From 133ac569c61bbe5a433f645a05978f267ca261f0 Mon Sep 17 00:00:00 2001 From: Andrea Bianco Date: Fri, 14 Jan 2022 18:30:05 +0100 Subject: [PATCH] Built motion from commit 61eb56d0.|2.6.0 --- 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.events.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 +- server/api/client-side-logs.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.oauth.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-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.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/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/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 +- server/utils/client-side-logger.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- 1169 files changed, 1169 insertions(+), 1169 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 9d57285..a5cfff7 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-14T17:05:03.298Z", + "time": "2022-01-14T17:19:28.477Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 5f32937..6da1c51 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-14T17:05:03.298Z", + "time": "2022-01-14T17:19:28.477Z", "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 20335af..2d72ffa 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 _0x3f81=['getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x3f81,0x1ca));var _0x13f8=function(_0x45761a,_0x594cb7){_0x45761a=_0x45761a-0x0;var _0x59143b=_0x3f81[_0x45761a];return _0x59143b;};'use strict';var Sequelize=require(_0x13f8('0x0'));module['exports']={'name':{'type':Sequelize[_0x13f8('0x1')],'get':function(_0x849b2d){return this[_0x13f8('0x2')](_0x13f8('0x3'));}},'action':{'type':Sequelize[_0x13f8('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x13f8('0x5'),_0x13f8('0x6'),_0x13f8('0x7'),_0x13f8('0x8'),_0x13f8('0x9'),_0x13f8('0xa'),_0x13f8('0xb'),_0x13f8('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x13f8('0xd')},'data1':{'type':Sequelize[_0x13f8('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x13f8('0x4')](0x1000),'comment':_0x13f8('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x13f8('0xf')},'data4':{'type':Sequelize[_0x13f8('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x13f8('0x4')](0x1000),'comments':_0x13f8('0x10')},'data6':{'type':Sequelize[_0x13f8('0x4')],'comments':_0x13f8('0x11')},'data7':{'type':Sequelize[_0x13f8('0x12')],'comments':_0x13f8('0x13')}}; \ No newline at end of file +var _0x0cba=['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)]','STRING','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]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x5a4ebf,_0x38d2b6){var _0x2c5589=function(_0x4ba420){while(--_0x4ba420){_0x5a4ebf['push'](_0x5a4ebf['shift']());}};_0x2c5589(++_0x38d2b6);}(_0x0cba,0x1d6));var _0xa0cb=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0x0cba[_0x114b7c];return _0x47185f;};'use strict';var Sequelize=require(_0xa0cb('0x0'));module[_0xa0cb('0x1')]={'name':{'type':Sequelize[_0xa0cb('0x2')],'get':function(_0x17fe0b){return this[_0xa0cb('0x3')](_0xa0cb('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xa0cb('0x5'),_0xa0cb('0x6'),_0xa0cb('0x7'),_0xa0cb('0x8'),'urlForward',_0xa0cb('0x9'),_0xa0cb('0xa'),_0xa0cb('0xb')]],'msg':_0xa0cb('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xa0cb('0xd')},'data2':{'type':Sequelize[_0xa0cb('0xe')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xa0cb('0xe')](0x1000),'comment':_0xa0cb('0xf')},'data4':{'type':Sequelize[_0xa0cb('0xe')](0x1000),'comments':_0xa0cb('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xa0cb('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0xa0cb('0x12')},'data7':{'type':Sequelize[_0xa0cb('0x13')],'comments':_0xa0cb('0x14')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 61dc76f..cceb24e 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 _0x169d=['params','body','catch','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x169d,0x18c));var _0xd169=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x169d[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xd169('0x0'));var rimraf=require(_0xd169('0x1'));var zipdir=require(_0xd169('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd169('0x3'));var moment=require(_0xd169('0x4'));var BPromise=require(_0xd169('0x5'));var Mustache=require(_0xd169('0x6'));var util=require('util');var path=require(_0xd169('0x7'));var sox=require('sox');var csv=require(_0xd169('0x8'));var ejs=require(_0xd169('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd169('0xa'));var squel=require(_0xd169('0xb'));var crypto=require(_0xd169('0xc'));var jsforce=require(_0xd169('0xd'));var deskjs=require(_0xd169('0xe'));var toCsv=require(_0xd169('0x8'));var querystring=require('querystring');var Papa=require(_0xd169('0xf'));var Redis=require(_0xd169('0x10'));var authService=require(_0xd169('0x11'));var qs=require(_0xd169('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd169('0x13'));var logger=require(_0xd169('0x14'))(_0xd169('0x15'));var utils=require(_0xd169('0x16'));var config=require(_0xd169('0x17'));var licenseUtil=require(_0xd169('0x18'));var db=require(_0xd169('0x19'))['db'];function respondWithStatusCode(_0x589759,_0x44e5f4){_0x44e5f4=_0x44e5f4||0xcc;return function(_0x27afd5){if(_0x27afd5){return _0x589759[_0xd169('0x1a')](_0x44e5f4);}return _0x589759[_0xd169('0x1b')](_0x44e5f4)[_0xd169('0x1c')]();};}function respondWithResult(_0x5a8ffc,_0x7985d3){_0x7985d3=_0x7985d3||0xc8;return function(_0x30feff){if(_0x30feff){return _0x5a8ffc['status'](_0x7985d3)[_0xd169('0x1d')](_0x30feff);}};}function respondWithFilteredResult(_0x5d6387,_0x17ea43){return function(_0x31166a){if(_0x31166a){var _0x532ded=typeof _0x17ea43[_0xd169('0x1e')]===_0xd169('0x1f')&&typeof _0x17ea43[_0xd169('0x20')]===_0xd169('0x1f');var _0x22d336=_0x31166a[_0xd169('0x21')];var _0x511c7f=_0x532ded?0x0:_0x17ea43[_0xd169('0x1e')];var _0x6425bd=_0x532ded?_0x31166a[_0xd169('0x21')]:_0x17ea43[_0xd169('0x1e')]+_0x17ea43[_0xd169('0x20')];var _0x2f565a;if(_0x6425bd>=_0x22d336){_0x6425bd=_0x22d336;_0x2f565a=0xc8;}else{_0x2f565a=0xce;}_0x5d6387[_0xd169('0x1b')](_0x2f565a);return _0x5d6387[_0xd169('0x22')](_0xd169('0x23'),_0x511c7f+'-'+_0x6425bd+'/'+_0x22d336)['json'](_0x31166a);}return null;};}function patchUpdates(_0x1d772f){return function(_0x2c95a2){try{jsonpatch[_0xd169('0x24')](_0x2c95a2,_0x1d772f,!![]);}catch(_0x5cc442){return BPromise['reject'](_0x5cc442);}return _0x2c95a2[_0xd169('0x25')]();};}function saveUpdates(_0x47ba48,_0x1e7023){return function(_0x4df4bf){if(_0x4df4bf){return _0x4df4bf[_0xd169('0x26')](_0x47ba48)[_0xd169('0x27')](function(_0x28000b){return _0x28000b;});}return null;};}function removeEntity(_0x272da2,_0x1da4b4){return function(_0x7b66f2){if(_0x7b66f2){return _0x7b66f2[_0xd169('0x28')]()[_0xd169('0x27')](function(){_0x272da2[_0xd169('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24a0dc,_0x4722b8){return function(_0x453e03){if(!_0x453e03){_0x24a0dc['sendStatus'](0x194);}return _0x453e03;};}function handleError(_0x9f52de,_0xfa3a32){_0xfa3a32=_0xfa3a32||0x1f4;return function(_0x363921){logger[_0xd169('0x29')](_0x363921[_0xd169('0x2a')]);if(_0x363921['name']){delete _0x363921[_0xd169('0x2b')];}_0x9f52de[_0xd169('0x1b')](_0xfa3a32)[_0xd169('0x2c')](_0x363921);};}exports['update']=function(_0x564fa8,_0x471205){if(_0x564fa8['body']['id']){delete _0x564fa8['body']['id'];}return db['Action']['find']({'where':{'id':_0x564fa8[_0xd169('0x2d')]['id']}})[_0xd169('0x27')](handleEntityNotFound(_0x471205,null))['then'](saveUpdates(_0x564fa8[_0xd169('0x2e')],null))[_0xd169('0x27')](respondWithResult(_0x471205,null))[_0xd169('0x2f')](handleError(_0x471205,null));};exports['destroy']=function(_0x56cacb,_0x58b38e){return db['Action'][_0xd169('0x30')]({'where':{'id':_0x56cacb[_0xd169('0x2d')]['id']}})[_0xd169('0x27')](handleEntityNotFound(_0x58b38e,null))['then'](removeEntity(_0x58b38e,null))['catch'](handleError(_0x58b38e,null));}; \ No newline at end of file +var _0x62f0=['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','count','limit','apply','save','destroy','then','stack','name','send','update','body','Action','find','catch','params','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','fs-extra','lodash','squel','jsforce'];(function(_0x551a90,_0x3b38fd){var _0x4a097b=function(_0x3e429b){while(--_0x3e429b){_0x551a90['push'](_0x551a90['shift']());}};_0x4a097b(++_0x3b38fd);}(_0x62f0,0x1b6));var _0x062f=function(_0xcb0eb2,_0x3906bf){_0xcb0eb2=_0xcb0eb2-0x0;var _0xbab9b8=_0x62f0[_0xcb0eb2];return _0xbab9b8;};'use strict';var emlformat=require(_0x062f('0x0'));var rimraf=require(_0x062f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x062f('0x2'));var rp=require('request-promise');var moment=require(_0x062f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x062f('0x4'));var util=require(_0x062f('0x5'));var path=require(_0x062f('0x6'));var sox=require(_0x062f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x062f('0x8'));var _=require(_0x062f('0x9'));var squel=require(_0x062f('0xa'));var crypto=require('crypto');var jsforce=require(_0x062f('0xb'));var deskjs=require(_0x062f('0xc'));var toCsv=require(_0x062f('0xd'));var querystring=require(_0x062f('0xe'));var Papa=require(_0x062f('0xf'));var Redis=require(_0x062f('0x10'));var authService=require(_0x062f('0x11'));var qs=require(_0x062f('0x12'));var as=require(_0x062f('0x13'));var hardwareService=require(_0x062f('0x14'));var logger=require(_0x062f('0x15'))(_0x062f('0x16'));var utils=require('../../config/utils');var config=require(_0x062f('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a285e,_0x3235f6){_0x3235f6=_0x3235f6||0xcc;return function(_0x5c68f3){if(_0x5c68f3){return _0x1a285e[_0x062f('0x18')](_0x3235f6);}return _0x1a285e[_0x062f('0x19')](_0x3235f6)[_0x062f('0x1a')]();};}function respondWithResult(_0x526371,_0x27925a){_0x27925a=_0x27925a||0xc8;return function(_0x2398e0){if(_0x2398e0){return _0x526371[_0x062f('0x19')](_0x27925a)[_0x062f('0x1b')](_0x2398e0);}};}function respondWithFilteredResult(_0x176287,_0x176772){return function(_0xd5266a){if(_0xd5266a){var _0x90f407=typeof _0x176772[_0x062f('0x1c')]===_0x062f('0x1d')&&typeof _0x176772['limit']===_0x062f('0x1d');var _0x7909cc=_0xd5266a['count'];var _0x2364c4=_0x90f407?0x0:_0x176772['offset'];var _0x41fa33=_0x90f407?_0xd5266a[_0x062f('0x1e')]:_0x176772['offset']+_0x176772[_0x062f('0x1f')];var _0x50b25b;if(_0x41fa33>=_0x7909cc){_0x41fa33=_0x7909cc;_0x50b25b=0xc8;}else{_0x50b25b=0xce;}_0x176287[_0x062f('0x19')](_0x50b25b);return _0x176287['set']('Content-Range',_0x2364c4+'-'+_0x41fa33+'/'+_0x7909cc)[_0x062f('0x1b')](_0xd5266a);}return null;};}function patchUpdates(_0x2cd5bf){return function(_0x4cc79c){try{jsonpatch[_0x062f('0x20')](_0x4cc79c,_0x2cd5bf,!![]);}catch(_0x468102){return BPromise['reject'](_0x468102);}return _0x4cc79c[_0x062f('0x21')]();};}function saveUpdates(_0xc4f89f,_0x1075e1){return function(_0x25723a){if(_0x25723a){return _0x25723a['update'](_0xc4f89f)['then'](function(_0x352cd4){return _0x352cd4;});}return null;};}function removeEntity(_0x28bbb0,_0x54d674){return function(_0x32f734){if(_0x32f734){return _0x32f734[_0x062f('0x22')]()[_0x062f('0x23')](function(){_0x28bbb0['status'](0xcc)[_0x062f('0x1a')]();});}};}function handleEntityNotFound(_0x48038a,_0x52a678){return function(_0x522c25){if(!_0x522c25){_0x48038a[_0x062f('0x18')](0x194);}return _0x522c25;};}function handleError(_0x22d2c8,_0x254da5){_0x254da5=_0x254da5||0x1f4;return function(_0x4a14e1){logger['error'](_0x4a14e1[_0x062f('0x24')]);if(_0x4a14e1[_0x062f('0x25')]){delete _0x4a14e1[_0x062f('0x25')];}_0x22d2c8[_0x062f('0x19')](_0x254da5)[_0x062f('0x26')](_0x4a14e1);};}exports[_0x062f('0x27')]=function(_0x5a6cc1,_0x61c525){if(_0x5a6cc1[_0x062f('0x28')]['id']){delete _0x5a6cc1[_0x062f('0x28')]['id'];}return db[_0x062f('0x29')][_0x062f('0x2a')]({'where':{'id':_0x5a6cc1['params']['id']}})[_0x062f('0x23')](handleEntityNotFound(_0x61c525,null))['then'](saveUpdates(_0x5a6cc1[_0x062f('0x28')],null))[_0x062f('0x23')](respondWithResult(_0x61c525,null))[_0x062f('0x2b')](handleError(_0x61c525,null));};exports[_0x062f('0x22')]=function(_0x35940d,_0x2e6c02){return db[_0x062f('0x29')][_0x062f('0x2a')]({'where':{'id':_0x35940d[_0x062f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2e6c02,null))['then'](removeEntity(_0x2e6c02,null))[_0x062f('0x2b')](handleError(_0x2e6c02,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 2d3755a..c392c96 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 _0x96db=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','Action','tools_actions'];(function(_0x16363b,_0x55063b){var _0x5b9897=function(_0x3bcac6){while(--_0x3bcac6){_0x16363b['push'](_0x16363b['shift']());}};_0x5b9897(++_0x55063b);}(_0x96db,0x13f));var _0xb96d=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x96db[_0x35af23];return _0x340506;};'use strict';var _=require(_0xb96d('0x0'));var util=require(_0xb96d('0x1'));var logger=require(_0xb96d('0x2'))('api');var moment=require(_0xb96d('0x3'));var BPromise=require(_0xb96d('0x4'));var rp=require(_0xb96d('0x5'));var fs=require('fs');var path=require(_0xb96d('0x6'));var rimraf=require(_0xb96d('0x7'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xb96d('0x8')]=function(_0x52fb33,_0xc5c913){return _0x52fb33['define'](_0xb96d('0x9'),attributes,{'tableName':_0xb96d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfde8=['Action','tools_actions','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define'];(function(_0x58a50e,_0x12a952){var _0x3b1e57=function(_0x47a31a){while(--_0x47a31a){_0x58a50e['push'](_0x58a50e['shift']());}};_0x3b1e57(++_0x12a952);}(_0xfde8,0x106));var _0x8fde=function(_0x552ce6,_0x4e7d8d){_0x552ce6=_0x552ce6-0x0;var _0x272ca6=_0xfde8[_0x552ce6];return _0x272ca6;};'use strict';var _=require(_0x8fde('0x0'));var util=require('util');var logger=require(_0x8fde('0x1'))(_0x8fde('0x2'));var moment=require(_0x8fde('0x3'));var BPromise=require('bluebird');var rp=require(_0x8fde('0x4'));var fs=require('fs');var path=require(_0x8fde('0x5'));var rimraf=require(_0x8fde('0x6'));var config=require(_0x8fde('0x7'));var attributes=require(_0x8fde('0x8'));module[_0x8fde('0x9')]=function(_0x475605,_0x4bd980){return _0x475605[_0x8fde('0xa')](_0x8fde('0xb'),attributes,{'tableName':_0x8fde('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index af696a8..c9bc7db 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4453f6,_0x197b53){_0x4453f6=_0x4453f6-0x0;var _0x1a85c0=_0x1cb9[_0x4453f6];return _0x1a85c0;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x4975,0x86));var _0x5497=function(_0x390e48,_0x534b13){_0x390e48=_0x390e48-0x0;var _0x43a37c=_0x4975[_0x390e48];return _0x43a37c;};'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')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index d123674..cdad4c2 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 _0xca0e=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path'];(function(_0x26bb15,_0x39b070){var _0x7aa58a=function(_0x25a1b6){while(--_0x25a1b6){_0x26bb15['push'](_0x26bb15['shift']());}};_0x7aa58a(++_0x39b070);}(_0xca0e,0x12f));var _0xeca0=function(_0x1d8e22,_0x442dd2){_0x1d8e22=_0x1d8e22-0x0;var _0x4ddd65=_0xca0e[_0x1d8e22];return _0x4ddd65;};'use strict';var multer=require(_0xeca0('0x0'));var util=require(_0xeca0('0x1'));var path=require(_0xeca0('0x2'));var timeout=require(_0xeca0('0x3'));var express=require(_0xeca0('0x4'));var router=express[_0xeca0('0x5')]();var fs_extra=require(_0xeca0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xeca0('0x7'));var config=require(_0xeca0('0x8'));var controller=require(_0xeca0('0x9'));router[_0xeca0('0xa')](_0xeca0('0xb'),auth[_0xeca0('0xc')](),controller[_0xeca0('0xd')]);router[_0xeca0('0xe')]('/:id',auth[_0xeca0('0xc')](),controller[_0xeca0('0xf')]);module[_0xeca0('0x10')]=router; \ No newline at end of file +var _0xa5df=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2e9658,_0x42e905){var _0x2c96a0=function(_0x33a8bd){while(--_0x33a8bd){_0x2e9658['push'](_0x2e9658['shift']());}};_0x2c96a0(++_0x42e905);}(_0xa5df,0x12c));var _0xfa5d=function(_0xe809e8,_0x527d41){_0xe809e8=_0xe809e8-0x0;var _0x446c4d=_0xa5df[_0xe809e8];return _0x446c4d;};'use strict';var multer=require('multer');var util=require(_0xfa5d('0x0'));var path=require(_0xfa5d('0x1'));var timeout=require(_0xfa5d('0x2'));var express=require(_0xfa5d('0x3'));var router=express[_0xfa5d('0x4')]();var fs_extra=require(_0xfa5d('0x5'));var auth=require(_0xfa5d('0x6'));var interaction=require(_0xfa5d('0x7'));var config=require(_0xfa5d('0x8'));var controller=require(_0xfa5d('0x9'));router[_0xfa5d('0xa')](_0xfa5d('0xb'),auth[_0xfa5d('0xc')](),controller[_0xfa5d('0xd')]);router[_0xfa5d('0xe')](_0xfa5d('0xb'),auth['isAuthenticated'](),controller[_0xfa5d('0xf')]);module[_0xfa5d('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 81ff022..5b7e76b 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 _0x207c=['STRING','TEXT','exports'];(function(_0x1192e1,_0x3b5aee){var _0x305a42=function(_0x551f8a){while(--_0x551f8a){_0x1192e1['push'](_0x1192e1['shift']());}};_0x305a42(++_0x3b5aee);}(_0x207c,0x1e8));var _0xc207=function(_0x9d58e0,_0x5ee515){_0x9d58e0=_0x9d58e0-0x0;var _0x5eab07=_0x207c[_0x9d58e0];return _0x5eab07;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'name':{'type':Sequelize[_0xc207('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc207('0x1')]},'parent':{'type':Sequelize[_0xc207('0x1')]},'table':{'type':Sequelize[_0xc207('0x1')]},'conditions':{'type':Sequelize[_0xc207('0x2')]},'joins':{'type':Sequelize[_0xc207('0x2')]}}; \ No newline at end of file +var _0x687b=['STRING','TEXT','sequelize','exports'];(function(_0x5cab87,_0x5751e9){var _0x2618c5=function(_0x17b71b){while(--_0x17b71b){_0x5cab87['push'](_0x5cab87['shift']());}};_0x2618c5(++_0x5751e9);}(_0x687b,0x14a));var _0xb687=function(_0x13891e,_0x4977fc){_0x13891e=_0x13891e-0x0;var _0x3d679a=_0x687b[_0x13891e];return _0x3d679a;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb687('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb687('0x3')]},'joins':{'type':Sequelize[_0xb687('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index a99dfd0..cc5332b 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 _0xf2d3=['apply','save','update','then','destroy','CustomReports','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','intersection','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_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)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','AnalyticMetric','keyBy','select','from','table','MetricId','function','format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','IS\x20NOT\x20NULL','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','replace','foreignKey','clone','output','web','fullPath','%s-%s.%s','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','right_join','cross_join','MIN(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','limit','undefined','count','offset','set','Content-Range'];(function(_0x4eb0b1,_0x1621ac){var _0x1b58bd=function(_0x30c4e5){while(--_0x30c4e5){_0x4eb0b1['push'](_0x4eb0b1['shift']());}};_0x1b58bd(++_0x1621ac);}(_0xf2d3,0x84));var _0x3f2d=function(_0x589b15,_0x1c28e3){_0x589b15=_0x589b15-0x0;var _0x36fe6b=_0xf2d3[_0x589b15];return _0x36fe6b;};'use strict';var emlformat=require(_0x3f2d('0x0'));var rimraf=require(_0x3f2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f2d('0x2'));var rp=require(_0x3f2d('0x3'));var moment=require(_0x3f2d('0x4'));var BPromise=require(_0x3f2d('0x5'));var Mustache=require(_0x3f2d('0x6'));var util=require(_0x3f2d('0x7'));var path=require(_0x3f2d('0x8'));var sox=require(_0x3f2d('0x9'));var csv=require('to-csv');var ejs=require(_0x3f2d('0xa'));var fs=require('fs');var fs_extra=require(_0x3f2d('0xb'));var _=require(_0x3f2d('0xc'));var squel=require('squel');var crypto=require(_0x3f2d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3f2d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3f2d('0xf'));var Redis=require(_0x3f2d('0x10'));var authService=require(_0x3f2d('0x11'));var qs=require(_0x3f2d('0x12'));var as=require(_0x3f2d('0x13'));var hardwareService=require(_0x3f2d('0x14'));var logger=require('../../config/logger')(_0x3f2d('0x15'));var utils=require(_0x3f2d('0x16'));var config=require(_0x3f2d('0x17'));var licenseUtil=require(_0x3f2d('0x18'));var db=require(_0x3f2d('0x19'))['db'];var dbH=require(_0x3f2d('0x19'))[_0x3f2d('0x1a')];function respondWithStatusCode(_0x127669,_0x398827){_0x398827=_0x398827||0xcc;return function(_0x4cd548){if(_0x4cd548){return _0x127669['sendStatus'](_0x398827);}return _0x127669[_0x3f2d('0x1b')](_0x398827)[_0x3f2d('0x1c')]();};}function respondWithResult(_0x33fe78,_0xb2d496){_0xb2d496=_0xb2d496||0xc8;return function(_0x4fc0f1){if(_0x4fc0f1){return _0x33fe78[_0x3f2d('0x1b')](_0xb2d496)[_0x3f2d('0x1d')](_0x4fc0f1);}};}function respondWithFilteredResult(_0x4f37b1,_0x12dc95){return function(_0x49e01d){if(_0x49e01d){var _0x5644f2=typeof _0x12dc95['offset']==='undefined'&&typeof _0x12dc95[_0x3f2d('0x1e')]===_0x3f2d('0x1f');var _0x25c7ab=_0x49e01d[_0x3f2d('0x20')];var _0x59af9a=_0x5644f2?0x0:_0x12dc95[_0x3f2d('0x21')];var _0x4d5def=_0x5644f2?_0x49e01d[_0x3f2d('0x20')]:_0x12dc95[_0x3f2d('0x21')]+_0x12dc95['limit'];var _0x38b142;if(_0x4d5def>=_0x25c7ab){_0x4d5def=_0x25c7ab;_0x38b142=0xc8;}else{_0x38b142=0xce;}_0x4f37b1[_0x3f2d('0x1b')](_0x38b142);return _0x4f37b1[_0x3f2d('0x22')](_0x3f2d('0x23'),_0x59af9a+'-'+_0x4d5def+'/'+_0x25c7ab)[_0x3f2d('0x1d')](_0x49e01d);}return null;};}function patchUpdates(_0x2ad771){return function(_0x43b128){try{jsonpatch[_0x3f2d('0x24')](_0x43b128,_0x2ad771,!![]);}catch(_0x83d495){return BPromise['reject'](_0x83d495);}return _0x43b128[_0x3f2d('0x25')]();};}function saveUpdates(_0xf8b215,_0x106a8f){return function(_0x47447e){if(_0x47447e){return _0x47447e[_0x3f2d('0x26')](_0xf8b215)[_0x3f2d('0x27')](function(_0x1e4882){return _0x1e4882;});}return null;};}function removeEntity(_0x327be7,_0x3142f6){return function(_0x538653){if(_0x538653){return _0x538653[_0x3f2d('0x28')]()[_0x3f2d('0x27')](function(){var _0x96b795=_0x538653['get']({'plain':!![]});var _0x4d0fe0=_0x3f2d('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x4d0fe0,'resourceId':_0x96b795['id']}})[_0x3f2d('0x27')](function(){return _0x538653;});})[_0x3f2d('0x27')](function(){_0x327be7[_0x3f2d('0x1b')](0xcc)[_0x3f2d('0x1c')]();});}};}function handleEntityNotFound(_0x16c22a,_0x50370a){return function(_0x1b0dda){if(!_0x1b0dda){_0x16c22a[_0x3f2d('0x2a')](0x194);}return _0x1b0dda;};}function handleError(_0x58cd13,_0x3fe110){_0x3fe110=_0x3fe110||0x1f4;return function(_0x45cdd0){logger[_0x3f2d('0x2b')](_0x45cdd0[_0x3f2d('0x2c')]);if(_0x45cdd0[_0x3f2d('0x2d')]){delete _0x45cdd0[_0x3f2d('0x2d')];}_0x58cd13[_0x3f2d('0x1b')](_0x3fe110)[_0x3f2d('0x2e')](_0x45cdd0);};}exports[_0x3f2d('0x2f')]=function(_0x133afd,_0x518306){var _0x351c66={},_0x3f9ed9={},_0xc06ebe={'count':0x0,'rows':[]};var _0x107633=_[_0x3f2d('0x30')](db[_0x3f2d('0x31')][_0x3f2d('0x32')],function(_0x3910bf){return{'name':_0x3910bf[_0x3f2d('0x33')],'type':_0x3910bf[_0x3f2d('0x34')][_0x3f2d('0x35')]};});_0x3f9ed9[_0x3f2d('0x36')]=_['map'](_0x107633,_0x3f2d('0x2d'));_0x3f9ed9['query']=_[_0x3f2d('0x37')](_0x133afd[_0x3f2d('0x38')]);_0x3f9ed9[_0x3f2d('0x39')]=_['intersection'](_0x3f9ed9['model'],_0x3f9ed9['query']);_0x351c66[_0x3f2d('0x3a')]=_['intersection'](_0x3f9ed9['model'],qs[_0x3f2d('0x3b')](_0x133afd['query'][_0x3f2d('0x3b')]));_0x351c66[_0x3f2d('0x3a')]=_0x351c66['attributes']['length']?_0x351c66['attributes']:_0x3f9ed9[_0x3f2d('0x36')];if(!_0x133afd[_0x3f2d('0x38')][_0x3f2d('0x3c')](_0x3f2d('0x3d'))){_0x351c66['limit']=qs[_0x3f2d('0x1e')](_0x133afd['query'][_0x3f2d('0x1e')]);_0x351c66[_0x3f2d('0x21')]=qs[_0x3f2d('0x21')](_0x133afd[_0x3f2d('0x38')]['offset']);}_0x351c66['order']=qs[_0x3f2d('0x3e')](_0x133afd[_0x3f2d('0x38')][_0x3f2d('0x3e')]);_0x351c66[_0x3f2d('0x3f')]=qs[_0x3f2d('0x39')](_['pick'](_0x133afd[_0x3f2d('0x38')],_0x3f9ed9[_0x3f2d('0x39')]),_0x107633);if(_0x133afd[_0x3f2d('0x38')][_0x3f2d('0x40')]){_0x351c66[_0x3f2d('0x3f')]=_['merge'](_0x351c66[_0x3f2d('0x3f')],{'$or':_[_0x3f2d('0x30')](_0x107633,function(_0x17ecd5){if(_0x17ecd5[_0x3f2d('0x34')]!=='VIRTUAL'){var _0x50bf6a={};_0x50bf6a[_0x17ecd5['name']]={'$like':'%'+_0x133afd[_0x3f2d('0x38')][_0x3f2d('0x40')]+'%'};return _0x50bf6a;}})});}_0x351c66=_[_0x3f2d('0x41')]({},_0x351c66,_0x133afd[_0x3f2d('0x42')]);var _0x3fdbf8={'where':_0x351c66[_0x3f2d('0x3f')]};return db[_0x3f2d('0x31')][_0x3f2d('0x20')](_0x3fdbf8)[_0x3f2d('0x27')](function(_0x4045fe){_0xc06ebe['count']=_0x4045fe;if(_0x133afd[_0x3f2d('0x38')][_0x3f2d('0x43')]){_0x351c66[_0x3f2d('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x3f2d('0x45')](_0x351c66);})[_0x3f2d('0x27')](function(_0x5c3a06){_0xc06ebe[_0x3f2d('0x46')]=_0x5c3a06;return _0xc06ebe;})['then'](respondWithFilteredResult(_0x518306,_0x351c66))[_0x3f2d('0x47')](handleError(_0x518306,null));};exports['show']=function(_0x345c67,_0x511723){var _0x1c7921={'raw':![],'where':{'id':_0x345c67['params']['id']}},_0x411bda={};_0x411bda[_0x3f2d('0x36')]=_[_0x3f2d('0x37')](db[_0x3f2d('0x31')]['rawAttributes']);_0x411bda[_0x3f2d('0x38')]=_['keys'](_0x345c67[_0x3f2d('0x38')]);_0x411bda['filters']=_[_0x3f2d('0x48')](_0x411bda[_0x3f2d('0x36')],_0x411bda[_0x3f2d('0x38')]);_0x1c7921['attributes']=_[_0x3f2d('0x48')](_0x411bda['model'],qs[_0x3f2d('0x3b')](_0x345c67[_0x3f2d('0x38')][_0x3f2d('0x3b')]));_0x1c7921[_0x3f2d('0x3a')]=_0x1c7921[_0x3f2d('0x3a')][_0x3f2d('0x49')]?_0x1c7921[_0x3f2d('0x3a')]:_0x411bda[_0x3f2d('0x36')];if(_0x345c67[_0x3f2d('0x38')][_0x3f2d('0x43')]){_0x1c7921[_0x3f2d('0x44')]=[{'all':!![]}];}_0x1c7921=_[_0x3f2d('0x41')]({},_0x1c7921,_0x345c67[_0x3f2d('0x42')]);return db[_0x3f2d('0x31')][_0x3f2d('0x4a')](_0x1c7921)['then'](handleEntityNotFound(_0x511723,null))[_0x3f2d('0x27')](respondWithResult(_0x511723,null))[_0x3f2d('0x47')](handleError(_0x511723,null));};exports[_0x3f2d('0x4b')]=function(_0x17fb2f,_0x166a5c){return db['AnalyticCustomReport'][_0x3f2d('0x4b')](_0x17fb2f[_0x3f2d('0x4c')],{})['then'](function(_0x248e0c){var _0xc86979=_0x17fb2f['user'][_0x3f2d('0x4d')]({'plain':!![]});if(!_0xc86979)throw new Error(_0x3f2d('0x4e'));if(_0xc86979[_0x3f2d('0x4f')]==='user'){var _0x340a4a=_0x248e0c[_0x3f2d('0x4d')]({'plain':!![]});var _0x19629a=_0x3f2d('0x50');return db[_0x3f2d('0x51')]['find']({'where':{'name':_0x19629a,'userProfileId':_0xc86979['userProfileId']},'raw':!![]})[_0x3f2d('0x27')](function(_0x556587){if(_0x556587&&_0x556587[_0x3f2d('0x52')]===0x0){return db[_0x3f2d('0x53')][_0x3f2d('0x4b')]({'name':_0x340a4a[_0x3f2d('0x2d')],'resourceId':_0x340a4a['id'],'type':_0x3f2d('0x29'),'sectionId':_0x556587['id']},{})[_0x3f2d('0x27')](function(){return _0x248e0c;});}else{return _0x248e0c;}})[_0x3f2d('0x47')](function(_0x317cfb){logger[_0x3f2d('0x2b')](_0x3f2d('0x54'),_0x317cfb);throw _0x317cfb;});}return _0x248e0c;})[_0x3f2d('0x27')](respondWithResult(_0x166a5c,0xc9))[_0x3f2d('0x47')](handleError(_0x166a5c,null));};exports['update']=function(_0x38fa71,_0x539c39){if(_0x38fa71['body']['id']){delete _0x38fa71[_0x3f2d('0x4c')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x38fa71[_0x3f2d('0x55')]['id']}})['then'](handleEntityNotFound(_0x539c39,null))[_0x3f2d('0x27')](saveUpdates(_0x38fa71[_0x3f2d('0x4c')],null))[_0x3f2d('0x27')](respondWithResult(_0x539c39,null))[_0x3f2d('0x47')](handleError(_0x539c39,null));};exports[_0x3f2d('0x28')]=function(_0x3bc2a5,_0x143924){return db[_0x3f2d('0x31')]['find']({'where':{'id':_0x3bc2a5[_0x3f2d('0x55')]['id']}})['then'](handleEntityNotFound(_0x143924,null))['then'](removeEntity(_0x143924,null))['catch'](handleError(_0x143924,null));};exports[_0x3f2d('0x56')]=function(_0xbc582c,_0x125400){var _0x42eaeb=0xa;var _0x31df3a=[_0x3f2d('0x57'),_0x3f2d('0x58'),'right_join','cross_join'];var _0x3d3a3e={'SUM':'SUM(%s)','COUNT':_0x3f2d('0x59'),'COUNT DISTINCT':_0x3f2d('0x5a'),'MAX':_0x3f2d('0x5b'),'MIN':'MIN(%s)','AVG':_0x3f2d('0x5c'),'GROUP_CONCAT':_0x3f2d('0x5d'),'GROUP_CONCAT ASC':_0x3f2d('0x5e'),'GROUP_CONCAT DESC':_0x3f2d('0x5f')};var _0x18e008={'SEC_TO_TIME':_0x3f2d('0x60'),'DATE':_0x3f2d('0x61'),'HOUR':_0x3f2d('0x62'),'ROUND':_0x3f2d('0x63'),'UNIX_TIMESTAMP':_0x3f2d('0x64')};var _0x363a39=function(_0x1d5f1a){return!_[_0x3f2d('0x65')]([_0x3f2d('0x66'),'IS\x20NOT\x20NULL',_0x3f2d('0x67'),_0x3f2d('0x68')],_0x1d5f1a);};var _0x3d4ca2=function(_0x3f3fa9){if(!_0x3f3fa9||!_0x3f3fa9[_0x3f2d('0x69')][_0x3f2d('0x49')]){return'';}for(var _0x557380='(',_0x629d83=0x0;_0x629d83<_0x3f3fa9[_0x3f2d('0x69')][_0x3f2d('0x49')];_0x629d83+=0x1){_0x629d83>0x0&&(_0x557380+='\x20'+_0x3f3fa9[_0x3f2d('0x6a')]+'\x20');_0x557380+=_0x3f3fa9['rules'][_0x629d83]['group']?_0x3d4ca2(_0x3f3fa9[_0x3f2d('0x69')][_0x629d83][_0x3f2d('0x6b')]):_0x3f3fa9[_0x3f2d('0x69')][_0x629d83][_0x3f2d('0x6c')]+'\x20'+_0x3f3fa9[_0x3f2d('0x69')][_0x629d83]['condition']+(_0x363a39(_0x3f3fa9[_0x3f2d('0x69')][_0x629d83]['condition'])?'\x20'+_0x3f3fa9[_0x3f2d('0x69')][_0x629d83][_0x3f2d('0x6d')]:'');}return _0x557380+')';};var _0x1863b6={'where':{'id':_0xbc582c[_0x3f2d('0x55')]['id']}},_0x27fe3a,_0x40b6fd,_0x563e13,_0x2bc001,_0x2c2e6b;_0x1863b6=_[_0x3f2d('0x41')]({},_0x1863b6,_0xbc582c[_0x3f2d('0x42')]);return db[_0x3f2d('0x31')]['find'](_0x1863b6)[_0x3f2d('0x27')](function(_0x2de25c){if(_0x2de25c){_0x27fe3a=_0x2de25c;return _0x2de25c[_0x3f2d('0x6e')]();}return null;})[_0x3f2d('0x27')](function(_0x5e2356){if(_0x5e2356){if(!_0x5e2356[_0x3f2d('0x49')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x40b6fd=_0x5e2356;return db[_0x3f2d('0x6f')][_0x3f2d('0x45')]({'raw':!![]});}return null;})[_0x3f2d('0x27')](function(_0xa9efd){if(_0xa9efd){_0x563e13=_[_0x3f2d('0x70')](_0xa9efd,'id');var _0x2c9564;var _0x1be73f=squel[_0x3f2d('0x71')]();_0x1be73f[_0x3f2d('0x72')](_0x27fe3a[_0x3f2d('0x73')]);for(var _0x3ed97e=0x0;_0x3ed97e<_0x40b6fd[_0x3f2d('0x49')];_0x3ed97e+=0x1){_0x2c9564=_0x40b6fd[_0x3ed97e]['MetricId']?_0x563e13[_0x40b6fd[_0x3ed97e][_0x3f2d('0x74')]]['metric']:_0x40b6fd[_0x3ed97e][_0x3f2d('0x6c')];_0x2c9564=_0x40b6fd[_0x3ed97e][_0x3f2d('0x75')]?_['replace'](_0x3d3a3e[_0x40b6fd[_0x3ed97e][_0x3f2d('0x75')]],'%s',_0x2c9564):_0x2c9564;_0x2c9564=_0x40b6fd[_0x3ed97e][_0x3f2d('0x76')]?_['replace'](_0x18e008[_0x40b6fd[_0x3ed97e][_0x3f2d('0x76')]],'%s',_0x2c9564):_0x2c9564;if(_0x40b6fd[_0x3ed97e][_0x3f2d('0x77')]){_0x1be73f[_0x3f2d('0x6b')](_0x2c9564);}_0x40b6fd[_0x3ed97e][_0x3f2d('0x78')]&&_0x1be73f[_0x3f2d('0x79')](_0x2c9564,_0x40b6fd[_0x3ed97e][_0x3f2d('0x78')]===_0x3f2d('0x7a')?![]:!![]);_0x1be73f[_0x3f2d('0x6c')](_0x2c9564,_0x40b6fd[_0x3ed97e][_0x3f2d('0x7b')]||_0x2c9564);}if(_0x27fe3a[_0x3f2d('0x7c')]){_0x27fe3a[_0x3f2d('0x7c')]=JSON[_0x3f2d('0x7d')](_0x27fe3a[_0x3f2d('0x7c')]);for(var _0x69244a=0x0;_0x69244a<_0x27fe3a[_0x3f2d('0x7c')][_0x3f2d('0x49')];_0x69244a+=0x1){if(_0x27fe3a['joins'][_0x69244a][_0x3f2d('0x34')]&&_[_0x3f2d('0x65')](_0x31df3a,_0x27fe3a[_0x3f2d('0x7c')][_0x69244a]['type'])&&_0x27fe3a[_0x3f2d('0x7c')][_0x69244a][_0x3f2d('0x7e')]&&_0x27fe3a[_0x3f2d('0x7c')][_0x69244a][_0x3f2d('0x7f')]&&_0x27fe3a[_0x3f2d('0x7c')][_0x69244a]['foreignKey']){_0x1be73f[_0x27fe3a[_0x3f2d('0x7c')][_0x69244a]['type']](_0x27fe3a[_0x3f2d('0x7c')][_0x69244a][_0x3f2d('0x7f')],null,util[_0x3f2d('0x76')](_0x3f2d('0x80'),_0x27fe3a[_0x3f2d('0x73')],_0x27fe3a[_0x3f2d('0x7c')][_0x69244a]['parentKey'],_0x27fe3a[_0x3f2d('0x7c')][_0x69244a]['foreignTable'],_0x27fe3a['joins'][_0x69244a]['foreignKey']));}}}if(_0x27fe3a[_0x3f2d('0x81')]){_0x27fe3a[_0x3f2d('0x81')]=JSON[_0x3f2d('0x7d')](_0x27fe3a['conditions']);_0x1be73f[_0x3f2d('0x3f')](_0x3d4ca2(_0x27fe3a[_0x3f2d('0x81')][_0x3f2d('0x6b')]));}_0x2c2e6b=_0x1be73f['clone']();_0x1be73f[_0x3f2d('0x1e')](_0x42eaeb);_0x1be73f[_0x3f2d('0x21')](0x0);logger['debug'](_0x3f2d('0x82'),_0x1be73f[_0x3f2d('0x83')]());return dbH[_0x3f2d('0x84')][_0x3f2d('0x38')](_0x1be73f[_0x3f2d('0x83')](),{'type':dbH['sequelize'][_0x3f2d('0x85')]['SELECT']});}})[_0x3f2d('0x27')](respondWithResult(_0x125400,null))[_0x3f2d('0x47')](handleError(_0x125400,null));};function runReport(_0x32a3bd,_0x58001d,_0x32317d){var _0x43bad8=_0x58001d['name'];var _0xd80bde=0xa;var _0x2b2a37=['join',_0x3f2d('0x58'),'right_join','cross_join'];var _0x5b8aef={'SUM':_0x3f2d('0x86'),'COUNT':_0x3f2d('0x59'),'COUNT DISTINCT':_0x3f2d('0x5a'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x3f2d('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3f2d('0x5f')};var _0x628260={'SEC_TO_TIME':_0x3f2d('0x60'),'DATE':_0x3f2d('0x61'),'HOUR':_0x3f2d('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3f2d('0x64')};var _0x483b3f=function(_0xa3f667){return!_[_0x3f2d('0x65')]([_0x3f2d('0x66'),_0x3f2d('0x87'),_0x3f2d('0x67'),'IS\x20NOT\x20EMPTY'],_0xa3f667);};var _0xb7a1a2=function(_0x4d9978){if(!_0x4d9978||!_0x4d9978[_0x3f2d('0x69')][_0x3f2d('0x49')]){return'';}for(var _0x5b75fc='(',_0x557496=0x0;_0x557496<_0x4d9978[_0x3f2d('0x69')]['length'];_0x557496+=0x1){_0x557496>0x0&&(_0x5b75fc+='\x20'+_0x4d9978[_0x3f2d('0x6a')]+'\x20');_0x5b75fc+=_0x4d9978[_0x3f2d('0x69')][_0x557496][_0x3f2d('0x6b')]?_0xb7a1a2(_0x4d9978[_0x3f2d('0x69')][_0x557496][_0x3f2d('0x6b')]):_0x4d9978[_0x3f2d('0x69')][_0x557496]['field']+'\x20'+_0x4d9978[_0x3f2d('0x69')][_0x557496]['condition']+(_0x483b3f(_0x4d9978['rules'][_0x557496][_0x3f2d('0x88')])?'\x20'+_0x4d9978[_0x3f2d('0x69')][_0x557496][_0x3f2d('0x6d')]:'');}return _0x5b75fc+')';};var _0x5bfe04={'where':{'id':_0x32a3bd['id']}},_0x474f28,_0x18f4b5,_0x5ac43d,_0x215dfd,_0x4567d8;_0x5bfe04=_[_0x3f2d('0x41')]({},_0x5bfe04,_0x32317d);return db[_0x3f2d('0x31')][_0x3f2d('0x4a')](_0x5bfe04)['then'](function(_0x5d124d){if(_0x5d124d){_0x474f28=_0x5d124d;return _0x5d124d[_0x3f2d('0x6e')]();}return null;})['then'](function(_0x398e0c){if(_0x398e0c){if(!_0x398e0c[_0x3f2d('0x49')]){throw new db[(_0x3f2d('0x89'))][(_0x3f2d('0x8a'))](_0x3f2d('0x8b'),0x193);}_0x18f4b5=_0x398e0c;return db[_0x3f2d('0x6f')][_0x3f2d('0x45')]({'raw':!![]});}return null;})['then'](function(_0xbc13c3){if(_0xbc13c3){_0x5ac43d=_[_0x3f2d('0x70')](_0xbc13c3,'id');var _0xbc5eef;var _0x4ba8c0=squel[_0x3f2d('0x71')]();_0x4ba8c0['from'](_0x474f28[_0x3f2d('0x73')]);for(var _0x1b0916=0x0;_0x1b0916<_0x18f4b5[_0x3f2d('0x49')];_0x1b0916+=0x1){_0xbc5eef=_0x18f4b5[_0x1b0916][_0x3f2d('0x74')]?_0x5ac43d[_0x18f4b5[_0x1b0916][_0x3f2d('0x74')]][_0x3f2d('0x8c')]:_0x18f4b5[_0x1b0916]['field'];_0xbc5eef=_0x18f4b5[_0x1b0916]['function']?_[_0x3f2d('0x8d')](_0x5b8aef[_0x18f4b5[_0x1b0916][_0x3f2d('0x75')]],'%s',_0xbc5eef):_0xbc5eef;_0xbc5eef=_0x18f4b5[_0x1b0916]['format']?_[_0x3f2d('0x8d')](_0x628260[_0x18f4b5[_0x1b0916][_0x3f2d('0x76')]],'%s',_0xbc5eef):_0xbc5eef;if(_0x18f4b5[_0x1b0916][_0x3f2d('0x77')]){_0x4ba8c0[_0x3f2d('0x6b')](_0xbc5eef);}_0x18f4b5[_0x1b0916][_0x3f2d('0x78')]&&_0x4ba8c0[_0x3f2d('0x79')](_0xbc5eef,_0x18f4b5[_0x1b0916][_0x3f2d('0x78')]===_0x3f2d('0x7a')?![]:!![]);_0x4ba8c0['field'](_0xbc5eef,_0x18f4b5[_0x1b0916][_0x3f2d('0x7b')]||_0xbc5eef);}if(_0x474f28[_0x3f2d('0x7c')]){_0x474f28[_0x3f2d('0x7c')]=JSON[_0x3f2d('0x7d')](_0x474f28[_0x3f2d('0x7c')]);for(var _0x41e0cd=0x0;_0x41e0cd<_0x474f28['joins']['length'];_0x41e0cd+=0x1){if(_0x474f28[_0x3f2d('0x7c')][_0x41e0cd]['type']&&_[_0x3f2d('0x65')](_0x2b2a37,_0x474f28[_0x3f2d('0x7c')][_0x41e0cd][_0x3f2d('0x34')])&&_0x474f28[_0x3f2d('0x7c')][_0x41e0cd][_0x3f2d('0x7e')]&&_0x474f28[_0x3f2d('0x7c')][_0x41e0cd]['foreignTable']&&_0x474f28[_0x3f2d('0x7c')][_0x41e0cd]['foreignKey']){_0x4ba8c0[_0x474f28[_0x3f2d('0x7c')][_0x41e0cd][_0x3f2d('0x34')]](_0x474f28[_0x3f2d('0x7c')][_0x41e0cd][_0x3f2d('0x7f')],null,util[_0x3f2d('0x76')](_0x3f2d('0x80'),_0x474f28[_0x3f2d('0x73')],_0x474f28[_0x3f2d('0x7c')][_0x41e0cd][_0x3f2d('0x7e')],_0x474f28[_0x3f2d('0x7c')][_0x41e0cd][_0x3f2d('0x7f')],_0x474f28[_0x3f2d('0x7c')][_0x41e0cd][_0x3f2d('0x8e')]));}}}if(_0x474f28[_0x3f2d('0x81')]){_0x474f28['conditions']=JSON[_0x3f2d('0x7d')](_0x474f28['conditions']);_0x4ba8c0[_0x3f2d('0x3f')](_0xb7a1a2(_0x474f28['conditions'][_0x3f2d('0x6b')]));}_0x4567d8=_0x4ba8c0[_0x3f2d('0x8f')]();_0x4ba8c0[_0x3f2d('0x1e')](_0xd80bde);_0x4ba8c0[_0x3f2d('0x21')](0x0);return;}})[_0x3f2d('0x27')](function(){if(_0x58001d[_0x3f2d('0x90')]===_0x3f2d('0x91')){return null;}var _0x3413ee=_['merge'](_0x58001d,{'name':_0x58001d[_0x3f2d('0x92')]||_0x58001d['name']||_0x474f28['name'],'basename':_0x43bad8,'savename':util[_0x3f2d('0x76')](_0x3f2d('0x93'),_0x58001d[_0x3f2d('0x2d')]||_0x474f28[_0x3f2d('0x2d')],require('randomstring')['generate'](0x4),_0x58001d[_0x3f2d('0x90')]||_0x3f2d('0x94')),'reportId':_0x474f28['id'],'reportType':_0x3f2d('0x95')});return db[_0x3f2d('0x96')][_0x3f2d('0x4b')](_0x3413ee,{'raw':!![]});})[_0x3f2d('0x27')](function(_0x383b0e){if(_0x474f28['table']===_0x3f2d('0x97')){_0x4567d8[_0x3f2d('0x3f')](_0x474f28[_0x3f2d('0x73')]+_0x3f2d('0x98'),_0x58001d[_0x3f2d('0x99')],_0x58001d[_0x3f2d('0x9a')]);}else{_0x4567d8['where'](_0x474f28[_0x3f2d('0x73')]+_0x3f2d('0x9b'),_0x58001d['startDate'],_0x58001d[_0x3f2d('0x9a')]);}if(_0x383b0e){logger['info'](_0x3f2d('0x9c'),_0x4567d8[_0x3f2d('0x83')]());require('child_process')['fork'](path[_0x3f2d('0x57')](__dirname,_0x3f2d('0x9d'),_0x383b0e['output']),[_0x383b0e['id'],_0x4567d8[_0x3f2d('0x83')](),path['join'](__dirname,_0x3f2d('0x9e'),_0x383b0e[_0x3f2d('0x9f')]),_0x43bad8]);return _0x383b0e;}else{var _0x1ecf61=squel[_0x3f2d('0x71')]();_0x1ecf61[_0x3f2d('0x72')]('('+_0x4567d8[_0x3f2d('0x83')]()+')',_0x3f2d('0xa0'));_0x1ecf61[_0x3f2d('0x6c')](_0x3f2d('0xa1'),_0x3f2d('0x20'));_0x4567d8[_0x3f2d('0x1e')](_0x58001d['limit']||_0xd80bde);_0x4567d8[_0x3f2d('0x21')](_0x58001d['offset']||0x0);return dbH[_0x3f2d('0x84')][_0x3f2d('0x38')](_0x1ecf61[_0x3f2d('0x83')](),{'type':dbH['sequelize'][_0x3f2d('0x85')][_0x3f2d('0xa2')]})[_0x3f2d('0x27')](function(_0x4b4491){if(!_0x4b4491[_0x3f2d('0x49')]){_0x215dfd=0x0;}else{_0x215dfd=_0x4b4491[0x0][_0x3f2d('0x20')]||0x0;}return dbH[_0x3f2d('0x84')]['query'](_0x4567d8['toString'](),{'type':dbH[_0x3f2d('0x84')][_0x3f2d('0x85')][_0x3f2d('0xa2')]});})[_0x3f2d('0x27')](function(_0x4d2b26){return{'rows':_0x4d2b26||[],'count':_0x215dfd};});}});}exports[_0x3f2d('0xa3')]=function(_0x3f83cb,_0x431484){return runReport(_0x3f83cb[_0x3f2d('0x55')],_0x3f83cb['query'],_0x3f83cb[_0x3f2d('0x42')])['then'](respondWithResult(_0x431484,null))[_0x3f2d('0x47')](handleError(_0x431484,null));};exports[_0x3f2d('0xa4')]=runReport;exports[_0x3f2d('0x38')]=function(_0x2dcd4,_0x48adb2){var _0x10a8cf=0xa;var _0x33a634=[_0x3f2d('0x57'),_0x3f2d('0x58'),_0x3f2d('0xa5'),_0x3f2d('0xa6')];var _0x4d1408={'SUM':_0x3f2d('0x86'),'COUNT':_0x3f2d('0x59'),'COUNT DISTINCT':_0x3f2d('0x5a'),'MAX':_0x3f2d('0x5b'),'MIN':_0x3f2d('0xa7'),'AVG':_0x3f2d('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3f2d('0x5e'),'GROUP_CONCAT DESC':_0x3f2d('0x5f')};var _0x226a75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x3f2d('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3f2d('0x64')};var _0x3af659=function(_0x1b924f){return!_[_0x3f2d('0x65')]([_0x3f2d('0x66'),_0x3f2d('0x87'),_0x3f2d('0x67'),_0x3f2d('0x68')],_0x1b924f);};var _0x43ae32=function(_0x3cd0a2){if(!_0x3cd0a2||!_0x3cd0a2[_0x3f2d('0x69')][_0x3f2d('0x49')]){return'';}for(var _0x295eca='(',_0x17e2e7=0x0;_0x17e2e7<_0x3cd0a2[_0x3f2d('0x69')][_0x3f2d('0x49')];_0x17e2e7+=0x1){_0x17e2e7>0x0&&(_0x295eca+='\x20'+_0x3cd0a2[_0x3f2d('0x6a')]+'\x20');_0x295eca+=_0x3cd0a2[_0x3f2d('0x69')][_0x17e2e7]['group']?_0x43ae32(_0x3cd0a2[_0x3f2d('0x69')][_0x17e2e7][_0x3f2d('0x6b')]):_0x3cd0a2['rules'][_0x17e2e7]['field']+'\x20'+_0x3cd0a2[_0x3f2d('0x69')][_0x17e2e7][_0x3f2d('0x88')]+(_0x3af659(_0x3cd0a2[_0x3f2d('0x69')][_0x17e2e7]['condition'])?'\x20'+_0x3cd0a2[_0x3f2d('0x69')][_0x17e2e7][_0x3f2d('0x6d')]:'');}return _0x295eca+')';};var _0x1be564={'where':{'id':_0x2dcd4[_0x3f2d('0x55')]['id']}},_0x2c053d,_0x147d7f,_0x1afea7,_0x322bfe,_0x1dda59;_0x1be564=_['merge']({},_0x1be564,_0x2dcd4[_0x3f2d('0x42')]);return db[_0x3f2d('0x31')][_0x3f2d('0x4a')](_0x1be564)[_0x3f2d('0x27')](function(_0x5e58fa){if(_0x5e58fa){_0x2c053d=_0x5e58fa;return _0x5e58fa[_0x3f2d('0x6e')]();}return null;})[_0x3f2d('0x27')](function(_0x36f394){if(_0x36f394){if(!_0x36f394['length']){throw new db[(_0x3f2d('0x89'))][(_0x3f2d('0x8a'))](_0x3f2d('0x8b'),0x193);}_0x147d7f=_0x36f394;return db['AnalyticMetric'][_0x3f2d('0x45')]({'raw':!![]});}return null;})[_0x3f2d('0x27')](function(_0x20a4ac){if(_0x20a4ac){_0x1afea7=_[_0x3f2d('0x70')](_0x20a4ac,'id');var _0x59b496;var _0x2fd765=squel[_0x3f2d('0x71')]();_0x2fd765['from'](_0x2c053d[_0x3f2d('0x73')]);for(var _0x417314=0x0;_0x417314<_0x147d7f['length'];_0x417314+=0x1){_0x59b496=_0x147d7f[_0x417314][_0x3f2d('0x74')]?_0x1afea7[_0x147d7f[_0x417314][_0x3f2d('0x74')]][_0x3f2d('0x8c')]:_0x147d7f[_0x417314][_0x3f2d('0x6c')];_0x59b496=_0x147d7f[_0x417314][_0x3f2d('0x75')]?_[_0x3f2d('0x8d')](_0x4d1408[_0x147d7f[_0x417314][_0x3f2d('0x75')]],'%s',_0x59b496):_0x59b496;_0x59b496=_0x147d7f[_0x417314]['format']?_[_0x3f2d('0x8d')](_0x226a75[_0x147d7f[_0x417314]['format']],'%s',_0x59b496):_0x59b496;if(_0x147d7f[_0x417314][_0x3f2d('0x77')]){_0x2fd765[_0x3f2d('0x6b')](_0x59b496);}_0x147d7f[_0x417314]['orderBy']&&_0x2fd765['order'](_0x59b496,_0x147d7f[_0x417314][_0x3f2d('0x78')]===_0x3f2d('0x7a')?![]:!![]);_0x2fd765[_0x3f2d('0x6c')](_0x59b496,_0x147d7f[_0x417314][_0x3f2d('0x7b')]||_0x59b496);}if(_0x2c053d[_0x3f2d('0x7c')]){_0x2c053d[_0x3f2d('0x7c')]=JSON[_0x3f2d('0x7d')](_0x2c053d[_0x3f2d('0x7c')]);for(var _0x299dc3=0x0;_0x299dc3<_0x2c053d[_0x3f2d('0x7c')]['length'];_0x299dc3+=0x1){if(_0x2c053d['joins'][_0x299dc3][_0x3f2d('0x34')]&&_[_0x3f2d('0x65')](_0x33a634,_0x2c053d[_0x3f2d('0x7c')][_0x299dc3][_0x3f2d('0x34')])&&_0x2c053d[_0x3f2d('0x7c')][_0x299dc3][_0x3f2d('0x7e')]&&_0x2c053d[_0x3f2d('0x7c')][_0x299dc3][_0x3f2d('0x7f')]&&_0x2c053d[_0x3f2d('0x7c')][_0x299dc3][_0x3f2d('0x8e')]){_0x2fd765[_0x2c053d[_0x3f2d('0x7c')][_0x299dc3]['type']](_0x2c053d[_0x3f2d('0x7c')][_0x299dc3][_0x3f2d('0x7f')],null,util[_0x3f2d('0x76')](_0x3f2d('0x80'),_0x2c053d[_0x3f2d('0x73')],_0x2c053d[_0x3f2d('0x7c')][_0x299dc3][_0x3f2d('0x7e')],_0x2c053d[_0x3f2d('0x7c')][_0x299dc3][_0x3f2d('0x7f')],_0x2c053d[_0x3f2d('0x7c')][_0x299dc3][_0x3f2d('0x8e')]));}}}if(_0x2c053d[_0x3f2d('0x81')]){_0x2c053d[_0x3f2d('0x81')]=JSON[_0x3f2d('0x7d')](_0x2c053d[_0x3f2d('0x81')]);_0x2fd765[_0x3f2d('0x3f')](_0x43ae32(_0x2c053d[_0x3f2d('0x81')][_0x3f2d('0x6b')]));}_0x1dda59=_0x2fd765[_0x3f2d('0x8f')]();_0x2fd765[_0x3f2d('0x1e')](_0x10a8cf);_0x2fd765['offset'](0x0);logger['debug'](_0x3f2d('0x82'),_0x2fd765[_0x3f2d('0x83')]());return dbH[_0x3f2d('0x84')][_0x3f2d('0x38')](_0x2fd765[_0x3f2d('0x83')](),{'type':dbH[_0x3f2d('0x84')][_0x3f2d('0x85')][_0x3f2d('0xa2')]});}})[_0x3f2d('0x27')](function(){return{'sql':_0x1dda59[_0x3f2d('0x83')]()};})[_0x3f2d('0x27')](respondWithResult(_0x48adb2,null))[_0x3f2d('0x47')](handleError(_0x48adb2,null));}; \ No newline at end of file +var _0x558c=['GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','metric','foreignKey','clone','output','web','fullPath','%s-%s.%s','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','select','countTable','QueryTypes','run','runReport','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','set','json','reject','destroy','then','get','CustomReports','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','cross_join','COUNT(DISTINCT\x20%s)'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x558c,0xbc));var _0xc558=function(_0x2e45bb,_0x5225f5){_0x2e45bb=_0x2e45bb-0x0;var _0x33e880=_0x558c[_0x2e45bb];return _0x33e880;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc558('0x0'));var jsonpatch=require(_0xc558('0x1'));var rp=require(_0xc558('0x2'));var moment=require(_0xc558('0x3'));var BPromise=require(_0xc558('0x4'));var Mustache=require('mustache');var util=require(_0xc558('0x5'));var path=require('path');var sox=require(_0xc558('0x6'));var csv=require('to-csv');var ejs=require(_0xc558('0x7'));var fs=require('fs');var fs_extra=require(_0xc558('0x8'));var _=require(_0xc558('0x9'));var squel=require(_0xc558('0xa'));var crypto=require(_0xc558('0xb'));var jsforce=require(_0xc558('0xc'));var deskjs=require(_0xc558('0xd'));var toCsv=require(_0xc558('0xe'));var querystring=require('querystring');var Papa=require(_0xc558('0xf'));var Redis=require('ioredis');var authService=require(_0xc558('0x10'));var qs=require(_0xc558('0x11'));var as=require(_0xc558('0x12'));var hardwareService=require(_0xc558('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xc558('0x14'));var config=require(_0xc558('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0xc558('0x16'))['dbH'];function respondWithStatusCode(_0x256924,_0x31ef2b){_0x31ef2b=_0x31ef2b||0xcc;return function(_0x5edc14){if(_0x5edc14){return _0x256924[_0xc558('0x17')](_0x31ef2b);}return _0x256924['status'](_0x31ef2b)[_0xc558('0x18')]();};}function respondWithResult(_0x300afb,_0x540254){_0x540254=_0x540254||0xc8;return function(_0x4657d3){if(_0x4657d3){return _0x300afb[_0xc558('0x19')](_0x540254)['json'](_0x4657d3);}};}function respondWithFilteredResult(_0xd26ede,_0x31d79a){return function(_0x544e53){if(_0x544e53){var _0x232ca3=typeof _0x31d79a['offset']==='undefined'&&typeof _0x31d79a[_0xc558('0x1a')]===_0xc558('0x1b');var _0x311b95=_0x544e53[_0xc558('0x1c')];var _0x110519=_0x232ca3?0x0:_0x31d79a[_0xc558('0x1d')];var _0x32948f=_0x232ca3?_0x544e53[_0xc558('0x1c')]:_0x31d79a['offset']+_0x31d79a[_0xc558('0x1a')];var _0x42eeb3;if(_0x32948f>=_0x311b95){_0x32948f=_0x311b95;_0x42eeb3=0xc8;}else{_0x42eeb3=0xce;}_0xd26ede['status'](_0x42eeb3);return _0xd26ede[_0xc558('0x1e')]('Content-Range',_0x110519+'-'+_0x32948f+'/'+_0x311b95)[_0xc558('0x1f')](_0x544e53);}return null;};}function patchUpdates(_0xc8e855){return function(_0x2b034f){try{jsonpatch['apply'](_0x2b034f,_0xc8e855,!![]);}catch(_0x1450f8){return BPromise[_0xc558('0x20')](_0x1450f8);}return _0x2b034f['save']();};}function saveUpdates(_0x26391c,_0x31ec34){return function(_0x67233b){if(_0x67233b){return _0x67233b['update'](_0x26391c)['then'](function(_0x2b5e21){return _0x2b5e21;});}return null;};}function removeEntity(_0x46f32d,_0x53ca44){return function(_0x569fa9){if(_0x569fa9){return _0x569fa9[_0xc558('0x21')]()[_0xc558('0x22')](function(){var _0x330348=_0x569fa9[_0xc558('0x23')]({'plain':!![]});var _0x255f97=_0xc558('0x24');return db[_0xc558('0x25')][_0xc558('0x21')]({'where':{'type':_0x255f97,'resourceId':_0x330348['id']}})[_0xc558('0x22')](function(){return _0x569fa9;});})[_0xc558('0x22')](function(){_0x46f32d['status'](0xcc)[_0xc558('0x18')]();});}};}function handleEntityNotFound(_0x4b5d41,_0x16026a){return function(_0x4589b2){if(!_0x4589b2){_0x4b5d41[_0xc558('0x17')](0x194);}return _0x4589b2;};}function handleError(_0x46f0b6,_0xcaa2a8){_0xcaa2a8=_0xcaa2a8||0x1f4;return function(_0x188d7a){logger['error'](_0x188d7a[_0xc558('0x26')]);if(_0x188d7a['name']){delete _0x188d7a[_0xc558('0x27')];}_0x46f0b6[_0xc558('0x19')](_0xcaa2a8)['send'](_0x188d7a);};}exports[_0xc558('0x28')]=function(_0x212949,_0xc8ca83){var _0x562f8a={},_0x2f7139={},_0x39cba1={'count':0x0,'rows':[]};var _0x49c81e=_[_0xc558('0x29')](db['AnalyticCustomReport'][_0xc558('0x2a')],function(_0x5076c4){return{'name':_0x5076c4[_0xc558('0x2b')],'type':_0x5076c4[_0xc558('0x2c')]['key']};});_0x2f7139[_0xc558('0x2d')]=_[_0xc558('0x29')](_0x49c81e,'name');_0x2f7139[_0xc558('0x2e')]=_[_0xc558('0x2f')](_0x212949['query']);_0x2f7139[_0xc558('0x30')]=_[_0xc558('0x31')](_0x2f7139[_0xc558('0x2d')],_0x2f7139[_0xc558('0x2e')]);_0x562f8a[_0xc558('0x32')]=_['intersection'](_0x2f7139[_0xc558('0x2d')],qs[_0xc558('0x33')](_0x212949[_0xc558('0x2e')][_0xc558('0x33')]));_0x562f8a[_0xc558('0x32')]=_0x562f8a[_0xc558('0x32')]['length']?_0x562f8a[_0xc558('0x32')]:_0x2f7139[_0xc558('0x2d')];if(!_0x212949[_0xc558('0x2e')][_0xc558('0x34')]('nolimit')){_0x562f8a[_0xc558('0x1a')]=qs['limit'](_0x212949['query'][_0xc558('0x1a')]);_0x562f8a[_0xc558('0x1d')]=qs[_0xc558('0x1d')](_0x212949[_0xc558('0x2e')][_0xc558('0x1d')]);}_0x562f8a[_0xc558('0x35')]=qs[_0xc558('0x36')](_0x212949[_0xc558('0x2e')][_0xc558('0x36')]);_0x562f8a[_0xc558('0x37')]=qs[_0xc558('0x30')](_[_0xc558('0x38')](_0x212949[_0xc558('0x2e')],_0x2f7139[_0xc558('0x30')]),_0x49c81e);if(_0x212949[_0xc558('0x2e')][_0xc558('0x39')]){_0x562f8a[_0xc558('0x37')]=_['merge'](_0x562f8a[_0xc558('0x37')],{'$or':_[_0xc558('0x29')](_0x49c81e,function(_0x5381e7){if(_0x5381e7[_0xc558('0x2c')]!==_0xc558('0x3a')){var _0xd4dac7={};_0xd4dac7[_0x5381e7[_0xc558('0x27')]]={'$like':'%'+_0x212949['query'][_0xc558('0x39')]+'%'};return _0xd4dac7;}})});}_0x562f8a=_[_0xc558('0x3b')]({},_0x562f8a,_0x212949[_0xc558('0x3c')]);var _0x5a9360={'where':_0x562f8a[_0xc558('0x37')]};return db[_0xc558('0x3d')][_0xc558('0x1c')](_0x5a9360)['then'](function(_0x1115b7){_0x39cba1[_0xc558('0x1c')]=_0x1115b7;if(_0x212949[_0xc558('0x2e')][_0xc558('0x3e')]){_0x562f8a[_0xc558('0x3f')]=[{'all':!![]}];}return db[_0xc558('0x3d')][_0xc558('0x40')](_0x562f8a);})[_0xc558('0x22')](function(_0x1b59eb){_0x39cba1[_0xc558('0x41')]=_0x1b59eb;return _0x39cba1;})[_0xc558('0x22')](respondWithFilteredResult(_0xc8ca83,_0x562f8a))[_0xc558('0x42')](handleError(_0xc8ca83,null));};exports[_0xc558('0x43')]=function(_0x40bf7e,_0x3dbfea){var _0x4009ac={'raw':![],'where':{'id':_0x40bf7e[_0xc558('0x44')]['id']}},_0x14a608={};_0x14a608[_0xc558('0x2d')]=_[_0xc558('0x2f')](db[_0xc558('0x3d')][_0xc558('0x2a')]);_0x14a608[_0xc558('0x2e')]=_[_0xc558('0x2f')](_0x40bf7e[_0xc558('0x2e')]);_0x14a608[_0xc558('0x30')]=_['intersection'](_0x14a608[_0xc558('0x2d')],_0x14a608[_0xc558('0x2e')]);_0x4009ac[_0xc558('0x32')]=_[_0xc558('0x31')](_0x14a608['model'],qs[_0xc558('0x33')](_0x40bf7e[_0xc558('0x2e')][_0xc558('0x33')]));_0x4009ac['attributes']=_0x4009ac[_0xc558('0x32')][_0xc558('0x45')]?_0x4009ac[_0xc558('0x32')]:_0x14a608[_0xc558('0x2d')];if(_0x40bf7e[_0xc558('0x2e')]['includeAll']){_0x4009ac[_0xc558('0x3f')]=[{'all':!![]}];}_0x4009ac=_[_0xc558('0x3b')]({},_0x4009ac,_0x40bf7e[_0xc558('0x3c')]);return db[_0xc558('0x3d')][_0xc558('0x46')](_0x4009ac)['then'](handleEntityNotFound(_0x3dbfea,null))[_0xc558('0x22')](respondWithResult(_0x3dbfea,null))[_0xc558('0x42')](handleError(_0x3dbfea,null));};exports[_0xc558('0x47')]=function(_0x42b8c8,_0x3c59c4){return db['AnalyticCustomReport'][_0xc558('0x47')](_0x42b8c8[_0xc558('0x48')],{})[_0xc558('0x22')](function(_0xec2068){var _0x1510d1=_0x42b8c8[_0xc558('0x49')][_0xc558('0x23')]({'plain':!![]});if(!_0x1510d1)throw new Error(_0xc558('0x4a'));if(_0x1510d1['role']===_0xc558('0x49')){var _0x366f76=_0xec2068[_0xc558('0x23')]({'plain':!![]});var _0xd77a2='Reports';return db[_0xc558('0x4b')]['find']({'where':{'name':_0xd77a2,'userProfileId':_0x1510d1[_0xc558('0x4c')]},'raw':!![]})[_0xc558('0x22')](function(_0x5e4735){if(_0x5e4735&&_0x5e4735[_0xc558('0x4d')]===0x0){return db[_0xc558('0x25')][_0xc558('0x47')]({'name':_0x366f76[_0xc558('0x27')],'resourceId':_0x366f76['id'],'type':_0xc558('0x24'),'sectionId':_0x5e4735['id']},{})[_0xc558('0x22')](function(){return _0xec2068;});}else{return _0xec2068;}})['catch'](function(_0x424d5b){logger['error'](_0xc558('0x4e'),_0x424d5b);throw _0x424d5b;});}return _0xec2068;})[_0xc558('0x22')](respondWithResult(_0x3c59c4,0xc9))['catch'](handleError(_0x3c59c4,null));};exports[_0xc558('0x4f')]=function(_0x3a85d6,_0x8b6d7e){if(_0x3a85d6[_0xc558('0x48')]['id']){delete _0x3a85d6['body']['id'];}return db[_0xc558('0x3d')][_0xc558('0x46')]({'where':{'id':_0x3a85d6[_0xc558('0x44')]['id']}})[_0xc558('0x22')](handleEntityNotFound(_0x8b6d7e,null))[_0xc558('0x22')](saveUpdates(_0x3a85d6[_0xc558('0x48')],null))[_0xc558('0x22')](respondWithResult(_0x8b6d7e,null))[_0xc558('0x42')](handleError(_0x8b6d7e,null));};exports['destroy']=function(_0x18cf07,_0x1cff44){return db[_0xc558('0x3d')][_0xc558('0x46')]({'where':{'id':_0x18cf07[_0xc558('0x44')]['id']}})[_0xc558('0x22')](handleEntityNotFound(_0x1cff44,null))['then'](removeEntity(_0x1cff44,null))[_0xc558('0x42')](handleError(_0x1cff44,null));};exports[_0xc558('0x50')]=function(_0x4578e1,_0x5063c9){var _0x4a3ab5=0xa;var _0x1d99c5=[_0xc558('0x51'),_0xc558('0x52'),_0xc558('0x53'),'cross_join'];var _0x2d4b81={'SUM':_0xc558('0x54'),'COUNT':_0xc558('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc558('0x56'),'MIN':_0xc558('0x57'),'AVG':_0xc558('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc558('0x59')};var _0x5cb2a4={'SEC_TO_TIME':_0xc558('0x5a'),'DATE':_0xc558('0x5b'),'HOUR':_0xc558('0x5c'),'ROUND':_0xc558('0x5d'),'UNIX_TIMESTAMP':_0xc558('0x5e')};var _0x34f2e5=function(_0x2f6ac4){return!_[_0xc558('0x5f')](['IS\x20NULL',_0xc558('0x60'),'IS\x20EMPTY',_0xc558('0x61')],_0x2f6ac4);};var _0x48ed50=function(_0x4c329d){if(!_0x4c329d||!_0x4c329d[_0xc558('0x62')][_0xc558('0x45')]){return'';}for(var _0xce02e='(',_0x4a40d0=0x0;_0x4a40d0<_0x4c329d['rules'][_0xc558('0x45')];_0x4a40d0+=0x1){_0x4a40d0>0x0&&(_0xce02e+='\x20'+_0x4c329d[_0xc558('0x63')]+'\x20');_0xce02e+=_0x4c329d[_0xc558('0x62')][_0x4a40d0][_0xc558('0x64')]?_0x48ed50(_0x4c329d[_0xc558('0x62')][_0x4a40d0]['group']):_0x4c329d[_0xc558('0x62')][_0x4a40d0]['field']+'\x20'+_0x4c329d[_0xc558('0x62')][_0x4a40d0][_0xc558('0x65')]+(_0x34f2e5(_0x4c329d[_0xc558('0x62')][_0x4a40d0][_0xc558('0x65')])?'\x20'+_0x4c329d['rules'][_0x4a40d0][_0xc558('0x66')]:'');}return _0xce02e+')';};var _0x5dcc06={'where':{'id':_0x4578e1[_0xc558('0x44')]['id']}},_0x3d0329,_0xcec597,_0x55938f,_0x2f24c4,_0x18b5cc;_0x5dcc06=_[_0xc558('0x3b')]({},_0x5dcc06,_0x4578e1['options']);return db[_0xc558('0x3d')][_0xc558('0x46')](_0x5dcc06)[_0xc558('0x22')](function(_0x47e1c6){if(_0x47e1c6){_0x3d0329=_0x47e1c6;return _0x47e1c6[_0xc558('0x67')]();}return null;})[_0xc558('0x22')](function(_0x9d9e00){if(_0x9d9e00){if(!_0x9d9e00['length']){throw new db[(_0xc558('0x68'))][(_0xc558('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xcec597=_0x9d9e00;return db[_0xc558('0x6a')]['findAll']({'raw':!![]});}return null;})[_0xc558('0x22')](function(_0x5d36c3){if(_0x5d36c3){_0x55938f=_[_0xc558('0x6b')](_0x5d36c3,'id');var _0x3e0699;var _0x255d94=squel['select']();_0x255d94[_0xc558('0x6c')](_0x3d0329[_0xc558('0x6d')]);for(var _0x1c9481=0x0;_0x1c9481<_0xcec597['length'];_0x1c9481+=0x1){_0x3e0699=_0xcec597[_0x1c9481][_0xc558('0x6e')]?_0x55938f[_0xcec597[_0x1c9481][_0xc558('0x6e')]]['metric']:_0xcec597[_0x1c9481][_0xc558('0x6f')];_0x3e0699=_0xcec597[_0x1c9481][_0xc558('0x70')]?_[_0xc558('0x71')](_0x2d4b81[_0xcec597[_0x1c9481][_0xc558('0x70')]],'%s',_0x3e0699):_0x3e0699;_0x3e0699=_0xcec597[_0x1c9481][_0xc558('0x72')]?_[_0xc558('0x71')](_0x5cb2a4[_0xcec597[_0x1c9481][_0xc558('0x72')]],'%s',_0x3e0699):_0x3e0699;if(_0xcec597[_0x1c9481][_0xc558('0x73')]){_0x255d94[_0xc558('0x64')](_0x3e0699);}_0xcec597[_0x1c9481][_0xc558('0x74')]&&_0x255d94['order'](_0x3e0699,_0xcec597[_0x1c9481][_0xc558('0x74')]===_0xc558('0x75')?![]:!![]);_0x255d94[_0xc558('0x6f')](_0x3e0699,_0xcec597[_0x1c9481][_0xc558('0x76')]||_0x3e0699);}if(_0x3d0329['joins']){_0x3d0329[_0xc558('0x77')]=JSON[_0xc558('0x78')](_0x3d0329[_0xc558('0x77')]);for(var _0x573cb8=0x0;_0x573cb8<_0x3d0329['joins'][_0xc558('0x45')];_0x573cb8+=0x1){if(_0x3d0329[_0xc558('0x77')][_0x573cb8][_0xc558('0x2c')]&&_['includes'](_0x1d99c5,_0x3d0329['joins'][_0x573cb8]['type'])&&_0x3d0329['joins'][_0x573cb8][_0xc558('0x79')]&&_0x3d0329[_0xc558('0x77')][_0x573cb8][_0xc558('0x7a')]&&_0x3d0329['joins'][_0x573cb8]['foreignKey']){_0x255d94[_0x3d0329['joins'][_0x573cb8]['type']](_0x3d0329[_0xc558('0x77')][_0x573cb8][_0xc558('0x7a')],null,util[_0xc558('0x72')](_0xc558('0x7b'),_0x3d0329['table'],_0x3d0329['joins'][_0x573cb8][_0xc558('0x79')],_0x3d0329[_0xc558('0x77')][_0x573cb8][_0xc558('0x7a')],_0x3d0329[_0xc558('0x77')][_0x573cb8]['foreignKey']));}}}if(_0x3d0329['conditions']){_0x3d0329['conditions']=JSON[_0xc558('0x78')](_0x3d0329['conditions']);_0x255d94[_0xc558('0x37')](_0x48ed50(_0x3d0329[_0xc558('0x7c')][_0xc558('0x64')]));}_0x18b5cc=_0x255d94['clone']();_0x255d94['limit'](_0x4a3ab5);_0x255d94[_0xc558('0x1d')](0x0);logger[_0xc558('0x7d')](_0xc558('0x7e'),_0x255d94[_0xc558('0x7f')]());return dbH[_0xc558('0x80')][_0xc558('0x2e')](_0x255d94[_0xc558('0x7f')](),{'type':dbH[_0xc558('0x80')]['QueryTypes'][_0xc558('0x81')]});}})[_0xc558('0x22')](respondWithResult(_0x5063c9,null))['catch'](handleError(_0x5063c9,null));};function runReport(_0x3e9ba9,_0x2a8322,_0x29c3ea){var _0x4befdb=_0x2a8322[_0xc558('0x27')];var _0x16b511=0xa;var _0x1abd03=[_0xc558('0x51'),'left_join',_0xc558('0x53'),_0xc558('0x82')];var _0x598a49={'SUM':_0xc558('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc558('0x83'),'MAX':_0xc558('0x56'),'MIN':_0xc558('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc558('0x84'),'GROUP_CONCAT ASC':_0xc558('0x85'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3b3e54={'SEC_TO_TIME':_0xc558('0x5a'),'DATE':_0xc558('0x5b'),'HOUR':_0xc558('0x5c'),'ROUND':_0xc558('0x5d'),'UNIX_TIMESTAMP':_0xc558('0x5e')};var _0x4ccc11=function(_0x3ef1aa){return!_[_0xc558('0x5f')]([_0xc558('0x86'),_0xc558('0x60'),_0xc558('0x87'),_0xc558('0x61')],_0x3ef1aa);};var _0x2c1562=function(_0x1a5aa5){if(!_0x1a5aa5||!_0x1a5aa5[_0xc558('0x62')]['length']){return'';}for(var _0x38bc74='(',_0x12b0a6=0x0;_0x12b0a6<_0x1a5aa5[_0xc558('0x62')][_0xc558('0x45')];_0x12b0a6+=0x1){_0x12b0a6>0x0&&(_0x38bc74+='\x20'+_0x1a5aa5['operator']+'\x20');_0x38bc74+=_0x1a5aa5['rules'][_0x12b0a6][_0xc558('0x64')]?_0x2c1562(_0x1a5aa5['rules'][_0x12b0a6]['group']):_0x1a5aa5[_0xc558('0x62')][_0x12b0a6][_0xc558('0x6f')]+'\x20'+_0x1a5aa5[_0xc558('0x62')][_0x12b0a6][_0xc558('0x65')]+(_0x4ccc11(_0x1a5aa5['rules'][_0x12b0a6][_0xc558('0x65')])?'\x20'+_0x1a5aa5[_0xc558('0x62')][_0x12b0a6][_0xc558('0x66')]:'');}return _0x38bc74+')';};var _0x260ae2={'where':{'id':_0x3e9ba9['id']}},_0x2eedbb,_0x41e6d7,_0xa27d38,_0x5c7700,_0x4a3cbb;_0x260ae2=_[_0xc558('0x3b')]({},_0x260ae2,_0x29c3ea);return db[_0xc558('0x3d')]['find'](_0x260ae2)[_0xc558('0x22')](function(_0x428fff){if(_0x428fff){_0x2eedbb=_0x428fff;return _0x428fff[_0xc558('0x67')]();}return null;})[_0xc558('0x22')](function(_0x2de0bf){if(_0x2de0bf){if(!_0x2de0bf[_0xc558('0x45')]){throw new db['Sequelize'][(_0xc558('0x69'))](_0xc558('0x88'),0x193);}_0x41e6d7=_0x2de0bf;return db['AnalyticMetric'][_0xc558('0x40')]({'raw':!![]});}return null;})[_0xc558('0x22')](function(_0x8dbacf){if(_0x8dbacf){_0xa27d38=_[_0xc558('0x6b')](_0x8dbacf,'id');var _0x43f876;var _0x2099cf=squel['select']();_0x2099cf[_0xc558('0x6c')](_0x2eedbb[_0xc558('0x6d')]);for(var _0x518b77=0x0;_0x518b77<_0x41e6d7[_0xc558('0x45')];_0x518b77+=0x1){_0x43f876=_0x41e6d7[_0x518b77][_0xc558('0x6e')]?_0xa27d38[_0x41e6d7[_0x518b77]['MetricId']][_0xc558('0x89')]:_0x41e6d7[_0x518b77][_0xc558('0x6f')];_0x43f876=_0x41e6d7[_0x518b77][_0xc558('0x70')]?_[_0xc558('0x71')](_0x598a49[_0x41e6d7[_0x518b77]['function']],'%s',_0x43f876):_0x43f876;_0x43f876=_0x41e6d7[_0x518b77]['format']?_[_0xc558('0x71')](_0x3b3e54[_0x41e6d7[_0x518b77][_0xc558('0x72')]],'%s',_0x43f876):_0x43f876;if(_0x41e6d7[_0x518b77][_0xc558('0x73')]){_0x2099cf['group'](_0x43f876);}_0x41e6d7[_0x518b77]['orderBy']&&_0x2099cf[_0xc558('0x35')](_0x43f876,_0x41e6d7[_0x518b77]['orderBy']===_0xc558('0x75')?![]:!![]);_0x2099cf[_0xc558('0x6f')](_0x43f876,_0x41e6d7[_0x518b77][_0xc558('0x76')]||_0x43f876);}if(_0x2eedbb[_0xc558('0x77')]){_0x2eedbb[_0xc558('0x77')]=JSON[_0xc558('0x78')](_0x2eedbb[_0xc558('0x77')]);for(var _0x79aed5=0x0;_0x79aed5<_0x2eedbb[_0xc558('0x77')][_0xc558('0x45')];_0x79aed5+=0x1){if(_0x2eedbb[_0xc558('0x77')][_0x79aed5][_0xc558('0x2c')]&&_['includes'](_0x1abd03,_0x2eedbb[_0xc558('0x77')][_0x79aed5]['type'])&&_0x2eedbb['joins'][_0x79aed5]['parentKey']&&_0x2eedbb[_0xc558('0x77')][_0x79aed5][_0xc558('0x7a')]&&_0x2eedbb[_0xc558('0x77')][_0x79aed5][_0xc558('0x8a')]){_0x2099cf[_0x2eedbb['joins'][_0x79aed5]['type']](_0x2eedbb[_0xc558('0x77')][_0x79aed5]['foreignTable'],null,util[_0xc558('0x72')]('%s.%s\x20=\x20%s.%s',_0x2eedbb[_0xc558('0x6d')],_0x2eedbb['joins'][_0x79aed5][_0xc558('0x79')],_0x2eedbb[_0xc558('0x77')][_0x79aed5][_0xc558('0x7a')],_0x2eedbb[_0xc558('0x77')][_0x79aed5][_0xc558('0x8a')]));}}}if(_0x2eedbb['conditions']){_0x2eedbb[_0xc558('0x7c')]=JSON[_0xc558('0x78')](_0x2eedbb[_0xc558('0x7c')]);_0x2099cf[_0xc558('0x37')](_0x2c1562(_0x2eedbb[_0xc558('0x7c')][_0xc558('0x64')]));}_0x4a3cbb=_0x2099cf[_0xc558('0x8b')]();_0x2099cf[_0xc558('0x1a')](_0x16b511);_0x2099cf['offset'](0x0);return;}})[_0xc558('0x22')](function(){if(_0x2a8322[_0xc558('0x8c')]===_0xc558('0x8d')){return null;}var _0x2fb037=_[_0xc558('0x3b')](_0x2a8322,{'name':_0x2a8322[_0xc558('0x8e')]||_0x2a8322[_0xc558('0x27')]||_0x2eedbb[_0xc558('0x27')],'basename':_0x4befdb,'savename':util[_0xc558('0x72')](_0xc558('0x8f'),_0x2a8322[_0xc558('0x27')]||_0x2eedbb['name'],require('randomstring')[_0xc558('0x90')](0x4),_0x2a8322[_0xc558('0x8c')]||'csv'),'reportId':_0x2eedbb['id'],'reportType':_0xc558('0x91')});return db[_0xc558('0x92')][_0xc558('0x47')](_0x2fb037,{'raw':!![]});})[_0xc558('0x22')](function(_0x4ca45c){if(_0x2eedbb[_0xc558('0x6d')]==='cdr'){_0x4a3cbb['where'](_0x2eedbb[_0xc558('0x6d')]+_0xc558('0x93'),_0x2a8322[_0xc558('0x94')],_0x2a8322['endDate']);}else{_0x4a3cbb[_0xc558('0x37')](_0x2eedbb[_0xc558('0x6d')]+_0xc558('0x95'),_0x2a8322['startDate'],_0x2a8322['endDate']);}if(_0x4ca45c){logger[_0xc558('0x96')](_0xc558('0x97'),_0x4a3cbb[_0xc558('0x7f')]());require('child_process')[_0xc558('0x98')](path[_0xc558('0x51')](__dirname,_0xc558('0x99'),_0x4ca45c[_0xc558('0x8c')]),[_0x4ca45c['id'],_0x4a3cbb[_0xc558('0x7f')](),path['join'](__dirname,_0xc558('0x9a'),_0x4ca45c['savename']),_0x4befdb]);return _0x4ca45c;}else{var _0x20bbd5=squel[_0xc558('0x9b')]();_0x20bbd5[_0xc558('0x6c')]('('+_0x4a3cbb[_0xc558('0x7f')]()+')',_0xc558('0x9c'));_0x20bbd5[_0xc558('0x6f')]('COUNT(*)',_0xc558('0x1c'));_0x4a3cbb[_0xc558('0x1a')](_0x2a8322[_0xc558('0x1a')]||_0x16b511);_0x4a3cbb[_0xc558('0x1d')](_0x2a8322[_0xc558('0x1d')]||0x0);return dbH['sequelize'][_0xc558('0x2e')](_0x20bbd5[_0xc558('0x7f')](),{'type':dbH[_0xc558('0x80')][_0xc558('0x9d')][_0xc558('0x81')]})[_0xc558('0x22')](function(_0x3b14bb){if(!_0x3b14bb[_0xc558('0x45')]){_0x5c7700=0x0;}else{_0x5c7700=_0x3b14bb[0x0][_0xc558('0x1c')]||0x0;}return dbH[_0xc558('0x80')][_0xc558('0x2e')](_0x4a3cbb[_0xc558('0x7f')](),{'type':dbH[_0xc558('0x80')][_0xc558('0x9d')][_0xc558('0x81')]});})['then'](function(_0x5d4d76){return{'rows':_0x5d4d76||[],'count':_0x5c7700};});}});}exports[_0xc558('0x9e')]=function(_0xab19e,_0x2b2fae){return runReport(_0xab19e[_0xc558('0x44')],_0xab19e[_0xc558('0x2e')],_0xab19e[_0xc558('0x3c')])[_0xc558('0x22')](respondWithResult(_0x2b2fae,null))[_0xc558('0x42')](handleError(_0x2b2fae,null));};exports[_0xc558('0x9f')]=runReport;exports[_0xc558('0x2e')]=function(_0x25c9d5,_0x5707fc){var _0x157223=0xa;var _0x5b3291=[_0xc558('0x51'),_0xc558('0x52'),_0xc558('0x53'),_0xc558('0x82')];var _0x59b4f1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc558('0x83'),'MAX':_0xc558('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc558('0x84'),'GROUP_CONCAT ASC':_0xc558('0x85'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x53c4ac={'SEC_TO_TIME':_0xc558('0x5a'),'DATE':_0xc558('0x5b'),'HOUR':_0xc558('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x10d949=function(_0x375443){return!_['includes']([_0xc558('0x86'),'IS\x20NOT\x20NULL',_0xc558('0x87'),_0xc558('0x61')],_0x375443);};var _0x4412a3=function(_0x4c18f2){if(!_0x4c18f2||!_0x4c18f2[_0xc558('0x62')][_0xc558('0x45')]){return'';}for(var _0x1b5223='(',_0x29870d=0x0;_0x29870d<_0x4c18f2[_0xc558('0x62')][_0xc558('0x45')];_0x29870d+=0x1){_0x29870d>0x0&&(_0x1b5223+='\x20'+_0x4c18f2[_0xc558('0x63')]+'\x20');_0x1b5223+=_0x4c18f2[_0xc558('0x62')][_0x29870d]['group']?_0x4412a3(_0x4c18f2[_0xc558('0x62')][_0x29870d][_0xc558('0x64')]):_0x4c18f2['rules'][_0x29870d][_0xc558('0x6f')]+'\x20'+_0x4c18f2[_0xc558('0x62')][_0x29870d][_0xc558('0x65')]+(_0x10d949(_0x4c18f2[_0xc558('0x62')][_0x29870d][_0xc558('0x65')])?'\x20'+_0x4c18f2[_0xc558('0x62')][_0x29870d][_0xc558('0x66')]:'');}return _0x1b5223+')';};var _0x36246a={'where':{'id':_0x25c9d5['params']['id']}},_0x2cecf1,_0x56c33b,_0x445c35,_0x219cf3,_0x4af8f4;_0x36246a=_[_0xc558('0x3b')]({},_0x36246a,_0x25c9d5[_0xc558('0x3c')]);return db[_0xc558('0x3d')][_0xc558('0x46')](_0x36246a)[_0xc558('0x22')](function(_0x5e5825){if(_0x5e5825){_0x2cecf1=_0x5e5825;return _0x5e5825[_0xc558('0x67')]();}return null;})['then'](function(_0x4948e3){if(_0x4948e3){if(!_0x4948e3[_0xc558('0x45')]){throw new db[(_0xc558('0x68'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56c33b=_0x4948e3;return db[_0xc558('0x6a')][_0xc558('0x40')]({'raw':!![]});}return null;})[_0xc558('0x22')](function(_0x1caab2){if(_0x1caab2){_0x445c35=_[_0xc558('0x6b')](_0x1caab2,'id');var _0x26f548;var _0x2e0436=squel[_0xc558('0x9b')]();_0x2e0436['from'](_0x2cecf1[_0xc558('0x6d')]);for(var _0x2eb981=0x0;_0x2eb981<_0x56c33b[_0xc558('0x45')];_0x2eb981+=0x1){_0x26f548=_0x56c33b[_0x2eb981]['MetricId']?_0x445c35[_0x56c33b[_0x2eb981][_0xc558('0x6e')]][_0xc558('0x89')]:_0x56c33b[_0x2eb981][_0xc558('0x6f')];_0x26f548=_0x56c33b[_0x2eb981][_0xc558('0x70')]?_[_0xc558('0x71')](_0x59b4f1[_0x56c33b[_0x2eb981][_0xc558('0x70')]],'%s',_0x26f548):_0x26f548;_0x26f548=_0x56c33b[_0x2eb981][_0xc558('0x72')]?_['replace'](_0x53c4ac[_0x56c33b[_0x2eb981]['format']],'%s',_0x26f548):_0x26f548;if(_0x56c33b[_0x2eb981][_0xc558('0x73')]){_0x2e0436['group'](_0x26f548);}_0x56c33b[_0x2eb981][_0xc558('0x74')]&&_0x2e0436['order'](_0x26f548,_0x56c33b[_0x2eb981][_0xc558('0x74')]===_0xc558('0x75')?![]:!![]);_0x2e0436['field'](_0x26f548,_0x56c33b[_0x2eb981][_0xc558('0x76')]||_0x26f548);}if(_0x2cecf1[_0xc558('0x77')]){_0x2cecf1[_0xc558('0x77')]=JSON[_0xc558('0x78')](_0x2cecf1['joins']);for(var _0x149087=0x0;_0x149087<_0x2cecf1[_0xc558('0x77')][_0xc558('0x45')];_0x149087+=0x1){if(_0x2cecf1[_0xc558('0x77')][_0x149087][_0xc558('0x2c')]&&_[_0xc558('0x5f')](_0x5b3291,_0x2cecf1['joins'][_0x149087][_0xc558('0x2c')])&&_0x2cecf1[_0xc558('0x77')][_0x149087][_0xc558('0x79')]&&_0x2cecf1[_0xc558('0x77')][_0x149087][_0xc558('0x7a')]&&_0x2cecf1[_0xc558('0x77')][_0x149087][_0xc558('0x8a')]){_0x2e0436[_0x2cecf1[_0xc558('0x77')][_0x149087][_0xc558('0x2c')]](_0x2cecf1['joins'][_0x149087][_0xc558('0x7a')],null,util[_0xc558('0x72')](_0xc558('0x7b'),_0x2cecf1['table'],_0x2cecf1[_0xc558('0x77')][_0x149087]['parentKey'],_0x2cecf1[_0xc558('0x77')][_0x149087][_0xc558('0x7a')],_0x2cecf1[_0xc558('0x77')][_0x149087]['foreignKey']));}}}if(_0x2cecf1['conditions']){_0x2cecf1[_0xc558('0x7c')]=JSON[_0xc558('0x78')](_0x2cecf1[_0xc558('0x7c')]);_0x2e0436[_0xc558('0x37')](_0x4412a3(_0x2cecf1['conditions'][_0xc558('0x64')]));}_0x4af8f4=_0x2e0436[_0xc558('0x8b')]();_0x2e0436[_0xc558('0x1a')](_0x157223);_0x2e0436['offset'](0x0);logger[_0xc558('0x7d')](_0xc558('0x7e'),_0x2e0436[_0xc558('0x7f')]());return dbH[_0xc558('0x80')][_0xc558('0x2e')](_0x2e0436[_0xc558('0x7f')](),{'type':dbH['sequelize'][_0xc558('0x9d')][_0xc558('0x81')]});}})[_0xc558('0x22')](function(){return{'sql':_0x4af8f4[_0xc558('0x7f')]()};})['then'](respondWithResult(_0x5707fc,null))[_0xc558('0x42')](handleError(_0x5707fc,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 942de0b..e577b2c 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 _0x9cda=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9cda,0x1de));var _0xa9cd=function(_0x2a5ff9,_0x36cec8){_0x2a5ff9=_0x2a5ff9-0x0;var _0x46dd87=_0x9cda[_0x2a5ff9];return _0x46dd87;};'use strict';var _=require(_0xa9cd('0x0'));var util=require(_0xa9cd('0x1'));var logger=require(_0xa9cd('0x2'))('api');var moment=require(_0xa9cd('0x3'));var BPromise=require(_0xa9cd('0x4'));var rp=require(_0xa9cd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9cd('0x6'));var config=require(_0xa9cd('0x7'));var attributes=require(_0xa9cd('0x8'));module[_0xa9cd('0x9')]=function(_0x3f9f88,_0x4abd6b){return _0x3f9f88[_0xa9cd('0xa')](_0xa9cd('0xb'),attributes,{'tableName':_0xa9cd('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8a7=['AnalyticCustomReport','analytics_custom_reports','lodash','util','api','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','define'];(function(_0x4b5a98,_0x500845){var _0x32e19e=function(_0x1f183a){while(--_0x1f183a){_0x4b5a98['push'](_0x4b5a98['shift']());}};_0x32e19e(++_0x500845);}(_0xd8a7,0x19a));var _0x7d8a=function(_0x15b644,_0x4cf28e){_0x15b644=_0x15b644-0x0;var _0x1682a0=_0xd8a7[_0x15b644];return _0x1682a0;};'use strict';var _=require(_0x7d8a('0x0'));var util=require(_0x7d8a('0x1'));var logger=require('../../config/logger')(_0x7d8a('0x2'));var moment=require('moment');var BPromise=require(_0x7d8a('0x3'));var rp=require(_0x7d8a('0x4'));var fs=require('fs');var path=require(_0x7d8a('0x5'));var rimraf=require(_0x7d8a('0x6'));var config=require('../../config/environment');var attributes=require(_0x7d8a('0x7'));module[_0x7d8a('0x8')]=function(_0x4d5d6d,_0x2ecc84){return _0x4d5d6d[_0x7d8a('0x9')](_0x7d8a('0xa'),attributes,{'tableName':_0x7d8a('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index c87ecd4..a9c1d29 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 _0xe04c=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2fbdcc,_0x1f73be){var _0x185d08=function(_0x297bf1){while(--_0x297bf1){_0x2fbdcc['push'](_0x2fbdcc['shift']());}};_0x185d08(++_0x1f73be);}(_0xe04c,0x18c));var _0xce04=function(_0x164360,_0x4c523f){_0x164360=_0x164360-0x0;var _0x3e796c=_0xe04c[_0x164360];return _0x3e796c;};'use strict';var _=require(_0xce04('0x0'));var util=require(_0xce04('0x1'));var moment=require(_0xce04('0x2'));var BPromise=require(_0xce04('0x3'));var rs=require(_0xce04('0x4'));var fs=require('fs');var Redis=require(_0xce04('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xce04('0x6'));var logger=require(_0xce04('0x7'))(_0xce04('0x8'));var config=require(_0xce04('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xce04('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3108,_0xeb824f,_0x3e8f9d){return new BPromise(function(_0x4e6dbe,_0x2c1d41){return client['request'](_0x4e3108,_0x3e8f9d)[_0xce04('0xb')](function(_0x32301c){logger[_0xce04('0xc')](_0xce04('0xd'),_0xeb824f,'request\x20sent');logger['debug'](_0xce04('0xe'),_0xeb824f,_0xce04('0xf'),JSON[_0xce04('0x10')](_0x32301c));if(_0x32301c[_0xce04('0x11')]){if(_0x32301c[_0xce04('0x11')][_0xce04('0x12')]===0x1f4){logger['error'](_0xce04('0xd'),_0xeb824f,_0x32301c[_0xce04('0x11')]['message']);return _0x2c1d41(_0x32301c[_0xce04('0x11')]['message']);}logger['error'](_0xce04('0xd'),_0xeb824f,_0x32301c[_0xce04('0x11')][_0xce04('0x13')]);return _0x4e6dbe(_0x32301c['error']['message']);}else{logger[_0xce04('0xc')](_0xce04('0xd'),_0xeb824f,_0xce04('0xf'));_0x4e6dbe(_0x32301c[_0xce04('0x14')][_0xce04('0x13')]);}})[_0xce04('0x15')](function(_0x4777c7){logger[_0xce04('0x11')](_0xce04('0xd'),_0xeb824f,_0x4777c7);_0x2c1d41(_0x4777c7);});});} \ No newline at end of file +var _0xe80e=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment'];(function(_0x42be66,_0x525d4f){var _0x18329b=function(_0x18246a){while(--_0x18246a){_0x42be66['push'](_0x42be66['shift']());}};_0x18329b(++_0x525d4f);}(_0xe80e,0x1a1));var _0xee80=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0xe80e[_0xc77819];return _0x1c9434;};'use strict';var _=require(_0xee80('0x0'));var util=require(_0xee80('0x1'));var moment=require(_0xee80('0x2'));var BPromise=require('bluebird');var rs=require(_0xee80('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xee80('0x4'))(_0xee80('0x5'));var config=require(_0xee80('0x6'));var jayson=require(_0xee80('0x7'));var client=jayson[_0xee80('0x8')][_0xee80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16c46f,_0x2f484f,_0x11661b){return new BPromise(function(_0x2879ef,_0x148688){return client['request'](_0x16c46f,_0x11661b)[_0xee80('0xa')](function(_0x12a503){logger['info'](_0xee80('0xb'),_0x2f484f,'request\x20sent');logger[_0xee80('0xc')](_0xee80('0xd'),_0x2f484f,_0xee80('0xe'),JSON[_0xee80('0xf')](_0x12a503));if(_0x12a503['error']){if(_0x12a503[_0xee80('0x10')][_0xee80('0x11')]===0x1f4){logger[_0xee80('0x10')](_0xee80('0xb'),_0x2f484f,_0x12a503['error']['message']);return _0x148688(_0x12a503[_0xee80('0x10')][_0xee80('0x12')]);}logger[_0xee80('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2f484f,_0x12a503[_0xee80('0x10')][_0xee80('0x12')]);return _0x2879ef(_0x12a503[_0xee80('0x10')][_0xee80('0x12')]);}else{logger[_0xee80('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2f484f,_0xee80('0xe'));_0x2879ef(_0x12a503[_0xee80('0x14')][_0xee80('0x12')]);}})['catch'](function(_0x4dcfca){logger[_0xee80('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2f484f,_0x4dcfca);_0x148688(_0x4dcfca);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index e12ea22..52590ba 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 _0x8d6d=['preview','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','show','/:id/preview'];(function(_0x1d3964,_0x559f99){var _0x40425e=function(_0x13218c){while(--_0x13218c){_0x1d3964['push'](_0x1d3964['shift']());}};_0x40425e(++_0x559f99);}(_0x8d6d,0x12b));var _0xd8d6=function(_0x1bcd80,_0x388288){_0x1bcd80=_0x1bcd80-0x0;var _0x26e19f=_0x8d6d[_0x1bcd80];return _0x26e19f;};'use strict';var multer=require(_0xd8d6('0x0'));var util=require(_0xd8d6('0x1'));var path=require(_0xd8d6('0x2'));var timeout=require('connect-timeout');var express=require(_0xd8d6('0x3'));var router=express[_0xd8d6('0x4')]();var fs_extra=require(_0xd8d6('0x5'));var auth=require(_0xd8d6('0x6'));var interaction=require(_0xd8d6('0x7'));var config=require('../../config/environment');var controller=require(_0xd8d6('0x8'));router[_0xd8d6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd8d6('0x9')]('/:id',auth[_0xd8d6('0xa')](),controller[_0xd8d6('0xb')]);router[_0xd8d6('0x9')](_0xd8d6('0xc'),auth[_0xd8d6('0xa')](),controller[_0xd8d6('0xd')]);router[_0xd8d6('0x9')]('/:id/run',auth[_0xd8d6('0xa')](),controller['run']);router['get'](_0xd8d6('0xe'),auth[_0xd8d6('0xa')](),controller[_0xd8d6('0xf')]);router[_0xd8d6('0x10')]('/',auth[_0xd8d6('0xa')](),controller[_0xd8d6('0x11')]);router[_0xd8d6('0x12')](_0xd8d6('0x13'),auth['isAuthenticated'](),controller[_0xd8d6('0x14')]);router[_0xd8d6('0x15')]('/:id',auth[_0xd8d6('0xa')](),controller[_0xd8d6('0x16')]);module[_0xd8d6('0x17')]=router; \ No newline at end of file +var _0x5dfb=['run','/:id/query','query','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/preview','preview'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x5dfb,0x1ac));var _0xb5df=function(_0x2d41e7,_0x543ff5){_0x2d41e7=_0x2d41e7-0x0;var _0x1f00c6=_0x5dfb[_0x2d41e7];return _0x1f00c6;};'use strict';var multer=require(_0xb5df('0x0'));var util=require('util');var path=require(_0xb5df('0x1'));var timeout=require(_0xb5df('0x2'));var express=require(_0xb5df('0x3'));var router=express[_0xb5df('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb5df('0x5'));var config=require(_0xb5df('0x6'));var controller=require('./analyticCustomReport.controller');router[_0xb5df('0x7')]('/',auth[_0xb5df('0x8')](),controller[_0xb5df('0x9')]);router[_0xb5df('0x7')]('/:id',auth[_0xb5df('0x8')](),controller['show']);router[_0xb5df('0x7')](_0xb5df('0xa'),auth[_0xb5df('0x8')](),controller[_0xb5df('0xb')]);router[_0xb5df('0x7')]('/:id/run',auth[_0xb5df('0x8')](),controller[_0xb5df('0xc')]);router[_0xb5df('0x7')](_0xb5df('0xd'),auth['isAuthenticated'](),controller[_0xb5df('0xe')]);router[_0xb5df('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb5df('0x10')](_0xb5df('0x11'),auth[_0xb5df('0x8')](),controller[_0xb5df('0x12')]);router[_0xb5df('0x13')]('/:id',auth[_0xb5df('0x8')](),controller[_0xb5df('0x14')]);module[_0xb5df('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index a6938a9..acb100b 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 _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x29dbfa,_0x40cd1e){var _0x28bd8c=function(_0x1b504e){while(--_0x1b504e){_0x29dbfa['push'](_0x29dbfa['shift']());}};_0x28bd8c(++_0x40cd1e);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x1ff59c,_0x31dc22){_0x1ff59c=_0x1ff59c-0x0;var _0x4b0171=_0x9c5a[_0x1ff59c];return _0x4b0171;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x425d=['sequelize','STRING','TEXT'];(function(_0x5aac48,_0x35d520){var _0x1aa026=function(_0x5c5d99){while(--_0x5c5d99){_0x5aac48['push'](_0x5aac48['shift']());}};_0x1aa026(++_0x35d520);}(_0x425d,0x1e0));var _0xd425=function(_0x30a565,_0x1337bf){_0x30a565=_0x30a565-0x0;var _0x388956=_0x425d[_0x30a565];return _0x388956;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 04433ac..9a80b77 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x385948,_0x58283c){_0x385948=_0x385948-0x0;var _0x2dc76c=_0xc6ac[_0x385948];return _0x2dc76c;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));}; \ No newline at end of file +var _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0x36ad76,_0x123873){var _0x82051f=function(_0x4b402a){while(--_0x4b402a){_0x36ad76['push'](_0x36ad76['shift']());}};_0x82051f(++_0x123873);}(_0x524e,0x15e));var _0xe524=function(_0x2a983e,_0x123722){_0x2a983e=_0x2a983e-0x0;var _0x57f0db=_0x524e[_0x2a983e];return _0x57f0db;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index d79e7ca..3d36509 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 _0x7124=['path','rimraf','./analyticDefaultReport.attributes','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird'];(function(_0x3db575,_0x4407cb){var _0x3299da=function(_0x45f8d9){while(--_0x45f8d9){_0x3db575['push'](_0x3db575['shift']());}};_0x3299da(++_0x4407cb);}(_0x7124,0x159));var _0x4712=function(_0x404991,_0x5a9865){_0x404991=_0x404991-0x0;var _0x429b45=_0x7124[_0x404991];return _0x429b45;};'use strict';var _=require(_0x4712('0x0'));var util=require(_0x4712('0x1'));var logger=require('../../config/logger')(_0x4712('0x2'));var moment=require(_0x4712('0x3'));var BPromise=require(_0x4712('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4712('0x5'));var rimraf=require(_0x4712('0x6'));var config=require('../../config/environment');var attributes=require(_0x4712('0x7'));module['exports']=function(_0x21c3a6,_0x3bdf2a){return _0x21c3a6['define'](_0x4712('0x8'),attributes,{'tableName':_0x4712('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba46=['define','analytics_default_reports','../../config/logger','api','moment','bluebird','path','rimraf','./analyticDefaultReport.attributes','exports'];(function(_0x4df1f5,_0x39c6d2){var _0x56585b=function(_0x287b6e){while(--_0x287b6e){_0x4df1f5['push'](_0x4df1f5['shift']());}};_0x56585b(++_0x39c6d2);}(_0xba46,0x156));var _0x6ba4=function(_0x17961a,_0x5a2696){_0x17961a=_0x17961a-0x0;var _0x56aecc=_0xba46[_0x17961a];return _0x56aecc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6ba4('0x0'))(_0x6ba4('0x1'));var moment=require(_0x6ba4('0x2'));var BPromise=require(_0x6ba4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ba4('0x4'));var rimraf=require(_0x6ba4('0x5'));var config=require('../../config/environment');var attributes=require(_0x6ba4('0x6'));module[_0x6ba4('0x7')]=function(_0x1e57d1,_0x210dbc){return _0x1e57d1[_0x6ba4('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x6ba4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 328b712..2b9934d 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 _0xb644=['http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xb644,0xd3));var _0x4b64=function(_0x557d49,_0xa5fe20){_0x557d49=_0x557d49-0x0;var _0x2c5e6a=_0xb644[_0x557d49];return _0x2c5e6a;};'use strict';var _=require(_0x4b64('0x0'));var util=require(_0x4b64('0x1'));var moment=require(_0x4b64('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b64('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b64('0x4'))(_0x4b64('0x5'));var config=require(_0x4b64('0x6'));var jayson=require(_0x4b64('0x7'));var client=jayson[_0x4b64('0x8')][_0x4b64('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf4c3bb,_0x870447,_0x13ca71){return new BPromise(function(_0x1975a6,_0x30dd4c){return client[_0x4b64('0xa')](_0xf4c3bb,_0x13ca71)['then'](function(_0x1ff085){logger[_0x4b64('0xb')](_0x4b64('0xc'),_0x870447,_0x4b64('0xd'));logger[_0x4b64('0xe')](_0x4b64('0xf'),_0x870447,_0x4b64('0xd'),JSON[_0x4b64('0x10')](_0x1ff085));if(_0x1ff085['error']){if(_0x1ff085[_0x4b64('0x11')][_0x4b64('0x12')]===0x1f4){logger[_0x4b64('0x11')](_0x4b64('0xc'),_0x870447,_0x1ff085[_0x4b64('0x11')][_0x4b64('0x13')]);return _0x30dd4c(_0x1ff085[_0x4b64('0x11')]['message']);}logger['error'](_0x4b64('0xc'),_0x870447,_0x1ff085[_0x4b64('0x11')][_0x4b64('0x13')]);return _0x1975a6(_0x1ff085[_0x4b64('0x11')]['message']);}else{logger['info'](_0x4b64('0xc'),_0x870447,_0x4b64('0xd'));_0x1975a6(_0x1ff085[_0x4b64('0x14')]['message']);}})[_0x4b64('0x15')](function(_0x4ff601){logger[_0x4b64('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x870447,_0x4ff601);_0x30dd4c(_0x4ff601);});});} \ No newline at end of file +var _0x9e2a=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4625fd,_0x3dcbeb){var _0x4efa6e=function(_0xc1b79e){while(--_0xc1b79e){_0x4625fd['push'](_0x4625fd['shift']());}};_0x4efa6e(++_0x3dcbeb);}(_0x9e2a,0x1b9));var _0xa9e2=function(_0x414ce0,_0x533c70){_0x414ce0=_0x414ce0-0x0;var _0x4e4694=_0x9e2a[_0x414ce0];return _0x4e4694;};'use strict';var _=require(_0xa9e2('0x0'));var util=require(_0xa9e2('0x1'));var moment=require('moment');var BPromise=require(_0xa9e2('0x2'));var rs=require(_0xa9e2('0x3'));var fs=require('fs');var Redis=require(_0xa9e2('0x4'));var db=require(_0xa9e2('0x5'))['db'];var utils=require(_0xa9e2('0x6'));var logger=require(_0xa9e2('0x7'))(_0xa9e2('0x8'));var config=require(_0xa9e2('0x9'));var jayson=require(_0xa9e2('0xa'));var client=jayson[_0xa9e2('0xb')][_0xa9e2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x360264,_0x58eb2d,_0x12c06f){return new BPromise(function(_0xe81269,_0x23574f){return client[_0xa9e2('0xd')](_0x360264,_0x12c06f)[_0xa9e2('0xe')](function(_0x4bb7ff){logger['info'](_0xa9e2('0xf'),_0x58eb2d,_0xa9e2('0x10'));logger[_0xa9e2('0x11')](_0xa9e2('0x12'),_0x58eb2d,_0xa9e2('0x10'),JSON['stringify'](_0x4bb7ff));if(_0x4bb7ff[_0xa9e2('0x13')]){if(_0x4bb7ff['error'][_0xa9e2('0x14')]===0x1f4){logger[_0xa9e2('0x13')](_0xa9e2('0xf'),_0x58eb2d,_0x4bb7ff[_0xa9e2('0x13')][_0xa9e2('0x15')]);return _0x23574f(_0x4bb7ff['error'][_0xa9e2('0x15')]);}logger[_0xa9e2('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x58eb2d,_0x4bb7ff[_0xa9e2('0x13')][_0xa9e2('0x15')]);return _0xe81269(_0x4bb7ff[_0xa9e2('0x13')][_0xa9e2('0x15')]);}else{logger[_0xa9e2('0x16')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x58eb2d,_0xa9e2('0x10'));_0xe81269(_0x4bb7ff['result'][_0xa9e2('0x15')]);}})[_0xa9e2('0x17')](function(_0xf1f8f1){logger[_0xa9e2('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x58eb2d,_0xf1f8f1);_0x23574f(_0xf1f8f1);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 9fa7ec7..11bfe2d 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 _0x09b7=['isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','post','put','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09b7,0x121));var _0x709b=function(_0x128641,_0x1ec4c1){_0x128641=_0x128641-0x0;var _0x228d4c=_0x09b7[_0x128641];return _0x228d4c;};'use strict';var multer=require(_0x709b('0x0'));var util=require('util');var path=require(_0x709b('0x1'));var timeout=require(_0x709b('0x2'));var express=require(_0x709b('0x3'));var router=express[_0x709b('0x4')]();var fs_extra=require(_0x709b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x709b('0x6'));var config=require(_0x709b('0x7'));var controller=require(_0x709b('0x8'));router[_0x709b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x709b('0xa'),auth[_0x709b('0xb')](),controller[_0x709b('0xc')]);router[_0x709b('0x9')](_0x709b('0xd'),auth[_0x709b('0xb')](),controller['preview']);router['get'](_0x709b('0xe'),auth['isAuthenticated'](),controller[_0x709b('0xf')]);router[_0x709b('0x9')](_0x709b('0x10'),auth[_0x709b('0xb')](),controller['query']);router[_0x709b('0x11')]('/',auth[_0x709b('0xb')](),controller['create']);router[_0x709b('0x12')](_0x709b('0xa'),auth[_0x709b('0xb')](),controller[_0x709b('0x13')]);router['delete'](_0x709b('0xa'),auth[_0x709b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbe42=['Router','fs-extra','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x28f0e0,_0x49904c){var _0x263cb0=function(_0x9a1384){while(--_0x9a1384){_0x28f0e0['push'](_0x28f0e0['shift']());}};_0x263cb0(++_0x49904c);}(_0xbe42,0x141));var _0x2be4=function(_0x19f5fc,_0x4c658a){_0x19f5fc=_0x19f5fc-0x0;var _0x315fa3=_0xbe42[_0x19f5fc];return _0x315fa3;};'use strict';var multer=require(_0x2be4('0x0'));var util=require('util');var path=require(_0x2be4('0x1'));var timeout=require(_0x2be4('0x2'));var express=require(_0x2be4('0x3'));var router=express[_0x2be4('0x4')]();var fs_extra=require(_0x2be4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2be4('0x6'));var controller=require(_0x2be4('0x7'));router[_0x2be4('0x8')]('/',auth[_0x2be4('0x9')](),controller[_0x2be4('0xa')]);router[_0x2be4('0x8')](_0x2be4('0xb'),auth[_0x2be4('0x9')](),controller[_0x2be4('0xc')]);router[_0x2be4('0x8')](_0x2be4('0xd'),auth[_0x2be4('0x9')](),controller['preview']);router['get'](_0x2be4('0xe'),auth['isAuthenticated'](),controller[_0x2be4('0xf')]);router[_0x2be4('0x8')](_0x2be4('0x10'),auth[_0x2be4('0x9')](),controller[_0x2be4('0x11')]);router[_0x2be4('0x12')]('/',auth[_0x2be4('0x9')](),controller[_0x2be4('0x13')]);router[_0x2be4('0x14')]('/:id',auth[_0x2be4('0x9')](),controller[_0x2be4('0x15')]);router[_0x2be4('0x16')](_0x2be4('0xb'),auth[_0x2be4('0x9')](),controller[_0x2be4('0x17')]);module[_0x2be4('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 55a7ea5..e20c75f 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 _0xba80=['moment','STRING','csv','pdf','xlsx','DATE','ENUM','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x58c1ea,_0x467382){var _0x11f721=function(_0x3a9ac6){while(--_0x3a9ac6){_0x58c1ea['push'](_0x58c1ea['shift']());}};_0x11f721(++_0x467382);}(_0xba80,0x8f));var _0x0ba8=function(_0x12137f,_0x403bf1){_0x12137f=_0x12137f-0x0;var _0x1a2406=_0xba80[_0x12137f];return _0x1a2406;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0ba8('0x0'));module['exports']={'name':{'type':Sequelize[_0x0ba8('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x0ba8('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x0ba8('0x2'),_0x0ba8('0x3'),_0x0ba8('0x4')),'allowNull':![],'defaultValue':_0x0ba8('0x2')},'savename':{'type':Sequelize[_0x0ba8('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0ba8('0x5')]},'endDate':{'type':Sequelize[_0x0ba8('0x5')]},'status':{'type':Sequelize[_0x0ba8('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x0ba8('0x6')](_0x0ba8('0x7'),_0x0ba8('0x8')),'allowNull':![],'defaultValue':_0x0ba8('0x7')},'reportId':{'type':Sequelize[_0x0ba8('0x9')](0xb)[_0x0ba8('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x405d=['DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x405d,0xf0));var _0xd405=function(_0x16a7ec,_0x3a822a){_0x16a7ec=_0x16a7ec-0x0;var _0x341e66=_0x405d[_0x16a7ec];return _0x341e66;};'use strict';var Sequelize=require(_0xd405('0x0'));var moment=require('moment');module[_0xd405('0x1')]={'name':{'type':Sequelize[_0xd405('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xd405('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xd405('0x3')](_0xd405('0x4'),_0xd405('0x5'),_0xd405('0x6')),'allowNull':![],'defaultValue':_0xd405('0x4')},'savename':{'type':Sequelize[_0xd405('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd405('0x7')]},'endDate':{'type':Sequelize[_0xd405('0x7')]},'status':{'type':Sequelize[_0xd405('0x2')],'defaultValue':_0xd405('0x8')},'type':{'type':Sequelize[_0xd405('0x3')](_0xd405('0x9'),_0xd405('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xd405('0xb')](0xb)[_0xd405('0xc')]},'reportType':{'type':Sequelize[_0xd405('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 8a899d2..3061199 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 _0x7036=['VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','download','basename','savename','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','output','toLowerCase','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','ExtractedReports','UserProfileResource','stack','name','send','index','AnalyticExtractedReport','rawAttributes','type','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x1c599a,_0x9f1758){var _0x163e91=function(_0x5c645c){while(--_0x5c645c){_0x1c599a['push'](_0x1c599a['shift']());}};_0x163e91(++_0x9f1758);}(_0x7036,0x1a3));var _0x6703=function(_0x593f0e,_0x3555e7){_0x593f0e=_0x593f0e-0x0;var _0x116f30=_0x7036[_0x593f0e];return _0x116f30;};'use strict';var emlformat=require(_0x6703('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6703('0x1'));var rp=require(_0x6703('0x2'));var moment=require(_0x6703('0x3'));var BPromise=require(_0x6703('0x4'));var Mustache=require(_0x6703('0x5'));var util=require(_0x6703('0x6'));var path=require(_0x6703('0x7'));var sox=require('sox');var csv=require(_0x6703('0x8'));var ejs=require(_0x6703('0x9'));var fs=require('fs');var fs_extra=require(_0x6703('0xa'));var _=require(_0x6703('0xb'));var squel=require(_0x6703('0xc'));var crypto=require(_0x6703('0xd'));var jsforce=require(_0x6703('0xe'));var deskjs=require(_0x6703('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6703('0x10'));var Papa=require('papaparse');var Redis=require(_0x6703('0x11'));var authService=require(_0x6703('0x12'));var qs=require(_0x6703('0x13'));var as=require(_0x6703('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6703('0x15'));var licenseUtil=require(_0x6703('0x16'));var db=require(_0x6703('0x17'))['db'];function respondWithStatusCode(_0x392279,_0x3b58b8){_0x3b58b8=_0x3b58b8||0xcc;return function(_0xaf5c25){if(_0xaf5c25){return _0x392279[_0x6703('0x18')](_0x3b58b8);}return _0x392279[_0x6703('0x19')](_0x3b58b8)[_0x6703('0x1a')]();};}function respondWithResult(_0xe1254d,_0x2dcaa7){_0x2dcaa7=_0x2dcaa7||0xc8;return function(_0x30a9f0){if(_0x30a9f0){return _0xe1254d[_0x6703('0x19')](_0x2dcaa7)[_0x6703('0x1b')](_0x30a9f0);}};}function respondWithFilteredResult(_0x1d1ab9,_0x24295d){return function(_0x37419d){if(_0x37419d){var _0x3d0376=typeof _0x24295d[_0x6703('0x1c')]===_0x6703('0x1d')&&typeof _0x24295d[_0x6703('0x1e')]==='undefined';var _0x23637f=_0x37419d['count'];var _0x5bcf01=_0x3d0376?0x0:_0x24295d['offset'];var _0x1be2fa=_0x3d0376?_0x37419d[_0x6703('0x1f')]:_0x24295d[_0x6703('0x1c')]+_0x24295d[_0x6703('0x1e')];var _0x5c419d;if(_0x1be2fa>=_0x23637f){_0x1be2fa=_0x23637f;_0x5c419d=0xc8;}else{_0x5c419d=0xce;}_0x1d1ab9['status'](_0x5c419d);return _0x1d1ab9[_0x6703('0x20')](_0x6703('0x21'),_0x5bcf01+'-'+_0x1be2fa+'/'+_0x23637f)['json'](_0x37419d);}return null;};}function patchUpdates(_0x5de3c1){return function(_0x27b7da){try{jsonpatch[_0x6703('0x22')](_0x27b7da,_0x5de3c1,!![]);}catch(_0x8eada5){return BPromise['reject'](_0x8eada5);}return _0x27b7da['save']();};}function saveUpdates(_0x279ce9,_0x31bfb5){return function(_0xbc9b41){if(_0xbc9b41){return _0xbc9b41[_0x6703('0x23')](_0x279ce9)[_0x6703('0x24')](function(_0x3643b5){return _0x3643b5;});}return null;};}function removeEntity(_0x48724b,_0x400d30){return function(_0x35e52f){if(_0x35e52f){return _0x35e52f['destroy']()['then'](function(){var _0x3b1167=_0x35e52f['get']({'plain':!![]});var _0x4e4a76=_0x6703('0x25');return db[_0x6703('0x26')]['destroy']({'where':{'type':_0x4e4a76,'resourceId':_0x3b1167['id']}})['then'](function(){return _0x35e52f;});})[_0x6703('0x24')](function(){_0x48724b[_0x6703('0x19')](0xcc)[_0x6703('0x1a')]();});}};}function handleEntityNotFound(_0xc63126,_0xfb4c4){return function(_0x3d40b8){if(!_0x3d40b8){_0xc63126['sendStatus'](0x194);}return _0x3d40b8;};}function handleError(_0x244ea1,_0x255093){_0x255093=_0x255093||0x1f4;return function(_0x425aae){logger['error'](_0x425aae[_0x6703('0x27')]);if(_0x425aae[_0x6703('0x28')]){delete _0x425aae[_0x6703('0x28')];}_0x244ea1[_0x6703('0x19')](_0x255093)[_0x6703('0x29')](_0x425aae);};}exports[_0x6703('0x2a')]=function(_0x47d5cb,_0x2dd287){var _0x15bc95={},_0x1046f7={},_0xf556bb={'count':0x0,'rows':[]};var _0x538e4a=_['map'](db[_0x6703('0x2b')][_0x6703('0x2c')],function(_0x1cafd9){return{'name':_0x1cafd9['fieldName'],'type':_0x1cafd9[_0x6703('0x2d')][_0x6703('0x2e')]};});_0x1046f7['model']=_[_0x6703('0x2f')](_0x538e4a,_0x6703('0x28'));_0x1046f7[_0x6703('0x30')]=_['keys'](_0x47d5cb['query']);_0x1046f7[_0x6703('0x31')]=_['intersection'](_0x1046f7[_0x6703('0x32')],_0x1046f7[_0x6703('0x30')]);_0x15bc95[_0x6703('0x33')]=_[_0x6703('0x34')](_0x1046f7[_0x6703('0x32')],qs[_0x6703('0x35')](_0x47d5cb['query']['fields']));_0x15bc95[_0x6703('0x33')]=_0x15bc95[_0x6703('0x33')][_0x6703('0x36')]?_0x15bc95['attributes']:_0x1046f7[_0x6703('0x32')];if(!_0x47d5cb[_0x6703('0x30')][_0x6703('0x37')]('nolimit')){_0x15bc95[_0x6703('0x1e')]=qs['limit'](_0x47d5cb['query'][_0x6703('0x1e')]);_0x15bc95[_0x6703('0x1c')]=qs[_0x6703('0x1c')](_0x47d5cb[_0x6703('0x30')]['offset']);}_0x15bc95[_0x6703('0x38')]=qs[_0x6703('0x39')](_0x47d5cb['query'][_0x6703('0x39')]);_0x15bc95[_0x6703('0x3a')]=qs['filters'](_[_0x6703('0x3b')](_0x47d5cb[_0x6703('0x30')],_0x1046f7['filters']),_0x538e4a);if(_0x47d5cb[_0x6703('0x30')][_0x6703('0x3c')]){_0x15bc95[_0x6703('0x3a')]=_['merge'](_0x15bc95[_0x6703('0x3a')],{'$or':_[_0x6703('0x2f')](_0x538e4a,function(_0x94d2ee){if(_0x94d2ee['type']!==_0x6703('0x3d')){var _0x1f552a={};_0x1f552a[_0x94d2ee['name']]={'$like':'%'+_0x47d5cb[_0x6703('0x30')]['filter']+'%'};return _0x1f552a;}})});}_0x15bc95=_[_0x6703('0x3e')]({},_0x15bc95,_0x47d5cb['options']);var _0x322f28={'where':_0x15bc95[_0x6703('0x3a')]};return db[_0x6703('0x2b')][_0x6703('0x1f')](_0x322f28)[_0x6703('0x24')](function(_0x24c830){_0xf556bb[_0x6703('0x1f')]=_0x24c830;if(_0x47d5cb[_0x6703('0x30')][_0x6703('0x3f')]){_0x15bc95[_0x6703('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x6703('0x41')](_0x15bc95);})[_0x6703('0x24')](function(_0x24744e){_0xf556bb[_0x6703('0x42')]=_0x24744e;return _0xf556bb;})[_0x6703('0x24')](respondWithFilteredResult(_0x2dd287,_0x15bc95))[_0x6703('0x43')](handleError(_0x2dd287,null));};exports[_0x6703('0x44')]=function(_0x451fe0,_0x3bff13){var _0x435782={'raw':!![],'where':{'id':_0x451fe0[_0x6703('0x45')]['id']}},_0x4cd610={};_0x4cd610[_0x6703('0x32')]=_['keys'](db[_0x6703('0x2b')][_0x6703('0x2c')]);_0x4cd610[_0x6703('0x30')]=_[_0x6703('0x46')](_0x451fe0[_0x6703('0x30')]);_0x4cd610[_0x6703('0x31')]=_['intersection'](_0x4cd610[_0x6703('0x32')],_0x4cd610[_0x6703('0x30')]);_0x435782['attributes']=_['intersection'](_0x4cd610[_0x6703('0x32')],qs[_0x6703('0x35')](_0x451fe0[_0x6703('0x30')][_0x6703('0x35')]));_0x435782[_0x6703('0x33')]=_0x435782['attributes']['length']?_0x435782[_0x6703('0x33')]:_0x4cd610['model'];if(_0x451fe0[_0x6703('0x30')][_0x6703('0x3f')]){_0x435782['include']=[{'all':!![]}];}_0x435782=_[_0x6703('0x3e')]({},_0x435782,_0x451fe0[_0x6703('0x47')]);return db[_0x6703('0x2b')][_0x6703('0x48')](_0x435782)[_0x6703('0x24')](handleEntityNotFound(_0x3bff13,null))['then'](respondWithResult(_0x3bff13,null))[_0x6703('0x43')](handleError(_0x3bff13,null));};exports[_0x6703('0x49')]=function(_0x18591c,_0x105108){return db[_0x6703('0x2b')][_0x6703('0x49')](_0x18591c[_0x6703('0x4a')],{})[_0x6703('0x24')](function(_0x4a6699){var _0x3fcab7=_0x18591c[_0x6703('0x4b')][_0x6703('0x4c')]({'plain':!![]});if(!_0x3fcab7)throw new Error(_0x6703('0x4d'));if(_0x3fcab7['role']===_0x6703('0x4b')){var _0x47a876=_0x4a6699[_0x6703('0x4c')]({'plain':!![]});var _0x34c87d=_0x6703('0x25');return db[_0x6703('0x4e')][_0x6703('0x48')]({'where':{'name':_0x34c87d,'userProfileId':_0x3fcab7['userProfileId']},'raw':!![]})[_0x6703('0x24')](function(_0x4ea9de){if(_0x4ea9de&&_0x4ea9de['autoAssociation']===0x0){return db[_0x6703('0x26')]['create']({'name':_0x47a876['name'],'resourceId':_0x47a876['id'],'type':_0x4ea9de[_0x6703('0x28')],'sectionId':_0x4ea9de['id']},{})[_0x6703('0x24')](function(){return _0x4a6699;});}else{return _0x4a6699;}})['catch'](function(_0x21a530){logger[_0x6703('0x4f')](_0x6703('0x50'),_0x21a530);throw _0x21a530;});}return _0x4a6699;})[_0x6703('0x24')](respondWithResult(_0x105108,0xc9))[_0x6703('0x43')](handleError(_0x105108,null));};exports[_0x6703('0x23')]=function(_0x219bf3,_0x1586fc){if(_0x219bf3['body']['id']){delete _0x219bf3[_0x6703('0x4a')]['id'];}return db[_0x6703('0x2b')]['find']({'where':{'id':_0x219bf3[_0x6703('0x45')]['id']}})[_0x6703('0x24')](handleEntityNotFound(_0x1586fc,null))[_0x6703('0x24')](saveUpdates(_0x219bf3[_0x6703('0x4a')],null))[_0x6703('0x24')](respondWithResult(_0x1586fc,null))[_0x6703('0x43')](handleError(_0x1586fc,null));};exports[_0x6703('0x51')]=function(_0x7aa57b,_0x43e875){return db[_0x6703('0x2b')][_0x6703('0x48')]({'where':{'id':_0x7aa57b['params']['id']}})[_0x6703('0x24')](handleEntityNotFound(_0x43e875,null))[_0x6703('0x24')](removeEntity(_0x43e875,null))['catch'](handleError(_0x43e875,null));};exports[_0x6703('0x52')]=function(_0x1cd22e,_0x186ee5,_0x43bca6){return db['AnalyticExtractedReport'][_0x6703('0x48')]({'where':{'id':_0x1cd22e[_0x6703('0x45')]['id']},'attributes':[_0x6703('0x28'),_0x6703('0x53'),_0x6703('0x54'),'output'],'raw':!![]})[_0x6703('0x24')](handleEntityNotFound(_0x186ee5,null))[_0x6703('0x24')](function(_0x569f12){if(_0x569f12){if(!fs[_0x6703('0x55')](path['join'](config[_0x6703('0x56')],_0x6703('0x57'),_0x569f12[_0x6703('0x54')]))){throw new db[(_0x6703('0x58'))][(_0x6703('0x59'))](_0x6703('0x5a'));}if(_0x1cd22e[_0x6703('0x30')][_0x6703('0x5b')]){return _0x186ee5[_0x6703('0x18')](0xc8);}return _0x186ee5[_0x6703('0x52')](path[_0x6703('0x5c')](config[_0x6703('0x56')],_0x6703('0x57'),_0x569f12[_0x6703('0x54')]),util[_0x6703('0x5d')]('%s.%s',_0x569f12['basename']||_0x569f12[_0x6703('0x28')],_0x569f12[_0x6703('0x5e')][_0x6703('0x5f')]()));}})[_0x6703('0x43')](handleError(_0x186ee5,null));}; \ No newline at end of file +var _0xe734=['includeAll','include','findAll','rows','params','keys','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','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','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','update','then','ExtractedReports','UserProfileResource','destroy','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options'];(function(_0x2c574e,_0x491053){var _0x1101f7=function(_0x5285c2){while(--_0x5285c2){_0x2c574e['push'](_0x2c574e['shift']());}};_0x1101f7(++_0x491053);}(_0xe734,0xeb));var _0x4e73=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xe734[_0x38ced4];return _0x547c07;};'use strict';var emlformat=require(_0x4e73('0x0'));var rimraf=require(_0x4e73('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4e73('0x2'));var rp=require('request-promise');var moment=require(_0x4e73('0x3'));var BPromise=require(_0x4e73('0x4'));var Mustache=require('mustache');var util=require(_0x4e73('0x5'));var path=require(_0x4e73('0x6'));var sox=require(_0x4e73('0x7'));var csv=require(_0x4e73('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e73('0x9'));var _=require(_0x4e73('0xa'));var squel=require(_0x4e73('0xb'));var crypto=require(_0x4e73('0xc'));var jsforce=require(_0x4e73('0xd'));var deskjs=require(_0x4e73('0xe'));var toCsv=require(_0x4e73('0x8'));var querystring=require(_0x4e73('0xf'));var Papa=require(_0x4e73('0x10'));var Redis=require(_0x4e73('0x11'));var authService=require(_0x4e73('0x12'));var qs=require(_0x4e73('0x13'));var as=require(_0x4e73('0x14'));var hardwareService=require(_0x4e73('0x15'));var logger=require(_0x4e73('0x16'))('api');var utils=require(_0x4e73('0x17'));var config=require(_0x4e73('0x18'));var licenseUtil=require(_0x4e73('0x19'));var db=require(_0x4e73('0x1a'))['db'];function respondWithStatusCode(_0x53c7fa,_0x4a35fb){_0x4a35fb=_0x4a35fb||0xcc;return function(_0x3db99f){if(_0x3db99f){return _0x53c7fa[_0x4e73('0x1b')](_0x4a35fb);}return _0x53c7fa[_0x4e73('0x1c')](_0x4a35fb)[_0x4e73('0x1d')]();};}function respondWithResult(_0x52f1c0,_0x5eb17a){_0x5eb17a=_0x5eb17a||0xc8;return function(_0x184a79){if(_0x184a79){return _0x52f1c0[_0x4e73('0x1c')](_0x5eb17a)['json'](_0x184a79);}};}function respondWithFilteredResult(_0x51820c,_0x1548ec){return function(_0x3164dd){if(_0x3164dd){var _0x1a0204=typeof _0x1548ec['offset']===_0x4e73('0x1e')&&typeof _0x1548ec[_0x4e73('0x1f')]==='undefined';var _0x450b3e=_0x3164dd[_0x4e73('0x20')];var _0x453e6c=_0x1a0204?0x0:_0x1548ec[_0x4e73('0x21')];var _0x6ba38c=_0x1a0204?_0x3164dd['count']:_0x1548ec[_0x4e73('0x21')]+_0x1548ec[_0x4e73('0x1f')];var _0x2d1e45;if(_0x6ba38c>=_0x450b3e){_0x6ba38c=_0x450b3e;_0x2d1e45=0xc8;}else{_0x2d1e45=0xce;}_0x51820c[_0x4e73('0x1c')](_0x2d1e45);return _0x51820c[_0x4e73('0x22')]('Content-Range',_0x453e6c+'-'+_0x6ba38c+'/'+_0x450b3e)[_0x4e73('0x23')](_0x3164dd);}return null;};}function patchUpdates(_0x230129){return function(_0x425d4d){try{jsonpatch[_0x4e73('0x24')](_0x425d4d,_0x230129,!![]);}catch(_0xc0ef0){return BPromise['reject'](_0xc0ef0);}return _0x425d4d['save']();};}function saveUpdates(_0xf5ad08,_0x52f317){return function(_0x24bc65){if(_0x24bc65){return _0x24bc65[_0x4e73('0x25')](_0xf5ad08)[_0x4e73('0x26')](function(_0x32b25d){return _0x32b25d;});}return null;};}function removeEntity(_0x10469c,_0x1831eb){return function(_0xa996b9){if(_0xa996b9){return _0xa996b9['destroy']()['then'](function(){var _0x58fac1=_0xa996b9['get']({'plain':!![]});var _0x209d40=_0x4e73('0x27');return db[_0x4e73('0x28')][_0x4e73('0x29')]({'where':{'type':_0x209d40,'resourceId':_0x58fac1['id']}})[_0x4e73('0x26')](function(){return _0xa996b9;});})[_0x4e73('0x26')](function(){_0x10469c[_0x4e73('0x1c')](0xcc)[_0x4e73('0x1d')]();});}};}function handleEntityNotFound(_0x60592,_0x369a9f){return function(_0x26a14b){if(!_0x26a14b){_0x60592[_0x4e73('0x1b')](0x194);}return _0x26a14b;};}function handleError(_0x4fba5e,_0x45256a){_0x45256a=_0x45256a||0x1f4;return function(_0x1d5522){logger['error'](_0x1d5522[_0x4e73('0x2a')]);if(_0x1d5522[_0x4e73('0x2b')]){delete _0x1d5522[_0x4e73('0x2b')];}_0x4fba5e['status'](_0x45256a)[_0x4e73('0x2c')](_0x1d5522);};}exports[_0x4e73('0x2d')]=function(_0x357f4f,_0x3ffe43){var _0x1a6089={},_0x47a8a0={},_0x3e6fac={'count':0x0,'rows':[]};var _0x3b3652=_[_0x4e73('0x2e')](db[_0x4e73('0x2f')][_0x4e73('0x30')],function(_0x112f63){return{'name':_0x112f63[_0x4e73('0x31')],'type':_0x112f63[_0x4e73('0x32')][_0x4e73('0x33')]};});_0x47a8a0['model']=_[_0x4e73('0x2e')](_0x3b3652,_0x4e73('0x2b'));_0x47a8a0[_0x4e73('0x34')]=_['keys'](_0x357f4f[_0x4e73('0x34')]);_0x47a8a0[_0x4e73('0x35')]=_['intersection'](_0x47a8a0[_0x4e73('0x36')],_0x47a8a0[_0x4e73('0x34')]);_0x1a6089['attributes']=_[_0x4e73('0x37')](_0x47a8a0['model'],qs['fields'](_0x357f4f[_0x4e73('0x34')][_0x4e73('0x38')]));_0x1a6089['attributes']=_0x1a6089[_0x4e73('0x39')][_0x4e73('0x3a')]?_0x1a6089[_0x4e73('0x39')]:_0x47a8a0[_0x4e73('0x36')];if(!_0x357f4f[_0x4e73('0x34')]['hasOwnProperty'](_0x4e73('0x3b'))){_0x1a6089[_0x4e73('0x1f')]=qs[_0x4e73('0x1f')](_0x357f4f[_0x4e73('0x34')]['limit']);_0x1a6089['offset']=qs[_0x4e73('0x21')](_0x357f4f[_0x4e73('0x34')]['offset']);}_0x1a6089[_0x4e73('0x3c')]=qs[_0x4e73('0x3d')](_0x357f4f[_0x4e73('0x34')]['sort']);_0x1a6089['where']=qs[_0x4e73('0x35')](_[_0x4e73('0x3e')](_0x357f4f['query'],_0x47a8a0[_0x4e73('0x35')]),_0x3b3652);if(_0x357f4f[_0x4e73('0x34')][_0x4e73('0x3f')]){_0x1a6089[_0x4e73('0x40')]=_[_0x4e73('0x41')](_0x1a6089[_0x4e73('0x40')],{'$or':_[_0x4e73('0x2e')](_0x3b3652,function(_0x4ac6b2){if(_0x4ac6b2[_0x4e73('0x32')]!==_0x4e73('0x42')){var _0xa4ca9c={};_0xa4ca9c[_0x4ac6b2[_0x4e73('0x2b')]]={'$like':'%'+_0x357f4f['query'][_0x4e73('0x3f')]+'%'};return _0xa4ca9c;}})});}_0x1a6089=_[_0x4e73('0x41')]({},_0x1a6089,_0x357f4f[_0x4e73('0x43')]);var _0x5964d9={'where':_0x1a6089[_0x4e73('0x40')]};return db[_0x4e73('0x2f')][_0x4e73('0x20')](_0x5964d9)[_0x4e73('0x26')](function(_0x26dc21){_0x3e6fac[_0x4e73('0x20')]=_0x26dc21;if(_0x357f4f[_0x4e73('0x34')][_0x4e73('0x44')]){_0x1a6089[_0x4e73('0x45')]=[{'all':!![]}];}return db[_0x4e73('0x2f')][_0x4e73('0x46')](_0x1a6089);})['then'](function(_0x37cf69){_0x3e6fac[_0x4e73('0x47')]=_0x37cf69;return _0x3e6fac;})['then'](respondWithFilteredResult(_0x3ffe43,_0x1a6089))['catch'](handleError(_0x3ffe43,null));};exports['show']=function(_0x1c6953,_0x35250e){var _0x104e92={'raw':!![],'where':{'id':_0x1c6953[_0x4e73('0x48')]['id']}},_0x578970={};_0x578970['model']=_['keys'](db[_0x4e73('0x2f')][_0x4e73('0x30')]);_0x578970[_0x4e73('0x34')]=_[_0x4e73('0x49')](_0x1c6953[_0x4e73('0x34')]);_0x578970[_0x4e73('0x35')]=_[_0x4e73('0x37')](_0x578970[_0x4e73('0x36')],_0x578970[_0x4e73('0x34')]);_0x104e92[_0x4e73('0x39')]=_[_0x4e73('0x37')](_0x578970[_0x4e73('0x36')],qs[_0x4e73('0x38')](_0x1c6953[_0x4e73('0x34')]['fields']));_0x104e92[_0x4e73('0x39')]=_0x104e92[_0x4e73('0x39')][_0x4e73('0x3a')]?_0x104e92[_0x4e73('0x39')]:_0x578970[_0x4e73('0x36')];if(_0x1c6953[_0x4e73('0x34')]['includeAll']){_0x104e92['include']=[{'all':!![]}];}_0x104e92=_[_0x4e73('0x41')]({},_0x104e92,_0x1c6953[_0x4e73('0x43')]);return db[_0x4e73('0x2f')][_0x4e73('0x4a')](_0x104e92)['then'](handleEntityNotFound(_0x35250e,null))[_0x4e73('0x26')](respondWithResult(_0x35250e,null))[_0x4e73('0x4b')](handleError(_0x35250e,null));};exports[_0x4e73('0x4c')]=function(_0x149df3,_0x2e30cb){return db[_0x4e73('0x2f')][_0x4e73('0x4c')](_0x149df3[_0x4e73('0x4d')],{})[_0x4e73('0x26')](function(_0x51f399){var _0x545b65=_0x149df3[_0x4e73('0x4e')][_0x4e73('0x4f')]({'plain':!![]});if(!_0x545b65)throw new Error(_0x4e73('0x50'));if(_0x545b65[_0x4e73('0x51')]===_0x4e73('0x4e')){var _0x10c3a8=_0x51f399[_0x4e73('0x4f')]({'plain':!![]});var _0xb2b7f9=_0x4e73('0x27');return db['UserProfileSection'][_0x4e73('0x4a')]({'where':{'name':_0xb2b7f9,'userProfileId':_0x545b65[_0x4e73('0x52')]},'raw':!![]})[_0x4e73('0x26')](function(_0xdd25ae){if(_0xdd25ae&&_0xdd25ae[_0x4e73('0x53')]===0x0){return db[_0x4e73('0x28')][_0x4e73('0x4c')]({'name':_0x10c3a8[_0x4e73('0x2b')],'resourceId':_0x10c3a8['id'],'type':_0xdd25ae[_0x4e73('0x2b')],'sectionId':_0xdd25ae['id']},{})['then'](function(){return _0x51f399;});}else{return _0x51f399;}})['catch'](function(_0x238f72){logger[_0x4e73('0x54')](_0x4e73('0x55'),_0x238f72);throw _0x238f72;});}return _0x51f399;})[_0x4e73('0x26')](respondWithResult(_0x2e30cb,0xc9))[_0x4e73('0x4b')](handleError(_0x2e30cb,null));};exports[_0x4e73('0x25')]=function(_0xc541e3,_0x26a634){if(_0xc541e3[_0x4e73('0x4d')]['id']){delete _0xc541e3['body']['id'];}return db[_0x4e73('0x2f')][_0x4e73('0x4a')]({'where':{'id':_0xc541e3[_0x4e73('0x48')]['id']}})[_0x4e73('0x26')](handleEntityNotFound(_0x26a634,null))['then'](saveUpdates(_0xc541e3[_0x4e73('0x4d')],null))['then'](respondWithResult(_0x26a634,null))[_0x4e73('0x4b')](handleError(_0x26a634,null));};exports[_0x4e73('0x29')]=function(_0x33326d,_0x45c48f){return db[_0x4e73('0x2f')][_0x4e73('0x4a')]({'where':{'id':_0x33326d['params']['id']}})[_0x4e73('0x26')](handleEntityNotFound(_0x45c48f,null))[_0x4e73('0x26')](removeEntity(_0x45c48f,null))[_0x4e73('0x4b')](handleError(_0x45c48f,null));};exports[_0x4e73('0x56')]=function(_0xe5bd5c,_0xd666c9,_0x3c9c48){return db['AnalyticExtractedReport'][_0x4e73('0x4a')]({'where':{'id':_0xe5bd5c[_0x4e73('0x48')]['id']},'attributes':[_0x4e73('0x2b'),_0x4e73('0x57'),_0x4e73('0x58'),_0x4e73('0x59')],'raw':!![]})[_0x4e73('0x26')](handleEntityNotFound(_0xd666c9,null))['then'](function(_0x49ed4b){if(_0x49ed4b){if(!fs[_0x4e73('0x5a')](path[_0x4e73('0x5b')](config[_0x4e73('0x5c')],_0x4e73('0x5d'),_0x49ed4b[_0x4e73('0x58')]))){throw new db[(_0x4e73('0x5e'))][(_0x4e73('0x5f'))](_0x4e73('0x60'));}if(_0xe5bd5c[_0x4e73('0x34')][_0x4e73('0x61')]){return _0xd666c9[_0x4e73('0x1b')](0xc8);}return _0xd666c9[_0x4e73('0x56')](path[_0x4e73('0x5b')](config[_0x4e73('0x5c')],_0x4e73('0x5d'),_0x49ed4b[_0x4e73('0x58')]),util[_0x4e73('0x62')](_0x4e73('0x63'),_0x49ed4b[_0x4e73('0x57')]||_0x49ed4b[_0x4e73('0x2b')],_0x49ed4b[_0x4e73('0x59')][_0x4e73('0x64')]()));}})[_0x4e73('0x4b')](handleError(_0xd666c9,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 44d4eb3..23179f1 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 _0xd3d2=['api','moment','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','lodash','util','../../config/logger'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xd3d2,0xc9));var _0x2d3d=function(_0x2b8ef9,_0x238c2a){_0x2b8ef9=_0x2b8ef9-0x0;var _0x25f841=_0xd3d2[_0x2b8ef9];return _0x25f841;};'use strict';var _=require(_0x2d3d('0x0'));var util=require(_0x2d3d('0x1'));var logger=require(_0x2d3d('0x2'))(_0x2d3d('0x3'));var moment=require(_0x2d3d('0x4'));var BPromise=require(_0x2d3d('0x5'));var rp=require(_0x2d3d('0x6'));var fs=require('fs');var path=require(_0x2d3d('0x7'));var rimraf=require('rimraf');var config=require(_0x2d3d('0x8'));var attributes=require(_0x2d3d('0x9'));module[_0x2d3d('0xa')]=function(_0x12c5e6,_0x10efcb){return _0x12c5e6['define'](_0x2d3d('0xb'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa86c=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x46c5b0,_0x233a9f){var _0x3e2342=function(_0x2bbc8c){while(--_0x2bbc8c){_0x46c5b0['push'](_0x46c5b0['shift']());}};_0x3e2342(++_0x233a9f);}(_0xa86c,0x19a));var _0xca86=function(_0x3f474a,_0xd54130){_0x3f474a=_0x3f474a-0x0;var _0x272589=_0xa86c[_0x3f474a];return _0x272589;};'use strict';var _=require(_0xca86('0x0'));var util=require(_0xca86('0x1'));var logger=require(_0xca86('0x2'))(_0xca86('0x3'));var moment=require(_0xca86('0x4'));var BPromise=require(_0xca86('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca86('0x6'));var rimraf=require(_0xca86('0x7'));var config=require(_0xca86('0x8'));var attributes=require(_0xca86('0x9'));module[_0xca86('0xa')]=function(_0x3d9eb7,_0x5d2178){return _0x3d9eb7[_0xca86('0xb')]('AnalyticExtractedReport',attributes,{'tableName':_0xca86('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 8011062..feae24e 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 _0x5c6d=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x67fb93,_0x3382f6){var _0x43569d=function(_0x536ca5){while(--_0x536ca5){_0x67fb93['push'](_0x67fb93['shift']());}};_0x43569d(++_0x3382f6);}(_0x5c6d,0x195));var _0xd5c6=function(_0x23080a,_0x4e29a7){_0x23080a=_0x23080a-0x0;var _0x3586d4=_0x5c6d[_0x23080a];return _0x3586d4;};'use strict';var _=require(_0xd5c6('0x0'));var util=require(_0xd5c6('0x1'));var moment=require('moment');var BPromise=require(_0xd5c6('0x2'));var rs=require(_0xd5c6('0x3'));var fs=require('fs');var Redis=require(_0xd5c6('0x4'));var db=require(_0xd5c6('0x5'))['db'];var utils=require(_0xd5c6('0x6'));var logger=require(_0xd5c6('0x7'))('rpc');var config=require(_0xd5c6('0x8'));var jayson=require(_0xd5c6('0x9'));var client=jayson[_0xd5c6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ff57d,_0x583506,_0x5649c0){return new BPromise(function(_0x523302,_0x34b705){return client[_0xd5c6('0xb')](_0x1ff57d,_0x5649c0)[_0xd5c6('0xc')](function(_0x28c851){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x583506,_0xd5c6('0xd'));logger[_0xd5c6('0xe')](_0xd5c6('0xf'),_0x583506,'request\x20sent',JSON['stringify'](_0x28c851));if(_0x28c851['error']){if(_0x28c851[_0xd5c6('0x10')][_0xd5c6('0x11')]===0x1f4){logger['error'](_0xd5c6('0x12'),_0x583506,_0x28c851[_0xd5c6('0x10')][_0xd5c6('0x13')]);return _0x34b705(_0x28c851[_0xd5c6('0x10')][_0xd5c6('0x13')]);}logger[_0xd5c6('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x583506,_0x28c851[_0xd5c6('0x10')][_0xd5c6('0x13')]);return _0x523302(_0x28c851['error'][_0xd5c6('0x13')]);}else{logger[_0xd5c6('0x14')](_0xd5c6('0x12'),_0x583506,_0xd5c6('0xd'));_0x523302(_0x28c851['result'][_0xd5c6('0x13')]);}})[_0xd5c6('0x15')](function(_0x201629){logger['error'](_0xd5c6('0x12'),_0x583506,_0x201629);_0x34b705(_0x201629);});});} \ No newline at end of file +var _0x04fa=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','request\x20sent'];(function(_0x8fc728,_0x3d01b0){var _0x11fd7c=function(_0x165c6c){while(--_0x165c6c){_0x8fc728['push'](_0x8fc728['shift']());}};_0x11fd7c(++_0x3d01b0);}(_0x04fa,0x119));var _0xa04f=function(_0x5bd478,_0x2d8524){_0x5bd478=_0x5bd478-0x0;var _0x3bd7ca=_0x04fa[_0x5bd478];return _0x3bd7ca;};'use strict';var _=require('lodash');var util=require(_0xa04f('0x0'));var moment=require(_0xa04f('0x1'));var BPromise=require(_0xa04f('0x2'));var rs=require(_0xa04f('0x3'));var fs=require('fs');var Redis=require(_0xa04f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa04f('0x5'));var logger=require('../../config/logger')(_0xa04f('0x6'));var config=require(_0xa04f('0x7'));var jayson=require(_0xa04f('0x8'));var client=jayson['client'][_0xa04f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c521c,_0x315771,_0x56f898){return new BPromise(function(_0x303e54,_0x4a2e03){return client['request'](_0x2c521c,_0x56f898)['then'](function(_0x5ea498){logger[_0xa04f('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x315771,'request\x20sent');logger[_0xa04f('0xb')](_0xa04f('0xc'),_0x315771,'request\x20sent',JSON[_0xa04f('0xd')](_0x5ea498));if(_0x5ea498['error']){if(_0x5ea498[_0xa04f('0xe')][_0xa04f('0xf')]===0x1f4){logger['error'](_0xa04f('0x10'),_0x315771,_0x5ea498[_0xa04f('0xe')]['message']);return _0x4a2e03(_0x5ea498['error']['message']);}logger[_0xa04f('0xe')](_0xa04f('0x10'),_0x315771,_0x5ea498[_0xa04f('0xe')][_0xa04f('0x11')]);return _0x303e54(_0x5ea498[_0xa04f('0xe')][_0xa04f('0x11')]);}else{logger['info'](_0xa04f('0x10'),_0x315771,_0xa04f('0x12'));_0x303e54(_0x5ea498['result'][_0xa04f('0x11')]);}})[_0xa04f('0x13')](function(_0x505abc){logger[_0xa04f('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x315771,_0x505abc);_0x4a2e03(_0x505abc);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 6cd148f..5dfeb9f 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 _0x046c=['get','index','/:id','show','/:id/download','post','create','put','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x23428f,_0x288620){var _0x4a1f23=function(_0x4d1f1d){while(--_0x4d1f1d){_0x23428f['push'](_0x23428f['shift']());}};_0x4a1f23(++_0x288620);}(_0x046c,0x8a));var _0xc046=function(_0x53f37f,_0xfb0b18){_0x53f37f=_0x53f37f-0x0;var _0x2fe5f8=_0x046c[_0x53f37f];return _0x2fe5f8;};'use strict';var multer=require(_0xc046('0x0'));var util=require(_0xc046('0x1'));var path=require(_0xc046('0x2'));var timeout=require(_0xc046('0x3'));var express=require(_0xc046('0x4'));var router=express['Router']();var fs_extra=require(_0xc046('0x5'));var auth=require(_0xc046('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc046('0x7'));var controller=require(_0xc046('0x8'));router[_0xc046('0x9')]('/',auth['isAuthenticated'](),controller[_0xc046('0xa')]);router['get'](_0xc046('0xb'),auth['isAuthenticated'](),controller[_0xc046('0xc')]);router[_0xc046('0x9')](_0xc046('0xd'),auth['isAuthenticated'](),controller['download']);router[_0xc046('0xe')]('/',auth['isAuthenticated'](),controller[_0xc046('0xf')]);router[_0xc046('0x10')](_0xc046('0xb'),auth[_0xc046('0x11')](),controller[_0xc046('0x12')]);router['delete']('/:id',auth[_0xc046('0x11')](),controller[_0xc046('0x13')]);module[_0xc046('0x14')]=router; \ No newline at end of file +var _0x3773=['index','show','/:id/download','download','post','create','/:id','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x542c11,_0x35d5df){var _0xd5ba30=function(_0x352bff){while(--_0x352bff){_0x542c11['push'](_0x542c11['shift']());}};_0xd5ba30(++_0x35d5df);}(_0x3773,0x171));var _0x3377=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x3773[_0xa148b7];return _0x51efd3;};'use strict';var multer=require('multer');var util=require(_0x3377('0x0'));var path=require(_0x3377('0x1'));var timeout=require(_0x3377('0x2'));var express=require('express');var router=express[_0x3377('0x3')]();var fs_extra=require(_0x3377('0x4'));var auth=require(_0x3377('0x5'));var interaction=require(_0x3377('0x6'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x3377('0x7')]('/',auth[_0x3377('0x8')](),controller[_0x3377('0x9')]);router[_0x3377('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3377('0xa')]);router['get'](_0x3377('0xb'),auth['isAuthenticated'](),controller[_0x3377('0xc')]);router[_0x3377('0xd')]('/',auth[_0x3377('0x8')](),controller[_0x3377('0xe')]);router['put'](_0x3377('0xf'),auth[_0x3377('0x8')](),controller['update']);router[_0x3377('0x10')](_0x3377('0xf'),auth[_0x3377('0x8')](),controller[_0x3377('0x11')]);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 8f61c5d..c90bc18 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 _0xc2c6=['STRING','BOOLEAN','exports'];(function(_0x1c101f,_0x52141d){var _0xe02ee4=function(_0x1d9034){while(--_0x1d9034){_0x1c101f['push'](_0x1c101f['shift']());}};_0xe02ee4(++_0x52141d);}(_0xc2c6,0x188));var _0x6c2c=function(_0x871ef5,_0x58880b){_0x871ef5=_0x871ef5-0x0;var _0x1f62ea=_0xc2c6[_0x871ef5];return _0x1f62ea;};'use strict';var Sequelize=require('sequelize');module[_0x6c2c('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x6c2c('0x1')]},'format':{'type':Sequelize[_0x6c2c('0x1')]},'groupBy':{'type':Sequelize[_0x6c2c('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6c2c('0x1')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf8dc=['TEXT','STRING','sequelize','exports'];(function(_0x43c28c,_0x115131){var _0x3b8871=function(_0x25fe78){while(--_0x25fe78){_0x43c28c['push'](_0x43c28c['shift']());}};_0x3b8871(++_0x115131);}(_0xf8dc,0x182));var _0xcf8d=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xf8dc[_0x298ed3];return _0x5aad28;};'use strict';var Sequelize=require(_0xcf8d('0x0'));module[_0xcf8d('0x1')]={'field':{'type':Sequelize[_0xcf8d('0x2')]},'alias':{'type':Sequelize[_0xcf8d('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xcf8d('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xcf8d('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 474c8fe..4f341c2 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 _0x226a=['to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','bulkCreate','ids','addFields','findOne','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3f6aa5,_0x52f31e){var _0x885aa=function(_0x382003){while(--_0x382003){_0x3f6aa5['push'](_0x3f6aa5['shift']());}};_0x885aa(++_0x52f31e);}(_0x226a,0x125));var _0xa226=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x226a[_0x1a9204];return _0x17ca68;};'use strict';var emlformat=require(_0xa226('0x0'));var rimraf=require(_0xa226('0x1'));var zipdir=require(_0xa226('0x2'));var jsonpatch=require(_0xa226('0x3'));var rp=require(_0xa226('0x4'));var moment=require('moment');var BPromise=require(_0xa226('0x5'));var Mustache=require(_0xa226('0x6'));var util=require(_0xa226('0x7'));var path=require(_0xa226('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa226('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa226('0xa'));var squel=require(_0xa226('0xb'));var crypto=require(_0xa226('0xc'));var jsforce=require(_0xa226('0xd'));var deskjs=require(_0xa226('0xe'));var toCsv=require(_0xa226('0xf'));var querystring=require('querystring');var Papa=require(_0xa226('0x10'));var Redis=require(_0xa226('0x11'));var authService=require(_0xa226('0x12'));var qs=require(_0xa226('0x13'));var as=require(_0xa226('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa226('0x15'))('api');var utils=require(_0xa226('0x16'));var config=require(_0xa226('0x17'));var licenseUtil=require(_0xa226('0x18'));var db=require(_0xa226('0x19'))['db'];function respondWithStatusCode(_0x549b89,_0x3b4a46){_0x3b4a46=_0x3b4a46||0xcc;return function(_0x2c03ca){if(_0x2c03ca){return _0x549b89['sendStatus'](_0x3b4a46);}return _0x549b89[_0xa226('0x1a')](_0x3b4a46)[_0xa226('0x1b')]();};}function respondWithResult(_0x5634a2,_0x41c8b2){_0x41c8b2=_0x41c8b2||0xc8;return function(_0x51941e){if(_0x51941e){return _0x5634a2[_0xa226('0x1a')](_0x41c8b2)[_0xa226('0x1c')](_0x51941e);}};}function respondWithFilteredResult(_0x5be735,_0x6745b5){return function(_0x5455ed){if(_0x5455ed){var _0x3afed2=typeof _0x6745b5[_0xa226('0x1d')]===_0xa226('0x1e')&&typeof _0x6745b5[_0xa226('0x1f')]===_0xa226('0x1e');var _0x25da2d=_0x5455ed['count'];var _0x504099=_0x3afed2?0x0:_0x6745b5[_0xa226('0x1d')];var _0x4d1317=_0x3afed2?_0x5455ed[_0xa226('0x20')]:_0x6745b5['offset']+_0x6745b5['limit'];var _0x3e81eb;if(_0x4d1317>=_0x25da2d){_0x4d1317=_0x25da2d;_0x3e81eb=0xc8;}else{_0x3e81eb=0xce;}_0x5be735['status'](_0x3e81eb);return _0x5be735['set']('Content-Range',_0x504099+'-'+_0x4d1317+'/'+_0x25da2d)[_0xa226('0x1c')](_0x5455ed);}return null;};}function patchUpdates(_0x50ff03){return function(_0x2b1cb9){try{jsonpatch['apply'](_0x2b1cb9,_0x50ff03,!![]);}catch(_0x4e6187){return BPromise[_0xa226('0x21')](_0x4e6187);}return _0x2b1cb9[_0xa226('0x22')]();};}function saveUpdates(_0x1c6cd1,_0x5adbda){return function(_0x2d78c5){if(_0x2d78c5){return _0x2d78c5[_0xa226('0x23')](_0x1c6cd1)[_0xa226('0x24')](function(_0x217545){return _0x217545;});}return null;};}function removeEntity(_0x3afd10,_0x1623dc){return function(_0x439de7){if(_0x439de7){return _0x439de7[_0xa226('0x25')]()['then'](function(){_0x3afd10[_0xa226('0x1a')](0xcc)[_0xa226('0x1b')]();});}};}function handleEntityNotFound(_0x5a0576,_0x1aeccc){return function(_0x20f571){if(!_0x20f571){_0x5a0576[_0xa226('0x26')](0x194);}return _0x20f571;};}function handleError(_0x17985a,_0x5be847){_0x5be847=_0x5be847||0x1f4;return function(_0x4a8341){logger['error'](_0x4a8341[_0xa226('0x27')]);if(_0x4a8341[_0xa226('0x28')]){delete _0x4a8341[_0xa226('0x28')];}_0x17985a[_0xa226('0x1a')](_0x5be847)[_0xa226('0x29')](_0x4a8341);};}exports[_0xa226('0x2a')]=function(_0x2c29d9,_0x5844c3){var _0x1dedff={},_0x167221={},_0x3085ce={'count':0x0,'rows':[]};var _0x16c6fb=_[_0xa226('0x2b')](db[_0xa226('0x2c')][_0xa226('0x2d')],function(_0x2eb50c){return{'name':_0x2eb50c['fieldName'],'type':_0x2eb50c[_0xa226('0x2e')]['key']};});_0x167221[_0xa226('0x2f')]=_[_0xa226('0x2b')](_0x16c6fb,_0xa226('0x28'));_0x167221[_0xa226('0x30')]=_[_0xa226('0x31')](_0x2c29d9[_0xa226('0x30')]);_0x167221[_0xa226('0x32')]=_[_0xa226('0x33')](_0x167221['model'],_0x167221['query']);_0x1dedff[_0xa226('0x34')]=_['intersection'](_0x167221[_0xa226('0x2f')],qs[_0xa226('0x35')](_0x2c29d9[_0xa226('0x30')]['fields']));_0x1dedff[_0xa226('0x34')]=_0x1dedff[_0xa226('0x34')][_0xa226('0x36')]?_0x1dedff[_0xa226('0x34')]:_0x167221[_0xa226('0x2f')];if(!_0x2c29d9['query'][_0xa226('0x37')]('nolimit')){_0x1dedff[_0xa226('0x1f')]=qs[_0xa226('0x1f')](_0x2c29d9[_0xa226('0x30')][_0xa226('0x1f')]);_0x1dedff[_0xa226('0x1d')]=qs[_0xa226('0x1d')](_0x2c29d9[_0xa226('0x30')][_0xa226('0x1d')]);}_0x1dedff[_0xa226('0x38')]=qs[_0xa226('0x39')](_0x2c29d9[_0xa226('0x30')][_0xa226('0x39')]);_0x1dedff[_0xa226('0x3a')]=qs['filters'](_[_0xa226('0x3b')](_0x2c29d9[_0xa226('0x30')],_0x167221[_0xa226('0x32')]),_0x16c6fb);if(_0x2c29d9[_0xa226('0x30')][_0xa226('0x3c')]){_0x1dedff[_0xa226('0x3a')]=_[_0xa226('0x3d')](_0x1dedff[_0xa226('0x3a')],{'$or':_[_0xa226('0x2b')](_0x16c6fb,function(_0x1e8486){if(_0x1e8486[_0xa226('0x2e')]!==_0xa226('0x3e')){var _0x3b488a={};_0x3b488a[_0x1e8486[_0xa226('0x28')]]={'$like':'%'+_0x2c29d9[_0xa226('0x30')][_0xa226('0x3c')]+'%'};return _0x3b488a;}})});}_0x1dedff=_[_0xa226('0x3d')]({},_0x1dedff,_0x2c29d9[_0xa226('0x3f')]);var _0x44add8={'where':_0x1dedff[_0xa226('0x3a')]};return db[_0xa226('0x2c')]['count'](_0x44add8)[_0xa226('0x24')](function(_0x4c0b21){_0x3085ce[_0xa226('0x20')]=_0x4c0b21;if(_0x2c29d9['query'][_0xa226('0x40')]){_0x1dedff[_0xa226('0x41')]=[{'all':!![]}];}return db[_0xa226('0x2c')][_0xa226('0x42')](_0x1dedff);})[_0xa226('0x24')](function(_0x5c7f6f){_0x3085ce['rows']=_0x5c7f6f;return _0x3085ce;})[_0xa226('0x24')](respondWithFilteredResult(_0x5844c3,_0x1dedff))['catch'](handleError(_0x5844c3,null));};exports['show']=function(_0x27dcb4,_0x71a35e){var _0x3b9c45={'raw':![],'where':{'id':_0x27dcb4[_0xa226('0x43')]['id']}},_0x1a94e4={};_0x1a94e4['model']=_[_0xa226('0x31')](db[_0xa226('0x2c')][_0xa226('0x2d')]);_0x1a94e4['query']=_[_0xa226('0x31')](_0x27dcb4[_0xa226('0x30')]);_0x1a94e4[_0xa226('0x32')]=_[_0xa226('0x33')](_0x1a94e4['model'],_0x1a94e4[_0xa226('0x30')]);_0x3b9c45[_0xa226('0x34')]=_[_0xa226('0x33')](_0x1a94e4[_0xa226('0x2f')],qs[_0xa226('0x35')](_0x27dcb4['query'][_0xa226('0x35')]));_0x3b9c45['attributes']=_0x3b9c45['attributes'][_0xa226('0x36')]?_0x3b9c45[_0xa226('0x34')]:_0x1a94e4[_0xa226('0x2f')];if(_0x27dcb4[_0xa226('0x30')][_0xa226('0x40')]){_0x3b9c45['include']=[{'all':!![]}];}_0x3b9c45=_[_0xa226('0x3d')]({},_0x3b9c45,_0x27dcb4[_0xa226('0x3f')]);return db['AnalyticFieldReport'][_0xa226('0x44')](_0x3b9c45)[_0xa226('0x24')](handleEntityNotFound(_0x71a35e,null))[_0xa226('0x24')](respondWithResult(_0x71a35e,null))[_0xa226('0x45')](handleError(_0x71a35e,null));};exports[_0xa226('0x46')]=function(_0x9d1de5,_0x27d598){return db['AnalyticFieldReport']['create'](_0x9d1de5[_0xa226('0x47')],{})[_0xa226('0x24')](respondWithResult(_0x27d598,0xc9))[_0xa226('0x45')](handleError(_0x27d598,null));};exports['bulkCreate']=function(_0x492250,_0x5197b6){return db[_0xa226('0x2c')][_0xa226('0x48')](_0x492250[_0xa226('0x47')],{'raw':![],'individualHooks':!![]})[_0xa226('0x24')](respondWithResult(_0x5197b6,0xc9))[_0xa226('0x45')](handleError(_0x5197b6,null));};exports[_0xa226('0x23')]=function(_0x3fa8e6,_0x1feca0){if(_0x3fa8e6[_0xa226('0x47')]['id']){delete _0x3fa8e6[_0xa226('0x47')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x3fa8e6['params']['id']}})[_0xa226('0x24')](handleEntityNotFound(_0x1feca0,null))[_0xa226('0x24')](saveUpdates(_0x3fa8e6['body'],null))[_0xa226('0x24')](respondWithResult(_0x1feca0,null))[_0xa226('0x45')](handleError(_0x1feca0,null));};exports[_0xa226('0x25')]=function(_0x440b72,_0x11e1ed){return db[_0xa226('0x2c')]['find']({'where':{'id':_0x440b72[_0xa226('0x43')]['id']}})[_0xa226('0x24')](handleEntityNotFound(_0x11e1ed,null))[_0xa226('0x24')](removeEntity(_0x11e1ed,null))[_0xa226('0x45')](handleError(_0x11e1ed,null));};exports['bulkDestroy']=function(_0x29bb73,_0x3fcf87){return db[_0xa226('0x2c')][_0xa226('0x25')]({'where':{'id':_0x29bb73[_0xa226('0x30')][_0xa226('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xa226('0x24')](respondWithResult(_0x3fcf87,0xcc))[_0xa226('0x45')](handleError(_0x3fcf87,null));};exports[_0xa226('0x4a')]=function(_0x4be521,_0x473b03,_0x36fd3d){return db['AnalyticCustomReport'][_0xa226('0x4b')]({'where':{'id':_0x4be521[_0xa226('0x43')]['id']}})[_0xa226('0x24')](handleEntityNotFound(_0x473b03,null))[_0xa226('0x24')](function(_0x3dc438){if(_0x3dc438){return db[_0xa226('0x4c')]['transaction'](function(_0x495802){return db[_0xa226('0x2c')][_0xa226('0x25')]({'where':{'CustomReportId':_0x4be521[_0xa226('0x43')]['id']},'transaction':_0x495802})['then'](function(_0x21bcf9){var _0x95bc85=_[_0xa226('0x2b')](_0x4be521['body'],function(_0x2decdd){delete _0x2decdd['id'];_0x2decdd['CustomReportId']=_0x4be521[_0xa226('0x43')]['id'];return _0x2decdd;});return db[_0xa226('0x2c')]['bulkCreate'](_0x95bc85,{'transaction':_0x495802});});})[_0xa226('0x24')](function(){return db[_0xa226('0x2c')][_0xa226('0x42')]({'where':{'CustomReportId':_0x4be521[_0xa226('0x43')]['id']}});});}})[_0xa226('0x24')](respondWithResult(_0x473b03,null))[_0xa226('0x45')](handleError(_0x473b03,null));}; \ No newline at end of file +var _0x323a=['apply','reject','save','update','destroy','then','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','rows','params','include','options','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x510219,_0x2a5f59){var _0x309f9a=function(_0x24de0e){while(--_0x24de0e){_0x510219['push'](_0x510219['shift']());}};_0x309f9a(++_0x2a5f59);}(_0x323a,0xd8));var _0xa323=function(_0x11b55f,_0x280622){_0x11b55f=_0x11b55f-0x0;var _0x4c944c=_0x323a[_0x11b55f];return _0x4c944c;};'use strict';var emlformat=require(_0xa323('0x0'));var rimraf=require(_0xa323('0x1'));var zipdir=require(_0xa323('0x2'));var jsonpatch=require(_0xa323('0x3'));var rp=require(_0xa323('0x4'));var moment=require(_0xa323('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa323('0x6'));var util=require(_0xa323('0x7'));var path=require(_0xa323('0x8'));var sox=require(_0xa323('0x9'));var csv=require('to-csv');var ejs=require(_0xa323('0xa'));var fs=require('fs');var fs_extra=require(_0xa323('0xb'));var _=require(_0xa323('0xc'));var squel=require('squel');var crypto=require(_0xa323('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa323('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa323('0xf'));var Papa=require(_0xa323('0x10'));var Redis=require(_0xa323('0x11'));var authService=require(_0xa323('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa323('0x13'));var logger=require(_0xa323('0x14'))(_0xa323('0x15'));var utils=require(_0xa323('0x16'));var config=require(_0xa323('0x17'));var licenseUtil=require(_0xa323('0x18'));var db=require(_0xa323('0x19'))['db'];function respondWithStatusCode(_0x36a8a7,_0x23e99d){_0x23e99d=_0x23e99d||0xcc;return function(_0x4d4c2c){if(_0x4d4c2c){return _0x36a8a7[_0xa323('0x1a')](_0x23e99d);}return _0x36a8a7['status'](_0x23e99d)[_0xa323('0x1b')]();};}function respondWithResult(_0x4ffa9f,_0x5dd133){_0x5dd133=_0x5dd133||0xc8;return function(_0x2c185c){if(_0x2c185c){return _0x4ffa9f[_0xa323('0x1c')](_0x5dd133)[_0xa323('0x1d')](_0x2c185c);}};}function respondWithFilteredResult(_0x38039f,_0x54a4a5){return function(_0x265fed){if(_0x265fed){var _0x2988c6=typeof _0x54a4a5[_0xa323('0x1e')]===_0xa323('0x1f')&&typeof _0x54a4a5[_0xa323('0x20')]===_0xa323('0x1f');var _0x36a37a=_0x265fed['count'];var _0x209045=_0x2988c6?0x0:_0x54a4a5[_0xa323('0x1e')];var _0x260a00=_0x2988c6?_0x265fed[_0xa323('0x21')]:_0x54a4a5['offset']+_0x54a4a5['limit'];var _0x1dc1d2;if(_0x260a00>=_0x36a37a){_0x260a00=_0x36a37a;_0x1dc1d2=0xc8;}else{_0x1dc1d2=0xce;}_0x38039f[_0xa323('0x1c')](_0x1dc1d2);return _0x38039f[_0xa323('0x22')](_0xa323('0x23'),_0x209045+'-'+_0x260a00+'/'+_0x36a37a)['json'](_0x265fed);}return null;};}function patchUpdates(_0x1fb51f){return function(_0x544cd8){try{jsonpatch[_0xa323('0x24')](_0x544cd8,_0x1fb51f,!![]);}catch(_0x39e665){return BPromise[_0xa323('0x25')](_0x39e665);}return _0x544cd8[_0xa323('0x26')]();};}function saveUpdates(_0x137c65,_0x2a33df){return function(_0x5abf2e){if(_0x5abf2e){return _0x5abf2e[_0xa323('0x27')](_0x137c65)['then'](function(_0x443c6a){return _0x443c6a;});}return null;};}function removeEntity(_0x592163,_0x1becd2){return function(_0x5090e6){if(_0x5090e6){return _0x5090e6[_0xa323('0x28')]()[_0xa323('0x29')](function(){_0x592163[_0xa323('0x1c')](0xcc)[_0xa323('0x1b')]();});}};}function handleEntityNotFound(_0x24c7c9,_0x30e5b2){return function(_0x3eab3f){if(!_0x3eab3f){_0x24c7c9['sendStatus'](0x194);}return _0x3eab3f;};}function handleError(_0x46bb37,_0xf6f646){_0xf6f646=_0xf6f646||0x1f4;return function(_0x1bb4b2){logger[_0xa323('0x2a')](_0x1bb4b2[_0xa323('0x2b')]);if(_0x1bb4b2['name']){delete _0x1bb4b2[_0xa323('0x2c')];}_0x46bb37[_0xa323('0x1c')](_0xf6f646)[_0xa323('0x2d')](_0x1bb4b2);};}exports['index']=function(_0x4f28be,_0x2c91ff){var _0x2d9e8e={},_0x2092b7={},_0x40a346={'count':0x0,'rows':[]};var _0x46ff99=_[_0xa323('0x2e')](db[_0xa323('0x2f')][_0xa323('0x30')],function(_0x153551){return{'name':_0x153551['fieldName'],'type':_0x153551['type']['key']};});_0x2092b7[_0xa323('0x31')]=_[_0xa323('0x2e')](_0x46ff99,_0xa323('0x2c'));_0x2092b7[_0xa323('0x32')]=_[_0xa323('0x33')](_0x4f28be[_0xa323('0x32')]);_0x2092b7[_0xa323('0x34')]=_['intersection'](_0x2092b7[_0xa323('0x31')],_0x2092b7['query']);_0x2d9e8e[_0xa323('0x35')]=_[_0xa323('0x36')](_0x2092b7[_0xa323('0x31')],qs[_0xa323('0x37')](_0x4f28be[_0xa323('0x32')][_0xa323('0x37')]));_0x2d9e8e[_0xa323('0x35')]=_0x2d9e8e[_0xa323('0x35')][_0xa323('0x38')]?_0x2d9e8e['attributes']:_0x2092b7['model'];if(!_0x4f28be[_0xa323('0x32')]['hasOwnProperty']('nolimit')){_0x2d9e8e[_0xa323('0x20')]=qs['limit'](_0x4f28be['query'][_0xa323('0x20')]);_0x2d9e8e[_0xa323('0x1e')]=qs[_0xa323('0x1e')](_0x4f28be['query'][_0xa323('0x1e')]);}_0x2d9e8e[_0xa323('0x39')]=qs['sort'](_0x4f28be[_0xa323('0x32')][_0xa323('0x3a')]);_0x2d9e8e[_0xa323('0x3b')]=qs['filters'](_[_0xa323('0x3c')](_0x4f28be[_0xa323('0x32')],_0x2092b7[_0xa323('0x34')]),_0x46ff99);if(_0x4f28be[_0xa323('0x32')][_0xa323('0x3d')]){_0x2d9e8e[_0xa323('0x3b')]=_[_0xa323('0x3e')](_0x2d9e8e['where'],{'$or':_[_0xa323('0x2e')](_0x46ff99,function(_0x295f1c){if(_0x295f1c[_0xa323('0x3f')]!==_0xa323('0x40')){var _0x278ad2={};_0x278ad2[_0x295f1c[_0xa323('0x2c')]]={'$like':'%'+_0x4f28be[_0xa323('0x32')][_0xa323('0x3d')]+'%'};return _0x278ad2;}})});}_0x2d9e8e=_[_0xa323('0x3e')]({},_0x2d9e8e,_0x4f28be['options']);var _0x54ff35={'where':_0x2d9e8e[_0xa323('0x3b')]};return db[_0xa323('0x2f')][_0xa323('0x21')](_0x54ff35)[_0xa323('0x29')](function(_0x1552e7){_0x40a346[_0xa323('0x21')]=_0x1552e7;if(_0x4f28be['query'][_0xa323('0x41')]){_0x2d9e8e['include']=[{'all':!![]}];}return db[_0xa323('0x2f')]['findAll'](_0x2d9e8e);})[_0xa323('0x29')](function(_0x5e8762){_0x40a346[_0xa323('0x42')]=_0x5e8762;return _0x40a346;})[_0xa323('0x29')](respondWithFilteredResult(_0x2c91ff,_0x2d9e8e))['catch'](handleError(_0x2c91ff,null));};exports['show']=function(_0x1988a1,_0x46b671){var _0x278f16={'raw':![],'where':{'id':_0x1988a1[_0xa323('0x43')]['id']}},_0x3cf896={};_0x3cf896[_0xa323('0x31')]=_[_0xa323('0x33')](db[_0xa323('0x2f')][_0xa323('0x30')]);_0x3cf896[_0xa323('0x32')]=_[_0xa323('0x33')](_0x1988a1['query']);_0x3cf896['filters']=_[_0xa323('0x36')](_0x3cf896[_0xa323('0x31')],_0x3cf896[_0xa323('0x32')]);_0x278f16['attributes']=_[_0xa323('0x36')](_0x3cf896['model'],qs['fields'](_0x1988a1['query'][_0xa323('0x37')]));_0x278f16[_0xa323('0x35')]=_0x278f16[_0xa323('0x35')]['length']?_0x278f16[_0xa323('0x35')]:_0x3cf896[_0xa323('0x31')];if(_0x1988a1[_0xa323('0x32')][_0xa323('0x41')]){_0x278f16[_0xa323('0x44')]=[{'all':!![]}];}_0x278f16=_[_0xa323('0x3e')]({},_0x278f16,_0x1988a1[_0xa323('0x45')]);return db[_0xa323('0x2f')][_0xa323('0x46')](_0x278f16)['then'](handleEntityNotFound(_0x46b671,null))['then'](respondWithResult(_0x46b671,null))[_0xa323('0x47')](handleError(_0x46b671,null));};exports[_0xa323('0x48')]=function(_0x39f4f9,_0x1c972b){return db[_0xa323('0x2f')][_0xa323('0x48')](_0x39f4f9[_0xa323('0x49')],{})['then'](respondWithResult(_0x1c972b,0xc9))[_0xa323('0x47')](handleError(_0x1c972b,null));};exports[_0xa323('0x4a')]=function(_0x528ba6,_0x228549){return db[_0xa323('0x2f')][_0xa323('0x4a')](_0x528ba6[_0xa323('0x49')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x228549,0xc9))[_0xa323('0x47')](handleError(_0x228549,null));};exports[_0xa323('0x27')]=function(_0x125efc,_0x3e9173){if(_0x125efc['body']['id']){delete _0x125efc[_0xa323('0x49')]['id'];}return db[_0xa323('0x2f')][_0xa323('0x46')]({'where':{'id':_0x125efc[_0xa323('0x43')]['id']}})[_0xa323('0x29')](handleEntityNotFound(_0x3e9173,null))[_0xa323('0x29')](saveUpdates(_0x125efc[_0xa323('0x49')],null))[_0xa323('0x29')](respondWithResult(_0x3e9173,null))[_0xa323('0x47')](handleError(_0x3e9173,null));};exports[_0xa323('0x28')]=function(_0x2a4ae4,_0x73041e){return db[_0xa323('0x2f')][_0xa323('0x46')]({'where':{'id':_0x2a4ae4['params']['id']}})[_0xa323('0x29')](handleEntityNotFound(_0x73041e,null))[_0xa323('0x29')](removeEntity(_0x73041e,null))[_0xa323('0x47')](handleError(_0x73041e,null));};exports[_0xa323('0x4b')]=function(_0x518a71,_0x683ddf){return db['AnalyticFieldReport'][_0xa323('0x28')]({'where':{'id':_0x518a71[_0xa323('0x32')][_0xa323('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xa323('0x29')](respondWithResult(_0x683ddf,0xcc))[_0xa323('0x47')](handleError(_0x683ddf,null));};exports[_0xa323('0x4d')]=function(_0x29cf35,_0x1e7d41,_0x32a60a){return db[_0xa323('0x4e')][_0xa323('0x4f')]({'where':{'id':_0x29cf35[_0xa323('0x43')]['id']}})[_0xa323('0x29')](handleEntityNotFound(_0x1e7d41,null))[_0xa323('0x29')](function(_0x4d5bd6){if(_0x4d5bd6){return db[_0xa323('0x50')][_0xa323('0x51')](function(_0x29ced2){return db[_0xa323('0x2f')][_0xa323('0x28')]({'where':{'CustomReportId':_0x29cf35[_0xa323('0x43')]['id']},'transaction':_0x29ced2})[_0xa323('0x29')](function(_0x274d9b){var _0x2873ef=_[_0xa323('0x2e')](_0x29cf35[_0xa323('0x49')],function(_0x359a4d){delete _0x359a4d['id'];_0x359a4d[_0xa323('0x52')]=_0x29cf35[_0xa323('0x43')]['id'];return _0x359a4d;});return db[_0xa323('0x2f')][_0xa323('0x4a')](_0x2873ef,{'transaction':_0x29ced2});});})['then'](function(){return db['AnalyticFieldReport'][_0xa323('0x53')]({'where':{'CustomReportId':_0x29cf35[_0xa323('0x43')]['id']}});});}})[_0xa323('0x29')](respondWithResult(_0x1e7d41,null))[_0xa323('0x47')](handleError(_0x1e7d41,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index d5f114f..02d981b 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 _0x6392=['util','../../config/logger','api','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash'];(function(_0xabc84f,_0x11d981){var _0x5d3faa=function(_0x2d1abd){while(--_0x2d1abd){_0xabc84f['push'](_0xabc84f['shift']());}};_0x5d3faa(++_0x11d981);}(_0x6392,0xdb));var _0x2639=function(_0x332339,_0x3a98e1){_0x332339=_0x332339-0x0;var _0x2d78e9=_0x6392[_0x332339];return _0x2d78e9;};'use strict';var _=require(_0x2639('0x0'));var util=require(_0x2639('0x1'));var logger=require(_0x2639('0x2'))(_0x2639('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2639('0x4'));var rimraf=require(_0x2639('0x5'));var config=require(_0x2639('0x6'));var attributes=require(_0x2639('0x7'));module[_0x2639('0x8')]=function(_0x1f30f5,_0x1bdc5c){return _0x1f30f5[_0x2639('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x2639('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1deb=['analytics_report_fields','api','moment','request-promise','rimraf','../../config/environment','exports','define','AnalyticFieldReport'];(function(_0x25eee5,_0x397933){var _0x49a41f=function(_0x135a66){while(--_0x135a66){_0x25eee5['push'](_0x25eee5['shift']());}};_0x49a41f(++_0x397933);}(_0x1deb,0x19f));var _0xb1de=function(_0xed6c85,_0x5ef939){_0xed6c85=_0xed6c85-0x0;var _0x597c22=_0x1deb[_0xed6c85];return _0x597c22;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb1de('0x0'));var moment=require(_0xb1de('0x1'));var BPromise=require('bluebird');var rp=require(_0xb1de('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb1de('0x3'));var config=require(_0xb1de('0x4'));var attributes=require('./analyticFieldReport.attributes');module[_0xb1de('0x5')]=function(_0x4cfd67,_0x32ddf6){return _0x4cfd67[_0xb1de('0x6')](_0xb1de('0x7'),attributes,{'tableName':_0xb1de('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 64dcd3b..8742b38 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 _0x9720=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x4bf793,_0x404922){var _0x55a44b=function(_0xbbc6c0){while(--_0xbbc6c0){_0x4bf793['push'](_0x4bf793['shift']());}};_0x55a44b(++_0x404922);}(_0x9720,0x9c));var _0x0972=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x9720[_0x486f4a];return _0x135d99;};'use strict';var _=require(_0x0972('0x0'));var util=require(_0x0972('0x1'));var moment=require(_0x0972('0x2'));var BPromise=require('bluebird');var rs=require(_0x0972('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0972('0x4'))['db'];var utils=require(_0x0972('0x5'));var logger=require(_0x0972('0x6'))(_0x0972('0x7'));var config=require('../../config/environment');var jayson=require(_0x0972('0x8'));var client=jayson[_0x0972('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf708aa,_0xf94288,_0x5b4fc9){return new BPromise(function(_0x45c89b,_0x5af3e8){return client['request'](_0xf708aa,_0x5b4fc9)['then'](function(_0x256dea){logger[_0x0972('0xa')](_0x0972('0xb'),_0xf94288,'request\x20sent');logger[_0x0972('0xc')](_0x0972('0xd'),_0xf94288,_0x0972('0xe'),JSON[_0x0972('0xf')](_0x256dea));if(_0x256dea[_0x0972('0x10')]){if(_0x256dea[_0x0972('0x10')][_0x0972('0x11')]===0x1f4){logger[_0x0972('0x10')](_0x0972('0xb'),_0xf94288,_0x256dea[_0x0972('0x10')]['message']);return _0x5af3e8(_0x256dea[_0x0972('0x10')]['message']);}logger[_0x0972('0x10')](_0x0972('0xb'),_0xf94288,_0x256dea['error']['message']);return _0x45c89b(_0x256dea[_0x0972('0x10')][_0x0972('0x12')]);}else{logger[_0x0972('0xa')](_0x0972('0xb'),_0xf94288,_0x0972('0xe'));_0x45c89b(_0x256dea[_0x0972('0x13')][_0x0972('0x12')]);}})[_0x0972('0x14')](function(_0x1f00ee){logger[_0x0972('0x10')](_0x0972('0xb'),_0xf94288,_0x1f00ee);_0x5af3e8(_0x1f00ee);});});} \ No newline at end of file +var _0xfb11=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x57252a,_0x1ceae9){var _0x2733a8=function(_0x1b8611){while(--_0x1b8611){_0x57252a['push'](_0x57252a['shift']());}};_0x2733a8(++_0x1ceae9);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xfb11[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c098d,_0x1859da,_0x2596c2){return new BPromise(function(_0x34e61a,_0x236b20){return client[_0x1fb1('0x9')](_0x4c098d,_0x2596c2)[_0x1fb1('0xa')](function(_0x438d15){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x1859da,'request\x20sent',JSON[_0x1fb1('0xf')](_0x438d15));if(_0x438d15['error']){if(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x236b20(_0x438d15['error'][_0x1fb1('0x12')]);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x34e61a(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,'request\x20sent');_0x34e61a(_0x438d15['result'][_0x1fb1('0x12')]);}})[_0x1fb1('0x13')](function(_0x3924ab){logger['error'](_0x1fb1('0xc'),_0x1859da,_0x3924ab);_0x236b20(_0x3924ab);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 02edc5c..7f0fdd8 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(_0x473a35,_0x41d447){var _0x3136aa=function(_0x1adb9e){while(--_0x1adb9e){_0x473a35['push'](_0x473a35['shift']());}};_0x3136aa(++_0x41d447);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x20a8fa,_0x5d07c8){var _0x22f4b3=function(_0x4bc6e9){while(--_0x4bc6e9){_0x20a8fa['push'](_0x20a8fa['shift']());}};_0x22f4b3(++_0x5d07c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 3ca0a40..45256ff 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 _0x6e6c=['exports','name','STRING','sequelize'];(function(_0x4804d9,_0x2a81ae){var _0x54dd3c=function(_0x1a3cbc){while(--_0x1a3cbc){_0x4804d9['push'](_0x4804d9['shift']());}};_0x54dd3c(++_0x2a81ae);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc6e6('0x2')},'table':{'type':Sequelize[_0xc6e6('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x80c7=['name','sequelize','exports','STRING'];(function(_0x679467,_0x3ecc58){var _0x265eef=function(_0x3efd97){while(--_0x3efd97){_0x679467['push'](_0x679467['shift']());}};_0x265eef(++_0x3ecc58);}(_0x80c7,0x8d));var _0x780c=function(_0x22e313,_0x152f60){_0x22e313=_0x22e313-0x0;var _0x4eb634=_0x80c7[_0x22e313];return _0x4eb634;};'use strict';var Sequelize=require(_0x780c('0x0'));module[_0x780c('0x1')]={'name':{'type':Sequelize[_0x780c('0x2')],'allowNull':![],'unique':_0x780c('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x780c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 7f15031..8023498 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x15ecaa,_0x339795){var _0x21fd80=function(_0x392e3f){while(--_0x392e3f){_0x15ecaa['push'](_0x15ecaa['shift']());}};_0x21fd80(++_0x339795);}(_0x008c,0x188));var _0xc008=function(_0x4375fb,_0x22650a){_0x4375fb=_0x4375fb-0x0;var _0x445a97=_0x008c[_0x4375fb];return _0x445a97;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file +var _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x7da7,0x10d));var _0x77da=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0x7da7[_0x41e8c4];return _0x54ffbe;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index f9e68b0..662fa17 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 _0x3e4d=['rimraf','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','request-promise','path'];(function(_0x4252fb,_0x2875b6){var _0x40b2ae=function(_0xf9ca79){while(--_0xf9ca79){_0x4252fb['push'](_0x4252fb['shift']());}};_0x40b2ae(++_0x2875b6);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x264252,_0x4a22f1){_0x264252=_0x264252-0x0;var _0xdc662=_0x3e4d[_0x264252];return _0xdc662;};'use strict';var _=require(_0xd3e4('0x0'));var util=require('util');var logger=require(_0xd3e4('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd3e4('0x2'));var fs=require('fs');var path=require(_0xd3e4('0x3'));var rimraf=require(_0xd3e4('0x4'));var config=require('../../config/environment');var attributes=require(_0xd3e4('0x5'));module['exports']=function(_0x4b9a10,_0x7b42fe){return _0x4b9a10[_0xd3e4('0x6')](_0xd3e4('0x7'),attributes,{'tableName':_0xd3e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dc0=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./analyticMetric.attributes','AnalyticMetric'];(function(_0xf579d,_0x1d0811){var _0xb2a1e0=function(_0x28fae9){while(--_0x28fae9){_0xf579d['push'](_0xf579d['shift']());}};_0xb2a1e0(++_0x1d0811);}(_0x6dc0,0x18c));var _0x06dc=function(_0x2e8350,_0x557136){_0x2e8350=_0x2e8350-0x0;var _0x144f9f=_0x6dc0[_0x2e8350];return _0x144f9f;};'use strict';var _=require(_0x06dc('0x0'));var util=require('util');var logger=require(_0x06dc('0x1'))(_0x06dc('0x2'));var moment=require(_0x06dc('0x3'));var BPromise=require(_0x06dc('0x4'));var rp=require(_0x06dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x06dc('0x6'));var attributes=require(_0x06dc('0x7'));module['exports']=function(_0x45a093,_0x26b287){return _0x45a093['define'](_0x06dc('0x8'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 45f3812..de6d582 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 _0xfaf4=['../../config/logger','jayson/promise','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1d5ce7,_0x213179){var _0x58141b=function(_0x297673){while(--_0x297673){_0x1d5ce7['push'](_0x1d5ce7['shift']());}};_0x58141b(++_0x213179);}(_0xfaf4,0x72));var _0x4faf=function(_0xb353ed,_0x395a78){_0xb353ed=_0xb353ed-0x0;var _0x129967=_0xfaf4[_0xb353ed];return _0x129967;};'use strict';var _=require(_0x4faf('0x0'));var util=require(_0x4faf('0x1'));var moment=require(_0x4faf('0x2'));var BPromise=require(_0x4faf('0x3'));var rs=require(_0x4faf('0x4'));var fs=require('fs');var Redis=require(_0x4faf('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4faf('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4faf('0x7'));var client=jayson['client'][_0x4faf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x487ea7,_0x34fd30,_0x56c943){return new BPromise(function(_0x494109,_0x2303c5){return client['request'](_0x487ea7,_0x56c943)[_0x4faf('0x9')](function(_0x3ee2ec){logger[_0x4faf('0xa')](_0x4faf('0xb'),_0x34fd30,_0x4faf('0xc'));logger[_0x4faf('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x34fd30,_0x4faf('0xc'),JSON[_0x4faf('0xe')](_0x3ee2ec));if(_0x3ee2ec[_0x4faf('0xf')]){if(_0x3ee2ec[_0x4faf('0xf')][_0x4faf('0x10')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x34fd30,_0x3ee2ec['error'][_0x4faf('0x11')]);return _0x2303c5(_0x3ee2ec[_0x4faf('0xf')][_0x4faf('0x11')]);}logger['error'](_0x4faf('0xb'),_0x34fd30,_0x3ee2ec['error'][_0x4faf('0x11')]);return _0x494109(_0x3ee2ec[_0x4faf('0xf')]['message']);}else{logger[_0x4faf('0xa')](_0x4faf('0xb'),_0x34fd30,_0x4faf('0xc'));_0x494109(_0x3ee2ec[_0x4faf('0x12')]['message']);}})[_0x4faf('0x13')](function(_0x19fdf1){logger[_0x4faf('0xf')](_0x4faf('0xb'),_0x34fd30,_0x19fdf1);_0x2303c5(_0x19fdf1);});});} \ No newline at end of file +var _0x3fa6=['util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x3fa6,0x71));var _0x63fa=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x3fa6[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x63fa('0x0'));var util=require(_0x63fa('0x1'));var moment=require('moment');var BPromise=require(_0x63fa('0x2'));var rs=require(_0x63fa('0x3'));var fs=require('fs');var Redis=require(_0x63fa('0x4'));var db=require(_0x63fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x63fa('0x6'));var config=require(_0x63fa('0x7'));var jayson=require(_0x63fa('0x8'));var client=jayson[_0x63fa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2415ef,_0x165ebb,_0x8954e6){return new BPromise(function(_0x1fee57,_0x732e0){return client[_0x63fa('0xa')](_0x2415ef,_0x8954e6)['then'](function(_0x3ad5bb){logger['info'](_0x63fa('0xb'),_0x165ebb,_0x63fa('0xc'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x165ebb,_0x63fa('0xc'),JSON[_0x63fa('0xd')](_0x3ad5bb));if(_0x3ad5bb[_0x63fa('0xe')]){if(_0x3ad5bb['error']['code']===0x1f4){logger[_0x63fa('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x165ebb,_0x3ad5bb['error']['message']);return _0x732e0(_0x3ad5bb['error']['message']);}logger[_0x63fa('0xe')](_0x63fa('0xb'),_0x165ebb,_0x3ad5bb[_0x63fa('0xe')][_0x63fa('0xf')]);return _0x1fee57(_0x3ad5bb[_0x63fa('0xe')][_0x63fa('0xf')]);}else{logger[_0x63fa('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x165ebb,_0x63fa('0xc'));_0x1fee57(_0x3ad5bb[_0x63fa('0x11')][_0x63fa('0xf')]);}})[_0x63fa('0x12')](function(_0x2e41d6){logger[_0x63fa('0xe')](_0x63fa('0xb'),_0x165ebb,_0x2e41d6);_0x732e0(_0x2e41d6);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index ac0478c..7f1ce35 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 _0xcdd0=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xcdd0[_0x13ce0c];return _0x4388fb;};'use strict';var multer=require(_0x0cdd('0x0'));var util=require(_0x0cdd('0x1'));var path=require(_0x0cdd('0x2'));var timeout=require(_0x0cdd('0x3'));var express=require('express');var router=express[_0x0cdd('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0cdd('0x5'));var config=require('../../config/environment');var controller=require(_0x0cdd('0x6'));router[_0x0cdd('0x7')]('/',auth[_0x0cdd('0x8')](),controller['index']);router[_0x0cdd('0x7')](_0x0cdd('0x9'),auth[_0x0cdd('0x8')](),controller[_0x0cdd('0xa')]);router[_0x0cdd('0xb')]('/',auth[_0x0cdd('0x8')](),controller[_0x0cdd('0xc')]);router[_0x0cdd('0xd')](_0x0cdd('0x9'),auth[_0x0cdd('0x8')](),controller[_0x0cdd('0xe')]);router[_0x0cdd('0xf')](_0x0cdd('0x9'),auth['isAuthenticated'](),controller[_0x0cdd('0x10')]);module[_0x0cdd('0x11')]=router; \ No newline at end of file +var _0xdb2a=['isAuthenticated','index','post','create','/:id','update','destroy','multer','util','path','Router','fs-extra','../../components/interaction/service','./analyticMetric.controller','get'];(function(_0x1b529c,_0x489af7){var _0xe91e36=function(_0x10b128){while(--_0x10b128){_0x1b529c['push'](_0x1b529c['shift']());}};_0xe91e36(++_0x489af7);}(_0xdb2a,0x16f));var _0xadb2=function(_0x337c73,_0x22d09c){_0x337c73=_0x337c73-0x0;var _0x3a97fc=_0xdb2a[_0x337c73];return _0x3a97fc;};'use strict';var multer=require(_0xadb2('0x0'));var util=require(_0xadb2('0x1'));var path=require(_0xadb2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xadb2('0x3')]();var fs_extra=require(_0xadb2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xadb2('0x5'));var config=require('../../config/environment');var controller=require(_0xadb2('0x6'));router[_0xadb2('0x7')]('/',auth[_0xadb2('0x8')](),controller[_0xadb2('0x9')]);router[_0xadb2('0x7')]('/:id',auth[_0xadb2('0x8')](),controller['show']);router[_0xadb2('0xa')]('/',auth[_0xadb2('0x8')](),controller[_0xadb2('0xb')]);router['put'](_0xadb2('0xc'),auth[_0xadb2('0x8')](),controller[_0xadb2('0xd')]);router['delete'](_0xadb2('0xc'),auth['isAuthenticated'](),controller[_0xadb2('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index afd7eb5..f5c9489 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 _0xfbb0=['exports','sequelize'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xfbb0,0x1d1));var _0x0fbb=function(_0x239dbb,_0x48633b){_0x239dbb=_0x239dbb-0x0;var _0x48f1ea=_0xfbb0[_0x239dbb];return _0x48f1ea;};'use strict';var Sequelize=require(_0x0fbb('0x0'));module[_0x0fbb('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x05d1=['exports','TEXT'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0x05d1,0x152));var _0x105d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x05d1[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0x105d('0x0')]={'tree':{'type':Sequelize[_0x105d('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 32814de..1f3effd 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 _0x3efd=['Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','undefined','limit','offset','count'];(function(_0x4ddf2e,_0x6c85a3){var _0x3c0ccb=function(_0x14c146){while(--_0x14c146){_0x4ddf2e['push'](_0x4ddf2e['shift']());}};_0x3c0ccb(++_0x6c85a3);}(_0x3efd,0x10d));var _0xd3ef=function(_0x383fc9,_0x4d6322){_0x383fc9=_0x383fc9-0x0;var _0x331248=_0x3efd[_0x383fc9];return _0x331248;};'use strict';var emlformat=require(_0xd3ef('0x0'));var rimraf=require(_0xd3ef('0x1'));var zipdir=require(_0xd3ef('0x2'));var jsonpatch=require(_0xd3ef('0x3'));var rp=require(_0xd3ef('0x4'));var moment=require(_0xd3ef('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd3ef('0x6'));var path=require(_0xd3ef('0x7'));var sox=require(_0xd3ef('0x8'));var csv=require('to-csv');var ejs=require(_0xd3ef('0x9'));var fs=require('fs');var fs_extra=require(_0xd3ef('0xa'));var _=require(_0xd3ef('0xb'));var squel=require(_0xd3ef('0xc'));var crypto=require(_0xd3ef('0xd'));var jsforce=require(_0xd3ef('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd3ef('0xf'));var Papa=require(_0xd3ef('0x10'));var Redis=require(_0xd3ef('0x11'));var authService=require(_0xd3ef('0x12'));var qs=require(_0xd3ef('0x13'));var as=require(_0xd3ef('0x14'));var hardwareService=require(_0xd3ef('0x15'));var logger=require(_0xd3ef('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xd3ef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd3ef('0x18'))['db'];function respondWithStatusCode(_0x5d3953,_0x16b6a9){_0x16b6a9=_0x16b6a9||0xcc;return function(_0x37c6c1){if(_0x37c6c1){return _0x5d3953['sendStatus'](_0x16b6a9);}return _0x5d3953[_0xd3ef('0x19')](_0x16b6a9)[_0xd3ef('0x1a')]();};}function respondWithResult(_0x5ba492,_0x5e8cf7){_0x5e8cf7=_0x5e8cf7||0xc8;return function(_0x88ab7f){if(_0x88ab7f){return _0x5ba492['status'](_0x5e8cf7)['json'](_0x88ab7f);}};}function respondWithFilteredResult(_0x3276cb,_0xd30b7e){return function(_0x473556){if(_0x473556){var _0x24979a=typeof _0xd30b7e['offset']===_0xd3ef('0x1b')&&typeof _0xd30b7e[_0xd3ef('0x1c')]==='undefined';var _0x238a33=_0x473556['count'];var _0x9d2c15=_0x24979a?0x0:_0xd30b7e[_0xd3ef('0x1d')];var _0x24e5ad=_0x24979a?_0x473556[_0xd3ef('0x1e')]:_0xd30b7e['offset']+_0xd30b7e['limit'];var _0x4ffbaa;if(_0x24e5ad>=_0x238a33){_0x24e5ad=_0x238a33;_0x4ffbaa=0xc8;}else{_0x4ffbaa=0xce;}_0x3276cb[_0xd3ef('0x19')](_0x4ffbaa);return _0x3276cb['set'](_0xd3ef('0x1f'),_0x9d2c15+'-'+_0x24e5ad+'/'+_0x238a33)[_0xd3ef('0x20')](_0x473556);}return null;};}function patchUpdates(_0x711e69){return function(_0x224fb0){try{jsonpatch[_0xd3ef('0x21')](_0x224fb0,_0x711e69,!![]);}catch(_0x121f2d){return BPromise[_0xd3ef('0x22')](_0x121f2d);}return _0x224fb0[_0xd3ef('0x23')]();};}function saveUpdates(_0x1abc1c,_0x326ee5){return function(_0x31b743){if(_0x31b743){return _0x31b743['update'](_0x1abc1c)[_0xd3ef('0x24')](function(_0x1bd8ba){return _0x1bd8ba;});}return null;};}function removeEntity(_0x474647,_0x36cfbe){return function(_0x30afde){if(_0x30afde){return _0x30afde[_0xd3ef('0x25')]()[_0xd3ef('0x24')](function(){_0x474647[_0xd3ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x542385,_0x1b2860){return function(_0x1a9916){if(!_0x1a9916){_0x542385[_0xd3ef('0x26')](0x194);}return _0x1a9916;};}function handleError(_0x2cbaf5,_0x2c48ef){_0x2c48ef=_0x2c48ef||0x1f4;return function(_0x5ee372){logger[_0xd3ef('0x27')](_0x5ee372[_0xd3ef('0x28')]);if(_0x5ee372[_0xd3ef('0x29')]){delete _0x5ee372[_0xd3ef('0x29')];}_0x2cbaf5['status'](_0x2c48ef)[_0xd3ef('0x2a')](_0x5ee372);};}exports[_0xd3ef('0x2b')]=function(_0x55998f,_0x1f636f){var _0x58132a={},_0x5cde1f={},_0x2511a3={'count':0x0,'rows':[]};var _0x54f7ce=_[_0xd3ef('0x2c')](db[_0xd3ef('0x2d')][_0xd3ef('0x2e')],function(_0x22e5f7){return{'name':_0x22e5f7[_0xd3ef('0x2f')],'type':_0x22e5f7[_0xd3ef('0x30')][_0xd3ef('0x31')]};});_0x5cde1f[_0xd3ef('0x32')]=_[_0xd3ef('0x2c')](_0x54f7ce,_0xd3ef('0x29'));_0x5cde1f[_0xd3ef('0x33')]=_['keys'](_0x55998f[_0xd3ef('0x33')]);_0x5cde1f[_0xd3ef('0x34')]=_['intersection'](_0x5cde1f[_0xd3ef('0x32')],_0x5cde1f[_0xd3ef('0x33')]);_0x58132a[_0xd3ef('0x35')]=_[_0xd3ef('0x36')](_0x5cde1f[_0xd3ef('0x32')],qs[_0xd3ef('0x37')](_0x55998f[_0xd3ef('0x33')][_0xd3ef('0x37')]));_0x58132a[_0xd3ef('0x35')]=_0x58132a[_0xd3ef('0x35')][_0xd3ef('0x38')]?_0x58132a[_0xd3ef('0x35')]:_0x5cde1f['model'];if(!_0x55998f['query'][_0xd3ef('0x39')]('nolimit')){_0x58132a[_0xd3ef('0x1c')]=qs[_0xd3ef('0x1c')](_0x55998f[_0xd3ef('0x33')][_0xd3ef('0x1c')]);_0x58132a[_0xd3ef('0x1d')]=qs[_0xd3ef('0x1d')](_0x55998f['query']['offset']);}_0x58132a['order']=qs[_0xd3ef('0x3a')](_0x55998f[_0xd3ef('0x33')][_0xd3ef('0x3a')]);_0x58132a[_0xd3ef('0x3b')]=qs[_0xd3ef('0x34')](_[_0xd3ef('0x3c')](_0x55998f['query'],_0x5cde1f['filters']),_0x54f7ce);if(_0x55998f[_0xd3ef('0x33')][_0xd3ef('0x3d')]){_0x58132a['where']=_[_0xd3ef('0x3e')](_0x58132a[_0xd3ef('0x3b')],{'$or':_['map'](_0x54f7ce,function(_0x2f86cb){if(_0x2f86cb[_0xd3ef('0x30')]!==_0xd3ef('0x3f')){var _0x1825e7={};_0x1825e7[_0x2f86cb[_0xd3ef('0x29')]]={'$like':'%'+_0x55998f['query'][_0xd3ef('0x3d')]+'%'};return _0x1825e7;}})});}_0x58132a=_['merge']({},_0x58132a,_0x55998f['options']);var _0x533b03={'where':_0x58132a['where']};return db[_0xd3ef('0x2d')][_0xd3ef('0x1e')](_0x533b03)[_0xd3ef('0x24')](function(_0x56b394){_0x2511a3['count']=_0x56b394;if(_0x55998f[_0xd3ef('0x33')][_0xd3ef('0x40')]){_0x58132a[_0xd3ef('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xd3ef('0x42')](_0x58132a);})['then'](function(_0xc2c01){_0x2511a3['rows']=_0xc2c01;return _0x2511a3;})[_0xd3ef('0x24')](respondWithFilteredResult(_0x1f636f,_0x58132a))[_0xd3ef('0x43')](handleError(_0x1f636f,null));};exports[_0xd3ef('0x44')]=function(_0x21fca7,_0x2998b5){var _0xb98813={'raw':!![],'where':{'id':_0x21fca7[_0xd3ef('0x45')]['id']}},_0x39cfe8={};_0x39cfe8[_0xd3ef('0x32')]=_['keys'](db[_0xd3ef('0x2d')][_0xd3ef('0x2e')]);_0x39cfe8['query']=_['keys'](_0x21fca7['query']);_0x39cfe8[_0xd3ef('0x34')]=_[_0xd3ef('0x36')](_0x39cfe8['model'],_0x39cfe8[_0xd3ef('0x33')]);_0xb98813['attributes']=_['intersection'](_0x39cfe8['model'],qs[_0xd3ef('0x37')](_0x21fca7[_0xd3ef('0x33')][_0xd3ef('0x37')]));_0xb98813[_0xd3ef('0x35')]=_0xb98813[_0xd3ef('0x35')][_0xd3ef('0x38')]?_0xb98813[_0xd3ef('0x35')]:_0x39cfe8['model'];if(_0x21fca7[_0xd3ef('0x33')]['includeAll']){_0xb98813[_0xd3ef('0x41')]=[{'all':!![]}];}_0xb98813=_['merge']({},_0xb98813,_0x21fca7[_0xd3ef('0x46')]);return db['AnalyticTreeReport'][_0xd3ef('0x47')](_0xb98813)[_0xd3ef('0x24')](handleEntityNotFound(_0x2998b5,null))[_0xd3ef('0x24')](respondWithResult(_0x2998b5,null))['catch'](handleError(_0x2998b5,null));};exports[_0xd3ef('0x48')]=function(_0x3e18ef,_0x255ae2){return db[_0xd3ef('0x2d')][_0xd3ef('0x48')](_0x3e18ef[_0xd3ef('0x49')],{})[_0xd3ef('0x24')](respondWithResult(_0x255ae2,0xc9))[_0xd3ef('0x43')](handleError(_0x255ae2,null));};exports[_0xd3ef('0x4a')]=function(_0x44fe5c,_0x2b8b4b){if(_0x44fe5c[_0xd3ef('0x49')]['id']){delete _0x44fe5c[_0xd3ef('0x49')]['id'];}return db[_0xd3ef('0x2d')][_0xd3ef('0x47')]({'where':{'id':_0x44fe5c[_0xd3ef('0x45')]['id']}})[_0xd3ef('0x24')](handleEntityNotFound(_0x2b8b4b,null))['then'](saveUpdates(_0x44fe5c[_0xd3ef('0x49')],null))[_0xd3ef('0x24')](respondWithResult(_0x2b8b4b,null))[_0xd3ef('0x43')](handleError(_0x2b8b4b,null));};exports['destroy']=function(_0x5d5e75,_0x1aa484){return db[_0xd3ef('0x2d')][_0xd3ef('0x47')]({'where':{'id':_0x5d5e75[_0xd3ef('0x45')]['id']}})[_0xd3ef('0x24')](handleEntityNotFound(_0x1aa484,null))[_0xd3ef('0x24')](removeEntity(_0x1aa484,null))[_0xd3ef('0x43')](handleError(_0x1aa484,null));}; \ No newline at end of file +var _0x04ba=['update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','options','includeAll','include','AnalyticTreeReport','findAll','catch','show','params','fields','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','apply'];(function(_0x3d4347,_0x47f3d9){var _0x14e255=function(_0x486733){while(--_0x486733){_0x3d4347['push'](_0x3d4347['shift']());}};_0x14e255(++_0x47f3d9);}(_0x04ba,0x188));var _0xa04b=function(_0x42ae66,_0x5f5315){_0x42ae66=_0x42ae66-0x0;var _0x216b71=_0x04ba[_0x42ae66];return _0x216b71;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa04b('0x0'));var zipdir=require(_0xa04b('0x1'));var jsonpatch=require(_0xa04b('0x2'));var rp=require(_0xa04b('0x3'));var moment=require(_0xa04b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa04b('0x5'));var util=require(_0xa04b('0x6'));var path=require(_0xa04b('0x7'));var sox=require('sox');var csv=require(_0xa04b('0x8'));var ejs=require(_0xa04b('0x9'));var fs=require('fs');var fs_extra=require(_0xa04b('0xa'));var _=require('lodash');var squel=require(_0xa04b('0xb'));var crypto=require('crypto');var jsforce=require(_0xa04b('0xc'));var deskjs=require(_0xa04b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa04b('0xe'));var Redis=require(_0xa04b('0xf'));var authService=require(_0xa04b('0x10'));var qs=require(_0xa04b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa04b('0x12'));var logger=require(_0xa04b('0x13'))(_0xa04b('0x14'));var utils=require(_0xa04b('0x15'));var config=require(_0xa04b('0x16'));var licenseUtil=require(_0xa04b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54340e,_0x54c5dd){_0x54c5dd=_0x54c5dd||0xcc;return function(_0x4622a3){if(_0x4622a3){return _0x54340e[_0xa04b('0x18')](_0x54c5dd);}return _0x54340e[_0xa04b('0x19')](_0x54c5dd)[_0xa04b('0x1a')]();};}function respondWithResult(_0x1ee0de,_0x5d17c7){_0x5d17c7=_0x5d17c7||0xc8;return function(_0x4b1934){if(_0x4b1934){return _0x1ee0de[_0xa04b('0x19')](_0x5d17c7)[_0xa04b('0x1b')](_0x4b1934);}};}function respondWithFilteredResult(_0x55be8b,_0x517c72){return function(_0x46c416){if(_0x46c416){var _0x4efd02=typeof _0x517c72['offset']===_0xa04b('0x1c')&&typeof _0x517c72['limit']===_0xa04b('0x1c');var _0x255859=_0x46c416[_0xa04b('0x1d')];var _0x5987d8=_0x4efd02?0x0:_0x517c72[_0xa04b('0x1e')];var _0x58ee89=_0x4efd02?_0x46c416[_0xa04b('0x1d')]:_0x517c72[_0xa04b('0x1e')]+_0x517c72[_0xa04b('0x1f')];var _0x5c35a9;if(_0x58ee89>=_0x255859){_0x58ee89=_0x255859;_0x5c35a9=0xc8;}else{_0x5c35a9=0xce;}_0x55be8b[_0xa04b('0x19')](_0x5c35a9);return _0x55be8b[_0xa04b('0x20')]('Content-Range',_0x5987d8+'-'+_0x58ee89+'/'+_0x255859)[_0xa04b('0x1b')](_0x46c416);}return null;};}function patchUpdates(_0x56277e){return function(_0xae2542){try{jsonpatch[_0xa04b('0x21')](_0xae2542,_0x56277e,!![]);}catch(_0x52f030){return BPromise['reject'](_0x52f030);}return _0xae2542['save']();};}function saveUpdates(_0x382fdb,_0x339f00){return function(_0x58d33f){if(_0x58d33f){return _0x58d33f[_0xa04b('0x22')](_0x382fdb)[_0xa04b('0x23')](function(_0x3d9b71){return _0x3d9b71;});}return null;};}function removeEntity(_0xdc41de,_0x5afef7){return function(_0x50e5d9){if(_0x50e5d9){return _0x50e5d9[_0xa04b('0x24')]()[_0xa04b('0x23')](function(){_0xdc41de[_0xa04b('0x19')](0xcc)[_0xa04b('0x1a')]();});}};}function handleEntityNotFound(_0x4a73f6,_0x1f3ab4){return function(_0x81c85){if(!_0x81c85){_0x4a73f6[_0xa04b('0x18')](0x194);}return _0x81c85;};}function handleError(_0x2c95a3,_0x19c346){_0x19c346=_0x19c346||0x1f4;return function(_0x3c8dda){logger[_0xa04b('0x25')](_0x3c8dda[_0xa04b('0x26')]);if(_0x3c8dda[_0xa04b('0x27')]){delete _0x3c8dda[_0xa04b('0x27')];}_0x2c95a3[_0xa04b('0x19')](_0x19c346)['send'](_0x3c8dda);};}exports[_0xa04b('0x28')]=function(_0x175ec2,_0x36d9d3){var _0x3b698b={},_0x2d0376={},_0x1f4172={'count':0x0,'rows':[]};var _0x189eef=_[_0xa04b('0x29')](db['AnalyticTreeReport'][_0xa04b('0x2a')],function(_0x52e414){return{'name':_0x52e414[_0xa04b('0x2b')],'type':_0x52e414[_0xa04b('0x2c')][_0xa04b('0x2d')]};});_0x2d0376[_0xa04b('0x2e')]=_[_0xa04b('0x29')](_0x189eef,_0xa04b('0x27'));_0x2d0376['query']=_[_0xa04b('0x2f')](_0x175ec2[_0xa04b('0x30')]);_0x2d0376[_0xa04b('0x31')]=_[_0xa04b('0x32')](_0x2d0376[_0xa04b('0x2e')],_0x2d0376[_0xa04b('0x30')]);_0x3b698b[_0xa04b('0x33')]=_['intersection'](_0x2d0376[_0xa04b('0x2e')],qs['fields'](_0x175ec2[_0xa04b('0x30')]['fields']));_0x3b698b['attributes']=_0x3b698b['attributes'][_0xa04b('0x34')]?_0x3b698b[_0xa04b('0x33')]:_0x2d0376[_0xa04b('0x2e')];if(!_0x175ec2[_0xa04b('0x30')]['hasOwnProperty']('nolimit')){_0x3b698b[_0xa04b('0x1f')]=qs[_0xa04b('0x1f')](_0x175ec2[_0xa04b('0x30')][_0xa04b('0x1f')]);_0x3b698b[_0xa04b('0x1e')]=qs['offset'](_0x175ec2[_0xa04b('0x30')][_0xa04b('0x1e')]);}_0x3b698b[_0xa04b('0x35')]=qs[_0xa04b('0x36')](_0x175ec2[_0xa04b('0x30')][_0xa04b('0x36')]);_0x3b698b[_0xa04b('0x37')]=qs[_0xa04b('0x31')](_[_0xa04b('0x38')](_0x175ec2[_0xa04b('0x30')],_0x2d0376[_0xa04b('0x31')]),_0x189eef);if(_0x175ec2[_0xa04b('0x30')][_0xa04b('0x39')]){_0x3b698b[_0xa04b('0x37')]=_['merge'](_0x3b698b[_0xa04b('0x37')],{'$or':_['map'](_0x189eef,function(_0x589219){if(_0x589219[_0xa04b('0x2c')]!=='VIRTUAL'){var _0x194230={};_0x194230[_0x589219[_0xa04b('0x27')]]={'$like':'%'+_0x175ec2[_0xa04b('0x30')][_0xa04b('0x39')]+'%'};return _0x194230;}})});}_0x3b698b=_[_0xa04b('0x3a')]({},_0x3b698b,_0x175ec2[_0xa04b('0x3b')]);var _0x5419cd={'where':_0x3b698b[_0xa04b('0x37')]};return db['AnalyticTreeReport'][_0xa04b('0x1d')](_0x5419cd)[_0xa04b('0x23')](function(_0x48f592){_0x1f4172[_0xa04b('0x1d')]=_0x48f592;if(_0x175ec2['query'][_0xa04b('0x3c')]){_0x3b698b[_0xa04b('0x3d')]=[{'all':!![]}];}return db[_0xa04b('0x3e')][_0xa04b('0x3f')](_0x3b698b);})[_0xa04b('0x23')](function(_0x5c97ef){_0x1f4172['rows']=_0x5c97ef;return _0x1f4172;})['then'](respondWithFilteredResult(_0x36d9d3,_0x3b698b))[_0xa04b('0x40')](handleError(_0x36d9d3,null));};exports[_0xa04b('0x41')]=function(_0x37f133,_0x16bcb3){var _0x308500={'raw':!![],'where':{'id':_0x37f133[_0xa04b('0x42')]['id']}},_0x184071={};_0x184071[_0xa04b('0x2e')]=_['keys'](db['AnalyticTreeReport'][_0xa04b('0x2a')]);_0x184071[_0xa04b('0x30')]=_[_0xa04b('0x2f')](_0x37f133[_0xa04b('0x30')]);_0x184071[_0xa04b('0x31')]=_[_0xa04b('0x32')](_0x184071[_0xa04b('0x2e')],_0x184071[_0xa04b('0x30')]);_0x308500[_0xa04b('0x33')]=_[_0xa04b('0x32')](_0x184071[_0xa04b('0x2e')],qs[_0xa04b('0x43')](_0x37f133[_0xa04b('0x30')][_0xa04b('0x43')]));_0x308500[_0xa04b('0x33')]=_0x308500[_0xa04b('0x33')][_0xa04b('0x34')]?_0x308500[_0xa04b('0x33')]:_0x184071[_0xa04b('0x2e')];if(_0x37f133['query'][_0xa04b('0x3c')]){_0x308500['include']=[{'all':!![]}];}_0x308500=_[_0xa04b('0x3a')]({},_0x308500,_0x37f133[_0xa04b('0x3b')]);return db['AnalyticTreeReport'][_0xa04b('0x44')](_0x308500)['then'](handleEntityNotFound(_0x16bcb3,null))[_0xa04b('0x23')](respondWithResult(_0x16bcb3,null))[_0xa04b('0x40')](handleError(_0x16bcb3,null));};exports[_0xa04b('0x45')]=function(_0x1f0c68,_0x23c7b5){return db[_0xa04b('0x3e')][_0xa04b('0x45')](_0x1f0c68[_0xa04b('0x46')],{})[_0xa04b('0x23')](respondWithResult(_0x23c7b5,0xc9))['catch'](handleError(_0x23c7b5,null));};exports[_0xa04b('0x22')]=function(_0x59a1e2,_0x4ca787){if(_0x59a1e2['body']['id']){delete _0x59a1e2[_0xa04b('0x46')]['id'];}return db[_0xa04b('0x3e')]['find']({'where':{'id':_0x59a1e2['params']['id']}})['then'](handleEntityNotFound(_0x4ca787,null))[_0xa04b('0x23')](saveUpdates(_0x59a1e2[_0xa04b('0x46')],null))[_0xa04b('0x23')](respondWithResult(_0x4ca787,null))[_0xa04b('0x40')](handleError(_0x4ca787,null));};exports[_0xa04b('0x24')]=function(_0x55cdd8,_0xc7437b){return db['AnalyticTreeReport'][_0xa04b('0x44')]({'where':{'id':_0x55cdd8[_0xa04b('0x42')]['id']}})['then'](handleEntityNotFound(_0xc7437b,null))[_0xa04b('0x23')](removeEntity(_0xc7437b,null))[_0xa04b('0x40')](handleError(_0xc7437b,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 01ff1b9..7983c15 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 _0xcac7=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xcac7,0xfc));var _0x7cac=function(_0xd29b38,_0x2f9ae9){_0xd29b38=_0xd29b38-0x0;var _0x4ba743=_0xcac7[_0xd29b38];return _0x4ba743;};'use strict';var _=require(_0x7cac('0x0'));var util=require('util');var logger=require(_0x7cac('0x1'))('api');var moment=require(_0x7cac('0x2'));var BPromise=require(_0x7cac('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cac('0x4'));var rimraf=require(_0x7cac('0x5'));var config=require(_0x7cac('0x6'));var attributes=require(_0x7cac('0x7'));module[_0x7cac('0x8')]=function(_0x670301,_0x1e1696){return _0x670301['define'](_0x7cac('0x9'),attributes,{'tableName':_0x7cac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a84=['path','rimraf','AnalyticTreeReport','analytics_report_trees','lodash','api','request-promise'];(function(_0x556947,_0x57bf4f){var _0x3b8173=function(_0x319970){while(--_0x319970){_0x556947['push'](_0x556947['shift']());}};_0x3b8173(++_0x57bf4f);}(_0x4a84,0x15b));var _0x44a8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4a84[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x44a8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x44a8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x44a8('0x2'));var fs=require('fs');var path=require(_0x44a8('0x3'));var rimraf=require(_0x44a8('0x4'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x339d79,_0x13c0bb){return _0x339d79['define'](_0x44a8('0x5'),attributes,{'tableName':_0x44a8('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 7b0c6f9..8ac0706 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0xf40504,_0xeea61b){var _0x4bb27f=function(_0x7c0980){while(--_0x7c0980){_0xf40504['push'](_0xf40504['shift']());}};_0x4bb27f(++_0xeea61b);}(_0xdb28,0x106));var _0x8db2=function(_0x450489,_0x35af05){_0x450489=_0x450489-0x0;var _0x539eaf=_0xdb28[_0x450489];return _0x539eaf;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x46848d,_0x37d0f6){var _0x22fbb1=function(_0x5409c7){while(--_0x5409c7){_0x46848d['push'](_0x46848d['shift']());}};_0x22fbb1(++_0x37d0f6);}(_0xdb28,0x106));var _0x8db2=function(_0x416593,_0x5769a5){_0x416593=_0x416593-0x0;var _0x269de3=_0xdb28[_0x416593];return _0x269de3;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index d4e39cc..26e3c97 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 _0x749f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports'];(function(_0x37c70b,_0x3e1893){var _0x12d56d=function(_0x2a99fe){while(--_0x2a99fe){_0x37c70b['push'](_0x37c70b['shift']());}};_0x12d56d(++_0x3e1893);}(_0x749f,0x7e));var _0xf749=function(_0x54da5b,_0x12fd71){_0x54da5b=_0x54da5b-0x0;var _0x285d3b=_0x749f[_0x54da5b];return _0x285d3b;};'use strict';var multer=require(_0xf749('0x0'));var util=require(_0xf749('0x1'));var path=require(_0xf749('0x2'));var timeout=require(_0xf749('0x3'));var express=require(_0xf749('0x4'));var router=express[_0xf749('0x5')]();var fs_extra=require(_0xf749('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf749('0x7'));var config=require(_0xf749('0x8'));var controller=require(_0xf749('0x9'));router[_0xf749('0xa')]('/',auth['isAuthenticated'](),controller[_0xf749('0xb')]);router[_0xf749('0xa')](_0xf749('0xc'),auth['isAuthenticated'](),controller[_0xf749('0xd')]);router[_0xf749('0xe')]('/',auth[_0xf749('0xf')](),controller[_0xf749('0x10')]);router[_0xf749('0x11')](_0xf749('0xc'),auth[_0xf749('0xf')](),controller['update']);router[_0xf749('0x12')]('/:id',auth[_0xf749('0xf')](),controller[_0xf749('0x13')]);module[_0xf749('0x14')]=router; \ No newline at end of file +var _0x3287=['create','put','/:id','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x4294ad,_0x3fc48b){var _0x3c230a=function(_0x4c3548){while(--_0x4c3548){_0x4294ad['push'](_0x4294ad['shift']());}};_0x3c230a(++_0x3fc48b);}(_0x3287,0xdf));var _0x7328=function(_0x2ec824,_0xc4825b){_0x2ec824=_0x2ec824-0x0;var _0x3f9826=_0x3287[_0x2ec824];return _0x3f9826;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7328('0x0'));var express=require(_0x7328('0x1'));var router=express[_0x7328('0x2')]();var fs_extra=require(_0x7328('0x3'));var auth=require(_0x7328('0x4'));var interaction=require(_0x7328('0x5'));var config=require(_0x7328('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x7328('0x7')]('/',auth[_0x7328('0x8')](),controller[_0x7328('0x9')]);router['get']('/:id',auth[_0x7328('0x8')](),controller[_0x7328('0xa')]);router['post']('/',auth[_0x7328('0x8')](),controller[_0x7328('0xb')]);router[_0x7328('0xc')](_0x7328('0xd'),auth[_0x7328('0x8')](),controller[_0x7328('0xe')]);router[_0x7328('0xf')](_0x7328('0xd'),auth[_0x7328('0x8')](),controller[_0x7328('0x10')]);module[_0x7328('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 220de48..95c2b0f 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 _0x9221=['exports','STRING'];(function(_0x3398a8,_0x1612d6){var _0x3e01d2=function(_0x44a554){while(--_0x44a554){_0x3398a8['push'](_0x3398a8['shift']());}};_0x3e01d2(++_0x1612d6);}(_0x9221,0x64));var _0x1922=function(_0x5a69b5,_0x167340){_0x5a69b5=_0x5a69b5-0x0;var _0x33a7fe=_0x9221[_0x5a69b5];return _0x33a7fe;};'use strict';var Sequelize=require('sequelize');module[_0x1922('0x0')]={'name':{'type':Sequelize[_0x1922('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1922('0x1')]}}; \ No newline at end of file +var _0xd51f=['sequelize','exports','STRING'];(function(_0x48d007,_0x446953){var _0x412d80=function(_0x20cccd){while(--_0x20cccd){_0x48d007['push'](_0x48d007['shift']());}};_0x412d80(++_0x446953);}(_0xd51f,0xf0));var _0xfd51=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xd51f[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xfd51('0x0'));module[_0xfd51('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xfd51('0x2')]},'type':{'type':Sequelize[_0xfd51('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index f3aae7e..94972bc 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 _0x8434=['error','stack','name','send','map','Attachment','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','clone','params','omit','updatedAt','body','createdAt','create','find','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy'];(function(_0x63f95b,_0x3bbcd4){var _0x459415=function(_0x20d542){while(--_0x20d542){_0x63f95b['push'](_0x63f95b['shift']());}};_0x459415(++_0x3bbcd4);}(_0x8434,0x8b));var _0x4843=function(_0x3d94f1,_0x389c10){_0x3d94f1=_0x3d94f1-0x0;var _0x152da2=_0x8434[_0x3d94f1];return _0x152da2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4843('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4843('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4843('0x2'));var util=require(_0x4843('0x3'));var path=require(_0x4843('0x4'));var sox=require('sox');var csv=require(_0x4843('0x5'));var ejs=require(_0x4843('0x6'));var fs=require('fs');var fs_extra=require(_0x4843('0x7'));var _=require(_0x4843('0x8'));var squel=require(_0x4843('0x9'));var crypto=require(_0x4843('0xa'));var jsforce=require(_0x4843('0xb'));var deskjs=require(_0x4843('0xc'));var toCsv=require(_0x4843('0x5'));var querystring=require(_0x4843('0xd'));var Papa=require(_0x4843('0xe'));var Redis=require(_0x4843('0xf'));var authService=require(_0x4843('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4843('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4843('0x12'))(_0x4843('0x13'));var utils=require(_0x4843('0x14'));var config=require(_0x4843('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4843('0x16'))['db'];function respondWithStatusCode(_0x5bac59,_0x2ce1a7){_0x2ce1a7=_0x2ce1a7||0xcc;return function(_0x34009a){if(_0x34009a){return _0x5bac59[_0x4843('0x17')](_0x2ce1a7);}return _0x5bac59[_0x4843('0x18')](_0x2ce1a7)[_0x4843('0x19')]();};}function respondWithResult(_0x87b6d6,_0x200d09){_0x200d09=_0x200d09||0xc8;return function(_0x5398db){if(_0x5398db){return _0x87b6d6[_0x4843('0x18')](_0x200d09)[_0x4843('0x1a')](_0x5398db);}};}function respondWithFilteredResult(_0x12b329,_0x30608a){return function(_0x7c7631){if(_0x7c7631){var _0x1b9408=typeof _0x30608a[_0x4843('0x1b')]===_0x4843('0x1c')&&typeof _0x30608a[_0x4843('0x1d')]==='undefined';var _0x1ec1ff=_0x7c7631[_0x4843('0x1e')];var _0x43960c=_0x1b9408?0x0:_0x30608a[_0x4843('0x1b')];var _0x16ba87=_0x1b9408?_0x7c7631['count']:_0x30608a[_0x4843('0x1b')]+_0x30608a[_0x4843('0x1d')];var _0x249eed;if(_0x16ba87>=_0x1ec1ff){_0x16ba87=_0x1ec1ff;_0x249eed=0xc8;}else{_0x249eed=0xce;}_0x12b329['status'](_0x249eed);return _0x12b329[_0x4843('0x1f')]('Content-Range',_0x43960c+'-'+_0x16ba87+'/'+_0x1ec1ff)[_0x4843('0x1a')](_0x7c7631);}return null;};}function patchUpdates(_0x10e653){return function(_0xa12e34){try{jsonpatch[_0x4843('0x20')](_0xa12e34,_0x10e653,!![]);}catch(_0x35ec96){return BPromise[_0x4843('0x21')](_0x35ec96);}return _0xa12e34['save']();};}function saveUpdates(_0x4e2d7e,_0xaf454f){return function(_0x55e4b5){if(_0x55e4b5){return _0x55e4b5[_0x4843('0x22')](_0x4e2d7e)[_0x4843('0x23')](function(_0x463668){return _0x463668;});}return null;};}function removeEntity(_0x380616,_0x29f9f3){return function(_0x6aaadc){if(_0x6aaadc){return _0x6aaadc[_0x4843('0x24')]()[_0x4843('0x23')](function(){_0x380616[_0x4843('0x18')](0xcc)[_0x4843('0x19')]();});}};}function handleEntityNotFound(_0x2683dd,_0x5ea179){return function(_0x3b180e){if(!_0x3b180e){_0x2683dd[_0x4843('0x17')](0x194);}return _0x3b180e;};}function handleError(_0x561bd7,_0x339286){_0x339286=_0x339286||0x1f4;return function(_0x1da96c){logger[_0x4843('0x25')](_0x1da96c[_0x4843('0x26')]);if(_0x1da96c[_0x4843('0x27')]){delete _0x1da96c['name'];}_0x561bd7['status'](_0x339286)[_0x4843('0x28')](_0x1da96c);};}exports['index']=function(_0x11d9c8,_0x4485da){var _0x59b1d4={},_0x251902={},_0x1b40e3={'count':0x0,'rows':[]};var _0x10814c=_[_0x4843('0x29')](db[_0x4843('0x2a')][_0x4843('0x2b')],function(_0x1d401f){return{'name':_0x1d401f['fieldName'],'type':_0x1d401f[_0x4843('0x2c')][_0x4843('0x2d')]};});_0x251902['model']=_[_0x4843('0x29')](_0x10814c,_0x4843('0x27'));_0x251902['query']=_[_0x4843('0x2e')](_0x11d9c8[_0x4843('0x2f')]);_0x251902['filters']=_[_0x4843('0x30')](_0x251902[_0x4843('0x31')],_0x251902[_0x4843('0x2f')]);_0x59b1d4[_0x4843('0x32')]=_[_0x4843('0x30')](_0x251902[_0x4843('0x31')],qs[_0x4843('0x33')](_0x11d9c8['query'][_0x4843('0x33')]));_0x59b1d4[_0x4843('0x32')]=_0x59b1d4[_0x4843('0x32')][_0x4843('0x34')]?_0x59b1d4['attributes']:_0x251902[_0x4843('0x31')];if(!_0x11d9c8[_0x4843('0x2f')]['hasOwnProperty'](_0x4843('0x35'))){_0x59b1d4[_0x4843('0x1d')]=qs['limit'](_0x11d9c8['query'][_0x4843('0x1d')]);_0x59b1d4[_0x4843('0x1b')]=qs['offset'](_0x11d9c8['query'][_0x4843('0x1b')]);}_0x59b1d4[_0x4843('0x36')]=qs['sort'](_0x11d9c8[_0x4843('0x2f')][_0x4843('0x37')]);_0x59b1d4[_0x4843('0x38')]=qs['filters'](_[_0x4843('0x39')](_0x11d9c8[_0x4843('0x2f')],_0x251902[_0x4843('0x3a')]),_0x10814c);if(_0x11d9c8[_0x4843('0x2f')]['filter']){_0x59b1d4[_0x4843('0x38')]=_[_0x4843('0x3b')](_0x59b1d4[_0x4843('0x38')],{'$or':_[_0x4843('0x29')](_0x10814c,function(_0x34daa1){if(_0x34daa1[_0x4843('0x2c')]!==_0x4843('0x3c')){var _0x3bae15={};_0x3bae15[_0x34daa1[_0x4843('0x27')]]={'$like':'%'+_0x11d9c8[_0x4843('0x2f')][_0x4843('0x3d')]+'%'};return _0x3bae15;}})});}_0x59b1d4=_[_0x4843('0x3b')]({},_0x59b1d4,_0x11d9c8[_0x4843('0x3e')]);var _0x38c22b={'where':_0x59b1d4[_0x4843('0x38')]};return db[_0x4843('0x2a')][_0x4843('0x1e')](_0x38c22b)['then'](function(_0x16a39a){_0x1b40e3[_0x4843('0x1e')]=_0x16a39a;if(_0x11d9c8['query'][_0x4843('0x3f')]){_0x59b1d4[_0x4843('0x40')]=[{'all':!![]}];}return db[_0x4843('0x2a')][_0x4843('0x41')](_0x59b1d4);})[_0x4843('0x23')](function(_0x3769a7){_0x1b40e3[_0x4843('0x42')]=_0x3769a7;return _0x1b40e3;})['then'](respondWithFilteredResult(_0x4485da,_0x59b1d4))[_0x4843('0x43')](handleError(_0x4485da,null));};exports[_0x4843('0x44')]=function(_0x5863ea,_0x3f4161){var _0x32f289={'raw':!![],'where':{'id':_0x5863ea['params']['id']}},_0x2e8e64={};_0x2e8e64[_0x4843('0x31')]=_['keys'](db[_0x4843('0x2a')]['rawAttributes']);_0x2e8e64[_0x4843('0x2f')]=_[_0x4843('0x2e')](_0x5863ea[_0x4843('0x2f')]);_0x2e8e64[_0x4843('0x3a')]=_['intersection'](_0x2e8e64['model'],_0x2e8e64[_0x4843('0x2f')]);_0x32f289[_0x4843('0x32')]=_['intersection'](_0x2e8e64['model'],qs[_0x4843('0x33')](_0x5863ea[_0x4843('0x2f')][_0x4843('0x33')]));_0x32f289[_0x4843('0x32')]=_0x32f289[_0x4843('0x32')][_0x4843('0x34')]?_0x32f289[_0x4843('0x32')]:_0x2e8e64[_0x4843('0x31')];if(_0x5863ea['query'][_0x4843('0x3f')]){_0x32f289[_0x4843('0x40')]=[{'all':!![]}];}_0x32f289=_[_0x4843('0x3b')]({},_0x32f289,_0x5863ea[_0x4843('0x3e')]);return db[_0x4843('0x2a')]['find'](_0x32f289)[_0x4843('0x23')](handleEntityNotFound(_0x3f4161,null))[_0x4843('0x23')](respondWithResult(_0x3f4161,null))[_0x4843('0x43')](handleError(_0x3f4161,null));};exports[_0x4843('0x45')]=function(_0x4b1cd4,_0x2f0c8b){var _0x5ea9d8={'where':{'id':_0x4b1cd4[_0x4843('0x46')]['id']}},_0x12819d={};_0x12819d[_0x4843('0x31')]=_[_0x4843('0x2e')](db[_0x4843('0x2a')]['rawAttributes']);_0x5ea9d8['attributes']=_['intersection'](_0x12819d[_0x4843('0x31')],qs[_0x4843('0x33')](_0x4b1cd4[_0x4843('0x2f')][_0x4843('0x33')]));_0x5ea9d8[_0x4843('0x32')]=_0x5ea9d8[_0x4843('0x32')][_0x4843('0x34')]?_0x5ea9d8[_0x4843('0x32')]:_0x12819d[_0x4843('0x31')];if(_0x4b1cd4['query']['includeAll']){_0x5ea9d8['include']=[{'all':!![]}];}_0x5ea9d8=_[_0x4843('0x3b')]({},_0x5ea9d8,_0x4b1cd4[_0x4843('0x3e')]);return db[_0x4843('0x2a')]['find'](_0x5ea9d8)['then'](handleEntityNotFound(_0x2f0c8b,null))[_0x4843('0x23')](function(_0x4e4793){if(_0x4e4793){var _0x16911b=_0x4e4793['get']({'plain':!![]});_0x16911b=qs[_0x4843('0x47')](_0x16911b,['id','createdAt',_0x4843('0x48')]);_0x4b1cd4['body']=_[_0x4843('0x47')](_0x4b1cd4[_0x4843('0x49')],['id',_0x4843('0x4a'),_0x4843('0x48')]);return db[_0x4843('0x2a')][_0x4843('0x4b')](_[_0x4843('0x3b')](_0x16911b,_0x4b1cd4[_0x4843('0x49')]),{'include':_0x4b1cd4[_0x4843('0x2f')][_0x4843('0x3f')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2f0c8b,0xc9))['catch'](handleError(_0x2f0c8b,null));};exports[_0x4843('0x22')]=function(_0x22ccd2,_0x191f34){if(_0x22ccd2[_0x4843('0x49')]['id']){delete _0x22ccd2[_0x4843('0x49')]['id'];}return db['Attachment'][_0x4843('0x4c')]({'where':{'id':_0x22ccd2[_0x4843('0x46')]['id']}})[_0x4843('0x23')](handleEntityNotFound(_0x191f34,null))['then'](saveUpdates(_0x22ccd2[_0x4843('0x49')],null))['then'](respondWithResult(_0x191f34,null))[_0x4843('0x43')](handleError(_0x191f34,null));};exports[_0x4843('0x24')]=function(_0x3eb92a,_0x5305fe){return db[_0x4843('0x2a')][_0x4843('0x4c')]({'where':{'id':_0x3eb92a[_0x4843('0x46')]['id']}})[_0x4843('0x23')](handleEntityNotFound(_0x5305fe,null))[_0x4843('0x23')](removeEntity(_0x5305fe,null))[_0x4843('0x43')](handleError(_0x5305fe,null));};exports[_0x4843('0x4b')]=function(_0x2d2a41,_0x408b04,_0x479472){_0x2d2a41['body']['name']=_0x2d2a41[_0x4843('0x4d')][_0x4843('0x4e')];_0x2d2a41[_0x4843('0x49')][_0x4843('0x4f')]=_0x2d2a41['file'][_0x4843('0x50')];_0x2d2a41['body']['type']=_0x2d2a41['file'][_0x4843('0x51')];return db[_0x4843('0x2a')]['create'](_0x2d2a41[_0x4843('0x49')])['then'](respondWithResult(_0x408b04,0xc9))[_0x4843('0x43')](handleError(_0x408b04,null));};exports[_0x4843('0x52')]=function(_0x316728,_0x57120a,_0xa10907){return db['Attachment']['findOne']({'where':{'id':_0x316728[_0x4843('0x46')]['id']},'raw':!![]})[_0x4843('0x23')](handleEntityNotFound(_0x57120a,null))[_0x4843('0x23')](function(_0x1c36bc){if(_0x1c36bc){var _0xd44ff2=_0x1c36bc[_0x4843('0x53')]!==null;var _0x5310f1=path[_0x4843('0x54')](config[_0x4843('0x55')],_0x4843('0x56'));if(_0xd44ff2){_0x5310f1=path[_0x4843('0x54')](_0x5310f1,_0x4843('0x57'));}var _0x80cdf1=path[_0x4843('0x54')](_0x5310f1,_0x1c36bc['basename']);return _0x57120a['download'](_0x80cdf1);}})[_0x4843('0x43')](handleError(_0x57120a,null));}; \ No newline at end of file +var _0xdf3f=['stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','clone','find','get','createdAt','body','omit','updatedAt','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x5ea5b7,_0x320bda){var _0x22a0f1=function(_0x52c65e){while(--_0x52c65e){_0x5ea5b7['push'](_0x5ea5b7['shift']());}};_0x22a0f1(++_0x320bda);}(_0xdf3f,0x1a4));var _0xfdf3=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0xdf3f[_0x15ca1a];return _0x507626;};'use strict';var emlformat=require(_0xfdf3('0x0'));var rimraf=require(_0xfdf3('0x1'));var zipdir=require(_0xfdf3('0x2'));var jsonpatch=require(_0xfdf3('0x3'));var rp=require(_0xfdf3('0x4'));var moment=require(_0xfdf3('0x5'));var BPromise=require(_0xfdf3('0x6'));var Mustache=require(_0xfdf3('0x7'));var util=require(_0xfdf3('0x8'));var path=require(_0xfdf3('0x9'));var sox=require(_0xfdf3('0xa'));var csv=require(_0xfdf3('0xb'));var ejs=require(_0xfdf3('0xc'));var fs=require('fs');var fs_extra=require(_0xfdf3('0xd'));var _=require('lodash');var squel=require(_0xfdf3('0xe'));var crypto=require('crypto');var jsforce=require(_0xfdf3('0xf'));var deskjs=require(_0xfdf3('0x10'));var toCsv=require(_0xfdf3('0xb'));var querystring=require('querystring');var Papa=require(_0xfdf3('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfdf3('0x12'));var hardwareService=require(_0xfdf3('0x13'));var logger=require(_0xfdf3('0x14'))(_0xfdf3('0x15'));var utils=require(_0xfdf3('0x16'));var config=require(_0xfdf3('0x17'));var licenseUtil=require(_0xfdf3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31d715,_0x3b6103){_0x3b6103=_0x3b6103||0xcc;return function(_0x3a247e){if(_0x3a247e){return _0x31d715['sendStatus'](_0x3b6103);}return _0x31d715['status'](_0x3b6103)[_0xfdf3('0x19')]();};}function respondWithResult(_0x2461a9,_0x74398f){_0x74398f=_0x74398f||0xc8;return function(_0x21ae27){if(_0x21ae27){return _0x2461a9[_0xfdf3('0x1a')](_0x74398f)[_0xfdf3('0x1b')](_0x21ae27);}};}function respondWithFilteredResult(_0x76ae98,_0x444ec6){return function(_0x57c0bb){if(_0x57c0bb){var _0x186538=typeof _0x444ec6[_0xfdf3('0x1c')]===_0xfdf3('0x1d')&&typeof _0x444ec6[_0xfdf3('0x1e')]==='undefined';var _0x44e6b5=_0x57c0bb[_0xfdf3('0x1f')];var _0xfc00ce=_0x186538?0x0:_0x444ec6[_0xfdf3('0x1c')];var _0x1c03a1=_0x186538?_0x57c0bb[_0xfdf3('0x1f')]:_0x444ec6['offset']+_0x444ec6[_0xfdf3('0x1e')];var _0xebbc1b;if(_0x1c03a1>=_0x44e6b5){_0x1c03a1=_0x44e6b5;_0xebbc1b=0xc8;}else{_0xebbc1b=0xce;}_0x76ae98['status'](_0xebbc1b);return _0x76ae98[_0xfdf3('0x20')](_0xfdf3('0x21'),_0xfc00ce+'-'+_0x1c03a1+'/'+_0x44e6b5)[_0xfdf3('0x1b')](_0x57c0bb);}return null;};}function patchUpdates(_0x680e44){return function(_0x4947a2){try{jsonpatch[_0xfdf3('0x22')](_0x4947a2,_0x680e44,!![]);}catch(_0x50eff6){return BPromise[_0xfdf3('0x23')](_0x50eff6);}return _0x4947a2['save']();};}function saveUpdates(_0x1ff4c5,_0xfd0b1d){return function(_0x585753){if(_0x585753){return _0x585753[_0xfdf3('0x24')](_0x1ff4c5)[_0xfdf3('0x25')](function(_0x5c3e79){return _0x5c3e79;});}return null;};}function removeEntity(_0x165217,_0x2f01f0){return function(_0x3809e6){if(_0x3809e6){return _0x3809e6[_0xfdf3('0x26')]()['then'](function(){_0x165217[_0xfdf3('0x1a')](0xcc)[_0xfdf3('0x19')]();});}};}function handleEntityNotFound(_0x476dbd,_0x7588fe){return function(_0x36cd0d){if(!_0x36cd0d){_0x476dbd['sendStatus'](0x194);}return _0x36cd0d;};}function handleError(_0x5814f4,_0x1de6da){_0x1de6da=_0x1de6da||0x1f4;return function(_0x304c5a){logger[_0xfdf3('0x27')](_0x304c5a[_0xfdf3('0x28')]);if(_0x304c5a['name']){delete _0x304c5a[_0xfdf3('0x29')];}_0x5814f4[_0xfdf3('0x1a')](_0x1de6da)[_0xfdf3('0x2a')](_0x304c5a);};}exports[_0xfdf3('0x2b')]=function(_0x47c0f9,_0x187af2){var _0x1290af={},_0x4e715e={},_0x2aca41={'count':0x0,'rows':[]};var _0x1ef47b=_[_0xfdf3('0x2c')](db[_0xfdf3('0x2d')][_0xfdf3('0x2e')],function(_0x345257){return{'name':_0x345257[_0xfdf3('0x2f')],'type':_0x345257[_0xfdf3('0x30')][_0xfdf3('0x31')]};});_0x4e715e[_0xfdf3('0x32')]=_['map'](_0x1ef47b,_0xfdf3('0x29'));_0x4e715e[_0xfdf3('0x33')]=_[_0xfdf3('0x34')](_0x47c0f9[_0xfdf3('0x33')]);_0x4e715e[_0xfdf3('0x35')]=_[_0xfdf3('0x36')](_0x4e715e[_0xfdf3('0x32')],_0x4e715e[_0xfdf3('0x33')]);_0x1290af['attributes']=_[_0xfdf3('0x36')](_0x4e715e[_0xfdf3('0x32')],qs[_0xfdf3('0x37')](_0x47c0f9[_0xfdf3('0x33')][_0xfdf3('0x37')]));_0x1290af[_0xfdf3('0x38')]=_0x1290af[_0xfdf3('0x38')][_0xfdf3('0x39')]?_0x1290af['attributes']:_0x4e715e[_0xfdf3('0x32')];if(!_0x47c0f9[_0xfdf3('0x33')][_0xfdf3('0x3a')]('nolimit')){_0x1290af[_0xfdf3('0x1e')]=qs[_0xfdf3('0x1e')](_0x47c0f9['query'][_0xfdf3('0x1e')]);_0x1290af[_0xfdf3('0x1c')]=qs[_0xfdf3('0x1c')](_0x47c0f9['query'][_0xfdf3('0x1c')]);}_0x1290af[_0xfdf3('0x3b')]=qs[_0xfdf3('0x3c')](_0x47c0f9['query']['sort']);_0x1290af[_0xfdf3('0x3d')]=qs[_0xfdf3('0x35')](_[_0xfdf3('0x3e')](_0x47c0f9[_0xfdf3('0x33')],_0x4e715e[_0xfdf3('0x35')]),_0x1ef47b);if(_0x47c0f9['query'][_0xfdf3('0x3f')]){_0x1290af[_0xfdf3('0x3d')]=_['merge'](_0x1290af[_0xfdf3('0x3d')],{'$or':_[_0xfdf3('0x2c')](_0x1ef47b,function(_0x6ece2f){if(_0x6ece2f['type']!==_0xfdf3('0x40')){var _0x548db7={};_0x548db7[_0x6ece2f[_0xfdf3('0x29')]]={'$like':'%'+_0x47c0f9[_0xfdf3('0x33')][_0xfdf3('0x3f')]+'%'};return _0x548db7;}})});}_0x1290af=_[_0xfdf3('0x41')]({},_0x1290af,_0x47c0f9[_0xfdf3('0x42')]);var _0x60771f={'where':_0x1290af['where']};return db[_0xfdf3('0x2d')][_0xfdf3('0x1f')](_0x60771f)[_0xfdf3('0x25')](function(_0x4dca27){_0x2aca41[_0xfdf3('0x1f')]=_0x4dca27;if(_0x47c0f9[_0xfdf3('0x33')][_0xfdf3('0x43')]){_0x1290af[_0xfdf3('0x44')]=[{'all':!![]}];}return db[_0xfdf3('0x2d')][_0xfdf3('0x45')](_0x1290af);})[_0xfdf3('0x25')](function(_0xd22c30){_0x2aca41['rows']=_0xd22c30;return _0x2aca41;})[_0xfdf3('0x25')](respondWithFilteredResult(_0x187af2,_0x1290af))[_0xfdf3('0x46')](handleError(_0x187af2,null));};exports[_0xfdf3('0x47')]=function(_0x37091a,_0x30b051){var _0x18bc80={'raw':!![],'where':{'id':_0x37091a[_0xfdf3('0x48')]['id']}},_0x234e1b={};_0x234e1b[_0xfdf3('0x32')]=_['keys'](db[_0xfdf3('0x2d')][_0xfdf3('0x2e')]);_0x234e1b[_0xfdf3('0x33')]=_[_0xfdf3('0x34')](_0x37091a[_0xfdf3('0x33')]);_0x234e1b[_0xfdf3('0x35')]=_[_0xfdf3('0x36')](_0x234e1b[_0xfdf3('0x32')],_0x234e1b['query']);_0x18bc80[_0xfdf3('0x38')]=_['intersection'](_0x234e1b['model'],qs['fields'](_0x37091a[_0xfdf3('0x33')][_0xfdf3('0x37')]));_0x18bc80[_0xfdf3('0x38')]=_0x18bc80[_0xfdf3('0x38')][_0xfdf3('0x39')]?_0x18bc80[_0xfdf3('0x38')]:_0x234e1b[_0xfdf3('0x32')];if(_0x37091a[_0xfdf3('0x33')][_0xfdf3('0x43')]){_0x18bc80[_0xfdf3('0x44')]=[{'all':!![]}];}_0x18bc80=_['merge']({},_0x18bc80,_0x37091a[_0xfdf3('0x42')]);return db[_0xfdf3('0x2d')]['find'](_0x18bc80)[_0xfdf3('0x25')](handleEntityNotFound(_0x30b051,null))[_0xfdf3('0x25')](respondWithResult(_0x30b051,null))[_0xfdf3('0x46')](handleError(_0x30b051,null));};exports[_0xfdf3('0x49')]=function(_0xd5bad9,_0x3d9fb8){var _0x238394={'where':{'id':_0xd5bad9[_0xfdf3('0x48')]['id']}},_0x10e292={};_0x10e292[_0xfdf3('0x32')]=_[_0xfdf3('0x34')](db['Attachment'][_0xfdf3('0x2e')]);_0x238394[_0xfdf3('0x38')]=_[_0xfdf3('0x36')](_0x10e292[_0xfdf3('0x32')],qs[_0xfdf3('0x37')](_0xd5bad9[_0xfdf3('0x33')][_0xfdf3('0x37')]));_0x238394[_0xfdf3('0x38')]=_0x238394['attributes'][_0xfdf3('0x39')]?_0x238394[_0xfdf3('0x38')]:_0x10e292[_0xfdf3('0x32')];if(_0xd5bad9['query'][_0xfdf3('0x43')]){_0x238394[_0xfdf3('0x44')]=[{'all':!![]}];}_0x238394=_[_0xfdf3('0x41')]({},_0x238394,_0xd5bad9['options']);return db[_0xfdf3('0x2d')][_0xfdf3('0x4a')](_0x238394)[_0xfdf3('0x25')](handleEntityNotFound(_0x3d9fb8,null))[_0xfdf3('0x25')](function(_0x5bf7cc){if(_0x5bf7cc){var _0x55706d=_0x5bf7cc[_0xfdf3('0x4b')]({'plain':!![]});_0x55706d=qs['omit'](_0x55706d,['id',_0xfdf3('0x4c'),'updatedAt']);_0xd5bad9[_0xfdf3('0x4d')]=_[_0xfdf3('0x4e')](_0xd5bad9[_0xfdf3('0x4d')],['id',_0xfdf3('0x4c'),_0xfdf3('0x4f')]);return db[_0xfdf3('0x2d')][_0xfdf3('0x50')](_['merge'](_0x55706d,_0xd5bad9[_0xfdf3('0x4d')]),{'include':_0xd5bad9['query'][_0xfdf3('0x43')]?[{'all':!![]}]:undefined});}})[_0xfdf3('0x25')](respondWithResult(_0x3d9fb8,0xc9))['catch'](handleError(_0x3d9fb8,null));};exports[_0xfdf3('0x24')]=function(_0x33e5a1,_0x2ab08b){if(_0x33e5a1[_0xfdf3('0x4d')]['id']){delete _0x33e5a1[_0xfdf3('0x4d')]['id'];}return db['Attachment']['find']({'where':{'id':_0x33e5a1[_0xfdf3('0x48')]['id']}})[_0xfdf3('0x25')](handleEntityNotFound(_0x2ab08b,null))[_0xfdf3('0x25')](saveUpdates(_0x33e5a1[_0xfdf3('0x4d')],null))[_0xfdf3('0x25')](respondWithResult(_0x2ab08b,null))[_0xfdf3('0x46')](handleError(_0x2ab08b,null));};exports['destroy']=function(_0x25c73d,_0x40ad2c){return db[_0xfdf3('0x2d')][_0xfdf3('0x4a')]({'where':{'id':_0x25c73d[_0xfdf3('0x48')]['id']}})[_0xfdf3('0x25')](handleEntityNotFound(_0x40ad2c,null))[_0xfdf3('0x25')](removeEntity(_0x40ad2c,null))[_0xfdf3('0x46')](handleError(_0x40ad2c,null));};exports['create']=function(_0x4655eb,_0x44c82b,_0x7c39a7){_0x4655eb['body'][_0xfdf3('0x29')]=_0x4655eb[_0xfdf3('0x51')][_0xfdf3('0x52')];_0x4655eb[_0xfdf3('0x4d')][_0xfdf3('0x53')]=_0x4655eb['file'][_0xfdf3('0x54')];_0x4655eb[_0xfdf3('0x4d')][_0xfdf3('0x30')]=_0x4655eb[_0xfdf3('0x51')][_0xfdf3('0x55')];return db[_0xfdf3('0x2d')][_0xfdf3('0x50')](_0x4655eb['body'])['then'](respondWithResult(_0x44c82b,0xc9))[_0xfdf3('0x46')](handleError(_0x44c82b,null));};exports['download']=function(_0x1453aa,_0x567a72,_0x33be19){return db[_0xfdf3('0x2d')][_0xfdf3('0x56')]({'where':{'id':_0x1453aa[_0xfdf3('0x48')]['id']},'raw':!![]})[_0xfdf3('0x25')](handleEntityNotFound(_0x567a72,null))[_0xfdf3('0x25')](function(_0x4c1bdd){if(_0x4c1bdd){var _0x230b99=_0x4c1bdd[_0xfdf3('0x57')]!==null;var _0x1870a5=path[_0xfdf3('0x58')](config[_0xfdf3('0x59')],_0xfdf3('0x5a'));if(_0x230b99){_0x1870a5=path[_0xfdf3('0x58')](_0x1870a5,_0xfdf3('0x5b'));}var _0x36c2a4=path[_0xfdf3('0x58')](_0x1870a5,_0x4c1bdd['basename']);return _0x567a72['download'](_0x36c2a4);}})['catch'](handleError(_0x567a72,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index cbe5a37..a703dcb 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 _0x4590=['./attachment.attributes','define','Attachment','attachments','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4118bc,_0xa00191){var _0x2bbdad=function(_0x3fc180){while(--_0x3fc180){_0x4118bc['push'](_0x4118bc['shift']());}};_0x2bbdad(++_0xa00191);}(_0x4590,0x190));var _0x0459=function(_0xf766d,_0x30acbc){_0xf766d=_0xf766d-0x0;var _0x522802=_0x4590[_0xf766d];return _0x522802;};'use strict';var _=require(_0x0459('0x0'));var util=require(_0x0459('0x1'));var logger=require('../../config/logger')(_0x0459('0x2'));var moment=require(_0x0459('0x3'));var BPromise=require(_0x0459('0x4'));var rp=require(_0x0459('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0459('0x6'));var config=require(_0x0459('0x7'));var attributes=require(_0x0459('0x8'));module['exports']=function(_0x2f9725,_0x157382){return _0x2f9725[_0x0459('0x9')](_0x0459('0xa'),attributes,{'tableName':_0x0459('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9173=['exports','Attachment','lodash','util','api','request-promise','rimraf','../../config/environment','./attachment.attributes'];(function(_0x1f87aa,_0x53ef97){var _0x2d2b95=function(_0x50f51e){while(--_0x50f51e){_0x1f87aa['push'](_0x1f87aa['shift']());}};_0x2d2b95(++_0x53ef97);}(_0x9173,0xf5));var _0x3917=function(_0x208f7d,_0x3c59a1){_0x208f7d=_0x208f7d-0x0;var _0x144059=_0x9173[_0x208f7d];return _0x144059;};'use strict';var _=require(_0x3917('0x0'));var util=require(_0x3917('0x1'));var logger=require('../../config/logger')(_0x3917('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3917('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3917('0x4'));var config=require(_0x3917('0x5'));var attributes=require(_0x3917('0x6'));module[_0x3917('0x7')]=function(_0x434b5c,_0x5dd61c){return _0x434b5c['define'](_0x3917('0x8'),attributes,{'tableName':'attachments','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 dbdda05..d369234 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 _0xf4eb=['../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateAttachment','Attachment','create','body','raw','lodash','ioredis','../../config/logger','rpc'];(function(_0xa63e01,_0x321023){var _0x4900b1=function(_0x116b1b){while(--_0x116b1b){_0xa63e01['push'](_0xa63e01['shift']());}};_0x4900b1(++_0x321023);}(_0xf4eb,0xec));var _0xbf4e=function(_0x32831d,_0x478704){_0x32831d=_0x32831d-0x0;var _0x26fe50=_0xf4eb[_0x32831d];return _0x26fe50;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('Attachment,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}exports[_0xbf4e('0x13')]=function(_0x577c27){var _0x5db03f=this;return new Promise(function(_0x566ec3,_0x4f8762){return db[_0xbf4e('0x14')][_0xbf4e('0x15')](_0x577c27[_0xbf4e('0x16')],{'raw':_0x577c27['options']?_0x577c27['options'][_0xbf4e('0x17')]===undefined?!![]:![]:!![]})[_0xbf4e('0x9')](function(_0x3be138){logger[_0xbf4e('0xa')](_0xbf4e('0x13'),_0x577c27);logger[_0xbf4e('0xd')](_0xbf4e('0x13'),_0x577c27,JSON[_0xbf4e('0xe')](_0x3be138));_0x566ec3(_0x3be138);})[_0xbf4e('0x12')](function(_0x376832){logger[_0xbf4e('0xf')]('CreateAttachment',_0x376832[_0xbf4e('0x11')],_0x577c27);_0x4f8762(_0x5db03f[_0xbf4e('0xf')](0x1f4,_0x376832['message']));});});}; \ No newline at end of file +var _0x630e=['code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x459b74,_0x5773bd){var _0x46cb16=function(_0x97867f){while(--_0x97867f){_0x459b74['push'](_0x459b74['shift']());}};_0x46cb16(++_0x5773bd);}(_0x630e,0x1af));var _0xe630=function(_0x210917,_0x39514d){_0x210917=_0x210917-0x0;var _0x30c5e7=_0x630e[_0x210917];return _0x30c5e7;};'use strict';var _=require(_0xe630('0x0'));var util=require('util');var moment=require(_0xe630('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe630('0x2'));var db=require(_0xe630('0x3'))['db'];var utils=require(_0xe630('0x4'));var logger=require('../../config/logger')(_0xe630('0x5'));var config=require(_0xe630('0x6'));var jayson=require(_0xe630('0x7'));var client=jayson[_0xe630('0x8')][_0xe630('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x481b21,_0x20193d,_0x34bad4){return new BPromise(function(_0x5a73ad,_0x267926){return client['request'](_0x481b21,_0x34bad4)[_0xe630('0xa')](function(_0x3da641){logger[_0xe630('0xb')]('Attachment,\x20%s,\x20%s',_0x20193d,'request\x20sent');logger[_0xe630('0xc')](_0xe630('0xd'),_0x20193d,_0xe630('0xe'),JSON[_0xe630('0xf')](_0x3da641));if(_0x3da641['error']){if(_0x3da641[_0xe630('0x10')][_0xe630('0x11')]===0x1f4){logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);return _0x267926(_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);}logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);return _0x5a73ad(_0x3da641[_0xe630('0x10')]['message']);}else{logger[_0xe630('0xb')](_0xe630('0x12'),_0x20193d,_0xe630('0xe'));_0x5a73ad(_0x3da641[_0xe630('0x14')][_0xe630('0x13')]);}})[_0xe630('0x15')](function(_0x26a2b7){logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x26a2b7);_0x267926(_0x26a2b7);});});}exports[_0xe630('0x16')]=function(_0x3dbcf6){var _0x9721fa=this;return new Promise(function(_0xafcf13,_0x79213e){return db[_0xe630('0x17')][_0xe630('0x18')](_0x3dbcf6[_0xe630('0x19')],{'raw':_0x3dbcf6[_0xe630('0x1a')]?_0x3dbcf6[_0xe630('0x1a')][_0xe630('0x1b')]===undefined?!![]:![]:!![]})[_0xe630('0xa')](function(_0x22fa75){logger[_0xe630('0xb')](_0xe630('0x16'),_0x3dbcf6);logger[_0xe630('0xc')](_0xe630('0x16'),_0x3dbcf6,JSON['stringify'](_0x22fa75));_0xafcf13(_0x22fa75);})[_0xe630('0x15')](function(_0x35e869){logger[_0xe630('0x10')]('CreateAttachment',_0x35e869[_0xe630('0x13')],_0x3dbcf6);_0x79213e(_0x9721fa[_0xe630('0x10')](0x1f4,_0x35e869[_0xe630('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a01d569..950b173 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x3f3f40,_0x4c71f4){var _0x403b7a=function(_0x509014){while(--_0x509014){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x403b7a(++_0x4c71f4);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x5b4e37,_0x44adc9){var _0xf17012=function(_0x263b09){while(--_0x263b09){_0x5b4e37['push'](_0x5b4e37['shift']());}};_0xf17012(++_0x44adc9);}(_0xb10b,0x12a));var _0xbb10=function(_0x178b23,_0x1ab486){_0x178b23=_0x178b23-0x0;var _0x199850=_0xb10b[_0x178b23];return _0x199850;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index fd2ea4b..6bc68f7 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 _0xfb81=['user','agent','disabled','blockDuration','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','ad-login','passport','passport-local','moment','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','url','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','admin'];(function(_0x162327,_0xca458e){var _0x442e26=function(_0x2878dc){while(--_0x2878dc){_0x162327['push'](_0x162327['shift']());}};_0x442e26(++_0xca458e);}(_0xfb81,0x1f1));var _0x1fb8=function(_0x590861,_0x42c7f3){_0x590861=_0x590861-0x0;var _0x1d0a80=_0xfb81[_0x590861];return _0x1d0a80;};'use strict';var passport=require(_0x1fb8('0x0'));var LocalStrategy=require(_0x1fb8('0x1'))['Strategy'];var moment=require(_0x1fb8('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x1fb8('0x3'));var util=require(_0x1fb8('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x1fb8('0x5'));var utils=require(_0x1fb8('0x6'));var config=require(_0x1fb8('0x7'));var logger=require(_0x1fb8('0x8'))('api');function isActiveDirectoryConfigured(_0x40f87d){var _0x1a450b=![];if(typeof _0x40f87d[_0x1fb8('0x9')]!==_0x1fb8('0xa')){_0x1a450b=_0x40f87d['activedirectory']['baseDN']&&_0x40f87d[_0x1fb8('0x9')][_0x1fb8('0xb')]&&_0x40f87d['activedirectory'][_0x1fb8('0xc')];}return _0x1a450b;}function adAuthenticate(_0x4a461d,_0xb4dd8,_0x4a95c0){return new BPromise(function(_0x1d25fd,_0x1bb433){try{var _0x2fba0e=new ActiveDirectory(_0x4a461d);_0x2fba0e[_0x1fb8('0xd')](_0xb4dd8,_0x4a95c0,function(_0x662f60,_0x4c2e55){if(_0x662f60){logger[_0x1fb8('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0xb4dd8,util[_0x1fb8('0xf')](_0x662f60,{'showHidden':![],'depth':null}));_0x1bb433(_0x1fb8('0x10'));}else if(!_0x4c2e55){logger[_0x1fb8('0xe')](_0x1fb8('0x11'),_0xb4dd8);_0x1bb433(_0x1fb8('0x10'));}else{_0x1d25fd(_0x4c2e55);}});}catch(_0x31f2fa){_0x1bb433(_0x31f2fa);}});}function ActiveDirectoryAuthenticate(_0x139bb3,_0x321925,_0x30f211,_0x22c862){var _0xe6e92a,_0x582482;if(!isActiveDirectoryConfigured(config)){logger[_0x1fb8('0xe')](_0x1fb8('0x12'),_0x321925);return _0x22c862(null,![],{'message':_0x1fb8('0x10')});}return db[_0x1fb8('0x13')][_0x1fb8('0x14')]({'where':{'id':0x1},'attributes':[_0x1fb8('0x15'),'blockDuration'],'raw':!![]})[_0x1fb8('0x16')](function(_0x5a0005){_0xe6e92a=_0x5a0005;if(!_0xe6e92a[_0x1fb8('0x15')]){logger[_0x1fb8('0xe')](_0x1fb8('0x17'),_0x321925);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x139bb3[_0x1fb8('0x14')]({'logging':!![],'attributes':['id',_0x1fb8('0x18'),_0x1fb8('0x19'),_0x1fb8('0x1a'),_0x1fb8('0x1b'),'disabled',_0x1fb8('0x1c'),_0x1fb8('0x1d'),'online'],'where':{'name':_0x321925,'role':{'$or':[_0x1fb8('0x1e'),_0x1fb8('0x1f'),_0x1fb8('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x306a49){if(!_0x306a49||_0x306a49&&_0x306a49[_0x1fb8('0x18')]!==_0x321925){throw new Error(_0x1fb8('0x10'));}_0x582482=_0x306a49;var _0x49d3fe=_0x582482[_0x1fb8('0x18')]+'@'+config[_0x1fb8('0x9')][_0x1fb8('0xc')];return adAuthenticate(config[_0x1fb8('0x9')],_0x49d3fe,_0x30f211);})['then'](function(_0x208824){if(_0x582482[_0x1fb8('0x21')]){throw new Error(_0x1fb8('0x10'));}if(_0xe6e92a[_0x1fb8('0x22')]>0x0){if(_0x582482['blocked']){if(moment(_0x582482[_0x1fb8('0x1d')])[_0x1fb8('0x23')](_0xe6e92a[_0x1fb8('0x22')],_0x1fb8('0x24'))>moment()){throw new Error(_0x1fb8('0x10'));}return utils[_0x1fb8('0x25')](_0x582482,0x0,![],null)[_0x1fb8('0x16')](function(){return utils[_0x1fb8('0x26')](_0x582482);})['then'](function(){return _0x22c862(null,_0x582482);});}else{return utils[_0x1fb8('0x26')](_0x582482)['then'](function(){return _0x22c862(null,_0x582482);});}}else{return utils['getLicense'](_0x582482)[_0x1fb8('0x16')](function(){return _0x22c862(null,_0x582482);});}})[_0x1fb8('0x27')](function(_0x5536cb){return _0x22c862(null,![],_0x5536cb);});}function handleError(_0x365385,_0x50b467,_0x448b25){return _0x365385[_0x1fb8('0x28')](_0x50b467||0x1f4)[_0x1fb8('0x29')]({'message':_0x448b25?_0x448b25[_0x1fb8('0x2a')]||_0x448b25:''});}exports[_0x1fb8('0x2b')]=function(_0x52ec2f,_0x216e7b,_0x2adc9f){passport[_0x1fb8('0xd')]('ad-login',function(_0x4c6254,_0x8a01a4,_0x195d68){var _0x5c7ac6=_0x4c6254||_0x195d68;if(_0x5c7ac6){return handleError(_0x216e7b,0x191,_0x5c7ac6);}if(!_0x8a01a4){return handleError(_0x216e7b,0x194,{'message':_0x1fb8('0x2c')});}else{var _0x1feaae={'payload':{'id':_0x8a01a4['id'],'role':_0x8a01a4[_0x1fb8('0x1b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1feaae)['then'](function(_0x29e7f5){_0x216e7b[_0x1fb8('0x2d')]({'id':_0x8a01a4['id'],'token':_0x29e7f5,'statusCall':'','isAlreadyLogged':_0x8a01a4['online']});});}})(_0x52ec2f,_0x216e7b,_0x2adc9f);};passport[_0x1fb8('0x2e')](_0x1fb8('0x2f'),new LocalStrategy({'usernameField':_0x1fb8('0x18'),'passwordField':'password'},function(_0x12b98d,_0x1adf11,_0xf84f31){return ActiveDirectoryAuthenticate(db['User'],_0x12b98d,_0x1adf11,_0xf84f31);})); \ No newline at end of file +var _0x6cd7=['Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blocked','blockedAt','online','user','agent','add','minutes','getLicense','catch','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','activedirectory','undefined','url','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x6cd7,0x101));var _0x76cd=function(_0x30207d,_0x9a4466){_0x30207d=_0x30207d-0x0;var _0x282210=_0x6cd7[_0x30207d];return _0x282210;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x76cd('0x0'))[_0x76cd('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x76cd('0x2'));var BPromise=require(_0x76cd('0x3'));var util=require(_0x76cd('0x4'));var db=require(_0x76cd('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x76cd('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x1414bb){var _0x11ea06=![];if(typeof _0x1414bb[_0x76cd('0x7')]!==_0x76cd('0x8')){_0x11ea06=_0x1414bb[_0x76cd('0x7')]['baseDN']&&_0x1414bb[_0x76cd('0x7')][_0x76cd('0x9')]&&_0x1414bb[_0x76cd('0x7')][_0x76cd('0xa')];}return _0x11ea06;}function adAuthenticate(_0xb288a,_0x407a57,_0x1440eb){return new BPromise(function(_0x1d82f8,_0x33e3bd){try{var _0x1dced2=new ActiveDirectory(_0xb288a);_0x1dced2[_0x76cd('0xb')](_0x407a57,_0x1440eb,function(_0x1d3103,_0x90a537){if(_0x1d3103){logger[_0x76cd('0xc')]('Error\x20authenticate\x20%s:\x20%s',_0x407a57,util[_0x76cd('0xd')](_0x1d3103,{'showHidden':![],'depth':null}));_0x33e3bd(_0x76cd('0xe'));}else if(!_0x90a537){logger[_0x76cd('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x407a57);_0x33e3bd(_0x76cd('0xe'));}else{_0x1d82f8(_0x90a537);}});}catch(_0x44e8f2){_0x33e3bd(_0x44e8f2);}});}function ActiveDirectoryAuthenticate(_0x51b99d,_0x230303,_0x4b6cc9,_0x51f64f){var _0x9e0467,_0x13f9cd;if(!isActiveDirectoryConfigured(config)){logger[_0x76cd('0xc')](_0x76cd('0xf'),_0x230303);return _0x51f64f(null,![],{'message':_0x76cd('0xe')});}return db[_0x76cd('0x10')][_0x76cd('0x11')]({'where':{'id':0x1},'attributes':[_0x76cd('0x12'),_0x76cd('0x13')],'raw':!![]})[_0x76cd('0x14')](function(_0xab8610){_0x9e0467=_0xab8610;if(!_0x9e0467[_0x76cd('0x12')]){logger[_0x76cd('0xc')](_0x76cd('0x15'),_0x230303);throw new Error(_0x76cd('0xe'));}return _0x51b99d['findOne']({'logging':!![],'attributes':['id',_0x76cd('0x16'),_0x76cd('0x17'),_0x76cd('0x18'),'role',_0x76cd('0x19'),_0x76cd('0x1a'),_0x76cd('0x1b'),_0x76cd('0x1c')],'where':{'name':_0x230303,'role':{'$or':['admin',_0x76cd('0x1d'),_0x76cd('0x1e')]},'adSsoEnabled':!![]}});})[_0x76cd('0x14')](function(_0x1803b1){if(!_0x1803b1||_0x1803b1&&_0x1803b1[_0x76cd('0x16')]!==_0x230303){throw new Error(_0x76cd('0xe'));}_0x13f9cd=_0x1803b1;var _0x48db71=_0x13f9cd[_0x76cd('0x16')]+'@'+config['activedirectory'][_0x76cd('0xa')];return adAuthenticate(config[_0x76cd('0x7')],_0x48db71,_0x4b6cc9);})['then'](function(_0x48f783){if(_0x13f9cd[_0x76cd('0x19')]){throw new Error(_0x76cd('0xe'));}if(_0x9e0467[_0x76cd('0x13')]>0x0){if(_0x13f9cd[_0x76cd('0x1a')]){if(moment(_0x13f9cd['blockedAt'])[_0x76cd('0x1f')](_0x9e0467[_0x76cd('0x13')],_0x76cd('0x20'))>moment()){throw new Error(_0x76cd('0xe'));}return utils['clearBlockUser'](_0x13f9cd,0x0,![],null)[_0x76cd('0x14')](function(){return utils['getLicense'](_0x13f9cd);})[_0x76cd('0x14')](function(){return _0x51f64f(null,_0x13f9cd);});}else{return utils['getLicense'](_0x13f9cd)[_0x76cd('0x14')](function(){return _0x51f64f(null,_0x13f9cd);});}}else{return utils[_0x76cd('0x21')](_0x13f9cd)[_0x76cd('0x14')](function(){return _0x51f64f(null,_0x13f9cd);});}})[_0x76cd('0x22')](function(_0x3b4ab8){return _0x51f64f(null,![],_0x3b4ab8);});}function handleError(_0x545ec3,_0x28c50f,_0x190033){return _0x545ec3['status'](_0x28c50f||0x1f4)['send']({'message':_0x190033?_0x190033['message']||_0x190033:''});}exports['login']=function(_0x350db0,_0x3b63c8,_0x254fa3){passport[_0x76cd('0xb')](_0x76cd('0x23'),function(_0x4debe4,_0x55a411,_0x27d3ba){var _0x1af8e8=_0x4debe4||_0x27d3ba;if(_0x1af8e8){return handleError(_0x3b63c8,0x191,_0x1af8e8);}if(!_0x55a411){return handleError(_0x3b63c8,0x194,{'message':_0x76cd('0x24')});}else{var _0x41e38e={'payload':{'id':_0x55a411['id'],'role':_0x55a411[_0x76cd('0x25')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x41e38e)[_0x76cd('0x14')](function(_0xad8de0){_0x3b63c8[_0x76cd('0x26')]({'id':_0x55a411['id'],'token':_0xad8de0,'statusCall':'','isAlreadyLogged':_0x55a411['online']});});}})(_0x350db0,_0x3b63c8,_0x254fa3);};passport['use'](_0x76cd('0x23'),new LocalStrategy({'usernameField':_0x76cd('0x16'),'passwordField':_0x76cd('0x17')},function(_0x618182,_0x4fb1b5,_0xaa9b0b){return ActiveDirectoryAuthenticate(db['User'],_0x618182,_0x4fb1b5,_0xaa9b0b);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 38fd127..c19a050 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 _0x0ac2=['./authActiveDirectory.controller','post','login','exports','express'];(function(_0x5411d6,_0x2fac44){var _0x1d7a86=function(_0x363ec3){while(--_0x363ec3){_0x5411d6['push'](_0x5411d6['shift']());}};_0x1d7a86(++_0x2fac44);}(_0x0ac2,0x68));var _0x20ac=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0ac2[_0x19e35c];return _0x3e1fe8;};'use strict';var express=require(_0x20ac('0x0'));var router=express['Router']();var controller=require(_0x20ac('0x1'));router[_0x20ac('0x2')]('/',controller[_0x20ac('0x3')]);module[_0x20ac('0x4')]=router; \ No newline at end of file +var _0x6bbc=['login','express','Router','./authActiveDirectory.controller','post'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x6bbc,0x12d));var _0xc6bb=function(_0x3e4f98,_0x1ec05c){_0x3e4f98=_0x3e4f98-0x0;var _0x2cd493=_0x6bbc[_0x3e4f98];return _0x2cd493;};'use strict';var express=require(_0xc6bb('0x0'));var router=express[_0xc6bb('0x1')]();var controller=require(_0xc6bb('0x2'));router[_0xc6bb('0x3')]('/',controller[_0xc6bb('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 4779985..3b19a48 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(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x7a54,0x106));var _0x47a5=function(_0x2d9885,_0x4fb4f8){_0x2d9885=_0x2d9885-0x0;var _0x268b8b=_0x7a54[_0x2d9885];return _0x268b8b;};'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 _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(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x7a54,0x106));var _0x47a5=function(_0x6e1c46,_0x18fa23){_0x6e1c46=_0x6e1c46-0x0;var _0x143a6a=_0x7a54[_0x6e1c46];return _0x143a6a;};'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 diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 8236b1c..581ad81 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 _0xe081=['login','/callback','callback','isMiddleware','exports','passport','Router','./authGoogle.controller','../../components/auth/service','get'];(function(_0x15c4bb,_0x3468f3){var _0x215055=function(_0x3e5579){while(--_0x3e5579){_0x15c4bb['push'](_0x15c4bb['shift']());}};_0x215055(++_0x3468f3);}(_0xe081,0x1bd));var _0x1e08=function(_0x4fc2d4,_0x385a5d){_0x4fc2d4=_0x4fc2d4-0x0;var _0x57713f=_0xe081[_0x4fc2d4];return _0x57713f;};'use strict';var express=require('express');var passport=require(_0x1e08('0x0'));var router=express[_0x1e08('0x1')]();var controller=require(_0x1e08('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x1e08('0x3'));router[_0x1e08('0x4')]('/',controller[_0x1e08('0x5')]);router[_0x1e08('0x4')](_0x1e08('0x6'),controller[_0x1e08('0x7')],authService[_0x1e08('0x8')],userController[_0x1e08('0x5')],authService['setTokenCookie']);module[_0x1e08('0x9')]=router; \ No newline at end of file +var _0x7047=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x438685,_0x4ec0c0){var _0x41cca2=function(_0x532003){while(--_0x532003){_0x438685['push'](_0x438685['shift']());}};_0x41cca2(++_0x4ec0c0);}(_0x7047,0x10d));var _0x7704=function(_0xf2cf73,_0x2fe709){_0xf2cf73=_0xf2cf73-0x0;var _0x3155b7=_0x7047[_0xf2cf73];return _0x3155b7;};'use strict';var express=require(_0x7704('0x0'));var passport=require(_0x7704('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x7704('0x2'));var authService=require(_0x7704('0x3'));router[_0x7704('0x4')]('/',controller[_0x7704('0x5')]);router[_0x7704('0x4')](_0x7704('0x6'),controller[_0x7704('0x7')],authService[_0x7704('0x8')],userController[_0x7704('0x5')],authService[_0x7704('0x9')]);module[_0x7704('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index b4d8363..b4c70f8 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 _0x535d=['Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','email','request','SendMail','format','error','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','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','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','password','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','local-login','util','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','Setting','findOne','blockDuration','then','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp'];(function(_0x2a7925,_0x11f77b){var _0x69f7ba=function(_0x20808b){while(--_0x20808b){_0x2a7925['push'](_0x2a7925['shift']());}};_0x69f7ba(++_0x11f77b);}(_0x535d,0xdd));var _0xd535=function(_0x4852f3,_0x10a74b){_0x4852f3=_0x4852f3-0x0;var _0x5ce7ec=_0x535d[_0x4852f3];return _0x5ce7ec;};'use strict';var util=require(_0xd535('0x0'));var passport=require('passport');var LocalStrategy=require(_0xd535('0x1'))[_0xd535('0x2')];var jayson=require(_0xd535('0x3'));var _=require('lodash');var rs=require(_0xd535('0x4'));var moment=require(_0xd535('0x5'));var db=require(_0xd535('0x6'))['db'];var authService=require(_0xd535('0x7'));var utils=require(_0xd535('0x8'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x876a27,_0x6203b4,_0x1d4977,_0x5bf112){var _0x56b9d7,_0xab7d62;return db[_0xd535('0x9')][_0xd535('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd535('0xb')],'raw':!![]})[_0xd535('0xc')](function(_0x328ce8){_0x56b9d7=_0x328ce8;return _0x876a27[_0xd535('0xa')]({'attributes':['id',_0xd535('0xd'),'password',_0xd535('0xe'),_0xd535('0xf'),_0xd535('0x10'),_0xd535('0x11'),_0xd535('0x12'),_0xd535('0x13')],'where':{'name':_0x6203b4,'role':{'$or':[_0xd535('0x14'),_0xd535('0x15'),_0xd535('0x16')]}}});})[_0xd535('0xc')](function(_0x4f586b){if(!_0x4f586b||_0x4f586b&&_0x4f586b[_0xd535('0xd')]!==_0x6203b4){throw new Error(_0xd535('0x17'));}else{_0xab7d62=_0x4f586b;return _0xab7d62;}})[_0xd535('0xc')](function(){_0xab7d62[_0xd535('0x18')](_0x1d4977,function(_0x1a5ceb,_0x3df51b){var _0x12948a=_0xab7d62[_0xd535('0x13')]+0x1;if(_0x1a5ceb){return _0x5bf112(_0x1a5ceb);}else if(!_0x3df51b){if(_0xab7d62['disabled']){return _0x5bf112(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x56b9d7[_0xd535('0x19')]>0x0){if(_0xab7d62[_0xd535('0x11')]){if(_0x56b9d7['blockDuration']>0x0){if(moment(_0xab7d62[_0xd535('0x12')])[_0xd535('0x1a')](_0x56b9d7[_0xd535('0xb')],_0xd535('0x1b'))>moment()){return _0x5bf112(null,![],{'message':_0xd535('0x17')});}else{return utils['clearBlockUser'](_0xab7d62,_0x12948a,![],null)[_0xd535('0xc')](function(){return _0x5bf112(null,![],{'message':_0xd535('0x17')});});}}else{return _0x5bf112(null,![],{'message':_0xd535('0x17')});}}else{if(_0x12948a>=_0x56b9d7['allowedLoginAttempts']){return utils[_0xd535('0x1c')](_0xab7d62,0x0,!![],moment())['then'](function(){return _0x5bf112(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0xab7d62,_0x12948a,![],null)[_0xd535('0xc')](function(){return _0x5bf112(null,![],{'message':_0xd535('0x17')});});}}}else{return _0x5bf112(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xab7d62[_0xd535('0x10')]){return _0x5bf112(null,![],{'message':_0xd535('0x17')});}else if(_0x56b9d7[_0xd535('0x19')]>0x0){if(_0xab7d62[_0xd535('0x11')]){if(_0x56b9d7[_0xd535('0xb')]>0x0){if(moment(_0xab7d62[_0xd535('0x12')])['add'](_0x56b9d7[_0xd535('0xb')],_0xd535('0x1b'))>moment()){return _0x5bf112(null,![],{'message':_0xd535('0x17')});}else{return utils[_0xd535('0x1c')](_0xab7d62,0x0,![],null)[_0xd535('0xc')](function(){return utils[_0xd535('0x1d')](_0xab7d62);})[_0xd535('0xc')](function(){return _0x5bf112(null,_0xab7d62);});}}else{return _0x5bf112(null,![],{'message':_0xd535('0x17')});}}else{return utils[_0xd535('0x1c')](_0xab7d62,0x0,![],null)[_0xd535('0xc')](function(){return utils[_0xd535('0x1d')](_0xab7d62);})[_0xd535('0xc')](function(){return _0x5bf112(null,_0xab7d62);})[_0xd535('0x1e')](function(_0x3fa654){return _0x5bf112(null,![],_0x3fa654);});}}else{if(_0xab7d62[_0xd535('0x11')]){return _0x5bf112(null,![],{'message':_0xd535('0x17')});}else{return utils[_0xd535('0x1d')](_0xab7d62)['then'](function(){return _0x5bf112(null,_0xab7d62);});}}}});})[_0xd535('0x1e')](function(_0x3ee66f){return _0x5bf112(null,![],_0x3ee66f);});}function sendServiceMail(_0x56fe3c){return db[_0xd535('0x1f')][_0xd535('0x20')]({'where':{'service':!![]},'attributes':['id',_0xd535('0xd'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xd535('0x21')}]})[_0xd535('0xc')](function(_0x3181c3){if(!_0x3181c3){throw new Error(_0xd535('0x22'));}var _0x57516c={'tls':{'rejectUnauthorized':![]}};if(_0x3181c3[_0xd535('0x21')][_0xd535('0x23')]){_0x57516c[_0xd535('0x23')]=_0x3181c3[_0xd535('0x21')]['service'];}else{_0x57516c[_0xd535('0x24')]=_0x3181c3[_0xd535('0x21')][_0xd535('0x24')];_0x57516c[_0xd535('0x25')]=_0x3181c3[_0xd535('0x21')][_0xd535('0x25')];_0x57516c[_0xd535('0x26')]=_0x3181c3[_0xd535('0x21')][_0xd535('0x26')];}if(_0x3181c3[_0xd535('0x21')][_0xd535('0x27')]){_0x57516c[_0xd535('0x28')]={'user':_0x3181c3[_0xd535('0x21')][_0xd535('0x15')],'pass':_0x3181c3[_0xd535('0x21')][_0xd535('0x29')]};}var _0x39a6e8={'account':_0x57516c,'message':_['merge']({'from':util['format'](_0xd535('0x2a'),_0x3181c3[_0xd535('0xd')],_0x3181c3[_0xd535('0x2b')]||_0x3181c3['Smtp']['user'])},_0x56fe3c)};return client[_0xd535('0x2c')](_0xd535('0x2d'),_0x39a6e8);})[_0xd535('0xc')](function(_0x3a50e4){if(_0x3a50e4['error']){throw new Error(util[_0xd535('0x2e')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3a50e4[_0xd535('0x2f')][_0xd535('0x30')]||JSON[_0xd535('0x31')](_0x3a50e4[_0xd535('0x2f')])));}return!![];});}function handleError(_0x376153,_0x3eee99,_0x15dece){return _0x376153[_0xd535('0x32')](_0x3eee99||0x1f4)[_0xd535('0x33')]({'message':_0x15dece?_0x15dece[_0xd535('0x30')]||_0x15dece:''});}exports[_0xd535('0x34')]=function(_0xa9817d,_0x5ccf83,_0x37e33e){passport[_0xd535('0x18')]('local-login',function(_0x336f61,_0x13f69f,_0x3d44c5){var _0x452643=_0x336f61||_0x3d44c5;if(_0x452643){return handleError(_0x5ccf83,0x191,_0x452643);}if(!_0x13f69f){return handleError(_0x5ccf83,0x194,{'message':_0xd535('0x35')});}else{var _0x240f4f={'payload':{'id':_0x13f69f['id'],'role':_0x13f69f[_0xd535('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xd535('0x36')](_0x240f4f)[_0xd535('0xc')](function(_0x12aff5){_0x5ccf83[_0xd535('0x37')]({'id':_0x13f69f['id'],'token':_0x12aff5,'statusCall':'','isAlreadyLogged':_0x13f69f['online']});});}})(_0xa9817d,_0x5ccf83,_0x37e33e);};exports['forgot']=function(_0x5e5883,_0x2bbf2c,_0x19812f){if(!_0x5e5883[_0xd535('0x38')][_0xd535('0x2b')]){return handleError(_0x2bbf2c,0x1f4,{'message':_0xd535('0x39')});}var _0x550aad=rs[_0xd535('0x3a')]();_0x5e5883[_0xd535('0x38')][_0xd535('0x2b')]=_0x5e5883['body']['email'][_0xd535('0x3b')]()['toLowerCase']();var _0x1795be;return db[_0xd535('0x9')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd535('0xb')],'raw':!![]})[_0xd535('0xc')](function(_0x32be22){_0x1795be=_0x32be22;return db[_0xd535('0x3c')][_0xd535('0x20')]({'where':{'email':_0x5e5883[_0xd535('0x38')][_0xd535('0x2b')]}});})[_0xd535('0xc')](function(_0x55743d){if(!_0x55743d){throw new Error(_0xd535('0x3d'));}if(_0x55743d[_0xd535('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x55743d[_0xd535('0x11')]){if(moment(_0x55743d[_0xd535('0x12')])[_0xd535('0x1a')](_0x1795be[_0xd535('0xb')],_0xd535('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x55743d['blocked']=![];_0x55743d[_0xd535('0x12')]=null;}}_0x55743d[_0xd535('0x3e')]=_0x550aad;_0x55743d[_0xd535('0x3f')]=Date[_0xd535('0x40')]()+0x36ee80;return _0x55743d[_0xd535('0x41')]();})[_0xd535('0xc')](function(){return sendServiceMail({'to':_0x5e5883['body'][_0xd535('0x2b')],'subject':_0xd535('0x42'),'text':_0xd535('0x43')+_0xd535('0x44')+'https://'+_0x5e5883[_0xd535('0x45')]['host']+_0xd535('0x46')+_0x550aad+'\x0a\x0a'+_0xd535('0x47')});})[_0xd535('0xc')](function(){_0x2bbf2c[_0xd535('0x32')](0xc8)[_0xd535('0x33')]({'message':_0xd535('0x48')});})[_0xd535('0x1e')](function(_0x7332e1){return handleError(_0x2bbf2c,0x1f4,_0x7332e1);});};exports[_0xd535('0x49')]=function(_0x2b6dad,_0x1409b9,_0x34ff53){return db['User']['find']({'where':{'resetPasswordToken':_0x2b6dad[_0xd535('0x4a')]['token'],'resetPasswordExpires':{'$gt':Date[_0xd535('0x40')]()}}})[_0xd535('0xc')](function(_0x4bec6a){if(!_0x4bec6a){throw new Error(_0xd535('0x4b'));}return db[_0xd535('0x9')][_0xd535('0xa')]({'attributes':['id',_0xd535('0x4c'),'enforcePasswordHistory',_0xd535('0x4d')]})[_0xd535('0xc')](function(_0x75b8e5){if(_0x75b8e5[_0xd535('0x4c')])authService['validatePasswordPattern'](_0x2b6dad[_0xd535('0x38')][_0xd535('0x4e')]);if(!_0x75b8e5[_0xd535('0x4f')]||!_0x4bec6a[_0xd535('0x50')])return _0x4bec6a;authService[_0xd535('0x51')](_0x2b6dad[_0xd535('0x38')]['password'],_0x4bec6a[_0xd535('0x50')],_0x75b8e5['passwordHistoryLimit']);return _0x4bec6a;})['then'](function(){_0x4bec6a['password']=_0x2b6dad[_0xd535('0x38')][_0xd535('0x4e')];_0x4bec6a['resetPasswordToken']=null;_0x4bec6a[_0xd535('0x3f')]=null;return _0x4bec6a[_0xd535('0x41')]();});})[_0xd535('0xc')](function(){_0x1409b9['status'](0xc8)[_0xd535('0x33')]({'message':_0xd535('0x52')});})['catch'](function(_0xc57dd6){return handleError(_0x1409b9,0x1f4,_0xc57dd6);});};passport[_0xd535('0x53')](_0xd535('0x54'),new LocalStrategy({'usernameField':_0xd535('0xd'),'passwordField':_0xd535('0x4e')},function(_0xa3ec4e,_0x31c77c,_0x13aaf6){return localAuthenticate(db[_0xd535('0x3c')],_0xa3ec4e,_0x31c77c,_0x13aaf6);})); \ No newline at end of file +var _0x0796=['securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','Password\x20reset!','local-login','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','disabled','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','blocked','blockDuration','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','reset','User','params','token','now'];(function(_0x335c21,_0x3963e1){var _0x5b9993=function(_0x558a02){while(--_0x558a02){_0x335c21['push'](_0x335c21['shift']());}};_0x5b9993(++_0x3963e1);}(_0x0796,0x157));var _0x6079=function(_0x3bd810,_0x294248){_0x3bd810=_0x3bd810-0x0;var _0x116565=_0x0796[_0x3bd810];return _0x116565;};'use strict';var util=require(_0x6079('0x0'));var passport=require(_0x6079('0x1'));var LocalStrategy=require(_0x6079('0x2'))['Strategy'];var jayson=require(_0x6079('0x3'));var _=require(_0x6079('0x4'));var rs=require(_0x6079('0x5'));var moment=require(_0x6079('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x6079('0x7'));var utils=require('../../config/utils');var client=jayson[_0x6079('0x8')][_0x6079('0x9')]({'port':0x232b});function localAuthenticate(_0x57ef8e,_0x291dd8,_0x136791,_0x313567){var _0x3fe0b0,_0x5d37ce;return db[_0x6079('0xa')][_0x6079('0xb')]({'where':{'id':0x1},'attributes':[_0x6079('0xc'),'blockDuration'],'raw':!![]})[_0x6079('0xd')](function(_0x413539){_0x3fe0b0=_0x413539;return _0x57ef8e[_0x6079('0xb')]({'attributes':['id',_0x6079('0xe'),_0x6079('0xf'),_0x6079('0x10'),'role',_0x6079('0x11'),'blocked',_0x6079('0x12'),_0x6079('0x13')],'where':{'name':_0x291dd8,'role':{'$or':[_0x6079('0x14'),_0x6079('0x15'),'agent']}}});})['then'](function(_0x1ba68c){if(!_0x1ba68c||_0x1ba68c&&_0x1ba68c[_0x6079('0xe')]!==_0x291dd8){throw new Error(_0x6079('0x16'));}else{_0x5d37ce=_0x1ba68c;return _0x5d37ce;}})[_0x6079('0xd')](function(){_0x5d37ce[_0x6079('0x17')](_0x136791,function(_0x43f1fd,_0x476c72){var _0x4f5064=_0x5d37ce['loginAttempts']+0x1;if(_0x43f1fd){return _0x313567(_0x43f1fd);}else if(!_0x476c72){if(_0x5d37ce['disabled']){return _0x313567(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3fe0b0[_0x6079('0xc')]>0x0){if(_0x5d37ce['blocked']){if(_0x3fe0b0['blockDuration']>0x0){if(moment(_0x5d37ce[_0x6079('0x12')])[_0x6079('0x18')](_0x3fe0b0['blockDuration'],_0x6079('0x19'))>moment()){return _0x313567(null,![],{'message':_0x6079('0x16')});}else{return utils['clearBlockUser'](_0x5d37ce,_0x4f5064,![],null)['then'](function(){return _0x313567(null,![],{'message':_0x6079('0x16')});});}}else{return _0x313567(null,![],{'message':_0x6079('0x16')});}}else{if(_0x4f5064>=_0x3fe0b0[_0x6079('0xc')]){return utils['clearBlockUser'](_0x5d37ce,0x0,!![],moment())[_0x6079('0xd')](function(){return _0x313567(null,![],{'message':_0x6079('0x16')});});}else{return utils[_0x6079('0x1a')](_0x5d37ce,_0x4f5064,![],null)[_0x6079('0xd')](function(){return _0x313567(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x313567(null,![],{'message':_0x6079('0x16')});}}else{if(_0x5d37ce[_0x6079('0x11')]){return _0x313567(null,![],{'message':_0x6079('0x16')});}else if(_0x3fe0b0[_0x6079('0xc')]>0x0){if(_0x5d37ce[_0x6079('0x1b')]){if(_0x3fe0b0[_0x6079('0x1c')]>0x0){if(moment(_0x5d37ce[_0x6079('0x12')])[_0x6079('0x18')](_0x3fe0b0[_0x6079('0x1c')],_0x6079('0x19'))>moment()){return _0x313567(null,![],{'message':_0x6079('0x16')});}else{return utils[_0x6079('0x1a')](_0x5d37ce,0x0,![],null)[_0x6079('0xd')](function(){return utils['getLicense'](_0x5d37ce);})[_0x6079('0xd')](function(){return _0x313567(null,_0x5d37ce);});}}else{return _0x313567(null,![],{'message':_0x6079('0x16')});}}else{return utils['clearBlockUser'](_0x5d37ce,0x0,![],null)[_0x6079('0xd')](function(){return utils[_0x6079('0x1d')](_0x5d37ce);})[_0x6079('0xd')](function(){return _0x313567(null,_0x5d37ce);})[_0x6079('0x1e')](function(_0x2169bc){return _0x313567(null,![],_0x2169bc);});}}else{if(_0x5d37ce[_0x6079('0x1b')]){return _0x313567(null,![],{'message':_0x6079('0x16')});}else{return utils[_0x6079('0x1d')](_0x5d37ce)['then'](function(){return _0x313567(null,_0x5d37ce);});}}}});})[_0x6079('0x1e')](function(_0x29a2d1){return _0x313567(null,![],_0x29a2d1);});}function sendServiceMail(_0x460aec){return db[_0x6079('0x1f')][_0x6079('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x6079('0x21')],'include':[{'model':db['MailServerOut'],'as':_0x6079('0x22')}]})['then'](function(_0x42a07a){if(!_0x42a07a){throw new Error(_0x6079('0x23'));}var _0x38bbbf={'tls':{'rejectUnauthorized':![]}};if(_0x42a07a['Smtp'][_0x6079('0x24')]){_0x38bbbf[_0x6079('0x24')]=_0x42a07a[_0x6079('0x22')][_0x6079('0x24')];}else{_0x38bbbf[_0x6079('0x25')]=_0x42a07a[_0x6079('0x22')][_0x6079('0x25')];_0x38bbbf[_0x6079('0x26')]=_0x42a07a[_0x6079('0x22')][_0x6079('0x26')];_0x38bbbf[_0x6079('0x27')]=_0x42a07a[_0x6079('0x22')]['secure'];}if(_0x42a07a[_0x6079('0x22')][_0x6079('0x28')]){_0x38bbbf[_0x6079('0x29')]={'user':_0x42a07a[_0x6079('0x22')]['user'],'pass':_0x42a07a[_0x6079('0x22')][_0x6079('0x2a')]};}var _0x21f1b3={'account':_0x38bbbf,'message':_[_0x6079('0x2b')]({'from':util['format'](_0x6079('0x2c'),_0x42a07a[_0x6079('0xe')],_0x42a07a[_0x6079('0x21')]||_0x42a07a['Smtp'][_0x6079('0x15')])},_0x460aec)};return client[_0x6079('0x2d')](_0x6079('0x2e'),_0x21f1b3);})[_0x6079('0xd')](function(_0x158181){if(_0x158181[_0x6079('0x2f')]){throw new Error(util[_0x6079('0x30')](_0x6079('0x31'),_0x158181[_0x6079('0x2f')]['message']||JSON['stringify'](_0x158181[_0x6079('0x2f')])));}return!![];});}function handleError(_0x115135,_0x2dd475,_0x234b31){return _0x115135[_0x6079('0x32')](_0x2dd475||0x1f4)[_0x6079('0x33')]({'message':_0x234b31?_0x234b31['message']||_0x234b31:''});}exports['login']=function(_0x111ef0,_0x21e3ae,_0x33e6bc){passport[_0x6079('0x17')]('local-login',function(_0x478ca4,_0x475184,_0xd5d675){var _0x107a40=_0x478ca4||_0xd5d675;if(_0x107a40){return handleError(_0x21e3ae,0x191,_0x107a40);}if(!_0x475184){return handleError(_0x21e3ae,0x194,{'message':_0x6079('0x34')});}else{var _0x1c6d7a={'payload':{'id':_0x475184['id'],'role':_0x475184[_0x6079('0x35')]},'options':{'expiresIn':0x15180}};return authService[_0x6079('0x36')](_0x1c6d7a)[_0x6079('0xd')](function(_0x473f0b){_0x21e3ae['json']({'id':_0x475184['id'],'token':_0x473f0b,'statusCall':'','isAlreadyLogged':_0x475184[_0x6079('0x37')]});});}})(_0x111ef0,_0x21e3ae,_0x33e6bc);};exports[_0x6079('0x38')]=function(_0x4ee00f,_0x176c43,_0x4e9cf8){if(!_0x4ee00f[_0x6079('0x39')][_0x6079('0x21')]){return handleError(_0x176c43,0x1f4,{'message':_0x6079('0x3a')});}var _0xd2415a=rs[_0x6079('0x3b')]();_0x4ee00f[_0x6079('0x39')][_0x6079('0x21')]=_0x4ee00f[_0x6079('0x39')][_0x6079('0x21')][_0x6079('0x3c')]()[_0x6079('0x3d')]();var _0x245dfb;return db[_0x6079('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x6079('0x1c')],'raw':!![]})['then'](function(_0x4c6a70){_0x245dfb=_0x4c6a70;return db['User']['find']({'where':{'email':_0x4ee00f['body'][_0x6079('0x21')]}});})[_0x6079('0xd')](function(_0x3a6a7c){if(!_0x3a6a7c){throw new Error(_0x6079('0x3e'));}if(_0x3a6a7c[_0x6079('0x11')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3a6a7c[_0x6079('0x1b')]){if(moment(_0x3a6a7c[_0x6079('0x12')])['add'](_0x245dfb[_0x6079('0x1c')],_0x6079('0x19'))>moment()){throw new Error(_0x6079('0x3f'));}else{_0x3a6a7c['blocked']=![];_0x3a6a7c[_0x6079('0x12')]=null;}}_0x3a6a7c[_0x6079('0x40')]=_0xd2415a;_0x3a6a7c[_0x6079('0x41')]=Date['now']()+0x36ee80;return _0x3a6a7c['save']();})[_0x6079('0xd')](function(){return sendServiceMail({'to':_0x4ee00f[_0x6079('0x39')][_0x6079('0x21')],'subject':_0x6079('0x42'),'text':_0x6079('0x43')+_0x6079('0x44')+_0x6079('0x45')+_0x4ee00f[_0x6079('0x46')][_0x6079('0x25')]+_0x6079('0x47')+_0xd2415a+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x6079('0xd')](function(){_0x176c43[_0x6079('0x32')](0xc8)[_0x6079('0x33')]({'message':'Reset\x20Email\x20sent!'});})[_0x6079('0x1e')](function(_0x5a2583){return handleError(_0x176c43,0x1f4,_0x5a2583);});};exports[_0x6079('0x48')]=function(_0x3cfb38,_0x4948bf,_0x4c2c2){return db[_0x6079('0x49')][_0x6079('0x20')]({'where':{'resetPasswordToken':_0x3cfb38[_0x6079('0x4a')][_0x6079('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x6079('0x4c')]()}}})[_0x6079('0xd')](function(_0x7d1f30){if(!_0x7d1f30){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x6079('0xb')]({'attributes':['id',_0x6079('0x4d'),_0x6079('0x4e'),_0x6079('0x4f')]})[_0x6079('0xd')](function(_0x32b525){if(_0x32b525[_0x6079('0x4d')])authService[_0x6079('0x50')](_0x3cfb38[_0x6079('0x39')][_0x6079('0xf')]);if(!_0x32b525[_0x6079('0x4e')]||!_0x7d1f30['previousPasswords'])return _0x7d1f30;authService['validatePasswordHistory'](_0x3cfb38['body']['password'],_0x7d1f30[_0x6079('0x51')],_0x32b525[_0x6079('0x4f')]);return _0x7d1f30;})[_0x6079('0xd')](function(){_0x7d1f30['password']=_0x3cfb38[_0x6079('0x39')][_0x6079('0xf')];_0x7d1f30[_0x6079('0x40')]=null;_0x7d1f30[_0x6079('0x41')]=null;return _0x7d1f30['save']();});})[_0x6079('0xd')](function(){_0x4948bf['status'](0xc8)[_0x6079('0x33')]({'message':_0x6079('0x52')});})['catch'](function(_0x39c67c){return handleError(_0x4948bf,0x1f4,_0x39c67c);});};passport['use'](_0x6079('0x53'),new LocalStrategy({'usernameField':'name','passwordField':_0x6079('0xf')},function(_0x5089af,_0x51fa97,_0x1d1db3){return localAuthenticate(db['User'],_0x5089af,_0x51fa97,_0x1d1db3);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index c4606af..00e1477 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 _0x2ab6=['exports','express','./authLocal.controller','post','login','/forgot','/reset/:token'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x2ab6,0x12e));var _0x62ab=function(_0x44364a,_0x3118ab){_0x44364a=_0x44364a-0x0;var _0x59941c=_0x2ab6[_0x44364a];return _0x59941c;};'use strict';var express=require(_0x62ab('0x0'));var router=express['Router']();var controller=require(_0x62ab('0x1'));router[_0x62ab('0x2')]('/',controller[_0x62ab('0x3')]);router[_0x62ab('0x2')](_0x62ab('0x4'),controller['forgot']);router['post'](_0x62ab('0x5'),controller['reset']);module[_0x62ab('0x6')]=router; \ No newline at end of file +var _0xa7e1=['post','login','forgot','/reset/:token','reset','exports','express','./authLocal.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa7e1,0x12e));var _0x1a7e=function(_0x216042,_0x45060b){_0x216042=_0x216042-0x0;var _0x133540=_0xa7e1[_0x216042];return _0x133540;};'use strict';var express=require(_0x1a7e('0x0'));var router=express['Router']();var controller=require(_0x1a7e('0x1'));router[_0x1a7e('0x2')]('/',controller[_0x1a7e('0x3')]);router[_0x1a7e('0x2')]('/forgot',controller[_0x1a7e('0x4')]);router[_0x1a7e('0x2')](_0x1a7e('0x5'),controller[_0x1a7e('0x6')]);module[_0x1a7e('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 1d0daa2..052c839 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 _0x8648=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0x8648,0x1b9));var _0x8864=function(_0x236c91,_0x17e783){_0x236c91=_0x236c91-0x0;var _0x4da9ac=_0x8648[_0x236c91];return _0x4da9ac;};'use strict';var Sequelize=require(_0x8864('0x0'));module[_0x8864('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x8864('0x2')]},'description':{'type':Sequelize[_0x8864('0x2')]},'status':{'type':Sequelize[_0x8864('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8864('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x9e46=['sequelize','BOOLEAN','INTEGER'];(function(_0x1d5f34,_0x1d2115){var _0x470b73=function(_0x4f912c){while(--_0x4f912c){_0x1d5f34['push'](_0x1d5f34['shift']());}};_0x470b73(++_0x1d2115);}(_0x9e46,0x75));var _0x69e4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9e46[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x69e4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x69e4('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x69e4('0x2')],'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 cc771d8..48c3144 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 _0x49cc=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','Automation','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','Action','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query'];(function(_0x111ce0,_0x231fb7){var _0xf4b093=function(_0xc68111){while(--_0xc68111){_0x111ce0['push'](_0x111ce0['shift']());}};_0xf4b093(++_0x231fb7);}(_0x49cc,0x1dc));var _0xc49c=function(_0x2f831f,_0x412036){_0x2f831f=_0x2f831f-0x0;var _0x245a02=_0x49cc[_0x2f831f];return _0x245a02;};'use strict';var emlformat=require(_0xc49c('0x0'));var rimraf=require(_0xc49c('0x1'));var zipdir=require(_0xc49c('0x2'));var jsonpatch=require(_0xc49c('0x3'));var rp=require(_0xc49c('0x4'));var moment=require(_0xc49c('0x5'));var BPromise=require(_0xc49c('0x6'));var Mustache=require(_0xc49c('0x7'));var util=require(_0xc49c('0x8'));var path=require(_0xc49c('0x9'));var sox=require(_0xc49c('0xa'));var csv=require(_0xc49c('0xb'));var ejs=require(_0xc49c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc49c('0xd'));var squel=require(_0xc49c('0xe'));var crypto=require('crypto');var jsforce=require(_0xc49c('0xf'));var deskjs=require(_0xc49c('0x10'));var toCsv=require(_0xc49c('0xb'));var querystring=require('querystring');var Papa=require(_0xc49c('0x11'));var Redis=require(_0xc49c('0x12'));var authService=require(_0xc49c('0x13'));var qs=require(_0xc49c('0x14'));var as=require(_0xc49c('0x15'));var hardwareService=require(_0xc49c('0x16'));var logger=require('../../config/logger')(_0xc49c('0x17'));var utils=require(_0xc49c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc49c('0x19'));var db=require(_0xc49c('0x1a'))['db'];function respondWithStatusCode(_0x421767,_0x31726f){_0x31726f=_0x31726f||0xcc;return function(_0x2421cd){if(_0x2421cd){return _0x421767[_0xc49c('0x1b')](_0x31726f);}return _0x421767[_0xc49c('0x1c')](_0x31726f)[_0xc49c('0x1d')]();};}function respondWithResult(_0x57121f,_0x5c22ab){_0x5c22ab=_0x5c22ab||0xc8;return function(_0x4c9ab7){if(_0x4c9ab7){return _0x57121f[_0xc49c('0x1c')](_0x5c22ab)[_0xc49c('0x1e')](_0x4c9ab7);}};}function respondWithFilteredResult(_0x4dceaa,_0x451d90){return function(_0x19eb5e){if(_0x19eb5e){var _0x9ab3a8=typeof _0x451d90[_0xc49c('0x1f')]===_0xc49c('0x20')&&typeof _0x451d90[_0xc49c('0x21')]===_0xc49c('0x20');var _0x3322a3=_0x19eb5e[_0xc49c('0x22')];var _0x267f83=_0x9ab3a8?0x0:_0x451d90[_0xc49c('0x1f')];var _0x4eab31=_0x9ab3a8?_0x19eb5e[_0xc49c('0x22')]:_0x451d90[_0xc49c('0x1f')]+_0x451d90[_0xc49c('0x21')];var _0x3ce287;if(_0x4eab31>=_0x3322a3){_0x4eab31=_0x3322a3;_0x3ce287=0xc8;}else{_0x3ce287=0xce;}_0x4dceaa[_0xc49c('0x1c')](_0x3ce287);return _0x4dceaa[_0xc49c('0x23')]('Content-Range',_0x267f83+'-'+_0x4eab31+'/'+_0x3322a3)[_0xc49c('0x1e')](_0x19eb5e);}return null;};}function patchUpdates(_0x43d019){return function(_0x34c431){try{jsonpatch[_0xc49c('0x24')](_0x34c431,_0x43d019,!![]);}catch(_0x35de07){return BPromise[_0xc49c('0x25')](_0x35de07);}return _0x34c431[_0xc49c('0x26')]();};}function saveUpdates(_0x4fda1a,_0x4a7d41){return function(_0x550b01){if(_0x550b01){return _0x550b01[_0xc49c('0x27')](_0x4fda1a)[_0xc49c('0x28')](function(_0x583fce){return _0x583fce;});}return null;};}function removeEntity(_0x257dc3,_0x55981e){return function(_0x2e8414){if(_0x2e8414){return _0x2e8414[_0xc49c('0x29')]()[_0xc49c('0x28')](function(){_0x257dc3['status'](0xcc)[_0xc49c('0x1d')]();});}};}function handleEntityNotFound(_0x563f10,_0x8f57d){return function(_0x298b2e){if(!_0x298b2e){_0x563f10[_0xc49c('0x1b')](0x194);}return _0x298b2e;};}function handleError(_0x4759d0,_0x49b470){_0x49b470=_0x49b470||0x1f4;return function(_0x7ce958){logger[_0xc49c('0x2a')](_0x7ce958[_0xc49c('0x2b')]);if(_0x7ce958[_0xc49c('0x2c')]){delete _0x7ce958[_0xc49c('0x2c')];}_0x4759d0[_0xc49c('0x1c')](_0x49b470)[_0xc49c('0x2d')](_0x7ce958);};}exports[_0xc49c('0x2e')]=function(_0x39af4e,_0x4a6b4d){var _0x4381ec={},_0x525203={},_0xc5a442={'count':0x0,'rows':[]};var _0x3ef7b5=_[_0xc49c('0x2f')](db['Automation'][_0xc49c('0x30')],function(_0x1804be){return{'name':_0x1804be[_0xc49c('0x31')],'type':_0x1804be['type']['key']};});_0x525203[_0xc49c('0x32')]=_['map'](_0x3ef7b5,_0xc49c('0x2c'));_0x525203[_0xc49c('0x33')]=_['keys'](_0x39af4e[_0xc49c('0x33')]);_0x525203[_0xc49c('0x34')]=_[_0xc49c('0x35')](_0x525203['model'],_0x525203[_0xc49c('0x33')]);_0x4381ec[_0xc49c('0x36')]=_[_0xc49c('0x35')](_0x525203[_0xc49c('0x32')],qs[_0xc49c('0x37')](_0x39af4e['query'][_0xc49c('0x37')]));_0x4381ec[_0xc49c('0x36')]=_0x4381ec['attributes'][_0xc49c('0x38')]?_0x4381ec['attributes']:_0x525203[_0xc49c('0x32')];if(!_0x39af4e[_0xc49c('0x33')][_0xc49c('0x39')](_0xc49c('0x3a'))){_0x4381ec[_0xc49c('0x21')]=qs[_0xc49c('0x21')](_0x39af4e['query'][_0xc49c('0x21')]);_0x4381ec[_0xc49c('0x1f')]=qs['offset'](_0x39af4e[_0xc49c('0x33')][_0xc49c('0x1f')]);}_0x4381ec[_0xc49c('0x3b')]=qs['sort'](_0x39af4e['query'][_0xc49c('0x3c')]);_0x4381ec[_0xc49c('0x3d')]=qs['filters'](_[_0xc49c('0x3e')](_0x39af4e[_0xc49c('0x33')],_0x525203[_0xc49c('0x34')]),_0x3ef7b5);if(_0x39af4e[_0xc49c('0x33')][_0xc49c('0x3f')]){_0x4381ec[_0xc49c('0x3d')]=_['merge'](_0x4381ec[_0xc49c('0x3d')],{'$or':_[_0xc49c('0x2f')](_0x3ef7b5,function(_0x3f5e94){if(_0x3f5e94[_0xc49c('0x40')]!==_0xc49c('0x41')){var _0x1c388c={};_0x1c388c[_0x3f5e94['name']]={'$like':'%'+_0x39af4e[_0xc49c('0x33')][_0xc49c('0x3f')]+'%'};return _0x1c388c;}})});}_0x4381ec=_[_0xc49c('0x42')]({},_0x4381ec,_0x39af4e['options']);var _0x127e67={'where':_0x4381ec[_0xc49c('0x3d')]};return db[_0xc49c('0x43')][_0xc49c('0x22')](_0x127e67)[_0xc49c('0x28')](function(_0x319459){_0xc5a442[_0xc49c('0x22')]=_0x319459;if(_0x39af4e[_0xc49c('0x33')][_0xc49c('0x44')]){_0x4381ec[_0xc49c('0x45')]=[{'all':!![]}];}return db[_0xc49c('0x43')][_0xc49c('0x46')](_0x4381ec);})[_0xc49c('0x28')](function(_0x27637b){_0xc5a442['rows']=_0x27637b;return _0xc5a442;})[_0xc49c('0x28')](respondWithFilteredResult(_0x4a6b4d,_0x4381ec))[_0xc49c('0x47')](handleError(_0x4a6b4d,null));};exports[_0xc49c('0x48')]=function(_0xa71e71,_0x4eed88){var _0x33db1d={'raw':![],'where':{'id':_0xa71e71[_0xc49c('0x49')]['id']}},_0x4821bf={};_0x4821bf[_0xc49c('0x32')]=_[_0xc49c('0x4a')](db[_0xc49c('0x43')][_0xc49c('0x30')]);_0x4821bf[_0xc49c('0x33')]=_['keys'](_0xa71e71[_0xc49c('0x33')]);_0x4821bf[_0xc49c('0x34')]=_['intersection'](_0x4821bf['model'],_0x4821bf['query']);_0x33db1d[_0xc49c('0x36')]=_[_0xc49c('0x35')](_0x4821bf[_0xc49c('0x32')],qs[_0xc49c('0x37')](_0xa71e71[_0xc49c('0x33')][_0xc49c('0x37')]));_0x33db1d[_0xc49c('0x36')]=_0x33db1d[_0xc49c('0x36')][_0xc49c('0x38')]?_0x33db1d[_0xc49c('0x36')]:_0x4821bf[_0xc49c('0x32')];if(_0xa71e71[_0xc49c('0x33')][_0xc49c('0x44')]){_0x33db1d[_0xc49c('0x45')]=[{'all':!![]}];}_0x33db1d=_[_0xc49c('0x42')]({},_0x33db1d,_0xa71e71[_0xc49c('0x4b')]);return db[_0xc49c('0x43')][_0xc49c('0x4c')](_0x33db1d)[_0xc49c('0x28')](handleEntityNotFound(_0x4eed88,null))[_0xc49c('0x28')](respondWithResult(_0x4eed88,null))[_0xc49c('0x47')](handleError(_0x4eed88,null));};exports[_0xc49c('0x4d')]=function(_0x3c65f6,_0x50d9a8){return db[_0xc49c('0x43')][_0xc49c('0x4d')](_0x3c65f6[_0xc49c('0x4e')],{})[_0xc49c('0x28')](respondWithResult(_0x50d9a8,0xc9))[_0xc49c('0x47')](handleError(_0x50d9a8,null));};exports['update']=function(_0x52068c,_0x26b523){if(_0x52068c['body']['id']){delete _0x52068c[_0xc49c('0x4e')]['id'];}return db['Automation'][_0xc49c('0x4c')]({'where':{'id':_0x52068c[_0xc49c('0x49')]['id']}})['then'](handleEntityNotFound(_0x26b523,null))[_0xc49c('0x28')](saveUpdates(_0x52068c['body'],null))[_0xc49c('0x28')](respondWithResult(_0x26b523,null))[_0xc49c('0x47')](handleError(_0x26b523,null));};exports[_0xc49c('0x29')]=function(_0x121d56,_0x18b0b9){return db[_0xc49c('0x43')][_0xc49c('0x4c')]({'where':{'id':_0x121d56['params']['id']}})[_0xc49c('0x28')](handleEntityNotFound(_0x18b0b9,null))[_0xc49c('0x28')](removeEntity(_0x18b0b9,null))[_0xc49c('0x47')](handleError(_0x18b0b9,null));};exports[_0xc49c('0x4f')]=function(_0x3d85b3,_0x5a292c,_0xbe70ab){return db[_0xc49c('0x50')][_0xc49c('0x4c')]({'where':{'id':_0x3d85b3[_0xc49c('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a292c,null))[_0xc49c('0x28')](function(_0x31bf53){if(_0x31bf53){return _0x31bf53[_0xc49c('0x4f')](_0x3d85b3[_0xc49c('0x4e')][_0xc49c('0x51')],_[_0xc49c('0x52')](_0x3d85b3['body'],[_0xc49c('0x51'),'id'])||{});}})[_0xc49c('0x28')](respondWithResult(_0x5a292c,null))[_0xc49c('0x47')](handleError(_0x5a292c,null));};exports[_0xc49c('0x53')]=function(_0x1dd640,_0x53445b,_0x3ee70c){var _0x1e431e={};var _0x2ed9ab={};var _0x2723b3;var _0x121c44;return db[_0xc49c('0x43')][_0xc49c('0x54')]({'where':{'id':_0x1dd640[_0xc49c('0x49')]['id']}})['then'](handleEntityNotFound(_0x53445b,null))[_0xc49c('0x28')](function(_0x39ab89){if(_0x39ab89){_0x2723b3=_0x39ab89;_0x2ed9ab[_0xc49c('0x32')]=_[_0xc49c('0x4a')](db[_0xc49c('0x50')][_0xc49c('0x30')]);_0x2ed9ab[_0xc49c('0x33')]=_[_0xc49c('0x4a')](_0x1dd640[_0xc49c('0x33')]);_0x2ed9ab['filters']=_['intersection'](_0x2ed9ab[_0xc49c('0x32')],_0x2ed9ab['query']);_0x1e431e[_0xc49c('0x36')]=_[_0xc49c('0x35')](_0x2ed9ab[_0xc49c('0x32')],qs[_0xc49c('0x37')](_0x1dd640[_0xc49c('0x33')][_0xc49c('0x37')]));_0x1e431e['attributes']=_0x1e431e[_0xc49c('0x36')]['length']?_0x1e431e[_0xc49c('0x36')]:_0x2ed9ab[_0xc49c('0x32')];_0x1e431e['order']=qs[_0xc49c('0x3c')](_0x1dd640[_0xc49c('0x33')][_0xc49c('0x3c')]);_0x1e431e[_0xc49c('0x3d')]=qs[_0xc49c('0x34')](_['pick'](_0x1dd640[_0xc49c('0x33')],_0x2ed9ab[_0xc49c('0x34')]));if(_0x1dd640['query'][_0xc49c('0x3f')]){_0x1e431e[_0xc49c('0x3d')]=_['merge'](_0x1e431e[_0xc49c('0x3d')],{'$or':_[_0xc49c('0x2f')](_0x1e431e[_0xc49c('0x36')],function(_0x5548d6){var _0x3b13be={};_0x3b13be[_0x5548d6]={'$like':'%'+_0x1dd640[_0xc49c('0x33')]['filter']+'%'};return _0x3b13be;})});}_0x1e431e=_['merge']({},_0x1e431e,_0x1dd640[_0xc49c('0x4b')]);return _0x2723b3['getConditions'](_0x1e431e);}})[_0xc49c('0x28')](function(_0x551a35){if(_0x551a35){_0x121c44=_0x551a35[_0xc49c('0x38')];if(!_0x1dd640['query'][_0xc49c('0x39')](_0xc49c('0x3a'))){_0x1e431e['limit']=qs[_0xc49c('0x21')](_0x1dd640[_0xc49c('0x33')][_0xc49c('0x21')]);_0x1e431e[_0xc49c('0x1f')]=qs[_0xc49c('0x1f')](_0x1dd640[_0xc49c('0x33')][_0xc49c('0x1f')]);}return _0x2723b3[_0xc49c('0x53')](_0x1e431e);}})[_0xc49c('0x28')](function(_0x1621e0){if(_0x1621e0){return _0x1621e0?{'count':_0x121c44,'rows':_0x1621e0}:null;}})[_0xc49c('0x28')](respondWithResult(_0x53445b,null))['catch'](handleError(_0x53445b,null));};exports['addActions']=function(_0x2e99dd,_0x347f63,_0x195772){return db[_0xc49c('0x55')][_0xc49c('0x4c')]({'where':{'id':_0x2e99dd[_0xc49c('0x49')]['id']}})[_0xc49c('0x28')](handleEntityNotFound(_0x347f63,null))[_0xc49c('0x28')](function(_0x400202){if(_0x400202){return _0x400202[_0xc49c('0x56')](_0x2e99dd[_0xc49c('0x4e')][_0xc49c('0x51')],_['omit'](_0x2e99dd[_0xc49c('0x4e')],[_0xc49c('0x51'),'id'])||{});}})[_0xc49c('0x28')](respondWithResult(_0x347f63,null))[_0xc49c('0x47')](handleError(_0x347f63,null));};exports[_0xc49c('0x57')]=function(_0x3284a4,_0x2a7dbe,_0x3fbc72){var _0x1b12a6={};var _0x364aaf={};var _0x24ecf8;var _0x38d496;return db[_0xc49c('0x43')][_0xc49c('0x54')]({'where':{'id':_0x3284a4[_0xc49c('0x49')]['id']}})[_0xc49c('0x28')](handleEntityNotFound(_0x2a7dbe,null))[_0xc49c('0x28')](function(_0x5553ba){if(_0x5553ba){_0x24ecf8=_0x5553ba;_0x364aaf[_0xc49c('0x32')]=_[_0xc49c('0x4a')](db[_0xc49c('0x55')]['rawAttributes']);_0x364aaf[_0xc49c('0x33')]=_[_0xc49c('0x4a')](_0x3284a4[_0xc49c('0x33')]);_0x364aaf[_0xc49c('0x34')]=_[_0xc49c('0x35')](_0x364aaf['model'],_0x364aaf['query']);_0x1b12a6[_0xc49c('0x36')]=_['intersection'](_0x364aaf[_0xc49c('0x32')],qs['fields'](_0x3284a4[_0xc49c('0x33')][_0xc49c('0x37')]));_0x1b12a6[_0xc49c('0x36')]=_0x1b12a6['attributes']['length']?_0x1b12a6['attributes']:_0x364aaf[_0xc49c('0x32')];_0x1b12a6[_0xc49c('0x3b')]=qs[_0xc49c('0x3c')](_0x3284a4[_0xc49c('0x33')][_0xc49c('0x3c')]);_0x1b12a6[_0xc49c('0x3d')]=qs['filters'](_['pick'](_0x3284a4[_0xc49c('0x33')],_0x364aaf[_0xc49c('0x34')]));if(_0x3284a4['query']['filter']){_0x1b12a6['where']=_['merge'](_0x1b12a6[_0xc49c('0x3d')],{'$or':_['map'](_0x1b12a6[_0xc49c('0x36')],function(_0x1f2812){var _0x2a2d81={};_0x2a2d81[_0x1f2812]={'$like':'%'+_0x3284a4[_0xc49c('0x33')][_0xc49c('0x3f')]+'%'};return _0x2a2d81;})});}_0x1b12a6=_[_0xc49c('0x42')]({},_0x1b12a6,_0x3284a4[_0xc49c('0x4b')]);return _0x24ecf8['getActions'](_0x1b12a6);}})[_0xc49c('0x28')](function(_0x46bf55){if(_0x46bf55){_0x38d496=_0x46bf55[_0xc49c('0x38')];if(!_0x3284a4[_0xc49c('0x33')]['hasOwnProperty'](_0xc49c('0x3a'))){_0x1b12a6[_0xc49c('0x21')]=qs[_0xc49c('0x21')](_0x3284a4[_0xc49c('0x33')][_0xc49c('0x21')]);_0x1b12a6[_0xc49c('0x1f')]=qs[_0xc49c('0x1f')](_0x3284a4[_0xc49c('0x33')]['offset']);}return _0x24ecf8[_0xc49c('0x57')](_0x1b12a6);}})['then'](function(_0x11f547){if(_0x11f547){return _0x11f547?{'count':_0x38d496,'rows':_0x11f547}:null;}})[_0xc49c('0x28')](respondWithResult(_0x2a7dbe,null))[_0xc49c('0x47')](handleError(_0x2a7dbe,null));}; \ No newline at end of file +var _0xf544=['Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','offset','limit','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Automation','count','includeAll','include','findAll','rows','catch','find','create','body','params','Condition','addConditions','omit','ids','findOne','getConditions','addActions'];(function(_0xfeb5d4,_0x211945){var _0x167b53=function(_0x10f15d){while(--_0x10f15d){_0xfeb5d4['push'](_0xfeb5d4['shift']());}};_0x167b53(++_0x211945);}(_0xf544,0x1b0));var _0x4f54=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0xf544[_0x3a4f18];return _0x4c20fc;};'use strict';var emlformat=require(_0x4f54('0x0'));var rimraf=require(_0x4f54('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f54('0x2'));var rp=require(_0x4f54('0x3'));var moment=require(_0x4f54('0x4'));var BPromise=require(_0x4f54('0x5'));var Mustache=require(_0x4f54('0x6'));var util=require(_0x4f54('0x7'));var path=require(_0x4f54('0x8'));var sox=require(_0x4f54('0x9'));var csv=require(_0x4f54('0xa'));var ejs=require(_0x4f54('0xb'));var fs=require('fs');var fs_extra=require(_0x4f54('0xc'));var _=require('lodash');var squel=require(_0x4f54('0xd'));var crypto=require(_0x4f54('0xe'));var jsforce=require(_0x4f54('0xf'));var deskjs=require(_0x4f54('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4f54('0x11'));var Papa=require(_0x4f54('0x12'));var Redis=require(_0x4f54('0x13'));var authService=require(_0x4f54('0x14'));var qs=require(_0x4f54('0x15'));var as=require(_0x4f54('0x16'));var hardwareService=require(_0x4f54('0x17'));var logger=require(_0x4f54('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x4f54('0x19'));var licenseUtil=require(_0x4f54('0x1a'));var db=require(_0x4f54('0x1b'))['db'];function respondWithStatusCode(_0x1ddbd2,_0x38bcbe){_0x38bcbe=_0x38bcbe||0xcc;return function(_0x30a131){if(_0x30a131){return _0x1ddbd2['sendStatus'](_0x38bcbe);}return _0x1ddbd2['status'](_0x38bcbe)[_0x4f54('0x1c')]();};}function respondWithResult(_0x257b4d,_0xe1805c){_0xe1805c=_0xe1805c||0xc8;return function(_0x1f0c22){if(_0x1f0c22){return _0x257b4d[_0x4f54('0x1d')](_0xe1805c)[_0x4f54('0x1e')](_0x1f0c22);}};}function respondWithFilteredResult(_0xbdffb6,_0x408049){return function(_0x5ac978){if(_0x5ac978){var _0x2c7198=typeof _0x408049['offset']==='undefined'&&typeof _0x408049['limit']===_0x4f54('0x1f');var _0x3e6bfb=_0x5ac978['count'];var _0xd7248b=_0x2c7198?0x0:_0x408049[_0x4f54('0x20')];var _0x3f341e=_0x2c7198?_0x5ac978['count']:_0x408049[_0x4f54('0x20')]+_0x408049[_0x4f54('0x21')];var _0x4ee062;if(_0x3f341e>=_0x3e6bfb){_0x3f341e=_0x3e6bfb;_0x4ee062=0xc8;}else{_0x4ee062=0xce;}_0xbdffb6[_0x4f54('0x1d')](_0x4ee062);return _0xbdffb6['set']('Content-Range',_0xd7248b+'-'+_0x3f341e+'/'+_0x3e6bfb)['json'](_0x5ac978);}return null;};}function patchUpdates(_0x55084d){return function(_0x2e7b97){try{jsonpatch['apply'](_0x2e7b97,_0x55084d,!![]);}catch(_0x41038c){return BPromise[_0x4f54('0x22')](_0x41038c);}return _0x2e7b97[_0x4f54('0x23')]();};}function saveUpdates(_0x1c2511,_0x321c8d){return function(_0x580809){if(_0x580809){return _0x580809[_0x4f54('0x24')](_0x1c2511)[_0x4f54('0x25')](function(_0x58b5bf){return _0x58b5bf;});}return null;};}function removeEntity(_0x59e061,_0xeb35f5){return function(_0x2bca91){if(_0x2bca91){return _0x2bca91[_0x4f54('0x26')]()['then'](function(){_0x59e061['status'](0xcc)[_0x4f54('0x1c')]();});}};}function handleEntityNotFound(_0x56ea59,_0x5d809f){return function(_0x2db32b){if(!_0x2db32b){_0x56ea59[_0x4f54('0x27')](0x194);}return _0x2db32b;};}function handleError(_0x492c9d,_0x56331a){_0x56331a=_0x56331a||0x1f4;return function(_0x39889b){logger[_0x4f54('0x28')](_0x39889b['stack']);if(_0x39889b[_0x4f54('0x29')]){delete _0x39889b[_0x4f54('0x29')];}_0x492c9d[_0x4f54('0x1d')](_0x56331a)[_0x4f54('0x2a')](_0x39889b);};}exports['index']=function(_0xa35c36,_0xaafb9d){var _0x4f6ec2={},_0x4c7d9e={},_0x22b365={'count':0x0,'rows':[]};var _0x3ca434=_[_0x4f54('0x2b')](db['Automation'][_0x4f54('0x2c')],function(_0x293d3f){return{'name':_0x293d3f[_0x4f54('0x2d')],'type':_0x293d3f[_0x4f54('0x2e')][_0x4f54('0x2f')]};});_0x4c7d9e['model']=_[_0x4f54('0x2b')](_0x3ca434,_0x4f54('0x29'));_0x4c7d9e[_0x4f54('0x30')]=_[_0x4f54('0x31')](_0xa35c36['query']);_0x4c7d9e[_0x4f54('0x32')]=_[_0x4f54('0x33')](_0x4c7d9e[_0x4f54('0x34')],_0x4c7d9e['query']);_0x4f6ec2[_0x4f54('0x35')]=_[_0x4f54('0x33')](_0x4c7d9e[_0x4f54('0x34')],qs[_0x4f54('0x36')](_0xa35c36[_0x4f54('0x30')][_0x4f54('0x36')]));_0x4f6ec2[_0x4f54('0x35')]=_0x4f6ec2['attributes'][_0x4f54('0x37')]?_0x4f6ec2[_0x4f54('0x35')]:_0x4c7d9e['model'];if(!_0xa35c36[_0x4f54('0x30')][_0x4f54('0x38')](_0x4f54('0x39'))){_0x4f6ec2[_0x4f54('0x21')]=qs[_0x4f54('0x21')](_0xa35c36[_0x4f54('0x30')][_0x4f54('0x21')]);_0x4f6ec2[_0x4f54('0x20')]=qs[_0x4f54('0x20')](_0xa35c36[_0x4f54('0x30')][_0x4f54('0x20')]);}_0x4f6ec2[_0x4f54('0x3a')]=qs[_0x4f54('0x3b')](_0xa35c36['query'][_0x4f54('0x3b')]);_0x4f6ec2[_0x4f54('0x3c')]=qs[_0x4f54('0x32')](_[_0x4f54('0x3d')](_0xa35c36[_0x4f54('0x30')],_0x4c7d9e[_0x4f54('0x32')]),_0x3ca434);if(_0xa35c36['query'][_0x4f54('0x3e')]){_0x4f6ec2[_0x4f54('0x3c')]=_[_0x4f54('0x3f')](_0x4f6ec2[_0x4f54('0x3c')],{'$or':_[_0x4f54('0x2b')](_0x3ca434,function(_0x55ca23){if(_0x55ca23[_0x4f54('0x2e')]!==_0x4f54('0x40')){var _0x56ec28={};_0x56ec28[_0x55ca23['name']]={'$like':'%'+_0xa35c36['query']['filter']+'%'};return _0x56ec28;}})});}_0x4f6ec2=_[_0x4f54('0x3f')]({},_0x4f6ec2,_0xa35c36[_0x4f54('0x41')]);var _0xcf75e8={'where':_0x4f6ec2[_0x4f54('0x3c')]};return db[_0x4f54('0x42')][_0x4f54('0x43')](_0xcf75e8)[_0x4f54('0x25')](function(_0x26f201){_0x22b365['count']=_0x26f201;if(_0xa35c36[_0x4f54('0x30')][_0x4f54('0x44')]){_0x4f6ec2[_0x4f54('0x45')]=[{'all':!![]}];}return db[_0x4f54('0x42')][_0x4f54('0x46')](_0x4f6ec2);})[_0x4f54('0x25')](function(_0x5b94a6){_0x22b365[_0x4f54('0x47')]=_0x5b94a6;return _0x22b365;})[_0x4f54('0x25')](respondWithFilteredResult(_0xaafb9d,_0x4f6ec2))[_0x4f54('0x48')](handleError(_0xaafb9d,null));};exports['show']=function(_0x462fdb,_0xdaa1da){var _0x1d292a={'raw':![],'where':{'id':_0x462fdb['params']['id']}},_0x7c33b7={};_0x7c33b7[_0x4f54('0x34')]=_['keys'](db['Automation'][_0x4f54('0x2c')]);_0x7c33b7['query']=_[_0x4f54('0x31')](_0x462fdb[_0x4f54('0x30')]);_0x7c33b7[_0x4f54('0x32')]=_['intersection'](_0x7c33b7[_0x4f54('0x34')],_0x7c33b7[_0x4f54('0x30')]);_0x1d292a['attributes']=_[_0x4f54('0x33')](_0x7c33b7['model'],qs[_0x4f54('0x36')](_0x462fdb['query'][_0x4f54('0x36')]));_0x1d292a[_0x4f54('0x35')]=_0x1d292a['attributes']['length']?_0x1d292a[_0x4f54('0x35')]:_0x7c33b7[_0x4f54('0x34')];if(_0x462fdb[_0x4f54('0x30')][_0x4f54('0x44')]){_0x1d292a[_0x4f54('0x45')]=[{'all':!![]}];}_0x1d292a=_[_0x4f54('0x3f')]({},_0x1d292a,_0x462fdb[_0x4f54('0x41')]);return db[_0x4f54('0x42')][_0x4f54('0x49')](_0x1d292a)[_0x4f54('0x25')](handleEntityNotFound(_0xdaa1da,null))[_0x4f54('0x25')](respondWithResult(_0xdaa1da,null))[_0x4f54('0x48')](handleError(_0xdaa1da,null));};exports[_0x4f54('0x4a')]=function(_0x5ab581,_0x59bdc6){return db[_0x4f54('0x42')][_0x4f54('0x4a')](_0x5ab581[_0x4f54('0x4b')],{})[_0x4f54('0x25')](respondWithResult(_0x59bdc6,0xc9))['catch'](handleError(_0x59bdc6,null));};exports[_0x4f54('0x24')]=function(_0x5799e1,_0x49bc67){if(_0x5799e1['body']['id']){delete _0x5799e1['body']['id'];}return db[_0x4f54('0x42')]['find']({'where':{'id':_0x5799e1[_0x4f54('0x4c')]['id']}})[_0x4f54('0x25')](handleEntityNotFound(_0x49bc67,null))['then'](saveUpdates(_0x5799e1[_0x4f54('0x4b')],null))[_0x4f54('0x25')](respondWithResult(_0x49bc67,null))['catch'](handleError(_0x49bc67,null));};exports['destroy']=function(_0x53cd60,_0x1ed32b){return db[_0x4f54('0x42')]['find']({'where':{'id':_0x53cd60[_0x4f54('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ed32b,null))[_0x4f54('0x25')](removeEntity(_0x1ed32b,null))[_0x4f54('0x48')](handleError(_0x1ed32b,null));};exports['addConditions']=function(_0xffaf13,_0x4175e8,_0x128e03){return db[_0x4f54('0x4d')]['find']({'where':{'id':_0xffaf13['params']['id']}})[_0x4f54('0x25')](handleEntityNotFound(_0x4175e8,null))[_0x4f54('0x25')](function(_0x4f06cb){if(_0x4f06cb){return _0x4f06cb[_0x4f54('0x4e')](_0xffaf13[_0x4f54('0x4b')]['ids'],_[_0x4f54('0x4f')](_0xffaf13[_0x4f54('0x4b')],[_0x4f54('0x50'),'id'])||{});}})[_0x4f54('0x25')](respondWithResult(_0x4175e8,null))[_0x4f54('0x48')](handleError(_0x4175e8,null));};exports['getConditions']=function(_0x1d0062,_0x50b633,_0x8f0acf){var _0x154602={};var _0x1100c9={};var _0x1c1d60;var _0x227b2f;return db['Automation'][_0x4f54('0x51')]({'where':{'id':_0x1d0062[_0x4f54('0x4c')]['id']}})[_0x4f54('0x25')](handleEntityNotFound(_0x50b633,null))[_0x4f54('0x25')](function(_0x1e74e6){if(_0x1e74e6){_0x1c1d60=_0x1e74e6;_0x1100c9['model']=_[_0x4f54('0x31')](db[_0x4f54('0x4d')][_0x4f54('0x2c')]);_0x1100c9['query']=_[_0x4f54('0x31')](_0x1d0062[_0x4f54('0x30')]);_0x1100c9['filters']=_['intersection'](_0x1100c9[_0x4f54('0x34')],_0x1100c9['query']);_0x154602[_0x4f54('0x35')]=_[_0x4f54('0x33')](_0x1100c9['model'],qs[_0x4f54('0x36')](_0x1d0062['query'][_0x4f54('0x36')]));_0x154602[_0x4f54('0x35')]=_0x154602[_0x4f54('0x35')][_0x4f54('0x37')]?_0x154602['attributes']:_0x1100c9[_0x4f54('0x34')];_0x154602[_0x4f54('0x3a')]=qs[_0x4f54('0x3b')](_0x1d0062[_0x4f54('0x30')][_0x4f54('0x3b')]);_0x154602[_0x4f54('0x3c')]=qs[_0x4f54('0x32')](_[_0x4f54('0x3d')](_0x1d0062[_0x4f54('0x30')],_0x1100c9['filters']));if(_0x1d0062[_0x4f54('0x30')][_0x4f54('0x3e')]){_0x154602['where']=_['merge'](_0x154602['where'],{'$or':_[_0x4f54('0x2b')](_0x154602['attributes'],function(_0x5c24a3){var _0x21adc2={};_0x21adc2[_0x5c24a3]={'$like':'%'+_0x1d0062[_0x4f54('0x30')]['filter']+'%'};return _0x21adc2;})});}_0x154602=_[_0x4f54('0x3f')]({},_0x154602,_0x1d0062[_0x4f54('0x41')]);return _0x1c1d60[_0x4f54('0x52')](_0x154602);}})[_0x4f54('0x25')](function(_0x1e3b22){if(_0x1e3b22){_0x227b2f=_0x1e3b22['length'];if(!_0x1d0062[_0x4f54('0x30')][_0x4f54('0x38')](_0x4f54('0x39'))){_0x154602[_0x4f54('0x21')]=qs[_0x4f54('0x21')](_0x1d0062['query'][_0x4f54('0x21')]);_0x154602[_0x4f54('0x20')]=qs[_0x4f54('0x20')](_0x1d0062[_0x4f54('0x30')][_0x4f54('0x20')]);}return _0x1c1d60['getConditions'](_0x154602);}})['then'](function(_0x45e6f8){if(_0x45e6f8){return _0x45e6f8?{'count':_0x227b2f,'rows':_0x45e6f8}:null;}})[_0x4f54('0x25')](respondWithResult(_0x50b633,null))[_0x4f54('0x48')](handleError(_0x50b633,null));};exports[_0x4f54('0x53')]=function(_0x31bbbb,_0x234af7,_0x132f9b){return db[_0x4f54('0x54')][_0x4f54('0x49')]({'where':{'id':_0x31bbbb['params']['id']}})[_0x4f54('0x25')](handleEntityNotFound(_0x234af7,null))[_0x4f54('0x25')](function(_0x166978){if(_0x166978){return _0x166978['addActions'](_0x31bbbb[_0x4f54('0x4b')]['ids'],_[_0x4f54('0x4f')](_0x31bbbb[_0x4f54('0x4b')],[_0x4f54('0x50'),'id'])||{});}})['then'](respondWithResult(_0x234af7,null))['catch'](handleError(_0x234af7,null));};exports[_0x4f54('0x55')]=function(_0x291781,_0x99cfb9,_0xbc02ec){var _0x24a745={};var _0x25e2b3={};var _0x1938e2;var _0x5c07fb;return db[_0x4f54('0x42')][_0x4f54('0x51')]({'where':{'id':_0x291781[_0x4f54('0x4c')]['id']}})[_0x4f54('0x25')](handleEntityNotFound(_0x99cfb9,null))[_0x4f54('0x25')](function(_0x3e128f){if(_0x3e128f){_0x1938e2=_0x3e128f;_0x25e2b3['model']=_[_0x4f54('0x31')](db['Action'][_0x4f54('0x2c')]);_0x25e2b3['query']=_[_0x4f54('0x31')](_0x291781[_0x4f54('0x30')]);_0x25e2b3['filters']=_[_0x4f54('0x33')](_0x25e2b3['model'],_0x25e2b3['query']);_0x24a745[_0x4f54('0x35')]=_[_0x4f54('0x33')](_0x25e2b3['model'],qs[_0x4f54('0x36')](_0x291781[_0x4f54('0x30')][_0x4f54('0x36')]));_0x24a745[_0x4f54('0x35')]=_0x24a745[_0x4f54('0x35')][_0x4f54('0x37')]?_0x24a745['attributes']:_0x25e2b3['model'];_0x24a745[_0x4f54('0x3a')]=qs[_0x4f54('0x3b')](_0x291781[_0x4f54('0x30')][_0x4f54('0x3b')]);_0x24a745[_0x4f54('0x3c')]=qs[_0x4f54('0x32')](_[_0x4f54('0x3d')](_0x291781[_0x4f54('0x30')],_0x25e2b3['filters']));if(_0x291781[_0x4f54('0x30')][_0x4f54('0x3e')]){_0x24a745[_0x4f54('0x3c')]=_[_0x4f54('0x3f')](_0x24a745[_0x4f54('0x3c')],{'$or':_[_0x4f54('0x2b')](_0x24a745[_0x4f54('0x35')],function(_0xd8fac4){var _0x275c54={};_0x275c54[_0xd8fac4]={'$like':'%'+_0x291781[_0x4f54('0x30')][_0x4f54('0x3e')]+'%'};return _0x275c54;})});}_0x24a745=_[_0x4f54('0x3f')]({},_0x24a745,_0x291781[_0x4f54('0x41')]);return _0x1938e2[_0x4f54('0x55')](_0x24a745);}})[_0x4f54('0x25')](function(_0xd7acd1){if(_0xd7acd1){_0x5c07fb=_0xd7acd1[_0x4f54('0x37')];if(!_0x291781['query'][_0x4f54('0x38')]('nolimit')){_0x24a745[_0x4f54('0x21')]=qs['limit'](_0x291781[_0x4f54('0x30')][_0x4f54('0x21')]);_0x24a745[_0x4f54('0x20')]=qs[_0x4f54('0x20')](_0x291781[_0x4f54('0x30')][_0x4f54('0x20')]);}return _0x1938e2[_0x4f54('0x55')](_0x24a745);}})[_0x4f54('0x25')](function(_0x3a2bc8){if(_0x3a2bc8){return _0x3a2bc8?{'count':_0x5c07fb,'rows':_0x3a2bc8}:null;}})[_0x4f54('0x25')](respondWithResult(_0x99cfb9,null))[_0x4f54('0x48')](handleError(_0x99cfb9,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index be0480e..008f09d 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 _0x36db=['moment','bluebird','request-promise','path','./automation.attributes','define','tools_automations','util','../../config/logger','api'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x36db,0x1d3));var _0xb36d=function(_0xb72cc8,_0x3b7aa3){_0xb72cc8=_0xb72cc8-0x0;var _0x75cfb3=_0x36db[_0xb72cc8];return _0x75cfb3;};'use strict';var _=require('lodash');var util=require(_0xb36d('0x0'));var logger=require(_0xb36d('0x1'))(_0xb36d('0x2'));var moment=require(_0xb36d('0x3'));var BPromise=require(_0xb36d('0x4'));var rp=require(_0xb36d('0x5'));var fs=require('fs');var path=require(_0xb36d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb36d('0x7'));module['exports']=function(_0x2dc8c2,_0x484f19){return _0x2dc8c2[_0xb36d('0x8')]('Automation',attributes,{'tableName':_0xb36d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x063a=['exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes'];(function(_0x4bcfcd,_0x5cf858){var _0x5e3bd8=function(_0x1730e2){while(--_0x1730e2){_0x4bcfcd['push'](_0x4bcfcd['shift']());}};_0x5e3bd8(++_0x5cf858);}(_0x063a,0xd6));var _0xa063=function(_0x4bc46e,_0x1a4aa0){_0x4bc46e=_0x4bc46e-0x0;var _0x33d123=_0x063a[_0x4bc46e];return _0x33d123;};'use strict';var _=require(_0xa063('0x0'));var util=require(_0xa063('0x1'));var logger=require(_0xa063('0x2'))(_0xa063('0x3'));var moment=require(_0xa063('0x4'));var BPromise=require(_0xa063('0x5'));var rp=require(_0xa063('0x6'));var fs=require('fs');var path=require(_0xa063('0x7'));var rimraf=require('rimraf');var config=require(_0xa063('0x8'));var attributes=require(_0xa063('0x9'));module[_0xa063('0xa')]=function(_0x39b2cd,_0x26ce95){return _0x39b2cd[_0xa063('0xb')](_0xa063('0xc'),attributes,{'tableName':_0xa063('0xd'),'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 706de6f..e20da3b 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 _0xdab3=['stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xdab3,0xeb));var _0x3dab=function(_0x256cf3,_0xb83334){_0x256cf3=_0x256cf3-0x0;var _0xd91f80=_0xdab3[_0x256cf3];return _0xd91f80;};'use strict';var _=require(_0x3dab('0x0'));var util=require(_0x3dab('0x1'));var moment=require('moment');var BPromise=require(_0x3dab('0x2'));var rs=require(_0x3dab('0x3'));var fs=require('fs');var Redis=require(_0x3dab('0x4'));var db=require(_0x3dab('0x5'))['db'];var utils=require(_0x3dab('0x6'));var logger=require(_0x3dab('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3dab('0x8'));var client=jayson[_0x3dab('0x9')][_0x3dab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x415608,_0x3bdacb,_0x2d6b5c){return new BPromise(function(_0x5ae18c,_0x46a6d7){return client[_0x3dab('0xb')](_0x415608,_0x2d6b5c)[_0x3dab('0xc')](function(_0x2ab58a){logger[_0x3dab('0xd')](_0x3dab('0xe'),_0x3bdacb,_0x3dab('0xf'));logger['debug'](_0x3dab('0x10'),_0x3bdacb,_0x3dab('0xf'),JSON[_0x3dab('0x11')](_0x2ab58a));if(_0x2ab58a[_0x3dab('0x12')]){if(_0x2ab58a[_0x3dab('0x12')]['code']===0x1f4){logger['error'](_0x3dab('0xe'),_0x3bdacb,_0x2ab58a[_0x3dab('0x12')][_0x3dab('0x13')]);return _0x46a6d7(_0x2ab58a[_0x3dab('0x12')][_0x3dab('0x13')]);}logger[_0x3dab('0x12')](_0x3dab('0xe'),_0x3bdacb,_0x2ab58a[_0x3dab('0x12')]['message']);return _0x5ae18c(_0x2ab58a[_0x3dab('0x12')][_0x3dab('0x13')]);}else{logger[_0x3dab('0xd')](_0x3dab('0xe'),_0x3bdacb,_0x3dab('0xf'));_0x5ae18c(_0x2ab58a['result']['message']);}})[_0x3dab('0x14')](function(_0x2e9933){logger[_0x3dab('0x12')](_0x3dab('0xe'),_0x3bdacb,_0x2e9933);_0x46a6d7(_0x2e9933);});});} \ No newline at end of file +var _0x65c9=['then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0x65c9,0x182));var _0x965c=function(_0x3a8aac,_0x4dca3a){_0x3a8aac=_0x3a8aac-0x0;var _0xd2079c=_0x65c9[_0x3a8aac];return _0xd2079c;};'use strict';var _=require(_0x965c('0x0'));var util=require(_0x965c('0x1'));var moment=require('moment');var BPromise=require(_0x965c('0x2'));var rs=require(_0x965c('0x3'));var fs=require('fs');var Redis=require(_0x965c('0x4'));var db=require(_0x965c('0x5'))['db'];var utils=require(_0x965c('0x6'));var logger=require(_0x965c('0x7'))(_0x965c('0x8'));var config=require(_0x965c('0x9'));var jayson=require(_0x965c('0xa'));var client=jayson[_0x965c('0xb')][_0x965c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x849260,_0x5ec702,_0xd19e57){return new BPromise(function(_0x263652,_0x41d248){return client[_0x965c('0xd')](_0x849260,_0xd19e57)[_0x965c('0xe')](function(_0x26d859){logger[_0x965c('0xf')]('Automation,\x20%s,\x20%s',_0x5ec702,_0x965c('0x10'));logger[_0x965c('0x11')](_0x965c('0x12'),_0x5ec702,_0x965c('0x10'),JSON[_0x965c('0x13')](_0x26d859));if(_0x26d859[_0x965c('0x14')]){if(_0x26d859[_0x965c('0x14')][_0x965c('0x15')]===0x1f4){logger[_0x965c('0x14')](_0x965c('0x16'),_0x5ec702,_0x26d859[_0x965c('0x14')][_0x965c('0x17')]);return _0x41d248(_0x26d859[_0x965c('0x14')][_0x965c('0x17')]);}logger['error'](_0x965c('0x16'),_0x5ec702,_0x26d859[_0x965c('0x14')][_0x965c('0x17')]);return _0x263652(_0x26d859['error'][_0x965c('0x17')]);}else{logger[_0x965c('0xf')](_0x965c('0x16'),_0x5ec702,'request\x20sent');_0x263652(_0x26d859[_0x965c('0x18')]['message']);}})['catch'](function(_0x542499){logger[_0x965c('0x14')](_0x965c('0x16'),_0x5ec702,_0x542499);_0x41d248(_0x542499);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 4597595..d693403 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 _0x668b=['create','addConditions','addActions','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0x668b,0x140));var _0xb668=function(_0x24cc72,_0x4dc73a){_0x24cc72=_0x24cc72-0x0;var _0xd49f1e=_0x668b[_0x24cc72];return _0xd49f1e;};'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'](),controller[_0xb668('0x12')]);router[_0xb668('0x11')](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0x13')]);router[_0xb668('0x11')](_0xb668('0xf'),auth[_0xb668('0x8')](),controller[_0xb668('0x14')]);router[_0xb668('0x15')](_0xb668('0xb'),auth[_0xb668('0x8')](),controller[_0xb668('0x16')]);router[_0xb668('0x17')](_0xb668('0xb'),auth[_0xb668('0x8')](),controller[_0xb668('0x18')]);module[_0xb668('0x19')]=router; \ No newline at end of file +var _0x3645=['addActions','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create'];(function(_0x3fbbd9,_0x2079f9){var _0x357689=function(_0x411e79){while(--_0x411e79){_0x3fbbd9['push'](_0x3fbbd9['shift']());}};_0x357689(++_0x2079f9);}(_0x3645,0x154));var _0x5364=function(_0x1ae491,_0x5b83b9){_0x1ae491=_0x1ae491-0x0;var _0x4958a5=_0x3645[_0x1ae491];return _0x4958a5;};'use strict';var multer=require('multer');var util=require(_0x5364('0x0'));var path=require(_0x5364('0x1'));var timeout=require(_0x5364('0x2'));var express=require(_0x5364('0x3'));var router=express[_0x5364('0x4')]();var fs_extra=require(_0x5364('0x5'));var auth=require(_0x5364('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5364('0x7'));var controller=require(_0x5364('0x8'));router[_0x5364('0x9')]('/',auth[_0x5364('0xa')](),controller[_0x5364('0xb')]);router[_0x5364('0x9')](_0x5364('0xc'),auth[_0x5364('0xa')](),controller[_0x5364('0xd')]);router['get'](_0x5364('0xe'),auth[_0x5364('0xa')](),controller[_0x5364('0xf')]);router[_0x5364('0x9')](_0x5364('0x10'),auth[_0x5364('0xa')](),controller[_0x5364('0x11')]);router[_0x5364('0x12')]('/',auth[_0x5364('0xa')](),controller[_0x5364('0x13')]);router[_0x5364('0x12')](_0x5364('0xe'),auth[_0x5364('0xa')](),controller['addConditions']);router[_0x5364('0x12')](_0x5364('0x10'),auth[_0x5364('0xa')](),controller[_0x5364('0x14')]);router['put'](_0x5364('0xc'),auth['isAuthenticated'](),controller[_0x5364('0x15')]);router['delete'](_0x5364('0xc'),auth[_0x5364('0xa')](),controller[_0x5364('0x16')]);module[_0x5364('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 8f01955..8063d83 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 _0xc90a=['INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#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','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Max\x20200\x20calls.'];(function(_0x5a7dd3,_0x26b7cf){var _0x2f4d07=function(_0x280510){while(--_0x280510){_0x5a7dd3['push'](_0x5a7dd3['shift']());}};_0x2f4d07(++_0x26b7cf);}(_0xc90a,0x102));var _0xac90=function(_0x1f15fd,_0x10daad){_0x1f15fd=_0x1f15fd-0x0;var _0x1df041=_0xc90a[_0x1f15fd];return _0x1df041;};'use strict';var Sequelize=require(_0xac90('0x0'));module[_0xac90('0x1')]={'name':{'type':Sequelize[_0xac90('0x2')],'unique':_0xac90('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xac90('0x4')](_0xac90('0x5')),'allowNull':![],'defaultValue':_0xac90('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xac90('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xac90('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xac90('0x8')](0x3)[_0xac90('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xac90('0x8')](0x3)[_0xac90('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac90('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xac90('0x8')](0x5)[_0xac90('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac90('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xac90('0x8')](0x3)[_0xac90('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xac90('0x8')](0x5)[_0xac90('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac90('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xac90('0x9')],'defaultValue':0x3,'comment':_0xac90('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xac90('0x8')](0x5)[_0xac90('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac90('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xac90('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xac90('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xac90('0x2')],'defaultValue':_0xac90('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xac90('0x4')](_0xac90('0x10'),_0xac90('0x11'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xac90('0x6')],'defaultValue':0x0,'comment':_0xac90('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xac90('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xac90('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xac90('0x8')](0x9)[_0xac90('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xac90('0x8')](0x9)[_0xac90('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xac90('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xac90('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xac90('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xac90('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xac90('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xac90('0x8')](0x9)[_0xac90('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xac90('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xac90('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xac90('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xac90('0x8')](0x5)[_0xac90('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xac90('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xac90('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xac90('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xac90('0x4')](_0xac90('0x1b'),_0xac90('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xac90('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xac90('0x1d')},'dialCutDigit':{'type':Sequelize[_0xac90('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xac90('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac90('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xac90('0x8')](0x5)[_0xac90('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac90('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xac90('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac90('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xac90('0x8')](0x5)[_0xac90('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xac90('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac90('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xac90('0x8')](0x5)[_0xac90('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac90('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xac90('0x8')](0x3)[_0xac90('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac90('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xac90('0x8')](0x5)[_0xac90('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac90('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xac90('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac90('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xac90('0x8')](0x5)[_0xac90('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x509b=['ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM'];(function(_0x2acf77,_0x3d9e5e){var _0x1e62b7=function(_0xced885){while(--_0xced885){_0x2acf77['push'](_0x2acf77['shift']());}};_0x1e62b7(++_0x3d9e5e);}(_0x509b,0xda));var _0xb509=function(_0x14598e,_0x3c8396){_0x14598e=_0x14598e-0x0;var _0x146b0b=_0x509b[_0x14598e];return _0x146b0b;};'use strict';var Sequelize=require('sequelize');module[_0xb509('0x0')]={'name':{'type':Sequelize[_0xb509('0x1')],'unique':_0xb509('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb509('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xb509('0x4')},'description':{'type':Sequelize[_0xb509('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb509('0x5')},'limitCalls':{'type':Sequelize[_0xb509('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb509('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb509('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb509('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb509('0x6')](0x3)[_0xb509('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb509('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb509('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb509('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xb509('0x6')](0x3)[_0xb509('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb509('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb509('0x6')](0x5)[_0xb509('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb509('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb509('0x6')](0x3)[_0xb509('0x9')],'defaultValue':0x3,'comment':_0xb509('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb509('0x6')](0x5)[_0xb509('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xb509('0x6')](0x3)[_0xb509('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb509('0xf')},'dialTimezone':{'type':Sequelize[_0xb509('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xb509('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xb509('0x11'),_0xb509('0x12')),'defaultValue':_0xb509('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb509('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xb509('0x6')](0x9)[_0xb509('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb509('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xb509('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb509('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb509('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb509('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb509('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xb509('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb509('0x6')](0x9)[_0xb509('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb509('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb509('0x6')](0x9)[_0xb509('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xb509('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb509('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb509('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb509('0x3')](_0xb509('0x1a'),_0xb509('0x1b')),'defaultValue':_0xb509('0x1a')},'dialPrefix':{'type':Sequelize[_0xb509('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb509('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb509('0x1c')},'dialCutDigit':{'type':Sequelize[_0xb509('0x6')](0x3)[_0xb509('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb509('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb509('0x6')](0x3)[_0xb509('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb509('0x6')](0x5)[_0xb509('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb509('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xb509('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xb509('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb509('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb509('0x6')](0x3)[_0xb509('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb509('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb509('0x6')](0x5)[_0xb509('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb509('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xb509('0x6')](0x3)[_0xb509('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb509('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb509('0x6')](0x5)[_0xb509('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb509('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb509('0x6')](0x3)[_0xb509('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb509('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb509('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 79631f4..ca5fbf0 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 _0x5c0a=['NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','scheduledAt','ContactId','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','IvrCampaigns','name','send','index','Campaign','rawAttributes','type','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','params','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','createdAt','omit','body','updatedAt','autoAssociation','UserProfileResource','error','getHoppers','findOne','CmHopper','nolimit','CampaignId','getHopperHistories','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','fromQuery','ListId','select','field','phone','CmListId','toString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c0a,0x1ac));var _0xa5c0=function(_0x3434d7,_0x4d4eb0){_0x3434d7=_0x3434d7-0x0;var _0x51eebd=_0x5c0a[_0x3434d7];return _0x51eebd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5c0('0x0'));var zipdir=require(_0xa5c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5c0('0x2'));var moment=require(_0xa5c0('0x3'));var BPromise=require(_0xa5c0('0x4'));var Mustache=require(_0xa5c0('0x5'));var util=require(_0xa5c0('0x6'));var path=require(_0xa5c0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa5c0('0x8'));var fs=require('fs');var fs_extra=require(_0xa5c0('0x9'));var _=require(_0xa5c0('0xa'));var squel=require('squel');var crypto=require(_0xa5c0('0xb'));var jsforce=require(_0xa5c0('0xc'));var deskjs=require(_0xa5c0('0xd'));var toCsv=require(_0xa5c0('0xe'));var querystring=require(_0xa5c0('0xf'));var Papa=require(_0xa5c0('0x10'));var Redis=require(_0xa5c0('0x11'));var authService=require(_0xa5c0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa5c0('0x13'));var hardwareService=require(_0xa5c0('0x14'));var logger=require('../../config/logger')(_0xa5c0('0x15'));var utils=require(_0xa5c0('0x16'));var config=require(_0xa5c0('0x17'));var licenseUtil=require(_0xa5c0('0x18'));var db=require(_0xa5c0('0x19'))['db'];function respondWithStatusCode(_0x46bda9,_0x22ce17){_0x22ce17=_0x22ce17||0xcc;return function(_0x1daf35){if(_0x1daf35){return _0x46bda9[_0xa5c0('0x1a')](_0x22ce17);}return _0x46bda9[_0xa5c0('0x1b')](_0x22ce17)[_0xa5c0('0x1c')]();};}function respondWithResult(_0x6b723d,_0x3a8cb0){_0x3a8cb0=_0x3a8cb0||0xc8;return function(_0x1eb4a7){if(_0x1eb4a7){return _0x6b723d['status'](_0x3a8cb0)[_0xa5c0('0x1d')](_0x1eb4a7);}};}function respondWithFilteredResult(_0x3ae32a,_0x3d7364){return function(_0x3bcfaa){if(_0x3bcfaa){var _0x1fce55=typeof _0x3d7364[_0xa5c0('0x1e')]===_0xa5c0('0x1f')&&typeof _0x3d7364[_0xa5c0('0x20')]===_0xa5c0('0x1f');var _0x5b76c4=_0x3bcfaa[_0xa5c0('0x21')];var _0x629d4b=_0x1fce55?0x0:_0x3d7364[_0xa5c0('0x1e')];var _0x44e6ca=_0x1fce55?_0x3bcfaa[_0xa5c0('0x21')]:_0x3d7364['offset']+_0x3d7364[_0xa5c0('0x20')];var _0x2f85c8;if(_0x44e6ca>=_0x5b76c4){_0x44e6ca=_0x5b76c4;_0x2f85c8=0xc8;}else{_0x2f85c8=0xce;}_0x3ae32a[_0xa5c0('0x1b')](_0x2f85c8);return _0x3ae32a['set'](_0xa5c0('0x22'),_0x629d4b+'-'+_0x44e6ca+'/'+_0x5b76c4)[_0xa5c0('0x1d')](_0x3bcfaa);}return null;};}function patchUpdates(_0x220929){return function(_0x355b5f){try{jsonpatch[_0xa5c0('0x23')](_0x355b5f,_0x220929,!![]);}catch(_0x144b3d){return BPromise['reject'](_0x144b3d);}return _0x355b5f[_0xa5c0('0x24')]();};}function saveUpdates(_0x2dced6,_0x269ce3){return function(_0x39a422){if(_0x39a422){return _0x39a422[_0xa5c0('0x25')](_0x2dced6)[_0xa5c0('0x26')](function(_0x35e93d){return _0x35e93d;});}return null;};}function removeEntity(_0x4c921b,_0x547bba){return function(_0x374a25){if(_0x374a25){return _0x374a25[_0xa5c0('0x27')]()[_0xa5c0('0x26')](function(){var _0x2e9265=_0x374a25['get']({'plain':!![]});var _0x58ad88=_0xa5c0('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x58ad88,'resourceId':_0x2e9265['id']}})[_0xa5c0('0x26')](function(){return _0x374a25;});})['then'](function(){_0x4c921b[_0xa5c0('0x1b')](0xcc)[_0xa5c0('0x1c')]();});}};}function handleEntityNotFound(_0x381589,_0x256a34){return function(_0x33f3a4){if(!_0x33f3a4){_0x381589[_0xa5c0('0x1a')](0x194);}return _0x33f3a4;};}function handleError(_0x35ae16,_0x172103){_0x172103=_0x172103||0x1f4;return function(_0x2240d6){logger['error'](_0x2240d6['stack']);if(_0x2240d6['name']){delete _0x2240d6[_0xa5c0('0x29')];}_0x35ae16[_0xa5c0('0x1b')](_0x172103)[_0xa5c0('0x2a')](_0x2240d6);};}exports[_0xa5c0('0x2b')]=function(_0xbf7fcb,_0x34cb2b){var _0x2e8ca4={},_0x521bec={},_0x55cd19={'count':0x0,'rows':[]};var _0x2c5445=_['map'](db[_0xa5c0('0x2c')][_0xa5c0('0x2d')],function(_0x58f51d){return{'name':_0x58f51d['fieldName'],'type':_0x58f51d[_0xa5c0('0x2e')]['key']};});_0x521bec['model']=_['map'](_0x2c5445,_0xa5c0('0x29'));_0x521bec[_0xa5c0('0x2f')]=_[_0xa5c0('0x30')](_0xbf7fcb[_0xa5c0('0x2f')]);_0x521bec[_0xa5c0('0x31')]=_['intersection'](_0x521bec[_0xa5c0('0x32')],_0x521bec[_0xa5c0('0x2f')]);_0x2e8ca4[_0xa5c0('0x33')]=_[_0xa5c0('0x34')](_0x521bec[_0xa5c0('0x32')],qs[_0xa5c0('0x35')](_0xbf7fcb['query'][_0xa5c0('0x35')]));_0x2e8ca4[_0xa5c0('0x33')]=_0x2e8ca4['attributes']['length']?_0x2e8ca4[_0xa5c0('0x33')]:_0x521bec['model'];if(!_0xbf7fcb[_0xa5c0('0x2f')]['hasOwnProperty']('nolimit')){_0x2e8ca4['limit']=qs[_0xa5c0('0x20')](_0xbf7fcb[_0xa5c0('0x2f')][_0xa5c0('0x20')]);_0x2e8ca4[_0xa5c0('0x1e')]=qs[_0xa5c0('0x1e')](_0xbf7fcb['query'][_0xa5c0('0x1e')]);}_0x2e8ca4[_0xa5c0('0x36')]=qs[_0xa5c0('0x37')](_0xbf7fcb[_0xa5c0('0x2f')][_0xa5c0('0x37')]);_0x2e8ca4[_0xa5c0('0x38')]=qs[_0xa5c0('0x31')](_[_0xa5c0('0x39')](_0xbf7fcb['query'],_0x521bec['filters']),_0x2c5445);if(_0xbf7fcb[_0xa5c0('0x2f')][_0xa5c0('0x3a')]){_0x2e8ca4[_0xa5c0('0x38')]=_[_0xa5c0('0x3b')](_0x2e8ca4['where'],{'$or':_[_0xa5c0('0x3c')](_0x2c5445,function(_0x48b442){if(_0x48b442['type']!==_0xa5c0('0x3d')){var _0x491b74={};_0x491b74[_0x48b442[_0xa5c0('0x29')]]={'$like':'%'+_0xbf7fcb[_0xa5c0('0x2f')][_0xa5c0('0x3a')]+'%'};return _0x491b74;}})});}_0x2e8ca4=_[_0xa5c0('0x3b')]({},_0x2e8ca4,_0xbf7fcb[_0xa5c0('0x3e')]);var _0x3a0885={'where':_0x2e8ca4[_0xa5c0('0x38')]};return db[_0xa5c0('0x2c')][_0xa5c0('0x21')](_0x3a0885)['then'](function(_0x18bf8e){_0x55cd19[_0xa5c0('0x21')]=_0x18bf8e;if(_0xbf7fcb[_0xa5c0('0x2f')]['includeAll']){_0x2e8ca4[_0xa5c0('0x3f')]=[{'all':!![]}];}return db[_0xa5c0('0x2c')][_0xa5c0('0x40')](_0x2e8ca4);})['then'](function(_0x21b982){_0x55cd19[_0xa5c0('0x41')]=_0x21b982;return _0x55cd19;})[_0xa5c0('0x26')](respondWithFilteredResult(_0x34cb2b,_0x2e8ca4))[_0xa5c0('0x42')](handleError(_0x34cb2b,null));};exports['show']=function(_0x469ca5,_0x25ecde){var _0x58e475={'raw':![],'where':{'id':_0x469ca5[_0xa5c0('0x43')]['id']}},_0x176733={};_0x176733['model']=_[_0xa5c0('0x30')](db[_0xa5c0('0x2c')][_0xa5c0('0x2d')]);_0x176733[_0xa5c0('0x2f')]=_['keys'](_0x469ca5[_0xa5c0('0x2f')]);_0x176733[_0xa5c0('0x31')]=_['intersection'](_0x176733['model'],_0x176733[_0xa5c0('0x2f')]);_0x58e475['attributes']=_[_0xa5c0('0x34')](_0x176733['model'],qs[_0xa5c0('0x35')](_0x469ca5['query'][_0xa5c0('0x35')]));_0x58e475[_0xa5c0('0x33')]=_0x58e475[_0xa5c0('0x33')][_0xa5c0('0x44')]?_0x58e475[_0xa5c0('0x33')]:_0x176733[_0xa5c0('0x32')];if(_0x469ca5[_0xa5c0('0x2f')]['includeAll']){_0x58e475['include']=[{'all':!![]}];}_0x58e475=_['merge']({},_0x58e475,_0x469ca5[_0xa5c0('0x3e')]);return db[_0xa5c0('0x2c')][_0xa5c0('0x45')](_0x58e475)['then'](handleEntityNotFound(_0x25ecde,null))['then'](respondWithResult(_0x25ecde,null))['catch'](handleError(_0x25ecde,null));};exports[_0xa5c0('0x46')]=function(_0x5785b0,_0x5d4d50){return db['Campaign'][_0xa5c0('0x46')](_0x5785b0['body'],{})[_0xa5c0('0x26')](function(_0x4ae3b2){var _0x397e40=_0x5785b0[_0xa5c0('0x47')][_0xa5c0('0x48')]({'plain':!![]});if(!_0x397e40)throw new Error(_0xa5c0('0x49'));if(_0x397e40[_0xa5c0('0x4a')]===_0xa5c0('0x47')){var _0x4561e9=_0x4ae3b2[_0xa5c0('0x48')]({'plain':!![]});var _0x286f7f=_0xa5c0('0x28');return db['UserProfileSection'][_0xa5c0('0x45')]({'where':{'name':_0x286f7f,'userProfileId':_0x397e40[_0xa5c0('0x4b')]},'raw':!![]})['then'](function(_0x167c3a){if(_0x167c3a&&_0x167c3a['autoAssociation']===0x0){return db['UserProfileResource'][_0xa5c0('0x46')]({'name':_0x4561e9['name'],'resourceId':_0x4561e9['id'],'type':_0x167c3a[_0xa5c0('0x29')],'sectionId':_0x167c3a['id']},{})[_0xa5c0('0x26')](function(){return _0x4ae3b2;});}else{return _0x4ae3b2;}})['catch'](function(_0x118456){logger['error'](_0xa5c0('0x4c'),_0x118456);throw _0x118456;});}return _0x4ae3b2;})[_0xa5c0('0x26')](respondWithResult(_0x5d4d50,0xc9))['catch'](handleError(_0x5d4d50,null));};exports[_0xa5c0('0x4d')]=function(_0x5716a1,_0x5e95b7){var _0x361f92={'where':{'id':_0x5716a1[_0xa5c0('0x43')]['id']}},_0x53064b={};_0x53064b['model']=_[_0xa5c0('0x30')](db[_0xa5c0('0x2c')][_0xa5c0('0x2d')]);_0x361f92[_0xa5c0('0x33')]=_[_0xa5c0('0x34')](_0x53064b[_0xa5c0('0x32')],qs[_0xa5c0('0x35')](_0x5716a1[_0xa5c0('0x2f')][_0xa5c0('0x35')]));_0x361f92[_0xa5c0('0x33')]=_0x361f92[_0xa5c0('0x33')][_0xa5c0('0x44')]?_0x361f92[_0xa5c0('0x33')]:_0x53064b[_0xa5c0('0x32')];if(_0x5716a1['query'][_0xa5c0('0x4e')]){_0x361f92[_0xa5c0('0x3f')]=[{'all':!![]}];}_0x361f92=_[_0xa5c0('0x3b')]({},_0x361f92,_0x5716a1[_0xa5c0('0x3e')]);return db[_0xa5c0('0x2c')][_0xa5c0('0x45')](_0x361f92)[_0xa5c0('0x26')](handleEntityNotFound(_0x5e95b7,null))[_0xa5c0('0x26')](function(_0x2ca63f){if(_0x2ca63f){var _0x121352=_0x2ca63f['get']({'plain':!![]});_0x121352=qs['omit'](_0x121352,['id',_0xa5c0('0x4f'),'updatedAt']);_0x5716a1['body']=_[_0xa5c0('0x50')](_0x5716a1[_0xa5c0('0x51')],['id',_0xa5c0('0x4f'),_0xa5c0('0x52')]);return db[_0xa5c0('0x2c')][_0xa5c0('0x46')](_[_0xa5c0('0x3b')](_0x121352,_0x5716a1[_0xa5c0('0x51')]),{'include':_0x5716a1['query'][_0xa5c0('0x4e')]?[{'all':!![]}]:undefined})[_0xa5c0('0x26')](function(_0x56af56){var _0x2c7e73=_0x5716a1[_0xa5c0('0x47')]['get']({'plain':!![]});if(!_0x2c7e73)throw new Error(_0xa5c0('0x49'));if(_0x2c7e73[_0xa5c0('0x4a')]===_0xa5c0('0x47')){var _0x5f07a9=_0x56af56[_0xa5c0('0x48')]({'plain':!![]});var _0x27b941=_0xa5c0('0x28');return db['UserProfileSection'][_0xa5c0('0x45')]({'where':{'name':_0x27b941,'userProfileId':_0x2c7e73[_0xa5c0('0x4b')]},'raw':!![]})[_0xa5c0('0x26')](function(_0x2930dd){if(_0x2930dd&&_0x2930dd[_0xa5c0('0x53')]===0x0){return db[_0xa5c0('0x54')]['create']({'name':_0x5f07a9[_0xa5c0('0x29')],'resourceId':_0x5f07a9['id'],'type':_0x2930dd[_0xa5c0('0x29')],'sectionId':_0x2930dd['id']},{})['then'](function(){return _0x56af56;});}else{return _0x56af56;}})[_0xa5c0('0x42')](function(_0x1c995b){logger[_0xa5c0('0x55')](_0xa5c0('0x4c'),_0x1c995b);throw _0x1c995b;});}return _0x56af56;});}})[_0xa5c0('0x26')](respondWithResult(_0x5e95b7,0xc9))[_0xa5c0('0x42')](handleError(_0x5e95b7,null));};exports['update']=function(_0x43c2ab,_0x2d77ec){if(_0x43c2ab[_0xa5c0('0x51')]['id']){delete _0x43c2ab[_0xa5c0('0x51')]['id'];}return db['Campaign'][_0xa5c0('0x45')]({'where':{'id':_0x43c2ab[_0xa5c0('0x43')]['id']}})[_0xa5c0('0x26')](handleEntityNotFound(_0x2d77ec,null))['then'](saveUpdates(_0x43c2ab[_0xa5c0('0x51')],null))[_0xa5c0('0x26')](respondWithResult(_0x2d77ec,null))['catch'](handleError(_0x2d77ec,null));};exports['destroy']=function(_0x4a8fa4,_0xeb8e08){return db[_0xa5c0('0x2c')][_0xa5c0('0x45')]({'where':{'id':_0x4a8fa4[_0xa5c0('0x43')]['id']}})[_0xa5c0('0x26')](handleEntityNotFound(_0xeb8e08,null))[_0xa5c0('0x26')](removeEntity(_0xeb8e08,null))[_0xa5c0('0x42')](handleError(_0xeb8e08,null));};exports[_0xa5c0('0x56')]=function(_0x252b69,_0x1268d1,_0x341277){var _0x1c5925={'raw':!![],'where':{}};var _0x214a2b={};var _0x45c690={'count':0x0,'rows':[]};return db[_0xa5c0('0x2c')][_0xa5c0('0x57')]({'where':{'id':_0x252b69[_0xa5c0('0x43')]['id']}})[_0xa5c0('0x26')](handleEntityNotFound(_0x1268d1,null))[_0xa5c0('0x26')](function(_0x323bf6){if(_0x323bf6){_0x214a2b[_0xa5c0('0x32')]=_[_0xa5c0('0x30')](db[_0xa5c0('0x58')][_0xa5c0('0x2d')]);_0x214a2b[_0xa5c0('0x2f')]=_[_0xa5c0('0x30')](_0x252b69['query']);_0x214a2b[_0xa5c0('0x31')]=_[_0xa5c0('0x34')](_0x214a2b[_0xa5c0('0x32')],_0x214a2b[_0xa5c0('0x2f')]);_0x1c5925[_0xa5c0('0x33')]=_[_0xa5c0('0x34')](_0x214a2b['model'],qs['fields'](_0x252b69[_0xa5c0('0x2f')]['fields']));_0x1c5925[_0xa5c0('0x33')]=_0x1c5925['attributes'][_0xa5c0('0x44')]?_0x1c5925['attributes']:_0x214a2b[_0xa5c0('0x32')];if(!_0x252b69['query']['hasOwnProperty'](_0xa5c0('0x59'))){_0x1c5925['limit']=qs[_0xa5c0('0x20')](_0x252b69[_0xa5c0('0x2f')][_0xa5c0('0x20')]);_0x1c5925[_0xa5c0('0x1e')]=qs[_0xa5c0('0x1e')](_0x252b69[_0xa5c0('0x2f')][_0xa5c0('0x1e')]);}_0x1c5925[_0xa5c0('0x36')]=qs[_0xa5c0('0x37')](_0x252b69['query'][_0xa5c0('0x37')]);_0x1c5925['where']=qs['filters'](_[_0xa5c0('0x39')](_0x252b69[_0xa5c0('0x2f')],_0x214a2b[_0xa5c0('0x31')]));_0x1c5925[_0xa5c0('0x38')][_0xa5c0('0x5a')]=_0x323bf6['id'];if(_0x252b69['query'][_0xa5c0('0x3a')]){_0x1c5925['where']=_[_0xa5c0('0x3b')](_0x1c5925['where'],{'$or':_['map'](_0x1c5925[_0xa5c0('0x33')],function(_0x30d4f8){var _0x215688={};_0x215688[_0x30d4f8]={'$like':'%'+_0x252b69['query']['filter']+'%'};return _0x215688;})});}_0x1c5925=_[_0xa5c0('0x3b')]({},_0x1c5925,_0x252b69[_0xa5c0('0x3e')]);return db[_0xa5c0('0x58')]['count']({'where':_0x1c5925['where']})[_0xa5c0('0x26')](function(_0x573c26){_0x45c690[_0xa5c0('0x21')]=_0x573c26;if(_0x252b69[_0xa5c0('0x2f')][_0xa5c0('0x4e')]){_0x1c5925['include']=[{'all':!![]}];}return db[_0xa5c0('0x58')][_0xa5c0('0x40')](_0x1c5925);})['then'](function(_0x25e42e){_0x45c690['rows']=_0x25e42e;return _0x45c690;});}})['then'](respondWithFilteredResult(_0x1268d1,_0x1c5925))[_0xa5c0('0x42')](handleError(_0x1268d1,null));};exports[_0xa5c0('0x5b')]=function(_0x25db54,_0x7dfd45,_0x176581){var _0x5d0115={'raw':!![],'where':{}};var _0x224a4d={};var _0x336304={'count':0x0,'rows':[]};return db['Campaign'][_0xa5c0('0x57')]({'where':{'id':_0x25db54[_0xa5c0('0x43')]['id']}})[_0xa5c0('0x26')](handleEntityNotFound(_0x7dfd45,null))['then'](function(_0x1d5732){if(_0x1d5732){_0x224a4d[_0xa5c0('0x32')]=_[_0xa5c0('0x30')](db[_0xa5c0('0x5c')][_0xa5c0('0x2d')]);_0x224a4d[_0xa5c0('0x2f')]=_[_0xa5c0('0x30')](_0x25db54['query']);_0x224a4d[_0xa5c0('0x31')]=_[_0xa5c0('0x34')](_0x224a4d['model'],_0x224a4d[_0xa5c0('0x2f')]);_0x5d0115[_0xa5c0('0x33')]=_[_0xa5c0('0x34')](_0x224a4d[_0xa5c0('0x32')],qs['fields'](_0x25db54[_0xa5c0('0x2f')]['fields']));_0x5d0115[_0xa5c0('0x33')]=_0x5d0115[_0xa5c0('0x33')]['length']?_0x5d0115[_0xa5c0('0x33')]:_0x224a4d['model'];if(!_0x25db54[_0xa5c0('0x2f')][_0xa5c0('0x5d')]('nolimit')){_0x5d0115['limit']=qs['limit'](_0x25db54[_0xa5c0('0x2f')][_0xa5c0('0x20')]);_0x5d0115[_0xa5c0('0x1e')]=qs[_0xa5c0('0x1e')](_0x25db54['query']['offset']);}_0x5d0115[_0xa5c0('0x36')]=qs['sort'](_0x25db54[_0xa5c0('0x2f')][_0xa5c0('0x37')]);_0x5d0115[_0xa5c0('0x38')]=qs[_0xa5c0('0x31')](_[_0xa5c0('0x39')](_0x25db54['query'],_0x224a4d[_0xa5c0('0x31')]));_0x5d0115['where'][_0xa5c0('0x5a')]=_0x1d5732['id'];if(_0x25db54['query'][_0xa5c0('0x3a')]){_0x5d0115[_0xa5c0('0x38')]=_['merge'](_0x5d0115[_0xa5c0('0x38')],{'$or':_[_0xa5c0('0x3c')](_0x5d0115['attributes'],function(_0x861eed){var _0x349ecb={};_0x349ecb[_0x861eed]={'$like':'%'+_0x25db54['query']['filter']+'%'};return _0x349ecb;})});}_0x5d0115=_[_0xa5c0('0x3b')]({},_0x5d0115,_0x25db54['options']);return db[_0xa5c0('0x5c')]['count']({'where':_0x5d0115['where']})[_0xa5c0('0x26')](function(_0x2a37a4){_0x336304[_0xa5c0('0x21')]=_0x2a37a4;if(_0x25db54[_0xa5c0('0x2f')][_0xa5c0('0x4e')]){_0x5d0115[_0xa5c0('0x3f')]=[{'all':!![]}];}return db[_0xa5c0('0x5c')][_0xa5c0('0x40')](_0x5d0115);})[_0xa5c0('0x26')](function(_0xf38897){_0x336304['rows']=_0xf38897;return _0x336304;});}})['then'](respondWithFilteredResult(_0x7dfd45,_0x5d0115))[_0xa5c0('0x42')](handleError(_0x7dfd45,null));};exports[_0xa5c0('0x5e')]=function(_0x21b885,_0x43621b,_0x483e0a){var _0x2b959c={'raw':!![],'where':{}};var _0x5e994c={};var _0x2cd0b7={'count':0x0,'rows':[]};return db[_0xa5c0('0x2c')]['findOne']({'where':{'id':_0x21b885['params']['id']}})[_0xa5c0('0x26')](handleEntityNotFound(_0x43621b,null))[_0xa5c0('0x26')](function(_0x479708){if(_0x479708){_0x5e994c[_0xa5c0('0x32')]=_['keys'](db[_0xa5c0('0x5f')]['rawAttributes']);_0x5e994c['query']=_[_0xa5c0('0x30')](_0x21b885[_0xa5c0('0x2f')]);_0x5e994c[_0xa5c0('0x31')]=_[_0xa5c0('0x34')](_0x5e994c['model'],_0x5e994c['query']);_0x2b959c[_0xa5c0('0x33')]=_[_0xa5c0('0x34')](_0x5e994c[_0xa5c0('0x32')],qs[_0xa5c0('0x35')](_0x21b885[_0xa5c0('0x2f')][_0xa5c0('0x35')]));_0x2b959c[_0xa5c0('0x33')]=_0x2b959c[_0xa5c0('0x33')][_0xa5c0('0x44')]?_0x2b959c[_0xa5c0('0x33')]:_0x5e994c[_0xa5c0('0x32')];if(!_0x21b885[_0xa5c0('0x2f')][_0xa5c0('0x5d')](_0xa5c0('0x59'))){_0x2b959c[_0xa5c0('0x20')]=qs['limit'](_0x21b885['query'][_0xa5c0('0x20')]);_0x2b959c[_0xa5c0('0x1e')]=qs[_0xa5c0('0x1e')](_0x21b885[_0xa5c0('0x2f')][_0xa5c0('0x1e')]);}_0x2b959c[_0xa5c0('0x36')]=qs['sort'](_0x21b885[_0xa5c0('0x2f')][_0xa5c0('0x37')]);_0x2b959c[_0xa5c0('0x38')]=qs['filters'](_[_0xa5c0('0x39')](_0x21b885[_0xa5c0('0x2f')],_0x5e994c[_0xa5c0('0x31')]));_0x2b959c['where'][_0xa5c0('0x5a')]=_0x479708['id'];if(_0x21b885[_0xa5c0('0x2f')]['filter']){_0x2b959c[_0xa5c0('0x38')]=_['merge'](_0x2b959c[_0xa5c0('0x38')],{'$or':_[_0xa5c0('0x3c')](_0x2b959c[_0xa5c0('0x33')],function(_0x571b62){var _0x337836={};_0x337836[_0x571b62]={'$like':'%'+_0x21b885['query']['filter']+'%'};return _0x337836;})});}_0x2b959c=_[_0xa5c0('0x3b')]({},_0x2b959c,_0x21b885[_0xa5c0('0x3e')]);return db[_0xa5c0('0x5f')][_0xa5c0('0x21')]({'where':_0x2b959c[_0xa5c0('0x38')]})[_0xa5c0('0x26')](function(_0x11fe92){_0x2cd0b7[_0xa5c0('0x21')]=_0x11fe92;if(_0x21b885[_0xa5c0('0x2f')][_0xa5c0('0x4e')]){_0x2b959c[_0xa5c0('0x3f')]=[{'all':!![]}];}return db[_0xa5c0('0x5f')]['findAll'](_0x2b959c);})[_0xa5c0('0x26')](function(_0xdb61cb){_0x2cd0b7[_0xa5c0('0x41')]=_0xdb61cb;return _0x2cd0b7;});}})['then'](respondWithFilteredResult(_0x43621b,_0x2b959c))[_0xa5c0('0x42')](handleError(_0x43621b,null));};exports[_0xa5c0('0x60')]=function(_0x423679,_0x346c5d,_0x524e87){var _0xc5bd23={'raw':!![],'where':{}};var _0xfee8e9={};var _0x13ace0={'count':0x0,'rows':[]};return db[_0xa5c0('0x2c')][_0xa5c0('0x57')]({'where':{'id':_0x423679[_0xa5c0('0x43')]['id']}})[_0xa5c0('0x26')](handleEntityNotFound(_0x346c5d,null))[_0xa5c0('0x26')](function(_0x52cc67){if(_0x52cc67){_0xfee8e9['model']=_[_0xa5c0('0x30')](db['CmHopperBlack'][_0xa5c0('0x2d')]);_0xfee8e9[_0xa5c0('0x2f')]=_[_0xa5c0('0x30')](_0x423679[_0xa5c0('0x2f')]);_0xfee8e9['filters']=_[_0xa5c0('0x34')](_0xfee8e9['model'],_0xfee8e9['query']);_0xc5bd23['attributes']=_[_0xa5c0('0x34')](_0xfee8e9['model'],qs[_0xa5c0('0x35')](_0x423679[_0xa5c0('0x2f')][_0xa5c0('0x35')]));_0xc5bd23['attributes']=_0xc5bd23['attributes'][_0xa5c0('0x44')]?_0xc5bd23['attributes']:_0xfee8e9[_0xa5c0('0x32')];if(!_0x423679[_0xa5c0('0x2f')]['hasOwnProperty'](_0xa5c0('0x59'))){_0xc5bd23['limit']=qs[_0xa5c0('0x20')](_0x423679['query'][_0xa5c0('0x20')]);_0xc5bd23['offset']=qs[_0xa5c0('0x1e')](_0x423679['query'][_0xa5c0('0x1e')]);}_0xc5bd23[_0xa5c0('0x36')]=qs[_0xa5c0('0x37')](_0x423679['query'][_0xa5c0('0x37')]);_0xc5bd23[_0xa5c0('0x38')]=qs[_0xa5c0('0x31')](_[_0xa5c0('0x39')](_0x423679['query'],_0xfee8e9[_0xa5c0('0x31')]));_0xc5bd23[_0xa5c0('0x38')][_0xa5c0('0x5a')]=_0x52cc67['id'];if(_0x423679[_0xa5c0('0x2f')][_0xa5c0('0x3a')]){_0xc5bd23[_0xa5c0('0x38')]=_[_0xa5c0('0x3b')](_0xc5bd23['where'],{'$or':_[_0xa5c0('0x3c')](_0xc5bd23['attributes'],function(_0x9b9470){var _0x33f9bc={};_0x33f9bc[_0x9b9470]={'$like':'%'+_0x423679[_0xa5c0('0x2f')][_0xa5c0('0x3a')]+'%'};return _0x33f9bc;})});}_0xc5bd23=_[_0xa5c0('0x3b')]({},_0xc5bd23,_0x423679[_0xa5c0('0x3e')]);return db[_0xa5c0('0x61')][_0xa5c0('0x21')]({'where':_0xc5bd23[_0xa5c0('0x38')]})[_0xa5c0('0x26')](function(_0x17a639){_0x13ace0['count']=_0x17a639;if(_0x423679[_0xa5c0('0x2f')][_0xa5c0('0x4e')]){_0xc5bd23[_0xa5c0('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xa5c0('0x40')](_0xc5bd23);})[_0xa5c0('0x26')](function(_0x2bcbec){_0x13ace0[_0xa5c0('0x41')]=_0x2bcbec;return _0x13ace0;});}})[_0xa5c0('0x26')](respondWithFilteredResult(_0x346c5d,_0xc5bd23))[_0xa5c0('0x42')](handleError(_0x346c5d,null));};exports['getLists']=function(_0x1626e5,_0x217867,_0x3a07cf){var _0x47f381={};var _0x13fd7e={};var _0x50cf18;var _0x248bc1;return db[_0xa5c0('0x2c')][_0xa5c0('0x57')]({'where':{'id':_0x1626e5[_0xa5c0('0x43')]['id']}})[_0xa5c0('0x26')](handleEntityNotFound(_0x217867,null))['then'](function(_0x305a2a){if(_0x305a2a){_0x50cf18=_0x305a2a;_0x13fd7e[_0xa5c0('0x32')]=_[_0xa5c0('0x30')](db['CmList'][_0xa5c0('0x2d')]);_0x13fd7e[_0xa5c0('0x2f')]=_[_0xa5c0('0x30')](_0x1626e5[_0xa5c0('0x2f')]);_0x13fd7e[_0xa5c0('0x31')]=_[_0xa5c0('0x34')](_0x13fd7e[_0xa5c0('0x32')],_0x13fd7e[_0xa5c0('0x2f')]);_0x47f381['attributes']=_['intersection'](_0x13fd7e[_0xa5c0('0x32')],qs[_0xa5c0('0x35')](_0x1626e5[_0xa5c0('0x2f')][_0xa5c0('0x35')]));_0x47f381[_0xa5c0('0x33')]=_0x47f381[_0xa5c0('0x33')]['length']?_0x47f381[_0xa5c0('0x33')]:_0x13fd7e['model'];_0x47f381[_0xa5c0('0x36')]=qs[_0xa5c0('0x37')](_0x1626e5['query'][_0xa5c0('0x37')]);_0x47f381[_0xa5c0('0x38')]=qs[_0xa5c0('0x31')](_[_0xa5c0('0x39')](_0x1626e5[_0xa5c0('0x2f')],_0x13fd7e[_0xa5c0('0x31')]));if(_0x1626e5[_0xa5c0('0x2f')][_0xa5c0('0x3a')]){_0x47f381[_0xa5c0('0x38')]=_['merge'](_0x47f381[_0xa5c0('0x38')],{'$or':_[_0xa5c0('0x3c')](_0x47f381[_0xa5c0('0x33')],function(_0x43dbbb){var _0x11f65f={};_0x11f65f[_0x43dbbb]={'$like':'%'+_0x1626e5[_0xa5c0('0x2f')][_0xa5c0('0x3a')]+'%'};return _0x11f65f;})});}_0x47f381=_['merge']({},_0x47f381,_0x1626e5[_0xa5c0('0x3e')]);return _0x50cf18[_0xa5c0('0x62')](_0x47f381);}})[_0xa5c0('0x26')](function(_0x1a69ad){if(_0x1a69ad){_0x248bc1=_0x1a69ad[_0xa5c0('0x44')];if(!_0x1626e5['query'][_0xa5c0('0x5d')]('nolimit')){_0x47f381[_0xa5c0('0x20')]=qs[_0xa5c0('0x20')](_0x1626e5['query'][_0xa5c0('0x20')]);_0x47f381[_0xa5c0('0x1e')]=qs[_0xa5c0('0x1e')](_0x1626e5['query'][_0xa5c0('0x1e')]);}return _0x50cf18[_0xa5c0('0x62')](_0x47f381);}})[_0xa5c0('0x26')](function(_0x314dc1){if(_0x314dc1){return _0x314dc1?{'count':_0x248bc1,'rows':_0x314dc1}:null;}})[_0xa5c0('0x26')](respondWithResult(_0x217867,null))[_0xa5c0('0x42')](handleError(_0x217867,null));};exports[_0xa5c0('0x63')]=function(_0x1ee24e,_0x37c18d,_0x59765a){var _0x334435,_0x1350e1;return db[_0xa5c0('0x2c')][_0xa5c0('0x45')]({'where':{'id':_0x1ee24e[_0xa5c0('0x43')]['id']}})[_0xa5c0('0x26')](handleEntityNotFound(_0x37c18d,null))[_0xa5c0('0x26')](function(_0x3bd82f){if(_0x3bd82f){_0x1350e1=_0x3bd82f;return _0x3bd82f['addLists'](_0x1ee24e[_0xa5c0('0x51')][_0xa5c0('0x64')],_[_0xa5c0('0x50')](_0x1ee24e['body'],['ids','id'])||{});}return null;})[_0xa5c0('0x65')](function(_0x31fe1d){var _0x285b66;_0x334435=_0x31fe1d||[];var _0x5e1188=[];if(_0x31fe1d){for(var _0x1f91e0=0x0;_0x1f91e0<_0x31fe1d[_0xa5c0('0x44')];_0x1f91e0+=0x1){var _0x3c6bae=_0x31fe1d[_0x1f91e0][_0xa5c0('0x48')]({'plain':!![]});_0x1350e1[_0xa5c0('0x66')]=_0x1ee24e[_0xa5c0('0x51')]['dialCheckDuplicateType']?_0x1ee24e[_0xa5c0('0x51')][_0xa5c0('0x66')]:_0x1350e1[_0xa5c0('0x66')];switch(_0x1350e1[_0xa5c0('0x66')]){case'always':_0x285b66=squel[_0xa5c0('0x67')]()[_0xa5c0('0x68')]('cm_hopper')[_0xa5c0('0x69')](['phone','scheduledAt','ContactId',_0xa5c0('0x6a'),_0xa5c0('0x5a'),'createdAt',_0xa5c0('0x52')],squel[_0xa5c0('0x6b')]()[_0xa5c0('0x6c')](_0xa5c0('0x6d'),_0xa5c0('0x6d'))[_0xa5c0('0x6c')]('NOW()','scheduledAt')[_0xa5c0('0x6c')]('id','ContactId')[_0xa5c0('0x6c')](_0x3c6bae[_0xa5c0('0x6e')][_0xa5c0('0x6f')](),'ListId')[_0xa5c0('0x6c')](_0x1ee24e[_0xa5c0('0x43')]['id'][_0xa5c0('0x6f')](),_0xa5c0('0x5a'))[_0xa5c0('0x6c')](_0xa5c0('0x70'),_0xa5c0('0x4f'))[_0xa5c0('0x6c')](_0xa5c0('0x70'),'updatedAt')[_0xa5c0('0x71')](_0xa5c0('0x72'))[_0xa5c0('0x38')](_0xa5c0('0x73'))['where'](_0xa5c0('0x74'),_0x3c6bae[_0xa5c0('0x6e')][_0xa5c0('0x6f')]())[_0xa5c0('0x38')](_0xa5c0('0x75'))[_0xa5c0('0x38')](_0xa5c0('0x76'),squel[_0xa5c0('0x6b')]()[_0xa5c0('0x6c')](_0xa5c0('0x77'))[_0xa5c0('0x71')](_0xa5c0('0x78'))[_0xa5c0('0x38')](_0xa5c0('0x79'),_0x1ee24e[_0xa5c0('0x43')]['id']['toString']()))[_0xa5c0('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa5c0('0x6b')]()[_0xa5c0('0x6c')](_0xa5c0('0x7a'))['from'](_0xa5c0('0x7b'))[_0xa5c0('0x38')](_0xa5c0('0x79'),_0x1ee24e[_0xa5c0('0x43')]['id'][_0xa5c0('0x6f')]())))[_0xa5c0('0x6f')]();break;case _0xa5c0('0x7c'):_0x285b66=squel[_0xa5c0('0x67')]()[_0xa5c0('0x68')](_0xa5c0('0x7b'))['fromQuery']([_0xa5c0('0x6d'),_0xa5c0('0x7d'),'ContactId','ListId',_0xa5c0('0x5a'),_0xa5c0('0x4f'),_0xa5c0('0x52')],squel[_0xa5c0('0x6b')]()['field'](_0xa5c0('0x6d'),_0xa5c0('0x6d'))[_0xa5c0('0x6c')](_0xa5c0('0x70'),_0xa5c0('0x7d'))['field']('id',_0xa5c0('0x7e'))[_0xa5c0('0x6c')](_0x3c6bae[_0xa5c0('0x6e')]['toString'](),_0xa5c0('0x6a'))[_0xa5c0('0x6c')](_0x1ee24e[_0xa5c0('0x43')]['id']['toString'](),_0xa5c0('0x5a'))[_0xa5c0('0x6c')](_0xa5c0('0x70'),_0xa5c0('0x4f'))[_0xa5c0('0x6c')]('NOW()',_0xa5c0('0x52'))[_0xa5c0('0x71')](_0xa5c0('0x72'))[_0xa5c0('0x38')](_0xa5c0('0x73'))[_0xa5c0('0x38')](_0xa5c0('0x74'),_0x3c6bae['CmListId'][_0xa5c0('0x6f')]())[_0xa5c0('0x38')](_0xa5c0('0x75'))['where'](_0xa5c0('0x76'),squel['select']()[_0xa5c0('0x6c')](_0xa5c0('0x7a'))['from'](_0xa5c0('0x7b'))[_0xa5c0('0x38')](_0xa5c0('0x79'),_0x1ee24e['params']['id'][_0xa5c0('0x6f')]())))[_0xa5c0('0x6f')]();break;default:_0x285b66=squel[_0xa5c0('0x67')]()['into'](_0xa5c0('0x7b'))[_0xa5c0('0x69')]([_0xa5c0('0x6d'),_0xa5c0('0x7d'),_0xa5c0('0x7e'),_0xa5c0('0x6a'),_0xa5c0('0x5a'),'createdAt',_0xa5c0('0x52')],squel[_0xa5c0('0x6b')]()[_0xa5c0('0x6c')](_0xa5c0('0x6d'),'phone')['field'](_0xa5c0('0x70'),_0xa5c0('0x7d'))['field']('id',_0xa5c0('0x7e'))[_0xa5c0('0x6c')](_0x3c6bae['CmListId'][_0xa5c0('0x6f')](),_0xa5c0('0x6a'))[_0xa5c0('0x6c')](_0x1ee24e[_0xa5c0('0x43')]['id']['toString'](),_0xa5c0('0x5a'))[_0xa5c0('0x6c')](_0xa5c0('0x70'),_0xa5c0('0x4f'))[_0xa5c0('0x6c')](_0xa5c0('0x70'),_0xa5c0('0x52'))[_0xa5c0('0x71')](_0xa5c0('0x72'))[_0xa5c0('0x38')](_0xa5c0('0x73'))[_0xa5c0('0x38')](_0xa5c0('0x74'),_0x3c6bae[_0xa5c0('0x6e')][_0xa5c0('0x6f')]())['where'](_0xa5c0('0x75')))[_0xa5c0('0x6f')]();}_0x5e1188[_0xa5c0('0x7f')](db[_0xa5c0('0x80')][_0xa5c0('0x2f')](_0x285b66));}return BPromise[_0xa5c0('0x81')](_0x5e1188);}})[_0xa5c0('0x26')](function(){return _0x334435;})['then'](respondWithResult(_0x37c18d,null))[_0xa5c0('0x42')](handleError(_0x37c18d,null));};exports['removeLists']=function(_0xf8756d,_0x26ae48,_0x778cc6){return db[_0xa5c0('0x2c')][_0xa5c0('0x45')]({'where':{'id':_0xf8756d[_0xa5c0('0x43')]['id']}})['then'](handleEntityNotFound(_0x26ae48,null))['then'](function(_0x217e7d){if(_0x217e7d){return _0x217e7d[_0xa5c0('0x82')](_0xf8756d[_0xa5c0('0x2f')]['ids']);}})[_0xa5c0('0x26')](function(_0x36cb11){if(_0x36cb11){return db['CmHopper'][_0xa5c0('0x27')]({'where':{'ListId':_0xf8756d[_0xa5c0('0x2f')][_0xa5c0('0x64')],'CampaignId':_0xf8756d['params']['id']}})[_0xa5c0('0x26')](function(){return _0x36cb11;});}})['then'](respondWithStatusCode(_0x26ae48,null))['catch'](handleError(_0x26ae48,null));};exports[_0xa5c0('0x83')]=function(_0x225a9e,_0x470b37,_0x203129){var _0x428498={};var _0x2ee426={};var _0x4541b3;var _0x12eb4d;return db[_0xa5c0('0x2c')][_0xa5c0('0x57')]({'where':{'id':_0x225a9e[_0xa5c0('0x43')]['id']}})[_0xa5c0('0x26')](handleEntityNotFound(_0x470b37,null))[_0xa5c0('0x26')](function(_0xf8e741){if(_0xf8e741){_0x4541b3=_0xf8e741;_0x2ee426[_0xa5c0('0x32')]=_[_0xa5c0('0x30')](db[_0xa5c0('0x84')]['rawAttributes']);_0x2ee426[_0xa5c0('0x2f')]=_[_0xa5c0('0x30')](_0x225a9e[_0xa5c0('0x2f')]);_0x2ee426[_0xa5c0('0x31')]=_[_0xa5c0('0x34')](_0x2ee426[_0xa5c0('0x32')],_0x2ee426[_0xa5c0('0x2f')]);_0x428498[_0xa5c0('0x33')]=_[_0xa5c0('0x34')](_0x2ee426[_0xa5c0('0x32')],qs[_0xa5c0('0x35')](_0x225a9e[_0xa5c0('0x2f')][_0xa5c0('0x35')]));_0x428498[_0xa5c0('0x33')]=_0x428498[_0xa5c0('0x33')][_0xa5c0('0x44')]?_0x428498[_0xa5c0('0x33')]:_0x2ee426[_0xa5c0('0x32')];_0x428498[_0xa5c0('0x36')]=qs[_0xa5c0('0x37')](_0x225a9e['query']['sort']);_0x428498[_0xa5c0('0x38')]=qs[_0xa5c0('0x31')](_['pick'](_0x225a9e[_0xa5c0('0x2f')],_0x2ee426[_0xa5c0('0x31')]));if(_0x225a9e[_0xa5c0('0x2f')]['filter']){_0x428498[_0xa5c0('0x38')]=_[_0xa5c0('0x3b')](_0x428498[_0xa5c0('0x38')],{'$or':_[_0xa5c0('0x3c')](_0x428498[_0xa5c0('0x33')],function(_0x421aed){var _0x964088={};_0x964088[_0x421aed]={'$like':'%'+_0x225a9e[_0xa5c0('0x2f')][_0xa5c0('0x3a')]+'%'};return _0x964088;})});}_0x428498=_[_0xa5c0('0x3b')]({},_0x428498,_0x225a9e[_0xa5c0('0x3e')]);return _0x4541b3['getBlackLists'](_0x428498);}})[_0xa5c0('0x26')](function(_0x274830){if(_0x274830){_0x12eb4d=_0x274830['length'];if(!_0x225a9e[_0xa5c0('0x2f')][_0xa5c0('0x5d')](_0xa5c0('0x59'))){_0x428498[_0xa5c0('0x20')]=qs['limit'](_0x225a9e[_0xa5c0('0x2f')][_0xa5c0('0x20')]);_0x428498['offset']=qs[_0xa5c0('0x1e')](_0x225a9e['query'][_0xa5c0('0x1e')]);}return _0x4541b3[_0xa5c0('0x83')](_0x428498);}})[_0xa5c0('0x26')](function(_0x447699){if(_0x447699){return _0x447699?{'count':_0x12eb4d,'rows':_0x447699}:null;}})[_0xa5c0('0x26')](respondWithResult(_0x470b37,null))[_0xa5c0('0x42')](handleError(_0x470b37,null));};exports[_0xa5c0('0x85')]=function(_0x42439c,_0x4712ba,_0x236da9){var _0x53ce2b,_0x4e8a89;return db['Campaign'][_0xa5c0('0x45')]({'where':{'id':_0x42439c[_0xa5c0('0x43')]['id']}})[_0xa5c0('0x26')](handleEntityNotFound(_0x4712ba,null))[_0xa5c0('0x26')](function(_0x27f6d6){if(_0x27f6d6){_0x4e8a89=_0x27f6d6;return _0x27f6d6[_0xa5c0('0x85')](_0x42439c[_0xa5c0('0x51')][_0xa5c0('0x64')],_[_0xa5c0('0x50')](_0x42439c['body'],['ids','id'])||{});}return null;})[_0xa5c0('0x65')](function(_0x2a3769){var _0x15a694;_0x53ce2b=_0x2a3769||[];var _0x14f0a1=[];if(_0x2a3769){for(var _0x22b14d=0x0;_0x22b14d<_0x2a3769['length'];_0x22b14d+=0x1){var _0x296253=_0x2a3769[_0x22b14d][_0xa5c0('0x48')]({'plain':!![]});_0x15a694=squel['insert']()[_0xa5c0('0x68')]('cm_hopper_black')[_0xa5c0('0x69')]([_0xa5c0('0x6d'),_0xa5c0('0x7e'),_0xa5c0('0x6a'),'CampaignId',_0xa5c0('0x4f'),_0xa5c0('0x52')],squel[_0xa5c0('0x6b')]()[_0xa5c0('0x6c')]('phone',_0xa5c0('0x6d'))[_0xa5c0('0x6c')]('id',_0xa5c0('0x7e'))['field'](_0x296253[_0xa5c0('0x6e')][_0xa5c0('0x6f')](),_0xa5c0('0x6a'))[_0xa5c0('0x6c')](_0x42439c[_0xa5c0('0x43')]['id'][_0xa5c0('0x6f')](),'CampaignId')[_0xa5c0('0x6c')](_0xa5c0('0x70'),_0xa5c0('0x4f'))[_0xa5c0('0x6c')](_0xa5c0('0x70'),_0xa5c0('0x52'))[_0xa5c0('0x71')](_0xa5c0('0x72'))[_0xa5c0('0x38')](_0xa5c0('0x73'))[_0xa5c0('0x38')](_0xa5c0('0x74'),_0x296253[_0xa5c0('0x6e')][_0xa5c0('0x6f')]())[_0xa5c0('0x38')](_0xa5c0('0x75')))[_0xa5c0('0x6f')]();_0x14f0a1['push'](db[_0xa5c0('0x80')][_0xa5c0('0x2f')](_0x15a694));}return BPromise[_0xa5c0('0x81')](_0x14f0a1);}})['then'](function(){return _0x53ce2b;})[_0xa5c0('0x26')](respondWithResult(_0x4712ba,null))[_0xa5c0('0x42')](handleError(_0x4712ba,null));};exports[_0xa5c0('0x86')]=function(_0x4f5d2b,_0x4a5720,_0x18710d){return db['Campaign'][_0xa5c0('0x45')]({'where':{'id':_0x4f5d2b[_0xa5c0('0x43')]['id']}})[_0xa5c0('0x26')](handleEntityNotFound(_0x4a5720,null))[_0xa5c0('0x26')](function(_0x236220){if(_0x236220){return _0x236220[_0xa5c0('0x86')](_0x4f5d2b[_0xa5c0('0x2f')][_0xa5c0('0x64')]);}})[_0xa5c0('0x26')](function(_0x119509){if(_0x119509){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x4f5d2b[_0xa5c0('0x2f')]['ids'],'CampaignId':_0x4f5d2b[_0xa5c0('0x43')]['id']}})['then'](function(){return _0x119509;});}})[_0xa5c0('0x26')](respondWithStatusCode(_0x4a5720,null))[_0xa5c0('0x42')](handleError(_0x4a5720,null));}; \ No newline at end of file +var _0x1ab0=['rimraf','zip-dir','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','find','create','body','user','UserProfileSection','userProfileId','clone','updatedAt','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CampaignId','CmHopper','rows','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','cm_hopper','fromQuery','scheduledAt','ContactId','field','NOW()','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','into','phone','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists'];(function(_0x1effba,_0x587d9e){var _0x28d3f2=function(_0x3b43b8){while(--_0x3b43b8){_0x1effba['push'](_0x1effba['shift']());}};_0x28d3f2(++_0x587d9e);}(_0x1ab0,0x17a));var _0x01ab=function(_0x3f8afd,_0x3c9bf){_0x3f8afd=_0x3f8afd-0x0;var _0x28a3e7=_0x1ab0[_0x3f8afd];return _0x28a3e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01ab('0x0'));var zipdir=require(_0x01ab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x01ab('0x2'));var Mustache=require('mustache');var util=require(_0x01ab('0x3'));var path=require('path');var sox=require(_0x01ab('0x4'));var csv=require(_0x01ab('0x5'));var ejs=require(_0x01ab('0x6'));var fs=require('fs');var fs_extra=require(_0x01ab('0x7'));var _=require(_0x01ab('0x8'));var squel=require(_0x01ab('0x9'));var crypto=require(_0x01ab('0xa'));var jsforce=require(_0x01ab('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x01ab('0x5'));var querystring=require(_0x01ab('0xc'));var Papa=require('papaparse');var Redis=require(_0x01ab('0xd'));var authService=require(_0x01ab('0xe'));var qs=require(_0x01ab('0xf'));var as=require(_0x01ab('0x10'));var hardwareService=require(_0x01ab('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x01ab('0x12'));var config=require(_0x01ab('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x01ab('0x14'))['db'];function respondWithStatusCode(_0x19d19e,_0x31e99f){_0x31e99f=_0x31e99f||0xcc;return function(_0x5d1c29){if(_0x5d1c29){return _0x19d19e['sendStatus'](_0x31e99f);}return _0x19d19e[_0x01ab('0x15')](_0x31e99f)[_0x01ab('0x16')]();};}function respondWithResult(_0x1d8eb0,_0x2800aa){_0x2800aa=_0x2800aa||0xc8;return function(_0x5f148f){if(_0x5f148f){return _0x1d8eb0[_0x01ab('0x15')](_0x2800aa)[_0x01ab('0x17')](_0x5f148f);}};}function respondWithFilteredResult(_0x22898f,_0x206f6e){return function(_0x99255f){if(_0x99255f){var _0x52b9e3=typeof _0x206f6e['offset']===_0x01ab('0x18')&&typeof _0x206f6e[_0x01ab('0x19')]==='undefined';var _0x45e01c=_0x99255f[_0x01ab('0x1a')];var _0x47f375=_0x52b9e3?0x0:_0x206f6e[_0x01ab('0x1b')];var _0x1d6e5d=_0x52b9e3?_0x99255f[_0x01ab('0x1a')]:_0x206f6e['offset']+_0x206f6e[_0x01ab('0x19')];var _0x58fe85;if(_0x1d6e5d>=_0x45e01c){_0x1d6e5d=_0x45e01c;_0x58fe85=0xc8;}else{_0x58fe85=0xce;}_0x22898f[_0x01ab('0x15')](_0x58fe85);return _0x22898f[_0x01ab('0x1c')]('Content-Range',_0x47f375+'-'+_0x1d6e5d+'/'+_0x45e01c)[_0x01ab('0x17')](_0x99255f);}return null;};}function patchUpdates(_0x732b7d){return function(_0xc6ac28){try{jsonpatch['apply'](_0xc6ac28,_0x732b7d,!![]);}catch(_0x3a23ce){return BPromise['reject'](_0x3a23ce);}return _0xc6ac28['save']();};}function saveUpdates(_0x21811d,_0x5a05cc){return function(_0x165da6){if(_0x165da6){return _0x165da6['update'](_0x21811d)[_0x01ab('0x1d')](function(_0x644d8e){return _0x644d8e;});}return null;};}function removeEntity(_0xf68ede,_0x3e6000){return function(_0x4efdf9){if(_0x4efdf9){return _0x4efdf9[_0x01ab('0x1e')]()['then'](function(){var _0x308d9f=_0x4efdf9[_0x01ab('0x1f')]({'plain':!![]});var _0x3c25f0=_0x01ab('0x20');return db[_0x01ab('0x21')][_0x01ab('0x1e')]({'where':{'type':_0x3c25f0,'resourceId':_0x308d9f['id']}})['then'](function(){return _0x4efdf9;});})[_0x01ab('0x1d')](function(){_0xf68ede['status'](0xcc)[_0x01ab('0x16')]();});}};}function handleEntityNotFound(_0x2fd81c,_0x11dbda){return function(_0x4b26e6){if(!_0x4b26e6){_0x2fd81c[_0x01ab('0x22')](0x194);}return _0x4b26e6;};}function handleError(_0x288f91,_0x4fdc3e){_0x4fdc3e=_0x4fdc3e||0x1f4;return function(_0x12453b){logger[_0x01ab('0x23')](_0x12453b['stack']);if(_0x12453b[_0x01ab('0x24')]){delete _0x12453b['name'];}_0x288f91[_0x01ab('0x15')](_0x4fdc3e)[_0x01ab('0x25')](_0x12453b);};}exports[_0x01ab('0x26')]=function(_0x322f97,_0x41ba21){var _0x319fd3={},_0x3a4380={},_0x389cf4={'count':0x0,'rows':[]};var _0x4499d8=_['map'](db[_0x01ab('0x27')][_0x01ab('0x28')],function(_0x8fa91e){return{'name':_0x8fa91e[_0x01ab('0x29')],'type':_0x8fa91e[_0x01ab('0x2a')][_0x01ab('0x2b')]};});_0x3a4380[_0x01ab('0x2c')]=_['map'](_0x4499d8,_0x01ab('0x24'));_0x3a4380[_0x01ab('0x2d')]=_[_0x01ab('0x2e')](_0x322f97[_0x01ab('0x2d')]);_0x3a4380[_0x01ab('0x2f')]=_[_0x01ab('0x30')](_0x3a4380[_0x01ab('0x2c')],_0x3a4380['query']);_0x319fd3[_0x01ab('0x31')]=_[_0x01ab('0x30')](_0x3a4380[_0x01ab('0x2c')],qs[_0x01ab('0x32')](_0x322f97[_0x01ab('0x2d')][_0x01ab('0x32')]));_0x319fd3[_0x01ab('0x31')]=_0x319fd3[_0x01ab('0x31')][_0x01ab('0x33')]?_0x319fd3[_0x01ab('0x31')]:_0x3a4380[_0x01ab('0x2c')];if(!_0x322f97[_0x01ab('0x2d')][_0x01ab('0x34')](_0x01ab('0x35'))){_0x319fd3[_0x01ab('0x19')]=qs[_0x01ab('0x19')](_0x322f97['query'][_0x01ab('0x19')]);_0x319fd3[_0x01ab('0x1b')]=qs[_0x01ab('0x1b')](_0x322f97[_0x01ab('0x2d')][_0x01ab('0x1b')]);}_0x319fd3[_0x01ab('0x36')]=qs[_0x01ab('0x37')](_0x322f97[_0x01ab('0x2d')][_0x01ab('0x37')]);_0x319fd3[_0x01ab('0x38')]=qs[_0x01ab('0x2f')](_[_0x01ab('0x39')](_0x322f97['query'],_0x3a4380['filters']),_0x4499d8);if(_0x322f97['query']['filter']){_0x319fd3[_0x01ab('0x38')]=_[_0x01ab('0x3a')](_0x319fd3[_0x01ab('0x38')],{'$or':_[_0x01ab('0x3b')](_0x4499d8,function(_0x3d574f){if(_0x3d574f[_0x01ab('0x2a')]!==_0x01ab('0x3c')){var _0x1a303d={};_0x1a303d[_0x3d574f[_0x01ab('0x24')]]={'$like':'%'+_0x322f97[_0x01ab('0x2d')][_0x01ab('0x3d')]+'%'};return _0x1a303d;}})});}_0x319fd3=_[_0x01ab('0x3a')]({},_0x319fd3,_0x322f97[_0x01ab('0x3e')]);var _0x4f0ed4={'where':_0x319fd3[_0x01ab('0x38')]};return db[_0x01ab('0x27')][_0x01ab('0x1a')](_0x4f0ed4)[_0x01ab('0x1d')](function(_0x32ea50){_0x389cf4[_0x01ab('0x1a')]=_0x32ea50;if(_0x322f97['query'][_0x01ab('0x3f')]){_0x319fd3['include']=[{'all':!![]}];}return db[_0x01ab('0x27')][_0x01ab('0x40')](_0x319fd3);})[_0x01ab('0x1d')](function(_0x1a1972){_0x389cf4['rows']=_0x1a1972;return _0x389cf4;})['then'](respondWithFilteredResult(_0x41ba21,_0x319fd3))[_0x01ab('0x41')](handleError(_0x41ba21,null));};exports[_0x01ab('0x42')]=function(_0x315c9e,_0x42a072){var _0x45f66e={'raw':![],'where':{'id':_0x315c9e[_0x01ab('0x43')]['id']}},_0x3c0a4a={};_0x3c0a4a[_0x01ab('0x2c')]=_[_0x01ab('0x2e')](db[_0x01ab('0x27')][_0x01ab('0x28')]);_0x3c0a4a[_0x01ab('0x2d')]=_[_0x01ab('0x2e')](_0x315c9e[_0x01ab('0x2d')]);_0x3c0a4a[_0x01ab('0x2f')]=_[_0x01ab('0x30')](_0x3c0a4a[_0x01ab('0x2c')],_0x3c0a4a[_0x01ab('0x2d')]);_0x45f66e[_0x01ab('0x31')]=_['intersection'](_0x3c0a4a[_0x01ab('0x2c')],qs['fields'](_0x315c9e['query'][_0x01ab('0x32')]));_0x45f66e[_0x01ab('0x31')]=_0x45f66e[_0x01ab('0x31')][_0x01ab('0x33')]?_0x45f66e['attributes']:_0x3c0a4a['model'];if(_0x315c9e[_0x01ab('0x2d')][_0x01ab('0x3f')]){_0x45f66e[_0x01ab('0x44')]=[{'all':!![]}];}_0x45f66e=_[_0x01ab('0x3a')]({},_0x45f66e,_0x315c9e[_0x01ab('0x3e')]);return db['Campaign'][_0x01ab('0x45')](_0x45f66e)[_0x01ab('0x1d')](handleEntityNotFound(_0x42a072,null))[_0x01ab('0x1d')](respondWithResult(_0x42a072,null))[_0x01ab('0x41')](handleError(_0x42a072,null));};exports[_0x01ab('0x46')]=function(_0x50aa7b,_0x41b6fe){return db[_0x01ab('0x27')][_0x01ab('0x46')](_0x50aa7b[_0x01ab('0x47')],{})[_0x01ab('0x1d')](function(_0x309502){var _0x523681=_0x50aa7b['user'][_0x01ab('0x1f')]({'plain':!![]});if(!_0x523681)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x523681['role']===_0x01ab('0x48')){var _0x55b64a=_0x309502[_0x01ab('0x1f')]({'plain':!![]});var _0x94e498=_0x01ab('0x20');return db[_0x01ab('0x49')]['find']({'where':{'name':_0x94e498,'userProfileId':_0x523681[_0x01ab('0x4a')]},'raw':!![]})[_0x01ab('0x1d')](function(_0x331c2f){if(_0x331c2f&&_0x331c2f['autoAssociation']===0x0){return db['UserProfileResource'][_0x01ab('0x46')]({'name':_0x55b64a[_0x01ab('0x24')],'resourceId':_0x55b64a['id'],'type':_0x331c2f[_0x01ab('0x24')],'sectionId':_0x331c2f['id']},{})[_0x01ab('0x1d')](function(){return _0x309502;});}else{return _0x309502;}})[_0x01ab('0x41')](function(_0x5ebcf9){logger[_0x01ab('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ebcf9);throw _0x5ebcf9;});}return _0x309502;})[_0x01ab('0x1d')](respondWithResult(_0x41b6fe,0xc9))[_0x01ab('0x41')](handleError(_0x41b6fe,null));};exports[_0x01ab('0x4b')]=function(_0x3e5dc8,_0x4b301a){var _0x280e22={'where':{'id':_0x3e5dc8['params']['id']}},_0xb45cc={};_0xb45cc[_0x01ab('0x2c')]=_['keys'](db[_0x01ab('0x27')]['rawAttributes']);_0x280e22['attributes']=_[_0x01ab('0x30')](_0xb45cc['model'],qs[_0x01ab('0x32')](_0x3e5dc8[_0x01ab('0x2d')][_0x01ab('0x32')]));_0x280e22['attributes']=_0x280e22[_0x01ab('0x31')][_0x01ab('0x33')]?_0x280e22[_0x01ab('0x31')]:_0xb45cc['model'];if(_0x3e5dc8[_0x01ab('0x2d')]['includeAll']){_0x280e22['include']=[{'all':!![]}];}_0x280e22=_['merge']({},_0x280e22,_0x3e5dc8['options']);return db['Campaign'][_0x01ab('0x45')](_0x280e22)[_0x01ab('0x1d')](handleEntityNotFound(_0x4b301a,null))['then'](function(_0x478e65){if(_0x478e65){var _0x40a810=_0x478e65[_0x01ab('0x1f')]({'plain':!![]});_0x40a810=qs['omit'](_0x40a810,['id','createdAt',_0x01ab('0x4c')]);_0x3e5dc8[_0x01ab('0x47')]=_[_0x01ab('0x4d')](_0x3e5dc8['body'],['id',_0x01ab('0x4e'),_0x01ab('0x4c')]);return db[_0x01ab('0x27')][_0x01ab('0x46')](_['merge'](_0x40a810,_0x3e5dc8[_0x01ab('0x47')]),{'include':_0x3e5dc8[_0x01ab('0x2d')]['includeAll']?[{'all':!![]}]:undefined})[_0x01ab('0x1d')](function(_0x4a22a1){var _0x22fff0=_0x3e5dc8['user']['get']({'plain':!![]});if(!_0x22fff0)throw new Error(_0x01ab('0x4f'));if(_0x22fff0['role']===_0x01ab('0x48')){var _0x4ed0d7=_0x4a22a1['get']({'plain':!![]});var _0x3579bb=_0x01ab('0x20');return db[_0x01ab('0x49')]['find']({'where':{'name':_0x3579bb,'userProfileId':_0x22fff0['userProfileId']},'raw':!![]})[_0x01ab('0x1d')](function(_0x4f68c8){if(_0x4f68c8&&_0x4f68c8[_0x01ab('0x50')]===0x0){return db[_0x01ab('0x21')][_0x01ab('0x46')]({'name':_0x4ed0d7['name'],'resourceId':_0x4ed0d7['id'],'type':_0x4f68c8[_0x01ab('0x24')],'sectionId':_0x4f68c8['id']},{})[_0x01ab('0x1d')](function(){return _0x4a22a1;});}else{return _0x4a22a1;}})['catch'](function(_0x3ef21e){logger[_0x01ab('0x23')](_0x01ab('0x51'),_0x3ef21e);throw _0x3ef21e;});}return _0x4a22a1;});}})[_0x01ab('0x1d')](respondWithResult(_0x4b301a,0xc9))['catch'](handleError(_0x4b301a,null));};exports['update']=function(_0x20477e,_0x184892){if(_0x20477e['body']['id']){delete _0x20477e[_0x01ab('0x47')]['id'];}return db['Campaign'][_0x01ab('0x45')]({'where':{'id':_0x20477e[_0x01ab('0x43')]['id']}})[_0x01ab('0x1d')](handleEntityNotFound(_0x184892,null))[_0x01ab('0x1d')](saveUpdates(_0x20477e[_0x01ab('0x47')],null))[_0x01ab('0x1d')](respondWithResult(_0x184892,null))['catch'](handleError(_0x184892,null));};exports[_0x01ab('0x1e')]=function(_0x3001bc,_0x59010a){return db[_0x01ab('0x27')]['find']({'where':{'id':_0x3001bc[_0x01ab('0x43')]['id']}})['then'](handleEntityNotFound(_0x59010a,null))[_0x01ab('0x1d')](removeEntity(_0x59010a,null))[_0x01ab('0x41')](handleError(_0x59010a,null));};exports['getHoppers']=function(_0x3d8ae6,_0xf00c0f,_0x33e9b7){var _0x47dcff={'raw':!![],'where':{}};var _0x364099={};var _0x5516db={'count':0x0,'rows':[]};return db['Campaign'][_0x01ab('0x52')]({'where':{'id':_0x3d8ae6[_0x01ab('0x43')]['id']}})['then'](handleEntityNotFound(_0xf00c0f,null))[_0x01ab('0x1d')](function(_0x15431b){if(_0x15431b){_0x364099['model']=_['keys'](db['CmHopper'][_0x01ab('0x28')]);_0x364099[_0x01ab('0x2d')]=_[_0x01ab('0x2e')](_0x3d8ae6[_0x01ab('0x2d')]);_0x364099['filters']=_[_0x01ab('0x30')](_0x364099['model'],_0x364099[_0x01ab('0x2d')]);_0x47dcff[_0x01ab('0x31')]=_['intersection'](_0x364099[_0x01ab('0x2c')],qs[_0x01ab('0x32')](_0x3d8ae6[_0x01ab('0x2d')][_0x01ab('0x32')]));_0x47dcff[_0x01ab('0x31')]=_0x47dcff['attributes'][_0x01ab('0x33')]?_0x47dcff[_0x01ab('0x31')]:_0x364099['model'];if(!_0x3d8ae6['query'][_0x01ab('0x34')](_0x01ab('0x35'))){_0x47dcff[_0x01ab('0x19')]=qs[_0x01ab('0x19')](_0x3d8ae6['query'][_0x01ab('0x19')]);_0x47dcff['offset']=qs[_0x01ab('0x1b')](_0x3d8ae6[_0x01ab('0x2d')][_0x01ab('0x1b')]);}_0x47dcff[_0x01ab('0x36')]=qs['sort'](_0x3d8ae6['query'][_0x01ab('0x37')]);_0x47dcff[_0x01ab('0x38')]=qs[_0x01ab('0x2f')](_[_0x01ab('0x39')](_0x3d8ae6['query'],_0x364099[_0x01ab('0x2f')]));_0x47dcff[_0x01ab('0x38')][_0x01ab('0x53')]=_0x15431b['id'];if(_0x3d8ae6[_0x01ab('0x2d')][_0x01ab('0x3d')]){_0x47dcff[_0x01ab('0x38')]=_[_0x01ab('0x3a')](_0x47dcff['where'],{'$or':_[_0x01ab('0x3b')](_0x47dcff['attributes'],function(_0x196d32){var _0x36beb7={};_0x36beb7[_0x196d32]={'$like':'%'+_0x3d8ae6[_0x01ab('0x2d')][_0x01ab('0x3d')]+'%'};return _0x36beb7;})});}_0x47dcff=_[_0x01ab('0x3a')]({},_0x47dcff,_0x3d8ae6['options']);return db[_0x01ab('0x54')][_0x01ab('0x1a')]({'where':_0x47dcff[_0x01ab('0x38')]})['then'](function(_0x5298cf){_0x5516db[_0x01ab('0x1a')]=_0x5298cf;if(_0x3d8ae6[_0x01ab('0x2d')][_0x01ab('0x3f')]){_0x47dcff['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x47dcff);})[_0x01ab('0x1d')](function(_0x37c30d){_0x5516db[_0x01ab('0x55')]=_0x37c30d;return _0x5516db;});}})[_0x01ab('0x1d')](respondWithFilteredResult(_0xf00c0f,_0x47dcff))['catch'](handleError(_0xf00c0f,null));};exports['getHopperHistories']=function(_0x3d10cf,_0x242c32,_0x42348d){var _0x12f41e={'raw':!![],'where':{}};var _0x2301ed={};var _0x275df3={'count':0x0,'rows':[]};return db[_0x01ab('0x27')][_0x01ab('0x52')]({'where':{'id':_0x3d10cf[_0x01ab('0x43')]['id']}})['then'](handleEntityNotFound(_0x242c32,null))[_0x01ab('0x1d')](function(_0x107e14){if(_0x107e14){_0x2301ed[_0x01ab('0x2c')]=_[_0x01ab('0x2e')](db[_0x01ab('0x56')][_0x01ab('0x28')]);_0x2301ed[_0x01ab('0x2d')]=_[_0x01ab('0x2e')](_0x3d10cf[_0x01ab('0x2d')]);_0x2301ed[_0x01ab('0x2f')]=_[_0x01ab('0x30')](_0x2301ed[_0x01ab('0x2c')],_0x2301ed[_0x01ab('0x2d')]);_0x12f41e[_0x01ab('0x31')]=_[_0x01ab('0x30')](_0x2301ed['model'],qs['fields'](_0x3d10cf[_0x01ab('0x2d')][_0x01ab('0x32')]));_0x12f41e[_0x01ab('0x31')]=_0x12f41e[_0x01ab('0x31')][_0x01ab('0x33')]?_0x12f41e[_0x01ab('0x31')]:_0x2301ed[_0x01ab('0x2c')];if(!_0x3d10cf['query'][_0x01ab('0x34')](_0x01ab('0x35'))){_0x12f41e[_0x01ab('0x19')]=qs[_0x01ab('0x19')](_0x3d10cf[_0x01ab('0x2d')][_0x01ab('0x19')]);_0x12f41e['offset']=qs[_0x01ab('0x1b')](_0x3d10cf[_0x01ab('0x2d')]['offset']);}_0x12f41e['order']=qs[_0x01ab('0x37')](_0x3d10cf['query'][_0x01ab('0x37')]);_0x12f41e[_0x01ab('0x38')]=qs[_0x01ab('0x2f')](_[_0x01ab('0x39')](_0x3d10cf[_0x01ab('0x2d')],_0x2301ed[_0x01ab('0x2f')]));_0x12f41e['where'][_0x01ab('0x53')]=_0x107e14['id'];if(_0x3d10cf['query'][_0x01ab('0x3d')]){_0x12f41e[_0x01ab('0x38')]=_[_0x01ab('0x3a')](_0x12f41e['where'],{'$or':_['map'](_0x12f41e[_0x01ab('0x31')],function(_0x2ac599){var _0x250ffe={};_0x250ffe[_0x2ac599]={'$like':'%'+_0x3d10cf['query'][_0x01ab('0x3d')]+'%'};return _0x250ffe;})});}_0x12f41e=_[_0x01ab('0x3a')]({},_0x12f41e,_0x3d10cf[_0x01ab('0x3e')]);return db[_0x01ab('0x56')][_0x01ab('0x1a')]({'where':_0x12f41e[_0x01ab('0x38')]})[_0x01ab('0x1d')](function(_0x33145f){_0x275df3[_0x01ab('0x1a')]=_0x33145f;if(_0x3d10cf['query']['includeAll']){_0x12f41e[_0x01ab('0x44')]=[{'all':!![]}];}return db[_0x01ab('0x56')][_0x01ab('0x40')](_0x12f41e);})[_0x01ab('0x1d')](function(_0x366e93){_0x275df3['rows']=_0x366e93;return _0x275df3;});}})[_0x01ab('0x1d')](respondWithFilteredResult(_0x242c32,_0x12f41e))[_0x01ab('0x41')](handleError(_0x242c32,null));};exports['getHopperFinals']=function(_0x2ce096,_0x187b1c,_0x3bebb3){var _0x59376d={'raw':!![],'where':{}};var _0xd4cc1={};var _0x2a44e9={'count':0x0,'rows':[]};return db[_0x01ab('0x27')][_0x01ab('0x52')]({'where':{'id':_0x2ce096[_0x01ab('0x43')]['id']}})[_0x01ab('0x1d')](handleEntityNotFound(_0x187b1c,null))[_0x01ab('0x1d')](function(_0x50061f){if(_0x50061f){_0xd4cc1[_0x01ab('0x2c')]=_[_0x01ab('0x2e')](db[_0x01ab('0x57')][_0x01ab('0x28')]);_0xd4cc1[_0x01ab('0x2d')]=_[_0x01ab('0x2e')](_0x2ce096['query']);_0xd4cc1[_0x01ab('0x2f')]=_['intersection'](_0xd4cc1[_0x01ab('0x2c')],_0xd4cc1[_0x01ab('0x2d')]);_0x59376d[_0x01ab('0x31')]=_['intersection'](_0xd4cc1[_0x01ab('0x2c')],qs[_0x01ab('0x32')](_0x2ce096[_0x01ab('0x2d')][_0x01ab('0x32')]));_0x59376d['attributes']=_0x59376d[_0x01ab('0x31')][_0x01ab('0x33')]?_0x59376d['attributes']:_0xd4cc1[_0x01ab('0x2c')];if(!_0x2ce096[_0x01ab('0x2d')][_0x01ab('0x34')]('nolimit')){_0x59376d['limit']=qs['limit'](_0x2ce096[_0x01ab('0x2d')]['limit']);_0x59376d[_0x01ab('0x1b')]=qs['offset'](_0x2ce096[_0x01ab('0x2d')]['offset']);}_0x59376d[_0x01ab('0x36')]=qs[_0x01ab('0x37')](_0x2ce096[_0x01ab('0x2d')][_0x01ab('0x37')]);_0x59376d[_0x01ab('0x38')]=qs['filters'](_[_0x01ab('0x39')](_0x2ce096[_0x01ab('0x2d')],_0xd4cc1[_0x01ab('0x2f')]));_0x59376d[_0x01ab('0x38')][_0x01ab('0x53')]=_0x50061f['id'];if(_0x2ce096[_0x01ab('0x2d')][_0x01ab('0x3d')]){_0x59376d[_0x01ab('0x38')]=_[_0x01ab('0x3a')](_0x59376d[_0x01ab('0x38')],{'$or':_['map'](_0x59376d['attributes'],function(_0x1b4866){var _0x3cec16={};_0x3cec16[_0x1b4866]={'$like':'%'+_0x2ce096[_0x01ab('0x2d')][_0x01ab('0x3d')]+'%'};return _0x3cec16;})});}_0x59376d=_[_0x01ab('0x3a')]({},_0x59376d,_0x2ce096[_0x01ab('0x3e')]);return db[_0x01ab('0x57')][_0x01ab('0x1a')]({'where':_0x59376d[_0x01ab('0x38')]})[_0x01ab('0x1d')](function(_0x3f9337){_0x2a44e9[_0x01ab('0x1a')]=_0x3f9337;if(_0x2ce096['query'][_0x01ab('0x3f')]){_0x59376d[_0x01ab('0x44')]=[{'all':!![]}];}return db[_0x01ab('0x57')][_0x01ab('0x40')](_0x59376d);})[_0x01ab('0x1d')](function(_0x563810){_0x2a44e9[_0x01ab('0x55')]=_0x563810;return _0x2a44e9;});}})['then'](respondWithFilteredResult(_0x187b1c,_0x59376d))['catch'](handleError(_0x187b1c,null));};exports[_0x01ab('0x58')]=function(_0x39090c,_0x5af1a5,_0x32519f){var _0x3ebf1c={'raw':!![],'where':{}};var _0x4abb94={};var _0x5d2545={'count':0x0,'rows':[]};return db[_0x01ab('0x27')]['findOne']({'where':{'id':_0x39090c[_0x01ab('0x43')]['id']}})[_0x01ab('0x1d')](handleEntityNotFound(_0x5af1a5,null))[_0x01ab('0x1d')](function(_0x2d902e){if(_0x2d902e){_0x4abb94[_0x01ab('0x2c')]=_[_0x01ab('0x2e')](db[_0x01ab('0x59')][_0x01ab('0x28')]);_0x4abb94[_0x01ab('0x2d')]=_[_0x01ab('0x2e')](_0x39090c['query']);_0x4abb94[_0x01ab('0x2f')]=_[_0x01ab('0x30')](_0x4abb94[_0x01ab('0x2c')],_0x4abb94['query']);_0x3ebf1c['attributes']=_[_0x01ab('0x30')](_0x4abb94['model'],qs['fields'](_0x39090c['query'][_0x01ab('0x32')]));_0x3ebf1c[_0x01ab('0x31')]=_0x3ebf1c[_0x01ab('0x31')][_0x01ab('0x33')]?_0x3ebf1c[_0x01ab('0x31')]:_0x4abb94[_0x01ab('0x2c')];if(!_0x39090c['query']['hasOwnProperty']('nolimit')){_0x3ebf1c[_0x01ab('0x19')]=qs[_0x01ab('0x19')](_0x39090c['query'][_0x01ab('0x19')]);_0x3ebf1c['offset']=qs['offset'](_0x39090c[_0x01ab('0x2d')][_0x01ab('0x1b')]);}_0x3ebf1c[_0x01ab('0x36')]=qs[_0x01ab('0x37')](_0x39090c[_0x01ab('0x2d')]['sort']);_0x3ebf1c[_0x01ab('0x38')]=qs[_0x01ab('0x2f')](_['pick'](_0x39090c[_0x01ab('0x2d')],_0x4abb94[_0x01ab('0x2f')]));_0x3ebf1c[_0x01ab('0x38')][_0x01ab('0x53')]=_0x2d902e['id'];if(_0x39090c['query']['filter']){_0x3ebf1c[_0x01ab('0x38')]=_[_0x01ab('0x3a')](_0x3ebf1c[_0x01ab('0x38')],{'$or':_[_0x01ab('0x3b')](_0x3ebf1c[_0x01ab('0x31')],function(_0x575b09){var _0x33f7ea={};_0x33f7ea[_0x575b09]={'$like':'%'+_0x39090c[_0x01ab('0x2d')][_0x01ab('0x3d')]+'%'};return _0x33f7ea;})});}_0x3ebf1c=_[_0x01ab('0x3a')]({},_0x3ebf1c,_0x39090c[_0x01ab('0x3e')]);return db[_0x01ab('0x59')][_0x01ab('0x1a')]({'where':_0x3ebf1c[_0x01ab('0x38')]})[_0x01ab('0x1d')](function(_0x117e3){_0x5d2545[_0x01ab('0x1a')]=_0x117e3;if(_0x39090c[_0x01ab('0x2d')]['includeAll']){_0x3ebf1c['include']=[{'all':!![]}];}return db[_0x01ab('0x59')]['findAll'](_0x3ebf1c);})[_0x01ab('0x1d')](function(_0x3ea72d){_0x5d2545[_0x01ab('0x55')]=_0x3ea72d;return _0x5d2545;});}})['then'](respondWithFilteredResult(_0x5af1a5,_0x3ebf1c))[_0x01ab('0x41')](handleError(_0x5af1a5,null));};exports[_0x01ab('0x5a')]=function(_0x4dc599,_0x52ce9e,_0x568bed){var _0x408cdd={};var _0x4bf6fa={};var _0x5d74b9;var _0x388322;return db['Campaign'][_0x01ab('0x52')]({'where':{'id':_0x4dc599['params']['id']}})['then'](handleEntityNotFound(_0x52ce9e,null))[_0x01ab('0x1d')](function(_0x3a2d1b){if(_0x3a2d1b){_0x5d74b9=_0x3a2d1b;_0x4bf6fa[_0x01ab('0x2c')]=_[_0x01ab('0x2e')](db[_0x01ab('0x5b')][_0x01ab('0x28')]);_0x4bf6fa[_0x01ab('0x2d')]=_[_0x01ab('0x2e')](_0x4dc599[_0x01ab('0x2d')]);_0x4bf6fa['filters']=_['intersection'](_0x4bf6fa[_0x01ab('0x2c')],_0x4bf6fa['query']);_0x408cdd[_0x01ab('0x31')]=_[_0x01ab('0x30')](_0x4bf6fa[_0x01ab('0x2c')],qs['fields'](_0x4dc599[_0x01ab('0x2d')][_0x01ab('0x32')]));_0x408cdd[_0x01ab('0x31')]=_0x408cdd[_0x01ab('0x31')][_0x01ab('0x33')]?_0x408cdd['attributes']:_0x4bf6fa[_0x01ab('0x2c')];_0x408cdd[_0x01ab('0x36')]=qs[_0x01ab('0x37')](_0x4dc599['query'][_0x01ab('0x37')]);_0x408cdd['where']=qs['filters'](_[_0x01ab('0x39')](_0x4dc599[_0x01ab('0x2d')],_0x4bf6fa[_0x01ab('0x2f')]));if(_0x4dc599[_0x01ab('0x2d')]['filter']){_0x408cdd['where']=_['merge'](_0x408cdd['where'],{'$or':_[_0x01ab('0x3b')](_0x408cdd[_0x01ab('0x31')],function(_0x1419e9){var _0x5b3a0f={};_0x5b3a0f[_0x1419e9]={'$like':'%'+_0x4dc599['query'][_0x01ab('0x3d')]+'%'};return _0x5b3a0f;})});}_0x408cdd=_[_0x01ab('0x3a')]({},_0x408cdd,_0x4dc599[_0x01ab('0x3e')]);return _0x5d74b9[_0x01ab('0x5a')](_0x408cdd);}})[_0x01ab('0x1d')](function(_0xf958da){if(_0xf958da){_0x388322=_0xf958da[_0x01ab('0x33')];if(!_0x4dc599[_0x01ab('0x2d')][_0x01ab('0x34')](_0x01ab('0x35'))){_0x408cdd[_0x01ab('0x19')]=qs[_0x01ab('0x19')](_0x4dc599[_0x01ab('0x2d')]['limit']);_0x408cdd[_0x01ab('0x1b')]=qs[_0x01ab('0x1b')](_0x4dc599[_0x01ab('0x2d')][_0x01ab('0x1b')]);}return _0x5d74b9['getLists'](_0x408cdd);}})['then'](function(_0x1a6da9){if(_0x1a6da9){return _0x1a6da9?{'count':_0x388322,'rows':_0x1a6da9}:null;}})[_0x01ab('0x1d')](respondWithResult(_0x52ce9e,null))[_0x01ab('0x41')](handleError(_0x52ce9e,null));};exports[_0x01ab('0x5c')]=function(_0x7d4cd7,_0x3febd5,_0x40c3b3){var _0x36f895,_0x3af6e7;return db[_0x01ab('0x27')][_0x01ab('0x45')]({'where':{'id':_0x7d4cd7[_0x01ab('0x43')]['id']}})['then'](handleEntityNotFound(_0x3febd5,null))[_0x01ab('0x1d')](function(_0x576844){if(_0x576844){_0x3af6e7=_0x576844;return _0x576844[_0x01ab('0x5c')](_0x7d4cd7[_0x01ab('0x47')][_0x01ab('0x5d')],_[_0x01ab('0x4d')](_0x7d4cd7[_0x01ab('0x47')],['ids','id'])||{});}return null;})['spread'](function(_0x18ed44){var _0x4c7776;_0x36f895=_0x18ed44||[];var _0x4d7f76=[];if(_0x18ed44){for(var _0x25f68e=0x0;_0x25f68e<_0x18ed44[_0x01ab('0x33')];_0x25f68e+=0x1){var _0x10e6d9=_0x18ed44[_0x25f68e]['get']({'plain':!![]});_0x3af6e7['dialCheckDuplicateType']=_0x7d4cd7[_0x01ab('0x47')][_0x01ab('0x5e')]?_0x7d4cd7[_0x01ab('0x47')][_0x01ab('0x5e')]:_0x3af6e7[_0x01ab('0x5e')];switch(_0x3af6e7[_0x01ab('0x5e')]){case _0x01ab('0x5f'):_0x4c7776=squel['insert']()['into'](_0x01ab('0x60'))[_0x01ab('0x61')](['phone',_0x01ab('0x62'),_0x01ab('0x63'),'ListId',_0x01ab('0x53'),_0x01ab('0x4e'),_0x01ab('0x4c')],squel['select']()[_0x01ab('0x64')]('phone','phone')[_0x01ab('0x64')](_0x01ab('0x65'),_0x01ab('0x62'))[_0x01ab('0x64')]('id','ContactId')[_0x01ab('0x64')](_0x10e6d9['CmListId'][_0x01ab('0x66')](),_0x01ab('0x67'))['field'](_0x7d4cd7['params']['id']['toString'](),_0x01ab('0x53'))[_0x01ab('0x64')](_0x01ab('0x65'),_0x01ab('0x4e'))['field'](_0x01ab('0x65'),_0x01ab('0x4c'))[_0x01ab('0x68')](_0x01ab('0x69'))[_0x01ab('0x38')](_0x01ab('0x6a'))[_0x01ab('0x38')](_0x01ab('0x6b'),_0x10e6d9[_0x01ab('0x6c')][_0x01ab('0x66')]())[_0x01ab('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0x01ab('0x38')](_0x01ab('0x6d'),squel[_0x01ab('0x6e')]()[_0x01ab('0x64')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x01ab('0x6f'))['where'](_0x01ab('0x70'),_0x7d4cd7[_0x01ab('0x43')]['id']['toString']()))[_0x01ab('0x38')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x01ab('0x64')](_0x01ab('0x71'))[_0x01ab('0x68')]('cm_hopper')[_0x01ab('0x38')]('CampaignId\x20=\x20?',_0x7d4cd7[_0x01ab('0x43')]['id']['toString']())))[_0x01ab('0x66')]();break;case'onlyIfOpen':_0x4c7776=squel[_0x01ab('0x72')]()[_0x01ab('0x73')](_0x01ab('0x60'))[_0x01ab('0x61')]([_0x01ab('0x74'),'scheduledAt','ContactId',_0x01ab('0x67'),_0x01ab('0x53'),_0x01ab('0x4e'),_0x01ab('0x4c')],squel[_0x01ab('0x6e')]()[_0x01ab('0x64')](_0x01ab('0x74'),_0x01ab('0x74'))[_0x01ab('0x64')]('NOW()',_0x01ab('0x62'))['field']('id','ContactId')[_0x01ab('0x64')](_0x10e6d9[_0x01ab('0x6c')][_0x01ab('0x66')](),'ListId')[_0x01ab('0x64')](_0x7d4cd7[_0x01ab('0x43')]['id'][_0x01ab('0x66')](),_0x01ab('0x53'))[_0x01ab('0x64')](_0x01ab('0x65'),_0x01ab('0x4e'))[_0x01ab('0x64')](_0x01ab('0x65'),_0x01ab('0x4c'))['from'](_0x01ab('0x69'))[_0x01ab('0x38')](_0x01ab('0x6a'))[_0x01ab('0x38')]('ListId\x20=\x20?',_0x10e6d9['CmListId'][_0x01ab('0x66')]())['where'](_0x01ab('0x75'))[_0x01ab('0x38')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x01ab('0x64')]('COALESCE(phone,\x27\x27)')[_0x01ab('0x68')](_0x01ab('0x60'))[_0x01ab('0x38')](_0x01ab('0x70'),_0x7d4cd7[_0x01ab('0x43')]['id']['toString']())))[_0x01ab('0x66')]();break;default:_0x4c7776=squel[_0x01ab('0x72')]()[_0x01ab('0x73')](_0x01ab('0x60'))[_0x01ab('0x61')]([_0x01ab('0x74'),'scheduledAt',_0x01ab('0x63'),_0x01ab('0x67'),_0x01ab('0x53'),_0x01ab('0x4e'),_0x01ab('0x4c')],squel[_0x01ab('0x6e')]()['field'](_0x01ab('0x74'),'phone')[_0x01ab('0x64')](_0x01ab('0x65'),_0x01ab('0x62'))[_0x01ab('0x64')]('id',_0x01ab('0x63'))[_0x01ab('0x64')](_0x10e6d9[_0x01ab('0x6c')][_0x01ab('0x66')](),_0x01ab('0x67'))[_0x01ab('0x64')](_0x7d4cd7[_0x01ab('0x43')]['id'][_0x01ab('0x66')](),_0x01ab('0x53'))[_0x01ab('0x64')](_0x01ab('0x65'),_0x01ab('0x4e'))[_0x01ab('0x64')](_0x01ab('0x65'),_0x01ab('0x4c'))[_0x01ab('0x68')]('cm_contacts')[_0x01ab('0x38')]('deletedAt\x20IS\x20NULL')['where'](_0x01ab('0x6b'),_0x10e6d9[_0x01ab('0x6c')]['toString']())[_0x01ab('0x38')](_0x01ab('0x75')))[_0x01ab('0x66')]();}_0x4d7f76[_0x01ab('0x76')](db[_0x01ab('0x77')][_0x01ab('0x2d')](_0x4c7776));}return BPromise[_0x01ab('0x78')](_0x4d7f76);}})[_0x01ab('0x1d')](function(){return _0x36f895;})['then'](respondWithResult(_0x3febd5,null))[_0x01ab('0x41')](handleError(_0x3febd5,null));};exports['removeLists']=function(_0x1cf933,_0x59159c,_0x2dae3a){return db[_0x01ab('0x27')][_0x01ab('0x45')]({'where':{'id':_0x1cf933[_0x01ab('0x43')]['id']}})['then'](handleEntityNotFound(_0x59159c,null))[_0x01ab('0x1d')](function(_0x160dc1){if(_0x160dc1){return _0x160dc1[_0x01ab('0x79')](_0x1cf933['query']['ids']);}})['then'](function(_0x2f0d84){if(_0x2f0d84){return db[_0x01ab('0x54')][_0x01ab('0x1e')]({'where':{'ListId':_0x1cf933[_0x01ab('0x2d')][_0x01ab('0x5d')],'CampaignId':_0x1cf933[_0x01ab('0x43')]['id']}})[_0x01ab('0x1d')](function(){return _0x2f0d84;});}})[_0x01ab('0x1d')](respondWithStatusCode(_0x59159c,null))['catch'](handleError(_0x59159c,null));};exports['getBlackLists']=function(_0x35854a,_0x4f4998,_0x309e23){var _0x25aca9={};var _0xe60a01={};var _0x23ff7f;var _0x489134;return db[_0x01ab('0x27')][_0x01ab('0x52')]({'where':{'id':_0x35854a[_0x01ab('0x43')]['id']}})['then'](handleEntityNotFound(_0x4f4998,null))[_0x01ab('0x1d')](function(_0xd2d714){if(_0xd2d714){_0x23ff7f=_0xd2d714;_0xe60a01[_0x01ab('0x2c')]=_['keys'](db['CmList']['rawAttributes']);_0xe60a01[_0x01ab('0x2d')]=_[_0x01ab('0x2e')](_0x35854a[_0x01ab('0x2d')]);_0xe60a01[_0x01ab('0x2f')]=_[_0x01ab('0x30')](_0xe60a01[_0x01ab('0x2c')],_0xe60a01[_0x01ab('0x2d')]);_0x25aca9[_0x01ab('0x31')]=_[_0x01ab('0x30')](_0xe60a01[_0x01ab('0x2c')],qs[_0x01ab('0x32')](_0x35854a['query'][_0x01ab('0x32')]));_0x25aca9['attributes']=_0x25aca9[_0x01ab('0x31')][_0x01ab('0x33')]?_0x25aca9[_0x01ab('0x31')]:_0xe60a01[_0x01ab('0x2c')];_0x25aca9[_0x01ab('0x36')]=qs['sort'](_0x35854a[_0x01ab('0x2d')][_0x01ab('0x37')]);_0x25aca9['where']=qs[_0x01ab('0x2f')](_[_0x01ab('0x39')](_0x35854a[_0x01ab('0x2d')],_0xe60a01[_0x01ab('0x2f')]));if(_0x35854a[_0x01ab('0x2d')][_0x01ab('0x3d')]){_0x25aca9[_0x01ab('0x38')]=_[_0x01ab('0x3a')](_0x25aca9[_0x01ab('0x38')],{'$or':_[_0x01ab('0x3b')](_0x25aca9[_0x01ab('0x31')],function(_0x241942){var _0x57d7e1={};_0x57d7e1[_0x241942]={'$like':'%'+_0x35854a[_0x01ab('0x2d')][_0x01ab('0x3d')]+'%'};return _0x57d7e1;})});}_0x25aca9=_[_0x01ab('0x3a')]({},_0x25aca9,_0x35854a[_0x01ab('0x3e')]);return _0x23ff7f['getBlackLists'](_0x25aca9);}})['then'](function(_0x3cccfe){if(_0x3cccfe){_0x489134=_0x3cccfe[_0x01ab('0x33')];if(!_0x35854a[_0x01ab('0x2d')][_0x01ab('0x34')](_0x01ab('0x35'))){_0x25aca9[_0x01ab('0x19')]=qs['limit'](_0x35854a[_0x01ab('0x2d')]['limit']);_0x25aca9['offset']=qs[_0x01ab('0x1b')](_0x35854a[_0x01ab('0x2d')][_0x01ab('0x1b')]);}return _0x23ff7f[_0x01ab('0x7a')](_0x25aca9);}})[_0x01ab('0x1d')](function(_0x469fbe){if(_0x469fbe){return _0x469fbe?{'count':_0x489134,'rows':_0x469fbe}:null;}})[_0x01ab('0x1d')](respondWithResult(_0x4f4998,null))[_0x01ab('0x41')](handleError(_0x4f4998,null));};exports[_0x01ab('0x7b')]=function(_0x24301f,_0x5ddcd4,_0x5d1a37){var _0x5bdacf,_0x5ed91b;return db[_0x01ab('0x27')][_0x01ab('0x45')]({'where':{'id':_0x24301f[_0x01ab('0x43')]['id']}})[_0x01ab('0x1d')](handleEntityNotFound(_0x5ddcd4,null))[_0x01ab('0x1d')](function(_0x5ab45a){if(_0x5ab45a){_0x5ed91b=_0x5ab45a;return _0x5ab45a[_0x01ab('0x7b')](_0x24301f['body'][_0x01ab('0x5d')],_[_0x01ab('0x4d')](_0x24301f[_0x01ab('0x47')],[_0x01ab('0x5d'),'id'])||{});}return null;})['spread'](function(_0x1ebc25){var _0x397d1f;_0x5bdacf=_0x1ebc25||[];var _0x230984=[];if(_0x1ebc25){for(var _0x4fd956=0x0;_0x4fd956<_0x1ebc25['length'];_0x4fd956+=0x1){var _0x3bdbf6=_0x1ebc25[_0x4fd956]['get']({'plain':!![]});_0x397d1f=squel['insert']()['into'](_0x01ab('0x7c'))[_0x01ab('0x61')]([_0x01ab('0x74'),'ContactId',_0x01ab('0x67'),_0x01ab('0x53'),_0x01ab('0x4e'),'updatedAt'],squel[_0x01ab('0x6e')]()[_0x01ab('0x64')]('phone','phone')['field']('id','ContactId')[_0x01ab('0x64')](_0x3bdbf6[_0x01ab('0x6c')][_0x01ab('0x66')](),_0x01ab('0x67'))['field'](_0x24301f[_0x01ab('0x43')]['id'][_0x01ab('0x66')](),_0x01ab('0x53'))[_0x01ab('0x64')](_0x01ab('0x65'),_0x01ab('0x4e'))[_0x01ab('0x64')](_0x01ab('0x65'),_0x01ab('0x4c'))[_0x01ab('0x68')](_0x01ab('0x69'))[_0x01ab('0x38')]('deletedAt\x20IS\x20NULL')['where'](_0x01ab('0x6b'),_0x3bdbf6[_0x01ab('0x6c')][_0x01ab('0x66')]())['where'](_0x01ab('0x75')))[_0x01ab('0x66')]();_0x230984[_0x01ab('0x76')](db['sequelize']['query'](_0x397d1f));}return BPromise[_0x01ab('0x78')](_0x230984);}})[_0x01ab('0x1d')](function(){return _0x5bdacf;})[_0x01ab('0x1d')](respondWithResult(_0x5ddcd4,null))[_0x01ab('0x41')](handleError(_0x5ddcd4,null));};exports[_0x01ab('0x7d')]=function(_0x3e0924,_0x1d0c63,_0x3f6cca){return db[_0x01ab('0x27')][_0x01ab('0x45')]({'where':{'id':_0x3e0924[_0x01ab('0x43')]['id']}})[_0x01ab('0x1d')](handleEntityNotFound(_0x1d0c63,null))[_0x01ab('0x1d')](function(_0x29af1f){if(_0x29af1f){return _0x29af1f[_0x01ab('0x7d')](_0x3e0924[_0x01ab('0x2d')]['ids']);}})['then'](function(_0x306443){if(_0x306443){return db[_0x01ab('0x59')][_0x01ab('0x1e')]({'where':{'ListId':_0x3e0924[_0x01ab('0x2d')][_0x01ab('0x5d')],'CampaignId':_0x3e0924[_0x01ab('0x43')]['id']}})[_0x01ab('0x1d')](function(){return _0x306443;});}})[_0x01ab('0x1d')](respondWithStatusCode(_0x1d0c63,null))[_0x01ab('0x41')](handleError(_0x1d0c63,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index e14c4c7..d13e370 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3f5580,_0x46b180){var _0x849532=function(_0x517425){while(--_0x517425){_0x3f5580['push'](_0x3f5580['shift']());}};_0x849532(++_0x46b180);}(_0x7a54,0x106));var _0x47a5=function(_0x1ca831,_0x1b9d40){_0x1ca831=_0x1ca831-0x0;var _0x9e5160=_0x7a54[_0x1ca831];return _0x9e5160;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 6397880..6b64a2a 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 _0xaa88=['../../config/environment','http','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','Campaign,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','GetCampaign','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xa4405e,_0x4b5af1){var _0x29e6a5=function(_0x556522){while(--_0x556522){_0xa4405e['push'](_0xa4405e['shift']());}};_0x29e6a5(++_0x4b5af1);}(_0xaa88,0x137));var _0x8aa8=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xaa88[_0x16d10f];return _0x50c823;};'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')]('Campaign,\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')]('Campaign,\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')]('Campaign,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});}exports['GetCampaign']=function(_0x2c1b9a){var _0x49d80d=this;return new Promise(function(_0x557adc,_0xab7af5){return db['Campaign'][_0x8aa8('0x15')]({'raw':_0x2c1b9a[_0x8aa8('0x16')]?_0x2c1b9a[_0x8aa8('0x16')][_0x8aa8('0x17')]===undefined?!![]:![]:!![],'where':_0x2c1b9a['options']?_0x2c1b9a[_0x8aa8('0x16')][_0x8aa8('0x18')]||null:null,'attributes':_0x2c1b9a[_0x8aa8('0x16')]?_0x2c1b9a[_0x8aa8('0x16')][_0x8aa8('0x19')]||null:null,'limit':_0x2c1b9a[_0x8aa8('0x16')]?_0x2c1b9a['options'][_0x8aa8('0x1a')]||null:null,'include':_0x2c1b9a['options']?_0x2c1b9a[_0x8aa8('0x16')]['include']?_[_0x8aa8('0x1b')](_0x2c1b9a['options'][_0x8aa8('0x1c')],function(_0x40adb5){return{'model':db[_0x40adb5[_0x8aa8('0x1d')]],'as':_0x40adb5['as'],'attributes':_0x40adb5['attributes'],'include':_0x40adb5[_0x8aa8('0x1c')]?_[_0x8aa8('0x1b')](_0x40adb5[_0x8aa8('0x1c')],function(_0x547a7b){return{'model':db[_0x547a7b['model']],'as':_0x547a7b['as'],'attributes':_0x547a7b[_0x8aa8('0x19')],'include':_0x547a7b[_0x8aa8('0x1c')]?_[_0x8aa8('0x1b')](_0x547a7b[_0x8aa8('0x1c')],function(_0x24143e){return{'model':db[_0x24143e['model']],'as':_0x24143e['as'],'attributes':_0x24143e[_0x8aa8('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a0ff2){logger[_0x8aa8('0xc')](_0x8aa8('0x1e'),_0x2c1b9a);logger['debug']('GetCampaign',_0x2c1b9a,JSON[_0x8aa8('0x1f')](_0x2a0ff2));_0x557adc(_0x2a0ff2);})['catch'](function(_0x385208){logger[_0x8aa8('0x10')](_0x8aa8('0x1e'),_0x385208[_0x8aa8('0x12')],_0x2c1b9a);_0xab7af5(_0x49d80d[_0x8aa8('0x10')](0x1f4,_0x385208['message']));});});}; \ No newline at end of file +var _0x0834=['attributes','limit','map','model','include','GetCampaign','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0834,0x18e));var _0x4083=function(_0x23c991,_0x566312){_0x23c991=_0x23c991-0x0;var _0x323d32=_0x0834[_0x23c991];return _0x323d32;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4083('0x0'));var BPromise=require(_0x4083('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4083('0x2'));var logger=require(_0x4083('0x3'))('rpc');var config=require(_0x4083('0x4'));var jayson=require(_0x4083('0x5'));var client=jayson['client'][_0x4083('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5c5a54,_0x31c7ef,_0x26ed53){return new BPromise(function(_0x2c42bb,_0x1d56dd){return client[_0x4083('0x7')](_0x5c5a54,_0x26ed53)[_0x4083('0x8')](function(_0x3cee37){logger[_0x4083('0x9')](_0x4083('0xa'),_0x31c7ef,_0x4083('0xb'));logger[_0x4083('0xc')](_0x4083('0xd'),_0x31c7ef,_0x4083('0xb'),JSON[_0x4083('0xe')](_0x3cee37));if(_0x3cee37[_0x4083('0xf')]){if(_0x3cee37['error']['code']===0x1f4){logger[_0x4083('0xf')](_0x4083('0xa'),_0x31c7ef,_0x3cee37['error'][_0x4083('0x10')]);return _0x1d56dd(_0x3cee37[_0x4083('0xf')][_0x4083('0x10')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x31c7ef,_0x3cee37[_0x4083('0xf')][_0x4083('0x10')]);return _0x2c42bb(_0x3cee37['error'][_0x4083('0x10')]);}else{logger[_0x4083('0x9')](_0x4083('0xa'),_0x31c7ef,_0x4083('0xb'));_0x2c42bb(_0x3cee37[_0x4083('0x11')]['message']);}})[_0x4083('0x12')](function(_0x10cadd){logger[_0x4083('0xf')](_0x4083('0xa'),_0x31c7ef,_0x10cadd);_0x1d56dd(_0x10cadd);});});}exports['GetCampaign']=function(_0x4e7d59){var _0x4d6089=this;return new Promise(function(_0xafda0c,_0x53d525){return db['Campaign'][_0x4083('0x13')]({'raw':_0x4e7d59['options']?_0x4e7d59[_0x4083('0x14')][_0x4083('0x15')]===undefined?!![]:![]:!![],'where':_0x4e7d59[_0x4083('0x14')]?_0x4e7d59[_0x4083('0x14')]['where']||null:null,'attributes':_0x4e7d59[_0x4083('0x14')]?_0x4e7d59['options'][_0x4083('0x16')]||null:null,'limit':_0x4e7d59[_0x4083('0x14')]?_0x4e7d59[_0x4083('0x14')][_0x4083('0x17')]||null:null,'include':_0x4e7d59['options']?_0x4e7d59[_0x4083('0x14')]['include']?_[_0x4083('0x18')](_0x4e7d59[_0x4083('0x14')]['include'],function(_0x52a440){return{'model':db[_0x52a440[_0x4083('0x19')]],'as':_0x52a440['as'],'attributes':_0x52a440['attributes'],'include':_0x52a440['include']?_['map'](_0x52a440[_0x4083('0x1a')],function(_0xb2fbb5){return{'model':db[_0xb2fbb5[_0x4083('0x19')]],'as':_0xb2fbb5['as'],'attributes':_0xb2fbb5['attributes'],'include':_0xb2fbb5[_0x4083('0x1a')]?_[_0x4083('0x18')](_0xb2fbb5[_0x4083('0x1a')],function(_0x552534){return{'model':db[_0x552534[_0x4083('0x19')]],'as':_0x552534['as'],'attributes':_0x552534[_0x4083('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x315458){logger[_0x4083('0x9')](_0x4083('0x1b'),_0x4e7d59);logger[_0x4083('0xc')](_0x4083('0x1b'),_0x4e7d59,JSON[_0x4083('0xe')](_0x315458));_0xafda0c(_0x315458);})[_0x4083('0x12')](function(_0x1534e9){logger[_0x4083('0xf')]('GetCampaign',_0x1534e9['message'],_0x4e7d59);_0x53d525(_0x4d6089[_0x4083('0xf')](0x1f4,_0x1534e9[_0x4083('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 2af8aa5..8362595 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 _0x794c=['post','create','/:id/clone','clone','addLists','addBlackLists','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists'];(function(_0x3b8f1c,_0x4f0f58){var _0x418afb=function(_0x3e107c){while(--_0x3e107c){_0x3b8f1c['push'](_0x3b8f1c['shift']());}};_0x418afb(++_0x4f0f58);}(_0x794c,0x199));var _0xc794=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x794c[_0x4eb6ec];return _0x58881b;};'use strict';var multer=require('multer');var util=require(_0xc794('0x0'));var path=require(_0xc794('0x1'));var timeout=require('connect-timeout');var express=require(_0xc794('0x2'));var router=express[_0xc794('0x3')]();var fs_extra=require(_0xc794('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc794('0x5'));var config=require(_0xc794('0x6'));var controller=require('./campaign.controller');router[_0xc794('0x7')]('/',auth[_0xc794('0x8')](),controller[_0xc794('0x9')]);router['get']('/:id',auth[_0xc794('0x8')](),controller[_0xc794('0xa')]);router['get']('/:id/hoppers',auth[_0xc794('0x8')](),controller['getHoppers']);router[_0xc794('0x7')](_0xc794('0xb'),auth[_0xc794('0x8')](),controller[_0xc794('0xc')]);router[_0xc794('0x7')](_0xc794('0xd'),auth[_0xc794('0x8')](),controller[_0xc794('0xe')]);router['get'](_0xc794('0xf'),auth[_0xc794('0x8')](),controller[_0xc794('0x10')]);router[_0xc794('0x7')](_0xc794('0x11'),auth[_0xc794('0x8')](),controller['getLists']);router['get'](_0xc794('0x12'),auth[_0xc794('0x8')](),controller[_0xc794('0x13')]);router[_0xc794('0x14')]('/',auth[_0xc794('0x8')](),controller[_0xc794('0x15')]);router[_0xc794('0x14')](_0xc794('0x16'),auth[_0xc794('0x8')](),controller[_0xc794('0x17')]);router[_0xc794('0x14')]('/:id/lists',auth[_0xc794('0x8')](),controller[_0xc794('0x18')]);router[_0xc794('0x14')](_0xc794('0x12'),auth['isAuthenticated'](),controller[_0xc794('0x19')]);router['put'](_0xc794('0x1a'),auth[_0xc794('0x8')](),controller[_0xc794('0x1b')]);router[_0xc794('0x1c')](_0xc794('0x1a'),auth[_0xc794('0x8')](),controller[_0xc794('0x1d')]);router[_0xc794('0x1c')](_0xc794('0x11'),auth[_0xc794('0x8')](),controller[_0xc794('0x1e')]);router['delete'](_0xc794('0x12'),auth[_0xc794('0x8')](),controller[_0xc794('0x1f')]);module[_0xc794('0x20')]=router; \ No newline at end of file +var _0x938a=['removeBlackLists','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','index','/:id/hoppers','isAuthenticated','/:id/hopper_histories','getHopperHistories','getHopperFinals','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','/:id/lists','addLists','addBlackLists','put','/:id','update','delete','destroy'];(function(_0x412261,_0x175b50){var _0x44942e=function(_0x20c5fd){while(--_0x20c5fd){_0x412261['push'](_0x412261['shift']());}};_0x44942e(++_0x175b50);}(_0x938a,0x1f2));var _0xa938=function(_0x23379a,_0x228aff){_0x23379a=_0x23379a-0x0;var _0x51a252=_0x938a[_0x23379a];return _0x51a252;};'use strict';var multer=require(_0xa938('0x0'));var util=require(_0xa938('0x1'));var path=require(_0xa938('0x2'));var timeout=require(_0xa938('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa938('0x4'));var auth=require(_0xa938('0x5'));var interaction=require(_0xa938('0x6'));var config=require('../../config/environment');var controller=require(_0xa938('0x7'));router[_0xa938('0x8')]('/',auth['isAuthenticated'](),controller[_0xa938('0x9')]);router[_0xa938('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa938('0x8')](_0xa938('0xa'),auth[_0xa938('0xb')](),controller['getHoppers']);router[_0xa938('0x8')](_0xa938('0xc'),auth[_0xa938('0xb')](),controller[_0xa938('0xd')]);router[_0xa938('0x8')]('/:id/hopper_finals',auth[_0xa938('0xb')](),controller[_0xa938('0xe')]);router[_0xa938('0x8')]('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router['get']('/:id/lists',auth[_0xa938('0xb')](),controller[_0xa938('0xf')]);router['get'](_0xa938('0x10'),auth[_0xa938('0xb')](),controller[_0xa938('0x11')]);router['post']('/',auth[_0xa938('0xb')](),controller[_0xa938('0x12')]);router[_0xa938('0x13')](_0xa938('0x14'),auth[_0xa938('0xb')](),controller['clone']);router[_0xa938('0x13')](_0xa938('0x15'),auth[_0xa938('0xb')](),controller[_0xa938('0x16')]);router['post'](_0xa938('0x10'),auth['isAuthenticated'](),controller[_0xa938('0x17')]);router[_0xa938('0x18')](_0xa938('0x19'),auth[_0xa938('0xb')](),controller[_0xa938('0x1a')]);router[_0xa938('0x1b')](_0xa938('0x19'),auth[_0xa938('0xb')](),controller[_0xa938('0x1c')]);router[_0xa938('0x1b')](_0xa938('0x15'),auth[_0xa938('0xb')](),controller['removeLists']);router[_0xa938('0x1b')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xa938('0x1d')]);module[_0xa938('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 3fe35bd..1fbd5a2 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 _0xdd3f=['exports','STRING','VIRTUAL','getDataValue','key','sequelize'];(function(_0x2787e9,_0x456837){var _0x5ad602=function(_0x6f39b0){while(--_0x6f39b0){_0x2787e9['push'](_0x2787e9['shift']());}};_0x5ad602(++_0x456837);}(_0xdd3f,0x155));var _0xfdd3=function(_0x3ca84a,_0x7801fc){_0x3ca84a=_0x3ca84a-0x0;var _0xb2ae81=_0xdd3f[_0x3ca84a];return _0xb2ae81;};'use strict';var Sequelize=require(_0xfdd3('0x0'));module[_0xfdd3('0x1')]={'key':{'type':Sequelize[_0xfdd3('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xfdd3('0x3')],'get':function(){return this[_0xfdd3('0x4')](_0xfdd3('0x5'));}}}; \ No newline at end of file +var _0x8c0e=['key','sequelize','exports','TEXT','STRING','VIRTUAL'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0x8c0e,0x19f));var _0xe8c0=function(_0x3ce56b,_0x5eae51){_0x3ce56b=_0x3ce56b-0x0;var _0x21b859=_0x8c0e[_0x3ce56b];return _0x21b859;};'use strict';var Sequelize=require(_0xe8c0('0x0'));module[_0xe8c0('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xe8c0('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe8c0('0x3')]},'name':{'type':Sequelize[_0xe8c0('0x4')],'get':function(){return this['getDataValue'](_0xe8c0('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 96b956f..e6c39ad 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 _0xe0b5=['get','CannedAnswers','UserProfileResource','error','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','intersection','length','includeAll','find','catch','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x3d6b42,_0x4f7a00){var _0x24a69b=function(_0x31d817){while(--_0x31d817){_0x3d6b42['push'](_0x3d6b42['shift']());}};_0x24a69b(++_0x4f7a00);}(_0xe0b5,0xf1));var _0x5e0b=function(_0x38adef,_0x49c128){_0x38adef=_0x38adef-0x0;var _0x1694dd=_0xe0b5[_0x38adef];return _0x1694dd;};'use strict';var emlformat=require(_0x5e0b('0x0'));var rimraf=require(_0x5e0b('0x1'));var zipdir=require(_0x5e0b('0x2'));var jsonpatch=require(_0x5e0b('0x3'));var rp=require(_0x5e0b('0x4'));var moment=require('moment');var BPromise=require(_0x5e0b('0x5'));var Mustache=require(_0x5e0b('0x6'));var util=require(_0x5e0b('0x7'));var path=require(_0x5e0b('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5e0b('0x9'));var fs=require('fs');var fs_extra=require(_0x5e0b('0xa'));var _=require(_0x5e0b('0xb'));var squel=require(_0x5e0b('0xc'));var crypto=require(_0x5e0b('0xd'));var jsforce=require(_0x5e0b('0xe'));var deskjs=require(_0x5e0b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5e0b('0x10'));var Papa=require(_0x5e0b('0x11'));var Redis=require(_0x5e0b('0x12'));var authService=require(_0x5e0b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5e0b('0x14'));var hardwareService=require(_0x5e0b('0x15'));var logger=require('../../config/logger')(_0x5e0b('0x16'));var utils=require(_0x5e0b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5e0b('0x18'));var db=require(_0x5e0b('0x19'))['db'];function respondWithStatusCode(_0x3852cd,_0x570a17){_0x570a17=_0x570a17||0xcc;return function(_0x2f1b21){if(_0x2f1b21){return _0x3852cd['sendStatus'](_0x570a17);}return _0x3852cd[_0x5e0b('0x1a')](_0x570a17)[_0x5e0b('0x1b')]();};}function respondWithResult(_0x39540f,_0x55de8d){_0x55de8d=_0x55de8d||0xc8;return function(_0x4a3bff){if(_0x4a3bff){return _0x39540f[_0x5e0b('0x1a')](_0x55de8d)['json'](_0x4a3bff);}};}function respondWithFilteredResult(_0x174d4a,_0x2fdd0e){return function(_0x3f283a){if(_0x3f283a){var _0x12e0fc=typeof _0x2fdd0e['offset']===_0x5e0b('0x1c')&&typeof _0x2fdd0e['limit']===_0x5e0b('0x1c');var _0x2f11e6=_0x3f283a[_0x5e0b('0x1d')];var _0x191c48=_0x12e0fc?0x0:_0x2fdd0e[_0x5e0b('0x1e')];var _0x484e5a=_0x12e0fc?_0x3f283a['count']:_0x2fdd0e[_0x5e0b('0x1e')]+_0x2fdd0e[_0x5e0b('0x1f')];var _0x4878c;if(_0x484e5a>=_0x2f11e6){_0x484e5a=_0x2f11e6;_0x4878c=0xc8;}else{_0x4878c=0xce;}_0x174d4a[_0x5e0b('0x1a')](_0x4878c);return _0x174d4a[_0x5e0b('0x20')](_0x5e0b('0x21'),_0x191c48+'-'+_0x484e5a+'/'+_0x2f11e6)[_0x5e0b('0x22')](_0x3f283a);}return null;};}function patchUpdates(_0x59d79d){return function(_0xe9dc28){try{jsonpatch[_0x5e0b('0x23')](_0xe9dc28,_0x59d79d,!![]);}catch(_0x33dffa){return BPromise[_0x5e0b('0x24')](_0x33dffa);}return _0xe9dc28[_0x5e0b('0x25')]();};}function saveUpdates(_0x48e70c,_0x53f4e2){return function(_0x4f332d){if(_0x4f332d){return _0x4f332d[_0x5e0b('0x26')](_0x48e70c)[_0x5e0b('0x27')](function(_0x5c9b86){return _0x5c9b86;});}return null;};}function removeEntity(_0x8ac78,_0x334620){return function(_0x4a604d){if(_0x4a604d){return _0x4a604d[_0x5e0b('0x28')]()['then'](function(){var _0x27d3b4=_0x4a604d[_0x5e0b('0x29')]({'plain':!![]});var _0x178892=_0x5e0b('0x2a');return db[_0x5e0b('0x2b')]['destroy']({'where':{'type':_0x178892,'resourceId':_0x27d3b4['id']}})[_0x5e0b('0x27')](function(){return _0x4a604d;});})['then'](function(){_0x8ac78[_0x5e0b('0x1a')](0xcc)[_0x5e0b('0x1b')]();});}};}function handleEntityNotFound(_0x546c65,_0x337f8e){return function(_0x4e3f28){if(!_0x4e3f28){_0x546c65['sendStatus'](0x194);}return _0x4e3f28;};}function handleError(_0x6eb171,_0x3d6e86){_0x3d6e86=_0x3d6e86||0x1f4;return function(_0x5b6027){logger[_0x5e0b('0x2c')](_0x5b6027['stack']);if(_0x5b6027['name']){delete _0x5b6027[_0x5e0b('0x2d')];}_0x6eb171[_0x5e0b('0x1a')](_0x3d6e86)['send'](_0x5b6027);};}exports[_0x5e0b('0x2e')]=function(_0x206d7a,_0x4f7a38){var _0x29ae37={},_0x1227e2={},_0x58b691={'count':0x0,'rows':[]};var _0x1d286a=_[_0x5e0b('0x2f')](db[_0x5e0b('0x30')][_0x5e0b('0x31')],function(_0x5b33e3){return{'name':_0x5b33e3[_0x5e0b('0x32')],'type':_0x5b33e3[_0x5e0b('0x33')][_0x5e0b('0x34')]};});_0x1227e2[_0x5e0b('0x35')]=_[_0x5e0b('0x2f')](_0x1d286a,_0x5e0b('0x2d'));_0x1227e2[_0x5e0b('0x36')]=_[_0x5e0b('0x37')](_0x206d7a['query']);_0x1227e2[_0x5e0b('0x38')]=_['intersection'](_0x1227e2[_0x5e0b('0x35')],_0x1227e2['query']);_0x29ae37[_0x5e0b('0x39')]=_['intersection'](_0x1227e2['model'],qs[_0x5e0b('0x3a')](_0x206d7a[_0x5e0b('0x36')][_0x5e0b('0x3a')]));_0x29ae37['attributes']=_0x29ae37[_0x5e0b('0x39')]['length']?_0x29ae37[_0x5e0b('0x39')]:_0x1227e2[_0x5e0b('0x35')];if(!_0x206d7a[_0x5e0b('0x36')][_0x5e0b('0x3b')](_0x5e0b('0x3c'))){_0x29ae37[_0x5e0b('0x1f')]=qs[_0x5e0b('0x1f')](_0x206d7a[_0x5e0b('0x36')][_0x5e0b('0x1f')]);_0x29ae37[_0x5e0b('0x1e')]=qs[_0x5e0b('0x1e')](_0x206d7a['query'][_0x5e0b('0x1e')]);}_0x29ae37[_0x5e0b('0x3d')]=qs['sort'](_0x206d7a[_0x5e0b('0x36')][_0x5e0b('0x3e')]);_0x29ae37[_0x5e0b('0x3f')]=qs[_0x5e0b('0x38')](_[_0x5e0b('0x40')](_0x206d7a[_0x5e0b('0x36')],_0x1227e2[_0x5e0b('0x38')]),_0x1d286a);if(_0x206d7a['query'][_0x5e0b('0x41')]){_0x29ae37[_0x5e0b('0x3f')]=_[_0x5e0b('0x42')](_0x29ae37['where'],{'$or':[{'key':{'$like':'%'+_0x206d7a['query'][_0x5e0b('0x41')]+'%'}},{'value':{'$like':'%'+_0x206d7a[_0x5e0b('0x36')][_0x5e0b('0x41')]+'%'}}]});}_0x29ae37=_[_0x5e0b('0x42')]({},_0x29ae37,_0x206d7a[_0x5e0b('0x43')]);var _0x2da218={'where':_0x29ae37[_0x5e0b('0x3f')]};return db['CannedAnswer']['count'](_0x2da218)[_0x5e0b('0x27')](function(_0xf23847){_0x58b691[_0x5e0b('0x1d')]=_0xf23847;if(_0x206d7a['query']['includeAll']){_0x29ae37[_0x5e0b('0x44')]=[{'all':!![]}];}return db[_0x5e0b('0x30')][_0x5e0b('0x45')](_0x29ae37);})[_0x5e0b('0x27')](function(_0x1b45b5){_0x58b691[_0x5e0b('0x46')]=_0x1b45b5;return _0x58b691;})[_0x5e0b('0x27')](respondWithFilteredResult(_0x4f7a38,_0x29ae37))['catch'](handleError(_0x4f7a38,null));};exports[_0x5e0b('0x47')]=function(_0x4a2d99,_0xab1672){var _0x459622={'raw':!![],'where':{'id':_0x4a2d99[_0x5e0b('0x48')]['id']}},_0x1bfdb2={};_0x1bfdb2['model']=_[_0x5e0b('0x37')](db[_0x5e0b('0x30')][_0x5e0b('0x31')]);_0x1bfdb2[_0x5e0b('0x36')]=_[_0x5e0b('0x37')](_0x4a2d99[_0x5e0b('0x36')]);_0x1bfdb2[_0x5e0b('0x38')]=_[_0x5e0b('0x49')](_0x1bfdb2[_0x5e0b('0x35')],_0x1bfdb2['query']);_0x459622[_0x5e0b('0x39')]=_[_0x5e0b('0x49')](_0x1bfdb2['model'],qs[_0x5e0b('0x3a')](_0x4a2d99[_0x5e0b('0x36')][_0x5e0b('0x3a')]));_0x459622[_0x5e0b('0x39')]=_0x459622['attributes'][_0x5e0b('0x4a')]?_0x459622[_0x5e0b('0x39')]:_0x1bfdb2[_0x5e0b('0x35')];if(_0x4a2d99[_0x5e0b('0x36')][_0x5e0b('0x4b')]){_0x459622[_0x5e0b('0x44')]=[{'all':!![]}];}_0x459622=_[_0x5e0b('0x42')]({},_0x459622,_0x4a2d99[_0x5e0b('0x43')]);return db[_0x5e0b('0x30')][_0x5e0b('0x4c')](_0x459622)[_0x5e0b('0x27')](handleEntityNotFound(_0xab1672,null))[_0x5e0b('0x27')](respondWithResult(_0xab1672,null))[_0x5e0b('0x4d')](handleError(_0xab1672,null));};exports[_0x5e0b('0x26')]=function(_0x22395e,_0x2c46aa){if(_0x22395e[_0x5e0b('0x4e')]['id']){delete _0x22395e[_0x5e0b('0x4e')]['id'];}return db['CannedAnswer'][_0x5e0b('0x4c')]({'where':{'id':_0x22395e[_0x5e0b('0x48')]['id']}})[_0x5e0b('0x27')](handleEntityNotFound(_0x2c46aa,null))[_0x5e0b('0x27')](saveUpdates(_0x22395e['body'],null))[_0x5e0b('0x27')](respondWithResult(_0x2c46aa,null))['catch'](handleError(_0x2c46aa,null));};exports[_0x5e0b('0x28')]=function(_0x2e2d48,_0x5c2de9){return db[_0x5e0b('0x30')][_0x5e0b('0x4c')]({'where':{'id':_0x2e2d48[_0x5e0b('0x48')]['id']}})[_0x5e0b('0x27')](handleEntityNotFound(_0x5c2de9,null))['then'](removeEntity(_0x5c2de9,null))[_0x5e0b('0x4d')](handleError(_0x5c2de9,null));};exports['create']=function(_0x5b36c3,_0x57b02b){var _0x829c5c={'key':_0x5b36c3['body'][_0x5e0b('0x34')]};if(_0x5b36c3['body']['MailAccountId']){_0x829c5c['MailAccountId']=_0x5b36c3[_0x5e0b('0x4e')][_0x5e0b('0x4f')];}else if(_0x5b36c3[_0x5e0b('0x4e')]['SmsAccountId']){_0x829c5c[_0x5e0b('0x50')]=_0x5b36c3[_0x5e0b('0x4e')]['SmsAccountId'];}else if(_0x5b36c3[_0x5e0b('0x4e')]['OpenchannelAccountId']){_0x829c5c[_0x5e0b('0x51')]=_0x5b36c3[_0x5e0b('0x4e')]['OpenchannelAccountId'];}else if(_0x5b36c3['body'][_0x5e0b('0x52')]){_0x829c5c[_0x5e0b('0x52')]=_0x5b36c3[_0x5e0b('0x4e')][_0x5e0b('0x52')];}return db[_0x5e0b('0x30')][_0x5e0b('0x4c')]({'where':_0x829c5c})[_0x5e0b('0x27')](function(_0x597c63){if(_0x597c63){throw new db[(_0x5e0b('0x53'))][(_0x5e0b('0x54'))](_0x5e0b('0x55'));}return db[_0x5e0b('0x30')][_0x5e0b('0x56')](_0x5b36c3[_0x5e0b('0x4e')]);})[_0x5e0b('0x27')](function(_0x11d6ba){var _0x3f7d38=_0x5b36c3[_0x5e0b('0x57')][_0x5e0b('0x29')]({'plain':!![]});if(!_0x3f7d38)throw new Error(_0x5e0b('0x58'));if(_0x3f7d38[_0x5e0b('0x59')]===_0x5e0b('0x57')){var _0x2842c7=_0x11d6ba['get']({'plain':!![]});return db[_0x5e0b('0x5a')][_0x5e0b('0x4c')]({'where':{'name':_0x5e0b('0x2a'),'userProfileId':_0x3f7d38[_0x5e0b('0x5b')]},'raw':!![]})['then'](function(_0x179605){if(_0x179605&&_0x179605[_0x5e0b('0x5c')]===0x0){return db[_0x5e0b('0x2b')]['create']({'name':_0x2842c7[_0x5e0b('0x2d')],'resourceId':_0x2842c7['id'],'type':_0x179605[_0x5e0b('0x2d')],'sectionId':_0x179605['id']},{})[_0x5e0b('0x27')](function(){return _0x11d6ba;});}else{return _0x11d6ba;}})['catch'](function(_0x794b3c){logger['error'](_0x5e0b('0x5d'),_0x794b3c);throw _0x794b3c;});}return _0x11d6ba;})[_0x5e0b('0x27')](respondWithResult(_0x57b02b,0xc9))['catch'](handleError(_0x57b02b,null));}; \ No newline at end of file +var _0xfbe9=['The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','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','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','CannedAnswers','UserProfileResource','error','send','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','CannedAnswer','count','includeAll','include','findAll','show','params','keys','intersection','catch','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError'];(function(_0x12f053,_0x2e6dec){var _0x10510e=function(_0x23690e){while(--_0x23690e){_0x12f053['push'](_0x12f053['shift']());}};_0x10510e(++_0x2e6dec);}(_0xfbe9,0xbd));var _0x9fbe=function(_0x11505c,_0x3be5b7){_0x11505c=_0x11505c-0x0;var _0x389e04=_0xfbe9[_0x11505c];return _0x389e04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fbe('0x0'));var zipdir=require(_0x9fbe('0x1'));var jsonpatch=require(_0x9fbe('0x2'));var rp=require(_0x9fbe('0x3'));var moment=require(_0x9fbe('0x4'));var BPromise=require(_0x9fbe('0x5'));var Mustache=require(_0x9fbe('0x6'));var util=require(_0x9fbe('0x7'));var path=require('path');var sox=require(_0x9fbe('0x8'));var csv=require(_0x9fbe('0x9'));var ejs=require(_0x9fbe('0xa'));var fs=require('fs');var fs_extra=require(_0x9fbe('0xb'));var _=require(_0x9fbe('0xc'));var squel=require(_0x9fbe('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9fbe('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9fbe('0xf'));var Papa=require(_0x9fbe('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9fbe('0x11'));var as=require(_0x9fbe('0x12'));var hardwareService=require(_0x9fbe('0x13'));var logger=require(_0x9fbe('0x14'))(_0x9fbe('0x15'));var utils=require(_0x9fbe('0x16'));var config=require(_0x9fbe('0x17'));var licenseUtil=require(_0x9fbe('0x18'));var db=require(_0x9fbe('0x19'))['db'];function respondWithStatusCode(_0x15f3df,_0x43d622){_0x43d622=_0x43d622||0xcc;return function(_0x2cbcb3){if(_0x2cbcb3){return _0x15f3df[_0x9fbe('0x1a')](_0x43d622);}return _0x15f3df['status'](_0x43d622)['end']();};}function respondWithResult(_0x29d675,_0xe0a578){_0xe0a578=_0xe0a578||0xc8;return function(_0x2fc891){if(_0x2fc891){return _0x29d675[_0x9fbe('0x1b')](_0xe0a578)[_0x9fbe('0x1c')](_0x2fc891);}};}function respondWithFilteredResult(_0x4eee70,_0x31c056){return function(_0x122de4){if(_0x122de4){var _0x3e30a9=typeof _0x31c056[_0x9fbe('0x1d')]===_0x9fbe('0x1e')&&typeof _0x31c056['limit']===_0x9fbe('0x1e');var _0xbcff0c=_0x122de4['count'];var _0x3cb607=_0x3e30a9?0x0:_0x31c056[_0x9fbe('0x1d')];var _0x4a54a0=_0x3e30a9?_0x122de4['count']:_0x31c056[_0x9fbe('0x1d')]+_0x31c056[_0x9fbe('0x1f')];var _0x44d13e;if(_0x4a54a0>=_0xbcff0c){_0x4a54a0=_0xbcff0c;_0x44d13e=0xc8;}else{_0x44d13e=0xce;}_0x4eee70[_0x9fbe('0x1b')](_0x44d13e);return _0x4eee70[_0x9fbe('0x20')](_0x9fbe('0x21'),_0x3cb607+'-'+_0x4a54a0+'/'+_0xbcff0c)[_0x9fbe('0x1c')](_0x122de4);}return null;};}function patchUpdates(_0x48f6d4){return function(_0x152997){try{jsonpatch[_0x9fbe('0x22')](_0x152997,_0x48f6d4,!![]);}catch(_0x3c2a79){return BPromise[_0x9fbe('0x23')](_0x3c2a79);}return _0x152997[_0x9fbe('0x24')]();};}function saveUpdates(_0x1f880f,_0x3b0beb){return function(_0x311ead){if(_0x311ead){return _0x311ead['update'](_0x1f880f)[_0x9fbe('0x25')](function(_0x2e6018){return _0x2e6018;});}return null;};}function removeEntity(_0x22a86d,_0x5aba37){return function(_0x58bd41){if(_0x58bd41){return _0x58bd41[_0x9fbe('0x26')]()['then'](function(){var _0x1235f2=_0x58bd41['get']({'plain':!![]});var _0xbf8170=_0x9fbe('0x27');return db[_0x9fbe('0x28')][_0x9fbe('0x26')]({'where':{'type':_0xbf8170,'resourceId':_0x1235f2['id']}})[_0x9fbe('0x25')](function(){return _0x58bd41;});})[_0x9fbe('0x25')](function(){_0x22a86d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fc147,_0x157132){return function(_0x25ab54){if(!_0x25ab54){_0x3fc147[_0x9fbe('0x1a')](0x194);}return _0x25ab54;};}function handleError(_0x27f2bb,_0x3e5a31){_0x3e5a31=_0x3e5a31||0x1f4;return function(_0x1890a7){logger[_0x9fbe('0x29')](_0x1890a7['stack']);if(_0x1890a7['name']){delete _0x1890a7['name'];}_0x27f2bb[_0x9fbe('0x1b')](_0x3e5a31)[_0x9fbe('0x2a')](_0x1890a7);};}exports[_0x9fbe('0x2b')]=function(_0x399410,_0xeb1c68){var _0x1043b1={},_0x4f2c41={},_0x5548ec={'count':0x0,'rows':[]};var _0x4171ef=_[_0x9fbe('0x2c')](db['CannedAnswer'][_0x9fbe('0x2d')],function(_0x498e2b){return{'name':_0x498e2b[_0x9fbe('0x2e')],'type':_0x498e2b[_0x9fbe('0x2f')][_0x9fbe('0x30')]};});_0x4f2c41[_0x9fbe('0x31')]=_[_0x9fbe('0x2c')](_0x4171ef,_0x9fbe('0x32'));_0x4f2c41[_0x9fbe('0x33')]=_['keys'](_0x399410[_0x9fbe('0x33')]);_0x4f2c41[_0x9fbe('0x34')]=_['intersection'](_0x4f2c41[_0x9fbe('0x31')],_0x4f2c41['query']);_0x1043b1[_0x9fbe('0x35')]=_['intersection'](_0x4f2c41[_0x9fbe('0x31')],qs[_0x9fbe('0x36')](_0x399410[_0x9fbe('0x33')][_0x9fbe('0x36')]));_0x1043b1[_0x9fbe('0x35')]=_0x1043b1[_0x9fbe('0x35')][_0x9fbe('0x37')]?_0x1043b1[_0x9fbe('0x35')]:_0x4f2c41['model'];if(!_0x399410[_0x9fbe('0x33')][_0x9fbe('0x38')](_0x9fbe('0x39'))){_0x1043b1[_0x9fbe('0x1f')]=qs[_0x9fbe('0x1f')](_0x399410[_0x9fbe('0x33')][_0x9fbe('0x1f')]);_0x1043b1[_0x9fbe('0x1d')]=qs[_0x9fbe('0x1d')](_0x399410[_0x9fbe('0x33')][_0x9fbe('0x1d')]);}_0x1043b1['order']=qs[_0x9fbe('0x3a')](_0x399410[_0x9fbe('0x33')][_0x9fbe('0x3a')]);_0x1043b1[_0x9fbe('0x3b')]=qs['filters'](_[_0x9fbe('0x3c')](_0x399410['query'],_0x4f2c41['filters']),_0x4171ef);if(_0x399410[_0x9fbe('0x33')][_0x9fbe('0x3d')]){_0x1043b1[_0x9fbe('0x3b')]=_[_0x9fbe('0x3e')](_0x1043b1[_0x9fbe('0x3b')],{'$or':[{'key':{'$like':'%'+_0x399410[_0x9fbe('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x399410[_0x9fbe('0x33')][_0x9fbe('0x3d')]+'%'}}]});}_0x1043b1=_[_0x9fbe('0x3e')]({},_0x1043b1,_0x399410[_0x9fbe('0x3f')]);var _0x27f456={'where':_0x1043b1[_0x9fbe('0x3b')]};return db[_0x9fbe('0x40')][_0x9fbe('0x41')](_0x27f456)[_0x9fbe('0x25')](function(_0x3f8d02){_0x5548ec[_0x9fbe('0x41')]=_0x3f8d02;if(_0x399410[_0x9fbe('0x33')][_0x9fbe('0x42')]){_0x1043b1[_0x9fbe('0x43')]=[{'all':!![]}];}return db[_0x9fbe('0x40')][_0x9fbe('0x44')](_0x1043b1);})[_0x9fbe('0x25')](function(_0x98be9f){_0x5548ec['rows']=_0x98be9f;return _0x5548ec;})['then'](respondWithFilteredResult(_0xeb1c68,_0x1043b1))['catch'](handleError(_0xeb1c68,null));};exports[_0x9fbe('0x45')]=function(_0x445310,_0x44c20c){var _0xb3aa32={'raw':!![],'where':{'id':_0x445310[_0x9fbe('0x46')]['id']}},_0x50c8b1={};_0x50c8b1[_0x9fbe('0x31')]=_[_0x9fbe('0x47')](db['CannedAnswer'][_0x9fbe('0x2d')]);_0x50c8b1[_0x9fbe('0x33')]=_[_0x9fbe('0x47')](_0x445310[_0x9fbe('0x33')]);_0x50c8b1[_0x9fbe('0x34')]=_[_0x9fbe('0x48')](_0x50c8b1[_0x9fbe('0x31')],_0x50c8b1[_0x9fbe('0x33')]);_0xb3aa32[_0x9fbe('0x35')]=_['intersection'](_0x50c8b1[_0x9fbe('0x31')],qs[_0x9fbe('0x36')](_0x445310['query'][_0x9fbe('0x36')]));_0xb3aa32[_0x9fbe('0x35')]=_0xb3aa32['attributes'][_0x9fbe('0x37')]?_0xb3aa32[_0x9fbe('0x35')]:_0x50c8b1[_0x9fbe('0x31')];if(_0x445310[_0x9fbe('0x33')]['includeAll']){_0xb3aa32[_0x9fbe('0x43')]=[{'all':!![]}];}_0xb3aa32=_[_0x9fbe('0x3e')]({},_0xb3aa32,_0x445310['options']);return db[_0x9fbe('0x40')]['find'](_0xb3aa32)[_0x9fbe('0x25')](handleEntityNotFound(_0x44c20c,null))['then'](respondWithResult(_0x44c20c,null))[_0x9fbe('0x49')](handleError(_0x44c20c,null));};exports[_0x9fbe('0x4a')]=function(_0x5262a8,_0x9dbd39){if(_0x5262a8[_0x9fbe('0x4b')]['id']){delete _0x5262a8['body']['id'];}return db['CannedAnswer'][_0x9fbe('0x4c')]({'where':{'id':_0x5262a8[_0x9fbe('0x46')]['id']}})[_0x9fbe('0x25')](handleEntityNotFound(_0x9dbd39,null))[_0x9fbe('0x25')](saveUpdates(_0x5262a8[_0x9fbe('0x4b')],null))['then'](respondWithResult(_0x9dbd39,null))[_0x9fbe('0x49')](handleError(_0x9dbd39,null));};exports[_0x9fbe('0x26')]=function(_0x4d02ae,_0x3a4bd6){return db[_0x9fbe('0x40')][_0x9fbe('0x4c')]({'where':{'id':_0x4d02ae['params']['id']}})[_0x9fbe('0x25')](handleEntityNotFound(_0x3a4bd6,null))['then'](removeEntity(_0x3a4bd6,null))[_0x9fbe('0x49')](handleError(_0x3a4bd6,null));};exports[_0x9fbe('0x4d')]=function(_0x954fa,_0x4eaa41){var _0x5ec925={'key':_0x954fa[_0x9fbe('0x4b')][_0x9fbe('0x30')]};if(_0x954fa[_0x9fbe('0x4b')][_0x9fbe('0x4e')]){_0x5ec925[_0x9fbe('0x4e')]=_0x954fa[_0x9fbe('0x4b')]['MailAccountId'];}else if(_0x954fa[_0x9fbe('0x4b')][_0x9fbe('0x4f')]){_0x5ec925[_0x9fbe('0x4f')]=_0x954fa[_0x9fbe('0x4b')][_0x9fbe('0x4f')];}else if(_0x954fa[_0x9fbe('0x4b')][_0x9fbe('0x50')]){_0x5ec925[_0x9fbe('0x50')]=_0x954fa[_0x9fbe('0x4b')][_0x9fbe('0x50')];}else if(_0x954fa[_0x9fbe('0x4b')][_0x9fbe('0x51')]){_0x5ec925[_0x9fbe('0x51')]=_0x954fa[_0x9fbe('0x4b')][_0x9fbe('0x51')];}return db[_0x9fbe('0x40')][_0x9fbe('0x4c')]({'where':_0x5ec925})[_0x9fbe('0x25')](function(_0x28a8f0){if(_0x28a8f0){throw new db[(_0x9fbe('0x52'))][(_0x9fbe('0x53'))](_0x9fbe('0x54'));}return db[_0x9fbe('0x40')][_0x9fbe('0x4d')](_0x954fa[_0x9fbe('0x4b')]);})[_0x9fbe('0x25')](function(_0x36948b){var _0x3ec10d=_0x954fa[_0x9fbe('0x55')]['get']({'plain':!![]});if(!_0x3ec10d)throw new Error(_0x9fbe('0x56'));if(_0x3ec10d['role']===_0x9fbe('0x55')){var _0x17da2d=_0x36948b['get']({'plain':!![]});return db[_0x9fbe('0x57')][_0x9fbe('0x4c')]({'where':{'name':_0x9fbe('0x27'),'userProfileId':_0x3ec10d[_0x9fbe('0x58')]},'raw':!![]})[_0x9fbe('0x25')](function(_0x2e0f25){if(_0x2e0f25&&_0x2e0f25[_0x9fbe('0x59')]===0x0){return db[_0x9fbe('0x28')][_0x9fbe('0x4d')]({'name':_0x17da2d['name'],'resourceId':_0x17da2d['id'],'type':_0x2e0f25[_0x9fbe('0x32')],'sectionId':_0x2e0f25['id']},{})[_0x9fbe('0x25')](function(){return _0x36948b;});}else{return _0x36948b;}})[_0x9fbe('0x49')](function(_0x4ca6af){logger['error'](_0x9fbe('0x5a'),_0x4ca6af);throw _0x4ca6af;});}return _0x36948b;})[_0x9fbe('0x25')](respondWithResult(_0x4eaa41,0xc9))[_0x9fbe('0x49')](handleError(_0x4eaa41,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 32fa5e9..f3744df 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 _0x29c9=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x29c9,0x189));var _0x929c=function(_0x4ff8aa,_0x3c2ae3){_0x4ff8aa=_0x4ff8aa-0x0;var _0x24f035=_0x29c9[_0x4ff8aa];return _0x24f035;};'use strict';var _=require(_0x929c('0x0'));var util=require(_0x929c('0x1'));var logger=require(_0x929c('0x2'))(_0x929c('0x3'));var moment=require(_0x929c('0x4'));var BPromise=require('bluebird');var rp=require(_0x929c('0x5'));var fs=require('fs');var path=require(_0x929c('0x6'));var rimraf=require(_0x929c('0x7'));var config=require(_0x929c('0x8'));var attributes=require(_0x929c('0x9'));module[_0x929c('0xa')]=function(_0x547baa,_0x161b59){return _0x547baa['define'](_0x929c('0xb'),attributes,{'tableName':_0x929c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x929c('0xd'),'collate':_0x929c('0xe')});}; \ No newline at end of file +var _0x9297=['bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9297,0x9b));var _0x7929=function(_0x9eb93b,_0x128db2){_0x9eb93b=_0x9eb93b-0x0;var _0x2f1c36=_0x9297[_0x9eb93b];return _0x2f1c36;};'use strict';var _=require(_0x7929('0x0'));var util=require(_0x7929('0x1'));var logger=require(_0x7929('0x2'))(_0x7929('0x3'));var moment=require(_0x7929('0x4'));var BPromise=require(_0x7929('0x5'));var rp=require(_0x7929('0x6'));var fs=require('fs');var path=require(_0x7929('0x7'));var rimraf=require(_0x7929('0x8'));var config=require(_0x7929('0x9'));var attributes=require(_0x7929('0xa'));module['exports']=function(_0xf7aebd,_0x9ebf9c){return _0xf7aebd[_0x7929('0xb')](_0x7929('0xc'),attributes,{'tableName':_0x7929('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7929('0xe'),'collate':_0x7929('0xf')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 713ca74..eb09cd4 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(_0x52f30b,_0x74123a){var _0x258c48=function(_0x4595b4){while(--_0x4595b4){_0x52f30b['push'](_0x52f30b['shift']());}};_0x258c48(++_0x74123a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x3a4d5c,_0x589f23){var _0x32b98a=function(_0x15e40b){while(--_0x15e40b){_0x3a4d5c['push'](_0x3a4d5c['shift']());}};_0x32b98a(++_0x589f23);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 8612d72..19a53b9 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 _0x4ac3=['isAuthenticated','/:id','show','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4ac3,0x1a6));var _0x34ac=function(_0x4cf3e4,_0x112297){_0x4cf3e4=_0x4cf3e4-0x0;var _0x38750c=_0x4ac3[_0x4cf3e4];return _0x38750c;};'use strict';var multer=require('multer');var util=require(_0x34ac('0x0'));var path=require(_0x34ac('0x1'));var timeout=require('connect-timeout');var express=require(_0x34ac('0x2'));var router=express[_0x34ac('0x3')]();var fs_extra=require(_0x34ac('0x4'));var auth=require(_0x34ac('0x5'));var interaction=require(_0x34ac('0x6'));var config=require(_0x34ac('0x7'));var controller=require(_0x34ac('0x8'));router[_0x34ac('0x9')]('/',auth[_0x34ac('0xa')](),controller['index']);router[_0x34ac('0x9')](_0x34ac('0xb'),auth['isAuthenticated'](),controller[_0x34ac('0xc')]);router['post']('/',auth[_0x34ac('0xa')](),controller['create']);router['put'](_0x34ac('0xb'),auth[_0x34ac('0xa')](),controller[_0x34ac('0xd')]);router[_0x34ac('0xe')](_0x34ac('0xb'),auth[_0x34ac('0xa')](),controller[_0x34ac('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2b1b=['index','/:id','update','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2b1b,0x91));var _0xb2b1=function(_0x58e15b,_0x35b622){_0x58e15b=_0x58e15b-0x0;var _0x5e5c5a=_0x2b1b[_0x58e15b];return _0x5e5c5a;};'use strict';var multer=require(_0xb2b1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb2b1('0x1'));var express=require(_0xb2b1('0x2'));var router=express[_0xb2b1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb2b1('0x4'));var interaction=require(_0xb2b1('0x5'));var config=require('../../config/environment');var controller=require(_0xb2b1('0x6'));router[_0xb2b1('0x7')]('/',auth[_0xb2b1('0x8')](),controller[_0xb2b1('0x9')]);router[_0xb2b1('0x7')](_0xb2b1('0xa'),auth[_0xb2b1('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb2b1('0xb')]);router['delete'](_0xb2b1('0xa'),auth[_0xb2b1('0x8')](),controller[_0xb2b1('0xc')]);module[_0xb2b1('0xd')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 7e46c1d..debcda8 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 _0xab26=['sequelize','exports','DATE','STRING','INTEGER'];(function(_0x57b032,_0xe9f215){var _0x5c3ed7=function(_0xac2a67){while(--_0xac2a67){_0x57b032['push'](_0x57b032['shift']());}};_0x5c3ed7(++_0xe9f215);}(_0xab26,0xd2));var _0x6ab2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xab26[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x6ab2('0x0'));module[_0x6ab2('0x1')]={'calldate':{'type':Sequelize[_0x6ab2('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x6ab2('0x3')]},'src':{'type':Sequelize[_0x6ab2('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6ab2('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x6ab2('0x3')]},'lastdata':{'type':Sequelize[_0x6ab2('0x3')]},'duration':{'type':Sequelize[_0x6ab2('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6ab2('0x3')]},'amaflags':{'type':Sequelize[_0x6ab2('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x6ab2('0x3')]},'uniqueid':{'type':Sequelize[_0x6ab2('0x3')]},'linkedid':{'type':Sequelize[_0x6ab2('0x3')]},'sequence':{'type':Sequelize[_0x6ab2('0x3')]},'peeraccount':{'type':Sequelize[_0x6ab2('0x3')]},'type':{'type':Sequelize[_0x6ab2('0x3')]},'tag':{'type':Sequelize[_0x6ab2('0x3')]}}; \ No newline at end of file +var _0x0269=['INTEGER','sequelize','DATE','STRING'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0269,0x135));var _0x9026=function(_0x3870ad,_0x241060){_0x3870ad=_0x3870ad-0x0;var _0x2a8969=_0x0269[_0x3870ad];return _0x2a8969;};'use strict';var Sequelize=require(_0x9026('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x9026('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x9026('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x9026('0x2')]},'dcontext':{'type':Sequelize[_0x9026('0x2')]},'channel':{'type':Sequelize[_0x9026('0x2')]},'dstchannel':{'type':Sequelize[_0x9026('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x9026('0x2')]},'duration':{'type':Sequelize[_0x9026('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9026('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x9026('0x2')]},'userfield':{'type':Sequelize[_0x9026('0x2')]},'uniqueid':{'type':Sequelize[_0x9026('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x9026('0x2')]},'peeraccount':{'type':Sequelize[_0x9026('0x2')]},'type':{'type':Sequelize[_0x9026('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 4c895bc..9c8697d 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 _0x25fa=['json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Cdr','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25fa,0x109));var _0xa25f=function(_0xdc5662,_0xaa941f){_0xdc5662=_0xdc5662-0x0;var _0x46cc6c=_0x25fa[_0xdc5662];return _0x46cc6c;};'use strict';var emlformat=require(_0xa25f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa25f('0x1'));var jsonpatch=require(_0xa25f('0x2'));var rp=require('request-promise');var moment=require(_0xa25f('0x3'));var BPromise=require(_0xa25f('0x4'));var Mustache=require(_0xa25f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa25f('0x6'));var csv=require('to-csv');var ejs=require(_0xa25f('0x7'));var fs=require('fs');var fs_extra=require(_0xa25f('0x8'));var _=require(_0xa25f('0x9'));var squel=require(_0xa25f('0xa'));var crypto=require(_0xa25f('0xb'));var jsforce=require(_0xa25f('0xc'));var deskjs=require(_0xa25f('0xd'));var toCsv=require(_0xa25f('0xe'));var querystring=require(_0xa25f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa25f('0x10'));var authService=require(_0xa25f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa25f('0x12'));var hardwareService=require(_0xa25f('0x13'));var logger=require(_0xa25f('0x14'))(_0xa25f('0x15'));var utils=require('../../config/utils');var config=require(_0xa25f('0x16'));var licenseUtil=require(_0xa25f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e970c,_0x465e41){_0x465e41=_0x465e41||0xcc;return function(_0x50bb78){if(_0x50bb78){return _0x3e970c[_0xa25f('0x18')](_0x465e41);}return _0x3e970c[_0xa25f('0x19')](_0x465e41)[_0xa25f('0x1a')]();};}function respondWithResult(_0x4b3792,_0x199e18){_0x199e18=_0x199e18||0xc8;return function(_0x2a627f){if(_0x2a627f){return _0x4b3792[_0xa25f('0x19')](_0x199e18)[_0xa25f('0x1b')](_0x2a627f);}};}function respondWithFilteredResult(_0x465809,_0x2d2417){return function(_0x1e5836){if(_0x1e5836){var _0x1859ba=typeof _0x2d2417['offset']===_0xa25f('0x1c')&&typeof _0x2d2417[_0xa25f('0x1d')]===_0xa25f('0x1c');var _0x451a6e=_0x1e5836[_0xa25f('0x1e')];var _0x427105=_0x1859ba?0x0:_0x2d2417['offset'];var _0x292171=_0x1859ba?_0x1e5836['count']:_0x2d2417[_0xa25f('0x1f')]+_0x2d2417['limit'];var _0x559c89;if(_0x292171>=_0x451a6e){_0x292171=_0x451a6e;_0x559c89=0xc8;}else{_0x559c89=0xce;}_0x465809[_0xa25f('0x19')](_0x559c89);return _0x465809['set'](_0xa25f('0x20'),_0x427105+'-'+_0x292171+'/'+_0x451a6e)[_0xa25f('0x1b')](_0x1e5836);}return null;};}function patchUpdates(_0x2aaf3a){return function(_0x3c2665){try{jsonpatch[_0xa25f('0x21')](_0x3c2665,_0x2aaf3a,!![]);}catch(_0x504135){return BPromise[_0xa25f('0x22')](_0x504135);}return _0x3c2665[_0xa25f('0x23')]();};}function saveUpdates(_0x371716,_0x14b7f6){return function(_0x5d2803){if(_0x5d2803){return _0x5d2803[_0xa25f('0x24')](_0x371716)[_0xa25f('0x25')](function(_0x248c0c){return _0x248c0c;});}return null;};}function removeEntity(_0x3675b5,_0x4c6f4d){return function(_0x2b710f){if(_0x2b710f){return _0x2b710f[_0xa25f('0x26')]()[_0xa25f('0x25')](function(){_0x3675b5[_0xa25f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2812d7,_0x898446){return function(_0x53f011){if(!_0x53f011){_0x2812d7[_0xa25f('0x18')](0x194);}return _0x53f011;};}function handleError(_0x51dbf8,_0x2df893){_0x2df893=_0x2df893||0x1f4;return function(_0x4eb7b7){logger[_0xa25f('0x27')](_0x4eb7b7[_0xa25f('0x28')]);if(_0x4eb7b7['name']){delete _0x4eb7b7[_0xa25f('0x29')];}_0x51dbf8[_0xa25f('0x19')](_0x2df893)['send'](_0x4eb7b7);};}exports[_0xa25f('0x2a')]=function(_0x5d39c7,_0x1030c4){var _0x41a847={},_0x472114={},_0x208518={'count':0x0,'rows':[]};var _0x334629=_['map'](db[_0xa25f('0x2b')][_0xa25f('0x2c')],function(_0x119ffc){return{'name':_0x119ffc[_0xa25f('0x2d')],'type':_0x119ffc[_0xa25f('0x2e')]['key']};});_0x472114[_0xa25f('0x2f')]=_[_0xa25f('0x30')](_0x334629,_0xa25f('0x29'));_0x472114[_0xa25f('0x31')]=_[_0xa25f('0x32')](_0x5d39c7[_0xa25f('0x31')]);_0x472114[_0xa25f('0x33')]=_[_0xa25f('0x34')](_0x472114[_0xa25f('0x2f')],_0x472114['query']);_0x41a847['attributes']=_['intersection'](_0x472114[_0xa25f('0x2f')],qs[_0xa25f('0x35')](_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x35')]));_0x41a847[_0xa25f('0x36')]=_0x41a847[_0xa25f('0x36')][_0xa25f('0x37')]?_0x41a847[_0xa25f('0x36')]:_0x472114[_0xa25f('0x2f')];if(!_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x38')]('nolimit')){_0x41a847['limit']=qs[_0xa25f('0x1d')](_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x1d')]);_0x41a847['offset']=qs['offset'](_0x5d39c7['query'][_0xa25f('0x1f')]);}_0x41a847[_0xa25f('0x39')]=qs[_0xa25f('0x3a')](_0x5d39c7['query']['sort']);_0x41a847[_0xa25f('0x3b')]=qs[_0xa25f('0x33')](_['pick'](_0x5d39c7['query'],_0x472114[_0xa25f('0x33')]),_0x334629);if(_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x3c')]){_0x41a847['where']=_[_0xa25f('0x3d')](_0x41a847[_0xa25f('0x3b')],{'$or':_[_0xa25f('0x30')](_0x334629,function(_0x49556e){if(_0x49556e['type']!==_0xa25f('0x3e')){var _0x44c9c8={};_0x44c9c8[_0x49556e[_0xa25f('0x29')]]={'$like':'%'+_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x3c')]+'%'};return _0x44c9c8;}})});}_0x41a847=_[_0xa25f('0x3d')]({},_0x41a847,_0x5d39c7[_0xa25f('0x3f')]);var _0x3382f4={'where':_0x41a847['where']};return db[_0xa25f('0x2b')][_0xa25f('0x1e')](_0x3382f4)[_0xa25f('0x25')](function(_0x2e886f){_0x208518[_0xa25f('0x1e')]=_0x2e886f;if(_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x40')]){_0x41a847[_0xa25f('0x41')]=[{'all':!![]}];}return db[_0xa25f('0x2b')][_0xa25f('0x42')](_0x41a847);})[_0xa25f('0x25')](function(_0x3267a0){_0x208518[_0xa25f('0x43')]=_0x3267a0;return _0x208518;})['then'](respondWithFilteredResult(_0x1030c4,_0x41a847))[_0xa25f('0x44')](handleError(_0x1030c4,null));};exports['show']=function(_0xace015,_0x320119){var _0x36afe4={'raw':!![],'where':{'id':_0xace015[_0xa25f('0x45')]['id']}},_0x559874={};_0x559874[_0xa25f('0x2f')]=_[_0xa25f('0x32')](db[_0xa25f('0x2b')]['rawAttributes']);_0x559874[_0xa25f('0x31')]=_[_0xa25f('0x32')](_0xace015[_0xa25f('0x31')]);_0x559874[_0xa25f('0x33')]=_[_0xa25f('0x34')](_0x559874[_0xa25f('0x2f')],_0x559874['query']);_0x36afe4[_0xa25f('0x36')]=_[_0xa25f('0x34')](_0x559874['model'],qs[_0xa25f('0x35')](_0xace015[_0xa25f('0x31')][_0xa25f('0x35')]));_0x36afe4[_0xa25f('0x36')]=_0x36afe4[_0xa25f('0x36')][_0xa25f('0x37')]?_0x36afe4[_0xa25f('0x36')]:_0x559874[_0xa25f('0x2f')];if(_0xace015[_0xa25f('0x31')][_0xa25f('0x40')]){_0x36afe4[_0xa25f('0x41')]=[{'all':!![]}];}_0x36afe4=_[_0xa25f('0x3d')]({},_0x36afe4,_0xace015[_0xa25f('0x3f')]);return db['Cdr'][_0xa25f('0x46')](_0x36afe4)[_0xa25f('0x25')](handleEntityNotFound(_0x320119,null))[_0xa25f('0x25')](respondWithResult(_0x320119,null))[_0xa25f('0x44')](handleError(_0x320119,null));};exports['create']=function(_0x34717c,_0x43888b){return db[_0xa25f('0x2b')]['create'](_0x34717c[_0xa25f('0x47')],{})[_0xa25f('0x25')](respondWithResult(_0x43888b,0xc9))[_0xa25f('0x44')](handleError(_0x43888b,null));};exports[_0xa25f('0x24')]=function(_0x18c9f2,_0x3b6d34){if(_0x18c9f2[_0xa25f('0x47')]['id']){delete _0x18c9f2[_0xa25f('0x47')]['id'];}return db['Cdr'][_0xa25f('0x46')]({'where':{'id':_0x18c9f2[_0xa25f('0x45')]['id']}})[_0xa25f('0x25')](handleEntityNotFound(_0x3b6d34,null))[_0xa25f('0x25')](saveUpdates(_0x18c9f2[_0xa25f('0x47')],null))[_0xa25f('0x25')](respondWithResult(_0x3b6d34,null))[_0xa25f('0x44')](handleError(_0x3b6d34,null));};exports[_0xa25f('0x26')]=function(_0x26a096,_0xe04d67){return db[_0xa25f('0x2b')][_0xa25f('0x46')]({'where':{'id':_0x26a096[_0xa25f('0x45')]['id']}})[_0xa25f('0x25')](handleEntityNotFound(_0xe04d67,null))[_0xa25f('0x25')](removeEntity(_0xe04d67,null))[_0xa25f('0x44')](handleError(_0xe04d67,null));};exports[_0xa25f('0x48')]=function(_0x2fedba,_0x32f719){return db[_0xa25f('0x2b')][_0xa25f('0x48')]()[_0xa25f('0x25')](respondWithResult(_0x32f719,null))['catch'](handleError(_0x32f719,null));}; \ No newline at end of file +var _0xe132=['model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','key'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xe132,0x162));var _0x2e13=function(_0x162c64,_0x2a8f0f){_0x162c64=_0x162c64-0x0;var _0x2b45f8=_0xe132[_0x162c64];return _0x2b45f8;};'use strict';var emlformat=require(_0x2e13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2e13('0x1'));var jsonpatch=require(_0x2e13('0x2'));var rp=require(_0x2e13('0x3'));var moment=require(_0x2e13('0x4'));var BPromise=require(_0x2e13('0x5'));var Mustache=require('mustache');var util=require(_0x2e13('0x6'));var path=require(_0x2e13('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e13('0x8'));var fs=require('fs');var fs_extra=require(_0x2e13('0x9'));var _=require(_0x2e13('0xa'));var squel=require(_0x2e13('0xb'));var crypto=require(_0x2e13('0xc'));var jsforce=require(_0x2e13('0xd'));var deskjs=require(_0x2e13('0xe'));var toCsv=require(_0x2e13('0xf'));var querystring=require(_0x2e13('0x10'));var Papa=require(_0x2e13('0x11'));var Redis=require('ioredis');var authService=require(_0x2e13('0x12'));var qs=require(_0x2e13('0x13'));var as=require(_0x2e13('0x14'));var hardwareService=require(_0x2e13('0x15'));var logger=require(_0x2e13('0x16'))(_0x2e13('0x17'));var utils=require(_0x2e13('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2e13('0x19'));var db=require(_0x2e13('0x1a'))['db'];function respondWithStatusCode(_0x320303,_0x299dd3){_0x299dd3=_0x299dd3||0xcc;return function(_0x424e58){if(_0x424e58){return _0x320303[_0x2e13('0x1b')](_0x299dd3);}return _0x320303[_0x2e13('0x1c')](_0x299dd3)['end']();};}function respondWithResult(_0xb70eb8,_0xea6c20){_0xea6c20=_0xea6c20||0xc8;return function(_0xfaca18){if(_0xfaca18){return _0xb70eb8['status'](_0xea6c20)[_0x2e13('0x1d')](_0xfaca18);}};}function respondWithFilteredResult(_0x2a58e5,_0x433bbd){return function(_0x5e96a5){if(_0x5e96a5){var _0xd25628=typeof _0x433bbd[_0x2e13('0x1e')]===_0x2e13('0x1f')&&typeof _0x433bbd['limit']==='undefined';var _0x2a3007=_0x5e96a5[_0x2e13('0x20')];var _0x336a10=_0xd25628?0x0:_0x433bbd[_0x2e13('0x1e')];var _0x399ce2=_0xd25628?_0x5e96a5[_0x2e13('0x20')]:_0x433bbd[_0x2e13('0x1e')]+_0x433bbd[_0x2e13('0x21')];var _0x4ae5e5;if(_0x399ce2>=_0x2a3007){_0x399ce2=_0x2a3007;_0x4ae5e5=0xc8;}else{_0x4ae5e5=0xce;}_0x2a58e5[_0x2e13('0x1c')](_0x4ae5e5);return _0x2a58e5[_0x2e13('0x22')](_0x2e13('0x23'),_0x336a10+'-'+_0x399ce2+'/'+_0x2a3007)[_0x2e13('0x1d')](_0x5e96a5);}return null;};}function patchUpdates(_0x479013){return function(_0x5d6938){try{jsonpatch[_0x2e13('0x24')](_0x5d6938,_0x479013,!![]);}catch(_0x1a05a4){return BPromise['reject'](_0x1a05a4);}return _0x5d6938['save']();};}function saveUpdates(_0x584040,_0x30f744){return function(_0x2b55a7){if(_0x2b55a7){return _0x2b55a7[_0x2e13('0x25')](_0x584040)[_0x2e13('0x26')](function(_0x17b453){return _0x17b453;});}return null;};}function removeEntity(_0x2416b3,_0x5ce58b){return function(_0x1482fc){if(_0x1482fc){return _0x1482fc[_0x2e13('0x27')]()[_0x2e13('0x26')](function(){_0x2416b3[_0x2e13('0x1c')](0xcc)[_0x2e13('0x28')]();});}};}function handleEntityNotFound(_0x3e5c24,_0x5cad4b){return function(_0x341ae7){if(!_0x341ae7){_0x3e5c24[_0x2e13('0x1b')](0x194);}return _0x341ae7;};}function handleError(_0x57aab0,_0x538984){_0x538984=_0x538984||0x1f4;return function(_0x15c555){logger[_0x2e13('0x29')](_0x15c555[_0x2e13('0x2a')]);if(_0x15c555['name']){delete _0x15c555[_0x2e13('0x2b')];}_0x57aab0[_0x2e13('0x1c')](_0x538984)[_0x2e13('0x2c')](_0x15c555);};}exports[_0x2e13('0x2d')]=function(_0x2c6e04,_0x428289){var _0x103867={},_0x19ee97={},_0x31f448={'count':0x0,'rows':[]};var _0x6e09d9=_[_0x2e13('0x2e')](db[_0x2e13('0x2f')][_0x2e13('0x30')],function(_0x28e2bf){return{'name':_0x28e2bf[_0x2e13('0x31')],'type':_0x28e2bf['type'][_0x2e13('0x32')]};});_0x19ee97[_0x2e13('0x33')]=_[_0x2e13('0x2e')](_0x6e09d9,'name');_0x19ee97['query']=_[_0x2e13('0x34')](_0x2c6e04[_0x2e13('0x35')]);_0x19ee97[_0x2e13('0x36')]=_[_0x2e13('0x37')](_0x19ee97[_0x2e13('0x33')],_0x19ee97[_0x2e13('0x35')]);_0x103867['attributes']=_['intersection'](_0x19ee97[_0x2e13('0x33')],qs[_0x2e13('0x38')](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x38')]));_0x103867[_0x2e13('0x39')]=_0x103867[_0x2e13('0x39')][_0x2e13('0x3a')]?_0x103867[_0x2e13('0x39')]:_0x19ee97['model'];if(!_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x3b')](_0x2e13('0x3c'))){_0x103867[_0x2e13('0x21')]=qs[_0x2e13('0x21')](_0x2c6e04['query'][_0x2e13('0x21')]);_0x103867[_0x2e13('0x1e')]=qs['offset'](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x1e')]);}_0x103867[_0x2e13('0x3d')]=qs['sort'](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x3e')]);_0x103867['where']=qs[_0x2e13('0x36')](_[_0x2e13('0x3f')](_0x2c6e04['query'],_0x19ee97[_0x2e13('0x36')]),_0x6e09d9);if(_0x2c6e04['query'][_0x2e13('0x40')]){_0x103867[_0x2e13('0x41')]=_['merge'](_0x103867[_0x2e13('0x41')],{'$or':_[_0x2e13('0x2e')](_0x6e09d9,function(_0x3839b9){if(_0x3839b9[_0x2e13('0x42')]!==_0x2e13('0x43')){var _0x778214={};_0x778214[_0x3839b9[_0x2e13('0x2b')]]={'$like':'%'+_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x40')]+'%'};return _0x778214;}})});}_0x103867=_[_0x2e13('0x44')]({},_0x103867,_0x2c6e04['options']);var _0x24ebb6={'where':_0x103867[_0x2e13('0x41')]};return db[_0x2e13('0x2f')][_0x2e13('0x20')](_0x24ebb6)[_0x2e13('0x26')](function(_0x4b23ca){_0x31f448[_0x2e13('0x20')]=_0x4b23ca;if(_0x2c6e04['query'][_0x2e13('0x45')]){_0x103867[_0x2e13('0x46')]=[{'all':!![]}];}return db['Cdr'][_0x2e13('0x47')](_0x103867);})['then'](function(_0x73f6a2){_0x31f448[_0x2e13('0x48')]=_0x73f6a2;return _0x31f448;})[_0x2e13('0x26')](respondWithFilteredResult(_0x428289,_0x103867))[_0x2e13('0x49')](handleError(_0x428289,null));};exports[_0x2e13('0x4a')]=function(_0x52b1a0,_0x425c97){var _0x499a56={'raw':!![],'where':{'id':_0x52b1a0[_0x2e13('0x4b')]['id']}},_0x10a1ab={};_0x10a1ab[_0x2e13('0x33')]=_[_0x2e13('0x34')](db[_0x2e13('0x2f')][_0x2e13('0x30')]);_0x10a1ab['query']=_['keys'](_0x52b1a0[_0x2e13('0x35')]);_0x10a1ab[_0x2e13('0x36')]=_['intersection'](_0x10a1ab[_0x2e13('0x33')],_0x10a1ab[_0x2e13('0x35')]);_0x499a56[_0x2e13('0x39')]=_['intersection'](_0x10a1ab['model'],qs[_0x2e13('0x38')](_0x52b1a0['query']['fields']));_0x499a56[_0x2e13('0x39')]=_0x499a56[_0x2e13('0x39')][_0x2e13('0x3a')]?_0x499a56['attributes']:_0x10a1ab[_0x2e13('0x33')];if(_0x52b1a0[_0x2e13('0x35')][_0x2e13('0x45')]){_0x499a56[_0x2e13('0x46')]=[{'all':!![]}];}_0x499a56=_['merge']({},_0x499a56,_0x52b1a0[_0x2e13('0x4c')]);return db['Cdr'][_0x2e13('0x4d')](_0x499a56)[_0x2e13('0x26')](handleEntityNotFound(_0x425c97,null))[_0x2e13('0x26')](respondWithResult(_0x425c97,null))[_0x2e13('0x49')](handleError(_0x425c97,null));};exports[_0x2e13('0x4e')]=function(_0x3be877,_0x961af7){return db[_0x2e13('0x2f')][_0x2e13('0x4e')](_0x3be877[_0x2e13('0x4f')],{})['then'](respondWithResult(_0x961af7,0xc9))[_0x2e13('0x49')](handleError(_0x961af7,null));};exports[_0x2e13('0x25')]=function(_0x4780b7,_0x1d13ec){if(_0x4780b7[_0x2e13('0x4f')]['id']){delete _0x4780b7[_0x2e13('0x4f')]['id'];}return db[_0x2e13('0x2f')][_0x2e13('0x4d')]({'where':{'id':_0x4780b7[_0x2e13('0x4b')]['id']}})[_0x2e13('0x26')](handleEntityNotFound(_0x1d13ec,null))[_0x2e13('0x26')](saveUpdates(_0x4780b7[_0x2e13('0x4f')],null))['then'](respondWithResult(_0x1d13ec,null))[_0x2e13('0x49')](handleError(_0x1d13ec,null));};exports[_0x2e13('0x27')]=function(_0x39cef0,_0xf40f35){return db[_0x2e13('0x2f')][_0x2e13('0x4d')]({'where':{'id':_0x39cef0['params']['id']}})[_0x2e13('0x26')](handleEntityNotFound(_0xf40f35,null))[_0x2e13('0x26')](removeEntity(_0xf40f35,null))[_0x2e13('0x49')](handleError(_0xf40f35,null));};exports[_0x2e13('0x50')]=function(_0x2a9587,_0x13b4f4){return db[_0x2e13('0x2f')]['describe']()[_0x2e13('0x26')](respondWithResult(_0x13b4f4,null))[_0x2e13('0x49')](handleError(_0x13b4f4,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index c058f3e..f82fa59 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5b2cfa,_0x262dc8){var _0x473b26=function(_0x3aeafc){while(--_0x3aeafc){_0x5b2cfa['push'](_0x5b2cfa['shift']());}};_0x473b26(++_0x262dc8);}(_0x7a54,0x106));var _0x47a5=function(_0x246c09,_0x4a3639){_0x246c09=_0x246c09-0x0;var _0x22d06a=_0x7a54[_0x246c09];return _0x22d06a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x359d45,_0x53b376){var _0x43f166=function(_0x4d8c8a){while(--_0x4d8c8a){_0x359d45['push'](_0x359d45['shift']());}};_0x43f166(++_0x53b376);}(_0x7a54,0x106));var _0x47a5=function(_0xdb538,_0x2b75ed){_0xdb538=_0xdb538-0x0;var _0x3595e3=_0x7a54[_0xdb538];return _0x3595e3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 8b18de2..372519b 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 _0xcd70=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x33975c,_0x50d085){var _0x1c15ab=function(_0x54e8bc){while(--_0x54e8bc){_0x33975c['push'](_0x33975c['shift']());}};_0x1c15ab(++_0x50d085);}(_0xcd70,0x126));var _0x0cd7=function(_0x2476fc,_0xe642c7){_0x2476fc=_0x2476fc-0x0;var _0x46c630=_0xcd70[_0x2476fc];return _0x46c630;};'use strict';var _=require(_0x0cd7('0x0'));var util=require(_0x0cd7('0x1'));var moment=require(_0x0cd7('0x2'));var BPromise=require(_0x0cd7('0x3'));var rs=require(_0x0cd7('0x4'));var fs=require('fs');var Redis=require(_0x0cd7('0x5'));var db=require(_0x0cd7('0x6'))['db'];var utils=require(_0x0cd7('0x7'));var logger=require(_0x0cd7('0x8'))(_0x0cd7('0x9'));var config=require(_0x0cd7('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0cd7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x64ba3c,_0x48b283,_0x4b7529){return new BPromise(function(_0x5d36f4,_0x4a0c4c){return client['request'](_0x64ba3c,_0x4b7529)[_0x0cd7('0xc')](function(_0x272f6d){logger['info'](_0x0cd7('0xd'),_0x48b283,_0x0cd7('0xe'));logger[_0x0cd7('0xf')](_0x0cd7('0x10'),_0x48b283,_0x0cd7('0xe'),JSON[_0x0cd7('0x11')](_0x272f6d));if(_0x272f6d[_0x0cd7('0x12')]){if(_0x272f6d[_0x0cd7('0x12')][_0x0cd7('0x13')]===0x1f4){logger[_0x0cd7('0x12')](_0x0cd7('0xd'),_0x48b283,_0x272f6d['error'][_0x0cd7('0x14')]);return _0x4a0c4c(_0x272f6d[_0x0cd7('0x12')][_0x0cd7('0x14')]);}logger[_0x0cd7('0x12')](_0x0cd7('0xd'),_0x48b283,_0x272f6d[_0x0cd7('0x12')][_0x0cd7('0x14')]);return _0x5d36f4(_0x272f6d[_0x0cd7('0x12')]['message']);}else{logger['info'](_0x0cd7('0xd'),_0x48b283,'request\x20sent');_0x5d36f4(_0x272f6d[_0x0cd7('0x15')]['message']);}})[_0x0cd7('0x16')](function(_0xc349ed){logger[_0x0cd7('0x12')](_0x0cd7('0xd'),_0x48b283,_0xc349ed);_0x4a0c4c(_0xc349ed);});});} \ No newline at end of file +var _0x1cf3=['client','http','request','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cf3,0x12c));var _0x31cf=function(_0x5d05eb,_0x3bd7d9){_0x5d05eb=_0x5d05eb-0x0;var _0x495076=_0x1cf3[_0x5d05eb];return _0x495076;};'use strict';var _=require(_0x31cf('0x0'));var util=require(_0x31cf('0x1'));var moment=require(_0x31cf('0x2'));var BPromise=require(_0x31cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31cf('0x4'));var db=require(_0x31cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x31cf('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x31cf('0x7'));var client=jayson[_0x31cf('0x8')][_0x31cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4abea7,_0x166309,_0x55a909){return new BPromise(function(_0x2f50d3,_0x1239c2){return client[_0x31cf('0xa')](_0x4abea7,_0x55a909)['then'](function(_0x12f112){logger[_0x31cf('0xb')](_0x31cf('0xc'),_0x166309,'request\x20sent');logger[_0x31cf('0xd')](_0x31cf('0xe'),_0x166309,_0x31cf('0xf'),JSON[_0x31cf('0x10')](_0x12f112));if(_0x12f112[_0x31cf('0x11')]){if(_0x12f112[_0x31cf('0x11')][_0x31cf('0x12')]===0x1f4){logger[_0x31cf('0x11')](_0x31cf('0xc'),_0x166309,_0x12f112['error'][_0x31cf('0x13')]);return _0x1239c2(_0x12f112[_0x31cf('0x11')][_0x31cf('0x13')]);}logger[_0x31cf('0x11')](_0x31cf('0xc'),_0x166309,_0x12f112['error'][_0x31cf('0x13')]);return _0x2f50d3(_0x12f112[_0x31cf('0x11')][_0x31cf('0x13')]);}else{logger[_0x31cf('0xb')](_0x31cf('0xc'),_0x166309,'request\x20sent');_0x2f50d3(_0x12f112[_0x31cf('0x14')][_0x31cf('0x13')]);}})[_0x31cf('0x15')](function(_0x266de6){logger['error'](_0x31cf('0xc'),_0x166309,_0x266de6);_0x1239c2(_0x266de6);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index ced50a6..4dd0326 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x27a848,_0x2dfc9a){var _0x57dbb0=function(_0x403443){while(--_0x403443){_0x27a848['push'](_0x27a848['shift']());}};_0x57dbb0(++_0x2dfc9a);}(_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 +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(_0x40f991,_0x576819){var _0x38eca2=function(_0x2a586f){while(--_0x2a586f){_0x40f991['push'](_0x40f991['shift']());}};_0x38eca2(++_0x576819);}(_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 8ddd66e..88c0460 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 _0xc97d=['*,*,*,*','sequelize','noop','TEXT','STRING'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0xc97d,0x1cd));var _0xdc97=function(_0xe6d35f,_0x5e88ce){_0xe6d35f=_0xe6d35f-0x0;var _0x41cc18=_0xc97d[_0xe6d35f];return _0x41cc18;};'use strict';var Sequelize=require(_0xdc97('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdc97('0x1')},'appdata':{'type':Sequelize[_0xdc97('0x2')]()},'description':{'type':Sequelize[_0xdc97('0x3')]},'interval':{'type':Sequelize[_0xdc97('0x3')],'defaultValue':_0xdc97('0x4')}}; \ No newline at end of file +var _0xcc6f=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xcc6f,0x1b6));var _0xfcc6=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xcc6f[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0xfcc6('0x0'));module[_0xfcc6('0x1')]={'priority':{'type':Sequelize[_0xfcc6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfcc6('0x3')],'allowNull':![],'defaultValue':_0xfcc6('0x4')},'appdata':{'type':Sequelize[_0xfcc6('0x5')]()},'description':{'type':Sequelize[_0xfcc6('0x3')]},'interval':{'type':Sequelize[_0xfcc6('0x3')],'defaultValue':_0xfcc6('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 738e942..c3a5239 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 _0xbbfa=['find','catch','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','end','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','merge','options'];(function(_0x3102f8,_0x3b08fc){var _0x119e9b=function(_0x5aa010){while(--_0x5aa010){_0x3102f8['push'](_0x3102f8['shift']());}};_0x119e9b(++_0x3b08fc);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x2e96de,_0x7b3fac){_0x2e96de=_0x2e96de-0x0;var _0x588f95=_0xbbfa[_0x2e96de];return _0x588f95;};'use strict';var emlformat=require(_0xabbf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabbf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabbf('0x2'));var moment=require(_0xabbf('0x3'));var BPromise=require(_0xabbf('0x4'));var Mustache=require(_0xabbf('0x5'));var util=require(_0xabbf('0x6'));var path=require(_0xabbf('0x7'));var sox=require(_0xabbf('0x8'));var csv=require(_0xabbf('0x9'));var ejs=require(_0xabbf('0xa'));var fs=require('fs');var fs_extra=require(_0xabbf('0xb'));var _=require(_0xabbf('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xabbf('0xd'));var toCsv=require(_0xabbf('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xabbf('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xabbf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabbf('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xabbf('0x11'));var config=require(_0xabbf('0x12'));var licenseUtil=require(_0xabbf('0x13'));var db=require(_0xabbf('0x14'))['db'];function respondWithStatusCode(_0x265487,_0x1cc1a0){_0x1cc1a0=_0x1cc1a0||0xcc;return function(_0x28fb83){if(_0x28fb83){return _0x265487[_0xabbf('0x15')](_0x1cc1a0);}return _0x265487[_0xabbf('0x16')](_0x1cc1a0)['end']();};}function respondWithResult(_0x3c85e8,_0x5e6866){_0x5e6866=_0x5e6866||0xc8;return function(_0x3c6e6d){if(_0x3c6e6d){return _0x3c85e8['status'](_0x5e6866)[_0xabbf('0x17')](_0x3c6e6d);}};}function respondWithFilteredResult(_0x23a44a,_0x1df763){return function(_0x13b970){if(_0x13b970){var _0x529af0=typeof _0x1df763[_0xabbf('0x18')]===_0xabbf('0x19')&&typeof _0x1df763[_0xabbf('0x1a')]===_0xabbf('0x19');var _0xbfddcf=_0x13b970['count'];var _0x4252e1=_0x529af0?0x0:_0x1df763[_0xabbf('0x18')];var _0x57002d=_0x529af0?_0x13b970[_0xabbf('0x1b')]:_0x1df763[_0xabbf('0x18')]+_0x1df763['limit'];var _0x1269d9;if(_0x57002d>=_0xbfddcf){_0x57002d=_0xbfddcf;_0x1269d9=0xc8;}else{_0x1269d9=0xce;}_0x23a44a[_0xabbf('0x16')](_0x1269d9);return _0x23a44a[_0xabbf('0x1c')]('Content-Range',_0x4252e1+'-'+_0x57002d+'/'+_0xbfddcf)['json'](_0x13b970);}return null;};}function patchUpdates(_0xdf7640){return function(_0x4d4efb){try{jsonpatch[_0xabbf('0x1d')](_0x4d4efb,_0xdf7640,!![]);}catch(_0x918fc8){return BPromise['reject'](_0x918fc8);}return _0x4d4efb['save']();};}function saveUpdates(_0x44248b,_0x45cf44){return function(_0x2eaa02){if(_0x2eaa02){return _0x2eaa02[_0xabbf('0x1e')](_0x44248b)[_0xabbf('0x1f')](function(_0x35313f){return _0x35313f;});}return null;};}function removeEntity(_0x17d684,_0x573d83){return function(_0x281b36){if(_0x281b36){return _0x281b36[_0xabbf('0x20')]()[_0xabbf('0x1f')](function(){_0x17d684['status'](0xcc)[_0xabbf('0x21')]();});}};}function handleEntityNotFound(_0x26ebc6,_0x26bd52){return function(_0x28a5a1){if(!_0x28a5a1){_0x26ebc6[_0xabbf('0x15')](0x194);}return _0x28a5a1;};}function handleError(_0x5861fb,_0x3a0eca){_0x3a0eca=_0x3a0eca||0x1f4;return function(_0x4ef7cf){logger['error'](_0x4ef7cf[_0xabbf('0x22')]);if(_0x4ef7cf[_0xabbf('0x23')]){delete _0x4ef7cf['name'];}_0x5861fb[_0xabbf('0x16')](_0x3a0eca)[_0xabbf('0x24')](_0x4ef7cf);};}exports['show']=function(_0x4f8ed7,_0x53e49a){var _0x58c8bc={'raw':!![],'where':{'id':_0x4f8ed7[_0xabbf('0x25')]['id']}},_0xf50e5f={};_0xf50e5f[_0xabbf('0x26')]=_[_0xabbf('0x27')](db[_0xabbf('0x28')][_0xabbf('0x29')]);_0xf50e5f[_0xabbf('0x2a')]=_[_0xabbf('0x27')](_0x4f8ed7[_0xabbf('0x2a')]);_0xf50e5f[_0xabbf('0x2b')]=_['intersection'](_0xf50e5f[_0xabbf('0x26')],_0xf50e5f['query']);_0x58c8bc[_0xabbf('0x2c')]=_[_0xabbf('0x2d')](_0xf50e5f['model'],qs[_0xabbf('0x2e')](_0x4f8ed7[_0xabbf('0x2a')][_0xabbf('0x2e')]));_0x58c8bc[_0xabbf('0x2c')]=_0x58c8bc[_0xabbf('0x2c')][_0xabbf('0x2f')]?_0x58c8bc[_0xabbf('0x2c')]:_0xf50e5f['model'];if(_0x4f8ed7['query'][_0xabbf('0x30')]){_0x58c8bc['include']=[{'all':!![]}];}_0x58c8bc=_[_0xabbf('0x31')]({},_0x58c8bc,_0x4f8ed7[_0xabbf('0x32')]);return db[_0xabbf('0x28')][_0xabbf('0x33')](_0x58c8bc)[_0xabbf('0x1f')](handleEntityNotFound(_0x53e49a,null))[_0xabbf('0x1f')](respondWithResult(_0x53e49a,null))[_0xabbf('0x34')](handleError(_0x53e49a,null));};exports['update']=function(_0xe24bdd,_0xf81f1f){if(_0xe24bdd[_0xabbf('0x35')]['id']){delete _0xe24bdd['body']['id'];}return db[_0xabbf('0x28')][_0xabbf('0x33')]({'where':{'id':_0xe24bdd[_0xabbf('0x25')]['id']}})[_0xabbf('0x1f')](handleEntityNotFound(_0xf81f1f,null))[_0xabbf('0x1f')](saveUpdates(_0xe24bdd[_0xabbf('0x35')],null))[_0xabbf('0x1f')](respondWithResult(_0xf81f1f,null))[_0xabbf('0x34')](handleError(_0xf81f1f,null));};exports[_0xabbf('0x20')]=function(_0x4b56c9,_0xb82cbe){return db[_0xabbf('0x28')][_0xabbf('0x33')]({'where':{'id':_0x4b56c9[_0xabbf('0x25')]['id']}})[_0xabbf('0x1f')](handleEntityNotFound(_0xb82cbe,null))['then'](removeEntity(_0xb82cbe,null))[_0xabbf('0x34')](handleError(_0xb82cbe,null));}; \ No newline at end of file +var _0xbc8b=['fields','length','includeAll','merge','options','find','catch','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','keys','ChatApplication','rawAttributes','query','model','attributes'];(function(_0x547839,_0x6ccef8){var _0x2904f=function(_0xf42a0c){while(--_0xf42a0c){_0x547839['push'](_0x547839['shift']());}};_0x2904f(++_0x6ccef8);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbc8b[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbc8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbc8('0x1'));var rp=require(_0xbbc8('0x2'));var moment=require(_0xbbc8('0x3'));var BPromise=require(_0xbbc8('0x4'));var Mustache=require(_0xbbc8('0x5'));var util=require(_0xbbc8('0x6'));var path=require('path');var sox=require(_0xbbc8('0x7'));var csv=require(_0xbbc8('0x8'));var ejs=require(_0xbbc8('0x9'));var fs=require('fs');var fs_extra=require(_0xbbc8('0xa'));var _=require(_0xbbc8('0xb'));var squel=require('squel');var crypto=require(_0xbbc8('0xc'));var jsforce=require(_0xbbc8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbbc8('0x8'));var querystring=require(_0xbbc8('0xe'));var Papa=require(_0xbbc8('0xf'));var Redis=require(_0xbbc8('0x10'));var authService=require(_0xbbc8('0x11'));var qs=require(_0xbbc8('0x12'));var as=require(_0xbbc8('0x13'));var hardwareService=require(_0xbbc8('0x14'));var logger=require(_0xbbc8('0x15'))(_0xbbc8('0x16'));var utils=require(_0xbbc8('0x17'));var config=require(_0xbbc8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbbc8('0x19'))['db'];function respondWithStatusCode(_0xc702ca,_0x1c4b00){_0x1c4b00=_0x1c4b00||0xcc;return function(_0x55b386){if(_0x55b386){return _0xc702ca['sendStatus'](_0x1c4b00);}return _0xc702ca[_0xbbc8('0x1a')](_0x1c4b00)['end']();};}function respondWithResult(_0x290045,_0x2add43){_0x2add43=_0x2add43||0xc8;return function(_0x1c76df){if(_0x1c76df){return _0x290045[_0xbbc8('0x1a')](_0x2add43)[_0xbbc8('0x1b')](_0x1c76df);}};}function respondWithFilteredResult(_0x1e9c27,_0x292cc2){return function(_0x1cd58e){if(_0x1cd58e){var _0x38bf2f=typeof _0x292cc2[_0xbbc8('0x1c')]===_0xbbc8('0x1d')&&typeof _0x292cc2[_0xbbc8('0x1e')]===_0xbbc8('0x1d');var _0x21a44b=_0x1cd58e['count'];var _0xc9a328=_0x38bf2f?0x0:_0x292cc2[_0xbbc8('0x1c')];var _0x38e642=_0x38bf2f?_0x1cd58e[_0xbbc8('0x1f')]:_0x292cc2['offset']+_0x292cc2[_0xbbc8('0x1e')];var _0x4f754f;if(_0x38e642>=_0x21a44b){_0x38e642=_0x21a44b;_0x4f754f=0xc8;}else{_0x4f754f=0xce;}_0x1e9c27[_0xbbc8('0x1a')](_0x4f754f);return _0x1e9c27[_0xbbc8('0x20')]('Content-Range',_0xc9a328+'-'+_0x38e642+'/'+_0x21a44b)[_0xbbc8('0x1b')](_0x1cd58e);}return null;};}function patchUpdates(_0x1f7576){return function(_0x14b069){try{jsonpatch[_0xbbc8('0x21')](_0x14b069,_0x1f7576,!![]);}catch(_0x1ec180){return BPromise[_0xbbc8('0x22')](_0x1ec180);}return _0x14b069[_0xbbc8('0x23')]();};}function saveUpdates(_0x58d198,_0x14af5b){return function(_0x5a1e00){if(_0x5a1e00){return _0x5a1e00[_0xbbc8('0x24')](_0x58d198)[_0xbbc8('0x25')](function(_0x3f22f2){return _0x3f22f2;});}return null;};}function removeEntity(_0x37acb1,_0x354312){return function(_0x521c11){if(_0x521c11){return _0x521c11[_0xbbc8('0x26')]()[_0xbbc8('0x25')](function(){_0x37acb1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fba6e,_0x2ee2dd){return function(_0x31fc9b){if(!_0x31fc9b){_0x4fba6e[_0xbbc8('0x27')](0x194);}return _0x31fc9b;};}function handleError(_0x11bdd5,_0x1a0129){_0x1a0129=_0x1a0129||0x1f4;return function(_0x15fd05){logger[_0xbbc8('0x28')](_0x15fd05[_0xbbc8('0x29')]);if(_0x15fd05['name']){delete _0x15fd05[_0xbbc8('0x2a')];}_0x11bdd5[_0xbbc8('0x1a')](_0x1a0129)[_0xbbc8('0x2b')](_0x15fd05);};}exports['show']=function(_0x186572,_0x239e64){var _0x4b0e0c={'raw':!![],'where':{'id':_0x186572['params']['id']}},_0x130758={};_0x130758['model']=_[_0xbbc8('0x2c')](db[_0xbbc8('0x2d')][_0xbbc8('0x2e')]);_0x130758[_0xbbc8('0x2f')]=_[_0xbbc8('0x2c')](_0x186572[_0xbbc8('0x2f')]);_0x130758['filters']=_['intersection'](_0x130758[_0xbbc8('0x30')],_0x130758[_0xbbc8('0x2f')]);_0x4b0e0c[_0xbbc8('0x31')]=_['intersection'](_0x130758[_0xbbc8('0x30')],qs[_0xbbc8('0x32')](_0x186572[_0xbbc8('0x2f')][_0xbbc8('0x32')]));_0x4b0e0c[_0xbbc8('0x31')]=_0x4b0e0c[_0xbbc8('0x31')][_0xbbc8('0x33')]?_0x4b0e0c[_0xbbc8('0x31')]:_0x130758[_0xbbc8('0x30')];if(_0x186572[_0xbbc8('0x2f')][_0xbbc8('0x34')]){_0x4b0e0c['include']=[{'all':!![]}];}_0x4b0e0c=_[_0xbbc8('0x35')]({},_0x4b0e0c,_0x186572[_0xbbc8('0x36')]);return db[_0xbbc8('0x2d')][_0xbbc8('0x37')](_0x4b0e0c)[_0xbbc8('0x25')](handleEntityNotFound(_0x239e64,null))[_0xbbc8('0x25')](respondWithResult(_0x239e64,null))[_0xbbc8('0x38')](handleError(_0x239e64,null));};exports[_0xbbc8('0x24')]=function(_0x2ee0ce,_0x146114){if(_0x2ee0ce['body']['id']){delete _0x2ee0ce[_0xbbc8('0x39')]['id'];}return db[_0xbbc8('0x2d')][_0xbbc8('0x37')]({'where':{'id':_0x2ee0ce[_0xbbc8('0x3a')]['id']}})[_0xbbc8('0x25')](handleEntityNotFound(_0x146114,null))[_0xbbc8('0x25')](saveUpdates(_0x2ee0ce['body'],null))[_0xbbc8('0x25')](respondWithResult(_0x146114,null))[_0xbbc8('0x38')](handleError(_0x146114,null));};exports[_0xbbc8('0x26')]=function(_0xe07825,_0x498a16){return db[_0xbbc8('0x2d')][_0xbbc8('0x37')]({'where':{'id':_0xe07825[_0xbbc8('0x3a')]['id']}})[_0xbbc8('0x25')](handleEntityNotFound(_0x498a16,null))[_0xbbc8('0x25')](removeEntity(_0x498a16,null))['catch'](handleError(_0x498a16,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index aac7b2c..7b16637 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 _0x0884=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1bc089,_0x5ab38){var _0x5382be=function(_0x5e5062){while(--_0x5e5062){_0x1bc089['push'](_0x1bc089['shift']());}};_0x5382be(++_0x5ab38);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4088('0x0'));var util=require(_0x4088('0x1'));var logger=require(_0x4088('0x2'))(_0x4088('0x3'));var moment=require(_0x4088('0x4'));var BPromise=require(_0x4088('0x5'));var rp=require(_0x4088('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4088('0x7'));var config=require(_0x4088('0x8'));var attributes=require(_0x4088('0x9'));module[_0x4088('0xa')]=function(_0x3b1d74,_0x4da2f7){return _0x3b1d74['define'](_0x4088('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4088('0xc'),'collate':_0x4088('0xd')});}; \ No newline at end of file +var _0xef3c=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatApplication','chat_applications','utf8mb4'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0xef3c,0x143));var _0xcef3=function(_0x2e58bc,_0x5d0f4b){_0x2e58bc=_0x2e58bc-0x0;var _0x15559c=_0xef3c[_0x2e58bc];return _0x15559c;};'use strict';var _=require(_0xcef3('0x0'));var util=require(_0xcef3('0x1'));var logger=require(_0xcef3('0x2'))(_0xcef3('0x3'));var moment=require(_0xcef3('0x4'));var BPromise=require(_0xcef3('0x5'));var rp=require(_0xcef3('0x6'));var fs=require('fs');var path=require(_0xcef3('0x7'));var rimraf=require(_0xcef3('0x8'));var config=require(_0xcef3('0x9'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x36bfa7,_0x45f966){return _0x36bfa7['define'](_0xcef3('0xa'),attributes,{'tableName':_0xcef3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcef3('0xc'),'collate':_0xcef3('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 24a6e00..37ca1e9 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 _0x1472=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','code','error'];(function(_0x39cdb8,_0x15ee98){var _0x44bbc9=function(_0x395338){while(--_0x395338){_0x39cdb8['push'](_0x39cdb8['shift']());}};_0x44bbc9(++_0x15ee98);}(_0x1472,0x15c));var _0x2147=function(_0x45161c,_0x5494fc){_0x45161c=_0x45161c-0x0;var _0x186581=_0x1472[_0x45161c];return _0x186581;};'use strict';var _=require(_0x2147('0x0'));var util=require(_0x2147('0x1'));var moment=require('moment');var BPromise=require(_0x2147('0x2'));var rs=require(_0x2147('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2147('0x4'))['db'];var utils=require(_0x2147('0x5'));var logger=require(_0x2147('0x6'))(_0x2147('0x7'));var config=require('../../config/environment');var jayson=require(_0x2147('0x8'));var client=jayson[_0x2147('0x9')][_0x2147('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cd05a,_0xe9b010,_0x54f326){return new BPromise(function(_0x1a71cd,_0x46b72e){return client[_0x2147('0xb')](_0x1cd05a,_0x54f326)[_0x2147('0xc')](function(_0x5efa8e){logger[_0x2147('0xd')](_0x2147('0xe'),_0xe9b010,'request\x20sent');logger[_0x2147('0xf')](_0x2147('0x10'),_0xe9b010,_0x2147('0x11'),JSON['stringify'](_0x5efa8e));if(_0x5efa8e['error']){if(_0x5efa8e['error'][_0x2147('0x12')]===0x1f4){logger[_0x2147('0x13')](_0x2147('0xe'),_0xe9b010,_0x5efa8e[_0x2147('0x13')][_0x2147('0x14')]);return _0x46b72e(_0x5efa8e[_0x2147('0x13')]['message']);}logger[_0x2147('0x13')](_0x2147('0xe'),_0xe9b010,_0x5efa8e[_0x2147('0x13')][_0x2147('0x14')]);return _0x1a71cd(_0x5efa8e[_0x2147('0x13')][_0x2147('0x14')]);}else{logger[_0x2147('0xd')]('ChatApplication,\x20%s,\x20%s',_0xe9b010,_0x2147('0x11'));_0x1a71cd(_0x5efa8e[_0x2147('0x15')][_0x2147('0x14')]);}})[_0x2147('0x16')](function(_0x35a61b){logger['error']('ChatApplication,\x20%s,\x20%s',_0xe9b010,_0x35a61b);_0x46b72e(_0x35a61b);});});} \ No newline at end of file +var _0x6b83=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatApplication,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird'];(function(_0x2bb66c,_0x36c6c6){var _0x1e0f98=function(_0x1e3412){while(--_0x1e3412){_0x2bb66c['push'](_0x2bb66c['shift']());}};_0x1e0f98(++_0x36c6c6);}(_0x6b83,0x7b));var _0x36b8=function(_0x4adff1,_0x4a8cbe){_0x4adff1=_0x4adff1-0x0;var _0x318759=_0x6b83[_0x4adff1];return _0x318759;};'use strict';var _=require(_0x36b8('0x0'));var util=require(_0x36b8('0x1'));var moment=require('moment');var BPromise=require(_0x36b8('0x2'));var rs=require(_0x36b8('0x3'));var fs=require('fs');var Redis=require(_0x36b8('0x4'));var db=require(_0x36b8('0x5'))['db'];var utils=require(_0x36b8('0x6'));var logger=require(_0x36b8('0x7'))(_0x36b8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x36b8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c8d1f,_0x49252a,_0x30408a){return new BPromise(function(_0x462e27,_0x22e2b5){return client[_0x36b8('0xa')](_0x1c8d1f,_0x30408a)['then'](function(_0x597a22){logger['info']('ChatApplication,\x20%s,\x20%s',_0x49252a,_0x36b8('0xb'));logger[_0x36b8('0xc')](_0x36b8('0xd'),_0x49252a,'request\x20sent',JSON[_0x36b8('0xe')](_0x597a22));if(_0x597a22['error']){if(_0x597a22[_0x36b8('0xf')]['code']===0x1f4){logger[_0x36b8('0xf')]('ChatApplication,\x20%s,\x20%s',_0x49252a,_0x597a22['error'][_0x36b8('0x10')]);return _0x22e2b5(_0x597a22[_0x36b8('0xf')][_0x36b8('0x10')]);}logger[_0x36b8('0xf')](_0x36b8('0x11'),_0x49252a,_0x597a22['error']['message']);return _0x462e27(_0x597a22['error'][_0x36b8('0x10')]);}else{logger[_0x36b8('0x12')](_0x36b8('0x11'),_0x49252a,_0x36b8('0xb'));_0x462e27(_0x597a22[_0x36b8('0x13')][_0x36b8('0x10')]);}})[_0x36b8('0x14')](function(_0x51c4a9){logger[_0x36b8('0xf')]('ChatApplication,\x20%s,\x20%s',_0x49252a,_0x51c4a9);_0x22e2b5(_0x51c4a9);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 2eca9da..169f53c 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 _0x5777=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5777,0x1c5));var _0x7577=function(_0x1c09ba,_0x5eb0c0){_0x1c09ba=_0x1c09ba-0x0;var _0x4b3a39=_0x5777[_0x1c09ba];return _0x4b3a39;};'use strict';var multer=require(_0x7577('0x0'));var util=require(_0x7577('0x1'));var path=require(_0x7577('0x2'));var timeout=require(_0x7577('0x3'));var express=require(_0x7577('0x4'));var router=express[_0x7577('0x5')]();var fs_extra=require(_0x7577('0x6'));var auth=require(_0x7577('0x7'));var interaction=require(_0x7577('0x8'));var config=require(_0x7577('0x9'));var controller=require(_0x7577('0xa'));router[_0x7577('0xb')](_0x7577('0xc'),auth[_0x7577('0xd')](),controller[_0x7577('0xe')]);router[_0x7577('0xf')](_0x7577('0xc'),auth[_0x7577('0xd')](),controller[_0x7577('0x10')]);router[_0x7577('0x11')]('/:id',auth[_0x7577('0xd')](),controller[_0x7577('0x12')]);module['exports']=router; \ No newline at end of file +var _0x658c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','put','update','destroy','exports','path'];(function(_0x49ad79,_0x48ee93){var _0xa4e38a=function(_0x4925c7){while(--_0x4925c7){_0x49ad79['push'](_0x49ad79['shift']());}};_0xa4e38a(++_0x48ee93);}(_0x658c,0x1ee));var _0xc658=function(_0x7d2841,_0x46d9f9){_0x7d2841=_0x7d2841-0x0;var _0x57dc74=_0x658c[_0x7d2841];return _0x57dc74;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc658('0x0'));var timeout=require(_0xc658('0x1'));var express=require(_0xc658('0x2'));var router=express[_0xc658('0x3')]();var fs_extra=require(_0xc658('0x4'));var auth=require(_0xc658('0x5'));var interaction=require(_0xc658('0x6'));var config=require(_0xc658('0x7'));var controller=require('./chatApplication.controller');router['get'](_0xc658('0x8'),auth[_0xc658('0x9')](),controller[_0xc658('0xa')]);router[_0xc658('0xb')]('/:id',auth[_0xc658('0x9')](),controller[_0xc658('0xc')]);router['delete'](_0xc658('0x8'),auth['isAuthenticated'](),controller[_0xc658('0xd')]);module[_0xc658('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 582aab1..53335ee 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 _0xe730=['STRING','sequelize','exports'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xe730,0xb5));var _0x0e73=function(_0x4c1fbc,_0x18aa21){_0x4c1fbc=_0x4c1fbc-0x0;var _0x48d0f7=_0xe730[_0x4c1fbc];return _0x48d0f7;};'use strict';var Sequelize=require(_0x0e73('0x0'));module[_0x0e73('0x1')]={'name':{'type':Sequelize[_0x0e73('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4329=['exports','STRING','BOOLEAN','sequelize'];(function(_0x22e4a2,_0x2023f8){var _0x5a213a=function(_0x2e72a1){while(--_0x2e72a1){_0x22e4a2['push'](_0x22e4a2['shift']());}};_0x5a213a(++_0x2023f8);}(_0x4329,0x13b));var _0x9432=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x4329[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x9432('0x0'));module[_0x9432('0x1')]={'name':{'type':Sequelize[_0x9432('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9432('0x2')]},'write':{'type':Sequelize[_0x9432('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index e365677..5fecd3d 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 _0x3d71=['pick','filter','VIRTUAL','merge','includeAll','ChatGroup','findAll','rows','show','params','include','options','find','catch','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','hasOwnProperty','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x5ef4f6,_0x5f353f){var _0x3d71d3=function(_0x588355){while(--_0x588355){_0x5ef4f6['push'](_0x5ef4f6['shift']());}};_0x3d71d3(++_0x5f353f);}(_0x3d71,0x14d));var _0x13d7=function(_0x4292c1,_0x4c13a8){_0x4292c1=_0x4292c1-0x0;var _0x184785=_0x3d71[_0x4292c1];return _0x184785;};'use strict';var emlformat=require(_0x13d7('0x0'));var rimraf=require(_0x13d7('0x1'));var zipdir=require(_0x13d7('0x2'));var jsonpatch=require(_0x13d7('0x3'));var rp=require(_0x13d7('0x4'));var moment=require(_0x13d7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x13d7('0x6'));var sox=require('sox');var csv=require(_0x13d7('0x7'));var ejs=require(_0x13d7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x13d7('0x9'));var squel=require(_0x13d7('0xa'));var crypto=require(_0x13d7('0xb'));var jsforce=require(_0x13d7('0xc'));var deskjs=require(_0x13d7('0xd'));var toCsv=require(_0x13d7('0x7'));var querystring=require(_0x13d7('0xe'));var Papa=require('papaparse');var Redis=require(_0x13d7('0xf'));var authService=require(_0x13d7('0x10'));var qs=require(_0x13d7('0x11'));var as=require(_0x13d7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x13d7('0x13'))(_0x13d7('0x14'));var utils=require(_0x13d7('0x15'));var config=require(_0x13d7('0x16'));var licenseUtil=require(_0x13d7('0x17'));var db=require(_0x13d7('0x18'))['db'];config[_0x13d7('0x19')]=_[_0x13d7('0x1a')](config['redis'],{'host':_0x13d7('0x1b'),'port':0x18eb});var socket=require(_0x13d7('0x1c'))(new Redis(config[_0x13d7('0x19')]));require(_0x13d7('0x1d'))['register'](socket);function respondWithStatusCode(_0x36fdc3,_0x41f62a){_0x41f62a=_0x41f62a||0xcc;return function(_0xb2722d){if(_0xb2722d){return _0x36fdc3[_0x13d7('0x1e')](_0x41f62a);}return _0x36fdc3[_0x13d7('0x1f')](_0x41f62a)[_0x13d7('0x20')]();};}function respondWithResult(_0x466ce6,_0x2feb61){_0x2feb61=_0x2feb61||0xc8;return function(_0x1f15f3){if(_0x1f15f3){return _0x466ce6[_0x13d7('0x1f')](_0x2feb61)[_0x13d7('0x21')](_0x1f15f3);}};}function respondWithFilteredResult(_0x240c48,_0x2477b5){return function(_0x31cb8d){if(_0x31cb8d){var _0x4ed4a9=typeof _0x2477b5[_0x13d7('0x22')]===_0x13d7('0x23')&&typeof _0x2477b5[_0x13d7('0x24')]===_0x13d7('0x23');var _0x2694ab=_0x31cb8d[_0x13d7('0x25')];var _0x34bf29=_0x4ed4a9?0x0:_0x2477b5[_0x13d7('0x22')];var _0x1e4c93=_0x4ed4a9?_0x31cb8d[_0x13d7('0x25')]:_0x2477b5[_0x13d7('0x22')]+_0x2477b5['limit'];var _0x28d879;if(_0x1e4c93>=_0x2694ab){_0x1e4c93=_0x2694ab;_0x28d879=0xc8;}else{_0x28d879=0xce;}_0x240c48[_0x13d7('0x1f')](_0x28d879);return _0x240c48['set']('Content-Range',_0x34bf29+'-'+_0x1e4c93+'/'+_0x2694ab)[_0x13d7('0x21')](_0x31cb8d);}return null;};}function patchUpdates(_0x3a7151){return function(_0x541b14){try{jsonpatch[_0x13d7('0x26')](_0x541b14,_0x3a7151,!![]);}catch(_0x40b584){return BPromise['reject'](_0x40b584);}return _0x541b14[_0x13d7('0x27')]();};}function saveUpdates(_0x468944,_0x27980a){return function(_0x293c06){if(_0x293c06){return _0x293c06['update'](_0x468944)[_0x13d7('0x28')](function(_0x3fc84b){return _0x3fc84b;});}return null;};}function removeEntity(_0x4d1217,_0x1670ea){return function(_0x32e2c3){if(_0x32e2c3){return _0x32e2c3[_0x13d7('0x29')]()[_0x13d7('0x28')](function(){_0x4d1217[_0x13d7('0x1f')](0xcc)[_0x13d7('0x20')]();});}};}function handleEntityNotFound(_0x4a01af,_0x2e4dd5){return function(_0x28b1bf){if(!_0x28b1bf){_0x4a01af[_0x13d7('0x1e')](0x194);}return _0x28b1bf;};}function handleError(_0x3fdf93,_0x425601){_0x425601=_0x425601||0x1f4;return function(_0x2f67cf){logger[_0x13d7('0x2a')](_0x2f67cf[_0x13d7('0x2b')]);if(_0x2f67cf['name']){delete _0x2f67cf[_0x13d7('0x2c')];}_0x3fdf93[_0x13d7('0x1f')](_0x425601)[_0x13d7('0x2d')](_0x2f67cf);};}exports['index']=function(_0x128349,_0x49cb8b){var _0x3672fc={},_0x51dfa8={},_0xcb8a15={'count':0x0,'rows':[]};var _0x57ff36=_['map'](db['ChatGroup'][_0x13d7('0x2e')],function(_0x3556d9){return{'name':_0x3556d9[_0x13d7('0x2f')],'type':_0x3556d9[_0x13d7('0x30')][_0x13d7('0x31')]};});_0x51dfa8[_0x13d7('0x32')]=_[_0x13d7('0x33')](_0x57ff36,'name');_0x51dfa8[_0x13d7('0x34')]=_[_0x13d7('0x35')](_0x128349[_0x13d7('0x34')]);_0x51dfa8[_0x13d7('0x36')]=_[_0x13d7('0x37')](_0x51dfa8[_0x13d7('0x32')],_0x51dfa8['query']);_0x3672fc[_0x13d7('0x38')]=_[_0x13d7('0x37')](_0x51dfa8[_0x13d7('0x32')],qs[_0x13d7('0x39')](_0x128349[_0x13d7('0x34')][_0x13d7('0x39')]));_0x3672fc[_0x13d7('0x38')]=_0x3672fc[_0x13d7('0x38')][_0x13d7('0x3a')]?_0x3672fc[_0x13d7('0x38')]:_0x51dfa8[_0x13d7('0x32')];if(!_0x128349[_0x13d7('0x34')]['hasOwnProperty'](_0x13d7('0x3b'))){_0x3672fc['limit']=qs[_0x13d7('0x24')](_0x128349[_0x13d7('0x34')]['limit']);_0x3672fc[_0x13d7('0x22')]=qs[_0x13d7('0x22')](_0x128349[_0x13d7('0x34')][_0x13d7('0x22')]);}_0x3672fc[_0x13d7('0x3c')]=qs[_0x13d7('0x3d')](_0x128349[_0x13d7('0x34')][_0x13d7('0x3d')]);_0x3672fc[_0x13d7('0x3e')]=qs[_0x13d7('0x36')](_[_0x13d7('0x3f')](_0x128349[_0x13d7('0x34')],_0x51dfa8['filters']),_0x57ff36);if(_0x128349[_0x13d7('0x34')][_0x13d7('0x40')]){_0x3672fc[_0x13d7('0x3e')]=_['merge'](_0x3672fc[_0x13d7('0x3e')],{'$or':_[_0x13d7('0x33')](_0x57ff36,function(_0x455431){if(_0x455431[_0x13d7('0x30')]!==_0x13d7('0x41')){var _0x157c2c={};_0x157c2c[_0x455431['name']]={'$like':'%'+_0x128349[_0x13d7('0x34')][_0x13d7('0x40')]+'%'};return _0x157c2c;}})});}_0x3672fc=_[_0x13d7('0x42')]({},_0x3672fc,_0x128349['options']);var _0x2c8deb={'where':_0x3672fc[_0x13d7('0x3e')]};return db['ChatGroup'][_0x13d7('0x25')](_0x2c8deb)[_0x13d7('0x28')](function(_0x4b395f){_0xcb8a15[_0x13d7('0x25')]=_0x4b395f;if(_0x128349[_0x13d7('0x34')][_0x13d7('0x43')]){_0x3672fc['include']=[{'all':!![]}];}return db[_0x13d7('0x44')][_0x13d7('0x45')](_0x3672fc);})[_0x13d7('0x28')](function(_0x131bf6){_0xcb8a15[_0x13d7('0x46')]=_0x131bf6;return _0xcb8a15;})[_0x13d7('0x28')](respondWithFilteredResult(_0x49cb8b,_0x3672fc))['catch'](handleError(_0x49cb8b,null));};exports[_0x13d7('0x47')]=function(_0x4c392f,_0x416147){var _0xcfe8de={'raw':!![],'where':{'id':_0x4c392f[_0x13d7('0x48')]['id']}},_0x1f4263={};_0x1f4263['model']=_[_0x13d7('0x35')](db[_0x13d7('0x44')][_0x13d7('0x2e')]);_0x1f4263[_0x13d7('0x34')]=_['keys'](_0x4c392f[_0x13d7('0x34')]);_0x1f4263[_0x13d7('0x36')]=_[_0x13d7('0x37')](_0x1f4263[_0x13d7('0x32')],_0x1f4263[_0x13d7('0x34')]);_0xcfe8de['attributes']=_[_0x13d7('0x37')](_0x1f4263[_0x13d7('0x32')],qs[_0x13d7('0x39')](_0x4c392f[_0x13d7('0x34')]['fields']));_0xcfe8de[_0x13d7('0x38')]=_0xcfe8de[_0x13d7('0x38')][_0x13d7('0x3a')]?_0xcfe8de[_0x13d7('0x38')]:_0x1f4263[_0x13d7('0x32')];if(_0x4c392f[_0x13d7('0x34')][_0x13d7('0x43')]){_0xcfe8de[_0x13d7('0x49')]=[{'all':!![]}];}_0xcfe8de=_[_0x13d7('0x42')]({},_0xcfe8de,_0x4c392f[_0x13d7('0x4a')]);return db[_0x13d7('0x44')][_0x13d7('0x4b')](_0xcfe8de)[_0x13d7('0x28')](handleEntityNotFound(_0x416147,null))[_0x13d7('0x28')](respondWithResult(_0x416147,null))[_0x13d7('0x4c')](handleError(_0x416147,null));};exports[_0x13d7('0x4d')]=function(_0x4047b7,_0x2dd782){return db[_0x13d7('0x44')][_0x13d7('0x4d')](_0x4047b7[_0x13d7('0x4e')],{})[_0x13d7('0x28')](respondWithResult(_0x2dd782,0xc9))['catch'](handleError(_0x2dd782,null));};exports[_0x13d7('0x4f')]=function(_0x2ba2f2,_0x5ec376){if(_0x2ba2f2[_0x13d7('0x4e')]['id']){delete _0x2ba2f2[_0x13d7('0x4e')]['id'];}return db[_0x13d7('0x44')]['find']({'where':{'id':_0x2ba2f2[_0x13d7('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ec376,null))[_0x13d7('0x28')](saveUpdates(_0x2ba2f2[_0x13d7('0x4e')],null))[_0x13d7('0x28')](respondWithResult(_0x5ec376,null))[_0x13d7('0x4c')](handleError(_0x5ec376,null));};exports['destroy']=function(_0x1aafd5,_0x13ca6b){return db['ChatGroup'][_0x13d7('0x4b')]({'where':{'id':_0x1aafd5[_0x13d7('0x48')]['id']}})[_0x13d7('0x28')](handleEntityNotFound(_0x13ca6b,null))[_0x13d7('0x28')](removeEntity(_0x13ca6b,null))['catch'](handleError(_0x13ca6b,null));};exports['describe']=function(_0x1efc68,_0x5de6f5){return db[_0x13d7('0x44')][_0x13d7('0x50')]()[_0x13d7('0x28')](respondWithResult(_0x5de6f5,null))['catch'](handleError(_0x5de6f5,null));};exports[_0x13d7('0x51')]=function(_0x873443,_0x2c60d8,_0x55c573){return db[_0x13d7('0x52')][_0x13d7('0x25')]({'where':{'ChatGroupId':_0x873443[_0x13d7('0x48')]['id'],'ToId':_0x873443[_0x13d7('0x53')]['id'],'read':![]}})[_0x13d7('0x28')](function(_0x130d25){return{'id':_[_0x13d7('0x54')](_0x873443['params']['id']),'count':_0x130d25};})[_0x13d7('0x28')](respondWithResult(_0x2c60d8,null))[_0x13d7('0x4c')](handleError(_0x2c60d8,null));};exports['addMembers']=function(_0x5eaf43,_0x428f24,_0x456a38){return db[_0x13d7('0x44')][_0x13d7('0x4b')]({'where':{'id':_0x5eaf43['params']['id']}})[_0x13d7('0x28')](handleEntityNotFound(_0x428f24,null))[_0x13d7('0x28')](function(_0x12bf86){if(_0x12bf86){return _0x12bf86[_0x13d7('0x55')](_0x5eaf43['body'][_0x13d7('0x56')],_[_0x13d7('0x57')](_0x5eaf43[_0x13d7('0x4e')],[_0x13d7('0x56'),'id'])||{});}})[_0x13d7('0x28')](respondWithResult(_0x428f24,null))[_0x13d7('0x4c')](handleError(_0x428f24,null));};exports[_0x13d7('0x58')]=function(_0x51de52,_0x27c5cc,_0x18906c){var _0x201441={};var _0x9fb114={};var _0x1a0f74;var _0x87c785;return db[_0x13d7('0x44')][_0x13d7('0x59')]({'where':{'id':_0x51de52['params']['id']}})[_0x13d7('0x28')](handleEntityNotFound(_0x27c5cc,null))['then'](function(_0x390573){if(_0x390573){_0x1a0f74=_0x390573;_0x9fb114[_0x13d7('0x32')]=_[_0x13d7('0x35')](db['User'][_0x13d7('0x2e')]);_0x9fb114[_0x13d7('0x34')]=_[_0x13d7('0x35')](_0x51de52[_0x13d7('0x34')]);_0x9fb114['filters']=_[_0x13d7('0x37')](_0x9fb114[_0x13d7('0x32')],_0x9fb114[_0x13d7('0x34')]);_0x201441[_0x13d7('0x38')]=_[_0x13d7('0x37')](_0x9fb114[_0x13d7('0x32')],qs[_0x13d7('0x39')](_0x51de52[_0x13d7('0x34')][_0x13d7('0x39')]));_0x201441[_0x13d7('0x38')]=_0x201441[_0x13d7('0x38')][_0x13d7('0x3a')]?_0x201441[_0x13d7('0x38')]:_0x9fb114[_0x13d7('0x32')];_0x201441[_0x13d7('0x3c')]=qs['sort'](_0x51de52[_0x13d7('0x34')][_0x13d7('0x3d')]);_0x201441[_0x13d7('0x3e')]=qs[_0x13d7('0x36')](_[_0x13d7('0x3f')](_0x51de52[_0x13d7('0x34')],_0x9fb114['filters']));if(_0x51de52[_0x13d7('0x34')][_0x13d7('0x40')]){_0x201441['where']=_[_0x13d7('0x42')](_0x201441[_0x13d7('0x3e')],{'$or':_['map'](_0x201441[_0x13d7('0x38')],function(_0x4f4423){var _0x3a83de={};_0x3a83de[_0x4f4423]={'$like':'%'+_0x51de52[_0x13d7('0x34')]['filter']+'%'};return _0x3a83de;})});}_0x201441=_[_0x13d7('0x42')]({},_0x201441,_0x51de52[_0x13d7('0x4a')]);return _0x1a0f74[_0x13d7('0x58')](_0x201441);}})[_0x13d7('0x28')](function(_0x4330cd){if(_0x4330cd){_0x87c785=_0x4330cd[_0x13d7('0x3a')];if(!_0x51de52[_0x13d7('0x34')][_0x13d7('0x5a')](_0x13d7('0x3b'))){_0x201441[_0x13d7('0x24')]=qs[_0x13d7('0x24')](_0x51de52['query'][_0x13d7('0x24')]);_0x201441[_0x13d7('0x22')]=qs['offset'](_0x51de52[_0x13d7('0x34')]['offset']);}return _0x1a0f74[_0x13d7('0x58')](_0x201441);}})[_0x13d7('0x28')](function(_0x556ced){if(_0x556ced){return _0x556ced?{'count':_0x87c785,'rows':_0x556ced}:null;}})[_0x13d7('0x28')](respondWithResult(_0x27c5cc,null))[_0x13d7('0x4c')](handleError(_0x27c5cc,null));};exports[_0x13d7('0x5b')]=function(_0x5e27bb,_0x2c7c41,_0x5959ba){return db[_0x13d7('0x44')]['find']({'where':{'id':_0x5e27bb[_0x13d7('0x48')]['id']}})[_0x13d7('0x28')](handleEntityNotFound(_0x2c7c41,null))['then'](function(_0x5c695a){if(_0x5c695a){return _0x5c695a['removeMembers'](_0x5e27bb[_0x13d7('0x34')][_0x13d7('0x56')]);}})[_0x13d7('0x28')](respondWithStatusCode(_0x2c7c41,null))[_0x13d7('0x4c')](handleError(_0x2c7c41,null));};exports[_0x13d7('0x5c')]=function(_0x36d265,_0x1e7d9c,_0x3cfb1d){if(_0x36d265['body']['id']){delete _0x36d265[_0x13d7('0x4e')]['id'];}return db[_0x13d7('0x44')][_0x13d7('0x4b')]({'where':{'id':_0x36d265['params']['id']}})[_0x13d7('0x28')](handleEntityNotFound(_0x1e7d9c,null))[_0x13d7('0x28')](function(_0x525fdb){if(_0x525fdb){_0x36d265['body'][_0x13d7('0x5d')]=_0x525fdb['id'];return db[_0x13d7('0x52')][_0x13d7('0x4d')](_0x36d265[_0x13d7('0x4e')]);}})[_0x13d7('0x28')](respondWithResult(_0x1e7d9c,null))[_0x13d7('0x4c')](handleError(_0x1e7d9c,null));};exports['getMessages']=function(_0x398149,_0x187095,_0x2cded4){var _0x3b5684={};var _0x4e4c7b={};var _0x14ac70;var _0x192d13;return db['ChatGroup'][_0x13d7('0x59')]({'where':{'id':_0x398149['params']['id']}})[_0x13d7('0x28')](handleEntityNotFound(_0x187095,null))[_0x13d7('0x28')](function(_0x33ed64){if(_0x33ed64){_0x14ac70=_0x33ed64;_0x4e4c7b['model']=_[_0x13d7('0x35')](db[_0x13d7('0x52')][_0x13d7('0x2e')]);_0x4e4c7b[_0x13d7('0x34')]=_[_0x13d7('0x35')](_0x398149[_0x13d7('0x34')]);_0x4e4c7b['filters']=_['intersection'](_0x4e4c7b[_0x13d7('0x32')],_0x4e4c7b[_0x13d7('0x34')]);_0x3b5684[_0x13d7('0x38')]=_[_0x13d7('0x37')](_0x4e4c7b[_0x13d7('0x32')],qs['fields'](_0x398149[_0x13d7('0x34')][_0x13d7('0x39')]));_0x3b5684[_0x13d7('0x38')]=_0x3b5684[_0x13d7('0x38')][_0x13d7('0x3a')]?_0x3b5684[_0x13d7('0x38')]:_0x4e4c7b['model'];_0x3b5684[_0x13d7('0x3c')]=qs['sort'](_0x398149['query'][_0x13d7('0x3d')]);_0x3b5684['where']=qs[_0x13d7('0x36')](_['pick'](_0x398149[_0x13d7('0x34')],_0x4e4c7b[_0x13d7('0x36')]));if(_0x398149[_0x13d7('0x34')][_0x13d7('0x40')]){_0x3b5684[_0x13d7('0x3e')]=_['merge'](_0x3b5684[_0x13d7('0x3e')],{'$or':_[_0x13d7('0x33')](_0x3b5684[_0x13d7('0x38')],function(_0x4a99d1){var _0x552ba0={};_0x552ba0[_0x4a99d1]={'$like':'%'+_0x398149['query'][_0x13d7('0x40')]+'%'};return _0x552ba0;})});}if(_0x398149[_0x13d7('0x34')][_0x13d7('0x5e')]){var _0x881f44=_0x398149[_0x13d7('0x34')][_0x13d7('0x5e')][_0x13d7('0x5f')](',');var _0x398d4e={};_0x398d4e[_0x881f44[0x0]]={'$gte':moment(_0x881f44[0x1])[_0x13d7('0x60')](_0x13d7('0x61'))};_0x3b5684[_0x13d7('0x3e')]=_[_0x13d7('0x42')](_0x3b5684[_0x13d7('0x3e')],_0x398d4e);}_0x3b5684=_[_0x13d7('0x42')]({},_0x3b5684,_0x398149['options']);return _0x14ac70[_0x13d7('0x62')](_0x3b5684);}})[_0x13d7('0x28')](function(_0x2d4e83){if(_0x2d4e83){_0x192d13=_0x2d4e83[_0x13d7('0x3a')];if(!_0x398149[_0x13d7('0x34')][_0x13d7('0x5a')](_0x13d7('0x3b'))){_0x3b5684[_0x13d7('0x24')]=qs['limit'](_0x398149['query'][_0x13d7('0x24')]);_0x3b5684[_0x13d7('0x22')]=qs[_0x13d7('0x22')](_0x398149['query'][_0x13d7('0x22')]);}return _0x14ac70[_0x13d7('0x62')](_0x3b5684);}})[_0x13d7('0x28')](function(_0x250dcd){if(_0x250dcd){return _0x250dcd?{'count':_0x192d13,'rows':_0x250dcd}:null;}})[_0x13d7('0x28')](respondWithResult(_0x187095,null))[_0x13d7('0x4c')](handleError(_0x187095,null));}; \ No newline at end of file +var _0x643f=['getMessages','$gte','split','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','removeMembers','addMessage'];(function(_0x2eb542,_0x5387d3){var _0x15eb27=function(_0x1a4ac9){while(--_0x1a4ac9){_0x2eb542['push'](_0x2eb542['shift']());}};_0x15eb27(++_0x5387d3);}(_0x643f,0x123));var _0xf643=function(_0x175f33,_0x58b838){_0x175f33=_0x175f33-0x0;var _0x250a92=_0x643f[_0x175f33];return _0x250a92;};'use strict';var emlformat=require(_0xf643('0x0'));var rimraf=require(_0xf643('0x1'));var zipdir=require(_0xf643('0x2'));var jsonpatch=require(_0xf643('0x3'));var rp=require(_0xf643('0x4'));var moment=require(_0xf643('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf643('0x6'));var util=require(_0xf643('0x7'));var path=require(_0xf643('0x8'));var sox=require(_0xf643('0x9'));var csv=require(_0xf643('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf643('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf643('0xc'));var jsforce=require(_0xf643('0xd'));var deskjs=require(_0xf643('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf643('0xf'));var Papa=require(_0xf643('0x10'));var Redis=require(_0xf643('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf643('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf643('0x13'))(_0xf643('0x14'));var utils=require(_0xf643('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf643('0x16'));var db=require(_0xf643('0x17'))['db'];config[_0xf643('0x18')]=_['defaults'](config[_0xf643('0x18')],{'host':_0xf643('0x19'),'port':0x18eb});var socket=require(_0xf643('0x1a'))(new Redis(config['redis']));require(_0xf643('0x1b'))['register'](socket);function respondWithStatusCode(_0x2ec618,_0x3d3db1){_0x3d3db1=_0x3d3db1||0xcc;return function(_0x2af4c7){if(_0x2af4c7){return _0x2ec618[_0xf643('0x1c')](_0x3d3db1);}return _0x2ec618[_0xf643('0x1d')](_0x3d3db1)[_0xf643('0x1e')]();};}function respondWithResult(_0x3cea17,_0x56ea10){_0x56ea10=_0x56ea10||0xc8;return function(_0x3f1bda){if(_0x3f1bda){return _0x3cea17[_0xf643('0x1d')](_0x56ea10)['json'](_0x3f1bda);}};}function respondWithFilteredResult(_0x479420,_0x5aabe6){return function(_0x5cbfe7){if(_0x5cbfe7){var _0x42876d=typeof _0x5aabe6[_0xf643('0x1f')]===_0xf643('0x20')&&typeof _0x5aabe6[_0xf643('0x21')]===_0xf643('0x20');var _0x3f758f=_0x5cbfe7[_0xf643('0x22')];var _0x3dd3bf=_0x42876d?0x0:_0x5aabe6[_0xf643('0x1f')];var _0x49d1a5=_0x42876d?_0x5cbfe7[_0xf643('0x22')]:_0x5aabe6['offset']+_0x5aabe6[_0xf643('0x21')];var _0x4a13f5;if(_0x49d1a5>=_0x3f758f){_0x49d1a5=_0x3f758f;_0x4a13f5=0xc8;}else{_0x4a13f5=0xce;}_0x479420[_0xf643('0x1d')](_0x4a13f5);return _0x479420[_0xf643('0x23')](_0xf643('0x24'),_0x3dd3bf+'-'+_0x49d1a5+'/'+_0x3f758f)[_0xf643('0x25')](_0x5cbfe7);}return null;};}function patchUpdates(_0x503568){return function(_0x1c17da){try{jsonpatch[_0xf643('0x26')](_0x1c17da,_0x503568,!![]);}catch(_0x4c03ff){return BPromise[_0xf643('0x27')](_0x4c03ff);}return _0x1c17da[_0xf643('0x28')]();};}function saveUpdates(_0x26b6ec,_0x2be981){return function(_0x11cf30){if(_0x11cf30){return _0x11cf30[_0xf643('0x29')](_0x26b6ec)[_0xf643('0x2a')](function(_0x32fa8d){return _0x32fa8d;});}return null;};}function removeEntity(_0xb3a30,_0x377f1e){return function(_0x24101c){if(_0x24101c){return _0x24101c[_0xf643('0x2b')]()[_0xf643('0x2a')](function(){_0xb3a30[_0xf643('0x1d')](0xcc)[_0xf643('0x1e')]();});}};}function handleEntityNotFound(_0x32f862,_0x546b07){return function(_0x4fb605){if(!_0x4fb605){_0x32f862[_0xf643('0x1c')](0x194);}return _0x4fb605;};}function handleError(_0x248ba9,_0x3507bc){_0x3507bc=_0x3507bc||0x1f4;return function(_0x2ff118){logger[_0xf643('0x2c')](_0x2ff118['stack']);if(_0x2ff118[_0xf643('0x2d')]){delete _0x2ff118['name'];}_0x248ba9[_0xf643('0x1d')](_0x3507bc)[_0xf643('0x2e')](_0x2ff118);};}exports[_0xf643('0x2f')]=function(_0x357c5f,_0x29ad50){var _0x17843f={},_0x71619d={},_0x54ba2c={'count':0x0,'rows':[]};var _0x4b20b9=_[_0xf643('0x30')](db[_0xf643('0x31')][_0xf643('0x32')],function(_0x2aa17b){return{'name':_0x2aa17b[_0xf643('0x33')],'type':_0x2aa17b['type'][_0xf643('0x34')]};});_0x71619d[_0xf643('0x35')]=_[_0xf643('0x30')](_0x4b20b9,_0xf643('0x2d'));_0x71619d[_0xf643('0x36')]=_['keys'](_0x357c5f[_0xf643('0x36')]);_0x71619d[_0xf643('0x37')]=_['intersection'](_0x71619d['model'],_0x71619d[_0xf643('0x36')]);_0x17843f[_0xf643('0x38')]=_[_0xf643('0x39')](_0x71619d[_0xf643('0x35')],qs[_0xf643('0x3a')](_0x357c5f[_0xf643('0x36')][_0xf643('0x3a')]));_0x17843f['attributes']=_0x17843f[_0xf643('0x38')][_0xf643('0x3b')]?_0x17843f['attributes']:_0x71619d[_0xf643('0x35')];if(!_0x357c5f[_0xf643('0x36')][_0xf643('0x3c')](_0xf643('0x3d'))){_0x17843f['limit']=qs['limit'](_0x357c5f[_0xf643('0x36')][_0xf643('0x21')]);_0x17843f[_0xf643('0x1f')]=qs[_0xf643('0x1f')](_0x357c5f[_0xf643('0x36')][_0xf643('0x1f')]);}_0x17843f[_0xf643('0x3e')]=qs[_0xf643('0x3f')](_0x357c5f['query'][_0xf643('0x3f')]);_0x17843f['where']=qs[_0xf643('0x37')](_[_0xf643('0x40')](_0x357c5f[_0xf643('0x36')],_0x71619d[_0xf643('0x37')]),_0x4b20b9);if(_0x357c5f[_0xf643('0x36')][_0xf643('0x41')]){_0x17843f[_0xf643('0x42')]=_[_0xf643('0x43')](_0x17843f[_0xf643('0x42')],{'$or':_[_0xf643('0x30')](_0x4b20b9,function(_0x55e395){if(_0x55e395[_0xf643('0x44')]!==_0xf643('0x45')){var _0x56503e={};_0x56503e[_0x55e395['name']]={'$like':'%'+_0x357c5f[_0xf643('0x36')][_0xf643('0x41')]+'%'};return _0x56503e;}})});}_0x17843f=_[_0xf643('0x43')]({},_0x17843f,_0x357c5f[_0xf643('0x46')]);var _0x4f4462={'where':_0x17843f[_0xf643('0x42')]};return db['ChatGroup'][_0xf643('0x22')](_0x4f4462)['then'](function(_0x484404){_0x54ba2c[_0xf643('0x22')]=_0x484404;if(_0x357c5f[_0xf643('0x36')][_0xf643('0x47')]){_0x17843f[_0xf643('0x48')]=[{'all':!![]}];}return db['ChatGroup'][_0xf643('0x49')](_0x17843f);})[_0xf643('0x2a')](function(_0x29659c){_0x54ba2c[_0xf643('0x4a')]=_0x29659c;return _0x54ba2c;})[_0xf643('0x2a')](respondWithFilteredResult(_0x29ad50,_0x17843f))[_0xf643('0x4b')](handleError(_0x29ad50,null));};exports[_0xf643('0x4c')]=function(_0x4480de,_0xe6401c){var _0x2b2e50={'raw':!![],'where':{'id':_0x4480de[_0xf643('0x4d')]['id']}},_0x28b05b={};_0x28b05b[_0xf643('0x35')]=_[_0xf643('0x4e')](db['ChatGroup'][_0xf643('0x32')]);_0x28b05b['query']=_[_0xf643('0x4e')](_0x4480de[_0xf643('0x36')]);_0x28b05b[_0xf643('0x37')]=_[_0xf643('0x39')](_0x28b05b[_0xf643('0x35')],_0x28b05b[_0xf643('0x36')]);_0x2b2e50[_0xf643('0x38')]=_[_0xf643('0x39')](_0x28b05b[_0xf643('0x35')],qs[_0xf643('0x3a')](_0x4480de[_0xf643('0x36')][_0xf643('0x3a')]));_0x2b2e50[_0xf643('0x38')]=_0x2b2e50[_0xf643('0x38')][_0xf643('0x3b')]?_0x2b2e50[_0xf643('0x38')]:_0x28b05b['model'];if(_0x4480de[_0xf643('0x36')][_0xf643('0x47')]){_0x2b2e50[_0xf643('0x48')]=[{'all':!![]}];}_0x2b2e50=_['merge']({},_0x2b2e50,_0x4480de[_0xf643('0x46')]);return db['ChatGroup'][_0xf643('0x4f')](_0x2b2e50)['then'](handleEntityNotFound(_0xe6401c,null))[_0xf643('0x2a')](respondWithResult(_0xe6401c,null))[_0xf643('0x4b')](handleError(_0xe6401c,null));};exports[_0xf643('0x50')]=function(_0x376aaf,_0x38be89){return db['ChatGroup'][_0xf643('0x50')](_0x376aaf['body'],{})['then'](respondWithResult(_0x38be89,0xc9))[_0xf643('0x4b')](handleError(_0x38be89,null));};exports[_0xf643('0x29')]=function(_0x49fb3f,_0x8db49f){if(_0x49fb3f['body']['id']){delete _0x49fb3f[_0xf643('0x51')]['id'];}return db[_0xf643('0x31')]['find']({'where':{'id':_0x49fb3f[_0xf643('0x4d')]['id']}})['then'](handleEntityNotFound(_0x8db49f,null))[_0xf643('0x2a')](saveUpdates(_0x49fb3f[_0xf643('0x51')],null))[_0xf643('0x2a')](respondWithResult(_0x8db49f,null))[_0xf643('0x4b')](handleError(_0x8db49f,null));};exports[_0xf643('0x2b')]=function(_0x3d230f,_0x3e5c5c){return db[_0xf643('0x31')][_0xf643('0x4f')]({'where':{'id':_0x3d230f[_0xf643('0x4d')]['id']}})[_0xf643('0x2a')](handleEntityNotFound(_0x3e5c5c,null))[_0xf643('0x2a')](removeEntity(_0x3e5c5c,null))[_0xf643('0x4b')](handleError(_0x3e5c5c,null));};exports['describe']=function(_0x4016ae,_0x40810a){return db['ChatGroup'][_0xf643('0x52')]()[_0xf643('0x2a')](respondWithResult(_0x40810a,null))['catch'](handleError(_0x40810a,null));};exports['getUnread']=function(_0x2b8571,_0x182113,_0x253078){return db[_0xf643('0x53')]['count']({'where':{'ChatGroupId':_0x2b8571[_0xf643('0x4d')]['id'],'ToId':_0x2b8571[_0xf643('0x54')]['id'],'read':![]}})[_0xf643('0x2a')](function(_0x3dd0cf){return{'id':_[_0xf643('0x55')](_0x2b8571[_0xf643('0x4d')]['id']),'count':_0x3dd0cf};})[_0xf643('0x2a')](respondWithResult(_0x182113,null))['catch'](handleError(_0x182113,null));};exports[_0xf643('0x56')]=function(_0x322d66,_0x5868ce,_0x263305){return db['ChatGroup']['find']({'where':{'id':_0x322d66[_0xf643('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5868ce,null))[_0xf643('0x2a')](function(_0xb26782){if(_0xb26782){return _0xb26782['addMembers'](_0x322d66['body']['ids'],_[_0xf643('0x57')](_0x322d66[_0xf643('0x51')],[_0xf643('0x58'),'id'])||{});}})[_0xf643('0x2a')](respondWithResult(_0x5868ce,null))[_0xf643('0x4b')](handleError(_0x5868ce,null));};exports[_0xf643('0x59')]=function(_0xcdeaab,_0x297da1,_0x4a4d2b){var _0x57a411={};var _0x7aed96={};var _0x1c498e;var _0x31eff1;return db[_0xf643('0x31')][_0xf643('0x5a')]({'where':{'id':_0xcdeaab[_0xf643('0x4d')]['id']}})[_0xf643('0x2a')](handleEntityNotFound(_0x297da1,null))['then'](function(_0x5a6dbf){if(_0x5a6dbf){_0x1c498e=_0x5a6dbf;_0x7aed96[_0xf643('0x35')]=_['keys'](db['User']['rawAttributes']);_0x7aed96['query']=_['keys'](_0xcdeaab['query']);_0x7aed96[_0xf643('0x37')]=_[_0xf643('0x39')](_0x7aed96[_0xf643('0x35')],_0x7aed96[_0xf643('0x36')]);_0x57a411[_0xf643('0x38')]=_[_0xf643('0x39')](_0x7aed96['model'],qs[_0xf643('0x3a')](_0xcdeaab['query'][_0xf643('0x3a')]));_0x57a411[_0xf643('0x38')]=_0x57a411['attributes'][_0xf643('0x3b')]?_0x57a411['attributes']:_0x7aed96['model'];_0x57a411[_0xf643('0x3e')]=qs[_0xf643('0x3f')](_0xcdeaab['query'][_0xf643('0x3f')]);_0x57a411[_0xf643('0x42')]=qs[_0xf643('0x37')](_[_0xf643('0x40')](_0xcdeaab['query'],_0x7aed96[_0xf643('0x37')]));if(_0xcdeaab['query']['filter']){_0x57a411['where']=_[_0xf643('0x43')](_0x57a411['where'],{'$or':_[_0xf643('0x30')](_0x57a411['attributes'],function(_0x312734){var _0x4a2176={};_0x4a2176[_0x312734]={'$like':'%'+_0xcdeaab['query'][_0xf643('0x41')]+'%'};return _0x4a2176;})});}_0x57a411=_['merge']({},_0x57a411,_0xcdeaab[_0xf643('0x46')]);return _0x1c498e[_0xf643('0x59')](_0x57a411);}})[_0xf643('0x2a')](function(_0x280e03){if(_0x280e03){_0x31eff1=_0x280e03[_0xf643('0x3b')];if(!_0xcdeaab[_0xf643('0x36')][_0xf643('0x3c')](_0xf643('0x3d'))){_0x57a411[_0xf643('0x21')]=qs[_0xf643('0x21')](_0xcdeaab[_0xf643('0x36')][_0xf643('0x21')]);_0x57a411['offset']=qs[_0xf643('0x1f')](_0xcdeaab['query'][_0xf643('0x1f')]);}return _0x1c498e['getMembers'](_0x57a411);}})[_0xf643('0x2a')](function(_0x532a24){if(_0x532a24){return _0x532a24?{'count':_0x31eff1,'rows':_0x532a24}:null;}})[_0xf643('0x2a')](respondWithResult(_0x297da1,null))[_0xf643('0x4b')](handleError(_0x297da1,null));};exports[_0xf643('0x5b')]=function(_0xb0c175,_0x3bc97b,_0x285d6c){return db[_0xf643('0x31')][_0xf643('0x4f')]({'where':{'id':_0xb0c175[_0xf643('0x4d')]['id']}})[_0xf643('0x2a')](handleEntityNotFound(_0x3bc97b,null))[_0xf643('0x2a')](function(_0x57648c){if(_0x57648c){return _0x57648c['removeMembers'](_0xb0c175['query']['ids']);}})[_0xf643('0x2a')](respondWithStatusCode(_0x3bc97b,null))[_0xf643('0x4b')](handleError(_0x3bc97b,null));};exports[_0xf643('0x5c')]=function(_0x5a1e3f,_0x47ee38,_0x3f31c7){if(_0x5a1e3f[_0xf643('0x51')]['id']){delete _0x5a1e3f['body']['id'];}return db[_0xf643('0x31')][_0xf643('0x4f')]({'where':{'id':_0x5a1e3f['params']['id']}})[_0xf643('0x2a')](handleEntityNotFound(_0x47ee38,null))['then'](function(_0x60003c){if(_0x60003c){_0x5a1e3f[_0xf643('0x51')]['ChatGroupId']=_0x60003c['id'];return db[_0xf643('0x53')][_0xf643('0x50')](_0x5a1e3f[_0xf643('0x51')]);}})['then'](respondWithResult(_0x47ee38,null))[_0xf643('0x4b')](handleError(_0x47ee38,null));};exports[_0xf643('0x5d')]=function(_0x118bf9,_0x33bfc2,_0x90cb83){var _0x319c80={};var _0x41988a={};var _0x215bfd;var _0x148b08;return db[_0xf643('0x31')][_0xf643('0x5a')]({'where':{'id':_0x118bf9[_0xf643('0x4d')]['id']}})['then'](handleEntityNotFound(_0x33bfc2,null))[_0xf643('0x2a')](function(_0x46ba0c){if(_0x46ba0c){_0x215bfd=_0x46ba0c;_0x41988a['model']=_[_0xf643('0x4e')](db[_0xf643('0x53')][_0xf643('0x32')]);_0x41988a['query']=_[_0xf643('0x4e')](_0x118bf9[_0xf643('0x36')]);_0x41988a[_0xf643('0x37')]=_[_0xf643('0x39')](_0x41988a[_0xf643('0x35')],_0x41988a[_0xf643('0x36')]);_0x319c80[_0xf643('0x38')]=_[_0xf643('0x39')](_0x41988a['model'],qs[_0xf643('0x3a')](_0x118bf9[_0xf643('0x36')][_0xf643('0x3a')]));_0x319c80[_0xf643('0x38')]=_0x319c80[_0xf643('0x38')][_0xf643('0x3b')]?_0x319c80[_0xf643('0x38')]:_0x41988a[_0xf643('0x35')];_0x319c80[_0xf643('0x3e')]=qs['sort'](_0x118bf9['query'][_0xf643('0x3f')]);_0x319c80[_0xf643('0x42')]=qs[_0xf643('0x37')](_['pick'](_0x118bf9[_0xf643('0x36')],_0x41988a[_0xf643('0x37')]));if(_0x118bf9[_0xf643('0x36')][_0xf643('0x41')]){_0x319c80[_0xf643('0x42')]=_[_0xf643('0x43')](_0x319c80[_0xf643('0x42')],{'$or':_[_0xf643('0x30')](_0x319c80[_0xf643('0x38')],function(_0x171187){var _0x5bdfe6={};_0x5bdfe6[_0x171187]={'$like':'%'+_0x118bf9[_0xf643('0x36')][_0xf643('0x41')]+'%'};return _0x5bdfe6;})});}if(_0x118bf9['query'][_0xf643('0x5e')]){var _0x339a69=_0x118bf9[_0xf643('0x36')]['$gte'][_0xf643('0x5f')](',');var _0x23b930={};_0x23b930[_0x339a69[0x0]]={'$gte':moment(_0x339a69[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x319c80[_0xf643('0x42')]=_['merge'](_0x319c80['where'],_0x23b930);}_0x319c80=_[_0xf643('0x43')]({},_0x319c80,_0x118bf9['options']);return _0x215bfd[_0xf643('0x5d')](_0x319c80);}})[_0xf643('0x2a')](function(_0x459cb9){if(_0x459cb9){_0x148b08=_0x459cb9[_0xf643('0x3b')];if(!_0x118bf9[_0xf643('0x36')][_0xf643('0x3c')](_0xf643('0x3d'))){_0x319c80[_0xf643('0x21')]=qs['limit'](_0x118bf9['query'][_0xf643('0x21')]);_0x319c80[_0xf643('0x1f')]=qs[_0xf643('0x1f')](_0x118bf9[_0xf643('0x36')][_0xf643('0x1f')]);}return _0x215bfd[_0xf643('0x5d')](_0x319c80);}})[_0xf643('0x2a')](function(_0x3e179f){if(_0x3e179f){return _0x3e179f?{'count':_0x148b08,'rows':_0x3e179f}:null;}})['then'](respondWithResult(_0x33bfc2,null))['catch'](handleError(_0x33bfc2,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index a03c7ef..a7c8816 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 _0xd497=['ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xd497,0x170));var _0x7d49=function(_0x2e2053,_0x5b83ef){_0x2e2053=_0x2e2053-0x0;var _0x40c7c3=_0xd497[_0x2e2053];return _0x40c7c3;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x7d49('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7d49('0x1')](0x0);var events={'afterCreate':_0x7d49('0x2'),'afterUpdate':'update','afterDestroy':_0x7d49('0x3')};function emitEvent(_0x1881d0){return function(_0x221f22,_0x48094a,_0x4182b0){ChatGroupEvents[_0x7d49('0x4')](_0x1881d0+':'+_0x221f22['id'],_0x221f22);ChatGroupEvents[_0x7d49('0x4')](_0x1881d0,_0x221f22);_0x4182b0(null);};}for(var e in events){if(events[_0x7d49('0x5')](e)){var event=events[e];ChatGroup[_0x7d49('0x6')](e,emitEvent(event));}}module[_0x7d49('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x32de=['setMaxListeners','update','remove','emit','hook','events','../../mysqldb','ChatGroup'];(function(_0x2123d9,_0x2c10ba){var _0x80844a=function(_0x3977db){while(--_0x3977db){_0x2123d9['push'](_0x2123d9['shift']());}};_0x80844a(++_0x2c10ba);}(_0x32de,0x7d));var _0xe32d=function(_0x3937e7,_0x91712b){_0x3937e7=_0x3937e7-0x0;var _0x197ad7=_0x32de[_0x3937e7];return _0x197ad7;};'use strict';var EventEmitter=require(_0xe32d('0x0'));var ChatGroup=require(_0xe32d('0x1'))['db'][_0xe32d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe32d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe32d('0x4'),'afterDestroy':_0xe32d('0x5')};function emitEvent(_0xf8fd59){return function(_0x1e431d,_0x504a88,_0x157c89){ChatGroupEvents[_0xe32d('0x6')](_0xf8fd59+':'+_0x1e431d['id'],_0x1e431d);ChatGroupEvents[_0xe32d('0x6')](_0xf8fd59,_0x1e431d);_0x157c89(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xe32d('0x7')](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 265d268..863b5da 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 _0x5dfa=['exports','ChatGroup','chat_groups','lodash','util','../../config/logger','api','request-promise','path','./chatGroup.attributes'];(function(_0x6aeaa1,_0x95f365){var _0x45d3d6=function(_0x275fc7){while(--_0x275fc7){_0x6aeaa1['push'](_0x6aeaa1['shift']());}};_0x45d3d6(++_0x95f365);}(_0x5dfa,0x125));var _0xa5df=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5dfa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa5df('0x0'));var util=require(_0xa5df('0x1'));var logger=require(_0xa5df('0x2'))(_0xa5df('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa5df('0x4'));var fs=require('fs');var path=require(_0xa5df('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa5df('0x6'));module[_0xa5df('0x7')]=function(_0x1c7ac9,_0x2adf65){return _0x1c7ac9['define'](_0xa5df('0x8'),attributes,{'tableName':_0xa5df('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93f2=['../../config/environment','exports','define','chat_groups','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3d49f2,_0x2e0ddf){var _0x5af308=function(_0x1aab2b){while(--_0x1aab2b){_0x3d49f2['push'](_0x3d49f2['shift']());}};_0x5af308(++_0x2e0ddf);}(_0x93f2,0x1e4));var _0x293f=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x93f2[_0x34843e];return _0x598f7f;};'use strict';var _=require(_0x293f('0x0'));var util=require('util');var logger=require(_0x293f('0x1'))('api');var moment=require(_0x293f('0x2'));var BPromise=require(_0x293f('0x3'));var rp=require(_0x293f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x293f('0x5'));var config=require(_0x293f('0x6'));var attributes=require('./chatGroup.attributes');module[_0x293f('0x7')]=function(_0x46d58e,_0x29be09){return _0x46d58e[_0x293f('0x8')]('ChatGroup',attributes,{'tableName':_0x293f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index af0fb3b..58c6b56 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 _0x28a2=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','info'];(function(_0xe70f6c,_0x3b734d){var _0x29d959=function(_0x37c8d9){while(--_0x37c8d9){_0xe70f6c['push'](_0xe70f6c['shift']());}};_0x29d959(++_0x3b734d);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x228a('0x0'));var util=require(_0x228a('0x1'));var moment=require(_0x228a('0x2'));var BPromise=require(_0x228a('0x3'));var rs=require(_0x228a('0x4'));var fs=require('fs');var Redis=require(_0x228a('0x5'));var db=require(_0x228a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x228a('0x7'))('rpc');var config=require(_0x228a('0x8'));var jayson=require(_0x228a('0x9'));var client=jayson[_0x228a('0xa')][_0x228a('0xb')]({'port':0x232a});config[_0x228a('0xc')]=_['defaults'](config[_0x228a('0xc')],{'host':_0x228a('0xd'),'port':0x18eb});var socket=require(_0x228a('0xe'))(new Redis(config[_0x228a('0xc')]));require('./chatGroup.socket')[_0x228a('0xf')](socket);function respondWithRpcPromise(_0x44dec4,_0x3b20dd,_0x1cb14a){return new BPromise(function(_0x2ccb62,_0x36d5a6){return client[_0x228a('0x10')](_0x44dec4,_0x1cb14a)[_0x228a('0x11')](function(_0x5b74cb){logger['info']('ChatGroup,\x20%s,\x20%s',_0x3b20dd,_0x228a('0x12'));logger[_0x228a('0x13')](_0x228a('0x14'),_0x3b20dd,_0x228a('0x12'),JSON[_0x228a('0x15')](_0x5b74cb));if(_0x5b74cb['error']){if(_0x5b74cb[_0x228a('0x16')][_0x228a('0x17')]===0x1f4){logger[_0x228a('0x16')]('ChatGroup,\x20%s,\x20%s',_0x3b20dd,_0x5b74cb['error'][_0x228a('0x18')]);return _0x36d5a6(_0x5b74cb[_0x228a('0x16')][_0x228a('0x18')]);}logger[_0x228a('0x16')](_0x228a('0x19'),_0x3b20dd,_0x5b74cb[_0x228a('0x16')][_0x228a('0x18')]);return _0x2ccb62(_0x5b74cb[_0x228a('0x16')]['message']);}else{logger[_0x228a('0x1a')]('ChatGroup,\x20%s,\x20%s',_0x3b20dd,_0x228a('0x12'));_0x2ccb62(_0x5b74cb[_0x228a('0x1b')][_0x228a('0x18')]);}})[_0x228a('0x1c')](function(_0x492595){logger['error'](_0x228a('0x19'),_0x3b20dd,_0x492595);_0x36d5a6(_0x492595);});});} \ No newline at end of file +var _0x1e69=['ChatGroup,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x27e568,_0x4a68f2){var _0x6af2d4=function(_0x3e0316){while(--_0x3e0316){_0x27e568['push'](_0x27e568['shift']());}};_0x6af2d4(++_0x4a68f2);}(_0x1e69,0x85));var _0x91e6=function(_0x564e23,_0x5d1239){_0x564e23=_0x564e23-0x0;var _0x1d1420=_0x1e69[_0x564e23];return _0x1d1420;};'use strict';var _=require('lodash');var util=require(_0x91e6('0x0'));var moment=require(_0x91e6('0x1'));var BPromise=require(_0x91e6('0x2'));var rs=require(_0x91e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x91e6('0x4'));var logger=require(_0x91e6('0x5'))(_0x91e6('0x6'));var config=require(_0x91e6('0x7'));var jayson=require(_0x91e6('0x8'));var client=jayson[_0x91e6('0x9')][_0x91e6('0xa')]({'port':0x232a});config[_0x91e6('0xb')]=_[_0x91e6('0xc')](config[_0x91e6('0xb')],{'host':_0x91e6('0xd'),'port':0x18eb});var socket=require(_0x91e6('0xe'))(new Redis(config[_0x91e6('0xb')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x3a05fb,_0x260c4d,_0x151810){return new BPromise(function(_0x1748b2,_0x5a97c4){return client[_0x91e6('0xf')](_0x3a05fb,_0x151810)[_0x91e6('0x10')](function(_0x270216){logger[_0x91e6('0x11')]('ChatGroup,\x20%s,\x20%s',_0x260c4d,_0x91e6('0x12'));logger[_0x91e6('0x13')](_0x91e6('0x14'),_0x260c4d,_0x91e6('0x12'),JSON[_0x91e6('0x15')](_0x270216));if(_0x270216[_0x91e6('0x16')]){if(_0x270216[_0x91e6('0x16')]['code']===0x1f4){logger[_0x91e6('0x16')](_0x91e6('0x17'),_0x260c4d,_0x270216[_0x91e6('0x16')][_0x91e6('0x18')]);return _0x5a97c4(_0x270216['error'][_0x91e6('0x18')]);}logger[_0x91e6('0x16')]('ChatGroup,\x20%s,\x20%s',_0x260c4d,_0x270216[_0x91e6('0x16')]['message']);return _0x1748b2(_0x270216['error']['message']);}else{logger['info'](_0x91e6('0x17'),_0x260c4d,_0x91e6('0x12'));_0x1748b2(_0x270216['result']['message']);}})[_0x91e6('0x19')](function(_0x2e2fb0){logger[_0x91e6('0x16')](_0x91e6('0x17'),_0x260c4d,_0x2e2fb0);_0x5a97c4(_0x2e2fb0);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 620887b..7e2cab8 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 _0x1dd9=['register','chatGroup:','./chatGroup.events','update','emit','removeListener'];(function(_0x3f2b26,_0x190ad6){var _0x349f3=function(_0x147159){while(--_0x147159){_0x3f2b26['push'](_0x3f2b26['shift']());}};_0x349f3(++_0x190ad6);}(_0x1dd9,0x9e));var _0x91dd=function(_0x4c81a0,_0x49dcaa){_0x4c81a0=_0x4c81a0-0x0;var _0x1b65c2=_0x1dd9[_0x4c81a0];return _0x1b65c2;};'use strict';var ChatGroupEvents=require(_0x91dd('0x0'));var events=['save','remove',_0x91dd('0x1')];function createListener(_0x30fd45,_0x5e7c04){return function(_0x315480){_0x5e7c04[_0x91dd('0x2')](_0x30fd45,_0x315480);};}function removeListener(_0x2aaee1,_0x3a7944){return function(){ChatGroupEvents[_0x91dd('0x3')](_0x2aaee1,_0x3a7944);};}exports[_0x91dd('0x4')]=function(_0xaab70b){for(var _0x17d503=0x0,_0x509504=events['length'];_0x17d503<_0x509504;_0x17d503++){var _0x55f901=events[_0x17d503];var _0x647685=createListener(_0x91dd('0x5')+_0x55f901,_0xaab70b);ChatGroupEvents['on'](_0x55f901,_0x647685);}}; \ No newline at end of file +var _0x4d39=['chatGroup:','./chatGroup.events','save','remove','emit','removeListener','register','length'];(function(_0x10ca3e,_0x3844d8){var _0x4176c6=function(_0x1d79a8){while(--_0x1d79a8){_0x10ca3e['push'](_0x10ca3e['shift']());}};_0x4176c6(++_0x3844d8);}(_0x4d39,0x89));var _0x94d3=function(_0x100400,_0x3292f7){_0x100400=_0x100400-0x0;var _0x2c9a66=_0x4d39[_0x100400];return _0x2c9a66;};'use strict';var ChatGroupEvents=require(_0x94d3('0x0'));var events=[_0x94d3('0x1'),_0x94d3('0x2'),'update'];function createListener(_0x427348,_0x2f2117){return function(_0x200ec8){_0x2f2117[_0x94d3('0x3')](_0x427348,_0x200ec8);};}function removeListener(_0x3f5242,_0x21a555){return function(){ChatGroupEvents[_0x94d3('0x4')](_0x3f5242,_0x21a555);};}exports[_0x94d3('0x5')]=function(_0x2b61b9){for(var _0xe66e45=0x0,_0x3c2f6c=events[_0x94d3('0x6')];_0xe66e45<_0x3c2f6c;_0xe66e45++){var _0x5dec45=events[_0xe66e45];var _0x474f1a=createListener(_0x94d3('0x7')+_0x5dec45,_0x2b61b9);ChatGroupEvents['on'](_0x5dec45,_0x474f1a);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 2f7b73a..cad287d 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 _0xb2a7=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMessage','put','update','delete','destroy','removeMembers'];(function(_0x137115,_0x3353e1){var _0x21bf74=function(_0x5426ab){while(--_0x5426ab){_0x137115['push'](_0x137115['shift']());}};_0x21bf74(++_0x3353e1);}(_0xb2a7,0xbb));var _0x7b2a=function(_0x4676ce,_0xd438c3){_0x4676ce=_0x4676ce-0x0;var _0x582624=_0xb2a7[_0x4676ce];return _0x582624;};'use strict';var multer=require(_0x7b2a('0x0'));var util=require(_0x7b2a('0x1'));var path=require(_0x7b2a('0x2'));var timeout=require('connect-timeout');var express=require(_0x7b2a('0x3'));var router=express[_0x7b2a('0x4')]();var fs_extra=require(_0x7b2a('0x5'));var auth=require(_0x7b2a('0x6'));var interaction=require(_0x7b2a('0x7'));var config=require(_0x7b2a('0x8'));var controller=require(_0x7b2a('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b2a('0xa')]);router[_0x7b2a('0xb')](_0x7b2a('0xc'),auth[_0x7b2a('0xd')](),controller['describe']);router[_0x7b2a('0xb')](_0x7b2a('0xe'),auth['isAuthenticated'](),controller[_0x7b2a('0xf')]);router[_0x7b2a('0xb')](_0x7b2a('0x10'),auth[_0x7b2a('0xd')](),controller[_0x7b2a('0x11')]);router[_0x7b2a('0xb')](_0x7b2a('0x12'),auth['isAuthenticated'](),controller[_0x7b2a('0x13')]);router['get'](_0x7b2a('0x14'),auth['isAuthenticated'](),controller[_0x7b2a('0x15')]);router['post']('/',auth[_0x7b2a('0xd')](),controller[_0x7b2a('0x16')]);router[_0x7b2a('0x17')]('/:id/members',auth[_0x7b2a('0xd')](),controller['addMembers']);router[_0x7b2a('0x17')](_0x7b2a('0x14'),auth[_0x7b2a('0xd')](),controller[_0x7b2a('0x18')]);router[_0x7b2a('0x19')](_0x7b2a('0xe'),auth['isAuthenticated'](),controller[_0x7b2a('0x1a')]);router[_0x7b2a('0x1b')](_0x7b2a('0xe'),auth[_0x7b2a('0xd')](),controller[_0x7b2a('0x1c')]);router[_0x7b2a('0x1b')](_0x7b2a('0x12'),auth[_0x7b2a('0xd')](),controller[_0x7b2a('0x1d')]);module[_0x7b2a('0x1e')]=router; \ No newline at end of file +var _0xedf7=['../../config/environment','index','get','/describe','isAuthenticated','/:id','/:id/unread','getUnread','/:id/messages','post','create','/:id/members','addMembers','addMessage','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2dcb1d,_0xe7d520){var _0xde9de8=function(_0x31682c){while(--_0x31682c){_0x2dcb1d['push'](_0x2dcb1d['shift']());}};_0xde9de8(++_0xe7d520);}(_0xedf7,0x148));var _0x7edf=function(_0x57c439,_0x759b49){_0x57c439=_0x57c439-0x0;var _0x3523b6=_0xedf7[_0x57c439];return _0x3523b6;};'use strict';var multer=require(_0x7edf('0x0'));var util=require(_0x7edf('0x1'));var path=require(_0x7edf('0x2'));var timeout=require(_0x7edf('0x3'));var express=require(_0x7edf('0x4'));var router=express[_0x7edf('0x5')]();var fs_extra=require(_0x7edf('0x6'));var auth=require(_0x7edf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7edf('0x8'));var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7edf('0x9')]);router[_0x7edf('0xa')](_0x7edf('0xb'),auth[_0x7edf('0xc')](),controller['describe']);router[_0x7edf('0xa')](_0x7edf('0xd'),auth[_0x7edf('0xc')](),controller['show']);router[_0x7edf('0xa')](_0x7edf('0xe'),auth['isAuthenticated'](),controller[_0x7edf('0xf')]);router[_0x7edf('0xa')]('/:id/members',auth[_0x7edf('0xc')](),controller['getMembers']);router[_0x7edf('0xa')](_0x7edf('0x10'),auth[_0x7edf('0xc')](),controller['getMessages']);router[_0x7edf('0x11')]('/',auth[_0x7edf('0xc')](),controller[_0x7edf('0x12')]);router[_0x7edf('0x11')](_0x7edf('0x13'),auth[_0x7edf('0xc')](),controller[_0x7edf('0x14')]);router['post'](_0x7edf('0x10'),auth[_0x7edf('0xc')](),controller[_0x7edf('0x15')]);router[_0x7edf('0x16')](_0x7edf('0xd'),auth['isAuthenticated'](),controller[_0x7edf('0x17')]);router['delete'](_0x7edf('0xd'),auth[_0x7edf('0xc')](),controller['destroy']);router['delete']('/:id/members',auth[_0x7edf('0xc')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 611f1e1..c3ba84d 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 _0xf69c=['ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','long'];(function(_0x225225,_0x5a30df){var _0x20a56a=function(_0x972296){while(--_0x972296){_0x225225['push'](_0x225225['shift']());}};_0x20a56a(++_0x5a30df);}(_0xf69c,0x1e2));var _0xcf69=function(_0x196e16,_0x168729){_0x196e16=_0x196e16-0x0;var _0x37531f=_0xf69c[_0x196e16];return _0x37531f;};'use strict';var Sequelize=require(_0xcf69('0x0'));module[_0xcf69('0x1')]={'closed':{'type':Sequelize[_0xcf69('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xcf69('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xcf69('0x4'),_0xcf69('0x5')),'defaultValue':_0xcf69('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xcf69('0x6')]},'mailTranscript':{'type':Sequelize[_0xcf69('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xcf69('0x8')]},'disposition':{'type':Sequelize[_0xcf69('0x7')]},'secondDisposition':{'type':Sequelize[_0xcf69('0x7')]},'thirdDisposition':{'type':Sequelize[_0xcf69('0x7')]},'note':{'type':Sequelize[_0xcf69('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xcf69('0x7')]},'osName':{'type':Sequelize[_0xcf69('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xcf69('0x7')]},'deviceVendor':{'type':Sequelize[_0xcf69('0x7')]},'deviceType':{'type':Sequelize[_0xcf69('0x7')]},'referer':{'type':Sequelize[_0xcf69('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xcf69('0x6')](_0xcf69('0x9'))},'read1stAt':{'type':Sequelize[_0xcf69('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcf69('0xa')]('in',_0xcf69('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xcf69('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xcf69('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xcf69('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3423=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x309ee3,_0x566df5){var _0x5333da=function(_0x4ede99){while(--_0x4ede99){_0x309ee3['push'](_0x309ee3['shift']());}};_0x5333da(++_0x566df5);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x3342('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3342('0x1')]},'ratingType':{'type':Sequelize[_0x3342('0x2')](_0x3342('0x3'),_0x3342('0x4')),'defaultValue':_0x3342('0x3')},'ratingMessage':{'type':Sequelize[_0x3342('0x5')]},'pathTranscript':{'type':Sequelize[_0x3342('0x5')]},'mailTranscript':{'type':Sequelize[_0x3342('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3342('0x7')]},'disposition':{'type':Sequelize[_0x3342('0x6')]},'secondDisposition':{'type':Sequelize[_0x3342('0x6')]},'thirdDisposition':{'type':Sequelize[_0x3342('0x6')]},'note':{'type':Sequelize[_0x3342('0x6')]},'browserName':{'type':Sequelize[_0x3342('0x6')]},'browserVersion':{'type':Sequelize[_0x3342('0x6')]},'osName':{'type':Sequelize[_0x3342('0x6')]},'osVersion':{'type':Sequelize[_0x3342('0x6')]},'deviceModel':{'type':Sequelize[_0x3342('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x3342('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x3342('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x3342('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3342('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x3342('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x3342('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 3aa3e5f..1678d56 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 _0xc5ba=['vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','CmContact','%s%d','System','customer','Visitor','website_alias','agentAlias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','secure','authentication','auth','pass','SendMail','sendMail','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','alias','setTags','spread','chatInteractionTags:save','removeTags','unix','root','server','files','attachments','transcript-%d-%s.zip','Owner','get','mkdirSync','Chat','Account','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','firstName','lastName','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','fast-json-patch','request-promise','bluebird','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./chatInteraction.socket','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','save','destroy','end','name','send','merge','body','contact','agent','interaction','account','Users','Tags','TagIds','split','forEach','push','waiting','talking','answered','unmanaged','closed','disposition','abandoned','UserId','total','index','map','rawAttributes','type','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','filters','pick','select','field','color','from','u.id','ui.ChatInteractionId','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','tools_tags','expr','search','parseSearch','sqlOperator','unreadMessages','value','having','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','compact','isEmpty','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','toString','keyBy','ChatInteraction','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','sequelize','groupBy','ChatInteractionId','all','rows','show','params','fields','includeAll','options','create','update','describe','createVidaooSession','findOne','ChatWebsite'];(function(_0x50efba,_0x880a80){var _0x37618d=function(_0x555428){while(--_0x555428){_0x50efba['push'](_0x50efba['shift']());}};_0x37618d(++_0x880a80);}(_0xc5ba,0x1b4));var _0xac5b=function(_0x553956,_0x57a991){_0x553956=_0x553956-0x0;var _0x2e4172=_0xc5ba[_0x553956];return _0x2e4172;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xac5b('0x0'));var rp=require(_0xac5b('0x1'));var moment=require('moment');var BPromise=require(_0xac5b('0x2'));var Mustache=require('mustache');var util=require(_0xac5b('0x3'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xac5b('0x4'));var fs=require('fs');var fs_extra=require(_0xac5b('0x5'));var _=require(_0xac5b('0x6'));var squel=require(_0xac5b('0x7'));var crypto=require(_0xac5b('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xac5b('0x9'));var toCsv=require(_0xac5b('0xa'));var querystring=require(_0xac5b('0xb'));var Papa=require(_0xac5b('0xc'));var Redis=require(_0xac5b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xac5b('0xe'));var as=require(_0xac5b('0xf'));var pdf=require(_0xac5b('0x10'));var hardwareService=require(_0xac5b('0x11'));var logger=require('../../config/logger')(_0xac5b('0x12'));var utils=require('../../config/utils');var config=require(_0xac5b('0x13'));var licenseUtil=require(_0xac5b('0x14'));var db=require(_0xac5b('0x15'))['db'];config['redis']=_[_0xac5b('0x16')](config[_0xac5b('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac5b('0x17')]));require(_0xac5b('0x18'))[_0xac5b('0x19')](socket);var jayson=require(_0xac5b('0x1a'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0xac5b('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x30e08a,_0x2e6a6b,_0x5423aa,_0x49f7e6){return new BPromise(function(_0xcc5646,_0x3f1605){var _0xfa556f=_0x49f7e6||client;return _0xfa556f[_0xac5b('0x1c')](_0x30e08a,_0x5423aa)[_0xac5b('0x1d')](function(_0x1415c1){logger[_0xac5b('0x1e')](_0xac5b('0x1f'),_0x2e6a6b,_0xac5b('0x20'));logger[_0xac5b('0x21')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2e6a6b,_0xac5b('0x20'),JSON[_0xac5b('0x22')](_0x1415c1));if(_0x1415c1[_0xac5b('0x23')]){if(_0x1415c1[_0xac5b('0x23')][_0xac5b('0x24')]===0x1f4){logger[_0xac5b('0x23')](_0xac5b('0x1f'),_0x2e6a6b,_0x1415c1[_0xac5b('0x23')][_0xac5b('0x25')]);return _0x3f1605(_0x1415c1[_0xac5b('0x23')][_0xac5b('0x25')]);}logger[_0xac5b('0x23')](_0xac5b('0x1f'),_0x2e6a6b,_0x1415c1[_0xac5b('0x23')][_0xac5b('0x25')]);return _0xcc5646(_0x1415c1['error']['message']);}else{logger[_0xac5b('0x1e')](_0xac5b('0x1f'),_0x2e6a6b,_0xac5b('0x20'));_0xcc5646(_0x1415c1[_0xac5b('0x26')][_0xac5b('0x25')]);}})[_0xac5b('0x27')](function(_0x58ad64){logger[_0xac5b('0x23')](_0xac5b('0x1f'),_0x2e6a6b,_0x58ad64);_0x3f1605(_0x58ad64);});});}function respondWithStatusCode(_0x28d05b,_0x471dc4){_0x471dc4=_0x471dc4||0xcc;return function(_0x27110f){if(_0x27110f){return _0x28d05b[_0xac5b('0x28')](_0x471dc4);}return _0x28d05b[_0xac5b('0x29')](_0x471dc4)['end']();};}function respondWithResult(_0x5e5699,_0x3aec82){_0x3aec82=_0x3aec82||0xc8;return function(_0x4889b4){if(_0x4889b4){return _0x5e5699[_0xac5b('0x29')](_0x3aec82)[_0xac5b('0x2a')](_0x4889b4);}};}function respondWithFilteredResult(_0x37307f,_0x47c564){return function(_0x1516df){if(_0x1516df){var _0x4099ef=typeof _0x47c564['offset']===_0xac5b('0x2b')&&typeof _0x47c564[_0xac5b('0x2c')]==='undefined';var _0x1923f1=_0x1516df['count'];var _0x18722c=_0x4099ef?0x0:_0x47c564[_0xac5b('0x2d')];var _0x4f66d4=_0x4099ef?_0x1516df[_0xac5b('0x2e')]:_0x47c564[_0xac5b('0x2d')]+_0x47c564[_0xac5b('0x2c')];var _0x222129;if(_0x4f66d4>=_0x1923f1){_0x4f66d4=_0x1923f1;_0x222129=0xc8;}else{_0x222129=0xce;}_0x37307f[_0xac5b('0x29')](_0x222129);return _0x37307f[_0xac5b('0x2f')]('Content-Range',_0x18722c+'-'+_0x4f66d4+'/'+_0x1923f1)[_0xac5b('0x2a')](_0x1516df);}return null;};}function patchUpdates(_0x5a72f2){return function(_0x2b1cde){try{jsonpatch[_0xac5b('0x30')](_0x2b1cde,_0x5a72f2,!![]);}catch(_0x39ca6d){return BPromise[_0xac5b('0x31')](_0x39ca6d);}return _0x2b1cde[_0xac5b('0x32')]();};}function saveUpdates(_0xc919c0,_0x5bb812){return function(_0x17548f){if(_0x17548f){return _0x17548f['update'](_0xc919c0)[_0xac5b('0x1d')](function(_0x12e33b){return _0x12e33b;});}return null;};}function removeEntity(_0x32c6c7,_0x4f384a){return function(_0x18009a){if(_0x18009a){return _0x18009a[_0xac5b('0x33')]()[_0xac5b('0x1d')](function(){_0x32c6c7['status'](0xcc)[_0xac5b('0x34')]();});}};}function handleEntityNotFound(_0x531804,_0x13e949){return function(_0x4185da){if(!_0x4185da){_0x531804[_0xac5b('0x28')](0x194);}return _0x4185da;};}function handleError(_0x3104d5,_0x4633ee){_0x4633ee=_0x4633ee||0x1f4;return function(_0x484096){logger[_0xac5b('0x23')](_0x484096['stack']);if(_0x484096[_0xac5b('0x35')]){delete _0x484096[_0xac5b('0x35')];}_0x3104d5[_0xac5b('0x29')](_0x4633ee)[_0xac5b('0x36')](_0x484096);};}function getMustacheRender(_0x184258,_0x4a789f){return Mustache['render'](_0x184258,_[_0xac5b('0x37')](_0x4a789f[_0xac5b('0x38')],{'contact':_0x4a789f[_0xac5b('0x39')],'message':_0x4a789f[_0xac5b('0x25')],'agent':_0x4a789f[_0xac5b('0x3a')],'interaction':_0x4a789f[_0xac5b('0x3b')],'account':_0x4a789f[_0xac5b('0x3c')]}))||'';}function getInteractionUsers(_0x1617ca,_0x2c9d48){return new BPromise(function(_0x557efd,_0x5da1b6){try{if(_0x2c9d48[_0x1617ca['id']]){_0x1617ca[_0xac5b('0x3d')]=_['map'](_0x2c9d48[_0x1617ca['id']],function(_0x9ab50a){return{'id':_0x9ab50a['id'],'fullname':_0x9ab50a['fullname']};});}}catch(_0x43d4f9){_0x5da1b6(_0x43d4f9);}_0x557efd(_0x1617ca);});}function getInteractionTags(_0x114c98,_0x163dc9){return new BPromise(function(_0x3afe07,_0x2e1133){try{if(_0x114c98['TagIds']){_0x114c98[_0xac5b('0x3e')]=[];_0x114c98[_0xac5b('0x3f')][_0xac5b('0x40')](',')[_0xac5b('0x41')](function(_0xe5bb22){_0x114c98['Tags'][_0xac5b('0x42')](_0x163dc9[_0xe5bb22]);});}delete _0x114c98[_0xac5b('0x3f')];}catch(_0x6f70fd){_0x2e1133(_0x6f70fd);}_0x3afe07(_0x114c98);});}function updateChatInteraction(_0x5f258d,_0x2de9f7,_0x51bd6c){return new BPromise(function(_0x1352b7,_0x4c4814){return getInteractionUsers(_0x5f258d,_0x51bd6c)[_0xac5b('0x1d')](function(_0x14cb93){return getInteractionTags(_0x14cb93,_0x2de9f7);})[_0xac5b('0x1d')](function(_0x53f09e){return getStateInteraction(_0x53f09e);})[_0xac5b('0x1d')](function(_0x24aa27){_0x1352b7(_0x24aa27);})[_0xac5b('0x27')](function(_0x2ebf71){_0x4c4814(_0x2ebf71);});});}function getStateInteraction(_0x414cca){return new BPromise(function(_0x5c7e14){_0x414cca[_0xac5b('0x43')]=0x0;_0x414cca[_0xac5b('0x44')]=0x0;_0x414cca[_0xac5b('0x45')]=0x0;_0x414cca[_0xac5b('0x46')]=0x0;_0x414cca['abandoned']=0x0;_0x414cca['total']=0x0;if(!_0x414cca[_0xac5b('0x47')]&&!_0x414cca['UserId']){_0x414cca[_0xac5b('0x43')]+=0x1;}if(!_0x414cca[_0xac5b('0x47')]&&_0x414cca['UserId']){_0x414cca[_0xac5b('0x44')]+=0x1;if(_0x414cca[_0xac5b('0x43')]){_0x414cca[_0xac5b('0x43')]-=0x1;}}if(_0x414cca[_0xac5b('0x47')]&&_0x414cca[_0xac5b('0x48')]===_0xac5b('0x49')){_0x414cca[_0xac5b('0x49')]+=0x1;if(_0x414cca[_0xac5b('0x43')]){_0x414cca[_0xac5b('0x43')]-=0x1;}}else if(_0x414cca['closed']&&!_0x414cca['UserId']&&_0x414cca['disposition']){_0x414cca[_0xac5b('0x46')]+=0x1;if(_0x414cca['waiting']){_0x414cca[_0xac5b('0x43')]-=0x1;}}else if(_0x414cca['closed']&&_0x414cca[_0xac5b('0x4a')]){_0x414cca[_0xac5b('0x45')]+=0x1;if(_0x414cca['talking']){_0x414cca[_0xac5b('0x44')]-=0x1;}}_0x414cca[_0xac5b('0x4b')]+=0x1;_0x5c7e14(_0x414cca);});}exports[_0xac5b('0x4c')]=function(_0x1216cb,_0x302965){var _0x4162a6={},_0x34b895={},_0x671bf1={'count':0x0,'rows':[]};var _0x2409d8=_[_0xac5b('0x4d')](db['ChatInteraction'][_0xac5b('0x4e')],function(_0x761963){return{'name':_0x761963['fieldName'],'type':_0x761963[_0xac5b('0x4f')]['key']};});_0x34b895[_0xac5b('0x50')]=_[_0xac5b('0x4d')](_0x2409d8,_0xac5b('0x35'));_0x34b895['query']=_[_0xac5b('0x51')](_0x1216cb[_0xac5b('0x52')]);_0x34b895['filters']=_[_0xac5b('0x53')](_0x34b895[_0xac5b('0x50')],_0x34b895['query']);_0x4162a6[_0xac5b('0x54')]=_[_0xac5b('0x53')](_0x34b895[_0xac5b('0x50')],qs['fields'](_0x1216cb['query']['fields']));_0x4162a6[_0xac5b('0x54')]=_0x4162a6[_0xac5b('0x54')][_0xac5b('0x55')]?_0x4162a6[_0xac5b('0x54')]:_0x34b895['model'];if(!_0x1216cb[_0xac5b('0x52')][_0xac5b('0x56')]('nolimit')){_0x4162a6[_0xac5b('0x2c')]=qs['limit'](_0x1216cb['query']['limit']);_0x4162a6[_0xac5b('0x2d')]=qs[_0xac5b('0x2d')](_0x1216cb[_0xac5b('0x52')][_0xac5b('0x2d')]);}_0x4162a6[_0xac5b('0x57')]=qs['sort'](_0x1216cb[_0xac5b('0x52')][_0xac5b('0x58')]);_0x4162a6['where']=qs[_0xac5b('0x59')](_[_0xac5b('0x5a')](_0x1216cb[_0xac5b('0x52')],_0x34b895[_0xac5b('0x59')]),_0x2409d8);var _0x5e9320=[];var _0x181de7=squel[_0xac5b('0x5b')]()[_0xac5b('0x5c')]('id')[_0xac5b('0x5c')](_0xac5b('0x35'))[_0xac5b('0x5c')](_0xac5b('0x5d'))[_0xac5b('0x5e')]('tools_tags');var _0xa26689=squel[_0xac5b('0x5b')]()[_0xac5b('0x5c')](_0xac5b('0x5f'))['field']('u.fullname')[_0xac5b('0x5c')](_0xac5b('0x60'))[_0xac5b('0x5e')](_0xac5b('0x61'),'ui')['left_join'](_0xac5b('0x62'),'u',_0xac5b('0x63'));var _0xf269f9=squel[_0xac5b('0x5b')]()['from'](_0xac5b('0x64'),'i')[_0xac5b('0x65')](_0xac5b('0x66'),'c',_0xac5b('0x67'))['left_join'](_0xac5b('0x62'),'o','o.id\x20=\x20i.UserId')[_0xac5b('0x65')](_0xac5b('0x68'),'a',_0xac5b('0x69'))[_0xac5b('0x65')](_0xac5b('0x6a'),'me',_0xac5b('0x6b'))[_0xac5b('0x65')](_0xac5b('0x6c'),'it','it.ChatInteractionId\x20=\x20i.id')['left_join'](_0xac5b('0x6d'),'t','t.id\x20=\x20it.TagId');var _0x377235=squel['expr']();var _0x2f5a68=[];var _0x285632=squel[_0xac5b('0x6e')]();var _0x342abd;if(_0x1216cb['query'][_0xac5b('0x6f')]){_0x342abd=as[_0xac5b('0x70')](_0x1216cb[_0xac5b('0x52')][_0xac5b('0x6f')]);var _0x1f2319=_0x342abd[_0xac5b('0x71')];for(var _0x15d669=0x0;_0x15d669<_0x342abd['conditions'][_0xac5b('0x55')];_0x15d669++){var _0x2a0558=_0x342abd['conditions'][_0x15d669];var _0x4b7058='i';var _0x35bfdb=_['find'](_0x2409d8,[_0xac5b('0x35'),_0x2a0558['field']]);if(!_0x35bfdb){switch(_0x2a0558[_0xac5b('0x5c')]){case _0xac5b('0x72'):if(_0x2a0558[_0xac5b('0x73')]==0x1){_0xf269f9[_0xac5b('0x74')]('`'+_0x2a0558[_0xac5b('0x5c')]+'`\x20=\x200');}else{_0xf269f9[_0xac5b('0x74')]('`'+_0x2a0558[_0xac5b('0x5c')]+'`\x20>\x200');}break;case _0xac5b('0x75'):if(_0x2a0558[_0xac5b('0x76')]===_0xac5b('0x77')){if(_0x2a0558[_0xac5b('0x73')]['split']('\x20')[_0xac5b('0x55')]>0x1){_0x377235[_0x1f2319]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xac5b('0x78')](_0x2a0558[_0xac5b('0x73')]),null);}else{var _0x479e45='%'+_0x2a0558[_0xac5b('0x73')]+'%';_0x377235[_0x1f2319](_0xac5b('0x79'),_0x479e45,_0x479e45,_0x479e45);}}else{_0x35bfdb=_[_0xac5b('0x7a')](_0x2409d8,[_0xac5b('0x35'),_0xac5b('0x7b')]);_0x2a0558['field']=_0xac5b('0x7b');_0x214ecc=as[_0xac5b('0x7c')](_0x4b7058,_0x35bfdb[_0xac5b('0x4f')],_0x2a0558);_0x377235[_0x1f2319](_0x214ecc[_0xac5b('0x7d')],_0x214ecc[_0xac5b('0x73')]['start'],_0x214ecc[_0xac5b('0x73')][_0xac5b('0x34')]);}break;case _0xac5b('0x7e'):var _0x29e385=_0x2a0558[_0xac5b('0x73')]['split'](',')[_0xac5b('0x4d')](function(_0xa2204c){return Number(_0xa2204c);});_0x29e385['forEach'](function(_0xa88911){_0x285632['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xa88911+',%');});_0x2f5a68=_['union'](_0x2f5a68,_0x29e385);break;case _0xac5b('0x7f'):if(_0x2a0558[_0xac5b('0x76')]===_0xac5b('0x77')){_0x377235[_0x1f2319](_0xac5b('0x80'),'%'+_0x2a0558[_0xac5b('0x73')]+'%',null);}else{_0x35bfdb=_['find'](_0x2409d8,['name',_0xac5b('0x4a')]);_0x2a0558[_0xac5b('0x5c')]='UserId';_0x214ecc=as[_0xac5b('0x7c')](_0x4b7058,_0x35bfdb[_0xac5b('0x4f')],_0x2a0558);_0x377235[_0x1f2319](_0x214ecc[_0xac5b('0x7d')],_0x214ecc[_0xac5b('0x73')][_0xac5b('0x81')],_0x214ecc[_0xac5b('0x73')][_0xac5b('0x34')]);}break;case _0xac5b('0x38'):_0x214ecc=as['buildExpression']('me',null,_0x2a0558);_0x377235[_0x1f2319](_0x214ecc[_0xac5b('0x7d')],_0x214ecc['value'][_0xac5b('0x81')],_0x214ecc[_0xac5b('0x73')][_0xac5b('0x34')]);break;}}else{var _0x214ecc=as[_0xac5b('0x7c')](_0x4b7058,_0x35bfdb['type'],_0x2a0558);_0x377235[_0x1f2319](_0x214ecc[_0xac5b('0x7d')],_0x214ecc[_0xac5b('0x73')][_0xac5b('0x81')],_0x214ecc[_0xac5b('0x73')][_0xac5b('0x34')]);}}}else{var _0x3ddaf1=_(_0x1216cb[_0xac5b('0x52')])[_0xac5b('0x51')]()[_0xac5b('0x4d')](function(_0x5ace4c){return _[_0xac5b('0x82')](_0x2409d8,[_0xac5b('0x35'),_0x5ace4c])?_0x5ace4c:undefined;})[_0xac5b('0x83')]()['value']();if(!_[_0xac5b('0x84')](_0x3ddaf1)){_0x3ddaf1[_0xac5b('0x41')](function(_0x36e240){if(_0x36e240==='ChatWebsiteId'){_0xf269f9[_0xac5b('0x85')](_0xac5b('0x86'),[][_0xac5b('0x87')](_0x1216cb[_0xac5b('0x52')][_0x36e240]));}else if(_0x36e240===_0xac5b('0x88')){var _0x64f692=JSON[_0xac5b('0x89')](_0x1216cb[_0xac5b('0x52')][_0x36e240])['$gte'];var _0x25fef7=JSON[_0xac5b('0x89')](_0x1216cb[_0xac5b('0x52')][_0x36e240])[_0xac5b('0x8a')];_0xf269f9[_0xac5b('0x85')](_0xac5b('0x8b'),_0x64f692,_0x25fef7);}else{if(_0x1216cb[_0xac5b('0x52')][_0x36e240]===_0xac5b('0x8c')){_0xf269f9[_0xac5b('0x85')]('i.'+_0x36e240+_0xac5b('0x8d'));}else{_0xf269f9[_0xac5b('0x85')]('i.'+_0x36e240+'\x20=\x20?',_0x1216cb[_0xac5b('0x52')][_0x36e240]);}}});}if(_0x1216cb[_0xac5b('0x52')][_0xac5b('0x8e')]){if(_0x1216cb[_0xac5b('0x52')]['read']==0x1){_0xf269f9[_0xac5b('0x74')](_0xac5b('0x8f'));}else{_0xf269f9[_0xac5b('0x74')](_0xac5b('0x90'));}}if(_0x1216cb[_0xac5b('0x52')][_0xac5b('0x91')]){_0x2f5a68=_['isArray'](_0x1216cb[_0xac5b('0x52')][_0xac5b('0x91')])?_0x1216cb[_0xac5b('0x52')]['tag']:new Array(_0x1216cb['query'][_0xac5b('0x91')]);_0x2f5a68['forEach'](function(_0x3877dd){_0x285632['or'](_0xac5b('0x92'),'%,'+_0x3877dd+',%');});}if(_0x1216cb[_0xac5b('0x52')][_0xac5b('0x93')]){var _0x5804de=_0x1216cb[_0xac5b('0x52')][_0xac5b('0x93')][_0xac5b('0x94')]('\x5c','\x5c\x5c')[_0xac5b('0x94')](/'/g,'\x27\x27');if(qs[_0xac5b('0x95')](_0x5804de)){_0x377235['or'](_0xac5b('0x96'),_0x5804de+'%');}else{_0x377235['or'](_0xac5b('0x97'),qs[_0xac5b('0x78')](_0x5804de))['or'](_0xac5b('0x98'),_0x5804de+'%');}}}_0xf269f9[_0xac5b('0x85')](_0x377235);_0xf269f9[_0xac5b('0x99')](_0xac5b('0x9a'));var _0x8b5c91={'type':db[_0xac5b('0x9b')][_0xac5b('0x9c')][_0xac5b('0x9d')],'raw':!![]};var _0x2a2003=_0xf269f9['clone']();_0x2a2003[_0xac5b('0x5c')](_0xac5b('0x9a'));_0x2a2003[_0xac5b('0x5c')](_0xac5b('0x9e'),_0xac5b('0x72'));if(_0x4162a6[_0xac5b('0x57')]){_0x4162a6[_0xac5b('0x57')][_0xac5b('0x41')](function(_0x406fa2){var _0x19a08e=_0x406fa2[0x0]===_0xac5b('0x9f')?_0x406fa2[0x0]:'i.'+_0x406fa2[0x0];_0xf269f9['order'](_0x19a08e,_0x406fa2[0x1]===_0xac5b('0xa0')?![]:!![]);});}if(!_['isEmpty'](_0x2f5a68)){_0xf269f9[_0xac5b('0x74')](_0x285632);_0x2a2003[_0xac5b('0x85')]('t.id\x20IN\x20?',_0x2f5a68);}BPromise[_0xac5b('0xa1')]()['then'](function(){if(!_0x342abd){if(_0x1216cb['query'][_0xac5b('0xa2')])return;_0x2a2003[_0xac5b('0x85')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xf269f9['where'](_0xac5b('0xa3'));return;}if(_0x1216cb[_0xac5b('0xa4')][_0xac5b('0xa5')]!=='agent')return;return _0x1216cb[_0xac5b('0xa4')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xac5b('0x1d')](function(_0xd87cf4){if(_[_0xac5b('0x84')](_0xd87cf4)){_0x2a2003[_0xac5b('0x85')](_0xac5b('0xa6'));_0xf269f9['where'](_0xac5b('0xa6'));}else{_0x2a2003[_0xac5b('0x85')](_0xac5b('0x86'),_['map'](_0xd87cf4,'id'));_0xf269f9[_0xac5b('0x85')](_0xac5b('0x86'),_[_0xac5b('0x4d')](_0xd87cf4,'id'));}});})[_0xac5b('0x1d')](function(){if(_0x1216cb[_0xac5b('0xa4')][_0xac5b('0xa5')]===_0xac5b('0x3a')&&!_0x342abd&&!_0x1216cb[_0xac5b('0x52')][_0xac5b('0xa2')])return[];return db['sequelize'][_0xac5b('0x52')](_0x2a2003[_0xac5b('0xa7')](),_0x8b5c91);})['then'](function(_0xf95879){_0x671bf1[_0xac5b('0x2e')]=_0xf95879[_0xac5b('0x55')];if(_0x671bf1['count']===0x0)return[];return db['sequelize'][_0xac5b('0x52')](_0x181de7[_0xac5b('0xa7')](),_0x8b5c91)[_0xac5b('0x1d')](function(_0x22a9e3){_0x5e9320=_[_0xac5b('0xa8')](_0x22a9e3,'id');_0x8b5c91=_[_0xac5b('0x37')](_0x8b5c91,{'model':db[_0xac5b('0xa9')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1216cb[_0xac5b('0x52')]['fields']){_0x4162a6[_0xac5b('0x54')][_0xac5b('0x41')](function(_0x382857){_0xf269f9[_0xac5b('0x5c')]('i.'+_0x382857);});}else{_0xf269f9[_0xac5b('0x5c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xac5b('0x72'));_0xf269f9[_0xac5b('0x5c')](_0xac5b('0xaa'),_0xac5b('0xab'));_0xf269f9[_0xac5b('0x5c')](_0xac5b('0xac'),'Account.mandatoryDisposition');_0xf269f9['field'](_0xac5b('0xad'),'contactName');_0xf269f9[_0xac5b('0x5c')]('i.*');_0xf269f9[_0xac5b('0x5c')](_0xac5b('0xae'),_0xac5b('0xaf'));_0xf269f9[_0xac5b('0x5c')](_0xac5b('0xb0'),_0xac5b('0xb1'));_0xf269f9[_0xac5b('0x5c')](_0xac5b('0xb2'),_0xac5b('0xb3'));_0xf269f9[_0xac5b('0x5c')](_0xac5b('0xb4'),_0xac5b('0xb5'));_0xf269f9['field'](_0xac5b('0xb6'),_0xac5b('0xb7'));_0xf269f9[_0xac5b('0x5c')]('c.fax',_0xac5b('0xb8'));_0xf269f9['field'](_0xac5b('0xb9'),_0xac5b('0xba'));_0xf269f9[_0xac5b('0x5c')](_0xac5b('0xbb'),'Owner.internal');_0xf269f9[_0xac5b('0x5c')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xac5b('0x3f'));}if(_0x4162a6[_0xac5b('0x2c')])_0xf269f9['limit'](_0x4162a6[_0xac5b('0x2c')]);if(_0x4162a6['offset'])_0xf269f9['offset'](_0x4162a6[_0xac5b('0x2d')]);return db[_0xac5b('0xbc')]['query'](_0xf269f9[_0xac5b('0xa7')](),_0x8b5c91);})['then'](function(_0x4cc4ea){if(_0x4cc4ea['length']>0x0)_0xa26689[_0xac5b('0x85')]('ui.ChatInteractionId\x20IN\x20?',_[_0xac5b('0x4d')](_0x4cc4ea,'id'));return db[_0xac5b('0xbc')][_0xac5b('0x52')](_0xa26689[_0xac5b('0xa7')](),_0x8b5c91)['then'](function(_0x1b8423){var _0x5d92e2=_[_0xac5b('0xbd')](_0x1b8423,_0xac5b('0xbe'));var _0x1823bc=[];_0x4cc4ea['forEach'](function(_0x4ee740){_0x1823bc[_0xac5b('0x42')](updateChatInteraction(_0x4ee740,_0x5e9320,_0x5d92e2));});return BPromise[_0xac5b('0xbf')](_0x1823bc);});});})[_0xac5b('0x1d')](function(_0x49c265){_0x671bf1[_0xac5b('0xc0')]=_0x49c265;return _0x671bf1;})[_0xac5b('0x1d')](respondWithFilteredResult(_0x302965,_0x4162a6))[_0xac5b('0x27')](handleError(_0x302965,null));};exports[_0xac5b('0xc1')]=function(_0x221502,_0xa28810){var _0x52d8a6={'raw':![],'where':{'id':_0x221502[_0xac5b('0xc2')]['id']}},_0x3c510d={};_0x3c510d[_0xac5b('0x50')]=_['keys'](db[_0xac5b('0xa9')]['rawAttributes']);_0x3c510d[_0xac5b('0x52')]=_[_0xac5b('0x51')](_0x221502[_0xac5b('0x52')]);_0x3c510d[_0xac5b('0x59')]=_[_0xac5b('0x53')](_0x3c510d[_0xac5b('0x50')],_0x3c510d[_0xac5b('0x52')]);_0x52d8a6[_0xac5b('0x54')]=_[_0xac5b('0x53')](_0x3c510d[_0xac5b('0x50')],qs['fields'](_0x221502[_0xac5b('0x52')][_0xac5b('0xc3')]));_0x52d8a6[_0xac5b('0x54')]=_0x52d8a6[_0xac5b('0x54')]['length']?_0x52d8a6['attributes']:_0x3c510d['model'];if(_0x221502[_0xac5b('0x52')][_0xac5b('0xc4')]){_0x52d8a6['include']=[{'all':!![]}];}_0x52d8a6=_[_0xac5b('0x37')]({},_0x52d8a6,_0x221502[_0xac5b('0xc5')]);return db['ChatInteraction'][_0xac5b('0x7a')](_0x52d8a6)[_0xac5b('0x1d')](handleEntityNotFound(_0xa28810,null))[_0xac5b('0x1d')](respondWithResult(_0xa28810,null))[_0xac5b('0x27')](handleError(_0xa28810,null));};exports[_0xac5b('0xc6')]=function(_0x6e0780,_0x43d116){return db['ChatInteraction'][_0xac5b('0xc6')](_0x6e0780[_0xac5b('0x38')],{})['then'](respondWithResult(_0x43d116,0xc9))['catch'](handleError(_0x43d116,null));};exports[_0xac5b('0xc7')]=function(_0x53b2e1,_0x2e118a){if(_0x53b2e1[_0xac5b('0x38')]['id']){delete _0x53b2e1[_0xac5b('0x38')]['id'];}return db[_0xac5b('0xa9')][_0xac5b('0x7a')]({'where':{'id':_0x53b2e1['params']['id']}})[_0xac5b('0x1d')](handleEntityNotFound(_0x2e118a,null))['then'](saveUpdates(_0x53b2e1[_0xac5b('0x38')],null))[_0xac5b('0x1d')](respondWithResult(_0x2e118a,null))[_0xac5b('0x27')](handleError(_0x2e118a,null));};exports[_0xac5b('0x33')]=function(_0x1c1e63,_0xf3dcf9){return db[_0xac5b('0xa9')]['find']({'where':{'id':_0x1c1e63['params']['id']}})['then'](handleEntityNotFound(_0xf3dcf9,null))[_0xac5b('0x1d')](removeEntity(_0xf3dcf9,null))['catch'](handleError(_0xf3dcf9,null));};exports[_0xac5b('0xc8')]=function(_0x3c508b,_0x18f888){return db['ChatInteraction'][_0xac5b('0xc8')]()[_0xac5b('0x1d')](respondWithResult(_0x18f888,null))[_0xac5b('0x27')](handleError(_0x18f888,null));};exports[_0xac5b('0xc9')]=function(_0x14e6c8,_0x592ef3){var _0x4a5da5=_0x14e6c8[_0xac5b('0xc2')]['id'];var _0x5f32c6;var _0x125481;var _0x138147;return db[_0xac5b('0xa9')][_0xac5b('0xca')]({'where':{'id':_0x4a5da5}})[_0xac5b('0x1d')](function(_0x332db6){_0x5f32c6=_0x332db6;return db[_0xac5b('0xcb')][_0xac5b('0xca')]({'where':{'id':_0x332db6[_0xac5b('0xa2')]},'attributes':['id',_0xac5b('0xcc'),_0xac5b('0xcd'),_0xac5b('0xce'),_0xac5b('0xcf'),_0xac5b('0xd0')],'raw':!![]});})[_0xac5b('0x1d')](function(_0x1dffa2){if(_0x1dffa2&&_0x1dffa2[_0xac5b('0xcc')]&&_0x1dffa2[_0xac5b('0xcd')]){_0x125481=_0x1dffa2;var _0x34dc59={'interaction':{'id':_0x4a5da5},'agent':{'id':_0x14e6c8[_0xac5b('0xa4')]['id'],'name':_0x14e6c8[_0xac5b('0xa4')][_0xac5b('0x35')],'fullname':_0x14e6c8[_0xac5b('0xa4')][_0xac5b('0xd1')],'email':_0x14e6c8[_0xac5b('0xa4')][_0xac5b('0xd2')]},'contact':_0x14e6c8[_0xac5b('0x38')][_0xac5b('0x39')],'account':_0x14e6c8[_0xac5b('0x38')][_0xac5b('0x3c')]};var _0x57d918={'rejectUnauthorized':![],'method':_0xac5b('0xd3'),'url':_0xac5b('0xd4'),'headers':{'X-APIKEY':_0x1dffa2[_0xac5b('0xcc')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x14e6c8[_0xac5b('0xa4')][_0xac5b('0xd2')]],'buttons':null,'topic':_0x125481[_0xac5b('0xce')],'note':_[_0xac5b('0xd5')](_0x125481[_0xac5b('0xcf')])?null:getMustacheRender(_0x125481[_0xac5b('0xcf')],_0x34dc59),'metadata':null},'redirect':_0xac5b('0xd6'),'json':!![]};try{if(!_[_0xac5b('0xd5')](_0x125481['vidaooMetadata'])){var _0x5df092=getMustacheRender(_0x125481['vidaooMetadata'],_0x34dc59);var _0x563951=JSON[_0xac5b('0x89')](_0x5df092);_0x57d918['body'][_0xac5b('0xd7')]=_0x563951;}}catch(_0x181505){throw new db[(_0xac5b('0x9b'))][(_0xac5b('0xd8'))](_0xac5b('0xd9'));}return rp(_0x57d918);}else{throw new db[(_0xac5b('0x9b'))][(_0xac5b('0xd8'))](_0xac5b('0xda'));}})[_0xac5b('0x1d')](function(_0x1bfa4d){_0x138147=_0x1bfa4d;if(_0x138147['id']){var _0x568e13={'body':_0x138147[_0xac5b('0xdb')],'ChatWebsiteId':_0x125481['id'],'ChatInteractionId':_0x5f32c6['id'],'direction':_0xac5b('0xdc'),'UserId':_0x14e6c8[_0xac5b('0xa4')]['id']};return db['ChatMessage'][_0xac5b('0xc6')](_0x568e13,{});}else{throw new db[(_0xac5b('0x9b'))][(_0xac5b('0xd8'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xac5b('0x1d')](function(){return _0x5f32c6[_0xac5b('0xdd')]({'vidaooSessionId':_0x138147['id']});})[_0xac5b('0x1d')](respondWithResult(_0x592ef3,null))[_0xac5b('0x27')](handleError(_0x592ef3,null));};exports[_0xac5b('0xde')]=function(_0xfeb2d2,_0x4f6f15){if(_0xfeb2d2['body']['id']){delete _0xfeb2d2[_0xac5b('0x38')]['id'];}return db[_0xac5b('0xa9')][_0xac5b('0x7a')]({'where':{'id':_0xfeb2d2[_0xac5b('0xc2')]['id']},'include':[{'model':db['CmContact'],'as':_0xac5b('0x75')}]})[_0xac5b('0x1d')](handleEntityNotFound(_0x4f6f15,null))[_0xac5b('0x1d')](saveUpdates(_0xfeb2d2[_0xac5b('0x38')],null))[_0xac5b('0x1d')](respondWithResult(_0x4f6f15,null))['catch'](handleError(_0x4f6f15,null));};exports['abandon']=function(_0x15cb07,_0x30aeea,_0x11fb85){if(_0x15cb07[_0xac5b('0x38')]['id']){delete _0x15cb07['body']['id'];}return db[_0xac5b('0xa9')][_0xac5b('0x7a')]({'where':{'id':_0x15cb07[_0xac5b('0xc2')]['id']}})['then'](function(_0x418bff){if(!_0x418bff){logger[_0xac5b('0x23')](_0xac5b('0xdf'),_0xac5b('0xe0'),0x194,'entity\x20not\x20found');_0x30aeea['sendStatus'](0x194);}else{if(_0x418bff[_0xac5b('0x4a')]){throw new db[(_0xac5b('0x9b'))][(_0xac5b('0xd8'))](_0xac5b('0xe1'));}}return _0x418bff;})[_0xac5b('0x1d')](function(_0xbee0da){if(_0xbee0da){return _0xbee0da[_0xac5b('0xc7')]({'closed':_0x15cb07['body'][_0xac5b('0x47')],'disposition':_0x15cb07[_0xac5b('0x38')]['disposition']})[_0xac5b('0x1d')](function(_0x5019b9){return _0x5019b9;});}})[_0xac5b('0x1d')](function(_0x15bf47){return respondWithRpcPromise(_0xac5b('0xe2'),_0xac5b('0xe0'),_0x15cb07['body'],client9004);})[_0xac5b('0x1d')](respondWithResult(_0x30aeea,null))[_0xac5b('0x27')](handleError(_0x30aeea,null));};exports[_0xac5b('0xe3')]=function(_0x3e1dc8,_0x26ed6a,_0x1835ef){_0x3e1dc8[_0xac5b('0x38')]['name']=_0x3e1dc8[_0xac5b('0xe4')][_0xac5b('0xe5')];_0x3e1dc8[_0xac5b('0x38')][_0xac5b('0xe6')]=_0x3e1dc8['file'][_0xac5b('0xe7')];_0x3e1dc8[_0xac5b('0x38')][_0xac5b('0x4f')]=_0x3e1dc8[_0xac5b('0xe4')][_0xac5b('0xe8')];return db[_0xac5b('0xe9')][_0xac5b('0xc6')](_0x3e1dc8['body'])[_0xac5b('0x1d')](respondWithResult(_0x26ed6a,0xc9))[_0xac5b('0x27')](handleError(_0x26ed6a,null));};exports[_0xac5b('0xea')]=function(_0x31f328,_0x3a2ddf,_0x1a6121){return db[_0xac5b('0xa9')]['findOne']({'where':{'id':_0x31f328[_0xac5b('0xc2')]['id']},'raw':!![]})[_0xac5b('0x1d')](handleEntityNotFound(_0x3a2ddf,null))[_0xac5b('0x1d')](function(_0x47e30){if(_0x47e30){if(_0x47e30[_0xac5b('0x47')]){return _0x3a2ddf[_0xac5b('0x29')](0x193)[_0xac5b('0x2a')]({'status':0x193,'message':_0xac5b('0xeb')});}return db[_0xac5b('0xe9')][_0xac5b('0xca')]({'where':{'id':_0x31f328[_0xac5b('0x52')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x3a2ddf,null));}})[_0xac5b('0x1d')](function(_0x36d33a){if(_0x36d33a){var _0x21f651=_0x36d33a[_0xac5b('0xec')]!==null;var _0x52dcb9=path[_0xac5b('0xed')](config['root'],'server/files/attachments/');if(_0x21f651){_0x52dcb9=path['join'](_0x52dcb9,_0xac5b('0xee'));}var _0x5b90d2=path[_0xac5b('0xed')](_0x52dcb9,_0x36d33a['basename']);return _0x3a2ddf[_0xac5b('0xef')](_0x5b90d2);}})[_0xac5b('0x27')](handleError(_0x3a2ddf,null));};exports[_0xac5b('0xf0')]=function(_0x1dd5e5,_0x36d740){var _0x5add44=null;var _0x4c43b7=null;var _0x5a4ccb=null;var _0x2d97f=null;if(_0x1dd5e5[_0xac5b('0x38')]['id']){delete _0x1dd5e5['body']['id'];}if(_0x1dd5e5[_0xac5b('0x38')][_0xac5b('0xf1')]){_0x2d97f=path[_0xac5b('0xed')](config['root'],_0xac5b('0xf2'),util[_0xac5b('0xf3')](_0xac5b('0xf4'),Date['now']()));_0x1dd5e5[_0xac5b('0x38')][_0xac5b('0xf5')]=_0x2d97f;}return db['ChatInteraction'][_0xac5b('0x7a')]({'where':{'id':_0x1dd5e5[_0xac5b('0xc2')]['id']},'include':[{'model':db[_0xac5b('0xf6')],'as':_0xac5b('0xf7'),'include':[{'model':db[_0xac5b('0x7f')],'as':'User'}]}]})[_0xac5b('0x1d')](handleEntityNotFound(_0x36d740,null))[_0xac5b('0x1d')](saveUpdates(_0x1dd5e5[_0xac5b('0x38')],null))[_0xac5b('0x1d')](function(_0x399786){if(_0x399786){_0x5add44=_0x399786;return db[_0xac5b('0xcb')][_0xac5b('0x7a')]({'where':{'id':_0x5add44[_0xac5b('0xa2')]}});}})[_0xac5b('0x1d')](function(_0x10a998){if(_0x10a998){_0x5a4ccb=_0x10a998;return db[_0xac5b('0xf8')][_0xac5b('0x7a')]({'where':{'id':_0x5add44[_0xac5b('0x7b')]}});}})[_0xac5b('0x1d')](function(_0x9ce672){if(_0x9ce672){_0x4c43b7=_0x9ce672;if(_0x2d97f){var _0x1f2b97=null;for(var _0x3891e6=0x1;_0x3891e6<_0x5add44[_0xac5b('0xf7')][_0xac5b('0x55')];++_0x3891e6){_0x1f2b97=_0x5add44[_0xac5b('0xf7')][_0x3891e6];var _0x11ab41=_0x1f2b97[_0xac5b('0x4a')]?util[_0xac5b('0xf3')](_0xac5b('0xf9'),_0x5a4ccb['agentAlias'],_0x1f2b97[_0xac5b('0x4a')]):_0xac5b('0xfa');var _0x4a47a8=_0x1dd5e5['body'][_0xac5b('0xfb')]||util[_0xac5b('0xf3')](_0xac5b('0xf9'),_0xac5b('0xfc'),_0x1f2b97[_0xac5b('0x7b')]);switch(_0x5a4ccb['agentIdentifier']){case _0xac5b('0xfd'):_0x11ab41=_0x1f2b97[_0xac5b('0x4a')]?util[_0xac5b('0xf3')](_0xac5b('0xf9'),_0x5a4ccb[_0xac5b('0xfe')],_0x1f2b97[_0xac5b('0x4a')]):_0xac5b('0xfa');break;case _0xac5b('0xff'):_0x11ab41=_0x1f2b97['UserId']?_0x1f2b97['User']['alias']||_0x1f2b97[_0xac5b('0x7f')][_0xac5b('0xd1')]:_0xac5b('0xfa');break;case _0xac5b('0x100'):_0x11ab41=_0x1f2b97[_0xac5b('0x4a')]?_0x1f2b97[_0xac5b('0x7f')][_0xac5b('0xd1')]:_0xac5b('0xfa');break;default:_0x11ab41=_0x1f2b97[_0xac5b('0x4a')]?util[_0xac5b('0xf3')](_0xac5b('0xf9'),_0x5a4ccb[_0xac5b('0xfe')],_0x1f2b97[_0xac5b('0x4a')]):_0xac5b('0xfa');}var _0x31c273=util[_0xac5b('0xf3')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1f2b97['createdAt'])[_0xac5b('0xf3')](_0xac5b('0x101')),_0x1f2b97[_0xac5b('0x102')]==='in'?_0x4a47a8:_0x11ab41,_0x1f2b97[_0xac5b('0x38')]);if(!_0x1f2b97[_0xac5b('0x103')]){fs[_0xac5b('0x104')](_0x2d97f,_0x31c273);}}return db[_0xac5b('0x105')][_0xac5b('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0xac5b('0x106')],'as':_0xac5b('0x107'),'raw':!![]}]});}}})[_0xac5b('0x1d')](function(_0x37f65f){if(_0x37f65f&&_0x37f65f[_0xac5b('0x107')]&&_0x1dd5e5['body']){var _0x4a9680={'tls':{'rejectUnauthorized':![]}};if(_0x37f65f[_0xac5b('0x107')][_0xac5b('0x108')]){_0x4a9680['service']=_0x37f65f['Smtp']['service'];}else{_0x4a9680[_0xac5b('0x109')]=_0x37f65f[_0xac5b('0x107')][_0xac5b('0x109')];_0x4a9680['port']=_0x37f65f['Smtp']['port'];_0x4a9680[_0xac5b('0x10a')]=_0x37f65f[_0xac5b('0x107')][_0xac5b('0x10a')];}if(_0x37f65f['Smtp'][_0xac5b('0x10b')]){_0x4a9680[_0xac5b('0x10c')]={'user':_0x37f65f[_0xac5b('0x107')][_0xac5b('0xa4')],'pass':_0x37f65f['Smtp'][_0xac5b('0x10d')]};}return respondWithRpcPromise(_0xac5b('0x10e'),_0xac5b('0x10f'),{'account':_0x4a9680,'message':{'from':util[_0xac5b('0xf3')]('\x22%s\x22\x20<%s>',_0x37f65f['name'],_0x37f65f['email']||_0x37f65f[_0xac5b('0x107')][_0xac5b('0xa4')]),'to':_0x1dd5e5['body'][_0xac5b('0xf1')],'subject':'Mail\x20Transcript','text':util['format'](_0xac5b('0x110'),_0x1dd5e5['body']['mailTranscript']),'attachments':[{'path':_0x2d97f}]}})[_0xac5b('0x1d')](function(){return _0x5add44;})['catch'](function(_0x3e16d8){console[_0xac5b('0x23')](_0x3e16d8);});}else{return _0x5add44;}})[_0xac5b('0x1d')](respondWithStatusCode(_0x36d740,0xc8))[_0xac5b('0x27')](handleError(_0x36d740,null));};exports[_0xac5b('0x111')]=function(_0x2c249e,_0x580a35,_0x32bd1b){return db[_0xac5b('0xf6')][_0xac5b('0x7a')]({'where':{'id':_0x2c249e[_0xac5b('0xc2')]['id']}})[_0xac5b('0x1d')](handleEntityNotFound(_0x580a35,null))[_0xac5b('0x1d')](function(_0x4416b3){if(_0x4416b3){return _0x4416b3[_0xac5b('0x111')](_0x2c249e['body'][_0xac5b('0x112')],_[_0xac5b('0x113')](_0x2c249e['body'],['ids','id'])||{});}})[_0xac5b('0x1d')](respondWithResult(_0x580a35,null))[_0xac5b('0x27')](handleError(_0x580a35,null));};exports[_0xac5b('0x114')]=function(_0x18d26d,_0x628e2f,_0x1596b3){var _0x2b442f={'raw':![],'where':{}};var _0x298dc0={};var _0x11f185={'count':0x0,'rows':[]};return db[_0xac5b('0xa9')][_0xac5b('0xca')]({'where':{'id':_0x18d26d[_0xac5b('0xc2')]['id']}})[_0xac5b('0x1d')](handleEntityNotFound(_0x628e2f,null))['then'](function(_0x136341){if(_0x136341){_0x298dc0[_0xac5b('0x50')]=_[_0xac5b('0x51')](db[_0xac5b('0xf6')][_0xac5b('0x4e')]);_0x298dc0['query']=_[_0xac5b('0x51')](_0x18d26d['query']);_0x298dc0['filters']=_[_0xac5b('0x53')](_0x298dc0[_0xac5b('0x50')],_0x298dc0['query']);_0x2b442f[_0xac5b('0x54')]=_['intersection'](_0x298dc0[_0xac5b('0x50')],qs['fields'](_0x18d26d['query'][_0xac5b('0xc3')]));_0x2b442f[_0xac5b('0x54')]=_0x2b442f['attributes'][_0xac5b('0x55')]?_0x2b442f[_0xac5b('0x54')]:_0x298dc0[_0xac5b('0x50')];if(!_0x18d26d[_0xac5b('0x52')][_0xac5b('0x56')](_0xac5b('0x115'))){_0x2b442f[_0xac5b('0x2c')]=qs['limit'](_0x18d26d[_0xac5b('0x52')][_0xac5b('0x2c')]);_0x2b442f[_0xac5b('0x2d')]=qs[_0xac5b('0x2d')](_0x18d26d[_0xac5b('0x52')][_0xac5b('0x2d')]);}_0x2b442f[_0xac5b('0x57')]=qs[_0xac5b('0x58')](_0x18d26d['query'][_0xac5b('0x58')]);_0x2b442f[_0xac5b('0x85')]=qs[_0xac5b('0x59')](_[_0xac5b('0x5a')](_0x18d26d[_0xac5b('0x52')],_0x298dc0[_0xac5b('0x59')]));_0x2b442f[_0xac5b('0x85')]['ChatInteractionId']=_0x136341['id'];if(_0x18d26d[_0xac5b('0x52')]['filter']){_0x2b442f[_0xac5b('0x85')]=_[_0xac5b('0x37')](_0x2b442f[_0xac5b('0x85')],{'$or':_[_0xac5b('0x4d')](_0x2b442f['attributes'],function(_0x3960cd){var _0x52af16={};_0x52af16[_0x3960cd]={'$like':'%'+_0x18d26d[_0xac5b('0x52')][_0xac5b('0x93')]+'%'};return _0x52af16;})});}if(_0x18d26d[_0xac5b('0x52')][_0xac5b('0x116')]){var _0x3325ee=_0x18d26d['query'][_0xac5b('0x116')][_0xac5b('0x40')](',');var _0x1417e7={};_0x1417e7[_0x3325ee[0x0]]={'$gte':moment(_0x3325ee[0x1])[_0xac5b('0xf3')](_0xac5b('0x117'))};_0x2b442f[_0xac5b('0x85')]=_[_0xac5b('0x37')](_0x2b442f['where'],_0x1417e7);}_0x2b442f=_[_0xac5b('0x37')]({},_0x2b442f,_0x18d26d[_0xac5b('0xc5')]);return db[_0xac5b('0xf6')][_0xac5b('0x2e')]({'where':_0x2b442f['where']})[_0xac5b('0x1d')](function(_0x46ed5d){_0x11f185[_0xac5b('0x2e')]=_0x46ed5d;if(_0x18d26d[_0xac5b('0x52')][_0xac5b('0xc4')]){_0x2b442f[_0xac5b('0x118')]=[{'all':!![]}];}return db[_0xac5b('0xf6')][_0xac5b('0x119')](_0x2b442f);})[_0xac5b('0x1d')](function(_0x5b8b65){_0x11f185[_0xac5b('0xc0')]=_0x5b8b65;return _0x11f185;});}})[_0xac5b('0x1d')](respondWithFilteredResult(_0x628e2f,_0x2b442f))[_0xac5b('0x27')](handleError(_0x628e2f,null));};exports[_0xac5b('0x11a')]=function(_0x10f157,_0x5b08bf,_0x199532){var _0x46c450={'where':{}},_0x16252a={},_0x360cc6={'count':0x0,'rows':[]};return db[_0xac5b('0xa9')][_0xac5b('0xca')]({'where':{'id':_0x10f157['params']['id']}})['then'](handleEntityNotFound(_0x5b08bf,null))[_0xac5b('0x1d')](function(_0x4a8d61){if(_0x4a8d61){_0x16252a[_0xac5b('0x50')]=_[_0xac5b('0x51')](db[_0xac5b('0xf6')]['rawAttributes']);_0x16252a[_0xac5b('0x52')]=_[_0xac5b('0x51')](_0x10f157[_0xac5b('0x52')]);_0x16252a[_0xac5b('0x59')]=_['intersection'](_0x16252a['model'],_0x16252a['query']);_0x46c450['attributes']=_['intersection'](_0x16252a[_0xac5b('0x50')],qs[_0xac5b('0xc3')](_0x10f157[_0xac5b('0x52')][_0xac5b('0xc3')]));_0x46c450['attributes']=_0x46c450[_0xac5b('0x54')][_0xac5b('0x55')]?_0x46c450[_0xac5b('0x54')]:_0x16252a[_0xac5b('0x50')];if(!_0x10f157['query'][_0xac5b('0x56')](_0xac5b('0x115'))){_0x46c450[_0xac5b('0x2c')]=qs['limit'](_0x10f157[_0xac5b('0x52')][_0xac5b('0x2c')]);_0x46c450['offset']=qs['offset'](_0x10f157['query'][_0xac5b('0x2d')]);}_0x46c450[_0xac5b('0x57')]=qs[_0xac5b('0x58')](_0x10f157[_0xac5b('0x52')][_0xac5b('0x58')]);_0x46c450[_0xac5b('0x85')]=qs[_0xac5b('0x59')](_[_0xac5b('0x5a')](_0x10f157['query'],_0x16252a[_0xac5b('0x59')]));_0x46c450['where'][_0xac5b('0xbe')]=_0x4a8d61['id'];if(_0x10f157['query']['filter']){_0x46c450[_0xac5b('0x85')]=_[_0xac5b('0x37')](_0x46c450[_0xac5b('0x85')],{'$or':_[_0xac5b('0x4d')](_0x46c450[_0xac5b('0x54')],function(_0x3ad9ad){var _0xfddcbe={};_0xfddcbe[_0x3ad9ad]={'$like':'%'+_0x10f157['query'][_0xac5b('0x93')]+'%'};return _0xfddcbe;})});}_0x46c450[_0xac5b('0x85')][_0xac5b('0x103')]=![];if(_0x10f157[_0xac5b('0x52')]['id']){_0x46c450['where']['id']={'$gt':_0x10f157[_0xac5b('0x52')]['id']};}_0x46c450=_[_0xac5b('0x37')]({},_0x46c450,_0x10f157[_0xac5b('0xc5')]);return db['ChatMessage'][_0xac5b('0x2e')]({'where':_0x46c450[_0xac5b('0x85')]})[_0xac5b('0x1d')](function(_0x3c5659){_0x360cc6[_0xac5b('0x2e')]=_0x3c5659;_0x46c450[_0xac5b('0x118')]=[];if(_0x10f157[_0xac5b('0x52')][_0xac5b('0x11b')]){_0x46c450['include'][_0xac5b('0x42')]({'model':db[_0xac5b('0x7f')],'as':_0xac5b('0x7f'),'attributes':['id',_0xac5b('0xd1'),_0xac5b('0x11c')]});}if(_0x10f157['query']['includeAll']){_0x46c450['include']=[{'all':!![]}];}return db[_0xac5b('0xf6')][_0xac5b('0x119')](_0x46c450);})[_0xac5b('0x1d')](function(_0x342fdd){_0x360cc6[_0xac5b('0xc0')]=_0x342fdd;return _0x360cc6;});}})['then'](respondWithFilteredResult(_0x5b08bf,_0x46c450))[_0xac5b('0x27')](handleError(_0x5b08bf,null));};exports['addTags']=function(_0x4b1049,_0x222e1a,_0x487afc){return db['ChatInteraction'][_0xac5b('0x7a')]({'where':{'id':_0x4b1049[_0xac5b('0xc2')]['id']}})['then'](handleEntityNotFound(_0x222e1a,null))[_0xac5b('0x1d')](function(_0x1ba2bb){if(_0x1ba2bb){return _0x1ba2bb[_0xac5b('0x11d')](_0x4b1049[_0xac5b('0x38')]['ids'],_[_0xac5b('0x113')](_0x4b1049[_0xac5b('0x38')],[_0xac5b('0x112'),'id'])||{})[_0xac5b('0x11e')](function(){return db['Tag']['findAll']({'attributes':['id',_0xac5b('0x35'),'color'],'where':{'id':_0x4b1049[_0xac5b('0x38')][_0xac5b('0x112')]}});})['then'](function(_0x495b70){socket['emit'](_0xac5b('0x11f'),{'id':Number(_0x4b1049[_0xac5b('0xc2')]['id']),'tags':_0x495b70||[]});return{'id':Number(_0x4b1049[_0xac5b('0xc2')]['id']),'tags':_0x495b70||[]};});}})[_0xac5b('0x1d')](respondWithResult(_0x222e1a,null))[_0xac5b('0x27')](handleError(_0x222e1a,null));};exports[_0xac5b('0x120')]=function(_0x37657b,_0x433d75,_0x2d981c){return db[_0xac5b('0xa9')]['find']({'where':{'id':_0x37657b[_0xac5b('0xc2')]['id']}})[_0xac5b('0x1d')](handleEntityNotFound(_0x433d75,null))['then'](function(_0x38a7be){if(_0x38a7be){return _0x38a7be['removeTags'](_0x37657b[_0xac5b('0x52')][_0xac5b('0x112')]);}})['then'](respondWithStatusCode(_0x433d75,null))[_0xac5b('0x27')](handleError(_0x433d75,null));};exports[_0xac5b('0xef')]=function(_0xab54ad,_0x206663){var _0xa135ba=moment()[_0xac5b('0x121')]()[_0xac5b('0xa7')]();var _0x30801b=path[_0xac5b('0xed')](config[_0xac5b('0x122')],_0xac5b('0x123'),_0xac5b('0x124'),'tmp');var _0x50d85f=path['join'](config[_0xac5b('0x122')],_0xac5b('0x123'),_0xac5b('0x124'),_0xac5b('0x125'));var _0x20b2d9=path[_0xac5b('0xed')](_0x30801b,_0xa135ba);var _0x52ea40=util['format'](_0xac5b('0x126'),_0xab54ad[_0xac5b('0xc2')]['id'],_0xa135ba);var _0x11f1d9=path[_0xac5b('0xed')](_0x30801b,_0x52ea40);var _0x415b71=[];_0x415b71[_0xac5b('0x42')]({'model':db[_0xac5b('0x7f')],'as':'User','attributes':['id',_0xac5b('0xd1')],'raw':!![]});_0x415b71[_0xac5b('0x42')]({'model':db[_0xac5b('0xf8')],'as':_0xac5b('0x75'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0xab54ad[_0xac5b('0x52')][_0xac5b('0x125')]){_0x415b71[_0xac5b('0x42')]({'model':db[_0xac5b('0xe9')],'as':_0xac5b('0xe9'),'raw':!![]});}var _0x955e13=[{'model':db[_0xac5b('0xf6')],'as':_0xac5b('0xf7'),'attributes':['id',_0xac5b('0x38'),_0xac5b('0x88'),_0xac5b('0x102'),'secret',_0xac5b('0x8e')],'include':_0x415b71}];_0x955e13[_0xac5b('0x42')]({'model':db[_0xac5b('0xcb')],'as':'Account','attributes':['id',_0xac5b('0x35')]});_0x955e13[_0xac5b('0x42')]({'model':db['User'],'as':_0xac5b('0x127'),'attributes':['id',_0xac5b('0xd1')]});return db[_0xac5b('0xa9')][_0xac5b('0x7a')]({'where':{'id':_0xab54ad[_0xac5b('0xc2')]['id']},'include':_0x955e13})[_0xac5b('0x1d')](handleEntityNotFound(_0x206663,null))[_0xac5b('0x1d')](function(_0x3245bb){if(_0x3245bb){var _0xb6dc71=_0x3245bb[_0xac5b('0x128')]({'plain':!![]});fs[_0xac5b('0x129')](_0x20b2d9);var _0x162611={'channel':_0xac5b('0x12a'),'account':_0xb6dc71[_0xac5b('0x12b')]['name'],'agent':_0xb6dc71[_0xac5b('0x127')]?_0xb6dc71['Owner']['fullname']:_0xac5b('0x12c'),'createdAt':moment(_0xb6dc71[_0xac5b('0x88')])['format'](_0xac5b('0x117'))[_0xac5b('0xa7')](),'closedAt':_0xb6dc71['closed']?moment(_0xb6dc71['closedAt'])['format'](_0xac5b('0x117'))['toString']():'','disposition':_0xb6dc71[_0xac5b('0x48')],'chatInfo':{'browser':_0xb6dc71[_0xac5b('0x12d')],'os':_0xb6dc71[_0xac5b('0x12e')],'referer':_0xb6dc71[_0xac5b('0x12f')],'customerIp':_0xb6dc71[_0xac5b('0x130')],'customerPort':_0xb6dc71['customerPort']?_0xb6dc71[_0xac5b('0x131')]:_0xac5b('0x12c')},'messages':_(_0xb6dc71[_0xac5b('0xf7')])[_0xac5b('0x132')]()[_0xac5b('0x93')]({'secret':![]})[_0xac5b('0x4d')](function(_0xd38d1d){if(_0xd38d1d[_0xac5b('0xe9')]){var _0x1b695b=path[_0xac5b('0xed')](_0x50d85f,_0xd38d1d[_0xac5b('0xe9')][_0xac5b('0xe6')]);if(fs[_0xac5b('0x133')](_0x1b695b)){fs[_0xac5b('0x134')](_0x1b695b)[_0xac5b('0x135')](fs[_0xac5b('0x136')](path[_0xac5b('0xed')](_0x20b2d9,_0xd38d1d[_0xac5b('0xe9')][_0xac5b('0xe6')])));}}return{'date':moment(_0xd38d1d['createdAt'])[_0xac5b('0xf3')]('YYYY-MM-DD\x20HH:mm:ss')[_0xac5b('0xa7')](),'sender':_0xd38d1d[_0xac5b('0x102')]===_0xac5b('0xdc')?_0xd38d1d['User']?_0xd38d1d[_0xac5b('0x7f')][_0xac5b('0xd1')]:'System':_0xd38d1d[_0xac5b('0x75')][_0xac5b('0x137')]+(_0xd38d1d['Contact'][_0xac5b('0x138')]?'\x20'+_0xd38d1d['Contact'][_0xac5b('0x138')]:''),'body':_0xd38d1d[_0xac5b('0xe9')]?_0xd38d1d['Attachment'][_0xac5b('0xe6')]:_0xd38d1d['body'],'direction':_0xd38d1d[_0xac5b('0x102')]==='out'?'A':'C','secret':_0xd38d1d['secret'],'read':_0xd38d1d[_0xac5b('0x8e')],'attachment':_0xd38d1d[_0xac5b('0xe9')]};})['value']()};return ejs['renderFile'](path[_0xac5b('0xed')](config[_0xac5b('0x122')],_0xac5b('0x123'),_0xac5b('0x139'),_0xac5b('0x13a')),{'interaction':_0x162611})[_0xac5b('0x1d')](function(_0x2cb7b4){var _0x24482e=path[_0xac5b('0xed')](_0x20b2d9,'transcript-'+_0xb6dc71['id']+'-'+_0xa135ba+_0xac5b('0x13b'));var _0x48327f={'path':_0x24482e,'channel':_0xac5b('0x12a'),'interactionId':_0xb6dc71['id']};return pdf[_0xac5b('0x13c')](_0x2cb7b4,_0x48327f);})[_0xac5b('0x1d')](function(){return new BPromise(function(_0xa5aa43,_0x503ccb){zipdir(_0x20b2d9,{'saveTo':_0x11f1d9},function(_0x55ea68,_0x108c54){if(_0x55ea68)return _0x503ccb(_0x55ea68);return _0xa5aa43(_0x108c54);});})['then'](function(){return new BPromise(function(_0x2d0d01,_0x22ec9b){rimraf(_0x20b2d9,function(_0x2e1f56){if(_0x2e1f56)_0x22ec9b(_0x2e1f56);return _0x2d0d01();});});})[_0xac5b('0x1d')](function(){return _0x206663[_0xac5b('0xef')](_0x11f1d9,_0x52ea40,function(_0x5edf39){if(_0x5edf39){console[_0xac5b('0x13d')](_0xac5b('0x13e'),_0x5edf39);}else{fs[_0xac5b('0x13f')](_0x11f1d9);}});});});}else{return _0x206663['sendStatus'](0xc8);}})[_0xac5b('0x27')](handleError(_0x206663,null));}; \ No newline at end of file +var _0x0b1e=['ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','keys','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','CmContact','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','ids','getMessages','ChatMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','secret','includeAgent','omit','spread','emit','chatInteractionTags:save','removeTags','server','attachments','transcript-%d-%s.zip','lastName','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','pipe','createWriteStream','firstName','out','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','request\x20sent','catch','sendStatus','end','status','undefined','limit','count','offset','set','reject','save','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','push','talking','unmanaged','abandoned','total','closed','UserId','waiting','disposition','answered','index','ChatInteraction','rawAttributes','fieldName','type','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\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)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','unreadMessages','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)'];(function(_0x568ef0,_0x1698f6){var _0x248acb=function(_0x54412c){while(--_0x54412c){_0x568ef0['push'](_0x568ef0['shift']());}};_0x248acb(++_0x1698f6);}(_0x0b1e,0x7c));var _0xe0b1=function(_0x5ec453,_0x30b0ba){_0x5ec453=_0x5ec453-0x0;var _0x25548f=_0x0b1e[_0x5ec453];return _0x25548f;};'use strict';var emlformat=require(_0xe0b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b1('0x1'));var jsonpatch=require(_0xe0b1('0x2'));var rp=require(_0xe0b1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe0b1('0x4'));var path=require(_0xe0b1('0x5'));var sox=require(_0xe0b1('0x6'));var csv=require(_0xe0b1('0x7'));var ejs=require(_0xe0b1('0x8'));var fs=require('fs');var fs_extra=require(_0xe0b1('0x9'));var _=require(_0xe0b1('0xa'));var squel=require(_0xe0b1('0xb'));var crypto=require(_0xe0b1('0xc'));var jsforce=require(_0xe0b1('0xd'));var deskjs=require(_0xe0b1('0xe'));var toCsv=require(_0xe0b1('0x7'));var querystring=require(_0xe0b1('0xf'));var Papa=require(_0xe0b1('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe0b1('0x11'));var as=require(_0xe0b1('0x12'));var pdf=require(_0xe0b1('0x13'));var hardwareService=require(_0xe0b1('0x14'));var logger=require(_0xe0b1('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe0b1('0x16'));var db=require(_0xe0b1('0x17'))['db'];config[_0xe0b1('0x18')]=_[_0xe0b1('0x19')](config['redis'],{'host':_0xe0b1('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe0b1('0x18')]));require(_0xe0b1('0x1b'))[_0xe0b1('0x1c')](socket);var jayson=require(_0xe0b1('0x1d'));var client=jayson[_0xe0b1('0x1e')][_0xe0b1('0x1f')]({'port':0x232b});var client9004=jayson[_0xe0b1('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x45c0e3,_0x5c7698,_0x11ad6a,_0x2f835e){return new BPromise(function(_0x147ff7,_0x225c8a){var _0x1c6253=_0x2f835e||client;return _0x1c6253[_0xe0b1('0x20')](_0x45c0e3,_0x11ad6a)[_0xe0b1('0x21')](function(_0x5b284f){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5c7698,'request\x20sent');logger[_0xe0b1('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5c7698,'request\x20sent',JSON[_0xe0b1('0x23')](_0x5b284f));if(_0x5b284f[_0xe0b1('0x24')]){if(_0x5b284f[_0xe0b1('0x24')][_0xe0b1('0x25')]===0x1f4){logger['error'](_0xe0b1('0x26'),_0x5c7698,_0x5b284f[_0xe0b1('0x24')][_0xe0b1('0x27')]);return _0x225c8a(_0x5b284f[_0xe0b1('0x24')][_0xe0b1('0x27')]);}logger[_0xe0b1('0x24')](_0xe0b1('0x26'),_0x5c7698,_0x5b284f[_0xe0b1('0x24')][_0xe0b1('0x27')]);return _0x147ff7(_0x5b284f[_0xe0b1('0x24')][_0xe0b1('0x27')]);}else{logger['info'](_0xe0b1('0x26'),_0x5c7698,_0xe0b1('0x28'));_0x147ff7(_0x5b284f['result']['message']);}})[_0xe0b1('0x29')](function(_0x2bc164){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5c7698,_0x2bc164);_0x225c8a(_0x2bc164);});});}function respondWithStatusCode(_0x207f7c,_0x14a262){_0x14a262=_0x14a262||0xcc;return function(_0x53303e){if(_0x53303e){return _0x207f7c[_0xe0b1('0x2a')](_0x14a262);}return _0x207f7c['status'](_0x14a262)[_0xe0b1('0x2b')]();};}function respondWithResult(_0x41444d,_0x193b3b){_0x193b3b=_0x193b3b||0xc8;return function(_0x3219d2){if(_0x3219d2){return _0x41444d[_0xe0b1('0x2c')](_0x193b3b)['json'](_0x3219d2);}};}function respondWithFilteredResult(_0x3304ff,_0x2bcd29){return function(_0x59f619){if(_0x59f619){var _0x3c61d1=typeof _0x2bcd29['offset']===_0xe0b1('0x2d')&&typeof _0x2bcd29[_0xe0b1('0x2e')]===_0xe0b1('0x2d');var _0x24fb74=_0x59f619[_0xe0b1('0x2f')];var _0x41862f=_0x3c61d1?0x0:_0x2bcd29[_0xe0b1('0x30')];var _0x28b251=_0x3c61d1?_0x59f619[_0xe0b1('0x2f')]:_0x2bcd29[_0xe0b1('0x30')]+_0x2bcd29[_0xe0b1('0x2e')];var _0x5e6486;if(_0x28b251>=_0x24fb74){_0x28b251=_0x24fb74;_0x5e6486=0xc8;}else{_0x5e6486=0xce;}_0x3304ff[_0xe0b1('0x2c')](_0x5e6486);return _0x3304ff[_0xe0b1('0x31')]('Content-Range',_0x41862f+'-'+_0x28b251+'/'+_0x24fb74)['json'](_0x59f619);}return null;};}function patchUpdates(_0x2b350a){return function(_0x4fbe62){try{jsonpatch['apply'](_0x4fbe62,_0x2b350a,!![]);}catch(_0x4499eb){return BPromise[_0xe0b1('0x32')](_0x4499eb);}return _0x4fbe62[_0xe0b1('0x33')]();};}function saveUpdates(_0x46aa64,_0x3bb271){return function(_0x51d167){if(_0x51d167){return _0x51d167[_0xe0b1('0x34')](_0x46aa64)[_0xe0b1('0x21')](function(_0x672f55){return _0x672f55;});}return null;};}function removeEntity(_0x5ac267,_0x42268d){return function(_0x2470d0){if(_0x2470d0){return _0x2470d0[_0xe0b1('0x35')]()[_0xe0b1('0x21')](function(){_0x5ac267[_0xe0b1('0x2c')](0xcc)[_0xe0b1('0x2b')]();});}};}function handleEntityNotFound(_0x5aa55b,_0x49ddae){return function(_0x37545a){if(!_0x37545a){_0x5aa55b[_0xe0b1('0x2a')](0x194);}return _0x37545a;};}function handleError(_0x430aad,_0x848146){_0x848146=_0x848146||0x1f4;return function(_0x2f7812){logger['error'](_0x2f7812[_0xe0b1('0x36')]);if(_0x2f7812[_0xe0b1('0x37')]){delete _0x2f7812[_0xe0b1('0x37')];}_0x430aad['status'](_0x848146)[_0xe0b1('0x38')](_0x2f7812);};}function getMustacheRender(_0x2a2d78,_0x5d369c){return Mustache[_0xe0b1('0x39')](_0x2a2d78,_[_0xe0b1('0x3a')](_0x5d369c[_0xe0b1('0x3b')],{'contact':_0x5d369c[_0xe0b1('0x3c')],'message':_0x5d369c['message'],'agent':_0x5d369c[_0xe0b1('0x3d')],'interaction':_0x5d369c[_0xe0b1('0x3e')],'account':_0x5d369c[_0xe0b1('0x3f')]}))||'';}function getInteractionUsers(_0x507800,_0x49f0ca){return new BPromise(function(_0x31760a,_0x4299b8){try{if(_0x49f0ca[_0x507800['id']]){_0x507800[_0xe0b1('0x40')]=_[_0xe0b1('0x41')](_0x49f0ca[_0x507800['id']],function(_0xf62327){return{'id':_0xf62327['id'],'fullname':_0xf62327[_0xe0b1('0x42')]};});}}catch(_0xdb4740){_0x4299b8(_0xdb4740);}_0x31760a(_0x507800);});}function getInteractionTags(_0x4114f4,_0x218ed2){return new BPromise(function(_0x286389,_0x3a4e31){try{if(_0x4114f4[_0xe0b1('0x43')]){_0x4114f4['Tags']=[];_0x4114f4[_0xe0b1('0x43')]['split'](',')['forEach'](function(_0x401e30){_0x4114f4[_0xe0b1('0x44')][_0xe0b1('0x45')](_0x218ed2[_0x401e30]);});}delete _0x4114f4[_0xe0b1('0x43')];}catch(_0x27e56a){_0x3a4e31(_0x27e56a);}_0x286389(_0x4114f4);});}function updateChatInteraction(_0x1de041,_0x2a773e,_0x44683a){return new BPromise(function(_0x24eb18,_0x1b92c9){return getInteractionUsers(_0x1de041,_0x44683a)[_0xe0b1('0x21')](function(_0x55ffeb){return getInteractionTags(_0x55ffeb,_0x2a773e);})['then'](function(_0x3cf25b){return getStateInteraction(_0x3cf25b);})['then'](function(_0x58a53b){_0x24eb18(_0x58a53b);})['catch'](function(_0x23b4f0){_0x1b92c9(_0x23b4f0);});});}function getStateInteraction(_0x14a63a){return new BPromise(function(_0x1b20f3){_0x14a63a['waiting']=0x0;_0x14a63a[_0xe0b1('0x46')]=0x0;_0x14a63a['answered']=0x0;_0x14a63a[_0xe0b1('0x47')]=0x0;_0x14a63a[_0xe0b1('0x48')]=0x0;_0x14a63a[_0xe0b1('0x49')]=0x0;if(!_0x14a63a[_0xe0b1('0x4a')]&&!_0x14a63a[_0xe0b1('0x4b')]){_0x14a63a[_0xe0b1('0x4c')]+=0x1;}if(!_0x14a63a[_0xe0b1('0x4a')]&&_0x14a63a[_0xe0b1('0x4b')]){_0x14a63a['talking']+=0x1;if(_0x14a63a[_0xe0b1('0x4c')]){_0x14a63a[_0xe0b1('0x4c')]-=0x1;}}if(_0x14a63a[_0xe0b1('0x4a')]&&_0x14a63a[_0xe0b1('0x4d')]===_0xe0b1('0x48')){_0x14a63a['abandoned']+=0x1;if(_0x14a63a[_0xe0b1('0x4c')]){_0x14a63a['waiting']-=0x1;}}else if(_0x14a63a['closed']&&!_0x14a63a[_0xe0b1('0x4b')]&&_0x14a63a[_0xe0b1('0x4d')]){_0x14a63a[_0xe0b1('0x47')]+=0x1;if(_0x14a63a[_0xe0b1('0x4c')]){_0x14a63a[_0xe0b1('0x4c')]-=0x1;}}else if(_0x14a63a[_0xe0b1('0x4a')]&&_0x14a63a[_0xe0b1('0x4b')]){_0x14a63a[_0xe0b1('0x4e')]+=0x1;if(_0x14a63a[_0xe0b1('0x46')]){_0x14a63a['talking']-=0x1;}}_0x14a63a[_0xe0b1('0x49')]+=0x1;_0x1b20f3(_0x14a63a);});}exports[_0xe0b1('0x4f')]=function(_0x432c6a,_0x4f3dd8){var _0x5df5f6={},_0x434bb8={},_0x4586d3={'count':0x0,'rows':[]};var _0xbb91a3=_[_0xe0b1('0x41')](db[_0xe0b1('0x50')][_0xe0b1('0x51')],function(_0x5d77ea){return{'name':_0x5d77ea[_0xe0b1('0x52')],'type':_0x5d77ea[_0xe0b1('0x53')]['key']};});_0x434bb8['model']=_[_0xe0b1('0x41')](_0xbb91a3,_0xe0b1('0x37'));_0x434bb8[_0xe0b1('0x54')]=_['keys'](_0x432c6a[_0xe0b1('0x54')]);_0x434bb8[_0xe0b1('0x55')]=_['intersection'](_0x434bb8['model'],_0x434bb8[_0xe0b1('0x54')]);_0x5df5f6[_0xe0b1('0x56')]=_[_0xe0b1('0x57')](_0x434bb8[_0xe0b1('0x58')],qs[_0xe0b1('0x59')](_0x432c6a['query'][_0xe0b1('0x59')]));_0x5df5f6['attributes']=_0x5df5f6[_0xe0b1('0x56')][_0xe0b1('0x5a')]?_0x5df5f6[_0xe0b1('0x56')]:_0x434bb8['model'];if(!_0x432c6a[_0xe0b1('0x54')][_0xe0b1('0x5b')](_0xe0b1('0x5c'))){_0x5df5f6[_0xe0b1('0x2e')]=qs['limit'](_0x432c6a[_0xe0b1('0x54')]['limit']);_0x5df5f6[_0xe0b1('0x30')]=qs[_0xe0b1('0x30')](_0x432c6a[_0xe0b1('0x54')][_0xe0b1('0x30')]);}_0x5df5f6['order']=qs['sort'](_0x432c6a[_0xe0b1('0x54')][_0xe0b1('0x5d')]);_0x5df5f6[_0xe0b1('0x5e')]=qs[_0xe0b1('0x55')](_[_0xe0b1('0x5f')](_0x432c6a[_0xe0b1('0x54')],_0x434bb8[_0xe0b1('0x55')]),_0xbb91a3);var _0x339f98=[];var _0x5b0db2=squel[_0xe0b1('0x60')]()[_0xe0b1('0x61')]('id')[_0xe0b1('0x61')](_0xe0b1('0x37'))[_0xe0b1('0x61')](_0xe0b1('0x62'))['from'](_0xe0b1('0x63'));var _0x4a6908=squel[_0xe0b1('0x60')]()['field'](_0xe0b1('0x64'))['field'](_0xe0b1('0x65'))[_0xe0b1('0x61')](_0xe0b1('0x66'))[_0xe0b1('0x67')](_0xe0b1('0x68'),'ui')[_0xe0b1('0x69')](_0xe0b1('0x6a'),'u',_0xe0b1('0x6b'));var _0x2e0e7a=squel[_0xe0b1('0x60')]()['from'](_0xe0b1('0x6c'),'i')[_0xe0b1('0x69')](_0xe0b1('0x6d'),'c',_0xe0b1('0x6e'))['left_join'](_0xe0b1('0x6a'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0xe0b1('0x6f'))[_0xe0b1('0x69')](_0xe0b1('0x70'),'me',_0xe0b1('0x71'))['left_join'](_0xe0b1('0x72'),'it','it.ChatInteractionId\x20=\x20i.id')['left_join'](_0xe0b1('0x63'),'t',_0xe0b1('0x73'));var _0x4f3e61=squel[_0xe0b1('0x74')]();var _0x3d4189=[];var _0x41a842=squel['expr']();var _0x234ded;if(_0x432c6a[_0xe0b1('0x54')][_0xe0b1('0x75')]){_0x234ded=as[_0xe0b1('0x76')](_0x432c6a['query']['search']);var _0x29bed7=_0x234ded[_0xe0b1('0x77')];for(var _0x41f235=0x0;_0x41f235<_0x234ded[_0xe0b1('0x78')][_0xe0b1('0x5a')];_0x41f235++){var _0x2cb1dc=_0x234ded[_0xe0b1('0x78')][_0x41f235];var _0x1469d7='i';var _0x3026cd=_[_0xe0b1('0x79')](_0xbb91a3,[_0xe0b1('0x37'),_0x2cb1dc[_0xe0b1('0x61')]]);if(!_0x3026cd){switch(_0x2cb1dc['field']){case'unreadMessages':if(_0x2cb1dc['value']==0x1){_0x2e0e7a[_0xe0b1('0x7a')]('`'+_0x2cb1dc['field']+_0xe0b1('0x7b'));}else{_0x2e0e7a[_0xe0b1('0x7a')]('`'+_0x2cb1dc[_0xe0b1('0x61')]+_0xe0b1('0x7c'));}break;case _0xe0b1('0x7d'):if(_0x2cb1dc[_0xe0b1('0x7e')]==='$substring'){if(_0x2cb1dc[_0xe0b1('0x7f')][_0xe0b1('0x80')]('\x20')['length']>0x1){_0x4f3e61[_0x29bed7]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe0b1('0x81')](_0x2cb1dc[_0xe0b1('0x7f')]),null);}else{var _0x262834='%'+_0x2cb1dc['value']+'%';_0x4f3e61[_0x29bed7](_0xe0b1('0x82'),_0x262834,_0x262834,_0x262834);}}else{_0x3026cd=_[_0xe0b1('0x79')](_0xbb91a3,[_0xe0b1('0x37'),'ContactId']);_0x2cb1dc[_0xe0b1('0x61')]=_0xe0b1('0x83');_0x25adba=as[_0xe0b1('0x84')](_0x1469d7,_0x3026cd[_0xe0b1('0x53')],_0x2cb1dc);_0x4f3e61[_0x29bed7](_0x25adba[_0xe0b1('0x85')],_0x25adba[_0xe0b1('0x7f')]['start'],_0x25adba[_0xe0b1('0x7f')]['end']);}break;case _0xe0b1('0x86'):var _0x34247a=_0x2cb1dc['value'][_0xe0b1('0x80')](',')['map'](function(_0x5bee36){return Number(_0x5bee36);});_0x34247a[_0xe0b1('0x87')](function(_0x5e0f9c){_0x41a842['or'](_0xe0b1('0x88'),'%,'+_0x5e0f9c+',%');});_0x3d4189=_[_0xe0b1('0x89')](_0x3d4189,_0x34247a);break;case _0xe0b1('0x8a'):if(_0x2cb1dc['operator']===_0xe0b1('0x8b')){_0x4f3e61[_0x29bed7](_0xe0b1('0x8c'),'%'+_0x2cb1dc[_0xe0b1('0x7f')]+'%',null);}else{_0x3026cd=_[_0xe0b1('0x79')](_0xbb91a3,[_0xe0b1('0x37'),'UserId']);_0x2cb1dc[_0xe0b1('0x61')]=_0xe0b1('0x4b');_0x25adba=as[_0xe0b1('0x84')](_0x1469d7,_0x3026cd[_0xe0b1('0x53')],_0x2cb1dc);_0x4f3e61[_0x29bed7](_0x25adba['text'],_0x25adba[_0xe0b1('0x7f')][_0xe0b1('0x8d')],_0x25adba['value'][_0xe0b1('0x2b')]);}break;case _0xe0b1('0x3b'):_0x25adba=as[_0xe0b1('0x84')]('me',null,_0x2cb1dc);_0x4f3e61[_0x29bed7](_0x25adba[_0xe0b1('0x85')],_0x25adba['value'][_0xe0b1('0x8d')],_0x25adba[_0xe0b1('0x7f')][_0xe0b1('0x2b')]);break;}}else{var _0x25adba=as[_0xe0b1('0x84')](_0x1469d7,_0x3026cd[_0xe0b1('0x53')],_0x2cb1dc);_0x4f3e61[_0x29bed7](_0x25adba[_0xe0b1('0x85')],_0x25adba[_0xe0b1('0x7f')][_0xe0b1('0x8d')],_0x25adba[_0xe0b1('0x7f')][_0xe0b1('0x2b')]);}}}else{var _0x1fcbb9=_(_0x432c6a['query'])['keys']()['map'](function(_0x19bcf7){return _['some'](_0xbb91a3,['name',_0x19bcf7])?_0x19bcf7:undefined;})[_0xe0b1('0x8e')]()[_0xe0b1('0x7f')]();if(!_[_0xe0b1('0x8f')](_0x1fcbb9)){_0x1fcbb9[_0xe0b1('0x87')](function(_0xecd8ae){if(_0xecd8ae===_0xe0b1('0x90')){_0x2e0e7a[_0xe0b1('0x5e')](_0xe0b1('0x91'),[][_0xe0b1('0x92')](_0x432c6a['query'][_0xecd8ae]));}else if(_0xecd8ae===_0xe0b1('0x93')){var _0x46e545=JSON[_0xe0b1('0x94')](_0x432c6a[_0xe0b1('0x54')][_0xecd8ae])['$gte'];var _0x28d308=JSON[_0xe0b1('0x94')](_0x432c6a[_0xe0b1('0x54')][_0xecd8ae])[_0xe0b1('0x95')];_0x2e0e7a[_0xe0b1('0x5e')](_0xe0b1('0x96'),_0x46e545,_0x28d308);}else{if(_0x432c6a['query'][_0xecd8ae]===_0xe0b1('0x97')){_0x2e0e7a[_0xe0b1('0x5e')]('i.'+_0xecd8ae+'\x20IS\x20NULL');}else{_0x2e0e7a['where']('i.'+_0xecd8ae+_0xe0b1('0x98'),_0x432c6a[_0xe0b1('0x54')][_0xecd8ae]);}}});}if(_0x432c6a[_0xe0b1('0x54')]['read']){if(_0x432c6a['query'][_0xe0b1('0x99')]==0x1){_0x2e0e7a[_0xe0b1('0x7a')](_0xe0b1('0x9a'));}else{_0x2e0e7a['having'](_0xe0b1('0x9b'));}}if(_0x432c6a['query']['tag']){_0x3d4189=_['isArray'](_0x432c6a[_0xe0b1('0x54')][_0xe0b1('0x9c')])?_0x432c6a[_0xe0b1('0x54')][_0xe0b1('0x9c')]:new Array(_0x432c6a[_0xe0b1('0x54')][_0xe0b1('0x9c')]);_0x3d4189[_0xe0b1('0x87')](function(_0x4ac8ce){_0x41a842['or'](_0xe0b1('0x88'),'%,'+_0x4ac8ce+',%');});}if(_0x432c6a[_0xe0b1('0x54')][_0xe0b1('0x9d')]){var _0xabe790=_0x432c6a[_0xe0b1('0x54')][_0xe0b1('0x9d')]['replace']('\x5c','\x5c\x5c')[_0xe0b1('0x9e')](/'/g,'\x27\x27');if(qs[_0xe0b1('0x9f')](_0xabe790)){_0x4f3e61['or'](_0xe0b1('0xa0'),_0xabe790+'%');}else{_0x4f3e61['or'](_0xe0b1('0xa1'),qs[_0xe0b1('0x81')](_0xabe790))['or'](_0xe0b1('0xa2'),_0xabe790+'%');}}}_0x2e0e7a['where'](_0x4f3e61);_0x2e0e7a['group'](_0xe0b1('0xa3'));var _0x4cf715={'type':db[_0xe0b1('0xa4')][_0xe0b1('0xa5')][_0xe0b1('0xa6')],'raw':!![]};var _0x41a464=_0x2e0e7a[_0xe0b1('0xa7')]();_0x41a464[_0xe0b1('0x61')](_0xe0b1('0xa3'));_0x41a464[_0xe0b1('0x61')](_0xe0b1('0xa8'),'unreadMessages');if(_0x5df5f6[_0xe0b1('0xa9')]){_0x5df5f6[_0xe0b1('0xa9')][_0xe0b1('0x87')](function(_0x2dcbb9){var _0x4ae92a=_0x2dcbb9[0x0]===_0xe0b1('0xaa')?_0x2dcbb9[0x0]:'i.'+_0x2dcbb9[0x0];_0x2e0e7a['order'](_0x4ae92a,_0x2dcbb9[0x1]===_0xe0b1('0xab')?![]:!![]);});}if(!_[_0xe0b1('0x8f')](_0x3d4189)){_0x2e0e7a[_0xe0b1('0x7a')](_0x41a842);_0x41a464[_0xe0b1('0x5e')]('t.id\x20IN\x20?',_0x3d4189);}BPromise['resolve']()[_0xe0b1('0x21')](function(){if(!_0x234ded){if(_0x432c6a['query'][_0xe0b1('0x90')])return;_0x41a464[_0xe0b1('0x5e')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x2e0e7a[_0xe0b1('0x5e')](_0xe0b1('0xac'));return;}if(_0x432c6a[_0xe0b1('0xad')][_0xe0b1('0xae')]!=='agent')return;return _0x432c6a['user'][_0xe0b1('0xaf')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2f6d45){if(_[_0xe0b1('0x8f')](_0x2f6d45)){_0x41a464['where'](_0xe0b1('0xb0'));_0x2e0e7a[_0xe0b1('0x5e')](_0xe0b1('0xb0'));}else{_0x41a464[_0xe0b1('0x5e')](_0xe0b1('0x91'),_['map'](_0x2f6d45,'id'));_0x2e0e7a[_0xe0b1('0x5e')](_0xe0b1('0x91'),_[_0xe0b1('0x41')](_0x2f6d45,'id'));}});})['then'](function(){if(_0x432c6a['user'][_0xe0b1('0xae')]==='agent'&&!_0x234ded&&!_0x432c6a[_0xe0b1('0x54')]['ChatWebsiteId'])return[];return db['sequelize'][_0xe0b1('0x54')](_0x41a464[_0xe0b1('0xb1')](),_0x4cf715);})['then'](function(_0x27a70e){_0x4586d3['count']=_0x27a70e['length'];if(_0x4586d3[_0xe0b1('0x2f')]===0x0)return[];return db[_0xe0b1('0xb2')][_0xe0b1('0x54')](_0x5b0db2[_0xe0b1('0xb1')](),_0x4cf715)[_0xe0b1('0x21')](function(_0x28de88){_0x339f98=_[_0xe0b1('0xb3')](_0x28de88,'id');_0x4cf715=_['merge'](_0x4cf715,{'model':db[_0xe0b1('0x50')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x432c6a[_0xe0b1('0x54')]['fields']){_0x5df5f6[_0xe0b1('0x56')][_0xe0b1('0x87')](function(_0x312d55){_0x2e0e7a[_0xe0b1('0x61')]('i.'+_0x312d55);});}else{_0x2e0e7a[_0xe0b1('0x61')](_0xe0b1('0xa8'),_0xe0b1('0xb4'));_0x2e0e7a[_0xe0b1('0x61')]('a.key',_0xe0b1('0xb5'));_0x2e0e7a[_0xe0b1('0x61')](_0xe0b1('0xb6'),'Account.mandatoryDisposition');_0x2e0e7a['field'](_0xe0b1('0xb7'),_0xe0b1('0xaa'));_0x2e0e7a[_0xe0b1('0x61')](_0xe0b1('0xb8'));_0x2e0e7a[_0xe0b1('0x61')]('c.firstName',_0xe0b1('0xb9'));_0x2e0e7a[_0xe0b1('0x61')](_0xe0b1('0xba'),_0xe0b1('0xbb'));_0x2e0e7a[_0xe0b1('0x61')](_0xe0b1('0xbc'),_0xe0b1('0xbd'));_0x2e0e7a[_0xe0b1('0x61')]('c.phone',_0xe0b1('0xbe'));_0x2e0e7a[_0xe0b1('0x61')](_0xe0b1('0xbf'),_0xe0b1('0xc0'));_0x2e0e7a['field']('c.fax',_0xe0b1('0xc1'));_0x2e0e7a[_0xe0b1('0x61')](_0xe0b1('0xc2'),_0xe0b1('0xc3'));_0x2e0e7a[_0xe0b1('0x61')](_0xe0b1('0xc4'),_0xe0b1('0xc5'));_0x2e0e7a[_0xe0b1('0x61')](_0xe0b1('0xc6'),_0xe0b1('0x43'));}if(_0x5df5f6[_0xe0b1('0x2e')])_0x2e0e7a['limit'](_0x5df5f6[_0xe0b1('0x2e')]);if(_0x5df5f6[_0xe0b1('0x30')])_0x2e0e7a[_0xe0b1('0x30')](_0x5df5f6[_0xe0b1('0x30')]);return db[_0xe0b1('0xb2')][_0xe0b1('0x54')](_0x2e0e7a['toString'](),_0x4cf715);})['then'](function(_0x1231e7){if(_0x1231e7[_0xe0b1('0x5a')]>0x0)_0x4a6908['where'](_0xe0b1('0xc7'),_[_0xe0b1('0x41')](_0x1231e7,'id'));return db['sequelize'][_0xe0b1('0x54')](_0x4a6908['toString'](),_0x4cf715)[_0xe0b1('0x21')](function(_0x2971ed){var _0x4c4875=_[_0xe0b1('0xc8')](_0x2971ed,_0xe0b1('0xc9'));var _0x40ef7f=[];_0x1231e7['forEach'](function(_0x5c4635){_0x40ef7f[_0xe0b1('0x45')](updateChatInteraction(_0x5c4635,_0x339f98,_0x4c4875));});return BPromise[_0xe0b1('0xca')](_0x40ef7f);});});})[_0xe0b1('0x21')](function(_0x4b1136){_0x4586d3[_0xe0b1('0xcb')]=_0x4b1136;return _0x4586d3;})[_0xe0b1('0x21')](respondWithFilteredResult(_0x4f3dd8,_0x5df5f6))[_0xe0b1('0x29')](handleError(_0x4f3dd8,null));};exports[_0xe0b1('0xcc')]=function(_0x5b5b9f,_0x2edaa2){var _0x1f4e38={'raw':![],'where':{'id':_0x5b5b9f[_0xe0b1('0xcd')]['id']}},_0x14337f={};_0x14337f[_0xe0b1('0x58')]=_[_0xe0b1('0xce')](db[_0xe0b1('0x50')][_0xe0b1('0x51')]);_0x14337f[_0xe0b1('0x54')]=_[_0xe0b1('0xce')](_0x5b5b9f[_0xe0b1('0x54')]);_0x14337f['filters']=_['intersection'](_0x14337f['model'],_0x14337f[_0xe0b1('0x54')]);_0x1f4e38[_0xe0b1('0x56')]=_[_0xe0b1('0x57')](_0x14337f[_0xe0b1('0x58')],qs[_0xe0b1('0x59')](_0x5b5b9f['query']['fields']));_0x1f4e38['attributes']=_0x1f4e38[_0xe0b1('0x56')][_0xe0b1('0x5a')]?_0x1f4e38['attributes']:_0x14337f[_0xe0b1('0x58')];if(_0x5b5b9f[_0xe0b1('0x54')]['includeAll']){_0x1f4e38[_0xe0b1('0xcf')]=[{'all':!![]}];}_0x1f4e38=_[_0xe0b1('0x3a')]({},_0x1f4e38,_0x5b5b9f[_0xe0b1('0xd0')]);return db[_0xe0b1('0x50')][_0xe0b1('0x79')](_0x1f4e38)[_0xe0b1('0x21')](handleEntityNotFound(_0x2edaa2,null))[_0xe0b1('0x21')](respondWithResult(_0x2edaa2,null))[_0xe0b1('0x29')](handleError(_0x2edaa2,null));};exports[_0xe0b1('0xd1')]=function(_0x3bbc17,_0x5dba2c){return db['ChatInteraction'][_0xe0b1('0xd1')](_0x3bbc17[_0xe0b1('0x3b')],{})[_0xe0b1('0x21')](respondWithResult(_0x5dba2c,0xc9))[_0xe0b1('0x29')](handleError(_0x5dba2c,null));};exports['update']=function(_0x5035cf,_0x26a978){if(_0x5035cf['body']['id']){delete _0x5035cf[_0xe0b1('0x3b')]['id'];}return db[_0xe0b1('0x50')][_0xe0b1('0x79')]({'where':{'id':_0x5035cf[_0xe0b1('0xcd')]['id']}})[_0xe0b1('0x21')](handleEntityNotFound(_0x26a978,null))[_0xe0b1('0x21')](saveUpdates(_0x5035cf[_0xe0b1('0x3b')],null))[_0xe0b1('0x21')](respondWithResult(_0x26a978,null))[_0xe0b1('0x29')](handleError(_0x26a978,null));};exports[_0xe0b1('0x35')]=function(_0x310d4d,_0x8500a){return db[_0xe0b1('0x50')][_0xe0b1('0x79')]({'where':{'id':_0x310d4d['params']['id']}})[_0xe0b1('0x21')](handleEntityNotFound(_0x8500a,null))[_0xe0b1('0x21')](removeEntity(_0x8500a,null))[_0xe0b1('0x29')](handleError(_0x8500a,null));};exports['describe']=function(_0x446b7b,_0x5e3d4a){return db[_0xe0b1('0x50')][_0xe0b1('0xd2')]()[_0xe0b1('0x21')](respondWithResult(_0x5e3d4a,null))[_0xe0b1('0x29')](handleError(_0x5e3d4a,null));};exports[_0xe0b1('0xd3')]=function(_0x3469ed,_0x1555cb){var _0x3580ea=_0x3469ed[_0xe0b1('0xcd')]['id'];var _0xa07da4;var _0x533e86;var _0x124545;return db[_0xe0b1('0x50')][_0xe0b1('0xd4')]({'where':{'id':_0x3580ea}})['then'](function(_0x2c4bc9){_0xa07da4=_0x2c4bc9;return db[_0xe0b1('0xd5')][_0xe0b1('0xd4')]({'where':{'id':_0x2c4bc9[_0xe0b1('0x90')]},'attributes':['id',_0xe0b1('0xd6'),_0xe0b1('0xd7'),_0xe0b1('0xd8'),_0xe0b1('0xd9'),_0xe0b1('0xda')],'raw':!![]});})[_0xe0b1('0x21')](function(_0x2d136a){if(_0x2d136a&&_0x2d136a[_0xe0b1('0xd6')]&&_0x2d136a[_0xe0b1('0xd7')]){_0x533e86=_0x2d136a;var _0x2f655a={'interaction':{'id':_0x3580ea},'agent':{'id':_0x3469ed[_0xe0b1('0xad')]['id'],'name':_0x3469ed[_0xe0b1('0xad')][_0xe0b1('0x37')],'fullname':_0x3469ed['user'][_0xe0b1('0x42')],'email':_0x3469ed[_0xe0b1('0xad')]['email']},'contact':_0x3469ed['body']['contact'],'account':_0x3469ed[_0xe0b1('0x3b')]['account']};var _0x23a695={'rejectUnauthorized':![],'method':'POST','url':_0xe0b1('0xdb'),'headers':{'X-APIKEY':_0x2d136a[_0xe0b1('0xd6')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3469ed[_0xe0b1('0xad')][_0xe0b1('0xdc')]],'buttons':null,'topic':_0x533e86[_0xe0b1('0xd8')],'note':_[_0xe0b1('0xdd')](_0x533e86[_0xe0b1('0xd9')])?null:getMustacheRender(_0x533e86[_0xe0b1('0xd9')],_0x2f655a),'metadata':null},'redirect':_0xe0b1('0xde'),'json':!![]};try{if(!_[_0xe0b1('0xdd')](_0x533e86['vidaooMetadata'])){var _0x7a9992=getMustacheRender(_0x533e86[_0xe0b1('0xda')],_0x2f655a);var _0x212c57=JSON[_0xe0b1('0x94')](_0x7a9992);_0x23a695[_0xe0b1('0x3b')]['metadata']=_0x212c57;}}catch(_0x466caf){throw new db['Sequelize'][(_0xe0b1('0xdf'))](_0xe0b1('0xe0'));}return rp(_0x23a695);}else{throw new db[(_0xe0b1('0xa4'))][(_0xe0b1('0xdf'))](_0xe0b1('0xe1'));}})[_0xe0b1('0x21')](function(_0x2b5c4f){_0x124545=_0x2b5c4f;if(_0x124545['id']){var _0x5a5f3b={'body':_0x124545[_0xe0b1('0xe2')],'ChatWebsiteId':_0x533e86['id'],'ChatInteractionId':_0xa07da4['id'],'direction':'out','UserId':_0x3469ed[_0xe0b1('0xad')]['id']};return db['ChatMessage'][_0xe0b1('0xd1')](_0x5a5f3b,{});}else{throw new db['Sequelize'][(_0xe0b1('0xdf'))](_0xe0b1('0xe3'));}})[_0xe0b1('0x21')](function(){return _0xa07da4['updateAttributes']({'vidaooSessionId':_0x124545['id']});})['then'](respondWithResult(_0x1555cb,null))[_0xe0b1('0x29')](handleError(_0x1555cb,null));};exports[_0xe0b1('0xe4')]=function(_0x5bd77d,_0x2974a1){if(_0x5bd77d[_0xe0b1('0x3b')]['id']){delete _0x5bd77d[_0xe0b1('0x3b')]['id'];}return db['ChatInteraction'][_0xe0b1('0x79')]({'where':{'id':_0x5bd77d['params']['id']},'include':[{'model':db['CmContact'],'as':_0xe0b1('0x7d')}]})[_0xe0b1('0x21')](handleEntityNotFound(_0x2974a1,null))[_0xe0b1('0x21')](saveUpdates(_0x5bd77d[_0xe0b1('0x3b')],null))['then'](respondWithResult(_0x2974a1,null))[_0xe0b1('0x29')](handleError(_0x2974a1,null));};exports[_0xe0b1('0xe5')]=function(_0x1e6133,_0x22d6ff,_0x203f20){if(_0x1e6133[_0xe0b1('0x3b')]['id']){delete _0x1e6133[_0xe0b1('0x3b')]['id'];}return db[_0xe0b1('0x50')][_0xe0b1('0x79')]({'where':{'id':_0x1e6133[_0xe0b1('0xcd')]['id']}})[_0xe0b1('0x21')](function(_0x106739){if(!_0x106739){logger[_0xe0b1('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xe0b1('0xe6'));_0x22d6ff[_0xe0b1('0x2a')](0x194);}else{if(_0x106739[_0xe0b1('0x4b')]){throw new db[(_0xe0b1('0xa4'))]['ValidationError'](_0xe0b1('0xe7'));}}return _0x106739;})[_0xe0b1('0x21')](function(_0xa73397){if(_0xa73397){return _0xa73397[_0xe0b1('0x34')]({'closed':_0x1e6133[_0xe0b1('0x3b')][_0xe0b1('0x4a')],'disposition':_0x1e6133[_0xe0b1('0x3b')][_0xe0b1('0x4d')]})['then'](function(_0x9b56b){return _0x9b56b;});}})[_0xe0b1('0x21')](function(_0x4ece7a){return respondWithRpcPromise('AbandonInteraction',_0xe0b1('0xe5'),_0x1e6133[_0xe0b1('0x3b')],client9004);})[_0xe0b1('0x21')](respondWithResult(_0x22d6ff,null))[_0xe0b1('0x29')](handleError(_0x22d6ff,null));};exports[_0xe0b1('0xe8')]=function(_0x38a92c,_0x4e7560,_0x735d0){_0x38a92c[_0xe0b1('0x3b')][_0xe0b1('0x37')]=_0x38a92c[_0xe0b1('0xe9')][_0xe0b1('0xea')];_0x38a92c[_0xe0b1('0x3b')][_0xe0b1('0xeb')]=_0x38a92c[_0xe0b1('0xe9')][_0xe0b1('0xec')];_0x38a92c[_0xe0b1('0x3b')][_0xe0b1('0x53')]=_0x38a92c[_0xe0b1('0xe9')][_0xe0b1('0xed')];return db[_0xe0b1('0xee')][_0xe0b1('0xd1')](_0x38a92c[_0xe0b1('0x3b')])[_0xe0b1('0x21')](respondWithResult(_0x4e7560,0xc9))[_0xe0b1('0x29')](handleError(_0x4e7560,null));};exports[_0xe0b1('0xef')]=function(_0x1b77ad,_0x26542f,_0x3c5370){return db[_0xe0b1('0x50')][_0xe0b1('0xd4')]({'where':{'id':_0x1b77ad[_0xe0b1('0xcd')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x26542f,null))[_0xe0b1('0x21')](function(_0x5232c5){if(_0x5232c5){if(_0x5232c5[_0xe0b1('0x4a')]){return _0x26542f[_0xe0b1('0x2c')](0x193)[_0xe0b1('0xf0')]({'status':0x193,'message':_0xe0b1('0xf1')});}return db[_0xe0b1('0xee')]['findOne']({'where':{'id':_0x1b77ad['query'][_0xe0b1('0xf2')]},'raw':!![]})[_0xe0b1('0x21')](handleEntityNotFound(_0x26542f,null));}})[_0xe0b1('0x21')](function(_0x31eab5){if(_0x31eab5){var _0x43a3d1=_0x31eab5[_0xe0b1('0xf3')]!==null;var _0x42dcc4=path[_0xe0b1('0xf4')](config[_0xe0b1('0xf5')],'server/files/attachments/');if(_0x43a3d1){_0x42dcc4=path['join'](_0x42dcc4,_0xe0b1('0xf6'));}var _0x489bb5=path[_0xe0b1('0xf4')](_0x42dcc4,_0x31eab5['basename']);return _0x26542f[_0xe0b1('0xf7')](_0x489bb5);}})[_0xe0b1('0x29')](handleError(_0x26542f,null));};exports[_0xe0b1('0xf8')]=function(_0x223f58,_0x5280c7){var _0x5544e8=null;var _0x10dbac=null;var _0x588089=null;var _0x4be56b=null;if(_0x223f58[_0xe0b1('0x3b')]['id']){delete _0x223f58['body']['id'];}if(_0x223f58[_0xe0b1('0x3b')][_0xe0b1('0xf9')]){_0x4be56b=path['join'](config[_0xe0b1('0xf5')],_0xe0b1('0xfa'),util['format'](_0xe0b1('0xfb'),Date[_0xe0b1('0xfc')]()));_0x223f58[_0xe0b1('0x3b')][_0xe0b1('0xfd')]=_0x4be56b;}return db[_0xe0b1('0x50')][_0xe0b1('0x79')]({'where':{'id':_0x223f58['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0xe0b1('0xfe'),'include':[{'model':db[_0xe0b1('0x8a')],'as':'User'}]}]})[_0xe0b1('0x21')](handleEntityNotFound(_0x5280c7,null))[_0xe0b1('0x21')](saveUpdates(_0x223f58[_0xe0b1('0x3b')],null))['then'](function(_0x1f666e){if(_0x1f666e){_0x5544e8=_0x1f666e;return db['ChatWebsite'][_0xe0b1('0x79')]({'where':{'id':_0x5544e8[_0xe0b1('0x90')]}});}})[_0xe0b1('0x21')](function(_0x14f3fb){if(_0x14f3fb){_0x588089=_0x14f3fb;return db[_0xe0b1('0xff')][_0xe0b1('0x79')]({'where':{'id':_0x5544e8[_0xe0b1('0x83')]}});}})[_0xe0b1('0x21')](function(_0x3757a3){if(_0x3757a3){_0x10dbac=_0x3757a3;if(_0x4be56b){var _0x47ea5e=null;for(var _0x91ef6c=0x1;_0x91ef6c<_0x5544e8[_0xe0b1('0xfe')]['length'];++_0x91ef6c){_0x47ea5e=_0x5544e8[_0xe0b1('0xfe')][_0x91ef6c];var _0x54629d=_0x47ea5e[_0xe0b1('0x4b')]?util[_0xe0b1('0x100')](_0xe0b1('0x101'),_0x588089[_0xe0b1('0x102')],_0x47ea5e[_0xe0b1('0x4b')]):_0xe0b1('0x103');var _0x403680=_0x223f58[_0xe0b1('0x3b')][_0xe0b1('0x104')]||util['format'](_0xe0b1('0x101'),_0xe0b1('0x105'),_0x47ea5e['ContactId']);switch(_0x588089[_0xe0b1('0x106')]){case _0xe0b1('0x107'):_0x54629d=_0x47ea5e[_0xe0b1('0x4b')]?util['format']('%s%d',_0x588089['agentAlias'],_0x47ea5e[_0xe0b1('0x4b')]):'System';break;case _0xe0b1('0x108'):_0x54629d=_0x47ea5e[_0xe0b1('0x4b')]?_0x47ea5e['User'][_0xe0b1('0x109')]||_0x47ea5e[_0xe0b1('0x8a')][_0xe0b1('0x42')]:_0xe0b1('0x103');break;case _0xe0b1('0x10a'):_0x54629d=_0x47ea5e[_0xe0b1('0x4b')]?_0x47ea5e[_0xe0b1('0x8a')][_0xe0b1('0x42')]:_0xe0b1('0x103');break;default:_0x54629d=_0x47ea5e['UserId']?util[_0xe0b1('0x100')](_0xe0b1('0x101'),_0x588089[_0xe0b1('0x102')],_0x47ea5e[_0xe0b1('0x4b')]):'System';}var _0x3425c9=util[_0xe0b1('0x100')](_0xe0b1('0x10b'),moment(_0x47ea5e[_0xe0b1('0x93')])[_0xe0b1('0x100')](_0xe0b1('0x10c')),_0x47ea5e[_0xe0b1('0x10d')]==='in'?_0x403680:_0x54629d,_0x47ea5e[_0xe0b1('0x3b')]);if(!_0x47ea5e['secret']){fs[_0xe0b1('0x10e')](_0x4be56b,_0x3425c9);}}return db[_0xe0b1('0x10f')][_0xe0b1('0xd4')]({'where':{'service':!![]},'include':[{'model':db[_0xe0b1('0x110')],'as':_0xe0b1('0x111'),'raw':!![]}]});}}})[_0xe0b1('0x21')](function(_0x18ae26){if(_0x18ae26&&_0x18ae26[_0xe0b1('0x111')]&&_0x223f58[_0xe0b1('0x3b')]){var _0x4ec6d4={'tls':{'rejectUnauthorized':![]}};if(_0x18ae26['Smtp']['service']){_0x4ec6d4['service']=_0x18ae26['Smtp']['service'];}else{_0x4ec6d4[_0xe0b1('0x112')]=_0x18ae26[_0xe0b1('0x111')]['host'];_0x4ec6d4[_0xe0b1('0x113')]=_0x18ae26['Smtp'][_0xe0b1('0x113')];_0x4ec6d4['secure']=_0x18ae26['Smtp'][_0xe0b1('0x114')];}if(_0x18ae26['Smtp'][_0xe0b1('0x115')]){_0x4ec6d4[_0xe0b1('0x116')]={'user':_0x18ae26['Smtp'][_0xe0b1('0xad')],'pass':_0x18ae26[_0xe0b1('0x111')][_0xe0b1('0x117')]};}return respondWithRpcPromise(_0xe0b1('0x118'),'sendMail',{'account':_0x4ec6d4,'message':{'from':util[_0xe0b1('0x100')](_0xe0b1('0x119'),_0x18ae26[_0xe0b1('0x37')],_0x18ae26[_0xe0b1('0xdc')]||_0x18ae26[_0xe0b1('0x111')]['user']),'to':_0x223f58[_0xe0b1('0x3b')][_0xe0b1('0xf9')],'subject':_0xe0b1('0x11a'),'text':util[_0xe0b1('0x100')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x223f58[_0xe0b1('0x3b')][_0xe0b1('0xf9')]),'attachments':[{'path':_0x4be56b}]}})[_0xe0b1('0x21')](function(){return _0x5544e8;})[_0xe0b1('0x29')](function(_0x58a896){console[_0xe0b1('0x24')](_0x58a896);});}else{return _0x5544e8;}})[_0xe0b1('0x21')](respondWithStatusCode(_0x5280c7,0xc8))[_0xe0b1('0x29')](handleError(_0x5280c7,null));};exports['addMessage']=function(_0x29edd0,_0x475dfb,_0x2070b8){return db['ChatMessage'][_0xe0b1('0x79')]({'where':{'id':_0x29edd0[_0xe0b1('0xcd')]['id']}})[_0xe0b1('0x21')](handleEntityNotFound(_0x475dfb,null))[_0xe0b1('0x21')](function(_0x14691c){if(_0x14691c){return _0x14691c['addMessage'](_0x29edd0[_0xe0b1('0x3b')][_0xe0b1('0x11b')],_['omit'](_0x29edd0['body'],[_0xe0b1('0x11b'),'id'])||{});}})[_0xe0b1('0x21')](respondWithResult(_0x475dfb,null))[_0xe0b1('0x29')](handleError(_0x475dfb,null));};exports[_0xe0b1('0x11c')]=function(_0x28997c,_0x23e80e,_0x19b6c6){var _0x2e1fc9={'raw':![],'where':{}};var _0x155e33={};var _0x27379b={'count':0x0,'rows':[]};return db[_0xe0b1('0x50')][_0xe0b1('0xd4')]({'where':{'id':_0x28997c[_0xe0b1('0xcd')]['id']}})[_0xe0b1('0x21')](handleEntityNotFound(_0x23e80e,null))[_0xe0b1('0x21')](function(_0x599cd6){if(_0x599cd6){_0x155e33['model']=_[_0xe0b1('0xce')](db[_0xe0b1('0x11d')][_0xe0b1('0x51')]);_0x155e33[_0xe0b1('0x54')]=_[_0xe0b1('0xce')](_0x28997c[_0xe0b1('0x54')]);_0x155e33[_0xe0b1('0x55')]=_[_0xe0b1('0x57')](_0x155e33[_0xe0b1('0x58')],_0x155e33[_0xe0b1('0x54')]);_0x2e1fc9[_0xe0b1('0x56')]=_['intersection'](_0x155e33[_0xe0b1('0x58')],qs[_0xe0b1('0x59')](_0x28997c[_0xe0b1('0x54')]['fields']));_0x2e1fc9['attributes']=_0x2e1fc9['attributes'][_0xe0b1('0x5a')]?_0x2e1fc9['attributes']:_0x155e33['model'];if(!_0x28997c[_0xe0b1('0x54')][_0xe0b1('0x5b')](_0xe0b1('0x5c'))){_0x2e1fc9['limit']=qs[_0xe0b1('0x2e')](_0x28997c[_0xe0b1('0x54')][_0xe0b1('0x2e')]);_0x2e1fc9[_0xe0b1('0x30')]=qs[_0xe0b1('0x30')](_0x28997c[_0xe0b1('0x54')]['offset']);}_0x2e1fc9[_0xe0b1('0xa9')]=qs[_0xe0b1('0x5d')](_0x28997c[_0xe0b1('0x54')]['sort']);_0x2e1fc9[_0xe0b1('0x5e')]=qs[_0xe0b1('0x55')](_[_0xe0b1('0x5f')](_0x28997c[_0xe0b1('0x54')],_0x155e33[_0xe0b1('0x55')]));_0x2e1fc9[_0xe0b1('0x5e')]['ChatInteractionId']=_0x599cd6['id'];if(_0x28997c[_0xe0b1('0x54')][_0xe0b1('0x9d')]){_0x2e1fc9['where']=_[_0xe0b1('0x3a')](_0x2e1fc9['where'],{'$or':_['map'](_0x2e1fc9[_0xe0b1('0x56')],function(_0x56bd65){var _0x5b6133={};_0x5b6133[_0x56bd65]={'$like':'%'+_0x28997c[_0xe0b1('0x54')][_0xe0b1('0x9d')]+'%'};return _0x5b6133;})});}if(_0x28997c['query'][_0xe0b1('0x11e')]){var _0x2cb973=_0x28997c[_0xe0b1('0x54')][_0xe0b1('0x11e')][_0xe0b1('0x80')](',');var _0xabe2f7={};_0xabe2f7[_0x2cb973[0x0]]={'$gte':moment(_0x2cb973[0x1])[_0xe0b1('0x100')](_0xe0b1('0x11f'))};_0x2e1fc9[_0xe0b1('0x5e')]=_['merge'](_0x2e1fc9[_0xe0b1('0x5e')],_0xabe2f7);}_0x2e1fc9=_[_0xe0b1('0x3a')]({},_0x2e1fc9,_0x28997c[_0xe0b1('0xd0')]);return db[_0xe0b1('0x11d')]['count']({'where':_0x2e1fc9['where']})[_0xe0b1('0x21')](function(_0x3c8595){_0x27379b[_0xe0b1('0x2f')]=_0x3c8595;if(_0x28997c['query']['includeAll']){_0x2e1fc9[_0xe0b1('0xcf')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b1('0x120')](_0x2e1fc9);})['then'](function(_0x35d5a0){_0x27379b[_0xe0b1('0xcb')]=_0x35d5a0;return _0x27379b;});}})[_0xe0b1('0x21')](respondWithFilteredResult(_0x23e80e,_0x2e1fc9))[_0xe0b1('0x29')](handleError(_0x23e80e,null));};exports[_0xe0b1('0x121')]=function(_0x16022c,_0x1cf45b,_0x4a443f){var _0x5e288a={'where':{}},_0x206815={},_0x193f6b={'count':0x0,'rows':[]};return db[_0xe0b1('0x50')][_0xe0b1('0xd4')]({'where':{'id':_0x16022c[_0xe0b1('0xcd')]['id']}})[_0xe0b1('0x21')](handleEntityNotFound(_0x1cf45b,null))[_0xe0b1('0x21')](function(_0xd1831){if(_0xd1831){_0x206815[_0xe0b1('0x58')]=_[_0xe0b1('0xce')](db[_0xe0b1('0x11d')][_0xe0b1('0x51')]);_0x206815['query']=_[_0xe0b1('0xce')](_0x16022c[_0xe0b1('0x54')]);_0x206815[_0xe0b1('0x55')]=_[_0xe0b1('0x57')](_0x206815[_0xe0b1('0x58')],_0x206815[_0xe0b1('0x54')]);_0x5e288a[_0xe0b1('0x56')]=_['intersection'](_0x206815[_0xe0b1('0x58')],qs[_0xe0b1('0x59')](_0x16022c[_0xe0b1('0x54')][_0xe0b1('0x59')]));_0x5e288a[_0xe0b1('0x56')]=_0x5e288a[_0xe0b1('0x56')][_0xe0b1('0x5a')]?_0x5e288a[_0xe0b1('0x56')]:_0x206815['model'];if(!_0x16022c['query']['hasOwnProperty']('nolimit')){_0x5e288a[_0xe0b1('0x2e')]=qs['limit'](_0x16022c[_0xe0b1('0x54')]['limit']);_0x5e288a[_0xe0b1('0x30')]=qs['offset'](_0x16022c['query'][_0xe0b1('0x30')]);}_0x5e288a['order']=qs['sort'](_0x16022c['query'][_0xe0b1('0x5d')]);_0x5e288a[_0xe0b1('0x5e')]=qs[_0xe0b1('0x55')](_[_0xe0b1('0x5f')](_0x16022c['query'],_0x206815['filters']));_0x5e288a[_0xe0b1('0x5e')][_0xe0b1('0xc9')]=_0xd1831['id'];if(_0x16022c[_0xe0b1('0x54')][_0xe0b1('0x9d')]){_0x5e288a[_0xe0b1('0x5e')]=_[_0xe0b1('0x3a')](_0x5e288a[_0xe0b1('0x5e')],{'$or':_[_0xe0b1('0x41')](_0x5e288a[_0xe0b1('0x56')],function(_0x1b881b){var _0x4a9441={};_0x4a9441[_0x1b881b]={'$like':'%'+_0x16022c['query']['filter']+'%'};return _0x4a9441;})});}_0x5e288a[_0xe0b1('0x5e')][_0xe0b1('0x122')]=![];if(_0x16022c['query']['id']){_0x5e288a['where']['id']={'$gt':_0x16022c[_0xe0b1('0x54')]['id']};}_0x5e288a=_[_0xe0b1('0x3a')]({},_0x5e288a,_0x16022c['options']);return db[_0xe0b1('0x11d')][_0xe0b1('0x2f')]({'where':_0x5e288a['where']})['then'](function(_0x3f5a6a){_0x193f6b[_0xe0b1('0x2f')]=_0x3f5a6a;_0x5e288a[_0xe0b1('0xcf')]=[];if(_0x16022c['query'][_0xe0b1('0x123')]){_0x5e288a[_0xe0b1('0xcf')][_0xe0b1('0x45')]({'model':db[_0xe0b1('0x8a')],'as':'User','attributes':['id',_0xe0b1('0x42'),_0xe0b1('0x109')]});}if(_0x16022c[_0xe0b1('0x54')]['includeAll']){_0x5e288a[_0xe0b1('0xcf')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b1('0x120')](_0x5e288a);})[_0xe0b1('0x21')](function(_0x2add4a){_0x193f6b[_0xe0b1('0xcb')]=_0x2add4a;return _0x193f6b;});}})['then'](respondWithFilteredResult(_0x1cf45b,_0x5e288a))[_0xe0b1('0x29')](handleError(_0x1cf45b,null));};exports['addTags']=function(_0x195ac1,_0x565c10,_0x5b4e2d){return db['ChatInteraction'][_0xe0b1('0x79')]({'where':{'id':_0x195ac1[_0xe0b1('0xcd')]['id']}})[_0xe0b1('0x21')](handleEntityNotFound(_0x565c10,null))[_0xe0b1('0x21')](function(_0x138575){if(_0x138575){return _0x138575['setTags'](_0x195ac1['body'][_0xe0b1('0x11b')],_[_0xe0b1('0x124')](_0x195ac1['body'],['ids','id'])||{})[_0xe0b1('0x125')](function(){return db[_0xe0b1('0x86')][_0xe0b1('0x120')]({'attributes':['id',_0xe0b1('0x37'),_0xe0b1('0x62')],'where':{'id':_0x195ac1[_0xe0b1('0x3b')][_0xe0b1('0x11b')]}});})[_0xe0b1('0x21')](function(_0x42b55b){socket[_0xe0b1('0x126')](_0xe0b1('0x127'),{'id':Number(_0x195ac1['params']['id']),'tags':_0x42b55b||[]});return{'id':Number(_0x195ac1[_0xe0b1('0xcd')]['id']),'tags':_0x42b55b||[]};});}})[_0xe0b1('0x21')](respondWithResult(_0x565c10,null))['catch'](handleError(_0x565c10,null));};exports[_0xe0b1('0x128')]=function(_0x30c0a8,_0x5c3633,_0x1264f6){return db['ChatInteraction'][_0xe0b1('0x79')]({'where':{'id':_0x30c0a8[_0xe0b1('0xcd')]['id']}})[_0xe0b1('0x21')](handleEntityNotFound(_0x5c3633,null))[_0xe0b1('0x21')](function(_0x789ad8){if(_0x789ad8){return _0x789ad8[_0xe0b1('0x128')](_0x30c0a8['query'][_0xe0b1('0x11b')]);}})['then'](respondWithStatusCode(_0x5c3633,null))[_0xe0b1('0x29')](handleError(_0x5c3633,null));};exports[_0xe0b1('0xf7')]=function(_0x333481,_0x144d22){var _0xbef7e0=moment()['unix']()[_0xe0b1('0xb1')]();var _0x59892c=path[_0xe0b1('0xf4')](config[_0xe0b1('0xf5')],_0xe0b1('0x129'),'files','tmp');var _0x4422b9=path[_0xe0b1('0xf4')](config[_0xe0b1('0xf5')],'server','files',_0xe0b1('0x12a'));var _0x20496c=path[_0xe0b1('0xf4')](_0x59892c,_0xbef7e0);var _0x3cf6f5=util[_0xe0b1('0x100')](_0xe0b1('0x12b'),_0x333481[_0xe0b1('0xcd')]['id'],_0xbef7e0);var _0x479d=path['join'](_0x59892c,_0x3cf6f5);var _0x5514bd=[];_0x5514bd['push']({'model':db[_0xe0b1('0x8a')],'as':'User','attributes':['id',_0xe0b1('0x42')],'raw':!![]});_0x5514bd[_0xe0b1('0x45')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0xe0b1('0x12c')],'raw':!![]});if(_0x333481[_0xe0b1('0x54')][_0xe0b1('0x12a')]){_0x5514bd['push']({'model':db['Attachment'],'as':_0xe0b1('0xee'),'raw':!![]});}var _0x78a1e=[{'model':db['ChatMessage'],'as':_0xe0b1('0xfe'),'attributes':['id',_0xe0b1('0x3b'),_0xe0b1('0x93'),_0xe0b1('0x10d'),_0xe0b1('0x122'),_0xe0b1('0x99')],'include':_0x5514bd}];_0x78a1e['push']({'model':db[_0xe0b1('0xd5')],'as':_0xe0b1('0x12d'),'attributes':['id','name']});_0x78a1e[_0xe0b1('0x45')]({'model':db[_0xe0b1('0x8a')],'as':_0xe0b1('0x12e'),'attributes':['id',_0xe0b1('0x42')]});return db['ChatInteraction']['find']({'where':{'id':_0x333481[_0xe0b1('0xcd')]['id']},'include':_0x78a1e})[_0xe0b1('0x21')](handleEntityNotFound(_0x144d22,null))[_0xe0b1('0x21')](function(_0x1a5cdc){if(_0x1a5cdc){var _0x152d57=_0x1a5cdc['get']({'plain':!![]});fs[_0xe0b1('0x12f')](_0x20496c);var _0xb66db6={'channel':_0xe0b1('0x130'),'account':_0x152d57['Account'][_0xe0b1('0x37')],'agent':_0x152d57[_0xe0b1('0x12e')]?_0x152d57[_0xe0b1('0x12e')][_0xe0b1('0x42')]:_0xe0b1('0x131'),'createdAt':moment(_0x152d57[_0xe0b1('0x93')])[_0xe0b1('0x100')](_0xe0b1('0x11f'))['toString'](),'closedAt':_0x152d57[_0xe0b1('0x4a')]?moment(_0x152d57[_0xe0b1('0x132')])[_0xe0b1('0x100')](_0xe0b1('0x11f'))[_0xe0b1('0xb1')]():'','disposition':_0x152d57[_0xe0b1('0x4d')],'chatInfo':{'browser':_0x152d57[_0xe0b1('0x133')],'os':_0x152d57[_0xe0b1('0x134')],'referer':_0x152d57['referer'],'customerIp':_0x152d57[_0xe0b1('0x135')],'customerPort':_0x152d57['customerPort']?_0x152d57[_0xe0b1('0x136')]:'N.A.'},'messages':_(_0x152d57[_0xe0b1('0xfe')])[_0xe0b1('0x137')]()[_0xe0b1('0x9d')]({'secret':![]})[_0xe0b1('0x41')](function(_0x247093){if(_0x247093['Attachment']){var _0x425c14=path['join'](_0x4422b9,_0x247093[_0xe0b1('0xee')][_0xe0b1('0xeb')]);if(fs['existsSync'](_0x425c14)){fs['createReadStream'](_0x425c14)[_0xe0b1('0x138')](fs[_0xe0b1('0x139')](path[_0xe0b1('0xf4')](_0x20496c,_0x247093['Attachment']['basename'])));}}return{'date':moment(_0x247093[_0xe0b1('0x93')])[_0xe0b1('0x100')](_0xe0b1('0x11f'))[_0xe0b1('0xb1')](),'sender':_0x247093[_0xe0b1('0x10d')]==='out'?_0x247093['User']?_0x247093[_0xe0b1('0x8a')][_0xe0b1('0x42')]:_0xe0b1('0x103'):_0x247093[_0xe0b1('0x7d')][_0xe0b1('0x13a')]+(_0x247093[_0xe0b1('0x7d')]['lastName']?'\x20'+_0x247093[_0xe0b1('0x7d')][_0xe0b1('0x12c')]:''),'body':_0x247093[_0xe0b1('0xee')]?_0x247093['Attachment'][_0xe0b1('0xeb')]:_0x247093[_0xe0b1('0x3b')],'direction':_0x247093['direction']===_0xe0b1('0x13b')?'A':'C','secret':_0x247093[_0xe0b1('0x122')],'read':_0x247093[_0xe0b1('0x99')],'attachment':_0x247093[_0xe0b1('0xee')]};})['value']()};return ejs['renderFile'](path[_0xe0b1('0xf4')](config[_0xe0b1('0xf5')],_0xe0b1('0x129'),_0xe0b1('0x13c'),'downloadInteraction.ejs'),{'interaction':_0xb66db6})[_0xe0b1('0x21')](function(_0x553fe7){var _0xeb8e4b=path[_0xe0b1('0xf4')](_0x20496c,_0xe0b1('0x13d')+_0x152d57['id']+'-'+_0xbef7e0+_0xe0b1('0x13e'));var _0x2dd473={'path':_0xeb8e4b,'channel':_0xe0b1('0x130'),'interactionId':_0x152d57['id']};return pdf[_0xe0b1('0x13f')](_0x553fe7,_0x2dd473);})[_0xe0b1('0x21')](function(){return new BPromise(function(_0x13795f,_0x5b488d){zipdir(_0x20496c,{'saveTo':_0x479d},function(_0x567b8e,_0x5e0d4c){if(_0x567b8e)return _0x5b488d(_0x567b8e);return _0x13795f(_0x5e0d4c);});})[_0xe0b1('0x21')](function(){return new BPromise(function(_0x541782,_0x5c05c2){rimraf(_0x20496c,function(_0x3ef5e7){if(_0x3ef5e7)_0x5c05c2(_0x3ef5e7);return _0x541782();});});})[_0xe0b1('0x21')](function(){return _0x144d22['download'](_0x479d,_0x3cf6f5,function(_0x341d38){if(_0x341d38){console[_0xe0b1('0x140')](_0xe0b1('0x141'),_0x341d38);}else{fs[_0xe0b1('0x142')](_0x479d);}});});});}else{return _0x144d22[_0xe0b1('0x2a')](0xc8);}})['catch'](handleError(_0x144d22,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 687ac46..9f71656 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 _0x3df8=['hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','then','map','findAll','setDataValue','unreadMessages','catch'];(function(_0x5e4805,_0x35d20c){var _0x5310d5=function(_0xd1a04b){while(--_0xd1a04b){_0x5e4805['push'](_0x5e4805['shift']());}};_0x5310d5(++_0x35d20c);}(_0x3df8,0xef));var _0x83df=function(_0x2730da,_0x1098bd){_0x2730da=_0x2730da-0x0;var _0xfe9991=_0x3df8[_0x2730da];return _0xfe9991;};'use strict';var EventEmitter=require(_0x83df('0x0'));var ChatInteraction=require(_0x83df('0x1'))['db'][_0x83df('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x83df('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x83df('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x83df('0x5'),'afterDestroy':_0x83df('0x6')};function emitEvent(_0x4b8ce6){return function(_0x32839e,_0x19aa15,_0x3ddc1f){_0x32839e['getUsers']({'attributes':['id'],'raw':!![]})[_0x83df('0x7')](function(_0x24b6e5){_0x32839e['setDataValue']('Users',_0x24b6e5[_0x83df('0x8')](function(_0x3480a7){return{'id':_0x3480a7['id']};}));return ChatMessage[_0x83df('0x9')]({'where':{'ChatInteractionId':_0x32839e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x583c0b){_0x32839e[_0x83df('0xa')](_0x83df('0xb'),_0x583c0b['length']);ChatInteractionEvents['emit'](_0x4b8ce6+':'+_0x32839e['id'],_0x32839e);ChatInteractionEvents['emit'](_0x4b8ce6,_0x32839e);_0x3ddc1f(null);})[_0x83df('0xc')](_0x3ddc1f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x83df('0xd')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x96ab=['save','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners'];(function(_0x35c45a,_0x18cca1){var _0x17c047=function(_0x4fbc01){while(--_0x4fbc01){_0x35c45a['push'](_0x35c45a['shift']());}};_0x17c047(++_0x18cca1);}(_0x96ab,0xd4));var _0xb96a=function(_0x4c07ab,_0x3933d4){_0x4c07ab=_0x4c07ab-0x0;var _0x1dc32e=_0x96ab[_0x4c07ab];return _0x1dc32e;};'use strict';var EventEmitter=require(_0xb96a('0x0'));var ChatInteraction=require(_0xb96a('0x1'))['db'][_0xb96a('0x2')];var ChatMessage=require(_0xb96a('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb96a('0x3')](0x0);var events={'afterCreate':_0xb96a('0x4'),'afterUpdate':'update','afterDestroy':_0xb96a('0x5')};function emitEvent(_0xed9bda){return function(_0x59d2a7,_0x3b7ff1,_0x3d223c){_0x59d2a7[_0xb96a('0x6')]({'attributes':['id'],'raw':!![]})[_0xb96a('0x7')](function(_0x3be1d0){_0x59d2a7['setDataValue'](_0xb96a('0x8'),_0x3be1d0[_0xb96a('0x9')](function(_0x20c041){return{'id':_0x20c041['id']};}));return ChatMessage[_0xb96a('0xa')]({'where':{'ChatInteractionId':_0x59d2a7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb96a('0x7')](function(_0x317765){_0x59d2a7[_0xb96a('0xb')](_0xb96a('0xc'),_0x317765[_0xb96a('0xd')]);ChatInteractionEvents['emit'](_0xed9bda+':'+_0x59d2a7['id'],_0x59d2a7);ChatInteractionEvents[_0xb96a('0xe')](_0xed9bda,_0x59d2a7);_0x3d223c(null);})[_0xb96a('0xf')](_0x3d223c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xb96a('0x10')](e,emitEvent(event));}}module[_0xb96a('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index ce6e327..bd98901 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 _0x4b7d=['utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x6a47e0,_0x5eccbc){var _0x558a99=function(_0x579858){while(--_0x579858){_0x6a47e0['push'](_0x6a47e0['shift']());}};_0x558a99(++_0x5eccbc);}(_0x4b7d,0x196));var _0xd4b7=function(_0xb3c3b9,_0x41d41f){_0xb3c3b9=_0xb3c3b9-0x0;var _0x6e79b0=_0x4b7d[_0xb3c3b9];return _0x6e79b0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd4b7('0x0'))(_0xd4b7('0x1'));var moment=require(_0xd4b7('0x2'));var BPromise=require('bluebird');var rp=require(_0xd4b7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd4b7('0x4'));var config=require(_0xd4b7('0x5'));var attributes=require('./chatInteraction.attributes');module[_0xd4b7('0x6')]=function(_0x10a45b,_0x2bce1c){return _0x10a45b[_0xd4b7('0x7')](_0xd4b7('0x8'),attributes,{'tableName':_0xd4b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x308122,_0x5e51cc,_0x329685){if(_0x308122['changed']('closed')){_0x308122[_0xd4b7('0xa')]=moment()[_0xd4b7('0xb')](_0xd4b7('0xc'));}_0x329685(null,_0x308122);}},'charset':_0xd4b7('0xd'),'collate':_0xd4b7('0xe')});}; \ No newline at end of file +var _0x884c=['rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x1917da,_0x2c70ba){var _0x47b18e=function(_0x35d2c5){while(--_0x35d2c5){_0x1917da['push'](_0x1917da['shift']());}};_0x47b18e(++_0x2c70ba);}(_0x884c,0xba));var _0xc884=function(_0x1c6bbb,_0x1c4f0a){_0x1c6bbb=_0x1c6bbb-0x0;var _0x389d6d=_0x884c[_0x1c6bbb];return _0x389d6d;};'use strict';var _=require(_0xc884('0x0'));var util=require(_0xc884('0x1'));var logger=require(_0xc884('0x2'))(_0xc884('0x3'));var moment=require('moment');var BPromise=require(_0xc884('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc884('0x5'));var rimraf=require(_0xc884('0x6'));var config=require(_0xc884('0x7'));var attributes=require(_0xc884('0x8'));module['exports']=function(_0x1546ac,_0x425639){return _0x1546ac[_0xc884('0x9')](_0xc884('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33d85b,_0x5f38d1,_0x3c1aa6){if(_0x33d85b['changed'](_0xc884('0xb'))){_0x33d85b['closedAt']=moment()[_0xc884('0xc')](_0xc884('0xd'));}_0x3c1aa6(null,_0x33d85b);}},'charset':_0xc884('0xe'),'collate':_0xc884('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index f41feb9..c35bfa4 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 _0x8c25=['ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','then','AddTagsToChatInteraction','addTags','ids','omit','AddTags','lodash','util','randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','request\x20sent','debug'];(function(_0x4aec3f,_0x2de89f){var _0x4f10cc=function(_0x325664){while(--_0x325664){_0x4aec3f['push'](_0x4aec3f['shift']());}};_0x4f10cc(++_0x2de89f);}(_0x8c25,0x1c2));var _0x58c2=function(_0x164517,_0x1ea624){_0x164517=_0x164517-0x0;var _0x2d819b=_0x8c25[_0x164517];return _0x2d819b;};'use strict';var _=require(_0x58c2('0x0'));var util=require(_0x58c2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x58c2('0x2'));var fs=require('fs');var Redis=require(_0x58c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x58c2('0x4'));var jayson=require(_0x58c2('0x5'));var client=jayson[_0x58c2('0x6')][_0x58c2('0x7')]({'port':0x232a});config[_0x58c2('0x8')]=_[_0x58c2('0x9')](config[_0x58c2('0x8')],{'host':_0x58c2('0xa'),'port':0x18eb});var socket=require(_0x58c2('0xb'))(new Redis(config[_0x58c2('0x8')]));require(_0x58c2('0xc'))[_0x58c2('0xd')](socket);function respondWithRpcPromise(_0x5371ec,_0x31b026,_0x276fce){return new BPromise(function(_0x467588,_0x302c71){return client[_0x58c2('0xe')](_0x5371ec,_0x276fce)['then'](function(_0x280f7e){logger[_0x58c2('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x31b026,_0x58c2('0x10'));logger[_0x58c2('0x11')](_0x58c2('0x12'),_0x31b026,_0x58c2('0x10'),JSON[_0x58c2('0x13')](_0x280f7e));if(_0x280f7e[_0x58c2('0x14')]){if(_0x280f7e[_0x58c2('0x14')]['code']===0x1f4){logger[_0x58c2('0x14')](_0x58c2('0x15'),_0x31b026,_0x280f7e[_0x58c2('0x14')][_0x58c2('0x16')]);return _0x302c71(_0x280f7e[_0x58c2('0x14')][_0x58c2('0x16')]);}logger[_0x58c2('0x14')](_0x58c2('0x15'),_0x31b026,_0x280f7e['error']['message']);return _0x467588(_0x280f7e[_0x58c2('0x14')][_0x58c2('0x16')]);}else{logger[_0x58c2('0xf')](_0x58c2('0x15'),_0x31b026,_0x58c2('0x10'));_0x467588(_0x280f7e[_0x58c2('0x17')]['message']);}})[_0x58c2('0x18')](function(_0x48bb3d){logger['error'](_0x58c2('0x15'),_0x31b026,_0x48bb3d);_0x302c71(_0x48bb3d);});});}exports[_0x58c2('0x19')]=function(_0x747b95){var _0x362617=this;return new Promise(function(_0x5ce527,_0x4c99bd){return db[_0x58c2('0x1a')][_0x58c2('0x1b')](_0x747b95[_0x58c2('0x1c')],{'raw':_0x747b95[_0x58c2('0x1d')]?_0x747b95['options'][_0x58c2('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x747b95[_0x58c2('0x1d')]?_0x747b95[_0x58c2('0x1d')][_0x58c2('0x1f')]||null:null,'attributes':_0x747b95[_0x58c2('0x1d')]?_0x747b95[_0x58c2('0x1d')]['attributes']||null:null,'limit':_0x747b95[_0x58c2('0x1d')]?_0x747b95[_0x58c2('0x1d')][_0x58c2('0x20')]||null:null})[_0x58c2('0x21')](function(_0x3bcc8b){logger[_0x58c2('0xf')](_0x58c2('0x19'),_0x747b95);logger[_0x58c2('0x11')](_0x58c2('0x19'),_0x747b95,JSON[_0x58c2('0x13')](_0x3bcc8b));_0x5ce527(_0x3bcc8b);})['catch'](function(_0x16a16f){logger[_0x58c2('0x14')]('UpdateChatInteraction',_0x16a16f['message'],_0x747b95);_0x4c99bd(_0x362617['error'](0x1f4,_0x16a16f[_0x58c2('0x16')]));});});};exports[_0x58c2('0x22')]=function(_0x91165b){return new Promise(function(_0x3740f6,_0x20a83b){return db['ChatInteraction']['find']({'where':_0x91165b[_0x58c2('0x1d')]?_0x91165b[_0x58c2('0x1d')][_0x58c2('0x1f')]||null:null})[_0x58c2('0x21')](function(_0x46d890){if(_0x46d890){return _0x46d890[_0x58c2('0x23')](_0x91165b[_0x58c2('0x1c')][_0x58c2('0x24')],_[_0x58c2('0x25')](_0x91165b['body'],[_0x58c2('0x24'),'id'])||{});}})['spread'](function(_0x4be8df){logger[_0x58c2('0xf')](_0x58c2('0x26'),_0x91165b);logger[_0x58c2('0x11')]('AddTags',_0x91165b,JSON['stringify'](_0x4be8df));_0x3740f6(_0x4be8df);})['catch'](function(_0x19e2e0){logger[_0x58c2('0x14')]('AddTags',_0x19e2e0[_0x58c2('0x16')],_0x91165b);_0x20a83b(_this[_0x58c2('0x14')](0x1f4,_0x19e2e0[_0x58c2('0x16')]));});});}; \ No newline at end of file +var _0xaca9=['ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','find','addTags','body','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x7cc0c8,_0x391976){var _0x1d1c7b=function(_0x1055d0){while(--_0x1055d0){_0x7cc0c8['push'](_0x7cc0c8['shift']());}};_0x1d1c7b(++_0x391976);}(_0xaca9,0xf7));var _0x9aca=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xaca9[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9aca('0x0'));var BPromise=require(_0x9aca('0x1'));var rs=require(_0x9aca('0x2'));var fs=require('fs');var Redis=require(_0x9aca('0x3'));var db=require(_0x9aca('0x4'))['db'];var utils=require(_0x9aca('0x5'));var logger=require(_0x9aca('0x6'))(_0x9aca('0x7'));var config=require(_0x9aca('0x8'));var jayson=require(_0x9aca('0x9'));var client=jayson[_0x9aca('0xa')]['http']({'port':0x232a});config[_0x9aca('0xb')]=_[_0x9aca('0xc')](config[_0x9aca('0xb')],{'host':_0x9aca('0xd'),'port':0x18eb});var socket=require(_0x9aca('0xe'))(new Redis(config[_0x9aca('0xb')]));require(_0x9aca('0xf'))[_0x9aca('0x10')](socket);function respondWithRpcPromise(_0x15ed6e,_0x1d58e7,_0x5cdac1){return new BPromise(function(_0x137666,_0x3c6dd6){return client[_0x9aca('0x11')](_0x15ed6e,_0x5cdac1)[_0x9aca('0x12')](function(_0x1047a9){logger[_0x9aca('0x13')](_0x9aca('0x14'),_0x1d58e7,_0x9aca('0x15'));logger[_0x9aca('0x16')](_0x9aca('0x17'),_0x1d58e7,_0x9aca('0x15'),JSON[_0x9aca('0x18')](_0x1047a9));if(_0x1047a9[_0x9aca('0x19')]){if(_0x1047a9[_0x9aca('0x19')][_0x9aca('0x1a')]===0x1f4){logger['error'](_0x9aca('0x14'),_0x1d58e7,_0x1047a9[_0x9aca('0x19')][_0x9aca('0x1b')]);return _0x3c6dd6(_0x1047a9[_0x9aca('0x19')][_0x9aca('0x1b')]);}logger[_0x9aca('0x19')](_0x9aca('0x14'),_0x1d58e7,_0x1047a9[_0x9aca('0x19')][_0x9aca('0x1b')]);return _0x137666(_0x1047a9[_0x9aca('0x19')][_0x9aca('0x1b')]);}else{logger[_0x9aca('0x13')](_0x9aca('0x14'),_0x1d58e7,_0x9aca('0x15'));_0x137666(_0x1047a9[_0x9aca('0x1c')]['message']);}})[_0x9aca('0x1d')](function(_0x5613a2){logger[_0x9aca('0x19')](_0x9aca('0x14'),_0x1d58e7,_0x5613a2);_0x3c6dd6(_0x5613a2);});});}exports[_0x9aca('0x1e')]=function(_0x10b834){var _0x22e353=this;return new Promise(function(_0x3f3c31,_0x38e8b4){return db[_0x9aca('0x1f')][_0x9aca('0x20')](_0x10b834['body'],{'raw':_0x10b834[_0x9aca('0x21')]?_0x10b834['options'][_0x9aca('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10b834[_0x9aca('0x21')]?_0x10b834[_0x9aca('0x21')][_0x9aca('0x23')]||null:null,'attributes':_0x10b834[_0x9aca('0x21')]?_0x10b834['options'][_0x9aca('0x24')]||null:null,'limit':_0x10b834['options']?_0x10b834[_0x9aca('0x21')][_0x9aca('0x25')]||null:null})[_0x9aca('0x12')](function(_0x2b19c7){logger['info'](_0x9aca('0x1e'),_0x10b834);logger[_0x9aca('0x16')](_0x9aca('0x1e'),_0x10b834,JSON['stringify'](_0x2b19c7));_0x3f3c31(_0x2b19c7);})[_0x9aca('0x1d')](function(_0x386b02){logger['error'](_0x9aca('0x1e'),_0x386b02['message'],_0x10b834);_0x38e8b4(_0x22e353['error'](0x1f4,_0x386b02[_0x9aca('0x1b')]));});});};exports['AddTagsToChatInteraction']=function(_0x38f2d6){return new Promise(function(_0x887e4,_0x9cbaca){return db['ChatInteraction'][_0x9aca('0x26')]({'where':_0x38f2d6[_0x9aca('0x21')]?_0x38f2d6['options'][_0x9aca('0x23')]||null:null})['then'](function(_0x5789f5){if(_0x5789f5){return _0x5789f5[_0x9aca('0x27')](_0x38f2d6[_0x9aca('0x28')][_0x9aca('0x29')],_[_0x9aca('0x2a')](_0x38f2d6[_0x9aca('0x28')],[_0x9aca('0x29'),'id'])||{});}})[_0x9aca('0x2b')](function(_0x3bc75c){logger['info'](_0x9aca('0x2c'),_0x38f2d6);logger[_0x9aca('0x16')](_0x9aca('0x2c'),_0x38f2d6,JSON[_0x9aca('0x18')](_0x3bc75c));_0x887e4(_0x3bc75c);})[_0x9aca('0x1d')](function(_0x171c15){logger['error']('AddTags',_0x171c15[_0x9aca('0x1b')],_0x38f2d6);_0x9cbaca(_this[_0x9aca('0x19')](0x1f4,_0x171c15[_0x9aca('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index cf6d933..50ad10c 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 _0x2791=['remove','update','emit','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x31d91a,_0x53be16){var _0x25f005=function(_0x3ae39a){while(--_0x3ae39a){_0x31d91a['push'](_0x31d91a['shift']());}};_0x25f005(++_0x53be16);}(_0x2791,0x66));var _0x1279=function(_0x2776ee,_0x1d75cb){_0x2776ee=_0x2776ee-0x0;var _0x3db8b6=_0x2791[_0x2776ee];return _0x3db8b6;};'use strict';var ChatInteractionEvents=require(_0x1279('0x0'));var events=[_0x1279('0x1'),_0x1279('0x2'),_0x1279('0x3')];function createListener(_0x2b9c2e,_0x4c6936){return function(_0x1da5e2){_0x4c6936[_0x1279('0x4')](_0x2b9c2e,_0x1da5e2);};}function removeListener(_0x1736f2,_0x343c70){return function(){ChatInteractionEvents['removeListener'](_0x1736f2,_0x343c70);};}exports[_0x1279('0x5')]=function(_0x5bf3fc){for(var _0x30f1e9=0x0,_0x3f26b2=events[_0x1279('0x6')];_0x30f1e9<_0x3f26b2;_0x30f1e9++){var _0x56cfd0=events[_0x30f1e9];var _0x374df3=createListener(_0x1279('0x7')+_0x56cfd0,_0x5bf3fc);ChatInteractionEvents['on'](_0x56cfd0,_0x374df3);}}; \ No newline at end of file +var _0xc755=['./chatInteraction.events','remove','emit','register','chatInteraction:'];(function(_0x3360da,_0x1dd6ff){var _0x5258e6=function(_0x5ad1ba){while(--_0x5ad1ba){_0x3360da['push'](_0x3360da['shift']());}};_0x5258e6(++_0x1dd6ff);}(_0xc755,0x140));var _0x5c75=function(_0x47868c,_0x23432e){_0x47868c=_0x47868c-0x0;var _0x4b31a5=_0xc755[_0x47868c];return _0x4b31a5;};'use strict';var ChatInteractionEvents=require(_0x5c75('0x0'));var events=['save',_0x5c75('0x1'),'update'];function createListener(_0x55f734,_0x114f47){return function(_0x307767){_0x114f47[_0x5c75('0x2')](_0x55f734,_0x307767);};}function removeListener(_0x1410d1,_0x359049){return function(){ChatInteractionEvents['removeListener'](_0x1410d1,_0x359049);};}exports[_0x5c75('0x3')]=function(_0x561863){for(var _0x3670a9=0x0,_0x2f2373=events['length'];_0x3670a9<_0x2f2373;_0x3670a9++){var _0xa71ebf=events[_0x3670a9];var _0x2f3292=createListener(_0x5c75('0x4')+_0xa71ebf,_0x561863);ChatInteractionEvents['on'](_0xa71ebf,_0x2f3292);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index ea50418..2417b65 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 _0x362d=['/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','delete','chatinteraction:destroy','destroy','removeTags','exports','path','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x362d,0x78));var _0xd362=function(_0x1cfbb8,_0x57974f){_0x1cfbb8=_0x1cfbb8-0x0;var _0x3f2423=_0x362d[_0x1cfbb8];return _0x3f2423;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd362('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd362('0x1'));var auth=require(_0xd362('0x2'));var interaction=require(_0xd362('0x3'));var config=require('../../config/environment');var controller=require(_0xd362('0x4'));router['get']('/',auth[_0xd362('0x5')](),controller[_0xd362('0x6')]);router[_0xd362('0x7')]('/describe',auth[_0xd362('0x5')](),controller[_0xd362('0x8')]);router[_0xd362('0x7')](_0xd362('0x9'),auth[_0xd362('0xa')](),controller[_0xd362('0xb')]);router['get'](_0xd362('0xc'),auth[_0xd362('0xa')](),controller[_0xd362('0xd')]);router[_0xd362('0x7')]('/:id/messages',auth[_0xd362('0x5')](),controller[_0xd362('0xe')]);router['get'](_0xd362('0xf'),auth[_0xd362('0xa')](),controller[_0xd362('0x10')]);router[_0xd362('0x7')]('/:id/download',auth[_0xd362('0x5')](),controller[_0xd362('0x11')]);router[_0xd362('0x12')]('/',auth['isAuthenticated'](),controller[_0xd362('0x13')]);router[_0xd362('0x12')](_0xd362('0x14'),auth['isAuthenticated'](),controller[_0xd362('0x15')]);var upload=multer({'storage':multer[_0xd362('0x16')]({'destination':function(_0x2967f7,_0x14a3ce,_0x5ecd38){_0x5ecd38(null,path[_0xd362('0x17')](config[_0xd362('0x18')],_0xd362('0x19')));},'filename':function(_0x5d8cbd,_0x431118,_0xfbab5a){_0xfbab5a(null,util[_0xd362('0x1a')](_0xd362('0x1b'),Date[_0xd362('0x1c')](),_0x431118['originalname'][_0xd362('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd362('0x12')](_0xd362('0x1e'),upload[_0xd362('0x1f')](_0xd362('0x20')),controller['attachmentUpload']);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xd362('0x21')]);router[_0xd362('0x12')](_0xd362('0x22'),auth['isAuthenticated'](),interaction[_0xd362('0x23')](_0xd362('0x24'),_0xd362('0x25')),controller[_0xd362('0x26')]);router[_0xd362('0x27')](_0xd362('0x9'),auth[_0xd362('0x5')](),interaction[_0xd362('0x23')](_0xd362('0x24'),_0xd362('0x28')),controller[_0xd362('0x29')]);router[_0xd362('0x27')](_0xd362('0x2a'),controller[_0xd362('0x2b')]);router['put']('/:id/abandon',auth[_0xd362('0xa')](),controller[_0xd362('0x2c')]);router['put']('/:id/close',controller['close']);router[_0xd362('0x2d')](_0xd362('0x9'),auth[_0xd362('0x5')](),interaction[_0xd362('0x23')](_0xd362('0x24'),_0xd362('0x2e')),controller[_0xd362('0x2f')]);router[_0xd362('0x2d')](_0xd362('0x22'),auth['isAuthenticated'](),controller[_0xd362('0x30')]);module[_0xd362('0x31')]=router; \ No newline at end of file +var _0x7cfc=['getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','originalname','replace','single','file','addMessage','/:id/tags','chat','chatinteraction:addtags','put','chatinteraction:update','update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages'];(function(_0x559d2f,_0x3a4d68){var _0x24046e=function(_0x3f650f){while(--_0x3f650f){_0x559d2f['push'](_0x559d2f['shift']());}};_0x24046e(++_0x3a4d68);}(_0x7cfc,0x1bf));var _0xc7cf=function(_0x4c5c5d,_0x583464){_0x4c5c5d=_0x4c5c5d-0x0;var _0x2079f1=_0x7cfc[_0x4c5c5d];return _0x2079f1;};'use strict';var multer=require(_0xc7cf('0x0'));var util=require(_0xc7cf('0x1'));var path=require(_0xc7cf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc7cf('0x3')]();var fs_extra=require(_0xc7cf('0x4'));var auth=require(_0xc7cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc7cf('0x6'));var controller=require(_0xc7cf('0x7'));router[_0xc7cf('0x8')]('/',auth[_0xc7cf('0x9')](),controller[_0xc7cf('0xa')]);router['get'](_0xc7cf('0xb'),auth[_0xc7cf('0x9')](),controller[_0xc7cf('0xc')]);router[_0xc7cf('0x8')](_0xc7cf('0xd'),auth[_0xc7cf('0xe')](),controller[_0xc7cf('0xf')]);router['get'](_0xc7cf('0x10'),auth[_0xc7cf('0xe')](),controller[_0xc7cf('0x11')]);router[_0xc7cf('0x8')](_0xc7cf('0x12'),auth[_0xc7cf('0x9')](),controller[_0xc7cf('0x13')]);router[_0xc7cf('0x8')](_0xc7cf('0x14'),auth[_0xc7cf('0xe')](),controller[_0xc7cf('0x15')]);router['get'](_0xc7cf('0x16'),auth[_0xc7cf('0x9')](),controller[_0xc7cf('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc7cf('0x18')]);router[_0xc7cf('0x19')](_0xc7cf('0x1a'),auth[_0xc7cf('0x9')](),controller[_0xc7cf('0x1b')]);var upload=multer({'storage':multer[_0xc7cf('0x1c')]({'destination':function(_0x33f15e,_0x3a2db5,_0xe76d14){_0xe76d14(null,path['join'](config[_0xc7cf('0x1d')],_0xc7cf('0x1e')));},'filename':function(_0x1c9e8e,_0x5c0684,_0xc0b7b5){_0xc0b7b5(null,util[_0xc7cf('0x1f')](_0xc7cf('0x20'),Date['now'](),_0x5c0684[_0xc7cf('0x21')][_0xc7cf('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc7cf('0x19')]('/:id/attachment_upload',upload[_0xc7cf('0x23')](_0xc7cf('0x24')),controller['attachmentUpload']);router['post'](_0xc7cf('0x12'),auth[_0xc7cf('0xe')](),controller[_0xc7cf('0x25')]);router[_0xc7cf('0x19')](_0xc7cf('0x26'),auth[_0xc7cf('0x9')](),interaction['tracked'](_0xc7cf('0x27'),_0xc7cf('0x28')),controller['addTags']);router[_0xc7cf('0x29')]('/:id',auth[_0xc7cf('0x9')](),interaction['tracked'](_0xc7cf('0x27'),_0xc7cf('0x2a')),controller[_0xc7cf('0x2b')]);router['put']('/:id/custom_update',controller[_0xc7cf('0x2c')]);router[_0xc7cf('0x29')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xc7cf('0x2d')]);router[_0xc7cf('0x29')](_0xc7cf('0x2e'),controller[_0xc7cf('0x2f')]);router[_0xc7cf('0x30')](_0xc7cf('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0xc7cf('0x27'),_0xc7cf('0x31')),controller[_0xc7cf('0x32')]);router[_0xc7cf('0x30')]('/:id/tags',auth[_0xc7cf('0x9')](),controller[_0xc7cf('0x33')]);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 255d0a5..4feecc9 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 _0x0987=['exports','medium','BOOLEAN','INTEGER'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x0987,0x130));var _0x7098=function(_0x1a65a0,_0x4307e2){_0x1a65a0=_0x1a65a0-0x0;var _0x50c536=_0x0987[_0x1a65a0];return _0x50c536;};'use strict';var Sequelize=require('sequelize');module[_0x7098('0x0')]={'body':{'type':Sequelize['TEXT'](_0x7098('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7098('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7098('0x3')]}}; \ No newline at end of file +var _0x37b7=['exports','TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x437545,_0x4ab48b){var _0x408060=function(_0x564586){while(--_0x564586){_0x437545['push'](_0x437545['shift']());}};_0x408060(++_0x4ab48b);}(_0x37b7,0x6b));var _0x737b=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x37b7[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0x737b('0x0'));module[_0x737b('0x1')]={'body':{'type':Sequelize[_0x737b('0x2')](_0x737b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x737b('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x737b('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index be47d64..5438b28 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 _0x4ff8=['eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','status','json','limit','count','offset','set','Content-Range','apply','update','destroy','end','sendStatus','error','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','then','catch','show','rawAttributes','keys','length','includeAll','options','find','create','body','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','FromId','all'];(function(_0x59f78a,_0x47f190){var _0x424cc3=function(_0xc5b614){while(--_0xc5b614){_0x59f78a['push'](_0x59f78a['shift']());}};_0x424cc3(++_0x47f190);}(_0x4ff8,0x156));var _0x84ff=function(_0x54d094,_0x2b7cec){_0x54d094=_0x54d094-0x0;var _0x590511=_0x4ff8[_0x54d094];return _0x590511;};'use strict';var emlformat=require(_0x84ff('0x0'));var rimraf=require(_0x84ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x84ff('0x2'));var rp=require(_0x84ff('0x3'));var moment=require(_0x84ff('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x84ff('0x5'));var path=require(_0x84ff('0x6'));var sox=require(_0x84ff('0x7'));var csv=require(_0x84ff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x84ff('0x9'));var _=require(_0x84ff('0xa'));var squel=require(_0x84ff('0xb'));var crypto=require(_0x84ff('0xc'));var jsforce=require(_0x84ff('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x84ff('0x8'));var querystring=require(_0x84ff('0xe'));var Papa=require(_0x84ff('0xf'));var Redis=require(_0x84ff('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x84ff('0x11'));var as=require(_0x84ff('0x12'));var hardwareService=require(_0x84ff('0x13'));var logger=require(_0x84ff('0x14'))(_0x84ff('0x15'));var utils=require(_0x84ff('0x16'));var config=require(_0x84ff('0x17'));var licenseUtil=require(_0x84ff('0x18'));var db=require(_0x84ff('0x19'))['db'];config[_0x84ff('0x1a')]=_[_0x84ff('0x1b')](config[_0x84ff('0x1a')],{'host':_0x84ff('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84ff('0x1a')]));require(_0x84ff('0x1d'))[_0x84ff('0x1e')](socket);function respondWithStatusCode(_0x466bf2,_0x1b461b){_0x1b461b=_0x1b461b||0xcc;return function(_0x5d1b1b){if(_0x5d1b1b){return _0x466bf2['sendStatus'](_0x1b461b);}return _0x466bf2[_0x84ff('0x1f')](_0x1b461b)['end']();};}function respondWithResult(_0x4eadf6,_0x489c16){_0x489c16=_0x489c16||0xc8;return function(_0x2860b7){if(_0x2860b7){return _0x4eadf6[_0x84ff('0x1f')](_0x489c16)[_0x84ff('0x20')](_0x2860b7);}};}function respondWithFilteredResult(_0x2850ec,_0x1f00d9){return function(_0x358d0b){if(_0x358d0b){var _0x56a893=typeof _0x1f00d9['offset']==='undefined'&&typeof _0x1f00d9[_0x84ff('0x21')]==='undefined';var _0xf260b2=_0x358d0b[_0x84ff('0x22')];var _0x23f740=_0x56a893?0x0:_0x1f00d9['offset'];var _0x7bb54f=_0x56a893?_0x358d0b[_0x84ff('0x22')]:_0x1f00d9[_0x84ff('0x23')]+_0x1f00d9[_0x84ff('0x21')];var _0x275e80;if(_0x7bb54f>=_0xf260b2){_0x7bb54f=_0xf260b2;_0x275e80=0xc8;}else{_0x275e80=0xce;}_0x2850ec[_0x84ff('0x1f')](_0x275e80);return _0x2850ec[_0x84ff('0x24')](_0x84ff('0x25'),_0x23f740+'-'+_0x7bb54f+'/'+_0xf260b2)[_0x84ff('0x20')](_0x358d0b);}return null;};}function patchUpdates(_0x44df4a){return function(_0x562736){try{jsonpatch[_0x84ff('0x26')](_0x562736,_0x44df4a,!![]);}catch(_0x25bc1c){return BPromise['reject'](_0x25bc1c);}return _0x562736['save']();};}function saveUpdates(_0x4b9dcf,_0x46f92c){return function(_0x1218a3){if(_0x1218a3){return _0x1218a3[_0x84ff('0x27')](_0x4b9dcf)['then'](function(_0x447a10){return _0x447a10;});}return null;};}function removeEntity(_0x3809ce,_0xe60158){return function(_0x3a0cf7){if(_0x3a0cf7){return _0x3a0cf7[_0x84ff('0x28')]()['then'](function(){_0x3809ce['status'](0xcc)[_0x84ff('0x29')]();});}};}function handleEntityNotFound(_0x5e3e39,_0x2da489){return function(_0x1b6e71){if(!_0x1b6e71){_0x5e3e39[_0x84ff('0x2a')](0x194);}return _0x1b6e71;};}function handleError(_0x3ae95d,_0x29d6ec){_0x29d6ec=_0x29d6ec||0x1f4;return function(_0x3f0e63){logger[_0x84ff('0x2b')](_0x3f0e63['stack']);if(_0x3f0e63[_0x84ff('0x2c')]){delete _0x3f0e63[_0x84ff('0x2c')];}_0x3ae95d['status'](_0x29d6ec)[_0x84ff('0x2d')](_0x3f0e63);};}exports[_0x84ff('0x2e')]=function(_0x362626,_0xebf1f6){var _0x2d1ead={},_0x29200a={},_0x1b0714={'count':0x0,'rows':[]};var _0x29ff56=_[_0x84ff('0x2f')](db[_0x84ff('0x30')]['rawAttributes'],function(_0x210aae){return{'name':_0x210aae[_0x84ff('0x31')],'type':_0x210aae[_0x84ff('0x32')][_0x84ff('0x33')]};});_0x29200a[_0x84ff('0x34')]=_[_0x84ff('0x2f')](_0x29ff56,_0x84ff('0x2c'));_0x29200a[_0x84ff('0x35')]=_['keys'](_0x362626[_0x84ff('0x35')]);_0x29200a['filters']=_['intersection'](_0x29200a[_0x84ff('0x34')],_0x29200a[_0x84ff('0x35')]);_0x2d1ead[_0x84ff('0x36')]=_[_0x84ff('0x37')](_0x29200a['model'],qs[_0x84ff('0x38')](_0x362626['query'][_0x84ff('0x38')]));_0x2d1ead['attributes']=_0x2d1ead[_0x84ff('0x36')]['length']?_0x2d1ead[_0x84ff('0x36')]:_0x29200a['model'];if(!_0x362626[_0x84ff('0x35')][_0x84ff('0x39')](_0x84ff('0x3a'))){_0x2d1ead[_0x84ff('0x21')]=qs['limit'](_0x362626['query'][_0x84ff('0x21')]);_0x2d1ead[_0x84ff('0x23')]=qs['offset'](_0x362626[_0x84ff('0x35')][_0x84ff('0x23')]);}_0x2d1ead[_0x84ff('0x3b')]=qs['sort'](_0x362626[_0x84ff('0x35')][_0x84ff('0x3c')]);_0x2d1ead[_0x84ff('0x3d')]=qs[_0x84ff('0x3e')](_[_0x84ff('0x3f')](_0x362626['query'],_0x29200a[_0x84ff('0x3e')]),_0x29ff56);if(_0x362626[_0x84ff('0x35')][_0x84ff('0x40')]){_0x2d1ead[_0x84ff('0x3d')]=_[_0x84ff('0x41')](_0x2d1ead['where'],{'$or':_[_0x84ff('0x2f')](_0x29ff56,function(_0x540db0){if(_0x540db0[_0x84ff('0x32')]!==_0x84ff('0x42')){var _0x15ceb7={};_0x15ceb7[_0x540db0[_0x84ff('0x2c')]]={'$like':'%'+_0x362626[_0x84ff('0x35')][_0x84ff('0x40')]+'%'};return _0x15ceb7;}})});}_0x2d1ead=_[_0x84ff('0x41')]({},_0x2d1ead,_0x362626['options']);var _0x2d9831={'where':_0x2d1ead[_0x84ff('0x3d')]};return db['ChatInternalMessage']['count'](_0x2d9831)['then'](function(_0x50ce75){_0x1b0714[_0x84ff('0x22')]=_0x50ce75;if(_0x362626[_0x84ff('0x35')]['includeAll']){_0x2d1ead[_0x84ff('0x43')]=[{'all':!![]}];}return db[_0x84ff('0x30')][_0x84ff('0x44')](_0x2d1ead);})['then'](function(_0x468021){_0x1b0714[_0x84ff('0x45')]=_0x468021;return _0x1b0714;})[_0x84ff('0x46')](respondWithFilteredResult(_0xebf1f6,_0x2d1ead))[_0x84ff('0x47')](handleError(_0xebf1f6,null));};exports[_0x84ff('0x48')]=function(_0x427137,_0xcf740e){var _0x52548d={'raw':!![],'where':{'id':_0x427137['params']['id']}},_0x56ff56={};_0x56ff56[_0x84ff('0x34')]=_['keys'](db[_0x84ff('0x30')][_0x84ff('0x49')]);_0x56ff56[_0x84ff('0x35')]=_[_0x84ff('0x4a')](_0x427137[_0x84ff('0x35')]);_0x56ff56['filters']=_[_0x84ff('0x37')](_0x56ff56[_0x84ff('0x34')],_0x56ff56['query']);_0x52548d[_0x84ff('0x36')]=_[_0x84ff('0x37')](_0x56ff56[_0x84ff('0x34')],qs[_0x84ff('0x38')](_0x427137[_0x84ff('0x35')][_0x84ff('0x38')]));_0x52548d[_0x84ff('0x36')]=_0x52548d[_0x84ff('0x36')][_0x84ff('0x4b')]?_0x52548d[_0x84ff('0x36')]:_0x56ff56[_0x84ff('0x34')];if(_0x427137[_0x84ff('0x35')][_0x84ff('0x4c')]){_0x52548d[_0x84ff('0x43')]=[{'all':!![]}];}_0x52548d=_[_0x84ff('0x41')]({},_0x52548d,_0x427137[_0x84ff('0x4d')]);return db[_0x84ff('0x30')][_0x84ff('0x4e')](_0x52548d)[_0x84ff('0x46')](handleEntityNotFound(_0xcf740e,null))[_0x84ff('0x46')](respondWithResult(_0xcf740e,null))[_0x84ff('0x47')](handleError(_0xcf740e,null));};exports[_0x84ff('0x4f')]=function(_0x801f41,_0x5668a8){return db['ChatInternalMessage']['create'](_0x801f41[_0x84ff('0x50')],{})[_0x84ff('0x46')](respondWithResult(_0x5668a8,0xc9))[_0x84ff('0x47')](handleError(_0x5668a8,null));};exports[_0x84ff('0x27')]=function(_0x43cb94,_0x59fbe9){if(_0x43cb94[_0x84ff('0x50')]['id']){delete _0x43cb94['body']['id'];}return db[_0x84ff('0x30')][_0x84ff('0x4e')]({'where':{'id':_0x43cb94[_0x84ff('0x51')]['id']}})[_0x84ff('0x46')](handleEntityNotFound(_0x59fbe9,null))[_0x84ff('0x46')](saveUpdates(_0x43cb94[_0x84ff('0x50')],null))[_0x84ff('0x46')](respondWithResult(_0x59fbe9,null))[_0x84ff('0x47')](handleError(_0x59fbe9,null));};exports[_0x84ff('0x28')]=function(_0x3e5985,_0x25f745){return db[_0x84ff('0x30')][_0x84ff('0x4e')]({'where':{'id':_0x3e5985[_0x84ff('0x51')]['id']}})[_0x84ff('0x46')](handleEntityNotFound(_0x25f745,null))[_0x84ff('0x46')](removeEntity(_0x25f745,null))[_0x84ff('0x47')](handleError(_0x25f745,null));};exports[_0x84ff('0x52')]=function(_0x21dfbf,_0x3e7d85){return db[_0x84ff('0x30')][_0x84ff('0x52')]()['then'](respondWithResult(_0x3e7d85,null))[_0x84ff('0x47')](handleError(_0x3e7d85,null));};function wrapUser(_0x4579f2){return function(_0x14102c){var _0x288655=_0x4579f2[_0x84ff('0x53')]({'plain':!![]});_0x288655[_0x84ff('0x54')]=[];if(_0x14102c){_0x288655[_0x84ff('0x55')]=_0x14102c[_0x84ff('0x56')];_0x288655[_0x84ff('0x57')]=_0x14102c;}else{_0x288655[_0x84ff('0x55')]=moment(0x0)[_0x84ff('0x58')](_0x84ff('0x59'));_0x288655[_0x84ff('0x57')]={};}return _0x288655;};}exports[_0x84ff('0x5a')]=function(_0x2540eb,_0x3930bd,_0x513578){var _0x297ad3=[];return db[_0x84ff('0x5b')][_0x84ff('0x44')]({'where':{'role':[_0x84ff('0x5c'),_0x84ff('0x5d'),_0x84ff('0x5e')]},'attributes':['id','fullname','name',_0x84ff('0x5f'),_0x84ff('0x60'),_0x84ff('0x61'),_0x84ff('0x62'),_0x84ff('0x63'),_0x84ff('0x64'),_0x84ff('0x65')],'order':qs[_0x84ff('0x3c')]('-online'),'include':[{'model':db[_0x84ff('0x66')],'as':_0x84ff('0x67'),'attributes':['id',_0x84ff('0x2c'),_0x84ff('0x32')],'through':{'attributes':[]}}]})[_0x84ff('0x46')](function(_0x59de5f){if(_0x59de5f){var _0x2d37eb=_0x2540eb[_0x84ff('0x5e')][_0x84ff('0x53')]({'plain':!![]});if(!_0x2d37eb)throw new Error(_0x84ff('0x68'));if(_0x2d37eb[_0x84ff('0x5f')]==='user'){return db[_0x84ff('0x69')][_0x84ff('0x4e')]({'where':{'name':_0x84ff('0x6a'),'userProfileId':_0x2d37eb[_0x84ff('0x6b')]},'raw':!![]})[_0x84ff('0x46')](function(_0x35faf5){if(_0x35faf5){if(_0x35faf5[_0x84ff('0x6c')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x35faf5['id']},'raw':!![]})[_0x84ff('0x46')](function(_0x12de87){var _0x2b7737=[];if(_[_0x84ff('0x6d')](_0x12de87)){_0x2b7737=_[_0x84ff('0x40')](_0x59de5f,function(_0x387cd3){if(_0x387cd3[_0x84ff('0x5f')]!==_0x84ff('0x5c')){return _0x387cd3;}});return _0x2b7737;}else{for(var _0x41462f=0x0;_0x41462f<_0x59de5f[_0x84ff('0x4b')];_0x41462f++){var _0x592bae=_0x59de5f[_0x41462f];if(_0x592bae[_0x84ff('0x5f')]===_0x84ff('0x5c')){var _0x3cbb00=_[_0x84ff('0x4e')](_0x12de87,function(_0x407d45){return _0x407d45[_0x84ff('0x6e')]===_0x592bae['id'];});if(_0x3cbb00)_0x2b7737[_0x84ff('0x6f')](_0x592bae);}else{_0x2b7737[_0x84ff('0x6f')](_0x592bae);}}return _0x2b7737;}});}else{return _0x59de5f;}}else{var _0x52b409=_[_0x84ff('0x40')](_0x59de5f,function(_0x2c1541){if(_0x2c1541[_0x84ff('0x5f')]!==_0x84ff('0x5c')){return _0x2c1541;}});return _0x52b409;}});}else{return _0x59de5f;}}})['then'](function(_0x3ac100){var _0x1bf5fb=[];if(_0x3ac100){_0x297ad3=_0x3ac100;for(var _0x239972=0x0;_0x239972<_0x3ac100[_0x84ff('0x4b')];_0x239972+=0x1){_0x297ad3[_0x239972][_0x84ff('0x54')]=[];_0x1bf5fb[_0x84ff('0x6f')](db[_0x84ff('0x30')][_0x84ff('0x4e')]({'where':{'FromId':[_0x2540eb[_0x84ff('0x5e')]['id'],_0x3ac100[_0x239972]['id']],'ToId':[_0x2540eb['user']['id'],_0x3ac100[_0x239972]['id']],'ChatGroupId':null},'attributes':['id',_0x84ff('0x56'),_0x84ff('0x70'),'ToId','read','body'],'order':qs[_0x84ff('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x84ff('0x46')](wrapUser(_0x3ac100[_0x239972])));}return BPromise[_0x84ff('0x71')](_0x1bf5fb);}return[];})[_0x84ff('0x46')](function(_0xacfe66){return{'rows':_0xacfe66,'count':_0xacfe66[_0x84ff('0x4b')]};})[_0x84ff('0x46')](respondWithResult(_0x3930bd,null))[_0x84ff('0x47')](handleError(_0x3930bd,null));}; \ No newline at end of file +var _0x0be0=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','include','findAll','rows','catch','keys','options','find','create','body','params','describe','lastMessageAt','createdAt','lastMessage','format','User','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','messages','push','read','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','key','model','query','attributes','intersection'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x0be0,0x167));var _0x00be=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x0be0[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x00be('0x0'));var rp=require(_0x00be('0x1'));var moment=require(_0x00be('0x2'));var BPromise=require(_0x00be('0x3'));var Mustache=require(_0x00be('0x4'));var util=require(_0x00be('0x5'));var path=require(_0x00be('0x6'));var sox=require('sox');var csv=require(_0x00be('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x00be('0x8'));var _=require(_0x00be('0x9'));var squel=require(_0x00be('0xa'));var crypto=require('crypto');var jsforce=require(_0x00be('0xb'));var deskjs=require(_0x00be('0xc'));var toCsv=require(_0x00be('0x7'));var querystring=require(_0x00be('0xd'));var Papa=require(_0x00be('0xe'));var Redis=require('ioredis');var authService=require(_0x00be('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x00be('0x10'));var utils=require(_0x00be('0x11'));var config=require(_0x00be('0x12'));var licenseUtil=require(_0x00be('0x13'));var db=require('../../mysqldb')['db'];config[_0x00be('0x14')]=_[_0x00be('0x15')](config[_0x00be('0x14')],{'host':_0x00be('0x16'),'port':0x18eb});var socket=require(_0x00be('0x17'))(new Redis(config[_0x00be('0x14')]));require('./chatInternalMessage.socket')[_0x00be('0x18')](socket);function respondWithStatusCode(_0x2eb209,_0x3d6d3c){_0x3d6d3c=_0x3d6d3c||0xcc;return function(_0x3edd26){if(_0x3edd26){return _0x2eb209[_0x00be('0x19')](_0x3d6d3c);}return _0x2eb209['status'](_0x3d6d3c)['end']();};}function respondWithResult(_0x3bd11d,_0x226ae2){_0x226ae2=_0x226ae2||0xc8;return function(_0x375dda){if(_0x375dda){return _0x3bd11d[_0x00be('0x1a')](_0x226ae2)[_0x00be('0x1b')](_0x375dda);}};}function respondWithFilteredResult(_0x2ab175,_0x14006e){return function(_0x5b4864){if(_0x5b4864){var _0x8ed491=typeof _0x14006e[_0x00be('0x1c')]==='undefined'&&typeof _0x14006e[_0x00be('0x1d')]==='undefined';var _0x4c4939=_0x5b4864[_0x00be('0x1e')];var _0x2b77b0=_0x8ed491?0x0:_0x14006e[_0x00be('0x1c')];var _0x1ea3b9=_0x8ed491?_0x5b4864['count']:_0x14006e[_0x00be('0x1c')]+_0x14006e[_0x00be('0x1d')];var _0x34a280;if(_0x1ea3b9>=_0x4c4939){_0x1ea3b9=_0x4c4939;_0x34a280=0xc8;}else{_0x34a280=0xce;}_0x2ab175[_0x00be('0x1a')](_0x34a280);return _0x2ab175[_0x00be('0x1f')](_0x00be('0x20'),_0x2b77b0+'-'+_0x1ea3b9+'/'+_0x4c4939)['json'](_0x5b4864);}return null;};}function patchUpdates(_0xf04eb4){return function(_0x294c7a){try{jsonpatch[_0x00be('0x21')](_0x294c7a,_0xf04eb4,!![]);}catch(_0x4c8b40){return BPromise[_0x00be('0x22')](_0x4c8b40);}return _0x294c7a[_0x00be('0x23')]();};}function saveUpdates(_0x42f1c3,_0x5ae638){return function(_0x41a699){if(_0x41a699){return _0x41a699[_0x00be('0x24')](_0x42f1c3)[_0x00be('0x25')](function(_0x360a66){return _0x360a66;});}return null;};}function removeEntity(_0x2d5d2,_0x47a742){return function(_0x5ec6b9){if(_0x5ec6b9){return _0x5ec6b9[_0x00be('0x26')]()[_0x00be('0x25')](function(){_0x2d5d2[_0x00be('0x1a')](0xcc)[_0x00be('0x27')]();});}};}function handleEntityNotFound(_0x19df1e,_0x366026){return function(_0x52fc88){if(!_0x52fc88){_0x19df1e[_0x00be('0x19')](0x194);}return _0x52fc88;};}function handleError(_0x575fd7,_0x3763c2){_0x3763c2=_0x3763c2||0x1f4;return function(_0x374059){logger[_0x00be('0x28')](_0x374059[_0x00be('0x29')]);if(_0x374059[_0x00be('0x2a')]){delete _0x374059[_0x00be('0x2a')];}_0x575fd7[_0x00be('0x1a')](_0x3763c2)[_0x00be('0x2b')](_0x374059);};}exports['index']=function(_0x2aebec,_0xbaff6a){var _0x4c46b1={},_0x23e2d8={},_0x4ebde6={'count':0x0,'rows':[]};var _0x4b5d07=_[_0x00be('0x2c')](db[_0x00be('0x2d')][_0x00be('0x2e')],function(_0x329458){return{'name':_0x329458[_0x00be('0x2f')],'type':_0x329458['type'][_0x00be('0x30')]};});_0x23e2d8[_0x00be('0x31')]=_['map'](_0x4b5d07,_0x00be('0x2a'));_0x23e2d8[_0x00be('0x32')]=_['keys'](_0x2aebec[_0x00be('0x32')]);_0x23e2d8['filters']=_['intersection'](_0x23e2d8['model'],_0x23e2d8[_0x00be('0x32')]);_0x4c46b1[_0x00be('0x33')]=_[_0x00be('0x34')](_0x23e2d8[_0x00be('0x31')],qs['fields'](_0x2aebec[_0x00be('0x32')][_0x00be('0x35')]));_0x4c46b1[_0x00be('0x33')]=_0x4c46b1['attributes'][_0x00be('0x36')]?_0x4c46b1[_0x00be('0x33')]:_0x23e2d8[_0x00be('0x31')];if(!_0x2aebec['query'][_0x00be('0x37')](_0x00be('0x38'))){_0x4c46b1[_0x00be('0x1d')]=qs[_0x00be('0x1d')](_0x2aebec[_0x00be('0x32')][_0x00be('0x1d')]);_0x4c46b1[_0x00be('0x1c')]=qs[_0x00be('0x1c')](_0x2aebec[_0x00be('0x32')][_0x00be('0x1c')]);}_0x4c46b1[_0x00be('0x39')]=qs[_0x00be('0x3a')](_0x2aebec[_0x00be('0x32')][_0x00be('0x3a')]);_0x4c46b1[_0x00be('0x3b')]=qs['filters'](_['pick'](_0x2aebec[_0x00be('0x32')],_0x23e2d8[_0x00be('0x3c')]),_0x4b5d07);if(_0x2aebec[_0x00be('0x32')][_0x00be('0x3d')]){_0x4c46b1[_0x00be('0x3b')]=_[_0x00be('0x3e')](_0x4c46b1[_0x00be('0x3b')],{'$or':_[_0x00be('0x2c')](_0x4b5d07,function(_0x31980a){if(_0x31980a['type']!==_0x00be('0x3f')){var _0x2e1d4b={};_0x2e1d4b[_0x31980a[_0x00be('0x2a')]]={'$like':'%'+_0x2aebec[_0x00be('0x32')][_0x00be('0x3d')]+'%'};return _0x2e1d4b;}})});}_0x4c46b1=_[_0x00be('0x3e')]({},_0x4c46b1,_0x2aebec['options']);var _0x2e76a1={'where':_0x4c46b1['where']};return db[_0x00be('0x2d')][_0x00be('0x1e')](_0x2e76a1)[_0x00be('0x25')](function(_0x649845){_0x4ebde6[_0x00be('0x1e')]=_0x649845;if(_0x2aebec[_0x00be('0x32')]['includeAll']){_0x4c46b1[_0x00be('0x40')]=[{'all':!![]}];}return db[_0x00be('0x2d')][_0x00be('0x41')](_0x4c46b1);})[_0x00be('0x25')](function(_0x5c9308){_0x4ebde6[_0x00be('0x42')]=_0x5c9308;return _0x4ebde6;})[_0x00be('0x25')](respondWithFilteredResult(_0xbaff6a,_0x4c46b1))[_0x00be('0x43')](handleError(_0xbaff6a,null));};exports['show']=function(_0x212904,_0x1ea167){var _0x34b7e8={'raw':!![],'where':{'id':_0x212904['params']['id']}},_0x532dd6={};_0x532dd6[_0x00be('0x31')]=_[_0x00be('0x44')](db[_0x00be('0x2d')][_0x00be('0x2e')]);_0x532dd6[_0x00be('0x32')]=_[_0x00be('0x44')](_0x212904[_0x00be('0x32')]);_0x532dd6['filters']=_[_0x00be('0x34')](_0x532dd6[_0x00be('0x31')],_0x532dd6[_0x00be('0x32')]);_0x34b7e8[_0x00be('0x33')]=_[_0x00be('0x34')](_0x532dd6[_0x00be('0x31')],qs[_0x00be('0x35')](_0x212904[_0x00be('0x32')][_0x00be('0x35')]));_0x34b7e8['attributes']=_0x34b7e8[_0x00be('0x33')][_0x00be('0x36')]?_0x34b7e8[_0x00be('0x33')]:_0x532dd6[_0x00be('0x31')];if(_0x212904[_0x00be('0x32')]['includeAll']){_0x34b7e8['include']=[{'all':!![]}];}_0x34b7e8=_[_0x00be('0x3e')]({},_0x34b7e8,_0x212904[_0x00be('0x45')]);return db[_0x00be('0x2d')][_0x00be('0x46')](_0x34b7e8)[_0x00be('0x25')](handleEntityNotFound(_0x1ea167,null))[_0x00be('0x25')](respondWithResult(_0x1ea167,null))[_0x00be('0x43')](handleError(_0x1ea167,null));};exports[_0x00be('0x47')]=function(_0x2e5019,_0x4d63fb){return db[_0x00be('0x2d')][_0x00be('0x47')](_0x2e5019['body'],{})[_0x00be('0x25')](respondWithResult(_0x4d63fb,0xc9))['catch'](handleError(_0x4d63fb,null));};exports['update']=function(_0x392faf,_0x4318b9){if(_0x392faf[_0x00be('0x48')]['id']){delete _0x392faf[_0x00be('0x48')]['id'];}return db[_0x00be('0x2d')][_0x00be('0x46')]({'where':{'id':_0x392faf[_0x00be('0x49')]['id']}})['then'](handleEntityNotFound(_0x4318b9,null))[_0x00be('0x25')](saveUpdates(_0x392faf['body'],null))[_0x00be('0x25')](respondWithResult(_0x4318b9,null))[_0x00be('0x43')](handleError(_0x4318b9,null));};exports[_0x00be('0x26')]=function(_0x2a0091,_0x536c73){return db[_0x00be('0x2d')][_0x00be('0x46')]({'where':{'id':_0x2a0091['params']['id']}})[_0x00be('0x25')](handleEntityNotFound(_0x536c73,null))[_0x00be('0x25')](removeEntity(_0x536c73,null))[_0x00be('0x43')](handleError(_0x536c73,null));};exports[_0x00be('0x4a')]=function(_0x17618f,_0x1d82ca){return db[_0x00be('0x2d')]['describe']()[_0x00be('0x25')](respondWithResult(_0x1d82ca,null))[_0x00be('0x43')](handleError(_0x1d82ca,null));};function wrapUser(_0x4ca206){return function(_0x45d4cc){var _0x25b8e7=_0x4ca206['get']({'plain':!![]});_0x25b8e7['messages']=[];if(_0x45d4cc){_0x25b8e7[_0x00be('0x4b')]=_0x45d4cc[_0x00be('0x4c')];_0x25b8e7[_0x00be('0x4d')]=_0x45d4cc;}else{_0x25b8e7[_0x00be('0x4b')]=moment(0x0)[_0x00be('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x25b8e7[_0x00be('0x4d')]={};}return _0x25b8e7;};}exports['getUsers']=function(_0x2fd04e,_0x44cc8f,_0xdb32cb){var _0x2db161=[];return db[_0x00be('0x4f')][_0x00be('0x41')]({'where':{'role':['agent',_0x00be('0x50'),'user']},'attributes':['id',_0x00be('0x51'),_0x00be('0x2a'),_0x00be('0x52'),_0x00be('0x53'),_0x00be('0x54'),_0x00be('0x55'),_0x00be('0x56'),_0x00be('0x57'),'showWebBar'],'order':qs[_0x00be('0x3a')]('-online'),'include':[{'model':db[_0x00be('0x58')],'as':_0x00be('0x59'),'attributes':['id',_0x00be('0x2a'),'type'],'through':{'attributes':[]}}]})[_0x00be('0x25')](function(_0x502d90){if(_0x502d90){var _0x5bb4cb=_0x2fd04e[_0x00be('0x5a')]['get']({'plain':!![]});if(!_0x5bb4cb)throw new Error(_0x00be('0x5b'));if(_0x5bb4cb['role']===_0x00be('0x5a')){return db[_0x00be('0x5c')][_0x00be('0x46')]({'where':{'name':_0x00be('0x5d'),'userProfileId':_0x5bb4cb[_0x00be('0x5e')]},'raw':!![]})[_0x00be('0x25')](function(_0x251202){if(_0x251202){if(_0x251202[_0x00be('0x5f')]===0x0){return db[_0x00be('0x60')][_0x00be('0x41')]({'where':{'sectionId':_0x251202['id']},'raw':!![]})['then'](function(_0xab7b33){var _0x5b71f7=[];if(_[_0x00be('0x61')](_0xab7b33)){_0x5b71f7=_[_0x00be('0x3d')](_0x502d90,function(_0x3e4ff9){if(_0x3e4ff9[_0x00be('0x52')]!=='agent'){return _0x3e4ff9;}});return _0x5b71f7;}else{for(var _0x552182=0x0;_0x552182<_0x502d90['length'];_0x552182++){var _0x132693=_0x502d90[_0x552182];if(_0x132693[_0x00be('0x52')]===_0x00be('0x62')){var _0x300a13=_[_0x00be('0x46')](_0xab7b33,function(_0x1a4c82){return _0x1a4c82[_0x00be('0x63')]===_0x132693['id'];});if(_0x300a13)_0x5b71f7['push'](_0x132693);}else{_0x5b71f7['push'](_0x132693);}}return _0x5b71f7;}});}else{return _0x502d90;}}else{var _0x1110cf=_[_0x00be('0x3d')](_0x502d90,function(_0x245032){if(_0x245032[_0x00be('0x52')]!=='agent'){return _0x245032;}});return _0x1110cf;}});}else{return _0x502d90;}}})[_0x00be('0x25')](function(_0x5ac5e3){var _0x3801f2=[];if(_0x5ac5e3){_0x2db161=_0x5ac5e3;for(var _0x4ea785=0x0;_0x4ea785<_0x5ac5e3[_0x00be('0x36')];_0x4ea785+=0x1){_0x2db161[_0x4ea785][_0x00be('0x64')]=[];_0x3801f2[_0x00be('0x65')](db[_0x00be('0x2d')][_0x00be('0x46')]({'where':{'FromId':[_0x2fd04e[_0x00be('0x5a')]['id'],_0x5ac5e3[_0x4ea785]['id']],'ToId':[_0x2fd04e[_0x00be('0x5a')]['id'],_0x5ac5e3[_0x4ea785]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId','ToId',_0x00be('0x66'),'body'],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x00be('0x25')](wrapUser(_0x5ac5e3[_0x4ea785])));}return BPromise['all'](_0x3801f2);}return[];})[_0x00be('0x25')](function(_0x4b1147){return{'rows':_0x4b1147,'count':_0x4b1147[_0x00be('0x36')]};})[_0x00be('0x25')](respondWithResult(_0x44cc8f,null))[_0x00be('0x43')](handleError(_0x44cc8f,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 2d01e52..0895d8d 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 _0xa32d=['events','../../mysqldb','ChatInternalMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x4bcb35,_0x4af08e){var _0x5e1067=function(_0x4f422a){while(--_0x4f422a){_0x4bcb35['push'](_0x4bcb35['shift']());}};_0x5e1067(++_0x4af08e);}(_0xa32d,0xb8));var _0xda32=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0xa32d[_0xaa6a4];return _0xdc31a4;};'use strict';var EventEmitter=require(_0xda32('0x0'));var ChatInternalMessage=require(_0xda32('0x1'))['db'][_0xda32('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xda32('0x3'),'afterUpdate':_0xda32('0x4'),'afterDestroy':_0xda32('0x5')};function emitEvent(_0x2cd25f){return function(_0x512b53,_0x2c5fe8,_0x26652c){ChatInternalMessageEvents[_0xda32('0x6')](_0x2cd25f+':'+_0x512b53['id'],_0x512b53);ChatInternalMessageEvents[_0xda32('0x6')](_0x2cd25f,_0x512b53);_0x26652c(null);};}for(var e in events){if(events[_0xda32('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x93bd=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x479f57,_0x1d4166){var _0x37f3d0=function(_0x13c469){while(--_0x13c469){_0x479f57['push'](_0x479f57['shift']());}};_0x37f3d0(++_0x1d4166);}(_0x93bd,0x1ef));var _0xd93b=function(_0x1861d2,_0x217fde){_0x1861d2=_0x1861d2-0x0;var _0x4a3f68=_0x93bd[_0x1861d2];return _0x4a3f68;};'use strict';var EventEmitter=require(_0xd93b('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xd93b('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd93b('0x2')](0x0);var events={'afterCreate':_0xd93b('0x3'),'afterUpdate':_0xd93b('0x4'),'afterDestroy':_0xd93b('0x5')};function emitEvent(_0x13a3cc){return function(_0x5f5b6b,_0x4be378,_0x5cbcac){ChatInternalMessageEvents['emit'](_0x13a3cc+':'+_0x5f5b6b['id'],_0x5f5b6b);ChatInternalMessageEvents[_0xd93b('0x6')](_0x13a3cc,_0x5f5b6b);_0x5cbcac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xd93b('0x7')](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 1e0f3dc..eb42778 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 _0xbad6=['util','api','moment','path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x168fc7,_0x280087){var _0x253280=function(_0x32f5a3){while(--_0x32f5a3){_0x168fc7['push'](_0x168fc7['shift']());}};_0x253280(++_0x280087);}(_0xbad6,0xf6));var _0x6bad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbad6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6bad('0x0'));var util=require(_0x6bad('0x1'));var logger=require('../../config/logger')(_0x6bad('0x2'));var moment=require(_0x6bad('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6bad('0x4'));var rimraf=require(_0x6bad('0x5'));var config=require(_0x6bad('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0x6bad('0x7')]=function(_0x1fc601,_0x256a5e){return _0x1fc601[_0x6bad('0x8')](_0x6bad('0x9'),attributes,{'tableName':_0x6bad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6bad('0xb'),'collate':_0x6bad('0xc')});}; \ No newline at end of file +var _0xfc2a=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xfc2a,0x8b));var _0xafc2=function(_0x10a120,_0x53fea3){_0x10a120=_0x10a120-0x0;var _0x26afa6=_0xfc2a[_0x10a120];return _0x26afa6;};'use strict';var _=require('lodash');var util=require(_0xafc2('0x0'));var logger=require(_0xafc2('0x1'))(_0xafc2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xafc2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xafc2('0x4'));var config=require(_0xafc2('0x5'));var attributes=require(_0xafc2('0x6'));module[_0xafc2('0x7')]=function(_0x1be70a,_0x1bf712){return _0x1be70a[_0xafc2('0x8')](_0xafc2('0x9'),attributes,{'tableName':_0xafc2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xafc2('0xb'),'collate':_0xafc2('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 65ef036..94cb26d 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 _0x5a05=['then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','defaults','redis','socket.io-emitter'];(function(_0x27dfc8,_0x11c74a){var _0x12e7d1=function(_0x2e8320){while(--_0x2e8320){_0x27dfc8['push'](_0x27dfc8['shift']());}};_0x12e7d1(++_0x11c74a);}(_0x5a05,0x17b));var _0x55a0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5a05[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x55a0('0x0'));var moment=require(_0x55a0('0x1'));var BPromise=require(_0x55a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55a0('0x3'));var db=require(_0x55a0('0x4'))['db'];var utils=require(_0x55a0('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x55a0('0x6'));var client=jayson[_0x55a0('0x7')][_0x55a0('0x8')]({'port':0x232a});config['redis']=_[_0x55a0('0x9')](config[_0x55a0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x55a0('0xb'))(new Redis(config[_0x55a0('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3bddd6,_0x1ccda5,_0x5d05c0){return new BPromise(function(_0x14abd2,_0x441004){return client['request'](_0x3bddd6,_0x5d05c0)[_0x55a0('0xc')](function(_0xc429f5){logger[_0x55a0('0xd')](_0x55a0('0xe'),_0x1ccda5,_0x55a0('0xf'));logger[_0x55a0('0x10')](_0x55a0('0x11'),_0x1ccda5,_0x55a0('0xf'),JSON['stringify'](_0xc429f5));if(_0xc429f5[_0x55a0('0x12')]){if(_0xc429f5[_0x55a0('0x12')][_0x55a0('0x13')]===0x1f4){logger['error'](_0x55a0('0xe'),_0x1ccda5,_0xc429f5['error'][_0x55a0('0x14')]);return _0x441004(_0xc429f5[_0x55a0('0x12')]['message']);}logger[_0x55a0('0x12')](_0x55a0('0xe'),_0x1ccda5,_0xc429f5[_0x55a0('0x12')][_0x55a0('0x14')]);return _0x14abd2(_0xc429f5[_0x55a0('0x12')]['message']);}else{logger[_0x55a0('0xd')]('ChatInternalMessage,\x20%s,\x20%s',_0x1ccda5,_0x55a0('0xf'));_0x14abd2(_0xc429f5[_0x55a0('0x15')]['message']);}})[_0x55a0('0x16')](function(_0x49dae2){logger[_0x55a0('0x12')](_0x55a0('0xe'),_0x1ccda5,_0x49dae2);_0x441004(_0x49dae2);});});} \ No newline at end of file +var _0x9d92=['../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2eb3db,_0x4a32c0){var _0x358f33=function(_0x1d0588){while(--_0x1d0588){_0x2eb3db['push'](_0x2eb3db['shift']());}};_0x358f33(++_0x4a32c0);}(_0x9d92,0xdf));var _0x29d9=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0x9d92[_0x671369];return _0x33f2b4;};'use strict';var _=require(_0x29d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x29d9('0x1'));var rs=require(_0x29d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29d9('0x3'))['db'];var utils=require(_0x29d9('0x4'));var logger=require(_0x29d9('0x5'))(_0x29d9('0x6'));var config=require(_0x29d9('0x7'));var jayson=require(_0x29d9('0x8'));var client=jayson[_0x29d9('0x9')]['http']({'port':0x232a});config[_0x29d9('0xa')]=_[_0x29d9('0xb')](config[_0x29d9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x29d9('0xc'))(new Redis(config[_0x29d9('0xa')]));require(_0x29d9('0xd'))['register'](socket);function respondWithRpcPromise(_0x49399f,_0x4d997b,_0x4fc9a9){return new BPromise(function(_0x26123d,_0xfd7bac){return client[_0x29d9('0xe')](_0x49399f,_0x4fc9a9)['then'](function(_0x22a01c){logger[_0x29d9('0xf')](_0x29d9('0x10'),_0x4d997b,_0x29d9('0x11'));logger['debug'](_0x29d9('0x12'),_0x4d997b,'request\x20sent',JSON['stringify'](_0x22a01c));if(_0x22a01c['error']){if(_0x22a01c[_0x29d9('0x13')][_0x29d9('0x14')]===0x1f4){logger[_0x29d9('0x13')](_0x29d9('0x10'),_0x4d997b,_0x22a01c['error'][_0x29d9('0x15')]);return _0xfd7bac(_0x22a01c[_0x29d9('0x13')][_0x29d9('0x15')]);}logger[_0x29d9('0x13')](_0x29d9('0x10'),_0x4d997b,_0x22a01c[_0x29d9('0x13')][_0x29d9('0x15')]);return _0x26123d(_0x22a01c[_0x29d9('0x13')][_0x29d9('0x15')]);}else{logger[_0x29d9('0xf')](_0x29d9('0x10'),_0x4d997b,'request\x20sent');_0x26123d(_0x22a01c[_0x29d9('0x16')]['message']);}})['catch'](function(_0x3b07e6){logger[_0x29d9('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x4d997b,_0x3b07e6);_0xfd7bac(_0x3b07e6);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index ad7c472..ac642f1 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 _0xed01=['emit','removeListener','register','./chatInternalMessage.events','save','remove','update'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xed01,0xb2));var _0x1ed0=function(_0x2774a7,_0x370440){_0x2774a7=_0x2774a7-0x0;var _0x5aadbf=_0xed01[_0x2774a7];return _0x5aadbf;};'use strict';var ChatInternalMessageEvents=require(_0x1ed0('0x0'));var events=[_0x1ed0('0x1'),_0x1ed0('0x2'),_0x1ed0('0x3')];function createListener(_0x875a35,_0x9e0b89){return function(_0x5debbd){_0x9e0b89[_0x1ed0('0x4')](_0x875a35,_0x5debbd);};}function removeListener(_0x39bd65,_0x478cea){return function(){ChatInternalMessageEvents[_0x1ed0('0x5')](_0x39bd65,_0x478cea);};}exports[_0x1ed0('0x6')]=function(_0x5bbfd4){for(var _0x31ed7d=0x0,_0xa1e7cd=events['length'];_0x31ed7d<_0xa1e7cd;_0x31ed7d++){var _0x31c36e=events[_0x31ed7d];var _0x588713=createListener('chatInternalMessage:'+_0x31c36e,_0x5bbfd4);ChatInternalMessageEvents['on'](_0x31c36e,_0x588713);}}; \ No newline at end of file +var _0x697c=['chatInternalMessage:','./chatInternalMessage.events','save','emit','removeListener','register','length'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x697c,0xe8));var _0xc697=function(_0x30691f,_0x187471){_0x30691f=_0x30691f-0x0;var _0x243eb5=_0x697c[_0x30691f];return _0x243eb5;};'use strict';var ChatInternalMessageEvents=require(_0xc697('0x0'));var events=[_0xc697('0x1'),'remove','update'];function createListener(_0x39a589,_0x19cd65){return function(_0x1d909c){_0x19cd65[_0xc697('0x2')](_0x39a589,_0x1d909c);};}function removeListener(_0x4db754,_0x197c1b){return function(){ChatInternalMessageEvents[_0xc697('0x3')](_0x4db754,_0x197c1b);};}exports[_0xc697('0x4')]=function(_0x2bc76e){for(var _0x7eb9fc=0x0,_0x34a638=events[_0xc697('0x5')];_0x7eb9fc<_0x34a638;_0x7eb9fc++){var _0x262f86=events[_0x7eb9fc];var _0x583880=createListener(_0xc697('0x6')+_0x262f86,_0x2bc76e);ChatInternalMessageEvents['on'](_0x262f86,_0x583880);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 8333316..06023c9 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 _0x2992=['get','isAuthenticated','index','/describe','/users','getUsers','show','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x10fa59,_0x3b353f){var _0x42d552=function(_0x2c5210){while(--_0x2c5210){_0x10fa59['push'](_0x10fa59['shift']());}};_0x42d552(++_0x3b353f);}(_0x2992,0x139));var _0x2299=function(_0x497826,_0x164921){_0x497826=_0x497826-0x0;var _0x4b3ae6=_0x2992[_0x497826];return _0x4b3ae6;};'use strict';var multer=require('multer');var util=require(_0x2299('0x0'));var path=require(_0x2299('0x1'));var timeout=require(_0x2299('0x2'));var express=require(_0x2299('0x3'));var router=express[_0x2299('0x4')]();var fs_extra=require(_0x2299('0x5'));var auth=require(_0x2299('0x6'));var interaction=require(_0x2299('0x7'));var config=require(_0x2299('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x2299('0x9')]('/',auth[_0x2299('0xa')](),controller[_0x2299('0xb')]);router['get'](_0x2299('0xc'),auth[_0x2299('0xa')](),controller['describe']);router[_0x2299('0x9')](_0x2299('0xd'),auth[_0x2299('0xa')](),controller[_0x2299('0xe')]);router['get']('/:id',auth[_0x2299('0xa')](),controller[_0x2299('0xf')]);router[_0x2299('0x10')]('/',auth[_0x2299('0xa')](),controller[_0x2299('0x11')]);router[_0x2299('0x12')](_0x2299('0x13'),controller[_0x2299('0x14')]);router[_0x2299('0x15')](_0x2299('0x13'),auth['isAuthenticated'](),controller[_0x2299('0x16')]);module['exports']=router; \ No newline at end of file +var _0x43a1=['get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','create','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x43a1,0x138));var _0x143a=function(_0x1968ab,_0x1a70dd){_0x1968ab=_0x1968ab-0x0;var _0x46be3d=_0x43a1[_0x1968ab];return _0x46be3d;};'use strict';var multer=require(_0x143a('0x0'));var util=require('util');var path=require(_0x143a('0x1'));var timeout=require(_0x143a('0x2'));var express=require(_0x143a('0x3'));var router=express[_0x143a('0x4')]();var fs_extra=require(_0x143a('0x5'));var auth=require(_0x143a('0x6'));var interaction=require(_0x143a('0x7'));var config=require(_0x143a('0x8'));var controller=require(_0x143a('0x9'));router[_0x143a('0xa')]('/',auth[_0x143a('0xb')](),controller[_0x143a('0xc')]);router[_0x143a('0xa')](_0x143a('0xd'),auth[_0x143a('0xb')](),controller[_0x143a('0xe')]);router[_0x143a('0xa')](_0x143a('0xf'),auth[_0x143a('0xb')](),controller[_0x143a('0x10')]);router[_0x143a('0xa')](_0x143a('0x11'),auth[_0x143a('0xb')](),controller[_0x143a('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x143a('0x13')]);router[_0x143a('0x14')]('/:id',controller[_0x143a('0x15')]);router['delete']('/:id',auth[_0x143a('0xb')](),controller['destroy']);module[_0x143a('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index f884588..b24611c 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 _0x6ae2=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x33220b,_0x557d47){_0x33220b=_0x33220b-0x0;var _0xbc4404=_0x6ae2[_0x33220b];return _0xbc4404;};'use strict';var Sequelize=require(_0x26ae('0x0'));module[_0x26ae('0x1')]={'body':{'type':Sequelize[_0x26ae('0x2')](_0x26ae('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x26ae('0x5')]('in',_0x26ae('0x6')),'defaultValue':_0x26ae('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x26ae('0x7')]},'providerResponse':{'type':Sequelize[_0x26ae('0x2')]}}; \ No newline at end of file +var _0x081e=['exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x257cae,_0x13de8a){var _0x27e43b=function(_0x918373){while(--_0x918373){_0x257cae['push'](_0x257cae['shift']());}};_0x27e43b(++_0x13de8a);}(_0x081e,0xc5));var _0xe081=function(_0x3fa1e1,_0x4e39f0){_0x3fa1e1=_0x3fa1e1-0x0;var _0x1cc2ad=_0x081e[_0x3fa1e1];return _0x1cc2ad;};'use strict';var Sequelize=require(_0xe081('0x0'));module[_0xe081('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe081('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xe081('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe081('0x4')]('in',_0xe081('0x5')),'defaultValue':_0xe081('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe081('0x6')]},'providerName':{'type':Sequelize[_0xe081('0x7')]},'providerResponse':{'type':Sequelize[_0xe081('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 97054d5..c87ea15 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 _0x4f1b=['info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','length','options','create','body','find','params','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','client','http','request','then'];(function(_0x2a08b9,_0x94c9e6){var _0x501187=function(_0x46a4fa){while(--_0x46a4fa){_0x2a08b9['push'](_0x2a08b9['shift']());}};_0x501187(++_0x94c9e6);}(_0x4f1b,0x65));var _0xb4f1=function(_0x26883f,_0x3b2ed9){_0x26883f=_0x26883f-0x0;var _0x1dd03e=_0x4f1b[_0x26883f];return _0x1dd03e;};'use strict';var emlformat=require(_0xb4f1('0x0'));var rimraf=require(_0xb4f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb4f1('0x2'));var moment=require(_0xb4f1('0x3'));var BPromise=require(_0xb4f1('0x4'));var Mustache=require(_0xb4f1('0x5'));var util=require(_0xb4f1('0x6'));var path=require(_0xb4f1('0x7'));var sox=require(_0xb4f1('0x8'));var csv=require(_0xb4f1('0x9'));var ejs=require(_0xb4f1('0xa'));var fs=require('fs');var fs_extra=require(_0xb4f1('0xb'));var _=require(_0xb4f1('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb4f1('0xd'));var deskjs=require(_0xb4f1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb4f1('0xf'));var Papa=require(_0xb4f1('0x10'));var Redis=require(_0xb4f1('0x11'));var authService=require(_0xb4f1('0x12'));var qs=require(_0xb4f1('0x13'));var as=require(_0xb4f1('0x14'));var hardwareService=require(_0xb4f1('0x15'));var logger=require(_0xb4f1('0x16'))(_0xb4f1('0x17'));var utils=require(_0xb4f1('0x18'));var config=require(_0xb4f1('0x19'));var licenseUtil=require(_0xb4f1('0x1a'));var db=require(_0xb4f1('0x1b'))['db'];config[_0xb4f1('0x1c')]=_[_0xb4f1('0x1d')](config[_0xb4f1('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xb4f1('0x1e'))(new Redis(config['redis']));require(_0xb4f1('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xb4f1('0x20')][_0xb4f1('0x21')]({'port':0x232c});var client9002=jayson[_0xb4f1('0x20')][_0xb4f1('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x14af83,_0xacf940,_0x359330,_0x14de25){return new BPromise(function(_0x5ca6f4,_0x8b7722){var _0x32b028=_0x14de25||client;return _0x32b028[_0xb4f1('0x22')](_0x14af83,_0x359330)[_0xb4f1('0x23')](function(_0x2ce7ac){logger[_0xb4f1('0x24')](_0xb4f1('0x25'),_0xacf940,_0xb4f1('0x26'));logger[_0xb4f1('0x27')](_0xb4f1('0x28'),_0xacf940,_0xb4f1('0x26'),JSON['stringify'](_0x2ce7ac));if(_0x2ce7ac['error']){if(_0x2ce7ac['error'][_0xb4f1('0x29')]===0x1f4){logger[_0xb4f1('0x2a')](_0xb4f1('0x25'),_0xacf940,_0x2ce7ac[_0xb4f1('0x2a')][_0xb4f1('0x2b')]);return _0x8b7722(_0x2ce7ac[_0xb4f1('0x2a')][_0xb4f1('0x2b')]);}logger[_0xb4f1('0x2a')](_0xb4f1('0x25'),_0xacf940,_0x2ce7ac['error'][_0xb4f1('0x2b')]);return _0x5ca6f4(_0x2ce7ac['error']['message']);}else{logger[_0xb4f1('0x24')](_0xb4f1('0x25'),_0xacf940,_0xb4f1('0x26'));_0x5ca6f4(_0x2ce7ac[_0xb4f1('0x2c')]['message']);}})[_0xb4f1('0x2d')](function(_0x4ff8a8){logger[_0xb4f1('0x2a')](_0xb4f1('0x25'),_0xacf940,_0x4ff8a8);_0x8b7722(_0x4ff8a8);});});}function respondWithStatusCode(_0x40c0cc,_0x5380e7){_0x5380e7=_0x5380e7||0xcc;return function(_0x47c40c){if(_0x47c40c){return _0x40c0cc[_0xb4f1('0x2e')](_0x5380e7);}return _0x40c0cc[_0xb4f1('0x2f')](_0x5380e7)[_0xb4f1('0x30')]();};}function respondWithResult(_0x90b0ad,_0x3f1767){_0x3f1767=_0x3f1767||0xc8;return function(_0x56aa15){if(_0x56aa15){return _0x90b0ad[_0xb4f1('0x2f')](_0x3f1767)['json'](_0x56aa15);}};}function respondWithFilteredResult(_0x2af87d,_0x85ba73){return function(_0x15a7eb){if(_0x15a7eb){var _0x4991bc=typeof _0x85ba73[_0xb4f1('0x31')]===_0xb4f1('0x32')&&typeof _0x85ba73[_0xb4f1('0x33')]===_0xb4f1('0x32');var _0x1434b9=_0x15a7eb[_0xb4f1('0x34')];var _0x36f034=_0x4991bc?0x0:_0x85ba73[_0xb4f1('0x31')];var _0x1f0a88=_0x4991bc?_0x15a7eb['count']:_0x85ba73[_0xb4f1('0x31')]+_0x85ba73[_0xb4f1('0x33')];var _0x3845ac;if(_0x1f0a88>=_0x1434b9){_0x1f0a88=_0x1434b9;_0x3845ac=0xc8;}else{_0x3845ac=0xce;}_0x2af87d[_0xb4f1('0x2f')](_0x3845ac);return _0x2af87d['set'](_0xb4f1('0x35'),_0x36f034+'-'+_0x1f0a88+'/'+_0x1434b9)[_0xb4f1('0x36')](_0x15a7eb);}return null;};}function patchUpdates(_0x3ea127){return function(_0x4cdc86){try{jsonpatch[_0xb4f1('0x37')](_0x4cdc86,_0x3ea127,!![]);}catch(_0x58586a){return BPromise[_0xb4f1('0x38')](_0x58586a);}return _0x4cdc86[_0xb4f1('0x39')]();};}function saveUpdates(_0x4c3116,_0x2d97e9){return function(_0x2c9fed){if(_0x2c9fed){return _0x2c9fed[_0xb4f1('0x3a')](_0x4c3116)[_0xb4f1('0x23')](function(_0x275672){return _0x275672;});}return null;};}function removeEntity(_0x366907,_0x521021){return function(_0x552997){if(_0x552997){return _0x552997[_0xb4f1('0x3b')]()['then'](function(){_0x366907['status'](0xcc)[_0xb4f1('0x30')]();});}};}function handleEntityNotFound(_0x4d8d88,_0x4117d9){return function(_0x486141){if(!_0x486141){_0x4d8d88[_0xb4f1('0x2e')](0x194);}return _0x486141;};}function handleError(_0x4ba832,_0xd1ba43){_0xd1ba43=_0xd1ba43||0x1f4;return function(_0x28ca8f){logger['error'](_0x28ca8f[_0xb4f1('0x3c')]);if(_0x28ca8f[_0xb4f1('0x3d')]){delete _0x28ca8f[_0xb4f1('0x3d')];}_0x4ba832[_0xb4f1('0x2f')](_0xd1ba43)['send'](_0x28ca8f);};}exports[_0xb4f1('0x3e')]=function(_0x21808d,_0x2b4521){var _0x3ef0d8={},_0x39f950={},_0x3193cb={'count':0x0,'rows':[]};var _0x188dd8=_[_0xb4f1('0x3f')](db[_0xb4f1('0x40')][_0xb4f1('0x41')],function(_0x33bfdc){return{'name':_0x33bfdc[_0xb4f1('0x42')],'type':_0x33bfdc[_0xb4f1('0x43')][_0xb4f1('0x44')]};});_0x39f950[_0xb4f1('0x45')]=_['map'](_0x188dd8,_0xb4f1('0x3d'));_0x39f950[_0xb4f1('0x46')]=_[_0xb4f1('0x47')](_0x21808d[_0xb4f1('0x46')]);_0x39f950[_0xb4f1('0x48')]=_['intersection'](_0x39f950[_0xb4f1('0x45')],_0x39f950[_0xb4f1('0x46')]);_0x3ef0d8[_0xb4f1('0x49')]=_[_0xb4f1('0x4a')](_0x39f950[_0xb4f1('0x45')],qs['fields'](_0x21808d[_0xb4f1('0x46')][_0xb4f1('0x4b')]));_0x3ef0d8['attributes']=_0x3ef0d8[_0xb4f1('0x49')]['length']?_0x3ef0d8[_0xb4f1('0x49')]:_0x39f950[_0xb4f1('0x45')];if(!_0x21808d[_0xb4f1('0x46')][_0xb4f1('0x4c')](_0xb4f1('0x4d'))){_0x3ef0d8['limit']=qs[_0xb4f1('0x33')](_0x21808d['query'][_0xb4f1('0x33')]);_0x3ef0d8[_0xb4f1('0x31')]=qs[_0xb4f1('0x31')](_0x21808d[_0xb4f1('0x46')]['offset']);}_0x3ef0d8[_0xb4f1('0x4e')]=qs[_0xb4f1('0x4f')](_0x21808d[_0xb4f1('0x46')][_0xb4f1('0x4f')]);_0x3ef0d8[_0xb4f1('0x50')]=qs[_0xb4f1('0x48')](_[_0xb4f1('0x51')](_0x21808d[_0xb4f1('0x46')],_0x39f950[_0xb4f1('0x48')]),_0x188dd8);if(_0x21808d[_0xb4f1('0x46')]['filter']){_0x3ef0d8[_0xb4f1('0x50')]=_[_0xb4f1('0x52')](_0x3ef0d8['where'],{'$or':_[_0xb4f1('0x3f')](_0x188dd8,function(_0x1a2a08){if(_0x1a2a08['type']!==_0xb4f1('0x53')){var _0x48249c={};_0x48249c[_0x1a2a08[_0xb4f1('0x3d')]]={'$like':'%'+_0x21808d[_0xb4f1('0x46')]['filter']+'%'};return _0x48249c;}})});}_0x3ef0d8=_['merge']({},_0x3ef0d8,_0x21808d['options']);var _0x49fdcc={'where':_0x3ef0d8['where']};return db[_0xb4f1('0x40')]['count'](_0x49fdcc)[_0xb4f1('0x23')](function(_0x5236d0){_0x3193cb[_0xb4f1('0x34')]=_0x5236d0;if(_0x21808d[_0xb4f1('0x46')][_0xb4f1('0x54')]){_0x3ef0d8[_0xb4f1('0x55')]=[{'all':!![]}];}return db['ChatMessage'][_0xb4f1('0x56')](_0x3ef0d8);})['then'](function(_0x66b521){_0x3193cb[_0xb4f1('0x57')]=_0x66b521;return _0x3193cb;})['then'](respondWithFilteredResult(_0x2b4521,_0x3ef0d8))['catch'](handleError(_0x2b4521,null));};exports['show']=function(_0x1f85f4,_0x5216b9){var _0x441767={'raw':!![],'where':{'id':_0x1f85f4['params']['id']}},_0x32ef8d={};_0x32ef8d[_0xb4f1('0x45')]=_['keys'](db['ChatMessage'][_0xb4f1('0x41')]);_0x32ef8d['query']=_['keys'](_0x1f85f4[_0xb4f1('0x46')]);_0x32ef8d[_0xb4f1('0x48')]=_[_0xb4f1('0x4a')](_0x32ef8d[_0xb4f1('0x45')],_0x32ef8d['query']);_0x441767[_0xb4f1('0x49')]=_[_0xb4f1('0x4a')](_0x32ef8d[_0xb4f1('0x45')],qs[_0xb4f1('0x4b')](_0x1f85f4[_0xb4f1('0x46')][_0xb4f1('0x4b')]));_0x441767['attributes']=_0x441767[_0xb4f1('0x49')][_0xb4f1('0x58')]?_0x441767[_0xb4f1('0x49')]:_0x32ef8d[_0xb4f1('0x45')];if(_0x1f85f4[_0xb4f1('0x46')][_0xb4f1('0x54')]){_0x441767[_0xb4f1('0x55')]=[{'all':!![]}];}_0x441767=_['merge']({},_0x441767,_0x1f85f4[_0xb4f1('0x59')]);return db[_0xb4f1('0x40')]['find'](_0x441767)['then'](handleEntityNotFound(_0x5216b9,null))[_0xb4f1('0x23')](respondWithResult(_0x5216b9,null))[_0xb4f1('0x2d')](handleError(_0x5216b9,null));};exports[_0xb4f1('0x5a')]=function(_0x4b89c2,_0x5630c8){return db[_0xb4f1('0x40')]['create'](_0x4b89c2[_0xb4f1('0x5b')],{})[_0xb4f1('0x23')](respondWithResult(_0x5630c8,0xc9))['catch'](handleError(_0x5630c8,null));};exports['update']=function(_0x8eb4f3,_0x68383b){if(_0x8eb4f3[_0xb4f1('0x5b')]['id']){delete _0x8eb4f3['body']['id'];}return db['ChatMessage'][_0xb4f1('0x5c')]({'where':{'id':_0x8eb4f3[_0xb4f1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x68383b,null))['then'](saveUpdates(_0x8eb4f3[_0xb4f1('0x5b')],null))[_0xb4f1('0x23')](respondWithResult(_0x68383b,null))['catch'](handleError(_0x68383b,null));};exports[_0xb4f1('0x3b')]=function(_0x2195c5,_0x2fc441){return db[_0xb4f1('0x40')]['find']({'where':{'id':_0x2195c5[_0xb4f1('0x5d')]['id']}})[_0xb4f1('0x23')](handleEntityNotFound(_0x2fc441,null))[_0xb4f1('0x23')](removeEntity(_0x2fc441,null))['catch'](handleError(_0x2fc441,null));};exports['describe']=function(_0x7788,_0x23ee76){return db[_0xb4f1('0x40')]['describe']()[_0xb4f1('0x23')](respondWithResult(_0x23ee76,null))[_0xb4f1('0x2d')](handleError(_0x23ee76,null));};var interaction_log=require('../../config/logger')(_0xb4f1('0x5e'));exports[_0xb4f1('0x5f')]=function(_0x3096a6,_0x455c24,_0x32c6a3){var _0x130dbd={'agent':{},'channel':_0xb4f1('0x60')};if(_0x3096a6[_0xb4f1('0x5b')]['id']){delete _0x3096a6['body']['id'];}_0x3096a6[_0xb4f1('0x5b')]['read']=!![];_0x3096a6['body']['readAt']=moment()[_0xb4f1('0x61')](_0xb4f1('0x62'));_0x3096a6[_0xb4f1('0x5b')][_0xb4f1('0x63')]=_0x3096a6[_0xb4f1('0x5b')][_0xb4f1('0x63')]||_0x3096a6['user']['id'];_0x130dbd[_0xb4f1('0x64')]['id']=_0x3096a6[_0xb4f1('0x5b')]['UserId'];return db[_0xb4f1('0x40')][_0xb4f1('0x5c')]({'where':{'id':_0x3096a6[_0xb4f1('0x5d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x455c24,null))[_0xb4f1('0x23')](saveUpdates(_0x3096a6[_0xb4f1('0x5b')],null))['then'](function(_0x1567b6){if(_0x1567b6){_0x130dbd['message']=_0x1567b6[_0xb4f1('0x65')]({'plain':!![]});return db['ChatInteraction'][_0xb4f1('0x5c')]({'where':{'id':_0x1567b6[_0xb4f1('0x66')]}});}return null;})[_0xb4f1('0x23')](handleEntityNotFound(_0x455c24,null))[_0xb4f1('0x23')](function(_0x5232d6){if(_0x5232d6){return _0x5232d6['update']({'UserId':_0x3096a6[_0xb4f1('0x5b')]['UserId'],'read1stAt':_[_0xb4f1('0x67')](_0x5232d6[_0xb4f1('0x68')])?moment()['format'](_0xb4f1('0x62')):undefined});}return null;})[_0xb4f1('0x23')](function(_0xacb624){if(_0xacb624){_0x130dbd[_0xb4f1('0x69')]=_0xacb624[_0xb4f1('0x65')]({'plain':!![]});interaction_log[_0xb4f1('0x24')](_0xb4f1('0x6a'),_0x3096a6['user']['id'],_0x3096a6['user'][_0xb4f1('0x3d')],_0x3096a6[_0xb4f1('0x6b')][_0xb4f1('0x6c')],_0x130dbd[_0xb4f1('0x69')]['id'],_0x3096a6[_0xb4f1('0x5b')]?JSON[_0xb4f1('0x6d')](_0x3096a6[_0xb4f1('0x5b')]):_0xb4f1('0x6e'));return respondWithRpcPromise(_0xb4f1('0x6f'),_0xb4f1('0x70'),_0x130dbd);}return null;})['then'](function(_0x258f5d){var _0x37f5f4=_0xb4f1('0x71')+_0x258f5d[_0xb4f1('0x2b')]['ContactId'];return db[_0xb4f1('0x72')][_0xb4f1('0x46')](_0x37f5f4,{'type':db[_0xb4f1('0x73')][_0xb4f1('0x74')][_0xb4f1('0x75')],'raw':!![]})[_0xb4f1('0x23')](function(_0x158dbd){return _0x158dbd;});})[_0xb4f1('0x23')](function(_0x437d93){if(_0x437d93){_0x130dbd[_0xb4f1('0x2b')][_0xb4f1('0x76')]=_0x437d93[0x0];if(!_0x3096a6[_0xb4f1('0x5b')][_0xb4f1('0x63')])return;return db[_0xb4f1('0x77')][_0xb4f1('0x5c')]({'where':{'id':_0x3096a6[_0xb4f1('0x5b')][_0xb4f1('0x63')],'role':_0xb4f1('0x64')},'attributes':['id',_0xb4f1('0x3d'),_0xb4f1('0x78'),_0xb4f1('0x79'),_0xb4f1('0x7a')],'raw':!![]});}return null;})[_0xb4f1('0x23')](function(_0x36e212){if(!_0x36e212)return null;_0x130dbd[_0xb4f1('0x2b')][_0xb4f1('0x64')]=_0x36e212;return _0x130dbd;})[_0xb4f1('0x23')](function(_0xeef62e){if(_0xeef62e){if(_0x3096a6[_0xb4f1('0x5b')]['manual']){_0x130dbd[_0xb4f1('0x2b')][_0xb4f1('0x7b')]=util['format'](_0xb4f1('0x7c'),_0x3096a6[_0xb4f1('0x6b')][_0xb4f1('0x3d')]);_0x130dbd[_0xb4f1('0x2b')]['channel']=_0x130dbd[_0xb4f1('0x7d')];_0x130dbd[_0xb4f1('0x2b')][_0xb4f1('0x7e')]=_0x130dbd[_0xb4f1('0x7d')];_0x130dbd['message'][_0xb4f1('0x7f')]=_0xb4f1('0x5f');return respondWithRpcPromise('EventManager',_0xb4f1('0x80'),{'event':_0xb4f1('0x81'),'message':_[_0xb4f1('0x52')](_0x130dbd[_0xb4f1('0x2b')],JSON[_0xb4f1('0x82')](_0x130dbd['interaction'][_0xb4f1('0x83')]))},client9002)[_0xb4f1('0x23')](function(){return _0x130dbd;});}return _0x130dbd;}return null;})[_0xb4f1('0x23')](respondWithResult(_0x455c24,null))['catch'](handleError(_0x455c24,null));};var interaction_log=require(_0xb4f1('0x16'))(_0xb4f1('0x5e'));exports[_0xb4f1('0x38')]=function(_0x326d7f,_0x1607ef,_0x1880e6){var _0x4cc966={'agent':{},'channel':'chat'};if(_0x326d7f['body']['id']){delete _0x326d7f[_0xb4f1('0x5b')]['id'];}_0x326d7f[_0xb4f1('0x5b')][_0xb4f1('0x63')]=_0x326d7f[_0xb4f1('0x5b')][_0xb4f1('0x63')]||_0x326d7f[_0xb4f1('0x6b')]['id'];_0x4cc966[_0xb4f1('0x64')]['id']=_0x326d7f[_0xb4f1('0x5b')][_0xb4f1('0x63')];return db[_0xb4f1('0x40')][_0xb4f1('0x5c')]({'where':{'id':_0x326d7f[_0xb4f1('0x5d')]['id'],'UserId':null}})[_0xb4f1('0x23')](handleEntityNotFound(_0x1607ef,null))['then'](function(_0x20ed90){if(_0x20ed90){_0x4cc966[_0xb4f1('0x2b')]=_0x20ed90[_0xb4f1('0x65')]({'plain':!![]});return db[_0xb4f1('0x84')][_0xb4f1('0x5c')]({'where':{'id':_0x20ed90['ChatInteractionId']}});}return null;})[_0xb4f1('0x23')](handleEntityNotFound(_0x1607ef,null))[_0xb4f1('0x23')](function(_0xdc5f62){if(_0xdc5f62){_0x4cc966[_0xb4f1('0x69')]=_0xdc5f62['get']({'plain':!![]});interaction_log[_0xb4f1('0x24')](_0xb4f1('0x85'),_0x326d7f['user']['id'],_0x326d7f['user']['name'],_0x326d7f[_0xb4f1('0x6b')][_0xb4f1('0x6c')],_0x4cc966[_0xb4f1('0x69')]['id'],_0x326d7f['body']?JSON[_0xb4f1('0x6d')](_0x326d7f[_0xb4f1('0x5b')]):_0xb4f1('0x6e'));return respondWithRpcPromise(_0xb4f1('0x86'),_0xb4f1('0x87'),_0x4cc966);}return null;})[_0xb4f1('0x23')](function(_0x693845){var _0x4a2f8b=_0xb4f1('0x71')+_0x693845[_0xb4f1('0x2b')]['ContactId'];return db[_0xb4f1('0x72')]['query'](_0x4a2f8b,{'type':db[_0xb4f1('0x73')]['QueryTypes'][_0xb4f1('0x75')],'raw':!![]})['then'](function(_0x293d7c){return _0x293d7c;});})['then'](function(_0x108acf){if(_0x108acf){_0x4cc966[_0xb4f1('0x2b')][_0xb4f1('0x76')]=_0x108acf[0x0];if(!_0x326d7f[_0xb4f1('0x5b')]['UserId'])return;return db['User']['find']({'where':{'id':_0x326d7f[_0xb4f1('0x5b')][_0xb4f1('0x63')],'role':_0xb4f1('0x64')},'attributes':['id','name',_0xb4f1('0x78'),_0xb4f1('0x79'),_0xb4f1('0x7a')],'raw':!![]});}return null;})[_0xb4f1('0x23')](function(_0x3aa29c){if(!_0x3aa29c)return null;_0x4cc966[_0xb4f1('0x2b')][_0xb4f1('0x64')]=_0x3aa29c;return _0x4cc966;})[_0xb4f1('0x23')](function(_0x4c872b){if(_0x4c872b){_0x4c872b[_0xb4f1('0x2b')][_0xb4f1('0x7b')]=util['format']('SIP/%s',_0x326d7f[_0xb4f1('0x6b')][_0xb4f1('0x3d')]);_0x4c872b[_0xb4f1('0x2b')][_0xb4f1('0x7d')]=_0x4cc966[_0xb4f1('0x7d')];_0x4c872b['message']['motionChannel']=_0x4cc966['channel'];_0x4c872b[_0xb4f1('0x2b')][_0xb4f1('0x7f')]=_0xb4f1('0x38');respondWithRpcPromise(_0xb4f1('0x80'),_0xb4f1('0x80'),{'event':_0xb4f1('0x88'),'message':_[_0xb4f1('0x52')](_0x4cc966[_0xb4f1('0x2b')],JSON[_0xb4f1('0x82')](_0x4cc966[_0xb4f1('0x69')]['formData']))},client9002);return _0x4cc966;}return null;})[_0xb4f1('0x23')](respondWithResult(_0x1607ef,null))['catch'](handleError(_0x1607ef,null));}; \ No newline at end of file +var _0x8ed2=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','status','end','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','query','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','ChatMessage','then','includeAll','include','findAll','rows','show','body','find','params','describe','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','interaction','role','null','ContactId','sequelize','QueryTypes','SELECT','contact','internal','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','formData','chat-interactions','reject','ChatInteraction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','fullname','interface','rejectmessage','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x2149c9,_0x158abb){var _0x1e7c13=function(_0xea83ee){while(--_0xea83ee){_0x2149c9['push'](_0x2149c9['shift']());}};_0x1e7c13(++_0x158abb);}(_0x8ed2,0x1da));var _0x28ed=function(_0x574682,_0x52be87){_0x574682=_0x574682-0x0;var _0x5e810d=_0x8ed2[_0x574682];return _0x5e810d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28ed('0x0'));var zipdir=require(_0x28ed('0x1'));var jsonpatch=require(_0x28ed('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x28ed('0x3'));var Mustache=require('mustache');var util=require(_0x28ed('0x4'));var path=require(_0x28ed('0x5'));var sox=require(_0x28ed('0x6'));var csv=require(_0x28ed('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28ed('0x8'));var _=require(_0x28ed('0x9'));var squel=require('squel');var crypto=require(_0x28ed('0xa'));var jsforce=require(_0x28ed('0xb'));var deskjs=require(_0x28ed('0xc'));var toCsv=require(_0x28ed('0x7'));var querystring=require('querystring');var Papa=require(_0x28ed('0xd'));var Redis=require(_0x28ed('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x28ed('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28ed('0x10'))(_0x28ed('0x11'));var utils=require('../../config/utils');var config=require(_0x28ed('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x28ed('0x13'))['db'];config[_0x28ed('0x14')]=_['defaults'](config[_0x28ed('0x14')],{'host':_0x28ed('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x28ed('0x14')]));require(_0x28ed('0x16'))[_0x28ed('0x17')](socket);var jayson=require(_0x28ed('0x18'));var client=jayson[_0x28ed('0x19')][_0x28ed('0x1a')]({'port':0x232c});var client9002=jayson[_0x28ed('0x19')][_0x28ed('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1b18d6,_0xede579,_0x5e180d,_0x30f110){return new BPromise(function(_0x2faef2,_0x586167){var _0x3aaaf2=_0x30f110||client;return _0x3aaaf2['request'](_0x1b18d6,_0x5e180d)['then'](function(_0x2b2be4){logger[_0x28ed('0x1b')](_0x28ed('0x1c'),_0xede579,_0x28ed('0x1d'));logger[_0x28ed('0x1e')](_0x28ed('0x1f'),_0xede579,_0x28ed('0x1d'),JSON[_0x28ed('0x20')](_0x2b2be4));if(_0x2b2be4[_0x28ed('0x21')]){if(_0x2b2be4['error']['code']===0x1f4){logger['error'](_0x28ed('0x1c'),_0xede579,_0x2b2be4[_0x28ed('0x21')][_0x28ed('0x22')]);return _0x586167(_0x2b2be4['error'][_0x28ed('0x22')]);}logger[_0x28ed('0x21')](_0x28ed('0x1c'),_0xede579,_0x2b2be4['error'][_0x28ed('0x22')]);return _0x2faef2(_0x2b2be4[_0x28ed('0x21')][_0x28ed('0x22')]);}else{logger['info'](_0x28ed('0x1c'),_0xede579,_0x28ed('0x1d'));_0x2faef2(_0x2b2be4[_0x28ed('0x23')][_0x28ed('0x22')]);}})[_0x28ed('0x24')](function(_0x200c43){logger[_0x28ed('0x21')](_0x28ed('0x1c'),_0xede579,_0x200c43);_0x586167(_0x200c43);});});}function respondWithStatusCode(_0x2931c4,_0xcde5f7){_0xcde5f7=_0xcde5f7||0xcc;return function(_0x464a1d){if(_0x464a1d){return _0x2931c4['sendStatus'](_0xcde5f7);}return _0x2931c4['status'](_0xcde5f7)['end']();};}function respondWithResult(_0x2475b2,_0x1dd22d){_0x1dd22d=_0x1dd22d||0xc8;return function(_0x3f967b){if(_0x3f967b){return _0x2475b2['status'](_0x1dd22d)[_0x28ed('0x25')](_0x3f967b);}};}function respondWithFilteredResult(_0x1f0206,_0x33c325){return function(_0x243d61){if(_0x243d61){var _0x470a1d=typeof _0x33c325[_0x28ed('0x26')]===_0x28ed('0x27')&&typeof _0x33c325[_0x28ed('0x28')]===_0x28ed('0x27');var _0x5cde33=_0x243d61['count'];var _0x5b155a=_0x470a1d?0x0:_0x33c325['offset'];var _0x5917aa=_0x470a1d?_0x243d61[_0x28ed('0x29')]:_0x33c325['offset']+_0x33c325[_0x28ed('0x28')];var _0x568361;if(_0x5917aa>=_0x5cde33){_0x5917aa=_0x5cde33;_0x568361=0xc8;}else{_0x568361=0xce;}_0x1f0206['status'](_0x568361);return _0x1f0206[_0x28ed('0x2a')](_0x28ed('0x2b'),_0x5b155a+'-'+_0x5917aa+'/'+_0x5cde33)['json'](_0x243d61);}return null;};}function patchUpdates(_0x53a151){return function(_0x2555d4){try{jsonpatch[_0x28ed('0x2c')](_0x2555d4,_0x53a151,!![]);}catch(_0x5f08d6){return BPromise['reject'](_0x5f08d6);}return _0x2555d4[_0x28ed('0x2d')]();};}function saveUpdates(_0x2b0eed,_0x3fd5b7){return function(_0x5b851f){if(_0x5b851f){return _0x5b851f[_0x28ed('0x2e')](_0x2b0eed)['then'](function(_0x4b4837){return _0x4b4837;});}return null;};}function removeEntity(_0x3daec8,_0x1f8e45){return function(_0x586e04){if(_0x586e04){return _0x586e04[_0x28ed('0x2f')]()['then'](function(){_0x3daec8[_0x28ed('0x30')](0xcc)[_0x28ed('0x31')]();});}};}function handleEntityNotFound(_0x366e55,_0x12d3a5){return function(_0xefd55f){if(!_0xefd55f){_0x366e55[_0x28ed('0x32')](0x194);}return _0xefd55f;};}function handleError(_0x8a477,_0x3a97ab){_0x3a97ab=_0x3a97ab||0x1f4;return function(_0x176591){logger[_0x28ed('0x21')](_0x176591['stack']);if(_0x176591['name']){delete _0x176591[_0x28ed('0x33')];}_0x8a477['status'](_0x3a97ab)[_0x28ed('0x34')](_0x176591);};}exports[_0x28ed('0x35')]=function(_0x2f8791,_0x226577){var _0x235b43={},_0x25026f={},_0x2b759b={'count':0x0,'rows':[]};var _0x2f7339=_[_0x28ed('0x36')](db['ChatMessage'][_0x28ed('0x37')],function(_0x3d3b64){return{'name':_0x3d3b64[_0x28ed('0x38')],'type':_0x3d3b64[_0x28ed('0x39')][_0x28ed('0x3a')]};});_0x25026f['model']=_[_0x28ed('0x36')](_0x2f7339,'name');_0x25026f['query']=_[_0x28ed('0x3b')](_0x2f8791['query']);_0x25026f[_0x28ed('0x3c')]=_[_0x28ed('0x3d')](_0x25026f['model'],_0x25026f[_0x28ed('0x3e')]);_0x235b43['attributes']=_['intersection'](_0x25026f[_0x28ed('0x3f')],qs['fields'](_0x2f8791['query'][_0x28ed('0x40')]));_0x235b43[_0x28ed('0x41')]=_0x235b43['attributes'][_0x28ed('0x42')]?_0x235b43['attributes']:_0x25026f[_0x28ed('0x3f')];if(!_0x2f8791[_0x28ed('0x3e')][_0x28ed('0x43')](_0x28ed('0x44'))){_0x235b43[_0x28ed('0x28')]=qs[_0x28ed('0x28')](_0x2f8791['query'][_0x28ed('0x28')]);_0x235b43['offset']=qs[_0x28ed('0x26')](_0x2f8791[_0x28ed('0x3e')][_0x28ed('0x26')]);}_0x235b43['order']=qs[_0x28ed('0x45')](_0x2f8791['query'][_0x28ed('0x45')]);_0x235b43['where']=qs['filters'](_['pick'](_0x2f8791[_0x28ed('0x3e')],_0x25026f[_0x28ed('0x3c')]),_0x2f7339);if(_0x2f8791['query'][_0x28ed('0x46')]){_0x235b43[_0x28ed('0x47')]=_[_0x28ed('0x48')](_0x235b43[_0x28ed('0x47')],{'$or':_[_0x28ed('0x36')](_0x2f7339,function(_0x4dcf11){if(_0x4dcf11[_0x28ed('0x39')]!=='VIRTUAL'){var _0xda1be3={};_0xda1be3[_0x4dcf11[_0x28ed('0x33')]]={'$like':'%'+_0x2f8791['query'][_0x28ed('0x46')]+'%'};return _0xda1be3;}})});}_0x235b43=_[_0x28ed('0x48')]({},_0x235b43,_0x2f8791[_0x28ed('0x49')]);var _0x9f40d3={'where':_0x235b43[_0x28ed('0x47')]};return db[_0x28ed('0x4a')][_0x28ed('0x29')](_0x9f40d3)[_0x28ed('0x4b')](function(_0x4e560d){_0x2b759b['count']=_0x4e560d;if(_0x2f8791[_0x28ed('0x3e')][_0x28ed('0x4c')]){_0x235b43[_0x28ed('0x4d')]=[{'all':!![]}];}return db[_0x28ed('0x4a')][_0x28ed('0x4e')](_0x235b43);})['then'](function(_0x4923ef){_0x2b759b[_0x28ed('0x4f')]=_0x4923ef;return _0x2b759b;})[_0x28ed('0x4b')](respondWithFilteredResult(_0x226577,_0x235b43))[_0x28ed('0x24')](handleError(_0x226577,null));};exports[_0x28ed('0x50')]=function(_0x354d3d,_0x3c3bad){var _0x40261e={'raw':!![],'where':{'id':_0x354d3d['params']['id']}},_0x3612e3={};_0x3612e3['model']=_[_0x28ed('0x3b')](db[_0x28ed('0x4a')][_0x28ed('0x37')]);_0x3612e3[_0x28ed('0x3e')]=_[_0x28ed('0x3b')](_0x354d3d[_0x28ed('0x3e')]);_0x3612e3[_0x28ed('0x3c')]=_['intersection'](_0x3612e3[_0x28ed('0x3f')],_0x3612e3[_0x28ed('0x3e')]);_0x40261e[_0x28ed('0x41')]=_[_0x28ed('0x3d')](_0x3612e3[_0x28ed('0x3f')],qs[_0x28ed('0x40')](_0x354d3d[_0x28ed('0x3e')][_0x28ed('0x40')]));_0x40261e['attributes']=_0x40261e[_0x28ed('0x41')][_0x28ed('0x42')]?_0x40261e['attributes']:_0x3612e3['model'];if(_0x354d3d[_0x28ed('0x3e')][_0x28ed('0x4c')]){_0x40261e[_0x28ed('0x4d')]=[{'all':!![]}];}_0x40261e=_[_0x28ed('0x48')]({},_0x40261e,_0x354d3d[_0x28ed('0x49')]);return db['ChatMessage']['find'](_0x40261e)[_0x28ed('0x4b')](handleEntityNotFound(_0x3c3bad,null))[_0x28ed('0x4b')](respondWithResult(_0x3c3bad,null))[_0x28ed('0x24')](handleError(_0x3c3bad,null));};exports['create']=function(_0x593f06,_0xe96687){return db[_0x28ed('0x4a')]['create'](_0x593f06['body'],{})[_0x28ed('0x4b')](respondWithResult(_0xe96687,0xc9))[_0x28ed('0x24')](handleError(_0xe96687,null));};exports[_0x28ed('0x2e')]=function(_0x46d7e8,_0x8c3e8b){if(_0x46d7e8[_0x28ed('0x51')]['id']){delete _0x46d7e8[_0x28ed('0x51')]['id'];}return db[_0x28ed('0x4a')][_0x28ed('0x52')]({'where':{'id':_0x46d7e8[_0x28ed('0x53')]['id']}})[_0x28ed('0x4b')](handleEntityNotFound(_0x8c3e8b,null))[_0x28ed('0x4b')](saveUpdates(_0x46d7e8[_0x28ed('0x51')],null))[_0x28ed('0x4b')](respondWithResult(_0x8c3e8b,null))[_0x28ed('0x24')](handleError(_0x8c3e8b,null));};exports[_0x28ed('0x2f')]=function(_0x1274b2,_0x3f5c4e){return db[_0x28ed('0x4a')][_0x28ed('0x52')]({'where':{'id':_0x1274b2['params']['id']}})[_0x28ed('0x4b')](handleEntityNotFound(_0x3f5c4e,null))['then'](removeEntity(_0x3f5c4e,null))[_0x28ed('0x24')](handleError(_0x3f5c4e,null));};exports[_0x28ed('0x54')]=function(_0x4c7df5,_0x37e2d4){return db[_0x28ed('0x4a')][_0x28ed('0x54')]()[_0x28ed('0x4b')](respondWithResult(_0x37e2d4,null))[_0x28ed('0x24')](handleError(_0x37e2d4,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x1543fe,_0x704bd6,_0x22b478){var _0x53c7bf={'agent':{},'channel':_0x28ed('0x55')};if(_0x1543fe['body']['id']){delete _0x1543fe['body']['id'];}_0x1543fe[_0x28ed('0x51')]['read']=!![];_0x1543fe[_0x28ed('0x51')][_0x28ed('0x56')]=moment()[_0x28ed('0x57')](_0x28ed('0x58'));_0x1543fe[_0x28ed('0x51')][_0x28ed('0x59')]=_0x1543fe[_0x28ed('0x51')][_0x28ed('0x59')]||_0x1543fe[_0x28ed('0x5a')]['id'];_0x53c7bf[_0x28ed('0x5b')]['id']=_0x1543fe[_0x28ed('0x51')][_0x28ed('0x59')];return db[_0x28ed('0x4a')]['find']({'where':{'id':_0x1543fe[_0x28ed('0x53')]['id'],'UserId':null}})[_0x28ed('0x4b')](handleEntityNotFound(_0x704bd6,null))[_0x28ed('0x4b')](saveUpdates(_0x1543fe['body'],null))[_0x28ed('0x4b')](function(_0x27bc80){if(_0x27bc80){_0x53c7bf['message']=_0x27bc80[_0x28ed('0x5c')]({'plain':!![]});return db['ChatInteraction'][_0x28ed('0x52')]({'where':{'id':_0x27bc80[_0x28ed('0x5d')]}});}return null;})[_0x28ed('0x4b')](handleEntityNotFound(_0x704bd6,null))[_0x28ed('0x4b')](function(_0x28632f){if(_0x28632f){return _0x28632f['update']({'UserId':_0x1543fe['body'][_0x28ed('0x59')],'read1stAt':_['isNil'](_0x28632f['read1stAt'])?moment()[_0x28ed('0x57')](_0x28ed('0x58')):undefined});}return null;})[_0x28ed('0x4b')](function(_0x2d97ee){if(_0x2d97ee){_0x53c7bf[_0x28ed('0x5e')]=_0x2d97ee[_0x28ed('0x5c')]({'plain':!![]});interaction_log[_0x28ed('0x1b')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1543fe[_0x28ed('0x5a')]['id'],_0x1543fe[_0x28ed('0x5a')]['name'],_0x1543fe[_0x28ed('0x5a')][_0x28ed('0x5f')],_0x53c7bf[_0x28ed('0x5e')]['id'],_0x1543fe[_0x28ed('0x51')]?JSON['stringify'](_0x1543fe[_0x28ed('0x51')]):_0x28ed('0x60'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x53c7bf);}return null;})['then'](function(_0x20bf38){var _0xfe7c40='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20bf38[_0x28ed('0x22')][_0x28ed('0x61')];return db[_0x28ed('0x62')][_0x28ed('0x3e')](_0xfe7c40,{'type':db['Sequelize'][_0x28ed('0x63')][_0x28ed('0x64')],'raw':!![]})[_0x28ed('0x4b')](function(_0x569fc7){return _0x569fc7;});})[_0x28ed('0x4b')](function(_0x1710ce){if(_0x1710ce){_0x53c7bf['message'][_0x28ed('0x65')]=_0x1710ce[0x0];if(!_0x1543fe['body'][_0x28ed('0x59')])return;return db['User'][_0x28ed('0x52')]({'where':{'id':_0x1543fe[_0x28ed('0x51')][_0x28ed('0x59')],'role':_0x28ed('0x5b')},'attributes':['id',_0x28ed('0x33'),'fullname','email',_0x28ed('0x66')],'raw':!![]});}return null;})[_0x28ed('0x4b')](function(_0x32715b){if(!_0x32715b)return null;_0x53c7bf['message'][_0x28ed('0x5b')]=_0x32715b;return _0x53c7bf;})[_0x28ed('0x4b')](function(_0x55897a){if(_0x55897a){if(_0x1543fe['body']['manual']){_0x53c7bf[_0x28ed('0x22')]['interface']=util['format'](_0x28ed('0x67'),_0x1543fe[_0x28ed('0x5a')][_0x28ed('0x33')]);_0x53c7bf[_0x28ed('0x22')][_0x28ed('0x68')]=_0x53c7bf[_0x28ed('0x68')];_0x53c7bf[_0x28ed('0x22')][_0x28ed('0x69')]=_0x53c7bf['channel'];_0x53c7bf[_0x28ed('0x22')][_0x28ed('0x6a')]=_0x28ed('0x6b');return respondWithRpcPromise(_0x28ed('0x6c'),_0x28ed('0x6c'),{'event':_0x28ed('0x6d'),'message':_[_0x28ed('0x48')](_0x53c7bf[_0x28ed('0x22')],JSON['parse'](_0x53c7bf[_0x28ed('0x5e')][_0x28ed('0x6e')]))},client9002)['then'](function(){return _0x53c7bf;});}return _0x53c7bf;}return null;})[_0x28ed('0x4b')](respondWithResult(_0x704bd6,null))[_0x28ed('0x24')](handleError(_0x704bd6,null));};var interaction_log=require(_0x28ed('0x10'))(_0x28ed('0x6f'));exports[_0x28ed('0x70')]=function(_0x23d416,_0x4383b2,_0x9641e0){var _0x5f5851={'agent':{},'channel':'chat'};if(_0x23d416[_0x28ed('0x51')]['id']){delete _0x23d416['body']['id'];}_0x23d416[_0x28ed('0x51')][_0x28ed('0x59')]=_0x23d416['body'][_0x28ed('0x59')]||_0x23d416[_0x28ed('0x5a')]['id'];_0x5f5851[_0x28ed('0x5b')]['id']=_0x23d416[_0x28ed('0x51')][_0x28ed('0x59')];return db[_0x28ed('0x4a')]['find']({'where':{'id':_0x23d416[_0x28ed('0x53')]['id'],'UserId':null}})[_0x28ed('0x4b')](handleEntityNotFound(_0x4383b2,null))[_0x28ed('0x4b')](function(_0x1f4a8e){if(_0x1f4a8e){_0x5f5851[_0x28ed('0x22')]=_0x1f4a8e['get']({'plain':!![]});return db[_0x28ed('0x71')]['find']({'where':{'id':_0x1f4a8e['ChatInteractionId']}});}return null;})[_0x28ed('0x4b')](handleEntityNotFound(_0x4383b2,null))[_0x28ed('0x4b')](function(_0x3ff7c0){if(_0x3ff7c0){_0x5f5851[_0x28ed('0x5e')]=_0x3ff7c0[_0x28ed('0x5c')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x23d416[_0x28ed('0x5a')]['id'],_0x23d416[_0x28ed('0x5a')]['name'],_0x23d416[_0x28ed('0x5a')][_0x28ed('0x5f')],_0x5f5851[_0x28ed('0x5e')]['id'],_0x23d416[_0x28ed('0x51')]?JSON[_0x28ed('0x20')](_0x23d416[_0x28ed('0x51')]):_0x28ed('0x60'));return respondWithRpcPromise(_0x28ed('0x72'),_0x28ed('0x73'),_0x5f5851);}return null;})['then'](function(_0x4c8d6e){var _0x3ae352=_0x28ed('0x74')+_0x4c8d6e[_0x28ed('0x22')][_0x28ed('0x61')];return db['sequelize'][_0x28ed('0x3e')](_0x3ae352,{'type':db[_0x28ed('0x75')][_0x28ed('0x63')][_0x28ed('0x64')],'raw':!![]})[_0x28ed('0x4b')](function(_0x25db8b){return _0x25db8b;});})['then'](function(_0x32cb1a){if(_0x32cb1a){_0x5f5851[_0x28ed('0x22')][_0x28ed('0x65')]=_0x32cb1a[0x0];if(!_0x23d416[_0x28ed('0x51')][_0x28ed('0x59')])return;return db['User'][_0x28ed('0x52')]({'where':{'id':_0x23d416[_0x28ed('0x51')][_0x28ed('0x59')],'role':_0x28ed('0x5b')},'attributes':['id',_0x28ed('0x33'),_0x28ed('0x76'),'email',_0x28ed('0x66')],'raw':!![]});}return null;})[_0x28ed('0x4b')](function(_0x1dc96a){if(!_0x1dc96a)return null;_0x5f5851[_0x28ed('0x22')][_0x28ed('0x5b')]=_0x1dc96a;return _0x5f5851;})[_0x28ed('0x4b')](function(_0x147524){if(_0x147524){_0x147524[_0x28ed('0x22')][_0x28ed('0x77')]=util['format'](_0x28ed('0x67'),_0x23d416[_0x28ed('0x5a')]['name']);_0x147524[_0x28ed('0x22')]['channel']=_0x5f5851['channel'];_0x147524[_0x28ed('0x22')][_0x28ed('0x69')]=_0x5f5851[_0x28ed('0x68')];_0x147524[_0x28ed('0x22')]['event']=_0x28ed('0x70');respondWithRpcPromise(_0x28ed('0x6c'),'EventManager',{'event':_0x28ed('0x78'),'message':_[_0x28ed('0x48')](_0x5f5851[_0x28ed('0x22')],JSON['parse'](_0x5f5851[_0x28ed('0x5e')][_0x28ed('0x6e')]))},client9002);return _0x5f5851;}return null;})['then'](respondWithResult(_0x4383b2,null))[_0x28ed('0x24')](handleError(_0x4383b2,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 075f426..122fbdd 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 _0x04e4=['events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','hasOwnProperty'];(function(_0x4a9ff5,_0x4c0044){var _0x29e447=function(_0x5b1fd9){while(--_0x5b1fd9){_0x4a9ff5['push'](_0x4a9ff5['shift']());}};_0x29e447(++_0x4c0044);}(_0x04e4,0x1dc));var _0x404e=function(_0x5a8349,_0x2d611c){_0x5a8349=_0x5a8349-0x0;var _0x1bff84=_0x04e4[_0x5a8349];return _0x1bff84;};'use strict';var EventEmitter=require(_0x404e('0x0'));var ChatMessage=require(_0x404e('0x1'))['db'][_0x404e('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x404e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x404e('0x4'),'afterDestroy':_0x404e('0x5')};function emitEvent(_0x3e1bd4){return function(_0x17f53c,_0x3f8d50,_0x38bc4b){ChatMessageEvents['emit'](_0x3e1bd4+':'+_0x17f53c['id'],_0x17f53c);ChatMessageEvents['emit'](_0x3e1bd4,_0x17f53c);_0x38bc4b(null);};}for(var e in events){if(events[_0x404e('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xe62c=['events','../../mysqldb','ChatMessage','setMaxListeners','remove','emit','hasOwnProperty','exports'];(function(_0xa68cd9,_0x35b670){var _0x567abc=function(_0xad8435){while(--_0xad8435){_0xa68cd9['push'](_0xa68cd9['shift']());}};_0x567abc(++_0x35b670);}(_0xe62c,0xe0));var _0xce62=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xe62c[_0x39096d];return _0x13da4f;};'use strict';var EventEmitter=require(_0xce62('0x0'));var ChatMessage=require(_0xce62('0x1'))['db'][_0xce62('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xce62('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xce62('0x4')};function emitEvent(_0x49a0a1){return function(_0x646484,_0x37b30a,_0x58ec3b){ChatMessageEvents[_0xce62('0x5')](_0x49a0a1+':'+_0x646484['id'],_0x646484);ChatMessageEvents[_0xce62('0x5')](_0x49a0a1,_0x646484);_0x58ec3b(null);};}for(var e in events){if(events[_0xce62('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xce62('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 8f3738f..b1d7018 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 _0xd78e=['request-promise','rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','get','direction','toLowerCase','secret','isNil','UserId','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xd78e,0x19b));var _0xed78=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xd78e[_0x2cfb58];return _0xd99951;};'use strict';var _=require('lodash');var util=require(_0xed78('0x0'));var logger=require(_0xed78('0x1'))(_0xed78('0x2'));var moment=require(_0xed78('0x3'));var BPromise=require(_0xed78('0x4'));var rp=require(_0xed78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed78('0x6'));var config=require(_0xed78('0x7'));var attributes=require(_0xed78('0x8'));module['exports']=function(_0x42744d,_0xa296d5){return _0x42744d[_0xed78('0x9')]('ChatMessage',attributes,{'tableName':_0xed78('0xa'),'paranoid':![],'indexes':[{'name':_0xed78('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2dad2c,_0x3bfc8b,_0x160976){var _0x587083=_0x42744d['models'];var _0x2baf8a=_0x2dad2c[_0xed78('0xc')]({'plain':!![]});if(_0x2baf8a[_0xed78('0xd')][_0xed78('0xe')]()==='in'||_0x2baf8a['direction']['toLowerCase']()==='out'&&!_0x2baf8a[_0xed78('0xf')]&&!_[_0xed78('0x10')](_0x2baf8a[_0xed78('0x11')])){_0x587083['ChatInteraction'][_0xed78('0x12')]({'where':{'id':_0x2baf8a['ChatInteractionId']}})[_0xed78('0x13')](function(_0x8e954f){if(_0x8e954f){_0x8e954f[_0xed78('0x14')]({'lastMsgAt':_0x2baf8a[_0xed78('0x15')],'lastMsgDirection':_0x2baf8a[_0xed78('0xd')]['toLowerCase']()});}})[_0xed78('0x16')](function(_0x26f43e){console[_0xed78('0x17')](_0x26f43e);});}_0x160976();}},'charset':_0xed78('0x18'),'collate':_0xed78('0x19')});}; \ No newline at end of file +var _0x61ca=['out','secret','isNil','findOne','createdAt','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x98aa6f,_0x1c2cb0){var _0x1371ec=function(_0x56db51){while(--_0x56db51){_0x98aa6f['push'](_0x98aa6f['shift']());}};_0x1371ec(++_0x1c2cb0);}(_0x61ca,0x1b0));var _0xa61c=function(_0xfbb0ce,_0x1579f9){_0xfbb0ce=_0xfbb0ce-0x0;var _0xc7cf13=_0x61ca[_0xfbb0ce];return _0xc7cf13;};'use strict';var _=require(_0xa61c('0x0'));var util=require(_0xa61c('0x1'));var logger=require(_0xa61c('0x2'))(_0xa61c('0x3'));var moment=require('moment');var BPromise=require(_0xa61c('0x4'));var rp=require(_0xa61c('0x5'));var fs=require('fs');var path=require(_0xa61c('0x6'));var rimraf=require(_0xa61c('0x7'));var config=require(_0xa61c('0x8'));var attributes=require('./chatMessage.attributes');module[_0xa61c('0x9')]=function(_0x4550eb,_0x345504){return _0x4550eb[_0xa61c('0xa')](_0xa61c('0xb'),attributes,{'tableName':_0xa61c('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xa61c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x249b9c,_0x1bf023,_0x3fd77e){var _0x55a35f=_0x4550eb[_0xa61c('0xe')];var _0x51e969=_0x249b9c[_0xa61c('0xf')]({'plain':!![]});if(_0x51e969[_0xa61c('0x10')][_0xa61c('0x11')]()==='in'||_0x51e969[_0xa61c('0x10')][_0xa61c('0x11')]()===_0xa61c('0x12')&&!_0x51e969[_0xa61c('0x13')]&&!_[_0xa61c('0x14')](_0x51e969['UserId'])){_0x55a35f['ChatInteraction'][_0xa61c('0x15')]({'where':{'id':_0x51e969['ChatInteractionId']}})['then'](function(_0x10b89c){if(_0x10b89c){_0x10b89c['update']({'lastMsgAt':_0x51e969[_0xa61c('0x16')],'lastMsgDirection':_0x51e969[_0xa61c('0x10')][_0xa61c('0x11')]()});}})[_0xa61c('0x17')](function(_0x2005be){console['error'](_0x2005be);});}_0x3fd77e();}},'charset':'utf8mb4','collate':_0xa61c('0x18')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 9905d65..b0822f6 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 _0xd1aa=['bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash'];(function(_0xb76d4b,_0xc5ef5f){var _0x1e9f5a=function(_0x80c555){while(--_0x80c555){_0xb76d4b['push'](_0xb76d4b['shift']());}};_0x1e9f5a(++_0xc5ef5f);}(_0xd1aa,0x13f));var _0xad1a=function(_0x3ed091,_0x3491d4){_0x3ed091=_0x3ed091-0x0;var _0x49f07c=_0xd1aa[_0x3ed091];return _0x49f07c;};'use strict';var _=require(_0xad1a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xad1a('0x1'));var rs=require(_0xad1a('0x2'));var fs=require('fs');var Redis=require(_0xad1a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad1a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xad1a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xad1a('0x6')][_0xad1a('0x7')]({'port':0x232a});config[_0xad1a('0x8')]=_[_0xad1a('0x9')](config[_0xad1a('0x8')],{'host':_0xad1a('0xa'),'port':0x18eb});var socket=require(_0xad1a('0xb'))(new Redis(config['redis']));require(_0xad1a('0xc'))['register'](socket);function respondWithRpcPromise(_0x11f55c,_0x2198e7,_0x22b395){return new BPromise(function(_0x6e224a,_0x5911b5){return client[_0xad1a('0xd')](_0x11f55c,_0x22b395)[_0xad1a('0xe')](function(_0x5b7c73){logger[_0xad1a('0xf')]('ChatMessage,\x20%s,\x20%s',_0x2198e7,_0xad1a('0x10'));logger['debug'](_0xad1a('0x11'),_0x2198e7,_0xad1a('0x10'),JSON[_0xad1a('0x12')](_0x5b7c73));if(_0x5b7c73[_0xad1a('0x13')]){if(_0x5b7c73[_0xad1a('0x13')][_0xad1a('0x14')]===0x1f4){logger[_0xad1a('0x13')](_0xad1a('0x15'),_0x2198e7,_0x5b7c73[_0xad1a('0x13')][_0xad1a('0x16')]);return _0x5911b5(_0x5b7c73[_0xad1a('0x13')][_0xad1a('0x16')]);}logger[_0xad1a('0x13')](_0xad1a('0x15'),_0x2198e7,_0x5b7c73[_0xad1a('0x13')][_0xad1a('0x16')]);return _0x6e224a(_0x5b7c73[_0xad1a('0x13')][_0xad1a('0x16')]);}else{logger[_0xad1a('0xf')](_0xad1a('0x15'),_0x2198e7,_0xad1a('0x10'));_0x6e224a(_0x5b7c73[_0xad1a('0x17')][_0xad1a('0x16')]);}})[_0xad1a('0x18')](function(_0x3fc586){logger['error'](_0xad1a('0x15'),_0x2198e7,_0x3fc586);_0x5911b5(_0x3fc586);});});}exports[_0xad1a('0x19')]=function(_0x34b9af){var _0x36f734=this;return new Promise(function(_0x1fed70,_0x2f2714){return db[_0xad1a('0x1a')][_0xad1a('0x1b')](_0x34b9af[_0xad1a('0x1c')],{'raw':_0x34b9af[_0xad1a('0x1d')]?_0x34b9af[_0xad1a('0x1d')][_0xad1a('0x1e')]===undefined?!![]:![]:!![]})[_0xad1a('0xe')](function(_0x187317){logger['info'](_0xad1a('0x19'),_0x34b9af);logger[_0xad1a('0x1f')](_0xad1a('0x19'),_0x34b9af,JSON[_0xad1a('0x12')](_0x187317));_0x1fed70(_0x187317);})[_0xad1a('0x18')](function(_0x1a0cbd){logger['error'](_0xad1a('0x19'),_0x1a0cbd[_0xad1a('0x16')],_0x34b9af);_0x2f2714(_0x36f734[_0xad1a('0x13')](0x1f4,_0x1a0cbd['message']));});});}; \ No newline at end of file +var _0x1da4=['CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x56f19c,_0x585049){var _0x6d493c=function(_0xae3736){while(--_0xae3736){_0x56f19c['push'](_0x56f19c['shift']());}};_0x6d493c(++_0x585049);}(_0x1da4,0xd8));var _0x41da=function(_0x324503,_0x5d2e3e){_0x324503=_0x324503-0x0;var _0x54784e=_0x1da4[_0x324503];return _0x54784e;};'use strict';var _=require(_0x41da('0x0'));var util=require(_0x41da('0x1'));var moment=require(_0x41da('0x2'));var BPromise=require(_0x41da('0x3'));var rs=require(_0x41da('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x41da('0x5'))['db'];var utils=require(_0x41da('0x6'));var logger=require(_0x41da('0x7'))(_0x41da('0x8'));var config=require(_0x41da('0x9'));var jayson=require(_0x41da('0xa'));var client=jayson[_0x41da('0xb')][_0x41da('0xc')]({'port':0x232a});config[_0x41da('0xd')]=_['defaults'](config[_0x41da('0xd')],{'host':_0x41da('0xe'),'port':0x18eb});var socket=require(_0x41da('0xf'))(new Redis(config['redis']));require(_0x41da('0x10'))[_0x41da('0x11')](socket);function respondWithRpcPromise(_0xbd9df6,_0x4f2ef8,_0x4b8eff){return new BPromise(function(_0x146537,_0x440f33){return client[_0x41da('0x12')](_0xbd9df6,_0x4b8eff)[_0x41da('0x13')](function(_0xd1fd8f){logger[_0x41da('0x14')](_0x41da('0x15'),_0x4f2ef8,_0x41da('0x16'));logger[_0x41da('0x17')](_0x41da('0x18'),_0x4f2ef8,'request\x20sent',JSON[_0x41da('0x19')](_0xd1fd8f));if(_0xd1fd8f[_0x41da('0x1a')]){if(_0xd1fd8f[_0x41da('0x1a')]['code']===0x1f4){logger[_0x41da('0x1a')](_0x41da('0x15'),_0x4f2ef8,_0xd1fd8f[_0x41da('0x1a')][_0x41da('0x1b')]);return _0x440f33(_0xd1fd8f[_0x41da('0x1a')][_0x41da('0x1b')]);}logger[_0x41da('0x1a')](_0x41da('0x15'),_0x4f2ef8,_0xd1fd8f['error'][_0x41da('0x1b')]);return _0x146537(_0xd1fd8f[_0x41da('0x1a')][_0x41da('0x1b')]);}else{logger[_0x41da('0x14')](_0x41da('0x15'),_0x4f2ef8,'request\x20sent');_0x146537(_0xd1fd8f[_0x41da('0x1c')]['message']);}})['catch'](function(_0x2b1464){logger['error'](_0x41da('0x15'),_0x4f2ef8,_0x2b1464);_0x440f33(_0x2b1464);});});}exports[_0x41da('0x1d')]=function(_0x3311ae){var _0x30cbbd=this;return new Promise(function(_0x4854fe,_0x7fcd6b){return db[_0x41da('0x1e')][_0x41da('0x1f')](_0x3311ae[_0x41da('0x20')],{'raw':_0x3311ae['options']?_0x3311ae[_0x41da('0x21')][_0x41da('0x22')]===undefined?!![]:![]:!![]})[_0x41da('0x13')](function(_0x415f38){logger[_0x41da('0x14')](_0x41da('0x1d'),_0x3311ae);logger[_0x41da('0x17')]('CreateChatMessage',_0x3311ae,JSON[_0x41da('0x19')](_0x415f38));_0x4854fe(_0x415f38);})['catch'](function(_0x4b1755){logger[_0x41da('0x1a')]('CreateChatMessage',_0x4b1755[_0x41da('0x1b')],_0x3311ae);_0x7fcd6b(_0x30cbbd[_0x41da('0x1a')](0x1f4,_0x4b1755[_0x41da('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 1d44af4..f7395f0 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 _0xb66c=['chatMessage:','./chatMessage.events','remove','removeListener','register','length'];(function(_0x118afa,_0x4bf0c1){var _0x167d76=function(_0x2c529b){while(--_0x2c529b){_0x118afa['push'](_0x118afa['shift']());}};_0x167d76(++_0x4bf0c1);}(_0xb66c,0x175));var _0xcb66=function(_0x395778,_0x1f21f4){_0x395778=_0x395778-0x0;var _0x29a864=_0xb66c[_0x395778];return _0x29a864;};'use strict';var ChatMessageEvents=require(_0xcb66('0x0'));var events=['save',_0xcb66('0x1'),'update'];function createListener(_0x2afcb8,_0x24ea13){return function(_0xf7ccc5){_0x24ea13['emit'](_0x2afcb8,_0xf7ccc5);};}function removeListener(_0x35d439,_0x386241){return function(){ChatMessageEvents[_0xcb66('0x2')](_0x35d439,_0x386241);};}exports[_0xcb66('0x3')]=function(_0x5d766d){for(var _0x518163=0x0,_0x19adf5=events[_0xcb66('0x4')];_0x518163<_0x19adf5;_0x518163++){var _0xa3993=events[_0x518163];var _0x439f3d=createListener(_0xcb66('0x5')+_0xa3993,_0x5d766d);ChatMessageEvents['on'](_0xa3993,_0x439f3d);}}; \ No newline at end of file +var _0x379e=['./chatMessage.events','emit','removeListener','length','chatMessage:'];(function(_0x5e5ad9,_0x18845f){var _0x396036=function(_0x337699){while(--_0x337699){_0x5e5ad9['push'](_0x5e5ad9['shift']());}};_0x396036(++_0x18845f);}(_0x379e,0x104));var _0xe379=function(_0x437351,_0x709928){_0x437351=_0x437351-0x0;var _0x40f093=_0x379e[_0x437351];return _0x40f093;};'use strict';var ChatMessageEvents=require(_0xe379('0x0'));var events=['save','remove','update'];function createListener(_0x594cd4,_0xccbef2){return function(_0x1e24f9){_0xccbef2[_0xe379('0x1')](_0x594cd4,_0x1e24f9);};}function removeListener(_0x3db31a,_0x475418){return function(){ChatMessageEvents[_0xe379('0x2')](_0x3db31a,_0x475418);};}exports['register']=function(_0x1f6c46){for(var _0x24221c=0x0,_0x166621=events[_0xe379('0x3')];_0x24221c<_0x166621;_0x24221c++){var _0x22cb37=events[_0x24221c];var _0x5475e7=createListener(_0xe379('0x4')+_0x22cb37,_0x1f6c46);ChatMessageEvents['on'](_0x22cb37,_0x5475e7);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index e5f56af..cab8fc7 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 _0x75df=['post','tracked','chatmessage:create','put','update','/:id/accept','accept','reject','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0x75df,0x12a));var _0xf75d=function(_0xcdfa61,_0x13c016){_0xcdfa61=_0xcdfa61-0x0;var _0x31f74b=_0x75df[_0xcdfa61];return _0x31f74b;};'use strict';var multer=require('multer');var util=require(_0xf75d('0x0'));var path=require('path');var timeout=require(_0xf75d('0x1'));var express=require(_0xf75d('0x2'));var router=express[_0xf75d('0x3')]();var fs_extra=require(_0xf75d('0x4'));var auth=require(_0xf75d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf75d('0x6'));router[_0xf75d('0x7')]('/',auth[_0xf75d('0x8')](),controller[_0xf75d('0x9')]);router[_0xf75d('0x7')](_0xf75d('0xa'),auth[_0xf75d('0x8')](),controller[_0xf75d('0xb')]);router[_0xf75d('0x7')](_0xf75d('0xc'),auth['isAuthenticated'](),controller[_0xf75d('0xd')]);router[_0xf75d('0xe')]('/',auth['isAuthenticated'](),interaction[_0xf75d('0xf')]('chat',_0xf75d('0x10')),controller['create']);router[_0xf75d('0x11')]('/:id',controller[_0xf75d('0x12')]);router[_0xf75d('0x11')](_0xf75d('0x13'),auth[_0xf75d('0x8')](),controller[_0xf75d('0x14')]);router[_0xf75d('0x11')]('/:id/reject',auth['isAuthenticated'](),controller[_0xf75d('0x15')]);router[_0xf75d('0x16')](_0xf75d('0xc'),auth[_0xf75d('0x8')](),controller['destroy']);module[_0xf75d('0x17')]=router; \ No newline at end of file +var _0x58c0=['../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','show','post','tracked','chat','chatmessage:create','/:id','/:id/accept','accept','put','reject','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3ae180,_0x4ed627){var _0x423906=function(_0x483b37){while(--_0x483b37){_0x3ae180['push'](_0x3ae180['shift']());}};_0x423906(++_0x4ed627);}(_0x58c0,0x1ee));var _0x058c=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0x58c0[_0x4b4f24];return _0x1c13d4;};'use strict';var multer=require('multer');var util=require(_0x058c('0x0'));var path=require('path');var timeout=require(_0x058c('0x1'));var express=require(_0x058c('0x2'));var router=express[_0x058c('0x3')]();var fs_extra=require(_0x058c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x058c('0x5'));var config=require(_0x058c('0x6'));var controller=require(_0x058c('0x7'));router[_0x058c('0x8')]('/',auth[_0x058c('0x9')](),controller[_0x058c('0xa')]);router['get']('/describe',auth[_0x058c('0x9')](),controller[_0x058c('0xb')]);router[_0x058c('0x8')]('/:id',auth[_0x058c('0x9')](),controller[_0x058c('0xc')]);router[_0x058c('0xd')]('/',auth[_0x058c('0x9')](),interaction[_0x058c('0xe')](_0x058c('0xf'),_0x058c('0x10')),controller['create']);router['put'](_0x058c('0x11'),controller['update']);router['put'](_0x058c('0x12'),auth[_0x058c('0x9')](),controller[_0x058c('0x13')]);router[_0x058c('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x058c('0x15')]);router[_0x058c('0x16')](_0x058c('0x11'),auth[_0x058c('0x9')](),controller[_0x058c('0x17')]);module[_0x058c('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 09f8744..a5feaac 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 _0xadb5=['medium','TEXT','exports'];(function(_0x1da689,_0x37cf97){var _0x3819f3=function(_0x5b5046){while(--_0x5b5046){_0x1da689['push'](_0x1da689['shift']());}};_0x3819f3(++_0x37cf97);}(_0xadb5,0xad));var _0x5adb=function(_0x3f7655,_0xc562f0){_0x3f7655=_0x3f7655-0x0;var _0x550582=_0xadb5[_0x3f7655];return _0x550582;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x219e0f,_0x5ab710){var _0x47d448=function(_0x2e8e78){while(--_0x2e8e78){_0x219e0f['push'](_0x219e0f['shift']());}};_0x47d448(++_0x5ab710);}(_0xdb28,0x106));var _0x8db2=function(_0x43bcc2,_0x31f4a4){_0x43bcc2=_0x43bcc2-0x0;var _0x4448bb=_0xdb28[_0x43bcc2];return _0x4448bb;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index a061212..93a455f 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(_0x597033,_0x5cadcf){var _0x414988=function(_0x564326){while(--_0x564326){_0x597033['push'](_0x597033['shift']());}};_0x414988(++_0x5cadcf);}(_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 _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(_0x2d3664,_0x3dc7a4){var _0x5a845a=function(_0x2e79d2){while(--_0x2e79d2){_0x2d3664['push'](_0x2d3664['shift']());}};_0x5a845a(++_0x3dc7a4);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index bb4b931..2bb35d7 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b0b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b0b,0x94));var _0xb4b0=function(_0x5059a7,_0xb18b00){_0x5059a7=_0x5059a7-0x0;var _0x49442d=_0x4b0b[_0x5059a7];return _0x49442d;};'use strict';var EventEmitter=require(_0xb4b0('0x0'));var ChatOfflineMessage=require(_0xb4b0('0x1'))['db'][_0xb4b0('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xb4b0('0x3')](0x0);var events={'afterCreate':_0xb4b0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2bf19a){return function(_0x14e6f3,_0xbdf917,_0x190985){ChatOfflineMessageEvents[_0xb4b0('0x5')](_0x2bf19a+':'+_0x14e6f3['id'],_0x14e6f3);ChatOfflineMessageEvents[_0xb4b0('0x5')](_0x2bf19a,_0x14e6f3);_0x190985(null);};}for(var e in events){if(events[_0xb4b0('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xb4b0('0x7')](e,emitEvent(event));}}module[_0xb4b0('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x1490=['hook','events','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0x1490,0x85));var _0x0149=function(_0x3725d1,_0x5ed039){_0x3725d1=_0x3725d1-0x0;var _0xda0001=_0x1490[_0x3725d1];return _0xda0001;};'use strict';var EventEmitter=require(_0x0149('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x0149('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0149('0x2'),'afterDestroy':'remove'};function emitEvent(_0x461386){return function(_0x1bceac,_0x2cfd93,_0x330f0b){ChatOfflineMessageEvents['emit'](_0x461386+':'+_0x1bceac['id'],_0x1bceac);ChatOfflineMessageEvents[_0x0149('0x3')](_0x461386,_0x1bceac);_0x330f0b(null);};}for(var e in events){if(events[_0x0149('0x4')](e)){var event=events[e];ChatOfflineMessage[_0x0149('0x5')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index a1448e8..596b8c6 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 _0x5340=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5340,0x1da));var _0x0534=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5340[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x0534('0x0'));module[_0x0534('0x1')]=function(_0x37dfe4){return _0x37dfe4['define']('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0534('0x2'),'collate':_0x0534('0x3')});}; \ No newline at end of file +var _0x6670=['chat_offline_messages','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x13d574,_0x25659e){var _0x3eaa12=function(_0x3b32aa){while(--_0x3b32aa){_0x13d574['push'](_0x13d574['shift']());}};_0x3eaa12(++_0x25659e);}(_0x6670,0x65));var _0x0667=function(_0x236a58,_0x537a36){_0x236a58=_0x236a58-0x0;var _0xacefba=_0x6670[_0x236a58];return _0xacefba;};'use strict';var attributes=require(_0x0667('0x0'));module['exports']=function(_0x54fca9){return _0x54fca9[_0x0667('0x1')](_0x0667('0x2'),attributes,{'tableName':_0x0667('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 4cdfbb4..b07a8ea 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 _0xd04e=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x30b710,_0x4477d1){var _0x205edf=function(_0x4e02cc){while(--_0x4e02cc){_0x30b710['push'](_0x30b710['shift']());}};_0x205edf(++_0x4477d1);}(_0xd04e,0x10d));var _0xed04=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xd04e[_0xc8a931];return _0x28bd27;};'use strict';var _=require(_0xed04('0x0'));var util=require(_0xed04('0x1'));var moment=require(_0xed04('0x2'));var BPromise=require(_0xed04('0x3'));var rs=require(_0xed04('0x4'));var fs=require('fs');var Redis=require(_0xed04('0x5'));var db=require(_0xed04('0x6'))['db'];var utils=require(_0xed04('0x7'));var logger=require(_0xed04('0x8'))('rpc');var config=require(_0xed04('0x9'));var jayson=require(_0xed04('0xa'));var client=jayson[_0xed04('0xb')][_0xed04('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf7aa9e,_0x4cdc39,_0x523527){return new BPromise(function(_0x5df2d2,_0x270f24){return client[_0xed04('0xd')](_0xf7aa9e,_0x523527)[_0xed04('0xe')](function(_0x277eac){logger[_0xed04('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4cdc39,'request\x20sent');logger[_0xed04('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x4cdc39,_0xed04('0x11'),JSON['stringify'](_0x277eac));if(_0x277eac[_0xed04('0x12')]){if(_0x277eac[_0xed04('0x12')]['code']===0x1f4){logger[_0xed04('0x12')](_0xed04('0x13'),_0x4cdc39,_0x277eac[_0xed04('0x12')]['message']);return _0x270f24(_0x277eac[_0xed04('0x12')][_0xed04('0x14')]);}logger[_0xed04('0x12')](_0xed04('0x13'),_0x4cdc39,_0x277eac[_0xed04('0x12')][_0xed04('0x14')]);return _0x5df2d2(_0x277eac['error']['message']);}else{logger['info'](_0xed04('0x13'),_0x4cdc39,'request\x20sent');_0x5df2d2(_0x277eac[_0xed04('0x15')][_0xed04('0x14')]);}})[_0xed04('0x16')](function(_0x4d8934){logger[_0xed04('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4cdc39,_0x4d8934);_0x270f24(_0x4d8934);});});} \ No newline at end of file +var _0xc4dd=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','error','ChatOfflineMessage,\x20%s,\x20%s','message','util','moment','bluebird','ioredis'];(function(_0x1d139f,_0x5b57fb){var _0x410757=function(_0x1e7fa0){while(--_0x1e7fa0){_0x1d139f['push'](_0x1d139f['shift']());}};_0x410757(++_0x5b57fb);}(_0xc4dd,0x1cd));var _0xdc4d=function(_0x32f240,_0x47bfb0){_0x32f240=_0x32f240-0x0;var _0xc418d0=_0xc4dd[_0x32f240];return _0xc418d0;};'use strict';var _=require('lodash');var util=require(_0xdc4d('0x0'));var moment=require(_0xdc4d('0x1'));var BPromise=require(_0xdc4d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc4d('0x3'));var db=require(_0xdc4d('0x4'))['db'];var utils=require(_0xdc4d('0x5'));var logger=require(_0xdc4d('0x6'))(_0xdc4d('0x7'));var config=require(_0xdc4d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdc4d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42a280,_0x3afeaf,_0x3165cf){return new BPromise(function(_0x1ee6eb,_0x54725a){return client['request'](_0x42a280,_0x3165cf)['then'](function(_0x4c4f85){logger[_0xdc4d('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3afeaf,'request\x20sent');logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3afeaf,_0xdc4d('0xb'),JSON['stringify'](_0x4c4f85));if(_0x4c4f85[_0xdc4d('0xc')]){if(_0x4c4f85[_0xdc4d('0xc')]['code']===0x1f4){logger['error'](_0xdc4d('0xd'),_0x3afeaf,_0x4c4f85[_0xdc4d('0xc')][_0xdc4d('0xe')]);return _0x54725a(_0x4c4f85['error']['message']);}logger[_0xdc4d('0xc')](_0xdc4d('0xd'),_0x3afeaf,_0x4c4f85[_0xdc4d('0xc')][_0xdc4d('0xe')]);return _0x1ee6eb(_0x4c4f85[_0xdc4d('0xc')][_0xdc4d('0xe')]);}else{logger[_0xdc4d('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3afeaf,_0xdc4d('0xb'));_0x1ee6eb(_0x4c4f85['result'][_0xdc4d('0xe')]);}})['catch'](function(_0x48babc){logger[_0xdc4d('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3afeaf,_0x48babc);_0x54725a(_0x48babc);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index d35ec10..2a00643 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 _0xff6b=['get','/describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index'];(function(_0x201211,_0x2e2788){var _0x3641da=function(_0xfb58b4){while(--_0xfb58b4){_0x201211['push'](_0x201211['shift']());}};_0x3641da(++_0x2e2788);}(_0xff6b,0xe6));var _0xbff6=function(_0x184fec,_0x5ba796){_0x184fec=_0x184fec-0x0;var _0x5aa2a9=_0xff6b[_0x184fec];return _0x5aa2a9;};'use strict';var multer=require('multer');var util=require(_0xbff6('0x0'));var path=require(_0xbff6('0x1'));var timeout=require(_0xbff6('0x2'));var express=require('express');var router=express[_0xbff6('0x3')]();var fs_extra=require(_0xbff6('0x4'));var auth=require(_0xbff6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbff6('0x6'));var controller=require(_0xbff6('0x7'));router['get']('/',auth[_0xbff6('0x8')](),controller[_0xbff6('0x9')]);router[_0xbff6('0xa')](_0xbff6('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xbff6('0xa')](_0xbff6('0xc'),auth[_0xbff6('0x8')](),controller[_0xbff6('0xd')]);router[_0xbff6('0xe')]('/',auth[_0xbff6('0x8')](),controller[_0xbff6('0xf')]);router[_0xbff6('0x10')](_0xbff6('0xc'),auth[_0xbff6('0x8')](),controller['update']);router[_0xbff6('0x11')](_0xbff6('0xc'),auth[_0xbff6('0x8')](),controller[_0xbff6('0x12')]);module[_0xbff6('0x13')]=router; \ No newline at end of file +var _0x2c12=['destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2c12,0x1c4));var _0x22c1=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x2c12[_0x3b76f7];return _0x43984e;};'use strict';var multer=require(_0x22c1('0x0'));var util=require(_0x22c1('0x1'));var path=require('path');var timeout=require(_0x22c1('0x2'));var express=require(_0x22c1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x22c1('0x4'));var config=require(_0x22c1('0x5'));var controller=require(_0x22c1('0x6'));router[_0x22c1('0x7')]('/',auth[_0x22c1('0x8')](),controller['index']);router[_0x22c1('0x7')](_0x22c1('0x9'),auth[_0x22c1('0x8')](),controller[_0x22c1('0xa')]);router[_0x22c1('0x7')](_0x22c1('0xb'),auth['isAuthenticated'](),controller[_0x22c1('0xc')]);router['post']('/',auth[_0x22c1('0x8')](),controller[_0x22c1('0xd')]);router[_0x22c1('0xe')]('/:id',auth[_0x22c1('0x8')](),controller[_0x22c1('0xf')]);router['delete']('/:id',auth[_0x22c1('0x8')](),controller[_0x22c1('0x10')]);module[_0x22c1('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 e731792..59e61e7 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 _0xcf25=['mouseOver','timeout','sequelize','STRING'];(function(_0x19bcfd,_0x38957b){var _0x25fdce=function(_0x3dbb2f){while(--_0x3dbb2f){_0x19bcfd['push'](_0x19bcfd['shift']());}};_0x25fdce(++_0x38957b);}(_0xcf25,0xe2));var _0x5cf2=function(_0x30fed4,_0x58ca83){_0x30fed4=_0x30fed4-0x0;var _0x500776=_0xcf25[_0x30fed4];return _0x500776;};'use strict';var Sequelize=require(_0x5cf2('0x0'));module['exports']={'name':{'type':Sequelize[_0x5cf2('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5cf2('0x2'),_0x5cf2('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x5cf2('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6ed2=['INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0xdb4892,_0x2ad9b4){var _0x11ba6b=function(_0x1be1d5){while(--_0x1be1d5){_0xdb4892['push'](_0xdb4892['shift']());}};_0x11ba6b(++_0x2ad9b4);}(_0x6ed2,0xce));var _0x26ed=function(_0x4628a1,_0x55ff29){_0x4628a1=_0x4628a1-0x0;var _0x492347=_0x6ed2[_0x4628a1];return _0x492347;};'use strict';var Sequelize=require(_0x26ed('0x0'));module[_0x26ed('0x1')]={'name':{'type':Sequelize[_0x26ed('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x26ed('0x3'),'timeout'),'defaultValue':_0x26ed('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x26ed('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 723f283..b67121f 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 _0x57d4=['mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','create','body','destroy','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0x57d4,0x78));var _0x457d=function(_0x144c63,_0x379efb){_0x144c63=_0x144c63-0x0;var _0x250a5d=_0x57d4[_0x144c63];return _0x250a5d;};'use strict';var emlformat=require(_0x457d('0x0'));var rimraf=require(_0x457d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x457d('0x2'));var rp=require(_0x457d('0x3'));var moment=require(_0x457d('0x4'));var BPromise=require(_0x457d('0x5'));var Mustache=require(_0x457d('0x6'));var util=require(_0x457d('0x7'));var path=require(_0x457d('0x8'));var sox=require(_0x457d('0x9'));var csv=require(_0x457d('0xa'));var ejs=require(_0x457d('0xb'));var fs=require('fs');var fs_extra=require(_0x457d('0xc'));var _=require('lodash');var squel=require(_0x457d('0xd'));var crypto=require(_0x457d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x457d('0xa'));var querystring=require(_0x457d('0xf'));var Papa=require(_0x457d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x457d('0x11'));var hardwareService=require(_0x457d('0x12'));var logger=require(_0x457d('0x13'))(_0x457d('0x14'));var utils=require(_0x457d('0x15'));var config=require(_0x457d('0x16'));var licenseUtil=require(_0x457d('0x17'));var db=require(_0x457d('0x18'))['db'];function respondWithStatusCode(_0xe7d200,_0x5abf49){_0x5abf49=_0x5abf49||0xcc;return function(_0x239a20){if(_0x239a20){return _0xe7d200[_0x457d('0x19')](_0x5abf49);}return _0xe7d200['status'](_0x5abf49)['end']();};}function respondWithResult(_0x44740f,_0x19ac04){_0x19ac04=_0x19ac04||0xc8;return function(_0x3e59d9){if(_0x3e59d9){return _0x44740f[_0x457d('0x1a')](_0x19ac04)[_0x457d('0x1b')](_0x3e59d9);}};}function respondWithFilteredResult(_0x3e62f8,_0xeac953){return function(_0x38cce1){if(_0x38cce1){var _0x55c6e4=typeof _0xeac953[_0x457d('0x1c')]===_0x457d('0x1d')&&typeof _0xeac953[_0x457d('0x1e')]==='undefined';var _0x4919da=_0x38cce1[_0x457d('0x1f')];var _0x4d988f=_0x55c6e4?0x0:_0xeac953[_0x457d('0x1c')];var _0x802f2b=_0x55c6e4?_0x38cce1['count']:_0xeac953[_0x457d('0x1c')]+_0xeac953['limit'];var _0x5e6400;if(_0x802f2b>=_0x4919da){_0x802f2b=_0x4919da;_0x5e6400=0xc8;}else{_0x5e6400=0xce;}_0x3e62f8[_0x457d('0x1a')](_0x5e6400);return _0x3e62f8[_0x457d('0x20')](_0x457d('0x21'),_0x4d988f+'-'+_0x802f2b+'/'+_0x4919da)[_0x457d('0x1b')](_0x38cce1);}return null;};}function patchUpdates(_0xc47d13){return function(_0x59c1b1){try{jsonpatch[_0x457d('0x22')](_0x59c1b1,_0xc47d13,!![]);}catch(_0x4141fc){return BPromise[_0x457d('0x23')](_0x4141fc);}return _0x59c1b1[_0x457d('0x24')]();};}function saveUpdates(_0x57f229,_0x4bf90d){return function(_0x4e2dff){if(_0x4e2dff){return _0x4e2dff[_0x457d('0x25')](_0x57f229)['then'](function(_0x5177cf){return _0x5177cf;});}return null;};}function removeEntity(_0x55bcb9,_0x206fdc){return function(_0x1eedc5){if(_0x1eedc5){return _0x1eedc5['destroy']()[_0x457d('0x26')](function(){_0x55bcb9[_0x457d('0x1a')](0xcc)[_0x457d('0x27')]();});}};}function handleEntityNotFound(_0x152cfc,_0x58991f){return function(_0x5d6554){if(!_0x5d6554){_0x152cfc[_0x457d('0x19')](0x194);}return _0x5d6554;};}function handleError(_0x47feed,_0x3d1ca7){_0x3d1ca7=_0x3d1ca7||0x1f4;return function(_0x21a102){logger[_0x457d('0x28')](_0x21a102[_0x457d('0x29')]);if(_0x21a102['name']){delete _0x21a102[_0x457d('0x2a')];}_0x47feed['status'](_0x3d1ca7)['send'](_0x21a102);};}exports[_0x457d('0x2b')]=function(_0x3f696d,_0x5eb50b){var _0x15e2d7={'raw':!![],'where':{'id':_0x3f696d['params']['id']}},_0x2d69d2={};_0x2d69d2[_0x457d('0x2c')]=_[_0x457d('0x2d')](db[_0x457d('0x2e')][_0x457d('0x2f')]);_0x2d69d2[_0x457d('0x30')]=_[_0x457d('0x2d')](_0x3f696d[_0x457d('0x30')]);_0x2d69d2[_0x457d('0x31')]=_[_0x457d('0x32')](_0x2d69d2[_0x457d('0x2c')],_0x2d69d2[_0x457d('0x30')]);_0x15e2d7[_0x457d('0x33')]=_[_0x457d('0x32')](_0x2d69d2[_0x457d('0x2c')],qs[_0x457d('0x34')](_0x3f696d[_0x457d('0x30')][_0x457d('0x34')]));_0x15e2d7[_0x457d('0x33')]=_0x15e2d7['attributes'][_0x457d('0x35')]?_0x15e2d7[_0x457d('0x33')]:_0x2d69d2['model'];if(_0x3f696d['query'][_0x457d('0x36')]){_0x15e2d7[_0x457d('0x37')]=[{'all':!![]}];}_0x15e2d7=_['merge']({},_0x15e2d7,_0x3f696d[_0x457d('0x38')]);return db[_0x457d('0x2e')][_0x457d('0x39')](_0x15e2d7)[_0x457d('0x26')](handleEntityNotFound(_0x5eb50b,null))[_0x457d('0x26')](respondWithResult(_0x5eb50b,null))[_0x457d('0x3a')](handleError(_0x5eb50b,null));};exports[_0x457d('0x3b')]=function(_0x61c817,_0x37bc38){return db[_0x457d('0x2e')][_0x457d('0x3b')](_0x61c817[_0x457d('0x3c')],{})[_0x457d('0x26')](respondWithResult(_0x37bc38,0xc9))[_0x457d('0x3a')](handleError(_0x37bc38,null));};exports[_0x457d('0x25')]=function(_0x4b29a1,_0x27811b){if(_0x4b29a1['body']['id']){delete _0x4b29a1['body']['id'];}return db['ChatProactiveAction'][_0x457d('0x39')]({'where':{'id':_0x4b29a1['params']['id']}})[_0x457d('0x26')](handleEntityNotFound(_0x27811b,null))['then'](saveUpdates(_0x4b29a1['body'],null))[_0x457d('0x26')](respondWithResult(_0x27811b,null))[_0x457d('0x3a')](handleError(_0x27811b,null));};exports[_0x457d('0x3d')]=function(_0x6cf64c,_0x14df5c){return db[_0x457d('0x2e')][_0x457d('0x39')]({'where':{'id':_0x6cf64c[_0x457d('0x3e')]['id']}})[_0x457d('0x26')](handleEntityNotFound(_0x14df5c,null))[_0x457d('0x26')](removeEntity(_0x14df5c,null))[_0x457d('0x3a')](handleError(_0x14df5c,null));}; \ No newline at end of file +var _0x535d=['eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','offset','set','Content-Range','reject','save','update','destroy','stack','name','send','show','ChatProactiveAction','rawAttributes','query','keys','model','attributes','intersection','fields','length','includeAll','merge','options','find','then','create','body','params','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x535d,0xe8));var _0xd535=function(_0x264bec,_0x446d01){_0x264bec=_0x264bec-0x0;var _0x19231b=_0x535d[_0x264bec];return _0x19231b;};'use strict';var emlformat=require(_0xd535('0x0'));var rimraf=require(_0xd535('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd535('0x2'));var rp=require(_0xd535('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd535('0x4'));var util=require(_0xd535('0x5'));var path=require(_0xd535('0x6'));var sox=require(_0xd535('0x7'));var csv=require(_0xd535('0x8'));var ejs=require(_0xd535('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd535('0xa'));var crypto=require(_0xd535('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd535('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd535('0xd'));var Papa=require(_0xd535('0xe'));var Redis=require(_0xd535('0xf'));var authService=require(_0xd535('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd535('0x11'));var hardwareService=require(_0xd535('0x12'));var logger=require(_0xd535('0x13'))(_0xd535('0x14'));var utils=require('../../config/utils');var config=require(_0xd535('0x15'));var licenseUtil=require(_0xd535('0x16'));var db=require(_0xd535('0x17'))['db'];function respondWithStatusCode(_0x7aab34,_0x352bf3){_0x352bf3=_0x352bf3||0xcc;return function(_0x3fd304){if(_0x3fd304){return _0x7aab34[_0xd535('0x18')](_0x352bf3);}return _0x7aab34['status'](_0x352bf3)[_0xd535('0x19')]();};}function respondWithResult(_0x52f768,_0x5c659d){_0x5c659d=_0x5c659d||0xc8;return function(_0x2b3e1b){if(_0x2b3e1b){return _0x52f768[_0xd535('0x1a')](_0x5c659d)['json'](_0x2b3e1b);}};}function respondWithFilteredResult(_0x2078ad,_0x338042){return function(_0x29e478){if(_0x29e478){var _0x500675=typeof _0x338042['offset']===_0xd535('0x1b')&&typeof _0x338042[_0xd535('0x1c')]===_0xd535('0x1b');var _0xb3cc32=_0x29e478['count'];var _0x921b2e=_0x500675?0x0:_0x338042['offset'];var _0x22d4e2=_0x500675?_0x29e478['count']:_0x338042[_0xd535('0x1d')]+_0x338042['limit'];var _0x2d7338;if(_0x22d4e2>=_0xb3cc32){_0x22d4e2=_0xb3cc32;_0x2d7338=0xc8;}else{_0x2d7338=0xce;}_0x2078ad[_0xd535('0x1a')](_0x2d7338);return _0x2078ad[_0xd535('0x1e')](_0xd535('0x1f'),_0x921b2e+'-'+_0x22d4e2+'/'+_0xb3cc32)['json'](_0x29e478);}return null;};}function patchUpdates(_0x4b11d9){return function(_0x185966){try{jsonpatch['apply'](_0x185966,_0x4b11d9,!![]);}catch(_0x5c4afa){return BPromise[_0xd535('0x20')](_0x5c4afa);}return _0x185966[_0xd535('0x21')]();};}function saveUpdates(_0x283d41,_0x11187d){return function(_0x3cad49){if(_0x3cad49){return _0x3cad49[_0xd535('0x22')](_0x283d41)['then'](function(_0x8e32ee){return _0x8e32ee;});}return null;};}function removeEntity(_0x34106a,_0x42008f){return function(_0x7cc1ef){if(_0x7cc1ef){return _0x7cc1ef[_0xd535('0x23')]()['then'](function(){_0x34106a['status'](0xcc)[_0xd535('0x19')]();});}};}function handleEntityNotFound(_0x1abfec,_0x482d00){return function(_0x4aa746){if(!_0x4aa746){_0x1abfec[_0xd535('0x18')](0x194);}return _0x4aa746;};}function handleError(_0x1995ee,_0x13cdb2){_0x13cdb2=_0x13cdb2||0x1f4;return function(_0x551a99){logger['error'](_0x551a99[_0xd535('0x24')]);if(_0x551a99[_0xd535('0x25')]){delete _0x551a99[_0xd535('0x25')];}_0x1995ee[_0xd535('0x1a')](_0x13cdb2)[_0xd535('0x26')](_0x551a99);};}exports[_0xd535('0x27')]=function(_0x231736,_0x4b1e24){var _0xcecc70={'raw':!![],'where':{'id':_0x231736['params']['id']}},_0x3ea7f7={};_0x3ea7f7['model']=_['keys'](db[_0xd535('0x28')][_0xd535('0x29')]);_0x3ea7f7[_0xd535('0x2a')]=_[_0xd535('0x2b')](_0x231736[_0xd535('0x2a')]);_0x3ea7f7['filters']=_['intersection'](_0x3ea7f7[_0xd535('0x2c')],_0x3ea7f7[_0xd535('0x2a')]);_0xcecc70[_0xd535('0x2d')]=_[_0xd535('0x2e')](_0x3ea7f7['model'],qs[_0xd535('0x2f')](_0x231736[_0xd535('0x2a')][_0xd535('0x2f')]));_0xcecc70[_0xd535('0x2d')]=_0xcecc70[_0xd535('0x2d')][_0xd535('0x30')]?_0xcecc70['attributes']:_0x3ea7f7[_0xd535('0x2c')];if(_0x231736[_0xd535('0x2a')][_0xd535('0x31')]){_0xcecc70['include']=[{'all':!![]}];}_0xcecc70=_[_0xd535('0x32')]({},_0xcecc70,_0x231736[_0xd535('0x33')]);return db[_0xd535('0x28')][_0xd535('0x34')](_0xcecc70)[_0xd535('0x35')](handleEntityNotFound(_0x4b1e24,null))['then'](respondWithResult(_0x4b1e24,null))['catch'](handleError(_0x4b1e24,null));};exports['create']=function(_0x17bf49,_0x2ccd79){return db[_0xd535('0x28')][_0xd535('0x36')](_0x17bf49[_0xd535('0x37')],{})[_0xd535('0x35')](respondWithResult(_0x2ccd79,0xc9))['catch'](handleError(_0x2ccd79,null));};exports['update']=function(_0x2a96c8,_0x49cb56){if(_0x2a96c8[_0xd535('0x37')]['id']){delete _0x2a96c8['body']['id'];}return db[_0xd535('0x28')]['find']({'where':{'id':_0x2a96c8[_0xd535('0x38')]['id']}})['then'](handleEntityNotFound(_0x49cb56,null))[_0xd535('0x35')](saveUpdates(_0x2a96c8[_0xd535('0x37')],null))[_0xd535('0x35')](respondWithResult(_0x49cb56,null))[_0xd535('0x39')](handleError(_0x49cb56,null));};exports['destroy']=function(_0x35db72,_0x314fce){return db['ChatProactiveAction'][_0xd535('0x34')]({'where':{'id':_0x35db72[_0xd535('0x38')]['id']}})[_0xd535('0x35')](handleEntityNotFound(_0x314fce,null))[_0xd535('0x35')](removeEntity(_0x314fce,null))[_0xd535('0x39')](handleError(_0x314fce,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 57c8572..1290307 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 _0xdb15=['define','chat_proactive_actions','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xdb15,0xe9));var _0x5db1=function(_0x3a08ee,_0x37f434){_0x3a08ee=_0x3a08ee-0x0;var _0x40c383=_0xdb15[_0x3a08ee];return _0x40c383;};'use strict';var _=require(_0x5db1('0x0'));var util=require('util');var logger=require(_0x5db1('0x1'))('api');var moment=require(_0x5db1('0x2'));var BPromise=require(_0x5db1('0x3'));var rp=require(_0x5db1('0x4'));var fs=require('fs');var path=require(_0x5db1('0x5'));var rimraf=require(_0x5db1('0x6'));var config=require(_0x5db1('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x5db1('0x8')]=function(_0x5ed84f,_0x321009){return _0x5ed84f[_0x5db1('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x5db1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc79c=['moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','api'];(function(_0x4cac5b,_0x4aa6fe){var _0x42f947=function(_0x58b29e){while(--_0x58b29e){_0x4cac5b['push'](_0x4cac5b['shift']());}};_0x42f947(++_0x4aa6fe);}(_0xc79c,0x149));var _0xcc79=function(_0x1ebebe,_0x438447){_0x1ebebe=_0x1ebebe-0x0;var _0x5a129b=_0xc79c[_0x1ebebe];return _0x5a129b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xcc79('0x0'));var moment=require(_0xcc79('0x1'));var BPromise=require('bluebird');var rp=require(_0xcc79('0x2'));var fs=require('fs');var path=require(_0xcc79('0x3'));var rimraf=require(_0xcc79('0x4'));var config=require(_0xcc79('0x5'));var attributes=require(_0xcc79('0x6'));module[_0xcc79('0x7')]=function(_0x200e50,_0x1d993f){return _0x200e50[_0xcc79('0x8')](_0xcc79('0x9'),attributes,{'tableName':_0xcc79('0xa'),'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 eab5636..fb81324 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 _0x402c=['info','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x21f6fe,_0x575190){var _0x3a3779=function(_0x3858ac){while(--_0x3858ac){_0x21f6fe['push'](_0x21f6fe['shift']());}};_0x3a3779(++_0x575190);}(_0x402c,0xb9));var _0xc402=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0x402c[_0x5ed54b];return _0x4b58c7;};'use strict';var _=require(_0xc402('0x0'));var util=require(_0xc402('0x1'));var moment=require('moment');var BPromise=require(_0xc402('0x2'));var rs=require(_0xc402('0x3'));var fs=require('fs');var Redis=require(_0xc402('0x4'));var db=require(_0xc402('0x5'))['db'];var utils=require(_0xc402('0x6'));var logger=require(_0xc402('0x7'))('rpc');var config=require(_0xc402('0x8'));var jayson=require(_0xc402('0x9'));var client=jayson[_0xc402('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d8fe8,_0x30eed1,_0x1e4acf){return new BPromise(function(_0x38d04e,_0xadda37){return client[_0xc402('0xb')](_0x1d8fe8,_0x1e4acf)[_0xc402('0xc')](function(_0x45ba78){logger[_0xc402('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x30eed1,_0xc402('0xe'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x30eed1,_0xc402('0xe'),JSON[_0xc402('0xf')](_0x45ba78));if(_0x45ba78[_0xc402('0x10')]){if(_0x45ba78['error'][_0xc402('0x11')]===0x1f4){logger['error'](_0xc402('0x12'),_0x30eed1,_0x45ba78[_0xc402('0x10')][_0xc402('0x13')]);return _0xadda37(_0x45ba78[_0xc402('0x10')][_0xc402('0x13')]);}logger[_0xc402('0x10')](_0xc402('0x12'),_0x30eed1,_0x45ba78[_0xc402('0x10')][_0xc402('0x13')]);return _0x38d04e(_0x45ba78[_0xc402('0x10')][_0xc402('0x13')]);}else{logger[_0xc402('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x30eed1,'request\x20sent');_0x38d04e(_0x45ba78[_0xc402('0x14')]['message']);}})[_0xc402('0x15')](function(_0x57dfe0){logger[_0xc402('0x10')](_0xc402('0x12'),_0x30eed1,_0x57dfe0);_0xadda37(_0x57dfe0);});});} \ No newline at end of file +var _0x5cd9=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','error','code','message','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x24910f,_0xec4bde){var _0x197f1a=function(_0x581d55){while(--_0x581d55){_0x24910f['push'](_0x24910f['shift']());}};_0x197f1a(++_0xec4bde);}(_0x5cd9,0x6a));var _0x95cd=function(_0x4a2192,_0x47be01){_0x4a2192=_0x4a2192-0x0;var _0x12c953=_0x5cd9[_0x4a2192];return _0x12c953;};'use strict';var _=require(_0x95cd('0x0'));var util=require(_0x95cd('0x1'));var moment=require(_0x95cd('0x2'));var BPromise=require(_0x95cd('0x3'));var rs=require(_0x95cd('0x4'));var fs=require('fs');var Redis=require(_0x95cd('0x5'));var db=require(_0x95cd('0x6'))['db'];var utils=require(_0x95cd('0x7'));var logger=require(_0x95cd('0x8'))('rpc');var config=require(_0x95cd('0x9'));var jayson=require(_0x95cd('0xa'));var client=jayson['client'][_0x95cd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a6298,_0x57efbe,_0x4ecc54){return new BPromise(function(_0x53b1e1,_0x33464f){return client['request'](_0x3a6298,_0x4ecc54)[_0x95cd('0xc')](function(_0x40cdc8){logger[_0x95cd('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x57efbe,_0x95cd('0xe'));logger[_0x95cd('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x57efbe,_0x95cd('0xe'),JSON['stringify'](_0x40cdc8));if(_0x40cdc8[_0x95cd('0x10')]){if(_0x40cdc8['error'][_0x95cd('0x11')]===0x1f4){logger[_0x95cd('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x57efbe,_0x40cdc8[_0x95cd('0x10')][_0x95cd('0x12')]);return _0x33464f(_0x40cdc8[_0x95cd('0x10')][_0x95cd('0x12')]);}logger['error'](_0x95cd('0x13'),_0x57efbe,_0x40cdc8['error']['message']);return _0x53b1e1(_0x40cdc8[_0x95cd('0x10')][_0x95cd('0x12')]);}else{logger[_0x95cd('0xd')](_0x95cd('0x13'),_0x57efbe,_0x95cd('0xe'));_0x53b1e1(_0x40cdc8[_0x95cd('0x14')][_0x95cd('0x12')]);}})['catch'](function(_0x5d2771){logger[_0x95cd('0x10')](_0x95cd('0x13'),_0x57efbe,_0x5d2771);_0x33464f(_0x5d2771);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 1754441..79f95a0 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 _0x5d58=['/:id','isAuthenticated','show','create','update','delete','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0x5d58,0x187));var _0x85d5=function(_0x57e91d,_0x29a250){_0x57e91d=_0x57e91d-0x0;var _0xe29cee=_0x5d58[_0x57e91d];return _0xe29cee;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./chatProactiveAction.controller');router[_0x85d5('0x4')](_0x85d5('0x5'),auth[_0x85d5('0x6')](),controller[_0x85d5('0x7')]);router['post']('/',auth[_0x85d5('0x6')](),controller[_0x85d5('0x8')]);router['put'](_0x85d5('0x5'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')](_0x85d5('0x5'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x71ab=['get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x71ab,0x64));var _0xb71a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x71ab[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0xa')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xf')]);router[_0xb71a('0x10')]('/:id',auth[_0xb71a('0xa')](),controller['destroy']);module[_0xb71a('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 955567d..be28a07 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 _0xe579=['sequelize','exports','STRING','name','INTEGER','beepall','roundrobin'];(function(_0x547fe8,_0x584058){var _0x2f5a35=function(_0x4763df){while(--_0x4763df){_0x547fe8['push'](_0x547fe8['shift']());}};_0x2f5a35(++_0x584058);}(_0xe579,0x69));var _0x9e57=function(_0x4af9fd,_0x3f681d){_0x4af9fd=_0x4af9fd-0x0;var _0x504cce=_0xe579[_0x4af9fd];return _0x504cce;};'use strict';var Sequelize=require(_0x9e57('0x0'));module[_0x9e57('0x1')]={'name':{'type':Sequelize[_0x9e57('0x2')],'unique':_0x9e57('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9e57('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x9e57('0x5'),_0x9e57('0x6'))}}; \ No newline at end of file +var _0x6db5=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall'];(function(_0x22bd91,_0x182c31){var _0x530b8e=function(_0x4c6ce6){while(--_0x4c6ce6){_0x22bd91['push'](_0x22bd91['shift']());}};_0x530b8e(++_0x182c31);}(_0x6db5,0x10a));var _0x56db=function(_0x4ce95a,_0x5990f6){_0x4ce95a=_0x4ce95a-0x0;var _0x32add0=_0x6db5[_0x4ce95a];return _0x32add0;};'use strict';var Sequelize=require(_0x56db('0x0'));module[_0x56db('0x1')]={'name':{'type':Sequelize[_0x56db('0x2')],'unique':_0x56db('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x56db('0x2')]},'timeout':{'type':Sequelize[_0x56db('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x56db('0x5')]('rrmemory',_0x56db('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 812730e..00837ae 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 _0x50a8=['every','TeamId','includes','all','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','ChatQueue,\x20%s,\x20%s','message','catch','sendStatus','status','end','limit','offset','count','Content-Range','json','apply','reject','update','then','destroy','get','stack','name','send','index','map','ChatQueue','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','pick','filter','where','merge','VIRTUAL','options','include','rows','params','rawAttributes','length','create','body','user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','nolimit','sort','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','forEach','emit','userChatQueue:save','removeTeams','Team','ids','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','QueryTypes'];(function(_0x2bb3f6,_0x25fde0){var _0x62b339=function(_0x53e014){while(--_0x53e014){_0x2bb3f6['push'](_0x2bb3f6['shift']());}};_0x62b339(++_0x25fde0);}(_0x50a8,0x99));var _0x850a=function(_0x467488,_0x38c7ae){_0x467488=_0x467488-0x0;var _0x56107f=_0x50a8[_0x467488];return _0x56107f;};'use strict';var emlformat=require(_0x850a('0x0'));var rimraf=require(_0x850a('0x1'));var zipdir=require(_0x850a('0x2'));var jsonpatch=require(_0x850a('0x3'));var rp=require('request-promise');var moment=require(_0x850a('0x4'));var BPromise=require(_0x850a('0x5'));var Mustache=require('mustache');var util=require(_0x850a('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x850a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x850a('0x8'));var squel=require(_0x850a('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x850a('0xa'));var toCsv=require(_0x850a('0xb'));var querystring=require(_0x850a('0xc'));var Papa=require(_0x850a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x850a('0xe'));var as=require(_0x850a('0xf'));var hardwareService=require(_0x850a('0x10'));var logger=require(_0x850a('0x11'))(_0x850a('0x12'));var utils=require(_0x850a('0x13'));var config=require(_0x850a('0x14'));var licenseUtil=require(_0x850a('0x15'));var db=require(_0x850a('0x16'))['db'];config[_0x850a('0x17')]=_[_0x850a('0x18')](config[_0x850a('0x17')],{'host':_0x850a('0x19'),'port':0x18eb});var socket=require(_0x850a('0x1a'))(new Redis(config[_0x850a('0x17')]));require('./chatQueue.socket')[_0x850a('0x1b')](socket);var jayson=require(_0x850a('0x1c'));var client=jayson[_0x850a('0x1d')][_0x850a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4da501,_0x37b50f,_0x81e4d0,_0x499625){return new BPromise(function(_0x3faadc,_0x4a6217){var _0x57be2d=_0x499625||client;return _0x57be2d[_0x850a('0x1f')](_0x4da501,_0x81e4d0)['then'](function(_0x58513f){logger[_0x850a('0x20')]('ChatQueue,\x20%s,\x20%s',_0x37b50f,_0x850a('0x21'));logger['debug'](_0x850a('0x22'),_0x37b50f,'request\x20sent',JSON['stringify'](_0x58513f));if(_0x58513f[_0x850a('0x23')]){if(_0x58513f[_0x850a('0x23')]['code']===0x1f4){logger[_0x850a('0x23')](_0x850a('0x24'),_0x37b50f,_0x58513f[_0x850a('0x23')]['message']);return _0x4a6217(_0x58513f['error'][_0x850a('0x25')]);}logger['error'](_0x850a('0x24'),_0x37b50f,_0x58513f[_0x850a('0x23')][_0x850a('0x25')]);return _0x3faadc(_0x58513f['error'][_0x850a('0x25')]);}else{logger[_0x850a('0x20')](_0x850a('0x24'),_0x37b50f,_0x850a('0x21'));_0x3faadc(_0x58513f['result']['message']);}})[_0x850a('0x26')](function(_0x4596b9){logger[_0x850a('0x23')](_0x850a('0x24'),_0x37b50f,_0x4596b9);_0x4a6217(_0x4596b9);});});}function respondWithStatusCode(_0xf465e9,_0xefc904){_0xefc904=_0xefc904||0xcc;return function(_0x5d4e72){if(_0x5d4e72){return _0xf465e9[_0x850a('0x27')](_0xefc904);}return _0xf465e9[_0x850a('0x28')](_0xefc904)[_0x850a('0x29')]();};}function respondWithResult(_0x354b02,_0x58a108){_0x58a108=_0x58a108||0xc8;return function(_0x41e717){if(_0x41e717){return _0x354b02['status'](_0x58a108)['json'](_0x41e717);}};}function respondWithFilteredResult(_0x51e6c,_0x2cc55a){return function(_0x3d214d){if(_0x3d214d){var _0x21eb32=typeof _0x2cc55a['offset']==='undefined'&&typeof _0x2cc55a[_0x850a('0x2a')]==='undefined';var _0x2c9b54=_0x3d214d['count'];var _0x12681d=_0x21eb32?0x0:_0x2cc55a[_0x850a('0x2b')];var _0x5a8331=_0x21eb32?_0x3d214d[_0x850a('0x2c')]:_0x2cc55a['offset']+_0x2cc55a[_0x850a('0x2a')];var _0x3cd7df;if(_0x5a8331>=_0x2c9b54){_0x5a8331=_0x2c9b54;_0x3cd7df=0xc8;}else{_0x3cd7df=0xce;}_0x51e6c[_0x850a('0x28')](_0x3cd7df);return _0x51e6c['set'](_0x850a('0x2d'),_0x12681d+'-'+_0x5a8331+'/'+_0x2c9b54)[_0x850a('0x2e')](_0x3d214d);}return null;};}function patchUpdates(_0x38442a){return function(_0x1b7bcb){try{jsonpatch[_0x850a('0x2f')](_0x1b7bcb,_0x38442a,!![]);}catch(_0x119c49){return BPromise[_0x850a('0x30')](_0x119c49);}return _0x1b7bcb['save']();};}function saveUpdates(_0x234802,_0x774c48){return function(_0x55dc14){if(_0x55dc14){return _0x55dc14[_0x850a('0x31')](_0x234802)[_0x850a('0x32')](function(_0x190ad1){return _0x190ad1;});}return null;};}function removeEntity(_0xd2da7c,_0x2fafad){return function(_0x17e1a4){if(_0x17e1a4){return _0x17e1a4[_0x850a('0x33')]()[_0x850a('0x32')](function(){var _0x342078=_0x17e1a4[_0x850a('0x34')]({'plain':!![]});var _0x2912e1='ChatQueues';return db['UserProfileResource'][_0x850a('0x33')]({'where':{'type':_0x2912e1,'resourceId':_0x342078['id']}})[_0x850a('0x32')](function(){return _0x17e1a4;});})[_0x850a('0x32')](function(){_0xd2da7c[_0x850a('0x28')](0xcc)[_0x850a('0x29')]();});}};}function handleEntityNotFound(_0x4233e2,_0x131dcb){return function(_0x299394){if(!_0x299394){_0x4233e2[_0x850a('0x27')](0x194);}return _0x299394;};}function handleError(_0x5d0e49,_0x541939){_0x541939=_0x541939||0x1f4;return function(_0x3e904f){logger[_0x850a('0x23')](_0x3e904f[_0x850a('0x35')]);if(_0x3e904f[_0x850a('0x36')]){delete _0x3e904f[_0x850a('0x36')];}_0x5d0e49[_0x850a('0x28')](_0x541939)[_0x850a('0x37')](_0x3e904f);};}exports[_0x850a('0x38')]=function(_0x340980,_0x1c540c){var _0x17d0e2={},_0x2ccf79={},_0x2c166f={'count':0x0,'rows':[]};var _0x967869=_[_0x850a('0x39')](db[_0x850a('0x3a')]['rawAttributes'],function(_0x168be1){return{'name':_0x168be1[_0x850a('0x3b')],'type':_0x168be1[_0x850a('0x3c')]['key']};});_0x2ccf79[_0x850a('0x3d')]=_[_0x850a('0x39')](_0x967869,_0x850a('0x36'));_0x2ccf79[_0x850a('0x3e')]=_[_0x850a('0x3f')](_0x340980[_0x850a('0x3e')]);_0x2ccf79[_0x850a('0x40')]=_[_0x850a('0x41')](_0x2ccf79['model'],_0x2ccf79[_0x850a('0x3e')]);_0x17d0e2['attributes']=_[_0x850a('0x41')](_0x2ccf79[_0x850a('0x3d')],qs[_0x850a('0x42')](_0x340980['query']['fields']));_0x17d0e2[_0x850a('0x43')]=_0x17d0e2['attributes']['length']?_0x17d0e2[_0x850a('0x43')]:_0x2ccf79[_0x850a('0x3d')];if(!_0x340980[_0x850a('0x3e')][_0x850a('0x44')]('nolimit')){_0x17d0e2['limit']=qs['limit'](_0x340980[_0x850a('0x3e')][_0x850a('0x2a')]);_0x17d0e2[_0x850a('0x2b')]=qs[_0x850a('0x2b')](_0x340980[_0x850a('0x3e')]['offset']);}_0x17d0e2[_0x850a('0x45')]=qs['sort'](_0x340980[_0x850a('0x3e')]['sort']);_0x17d0e2['where']=qs[_0x850a('0x40')](_[_0x850a('0x46')](_0x340980[_0x850a('0x3e')],_0x2ccf79['filters']),_0x967869);if(_0x340980[_0x850a('0x3e')][_0x850a('0x47')]){_0x17d0e2[_0x850a('0x48')]=_[_0x850a('0x49')](_0x17d0e2[_0x850a('0x48')],{'$or':_[_0x850a('0x39')](_0x967869,function(_0x495235){if(_0x495235[_0x850a('0x3c')]!==_0x850a('0x4a')){var _0x356e3f={};_0x356e3f[_0x495235[_0x850a('0x36')]]={'$like':'%'+_0x340980[_0x850a('0x3e')][_0x850a('0x47')]+'%'};return _0x356e3f;}})});}_0x17d0e2=_[_0x850a('0x49')]({},_0x17d0e2,_0x340980[_0x850a('0x4b')]);var _0x145bae={'where':_0x17d0e2['where']};return db[_0x850a('0x3a')][_0x850a('0x2c')](_0x145bae)['then'](function(_0x329995){_0x2c166f[_0x850a('0x2c')]=_0x329995;if(_0x340980[_0x850a('0x3e')]['includeAll']){_0x17d0e2[_0x850a('0x4c')]=[{'all':!![]}];}return db[_0x850a('0x3a')]['findAll'](_0x17d0e2);})[_0x850a('0x32')](function(_0x2422d5){_0x2c166f[_0x850a('0x4d')]=_0x2422d5;return _0x2c166f;})[_0x850a('0x32')](respondWithFilteredResult(_0x1c540c,_0x17d0e2))['catch'](handleError(_0x1c540c,null));};exports['show']=function(_0x244e98,_0x3fcffe){var _0x56bfc1={'raw':!![],'where':{'id':_0x244e98[_0x850a('0x4e')]['id']}},_0x90b28b={};_0x90b28b[_0x850a('0x3d')]=_[_0x850a('0x3f')](db[_0x850a('0x3a')][_0x850a('0x4f')]);_0x90b28b[_0x850a('0x3e')]=_['keys'](_0x244e98['query']);_0x90b28b[_0x850a('0x40')]=_['intersection'](_0x90b28b[_0x850a('0x3d')],_0x90b28b[_0x850a('0x3e')]);_0x56bfc1[_0x850a('0x43')]=_[_0x850a('0x41')](_0x90b28b[_0x850a('0x3d')],qs['fields'](_0x244e98[_0x850a('0x3e')][_0x850a('0x42')]));_0x56bfc1['attributes']=_0x56bfc1[_0x850a('0x43')][_0x850a('0x50')]?_0x56bfc1[_0x850a('0x43')]:_0x90b28b[_0x850a('0x3d')];if(_0x244e98[_0x850a('0x3e')]['includeAll']){_0x56bfc1['include']=[{'all':!![]}];}_0x56bfc1=_[_0x850a('0x49')]({},_0x56bfc1,_0x244e98[_0x850a('0x4b')]);return db[_0x850a('0x3a')]['find'](_0x56bfc1)[_0x850a('0x32')](handleEntityNotFound(_0x3fcffe,null))[_0x850a('0x32')](respondWithResult(_0x3fcffe,null))[_0x850a('0x26')](handleError(_0x3fcffe,null));};exports[_0x850a('0x51')]=function(_0x42b419,_0x191fe2){return db[_0x850a('0x3a')]['create'](_0x42b419[_0x850a('0x52')],{})[_0x850a('0x32')](function(_0x5ba72f){var _0x2246f5=_0x42b419[_0x850a('0x53')][_0x850a('0x34')]({'plain':!![]});if(!_0x2246f5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2246f5[_0x850a('0x54')]===_0x850a('0x53')){var _0x27f73e=_0x5ba72f[_0x850a('0x34')]({'plain':!![]});var _0x562d82='ChatQueues';return db['UserProfileSection'][_0x850a('0x55')]({'where':{'name':_0x562d82,'userProfileId':_0x2246f5[_0x850a('0x56')]},'raw':!![]})[_0x850a('0x32')](function(_0x2c8102){if(_0x2c8102&&_0x2c8102['autoAssociation']===0x0){return db['UserProfileResource'][_0x850a('0x51')]({'name':_0x27f73e['name'],'resourceId':_0x27f73e['id'],'type':_0x2c8102['name'],'sectionId':_0x2c8102['id']},{})[_0x850a('0x32')](function(){return _0x5ba72f;});}else{return _0x5ba72f;}})[_0x850a('0x26')](function(_0x3e494f){logger[_0x850a('0x23')](_0x850a('0x57'),_0x3e494f);throw _0x3e494f;});}return _0x5ba72f;})[_0x850a('0x32')](respondWithResult(_0x191fe2,0xc9))[_0x850a('0x26')](handleError(_0x191fe2,null));};exports[_0x850a('0x31')]=function(_0x58c256,_0x47d653){if(_0x58c256[_0x850a('0x52')]['id']){delete _0x58c256[_0x850a('0x52')]['id'];}return db['ChatQueue'][_0x850a('0x55')]({'where':{'id':_0x58c256[_0x850a('0x4e')]['id']}})[_0x850a('0x32')](handleEntityNotFound(_0x47d653,null))['then'](saveUpdates(_0x58c256[_0x850a('0x52')],null))['then'](respondWithResult(_0x47d653,null))['catch'](handleError(_0x47d653,null));};exports['destroy']=function(_0x5513e2,_0x537216){return db[_0x850a('0x3a')][_0x850a('0x55')]({'where':{'id':_0x5513e2['params']['id']}})[_0x850a('0x32')](handleEntityNotFound(_0x537216,null))[_0x850a('0x32')](removeEntity(_0x537216,null))[_0x850a('0x26')](handleError(_0x537216,null));};exports[_0x850a('0x58')]=function(_0x38b16f,_0x510c1e){return db[_0x850a('0x3a')][_0x850a('0x58')]()[_0x850a('0x32')](respondWithResult(_0x510c1e,null))['catch'](handleError(_0x510c1e,null));};exports['getMembers']=function(_0x178650,_0x31566d,_0xb27826){var _0x468419={'raw':!![],'where':{}},_0x20aa0f={},_0x388ca2;return db[_0x850a('0x3a')][_0x850a('0x59')]({'where':{'id':_0x178650[_0x850a('0x4e')]['id']}})[_0x850a('0x32')](handleEntityNotFound(_0x31566d,null))[_0x850a('0x32')](function(_0x382f29){if(_0x382f29){_0x388ca2=_0x382f29[_0x850a('0x34')]({'plain':!![]});_0x20aa0f[_0x850a('0x3d')]=_[_0x850a('0x3f')](db[_0x850a('0x5a')][_0x850a('0x4f')]);_0x20aa0f[_0x850a('0x3e')]=_[_0x850a('0x3f')](_0x178650['query']);_0x20aa0f[_0x850a('0x40')]=_[_0x850a('0x41')](_0x20aa0f[_0x850a('0x3d')],_0x20aa0f[_0x850a('0x3e')]);_0x468419['attributes']=_[_0x850a('0x41')](_0x20aa0f[_0x850a('0x3d')],qs['fields'](_0x178650['query'][_0x850a('0x42')]));_0x468419['attributes']=_0x468419['attributes'][_0x850a('0x50')]?_0x468419[_0x850a('0x43')]:_0x20aa0f[_0x850a('0x3d')];if(!_0x178650[_0x850a('0x3e')]['hasOwnProperty'](_0x850a('0x5b'))){_0x468419['limit']=qs[_0x850a('0x2a')](_0x178650[_0x850a('0x3e')][_0x850a('0x2a')]);_0x468419[_0x850a('0x2b')]=qs[_0x850a('0x2b')](_0x178650[_0x850a('0x3e')][_0x850a('0x2b')]);}_0x468419[_0x850a('0x45')]=qs[_0x850a('0x5c')](_0x178650['query'][_0x850a('0x5c')]);_0x468419['where']=qs[_0x850a('0x40')](_['pick'](_0x178650[_0x850a('0x3e')],_0x20aa0f['filters']));_0x468419[_0x850a('0x48')][_0x850a('0x5d')]=_0x382f29['id'];if(_0x178650['query'][_0x850a('0x47')]){_0x468419[_0x850a('0x48')]=_[_0x850a('0x49')](_0x468419[_0x850a('0x48')],{'$or':_[_0x850a('0x39')](_0x468419['attributes'],function(_0x4cf510){var _0x4a1e52={};_0x4a1e52[_0x4cf510]={'$like':'%'+_0x178650[_0x850a('0x3e')][_0x850a('0x47')]+'%'};return _0x4a1e52;})});}_0x468419=_['merge']({},_0x468419,_0x178650[_0x850a('0x4b')]);return db[_0x850a('0x5a')][_0x850a('0x5e')](_0x468419);}})[_0x850a('0x32')](function(_0x48e9ff){if(_0x48e9ff){return db[_0x850a('0x5f')][_0x850a('0x60')]({'where':{'id':_['map'](_0x48e9ff,_0x850a('0x61')),'role':_0x850a('0x62')},'attributes':['id',_0x850a('0x36'),_0x850a('0x63'),_0x850a('0x64'),_0x850a('0x65')]});}})['then'](function(_0x3239ca){if(_0x3239ca){return{'count':_0x3239ca[_0x850a('0x2c')],'rows':_['map'](_0x3239ca[_0x850a('0x4d')],function(_0x2bb337){return{'membername':_0x2bb337[_0x850a('0x36')],'UserId':_0x2bb337['id'],'queue_name':_0x388ca2[_0x850a('0x36')],'ChatQueueId':_0x388ca2['id'],'interface':util[_0x850a('0x66')](_0x850a('0x67'),_0x850a('0x68'),_0x2bb337['name']),'penalty':0x0,'paused':_0x2bb337['chatPause'],'createdAt':_0x2bb337[_0x850a('0x65')],'updatedAt':_0x2bb337[_0x850a('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x31566d,_0x468419))['catch'](handleError(_0x31566d,null));};exports['getTeams']=function(_0x22db81,_0x1f3b52,_0x3e0744){var _0x40e617={};var _0x6459c4={};var _0x292cf7;var _0x2c9808;return db['ChatQueue']['findOne']({'where':{'id':_0x22db81[_0x850a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1f3b52,null))['then'](function(_0x4dc0f3){if(_0x4dc0f3){_0x292cf7=_0x4dc0f3;_0x6459c4[_0x850a('0x3d')]=_[_0x850a('0x3f')](db['Team'][_0x850a('0x4f')]);_0x6459c4[_0x850a('0x3e')]=_[_0x850a('0x3f')](_0x22db81[_0x850a('0x3e')]);_0x6459c4[_0x850a('0x40')]=_['intersection'](_0x6459c4[_0x850a('0x3d')],_0x6459c4['query']);_0x40e617[_0x850a('0x43')]=_[_0x850a('0x41')](_0x6459c4[_0x850a('0x3d')],qs[_0x850a('0x42')](_0x22db81[_0x850a('0x3e')][_0x850a('0x42')]));_0x40e617['attributes']=_0x40e617[_0x850a('0x43')][_0x850a('0x50')]?_0x40e617[_0x850a('0x43')]:_0x6459c4[_0x850a('0x3d')];_0x40e617['order']=qs[_0x850a('0x5c')](_0x22db81[_0x850a('0x3e')][_0x850a('0x5c')]);_0x40e617[_0x850a('0x48')]=qs[_0x850a('0x40')](_['pick'](_0x22db81[_0x850a('0x3e')],_0x6459c4[_0x850a('0x40')]));if(_0x22db81['query'][_0x850a('0x47')]){_0x40e617[_0x850a('0x48')]=_[_0x850a('0x49')](_0x40e617[_0x850a('0x48')],{'$or':_[_0x850a('0x39')](_0x40e617[_0x850a('0x43')],function(_0x55f0a4){var _0x56a649={};_0x56a649[_0x55f0a4]={'$like':'%'+_0x22db81[_0x850a('0x3e')][_0x850a('0x47')]+'%'};return _0x56a649;})});}_0x40e617=_[_0x850a('0x49')]({},_0x40e617,_0x22db81['options']);return _0x292cf7[_0x850a('0x69')](_0x40e617);}})[_0x850a('0x32')](function(_0x65e07b){if(_0x65e07b){_0x2c9808=_0x65e07b[_0x850a('0x50')];if(!_0x22db81[_0x850a('0x3e')][_0x850a('0x44')](_0x850a('0x5b'))){_0x40e617['limit']=qs[_0x850a('0x2a')](_0x22db81[_0x850a('0x3e')]['limit']);_0x40e617[_0x850a('0x2b')]=qs[_0x850a('0x2b')](_0x22db81['query'][_0x850a('0x2b')]);}return _0x292cf7[_0x850a('0x69')](_0x40e617);}})[_0x850a('0x32')](function(_0x767484){if(_0x767484){return _0x767484?{'count':_0x2c9808,'rows':_0x767484}:null;}})[_0x850a('0x32')](respondWithResult(_0x1f3b52,null))[_0x850a('0x26')](handleError(_0x1f3b52,null));};exports['addTeams']=function(_0x107f26,_0x4520c0,_0x504552){var _0x16a871=_0x107f26[_0x850a('0x52')]['ids'];return db['Team'][_0x850a('0x5e')]({'where':{'id':_0x16a871},'attributes':['id'],'include':[{'model':db['User'],'as':_0x850a('0x6a'),'attributes':['id',_0x850a('0x36'),_0x850a('0x6b'),_0x850a('0x6c'),'interface'],'raw':!![]}]})[_0x850a('0x32')](function(_0x53210f){if(_0x53210f){var _0x15282d=_[_0x850a('0x6d')](_0x53210f,function(_0x15fcac){var _0x57a931=_0x15fcac[_0x850a('0x34')]({'plain':!![]});return _0x57a931[_0x850a('0x6a')];});return db['ChatQueue']['find']({'where':{'id':_0x107f26[_0x850a('0x4e')]['id']}})[_0x850a('0x32')](function(_0xb038c2){return db[_0x850a('0x6e')][_0x850a('0x6f')](function(_0x5e15d0){return _0xb038c2[_0x850a('0x70')](_0x16a871,{'transaction':_0x5e15d0})[_0x850a('0x32')](function(){return BPromise['each'](_0x15282d,function(_0x5a9c1a){return db[_0x850a('0x5a')]['findOrCreate']({'where':{'UserId':_0x5a9c1a['id'],'ChatQueueId':_0x107f26['params']['id']},'transaction':_0x5e15d0});});})[_0x850a('0x32')](function(){_0x15282d[_0x850a('0x71')](function(_0x376174){socket[_0x850a('0x72')](_0x850a('0x73'),{'UserId':_0x376174['id'],'ChatQueueId':_0xb038c2['id']});});});});});}})[_0x850a('0x32')](respondWithStatusCode(_0x4520c0,null))['catch'](handleError(_0x4520c0,null));};exports[_0x850a('0x74')]=function(_0x37d602,_0x291b7a,_0x340b99){return db[_0x850a('0x75')]['findAll']({'where':{'id':_0x37d602['query'][_0x850a('0x76')]},'attributes':['id'],'include':[{'model':db[_0x850a('0x5f')],'as':_0x850a('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x850a('0x32')](handleEntityNotFound(_0x291b7a,null))[_0x850a('0x32')](function(_0xde0696){var _0x5d6736=_[_0x850a('0x39')](_0xde0696,'id');var _0x2cbb54=[];var _0x106545=[];var _0x3b1d67=squel['select']();_0x3b1d67[_0x850a('0x77')](_0x850a('0x78'))[_0x850a('0x79')](_0x850a('0x7a'),'tq')[_0x850a('0x7b')](_0x850a('0x7c'),'ut',_0x850a('0x7d'))[_0x850a('0x48')](_0x850a('0x7e'),_0x37d602[_0x850a('0x4e')]['id']);for(var _0x58dbf7=0x0;_0x58dbf7<_0xde0696[_0x850a('0x50')];_0x58dbf7+=0x1){let _0x4e0443=_0xde0696[_0x58dbf7];for(var _0x456f19=0x0;_0x456f19<_0x4e0443[_0x850a('0x6a')][_0x850a('0x50')];_0x456f19+=0x1){let _0x14084f=_0x4e0443[_0x850a('0x6a')][_0x456f19];var _0x2e9e30=_0x3b1d67[_0x850a('0x7f')]();_0x2e9e30[_0x850a('0x48')](_0x850a('0x80'),_0x14084f['id']);_0x106545[_0x850a('0x81')](db[_0x850a('0x6e')][_0x850a('0x3e')](_0x2e9e30['toString'](),{'type':db[_0x850a('0x6e')][_0x850a('0x82')]['SELECT']})[_0x850a('0x32')](function(_0x581d54){if(_0x581d54[_0x850a('0x50')]===0x1){return _0x14084f['id'];}else{var _0x4516d9=_[_0x850a('0x83')](_['map'](_0x581d54,_0x850a('0x84')),function(_0x8cbf96){return _[_0x850a('0x85')](_0x5d6736,_0x8cbf96);});if(_0x4516d9){return _0x14084f['id'];}}}));}}return BPromise[_0x850a('0x86')](_0x106545)[_0x850a('0x32')](function(_0x2b6ec9){_0x2cbb54=_(_0x2cbb54)['union'](_0x2b6ec9)[_0x850a('0x87')]()['value']();return db[_0x850a('0x3a')][_0x850a('0x55')]({'where':{'id':_0x37d602[_0x850a('0x4e')]['id']}})[_0x850a('0x32')](function(_0x51e8c1){return db[_0x850a('0x6e')][_0x850a('0x6f')](function(_0x1962a6){return _0x51e8c1['removeTeams'](_0x37d602['query'][_0x850a('0x76')],{'transaction':_0x1962a6})[_0x850a('0x32')](function(){if(!_[_0x850a('0x88')](_0x2cbb54)){return _0x51e8c1[_0x850a('0x89')](_0x2cbb54,{'transaction':_0x1962a6});}})['then'](function(){_0x2cbb54['forEach'](function(_0x1d5188){socket[_0x850a('0x72')](_0x850a('0x8a'),{'UserId':_0x1d5188,'ChatQueueId':_0x51e8c1['id']});});});});});});})[_0x850a('0x32')](respondWithStatusCode(_0x291b7a,null))[_0x850a('0x26')](handleError(_0x291b7a,null));};exports[_0x850a('0x8b')]=function(_0x4f9760,_0x47538b,_0x28993d){return db[_0x850a('0x3a')][_0x850a('0x55')]({'where':{'id':_0x4f9760[_0x850a('0x4e')]['id']}})[_0x850a('0x32')](handleEntityNotFound(_0x47538b,null))[_0x850a('0x32')](function(_0x48e564){if(_0x48e564){return _0x48e564['addAgents'](_0x4f9760[_0x850a('0x52')][_0x850a('0x76')],_['omit'](_0x4f9760[_0x850a('0x52')],[_0x850a('0x76'),'id'])||{})['spread'](function(_0xa4bc0b){for(var _0x1d4734=0x0;_0x1d4734<_0x4f9760['body'][_0x850a('0x76')][_0x850a('0x50')];_0x1d4734+=0x1){socket[_0x850a('0x72')](_0x850a('0x73'),{'UserId':Number(_0x4f9760[_0x850a('0x52')][_0x850a('0x76')][_0x1d4734]),'ChatQueueId':Number(_0x4f9760[_0x850a('0x4e')]['id'])});}return _0xa4bc0b;});}})[_0x850a('0x32')](respondWithResult(_0x47538b,null))[_0x850a('0x26')](handleError(_0x47538b,null));};exports['removeAgents']=function(_0x41af25,_0x574218,_0x33c47f){return db[_0x850a('0x3a')]['find']({'where':{'id':_0x41af25[_0x850a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x574218,null))[_0x850a('0x32')](function(_0x4b4153){if(_0x4b4153){return _0x4b4153[_0x850a('0x89')](_0x41af25[_0x850a('0x3e')]['ids'])[_0x850a('0x32')](function(){if(_[_0x850a('0x8c')](_0x41af25[_0x850a('0x3e')][_0x850a('0x76')])){for(var _0x8b8f50=0x0;_0x8b8f50<_0x41af25[_0x850a('0x3e')][_0x850a('0x76')][_0x850a('0x50')];_0x8b8f50+=0x1){socket['emit'](_0x850a('0x8a'),{'UserId':Number(_0x41af25['query'][_0x850a('0x76')][_0x8b8f50]),'ChatQueueId':Number(_0x41af25[_0x850a('0x4e')]['id'])});}}else{socket[_0x850a('0x72')]('userChatQueue:remove',{'UserId':Number(_0x41af25[_0x850a('0x3e')][_0x850a('0x76')]),'ChatQueueId':Number(_0x41af25['params']['id'])});}});}})['then'](respondWithStatusCode(_0x574218,null))['catch'](handleError(_0x574218,null));};exports[_0x850a('0x8d')]=function(_0x31543f,_0x1f0564,_0xd44245){var _0xb582c7={};var _0x41d19a={};var _0x2e6895;var _0x3e4cab;return db['ChatQueue']['findOne']({'where':{'id':_0x31543f['params']['id']}})[_0x850a('0x32')](handleEntityNotFound(_0x1f0564,null))[_0x850a('0x32')](function(_0x214b62){if(_0x214b62){_0x2e6895=_0x214b62;_0x41d19a[_0x850a('0x3d')]=_[_0x850a('0x3f')](db[_0x850a('0x5f')][_0x850a('0x4f')]);_0x41d19a['query']=_[_0x850a('0x3f')](_0x31543f[_0x850a('0x3e')]);_0x41d19a['filters']=_['intersection'](_0x41d19a['model'],_0x41d19a[_0x850a('0x3e')]);_0xb582c7[_0x850a('0x43')]=_[_0x850a('0x41')](_0x41d19a['model'],qs['fields'](_0x31543f['query'][_0x850a('0x42')]));_0xb582c7[_0x850a('0x43')]=_0xb582c7['attributes']['length']?_0xb582c7[_0x850a('0x43')]:_0x41d19a[_0x850a('0x3d')];_0xb582c7['order']=qs[_0x850a('0x5c')](_0x31543f[_0x850a('0x3e')][_0x850a('0x5c')]);_0xb582c7[_0x850a('0x48')]=qs[_0x850a('0x40')](_[_0x850a('0x46')](_0x31543f['query'],_0x41d19a[_0x850a('0x40')]));if(_0x31543f[_0x850a('0x3e')][_0x850a('0x47')]){_0xb582c7[_0x850a('0x48')]=_[_0x850a('0x49')](_0xb582c7[_0x850a('0x48')],{'$or':_[_0x850a('0x39')](_0xb582c7[_0x850a('0x43')],function(_0x11ddd4){var _0x13b416={};_0x13b416[_0x11ddd4]={'$like':'%'+_0x31543f[_0x850a('0x3e')][_0x850a('0x47')]+'%'};return _0x13b416;})});}_0xb582c7=_[_0x850a('0x49')]({},_0xb582c7,_0x31543f[_0x850a('0x4b')]);return _0x2e6895['getAgents'](_0xb582c7);}})[_0x850a('0x32')](function(_0x494291){if(_0x494291){_0x3e4cab=_0x494291[_0x850a('0x50')];if(!_0x31543f[_0x850a('0x3e')]['hasOwnProperty'](_0x850a('0x5b'))){_0xb582c7[_0x850a('0x2a')]=qs[_0x850a('0x2a')](_0x31543f[_0x850a('0x3e')]['limit']);_0xb582c7[_0x850a('0x2b')]=qs[_0x850a('0x2b')](_0x31543f[_0x850a('0x3e')][_0x850a('0x2b')]);}return _0x2e6895['getAgents'](_0xb582c7);}})[_0x850a('0x32')](function(_0xf36f96){if(_0xf36f96){return _0xf36f96?{'count':_0x3e4cab,'rows':_0xf36f96}:null;}})['then'](respondWithResult(_0x1f0564,null))['catch'](handleError(_0x1f0564,null));}; \ No newline at end of file +var _0x28b3=['offset','limit','set','json','apply','reject','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','params','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','count'];(function(_0x3b59db,_0x47f8a4){var _0x858d75=function(_0x21f5b4){while(--_0x21f5b4){_0x3b59db['push'](_0x3b59db['shift']());}};_0x858d75(++_0x47f8a4);}(_0x28b3,0x101));var _0x328b=function(_0x27c551,_0x4686dc){_0x27c551=_0x27c551-0x0;var _0xab2ba2=_0x28b3[_0x27c551];return _0xab2ba2;};'use strict';var emlformat=require(_0x328b('0x0'));var rimraf=require(_0x328b('0x1'));var zipdir=require(_0x328b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x328b('0x3'));var moment=require(_0x328b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x328b('0x5'));var util=require(_0x328b('0x6'));var path=require(_0x328b('0x7'));var sox=require(_0x328b('0x8'));var csv=require('to-csv');var ejs=require(_0x328b('0x9'));var fs=require('fs');var fs_extra=require(_0x328b('0xa'));var _=require(_0x328b('0xb'));var squel=require(_0x328b('0xc'));var crypto=require(_0x328b('0xd'));var jsforce=require(_0x328b('0xe'));var deskjs=require(_0x328b('0xf'));var toCsv=require(_0x328b('0x10'));var querystring=require(_0x328b('0x11'));var Papa=require(_0x328b('0x12'));var Redis=require(_0x328b('0x13'));var authService=require(_0x328b('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x328b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x328b('0x16'))(_0x328b('0x17'));var utils=require('../../config/utils');var config=require(_0x328b('0x18'));var licenseUtil=require(_0x328b('0x19'));var db=require('../../mysqldb')['db'];config[_0x328b('0x1a')]=_['defaults'](config['redis'],{'host':_0x328b('0x1b'),'port':0x18eb});var socket=require(_0x328b('0x1c'))(new Redis(config['redis']));require(_0x328b('0x1d'))['register'](socket);var jayson=require(_0x328b('0x1e'));var client=jayson[_0x328b('0x1f')][_0x328b('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xb2008f,_0x14a8ce,_0x2706eb,_0x1dee53){return new BPromise(function(_0x3e563d,_0x34c516){var _0x369247=_0x1dee53||client;return _0x369247['request'](_0xb2008f,_0x2706eb)[_0x328b('0x21')](function(_0x10d005){logger['info'](_0x328b('0x22'),_0x14a8ce,'request\x20sent');logger[_0x328b('0x23')](_0x328b('0x24'),_0x14a8ce,_0x328b('0x25'),JSON[_0x328b('0x26')](_0x10d005));if(_0x10d005[_0x328b('0x27')]){if(_0x10d005['error'][_0x328b('0x28')]===0x1f4){logger[_0x328b('0x27')]('ChatQueue,\x20%s,\x20%s',_0x14a8ce,_0x10d005['error'][_0x328b('0x29')]);return _0x34c516(_0x10d005['error'][_0x328b('0x29')]);}logger[_0x328b('0x27')](_0x328b('0x22'),_0x14a8ce,_0x10d005[_0x328b('0x27')][_0x328b('0x29')]);return _0x3e563d(_0x10d005[_0x328b('0x27')]['message']);}else{logger['info'](_0x328b('0x22'),_0x14a8ce,'request\x20sent');_0x3e563d(_0x10d005[_0x328b('0x2a')]['message']);}})[_0x328b('0x2b')](function(_0xe872c7){logger[_0x328b('0x27')]('ChatQueue,\x20%s,\x20%s',_0x14a8ce,_0xe872c7);_0x34c516(_0xe872c7);});});}function respondWithStatusCode(_0xc37a57,_0xafdf57){_0xafdf57=_0xafdf57||0xcc;return function(_0x2ef65c){if(_0x2ef65c){return _0xc37a57[_0x328b('0x2c')](_0xafdf57);}return _0xc37a57[_0x328b('0x2d')](_0xafdf57)[_0x328b('0x2e')]();};}function respondWithResult(_0x7d3858,_0x486eff){_0x486eff=_0x486eff||0xc8;return function(_0x51ce35){if(_0x51ce35){return _0x7d3858[_0x328b('0x2d')](_0x486eff)['json'](_0x51ce35);}};}function respondWithFilteredResult(_0x19266c,_0x29600c){return function(_0x4c2129){if(_0x4c2129){var _0x35d0c8=typeof _0x29600c['offset']==='undefined'&&typeof _0x29600c['limit']===_0x328b('0x2f');var _0x372017=_0x4c2129[_0x328b('0x30')];var _0x2fc6b0=_0x35d0c8?0x0:_0x29600c[_0x328b('0x31')];var _0x4a194a=_0x35d0c8?_0x4c2129[_0x328b('0x30')]:_0x29600c[_0x328b('0x31')]+_0x29600c[_0x328b('0x32')];var _0x442204;if(_0x4a194a>=_0x372017){_0x4a194a=_0x372017;_0x442204=0xc8;}else{_0x442204=0xce;}_0x19266c[_0x328b('0x2d')](_0x442204);return _0x19266c[_0x328b('0x33')]('Content-Range',_0x2fc6b0+'-'+_0x4a194a+'/'+_0x372017)[_0x328b('0x34')](_0x4c2129);}return null;};}function patchUpdates(_0x45bd09){return function(_0x26e2ea){try{jsonpatch[_0x328b('0x35')](_0x26e2ea,_0x45bd09,!![]);}catch(_0x26d086){return BPromise[_0x328b('0x36')](_0x26d086);}return _0x26e2ea['save']();};}function saveUpdates(_0x24dd8f,_0x4d1a7e){return function(_0x47ec49){if(_0x47ec49){return _0x47ec49['update'](_0x24dd8f)['then'](function(_0x4c864d){return _0x4c864d;});}return null;};}function removeEntity(_0x435295,_0x52aacd){return function(_0xf7ed6a){if(_0xf7ed6a){return _0xf7ed6a[_0x328b('0x37')]()['then'](function(){var _0x1804fc=_0xf7ed6a[_0x328b('0x38')]({'plain':!![]});var _0x4e0197=_0x328b('0x39');return db[_0x328b('0x3a')][_0x328b('0x37')]({'where':{'type':_0x4e0197,'resourceId':_0x1804fc['id']}})['then'](function(){return _0xf7ed6a;});})[_0x328b('0x21')](function(){_0x435295[_0x328b('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e40c1,_0x2af190){return function(_0x4c8f9e){if(!_0x4c8f9e){_0x4e40c1[_0x328b('0x2c')](0x194);}return _0x4c8f9e;};}function handleError(_0x922fcb,_0x24b04a){_0x24b04a=_0x24b04a||0x1f4;return function(_0x35ed55){logger[_0x328b('0x27')](_0x35ed55[_0x328b('0x3b')]);if(_0x35ed55[_0x328b('0x3c')]){delete _0x35ed55['name'];}_0x922fcb['status'](_0x24b04a)[_0x328b('0x3d')](_0x35ed55);};}exports[_0x328b('0x3e')]=function(_0x369af9,_0x151a04){var _0xd7ed50={},_0x59e42f={},_0x1b8010={'count':0x0,'rows':[]};var _0x516836=_[_0x328b('0x3f')](db[_0x328b('0x40')][_0x328b('0x41')],function(_0x21c504){return{'name':_0x21c504['fieldName'],'type':_0x21c504[_0x328b('0x42')][_0x328b('0x43')]};});_0x59e42f['model']=_['map'](_0x516836,_0x328b('0x3c'));_0x59e42f[_0x328b('0x44')]=_['keys'](_0x369af9['query']);_0x59e42f['filters']=_[_0x328b('0x45')](_0x59e42f[_0x328b('0x46')],_0x59e42f[_0x328b('0x44')]);_0xd7ed50[_0x328b('0x47')]=_[_0x328b('0x45')](_0x59e42f['model'],qs[_0x328b('0x48')](_0x369af9[_0x328b('0x44')]['fields']));_0xd7ed50[_0x328b('0x47')]=_0xd7ed50[_0x328b('0x47')][_0x328b('0x49')]?_0xd7ed50[_0x328b('0x47')]:_0x59e42f[_0x328b('0x46')];if(!_0x369af9[_0x328b('0x44')][_0x328b('0x4a')](_0x328b('0x4b'))){_0xd7ed50[_0x328b('0x32')]=qs['limit'](_0x369af9['query'][_0x328b('0x32')]);_0xd7ed50[_0x328b('0x31')]=qs['offset'](_0x369af9['query'][_0x328b('0x31')]);}_0xd7ed50['order']=qs[_0x328b('0x4c')](_0x369af9[_0x328b('0x44')][_0x328b('0x4c')]);_0xd7ed50[_0x328b('0x4d')]=qs[_0x328b('0x4e')](_[_0x328b('0x4f')](_0x369af9[_0x328b('0x44')],_0x59e42f[_0x328b('0x4e')]),_0x516836);if(_0x369af9[_0x328b('0x44')][_0x328b('0x50')]){_0xd7ed50['where']=_[_0x328b('0x51')](_0xd7ed50[_0x328b('0x4d')],{'$or':_[_0x328b('0x3f')](_0x516836,function(_0x555df4){if(_0x555df4[_0x328b('0x42')]!==_0x328b('0x52')){var _0x26fdea={};_0x26fdea[_0x555df4[_0x328b('0x3c')]]={'$like':'%'+_0x369af9[_0x328b('0x44')]['filter']+'%'};return _0x26fdea;}})});}_0xd7ed50=_[_0x328b('0x51')]({},_0xd7ed50,_0x369af9[_0x328b('0x53')]);var _0x2bc6af={'where':_0xd7ed50[_0x328b('0x4d')]};return db[_0x328b('0x40')][_0x328b('0x30')](_0x2bc6af)[_0x328b('0x21')](function(_0x401a2d){_0x1b8010[_0x328b('0x30')]=_0x401a2d;if(_0x369af9[_0x328b('0x44')][_0x328b('0x54')]){_0xd7ed50[_0x328b('0x55')]=[{'all':!![]}];}return db[_0x328b('0x40')][_0x328b('0x56')](_0xd7ed50);})[_0x328b('0x21')](function(_0x2e11f5){_0x1b8010[_0x328b('0x57')]=_0x2e11f5;return _0x1b8010;})[_0x328b('0x21')](respondWithFilteredResult(_0x151a04,_0xd7ed50))['catch'](handleError(_0x151a04,null));};exports[_0x328b('0x58')]=function(_0xb91e0c,_0x1645f3){var _0x5681fd={'raw':!![],'where':{'id':_0xb91e0c['params']['id']}},_0x3ec10f={};_0x3ec10f[_0x328b('0x46')]=_[_0x328b('0x59')](db['ChatQueue'][_0x328b('0x41')]);_0x3ec10f[_0x328b('0x44')]=_[_0x328b('0x59')](_0xb91e0c[_0x328b('0x44')]);_0x3ec10f[_0x328b('0x4e')]=_['intersection'](_0x3ec10f[_0x328b('0x46')],_0x3ec10f[_0x328b('0x44')]);_0x5681fd['attributes']=_[_0x328b('0x45')](_0x3ec10f[_0x328b('0x46')],qs[_0x328b('0x48')](_0xb91e0c['query']['fields']));_0x5681fd[_0x328b('0x47')]=_0x5681fd[_0x328b('0x47')][_0x328b('0x49')]?_0x5681fd[_0x328b('0x47')]:_0x3ec10f[_0x328b('0x46')];if(_0xb91e0c[_0x328b('0x44')]['includeAll']){_0x5681fd[_0x328b('0x55')]=[{'all':!![]}];}_0x5681fd=_[_0x328b('0x51')]({},_0x5681fd,_0xb91e0c[_0x328b('0x53')]);return db[_0x328b('0x40')][_0x328b('0x5a')](_0x5681fd)[_0x328b('0x21')](handleEntityNotFound(_0x1645f3,null))[_0x328b('0x21')](respondWithResult(_0x1645f3,null))[_0x328b('0x2b')](handleError(_0x1645f3,null));};exports[_0x328b('0x5b')]=function(_0x503be7,_0x1da915){return db['ChatQueue'][_0x328b('0x5b')](_0x503be7[_0x328b('0x5c')],{})[_0x328b('0x21')](function(_0x473a29){var _0x1aa261=_0x503be7[_0x328b('0x5d')][_0x328b('0x38')]({'plain':!![]});if(!_0x1aa261)throw new Error(_0x328b('0x5e'));if(_0x1aa261[_0x328b('0x5f')]===_0x328b('0x5d')){var _0x38716d=_0x473a29['get']({'plain':!![]});var _0x45cc9d=_0x328b('0x39');return db['UserProfileSection']['find']({'where':{'name':_0x45cc9d,'userProfileId':_0x1aa261[_0x328b('0x60')]},'raw':!![]})[_0x328b('0x21')](function(_0x1440be){if(_0x1440be&&_0x1440be[_0x328b('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0x38716d[_0x328b('0x3c')],'resourceId':_0x38716d['id'],'type':_0x1440be[_0x328b('0x3c')],'sectionId':_0x1440be['id']},{})[_0x328b('0x21')](function(){return _0x473a29;});}else{return _0x473a29;}})[_0x328b('0x2b')](function(_0xf8b314){logger[_0x328b('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf8b314);throw _0xf8b314;});}return _0x473a29;})[_0x328b('0x21')](respondWithResult(_0x1da915,0xc9))[_0x328b('0x2b')](handleError(_0x1da915,null));};exports[_0x328b('0x62')]=function(_0x292931,_0xbe60c2){if(_0x292931[_0x328b('0x5c')]['id']){delete _0x292931[_0x328b('0x5c')]['id'];}return db[_0x328b('0x40')][_0x328b('0x5a')]({'where':{'id':_0x292931[_0x328b('0x63')]['id']}})['then'](handleEntityNotFound(_0xbe60c2,null))[_0x328b('0x21')](saveUpdates(_0x292931[_0x328b('0x5c')],null))['then'](respondWithResult(_0xbe60c2,null))[_0x328b('0x2b')](handleError(_0xbe60c2,null));};exports[_0x328b('0x37')]=function(_0x1c773c,_0x53b90b){return db[_0x328b('0x40')][_0x328b('0x5a')]({'where':{'id':_0x1c773c[_0x328b('0x63')]['id']}})[_0x328b('0x21')](handleEntityNotFound(_0x53b90b,null))[_0x328b('0x21')](removeEntity(_0x53b90b,null))[_0x328b('0x2b')](handleError(_0x53b90b,null));};exports['describe']=function(_0x33644c,_0x5ee913){return db[_0x328b('0x40')]['describe']()[_0x328b('0x21')](respondWithResult(_0x5ee913,null))[_0x328b('0x2b')](handleError(_0x5ee913,null));};exports[_0x328b('0x64')]=function(_0x274111,_0x539c79,_0x500698){var _0x2c62c6={'raw':!![],'where':{}},_0x413514={},_0x1efd34;return db[_0x328b('0x40')][_0x328b('0x65')]({'where':{'id':_0x274111[_0x328b('0x63')]['id']}})[_0x328b('0x21')](handleEntityNotFound(_0x539c79,null))[_0x328b('0x21')](function(_0x8420f){if(_0x8420f){_0x1efd34=_0x8420f['get']({'plain':!![]});_0x413514[_0x328b('0x46')]=_['keys'](db[_0x328b('0x66')][_0x328b('0x41')]);_0x413514[_0x328b('0x44')]=_[_0x328b('0x59')](_0x274111[_0x328b('0x44')]);_0x413514['filters']=_[_0x328b('0x45')](_0x413514[_0x328b('0x46')],_0x413514['query']);_0x2c62c6[_0x328b('0x47')]=_['intersection'](_0x413514['model'],qs[_0x328b('0x48')](_0x274111[_0x328b('0x44')][_0x328b('0x48')]));_0x2c62c6[_0x328b('0x47')]=_0x2c62c6[_0x328b('0x47')][_0x328b('0x49')]?_0x2c62c6[_0x328b('0x47')]:_0x413514[_0x328b('0x46')];if(!_0x274111['query'][_0x328b('0x4a')](_0x328b('0x4b'))){_0x2c62c6[_0x328b('0x32')]=qs[_0x328b('0x32')](_0x274111[_0x328b('0x44')][_0x328b('0x32')]);_0x2c62c6[_0x328b('0x31')]=qs[_0x328b('0x31')](_0x274111['query']['offset']);}_0x2c62c6['order']=qs[_0x328b('0x4c')](_0x274111['query'][_0x328b('0x4c')]);_0x2c62c6[_0x328b('0x4d')]=qs[_0x328b('0x4e')](_[_0x328b('0x4f')](_0x274111['query'],_0x413514[_0x328b('0x4e')]));_0x2c62c6['where'][_0x328b('0x67')]=_0x8420f['id'];if(_0x274111[_0x328b('0x44')][_0x328b('0x50')]){_0x2c62c6['where']=_[_0x328b('0x51')](_0x2c62c6['where'],{'$or':_[_0x328b('0x3f')](_0x2c62c6[_0x328b('0x47')],function(_0x419efb){var _0x27d134={};_0x27d134[_0x419efb]={'$like':'%'+_0x274111['query']['filter']+'%'};return _0x27d134;})});}_0x2c62c6=_['merge']({},_0x2c62c6,_0x274111['options']);return db[_0x328b('0x66')][_0x328b('0x56')](_0x2c62c6);}})['then'](function(_0x1e1e9c){if(_0x1e1e9c){return db[_0x328b('0x68')][_0x328b('0x69')]({'where':{'id':_[_0x328b('0x3f')](_0x1e1e9c,_0x328b('0x6a')),'role':'agent'},'attributes':['id','name',_0x328b('0x6b'),_0x328b('0x6c'),_0x328b('0x6d')]});}})[_0x328b('0x21')](function(_0x3c5d3a){if(_0x3c5d3a){return{'count':_0x3c5d3a[_0x328b('0x30')],'rows':_[_0x328b('0x3f')](_0x3c5d3a[_0x328b('0x57')],function(_0x2db9e7){return{'membername':_0x2db9e7[_0x328b('0x3c')],'UserId':_0x2db9e7['id'],'queue_name':_0x1efd34[_0x328b('0x3c')],'ChatQueueId':_0x1efd34['id'],'interface':util[_0x328b('0x6e')](_0x328b('0x6f'),'SIP',_0x2db9e7['name']),'penalty':0x0,'paused':_0x2db9e7[_0x328b('0x6b')],'createdAt':_0x2db9e7[_0x328b('0x6d')],'updatedAt':_0x2db9e7[_0x328b('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x328b('0x21')](respondWithFilteredResult(_0x539c79,_0x2c62c6))[_0x328b('0x2b')](handleError(_0x539c79,null));};exports[_0x328b('0x70')]=function(_0x117813,_0x2c884f,_0x553c13){var _0x268722={};var _0x257f24={};var _0x22835b;var _0x4a2558;return db[_0x328b('0x40')][_0x328b('0x65')]({'where':{'id':_0x117813[_0x328b('0x63')]['id']}})[_0x328b('0x21')](handleEntityNotFound(_0x2c884f,null))['then'](function(_0xde17cb){if(_0xde17cb){_0x22835b=_0xde17cb;_0x257f24['model']=_[_0x328b('0x59')](db[_0x328b('0x71')][_0x328b('0x41')]);_0x257f24[_0x328b('0x44')]=_[_0x328b('0x59')](_0x117813['query']);_0x257f24[_0x328b('0x4e')]=_[_0x328b('0x45')](_0x257f24[_0x328b('0x46')],_0x257f24[_0x328b('0x44')]);_0x268722[_0x328b('0x47')]=_[_0x328b('0x45')](_0x257f24[_0x328b('0x46')],qs[_0x328b('0x48')](_0x117813['query'][_0x328b('0x48')]));_0x268722['attributes']=_0x268722[_0x328b('0x47')][_0x328b('0x49')]?_0x268722[_0x328b('0x47')]:_0x257f24[_0x328b('0x46')];_0x268722[_0x328b('0x72')]=qs[_0x328b('0x4c')](_0x117813[_0x328b('0x44')][_0x328b('0x4c')]);_0x268722[_0x328b('0x4d')]=qs['filters'](_['pick'](_0x117813[_0x328b('0x44')],_0x257f24[_0x328b('0x4e')]));if(_0x117813[_0x328b('0x44')][_0x328b('0x50')]){_0x268722[_0x328b('0x4d')]=_[_0x328b('0x51')](_0x268722[_0x328b('0x4d')],{'$or':_['map'](_0x268722[_0x328b('0x47')],function(_0x70b48f){var _0x4998e0={};_0x4998e0[_0x70b48f]={'$like':'%'+_0x117813[_0x328b('0x44')][_0x328b('0x50')]+'%'};return _0x4998e0;})});}_0x268722=_[_0x328b('0x51')]({},_0x268722,_0x117813[_0x328b('0x53')]);return _0x22835b[_0x328b('0x70')](_0x268722);}})[_0x328b('0x21')](function(_0x4ba607){if(_0x4ba607){_0x4a2558=_0x4ba607[_0x328b('0x49')];if(!_0x117813[_0x328b('0x44')][_0x328b('0x4a')](_0x328b('0x4b'))){_0x268722['limit']=qs['limit'](_0x117813[_0x328b('0x44')][_0x328b('0x32')]);_0x268722[_0x328b('0x31')]=qs[_0x328b('0x31')](_0x117813[_0x328b('0x44')][_0x328b('0x31')]);}return _0x22835b[_0x328b('0x70')](_0x268722);}})[_0x328b('0x21')](function(_0x3a6e5c){if(_0x3a6e5c){return _0x3a6e5c?{'count':_0x4a2558,'rows':_0x3a6e5c}:null;}})[_0x328b('0x21')](respondWithResult(_0x2c884f,null))[_0x328b('0x2b')](handleError(_0x2c884f,null));};exports[_0x328b('0x73')]=function(_0x1fc354,_0x2d9ced,_0x3c2e03){var _0x4169bf=_0x1fc354[_0x328b('0x5c')][_0x328b('0x74')];return db[_0x328b('0x71')]['findAll']({'where':{'id':_0x4169bf},'attributes':['id'],'include':[{'model':db[_0x328b('0x68')],'as':_0x328b('0x75'),'attributes':['id',_0x328b('0x3c'),_0x328b('0x76'),_0x328b('0x77'),_0x328b('0x78')],'raw':!![]}]})[_0x328b('0x21')](function(_0x18f20f){if(_0x18f20f){var _0x189c9e=_['flatMap'](_0x18f20f,function(_0x4ded0e){var _0x189cab=_0x4ded0e[_0x328b('0x38')]({'plain':!![]});return _0x189cab[_0x328b('0x75')];});return db[_0x328b('0x40')]['find']({'where':{'id':_0x1fc354[_0x328b('0x63')]['id']}})[_0x328b('0x21')](function(_0x138d82){return db[_0x328b('0x79')][_0x328b('0x7a')](function(_0x3b5a36){return _0x138d82[_0x328b('0x73')](_0x4169bf,{'transaction':_0x3b5a36})[_0x328b('0x21')](function(){return BPromise[_0x328b('0x7b')](_0x189c9e,function(_0x34f655){return db[_0x328b('0x66')][_0x328b('0x7c')]({'where':{'UserId':_0x34f655['id'],'ChatQueueId':_0x1fc354[_0x328b('0x63')]['id']},'transaction':_0x3b5a36});});})[_0x328b('0x21')](function(){_0x189c9e[_0x328b('0x7d')](function(_0x4857ed){socket[_0x328b('0x7e')](_0x328b('0x7f'),{'UserId':_0x4857ed['id'],'ChatQueueId':_0x138d82['id']});});});});});}})['then'](respondWithStatusCode(_0x2d9ced,null))[_0x328b('0x2b')](handleError(_0x2d9ced,null));};exports[_0x328b('0x80')]=function(_0x4ec2ac,_0x2220ea,_0x234f7f){return db[_0x328b('0x71')]['findAll']({'where':{'id':_0x4ec2ac['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x328b('0x68')],'as':_0x328b('0x75'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2220ea,null))['then'](function(_0x32a4cf){var _0x15e121=_['map'](_0x32a4cf,'id');var _0x350cef=[];var _0xde3311=[];var _0x31496f=squel[_0x328b('0x81')]();_0x31496f['field'](_0x328b('0x82'))[_0x328b('0x83')](_0x328b('0x84'),'tq')['join'](_0x328b('0x85'),'ut',_0x328b('0x86'))[_0x328b('0x4d')](_0x328b('0x87'),_0x4ec2ac[_0x328b('0x63')]['id']);for(var _0x5b1b85=0x0;_0x5b1b85<_0x32a4cf[_0x328b('0x49')];_0x5b1b85+=0x1){let _0x580c8b=_0x32a4cf[_0x5b1b85];for(var _0x36fcd6=0x0;_0x36fcd6<_0x580c8b['Agents'][_0x328b('0x49')];_0x36fcd6+=0x1){let _0x224810=_0x580c8b[_0x328b('0x75')][_0x36fcd6];var _0x4f7f7e=_0x31496f[_0x328b('0x88')]();_0x4f7f7e[_0x328b('0x4d')](_0x328b('0x89'),_0x224810['id']);_0xde3311[_0x328b('0x8a')](db[_0x328b('0x79')][_0x328b('0x44')](_0x4f7f7e['toString'](),{'type':db['sequelize'][_0x328b('0x8b')][_0x328b('0x8c')]})[_0x328b('0x21')](function(_0x32e4c1){if(_0x32e4c1[_0x328b('0x49')]===0x1){return _0x224810['id'];}else{var _0x22a9c3=_['every'](_[_0x328b('0x3f')](_0x32e4c1,_0x328b('0x8d')),function(_0x4e62d5){return _['includes'](_0x15e121,_0x4e62d5);});if(_0x22a9c3){return _0x224810['id'];}}}));}}return BPromise[_0x328b('0x8e')](_0xde3311)[_0x328b('0x21')](function(_0x3ab6e0){_0x350cef=_(_0x350cef)[_0x328b('0x8f')](_0x3ab6e0)[_0x328b('0x90')]()[_0x328b('0x91')]();return db[_0x328b('0x40')][_0x328b('0x5a')]({'where':{'id':_0x4ec2ac['params']['id']}})[_0x328b('0x21')](function(_0x420419){return db[_0x328b('0x79')]['transaction'](function(_0x3316d2){return _0x420419['removeTeams'](_0x4ec2ac[_0x328b('0x44')][_0x328b('0x74')],{'transaction':_0x3316d2})[_0x328b('0x21')](function(){if(!_[_0x328b('0x92')](_0x350cef)){return _0x420419[_0x328b('0x93')](_0x350cef,{'transaction':_0x3316d2});}})['then'](function(){_0x350cef[_0x328b('0x7d')](function(_0x494d92){socket[_0x328b('0x7e')](_0x328b('0x94'),{'UserId':_0x494d92,'ChatQueueId':_0x420419['id']});});});});});});})[_0x328b('0x21')](respondWithStatusCode(_0x2220ea,null))[_0x328b('0x2b')](handleError(_0x2220ea,null));};exports[_0x328b('0x95')]=function(_0x3c3dcb,_0x4e6cc3,_0xdbd67e){return db['ChatQueue']['find']({'where':{'id':_0x3c3dcb['params']['id']}})[_0x328b('0x21')](handleEntityNotFound(_0x4e6cc3,null))[_0x328b('0x21')](function(_0x1de9f9){if(_0x1de9f9){return _0x1de9f9[_0x328b('0x95')](_0x3c3dcb['body'][_0x328b('0x74')],_[_0x328b('0x96')](_0x3c3dcb['body'],[_0x328b('0x74'),'id'])||{})[_0x328b('0x97')](function(_0x35b7df){for(var _0x4d6163=0x0;_0x4d6163<_0x3c3dcb[_0x328b('0x5c')][_0x328b('0x74')][_0x328b('0x49')];_0x4d6163+=0x1){socket['emit'](_0x328b('0x7f'),{'UserId':Number(_0x3c3dcb[_0x328b('0x5c')][_0x328b('0x74')][_0x4d6163]),'ChatQueueId':Number(_0x3c3dcb[_0x328b('0x63')]['id'])});}return _0x35b7df;});}})[_0x328b('0x21')](respondWithResult(_0x4e6cc3,null))[_0x328b('0x2b')](handleError(_0x4e6cc3,null));};exports[_0x328b('0x93')]=function(_0x5dc530,_0xe1f906,_0x20be91){return db['ChatQueue'][_0x328b('0x5a')]({'where':{'id':_0x5dc530[_0x328b('0x63')]['id']}})[_0x328b('0x21')](handleEntityNotFound(_0xe1f906,null))['then'](function(_0x78e636){if(_0x78e636){return _0x78e636['removeAgents'](_0x5dc530[_0x328b('0x44')]['ids'])[_0x328b('0x21')](function(){if(_['isArray'](_0x5dc530[_0x328b('0x44')]['ids'])){for(var _0x3a1a94=0x0;_0x3a1a94<_0x5dc530[_0x328b('0x44')][_0x328b('0x74')]['length'];_0x3a1a94+=0x1){socket[_0x328b('0x7e')](_0x328b('0x94'),{'UserId':Number(_0x5dc530[_0x328b('0x44')][_0x328b('0x74')][_0x3a1a94]),'ChatQueueId':Number(_0x5dc530['params']['id'])});}}else{socket[_0x328b('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x5dc530[_0x328b('0x44')]['ids']),'ChatQueueId':Number(_0x5dc530['params']['id'])});}});}})[_0x328b('0x21')](respondWithStatusCode(_0xe1f906,null))[_0x328b('0x2b')](handleError(_0xe1f906,null));};exports[_0x328b('0x98')]=function(_0x41c5d9,_0x4ef599,_0xeaeff1){var _0xe5ccc6={};var _0x2fbe77={};var _0x43f649;var _0x115b9f;return db[_0x328b('0x40')][_0x328b('0x65')]({'where':{'id':_0x41c5d9[_0x328b('0x63')]['id']}})[_0x328b('0x21')](handleEntityNotFound(_0x4ef599,null))[_0x328b('0x21')](function(_0x559653){if(_0x559653){_0x43f649=_0x559653;_0x2fbe77[_0x328b('0x46')]=_[_0x328b('0x59')](db[_0x328b('0x68')][_0x328b('0x41')]);_0x2fbe77[_0x328b('0x44')]=_['keys'](_0x41c5d9['query']);_0x2fbe77['filters']=_[_0x328b('0x45')](_0x2fbe77[_0x328b('0x46')],_0x2fbe77['query']);_0xe5ccc6[_0x328b('0x47')]=_[_0x328b('0x45')](_0x2fbe77['model'],qs[_0x328b('0x48')](_0x41c5d9[_0x328b('0x44')]['fields']));_0xe5ccc6['attributes']=_0xe5ccc6[_0x328b('0x47')][_0x328b('0x49')]?_0xe5ccc6['attributes']:_0x2fbe77[_0x328b('0x46')];_0xe5ccc6[_0x328b('0x72')]=qs[_0x328b('0x4c')](_0x41c5d9[_0x328b('0x44')][_0x328b('0x4c')]);_0xe5ccc6[_0x328b('0x4d')]=qs[_0x328b('0x4e')](_[_0x328b('0x4f')](_0x41c5d9[_0x328b('0x44')],_0x2fbe77['filters']));if(_0x41c5d9[_0x328b('0x44')][_0x328b('0x50')]){_0xe5ccc6[_0x328b('0x4d')]=_[_0x328b('0x51')](_0xe5ccc6[_0x328b('0x4d')],{'$or':_[_0x328b('0x3f')](_0xe5ccc6[_0x328b('0x47')],function(_0x394303){var _0x582e54={};_0x582e54[_0x394303]={'$like':'%'+_0x41c5d9[_0x328b('0x44')]['filter']+'%'};return _0x582e54;})});}_0xe5ccc6=_[_0x328b('0x51')]({},_0xe5ccc6,_0x41c5d9[_0x328b('0x53')]);return _0x43f649[_0x328b('0x98')](_0xe5ccc6);}})[_0x328b('0x21')](function(_0x1b4220){if(_0x1b4220){_0x115b9f=_0x1b4220[_0x328b('0x49')];if(!_0x41c5d9[_0x328b('0x44')][_0x328b('0x4a')]('nolimit')){_0xe5ccc6[_0x328b('0x32')]=qs[_0x328b('0x32')](_0x41c5d9[_0x328b('0x44')][_0x328b('0x32')]);_0xe5ccc6[_0x328b('0x31')]=qs[_0x328b('0x31')](_0x41c5d9[_0x328b('0x44')][_0x328b('0x31')]);}return _0x43f649[_0x328b('0x98')](_0xe5ccc6);}})[_0x328b('0x21')](function(_0x5bbfbf){if(_0x5bbfbf){return _0x5bbfbf?{'count':_0x115b9f,'rows':_0x5bbfbf}:null;}})[_0x328b('0x21')](respondWithResult(_0x4ef599,null))[_0x328b('0x2b')](handleError(_0x4ef599,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 89a32aa..c0b21ff 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 _0xc4db=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x2dce13,_0x4800d5){var _0x4afe9a=function(_0x21b273){while(--_0x21b273){_0x2dce13['push'](_0x2dce13['shift']());}};_0x4afe9a(++_0x4800d5);}(_0xc4db,0x178));var _0xbc4d=function(_0x15d285,_0x5b85ef){_0x15d285=_0x15d285-0x0;var _0x6d556d=_0xc4db[_0x15d285];return _0x6d556d;};'use strict';var EventEmitter=require(_0xbc4d('0x0'));var ChatQueue=require(_0xbc4d('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbc4d('0x2')](0x0);var events={'afterCreate':_0xbc4d('0x3'),'afterUpdate':_0xbc4d('0x4'),'afterDestroy':_0xbc4d('0x5')};function emitEvent(_0x463968){return function(_0x526c55,_0x17ca0b,_0x579730){ChatQueueEvents['emit'](_0x463968+':'+_0x526c55['id'],_0x526c55);ChatQueueEvents[_0xbc4d('0x6')](_0x463968,_0x526c55);_0x579730(null);};}for(var e in events){if(events[_0xbc4d('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xbc4d('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0xe60e=['save','update','remove','emit','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xe60e,0x10a));var _0xee60=function(_0x254f49,_0x5bd2c9){_0x254f49=_0x254f49-0x0;var _0x1ff9cb=_0xe60e[_0x254f49];return _0x1ff9cb;};'use strict';var EventEmitter=require(_0xee60('0x0'));var ChatQueue=require(_0xee60('0x1'))['db'][_0xee60('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xee60('0x3')](0x0);var events={'afterCreate':_0xee60('0x4'),'afterUpdate':_0xee60('0x5'),'afterDestroy':_0xee60('0x6')};function emitEvent(_0x2ce7c3){return function(_0x2e4cf4,_0x4ba086,_0x4a7bc0){ChatQueueEvents[_0xee60('0x7')](_0x2ce7c3+':'+_0x2e4cf4['id'],_0x2e4cf4);ChatQueueEvents[_0xee60('0x7')](_0x2ce7c3,_0x2e4cf4);_0x4a7bc0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xee60('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 0254834..7cc5081 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 _0x5c66=['util','api','moment','bluebird','path','../../config/environment','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash'];(function(_0x3f8762,_0xe7f8d2){var _0x37cb5e=function(_0x303d9b){while(--_0x303d9b){_0x3f8762['push'](_0x3f8762['shift']());}};_0x37cb5e(++_0xe7f8d2);}(_0x5c66,0x99));var _0x65c6=function(_0x407065,_0x3246aa){_0x407065=_0x407065-0x0;var _0x4832ab=_0x5c66[_0x407065];return _0x4832ab;};'use strict';var _=require(_0x65c6('0x0'));var util=require(_0x65c6('0x1'));var logger=require('../../config/logger')(_0x65c6('0x2'));var moment=require(_0x65c6('0x3'));var BPromise=require(_0x65c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x65c6('0x5'));var rimraf=require('rimraf');var config=require(_0x65c6('0x6'));var attributes=require(_0x65c6('0x7'));module['exports']=function(_0x28e363,_0x2836de){return _0x28e363[_0x65c6('0x8')](_0x65c6('0x9'),attributes,{'tableName':_0x65c6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7c8=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','./chatQueue.attributes','define','chat_queues'];(function(_0x162448,_0x1c390d){var _0x3a7425=function(_0x3913fd){while(--_0x3913fd){_0x162448['push'](_0x162448['shift']());}};_0x3a7425(++_0x1c390d);}(_0xd7c8,0x10e));var _0x8d7c=function(_0x81e98c,_0x298337){_0x81e98c=_0x81e98c-0x0;var _0x44627f=_0xd7c8[_0x81e98c];return _0x44627f;};'use strict';var _=require('lodash');var util=require(_0x8d7c('0x0'));var logger=require(_0x8d7c('0x1'))(_0x8d7c('0x2'));var moment=require('moment');var BPromise=require(_0x8d7c('0x3'));var rp=require(_0x8d7c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8d7c('0x5'));var attributes=require(_0x8d7c('0x6'));module['exports']=function(_0x4626d9,_0x20ae71){return _0x4626d9[_0x8d7c('0x7')]('ChatQueue',attributes,{'tableName':_0x8d7c('0x8'),'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 d4b1610..542d112 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 _0x9037=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','ChatQueue','options','raw','limit','include','model','map','attributes','debug','stringify','ShowChatQueue','find','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then'];(function(_0x34dbda,_0x3c74cf){var _0x1cf345=function(_0x25d03b){while(--_0x25d03b){_0x34dbda['push'](_0x34dbda['shift']());}};_0x1cf345(++_0x3c74cf);}(_0x9037,0xbf));var _0x7903=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9037[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x7903('0x0'));var moment=require('moment');var BPromise=require(_0x7903('0x1'));var rs=require(_0x7903('0x2'));var fs=require('fs');var Redis=require(_0x7903('0x3'));var db=require(_0x7903('0x4'))['db'];var utils=require(_0x7903('0x5'));var logger=require(_0x7903('0x6'))(_0x7903('0x7'));var config=require(_0x7903('0x8'));var jayson=require(_0x7903('0x9'));var client=jayson[_0x7903('0xa')][_0x7903('0xb')]({'port':0x232a});config[_0x7903('0xc')]=_['defaults'](config[_0x7903('0xc')],{'host':_0x7903('0xd'),'port':0x18eb});var socket=require(_0x7903('0xe'))(new Redis(config[_0x7903('0xc')]));require(_0x7903('0xf'))[_0x7903('0x10')](socket);function respondWithRpcPromise(_0x5f4cc7,_0x4ee35b,_0x10be96){return new BPromise(function(_0x414e9c,_0x2581b1){return client[_0x7903('0x11')](_0x5f4cc7,_0x10be96)[_0x7903('0x12')](function(_0x2c578c){logger[_0x7903('0x13')](_0x7903('0x14'),_0x4ee35b,_0x7903('0x15'));logger['debug'](_0x7903('0x16'),_0x4ee35b,_0x7903('0x15'),JSON['stringify'](_0x2c578c));if(_0x2c578c[_0x7903('0x17')]){if(_0x2c578c[_0x7903('0x17')][_0x7903('0x18')]===0x1f4){logger['error'](_0x7903('0x14'),_0x4ee35b,_0x2c578c['error'][_0x7903('0x19')]);return _0x2581b1(_0x2c578c['error'][_0x7903('0x19')]);}logger[_0x7903('0x17')](_0x7903('0x14'),_0x4ee35b,_0x2c578c[_0x7903('0x17')][_0x7903('0x19')]);return _0x414e9c(_0x2c578c[_0x7903('0x17')][_0x7903('0x19')]);}else{logger[_0x7903('0x13')](_0x7903('0x14'),_0x4ee35b,_0x7903('0x15'));_0x414e9c(_0x2c578c[_0x7903('0x1a')][_0x7903('0x19')]);}})[_0x7903('0x1b')](function(_0x3d3fd6){logger[_0x7903('0x17')]('ChatQueue,\x20%s,\x20%s',_0x4ee35b,_0x3d3fd6);_0x2581b1(_0x3d3fd6);});});}exports[_0x7903('0x1c')]=function(_0x433832){var _0x1cb0ce=this;return new Promise(function(_0x1f832f,_0x1a51e7){return db[_0x7903('0x1d')]['findAll']({'raw':_0x433832['options']?_0x433832[_0x7903('0x1e')][_0x7903('0x1f')]===undefined?!![]:![]:!![],'where':_0x433832[_0x7903('0x1e')]?_0x433832[_0x7903('0x1e')]['where']||null:null,'attributes':_0x433832['options']?_0x433832[_0x7903('0x1e')]['attributes']||null:null,'limit':_0x433832['options']?_0x433832[_0x7903('0x1e')][_0x7903('0x20')]||null:null,'include':_0x433832[_0x7903('0x1e')]?_0x433832[_0x7903('0x1e')][_0x7903('0x21')]?_['map'](_0x433832[_0x7903('0x1e')][_0x7903('0x21')],function(_0x434743){return{'model':db[_0x434743[_0x7903('0x22')]],'as':_0x434743['as'],'attributes':_0x434743['attributes'],'include':_0x434743['include']?_[_0x7903('0x23')](_0x434743[_0x7903('0x21')],function(_0x183689){return{'model':db[_0x183689[_0x7903('0x22')]],'as':_0x183689['as'],'attributes':_0x183689[_0x7903('0x24')],'include':_0x183689[_0x7903('0x21')]?_[_0x7903('0x23')](_0x183689[_0x7903('0x21')],function(_0x54a20a){return{'model':db[_0x54a20a[_0x7903('0x22')]],'as':_0x54a20a['as'],'attributes':_0x54a20a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7903('0x12')](function(_0xa0f093){logger[_0x7903('0x13')]('GetChatQueue',_0x433832);logger[_0x7903('0x25')](_0x7903('0x1c'),_0x433832,JSON[_0x7903('0x26')](_0xa0f093));_0x1f832f(_0xa0f093);})[_0x7903('0x1b')](function(_0x496c42){logger[_0x7903('0x17')](_0x7903('0x1c'),_0x496c42[_0x7903('0x19')],_0x433832);_0x1a51e7(_0x1cb0ce[_0x7903('0x17')](0x1f4,_0x496c42['message']));});});};exports[_0x7903('0x27')]=function(_0x58cd05){var _0x377cdb=this;return new Promise(function(_0x17b9dd,_0x38fa97){return db[_0x7903('0x1d')][_0x7903('0x28')]({'raw':_0x58cd05[_0x7903('0x1e')]?_0x58cd05[_0x7903('0x1e')][_0x7903('0x1f')]===undefined?!![]:![]:!![],'where':_0x58cd05['options']?_0x58cd05[_0x7903('0x1e')][_0x7903('0x29')]||null:null,'attributes':_0x58cd05[_0x7903('0x1e')]?_0x58cd05[_0x7903('0x1e')][_0x7903('0x24')]||null:null,'include':_0x58cd05[_0x7903('0x1e')]?_0x58cd05[_0x7903('0x1e')][_0x7903('0x21')]?_[_0x7903('0x23')](_0x58cd05[_0x7903('0x1e')]['include'],function(_0x3c6ba3){return{'model':db[_0x3c6ba3['model']],'as':_0x3c6ba3['as'],'attributes':_0x3c6ba3['attributes'],'include':_0x3c6ba3['include']?_[_0x7903('0x23')](_0x3c6ba3['include'],function(_0x2df96d){return{'model':db[_0x2df96d[_0x7903('0x22')]],'as':_0x2df96d['as'],'attributes':_0x2df96d[_0x7903('0x24')],'include':_0x2df96d[_0x7903('0x21')]?_[_0x7903('0x23')](_0x2df96d[_0x7903('0x21')],function(_0x19c0f2){return{'model':db[_0x19c0f2[_0x7903('0x22')]],'as':_0x19c0f2['as'],'attributes':_0x19c0f2[_0x7903('0x24')]};}):[]};}):[]};}):[]:[]})[_0x7903('0x12')](function(_0x1b0674){logger[_0x7903('0x13')](_0x7903('0x27'),_0x58cd05);logger[_0x7903('0x25')](_0x7903('0x27'),_0x58cd05,JSON[_0x7903('0x26')](_0x1b0674));_0x17b9dd(_0x1b0674);})[_0x7903('0x1b')](function(_0x48ee16){logger[_0x7903('0x17')]('ShowChatQueue',_0x48ee16[_0x7903('0x19')],_0x58cd05);_0x38fa97(_0x377cdb[_0x7903('0x17')](0x1f4,_0x48ee16[_0x7903('0x19')]));});});}; \ No newline at end of file +var _0x32e7=['model','attributes','then','ShowChatQueue','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','register','request','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','where','limit','include','map'];(function(_0x124546,_0x9425b0){var _0x10b6a8=function(_0x52e5cf){while(--_0x52e5cf){_0x124546['push'](_0x124546['shift']());}};_0x10b6a8(++_0x9425b0);}(_0x32e7,0xc3));var _0x732e=function(_0x274c31,_0xf74ab8){_0x274c31=_0x274c31-0x0;var _0x3b36df=_0x32e7[_0x274c31];return _0x3b36df;};'use strict';var _=require(_0x732e('0x0'));var util=require('util');var moment=require(_0x732e('0x1'));var BPromise=require(_0x732e('0x2'));var rs=require(_0x732e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x732e('0x4'))['db'];var utils=require(_0x732e('0x5'));var logger=require(_0x732e('0x6'))(_0x732e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x732e('0x8')]['http']({'port':0x232a});config[_0x732e('0x9')]=_[_0x732e('0xa')](config['redis'],{'host':_0x732e('0xb'),'port':0x18eb});var socket=require(_0x732e('0xc'))(new Redis(config[_0x732e('0x9')]));require('./chatQueue.socket')[_0x732e('0xd')](socket);function respondWithRpcPromise(_0x4e0df5,_0x367a2c,_0x3facf4){return new BPromise(function(_0xf8c6f6,_0x264581){return client[_0x732e('0xe')](_0x4e0df5,_0x3facf4)['then'](function(_0x34c5b9){logger[_0x732e('0xf')](_0x732e('0x10'),_0x367a2c,_0x732e('0x11'));logger['debug'](_0x732e('0x12'),_0x367a2c,_0x732e('0x11'),JSON[_0x732e('0x13')](_0x34c5b9));if(_0x34c5b9['error']){if(_0x34c5b9[_0x732e('0x14')]['code']===0x1f4){logger[_0x732e('0x14')]('ChatQueue,\x20%s,\x20%s',_0x367a2c,_0x34c5b9[_0x732e('0x14')]['message']);return _0x264581(_0x34c5b9['error'][_0x732e('0x15')]);}logger[_0x732e('0x14')](_0x732e('0x10'),_0x367a2c,_0x34c5b9[_0x732e('0x14')][_0x732e('0x15')]);return _0xf8c6f6(_0x34c5b9[_0x732e('0x14')][_0x732e('0x15')]);}else{logger[_0x732e('0xf')](_0x732e('0x10'),_0x367a2c,_0x732e('0x11'));_0xf8c6f6(_0x34c5b9[_0x732e('0x16')][_0x732e('0x15')]);}})[_0x732e('0x17')](function(_0x1ffdff){logger['error']('ChatQueue,\x20%s,\x20%s',_0x367a2c,_0x1ffdff);_0x264581(_0x1ffdff);});});}exports[_0x732e('0x18')]=function(_0x2126ef){var _0x567239=this;return new Promise(function(_0x2f00c6,_0x3a901c){return db[_0x732e('0x19')][_0x732e('0x1a')]({'raw':_0x2126ef[_0x732e('0x1b')]?_0x2126ef[_0x732e('0x1b')][_0x732e('0x1c')]===undefined?!![]:![]:!![],'where':_0x2126ef[_0x732e('0x1b')]?_0x2126ef[_0x732e('0x1b')][_0x732e('0x1d')]||null:null,'attributes':_0x2126ef['options']?_0x2126ef[_0x732e('0x1b')]['attributes']||null:null,'limit':_0x2126ef['options']?_0x2126ef[_0x732e('0x1b')][_0x732e('0x1e')]||null:null,'include':_0x2126ef[_0x732e('0x1b')]?_0x2126ef[_0x732e('0x1b')][_0x732e('0x1f')]?_[_0x732e('0x20')](_0x2126ef[_0x732e('0x1b')][_0x732e('0x1f')],function(_0x553605){return{'model':db[_0x553605[_0x732e('0x21')]],'as':_0x553605['as'],'attributes':_0x553605[_0x732e('0x22')],'include':_0x553605[_0x732e('0x1f')]?_['map'](_0x553605[_0x732e('0x1f')],function(_0x22f38f){return{'model':db[_0x22f38f[_0x732e('0x21')]],'as':_0x22f38f['as'],'attributes':_0x22f38f[_0x732e('0x22')],'include':_0x22f38f[_0x732e('0x1f')]?_[_0x732e('0x20')](_0x22f38f[_0x732e('0x1f')],function(_0x123c3a){return{'model':db[_0x123c3a[_0x732e('0x21')]],'as':_0x123c3a['as'],'attributes':_0x123c3a[_0x732e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x732e('0x23')](function(_0x607101){logger[_0x732e('0xf')]('GetChatQueue',_0x2126ef);logger['debug']('GetChatQueue',_0x2126ef,JSON[_0x732e('0x13')](_0x607101));_0x2f00c6(_0x607101);})[_0x732e('0x17')](function(_0x301921){logger['error'](_0x732e('0x18'),_0x301921[_0x732e('0x15')],_0x2126ef);_0x3a901c(_0x567239[_0x732e('0x14')](0x1f4,_0x301921['message']));});});};exports[_0x732e('0x24')]=function(_0x43ccf9){var _0x44f749=this;return new Promise(function(_0x393cdc,_0x24a36d){return db['ChatQueue']['find']({'raw':_0x43ccf9['options']?_0x43ccf9['options']['raw']===undefined?!![]:![]:!![],'where':_0x43ccf9[_0x732e('0x1b')]?_0x43ccf9[_0x732e('0x1b')][_0x732e('0x1d')]||null:null,'attributes':_0x43ccf9['options']?_0x43ccf9[_0x732e('0x1b')][_0x732e('0x22')]||null:null,'include':_0x43ccf9[_0x732e('0x1b')]?_0x43ccf9[_0x732e('0x1b')][_0x732e('0x1f')]?_[_0x732e('0x20')](_0x43ccf9[_0x732e('0x1b')][_0x732e('0x1f')],function(_0x43d50a){return{'model':db[_0x43d50a[_0x732e('0x21')]],'as':_0x43d50a['as'],'attributes':_0x43d50a[_0x732e('0x22')],'include':_0x43d50a[_0x732e('0x1f')]?_[_0x732e('0x20')](_0x43d50a['include'],function(_0x717321){return{'model':db[_0x717321[_0x732e('0x21')]],'as':_0x717321['as'],'attributes':_0x717321['attributes'],'include':_0x717321['include']?_[_0x732e('0x20')](_0x717321[_0x732e('0x1f')],function(_0x2b980b){return{'model':db[_0x2b980b[_0x732e('0x21')]],'as':_0x2b980b['as'],'attributes':_0x2b980b[_0x732e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x732e('0x23')](function(_0x13f744){logger[_0x732e('0xf')](_0x732e('0x24'),_0x43ccf9);logger[_0x732e('0x25')](_0x732e('0x24'),_0x43ccf9,JSON[_0x732e('0x13')](_0x13f744));_0x393cdc(_0x13f744);})[_0x732e('0x17')](function(_0xd94c55){logger[_0x732e('0x14')](_0x732e('0x24'),_0xd94c55['message'],_0x43ccf9);_0x24a36d(_0x44f749[_0x732e('0x14')](0x1f4,_0xd94c55['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 9af5178..e36bbad 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 _0xf109=['remove','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf109,0xce));var _0x9f10=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xf109[_0x1a7846];return _0x48049;};'use strict';var ChatQueueEvents=require(_0x9f10('0x0'));var events=[_0x9f10('0x1'),_0x9f10('0x2'),'update'];function createListener(_0x5b381d,_0x4cbc7a){return function(_0x3659ce){_0x4cbc7a[_0x9f10('0x3')](_0x5b381d,_0x3659ce);};}function removeListener(_0x74d0ee,_0x26f01c){return function(){ChatQueueEvents[_0x9f10('0x4')](_0x74d0ee,_0x26f01c);};}exports[_0x9f10('0x5')]=function(_0x408fe8){for(var _0xd3137b=0x0,_0x227a29=events[_0x9f10('0x6')];_0xd3137b<_0x227a29;_0xd3137b++){var _0x3fd82f=events[_0xd3137b];var _0x5c8719=createListener(_0x9f10('0x7')+_0x3fd82f,_0x408fe8);ChatQueueEvents['on'](_0x3fd82f,_0x5c8719);}}; \ No newline at end of file +var _0x55e0=['emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x27ccb6,_0x103913){var _0x412043=function(_0x3c1624){while(--_0x3c1624){_0x27ccb6['push'](_0x27ccb6['shift']());}};_0x412043(++_0x103913);}(_0x55e0,0xdc));var _0x055e=function(_0x1f2488,_0x1ec255){_0x1f2488=_0x1f2488-0x0;var _0x558038=_0x55e0[_0x1f2488];return _0x558038;};'use strict';var ChatQueueEvents=require(_0x055e('0x0'));var events=[_0x055e('0x1'),_0x055e('0x2'),_0x055e('0x3')];function createListener(_0x5b82b9,_0x578882){return function(_0x3a2ee6){_0x578882[_0x055e('0x4')](_0x5b82b9,_0x3a2ee6);};}function removeListener(_0x33cd7b,_0x2773e4){return function(){ChatQueueEvents[_0x055e('0x5')](_0x33cd7b,_0x2773e4);};}exports[_0x055e('0x6')]=function(_0x490ee1){for(var _0x5239f6=0x0,_0x4384ff=events['length'];_0x5239f6<_0x4384ff;_0x5239f6++){var _0x8e7824=events[_0x5239f6];var _0x3c4cf=createListener(_0x055e('0x7')+_0x8e7824,_0x490ee1);ChatQueueEvents['on'](_0x8e7824,_0x3c4cf);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 7d3fc42..59151a9 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(_0x58f992,_0x142571){var _0x17518b=function(_0x458caf){while(--_0x458caf){_0x58f992['push'](_0x58f992['shift']());}};_0x17518b(++_0x142571);}(_0x814b,0x1a2));var _0xb814=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0x814b[_0x1fc1f9];return _0x4987ca;};'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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5b6fd5,_0x3c9351){var _0xe06506=function(_0x317f60){while(--_0x317f60){_0x5b6fd5['push'](_0x5b6fd5['shift']());}};_0xe06506(++_0x3c9351);}(_0x7217,0x19e));var _0x7721=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x7217[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 2ad6b11..c806556 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 _0x635e=['DATE','moment','sequelize','exports','STRING'];(function(_0x389eb7,_0x2c7003){var _0x59f2ae=function(_0xf77d72){while(--_0xf77d72){_0x389eb7['push'](_0x389eb7['shift']());}};_0x59f2ae(++_0x2c7003);}(_0x635e,0xf6));var _0xe635=function(_0x5669ec,_0x7b42ad){_0x5669ec=_0x5669ec-0x0;var _0x2678f4=_0x635e[_0x5669ec];return _0x2678f4;};'use strict';var moment=require(_0xe635('0x0'));var Sequelize=require(_0xe635('0x1'));module[_0xe635('0x2')]={'uniqueid':{'type':Sequelize[_0xe635('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe635('0x3')]},'joinAt':{'type':Sequelize[_0xe635('0x4')]},'leaveAt':{'type':Sequelize[_0xe635('0x4')]},'acceptAt':{'type':Sequelize[_0xe635('0x4')]},'exitAt':{'type':Sequelize[_0xe635('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5d8d=['STRING','DATE','moment','sequelize','exports'];(function(_0x1b2493,_0x5f78b2){var _0x15d33c=function(_0x2c0230){while(--_0x2c0230){_0x1b2493['push'](_0x1b2493['shift']());}};_0x15d33c(++_0x5f78b2);}(_0x5d8d,0xe3));var _0xd5d8=function(_0x5be27b,_0x137a81){_0x5be27b=_0x5be27b-0x0;var _0x65ac7b=_0x5d8d[_0x5be27b];return _0x65ac7b;};'use strict';var moment=require(_0xd5d8('0x0'));var Sequelize=require(_0xd5d8('0x1'));module[_0xd5d8('0x2')]={'uniqueid':{'type':Sequelize[_0xd5d8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd5d8('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd5d8('0x4')]},'acceptAt':{'type':Sequelize[_0xd5d8('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd5d8('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 96829d3..c7b5413 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 _0x62f1=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','save','update','then','stack','name','send','rawAttributes','fieldName','type','map','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','ChatQueueReport','includeAll','include','rows','show','params','keys','create','body','catch','find','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x62f1,0x112));var _0x162f=function(_0xb00537,_0x4d25b9){_0xb00537=_0xb00537-0x0;var _0x55d401=_0x62f1[_0xb00537];return _0x55d401;};'use strict';var emlformat=require(_0x162f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x162f('0x1'));var jsonpatch=require(_0x162f('0x2'));var rp=require(_0x162f('0x3'));var moment=require(_0x162f('0x4'));var BPromise=require(_0x162f('0x5'));var Mustache=require(_0x162f('0x6'));var util=require(_0x162f('0x7'));var path=require(_0x162f('0x8'));var sox=require(_0x162f('0x9'));var csv=require(_0x162f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x162f('0xb'));var _=require(_0x162f('0xc'));var squel=require('squel');var crypto=require(_0x162f('0xd'));var jsforce=require(_0x162f('0xe'));var deskjs=require(_0x162f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x162f('0x10'));var Papa=require(_0x162f('0x11'));var Redis=require(_0x162f('0x12'));var authService=require(_0x162f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x162f('0x14'));var hardwareService=require(_0x162f('0x15'));var logger=require(_0x162f('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x162f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6ae441,_0x361048){_0x361048=_0x361048||0xcc;return function(_0x4561d2){if(_0x4561d2){return _0x6ae441[_0x162f('0x18')](_0x361048);}return _0x6ae441['status'](_0x361048)[_0x162f('0x19')]();};}function respondWithResult(_0x2bf9f0,_0x3daa69){_0x3daa69=_0x3daa69||0xc8;return function(_0x130db8){if(_0x130db8){return _0x2bf9f0['status'](_0x3daa69)[_0x162f('0x1a')](_0x130db8);}};}function respondWithFilteredResult(_0x4e48e1,_0x250983){return function(_0x2d90ad){if(_0x2d90ad){var _0x40a284=typeof _0x250983[_0x162f('0x1b')]==='undefined'&&typeof _0x250983['limit']===_0x162f('0x1c');var _0xa03e71=_0x2d90ad[_0x162f('0x1d')];var _0x1ee433=_0x40a284?0x0:_0x250983[_0x162f('0x1b')];var _0x750506=_0x40a284?_0x2d90ad[_0x162f('0x1d')]:_0x250983['offset']+_0x250983[_0x162f('0x1e')];var _0x53ac47;if(_0x750506>=_0xa03e71){_0x750506=_0xa03e71;_0x53ac47=0xc8;}else{_0x53ac47=0xce;}_0x4e48e1[_0x162f('0x1f')](_0x53ac47);return _0x4e48e1[_0x162f('0x20')]('Content-Range',_0x1ee433+'-'+_0x750506+'/'+_0xa03e71)[_0x162f('0x1a')](_0x2d90ad);}return null;};}function patchUpdates(_0x236ef5){return function(_0x57796d){try{jsonpatch[_0x162f('0x21')](_0x57796d,_0x236ef5,!![]);}catch(_0x436a5a){return BPromise[_0x162f('0x22')](_0x436a5a);}return _0x57796d[_0x162f('0x23')]();};}function saveUpdates(_0x5dc1a7,_0xdab3e){return function(_0x246aff){if(_0x246aff){return _0x246aff[_0x162f('0x24')](_0x5dc1a7)[_0x162f('0x25')](function(_0x422241){return _0x422241;});}return null;};}function removeEntity(_0x1512b0,_0xbcbe11){return function(_0x331d0d){if(_0x331d0d){return _0x331d0d['destroy']()[_0x162f('0x25')](function(){_0x1512b0[_0x162f('0x1f')](0xcc)[_0x162f('0x19')]();});}};}function handleEntityNotFound(_0x16f5e2,_0x59482e){return function(_0x2fc293){if(!_0x2fc293){_0x16f5e2['sendStatus'](0x194);}return _0x2fc293;};}function handleError(_0x1e25d5,_0x54e4e1){_0x54e4e1=_0x54e4e1||0x1f4;return function(_0x2cd181){logger['error'](_0x2cd181[_0x162f('0x26')]);if(_0x2cd181['name']){delete _0x2cd181[_0x162f('0x27')];}_0x1e25d5[_0x162f('0x1f')](_0x54e4e1)[_0x162f('0x28')](_0x2cd181);};}exports['index']=function(_0x4bb880,_0x4c58ff){var _0x580e13={},_0x3f9247={},_0x1b0f5b={'count':0x0,'rows':[]};var _0x4c4049=_['map'](db['ChatQueueReport'][_0x162f('0x29')],function(_0x5089c7){return{'name':_0x5089c7[_0x162f('0x2a')],'type':_0x5089c7[_0x162f('0x2b')]['key']};});_0x3f9247['model']=_[_0x162f('0x2c')](_0x4c4049,_0x162f('0x27'));_0x3f9247[_0x162f('0x2d')]=_['keys'](_0x4bb880[_0x162f('0x2d')]);_0x3f9247[_0x162f('0x2e')]=_[_0x162f('0x2f')](_0x3f9247[_0x162f('0x30')],_0x3f9247['query']);_0x580e13['attributes']=_[_0x162f('0x2f')](_0x3f9247['model'],qs[_0x162f('0x31')](_0x4bb880['query']['fields']));_0x580e13['attributes']=_0x580e13['attributes'][_0x162f('0x32')]?_0x580e13[_0x162f('0x33')]:_0x3f9247[_0x162f('0x30')];if(!_0x4bb880['query'][_0x162f('0x34')](_0x162f('0x35'))){_0x580e13['limit']=qs[_0x162f('0x1e')](_0x4bb880[_0x162f('0x2d')][_0x162f('0x1e')]);_0x580e13['offset']=qs[_0x162f('0x1b')](_0x4bb880['query'][_0x162f('0x1b')]);}_0x580e13['order']=qs[_0x162f('0x36')](_0x4bb880['query'][_0x162f('0x36')]);_0x580e13[_0x162f('0x37')]=qs['filters'](_[_0x162f('0x38')](_0x4bb880['query'],_0x3f9247[_0x162f('0x2e')]),_0x4c4049);if(_0x4bb880[_0x162f('0x2d')]['filter']){_0x580e13[_0x162f('0x37')]=_['merge'](_0x580e13[_0x162f('0x37')],{'$or':_['map'](_0x4c4049,function(_0x5f4b3f){if(_0x5f4b3f[_0x162f('0x2b')]!==_0x162f('0x39')){var _0x4a328f={};_0x4a328f[_0x5f4b3f[_0x162f('0x27')]]={'$like':'%'+_0x4bb880['query']['filter']+'%'};return _0x4a328f;}})});}_0x580e13=_[_0x162f('0x3a')]({},_0x580e13,_0x4bb880[_0x162f('0x3b')]);var _0x59ca49={'where':_0x580e13[_0x162f('0x37')]};return db[_0x162f('0x3c')][_0x162f('0x1d')](_0x59ca49)[_0x162f('0x25')](function(_0x2fa18e){_0x1b0f5b['count']=_0x2fa18e;if(_0x4bb880[_0x162f('0x2d')][_0x162f('0x3d')]){_0x580e13[_0x162f('0x3e')]=[{'all':!![]}];}return db[_0x162f('0x3c')]['findAll'](_0x580e13);})[_0x162f('0x25')](function(_0x146daa){_0x1b0f5b[_0x162f('0x3f')]=_0x146daa;return _0x1b0f5b;})[_0x162f('0x25')](respondWithFilteredResult(_0x4c58ff,_0x580e13))['catch'](handleError(_0x4c58ff,null));};exports[_0x162f('0x40')]=function(_0xc2143e,_0x52c8c3){var _0x8c8443={'raw':!![],'where':{'id':_0xc2143e[_0x162f('0x41')]['id']}},_0x21dd30={};_0x21dd30[_0x162f('0x30')]=_[_0x162f('0x42')](db[_0x162f('0x3c')][_0x162f('0x29')]);_0x21dd30['query']=_[_0x162f('0x42')](_0xc2143e[_0x162f('0x2d')]);_0x21dd30['filters']=_[_0x162f('0x2f')](_0x21dd30[_0x162f('0x30')],_0x21dd30['query']);_0x8c8443[_0x162f('0x33')]=_[_0x162f('0x2f')](_0x21dd30[_0x162f('0x30')],qs[_0x162f('0x31')](_0xc2143e[_0x162f('0x2d')][_0x162f('0x31')]));_0x8c8443[_0x162f('0x33')]=_0x8c8443[_0x162f('0x33')][_0x162f('0x32')]?_0x8c8443[_0x162f('0x33')]:_0x21dd30[_0x162f('0x30')];if(_0xc2143e[_0x162f('0x2d')][_0x162f('0x3d')]){_0x8c8443[_0x162f('0x3e')]=[{'all':!![]}];}_0x8c8443=_['merge']({},_0x8c8443,_0xc2143e[_0x162f('0x3b')]);return db[_0x162f('0x3c')]['find'](_0x8c8443)['then'](handleEntityNotFound(_0x52c8c3,null))[_0x162f('0x25')](respondWithResult(_0x52c8c3,null))['catch'](handleError(_0x52c8c3,null));};exports[_0x162f('0x43')]=function(_0x5d06c1,_0x1e936b){return db['ChatQueueReport'][_0x162f('0x43')](_0x5d06c1[_0x162f('0x44')],{})[_0x162f('0x25')](respondWithResult(_0x1e936b,0xc9))[_0x162f('0x45')](handleError(_0x1e936b,null));};exports[_0x162f('0x24')]=function(_0xf74671,_0x466136){if(_0xf74671[_0x162f('0x44')]['id']){delete _0xf74671[_0x162f('0x44')]['id'];}return db['ChatQueueReport'][_0x162f('0x46')]({'where':{'id':_0xf74671[_0x162f('0x41')]['id']}})['then'](handleEntityNotFound(_0x466136,null))[_0x162f('0x25')](saveUpdates(_0xf74671[_0x162f('0x44')],null))[_0x162f('0x25')](respondWithResult(_0x466136,null))[_0x162f('0x45')](handleError(_0x466136,null));};exports[_0x162f('0x47')]=function(_0x487835,_0x232348){return db[_0x162f('0x3c')][_0x162f('0x46')]({'where':{'id':_0x487835[_0x162f('0x41')]['id']}})[_0x162f('0x25')](handleEntityNotFound(_0x232348,null))['then'](removeEntity(_0x232348,null))['catch'](handleError(_0x232348,null));};exports[_0x162f('0x48')]=function(_0x4d74eb,_0x3e25b5){return db[_0x162f('0x3c')]['describe']()[_0x162f('0x25')](respondWithResult(_0x3e25b5,null))[_0x162f('0x45')](handleError(_0x3e25b5,null));}; \ No newline at end of file +var _0xb145=['includeAll','findAll','rows','catch','show','params','include','options','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','end','error','stack','name','send','index','ChatQueueReport','rawAttributes','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x1da6c8,_0x1f1f00){var _0x4858cf=function(_0x2fe23b){while(--_0x2fe23b){_0x1da6c8['push'](_0x1da6c8['shift']());}};_0x4858cf(++_0x1f1f00);}(_0xb145,0xa3));var _0x5b14=function(_0x457895,_0x4248f2){_0x457895=_0x457895-0x0;var _0x16d1d9=_0xb145[_0x457895];return _0x16d1d9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b14('0x0'));var zipdir=require(_0x5b14('0x1'));var jsonpatch=require(_0x5b14('0x2'));var rp=require(_0x5b14('0x3'));var moment=require(_0x5b14('0x4'));var BPromise=require(_0x5b14('0x5'));var Mustache=require(_0x5b14('0x6'));var util=require(_0x5b14('0x7'));var path=require('path');var sox=require(_0x5b14('0x8'));var csv=require(_0x5b14('0x9'));var ejs=require(_0x5b14('0xa'));var fs=require('fs');var fs_extra=require(_0x5b14('0xb'));var _=require('lodash');var squel=require(_0x5b14('0xc'));var crypto=require(_0x5b14('0xd'));var jsforce=require(_0x5b14('0xe'));var deskjs=require(_0x5b14('0xf'));var toCsv=require(_0x5b14('0x9'));var querystring=require('querystring');var Papa=require(_0x5b14('0x10'));var Redis=require(_0x5b14('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5b14('0x12'));var as=require(_0x5b14('0x13'));var hardwareService=require(_0x5b14('0x14'));var logger=require(_0x5b14('0x15'))(_0x5b14('0x16'));var utils=require('../../config/utils');var config=require(_0x5b14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b14('0x18'))['db'];function respondWithStatusCode(_0x1903a5,_0xc33723){_0xc33723=_0xc33723||0xcc;return function(_0x1cb56b){if(_0x1cb56b){return _0x1903a5[_0x5b14('0x19')](_0xc33723);}return _0x1903a5[_0x5b14('0x1a')](_0xc33723)['end']();};}function respondWithResult(_0x27b34b,_0x16f2a1){_0x16f2a1=_0x16f2a1||0xc8;return function(_0x35fb8b){if(_0x35fb8b){return _0x27b34b[_0x5b14('0x1a')](_0x16f2a1)[_0x5b14('0x1b')](_0x35fb8b);}};}function respondWithFilteredResult(_0x2a8fe5,_0x68f695){return function(_0xe5af75){if(_0xe5af75){var _0x183b0a=typeof _0x68f695[_0x5b14('0x1c')]===_0x5b14('0x1d')&&typeof _0x68f695[_0x5b14('0x1e')]==='undefined';var _0x24cfd0=_0xe5af75['count'];var _0x48d395=_0x183b0a?0x0:_0x68f695['offset'];var _0x3f397d=_0x183b0a?_0xe5af75[_0x5b14('0x1f')]:_0x68f695[_0x5b14('0x1c')]+_0x68f695[_0x5b14('0x1e')];var _0x3786f7;if(_0x3f397d>=_0x24cfd0){_0x3f397d=_0x24cfd0;_0x3786f7=0xc8;}else{_0x3786f7=0xce;}_0x2a8fe5[_0x5b14('0x1a')](_0x3786f7);return _0x2a8fe5[_0x5b14('0x20')]('Content-Range',_0x48d395+'-'+_0x3f397d+'/'+_0x24cfd0)['json'](_0xe5af75);}return null;};}function patchUpdates(_0x4fa079){return function(_0x4f4717){try{jsonpatch[_0x5b14('0x21')](_0x4f4717,_0x4fa079,!![]);}catch(_0x9a9495){return BPromise[_0x5b14('0x22')](_0x9a9495);}return _0x4f4717['save']();};}function saveUpdates(_0x1018d9,_0x1577f7){return function(_0x4857c7){if(_0x4857c7){return _0x4857c7[_0x5b14('0x23')](_0x1018d9)[_0x5b14('0x24')](function(_0x50951f){return _0x50951f;});}return null;};}function removeEntity(_0x33a293,_0x54073f){return function(_0x59282c){if(_0x59282c){return _0x59282c['destroy']()['then'](function(){_0x33a293[_0x5b14('0x1a')](0xcc)[_0x5b14('0x25')]();});}};}function handleEntityNotFound(_0x153a25,_0x5da505){return function(_0x46f86a){if(!_0x46f86a){_0x153a25[_0x5b14('0x19')](0x194);}return _0x46f86a;};}function handleError(_0x2ac7b0,_0x143648){_0x143648=_0x143648||0x1f4;return function(_0xe6851b){logger[_0x5b14('0x26')](_0xe6851b[_0x5b14('0x27')]);if(_0xe6851b[_0x5b14('0x28')]){delete _0xe6851b[_0x5b14('0x28')];}_0x2ac7b0[_0x5b14('0x1a')](_0x143648)[_0x5b14('0x29')](_0xe6851b);};}exports[_0x5b14('0x2a')]=function(_0x1c3c52,_0x266bbe){var _0x4cfd66={},_0x370fcd={},_0x18a76d={'count':0x0,'rows':[]};var _0x53b13d=_['map'](db[_0x5b14('0x2b')][_0x5b14('0x2c')],function(_0x5dca4f){return{'name':_0x5dca4f['fieldName'],'type':_0x5dca4f[_0x5b14('0x2d')]['key']};});_0x370fcd[_0x5b14('0x2e')]=_[_0x5b14('0x2f')](_0x53b13d,'name');_0x370fcd['query']=_[_0x5b14('0x30')](_0x1c3c52[_0x5b14('0x31')]);_0x370fcd[_0x5b14('0x32')]=_['intersection'](_0x370fcd[_0x5b14('0x2e')],_0x370fcd['query']);_0x4cfd66[_0x5b14('0x33')]=_[_0x5b14('0x34')](_0x370fcd[_0x5b14('0x2e')],qs[_0x5b14('0x35')](_0x1c3c52['query'][_0x5b14('0x35')]));_0x4cfd66[_0x5b14('0x33')]=_0x4cfd66[_0x5b14('0x33')][_0x5b14('0x36')]?_0x4cfd66['attributes']:_0x370fcd[_0x5b14('0x2e')];if(!_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x37')]('nolimit')){_0x4cfd66[_0x5b14('0x1e')]=qs['limit'](_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x1e')]);_0x4cfd66['offset']=qs[_0x5b14('0x1c')](_0x1c3c52[_0x5b14('0x31')]['offset']);}_0x4cfd66[_0x5b14('0x38')]=qs['sort'](_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x39')]);_0x4cfd66[_0x5b14('0x3a')]=qs[_0x5b14('0x32')](_['pick'](_0x1c3c52[_0x5b14('0x31')],_0x370fcd[_0x5b14('0x32')]),_0x53b13d);if(_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3b')]){_0x4cfd66[_0x5b14('0x3a')]=_[_0x5b14('0x3c')](_0x4cfd66[_0x5b14('0x3a')],{'$or':_[_0x5b14('0x2f')](_0x53b13d,function(_0x4f647c){if(_0x4f647c[_0x5b14('0x2d')]!==_0x5b14('0x3d')){var _0x3f9d1d={};_0x3f9d1d[_0x4f647c[_0x5b14('0x28')]]={'$like':'%'+_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3b')]+'%'};return _0x3f9d1d;}})});}_0x4cfd66=_[_0x5b14('0x3c')]({},_0x4cfd66,_0x1c3c52['options']);var _0x2ebaa8={'where':_0x4cfd66['where']};return db[_0x5b14('0x2b')][_0x5b14('0x1f')](_0x2ebaa8)['then'](function(_0x4c05ac){_0x18a76d['count']=_0x4c05ac;if(_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3e')]){_0x4cfd66['include']=[{'all':!![]}];}return db[_0x5b14('0x2b')][_0x5b14('0x3f')](_0x4cfd66);})[_0x5b14('0x24')](function(_0x3d0369){_0x18a76d[_0x5b14('0x40')]=_0x3d0369;return _0x18a76d;})['then'](respondWithFilteredResult(_0x266bbe,_0x4cfd66))[_0x5b14('0x41')](handleError(_0x266bbe,null));};exports[_0x5b14('0x42')]=function(_0x4fb46e,_0x996aee){var _0x985e69={'raw':!![],'where':{'id':_0x4fb46e[_0x5b14('0x43')]['id']}},_0x5cc257={};_0x5cc257['model']=_[_0x5b14('0x30')](db[_0x5b14('0x2b')][_0x5b14('0x2c')]);_0x5cc257[_0x5b14('0x31')]=_['keys'](_0x4fb46e[_0x5b14('0x31')]);_0x5cc257[_0x5b14('0x32')]=_[_0x5b14('0x34')](_0x5cc257[_0x5b14('0x2e')],_0x5cc257['query']);_0x985e69['attributes']=_[_0x5b14('0x34')](_0x5cc257[_0x5b14('0x2e')],qs['fields'](_0x4fb46e[_0x5b14('0x31')]['fields']));_0x985e69[_0x5b14('0x33')]=_0x985e69[_0x5b14('0x33')][_0x5b14('0x36')]?_0x985e69[_0x5b14('0x33')]:_0x5cc257[_0x5b14('0x2e')];if(_0x4fb46e['query'][_0x5b14('0x3e')]){_0x985e69[_0x5b14('0x44')]=[{'all':!![]}];}_0x985e69=_[_0x5b14('0x3c')]({},_0x985e69,_0x4fb46e[_0x5b14('0x45')]);return db[_0x5b14('0x2b')]['find'](_0x985e69)['then'](handleEntityNotFound(_0x996aee,null))[_0x5b14('0x24')](respondWithResult(_0x996aee,null))['catch'](handleError(_0x996aee,null));};exports['create']=function(_0x4825b4,_0x35d00d){return db[_0x5b14('0x2b')][_0x5b14('0x46')](_0x4825b4[_0x5b14('0x47')],{})[_0x5b14('0x24')](respondWithResult(_0x35d00d,0xc9))[_0x5b14('0x41')](handleError(_0x35d00d,null));};exports[_0x5b14('0x23')]=function(_0x4d2bee,_0x548e1c){if(_0x4d2bee['body']['id']){delete _0x4d2bee['body']['id'];}return db['ChatQueueReport'][_0x5b14('0x48')]({'where':{'id':_0x4d2bee[_0x5b14('0x43')]['id']}})[_0x5b14('0x24')](handleEntityNotFound(_0x548e1c,null))[_0x5b14('0x24')](saveUpdates(_0x4d2bee[_0x5b14('0x47')],null))['then'](respondWithResult(_0x548e1c,null))['catch'](handleError(_0x548e1c,null));};exports[_0x5b14('0x49')]=function(_0xd6ea50,_0x58b18e){return db[_0x5b14('0x2b')][_0x5b14('0x48')]({'where':{'id':_0xd6ea50['params']['id']}})['then'](handleEntityNotFound(_0x58b18e,null))[_0x5b14('0x24')](removeEntity(_0x58b18e,null))[_0x5b14('0x41')](handleError(_0x58b18e,null));};exports[_0x5b14('0x4a')]=function(_0x5d3782,_0x1a51d5){return db[_0x5b14('0x2b')][_0x5b14('0x4a')]()[_0x5b14('0x24')](respondWithResult(_0x1a51d5,null))[_0x5b14('0x41')](handleError(_0x1a51d5,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 2ae1b88..f74ea3e 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(_0x556af5,_0x3d5dd3){var _0x2c8a91=function(_0x12c3dd){while(--_0x12c3dd){_0x556af5['push'](_0x556af5['shift']());}};_0x2c8a91(++_0x3d5dd3);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xb7e7[_0x3305de];return _0x3b5a84;};'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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2cdc41,_0x27a4bc){var _0x39e4a2=function(_0x39c1a6){while(--_0x39c1a6){_0x2cdc41['push'](_0x2cdc41['shift']());}};_0x39e4a2(++_0x27a4bc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 06bceac..ca28bef 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 _0x35d2=['result','catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','stringify','update','attributes','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent'];(function(_0x30b1e1,_0x2116d8){var _0xd358f8=function(_0x1abccb){while(--_0x1abccb){_0x30b1e1['push'](_0x30b1e1['shift']());}};_0xd358f8(++_0x2116d8);}(_0x35d2,0xd4));var _0x235d=function(_0x1c61c9,_0x167304){_0x1c61c9=_0x1c61c9-0x0;var _0x27a3ff=_0x35d2[_0x1c61c9];return _0x27a3ff;};'use strict';var _=require(_0x235d('0x0'));var util=require('util');var moment=require(_0x235d('0x1'));var BPromise=require(_0x235d('0x2'));var rs=require(_0x235d('0x3'));var fs=require('fs');var Redis=require(_0x235d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x235d('0x5'));var logger=require(_0x235d('0x6'))(_0x235d('0x7'));var config=require(_0x235d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x235d('0x9')][_0x235d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5340cb,_0x1b1381,_0x535437){return new BPromise(function(_0x41a9ae,_0x518aa2){return client[_0x235d('0xb')](_0x5340cb,_0x535437)['then'](function(_0x252087){logger[_0x235d('0xc')](_0x235d('0xd'),_0x1b1381,'request\x20sent');logger[_0x235d('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1b1381,'request\x20sent',JSON['stringify'](_0x252087));if(_0x252087['error']){if(_0x252087[_0x235d('0xf')][_0x235d('0x10')]===0x1f4){logger[_0x235d('0xf')](_0x235d('0xd'),_0x1b1381,_0x252087[_0x235d('0xf')][_0x235d('0x11')]);return _0x518aa2(_0x252087[_0x235d('0xf')][_0x235d('0x11')]);}logger['error'](_0x235d('0xd'),_0x1b1381,_0x252087[_0x235d('0xf')][_0x235d('0x11')]);return _0x41a9ae(_0x252087[_0x235d('0xf')][_0x235d('0x11')]);}else{logger[_0x235d('0xc')](_0x235d('0xd'),_0x1b1381,_0x235d('0x12'));_0x41a9ae(_0x252087[_0x235d('0x13')][_0x235d('0x11')]);}})[_0x235d('0x14')](function(_0x2bbcef){logger['error'](_0x235d('0xd'),_0x1b1381,_0x2bbcef);_0x518aa2(_0x2bbcef);});});}exports['CreateChatQueueReport']=function(_0x18fd31){var _0x5cbedb=this;return new Promise(function(_0x466a3f,_0x2a5a1d){return db[_0x235d('0x15')][_0x235d('0x16')](_0x18fd31[_0x235d('0x17')],{'raw':_0x18fd31[_0x235d('0x18')]?_0x18fd31[_0x235d('0x18')][_0x235d('0x19')]===undefined?!![]:![]:!![]})[_0x235d('0x1a')](function(_0x4bee34){logger[_0x235d('0xc')](_0x235d('0x1b'),_0x18fd31);logger['debug'](_0x235d('0x1b'),_0x18fd31,JSON[_0x235d('0x1c')](_0x4bee34));_0x466a3f(_0x4bee34);})['catch'](function(_0x4cad98){logger[_0x235d('0xf')](_0x235d('0x1b'),_0x4cad98[_0x235d('0x11')],_0x18fd31);_0x2a5a1d(_0x5cbedb[_0x235d('0xf')](0x1f4,_0x4cad98[_0x235d('0x11')]));});});};exports['UpdateChatQueueReport']=function(_0x4f8075){var _0x493ee6=this;return new Promise(function(_0x5ee5ef,_0x5b6126){return db['ChatQueueReport'][_0x235d('0x1d')](_0x4f8075[_0x235d('0x17')],{'raw':_0x4f8075['options']?_0x4f8075[_0x235d('0x18')][_0x235d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f8075['options']?_0x4f8075[_0x235d('0x18')]['where']||null:null,'attributes':_0x4f8075[_0x235d('0x18')]?_0x4f8075[_0x235d('0x18')][_0x235d('0x1e')]||null:null,'limit':_0x4f8075[_0x235d('0x18')]?_0x4f8075[_0x235d('0x18')][_0x235d('0x1f')]||null:null})['then'](function(_0x22fdfb){logger[_0x235d('0xc')]('UpdateChatQueueReport',_0x4f8075);logger['debug'](_0x235d('0x20'),_0x4f8075,JSON[_0x235d('0x1c')](_0x22fdfb));_0x5ee5ef(_0x22fdfb);})[_0x235d('0x14')](function(_0x47e326){logger['error'](_0x235d('0x20'),_0x47e326[_0x235d('0x11')],_0x4f8075);_0x5b6126(_0x493ee6[_0x235d('0xf')](0x1f4,_0x47e326[_0x235d('0x11')]));});});}; \ No newline at end of file +var _0xafcd=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','UpdateChatQueueReport','update','body','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x36258e,_0x3c60ab){var _0x476be9=function(_0x48014a){while(--_0x48014a){_0x36258e['push'](_0x36258e['shift']());}};_0x476be9(++_0x3c60ab);}(_0xafcd,0x157));var _0xdafc=function(_0x5189d6,_0x557268){_0x5189d6=_0x5189d6-0x0;var _0xb04855=_0xafcd[_0x5189d6];return _0xb04855;};'use strict';var _=require(_0xdafc('0x0'));var util=require(_0xdafc('0x1'));var moment=require(_0xdafc('0x2'));var BPromise=require(_0xdafc('0x3'));var rs=require(_0xdafc('0x4'));var fs=require('fs');var Redis=require(_0xdafc('0x5'));var db=require(_0xdafc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdafc('0x7'))(_0xdafc('0x8'));var config=require(_0xdafc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdafc('0xa')][_0xdafc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33adc9,_0x52872c,_0x24f2e7){return new BPromise(function(_0x255125,_0x397db6){return client[_0xdafc('0xc')](_0x33adc9,_0x24f2e7)[_0xdafc('0xd')](function(_0x241787){logger[_0xdafc('0xe')](_0xdafc('0xf'),_0x52872c,_0xdafc('0x10'));logger[_0xdafc('0x11')](_0xdafc('0x12'),_0x52872c,'request\x20sent',JSON['stringify'](_0x241787));if(_0x241787[_0xdafc('0x13')]){if(_0x241787[_0xdafc('0x13')][_0xdafc('0x14')]===0x1f4){logger[_0xdafc('0x13')](_0xdafc('0xf'),_0x52872c,_0x241787['error']['message']);return _0x397db6(_0x241787['error'][_0xdafc('0x15')]);}logger['error'](_0xdafc('0xf'),_0x52872c,_0x241787['error'][_0xdafc('0x15')]);return _0x255125(_0x241787[_0xdafc('0x13')][_0xdafc('0x15')]);}else{logger[_0xdafc('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x52872c,'request\x20sent');_0x255125(_0x241787[_0xdafc('0x16')][_0xdafc('0x15')]);}})[_0xdafc('0x17')](function(_0x5bfac1){logger['error'](_0xdafc('0xf'),_0x52872c,_0x5bfac1);_0x397db6(_0x5bfac1);});});}exports[_0xdafc('0x18')]=function(_0xdab843){var _0x2fef1b=this;return new Promise(function(_0x17136e,_0x3d2274){return db[_0xdafc('0x19')][_0xdafc('0x1a')](_0xdab843['body'],{'raw':_0xdab843[_0xdafc('0x1b')]?_0xdab843[_0xdafc('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xdafc('0xd')](function(_0xb825df){logger[_0xdafc('0xe')](_0xdafc('0x18'),_0xdab843);logger[_0xdafc('0x11')](_0xdafc('0x18'),_0xdab843,JSON['stringify'](_0xb825df));_0x17136e(_0xb825df);})['catch'](function(_0x59af2e){logger[_0xdafc('0x13')]('CreateChatQueueReport',_0x59af2e[_0xdafc('0x15')],_0xdab843);_0x3d2274(_0x2fef1b[_0xdafc('0x13')](0x1f4,_0x59af2e[_0xdafc('0x15')]));});});};exports[_0xdafc('0x1c')]=function(_0x5be20a){var _0x41ff90=this;return new Promise(function(_0x4fd6ff,_0x5985f9){return db[_0xdafc('0x19')][_0xdafc('0x1d')](_0x5be20a[_0xdafc('0x1e')],{'raw':_0x5be20a[_0xdafc('0x1b')]?_0x5be20a[_0xdafc('0x1b')][_0xdafc('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5be20a[_0xdafc('0x1b')]?_0x5be20a['options'][_0xdafc('0x20')]||null:null,'attributes':_0x5be20a[_0xdafc('0x1b')]?_0x5be20a['options'][_0xdafc('0x21')]||null:null,'limit':_0x5be20a['options']?_0x5be20a['options'][_0xdafc('0x22')]||null:null})['then'](function(_0x2fbc2b){logger[_0xdafc('0xe')]('UpdateChatQueueReport',_0x5be20a);logger[_0xdafc('0x11')]('UpdateChatQueueReport',_0x5be20a,JSON['stringify'](_0x2fbc2b));_0x4fd6ff(_0x2fbc2b);})['catch'](function(_0x3fd347){logger[_0xdafc('0x13')](_0xdafc('0x1c'),_0x3fd347[_0xdafc('0x15')],_0x5be20a);_0x5985f9(_0x41ff90[_0xdafc('0x13')](0x1f4,_0x3fd347[_0xdafc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 1f748a2..68d8d76 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 _0xa806=['fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x11f79d,_0x2de5ef){var _0xaab0dc=function(_0x27beb2){while(--_0x27beb2){_0x11f79d['push'](_0x11f79d['shift']());}};_0xaab0dc(++_0x2de5ef);}(_0xa806,0x18b));var _0x6a80=function(_0x19e1f6,_0x52d013){_0x19e1f6=_0x19e1f6-0x0;var _0x4b9242=_0xa806[_0x19e1f6];return _0x4b9242;};'use strict';var multer=require(_0x6a80('0x0'));var util=require(_0x6a80('0x1'));var path=require(_0x6a80('0x2'));var timeout=require(_0x6a80('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6a80('0x4'));var auth=require(_0x6a80('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6a80('0x6'));var controller=require(_0x6a80('0x7'));router[_0x6a80('0x8')]('/',auth[_0x6a80('0x9')](),controller[_0x6a80('0xa')]);router[_0x6a80('0x8')](_0x6a80('0xb'),auth[_0x6a80('0x9')](),controller['describe']);router[_0x6a80('0x8')]('/:id',auth[_0x6a80('0x9')](),controller[_0x6a80('0xc')]);router[_0x6a80('0xd')]('/',auth['isAuthenticated'](),controller[_0x6a80('0xe')]);router[_0x6a80('0xf')]('/:id',auth[_0x6a80('0x9')](),controller[_0x6a80('0x10')]);router[_0x6a80('0x11')](_0x6a80('0x12'),auth[_0x6a80('0x9')](),controller[_0x6a80('0x13')]);module[_0x6a80('0x14')]=router; \ No newline at end of file +var _0x68be=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','index','get','describe','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x2fe411,_0x2efad2){var _0x253808=function(_0x304372){while(--_0x304372){_0x2fe411['push'](_0x2fe411['shift']());}};_0x253808(++_0x2efad2);}(_0x68be,0xcf));var _0xe68b=function(_0x505e11,_0x23c698){_0x505e11=_0x505e11-0x0;var _0x42fc5d=_0x68be[_0x505e11];return _0x42fc5d;};'use strict';var multer=require(_0xe68b('0x0'));var util=require(_0xe68b('0x1'));var path=require(_0xe68b('0x2'));var timeout=require('connect-timeout');var express=require(_0xe68b('0x3'));var router=express[_0xe68b('0x4')]();var fs_extra=require(_0xe68b('0x5'));var auth=require(_0xe68b('0x6'));var interaction=require(_0xe68b('0x7'));var config=require('../../config/environment');var controller=require(_0xe68b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe68b('0x9')]);router[_0xe68b('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xe68b('0xb')]);router[_0xe68b('0xa')](_0xe68b('0xc'),auth[_0xe68b('0xd')](),controller[_0xe68b('0xe')]);router[_0xe68b('0xf')]('/',auth[_0xe68b('0xd')](),controller[_0xe68b('0x10')]);router['put']('/:id',auth[_0xe68b('0xd')](),controller[_0xe68b('0x11')]);router[_0xe68b('0x12')]('/:id',auth[_0xe68b('0xd')](),controller[_0xe68b('0x13')]);module[_0xe68b('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 597cc36..3c6b51d 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x23867b,_0x27080f){var _0x5d984b=function(_0x125f06){while(--_0x125f06){_0x23867b['push'](_0x23867b['shift']());}};_0x5d984b(++_0x27080f);}(_0x70e0,0x17b));var _0x070e=function(_0x16a8e8,_0x5cf6b3){_0x16a8e8=_0x16a8e8-0x0;var _0x4bc65c=_0x70e0[_0x16a8e8];return _0x4bc65c;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1080ff,_0x275fee){_0x1080ff=_0x1080ff-0x0;var _0x51d4b2=_0x9bde[_0x1080ff];return _0x51d4b2;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index f2a0d85..7254cee 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 _0xddb0=['sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','body','params','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0xddb0,0x1c0));var _0x0ddb=function(_0x1bef20,_0x181572){_0x1bef20=_0x1bef20-0x0;var _0x5068e5=_0xddb0[_0x1bef20];return _0x5068e5;};'use strict';var emlformat=require(_0x0ddb('0x0'));var rimraf=require(_0x0ddb('0x1'));var zipdir=require(_0x0ddb('0x2'));var jsonpatch=require(_0x0ddb('0x3'));var rp=require(_0x0ddb('0x4'));var moment=require(_0x0ddb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0ddb('0x6'));var path=require(_0x0ddb('0x7'));var sox=require(_0x0ddb('0x8'));var csv=require('to-csv');var ejs=require(_0x0ddb('0x9'));var fs=require('fs');var fs_extra=require(_0x0ddb('0xa'));var _=require(_0x0ddb('0xb'));var squel=require(_0x0ddb('0xc'));var crypto=require('crypto');var jsforce=require(_0x0ddb('0xd'));var deskjs=require(_0x0ddb('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0ddb('0xf'));var Papa=require(_0x0ddb('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0ddb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ddb('0x12'));var logger=require(_0x0ddb('0x13'))(_0x0ddb('0x14'));var utils=require('../../config/utils');var config=require(_0x0ddb('0x15'));var licenseUtil=require(_0x0ddb('0x16'));var db=require(_0x0ddb('0x17'))['db'];function respondWithStatusCode(_0x4d386c,_0x13f91c){_0x13f91c=_0x13f91c||0xcc;return function(_0xba2a68){if(_0xba2a68){return _0x4d386c[_0x0ddb('0x18')](_0x13f91c);}return _0x4d386c[_0x0ddb('0x19')](_0x13f91c)[_0x0ddb('0x1a')]();};}function respondWithResult(_0x53d316,_0x2dba52){_0x2dba52=_0x2dba52||0xc8;return function(_0x20523f){if(_0x20523f){return _0x53d316['status'](_0x2dba52)[_0x0ddb('0x1b')](_0x20523f);}};}function respondWithFilteredResult(_0x47317b,_0x29b692){return function(_0xda56a){if(_0xda56a){var _0x4e6daa=typeof _0x29b692['offset']===_0x0ddb('0x1c')&&typeof _0x29b692[_0x0ddb('0x1d')]===_0x0ddb('0x1c');var _0x4d91c4=_0xda56a[_0x0ddb('0x1e')];var _0x56c3ae=_0x4e6daa?0x0:_0x29b692['offset'];var _0x4b0795=_0x4e6daa?_0xda56a[_0x0ddb('0x1e')]:_0x29b692[_0x0ddb('0x1f')]+_0x29b692['limit'];var _0x54cb49;if(_0x4b0795>=_0x4d91c4){_0x4b0795=_0x4d91c4;_0x54cb49=0xc8;}else{_0x54cb49=0xce;}_0x47317b[_0x0ddb('0x19')](_0x54cb49);return _0x47317b[_0x0ddb('0x20')](_0x0ddb('0x21'),_0x56c3ae+'-'+_0x4b0795+'/'+_0x4d91c4)['json'](_0xda56a);}return null;};}function patchUpdates(_0x424b23){return function(_0x438441){try{jsonpatch[_0x0ddb('0x22')](_0x438441,_0x424b23,!![]);}catch(_0x4f8b7a){return BPromise['reject'](_0x4f8b7a);}return _0x438441[_0x0ddb('0x23')]();};}function saveUpdates(_0x292d31,_0x4e4768){return function(_0x152492){if(_0x152492){return _0x152492[_0x0ddb('0x24')](_0x292d31)[_0x0ddb('0x25')](function(_0x47a6bc){return _0x47a6bc;});}return null;};}function removeEntity(_0x1a9251,_0x5770d5){return function(_0x145409){if(_0x145409){return _0x145409[_0x0ddb('0x26')]()[_0x0ddb('0x25')](function(){_0x1a9251[_0x0ddb('0x19')](0xcc)[_0x0ddb('0x1a')]();});}};}function handleEntityNotFound(_0x10b075,_0x388c12){return function(_0x3521d7){if(!_0x3521d7){_0x10b075[_0x0ddb('0x18')](0x194);}return _0x3521d7;};}function handleError(_0x1a4793,_0x5df97a){_0x5df97a=_0x5df97a||0x1f4;return function(_0x3bd2b0){logger[_0x0ddb('0x27')](_0x3bd2b0['stack']);if(_0x3bd2b0[_0x0ddb('0x28')]){delete _0x3bd2b0[_0x0ddb('0x28')];}_0x1a4793[_0x0ddb('0x19')](_0x5df97a)[_0x0ddb('0x29')](_0x3bd2b0);};}exports[_0x0ddb('0x2a')]=function(_0x449d4b,_0x2ef41e){var _0x1a1fca={},_0x1b3eea={},_0x3c4d11={'count':0x0,'rows':[]};var _0x27a0e7=_[_0x0ddb('0x2b')](db[_0x0ddb('0x2c')][_0x0ddb('0x2d')],function(_0x16de7d){return{'name':_0x16de7d[_0x0ddb('0x2e')],'type':_0x16de7d[_0x0ddb('0x2f')][_0x0ddb('0x30')]};});_0x1b3eea[_0x0ddb('0x31')]=_['map'](_0x27a0e7,_0x0ddb('0x28'));_0x1b3eea[_0x0ddb('0x32')]=_[_0x0ddb('0x33')](_0x449d4b[_0x0ddb('0x32')]);_0x1b3eea[_0x0ddb('0x34')]=_[_0x0ddb('0x35')](_0x1b3eea['model'],_0x1b3eea[_0x0ddb('0x32')]);_0x1a1fca[_0x0ddb('0x36')]=_['intersection'](_0x1b3eea[_0x0ddb('0x31')],qs[_0x0ddb('0x37')](_0x449d4b[_0x0ddb('0x32')][_0x0ddb('0x37')]));_0x1a1fca[_0x0ddb('0x36')]=_0x1a1fca[_0x0ddb('0x36')]['length']?_0x1a1fca['attributes']:_0x1b3eea['model'];if(!_0x449d4b[_0x0ddb('0x32')]['hasOwnProperty'](_0x0ddb('0x38'))){_0x1a1fca['limit']=qs['limit'](_0x449d4b['query']['limit']);_0x1a1fca[_0x0ddb('0x1f')]=qs['offset'](_0x449d4b[_0x0ddb('0x32')][_0x0ddb('0x1f')]);}_0x1a1fca[_0x0ddb('0x39')]=qs['sort'](_0x449d4b[_0x0ddb('0x32')][_0x0ddb('0x3a')]);_0x1a1fca[_0x0ddb('0x3b')]=qs[_0x0ddb('0x34')](_[_0x0ddb('0x3c')](_0x449d4b[_0x0ddb('0x32')],_0x1b3eea[_0x0ddb('0x34')]),_0x27a0e7);if(_0x449d4b['query'][_0x0ddb('0x3d')]){_0x1a1fca[_0x0ddb('0x3b')]=_[_0x0ddb('0x3e')](_0x1a1fca['where'],{'$or':_[_0x0ddb('0x2b')](_0x27a0e7,function(_0x211861){if(_0x211861[_0x0ddb('0x2f')]!==_0x0ddb('0x3f')){var _0x4a97bb={};_0x4a97bb[_0x211861[_0x0ddb('0x28')]]={'$like':'%'+_0x449d4b['query'][_0x0ddb('0x3d')]+'%'};return _0x4a97bb;}})});}_0x1a1fca=_['merge']({},_0x1a1fca,_0x449d4b[_0x0ddb('0x40')]);var _0x512be0={'where':_0x1a1fca['where']};return db[_0x0ddb('0x2c')][_0x0ddb('0x1e')](_0x512be0)[_0x0ddb('0x25')](function(_0x337dc9){_0x3c4d11[_0x0ddb('0x1e')]=_0x337dc9;if(_0x449d4b[_0x0ddb('0x32')][_0x0ddb('0x41')]){_0x1a1fca[_0x0ddb('0x42')]=[{'all':!![]}];}return db[_0x0ddb('0x2c')][_0x0ddb('0x43')](_0x1a1fca);})[_0x0ddb('0x25')](function(_0x38226c){_0x3c4d11[_0x0ddb('0x44')]=_0x38226c;return _0x3c4d11;})['then'](respondWithFilteredResult(_0x2ef41e,_0x1a1fca))[_0x0ddb('0x45')](handleError(_0x2ef41e,null));};exports[_0x0ddb('0x46')]=function(_0x22d89e,_0x47b56a){var _0x341a03={'raw':!![],'where':{'id':_0x22d89e['params']['id']}},_0xc1acbe={};_0xc1acbe['model']=_[_0x0ddb('0x33')](db[_0x0ddb('0x2c')][_0x0ddb('0x2d')]);_0xc1acbe[_0x0ddb('0x32')]=_[_0x0ddb('0x33')](_0x22d89e[_0x0ddb('0x32')]);_0xc1acbe['filters']=_[_0x0ddb('0x35')](_0xc1acbe[_0x0ddb('0x31')],_0xc1acbe[_0x0ddb('0x32')]);_0x341a03[_0x0ddb('0x36')]=_['intersection'](_0xc1acbe[_0x0ddb('0x31')],qs['fields'](_0x22d89e['query'][_0x0ddb('0x37')]));_0x341a03[_0x0ddb('0x36')]=_0x341a03[_0x0ddb('0x36')][_0x0ddb('0x47')]?_0x341a03[_0x0ddb('0x36')]:_0xc1acbe['model'];if(_0x22d89e['query']['includeAll']){_0x341a03['include']=[{'all':!![]}];}_0x341a03=_[_0x0ddb('0x3e')]({},_0x341a03,_0x22d89e[_0x0ddb('0x40')]);return db['ChatTransferReport']['find'](_0x341a03)[_0x0ddb('0x25')](handleEntityNotFound(_0x47b56a,null))[_0x0ddb('0x25')](respondWithResult(_0x47b56a,null))[_0x0ddb('0x45')](handleError(_0x47b56a,null));};exports['create']=function(_0x5b9360,_0x32a2cc){return db['ChatTransferReport']['create'](_0x5b9360[_0x0ddb('0x48')],{})[_0x0ddb('0x25')](respondWithResult(_0x32a2cc,0xc9))[_0x0ddb('0x45')](handleError(_0x32a2cc,null));};exports[_0x0ddb('0x24')]=function(_0x19ca5a,_0x19fcbf){if(_0x19ca5a[_0x0ddb('0x48')]['id']){delete _0x19ca5a[_0x0ddb('0x48')]['id'];}return db[_0x0ddb('0x2c')]['find']({'where':{'id':_0x19ca5a[_0x0ddb('0x49')]['id']}})['then'](handleEntityNotFound(_0x19fcbf,null))[_0x0ddb('0x25')](saveUpdates(_0x19ca5a['body'],null))['then'](respondWithResult(_0x19fcbf,null))[_0x0ddb('0x45')](handleError(_0x19fcbf,null));};exports[_0x0ddb('0x26')]=function(_0xd6c847,_0x36f838){return db[_0x0ddb('0x2c')][_0x0ddb('0x4a')]({'where':{'id':_0xd6c847[_0x0ddb('0x49')]['id']}})[_0x0ddb('0x25')](handleEntityNotFound(_0x36f838,null))[_0x0ddb('0x25')](removeEntity(_0x36f838,null))['catch'](handleError(_0x36f838,null));};exports[_0x0ddb('0x4b')]=function(_0x3b0fb5,_0x2f1d43){return db[_0x0ddb('0x2c')][_0x0ddb('0x4b')]()[_0x0ddb('0x25')](respondWithResult(_0x2f1d43,null))[_0x0ddb('0x45')](handleError(_0x2f1d43,null));}; \ No newline at end of file +var _0xb43d=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','then','error','name','send','index','map','ChatTransferReport','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','keys','include','create','body','find','describe','eml-format'];(function(_0x574b14,_0x294789){var _0x477df4=function(_0x2a7734){while(--_0x2a7734){_0x574b14['push'](_0x574b14['shift']());}};_0x477df4(++_0x294789);}(_0xb43d,0xd1));var _0xdb43=function(_0x3f49ce,_0x35bc84){_0x3f49ce=_0x3f49ce-0x0;var _0x54a3d0=_0xb43d[_0x3f49ce];return _0x54a3d0;};'use strict';var emlformat=require(_0xdb43('0x0'));var rimraf=require(_0xdb43('0x1'));var zipdir=require(_0xdb43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb43('0x3'));var moment=require(_0xdb43('0x4'));var BPromise=require(_0xdb43('0x5'));var Mustache=require(_0xdb43('0x6'));var util=require('util');var path=require(_0xdb43('0x7'));var sox=require(_0xdb43('0x8'));var csv=require(_0xdb43('0x9'));var ejs=require(_0xdb43('0xa'));var fs=require('fs');var fs_extra=require(_0xdb43('0xb'));var _=require(_0xdb43('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdb43('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdb43('0xe'));var Papa=require(_0xdb43('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdb43('0x10'));var as=require(_0xdb43('0x11'));var hardwareService=require(_0xdb43('0x12'));var logger=require(_0xdb43('0x13'))('api');var utils=require(_0xdb43('0x14'));var config=require(_0xdb43('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb43('0x16'))['db'];function respondWithStatusCode(_0x4663e1,_0x336147){_0x336147=_0x336147||0xcc;return function(_0x5a06a5){if(_0x5a06a5){return _0x4663e1['sendStatus'](_0x336147);}return _0x4663e1[_0xdb43('0x17')](_0x336147)[_0xdb43('0x18')]();};}function respondWithResult(_0x3415c8,_0x4e6492){_0x4e6492=_0x4e6492||0xc8;return function(_0x267e2a){if(_0x267e2a){return _0x3415c8[_0xdb43('0x17')](_0x4e6492)[_0xdb43('0x19')](_0x267e2a);}};}function respondWithFilteredResult(_0x5f5360,_0x3b67bb){return function(_0x576488){if(_0x576488){var _0x539654=typeof _0x3b67bb[_0xdb43('0x1a')]==='undefined'&&typeof _0x3b67bb[_0xdb43('0x1b')]===_0xdb43('0x1c');var _0x4e7043=_0x576488[_0xdb43('0x1d')];var _0x43720f=_0x539654?0x0:_0x3b67bb[_0xdb43('0x1a')];var _0x588c6f=_0x539654?_0x576488[_0xdb43('0x1d')]:_0x3b67bb[_0xdb43('0x1a')]+_0x3b67bb[_0xdb43('0x1b')];var _0x149c00;if(_0x588c6f>=_0x4e7043){_0x588c6f=_0x4e7043;_0x149c00=0xc8;}else{_0x149c00=0xce;}_0x5f5360['status'](_0x149c00);return _0x5f5360[_0xdb43('0x1e')]('Content-Range',_0x43720f+'-'+_0x588c6f+'/'+_0x4e7043)[_0xdb43('0x19')](_0x576488);}return null;};}function patchUpdates(_0x326c5f){return function(_0x30f95d){try{jsonpatch['apply'](_0x30f95d,_0x326c5f,!![]);}catch(_0x301a0a){return BPromise[_0xdb43('0x1f')](_0x301a0a);}return _0x30f95d[_0xdb43('0x20')]();};}function saveUpdates(_0x2e1dfe,_0x4bb9a9){return function(_0x523b11){if(_0x523b11){return _0x523b11[_0xdb43('0x21')](_0x2e1dfe)['then'](function(_0x4efb4e){return _0x4efb4e;});}return null;};}function removeEntity(_0x5d71e3,_0x333ace){return function(_0x27a4e1){if(_0x27a4e1){return _0x27a4e1[_0xdb43('0x22')]()[_0xdb43('0x23')](function(){_0x5d71e3[_0xdb43('0x17')](0xcc)[_0xdb43('0x18')]();});}};}function handleEntityNotFound(_0x2fb621,_0x874316){return function(_0x2fd025){if(!_0x2fd025){_0x2fb621['sendStatus'](0x194);}return _0x2fd025;};}function handleError(_0x1d7c3b,_0x132a93){_0x132a93=_0x132a93||0x1f4;return function(_0x25459d){logger[_0xdb43('0x24')](_0x25459d['stack']);if(_0x25459d[_0xdb43('0x25')]){delete _0x25459d['name'];}_0x1d7c3b[_0xdb43('0x17')](_0x132a93)[_0xdb43('0x26')](_0x25459d);};}exports[_0xdb43('0x27')]=function(_0x278111,_0x59b435){var _0x38a4d3={},_0x368b58={},_0x16133b={'count':0x0,'rows':[]};var _0x528bbb=_[_0xdb43('0x28')](db[_0xdb43('0x29')][_0xdb43('0x2a')],function(_0x2c6f7c){return{'name':_0x2c6f7c['fieldName'],'type':_0x2c6f7c['type']['key']};});_0x368b58[_0xdb43('0x2b')]=_[_0xdb43('0x28')](_0x528bbb,_0xdb43('0x25'));_0x368b58['query']=_['keys'](_0x278111[_0xdb43('0x2c')]);_0x368b58[_0xdb43('0x2d')]=_[_0xdb43('0x2e')](_0x368b58[_0xdb43('0x2b')],_0x368b58[_0xdb43('0x2c')]);_0x38a4d3[_0xdb43('0x2f')]=_[_0xdb43('0x2e')](_0x368b58['model'],qs[_0xdb43('0x30')](_0x278111[_0xdb43('0x2c')][_0xdb43('0x30')]));_0x38a4d3[_0xdb43('0x2f')]=_0x38a4d3[_0xdb43('0x2f')][_0xdb43('0x31')]?_0x38a4d3[_0xdb43('0x2f')]:_0x368b58[_0xdb43('0x2b')];if(!_0x278111[_0xdb43('0x2c')][_0xdb43('0x32')](_0xdb43('0x33'))){_0x38a4d3['limit']=qs[_0xdb43('0x1b')](_0x278111[_0xdb43('0x2c')][_0xdb43('0x1b')]);_0x38a4d3['offset']=qs['offset'](_0x278111['query'][_0xdb43('0x1a')]);}_0x38a4d3['order']=qs[_0xdb43('0x34')](_0x278111[_0xdb43('0x2c')]['sort']);_0x38a4d3[_0xdb43('0x35')]=qs[_0xdb43('0x2d')](_['pick'](_0x278111['query'],_0x368b58[_0xdb43('0x2d')]),_0x528bbb);if(_0x278111[_0xdb43('0x2c')][_0xdb43('0x36')]){_0x38a4d3[_0xdb43('0x35')]=_['merge'](_0x38a4d3[_0xdb43('0x35')],{'$or':_[_0xdb43('0x28')](_0x528bbb,function(_0x478d53){if(_0x478d53[_0xdb43('0x37')]!==_0xdb43('0x38')){var _0x363b59={};_0x363b59[_0x478d53[_0xdb43('0x25')]]={'$like':'%'+_0x278111[_0xdb43('0x2c')][_0xdb43('0x36')]+'%'};return _0x363b59;}})});}_0x38a4d3=_[_0xdb43('0x39')]({},_0x38a4d3,_0x278111[_0xdb43('0x3a')]);var _0x4ac283={'where':_0x38a4d3[_0xdb43('0x35')]};return db[_0xdb43('0x29')][_0xdb43('0x1d')](_0x4ac283)[_0xdb43('0x23')](function(_0x551bc4){_0x16133b[_0xdb43('0x1d')]=_0x551bc4;if(_0x278111[_0xdb43('0x2c')][_0xdb43('0x3b')]){_0x38a4d3['include']=[{'all':!![]}];}return db[_0xdb43('0x29')][_0xdb43('0x3c')](_0x38a4d3);})['then'](function(_0x5c250d){_0x16133b[_0xdb43('0x3d')]=_0x5c250d;return _0x16133b;})[_0xdb43('0x23')](respondWithFilteredResult(_0x59b435,_0x38a4d3))[_0xdb43('0x3e')](handleError(_0x59b435,null));};exports['show']=function(_0x34c008,_0x1c1054){var _0x58824f={'raw':!![],'where':{'id':_0x34c008[_0xdb43('0x3f')]['id']}},_0x2aa8a9={};_0x2aa8a9['model']=_[_0xdb43('0x40')](db[_0xdb43('0x29')][_0xdb43('0x2a')]);_0x2aa8a9[_0xdb43('0x2c')]=_[_0xdb43('0x40')](_0x34c008[_0xdb43('0x2c')]);_0x2aa8a9['filters']=_[_0xdb43('0x2e')](_0x2aa8a9[_0xdb43('0x2b')],_0x2aa8a9[_0xdb43('0x2c')]);_0x58824f[_0xdb43('0x2f')]=_[_0xdb43('0x2e')](_0x2aa8a9[_0xdb43('0x2b')],qs[_0xdb43('0x30')](_0x34c008[_0xdb43('0x2c')][_0xdb43('0x30')]));_0x58824f[_0xdb43('0x2f')]=_0x58824f[_0xdb43('0x2f')][_0xdb43('0x31')]?_0x58824f[_0xdb43('0x2f')]:_0x2aa8a9['model'];if(_0x34c008['query']['includeAll']){_0x58824f[_0xdb43('0x41')]=[{'all':!![]}];}_0x58824f=_[_0xdb43('0x39')]({},_0x58824f,_0x34c008[_0xdb43('0x3a')]);return db[_0xdb43('0x29')]['find'](_0x58824f)[_0xdb43('0x23')](handleEntityNotFound(_0x1c1054,null))['then'](respondWithResult(_0x1c1054,null))[_0xdb43('0x3e')](handleError(_0x1c1054,null));};exports[_0xdb43('0x42')]=function(_0x1bc04f,_0x3cadc3){return db[_0xdb43('0x29')][_0xdb43('0x42')](_0x1bc04f[_0xdb43('0x43')],{})[_0xdb43('0x23')](respondWithResult(_0x3cadc3,0xc9))['catch'](handleError(_0x3cadc3,null));};exports['update']=function(_0x11ba98,_0x1958c8){if(_0x11ba98[_0xdb43('0x43')]['id']){delete _0x11ba98[_0xdb43('0x43')]['id'];}return db['ChatTransferReport'][_0xdb43('0x44')]({'where':{'id':_0x11ba98[_0xdb43('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1958c8,null))[_0xdb43('0x23')](saveUpdates(_0x11ba98[_0xdb43('0x43')],null))['then'](respondWithResult(_0x1958c8,null))[_0xdb43('0x3e')](handleError(_0x1958c8,null));};exports[_0xdb43('0x22')]=function(_0x45069f,_0x38a92e){return db['ChatTransferReport'][_0xdb43('0x44')]({'where':{'id':_0x45069f[_0xdb43('0x3f')]['id']}})[_0xdb43('0x23')](handleEntityNotFound(_0x38a92e,null))[_0xdb43('0x23')](removeEntity(_0x38a92e,null))[_0xdb43('0x3e')](handleError(_0x38a92e,null));};exports['describe']=function(_0x2646f7,_0x1169e5){return db['ChatTransferReport'][_0xdb43('0x45')]()[_0xdb43('0x23')](respondWithResult(_0x1169e5,null))['catch'](handleError(_0x1169e5,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index b8cf14f..676f583 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 _0x70c7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','api'];(function(_0x22e8a5,_0x46f2bd){var _0x1b23eb=function(_0xe0287f){while(--_0xe0287f){_0x22e8a5['push'](_0x22e8a5['shift']());}};_0x1b23eb(++_0x46f2bd);}(_0x70c7,0x177));var _0x770c=function(_0xefa0bd,_0x19b591){_0xefa0bd=_0xefa0bd-0x0;var _0x612c61=_0x70c7[_0xefa0bd];return _0x612c61;};'use strict';var _=require(_0x770c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x770c('0x1'));var moment=require(_0x770c('0x2'));var BPromise=require(_0x770c('0x3'));var rp=require(_0x770c('0x4'));var fs=require('fs');var path=require(_0x770c('0x5'));var rimraf=require(_0x770c('0x6'));var config=require(_0x770c('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0x770c('0x8')]=function(_0x5f5414,_0x4368e5){return _0x5f5414[_0x770c('0x9')](_0x770c('0xa'),attributes,{'tableName':_0x770c('0xb'),'paranoid':![],'indexes':[{'name':_0x770c('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d51=['rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x12dc9a,_0x415013){var _0x5cdf78=function(_0x724514){while(--_0x724514){_0x12dc9a['push'](_0x12dc9a['shift']());}};_0x5cdf78(++_0x415013);}(_0x6d51,0x1cd));var _0x16d5=function(_0x5c0125,_0x3841b5){_0x5c0125=_0x5c0125-0x0;var _0x23da73=_0x6d51[_0x5c0125];return _0x23da73;};'use strict';var _=require(_0x16d5('0x0'));var util=require(_0x16d5('0x1'));var logger=require(_0x16d5('0x2'))('api');var moment=require(_0x16d5('0x3'));var BPromise=require(_0x16d5('0x4'));var rp=require(_0x16d5('0x5'));var fs=require('fs');var path=require(_0x16d5('0x6'));var rimraf=require(_0x16d5('0x7'));var config=require(_0x16d5('0x8'));var attributes=require(_0x16d5('0x9'));module[_0x16d5('0xa')]=function(_0x279977,_0x50decd){return _0x279977['define'](_0x16d5('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x16d5('0xc'),'fields':[_0x16d5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index a749678..f2b5218 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 _0x39e3=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x39e3,0xe6));var _0x339e=function(_0x3d4dd8,_0x5bdc3d){_0x3d4dd8=_0x3d4dd8-0x0;var _0x124efc=_0x39e3[_0x3d4dd8];return _0x124efc;};'use strict';var _=require('lodash');var util=require(_0x339e('0x0'));var moment=require(_0x339e('0x1'));var BPromise=require(_0x339e('0x2'));var rs=require(_0x339e('0x3'));var fs=require('fs');var Redis=require(_0x339e('0x4'));var db=require(_0x339e('0x5'))['db'];var utils=require(_0x339e('0x6'));var logger=require(_0x339e('0x7'))('rpc');var config=require(_0x339e('0x8'));var jayson=require(_0x339e('0x9'));var client=jayson[_0x339e('0xa')][_0x339e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39fa7e,_0xea2dae,_0x389a06){return new BPromise(function(_0x15578d,_0x297534){return client[_0x339e('0xc')](_0x39fa7e,_0x389a06)[_0x339e('0xd')](function(_0x52f79f){logger[_0x339e('0xe')](_0x339e('0xf'),_0xea2dae,'request\x20sent');logger[_0x339e('0x10')](_0x339e('0x11'),_0xea2dae,_0x339e('0x12'),JSON[_0x339e('0x13')](_0x52f79f));if(_0x52f79f[_0x339e('0x14')]){if(_0x52f79f['error'][_0x339e('0x15')]===0x1f4){logger[_0x339e('0x14')](_0x339e('0xf'),_0xea2dae,_0x52f79f['error'][_0x339e('0x16')]);return _0x297534(_0x52f79f[_0x339e('0x14')][_0x339e('0x16')]);}logger[_0x339e('0x14')](_0x339e('0xf'),_0xea2dae,_0x52f79f[_0x339e('0x14')][_0x339e('0x16')]);return _0x15578d(_0x52f79f[_0x339e('0x14')][_0x339e('0x16')]);}else{logger[_0x339e('0xe')](_0x339e('0xf'),_0xea2dae,_0x339e('0x12'));_0x15578d(_0x52f79f[_0x339e('0x17')][_0x339e('0x16')]);}})[_0x339e('0x18')](function(_0x4435d3){logger[_0x339e('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0xea2dae,_0x4435d3);_0x297534(_0x4435d3);});});} \ No newline at end of file +var _0x5148=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb'];(function(_0x5081c6,_0x39cd1d){var _0x782db1=function(_0x4549bc){while(--_0x4549bc){_0x5081c6['push'](_0x5081c6['shift']());}};_0x782db1(++_0x39cd1d);}(_0x5148,0x1c4));var _0x8514=function(_0x3582de,_0x4cd6d1){_0x3582de=_0x3582de-0x0;var _0x202b18=_0x5148[_0x3582de];return _0x202b18;};'use strict';var _=require(_0x8514('0x0'));var util=require('util');var moment=require(_0x8514('0x1'));var BPromise=require(_0x8514('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8514('0x3'))['db'];var utils=require(_0x8514('0x4'));var logger=require(_0x8514('0x5'))(_0x8514('0x6'));var config=require(_0x8514('0x7'));var jayson=require(_0x8514('0x8'));var client=jayson[_0x8514('0x9')][_0x8514('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2083c8,_0x55db5b,_0x28e4df){return new BPromise(function(_0x18ca0b,_0x2cfdf3){return client[_0x8514('0xb')](_0x2083c8,_0x28e4df)[_0x8514('0xc')](function(_0x4b04eb){logger[_0x8514('0xd')](_0x8514('0xe'),_0x55db5b,_0x8514('0xf'));logger[_0x8514('0x10')](_0x8514('0x11'),_0x55db5b,_0x8514('0xf'),JSON[_0x8514('0x12')](_0x4b04eb));if(_0x4b04eb['error']){if(_0x4b04eb[_0x8514('0x13')][_0x8514('0x14')]===0x1f4){logger[_0x8514('0x13')](_0x8514('0xe'),_0x55db5b,_0x4b04eb[_0x8514('0x13')][_0x8514('0x15')]);return _0x2cfdf3(_0x4b04eb[_0x8514('0x13')][_0x8514('0x15')]);}logger[_0x8514('0x13')](_0x8514('0xe'),_0x55db5b,_0x4b04eb['error'][_0x8514('0x15')]);return _0x18ca0b(_0x4b04eb[_0x8514('0x13')][_0x8514('0x15')]);}else{logger[_0x8514('0xd')](_0x8514('0xe'),_0x55db5b,_0x8514('0xf'));_0x18ca0b(_0x4b04eb[_0x8514('0x16')][_0x8514('0x15')]);}})[_0x8514('0x17')](function(_0x19e292){logger[_0x8514('0x13')](_0x8514('0xe'),_0x55db5b,_0x19e292);_0x2cfdf3(_0x19e292);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6b54588..b8aab88 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 _0x5539=['/describe','describe','get','post','create','put','update','delete','/:id','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index'];(function(_0x31e2b2,_0x1c67aa){var _0x2909b9=function(_0x5e3edb){while(--_0x5e3edb){_0x31e2b2['push'](_0x31e2b2['shift']());}};_0x2909b9(++_0x1c67aa);}(_0x5539,0x16f));var _0x9553=function(_0x549c8a,_0x102246){_0x549c8a=_0x549c8a-0x0;var _0x2793f4=_0x5539[_0x549c8a];return _0x2793f4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9553('0x0'));var timeout=require(_0x9553('0x1'));var express=require(_0x9553('0x2'));var router=express[_0x9553('0x3')]();var fs_extra=require(_0x9553('0x4'));var auth=require(_0x9553('0x5'));var interaction=require(_0x9553('0x6'));var config=require(_0x9553('0x7'));var controller=require(_0x9553('0x8'));router['get']('/',auth[_0x9553('0x9')](),controller[_0x9553('0xa')]);router['get'](_0x9553('0xb'),auth['isAuthenticated'](),controller[_0x9553('0xc')]);router[_0x9553('0xd')]('/:id',auth[_0x9553('0x9')](),controller['show']);router[_0x9553('0xe')]('/',auth['isAuthenticated'](),controller[_0x9553('0xf')]);router[_0x9553('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9553('0x11')]);router[_0x9553('0x12')](_0x9553('0x13'),auth['isAuthenticated'](),controller[_0x9553('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc768=['update','destroy','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','post','create','put','/:id'];(function(_0x43e315,_0x542b4a){var _0x102fd6=function(_0xc74c86){while(--_0xc74c86){_0x43e315['push'](_0x43e315['shift']());}};_0x102fd6(++_0x542b4a);}(_0xc768,0x18f));var _0x8c76=function(_0x200f02,_0x3cbb05){_0x200f02=_0x200f02-0x0;var _0x26fbfa=_0xc768[_0x200f02];return _0x26fbfa;};'use strict';var multer=require(_0x8c76('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8c76('0x1'));var router=express[_0x8c76('0x2')]();var fs_extra=require(_0x8c76('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8c76('0x4'));var config=require(_0x8c76('0x5'));var controller=require(_0x8c76('0x6'));router[_0x8c76('0x7')]('/',auth[_0x8c76('0x8')](),controller['index']);router[_0x8c76('0x7')](_0x8c76('0x9'),auth['isAuthenticated'](),controller[_0x8c76('0xa')]);router[_0x8c76('0x7')]('/:id',auth[_0x8c76('0x8')](),controller['show']);router[_0x8c76('0xb')]('/',auth['isAuthenticated'](),controller[_0x8c76('0xc')]);router[_0x8c76('0xd')](_0x8c76('0xe'),auth[_0x8c76('0x8')](),controller[_0x8c76('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8c76('0x10')]);module[_0x8c76('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 66dd6d1..1df8ccc 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 _0xfadd=['input','name','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','INTEGER','TEXT','stringify'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0xfadd,0x1ca));var _0xdfad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfadd[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xdfad('0x0'));var rs=require(_0xdfad('0x1'));module['exports']={'name':{'type':Sequelize[_0xdfad('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xdfad('0x2')],'allowNull':![],'unique':_0xdfad('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xdfad('0x4')},'key':{'type':Sequelize[_0xdfad('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xdfad('0x2')],'allowNull':![],'defaultValue':_0xdfad('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xdfad('0x2')],'allowNull':![],'defaultValue':_0xdfad('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdfad('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xdfad('0x2')]},'animation':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xdfad('0x8')](_0xdfad('0x9'),_0xdfad('0xa')),'defaultValue':_0xdfad('0x9')},'header_online':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xdfad('0xc')},'offline_chat_button':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0xd')},'header_offline':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0xe')},'download_transcript':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xdfad('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0x11')},'noteTitle':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0x12')},'closingMessageButton':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0xd')},'skipMessageButton':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0x13')},'conditionAgreement':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0x14')},'ratingType':{'type':Sequelize[_0xdfad('0x8')](_0xdfad('0x15'),_0xdfad('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xdfad('0x17')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xdfad('0x18')],'defaultValue':function(){return JSON[_0xdfad('0x19')]({'items':[{'type':_0xdfad('0x1a'),'variable':null,'config':{'placeholder':_0xdfad('0x1b'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xdfad('0x1a'),'props':{'title':_0xdfad('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xdfad('0x4'),'type':_0xdfad('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xdfad('0x1c')](_0xdfad('0x1d'))?JSON['parse'](this[_0xdfad('0x1c')]('onlineForm')):{};},'set':function(_0x5449fe){return this[_0xdfad('0x1e')](_0xdfad('0x1d'),JSON[_0xdfad('0x19')](_0x5449fe));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xdfad('0x19')]({'items':[{'type':_0xdfad('0x1a'),'props':{'title':_0xdfad('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xdfad('0x4'),'type':_0xdfad('0x4')},'variable':null},{'type':_0xdfad('0x1f'),'config':{'placeholder':_0xdfad('0x20')},'props':{'title':_0xdfad('0x20'),'helpText':_0xdfad('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xdfad('0x1c')](_0xdfad('0x22'))?JSON[_0xdfad('0x23')](this[_0xdfad('0x1c')](_0xdfad('0x22'))):{};},'set':function(_0x1a1ead){return this[_0xdfad('0x1e')](_0xdfad('0x22'),JSON[_0xdfad('0x19')](_0x1a1ead));}},'token':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xdfad('0x2')]},'forwardOffline':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xdfad('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0x25')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xdfad('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xdfad('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xdfad('0x18')]},'showAgentAvatar':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xdfad('0x2')]},'notificationTemplate':{'type':Sequelize[_0xdfad('0x18')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xdfad('0x2')],'defaultValue':_0xdfad('0x27')},'defaultTitle':{'type':Sequelize[_0xdfad('0x2')]},'customerAvatar':{'type':Sequelize[_0xdfad('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xdfad('0x17')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdfad('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdfad('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xdfad('0x28')},'systemAvatar':{'type':Sequelize[_0xdfad('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdfad('0x17')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![],'comment':_0xdfad('0x29'),'set':function(_0x4d826b){if(!_0x4d826b)this[_0xdfad('0x1e')](_0xdfad('0x2a'),null);this[_0xdfad('0x1e')]('mandatoryDisposition',_0x4d826b);}},'vidaooEscalation':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xdfad('0x2')]},'vidaooTopic':{'type':Sequelize[_0xdfad('0x2')],'allowNull':![],'defaultValue':_0xdfad('0x2b')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xdfad('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xdfad('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x49b9=['Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','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','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared'];(function(_0x505d34,_0x150c74){var _0x1c5a5c=function(_0x1089df){while(--_0x1089df){_0x505d34['push'](_0x505d34['shift']());}};_0x1c5a5c(++_0x150c74);}(_0x49b9,0xfc));var _0x949b=function(_0x8b1f09,_0x4beb03){_0x8b1f09=_0x8b1f09-0x0;var _0x426969=_0x49b9[_0x8b1f09];return _0x426969;};'use strict';var Sequelize=require(_0x949b('0x0'));var rs=require(_0x949b('0x1'));module[_0x949b('0x2')]={'name':{'type':Sequelize[_0x949b('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x949b('0x3')],'allowNull':![],'unique':_0x949b('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x949b('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x949b('0x6')},'customerAlias':{'type':Sequelize[_0x949b('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x949b('0x3')],'allowNull':![],'defaultValue':_0x949b('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x949b('0x3')],'allowNull':![],'defaultValue':_0x949b('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x949b('0x3')],'allowNull':![],'defaultValue':_0x949b('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x949b('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x949b('0x3')]},'animation':{'type':Sequelize[_0x949b('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x949b('0xb')]('rounded',_0x949b('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x949b('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0xd')},'offline_chat_button':{'type':Sequelize[_0x949b('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x949b('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x949b('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x949b('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x949b('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x949b('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x949b('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0x12')},'placeholderMessage':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0x13')},'closingMessage':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0x14')},'closingMessageButton':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0x15')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x949b('0x16')},'conditionAgreement':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x949b('0x17')},'ratingType':{'type':Sequelize[_0x949b('0xb')](_0x949b('0x18'),_0x949b('0x19')),'defaultValue':_0x949b('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x949b('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x949b('0xf')],'defaultValue':function(){return JSON[_0x949b('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x949b('0x1b'),'type':_0x949b('0x1c'),'required':!![]},'props':{'title':_0x949b('0x1b'),'helpText':''}},{'type':_0x949b('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x949b('0x5'),'type':_0x949b('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x949b('0x1e')](_0x949b('0x1f'))?JSON[_0x949b('0x20')](this[_0x949b('0x1e')](_0x949b('0x1f'))):{};},'set':function(_0x18d48f){return this[_0x949b('0x21')]('onlineForm',JSON[_0x949b('0x1a')](_0x18d48f));}},'offlineForm':{'type':Sequelize[_0x949b('0xf')],'defaultValue':function(){return JSON[_0x949b('0x1a')]({'items':[{'type':_0x949b('0x1d'),'props':{'title':_0x949b('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x949b('0x5'),'type':_0x949b('0x5')},'variable':null},{'type':_0x949b('0x22'),'config':{'placeholder':_0x949b('0x23')},'props':{'title':_0x949b('0x23'),'helpText':_0x949b('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x949b('0x1e')](_0x949b('0x25'))?JSON['parse'](this['getDataValue'](_0x949b('0x25'))):{};},'set':function(_0x36376d){return this['setDataValue']('offlineForm',JSON[_0x949b('0x1a')](_0x36376d));}},'token':{'type':Sequelize[_0x949b('0x3')],'defaultValue':function(){return rs[_0x949b('0x26')]();}},'autoclose':{'type':Sequelize[_0x949b('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x949b('0x3')]},'waitingTitle':{'type':Sequelize[_0x949b('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x949b('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x949b('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x949b('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x949b('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0x16')},'sendUnmanaged':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0x15')},'enableCustomerAttachment':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x949b('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x949b('0xf')],'defaultValue':function(){return _0x949b('0x2b');}},'notificationSound':{'type':Sequelize[_0x949b('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x949b('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0x2c')},'verticalAlignment':{'type':Sequelize[_0x949b('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x949b('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x949b('0x3')],'allowNull':![],'defaultValue':_0x949b('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x949b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x949b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x949b('0x3')],'defaultValue':_0x949b('0x2f')},'systemAvatar':{'type':Sequelize[_0x949b('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x949b('0x9')],'comment':_0x949b('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![],'comment':_0x949b('0x31'),'set':function(_0xc0060c){if(!_0xc0060c)this[_0x949b('0x21')]('mandatoryDispositionPauseId',null);this[_0x949b('0x21')](_0x949b('0x32'),_0xc0060c);}},'vidaooEscalation':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x949b('0x3')]},'vidaooTopic':{'type':Sequelize[_0x949b('0x3')],'allowNull':![],'defaultValue':_0x949b('0x33')},'vidaooNote':{'type':Sequelize[_0x949b('0x3')],'defaultValue':function(){return _0x949b('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x949b('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x949b('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x949b('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index d90ede8..86451bf 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 _0xac0a=['request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','status','end','json','offset','limit','undefined','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','rawAttributes','fieldName','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','count','includeAll','ChatWebsite','rows','catch','show','params','mandatoryDispositionPause','keys','include','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','ChatApplication','Applications','List','applications','list','orderBy','priority','asc','account','contact','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','stringify','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','describe','ListId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','all','some','readFileSync','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','textColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','transaction','ISOLATION_LEVELS','findAndCountAll','sendStatus','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','html-to-text','jayson/promise','client','http'];(function(_0x227edc,_0x26a1a1){var _0x21bcba=function(_0x25508c){while(--_0x25508c){_0x227edc['push'](_0x227edc['shift']());}};_0x21bcba(++_0x26a1a1);}(_0xac0a,0x11e));var _0xaac0=function(_0x44be08,_0x314180){_0x44be08=_0x44be08-0x0;var _0x4a423a=_0xac0a[_0x44be08];return _0x4a423a;};'use strict';var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac0('0x0'));var path=require(_0xaac0('0x1'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaac0('0x2'));var _=require(_0xaac0('0x3'));var querystring=require(_0xaac0('0x4'));var Redis=require(_0xaac0('0x5'));var qs=require(_0xaac0('0x6'));var logger=require(_0xaac0('0x7'))(_0xaac0('0x8'));var config=require(_0xaac0('0x9'));var db=require(_0xaac0('0xa'))['db'];config[_0xaac0('0xb')]=_[_0xaac0('0xc')](config[_0xaac0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xaac0('0xd'))(new Redis(config[_0xaac0('0xb')]));require('./chatWebsite.socket')[_0xaac0('0xe')](socket);var htmlToText=require(_0xaac0('0xf'));var jayson=require(_0xaac0('0x10'));var client=jayson[_0xaac0('0x11')][_0xaac0('0x12')]({'port':0x232c});var client9002=jayson[_0xaac0('0x11')][_0xaac0('0x12')]({'port':0x232a});var client9003=jayson[_0xaac0('0x11')][_0xaac0('0x12')]({'port':0x232b});var client9001=jayson[_0xaac0('0x11')][_0xaac0('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x19aa52,_0x418abc,_0x2d19b8,_0x1a28a8){return new BPromise(function(_0x2109a4,_0x2fdd0a){var _0x5b5fdc=_0x1a28a8||client;return _0x5b5fdc[_0xaac0('0x13')](_0x19aa52,_0x2d19b8)[_0xaac0('0x14')](function(_0x8f2200){logger[_0xaac0('0x15')](_0xaac0('0x16'),_0x418abc,_0xaac0('0x17'));logger[_0xaac0('0x18')](_0xaac0('0x19'),_0x418abc,_0xaac0('0x17'),JSON['stringify'](_0x8f2200));if(_0x8f2200[_0xaac0('0x1a')]){if(_0x8f2200['error']['code']===0x1f4){logger[_0xaac0('0x1a')](_0xaac0('0x16'),_0x418abc,_0x8f2200['error'][_0xaac0('0x1b')]);return _0x2fdd0a(_0x8f2200[_0xaac0('0x1a')]['message']);}logger[_0xaac0('0x1a')](_0xaac0('0x16'),_0x418abc,_0x8f2200[_0xaac0('0x1a')][_0xaac0('0x1b')]);return _0x2109a4(_0x8f2200[_0xaac0('0x1a')][_0xaac0('0x1b')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x418abc,_0xaac0('0x17'));_0x2109a4(_0x8f2200[_0xaac0('0x1c')]['message']);}})['catch'](function(_0x33d2cd){logger[_0xaac0('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x418abc,_0x33d2cd);_0x2fdd0a(_0x33d2cd);});});}function respondWithStatusCode(_0x222baa,_0x50b488){_0x50b488=_0x50b488||0xcc;return function(_0x3e967d){if(_0x3e967d){return _0x222baa['sendStatus'](_0x50b488);}return _0x222baa[_0xaac0('0x1d')](_0x50b488)[_0xaac0('0x1e')]();};}function respondWithResult(_0x2269fd,_0x17d486){_0x17d486=_0x17d486||0xc8;return function(_0x35de64){if(_0x35de64){return _0x2269fd[_0xaac0('0x1d')](_0x17d486)[_0xaac0('0x1f')](_0x35de64);}};}function respondWithFilteredResult(_0x50106e,_0xa05ba7){return function(_0x37fa18){if(_0x37fa18){var _0x1c10b9=typeof _0xa05ba7[_0xaac0('0x20')]==='undefined'&&typeof _0xa05ba7[_0xaac0('0x21')]===_0xaac0('0x22');var _0x15f0f4=_0x37fa18['count'];var _0x5b9593=_0x1c10b9?0x0:_0xa05ba7[_0xaac0('0x20')];var _0x46b879=_0x1c10b9?_0x37fa18['count']:_0xa05ba7['offset']+_0xa05ba7[_0xaac0('0x21')];var _0x8432d7;if(_0x46b879>=_0x15f0f4){_0x46b879=_0x15f0f4;_0x8432d7=0xc8;}else{_0x8432d7=0xce;}_0x50106e['status'](_0x8432d7);return _0x50106e['set'](_0xaac0('0x23'),_0x5b9593+'-'+_0x46b879+'/'+_0x15f0f4)[_0xaac0('0x1f')](_0x37fa18);}return null;};}function saveUpdates(_0x3558ee){return function(_0x218a5e){if(_0x218a5e){return _0x218a5e[_0xaac0('0x24')](_0x3558ee)['then'](function(_0x32d552){return _0x32d552;});}return null;};}function removeEntity(_0xe2d7c1){return function(_0x3bd25a){if(_0x3bd25a){return _0x3bd25a[_0xaac0('0x25')]()[_0xaac0('0x14')](function(){var _0x51b575=_0x3bd25a[_0xaac0('0x26')]({'plain':!![]});var _0x5744f4=_0xaac0('0x27');return db[_0xaac0('0x28')]['destroy']({'where':{'type':_0x5744f4,'resourceId':_0x51b575['id']}})[_0xaac0('0x14')](function(){return _0x3bd25a;});})[_0xaac0('0x14')](function(){_0xe2d7c1['status'](0xcc)[_0xaac0('0x1e')]();});}};}function handleEntityNotFound(_0x4d0eb7){return function(_0x1cdc62){if(!_0x1cdc62){_0x4d0eb7['sendStatus'](0x194);}return _0x1cdc62;};}function handleError(_0x2317e0,_0x156ce4){_0x156ce4=_0x156ce4||0x1f4;return function(_0x22da9c){logger[_0xaac0('0x1a')](_0x22da9c[_0xaac0('0x29')]);if(_0x22da9c[_0xaac0('0x2a')]){delete _0x22da9c[_0xaac0('0x2a')];}_0x2317e0[_0xaac0('0x1d')](_0x156ce4)[_0xaac0('0x2b')](_0x22da9c);};}exports[_0xaac0('0x2c')]=function(_0x30a33a,_0x490670){var _0xbff12b={'include':[{'model':db[_0xaac0('0x2d')],'as':'mandatoryDispositionPause'}]},_0x38f383={},_0x36a9a8={'count':0x0,'rows':[]};var _0x4f6e4c=_['map'](db['ChatWebsite'][_0xaac0('0x2e')],function(_0x2a524c){return{'name':_0x2a524c[_0xaac0('0x2f')],'type':_0x2a524c['type']['key']};});_0x38f383[_0xaac0('0x30')]=_[_0xaac0('0x31')](_0x4f6e4c,_0xaac0('0x2a'));_0x38f383[_0xaac0('0x32')]=_['keys'](_0x30a33a['query']);_0x38f383['filters']=_[_0xaac0('0x33')](_0x38f383[_0xaac0('0x30')],_0x38f383[_0xaac0('0x32')]);_0xbff12b[_0xaac0('0x34')]=_[_0xaac0('0x33')](_0x38f383['model'],qs[_0xaac0('0x35')](_0x30a33a[_0xaac0('0x32')][_0xaac0('0x35')]));_0xbff12b[_0xaac0('0x34')]=_0xbff12b['attributes'][_0xaac0('0x36')]?_0xbff12b[_0xaac0('0x34')]:_0x38f383['model'];if(!_0x30a33a[_0xaac0('0x32')][_0xaac0('0x37')](_0xaac0('0x38'))){_0xbff12b[_0xaac0('0x21')]=qs['limit'](_0x30a33a['query'][_0xaac0('0x21')]);_0xbff12b['offset']=qs[_0xaac0('0x20')](_0x30a33a[_0xaac0('0x32')][_0xaac0('0x20')]);}_0xbff12b[_0xaac0('0x39')]=qs[_0xaac0('0x3a')](_0x30a33a[_0xaac0('0x32')][_0xaac0('0x3a')]);_0xbff12b[_0xaac0('0x3b')]=qs[_0xaac0('0x3c')](_[_0xaac0('0x3d')](_0x30a33a['query'],_0x38f383[_0xaac0('0x3c')]),_0x4f6e4c);if(_0x30a33a[_0xaac0('0x32')]['filter']){_0xbff12b[_0xaac0('0x3b')]=_[_0xaac0('0x3e')](_0xbff12b['where'],{'$or':_[_0xaac0('0x31')](_0x4f6e4c,function(_0x4f2c69){if(_0x4f2c69[_0xaac0('0x3f')]!==_0xaac0('0x40')){var _0xc6d106={};_0xc6d106[_0x4f2c69[_0xaac0('0x2a')]]={'$like':'%'+_0x30a33a['query'][_0xaac0('0x41')]+'%'};return _0xc6d106;}})});}_0xbff12b=_[_0xaac0('0x3e')]({},_0xbff12b,_0x30a33a[_0xaac0('0x42')]);var _0x10fe1e={'where':_0xbff12b[_0xaac0('0x3b')]};return db['ChatWebsite'][_0xaac0('0x43')](_0x10fe1e)[_0xaac0('0x14')](function(_0x45a2f7){_0x36a9a8[_0xaac0('0x43')]=_0x45a2f7;if(_0x30a33a['query'][_0xaac0('0x44')]){_0xbff12b['include']=[{'all':!![]}];}return db[_0xaac0('0x45')]['findAll'](_0xbff12b);})[_0xaac0('0x14')](function(_0x8be5fc){_0x36a9a8[_0xaac0('0x46')]=_0x8be5fc;return _0x36a9a8;})['then'](respondWithFilteredResult(_0x490670,_0xbff12b))[_0xaac0('0x47')](handleError(_0x490670,null));};exports[_0xaac0('0x48')]=function(_0x2cb95e,_0x26849c){var _0x34b81d={'raw':![],'where':{'id':_0x2cb95e[_0xaac0('0x49')]['id']},'include':[{'model':db[_0xaac0('0x2d')],'as':_0xaac0('0x4a')}]},_0x1e7bcf={};_0x1e7bcf['model']=_[_0xaac0('0x4b')](db[_0xaac0('0x45')][_0xaac0('0x2e')]);_0x1e7bcf[_0xaac0('0x32')]=_[_0xaac0('0x4b')](_0x2cb95e[_0xaac0('0x32')]);_0x1e7bcf[_0xaac0('0x3c')]=_['intersection'](_0x1e7bcf['model'],_0x1e7bcf[_0xaac0('0x32')]);_0x34b81d['attributes']=_[_0xaac0('0x33')](_0x1e7bcf[_0xaac0('0x30')],qs[_0xaac0('0x35')](_0x2cb95e[_0xaac0('0x32')][_0xaac0('0x35')]));_0x34b81d[_0xaac0('0x34')]=_0x34b81d[_0xaac0('0x34')]['length']?_0x34b81d[_0xaac0('0x34')]:_0x1e7bcf[_0xaac0('0x30')];if(_0x2cb95e[_0xaac0('0x32')][_0xaac0('0x44')]){_0x34b81d[_0xaac0('0x4c')]=[{'all':!![]}];}_0x34b81d=_[_0xaac0('0x3e')]({},_0x34b81d,_0x2cb95e[_0xaac0('0x42')]);return db[_0xaac0('0x45')]['find'](_0x34b81d)['then'](handleEntityNotFound(_0x26849c,null))[_0xaac0('0x14')](respondWithResult(_0x26849c,null))['catch'](handleError(_0x26849c,null));};exports['create']=function(_0x2089e1,_0x235264){return db[_0xaac0('0x45')]['create'](_0x2089e1['body'],{})['then'](function(_0x2ae63d){var _0x469b79=_0x2089e1[_0xaac0('0x4d')][_0xaac0('0x26')]({'plain':!![]});if(!_0x469b79)throw new Error(_0xaac0('0x4e'));if(_0x469b79[_0xaac0('0x4f')]===_0xaac0('0x4d')){var _0x50b28e=_0x2ae63d[_0xaac0('0x26')]({'plain':!![]});var _0x293b05=_0xaac0('0x27');return db[_0xaac0('0x50')][_0xaac0('0x51')]({'where':{'name':_0x293b05,'userProfileId':_0x469b79['userProfileId']},'raw':!![]})[_0xaac0('0x14')](function(_0x17974a){if(_0x17974a&&_0x17974a[_0xaac0('0x52')]===0x0){return db[_0xaac0('0x28')][_0xaac0('0x53')]({'name':_0x50b28e[_0xaac0('0x2a')],'resourceId':_0x50b28e['id'],'type':_0x17974a[_0xaac0('0x2a')],'sectionId':_0x17974a['id']},{})['then'](function(){return _0x2ae63d;});}else{return _0x2ae63d;}})[_0xaac0('0x47')](function(_0x3f5f56){logger[_0xaac0('0x1a')](_0xaac0('0x54'),_0x3f5f56);throw _0x3f5f56;});}return _0x2ae63d;})['then'](respondWithResult(_0x235264,0xc9))[_0xaac0('0x47')](handleError(_0x235264,null));};exports['update']=function(_0x45e260,_0x4a828b){if(_0x45e260[_0xaac0('0x55')]['id']){delete _0x45e260[_0xaac0('0x55')]['id'];}return db[_0xaac0('0x45')][_0xaac0('0x51')]({'where':{'id':_0x45e260[_0xaac0('0x49')]['id']},'include':[{'model':db['Pause'],'as':_0xaac0('0x4a')}]})[_0xaac0('0x14')](handleEntityNotFound(_0x4a828b,null))[_0xaac0('0x14')](saveUpdates(_0x45e260['body'],null))['then'](respondWithResult(_0x4a828b,null))[_0xaac0('0x47')](handleError(_0x4a828b,null));};exports[_0xaac0('0x25')]=function(_0x1bc5d7,_0x376693){return db[_0xaac0('0x45')][_0xaac0('0x51')]({'where':{'id':_0x1bc5d7['params']['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x376693,null))[_0xaac0('0x14')](removeEntity(_0x376693,null))['catch'](handleError(_0x376693,null));};exports['describe']=function(_0x504d35,_0x93d51){return db['ChatWebsite']['describe']()[_0xaac0('0x14')](respondWithResult(_0x93d51,null))[_0xaac0('0x47')](handleError(_0x93d51,null));};exports[_0xaac0('0x56')]=function(_0x51ed05,_0x2fb130){if(_0x51ed05[_0xaac0('0x55')]['id']){delete _0x51ed05['body']['id'];}return db[_0xaac0('0x45')]['find']({'where':{'id':_0x51ed05[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x2fb130,null))[_0xaac0('0x14')](function(_0xb5e7cb){if(_0xb5e7cb){_0x51ed05['body'][_0xaac0('0x57')]=_0xb5e7cb['id'];return db[_0xaac0('0x58')][_0xaac0('0x53')](_0x51ed05[_0xaac0('0x55')]);}})[_0xaac0('0x14')](respondWithResult(_0x2fb130,null))[_0xaac0('0x47')](handleError(_0x2fb130,null));};exports[_0xaac0('0x59')]=function(_0x23a219,_0x42626d){var _0x24bbe0={'raw':![],'where':{}};var _0x214d04={};var _0x8a3d15={'count':0x0,'rows':[]};return db[_0xaac0('0x45')][_0xaac0('0x5a')]({'where':{'id':_0x23a219[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x42626d,null))[_0xaac0('0x14')](function(_0x203f19){if(_0x203f19){_0x214d04[_0xaac0('0x30')]=_[_0xaac0('0x4b')](db[_0xaac0('0x58')][_0xaac0('0x2e')]);_0x214d04[_0xaac0('0x32')]=_[_0xaac0('0x4b')](_0x23a219[_0xaac0('0x32')]);_0x214d04[_0xaac0('0x3c')]=_[_0xaac0('0x33')](_0x214d04[_0xaac0('0x30')],_0x214d04[_0xaac0('0x32')]);_0x24bbe0['attributes']=_[_0xaac0('0x33')](_0x214d04['model'],qs[_0xaac0('0x35')](_0x23a219[_0xaac0('0x32')][_0xaac0('0x35')]));_0x24bbe0[_0xaac0('0x34')]=_0x24bbe0[_0xaac0('0x34')][_0xaac0('0x36')]?_0x24bbe0[_0xaac0('0x34')]:_0x214d04[_0xaac0('0x30')];if(!_0x23a219[_0xaac0('0x32')][_0xaac0('0x37')](_0xaac0('0x38'))){_0x24bbe0['limit']=qs[_0xaac0('0x21')](_0x23a219[_0xaac0('0x32')][_0xaac0('0x21')]);_0x24bbe0[_0xaac0('0x20')]=qs[_0xaac0('0x20')](_0x23a219[_0xaac0('0x32')][_0xaac0('0x20')]);}_0x24bbe0[_0xaac0('0x39')]=qs[_0xaac0('0x3a')](_0x23a219[_0xaac0('0x32')][_0xaac0('0x3a')]);_0x24bbe0[_0xaac0('0x3b')]=qs[_0xaac0('0x3c')](_[_0xaac0('0x3d')](_0x23a219[_0xaac0('0x32')],_0x214d04[_0xaac0('0x3c')]));_0x24bbe0[_0xaac0('0x3b')]['ChatWebsiteId']=_0x203f19['id'];if(_0x23a219['query'][_0xaac0('0x41')]){_0x24bbe0[_0xaac0('0x3b')]=_[_0xaac0('0x3e')](_0x24bbe0[_0xaac0('0x3b')],{'$or':_[_0xaac0('0x31')](_0x24bbe0[_0xaac0('0x34')],function(_0x54794e){var _0x5b4fe5={};_0x5b4fe5[_0x54794e]={'$like':'%'+_0x23a219[_0xaac0('0x32')][_0xaac0('0x41')]+'%'};return _0x5b4fe5;})});}_0x24bbe0=_[_0xaac0('0x3e')]({},_0x24bbe0,_0x23a219[_0xaac0('0x42')]);return db[_0xaac0('0x58')]['count']({'where':_0x24bbe0['where']})[_0xaac0('0x14')](function(_0x135e43){_0x8a3d15[_0xaac0('0x43')]=_0x135e43;if(_0x23a219[_0xaac0('0x32')][_0xaac0('0x44')]){_0x24bbe0[_0xaac0('0x4c')]=[{'all':!![]}];}return db[_0xaac0('0x58')][_0xaac0('0x5b')](_0x24bbe0);})[_0xaac0('0x14')](function(_0xd5baa3){_0x8a3d15[_0xaac0('0x46')]=_0xd5baa3;return _0x8a3d15;});}})['then'](respondWithFilteredResult(_0x42626d,_0x24bbe0))['catch'](handleError(_0x42626d,null));};exports[_0xaac0('0x5c')]=function(_0x143906,_0x43cd8c){return db['ChatWebsite'][_0xaac0('0x51')]({'where':{'id':_0x143906[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x43cd8c,null))['then'](function(_0x369ddc){if(_0x369ddc){return _0x369ddc[_0xaac0('0x5c')](_0x143906[_0xaac0('0x32')][_0xaac0('0x5d')]);}})[_0xaac0('0x14')](respondWithStatusCode(_0x43cd8c,null))[_0xaac0('0x47')](handleError(_0x43cd8c,null));};exports[_0xaac0('0x5e')]=function(_0x49dc0b,_0xf27b55){if(_0x49dc0b[_0xaac0('0x55')]['id']){delete _0x49dc0b[_0xaac0('0x55')]['id'];}return db[_0xaac0('0x45')]['find']({'where':{'id':_0x49dc0b[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0xf27b55,null))[_0xaac0('0x14')](function(_0x10d520){if(_0x10d520){_0x49dc0b[_0xaac0('0x55')][_0xaac0('0x57')]=_0x10d520['id'];return db['CannedAnswer']['create'](_0x49dc0b[_0xaac0('0x55')]);}})['then'](respondWithResult(_0xf27b55,null))['catch'](handleError(_0xf27b55,null));};exports[_0xaac0('0x5f')]=function(_0x95cd70,_0x5a6ed8){var _0x65603e={'raw':![],'where':{}};var _0xe45e64={};var _0x30d1c9={'count':0x0,'rows':[]};return db[_0xaac0('0x45')][_0xaac0('0x5a')]({'where':{'id':_0x95cd70[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x5a6ed8,null))['then'](function(_0x35756a){if(_0x35756a){_0xe45e64[_0xaac0('0x30')]=_[_0xaac0('0x4b')](db['CannedAnswer'][_0xaac0('0x2e')]);_0xe45e64[_0xaac0('0x32')]=_[_0xaac0('0x4b')](_0x95cd70['query']);_0xe45e64[_0xaac0('0x3c')]=_[_0xaac0('0x33')](_0xe45e64[_0xaac0('0x30')],_0xe45e64[_0xaac0('0x32')]);_0x65603e[_0xaac0('0x34')]=_[_0xaac0('0x33')](_0xe45e64[_0xaac0('0x30')],qs[_0xaac0('0x35')](_0x95cd70['query']['fields']));_0x65603e[_0xaac0('0x34')]=_0x65603e[_0xaac0('0x34')][_0xaac0('0x36')]?_0x65603e[_0xaac0('0x34')]:_0xe45e64[_0xaac0('0x30')];if(!_0x95cd70['query']['hasOwnProperty'](_0xaac0('0x38'))){_0x65603e['limit']=qs['limit'](_0x95cd70[_0xaac0('0x32')]['limit']);_0x65603e[_0xaac0('0x20')]=qs['offset'](_0x95cd70[_0xaac0('0x32')][_0xaac0('0x20')]);}_0x65603e[_0xaac0('0x39')]=qs[_0xaac0('0x3a')](_0x95cd70['query']['sort']);_0x65603e[_0xaac0('0x3b')]=qs[_0xaac0('0x3c')](_['pick'](_0x95cd70[_0xaac0('0x32')],_0xe45e64[_0xaac0('0x3c')]));_0x65603e[_0xaac0('0x3b')][_0xaac0('0x57')]=_0x35756a['id'];if(_0x95cd70[_0xaac0('0x32')]['filter']){_0x65603e[_0xaac0('0x3b')]=_['merge'](_0x65603e[_0xaac0('0x3b')],{'$or':_[_0xaac0('0x31')](_0x65603e[_0xaac0('0x34')],function(_0x9ec637){var _0x104fba={};_0x104fba[_0x9ec637]={'$like':'%'+_0x95cd70[_0xaac0('0x32')]['filter']+'%'};return _0x104fba;})});}_0x65603e=_['merge']({},_0x65603e,_0x95cd70[_0xaac0('0x42')]);return db[_0xaac0('0x60')][_0xaac0('0x43')]({'where':_0x65603e[_0xaac0('0x3b')]})[_0xaac0('0x14')](function(_0x15c86d){_0x30d1c9[_0xaac0('0x43')]=_0x15c86d;if(_0x95cd70[_0xaac0('0x32')][_0xaac0('0x44')]){_0x65603e[_0xaac0('0x4c')]=[{'all':!![]}];}return db[_0xaac0('0x60')]['findAll'](_0x65603e);})[_0xaac0('0x14')](function(_0x480209){_0x30d1c9[_0xaac0('0x46')]=_0x480209;return _0x30d1c9;});}})[_0xaac0('0x14')](respondWithFilteredResult(_0x5a6ed8,_0x65603e))[_0xaac0('0x47')](handleError(_0x5a6ed8,null));};exports[_0xaac0('0x61')]=function(_0x1b2b8b,_0x57944e){return db[_0xaac0('0x45')][_0xaac0('0x51')]({'where':{'id':_0x1b2b8b[_0xaac0('0x49')]['id']}})['then'](handleEntityNotFound(_0x57944e,null))[_0xaac0('0x14')](function(_0x238167){if(_0x238167){return _0x238167[_0xaac0('0x61')](_0x1b2b8b['query'][_0xaac0('0x5d')]);}})['then'](respondWithStatusCode(_0x57944e,null))['catch'](handleError(_0x57944e,null));};exports[_0xaac0('0x62')]=function(_0x4f1241,_0x5ac6cf){_0x4f1241[_0xaac0('0x55')][_0xaac0('0x63')]=_0x4f1241[_0xaac0('0x64')]['filename'];return db[_0xaac0('0x45')][_0xaac0('0x51')]({'where':{'id':_0x4f1241[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x5ac6cf,null))[_0xaac0('0x14')](saveUpdates(_0x4f1241['body'],null))[_0xaac0('0x14')](respondWithResult(_0x5ac6cf,null))[_0xaac0('0x47')](handleError(_0x5ac6cf,null));};exports[_0xaac0('0x65')]=function(_0xaadb21,_0xf0f895){_0xaadb21[_0xaac0('0x55')][_0xaac0('0x66')]=_0xaadb21['file'][_0xaac0('0x67')];return db[_0xaac0('0x45')][_0xaac0('0x51')]({'where':{'id':_0xaadb21[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0xf0f895,null))[_0xaac0('0x14')](saveUpdates(_0xaadb21[_0xaac0('0x55')],null))[_0xaac0('0x14')](respondWithResult(_0xf0f895,null))[_0xaac0('0x47')](handleError(_0xf0f895,null));};exports['addCustomerAvatar']=function(_0x357282,_0x2972a3){_0x357282[_0xaac0('0x55')][_0xaac0('0x68')]=_0x357282[_0xaac0('0x64')][_0xaac0('0x67')];return db[_0xaac0('0x45')]['find']({'where':{'id':_0x357282[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x2972a3,null))[_0xaac0('0x14')](saveUpdates(_0x357282[_0xaac0('0x55')],null))['then'](respondWithResult(_0x2972a3,null))[_0xaac0('0x47')](handleError(_0x2972a3,null));};exports[_0xaac0('0x69')]=function(_0x29a8bc,_0x480876){_0x29a8bc[_0xaac0('0x55')][_0xaac0('0x6a')]=_0x29a8bc[_0xaac0('0x64')][_0xaac0('0x67')];return db[_0xaac0('0x45')][_0xaac0('0x51')]({'where':{'id':_0x29a8bc[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x480876,null))[_0xaac0('0x14')](saveUpdates(_0x29a8bc[_0xaac0('0x55')],null))[_0xaac0('0x14')](respondWithResult(_0x480876,null))[_0xaac0('0x47')](handleError(_0x480876,null));};exports['getLogo']=function(_0x24ddfc,_0x1021ea){var _0x183eba=path[_0xaac0('0x6b')](config[_0xaac0('0x6c')],_0xaac0('0x6d'));var _0x7bb467={'where':{'id':_0x24ddfc[_0xaac0('0x49')]['id']},'attributes':['id',_0xaac0('0x63')],'raw':!![]};var _0x525c74=![];return require('../../config/license/util')[_0xaac0('0x6e')]()['then'](function(_0x57a1c6){if(_0x57a1c6){_0x525c74=_0x57a1c6[_0xaac0('0x6f')];}})[_0xaac0('0x14')](function(){return db[_0xaac0('0x45')][_0xaac0('0x51')](_0x7bb467);})[_0xaac0('0x14')](handleEntityNotFound(_0x1021ea,null))['then'](function(_0x3afef5){if(_0x3afef5){if(!_[_0xaac0('0x70')](_0x3afef5[_0xaac0('0x63')])){if(fs[_0xaac0('0x71')](path[_0xaac0('0x6b')](config[_0xaac0('0x6c')],_0xaac0('0x72'),_0x3afef5['sitepic']))&&_0x525c74){_0x183eba=path[_0xaac0('0x6b')](config[_0xaac0('0x6c')],_0xaac0('0x72'),_0x3afef5[_0xaac0('0x63')]);}}return _0x1021ea[_0xaac0('0x73')](_0x183eba);}})[_0xaac0('0x47')](handleError(_0x1021ea,null));};exports[_0xaac0('0x74')]=function(_0x206a78,_0x443268){var _0x398e3d=path[_0xaac0('0x6b')](config[_0xaac0('0x6c')],_0xaac0('0x75'));var _0x5e4e67={'where':{'id':_0x206a78['params']['id']},'attributes':['id',_0xaac0('0x66')],'raw':!![]};return db['ChatWebsite'][_0xaac0('0x51')](_0x5e4e67)[_0xaac0('0x14')](handleEntityNotFound(_0x443268,null))['then'](function(_0x3c17fe){if(_0x3c17fe){if(!_[_0xaac0('0x70')](_0x3c17fe[_0xaac0('0x66')])){if(fs[_0xaac0('0x71')](path[_0xaac0('0x6b')](config['root'],_0xaac0('0x76'),_0x3c17fe[_0xaac0('0x66')]))){_0x398e3d=path[_0xaac0('0x6b')](config[_0xaac0('0x6c')],_0xaac0('0x76'),_0x3c17fe['agentAvatar']);}}return _0x443268[_0xaac0('0x73')](_0x398e3d);}})[_0xaac0('0x47')](handleError(_0x443268,null));};exports[_0xaac0('0x77')]=function(_0x46360e,_0x42a429){var _0x1165b8=path[_0xaac0('0x6b')](config[_0xaac0('0x6c')],_0xaac0('0x78'));var _0x10ac81={'where':{'id':_0x46360e[_0xaac0('0x49')]['id']},'attributes':['id',_0xaac0('0x68'),_0xaac0('0x79')],'raw':!![]};return db[_0xaac0('0x45')][_0xaac0('0x51')](_0x10ac81)['then'](handleEntityNotFound(_0x42a429,null))[_0xaac0('0x14')](function(_0x2cf441){if(_0x2cf441){if(!_[_0xaac0('0x70')](_0x2cf441['customerAvatar'])){if(fs[_0xaac0('0x71')](path['join'](config[_0xaac0('0x6c')],_0xaac0('0x76'),_0x2cf441[_0xaac0('0x68')]))&&_0x2cf441['showCustomerAvatar']){_0x1165b8=path['join'](config['root'],_0xaac0('0x76'),_0x2cf441[_0xaac0('0x68')]);}}return _0x42a429[_0xaac0('0x73')](_0x1165b8);}})['catch'](handleError(_0x42a429,null));};exports['getSystemAvatar']=function(_0x53b798,_0x4659aa){var _0x29d1a9=path[_0xaac0('0x6b')](config[_0xaac0('0x6c')],_0xaac0('0x7a'));var _0x49818c={'where':{'id':_0x53b798[_0xaac0('0x49')]['id']},'attributes':['id',_0xaac0('0x6a')],'raw':!![]};return db['ChatWebsite']['find'](_0x49818c)[_0xaac0('0x14')](handleEntityNotFound(_0x4659aa,null))[_0xaac0('0x14')](function(_0x41c1b4){if(_0x41c1b4){if(!_[_0xaac0('0x70')](_0x41c1b4[_0xaac0('0x6a')])){if(fs['existsSync'](path[_0xaac0('0x6b')](config[_0xaac0('0x6c')],_0xaac0('0x76'),_0x41c1b4[_0xaac0('0x6a')]))){_0x29d1a9=path[_0xaac0('0x6b')](config[_0xaac0('0x6c')],_0xaac0('0x76'),_0x41c1b4[_0xaac0('0x6a')]);}}return _0x4659aa[_0xaac0('0x73')](_0x29d1a9);}})[_0xaac0('0x47')](handleError(_0x4659aa,null));};exports[_0xaac0('0x7b')]=function(_0x5c3a48,_0x2f2fcf){var _0x2b68dc=require('user-agent-parser');var _0x4989ae=new _0x2b68dc();var _0x1e0baa=_0x4989ae[_0xaac0('0x7c')](_0x5c3a48[_0xaac0('0x7d')]['user-agent'])[_0xaac0('0x7e')]();var _0x70e8e={'body':_0x5c3a48['body'],'channel':_0xaac0('0x7f')};var _0x56bf58=[];var _0x280b98=[];var _0x332979={};var _0x4a5abf=![];return db[_0xaac0('0x80')]['describe']()[_0xaac0('0x14')](function(_0x11a3d5){if(!_0x11a3d5){throw new db[(_0xaac0('0x81'))][(_0xaac0('0x82'))](_0xaac0('0x83'));}_0x56bf58=_[_0xaac0('0x84')](_['keys'](_0x11a3d5),['createdAt',_0xaac0('0x85')]);_0x280b98=_[_0xaac0('0x84')](_['keys'](_0x11a3d5),[_0xaac0('0x86'),_0xaac0('0x85'),_0xaac0('0x87'),'ListId']);if(_0x5c3a48[_0xaac0('0x55')]['id']){delete _0x5c3a48[_0xaac0('0x55')]['id'];}if(_['isNil'](_0x5c3a48['body']['from'])){throw new db[(_0xaac0('0x81'))][(_0xaac0('0x82'))](_0xaac0('0x88'));}if(_[_0xaac0('0x70')](_0x5c3a48['body']['body'])||_0x5c3a48[_0xaac0('0x55')][_0xaac0('0x55')]===''){throw new db['Sequelize'][(_0xaac0('0x82'))](_0xaac0('0x89'));}if(_['isNil'](_0x5c3a48[_0xaac0('0x55')][_0xaac0('0x8a')])){throw new db[(_0xaac0('0x81'))][(_0xaac0('0x82'))](_0xaac0('0x8b')+_0x280b98);}if(!_['includes'](_0x280b98,_0x5c3a48[_0xaac0('0x55')][_0xaac0('0x8a')])){throw new db[(_0xaac0('0x81'))][(_0xaac0('0x82'))](_0xaac0('0x8c')+_0x280b98);}_0x332979[_0x5c3a48[_0xaac0('0x55')][_0xaac0('0x8a')]]=_0x5c3a48['body'][_0xaac0('0x8d')];})[_0xaac0('0x14')](function(){return db[_0xaac0('0x45')]['find']({'where':{'id':_0x5c3a48['params']['id']},'include':[{'model':db[_0xaac0('0x8e')],'as':'List','include':[{'model':db[_0xaac0('0x80')],'as':_0xaac0('0x8f'),'where':_0x332979,'limit':0x1,'order':[[_0xaac0('0x85'),_0xaac0('0x90')]]}]},{'model':db[_0xaac0('0x91')],'as':_0xaac0('0x92')}]});})['then'](handleEntityNotFound(_0x2f2fcf,null))['then'](function(_0x4baf06){if(_0x4baf06&&_0x4baf06[_0xaac0('0x93')]){_0x70e8e['account']=_0x4baf06;_0x70e8e[_0xaac0('0x94')]=_0x4baf06[_0xaac0('0x92')];_0x70e8e[_0xaac0('0x95')]=_0x4baf06[_0xaac0('0x93')];_0x70e8e[_0xaac0('0x94')]=_[_0xaac0('0x96')](_0x70e8e[_0xaac0('0x94')],[_0xaac0('0x97')],[_0xaac0('0x98')]);if(_0x70e8e[_0xaac0('0x99')][_0xaac0('0x92')]){delete _0x70e8e[_0xaac0('0x99')][_0xaac0('0x92')];}if(_0x70e8e['account']['List']&&_0x70e8e[_0xaac0('0x99')][_0xaac0('0x93')][_0xaac0('0x8f')][_0xaac0('0x36')]){return _0x70e8e['account']['List'][_0xaac0('0x8f')][0x0];}var _0x266c31=_[_0xaac0('0xc')](_0x5c3a48[_0xaac0('0x55')],{'firstName':_0x5c3a48[_0xaac0('0x55')][_0xaac0('0x8d')],'ListId':_0x4baf06['ListId']});_0x266c31[_0x5c3a48[_0xaac0('0x55')][_0xaac0('0x8a')]]=_0x5c3a48[_0xaac0('0x55')][_0xaac0('0x8d')];return db[_0xaac0('0x80')][_0xaac0('0x53')](_0x266c31,{'fields':_0x56bf58,'raw':!![]});}})[_0xaac0('0x14')](handleEntityNotFound(_0x2f2fcf,null))[_0xaac0('0x14')](function(_0x466f96){_0x70e8e[_0xaac0('0x9a')]=_0x466f96;var _0x27141b=_0x5c3a48['body']['customerIp'];if(_0x5c3a48['headers'][_0xaac0('0x9b')]){_0x27141b=_0x5c3a48['headers'][_0xaac0('0x9b')];}else if(_0x5c3a48[_0xaac0('0x7d')]['x-forwarded-for']){_0x27141b=_[_0xaac0('0x9c')](_0x5c3a48['headers'][_0xaac0('0x9d')][_0xaac0('0x9e')](','));}if(_0x466f96){var _0x30d97a={'ContactId':_0x466f96['id'],'ChatWebsiteId':_0x5c3a48['params']['id'],'from':(_0x466f96[_0xaac0('0x9f')]||'')+'\x20'+(_0x466f96[_0xaac0('0xa0')]||''),'customerIp':_0x27141b,'customerPort':_0x5c3a48[_0xaac0('0x7d')]['x-real-port']?_0x5c3a48[_0xaac0('0x7d')][_0xaac0('0xa1')]:null,'referer':_0x5c3a48[_0xaac0('0x55')][_0xaac0('0xa2')],'browserName':_0x1e0baa['browser'][_0xaac0('0x2a')]&&_0x1e0baa[_0xaac0('0xa3')][_0xaac0('0xa4')]?util[_0xaac0('0xa5')](_0xaac0('0xa6'),_0x1e0baa[_0xaac0('0xa3')][_0xaac0('0x2a')],_0x1e0baa[_0xaac0('0xa3')][_0xaac0('0xa4')]):_0xaac0('0xa7'),'browserVersion':_0x1e0baa[_0xaac0('0xa3')][_0xaac0('0xa4')]||_0xaac0('0xa7'),'osName':util[_0xaac0('0xa5')]('%s\x20%s',_0x1e0baa['os']['name'],_0x1e0baa['os'][_0xaac0('0xa4')]),'osVersion':_0x1e0baa['os'][_0xaac0('0xa4')],'deviceModel':_0x1e0baa[_0xaac0('0xa8')][_0xaac0('0x30')]&&_0x1e0baa[_0xaac0('0xa8')][_0xaac0('0xa9')]?util[_0xaac0('0xa5')]('%s\x20%s\x20%s',_0x1e0baa['device'][_0xaac0('0x30')],_0x1e0baa[_0xaac0('0xa8')][_0xaac0('0xa9')],_0x1e0baa[_0xaac0('0xa8')][_0xaac0('0x3f')]):null,'deviceVendor':_0x1e0baa['device'][_0xaac0('0xa9')],'deviceType':_0x1e0baa[_0xaac0('0xa8')][_0xaac0('0x3f')],'formData':JSON[_0xaac0('0xaa')](_0x5c3a48[_0xaac0('0x55')])};var _0x487c8c={'ChatWebsiteId':_0x5c3a48[_0xaac0('0x49')]['id'],'closed':![]};if(_0x5c3a48[_0xaac0('0x55')][_0xaac0('0xab')]){_0x487c8c[_0xaac0('0xab')]=_0x5c3a48[_0xaac0('0x55')]['threadId'];return db[_0xaac0('0xac')][_0xaac0('0x51')]({'where':_0x487c8c})[_0xaac0('0x14')](function(_0x167180){if(_0x167180){return[_0x167180,![]];}_0x30d97a[_0xaac0('0xab')]=_0x5c3a48[_0xaac0('0x55')]['threadId'];_0x30d97a[_0xaac0('0xad')]=_0x5c3a48['body'][_0xaac0('0xad')];return db[_0xaac0('0xac')][_0xaac0('0x53')](_0x30d97a)[_0xaac0('0x14')](function(_0x23db92){return[_0x23db92,!![]];});});}_0x487c8c['ContactId']=_0x466f96['id'];if(_0x5c3a48[_0xaac0('0x55')]['interaction']&&_0x5c3a48[_0xaac0('0x55')][_0xaac0('0xae')]['id']){_0x487c8c['id']=_0x5c3a48['body'][_0xaac0('0xae')]['id'];return db[_0xaac0('0xac')]['find']({'where':_0x487c8c})['then'](function(_0x3b36c6){if(_0x3b36c6){return[_0x3b36c6,![]];}return db[_0xaac0('0xac')][_0xaac0('0x53')](_0x30d97a)[_0xaac0('0x14')](function(_0x43a201){return[_0x43a201,!![]];});});}return db['ChatInteraction']['create'](_0x30d97a)['then'](function(_0x3ad124){return[_0x3ad124,!![]];});}})[_0xaac0('0xaf')](function(_0x12ec41,_0x49e228){if(_0x12ec41){_0x4a5abf=_0x49e228;if(!_0x49e228){var _0x2561fe={'from':(_0x70e8e[_0xaac0('0x9a')][_0xaac0('0x9f')]||'')+'\x20'+(_0x70e8e[_0xaac0('0x9a')][_0xaac0('0xa0')]||'')};if(_0x5c3a48[_0xaac0('0x55')]['threadId']&&_0x5c3a48[_0xaac0('0x55')]['messageId']&&_0x5c3a48[_0xaac0('0x55')]['threadId']!=_0x5c3a48[_0xaac0('0x55')][_0xaac0('0xb0')]){_0x2561fe[_0xaac0('0xab')]=_0x5c3a48[_0xaac0('0x55')]['messageId'];}return _0x12ec41[_0xaac0('0x24')](_0x2561fe);}else{return _0x12ec41;}}})[_0xaac0('0x14')](function(_0x4a3e55){_0x70e8e['interaction']=_0x4a3e55['get']({'plain':!![]});_0x70e8e[_0xaac0('0xae')][_0xaac0('0xb1')]=_0x4a5abf;if(_0x70e8e['interaction']['created']){if(_0x70e8e[_0xaac0('0x99')][_0xaac0('0xb2')]){_0x70e8e['applications'][_0xaac0('0xb3')]({'id':0x0,'priority':_0x70e8e['applications']['length']+0x1,'app':_0xaac0('0xb4'),'appdata':'unmanaged','interval':_0xaac0('0xb5')});}}return db[_0xaac0('0xb6')]['create']({'body':_0x5c3a48[_0xaac0('0x55')][_0xaac0('0x55')],'ChatWebsiteId':_0x5c3a48[_0xaac0('0x49')]['id'],'ChatInteractionId':_0x4a3e55['id'],'direction':'in','ContactId':_0x70e8e[_0xaac0('0x9a')]['id'],'AttachmentId':_0x5c3a48[_0xaac0('0x55')][_0xaac0('0xb7')]});})[_0xaac0('0x14')](function(_0x2eab02){_0x70e8e['message']=_0x2eab02;if(_0x70e8e[_0xaac0('0xae')][_0xaac0('0xb8')]){return db[_0xaac0('0xb9')][_0xaac0('0x51')]({'attributes':['id',_0xaac0('0x2a')],'where':{'id':_0x70e8e[_0xaac0('0xae')][_0xaac0('0xb8')]}})['then'](function(_0x27ff77){if(_0x27ff77){_0x70e8e[_0xaac0('0x94')][_0xaac0('0xba')]({'id':0x0,'priority':0x0,'app':_0xaac0('0xbb'),'appdata':_0x27ff77[_0xaac0('0x2a')]+','+(_0x70e8e[_0xaac0('0x99')][_0xaac0('0xbc')]||0xa),'interval':'*,*,*,*'});_0x70e8e[_0xaac0('0xbd')]=!![];}return respondWithRpcPromise(_0xaac0('0xbe'),_0xaac0('0xbf'),_0x70e8e);});}return respondWithRpcPromise(_0xaac0('0xbe'),_0xaac0('0xbf'),_0x70e8e);})[_0xaac0('0x14')](function(_0x22328a){respondWithRpcPromise('EventManager',_0xaac0('0xc0'),{'event':_0xaac0('0x7b'),'message':_0x22328a},client9002);return _0x22328a;})[_0xaac0('0x14')](respondWithResult(_0x2f2fcf,null))['catch'](handleError(_0x2f2fcf,null));};exports[_0xaac0('0xc1')]=function(_0x3ff68a,_0x52c441){var _0x2e2a78,_0x4da72a,_0x52b27d;var _0x5096c4=[];var _0x1126ff={};var _0x140131=_0x3ff68a[_0xaac0('0xc2')]||[];var _0x122df0=[];var _0x3cf4f2;return db['CmContact'][_0xaac0('0xc3')]()[_0xaac0('0x14')](function(_0x362065){if(!_0x362065){throw new db['Sequelize'][(_0xaac0('0x82'))](_0xaac0('0x83'));}_0x5096c4=_[_0xaac0('0x84')](_[_0xaac0('0x4b')](_0x362065),['createdAt',_0xaac0('0x85'),_0xaac0('0x87'),_0xaac0('0xc4')]);if(_0x3ff68a['body']['id']){delete _0x3ff68a[_0xaac0('0x55')]['id'];}if(_[_0xaac0('0x70')](_0x3ff68a[_0xaac0('0x55')]['from'])){throw _0x52c441[_0xaac0('0x1d')](0x1f4)[_0xaac0('0x2b')](new db[(_0xaac0('0x81'))][(_0xaac0('0x82'))]('from\x20is\x20mandatory'));}if(_[_0xaac0('0x70')](_0x3ff68a[_0xaac0('0x55')]['body'])||_0x3ff68a[_0xaac0('0x55')][_0xaac0('0x55')]===''){throw _0x52c441[_0xaac0('0x1d')](0x1f4)[_0xaac0('0x2b')](new db[(_0xaac0('0x81'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xaac0('0x70')](_0x3ff68a['body'][_0xaac0('0xc5')])){throw _0x52c441[_0xaac0('0x1d')](0x1f4)[_0xaac0('0x2b')](new db[(_0xaac0('0x81'))][(_0xaac0('0x82'))](_0xaac0('0xc6')+_0x5096c4));}if(!_[_0xaac0('0xc7')](_0x5096c4,_0x3ff68a[_0xaac0('0x55')][_0xaac0('0xc5')])){throw _0x52c441[_0xaac0('0x1d')](0x1f4)[_0xaac0('0x2b')](new db['Sequelize']['ValidationError'](_0xaac0('0xc8')+_0x5096c4));}_0x1126ff[_0x3ff68a[_0xaac0('0x55')][_0xaac0('0xc5')]]=_0x3ff68a['body'][_0xaac0('0x8d')];})[_0xaac0('0x14')](function(){return db[_0xaac0('0x45')][_0xaac0('0x51')]({'where':{'id':_0x3ff68a[_0xaac0('0x49')]['id']},'include':[{'model':db['CmList'],'as':_0xaac0('0x93')},{'model':db[_0xaac0('0xc9')],'as':'MailAccount'}]});})[_0xaac0('0x14')](handleEntityNotFound(_0x52c441,null))['then'](function(_0x1d875a){if(_0x1d875a&&_0x1d875a[_0xaac0('0x93')]){_0x4da72a=_0x1d875a;var _0x37fbc1=_[_0xaac0('0xc')](_0x3ff68a[_0xaac0('0x55')],{'firstName':_0x3ff68a['body'][_0xaac0('0x8d')],'phone':_0x3ff68a[_0xaac0('0x55')][_0xaac0('0x8d')],'ListId':_0x1d875a[_0xaac0('0xc4')]});_0x37fbc1[_0x3ff68a[_0xaac0('0x55')][_0xaac0('0xc5')]]=_0x3ff68a[_0xaac0('0x55')][_0xaac0('0x8d')];return db['CmContact'][_0xaac0('0xca')]({'where':_0x1126ff,'defaults':_0x37fbc1});}})[_0xaac0('0xaf')](function(_0x3176a6){if(_0x3176a6){_0x52b27d=_0x3176a6;var _0x105245=fs['readFileSync'](path[_0xaac0('0x6b')](config['root'],_0xaac0('0xcb')),_0xaac0('0xcc'));var _0x5157b7=ejs['render'](_0x105245,{'body':_[_0xaac0('0xcd')](_0x3ff68a[_0xaac0('0x55')][_0xaac0('0x55')]),'bodyTitle':_0x4da72a['offlineMessageBody']});return db[_0xaac0('0xce')][_0xaac0('0x53')]({'body':_0x5157b7,'plainBody':htmlToText['fromString'](_0x5157b7),'ContactId':_0x3176a6['id'],'ChatWebsiteId':_0x4da72a['id']});}})[_0xaac0('0x14')](function(_0x39837b){_0x3cf4f2=_0x39837b;if(_0x140131[_0xaac0('0x36')]){var _0x46b36c=_0x140131[_0xaac0('0x31')](function(_0x35ca5f){return{'name':_0x35ca5f[_0xaac0('0xcf')],'basename':_0x35ca5f['filename'],'type':_0x35ca5f[_0xaac0('0xd0')],'ChatOfflineMessageId':_0x39837b['id']};});_0x122df0=_0x46b36c[_0xaac0('0x31')](_0x2189cb=>{var _0x2989c0={'filename':_0x2189cb[_0xaac0('0x2a')],'path':path['join'](config['root'],_0xaac0('0xd1'),_0xaac0('0xc2'),_0xaac0('0xd2'),'offline-chat',_0x2189cb[_0xaac0('0xd3')])};return _0x2989c0;});if(!_0x4da72a[_0xaac0('0xd4')]){return db['sequelize']['transaction'](function(_0x197b78){return db['Attachment'][_0xaac0('0xd5')](_0x46b36c,{'transaction':_0x197b78});});}}})[_0xaac0('0x14')](function(){if(_0x3cf4f2){_0x2e2a78=_0x3cf4f2;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xaac0('0xd6')],'as':_0xaac0('0xd7'),'raw':!![]}]});}})['then'](function(_0x5a3a44){if(_0x5a3a44&&_0x5a3a44[_0xaac0('0xd7')]&&_0x4da72a[_0xaac0('0xd8')]&&_0x4da72a[_0xaac0('0xd9')]){var _0x6dbbd3={'tls':{'rejectUnauthorized':![]}};if(_0x5a3a44[_0xaac0('0xd7')][_0xaac0('0xda')]){_0x6dbbd3['service']=_0x5a3a44[_0xaac0('0xd7')][_0xaac0('0xda')];}else{_0x6dbbd3[_0xaac0('0xdb')]=_0x5a3a44['Smtp'][_0xaac0('0xdb')];_0x6dbbd3[_0xaac0('0xdc')]=_0x5a3a44[_0xaac0('0xd7')][_0xaac0('0xdc')];_0x6dbbd3[_0xaac0('0xdd')]=_0x5a3a44['Smtp'][_0xaac0('0xdd')];}if(_0x5a3a44['Smtp'][_0xaac0('0xde')]){_0x6dbbd3['auth']={'user':_0x5a3a44[_0xaac0('0xd7')][_0xaac0('0x4d')],'pass':_0x5a3a44[_0xaac0('0xd7')]['pass']};}return respondWithRpcPromise('SendMail',_0xaac0('0xdf'),{'account':_0x6dbbd3,'message':{'from':util[_0xaac0('0xa5')](_0xaac0('0xe0'),_0x5a3a44[_0xaac0('0x2a')],_0x5a3a44[_0xaac0('0xe1')]||_0x5a3a44[_0xaac0('0xd7')]['user']),'to':_0x4da72a['forwardOfflineAddress'],'subject':_0x4da72a[_0xaac0('0xe2')],'html':_0x2e2a78[_0xaac0('0x55')],'attachments':_0x122df0}},client9003)[_0xaac0('0x14')](function(){return _0x2e2a78;})[_0xaac0('0x47')](function(_0x5269a7){console[_0xaac0('0x1a')](_0x5269a7);});}})[_0xaac0('0x14')](function(){if(_0x4da72a&&_0x4da72a[_0xaac0('0xd4')]&&_0x4da72a[_0xaac0('0xe3')]){var _0x330405=[];if(_0x140131[_0xaac0('0x36')]){_0x330405=_0x140131[_0xaac0('0x31')](function(_0x4c74c5){return{'name':_0x4c74c5[_0xaac0('0xcf')],'basename':_0x4c74c5[_0xaac0('0x67')],'type':_0x4c74c5[_0xaac0('0xd0')],'ChatOfflineMessageId':_0x3cf4f2['id']};});}var _0xde6c0e;if(!_[_0xaac0('0x70')](_0x4da72a[_0xaac0('0xe4')])){var _0xee1ffa=_[_0xaac0('0x31')](_0x3ff68a[_0xaac0('0x55')],function(_0x536cdd){return _0x536cdd;});var _0x41def3=_[_0xaac0('0xe5')](_0xee1ffa)[0x0];var _0x1bdf46=_[_0xaac0('0xe6')](_0x41def3,function(_0x46c1d4){return _0x46c1d4;});_0xde6c0e=_0x1bdf46[0x1][_0x4da72a[_0xaac0('0xe4')]];}var _0x4f6663={'from':_0x52b27d['email'],'firstName':_0x52b27d[_0xaac0('0x9f')],'lastName':_0x52b27d[_0xaac0('0xa0')],'mapKey':_0xaac0('0xe1'),'message':{'from':_0x52b27d[_0xaac0('0xe1')],'to':_0x4da72a['MailAccount']['email'],'cc':'','subject':_['isNil'](_0xde6c0e)?_0x4da72a[_0xaac0('0xe2')]:_0xde6c0e,'messageId':'','sentAt':new Date(),'attach':_0x330405[_0xaac0('0x36')],'attachments':_0x330405,'originChannel':_0xaac0('0xe7'),'ChatWebsiteId':_0x4da72a['id'],'ChatOfflineMessageId':_0x2e2a78['id'],'originTo':_0x4da72a[_0xaac0('0xc9')][_0xaac0('0xe1')]},'body':_0x2e2a78[_0xaac0('0x55')]};var _0x396fe9={'account':{'id':_0x4da72a[_0xaac0('0xe3')]},'body':_0x4f6663,'log':_0xaac0('0xe8')};return respondWithRpcPromise('NotifyMailAccount',_0xaac0('0xe9'),_0x396fe9,client9001)[_0xaac0('0x14')](function(){return _0x2e2a78;})[_0xaac0('0x47')](function(_0x15085e){console['error'](_0x15085e);});}return;})[_0xaac0('0x14')](function(){if(_0x2e2a78){return _0x2e2a78;}})[_0xaac0('0x14')](respondWithResult(_0x52c441,null))[_0xaac0('0x47')](function(_0x5e7a6c){console[_0xaac0('0x1a')](_0xaac0('0x47'),_0x5e7a6c);for(var _0x182938 of _0x140131){var _0x56bc83=path['join'](config[_0xaac0('0x6c')],'server',_0xaac0('0xc2'),_0xaac0('0xd2'),'offline-chat',_0x182938[_0xaac0('0x67')]);fs_extra[_0xaac0('0xea')](_0x56bc83)[_0xaac0('0x47')](function(_0x1b1993){console[_0xaac0('0x1a')]('Could\x20not\x20remove\x20attachment\x20file',_0x56bc83,_0x1b1993);});}});};exports['addInteraction']=function(_0x32a614,_0x4b84b5){return db[_0xaac0('0xac')][_0xaac0('0x51')]({'where':{'id':_0x32a614[_0xaac0('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b84b5,null))[_0xaac0('0x14')](function(_0x5a26da){if(_0x5a26da){return _0x5a26da[_0xaac0('0xeb')](_0x32a614['body'][_0xaac0('0x5d')],_[_0xaac0('0xec')](_0x32a614[_0xaac0('0x55')],['ids','id'])||{});}})[_0xaac0('0x14')](respondWithResult(_0x4b84b5,null))['catch'](handleError(_0x4b84b5,null));};exports[_0xaac0('0xed')]=function(_0x28cea0,_0x53fb12){var _0x31b3a0={'raw':![],'where':{}};var _0x1cc26b={};var _0x4f502e={'count':0x0,'rows':[]};return db[_0xaac0('0x45')][_0xaac0('0x5a')]({'where':{'id':_0x28cea0['params']['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x53fb12,null))[_0xaac0('0x14')](function(_0x17a419){if(_0x17a419){_0x1cc26b[_0xaac0('0x30')]=_['keys'](db['ChatInteraction'][_0xaac0('0x2e')]);_0x1cc26b['query']=_[_0xaac0('0x4b')](_0x28cea0[_0xaac0('0x32')]);_0x1cc26b[_0xaac0('0x3c')]=_[_0xaac0('0x33')](_0x1cc26b[_0xaac0('0x30')],_0x1cc26b[_0xaac0('0x32')]);_0x31b3a0[_0xaac0('0x34')]=_[_0xaac0('0x33')](_0x1cc26b['model'],qs['fields'](_0x28cea0[_0xaac0('0x32')]['fields']));_0x31b3a0[_0xaac0('0x34')]=_0x31b3a0[_0xaac0('0x34')]['length']?_0x31b3a0[_0xaac0('0x34')]:_0x1cc26b[_0xaac0('0x30')];if(!_0x28cea0[_0xaac0('0x32')][_0xaac0('0x37')](_0xaac0('0x38'))){_0x31b3a0['limit']=qs[_0xaac0('0x21')](_0x28cea0[_0xaac0('0x32')][_0xaac0('0x21')]);_0x31b3a0['offset']=qs['offset'](_0x28cea0[_0xaac0('0x32')][_0xaac0('0x20')]);}_0x31b3a0['order']=qs[_0xaac0('0x3a')](_0x28cea0[_0xaac0('0x32')][_0xaac0('0x3a')]);_0x31b3a0[_0xaac0('0x3b')]=qs[_0xaac0('0x3c')](_[_0xaac0('0x3d')](_0x28cea0[_0xaac0('0x32')],_0x1cc26b['filters']));_0x31b3a0['where'][_0xaac0('0x57')]=_0x17a419['id'];if(_0x28cea0[_0xaac0('0x32')]['filter']){_0x31b3a0[_0xaac0('0x3b')]=_['merge'](_0x31b3a0[_0xaac0('0x3b')],{'$or':_[_0xaac0('0x31')](_0x31b3a0[_0xaac0('0x34')],function(_0xd70737){var _0x2cf7a6={};_0x2cf7a6[_0xd70737]={'$like':'%'+_0x28cea0['query'][_0xaac0('0x41')]+'%'};return _0x2cf7a6;})});}_0x31b3a0=_[_0xaac0('0x3e')]({},_0x31b3a0,_0x28cea0[_0xaac0('0x42')]);return db['ChatInteraction'][_0xaac0('0x43')]({'where':_0x31b3a0[_0xaac0('0x3b')]})[_0xaac0('0x14')](function(_0x1949b9){_0x4f502e[_0xaac0('0x43')]=_0x1949b9;if(_0x28cea0[_0xaac0('0x32')]['includeAll']){_0x31b3a0[_0xaac0('0x4c')]=[{'model':db[_0xaac0('0x80')],'as':_0xaac0('0xee'),'required':![]},{'model':db['User'],'as':_0xaac0('0xef'),'attributes':[_0xaac0('0x2a'),_0xaac0('0xf0'),'internal'],'required':![]},{'model':db[_0xaac0('0xf1')],'as':_0xaac0('0xf2'),'attributes':['id',_0xaac0('0x2a'),_0xaac0('0xf3')],'where':_0x28cea0['query'][_0xaac0('0xf4')]?{'id':_0x28cea0[_0xaac0('0x32')][_0xaac0('0xf4')]}:undefined,'required':_0x28cea0[_0xaac0('0x32')][_0xaac0('0xf4')]?!![]:![]}];}return db[_0xaac0('0xac')][_0xaac0('0x5b')](_0x31b3a0);})[_0xaac0('0x14')](function(_0x2d070b){_0x4f502e[_0xaac0('0x46')]=_0x2d070b;return _0x4f502e;});}})[_0xaac0('0x14')](respondWithFilteredResult(_0x53fb12,_0x31b3a0))['catch'](handleError(_0x53fb12,null));};function iftimePromise(_0x19711c,_0x46679d){return respondWithRpcPromise(_0xaac0('0xf5'),_0xaac0('0xf6'),{'command':_0x46679d[_0xaac0('0xf7')]?util[_0xaac0('0xa5')](_0xaac0('0xf8'),_0x19711c['interval'],_0x46679d[_0xaac0('0xf7')]):util[_0xaac0('0xa5')](_0xaac0('0xf9'),_0x19711c[_0xaac0('0xfa')])},client9002)[_0xaac0('0x14')](function(_0x460931){var _0x3e8658=_0x460931&&_0x460931[_0xaac0('0xfb')](_0xaac0('0xfc'))>=0x0?!![]:![];logger[_0xaac0('0x15')](_0xaac0('0xfd'),_0x46679d['id'],_0x19711c['id'],_0x19711c[_0xaac0('0xfa')],_0x3e8658?_0xaac0('0xfe'):_0xaac0('0xff'),_0x46679d[_0xaac0('0xf7')]?_0x46679d[_0xaac0('0xf7')]:_0xaac0('0x100'));return _0x3e8658;})['catch'](function(_0xd24829){logger['error'](_0xaac0('0xfd'),_0x46679d['id'],_0x19711c['id'],_0x19711c[_0xaac0('0xfa')],util[_0xaac0('0x101')](_0xd24829,{'showHidden':![],'depth':null}),_0x46679d[_0xaac0('0xf7')]?_0x46679d['timezone']:'No\x20timezone');return![];});}exports[_0xaac0('0xf6')]=function(_0x2de7fe,_0x2ee611){var _0x3b88fc=0x0;var _0x36234b=0x0;var _0x51f60b=![];var _0x51bb8f;var _0x2978c9;return db[_0xaac0('0x45')]['find']({'where':{'id':_0x2de7fe[_0xaac0('0x49')]['id']},'include':[{'model':db[_0xaac0('0x102')],'as':_0xaac0('0x102'),'include':[{'model':db[_0xaac0('0x102')],'as':_0xaac0('0x103'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xaac0('0x14')](handleEntityNotFound(_0x2ee611,null))[_0xaac0('0x14')](function(_0x17cec7){if(_0x17cec7){_0x51bb8f=_0x17cec7;return _0x17cec7[_0xaac0('0x104')]({'raw':!![]});}})[_0xaac0('0x14')](function(_0x3ee94f){if(_0x51bb8f){if(_0x3ee94f){_0x2978c9=_0x3ee94f;}}return require(_0xaac0('0x105'))['getLicense']();})[_0xaac0('0x14')](function(_0x2cc965){if(_0x2cc965){_0x36234b=_0x2cc965[_0xaac0('0x106')];_0x51f60b=_0x2cc965[_0xaac0('0x6f')];}})[_0xaac0('0x14')](function(){return db[_0xaac0('0xac')][_0xaac0('0x43')]({'where':{'closed':![]}});})[_0xaac0('0x14')](function(_0x1d701f){_0x3b88fc=_0x1d701f;if(_0x36234b&&_0x1d701f>_0x36234b){return db[_0xaac0('0x107')][_0xaac0('0x5a')]({'where':{'id':0x1}})['then'](function(_0x3e58b6){if(_0x3e58b6){_0x3e58b6[_0xaac0('0x108')](_0xaac0('0x109'));}});}})['then'](function(){if(_0x51bb8f['Interval']&&_0x51bb8f['Interval'][_0xaac0('0x103')]){var _0xd2459b=[];for(var _0x8fddef=0x0;_0x8fddef<_0x51bb8f['Interval']['Intervals'][_0xaac0('0x36')];_0x8fddef++){var _0x3dc6ea=_0x51bb8f['Interval'][_0xaac0('0x103')][_0x8fddef][_0xaac0('0x26')]({'plain':!![]});_0xd2459b[_0xaac0('0xb3')](iftimePromise(_0x3dc6ea,_0x51bb8f));}return BPromise[_0xaac0('0x10a')](_0xd2459b)[_0xaac0('0x14')](function(_0x335620){return _[_0xaac0('0x10b')](_0x335620);});}else{return!![];}})['then'](function(_0x5efbe7){var _0x3d8d01=fs[_0xaac0('0x10c')](path[_0xaac0('0x6b')](config[_0xaac0('0x6c')],'server/files/chat/iframe.ejs'),_0xaac0('0xcc'));var _0xbd3b6e={'remote':_0x51bb8f[_0xaac0('0x10d')],'query':querystring[_0xaac0('0xaa')](_[_0xaac0('0x3e')](_0x51bb8f[_0xaac0('0x26')]({'plain':!![]}),{'customerIp':_0x2de7fe[_0xaac0('0x7d')][_0xaac0('0x9d')]||_0x2de7fe[_0xaac0('0x7d')][_0xaac0('0x10e')]||_0x2de7fe[_0xaac0('0x10f')][_0xaac0('0x110')]||_0x2de7fe['ip'],'referer':_0x2de7fe[_0xaac0('0x7d')][_0xaac0('0xa2')],'openedInteractions':_0x3b88fc,'maxInteractions':_0x36234b,'virtual':_0x51f60b[_0xaac0('0x106')],'online':_0x5efbe7,'custom':_0x51f60b}))[_0xaac0('0x111')](/'/g,'\x5c\x27')};_0x2ee611[_0xaac0('0x2b')](ejs[_0xaac0('0x112')](Mustache[_0xaac0('0x112')](_0x3d8d01,_0xbd3b6e),{'proactiveActions':_0x2978c9,'alignment':_0x51bb8f[_0xaac0('0x113')],'verticalAlignment':_0x51bb8f['verticalAlignment'],'div_color':_0x51bb8f['color'],'labelText':_0x51bb8f['labelText'],'text_color':_0x51bb8f[_0xaac0('0x114')],'button_color':_0x51bb8f['color_button'],'background_color':_0x51bb8f[_0xaac0('0x115')],'hideWhenOffline':_0x51bb8f[_0xaac0('0x116')],'interval':_0x51bb8f[_0xaac0('0x117')]}));})[_0xaac0('0x47')](handleError(_0x2ee611,null));};exports[_0xaac0('0x118')]=function(_0x30af70,_0x50c305){var _0x5321e0=_0x30af70[_0xaac0('0x49')]['id'];var _0x2d6210=_0x30af70['body'];var _0x4729c0=0xc8;var _0x4f426e=null;return db[_0xaac0('0x119')][_0xaac0('0x11a')]({'isolationLevel':db[_0xaac0('0x119')]['Transaction'][_0xaac0('0x11b')]['READ_COMMITTED']},function(_0xb5261b){return db[_0xaac0('0x45')][_0xaac0('0x5a')]({'where':{'id':_0x5321e0},'transaction':_0xb5261b})['then'](function(_0x32a9f1){if(_0x32a9f1){return db['ChatApplication'][_0xaac0('0x25')]({'where':{'ChatWebsiteId':_0x5321e0},'transaction':_0xb5261b})[_0xaac0('0x14')](function(){var _0x9eae91=_[_0xaac0('0x31')](_0x2d6210,function(_0x3fd7f2){_0x3fd7f2[_0xaac0('0x57')]=_0x5321e0;return _0x3fd7f2;});return db['ChatApplication'][_0xaac0('0xd5')](_0x9eae91,{'transaction':_0xb5261b});});}else{_0x4729c0=0x194;_0x4f426e=[];}});})[_0xaac0('0x14')](function(){if(_0x4729c0!==0x194){return db[_0xaac0('0x91')][_0xaac0('0x11c')]({'where':{'ChatWebsiteId':_0x5321e0},'order':_0xaac0('0x97')})['then'](function(_0x3a4d59){_0x4f426e=_0x3a4d59;});}})[_0xaac0('0x47')](function(_0x24343c){_0x4729c0=0x1f4;logger['error'](_0x24343c[_0xaac0('0x29')]);if(_0x24343c[_0xaac0('0x2a')]){delete _0x24343c[_0xaac0('0x2a')];}_0x4f426e=_0x24343c;})['finally'](function(){if(_0x4f426e===null){_0x50c305[_0xaac0('0x11d')](_0x4729c0);}else{if(_0x4729c0===0x1f4){_0x50c305['status'](_0x4729c0)['send'](_0x4f426e);}else{_0x50c305[_0xaac0('0x1d')](_0x4729c0)[_0xaac0('0x1f')](_0x4f426e);}}});};exports[_0xaac0('0x11e')]=function(_0x3275cf,_0x571911){var _0x52ce94={};var _0x122854={};var _0x34d322;var _0x50f10c;return db[_0xaac0('0x45')][_0xaac0('0x5a')]({'where':{'id':_0x3275cf[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x571911,null))[_0xaac0('0x14')](function(_0x450583){if(_0x450583){_0x34d322=_0x450583;_0x122854[_0xaac0('0x30')]=_[_0xaac0('0x4b')](db[_0xaac0('0x91')]['rawAttributes']);_0x122854['query']=_[_0xaac0('0x4b')](_0x3275cf[_0xaac0('0x32')]);_0x122854['filters']=_[_0xaac0('0x33')](_0x122854[_0xaac0('0x30')],_0x122854[_0xaac0('0x32')]);_0x52ce94[_0xaac0('0x34')]=_[_0xaac0('0x33')](_0x122854[_0xaac0('0x30')],qs['fields'](_0x3275cf[_0xaac0('0x32')][_0xaac0('0x35')]));_0x52ce94[_0xaac0('0x34')]=_0x52ce94[_0xaac0('0x34')][_0xaac0('0x36')]?_0x52ce94[_0xaac0('0x34')]:_0x122854['model'];_0x52ce94[_0xaac0('0x39')]=qs['sort'](_0x3275cf['query']['sort']);_0x52ce94[_0xaac0('0x3b')]=qs[_0xaac0('0x3c')](_[_0xaac0('0x3d')](_0x3275cf[_0xaac0('0x32')],_0x122854[_0xaac0('0x3c')]));if(_0x3275cf[_0xaac0('0x32')][_0xaac0('0x41')]){_0x52ce94[_0xaac0('0x3b')]=_['merge'](_0x52ce94[_0xaac0('0x3b')],{'$or':_[_0xaac0('0x31')](_0x52ce94[_0xaac0('0x34')],function(_0x235477){var _0xf84b20={};_0xf84b20[_0x235477]={'$like':'%'+_0x3275cf[_0xaac0('0x32')]['filter']+'%'};return _0xf84b20;})});}_0x52ce94=_['merge']({},_0x52ce94,_0x3275cf[_0xaac0('0x42')]);return _0x34d322[_0xaac0('0x11e')](_0x52ce94);}})['then'](function(_0x24feb6){if(_0x24feb6){_0x50f10c=_0x24feb6[_0xaac0('0x36')];if(!_0x3275cf[_0xaac0('0x32')][_0xaac0('0x37')](_0xaac0('0x38'))){_0x52ce94[_0xaac0('0x21')]=qs[_0xaac0('0x21')](_0x3275cf['query']['limit']);_0x52ce94[_0xaac0('0x20')]=qs[_0xaac0('0x20')](_0x3275cf['query'][_0xaac0('0x20')]);}return _0x34d322['getApplications'](_0x52ce94);}})[_0xaac0('0x14')](function(_0x3baf0c){if(_0x3baf0c){return _0x3baf0c?{'count':_0x50f10c,'rows':_0x3baf0c}:null;}})[_0xaac0('0x14')](respondWithResult(_0x571911,null))[_0xaac0('0x47')](handleError(_0x571911,null));};exports[_0xaac0('0x11f')]=function(_0x475fca,_0x296f1a){return db[_0xaac0('0x120')][_0xaac0('0x51')]({'where':{'id':_0x475fca[_0xaac0('0x49')]['id']}})['then'](handleEntityNotFound(_0x296f1a,null))[_0xaac0('0x14')](function(_0x318f1a){if(_0x318f1a){return _0x318f1a['addProactiveActions'](_0x475fca['body'][_0xaac0('0x5d')],_[_0xaac0('0xec')](_0x475fca[_0xaac0('0x55')],[_0xaac0('0x5d'),'id'])||{});}})[_0xaac0('0x14')](respondWithResult(_0x296f1a,null))['catch'](handleError(_0x296f1a,null));};exports[_0xaac0('0x104')]=function(_0x37e145,_0x10ccc7){var _0x246106={};var _0x4d6775={};var _0x557808;var _0x2dd492;return db[_0xaac0('0x45')][_0xaac0('0x5a')]({'where':{'id':_0x37e145[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x10ccc7,null))[_0xaac0('0x14')](function(_0x57a7e8){if(_0x57a7e8){_0x557808=_0x57a7e8;_0x4d6775[_0xaac0('0x30')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x4d6775[_0xaac0('0x32')]=_[_0xaac0('0x4b')](_0x37e145[_0xaac0('0x32')]);_0x4d6775['filters']=_[_0xaac0('0x33')](_0x4d6775[_0xaac0('0x30')],_0x4d6775['query']);_0x246106[_0xaac0('0x34')]=_[_0xaac0('0x33')](_0x4d6775[_0xaac0('0x30')],qs['fields'](_0x37e145[_0xaac0('0x32')][_0xaac0('0x35')]));_0x246106[_0xaac0('0x34')]=_0x246106[_0xaac0('0x34')][_0xaac0('0x36')]?_0x246106[_0xaac0('0x34')]:_0x4d6775[_0xaac0('0x30')];_0x246106['order']=qs[_0xaac0('0x3a')](_0x37e145[_0xaac0('0x32')][_0xaac0('0x3a')]);_0x246106[_0xaac0('0x3b')]=qs['filters'](_[_0xaac0('0x3d')](_0x37e145['query'],_0x4d6775[_0xaac0('0x3c')]));if(_0x37e145[_0xaac0('0x32')][_0xaac0('0x41')]){_0x246106[_0xaac0('0x3b')]=_[_0xaac0('0x3e')](_0x246106[_0xaac0('0x3b')],{'$or':_[_0xaac0('0x31')](_0x246106[_0xaac0('0x34')],function(_0x21b968){var _0x2a1673={};_0x2a1673[_0x21b968]={'$like':'%'+_0x37e145[_0xaac0('0x32')][_0xaac0('0x41')]+'%'};return _0x2a1673;})});}_0x246106=_['merge']({},_0x246106,_0x37e145[_0xaac0('0x42')]);return _0x557808[_0xaac0('0x104')](_0x246106);}})['then'](function(_0x34e595){if(_0x34e595){_0x2dd492=_0x34e595[_0xaac0('0x36')];if(!_0x37e145[_0xaac0('0x32')][_0xaac0('0x37')](_0xaac0('0x38'))){_0x246106['limit']=qs['limit'](_0x37e145[_0xaac0('0x32')][_0xaac0('0x21')]);_0x246106['offset']=qs['offset'](_0x37e145[_0xaac0('0x32')][_0xaac0('0x20')]);}return _0x557808[_0xaac0('0x104')](_0x246106);}})[_0xaac0('0x14')](function(_0x7ce87b){if(_0x7ce87b){return _0x7ce87b?{'count':_0x2dd492,'rows':_0x7ce87b}:null;}})[_0xaac0('0x14')](respondWithResult(_0x10ccc7,null))[_0xaac0('0x47')](handleError(_0x10ccc7,null));};exports[_0xaac0('0x121')]=function(_0x2e232c,_0x7d6731){var _0x49bfd9=_0x2e232c['query'][_0xaac0('0x122')]===_0xaac0('0x123')?'offlineForm':_0xaac0('0x124');return db['ChatWebsite'][_0xaac0('0x51')]({'attributes':['id',_0x49bfd9],'where':{'id':_0x2e232c[_0xaac0('0x49')]['id']}})['then'](handleEntityNotFound(_0x7d6731,null))[_0xaac0('0x14')](function(_0x5977c3){if(_0x5977c3){var _0x3a1247=_0x5977c3[_0x49bfd9];var _0x3e556b=_0x3a1247&&_0x3a1247[_0xaac0('0x125')]?_0x3a1247['items']:[];_0x7d6731['send']({'fromKey':_[_0xaac0('0x70')](_0x3a1247[_0xaac0('0x126')])?undefined:_0x3a1247[_0xaac0('0x126')],'count':_0x3e556b['length'],'rows':_0x3e556b});}})[_0xaac0('0x47')](handleError(_0x7d6731,null));};exports[_0xaac0('0x127')]=function(_0x1b96b0,_0x1a318b){var _0x39417c={'raw':![],'where':{}};var _0x356ea7={};var _0xc3ea44={'count':0x0,'rows':[]};return db[_0xaac0('0x45')][_0xaac0('0x5a')]({'where':{'id':_0x1b96b0[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x1a318b,null))[_0xaac0('0x14')](function(_0x528c97){if(_0x528c97){_0x356ea7[_0xaac0('0x30')]=_['keys'](db[_0xaac0('0xce')][_0xaac0('0x2e')]);_0x356ea7[_0xaac0('0x32')]=_[_0xaac0('0x4b')](_0x1b96b0['query']);_0x356ea7['filters']=_[_0xaac0('0x33')](_0x356ea7[_0xaac0('0x30')],_0x356ea7['query']);_0x39417c[_0xaac0('0x34')]=_[_0xaac0('0x33')](_0x356ea7[_0xaac0('0x30')],qs[_0xaac0('0x35')](_0x1b96b0[_0xaac0('0x32')][_0xaac0('0x35')]));_0x39417c[_0xaac0('0x34')]=_0x39417c['attributes'][_0xaac0('0x36')]?_0x39417c[_0xaac0('0x34')]:_0x356ea7[_0xaac0('0x30')];if(!_0x1b96b0[_0xaac0('0x32')][_0xaac0('0x37')](_0xaac0('0x38'))){_0x39417c[_0xaac0('0x21')]=qs[_0xaac0('0x21')](_0x1b96b0['query'][_0xaac0('0x21')]);_0x39417c[_0xaac0('0x20')]=qs[_0xaac0('0x20')](_0x1b96b0[_0xaac0('0x32')]['offset']);}_0x39417c['order']=qs[_0xaac0('0x3a')](_0x1b96b0[_0xaac0('0x32')]['sort']);_0x39417c['where']=qs[_0xaac0('0x3c')](_['pick'](_0x1b96b0['query'],_0x356ea7[_0xaac0('0x3c')]));_0x39417c[_0xaac0('0x3b')][_0xaac0('0x57')]=_0x528c97['id'];if(_0x1b96b0['query'][_0xaac0('0x41')]){_0x39417c['where']=_[_0xaac0('0x3e')](_0x39417c['where'],{'$or':_['map'](_0x39417c[_0xaac0('0x34')],function(_0x306507){var _0xac6661={};_0xac6661[_0x306507]={'$like':'%'+_0x1b96b0['query'][_0xaac0('0x41')]+'%'};return _0xac6661;})});}_0x39417c=_[_0xaac0('0x3e')]({},_0x39417c,_0x1b96b0[_0xaac0('0x42')]);return db[_0xaac0('0xce')]['count']({'where':_0x39417c[_0xaac0('0x3b')]})[_0xaac0('0x14')](function(_0x2ead5c){_0xc3ea44['count']=_0x2ead5c;if(_0x1b96b0['query'][_0xaac0('0x44')]){_0x39417c['include']=[{'all':!![]}];}else{_0x39417c[_0xaac0('0x4c')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xaac0('0x128')],'as':_0xaac0('0x129'),'required':![]}];}return db[_0xaac0('0xce')][_0xaac0('0x5b')](_0x39417c);})[_0xaac0('0x14')](function(_0xfb8dd5){_0xc3ea44[_0xaac0('0x46')]=_0xfb8dd5;return _0xc3ea44;});}})[_0xaac0('0x14')](respondWithFilteredResult(_0x1a318b,_0x39417c))[_0xaac0('0x47')](handleError(_0x1a318b,null));};exports[_0xaac0('0x12a')]=function(_0x40599,_0xba8976){return db['ChatWebsite'][_0xaac0('0x51')]({'where':{'id':_0x40599[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0xba8976,null))['then'](function(_0x11fd44){if(_0x11fd44){return _0x11fd44['addAgents'](_0x40599['body'][_0xaac0('0x5d')],_[_0xaac0('0xec')](_0x40599[_0xaac0('0x55')],[_0xaac0('0x5d'),'id'])||{})[_0xaac0('0xaf')](function(_0x48227e){for(var _0x53332e=0x0;_0x53332e<_0x40599[_0xaac0('0x55')][_0xaac0('0x5d')][_0xaac0('0x36')];_0x53332e+=0x1){socket['emit'](_0xaac0('0x12b'),{'UserId':Number(_0x40599[_0xaac0('0x55')]['ids'][_0x53332e]),'ChatWebsiteId':Number(_0x40599[_0xaac0('0x49')]['id'])});}return _0x48227e;});}})[_0xaac0('0x14')](respondWithResult(_0xba8976,null))[_0xaac0('0x47')](handleError(_0xba8976,null));};exports['removeAgents']=function(_0x355b70,_0x3f89c5){return db[_0xaac0('0x45')][_0xaac0('0x51')]({'where':{'id':_0x355b70[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x3f89c5,null))['then'](function(_0x5a25f6){if(_0x5a25f6){return _0x5a25f6[_0xaac0('0x12c')](_0x355b70[_0xaac0('0x32')][_0xaac0('0x5d')])['then'](function(){if(_[_0xaac0('0x12d')](_0x355b70[_0xaac0('0x32')][_0xaac0('0x5d')])){for(var _0x1b6360=0x0;_0x1b6360<_0x355b70['query'][_0xaac0('0x5d')][_0xaac0('0x36')];_0x1b6360+=0x1){socket[_0xaac0('0x12e')](_0xaac0('0x12f'),{'UserId':Number(_0x355b70[_0xaac0('0x32')][_0xaac0('0x5d')][_0x1b6360]),'ChatWebsiteId':Number(_0x355b70['params']['id'])});}}else{socket['emit'](_0xaac0('0x12f'),{'UserId':Number(_0x355b70[_0xaac0('0x32')]['ids']),'ChatWebsiteId':Number(_0x355b70[_0xaac0('0x49')]['id'])});}});}})[_0xaac0('0x14')](respondWithStatusCode(_0x3f89c5,null))[_0xaac0('0x47')](handleError(_0x3f89c5,null));};exports['getAgents']=function(_0x57b894,_0x4ceeae){var _0x51e69c={};var _0x15ba36={};var _0x2df0fc;var _0x19d919;return db[_0xaac0('0x45')][_0xaac0('0x5a')]({'where':{'id':_0x57b894[_0xaac0('0x49')]['id']}})[_0xaac0('0x14')](handleEntityNotFound(_0x4ceeae,null))['then'](function(_0x33e8dc){if(_0x33e8dc){_0x2df0fc=_0x33e8dc;_0x15ba36['model']=_[_0xaac0('0x4b')](db['User'][_0xaac0('0x2e')]);_0x15ba36[_0xaac0('0x32')]=_['keys'](_0x57b894['query']);_0x15ba36[_0xaac0('0x3c')]=_[_0xaac0('0x33')](_0x15ba36[_0xaac0('0x30')],_0x15ba36[_0xaac0('0x32')]);_0x51e69c[_0xaac0('0x34')]=_[_0xaac0('0x33')](_0x15ba36[_0xaac0('0x30')],qs['fields'](_0x57b894[_0xaac0('0x32')][_0xaac0('0x35')]));_0x51e69c[_0xaac0('0x34')]=_0x51e69c[_0xaac0('0x34')]['length']?_0x51e69c[_0xaac0('0x34')]:_0x15ba36[_0xaac0('0x30')];_0x51e69c['order']=qs[_0xaac0('0x3a')](_0x57b894[_0xaac0('0x32')]['sort']);_0x51e69c[_0xaac0('0x3b')]=qs[_0xaac0('0x3c')](_[_0xaac0('0x3d')](_0x57b894['query'],_0x15ba36[_0xaac0('0x3c')]));if(_0x57b894[_0xaac0('0x32')]['filter']){_0x51e69c[_0xaac0('0x3b')]=_[_0xaac0('0x3e')](_0x51e69c[_0xaac0('0x3b')],{'$or':_['map'](_0x51e69c['attributes'],function(_0x42166f){var _0x162ec8={};_0x162ec8[_0x42166f]={'$like':'%'+_0x57b894[_0xaac0('0x32')]['filter']+'%'};return _0x162ec8;})});}_0x51e69c=_[_0xaac0('0x3e')]({},_0x51e69c,_0x57b894[_0xaac0('0x42')]);return _0x2df0fc[_0xaac0('0x130')](_0x51e69c);}})['then'](function(_0x57b679){if(_0x57b679){_0x19d919=_0x57b679[_0xaac0('0x36')];if(!_0x57b894[_0xaac0('0x32')][_0xaac0('0x37')](_0xaac0('0x38'))){_0x51e69c['limit']=qs[_0xaac0('0x21')](_0x57b894[_0xaac0('0x32')]['limit']);_0x51e69c[_0xaac0('0x20')]=qs['offset'](_0x57b894[_0xaac0('0x32')]['offset']);}return _0x2df0fc['getAgents'](_0x51e69c);}})[_0xaac0('0x14')](function(_0x4ab8cc){if(_0x4ab8cc){return _0x4ab8cc?{'count':_0x19d919,'rows':_0x4ab8cc}:null;}})[_0xaac0('0x14')](respondWithResult(_0x4ceeae,null))[_0xaac0('0x47')](handleError(_0x4ceeae,null));}; \ No newline at end of file +var _0x2086=['querystring','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','sendStatus','status','json','offset','limit','undefined','count','Content-Range','destroy','get','ChatWebsites','end','stack','name','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows','show','params','mandatoryDispositionPause','merge','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','findOne','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','root','server/files/images/logos/','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','account','list','orderBy','asc','Applications','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','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','messageId','created','push','applications','close','unmanaged','*,*,*,*','ChatMessage','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','files','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','SendMail','email','offlineMessageSubject','toPairsIn','mapValues','subjectOffline','Chat','MailAccountId','NotifyMailAccount','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','internal','Tags','color','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','alignment','verticalAlignment','labelText','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','false','offlineForm','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','bluebird','mustache','util','path','ejs','fs-extra'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x2086,0x124));var _0x6208=function(_0x5ed389,_0x1d0add){_0x5ed389=_0x5ed389-0x0;var _0x1935e6=_0x2086[_0x5ed389];return _0x1935e6;};'use strict';var BPromise=require(_0x6208('0x0'));var Mustache=require(_0x6208('0x1'));var util=require(_0x6208('0x2'));var path=require(_0x6208('0x3'));var ejs=require(_0x6208('0x4'));var fs=require('fs');var fs_extra=require(_0x6208('0x5'));var _=require('lodash');var querystring=require(_0x6208('0x6'));var Redis=require(_0x6208('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x6208('0x8'))(_0x6208('0x9'));var config=require(_0x6208('0xa'));var db=require(_0x6208('0xb'))['db'];config[_0x6208('0xc')]=_['defaults'](config[_0x6208('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6208('0xc')]));require(_0x6208('0xd'))[_0x6208('0xe')](socket);var htmlToText=require(_0x6208('0xf'));var jayson=require(_0x6208('0x10'));var client=jayson[_0x6208('0x11')][_0x6208('0x12')]({'port':0x232c});var client9002=jayson['client'][_0x6208('0x12')]({'port':0x232a});var client9003=jayson[_0x6208('0x11')][_0x6208('0x12')]({'port':0x232b});var client9001=jayson[_0x6208('0x11')][_0x6208('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x532035,_0x3d5715,_0x53f5f1,_0x3b1cab){return new BPromise(function(_0x1e1d2e,_0x3d95b4){var _0x53962d=_0x3b1cab||client;return _0x53962d[_0x6208('0x13')](_0x532035,_0x53f5f1)[_0x6208('0x14')](function(_0x3a54b3){logger['info'](_0x6208('0x15'),_0x3d5715,_0x6208('0x16'));logger[_0x6208('0x17')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3d5715,_0x6208('0x16'),JSON[_0x6208('0x18')](_0x3a54b3));if(_0x3a54b3[_0x6208('0x19')]){if(_0x3a54b3['error']['code']===0x1f4){logger[_0x6208('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x3d5715,_0x3a54b3['error'][_0x6208('0x1a')]);return _0x3d95b4(_0x3a54b3['error'][_0x6208('0x1a')]);}logger[_0x6208('0x19')](_0x6208('0x15'),_0x3d5715,_0x3a54b3[_0x6208('0x19')][_0x6208('0x1a')]);return _0x1e1d2e(_0x3a54b3[_0x6208('0x19')][_0x6208('0x1a')]);}else{logger[_0x6208('0x1b')](_0x6208('0x15'),_0x3d5715,_0x6208('0x16'));_0x1e1d2e(_0x3a54b3[_0x6208('0x1c')][_0x6208('0x1a')]);}})['catch'](function(_0x2d3dbf){logger[_0x6208('0x19')](_0x6208('0x15'),_0x3d5715,_0x2d3dbf);_0x3d95b4(_0x2d3dbf);});});}function respondWithStatusCode(_0x1356cc,_0x25675e){_0x25675e=_0x25675e||0xcc;return function(_0x11524a){if(_0x11524a){return _0x1356cc[_0x6208('0x1d')](_0x25675e);}return _0x1356cc[_0x6208('0x1e')](_0x25675e)['end']();};}function respondWithResult(_0x15d14e,_0x251fbe){_0x251fbe=_0x251fbe||0xc8;return function(_0x1ed151){if(_0x1ed151){return _0x15d14e[_0x6208('0x1e')](_0x251fbe)[_0x6208('0x1f')](_0x1ed151);}};}function respondWithFilteredResult(_0x40bab6,_0x117fa7){return function(_0x364b13){if(_0x364b13){var _0x28251b=typeof _0x117fa7[_0x6208('0x20')]==='undefined'&&typeof _0x117fa7[_0x6208('0x21')]===_0x6208('0x22');var _0x330ac9=_0x364b13[_0x6208('0x23')];var _0x2e1e92=_0x28251b?0x0:_0x117fa7[_0x6208('0x20')];var _0x5d03d7=_0x28251b?_0x364b13['count']:_0x117fa7[_0x6208('0x20')]+_0x117fa7[_0x6208('0x21')];var _0x18df12;if(_0x5d03d7>=_0x330ac9){_0x5d03d7=_0x330ac9;_0x18df12=0xc8;}else{_0x18df12=0xce;}_0x40bab6[_0x6208('0x1e')](_0x18df12);return _0x40bab6['set'](_0x6208('0x24'),_0x2e1e92+'-'+_0x5d03d7+'/'+_0x330ac9)[_0x6208('0x1f')](_0x364b13);}return null;};}function saveUpdates(_0x4c9bbe){return function(_0x469750){if(_0x469750){return _0x469750['update'](_0x4c9bbe)['then'](function(_0x53f775){return _0x53f775;});}return null;};}function removeEntity(_0x3f5474){return function(_0x586af3){if(_0x586af3){return _0x586af3[_0x6208('0x25')]()['then'](function(){var _0x3b4ee1=_0x586af3[_0x6208('0x26')]({'plain':!![]});var _0x482379=_0x6208('0x27');return db['UserProfileResource'][_0x6208('0x25')]({'where':{'type':_0x482379,'resourceId':_0x3b4ee1['id']}})[_0x6208('0x14')](function(){return _0x586af3;});})[_0x6208('0x14')](function(){_0x3f5474['status'](0xcc)[_0x6208('0x28')]();});}};}function handleEntityNotFound(_0xd856b6){return function(_0xbfd042){if(!_0xbfd042){_0xd856b6[_0x6208('0x1d')](0x194);}return _0xbfd042;};}function handleError(_0x3c7a04,_0x4acb59){_0x4acb59=_0x4acb59||0x1f4;return function(_0x2a8816){logger[_0x6208('0x19')](_0x2a8816[_0x6208('0x29')]);if(_0x2a8816[_0x6208('0x2a')]){delete _0x2a8816[_0x6208('0x2a')];}_0x3c7a04[_0x6208('0x1e')](_0x4acb59)['send'](_0x2a8816);};}exports['index']=function(_0x430d9d,_0x5cf0fa){var _0x53da67={'include':[{'model':db[_0x6208('0x2b')],'as':'mandatoryDispositionPause'}]},_0x2bdf7f={},_0x1a7d1c={'count':0x0,'rows':[]};var _0x3829b8=_[_0x6208('0x2c')](db[_0x6208('0x2d')][_0x6208('0x2e')],function(_0x158e30){return{'name':_0x158e30[_0x6208('0x2f')],'type':_0x158e30[_0x6208('0x30')][_0x6208('0x31')]};});_0x2bdf7f['model']=_[_0x6208('0x2c')](_0x3829b8,_0x6208('0x2a'));_0x2bdf7f['query']=_[_0x6208('0x32')](_0x430d9d[_0x6208('0x33')]);_0x2bdf7f[_0x6208('0x34')]=_[_0x6208('0x35')](_0x2bdf7f[_0x6208('0x36')],_0x2bdf7f[_0x6208('0x33')]);_0x53da67[_0x6208('0x37')]=_[_0x6208('0x35')](_0x2bdf7f[_0x6208('0x36')],qs[_0x6208('0x38')](_0x430d9d[_0x6208('0x33')][_0x6208('0x38')]));_0x53da67[_0x6208('0x37')]=_0x53da67[_0x6208('0x37')][_0x6208('0x39')]?_0x53da67[_0x6208('0x37')]:_0x2bdf7f[_0x6208('0x36')];if(!_0x430d9d[_0x6208('0x33')][_0x6208('0x3a')](_0x6208('0x3b'))){_0x53da67[_0x6208('0x21')]=qs['limit'](_0x430d9d['query'][_0x6208('0x21')]);_0x53da67['offset']=qs[_0x6208('0x20')](_0x430d9d[_0x6208('0x33')]['offset']);}_0x53da67[_0x6208('0x3c')]=qs[_0x6208('0x3d')](_0x430d9d['query'][_0x6208('0x3d')]);_0x53da67['where']=qs['filters'](_[_0x6208('0x3e')](_0x430d9d['query'],_0x2bdf7f[_0x6208('0x34')]),_0x3829b8);if(_0x430d9d['query'][_0x6208('0x3f')]){_0x53da67[_0x6208('0x40')]=_['merge'](_0x53da67[_0x6208('0x40')],{'$or':_[_0x6208('0x2c')](_0x3829b8,function(_0x5ac2d3){if(_0x5ac2d3[_0x6208('0x30')]!==_0x6208('0x41')){var _0x16630a={};_0x16630a[_0x5ac2d3[_0x6208('0x2a')]]={'$like':'%'+_0x430d9d['query'][_0x6208('0x3f')]+'%'};return _0x16630a;}})});}_0x53da67=_['merge']({},_0x53da67,_0x430d9d[_0x6208('0x42')]);var _0x4d86fd={'where':_0x53da67[_0x6208('0x40')]};return db[_0x6208('0x2d')][_0x6208('0x23')](_0x4d86fd)[_0x6208('0x14')](function(_0xb06f83){_0x1a7d1c['count']=_0xb06f83;if(_0x430d9d[_0x6208('0x33')][_0x6208('0x43')]){_0x53da67[_0x6208('0x44')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x53da67);})[_0x6208('0x14')](function(_0x1c5482){_0x1a7d1c[_0x6208('0x45')]=_0x1c5482;return _0x1a7d1c;})[_0x6208('0x14')](respondWithFilteredResult(_0x5cf0fa,_0x53da67))['catch'](handleError(_0x5cf0fa,null));};exports[_0x6208('0x46')]=function(_0x2b71ba,_0x44e12f){var _0x17f2c1={'raw':![],'where':{'id':_0x2b71ba[_0x6208('0x47')]['id']},'include':[{'model':db[_0x6208('0x2b')],'as':_0x6208('0x48')}]},_0x39285a={};_0x39285a['model']=_[_0x6208('0x32')](db[_0x6208('0x2d')][_0x6208('0x2e')]);_0x39285a[_0x6208('0x33')]=_['keys'](_0x2b71ba[_0x6208('0x33')]);_0x39285a['filters']=_[_0x6208('0x35')](_0x39285a[_0x6208('0x36')],_0x39285a[_0x6208('0x33')]);_0x17f2c1['attributes']=_['intersection'](_0x39285a[_0x6208('0x36')],qs[_0x6208('0x38')](_0x2b71ba[_0x6208('0x33')]['fields']));_0x17f2c1[_0x6208('0x37')]=_0x17f2c1[_0x6208('0x37')][_0x6208('0x39')]?_0x17f2c1[_0x6208('0x37')]:_0x39285a['model'];if(_0x2b71ba['query'][_0x6208('0x43')]){_0x17f2c1[_0x6208('0x44')]=[{'all':!![]}];}_0x17f2c1=_[_0x6208('0x49')]({},_0x17f2c1,_0x2b71ba[_0x6208('0x42')]);return db[_0x6208('0x2d')]['find'](_0x17f2c1)[_0x6208('0x14')](handleEntityNotFound(_0x44e12f,null))[_0x6208('0x14')](respondWithResult(_0x44e12f,null))[_0x6208('0x4a')](handleError(_0x44e12f,null));};exports[_0x6208('0x4b')]=function(_0x26248f,_0x1467ab){return db[_0x6208('0x2d')]['create'](_0x26248f[_0x6208('0x4c')],{})[_0x6208('0x14')](function(_0x6490e6){var _0x60d4bf=_0x26248f[_0x6208('0x4d')][_0x6208('0x26')]({'plain':!![]});if(!_0x60d4bf)throw new Error(_0x6208('0x4e'));if(_0x60d4bf[_0x6208('0x4f')]==='user'){var _0x5c5a4e=_0x6490e6[_0x6208('0x26')]({'plain':!![]});var _0x520a8d=_0x6208('0x27');return db[_0x6208('0x50')][_0x6208('0x51')]({'where':{'name':_0x520a8d,'userProfileId':_0x60d4bf[_0x6208('0x52')]},'raw':!![]})[_0x6208('0x14')](function(_0x53cd63){if(_0x53cd63&&_0x53cd63[_0x6208('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x5c5a4e[_0x6208('0x2a')],'resourceId':_0x5c5a4e['id'],'type':_0x53cd63[_0x6208('0x2a')],'sectionId':_0x53cd63['id']},{})[_0x6208('0x14')](function(){return _0x6490e6;});}else{return _0x6490e6;}})[_0x6208('0x4a')](function(_0x46d19e){logger[_0x6208('0x19')](_0x6208('0x54'),_0x46d19e);throw _0x46d19e;});}return _0x6490e6;})['then'](respondWithResult(_0x1467ab,0xc9))[_0x6208('0x4a')](handleError(_0x1467ab,null));};exports[_0x6208('0x55')]=function(_0x45dfdf,_0x48a135){if(_0x45dfdf[_0x6208('0x4c')]['id']){delete _0x45dfdf[_0x6208('0x4c')]['id'];}return db[_0x6208('0x2d')][_0x6208('0x51')]({'where':{'id':_0x45dfdf['params']['id']},'include':[{'model':db[_0x6208('0x2b')],'as':_0x6208('0x48')}]})['then'](handleEntityNotFound(_0x48a135,null))[_0x6208('0x14')](saveUpdates(_0x45dfdf[_0x6208('0x4c')],null))['then'](respondWithResult(_0x48a135,null))[_0x6208('0x4a')](handleError(_0x48a135,null));};exports[_0x6208('0x25')]=function(_0x3c31a1,_0xeabdb8){return db[_0x6208('0x2d')][_0x6208('0x51')]({'where':{'id':_0x3c31a1['params']['id']}})[_0x6208('0x14')](handleEntityNotFound(_0xeabdb8,null))[_0x6208('0x14')](removeEntity(_0xeabdb8,null))['catch'](handleError(_0xeabdb8,null));};exports[_0x6208('0x56')]=function(_0x22be5c,_0x52b296){return db['ChatWebsite'][_0x6208('0x56')]()[_0x6208('0x14')](respondWithResult(_0x52b296,null))[_0x6208('0x4a')](handleError(_0x52b296,null));};exports[_0x6208('0x57')]=function(_0x3cc07c,_0x1fa553){if(_0x3cc07c[_0x6208('0x4c')]['id']){delete _0x3cc07c[_0x6208('0x4c')]['id'];}return db[_0x6208('0x2d')][_0x6208('0x51')]({'where':{'id':_0x3cc07c['params']['id']}})['then'](handleEntityNotFound(_0x1fa553,null))['then'](function(_0x513a78){if(_0x513a78){_0x3cc07c[_0x6208('0x4c')][_0x6208('0x58')]=_0x513a78['id'];return db[_0x6208('0x59')][_0x6208('0x4b')](_0x3cc07c[_0x6208('0x4c')]);}})[_0x6208('0x14')](respondWithResult(_0x1fa553,null))[_0x6208('0x4a')](handleError(_0x1fa553,null));};exports['getDispositions']=function(_0x4aa147,_0x158900){var _0x2509ca={'raw':![],'where':{}};var _0x2f644c={};var _0x3a57da={'count':0x0,'rows':[]};return db[_0x6208('0x2d')][_0x6208('0x5a')]({'where':{'id':_0x4aa147[_0x6208('0x47')]['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x158900,null))['then'](function(_0x3fe2a5){if(_0x3fe2a5){_0x2f644c[_0x6208('0x36')]=_[_0x6208('0x32')](db[_0x6208('0x59')][_0x6208('0x2e')]);_0x2f644c[_0x6208('0x33')]=_['keys'](_0x4aa147[_0x6208('0x33')]);_0x2f644c['filters']=_[_0x6208('0x35')](_0x2f644c[_0x6208('0x36')],_0x2f644c[_0x6208('0x33')]);_0x2509ca[_0x6208('0x37')]=_[_0x6208('0x35')](_0x2f644c[_0x6208('0x36')],qs[_0x6208('0x38')](_0x4aa147[_0x6208('0x33')][_0x6208('0x38')]));_0x2509ca[_0x6208('0x37')]=_0x2509ca[_0x6208('0x37')][_0x6208('0x39')]?_0x2509ca[_0x6208('0x37')]:_0x2f644c[_0x6208('0x36')];if(!_0x4aa147[_0x6208('0x33')][_0x6208('0x3a')](_0x6208('0x3b'))){_0x2509ca['limit']=qs[_0x6208('0x21')](_0x4aa147[_0x6208('0x33')][_0x6208('0x21')]);_0x2509ca[_0x6208('0x20')]=qs[_0x6208('0x20')](_0x4aa147[_0x6208('0x33')][_0x6208('0x20')]);}_0x2509ca[_0x6208('0x3c')]=qs[_0x6208('0x3d')](_0x4aa147[_0x6208('0x33')][_0x6208('0x3d')]);_0x2509ca[_0x6208('0x40')]=qs['filters'](_['pick'](_0x4aa147[_0x6208('0x33')],_0x2f644c['filters']));_0x2509ca[_0x6208('0x40')][_0x6208('0x58')]=_0x3fe2a5['id'];if(_0x4aa147[_0x6208('0x33')][_0x6208('0x3f')]){_0x2509ca['where']=_[_0x6208('0x49')](_0x2509ca[_0x6208('0x40')],{'$or':_['map'](_0x2509ca[_0x6208('0x37')],function(_0x3634f2){var _0x2b02fc={};_0x2b02fc[_0x3634f2]={'$like':'%'+_0x4aa147[_0x6208('0x33')]['filter']+'%'};return _0x2b02fc;})});}_0x2509ca=_[_0x6208('0x49')]({},_0x2509ca,_0x4aa147[_0x6208('0x42')]);return db[_0x6208('0x59')]['count']({'where':_0x2509ca[_0x6208('0x40')]})[_0x6208('0x14')](function(_0x1288ff){_0x3a57da[_0x6208('0x23')]=_0x1288ff;if(_0x4aa147[_0x6208('0x33')][_0x6208('0x43')]){_0x2509ca[_0x6208('0x44')]=[{'all':!![]}];}return db[_0x6208('0x59')][_0x6208('0x5b')](_0x2509ca);})[_0x6208('0x14')](function(_0x33ca75){_0x3a57da[_0x6208('0x45')]=_0x33ca75;return _0x3a57da;});}})['then'](respondWithFilteredResult(_0x158900,_0x2509ca))[_0x6208('0x4a')](handleError(_0x158900,null));};exports[_0x6208('0x5c')]=function(_0x29066f,_0x12bf1c){return db['ChatWebsite']['find']({'where':{'id':_0x29066f[_0x6208('0x47')]['id']}})['then'](handleEntityNotFound(_0x12bf1c,null))[_0x6208('0x14')](function(_0x4017e3){if(_0x4017e3){return _0x4017e3['removeDispositions'](_0x29066f['query'][_0x6208('0x5d')]);}})['then'](respondWithStatusCode(_0x12bf1c,null))['catch'](handleError(_0x12bf1c,null));};exports[_0x6208('0x5e')]=function(_0x3219a8,_0x28270d){if(_0x3219a8[_0x6208('0x4c')]['id']){delete _0x3219a8[_0x6208('0x4c')]['id'];}return db[_0x6208('0x2d')][_0x6208('0x51')]({'where':{'id':_0x3219a8[_0x6208('0x47')]['id']}})['then'](handleEntityNotFound(_0x28270d,null))['then'](function(_0x4301ca){if(_0x4301ca){_0x3219a8[_0x6208('0x4c')][_0x6208('0x58')]=_0x4301ca['id'];return db['CannedAnswer'][_0x6208('0x4b')](_0x3219a8['body']);}})[_0x6208('0x14')](respondWithResult(_0x28270d,null))['catch'](handleError(_0x28270d,null));};exports[_0x6208('0x5f')]=function(_0x2a03bb,_0x3cdb04){var _0xa796ce={'raw':![],'where':{}};var _0x245eec={};var _0x1ebd2a={'count':0x0,'rows':[]};return db[_0x6208('0x2d')]['findOne']({'where':{'id':_0x2a03bb[_0x6208('0x47')]['id']}})['then'](handleEntityNotFound(_0x3cdb04,null))[_0x6208('0x14')](function(_0x6c62ed){if(_0x6c62ed){_0x245eec[_0x6208('0x36')]=_[_0x6208('0x32')](db['CannedAnswer']['rawAttributes']);_0x245eec[_0x6208('0x33')]=_[_0x6208('0x32')](_0x2a03bb['query']);_0x245eec['filters']=_[_0x6208('0x35')](_0x245eec[_0x6208('0x36')],_0x245eec[_0x6208('0x33')]);_0xa796ce[_0x6208('0x37')]=_[_0x6208('0x35')](_0x245eec[_0x6208('0x36')],qs[_0x6208('0x38')](_0x2a03bb['query'][_0x6208('0x38')]));_0xa796ce[_0x6208('0x37')]=_0xa796ce['attributes'][_0x6208('0x39')]?_0xa796ce[_0x6208('0x37')]:_0x245eec[_0x6208('0x36')];if(!_0x2a03bb[_0x6208('0x33')][_0x6208('0x3a')](_0x6208('0x3b'))){_0xa796ce[_0x6208('0x21')]=qs[_0x6208('0x21')](_0x2a03bb[_0x6208('0x33')][_0x6208('0x21')]);_0xa796ce[_0x6208('0x20')]=qs[_0x6208('0x20')](_0x2a03bb[_0x6208('0x33')][_0x6208('0x20')]);}_0xa796ce[_0x6208('0x3c')]=qs['sort'](_0x2a03bb[_0x6208('0x33')][_0x6208('0x3d')]);_0xa796ce['where']=qs[_0x6208('0x34')](_[_0x6208('0x3e')](_0x2a03bb['query'],_0x245eec[_0x6208('0x34')]));_0xa796ce[_0x6208('0x40')]['ChatWebsiteId']=_0x6c62ed['id'];if(_0x2a03bb[_0x6208('0x33')][_0x6208('0x3f')]){_0xa796ce[_0x6208('0x40')]=_['merge'](_0xa796ce['where'],{'$or':_['map'](_0xa796ce['attributes'],function(_0x5f2a7){var _0x591f4f={};_0x591f4f[_0x5f2a7]={'$like':'%'+_0x2a03bb[_0x6208('0x33')][_0x6208('0x3f')]+'%'};return _0x591f4f;})});}_0xa796ce=_['merge']({},_0xa796ce,_0x2a03bb[_0x6208('0x42')]);return db['CannedAnswer'][_0x6208('0x23')]({'where':_0xa796ce['where']})[_0x6208('0x14')](function(_0x5cb80c){_0x1ebd2a[_0x6208('0x23')]=_0x5cb80c;if(_0x2a03bb[_0x6208('0x33')]['includeAll']){_0xa796ce['include']=[{'all':!![]}];}return db[_0x6208('0x60')]['findAll'](_0xa796ce);})[_0x6208('0x14')](function(_0x49f00e){_0x1ebd2a[_0x6208('0x45')]=_0x49f00e;return _0x1ebd2a;});}})['then'](respondWithFilteredResult(_0x3cdb04,_0xa796ce))['catch'](handleError(_0x3cdb04,null));};exports[_0x6208('0x61')]=function(_0x349042,_0x1da591){return db['ChatWebsite'][_0x6208('0x51')]({'where':{'id':_0x349042[_0x6208('0x47')]['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x1da591,null))[_0x6208('0x14')](function(_0x21cd1e){if(_0x21cd1e){return _0x21cd1e[_0x6208('0x61')](_0x349042[_0x6208('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x1da591,null))[_0x6208('0x4a')](handleError(_0x1da591,null));};exports[_0x6208('0x62')]=function(_0x265b7f,_0x457a84){_0x265b7f[_0x6208('0x4c')][_0x6208('0x63')]=_0x265b7f['file'][_0x6208('0x64')];return db['ChatWebsite'][_0x6208('0x51')]({'where':{'id':_0x265b7f[_0x6208('0x47')]['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x457a84,null))[_0x6208('0x14')](saveUpdates(_0x265b7f[_0x6208('0x4c')],null))[_0x6208('0x14')](respondWithResult(_0x457a84,null))[_0x6208('0x4a')](handleError(_0x457a84,null));};exports[_0x6208('0x65')]=function(_0x38a418,_0x5731e2){_0x38a418['body'][_0x6208('0x66')]=_0x38a418[_0x6208('0x67')][_0x6208('0x64')];return db[_0x6208('0x2d')]['find']({'where':{'id':_0x38a418[_0x6208('0x47')]['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x5731e2,null))[_0x6208('0x14')](saveUpdates(_0x38a418[_0x6208('0x4c')],null))[_0x6208('0x14')](respondWithResult(_0x5731e2,null))[_0x6208('0x4a')](handleError(_0x5731e2,null));};exports[_0x6208('0x68')]=function(_0x18297c,_0x3fae98){_0x18297c[_0x6208('0x4c')][_0x6208('0x69')]=_0x18297c[_0x6208('0x67')][_0x6208('0x64')];return db['ChatWebsite'][_0x6208('0x51')]({'where':{'id':_0x18297c[_0x6208('0x47')]['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x3fae98,null))[_0x6208('0x14')](saveUpdates(_0x18297c[_0x6208('0x4c')],null))[_0x6208('0x14')](respondWithResult(_0x3fae98,null))[_0x6208('0x4a')](handleError(_0x3fae98,null));};exports[_0x6208('0x6a')]=function(_0x3483ff,_0x175c92){_0x3483ff[_0x6208('0x4c')][_0x6208('0x6b')]=_0x3483ff[_0x6208('0x67')][_0x6208('0x64')];return db[_0x6208('0x2d')][_0x6208('0x51')]({'where':{'id':_0x3483ff[_0x6208('0x47')]['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x175c92,null))[_0x6208('0x14')](saveUpdates(_0x3483ff[_0x6208('0x4c')],null))['then'](respondWithResult(_0x175c92,null))['catch'](handleError(_0x175c92,null));};exports[_0x6208('0x6c')]=function(_0x151e1f,_0x2265df){var _0x1dab34=path[_0x6208('0x6d')](config['root'],_0x6208('0x6e'));var _0x2c2f7c={'where':{'id':_0x151e1f['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x7ed61=![];return require(_0x6208('0x6f'))['getLicense']()[_0x6208('0x14')](function(_0xa6bbd9){if(_0xa6bbd9){_0x7ed61=_0xa6bbd9[_0x6208('0x70')];}})[_0x6208('0x14')](function(){return db['ChatWebsite']['find'](_0x2c2f7c);})['then'](handleEntityNotFound(_0x2265df,null))[_0x6208('0x14')](function(_0x234f80){if(_0x234f80){if(!_[_0x6208('0x71')](_0x234f80[_0x6208('0x63')])){if(fs[_0x6208('0x72')](path['join'](config[_0x6208('0x73')],_0x6208('0x74'),_0x234f80[_0x6208('0x63')]))&&_0x7ed61){_0x1dab34=path[_0x6208('0x6d')](config[_0x6208('0x73')],'server/files/images/logos/',_0x234f80['sitepic']);}}return _0x2265df['download'](_0x1dab34);}})[_0x6208('0x4a')](handleError(_0x2265df,null));};exports['getAvatar']=function(_0x337157,_0x588a7f){var _0x359807=path['join'](config[_0x6208('0x73')],'server/files/images/avatars/default_avatar.png');var _0x5346a0={'where':{'id':_0x337157[_0x6208('0x47')]['id']},'attributes':['id',_0x6208('0x66')],'raw':!![]};return db[_0x6208('0x2d')][_0x6208('0x51')](_0x5346a0)[_0x6208('0x14')](handleEntityNotFound(_0x588a7f,null))[_0x6208('0x14')](function(_0x1b3cd2){if(_0x1b3cd2){if(!_[_0x6208('0x71')](_0x1b3cd2['agentAvatar'])){if(fs[_0x6208('0x72')](path['join'](config[_0x6208('0x73')],'server/files/images/avatars/',_0x1b3cd2['agentAvatar']))){_0x359807=path[_0x6208('0x6d')](config['root'],_0x6208('0x75'),_0x1b3cd2[_0x6208('0x66')]);}}return _0x588a7f[_0x6208('0x76')](_0x359807);}})[_0x6208('0x4a')](handleError(_0x588a7f,null));};exports[_0x6208('0x77')]=function(_0xcc7962,_0x351428){var _0x19a7fc=path[_0x6208('0x6d')](config[_0x6208('0x73')],_0x6208('0x78'));var _0x253920={'where':{'id':_0xcc7962['params']['id']},'attributes':['id',_0x6208('0x69'),_0x6208('0x79')],'raw':!![]};return db[_0x6208('0x2d')][_0x6208('0x51')](_0x253920)[_0x6208('0x14')](handleEntityNotFound(_0x351428,null))[_0x6208('0x14')](function(_0x86804d){if(_0x86804d){if(!_[_0x6208('0x71')](_0x86804d[_0x6208('0x69')])){if(fs[_0x6208('0x72')](path[_0x6208('0x6d')](config[_0x6208('0x73')],'server/files/images/avatars/',_0x86804d[_0x6208('0x69')]))&&_0x86804d['showCustomerAvatar']){_0x19a7fc=path[_0x6208('0x6d')](config[_0x6208('0x73')],_0x6208('0x75'),_0x86804d[_0x6208('0x69')]);}}return _0x351428['download'](_0x19a7fc);}})[_0x6208('0x4a')](handleError(_0x351428,null));};exports[_0x6208('0x7a')]=function(_0x44578b,_0x59e72c){var _0x2f531e=path[_0x6208('0x6d')](config[_0x6208('0x73')],'server/files/images/avatars/system_avatar.png');var _0x37d48f={'where':{'id':_0x44578b[_0x6208('0x47')]['id']},'attributes':['id',_0x6208('0x6b')],'raw':!![]};return db[_0x6208('0x2d')][_0x6208('0x51')](_0x37d48f)[_0x6208('0x14')](handleEntityNotFound(_0x59e72c,null))[_0x6208('0x14')](function(_0x474b1e){if(_0x474b1e){if(!_[_0x6208('0x71')](_0x474b1e['systemAvatar'])){if(fs[_0x6208('0x72')](path['join'](config[_0x6208('0x73')],_0x6208('0x75'),_0x474b1e[_0x6208('0x6b')]))){_0x2f531e=path[_0x6208('0x6d')](config[_0x6208('0x73')],_0x6208('0x75'),_0x474b1e[_0x6208('0x6b')]);}}return _0x59e72c[_0x6208('0x76')](_0x2f531e);}})[_0x6208('0x4a')](handleError(_0x59e72c,null));};exports[_0x6208('0x7b')]=function(_0x3e93d7,_0x23c335){var _0x4b5538=require('user-agent-parser');var _0x152565=new _0x4b5538();var _0xa069b7=_0x152565[_0x6208('0x7c')](_0x3e93d7[_0x6208('0x7d')]['user-agent'])[_0x6208('0x7e')]();var _0x23ea91={'body':_0x3e93d7[_0x6208('0x4c')],'channel':_0x6208('0x7f')};var _0x344cda=[];var _0x28c2aa=[];var _0x4c2e38={};var _0x2ae600=![];return db[_0x6208('0x80')]['describe']()['then'](function(_0x37607b){if(!_0x37607b){throw new db[(_0x6208('0x81'))][(_0x6208('0x82'))](_0x6208('0x83'));}_0x344cda=_['difference'](_['keys'](_0x37607b),[_0x6208('0x84'),_0x6208('0x85')]);_0x28c2aa=_[_0x6208('0x86')](_['keys'](_0x37607b),[_0x6208('0x84'),_0x6208('0x85'),'CompanyId',_0x6208('0x87')]);if(_0x3e93d7[_0x6208('0x4c')]['id']){delete _0x3e93d7[_0x6208('0x4c')]['id'];}if(_[_0x6208('0x71')](_0x3e93d7[_0x6208('0x4c')][_0x6208('0x88')])){throw new db[(_0x6208('0x81'))][(_0x6208('0x82'))](_0x6208('0x89'));}if(_['isNil'](_0x3e93d7[_0x6208('0x4c')][_0x6208('0x4c')])||_0x3e93d7[_0x6208('0x4c')][_0x6208('0x4c')]===''){throw new db[(_0x6208('0x81'))][(_0x6208('0x82'))](_0x6208('0x8a'));}if(_[_0x6208('0x71')](_0x3e93d7[_0x6208('0x4c')][_0x6208('0x8b')])){throw new db[(_0x6208('0x81'))][(_0x6208('0x82'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x28c2aa);}if(!_[_0x6208('0x8c')](_0x28c2aa,_0x3e93d7['body'][_0x6208('0x8b')])){throw new db[(_0x6208('0x81'))][(_0x6208('0x82'))](_0x6208('0x8d')+_0x28c2aa);}_0x4c2e38[_0x3e93d7['body']['mapKey']]=_0x3e93d7[_0x6208('0x4c')][_0x6208('0x88')];})[_0x6208('0x14')](function(){return db[_0x6208('0x2d')][_0x6208('0x51')]({'where':{'id':_0x3e93d7[_0x6208('0x47')]['id']},'include':[{'model':db[_0x6208('0x8e')],'as':_0x6208('0x8f'),'include':[{'model':db['CmContact'],'as':_0x6208('0x90'),'where':_0x4c2e38,'limit':0x1,'order':[[_0x6208('0x85'),_0x6208('0x91')]]}]},{'model':db[_0x6208('0x92')],'as':'Applications'}]});})[_0x6208('0x14')](handleEntityNotFound(_0x23c335,null))[_0x6208('0x14')](function(_0x1dcc2b){if(_0x1dcc2b&&_0x1dcc2b[_0x6208('0x8f')]){_0x23ea91[_0x6208('0x93')]=_0x1dcc2b;_0x23ea91['applications']=_0x1dcc2b['Applications'];_0x23ea91[_0x6208('0x94')]=_0x1dcc2b[_0x6208('0x8f')];_0x23ea91['applications']=_[_0x6208('0x95')](_0x23ea91['applications'],['priority'],[_0x6208('0x96')]);if(_0x23ea91['account']['Applications']){delete _0x23ea91[_0x6208('0x93')][_0x6208('0x97')];}if(_0x23ea91['account'][_0x6208('0x8f')]&&_0x23ea91[_0x6208('0x93')][_0x6208('0x8f')][_0x6208('0x90')][_0x6208('0x39')]){return _0x23ea91[_0x6208('0x93')][_0x6208('0x8f')][_0x6208('0x90')][0x0];}var _0x3c3e7d=_['defaults'](_0x3e93d7[_0x6208('0x4c')],{'firstName':_0x3e93d7['body']['from'],'ListId':_0x1dcc2b[_0x6208('0x87')]});_0x3c3e7d[_0x3e93d7['body'][_0x6208('0x8b')]]=_0x3e93d7[_0x6208('0x4c')][_0x6208('0x88')];return db[_0x6208('0x80')][_0x6208('0x4b')](_0x3c3e7d,{'fields':_0x344cda,'raw':!![]});}})[_0x6208('0x14')](handleEntityNotFound(_0x23c335,null))[_0x6208('0x14')](function(_0x3d6d2b){_0x23ea91[_0x6208('0x98')]=_0x3d6d2b;var _0x52fe1a=_0x3e93d7[_0x6208('0x4c')][_0x6208('0x99')];if(_0x3e93d7[_0x6208('0x7d')][_0x6208('0x9a')]){_0x52fe1a=_0x3e93d7[_0x6208('0x7d')][_0x6208('0x9a')];}else if(_0x3e93d7[_0x6208('0x7d')][_0x6208('0x9b')]){_0x52fe1a=_[_0x6208('0x9c')](_0x3e93d7[_0x6208('0x7d')]['x-forwarded-for'][_0x6208('0x9d')](','));}if(_0x3d6d2b){var _0x541f2d={'ContactId':_0x3d6d2b['id'],'ChatWebsiteId':_0x3e93d7['params']['id'],'from':(_0x3d6d2b[_0x6208('0x9e')]||'')+'\x20'+(_0x3d6d2b[_0x6208('0x9f')]||''),'customerIp':_0x52fe1a,'customerPort':_0x3e93d7[_0x6208('0x7d')]['x-real-port']?_0x3e93d7['headers'][_0x6208('0xa0')]:null,'referer':_0x3e93d7[_0x6208('0x4c')][_0x6208('0xa1')],'browserName':_0xa069b7['browser'][_0x6208('0x2a')]&&_0xa069b7[_0x6208('0xa2')][_0x6208('0xa3')]?util[_0x6208('0xa4')](_0x6208('0xa5'),_0xa069b7[_0x6208('0xa2')][_0x6208('0x2a')],_0xa069b7['browser'][_0x6208('0xa3')]):_0x6208('0xa6'),'browserVersion':_0xa069b7['browser'][_0x6208('0xa3')]||_0x6208('0xa6'),'osName':util[_0x6208('0xa4')](_0x6208('0xa5'),_0xa069b7['os'][_0x6208('0x2a')],_0xa069b7['os'][_0x6208('0xa3')]),'osVersion':_0xa069b7['os'][_0x6208('0xa3')],'deviceModel':_0xa069b7[_0x6208('0xa7')]['model']&&_0xa069b7[_0x6208('0xa7')][_0x6208('0xa8')]?util[_0x6208('0xa4')](_0x6208('0xa9'),_0xa069b7['device'][_0x6208('0x36')],_0xa069b7[_0x6208('0xa7')][_0x6208('0xa8')],_0xa069b7[_0x6208('0xa7')][_0x6208('0x30')]):null,'deviceVendor':_0xa069b7[_0x6208('0xa7')][_0x6208('0xa8')],'deviceType':_0xa069b7[_0x6208('0xa7')][_0x6208('0x30')],'formData':JSON['stringify'](_0x3e93d7['body'])};var _0x1f1cdb={'ChatWebsiteId':_0x3e93d7[_0x6208('0x47')]['id'],'closed':![]};if(_0x3e93d7[_0x6208('0x4c')][_0x6208('0xaa')]){_0x1f1cdb['threadId']=_0x3e93d7['body'][_0x6208('0xaa')];return db[_0x6208('0xab')][_0x6208('0x51')]({'where':_0x1f1cdb})[_0x6208('0x14')](function(_0x11fdaa){if(_0x11fdaa){return[_0x11fdaa,![]];}_0x541f2d[_0x6208('0xaa')]=_0x3e93d7[_0x6208('0x4c')][_0x6208('0xaa')];_0x541f2d[_0x6208('0xac')]=_0x3e93d7[_0x6208('0x4c')][_0x6208('0xac')];return db[_0x6208('0xab')][_0x6208('0x4b')](_0x541f2d)['then'](function(_0x3c7312){return[_0x3c7312,!![]];});});}_0x1f1cdb[_0x6208('0xad')]=_0x3d6d2b['id'];if(_0x3e93d7['body']['interaction']&&_0x3e93d7[_0x6208('0x4c')][_0x6208('0xae')]['id']){_0x1f1cdb['id']=_0x3e93d7['body'][_0x6208('0xae')]['id'];return db['ChatInteraction'][_0x6208('0x51')]({'where':_0x1f1cdb})[_0x6208('0x14')](function(_0x53093b){if(_0x53093b){return[_0x53093b,![]];}return db[_0x6208('0xab')]['create'](_0x541f2d)[_0x6208('0x14')](function(_0x8b54b0){return[_0x8b54b0,!![]];});});}return db[_0x6208('0xab')][_0x6208('0x4b')](_0x541f2d)[_0x6208('0x14')](function(_0x28ace8){return[_0x28ace8,!![]];});}})['spread'](function(_0xba556f,_0x350aaf){if(_0xba556f){_0x2ae600=_0x350aaf;if(!_0x350aaf){var _0x4d14c7={'from':(_0x23ea91['contact'][_0x6208('0x9e')]||'')+'\x20'+(_0x23ea91['contact'][_0x6208('0x9f')]||'')};if(_0x3e93d7[_0x6208('0x4c')][_0x6208('0xaa')]&&_0x3e93d7[_0x6208('0x4c')][_0x6208('0xaf')]&&_0x3e93d7[_0x6208('0x4c')][_0x6208('0xaa')]!=_0x3e93d7['body'][_0x6208('0xaf')]){_0x4d14c7[_0x6208('0xaa')]=_0x3e93d7['body'][_0x6208('0xaf')];}return _0xba556f[_0x6208('0x55')](_0x4d14c7);}else{return _0xba556f;}}})[_0x6208('0x14')](function(_0x5214c2){_0x23ea91[_0x6208('0xae')]=_0x5214c2[_0x6208('0x26')]({'plain':!![]});_0x23ea91['interaction'][_0x6208('0xb0')]=_0x2ae600;if(_0x23ea91['interaction']['created']){if(_0x23ea91[_0x6208('0x93')]['autoclose']){_0x23ea91['applications'][_0x6208('0xb1')]({'id':0x0,'priority':_0x23ea91[_0x6208('0xb2')][_0x6208('0x39')]+0x1,'app':_0x6208('0xb3'),'appdata':_0x6208('0xb4'),'interval':_0x6208('0xb5')});}}return db[_0x6208('0xb6')][_0x6208('0x4b')]({'body':_0x3e93d7['body']['body'],'ChatWebsiteId':_0x3e93d7[_0x6208('0x47')]['id'],'ChatInteractionId':_0x5214c2['id'],'direction':'in','ContactId':_0x23ea91['contact']['id'],'AttachmentId':_0x3e93d7[_0x6208('0x4c')]['AttachmentId']});})['then'](function(_0x2b4a1c){_0x23ea91['message']=_0x2b4a1c;if(_0x23ea91[_0x6208('0xae')]['UserId']){return db[_0x6208('0xb7')][_0x6208('0x51')]({'attributes':['id',_0x6208('0x2a')],'where':{'id':_0x23ea91[_0x6208('0xae')][_0x6208('0xb8')]}})[_0x6208('0x14')](function(_0x1a1576){if(_0x1a1576){_0x23ea91[_0x6208('0xb2')][_0x6208('0xb9')]({'id':0x0,'priority':0x0,'app':_0x6208('0xba'),'appdata':_0x1a1576[_0x6208('0x2a')]+','+(_0x23ea91['account'][_0x6208('0xbb')]||0xa),'interval':_0x6208('0xb5')});_0x23ea91['forcedOwnership']=!![];}return respondWithRpcPromise(_0x6208('0xbc'),_0x6208('0xbd'),_0x23ea91);});}return respondWithRpcPromise(_0x6208('0xbc'),_0x6208('0xbd'),_0x23ea91);})[_0x6208('0x14')](function(_0x40cce3){respondWithRpcPromise(_0x6208('0xbe'),_0x6208('0xbe'),{'event':_0x6208('0x7b'),'message':_0x40cce3},client9002);return _0x40cce3;})[_0x6208('0x14')](respondWithResult(_0x23c335,null))[_0x6208('0x4a')](handleError(_0x23c335,null));};exports['offline']=function(_0x4868ee,_0x4e31db){var _0x32b874,_0x4fef01,_0x1211ca;var _0x2cfb75=[];var _0x4313d4={};var _0x1c083f=_0x4868ee[_0x6208('0xbf')]||[];var _0x315e7e=[];var _0x4c32ac;return db[_0x6208('0x80')]['describe']()['then'](function(_0x387498){if(!_0x387498){throw new db[(_0x6208('0x81'))][(_0x6208('0x82'))](_0x6208('0x83'));}_0x2cfb75=_[_0x6208('0x86')](_[_0x6208('0x32')](_0x387498),[_0x6208('0x84'),_0x6208('0x85'),_0x6208('0xc0'),_0x6208('0x87')]);if(_0x4868ee['body']['id']){delete _0x4868ee[_0x6208('0x4c')]['id'];}if(_[_0x6208('0x71')](_0x4868ee[_0x6208('0x4c')][_0x6208('0x88')])){throw _0x4e31db[_0x6208('0x1e')](0x1f4)[_0x6208('0xc1')](new db['Sequelize']['ValidationError'](_0x6208('0x89')));}if(_[_0x6208('0x71')](_0x4868ee[_0x6208('0x4c')]['body'])||_0x4868ee[_0x6208('0x4c')][_0x6208('0x4c')]===''){throw _0x4e31db[_0x6208('0x1e')](0x1f4)['send'](new db[(_0x6208('0x81'))][(_0x6208('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x4868ee[_0x6208('0x4c')][_0x6208('0xc2')])){throw _0x4e31db['status'](0x1f4)[_0x6208('0xc1')](new db['Sequelize']['ValidationError'](_0x6208('0xc3')+_0x2cfb75));}if(!_['includes'](_0x2cfb75,_0x4868ee[_0x6208('0x4c')][_0x6208('0xc2')])){throw _0x4e31db[_0x6208('0x1e')](0x1f4)[_0x6208('0xc1')](new db[(_0x6208('0x81'))][(_0x6208('0x82'))](_0x6208('0xc4')+_0x2cfb75));}_0x4313d4[_0x4868ee[_0x6208('0x4c')][_0x6208('0xc2')]]=_0x4868ee[_0x6208('0x4c')]['from'];})['then'](function(){return db[_0x6208('0x2d')][_0x6208('0x51')]({'where':{'id':_0x4868ee[_0x6208('0x47')]['id']},'include':[{'model':db[_0x6208('0x8e')],'as':_0x6208('0x8f')},{'model':db[_0x6208('0xc5')],'as':_0x6208('0xc5')}]});})['then'](handleEntityNotFound(_0x4e31db,null))['then'](function(_0xd968bf){if(_0xd968bf&&_0xd968bf['List']){_0x4fef01=_0xd968bf;var _0x423145=_['defaults'](_0x4868ee[_0x6208('0x4c')],{'firstName':_0x4868ee[_0x6208('0x4c')][_0x6208('0x88')],'phone':_0x4868ee['body'][_0x6208('0x88')],'ListId':_0xd968bf[_0x6208('0x87')]});_0x423145[_0x4868ee[_0x6208('0x4c')][_0x6208('0xc2')]]=_0x4868ee[_0x6208('0x4c')][_0x6208('0x88')];return db[_0x6208('0x80')][_0x6208('0xc6')]({'where':_0x4313d4,'defaults':_0x423145});}})[_0x6208('0xc7')](function(_0x18cbe7){if(_0x18cbe7){_0x1211ca=_0x18cbe7;var _0x4a3abf=fs[_0x6208('0xc8')](path[_0x6208('0x6d')](config[_0x6208('0x73')],_0x6208('0xc9')),_0x6208('0xca'));var _0x12250e=ejs[_0x6208('0xcb')](_0x4a3abf,{'body':_[_0x6208('0xcc')](_0x4868ee['body']['body']),'bodyTitle':_0x4fef01[_0x6208('0xcd')]});return db[_0x6208('0xce')]['create']({'body':_0x12250e,'plainBody':htmlToText[_0x6208('0xcf')](_0x12250e),'ContactId':_0x18cbe7['id'],'ChatWebsiteId':_0x4fef01['id']});}})[_0x6208('0x14')](function(_0x115d51){_0x4c32ac=_0x115d51;if(_0x1c083f[_0x6208('0x39')]){var _0x1e1373=_0x1c083f['map'](function(_0x226fcc){return{'name':_0x226fcc['originalname'],'basename':_0x226fcc[_0x6208('0x64')],'type':_0x226fcc[_0x6208('0xd0')],'ChatOfflineMessageId':_0x115d51['id']};});_0x315e7e=_0x1e1373['map'](_0x17bd5c=>{var _0x5610df={'filename':_0x17bd5c[_0x6208('0x2a')],'path':path[_0x6208('0x6d')](config['root'],_0x6208('0xd1'),'files',_0x6208('0xd2'),'offline-chat',_0x17bd5c[_0x6208('0xd3')])};return _0x5610df;});if(!_0x4fef01[_0x6208('0xd4')]){return db[_0x6208('0xd5')][_0x6208('0xd6')](function(_0x4bd4e7){return db[_0x6208('0xd7')][_0x6208('0xd8')](_0x1e1373,{'transaction':_0x4bd4e7});});}}})[_0x6208('0x14')](function(){if(_0x4c32ac){_0x32b874=_0x4c32ac;return db[_0x6208('0xc5')][_0x6208('0x5a')]({'where':{'active':!![]},'include':[{'model':db[_0x6208('0xd9')],'as':_0x6208('0xda'),'raw':!![]}]});}})[_0x6208('0x14')](function(_0x4075a0){if(_0x4075a0&&_0x4075a0[_0x6208('0xda')]&&_0x4fef01[_0x6208('0xdb')]&&_0x4fef01[_0x6208('0xdc')]){var _0x50dd76={'tls':{'rejectUnauthorized':![]}};if(_0x4075a0[_0x6208('0xda')][_0x6208('0xdd')]){_0x50dd76[_0x6208('0xdd')]=_0x4075a0[_0x6208('0xda')][_0x6208('0xdd')];}else{_0x50dd76[_0x6208('0xde')]=_0x4075a0['Smtp'][_0x6208('0xde')];_0x50dd76[_0x6208('0xdf')]=_0x4075a0[_0x6208('0xda')][_0x6208('0xdf')];_0x50dd76[_0x6208('0xe0')]=_0x4075a0[_0x6208('0xda')][_0x6208('0xe0')];}if(_0x4075a0[_0x6208('0xda')][_0x6208('0xe1')]){_0x50dd76[_0x6208('0xe2')]={'user':_0x4075a0[_0x6208('0xda')][_0x6208('0x4d')],'pass':_0x4075a0['Smtp']['pass']};}return respondWithRpcPromise(_0x6208('0xe3'),'sendMail',{'account':_0x50dd76,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x4075a0['name'],_0x4075a0[_0x6208('0xe4')]||_0x4075a0[_0x6208('0xda')][_0x6208('0x4d')]),'to':_0x4fef01[_0x6208('0xdc')],'subject':_0x4fef01[_0x6208('0xe5')],'html':_0x32b874['body'],'attachments':_0x315e7e}},client9003)[_0x6208('0x14')](function(){return _0x32b874;})[_0x6208('0x4a')](function(_0x50429f){console[_0x6208('0x19')](_0x50429f);});}})[_0x6208('0x14')](function(){if(_0x4fef01&&_0x4fef01['openNewInteraction']&&_0x4fef01['MailAccountId']){var _0x20a404=[];if(_0x1c083f[_0x6208('0x39')]){_0x20a404=_0x1c083f[_0x6208('0x2c')](function(_0x29b3ad){return{'name':_0x29b3ad['originalname'],'basename':_0x29b3ad[_0x6208('0x64')],'type':_0x29b3ad[_0x6208('0xd0')],'ChatOfflineMessageId':_0x4c32ac['id']};});}var _0x5883c4;if(!_[_0x6208('0x71')](_0x4fef01['subjectOffline'])){var _0x13dd44=_[_0x6208('0x2c')](_0x4868ee[_0x6208('0x4c')],function(_0xd9d53e){return _0xd9d53e;});var _0x201bad=_[_0x6208('0xe6')](_0x13dd44)[0x0];var _0x52bc86=_[_0x6208('0xe7')](_0x201bad,function(_0x5e005b){return _0x5e005b;});_0x5883c4=_0x52bc86[0x1][_0x4fef01[_0x6208('0xe8')]];}var _0x4dfc95={'from':_0x1211ca[_0x6208('0xe4')],'firstName':_0x1211ca[_0x6208('0x9e')],'lastName':_0x1211ca[_0x6208('0x9f')],'mapKey':_0x6208('0xe4'),'message':{'from':_0x1211ca['email'],'to':_0x4fef01[_0x6208('0xc5')][_0x6208('0xe4')],'cc':'','subject':_[_0x6208('0x71')](_0x5883c4)?_0x4fef01[_0x6208('0xe5')]:_0x5883c4,'messageId':'','sentAt':new Date(),'attach':_0x20a404[_0x6208('0x39')],'attachments':_0x20a404,'originChannel':_0x6208('0xe9'),'ChatWebsiteId':_0x4fef01['id'],'ChatOfflineMessageId':_0x32b874['id'],'originTo':_0x4fef01['MailAccount'][_0x6208('0xe4')]},'body':_0x32b874['body']};var _0x40a8ae={'account':{'id':_0x4fef01[_0x6208('0xea')]},'body':_0x4dfc95,'log':_0x6208('0xeb')};return respondWithRpcPromise(_0x6208('0xeb'),'notifyMail',_0x40a8ae,client9001)[_0x6208('0x14')](function(){return _0x32b874;})[_0x6208('0x4a')](function(_0x1a1c1f){console[_0x6208('0x19')](_0x1a1c1f);});}return;})[_0x6208('0x14')](function(){if(_0x32b874){return _0x32b874;}})[_0x6208('0x14')](respondWithResult(_0x4e31db,null))[_0x6208('0x4a')](function(_0x43427d){console[_0x6208('0x19')](_0x6208('0x4a'),_0x43427d);for(var _0x4ff65f of _0x1c083f){var _0x20270e=path[_0x6208('0x6d')](config[_0x6208('0x73')],'server',_0x6208('0xbf'),_0x6208('0xd2'),_0x6208('0xec'),_0x4ff65f[_0x6208('0x64')]);fs_extra[_0x6208('0xed')](_0x20270e)['catch'](function(_0x3d14ac){console[_0x6208('0x19')](_0x6208('0xee'),_0x20270e,_0x3d14ac);});}});};exports['addInteraction']=function(_0x4a950c,_0x1e6bea){return db['ChatInteraction'][_0x6208('0x51')]({'where':{'id':_0x4a950c[_0x6208('0x47')]['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x1e6bea,null))['then'](function(_0x1e8631){if(_0x1e8631){return _0x1e8631[_0x6208('0xef')](_0x4a950c['body'][_0x6208('0x5d')],_[_0x6208('0xf0')](_0x4a950c['body'],[_0x6208('0x5d'),'id'])||{});}})[_0x6208('0x14')](respondWithResult(_0x1e6bea,null))['catch'](handleError(_0x1e6bea,null));};exports['getInteractions']=function(_0x1b2f58,_0x55e0ac){var _0x58c7d0={'raw':![],'where':{}};var _0x283b65={};var _0x558a0e={'count':0x0,'rows':[]};return db[_0x6208('0x2d')][_0x6208('0x5a')]({'where':{'id':_0x1b2f58[_0x6208('0x47')]['id']}})['then'](handleEntityNotFound(_0x55e0ac,null))['then'](function(_0x500a50){if(_0x500a50){_0x283b65[_0x6208('0x36')]=_['keys'](db['ChatInteraction'][_0x6208('0x2e')]);_0x283b65['query']=_[_0x6208('0x32')](_0x1b2f58[_0x6208('0x33')]);_0x283b65[_0x6208('0x34')]=_[_0x6208('0x35')](_0x283b65[_0x6208('0x36')],_0x283b65['query']);_0x58c7d0[_0x6208('0x37')]=_[_0x6208('0x35')](_0x283b65['model'],qs['fields'](_0x1b2f58[_0x6208('0x33')][_0x6208('0x38')]));_0x58c7d0[_0x6208('0x37')]=_0x58c7d0['attributes'][_0x6208('0x39')]?_0x58c7d0[_0x6208('0x37')]:_0x283b65[_0x6208('0x36')];if(!_0x1b2f58['query'][_0x6208('0x3a')](_0x6208('0x3b'))){_0x58c7d0[_0x6208('0x21')]=qs[_0x6208('0x21')](_0x1b2f58[_0x6208('0x33')]['limit']);_0x58c7d0[_0x6208('0x20')]=qs[_0x6208('0x20')](_0x1b2f58[_0x6208('0x33')][_0x6208('0x20')]);}_0x58c7d0['order']=qs[_0x6208('0x3d')](_0x1b2f58['query'][_0x6208('0x3d')]);_0x58c7d0[_0x6208('0x40')]=qs[_0x6208('0x34')](_[_0x6208('0x3e')](_0x1b2f58[_0x6208('0x33')],_0x283b65[_0x6208('0x34')]));_0x58c7d0['where'][_0x6208('0x58')]=_0x500a50['id'];if(_0x1b2f58[_0x6208('0x33')][_0x6208('0x3f')]){_0x58c7d0[_0x6208('0x40')]=_[_0x6208('0x49')](_0x58c7d0['where'],{'$or':_[_0x6208('0x2c')](_0x58c7d0[_0x6208('0x37')],function(_0x132317){var _0x570c9d={};_0x570c9d[_0x132317]={'$like':'%'+_0x1b2f58[_0x6208('0x33')][_0x6208('0x3f')]+'%'};return _0x570c9d;})});}_0x58c7d0=_[_0x6208('0x49')]({},_0x58c7d0,_0x1b2f58[_0x6208('0x42')]);return db['ChatInteraction']['count']({'where':_0x58c7d0[_0x6208('0x40')]})[_0x6208('0x14')](function(_0x349c6c){_0x558a0e[_0x6208('0x23')]=_0x349c6c;if(_0x1b2f58[_0x6208('0x33')][_0x6208('0x43')]){_0x58c7d0[_0x6208('0x44')]=[{'model':db['CmContact'],'as':_0x6208('0xf1'),'required':![]},{'model':db['User'],'as':_0x6208('0xf2'),'attributes':[_0x6208('0x2a'),'fullname',_0x6208('0xf3')],'required':![]},{'model':db['Tag'],'as':_0x6208('0xf4'),'attributes':['id',_0x6208('0x2a'),_0x6208('0xf5')],'where':_0x1b2f58[_0x6208('0x33')][_0x6208('0xf6')]?{'id':_0x1b2f58[_0x6208('0x33')][_0x6208('0xf6')]}:undefined,'required':_0x1b2f58[_0x6208('0x33')][_0x6208('0xf6')]?!![]:![]}];}return db[_0x6208('0xab')][_0x6208('0x5b')](_0x58c7d0);})['then'](function(_0x2d55c2){_0x558a0e[_0x6208('0x45')]=_0x2d55c2;return _0x558a0e;});}})['then'](respondWithFilteredResult(_0x55e0ac,_0x58c7d0))['catch'](handleError(_0x55e0ac,null));};function iftimePromise(_0x45f647,_0x2c23aa){return respondWithRpcPromise(_0x6208('0xf7'),'getSnippet',{'command':_0x2c23aa[_0x6208('0xf8')]?util[_0x6208('0xa4')]('iftime\x20%s,%s',_0x45f647[_0x6208('0xf9')],_0x2c23aa[_0x6208('0xf8')]):util[_0x6208('0xa4')](_0x6208('0xfa'),_0x45f647[_0x6208('0xf9')])},client9002)[_0x6208('0x14')](function(_0x58b181){var _0x47af82=_0x58b181&&_0x58b181[_0x6208('0xfb')](_0x6208('0xfc'))>=0x0?!![]:![];logger[_0x6208('0x1b')](_0x6208('0xfd'),_0x2c23aa['id'],_0x45f647['id'],_0x45f647[_0x6208('0xf9')],_0x47af82?_0x6208('0xfe'):_0x6208('0xff'),_0x2c23aa['timezone']?_0x2c23aa[_0x6208('0xf8')]:'No\x20timezone');return _0x47af82;})[_0x6208('0x4a')](function(_0x1b073d){logger[_0x6208('0x19')](_0x6208('0xfd'),_0x2c23aa['id'],_0x45f647['id'],_0x45f647[_0x6208('0xf9')],util['inspect'](_0x1b073d,{'showHidden':![],'depth':null}),_0x2c23aa['timezone']?_0x2c23aa['timezone']:_0x6208('0x100'));return![];});}exports[_0x6208('0x101')]=function(_0x15dee7,_0x2545d8){var _0x3779ad=0x0;var _0xce06f7=0x0;var _0x27b789=![];var _0xe2b683;var _0x5e1c93;return db[_0x6208('0x2d')]['find']({'where':{'id':_0x15dee7[_0x6208('0x47')]['id']},'include':[{'model':db[_0x6208('0x102')],'as':_0x6208('0x102'),'include':[{'model':db[_0x6208('0x102')],'as':_0x6208('0x103'),'attributes':['id',_0x6208('0xf9')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2545d8,null))['then'](function(_0x335938){if(_0x335938){_0xe2b683=_0x335938;return _0x335938[_0x6208('0x104')]({'raw':!![]});}})[_0x6208('0x14')](function(_0xd140aa){if(_0xe2b683){if(_0xd140aa){_0x5e1c93=_0xd140aa;}}return require('../../config/license/util')[_0x6208('0x105')]();})[_0x6208('0x14')](function(_0x21e7d6){if(_0x21e7d6){_0xce06f7=_0x21e7d6[_0x6208('0x106')];_0x27b789=_0x21e7d6[_0x6208('0x70')];}})[_0x6208('0x14')](function(){return db[_0x6208('0xab')][_0x6208('0x23')]({'where':{'closed':![]}});})[_0x6208('0x14')](function(_0x102c3d){_0x3779ad=_0x102c3d;if(_0xce06f7&&_0x102c3d>_0xce06f7){return db[_0x6208('0x107')]['findOne']({'where':{'id':0x1}})[_0x6208('0x14')](function(_0x4f4de0){if(_0x4f4de0){_0x4f4de0[_0x6208('0x108')](_0x6208('0x109'));}});}})[_0x6208('0x14')](function(){if(_0xe2b683['Interval']&&_0xe2b683['Interval'][_0x6208('0x103')]){var _0x4a8954=[];for(var _0x1da848=0x0;_0x1da848<_0xe2b683[_0x6208('0x102')][_0x6208('0x103')][_0x6208('0x39')];_0x1da848++){var _0x4e7e8f=_0xe2b683[_0x6208('0x102')][_0x6208('0x103')][_0x1da848][_0x6208('0x26')]({'plain':!![]});_0x4a8954[_0x6208('0xb1')](iftimePromise(_0x4e7e8f,_0xe2b683));}return BPromise[_0x6208('0x10a')](_0x4a8954)[_0x6208('0x14')](function(_0x323b78){return _['some'](_0x323b78);});}else{return!![];}})[_0x6208('0x14')](function(_0x2e9738){var _0x28282a=fs[_0x6208('0xc8')](path[_0x6208('0x6d')](config[_0x6208('0x73')],_0x6208('0x10b')),_0x6208('0xca'));var _0x453376={'remote':_0xe2b683[_0x6208('0x10c')],'query':querystring[_0x6208('0x18')](_[_0x6208('0x49')](_0xe2b683[_0x6208('0x26')]({'plain':!![]}),{'customerIp':_0x15dee7[_0x6208('0x7d')][_0x6208('0x9b')]||_0x15dee7['headers'][_0x6208('0x10d')]||_0x15dee7['connection'][_0x6208('0x10e')]||_0x15dee7['ip'],'referer':_0x15dee7[_0x6208('0x7d')][_0x6208('0xa1')],'openedInteractions':_0x3779ad,'maxInteractions':_0xce06f7,'virtual':_0x27b789['virtual'],'online':_0x2e9738,'custom':_0x27b789}))['replace'](/'/g,'\x5c\x27')};_0x2545d8[_0x6208('0xc1')](ejs[_0x6208('0xcb')](Mustache[_0x6208('0xcb')](_0x28282a,_0x453376),{'proactiveActions':_0x5e1c93,'alignment':_0xe2b683[_0x6208('0x10f')],'verticalAlignment':_0xe2b683[_0x6208('0x110')],'div_color':_0xe2b683[_0x6208('0xf5')],'labelText':_0xe2b683[_0x6208('0x111')],'text_color':_0xe2b683['textColor'],'button_color':_0xe2b683[_0x6208('0x112')],'background_color':_0xe2b683[_0x6208('0x113')],'hideWhenOffline':_0xe2b683[_0x6208('0x114')],'interval':_0xe2b683[_0x6208('0x115')]}));})['catch'](handleError(_0x2545d8,null));};exports[_0x6208('0x116')]=function(_0x460fd0,_0x5a725){var _0x4b32e4=_0x460fd0[_0x6208('0x47')]['id'];var _0x5b9ebf=_0x460fd0[_0x6208('0x4c')];var _0x3e1dbc=0xc8;var _0xd225e9=null;return db[_0x6208('0xd5')][_0x6208('0xd6')]({'isolationLevel':db[_0x6208('0xd5')][_0x6208('0x117')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x408339){return db[_0x6208('0x2d')][_0x6208('0x5a')]({'where':{'id':_0x4b32e4},'transaction':_0x408339})[_0x6208('0x14')](function(_0x34956d){if(_0x34956d){return db[_0x6208('0x92')]['destroy']({'where':{'ChatWebsiteId':_0x4b32e4},'transaction':_0x408339})[_0x6208('0x14')](function(){var _0x2a6467=_[_0x6208('0x2c')](_0x5b9ebf,function(_0x3e4d01){_0x3e4d01[_0x6208('0x58')]=_0x4b32e4;return _0x3e4d01;});return db['ChatApplication']['bulkCreate'](_0x2a6467,{'transaction':_0x408339});});}else{_0x3e1dbc=0x194;_0xd225e9=[];}});})[_0x6208('0x14')](function(){if(_0x3e1dbc!==0x194){return db[_0x6208('0x92')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4b32e4},'order':_0x6208('0x118')})[_0x6208('0x14')](function(_0x4b8c61){_0xd225e9=_0x4b8c61;});}})[_0x6208('0x4a')](function(_0x2be054){_0x3e1dbc=0x1f4;logger[_0x6208('0x19')](_0x2be054[_0x6208('0x29')]);if(_0x2be054[_0x6208('0x2a')]){delete _0x2be054['name'];}_0xd225e9=_0x2be054;})[_0x6208('0x119')](function(){if(_0xd225e9===null){_0x5a725['sendStatus'](_0x3e1dbc);}else{if(_0x3e1dbc===0x1f4){_0x5a725[_0x6208('0x1e')](_0x3e1dbc)[_0x6208('0xc1')](_0xd225e9);}else{_0x5a725[_0x6208('0x1e')](_0x3e1dbc)['json'](_0xd225e9);}}});};exports[_0x6208('0x11a')]=function(_0x4a53ef,_0x1537a0){var _0xbd1d5c={};var _0x336a3b={};var _0x5c31f7;var _0x5db5f7;return db[_0x6208('0x2d')][_0x6208('0x5a')]({'where':{'id':_0x4a53ef['params']['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x1537a0,null))[_0x6208('0x14')](function(_0x8e4554){if(_0x8e4554){_0x5c31f7=_0x8e4554;_0x336a3b[_0x6208('0x36')]=_[_0x6208('0x32')](db[_0x6208('0x92')]['rawAttributes']);_0x336a3b[_0x6208('0x33')]=_[_0x6208('0x32')](_0x4a53ef[_0x6208('0x33')]);_0x336a3b[_0x6208('0x34')]=_[_0x6208('0x35')](_0x336a3b['model'],_0x336a3b['query']);_0xbd1d5c[_0x6208('0x37')]=_[_0x6208('0x35')](_0x336a3b[_0x6208('0x36')],qs[_0x6208('0x38')](_0x4a53ef[_0x6208('0x33')][_0x6208('0x38')]));_0xbd1d5c[_0x6208('0x37')]=_0xbd1d5c[_0x6208('0x37')]['length']?_0xbd1d5c[_0x6208('0x37')]:_0x336a3b[_0x6208('0x36')];_0xbd1d5c[_0x6208('0x3c')]=qs[_0x6208('0x3d')](_0x4a53ef[_0x6208('0x33')][_0x6208('0x3d')]);_0xbd1d5c[_0x6208('0x40')]=qs[_0x6208('0x34')](_[_0x6208('0x3e')](_0x4a53ef['query'],_0x336a3b[_0x6208('0x34')]));if(_0x4a53ef['query']['filter']){_0xbd1d5c[_0x6208('0x40')]=_[_0x6208('0x49')](_0xbd1d5c[_0x6208('0x40')],{'$or':_[_0x6208('0x2c')](_0xbd1d5c[_0x6208('0x37')],function(_0x216d07){var _0x7605b7={};_0x7605b7[_0x216d07]={'$like':'%'+_0x4a53ef['query'][_0x6208('0x3f')]+'%'};return _0x7605b7;})});}_0xbd1d5c=_[_0x6208('0x49')]({},_0xbd1d5c,_0x4a53ef['options']);return _0x5c31f7[_0x6208('0x11a')](_0xbd1d5c);}})['then'](function(_0x592e5b){if(_0x592e5b){_0x5db5f7=_0x592e5b[_0x6208('0x39')];if(!_0x4a53ef[_0x6208('0x33')]['hasOwnProperty'](_0x6208('0x3b'))){_0xbd1d5c['limit']=qs[_0x6208('0x21')](_0x4a53ef[_0x6208('0x33')]['limit']);_0xbd1d5c[_0x6208('0x20')]=qs[_0x6208('0x20')](_0x4a53ef[_0x6208('0x33')][_0x6208('0x20')]);}return _0x5c31f7['getApplications'](_0xbd1d5c);}})[_0x6208('0x14')](function(_0x4dba65){if(_0x4dba65){return _0x4dba65?{'count':_0x5db5f7,'rows':_0x4dba65}:null;}})[_0x6208('0x14')](respondWithResult(_0x1537a0,null))[_0x6208('0x4a')](handleError(_0x1537a0,null));};exports[_0x6208('0x11b')]=function(_0x8a408c,_0x377bb1){return db[_0x6208('0x11c')][_0x6208('0x51')]({'where':{'id':_0x8a408c[_0x6208('0x47')]['id']}})['then'](handleEntityNotFound(_0x377bb1,null))['then'](function(_0x5a3376){if(_0x5a3376){return _0x5a3376[_0x6208('0x11b')](_0x8a408c[_0x6208('0x4c')]['ids'],_['omit'](_0x8a408c['body'],['ids','id'])||{});}})[_0x6208('0x14')](respondWithResult(_0x377bb1,null))['catch'](handleError(_0x377bb1,null));};exports[_0x6208('0x104')]=function(_0x5e89d8,_0x366c0d){var _0x525ca6={};var _0x44dd57={};var _0x12961e;var _0x5bfb23;return db[_0x6208('0x2d')][_0x6208('0x5a')]({'where':{'id':_0x5e89d8['params']['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x366c0d,null))[_0x6208('0x14')](function(_0xa02db3){if(_0xa02db3){_0x12961e=_0xa02db3;_0x44dd57['model']=_[_0x6208('0x32')](db[_0x6208('0x11d')][_0x6208('0x2e')]);_0x44dd57['query']=_['keys'](_0x5e89d8[_0x6208('0x33')]);_0x44dd57[_0x6208('0x34')]=_[_0x6208('0x35')](_0x44dd57[_0x6208('0x36')],_0x44dd57[_0x6208('0x33')]);_0x525ca6[_0x6208('0x37')]=_[_0x6208('0x35')](_0x44dd57['model'],qs['fields'](_0x5e89d8[_0x6208('0x33')][_0x6208('0x38')]));_0x525ca6['attributes']=_0x525ca6[_0x6208('0x37')][_0x6208('0x39')]?_0x525ca6['attributes']:_0x44dd57[_0x6208('0x36')];_0x525ca6[_0x6208('0x3c')]=qs[_0x6208('0x3d')](_0x5e89d8[_0x6208('0x33')][_0x6208('0x3d')]);_0x525ca6[_0x6208('0x40')]=qs[_0x6208('0x34')](_[_0x6208('0x3e')](_0x5e89d8[_0x6208('0x33')],_0x44dd57[_0x6208('0x34')]));if(_0x5e89d8[_0x6208('0x33')]['filter']){_0x525ca6[_0x6208('0x40')]=_[_0x6208('0x49')](_0x525ca6[_0x6208('0x40')],{'$or':_[_0x6208('0x2c')](_0x525ca6[_0x6208('0x37')],function(_0x4888dd){var _0x160119={};_0x160119[_0x4888dd]={'$like':'%'+_0x5e89d8[_0x6208('0x33')][_0x6208('0x3f')]+'%'};return _0x160119;})});}_0x525ca6=_[_0x6208('0x49')]({},_0x525ca6,_0x5e89d8[_0x6208('0x42')]);return _0x12961e[_0x6208('0x104')](_0x525ca6);}})[_0x6208('0x14')](function(_0x1f7ca3){if(_0x1f7ca3){_0x5bfb23=_0x1f7ca3['length'];if(!_0x5e89d8[_0x6208('0x33')]['hasOwnProperty']('nolimit')){_0x525ca6['limit']=qs['limit'](_0x5e89d8[_0x6208('0x33')]['limit']);_0x525ca6[_0x6208('0x20')]=qs[_0x6208('0x20')](_0x5e89d8[_0x6208('0x33')]['offset']);}return _0x12961e[_0x6208('0x104')](_0x525ca6);}})['then'](function(_0x4b811d){if(_0x4b811d){return _0x4b811d?{'count':_0x5bfb23,'rows':_0x4b811d}:null;}})[_0x6208('0x14')](respondWithResult(_0x366c0d,null))[_0x6208('0x4a')](handleError(_0x366c0d,null));};exports['getFields']=function(_0x252dbc,_0x2c9110){var _0x381ed0=_0x252dbc[_0x6208('0x33')]['online']===_0x6208('0x11e')?_0x6208('0x11f'):'onlineForm';return db[_0x6208('0x2d')][_0x6208('0x51')]({'attributes':['id',_0x381ed0],'where':{'id':_0x252dbc[_0x6208('0x47')]['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x2c9110,null))[_0x6208('0x14')](function(_0x493ad8){if(_0x493ad8){var _0x37c117=_0x493ad8[_0x381ed0];var _0x246bd9=_0x37c117&&_0x37c117['items']?_0x37c117['items']:[];_0x2c9110[_0x6208('0xc1')]({'fromKey':_[_0x6208('0x71')](_0x37c117[_0x6208('0x120')])?undefined:_0x37c117[_0x6208('0x120')],'count':_0x246bd9[_0x6208('0x39')],'rows':_0x246bd9});}})['catch'](handleError(_0x2c9110,null));};exports[_0x6208('0x121')]=function(_0x8a088b,_0x3c80c3){var _0xa61de3={'raw':![],'where':{}};var _0x71fa4d={};var _0x20f96a={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x8a088b['params']['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x3c80c3,null))[_0x6208('0x14')](function(_0x17d9d6){if(_0x17d9d6){_0x71fa4d['model']=_[_0x6208('0x32')](db[_0x6208('0xce')][_0x6208('0x2e')]);_0x71fa4d['query']=_[_0x6208('0x32')](_0x8a088b['query']);_0x71fa4d[_0x6208('0x34')]=_[_0x6208('0x35')](_0x71fa4d[_0x6208('0x36')],_0x71fa4d[_0x6208('0x33')]);_0xa61de3[_0x6208('0x37')]=_[_0x6208('0x35')](_0x71fa4d[_0x6208('0x36')],qs[_0x6208('0x38')](_0x8a088b[_0x6208('0x33')]['fields']));_0xa61de3['attributes']=_0xa61de3[_0x6208('0x37')][_0x6208('0x39')]?_0xa61de3['attributes']:_0x71fa4d[_0x6208('0x36')];if(!_0x8a088b[_0x6208('0x33')][_0x6208('0x3a')](_0x6208('0x3b'))){_0xa61de3[_0x6208('0x21')]=qs[_0x6208('0x21')](_0x8a088b[_0x6208('0x33')][_0x6208('0x21')]);_0xa61de3[_0x6208('0x20')]=qs['offset'](_0x8a088b[_0x6208('0x33')][_0x6208('0x20')]);}_0xa61de3['order']=qs[_0x6208('0x3d')](_0x8a088b[_0x6208('0x33')][_0x6208('0x3d')]);_0xa61de3[_0x6208('0x40')]=qs[_0x6208('0x34')](_['pick'](_0x8a088b[_0x6208('0x33')],_0x71fa4d[_0x6208('0x34')]));_0xa61de3['where'][_0x6208('0x58')]=_0x17d9d6['id'];if(_0x8a088b[_0x6208('0x33')][_0x6208('0x3f')]){_0xa61de3[_0x6208('0x40')]=_[_0x6208('0x49')](_0xa61de3[_0x6208('0x40')],{'$or':_[_0x6208('0x2c')](_0xa61de3['attributes'],function(_0x152b5b){var _0x29d364={};_0x29d364[_0x152b5b]={'$like':'%'+_0x8a088b[_0x6208('0x33')][_0x6208('0x3f')]+'%'};return _0x29d364;})});}_0xa61de3=_['merge']({},_0xa61de3,_0x8a088b[_0x6208('0x42')]);return db[_0x6208('0xce')][_0x6208('0x23')]({'where':_0xa61de3[_0x6208('0x40')]})[_0x6208('0x14')](function(_0x3d64fc){_0x20f96a[_0x6208('0x23')]=_0x3d64fc;if(_0x8a088b[_0x6208('0x33')][_0x6208('0x43')]){_0xa61de3[_0x6208('0x44')]=[{'all':!![]}];}else{_0xa61de3[_0x6208('0x44')]=[{'model':db[_0x6208('0x80')],'as':_0x6208('0xf1'),'required':![]},{'model':db['Attachment'],'as':_0x6208('0x122'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0xa61de3);})[_0x6208('0x14')](function(_0x2f89a1){_0x20f96a[_0x6208('0x45')]=_0x2f89a1;return _0x20f96a;});}})[_0x6208('0x14')](respondWithFilteredResult(_0x3c80c3,_0xa61de3))[_0x6208('0x4a')](handleError(_0x3c80c3,null));};exports[_0x6208('0x123')]=function(_0x1bfcd1,_0x3757d7){return db[_0x6208('0x2d')][_0x6208('0x51')]({'where':{'id':_0x1bfcd1[_0x6208('0x47')]['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x3757d7,null))[_0x6208('0x14')](function(_0x2a64f0){if(_0x2a64f0){return _0x2a64f0[_0x6208('0x123')](_0x1bfcd1[_0x6208('0x4c')]['ids'],_[_0x6208('0xf0')](_0x1bfcd1['body'],[_0x6208('0x5d'),'id'])||{})[_0x6208('0xc7')](function(_0x4bba6f){for(var _0x3ce960=0x0;_0x3ce960<_0x1bfcd1[_0x6208('0x4c')][_0x6208('0x5d')][_0x6208('0x39')];_0x3ce960+=0x1){socket['emit'](_0x6208('0x124'),{'UserId':Number(_0x1bfcd1[_0x6208('0x4c')][_0x6208('0x5d')][_0x3ce960]),'ChatWebsiteId':Number(_0x1bfcd1[_0x6208('0x47')]['id'])});}return _0x4bba6f;});}})[_0x6208('0x14')](respondWithResult(_0x3757d7,null))[_0x6208('0x4a')](handleError(_0x3757d7,null));};exports[_0x6208('0x125')]=function(_0x9480b,_0x698aaf){return db[_0x6208('0x2d')][_0x6208('0x51')]({'where':{'id':_0x9480b['params']['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x698aaf,null))['then'](function(_0x161500){if(_0x161500){return _0x161500[_0x6208('0x125')](_0x9480b[_0x6208('0x33')][_0x6208('0x5d')])[_0x6208('0x14')](function(){if(_[_0x6208('0x126')](_0x9480b[_0x6208('0x33')][_0x6208('0x5d')])){for(var _0x4b777=0x0;_0x4b777<_0x9480b[_0x6208('0x33')][_0x6208('0x5d')]['length'];_0x4b777+=0x1){socket['emit'](_0x6208('0x127'),{'UserId':Number(_0x9480b[_0x6208('0x33')]['ids'][_0x4b777]),'ChatWebsiteId':Number(_0x9480b['params']['id'])});}}else{socket[_0x6208('0x128')]('userChatWebsite:remove',{'UserId':Number(_0x9480b[_0x6208('0x33')][_0x6208('0x5d')]),'ChatWebsiteId':Number(_0x9480b[_0x6208('0x47')]['id'])});}});}})[_0x6208('0x14')](respondWithStatusCode(_0x698aaf,null))['catch'](handleError(_0x698aaf,null));};exports[_0x6208('0x129')]=function(_0x54d85d,_0x5ad5c){var _0x243b35={};var _0x3a4526={};var _0x286633;var _0x25e75b;return db[_0x6208('0x2d')][_0x6208('0x5a')]({'where':{'id':_0x54d85d['params']['id']}})[_0x6208('0x14')](handleEntityNotFound(_0x5ad5c,null))[_0x6208('0x14')](function(_0x27cbfd){if(_0x27cbfd){_0x286633=_0x27cbfd;_0x3a4526[_0x6208('0x36')]=_[_0x6208('0x32')](db[_0x6208('0xb7')][_0x6208('0x2e')]);_0x3a4526[_0x6208('0x33')]=_[_0x6208('0x32')](_0x54d85d[_0x6208('0x33')]);_0x3a4526[_0x6208('0x34')]=_[_0x6208('0x35')](_0x3a4526[_0x6208('0x36')],_0x3a4526[_0x6208('0x33')]);_0x243b35[_0x6208('0x37')]=_[_0x6208('0x35')](_0x3a4526[_0x6208('0x36')],qs[_0x6208('0x38')](_0x54d85d['query'][_0x6208('0x38')]));_0x243b35[_0x6208('0x37')]=_0x243b35['attributes']['length']?_0x243b35[_0x6208('0x37')]:_0x3a4526[_0x6208('0x36')];_0x243b35['order']=qs['sort'](_0x54d85d['query'][_0x6208('0x3d')]);_0x243b35[_0x6208('0x40')]=qs['filters'](_[_0x6208('0x3e')](_0x54d85d[_0x6208('0x33')],_0x3a4526[_0x6208('0x34')]));if(_0x54d85d['query'][_0x6208('0x3f')]){_0x243b35[_0x6208('0x40')]=_[_0x6208('0x49')](_0x243b35['where'],{'$or':_[_0x6208('0x2c')](_0x243b35[_0x6208('0x37')],function(_0x216eb0){var _0x151569={};_0x151569[_0x216eb0]={'$like':'%'+_0x54d85d['query'][_0x6208('0x3f')]+'%'};return _0x151569;})});}_0x243b35=_['merge']({},_0x243b35,_0x54d85d['options']);return _0x286633['getAgents'](_0x243b35);}})[_0x6208('0x14')](function(_0x288c7c){if(_0x288c7c){_0x25e75b=_0x288c7c[_0x6208('0x39')];if(!_0x54d85d[_0x6208('0x33')][_0x6208('0x3a')]('nolimit')){_0x243b35[_0x6208('0x21')]=qs[_0x6208('0x21')](_0x54d85d[_0x6208('0x33')][_0x6208('0x21')]);_0x243b35[_0x6208('0x20')]=qs[_0x6208('0x20')](_0x54d85d[_0x6208('0x33')][_0x6208('0x20')]);}return _0x286633[_0x6208('0x129')](_0x243b35);}})[_0x6208('0x14')](function(_0x464057){if(_0x464057){return _0x464057?{'count':_0x25e75b,'rows':_0x464057}:null;}})['then'](respondWithResult(_0x5ad5c,null))['catch'](handleError(_0x5ad5c,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index bc08086..9001b54 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 _0x8a8b=['events','setMaxListeners','save','remove','emit','hook'];(function(_0x2dbbeb,_0x54465d){var _0x3c26a1=function(_0x970a64){while(--_0x970a64){_0x2dbbeb['push'](_0x2dbbeb['shift']());}};_0x3c26a1(++_0x54465d);}(_0x8a8b,0xae));var _0xb8a8=function(_0x31e8e5,_0x2dded1){_0x31e8e5=_0x31e8e5-0x0;var _0x48bf2d=_0x8a8b[_0x31e8e5];return _0x48bf2d;};'use strict';var EventEmitter=require(_0xb8a8('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb8a8('0x1')](0x0);var events={'afterCreate':_0xb8a8('0x2'),'afterUpdate':'update','afterDestroy':_0xb8a8('0x3')};function emitEvent(_0x5710bc){return function(_0xca9854,_0x4fe301,_0x4043fd){ChatWebsiteEvents[_0xb8a8('0x4')](_0x5710bc+':'+_0xca9854['id'],_0xca9854);ChatWebsiteEvents[_0xb8a8('0x4')](_0x5710bc,_0xca9854);_0x4043fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xb8a8('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x308a=['hook','events','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x32be52,_0x498982){var _0x3704a0=function(_0x351f28){while(--_0x351f28){_0x32be52['push'](_0x32be52['shift']());}};_0x3704a0(++_0x498982);}(_0x308a,0x71));var _0xa308=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x308a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xa308('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xa308('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa308('0x2')](0x0);var events={'afterCreate':_0xa308('0x3'),'afterUpdate':_0xa308('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5320e6){return function(_0x3a294d,_0x99d71a,_0x37035d){ChatWebsiteEvents[_0xa308('0x5')](_0x5320e6+':'+_0x3a294d['id'],_0x3a294d);ChatWebsiteEvents[_0xa308('0x5')](_0x5320e6,_0x3a294d);_0x37035d(null);};}for(var e in events){if(events[_0xa308('0x6')](e)){var event=events[e];ChatWebsite[_0xa308('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index a312cfa..e596c8c 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 _0x6879=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','chat_websites'];(function(_0x478f5a,_0x272c62){var _0x4e15d7=function(_0x157556){while(--_0x157556){_0x478f5a['push'](_0x478f5a['shift']());}};_0x4e15d7(++_0x272c62);}(_0x6879,0xdc));var _0x9687=function(_0x2a80d1,_0x5b36b7){_0x2a80d1=_0x2a80d1-0x0;var _0xfab5d8=_0x6879[_0x2a80d1];return _0xfab5d8;};'use strict';var _=require(_0x9687('0x0'));var util=require(_0x9687('0x1'));var logger=require(_0x9687('0x2'))(_0x9687('0x3'));var moment=require('moment');var BPromise=require(_0x9687('0x4'));var rp=require(_0x9687('0x5'));var fs=require('fs');var path=require(_0x9687('0x6'));var rimraf=require(_0x9687('0x7'));var config=require(_0x9687('0x8'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0xbe6c1f,_0x176fdc){return _0xbe6c1f[_0x9687('0x9')]('ChatWebsite',attributes,{'tableName':_0x9687('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc1a=['../../config/logger','api','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util'];(function(_0xc8cb25,_0x4468d2){var _0x3bb6cc=function(_0x57dad3){while(--_0x57dad3){_0xc8cb25['push'](_0xc8cb25['shift']());}};_0x3bb6cc(++_0x4468d2);}(_0xcc1a,0xda));var _0xacc1=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0xcc1a[_0x538c70];return _0x42ae01;};'use strict';var _=require(_0xacc1('0x0'));var util=require(_0xacc1('0x1'));var logger=require(_0xacc1('0x2'))(_0xacc1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xacc1('0x4'));var rimraf=require('rimraf');var config=require(_0xacc1('0x5'));var attributes=require(_0xacc1('0x6'));module[_0xacc1('0x7')]=function(_0x310eeb,_0x5eb12e){return _0x310eeb[_0xacc1('0x8')](_0xacc1('0x9'),attributes,{'tableName':_0xacc1('0xa'),'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 7f3cd51..50f4199 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 _0x5ad3=['info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','register','request','then'];(function(_0x1edec6,_0x25764b){var _0x2dc747=function(_0xb49fed){while(--_0xb49fed){_0x1edec6['push'](_0x1edec6['shift']());}};_0x2dc747(++_0x25764b);}(_0x5ad3,0xca));var _0x35ad=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0x5ad3[_0x4ba380];return _0x4b111b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x35ad('0x0'));var BPromise=require(_0x35ad('0x1'));var rs=require(_0x35ad('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x35ad('0x3'))(_0x35ad('0x4'));var config=require(_0x35ad('0x5'));var jayson=require(_0x35ad('0x6'));var client=jayson[_0x35ad('0x7')]['http']({'port':0x232a});config['redis']=_[_0x35ad('0x8')](config[_0x35ad('0x9')],{'host':_0x35ad('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x35ad('0xb')](socket);function respondWithRpcPromise(_0x25415e,_0x34bc06,_0x379132){return new BPromise(function(_0x68fbcc,_0x2dff8e){return client[_0x35ad('0xc')](_0x25415e,_0x379132)[_0x35ad('0xd')](function(_0x137574){logger[_0x35ad('0xe')](_0x35ad('0xf'),_0x34bc06,'request\x20sent');logger[_0x35ad('0x10')](_0x35ad('0x11'),_0x34bc06,_0x35ad('0x12'),JSON[_0x35ad('0x13')](_0x137574));if(_0x137574[_0x35ad('0x14')]){if(_0x137574[_0x35ad('0x14')]['code']===0x1f4){logger['error'](_0x35ad('0xf'),_0x34bc06,_0x137574[_0x35ad('0x14')]['message']);return _0x2dff8e(_0x137574[_0x35ad('0x14')][_0x35ad('0x15')]);}logger[_0x35ad('0x14')](_0x35ad('0xf'),_0x34bc06,_0x137574['error'][_0x35ad('0x15')]);return _0x68fbcc(_0x137574[_0x35ad('0x14')]['message']);}else{logger[_0x35ad('0xe')](_0x35ad('0xf'),_0x34bc06,_0x35ad('0x12'));_0x68fbcc(_0x137574[_0x35ad('0x16')][_0x35ad('0x15')]);}})[_0x35ad('0x17')](function(_0x1050d4){logger[_0x35ad('0x14')](_0x35ad('0xf'),_0x34bc06,_0x1050d4);_0x2dff8e(_0x1050d4);});});} \ No newline at end of file +var _0x1eab=['ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','debug'];(function(_0x3accaa,_0x402e0d){var _0x550206=function(_0x1b11f1){while(--_0x1b11f1){_0x3accaa['push'](_0x3accaa['shift']());}};_0x550206(++_0x402e0d);}(_0x1eab,0x161));var _0xb1ea=function(_0x1e423a,_0x5719b2){_0x1e423a=_0x1e423a-0x0;var _0x2ca2e5=_0x1eab[_0x1e423a];return _0x2ca2e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb1ea('0x0'));var BPromise=require(_0xb1ea('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1ea('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb1ea('0x3'));var logger=require(_0xb1ea('0x4'))('rpc');var config=require(_0xb1ea('0x5'));var jayson=require(_0xb1ea('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xb1ea('0x7')]=_['defaults'](config['redis'],{'host':_0xb1ea('0x8'),'port':0x18eb});var socket=require(_0xb1ea('0x9'))(new Redis(config['redis']));require(_0xb1ea('0xa'))[_0xb1ea('0xb')](socket);function respondWithRpcPromise(_0x2bb9f3,_0x1b0402,_0x360897){return new BPromise(function(_0x1457fe,_0x3a6f29){return client[_0xb1ea('0xc')](_0x2bb9f3,_0x360897)['then'](function(_0x1c63f5){logger[_0xb1ea('0xd')]('ChatWebsite,\x20%s,\x20%s',_0x1b0402,'request\x20sent');logger[_0xb1ea('0xe')](_0xb1ea('0xf'),_0x1b0402,_0xb1ea('0x10'),JSON['stringify'](_0x1c63f5));if(_0x1c63f5[_0xb1ea('0x11')]){if(_0x1c63f5[_0xb1ea('0x11')][_0xb1ea('0x12')]===0x1f4){logger['error'](_0xb1ea('0x13'),_0x1b0402,_0x1c63f5[_0xb1ea('0x11')]['message']);return _0x3a6f29(_0x1c63f5[_0xb1ea('0x11')][_0xb1ea('0x14')]);}logger['error'](_0xb1ea('0x13'),_0x1b0402,_0x1c63f5[_0xb1ea('0x11')][_0xb1ea('0x14')]);return _0x1457fe(_0x1c63f5[_0xb1ea('0x11')][_0xb1ea('0x14')]);}else{logger[_0xb1ea('0xd')](_0xb1ea('0x13'),_0x1b0402,_0xb1ea('0x10'));_0x1457fe(_0x1c63f5[_0xb1ea('0x15')][_0xb1ea('0x14')]);}})[_0xb1ea('0x16')](function(_0x3d974f){logger[_0xb1ea('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x1b0402,_0x3d974f);_0x3a6f29(_0x3d974f);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index c629518..3ca4293 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 _0xa6b9=['save','remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x4dd4a6,_0x5add5b){var _0x1abb6d=function(_0x523801){while(--_0x523801){_0x4dd4a6['push'](_0x4dd4a6['shift']());}};_0x1abb6d(++_0x5add5b);}(_0xa6b9,0x74));var _0x9a6b=function(_0x2760c9,_0x1ba5a7){_0x2760c9=_0x2760c9-0x0;var _0x10dd54=_0xa6b9[_0x2760c9];return _0x10dd54;};'use strict';var ChatWebsiteEvents=require(_0x9a6b('0x0'));var events=[_0x9a6b('0x1'),_0x9a6b('0x2'),_0x9a6b('0x3')];function createListener(_0x32f11e,_0x324e72){return function(_0x453d6c){_0x324e72[_0x9a6b('0x4')](_0x32f11e,_0x453d6c);};}function removeListener(_0x1c5492,_0x4d0708){return function(){ChatWebsiteEvents[_0x9a6b('0x5')](_0x1c5492,_0x4d0708);};}exports[_0x9a6b('0x6')]=function(_0x5a3598){for(var _0x5ec50e=0x0,_0x46bd57=events[_0x9a6b('0x7')];_0x5ec50e<_0x46bd57;_0x5ec50e++){var _0xf4b745=events[_0x5ec50e];var _0x2736e4=createListener(_0x9a6b('0x8')+_0xf4b745,_0x5a3598);ChatWebsiteEvents['on'](_0xf4b745,_0x2736e4);}}; \ No newline at end of file +var _0x8c46=['./chatWebsite.events','save','remove','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x20d55d,_0x57bfba){var _0x390647=function(_0x15207b){while(--_0x15207b){_0x20d55d['push'](_0x20d55d['shift']());}};_0x390647(++_0x57bfba);}(_0x8c46,0x75));var _0x68c4=function(_0x341ae6,_0x3b6623){_0x341ae6=_0x341ae6-0x0;var _0x137f15=_0x8c46[_0x341ae6];return _0x137f15;};'use strict';var ChatWebsiteEvents=require(_0x68c4('0x0'));var events=[_0x68c4('0x1'),_0x68c4('0x2'),_0x68c4('0x3')];function createListener(_0x5a5e95,_0x1d4fde){return function(_0x10f0aa){_0x1d4fde[_0x68c4('0x4')](_0x5a5e95,_0x10f0aa);};}function removeListener(_0x428454,_0x2dc100){return function(){ChatWebsiteEvents[_0x68c4('0x5')](_0x428454,_0x2dc100);};}exports[_0x68c4('0x6')]=function(_0x15ba92){for(var _0x252481=0x0,_0x4bf177=events[_0x68c4('0x7')];_0x252481<_0x4bf177;_0x252481++){var _0x285500=events[_0x252481];var _0x4dfe4=createListener(_0x68c4('0x8')+_0x285500,_0x15ba92);ChatWebsiteEvents['on'](_0x285500,_0x4dfe4);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 56aa397..35e708b 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 _0x4ad9=['extname','/:id/offline','any','offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','/:id/users','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./chatWebsite.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','post','addDisposition','/:id/canned_answers','diskStorage','join','format','%s-%s','now','originalname','single','file','root','server/files/images/avatars/','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','replace'];(function(_0x2844fb,_0x2e995b){var _0x494b00=function(_0xac1bf9){while(--_0xac1bf9){_0x2844fb['push'](_0x2844fb['shift']());}};_0x494b00(++_0x2e995b);}(_0x4ad9,0x9b));var _0x94ad=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4ad9[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x94ad('0x0'));var util=require('util');var path=require(_0x94ad('0x1'));var timeout=require(_0x94ad('0x2'));var express=require('express');var router=express[_0x94ad('0x3')]();var fs_extra=require(_0x94ad('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x94ad('0x5'));var controller=require(_0x94ad('0x6'));router['get']('/',auth[_0x94ad('0x7')](),controller[_0x94ad('0x8')]);router['get'](_0x94ad('0x9'),auth[_0x94ad('0x7')](),controller[_0x94ad('0xa')]);router[_0x94ad('0xb')](_0x94ad('0xc'),auth[_0x94ad('0x7')](),controller[_0x94ad('0xd')]);router['get'](_0x94ad('0xe'),auth[_0x94ad('0x7')](),controller[_0x94ad('0xf')]);router[_0x94ad('0xb')]('/:id/canned_answers',auth[_0x94ad('0x7')](),controller[_0x94ad('0x10')]);router[_0x94ad('0xb')](_0x94ad('0x11'),controller[_0x94ad('0x12')]);router[_0x94ad('0xb')](_0x94ad('0x13'),controller[_0x94ad('0x14')]);router[_0x94ad('0xb')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x94ad('0xb')](_0x94ad('0x15'),controller[_0x94ad('0x16')]);router[_0x94ad('0xb')](_0x94ad('0x17'),auth['isAuthenticated'](),controller['getInteractions']);router['get']('/:id/snippet',controller[_0x94ad('0x18')]);router['get'](_0x94ad('0x19'),auth[_0x94ad('0x7')](),controller[_0x94ad('0x1a')]);router[_0x94ad('0xb')](_0x94ad('0x1b'),auth[_0x94ad('0x7')](),controller[_0x94ad('0x1c')]);router['get'](_0x94ad('0x1d'),controller[_0x94ad('0x1e')]);router[_0x94ad('0xb')]('/:id/offline_messages',auth[_0x94ad('0x7')](),controller[_0x94ad('0x1f')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x94ad('0x20')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x94ad('0x21')](_0x94ad('0xe'),auth['isAuthenticated'](),controller[_0x94ad('0x22')]);router[_0x94ad('0x21')](_0x94ad('0x23'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x94ad('0x24')]({'destination':function(_0x3958c3,_0x258d04,_0x137d69){_0x137d69(null,path[_0x94ad('0x25')](config['root'],'server/files/images/logos/'));},'filename':function(_0x255663,_0xa953dd,_0x43bf70){_0x43bf70(null,util[_0x94ad('0x26')](_0x94ad('0x27'),Date[_0x94ad('0x28')](),_0xa953dd[_0x94ad('0x29')]));}})});router[_0x94ad('0x21')](_0x94ad('0x11'),upload[_0x94ad('0x2a')](_0x94ad('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0x94ad('0x24')]({'destination':function(_0x1a9147,_0x480b01,_0xf47fe8){_0xf47fe8(null,path['join'](config[_0x94ad('0x2c')],_0x94ad('0x2d')));},'filename':function(_0x47bbfd,_0x57b8ed,_0x5a691a){_0x5a691a(null,util['format']('%s-%s',Date[_0x94ad('0x28')](),_0x57b8ed[_0x94ad('0x29')]));}})});router[_0x94ad('0x21')](_0x94ad('0x13'),upload[_0x94ad('0x2a')]('file'),controller[_0x94ad('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe8b989,_0x563e92,_0x91c6e9){_0x91c6e9(null,path['join'](config[_0x94ad('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x23d109,_0x3d2cc4,_0x476bd2){_0x476bd2(null,util[_0x94ad('0x26')]('%s-%s',Date['now'](),_0x3d2cc4[_0x94ad('0x29')]));}})});router['post'](_0x94ad('0x2f'),upload[_0x94ad('0x2a')](_0x94ad('0x2b')),controller[_0x94ad('0x30')]);var upload=multer({'storage':multer[_0x94ad('0x24')]({'destination':function(_0x40ecb5,_0x546a67,_0x427585){_0x427585(null,path['join'](config[_0x94ad('0x2c')],_0x94ad('0x2d')));},'filename':function(_0x4c34af,_0x4e8803,_0x1d6001){_0x1d6001(null,util[_0x94ad('0x26')]('%s-%s',Date['now'](),_0x4e8803[_0x94ad('0x29')]));}})});router[_0x94ad('0x21')](_0x94ad('0x15'),upload[_0x94ad('0x2a')](_0x94ad('0x2b')),controller[_0x94ad('0x31')]);router['post'](_0x94ad('0x32'),controller[_0x94ad('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x129db4,_0x1f1afc,_0x3be09a){const _0x5ee123=path[_0x94ad('0x25')](config[_0x94ad('0x2c')],_0x94ad('0x34'),_0x94ad('0x35'),'offline-chat');fs_extra['ensureDir'](_0x5ee123,function(){_0x3be09a(null,_0x5ee123);});},'filename':function(_0x16a033,_0xe67262,_0x11826d){const _0x3a5166=_0xe67262['originalname'][_0x94ad('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2533d6=path[_0x94ad('0x37')](_0x3a5166);const _0x3a2b93=Date[_0x94ad('0x28')]()+'-'+_0x3a5166[_0x94ad('0x36')](_0x2533d6,'')+_0x2533d6;_0x11826d(null,_0x3a2b93);}})});router[_0x94ad('0x21')](_0x94ad('0x38'),offlineUploadMulter[_0x94ad('0x39')](),controller[_0x94ad('0x3a')]);router[_0x94ad('0x21')](_0x94ad('0x17'),auth[_0x94ad('0x7')](),controller['addInteraction']);router['post'](_0x94ad('0x19'),auth['isAuthenticated'](),controller[_0x94ad('0x3b')]);router[_0x94ad('0x21')](_0x94ad('0x1b'),auth[_0x94ad('0x7')](),controller[_0x94ad('0x3c')]);router[_0x94ad('0x21')]('/:id/users',auth[_0x94ad('0x7')](),controller[_0x94ad('0x3d')]);router[_0x94ad('0x3e')](_0x94ad('0xc'),auth[_0x94ad('0x7')](),controller[_0x94ad('0x3f')]);router[_0x94ad('0x40')](_0x94ad('0xc'),auth[_0x94ad('0x7')](),controller[_0x94ad('0x41')]);router[_0x94ad('0x40')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x94ad('0x40')]('/:id/canned_answers',auth[_0x94ad('0x7')](),controller[_0x94ad('0x42')]);router[_0x94ad('0x40')](_0x94ad('0x43'),auth[_0x94ad('0x7')](),controller[_0x94ad('0x44')]);module[_0x94ad('0x45')]=router; \ No newline at end of file +var _0xd74c=['extname','replace','/:id/offline','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','put','delete','destroy','removeDispositions','removeAnswers','/:id/users','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','/:id','getAnswers','/:id/logo','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','/:id/offline_messages','getAgents','post','create','addDisposition','/:id/canned_answers','join','%s-%s','now','originalname','single','file','diskStorage','server/files/images/avatars/','/:id/avatar','addAvatar','root','format','/:id/customer_avatar','addSystemAvatar','/:id/notify','attachments','ensureDir'];(function(_0x2afadf,_0x57fb00){var _0x3f0571=function(_0x16f0c7){while(--_0x16f0c7){_0x2afadf['push'](_0x2afadf['shift']());}};_0x3f0571(++_0x57fb00);}(_0xd74c,0x1d6));var _0xcd74=function(_0x1b3159,_0x22c6ac){_0x1b3159=_0x1b3159-0x0;var _0x5d4bcc=_0xd74c[_0x1b3159];return _0x5d4bcc;};'use strict';var multer=require(_0xcd74('0x0'));var util=require('util');var path=require(_0xcd74('0x1'));var timeout=require(_0xcd74('0x2'));var express=require(_0xcd74('0x3'));var router=express[_0xcd74('0x4')]();var fs_extra=require(_0xcd74('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcd74('0x6'));var config=require(_0xcd74('0x7'));var controller=require(_0xcd74('0x8'));router[_0xcd74('0x9')]('/',auth['isAuthenticated'](),controller[_0xcd74('0xa')]);router[_0xcd74('0x9')](_0xcd74('0xb'),auth[_0xcd74('0xc')](),controller['describe']);router[_0xcd74('0x9')](_0xcd74('0xd'),auth[_0xcd74('0xc')](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0xcd74('0xc')](),controller[_0xcd74('0xe')]);router['get'](_0xcd74('0xf'),controller[_0xcd74('0x10')]);router['get']('/:id/avatar',controller[_0xcd74('0x11')]);router[_0xcd74('0x9')]('/:id/customer_avatar',controller[_0xcd74('0x12')]);router[_0xcd74('0x9')](_0xcd74('0x13'),controller[_0xcd74('0x14')]);router['get']('/:id/interactions',auth[_0xcd74('0xc')](),controller[_0xcd74('0x15')]);router['get']('/:id/snippet',controller[_0xcd74('0x16')]);router[_0xcd74('0x9')](_0xcd74('0x17'),auth[_0xcd74('0xc')](),controller[_0xcd74('0x18')]);router['get']('/:id/proactive_actions',auth[_0xcd74('0xc')](),controller[_0xcd74('0x19')]);router['get'](_0xcd74('0x1a'),controller['getFields']);router[_0xcd74('0x9')](_0xcd74('0x1b'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0xcd74('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xcd74('0x1c')]);router[_0xcd74('0x1d')]('/',auth[_0xcd74('0xc')](),controller[_0xcd74('0x1e')]);router[_0xcd74('0x1d')]('/:id/dispositions',auth[_0xcd74('0xc')](),controller[_0xcd74('0x1f')]);router[_0xcd74('0x1d')](_0xcd74('0x20'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a0c4c,_0x147cce,_0x21c4a1){_0x21c4a1(null,path[_0xcd74('0x21')](config['root'],'server/files/images/logos/'));},'filename':function(_0x4d7759,_0x219b58,_0x61ee22){_0x61ee22(null,util['format'](_0xcd74('0x22'),Date[_0xcd74('0x23')](),_0x219b58[_0xcd74('0x24')]));}})});router[_0xcd74('0x1d')](_0xcd74('0xf'),upload[_0xcd74('0x25')](_0xcd74('0x26')),controller['addLogo']);var upload=multer({'storage':multer[_0xcd74('0x27')]({'destination':function(_0x52c19d,_0x1cc768,_0x4d3485){_0x4d3485(null,path['join'](config['root'],_0xcd74('0x28')));},'filename':function(_0x4df772,_0x1da83c,_0x49e3c7){_0x49e3c7(null,util['format'](_0xcd74('0x22'),Date[_0xcd74('0x23')](),_0x1da83c[_0xcd74('0x24')]));}})});router[_0xcd74('0x1d')](_0xcd74('0x29'),upload[_0xcd74('0x25')]('file'),controller[_0xcd74('0x2a')]);var upload=multer({'storage':multer[_0xcd74('0x27')]({'destination':function(_0x10e575,_0x2e7e30,_0x4e579c){_0x4e579c(null,path[_0xcd74('0x21')](config[_0xcd74('0x2b')],_0xcd74('0x28')));},'filename':function(_0x4f7c08,_0x36cf27,_0x41c2ed){_0x41c2ed(null,util[_0xcd74('0x2c')](_0xcd74('0x22'),Date[_0xcd74('0x23')](),_0x36cf27[_0xcd74('0x24')]));}})});router['post'](_0xcd74('0x2d'),upload[_0xcd74('0x25')](_0xcd74('0x26')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xcd74('0x27')]({'destination':function(_0x313cd3,_0x2cfc37,_0x1da742){_0x1da742(null,path[_0xcd74('0x21')](config[_0xcd74('0x2b')],_0xcd74('0x28')));},'filename':function(_0xa8f228,_0x727ce9,_0x5b867a){_0x5b867a(null,util[_0xcd74('0x2c')](_0xcd74('0x22'),Date[_0xcd74('0x23')](),_0x727ce9[_0xcd74('0x24')]));}})});router[_0xcd74('0x1d')](_0xcd74('0x13'),upload[_0xcd74('0x25')](_0xcd74('0x26')),controller[_0xcd74('0x2e')]);router[_0xcd74('0x1d')](_0xcd74('0x2f'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xcd74('0x27')]({'destination':function(_0x211101,_0x109aef,_0x461eab){const _0x33bbb0=path['join'](config[_0xcd74('0x2b')],'server/files',_0xcd74('0x30'),'offline-chat');fs_extra[_0xcd74('0x31')](_0x33bbb0,function(){_0x461eab(null,_0x33bbb0);});},'filename':function(_0x2f219f,_0x4688f6,_0xecefaa){const _0x2c0889=_0x4688f6[_0xcd74('0x24')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1f02aa=path[_0xcd74('0x32')](_0x2c0889);const _0xe61ec6=Date[_0xcd74('0x23')]()+'-'+_0x2c0889[_0xcd74('0x33')](_0x1f02aa,'')+_0x1f02aa;_0xecefaa(null,_0xe61ec6);}})});router[_0xcd74('0x1d')](_0xcd74('0x34'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0xcd74('0x35'),auth[_0xcd74('0xc')](),controller[_0xcd74('0x36')]);router['post'](_0xcd74('0x17'),auth[_0xcd74('0xc')](),controller[_0xcd74('0x37')]);router[_0xcd74('0x1d')](_0xcd74('0x38'),auth[_0xcd74('0xc')](),controller[_0xcd74('0x39')]);router[_0xcd74('0x1d')]('/:id/users',auth[_0xcd74('0xc')](),controller['addAgents']);router[_0xcd74('0x3a')](_0xcd74('0xd'),auth[_0xcd74('0xc')](),controller['update']);router[_0xcd74('0x3b')](_0xcd74('0xd'),auth[_0xcd74('0xc')](),controller[_0xcd74('0x3c')]);router[_0xcd74('0x3b')]('/:id/dispositions',auth[_0xcd74('0xc')](),controller[_0xcd74('0x3d')]);router[_0xcd74('0x3b')]('/:id/canned_answers',auth[_0xcd74('0xc')](),controller[_0xcd74('0x3e')]);router[_0xcd74('0x3b')](_0xcd74('0x3f'),auth[_0xcd74('0xc')](),controller['removeAgents']);module[_0xcd74('0x40')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 5ad6d08..3b7edcd 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a69=['expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','app','get','Client-Side\x20logger\x20not\x20found!'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x2a69,0x164));var _0x92a6=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x2a69[_0x1cc8fe];return _0x230054;};var beaverLogger=require(_0x92a6('0x0'));var express=require('express');var auth=require(_0x92a6('0x1'));var config=require(_0x92a6('0x2'));var router=express[_0x92a6('0x3')]();var isProduction=config[_0x92a6('0x4')]==='production'||![];function clientSideLogs(_0x36cf50,_0x387e1a,_0x563a1f){var _0x57f8b5=_0x36cf50[_0x92a6('0x5')][_0x92a6('0x6')]('client-side-logger');if(!_0x57f8b5){throw new Error(_0x92a6('0x7'));}return beaverLogger[_0x92a6('0x8')]({'uri':_0x92a6('0x9'),'logger':_0x57f8b5,'enableCors':!isProduction})(_0x36cf50,_0x387e1a,_0x563a1f);}router[_0x92a6('0xa')](auth[_0x92a6('0xb')](),clientSideLogs);module[_0x92a6('0xc')]=router; \ No newline at end of file +var _0x132a=['/client-logs','use','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x132a,0x199));var _0xa132=function(_0x1e7de9,_0x52f0ca){_0x1e7de9=_0x1e7de9-0x0;var _0x4639ce=_0x132a[_0x1e7de9];return _0x4639ce;};var beaverLogger=require('beaver-logger/server');var express=require(_0xa132('0x0'));var auth=require(_0xa132('0x1'));var config=require(_0xa132('0x2'));var router=express[_0xa132('0x3')]();var isProduction=config[_0xa132('0x4')]===_0xa132('0x5')||![];function clientSideLogs(_0x3ae426,_0x198ad8,_0x25e4c6){var _0x2144e6=_0x3ae426[_0xa132('0x6')][_0xa132('0x7')](_0xa132('0x8'));if(!_0x2144e6){throw new Error(_0xa132('0x9'));}return beaverLogger[_0xa132('0xa')]({'uri':_0xa132('0xb'),'logger':_0x2144e6,'enableCors':!isProduction})(_0x3ae426,_0x198ad8,_0x25e4c6);}router[_0xa132('0xc')](auth[_0xa132('0xd')](),clientSideLogs);module[_0xa132('0xe')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 101ca08..ead40f0 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 _0xc761=['MicrosoftAzure\x20=>\x20refresh_token','sequelize','STRING','ENUM','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x5864ef,_0x496812){var _0x21c244=function(_0x433f8a){while(--_0x433f8a){_0x5864ef['push'](_0x5864ef['shift']());}};_0x21c244(++_0x496812);}(_0xc761,0x160));var _0x1c76=function(_0x3a13cf,_0x478c62){_0x3a13cf=_0x3a13cf-0x0;var _0x4817c=_0xc761[_0x3a13cf];return _0x4817c;};'use strict';var Sequelize=require(_0x1c76('0x0'));module['exports']={'name':{'type':Sequelize[_0x1c76('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1c76('0x2')]('AmazonAWS',_0x1c76('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x1c76('0x2')](_0x1c76('0x4'),_0x1c76('0x5'))},'data1':{'type':Sequelize[_0x1c76('0x1')],'comment':_0x1c76('0x6')},'data2':{'type':Sequelize[_0x1c76('0x1')],'comment':_0x1c76('0x7')},'data3':{'type':Sequelize[_0x1c76('0x1')],'comment':_0x1c76('0x8')},'data4':{'type':Sequelize['STRING'],'comment':_0x1c76('0x9')},'data5':{'type':Sequelize[_0x1c76('0xa')],'comment':_0x1c76('0xb')},'data6':{'type':Sequelize[_0x1c76('0xa')],'comment':_0x1c76('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0xb1f6=['MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xb1f6,0x1d6));var _0x6b1f=function(_0x3e52fd,_0x5deeaf){_0x3e52fd=_0x3e52fd-0x0;var _0x277992=_0xb1f6[_0x3e52fd];return _0x277992;};'use strict';var Sequelize=require(_0x6b1f('0x0'));module[_0x6b1f('0x1')]={'name':{'type':Sequelize[_0x6b1f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6b1f('0x3')](_0x6b1f('0x4'),'Google',_0x6b1f('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0x6b1f('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x6b1f('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0x6b1f('0x8')},'data3':{'type':Sequelize['STRING'],'comment':_0x6b1f('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0x6b1f('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0x6b1f('0xb')},'data6':{'type':Sequelize[_0x6b1f('0xc')],'comment':_0x6b1f('0xd')},'data7':{'type':Sequelize[_0x6b1f('0xc')],'comment':_0x6b1f('0xe')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 77a4c4d..eff6950 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 _0xf048=['oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/logger','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','then','error','stack','send','padEnd','slice','map','CloudProvider','rawAttributes','fieldName','type','model','name','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','includeAll','rows','service','decryptString','data3','show','params','include','options','find','MicrosoftAzure','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','catch','update','destroy'];(function(_0x500d3d,_0x538de8){var _0x4498e2=function(_0x5bdf2f){while(--_0x5bdf2f){_0x500d3d['push'](_0x500d3d['shift']());}};_0x4498e2(++_0x538de8);}(_0xf048,0x198));var _0x8f04=function(_0x2b80e5,_0x523953){_0x2b80e5=_0x2b80e5-0x0;var _0x709c1c=_0xf048[_0x2b80e5];return _0x709c1c;};'use strict';var _=require(_0x8f04('0x0'));var Redis=require('ioredis');var qs=require(_0x8f04('0x1'));var encryptor=require(_0x8f04('0x2'));var config=require('../../config/environment');var logger=require(_0x8f04('0x3'))('api');var db=require(_0x8f04('0x4'))['db'];var oauth=require(_0x8f04('0x5'));config['redis']=_[_0x8f04('0x6')](config[_0x8f04('0x7')],{'host':_0x8f04('0x8'),'port':0x18eb});var socket=require(_0x8f04('0x9'))(new Redis(config[_0x8f04('0x7')]));var redis=new Redis(config[_0x8f04('0x7')]);function respondWithStatusCode(_0x22b013,_0x4dd9b0){_0x4dd9b0=_0x4dd9b0||0xcc;return function(_0x70336){if(_0x70336){return _0x22b013[_0x8f04('0xa')](_0x4dd9b0);}return _0x22b013['status'](_0x4dd9b0)[_0x8f04('0xb')]();};}function respondWithResult(_0x2ee0df,_0x36e8e0){_0x36e8e0=_0x36e8e0||0xc8;return function(_0x29d62b){if(_0x29d62b){return _0x2ee0df['status'](_0x36e8e0)[_0x8f04('0xc')](_0x29d62b);}};}function respondWithFilteredResult(_0x1228bd,_0x5134d7){return function(_0xd56015){if(_0xd56015){var _0x1f5870=typeof _0x5134d7[_0x8f04('0xd')]===_0x8f04('0xe')&&typeof _0x5134d7['limit']==='undefined';var _0x194203=_0xd56015[_0x8f04('0xf')];var _0x27136d=_0x1f5870?0x0:_0x5134d7[_0x8f04('0xd')];var _0x2296a0=_0x1f5870?_0xd56015[_0x8f04('0xf')]:_0x5134d7[_0x8f04('0xd')]+_0x5134d7[_0x8f04('0x10')];var _0xc48369;if(_0x2296a0>=_0x194203){_0x2296a0=_0x194203;_0xc48369=0xc8;}else{_0xc48369=0xce;}_0x1228bd[_0x8f04('0x11')](_0xc48369);return _0x1228bd[_0x8f04('0x12')](_0x8f04('0x13'),_0x27136d+'-'+_0x2296a0+'/'+_0x194203)['json'](_0xd56015);}return null;};}function saveUpdates(_0x11bce8){return function(_0x32e0b2){if(_0x32e0b2){return _0x32e0b2['update'](_0x11bce8)[_0x8f04('0x14')](function(_0x5c1d2d){return _0x5c1d2d;});}return null;};}function removeEntity(_0x3415c2){return function(_0x187534){if(_0x187534){return _0x187534['destroy']()[_0x8f04('0x14')](function(){_0x3415c2[_0x8f04('0x11')](0xcc)[_0x8f04('0xb')]();});}};}function handleEntityNotFound(_0x3408e7){return function(_0x6357d1){if(!_0x6357d1){_0x3408e7[_0x8f04('0xa')](0x194);}return _0x6357d1;};}function handleError(_0x240d51,_0xc73f80){_0xc73f80=_0xc73f80||0x1f4;return function(_0x8e2100){logger[_0x8f04('0x15')](_0x8e2100[_0x8f04('0x16')]);if(_0x8e2100['name']){delete _0x8e2100['name'];}_0x240d51[_0x8f04('0x11')](_0xc73f80)[_0x8f04('0x17')](_0x8e2100);};}function maskClientSecret(_0x58597d){return _[_0x8f04('0x18')](_0x58597d[_0x8f04('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x1e2fac,_0x32a494){var _0x373f1a={},_0x32169e={},_0x49b9f5={'count':0x0,'rows':[]};var _0x6618be=_[_0x8f04('0x1a')](db[_0x8f04('0x1b')][_0x8f04('0x1c')],function(_0x5cf614){return{'name':_0x5cf614[_0x8f04('0x1d')],'type':_0x5cf614[_0x8f04('0x1e')]['key']};});_0x32169e[_0x8f04('0x1f')]=_[_0x8f04('0x1a')](_0x6618be,_0x8f04('0x20'));_0x32169e['query']=_[_0x8f04('0x21')](_0x1e2fac[_0x8f04('0x22')]);_0x32169e['filters']=_[_0x8f04('0x23')](_0x32169e[_0x8f04('0x1f')],_0x32169e[_0x8f04('0x22')]);_0x373f1a[_0x8f04('0x24')]=_[_0x8f04('0x23')](_0x32169e[_0x8f04('0x1f')],qs[_0x8f04('0x25')](_0x1e2fac['query'][_0x8f04('0x25')]));_0x373f1a[_0x8f04('0x24')]=_0x373f1a['attributes'][_0x8f04('0x26')]?_0x373f1a[_0x8f04('0x24')]:_0x32169e['model'];if(!_0x1e2fac[_0x8f04('0x22')]['hasOwnProperty'](_0x8f04('0x27'))){_0x373f1a[_0x8f04('0x10')]=qs[_0x8f04('0x10')](_0x1e2fac[_0x8f04('0x22')][_0x8f04('0x10')]);_0x373f1a[_0x8f04('0xd')]=qs[_0x8f04('0xd')](_0x1e2fac[_0x8f04('0x22')]['offset']);}_0x373f1a[_0x8f04('0x28')]=qs['sort'](_0x1e2fac[_0x8f04('0x22')][_0x8f04('0x29')]);_0x373f1a[_0x8f04('0x2a')]=qs[_0x8f04('0x2b')](_['pick'](_0x1e2fac['query'],_0x32169e['filters']),_0x6618be);if(_0x1e2fac[_0x8f04('0x22')][_0x8f04('0x2c')]){_0x373f1a[_0x8f04('0x2a')]=_['merge'](_0x373f1a[_0x8f04('0x2a')],{'$or':_[_0x8f04('0x1a')](_0x6618be,function(_0x460c60){if(_0x460c60[_0x8f04('0x1e')]!=='VIRTUAL'){var _0x59de8d={};_0x59de8d[_0x460c60[_0x8f04('0x20')]]={'$like':'%'+_0x1e2fac[_0x8f04('0x22')]['filter']+'%'};return _0x59de8d;}})});}_0x373f1a=_[_0x8f04('0x2d')]({},_0x373f1a,_0x1e2fac['options']);var _0x159ea0={'where':_0x373f1a[_0x8f04('0x2a')]};return db[_0x8f04('0x1b')][_0x8f04('0xf')](_0x159ea0)[_0x8f04('0x14')](function(_0x23ed8e){_0x49b9f5['count']=_0x23ed8e;if(_0x1e2fac['query'][_0x8f04('0x2e')]){_0x373f1a['include']=[{'all':!![]}];}return db[_0x8f04('0x1b')]['findAll'](_0x373f1a);})[_0x8f04('0x14')](function(_0x2509c4){_0x49b9f5[_0x8f04('0x2f')]=_['map'](_0x2509c4,function(_0x2c6ce7){if(_0x2c6ce7[_0x8f04('0x30')]==='MicrosoftAzure'){var _0x2e1ef8=encryptor[_0x8f04('0x31')](_0x2c6ce7[_0x8f04('0x32')]);_0x2c6ce7[_0x8f04('0x32')]=maskClientSecret(_0x2e1ef8);}return _0x2c6ce7;});return _0x49b9f5;})['then'](respondWithFilteredResult(_0x32a494,_0x373f1a))['catch'](handleError(_0x32a494,null));};exports[_0x8f04('0x33')]=function(_0x3d49e8,_0x2eb3f6){var _0x352680={'raw':!![],'where':{'id':_0x3d49e8[_0x8f04('0x34')]['id']}},_0x56cb08={};_0x56cb08[_0x8f04('0x1f')]=_['keys'](db[_0x8f04('0x1b')][_0x8f04('0x1c')]);_0x56cb08['query']=_[_0x8f04('0x21')](_0x3d49e8['query']);_0x56cb08[_0x8f04('0x2b')]=_['intersection'](_0x56cb08[_0x8f04('0x1f')],_0x56cb08['query']);_0x352680['attributes']=_[_0x8f04('0x23')](_0x56cb08[_0x8f04('0x1f')],qs[_0x8f04('0x25')](_0x3d49e8[_0x8f04('0x22')][_0x8f04('0x25')]));_0x352680[_0x8f04('0x24')]=_0x352680[_0x8f04('0x24')]['length']?_0x352680[_0x8f04('0x24')]:_0x56cb08[_0x8f04('0x1f')];if(_0x3d49e8[_0x8f04('0x22')]['includeAll']){_0x352680[_0x8f04('0x35')]=[{'all':!![]}];}_0x352680=_[_0x8f04('0x2d')]({},_0x352680,_0x3d49e8[_0x8f04('0x36')]);return db[_0x8f04('0x1b')][_0x8f04('0x37')](_0x352680)['then'](handleEntityNotFound(_0x2eb3f6,null))[_0x8f04('0x14')](function(_0x2790dc){if(_0x2790dc[_0x8f04('0x30')]===_0x8f04('0x38')){var _0x16482f=encryptor[_0x8f04('0x31')](_0x2790dc['data3']);_0x2790dc[_0x8f04('0x32')]=maskClientSecret(_0x16482f);}return _0x2790dc;})[_0x8f04('0x14')](respondWithResult(_0x2eb3f6,null))['catch'](handleError(_0x2eb3f6,null));};exports[_0x8f04('0x39')]=function(_0x1e146a,_0xe458e6){if(!_0x1e146a[_0x8f04('0x3a')][_0x8f04('0x20')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x1e146a['body'][_0x8f04('0x30')])throw new Error(_0x8f04('0x3b'));var _0x280aa9=db[_0x8f04('0x1b')]['rawAttributes'][_0x8f04('0x30')][_0x8f04('0x3c')];if(!_0x280aa9[_0x8f04('0x3d')](_0x1e146a[_0x8f04('0x3a')][_0x8f04('0x30')]))throw new Error(_0x8f04('0x3e')+_0x280aa9['join'](',\x20'));if(_0x1e146a['body'][_0x8f04('0x30')]===_0x8f04('0x38')&&_0x1e146a[_0x8f04('0x3a')][_0x8f04('0x32')]){_0x1e146a['body'][_0x8f04('0x32')]=encryptor[_0x8f04('0x3f')](_0x1e146a['body']['data3']);}return db[_0x8f04('0x1b')][_0x8f04('0x39')](_0x1e146a['body'],{})[_0x8f04('0x14')](respondWithResult(_0xe458e6,0xc9))[_0x8f04('0x40')](handleError(_0xe458e6,null));};exports[_0x8f04('0x41')]=function(_0x2a223b,_0x191154){if(_0x2a223b[_0x8f04('0x3a')]['id']){delete _0x2a223b['body']['id'];}return db[_0x8f04('0x1b')][_0x8f04('0x37')]({'where':{'id':_0x2a223b['params']['id']}})[_0x8f04('0x14')](handleEntityNotFound(_0x191154,null))[_0x8f04('0x14')](function(_0x45be05){if(_0x45be05[_0x8f04('0x30')]===_0x8f04('0x38')&&_0x2a223b[_0x8f04('0x3a')]['data3']){_0x2a223b[_0x8f04('0x3a')][_0x8f04('0x32')]=encryptor['encryptString'](_0x2a223b[_0x8f04('0x3a')][_0x8f04('0x32')]);}return _0x45be05;})[_0x8f04('0x14')](saveUpdates(_0x2a223b['body'],null))[_0x8f04('0x14')](respondWithResult(_0x191154,null))['catch'](handleError(_0x191154,null));};exports[_0x8f04('0x42')]=function(_0x58767a,_0x42d8dd){return db[_0x8f04('0x1b')][_0x8f04('0x37')]({'where':{'id':_0x58767a['params']['id']}})['then'](handleEntityNotFound(_0x42d8dd,null))['then'](removeEntity(_0x42d8dd,null))[_0x8f04('0x40')](handleError(_0x42d8dd,null));};exports[_0x8f04('0x43')]=function(_0x366c74,_0x17912f){return db['CloudProvider']['findOne']({'where':{'id':_0x366c74[_0x8f04('0x34')]['id']},'raw':!![]})[_0x8f04('0x14')](function(_0x4e4735){if(!_0x4e4735)return _0x17912f[_0x8f04('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x4e4735,_0x366c74[_0x8f04('0x44')]['id'])};})['then'](respondWithResult(_0x17912f,null))[_0x8f04('0x40')](handleError(_0x17912f,null));};exports[_0x8f04('0x45')]=function(_0x2eb68f,_0x31f2c5){var _0x46dbb2=_0x2eb68f[_0x8f04('0x3a')];var _0x31805f;var _0x1a4ae2;if(_0x46dbb2[_0x8f04('0x15')])throw _0x46dbb2;redis[_0x8f04('0x46')](_0x46dbb2[_0x8f04('0x47')])[_0x8f04('0x14')](function(_0x4a9817){if(!_0x4a9817)throw new Error(_0x8f04('0x48'));_0x31805f=JSON['parse'](_0x4a9817);var _0x196f4e=Buffer[_0x8f04('0x49')](_0x46dbb2[_0x8f04('0x47')],_0x8f04('0x4a'))[_0x8f04('0x4b')]('ascii');_0x1a4ae2=JSON[_0x8f04('0x4c')](_0x196f4e);if(!oauth[_0x8f04('0x4d')](_0x46dbb2[_0x8f04('0x4e')],_0x31805f[_0x8f04('0x4f')]))throw new Error(_0x8f04('0x50'));redis[_0x8f04('0x51')](_0x46dbb2[_0x8f04('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x46dbb2[_0x8f04('0x52')],_0x31805f);})[_0x8f04('0x14')](function(_0x4d9b7b){_0x31805f[_0x8f04('0x53')]=_0x4d9b7b[_0x8f04('0x54')];_0x31805f[_0x8f04('0x55')]=_0x4d9b7b[_0x8f04('0x56')];return db[_0x8f04('0x1b')][_0x8f04('0x41')]({'data5':_0x31805f[_0x8f04('0x53')],'data6':_0x31805f[_0x8f04('0x55')]},{'where':{'id':_0x31805f['id']}});})[_0x8f04('0x14')](function(){oauth[_0x8f04('0x57')](_0x31805f);socket[_0x8f04('0x58')](_0x8f04('0x59'),{'id':_0x1a4ae2['id']});return;})['then'](respondWithStatusCode(_0x31f2c5,null))[_0x8f04('0x40')](function(_0x446a21){if(_0x1a4ae2){socket['emit'](_0x8f04('0x5a'),{'id':_0x1a4ae2['id']});}if(!_0x31805f){logger[_0x8f04('0x15')](_0x8f04('0x5b'),_0x446a21);return _0x31f2c5[_0x8f04('0x11')](0x1f4)[_0x8f04('0x17')](_0x446a21[_0x8f04('0x5c')]);}logger[_0x8f04('0x15')](_0x8f04('0x5d'),_0x31805f['id'],JSON[_0x8f04('0x5e')](_0x446a21));});}; \ No newline at end of file +var _0x51ef=['Invalid\x20state\x20parameter','parse','from','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','access_token','data5','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','offset','undefined','count','set','Content-Range','json','update','then','sendStatus','error','stack','name','send','padEnd','slice','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','options','includeAll','CloudProvider','findAll','rows','service','MicrosoftAzure','decryptString','catch','show','params','length','include','merge','find','data3','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state'];(function(_0x30e208,_0x1b436f){var _0x3e46d2=function(_0x30f9a8){while(--_0x30f9a8){_0x30e208['push'](_0x30e208['shift']());}};_0x3e46d2(++_0x1b436f);}(_0x51ef,0x18e));var _0xf51e=function(_0x37d6f0,_0xaf1fb4){_0x37d6f0=_0x37d6f0-0x0;var _0x536c64=_0x51ef[_0x37d6f0];return _0x536c64;};'use strict';var _=require(_0xf51e('0x0'));var Redis=require(_0xf51e('0x1'));var qs=require(_0xf51e('0x2'));var encryptor=require(_0xf51e('0x3'));var config=require(_0xf51e('0x4'));var logger=require(_0xf51e('0x5'))('api');var db=require(_0xf51e('0x6'))['db'];var oauth=require(_0xf51e('0x7'));config[_0xf51e('0x8')]=_[_0xf51e('0x9')](config[_0xf51e('0x8')],{'host':_0xf51e('0xa'),'port':0x18eb});var socket=require(_0xf51e('0xb'))(new Redis(config[_0xf51e('0x8')]));var redis=new Redis(config[_0xf51e('0x8')]);function respondWithStatusCode(_0x1a85a7,_0x3e9f89){_0x3e9f89=_0x3e9f89||0xcc;return function(_0x5e6ce4){if(_0x5e6ce4){return _0x1a85a7['sendStatus'](_0x3e9f89);}return _0x1a85a7[_0xf51e('0xc')](_0x3e9f89)['end']();};}function respondWithResult(_0x2dde94,_0x2cf521){_0x2cf521=_0x2cf521||0xc8;return function(_0x14a88f){if(_0x14a88f){return _0x2dde94[_0xf51e('0xc')](_0x2cf521)['json'](_0x14a88f);}};}function respondWithFilteredResult(_0x4687d9,_0x32f5d3){return function(_0x30e799){if(_0x30e799){var _0x4614ff=typeof _0x32f5d3[_0xf51e('0xd')]===_0xf51e('0xe')&&typeof _0x32f5d3['limit']==='undefined';var _0x10ada3=_0x30e799[_0xf51e('0xf')];var _0xedf49c=_0x4614ff?0x0:_0x32f5d3[_0xf51e('0xd')];var _0x4b4c14=_0x4614ff?_0x30e799[_0xf51e('0xf')]:_0x32f5d3[_0xf51e('0xd')]+_0x32f5d3['limit'];var _0x47c212;if(_0x4b4c14>=_0x10ada3){_0x4b4c14=_0x10ada3;_0x47c212=0xc8;}else{_0x47c212=0xce;}_0x4687d9['status'](_0x47c212);return _0x4687d9[_0xf51e('0x10')](_0xf51e('0x11'),_0xedf49c+'-'+_0x4b4c14+'/'+_0x10ada3)[_0xf51e('0x12')](_0x30e799);}return null;};}function saveUpdates(_0x4597a2){return function(_0x332230){if(_0x332230){return _0x332230[_0xf51e('0x13')](_0x4597a2)[_0xf51e('0x14')](function(_0x24748f){return _0x24748f;});}return null;};}function removeEntity(_0x5365bc){return function(_0x412e2d){if(_0x412e2d){return _0x412e2d['destroy']()[_0xf51e('0x14')](function(){_0x5365bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x69712e){return function(_0x24c4a7){if(!_0x24c4a7){_0x69712e[_0xf51e('0x15')](0x194);}return _0x24c4a7;};}function handleError(_0x3eac43,_0x2c56f7){_0x2c56f7=_0x2c56f7||0x1f4;return function(_0x88aee2){logger[_0xf51e('0x16')](_0x88aee2[_0xf51e('0x17')]);if(_0x88aee2[_0xf51e('0x18')]){delete _0x88aee2[_0xf51e('0x18')];}_0x3eac43[_0xf51e('0xc')](_0x2c56f7)[_0xf51e('0x19')](_0x88aee2);};}function maskClientSecret(_0x4fb747){return _[_0xf51e('0x1a')](_0x4fb747[_0xf51e('0x1b')](0x0,0x3),0x14,'*');}exports[_0xf51e('0x1c')]=function(_0x24337f,_0x4aa04e){var _0x4194b4={},_0x3c4f18={},_0x2b8b6c={'count':0x0,'rows':[]};var _0xa352e7=_[_0xf51e('0x1d')](db['CloudProvider'][_0xf51e('0x1e')],function(_0x5af5fd){return{'name':_0x5af5fd[_0xf51e('0x1f')],'type':_0x5af5fd[_0xf51e('0x20')][_0xf51e('0x21')]};});_0x3c4f18['model']=_[_0xf51e('0x1d')](_0xa352e7,_0xf51e('0x18'));_0x3c4f18['query']=_['keys'](_0x24337f[_0xf51e('0x22')]);_0x3c4f18[_0xf51e('0x23')]=_[_0xf51e('0x24')](_0x3c4f18['model'],_0x3c4f18[_0xf51e('0x22')]);_0x4194b4[_0xf51e('0x25')]=_[_0xf51e('0x24')](_0x3c4f18[_0xf51e('0x26')],qs[_0xf51e('0x27')](_0x24337f[_0xf51e('0x22')][_0xf51e('0x27')]));_0x4194b4[_0xf51e('0x25')]=_0x4194b4[_0xf51e('0x25')]['length']?_0x4194b4['attributes']:_0x3c4f18[_0xf51e('0x26')];if(!_0x24337f['query'][_0xf51e('0x28')](_0xf51e('0x29'))){_0x4194b4[_0xf51e('0x2a')]=qs['limit'](_0x24337f[_0xf51e('0x22')]['limit']);_0x4194b4[_0xf51e('0xd')]=qs[_0xf51e('0xd')](_0x24337f[_0xf51e('0x22')][_0xf51e('0xd')]);}_0x4194b4['order']=qs[_0xf51e('0x2b')](_0x24337f[_0xf51e('0x22')][_0xf51e('0x2b')]);_0x4194b4[_0xf51e('0x2c')]=qs[_0xf51e('0x23')](_[_0xf51e('0x2d')](_0x24337f['query'],_0x3c4f18[_0xf51e('0x23')]),_0xa352e7);if(_0x24337f[_0xf51e('0x22')]['filter']){_0x4194b4[_0xf51e('0x2c')]=_['merge'](_0x4194b4[_0xf51e('0x2c')],{'$or':_[_0xf51e('0x1d')](_0xa352e7,function(_0x35b25f){if(_0x35b25f[_0xf51e('0x20')]!==_0xf51e('0x2e')){var _0x564e0e={};_0x564e0e[_0x35b25f['name']]={'$like':'%'+_0x24337f[_0xf51e('0x22')]['filter']+'%'};return _0x564e0e;}})});}_0x4194b4=_['merge']({},_0x4194b4,_0x24337f[_0xf51e('0x2f')]);var _0x2e0595={'where':_0x4194b4['where']};return db['CloudProvider'][_0xf51e('0xf')](_0x2e0595)['then'](function(_0x3df4c5){_0x2b8b6c[_0xf51e('0xf')]=_0x3df4c5;if(_0x24337f[_0xf51e('0x22')][_0xf51e('0x30')]){_0x4194b4['include']=[{'all':!![]}];}return db[_0xf51e('0x31')][_0xf51e('0x32')](_0x4194b4);})['then'](function(_0x2a95dc){_0x2b8b6c[_0xf51e('0x33')]=_[_0xf51e('0x1d')](_0x2a95dc,function(_0x334810){if(_0x334810[_0xf51e('0x34')]===_0xf51e('0x35')){var _0xac08bf=encryptor[_0xf51e('0x36')](_0x334810['data3']);_0x334810['data3']=maskClientSecret(_0xac08bf);}return _0x334810;});return _0x2b8b6c;})[_0xf51e('0x14')](respondWithFilteredResult(_0x4aa04e,_0x4194b4))[_0xf51e('0x37')](handleError(_0x4aa04e,null));};exports[_0xf51e('0x38')]=function(_0x52b353,_0x437374){var _0x8458ee={'raw':!![],'where':{'id':_0x52b353[_0xf51e('0x39')]['id']}},_0x3b843a={};_0x3b843a[_0xf51e('0x26')]=_['keys'](db[_0xf51e('0x31')]['rawAttributes']);_0x3b843a[_0xf51e('0x22')]=_['keys'](_0x52b353['query']);_0x3b843a['filters']=_[_0xf51e('0x24')](_0x3b843a[_0xf51e('0x26')],_0x3b843a['query']);_0x8458ee[_0xf51e('0x25')]=_[_0xf51e('0x24')](_0x3b843a[_0xf51e('0x26')],qs[_0xf51e('0x27')](_0x52b353['query'][_0xf51e('0x27')]));_0x8458ee['attributes']=_0x8458ee['attributes'][_0xf51e('0x3a')]?_0x8458ee[_0xf51e('0x25')]:_0x3b843a['model'];if(_0x52b353[_0xf51e('0x22')][_0xf51e('0x30')]){_0x8458ee[_0xf51e('0x3b')]=[{'all':!![]}];}_0x8458ee=_[_0xf51e('0x3c')]({},_0x8458ee,_0x52b353[_0xf51e('0x2f')]);return db[_0xf51e('0x31')][_0xf51e('0x3d')](_0x8458ee)[_0xf51e('0x14')](handleEntityNotFound(_0x437374,null))[_0xf51e('0x14')](function(_0x4e6923){if(_0x4e6923['service']==='MicrosoftAzure'){var _0x98892e=encryptor['decryptString'](_0x4e6923[_0xf51e('0x3e')]);_0x4e6923['data3']=maskClientSecret(_0x98892e);}return _0x4e6923;})[_0xf51e('0x14')](respondWithResult(_0x437374,null))['catch'](handleError(_0x437374,null));};exports[_0xf51e('0x3f')]=function(_0x38ac6d,_0x1cd309){if(!_0x38ac6d[_0xf51e('0x40')][_0xf51e('0x18')])throw new Error(_0xf51e('0x41'));if(!_0x38ac6d[_0xf51e('0x40')][_0xf51e('0x34')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x25e216=db[_0xf51e('0x31')][_0xf51e('0x1e')][_0xf51e('0x34')][_0xf51e('0x42')];if(!_0x25e216[_0xf51e('0x43')](_0x38ac6d[_0xf51e('0x40')][_0xf51e('0x34')]))throw new Error(_0xf51e('0x44')+_0x25e216[_0xf51e('0x45')](',\x20'));if(_0x38ac6d[_0xf51e('0x40')][_0xf51e('0x34')]==='MicrosoftAzure'&&_0x38ac6d['body']['data3']){_0x38ac6d['body'][_0xf51e('0x3e')]=encryptor[_0xf51e('0x46')](_0x38ac6d[_0xf51e('0x40')][_0xf51e('0x3e')]);}return db['CloudProvider']['create'](_0x38ac6d['body'],{})['then'](respondWithResult(_0x1cd309,0xc9))[_0xf51e('0x37')](handleError(_0x1cd309,null));};exports[_0xf51e('0x13')]=function(_0x148ce7,_0x1d3c07){if(_0x148ce7[_0xf51e('0x40')]['id']){delete _0x148ce7[_0xf51e('0x40')]['id'];}return db[_0xf51e('0x31')][_0xf51e('0x3d')]({'where':{'id':_0x148ce7[_0xf51e('0x39')]['id']}})[_0xf51e('0x14')](handleEntityNotFound(_0x1d3c07,null))[_0xf51e('0x14')](function(_0x5b69cc){if(_0x5b69cc[_0xf51e('0x34')]==='MicrosoftAzure'&&_0x148ce7['body']['data3']){_0x148ce7[_0xf51e('0x40')][_0xf51e('0x3e')]=encryptor[_0xf51e('0x46')](_0x148ce7[_0xf51e('0x40')][_0xf51e('0x3e')]);}return _0x5b69cc;})[_0xf51e('0x14')](saveUpdates(_0x148ce7[_0xf51e('0x40')],null))[_0xf51e('0x14')](respondWithResult(_0x1d3c07,null))[_0xf51e('0x37')](handleError(_0x1d3c07,null));};exports[_0xf51e('0x47')]=function(_0x46fc26,_0x50680a){return db[_0xf51e('0x31')]['find']({'where':{'id':_0x46fc26[_0xf51e('0x39')]['id']}})[_0xf51e('0x14')](handleEntityNotFound(_0x50680a,null))[_0xf51e('0x14')](removeEntity(_0x50680a,null))[_0xf51e('0x37')](handleError(_0x50680a,null));};exports['oauth2MicrosoftAuthorize']=function(_0x1837ef,_0x2e598b){return db['CloudProvider'][_0xf51e('0x48')]({'where':{'id':_0x1837ef['params']['id']},'raw':!![]})[_0xf51e('0x14')](function(_0x2c8441){if(!_0x2c8441)return _0x2e598b[_0xf51e('0x15')](0x194);return{'url':oauth[_0xf51e('0x49')](_0x2c8441,_0x1837ef[_0xf51e('0x4a')]['id'])};})[_0xf51e('0x14')](respondWithResult(_0x2e598b,null))['catch'](handleError(_0x2e598b,null));};exports[_0xf51e('0x4b')]=function(_0x32e0ff,_0x37ada7){var _0x587fc8=_0x32e0ff[_0xf51e('0x40')];var _0x1bbb85;var _0x39c4b9;if(_0x587fc8[_0xf51e('0x16')])throw _0x587fc8;redis['get'](_0x587fc8[_0xf51e('0x4c')])[_0xf51e('0x14')](function(_0xb6ad1c){if(!_0xb6ad1c)throw new Error(_0xf51e('0x4d'));_0x1bbb85=JSON[_0xf51e('0x4e')](_0xb6ad1c);var _0x2a8d39=Buffer[_0xf51e('0x4f')](_0x587fc8['state'],'base64')['toString'](_0xf51e('0x50'));_0x39c4b9=JSON[_0xf51e('0x4e')](_0x2a8d39);if(!oauth[_0xf51e('0x51')](_0x587fc8['id_token'],_0x1bbb85[_0xf51e('0x52')]))throw new Error(_0xf51e('0x53'));redis['del'](_0x587fc8['state']);return oauth[_0xf51e('0x54')](_0x587fc8[_0xf51e('0x55')],_0x1bbb85);})[_0xf51e('0x14')](function(_0x1aef6e){_0x1bbb85['data5']=_0x1aef6e[_0xf51e('0x56')];_0x1bbb85['data6']=_0x1aef6e['refresh_token'];return db[_0xf51e('0x31')][_0xf51e('0x13')]({'data5':_0x1bbb85[_0xf51e('0x57')],'data6':_0x1bbb85['data6']},{'where':{'id':_0x1bbb85['id']}});})[_0xf51e('0x14')](function(){oauth['startRefreshInterval'](_0x1bbb85);socket[_0xf51e('0x58')](_0xf51e('0x59'),{'id':_0x39c4b9['id']});return;})[_0xf51e('0x14')](respondWithStatusCode(_0x37ada7,null))[_0xf51e('0x37')](function(_0x1a8dce){if(_0x39c4b9){socket['emit'](_0xf51e('0x5a'),{'id':_0x39c4b9['id']});}if(!_0x1bbb85){logger[_0xf51e('0x16')](_0xf51e('0x5b'),_0x1a8dce);return _0x37ada7['status'](0x1f4)[_0xf51e('0x19')](_0x1a8dce[_0xf51e('0x5c')]);}logger[_0xf51e('0x16')](_0xf51e('0x5d'),_0x1bbb85['id'],JSON[_0xf51e('0x5e')](_0x1a8dce));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index a2a4c69..789be54 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 _0x18d3=['CloudProvider','cloud_providers','lodash','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x470f03,_0x238735){var _0x5a35d6=function(_0x8004af){while(--_0x8004af){_0x470f03['push'](_0x470f03['shift']());}};_0x5a35d6(++_0x238735);}(_0x18d3,0x86));var _0x318d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x18d3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x318d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x318d('0x1'));var moment=require(_0x318d('0x2'));var BPromise=require(_0x318d('0x3'));var rp=require(_0x318d('0x4'));var fs=require('fs');var path=require(_0x318d('0x5'));var rimraf=require('rimraf');var config=require(_0x318d('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x318d('0x7')]=function(_0x524f98,_0x2200b6){return _0x524f98[_0x318d('0x8')](_0x318d('0x9'),attributes,{'tableName':_0x318d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89f0=['rimraf','exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5d88be,_0x5a9a0d){var _0x27b2e7=function(_0x5662c1){while(--_0x5662c1){_0x5d88be['push'](_0x5d88be['shift']());}};_0x27b2e7(++_0x5a9a0d);}(_0x89f0,0x19c));var _0x089f=function(_0x2d4ba7,_0x116f05){_0x2d4ba7=_0x2d4ba7-0x0;var _0x211b68=_0x89f0[_0x2d4ba7];return _0x211b68;};'use strict';var _=require(_0x089f('0x0'));var util=require(_0x089f('0x1'));var logger=require(_0x089f('0x2'))(_0x089f('0x3'));var moment=require(_0x089f('0x4'));var BPromise=require(_0x089f('0x5'));var rp=require(_0x089f('0x6'));var fs=require('fs');var path=require(_0x089f('0x7'));var rimraf=require(_0x089f('0x8'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0x089f('0x9')]=function(_0xaa4918,_0x17f842){return _0xaa4918['define'](_0x089f('0xa'),attributes,{'tableName':_0x089f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index f1fa0cf..c8ca72b 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc95a=['redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','data7','/.default','join','Outlook365','replace','data2','code','id_token','randomBytes','toString','hex','client_id','data1','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','key','oauth2Claims','set','payload','iss','aud','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','{TENANT_ID}','data5','access_token','data6','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','inspect','error','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','defaults'];(function(_0x4bb201,_0x47434b){var _0x4e9dec=function(_0xf3ebc0){while(--_0xf3ebc0){_0x4bb201['push'](_0x4bb201['shift']());}};_0x4e9dec(++_0x47434b);}(_0xc95a,0x90));var _0xac95=function(_0x44d6bb,_0x43f171){_0x44d6bb=_0x44d6bb-0x0;var _0x167b7e=_0xc95a[_0x44d6bb];return _0x167b7e;};'use strict';var _=require(_0xac95('0x0'));var crypto=require(_0xac95('0x1'));var jwt=require(_0xac95('0x2'));var moment=require(_0xac95('0x3'));var Redis=require(_0xac95('0x4'));var rp=require('request-promise');var util=require(_0xac95('0x5'));var encryptor=require(_0xac95('0x6'));var config=require(_0xac95('0x7'));var logger=require(_0xac95('0x8'))(_0xac95('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xac95('0xa'))['db'];config['redis']=_[_0xac95('0xb')](config[_0xac95('0xc')],{'host':_0xac95('0xd'),'port':0x18eb});var redis=new Redis(config[_0xac95('0xc')]);var MICROSOFT_AUTH_URL=_0xac95('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0xac95('0xf'),'profile',_0xac95('0x10'),_0xac95('0x11'),_0xac95('0x12'),_0xac95('0x13'),_0xac95('0x14')],'Dynamics365':[_0xac95('0xf'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xac95('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0xac95('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2a883a){var _0x1f86f8=_[_0xac95('0x17')](AZURE_AUTH_SCOPES[_0x2a883a['type']]);if(_0x2a883a[_0xac95('0x18')]===_0xac95('0x19'))_0x1f86f8['push'](_0x2a883a[_0xac95('0x1a')]+_0xac95('0x1b'));return _0x1f86f8[_0xac95('0x1c')]('\x20');}function getAccessTokenScope(_0x1d34e6){if(_0x1d34e6[_0xac95('0x18')]===_0xac95('0x1d'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x1d34e6[_0xac95('0x18')]===_0xac95('0x19'))return _0x1d34e6[_0xac95('0x1a')]+_0xac95('0x1b');}function generateMicrosoftAuthorizationUrl(_0xe3b8a7,_0x1d78fc){var _0x2f09af=MICROSOFT_AUTH_URL[_0xac95('0x1e')]('{TENANT_ID}',_0xe3b8a7[_0xac95('0x1f')]);var _0x1a77d7=[_0xac95('0x20'),_0xac95('0x21')];var _0x270c38=Buffer['from'](JSON['stringify']({'id':_0x1d78fc}))['toString']('base64');var _0x5ef303=crypto[_0xac95('0x22')](0x10)[_0xac95('0x23')](_0xac95('0x24'));var _0x12e6dc=getAuthorizationScopes(_0xe3b8a7);var _0x36ca8a=[{'key':_0xac95('0x25'),'value':_0xe3b8a7[_0xac95('0x26')]},{'key':'response_type','value':encodeURIComponent(_0x1a77d7['join']('\x20'))},{'key':_0xac95('0x27'),'value':_0xe3b8a7[_0xac95('0x28')]},{'key':_0xac95('0x29'),'value':_0xac95('0x2a')},{'key':_0xac95('0x2b'),'value':encodeURIComponent(_0x12e6dc)},{'key':_0xac95('0x2c'),'value':_0x270c38},{'key':_0xac95('0x2d'),'value':_0x5ef303},{'key':_0xac95('0x2e'),'value':'login'}];var _0x17bd5f=_0x2f09af+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xac95('0x17')](_0x36ca8a,function(_0x2cfe87){return _0x2cfe87[_0xac95('0x2f')]+'='+_0x2cfe87['value'];})['join']('&');_0xe3b8a7[_0xac95('0x30')]={'issuer':_0x2f09af[_0xac95('0x1e')]('oauth2/',''),'audience':_0xe3b8a7[_0xac95('0x26')],'state':_0x270c38,'nonce':_0x5ef303};redis[_0xac95('0x31')](_0x270c38,JSON['stringify'](_0xe3b8a7));return _0x17bd5f;}function isValidIdToken(_0x2267dc,_0x55acd3){try{var _0x410535=jwt['decode'](_0x2267dc,{'complete':!![]});var _0x21793a=_0x410535[_0xac95('0x32')];if(_0x21793a[_0xac95('0x33')]!==_0x55acd3['issuer'])return![];if(_0x21793a[_0xac95('0x34')]!==_0x55acd3['audience'])return![];if(_0x21793a[_0xac95('0x2d')]!==_0x55acd3[_0xac95('0x2d')])return![];if(moment()[_0xac95('0x35')](moment[_0xac95('0x36')](_0x21793a[_0xac95('0x37')])))return![];return!![];}catch(_0x2403ec){throw _0x2403ec;}}function refreshOauth2MicrosoftAccessToken(_0x24936b){return Promise[_0xac95('0x38')]()[_0xac95('0x39')](function(){if(_0x24936b[_0xac95('0x3a')])return _0x24936b;return db[_0xac95('0x3b')][_0xac95('0x3c')]({'where':{'id':_0x24936b['id']},'raw':!![]});})[_0xac95('0x39')](function(_0x5c4a97){var _0x150916={'grant_type':_0xac95('0x3d'),'refresh_token':_0x5c4a97['data6'],'scope':getAccessTokenScope(_0x5c4a97),'redirect_uri':_0x5c4a97[_0xac95('0x28')],'client_id':_0x5c4a97['data1'],'client_secret':encryptor[_0xac95('0x3e')](_0x5c4a97[_0xac95('0x3a')])};var _0x2e1b4e={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0xac95('0x3f'),_0x5c4a97['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x150916,'json':!![]};return rp(_0x2e1b4e);})[_0xac95('0x39')](function(_0x383ebc){_0x24936b[_0xac95('0x40')]=_0x383ebc[_0xac95('0x41')];_0x24936b[_0xac95('0x42')]=_0x383ebc['refresh_token'];return db[_0xac95('0x3b')][_0xac95('0x43')]({'data5':_0x24936b[_0xac95('0x40')],'data6':_0x24936b['data6']},{'where':{'id':_0x24936b['id']}});})[_0xac95('0x39')](function(){return _0x24936b;})[_0xac95('0x44')](function(_0x3be0b1){logger['error'](_0xac95('0x45'),_0x24936b['id'],_0x3be0b1);});}function getOauth2MicrosoftAccessToken(_0x13a89c,_0x10f9ba){var _0x2c9c12={'grant_type':_0xac95('0x46'),'code':_0x13a89c,'scope':getAccessTokenScope(_0x10f9ba),'redirect_uri':_0x10f9ba[_0xac95('0x28')],'client_id':_0x10f9ba[_0xac95('0x26')],'client_secret':encryptor['decryptString'](_0x10f9ba[_0xac95('0x3a')])};var _0x517cf4={'method':_0xac95('0x47'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x10f9ba['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2c9c12,'json':!![]};return rp(_0x517cf4);}function startRefreshInterval(_0x535fd1){var _0x567b98=schedule[_0xac95('0x48')];if(_0x567b98[_0x535fd1['id']])clearInterval(_0x567b98[_0x535fd1['id']]);_0x567b98[_0x535fd1['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xac95('0x49')](this,{'id':_0x535fd1['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xac95('0x48')]=_0x567b98;}function startAllRefreshIntervals(){return db[_0xac95('0x3b')][_0xac95('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x306ebc){var _0x9ba9e0=_0x306ebc[_0xac95('0x17')](function(_0x40c1f3){return refreshOauth2MicrosoftAccessToken(_0x40c1f3)[_0xac95('0x39')](function(_0x592370){startRefreshInterval(_0x592370);});});return Promise[_0xac95('0x4b')](_0x9ba9e0);})[_0xac95('0x44')](function(_0x50d0b8){var _0xa699c9=_0x50d0b8?util[_0xac95('0x4c')](_0x50d0b8,{'showHidden':![],'depth':null}):'';logger[_0xac95('0x4d')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0xa699c9);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x496e=['access_token','data6','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','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','/authorize','/token','type','push','/.default','join','Dynamics365','data7','data2','code','id_token','toString','base64','randomBytes','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','state','login','map','key','oauth2Claims','replace','data1','stringify','decode','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','POST','{TENANT_ID}','data5'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x496e,0xa4));var _0xe496=function(_0x81ebc1,_0x3080a6){_0x81ebc1=_0x81ebc1-0x0;var _0x1b419a=_0x496e[_0x81ebc1];return _0x1b419a;};'use strict';var _=require(_0xe496('0x0'));var crypto=require(_0xe496('0x1'));var jwt=require(_0xe496('0x2'));var moment=require(_0xe496('0x3'));var Redis=require(_0xe496('0x4'));var rp=require(_0xe496('0x5'));var util=require(_0xe496('0x6'));var encryptor=require(_0xe496('0x7'));var config=require(_0xe496('0x8'));var logger=require(_0xe496('0x9'))(_0xe496('0xa'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xe496('0xb'))['db'];config[_0xe496('0xc')]=_[_0xe496('0xd')](config[_0xe496('0xc')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xe496('0xc')]);var MICROSOFT_AUTH_URL=_0xe496('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0xe496('0xf'),_0xe496('0x10'),'email',_0xe496('0x11'),_0xe496('0x12'),_0xe496('0x13'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid',_0xe496('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xe496('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0xe496('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x48135f){var _0x4cd139=_['map'](AZURE_AUTH_SCOPES[_0x48135f[_0xe496('0x16')]]);if(_0x48135f[_0xe496('0x16')]==='Dynamics365')_0x4cd139[_0xe496('0x17')](_0x48135f['data7']+_0xe496('0x18'));return _0x4cd139[_0xe496('0x19')]('\x20');}function getAccessTokenScope(_0x4980cf){if(_0x4980cf['type']==='Outlook365')return _0xe496('0x12');if(_0x4980cf[_0xe496('0x16')]===_0xe496('0x1a'))return _0x4980cf[_0xe496('0x1b')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x28872c,_0x1d8909){var _0x2b42af=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x28872c[_0xe496('0x1c')]);var _0x31eafe=[_0xe496('0x1d'),_0xe496('0x1e')];var _0x14780e=Buffer['from'](JSON['stringify']({'id':_0x1d8909}))[_0xe496('0x1f')](_0xe496('0x20'));var _0x161240=crypto[_0xe496('0x21')](0x10)[_0xe496('0x1f')](_0xe496('0x22'));var _0x1d13f=getAuthorizationScopes(_0x28872c);var _0x3386fd=[{'key':_0xe496('0x23'),'value':_0x28872c['data1']},{'key':_0xe496('0x24'),'value':encodeURIComponent(_0x31eafe['join']('\x20'))},{'key':_0xe496('0x25'),'value':_0x28872c[_0xe496('0x26')]},{'key':_0xe496('0x27'),'value':_0xe496('0x28')},{'key':'scope','value':encodeURIComponent(_0x1d13f)},{'key':_0xe496('0x29'),'value':_0x14780e},{'key':'nonce','value':_0x161240},{'key':'prompt','value':_0xe496('0x2a')}];var _0x139f66=_0x2b42af+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xe496('0x2b')](_0x3386fd,function(_0x22820d){return _0x22820d[_0xe496('0x2c')]+'='+_0x22820d['value'];})[_0xe496('0x19')]('&');_0x28872c[_0xe496('0x2d')]={'issuer':_0x2b42af[_0xe496('0x2e')]('oauth2/',''),'audience':_0x28872c[_0xe496('0x2f')],'state':_0x14780e,'nonce':_0x161240};redis['set'](_0x14780e,JSON[_0xe496('0x30')](_0x28872c));return _0x139f66;}function isValidIdToken(_0x144301,_0x502d45){try{var _0x52b6c5=jwt[_0xe496('0x31')](_0x144301,{'complete':!![]});var _0x4866bf=_0x52b6c5[_0xe496('0x32')];if(_0x4866bf[_0xe496('0x33')]!==_0x502d45[_0xe496('0x34')])return![];if(_0x4866bf[_0xe496('0x35')]!==_0x502d45[_0xe496('0x36')])return![];if(_0x4866bf[_0xe496('0x37')]!==_0x502d45[_0xe496('0x37')])return![];if(moment()[_0xe496('0x38')](moment[_0xe496('0x39')](_0x4866bf[_0xe496('0x3a')])))return![];return!![];}catch(_0x35c440){throw _0x35c440;}}function refreshOauth2MicrosoftAccessToken(_0x482205){return Promise['resolve']()[_0xe496('0x3b')](function(){if(_0x482205[_0xe496('0x3c')])return _0x482205;return db[_0xe496('0x3d')][_0xe496('0x3e')]({'where':{'id':_0x482205['id']},'raw':!![]});})[_0xe496('0x3b')](function(_0x86b9e1){var _0x2bb583={'grant_type':_0xe496('0x3f'),'refresh_token':_0x86b9e1['data6'],'scope':getAccessTokenScope(_0x86b9e1),'redirect_uri':_0x86b9e1[_0xe496('0x26')],'client_id':_0x86b9e1[_0xe496('0x2f')],'client_secret':encryptor['decryptString'](_0x86b9e1[_0xe496('0x3c')])};var _0x2307d4={'method':_0xe496('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0xe496('0x41'),_0x86b9e1[_0xe496('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2bb583,'json':!![]};return rp(_0x2307d4);})[_0xe496('0x3b')](function(_0x23b1cf){_0x482205[_0xe496('0x42')]=_0x23b1cf[_0xe496('0x43')];_0x482205[_0xe496('0x44')]=_0x23b1cf['refresh_token'];return db[_0xe496('0x3d')][_0xe496('0x45')]({'data5':_0x482205[_0xe496('0x42')],'data6':_0x482205['data6']},{'where':{'id':_0x482205['id']}});})[_0xe496('0x3b')](function(){return _0x482205;})[_0xe496('0x46')](function(_0x42953e){logger[_0xe496('0x47')](_0xe496('0x48'),_0x482205['id'],_0x42953e);});}function getOauth2MicrosoftAccessToken(_0x3d4050,_0x11540e){var _0x17a242={'grant_type':'authorization_code','code':_0x3d4050,'scope':getAccessTokenScope(_0x11540e),'redirect_uri':_0x11540e['data4'],'client_id':_0x11540e['data1'],'client_secret':encryptor['decryptString'](_0x11540e['data3'])};var _0x1ea93d={'method':_0xe496('0x40'),'uri':MICROSOFT_AUTH_URL[_0xe496('0x2e')]('{TENANT_ID}',_0x11540e[_0xe496('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x17a242,'json':!![]};return rp(_0x1ea93d);}function startRefreshInterval(_0x1662ab){var _0x57a2ac=schedule[_0xe496('0x49')];if(_0x57a2ac[_0x1662ab['id']])clearInterval(_0x57a2ac[_0x1662ab['id']]);_0x57a2ac[_0x1662ab['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xe496('0x4a')](this,{'id':_0x1662ab['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xe496('0x49')]=_0x57a2ac;}function startAllRefreshIntervals(){return db[_0xe496('0x3d')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xe496('0x3b')](function(_0x1ad2ca){var _0xdd4b8d=_0x1ad2ca[_0xe496('0x2b')](function(_0xaf925){return refreshOauth2MicrosoftAccessToken(_0xaf925)['then'](function(_0x4de648){startRefreshInterval(_0x4de648);});});return Promise['all'](_0xdd4b8d);})[_0xe496('0x46')](function(_0x2b5f9b){var _0x5c3747=_0x2b5f9b?util[_0xe496('0x4b')](_0x2b5f9b,{'showHidden':![],'depth':null}):'';logger[_0xe496('0x47')](_0xe496('0x4c'),_0x5c3747);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index f13d70e..310d711 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 _0x6f75=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6f75,0x71));var _0x56f7=function(_0x4a16b1,_0x1cab69){_0x4a16b1=_0x4a16b1-0x0;var _0x4a8084=_0x6f75[_0x4a16b1];return _0x4a8084;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var moment=require(_0x56f7('0x2'));var BPromise=require(_0x56f7('0x3'));var rs=require(_0x56f7('0x4'));var fs=require('fs');var Redis=require(_0x56f7('0x5'));var db=require(_0x56f7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x56f7('0x7'))(_0x56f7('0x8'));var config=require(_0x56f7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x137d14,_0xcc51b1,_0x4b5dcc){return new BPromise(function(_0x184bf7,_0x5155ff){return client['request'](_0x137d14,_0x4b5dcc)[_0x56f7('0xa')](function(_0x1e607c){logger[_0x56f7('0xb')](_0x56f7('0xc'),_0xcc51b1,_0x56f7('0xd'));logger[_0x56f7('0xe')](_0x56f7('0xf'),_0xcc51b1,_0x56f7('0xd'),JSON[_0x56f7('0x10')](_0x1e607c));if(_0x1e607c[_0x56f7('0x11')]){if(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x12')]===0x1f4){logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c['error'][_0x56f7('0x13')]);return _0x5155ff(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);return _0x184bf7(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0xcc51b1,_0x56f7('0xd'));_0x184bf7(_0x1e607c[_0x56f7('0x14')][_0x56f7('0x13')]);}})[_0x56f7('0x15')](function(_0x40fb77){logger[_0x56f7('0x11')]('CloudProvider,\x20%s,\x20%s',_0xcc51b1,_0x40fb77);_0x5155ff(_0x40fb77);});});} \ No newline at end of file +var _0xab75=['info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x16e824,_0x23ab90){var _0x1745ea=function(_0x327e55){while(--_0x327e55){_0x16e824['push'](_0x16e824['shift']());}};_0x1745ea(++_0x23ab90);}(_0xab75,0x11f));var _0x5ab7=function(_0x1cd226,_0x151de8){_0x1cd226=_0x1cd226-0x0;var _0x55af13=_0xab75[_0x1cd226];return _0x55af13;};'use strict';var _=require(_0x5ab7('0x0'));var util=require(_0x5ab7('0x1'));var moment=require(_0x5ab7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ab7('0x3'));var db=require(_0x5ab7('0x4'))['db'];var utils=require(_0x5ab7('0x5'));var logger=require('../../config/logger')(_0x5ab7('0x6'));var config=require(_0x5ab7('0x7'));var jayson=require(_0x5ab7('0x8'));var client=jayson[_0x5ab7('0x9')][_0x5ab7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32b338,_0x229f83,_0x368f69){return new BPromise(function(_0x365a58,_0x86468a){return client[_0x5ab7('0xb')](_0x32b338,_0x368f69)['then'](function(_0x216796){logger[_0x5ab7('0xc')]('CloudProvider,\x20%s,\x20%s',_0x229f83,_0x5ab7('0xd'));logger[_0x5ab7('0xe')](_0x5ab7('0xf'),_0x229f83,_0x5ab7('0xd'),JSON[_0x5ab7('0x10')](_0x216796));if(_0x216796['error']){if(_0x216796['error'][_0x5ab7('0x11')]===0x1f4){logger[_0x5ab7('0x12')](_0x5ab7('0x13'),_0x229f83,_0x216796[_0x5ab7('0x12')][_0x5ab7('0x14')]);return _0x86468a(_0x216796[_0x5ab7('0x12')][_0x5ab7('0x14')]);}logger[_0x5ab7('0x12')](_0x5ab7('0x13'),_0x229f83,_0x216796[_0x5ab7('0x12')][_0x5ab7('0x14')]);return _0x365a58(_0x216796['error'][_0x5ab7('0x14')]);}else{logger[_0x5ab7('0xc')](_0x5ab7('0x13'),_0x229f83,_0x5ab7('0xd'));_0x365a58(_0x216796[_0x5ab7('0x15')][_0x5ab7('0x14')]);}})[_0x5ab7('0x16')](function(_0x2a126c){logger[_0x5ab7('0x12')](_0x5ab7('0x13'),_0x229f83,_0x2a126c);_0x86468a(_0x2a126c);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index f009b03..45bb41f 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 _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(_0x1566c4,_0x2b2090){var _0x5a5f0d=function(_0x4f2bd6){while(--_0x4f2bd6){_0x1566c4['push'](_0x1566c4['shift']());}};_0x5a5f0d(++_0x2b2090);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'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 +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7a54,0x106));var _0x47a5=function(_0xd0b8f8,_0x31a7b2){_0xd0b8f8=_0xd0b8f8-0x0;var _0x52278f=_0x7a54[_0xd0b8f8];return _0x52278f;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 971b3b1..b25ef78 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 _0xedc0=['sequelize','STRING','name'];(function(_0x21f255,_0x41fa5d){var _0x56ac90=function(_0x5eb2a5){while(--_0x5eb2a5){_0x21f255['push'](_0x21f255['shift']());}};_0x56ac90(++_0x41fa5d);}(_0xedc0,0x12c));var _0x0edc=function(_0x345c86,_0x2b12e0){_0x345c86=_0x345c86-0x0;var _0x41e895=_0xedc0[_0x345c86];return _0x41e895;};'use strict';var Sequelize=require(_0x0edc('0x0'));module['exports']={'name':{'type':Sequelize[_0x0edc('0x1')],'unique':_0x0edc('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0edc('0x1')]},'companyId':{'type':Sequelize[_0x0edc('0x1')]},'website':{'type':Sequelize[_0x0edc('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x0edc('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x0edc('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0edc('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0edc('0x1')]},'sStreet':{'type':Sequelize[_0x0edc('0x1')]},'sPostalCode':{'type':Sequelize[_0x0edc('0x1')]},'sCity':{'type':Sequelize[_0x0edc('0x1')]},'sCountry':{'type':Sequelize[_0x0edc('0x1')]},'description':{'type':Sequelize[_0x0edc('0x1')]}}; \ No newline at end of file +var _0xdc52=['name','sequelize','exports','STRING'];(function(_0xc6686e,_0x52f2df){var _0xc7b8c6=function(_0x11cb0c){while(--_0x11cb0c){_0xc6686e['push'](_0xc6686e['shift']());}};_0xc7b8c6(++_0x52f2df);}(_0xdc52,0x1bd));var _0x2dc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc52[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2dc5('0x0'));module[_0x2dc5('0x1')]={'name':{'type':Sequelize[_0x2dc5('0x2')],'unique':_0x2dc5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2dc5('0x2')]},'companyId':{'type':Sequelize[_0x2dc5('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x2dc5('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2dc5('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x2dc5('0x2')]},'country':{'type':Sequelize[_0x2dc5('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2dc5('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x2dc5('0x2')]},'sCity':{'type':Sequelize[_0x2dc5('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2dc5('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 2dd4c8a..a9e1eb9 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 _0xe67d=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Companies','sendStatus','stack','name','send','index','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','CmCompany','include','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addContacts','CmContact','ids','findOne','rawAttributes','filter','map','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x5ece84,_0xc06c9f){var _0x2a12c4=function(_0x133bf3){while(--_0x133bf3){_0x5ece84['push'](_0x5ece84['shift']());}};_0x2a12c4(++_0xc06c9f);}(_0xe67d,0x10a));var _0xde67=function(_0x2a2799,_0x5e25a8){_0x2a2799=_0x2a2799-0x0;var _0x17f761=_0xe67d[_0x2a2799];return _0x17f761;};'use strict';var emlformat=require(_0xde67('0x0'));var rimraf=require(_0xde67('0x1'));var zipdir=require(_0xde67('0x2'));var jsonpatch=require(_0xde67('0x3'));var rp=require('request-promise');var moment=require(_0xde67('0x4'));var BPromise=require(_0xde67('0x5'));var Mustache=require(_0xde67('0x6'));var util=require(_0xde67('0x7'));var path=require(_0xde67('0x8'));var sox=require(_0xde67('0x9'));var csv=require(_0xde67('0xa'));var ejs=require(_0xde67('0xb'));var fs=require('fs');var fs_extra=require(_0xde67('0xc'));var _=require(_0xde67('0xd'));var squel=require(_0xde67('0xe'));var crypto=require(_0xde67('0xf'));var jsforce=require(_0xde67('0x10'));var deskjs=require(_0xde67('0x11'));var toCsv=require(_0xde67('0xa'));var querystring=require(_0xde67('0x12'));var Papa=require(_0xde67('0x13'));var Redis=require(_0xde67('0x14'));var authService=require(_0xde67('0x15'));var qs=require(_0xde67('0x16'));var as=require(_0xde67('0x17'));var hardwareService=require(_0xde67('0x18'));var logger=require(_0xde67('0x19'))('api');var utils=require('../../config/utils');var config=require(_0xde67('0x1a'));var licenseUtil=require(_0xde67('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35c819,_0x5724c7){_0x5724c7=_0x5724c7||0xcc;return function(_0x352609){if(_0x352609){return _0x35c819['sendStatus'](_0x5724c7);}return _0x35c819[_0xde67('0x1c')](_0x5724c7)[_0xde67('0x1d')]();};}function respondWithResult(_0x1e457f,_0x3c7fb9){_0x3c7fb9=_0x3c7fb9||0xc8;return function(_0x2626dd){if(_0x2626dd){return _0x1e457f[_0xde67('0x1c')](_0x3c7fb9)[_0xde67('0x1e')](_0x2626dd);}};}function respondWithFilteredResult(_0x32c88b,_0x524d49){return function(_0x1e84d3){if(_0x1e84d3){var _0x24e030=typeof _0x524d49[_0xde67('0x1f')]===_0xde67('0x20')&&typeof _0x524d49[_0xde67('0x21')]===_0xde67('0x20');var _0x5cf697=_0x1e84d3[_0xde67('0x22')];var _0x2b9c67=_0x24e030?0x0:_0x524d49['offset'];var _0x39e0f6=_0x24e030?_0x1e84d3[_0xde67('0x22')]:_0x524d49[_0xde67('0x1f')]+_0x524d49[_0xde67('0x21')];var _0x4ede17;if(_0x39e0f6>=_0x5cf697){_0x39e0f6=_0x5cf697;_0x4ede17=0xc8;}else{_0x4ede17=0xce;}_0x32c88b[_0xde67('0x1c')](_0x4ede17);return _0x32c88b[_0xde67('0x23')](_0xde67('0x24'),_0x2b9c67+'-'+_0x39e0f6+'/'+_0x5cf697)[_0xde67('0x1e')](_0x1e84d3);}return null;};}function patchUpdates(_0x342201){return function(_0x23ea6e){try{jsonpatch[_0xde67('0x25')](_0x23ea6e,_0x342201,!![]);}catch(_0x4f2620){return BPromise[_0xde67('0x26')](_0x4f2620);}return _0x23ea6e[_0xde67('0x27')]();};}function saveUpdates(_0xff2873,_0x46b52c){return function(_0x37f1c2){if(_0x37f1c2){return _0x37f1c2['update'](_0xff2873)[_0xde67('0x28')](function(_0x29eb48){return _0x29eb48;});}return null;};}function removeEntity(_0x131f95,_0x2ad565){return function(_0x5cd028){if(_0x5cd028){return _0x5cd028[_0xde67('0x29')]()[_0xde67('0x28')](function(){var _0x52cf88=_0x5cd028[_0xde67('0x2a')]({'plain':!![]});var _0x140e15=_0xde67('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x140e15,'resourceId':_0x52cf88['id']}})[_0xde67('0x28')](function(){return _0x5cd028;});})[_0xde67('0x28')](function(){_0x131f95[_0xde67('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40a608,_0x959dba){return function(_0x25b442){if(!_0x25b442){_0x40a608[_0xde67('0x2c')](0x194);}return _0x25b442;};}function handleError(_0x8d1489,_0x768bb1){_0x768bb1=_0x768bb1||0x1f4;return function(_0x8e8e7f){logger['error'](_0x8e8e7f[_0xde67('0x2d')]);if(_0x8e8e7f[_0xde67('0x2e')]){delete _0x8e8e7f['name'];}_0x8d1489['status'](_0x768bb1)[_0xde67('0x2f')](_0x8e8e7f);};}exports[_0xde67('0x30')]=function(_0x2c20e3,_0x5b5931){var _0x8698f5={},_0x4204ef={},_0x198980={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0xde67('0x28')](function(_0x349442){_0x4204ef[_0xde67('0x31')]=_[_0xde67('0x32')](_0x349442);_0x4204ef[_0xde67('0x33')]=_[_0xde67('0x32')](_0x2c20e3['query']);_0x4204ef[_0xde67('0x34')]=_['intersection'](_0x4204ef[_0xde67('0x31')],_0x4204ef[_0xde67('0x33')]);_0x8698f5[_0xde67('0x35')]=_[_0xde67('0x36')](_0x4204ef[_0xde67('0x31')],qs['fields'](_0x2c20e3[_0xde67('0x33')][_0xde67('0x37')]));_0x8698f5[_0xde67('0x35')]=_0x8698f5[_0xde67('0x35')][_0xde67('0x38')]?_0x8698f5[_0xde67('0x35')]:_0x4204ef[_0xde67('0x31')];if(!_0x2c20e3['query'][_0xde67('0x39')](_0xde67('0x3a'))){_0x8698f5[_0xde67('0x21')]=qs[_0xde67('0x21')](_0x2c20e3[_0xde67('0x33')][_0xde67('0x21')]);_0x8698f5[_0xde67('0x1f')]=qs[_0xde67('0x1f')](_0x2c20e3['query']['offset']);}_0x8698f5[_0xde67('0x3b')]=qs[_0xde67('0x3c')](_0x2c20e3['query'][_0xde67('0x3c')]);_0x8698f5['where']=qs['filters'](_[_0xde67('0x3d')](_0x2c20e3[_0xde67('0x33')],_0x4204ef['filters']),_0x349442);if(_0x2c20e3[_0xde67('0x33')]['filter']){_0x8698f5[_0xde67('0x3e')]=_[_0xde67('0x3f')](_0x8698f5[_0xde67('0x3e')],{'$or':_['map'](_0x8698f5[_0xde67('0x35')],function(_0x5c54fd){var _0x564f09={};_0x564f09[_0x5c54fd]={'$like':'%'+_0x2c20e3[_0xde67('0x33')]['filter']+'%'};return _0x564f09;})});}_0x8698f5=_[_0xde67('0x3f')]({},_0x8698f5,_0x2c20e3[_0xde67('0x40')]);var _0x251ee2={'where':_0x8698f5['where']};return db[_0xde67('0x41')]['count'](_0x251ee2)[_0xde67('0x28')](function(_0x301400){_0x198980[_0xde67('0x22')]=_0x301400;if(_0x2c20e3[_0xde67('0x33')]['includeAll']){_0x8698f5[_0xde67('0x42')]=[{'all':!![]}];}return db[_0xde67('0x41')]['findAll'](_0x8698f5);})[_0xde67('0x28')](function(_0x2c9265){_0x198980[_0xde67('0x43')]=_0x2c9265;return _0x198980;})[_0xde67('0x28')](respondWithFilteredResult(_0x5b5931,_0x8698f5))[_0xde67('0x44')](handleError(_0x5b5931,null));})[_0xde67('0x44')](handleError(_0x5b5931,null));};exports[_0xde67('0x45')]=function(_0x3e3776,_0x3dc83f){var _0x48b75e={'raw':![],'where':{'id':_0x3e3776[_0xde67('0x46')]['id']}},_0x5417ea={};_0x5417ea[_0xde67('0x31')]=_[_0xde67('0x32')](db[_0xde67('0x41')]['rawAttributes']);_0x5417ea[_0xde67('0x33')]=_[_0xde67('0x32')](_0x3e3776[_0xde67('0x33')]);_0x5417ea[_0xde67('0x34')]=_[_0xde67('0x36')](_0x5417ea['model'],_0x5417ea[_0xde67('0x33')]);_0x48b75e[_0xde67('0x35')]=_[_0xde67('0x36')](_0x5417ea[_0xde67('0x31')],qs[_0xde67('0x37')](_0x3e3776[_0xde67('0x33')][_0xde67('0x37')]));_0x48b75e['attributes']=_0x48b75e[_0xde67('0x35')][_0xde67('0x38')]?_0x48b75e[_0xde67('0x35')]:_0x5417ea['model'];if(_0x3e3776['query'][_0xde67('0x47')]){_0x48b75e[_0xde67('0x42')]=[{'all':!![]}];}_0x48b75e=_['merge']({},_0x48b75e,_0x3e3776[_0xde67('0x40')]);return db[_0xde67('0x41')][_0xde67('0x48')](_0x48b75e)[_0xde67('0x28')](handleEntityNotFound(_0x3dc83f,null))[_0xde67('0x28')](respondWithResult(_0x3dc83f,null))['catch'](handleError(_0x3dc83f,null));};exports['create']=function(_0x2e8e19,_0x583e59){return db[_0xde67('0x41')][_0xde67('0x49')](_0x2e8e19[_0xde67('0x4a')],{})[_0xde67('0x28')](function(_0x5a6419){var _0x3b49c7=_0x2e8e19['user'][_0xde67('0x2a')]({'plain':!![]});if(!_0x3b49c7)throw new Error(_0xde67('0x4b'));if(_0x3b49c7['role']===_0xde67('0x4c')){var _0x3b72f8=_0x5a6419[_0xde67('0x2a')]({'plain':!![]});var _0x2dbdb9=_0xde67('0x2b');return db[_0xde67('0x4d')]['find']({'where':{'name':_0x2dbdb9,'userProfileId':_0x3b49c7[_0xde67('0x4e')]},'raw':!![]})['then'](function(_0x174814){if(_0x174814&&_0x174814['autoAssociation']===0x0){return db['UserProfileResource'][_0xde67('0x49')]({'name':_0x3b72f8[_0xde67('0x2e')],'resourceId':_0x3b72f8['id'],'type':_0x174814[_0xde67('0x2e')],'sectionId':_0x174814['id']},{})[_0xde67('0x28')](function(){return _0x5a6419;});}else{return _0x5a6419;}})[_0xde67('0x44')](function(_0x40ee4c){logger[_0xde67('0x4f')](_0xde67('0x50'),_0x40ee4c);throw _0x40ee4c;});}return _0x5a6419;})[_0xde67('0x28')](respondWithResult(_0x583e59,0xc9))[_0xde67('0x44')](handleError(_0x583e59,null));};exports[_0xde67('0x51')]=function(_0x293f34,_0x189659){if(_0x293f34[_0xde67('0x4a')]['id']){delete _0x293f34[_0xde67('0x4a')]['id'];}return db[_0xde67('0x41')]['find']({'where':{'id':_0x293f34[_0xde67('0x46')]['id']}})[_0xde67('0x28')](handleEntityNotFound(_0x189659,null))[_0xde67('0x28')](saveUpdates(_0x293f34[_0xde67('0x4a')],null))[_0xde67('0x28')](respondWithResult(_0x189659,null))[_0xde67('0x44')](handleError(_0x189659,null));};exports[_0xde67('0x29')]=function(_0x407155,_0x3bcd3f){return db[_0xde67('0x41')][_0xde67('0x48')]({'where':{'id':_0x407155['params']['id']}})['then'](handleEntityNotFound(_0x3bcd3f,null))['then'](removeEntity(_0x3bcd3f,null))[_0xde67('0x44')](handleError(_0x3bcd3f,null));};exports['describe']=function(_0x34518c,_0x3039e4){return db[_0xde67('0x41')][_0xde67('0x52')]()[_0xde67('0x28')](respondWithResult(_0x3039e4,null))[_0xde67('0x44')](handleError(_0x3039e4,null));};exports[_0xde67('0x53')]=function(_0x4fd335,_0x1aa1c8,_0x3c3914){return db[_0xde67('0x54')]['find']({'where':{'id':_0x4fd335[_0xde67('0x46')]['id']}})[_0xde67('0x28')](handleEntityNotFound(_0x1aa1c8,null))['then'](function(_0x38eb9f){if(_0x38eb9f){return _0x38eb9f['addContacts'](_0x4fd335[_0xde67('0x4a')][_0xde67('0x55')],_['omit'](_0x4fd335['body'],[_0xde67('0x55'),'id'])||{});}})[_0xde67('0x28')](respondWithResult(_0x1aa1c8,null))['catch'](handleError(_0x1aa1c8,null));};exports['getContacts']=function(_0x247936,_0x280142,_0x2d86e8){var _0x545ac1={};var _0x1ad45c={};var _0x4a4c95;var _0x2fbc83;return db[_0xde67('0x41')][_0xde67('0x56')]({'where':{'id':_0x247936[_0xde67('0x46')]['id']}})[_0xde67('0x28')](handleEntityNotFound(_0x280142,null))[_0xde67('0x28')](function(_0x311e13){if(_0x311e13){_0x4a4c95=_0x311e13;_0x1ad45c[_0xde67('0x31')]=_[_0xde67('0x32')](db['CmContact'][_0xde67('0x57')]);_0x1ad45c[_0xde67('0x33')]=_['keys'](_0x247936['query']);_0x1ad45c['filters']=_['intersection'](_0x1ad45c['model'],_0x1ad45c[_0xde67('0x33')]);_0x545ac1['attributes']=_[_0xde67('0x36')](_0x1ad45c[_0xde67('0x31')],qs[_0xde67('0x37')](_0x247936['query'][_0xde67('0x37')]));_0x545ac1['attributes']=_0x545ac1[_0xde67('0x35')]['length']?_0x545ac1[_0xde67('0x35')]:_0x1ad45c[_0xde67('0x31')];_0x545ac1[_0xde67('0x3b')]=qs[_0xde67('0x3c')](_0x247936['query'][_0xde67('0x3c')]);_0x545ac1['where']=qs['filters'](_[_0xde67('0x3d')](_0x247936[_0xde67('0x33')],_0x1ad45c['filters']));if(_0x247936['query'][_0xde67('0x58')]){_0x545ac1[_0xde67('0x3e')]=_['merge'](_0x545ac1[_0xde67('0x3e')],{'$or':_[_0xde67('0x59')](_0x545ac1['attributes'],function(_0x1122c2){var _0x589eb0={};_0x589eb0[_0x1122c2]={'$like':'%'+_0x247936['query'][_0xde67('0x58')]+'%'};return _0x589eb0;})});}_0x545ac1=_['merge']({},_0x545ac1,_0x247936[_0xde67('0x40')]);return _0x4a4c95[_0xde67('0x5a')](_0x545ac1);}})[_0xde67('0x28')](function(_0xa7ef23){if(_0xa7ef23){_0x2fbc83=_0xa7ef23[_0xde67('0x38')];if(!_0x247936[_0xde67('0x33')][_0xde67('0x39')](_0xde67('0x3a'))){_0x545ac1[_0xde67('0x21')]=qs[_0xde67('0x21')](_0x247936[_0xde67('0x33')][_0xde67('0x21')]);_0x545ac1['offset']=qs['offset'](_0x247936[_0xde67('0x33')][_0xde67('0x1f')]);}return _0x4a4c95[_0xde67('0x5a')](_0x545ac1);}})[_0xde67('0x28')](function(_0x47314d){if(_0x47314d){return _0x47314d?{'count':_0x2fbc83,'rows':_0x47314d}:null;}})['then'](respondWithResult(_0x280142,null))[_0xde67('0x44')](handleError(_0x280142,null));}; \ No newline at end of file +var _0xfad6=['order','sort','where','pick','filter','map','options','CmCompany','include','findAll','rows','catch','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','addContacts','CmContact','ids','getContacts','merge','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','describe','model','keys','query','filters','attributes','intersection','fields','length','nolimit'];(function(_0x1b7bb2,_0x1a4932){var _0x3928f4=function(_0x328c3b){while(--_0x328c3b){_0x1b7bb2['push'](_0x1b7bb2['shift']());}};_0x3928f4(++_0x1a4932);}(_0xfad6,0x71));var _0x6fad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfad6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6fad('0x0'));var rimraf=require(_0x6fad('0x1'));var zipdir=require(_0x6fad('0x2'));var jsonpatch=require(_0x6fad('0x3'));var rp=require('request-promise');var moment=require(_0x6fad('0x4'));var BPromise=require(_0x6fad('0x5'));var Mustache=require('mustache');var util=require(_0x6fad('0x6'));var path=require(_0x6fad('0x7'));var sox=require(_0x6fad('0x8'));var csv=require(_0x6fad('0x9'));var ejs=require(_0x6fad('0xa'));var fs=require('fs');var fs_extra=require(_0x6fad('0xb'));var _=require(_0x6fad('0xc'));var squel=require(_0x6fad('0xd'));var crypto=require(_0x6fad('0xe'));var jsforce=require(_0x6fad('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6fad('0x9'));var querystring=require(_0x6fad('0x10'));var Papa=require(_0x6fad('0x11'));var Redis=require(_0x6fad('0x12'));var authService=require(_0x6fad('0x13'));var qs=require(_0x6fad('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6fad('0x15'));var logger=require('../../config/logger')(_0x6fad('0x16'));var utils=require(_0x6fad('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6fad('0x18'));var db=require(_0x6fad('0x19'))['db'];function respondWithStatusCode(_0x8ac672,_0x254200){_0x254200=_0x254200||0xcc;return function(_0xaa3358){if(_0xaa3358){return _0x8ac672[_0x6fad('0x1a')](_0x254200);}return _0x8ac672[_0x6fad('0x1b')](_0x254200)[_0x6fad('0x1c')]();};}function respondWithResult(_0xb1cd08,_0x512bf0){_0x512bf0=_0x512bf0||0xc8;return function(_0x593bd0){if(_0x593bd0){return _0xb1cd08[_0x6fad('0x1b')](_0x512bf0)[_0x6fad('0x1d')](_0x593bd0);}};}function respondWithFilteredResult(_0x995286,_0x31c06f){return function(_0xabc9d6){if(_0xabc9d6){var _0x103192=typeof _0x31c06f[_0x6fad('0x1e')]===_0x6fad('0x1f')&&typeof _0x31c06f[_0x6fad('0x20')]===_0x6fad('0x1f');var _0x314052=_0xabc9d6[_0x6fad('0x21')];var _0x20c843=_0x103192?0x0:_0x31c06f[_0x6fad('0x1e')];var _0x1df43a=_0x103192?_0xabc9d6['count']:_0x31c06f['offset']+_0x31c06f['limit'];var _0x385aaa;if(_0x1df43a>=_0x314052){_0x1df43a=_0x314052;_0x385aaa=0xc8;}else{_0x385aaa=0xce;}_0x995286[_0x6fad('0x1b')](_0x385aaa);return _0x995286[_0x6fad('0x22')]('Content-Range',_0x20c843+'-'+_0x1df43a+'/'+_0x314052)[_0x6fad('0x1d')](_0xabc9d6);}return null;};}function patchUpdates(_0x477e44){return function(_0x5218e3){try{jsonpatch['apply'](_0x5218e3,_0x477e44,!![]);}catch(_0x4ffa8c){return BPromise[_0x6fad('0x23')](_0x4ffa8c);}return _0x5218e3[_0x6fad('0x24')]();};}function saveUpdates(_0x15cff5,_0xc56715){return function(_0x3ddf4f){if(_0x3ddf4f){return _0x3ddf4f[_0x6fad('0x25')](_0x15cff5)[_0x6fad('0x26')](function(_0x4a7011){return _0x4a7011;});}return null;};}function removeEntity(_0x3ffa0c,_0xdb9a2a){return function(_0x38d5f2){if(_0x38d5f2){return _0x38d5f2[_0x6fad('0x27')]()[_0x6fad('0x26')](function(){var _0x31295d=_0x38d5f2[_0x6fad('0x28')]({'plain':!![]});var _0x22fb43='Companies';return db[_0x6fad('0x29')][_0x6fad('0x27')]({'where':{'type':_0x22fb43,'resourceId':_0x31295d['id']}})[_0x6fad('0x26')](function(){return _0x38d5f2;});})[_0x6fad('0x26')](function(){_0x3ffa0c[_0x6fad('0x1b')](0xcc)[_0x6fad('0x1c')]();});}};}function handleEntityNotFound(_0x522916,_0x5d53fb){return function(_0x590b1e){if(!_0x590b1e){_0x522916[_0x6fad('0x1a')](0x194);}return _0x590b1e;};}function handleError(_0x1b87bb,_0x1365fe){_0x1365fe=_0x1365fe||0x1f4;return function(_0x2035ce){logger[_0x6fad('0x2a')](_0x2035ce['stack']);if(_0x2035ce[_0x6fad('0x2b')]){delete _0x2035ce[_0x6fad('0x2b')];}_0x1b87bb[_0x6fad('0x1b')](_0x1365fe)[_0x6fad('0x2c')](_0x2035ce);};}exports['index']=function(_0x4f9d4f,_0x4b23db){var _0x39ff9f={},_0x11e4db={},_0x219047={'count':0x0,'rows':[]};return db['CmCompany'][_0x6fad('0x2d')]()[_0x6fad('0x26')](function(_0x41ed07){_0x11e4db[_0x6fad('0x2e')]=_[_0x6fad('0x2f')](_0x41ed07);_0x11e4db[_0x6fad('0x30')]=_[_0x6fad('0x2f')](_0x4f9d4f['query']);_0x11e4db[_0x6fad('0x31')]=_['intersection'](_0x11e4db[_0x6fad('0x2e')],_0x11e4db[_0x6fad('0x30')]);_0x39ff9f[_0x6fad('0x32')]=_[_0x6fad('0x33')](_0x11e4db[_0x6fad('0x2e')],qs[_0x6fad('0x34')](_0x4f9d4f[_0x6fad('0x30')][_0x6fad('0x34')]));_0x39ff9f[_0x6fad('0x32')]=_0x39ff9f[_0x6fad('0x32')][_0x6fad('0x35')]?_0x39ff9f[_0x6fad('0x32')]:_0x11e4db[_0x6fad('0x2e')];if(!_0x4f9d4f['query']['hasOwnProperty'](_0x6fad('0x36'))){_0x39ff9f[_0x6fad('0x20')]=qs[_0x6fad('0x20')](_0x4f9d4f[_0x6fad('0x30')][_0x6fad('0x20')]);_0x39ff9f[_0x6fad('0x1e')]=qs[_0x6fad('0x1e')](_0x4f9d4f[_0x6fad('0x30')][_0x6fad('0x1e')]);}_0x39ff9f[_0x6fad('0x37')]=qs['sort'](_0x4f9d4f[_0x6fad('0x30')][_0x6fad('0x38')]);_0x39ff9f[_0x6fad('0x39')]=qs['filters'](_[_0x6fad('0x3a')](_0x4f9d4f[_0x6fad('0x30')],_0x11e4db[_0x6fad('0x31')]),_0x41ed07);if(_0x4f9d4f[_0x6fad('0x30')][_0x6fad('0x3b')]){_0x39ff9f['where']=_['merge'](_0x39ff9f[_0x6fad('0x39')],{'$or':_[_0x6fad('0x3c')](_0x39ff9f[_0x6fad('0x32')],function(_0x205ddb){var _0x3df75d={};_0x3df75d[_0x205ddb]={'$like':'%'+_0x4f9d4f[_0x6fad('0x30')][_0x6fad('0x3b')]+'%'};return _0x3df75d;})});}_0x39ff9f=_['merge']({},_0x39ff9f,_0x4f9d4f[_0x6fad('0x3d')]);var _0x3a7701={'where':_0x39ff9f[_0x6fad('0x39')]};return db[_0x6fad('0x3e')][_0x6fad('0x21')](_0x3a7701)[_0x6fad('0x26')](function(_0x56d15e){_0x219047['count']=_0x56d15e;if(_0x4f9d4f[_0x6fad('0x30')]['includeAll']){_0x39ff9f[_0x6fad('0x3f')]=[{'all':!![]}];}return db[_0x6fad('0x3e')][_0x6fad('0x40')](_0x39ff9f);})[_0x6fad('0x26')](function(_0x2c6d84){_0x219047[_0x6fad('0x41')]=_0x2c6d84;return _0x219047;})['then'](respondWithFilteredResult(_0x4b23db,_0x39ff9f))['catch'](handleError(_0x4b23db,null));})[_0x6fad('0x42')](handleError(_0x4b23db,null));};exports['show']=function(_0x3d2718,_0x4c9a56){var _0x4b70da={'raw':![],'where':{'id':_0x3d2718['params']['id']}},_0x292a00={};_0x292a00[_0x6fad('0x2e')]=_['keys'](db['CmCompany'][_0x6fad('0x43')]);_0x292a00['query']=_[_0x6fad('0x2f')](_0x3d2718['query']);_0x292a00['filters']=_[_0x6fad('0x33')](_0x292a00[_0x6fad('0x2e')],_0x292a00['query']);_0x4b70da[_0x6fad('0x32')]=_['intersection'](_0x292a00[_0x6fad('0x2e')],qs[_0x6fad('0x34')](_0x3d2718[_0x6fad('0x30')][_0x6fad('0x34')]));_0x4b70da[_0x6fad('0x32')]=_0x4b70da['attributes'][_0x6fad('0x35')]?_0x4b70da[_0x6fad('0x32')]:_0x292a00[_0x6fad('0x2e')];if(_0x3d2718['query'][_0x6fad('0x44')]){_0x4b70da['include']=[{'all':!![]}];}_0x4b70da=_['merge']({},_0x4b70da,_0x3d2718[_0x6fad('0x3d')]);return db[_0x6fad('0x3e')][_0x6fad('0x45')](_0x4b70da)[_0x6fad('0x26')](handleEntityNotFound(_0x4c9a56,null))[_0x6fad('0x26')](respondWithResult(_0x4c9a56,null))[_0x6fad('0x42')](handleError(_0x4c9a56,null));};exports[_0x6fad('0x46')]=function(_0x34daf8,_0x49682b){return db[_0x6fad('0x3e')]['create'](_0x34daf8[_0x6fad('0x47')],{})[_0x6fad('0x26')](function(_0x80f737){var _0x2016ca=_0x34daf8[_0x6fad('0x48')][_0x6fad('0x28')]({'plain':!![]});if(!_0x2016ca)throw new Error(_0x6fad('0x49'));if(_0x2016ca['role']===_0x6fad('0x48')){var _0xec8edc=_0x80f737['get']({'plain':!![]});var _0x4fd00d='Companies';return db[_0x6fad('0x4a')][_0x6fad('0x45')]({'where':{'name':_0x4fd00d,'userProfileId':_0x2016ca[_0x6fad('0x4b')]},'raw':!![]})['then'](function(_0x26fea4){if(_0x26fea4&&_0x26fea4[_0x6fad('0x4c')]===0x0){return db[_0x6fad('0x29')][_0x6fad('0x46')]({'name':_0xec8edc[_0x6fad('0x2b')],'resourceId':_0xec8edc['id'],'type':_0x26fea4[_0x6fad('0x2b')],'sectionId':_0x26fea4['id']},{})[_0x6fad('0x26')](function(){return _0x80f737;});}else{return _0x80f737;}})[_0x6fad('0x42')](function(_0x29ff31){logger[_0x6fad('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29ff31);throw _0x29ff31;});}return _0x80f737;})[_0x6fad('0x26')](respondWithResult(_0x49682b,0xc9))['catch'](handleError(_0x49682b,null));};exports['update']=function(_0x59ad52,_0x522d43){if(_0x59ad52['body']['id']){delete _0x59ad52[_0x6fad('0x47')]['id'];}return db['CmCompany'][_0x6fad('0x45')]({'where':{'id':_0x59ad52[_0x6fad('0x4d')]['id']}})[_0x6fad('0x26')](handleEntityNotFound(_0x522d43,null))['then'](saveUpdates(_0x59ad52[_0x6fad('0x47')],null))['then'](respondWithResult(_0x522d43,null))['catch'](handleError(_0x522d43,null));};exports[_0x6fad('0x27')]=function(_0x574e09,_0x114910){return db[_0x6fad('0x3e')][_0x6fad('0x45')]({'where':{'id':_0x574e09[_0x6fad('0x4d')]['id']}})[_0x6fad('0x26')](handleEntityNotFound(_0x114910,null))[_0x6fad('0x26')](removeEntity(_0x114910,null))[_0x6fad('0x42')](handleError(_0x114910,null));};exports[_0x6fad('0x2d')]=function(_0x4f33cd,_0x23de51){return db['CmCompany'][_0x6fad('0x2d')]()[_0x6fad('0x26')](respondWithResult(_0x23de51,null))['catch'](handleError(_0x23de51,null));};exports[_0x6fad('0x4e')]=function(_0x6a16ec,_0x3c8f11,_0x56b309){return db[_0x6fad('0x4f')][_0x6fad('0x45')]({'where':{'id':_0x6a16ec[_0x6fad('0x4d')]['id']}})[_0x6fad('0x26')](handleEntityNotFound(_0x3c8f11,null))[_0x6fad('0x26')](function(_0x1c4d23){if(_0x1c4d23){return _0x1c4d23[_0x6fad('0x4e')](_0x6a16ec[_0x6fad('0x47')][_0x6fad('0x50')],_['omit'](_0x6a16ec[_0x6fad('0x47')],[_0x6fad('0x50'),'id'])||{});}})[_0x6fad('0x26')](respondWithResult(_0x3c8f11,null))[_0x6fad('0x42')](handleError(_0x3c8f11,null));};exports[_0x6fad('0x51')]=function(_0x34c23e,_0x363346,_0x1a1ef1){var _0x3a06c3={};var _0x194864={};var _0x432367;var _0x651be6;return db[_0x6fad('0x3e')]['findOne']({'where':{'id':_0x34c23e[_0x6fad('0x4d')]['id']}})['then'](handleEntityNotFound(_0x363346,null))[_0x6fad('0x26')](function(_0x20ddea){if(_0x20ddea){_0x432367=_0x20ddea;_0x194864[_0x6fad('0x2e')]=_[_0x6fad('0x2f')](db['CmContact'][_0x6fad('0x43')]);_0x194864[_0x6fad('0x30')]=_['keys'](_0x34c23e['query']);_0x194864['filters']=_[_0x6fad('0x33')](_0x194864[_0x6fad('0x2e')],_0x194864[_0x6fad('0x30')]);_0x3a06c3[_0x6fad('0x32')]=_['intersection'](_0x194864[_0x6fad('0x2e')],qs[_0x6fad('0x34')](_0x34c23e[_0x6fad('0x30')][_0x6fad('0x34')]));_0x3a06c3[_0x6fad('0x32')]=_0x3a06c3['attributes'][_0x6fad('0x35')]?_0x3a06c3[_0x6fad('0x32')]:_0x194864['model'];_0x3a06c3['order']=qs['sort'](_0x34c23e[_0x6fad('0x30')][_0x6fad('0x38')]);_0x3a06c3[_0x6fad('0x39')]=qs[_0x6fad('0x31')](_[_0x6fad('0x3a')](_0x34c23e[_0x6fad('0x30')],_0x194864[_0x6fad('0x31')]));if(_0x34c23e[_0x6fad('0x30')][_0x6fad('0x3b')]){_0x3a06c3['where']=_[_0x6fad('0x52')](_0x3a06c3[_0x6fad('0x39')],{'$or':_[_0x6fad('0x3c')](_0x3a06c3[_0x6fad('0x32')],function(_0x5a303a){var _0x453b0f={};_0x453b0f[_0x5a303a]={'$like':'%'+_0x34c23e[_0x6fad('0x30')]['filter']+'%'};return _0x453b0f;})});}_0x3a06c3=_[_0x6fad('0x52')]({},_0x3a06c3,_0x34c23e[_0x6fad('0x3d')]);return _0x432367['getContacts'](_0x3a06c3);}})[_0x6fad('0x26')](function(_0x102979){if(_0x102979){_0x651be6=_0x102979[_0x6fad('0x35')];if(!_0x34c23e['query'][_0x6fad('0x53')](_0x6fad('0x36'))){_0x3a06c3[_0x6fad('0x20')]=qs[_0x6fad('0x20')](_0x34c23e[_0x6fad('0x30')][_0x6fad('0x20')]);_0x3a06c3[_0x6fad('0x1e')]=qs[_0x6fad('0x1e')](_0x34c23e['query'][_0x6fad('0x1e')]);}return _0x432367[_0x6fad('0x51')](_0x3a06c3);}})['then'](function(_0x3902ef){if(_0x3902ef){return _0x3902ef?{'count':_0x651be6,'rows':_0x3902ef}:null;}})[_0x6fad('0x26')](respondWithResult(_0x363346,null))[_0x6fad('0x42')](handleError(_0x363346,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 4b16fbf..4fd7359 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 _0x6ef4=['request-promise','exports','CmCompany','cm_companies','util','../../config/logger','api','moment','bluebird'];(function(_0xdfaffd,_0x3b232e){var _0x3d71a4=function(_0x3d094d){while(--_0x3d094d){_0xdfaffd['push'](_0xdfaffd['shift']());}};_0x3d71a4(++_0x3b232e);}(_0x6ef4,0x8b));var _0x46ef=function(_0x105c72,_0x52c05a){_0x105c72=_0x105c72-0x0;var _0x367c23=_0x6ef4[_0x105c72];return _0x367c23;};'use strict';var _=require('lodash');var util=require(_0x46ef('0x0'));var logger=require(_0x46ef('0x1'))(_0x46ef('0x2'));var moment=require(_0x46ef('0x3'));var BPromise=require(_0x46ef('0x4'));var rp=require(_0x46ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x46ef('0x6')]=function(_0x1400c4,_0x1ee87d){return _0x1400c4['define'](_0x46ef('0x7'),attributes,{'tableName':_0x46ef('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50c1=['bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','../../config/logger','moment'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x50c1,0x17e));var _0x150c=function(_0x648e60,_0x54e47e){_0x648e60=_0x648e60-0x0;var _0x3dd4c9=_0x50c1[_0x648e60];return _0x3dd4c9;};'use strict';var _=require(_0x150c('0x0'));var util=require('util');var logger=require(_0x150c('0x1'))('api');var moment=require(_0x150c('0x2'));var BPromise=require(_0x150c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x150c('0x4'));var rimraf=require(_0x150c('0x5'));var config=require(_0x150c('0x6'));var attributes=require(_0x150c('0x7'));module[_0x150c('0x8')]=function(_0x2ca8df,_0x14f961){return _0x2ca8df[_0x150c('0x9')](_0x150c('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index cb3fee3..b89f641 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 _0xb270=['then','info','request\x20sent','debug','stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0xb270,0xd1));var _0x0b27=function(_0x2cde51,_0x41b85c){_0x2cde51=_0x2cde51-0x0;var _0x37177e=_0xb270[_0x2cde51];return _0x37177e;};'use strict';var _=require(_0x0b27('0x0'));var util=require(_0x0b27('0x1'));var moment=require(_0x0b27('0x2'));var BPromise=require(_0x0b27('0x3'));var rs=require(_0x0b27('0x4'));var fs=require('fs');var Redis=require(_0x0b27('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0b27('0x6'));var logger=require(_0x0b27('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0b27('0x8'));var client=jayson['client'][_0x0b27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x260ece,_0x48cf67,_0x5c3816){return new BPromise(function(_0x7f60a1,_0xb4f180){return client[_0x0b27('0xa')](_0x260ece,_0x5c3816)[_0x0b27('0xb')](function(_0x59b361){logger[_0x0b27('0xc')]('CmCompany,\x20%s,\x20%s',_0x48cf67,_0x0b27('0xd'));logger[_0x0b27('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x48cf67,_0x0b27('0xd'),JSON[_0x0b27('0xf')](_0x59b361));if(_0x59b361[_0x0b27('0x10')]){if(_0x59b361[_0x0b27('0x10')][_0x0b27('0x11')]===0x1f4){logger[_0x0b27('0x10')]('CmCompany,\x20%s,\x20%s',_0x48cf67,_0x59b361['error'][_0x0b27('0x12')]);return _0xb4f180(_0x59b361[_0x0b27('0x10')][_0x0b27('0x12')]);}logger[_0x0b27('0x10')](_0x0b27('0x13'),_0x48cf67,_0x59b361[_0x0b27('0x10')][_0x0b27('0x12')]);return _0x7f60a1(_0x59b361['error']['message']);}else{logger[_0x0b27('0xc')]('CmCompany,\x20%s,\x20%s',_0x48cf67,_0x0b27('0xd'));_0x7f60a1(_0x59b361[_0x0b27('0x14')][_0x0b27('0x12')]);}})[_0x0b27('0x15')](function(_0x5967bc){logger[_0x0b27('0x10')]('CmCompany,\x20%s,\x20%s',_0x48cf67,_0x5967bc);_0xb4f180(_0x5967bc);});});} \ No newline at end of file +var _0xec63=['stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xec63,0x192));var _0x3ec6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec63[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3ec6('0x0'));var util=require(_0x3ec6('0x1'));var moment=require('moment');var BPromise=require(_0x3ec6('0x2'));var rs=require(_0x3ec6('0x3'));var fs=require('fs');var Redis=require(_0x3ec6('0x4'));var db=require(_0x3ec6('0x5'))['db'];var utils=require(_0x3ec6('0x6'));var logger=require('../../config/logger')(_0x3ec6('0x7'));var config=require(_0x3ec6('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3ec6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d0b70,_0x21015b,_0x26f6a4){return new BPromise(function(_0x5b835c,_0xe4bbf9){return client[_0x3ec6('0xa')](_0x4d0b70,_0x26f6a4)[_0x3ec6('0xb')](function(_0x278c66){logger['info'](_0x3ec6('0xc'),_0x21015b,_0x3ec6('0xd'));logger[_0x3ec6('0xe')](_0x3ec6('0xf'),_0x21015b,_0x3ec6('0xd'),JSON[_0x3ec6('0x10')](_0x278c66));if(_0x278c66[_0x3ec6('0x11')]){if(_0x278c66[_0x3ec6('0x11')]['code']===0x1f4){logger[_0x3ec6('0x11')]('CmCompany,\x20%s,\x20%s',_0x21015b,_0x278c66[_0x3ec6('0x11')][_0x3ec6('0x12')]);return _0xe4bbf9(_0x278c66[_0x3ec6('0x11')][_0x3ec6('0x12')]);}logger[_0x3ec6('0x11')](_0x3ec6('0xc'),_0x21015b,_0x278c66[_0x3ec6('0x11')]['message']);return _0x5b835c(_0x278c66[_0x3ec6('0x11')][_0x3ec6('0x12')]);}else{logger[_0x3ec6('0x13')](_0x3ec6('0xc'),_0x21015b,_0x3ec6('0xd'));_0x5b835c(_0x278c66[_0x3ec6('0x14')][_0x3ec6('0x12')]);}})[_0x3ec6('0x15')](function(_0x3a898c){logger[_0x3ec6('0x11')](_0x3ec6('0xc'),_0x21015b,_0x3a898c);_0xe4bbf9(_0x3a898c);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 6eed3e4..165d5e5 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 _0xa2ca=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','post','addContacts','destroy','exports','multer','util','connect-timeout','express'];(function(_0x4f9f32,_0x2f895c){var _0x1538e0=function(_0x11c6ea){while(--_0x11c6ea){_0x4f9f32['push'](_0x4f9f32['shift']());}};_0x1538e0(++_0x2f895c);}(_0xa2ca,0xce));var _0xaa2c=function(_0x43e251,_0x552b10){_0x43e251=_0x43e251-0x0;var _0x530182=_0xa2ca[_0x43e251];return _0x530182;};'use strict';var multer=require(_0xaa2c('0x0'));var util=require(_0xaa2c('0x1'));var path=require('path');var timeout=require(_0xaa2c('0x2'));var express=require(_0xaa2c('0x3'));var router=express[_0xaa2c('0x4')]();var fs_extra=require(_0xaa2c('0x5'));var auth=require(_0xaa2c('0x6'));var interaction=require(_0xaa2c('0x7'));var config=require(_0xaa2c('0x8'));var controller=require('./cmCompany.controller');router[_0xaa2c('0x9')]('/',auth[_0xaa2c('0xa')](),controller[_0xaa2c('0xb')]);router[_0xaa2c('0x9')](_0xaa2c('0xc'),auth[_0xaa2c('0xa')](),controller[_0xaa2c('0xd')]);router['get'](_0xaa2c('0xe'),auth[_0xaa2c('0xa')](),controller[_0xaa2c('0xf')]);router[_0xaa2c('0x9')](_0xaa2c('0x10'),auth[_0xaa2c('0xa')](),controller['getContacts']);router[_0xaa2c('0x11')]('/',auth[_0xaa2c('0xa')](),controller['create']);router[_0xaa2c('0x11')](_0xaa2c('0x10'),auth[_0xaa2c('0xa')](),controller[_0xaa2c('0x12')]);router['put'](_0xaa2c('0xe'),auth[_0xaa2c('0xa')](),controller['update']);router['delete']('/:id',auth[_0xaa2c('0xa')](),controller[_0xaa2c('0x13')]);module[_0xaa2c('0x14')]=router; \ No newline at end of file +var _0xaf99=['./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x438217,_0x4c45ac){var _0x2ffe3=function(_0x2c8522){while(--_0x2c8522){_0x438217['push'](_0x438217['shift']());}};_0x2ffe3(++_0x4c45ac);}(_0xaf99,0xdf));var _0x9af9=function(_0x3ffb08,_0x5cb812){_0x3ffb08=_0x3ffb08-0x0;var _0x1d227b=_0xaf99[_0x3ffb08];return _0x1d227b;};'use strict';var multer=require(_0x9af9('0x0'));var util=require(_0x9af9('0x1'));var path=require(_0x9af9('0x2'));var timeout=require('connect-timeout');var express=require(_0x9af9('0x3'));var router=express[_0x9af9('0x4')]();var fs_extra=require(_0x9af9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9af9('0x6'));var config=require('../../config/environment');var controller=require(_0x9af9('0x7'));router[_0x9af9('0x8')]('/',auth[_0x9af9('0x9')](),controller[_0x9af9('0xa')]);router[_0x9af9('0x8')]('/describe',auth[_0x9af9('0x9')](),controller[_0x9af9('0xb')]);router[_0x9af9('0x8')](_0x9af9('0xc'),auth[_0x9af9('0x9')](),controller[_0x9af9('0xd')]);router[_0x9af9('0x8')](_0x9af9('0xe'),auth[_0x9af9('0x9')](),controller[_0x9af9('0xf')]);router[_0x9af9('0x10')]('/',auth[_0x9af9('0x9')](),controller[_0x9af9('0x11')]);router[_0x9af9('0x10')](_0x9af9('0xe'),auth[_0x9af9('0x9')](),controller[_0x9af9('0x12')]);router[_0x9af9('0x13')](_0x9af9('0xc'),auth[_0x9af9('0x9')](),controller[_0x9af9('0x14')]);router['delete'](_0x9af9('0xc'),auth[_0x9af9('0x9')](),controller[_0x9af9('0x15')]);module[_0x9af9('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index e66ae8e..721d823 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 _0xb10b=['TEXT','INTEGER','UNSIGNED','DATE','lodash','exports','STRING'];(function(_0x1f8549,_0x2aa2dc){var _0x41946c=function(_0x4d316b){while(--_0x4d316b){_0x1f8549['push'](_0x1f8549['shift']());}};_0x41946c(++_0x2aa2dc);}(_0xb10b,0x12a));var _0xbb10=function(_0x400f2a,_0x52a559){_0x400f2a=_0x400f2a-0x0;var _0x3dd8d1=_0xb10b[_0x400f2a];return _0x3dd8d1;};'use strict';var _=require(_0xbb10('0x0'));var Sequelize=require('sequelize');module[_0xbb10('0x1')]={'firstName':{'type':Sequelize[_0xbb10('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xbb10('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xbb10('0x2')]},'city':{'type':Sequelize[_0xbb10('0x2')]},'country':{'type':Sequelize[_0xbb10('0x2')]},'dateOfBirth':{'type':Sequelize[_0xbb10('0x2')]},'description':{'type':Sequelize[_0xbb10('0x3')]},'phone':{'type':Sequelize[_0xbb10('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbb10('0x2')]},'email':{'type':Sequelize[_0xbb10('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xbb10('0x2')]},'fb_data':{'type':Sequelize[_0xbb10('0x2')]},'twitter':{'type':Sequelize[_0xbb10('0x2')]},'skype':{'type':Sequelize[_0xbb10('0x2')]},'teams':{'type':Sequelize[_0xbb10('0x2')]},'viber':{'type':Sequelize[_0xbb10('0x2')]},'line':{'type':Sequelize[_0xbb10('0x2')]},'wechat':{'type':Sequelize[_0xbb10('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xbb10('0x4')](0x2)[_0xbb10('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xbb10('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xbb10('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb7e7=['NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0xb7e7,0x121));var _0x7b7e=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xb7e7[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x7b7e('0x0'));var Sequelize=require('sequelize');module[_0x7b7e('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x7b7e('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7b7e('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7b7e('0x2')]},'dateOfBirth':{'type':Sequelize[_0x7b7e('0x2')]},'description':{'type':Sequelize[_0x7b7e('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x7b7e('0x2')]},'email':{'type':Sequelize[_0x7b7e('0x2')]},'url':{'type':Sequelize[_0x7b7e('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x7b7e('0x2')]},'twitter':{'type':Sequelize[_0x7b7e('0x2')]},'skype':{'type':Sequelize[_0x7b7e('0x2')]},'teams':{'type':Sequelize[_0x7b7e('0x2')]},'viber':{'type':Sequelize[_0x7b7e('0x2')]},'line':{'type':Sequelize[_0x7b7e('0x2')]},'wechat':{'type':Sequelize[_0x7b7e('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x7b7e('0x4')]},'priority':{'type':Sequelize[_0x7b7e('0x4')](0x2)[_0x7b7e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7b7e('0x6')],'defaultValue':Sequelize[_0x7b7e('0x7')]},'dialTimezone':{'type':Sequelize[_0x7b7e('0x2')]},'utcOffset':{'type':Sequelize[_0x7b7e('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index ae9e61f..ce9cb00 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 _0x052f=['pickBy','toParam','phone','CmHopper','getTags','pick','options','ids','rawAttributes','nolimit','ContactId','includeAll','getHopperHistories','CmHopperHistory','include','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','meta','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','sms','openchannel','fax','whatsapp','resolve','channel','toLowerCase','parse','isValid','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','chat','Website','closed','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','deviceModel','ratingType','ratingValue','referer','subject','substatus','externalUrl','Interaction','all','flatten','sortBy','slice','bluebird','util','path','lodash','squel','papaparse','ioredis','../../config/logger','api','../../config/environment/shared','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','count','set','json','update','then','error','stack','name','send','index','CmContact','describe','keys','length','cf_','push','CmCustomField','findOne','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','buildExpression','text','end','filter','Contact','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','split','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?','isEmail','c.email\x20LIKE\x20?','group','c.id','Sequelize','SELECT','clone','DESC','isEmpty','having','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.lastName','c.mobile','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','params','startsWith','columnName','displayName','findAll','alias','catch','body','get','mergeWith','isArray','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','destroy','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','isNil','dialTimezone','timezones','utcOffset','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','$and','omit','format','cf_%d'];(function(_0x31a7f1,_0x130e51){var _0x5d4407=function(_0x7df34f){while(--_0x7df34f){_0x31a7f1['push'](_0x31a7f1['shift']());}};_0x5d4407(++_0x130e51);}(_0x052f,0x17c));var _0xf052=function(_0x29e031,_0x1bee3e){_0x29e031=_0x29e031-0x0;var _0x5457d8=_0x052f[_0x29e031];return _0x5457d8;};'use strict';var moment=require('moment');var BPromise=require(_0xf052('0x0'));var util=require(_0xf052('0x1'));var path=require(_0xf052('0x2'));var fs=require('fs');var _=require(_0xf052('0x3'));var squel=require(_0xf052('0x4'));var Papa=require(_0xf052('0x5'));var Redis=require(_0xf052('0x6'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0xf052('0x7'))(_0xf052('0x8'));var config=require('../../config/environment');var shared=require(_0xf052('0x9'));var db=require(_0xf052('0xa'))['db'];config['redis']=_[_0xf052('0xb')](config[_0xf052('0xc')],{'host':_0xf052('0xd'),'port':0x18eb});var socket=require(_0xf052('0xe'))(new Redis(config['redis']));require(_0xf052('0xf'))[_0xf052('0x10')](socket);function respondWithResult(_0x224a48,_0x5d7b81){_0x5d7b81=_0x5d7b81||0xc8;return function(_0x11ae73){if(_0x11ae73){return _0x224a48[_0xf052('0x11')](_0x5d7b81)['json'](_0x11ae73);}};}function respondWithFilteredResult(_0x49133f,_0x433c0b){return function(_0x291208){if(_0x291208){var _0x25bd8f=typeof _0x433c0b[_0xf052('0x12')]===_0xf052('0x13')&&typeof _0x433c0b['limit']===_0xf052('0x13');var _0x3a5a8a=_0x291208[_0xf052('0x14')];var _0x39adb7=_0x25bd8f?0x0:_0x433c0b[_0xf052('0x12')];var _0x401a6c=_0x25bd8f?_0x291208[_0xf052('0x14')]:_0x433c0b[_0xf052('0x12')]+_0x433c0b['limit'];var _0x172700;if(_0x401a6c>=_0x3a5a8a){_0x401a6c=_0x3a5a8a;_0x172700=0xc8;}else{_0x172700=0xce;}_0x49133f[_0xf052('0x11')](_0x172700);return _0x49133f[_0xf052('0x15')]('Content-Range',_0x39adb7+'-'+_0x401a6c+'/'+_0x3a5a8a)[_0xf052('0x16')](_0x291208);}return null;};}function saveUpdates(_0x274377){return function(_0x36f5b5){if(_0x36f5b5){return _0x36f5b5[_0xf052('0x17')](_0x274377)[_0xf052('0x18')](function(_0x10f232){return _0x10f232;});}return null;};}function removeEntity(_0x28a10b){return function(_0x3bfb53){if(_0x3bfb53){return _0x3bfb53['destroy']()['then'](function(){_0x28a10b[_0xf052('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a60a4){return function(_0x1f37f2){if(!_0x1f37f2){_0x2a60a4['sendStatus'](0x194);}return _0x1f37f2;};}function handleError(_0x3a9564,_0x1f1055){_0x1f1055=_0x1f1055||0x1f4;return function(_0x41e949){logger[_0xf052('0x19')](_0x41e949[_0xf052('0x1a')]);if(_0x41e949[_0xf052('0x1b')]){delete _0x41e949[_0xf052('0x1b')];}_0x3a9564[_0xf052('0x11')](_0x1f1055)[_0xf052('0x1c')](_0x41e949);};}exports[_0xf052('0x1d')]=function(_0x4621c4,_0x3ddd42){var _0x4f0c4d={},_0x141a72={},_0x175c37={'count':0x0,'rows':[]};return db[_0xf052('0x1e')][_0xf052('0x1f')]()[_0xf052('0x18')](function(_0x35caf8){var _0x2f8ad1=[];for(var _0x12d01c=0x0;_0x12d01c0x1){_0x32236d['or'](_0xf052('0x5c'),qs[_0xf052('0x5d')](_0x29dbec),null);}else{if(qs[_0xf052('0x5e')](_0x29dbec)){_0x32236d['or'](_0xf052('0x5f'),_0x29dbec+'%');_0x32236d['or']('c.phone\x20LIKE\x20?',_0x29dbec+'%');_0x32236d['or']('c.mobile\x20LIKE\x20?',_0x29dbec+'%');_0x32236d['or']('c.fax\x20LIKE\x20?',_0x29dbec+'%');}else if(qs[_0xf052('0x60')](_0x29dbec)){_0x32236d['or'](_0xf052('0x61'),_0x29dbec+'%');}else{_0x32236d['or']('c.firstName\x20LIKE\x20?','%'+_0x29dbec+'%');_0x32236d['or']('c.lastName\x20LIKE\x20?','%'+_0x29dbec+'%');_0x32236d['or'](_0xf052('0x61'),'%'+_0x29dbec+'%');}}}}_0x551522[_0xf052('0x32')](_0x32236d);_0x551522[_0xf052('0x62')](_0xf052('0x63'));var _0x3b7865={'type':db[_0xf052('0x64')]['QueryTypes'][_0xf052('0x65')],'raw':!![]};var _0x35c4f6=_0x551522[_0xf052('0x66')]()[_0xf052('0x34')](_0xf052('0x63'));if(_0x4f0c4d[_0xf052('0x30')]){_0x4f0c4d[_0xf052('0x30')][_0xf052('0x53')](function(_0x5d18b4){_0x551522[_0xf052('0x30')]('c.'+_0x5d18b4[0x0],_0x5d18b4[0x1]===_0xf052('0x67')?![]:!![]);});}if(!_[_0xf052('0x68')](_0x1620e9)){_0x551522[_0xf052('0x69')](_0x1aa33f);_0x35c4f6[_0xf052('0x32')]('t.id\x20IN\x20?',_0x1620e9);}BPromise['resolve']()['then'](function(){if(!_0x2ae7fe)return;if(_0x4621c4[_0xf052('0x6a')][_0xf052('0x6b')]!==_0xf052('0x6c'))return;if(!_[_0xf052('0x6d')](_0x2ae7fe[_0xf052('0x41')],[_0xf052('0x34'),_0xf052('0x48')])){return _0x4621c4['user'][_0xf052('0x6e')]({'attributes':['id'],'raw':!![]})[_0xf052('0x18')](function(_0x60354){if(_[_0xf052('0x68')](_0x60354)){_0x35c4f6['where'](_0xf052('0x6f'));_0x551522[_0xf052('0x32')](_0xf052('0x6f'));}else{_0x35c4f6[_0xf052('0x32')](_0xf052('0x55'),_['map'](_0x60354,'id'));_0x551522[_0xf052('0x32')](_0xf052('0x55'),_[_0xf052('0x45')](_0x60354,'id'));}});}})[_0xf052('0x18')](function(){if(_0x4621c4[_0xf052('0x6a')][_0xf052('0x6b')]===_0xf052('0x6c')&&!_0x2ae7fe&&!_0x4621c4[_0xf052('0x29')]['ListId'])return[];return db[_0xf052('0x70')][_0xf052('0x29')](_0x35c4f6[_0xf052('0x71')](),_0x3b7865);})[_0xf052('0x18')](function(_0x590195){_0x175c37[_0xf052('0x14')]=_0x590195[_0xf052('0x21')];if(_0x175c37['count']===0x0)return[];return db[_0xf052('0x70')][_0xf052('0x29')](_0x1b5837['toString'](),_0x3b7865)[_0xf052('0x18')](function(_0x12ff96){_0xe3972b=_[_0xf052('0x72')](_0x12ff96,'id');_0x3b7865=_[_0xf052('0x73')](_0x3b7865,{'model':db[_0xf052('0x1e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4621c4[_0xf052('0x29')][_0xf052('0x2d')]){_0x4f0c4d['attributes'][_0xf052('0x53')](function(_0x104ce7){_0x551522[_0xf052('0x34')]('c.'+_0x104ce7);});}else{_0x551522[_0xf052('0x34')](_0xf052('0x63'));_0x551522[_0xf052('0x34')]('c.firstName');_0x551522[_0xf052('0x34')](_0xf052('0x74'));_0x551522[_0xf052('0x34')]('c.phone');_0x551522[_0xf052('0x34')](_0xf052('0x75'));_0x551522[_0xf052('0x34')]('c.fax');_0x551522[_0xf052('0x34')](_0xf052('0x76'));_0x551522[_0xf052('0x34')](_0xf052('0x77'));_0x551522[_0xf052('0x34')](_0xf052('0x78'));_0x551522[_0xf052('0x34')](_0xf052('0x79'));_0x551522[_0xf052('0x34')](_0xf052('0x7a'));_0x551522[_0xf052('0x34')](_0xf052('0x7b'),_0xf052('0x7c'));}if(_0x4f0c4d[_0xf052('0x2f')])_0x551522[_0xf052('0x2f')](_0x4f0c4d[_0xf052('0x2f')]);if(_0x4f0c4d[_0xf052('0x12')])_0x551522['offset'](_0x4f0c4d[_0xf052('0x12')]);return db['sequelize'][_0xf052('0x29')](_0x551522['toString'](),_0x3b7865);});})['then'](function(_0x62694b){_0x62694b['forEach'](function(_0x3a7145){if(_0x3a7145['TagIds']){_0x3a7145[_0xf052('0x7d')]=[];_0x3a7145[_0xf052('0x7c')][_0xf052('0x5b')](',')[_0xf052('0x53')](function(_0x37f1d9){_0x3a7145[_0xf052('0x7d')][_0xf052('0x23')](_0xe3972b[_0x37f1d9]);});}delete _0x3a7145[_0xf052('0x7c')];});_0x175c37[_0xf052('0x7e')]=_0x62694b;return _0x175c37;})[_0xf052('0x18')](respondWithFilteredResult(_0x3ddd42,_0x4f0c4d));})['catch'](handleError(_0x3ddd42,null));};exports['destroy']=function(_0x28e346,_0x3cb135){return db['CmContact'][_0xf052('0x42')]({'where':{'id':_0x28e346[_0xf052('0x7f')]['id']}})['then'](handleEntityNotFound(_0x3cb135,null))[_0xf052('0x18')](removeEntity(_0x3cb135,null))['catch'](handleError(_0x3cb135,null));};exports[_0xf052('0x1f')]=function(_0x43bb74,_0x3b396c){return db[_0xf052('0x1e')]['describe']()[_0xf052('0x18')](function(_0x1cbbd9){delete _0x1cbbd9['tags'];for(var _0x23777d=0x0;_0x23777d=_0x51a597){_0x2ba71c=_0x51a597;_0x40108b=0xc8;}else{_0x40108b=0xce;}_0x493432[_0xc3ce('0x10')](_0x40108b);return _0x493432['set'](_0xc3ce('0x16'),_0x4f0d33+'-'+_0x2ba71c+'/'+_0x51a597)[_0xc3ce('0x11')](_0xf99ef7);}return null;};}function saveUpdates(_0x4f3c34){return function(_0x555d6b){if(_0x555d6b){return _0x555d6b[_0xc3ce('0x17')](_0x4f3c34)[_0xc3ce('0x18')](function(_0x34514e){return _0x34514e;});}return null;};}function removeEntity(_0x1ddfc3){return function(_0x1e376f){if(_0x1e376f){return _0x1e376f[_0xc3ce('0x19')]()[_0xc3ce('0x18')](function(){_0x1ddfc3[_0xc3ce('0x10')](0xcc)[_0xc3ce('0x1a')]();});}};}function handleEntityNotFound(_0x29b1e8){return function(_0x6d2462){if(!_0x6d2462){_0x29b1e8[_0xc3ce('0x1b')](0x194);}return _0x6d2462;};}function handleError(_0x243bb4,_0x32bb89){_0x32bb89=_0x32bb89||0x1f4;return function(_0x5b9132){logger[_0xc3ce('0x1c')](_0x5b9132[_0xc3ce('0x1d')]);if(_0x5b9132[_0xc3ce('0x1e')]){delete _0x5b9132[_0xc3ce('0x1e')];}_0x243bb4[_0xc3ce('0x10')](_0x32bb89)['send'](_0x5b9132);};}exports[_0xc3ce('0x1f')]=function(_0x1e7ca9,_0x2139f7){var _0x58acd1={},_0x16b6aa={},_0x4f6d7a={'count':0x0,'rows':[]};return db['CmContact'][_0xc3ce('0x20')]()[_0xc3ce('0x18')](function(_0x42b527){var _0x30fb23=[];for(var _0x504a15=0x0;_0x504a150x1){_0x4c8504['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc3ce('0x5a')](_0x2b76d5),null);}else{if(qs['isNumeric'](_0x2b76d5)){_0x4c8504['or'](_0xc3ce('0x5b'),_0x2b76d5+'%');_0x4c8504['or'](_0xc3ce('0x5c'),_0x2b76d5+'%');_0x4c8504['or'](_0xc3ce('0x5d'),_0x2b76d5+'%');_0x4c8504['or'](_0xc3ce('0x5e'),_0x2b76d5+'%');}else if(qs[_0xc3ce('0x5f')](_0x2b76d5)){_0x4c8504['or'](_0xc3ce('0x60'),_0x2b76d5+'%');}else{_0x4c8504['or']('c.firstName\x20LIKE\x20?','%'+_0x2b76d5+'%');_0x4c8504['or'](_0xc3ce('0x61'),'%'+_0x2b76d5+'%');_0x4c8504['or'](_0xc3ce('0x60'),'%'+_0x2b76d5+'%');}}}}_0x25af10[_0xc3ce('0x2f')](_0x4c8504);_0x25af10[_0xc3ce('0x62')](_0xc3ce('0x63'));var _0x3df50c={'type':db[_0xc3ce('0x64')][_0xc3ce('0x65')][_0xc3ce('0x66')],'raw':!![]};var _0x4d2a06=_0x25af10['clone']()[_0xc3ce('0x33')](_0xc3ce('0x63'));if(_0x58acd1['order']){_0x58acd1[_0xc3ce('0x2d')]['forEach'](function(_0x5eaf16){_0x25af10['order']('c.'+_0x5eaf16[0x0],_0x5eaf16[0x1]===_0xc3ce('0x67')?![]:!![]);});}if(!_[_0xc3ce('0x68')](_0x606aab)){_0x25af10[_0xc3ce('0x69')](_0x2da63a);_0x4d2a06[_0xc3ce('0x2f')](_0xc3ce('0x6a'),_0x606aab);}BPromise[_0xc3ce('0x6b')]()['then'](function(){if(!_0x24605e)return;if(_0x1e7ca9[_0xc3ce('0x6c')][_0xc3ce('0x6d')]!==_0xc3ce('0x6e'))return;if(!_[_0xc3ce('0x6f')](_0x24605e[_0xc3ce('0x40')],[_0xc3ce('0x33'),_0xc3ce('0x49')])){return _0x1e7ca9[_0xc3ce('0x6c')][_0xc3ce('0x70')]({'attributes':['id'],'raw':!![]})[_0xc3ce('0x18')](function(_0x1771f2){if(_[_0xc3ce('0x68')](_0x1771f2)){_0x4d2a06[_0xc3ce('0x2f')](_0xc3ce('0x71'));_0x25af10[_0xc3ce('0x2f')](_0xc3ce('0x71'));}else{_0x4d2a06[_0xc3ce('0x2f')](_0xc3ce('0x55'),_[_0xc3ce('0x45')](_0x1771f2,'id'));_0x25af10[_0xc3ce('0x2f')]('c.ListId\x20IN\x20?',_[_0xc3ce('0x45')](_0x1771f2,'id'));}});}})[_0xc3ce('0x18')](function(){if(_0x1e7ca9[_0xc3ce('0x6c')]['role']===_0xc3ce('0x6e')&&!_0x24605e&&!_0x1e7ca9['query'][_0xc3ce('0x72')])return[];return db[_0xc3ce('0x73')][_0xc3ce('0x28')](_0x4d2a06['toString'](),_0x3df50c);})[_0xc3ce('0x18')](function(_0x180189){_0x4f6d7a[_0xc3ce('0x15')]=_0x180189[_0xc3ce('0x21')];if(_0x4f6d7a[_0xc3ce('0x15')]===0x0)return[];return db['sequelize']['query'](_0x12cc94[_0xc3ce('0x74')](),_0x3df50c)[_0xc3ce('0x18')](function(_0x162319){_0x2377a9=_[_0xc3ce('0x75')](_0x162319,'id');_0x3df50c=_[_0xc3ce('0x76')](_0x3df50c,{'model':db[_0xc3ce('0x77')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e7ca9[_0xc3ce('0x28')][_0xc3ce('0x2b')]){_0x58acd1[_0xc3ce('0x29')][_0xc3ce('0x46')](function(_0x535d1e){_0x25af10[_0xc3ce('0x33')]('c.'+_0x535d1e);});}else{_0x25af10['field'](_0xc3ce('0x63'));_0x25af10[_0xc3ce('0x33')](_0xc3ce('0x78'));_0x25af10[_0xc3ce('0x33')](_0xc3ce('0x79'));_0x25af10['field'](_0xc3ce('0x7a'));_0x25af10[_0xc3ce('0x33')](_0xc3ce('0x7b'));_0x25af10['field'](_0xc3ce('0x7c'));_0x25af10['field']('c.email');_0x25af10['field'](_0xc3ce('0x7d'));_0x25af10[_0xc3ce('0x33')](_0xc3ce('0x7e'));_0x25af10[_0xc3ce('0x33')](_0xc3ce('0x7f'));_0x25af10['field'](_0xc3ce('0x80'));_0x25af10[_0xc3ce('0x33')](_0xc3ce('0x81'),_0xc3ce('0x82'));}if(_0x58acd1[_0xc3ce('0x14')])_0x25af10[_0xc3ce('0x14')](_0x58acd1[_0xc3ce('0x14')]);if(_0x58acd1[_0xc3ce('0x12')])_0x25af10[_0xc3ce('0x12')](_0x58acd1['offset']);return db[_0xc3ce('0x73')][_0xc3ce('0x28')](_0x25af10[_0xc3ce('0x74')](),_0x3df50c);});})[_0xc3ce('0x18')](function(_0x5a45f9){_0x5a45f9[_0xc3ce('0x46')](function(_0x21a680){if(_0x21a680['TagIds']){_0x21a680[_0xc3ce('0x83')]=[];_0x21a680[_0xc3ce('0x82')][_0xc3ce('0x44')](',')[_0xc3ce('0x46')](function(_0x44976d){_0x21a680[_0xc3ce('0x83')][_0xc3ce('0x54')](_0x2377a9[_0x44976d]);});}delete _0x21a680[_0xc3ce('0x82')];});_0x4f6d7a[_0xc3ce('0x84')]=_0x5a45f9;return _0x4f6d7a;})[_0xc3ce('0x18')](respondWithFilteredResult(_0x2139f7,_0x58acd1));})[_0xc3ce('0x85')](handleError(_0x2139f7,null));};exports[_0xc3ce('0x19')]=function(_0x53416b,_0x55201d){return db[_0xc3ce('0x77')]['find']({'where':{'id':_0x53416b[_0xc3ce('0x86')]['id']}})[_0xc3ce('0x18')](handleEntityNotFound(_0x55201d,null))['then'](removeEntity(_0x55201d,null))[_0xc3ce('0x85')](handleError(_0x55201d,null));};exports[_0xc3ce('0x20')]=function(_0x4947e7,_0x475eb6){return db[_0xc3ce('0x77')]['describe']()[_0xc3ce('0x18')](function(_0x3dc47d){delete _0x3dc47d[_0xc3ce('0x87')];for(var _0x4368e1=0x0;_0x4368e1{}\s\\|]/g,'-');_0x4a79b9(null,util['format'](_0x4be8('0x25'),path['basename'](_0x8cc654['originalname'],path['extname'](_0x8cc654['originalname'])),Date[_0x4be8('0x26')](),path['extname'](_0x8cc654[_0x4be8('0x23')])));}})});router[_0x4be8('0x1a')]('/csv',upload[_0x4be8('0x27')](_0x4be8('0x28')),controller[_0x4be8('0x29')]);var upload=multer({'storage':multer[_0x4be8('0x1f')]({'destination':function(_0x1abdf4,_0x167d8a,_0x25303e){_0x25303e(null,path[_0x4be8('0x20')](config[_0x4be8('0x21')],'server/files/tmp'));},'filename':function(_0x14113e,_0xe3c33b,_0x108ad8){_0xe3c33b[_0x4be8('0x23')]=_0xe3c33b[_0x4be8('0x23')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x108ad8(null,util[_0x4be8('0x2a')](_0x4be8('0x25'),path[_0x4be8('0x2b')](_0xe3c33b[_0x4be8('0x23')],path[_0x4be8('0x2c')](_0xe3c33b[_0x4be8('0x23')])),Date[_0x4be8('0x26')](),path['extname'](_0xe3c33b[_0x4be8('0x23')])));}})});router[_0x4be8('0x1a')]('/upload',upload[_0x4be8('0x27')](_0x4be8('0x28')),controller['upload']);router[_0x4be8('0x1a')]('/upload/:id',auth['isAuthenticated'](),controller[_0x4be8('0x2d')]);router[_0x4be8('0x2e')]('/:id',auth[_0x4be8('0xa')](),controller[_0x4be8('0x2f')]);router[_0x4be8('0x30')]('/:id',auth[_0x4be8('0xa')](),controller['destroy']);module[_0x4be8('0x31')]=router; \ No newline at end of file +var _0xabc3=['destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/tags','getTags','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','/merge','merge','post','create','/create_many','setTags','diskStorage','server/files/tmp','originalname','replace','format','basename','extname','now','/csv','single','file','uploadCsv','root','%s-%s%s','/upload','upload','import','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabc3,0x10a));var _0x3abc=function(_0x4e6ce3,_0x4bdc9e){_0x4e6ce3=_0x4e6ce3-0x0;var _0x589a7b=_0xabc3[_0x4e6ce3];return _0x589a7b;};'use strict';var multer=require(_0x3abc('0x0'));var util=require('util');var path=require(_0x3abc('0x1'));var timeout=require(_0x3abc('0x2'));var express=require(_0x3abc('0x3'));var router=express['Router']();var fs_extra=require(_0x3abc('0x4'));var auth=require(_0x3abc('0x5'));var interaction=require(_0x3abc('0x6'));var config=require(_0x3abc('0x7'));var controller=require(_0x3abc('0x8'));router[_0x3abc('0x9')]('/',auth['isAuthenticated'](),controller[_0x3abc('0xa')]);router[_0x3abc('0x9')](_0x3abc('0xb'),auth['isAuthenticated'](),controller[_0x3abc('0xc')]);router[_0x3abc('0x9')](_0x3abc('0xd'),auth[_0x3abc('0xe')](),controller[_0x3abc('0xf')]);router[_0x3abc('0x9')](_0x3abc('0x10'),auth[_0x3abc('0xe')](),controller[_0x3abc('0x11')]);router[_0x3abc('0x9')]('/:id/hoppers',auth[_0x3abc('0xe')](),controller[_0x3abc('0x12')]);router['get'](_0x3abc('0x13'),auth[_0x3abc('0xe')](),controller['getHopperHistories']);router[_0x3abc('0x9')](_0x3abc('0x14'),auth[_0x3abc('0xe')](),controller[_0x3abc('0x15')]);router[_0x3abc('0x9')](_0x3abc('0x16'),auth[_0x3abc('0xe')](),controller[_0x3abc('0x17')]);router['get'](_0x3abc('0x18'),auth[_0x3abc('0xe')](),controller[_0x3abc('0x19')]);router['post'](_0x3abc('0x1a'),auth[_0x3abc('0xe')](),controller[_0x3abc('0x1b')]);router[_0x3abc('0x1c')]('/',auth[_0x3abc('0xe')](),controller[_0x3abc('0x1d')]);router['post'](_0x3abc('0x1e'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x3abc('0x1c')](_0x3abc('0x10'),auth['isAuthenticated'](),controller[_0x3abc('0x1f')]);var upload=multer({'storage':multer[_0x3abc('0x20')]({'destination':function(_0x9da6f8,_0x45732f,_0x5859a1){_0x5859a1(null,path['join'](config['root'],_0x3abc('0x21')));},'filename':function(_0x31126e,_0x3c0fac,_0x37cafc){_0x3c0fac['originalname']=_0x3c0fac[_0x3abc('0x22')][_0x3abc('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x37cafc(null,util[_0x3abc('0x24')]('%s-%s%s',path[_0x3abc('0x25')](_0x3c0fac['originalname'],path[_0x3abc('0x26')](_0x3c0fac[_0x3abc('0x22')])),Date[_0x3abc('0x27')](),path[_0x3abc('0x26')](_0x3c0fac['originalname'])));}})});router[_0x3abc('0x1c')](_0x3abc('0x28'),upload[_0x3abc('0x29')](_0x3abc('0x2a')),controller[_0x3abc('0x2b')]);var upload=multer({'storage':multer[_0x3abc('0x20')]({'destination':function(_0x1eae50,_0x42ea90,_0x31dd91){_0x31dd91(null,path['join'](config[_0x3abc('0x2c')],_0x3abc('0x21')));},'filename':function(_0x508c92,_0x39ed02,_0x50f609){_0x39ed02['originalname']=_0x39ed02['originalname'][_0x3abc('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x50f609(null,util[_0x3abc('0x24')](_0x3abc('0x2d'),path['basename'](_0x39ed02[_0x3abc('0x22')],path[_0x3abc('0x26')](_0x39ed02[_0x3abc('0x22')])),Date[_0x3abc('0x27')](),path[_0x3abc('0x26')](_0x39ed02[_0x3abc('0x22')])));}})});router[_0x3abc('0x1c')](_0x3abc('0x2e'),upload['single']('file'),controller[_0x3abc('0x2f')]);router['post']('/upload/:id',auth[_0x3abc('0xe')](),controller[_0x3abc('0x30')]);router[_0x3abc('0x31')](_0x3abc('0xd'),auth[_0x3abc('0xe')](),controller[_0x3abc('0x32')]);router[_0x3abc('0x33')](_0x3abc('0xd'),auth['isAuthenticated'](),controller[_0x3abc('0x34')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 23b8e7f..abadbfe 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 _0x6486=['type','select','parse','values','BOOLEAN','ENUM','voice','sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long'];(function(_0x235e66,_0x4bef96){var _0x36019b=function(_0x3674f3){while(--_0x3674f3){_0x235e66['push'](_0x235e66['shift']());}};_0x36019b(++_0x4bef96);}(_0x6486,0x7e));var _0x6648=function(_0x20d5a9,_0x1e0773){_0x20d5a9=_0x20d5a9-0x0;var _0x3e1e25=_0x6486[_0x20d5a9];return _0x3e1e25;};'use strict';var Sequelize=require(_0x6648('0x0'));var _=require(_0x6648('0x1'));module[_0x6648('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x28ffdd){return this[_0x6648('0x3')](_0x6648('0x4'));}},'alias':{'type':Sequelize[_0x6648('0x5')],'allowNull':![],'set':function(_0x3552e3){this[_0x6648('0x6')](_0x6648('0x4'),_0x3552e3?_0x3552e3:this[_0x6648('0x3')](_0x6648('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x6648('0x8')](_0x6648('0x9')),'get':function(){if(this[_0x6648('0x3')](_0x6648('0xa'))===_0x6648('0xb')){return JSON[_0x6648('0xc')](this[_0x6648('0x3')](_0x6648('0xd')));}else{return this['getDataValue']('values');}},'set':function(_0x3517ff){if(Array['isArray'](_0x3517ff)){this['setDataValue'](_0x6648('0xd'),JSON['stringify'](_0x3517ff));}else{this['setDataValue']('values',_0x3517ff);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x6648('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x6648('0xf')](_0x6648('0x10'))}}; \ No newline at end of file +var _0xc676=['TEXT','long','type','values','isArray','stringify','BOOLEAN','ENUM','voice','lodash','exports','STRING','setDataValue','getDataValue','name'];(function(_0x2a2670,_0x4144ef){var _0x3bdc49=function(_0x24f4f8){while(--_0x24f4f8){_0x2a2670['push'](_0x2a2670['shift']());}};_0x3bdc49(++_0x4144ef);}(_0xc676,0x1da));var _0x6c67=function(_0x4dcc6f,_0x460812){_0x4dcc6f=_0x4dcc6f-0x0;var _0x302039=_0xc676[_0x4dcc6f];return _0x302039;};'use strict';var Sequelize=require('sequelize');var _=require(_0x6c67('0x0'));module[_0x6c67('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x23f166){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x6c67('0x2')],'allowNull':![],'set':function(_0x563278){this[_0x6c67('0x3')]('alias',_0x563278?_0x563278:this[_0x6c67('0x4')](_0x6c67('0x5')));}},'type':{'type':Sequelize[_0x6c67('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0x6c67('0x6')](_0x6c67('0x7')),'get':function(){if(this[_0x6c67('0x4')](_0x6c67('0x8'))==='select'){return JSON['parse'](this[_0x6c67('0x4')](_0x6c67('0x9')));}else{return this['getDataValue'](_0x6c67('0x9'));}},'set':function(_0x101a86){if(Array[_0x6c67('0xa')](_0x101a86)){this[_0x6c67('0x3')](_0x6c67('0x9'),JSON[_0x6c67('0xb')](_0x101a86));}else{this[_0x6c67('0x3')]('values',_0x101a86);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x6c67('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x6c67('0xd')](_0x6c67('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 6bc8c79..f645169 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 _0x2ca4=['pick','merge','VIRTUAL','filter','options','where','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','destroy','transaction','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','set','json','reject','save','update','then','status','name','send','index','map','CmCustomField','type','key','model','differenceBy','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x3e5bc8,_0x457d89){var _0xfd84bc=function(_0x1a766c){while(--_0x1a766c){_0x3e5bc8['push'](_0x3e5bc8['shift']());}};_0xfd84bc(++_0x457d89);}(_0x2ca4,0xcf));var _0x42ca=function(_0x1c16a4,_0xbba97c){_0x1c16a4=_0x1c16a4-0x0;var _0xa47eb7=_0x2ca4[_0x1c16a4];return _0xa47eb7;};'use strict';var emlformat=require(_0x42ca('0x0'));var rimraf=require(_0x42ca('0x1'));var zipdir=require(_0x42ca('0x2'));var jsonpatch=require(_0x42ca('0x3'));var rp=require(_0x42ca('0x4'));var moment=require(_0x42ca('0x5'));var BPromise=require(_0x42ca('0x6'));var Mustache=require(_0x42ca('0x7'));var util=require(_0x42ca('0x8'));var path=require('path');var sox=require(_0x42ca('0x9'));var csv=require(_0x42ca('0xa'));var ejs=require(_0x42ca('0xb'));var fs=require('fs');var fs_extra=require(_0x42ca('0xc'));var _=require('lodash');var squel=require(_0x42ca('0xd'));var crypto=require(_0x42ca('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x42ca('0xf'));var toCsv=require(_0x42ca('0xa'));var querystring=require(_0x42ca('0x10'));var Papa=require('papaparse');var Redis=require(_0x42ca('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x42ca('0x12'));var hardwareService=require(_0x42ca('0x13'));var logger=require(_0x42ca('0x14'))(_0x42ca('0x15'));var utils=require(_0x42ca('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x42ca('0x17'));var db=require(_0x42ca('0x18'))['db'];function respondWithStatusCode(_0x1a9af1,_0x4ce324){_0x4ce324=_0x4ce324||0xcc;return function(_0x40454e){if(_0x40454e){return _0x1a9af1[_0x42ca('0x19')](_0x4ce324);}return _0x1a9af1['status'](_0x4ce324)[_0x42ca('0x1a')]();};}function respondWithResult(_0x488574,_0x2592c2){_0x2592c2=_0x2592c2||0xc8;return function(_0x5985ca){if(_0x5985ca){return _0x488574['status'](_0x2592c2)['json'](_0x5985ca);}};}function respondWithFilteredResult(_0x20d032,_0xc716dc){return function(_0x15a28b){if(_0x15a28b){var _0x122b6=typeof _0xc716dc[_0x42ca('0x1b')]===_0x42ca('0x1c')&&typeof _0xc716dc[_0x42ca('0x1d')]==='undefined';var _0x52a725=_0x15a28b['count'];var _0x1857d8=_0x122b6?0x0:_0xc716dc['offset'];var _0x52d53b=_0x122b6?_0x15a28b['count']:_0xc716dc[_0x42ca('0x1b')]+_0xc716dc['limit'];var _0x31f34b;if(_0x52d53b>=_0x52a725){_0x52d53b=_0x52a725;_0x31f34b=0xc8;}else{_0x31f34b=0xce;}_0x20d032['status'](_0x31f34b);return _0x20d032[_0x42ca('0x1e')]('Content-Range',_0x1857d8+'-'+_0x52d53b+'/'+_0x52a725)[_0x42ca('0x1f')](_0x15a28b);}return null;};}function patchUpdates(_0x106afd){return function(_0x4f5b01){try{jsonpatch['apply'](_0x4f5b01,_0x106afd,!![]);}catch(_0x4dce94){return BPromise[_0x42ca('0x20')](_0x4dce94);}return _0x4f5b01[_0x42ca('0x21')]();};}function saveUpdates(_0x2fded2,_0x1b9003){return function(_0x1d6fe4){if(_0x1d6fe4){return _0x1d6fe4[_0x42ca('0x22')](_0x2fded2)['then'](function(_0x3e881f){return _0x3e881f;});}return null;};}function removeEntity(_0x2ee2a7,_0x81109e){return function(_0x160ffa){if(_0x160ffa){return _0x160ffa['destroy']()[_0x42ca('0x23')](function(){_0x2ee2a7[_0x42ca('0x24')](0xcc)[_0x42ca('0x1a')]();});}};}function handleEntityNotFound(_0x555f1a,_0x5eb17a){return function(_0x499794){if(!_0x499794){_0x555f1a[_0x42ca('0x19')](0x194);}return _0x499794;};}function handleError(_0x56847b,_0x16fc00){_0x16fc00=_0x16fc00||0x1f4;return function(_0x3441df){logger['error'](_0x3441df['stack']);if(_0x3441df[_0x42ca('0x25')]){delete _0x3441df['name'];}_0x56847b[_0x42ca('0x24')](_0x16fc00)[_0x42ca('0x26')](_0x3441df);};}exports[_0x42ca('0x27')]=function(_0x40c535,_0x3780b1){var _0x4ac977={},_0x346c2e={},_0x26d522={'count':0x0,'rows':[]};var _0x2faf74=_[_0x42ca('0x28')](db[_0x42ca('0x29')]['rawAttributes'],function(_0x3b14e1){return{'name':_0x3b14e1['fieldName'],'type':_0x3b14e1[_0x42ca('0x2a')][_0x42ca('0x2b')]};});_0x346c2e[_0x42ca('0x2c')]=_[_0x42ca('0x2d')](_['map'](_0x2faf74,_0x42ca('0x25')),[_0x42ca('0x25')]);_0x346c2e[_0x42ca('0x2e')]=_[_0x42ca('0x2f')](_0x40c535['query']);_0x346c2e['filters']=_['intersection'](_0x346c2e[_0x42ca('0x2c')],_0x346c2e[_0x42ca('0x2e')]);_0x4ac977[_0x42ca('0x30')]=_[_0x42ca('0x31')](_0x346c2e['model'],qs[_0x42ca('0x32')](_0x40c535[_0x42ca('0x2e')][_0x42ca('0x32')]));_0x4ac977[_0x42ca('0x30')]=_0x4ac977[_0x42ca('0x30')][_0x42ca('0x33')]?_0x4ac977[_0x42ca('0x30')]:_0x346c2e[_0x42ca('0x2c')];if(!_0x40c535[_0x42ca('0x2e')][_0x42ca('0x34')](_0x42ca('0x35'))){_0x4ac977[_0x42ca('0x1d')]=qs[_0x42ca('0x1d')](_0x40c535[_0x42ca('0x2e')][_0x42ca('0x1d')]);_0x4ac977[_0x42ca('0x1b')]=qs['offset'](_0x40c535['query'][_0x42ca('0x1b')]);}_0x4ac977[_0x42ca('0x36')]=qs[_0x42ca('0x37')](_0x40c535['query'][_0x42ca('0x37')]);_0x4ac977['where']=qs[_0x42ca('0x38')](_[_0x42ca('0x39')](_0x40c535['query'],_0x346c2e['filters']),_0x2faf74);if(_0x40c535[_0x42ca('0x2e')]['filter']){_0x4ac977['where']=_[_0x42ca('0x3a')](_0x4ac977['where'],{'$or':_['map'](_0x2faf74,function(_0x389cf4){if(_0x389cf4[_0x42ca('0x2a')]!==_0x42ca('0x3b')){var _0x5c5da1={};_0x5c5da1[_0x389cf4[_0x42ca('0x25')]]={'$like':'%'+_0x40c535[_0x42ca('0x2e')][_0x42ca('0x3c')]+'%'};return _0x5c5da1;}})});}_0x4ac977=_['merge']({},_0x4ac977,_0x40c535[_0x42ca('0x3d')]);var _0x4b1631={'where':_0x4ac977[_0x42ca('0x3e')]};return db[_0x42ca('0x29')][_0x42ca('0x3f')](_0x4b1631)[_0x42ca('0x23')](function(_0x1f2b22){_0x26d522[_0x42ca('0x3f')]=_0x1f2b22;if(_0x40c535['query'][_0x42ca('0x40')]){_0x4ac977[_0x42ca('0x41')]=[{'all':!![]}];}return db[_0x42ca('0x29')][_0x42ca('0x42')](_0x4ac977);})[_0x42ca('0x23')](function(_0x40b32f){_0x26d522[_0x42ca('0x43')]=_0x40b32f;return _0x26d522;})[_0x42ca('0x23')](respondWithFilteredResult(_0x3780b1,_0x4ac977))[_0x42ca('0x44')](handleError(_0x3780b1,null));};exports[_0x42ca('0x45')]=function(_0x406dd0,_0x4bbae4){var _0x4d743e={'raw':!![],'where':{'id':_0x406dd0[_0x42ca('0x46')]['id']}},_0x4f3e10={};_0x4f3e10[_0x42ca('0x2c')]=_[_0x42ca('0x2f')](db['CmCustomField'][_0x42ca('0x47')]);_0x4f3e10[_0x42ca('0x2e')]=_['keys'](_0x406dd0[_0x42ca('0x2e')]);_0x4f3e10[_0x42ca('0x38')]=_[_0x42ca('0x31')](_0x4f3e10[_0x42ca('0x2c')],_0x4f3e10[_0x42ca('0x2e')]);_0x4d743e[_0x42ca('0x30')]=_[_0x42ca('0x31')](_0x4f3e10[_0x42ca('0x2c')],qs[_0x42ca('0x32')](_0x406dd0[_0x42ca('0x2e')][_0x42ca('0x32')]));_0x4d743e[_0x42ca('0x30')]=_0x4d743e[_0x42ca('0x30')]['length']?_0x4d743e[_0x42ca('0x30')]:_0x4f3e10[_0x42ca('0x2c')];if(_0x406dd0[_0x42ca('0x2e')][_0x42ca('0x40')]){_0x4d743e[_0x42ca('0x41')]=[{'all':!![]}];}_0x4d743e=_[_0x42ca('0x3a')]({},_0x4d743e,_0x406dd0[_0x42ca('0x3d')]);return db[_0x42ca('0x29')][_0x42ca('0x48')](_0x4d743e)[_0x42ca('0x23')](handleEntityNotFound(_0x4bbae4,null))['then'](respondWithResult(_0x4bbae4,null))['catch'](handleError(_0x4bbae4,null));};exports[_0x42ca('0x22')]=function(_0x3f7f53,_0x2fa86e){if(_0x3f7f53[_0x42ca('0x49')]['id']){delete _0x3f7f53[_0x42ca('0x49')]['id'];}return db[_0x42ca('0x29')][_0x42ca('0x48')]({'where':{'id':_0x3f7f53[_0x42ca('0x46')]['id']}})[_0x42ca('0x23')](handleEntityNotFound(_0x2fa86e,null))['then'](saveUpdates(_0x3f7f53[_0x42ca('0x49')],null))[_0x42ca('0x23')](respondWithResult(_0x2fa86e,null))[_0x42ca('0x44')](handleError(_0x2fa86e,null));};exports[_0x42ca('0x4a')]=function(_0x1005b3,_0xa0cb54){return db[_0x42ca('0x29')][_0x42ca('0x48')]({'where':{'id':_0x1005b3[_0x42ca('0x46')]['id']}})['then'](handleEntityNotFound(_0xa0cb54,null))['then'](removeEntity(_0xa0cb54,null))[_0x42ca('0x44')](handleError(_0xa0cb54,null));};exports['create']=function(_0x40214b,_0x322e9d){var _0x17ac83;return db['sequelize'][_0x42ca('0x4b')](function(_0x5406aa){return db[_0x42ca('0x29')]['create'](_0x40214b[_0x42ca('0x49')],{'transaction':_0x5406aa})[_0x42ca('0x23')](function(_0x1acf2b){_0x17ac83=_0x1acf2b;var _0x505d64={'type':db[_0x42ca('0x4c')]['TEXT'],'transaction':_0x5406aa};switch(_0x40214b[_0x42ca('0x49')][_0x42ca('0x2a')]){case _0x42ca('0x4d'):_0x505d64[_0x42ca('0x2a')]=db[_0x42ca('0x4c')][_0x42ca('0x4e')];break;case _0x42ca('0x4f'):_0x505d64[_0x42ca('0x2a')]=db[_0x42ca('0x4c')][_0x42ca('0x50')];break;case _0x42ca('0x51'):_0x505d64[_0x42ca('0x2a')]=db[_0x42ca('0x4c')][_0x42ca('0x52')];_0x505d64['defaultValue']=![];break;default:}return db['sequelize'][_0x42ca('0x53')][_0x42ca('0x54')](_0x42ca('0x55'),util[_0x42ca('0x56')](_0x42ca('0x57'),_0x17ac83['id']),_0x505d64);})[_0x42ca('0x23')](function(){return _0x17ac83;});})[_0x42ca('0x23')](respondWithResult(_0x322e9d,0xc9))[_0x42ca('0x44')](handleError(_0x322e9d,null));}; \ No newline at end of file +var _0x9c06=['name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','includeAll','include','catch','show','params','length','options','find','body','destroy','create','sequelize','transaction','number','switch','Sequelize','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','save','update','then','error','stack'];(function(_0x4e5d6a,_0x20bbaf){var _0x412927=function(_0xbe402b){while(--_0xbe402b){_0x4e5d6a['push'](_0x4e5d6a['shift']());}};_0x412927(++_0x20bbaf);}(_0x9c06,0x7f));var _0x69c0=function(_0x210142,_0xb15dc7){_0x210142=_0x210142-0x0;var _0x1d3211=_0x9c06[_0x210142];return _0x1d3211;};'use strict';var emlformat=require(_0x69c0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x69c0('0x1'));var jsonpatch=require(_0x69c0('0x2'));var rp=require(_0x69c0('0x3'));var moment=require(_0x69c0('0x4'));var BPromise=require(_0x69c0('0x5'));var Mustache=require(_0x69c0('0x6'));var util=require(_0x69c0('0x7'));var path=require('path');var sox=require(_0x69c0('0x8'));var csv=require(_0x69c0('0x9'));var ejs=require(_0x69c0('0xa'));var fs=require('fs');var fs_extra=require(_0x69c0('0xb'));var _=require(_0x69c0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x69c0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x69c0('0x9'));var querystring=require(_0x69c0('0xe'));var Papa=require(_0x69c0('0xf'));var Redis=require('ioredis');var authService=require(_0x69c0('0x10'));var qs=require(_0x69c0('0x11'));var as=require(_0x69c0('0x12'));var hardwareService=require(_0x69c0('0x13'));var logger=require(_0x69c0('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x69c0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358170,_0x3cd7e2){_0x3cd7e2=_0x3cd7e2||0xcc;return function(_0x2f18ac){if(_0x2f18ac){return _0x358170[_0x69c0('0x16')](_0x3cd7e2);}return _0x358170['status'](_0x3cd7e2)[_0x69c0('0x17')]();};}function respondWithResult(_0x1995b9,_0xfab1d8){_0xfab1d8=_0xfab1d8||0xc8;return function(_0x362290){if(_0x362290){return _0x1995b9[_0x69c0('0x18')](_0xfab1d8)[_0x69c0('0x19')](_0x362290);}};}function respondWithFilteredResult(_0x2fc7fd,_0x3d4357){return function(_0x2cf642){if(_0x2cf642){var _0x37081a=typeof _0x3d4357['offset']===_0x69c0('0x1a')&&typeof _0x3d4357[_0x69c0('0x1b')]==='undefined';var _0xf18f80=_0x2cf642[_0x69c0('0x1c')];var _0x4def3d=_0x37081a?0x0:_0x3d4357[_0x69c0('0x1d')];var _0x287546=_0x37081a?_0x2cf642[_0x69c0('0x1c')]:_0x3d4357[_0x69c0('0x1d')]+_0x3d4357[_0x69c0('0x1b')];var _0xa018b7;if(_0x287546>=_0xf18f80){_0x287546=_0xf18f80;_0xa018b7=0xc8;}else{_0xa018b7=0xce;}_0x2fc7fd[_0x69c0('0x18')](_0xa018b7);return _0x2fc7fd['set']('Content-Range',_0x4def3d+'-'+_0x287546+'/'+_0xf18f80)[_0x69c0('0x19')](_0x2cf642);}return null;};}function patchUpdates(_0x4e1433){return function(_0x4dc14a){try{jsonpatch['apply'](_0x4dc14a,_0x4e1433,!![]);}catch(_0x380cf2){return BPromise['reject'](_0x380cf2);}return _0x4dc14a[_0x69c0('0x1e')]();};}function saveUpdates(_0x456e66,_0x4f4cc3){return function(_0x3970fd){if(_0x3970fd){return _0x3970fd[_0x69c0('0x1f')](_0x456e66)[_0x69c0('0x20')](function(_0x13ec3b){return _0x13ec3b;});}return null;};}function removeEntity(_0x1788bc,_0x1b2158){return function(_0x4bfb0c){if(_0x4bfb0c){return _0x4bfb0c['destroy']()[_0x69c0('0x20')](function(){_0x1788bc['status'](0xcc)[_0x69c0('0x17')]();});}};}function handleEntityNotFound(_0xac093,_0x419f05){return function(_0xd058cf){if(!_0xd058cf){_0xac093[_0x69c0('0x16')](0x194);}return _0xd058cf;};}function handleError(_0x586732,_0x4adcf6){_0x4adcf6=_0x4adcf6||0x1f4;return function(_0x2bb20e){logger[_0x69c0('0x21')](_0x2bb20e[_0x69c0('0x22')]);if(_0x2bb20e[_0x69c0('0x23')]){delete _0x2bb20e[_0x69c0('0x23')];}_0x586732[_0x69c0('0x18')](_0x4adcf6)['send'](_0x2bb20e);};}exports[_0x69c0('0x24')]=function(_0x2f1258,_0x1bdae4){var _0xdac53e={},_0x1f6e3c={},_0x4dad2d={'count':0x0,'rows':[]};var _0x4e7473=_[_0x69c0('0x25')](db[_0x69c0('0x26')][_0x69c0('0x27')],function(_0xbc430e){return{'name':_0xbc430e[_0x69c0('0x28')],'type':_0xbc430e[_0x69c0('0x29')][_0x69c0('0x2a')]};});_0x1f6e3c[_0x69c0('0x2b')]=_[_0x69c0('0x2c')](_['map'](_0x4e7473,_0x69c0('0x23')),[_0x69c0('0x23')]);_0x1f6e3c[_0x69c0('0x2d')]=_[_0x69c0('0x2e')](_0x2f1258[_0x69c0('0x2d')]);_0x1f6e3c['filters']=_[_0x69c0('0x2f')](_0x1f6e3c[_0x69c0('0x2b')],_0x1f6e3c[_0x69c0('0x2d')]);_0xdac53e[_0x69c0('0x30')]=_[_0x69c0('0x2f')](_0x1f6e3c[_0x69c0('0x2b')],qs[_0x69c0('0x31')](_0x2f1258[_0x69c0('0x2d')][_0x69c0('0x31')]));_0xdac53e[_0x69c0('0x30')]=_0xdac53e[_0x69c0('0x30')]['length']?_0xdac53e[_0x69c0('0x30')]:_0x1f6e3c[_0x69c0('0x2b')];if(!_0x2f1258[_0x69c0('0x2d')][_0x69c0('0x32')](_0x69c0('0x33'))){_0xdac53e[_0x69c0('0x1b')]=qs['limit'](_0x2f1258['query'][_0x69c0('0x1b')]);_0xdac53e[_0x69c0('0x1d')]=qs[_0x69c0('0x1d')](_0x2f1258[_0x69c0('0x2d')][_0x69c0('0x1d')]);}_0xdac53e[_0x69c0('0x34')]=qs[_0x69c0('0x35')](_0x2f1258['query'][_0x69c0('0x35')]);_0xdac53e['where']=qs[_0x69c0('0x36')](_[_0x69c0('0x37')](_0x2f1258[_0x69c0('0x2d')],_0x1f6e3c[_0x69c0('0x36')]),_0x4e7473);if(_0x2f1258['query']['filter']){_0xdac53e[_0x69c0('0x38')]=_[_0x69c0('0x39')](_0xdac53e[_0x69c0('0x38')],{'$or':_[_0x69c0('0x25')](_0x4e7473,function(_0x5b4067){if(_0x5b4067['type']!==_0x69c0('0x3a')){var _0x350c13={};_0x350c13[_0x5b4067[_0x69c0('0x23')]]={'$like':'%'+_0x2f1258['query']['filter']+'%'};return _0x350c13;}})});}_0xdac53e=_[_0x69c0('0x39')]({},_0xdac53e,_0x2f1258['options']);var _0x9a4251={'where':_0xdac53e[_0x69c0('0x38')]};return db[_0x69c0('0x26')][_0x69c0('0x1c')](_0x9a4251)[_0x69c0('0x20')](function(_0x262d1a){_0x4dad2d[_0x69c0('0x1c')]=_0x262d1a;if(_0x2f1258[_0x69c0('0x2d')][_0x69c0('0x3b')]){_0xdac53e[_0x69c0('0x3c')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0xdac53e);})[_0x69c0('0x20')](function(_0x23db67){_0x4dad2d['rows']=_0x23db67;return _0x4dad2d;})[_0x69c0('0x20')](respondWithFilteredResult(_0x1bdae4,_0xdac53e))[_0x69c0('0x3d')](handleError(_0x1bdae4,null));};exports[_0x69c0('0x3e')]=function(_0x3e275a,_0x4bb9d1){var _0x1ec341={'raw':!![],'where':{'id':_0x3e275a[_0x69c0('0x3f')]['id']}},_0x1ed19b={};_0x1ed19b['model']=_[_0x69c0('0x2e')](db[_0x69c0('0x26')][_0x69c0('0x27')]);_0x1ed19b[_0x69c0('0x2d')]=_[_0x69c0('0x2e')](_0x3e275a[_0x69c0('0x2d')]);_0x1ed19b[_0x69c0('0x36')]=_['intersection'](_0x1ed19b[_0x69c0('0x2b')],_0x1ed19b[_0x69c0('0x2d')]);_0x1ec341[_0x69c0('0x30')]=_[_0x69c0('0x2f')](_0x1ed19b[_0x69c0('0x2b')],qs[_0x69c0('0x31')](_0x3e275a[_0x69c0('0x2d')][_0x69c0('0x31')]));_0x1ec341['attributes']=_0x1ec341[_0x69c0('0x30')][_0x69c0('0x40')]?_0x1ec341[_0x69c0('0x30')]:_0x1ed19b['model'];if(_0x3e275a[_0x69c0('0x2d')]['includeAll']){_0x1ec341[_0x69c0('0x3c')]=[{'all':!![]}];}_0x1ec341=_['merge']({},_0x1ec341,_0x3e275a[_0x69c0('0x41')]);return db['CmCustomField'][_0x69c0('0x42')](_0x1ec341)[_0x69c0('0x20')](handleEntityNotFound(_0x4bb9d1,null))[_0x69c0('0x20')](respondWithResult(_0x4bb9d1,null))[_0x69c0('0x3d')](handleError(_0x4bb9d1,null));};exports['update']=function(_0x2cc4ed,_0x3503e3){if(_0x2cc4ed['body']['id']){delete _0x2cc4ed[_0x69c0('0x43')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x2cc4ed['params']['id']}})[_0x69c0('0x20')](handleEntityNotFound(_0x3503e3,null))['then'](saveUpdates(_0x2cc4ed[_0x69c0('0x43')],null))['then'](respondWithResult(_0x3503e3,null))[_0x69c0('0x3d')](handleError(_0x3503e3,null));};exports[_0x69c0('0x44')]=function(_0x45240e,_0x5a3f2){return db['CmCustomField'][_0x69c0('0x42')]({'where':{'id':_0x45240e[_0x69c0('0x3f')]['id']}})[_0x69c0('0x20')](handleEntityNotFound(_0x5a3f2,null))[_0x69c0('0x20')](removeEntity(_0x5a3f2,null))[_0x69c0('0x3d')](handleError(_0x5a3f2,null));};exports[_0x69c0('0x45')]=function(_0xefd285,_0x1c4293){var _0x37f509;return db[_0x69c0('0x46')][_0x69c0('0x47')](function(_0x1e5c44){return db[_0x69c0('0x26')][_0x69c0('0x45')](_0xefd285[_0x69c0('0x43')],{'transaction':_0x1e5c44})[_0x69c0('0x20')](function(_0x21a097){_0x37f509=_0x21a097;var _0x4b29f4={'type':db['Sequelize']['TEXT'],'transaction':_0x1e5c44};switch(_0xefd285['body'][_0x69c0('0x29')]){case'text':_0x4b29f4[_0x69c0('0x29')]=db['Sequelize']['TEXT'];break;case _0x69c0('0x48'):_0x4b29f4[_0x69c0('0x29')]=db['Sequelize']['INTEGER'];break;case _0x69c0('0x49'):_0x4b29f4[_0x69c0('0x29')]=db[_0x69c0('0x4a')][_0x69c0('0x4b')];_0x4b29f4[_0x69c0('0x4c')]=![];break;default:}return db[_0x69c0('0x46')]['queryInterface'][_0x69c0('0x4d')](_0x69c0('0x4e'),util[_0x69c0('0x4f')](_0x69c0('0x50'),_0x37f509['id']),_0x4b29f4);})[_0x69c0('0x20')](function(){return _0x37f509;});})[_0x69c0('0x20')](respondWithResult(_0x1c4293,0xc9))['catch'](handleError(_0x1c4293,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 2ed33ea..384f1e0 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 _0x2fb9=['CmCustomField','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x2bcabf,_0x15d055){var _0x2e869c=function(_0x5d2704){while(--_0x5d2704){_0x2bcabf['push'](_0x2bcabf['shift']());}};_0x2e869c(++_0x15d055);}(_0x2fb9,0xd1));var _0x92fb=function(_0x173272,_0x42fac6){_0x173272=_0x173272-0x0;var _0x5805b9=_0x2fb9[_0x173272];return _0x5805b9;};'use strict';var _=require(_0x92fb('0x0'));var util=require(_0x92fb('0x1'));var logger=require('../../config/logger')(_0x92fb('0x2'));var moment=require(_0x92fb('0x3'));var BPromise=require(_0x92fb('0x4'));var rp=require(_0x92fb('0x5'));var fs=require('fs');var path=require(_0x92fb('0x6'));var rimraf=require(_0x92fb('0x7'));var config=require(_0x92fb('0x8'));var attributes=require(_0x92fb('0x9'));module[_0x92fb('0xa')]=function(_0x482531,_0x4ce38b){return _0x482531[_0x92fb('0xb')](_0x92fb('0xc'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc409=['../../config/environment','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x49bdbb,_0x4e7f92){var _0x1f2843=function(_0x3f5042){while(--_0x3f5042){_0x49bdbb['push'](_0x49bdbb['shift']());}};_0x1f2843(++_0x4e7f92);}(_0xc409,0xe2));var _0x9c40=function(_0x277a43,_0x5418c6){_0x277a43=_0x277a43-0x0;var _0x37d663=_0xc409[_0x277a43];return _0x37d663;};'use strict';var _=require(_0x9c40('0x0'));var util=require(_0x9c40('0x1'));var logger=require(_0x9c40('0x2'))(_0x9c40('0x3'));var moment=require(_0x9c40('0x4'));var BPromise=require(_0x9c40('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c40('0x6'));var rimraf=require(_0x9c40('0x7'));var config=require(_0x9c40('0x8'));var attributes=require('./cmCustomField.attributes');module[_0x9c40('0x9')]=function(_0x3ad5b0,_0xbbb90b){return _0x3ad5b0[_0x9c40('0xa')](_0x9c40('0xb'),attributes,{'tableName':_0x9c40('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index ee5df93..9da5927 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 _0x73e6=['util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x3d8af7,_0x13c0ca){var _0x74a3e4=function(_0x58c167){while(--_0x58c167){_0x3d8af7['push'](_0x3d8af7['shift']());}};_0x74a3e4(++_0x13c0ca);}(_0x73e6,0x18f));var _0x673e=function(_0x395283,_0x4ce40e){_0x395283=_0x395283-0x0;var _0x57a286=_0x73e6[_0x395283];return _0x57a286;};'use strict';var _=require(_0x673e('0x0'));var util=require(_0x673e('0x1'));var moment=require(_0x673e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x673e('0x3'));var db=require(_0x673e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x673e('0x5'));var config=require(_0x673e('0x6'));var jayson=require(_0x673e('0x7'));var client=jayson['client'][_0x673e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x254fa3,_0x4ca253,_0x1138f6){return new BPromise(function(_0x1c44d5,_0x1538dd){return client[_0x673e('0x9')](_0x254fa3,_0x1138f6)[_0x673e('0xa')](function(_0x26e542){logger[_0x673e('0xb')](_0x673e('0xc'),_0x4ca253,_0x673e('0xd'));logger['debug'](_0x673e('0xe'),_0x4ca253,_0x673e('0xd'),JSON[_0x673e('0xf')](_0x26e542));if(_0x26e542['error']){if(_0x26e542[_0x673e('0x10')]['code']===0x1f4){logger['error'](_0x673e('0xc'),_0x4ca253,_0x26e542[_0x673e('0x10')][_0x673e('0x11')]);return _0x1538dd(_0x26e542['error'][_0x673e('0x11')]);}logger[_0x673e('0x10')](_0x673e('0xc'),_0x4ca253,_0x26e542[_0x673e('0x10')][_0x673e('0x11')]);return _0x1c44d5(_0x26e542[_0x673e('0x10')][_0x673e('0x11')]);}else{logger[_0x673e('0xb')](_0x673e('0xc'),_0x4ca253,_0x673e('0xd'));_0x1c44d5(_0x26e542[_0x673e('0x12')][_0x673e('0x11')]);}})[_0x673e('0x13')](function(_0x4e8d05){logger[_0x673e('0x10')](_0x673e('0xc'),_0x4ca253,_0x4e8d05);_0x1538dd(_0x4e8d05);});});} \ No newline at end of file +var _0x89dc=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x449251,_0x10ffbc){var _0x576878=function(_0x111e7c){while(--_0x111e7c){_0x449251['push'](_0x449251['shift']());}};_0x576878(++_0x10ffbc);}(_0x89dc,0x122));var _0xc89d=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x89dc[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0xc89d('0x0'));var util=require(_0xc89d('0x1'));var moment=require('moment');var BPromise=require(_0xc89d('0x2'));var rs=require(_0xc89d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc89d('0x4'))['db'];var utils=require(_0xc89d('0x5'));var logger=require('../../config/logger')(_0xc89d('0x6'));var config=require(_0xc89d('0x7'));var jayson=require(_0xc89d('0x8'));var client=jayson[_0xc89d('0x9')][_0xc89d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a06c8,_0x363d67,_0x50403c){return new BPromise(function(_0x2b7256,_0x24132f){return client[_0xc89d('0xb')](_0x3a06c8,_0x50403c)[_0xc89d('0xc')](function(_0x5e0239){logger[_0xc89d('0xd')](_0xc89d('0xe'),_0x363d67,_0xc89d('0xf'));logger[_0xc89d('0x10')](_0xc89d('0x11'),_0x363d67,_0xc89d('0xf'),JSON[_0xc89d('0x12')](_0x5e0239));if(_0x5e0239['error']){if(_0x5e0239[_0xc89d('0x13')][_0xc89d('0x14')]===0x1f4){logger['error'](_0xc89d('0xe'),_0x363d67,_0x5e0239[_0xc89d('0x13')][_0xc89d('0x15')]);return _0x24132f(_0x5e0239[_0xc89d('0x13')][_0xc89d('0x15')]);}logger['error'](_0xc89d('0xe'),_0x363d67,_0x5e0239[_0xc89d('0x13')][_0xc89d('0x15')]);return _0x2b7256(_0x5e0239['error'][_0xc89d('0x15')]);}else{logger[_0xc89d('0xd')](_0xc89d('0xe'),_0x363d67,_0xc89d('0xf'));_0x2b7256(_0x5e0239[_0xc89d('0x16')]['message']);}})[_0xc89d('0x17')](function(_0x1918ab){logger['error'](_0xc89d('0xe'),_0x363d67,_0x1918ab);_0x24132f(_0x1918ab);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 8a0bb6e..3ee7052 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 _0x7a08=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','show','post','create','update','delete','/:id'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x7a08,0x11e));var _0x87a0=function(_0x5aa6a9,_0x3ae14c){_0x5aa6a9=_0x5aa6a9-0x0;var _0x119ce5=_0x7a08[_0x5aa6a9];return _0x119ce5;};'use strict';var multer=require(_0x87a0('0x0'));var util=require(_0x87a0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x87a0('0x2'));var router=express[_0x87a0('0x3')]();var fs_extra=require(_0x87a0('0x4'));var auth=require(_0x87a0('0x5'));var interaction=require(_0x87a0('0x6'));var config=require(_0x87a0('0x7'));var controller=require(_0x87a0('0x8'));router[_0x87a0('0x9')]('/',auth[_0x87a0('0xa')](),controller[_0x87a0('0xb')]);router[_0x87a0('0x9')]('/:id',auth[_0x87a0('0xa')](),controller[_0x87a0('0xc')]);router[_0x87a0('0xd')]('/',auth[_0x87a0('0xa')](),controller[_0x87a0('0xe')]);router['put']('/:id',auth[_0x87a0('0xa')](),controller[_0x87a0('0xf')]);router[_0x87a0('0x10')](_0x87a0('0x11'),auth[_0x87a0('0xa')](),controller['destroy']);module[_0x87a0('0x12')]=router; \ No newline at end of file +var _0xe043=['isAuthenticated','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','show'];(function(_0x1ff575,_0xdba21f){var _0x48fc9e=function(_0x51cf97){while(--_0x51cf97){_0x1ff575['push'](_0x1ff575['shift']());}};_0x48fc9e(++_0xdba21f);}(_0xe043,0x113));var _0x3e04=function(_0x44ce51,_0xb1677c){_0x44ce51=_0x44ce51-0x0;var _0xc46ea8=_0xe043[_0x44ce51];return _0xc46ea8;};'use strict';var multer=require(_0x3e04('0x0'));var util=require(_0x3e04('0x1'));var path=require(_0x3e04('0x2'));var timeout=require(_0x3e04('0x3'));var express=require(_0x3e04('0x4'));var router=express[_0x3e04('0x5')]();var fs_extra=require(_0x3e04('0x6'));var auth=require(_0x3e04('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3e04('0x8'));var controller=require('./cmCustomField.controller');router[_0x3e04('0x9')]('/',auth['isAuthenticated'](),controller[_0x3e04('0xa')]);router[_0x3e04('0x9')](_0x3e04('0xb'),auth['isAuthenticated'](),controller[_0x3e04('0xc')]);router['post']('/',auth[_0x3e04('0xd')](),controller[_0x3e04('0xe')]);router[_0x3e04('0xf')]('/:id',auth[_0x3e04('0xd')](),controller['update']);router['delete']('/:id',auth[_0x3e04('0xd')](),controller[_0x3e04('0x10')]);module[_0x3e04('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index acd7382..2220cac 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 _0x2032=['contactListQueue','sequelize','exports','STRING','DATE','format','INTEGER','BOOLEAN','UNSIGNED'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x2032,0xd9));var _0x2203=function(_0x2e6d4a,_0x517265){_0x2e6d4a=_0x2e6d4a-0x0;var _0x201fd1=_0x2032[_0x2e6d4a];return _0x201fd1;};'use strict';var moment=require('moment');var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'phone':{'type':Sequelize[_0x2203('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x2203('0x3')],'defaultValue':moment()[_0x2203('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x2203('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2203('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2203('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x2203('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2203('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2203('0x3')]},'priority':{'type':Sequelize[_0x2203('0x5')](0x2)[_0x2203('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2203('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x2203('0x5')],'unique':_0x2203('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x2203('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x2203('0x8')},'CampaignId':{'type':Sequelize[_0x2203('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x2203('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2203('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2203('0x5')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x2203('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x47c5=['STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports'];(function(_0x20d6f0,_0x33e54c){var _0x105ceb=function(_0x4927e9){while(--_0x4927e9){_0x20d6f0['push'](_0x20d6f0['shift']());}};_0x105ceb(++_0x33e54c);}(_0x47c5,0x165));var _0x547c=function(_0x57ede0,_0x2c5e8c){_0x57ede0=_0x57ede0-0x0;var _0x60056=_0x47c5[_0x57ede0];return _0x60056;};'use strict';var moment=require(_0x547c('0x0'));var Sequelize=require(_0x547c('0x1'));module[_0x547c('0x2')]={'phone':{'type':Sequelize[_0x547c('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x547c('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x547c('0x5')],'defaultValue':moment()['format'](_0x547c('0x6'))},'countbusyretry':{'type':Sequelize[_0x547c('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x547c('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x547c('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x547c('0x5')]},'priority':{'type':Sequelize[_0x547c('0x7')](0x2)[_0x547c('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x547c('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x547c('0x7')],'unique':_0x547c('0x9')},'ListId':{'type':Sequelize[_0x547c('0x7')],'unique':_0x547c('0x9')},'UserId':{'type':Sequelize[_0x547c('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x547c('0x7')],'unique':_0x547c('0x9')},'CampaignId':{'type':Sequelize[_0x547c('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x547c('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x547c('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x547c('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x547c('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x547c('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x547c('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 1956ea7..a13e062 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 _0x1f09=['LOCK','UPDATE','Contact','CmCompany','Company','List','dialActive','update','recallme','CmList','getOpenContacts','preview','length','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','push','json','getTimezone','lodash','../../config/logger','../../config/environment','status','offset','undefined','count','limit','sendStatus','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','intersection','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$contains','$any','attributes','fields','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','include','findAll','then','rows','catch','show','includeAll','options','find','create','body','params','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','updatedAt','state','statedesc','deleted','membername','user','UserId','format','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','prev','isEmpty','priority','ASC','scheduledAt','literal','DESC','hopperIds','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat'];(function(_0x5311a1,_0x304912){var _0x2acb9f=function(_0x4803e7){while(--_0x4803e7){_0x5311a1['push'](_0x5311a1['shift']());}};_0x2acb9f(++_0x304912);}(_0x1f09,0x96));var _0x91f0=function(_0x4bec85,_0x7bca9){_0x4bec85=_0x4bec85-0x0;var _0x1799d3=_0x1f09[_0x4bec85];return _0x1799d3;};'use strict';var moment=require('moment');var _=require(_0x91f0('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x91f0('0x1'))('api');var shared=require(_0x91f0('0x2'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x10cbf6,_0x422f19){_0x422f19=_0x422f19||0xc8;return function(_0x218ee4){if(_0x218ee4){return _0x10cbf6[_0x91f0('0x3')](_0x422f19)['json'](_0x218ee4);}};}function respondWithFilteredResult(_0xe9469f,_0x131eeb){return function(_0x462972){if(_0x462972){var _0x53fba9=typeof _0x131eeb[_0x91f0('0x4')]===_0x91f0('0x5')&&typeof _0x131eeb['limit']===_0x91f0('0x5');var _0x49df67=_0x462972[_0x91f0('0x6')];var _0xe8b250=_0x53fba9?0x0:_0x131eeb[_0x91f0('0x4')];var _0x141e47=_0x53fba9?_0x462972[_0x91f0('0x6')]:_0x131eeb[_0x91f0('0x4')]+_0x131eeb[_0x91f0('0x7')];var _0x138b7a;if(_0x141e47>=_0x49df67){_0x141e47=_0x49df67;_0x138b7a=0xc8;}else{_0x138b7a=0xce;}_0xe9469f[_0x91f0('0x3')](_0x138b7a);return _0xe9469f['set']('Content-Range',_0xe8b250+'-'+_0x141e47+'/'+_0x49df67)['json'](_0x462972);}return null;};}function saveUpdates(_0x5b76a2,_0x132a05){return function(_0xe441b4){if(_0xe441b4){return _0xe441b4['update'](_0x5b76a2)['then'](function(_0x1d902b){return _0x1d902b;});}return null;};}function handleEntityNotFound(_0x2b21cb,_0x123ef6){return function(_0xdeac3a){if(!_0xdeac3a){_0x2b21cb[_0x91f0('0x8')](0x194);}return _0xdeac3a;};}function handleError(_0x165d30,_0x1ebfc4){_0x1ebfc4=_0x1ebfc4||0x1f4;return function(_0x50b84c){logger['error'](_0x50b84c['stack']);if(_0x50b84c[_0x91f0('0x9')]){delete _0x50b84c[_0x91f0('0x9')];}_0x165d30[_0x91f0('0x3')](_0x1ebfc4)[_0x91f0('0xa')](_0x50b84c);};}exports[_0x91f0('0xb')]=function(_0x2e163c,_0x1b5032){var _0x372213={},_0x4b24f1={},_0x3964e0={'count':0x0,'rows':[]};var _0xbf74f8=_[_0x91f0('0xc')](db[_0x91f0('0xd')][_0x91f0('0xe')],function(_0x58ce87){return{'name':_0x58ce87[_0x91f0('0xf')],'type':_0x58ce87[_0x91f0('0x10')][_0x91f0('0x11')]};});_0x4b24f1[_0x91f0('0x12')]=_[_0x91f0('0xc')](_0xbf74f8,_0x91f0('0x9'));_0x4b24f1[_0x91f0('0x13')]=_[_0x91f0('0x14')](_0x2e163c[_0x91f0('0x13')]);_0x4b24f1['filters']=_[_0x91f0('0x15')](_0x4b24f1[_0x91f0('0x12')],_0x4b24f1[_0x91f0('0x13')]);_0x4b24f1[_0x91f0('0x16')]=_[_0x91f0('0x17')](_0x4b24f1['filters'],[_0x91f0('0x18'),_0x91f0('0x19'),_0x91f0('0x1a'),_0x91f0('0x1b'),_0x91f0('0x1c'),_0x91f0('0x1d'),_0x91f0('0x1e'),_0x91f0('0x1f'),_0x91f0('0x20'),'$between',_0x91f0('0x21'),_0x91f0('0x22'),_0x91f0('0x23'),_0x91f0('0x24'),_0x91f0('0x25'),'$iLike','$notILike',_0x91f0('0x24'),'$overlap',_0x91f0('0x26'),'$contained',_0x91f0('0x27')]);_0x372213[_0x91f0('0x28')]=_[_0x91f0('0x15')](_0x4b24f1[_0x91f0('0x12')],qs[_0x91f0('0x29')](_0x2e163c[_0x91f0('0x13')][_0x91f0('0x29')]));_0x372213[_0x91f0('0x28')]=_0x372213['attributes']['length']?_0x372213['attributes']:_0x4b24f1['model'];if(!_0x2e163c[_0x91f0('0x13')][_0x91f0('0x2a')]('nolimit')){_0x372213['limit']=qs[_0x91f0('0x7')](_0x2e163c[_0x91f0('0x13')][_0x91f0('0x7')]);_0x372213[_0x91f0('0x4')]=qs['offset'](_0x2e163c['query'][_0x91f0('0x4')]);}_0x372213[_0x91f0('0x2b')]=qs[_0x91f0('0x2c')](_0x2e163c[_0x91f0('0x13')][_0x91f0('0x2c')]);_0x372213['where']=qs[_0x91f0('0x16')](_[_0x91f0('0x2d')](_0x2e163c[_0x91f0('0x13')],_0x4b24f1[_0x91f0('0x16')]),_0xbf74f8);if(_0x2e163c[_0x91f0('0x13')]['filter']){_0x372213['where']=_[_0x91f0('0x2e')](_0x372213[_0x91f0('0x2f')],{'$or':_[_0x91f0('0xc')](_0xbf74f8,function(_0x20a082){if(_0x20a082[_0x91f0('0x10')]!==_0x91f0('0x30')){var _0x13be17={};_0x13be17[_0x20a082['name']]={'$like':'%'+_0x2e163c[_0x91f0('0x13')][_0x91f0('0x31')]+'%'};return _0x13be17;}})});}_0x372213=_[_0x91f0('0x2e')]({},_0x372213,_0x2e163c['options']);var _0xdbbde9={'where':_0x372213[_0x91f0('0x2f')]};return db['CmHopper'][_0x91f0('0x6')](_0xdbbde9)['then'](function(_0x948d98){_0x3964e0[_0x91f0('0x6')]=_0x948d98;if(_0x2e163c['query']['includeAll']){_0x372213[_0x91f0('0x32')]=[{'all':!![]}];}return db[_0x91f0('0xd')][_0x91f0('0x33')](_0x372213);})[_0x91f0('0x34')](function(_0x47684f){_0x3964e0[_0x91f0('0x35')]=_0x47684f;return _0x3964e0;})[_0x91f0('0x34')](respondWithFilteredResult(_0x1b5032,_0x372213))[_0x91f0('0x36')](handleError(_0x1b5032,null));};exports[_0x91f0('0x37')]=function(_0x439d73,_0x3e5138){var _0x175dda={'raw':!![],'where':{'id':_0x439d73['params']['id']}},_0x2466de={};_0x2466de[_0x91f0('0x12')]=_[_0x91f0('0x14')](db[_0x91f0('0xd')][_0x91f0('0xe')]);_0x2466de[_0x91f0('0x13')]=_[_0x91f0('0x14')](_0x439d73[_0x91f0('0x13')]);_0x2466de['filters']=_[_0x91f0('0x15')](_0x2466de[_0x91f0('0x12')],_0x2466de[_0x91f0('0x13')]);_0x175dda[_0x91f0('0x28')]=_['intersection'](_0x2466de['model'],qs['fields'](_0x439d73[_0x91f0('0x13')]['fields']));_0x175dda[_0x91f0('0x28')]=_0x175dda[_0x91f0('0x28')]['length']?_0x175dda['attributes']:_0x2466de[_0x91f0('0x12')];if(_0x439d73[_0x91f0('0x13')][_0x91f0('0x38')]){_0x175dda[_0x91f0('0x32')]=[{'all':!![]}];}_0x175dda=_[_0x91f0('0x2e')]({},_0x175dda,_0x439d73[_0x91f0('0x39')]);return db[_0x91f0('0xd')][_0x91f0('0x3a')](_0x175dda)[_0x91f0('0x34')](handleEntityNotFound(_0x3e5138,null))['then'](respondWithResult(_0x3e5138,null))[_0x91f0('0x36')](handleError(_0x3e5138,null));};exports[_0x91f0('0x3b')]=function(_0x4c92c9,_0x18195b){return db['CmHopper']['create'](_0x4c92c9[_0x91f0('0x3c')],{})[_0x91f0('0x34')](respondWithResult(_0x18195b,0xc9))[_0x91f0('0x36')](handleError(_0x18195b,null));};exports['update']=function(_0x594bb2,_0x4e33b4){if(_0x594bb2[_0x91f0('0x3c')]['id']){delete _0x594bb2[_0x91f0('0x3c')]['id'];}return db[_0x91f0('0xd')][_0x91f0('0x3a')]({'where':{'id':_0x594bb2[_0x91f0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4e33b4,null))[_0x91f0('0x34')](saveUpdates(_0x594bb2[_0x91f0('0x3c')],null))['then'](respondWithResult(_0x4e33b4,null))[_0x91f0('0x36')](handleError(_0x4e33b4,null));};exports[_0x91f0('0x3e')]=function(_0x97cbf8,_0x70f583){return db[_0x91f0('0xd')][_0x91f0('0x3e')]()[_0x91f0('0x34')](respondWithResult(_0x70f583,null))['catch'](handleError(_0x70f583,null));};exports[_0x91f0('0x3f')]=function(_0x26bbcb,_0x315ce1){var _0x19c64a;return db[_0x91f0('0xd')][_0x91f0('0x3a')]({'where':{'id':_0x26bbcb[_0x91f0('0x3d')]['id']}})[_0x91f0('0x34')](handleEntityNotFound(_0x315ce1,null))[_0x91f0('0x34')](function(_0x25d967){if(_0x25d967){return _0x25d967[_0x91f0('0x3f')]()[_0x91f0('0x34')](function(_0x17abdd){return _0x17abdd;});}})[_0x91f0('0x34')](function(_0x34696d){_0x19c64a=_0x34696d;if(_0x34696d){if(_0x34696d[_0x91f0('0x40')]||_0x34696d[_0x91f0('0x41')]){return db[_0x34696d[_0x91f0('0x40')]?_0x91f0('0x42'):_0x91f0('0x43')]['find']({'where':{'id':_0x34696d[_0x91f0('0x40')]?_0x34696d[_0x91f0('0x40')]:_0x34696d[_0x91f0('0x41')]},'attributes':['id',_0x91f0('0x9')],'raw':!![]});}}})[_0x91f0('0x34')](function(_0x2730b5){var _0x8afeaf={};if(_0x2730b5){_['merge'](_0x8afeaf,_['omit'](_0x19c64a[_0x91f0('0x44')],['createdAt',_0x91f0('0x45'),'id']));_0x8afeaf[_0x91f0('0x46')]=0x15;_0x8afeaf[_0x91f0('0x47')]=_0x91f0('0x48');_0x8afeaf['campaign']=_0x2730b5[_0x91f0('0x9')];_0x8afeaf[_0x91f0('0x49')]=_0x26bbcb[_0x91f0('0x4a')][_0x91f0('0x9')];_0x8afeaf[_0x91f0('0x4b')]=_0x26bbcb[_0x91f0('0x4a')]['id'];_0x8afeaf[_0x91f0('0x48')]=!![];_0x8afeaf['deletedat']=moment()[_0x91f0('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x8afeaf[_0x91f0('0x4d')]=_0x19c64a['phone'];_0x8afeaf[_0x91f0('0x4e')]=_0x19c64a[_0x91f0('0x40')]?_0x91f0('0x4f'):_0x91f0('0x50');return db[_0x91f0('0x51')][_0x91f0('0x3a')]({'where':{'id':_0x8afeaf[_0x91f0('0x52')]},'attributes':[_0x91f0('0x53'),_0x91f0('0x54')]})[_0x91f0('0x34')](function(_0x3de04a){if(!_[_0x91f0('0x55')](_0x315ce1)&&!_[_0x91f0('0x55')](_0x3de04a[_0x91f0('0x53')])){_0x8afeaf[_0x91f0('0x56')]=_0x3de04a[_0x91f0('0x53')];if(!_[_0x91f0('0x55')](_0x3de04a[_0x91f0('0x54')])){_0x8afeaf[_0x91f0('0x56')]+='\x20'+_0x3de04a[_0x91f0('0x54')];}}})[_0x91f0('0x57')](function(){return db['CmHopperFinal'][_0x91f0('0x3b')](_0x8afeaf);});}})[_0x91f0('0x34')](function(){return _0x315ce1[_0x91f0('0x3')](0xcc)['end']();})[_0x91f0('0x36')](handleError(_0x315ce1,null));};exports['getPreview']=function(_0x94b80a,_0x6d2250){var _0x5de47d=[];return db['CmContact'][_0x91f0('0x3e')]()[_0x91f0('0x34')](function(_0x1113c0){_0x5de47d=_[_0x91f0('0x14')](_0x1113c0);return _0x94b80a[_0x91f0('0x4a')][_0x91f0('0x58')]({'where':{'type':_0x91f0('0x59'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x91f0('0x5a'),_0x91f0('0x5b')],'raw':!![]});})[_0x91f0('0x34')](function(_0x538d55){if(_0x538d55&&_0x538d55['length']){return db[_0x91f0('0x5c')][_0x91f0('0x5d')](function(_0x1e95f5){var _0x3ee79b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x91f0('0x4c')](_0x91f0('0x5e'))},'VoiceQueueId':{'$in':_['map'](_0x538d55,'id')},'$or':[{'UserId':null},{'UserId':_0x94b80a[_0x91f0('0x4a')]['id']}]};var _0x238535={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x538d55)[_0x91f0('0x31')](['dialPreviewAutoRecallMe',0x0])[_0x91f0('0xc')]('id')[_0x91f0('0x5f')]()},'$or':[{'UserId':null},{'UserId':_0x94b80a[_0x91f0('0x4a')]['id']}]};var _0x266bb9={'$or':[_0x3ee79b,_0x238535]};var _0x21571b=[];if(_0x94b80a[_0x91f0('0x3c')][_0x91f0('0x60')]&&_0x94b80a[_0x91f0('0x3c')][_0x91f0('0x60')]===_0x91f0('0x61')){if(!_[_0x91f0('0x62')](_0x94b80a[_0x91f0('0x3c')]['hopperIds'])){_0x266bb9['id']={'$in':_0x94b80a[_0x91f0('0x3c')]['hopperIds']};}_0x21571b=[[_0x91f0('0x63'),_0x91f0('0x64')],[_0x91f0('0x65'),_0x538d55[0x0][_0x91f0('0x5a')]==='ASC'?'DESC':'ASC'],db['sequelize'][_0x91f0('0x66')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x91f0('0x67')]];}else{if(!_['isEmpty'](_0x94b80a['body'][_0x91f0('0x68')])){_0x266bb9['id']={'$notIn':_0x94b80a[_0x91f0('0x3c')][_0x91f0('0x68')]};}_0x21571b=[[_0x91f0('0x63'),'DESC'],[_0x91f0('0x65'),_0x538d55[0x0]['dialOrderByScheduledAt']],db[_0x91f0('0x5c')]['literal'](_0x91f0('0x69')),['id',_0x91f0('0x64')]];}return db[_0x91f0('0xd')][_0x91f0('0x6a')]({'attributes':['id',_0x91f0('0x6b'),'recallme'],'where':_0x266bb9,'order':_0x21571b,'transaction':_0x1e95f5,'lock':_0x1e95f5[_0x91f0('0x6c')][_0x91f0('0x6d')],'include':[{'model':db[_0x91f0('0x51')],'as':_0x91f0('0x6e'),'attributes':_0x5de47d,'include':[{'model':db[_0x91f0('0x6f')],'as':_0x91f0('0x70'),'attributes':['id',_0x91f0('0x9')]}]},{'model':db['CmList'],'as':_0x91f0('0x71'),'attributes':['id',_0x91f0('0x9')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x91f0('0x9'),_0x91f0('0x72')]}]})[_0x91f0('0x34')](function(_0x4b52d4){if(_0x4b52d4){return _0x4b52d4[_0x91f0('0x73')]({'UserId':_0x94b80a['user']['id']},{'transaction':_0x1e95f5});}});});}})[_0x91f0('0x34')](handleEntityNotFound(_0x6d2250,null))['then'](respondWithResult(_0x6d2250,null))[_0x91f0('0x36')](handleError(_0x6d2250,null));};exports['getPreviewRecall']=function(_0x2ff3fe,_0x163f12,_0x4c71d3){var _0x41856a=[];var _0x552c99=_0x2ff3fe[_0x91f0('0x3d')]['id'];var _0x2d0997=_0x2ff3fe[_0x91f0('0x4a')]['id'];return db[_0x91f0('0x51')][_0x91f0('0x3e')]()[_0x91f0('0x34')](function(_0xb13907){_0x41856a=_[_0x91f0('0x14')](_0xb13907);return db[_0x91f0('0x5c')][_0x91f0('0x5d')](function(_0x52bde2){const _0x2aa1a1={'id':_0x552c99};return db['CmHopper']['findOne']({'attributes':['id',_0x91f0('0x6b'),_0x91f0('0x74')],'where':_0x2aa1a1,'transaction':_0x52bde2,'lock':_0x52bde2[_0x91f0('0x6c')][_0x91f0('0x6d')],'include':[{'model':db['CmContact'],'as':_0x91f0('0x6e'),'attributes':_0x41856a,'include':[{'model':db['CmCompany'],'as':_0x91f0('0x70'),'attributes':['id',_0x91f0('0x9')]}]},{'model':db[_0x91f0('0x75')],'as':_0x91f0('0x71'),'attributes':['id',_0x91f0('0x9')]},{'model':db[_0x91f0('0x42')],'as':'Queue','attributes':['id',_0x91f0('0x9'),'dialActive']}]})[_0x91f0('0x34')](function(_0x539503){if(_0x539503){return _0x539503[_0x91f0('0x73')]({'UserId':_0x2d0997},{'transaction':_0x52bde2});}});});})[_0x91f0('0x34')](handleEntityNotFound(_0x163f12,null))['then'](respondWithResult(_0x163f12,null))[_0x91f0('0x36')](handleError(_0x163f12,null));};exports[_0x91f0('0x76')]=function(_0x511f60,_0x146e66){return _0x511f60[_0x91f0('0x4a')][_0x91f0('0x58')]({'where':{'type':_0x91f0('0x59'),'dialActive':!![],'dialMethod':_0x91f0('0x77')},'attributes':['id'],'raw':!![]})[_0x91f0('0x34')](function(_0x3a3b98){if(_0x3a3b98&&_0x3a3b98[_0x91f0('0x78')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x91f0('0x4c')](_0x91f0('0x5e'))},'VoiceQueueId':{'$in':_[_0x91f0('0xc')](_0x3a3b98,'id')},'$or':[{'UserId':null},{'UserId':_0x511f60['user']['id']}]}});}return 0x0;})[_0x91f0('0x34')](function(_0x57e42d){if(!_[_0x91f0('0x55')](_0x57e42d)&&_[_0x91f0('0x79')](_0x57e42d)){return _0x146e66[_0x91f0('0x3')](0xc8)['json']({'contacts':_0x57e42d});}else{logger[_0x91f0('0x7a')](_0x91f0('0x7b'),_0x91f0('0x76'),0x194,'entity\x20not\x20found');_0x146e66[_0x91f0('0x8')](0x194);}})[_0x91f0('0x36')](handleError(_0x146e66,null));};exports[_0x91f0('0x7c')]=function(_0xba0d18,_0x1265b0){var _0x171535=shared[_0x91f0('0x7d')];var _0x365a5b=[];_[_0x91f0('0xc')](_0x171535,function(_0x4d1ef4){_0x365a5b[_0x91f0('0x7e')]({'id':_0x4d1ef4['name'],'name':_0x4d1ef4[_0x91f0('0x9')],'utcOffset':_0x4d1ef4['utcOffset']});});return _0x1265b0[_0x91f0('0x3')](0xc8)[_0x91f0('0x7f')]({'tz':_0x365a5b});};exports[_0x91f0('0x80')]=function(_0x220431,_0xa2de28){var _0x2ac774=shared[_0x91f0('0x7d')];var _0x130dc4={};if(!_[_0x91f0('0x55')](_0x2ac774[_0x220431[_0x91f0('0x3c')]['id']]))_0x130dc4=_0x2ac774[_0x220431[_0x91f0('0x3c')]['id']];return _0xa2de28[_0x91f0('0x3')](0xc8)[_0x91f0('0x7f')](_0x130dc4);}; \ No newline at end of file +var _0x9c12=['VoiceQueueId','VoiceQueue','Campaign','CampaignId','dataValues','createdAt','state','statedesc','deleted','campaign','membername','user','UserId','format','calleridnum','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','hopperIds','priority','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','dialActive','getPreviewRecall','getOpenContacts','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','push','utcOffset','timezones','moment','../../components/parsers/qs','api','../../config/environment','status','json','offset','undefined','limit','count','Content-Range','update','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$contains','$any','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','CmHopper','then','includeAll','findAll','rows','catch','params','include','find','create','body','describe','destroy'];(function(_0x5aa941,_0x1a599d){var _0x1634fb=function(_0x581dd5){while(--_0x581dd5){_0x5aa941['push'](_0x5aa941['shift']());}};_0x1634fb(++_0x1a599d);}(_0x9c12,0x153));var _0x29c1=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x9c12[_0x1a9204];return _0x17ca68;};'use strict';var moment=require(_0x29c1('0x0'));var _=require('lodash');var qs=require(_0x29c1('0x1'));var logger=require('../../config/logger')(_0x29c1('0x2'));var shared=require(_0x29c1('0x3'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x53558b,_0x5bafd7){_0x5bafd7=_0x5bafd7||0xc8;return function(_0xdae1e4){if(_0xdae1e4){return _0x53558b[_0x29c1('0x4')](_0x5bafd7)[_0x29c1('0x5')](_0xdae1e4);}};}function respondWithFilteredResult(_0x9dd326,_0x523f5a){return function(_0x388db){if(_0x388db){var _0x27908e=typeof _0x523f5a[_0x29c1('0x6')]===_0x29c1('0x7')&&typeof _0x523f5a[_0x29c1('0x8')]===_0x29c1('0x7');var _0x3eab61=_0x388db[_0x29c1('0x9')];var _0x172c06=_0x27908e?0x0:_0x523f5a[_0x29c1('0x6')];var _0x30dbf2=_0x27908e?_0x388db[_0x29c1('0x9')]:_0x523f5a[_0x29c1('0x6')]+_0x523f5a['limit'];var _0x49dc74;if(_0x30dbf2>=_0x3eab61){_0x30dbf2=_0x3eab61;_0x49dc74=0xc8;}else{_0x49dc74=0xce;}_0x9dd326['status'](_0x49dc74);return _0x9dd326['set'](_0x29c1('0xa'),_0x172c06+'-'+_0x30dbf2+'/'+_0x3eab61)[_0x29c1('0x5')](_0x388db);}return null;};}function saveUpdates(_0x18a8ab,_0x4ae048){return function(_0x21907c){if(_0x21907c){return _0x21907c[_0x29c1('0xb')](_0x18a8ab)['then'](function(_0x16613){return _0x16613;});}return null;};}function handleEntityNotFound(_0x35a0e8,_0xa0eb92){return function(_0x15a23c){if(!_0x15a23c){_0x35a0e8[_0x29c1('0xc')](0x194);}return _0x15a23c;};}function handleError(_0x46e07d,_0x32714a){_0x32714a=_0x32714a||0x1f4;return function(_0x20aa30){logger[_0x29c1('0xd')](_0x20aa30[_0x29c1('0xe')]);if(_0x20aa30[_0x29c1('0xf')]){delete _0x20aa30['name'];}_0x46e07d[_0x29c1('0x4')](_0x32714a)[_0x29c1('0x10')](_0x20aa30);};}exports[_0x29c1('0x11')]=function(_0xb7db18,_0x2bbbf6){var _0x7652f4={},_0x1b57f5={},_0x5b69a4={'count':0x0,'rows':[]};var _0x1734b9=_[_0x29c1('0x12')](db['CmHopper'][_0x29c1('0x13')],function(_0x39f06e){return{'name':_0x39f06e[_0x29c1('0x14')],'type':_0x39f06e[_0x29c1('0x15')][_0x29c1('0x16')]};});_0x1b57f5[_0x29c1('0x17')]=_['map'](_0x1734b9,'name');_0x1b57f5['query']=_[_0x29c1('0x18')](_0xb7db18['query']);_0x1b57f5[_0x29c1('0x19')]=_[_0x29c1('0x1a')](_0x1b57f5[_0x29c1('0x17')],_0x1b57f5['query']);_0x1b57f5['filters']=_[_0x29c1('0x1b')](_0x1b57f5['filters'],[_0x29c1('0x1c'),_0x29c1('0x1d'),_0x29c1('0x1e'),_0x29c1('0x1f'),_0x29c1('0x20'),'$lte',_0x29c1('0x21'),_0x29c1('0x22'),_0x29c1('0x23'),_0x29c1('0x24'),_0x29c1('0x25'),_0x29c1('0x26'),'$notIn',_0x29c1('0x27'),_0x29c1('0x28'),_0x29c1('0x29'),_0x29c1('0x2a'),_0x29c1('0x27'),'$overlap',_0x29c1('0x2b'),'$contained',_0x29c1('0x2c')]);_0x7652f4[_0x29c1('0x2d')]=_[_0x29c1('0x1a')](_0x1b57f5[_0x29c1('0x17')],qs[_0x29c1('0x2e')](_0xb7db18[_0x29c1('0x2f')][_0x29c1('0x2e')]));_0x7652f4[_0x29c1('0x2d')]=_0x7652f4[_0x29c1('0x2d')][_0x29c1('0x30')]?_0x7652f4[_0x29c1('0x2d')]:_0x1b57f5[_0x29c1('0x17')];if(!_0xb7db18[_0x29c1('0x2f')][_0x29c1('0x31')](_0x29c1('0x32'))){_0x7652f4[_0x29c1('0x8')]=qs['limit'](_0xb7db18[_0x29c1('0x2f')][_0x29c1('0x8')]);_0x7652f4[_0x29c1('0x6')]=qs[_0x29c1('0x6')](_0xb7db18[_0x29c1('0x2f')][_0x29c1('0x6')]);}_0x7652f4[_0x29c1('0x33')]=qs[_0x29c1('0x34')](_0xb7db18['query'][_0x29c1('0x34')]);_0x7652f4['where']=qs['filters'](_[_0x29c1('0x35')](_0xb7db18['query'],_0x1b57f5[_0x29c1('0x19')]),_0x1734b9);if(_0xb7db18[_0x29c1('0x2f')]['filter']){_0x7652f4[_0x29c1('0x36')]=_[_0x29c1('0x37')](_0x7652f4[_0x29c1('0x36')],{'$or':_[_0x29c1('0x12')](_0x1734b9,function(_0x1ff111){if(_0x1ff111[_0x29c1('0x15')]!==_0x29c1('0x38')){var _0x104358={};_0x104358[_0x1ff111[_0x29c1('0xf')]]={'$like':'%'+_0xb7db18[_0x29c1('0x2f')][_0x29c1('0x39')]+'%'};return _0x104358;}})});}_0x7652f4=_['merge']({},_0x7652f4,_0xb7db18[_0x29c1('0x3a')]);var _0x85353f={'where':_0x7652f4[_0x29c1('0x36')]};return db[_0x29c1('0x3b')][_0x29c1('0x9')](_0x85353f)[_0x29c1('0x3c')](function(_0x10ae57){_0x5b69a4['count']=_0x10ae57;if(_0xb7db18['query'][_0x29c1('0x3d')]){_0x7652f4['include']=[{'all':!![]}];}return db[_0x29c1('0x3b')][_0x29c1('0x3e')](_0x7652f4);})[_0x29c1('0x3c')](function(_0x57648a){_0x5b69a4[_0x29c1('0x3f')]=_0x57648a;return _0x5b69a4;})[_0x29c1('0x3c')](respondWithFilteredResult(_0x2bbbf6,_0x7652f4))[_0x29c1('0x40')](handleError(_0x2bbbf6,null));};exports['show']=function(_0x489d87,_0x50d33b){var _0x54bffa={'raw':!![],'where':{'id':_0x489d87[_0x29c1('0x41')]['id']}},_0x29cb59={};_0x29cb59[_0x29c1('0x17')]=_[_0x29c1('0x18')](db[_0x29c1('0x3b')][_0x29c1('0x13')]);_0x29cb59[_0x29c1('0x2f')]=_[_0x29c1('0x18')](_0x489d87[_0x29c1('0x2f')]);_0x29cb59[_0x29c1('0x19')]=_[_0x29c1('0x1a')](_0x29cb59[_0x29c1('0x17')],_0x29cb59[_0x29c1('0x2f')]);_0x54bffa['attributes']=_[_0x29c1('0x1a')](_0x29cb59[_0x29c1('0x17')],qs[_0x29c1('0x2e')](_0x489d87[_0x29c1('0x2f')][_0x29c1('0x2e')]));_0x54bffa['attributes']=_0x54bffa[_0x29c1('0x2d')][_0x29c1('0x30')]?_0x54bffa['attributes']:_0x29cb59[_0x29c1('0x17')];if(_0x489d87['query'][_0x29c1('0x3d')]){_0x54bffa[_0x29c1('0x42')]=[{'all':!![]}];}_0x54bffa=_[_0x29c1('0x37')]({},_0x54bffa,_0x489d87[_0x29c1('0x3a')]);return db[_0x29c1('0x3b')][_0x29c1('0x43')](_0x54bffa)[_0x29c1('0x3c')](handleEntityNotFound(_0x50d33b,null))[_0x29c1('0x3c')](respondWithResult(_0x50d33b,null))[_0x29c1('0x40')](handleError(_0x50d33b,null));};exports[_0x29c1('0x44')]=function(_0x3b9230,_0x2e784d){return db['CmHopper'][_0x29c1('0x44')](_0x3b9230[_0x29c1('0x45')],{})['then'](respondWithResult(_0x2e784d,0xc9))[_0x29c1('0x40')](handleError(_0x2e784d,null));};exports[_0x29c1('0xb')]=function(_0x411e64,_0x1077f1){if(_0x411e64[_0x29c1('0x45')]['id']){delete _0x411e64[_0x29c1('0x45')]['id'];}return db[_0x29c1('0x3b')]['find']({'where':{'id':_0x411e64[_0x29c1('0x41')]['id']}})['then'](handleEntityNotFound(_0x1077f1,null))['then'](saveUpdates(_0x411e64[_0x29c1('0x45')],null))[_0x29c1('0x3c')](respondWithResult(_0x1077f1,null))[_0x29c1('0x40')](handleError(_0x1077f1,null));};exports[_0x29c1('0x46')]=function(_0x2a2d94,_0x527833){return db[_0x29c1('0x3b')]['describe']()['then'](respondWithResult(_0x527833,null))[_0x29c1('0x40')](handleError(_0x527833,null));};exports[_0x29c1('0x47')]=function(_0x23b042,_0x589916){var _0x251f1c;return db[_0x29c1('0x3b')][_0x29c1('0x43')]({'where':{'id':_0x23b042[_0x29c1('0x41')]['id']}})['then'](handleEntityNotFound(_0x589916,null))['then'](function(_0x151c73){if(_0x151c73){return _0x151c73[_0x29c1('0x47')]()[_0x29c1('0x3c')](function(_0x25c838){return _0x25c838;});}})[_0x29c1('0x3c')](function(_0x186afb){_0x251f1c=_0x186afb;if(_0x186afb){if(_0x186afb['VoiceQueueId']||_0x186afb['CampaignId']){return db[_0x186afb[_0x29c1('0x48')]?_0x29c1('0x49'):_0x29c1('0x4a')][_0x29c1('0x43')]({'where':{'id':_0x186afb[_0x29c1('0x48')]?_0x186afb[_0x29c1('0x48')]:_0x186afb[_0x29c1('0x4b')]},'attributes':['id',_0x29c1('0xf')],'raw':!![]});}}})[_0x29c1('0x3c')](function(_0x46c87d){var _0x265e4e={};if(_0x46c87d){_[_0x29c1('0x37')](_0x265e4e,_['omit'](_0x251f1c[_0x29c1('0x4c')],[_0x29c1('0x4d'),'updatedAt','id']));_0x265e4e[_0x29c1('0x4e')]=0x15;_0x265e4e[_0x29c1('0x4f')]=_0x29c1('0x50');_0x265e4e[_0x29c1('0x51')]=_0x46c87d[_0x29c1('0xf')];_0x265e4e[_0x29c1('0x52')]=_0x23b042[_0x29c1('0x53')][_0x29c1('0xf')];_0x265e4e[_0x29c1('0x54')]=_0x23b042[_0x29c1('0x53')]['id'];_0x265e4e[_0x29c1('0x50')]=!![];_0x265e4e['deletedat']=moment()[_0x29c1('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x265e4e[_0x29c1('0x56')]=_0x251f1c[_0x29c1('0x57')];_0x265e4e[_0x29c1('0x58')]=_0x251f1c[_0x29c1('0x48')]?_0x29c1('0x59'):_0x29c1('0x5a');return db[_0x29c1('0x5b')][_0x29c1('0x43')]({'where':{'id':_0x265e4e['ContactId']},'attributes':[_0x29c1('0x5c'),_0x29c1('0x5d')]})['then'](function(_0x527591){if(!_[_0x29c1('0x5e')](_0x589916)&&!_['isNil'](_0x527591[_0x29c1('0x5c')])){_0x265e4e[_0x29c1('0x5f')]=_0x527591[_0x29c1('0x5c')];if(!_['isNil'](_0x527591[_0x29c1('0x5d')])){_0x265e4e[_0x29c1('0x5f')]+='\x20'+_0x527591['lastName'];}}})[_0x29c1('0x60')](function(){return db[_0x29c1('0x61')][_0x29c1('0x44')](_0x265e4e);});}})[_0x29c1('0x3c')](function(){return _0x589916[_0x29c1('0x4')](0xcc)[_0x29c1('0x62')]();})['catch'](handleError(_0x589916,null));};exports[_0x29c1('0x63')]=function(_0x1413a6,_0x5d8714){var _0x32c34a=[];return db[_0x29c1('0x5b')][_0x29c1('0x46')]()[_0x29c1('0x3c')](function(_0x163e87){_0x32c34a=_[_0x29c1('0x18')](_0x163e87);return _0x1413a6[_0x29c1('0x53')][_0x29c1('0x64')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x29c1('0x65')},'attributes':['id',_0x29c1('0x66'),_0x29c1('0x67')],'raw':!![]});})[_0x29c1('0x3c')](function(_0x4cb3a1){if(_0x4cb3a1&&_0x4cb3a1[_0x29c1('0x30')]){return db[_0x29c1('0x68')][_0x29c1('0x69')](function(_0x5d6f6e){var _0x3a915f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x29c1('0x55')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x29c1('0x12')](_0x4cb3a1,'id')},'$or':[{'UserId':null},{'UserId':_0x1413a6[_0x29c1('0x53')]['id']}]};var _0x507c8b={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4cb3a1)[_0x29c1('0x39')]([_0x29c1('0x67'),0x0])[_0x29c1('0x12')]('id')[_0x29c1('0x6a')]()},'$or':[{'UserId':null},{'UserId':_0x1413a6['user']['id']}]};var _0x3455a8={'$or':[_0x3a915f,_0x507c8b]};var _0x14c5d4=[];if(_0x1413a6['body'][_0x29c1('0x6b')]&&_0x1413a6[_0x29c1('0x45')][_0x29c1('0x6b')]===_0x29c1('0x6c')){if(!_['isEmpty'](_0x1413a6[_0x29c1('0x45')][_0x29c1('0x6d')])){_0x3455a8['id']={'$in':_0x1413a6[_0x29c1('0x45')][_0x29c1('0x6d')]};}_0x14c5d4=[[_0x29c1('0x6e'),'ASC'],['scheduledAt',_0x4cb3a1[0x0][_0x29c1('0x66')]===_0x29c1('0x6f')?'DESC':_0x29c1('0x6f')],db['sequelize'][_0x29c1('0x70')](_0x29c1('0x71')),['id',_0x29c1('0x72')]];}else{if(!_['isEmpty'](_0x1413a6[_0x29c1('0x45')][_0x29c1('0x6d')])){_0x3455a8['id']={'$notIn':_0x1413a6[_0x29c1('0x45')][_0x29c1('0x6d')]};}_0x14c5d4=[[_0x29c1('0x6e'),'DESC'],[_0x29c1('0x73'),_0x4cb3a1[0x0][_0x29c1('0x66')]],db['sequelize'][_0x29c1('0x70')](_0x29c1('0x74')),['id','ASC']];}return db[_0x29c1('0x3b')][_0x29c1('0x75')]({'attributes':['id',_0x29c1('0x76'),_0x29c1('0x77')],'where':_0x3455a8,'order':_0x14c5d4,'transaction':_0x5d6f6e,'lock':_0x5d6f6e[_0x29c1('0x78')][_0x29c1('0x79')],'include':[{'model':db[_0x29c1('0x5b')],'as':_0x29c1('0x7a'),'attributes':_0x32c34a,'include':[{'model':db[_0x29c1('0x7b')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x29c1('0x7c')],'as':_0x29c1('0x7d'),'attributes':['id','name']},{'model':db[_0x29c1('0x49')],'as':_0x29c1('0x7e'),'attributes':['id',_0x29c1('0xf'),_0x29c1('0x7f')]}]})[_0x29c1('0x3c')](function(_0x519d01){if(_0x519d01){return _0x519d01['update']({'UserId':_0x1413a6[_0x29c1('0x53')]['id']},{'transaction':_0x5d6f6e});}});});}})[_0x29c1('0x3c')](handleEntityNotFound(_0x5d8714,null))[_0x29c1('0x3c')](respondWithResult(_0x5d8714,null))[_0x29c1('0x40')](handleError(_0x5d8714,null));};exports[_0x29c1('0x80')]=function(_0x571101,_0x18f4e5,_0x45eec2){var _0x133778=[];var _0x4f267e=_0x571101[_0x29c1('0x41')]['id'];var _0x44fed3=_0x571101['user']['id'];return db[_0x29c1('0x5b')][_0x29c1('0x46')]()[_0x29c1('0x3c')](function(_0x45d613){_0x133778=_['keys'](_0x45d613);return db[_0x29c1('0x68')]['transaction'](function(_0x4d7570){const _0x5ea930={'id':_0x4f267e};return db['CmHopper']['findOne']({'attributes':['id',_0x29c1('0x76'),_0x29c1('0x77')],'where':_0x5ea930,'transaction':_0x4d7570,'lock':_0x4d7570['LOCK']['UPDATE'],'include':[{'model':db[_0x29c1('0x5b')],'as':_0x29c1('0x7a'),'attributes':_0x133778,'include':[{'model':db[_0x29c1('0x7b')],'as':'Company','attributes':['id',_0x29c1('0xf')]}]},{'model':db[_0x29c1('0x7c')],'as':_0x29c1('0x7d'),'attributes':['id',_0x29c1('0xf')]},{'model':db[_0x29c1('0x49')],'as':_0x29c1('0x7e'),'attributes':['id','name',_0x29c1('0x7f')]}]})[_0x29c1('0x3c')](function(_0x1a839b){if(_0x1a839b){return _0x1a839b[_0x29c1('0xb')]({'UserId':_0x44fed3},{'transaction':_0x4d7570});}});});})['then'](handleEntityNotFound(_0x18f4e5,null))[_0x29c1('0x3c')](respondWithResult(_0x18f4e5,null))[_0x29c1('0x40')](handleError(_0x18f4e5,null));};exports[_0x29c1('0x81')]=function(_0x2ecaa4,_0x26f488){return _0x2ecaa4[_0x29c1('0x53')][_0x29c1('0x64')]({'where':{'type':_0x29c1('0x82'),'dialActive':!![],'dialMethod':_0x29c1('0x65')},'attributes':['id'],'raw':!![]})[_0x29c1('0x3c')](function(_0x2b834a){if(_0x2b834a&&_0x2b834a[_0x29c1('0x30')]){return db[_0x29c1('0x3b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x29c1('0x12')](_0x2b834a,'id')},'$or':[{'UserId':null},{'UserId':_0x2ecaa4[_0x29c1('0x53')]['id']}]}});}return 0x0;})[_0x29c1('0x3c')](function(_0x407ba2){if(!_[_0x29c1('0x5e')](_0x407ba2)&&_[_0x29c1('0x83')](_0x407ba2)){return _0x26f488[_0x29c1('0x4')](0xc8)[_0x29c1('0x5')]({'contacts':_0x407ba2});}else{logger[_0x29c1('0xd')](_0x29c1('0x84'),_0x29c1('0x81'),0x194,'entity\x20not\x20found');_0x26f488[_0x29c1('0xc')](0x194);}})[_0x29c1('0x40')](handleError(_0x26f488,null));};exports[_0x29c1('0x85')]=function(_0x562afb,_0x30406c){var _0x1ca55c=shared['timezones'];var _0x54a232=[];_[_0x29c1('0x12')](_0x1ca55c,function(_0x4328ae){_0x54a232[_0x29c1('0x86')]({'id':_0x4328ae[_0x29c1('0xf')],'name':_0x4328ae['name'],'utcOffset':_0x4328ae[_0x29c1('0x87')]});});return _0x30406c['status'](0xc8)[_0x29c1('0x5')]({'tz':_0x54a232});};exports['getTimezone']=function(_0x77a663,_0x25f044){var _0x3bf5f7=shared[_0x29c1('0x88')];var _0xb964b7={};if(!_[_0x29c1('0x5e')](_0x3bf5f7[_0x77a663[_0x29c1('0x45')]['id']]))_0xb964b7=_0x3bf5f7[_0x77a663[_0x29c1('0x45')]['id']];return _0x25f044['status'](0xc8)['json'](_0xb964b7);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 200e50e..2fd2448 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 _0x1261=['path','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x84a35a,_0x39bc13){var _0x2821dc=function(_0x2c5ee7){while(--_0x2c5ee7){_0x84a35a['push'](_0x84a35a['shift']());}};_0x2821dc(++_0x39bc13);}(_0x1261,0x144));var _0x1126=function(_0x3e8de2,_0x468431){_0x3e8de2=_0x3e8de2-0x0;var _0x56b736=_0x1261[_0x3e8de2];return _0x56b736;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('CmHopper',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]},{'name':_0x1126('0xd'),'fields':[_0x1126('0xd')]},{'name':'priority','fields':[_0x1126('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x524e=['define','CmHopper','scheduledat','phone','priority','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x124579,_0x2ad4c2){var _0x984a1b=function(_0x41a640){while(--_0x41a640){_0x124579['push'](_0x124579['shift']());}};_0x984a1b(++_0x2ad4c2);}(_0x524e,0x15e));var _0xe524=function(_0x3d3fae,_0x197e0a){_0x3d3fae=_0x3d3fae-0x0;var _0x4a8b9b=_0x524e[_0x3d3fae];return _0x4a8b9b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xe524('0xc'),'fields':[_0xe524('0xc')]},{'name':_0xe524('0xd'),'fields':[_0xe524('0xd')]},{'name':_0xe524('0xe'),'fields':[_0xe524('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index cfe7e5e..5099cb3 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 _0x8927=['moment','bluebird','../../mysqldb','rpc','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','CmHopper,\x20%s,\x20%s','message','catch','GetCmHopper','findAll','options','raw','where','attributes','limit','include','map','model','ShowCmHopper','CmHopper','find','CreateCmHopper','UpdateCmHopper','update','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','LOCK','keys','User','name','voicePause','length','push','includes','dataValues','ContactId','MoveContactManagedDialer','transaction','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','contactsRescheduled','UserId','UPDATE','all','GetContactRecallMe','Contact','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','log','NOW()','Agent','CmList','List','CmHopperHandlePreviewRecallNotifications\x20hoppers','lodash'];(function(_0x18fed9,_0x467479){var _0x50e7f3=function(_0x47c614){while(--_0x47c614){_0x18fed9['push'](_0x18fed9['shift']());}};_0x50e7f3(++_0x467479);}(_0x8927,0x1a8));var _0x7892=function(_0x3e7d4b,_0x189b61){_0x3e7d4b=_0x3e7d4b-0x0;var _0x39aa5b=_0x8927[_0x3e7d4b];return _0x39aa5b;};'use strict';var _=require(_0x7892('0x0'));var util=require('util');var moment=require(_0x7892('0x1'));var BPromise=require(_0x7892('0x2'));var db=require(_0x7892('0x3'))['db'];var logger=require('../../config/logger')(_0x7892('0x4'));var jayson=require(_0x7892('0x5'));var client=jayson[_0x7892('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a7b54,_0x57f28b,_0x11fbc8){return new BPromise(function(_0x28b7ea,_0x3ff801){return client['request'](_0x2a7b54,_0x11fbc8)[_0x7892('0x7')](function(_0x54e18f){logger[_0x7892('0x8')]('CmHopper,\x20%s,\x20%s',_0x57f28b,_0x7892('0x9'));logger[_0x7892('0xa')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x57f28b,'request\x20sent',JSON[_0x7892('0xb')](_0x54e18f));if(_0x54e18f['error']){if(_0x54e18f[_0x7892('0xc')]['code']===0x1f4){logger[_0x7892('0xc')](_0x7892('0xd'),_0x57f28b,_0x54e18f['error'][_0x7892('0xe')]);return _0x3ff801(_0x54e18f[_0x7892('0xc')][_0x7892('0xe')]);}logger[_0x7892('0xc')](_0x7892('0xd'),_0x57f28b,_0x54e18f[_0x7892('0xc')][_0x7892('0xe')]);return _0x28b7ea(_0x54e18f['error'][_0x7892('0xe')]);}else{logger[_0x7892('0x8')](_0x7892('0xd'),_0x57f28b,'request\x20sent');_0x28b7ea(_0x54e18f['result'][_0x7892('0xe')]);}})[_0x7892('0xf')](function(_0x5eda71){logger['error'](_0x7892('0xd'),_0x57f28b,_0x5eda71);_0x3ff801(_0x5eda71);});});}exports[_0x7892('0x10')]=function(_0x45e98d){var _0x2106cb=this;return new Promise(function(_0x1a2620,_0x2acd60){return db['CmHopper'][_0x7892('0x11')]({'raw':_0x45e98d[_0x7892('0x12')]?_0x45e98d['options'][_0x7892('0x13')]===undefined?!![]:![]:!![],'where':_0x45e98d[_0x7892('0x12')]?_0x45e98d[_0x7892('0x12')][_0x7892('0x14')]||null:null,'attributes':_0x45e98d[_0x7892('0x12')]?_0x45e98d[_0x7892('0x12')][_0x7892('0x15')]||null:null,'limit':_0x45e98d['options']?_0x45e98d[_0x7892('0x12')][_0x7892('0x16')]||null:null,'include':_0x45e98d[_0x7892('0x12')]?_0x45e98d[_0x7892('0x12')][_0x7892('0x17')]?_[_0x7892('0x18')](_0x45e98d[_0x7892('0x12')][_0x7892('0x17')],function(_0x18871d){return{'model':db[_0x18871d[_0x7892('0x19')]],'as':_0x18871d['as'],'attributes':_0x18871d[_0x7892('0x15')],'include':_0x18871d['include']?_[_0x7892('0x18')](_0x18871d[_0x7892('0x17')],function(_0x56dbe5){return{'model':db[_0x56dbe5[_0x7892('0x19')]],'as':_0x56dbe5['as'],'attributes':_0x56dbe5[_0x7892('0x15')],'include':_0x56dbe5[_0x7892('0x17')]?_['map'](_0x56dbe5[_0x7892('0x17')],function(_0x1a599a){return{'model':db[_0x1a599a[_0x7892('0x19')]],'as':_0x1a599a['as'],'attributes':_0x1a599a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7892('0x7')](function(_0x4dbe91){logger[_0x7892('0x8')]('GetCmHopper',_0x45e98d);logger['debug'](_0x7892('0x10'),_0x45e98d,JSON[_0x7892('0xb')](_0x4dbe91));_0x1a2620(_0x4dbe91);})[_0x7892('0xf')](function(_0x591772){logger['error']('GetCmHopper',_0x591772[_0x7892('0xe')],_0x45e98d);_0x2acd60(_0x2106cb['error'](0x1f4,_0x591772['message']));});});};exports[_0x7892('0x1a')]=function(_0x2f472e){var _0x37a42e=this;return new Promise(function(_0x26955f,_0x37f05d){return db[_0x7892('0x1b')][_0x7892('0x1c')]({'raw':_0x2f472e[_0x7892('0x12')]?_0x2f472e['options'][_0x7892('0x13')]===undefined?!![]:![]:!![],'where':_0x2f472e[_0x7892('0x12')]?_0x2f472e[_0x7892('0x12')]['where']||null:null,'attributes':_0x2f472e['options']?_0x2f472e[_0x7892('0x12')][_0x7892('0x15')]||null:null,'include':_0x2f472e[_0x7892('0x12')]?_0x2f472e['options'][_0x7892('0x17')]?_[_0x7892('0x18')](_0x2f472e[_0x7892('0x12')][_0x7892('0x17')],function(_0x318270){return{'model':db[_0x318270[_0x7892('0x19')]],'as':_0x318270['as'],'attributes':_0x318270[_0x7892('0x15')],'include':_0x318270['include']?_[_0x7892('0x18')](_0x318270[_0x7892('0x17')],function(_0x30eecb){return{'model':db[_0x30eecb[_0x7892('0x19')]],'as':_0x30eecb['as'],'attributes':_0x30eecb[_0x7892('0x15')],'include':_0x30eecb[_0x7892('0x17')]?_[_0x7892('0x18')](_0x30eecb[_0x7892('0x17')],function(_0x26802d){return{'model':db[_0x26802d[_0x7892('0x19')]],'as':_0x26802d['as'],'attributes':_0x26802d[_0x7892('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b0dfa){logger[_0x7892('0x8')](_0x7892('0x1a'),_0x2f472e);logger['debug'](_0x7892('0x1a'),_0x2f472e,JSON['stringify'](_0x2b0dfa));_0x26955f(_0x2b0dfa);})['catch'](function(_0x2b4a7e){logger[_0x7892('0xc')]('ShowCmHopper',_0x2b4a7e[_0x7892('0xe')],_0x2f472e);_0x37f05d(_0x37a42e[_0x7892('0xc')](0x1f4,_0x2b4a7e[_0x7892('0xe')]));});});};exports['CreateCmHopper']=function(_0x3170b4){var _0x23d02f=this;return new Promise(function(_0x15b22e,_0x179d39){return db['CmHopper']['create'](_0x3170b4['body'],{'raw':_0x3170b4[_0x7892('0x12')]?_0x3170b4[_0x7892('0x12')][_0x7892('0x13')]===undefined?!![]:![]:!![]})[_0x7892('0x7')](function(_0x5dc941){logger[_0x7892('0x8')](_0x7892('0x1d'),_0x3170b4);logger['debug']('CreateCmHopper',_0x3170b4,JSON[_0x7892('0xb')](_0x5dc941));_0x15b22e(_0x5dc941);})[_0x7892('0xf')](function(_0x34bdb1){logger[_0x7892('0xc')](_0x7892('0x1d'),_0x34bdb1['message'],_0x3170b4);_0x179d39(_0x23d02f[_0x7892('0xc')](0x1f4,_0x34bdb1[_0x7892('0xe')]));});});};exports[_0x7892('0x1e')]=function(_0x3f2bbb){var _0x4ee822=this;return new Promise(function(_0x5a1015,_0x56e5ce){return db['CmHopper'][_0x7892('0x1f')](_0x3f2bbb[_0x7892('0x20')],{'raw':_0x3f2bbb[_0x7892('0x12')]?_0x3f2bbb[_0x7892('0x12')][_0x7892('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f2bbb[_0x7892('0x12')]?_0x3f2bbb[_0x7892('0x12')][_0x7892('0x14')]||null:null,'attributes':_0x3f2bbb['options']?_0x3f2bbb['options'][_0x7892('0x15')]||null:null,'limit':_0x3f2bbb[_0x7892('0x12')]?_0x3f2bbb[_0x7892('0x12')]['limit']||null:null})[_0x7892('0x7')](function(_0x14cc29){logger['info'](_0x7892('0x1e'),_0x3f2bbb);logger[_0x7892('0x8')](_0x7892('0x21'),JSON[_0x7892('0xb')](_0x3f2bbb[_0x7892('0x12')][_0x7892('0x14')]),_0x3f2bbb[_0x7892('0x20')][_0x7892('0x22')]);logger['debug'](_0x7892('0x1e'),_0x3f2bbb,JSON['stringify'](_0x14cc29));_0x5a1015(_0x14cc29);})[_0x7892('0xf')](function(_0xe98c09){logger['error'](_0x7892('0x1e'),_0xe98c09['message'],_0x3f2bbb);_0x56e5ce(_0x4ee822[_0x7892('0xc')](0x1f4,_0xe98c09[_0x7892('0xe')]));});});};exports[_0x7892('0x23')]=function(_0x19a038){var _0x3bf9e4=this;return new Promise(function(_0x166504,_0x5314f7){return db[_0x7892('0x1b')][_0x7892('0x24')]({'where':_0x19a038[_0x7892('0x12')]?_0x19a038[_0x7892('0x12')][_0x7892('0x14')]||null:null})[_0x7892('0x7')](function(_0x4888b3){logger[_0x7892('0x8')](_0x7892('0x23'),_0x19a038);logger[_0x7892('0xa')]('DestroyCmHopper',_0x19a038,JSON['stringify'](_0x4888b3));_0x166504(_0x4888b3);})[_0x7892('0xf')](function(_0x47cf99){logger['error']('DestroyCmHopper',_0x47cf99['message'],_0x19a038);_0x5314f7(_0x3bf9e4[_0x7892('0xc')](0x1f4,_0x47cf99[_0x7892('0xe')]));});});};exports[_0x7892('0x25')]=function(_0x2ebd17){var _0x4eaece=this;return new Promise(function(_0x4245a8,_0x4f7ffb){return db[_0x7892('0x26')][_0x7892('0x27')]()[_0x7892('0x7')](function(_0x4256e6){return db[_0x7892('0x28')]['transaction'](function(_0x38713b){return db[_0x7892('0x1b')][_0x7892('0x11')]({'where':_0x2ebd17['options']?_0x2ebd17[_0x7892('0x12')][_0x7892('0x14')]||null:null,'attributes':_0x2ebd17[_0x7892('0x12')]?_0x2ebd17['options']['attributes']||null:null,'limit':_0x2ebd17[_0x7892('0x12')]?_0x2ebd17[_0x7892('0x12')][_0x7892('0x16')]||null:null,'order':_0x2ebd17[_0x7892('0x12')]?_0x2ebd17[_0x7892('0x12')][_0x7892('0x29')]||null:null,'transaction':_0x38713b,'lock':_0x38713b[_0x7892('0x2a')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x7892('0x2b')](_0x4256e6)},{'model':db[_0x7892('0x2c')],'as':'Agent','attributes':['id',_0x7892('0x2d'),_0x7892('0x2e')]}]})[_0x7892('0x7')](function(_0x11b0d5){var _0x391f8b=[];var _0x4b4b2d=[];for(var _0x308885=0x0;_0x308885<_0x11b0d5[_0x7892('0x2f')];_0x308885+=0x1){var _0x12f4e3=_0x11b0d5[_0x308885]['UserId'];if(_0x12f4e3===null){_0x391f8b[_0x7892('0x30')](_0x11b0d5[_0x308885][_0x7892('0x1f')](_0x2ebd17[_0x7892('0x20')],{'transaction':_0x38713b}));}else if(!_0x4b4b2d[_0x7892('0x31')](_0x12f4e3)){_0x4b4b2d[_0x7892('0x30')](_0x12f4e3);_0x391f8b[_0x7892('0x30')](_0x11b0d5[_0x308885][_0x7892('0x1f')](_0x2ebd17['body'],{'transaction':_0x38713b}));}}return BPromise['all'](_0x391f8b);});})['then'](function(_0x56050e){logger[_0x7892('0x8')]('GetContactDialer',_0x2ebd17);if(_0x56050e['length']>0x0){logger[_0x7892('0x8')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x56050e[0x0][_0x7892('0x32')]['id'],_0x56050e[0x0]['dataValues'][_0x7892('0x33')],_0x56050e[0x0]['dataValues'][_0x7892('0x22')]);}logger[_0x7892('0xa')]('GetContactDialer',_0x2ebd17,JSON[_0x7892('0xb')](_0x56050e));_0x4245a8(_0x56050e);})[_0x7892('0xf')](function(_0x452087){logger[_0x7892('0xc')](_0x7892('0x25'),_0x452087['message'],_0x2ebd17);_0x4f7ffb(_0x4eaece[_0x7892('0xc')](0x1f4,_0x452087[_0x7892('0xe')]));});});});};exports[_0x7892('0x34')]=function(_0x2efaeb){var _0x1ae58d=this;return new Promise(function(_0xcc346f,_0x446e02){return db[_0x7892('0x28')][_0x7892('0x35')](function(_0xc854d8){return db['CmHopperFinal'][_0x7892('0x36')](_0x2efaeb[_0x7892('0x20')],{'raw':_0x2efaeb[_0x7892('0x12')]?_0x2efaeb[_0x7892('0x12')][_0x7892('0x13')]===undefined?!![]:![]:!![],'transaction':_0xc854d8})['then'](function(){logger['info'](_0x7892('0x37'),JSON[_0x7892('0xb')](_0x2efaeb[_0x7892('0x12')][_0x7892('0x14')]),_0x2efaeb[_0x7892('0x12')][_0x7892('0x14')]['active']);return db['CmHopper']['destroy']({'where':_0x2efaeb[_0x7892('0x12')]?_0x2efaeb[_0x7892('0x12')][_0x7892('0x14')]||null:null,'transaction':_0xc854d8});});})[_0x7892('0x7')](function(_0x3ef74e){logger['info'](_0x7892('0x34'),_0x2efaeb);logger['debug'](_0x7892('0x34'),_0x2efaeb,JSON['stringify'](_0x3ef74e));_0xcc346f(_0x3ef74e);})[_0x7892('0xf')](function(_0xc5491){logger[_0x7892('0xc')](_0x7892('0x34'),_0xc5491[_0x7892('0xe')],_0x2efaeb);_0x446e02(_0x1ae58d['error'](0x1f4,_0xc5491[_0x7892('0xe')]));});});};exports[_0x7892('0x38')]=function(_0x41fc6a){var _0x44da83=this;return new Promise(function(_0x15d0db,_0x1d04a2){return db[_0x7892('0x1b')]['findAll']({'raw':_0x41fc6a[_0x7892('0x12')]?_0x41fc6a[_0x7892('0x12')][_0x7892('0x13')]===undefined?!![]:![]:!![],'where':_0x41fc6a[_0x7892('0x12')]?_0x41fc6a[_0x7892('0x12')][_0x7892('0x14')]||null:null,'attributes':[[db['sequelize']['fn'](_0x7892('0x39'),db[_0x7892('0x28')]['fn']('IF',db[_0x7892('0x28')][_0x7892('0x3a')](_0x7892('0x3b')+util[_0x7892('0x3c')](_0x7892('0x3d'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0x7892('0x3e')]]})[_0x7892('0x7')](function(_0x308bdf){logger['info'](_0x7892('0x38'),_0x41fc6a);logger[_0x7892('0xa')](_0x7892('0x38'),_0x41fc6a,JSON['stringify'](_0x308bdf));_0x15d0db(_0x308bdf);})[_0x7892('0xf')](function(_0x3e39ad){logger[_0x7892('0xc')](_0x7892('0x38'),_0x3e39ad['message'],_0x41fc6a);_0x1d04a2(_0x44da83[_0x7892('0xc')](0x1f4,_0x3e39ad[_0x7892('0xe')]));});});};exports['GetContactRecallMe']=function(_0x2ffb24){var _0x23f0fe=this;return new Promise(function(_0x1ff817,_0x3a24e4){return db[_0x7892('0x26')][_0x7892('0x27')]()['then'](function(_0x33782d){return db[_0x7892('0x28')][_0x7892('0x35')](function(_0x3c6a9b){return db[_0x7892('0x1b')][_0x7892('0x11')]({'where':_0x2ffb24['options']?_0x2ffb24[_0x7892('0x12')][_0x7892('0x14')]||null:null,'attributes':_0x2ffb24['options']?_0x2ffb24[_0x7892('0x12')]['attributes']||null:null,'limit':0x1,'order':_0x2ffb24[_0x7892('0x12')]?_0x2ffb24[_0x7892('0x12')][_0x7892('0x29')]||null:null,'group':db[_0x7892('0x1b')][_0x7892('0x3f')],'transaction':_0x3c6a9b,'lock':_0x3c6a9b[_0x7892('0x2a')][_0x7892('0x40')],'include':_0x2ffb24[_0x7892('0x12')]?_0x2ffb24['options']['include']?_[_0x7892('0x18')](_0x2ffb24[_0x7892('0x12')]['include'],function(_0x27441d){return{'model':db[_0x27441d[_0x7892('0x19')]],'as':_0x27441d['as'],'attributes':_0x27441d[_0x7892('0x15')],'include':_0x27441d[_0x7892('0x17')]?_[_0x7892('0x18')](_0x27441d[_0x7892('0x17')],function(_0x254616){return{'model':db[_0x254616[_0x7892('0x19')]],'as':_0x254616['as'],'attributes':_0x254616[_0x7892('0x15')],'include':_0x254616[_0x7892('0x17')]?_[_0x7892('0x18')](_0x254616['include'],function(_0x584306){return{'model':db[_0x584306[_0x7892('0x19')]],'as':_0x584306['as'],'attributes':_0x584306[_0x7892('0x15')]};}):[]};}):[]};}):[]:[]})[_0x7892('0x7')](function(_0x1ff85a){var _0x13972c=[];for(var _0x380559=0x0;_0x380559<_0x1ff85a[_0x7892('0x2f')];_0x380559+=0x1){_0x13972c[_0x7892('0x30')](_0x1ff85a[_0x380559][_0x7892('0x1f')](_0x2ffb24[_0x7892('0x20')],{'transaction':_0x3c6a9b}));}return BPromise[_0x7892('0x41')](_0x13972c);});})[_0x7892('0x7')](function(_0x52bdc2){logger[_0x7892('0x8')](_0x7892('0x42'),_0x2ffb24);logger[_0x7892('0xa')](_0x7892('0x42'),_0x2ffb24,JSON[_0x7892('0xb')](_0x52bdc2));_0x1ff817(_0x52bdc2);})[_0x7892('0xf')](function(_0x19d535){logger[_0x7892('0xc')]('GetContactRecallMe',_0x19d535[_0x7892('0xe')],_0x2ffb24);_0x3a24e4(_0x23f0fe[_0x7892('0xc')](0x1f4,_0x19d535[_0x7892('0xe')]));});});});};exports['GetCmHopperPreview']=function(_0x1f376f){var _0x518680=this;return new Promise(function(_0x5c2e34,_0x5988a2){db[_0x7892('0x26')][_0x7892('0x27')]()[_0x7892('0x7')](function(_0x3b505c){return db[_0x7892('0x1b')][_0x7892('0x11')]({'raw':_0x1f376f[_0x7892('0x12')]?_0x1f376f[_0x7892('0x12')][_0x7892('0x13')]===undefined?!![]:![]:!![],'where':_0x1f376f[_0x7892('0x12')]?_0x1f376f[_0x7892('0x12')][_0x7892('0x14')]||null:null,'attributes':_0x1f376f['options']?_0x1f376f[_0x7892('0x12')][_0x7892('0x15')]||null:null,'limit':_0x1f376f[_0x7892('0x12')]?_0x1f376f['options'][_0x7892('0x16')]||null:null,'include':_0x1f376f['options']?_0x1f376f[_0x7892('0x12')][_0x7892('0x17')]?_[_0x7892('0x18')](_0x1f376f[_0x7892('0x12')][_0x7892('0x17')],function(_0x2111d8){return{'model':db[_0x2111d8[_0x7892('0x19')]],'as':_0x2111d8['as'],'attributes':_0x2111d8['as']===_0x7892('0x43')?_[_0x7892('0x2b')](_0x3b505c):_0x2111d8[_0x7892('0x15')],'include':_0x2111d8[_0x7892('0x17')]?_[_0x7892('0x18')](_0x2111d8[_0x7892('0x17')],function(_0x51dd96){return{'model':db[_0x51dd96[_0x7892('0x19')]],'as':_0x51dd96['as'],'attributes':_0x51dd96[_0x7892('0x15')],'include':_0x51dd96[_0x7892('0x17')]?_['map'](_0x51dd96[_0x7892('0x17')],function(_0x4bfbe1){return{'model':db[_0x4bfbe1[_0x7892('0x19')]],'as':_0x4bfbe1['as'],'attributes':_0x4bfbe1[_0x7892('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4be938){logger[_0x7892('0x8')](_0x7892('0x10'),_0x1f376f);logger[_0x7892('0xa')](_0x7892('0x10'),_0x1f376f,JSON['stringify'](_0x4be938));_0x5c2e34(_0x4be938);})[_0x7892('0xf')](function(_0x22ad31){logger[_0x7892('0xc')](_0x7892('0x10'),_0x22ad31[_0x7892('0xe')],_0x1f376f);_0x5988a2(_0x518680[_0x7892('0xc')](0x1f4,_0x22ad31[_0x7892('0xe')]));});});});};exports[_0x7892('0x44')]=function(_0x1fa7e4){var _0x2600ba=this;return new Promise(function(_0x1f7afb,_0x20d96e){return db[_0x7892('0x26')][_0x7892('0x45')]({'raw':!![],'where':{'phone':_0x1fa7e4[_0x7892('0x12')][_0x7892('0x14')][_0x7892('0x46')]},'attributes':['id',_0x7892('0x47')],'order':[['id',_0x7892('0x48')]]})[_0x7892('0x7')](function(_0x2e131b){logger[_0x7892('0x8')](_0x7892('0x49'),_0x1fa7e4);logger['debug'](_0x7892('0x49'),_0x1fa7e4,JSON[_0x7892('0xb')](_0x2e131b));_0x1f7afb(_0x2e131b);})[_0x7892('0xf')](function(_0x2ab4d8){logger[_0x7892('0xc')](_0x7892('0x49'),_0x2ab4d8[_0x7892('0xe')],_0x1fa7e4);_0x20d96e(_0x2600ba[_0x7892('0xc')](0x1f4,_0x2ab4d8['message']));});});};exports[_0x7892('0x4a')]=function(_0x21fe2c){var _0x17804f=this;return new Promise(function(_0x425677,_0x5a2e7d){return db[_0x7892('0x28')]['transaction'](function(_0x1b4ea1){return db[_0x7892('0x1b')][_0x7892('0x1f')]({'active':![]},{'where':{},'transaction':_0x1b4ea1})[_0x7892('0x7')](function(_0x47dccc){logger[_0x7892('0x8')]('ResetActiveCalls',_0x21fe2c);logger[_0x7892('0xa')](_0x7892('0x4a'),_0x21fe2c,JSON[_0x7892('0xb')](_0x47dccc));_0x425677(_0x47dccc);})[_0x7892('0xf')](function(_0x22e0da){logger[_0x7892('0xc')](_0x7892('0x4a'),_0x22e0da['message'],_0x21fe2c);_0x5a2e7d(_0x17804f[_0x7892('0xc')](0x1f4,_0x22e0da[_0x7892('0xe')]));});});});};exports[_0x7892('0x4b')]=function(_0x23cc6b){var _0x1c6c02=this;var _0x5aa424=_0x23cc6b[_0x7892('0x20')][_0x7892('0x14')][_0x7892('0x4c')];var _0x28bad6=_0x23cc6b[_0x7892('0x20')][_0x7892('0x14')][_0x7892('0x4d')];var _0x53c359=_0x23cc6b[_0x7892('0x20')][_0x7892('0x14')][_0x7892('0x4e')];console[_0x7892('0x4f')]('CmHopperHandlePreviewRecallNotifications\x20voiceQueueIds,\x20interval,\x20availableAgentsIds',_0x5aa424,_0x28bad6,_0x53c359);return new Promise(function(_0x1c2b49,_0x127f84){return db['CmHopper'][_0x7892('0x11')]({'where':{'voiceQueueId':{'$in':_0x5aa424},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x7892('0x28')]['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x28bad6+'\x20MINUTE'),'$gt':db[_0x7892('0x28')][_0x7892('0x3a')](_0x7892('0x50'))}},'UserId':{'$in':_0x53c359}},'logging':!![],'include':[{'model':db[_0x7892('0x26')],'as':'Contact'},{'model':db[_0x7892('0x2c')],'as':_0x7892('0x51'),'attributes':['id',_0x7892('0x2d'),_0x7892('0x2e')]},{'model':db[_0x7892('0x52')],'as':_0x7892('0x53')}]})[_0x7892('0x7')](function(_0x1aa7f1){console[_0x7892('0x4f')](_0x7892('0x54'),_0x1aa7f1);if(_0x1aa7f1[_0x7892('0x2f')]>0x0){return db[_0x7892('0x28')][_0x7892('0x35')](function(_0x1408ab){return db[_0x7892('0x1b')]['update']({'recallmeNotifiedDate':db[_0x7892('0x28')][_0x7892('0x3a')](_0x7892('0x50'))},{'where':{'id':{'$in':_['map'](_0x1aa7f1,'id')}},'logging':!![],'transaction':_0x1408ab})[_0x7892('0x7')](function(){_0x1c2b49(_0x1aa7f1);})['catch'](function(_0x2e4a46){logger[_0x7892('0xc')](_0x7892('0x4b'),_0x2e4a46[_0x7892('0xe')],_0x23cc6b);_0x127f84(_0x1c6c02['error'](0x1f4,_0x2e4a46[_0x7892('0xe')]));});})[_0x7892('0xf')](function(_0x4f0f8e){logger['error'](_0x7892('0x4b'),_0x4f0f8e[_0x7892('0xe')],_0x23cc6b);_0x127f84(_0x1c6c02[_0x7892('0xc')](0x1f4,_0x4f0f8e[_0x7892('0xe')]));});}else{_0x1c2b49(_0x1aa7f1);}});});}; \ No newline at end of file +var _0xd572=['dataValues','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','describe','transaction','findAll','order','LOCK','Contact','GetContactByPhone','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','log','CmHopperHandlePreviewRecallNotifications\x20voiceQueueIds,\x20interval,\x20availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','voicePause','CmList','CmHopperHandlePreviewRecallNotifications\x20hoppers','NOW()','lodash','util','moment','../../mysqldb','../../config/logger','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','CmHopper','options','where','attributes','limit','include','map','model','GetCmHopper','debug','ShowCmHopper','find','raw','CreateCmHopper','create','body','catch','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','DestroyCmHopper','GetContactDialer','CmContact','UPDATE','keys','User','Agent','UserId','push','includes','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]'];(function(_0x589408,_0x3ec663){var _0x361e50=function(_0x3d1321){while(--_0x3d1321){_0x589408['push'](_0x589408['shift']());}};_0x361e50(++_0x3ec663);}(_0xd572,0x1cd));var _0x2d57=function(_0x323455,_0xbd3d87){_0x323455=_0x323455-0x0;var _0x56e62d=_0xd572[_0x323455];return _0x56e62d;};'use strict';var _=require(_0x2d57('0x0'));var util=require(_0x2d57('0x1'));var moment=require(_0x2d57('0x2'));var BPromise=require('bluebird');var db=require(_0x2d57('0x3'))['db'];var logger=require(_0x2d57('0x4'))('rpc');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e54ab,_0x1fbe07,_0x35c260){return new BPromise(function(_0x289b18,_0x5281d6){return client['request'](_0x3e54ab,_0x35c260)[_0x2d57('0x5')](function(_0x1a81e1){logger[_0x2d57('0x6')](_0x2d57('0x7'),_0x1fbe07,'request\x20sent');logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x1fbe07,_0x2d57('0x8'),JSON[_0x2d57('0x9')](_0x1a81e1));if(_0x1a81e1['error']){if(_0x1a81e1['error'][_0x2d57('0xa')]===0x1f4){logger[_0x2d57('0xb')](_0x2d57('0x7'),_0x1fbe07,_0x1a81e1['error'][_0x2d57('0xc')]);return _0x5281d6(_0x1a81e1['error'][_0x2d57('0xc')]);}logger[_0x2d57('0xb')](_0x2d57('0x7'),_0x1fbe07,_0x1a81e1[_0x2d57('0xb')]['message']);return _0x289b18(_0x1a81e1[_0x2d57('0xb')][_0x2d57('0xc')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x1fbe07,'request\x20sent');_0x289b18(_0x1a81e1[_0x2d57('0xd')][_0x2d57('0xc')]);}})['catch'](function(_0x16aacc){logger[_0x2d57('0xb')](_0x2d57('0x7'),_0x1fbe07,_0x16aacc);_0x5281d6(_0x16aacc);});});}exports['GetCmHopper']=function(_0x1589a4){var _0x439b45=this;return new Promise(function(_0x4182d8,_0x35c4b5){return db[_0x2d57('0xe')]['findAll']({'raw':_0x1589a4[_0x2d57('0xf')]?_0x1589a4[_0x2d57('0xf')]['raw']===undefined?!![]:![]:!![],'where':_0x1589a4[_0x2d57('0xf')]?_0x1589a4[_0x2d57('0xf')][_0x2d57('0x10')]||null:null,'attributes':_0x1589a4[_0x2d57('0xf')]?_0x1589a4[_0x2d57('0xf')][_0x2d57('0x11')]||null:null,'limit':_0x1589a4[_0x2d57('0xf')]?_0x1589a4['options'][_0x2d57('0x12')]||null:null,'include':_0x1589a4['options']?_0x1589a4[_0x2d57('0xf')][_0x2d57('0x13')]?_[_0x2d57('0x14')](_0x1589a4[_0x2d57('0xf')]['include'],function(_0x3656b6){return{'model':db[_0x3656b6[_0x2d57('0x15')]],'as':_0x3656b6['as'],'attributes':_0x3656b6[_0x2d57('0x11')],'include':_0x3656b6['include']?_[_0x2d57('0x14')](_0x3656b6['include'],function(_0x11073d){return{'model':db[_0x11073d[_0x2d57('0x15')]],'as':_0x11073d['as'],'attributes':_0x11073d[_0x2d57('0x11')],'include':_0x11073d[_0x2d57('0x13')]?_['map'](_0x11073d[_0x2d57('0x13')],function(_0x298916){return{'model':db[_0x298916[_0x2d57('0x15')]],'as':_0x298916['as'],'attributes':_0x298916[_0x2d57('0x11')]};}):[]};}):[]};}):[]:[]})[_0x2d57('0x5')](function(_0x5e0915){logger[_0x2d57('0x6')](_0x2d57('0x16'),_0x1589a4);logger[_0x2d57('0x17')]('GetCmHopper',_0x1589a4,JSON['stringify'](_0x5e0915));_0x4182d8(_0x5e0915);})['catch'](function(_0xa4c0dd){logger[_0x2d57('0xb')](_0x2d57('0x16'),_0xa4c0dd['message'],_0x1589a4);_0x35c4b5(_0x439b45[_0x2d57('0xb')](0x1f4,_0xa4c0dd[_0x2d57('0xc')]));});});};exports[_0x2d57('0x18')]=function(_0x39a24b){var _0x5f2077=this;return new Promise(function(_0x52595e,_0x3dbad8){return db[_0x2d57('0xe')][_0x2d57('0x19')]({'raw':_0x39a24b['options']?_0x39a24b[_0x2d57('0xf')][_0x2d57('0x1a')]===undefined?!![]:![]:!![],'where':_0x39a24b['options']?_0x39a24b[_0x2d57('0xf')]['where']||null:null,'attributes':_0x39a24b[_0x2d57('0xf')]?_0x39a24b[_0x2d57('0xf')]['attributes']||null:null,'include':_0x39a24b[_0x2d57('0xf')]?_0x39a24b['options'][_0x2d57('0x13')]?_[_0x2d57('0x14')](_0x39a24b[_0x2d57('0xf')]['include'],function(_0x278cd4){return{'model':db[_0x278cd4[_0x2d57('0x15')]],'as':_0x278cd4['as'],'attributes':_0x278cd4[_0x2d57('0x11')],'include':_0x278cd4['include']?_[_0x2d57('0x14')](_0x278cd4['include'],function(_0x443dc1){return{'model':db[_0x443dc1[_0x2d57('0x15')]],'as':_0x443dc1['as'],'attributes':_0x443dc1['attributes'],'include':_0x443dc1[_0x2d57('0x13')]?_[_0x2d57('0x14')](_0x443dc1[_0x2d57('0x13')],function(_0x5bf5eb){return{'model':db[_0x5bf5eb['model']],'as':_0x5bf5eb['as'],'attributes':_0x5bf5eb[_0x2d57('0x11')]};}):[]};}):[]};}):[]:[]})[_0x2d57('0x5')](function(_0x5b7083){logger[_0x2d57('0x6')](_0x2d57('0x18'),_0x39a24b);logger['debug'](_0x2d57('0x18'),_0x39a24b,JSON[_0x2d57('0x9')](_0x5b7083));_0x52595e(_0x5b7083);})['catch'](function(_0x38491f){logger[_0x2d57('0xb')](_0x2d57('0x18'),_0x38491f[_0x2d57('0xc')],_0x39a24b);_0x3dbad8(_0x5f2077[_0x2d57('0xb')](0x1f4,_0x38491f[_0x2d57('0xc')]));});});};exports[_0x2d57('0x1b')]=function(_0x9a706b){var _0x4ad1fa=this;return new Promise(function(_0x2ed791,_0x1dad77){return db[_0x2d57('0xe')][_0x2d57('0x1c')](_0x9a706b[_0x2d57('0x1d')],{'raw':_0x9a706b[_0x2d57('0xf')]?_0x9a706b[_0x2d57('0xf')][_0x2d57('0x1a')]===undefined?!![]:![]:!![]})[_0x2d57('0x5')](function(_0x5838bf){logger[_0x2d57('0x6')](_0x2d57('0x1b'),_0x9a706b);logger['debug']('CreateCmHopper',_0x9a706b,JSON[_0x2d57('0x9')](_0x5838bf));_0x2ed791(_0x5838bf);})[_0x2d57('0x1e')](function(_0x17e698){logger[_0x2d57('0xb')](_0x2d57('0x1b'),_0x17e698[_0x2d57('0xc')],_0x9a706b);_0x1dad77(_0x4ad1fa[_0x2d57('0xb')](0x1f4,_0x17e698[_0x2d57('0xc')]));});});};exports[_0x2d57('0x1f')]=function(_0xfdc694){var _0xf24ac9=this;return new Promise(function(_0x3233b9,_0x4a7d8e){return db[_0x2d57('0xe')][_0x2d57('0x20')](_0xfdc694[_0x2d57('0x1d')],{'raw':_0xfdc694[_0x2d57('0xf')]?_0xfdc694[_0x2d57('0xf')][_0x2d57('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfdc694[_0x2d57('0xf')]?_0xfdc694[_0x2d57('0xf')]['where']||null:null,'attributes':_0xfdc694[_0x2d57('0xf')]?_0xfdc694[_0x2d57('0xf')]['attributes']||null:null,'limit':_0xfdc694[_0x2d57('0xf')]?_0xfdc694[_0x2d57('0xf')][_0x2d57('0x12')]||null:null})[_0x2d57('0x5')](function(_0x30c63e){logger[_0x2d57('0x6')](_0x2d57('0x1f'),_0xfdc694);logger[_0x2d57('0x6')](_0x2d57('0x21'),JSON['stringify'](_0xfdc694[_0x2d57('0xf')]['where']),_0xfdc694[_0x2d57('0x1d')][_0x2d57('0x22')]);logger['debug'](_0x2d57('0x1f'),_0xfdc694,JSON[_0x2d57('0x9')](_0x30c63e));_0x3233b9(_0x30c63e);})[_0x2d57('0x1e')](function(_0x4c619c){logger[_0x2d57('0xb')](_0x2d57('0x1f'),_0x4c619c[_0x2d57('0xc')],_0xfdc694);_0x4a7d8e(_0xf24ac9[_0x2d57('0xb')](0x1f4,_0x4c619c[_0x2d57('0xc')]));});});};exports['DestroyCmHopper']=function(_0xb1dc30){var _0x3edb1c=this;return new Promise(function(_0x48bfc5,_0x2e3365){return db[_0x2d57('0xe')][_0x2d57('0x23')]({'where':_0xb1dc30[_0x2d57('0xf')]?_0xb1dc30[_0x2d57('0xf')][_0x2d57('0x10')]||null:null})[_0x2d57('0x5')](function(_0x43bdaf){logger[_0x2d57('0x6')]('DestroyCmHopper',_0xb1dc30);logger[_0x2d57('0x17')](_0x2d57('0x24'),_0xb1dc30,JSON[_0x2d57('0x9')](_0x43bdaf));_0x48bfc5(_0x43bdaf);})[_0x2d57('0x1e')](function(_0x1b09c2){logger[_0x2d57('0xb')](_0x2d57('0x24'),_0x1b09c2[_0x2d57('0xc')],_0xb1dc30);_0x2e3365(_0x3edb1c['error'](0x1f4,_0x1b09c2[_0x2d57('0xc')]));});});};exports[_0x2d57('0x25')]=function(_0x210116){var _0x1aa697=this;return new Promise(function(_0x3f5da6,_0x3c68c9){return db[_0x2d57('0x26')]['describe']()[_0x2d57('0x5')](function(_0x1dbc1a){return db['sequelize']['transaction'](function(_0x55392a){return db['CmHopper']['findAll']({'where':_0x210116[_0x2d57('0xf')]?_0x210116[_0x2d57('0xf')]['where']||null:null,'attributes':_0x210116[_0x2d57('0xf')]?_0x210116['options'][_0x2d57('0x11')]||null:null,'limit':_0x210116[_0x2d57('0xf')]?_0x210116[_0x2d57('0xf')][_0x2d57('0x12')]||null:null,'order':_0x210116[_0x2d57('0xf')]?_0x210116['options']['order']||null:null,'transaction':_0x55392a,'lock':_0x55392a['LOCK'][_0x2d57('0x27')],'include':[{'model':db[_0x2d57('0x26')],'as':'Contact','attributes':_[_0x2d57('0x28')](_0x1dbc1a)},{'model':db[_0x2d57('0x29')],'as':_0x2d57('0x2a'),'attributes':['id','name','voicePause']}]})[_0x2d57('0x5')](function(_0x2c10d0){var _0x3c197b=[];var _0x1d0f2f=[];for(var _0x29ab7f=0x0;_0x29ab7f<_0x2c10d0['length'];_0x29ab7f+=0x1){var _0x3a806c=_0x2c10d0[_0x29ab7f][_0x2d57('0x2b')];if(_0x3a806c===null){_0x3c197b[_0x2d57('0x2c')](_0x2c10d0[_0x29ab7f][_0x2d57('0x20')](_0x210116[_0x2d57('0x1d')],{'transaction':_0x55392a}));}else if(!_0x1d0f2f[_0x2d57('0x2d')](_0x3a806c)){_0x1d0f2f[_0x2d57('0x2c')](_0x3a806c);_0x3c197b[_0x2d57('0x2c')](_0x2c10d0[_0x29ab7f]['update'](_0x210116['body'],{'transaction':_0x55392a}));}}return BPromise[_0x2d57('0x2e')](_0x3c197b);});})[_0x2d57('0x5')](function(_0x3b49c9){logger[_0x2d57('0x6')](_0x2d57('0x25'),_0x210116);if(_0x3b49c9[_0x2d57('0x2f')]>0x0){logger[_0x2d57('0x6')](_0x2d57('0x30'),_0x3b49c9[0x0][_0x2d57('0x31')]['id'],_0x3b49c9[0x0][_0x2d57('0x31')]['ContactId'],_0x3b49c9[0x0][_0x2d57('0x31')][_0x2d57('0x22')]);}logger[_0x2d57('0x17')](_0x2d57('0x25'),_0x210116,JSON[_0x2d57('0x9')](_0x3b49c9));_0x3f5da6(_0x3b49c9);})[_0x2d57('0x1e')](function(_0x5b48b5){logger[_0x2d57('0xb')]('GetContactDialer',_0x5b48b5['message'],_0x210116);_0x3c68c9(_0x1aa697[_0x2d57('0xb')](0x1f4,_0x5b48b5[_0x2d57('0xc')]));});});});};exports['MoveContactManagedDialer']=function(_0x969f9b){var _0x593092=this;return new Promise(function(_0x4cf3ba,_0x250652){return db[_0x2d57('0x32')]['transaction'](function(_0x23718a){return db[_0x2d57('0x33')]['create'](_0x969f9b[_0x2d57('0x1d')],{'raw':_0x969f9b[_0x2d57('0xf')]?_0x969f9b[_0x2d57('0xf')][_0x2d57('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x23718a})[_0x2d57('0x5')](function(){logger[_0x2d57('0x6')](_0x2d57('0x34'),JSON[_0x2d57('0x9')](_0x969f9b['options'][_0x2d57('0x10')]),_0x969f9b[_0x2d57('0xf')]['where']['active']);return db[_0x2d57('0xe')][_0x2d57('0x23')]({'where':_0x969f9b[_0x2d57('0xf')]?_0x969f9b[_0x2d57('0xf')]['where']||null:null,'transaction':_0x23718a});});})[_0x2d57('0x5')](function(_0x4db07e){logger[_0x2d57('0x6')](_0x2d57('0x35'),_0x969f9b);logger[_0x2d57('0x17')](_0x2d57('0x35'),_0x969f9b,JSON[_0x2d57('0x9')](_0x4db07e));_0x4cf3ba(_0x4db07e);})[_0x2d57('0x1e')](function(_0x3a9957){logger['error']('MoveContactManagedDialer',_0x3a9957['message'],_0x969f9b);_0x250652(_0x593092[_0x2d57('0xb')](0x1f4,_0x3a9957['message']));});});};exports[_0x2d57('0x36')]=function(_0x49a271){var _0x1fa3d0=this;return new Promise(function(_0x3dcbc9,_0x5b166c){return db[_0x2d57('0xe')]['findAll']({'raw':_0x49a271['options']?_0x49a271['options'][_0x2d57('0x1a')]===undefined?!![]:![]:!![],'where':_0x49a271[_0x2d57('0xf')]?_0x49a271[_0x2d57('0xf')][_0x2d57('0x10')]||null:null,'attributes':[[db[_0x2d57('0x32')]['fn']('COUNT',db[_0x2d57('0x32')]['fn']('IF',db[_0x2d57('0x32')][_0x2d57('0x37')](_0x2d57('0x38')+util[_0x2d57('0x39')](_0x2d57('0x3a'),moment()[_0x2d57('0x39')](_0x2d57('0x3b')))+'\x20,\x201,\x20null'))),_0x2d57('0x3c')]]})[_0x2d57('0x5')](function(_0x1a87da){logger[_0x2d57('0x6')]('CountReScheduled',_0x49a271);logger[_0x2d57('0x17')](_0x2d57('0x36'),_0x49a271,JSON[_0x2d57('0x9')](_0x1a87da));_0x3dcbc9(_0x1a87da);})[_0x2d57('0x1e')](function(_0x73270b){logger['error'](_0x2d57('0x36'),_0x73270b[_0x2d57('0xc')],_0x49a271);_0x5b166c(_0x1fa3d0[_0x2d57('0xb')](0x1f4,_0x73270b[_0x2d57('0xc')]));});});};exports[_0x2d57('0x3d')]=function(_0xed7081){var _0x3e74e1=this;return new Promise(function(_0x54a421,_0x2020a1){return db[_0x2d57('0x26')][_0x2d57('0x3e')]()[_0x2d57('0x5')](function(_0x303d4a){return db[_0x2d57('0x32')][_0x2d57('0x3f')](function(_0x557856){return db[_0x2d57('0xe')][_0x2d57('0x40')]({'where':_0xed7081['options']?_0xed7081[_0x2d57('0xf')][_0x2d57('0x10')]||null:null,'attributes':_0xed7081[_0x2d57('0xf')]?_0xed7081['options'][_0x2d57('0x11')]||null:null,'limit':0x1,'order':_0xed7081[_0x2d57('0xf')]?_0xed7081[_0x2d57('0xf')][_0x2d57('0x41')]||null:null,'group':db[_0x2d57('0xe')][_0x2d57('0x2b')],'transaction':_0x557856,'lock':_0x557856[_0x2d57('0x42')][_0x2d57('0x27')],'include':_0xed7081[_0x2d57('0xf')]?_0xed7081[_0x2d57('0xf')][_0x2d57('0x13')]?_[_0x2d57('0x14')](_0xed7081['options'][_0x2d57('0x13')],function(_0x3f931d){return{'model':db[_0x3f931d[_0x2d57('0x15')]],'as':_0x3f931d['as'],'attributes':_0x3f931d['attributes'],'include':_0x3f931d['include']?_[_0x2d57('0x14')](_0x3f931d['include'],function(_0x55ad8c){return{'model':db[_0x55ad8c[_0x2d57('0x15')]],'as':_0x55ad8c['as'],'attributes':_0x55ad8c[_0x2d57('0x11')],'include':_0x55ad8c['include']?_['map'](_0x55ad8c[_0x2d57('0x13')],function(_0x560b54){return{'model':db[_0x560b54[_0x2d57('0x15')]],'as':_0x560b54['as'],'attributes':_0x560b54[_0x2d57('0x11')]};}):[]};}):[]};}):[]:[]})[_0x2d57('0x5')](function(_0x4ddf52){var _0x528b29=[];for(var _0x1e193e=0x0;_0x1e193e<_0x4ddf52['length'];_0x1e193e+=0x1){_0x528b29[_0x2d57('0x2c')](_0x4ddf52[_0x1e193e]['update'](_0xed7081[_0x2d57('0x1d')],{'transaction':_0x557856}));}return BPromise[_0x2d57('0x2e')](_0x528b29);});})[_0x2d57('0x5')](function(_0x2c19e1){logger[_0x2d57('0x6')](_0x2d57('0x3d'),_0xed7081);logger['debug'](_0x2d57('0x3d'),_0xed7081,JSON[_0x2d57('0x9')](_0x2c19e1));_0x54a421(_0x2c19e1);})['catch'](function(_0x596608){logger[_0x2d57('0xb')]('GetContactRecallMe',_0x596608[_0x2d57('0xc')],_0xed7081);_0x2020a1(_0x3e74e1['error'](0x1f4,_0x596608[_0x2d57('0xc')]));});});});};exports['GetCmHopperPreview']=function(_0x1b4e1d){var _0x92cb3e=this;return new Promise(function(_0x686cc8,_0x265478){db[_0x2d57('0x26')][_0x2d57('0x3e')]()['then'](function(_0x12ece2){return db[_0x2d57('0xe')][_0x2d57('0x40')]({'raw':_0x1b4e1d[_0x2d57('0xf')]?_0x1b4e1d[_0x2d57('0xf')]['raw']===undefined?!![]:![]:!![],'where':_0x1b4e1d[_0x2d57('0xf')]?_0x1b4e1d[_0x2d57('0xf')][_0x2d57('0x10')]||null:null,'attributes':_0x1b4e1d[_0x2d57('0xf')]?_0x1b4e1d[_0x2d57('0xf')][_0x2d57('0x11')]||null:null,'limit':_0x1b4e1d['options']?_0x1b4e1d[_0x2d57('0xf')][_0x2d57('0x12')]||null:null,'include':_0x1b4e1d['options']?_0x1b4e1d[_0x2d57('0xf')][_0x2d57('0x13')]?_['map'](_0x1b4e1d[_0x2d57('0xf')][_0x2d57('0x13')],function(_0x426f6c){return{'model':db[_0x426f6c['model']],'as':_0x426f6c['as'],'attributes':_0x426f6c['as']===_0x2d57('0x43')?_[_0x2d57('0x28')](_0x12ece2):_0x426f6c[_0x2d57('0x11')],'include':_0x426f6c[_0x2d57('0x13')]?_[_0x2d57('0x14')](_0x426f6c['include'],function(_0x5d2011){return{'model':db[_0x5d2011['model']],'as':_0x5d2011['as'],'attributes':_0x5d2011['attributes'],'include':_0x5d2011[_0x2d57('0x13')]?_[_0x2d57('0x14')](_0x5d2011[_0x2d57('0x13')],function(_0x2d7800){return{'model':db[_0x2d7800['model']],'as':_0x2d7800['as'],'attributes':_0x2d7800[_0x2d57('0x11')]};}):[]};}):[]};}):[]:[]})[_0x2d57('0x5')](function(_0x5467f6){logger[_0x2d57('0x6')](_0x2d57('0x16'),_0x1b4e1d);logger[_0x2d57('0x17')](_0x2d57('0x16'),_0x1b4e1d,JSON['stringify'](_0x5467f6));_0x686cc8(_0x5467f6);})[_0x2d57('0x1e')](function(_0x37774e){logger[_0x2d57('0xb')]('GetCmHopper',_0x37774e['message'],_0x1b4e1d);_0x265478(_0x92cb3e[_0x2d57('0xb')](0x1f4,_0x37774e[_0x2d57('0xc')]));});});});};exports[_0x2d57('0x44')]=function(_0x356cca){var _0x4612c0=this;return new Promise(function(_0x5b208f,_0x1ba508){return db[_0x2d57('0x26')]['findOne']({'raw':!![],'where':{'phone':_0x356cca[_0x2d57('0xf')]['where'][_0x2d57('0x45')]},'attributes':['id',_0x2d57('0x46')],'order':[['id',_0x2d57('0x47')]]})[_0x2d57('0x5')](function(_0x5351c8){logger[_0x2d57('0x6')](_0x2d57('0x48'),_0x356cca);logger['debug']('getContactByPhone',_0x356cca,JSON[_0x2d57('0x9')](_0x5351c8));_0x5b208f(_0x5351c8);})[_0x2d57('0x1e')](function(_0x42ac30){logger[_0x2d57('0xb')](_0x2d57('0x48'),_0x42ac30[_0x2d57('0xc')],_0x356cca);_0x1ba508(_0x4612c0[_0x2d57('0xb')](0x1f4,_0x42ac30[_0x2d57('0xc')]));});});};exports['ResetActiveCalls']=function(_0x54756a){var _0xc201b2=this;return new Promise(function(_0x5814bd,_0x4ac178){return db[_0x2d57('0x32')][_0x2d57('0x3f')](function(_0x4f07d9){return db['CmHopper'][_0x2d57('0x20')]({'active':![]},{'where':{},'transaction':_0x4f07d9})['then'](function(_0x568eeb){logger[_0x2d57('0x6')](_0x2d57('0x49'),_0x54756a);logger[_0x2d57('0x17')]('ResetActiveCalls',_0x54756a,JSON[_0x2d57('0x9')](_0x568eeb));_0x5814bd(_0x568eeb);})[_0x2d57('0x1e')](function(_0x167bfc){logger[_0x2d57('0xb')](_0x2d57('0x49'),_0x167bfc[_0x2d57('0xc')],_0x54756a);_0x4ac178(_0xc201b2[_0x2d57('0xb')](0x1f4,_0x167bfc[_0x2d57('0xc')]));});});});};exports[_0x2d57('0x4a')]=function(_0x21317d){var _0x37f2c5=this;var _0x3ea90b=_0x21317d['body'][_0x2d57('0x10')][_0x2d57('0x4b')];var _0x5e2b23=_0x21317d['body'][_0x2d57('0x10')]['interval'];var _0xc62c4a=_0x21317d[_0x2d57('0x1d')][_0x2d57('0x10')][_0x2d57('0x4c')];console[_0x2d57('0x4d')](_0x2d57('0x4e'),_0x3ea90b,_0x5e2b23,_0xc62c4a);return new Promise(function(_0x3dbe94,_0x2c6096){return db[_0x2d57('0xe')][_0x2d57('0x40')]({'where':{'voiceQueueId':{'$in':_0x3ea90b},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x2d57('0x32')][_0x2d57('0x37')](_0x2d57('0x4f')+_0x5e2b23+_0x2d57('0x50')),'$gt':db[_0x2d57('0x32')][_0x2d57('0x37')]('NOW()')}},'UserId':{'$in':_0xc62c4a}},'logging':!![],'include':[{'model':db[_0x2d57('0x26')],'as':'Contact'},{'model':db[_0x2d57('0x29')],'as':_0x2d57('0x2a'),'attributes':['id','name',_0x2d57('0x51')]},{'model':db[_0x2d57('0x52')],'as':'List'}]})[_0x2d57('0x5')](function(_0xa28b77){console[_0x2d57('0x4d')](_0x2d57('0x53'),_0xa28b77);if(_0xa28b77[_0x2d57('0x2f')]>0x0){return db[_0x2d57('0x32')]['transaction'](function(_0x3c7ba5){return db[_0x2d57('0xe')][_0x2d57('0x20')]({'recallmeNotifiedDate':db[_0x2d57('0x32')][_0x2d57('0x37')](_0x2d57('0x54'))},{'where':{'id':{'$in':_[_0x2d57('0x14')](_0xa28b77,'id')}},'logging':!![],'transaction':_0x3c7ba5})['then'](function(){_0x3dbe94(_0xa28b77);})[_0x2d57('0x1e')](function(_0x219bcd){logger[_0x2d57('0xb')]('CmHopperHandlePreviewRecallNotifications',_0x219bcd['message'],_0x21317d);_0x2c6096(_0x37f2c5[_0x2d57('0xb')](0x1f4,_0x219bcd[_0x2d57('0xc')]));});})['catch'](function(_0x2377b1){logger[_0x2d57('0xb')](_0x2d57('0x4a'),_0x2377b1[_0x2d57('0xc')],_0x21317d);_0x2c6096(_0x37f2c5[_0x2d57('0xb')](0x1f4,_0x2377b1[_0x2d57('0xc')]));});}else{_0x3dbe94(_0xa28b77);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 2973f18..4552707 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 _0x76ee=['getOpenContacts','getTimezones','/:id','getPreviewRecall','post','getPreview','/timezone','getTimezone','delete','destroy','express','./cmHopper.controller','get','/describe','describe','/opencontacts','isAuthenticated'];(function(_0x69fc5c,_0x242a6a){var _0x2c45a2=function(_0x281d4c){while(--_0x281d4c){_0x69fc5c['push'](_0x69fc5c['shift']());}};_0x2c45a2(++_0x242a6a);}(_0x76ee,0xa3));var _0xe76e=function(_0x18b7bc,_0xd21b82){_0x18b7bc=_0x18b7bc-0x0;var _0x445fdb=_0x76ee[_0x18b7bc];return _0x445fdb;};'use strict';var express=require(_0xe76e('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xe76e('0x1'));router[_0xe76e('0x2')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe76e('0x2')](_0xe76e('0x3'),auth['isAuthenticated'](),controller[_0xe76e('0x4')]);router[_0xe76e('0x2')](_0xe76e('0x5'),auth[_0xe76e('0x6')](),controller[_0xe76e('0x7')]);router[_0xe76e('0x2')]('/timezones',auth[_0xe76e('0x6')](),controller[_0xe76e('0x8')]);router['get'](_0xe76e('0x9'),auth[_0xe76e('0x6')](),controller['show']);router[_0xe76e('0x2')]('/:id/previewrecall',auth['isAuthenticated'](),controller[_0xe76e('0xa')]);router['post']('/',auth[_0xe76e('0x6')](),controller['create']);router[_0xe76e('0xb')]('/preview',auth[_0xe76e('0x6')](),controller[_0xe76e('0xc')]);router[_0xe76e('0xb')](_0xe76e('0xd'),auth['isAuthenticated'](),controller[_0xe76e('0xe')]);router['put'](_0xe76e('0x9'),auth[_0xe76e('0x6')](),controller['update']);router[_0xe76e('0xf')](_0xe76e('0x9'),auth[_0xe76e('0x6')](),controller[_0xe76e('0x10')]);module['exports']=router; \ No newline at end of file +var _0x21d5=['getPreviewRecall','post','/preview','getPreview','/timezone','getTimezone','put','/:id','update','delete','destroy','exports','express','Router','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts','getTimezones'];(function(_0x342993,_0x43f554){var _0x366ce=function(_0x2cbdc2){while(--_0x2cbdc2){_0x342993['push'](_0x342993['shift']());}};_0x366ce(++_0x43f554);}(_0x21d5,0x8a));var _0x521d=function(_0x2d4a91,_0x3fc268){_0x2d4a91=_0x2d4a91-0x0;var _0x5b0260=_0x21d5[_0x2d4a91];return _0x5b0260;};'use strict';var express=require(_0x521d('0x0'));var router=express[_0x521d('0x1')]();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router[_0x521d('0x2')]('/',auth[_0x521d('0x3')](),controller[_0x521d('0x4')]);router[_0x521d('0x2')](_0x521d('0x5'),auth[_0x521d('0x3')](),controller['describe']);router[_0x521d('0x2')](_0x521d('0x6'),auth[_0x521d('0x3')](),controller[_0x521d('0x7')]);router[_0x521d('0x2')]('/timezones',auth['isAuthenticated'](),controller[_0x521d('0x8')]);router[_0x521d('0x2')]('/:id',auth[_0x521d('0x3')](),controller['show']);router['get']('/:id/previewrecall',auth['isAuthenticated'](),controller[_0x521d('0x9')]);router[_0x521d('0xa')]('/',auth[_0x521d('0x3')](),controller['create']);router['post'](_0x521d('0xb'),auth[_0x521d('0x3')](),controller[_0x521d('0xc')]);router['post'](_0x521d('0xd'),auth[_0x521d('0x3')](),controller[_0x521d('0xe')]);router[_0x521d('0xf')](_0x521d('0x10'),auth['isAuthenticated'](),controller[_0x521d('0x11')]);router[_0x521d('0x12')](_0x521d('0x10'),auth[_0x521d('0x3')](),controller[_0x521d('0x13')]);module[_0x521d('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 9cbee3e..c10e03b 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 _0xe604=['contactListQueue','INTEGER','moment'];(function(_0x454af7,_0x3a15b3){var _0x220702=function(_0x52881c){while(--_0x52881c){_0x454af7['push'](_0x454af7['shift']());}};_0x220702(++_0x3a15b3);}(_0xe604,0x101));var _0x4e60=function(_0x16c5d5,_0x71ab68){_0x16c5d5=_0x16c5d5-0x0;var _0x5c7954=_0xe604[_0x16c5d5];return _0x5c7954;};'use strict';var moment=require(_0x4e60('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x4e60('0x1')},'ListId':{'type':Sequelize[_0x4e60('0x2')],'unique':_0x4e60('0x1')},'VoiceQueueId':{'type':Sequelize[_0x4e60('0x2')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0xf966=['exports','INTEGER','contactListQueue','moment','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf966,0x184));var _0x6f96=function(_0x1eff29,_0x2b7081){_0x1eff29=_0x1eff29-0x0;var _0x3003ee=_0xf966[_0x1eff29];return _0x3003ee;};'use strict';var moment=require(_0x6f96('0x0'));var Sequelize=require(_0x6f96('0x1'));module[_0x6f96('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6f96('0x3')],'unique':_0x6f96('0x4')},'ListId':{'type':Sequelize[_0x6f96('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x6f96('0x3')],'unique':_0x6f96('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 47e6f0a..cd36011 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 _0xeaba=['keys','fields','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','save','then','destroy','stack','send','index','map','CmHopperBlack','rawAttributes','type','model','name','intersection','query','attributes','length','hasOwnProperty','order','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params'];(function(_0x1f44e4,_0x22d9fd){var _0x591989=function(_0x3aeb88){while(--_0x3aeb88){_0x1f44e4['push'](_0x1f44e4['shift']());}};_0x591989(++_0x22d9fd);}(_0xeaba,0x87));var _0xaeab=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xeaba[_0x1ae5ab];return _0x1ce001;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaeab('0x0'));var zipdir=require(_0xaeab('0x1'));var jsonpatch=require(_0xaeab('0x2'));var rp=require(_0xaeab('0x3'));var moment=require(_0xaeab('0x4'));var BPromise=require(_0xaeab('0x5'));var Mustache=require(_0xaeab('0x6'));var util=require(_0xaeab('0x7'));var path=require(_0xaeab('0x8'));var sox=require(_0xaeab('0x9'));var csv=require(_0xaeab('0xa'));var ejs=require(_0xaeab('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaeab('0xc'));var squel=require('squel');var crypto=require(_0xaeab('0xd'));var jsforce=require(_0xaeab('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaeab('0xa'));var querystring=require('querystring');var Papa=require(_0xaeab('0xf'));var Redis=require('ioredis');var authService=require(_0xaeab('0x10'));var qs=require(_0xaeab('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaeab('0x12'));var logger=require(_0xaeab('0x13'))(_0xaeab('0x14'));var utils=require('../../config/utils');var config=require(_0xaeab('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32dc2a,_0x4e0fe4){_0x4e0fe4=_0x4e0fe4||0xcc;return function(_0x93de65){if(_0x93de65){return _0x32dc2a[_0xaeab('0x16')](_0x4e0fe4);}return _0x32dc2a[_0xaeab('0x17')](_0x4e0fe4)[_0xaeab('0x18')]();};}function respondWithResult(_0x455a9c,_0x1bf1c5){_0x1bf1c5=_0x1bf1c5||0xc8;return function(_0x388490){if(_0x388490){return _0x455a9c[_0xaeab('0x17')](_0x1bf1c5)[_0xaeab('0x19')](_0x388490);}};}function respondWithFilteredResult(_0x42b9b3,_0x36e7bd){return function(_0x5b76a4){if(_0x5b76a4){var _0x523d26=typeof _0x36e7bd[_0xaeab('0x1a')]==='undefined'&&typeof _0x36e7bd['limit']===_0xaeab('0x1b');var _0x4d899a=_0x5b76a4[_0xaeab('0x1c')];var _0x1d79ea=_0x523d26?0x0:_0x36e7bd[_0xaeab('0x1a')];var _0x3deed1=_0x523d26?_0x5b76a4[_0xaeab('0x1c')]:_0x36e7bd[_0xaeab('0x1a')]+_0x36e7bd[_0xaeab('0x1d')];var _0x1ab1c4;if(_0x3deed1>=_0x4d899a){_0x3deed1=_0x4d899a;_0x1ab1c4=0xc8;}else{_0x1ab1c4=0xce;}_0x42b9b3[_0xaeab('0x17')](_0x1ab1c4);return _0x42b9b3[_0xaeab('0x1e')]('Content-Range',_0x1d79ea+'-'+_0x3deed1+'/'+_0x4d899a)[_0xaeab('0x19')](_0x5b76a4);}return null;};}function patchUpdates(_0x367e16){return function(_0x3a5428){try{jsonpatch['apply'](_0x3a5428,_0x367e16,!![]);}catch(_0x581b29){return BPromise['reject'](_0x581b29);}return _0x3a5428[_0xaeab('0x1f')]();};}function saveUpdates(_0x5525c2,_0x487f1a){return function(_0x5aa51c){if(_0x5aa51c){return _0x5aa51c['update'](_0x5525c2)[_0xaeab('0x20')](function(_0x546f36){return _0x546f36;});}return null;};}function removeEntity(_0x2afa5c,_0x39a0fe){return function(_0x1bc18d){if(_0x1bc18d){return _0x1bc18d[_0xaeab('0x21')]()[_0xaeab('0x20')](function(){_0x2afa5c[_0xaeab('0x17')](0xcc)[_0xaeab('0x18')]();});}};}function handleEntityNotFound(_0x31ad1e,_0x46e42e){return function(_0x4d8973){if(!_0x4d8973){_0x31ad1e[_0xaeab('0x16')](0x194);}return _0x4d8973;};}function handleError(_0x11203f,_0x592da9){_0x592da9=_0x592da9||0x1f4;return function(_0x35e75b){logger['error'](_0x35e75b[_0xaeab('0x22')]);if(_0x35e75b['name']){delete _0x35e75b['name'];}_0x11203f[_0xaeab('0x17')](_0x592da9)[_0xaeab('0x23')](_0x35e75b);};}exports[_0xaeab('0x24')]=function(_0x28748a,_0xa558a3){var _0x5a7ae7={},_0x4a4645={},_0x5365b={'count':0x0,'rows':[]};var _0x7a03cf=_[_0xaeab('0x25')](db[_0xaeab('0x26')][_0xaeab('0x27')],function(_0x2f57c1){return{'name':_0x2f57c1['fieldName'],'type':_0x2f57c1[_0xaeab('0x28')]['key']};});_0x4a4645[_0xaeab('0x29')]=_[_0xaeab('0x25')](_0x7a03cf,_0xaeab('0x2a'));_0x4a4645['query']=_['keys'](_0x28748a['query']);_0x4a4645['filters']=_[_0xaeab('0x2b')](_0x4a4645[_0xaeab('0x29')],_0x4a4645[_0xaeab('0x2c')]);_0x5a7ae7[_0xaeab('0x2d')]=_[_0xaeab('0x2b')](_0x4a4645[_0xaeab('0x29')],qs['fields'](_0x28748a['query']['fields']));_0x5a7ae7[_0xaeab('0x2d')]=_0x5a7ae7['attributes'][_0xaeab('0x2e')]?_0x5a7ae7['attributes']:_0x4a4645[_0xaeab('0x29')];if(!_0x28748a['query'][_0xaeab('0x2f')]('nolimit')){_0x5a7ae7['limit']=qs[_0xaeab('0x1d')](_0x28748a[_0xaeab('0x2c')][_0xaeab('0x1d')]);_0x5a7ae7['offset']=qs[_0xaeab('0x1a')](_0x28748a['query'][_0xaeab('0x1a')]);}_0x5a7ae7[_0xaeab('0x30')]=qs['sort'](_0x28748a[_0xaeab('0x2c')]['sort']);_0x5a7ae7[_0xaeab('0x31')]=qs[_0xaeab('0x32')](_['pick'](_0x28748a[_0xaeab('0x2c')],_0x4a4645[_0xaeab('0x32')]),_0x7a03cf);if(_0x28748a['query'][_0xaeab('0x33')]){_0x5a7ae7['where']=_[_0xaeab('0x34')](_0x5a7ae7['where'],{'$or':_[_0xaeab('0x25')](_0x7a03cf,function(_0xd22b9b){if(_0xd22b9b[_0xaeab('0x28')]!==_0xaeab('0x35')){var _0x451d9f={};_0x451d9f[_0xd22b9b[_0xaeab('0x2a')]]={'$like':'%'+_0x28748a['query'][_0xaeab('0x33')]+'%'};return _0x451d9f;}})});}_0x5a7ae7=_['merge']({},_0x5a7ae7,_0x28748a[_0xaeab('0x36')]);var _0x1c8d09={'where':_0x5a7ae7[_0xaeab('0x31')]};return db['CmHopperBlack'][_0xaeab('0x1c')](_0x1c8d09)[_0xaeab('0x20')](function(_0x4dd5a9){_0x5365b[_0xaeab('0x1c')]=_0x4dd5a9;if(_0x28748a[_0xaeab('0x2c')][_0xaeab('0x37')]){_0x5a7ae7['include']=[{'all':!![]}];}return db[_0xaeab('0x26')]['findAll'](_0x5a7ae7);})[_0xaeab('0x20')](function(_0x3639b3){_0x5365b[_0xaeab('0x38')]=_0x3639b3;return _0x5365b;})[_0xaeab('0x20')](respondWithFilteredResult(_0xa558a3,_0x5a7ae7))[_0xaeab('0x39')](handleError(_0xa558a3,null));};exports[_0xaeab('0x3a')]=function(_0x3c1a96,_0x11ea7c){var _0x2536b8={'raw':!![],'where':{'id':_0x3c1a96[_0xaeab('0x3b')]['id']}},_0xe21ef5={};_0xe21ef5[_0xaeab('0x29')]=_[_0xaeab('0x3c')](db['CmHopperBlack']['rawAttributes']);_0xe21ef5[_0xaeab('0x2c')]=_[_0xaeab('0x3c')](_0x3c1a96[_0xaeab('0x2c')]);_0xe21ef5[_0xaeab('0x32')]=_['intersection'](_0xe21ef5[_0xaeab('0x29')],_0xe21ef5[_0xaeab('0x2c')]);_0x2536b8[_0xaeab('0x2d')]=_[_0xaeab('0x2b')](_0xe21ef5[_0xaeab('0x29')],qs[_0xaeab('0x3d')](_0x3c1a96[_0xaeab('0x2c')][_0xaeab('0x3d')]));_0x2536b8[_0xaeab('0x2d')]=_0x2536b8[_0xaeab('0x2d')][_0xaeab('0x2e')]?_0x2536b8['attributes']:_0xe21ef5[_0xaeab('0x29')];if(_0x3c1a96[_0xaeab('0x2c')][_0xaeab('0x37')]){_0x2536b8['include']=[{'all':!![]}];}_0x2536b8=_[_0xaeab('0x34')]({},_0x2536b8,_0x3c1a96[_0xaeab('0x36')]);return db[_0xaeab('0x26')]['find'](_0x2536b8)['then'](handleEntityNotFound(_0x11ea7c,null))[_0xaeab('0x20')](respondWithResult(_0x11ea7c,null))['catch'](handleError(_0x11ea7c,null));};exports['update']=function(_0x534e32,_0x36df6b){if(_0x534e32[_0xaeab('0x3e')]['id']){delete _0x534e32[_0xaeab('0x3e')]['id'];}return db['CmHopperBlack'][_0xaeab('0x3f')]({'where':{'id':_0x534e32[_0xaeab('0x3b')]['id']}})[_0xaeab('0x20')](handleEntityNotFound(_0x36df6b,null))[_0xaeab('0x20')](saveUpdates(_0x534e32[_0xaeab('0x3e')],null))[_0xaeab('0x20')](respondWithResult(_0x36df6b,null))[_0xaeab('0x39')](handleError(_0x36df6b,null));};exports[_0xaeab('0x21')]=function(_0x17b6f0,_0x14532b){return db[_0xaeab('0x26')]['find']({'where':{'id':_0x17b6f0['params']['id']}})[_0xaeab('0x20')](handleEntityNotFound(_0x14532b,null))[_0xaeab('0x20')](removeEntity(_0x14532b,null))[_0xaeab('0x39')](handleError(_0x14532b,null));};exports[_0xaeab('0x40')]=function(_0x24a722,_0x35dd17){return db[_0xaeab('0x26')][_0xaeab('0x40')]()[_0xaeab('0x20')](respondWithResult(_0x35dd17,null))[_0xaeab('0x39')](handleError(_0x35dd17,null));}; \ No newline at end of file +var _0x5496=['reject','update','then','destroy','error','stack','name','send','CmHopperBlack','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','body','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','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','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5496,0x105));var _0x6549=function(_0x5c4a9d,_0x1cbae8){_0x5c4a9d=_0x5c4a9d-0x0;var _0x33151b=_0x5496[_0x5c4a9d];return _0x33151b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6549('0x0'));var jsonpatch=require(_0x6549('0x1'));var rp=require(_0x6549('0x2'));var moment=require('moment');var BPromise=require(_0x6549('0x3'));var Mustache=require(_0x6549('0x4'));var util=require(_0x6549('0x5'));var path=require('path');var sox=require(_0x6549('0x6'));var csv=require(_0x6549('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6549('0x8'));var squel=require(_0x6549('0x9'));var crypto=require('crypto');var jsforce=require(_0x6549('0xa'));var deskjs=require(_0x6549('0xb'));var toCsv=require(_0x6549('0x7'));var querystring=require(_0x6549('0xc'));var Papa=require(_0x6549('0xd'));var Redis=require(_0x6549('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6549('0xf'));var as=require(_0x6549('0x10'));var hardwareService=require(_0x6549('0x11'));var logger=require(_0x6549('0x12'))(_0x6549('0x13'));var utils=require(_0x6549('0x14'));var config=require(_0x6549('0x15'));var licenseUtil=require(_0x6549('0x16'));var db=require(_0x6549('0x17'))['db'];function respondWithStatusCode(_0x3811ed,_0x40d71f){_0x40d71f=_0x40d71f||0xcc;return function(_0x166a40){if(_0x166a40){return _0x3811ed[_0x6549('0x18')](_0x40d71f);}return _0x3811ed['status'](_0x40d71f)[_0x6549('0x19')]();};}function respondWithResult(_0x60716a,_0x2418d2){_0x2418d2=_0x2418d2||0xc8;return function(_0x1a4b29){if(_0x1a4b29){return _0x60716a[_0x6549('0x1a')](_0x2418d2)['json'](_0x1a4b29);}};}function respondWithFilteredResult(_0xc25c39,_0x3c7487){return function(_0x34c31c){if(_0x34c31c){var _0x4b91d5=typeof _0x3c7487[_0x6549('0x1b')]===_0x6549('0x1c')&&typeof _0x3c7487[_0x6549('0x1d')]===_0x6549('0x1c');var _0x57b87a=_0x34c31c[_0x6549('0x1e')];var _0xf12c91=_0x4b91d5?0x0:_0x3c7487[_0x6549('0x1b')];var _0x147a01=_0x4b91d5?_0x34c31c['count']:_0x3c7487[_0x6549('0x1b')]+_0x3c7487[_0x6549('0x1d')];var _0x1ebb3c;if(_0x147a01>=_0x57b87a){_0x147a01=_0x57b87a;_0x1ebb3c=0xc8;}else{_0x1ebb3c=0xce;}_0xc25c39[_0x6549('0x1a')](_0x1ebb3c);return _0xc25c39[_0x6549('0x1f')](_0x6549('0x20'),_0xf12c91+'-'+_0x147a01+'/'+_0x57b87a)[_0x6549('0x21')](_0x34c31c);}return null;};}function patchUpdates(_0x24b1e1){return function(_0xc45220){try{jsonpatch[_0x6549('0x22')](_0xc45220,_0x24b1e1,!![]);}catch(_0x58383b){return BPromise[_0x6549('0x23')](_0x58383b);}return _0xc45220['save']();};}function saveUpdates(_0x3ceba6,_0x1da5fe){return function(_0x44871f){if(_0x44871f){return _0x44871f[_0x6549('0x24')](_0x3ceba6)[_0x6549('0x25')](function(_0x115826){return _0x115826;});}return null;};}function removeEntity(_0x5c4c5f,_0xcfaa15){return function(_0x268c84){if(_0x268c84){return _0x268c84[_0x6549('0x26')]()[_0x6549('0x25')](function(){_0x5c4c5f['status'](0xcc)[_0x6549('0x19')]();});}};}function handleEntityNotFound(_0x1f1e06,_0x30f2db){return function(_0x1ac66a){if(!_0x1ac66a){_0x1f1e06[_0x6549('0x18')](0x194);}return _0x1ac66a;};}function handleError(_0x33215e,_0x38c6bc){_0x38c6bc=_0x38c6bc||0x1f4;return function(_0x10d957){logger[_0x6549('0x27')](_0x10d957[_0x6549('0x28')]);if(_0x10d957[_0x6549('0x29')]){delete _0x10d957[_0x6549('0x29')];}_0x33215e[_0x6549('0x1a')](_0x38c6bc)[_0x6549('0x2a')](_0x10d957);};}exports['index']=function(_0xf64a15,_0x12ff49){var _0x5607d4={},_0x4c9d5c={},_0x39b072={'count':0x0,'rows':[]};var _0x4cfaf0=_['map'](db[_0x6549('0x2b')]['rawAttributes'],function(_0x51e25b){return{'name':_0x51e25b[_0x6549('0x2c')],'type':_0x51e25b[_0x6549('0x2d')]['key']};});_0x4c9d5c[_0x6549('0x2e')]=_[_0x6549('0x2f')](_0x4cfaf0,'name');_0x4c9d5c[_0x6549('0x30')]=_[_0x6549('0x31')](_0xf64a15[_0x6549('0x30')]);_0x4c9d5c['filters']=_[_0x6549('0x32')](_0x4c9d5c[_0x6549('0x2e')],_0x4c9d5c[_0x6549('0x30')]);_0x5607d4[_0x6549('0x33')]=_[_0x6549('0x32')](_0x4c9d5c[_0x6549('0x2e')],qs['fields'](_0xf64a15[_0x6549('0x30')][_0x6549('0x34')]));_0x5607d4[_0x6549('0x33')]=_0x5607d4['attributes'][_0x6549('0x35')]?_0x5607d4[_0x6549('0x33')]:_0x4c9d5c[_0x6549('0x2e')];if(!_0xf64a15[_0x6549('0x30')][_0x6549('0x36')](_0x6549('0x37'))){_0x5607d4[_0x6549('0x1d')]=qs['limit'](_0xf64a15[_0x6549('0x30')]['limit']);_0x5607d4[_0x6549('0x1b')]=qs[_0x6549('0x1b')](_0xf64a15[_0x6549('0x30')][_0x6549('0x1b')]);}_0x5607d4[_0x6549('0x38')]=qs[_0x6549('0x39')](_0xf64a15[_0x6549('0x30')][_0x6549('0x39')]);_0x5607d4['where']=qs[_0x6549('0x3a')](_[_0x6549('0x3b')](_0xf64a15['query'],_0x4c9d5c[_0x6549('0x3a')]),_0x4cfaf0);if(_0xf64a15[_0x6549('0x30')][_0x6549('0x3c')]){_0x5607d4[_0x6549('0x3d')]=_[_0x6549('0x3e')](_0x5607d4['where'],{'$or':_['map'](_0x4cfaf0,function(_0x171820){if(_0x171820[_0x6549('0x2d')]!==_0x6549('0x3f')){var _0x45b01f={};_0x45b01f[_0x171820[_0x6549('0x29')]]={'$like':'%'+_0xf64a15['query']['filter']+'%'};return _0x45b01f;}})});}_0x5607d4=_[_0x6549('0x3e')]({},_0x5607d4,_0xf64a15[_0x6549('0x40')]);var _0xa0d329={'where':_0x5607d4[_0x6549('0x3d')]};return db[_0x6549('0x2b')][_0x6549('0x1e')](_0xa0d329)[_0x6549('0x25')](function(_0x21532c){_0x39b072['count']=_0x21532c;if(_0xf64a15[_0x6549('0x30')][_0x6549('0x41')]){_0x5607d4['include']=[{'all':!![]}];}return db[_0x6549('0x2b')][_0x6549('0x42')](_0x5607d4);})[_0x6549('0x25')](function(_0xecc45f){_0x39b072[_0x6549('0x43')]=_0xecc45f;return _0x39b072;})['then'](respondWithFilteredResult(_0x12ff49,_0x5607d4))[_0x6549('0x44')](handleError(_0x12ff49,null));};exports['show']=function(_0x2bda15,_0x3357d3){var _0x29162f={'raw':!![],'where':{'id':_0x2bda15[_0x6549('0x45')]['id']}},_0x25924f={};_0x25924f['model']=_[_0x6549('0x31')](db[_0x6549('0x2b')]['rawAttributes']);_0x25924f[_0x6549('0x30')]=_['keys'](_0x2bda15['query']);_0x25924f[_0x6549('0x3a')]=_[_0x6549('0x32')](_0x25924f[_0x6549('0x2e')],_0x25924f[_0x6549('0x30')]);_0x29162f['attributes']=_[_0x6549('0x32')](_0x25924f[_0x6549('0x2e')],qs[_0x6549('0x34')](_0x2bda15['query']['fields']));_0x29162f[_0x6549('0x33')]=_0x29162f[_0x6549('0x33')][_0x6549('0x35')]?_0x29162f['attributes']:_0x25924f[_0x6549('0x2e')];if(_0x2bda15[_0x6549('0x30')][_0x6549('0x41')]){_0x29162f[_0x6549('0x46')]=[{'all':!![]}];}_0x29162f=_[_0x6549('0x3e')]({},_0x29162f,_0x2bda15[_0x6549('0x40')]);return db['CmHopperBlack'][_0x6549('0x47')](_0x29162f)[_0x6549('0x25')](handleEntityNotFound(_0x3357d3,null))[_0x6549('0x25')](respondWithResult(_0x3357d3,null))[_0x6549('0x44')](handleError(_0x3357d3,null));};exports['update']=function(_0x58358a,_0x16e294){if(_0x58358a[_0x6549('0x48')]['id']){delete _0x58358a['body']['id'];}return db['CmHopperBlack'][_0x6549('0x47')]({'where':{'id':_0x58358a[_0x6549('0x45')]['id']}})['then'](handleEntityNotFound(_0x16e294,null))[_0x6549('0x25')](saveUpdates(_0x58358a[_0x6549('0x48')],null))[_0x6549('0x25')](respondWithResult(_0x16e294,null))[_0x6549('0x44')](handleError(_0x16e294,null));};exports[_0x6549('0x26')]=function(_0x56748c,_0x4c7516){return db[_0x6549('0x2b')][_0x6549('0x47')]({'where':{'id':_0x56748c[_0x6549('0x45')]['id']}})[_0x6549('0x25')](handleEntityNotFound(_0x4c7516,null))[_0x6549('0x25')](removeEntity(_0x4c7516,null))[_0x6549('0x44')](handleError(_0x4c7516,null));};exports[_0x6549('0x49')]=function(_0x4e192c,_0x2a7f5d){return db['CmHopperBlack'][_0x6549('0x49')]()['then'](respondWithResult(_0x2a7f5d,null))[_0x6549('0x44')](handleError(_0x2a7f5d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 0b28f43..3027450 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 _0x0a93=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','lodash','../../config/logger','api'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x0a93,0x13c));var _0x30a9=function(_0x750b84,_0x2d911e){_0x750b84=_0x750b84-0x0;var _0x32c81a=_0x0a93[_0x750b84];return _0x32c81a;};'use strict';var _=require(_0x30a9('0x0'));var util=require('util');var logger=require(_0x30a9('0x1'))(_0x30a9('0x2'));var moment=require(_0x30a9('0x3'));var BPromise=require(_0x30a9('0x4'));var rp=require(_0x30a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30a9('0x6'));var config=require(_0x30a9('0x7'));var attributes=require(_0x30a9('0x8'));module[_0x30a9('0x9')]=function(_0x1242fe,_0x4dc230){return _0x1242fe['define'](_0x30a9('0xa'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd93b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cmHopperBlack.attributes','exports','define','cm_hopper_black'];(function(_0x1fd613,_0x175c9b){var _0x518d26=function(_0x3b9ba1){while(--_0x3b9ba1){_0x1fd613['push'](_0x1fd613['shift']());}};_0x518d26(++_0x175c9b);}(_0xd93b,0xc0));var _0xbd93=function(_0x634cd,_0x5b70ba){_0x634cd=_0x634cd-0x0;var _0x1d0f39=_0xd93b[_0x634cd];return _0x1d0f39;};'use strict';var _=require(_0xbd93('0x0'));var util=require(_0xbd93('0x1'));var logger=require(_0xbd93('0x2'))(_0xbd93('0x3'));var moment=require(_0xbd93('0x4'));var BPromise=require(_0xbd93('0x5'));var rp=require(_0xbd93('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd93('0x7'));var config=require('../../config/environment');var attributes=require(_0xbd93('0x8'));module[_0xbd93('0x9')]=function(_0x167636,_0x2c032a){return _0x167636[_0xbd93('0xa')]('CmHopperBlack',attributes,{'tableName':_0xbd93('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 f189dad..1f1e7ab 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 _0xa62e=['include','map','model','then','stringify','UpdateCmHopperBlack','update','where','DestroyCmHopperBlack','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa62e,0x121));var _0xea62=function(_0x275d58,_0x29e6d6){_0x275d58=_0x275d58-0x0;var _0x2f7839=_0xa62e[_0x275d58];return _0x2f7839;};'use strict';var _=require(_0xea62('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xea62('0x1'));var rs=require(_0xea62('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xea62('0x3'));var logger=require(_0xea62('0x4'))(_0xea62('0x5'));var config=require(_0xea62('0x6'));var jayson=require(_0xea62('0x7'));var client=jayson['client'][_0xea62('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x511ad6,_0x524ed4,_0x4439ef){return new BPromise(function(_0x6357f2,_0x26429a){return client[_0xea62('0x9')](_0x511ad6,_0x4439ef)['then'](function(_0x596bb1){logger[_0xea62('0xa')](_0xea62('0xb'),_0x524ed4,_0xea62('0xc'));logger[_0xea62('0xd')](_0xea62('0xe'),_0x524ed4,'request\x20sent',JSON['stringify'](_0x596bb1));if(_0x596bb1[_0xea62('0xf')]){if(_0x596bb1['error'][_0xea62('0x10')]===0x1f4){logger['error'](_0xea62('0xb'),_0x524ed4,_0x596bb1[_0xea62('0xf')][_0xea62('0x11')]);return _0x26429a(_0x596bb1[_0xea62('0xf')][_0xea62('0x11')]);}logger['error'](_0xea62('0xb'),_0x524ed4,_0x596bb1[_0xea62('0xf')]['message']);return _0x6357f2(_0x596bb1['error'][_0xea62('0x11')]);}else{logger[_0xea62('0xa')](_0xea62('0xb'),_0x524ed4,_0xea62('0xc'));_0x6357f2(_0x596bb1[_0xea62('0x12')][_0xea62('0x11')]);}})[_0xea62('0x13')](function(_0x449941){logger['error'](_0xea62('0xb'),_0x524ed4,_0x449941);_0x26429a(_0x449941);});});}exports[_0xea62('0x14')]=function(_0x44111b){var _0x1f3753=this;return new Promise(function(_0x6ae8cb,_0x407f74){return db[_0xea62('0x15')][_0xea62('0x16')]({'raw':_0x44111b[_0xea62('0x17')]?_0x44111b['options'][_0xea62('0x18')]===undefined?!![]:![]:!![],'where':_0x44111b[_0xea62('0x17')]?_0x44111b[_0xea62('0x17')]['where']||null:null,'attributes':_0x44111b['options']?_0x44111b[_0xea62('0x17')][_0xea62('0x19')]||null:null,'limit':_0x44111b[_0xea62('0x17')]?_0x44111b[_0xea62('0x17')]['limit']||null:null,'include':_0x44111b[_0xea62('0x17')]?_0x44111b[_0xea62('0x17')][_0xea62('0x1a')]?_[_0xea62('0x1b')](_0x44111b[_0xea62('0x17')][_0xea62('0x1a')],function(_0x4c0151){return{'model':db[_0x4c0151['model']],'as':_0x4c0151['as'],'attributes':_0x4c0151[_0xea62('0x19')],'include':_0x4c0151[_0xea62('0x1a')]?_[_0xea62('0x1b')](_0x4c0151[_0xea62('0x1a')],function(_0x171eb4){return{'model':db[_0x171eb4[_0xea62('0x1c')]],'as':_0x171eb4['as'],'attributes':_0x171eb4[_0xea62('0x19')],'include':_0x171eb4['include']?_[_0xea62('0x1b')](_0x171eb4['include'],function(_0x1304e4){return{'model':db[_0x1304e4[_0xea62('0x1c')]],'as':_0x1304e4['as'],'attributes':_0x1304e4[_0xea62('0x19')]};}):[]};}):[]};}):[]:[]})[_0xea62('0x1d')](function(_0x33813e){logger[_0xea62('0xa')](_0xea62('0x14'),_0x44111b);logger[_0xea62('0xd')](_0xea62('0x14'),_0x44111b,JSON[_0xea62('0x1e')](_0x33813e));_0x6ae8cb(_0x33813e);})[_0xea62('0x13')](function(_0x58eedd){logger[_0xea62('0xf')](_0xea62('0x14'),_0x58eedd[_0xea62('0x11')],_0x44111b);_0x407f74(_0x1f3753[_0xea62('0xf')](0x1f4,_0x58eedd[_0xea62('0x11')]));});});};exports[_0xea62('0x1f')]=function(_0x123a2){var _0x25e86b=this;return new Promise(function(_0x13a05e,_0x19349e){return db[_0xea62('0x15')][_0xea62('0x20')](_0x123a2['body'],{'raw':_0x123a2[_0xea62('0x17')]?_0x123a2[_0xea62('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x123a2[_0xea62('0x17')]?_0x123a2[_0xea62('0x17')][_0xea62('0x21')]||null:null,'attributes':_0x123a2['options']?_0x123a2[_0xea62('0x17')][_0xea62('0x19')]||null:null,'limit':_0x123a2[_0xea62('0x17')]?_0x123a2[_0xea62('0x17')]['limit']||null:null})[_0xea62('0x1d')](function(_0x3e694e){logger[_0xea62('0xa')](_0xea62('0x1f'),_0x123a2);logger[_0xea62('0xd')](_0xea62('0x1f'),_0x123a2,JSON[_0xea62('0x1e')](_0x3e694e));_0x13a05e(_0x3e694e);})[_0xea62('0x13')](function(_0x19e218){logger['error'](_0xea62('0x1f'),_0x19e218[_0xea62('0x11')],_0x123a2);_0x19349e(_0x25e86b[_0xea62('0xf')](0x1f4,_0x19e218[_0xea62('0x11')]));});});};exports[_0xea62('0x22')]=function(_0x301f6a){var _0x2ab765=this;return new Promise(function(_0x464d66,_0x4bcb25){return db[_0xea62('0x15')]['destroy']({'where':_0x301f6a[_0xea62('0x17')]?_0x301f6a['options'][_0xea62('0x21')]||null:null})[_0xea62('0x1d')](function(_0x4c0a98){logger['info'](_0xea62('0x22'),_0x301f6a);logger[_0xea62('0xd')](_0xea62('0x22'),_0x301f6a,JSON[_0xea62('0x1e')](_0x4c0a98));_0x464d66(_0x4c0a98);})[_0xea62('0x13')](function(_0x2a42c6){logger[_0xea62('0xf')](_0xea62('0x22'),_0x2a42c6['message'],_0x301f6a);_0x4bcb25(_0x2ab765['error'](0x1f4,_0x2a42c6[_0xea62('0x11')]));});});}; \ No newline at end of file +var _0xb100=['UpdateCmHopperBlack','update','body','destroy','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperBlack','findAll','options','raw','where','attributes','limit','map','include','model','GetCmHopperBlack'];(function(_0x4a6eee,_0x48dace){var _0x35e1be=function(_0x49b8a0){while(--_0x49b8a0){_0x4a6eee['push'](_0x4a6eee['shift']());}};_0x35e1be(++_0x48dace);}(_0xb100,0x11c));var _0x0b10=function(_0xa5c63f,_0x2aaaa8){_0xa5c63f=_0xa5c63f-0x0;var _0xf352b1=_0xb100[_0xa5c63f];return _0xf352b1;};'use strict';var _=require('lodash');var util=require(_0x0b10('0x0'));var moment=require(_0x0b10('0x1'));var BPromise=require(_0x0b10('0x2'));var rs=require(_0x0b10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b10('0x4'))['db'];var utils=require(_0x0b10('0x5'));var logger=require(_0x0b10('0x6'))(_0x0b10('0x7'));var config=require(_0x0b10('0x8'));var jayson=require(_0x0b10('0x9'));var client=jayson[_0x0b10('0xa')][_0x0b10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ff3b5,_0x139a78,_0x503e48){return new BPromise(function(_0x3c382c,_0x33d75a){return client[_0x0b10('0xc')](_0x4ff3b5,_0x503e48)[_0x0b10('0xd')](function(_0x37aab9){logger[_0x0b10('0xe')](_0x0b10('0xf'),_0x139a78,_0x0b10('0x10'));logger[_0x0b10('0x11')](_0x0b10('0x12'),_0x139a78,'request\x20sent',JSON[_0x0b10('0x13')](_0x37aab9));if(_0x37aab9[_0x0b10('0x14')]){if(_0x37aab9[_0x0b10('0x14')][_0x0b10('0x15')]===0x1f4){logger[_0x0b10('0x14')](_0x0b10('0xf'),_0x139a78,_0x37aab9[_0x0b10('0x14')]['message']);return _0x33d75a(_0x37aab9['error'][_0x0b10('0x16')]);}logger[_0x0b10('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x139a78,_0x37aab9['error'][_0x0b10('0x16')]);return _0x3c382c(_0x37aab9['error'][_0x0b10('0x16')]);}else{logger[_0x0b10('0xe')](_0x0b10('0xf'),_0x139a78,'request\x20sent');_0x3c382c(_0x37aab9[_0x0b10('0x17')][_0x0b10('0x16')]);}})[_0x0b10('0x18')](function(_0x4d1465){logger[_0x0b10('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x139a78,_0x4d1465);_0x33d75a(_0x4d1465);});});}exports['GetCmHopperBlack']=function(_0x4e67a4){var _0x1e78eb=this;return new Promise(function(_0x4b6981,_0x2e706b){return db[_0x0b10('0x19')][_0x0b10('0x1a')]({'raw':_0x4e67a4[_0x0b10('0x1b')]?_0x4e67a4['options'][_0x0b10('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e67a4['options']?_0x4e67a4[_0x0b10('0x1b')][_0x0b10('0x1d')]||null:null,'attributes':_0x4e67a4[_0x0b10('0x1b')]?_0x4e67a4[_0x0b10('0x1b')][_0x0b10('0x1e')]||null:null,'limit':_0x4e67a4[_0x0b10('0x1b')]?_0x4e67a4[_0x0b10('0x1b')][_0x0b10('0x1f')]||null:null,'include':_0x4e67a4[_0x0b10('0x1b')]?_0x4e67a4[_0x0b10('0x1b')]['include']?_[_0x0b10('0x20')](_0x4e67a4[_0x0b10('0x1b')][_0x0b10('0x21')],function(_0x583127){return{'model':db[_0x583127[_0x0b10('0x22')]],'as':_0x583127['as'],'attributes':_0x583127['attributes'],'include':_0x583127[_0x0b10('0x21')]?_['map'](_0x583127['include'],function(_0x444f50){return{'model':db[_0x444f50[_0x0b10('0x22')]],'as':_0x444f50['as'],'attributes':_0x444f50['attributes'],'include':_0x444f50[_0x0b10('0x21')]?_[_0x0b10('0x20')](_0x444f50['include'],function(_0xfc5800){return{'model':db[_0xfc5800['model']],'as':_0xfc5800['as'],'attributes':_0xfc5800['attributes']};}):[]};}):[]};}):[]:[]})[_0x0b10('0xd')](function(_0x3286cc){logger['info'](_0x0b10('0x23'),_0x4e67a4);logger[_0x0b10('0x11')]('GetCmHopperBlack',_0x4e67a4,JSON[_0x0b10('0x13')](_0x3286cc));_0x4b6981(_0x3286cc);})[_0x0b10('0x18')](function(_0x3d7b12){logger['error']('GetCmHopperBlack',_0x3d7b12[_0x0b10('0x16')],_0x4e67a4);_0x2e706b(_0x1e78eb['error'](0x1f4,_0x3d7b12['message']));});});};exports[_0x0b10('0x24')]=function(_0x147f0c){var _0x564473=this;return new Promise(function(_0x7be1d2,_0x35a04a){return db['CmHopperBlack'][_0x0b10('0x25')](_0x147f0c[_0x0b10('0x26')],{'raw':_0x147f0c[_0x0b10('0x1b')]?_0x147f0c[_0x0b10('0x1b')][_0x0b10('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x147f0c['options']?_0x147f0c[_0x0b10('0x1b')]['where']||null:null,'attributes':_0x147f0c['options']?_0x147f0c[_0x0b10('0x1b')][_0x0b10('0x1e')]||null:null,'limit':_0x147f0c[_0x0b10('0x1b')]?_0x147f0c[_0x0b10('0x1b')]['limit']||null:null})[_0x0b10('0xd')](function(_0xf989d2){logger[_0x0b10('0xe')]('UpdateCmHopperBlack',_0x147f0c);logger['debug']('UpdateCmHopperBlack',_0x147f0c,JSON[_0x0b10('0x13')](_0xf989d2));_0x7be1d2(_0xf989d2);})[_0x0b10('0x18')](function(_0x295151){logger[_0x0b10('0x14')]('UpdateCmHopperBlack',_0x295151['message'],_0x147f0c);_0x35a04a(_0x564473[_0x0b10('0x14')](0x1f4,_0x295151[_0x0b10('0x16')]));});});};exports['DestroyCmHopperBlack']=function(_0x4ff44d){var _0x853c24=this;return new Promise(function(_0x26837f,_0x1d92ce){return db[_0x0b10('0x19')][_0x0b10('0x27')]({'where':_0x4ff44d[_0x0b10('0x1b')]?_0x4ff44d['options'][_0x0b10('0x1d')]||null:null})['then'](function(_0x925f6b){logger[_0x0b10('0xe')]('DestroyCmHopperBlack',_0x4ff44d);logger['debug']('DestroyCmHopperBlack',_0x4ff44d,JSON[_0x0b10('0x13')](_0x925f6b));_0x26837f(_0x925f6b);})['catch'](function(_0x17984c){logger[_0x0b10('0x14')]('DestroyCmHopperBlack',_0x17984c[_0x0b10('0x16')],_0x4ff44d);_0x1d92ce(_0x853c24[_0x0b10('0x14')](0x1f4,_0x17984c[_0x0b10('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index c2b4c4f..4938ed0 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 _0x01d9=['update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var fs_extra=require(_0x901d('0x5'));var auth=require(_0x901d('0x6'));var interaction=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var controller=require(_0x901d('0x9'));router[_0x901d('0xa')]('/',auth['isAuthenticated'](),controller[_0x901d('0xb')]);router[_0x901d('0xa')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0xe')]);router[_0x901d('0xa')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x12')]);router['delete'](_0x901d('0xf'),auth['isAuthenticated'](),controller[_0x901d('0x13')]);module[_0x901d('0x14')]=router; \ No newline at end of file +var _0x8f9d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','/:id','show','update','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8f9d,0x93));var _0xd8f9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f9d[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require('util');var path=require(_0xd8f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f9('0x2'));var router=express[_0xd8f9('0x3')]();var fs_extra=require(_0xd8f9('0x4'));var auth=require(_0xd8f9('0x5'));var interaction=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var controller=require(_0xd8f9('0x8'));router['get']('/',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xa')]);router[_0xd8f9('0xb')](_0xd8f9('0xc'),auth[_0xd8f9('0x9')](),controller['describe']);router[_0xd8f9('0xb')](_0xd8f9('0xd'),auth['isAuthenticated'](),controller[_0xd8f9('0xe')]);router['put']('/:id',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xf')]);router[_0xd8f9('0x10')](_0xd8f9('0xd'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x11')]);module[_0xd8f9('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 63e067d..b49bd51 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 _0x8d4c=['exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize'];(function(_0x3526ff,_0x4f7853){var _0x5c716c=function(_0x90676e){while(--_0x90676e){_0x3526ff['push'](_0x3526ff['shift']());}};_0x5c716c(++_0x4f7853);}(_0x8d4c,0x173));var _0xc8d4=function(_0x61bb05,_0x47421f){_0x61bb05=_0x61bb05-0x0;var _0x3ceb3e=_0x8d4c[_0x61bb05];return _0x3ceb3e;};'use strict';var Sequelize=require(_0xc8d4('0x0'));var moment=require('moment');module[_0xc8d4('0x1')]={'state':{'type':Sequelize[_0xc8d4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc8d4('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xc8d4('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc8d4('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc8d4('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc8d4('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc8d4('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xc8d4('0x3')]},'originatecalleridname':{'type':Sequelize[_0xc8d4('0x3')]},'calleridnum':{'type':Sequelize[_0xc8d4('0x3')]},'calleridname':{'type':Sequelize[_0xc8d4('0x3')]},'starttime':{'type':Sequelize[_0xc8d4('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xc8d4('0x4')]},'droptime':{'type':Sequelize[_0xc8d4('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xc8d4('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc8d4('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc8d4('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc8d4('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc8d4('0x3')]},'campaign':{'type':Sequelize[_0xc8d4('0x3')]},'campaigntype':{'type':Sequelize[_0xc8d4('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xc8d4('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc8d4('0x3')]},'dispositionat':{'type':Sequelize[_0xc8d4('0x4')],'set':function(_0x3c871b){var _0xcb18c0=this[_0xc8d4('0x5')]('endtime');if(_0xcb18c0&&_0x3c871b){this[_0xc8d4('0x6')](_0xc8d4('0x7'),moment(_0x3c871b)[_0xc8d4('0x8')](moment(_0xcb18c0),_0xc8d4('0x9')));}return this['setDataValue'](_0xc8d4('0xa'),_0x3c871b);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xc8d4('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xc8d4('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xc8d4('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xc8d4('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc8d4('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc8d4('0x4')]},'deleted':{'type':Sequelize[_0xc8d4('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xc8d4('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc8d4('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc8d4('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc8d4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x298a=['followuptime','diff','seconds','BOOLEAN','INTEGER','STRING','DATE','getDataValue','setDataValue'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x298a,0xdc));var _0xa298=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x298a[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0xa298('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xa298('0x1')]},'scheduledat':{'type':Sequelize[_0xa298('0x2')]},'countbusyretry':{'type':Sequelize[_0xa298('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa298('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa298('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa298('0x1')]},'originatecalleridnum':{'type':Sequelize[_0xa298('0x1')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa298('0x1')]},'calleridname':{'type':Sequelize[_0xa298('0x1')]},'starttime':{'type':Sequelize[_0xa298('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xa298('0x2')]},'droptime':{'type':Sequelize[_0xa298('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa298('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa298('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa298('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa298('0x1')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xa298('0x1')]},'membername':{'type':Sequelize[_0xa298('0x1')]},'reason':{'type':Sequelize[_0xa298('0x1')]},'disposition':{'type':Sequelize[_0xa298('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xa298('0x1')]},'dispositionat':{'type':Sequelize[_0xa298('0x2')],'set':function(_0xbfe764){var _0x3ab9a3=this[_0xa298('0x3')]('endtime');if(_0x3ab9a3&&_0xbfe764){this[_0xa298('0x4')](_0xa298('0x5'),moment(_0xbfe764)[_0xa298('0x6')](moment(_0x3ab9a3),_0xa298('0x7')));}return this['setDataValue']('dispositionat',_0xbfe764);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xa298('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xa298('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xa298('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa298('0x2')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xa298('0x1')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xa298('0x2')]},'recallme':{'type':Sequelize[_0xa298('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xa298('0x2')]},'countnosuchnumberretry':{'type':Sequelize[_0xa298('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa298('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa298('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa298('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa298('0x0')],'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 3c082aa..e706d9f 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 _0x687b=['filter','VIRTUAL','options','include','findAll','rows','show','length','includeAll','merge','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper_final','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0x687b,0x14a));var _0xb687=function(_0x4a9d87,_0x2cc20f){_0x4a9d87=_0x4a9d87-0x0;var _0x1ad978=_0x687b[_0x4a9d87];return _0x1ad978;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':!![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['CmHopperFinal'][_0xb687('0x4b')]()[_0xb687('0x26')](respondWithResult(_0x4f3069,null))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports[_0xb687('0x25')]=function(_0x535c00,_0x33a0b0){if(_0x535c00[_0xb687('0x4c')][_0xb687('0x4d')]){delete _0x535c00[_0xb687('0x4c')]['uniqueid'];}return db['CmHopperFinal'][_0xb687('0x49')]({'where':{'uniqueid':_0x535c00[_0xb687('0x4e')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33a0b0,null))['then'](saveUpdates(_0x535c00['body'],null))[_0xb687('0x26')](respondWithResult(_0x33a0b0,null))[_0xb687('0x4a')](handleError(_0x33a0b0,null));};exports[_0xb687('0x4f')]=function(_0x22e618,_0x34205d,_0x1fb31a){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x22e618['params']['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb687('0x59')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x5a')))),_0xb687('0x5b')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x34205d,null))['then'](respondWithResult(_0x34205d,null))['catch'](handleError(_0x34205d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5d266c,_0x1cc507,_0x1db4ca){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'CampaignId':_0x5d266c[_0xb687('0x4e')]['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5d')))),'noSuchContacts'],[db['sequelize']['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x5e')))),_0xb687('0x59')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5a')))),_0xb687('0x5b')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5f')))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x1cc507,null))[_0xb687('0x26')](respondWithResult(_0x1cc507,null))['catch'](handleError(_0x1cc507,null));};exports[_0xb687('0x60')]=function(_0x5449c4,_0x2c2add,_0x431cc5){return db['VoiceQueue'][_0xb687('0x49')]({'where':{'id':_0x5449c4[_0xb687('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c2add,null))[_0xb687('0x26')](function(_0x1736ef){var _0x52285e;if(_0x1736ef){_0x52285e=squel['insert']()[_0xb687('0x61')]('cm_hopper')[_0xb687('0x62')]([_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65'),_0xb687('0x66'),_0xb687('0x67'),_0xb687('0x68'),_0xb687('0x69')],squel['select']()[_0xb687('0x6a')](_0xb687('0x6b'),_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))['field'](_0xb687('0x6d'),_0xb687('0x65'))['field'](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')](_0xb687('0x6f'),'VoiceQueueId')[_0xb687('0x6a')]('NOW()','createdAt')[_0xb687('0x6a')]('NOW()','updatedAt')[_0xb687('0x70')]('cm_hopper_final')[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4['params']['id'][_0xb687('0x72')]())[_0xb687('0x3e')]('state\x20=\x20?',_0x5449c4[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x63'))[_0xb687('0x70')]('cm_hopper')[_0xb687('0x3e')]('VoiceQueueId\x20=\x20?',_0x5449c4['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')]('calleridnum')['from'](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4[_0xb687('0x4e')]['id']['toString']())[_0xb687('0x3e')](_0xb687('0x78')))[_0xb687('0x79')](_0xb687('0x65')))[_0xb687('0x72')]();return db[_0xb687('0x50')][_0xb687('0x34')](_0x52285e);}return[];})[_0xb687('0x26')](respondWithResult(_0x2c2add,null))[_0xb687('0x4a')](handleError(_0x2c2add,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x25f5c3,_0x33d1fc,_0x207953){return db[_0xb687('0x7a')][_0xb687('0x49')]({'where':{'id':_0x25f5c3['params']['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33d1fc,null))[_0xb687('0x26')](function(_0x48bbee){var _0x19ac6d;if(_0x48bbee){_0x19ac6d=squel['insert']()[_0xb687('0x61')](_0xb687('0x7b'))['fromQuery']([_0xb687('0x63'),_0xb687('0x64'),'ContactId',_0xb687('0x66'),_0xb687('0x7c'),_0xb687('0x68'),_0xb687('0x69')],squel[_0xb687('0x76')]()[_0xb687('0x6a')]('ANY_VALUE(calleridnum)',_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))[_0xb687('0x6a')](_0xb687('0x6d'),_0xb687('0x65'))[_0xb687('0x6a')](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')]('ANY_VALUE(CampaignId)',_0xb687('0x7c'))['field'](_0xb687('0x6c'),_0xb687('0x68'))['field']('NOW()',_0xb687('0x69'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x7e'),_0x25f5c3[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel['select']()['field'](_0xb687('0x63'))['from']('cm_hopper')[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x7f'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())['where'](_0xb687('0x78')))[_0xb687('0x79')]('ContactId'))[_0xb687('0x72')]();return db['sequelize'][_0xb687('0x34')](_0x19ac6d);}return[];})[_0xb687('0x26')](respondWithResult(_0x33d1fc,null))['catch'](handleError(_0x33d1fc,null));};exports[_0xb687('0x80')]=function(_0x20e46a,_0x1c389f,_0x45d0ab){return db[_0xb687('0x81')][_0xb687('0x82')]({'where':{'VoiceQueueId':_0x20e46a[_0xb687('0x4c')]['VoiceQueueId'],'CampaignId':_0x20e46a['body'][_0xb687('0x7c')],'ContactId':_0x20e46a['body'][_0xb687('0x65')]}})[_0xb687('0x26')](handleEntityNotFound(_0x1c389f,null))[_0xb687('0x26')](function(_0x312529){if(_0x312529){return _0x312529;}return null;})['then'](respondWithResult(_0x1c389f,null))[_0xb687('0x4a')](handleError(_0x1c389f,null));}; \ No newline at end of file +var _0xc2c7=['`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','group','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','calleridnum','state\x20=\x204','checkContactHopper','CmHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','uniqueid','params','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal'];(function(_0x1fdfad,_0x87dffe){var _0x22ee3f=function(_0x16cb9f){while(--_0x16cb9f){_0x1fdfad['push'](_0x1fdfad['shift']());}};_0x22ee3f(++_0x87dffe);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4d1540,_0x47b7b4){_0x4d1540=_0x4d1540-0x0;var _0x242075=_0xc2c7[_0x4d1540];return _0x242075;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['CmHopperFinal'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['describe']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['describe']()['then'](respondWithResult(_0x3091bd,null))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x39d5af,_0x2b79d5){if(_0x39d5af['body']['uniqueid']){delete _0x39d5af['body'][_0x7c2c('0x48')];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'uniqueid':_0x39d5af[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x2b79d5,null))['then'](saveUpdates(_0x39d5af[_0x7c2c('0x4a')],null))[_0x7c2c('0x26')](respondWithResult(_0x2b79d5,null))['catch'](handleError(_0x2b79d5,null));};exports[_0x7c2c('0x4b')]=function(_0x56e09d,_0xfba6a7,_0x3806f4){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x56e09d['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x4d')))),_0x7c2c('0x4e')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')]('`state`\x20=\x205,\x201,\x20null'))),_0x7c2c('0x53')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x54')))),'congestionContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x58')))),_0x7c2c('0x59')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x7c2c('0x26')](handleEntityNotFound(_0xfba6a7,null))[_0x7c2c('0x26')](respondWithResult(_0xfba6a7,null))[_0x7c2c('0x45')](handleError(_0xfba6a7,null));};exports[_0x7c2c('0x5a')]=function(_0x44602a,_0x1ad537,_0x2d04da){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'CampaignId':_0x44602a['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x7c2c('0x4e')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x5b')))),'busyContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x7c2c('0x54')))),_0x7c2c('0x5c')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5d')))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x58')))),'reCallContacts'],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5e')))),_0x7c2c('0x5f')]]})['then'](handleEntityNotFound(_0x1ad537,null))[_0x7c2c('0x26')](respondWithResult(_0x1ad537,null))['catch'](handleError(_0x1ad537,null));};exports[_0x7c2c('0x60')]=function(_0x2b597d,_0x20eb63,_0x56f737){return db[_0x7c2c('0x61')][_0x7c2c('0x47')]({'where':{'id':_0x2b597d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x20eb63,null))['then'](function(_0x158352){var _0x1e711e;if(_0x158352){_0x1e711e=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')](_0x7c2c('0x64'))[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),'ListId',_0x7c2c('0x69'),_0x7c2c('0x6a'),'updatedAt'],squel[_0x7c2c('0x6b')]()['field']('ANY_VALUE(calleridnum)',_0x7c2c('0x66'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),'scheduledAt')[_0x7c2c('0x6c')](_0x7c2c('0x6e'),_0x7c2c('0x68'))['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')](_0x7c2c('0x71'),'VoiceQueueId')[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),_0x7c2c('0x72'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2b597d[_0x7c2c('0x4a')][_0x7c2c('0x77')][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x66'))[_0x7c2c('0x73')](_0x7c2c('0x64'))['where'](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel['select']()[_0x7c2c('0x6c')]('calleridnum')[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')]('state\x20=\x204'))[_0x7c2c('0x7b')](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x1e711e);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x20eb63,null))[_0x7c2c('0x45')](handleError(_0x20eb63,null));};exports[_0x7c2c('0x7c')]=function(_0x2f249d,_0x136226,_0x354236){return db[_0x7c2c('0x7d')][_0x7c2c('0x47')]({'where':{'id':_0x2f249d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x136226,null))[_0x7c2c('0x26')](function(_0xb47bf0){var _0x4d0922;if(_0xb47bf0){_0x4d0922=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')]('cm_hopper')[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),_0x7c2c('0x70'),'CampaignId',_0x7c2c('0x6a'),_0x7c2c('0x72')],squel[_0x7c2c('0x6b')]()['field'](_0x7c2c('0x7e'),_0x7c2c('0x66'))[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x67'))['field'](_0x7c2c('0x6e'),'ContactId')['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')]('ANY_VALUE(CampaignId)',_0x7c2c('0x7f'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),'updatedAt')['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2f249d[_0x7c2c('0x4a')]['state'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()['field']('phone')[_0x7c2c('0x73')](_0x7c2c('0x64'))[_0x7c2c('0x3d')](_0x7c2c('0x80'),_0x2f249d['params']['id'][_0x7c2c('0x78')]()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x81'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')]('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())['where'](_0x7c2c('0x82')))['group'](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x4d0922);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x136226,null))[_0x7c2c('0x45')](handleError(_0x136226,null));};exports[_0x7c2c('0x83')]=function(_0x309051,_0x3f8683,_0x1eeb00){return db[_0x7c2c('0x84')]['findOne']({'where':{'VoiceQueueId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x69')],'CampaignId':_0x309051[_0x7c2c('0x4a')]['CampaignId'],'ContactId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x68')]}})['then'](handleEntityNotFound(_0x3f8683,null))[_0x7c2c('0x26')](function(_0x511158){if(_0x511158){return _0x511158;}return null;})[_0x7c2c('0x26')](respondWithResult(_0x3f8683,null))['catch'](handleError(_0x3f8683,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 346e051..3a98d8c 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 _0x7b59=['uniqueid','api','moment','request-promise','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x55d9d4,_0x5b8ccd){var _0x311a86=function(_0x6020f3){while(--_0x6020f3){_0x55d9d4['push'](_0x55d9d4['shift']());}};_0x311a86(++_0x5b8ccd);}(_0x7b59,0x1b9));var _0x97b5=function(_0x46028b,_0x4ce5ba){_0x46028b=_0x46028b-0x0;var _0x28a5e2=_0x7b59[_0x46028b];return _0x28a5e2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x97b5('0x0'));var moment=require(_0x97b5('0x1'));var BPromise=require('bluebird');var rp=require(_0x97b5('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x97b5('0x3'));var attributes=require(_0x97b5('0x4'));module[_0x97b5('0x5')]=function(_0x5626bf,_0x1bc13a){return _0x5626bf[_0x97b5('0x6')](_0x97b5('0x7'),attributes,{'tableName':_0x97b5('0x8'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x97b5('0x9')]},{'name':_0x97b5('0xa'),'fields':[_0x97b5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x808d=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x5df6e5,_0x23b178){var _0x540bb7=function(_0xe37e71){while(--_0xe37e71){_0x5df6e5['push'](_0x5df6e5['shift']());}};_0x540bb7(++_0x23b178);}(_0x808d,0x15b));var _0xd808=function(_0x5be219,_0x7d9187){_0x5be219=_0x5be219-0x0;var _0x27d804=_0x808d[_0x5be219];return _0x27d804;};'use strict';var _=require(_0xd808('0x0'));var util=require(_0xd808('0x1'));var logger=require(_0xd808('0x2'))(_0xd808('0x3'));var moment=require(_0xd808('0x4'));var BPromise=require(_0xd808('0x5'));var rp=require(_0xd808('0x6'));var fs=require('fs');var path=require(_0xd808('0x7'));var rimraf=require(_0xd808('0x8'));var config=require(_0xd808('0x9'));var attributes=require(_0xd808('0xa'));module[_0xd808('0xb')]=function(_0x189f78,_0x271243){return _0x189f78[_0xd808('0xc')]('CmHopperFinal',attributes,{'tableName':_0xd808('0xd'),'paranoid':![],'indexes':[{'name':_0xd808('0xe'),'fields':['calleridnum']},{'name':_0xd808('0xf'),'fields':[_0xd808('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 038b76c..1f5b20f 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(_0x202d20,_0x56a866){var _0x3daa95=function(_0x5a9b53){while(--_0x5a9b53){_0x202d20['push'](_0x202d20['shift']());}};_0x3daa95(++_0x56a866);}(_0x7a54,0x106));var _0x47a5=function(_0x5df17a,_0x18bebf){_0x5df17a=_0x5df17a-0x0;var _0x26bdb6=_0x7a54[_0x5df17a];return _0x26bdb6;};'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 _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(_0x3cb550,_0x3d940e){var _0x3909e1=function(_0x50dbf3){while(--_0x50dbf3){_0x3cb550['push'](_0x3cb550['shift']());}};_0x3909e1(++_0x3d940e);}(_0x7a54,0x106));var _0x47a5=function(_0x55d403,_0x1a8090){_0x55d403=_0x55d403-0x0;var _0x5647be=_0x7a54[_0x55d403];return _0x5647be;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index fdaa537..a341702 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 _0xb53b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','Router','fs-extra'];(function(_0x454e48,_0x13ba74){var _0x3c2597=function(_0x35881e){while(--_0x35881e){_0x454e48['push'](_0x454e48['shift']());}};_0x3c2597(++_0x13ba74);}(_0xb53b,0xd6));var _0xbb53=function(_0x286726,_0x20a337){_0x286726=_0x286726-0x0;var _0xcd4fe9=_0xb53b[_0x286726];return _0xcd4fe9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbb53('0x0')]();var fs_extra=require(_0xbb53('0x1'));var auth=require(_0xbb53('0x2'));var interaction=require(_0xbb53('0x3'));var config=require(_0xbb53('0x4'));var controller=require(_0xbb53('0x5'));router[_0xbb53('0x6')]('/',auth['isAuthenticated'](),controller[_0xbb53('0x7')]);router[_0xbb53('0x6')](_0xbb53('0x8'),auth[_0xbb53('0x9')](),controller[_0xbb53('0xa')]);router[_0xbb53('0x6')](_0xbb53('0xb'),auth[_0xbb53('0x9')](),controller['show']);router[_0xbb53('0x6')](_0xbb53('0xc'),auth[_0xbb53('0x9')](),controller[_0xbb53('0xd')]);router[_0xbb53('0x6')](_0xbb53('0xe'),auth['isAuthenticated'](),controller[_0xbb53('0xf')]);router[_0xbb53('0x10')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0xbb53('0x11')]);router[_0xbb53('0x10')](_0xbb53('0x12'),auth['isAuthenticated'](),controller[_0xbb53('0x13')]);router[_0xbb53('0x10')]('/checkContactHopper',auth[_0xbb53('0x9')](),controller[_0xbb53('0x14')]);router[_0xbb53('0x15')](_0xbb53('0xb'),auth[_0xbb53('0x9')](),controller[_0xbb53('0x16')]);module[_0xbb53('0x17')]=router; \ No newline at end of file +var _0x7dbc=['index','get','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','/checkContactHopper','put','/:id','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated'];(function(_0x5b3204,_0x59e159){var _0x1db520=function(_0x16373f){while(--_0x16373f){_0x5b3204['push'](_0x5b3204['shift']());}};_0x1db520(++_0x59e159);}(_0x7dbc,0xe0));var _0xc7db=function(_0x11f0f0,_0xb894d3){_0x11f0f0=_0x11f0f0-0x0;var _0x2ae215=_0x7dbc[_0x11f0f0];return _0x2ae215;};'use strict';var multer=require(_0xc7db('0x0'));var util=require(_0xc7db('0x1'));var path=require(_0xc7db('0x2'));var timeout=require('connect-timeout');var express=require(_0xc7db('0x3'));var router=express[_0xc7db('0x4')]();var fs_extra=require(_0xc7db('0x5'));var auth=require(_0xc7db('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc7db('0x7'));var controller=require(_0xc7db('0x8'));router['get']('/',auth[_0xc7db('0x9')](),controller[_0xc7db('0xa')]);router[_0xc7db('0xb')](_0xc7db('0xc'),auth[_0xc7db('0x9')](),controller[_0xc7db('0xd')]);router[_0xc7db('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xc7db('0xe')]);router['get'](_0xc7db('0xf'),auth[_0xc7db('0x9')](),controller[_0xc7db('0x10')]);router[_0xc7db('0xb')](_0xc7db('0x11'),auth[_0xc7db('0x9')](),controller[_0xc7db('0x12')]);router['post']('/voice/queue/moveContacts/:id',auth[_0xc7db('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xc7db('0x13')](_0xc7db('0x14'),auth[_0xc7db('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xc7db('0x13')](_0xc7db('0x15'),auth[_0xc7db('0x9')](),controller['checkContactHopper']);router[_0xc7db('0x16')](_0xc7db('0x17'),auth[_0xc7db('0x9')](),controller[_0xc7db('0x18')]);module[_0xc7db('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 0ddae51..0120740 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 _0xc7dd=['BOOLEAN','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xc7dd,0x15d));var _0xdc7d=function(_0x47a41f,_0x48d92b){_0x47a41f=_0x47a41f-0x0;var _0x2411f5=_0xc7dd[_0x47a41f];return _0x2411f5;};'use strict';var Sequelize=require(_0xdc7d('0x0'));module[_0xdc7d('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xdc7d('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdc7d('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdc7d('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdc7d('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xdc7d('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdc7d('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xdc7d('0x4')]},'answertime':{'type':Sequelize[_0xdc7d('0x4')]},'droptime':{'type':Sequelize[_0xdc7d('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xdc7d('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdc7d('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdc7d('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdc7d('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xdc7d('0x2')]},'membername':{'type':Sequelize[_0xdc7d('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xdc7d('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xdc7d('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdc7d('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdc7d('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xdc7d('0x4')]},'edited':{'type':Sequelize[_0xdc7d('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xdc7d('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdc7d('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdc7d('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdc7d('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6dc0=['STRING','BOOLEAN','sequelize','exports','INTEGER','DATE'];(function(_0x201e58,_0x4998b2){var _0x2d5709=function(_0x58765b){while(--_0x58765b){_0x201e58['push'](_0x201e58['shift']());}};_0x2d5709(++_0x4998b2);}(_0x6dc0,0xb6));var _0x06dc=function(_0x45e7e7,_0x10e163){_0x45e7e7=_0x45e7e7-0x0;var _0x5ed7e6=_0x6dc0[_0x45e7e7];return _0x5ed7e6;};'use strict';var Sequelize=require(_0x06dc('0x0'));module[_0x06dc('0x1')]={'state':{'type':Sequelize[_0x06dc('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x06dc('0x3')]},'countbusyretry':{'type':Sequelize[_0x06dc('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x06dc('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x06dc('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x06dc('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x06dc('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x06dc('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x06dc('0x3')]},'responsetime':{'type':Sequelize[_0x06dc('0x3')]},'answertime':{'type':Sequelize[_0x06dc('0x3')]},'droptime':{'type':Sequelize[_0x06dc('0x3')]},'endtime':{'type':Sequelize[_0x06dc('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x06dc('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x06dc('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x06dc('0x4')]},'membername':{'type':Sequelize[_0x06dc('0x4')]},'reason':{'type':Sequelize[_0x06dc('0x4')]},'amd':{'type':Sequelize[_0x06dc('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x06dc('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x06dc('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x06dc('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x06dc('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x06dc('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 4cb2db2..0960f90 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 _0x981c=['options','find','create','describe','update','uniqueid','body','params','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','error','stack','name','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','CmHopperHistory','includeAll','include','catch','show','keys'];(function(_0x3bf249,_0x4b08fc){var _0x5e1a12=function(_0x3bd569){while(--_0x3bd569){_0x3bf249['push'](_0x3bf249['shift']());}};_0x5e1a12(++_0x4b08fc);}(_0x981c,0x9a));var _0xc981=function(_0x2ee087,_0x12b145){_0x2ee087=_0x2ee087-0x0;var _0x20daa3=_0x981c[_0x2ee087];return _0x20daa3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc981('0x0'));var jsonpatch=require(_0xc981('0x1'));var rp=require('request-promise');var moment=require(_0xc981('0x2'));var BPromise=require(_0xc981('0x3'));var Mustache=require(_0xc981('0x4'));var util=require(_0xc981('0x5'));var path=require(_0xc981('0x6'));var sox=require(_0xc981('0x7'));var csv=require(_0xc981('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc981('0x9'));var _=require(_0xc981('0xa'));var squel=require('squel');var crypto=require(_0xc981('0xb'));var jsforce=require(_0xc981('0xc'));var deskjs=require(_0xc981('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc981('0xe'));var Redis=require('ioredis');var authService=require(_0xc981('0xf'));var qs=require(_0xc981('0x10'));var as=require(_0xc981('0x11'));var hardwareService=require(_0xc981('0x12'));var logger=require(_0xc981('0x13'))(_0xc981('0x14'));var utils=require(_0xc981('0x15'));var config=require(_0xc981('0x16'));var licenseUtil=require(_0xc981('0x17'));var db=require(_0xc981('0x18'))['db'];function respondWithStatusCode(_0x307a7c,_0x4428a8){_0x4428a8=_0x4428a8||0xcc;return function(_0x3574e9){if(_0x3574e9){return _0x307a7c[_0xc981('0x19')](_0x4428a8);}return _0x307a7c[_0xc981('0x1a')](_0x4428a8)[_0xc981('0x1b')]();};}function respondWithResult(_0x1d1dd9,_0x102f0c){_0x102f0c=_0x102f0c||0xc8;return function(_0x37af5f){if(_0x37af5f){return _0x1d1dd9[_0xc981('0x1a')](_0x102f0c)[_0xc981('0x1c')](_0x37af5f);}};}function respondWithFilteredResult(_0x4337fa,_0x2fc4d2){return function(_0x59bdc5){if(_0x59bdc5){var _0x4ce615=typeof _0x2fc4d2['offset']===_0xc981('0x1d')&&typeof _0x2fc4d2[_0xc981('0x1e')]==='undefined';var _0x1e5b4b=_0x59bdc5[_0xc981('0x1f')];var _0x4a06ad=_0x4ce615?0x0:_0x2fc4d2[_0xc981('0x20')];var _0x16be8d=_0x4ce615?_0x59bdc5[_0xc981('0x1f')]:_0x2fc4d2['offset']+_0x2fc4d2[_0xc981('0x1e')];var _0x3b8219;if(_0x16be8d>=_0x1e5b4b){_0x16be8d=_0x1e5b4b;_0x3b8219=0xc8;}else{_0x3b8219=0xce;}_0x4337fa[_0xc981('0x1a')](_0x3b8219);return _0x4337fa[_0xc981('0x21')]('Content-Range',_0x4a06ad+'-'+_0x16be8d+'/'+_0x1e5b4b)[_0xc981('0x1c')](_0x59bdc5);}return null;};}function patchUpdates(_0x429559){return function(_0x57c845){try{jsonpatch[_0xc981('0x22')](_0x57c845,_0x429559,!![]);}catch(_0x119659){return BPromise[_0xc981('0x23')](_0x119659);}return _0x57c845[_0xc981('0x24')]();};}function saveUpdates(_0x561689,_0x160d4c){return function(_0x2426df){if(_0x2426df){return _0x2426df['update'](_0x561689)['then'](function(_0x214db6){return _0x214db6;});}return null;};}function removeEntity(_0x1036c3,_0x457845){return function(_0x46929f){if(_0x46929f){return _0x46929f['destroy']()[_0xc981('0x25')](function(){_0x1036c3[_0xc981('0x1a')](0xcc)[_0xc981('0x1b')]();});}};}function handleEntityNotFound(_0x524b15,_0x21df9b){return function(_0x2b582d){if(!_0x2b582d){_0x524b15[_0xc981('0x19')](0x194);}return _0x2b582d;};}function handleError(_0x5a3426,_0xb16d93){_0xb16d93=_0xb16d93||0x1f4;return function(_0x314a6b){logger[_0xc981('0x26')](_0x314a6b[_0xc981('0x27')]);if(_0x314a6b[_0xc981('0x28')]){delete _0x314a6b[_0xc981('0x28')];}_0x5a3426[_0xc981('0x1a')](_0xb16d93)['send'](_0x314a6b);};}exports['index']=function(_0xd226c4,_0x3f0497){var _0x1f02a8={},_0x26fdcb={},_0x375b9d={'count':0x0,'rows':[]};var _0x3c5b63=_['map'](db['CmHopperHistory'][_0xc981('0x29')],function(_0x157b77){return{'name':_0x157b77['fieldName'],'type':_0x157b77['type'][_0xc981('0x2a')]};});_0x26fdcb[_0xc981('0x2b')]=_['map'](_0x3c5b63,_0xc981('0x28'));_0x26fdcb[_0xc981('0x2c')]=_['keys'](_0xd226c4[_0xc981('0x2c')]);_0x26fdcb[_0xc981('0x2d')]=_[_0xc981('0x2e')](_0x26fdcb[_0xc981('0x2b')],_0x26fdcb[_0xc981('0x2c')]);_0x1f02a8[_0xc981('0x2f')]=_['intersection'](_0x26fdcb[_0xc981('0x2b')],qs['fields'](_0xd226c4['query'][_0xc981('0x30')]));_0x1f02a8['attributes']=_0x1f02a8[_0xc981('0x2f')][_0xc981('0x31')]?_0x1f02a8[_0xc981('0x2f')]:_0x26fdcb[_0xc981('0x2b')];if(!_0xd226c4[_0xc981('0x2c')]['hasOwnProperty'](_0xc981('0x32'))){_0x1f02a8[_0xc981('0x1e')]=qs[_0xc981('0x1e')](_0xd226c4[_0xc981('0x2c')][_0xc981('0x1e')]);_0x1f02a8[_0xc981('0x20')]=qs[_0xc981('0x20')](_0xd226c4[_0xc981('0x2c')]['offset']);}_0x1f02a8[_0xc981('0x33')]=qs[_0xc981('0x34')](_0xd226c4[_0xc981('0x2c')][_0xc981('0x34')]);_0x1f02a8[_0xc981('0x35')]=qs[_0xc981('0x2d')](_['pick'](_0xd226c4[_0xc981('0x2c')],_0x26fdcb[_0xc981('0x2d')]),_0x3c5b63);if(_0xd226c4[_0xc981('0x2c')][_0xc981('0x36')]){_0x1f02a8[_0xc981('0x35')]=_[_0xc981('0x37')](_0x1f02a8['where'],{'$or':_[_0xc981('0x38')](_0x3c5b63,function(_0x391f6e){if(_0x391f6e[_0xc981('0x39')]!==_0xc981('0x3a')){var _0x2958fb={};_0x2958fb[_0x391f6e[_0xc981('0x28')]]={'$like':'%'+_0xd226c4[_0xc981('0x2c')][_0xc981('0x36')]+'%'};return _0x2958fb;}})});}_0x1f02a8=_[_0xc981('0x37')]({},_0x1f02a8,_0xd226c4['options']);var _0x3417f8={'where':_0x1f02a8[_0xc981('0x35')]};return db[_0xc981('0x3b')]['count'](_0x3417f8)[_0xc981('0x25')](function(_0x3d4892){_0x375b9d['count']=_0x3d4892;if(_0xd226c4[_0xc981('0x2c')][_0xc981('0x3c')]){_0x1f02a8[_0xc981('0x3d')]=[{'all':!![]}];}return db[_0xc981('0x3b')]['findAll'](_0x1f02a8);})['then'](function(_0x450826){_0x375b9d['rows']=_0x450826;return _0x375b9d;})[_0xc981('0x25')](respondWithFilteredResult(_0x3f0497,_0x1f02a8))[_0xc981('0x3e')](handleError(_0x3f0497,null));};exports[_0xc981('0x3f')]=function(_0x33e25f,_0x89fbc8){var _0x39c20f={'raw':!![],'where':{'id':_0x33e25f['params']['id']}},_0x38d2b9={};_0x38d2b9['model']=_['keys'](db[_0xc981('0x3b')][_0xc981('0x29')]);_0x38d2b9[_0xc981('0x2c')]=_[_0xc981('0x40')](_0x33e25f[_0xc981('0x2c')]);_0x38d2b9[_0xc981('0x2d')]=_['intersection'](_0x38d2b9[_0xc981('0x2b')],_0x38d2b9[_0xc981('0x2c')]);_0x39c20f[_0xc981('0x2f')]=_[_0xc981('0x2e')](_0x38d2b9[_0xc981('0x2b')],qs[_0xc981('0x30')](_0x33e25f['query'][_0xc981('0x30')]));_0x39c20f[_0xc981('0x2f')]=_0x39c20f[_0xc981('0x2f')][_0xc981('0x31')]?_0x39c20f[_0xc981('0x2f')]:_0x38d2b9[_0xc981('0x2b')];if(_0x33e25f[_0xc981('0x2c')]['includeAll']){_0x39c20f[_0xc981('0x3d')]=[{'all':!![]}];}_0x39c20f=_[_0xc981('0x37')]({},_0x39c20f,_0x33e25f[_0xc981('0x41')]);return db[_0xc981('0x3b')][_0xc981('0x42')](_0x39c20f)[_0xc981('0x25')](handleEntityNotFound(_0x89fbc8,null))[_0xc981('0x25')](respondWithResult(_0x89fbc8,null))[_0xc981('0x3e')](handleError(_0x89fbc8,null));};exports[_0xc981('0x43')]=function(_0x5d2b6f,_0x5a2abe){return db[_0xc981('0x3b')]['create'](_0x5d2b6f['body'],{})[_0xc981('0x25')](respondWithResult(_0x5a2abe,0xc9))['catch'](handleError(_0x5a2abe,null));};exports[_0xc981('0x44')]=function(_0x365c26,_0x47fa78){return db[_0xc981('0x3b')][_0xc981('0x44')]()[_0xc981('0x25')](respondWithResult(_0x47fa78,null))[_0xc981('0x3e')](handleError(_0x47fa78,null));};exports[_0xc981('0x45')]=function(_0x1cf565,_0x14c1d1){if(_0x1cf565['body'][_0xc981('0x46')]){delete _0x1cf565[_0xc981('0x47')][_0xc981('0x46')];}return db['CmHopperHistory'][_0xc981('0x42')]({'where':{'uniqueid':_0x1cf565[_0xc981('0x48')]['id']}})[_0xc981('0x25')](handleEntityNotFound(_0x14c1d1,null))[_0xc981('0x25')](saveUpdates(_0x1cf565[_0xc981('0x47')],null))['then'](respondWithResult(_0x14c1d1,null))[_0xc981('0x3e')](handleError(_0x14c1d1,null));}; \ No newline at end of file +var _0xcf30=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','options','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','describe','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'];(function(_0x53c1a2,_0x444338){var _0x24836d=function(_0x225052){while(--_0x225052){_0x53c1a2['push'](_0x53c1a2['shift']());}};_0x24836d(++_0x444338);}(_0xcf30,0xd7));var _0x0cf3=function(_0xec5672,_0x45107e){_0xec5672=_0xec5672-0x0;var _0x1537a7=_0xcf30[_0xec5672];return _0x1537a7;};'use strict';var emlformat=require(_0x0cf3('0x0'));var rimraf=require(_0x0cf3('0x1'));var zipdir=require(_0x0cf3('0x2'));var jsonpatch=require(_0x0cf3('0x3'));var rp=require(_0x0cf3('0x4'));var moment=require(_0x0cf3('0x5'));var BPromise=require(_0x0cf3('0x6'));var Mustache=require(_0x0cf3('0x7'));var util=require(_0x0cf3('0x8'));var path=require(_0x0cf3('0x9'));var sox=require(_0x0cf3('0xa'));var csv=require(_0x0cf3('0xb'));var ejs=require(_0x0cf3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0cf3('0xd'));var squel=require(_0x0cf3('0xe'));var crypto=require(_0x0cf3('0xf'));var jsforce=require(_0x0cf3('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x0cf3('0xb'));var querystring=require(_0x0cf3('0x11'));var Papa=require(_0x0cf3('0x12'));var Redis=require(_0x0cf3('0x13'));var authService=require(_0x0cf3('0x14'));var qs=require(_0x0cf3('0x15'));var as=require(_0x0cf3('0x16'));var hardwareService=require(_0x0cf3('0x17'));var logger=require(_0x0cf3('0x18'))('api');var utils=require(_0x0cf3('0x19'));var config=require(_0x0cf3('0x1a'));var licenseUtil=require(_0x0cf3('0x1b'));var db=require(_0x0cf3('0x1c'))['db'];function respondWithStatusCode(_0x4daf60,_0x1aeab4){_0x1aeab4=_0x1aeab4||0xcc;return function(_0x30fee0){if(_0x30fee0){return _0x4daf60[_0x0cf3('0x1d')](_0x1aeab4);}return _0x4daf60['status'](_0x1aeab4)[_0x0cf3('0x1e')]();};}function respondWithResult(_0x597338,_0x49e7ec){_0x49e7ec=_0x49e7ec||0xc8;return function(_0x135dc6){if(_0x135dc6){return _0x597338[_0x0cf3('0x1f')](_0x49e7ec)[_0x0cf3('0x20')](_0x135dc6);}};}function respondWithFilteredResult(_0x3403eb,_0x4fffd7){return function(_0x3b6dfb){if(_0x3b6dfb){var _0x5e35d4=typeof _0x4fffd7[_0x0cf3('0x21')]===_0x0cf3('0x22')&&typeof _0x4fffd7[_0x0cf3('0x23')]==='undefined';var _0x25dcf4=_0x3b6dfb[_0x0cf3('0x24')];var _0x4a1ff7=_0x5e35d4?0x0:_0x4fffd7['offset'];var _0x8f3eb2=_0x5e35d4?_0x3b6dfb[_0x0cf3('0x24')]:_0x4fffd7[_0x0cf3('0x21')]+_0x4fffd7[_0x0cf3('0x23')];var _0xeabc9a;if(_0x8f3eb2>=_0x25dcf4){_0x8f3eb2=_0x25dcf4;_0xeabc9a=0xc8;}else{_0xeabc9a=0xce;}_0x3403eb['status'](_0xeabc9a);return _0x3403eb[_0x0cf3('0x25')](_0x0cf3('0x26'),_0x4a1ff7+'-'+_0x8f3eb2+'/'+_0x25dcf4)[_0x0cf3('0x20')](_0x3b6dfb);}return null;};}function patchUpdates(_0x34bd3f){return function(_0x113e95){try{jsonpatch['apply'](_0x113e95,_0x34bd3f,!![]);}catch(_0x498185){return BPromise['reject'](_0x498185);}return _0x113e95[_0x0cf3('0x27')]();};}function saveUpdates(_0xaaa107,_0x453e16){return function(_0x1081c0){if(_0x1081c0){return _0x1081c0[_0x0cf3('0x28')](_0xaaa107)[_0x0cf3('0x29')](function(_0x40a912){return _0x40a912;});}return null;};}function removeEntity(_0x2343b0,_0x1d8e1f){return function(_0x240fe6){if(_0x240fe6){return _0x240fe6['destroy']()[_0x0cf3('0x29')](function(){_0x2343b0['status'](0xcc)[_0x0cf3('0x1e')]();});}};}function handleEntityNotFound(_0x3a26dd,_0x39528b){return function(_0x27436e){if(!_0x27436e){_0x3a26dd[_0x0cf3('0x1d')](0x194);}return _0x27436e;};}function handleError(_0x29a904,_0x289510){_0x289510=_0x289510||0x1f4;return function(_0x4f464f){logger[_0x0cf3('0x2a')](_0x4f464f[_0x0cf3('0x2b')]);if(_0x4f464f['name']){delete _0x4f464f['name'];}_0x29a904[_0x0cf3('0x1f')](_0x289510)[_0x0cf3('0x2c')](_0x4f464f);};}exports[_0x0cf3('0x2d')]=function(_0x296666,_0x369a7c){var _0x568c6c={},_0x387d9f={},_0x248dc7={'count':0x0,'rows':[]};var _0x5a82bc=_[_0x0cf3('0x2e')](db[_0x0cf3('0x2f')][_0x0cf3('0x30')],function(_0x347fbd){return{'name':_0x347fbd[_0x0cf3('0x31')],'type':_0x347fbd[_0x0cf3('0x32')][_0x0cf3('0x33')]};});_0x387d9f[_0x0cf3('0x34')]=_[_0x0cf3('0x2e')](_0x5a82bc,_0x0cf3('0x35'));_0x387d9f[_0x0cf3('0x36')]=_[_0x0cf3('0x37')](_0x296666['query']);_0x387d9f[_0x0cf3('0x38')]=_['intersection'](_0x387d9f[_0x0cf3('0x34')],_0x387d9f['query']);_0x568c6c[_0x0cf3('0x39')]=_[_0x0cf3('0x3a')](_0x387d9f[_0x0cf3('0x34')],qs['fields'](_0x296666[_0x0cf3('0x36')][_0x0cf3('0x3b')]));_0x568c6c[_0x0cf3('0x39')]=_0x568c6c[_0x0cf3('0x39')][_0x0cf3('0x3c')]?_0x568c6c['attributes']:_0x387d9f[_0x0cf3('0x34')];if(!_0x296666[_0x0cf3('0x36')][_0x0cf3('0x3d')]('nolimit')){_0x568c6c['limit']=qs[_0x0cf3('0x23')](_0x296666[_0x0cf3('0x36')][_0x0cf3('0x23')]);_0x568c6c['offset']=qs[_0x0cf3('0x21')](_0x296666[_0x0cf3('0x36')][_0x0cf3('0x21')]);}_0x568c6c[_0x0cf3('0x3e')]=qs['sort'](_0x296666['query'][_0x0cf3('0x3f')]);_0x568c6c[_0x0cf3('0x40')]=qs[_0x0cf3('0x38')](_['pick'](_0x296666['query'],_0x387d9f[_0x0cf3('0x38')]),_0x5a82bc);if(_0x296666[_0x0cf3('0x36')][_0x0cf3('0x41')]){_0x568c6c[_0x0cf3('0x40')]=_['merge'](_0x568c6c[_0x0cf3('0x40')],{'$or':_[_0x0cf3('0x2e')](_0x5a82bc,function(_0x2f4311){if(_0x2f4311[_0x0cf3('0x32')]!=='VIRTUAL'){var _0x205fee={};_0x205fee[_0x2f4311[_0x0cf3('0x35')]]={'$like':'%'+_0x296666[_0x0cf3('0x36')]['filter']+'%'};return _0x205fee;}})});}_0x568c6c=_['merge']({},_0x568c6c,_0x296666[_0x0cf3('0x42')]);var _0x4f68fe={'where':_0x568c6c[_0x0cf3('0x40')]};return db[_0x0cf3('0x2f')][_0x0cf3('0x24')](_0x4f68fe)[_0x0cf3('0x29')](function(_0x48fd0d){_0x248dc7['count']=_0x48fd0d;if(_0x296666[_0x0cf3('0x36')][_0x0cf3('0x43')]){_0x568c6c['include']=[{'all':!![]}];}return db[_0x0cf3('0x2f')][_0x0cf3('0x44')](_0x568c6c);})[_0x0cf3('0x29')](function(_0x14cf19){_0x248dc7[_0x0cf3('0x45')]=_0x14cf19;return _0x248dc7;})[_0x0cf3('0x29')](respondWithFilteredResult(_0x369a7c,_0x568c6c))[_0x0cf3('0x46')](handleError(_0x369a7c,null));};exports[_0x0cf3('0x47')]=function(_0x55456c,_0x3ea806){var _0x21a997={'raw':!![],'where':{'id':_0x55456c[_0x0cf3('0x48')]['id']}},_0x588d61={};_0x588d61[_0x0cf3('0x34')]=_['keys'](db[_0x0cf3('0x2f')][_0x0cf3('0x30')]);_0x588d61[_0x0cf3('0x36')]=_[_0x0cf3('0x37')](_0x55456c[_0x0cf3('0x36')]);_0x588d61[_0x0cf3('0x38')]=_[_0x0cf3('0x3a')](_0x588d61[_0x0cf3('0x34')],_0x588d61[_0x0cf3('0x36')]);_0x21a997[_0x0cf3('0x39')]=_[_0x0cf3('0x3a')](_0x588d61[_0x0cf3('0x34')],qs[_0x0cf3('0x3b')](_0x55456c[_0x0cf3('0x36')][_0x0cf3('0x3b')]));_0x21a997[_0x0cf3('0x39')]=_0x21a997['attributes'][_0x0cf3('0x3c')]?_0x21a997[_0x0cf3('0x39')]:_0x588d61[_0x0cf3('0x34')];if(_0x55456c[_0x0cf3('0x36')][_0x0cf3('0x43')]){_0x21a997[_0x0cf3('0x49')]=[{'all':!![]}];}_0x21a997=_[_0x0cf3('0x4a')]({},_0x21a997,_0x55456c[_0x0cf3('0x42')]);return db[_0x0cf3('0x2f')][_0x0cf3('0x4b')](_0x21a997)['then'](handleEntityNotFound(_0x3ea806,null))[_0x0cf3('0x29')](respondWithResult(_0x3ea806,null))[_0x0cf3('0x46')](handleError(_0x3ea806,null));};exports[_0x0cf3('0x4c')]=function(_0x315da,_0x2f0ad0){return db[_0x0cf3('0x2f')][_0x0cf3('0x4c')](_0x315da[_0x0cf3('0x4d')],{})[_0x0cf3('0x29')](respondWithResult(_0x2f0ad0,0xc9))['catch'](handleError(_0x2f0ad0,null));};exports[_0x0cf3('0x4e')]=function(_0x36df53,_0xd6a455){return db['CmHopperHistory']['describe']()[_0x0cf3('0x29')](respondWithResult(_0xd6a455,null))[_0x0cf3('0x46')](handleError(_0xd6a455,null));};exports[_0x0cf3('0x28')]=function(_0x21d52a,_0x292539){if(_0x21d52a[_0x0cf3('0x4d')]['uniqueid']){delete _0x21d52a[_0x0cf3('0x4d')]['uniqueid'];}return db[_0x0cf3('0x2f')][_0x0cf3('0x4b')]({'where':{'uniqueid':_0x21d52a[_0x0cf3('0x48')]['id']}})[_0x0cf3('0x29')](handleEntityNotFound(_0x292539,null))[_0x0cf3('0x29')](saveUpdates(_0x21d52a[_0x0cf3('0x4d')],null))[_0x0cf3('0x29')](respondWithResult(_0x292539,null))[_0x0cf3('0x46')](handleError(_0x292539,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 451259d..63ef33f 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 _0x3646=['./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x364e26,_0x14d83e){var _0x26269b=function(_0x41953d){while(--_0x41953d){_0x364e26['push'](_0x364e26['shift']());}};_0x26269b(++_0x14d83e);}(_0x3646,0x15f));var _0x6364=function(_0x492215,_0x56dcc2){_0x492215=_0x492215-0x0;var _0xb9af30=_0x3646[_0x492215];return _0xb9af30;};'use strict';var _=require(_0x6364('0x0'));var util=require(_0x6364('0x1'));var logger=require(_0x6364('0x2'))(_0x6364('0x3'));var moment=require('moment');var BPromise=require(_0x6364('0x4'));var rp=require(_0x6364('0x5'));var fs=require('fs');var path=require(_0x6364('0x6'));var rimraf=require(_0x6364('0x7'));var config=require(_0x6364('0x8'));var attributes=require(_0x6364('0x9'));module[_0x6364('0xa')]=function(_0x31f514,_0x165164){return _0x31f514[_0x6364('0xb')](_0x6364('0xc'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x6364('0xd'),'fields':[_0x6364('0xd')]},{'name':_0x6364('0xe'),'fields':[_0x6364('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x627e=['define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x539112,_0x262d69){var _0xd0b4a2=function(_0x3ee89d){while(--_0x3ee89d){_0x539112['push'](_0x539112['shift']());}};_0xd0b4a2(++_0x262d69);}(_0x627e,0x14a));var _0xe627=function(_0x40e3bd,_0x198417){_0x40e3bd=_0x40e3bd-0x0;var _0x1c00f1=_0x627e[_0x40e3bd];return _0x1c00f1;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var logger=require(_0xe627('0x2'))(_0xe627('0x3'));var moment=require(_0xe627('0x4'));var BPromise=require('bluebird');var rp=require(_0xe627('0x5'));var fs=require('fs');var path=require(_0xe627('0x6'));var rimraf=require(_0xe627('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x1a1a3d,_0x3f2791){return _0x1a1a3d[_0xe627('0x8')](_0xe627('0x9'),attributes,{'tableName':_0xe627('0xa'),'paranoid':![],'indexes':[{'name':_0xe627('0xb'),'fields':['endtime']},{'name':_0xe627('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 35929b2..5110160 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 _0x3b46=['col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','CmHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','catch','CreateCmHopperHistory','body','options','raw','AvgHandleTime','where','sequelize','COUNT'];(function(_0x56d3cf,_0x20787b){var _0x5881e6=function(_0x2bd2cc){while(--_0x2bd2cc){_0x56d3cf['push'](_0x56d3cf['shift']());}};_0x5881e6(++_0x20787b);}(_0x3b46,0x1a2));var _0x63b4=function(_0x8a30cf,_0x40f19b){_0x8a30cf=_0x8a30cf-0x0;var _0x20f439=_0x3b46[_0x8a30cf];return _0x20f439;};'use strict';var _=require(_0x63b4('0x0'));var util=require(_0x63b4('0x1'));var moment=require(_0x63b4('0x2'));var BPromise=require(_0x63b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x63b4('0x4'));var db=require(_0x63b4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x63b4('0x6'))(_0x63b4('0x7'));var config=require(_0x63b4('0x8'));var jayson=require(_0x63b4('0x9'));var client=jayson[_0x63b4('0xa')][_0x63b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x514b5d,_0x5ce3df,_0x352379){return new BPromise(function(_0x4b02fb,_0x261eb8){return client[_0x63b4('0xc')](_0x514b5d,_0x352379)[_0x63b4('0xd')](function(_0x438ec8){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x5ce3df,_0x63b4('0xe'));logger[_0x63b4('0xf')](_0x63b4('0x10'),_0x5ce3df,_0x63b4('0xe'),JSON[_0x63b4('0x11')](_0x438ec8));if(_0x438ec8[_0x63b4('0x12')]){if(_0x438ec8['error'][_0x63b4('0x13')]===0x1f4){logger[_0x63b4('0x12')](_0x63b4('0x14'),_0x5ce3df,_0x438ec8[_0x63b4('0x12')]['message']);return _0x261eb8(_0x438ec8[_0x63b4('0x12')][_0x63b4('0x15')]);}logger[_0x63b4('0x12')](_0x63b4('0x14'),_0x5ce3df,_0x438ec8[_0x63b4('0x12')][_0x63b4('0x15')]);return _0x4b02fb(_0x438ec8[_0x63b4('0x12')]['message']);}else{logger[_0x63b4('0x16')](_0x63b4('0x14'),_0x5ce3df,_0x63b4('0xe'));_0x4b02fb(_0x438ec8['result'][_0x63b4('0x15')]);}})[_0x63b4('0x17')](function(_0x39b0dc){logger[_0x63b4('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x5ce3df,_0x39b0dc);_0x261eb8(_0x39b0dc);});});}exports[_0x63b4('0x18')]=function(_0x143352){var _0x43b0df=this;return new Promise(function(_0x4c8ab2,_0x19358b){return db['CmHopperHistory']['create'](_0x143352[_0x63b4('0x19')],{'raw':_0x143352['options']?_0x143352[_0x63b4('0x1a')][_0x63b4('0x1b')]===undefined?!![]:![]:!![]})[_0x63b4('0xd')](function(_0x48dc55){logger['info'](_0x63b4('0x18'),_0x143352);logger[_0x63b4('0xf')](_0x63b4('0x18'),_0x143352,JSON[_0x63b4('0x11')](_0x48dc55));_0x4c8ab2(_0x48dc55);})['catch'](function(_0x39f910){logger[_0x63b4('0x12')](_0x63b4('0x18'),_0x39f910[_0x63b4('0x15')],_0x143352);_0x19358b(_0x43b0df['error'](0x1f4,_0x39f910[_0x63b4('0x15')]));});});};exports[_0x63b4('0x1c')]=function(_0x5cbbc3){var _0x7d8cff=this;return new Promise(function(_0x58880e,_0x4159ee){return db['CmHopperHistory']['findAll']({'raw':_0x5cbbc3[_0x63b4('0x1a')]?_0x5cbbc3[_0x63b4('0x1a')][_0x63b4('0x1b')]===undefined?!![]:![]:!![],'where':_0x5cbbc3[_0x63b4('0x1a')]?_0x5cbbc3[_0x63b4('0x1a')][_0x63b4('0x1d')]||null:null,'attributes':[[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db[_0x63b4('0x1e')][_0x63b4('0x20')]('id')),_0x63b4('0x21')],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db['sequelize']['fn']('IF',db[_0x63b4('0x1e')][_0x63b4('0x22')](_0x63b4('0x23')))),_0x63b4('0x24')],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db[_0x63b4('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x63b4('0x25')))),_0x63b4('0x26')],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db[_0x63b4('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x63b4('0x27')))),_0x63b4('0x28')],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x29'),db[_0x63b4('0x1e')]['fn']('IF',db[_0x63b4('0x1e')][_0x63b4('0x22')](_0x63b4('0x2a')))),'predictiveIntervalAvgHoldtime'],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x29'),db[_0x63b4('0x1e')]['fn']('IF',db[_0x63b4('0x1e')][_0x63b4('0x22')](_0x63b4('0x2b')))),_0x63b4('0x2c')]]})[_0x63b4('0xd')](function(_0x184e18){logger[_0x63b4('0x16')](_0x63b4('0x1c'),_0x5cbbc3);logger[_0x63b4('0xf')](_0x63b4('0x1c'),_0x5cbbc3,JSON[_0x63b4('0x11')](_0x184e18));_0x58880e(_0x184e18);})[_0x63b4('0x17')](function(_0x234642){logger[_0x63b4('0x12')]('AvgHandleTime',_0x234642[_0x63b4('0x15')],_0x5cbbc3);_0x4159ee(_0x7d8cff[_0x63b4('0x12')](0x1f4,_0x234642[_0x63b4('0x15')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x408ebb){var _0x1a54e4=this;return new Promise(function(_0x3708c6,_0x88718b){return db[_0x63b4('0x2d')][_0x63b4('0x2e')]({'raw':_0x408ebb['options']?_0x408ebb['options'][_0x63b4('0x1b')]===undefined?!![]:![]:!![],'where':_0x408ebb[_0x63b4('0x1a')]?_0x408ebb[_0x63b4('0x1a')][_0x63b4('0x1d')]||null:null,'attributes':[[_0x63b4('0x2f'),_0x63b4('0x30')],[db['sequelize']['fn'](_0x63b4('0x1f'),db[_0x63b4('0x1e')]['fn']('IF',db[_0x63b4('0x1e')]['literal'](_0x63b4('0x31')))),_0x63b4('0x32')],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db[_0x63b4('0x1e')]['fn']('IF',db[_0x63b4('0x1e')][_0x63b4('0x22')](_0x63b4('0x33')))),_0x63b4('0x34')],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db[_0x63b4('0x1e')]['fn']('IF',db['sequelize'][_0x63b4('0x22')](_0x63b4('0x23')))),_0x63b4('0x35')],[db['sequelize']['fn']('COUNT',db[_0x63b4('0x1e')]['fn']('IF',db[_0x63b4('0x1e')][_0x63b4('0x22')](_0x63b4('0x36')))),'outboundBusyCallsDay'],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db[_0x63b4('0x1e')]['fn']('IF',db['sequelize'][_0x63b4('0x22')](_0x63b4('0x37')))),_0x63b4('0x38')],[db[_0x63b4('0x1e')]['fn']('COUNT',db[_0x63b4('0x1e')]['fn']('IF',db[_0x63b4('0x1e')][_0x63b4('0x22')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x63b4('0x39')],[db[_0x63b4('0x1e')]['fn']('COUNT',db[_0x63b4('0x1e')]['fn']('IF',db[_0x63b4('0x1e')]['literal'](_0x63b4('0x3a')))),_0x63b4('0x3b')],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db['sequelize']['fn']('IF',db[_0x63b4('0x1e')][_0x63b4('0x22')](_0x63b4('0x3c')))),_0x63b4('0x3d')],[db[_0x63b4('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x63b4('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),_0x63b4('0x3e')],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db['sequelize']['fn']('IF',db[_0x63b4('0x1e')][_0x63b4('0x22')](_0x63b4('0x3f')))),_0x63b4('0x40')],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db[_0x63b4('0x1e')]['fn']('IF',db[_0x63b4('0x1e')][_0x63b4('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0x63b4('0x41')],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db[_0x63b4('0x1e')]['fn']('IF',db['sequelize'][_0x63b4('0x22')](_0x63b4('0x42')))),_0x63b4('0x43')],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db[_0x63b4('0x1e')]['fn']('IF',db[_0x63b4('0x1e')][_0x63b4('0x22')](_0x63b4('0x44')))),'outboundRejectCallsDay'],[db[_0x63b4('0x1e')]['fn'](_0x63b4('0x1f'),db[_0x63b4('0x1e')]['fn']('IF',db[_0x63b4('0x1e')][_0x63b4('0x22')](_0x63b4('0x45')))),_0x63b4('0x46')]],'group':[_0x63b4('0x2f')]})['then'](function(_0x58fd0c){logger[_0x63b4('0x16')]('GetVoiceQueueHopperHistory',_0x408ebb);logger[_0x63b4('0xf')](_0x63b4('0x47'),_0x408ebb,JSON[_0x63b4('0x11')](_0x58fd0c));_0x3708c6(_0x58fd0c);})[_0x63b4('0x17')](function(_0x3e2e57){logger[_0x63b4('0x12')]('GetVoiceQueueHopperHistory',_0x3e2e57[_0x63b4('0x15')],_0x408ebb);_0x88718b(_0x1a54e4[_0x63b4('0x12')](0x1f4,_0x3e2e57[_0x63b4('0x15')]));});});};exports['GetCampaignHopperHistory']=function(_0x3bdb17){var _0x32ff5a=this;return new Promise(function(_0x59f1b7,_0x5e0a1c){return db[_0x63b4('0x2d')][_0x63b4('0x2e')]({'raw':_0x3bdb17[_0x63b4('0x1a')]?_0x3bdb17[_0x63b4('0x1a')][_0x63b4('0x1b')]===undefined?!![]:![]:!![],'where':_0x3bdb17[_0x63b4('0x1a')]?_0x3bdb17['options']['where']||null:null,'attributes':[[_0x63b4('0x2f'),_0x63b4('0x30')],[db['sequelize']['fn'](_0x63b4('0x1f'),db[_0x63b4('0x1e')]['col']('id')),_0x63b4('0x48')],[db['sequelize']['fn'](_0x63b4('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x63b4('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x63b4('0x49')]],'group':['campaign']})[_0x63b4('0xd')](function(_0x2864bf){logger[_0x63b4('0x16')]('GetCampaignHopperHistory',_0x3bdb17);logger['debug'](_0x63b4('0x4a'),_0x3bdb17,JSON[_0x63b4('0x11')](_0x2864bf));_0x59f1b7(_0x2864bf);})['catch'](function(_0x65a9e9){logger[_0x63b4('0x12')](_0x63b4('0x4a'),_0x65a9e9[_0x63b4('0x15')],_0x3bdb17);_0x5e0a1c(_0x32ff5a[_0x63b4('0x12')](0x1f4,_0x65a9e9[_0x63b4('0x15')]));});});}; \ No newline at end of file +var _0x205d=['CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','stringify','AvgHandleTime','findAll','where','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','raw','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','name','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x467b71,_0xb770a9){var _0x5ec7bb=function(_0x612bc3){while(--_0x612bc3){_0x467b71['push'](_0x467b71['shift']());}};_0x5ec7bb(++_0xb770a9);}(_0x205d,0xf6));var _0xd205=function(_0x421c11,_0xcf7560){_0x421c11=_0x421c11-0x0;var _0x317709=_0x205d[_0x421c11];return _0x317709;};'use strict';var _=require(_0xd205('0x0'));var util=require(_0xd205('0x1'));var moment=require(_0xd205('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd205('0x3'));var db=require(_0xd205('0x4'))['db'];var utils=require(_0xd205('0x5'));var logger=require('../../config/logger')(_0xd205('0x6'));var config=require(_0xd205('0x7'));var jayson=require(_0xd205('0x8'));var client=jayson[_0xd205('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2614e7,_0x2b6078,_0xdb99a8){return new BPromise(function(_0x372211,_0x3ce946){return client[_0xd205('0xa')](_0x2614e7,_0xdb99a8)[_0xd205('0xb')](function(_0x1cd484){logger[_0xd205('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x2b6078,_0xd205('0xd'));logger[_0xd205('0xe')](_0xd205('0xf'),_0x2b6078,_0xd205('0xd'),JSON['stringify'](_0x1cd484));if(_0x1cd484[_0xd205('0x10')]){if(_0x1cd484[_0xd205('0x10')][_0xd205('0x11')]===0x1f4){logger[_0xd205('0x10')](_0xd205('0x12'),_0x2b6078,_0x1cd484[_0xd205('0x10')][_0xd205('0x13')]);return _0x3ce946(_0x1cd484['error'][_0xd205('0x13')]);}logger[_0xd205('0x10')](_0xd205('0x12'),_0x2b6078,_0x1cd484['error']['message']);return _0x372211(_0x1cd484[_0xd205('0x10')]['message']);}else{logger[_0xd205('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x2b6078,_0xd205('0xd'));_0x372211(_0x1cd484[_0xd205('0x14')][_0xd205('0x13')]);}})[_0xd205('0x15')](function(_0x57201a){logger[_0xd205('0x10')](_0xd205('0x12'),_0x2b6078,_0x57201a);_0x3ce946(_0x57201a);});});}exports[_0xd205('0x16')]=function(_0x135e9d){var _0x1af3b3=this;return new Promise(function(_0x31eb94,_0x3121b0){return db[_0xd205('0x17')][_0xd205('0x18')](_0x135e9d['body'],{'raw':_0x135e9d[_0xd205('0x19')]?_0x135e9d['options']['raw']===undefined?!![]:![]:!![]})[_0xd205('0xb')](function(_0x5c3c31){logger['info'](_0xd205('0x16'),_0x135e9d);logger[_0xd205('0xe')](_0xd205('0x16'),_0x135e9d,JSON[_0xd205('0x1a')](_0x5c3c31));_0x31eb94(_0x5c3c31);})[_0xd205('0x15')](function(_0x19f710){logger[_0xd205('0x10')](_0xd205('0x16'),_0x19f710[_0xd205('0x13')],_0x135e9d);_0x3121b0(_0x1af3b3[_0xd205('0x10')](0x1f4,_0x19f710[_0xd205('0x13')]));});});};exports[_0xd205('0x1b')]=function(_0x436a3a){var _0x1e7264=this;return new Promise(function(_0x1f2a7b,_0x125922){return db[_0xd205('0x17')][_0xd205('0x1c')]({'raw':_0x436a3a[_0xd205('0x19')]?_0x436a3a[_0xd205('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x436a3a[_0xd205('0x19')]?_0x436a3a[_0xd205('0x19')][_0xd205('0x1d')]||null:null,'attributes':[[db[_0xd205('0x1e')]['fn'](_0xd205('0x1f'),db[_0xd205('0x1e')]['col']('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0xd205('0x1f'),db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')](_0xd205('0x21')))),_0xd205('0x22')],[db[_0xd205('0x1e')]['fn']('COUNT',db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')](_0xd205('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xd205('0x1f'),db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')]['literal'](_0xd205('0x24')))),_0xd205('0x25')],[db[_0xd205('0x1e')]['fn']('AVG',db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0xd205('0x1e')]['fn']('AVG',db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')](_0xd205('0x26')))),'predictiveIntervalAvgTalktime']]})[_0xd205('0xb')](function(_0x4dec02){logger[_0xd205('0xc')](_0xd205('0x1b'),_0x436a3a);logger['debug'](_0xd205('0x1b'),_0x436a3a,JSON['stringify'](_0x4dec02));_0x1f2a7b(_0x4dec02);})[_0xd205('0x15')](function(_0x40b6f8){logger[_0xd205('0x10')](_0xd205('0x1b'),_0x40b6f8[_0xd205('0x13')],_0x436a3a);_0x125922(_0x1e7264[_0xd205('0x10')](0x1f4,_0x40b6f8[_0xd205('0x13')]));});});};exports[_0xd205('0x27')]=function(_0x17858b){var _0x3f2387=this;return new Promise(function(_0x5bb1fb,_0x38d565){return db[_0xd205('0x17')]['findAll']({'raw':_0x17858b['options']?_0x17858b['options'][_0xd205('0x28')]===undefined?!![]:![]:!![],'where':_0x17858b[_0xd205('0x19')]?_0x17858b[_0xd205('0x19')][_0xd205('0x1d')]||null:null,'attributes':[[_0xd205('0x29'),'name'],[db[_0xd205('0x1e')]['fn'](_0xd205('0x1f'),db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')](_0xd205('0x2a')))),_0xd205('0x2b')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xd205('0x20')](_0xd205('0x2c')))),_0xd205('0x2d')],[db['sequelize']['fn']('COUNT',db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xd205('0x2e')],[db[_0xd205('0x1e')]['fn'](_0xd205('0x1f'),db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0xd205('0x1e')]['fn'](_0xd205('0x1f'),db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')]['literal'](_0xd205('0x2f')))),'outboundCongestionCallsDay'],[db[_0xd205('0x1e')]['fn'](_0xd205('0x1f'),db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')](_0xd205('0x30')))),_0xd205('0x31')],[db[_0xd205('0x1e')]['fn'](_0xd205('0x1f'),db['sequelize']['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xd205('0x32')],[db['sequelize']['fn'](_0xd205('0x1f'),db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')]['literal'](_0xd205('0x33')))),'outboundUnknownCallsDay'],[db[_0xd205('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')]('`state`\x20=\x2013,\x201,\x20null'))),_0xd205('0x34')],[db[_0xd205('0x1e')]['fn'](_0xd205('0x1f'),db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')](_0xd205('0x35')))),_0xd205('0x36')],[db[_0xd205('0x1e')]['fn'](_0xd205('0x1f'),db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')]['literal'](_0xd205('0x37')))),_0xd205('0x38')],[db[_0xd205('0x1e')]['fn']('COUNT',db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')](_0xd205('0x39')))),_0xd205('0x3a')],[db[_0xd205('0x1e')]['fn'](_0xd205('0x1f'),db[_0xd205('0x1e')]['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')](_0xd205('0x3b')))),_0xd205('0x38')],[db[_0xd205('0x1e')]['fn'](_0xd205('0x1f'),db['sequelize']['fn']('IF',db[_0xd205('0x1e')][_0xd205('0x20')](_0xd205('0x3c')))),'outboundReCallsDay']],'group':['campaign']})[_0xd205('0xb')](function(_0x5c3167){logger[_0xd205('0xc')]('GetVoiceQueueHopperHistory',_0x17858b);logger[_0xd205('0xe')](_0xd205('0x27'),_0x17858b,JSON[_0xd205('0x1a')](_0x5c3167));_0x5bb1fb(_0x5c3167);})[_0xd205('0x15')](function(_0x44c972){logger[_0xd205('0x10')](_0xd205('0x27'),_0x44c972[_0xd205('0x13')],_0x17858b);_0x38d565(_0x3f2387['error'](0x1f4,_0x44c972[_0xd205('0x13')]));});});};exports[_0xd205('0x3d')]=function(_0x2e8dff){var _0x5c77eb=this;return new Promise(function(_0x255c3c,_0x453a84){return db[_0xd205('0x17')]['findAll']({'raw':_0x2e8dff[_0xd205('0x19')]?_0x2e8dff[_0xd205('0x19')][_0xd205('0x28')]===undefined?!![]:![]:!![],'where':_0x2e8dff[_0xd205('0x19')]?_0x2e8dff[_0xd205('0x19')][_0xd205('0x1d')]||null:null,'attributes':[['campaign',_0xd205('0x3e')],[db[_0xd205('0x1e')]['fn'](_0xd205('0x1f'),db[_0xd205('0x1e')][_0xd205('0x3f')]('id')),_0xd205('0x40')],[db[_0xd205('0x1e')]['fn']('COUNT',db[_0xd205('0x1e')]['fn']('IF',db['sequelize'][_0xd205('0x20')](_0xd205('0x21')))),_0xd205('0x41')]],'group':[_0xd205('0x29')]})[_0xd205('0xb')](function(_0x15c8aa){logger[_0xd205('0xc')]('GetCampaignHopperHistory',_0x2e8dff);logger[_0xd205('0xe')](_0xd205('0x3d'),_0x2e8dff,JSON['stringify'](_0x15c8aa));_0x255c3c(_0x15c8aa);})[_0xd205('0x15')](function(_0x1d6693){logger['error'](_0xd205('0x3d'),_0x1d6693['message'],_0x2e8dff);_0x453a84(_0x5c77eb['error'](0x1f4,_0x1d6693[_0xd205('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 0dbe00a..7d9fc01 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 _0x069c=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','exports','util','express'];(function(_0x3589ab,_0x3e42e6){var _0x19bf8f=function(_0xe8714c){while(--_0xe8714c){_0x3589ab['push'](_0x3589ab['shift']());}};_0x19bf8f(++_0x3e42e6);}(_0x069c,0x13e));var _0xc069=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x069c[_0x494d1f];return _0x457b6e;};'use strict';var multer=require('multer');var util=require(_0xc069('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc069('0x1'));var router=express[_0xc069('0x2')]();var fs_extra=require(_0xc069('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc069('0x4'));var config=require(_0xc069('0x5'));var controller=require('./cmHopperHistory.controller');router[_0xc069('0x6')]('/',auth[_0xc069('0x7')](),controller['index']);router['get'](_0xc069('0x8'),auth[_0xc069('0x7')](),controller[_0xc069('0x9')]);router[_0xc069('0x6')](_0xc069('0xa'),auth[_0xc069('0x7')](),controller[_0xc069('0xb')]);router[_0xc069('0xc')]('/',auth[_0xc069('0x7')](),controller[_0xc069('0xd')]);router[_0xc069('0xe')](_0xc069('0xa'),auth[_0xc069('0x7')](),controller['update']);module[_0xc069('0xf')]=router; \ No newline at end of file +var _0x998f=['put','/:id','update','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x237d67,_0x4ff2db){var _0x292dfb=function(_0x565a7d){while(--_0x565a7d){_0x237d67['push'](_0x237d67['shift']());}};_0x292dfb(++_0x4ff2db);}(_0x998f,0x18a));var _0xf998=function(_0x46e32a,_0x1d80bd){_0x46e32a=_0x46e32a-0x0;var _0xa81881=_0x998f[_0x46e32a];return _0xa81881;};'use strict';var multer=require(_0xf998('0x0'));var util=require('util');var path=require(_0xf998('0x1'));var timeout=require(_0xf998('0x2'));var express=require(_0xf998('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf998('0x4'));var config=require(_0xf998('0x5'));var controller=require('./cmHopperHistory.controller');router[_0xf998('0x6')]('/',auth[_0xf998('0x7')](),controller[_0xf998('0x8')]);router[_0xf998('0x6')](_0xf998('0x9'),auth[_0xf998('0x7')](),controller[_0xf998('0xa')]);router[_0xf998('0x6')]('/:id',auth[_0xf998('0x7')](),controller[_0xf998('0xb')]);router[_0xf998('0xc')]('/',auth[_0xf998('0x7')](),controller[_0xf998('0xd')]);router[_0xf998('0xe')](_0xf998('0xf'),auth[_0xf998('0x7')](),controller[_0xf998('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 634fb2f..e658fb4 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 _0xd7ce=['exports','STRING','name','sequelize'];(function(_0x5a0b40,_0x125842){var _0x422d9f=function(_0x5c7054){while(--_0x5c7054){_0x5a0b40['push'](_0x5a0b40['shift']());}};_0x422d9f(++_0x125842);}(_0xd7ce,0x16b));var _0xed7c=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xd7ce[_0x30b0d8];return _0x459c09;};'use strict';var Sequelize=require(_0xed7c('0x0'));module[_0xed7c('0x1')]={'name':{'type':Sequelize[_0xed7c('0x2')],'unique':_0xed7c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe14d=['STRING','name','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe14d,0x1ee));var _0xde14=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe14d[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'name':{'type':Sequelize[_0xde14('0x2')],'unique':_0xde14('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xde14('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 79e7318..61d7d1e 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 _0xa488=['format','cf_%d','raw','getContactsCsv','isEmpty','writeFileSync','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','TEXT','number','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','get','Lists','UserProfileResource','end','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','type','name','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','CmList','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','ids','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','message','getContacts','CmCustomField','CustomFields'];(function(_0x20daba,_0x5717d4){var _0x3b5430=function(_0x423be6){while(--_0x423be6){_0x20daba['push'](_0x20daba['shift']());}};_0x3b5430(++_0x5717d4);}(_0xa488,0x149));var _0x8a48=function(_0x230962,_0x5e9cdc){_0x230962=_0x230962-0x0;var _0x198020=_0xa488[_0x230962];return _0x198020;};'use strict';var emlformat=require(_0x8a48('0x0'));var rimraf=require(_0x8a48('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8a48('0x2'));var moment=require('moment');var BPromise=require(_0x8a48('0x3'));var Mustache=require(_0x8a48('0x4'));var util=require(_0x8a48('0x5'));var path=require(_0x8a48('0x6'));var sox=require(_0x8a48('0x7'));var csv=require('to-csv');var ejs=require(_0x8a48('0x8'));var fs=require('fs');var fs_extra=require(_0x8a48('0x9'));var _=require(_0x8a48('0xa'));var squel=require(_0x8a48('0xb'));var crypto=require(_0x8a48('0xc'));var jsforce=require(_0x8a48('0xd'));var deskjs=require(_0x8a48('0xe'));var toCsv=require(_0x8a48('0xf'));var querystring=require(_0x8a48('0x10'));var Papa=require(_0x8a48('0x11'));var Redis=require('ioredis');var authService=require(_0x8a48('0x12'));var qs=require(_0x8a48('0x13'));var as=require(_0x8a48('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8a48('0x15'));var utils=require(_0x8a48('0x16'));var config=require(_0x8a48('0x17'));var licenseUtil=require(_0x8a48('0x18'));var db=require(_0x8a48('0x19'))['db'];config[_0x8a48('0x1a')]=_['defaults'](config[_0x8a48('0x1a')],{'host':_0x8a48('0x1b'),'port':0x18eb});var socket=require(_0x8a48('0x1c'))(new Redis(config[_0x8a48('0x1a')]));require(_0x8a48('0x1d'))[_0x8a48('0x1e')](socket);function respondWithStatusCode(_0x474f62,_0x3c5e81){_0x3c5e81=_0x3c5e81||0xcc;return function(_0x5016cd){if(_0x5016cd){return _0x474f62['sendStatus'](_0x3c5e81);}return _0x474f62[_0x8a48('0x1f')](_0x3c5e81)['end']();};}function respondWithResult(_0xf4d673,_0x561105){_0x561105=_0x561105||0xc8;return function(_0x5da373){if(_0x5da373){return _0xf4d673[_0x8a48('0x1f')](_0x561105)[_0x8a48('0x20')](_0x5da373);}};}function respondWithFilteredResult(_0x43842e,_0x49e4b6){return function(_0x23bc16){if(_0x23bc16){var _0x1e8d58=typeof _0x49e4b6['offset']===_0x8a48('0x21')&&typeof _0x49e4b6[_0x8a48('0x22')]===_0x8a48('0x21');var _0x4cb853=_0x23bc16[_0x8a48('0x23')];var _0x2c822d=_0x1e8d58?0x0:_0x49e4b6[_0x8a48('0x24')];var _0x3251e8=_0x1e8d58?_0x23bc16[_0x8a48('0x23')]:_0x49e4b6['offset']+_0x49e4b6['limit'];var _0x5564f8;if(_0x3251e8>=_0x4cb853){_0x3251e8=_0x4cb853;_0x5564f8=0xc8;}else{_0x5564f8=0xce;}_0x43842e[_0x8a48('0x1f')](_0x5564f8);return _0x43842e[_0x8a48('0x25')](_0x8a48('0x26'),_0x2c822d+'-'+_0x3251e8+'/'+_0x4cb853)[_0x8a48('0x20')](_0x23bc16);}return null;};}function patchUpdates(_0x211a76){return function(_0x4fa2b0){try{jsonpatch['apply'](_0x4fa2b0,_0x211a76,!![]);}catch(_0x2b2b0e){return BPromise[_0x8a48('0x27')](_0x2b2b0e);}return _0x4fa2b0[_0x8a48('0x28')]();};}function saveUpdates(_0x3d9bda,_0x3859d5){return function(_0x4811dd){if(_0x4811dd){return _0x4811dd[_0x8a48('0x29')](_0x3d9bda)['then'](function(_0x9b180d){return _0x9b180d;});}return null;};}function removeEntity(_0x5eb0e2,_0x3a0f2c){return function(_0x3e4892){if(_0x3e4892){return _0x3e4892[_0x8a48('0x2a')]()[_0x8a48('0x2b')](function(){var _0x4a7795=_0x3e4892[_0x8a48('0x2c')]({'plain':!![]});var _0x50cdac=_0x8a48('0x2d');return db[_0x8a48('0x2e')][_0x8a48('0x2a')]({'where':{'type':_0x50cdac,'resourceId':_0x4a7795['id']}})['then'](function(){return _0x3e4892;});})[_0x8a48('0x2b')](function(){_0x5eb0e2['status'](0xcc)[_0x8a48('0x2f')]();});}};}function handleEntityNotFound(_0x49b262,_0x3170b7){return function(_0x16b012){if(!_0x16b012){_0x49b262[_0x8a48('0x30')](0x194);}return _0x16b012;};}function handleError(_0x1493c7,_0x4ceb56){_0x4ceb56=_0x4ceb56||0x1f4;return function(_0x3dbbf8){logger[_0x8a48('0x31')](_0x3dbbf8[_0x8a48('0x32')]);if(_0x3dbbf8['name']){delete _0x3dbbf8['name'];}_0x1493c7[_0x8a48('0x1f')](_0x4ceb56)[_0x8a48('0x33')](_0x3dbbf8);};}exports[_0x8a48('0x34')]=function(_0x5e11c7,_0x5046fe){var _0x5253e7={},_0x39deec={},_0x19547f={'count':0x0,'rows':[]};var _0x47fe55=_[_0x8a48('0x35')](db['CmList'][_0x8a48('0x36')],function(_0x1b0bc3){return{'name':_0x1b0bc3[_0x8a48('0x37')],'type':_0x1b0bc3[_0x8a48('0x38')]['key']};});_0x39deec['model']=_[_0x8a48('0x35')](_0x47fe55,_0x8a48('0x39'));_0x39deec[_0x8a48('0x3a')]=_[_0x8a48('0x3b')](_0x5e11c7['query']);_0x39deec[_0x8a48('0x3c')]=_[_0x8a48('0x3d')](_0x39deec['model'],_0x39deec[_0x8a48('0x3a')]);_0x5253e7[_0x8a48('0x3e')]=_[_0x8a48('0x3d')](_0x39deec[_0x8a48('0x3f')],qs[_0x8a48('0x40')](_0x5e11c7[_0x8a48('0x3a')]['fields']));_0x5253e7[_0x8a48('0x3e')]=_0x5253e7[_0x8a48('0x3e')]['length']?_0x5253e7[_0x8a48('0x3e')]:_0x39deec[_0x8a48('0x3f')];if(!_0x5e11c7[_0x8a48('0x3a')]['hasOwnProperty'](_0x8a48('0x41'))){_0x5253e7[_0x8a48('0x22')]=qs[_0x8a48('0x22')](_0x5e11c7[_0x8a48('0x3a')]['limit']);_0x5253e7[_0x8a48('0x24')]=qs['offset'](_0x5e11c7[_0x8a48('0x3a')]['offset']);}_0x5253e7[_0x8a48('0x42')]=qs[_0x8a48('0x43')](_0x5e11c7['query']['sort']);_0x5253e7['where']=qs[_0x8a48('0x3c')](_[_0x8a48('0x44')](_0x5e11c7['query'],_0x39deec[_0x8a48('0x3c')]),_0x47fe55);if(_0x5e11c7[_0x8a48('0x3a')]['filter']){_0x5253e7['where']=_['merge'](_0x5253e7[_0x8a48('0x45')],{'$or':_[_0x8a48('0x35')](_0x47fe55,function(_0x337115){if(_0x337115[_0x8a48('0x38')]!==_0x8a48('0x46')){var _0x2af046={};_0x2af046[_0x337115[_0x8a48('0x39')]]={'$like':'%'+_0x5e11c7[_0x8a48('0x3a')][_0x8a48('0x47')]+'%'};return _0x2af046;}})});}_0x5253e7=_[_0x8a48('0x48')]({},_0x5253e7,_0x5e11c7[_0x8a48('0x49')]);var _0x4d68b9={'where':_0x5253e7[_0x8a48('0x45')]};return db[_0x8a48('0x4a')]['count'](_0x4d68b9)[_0x8a48('0x2b')](function(_0x4c240a){_0x19547f[_0x8a48('0x23')]=_0x4c240a;if(_0x5e11c7[_0x8a48('0x3a')][_0x8a48('0x4b')]){_0x5253e7[_0x8a48('0x4c')]=[{'all':!![]}];}return db[_0x8a48('0x4a')][_0x8a48('0x4d')](_0x5253e7);})[_0x8a48('0x2b')](function(_0x119032){_0x19547f[_0x8a48('0x4e')]=_0x119032;return _0x19547f;})[_0x8a48('0x2b')](respondWithFilteredResult(_0x5046fe,_0x5253e7))[_0x8a48('0x4f')](handleError(_0x5046fe,null));};exports[_0x8a48('0x50')]=function(_0x5a887d,_0x3e4aea){var _0xe63a05={'raw':![],'where':{'id':_0x5a887d[_0x8a48('0x51')]['id']}},_0x1a43c9={};_0x1a43c9[_0x8a48('0x3f')]=_[_0x8a48('0x3b')](db['CmList'][_0x8a48('0x36')]);_0x1a43c9['query']=_[_0x8a48('0x3b')](_0x5a887d['query']);_0x1a43c9[_0x8a48('0x3c')]=_[_0x8a48('0x3d')](_0x1a43c9[_0x8a48('0x3f')],_0x1a43c9[_0x8a48('0x3a')]);_0xe63a05[_0x8a48('0x3e')]=_[_0x8a48('0x3d')](_0x1a43c9[_0x8a48('0x3f')],qs[_0x8a48('0x40')](_0x5a887d[_0x8a48('0x3a')]['fields']));_0xe63a05[_0x8a48('0x3e')]=_0xe63a05['attributes'][_0x8a48('0x52')]?_0xe63a05[_0x8a48('0x3e')]:_0x1a43c9['model'];if(_0x5a887d[_0x8a48('0x3a')][_0x8a48('0x4b')]){_0xe63a05[_0x8a48('0x4c')]=[{'all':!![]}];}_0xe63a05=_[_0x8a48('0x48')]({},_0xe63a05,_0x5a887d[_0x8a48('0x49')]);return db[_0x8a48('0x4a')][_0x8a48('0x53')](_0xe63a05)['then'](handleEntityNotFound(_0x3e4aea,null))[_0x8a48('0x2b')](respondWithResult(_0x3e4aea,null))[_0x8a48('0x4f')](handleError(_0x3e4aea,null));};exports[_0x8a48('0x54')]=function(_0x47fc9b,_0x31cf78){return db['CmList'][_0x8a48('0x54')](_0x47fc9b[_0x8a48('0x55')],{})['then'](function(_0x269084){var _0x42979f=_0x47fc9b['user'][_0x8a48('0x2c')]({'plain':!![]});if(!_0x42979f)throw new Error(_0x8a48('0x56'));if(_0x42979f[_0x8a48('0x57')]==='user'){var _0x59d22d=_0x269084['get']({'plain':!![]});var _0x255e56=_0x8a48('0x2d');return db[_0x8a48('0x58')]['find']({'where':{'name':_0x255e56,'userProfileId':_0x42979f[_0x8a48('0x59')]},'raw':!![]})[_0x8a48('0x2b')](function(_0x420255){if(_0x420255&&_0x420255[_0x8a48('0x5a')]===0x0){return db[_0x8a48('0x2e')][_0x8a48('0x54')]({'name':_0x59d22d[_0x8a48('0x39')],'resourceId':_0x59d22d['id'],'type':_0x420255[_0x8a48('0x39')],'sectionId':_0x420255['id']},{})[_0x8a48('0x2b')](function(){return _0x269084;});}else{return _0x269084;}})[_0x8a48('0x4f')](function(_0x3e9ee1){logger[_0x8a48('0x31')](_0x8a48('0x5b'),_0x3e9ee1);throw _0x3e9ee1;});}return _0x269084;})[_0x8a48('0x2b')](respondWithResult(_0x31cf78,0xc9))['catch'](handleError(_0x31cf78,null));};exports['update']=function(_0x2c3f30,_0x1fcc3a){if(_0x2c3f30[_0x8a48('0x55')]['id']){delete _0x2c3f30[_0x8a48('0x55')]['id'];}return db[_0x8a48('0x4a')]['find']({'where':{'id':_0x2c3f30['params']['id']}})[_0x8a48('0x2b')](handleEntityNotFound(_0x1fcc3a,null))[_0x8a48('0x2b')](saveUpdates(_0x2c3f30['body'],null))[_0x8a48('0x2b')](respondWithResult(_0x1fcc3a,null))[_0x8a48('0x4f')](handleError(_0x1fcc3a,null));};exports['destroy']=function(_0x379f9f,_0x5cda25){return db[_0x8a48('0x4a')][_0x8a48('0x53')]({'where':{'id':_0x379f9f[_0x8a48('0x51')]['id']}})['then'](handleEntityNotFound(_0x5cda25,null))[_0x8a48('0x2b')](removeEntity(_0x5cda25,null))['catch'](handleError(_0x5cda25,null));};exports[_0x8a48('0x5c')]=function(_0x35fc50,_0x1bc50e){return db[_0x8a48('0x4a')][_0x8a48('0x5c')]()['then'](respondWithResult(_0x1bc50e,null))[_0x8a48('0x4f')](handleError(_0x1bc50e,null));};exports[_0x8a48('0x5d')]=function(_0x5b3b21,_0x2a6d2b,_0x805001){if(_0x5b3b21[_0x8a48('0x55')]['id']){delete _0x5b3b21[_0x8a48('0x55')]['id'];}return db[_0x8a48('0x4a')][_0x8a48('0x53')]({'where':{'id':_0x5b3b21['params']['id']}})[_0x8a48('0x2b')](handleEntityNotFound(_0x2a6d2b,null))[_0x8a48('0x2b')](function(_0x42d07a){if(_0x42d07a){_0x5b3b21[_0x8a48('0x55')][_0x8a48('0x5e')]=_0x42d07a['id'];return db['Disposition'][_0x8a48('0x54')](_0x5b3b21[_0x8a48('0x55')]);}})[_0x8a48('0x2b')](respondWithResult(_0x2a6d2b,null))[_0x8a48('0x4f')](handleError(_0x2a6d2b,null));};exports[_0x8a48('0x5f')]=function(_0x1c1185,_0x385d3e,_0xec72b){var _0x234501={'raw':![],'where':{}};var _0x2f6a39={};var _0x35ab44={'count':0x0,'rows':[]};return db[_0x8a48('0x4a')][_0x8a48('0x60')]({'where':{'id':_0x1c1185[_0x8a48('0x51')]['id']}})[_0x8a48('0x2b')](handleEntityNotFound(_0x385d3e,null))[_0x8a48('0x2b')](function(_0x50445e){if(_0x50445e){_0x2f6a39[_0x8a48('0x3f')]=_[_0x8a48('0x3b')](db[_0x8a48('0x61')][_0x8a48('0x36')]);_0x2f6a39[_0x8a48('0x3a')]=_[_0x8a48('0x3b')](_0x1c1185[_0x8a48('0x3a')]);_0x2f6a39[_0x8a48('0x3c')]=_[_0x8a48('0x3d')](_0x2f6a39[_0x8a48('0x3f')],_0x2f6a39[_0x8a48('0x3a')]);_0x234501[_0x8a48('0x3e')]=_[_0x8a48('0x3d')](_0x2f6a39[_0x8a48('0x3f')],qs[_0x8a48('0x40')](_0x1c1185[_0x8a48('0x3a')][_0x8a48('0x40')]));_0x234501['attributes']=_0x234501[_0x8a48('0x3e')][_0x8a48('0x52')]?_0x234501[_0x8a48('0x3e')]:_0x2f6a39[_0x8a48('0x3f')];if(!_0x1c1185[_0x8a48('0x3a')][_0x8a48('0x62')](_0x8a48('0x41'))){_0x234501[_0x8a48('0x22')]=qs[_0x8a48('0x22')](_0x1c1185[_0x8a48('0x3a')][_0x8a48('0x22')]);_0x234501[_0x8a48('0x24')]=qs[_0x8a48('0x24')](_0x1c1185[_0x8a48('0x3a')]['offset']);}_0x234501[_0x8a48('0x42')]=qs[_0x8a48('0x43')](_0x1c1185['query'][_0x8a48('0x43')]);_0x234501[_0x8a48('0x45')]=qs[_0x8a48('0x3c')](_[_0x8a48('0x44')](_0x1c1185['query'],_0x2f6a39[_0x8a48('0x3c')]));_0x234501[_0x8a48('0x45')][_0x8a48('0x5e')]=_0x50445e['id'];if(_0x1c1185['query'][_0x8a48('0x47')]){_0x234501[_0x8a48('0x45')]=_[_0x8a48('0x48')](_0x234501[_0x8a48('0x45')],{'$or':_[_0x8a48('0x35')](_0x234501[_0x8a48('0x3e')],function(_0x5e78e6){var _0x27e793={};_0x27e793[_0x5e78e6]={'$like':'%'+_0x1c1185[_0x8a48('0x3a')][_0x8a48('0x47')]+'%'};return _0x27e793;})});}_0x234501=_['merge']({},_0x234501,_0x1c1185[_0x8a48('0x49')]);return db[_0x8a48('0x61')]['count']({'where':_0x234501[_0x8a48('0x45')]})[_0x8a48('0x2b')](function(_0x196e17){_0x35ab44['count']=_0x196e17;if(_0x1c1185[_0x8a48('0x3a')][_0x8a48('0x4b')]){_0x234501[_0x8a48('0x4c')]=[{'all':!![]}];}return db[_0x8a48('0x61')][_0x8a48('0x4d')](_0x234501);})['then'](function(_0x43249a){_0x35ab44[_0x8a48('0x4e')]=_0x43249a;return _0x35ab44;});}})[_0x8a48('0x2b')](respondWithFilteredResult(_0x385d3e,_0x234501))[_0x8a48('0x4f')](handleError(_0x385d3e,null));};exports[_0x8a48('0x63')]=function(_0x57cfdd,_0x935dae,_0x188dad){return db[_0x8a48('0x4a')]['find']({'where':{'id':_0x57cfdd[_0x8a48('0x51')]['id']}})[_0x8a48('0x2b')](handleEntityNotFound(_0x935dae,null))[_0x8a48('0x2b')](function(_0x485397){if(_0x485397){return _0x485397[_0x8a48('0x63')](_0x57cfdd['query'][_0x8a48('0x64')]);}})[_0x8a48('0x2b')](respondWithStatusCode(_0x935dae,null))[_0x8a48('0x4f')](handleError(_0x935dae,null));};exports['addContacts']=function(_0x17e2ac,_0x1e1279,_0x13f167){return db[_0x8a48('0x4a')][_0x8a48('0x53')]({'where':{'id':_0x17e2ac[_0x8a48('0x51')]['id']}})[_0x8a48('0x2b')](handleEntityNotFound(_0x1e1279,null))[_0x8a48('0x2b')](function(_0x595b31){if(_0x595b31){var _0x5005f0=[];var _0x579a2c={'success':[],'errors':[]};return db[_0x8a48('0x65')][_0x8a48('0x5c')]()[_0x8a48('0x2b')](function(_0x19a08d){if(_0x17e2ac[_0x8a48('0x55')][_0x8a48('0x66')]&&_[_0x8a48('0x67')](_0x17e2ac[_0x8a48('0x55')][_0x8a48('0x66')])){if(_0x17e2ac[_0x8a48('0x55')][_0x8a48('0x66')][_0x8a48('0x52')]){_0x17e2ac[_0x8a48('0x55')][_0x8a48('0x66')]=_0x17e2ac['body'][_0x8a48('0x66')][_0x8a48('0x68')](';')+';';}else{_0x17e2ac[_0x8a48('0x55')][_0x8a48('0x66')]=null;}}else{_0x17e2ac['body'][_0x8a48('0x66')]=null;}if(_0x17e2ac[_0x8a48('0x55')]&&_['isArray'](_0x17e2ac['body'])){for(var _0x34147a=0x0;_0x34147a<_0x17e2ac[_0x8a48('0x55')][_0x8a48('0x52')];_0x34147a+=0x1){_0x17e2ac[_0x8a48('0x55')][_0x34147a][_0x8a48('0x5e')]=_0x17e2ac['params']['id'];_0x5005f0[_0x8a48('0x69')](_0x17e2ac[_0x8a48('0x55')][_0x34147a]);}return BPromise[_0x8a48('0x6a')](_0x5005f0,function(_0x25c403){return db[_0x8a48('0x65')][_0x8a48('0x54')](_[_0x8a48('0x6b')](_0x25c403,['ids','id'])||{},{'fields':_[_0x8a48('0x3b')](_0x19a08d),'raw':!![]})[_0x8a48('0x2b')](function(_0x4be4e6){_0x579a2c[_0x8a48('0x6c')]['push'](_0x4be4e6[_0x8a48('0x6d')]);})[_0x8a48('0x4f')](function(_0x4bdb2d){_0x579a2c[_0x8a48('0x6e')][_0x8a48('0x69')]({'data':_0x25c403,'error':_0x4bdb2d[_0x8a48('0x6f')]});});})[_0x8a48('0x2b')](function(_0x54500b){return _0x579a2c;})[_0x8a48('0x4f')](function(_0x3bbb5e){return _0x3bbb5e;});}else{_0x1e1279[_0x8a48('0x1f')](0x190)[_0x8a48('0x20')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x8a48('0x2b')](respondWithResult(_0x1e1279,null))['catch'](handleError(_0x1e1279,null));};exports[_0x8a48('0x70')]=function(_0x4788cd,_0x1d5d3e,_0x57c757){var _0x33234c;return db[_0x8a48('0x4a')][_0x8a48('0x53')]({'where':{'id':_0x4788cd[_0x8a48('0x51')]['id']},'include':[{'model':db[_0x8a48('0x71')],'as':_0x8a48('0x72')}]})[_0x8a48('0x2b')](handleEntityNotFound(_0x1d5d3e,null))['then'](function(_0x50453c){if(_0x50453c){_0x33234c=_0x50453c;return db[_0x8a48('0x65')][_0x8a48('0x36')];}})[_0x8a48('0x2b')](function(_0x3e9c19){if(_0x3e9c19){var _0x3718ca={};var _0x3aa90c={};_0x3aa90c[_0x8a48('0x3f')]=_['concat'](_[_0x8a48('0x3b')](_0x3e9c19),_[_0x8a48('0x35')](_0x33234c['CustomFields'],function(_0x388284){return util[_0x8a48('0x73')](_0x8a48('0x74'),_0x388284['id']);}));_0x3aa90c[_0x8a48('0x3a')]=_['keys'](_0x4788cd['query']);_0x3aa90c['filters']=_[_0x8a48('0x3d')](_0x3aa90c[_0x8a48('0x3f')],_0x3aa90c[_0x8a48('0x3a')]);_0x3718ca[_0x8a48('0x3e')]=_['intersection'](_0x3aa90c[_0x8a48('0x3f')],qs[_0x8a48('0x40')](_0x4788cd[_0x8a48('0x3a')]['fields']));_0x3718ca['attributes']=_0x3718ca[_0x8a48('0x3e')][_0x8a48('0x52')]?_0x3718ca[_0x8a48('0x3e')]:_0x3aa90c[_0x8a48('0x3f')];if(!_0x4788cd[_0x8a48('0x3a')][_0x8a48('0x62')](_0x8a48('0x41'))){_0x3718ca[_0x8a48('0x22')]=qs['limit'](_0x4788cd[_0x8a48('0x3a')][_0x8a48('0x22')]);_0x3718ca[_0x8a48('0x24')]=qs[_0x8a48('0x24')](_0x4788cd[_0x8a48('0x3a')][_0x8a48('0x24')]);}_0x3718ca[_0x8a48('0x42')]=qs[_0x8a48('0x43')](_0x4788cd[_0x8a48('0x3a')]['sort']);_0x3718ca[_0x8a48('0x45')]=qs['filters'](_[_0x8a48('0x44')](_0x4788cd[_0x8a48('0x3a')],_0x3aa90c[_0x8a48('0x3c')]));_0x3718ca[_0x8a48('0x75')]=!![];if(_0x4788cd['query'][_0x8a48('0x47')]){_0x3718ca[_0x8a48('0x45')]=_['merge'](_0x3718ca[_0x8a48('0x45')],{'$or':_[_0x8a48('0x35')](_0x3718ca[_0x8a48('0x3e')],function(_0x5d7fea){var _0x6752df={};_0x6752df[_0x5d7fea]={'$like':'%'+_0x4788cd['query'][_0x8a48('0x47')]+'%'};return _0x6752df;})});}_0x3718ca=_[_0x8a48('0x48')]({},_0x3718ca,_0x4788cd[_0x8a48('0x49')]);return _0x33234c[_0x8a48('0x70')](_0x3718ca);}})[_0x8a48('0x2b')](respondWithResult(_0x1d5d3e,null))[_0x8a48('0x4f')](handleError(_0x1d5d3e,null));};exports[_0x8a48('0x76')]=function(_0x47b8ae,_0x14ece3,_0x1e827a){var _0x2272c5;return db[_0x8a48('0x4a')][_0x8a48('0x53')]({'where':{'id':_0x47b8ae[_0x8a48('0x51')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x8a48('0x2b')](handleEntityNotFound(_0x14ece3,null))['then'](function(_0x33317b){if(_0x33317b){_0x2272c5=_0x33317b;return db[_0x8a48('0x65')][_0x8a48('0x36')];}})[_0x8a48('0x2b')](function(_0x4e103d){if(_0x4e103d){var _0x30d4e0={};var _0x3e37f2={};_0x3e37f2[_0x8a48('0x3f')]=_['concat'](_['keys'](_0x4e103d),_[_0x8a48('0x35')](_0x2272c5[_0x8a48('0x72')],function(_0x2cbed7){return util[_0x8a48('0x73')](_0x8a48('0x74'),_0x2cbed7['id']);}));_0x3e37f2[_0x8a48('0x3a')]=_[_0x8a48('0x3b')](_0x47b8ae['query']);_0x3e37f2['filters']=_[_0x8a48('0x3d')](_0x3e37f2[_0x8a48('0x3f')],_0x3e37f2[_0x8a48('0x3a')]);_0x30d4e0[_0x8a48('0x3e')]=_['intersection'](_0x3e37f2['model'],qs[_0x8a48('0x40')](_0x47b8ae['query'][_0x8a48('0x40')]));_0x30d4e0[_0x8a48('0x3e')]=_0x30d4e0[_0x8a48('0x3e')][_0x8a48('0x52')]?_0x30d4e0[_0x8a48('0x3e')]:_0x3e37f2[_0x8a48('0x3f')];if(!_0x47b8ae['query']['hasOwnProperty'](_0x8a48('0x41'))){_0x30d4e0['limit']=qs[_0x8a48('0x22')](_0x47b8ae['query'][_0x8a48('0x22')]);_0x30d4e0[_0x8a48('0x24')]=qs[_0x8a48('0x24')](_0x47b8ae[_0x8a48('0x3a')][_0x8a48('0x24')]);}_0x30d4e0[_0x8a48('0x42')]=qs[_0x8a48('0x43')](_0x47b8ae['query'][_0x8a48('0x43')]);_0x30d4e0['where']=qs[_0x8a48('0x3c')](_[_0x8a48('0x44')](_0x47b8ae[_0x8a48('0x3a')],_0x3e37f2[_0x8a48('0x3c')]));_0x30d4e0['raw']=!![];if(_0x47b8ae[_0x8a48('0x3a')][_0x8a48('0x47')]){_0x30d4e0[_0x8a48('0x45')]=_[_0x8a48('0x48')](_0x30d4e0[_0x8a48('0x45')],{'$or':_[_0x8a48('0x35')](_0x30d4e0[_0x8a48('0x3e')],function(_0x5bd003){var _0x3ca064={};_0x3ca064[_0x5bd003]={'$like':'%'+_0x47b8ae[_0x8a48('0x3a')]['filter']+'%'};return _0x3ca064;})});}_0x30d4e0=_[_0x8a48('0x48')]({},_0x30d4e0,_0x47b8ae[_0x8a48('0x49')]);return _0x2272c5[_0x8a48('0x70')](_0x30d4e0);}})[_0x8a48('0x2b')](function(_0x4a6a3e){if(!_[_0x8a48('0x77')](_0x4a6a3e)){var _0x4a23ec=toCsv(_0x4a6a3e);var _0x4b5379=Date['now']();fs[_0x8a48('0x78')](util['format']('/tmp/list_%d_%s.csv',_0x2272c5['id'],_0x4b5379),_0x4a23ec);_0x14ece3['setHeader']('Content-disposition',_0x8a48('0x79')+util[_0x8a48('0x73')](_0x8a48('0x7a'),_0x2272c5['id'],_0x4b5379));_0x14ece3[_0x8a48('0x7b')](_0x8a48('0x7c'),'text/csv');return _0x14ece3[_0x8a48('0x7d')](util['format'](_0x8a48('0x7e'),_0x2272c5['id'],_0x4b5379));}else{return _0x14ece3[_0x8a48('0x30')](0xcc);}})[_0x8a48('0x4f')](handleError(_0x14ece3,null));};exports[_0x8a48('0x7f')]=function(_0x39f626,_0x25201c,_0x43b383){var _0x401708;delete _0x39f626[_0x8a48('0x55')]['id'];return db['CmList'][_0x8a48('0x60')]({'where':{'id':_0x39f626[_0x8a48('0x51')]['id']}})[_0x8a48('0x2b')](handleEntityNotFound(_0x25201c,null))['then'](function(_0x487ac8){if(_0x487ac8){return db[_0x8a48('0x80')][_0x8a48('0x81')](function(_0x3e0e88){return db[_0x8a48('0x71')]['create'](_0x39f626['body'],{'transaction':_0x3e0e88})[_0x8a48('0x2b')](function(_0x33bd92){_0x401708=_0x33bd92;return _0x487ac8[_0x8a48('0x82')](_0x33bd92,{'transaction':_0x3e0e88});})[_0x8a48('0x2b')](function(){var _0x3fddca={'type':db['Sequelize'][_0x8a48('0x83')],'transaction':_0x3e0e88};switch(_0x39f626[_0x8a48('0x55')][_0x8a48('0x38')]){case'text':_0x3fddca[_0x8a48('0x38')]=db['Sequelize'][_0x8a48('0x83')];break;case _0x8a48('0x84'):_0x3fddca[_0x8a48('0x38')]=db[_0x8a48('0x85')][_0x8a48('0x86')];break;case _0x8a48('0x87'):_0x3fddca[_0x8a48('0x38')]=db[_0x8a48('0x85')][_0x8a48('0x88')];_0x3fddca[_0x8a48('0x89')]=![];break;default:}return db[_0x8a48('0x80')][_0x8a48('0x8a')][_0x8a48('0x8b')]('cm_contacts',util[_0x8a48('0x73')](_0x8a48('0x8c'),_0x401708['id']),_0x3fddca);})['then'](function(){return _0x401708;});});}})[_0x8a48('0x2b')](respondWithResult(_0x25201c,null))[_0x8a48('0x4f')](handleError(_0x25201c,null));};exports[_0x8a48('0x8d')]=function(_0x45e312,_0x43a8d3,_0x2d2837){var _0x286c4b={};var _0x446610={};var _0x1dbe63;var _0x3de682;return db['CmList']['findOne']({'where':{'id':_0x45e312[_0x8a48('0x51')]['id']}})['then'](handleEntityNotFound(_0x43a8d3,null))[_0x8a48('0x2b')](function(_0x2c69ee){if(_0x2c69ee){_0x1dbe63=_0x2c69ee;_0x446610[_0x8a48('0x3f')]=_[_0x8a48('0x3b')](db[_0x8a48('0x71')]['rawAttributes']);_0x446610[_0x8a48('0x3a')]=_['keys'](_0x45e312['query']);_0x446610['filters']=_[_0x8a48('0x3d')](_0x446610['model'],_0x446610[_0x8a48('0x3a')]);_0x286c4b[_0x8a48('0x3e')]=_['intersection'](_0x446610[_0x8a48('0x3f')],qs[_0x8a48('0x40')](_0x45e312[_0x8a48('0x3a')][_0x8a48('0x40')]));_0x286c4b[_0x8a48('0x3e')]=_0x286c4b[_0x8a48('0x3e')]['length']?_0x286c4b[_0x8a48('0x3e')]:_0x446610['model'];_0x286c4b['order']=qs[_0x8a48('0x43')](_0x45e312[_0x8a48('0x3a')][_0x8a48('0x43')]);_0x286c4b[_0x8a48('0x45')]=qs[_0x8a48('0x3c')](_[_0x8a48('0x44')](_0x45e312[_0x8a48('0x3a')],_0x446610[_0x8a48('0x3c')]));_0x286c4b[_0x8a48('0x45')]=_['merge'](_0x286c4b[_0x8a48('0x45')],{'$or':[{'ListId':_0x2c69ee['id']},{'ListId':null}]});if(_0x45e312[_0x8a48('0x3a')]['filter']){_0x286c4b['where']=_[_0x8a48('0x48')](_0x286c4b[_0x8a48('0x45')],{'$or':_['map'](_0x286c4b[_0x8a48('0x3e')],function(_0x2fc7c8){var _0x31258e={};_0x31258e[_0x2fc7c8]={'$like':'%'+_0x45e312['query'][_0x8a48('0x47')]+'%'};return _0x31258e;})});}_0x286c4b=_[_0x8a48('0x48')]({},_0x286c4b,_0x45e312[_0x8a48('0x49')]);return db['CmCustomField']['findAndCountAll'](_0x286c4b);}})[_0x8a48('0x2b')](respondWithResult(_0x43a8d3,null))['catch'](handleError(_0x43a8d3,null));};exports[_0x8a48('0x8e')]=function(_0x3a6950,_0x3ccb6e,_0x388945){return db[_0x8a48('0x4a')][_0x8a48('0x53')]({'where':{'id':_0x3a6950[_0x8a48('0x51')]['id']}})[_0x8a48('0x2b')](handleEntityNotFound(_0x3ccb6e,null))[_0x8a48('0x2b')](function(_0x257b31){if(_0x257b31){return _0x257b31[_0x8a48('0x8e')](_0x3a6950['body']['ids'],_[_0x8a48('0x6b')](_0x3a6950[_0x8a48('0x55')],[_0x8a48('0x64'),'id'])||{})[_0x8a48('0x8f')](function(_0x47c035){for(var _0xdaf519=0x0;_0xdaf519<_0x3a6950[_0x8a48('0x55')][_0x8a48('0x64')][_0x8a48('0x52')];_0xdaf519+=0x1){socket[_0x8a48('0x90')]('userCmList:save',{'UserId':Number(_0x3a6950['body'][_0x8a48('0x64')][_0xdaf519]),'CmListId':Number(_0x3a6950['params']['id'])});}return _0x47c035;});}})[_0x8a48('0x2b')](respondWithResult(_0x3ccb6e,null))[_0x8a48('0x4f')](handleError(_0x3ccb6e,null));};exports[_0x8a48('0x91')]=function(_0x379d21,_0x237d86,_0x244b71){return db[_0x8a48('0x4a')]['find']({'where':{'id':_0x379d21[_0x8a48('0x51')]['id']}})[_0x8a48('0x2b')](handleEntityNotFound(_0x237d86,null))[_0x8a48('0x2b')](function(_0x4698a4){if(_0x4698a4){return _0x4698a4['removeAgents'](_0x379d21[_0x8a48('0x3a')][_0x8a48('0x64')])['then'](function(){if(_['isArray'](_0x379d21[_0x8a48('0x3a')][_0x8a48('0x64')])){for(var _0x1309e8=0x0;_0x1309e8<_0x379d21[_0x8a48('0x3a')][_0x8a48('0x64')][_0x8a48('0x52')];_0x1309e8+=0x1){socket[_0x8a48('0x90')](_0x8a48('0x92'),{'UserId':Number(_0x379d21[_0x8a48('0x3a')][_0x8a48('0x64')][_0x1309e8]),'CmListId':Number(_0x379d21['params']['id'])});}}else{socket[_0x8a48('0x90')](_0x8a48('0x92'),{'UserId':Number(_0x379d21[_0x8a48('0x3a')][_0x8a48('0x64')]),'CmListId':Number(_0x379d21[_0x8a48('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x237d86,null))['catch'](handleError(_0x237d86,null));};exports[_0x8a48('0x93')]=function(_0x1e0bc7,_0xc4baa8,_0x4a028c){var _0x2f92ed={};var _0x5efd48={};var _0x3135ec;var _0x269cf5;return db[_0x8a48('0x4a')][_0x8a48('0x60')]({'where':{'id':_0x1e0bc7[_0x8a48('0x51')]['id']}})[_0x8a48('0x2b')](handleEntityNotFound(_0xc4baa8,null))['then'](function(_0x2fec10){if(_0x2fec10){_0x3135ec=_0x2fec10;_0x5efd48[_0x8a48('0x3f')]=_[_0x8a48('0x3b')](db['User'][_0x8a48('0x36')]);_0x5efd48['query']=_[_0x8a48('0x3b')](_0x1e0bc7['query']);_0x5efd48[_0x8a48('0x3c')]=_[_0x8a48('0x3d')](_0x5efd48['model'],_0x5efd48[_0x8a48('0x3a')]);_0x2f92ed['attributes']=_[_0x8a48('0x3d')](_0x5efd48[_0x8a48('0x3f')],qs[_0x8a48('0x40')](_0x1e0bc7[_0x8a48('0x3a')]['fields']));_0x2f92ed[_0x8a48('0x3e')]=_0x2f92ed[_0x8a48('0x3e')]['length']?_0x2f92ed[_0x8a48('0x3e')]:_0x5efd48[_0x8a48('0x3f')];_0x2f92ed[_0x8a48('0x42')]=qs['sort'](_0x1e0bc7[_0x8a48('0x3a')]['sort']);_0x2f92ed[_0x8a48('0x45')]=qs['filters'](_[_0x8a48('0x44')](_0x1e0bc7[_0x8a48('0x3a')],_0x5efd48['filters']));if(_0x1e0bc7[_0x8a48('0x3a')][_0x8a48('0x47')]){_0x2f92ed['where']=_['merge'](_0x2f92ed['where'],{'$or':_[_0x8a48('0x35')](_0x2f92ed[_0x8a48('0x3e')],function(_0x22a00f){var _0x322de8={};_0x322de8[_0x22a00f]={'$like':'%'+_0x1e0bc7[_0x8a48('0x3a')][_0x8a48('0x47')]+'%'};return _0x322de8;})});}_0x2f92ed=_[_0x8a48('0x48')]({},_0x2f92ed,_0x1e0bc7[_0x8a48('0x49')]);return _0x3135ec[_0x8a48('0x93')](_0x2f92ed);}})[_0x8a48('0x2b')](function(_0x500cf7){if(_0x500cf7){_0x269cf5=_0x500cf7['length'];if(!_0x1e0bc7[_0x8a48('0x3a')][_0x8a48('0x62')]('nolimit')){_0x2f92ed[_0x8a48('0x22')]=qs['limit'](_0x1e0bc7[_0x8a48('0x3a')]['limit']);_0x2f92ed['offset']=qs[_0x8a48('0x24')](_0x1e0bc7['query'][_0x8a48('0x24')]);}return _0x3135ec[_0x8a48('0x93')](_0x2f92ed);}})['then'](function(_0xfd4676){if(_0xfd4676){return _0xfd4676?{'count':_0x269cf5,'rows':_0xfd4676}:null;}})['then'](respondWithResult(_0xc4baa8,null))[_0x8a48('0x4f')](handleError(_0xc4baa8,null));}; \ No newline at end of file +var _0x1455=['UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','where','pick','filter','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','ListId','push','each','success','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','map','cf_%d','raw','getContacts','format','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','addCustomFields','Sequelize','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','Lists','UserProfileResource','error','stack','name','send','CmList','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','length','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x14915a,_0x222f6b){var _0x2f683c=function(_0x28e694){while(--_0x28e694){_0x14915a['push'](_0x14915a['shift']());}};_0x2f683c(++_0x222f6b);}(_0x1455,0xda));var _0x5145=function(_0x4bd5f0,_0x101b89){_0x4bd5f0=_0x4bd5f0-0x0;var _0x4bc737=_0x1455[_0x4bd5f0];return _0x4bc737;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5145('0x0'));var zipdir=require(_0x5145('0x1'));var jsonpatch=require(_0x5145('0x2'));var rp=require(_0x5145('0x3'));var moment=require(_0x5145('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5145('0x5'));var util=require(_0x5145('0x6'));var path=require(_0x5145('0x7'));var sox=require(_0x5145('0x8'));var csv=require(_0x5145('0x9'));var ejs=require(_0x5145('0xa'));var fs=require('fs');var fs_extra=require(_0x5145('0xb'));var _=require(_0x5145('0xc'));var squel=require(_0x5145('0xd'));var crypto=require(_0x5145('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5145('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5145('0x10'));var Papa=require(_0x5145('0x11'));var Redis=require('ioredis');var authService=require(_0x5145('0x12'));var qs=require(_0x5145('0x13'));var as=require(_0x5145('0x14'));var hardwareService=require(_0x5145('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5145('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5145('0x17'));var db=require(_0x5145('0x18'))['db'];config['redis']=_[_0x5145('0x19')](config['redis'],{'host':_0x5145('0x1a'),'port':0x18eb});var socket=require(_0x5145('0x1b'))(new Redis(config[_0x5145('0x1c')]));require(_0x5145('0x1d'))[_0x5145('0x1e')](socket);function respondWithStatusCode(_0x345fdf,_0x2d1dc3){_0x2d1dc3=_0x2d1dc3||0xcc;return function(_0x13d54a){if(_0x13d54a){return _0x345fdf[_0x5145('0x1f')](_0x2d1dc3);}return _0x345fdf[_0x5145('0x20')](_0x2d1dc3)[_0x5145('0x21')]();};}function respondWithResult(_0x4cdf7e,_0x39ee2c){_0x39ee2c=_0x39ee2c||0xc8;return function(_0x5da451){if(_0x5da451){return _0x4cdf7e['status'](_0x39ee2c)[_0x5145('0x22')](_0x5da451);}};}function respondWithFilteredResult(_0xb576e7,_0x34791d){return function(_0x407950){if(_0x407950){var _0x5ccd25=typeof _0x34791d[_0x5145('0x23')]===_0x5145('0x24')&&typeof _0x34791d['limit']===_0x5145('0x24');var _0x5185a7=_0x407950[_0x5145('0x25')];var _0xdc2b9f=_0x5ccd25?0x0:_0x34791d[_0x5145('0x23')];var _0x134b3e=_0x5ccd25?_0x407950['count']:_0x34791d['offset']+_0x34791d[_0x5145('0x26')];var _0xa4533f;if(_0x134b3e>=_0x5185a7){_0x134b3e=_0x5185a7;_0xa4533f=0xc8;}else{_0xa4533f=0xce;}_0xb576e7['status'](_0xa4533f);return _0xb576e7[_0x5145('0x27')](_0x5145('0x28'),_0xdc2b9f+'-'+_0x134b3e+'/'+_0x5185a7)['json'](_0x407950);}return null;};}function patchUpdates(_0x2c680e){return function(_0x36e26d){try{jsonpatch[_0x5145('0x29')](_0x36e26d,_0x2c680e,!![]);}catch(_0x3521b1){return BPromise['reject'](_0x3521b1);}return _0x36e26d[_0x5145('0x2a')]();};}function saveUpdates(_0x3e5d03,_0x50d5ca){return function(_0x382e41){if(_0x382e41){return _0x382e41[_0x5145('0x2b')](_0x3e5d03)[_0x5145('0x2c')](function(_0x75fbf2){return _0x75fbf2;});}return null;};}function removeEntity(_0x5ac7a8,_0x459d83){return function(_0x326ffb){if(_0x326ffb){return _0x326ffb[_0x5145('0x2d')]()[_0x5145('0x2c')](function(){var _0x27ad3c=_0x326ffb['get']({'plain':!![]});var _0x1916d3=_0x5145('0x2e');return db[_0x5145('0x2f')][_0x5145('0x2d')]({'where':{'type':_0x1916d3,'resourceId':_0x27ad3c['id']}})[_0x5145('0x2c')](function(){return _0x326ffb;});})['then'](function(){_0x5ac7a8[_0x5145('0x20')](0xcc)[_0x5145('0x21')]();});}};}function handleEntityNotFound(_0x29f63e,_0xfdd3a6){return function(_0x1a361e){if(!_0x1a361e){_0x29f63e[_0x5145('0x1f')](0x194);}return _0x1a361e;};}function handleError(_0x1bac32,_0xb77190){_0xb77190=_0xb77190||0x1f4;return function(_0x2b731d){logger[_0x5145('0x30')](_0x2b731d[_0x5145('0x31')]);if(_0x2b731d['name']){delete _0x2b731d[_0x5145('0x32')];}_0x1bac32[_0x5145('0x20')](_0xb77190)[_0x5145('0x33')](_0x2b731d);};}exports['index']=function(_0x1a9ec0,_0x344c29){var _0xf4a46a={},_0x3e8616={},_0x5e2f28={'count':0x0,'rows':[]};var _0x10a2cc=_['map'](db[_0x5145('0x34')][_0x5145('0x35')],function(_0x48877f){return{'name':_0x48877f[_0x5145('0x36')],'type':_0x48877f['type'][_0x5145('0x37')]};});_0x3e8616[_0x5145('0x38')]=_['map'](_0x10a2cc,_0x5145('0x32'));_0x3e8616[_0x5145('0x39')]=_['keys'](_0x1a9ec0[_0x5145('0x39')]);_0x3e8616[_0x5145('0x3a')]=_[_0x5145('0x3b')](_0x3e8616[_0x5145('0x38')],_0x3e8616[_0x5145('0x39')]);_0xf4a46a[_0x5145('0x3c')]=_[_0x5145('0x3b')](_0x3e8616[_0x5145('0x38')],qs[_0x5145('0x3d')](_0x1a9ec0[_0x5145('0x39')][_0x5145('0x3d')]));_0xf4a46a[_0x5145('0x3c')]=_0xf4a46a['attributes']['length']?_0xf4a46a[_0x5145('0x3c')]:_0x3e8616[_0x5145('0x38')];if(!_0x1a9ec0[_0x5145('0x39')][_0x5145('0x3e')](_0x5145('0x3f'))){_0xf4a46a[_0x5145('0x26')]=qs['limit'](_0x1a9ec0[_0x5145('0x39')][_0x5145('0x26')]);_0xf4a46a[_0x5145('0x23')]=qs['offset'](_0x1a9ec0[_0x5145('0x39')][_0x5145('0x23')]);}_0xf4a46a[_0x5145('0x40')]=qs[_0x5145('0x41')](_0x1a9ec0[_0x5145('0x39')][_0x5145('0x41')]);_0xf4a46a['where']=qs[_0x5145('0x3a')](_['pick'](_0x1a9ec0[_0x5145('0x39')],_0x3e8616[_0x5145('0x3a')]),_0x10a2cc);if(_0x1a9ec0[_0x5145('0x39')]['filter']){_0xf4a46a['where']=_['merge'](_0xf4a46a['where'],{'$or':_['map'](_0x10a2cc,function(_0x3f4724){if(_0x3f4724[_0x5145('0x42')]!==_0x5145('0x43')){var _0xef6af9={};_0xef6af9[_0x3f4724[_0x5145('0x32')]]={'$like':'%'+_0x1a9ec0[_0x5145('0x39')]['filter']+'%'};return _0xef6af9;}})});}_0xf4a46a=_['merge']({},_0xf4a46a,_0x1a9ec0[_0x5145('0x44')]);var _0x40d671={'where':_0xf4a46a['where']};return db[_0x5145('0x34')][_0x5145('0x25')](_0x40d671)[_0x5145('0x2c')](function(_0x4f38f7){_0x5e2f28[_0x5145('0x25')]=_0x4f38f7;if(_0x1a9ec0[_0x5145('0x39')][_0x5145('0x45')]){_0xf4a46a[_0x5145('0x46')]=[{'all':!![]}];}return db[_0x5145('0x34')][_0x5145('0x47')](_0xf4a46a);})[_0x5145('0x2c')](function(_0x14044e){_0x5e2f28[_0x5145('0x48')]=_0x14044e;return _0x5e2f28;})[_0x5145('0x2c')](respondWithFilteredResult(_0x344c29,_0xf4a46a))[_0x5145('0x49')](handleError(_0x344c29,null));};exports['show']=function(_0x59de22,_0x31e0f4){var _0x2ae7dc={'raw':![],'where':{'id':_0x59de22['params']['id']}},_0x2c6c1f={};_0x2c6c1f[_0x5145('0x38')]=_[_0x5145('0x4a')](db['CmList'][_0x5145('0x35')]);_0x2c6c1f['query']=_['keys'](_0x59de22['query']);_0x2c6c1f[_0x5145('0x3a')]=_['intersection'](_0x2c6c1f[_0x5145('0x38')],_0x2c6c1f['query']);_0x2ae7dc[_0x5145('0x3c')]=_[_0x5145('0x3b')](_0x2c6c1f['model'],qs[_0x5145('0x3d')](_0x59de22[_0x5145('0x39')][_0x5145('0x3d')]));_0x2ae7dc[_0x5145('0x3c')]=_0x2ae7dc['attributes'][_0x5145('0x4b')]?_0x2ae7dc[_0x5145('0x3c')]:_0x2c6c1f[_0x5145('0x38')];if(_0x59de22[_0x5145('0x39')][_0x5145('0x45')]){_0x2ae7dc[_0x5145('0x46')]=[{'all':!![]}];}_0x2ae7dc=_[_0x5145('0x4c')]({},_0x2ae7dc,_0x59de22['options']);return db['CmList'][_0x5145('0x4d')](_0x2ae7dc)[_0x5145('0x2c')](handleEntityNotFound(_0x31e0f4,null))[_0x5145('0x2c')](respondWithResult(_0x31e0f4,null))[_0x5145('0x49')](handleError(_0x31e0f4,null));};exports['create']=function(_0x4697e6,_0x14a6c6){return db[_0x5145('0x34')][_0x5145('0x4e')](_0x4697e6[_0x5145('0x4f')],{})[_0x5145('0x2c')](function(_0x5ccb16){var _0xc14e1d=_0x4697e6[_0x5145('0x50')][_0x5145('0x51')]({'plain':!![]});if(!_0xc14e1d)throw new Error(_0x5145('0x52'));if(_0xc14e1d[_0x5145('0x53')]===_0x5145('0x50')){var _0xf40bf6=_0x5ccb16[_0x5145('0x51')]({'plain':!![]});var _0x1e64bb=_0x5145('0x2e');return db[_0x5145('0x54')][_0x5145('0x4d')]({'where':{'name':_0x1e64bb,'userProfileId':_0xc14e1d['userProfileId']},'raw':!![]})['then'](function(_0x3d2d8c){if(_0x3d2d8c&&_0x3d2d8c['autoAssociation']===0x0){return db['UserProfileResource'][_0x5145('0x4e')]({'name':_0xf40bf6[_0x5145('0x32')],'resourceId':_0xf40bf6['id'],'type':_0x3d2d8c[_0x5145('0x32')],'sectionId':_0x3d2d8c['id']},{})[_0x5145('0x2c')](function(){return _0x5ccb16;});}else{return _0x5ccb16;}})[_0x5145('0x49')](function(_0x4f7410){logger[_0x5145('0x30')](_0x5145('0x55'),_0x4f7410);throw _0x4f7410;});}return _0x5ccb16;})[_0x5145('0x2c')](respondWithResult(_0x14a6c6,0xc9))[_0x5145('0x49')](handleError(_0x14a6c6,null));};exports[_0x5145('0x2b')]=function(_0x542087,_0x5ea9c1){if(_0x542087['body']['id']){delete _0x542087[_0x5145('0x4f')]['id'];}return db[_0x5145('0x34')][_0x5145('0x4d')]({'where':{'id':_0x542087[_0x5145('0x56')]['id']}})[_0x5145('0x2c')](handleEntityNotFound(_0x5ea9c1,null))[_0x5145('0x2c')](saveUpdates(_0x542087['body'],null))[_0x5145('0x2c')](respondWithResult(_0x5ea9c1,null))[_0x5145('0x49')](handleError(_0x5ea9c1,null));};exports[_0x5145('0x2d')]=function(_0x428f01,_0x2a75dd){return db['CmList']['find']({'where':{'id':_0x428f01[_0x5145('0x56')]['id']}})['then'](handleEntityNotFound(_0x2a75dd,null))[_0x5145('0x2c')](removeEntity(_0x2a75dd,null))['catch'](handleError(_0x2a75dd,null));};exports['describe']=function(_0x19aa83,_0x5d5e38){return db[_0x5145('0x34')][_0x5145('0x57')]()[_0x5145('0x2c')](respondWithResult(_0x5d5e38,null))[_0x5145('0x49')](handleError(_0x5d5e38,null));};exports[_0x5145('0x58')]=function(_0x1952b4,_0x50418a,_0x5936d8){if(_0x1952b4[_0x5145('0x4f')]['id']){delete _0x1952b4[_0x5145('0x4f')]['id'];}return db[_0x5145('0x34')]['find']({'where':{'id':_0x1952b4[_0x5145('0x56')]['id']}})[_0x5145('0x2c')](handleEntityNotFound(_0x50418a,null))[_0x5145('0x2c')](function(_0x687737){if(_0x687737){_0x1952b4[_0x5145('0x4f')]['ListId']=_0x687737['id'];return db[_0x5145('0x59')][_0x5145('0x4e')](_0x1952b4['body']);}})[_0x5145('0x2c')](respondWithResult(_0x50418a,null))[_0x5145('0x49')](handleError(_0x50418a,null));};exports[_0x5145('0x5a')]=function(_0x1ed955,_0x4bb50a,_0x4e47d7){var _0x42013b={'raw':![],'where':{}};var _0x375554={};var _0x3fdb9b={'count':0x0,'rows':[]};return db[_0x5145('0x34')][_0x5145('0x5b')]({'where':{'id':_0x1ed955['params']['id']}})[_0x5145('0x2c')](handleEntityNotFound(_0x4bb50a,null))['then'](function(_0x311ea2){if(_0x311ea2){_0x375554[_0x5145('0x38')]=_['keys'](db['Disposition']['rawAttributes']);_0x375554['query']=_['keys'](_0x1ed955['query']);_0x375554[_0x5145('0x3a')]=_[_0x5145('0x3b')](_0x375554['model'],_0x375554['query']);_0x42013b[_0x5145('0x3c')]=_[_0x5145('0x3b')](_0x375554['model'],qs[_0x5145('0x3d')](_0x1ed955['query']['fields']));_0x42013b[_0x5145('0x3c')]=_0x42013b['attributes'][_0x5145('0x4b')]?_0x42013b[_0x5145('0x3c')]:_0x375554['model'];if(!_0x1ed955[_0x5145('0x39')][_0x5145('0x3e')](_0x5145('0x3f'))){_0x42013b[_0x5145('0x26')]=qs[_0x5145('0x26')](_0x1ed955[_0x5145('0x39')]['limit']);_0x42013b[_0x5145('0x23')]=qs[_0x5145('0x23')](_0x1ed955['query'][_0x5145('0x23')]);}_0x42013b['order']=qs[_0x5145('0x41')](_0x1ed955[_0x5145('0x39')]['sort']);_0x42013b[_0x5145('0x5c')]=qs['filters'](_[_0x5145('0x5d')](_0x1ed955[_0x5145('0x39')],_0x375554['filters']));_0x42013b['where']['ListId']=_0x311ea2['id'];if(_0x1ed955[_0x5145('0x39')][_0x5145('0x5e')]){_0x42013b['where']=_[_0x5145('0x4c')](_0x42013b[_0x5145('0x5c')],{'$or':_['map'](_0x42013b[_0x5145('0x3c')],function(_0x495189){var _0x4b7bab={};_0x4b7bab[_0x495189]={'$like':'%'+_0x1ed955[_0x5145('0x39')]['filter']+'%'};return _0x4b7bab;})});}_0x42013b=_[_0x5145('0x4c')]({},_0x42013b,_0x1ed955[_0x5145('0x44')]);return db[_0x5145('0x59')][_0x5145('0x25')]({'where':_0x42013b[_0x5145('0x5c')]})['then'](function(_0x482b44){_0x3fdb9b[_0x5145('0x25')]=_0x482b44;if(_0x1ed955[_0x5145('0x39')]['includeAll']){_0x42013b[_0x5145('0x46')]=[{'all':!![]}];}return db[_0x5145('0x59')][_0x5145('0x47')](_0x42013b);})['then'](function(_0x1910dd){_0x3fdb9b[_0x5145('0x48')]=_0x1910dd;return _0x3fdb9b;});}})[_0x5145('0x2c')](respondWithFilteredResult(_0x4bb50a,_0x42013b))['catch'](handleError(_0x4bb50a,null));};exports[_0x5145('0x5f')]=function(_0x1c3c07,_0x18c8c0,_0x2bf393){return db['CmList'][_0x5145('0x4d')]({'where':{'id':_0x1c3c07[_0x5145('0x56')]['id']}})[_0x5145('0x2c')](handleEntityNotFound(_0x18c8c0,null))[_0x5145('0x2c')](function(_0x486553){if(_0x486553){return _0x486553[_0x5145('0x5f')](_0x1c3c07[_0x5145('0x39')][_0x5145('0x60')]);}})[_0x5145('0x2c')](respondWithStatusCode(_0x18c8c0,null))['catch'](handleError(_0x18c8c0,null));};exports[_0x5145('0x61')]=function(_0x55e46c,_0x3470f4,_0x48a5d7){return db[_0x5145('0x34')][_0x5145('0x4d')]({'where':{'id':_0x55e46c[_0x5145('0x56')]['id']}})[_0x5145('0x2c')](handleEntityNotFound(_0x3470f4,null))[_0x5145('0x2c')](function(_0x1e3150){if(_0x1e3150){var _0xa2fb29=[];var _0x23b226={'success':[],'errors':[]};return db[_0x5145('0x62')][_0x5145('0x57')]()[_0x5145('0x2c')](function(_0x4d279e){if(_0x55e46c[_0x5145('0x4f')]['tags']&&_[_0x5145('0x63')](_0x55e46c['body'][_0x5145('0x64')])){if(_0x55e46c[_0x5145('0x4f')][_0x5145('0x64')]['length']){_0x55e46c[_0x5145('0x4f')]['tags']=_0x55e46c['body']['tags'][_0x5145('0x65')](';')+';';}else{_0x55e46c['body'][_0x5145('0x64')]=null;}}else{_0x55e46c[_0x5145('0x4f')]['tags']=null;}if(_0x55e46c[_0x5145('0x4f')]&&_[_0x5145('0x63')](_0x55e46c[_0x5145('0x4f')])){for(var _0xb32e2a=0x0;_0xb32e2a<_0x55e46c[_0x5145('0x4f')]['length'];_0xb32e2a+=0x1){_0x55e46c[_0x5145('0x4f')][_0xb32e2a][_0x5145('0x66')]=_0x55e46c[_0x5145('0x56')]['id'];_0xa2fb29[_0x5145('0x67')](_0x55e46c['body'][_0xb32e2a]);}return BPromise[_0x5145('0x68')](_0xa2fb29,function(_0x46dcbe){return db[_0x5145('0x62')][_0x5145('0x4e')](_['omit'](_0x46dcbe,[_0x5145('0x60'),'id'])||{},{'fields':_[_0x5145('0x4a')](_0x4d279e),'raw':!![]})[_0x5145('0x2c')](function(_0x50890c){_0x23b226[_0x5145('0x69')]['push'](_0x50890c[_0x5145('0x6a')]);})[_0x5145('0x49')](function(_0x18da64){_0x23b226[_0x5145('0x6b')]['push']({'data':_0x46dcbe,'error':_0x18da64[_0x5145('0x6c')]});});})[_0x5145('0x2c')](function(_0x3de72b){return _0x23b226;})['catch'](function(_0x19f0bd){return _0x19f0bd;});}else{_0x3470f4[_0x5145('0x20')](0x190)[_0x5145('0x22')]({'message':_0x5145('0x6d')});}});}})[_0x5145('0x2c')](respondWithResult(_0x3470f4,null))['catch'](handleError(_0x3470f4,null));};exports['getContacts']=function(_0xb41f77,_0x3aef34,_0x49245e){var _0x15e6cd;return db[_0x5145('0x34')][_0x5145('0x4d')]({'where':{'id':_0xb41f77['params']['id']},'include':[{'model':db[_0x5145('0x6e')],'as':_0x5145('0x6f')}]})[_0x5145('0x2c')](handleEntityNotFound(_0x3aef34,null))[_0x5145('0x2c')](function(_0x31cd41){if(_0x31cd41){_0x15e6cd=_0x31cd41;return db['CmContact'][_0x5145('0x35')];}})['then'](function(_0x2b7e1a){if(_0x2b7e1a){var _0x4289f1={};var _0x1036b6={};_0x1036b6[_0x5145('0x38')]=_[_0x5145('0x70')](_[_0x5145('0x4a')](_0x2b7e1a),_[_0x5145('0x71')](_0x15e6cd['CustomFields'],function(_0x17b0a5){return util['format'](_0x5145('0x72'),_0x17b0a5['id']);}));_0x1036b6['query']=_[_0x5145('0x4a')](_0xb41f77[_0x5145('0x39')]);_0x1036b6[_0x5145('0x3a')]=_['intersection'](_0x1036b6[_0x5145('0x38')],_0x1036b6[_0x5145('0x39')]);_0x4289f1['attributes']=_[_0x5145('0x3b')](_0x1036b6[_0x5145('0x38')],qs[_0x5145('0x3d')](_0xb41f77[_0x5145('0x39')]['fields']));_0x4289f1[_0x5145('0x3c')]=_0x4289f1[_0x5145('0x3c')][_0x5145('0x4b')]?_0x4289f1[_0x5145('0x3c')]:_0x1036b6[_0x5145('0x38')];if(!_0xb41f77['query'][_0x5145('0x3e')](_0x5145('0x3f'))){_0x4289f1[_0x5145('0x26')]=qs[_0x5145('0x26')](_0xb41f77[_0x5145('0x39')][_0x5145('0x26')]);_0x4289f1['offset']=qs[_0x5145('0x23')](_0xb41f77[_0x5145('0x39')]['offset']);}_0x4289f1[_0x5145('0x40')]=qs[_0x5145('0x41')](_0xb41f77[_0x5145('0x39')][_0x5145('0x41')]);_0x4289f1[_0x5145('0x5c')]=qs['filters'](_[_0x5145('0x5d')](_0xb41f77['query'],_0x1036b6[_0x5145('0x3a')]));_0x4289f1[_0x5145('0x73')]=!![];if(_0xb41f77[_0x5145('0x39')][_0x5145('0x5e')]){_0x4289f1[_0x5145('0x5c')]=_[_0x5145('0x4c')](_0x4289f1[_0x5145('0x5c')],{'$or':_['map'](_0x4289f1[_0x5145('0x3c')],function(_0x148f77){var _0xef9e62={};_0xef9e62[_0x148f77]={'$like':'%'+_0xb41f77[_0x5145('0x39')][_0x5145('0x5e')]+'%'};return _0xef9e62;})});}_0x4289f1=_[_0x5145('0x4c')]({},_0x4289f1,_0xb41f77[_0x5145('0x44')]);return _0x15e6cd[_0x5145('0x74')](_0x4289f1);}})[_0x5145('0x2c')](respondWithResult(_0x3aef34,null))['catch'](handleError(_0x3aef34,null));};exports['getContactsCsv']=function(_0x31c558,_0x4e9b0f,_0x428954){var _0x5ad81f;return db[_0x5145('0x34')][_0x5145('0x4d')]({'where':{'id':_0x31c558[_0x5145('0x56')]['id']},'include':[{'model':db[_0x5145('0x6e')],'as':_0x5145('0x6f')}]})[_0x5145('0x2c')](handleEntityNotFound(_0x4e9b0f,null))[_0x5145('0x2c')](function(_0x512ca7){if(_0x512ca7){_0x5ad81f=_0x512ca7;return db[_0x5145('0x62')][_0x5145('0x35')];}})[_0x5145('0x2c')](function(_0x22b99d){if(_0x22b99d){var _0x1b7c74={};var _0x478b83={};_0x478b83['model']=_['concat'](_[_0x5145('0x4a')](_0x22b99d),_[_0x5145('0x71')](_0x5ad81f[_0x5145('0x6f')],function(_0x439e7d){return util[_0x5145('0x75')]('cf_%d',_0x439e7d['id']);}));_0x478b83[_0x5145('0x39')]=_[_0x5145('0x4a')](_0x31c558[_0x5145('0x39')]);_0x478b83[_0x5145('0x3a')]=_[_0x5145('0x3b')](_0x478b83[_0x5145('0x38')],_0x478b83[_0x5145('0x39')]);_0x1b7c74[_0x5145('0x3c')]=_[_0x5145('0x3b')](_0x478b83['model'],qs[_0x5145('0x3d')](_0x31c558[_0x5145('0x39')][_0x5145('0x3d')]));_0x1b7c74['attributes']=_0x1b7c74[_0x5145('0x3c')][_0x5145('0x4b')]?_0x1b7c74['attributes']:_0x478b83['model'];if(!_0x31c558[_0x5145('0x39')][_0x5145('0x3e')](_0x5145('0x3f'))){_0x1b7c74['limit']=qs[_0x5145('0x26')](_0x31c558[_0x5145('0x39')][_0x5145('0x26')]);_0x1b7c74[_0x5145('0x23')]=qs[_0x5145('0x23')](_0x31c558[_0x5145('0x39')][_0x5145('0x23')]);}_0x1b7c74['order']=qs['sort'](_0x31c558[_0x5145('0x39')][_0x5145('0x41')]);_0x1b7c74[_0x5145('0x5c')]=qs[_0x5145('0x3a')](_[_0x5145('0x5d')](_0x31c558[_0x5145('0x39')],_0x478b83[_0x5145('0x3a')]));_0x1b7c74['raw']=!![];if(_0x31c558[_0x5145('0x39')][_0x5145('0x5e')]){_0x1b7c74['where']=_[_0x5145('0x4c')](_0x1b7c74[_0x5145('0x5c')],{'$or':_['map'](_0x1b7c74['attributes'],function(_0x40e00a){var _0x58ca9a={};_0x58ca9a[_0x40e00a]={'$like':'%'+_0x31c558[_0x5145('0x39')][_0x5145('0x5e')]+'%'};return _0x58ca9a;})});}_0x1b7c74=_[_0x5145('0x4c')]({},_0x1b7c74,_0x31c558[_0x5145('0x44')]);return _0x5ad81f[_0x5145('0x74')](_0x1b7c74);}})[_0x5145('0x2c')](function(_0x300057){if(!_[_0x5145('0x76')](_0x300057)){var _0x4193ea=toCsv(_0x300057);var _0x2bb047=Date['now']();fs[_0x5145('0x77')](util[_0x5145('0x75')](_0x5145('0x78'),_0x5ad81f['id'],_0x2bb047),_0x4193ea);_0x4e9b0f[_0x5145('0x79')](_0x5145('0x7a'),'attachment;\x20filename='+util[_0x5145('0x75')](_0x5145('0x7b'),_0x5ad81f['id'],_0x2bb047));_0x4e9b0f['setHeader'](_0x5145('0x7c'),_0x5145('0x7d'));return _0x4e9b0f[_0x5145('0x7e')](util[_0x5145('0x75')](_0x5145('0x78'),_0x5ad81f['id'],_0x2bb047));}else{return _0x4e9b0f[_0x5145('0x1f')](0xcc);}})[_0x5145('0x49')](handleError(_0x4e9b0f,null));};exports['addCustomField']=function(_0xaee742,_0x158ca7,_0x5439a7){var _0x4973cd;delete _0xaee742['body']['id'];return db['CmList'][_0x5145('0x5b')]({'where':{'id':_0xaee742[_0x5145('0x56')]['id']}})[_0x5145('0x2c')](handleEntityNotFound(_0x158ca7,null))[_0x5145('0x2c')](function(_0x44db61){if(_0x44db61){return db[_0x5145('0x7f')][_0x5145('0x80')](function(_0xab0dd){return db['CmCustomField'][_0x5145('0x4e')](_0xaee742[_0x5145('0x4f')],{'transaction':_0xab0dd})[_0x5145('0x2c')](function(_0x8f43fe){_0x4973cd=_0x8f43fe;return _0x44db61[_0x5145('0x81')](_0x8f43fe,{'transaction':_0xab0dd});})['then'](function(){var _0x55bfb1={'type':db[_0x5145('0x82')]['TEXT'],'transaction':_0xab0dd};switch(_0xaee742[_0x5145('0x4f')]['type']){case _0x5145('0x83'):_0x55bfb1[_0x5145('0x42')]=db[_0x5145('0x82')]['TEXT'];break;case _0x5145('0x84'):_0x55bfb1[_0x5145('0x42')]=db[_0x5145('0x82')][_0x5145('0x85')];break;case _0x5145('0x86'):_0x55bfb1[_0x5145('0x42')]=db[_0x5145('0x82')][_0x5145('0x87')];_0x55bfb1[_0x5145('0x88')]=![];break;default:}return db['sequelize'][_0x5145('0x89')][_0x5145('0x8a')]('cm_contacts',util[_0x5145('0x75')](_0x5145('0x8b'),_0x4973cd['id']),_0x55bfb1);})[_0x5145('0x2c')](function(){return _0x4973cd;});});}})[_0x5145('0x2c')](respondWithResult(_0x158ca7,null))['catch'](handleError(_0x158ca7,null));};exports[_0x5145('0x8c')]=function(_0x3c044c,_0x3b3f0e,_0x31168f){var _0x5d1528={};var _0x5e28c8={};var _0x17e5f5;var _0x4747ae;return db[_0x5145('0x34')][_0x5145('0x5b')]({'where':{'id':_0x3c044c['params']['id']}})[_0x5145('0x2c')](handleEntityNotFound(_0x3b3f0e,null))[_0x5145('0x2c')](function(_0x274c9c){if(_0x274c9c){_0x17e5f5=_0x274c9c;_0x5e28c8[_0x5145('0x38')]=_[_0x5145('0x4a')](db[_0x5145('0x6e')]['rawAttributes']);_0x5e28c8['query']=_[_0x5145('0x4a')](_0x3c044c['query']);_0x5e28c8[_0x5145('0x3a')]=_['intersection'](_0x5e28c8[_0x5145('0x38')],_0x5e28c8['query']);_0x5d1528[_0x5145('0x3c')]=_['intersection'](_0x5e28c8['model'],qs[_0x5145('0x3d')](_0x3c044c[_0x5145('0x39')][_0x5145('0x3d')]));_0x5d1528[_0x5145('0x3c')]=_0x5d1528[_0x5145('0x3c')][_0x5145('0x4b')]?_0x5d1528['attributes']:_0x5e28c8[_0x5145('0x38')];_0x5d1528[_0x5145('0x40')]=qs[_0x5145('0x41')](_0x3c044c['query'][_0x5145('0x41')]);_0x5d1528[_0x5145('0x5c')]=qs[_0x5145('0x3a')](_['pick'](_0x3c044c[_0x5145('0x39')],_0x5e28c8[_0x5145('0x3a')]));_0x5d1528['where']=_[_0x5145('0x4c')](_0x5d1528[_0x5145('0x5c')],{'$or':[{'ListId':_0x274c9c['id']},{'ListId':null}]});if(_0x3c044c[_0x5145('0x39')][_0x5145('0x5e')]){_0x5d1528[_0x5145('0x5c')]=_[_0x5145('0x4c')](_0x5d1528[_0x5145('0x5c')],{'$or':_['map'](_0x5d1528[_0x5145('0x3c')],function(_0x46ef84){var _0x1d6301={};_0x1d6301[_0x46ef84]={'$like':'%'+_0x3c044c[_0x5145('0x39')][_0x5145('0x5e')]+'%'};return _0x1d6301;})});}_0x5d1528=_[_0x5145('0x4c')]({},_0x5d1528,_0x3c044c[_0x5145('0x44')]);return db[_0x5145('0x6e')][_0x5145('0x8d')](_0x5d1528);}})['then'](respondWithResult(_0x3b3f0e,null))['catch'](handleError(_0x3b3f0e,null));};exports[_0x5145('0x8e')]=function(_0x4c17c7,_0x1e1bdd,_0x1ef453){return db[_0x5145('0x34')][_0x5145('0x4d')]({'where':{'id':_0x4c17c7[_0x5145('0x56')]['id']}})[_0x5145('0x2c')](handleEntityNotFound(_0x1e1bdd,null))[_0x5145('0x2c')](function(_0x515dcb){if(_0x515dcb){return _0x515dcb[_0x5145('0x8e')](_0x4c17c7[_0x5145('0x4f')][_0x5145('0x60')],_[_0x5145('0x8f')](_0x4c17c7[_0x5145('0x4f')],[_0x5145('0x60'),'id'])||{})[_0x5145('0x90')](function(_0x38f805){for(var _0xece4f3=0x0;_0xece4f3<_0x4c17c7[_0x5145('0x4f')]['ids']['length'];_0xece4f3+=0x1){socket[_0x5145('0x91')](_0x5145('0x92'),{'UserId':Number(_0x4c17c7[_0x5145('0x4f')][_0x5145('0x60')][_0xece4f3]),'CmListId':Number(_0x4c17c7[_0x5145('0x56')]['id'])});}return _0x38f805;});}})[_0x5145('0x2c')](respondWithResult(_0x1e1bdd,null))['catch'](handleError(_0x1e1bdd,null));};exports[_0x5145('0x93')]=function(_0x52adda,_0x4d813c,_0x33a07d){return db[_0x5145('0x34')][_0x5145('0x4d')]({'where':{'id':_0x52adda[_0x5145('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d813c,null))[_0x5145('0x2c')](function(_0x1f26b5){if(_0x1f26b5){return _0x1f26b5[_0x5145('0x93')](_0x52adda[_0x5145('0x39')]['ids'])[_0x5145('0x2c')](function(){if(_[_0x5145('0x63')](_0x52adda[_0x5145('0x39')][_0x5145('0x60')])){for(var _0x3cd115=0x0;_0x3cd115<_0x52adda[_0x5145('0x39')][_0x5145('0x60')][_0x5145('0x4b')];_0x3cd115+=0x1){socket['emit'](_0x5145('0x94'),{'UserId':Number(_0x52adda[_0x5145('0x39')]['ids'][_0x3cd115]),'CmListId':Number(_0x52adda[_0x5145('0x56')]['id'])});}}else{socket[_0x5145('0x91')](_0x5145('0x94'),{'UserId':Number(_0x52adda['query'][_0x5145('0x60')]),'CmListId':Number(_0x52adda['params']['id'])});}});}})[_0x5145('0x2c')](respondWithStatusCode(_0x4d813c,null))[_0x5145('0x49')](handleError(_0x4d813c,null));};exports['getAgents']=function(_0x52b692,_0x204acb,_0x2c3e6a){var _0x16b992={};var _0x2058d8={};var _0x3fa579;var _0xfa3e46;return db[_0x5145('0x34')][_0x5145('0x5b')]({'where':{'id':_0x52b692[_0x5145('0x56')]['id']}})[_0x5145('0x2c')](handleEntityNotFound(_0x204acb,null))[_0x5145('0x2c')](function(_0x437833){if(_0x437833){_0x3fa579=_0x437833;_0x2058d8[_0x5145('0x38')]=_[_0x5145('0x4a')](db[_0x5145('0x95')][_0x5145('0x35')]);_0x2058d8[_0x5145('0x39')]=_[_0x5145('0x4a')](_0x52b692['query']);_0x2058d8['filters']=_['intersection'](_0x2058d8[_0x5145('0x38')],_0x2058d8[_0x5145('0x39')]);_0x16b992[_0x5145('0x3c')]=_[_0x5145('0x3b')](_0x2058d8[_0x5145('0x38')],qs['fields'](_0x52b692[_0x5145('0x39')][_0x5145('0x3d')]));_0x16b992[_0x5145('0x3c')]=_0x16b992['attributes'][_0x5145('0x4b')]?_0x16b992['attributes']:_0x2058d8[_0x5145('0x38')];_0x16b992[_0x5145('0x40')]=qs[_0x5145('0x41')](_0x52b692[_0x5145('0x39')]['sort']);_0x16b992[_0x5145('0x5c')]=qs['filters'](_[_0x5145('0x5d')](_0x52b692[_0x5145('0x39')],_0x2058d8[_0x5145('0x3a')]));if(_0x52b692[_0x5145('0x39')][_0x5145('0x5e')]){_0x16b992['where']=_['merge'](_0x16b992[_0x5145('0x5c')],{'$or':_[_0x5145('0x71')](_0x16b992[_0x5145('0x3c')],function(_0x34e407){var _0x58a3cd={};_0x58a3cd[_0x34e407]={'$like':'%'+_0x52b692[_0x5145('0x39')]['filter']+'%'};return _0x58a3cd;})});}_0x16b992=_[_0x5145('0x4c')]({},_0x16b992,_0x52b692[_0x5145('0x44')]);return _0x3fa579[_0x5145('0x96')](_0x16b992);}})[_0x5145('0x2c')](function(_0x542bb4){if(_0x542bb4){_0xfa3e46=_0x542bb4['length'];if(!_0x52b692['query'][_0x5145('0x3e')](_0x5145('0x3f'))){_0x16b992[_0x5145('0x26')]=qs[_0x5145('0x26')](_0x52b692[_0x5145('0x39')][_0x5145('0x26')]);_0x16b992[_0x5145('0x23')]=qs[_0x5145('0x23')](_0x52b692[_0x5145('0x39')][_0x5145('0x23')]);}return _0x3fa579[_0x5145('0x96')](_0x16b992);}})[_0x5145('0x2c')](function(_0x6cb28f){if(_0x6cb28f){return _0x6cb28f?{'count':_0xfa3e46,'rows':_0x6cb28f}:null;}})['then'](respondWithResult(_0x204acb,null))[_0x5145('0x49')](handleError(_0x204acb,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index cb08fbe..3bb3365 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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x470cc1,_0x56c9ac){_0x470cc1=_0x470cc1-0x0;var _0x43a332=_0x3e74[_0x470cc1];return _0x43a332;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe14b,0x93));var _0xbe14=function(_0x45f8f6,_0x17c244){_0x45f8f6=_0x45f8f6-0x0;var _0x174a44=_0xe14b[_0x45f8f6];return _0x174a44;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('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 317b4a0..0abd039 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','CmList','util'];(function(_0xa063ce,_0x1e61b0){var _0x3d684a=function(_0x3eaca8){while(--_0x3eaca8){_0xa063ce['push'](_0xa063ce['shift']());}};_0x3d684a(++_0x1e61b0);}(_0xedd9,0xfc));var _0x9edd=function(_0x43be71,_0x33cf54){_0x43be71=_0x43be71-0x0;var _0x40fc7a=_0xedd9[_0x43be71];return _0x40fc7a;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c81=['moment','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','util','api'];(function(_0x368b71,_0x2982f8){var _0x16b260=function(_0x4b20f7){while(--_0x4b20f7){_0x368b71['push'](_0x368b71['shift']());}};_0x16b260(++_0x2982f8);}(_0x3c81,0x102));var _0x13c8=function(_0x28f792,_0x4155fe){_0x28f792=_0x28f792-0x0;var _0x3f0134=_0x3c81[_0x28f792];return _0x3f0134;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var logger=require('../../config/logger')(_0x13c8('0x2'));var moment=require(_0x13c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13c8('0x4'));var attributes=require(_0x13c8('0x5'));module[_0x13c8('0x6')]=function(_0x1c16f1,_0x2a4d66){return _0x1c16f1[_0x13c8('0x7')](_0x13c8('0x8'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index aef62a7..fb15927 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 _0x06a9=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1d7031,_0x115f5b){var _0xb892c=function(_0xb7042){while(--_0xb7042){_0x1d7031['push'](_0x1d7031['shift']());}};_0xb892c(++_0x115f5b);}(_0x06a9,0xf8));var _0x906a=function(_0x1d4f28,_0x3c34ea){_0x1d4f28=_0x1d4f28-0x0;var _0x43327a=_0x06a9[_0x1d4f28];return _0x43327a;};'use strict';var _=require(_0x906a('0x0'));var util=require(_0x906a('0x1'));var moment=require(_0x906a('0x2'));var BPromise=require(_0x906a('0x3'));var rs=require(_0x906a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x906a('0x5'))['db'];var utils=require(_0x906a('0x6'));var logger=require(_0x906a('0x7'))(_0x906a('0x8'));var config=require(_0x906a('0x9'));var jayson=require(_0x906a('0xa'));var client=jayson[_0x906a('0xb')][_0x906a('0xc')]({'port':0x232a});config[_0x906a('0xd')]=_[_0x906a('0xe')](config[_0x906a('0xd')],{'host':_0x906a('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x906a('0xd')]));require('./cmList.socket')[_0x906a('0x10')](socket);function respondWithRpcPromise(_0x3d1cce,_0x3d1778,_0xde248b){return new BPromise(function(_0x3a0a5c,_0x158681){return client['request'](_0x3d1cce,_0xde248b)[_0x906a('0x11')](function(_0x34c6ae){logger[_0x906a('0x12')](_0x906a('0x13'),_0x3d1778,_0x906a('0x14'));logger['debug'](_0x906a('0x15'),_0x3d1778,_0x906a('0x14'),JSON[_0x906a('0x16')](_0x34c6ae));if(_0x34c6ae[_0x906a('0x17')]){if(_0x34c6ae[_0x906a('0x17')][_0x906a('0x18')]===0x1f4){logger[_0x906a('0x17')](_0x906a('0x13'),_0x3d1778,_0x34c6ae[_0x906a('0x17')][_0x906a('0x19')]);return _0x158681(_0x34c6ae['error']['message']);}logger[_0x906a('0x17')]('CmList,\x20%s,\x20%s',_0x3d1778,_0x34c6ae[_0x906a('0x17')]['message']);return _0x3a0a5c(_0x34c6ae[_0x906a('0x17')][_0x906a('0x19')]);}else{logger[_0x906a('0x12')](_0x906a('0x13'),_0x3d1778,'request\x20sent');_0x3a0a5c(_0x34c6ae[_0x906a('0x1a')][_0x906a('0x19')]);}})[_0x906a('0x1b')](function(_0x1b382b){logger[_0x906a('0x17')]('CmList,\x20%s,\x20%s',_0x3d1778,_0x1b382b);_0x158681(_0x1b382b);});});} \ No newline at end of file +var _0xa747=['CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1ef246,_0x42e40){var _0x229a28=function(_0x120b0f){while(--_0x120b0f){_0x1ef246['push'](_0x1ef246['shift']());}};_0x229a28(++_0x42e40);}(_0xa747,0x7e));var _0x7a74=function(_0x173e0c,_0x2d6d22){_0x173e0c=_0x173e0c-0x0;var _0x228621=_0xa747[_0x173e0c];return _0x228621;};'use strict';var _=require(_0x7a74('0x0'));var util=require(_0x7a74('0x1'));var moment=require(_0x7a74('0x2'));var BPromise=require(_0x7a74('0x3'));var rs=require(_0x7a74('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a74('0x5'))['db'];var utils=require(_0x7a74('0x6'));var logger=require(_0x7a74('0x7'))(_0x7a74('0x8'));var config=require(_0x7a74('0x9'));var jayson=require(_0x7a74('0xa'));var client=jayson[_0x7a74('0xb')][_0x7a74('0xc')]({'port':0x232a});config['redis']=_[_0x7a74('0xd')](config[_0x7a74('0xe')],{'host':_0x7a74('0xf'),'port':0x18eb});var socket=require(_0x7a74('0x10'))(new Redis(config[_0x7a74('0xe')]));require(_0x7a74('0x11'))[_0x7a74('0x12')](socket);function respondWithRpcPromise(_0x408b08,_0x564601,_0x20dbbf){return new BPromise(function(_0x52b283,_0x33100e){return client[_0x7a74('0x13')](_0x408b08,_0x20dbbf)['then'](function(_0x36df43){logger[_0x7a74('0x14')](_0x7a74('0x15'),_0x564601,_0x7a74('0x16'));logger[_0x7a74('0x17')](_0x7a74('0x18'),_0x564601,_0x7a74('0x16'),JSON[_0x7a74('0x19')](_0x36df43));if(_0x36df43[_0x7a74('0x1a')]){if(_0x36df43[_0x7a74('0x1a')][_0x7a74('0x1b')]===0x1f4){logger[_0x7a74('0x1a')](_0x7a74('0x15'),_0x564601,_0x36df43[_0x7a74('0x1a')][_0x7a74('0x1c')]);return _0x33100e(_0x36df43[_0x7a74('0x1a')][_0x7a74('0x1c')]);}logger['error']('CmList,\x20%s,\x20%s',_0x564601,_0x36df43[_0x7a74('0x1a')][_0x7a74('0x1c')]);return _0x52b283(_0x36df43[_0x7a74('0x1a')][_0x7a74('0x1c')]);}else{logger[_0x7a74('0x14')](_0x7a74('0x15'),_0x564601,_0x7a74('0x16'));_0x52b283(_0x36df43['result'][_0x7a74('0x1c')]);}})[_0x7a74('0x1d')](function(_0x64408c){logger['error'](_0x7a74('0x15'),_0x564601,_0x64408c);_0x33100e(_0x64408c);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 15e1d11..fb2f4e1 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 _0x1952=['cmList:','save','remove','removeListener','length'];(function(_0x5434b6,_0x2a1255){var _0x2b1222=function(_0x906b6){while(--_0x906b6){_0x5434b6['push'](_0x5434b6['shift']());}};_0x2b1222(++_0x2a1255);}(_0x1952,0x92));var _0x2195=function(_0x14a6eb,_0x417b92){_0x14a6eb=_0x14a6eb-0x0;var _0x1db3f3=_0x1952[_0x14a6eb];return _0x1db3f3;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x2195('0x0'),_0x2195('0x1'),'update'];function createListener(_0x18be4b,_0x5bc1d5){return function(_0x6e4d99){_0x5bc1d5['emit'](_0x18be4b,_0x6e4d99);};}function removeListener(_0x4f994a,_0x1d05d0){return function(){CmListEvents[_0x2195('0x2')](_0x4f994a,_0x1d05d0);};}exports['register']=function(_0x140263){for(var _0xfdb1ac=0x0,_0x2a7f81=events[_0x2195('0x3')];_0xfdb1ac<_0x2a7f81;_0xfdb1ac++){var _0x5b89ea=events[_0xfdb1ac];var _0x5d72d6=createListener(_0x2195('0x4')+_0x5b89ea,_0x140263);CmListEvents['on'](_0x5b89ea,_0x5d72d6);}}; \ No newline at end of file +var _0xf881=['register','length','cmList:','./cmList.events','save','removeListener'];(function(_0x461c3a,_0x20860a){var _0x282312=function(_0x30c4b3){while(--_0x30c4b3){_0x461c3a['push'](_0x461c3a['shift']());}};_0x282312(++_0x20860a);}(_0xf881,0x1d1));var _0x1f88=function(_0x63b50f,_0x291866){_0x63b50f=_0x63b50f-0x0;var _0x1b80ae=_0xf881[_0x63b50f];return _0x1b80ae;};'use strict';var CmListEvents=require(_0x1f88('0x0'));var events=[_0x1f88('0x1'),'remove','update'];function createListener(_0x19a543,_0x3d0219){return function(_0x3cd7c5){_0x3d0219['emit'](_0x19a543,_0x3cd7c5);};}function removeListener(_0xa751f7,_0x1a8e43){return function(){CmListEvents[_0x1f88('0x2')](_0xa751f7,_0x1a8e43);};}exports[_0x1f88('0x3')]=function(_0x4f563c){for(var _0x4f4825=0x0,_0x554ab6=events[_0x1f88('0x4')];_0x4f4825<_0x554ab6;_0x4f4825++){var _0x1c829b=events[_0x4f4825];var _0x462983=createListener(_0x1f88('0x5')+_0x1c829b,_0x4f563c);CmListEvents['on'](_0x1c829b,_0x462983);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index bb3a58f..17e5353 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 _0x7770=['getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','addContacts','/:id/users','addAgents','update','delete','removeDispositions','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv'];(function(_0x397f34,_0x3ac328){var _0x272cda=function(_0x2c9756){while(--_0x2c9756){_0x397f34['push'](_0x397f34['shift']());}};_0x272cda(++_0x3ac328);}(_0x7770,0xf5));var _0x0777=function(_0x32977d,_0x54da78){_0x32977d=_0x32977d-0x0;var _0x253892=_0x7770[_0x32977d];return _0x253892;};'use strict';var multer=require('multer');var util=require(_0x0777('0x0'));var path=require(_0x0777('0x1'));var timeout=require(_0x0777('0x2'));var express=require(_0x0777('0x3'));var router=express[_0x0777('0x4')]();var fs_extra=require(_0x0777('0x5'));var auth=require(_0x0777('0x6'));var interaction=require(_0x0777('0x7'));var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0x0777('0x8')]('/',auth[_0x0777('0x9')](),controller[_0x0777('0xa')]);router['get'](_0x0777('0xb'),auth['isAuthenticated'](),controller[_0x0777('0xc')]);router['get'](_0x0777('0xd'),auth[_0x0777('0x9')](),controller[_0x0777('0xe')]);router[_0x0777('0x8')](_0x0777('0xf'),auth[_0x0777('0x9')](),controller[_0x0777('0x10')]);router[_0x0777('0x8')](_0x0777('0x11'),auth[_0x0777('0x9')](),controller['getContacts']);router['get'](_0x0777('0x12'),auth['isAuthenticated'](),controller[_0x0777('0x13')]);router[_0x0777('0x8')](_0x0777('0x14'),auth[_0x0777('0x9')](),controller[_0x0777('0x15')]);router[_0x0777('0x8')]('/:id/users',auth[_0x0777('0x9')](),controller[_0x0777('0x16')]);router[_0x0777('0x17')]('/',auth['isAuthenticated'](),controller[_0x0777('0x18')]);router[_0x0777('0x17')]('/:id/dispositions',auth[_0x0777('0x9')](),controller['addDisposition']);router['post']('/:id/contacts',auth[_0x0777('0x9')](),controller[_0x0777('0x19')]);router[_0x0777('0x17')]('/:id/fields',auth[_0x0777('0x9')](),controller['addCustomField']);router[_0x0777('0x17')](_0x0777('0x1a'),auth[_0x0777('0x9')](),controller[_0x0777('0x1b')]);router['put'](_0x0777('0xd'),auth[_0x0777('0x9')](),controller[_0x0777('0x1c')]);router[_0x0777('0x1d')](_0x0777('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x0777('0x1d')](_0x0777('0xf'),auth['isAuthenticated'](),controller[_0x0777('0x1e')]);router[_0x0777('0x1d')](_0x0777('0x1a'),auth['isAuthenticated'](),controller[_0x0777('0x1f')]);module[_0x0777('0x20')]=router; \ No newline at end of file +var _0x74c6=['addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','/:id','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create'];(function(_0x4835ab,_0x2c8e33){var _0xc55b8c=function(_0x82b05f){while(--_0x82b05f){_0x4835ab['push'](_0x4835ab['shift']());}};_0xc55b8c(++_0x2c8e33);}(_0x74c6,0xb9));var _0x674c=function(_0x509be3,_0x736852){_0x509be3=_0x509be3-0x0;var _0x440c03=_0x74c6[_0x509be3];return _0x440c03;};'use strict';var multer=require(_0x674c('0x0'));var util=require('util');var path=require(_0x674c('0x1'));var timeout=require('connect-timeout');var express=require(_0x674c('0x2'));var router=express[_0x674c('0x3')]();var fs_extra=require(_0x674c('0x4'));var auth=require(_0x674c('0x5'));var interaction=require(_0x674c('0x6'));var config=require(_0x674c('0x7'));var controller=require(_0x674c('0x8'));router[_0x674c('0x9')]('/',auth[_0x674c('0xa')](),controller[_0x674c('0xb')]);router[_0x674c('0x9')](_0x674c('0xc'),auth[_0x674c('0xa')](),controller['describe']);router[_0x674c('0x9')](_0x674c('0xd'),auth[_0x674c('0xa')](),controller['show']);router[_0x674c('0x9')](_0x674c('0xe'),auth[_0x674c('0xa')](),controller['getDispositions']);router[_0x674c('0x9')](_0x674c('0xf'),auth[_0x674c('0xa')](),controller[_0x674c('0x10')]);router[_0x674c('0x9')](_0x674c('0x11'),auth[_0x674c('0xa')](),controller[_0x674c('0x12')]);router[_0x674c('0x9')](_0x674c('0x13'),auth['isAuthenticated'](),controller[_0x674c('0x14')]);router[_0x674c('0x9')](_0x674c('0x15'),auth[_0x674c('0xa')](),controller[_0x674c('0x16')]);router[_0x674c('0x17')]('/',auth[_0x674c('0xa')](),controller[_0x674c('0x18')]);router[_0x674c('0x17')](_0x674c('0xe'),auth[_0x674c('0xa')](),controller[_0x674c('0x19')]);router[_0x674c('0x17')](_0x674c('0xf'),auth['isAuthenticated'](),controller[_0x674c('0x1a')]);router['post'](_0x674c('0x13'),auth[_0x674c('0xa')](),controller[_0x674c('0x1b')]);router[_0x674c('0x17')](_0x674c('0x15'),auth[_0x674c('0xa')](),controller[_0x674c('0x1c')]);router[_0x674c('0x1d')](_0x674c('0xd'),auth[_0x674c('0xa')](),controller[_0x674c('0x1e')]);router[_0x674c('0x1f')](_0x674c('0xd'),auth[_0x674c('0xa')](),controller[_0x674c('0x20')]);router[_0x674c('0x1f')](_0x674c('0xe'),auth[_0x674c('0xa')](),controller[_0x674c('0x21')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x674c('0x22')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 0732cfa..76c759b 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 _0xbfb5=['VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x5d3ad7,_0x150d60){var _0x1ed853=function(_0x5eac0f){while(--_0x5eac0f){_0x5d3ad7['push'](_0x5d3ad7['shift']());}};_0x1ed853(++_0x150d60);}(_0xbfb5,0x1cb));var _0x5bfb=function(_0x9fd869,_0x2ba3bc){_0x9fd869=_0x9fd869-0x0;var _0x445e40=_0xbfb5[_0x9fd869];return _0x445e40;};'use strict';var Sequelize=require(_0x5bfb('0x0'));module['exports']={'name':{'type':Sequelize[_0x5bfb('0x1')],'get':function(_0x5ddefb){return this[_0x5bfb('0x2')](_0x5bfb('0x3'));}},'field':{'type':Sequelize[_0x5bfb('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x5bfb('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x5bfb('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa231=['STRING','exports','getDataValue','field'];(function(_0x2d0bfd,_0x2ba336){var _0x4d806c=function(_0x47938d){while(--_0x47938d){_0x2d0bfd['push'](_0x2d0bfd['shift']());}};_0x4d806c(++_0x2ba336);}(_0xa231,0x1c9));var _0x1a23=function(_0x1591f7,_0x5aedd6){_0x1591f7=_0x1591f7-0x0;var _0x4e1517=_0xa231[_0x1591f7];return _0x4e1517;};'use strict';var Sequelize=require('sequelize');module[_0x1a23('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5e0fb2){return this[_0x1a23('0x1')](_0x1a23('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x1a23('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 076d8ed..93b7dfd 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(_0x203a7f,_0xcae6e3){var _0x4d2ec5=function(_0x536a44){while(--_0x536a44){_0x203a7f['push'](_0x203a7f['shift']());}};_0x4d2ec5(++_0xcae6e3);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x44a15f,_0x1a9460){var _0x3c9b89=function(_0xc91059){while(--_0xc91059){_0x44a15f['push'](_0x44a15f['shift']());}};_0x3c9b89(++_0x1a9460);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 10ed5db..b878f11 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 _0x94bb=['exports','define','tools_conditions','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x910b2,_0x3459ed){var _0x423adf=function(_0x45749a){while(--_0x45749a){_0x910b2['push'](_0x910b2['shift']());}};_0x423adf(++_0x3459ed);}(_0x94bb,0xd4));var _0xb94b=function(_0x146edd,_0x2be255){_0x146edd=_0x146edd-0x0;var _0x46079b=_0x94bb[_0x146edd];return _0x46079b;};'use strict';var _=require(_0xb94b('0x0'));var util=require(_0xb94b('0x1'));var logger=require(_0xb94b('0x2'))(_0xb94b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb94b('0x4'));var fs=require('fs');var path=require(_0xb94b('0x5'));var rimraf=require(_0xb94b('0x6'));var config=require(_0xb94b('0x7'));var attributes=require('./condition.attributes');module[_0xb94b('0x8')]=function(_0x12b5d6,_0x2ee953){return _0x12b5d6[_0xb94b('0x9')]('Condition',attributes,{'tableName':_0xb94b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7daf=['rimraf','../../config/environment','./condition.attributes','exports','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4cae34,_0x185973){var _0x55efb7=function(_0x3c30f3){while(--_0x3c30f3){_0x4cae34['push'](_0x4cae34['shift']());}};_0x55efb7(++_0x185973);}(_0x7daf,0x16d));var _0xf7da=function(_0x3e0d44,_0xc4f9ff){_0x3e0d44=_0x3e0d44-0x0;var _0x297f42=_0x7daf[_0x3e0d44];return _0x297f42;};'use strict';var _=require(_0xf7da('0x0'));var util=require(_0xf7da('0x1'));var logger=require(_0xf7da('0x2'))(_0xf7da('0x3'));var moment=require(_0xf7da('0x4'));var BPromise=require(_0xf7da('0x5'));var rp=require(_0xf7da('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7da('0x7'));var config=require(_0xf7da('0x8'));var attributes=require(_0xf7da('0x9'));module[_0xf7da('0xa')]=function(_0x5aa96d,_0x465807){return _0x5aa96d['define']('Condition',attributes,{'tableName':_0xf7da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 6511a2f..f345796 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 _0xeac8=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error'];(function(_0x4eeb44,_0x578225){var _0xa4fcfd=function(_0x34120a){while(--_0x34120a){_0x4eeb44['push'](_0x4eeb44['shift']());}};_0xa4fcfd(++_0x578225);}(_0xeac8,0x12d));var _0x8eac=function(_0x30c993,_0x9a9f8d){_0x30c993=_0x30c993-0x0;var _0x4845b3=_0xeac8[_0x30c993];return _0x4845b3;};'use strict';var _=require(_0x8eac('0x0'));var util=require(_0x8eac('0x1'));var moment=require(_0x8eac('0x2'));var BPromise=require(_0x8eac('0x3'));var rs=require(_0x8eac('0x4'));var fs=require('fs');var Redis=require(_0x8eac('0x5'));var db=require(_0x8eac('0x6'))['db'];var utils=require(_0x8eac('0x7'));var logger=require(_0x8eac('0x8'))(_0x8eac('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8eac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45d300,_0x5c65b1,_0x4c2cdd){return new BPromise(function(_0x42d8ff,_0x5ea620){return client[_0x8eac('0xb')](_0x45d300,_0x4c2cdd)[_0x8eac('0xc')](function(_0x5215f5){logger[_0x8eac('0xd')](_0x8eac('0xe'),_0x5c65b1,_0x8eac('0xf'));logger[_0x8eac('0x10')](_0x8eac('0x11'),_0x5c65b1,_0x8eac('0xf'),JSON['stringify'](_0x5215f5));if(_0x5215f5[_0x8eac('0x12')]){if(_0x5215f5['error']['code']===0x1f4){logger[_0x8eac('0x12')](_0x8eac('0xe'),_0x5c65b1,_0x5215f5[_0x8eac('0x12')][_0x8eac('0x13')]);return _0x5ea620(_0x5215f5['error'][_0x8eac('0x13')]);}logger['error'](_0x8eac('0xe'),_0x5c65b1,_0x5215f5[_0x8eac('0x12')][_0x8eac('0x13')]);return _0x42d8ff(_0x5215f5['error'][_0x8eac('0x13')]);}else{logger[_0x8eac('0xd')](_0x8eac('0xe'),_0x5c65b1,'request\x20sent');_0x42d8ff(_0x5215f5['result'][_0x8eac('0x13')]);}})['catch'](function(_0x46f225){logger[_0x8eac('0x12')](_0x8eac('0xe'),_0x5c65b1,_0x46f225);_0x5ea620(_0x46f225);});});} \ No newline at end of file +var _0xe89d=['request','then','request\x20sent','debug','error','code','Condition,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x258376,_0x1bcb8d){var _0x75ac11=function(_0xd21397){while(--_0xd21397){_0x258376['push'](_0x258376['shift']());}};_0x75ac11(++_0x1bcb8d);}(_0xe89d,0xa4));var _0xde89=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe89d[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xde89('0x0'));var util=require(_0xde89('0x1'));var moment=require(_0xde89('0x2'));var BPromise=require(_0xde89('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde89('0x4'));var db=require(_0xde89('0x5'))['db'];var utils=require(_0xde89('0x6'));var logger=require(_0xde89('0x7'))(_0xde89('0x8'));var config=require(_0xde89('0x9'));var jayson=require(_0xde89('0xa'));var client=jayson[_0xde89('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d6e9a,_0x414f60,_0x1240c9){return new BPromise(function(_0x4f7360,_0x2de2fb){return client[_0xde89('0xc')](_0x1d6e9a,_0x1240c9)[_0xde89('0xd')](function(_0x440492){logger['info']('Condition,\x20%s,\x20%s',_0x414f60,_0xde89('0xe'));logger[_0xde89('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x414f60,_0xde89('0xe'),JSON['stringify'](_0x440492));if(_0x440492[_0xde89('0x10')]){if(_0x440492[_0xde89('0x10')][_0xde89('0x11')]===0x1f4){logger[_0xde89('0x10')](_0xde89('0x12'),_0x414f60,_0x440492[_0xde89('0x10')][_0xde89('0x13')]);return _0x2de2fb(_0x440492[_0xde89('0x10')][_0xde89('0x13')]);}logger['error'](_0xde89('0x12'),_0x414f60,_0x440492[_0xde89('0x10')][_0xde89('0x13')]);return _0x4f7360(_0x440492['error'][_0xde89('0x13')]);}else{logger[_0xde89('0x14')]('Condition,\x20%s,\x20%s',_0x414f60,_0xde89('0xe'));_0x4f7360(_0x440492[_0xde89('0x15')][_0xde89('0x13')]);}})['catch'](function(_0x5e0f54){logger[_0xde89('0x10')](_0xde89('0x12'),_0x414f60,_0x5e0f54);_0x2de2fb(_0x5e0f54);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 6253cb3..a952154 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 _0x6a7f=['destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update'];(function(_0x2e56b2,_0x2925a6){var _0x207d5a=function(_0x7483fe){while(--_0x7483fe){_0x2e56b2['push'](_0x2e56b2['shift']());}};_0x207d5a(++_0x2925a6);}(_0x6a7f,0x106));var _0xf6a7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6a7f[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xf6a7('0x0'));var util=require(_0xf6a7('0x1'));var path=require(_0xf6a7('0x2'));var timeout=require(_0xf6a7('0x3'));var express=require(_0xf6a7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf6a7('0x5'));var config=require(_0xf6a7('0x6'));var controller=require('./condition.controller');router[_0xf6a7('0x7')](_0xf6a7('0x8'),auth[_0xf6a7('0x9')](),controller[_0xf6a7('0xa')]);router['delete']('/:id',auth[_0xf6a7('0x9')](),controller[_0xf6a7('0xb')]);module[_0xf6a7('0xc')]=router; \ No newline at end of file +var _0xef0d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5e6fb6,_0x117f66){var _0x5ab78d=function(_0x519a7b){while(--_0x519a7b){_0x5e6fb6['push'](_0x5e6fb6['shift']());}};_0x5ab78d(++_0x117f66);}(_0xef0d,0xdc));var _0xdef0=function(_0x27fef2,_0x1ebb03){_0x27fef2=_0x27fef2-0x0;var _0x25c695=_0xef0d[_0x27fef2];return _0x25c695;};'use strict';var multer=require(_0xdef0('0x0'));var util=require('util');var path=require(_0xdef0('0x1'));var timeout=require(_0xdef0('0x2'));var express=require(_0xdef0('0x3'));var router=express[_0xdef0('0x4')]();var fs_extra=require(_0xdef0('0x5'));var auth=require(_0xdef0('0x6'));var interaction=require(_0xdef0('0x7'));var config=require(_0xdef0('0x8'));var controller=require(_0xdef0('0x9'));router['put'](_0xdef0('0xa'),auth[_0xdef0('0xb')](),controller[_0xdef0('0xc')]);router[_0xdef0('0xd')](_0xdef0('0xa'),auth[_0xdef0('0xb')](),controller[_0xdef0('0xe')]);module[_0xdef0('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 6fb2f93..f58279e 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0x183aa1,_0x22da13){var _0xc3224f=function(_0x18a97b){while(--_0x18a97b){_0x183aa1['push'](_0x183aa1['shift']());}};_0xc3224f(++_0x22da13);}(_0xb10b,0x12a));var _0xbb10=function(_0x582ccd,_0xa9ab43){_0x582ccd=_0x582ccd-0x0;var _0x11545d=_0xb10b[_0x582ccd];return _0x11545d;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x5e4e03,_0x2a0bbc){var _0x2774f7=function(_0x53a2c3){while(--_0x53a2c3){_0x5e4e03['push'](_0x5e4e03['shift']());}};_0x2774f7(++_0x2a0bbc);}(_0x2032,0xd9));var _0x2203=function(_0x1cb368,_0x4d09d5){_0x1cb368=_0x1cb368-0x0;var _0x54089f=_0x2032[_0x1cb368];return _0x54089f;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 1c90387..273c216 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 _0x11d6=['apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','error','stack','name','send','index','Dashboard','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','omit','createdAt','updatedAt','UserProfileSection','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','pick','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./dashboard.socket','register','status','json','offset','undefined','limit','count','Content-Range'];(function(_0x83da39,_0x1d6cb6){var _0x1e9d39=function(_0x306db6){while(--_0x306db6){_0x83da39['push'](_0x83da39['shift']());}};_0x1e9d39(++_0x1d6cb6);}(_0x11d6,0xe5));var _0x611d=function(_0x439085,_0x25d016){_0x439085=_0x439085-0x0;var _0x580de1=_0x11d6[_0x439085];return _0x580de1;};'use strict';var emlformat=require(_0x611d('0x0'));var rimraf=require(_0x611d('0x1'));var zipdir=require(_0x611d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x611d('0x3'));var moment=require(_0x611d('0x4'));var BPromise=require(_0x611d('0x5'));var Mustache=require(_0x611d('0x6'));var util=require('util');var path=require(_0x611d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x611d('0x8'));var fs=require('fs');var fs_extra=require(_0x611d('0x9'));var _=require(_0x611d('0xa'));var squel=require(_0x611d('0xb'));var crypto=require('crypto');var jsforce=require(_0x611d('0xc'));var deskjs=require(_0x611d('0xd'));var toCsv=require(_0x611d('0xe'));var querystring=require(_0x611d('0xf'));var Papa=require(_0x611d('0x10'));var Redis=require(_0x611d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x611d('0x12'));var hardwareService=require(_0x611d('0x13'));var logger=require(_0x611d('0x14'))(_0x611d('0x15'));var utils=require(_0x611d('0x16'));var config=require(_0x611d('0x17'));var licenseUtil=require(_0x611d('0x18'));var db=require(_0x611d('0x19'))['db'];config[_0x611d('0x1a')]=_['defaults'](config[_0x611d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x611d('0x1b'))(new Redis(config[_0x611d('0x1a')]));require(_0x611d('0x1c'))[_0x611d('0x1d')](socket);function respondWithStatusCode(_0x149a1e,_0x5e0062){_0x5e0062=_0x5e0062||0xcc;return function(_0x488449){if(_0x488449){return _0x149a1e['sendStatus'](_0x5e0062);}return _0x149a1e['status'](_0x5e0062)['end']();};}function respondWithResult(_0x8e20be,_0x4307e4){_0x4307e4=_0x4307e4||0xc8;return function(_0x4c2ed4){if(_0x4c2ed4){return _0x8e20be[_0x611d('0x1e')](_0x4307e4)[_0x611d('0x1f')](_0x4c2ed4);}};}function respondWithFilteredResult(_0x515923,_0x2934a8){return function(_0x458b5c){if(_0x458b5c){var _0x3f0e01=typeof _0x2934a8[_0x611d('0x20')]===_0x611d('0x21')&&typeof _0x2934a8[_0x611d('0x22')]===_0x611d('0x21');var _0x29d297=_0x458b5c[_0x611d('0x23')];var _0x215c81=_0x3f0e01?0x0:_0x2934a8['offset'];var _0xbba5a6=_0x3f0e01?_0x458b5c['count']:_0x2934a8[_0x611d('0x20')]+_0x2934a8[_0x611d('0x22')];var _0x5a8a0d;if(_0xbba5a6>=_0x29d297){_0xbba5a6=_0x29d297;_0x5a8a0d=0xc8;}else{_0x5a8a0d=0xce;}_0x515923[_0x611d('0x1e')](_0x5a8a0d);return _0x515923['set'](_0x611d('0x24'),_0x215c81+'-'+_0xbba5a6+'/'+_0x29d297)[_0x611d('0x1f')](_0x458b5c);}return null;};}function patchUpdates(_0x5d8c34){return function(_0x8db570){try{jsonpatch[_0x611d('0x25')](_0x8db570,_0x5d8c34,!![]);}catch(_0x448951){return BPromise[_0x611d('0x26')](_0x448951);}return _0x8db570[_0x611d('0x27')]();};}function saveUpdates(_0x115322,_0x2d8851){return function(_0x374ea7){if(_0x374ea7){return _0x374ea7[_0x611d('0x28')](_0x115322)[_0x611d('0x29')](function(_0x29a5be){return _0x29a5be;});}return null;};}function removeEntity(_0x3ad40a,_0x37dd01){return function(_0x9eb221){if(_0x9eb221){return _0x9eb221[_0x611d('0x2a')]()[_0x611d('0x29')](function(){var _0xa54548=_0x9eb221[_0x611d('0x2b')]({'plain':!![]});var _0x280742=_0x611d('0x2c');return db[_0x611d('0x2d')][_0x611d('0x2a')]({'where':{'type':_0x280742,'resourceId':_0xa54548['id']}})[_0x611d('0x29')](function(){return _0x9eb221;});})['then'](function(){_0x3ad40a['status'](0xcc)[_0x611d('0x2e')]();});}};}function handleEntityNotFound(_0x12b9d9,_0x54dfa3){return function(_0x1ac141){if(!_0x1ac141){_0x12b9d9['sendStatus'](0x194);}return _0x1ac141;};}function handleError(_0x1491a4,_0x1116a1){_0x1116a1=_0x1116a1||0x1f4;return function(_0x5b9023){logger[_0x611d('0x2f')](_0x5b9023[_0x611d('0x30')]);if(_0x5b9023[_0x611d('0x31')]){delete _0x5b9023[_0x611d('0x31')];}_0x1491a4[_0x611d('0x1e')](_0x1116a1)[_0x611d('0x32')](_0x5b9023);};}exports[_0x611d('0x33')]=function(_0x4c6a64,_0x139191){var _0x55d99a={},_0x18be75={},_0x15e30c={'count':0x0,'rows':[]};var _0x125043=_['map'](db[_0x611d('0x34')]['rawAttributes'],function(_0x2f2047){return{'name':_0x2f2047[_0x611d('0x35')],'type':_0x2f2047[_0x611d('0x36')][_0x611d('0x37')]};});_0x18be75['model']=_[_0x611d('0x38')](_0x125043,'name');_0x18be75[_0x611d('0x39')]=_[_0x611d('0x3a')](_0x4c6a64[_0x611d('0x39')]);_0x18be75['filters']=_['intersection'](_0x18be75[_0x611d('0x3b')],_0x18be75['query']);_0x55d99a[_0x611d('0x3c')]=_[_0x611d('0x3d')](_0x18be75[_0x611d('0x3b')],qs[_0x611d('0x3e')](_0x4c6a64[_0x611d('0x39')]['fields']));_0x55d99a['attributes']=_0x55d99a['attributes'][_0x611d('0x3f')]?_0x55d99a[_0x611d('0x3c')]:_0x18be75['model'];if(!_0x4c6a64['query'][_0x611d('0x40')](_0x611d('0x41'))){_0x55d99a['limit']=qs[_0x611d('0x22')](_0x4c6a64['query'][_0x611d('0x22')]);_0x55d99a[_0x611d('0x20')]=qs[_0x611d('0x20')](_0x4c6a64[_0x611d('0x39')][_0x611d('0x20')]);}_0x55d99a[_0x611d('0x42')]=qs[_0x611d('0x43')](_0x4c6a64[_0x611d('0x39')][_0x611d('0x43')]);_0x55d99a[_0x611d('0x44')]=qs['filters'](_['pick'](_0x4c6a64[_0x611d('0x39')],_0x18be75[_0x611d('0x45')]),_0x125043);if(_0x4c6a64[_0x611d('0x39')][_0x611d('0x46')]){_0x55d99a[_0x611d('0x44')]=_[_0x611d('0x47')](_0x55d99a['where'],{'$or':_['map'](_0x125043,function(_0x2ba7c7){if(_0x2ba7c7['type']!==_0x611d('0x48')){var _0x219b14={};_0x219b14[_0x2ba7c7[_0x611d('0x31')]]={'$like':'%'+_0x4c6a64[_0x611d('0x39')][_0x611d('0x46')]+'%'};return _0x219b14;}})});}_0x55d99a=_[_0x611d('0x47')]({},_0x55d99a,_0x4c6a64[_0x611d('0x49')]);var _0x261a84={'where':_0x55d99a[_0x611d('0x44')]};return db[_0x611d('0x34')]['count'](_0x261a84)[_0x611d('0x29')](function(_0x1f4e16){_0x15e30c['count']=_0x1f4e16;if(_0x4c6a64[_0x611d('0x39')][_0x611d('0x4a')]){_0x55d99a[_0x611d('0x4b')]=[{'all':!![]}];}return db[_0x611d('0x34')][_0x611d('0x4c')](_0x55d99a);})[_0x611d('0x29')](function(_0x546ae6){_0x15e30c['rows']=_0x546ae6;return _0x15e30c;})[_0x611d('0x29')](respondWithFilteredResult(_0x139191,_0x55d99a))['catch'](handleError(_0x139191,null));};exports[_0x611d('0x4d')]=function(_0x5bb44a,_0x466af4){var _0x50dbfc={'raw':![],'where':{'id':_0x5bb44a[_0x611d('0x4e')]['id']}},_0x2dca0d={};_0x2dca0d[_0x611d('0x3b')]=_[_0x611d('0x3a')](db[_0x611d('0x34')][_0x611d('0x4f')]);_0x2dca0d['query']=_['keys'](_0x5bb44a[_0x611d('0x39')]);_0x2dca0d[_0x611d('0x45')]=_[_0x611d('0x3d')](_0x2dca0d[_0x611d('0x3b')],_0x2dca0d['query']);_0x50dbfc[_0x611d('0x3c')]=_[_0x611d('0x3d')](_0x2dca0d['model'],qs['fields'](_0x5bb44a[_0x611d('0x39')][_0x611d('0x3e')]));_0x50dbfc[_0x611d('0x3c')]=_0x50dbfc[_0x611d('0x3c')][_0x611d('0x3f')]?_0x50dbfc[_0x611d('0x3c')]:_0x2dca0d[_0x611d('0x3b')];if(_0x5bb44a[_0x611d('0x39')][_0x611d('0x4a')]){_0x50dbfc[_0x611d('0x4b')]=[{'all':!![]}];}_0x50dbfc=_[_0x611d('0x47')]({},_0x50dbfc,_0x5bb44a['options']);return db[_0x611d('0x34')][_0x611d('0x50')](_0x50dbfc)[_0x611d('0x29')](handleEntityNotFound(_0x466af4,null))['then'](respondWithResult(_0x466af4,null))[_0x611d('0x51')](handleError(_0x466af4,null));};exports['create']=function(_0x138011,_0x1bfb03){return db['Dashboard'][_0x611d('0x52')](_0x138011[_0x611d('0x53')],{})[_0x611d('0x29')](function(_0x3e95e2){var _0x25f989=_0x138011[_0x611d('0x54')][_0x611d('0x2b')]({'plain':!![]});if(!_0x25f989)throw new Error(_0x611d('0x55'));if(_0x25f989[_0x611d('0x56')]===_0x611d('0x54')){var _0x293319=_0x3e95e2[_0x611d('0x2b')]({'plain':!![]});var _0x3178e8=_0x611d('0x2c');return db['UserProfileSection'][_0x611d('0x50')]({'where':{'name':_0x3178e8,'userProfileId':_0x25f989[_0x611d('0x57')]},'raw':!![]})[_0x611d('0x29')](function(_0x4922df){if(_0x4922df&&_0x4922df[_0x611d('0x58')]===0x0){return db[_0x611d('0x2d')]['create']({'name':_0x293319[_0x611d('0x31')],'resourceId':_0x293319['id'],'type':_0x4922df[_0x611d('0x31')],'sectionId':_0x4922df['id']},{})[_0x611d('0x29')](function(){return _0x3e95e2;});}else{return _0x3e95e2;}})[_0x611d('0x51')](function(_0x29aee7){logger[_0x611d('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29aee7);throw _0x29aee7;});}return _0x3e95e2;})[_0x611d('0x29')](respondWithResult(_0x1bfb03,0xc9))[_0x611d('0x51')](handleError(_0x1bfb03,null));};exports['clone']=function(_0x3bd13d,_0x8fa345){var _0x1f3dec={'where':{'id':_0x3bd13d[_0x611d('0x4e')]['id']}},_0x1dcce2={};_0x1dcce2['model']=_[_0x611d('0x3a')](db[_0x611d('0x34')][_0x611d('0x4f')]);_0x1f3dec[_0x611d('0x3c')]=_[_0x611d('0x3d')](_0x1dcce2['model'],qs[_0x611d('0x3e')](_0x3bd13d[_0x611d('0x39')][_0x611d('0x3e')]));_0x1f3dec[_0x611d('0x3c')]=_0x1f3dec[_0x611d('0x3c')][_0x611d('0x3f')]?_0x1f3dec[_0x611d('0x3c')]:_0x1dcce2[_0x611d('0x3b')];if(_0x3bd13d['query'][_0x611d('0x4a')]){_0x1f3dec[_0x611d('0x4b')]=[{'all':!![]}];}_0x1f3dec=_[_0x611d('0x47')]({},_0x1f3dec,_0x3bd13d[_0x611d('0x49')]);return db['Dashboard'][_0x611d('0x50')](_0x1f3dec)[_0x611d('0x29')](handleEntityNotFound(_0x8fa345,null))[_0x611d('0x29')](function(_0x5822cf){if(_0x5822cf){var _0x3aa274=_0x5822cf[_0x611d('0x2b')]({'plain':!![]});_0x3aa274=qs[_0x611d('0x59')](_0x3aa274,['id',_0x611d('0x5a'),_0x611d('0x5b')]);_0x3bd13d['body']=_['omit'](_0x3bd13d[_0x611d('0x53')],['id',_0x611d('0x5a'),'updatedAt']);return db[_0x611d('0x34')][_0x611d('0x52')](_[_0x611d('0x47')](_0x3aa274,_0x3bd13d['body']),{'include':_0x3bd13d[_0x611d('0x39')][_0x611d('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0xe0b166){var _0x425dc2=_0x3bd13d[_0x611d('0x54')][_0x611d('0x2b')]({'plain':!![]});if(!_0x425dc2)throw new Error(_0x611d('0x55'));if(_0x425dc2['role']===_0x611d('0x54')){var _0x4b1a2d=_0xe0b166[_0x611d('0x2b')]({'plain':!![]});var _0x485ce0=_0x611d('0x2c');return db[_0x611d('0x5c')][_0x611d('0x50')]({'where':{'name':_0x485ce0,'userProfileId':_0x425dc2['userProfileId']},'raw':!![]})[_0x611d('0x29')](function(_0x5d2a9d){if(_0x5d2a9d&&_0x5d2a9d[_0x611d('0x58')]===0x0){return db[_0x611d('0x2d')][_0x611d('0x52')]({'name':_0x4b1a2d[_0x611d('0x31')],'resourceId':_0x4b1a2d['id'],'type':_0x5d2a9d[_0x611d('0x31')],'sectionId':_0x5d2a9d['id']},{})[_0x611d('0x29')](function(){return _0xe0b166;});}else{return _0xe0b166;}})[_0x611d('0x51')](function(_0x15f656){logger[_0x611d('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15f656);throw _0x15f656;});}return _0xe0b166;});}})[_0x611d('0x29')](respondWithResult(_0x8fa345,0xc9))[_0x611d('0x51')](handleError(_0x8fa345,null));};exports[_0x611d('0x28')]=function(_0x3ed052,_0x316bf6){if(_0x3ed052[_0x611d('0x53')]['id']){delete _0x3ed052[_0x611d('0x53')]['id'];}return db[_0x611d('0x34')][_0x611d('0x50')]({'where':{'id':_0x3ed052[_0x611d('0x4e')]['id']}})[_0x611d('0x29')](handleEntityNotFound(_0x316bf6,null))[_0x611d('0x29')](saveUpdates(_0x3ed052['body'],null))['then'](respondWithResult(_0x316bf6,null))['catch'](handleError(_0x316bf6,null));};exports[_0x611d('0x2a')]=function(_0x19b479,_0xe61248){return db[_0x611d('0x34')][_0x611d('0x50')]({'where':{'id':_0x19b479[_0x611d('0x4e')]['id']}})[_0x611d('0x29')](handleEntityNotFound(_0xe61248,null))['then'](removeEntity(_0xe61248,null))[_0x611d('0x51')](handleError(_0xe61248,null));};function widgetAttributes(_0x1cf6b1){try{switch(_0x1cf6b1[_0x611d('0x36')]){case _0x611d('0x5d'):return[{'name':_0x611d('0x5e'),'value':_0x1cf6b1[_0x611d('0x5e')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1['attrs'][0x0]?_0x1cf6b1[_0x611d('0x5f')][0x0]['value']:undefined)||_0x611d('0x60')}];case _0x611d('0x61'):return[{'name':_0x611d('0x62'),'value':_0x1cf6b1[_0x611d('0x62')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x0]?_0x1cf6b1[_0x611d('0x5f')][0x0][_0x611d('0x63')]:undefined)||''}];case _0x611d('0x64'):return[{'name':_0x611d('0x65'),'value':_0x1cf6b1[_0x611d('0x65')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x0]?_0x1cf6b1[_0x611d('0x5f')][0x0][_0x611d('0x63')]:undefined)||_0x611d('0x66')},{'name':_0x611d('0x67'),'value':_0x1cf6b1['attrTimezone']||(_0x1cf6b1['attrs']&&_0x1cf6b1[_0x611d('0x5f')][0x1]?_0x1cf6b1[_0x611d('0x5f')][0x1][_0x611d('0x63')]:undefined)||'0.00'},{'name':_0x611d('0x68'),'value':_0x1cf6b1[_0x611d('0x68')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x2]?_0x1cf6b1[_0x611d('0x5f')][0x2][_0x611d('0x63')]:undefined)||0xc}];case _0x611d('0x69'):return[{'name':_0x611d('0x6a'),'value':_0x1cf6b1['attrMetric']||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1['attrs'][0x0]?_0x1cf6b1[_0x611d('0x5f')][0x0][_0x611d('0x63')]:undefined)||'total'},{'name':_0x611d('0x6b'),'value':_0x1cf6b1[_0x611d('0x6b')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x1]?_0x1cf6b1[_0x611d('0x5f')][0x1][_0x611d('0x63')]:undefined)||[]},{'name':'attrFontSize','value':_0x1cf6b1[_0x611d('0x68')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1['attrs'][0x2]?_0x1cf6b1[_0x611d('0x5f')][0x2][_0x611d('0x63')]:undefined)||0x14},{'name':_0x611d('0x6c'),'value':_0x1cf6b1[_0x611d('0x6c')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1['attrs'][0x3]?_0x1cf6b1['attrs'][0x3]['value']:undefined)||_0x611d('0x6d')},{'name':_0x611d('0x6e'),'value':_0x1cf6b1[_0x611d('0x6e')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x4]?_0x1cf6b1['attrs'][0x4]['value']:undefined)||''},{'name':_0x611d('0x6f'),'value':_0x1cf6b1[_0x611d('0x6f')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x5]?_0x1cf6b1['attrs'][0x5][_0x611d('0x63')]:undefined)||''},{'name':_0x611d('0x70'),'value':_0x1cf6b1['attrSmsAccounts']||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1['attrs'][0x6]?_0x1cf6b1[_0x611d('0x5f')][0x6]['value']:undefined)||''},{'name':_0x611d('0x71'),'value':_0x1cf6b1[_0x611d('0x71')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x7]?_0x1cf6b1['attrs'][0x7][_0x611d('0x63')]:undefined)||''},{'name':_0x611d('0x72'),'value':_0x1cf6b1[_0x611d('0x72')]||(_0x1cf6b1['attrs']&&_0x1cf6b1['attrs'][0x8]?_0x1cf6b1[_0x611d('0x5f')][0x8][_0x611d('0x63')]:undefined)||''},{'name':_0x611d('0x73'),'value':_0x1cf6b1[_0x611d('0x73')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x9]?_0x1cf6b1['attrs'][0x9][_0x611d('0x63')]:undefined)||''}];case'multibar-chart':case _0x611d('0x74'):return[{'name':_0x611d('0x75'),'value':_0x1cf6b1['attrSerie1']||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1['attrs'][0x0]?_0x1cf6b1[_0x611d('0x5f')][0x0][_0x611d('0x63')]:undefined)||_0x611d('0x76')},{'name':_0x611d('0x77'),'value':_0x1cf6b1[_0x611d('0x77')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1['attrs'][0x1]?_0x1cf6b1[_0x611d('0x5f')][0x1][_0x611d('0x63')]:undefined)||null},{'name':_0x611d('0x78'),'value':_0x1cf6b1['attrSerie3']||(_0x1cf6b1['attrs']&&_0x1cf6b1[_0x611d('0x5f')][0x2]?_0x1cf6b1[_0x611d('0x5f')][0x2][_0x611d('0x63')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1cf6b1[_0x611d('0x6b')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1['attrs'][0x3]?_0x1cf6b1[_0x611d('0x5f')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x1cf6b1[_0x611d('0x6c')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x4]?_0x1cf6b1['attrs'][0x4][_0x611d('0x63')]:undefined)||_0x611d('0x6d')},{'name':_0x611d('0x6e'),'value':_0x1cf6b1[_0x611d('0x6e')]||(_0x1cf6b1['attrs']&&_0x1cf6b1['attrs'][0x5]?_0x1cf6b1['attrs'][0x5][_0x611d('0x63')]:undefined)||''},{'name':_0x611d('0x6f'),'value':_0x1cf6b1[_0x611d('0x6f')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x6]?_0x1cf6b1[_0x611d('0x5f')][0x6][_0x611d('0x63')]:undefined)||''},{'name':_0x611d('0x70'),'value':_0x1cf6b1[_0x611d('0x70')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x7]?_0x1cf6b1[_0x611d('0x5f')][0x7][_0x611d('0x63')]:undefined)||''},{'name':_0x611d('0x71'),'value':_0x1cf6b1[_0x611d('0x71')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1['attrs'][0x8]?_0x1cf6b1[_0x611d('0x5f')][0x8]['value']:undefined)||''},{'name':_0x611d('0x72'),'value':_0x1cf6b1['attrWhatsappAccounts']||(_0x1cf6b1['attrs']&&_0x1cf6b1[_0x611d('0x5f')][0x9]?_0x1cf6b1[_0x611d('0x5f')][0x9][_0x611d('0x63')]:undefined)||''},{'name':_0x611d('0x73'),'value':_0x1cf6b1[_0x611d('0x73')]||(_0x1cf6b1['attrs']&&_0x1cf6b1[_0x611d('0x5f')][0xa]?_0x1cf6b1[_0x611d('0x5f')][0xa][_0x611d('0x63')]:undefined)||''}];case _0x611d('0x79'):return[{'name':'attrReport','type':_0x1cf6b1[_0x611d('0x7a')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x0]?_0x1cf6b1[_0x611d('0x5f')][0x0][_0x611d('0x36')]:undefined)||null,'value':_0x1cf6b1[_0x611d('0x7b')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1['attrs'][0x0]?_0x1cf6b1[_0x611d('0x5f')][0x0][_0x611d('0x63')]:undefined)||null},{'name':_0x611d('0x7c'),'value':_0x1cf6b1[_0x611d('0x7c')]||(_0x1cf6b1[_0x611d('0x5f')]&&_0x1cf6b1[_0x611d('0x5f')][0x1]?_0x1cf6b1[_0x611d('0x5f')][0x1][_0x611d('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x262cd9){logger[_0x611d('0x2f')](_0x611d('0x7d'),JSON[_0x611d('0x7e')](_0x262cd9));return[];}}exports[_0x611d('0x7f')]=function(_0x593ff,_0x36fead,_0x2d7f7b){if(_0x593ff['body']['id']){delete _0x593ff[_0x611d('0x53')]['id'];}return db[_0x611d('0x34')][_0x611d('0x50')]({'where':{'id':_0x593ff[_0x611d('0x4e')]['id']}})[_0x611d('0x29')](handleEntityNotFound(_0x36fead,null))['then'](function(_0x43296e){if(_0x43296e){_0x593ff['body'][_0x611d('0x80')]=_0x43296e['id'];_0x593ff[_0x611d('0x53')]['attrs']=widgetAttributes(_0x593ff['body']);return db['DashboardItem'][_0x611d('0x52')](_0x593ff[_0x611d('0x53')]);}})[_0x611d('0x29')](respondWithResult(_0x36fead,null))[_0x611d('0x51')](handleError(_0x36fead,null));};exports[_0x611d('0x81')]=function(_0x16b937,_0x40a22c,_0x405593){var _0x919bf={};var _0x5e2041={};var _0x184df9;var _0x2b2c57;return db[_0x611d('0x34')][_0x611d('0x82')]({'where':{'id':_0x16b937[_0x611d('0x4e')]['id']}})[_0x611d('0x29')](handleEntityNotFound(_0x40a22c,null))[_0x611d('0x29')](function(_0x2df957){if(_0x2df957){_0x184df9=_0x2df957;_0x5e2041['model']=_['keys'](db[_0x611d('0x83')]['rawAttributes']);_0x5e2041[_0x611d('0x39')]=_['keys'](_0x16b937[_0x611d('0x39')]);_0x5e2041[_0x611d('0x45')]=_[_0x611d('0x3d')](_0x5e2041[_0x611d('0x3b')],_0x5e2041['query']);_0x919bf[_0x611d('0x3c')]=_['intersection'](_0x5e2041[_0x611d('0x3b')],qs['fields'](_0x16b937[_0x611d('0x39')][_0x611d('0x3e')]));_0x919bf[_0x611d('0x3c')]=_0x919bf[_0x611d('0x3c')][_0x611d('0x3f')]?_0x919bf[_0x611d('0x3c')]:_0x5e2041['model'];_0x919bf['order']=qs['sort'](_0x16b937[_0x611d('0x39')][_0x611d('0x43')]);_0x919bf[_0x611d('0x44')]=qs[_0x611d('0x45')](_[_0x611d('0x84')](_0x16b937[_0x611d('0x39')],_0x5e2041[_0x611d('0x45')]));if(_0x16b937['query'][_0x611d('0x46')]){_0x919bf[_0x611d('0x44')]=_[_0x611d('0x47')](_0x919bf[_0x611d('0x44')],{'$or':_[_0x611d('0x38')](_0x919bf[_0x611d('0x3c')],function(_0x582e46){var _0xa3d7cf={};_0xa3d7cf[_0x582e46]={'$like':'%'+_0x16b937[_0x611d('0x39')][_0x611d('0x46')]+'%'};return _0xa3d7cf;})});}_0x919bf=_[_0x611d('0x47')]({},_0x919bf,_0x16b937['options']);return _0x184df9[_0x611d('0x81')](_0x919bf);}})[_0x611d('0x29')](function(_0x53a960){if(_0x53a960){_0x2b2c57=_0x53a960['length'];if(!_0x16b937[_0x611d('0x39')][_0x611d('0x40')](_0x611d('0x41'))){_0x919bf[_0x611d('0x22')]=qs[_0x611d('0x22')](_0x16b937[_0x611d('0x39')][_0x611d('0x22')]);_0x919bf[_0x611d('0x20')]=qs['offset'](_0x16b937[_0x611d('0x39')][_0x611d('0x20')]);}return _0x184df9[_0x611d('0x81')](_0x919bf);}})[_0x611d('0x29')](function(_0x2d56c6){if(_0x2d56c6){return _0x2d56c6?{'count':_0x2b2c57,'rows':_0x2d56c6}:null;}})['then'](respondWithResult(_0x40a22c,null))[_0x611d('0x51')](handleError(_0x40a22c,null));}; \ No newline at end of file +var _0x2bd8=['to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','register','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','end','error','stack','name','send','index','Dashboard','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','iframe','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','pick','filter','nolimit','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x67adb,_0x2a6aa9){var _0x2f9c65=function(_0x2b9efe){while(--_0x2b9efe){_0x67adb['push'](_0x67adb['shift']());}};_0x2f9c65(++_0x2a6aa9);}(_0x2bd8,0x70));var _0x82bd=function(_0x58f399,_0x5867e6){_0x58f399=_0x58f399-0x0;var _0x2c0bb0=_0x2bd8[_0x58f399];return _0x2c0bb0;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require(_0x82bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82bd('0x2'));var rp=require('request-promise');var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var Mustache=require('mustache');var util=require(_0x82bd('0x5'));var path=require('path');var sox=require(_0x82bd('0x6'));var csv=require('to-csv');var ejs=require(_0x82bd('0x7'));var fs=require('fs');var fs_extra=require(_0x82bd('0x8'));var _=require(_0x82bd('0x9'));var squel=require(_0x82bd('0xa'));var crypto=require(_0x82bd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x82bd('0xc'));var toCsv=require(_0x82bd('0xd'));var querystring=require('querystring');var Papa=require(_0x82bd('0xe'));var Redis=require(_0x82bd('0xf'));var authService=require(_0x82bd('0x10'));var qs=require(_0x82bd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x12'));var logger=require(_0x82bd('0x13'))(_0x82bd('0x14'));var utils=require(_0x82bd('0x15'));var config=require(_0x82bd('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x82bd('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x82bd('0x18')](socket);function respondWithStatusCode(_0x195b67,_0x4cf7ad){_0x4cf7ad=_0x4cf7ad||0xcc;return function(_0x24f269){if(_0x24f269){return _0x195b67[_0x82bd('0x19')](_0x4cf7ad);}return _0x195b67[_0x82bd('0x1a')](_0x4cf7ad)['end']();};}function respondWithResult(_0x216c9c,_0x319166){_0x319166=_0x319166||0xc8;return function(_0x376dc6){if(_0x376dc6){return _0x216c9c[_0x82bd('0x1a')](_0x319166)['json'](_0x376dc6);}};}function respondWithFilteredResult(_0x1c329b,_0x23cfd7){return function(_0x55eff7){if(_0x55eff7){var _0x28002b=typeof _0x23cfd7[_0x82bd('0x1b')]===_0x82bd('0x1c')&&typeof _0x23cfd7[_0x82bd('0x1d')]===_0x82bd('0x1c');var _0x36bb45=_0x55eff7[_0x82bd('0x1e')];var _0x5227e8=_0x28002b?0x0:_0x23cfd7[_0x82bd('0x1b')];var _0x1e31d4=_0x28002b?_0x55eff7[_0x82bd('0x1e')]:_0x23cfd7[_0x82bd('0x1b')]+_0x23cfd7[_0x82bd('0x1d')];var _0x20cc1a;if(_0x1e31d4>=_0x36bb45){_0x1e31d4=_0x36bb45;_0x20cc1a=0xc8;}else{_0x20cc1a=0xce;}_0x1c329b['status'](_0x20cc1a);return _0x1c329b[_0x82bd('0x1f')]('Content-Range',_0x5227e8+'-'+_0x1e31d4+'/'+_0x36bb45)['json'](_0x55eff7);}return null;};}function patchUpdates(_0x25617c){return function(_0x1eb5c4){try{jsonpatch[_0x82bd('0x20')](_0x1eb5c4,_0x25617c,!![]);}catch(_0x2815f6){return BPromise[_0x82bd('0x21')](_0x2815f6);}return _0x1eb5c4[_0x82bd('0x22')]();};}function saveUpdates(_0x1515aa,_0x41a11f){return function(_0x5acad1){if(_0x5acad1){return _0x5acad1[_0x82bd('0x23')](_0x1515aa)['then'](function(_0x2b491b){return _0x2b491b;});}return null;};}function removeEntity(_0x2672df,_0x27ee90){return function(_0x4e19cf){if(_0x4e19cf){return _0x4e19cf[_0x82bd('0x24')]()[_0x82bd('0x25')](function(){var _0x4510ff=_0x4e19cf[_0x82bd('0x26')]({'plain':!![]});var _0x451ced=_0x82bd('0x27');return db[_0x82bd('0x28')]['destroy']({'where':{'type':_0x451ced,'resourceId':_0x4510ff['id']}})[_0x82bd('0x25')](function(){return _0x4e19cf;});})[_0x82bd('0x25')](function(){_0x2672df[_0x82bd('0x1a')](0xcc)[_0x82bd('0x29')]();});}};}function handleEntityNotFound(_0x34f27d,_0x594d2d){return function(_0x1ef3b1){if(!_0x1ef3b1){_0x34f27d['sendStatus'](0x194);}return _0x1ef3b1;};}function handleError(_0x434746,_0x2e2aa1){_0x2e2aa1=_0x2e2aa1||0x1f4;return function(_0x351a5c){logger[_0x82bd('0x2a')](_0x351a5c[_0x82bd('0x2b')]);if(_0x351a5c[_0x82bd('0x2c')]){delete _0x351a5c[_0x82bd('0x2c')];}_0x434746[_0x82bd('0x1a')](_0x2e2aa1)[_0x82bd('0x2d')](_0x351a5c);};}exports[_0x82bd('0x2e')]=function(_0x2acd69,_0x489b3e){var _0x131340={},_0x9d6147={},_0xccb59b={'count':0x0,'rows':[]};var _0x48dd40=_['map'](db[_0x82bd('0x2f')][_0x82bd('0x30')],function(_0x5e3997){return{'name':_0x5e3997['fieldName'],'type':_0x5e3997[_0x82bd('0x31')][_0x82bd('0x32')]};});_0x9d6147[_0x82bd('0x33')]=_[_0x82bd('0x34')](_0x48dd40,_0x82bd('0x2c'));_0x9d6147[_0x82bd('0x35')]=_[_0x82bd('0x36')](_0x2acd69[_0x82bd('0x35')]);_0x9d6147[_0x82bd('0x37')]=_[_0x82bd('0x38')](_0x9d6147[_0x82bd('0x33')],_0x9d6147[_0x82bd('0x35')]);_0x131340[_0x82bd('0x39')]=_['intersection'](_0x9d6147[_0x82bd('0x33')],qs[_0x82bd('0x3a')](_0x2acd69['query'][_0x82bd('0x3a')]));_0x131340[_0x82bd('0x39')]=_0x131340[_0x82bd('0x39')][_0x82bd('0x3b')]?_0x131340['attributes']:_0x9d6147['model'];if(!_0x2acd69[_0x82bd('0x35')][_0x82bd('0x3c')]('nolimit')){_0x131340[_0x82bd('0x1d')]=qs[_0x82bd('0x1d')](_0x2acd69[_0x82bd('0x35')]['limit']);_0x131340[_0x82bd('0x1b')]=qs['offset'](_0x2acd69['query']['offset']);}_0x131340['order']=qs['sort'](_0x2acd69[_0x82bd('0x35')][_0x82bd('0x3d')]);_0x131340[_0x82bd('0x3e')]=qs[_0x82bd('0x37')](_['pick'](_0x2acd69[_0x82bd('0x35')],_0x9d6147[_0x82bd('0x37')]),_0x48dd40);if(_0x2acd69[_0x82bd('0x35')]['filter']){_0x131340['where']=_[_0x82bd('0x3f')](_0x131340[_0x82bd('0x3e')],{'$or':_[_0x82bd('0x34')](_0x48dd40,function(_0x5ac7ab){if(_0x5ac7ab[_0x82bd('0x31')]!=='VIRTUAL'){var _0x3726bc={};_0x3726bc[_0x5ac7ab[_0x82bd('0x2c')]]={'$like':'%'+_0x2acd69[_0x82bd('0x35')]['filter']+'%'};return _0x3726bc;}})});}_0x131340=_[_0x82bd('0x3f')]({},_0x131340,_0x2acd69['options']);var _0x4f77ad={'where':_0x131340[_0x82bd('0x3e')]};return db[_0x82bd('0x2f')][_0x82bd('0x1e')](_0x4f77ad)['then'](function(_0x10e586){_0xccb59b[_0x82bd('0x1e')]=_0x10e586;if(_0x2acd69['query'][_0x82bd('0x40')]){_0x131340[_0x82bd('0x41')]=[{'all':!![]}];}return db[_0x82bd('0x2f')][_0x82bd('0x42')](_0x131340);})[_0x82bd('0x25')](function(_0x220e03){_0xccb59b[_0x82bd('0x43')]=_0x220e03;return _0xccb59b;})['then'](respondWithFilteredResult(_0x489b3e,_0x131340))['catch'](handleError(_0x489b3e,null));};exports[_0x82bd('0x44')]=function(_0x121fe4,_0xdbc81){var _0x1a1e48={'raw':![],'where':{'id':_0x121fe4[_0x82bd('0x45')]['id']}},_0x43ad25={};_0x43ad25[_0x82bd('0x33')]=_[_0x82bd('0x36')](db[_0x82bd('0x2f')][_0x82bd('0x30')]);_0x43ad25[_0x82bd('0x35')]=_['keys'](_0x121fe4[_0x82bd('0x35')]);_0x43ad25[_0x82bd('0x37')]=_[_0x82bd('0x38')](_0x43ad25[_0x82bd('0x33')],_0x43ad25['query']);_0x1a1e48[_0x82bd('0x39')]=_[_0x82bd('0x38')](_0x43ad25[_0x82bd('0x33')],qs[_0x82bd('0x3a')](_0x121fe4[_0x82bd('0x35')]['fields']));_0x1a1e48[_0x82bd('0x39')]=_0x1a1e48[_0x82bd('0x39')]['length']?_0x1a1e48[_0x82bd('0x39')]:_0x43ad25[_0x82bd('0x33')];if(_0x121fe4[_0x82bd('0x35')][_0x82bd('0x40')]){_0x1a1e48[_0x82bd('0x41')]=[{'all':!![]}];}_0x1a1e48=_[_0x82bd('0x3f')]({},_0x1a1e48,_0x121fe4[_0x82bd('0x46')]);return db[_0x82bd('0x2f')][_0x82bd('0x47')](_0x1a1e48)[_0x82bd('0x25')](handleEntityNotFound(_0xdbc81,null))[_0x82bd('0x25')](respondWithResult(_0xdbc81,null))[_0x82bd('0x48')](handleError(_0xdbc81,null));};exports[_0x82bd('0x49')]=function(_0xdfe3c,_0x43d2a1){return db[_0x82bd('0x2f')][_0x82bd('0x49')](_0xdfe3c[_0x82bd('0x4a')],{})[_0x82bd('0x25')](function(_0x203acf){var _0x16392d=_0xdfe3c['user'][_0x82bd('0x26')]({'plain':!![]});if(!_0x16392d)throw new Error(_0x82bd('0x4b'));if(_0x16392d[_0x82bd('0x4c')]===_0x82bd('0x4d')){var _0x488022=_0x203acf['get']({'plain':!![]});var _0x4ce1b5=_0x82bd('0x27');return db[_0x82bd('0x4e')][_0x82bd('0x47')]({'where':{'name':_0x4ce1b5,'userProfileId':_0x16392d[_0x82bd('0x4f')]},'raw':!![]})['then'](function(_0x309748){if(_0x309748&&_0x309748[_0x82bd('0x50')]===0x0){return db[_0x82bd('0x28')]['create']({'name':_0x488022[_0x82bd('0x2c')],'resourceId':_0x488022['id'],'type':_0x309748['name'],'sectionId':_0x309748['id']},{})['then'](function(){return _0x203acf;});}else{return _0x203acf;}})[_0x82bd('0x48')](function(_0x2b76b4){logger[_0x82bd('0x2a')](_0x82bd('0x51'),_0x2b76b4);throw _0x2b76b4;});}return _0x203acf;})[_0x82bd('0x25')](respondWithResult(_0x43d2a1,0xc9))['catch'](handleError(_0x43d2a1,null));};exports[_0x82bd('0x52')]=function(_0x3ffc38,_0x1dcc7a){var _0x5e2623={'where':{'id':_0x3ffc38[_0x82bd('0x45')]['id']}},_0x31b4bf={};_0x31b4bf[_0x82bd('0x33')]=_[_0x82bd('0x36')](db[_0x82bd('0x2f')][_0x82bd('0x30')]);_0x5e2623[_0x82bd('0x39')]=_[_0x82bd('0x38')](_0x31b4bf[_0x82bd('0x33')],qs[_0x82bd('0x3a')](_0x3ffc38[_0x82bd('0x35')][_0x82bd('0x3a')]));_0x5e2623[_0x82bd('0x39')]=_0x5e2623['attributes'][_0x82bd('0x3b')]?_0x5e2623[_0x82bd('0x39')]:_0x31b4bf[_0x82bd('0x33')];if(_0x3ffc38[_0x82bd('0x35')][_0x82bd('0x40')]){_0x5e2623[_0x82bd('0x41')]=[{'all':!![]}];}_0x5e2623=_[_0x82bd('0x3f')]({},_0x5e2623,_0x3ffc38[_0x82bd('0x46')]);return db[_0x82bd('0x2f')][_0x82bd('0x47')](_0x5e2623)[_0x82bd('0x25')](handleEntityNotFound(_0x1dcc7a,null))[_0x82bd('0x25')](function(_0x3e7b30){if(_0x3e7b30){var _0x1b1bb7=_0x3e7b30[_0x82bd('0x26')]({'plain':!![]});_0x1b1bb7=qs['omit'](_0x1b1bb7,['id',_0x82bd('0x53'),_0x82bd('0x54')]);_0x3ffc38['body']=_[_0x82bd('0x55')](_0x3ffc38[_0x82bd('0x4a')],['id',_0x82bd('0x53'),'updatedAt']);return db[_0x82bd('0x2f')][_0x82bd('0x49')](_[_0x82bd('0x3f')](_0x1b1bb7,_0x3ffc38['body']),{'include':_0x3ffc38['query'][_0x82bd('0x40')]?[{'all':!![]}]:undefined})[_0x82bd('0x25')](function(_0x53eb28){var _0x58b027=_0x3ffc38['user']['get']({'plain':!![]});if(!_0x58b027)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58b027['role']==='user'){var _0xecc4de=_0x53eb28[_0x82bd('0x26')]({'plain':!![]});var _0x5e21a7=_0x82bd('0x27');return db[_0x82bd('0x4e')]['find']({'where':{'name':_0x5e21a7,'userProfileId':_0x58b027[_0x82bd('0x4f')]},'raw':!![]})[_0x82bd('0x25')](function(_0xcc38bb){if(_0xcc38bb&&_0xcc38bb[_0x82bd('0x50')]===0x0){return db[_0x82bd('0x28')]['create']({'name':_0xecc4de[_0x82bd('0x2c')],'resourceId':_0xecc4de['id'],'type':_0xcc38bb[_0x82bd('0x2c')],'sectionId':_0xcc38bb['id']},{})['then'](function(){return _0x53eb28;});}else{return _0x53eb28;}})[_0x82bd('0x48')](function(_0x15f554){logger[_0x82bd('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15f554);throw _0x15f554;});}return _0x53eb28;});}})[_0x82bd('0x25')](respondWithResult(_0x1dcc7a,0xc9))[_0x82bd('0x48')](handleError(_0x1dcc7a,null));};exports[_0x82bd('0x23')]=function(_0x1dc148,_0x43cea9){if(_0x1dc148[_0x82bd('0x4a')]['id']){delete _0x1dc148[_0x82bd('0x4a')]['id'];}return db[_0x82bd('0x2f')][_0x82bd('0x47')]({'where':{'id':_0x1dc148['params']['id']}})[_0x82bd('0x25')](handleEntityNotFound(_0x43cea9,null))[_0x82bd('0x25')](saveUpdates(_0x1dc148[_0x82bd('0x4a')],null))[_0x82bd('0x25')](respondWithResult(_0x43cea9,null))[_0x82bd('0x48')](handleError(_0x43cea9,null));};exports[_0x82bd('0x24')]=function(_0x3e2d47,_0x51f4ab){return db[_0x82bd('0x2f')][_0x82bd('0x47')]({'where':{'id':_0x3e2d47[_0x82bd('0x45')]['id']}})['then'](handleEntityNotFound(_0x51f4ab,null))[_0x82bd('0x25')](removeEntity(_0x51f4ab,null))[_0x82bd('0x48')](handleError(_0x51f4ab,null));};function widgetAttributes(_0x267e80){try{switch(_0x267e80[_0x82bd('0x31')]){case _0x82bd('0x56'):return[{'name':'attrUrl','value':_0x267e80['attrUrl']||(_0x267e80['attrs']&&_0x267e80[_0x82bd('0x57')][0x0]?_0x267e80[_0x82bd('0x57')][0x0][_0x82bd('0x58')]:undefined)||_0x82bd('0x59')}];case'custom':return[{'name':_0x82bd('0x5a'),'value':_0x267e80[_0x82bd('0x5a')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80['attrs'][0x0]?_0x267e80[_0x82bd('0x57')][0x0][_0x82bd('0x58')]:undefined)||''}];case _0x82bd('0x5b'):return[{'name':'attrHourFormat','value':_0x267e80[_0x82bd('0x5c')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x0]?_0x267e80['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x82bd('0x5d'),'value':_0x267e80[_0x82bd('0x5d')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x1]?_0x267e80[_0x82bd('0x57')][0x1][_0x82bd('0x58')]:undefined)||'0.00'},{'name':_0x82bd('0x5e'),'value':_0x267e80['attrFontSize']||(_0x267e80['attrs']&&_0x267e80[_0x82bd('0x57')][0x2]?_0x267e80[_0x82bd('0x57')][0x2][_0x82bd('0x58')]:undefined)||0xc}];case _0x82bd('0x5f'):return[{'name':_0x82bd('0x60'),'value':_0x267e80[_0x82bd('0x60')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x0]?_0x267e80['attrs'][0x0][_0x82bd('0x58')]:undefined)||_0x82bd('0x61')},{'name':_0x82bd('0x62'),'value':_0x267e80[_0x82bd('0x62')]||(_0x267e80['attrs']&&_0x267e80[_0x82bd('0x57')][0x1]?_0x267e80[_0x82bd('0x57')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x267e80[_0x82bd('0x5e')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x2]?_0x267e80[_0x82bd('0x57')][0x2][_0x82bd('0x58')]:undefined)||0x14},{'name':_0x82bd('0x63'),'value':_0x267e80[_0x82bd('0x63')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x3]?_0x267e80[_0x82bd('0x57')][0x3]['value']:undefined)||_0x82bd('0x64')},{'name':'attrEmailAccounts','value':_0x267e80['attrEmailAccounts']||(_0x267e80[_0x82bd('0x57')]&&_0x267e80['attrs'][0x4]?_0x267e80[_0x82bd('0x57')][0x4][_0x82bd('0x58')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x267e80[_0x82bd('0x65')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x5]?_0x267e80[_0x82bd('0x57')][0x5][_0x82bd('0x58')]:undefined)||''},{'name':_0x82bd('0x66'),'value':_0x267e80[_0x82bd('0x66')]||(_0x267e80['attrs']&&_0x267e80[_0x82bd('0x57')][0x6]?_0x267e80[_0x82bd('0x57')][0x6][_0x82bd('0x58')]:undefined)||''},{'name':_0x82bd('0x67'),'value':_0x267e80[_0x82bd('0x67')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x7]?_0x267e80[_0x82bd('0x57')][0x7][_0x82bd('0x58')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x267e80[_0x82bd('0x68')]||(_0x267e80['attrs']&&_0x267e80[_0x82bd('0x57')][0x8]?_0x267e80[_0x82bd('0x57')][0x8][_0x82bd('0x58')]:undefined)||''},{'name':_0x82bd('0x69'),'value':_0x267e80[_0x82bd('0x69')]||(_0x267e80['attrs']&&_0x267e80[_0x82bd('0x57')][0x9]?_0x267e80[_0x82bd('0x57')][0x9][_0x82bd('0x58')]:undefined)||''}];case _0x82bd('0x6a'):case'pie-chart':return[{'name':_0x82bd('0x6b'),'value':_0x267e80[_0x82bd('0x6b')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x0]?_0x267e80[_0x82bd('0x57')][0x0][_0x82bd('0x58')]:undefined)||_0x82bd('0x61')},{'name':_0x82bd('0x6c'),'value':_0x267e80['attrSerie2']||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x1]?_0x267e80[_0x82bd('0x57')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x267e80[_0x82bd('0x6d')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x2]?_0x267e80['attrs'][0x2][_0x82bd('0x58')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x267e80['attrVoiceQueues']||(_0x267e80[_0x82bd('0x57')]&&_0x267e80['attrs'][0x3]?_0x267e80[_0x82bd('0x57')][0x3][_0x82bd('0x58')]:undefined)||[]},{'name':'attrChannel','value':_0x267e80['attrChannel']||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x4]?_0x267e80[_0x82bd('0x57')][0x4][_0x82bd('0x58')]:undefined)||_0x82bd('0x64')},{'name':_0x82bd('0x6e'),'value':_0x267e80[_0x82bd('0x6e')]||(_0x267e80['attrs']&&_0x267e80['attrs'][0x5]?_0x267e80[_0x82bd('0x57')][0x5][_0x82bd('0x58')]:undefined)||''},{'name':_0x82bd('0x65'),'value':_0x267e80[_0x82bd('0x65')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x6]?_0x267e80['attrs'][0x6]['value']:undefined)||''},{'name':_0x82bd('0x66'),'value':_0x267e80[_0x82bd('0x66')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x7]?_0x267e80[_0x82bd('0x57')][0x7][_0x82bd('0x58')]:undefined)||''},{'name':_0x82bd('0x67'),'value':_0x267e80[_0x82bd('0x67')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x8]?_0x267e80[_0x82bd('0x57')][0x8][_0x82bd('0x58')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x267e80[_0x82bd('0x68')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x9]?_0x267e80[_0x82bd('0x57')][0x9][_0x82bd('0x58')]:undefined)||''},{'name':_0x82bd('0x69'),'value':_0x267e80[_0x82bd('0x69')]||(_0x267e80['attrs']&&_0x267e80[_0x82bd('0x57')][0xa]?_0x267e80['attrs'][0xa][_0x82bd('0x58')]:undefined)||''}];case _0x82bd('0x6f'):return[{'name':_0x82bd('0x70'),'type':_0x267e80[_0x82bd('0x71')]||(_0x267e80[_0x82bd('0x57')]&&_0x267e80[_0x82bd('0x57')][0x0]?_0x267e80[_0x82bd('0x57')][0x0][_0x82bd('0x31')]:undefined)||null,'value':_0x267e80['attrReport']||(_0x267e80['attrs']&&_0x267e80[_0x82bd('0x57')][0x0]?_0x267e80['attrs'][0x0]['value']:undefined)||null},{'name':_0x82bd('0x72'),'value':_0x267e80[_0x82bd('0x72')]||(_0x267e80['attrs']&&_0x267e80[_0x82bd('0x57')][0x1]?_0x267e80[_0x82bd('0x57')][0x1][_0x82bd('0x58')]:undefined)||0x0}];default:return[];}}catch(_0x890e89){logger[_0x82bd('0x2a')]('widgetAttributes:\x20%s',JSON[_0x82bd('0x73')](_0x890e89));return[];}}exports[_0x82bd('0x74')]=function(_0x12ebe0,_0x21aa8d,_0x1e783d){if(_0x12ebe0[_0x82bd('0x4a')]['id']){delete _0x12ebe0['body']['id'];}return db[_0x82bd('0x2f')]['find']({'where':{'id':_0x12ebe0[_0x82bd('0x45')]['id']}})[_0x82bd('0x25')](handleEntityNotFound(_0x21aa8d,null))['then'](function(_0x25b0ca){if(_0x25b0ca){_0x12ebe0[_0x82bd('0x4a')][_0x82bd('0x75')]=_0x25b0ca['id'];_0x12ebe0[_0x82bd('0x4a')]['attrs']=widgetAttributes(_0x12ebe0[_0x82bd('0x4a')]);return db[_0x82bd('0x76')][_0x82bd('0x49')](_0x12ebe0[_0x82bd('0x4a')]);}})[_0x82bd('0x25')](respondWithResult(_0x21aa8d,null))[_0x82bd('0x48')](handleError(_0x21aa8d,null));};exports[_0x82bd('0x77')]=function(_0x2fe384,_0xa9fdf8,_0x2d94b6){var _0x57f3d2={};var _0x2c1770={};var _0x938f4f;var _0x2daf13;return db[_0x82bd('0x2f')][_0x82bd('0x78')]({'where':{'id':_0x2fe384[_0x82bd('0x45')]['id']}})[_0x82bd('0x25')](handleEntityNotFound(_0xa9fdf8,null))[_0x82bd('0x25')](function(_0xe022bd){if(_0xe022bd){_0x938f4f=_0xe022bd;_0x2c1770['model']=_[_0x82bd('0x36')](db[_0x82bd('0x76')]['rawAttributes']);_0x2c1770[_0x82bd('0x35')]=_['keys'](_0x2fe384[_0x82bd('0x35')]);_0x2c1770[_0x82bd('0x37')]=_[_0x82bd('0x38')](_0x2c1770['model'],_0x2c1770[_0x82bd('0x35')]);_0x57f3d2[_0x82bd('0x39')]=_[_0x82bd('0x38')](_0x2c1770['model'],qs[_0x82bd('0x3a')](_0x2fe384[_0x82bd('0x35')][_0x82bd('0x3a')]));_0x57f3d2[_0x82bd('0x39')]=_0x57f3d2[_0x82bd('0x39')]['length']?_0x57f3d2['attributes']:_0x2c1770[_0x82bd('0x33')];_0x57f3d2[_0x82bd('0x79')]=qs[_0x82bd('0x3d')](_0x2fe384[_0x82bd('0x35')][_0x82bd('0x3d')]);_0x57f3d2[_0x82bd('0x3e')]=qs[_0x82bd('0x37')](_[_0x82bd('0x7a')](_0x2fe384[_0x82bd('0x35')],_0x2c1770[_0x82bd('0x37')]));if(_0x2fe384[_0x82bd('0x35')][_0x82bd('0x7b')]){_0x57f3d2[_0x82bd('0x3e')]=_[_0x82bd('0x3f')](_0x57f3d2[_0x82bd('0x3e')],{'$or':_[_0x82bd('0x34')](_0x57f3d2[_0x82bd('0x39')],function(_0x2e827b){var _0x52a379={};_0x52a379[_0x2e827b]={'$like':'%'+_0x2fe384[_0x82bd('0x35')][_0x82bd('0x7b')]+'%'};return _0x52a379;})});}_0x57f3d2=_['merge']({},_0x57f3d2,_0x2fe384[_0x82bd('0x46')]);return _0x938f4f[_0x82bd('0x77')](_0x57f3d2);}})['then'](function(_0x289865){if(_0x289865){_0x2daf13=_0x289865[_0x82bd('0x3b')];if(!_0x2fe384[_0x82bd('0x35')][_0x82bd('0x3c')](_0x82bd('0x7c'))){_0x57f3d2[_0x82bd('0x1d')]=qs[_0x82bd('0x1d')](_0x2fe384['query'][_0x82bd('0x1d')]);_0x57f3d2['offset']=qs[_0x82bd('0x1b')](_0x2fe384['query'][_0x82bd('0x1b')]);}return _0x938f4f[_0x82bd('0x77')](_0x57f3d2);}})[_0x82bd('0x25')](function(_0x165d23){if(_0x165d23){return _0x165d23?{'count':_0x2daf13,'rows':_0x165d23}:null;}})[_0x82bd('0x25')](respondWithResult(_0xa9fdf8,null))['catch'](handleError(_0xa9fdf8,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 7a9eafb..6d023b7 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 _0x5790=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Dashboard','save'];(function(_0x54f46e,_0x119496){var _0x1fc4f6=function(_0x8cf865){while(--_0x8cf865){_0x54f46e['push'](_0x54f46e['shift']());}};_0x1fc4f6(++_0x119496);}(_0x5790,0xa5));var _0x0579=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5790[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x0579('0x0'))['db'][_0x0579('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0579('0x2'),'afterUpdate':'update','afterDestroy':_0x0579('0x3')};function emitEvent(_0x3db770){return function(_0x47a28d,_0x5affd9,_0x320dff){DashboardEvents[_0x0579('0x4')](_0x3db770+':'+_0x47a28d['id'],_0x47a28d);DashboardEvents[_0x0579('0x4')](_0x3db770,_0x47a28d);_0x320dff(null);};}for(var e in events){if(events[_0x0579('0x5')](e)){var event=events[e];Dashboard[_0x0579('0x6')](e,emitEvent(event));}}module[_0x0579('0x7')]=DashboardEvents; \ No newline at end of file +var _0xbe4a=['remove','emit','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','update'];(function(_0x107d16,_0x4cf37f){var _0x137457=function(_0x10fff3){while(--_0x10fff3){_0x107d16['push'](_0x107d16['shift']());}};_0x137457(++_0x4cf37f);}(_0xbe4a,0x1d8));var _0xabe4=function(_0xa3da82,_0x3be0c4){_0xa3da82=_0xa3da82-0x0;var _0x55a74=_0xbe4a[_0xa3da82];return _0x55a74;};'use strict';var EventEmitter=require(_0xabe4('0x0'));var Dashboard=require(_0xabe4('0x1'))['db'][_0xabe4('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xabe4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xabe4('0x4'),'afterDestroy':_0xabe4('0x5')};function emitEvent(_0x8ebcec){return function(_0x129d39,_0x568913,_0x17d605){DashboardEvents[_0xabe4('0x6')](_0x8ebcec+':'+_0x129d39['id'],_0x129d39);DashboardEvents['emit'](_0x8ebcec,_0x129d39);_0x17d605(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xabe4('0x7')](e,emitEvent(event));}}module[_0xabe4('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 4d4293d..fe86bd4 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 _0x316c=['./dashboard.attributes','exports','Dashboard','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x369cf2,_0x47e28c){var _0x5c7d3e=function(_0x4143d9){while(--_0x4143d9){_0x369cf2['push'](_0x369cf2['shift']());}};_0x5c7d3e(++_0x47e28c);}(_0x316c,0x18f));var _0xc316=function(_0x536868,_0x405a0e){_0x536868=_0x536868-0x0;var _0x38b671=_0x316c[_0x536868];return _0x38b671;};'use strict';var _=require(_0xc316('0x0'));var util=require(_0xc316('0x1'));var logger=require(_0xc316('0x2'))(_0xc316('0x3'));var moment=require(_0xc316('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc316('0x5'));var rimraf=require(_0xc316('0x6'));var config=require(_0xc316('0x7'));var attributes=require(_0xc316('0x8'));module[_0xc316('0x9')]=function(_0x5eec98,_0x82e7a5){return _0x5eec98['define'](_0xc316('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8b4=['path','rimraf','./dashboard.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1ccb95,_0x79a418){var _0x2a78e0=function(_0x46bdb2){while(--_0x46bdb2){_0x1ccb95['push'](_0x1ccb95['shift']());}};_0x2a78e0(++_0x79a418);}(_0xa8b4,0xcb));var _0x4a8b=function(_0x78a9ee,_0x33ca62){_0x78a9ee=_0x78a9ee-0x0;var _0x5b6524=_0xa8b4[_0x78a9ee];return _0x5b6524;};'use strict';var _=require(_0x4a8b('0x0'));var util=require(_0x4a8b('0x1'));var logger=require(_0x4a8b('0x2'))(_0x4a8b('0x3'));var moment=require('moment');var BPromise=require(_0x4a8b('0x4'));var rp=require(_0x4a8b('0x5'));var fs=require('fs');var path=require(_0x4a8b('0x6'));var rimraf=require(_0x4a8b('0x7'));var config=require('../../config/environment');var attributes=require(_0x4a8b('0x8'));module[_0x4a8b('0x9')]=function(_0x46946c,_0x51f91f){return _0x46946c[_0x4a8b('0xa')]('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index b05d51f..0d95db1 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 _0x5265=['request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x27923d,_0xa2c725){var _0x1911d3=function(_0x3de7c1){while(--_0x3de7c1){_0x27923d['push'](_0x27923d['shift']());}};_0x1911d3(++_0xa2c725);}(_0x5265,0x12f));var _0x5526=function(_0x53c5b2,_0x26563a){_0x53c5b2=_0x53c5b2-0x0;var _0x9954d=_0x5265[_0x53c5b2];return _0x9954d;};'use strict';var _=require(_0x5526('0x0'));var util=require(_0x5526('0x1'));var moment=require(_0x5526('0x2'));var BPromise=require(_0x5526('0x3'));var rs=require(_0x5526('0x4'));var fs=require('fs');var Redis=require(_0x5526('0x5'));var db=require(_0x5526('0x6'))['db'];var utils=require(_0x5526('0x7'));var logger=require(_0x5526('0x8'))(_0x5526('0x9'));var config=require(_0x5526('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5526('0xb')][_0x5526('0xc')]({'port':0x232a});config[_0x5526('0xd')]=_[_0x5526('0xe')](config[_0x5526('0xd')],{'host':_0x5526('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5526('0xd')]));require(_0x5526('0x10'))[_0x5526('0x11')](socket);function respondWithRpcPromise(_0x237ad7,_0x31cafd,_0x33feff){return new BPromise(function(_0x348316,_0x30885e){return client[_0x5526('0x12')](_0x237ad7,_0x33feff)[_0x5526('0x13')](function(_0x11022e){logger[_0x5526('0x14')](_0x5526('0x15'),_0x31cafd,'request\x20sent');logger[_0x5526('0x16')](_0x5526('0x17'),_0x31cafd,'request\x20sent',JSON[_0x5526('0x18')](_0x11022e));if(_0x11022e['error']){if(_0x11022e['error']['code']===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x31cafd,_0x11022e[_0x5526('0x19')][_0x5526('0x1a')]);return _0x30885e(_0x11022e[_0x5526('0x19')][_0x5526('0x1a')]);}logger[_0x5526('0x19')](_0x5526('0x15'),_0x31cafd,_0x11022e[_0x5526('0x19')]['message']);return _0x348316(_0x11022e['error'][_0x5526('0x1a')]);}else{logger[_0x5526('0x14')](_0x5526('0x15'),_0x31cafd,_0x5526('0x1b'));_0x348316(_0x11022e[_0x5526('0x1c')][_0x5526('0x1a')]);}})[_0x5526('0x1d')](function(_0x32b194){logger[_0x5526('0x19')](_0x5526('0x15'),_0x31cafd,_0x32b194);_0x30885e(_0x32b194);});});} \ No newline at end of file +var _0xa650=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird'];(function(_0x138d25,_0x3824e5){var _0x51d564=function(_0x520dbf){while(--_0x520dbf){_0x138d25['push'](_0x138d25['shift']());}};_0x51d564(++_0x3824e5);}(_0xa650,0x129));var _0x0a65=function(_0x139171,_0x23ade2){_0x139171=_0x139171-0x0;var _0x2b4124=_0xa650[_0x139171];return _0x2b4124;};'use strict';var _=require(_0x0a65('0x0'));var util=require('util');var moment=require(_0x0a65('0x1'));var BPromise=require(_0x0a65('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a65('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a65('0x4'));var logger=require('../../config/logger')(_0x0a65('0x5'));var config=require(_0x0a65('0x6'));var jayson=require(_0x0a65('0x7'));var client=jayson['client'][_0x0a65('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x0a65('0x9'),'port':0x18eb});var socket=require(_0x0a65('0xa'))(new Redis(config[_0x0a65('0xb')]));require(_0x0a65('0xc'))[_0x0a65('0xd')](socket);function respondWithRpcPromise(_0x54c0b9,_0x5a8f9f,_0x1b6957){return new BPromise(function(_0xf5de87,_0x1d796e){return client[_0x0a65('0xe')](_0x54c0b9,_0x1b6957)[_0x0a65('0xf')](function(_0x187cc7){logger[_0x0a65('0x10')](_0x0a65('0x11'),_0x5a8f9f,'request\x20sent');logger['debug'](_0x0a65('0x12'),_0x5a8f9f,'request\x20sent',JSON['stringify'](_0x187cc7));if(_0x187cc7['error']){if(_0x187cc7[_0x0a65('0x13')][_0x0a65('0x14')]===0x1f4){logger[_0x0a65('0x13')](_0x0a65('0x11'),_0x5a8f9f,_0x187cc7['error']['message']);return _0x1d796e(_0x187cc7[_0x0a65('0x13')][_0x0a65('0x15')]);}logger[_0x0a65('0x13')]('Dashboard,\x20%s,\x20%s',_0x5a8f9f,_0x187cc7[_0x0a65('0x13')][_0x0a65('0x15')]);return _0xf5de87(_0x187cc7[_0x0a65('0x13')]['message']);}else{logger['info'](_0x0a65('0x11'),_0x5a8f9f,_0x0a65('0x16'));_0xf5de87(_0x187cc7[_0x0a65('0x17')]['message']);}})[_0x0a65('0x18')](function(_0x2a67f3){logger[_0x0a65('0x13')](_0x0a65('0x11'),_0x5a8f9f,_0x2a67f3);_0x1d796e(_0x2a67f3);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index cac923b..c7c1d80 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 _0x3780=['register','length','./dashboard.events','save','emit','removeListener'];(function(_0x851482,_0x27ffac){var _0x4c6c15=function(_0x2c1c57){while(--_0x2c1c57){_0x851482['push'](_0x851482['shift']());}};_0x4c6c15(++_0x27ffac);}(_0x3780,0x1ac));var _0x0378=function(_0x46f153,_0x8061fd){_0x46f153=_0x46f153-0x0;var _0x43b848=_0x3780[_0x46f153];return _0x43b848;};'use strict';var DashboardEvents=require(_0x0378('0x0'));var events=[_0x0378('0x1'),'remove','update'];function createListener(_0x13dbd4,_0x45ab32){return function(_0x4cc28f){_0x45ab32[_0x0378('0x2')](_0x13dbd4,_0x4cc28f);};}function removeListener(_0x362f38,_0x5f2360){return function(){DashboardEvents[_0x0378('0x3')](_0x362f38,_0x5f2360);};}exports[_0x0378('0x4')]=function(_0x5769d9){for(var _0x3969a0=0x0,_0x306371=events[_0x0378('0x5')];_0x3969a0<_0x306371;_0x3969a0++){var _0x16c37d=events[_0x3969a0];var _0x18c1dd=createListener('dashboard:'+_0x16c37d,_0x5769d9);DashboardEvents['on'](_0x16c37d,_0x18c1dd);}}; \ No newline at end of file +var _0x56c4=['register','./dashboard.events','save','emit'];(function(_0x31ee98,_0x1e1a4a){var _0x246d93=function(_0x1639f8){while(--_0x1639f8){_0x31ee98['push'](_0x31ee98['shift']());}};_0x246d93(++_0x1e1a4a);}(_0x56c4,0x175));var _0x456c=function(_0xb40c4f,_0x5231f2){_0xb40c4f=_0xb40c4f-0x0;var _0x1d5f81=_0x56c4[_0xb40c4f];return _0x1d5f81;};'use strict';var DashboardEvents=require(_0x456c('0x0'));var events=[_0x456c('0x1'),'remove','update'];function createListener(_0x43dccd,_0x1ba1c2){return function(_0x35d792){_0x1ba1c2[_0x456c('0x2')](_0x43dccd,_0x35d792);};}function removeListener(_0x5a321c,_0x3b243d){return function(){DashboardEvents['removeListener'](_0x5a321c,_0x3b243d);};}exports[_0x456c('0x3')]=function(_0x3abf15){for(var _0x334701=0x0,_0x340113=events['length'];_0x334701<_0x340113;_0x334701++){var _0x1f44c3=events[_0x334701];var _0x1fa6a2=createListener('dashboard:'+_0x1f44c3,_0x3abf15);DashboardEvents['on'](_0x1f44c3,_0x1fa6a2);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index c6d8e8e..da400a1 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 _0xda91=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','addItem','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xda91,0xca));var _0x1da9=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xda91[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x1da9('0x0'));var util=require(_0x1da9('0x1'));var path=require('path');var timeout=require(_0x1da9('0x2'));var express=require(_0x1da9('0x3'));var router=express[_0x1da9('0x4')]();var fs_extra=require(_0x1da9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1da9('0x6'));var config=require(_0x1da9('0x7'));var controller=require('./dashboard.controller');router[_0x1da9('0x8')]('/',auth[_0x1da9('0x9')](),controller[_0x1da9('0xa')]);router['get'](_0x1da9('0xb'),auth[_0x1da9('0x9')](),controller[_0x1da9('0xc')]);router[_0x1da9('0x8')](_0x1da9('0xd'),auth[_0x1da9('0x9')](),controller[_0x1da9('0xe')]);router['post']('/',auth[_0x1da9('0x9')](),controller[_0x1da9('0xf')]);router[_0x1da9('0x10')](_0x1da9('0x11'),auth[_0x1da9('0x9')](),controller['clone']);router[_0x1da9('0x10')](_0x1da9('0xd'),auth[_0x1da9('0x9')](),controller[_0x1da9('0x12')]);router[_0x1da9('0x13')](_0x1da9('0xb'),auth[_0x1da9('0x9')](),controller[_0x1da9('0x14')]);router[_0x1da9('0x15')](_0x1da9('0xb'),auth[_0x1da9('0x9')](),controller[_0x1da9('0x16')]);module['exports']=router; \ No newline at end of file +var _0x7541=['../../config/environment','./dashboard.controller','get','isAuthenticated','index','show','getItems','post','create','/:id/clone','clone','/:id/items','addItem','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3e85a4,_0x18c3a9){var _0x21e7d1=function(_0x48457d){while(--_0x48457d){_0x3e85a4['push'](_0x3e85a4['shift']());}};_0x21e7d1(++_0x18c3a9);}(_0x7541,0x1cc));var _0x1754=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x7541[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require(_0x1754('0x0'));var util=require(_0x1754('0x1'));var path=require(_0x1754('0x2'));var timeout=require(_0x1754('0x3'));var express=require(_0x1754('0x4'));var router=express['Router']();var fs_extra=require(_0x1754('0x5'));var auth=require(_0x1754('0x6'));var interaction=require(_0x1754('0x7'));var config=require(_0x1754('0x8'));var controller=require(_0x1754('0x9'));router[_0x1754('0xa')]('/',auth[_0x1754('0xb')](),controller[_0x1754('0xc')]);router[_0x1754('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1754('0xd')]);router[_0x1754('0xa')]('/:id/items',auth['isAuthenticated'](),controller[_0x1754('0xe')]);router[_0x1754('0xf')]('/',auth[_0x1754('0xb')](),controller[_0x1754('0x10')]);router[_0x1754('0xf')](_0x1754('0x11'),auth['isAuthenticated'](),controller[_0x1754('0x12')]);router[_0x1754('0xf')](_0x1754('0x13'),auth[_0x1754('0xb')](),controller[_0x1754('0x14')]);router[_0x1754('0x15')](_0x1754('0x16'),auth[_0x1754('0xb')](),controller[_0x1754('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1754('0x18')]);module[_0x1754('0x19')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 1bf2e37..22abfc9 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 _0xda19=['TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','squel','lodash','STRING'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0xda19,0xd5));var _0x9da1=function(_0x58ca10,_0x3c41eb){_0x58ca10=_0x58ca10-0x0;var _0x3de71e=_0xda19[_0x58ca10];return _0x3de71e;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x9da1('0x0'));var _=require(_0x9da1('0x1'));module['exports']={'title':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x9da1('0x3')]('long'),'get':function(){try{return JSON[_0x9da1('0x4')](this[_0x9da1('0x5')](_0x9da1('0x6')));}catch(_0x470043){return[];}},'set':function(_0x156faf){try{this[_0x9da1('0x7')](_0x9da1('0x6'),JSON[_0x9da1('0x8')](_0x156faf));}catch(_0x1c24e6){this[_0x9da1('0x7')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x9da1('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x9da1('0x9')]},'background':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![],'defaultValue':_0x9da1('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![],'defaultValue':_0x9da1('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x9da1('0x2')]},'titleFontSize':{'type':Sequelize[_0x9da1('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0x9536=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x392b8a,_0x2f6e0c){var _0x471611=function(_0x1effe0){while(--_0x1effe0){_0x392b8a['push'](_0x392b8a['shift']());}};_0x471611(++_0x2f6e0c);}(_0x9536,0x179));var _0x6953=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x9536[_0x5f1617];return _0x3af5da;};'use strict';var Sequelize=require(_0x6953('0x0'));var squel=require(_0x6953('0x1'));var _=require(_0x6953('0x2'));module[_0x6953('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6953('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x6953('0x5')),'get':function(){try{return JSON[_0x6953('0x6')](this[_0x6953('0x7')](_0x6953('0x8')));}catch(_0x2f3cc3){return[];}},'set':function(_0x494ac2){try{this[_0x6953('0x9')](_0x6953('0x8'),JSON[_0x6953('0xa')](_0x494ac2));}catch(_0x3e1aff){this[_0x6953('0x9')]('attrs',JSON[_0x6953('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x6953('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6953('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6953('0xb')]},'background':{'type':Sequelize[_0x6953('0x4')],'allowNull':![],'defaultValue':_0x6953('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6953('0x4')],'allowNull':![],'defaultValue':_0x6953('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6953('0x4')]},'titleFontSize':{'type':Sequelize[_0x6953('0xb')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 16bdd7d..cc44f3b 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 _0xaf5a=['ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','model','DashboardItem','rawAttributes','keys','filters','intersection','query','attributes','length','includeAll','merge','options','find','catch','params','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','type','attrRefresh','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x201b94,_0x5cada6){var _0x49da82=function(_0x503bea){while(--_0x503bea){_0x201b94['push'](_0x201b94['shift']());}};_0x49da82(++_0x5cada6);}(_0xaf5a,0x116));var _0xaaf5=function(_0x111c47,_0x2c867b){_0x111c47=_0x111c47-0x0;var _0x30790f=_0xaf5a[_0x111c47];return _0x30790f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaaf5('0x0'));var zipdir=require(_0xaaf5('0x1'));var jsonpatch=require(_0xaaf5('0x2'));var rp=require(_0xaaf5('0x3'));var moment=require(_0xaaf5('0x4'));var BPromise=require(_0xaaf5('0x5'));var Mustache=require(_0xaaf5('0x6'));var util=require(_0xaaf5('0x7'));var path=require('path');var sox=require(_0xaaf5('0x8'));var csv=require(_0xaaf5('0x9'));var ejs=require(_0xaaf5('0xa'));var fs=require('fs');var fs_extra=require(_0xaaf5('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaaf5('0xc'));var jsforce=require(_0xaaf5('0xd'));var deskjs=require(_0xaaf5('0xe'));var toCsv=require(_0xaaf5('0x9'));var querystring=require(_0xaaf5('0xf'));var Papa=require('papaparse');var Redis=require(_0xaaf5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaaf5('0x11'));var hardwareService=require(_0xaaf5('0x12'));var logger=require('../../config/logger')(_0xaaf5('0x13'));var utils=require(_0xaaf5('0x14'));var config=require(_0xaaf5('0x15'));var licenseUtil=require(_0xaaf5('0x16'));var db=require('../../mysqldb')['db'];config[_0xaaf5('0x17')]=_[_0xaaf5('0x18')](config['redis'],{'host':_0xaaf5('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaaf5('0x17')]));require(_0xaaf5('0x1a'))[_0xaaf5('0x1b')](socket);function respondWithStatusCode(_0x304060,_0x59d204){_0x59d204=_0x59d204||0xcc;return function(_0x3db5d0){if(_0x3db5d0){return _0x304060[_0xaaf5('0x1c')](_0x59d204);}return _0x304060[_0xaaf5('0x1d')](_0x59d204)[_0xaaf5('0x1e')]();};}function respondWithResult(_0x277f2b,_0x10a50b){_0x10a50b=_0x10a50b||0xc8;return function(_0x27d66f){if(_0x27d66f){return _0x277f2b['status'](_0x10a50b)[_0xaaf5('0x1f')](_0x27d66f);}};}function respondWithFilteredResult(_0x14bc84,_0x25bcb1){return function(_0x3a036d){if(_0x3a036d){var _0x318d47=typeof _0x25bcb1[_0xaaf5('0x20')]===_0xaaf5('0x21')&&typeof _0x25bcb1['limit']==='undefined';var _0xf60239=_0x3a036d[_0xaaf5('0x22')];var _0x3fd914=_0x318d47?0x0:_0x25bcb1[_0xaaf5('0x20')];var _0x409089=_0x318d47?_0x3a036d[_0xaaf5('0x22')]:_0x25bcb1['offset']+_0x25bcb1['limit'];var _0xd31eae;if(_0x409089>=_0xf60239){_0x409089=_0xf60239;_0xd31eae=0xc8;}else{_0xd31eae=0xce;}_0x14bc84[_0xaaf5('0x1d')](_0xd31eae);return _0x14bc84[_0xaaf5('0x23')](_0xaaf5('0x24'),_0x3fd914+'-'+_0x409089+'/'+_0xf60239)[_0xaaf5('0x1f')](_0x3a036d);}return null;};}function patchUpdates(_0x2a390c){return function(_0xe178ae){try{jsonpatch[_0xaaf5('0x25')](_0xe178ae,_0x2a390c,!![]);}catch(_0x270783){return BPromise[_0xaaf5('0x26')](_0x270783);}return _0xe178ae[_0xaaf5('0x27')]();};}function saveUpdates(_0xd7db51,_0xb2a0ec){return function(_0x1dea57){if(_0x1dea57){return _0x1dea57['update'](_0xd7db51)['then'](function(_0x15a6e4){return _0x15a6e4;});}return null;};}function removeEntity(_0x569c78,_0x44aef2){return function(_0x4d2003){if(_0x4d2003){return _0x4d2003['destroy']()[_0xaaf5('0x28')](function(){_0x569c78[_0xaaf5('0x1d')](0xcc)[_0xaaf5('0x1e')]();});}};}function handleEntityNotFound(_0x30dca9,_0x11b2a9){return function(_0x459059){if(!_0x459059){_0x30dca9['sendStatus'](0x194);}return _0x459059;};}function handleError(_0x3fb41a,_0x533bc8){_0x533bc8=_0x533bc8||0x1f4;return function(_0x4beb05){logger[_0xaaf5('0x29')](_0x4beb05[_0xaaf5('0x2a')]);if(_0x4beb05[_0xaaf5('0x2b')]){delete _0x4beb05[_0xaaf5('0x2b')];}_0x3fb41a[_0xaaf5('0x1d')](_0x533bc8)[_0xaaf5('0x2c')](_0x4beb05);};}exports['show']=function(_0x23e7da,_0x4954af){var _0x39539f={'raw':![],'where':{'id':_0x23e7da['params']['id']}},_0x561800={};_0x561800[_0xaaf5('0x2d')]=_['keys'](db[_0xaaf5('0x2e')][_0xaaf5('0x2f')]);_0x561800['query']=_[_0xaaf5('0x30')](_0x23e7da['query']);_0x561800[_0xaaf5('0x31')]=_[_0xaaf5('0x32')](_0x561800['model'],_0x561800[_0xaaf5('0x33')]);_0x39539f['attributes']=_[_0xaaf5('0x32')](_0x561800[_0xaaf5('0x2d')],qs['fields'](_0x23e7da[_0xaaf5('0x33')]['fields']));_0x39539f[_0xaaf5('0x34')]=_0x39539f[_0xaaf5('0x34')][_0xaaf5('0x35')]?_0x39539f[_0xaaf5('0x34')]:_0x561800[_0xaaf5('0x2d')];if(_0x23e7da[_0xaaf5('0x33')][_0xaaf5('0x36')]){_0x39539f['include']=[{'all':!![]}];}_0x39539f=_[_0xaaf5('0x37')]({},_0x39539f,_0x23e7da[_0xaaf5('0x38')]);return db['DashboardItem'][_0xaaf5('0x39')](_0x39539f)[_0xaaf5('0x28')](handleEntityNotFound(_0x4954af,null))[_0xaaf5('0x28')](respondWithResult(_0x4954af,null))[_0xaaf5('0x3a')](handleError(_0x4954af,null));};exports['destroy']=function(_0x43f472,_0x2e82e2){return db[_0xaaf5('0x2e')][_0xaaf5('0x39')]({'where':{'id':_0x43f472[_0xaaf5('0x3b')]['id']}})[_0xaaf5('0x28')](handleEntityNotFound(_0x2e82e2,null))['then'](removeEntity(_0x2e82e2,null))[_0xaaf5('0x3a')](handleError(_0x2e82e2,null));};function widgetAttributes(_0x28ad39){try{switch(_0x28ad39['type']){case _0xaaf5('0x3c'):return[{'name':_0xaaf5('0x3d'),'value':_0x28ad39[_0xaaf5('0x3d')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39['attrs'][0x0]?_0x28ad39[_0xaaf5('0x3e')][0x0]['value']:undefined)||_0xaaf5('0x3f')}];case _0xaaf5('0x40'):return[{'name':_0xaaf5('0x41'),'value':_0x28ad39[_0xaaf5('0x41')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x0]?_0x28ad39[_0xaaf5('0x3e')][0x0][_0xaaf5('0x42')]:undefined)||''}];case _0xaaf5('0x43'):return[{'name':_0xaaf5('0x44'),'value':_0x28ad39[_0xaaf5('0x44')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39['attrs'][0x0]?_0x28ad39[_0xaaf5('0x3e')][0x0][_0xaaf5('0x42')]:undefined)||_0xaaf5('0x45')},{'name':_0xaaf5('0x46'),'value':_0x28ad39[_0xaaf5('0x46')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x1]?_0x28ad39['attrs'][0x1][_0xaaf5('0x42')]:undefined)||_0xaaf5('0x47')},{'name':_0xaaf5('0x48'),'value':_0x28ad39[_0xaaf5('0x48')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x2]?_0x28ad39[_0xaaf5('0x3e')][0x2][_0xaaf5('0x42')]:undefined)||0xc}];case _0xaaf5('0x49'):return[{'name':_0xaaf5('0x4a'),'value':_0x28ad39[_0xaaf5('0x4a')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39['attrs'][0x0]?_0x28ad39[_0xaaf5('0x3e')][0x0][_0xaaf5('0x42')]:undefined)||_0xaaf5('0x4b')},{'name':_0xaaf5('0x4c'),'value':_0x28ad39[_0xaaf5('0x4c')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x1]?_0x28ad39[_0xaaf5('0x3e')][0x1]['value']:undefined)||[]},{'name':_0xaaf5('0x48'),'value':_0x28ad39['attrFontSize']||(_0x28ad39['attrs']&&_0x28ad39[_0xaaf5('0x3e')][0x2]?_0x28ad39['attrs'][0x2][_0xaaf5('0x42')]:undefined)||0x14},{'name':_0xaaf5('0x4d'),'value':_0x28ad39['attrChannel']||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39['attrs'][0x3]?_0x28ad39['attrs'][0x3][_0xaaf5('0x42')]:undefined)||_0xaaf5('0x4e')},{'name':_0xaaf5('0x4f'),'value':_0x28ad39['attrEmailAccounts']||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x4]?_0x28ad39[_0xaaf5('0x3e')][0x4][_0xaaf5('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x28ad39[_0xaaf5('0x50')]||(_0x28ad39['attrs']&&_0x28ad39['attrs'][0x5]?_0x28ad39[_0xaaf5('0x3e')][0x5]['value']:undefined)||''},{'name':_0xaaf5('0x51'),'value':_0x28ad39[_0xaaf5('0x51')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x6]?_0x28ad39[_0xaaf5('0x3e')][0x6][_0xaaf5('0x42')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x28ad39[_0xaaf5('0x52')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39['attrs'][0x7]?_0x28ad39[_0xaaf5('0x3e')][0x7][_0xaaf5('0x42')]:undefined)||''},{'name':_0xaaf5('0x53'),'value':_0x28ad39[_0xaaf5('0x53')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x8]?_0x28ad39[_0xaaf5('0x3e')][0x8][_0xaaf5('0x42')]:undefined)||''},{'name':'attrChatWebsites','value':_0x28ad39[_0xaaf5('0x54')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x9]?_0x28ad39[_0xaaf5('0x3e')][0x9][_0xaaf5('0x42')]:undefined)||''}];case _0xaaf5('0x55'):case'pie-chart':return[{'name':_0xaaf5('0x56'),'value':_0x28ad39[_0xaaf5('0x56')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x0]?_0x28ad39[_0xaaf5('0x3e')][0x0][_0xaaf5('0x42')]:undefined)||_0xaaf5('0x4b')},{'name':_0xaaf5('0x57'),'value':_0x28ad39[_0xaaf5('0x57')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39['attrs'][0x1]?_0x28ad39[_0xaaf5('0x3e')][0x1][_0xaaf5('0x42')]:undefined)||null},{'name':'attrSerie3','value':_0x28ad39['attrSerie3']||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x2]?_0x28ad39[_0xaaf5('0x3e')][0x2][_0xaaf5('0x42')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x28ad39[_0xaaf5('0x4c')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39['attrs'][0x3]?_0x28ad39[_0xaaf5('0x3e')][0x3][_0xaaf5('0x42')]:undefined)||[]},{'name':_0xaaf5('0x4d'),'value':_0x28ad39[_0xaaf5('0x4d')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x4]?_0x28ad39[_0xaaf5('0x3e')][0x4][_0xaaf5('0x42')]:undefined)||_0xaaf5('0x4e')},{'name':_0xaaf5('0x4f'),'value':_0x28ad39[_0xaaf5('0x4f')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x5]?_0x28ad39[_0xaaf5('0x3e')][0x5][_0xaaf5('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x28ad39['attrFaxAccounts']||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x6]?_0x28ad39[_0xaaf5('0x3e')][0x6]['value']:undefined)||''},{'name':_0xaaf5('0x51'),'value':_0x28ad39['attrSmsAccounts']||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x7]?_0x28ad39[_0xaaf5('0x3e')][0x7][_0xaaf5('0x42')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x28ad39[_0xaaf5('0x52')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x8]?_0x28ad39[_0xaaf5('0x3e')][0x8][_0xaaf5('0x42')]:undefined)||''},{'name':_0xaaf5('0x53'),'value':_0x28ad39['attrWhatsappAccounts']||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x9]?_0x28ad39[_0xaaf5('0x3e')][0x9][_0xaaf5('0x42')]:undefined)||''},{'name':_0xaaf5('0x54'),'value':_0x28ad39[_0xaaf5('0x54')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0xa]?_0x28ad39[_0xaaf5('0x3e')][0xa][_0xaaf5('0x42')]:undefined)||''}];case _0xaaf5('0x58'):return[{'name':_0xaaf5('0x59'),'type':_0x28ad39[_0xaaf5('0x5a')]||(_0x28ad39['attrs']&&_0x28ad39[_0xaaf5('0x3e')][0x0]?_0x28ad39[_0xaaf5('0x3e')][0x0][_0xaaf5('0x5b')]:undefined)||null,'value':_0x28ad39[_0xaaf5('0x59')]||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39[_0xaaf5('0x3e')][0x0]?_0x28ad39[_0xaaf5('0x3e')][0x0][_0xaaf5('0x42')]:undefined)||null},{'name':_0xaaf5('0x5c'),'value':_0x28ad39['attrRefresh']||(_0x28ad39[_0xaaf5('0x3e')]&&_0x28ad39['attrs'][0x1]?_0x28ad39['attrs'][0x1][_0xaaf5('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x1ab81f){logger[_0xaaf5('0x29')]('widgetAttributes:\x20%s',JSON['stringify'](_0x1ab81f));return[];}}exports[_0xaaf5('0x5d')]=function(_0x4abdc5,_0x5ca979){if(_0x4abdc5[_0xaaf5('0x5e')]){_0x4abdc5['body'][_0xaaf5('0x3e')]=widgetAttributes(_0x4abdc5[_0xaaf5('0x5e')]);}return db['DashboardItem'][_0xaaf5('0x5d')](_0x4abdc5['body'],{})[_0xaaf5('0x28')](respondWithResult(_0x5ca979,0xc9))['catch'](handleError(_0x5ca979,null));};exports[_0xaaf5('0x5f')]=function(_0x5cb6e5,_0x7d9990){if(_0x5cb6e5[_0xaaf5('0x5e')]['id']){delete _0x5cb6e5[_0xaaf5('0x5e')]['id'];}_0x5cb6e5[_0xaaf5('0x5e')]['attrs']=widgetAttributes(_0x5cb6e5[_0xaaf5('0x5e')]);return db[_0xaaf5('0x2e')][_0xaaf5('0x39')]({'where':{'id':_0x5cb6e5[_0xaaf5('0x3b')]['id']}})[_0xaaf5('0x28')](handleEntityNotFound(_0x7d9990,null))[_0xaaf5('0x28')](saveUpdates(_0x5cb6e5[_0xaaf5('0x5e')],null))[_0xaaf5('0x28')](respondWithResult(_0x7d9990,null))[_0xaaf5('0x3a')](handleError(_0x7d9990,null));}; \ No newline at end of file +var _0x7ebb=['save','update','then','destroy','end','sendStatus','error','stack','name','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','model','fields','attributes','include','options','find','catch','type','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChatWebsites','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0xf052d8,_0x3a5291){var _0x71ec25=function(_0x1b4888){while(--_0x1b4888){_0xf052d8['push'](_0xf052d8['shift']());}};_0x71ec25(++_0x3a5291);}(_0x7ebb,0x161));var _0xb7eb=function(_0x12d370,_0x13ae4d){_0x12d370=_0x12d370-0x0;var _0x39748c=_0x7ebb[_0x12d370];return _0x39748c;};'use strict';var emlformat=require(_0xb7eb('0x0'));var rimraf=require(_0xb7eb('0x1'));var zipdir=require(_0xb7eb('0x2'));var jsonpatch=require(_0xb7eb('0x3'));var rp=require(_0xb7eb('0x4'));var moment=require(_0xb7eb('0x5'));var BPromise=require(_0xb7eb('0x6'));var Mustache=require('mustache');var util=require(_0xb7eb('0x7'));var path=require(_0xb7eb('0x8'));var sox=require(_0xb7eb('0x9'));var csv=require(_0xb7eb('0xa'));var ejs=require(_0xb7eb('0xb'));var fs=require('fs');var fs_extra=require(_0xb7eb('0xc'));var _=require(_0xb7eb('0xd'));var squel=require(_0xb7eb('0xe'));var crypto=require(_0xb7eb('0xf'));var jsforce=require(_0xb7eb('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb7eb('0x11'));var Papa=require(_0xb7eb('0x12'));var Redis=require(_0xb7eb('0x13'));var authService=require(_0xb7eb('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb7eb('0x15'));var hardwareService=require(_0xb7eb('0x16'));var logger=require('../../config/logger')(_0xb7eb('0x17'));var utils=require(_0xb7eb('0x18'));var config=require(_0xb7eb('0x19'));var licenseUtil=require(_0xb7eb('0x1a'));var db=require(_0xb7eb('0x1b'))['db'];config[_0xb7eb('0x1c')]=_[_0xb7eb('0x1d')](config['redis'],{'host':_0xb7eb('0x1e'),'port':0x18eb});var socket=require(_0xb7eb('0x1f'))(new Redis(config[_0xb7eb('0x1c')]));require('./dashboardItem.socket')[_0xb7eb('0x20')](socket);function respondWithStatusCode(_0xbd0a5a,_0x35add2){_0x35add2=_0x35add2||0xcc;return function(_0x2c1912){if(_0x2c1912){return _0xbd0a5a['sendStatus'](_0x35add2);}return _0xbd0a5a[_0xb7eb('0x21')](_0x35add2)['end']();};}function respondWithResult(_0x4977b5,_0x3d9cf3){_0x3d9cf3=_0x3d9cf3||0xc8;return function(_0x403130){if(_0x403130){return _0x4977b5['status'](_0x3d9cf3)[_0xb7eb('0x22')](_0x403130);}};}function respondWithFilteredResult(_0x2186ae,_0x3fbee6){return function(_0x1c0294){if(_0x1c0294){var _0x52324c=typeof _0x3fbee6[_0xb7eb('0x23')]==='undefined'&&typeof _0x3fbee6[_0xb7eb('0x24')]===_0xb7eb('0x25');var _0x4b74f3=_0x1c0294[_0xb7eb('0x26')];var _0x5ae156=_0x52324c?0x0:_0x3fbee6[_0xb7eb('0x23')];var _0x17ac2c=_0x52324c?_0x1c0294[_0xb7eb('0x26')]:_0x3fbee6[_0xb7eb('0x23')]+_0x3fbee6[_0xb7eb('0x24')];var _0x36beb6;if(_0x17ac2c>=_0x4b74f3){_0x17ac2c=_0x4b74f3;_0x36beb6=0xc8;}else{_0x36beb6=0xce;}_0x2186ae[_0xb7eb('0x21')](_0x36beb6);return _0x2186ae[_0xb7eb('0x27')](_0xb7eb('0x28'),_0x5ae156+'-'+_0x17ac2c+'/'+_0x4b74f3)['json'](_0x1c0294);}return null;};}function patchUpdates(_0x53071f){return function(_0x2dbfae){try{jsonpatch[_0xb7eb('0x29')](_0x2dbfae,_0x53071f,!![]);}catch(_0x3ad448){return BPromise[_0xb7eb('0x2a')](_0x3ad448);}return _0x2dbfae[_0xb7eb('0x2b')]();};}function saveUpdates(_0x5bdadf,_0x12ba95){return function(_0x1a5302){if(_0x1a5302){return _0x1a5302[_0xb7eb('0x2c')](_0x5bdadf)[_0xb7eb('0x2d')](function(_0x48e4d7){return _0x48e4d7;});}return null;};}function removeEntity(_0x202b4d,_0x48dabb){return function(_0x3cdbde){if(_0x3cdbde){return _0x3cdbde[_0xb7eb('0x2e')]()[_0xb7eb('0x2d')](function(){_0x202b4d['status'](0xcc)[_0xb7eb('0x2f')]();});}};}function handleEntityNotFound(_0x45e14f,_0xfb79c2){return function(_0x3c8676){if(!_0x3c8676){_0x45e14f[_0xb7eb('0x30')](0x194);}return _0x3c8676;};}function handleError(_0x322795,_0x86df9b){_0x86df9b=_0x86df9b||0x1f4;return function(_0x23aee6){logger[_0xb7eb('0x31')](_0x23aee6[_0xb7eb('0x32')]);if(_0x23aee6[_0xb7eb('0x33')]){delete _0x23aee6[_0xb7eb('0x33')];}_0x322795[_0xb7eb('0x21')](_0x86df9b)['send'](_0x23aee6);};}exports[_0xb7eb('0x34')]=function(_0x5b2a8d,_0x20f0c0){var _0x4f3e84={'raw':![],'where':{'id':_0x5b2a8d[_0xb7eb('0x35')]['id']}},_0x409045={};_0x409045['model']=_[_0xb7eb('0x36')](db[_0xb7eb('0x37')][_0xb7eb('0x38')]);_0x409045['query']=_[_0xb7eb('0x36')](_0x5b2a8d[_0xb7eb('0x39')]);_0x409045[_0xb7eb('0x3a')]=_[_0xb7eb('0x3b')](_0x409045[_0xb7eb('0x3c')],_0x409045[_0xb7eb('0x39')]);_0x4f3e84['attributes']=_[_0xb7eb('0x3b')](_0x409045[_0xb7eb('0x3c')],qs[_0xb7eb('0x3d')](_0x5b2a8d[_0xb7eb('0x39')]['fields']));_0x4f3e84[_0xb7eb('0x3e')]=_0x4f3e84[_0xb7eb('0x3e')]['length']?_0x4f3e84[_0xb7eb('0x3e')]:_0x409045[_0xb7eb('0x3c')];if(_0x5b2a8d[_0xb7eb('0x39')]['includeAll']){_0x4f3e84[_0xb7eb('0x3f')]=[{'all':!![]}];}_0x4f3e84=_['merge']({},_0x4f3e84,_0x5b2a8d[_0xb7eb('0x40')]);return db[_0xb7eb('0x37')][_0xb7eb('0x41')](_0x4f3e84)[_0xb7eb('0x2d')](handleEntityNotFound(_0x20f0c0,null))['then'](respondWithResult(_0x20f0c0,null))['catch'](handleError(_0x20f0c0,null));};exports[_0xb7eb('0x2e')]=function(_0x20b11b,_0x4d2b02){return db[_0xb7eb('0x37')][_0xb7eb('0x41')]({'where':{'id':_0x20b11b[_0xb7eb('0x35')]['id']}})[_0xb7eb('0x2d')](handleEntityNotFound(_0x4d2b02,null))[_0xb7eb('0x2d')](removeEntity(_0x4d2b02,null))[_0xb7eb('0x42')](handleError(_0x4d2b02,null));};function widgetAttributes(_0xa4b736){try{switch(_0xa4b736[_0xb7eb('0x43')]){case'iframe':return[{'name':_0xb7eb('0x44'),'value':_0xa4b736['attrUrl']||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x0]?_0xa4b736[_0xb7eb('0x45')][0x0][_0xb7eb('0x46')]:undefined)||'https://'}];case _0xb7eb('0x47'):return[{'name':_0xb7eb('0x48'),'value':_0xa4b736[_0xb7eb('0x48')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x0]?_0xa4b736['attrs'][0x0][_0xb7eb('0x46')]:undefined)||''}];case'clock':return[{'name':_0xb7eb('0x49'),'value':_0xa4b736[_0xb7eb('0x49')]||(_0xa4b736['attrs']&&_0xa4b736[_0xb7eb('0x45')][0x0]?_0xa4b736[_0xb7eb('0x45')][0x0][_0xb7eb('0x46')]:undefined)||_0xb7eb('0x4a')},{'name':'attrTimezone','value':_0xa4b736['attrTimezone']||(_0xa4b736['attrs']&&_0xa4b736[_0xb7eb('0x45')][0x1]?_0xa4b736[_0xb7eb('0x45')][0x1][_0xb7eb('0x46')]:undefined)||_0xb7eb('0x4b')},{'name':_0xb7eb('0x4c'),'value':_0xa4b736[_0xb7eb('0x4c')]||(_0xa4b736['attrs']&&_0xa4b736[_0xb7eb('0x45')][0x2]?_0xa4b736['attrs'][0x2][_0xb7eb('0x46')]:undefined)||0xc}];case _0xb7eb('0x4d'):return[{'name':_0xb7eb('0x4e'),'value':_0xa4b736['attrMetric']||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x0]?_0xa4b736[_0xb7eb('0x45')][0x0]['value']:undefined)||_0xb7eb('0x4f')},{'name':_0xb7eb('0x50'),'value':_0xa4b736[_0xb7eb('0x50')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x1]?_0xa4b736[_0xb7eb('0x45')][0x1][_0xb7eb('0x46')]:undefined)||[]},{'name':_0xb7eb('0x4c'),'value':_0xa4b736[_0xb7eb('0x4c')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x2]?_0xa4b736[_0xb7eb('0x45')][0x2][_0xb7eb('0x46')]:undefined)||0x14},{'name':_0xb7eb('0x51'),'value':_0xa4b736[_0xb7eb('0x51')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x3]?_0xa4b736[_0xb7eb('0x45')][0x3][_0xb7eb('0x46')]:undefined)||'voice'},{'name':_0xb7eb('0x52'),'value':_0xa4b736[_0xb7eb('0x52')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x4]?_0xa4b736[_0xb7eb('0x45')][0x4]['value']:undefined)||''},{'name':_0xb7eb('0x53'),'value':_0xa4b736[_0xb7eb('0x53')]||(_0xa4b736['attrs']&&_0xa4b736[_0xb7eb('0x45')][0x5]?_0xa4b736[_0xb7eb('0x45')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0xa4b736[_0xb7eb('0x54')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x6]?_0xa4b736[_0xb7eb('0x45')][0x6][_0xb7eb('0x46')]:undefined)||''},{'name':_0xb7eb('0x55'),'value':_0xa4b736[_0xb7eb('0x55')]||(_0xa4b736['attrs']&&_0xa4b736[_0xb7eb('0x45')][0x7]?_0xa4b736[_0xb7eb('0x45')][0x7]['value']:undefined)||''},{'name':_0xb7eb('0x56'),'value':_0xa4b736['attrWhatsappAccounts']||(_0xa4b736['attrs']&&_0xa4b736['attrs'][0x8]?_0xa4b736[_0xb7eb('0x45')][0x8][_0xb7eb('0x46')]:undefined)||''},{'name':'attrChatWebsites','value':_0xa4b736['attrChatWebsites']||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x9]?_0xa4b736[_0xb7eb('0x45')][0x9][_0xb7eb('0x46')]:undefined)||''}];case _0xb7eb('0x57'):case _0xb7eb('0x58'):return[{'name':_0xb7eb('0x59'),'value':_0xa4b736[_0xb7eb('0x59')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x0]?_0xa4b736['attrs'][0x0][_0xb7eb('0x46')]:undefined)||_0xb7eb('0x4f')},{'name':'attrSerie2','value':_0xa4b736[_0xb7eb('0x5a')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x1]?_0xa4b736[_0xb7eb('0x45')][0x1]['value']:undefined)||null},{'name':_0xb7eb('0x5b'),'value':_0xa4b736[_0xb7eb('0x5b')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736['attrs'][0x2]?_0xa4b736[_0xb7eb('0x45')][0x2][_0xb7eb('0x46')]:undefined)||null},{'name':'attrVoiceQueues','value':_0xa4b736[_0xb7eb('0x50')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x3]?_0xa4b736['attrs'][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0xa4b736[_0xb7eb('0x51')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x4]?_0xa4b736[_0xb7eb('0x45')][0x4]['value']:undefined)||'voice'},{'name':_0xb7eb('0x52'),'value':_0xa4b736[_0xb7eb('0x52')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x5]?_0xa4b736['attrs'][0x5][_0xb7eb('0x46')]:undefined)||''},{'name':_0xb7eb('0x53'),'value':_0xa4b736[_0xb7eb('0x53')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x6]?_0xa4b736[_0xb7eb('0x45')][0x6][_0xb7eb('0x46')]:undefined)||''},{'name':_0xb7eb('0x54'),'value':_0xa4b736[_0xb7eb('0x54')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736['attrs'][0x7]?_0xa4b736[_0xb7eb('0x45')][0x7][_0xb7eb('0x46')]:undefined)||''},{'name':_0xb7eb('0x55'),'value':_0xa4b736[_0xb7eb('0x55')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736['attrs'][0x8]?_0xa4b736[_0xb7eb('0x45')][0x8]['value']:undefined)||''},{'name':_0xb7eb('0x56'),'value':_0xa4b736[_0xb7eb('0x56')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x9]?_0xa4b736['attrs'][0x9][_0xb7eb('0x46')]:undefined)||''},{'name':_0xb7eb('0x5c'),'value':_0xa4b736[_0xb7eb('0x5c')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0xa]?_0xa4b736[_0xb7eb('0x45')][0xa][_0xb7eb('0x46')]:undefined)||''}];case'web-report':return[{'name':_0xb7eb('0x5d'),'type':_0xa4b736['reportType']||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x0]?_0xa4b736[_0xb7eb('0x45')][0x0]['type']:undefined)||null,'value':_0xa4b736[_0xb7eb('0x5d')]||(_0xa4b736[_0xb7eb('0x45')]&&_0xa4b736[_0xb7eb('0x45')][0x0]?_0xa4b736[_0xb7eb('0x45')][0x0]['value']:undefined)||null},{'name':_0xb7eb('0x5e'),'value':_0xa4b736['attrRefresh']||(_0xa4b736['attrs']&&_0xa4b736[_0xb7eb('0x45')][0x1]?_0xa4b736['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x7bc2b3){logger['error'](_0xb7eb('0x5f'),JSON[_0xb7eb('0x60')](_0x7bc2b3));return[];}}exports[_0xb7eb('0x61')]=function(_0xc2089,_0x4bf530){if(_0xc2089['body']){_0xc2089[_0xb7eb('0x62')][_0xb7eb('0x45')]=widgetAttributes(_0xc2089['body']);}return db[_0xb7eb('0x37')][_0xb7eb('0x61')](_0xc2089[_0xb7eb('0x62')],{})[_0xb7eb('0x2d')](respondWithResult(_0x4bf530,0xc9))['catch'](handleError(_0x4bf530,null));};exports[_0xb7eb('0x2c')]=function(_0x5613f5,_0x33d953){if(_0x5613f5[_0xb7eb('0x62')]['id']){delete _0x5613f5[_0xb7eb('0x62')]['id'];}_0x5613f5[_0xb7eb('0x62')][_0xb7eb('0x45')]=widgetAttributes(_0x5613f5['body']);return db[_0xb7eb('0x37')][_0xb7eb('0x41')]({'where':{'id':_0x5613f5['params']['id']}})[_0xb7eb('0x2d')](handleEntityNotFound(_0x33d953,null))[_0xb7eb('0x2d')](saveUpdates(_0x5613f5['body'],null))[_0xb7eb('0x2d')](respondWithResult(_0x33d953,null))[_0xb7eb('0x42')](handleError(_0x33d953,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index ed98ac7..c1cc48c 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 _0x2317=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','DashboardItem','save','update'];(function(_0x2ecd48,_0x537c2c){var _0x4044c3=function(_0x2feaa0){while(--_0x2feaa0){_0x2ecd48['push'](_0x2ecd48['shift']());}};_0x4044c3(++_0x537c2c);}(_0x2317,0x16d));var _0x7231=function(_0x3e600c,_0x28a675){_0x3e600c=_0x3e600c-0x0;var _0x49180d=_0x2317[_0x3e600c];return _0x49180d;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x7231('0x0'))['db'][_0x7231('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7231('0x2'),'afterUpdate':_0x7231('0x3'),'afterDestroy':_0x7231('0x4')};function emitEvent(_0x4f91e8){return function(_0xcaa557,_0x5ddc19,_0x161af){DashboardItemEvents[_0x7231('0x5')](_0x4f91e8+':'+_0xcaa557['id'],_0xcaa557);DashboardItemEvents['emit'](_0x4f91e8,_0xcaa557);_0x161af(null);};}for(var e in events){if(events[_0x7231('0x6')](e)){var event=events[e];DashboardItem[_0x7231('0x7')](e,emitEvent(event));}}module[_0x7231('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x41db=['update','remove','emit','hasOwnProperty','hook','DashboardItem'];(function(_0x270eeb,_0x3dc770){var _0x3c32fc=function(_0x4c8a7e){while(--_0x4c8a7e){_0x270eeb['push'](_0x270eeb['shift']());}};_0x3c32fc(++_0x3dc770);}(_0x41db,0x179));var _0xb41d=function(_0x5128b5,_0xb132be){_0x5128b5=_0x5128b5-0x0;var _0x3a421f=_0x41db[_0x5128b5];return _0x3a421f;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0xb41d('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb41d('0x1'),'afterDestroy':_0xb41d('0x2')};function emitEvent(_0x40f38f){return function(_0x117f8f,_0x2f21eb,_0xa15b0){DashboardItemEvents['emit'](_0x40f38f+':'+_0x117f8f['id'],_0x117f8f);DashboardItemEvents[_0xb41d('0x3')](_0x40f38f,_0x117f8f);_0xa15b0(null);};}for(var e in events){if(events[_0xb41d('0x4')](e)){var event=events[e];DashboardItem[_0xb41d('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 728ec96..b01db7a 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 _0xcfee=['bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','define','dashboard_items','lodash','util','../../config/logger','api','moment'];(function(_0x13c74f,_0x797db6){var _0x19b19c=function(_0x3844bb){while(--_0x3844bb){_0x13c74f['push'](_0x13c74f['shift']());}};_0x19b19c(++_0x797db6);}(_0xcfee,0x10f));var _0xecfe=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xcfee[_0x4b7895];return _0x264180;};'use strict';var _=require(_0xecfe('0x0'));var util=require(_0xecfe('0x1'));var logger=require(_0xecfe('0x2'))(_0xecfe('0x3'));var moment=require(_0xecfe('0x4'));var BPromise=require(_0xecfe('0x5'));var rp=require(_0xecfe('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xecfe('0x7'));var config=require(_0xecfe('0x8'));var attributes=require(_0xecfe('0x9'));module['exports']=function(_0x4ec042,_0xca50f){return _0x4ec042[_0xecfe('0xa')]('DashboardItem',attributes,{'tableName':_0xecfe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5df=['../../config/environment','./dashboardItem.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0xa5df,0x190));var _0xfa5d=function(_0x41a5bf,_0xfb41d8){_0x41a5bf=_0x41a5bf-0x0;var _0x15cf1e=_0xa5df[_0x41a5bf];return _0x15cf1e;};'use strict';var _=require(_0xfa5d('0x0'));var util=require(_0xfa5d('0x1'));var logger=require(_0xfa5d('0x2'))(_0xfa5d('0x3'));var moment=require(_0xfa5d('0x4'));var BPromise=require(_0xfa5d('0x5'));var rp=require(_0xfa5d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa5d('0x7'));var config=require(_0xfa5d('0x8'));var attributes=require(_0xfa5d('0x9'));module[_0xfa5d('0xa')]=function(_0x331859,_0x1c2214){return _0x331859[_0xfa5d('0xb')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 9f987c1..3b25400 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 _0xe04f=['request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xe04f,0x16c));var _0xfe04=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0xe04f[_0x2142c8];return _0x4286e9;};'use strict';var _=require(_0xfe04('0x0'));var util=require(_0xfe04('0x1'));var moment=require(_0xfe04('0x2'));var BPromise=require(_0xfe04('0x3'));var rs=require(_0xfe04('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe04('0x5'))['db'];var utils=require(_0xfe04('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfe04('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xfe04('0x8')]=_[_0xfe04('0x9')](config[_0xfe04('0x8')],{'host':_0xfe04('0xa'),'port':0x18eb});var socket=require(_0xfe04('0xb'))(new Redis(config[_0xfe04('0x8')]));require(_0xfe04('0xc'))[_0xfe04('0xd')](socket);function respondWithRpcPromise(_0x471320,_0x353d2a,_0x3d9146){return new BPromise(function(_0x1d3218,_0x37f063){return client[_0xfe04('0xe')](_0x471320,_0x3d9146)[_0xfe04('0xf')](function(_0x2b012d){logger[_0xfe04('0x10')](_0xfe04('0x11'),_0x353d2a,_0xfe04('0x12'));logger[_0xfe04('0x13')](_0xfe04('0x14'),_0x353d2a,_0xfe04('0x12'),JSON[_0xfe04('0x15')](_0x2b012d));if(_0x2b012d[_0xfe04('0x16')]){if(_0x2b012d[_0xfe04('0x16')][_0xfe04('0x17')]===0x1f4){logger[_0xfe04('0x16')](_0xfe04('0x11'),_0x353d2a,_0x2b012d[_0xfe04('0x16')]['message']);return _0x37f063(_0x2b012d['error'][_0xfe04('0x18')]);}logger[_0xfe04('0x16')](_0xfe04('0x11'),_0x353d2a,_0x2b012d['error']['message']);return _0x1d3218(_0x2b012d[_0xfe04('0x16')]['message']);}else{logger[_0xfe04('0x10')](_0xfe04('0x11'),_0x353d2a,'request\x20sent');_0x1d3218(_0x2b012d[_0xfe04('0x19')]['message']);}})[_0xfe04('0x1a')](function(_0x1d5396){logger[_0xfe04('0x16')]('DashboardItem,\x20%s,\x20%s',_0x353d2a,_0x1d5396);_0x37f063(_0x1d5396);});});} \ No newline at end of file +var _0xc364=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','redis','defaults','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0xc364,0x195));var _0x4c36=function(_0x4225aa,_0x582bf2){_0x4225aa=_0x4225aa-0x0;var _0x3f8fab=_0xc364[_0x4225aa];return _0x3f8fab;};'use strict';var _=require('lodash');var util=require(_0x4c36('0x0'));var moment=require('moment');var BPromise=require(_0x4c36('0x1'));var rs=require(_0x4c36('0x2'));var fs=require('fs');var Redis=require(_0x4c36('0x3'));var db=require(_0x4c36('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c36('0x5'))(_0x4c36('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4c36('0x7')]({'port':0x232a});config[_0x4c36('0x8')]=_[_0x4c36('0x9')](config[_0x4c36('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c36('0x8')]));require(_0x4c36('0xa'))[_0x4c36('0xb')](socket);function respondWithRpcPromise(_0x5c639d,_0x227147,_0x44933b){return new BPromise(function(_0x5a99f1,_0x36ad78){return client[_0x4c36('0xc')](_0x5c639d,_0x44933b)['then'](function(_0x14e853){logger[_0x4c36('0xd')](_0x4c36('0xe'),_0x227147,'request\x20sent');logger[_0x4c36('0xf')](_0x4c36('0x10'),_0x227147,'request\x20sent',JSON[_0x4c36('0x11')](_0x14e853));if(_0x14e853['error']){if(_0x14e853[_0x4c36('0x12')]['code']===0x1f4){logger[_0x4c36('0x12')](_0x4c36('0xe'),_0x227147,_0x14e853[_0x4c36('0x12')][_0x4c36('0x13')]);return _0x36ad78(_0x14e853['error'][_0x4c36('0x13')]);}logger['error'](_0x4c36('0xe'),_0x227147,_0x14e853[_0x4c36('0x12')]['message']);return _0x5a99f1(_0x14e853[_0x4c36('0x12')][_0x4c36('0x13')]);}else{logger[_0x4c36('0xd')](_0x4c36('0xe'),_0x227147,'request\x20sent');_0x5a99f1(_0x14e853['result'][_0x4c36('0x13')]);}})[_0x4c36('0x14')](function(_0x1e108f){logger[_0x4c36('0x12')](_0x4c36('0xe'),_0x227147,_0x1e108f);_0x36ad78(_0x1e108f);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 19c0f96..f081c49 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 _0xc15d=['register','./dashboardItem.events','remove','emit','removeListener'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0xc15d,0x65));var _0xdc15=function(_0x51e899,_0x2c3fc8){_0x51e899=_0x51e899-0x0;var _0x23137e=_0xc15d[_0x51e899];return _0x23137e;};'use strict';var DashboardItemEvents=require(_0xdc15('0x0'));var events=['save',_0xdc15('0x1'),'update'];function createListener(_0x444fd4,_0x340cf9){return function(_0x50d9f9){_0x340cf9[_0xdc15('0x2')](_0x444fd4,_0x50d9f9);};}function removeListener(_0x4e8605,_0x724083){return function(){DashboardItemEvents[_0xdc15('0x3')](_0x4e8605,_0x724083);};}exports[_0xdc15('0x4')]=function(_0x7fb4cf){for(var _0x42df37=0x0,_0x101093=events['length'];_0x42df37<_0x101093;_0x42df37++){var _0x353429=events[_0x42df37];var _0x2464d2=createListener('dashboardItem:'+_0x353429,_0x7fb4cf);DashboardItemEvents['on'](_0x353429,_0x2464d2);}}; \ No newline at end of file +var _0xdd90=['register','length','./dashboardItem.events','save','update','emit','removeListener'];(function(_0x272fff,_0x5cbd65){var _0x22263c=function(_0x300f88){while(--_0x300f88){_0x272fff['push'](_0x272fff['shift']());}};_0x22263c(++_0x5cbd65);}(_0xdd90,0x1d7));var _0x0dd9=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xdd90[_0x2c91e9];return _0x13f0ff;};'use strict';var DashboardItemEvents=require(_0x0dd9('0x0'));var events=[_0x0dd9('0x1'),'remove',_0x0dd9('0x2')];function createListener(_0x4514f2,_0x268ffa){return function(_0x8942b1){_0x268ffa[_0x0dd9('0x3')](_0x4514f2,_0x8942b1);};}function removeListener(_0x36691a,_0x49ee30){return function(){DashboardItemEvents[_0x0dd9('0x4')](_0x36691a,_0x49ee30);};}exports[_0x0dd9('0x5')]=function(_0x305f26){for(var _0x1f90f1=0x0,_0x283d82=events[_0x0dd9('0x6')];_0x1f90f1<_0x283d82;_0x1f90f1++){var _0xcc3482=events[_0x1f90f1];var _0x159384=createListener('dashboardItem:'+_0xcc3482,_0x305f26);DashboardItemEvents['on'](_0xcc3482,_0x159384);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 6bb3edd..ac38e5e 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 _0x1b7e=['create','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post'];(function(_0x1dc5a7,_0x448a9f){var _0x4b3f3e=function(_0x1f0cd5){while(--_0x1f0cd5){_0x1dc5a7['push'](_0x1dc5a7['shift']());}};_0x4b3f3e(++_0x448a9f);}(_0x1b7e,0x193));var _0xe1b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b7e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe1b7('0x0'));var util=require(_0xe1b7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe1b7('0x2'));var router=express[_0xe1b7('0x3')]();var fs_extra=require(_0xe1b7('0x4'));var auth=require(_0xe1b7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe1b7('0x6'));var controller=require(_0xe1b7('0x7'));router[_0xe1b7('0x8')](_0xe1b7('0x9'),auth[_0xe1b7('0xa')](),controller[_0xe1b7('0xb')]);router[_0xe1b7('0xc')]('/',auth[_0xe1b7('0xa')](),controller[_0xe1b7('0xd')]);router['put']('/:id',auth[_0xe1b7('0xa')](),controller[_0xe1b7('0xe')]);router['delete'](_0xe1b7('0x9'),auth[_0xe1b7('0xa')](),controller['destroy']);module[_0xe1b7('0xf')]=router; \ No newline at end of file +var _0x0545=['put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','./dashboardItem.controller','get','isAuthenticated','post','create'];(function(_0x2f56d7,_0x2a96a4){var _0x28bce5=function(_0x4bac26){while(--_0x4bac26){_0x2f56d7['push'](_0x2f56d7['shift']());}};_0x28bce5(++_0x2a96a4);}(_0x0545,0x116));var _0x5054=function(_0x51ce63,_0x1dd21c){_0x51ce63=_0x51ce63-0x0;var _0x593201=_0x0545[_0x51ce63];return _0x593201;};'use strict';var multer=require(_0x5054('0x0'));var util=require('util');var path=require(_0x5054('0x1'));var timeout=require(_0x5054('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5054('0x3'));var auth=require(_0x5054('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5054('0x5'));router[_0x5054('0x6')]('/:id',auth[_0x5054('0x7')](),controller['show']);router[_0x5054('0x8')]('/',auth[_0x5054('0x7')](),controller[_0x5054('0x9')]);router[_0x5054('0xa')](_0x5054('0xb'),auth[_0x5054('0x7')](),controller[_0x5054('0xc')]);router[_0x5054('0xd')]('/:id',auth[_0x5054('0x7')](),controller[_0x5054('0xe')]);module[_0x5054('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 7e10830..3040bff 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 _0xef1b=['first','second','third','sequelize','STRING','ENUM'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xef1b,0x9f));var _0xbef1=function(_0x46b904,_0x4f6019){_0x46b904=_0x46b904-0x0;var _0x1143c2=_0xef1b[_0x46b904];return _0x1143c2;};'use strict';var Sequelize=require(_0xbef1('0x0'));module['exports']={'name':{'type':Sequelize[_0xbef1('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xbef1('0x2')](_0xbef1('0x3'),_0xbef1('0x4'),_0xbef1('0x5')),'allowNull':![],'defaultValue':_0xbef1('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x85e6=['STRING','ENUM','first','second','sequelize','exports'];(function(_0x20a023,_0x26d9f2){var _0x32562b=function(_0x57450d){while(--_0x57450d){_0x20a023['push'](_0x20a023['shift']());}};_0x32562b(++_0x26d9f2);}(_0x85e6,0x1d8));var _0x685e=function(_0x415d2e,_0x3b7e32){_0x415d2e=_0x415d2e-0x0;var _0x58da0f=_0x85e6[_0x415d2e];return _0x58da0f;};'use strict';var Sequelize=require(_0x685e('0x0'));module[_0x685e('0x1')]={'name':{'type':Sequelize[_0x685e('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x685e('0x3')](_0x685e('0x4'),_0x685e('0x5'),'third'),'allowNull':![],'defaultValue':_0x685e('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 75581c9..20b679b 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 _0xc2e5=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','Disposition','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','destroy','get','Dispositions','then','sendStatus','error','name','send','index','map','rawAttributes','query','keys','filters','intersection','model'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc2e5,0x6f));var _0x5c2e=function(_0x32c9b9,_0x21a0cf){_0x32c9b9=_0x32c9b9-0x0;var _0x239eab=_0xc2e5[_0x32c9b9];return _0x239eab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c2e('0x0'));var zipdir=require(_0x5c2e('0x1'));var jsonpatch=require(_0x5c2e('0x2'));var rp=require(_0x5c2e('0x3'));var moment=require(_0x5c2e('0x4'));var BPromise=require(_0x5c2e('0x5'));var Mustache=require(_0x5c2e('0x6'));var util=require('util');var path=require(_0x5c2e('0x7'));var sox=require(_0x5c2e('0x8'));var csv=require(_0x5c2e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c2e('0xa'));var _=require('lodash');var squel=require(_0x5c2e('0xb'));var crypto=require(_0x5c2e('0xc'));var jsforce=require(_0x5c2e('0xd'));var deskjs=require(_0x5c2e('0xe'));var toCsv=require(_0x5c2e('0x9'));var querystring=require('querystring');var Papa=require(_0x5c2e('0xf'));var Redis=require(_0x5c2e('0x10'));var authService=require(_0x5c2e('0x11'));var qs=require(_0x5c2e('0x12'));var as=require(_0x5c2e('0x13'));var hardwareService=require(_0x5c2e('0x14'));var logger=require('../../config/logger')(_0x5c2e('0x15'));var utils=require(_0x5c2e('0x16'));var config=require(_0x5c2e('0x17'));var licenseUtil=require(_0x5c2e('0x18'));var db=require(_0x5c2e('0x19'))['db'];function respondWithStatusCode(_0x4a134c,_0x5b963b){_0x5b963b=_0x5b963b||0xcc;return function(_0x1ba5ad){if(_0x1ba5ad){return _0x4a134c['sendStatus'](_0x5b963b);}return _0x4a134c['status'](_0x5b963b)[_0x5c2e('0x1a')]();};}function respondWithResult(_0xe7fe49,_0xb6c231){_0xb6c231=_0xb6c231||0xc8;return function(_0x2643f3){if(_0x2643f3){return _0xe7fe49[_0x5c2e('0x1b')](_0xb6c231)[_0x5c2e('0x1c')](_0x2643f3);}};}function respondWithFilteredResult(_0x5d0acc,_0x33601e){return function(_0x313a6f){if(_0x313a6f){var _0x3b1884=typeof _0x33601e[_0x5c2e('0x1d')]===_0x5c2e('0x1e')&&typeof _0x33601e['limit']==='undefined';var _0x49e32e=_0x313a6f[_0x5c2e('0x1f')];var _0x2fd98a=_0x3b1884?0x0:_0x33601e['offset'];var _0x5979df=_0x3b1884?_0x313a6f[_0x5c2e('0x1f')]:_0x33601e['offset']+_0x33601e[_0x5c2e('0x20')];var _0x52ffaa;if(_0x5979df>=_0x49e32e){_0x5979df=_0x49e32e;_0x52ffaa=0xc8;}else{_0x52ffaa=0xce;}_0x5d0acc[_0x5c2e('0x1b')](_0x52ffaa);return _0x5d0acc['set'](_0x5c2e('0x21'),_0x2fd98a+'-'+_0x5979df+'/'+_0x49e32e)['json'](_0x313a6f);}return null;};}function patchUpdates(_0xe0c1a7){return function(_0xe74fa4){try{jsonpatch['apply'](_0xe74fa4,_0xe0c1a7,!![]);}catch(_0x2c98ef){return BPromise[_0x5c2e('0x22')](_0x2c98ef);}return _0xe74fa4[_0x5c2e('0x23')]();};}function saveUpdates(_0x437a32,_0x1e3949){return function(_0x4e6dca){if(_0x4e6dca){return _0x4e6dca[_0x5c2e('0x24')](_0x437a32)['then'](function(_0x3136f0){return _0x3136f0;});}return null;};}function removeEntity(_0x3e9535,_0x441403){return function(_0x5f473a){if(_0x5f473a){return _0x5f473a[_0x5c2e('0x25')]()['then'](function(){var _0x52e283=_0x5f473a[_0x5c2e('0x26')]({'plain':!![]});var _0x2bbe81=_0x5c2e('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x2bbe81,'resourceId':_0x52e283['id']}})[_0x5c2e('0x28')](function(){return _0x5f473a;});})['then'](function(){_0x3e9535[_0x5c2e('0x1b')](0xcc)[_0x5c2e('0x1a')]();});}};}function handleEntityNotFound(_0x5811c5,_0x2e85ff){return function(_0x2de98f){if(!_0x2de98f){_0x5811c5[_0x5c2e('0x29')](0x194);}return _0x2de98f;};}function handleError(_0x5b8b81,_0x2e45ba){_0x2e45ba=_0x2e45ba||0x1f4;return function(_0x1cf3b6){logger[_0x5c2e('0x2a')](_0x1cf3b6['stack']);if(_0x1cf3b6[_0x5c2e('0x2b')]){delete _0x1cf3b6['name'];}_0x5b8b81[_0x5c2e('0x1b')](_0x2e45ba)[_0x5c2e('0x2c')](_0x1cf3b6);};}exports[_0x5c2e('0x2d')]=function(_0x4af201,_0xc2b38a){var _0x5c3f9b={},_0x238923={},_0x58a65b={'count':0x0,'rows':[]};var _0x3ba5b6=_[_0x5c2e('0x2e')](db['Disposition'][_0x5c2e('0x2f')],function(_0x3639bb){return{'name':_0x3639bb['fieldName'],'type':_0x3639bb['type']['key']};});_0x238923['model']=_[_0x5c2e('0x2e')](_0x3ba5b6,_0x5c2e('0x2b'));_0x238923[_0x5c2e('0x30')]=_[_0x5c2e('0x31')](_0x4af201[_0x5c2e('0x30')]);_0x238923[_0x5c2e('0x32')]=_[_0x5c2e('0x33')](_0x238923[_0x5c2e('0x34')],_0x238923[_0x5c2e('0x30')]);_0x5c3f9b['attributes']=_[_0x5c2e('0x33')](_0x238923['model'],qs[_0x5c2e('0x35')](_0x4af201[_0x5c2e('0x30')][_0x5c2e('0x35')]));_0x5c3f9b[_0x5c2e('0x36')]=_0x5c3f9b[_0x5c2e('0x36')][_0x5c2e('0x37')]?_0x5c3f9b[_0x5c2e('0x36')]:_0x238923[_0x5c2e('0x34')];if(!_0x4af201['query'][_0x5c2e('0x38')](_0x5c2e('0x39'))){_0x5c3f9b[_0x5c2e('0x20')]=qs[_0x5c2e('0x20')](_0x4af201[_0x5c2e('0x30')][_0x5c2e('0x20')]);_0x5c3f9b[_0x5c2e('0x1d')]=qs[_0x5c2e('0x1d')](_0x4af201[_0x5c2e('0x30')][_0x5c2e('0x1d')]);}_0x5c3f9b[_0x5c2e('0x3a')]=qs['sort'](_0x4af201['query'][_0x5c2e('0x3b')]);_0x5c3f9b[_0x5c2e('0x3c')]=qs[_0x5c2e('0x32')](_['pick'](_0x4af201[_0x5c2e('0x30')],_0x238923[_0x5c2e('0x32')]),_0x3ba5b6);if(_0x4af201[_0x5c2e('0x30')][_0x5c2e('0x3d')]){_0x5c3f9b[_0x5c2e('0x3c')]=_[_0x5c2e('0x3e')](_0x5c3f9b[_0x5c2e('0x3c')],{'$or':_[_0x5c2e('0x2e')](_0x3ba5b6,function(_0x1bead6){if(_0x1bead6[_0x5c2e('0x3f')]!==_0x5c2e('0x40')){var _0x3d9f78={};_0x3d9f78[_0x1bead6[_0x5c2e('0x2b')]]={'$like':'%'+_0x4af201[_0x5c2e('0x30')][_0x5c2e('0x3d')]+'%'};return _0x3d9f78;}})});}_0x5c3f9b=_['merge']({},_0x5c3f9b,_0x4af201[_0x5c2e('0x41')]);var _0x49882d={'where':_0x5c3f9b[_0x5c2e('0x3c')]};return db[_0x5c2e('0x42')][_0x5c2e('0x1f')](_0x49882d)[_0x5c2e('0x28')](function(_0x587ac4){_0x58a65b['count']=_0x587ac4;if(_0x4af201['query'][_0x5c2e('0x43')]){_0x5c3f9b[_0x5c2e('0x44')]=[{'all':!![]}];}return db[_0x5c2e('0x42')][_0x5c2e('0x45')](_0x5c3f9b);})[_0x5c2e('0x28')](function(_0x49aee0){_0x58a65b[_0x5c2e('0x46')]=_0x49aee0;return _0x58a65b;})[_0x5c2e('0x28')](respondWithFilteredResult(_0xc2b38a,_0x5c3f9b))[_0x5c2e('0x47')](handleError(_0xc2b38a,null));};exports[_0x5c2e('0x48')]=function(_0x1761ca,_0xe2e12d){var _0x2dd263={'raw':!![],'where':{'id':_0x1761ca[_0x5c2e('0x49')]['id']}},_0x1420f2={};_0x1420f2[_0x5c2e('0x34')]=_['keys'](db[_0x5c2e('0x42')][_0x5c2e('0x2f')]);_0x1420f2[_0x5c2e('0x30')]=_[_0x5c2e('0x31')](_0x1761ca[_0x5c2e('0x30')]);_0x1420f2[_0x5c2e('0x32')]=_['intersection'](_0x1420f2[_0x5c2e('0x34')],_0x1420f2[_0x5c2e('0x30')]);_0x2dd263[_0x5c2e('0x36')]=_[_0x5c2e('0x33')](_0x1420f2['model'],qs[_0x5c2e('0x35')](_0x1761ca[_0x5c2e('0x30')]['fields']));_0x2dd263[_0x5c2e('0x36')]=_0x2dd263['attributes'][_0x5c2e('0x37')]?_0x2dd263[_0x5c2e('0x36')]:_0x1420f2[_0x5c2e('0x34')];if(_0x1761ca[_0x5c2e('0x30')]['includeAll']){_0x2dd263[_0x5c2e('0x44')]=[{'all':!![]}];}_0x2dd263=_['merge']({},_0x2dd263,_0x1761ca['options']);return db[_0x5c2e('0x42')]['find'](_0x2dd263)[_0x5c2e('0x28')](handleEntityNotFound(_0xe2e12d,null))[_0x5c2e('0x28')](respondWithResult(_0xe2e12d,null))[_0x5c2e('0x47')](handleError(_0xe2e12d,null));};exports[_0x5c2e('0x4a')]=function(_0x52768d,_0x1098f9){return db[_0x5c2e('0x42')][_0x5c2e('0x4a')](_0x52768d[_0x5c2e('0x4b')],{})[_0x5c2e('0x28')](function(_0x202e35){var _0x5913b3=_0x52768d[_0x5c2e('0x4c')]['get']({'plain':!![]});if(!_0x5913b3)throw new Error(_0x5c2e('0x4d'));if(_0x5913b3[_0x5c2e('0x4e')]===_0x5c2e('0x4c')){var _0x2183cd=_0x202e35[_0x5c2e('0x26')]({'plain':!![]});var _0x200699=_0x5c2e('0x27');return db[_0x5c2e('0x4f')][_0x5c2e('0x50')]({'where':{'name':_0x200699,'userProfileId':_0x5913b3['userProfileId']},'raw':!![]})[_0x5c2e('0x28')](function(_0x25811c){if(_0x25811c&&_0x25811c['autoAssociation']===0x0){return db[_0x5c2e('0x51')][_0x5c2e('0x4a')]({'name':_0x2183cd[_0x5c2e('0x2b')],'resourceId':_0x2183cd['id'],'type':_0x25811c['name'],'sectionId':_0x25811c['id']},{})[_0x5c2e('0x28')](function(){return _0x202e35;});}else{return _0x202e35;}})[_0x5c2e('0x47')](function(_0x5a9486){logger[_0x5c2e('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a9486);throw _0x5a9486;});}return _0x202e35;})[_0x5c2e('0x28')](respondWithResult(_0x1098f9,0xc9))[_0x5c2e('0x47')](handleError(_0x1098f9,null));};exports[_0x5c2e('0x24')]=function(_0x26bf03,_0x1b2e09){if(_0x26bf03[_0x5c2e('0x4b')]['id']){delete _0x26bf03[_0x5c2e('0x4b')]['id'];}return db[_0x5c2e('0x42')][_0x5c2e('0x50')]({'where':{'id':_0x26bf03[_0x5c2e('0x49')]['id']}})[_0x5c2e('0x28')](handleEntityNotFound(_0x1b2e09,null))['then'](saveUpdates(_0x26bf03[_0x5c2e('0x4b')],null))[_0x5c2e('0x28')](respondWithResult(_0x1b2e09,null))[_0x5c2e('0x47')](handleError(_0x1b2e09,null));};exports[_0x5c2e('0x25')]=function(_0x183864,_0x147e46){return db[_0x5c2e('0x42')][_0x5c2e('0x50')]({'where':{'id':_0x183864[_0x5c2e('0x49')]['id']}})['then'](handleEntityNotFound(_0x147e46,null))[_0x5c2e('0x28')](removeEntity(_0x147e46,null))[_0x5c2e('0x47')](handleError(_0x147e46,null));}; \ No newline at end of file +var _0xc13c=['save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','index','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','Disposition','includeAll','include','catch','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','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','status','end','json','undefined','limit','offset','count','Content-Range','reject'];(function(_0x339f4d,_0x3d3481){var _0x410bc3=function(_0x837285){while(--_0x837285){_0x339f4d['push'](_0x339f4d['shift']());}};_0x410bc3(++_0x3d3481);}(_0xc13c,0x15c));var _0xcc13=function(_0x212a17,_0x1749f6){_0x212a17=_0x212a17-0x0;var _0x578aa4=_0xc13c[_0x212a17];return _0x578aa4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc13('0x0'));var zipdir=require(_0xcc13('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc13('0x2'));var moment=require('moment');var BPromise=require(_0xcc13('0x3'));var Mustache=require('mustache');var util=require(_0xcc13('0x4'));var path=require(_0xcc13('0x5'));var sox=require('sox');var csv=require(_0xcc13('0x6'));var ejs=require(_0xcc13('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc13('0x8'));var squel=require(_0xcc13('0x9'));var crypto=require('crypto');var jsforce=require(_0xcc13('0xa'));var deskjs=require(_0xcc13('0xb'));var toCsv=require(_0xcc13('0x6'));var querystring=require('querystring');var Papa=require(_0xcc13('0xc'));var Redis=require(_0xcc13('0xd'));var authService=require(_0xcc13('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcc13('0xf'));var hardwareService=require(_0xcc13('0x10'));var logger=require(_0xcc13('0x11'))(_0xcc13('0x12'));var utils=require(_0xcc13('0x13'));var config=require(_0xcc13('0x14'));var licenseUtil=require(_0xcc13('0x15'));var db=require(_0xcc13('0x16'))['db'];function respondWithStatusCode(_0x515866,_0xf24f83){_0xf24f83=_0xf24f83||0xcc;return function(_0x1c7bf8){if(_0x1c7bf8){return _0x515866['sendStatus'](_0xf24f83);}return _0x515866[_0xcc13('0x17')](_0xf24f83)[_0xcc13('0x18')]();};}function respondWithResult(_0x313bab,_0x3aff1d){_0x3aff1d=_0x3aff1d||0xc8;return function(_0x4a85a0){if(_0x4a85a0){return _0x313bab['status'](_0x3aff1d)[_0xcc13('0x19')](_0x4a85a0);}};}function respondWithFilteredResult(_0x4bcf51,_0x1d8614){return function(_0x241fbd){if(_0x241fbd){var _0x3f1c1e=typeof _0x1d8614['offset']===_0xcc13('0x1a')&&typeof _0x1d8614[_0xcc13('0x1b')]===_0xcc13('0x1a');var _0x1e69ef=_0x241fbd['count'];var _0xffb0d0=_0x3f1c1e?0x0:_0x1d8614[_0xcc13('0x1c')];var _0x5668db=_0x3f1c1e?_0x241fbd[_0xcc13('0x1d')]:_0x1d8614['offset']+_0x1d8614[_0xcc13('0x1b')];var _0x4c6a88;if(_0x5668db>=_0x1e69ef){_0x5668db=_0x1e69ef;_0x4c6a88=0xc8;}else{_0x4c6a88=0xce;}_0x4bcf51[_0xcc13('0x17')](_0x4c6a88);return _0x4bcf51['set'](_0xcc13('0x1e'),_0xffb0d0+'-'+_0x5668db+'/'+_0x1e69ef)['json'](_0x241fbd);}return null;};}function patchUpdates(_0xfa10a7){return function(_0x449894){try{jsonpatch['apply'](_0x449894,_0xfa10a7,!![]);}catch(_0x537e46){return BPromise[_0xcc13('0x1f')](_0x537e46);}return _0x449894[_0xcc13('0x20')]();};}function saveUpdates(_0x2ecc9f,_0x47ee57){return function(_0x1d7f7e){if(_0x1d7f7e){return _0x1d7f7e[_0xcc13('0x21')](_0x2ecc9f)[_0xcc13('0x22')](function(_0x19d576){return _0x19d576;});}return null;};}function removeEntity(_0x344911,_0x29221a){return function(_0x533f39){if(_0x533f39){return _0x533f39[_0xcc13('0x23')]()[_0xcc13('0x22')](function(){var _0x8aab1=_0x533f39[_0xcc13('0x24')]({'plain':!![]});var _0x2aa29f=_0xcc13('0x25');return db[_0xcc13('0x26')][_0xcc13('0x23')]({'where':{'type':_0x2aa29f,'resourceId':_0x8aab1['id']}})[_0xcc13('0x22')](function(){return _0x533f39;});})[_0xcc13('0x22')](function(){_0x344911[_0xcc13('0x17')](0xcc)[_0xcc13('0x18')]();});}};}function handleEntityNotFound(_0x2618d5,_0x15af4e){return function(_0x5c153d){if(!_0x5c153d){_0x2618d5['sendStatus'](0x194);}return _0x5c153d;};}function handleError(_0x270590,_0x583446){_0x583446=_0x583446||0x1f4;return function(_0x1b0672){logger[_0xcc13('0x27')](_0x1b0672[_0xcc13('0x28')]);if(_0x1b0672[_0xcc13('0x29')]){delete _0x1b0672[_0xcc13('0x29')];}_0x270590[_0xcc13('0x17')](_0x583446)['send'](_0x1b0672);};}exports[_0xcc13('0x2a')]=function(_0x5a4825,_0xd160e6){var _0x33f131={},_0x3248d9={},_0x395148={'count':0x0,'rows':[]};var _0x39e521=_['map'](db['Disposition'][_0xcc13('0x2b')],function(_0x1a7f4a){return{'name':_0x1a7f4a['fieldName'],'type':_0x1a7f4a[_0xcc13('0x2c')][_0xcc13('0x2d')]};});_0x3248d9[_0xcc13('0x2e')]=_[_0xcc13('0x2f')](_0x39e521,_0xcc13('0x29'));_0x3248d9[_0xcc13('0x30')]=_[_0xcc13('0x31')](_0x5a4825[_0xcc13('0x30')]);_0x3248d9['filters']=_[_0xcc13('0x32')](_0x3248d9[_0xcc13('0x2e')],_0x3248d9['query']);_0x33f131[_0xcc13('0x33')]=_[_0xcc13('0x32')](_0x3248d9[_0xcc13('0x2e')],qs[_0xcc13('0x34')](_0x5a4825['query'][_0xcc13('0x34')]));_0x33f131[_0xcc13('0x33')]=_0x33f131['attributes'][_0xcc13('0x35')]?_0x33f131['attributes']:_0x3248d9['model'];if(!_0x5a4825[_0xcc13('0x30')][_0xcc13('0x36')]('nolimit')){_0x33f131[_0xcc13('0x1b')]=qs[_0xcc13('0x1b')](_0x5a4825[_0xcc13('0x30')][_0xcc13('0x1b')]);_0x33f131[_0xcc13('0x1c')]=qs[_0xcc13('0x1c')](_0x5a4825[_0xcc13('0x30')]['offset']);}_0x33f131['order']=qs[_0xcc13('0x37')](_0x5a4825[_0xcc13('0x30')]['sort']);_0x33f131[_0xcc13('0x38')]=qs[_0xcc13('0x39')](_[_0xcc13('0x3a')](_0x5a4825[_0xcc13('0x30')],_0x3248d9[_0xcc13('0x39')]),_0x39e521);if(_0x5a4825[_0xcc13('0x30')][_0xcc13('0x3b')]){_0x33f131[_0xcc13('0x38')]=_['merge'](_0x33f131[_0xcc13('0x38')],{'$or':_[_0xcc13('0x2f')](_0x39e521,function(_0x1af96b){if(_0x1af96b[_0xcc13('0x2c')]!==_0xcc13('0x3c')){var _0x57b7c7={};_0x57b7c7[_0x1af96b[_0xcc13('0x29')]]={'$like':'%'+_0x5a4825[_0xcc13('0x30')][_0xcc13('0x3b')]+'%'};return _0x57b7c7;}})});}_0x33f131=_[_0xcc13('0x3d')]({},_0x33f131,_0x5a4825['options']);var _0x4dd763={'where':_0x33f131[_0xcc13('0x38')]};return db[_0xcc13('0x3e')][_0xcc13('0x1d')](_0x4dd763)['then'](function(_0x4ce1f0){_0x395148[_0xcc13('0x1d')]=_0x4ce1f0;if(_0x5a4825[_0xcc13('0x30')][_0xcc13('0x3f')]){_0x33f131[_0xcc13('0x40')]=[{'all':!![]}];}return db[_0xcc13('0x3e')]['findAll'](_0x33f131);})[_0xcc13('0x22')](function(_0x28ba53){_0x395148['rows']=_0x28ba53;return _0x395148;})[_0xcc13('0x22')](respondWithFilteredResult(_0xd160e6,_0x33f131))[_0xcc13('0x41')](handleError(_0xd160e6,null));};exports['show']=function(_0x3ba6b2,_0x3254dc){var _0x1e54e2={'raw':!![],'where':{'id':_0x3ba6b2[_0xcc13('0x42')]['id']}},_0x266954={};_0x266954['model']=_[_0xcc13('0x31')](db[_0xcc13('0x3e')][_0xcc13('0x2b')]);_0x266954[_0xcc13('0x30')]=_['keys'](_0x3ba6b2[_0xcc13('0x30')]);_0x266954[_0xcc13('0x39')]=_['intersection'](_0x266954['model'],_0x266954[_0xcc13('0x30')]);_0x1e54e2[_0xcc13('0x33')]=_[_0xcc13('0x32')](_0x266954[_0xcc13('0x2e')],qs[_0xcc13('0x34')](_0x3ba6b2[_0xcc13('0x30')]['fields']));_0x1e54e2['attributes']=_0x1e54e2[_0xcc13('0x33')][_0xcc13('0x35')]?_0x1e54e2[_0xcc13('0x33')]:_0x266954[_0xcc13('0x2e')];if(_0x3ba6b2['query'][_0xcc13('0x3f')]){_0x1e54e2[_0xcc13('0x40')]=[{'all':!![]}];}_0x1e54e2=_[_0xcc13('0x3d')]({},_0x1e54e2,_0x3ba6b2[_0xcc13('0x43')]);return db[_0xcc13('0x3e')][_0xcc13('0x44')](_0x1e54e2)[_0xcc13('0x22')](handleEntityNotFound(_0x3254dc,null))[_0xcc13('0x22')](respondWithResult(_0x3254dc,null))['catch'](handleError(_0x3254dc,null));};exports[_0xcc13('0x45')]=function(_0x6060a3,_0x20b2d9){return db[_0xcc13('0x3e')]['create'](_0x6060a3[_0xcc13('0x46')],{})[_0xcc13('0x22')](function(_0x106b4c){var _0x20d67e=_0x6060a3['user'][_0xcc13('0x24')]({'plain':!![]});if(!_0x20d67e)throw new Error(_0xcc13('0x47'));if(_0x20d67e[_0xcc13('0x48')]===_0xcc13('0x49')){var _0x294e1a=_0x106b4c[_0xcc13('0x24')]({'plain':!![]});var _0x4ba716=_0xcc13('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x4ba716,'userProfileId':_0x20d67e['userProfileId']},'raw':!![]})[_0xcc13('0x22')](function(_0x5b8b7c){if(_0x5b8b7c&&_0x5b8b7c[_0xcc13('0x4a')]===0x0){return db[_0xcc13('0x26')][_0xcc13('0x45')]({'name':_0x294e1a['name'],'resourceId':_0x294e1a['id'],'type':_0x5b8b7c[_0xcc13('0x29')],'sectionId':_0x5b8b7c['id']},{})[_0xcc13('0x22')](function(){return _0x106b4c;});}else{return _0x106b4c;}})[_0xcc13('0x41')](function(_0x2d58d0){logger[_0xcc13('0x27')](_0xcc13('0x4b'),_0x2d58d0);throw _0x2d58d0;});}return _0x106b4c;})[_0xcc13('0x22')](respondWithResult(_0x20b2d9,0xc9))['catch'](handleError(_0x20b2d9,null));};exports[_0xcc13('0x21')]=function(_0x4f19ff,_0x1686d9){if(_0x4f19ff['body']['id']){delete _0x4f19ff[_0xcc13('0x46')]['id'];}return db[_0xcc13('0x3e')][_0xcc13('0x44')]({'where':{'id':_0x4f19ff['params']['id']}})[_0xcc13('0x22')](handleEntityNotFound(_0x1686d9,null))['then'](saveUpdates(_0x4f19ff[_0xcc13('0x46')],null))[_0xcc13('0x22')](respondWithResult(_0x1686d9,null))[_0xcc13('0x41')](handleError(_0x1686d9,null));};exports[_0xcc13('0x23')]=function(_0x53f4a1,_0x213b23){return db[_0xcc13('0x3e')]['find']({'where':{'id':_0x53f4a1[_0xcc13('0x42')]['id']}})['then'](handleEntityNotFound(_0x213b23,null))[_0xcc13('0x22')](removeEntity(_0x213b23,null))[_0xcc13('0x41')](handleError(_0x213b23,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index cbc3faf..2e8fc2e 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 _0x507b=['name_chat','ChatWebsiteId','name_mail','MailAccountId','name_fax','FaxAccountId','OpenchannelAccountId','WhatsappAccountId','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','tools_dispositions','name_voice','name','ListId'];(function(_0x341acb,_0x2ec6fb){var _0x29715f=function(_0x30ff6c){while(--_0x30ff6c){_0x341acb['push'](_0x341acb['shift']());}};_0x29715f(++_0x2ec6fb);}(_0x507b,0x1d0));var _0xb507=function(_0x1d4f34,_0x2fc968){_0x1d4f34=_0x1d4f34-0x0;var _0x2aed87=_0x507b[_0x1d4f34];return _0x2aed87;};'use strict';var _=require('lodash');var util=require(_0xb507('0x0'));var logger=require(_0xb507('0x1'))(_0xb507('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb507('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb507('0x4'));var config=require(_0xb507('0x5'));var attributes=require('./disposition.attributes');module[_0xb507('0x6')]=function(_0x459155,_0x2aafd3){return _0x459155['define']('Disposition',attributes,{'tableName':_0xb507('0x7'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xb507('0x8'),'fields':[_0xb507('0x9'),_0xb507('0xa')]},{'unique':!![],'name':_0xb507('0xb'),'fields':[_0xb507('0x9'),_0xb507('0xc')]},{'unique':!![],'name':_0xb507('0xd'),'fields':[_0xb507('0x9'),_0xb507('0xe')]},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':_0xb507('0xf'),'fields':[_0xb507('0x9'),_0xb507('0x10')]},{'unique':!![],'name':'name_openchannel','fields':[_0xb507('0x9'),_0xb507('0x11')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0xb507('0x12')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x385e=['./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_mail','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x19bcc0,_0x4491a6){var _0x46343e=function(_0x2a6941){while(--_0x2a6941){_0x19bcc0['push'](_0x19bcc0['shift']());}};_0x46343e(++_0x4491a6);}(_0x385e,0x1da));var _0xe385=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0x385e[_0x440917];return _0x5e906b;};'use strict';var _=require(_0xe385('0x0'));var util=require(_0xe385('0x1'));var logger=require('../../config/logger')(_0xe385('0x2'));var moment=require(_0xe385('0x3'));var BPromise=require(_0xe385('0x4'));var rp=require(_0xe385('0x5'));var fs=require('fs');var path=require(_0xe385('0x6'));var rimraf=require(_0xe385('0x7'));var config=require(_0xe385('0x8'));var attributes=require(_0xe385('0x9'));module['exports']=function(_0x429f32,_0xf14ef5){return _0x429f32[_0xe385('0xa')](_0xe385('0xb'),attributes,{'tableName':_0xe385('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xe385('0xd'),'fields':[_0xe385('0xe'),_0xe385('0xf')]},{'unique':!![],'name':_0xe385('0x10'),'fields':[_0xe385('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0xe385('0x11'),'fields':[_0xe385('0xe'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0xe385('0xe'),_0xe385('0x12')]},{'unique':!![],'name':'name_fax','fields':[_0xe385('0xe'),_0xe385('0x13')]},{'unique':!![],'name':_0xe385('0x14'),'fields':['name',_0xe385('0x15')]},{'unique':!![],'name':'name_whatsapp','fields':[_0xe385('0xe'),_0xe385('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 87ddce9..0df43c5 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(_0x375195,_0x363213){var _0x5b20ac=function(_0x3460f9){while(--_0x3460f9){_0x375195['push'](_0x375195['shift']());}};_0x5b20ac(++_0x363213);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0xe02c53,_0xe06a59){var _0x391f8b=function(_0x1800ee){while(--_0x1800ee){_0xe02c53['push'](_0xe02c53['shift']());}};_0x391f8b(++_0xe06a59);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 5cafbca..4771151 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 _0x30a6=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x2f356c,_0x54a603){var _0x2dd85c=function(_0x37a900){while(--_0x37a900){_0x2f356c['push'](_0x2f356c['shift']());}};_0x2dd85c(++_0x54a603);}(_0x30a6,0x1b5));var _0x630a=function(_0x49653e,_0x196c78){_0x49653e=_0x49653e-0x0;var _0x80e684=_0x30a6[_0x49653e];return _0x80e684;};'use strict';var multer=require(_0x630a('0x0'));var util=require('util');var path=require(_0x630a('0x1'));var timeout=require(_0x630a('0x2'));var express=require(_0x630a('0x3'));var router=express[_0x630a('0x4')]();var fs_extra=require(_0x630a('0x5'));var auth=require(_0x630a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x630a('0x7'));var controller=require(_0x630a('0x8'));router[_0x630a('0x9')]('/',auth[_0x630a('0xa')](),controller['index']);router[_0x630a('0x9')](_0x630a('0xb'),auth[_0x630a('0xa')](),controller[_0x630a('0xc')]);router['post']('/',auth[_0x630a('0xa')](),controller[_0x630a('0xd')]);router[_0x630a('0xe')](_0x630a('0xb'),auth[_0x630a('0xa')](),controller[_0x630a('0xf')]);router[_0x630a('0x10')](_0x630a('0xb'),auth[_0x630a('0xa')](),controller[_0x630a('0x11')]);module[_0x630a('0x12')]=router; \ No newline at end of file +var _0x2456=['show','post','create','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id'];(function(_0x219a04,_0xccc518){var _0x5e5155=function(_0x470e3a){while(--_0x470e3a){_0x219a04['push'](_0x219a04['shift']());}};_0x5e5155(++_0xccc518);}(_0x2456,0x126));var _0x6245=function(_0x3cf683,_0x1689f3){_0x3cf683=_0x3cf683-0x0;var _0x3f3761=_0x2456[_0x3cf683];return _0x3f3761;};'use strict';var multer=require('multer');var util=require(_0x6245('0x0'));var path=require(_0x6245('0x1'));var timeout=require(_0x6245('0x2'));var express=require(_0x6245('0x3'));var router=express['Router']();var fs_extra=require(_0x6245('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6245('0x5'));var config=require(_0x6245('0x6'));var controller=require(_0x6245('0x7'));router[_0x6245('0x8')]('/',auth[_0x6245('0x9')](),controller[_0x6245('0xa')]);router['get'](_0x6245('0xb'),auth[_0x6245('0x9')](),controller[_0x6245('0xc')]);router[_0x6245('0xd')]('/',auth[_0x6245('0x9')](),controller[_0x6245('0xe')]);router['put']('/:id',auth[_0x6245('0x9')](),controller[_0x6245('0xf')]);router['delete']('/:id',auth[_0x6245('0x9')](),controller[_0x6245('0x10')]);module[_0x6245('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 9181f6a..79d8f77 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 _0x3f82=['v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','yes','localstationid','4800','12000','14400','7200','9600'];(function(_0x1d3298,_0x43a337){var _0x243c44=function(_0x4d6b6b){while(--_0x4d6b6b){_0x1d3298['push'](_0x1d3298['shift']());}};_0x243c44(++_0x43a337);}(_0x3f82,0x166));var _0x23f8=function(_0x31b1f0,_0x1b59f1){_0x31b1f0=_0x31b1f0-0x0;var _0x1cab75=_0x3f82[_0x31b1f0];return _0x1cab75;};'use strict';var Sequelize=require('sequelize');module[_0x23f8('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x23f8('0x1')]},'ecm':{'type':Sequelize[_0x23f8('0x2')](_0x23f8('0x3'),'no'),'defaultValue':_0x23f8('0x3')},'headerinfo':{'type':Sequelize[_0x23f8('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x23f8('0x1')],'unique':_0x23f8('0x4')},'minrate':{'type':Sequelize[_0x23f8('0x2')]('2400',_0x23f8('0x5'),'7200','9600',_0x23f8('0x6'),_0x23f8('0x7')),'defaultValue':_0x23f8('0x5')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x23f8('0x5'),_0x23f8('0x8'),_0x23f8('0x9'),'12000',_0x23f8('0x7')),'defaultValue':_0x23f8('0x7')},'modem':{'type':Sequelize[_0x23f8('0x1')],'defaultValue':_0x23f8('0xa')},'gateway':{'type':Sequelize[_0x23f8('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x23f8('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x23f8('0xc'),_0x23f8('0xd'),_0x23f8('0xe'),'KHOMP'),'defaultValue':_0x23f8('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x23f8('0xf')],'defaultValue':function(){return _0x23f8('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x23f8('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x23f8('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x23f8('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x23f8('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x23f8('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x23f8('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x23f8('0x11')],'defaultValue':![],'comment':_0x23f8('0x13'),'set':function(_0x17ff23){if(!_0x17ff23)this[_0x23f8('0x14')](_0x23f8('0x15'),null);this[_0x23f8('0x14')](_0x23f8('0x16'),_0x17ff23);}}}; \ No newline at end of file +var _0x46b7=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','localstationid','4800','7200','12000','14400','2400','9600','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x5811f0,_0x13ba47){var _0x3f7013=function(_0x5b9d11){while(--_0x5b9d11){_0x5811f0['push'](_0x5811f0['shift']());}};_0x3f7013(++_0x13ba47);}(_0x46b7,0x71));var _0x746b=function(_0x363583,_0x5c1919){_0x363583=_0x363583-0x0;var _0x56ce19=_0x46b7[_0x363583];return _0x56ce19;};'use strict';var Sequelize=require(_0x746b('0x0'));module[_0x746b('0x1')]={'name':{'type':Sequelize[_0x746b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x746b('0x2')]},'ecm':{'type':Sequelize[_0x746b('0x3')](_0x746b('0x4'),'no'),'defaultValue':_0x746b('0x4')},'headerinfo':{'type':Sequelize[_0x746b('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x746b('0x5')},'minrate':{'type':Sequelize[_0x746b('0x3')]('2400',_0x746b('0x6'),_0x746b('0x7'),'9600',_0x746b('0x8'),_0x746b('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x746b('0x3')](_0x746b('0xa'),_0x746b('0x6'),_0x746b('0x7'),_0x746b('0xb'),_0x746b('0x8'),_0x746b('0x9')),'defaultValue':_0x746b('0x9')},'modem':{'type':Sequelize[_0x746b('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x746b('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x746b('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x746b('0x3')](_0x746b('0xc'),_0x746b('0xd'),_0x746b('0xe'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x746b('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x746b('0xf')],'defaultValue':function(){return _0x746b('0x10');}},'notificationSound':{'type':Sequelize[_0x746b('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x746b('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x746b('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x746b('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x746b('0x12')],'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[_0x746b('0x11')],'defaultValue':![],'comment':_0x746b('0x13'),'set':function(_0x152a04){if(!_0x152a04)this[_0x746b('0x14')](_0x746b('0x15'),null);this[_0x746b('0x14')]('mandatoryDisposition',_0x152a04);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 47223f3..5d9cf41 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 _0x4ac4=['READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','context','from-voip-provider','exten','app','system','description','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','updateAccountApplications','VoiceExtension','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','root','basename','CheckAfterSend','isNil','from','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./faxAccount.socket','register','client','http','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','end','status','undefined','count','offset','limit','set','json','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','params','Pause','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','body','describe','addDisposition','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','FaxAccountId','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','Contact','User','internal','Tags','color','tag','addApplications','sequelize','ISOLATION_LEVELS'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x4ac4,0x106));var _0x44ac=function(_0x4ab62e,_0x1c9869){_0x4ab62e=_0x4ab62e-0x0;var _0x19c3d1=_0x4ac4[_0x4ab62e];return _0x19c3d1;};'use strict';var emlformat=require(_0x44ac('0x0'));var rimraf=require(_0x44ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x44ac('0x2'));var rp=require('request-promise');var moment=require(_0x44ac('0x3'));var BPromise=require(_0x44ac('0x4'));var Mustache=require('mustache');var util=require(_0x44ac('0x5'));var path=require(_0x44ac('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44ac('0x7'));var _=require('lodash');var squel=require(_0x44ac('0x8'));var crypto=require('crypto');var jsforce=require(_0x44ac('0x9'));var deskjs=require(_0x44ac('0xa'));var toCsv=require(_0x44ac('0xb'));var querystring=require('querystring');var Papa=require(_0x44ac('0xc'));var Redis=require(_0x44ac('0xd'));var authService=require(_0x44ac('0xe'));var qs=require(_0x44ac('0xf'));var as=require(_0x44ac('0x10'));var hardwareService=require(_0x44ac('0x11'));var logger=require(_0x44ac('0x12'))(_0x44ac('0x13'));var utils=require(_0x44ac('0x14'));var config=require(_0x44ac('0x15'));var licenseUtil=require(_0x44ac('0x16'));var db=require('../../mysqldb')['db'];config[_0x44ac('0x17')]=_[_0x44ac('0x18')](config[_0x44ac('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x44ac('0x19'))(new Redis(config[_0x44ac('0x17')]));require(_0x44ac('0x1a'))[_0x44ac('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x44ac('0x1c')][_0x44ac('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17a474,_0x40e672,_0x318dd5,_0x4dfd36){return new BPromise(function(_0x4198ff,_0xd4adc0){var _0x3aa946=_0x4dfd36||client;return _0x3aa946['request'](_0x17a474,_0x318dd5)[_0x44ac('0x1e')](function(_0x1be7f6){logger[_0x44ac('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x40e672,'request\x20sent');logger[_0x44ac('0x20')](_0x44ac('0x21'),_0x40e672,_0x44ac('0x22'),JSON[_0x44ac('0x23')](_0x1be7f6));if(_0x1be7f6[_0x44ac('0x24')]){if(_0x1be7f6[_0x44ac('0x24')][_0x44ac('0x25')]===0x1f4){logger[_0x44ac('0x24')](_0x44ac('0x26'),_0x40e672,_0x1be7f6[_0x44ac('0x24')][_0x44ac('0x27')]);return _0xd4adc0(_0x1be7f6['error']['message']);}logger['error'](_0x44ac('0x26'),_0x40e672,_0x1be7f6[_0x44ac('0x24')][_0x44ac('0x27')]);return _0x4198ff(_0x1be7f6['error'][_0x44ac('0x27')]);}else{logger['info'](_0x44ac('0x26'),_0x40e672,_0x44ac('0x22'));_0x4198ff(_0x1be7f6[_0x44ac('0x28')][_0x44ac('0x27')]);}})[_0x44ac('0x29')](function(_0x1bb548){logger[_0x44ac('0x24')](_0x44ac('0x26'),_0x40e672,_0x1bb548);_0xd4adc0(_0x1bb548);});});}function respondWithStatusCode(_0x68228b,_0x2c5d4f){_0x2c5d4f=_0x2c5d4f||0xcc;return function(_0x524cf5){if(_0x524cf5){return _0x68228b['sendStatus'](_0x2c5d4f);}return _0x68228b['status'](_0x2c5d4f)[_0x44ac('0x2a')]();};}function respondWithResult(_0x47966d,_0x299056){_0x299056=_0x299056||0xc8;return function(_0x5c15a7){if(_0x5c15a7){return _0x47966d[_0x44ac('0x2b')](_0x299056)['json'](_0x5c15a7);}};}function respondWithFilteredResult(_0x31e122,_0x5390a8){return function(_0x50c88b){if(_0x50c88b){var _0x2c4f27=typeof _0x5390a8['offset']===_0x44ac('0x2c')&&typeof _0x5390a8['limit']==='undefined';var _0x472191=_0x50c88b[_0x44ac('0x2d')];var _0x2dd438=_0x2c4f27?0x0:_0x5390a8['offset'];var _0x34ddbf=_0x2c4f27?_0x50c88b[_0x44ac('0x2d')]:_0x5390a8[_0x44ac('0x2e')]+_0x5390a8[_0x44ac('0x2f')];var _0x28f594;if(_0x34ddbf>=_0x472191){_0x34ddbf=_0x472191;_0x28f594=0xc8;}else{_0x28f594=0xce;}_0x31e122[_0x44ac('0x2b')](_0x28f594);return _0x31e122[_0x44ac('0x30')]('Content-Range',_0x2dd438+'-'+_0x34ddbf+'/'+_0x472191)[_0x44ac('0x31')](_0x50c88b);}return null;};}function patchUpdates(_0x12e511){return function(_0x429cf2){try{jsonpatch['apply'](_0x429cf2,_0x12e511,!![]);}catch(_0x566144){return BPromise[_0x44ac('0x32')](_0x566144);}return _0x429cf2[_0x44ac('0x33')]();};}function saveUpdates(_0x5272eb,_0x482d8f){return function(_0x4cde1d){if(_0x4cde1d){return _0x4cde1d[_0x44ac('0x34')](_0x5272eb)[_0x44ac('0x1e')](function(_0x7c3ab3){return _0x7c3ab3;});}return null;};}function removeEntity(_0x92092d,_0x440e07){return function(_0x5399bd){if(_0x5399bd){return _0x5399bd[_0x44ac('0x35')]()[_0x44ac('0x1e')](function(){var _0x578632=_0x5399bd[_0x44ac('0x36')]({'plain':!![]});var _0x5c0894=_0x44ac('0x37');return db[_0x44ac('0x38')]['destroy']({'where':{'type':_0x5c0894,'resourceId':_0x578632['id']}})[_0x44ac('0x1e')](function(){return _0x5399bd;});})[_0x44ac('0x1e')](function(){_0x92092d['status'](0xcc)[_0x44ac('0x2a')]();});}};}function handleEntityNotFound(_0x3368d3,_0x7c4652){return function(_0x2e9ff0){if(!_0x2e9ff0){_0x3368d3[_0x44ac('0x39')](0x194);}return _0x2e9ff0;};}function handleError(_0x1acb4f,_0x3749d9){_0x3749d9=_0x3749d9||0x1f4;return function(_0x1311da){logger[_0x44ac('0x24')](_0x1311da[_0x44ac('0x3a')]);if(_0x1311da[_0x44ac('0x3b')]){delete _0x1311da[_0x44ac('0x3b')];}_0x1acb4f['status'](_0x3749d9)['send'](_0x1311da);};}exports['index']=function(_0x2eded2,_0x196d35){var _0x220747={'include':[{'model':db['Pause'],'as':_0x44ac('0x3c')}]},_0x3cc857={},_0x447529={'count':0x0,'rows':[]};var _0x53f6b4=_[_0x44ac('0x3d')](db[_0x44ac('0x3e')][_0x44ac('0x3f')],function(_0x1d50d2){return{'name':_0x1d50d2[_0x44ac('0x40')],'type':_0x1d50d2[_0x44ac('0x41')][_0x44ac('0x42')]};});_0x3cc857[_0x44ac('0x43')]=_[_0x44ac('0x3d')](_0x53f6b4,_0x44ac('0x3b'));_0x3cc857[_0x44ac('0x44')]=_[_0x44ac('0x45')](_0x2eded2[_0x44ac('0x44')]);_0x3cc857['filters']=_[_0x44ac('0x46')](_0x3cc857[_0x44ac('0x43')],_0x3cc857[_0x44ac('0x44')]);_0x220747[_0x44ac('0x47')]=_[_0x44ac('0x46')](_0x3cc857['model'],qs[_0x44ac('0x48')](_0x2eded2['query'][_0x44ac('0x48')]));_0x220747['attributes']=_0x220747[_0x44ac('0x47')][_0x44ac('0x49')]?_0x220747['attributes']:_0x3cc857[_0x44ac('0x43')];if(!_0x2eded2[_0x44ac('0x44')][_0x44ac('0x4a')](_0x44ac('0x4b'))){_0x220747[_0x44ac('0x2f')]=qs[_0x44ac('0x2f')](_0x2eded2[_0x44ac('0x44')][_0x44ac('0x2f')]);_0x220747[_0x44ac('0x2e')]=qs[_0x44ac('0x2e')](_0x2eded2[_0x44ac('0x44')][_0x44ac('0x2e')]);}_0x220747[_0x44ac('0x4c')]=qs[_0x44ac('0x4d')](_0x2eded2[_0x44ac('0x44')][_0x44ac('0x4d')]);_0x220747['where']=qs['filters'](_[_0x44ac('0x4e')](_0x2eded2[_0x44ac('0x44')],_0x3cc857[_0x44ac('0x4f')]),_0x53f6b4);if(_0x2eded2[_0x44ac('0x44')][_0x44ac('0x50')]){_0x220747['where']=_[_0x44ac('0x51')](_0x220747[_0x44ac('0x52')],{'$or':_[_0x44ac('0x3d')](_0x53f6b4,function(_0xb1d192){if(_0xb1d192['type']!==_0x44ac('0x53')){var _0x3c46d2={};_0x3c46d2[_0xb1d192[_0x44ac('0x3b')]]={'$like':'%'+_0x2eded2[_0x44ac('0x44')][_0x44ac('0x50')]+'%'};return _0x3c46d2;}})});}_0x220747=_[_0x44ac('0x51')]({},_0x220747,_0x2eded2[_0x44ac('0x54')]);var _0x2fcdae={'where':_0x220747[_0x44ac('0x52')]};return db[_0x44ac('0x3e')][_0x44ac('0x2d')](_0x2fcdae)[_0x44ac('0x1e')](function(_0x4d7147){_0x447529[_0x44ac('0x2d')]=_0x4d7147;if(_0x2eded2[_0x44ac('0x44')][_0x44ac('0x55')]){_0x220747['include']=[{'all':!![]}];}return db[_0x44ac('0x3e')][_0x44ac('0x56')](_0x220747);})[_0x44ac('0x1e')](function(_0x1b1356){_0x447529[_0x44ac('0x57')]=_0x1b1356;return _0x447529;})[_0x44ac('0x1e')](respondWithFilteredResult(_0x196d35,_0x220747))[_0x44ac('0x29')](handleError(_0x196d35,null));};exports[_0x44ac('0x58')]=function(_0x356b2c,_0x23404a){var _0x50a1a6={'raw':![],'where':{'id':_0x356b2c[_0x44ac('0x59')]['id']},'include':[{'model':db[_0x44ac('0x5a')],'as':'mandatoryDispositionPause'}]},_0x4980cc={};_0x4980cc[_0x44ac('0x43')]=_['keys'](db['FaxAccount'][_0x44ac('0x3f')]);_0x4980cc['query']=_[_0x44ac('0x45')](_0x356b2c[_0x44ac('0x44')]);_0x4980cc[_0x44ac('0x4f')]=_[_0x44ac('0x46')](_0x4980cc[_0x44ac('0x43')],_0x4980cc[_0x44ac('0x44')]);_0x50a1a6[_0x44ac('0x47')]=_['intersection'](_0x4980cc['model'],qs[_0x44ac('0x48')](_0x356b2c[_0x44ac('0x44')][_0x44ac('0x48')]));_0x50a1a6[_0x44ac('0x47')]=_0x50a1a6[_0x44ac('0x47')][_0x44ac('0x49')]?_0x50a1a6[_0x44ac('0x47')]:_0x4980cc[_0x44ac('0x43')];if(_0x356b2c[_0x44ac('0x44')][_0x44ac('0x55')]){_0x50a1a6[_0x44ac('0x5b')]=[{'all':!![]}];}_0x50a1a6=_['merge']({},_0x50a1a6,_0x356b2c[_0x44ac('0x54')]);return db[_0x44ac('0x3e')][_0x44ac('0x5c')](_0x50a1a6)['then'](handleEntityNotFound(_0x23404a,null))[_0x44ac('0x1e')](respondWithResult(_0x23404a,null))[_0x44ac('0x29')](handleError(_0x23404a,null));};exports[_0x44ac('0x5d')]=function(_0x4e47a5,_0x3ed838){return db[_0x44ac('0x3e')]['create'](_0x4e47a5['body'],{})['then'](function(_0x21e5fd){var _0x52d59c=_0x4e47a5[_0x44ac('0x5e')][_0x44ac('0x36')]({'plain':!![]});if(!_0x52d59c)throw new Error(_0x44ac('0x5f'));if(_0x52d59c[_0x44ac('0x60')]===_0x44ac('0x5e')){var _0x44422e=_0x21e5fd[_0x44ac('0x36')]({'plain':!![]});var _0x4f0417='FaxAccounts';return db['UserProfileSection'][_0x44ac('0x5c')]({'where':{'name':_0x4f0417,'userProfileId':_0x52d59c[_0x44ac('0x61')]},'raw':!![]})[_0x44ac('0x1e')](function(_0xf80f79){if(_0xf80f79&&_0xf80f79['autoAssociation']===0x0){return db[_0x44ac('0x38')]['create']({'name':_0x44422e[_0x44ac('0x3b')],'resourceId':_0x44422e['id'],'type':_0xf80f79[_0x44ac('0x3b')],'sectionId':_0xf80f79['id']},{})[_0x44ac('0x1e')](function(){return _0x21e5fd;});}else{return _0x21e5fd;}})[_0x44ac('0x29')](function(_0x4b02f1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b02f1);throw _0x4b02f1;});}return _0x21e5fd;})['then'](respondWithResult(_0x3ed838,0xc9))[_0x44ac('0x29')](handleError(_0x3ed838,null));};exports[_0x44ac('0x34')]=function(_0x140a65,_0x1c81d1){if(_0x140a65[_0x44ac('0x62')]['id']){delete _0x140a65[_0x44ac('0x62')]['id'];}return db[_0x44ac('0x3e')][_0x44ac('0x5c')]({'where':{'id':_0x140a65['params']['id']},'include':[{'model':db[_0x44ac('0x5a')],'as':_0x44ac('0x3c')}]})[_0x44ac('0x1e')](handleEntityNotFound(_0x1c81d1,null))['then'](saveUpdates(_0x140a65[_0x44ac('0x62')],null))[_0x44ac('0x1e')](respondWithResult(_0x1c81d1,null))[_0x44ac('0x29')](handleError(_0x1c81d1,null));};exports[_0x44ac('0x35')]=function(_0x2cdfc1,_0x224e79){return db[_0x44ac('0x3e')]['find']({'where':{'id':_0x2cdfc1[_0x44ac('0x59')]['id']}})['then'](handleEntityNotFound(_0x224e79,null))[_0x44ac('0x1e')](removeEntity(_0x224e79,null))[_0x44ac('0x29')](handleError(_0x224e79,null));};exports[_0x44ac('0x63')]=function(_0x33555b,_0x3ed898){return db['FaxAccount'][_0x44ac('0x63')]()[_0x44ac('0x1e')](respondWithResult(_0x3ed898,null))['catch'](handleError(_0x3ed898,null));};exports[_0x44ac('0x64')]=function(_0x31442f,_0x19afd3,_0x482a52){if(_0x31442f[_0x44ac('0x62')]['id']){delete _0x31442f[_0x44ac('0x62')]['id'];}return db[_0x44ac('0x3e')][_0x44ac('0x5c')]({'where':{'id':_0x31442f[_0x44ac('0x59')]['id']}})[_0x44ac('0x1e')](handleEntityNotFound(_0x19afd3,null))[_0x44ac('0x1e')](function(_0x4ce801){if(_0x4ce801){_0x31442f[_0x44ac('0x62')]['FaxAccountId']=_0x4ce801['id'];return db['Disposition'][_0x44ac('0x5d')](_0x31442f['body']);}})[_0x44ac('0x1e')](respondWithResult(_0x19afd3,null))[_0x44ac('0x29')](handleError(_0x19afd3,null));};exports[_0x44ac('0x65')]=function(_0x3d78b2,_0x24e251,_0x3dbd4){var _0x36725f={'raw':![],'where':{}};var _0x429967={};var _0x24ef8f={'count':0x0,'rows':[]};return db['FaxAccount'][_0x44ac('0x66')]({'where':{'id':_0x3d78b2[_0x44ac('0x59')]['id']}})['then'](handleEntityNotFound(_0x24e251,null))[_0x44ac('0x1e')](function(_0x4a3c1e){if(_0x4a3c1e){_0x429967[_0x44ac('0x43')]=_[_0x44ac('0x45')](db[_0x44ac('0x67')]['rawAttributes']);_0x429967['query']=_['keys'](_0x3d78b2['query']);_0x429967[_0x44ac('0x4f')]=_['intersection'](_0x429967[_0x44ac('0x43')],_0x429967['query']);_0x36725f[_0x44ac('0x47')]=_[_0x44ac('0x46')](_0x429967['model'],qs[_0x44ac('0x48')](_0x3d78b2['query'][_0x44ac('0x48')]));_0x36725f[_0x44ac('0x47')]=_0x36725f['attributes'][_0x44ac('0x49')]?_0x36725f['attributes']:_0x429967[_0x44ac('0x43')];if(!_0x3d78b2[_0x44ac('0x44')][_0x44ac('0x4a')](_0x44ac('0x4b'))){_0x36725f[_0x44ac('0x2f')]=qs['limit'](_0x3d78b2[_0x44ac('0x44')][_0x44ac('0x2f')]);_0x36725f[_0x44ac('0x2e')]=qs[_0x44ac('0x2e')](_0x3d78b2[_0x44ac('0x44')][_0x44ac('0x2e')]);}_0x36725f[_0x44ac('0x4c')]=qs[_0x44ac('0x4d')](_0x3d78b2[_0x44ac('0x44')]['sort']);_0x36725f[_0x44ac('0x52')]=qs[_0x44ac('0x4f')](_[_0x44ac('0x4e')](_0x3d78b2[_0x44ac('0x44')],_0x429967[_0x44ac('0x4f')]));_0x36725f[_0x44ac('0x52')]['FaxAccountId']=_0x4a3c1e['id'];if(_0x3d78b2[_0x44ac('0x44')][_0x44ac('0x50')]){_0x36725f[_0x44ac('0x52')]=_['merge'](_0x36725f[_0x44ac('0x52')],{'$or':_[_0x44ac('0x3d')](_0x36725f[_0x44ac('0x47')],function(_0x21c8e0){var _0x4371f9={};_0x4371f9[_0x21c8e0]={'$like':'%'+_0x3d78b2['query'][_0x44ac('0x50')]+'%'};return _0x4371f9;})});}_0x36725f=_[_0x44ac('0x51')]({},_0x36725f,_0x3d78b2['options']);return db['Disposition'][_0x44ac('0x2d')]({'where':_0x36725f['where']})[_0x44ac('0x1e')](function(_0x1cd3c3){_0x24ef8f[_0x44ac('0x2d')]=_0x1cd3c3;if(_0x3d78b2[_0x44ac('0x44')][_0x44ac('0x55')]){_0x36725f[_0x44ac('0x5b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x36725f);})[_0x44ac('0x1e')](function(_0xd03b5d){_0x24ef8f[_0x44ac('0x57')]=_0xd03b5d;return _0x24ef8f;});}})[_0x44ac('0x1e')](respondWithFilteredResult(_0x24e251,_0x36725f))['catch'](handleError(_0x24e251,null));};exports[_0x44ac('0x68')]=function(_0x2cc2d6,_0x4f4560,_0x3905a6){return db[_0x44ac('0x3e')][_0x44ac('0x5c')]({'where':{'id':_0x2cc2d6['params']['id']}})[_0x44ac('0x1e')](handleEntityNotFound(_0x4f4560,null))['then'](function(_0x1ba28e){if(_0x1ba28e){return _0x1ba28e[_0x44ac('0x68')](_0x2cc2d6[_0x44ac('0x44')][_0x44ac('0x69')]);}})['then'](respondWithStatusCode(_0x4f4560,null))[_0x44ac('0x29')](handleError(_0x4f4560,null));};exports[_0x44ac('0x6a')]=function(_0x2bef41,_0x8efc17,_0x5b7a0a){if(_0x2bef41[_0x44ac('0x62')]['id']){delete _0x2bef41[_0x44ac('0x62')]['id'];}return db['FaxAccount'][_0x44ac('0x5c')]({'where':{'id':_0x2bef41[_0x44ac('0x59')]['id']}})[_0x44ac('0x1e')](handleEntityNotFound(_0x8efc17,null))['then'](function(_0x492cdd){if(_0x492cdd){_0x2bef41['body'][_0x44ac('0x6b')]=_0x492cdd['id'];return db[_0x44ac('0x6c')][_0x44ac('0x5d')](_0x2bef41[_0x44ac('0x62')]);}})['then'](respondWithResult(_0x8efc17,null))['catch'](handleError(_0x8efc17,null));};exports[_0x44ac('0x6d')]=function(_0x29d7ed,_0x57ef18,_0x260d1d){var _0x3ec1ef={'raw':![],'where':{}};var _0x2e3ec1={};var _0x4574a7={'count':0x0,'rows':[]};return db[_0x44ac('0x3e')]['findOne']({'where':{'id':_0x29d7ed[_0x44ac('0x59')]['id']}})['then'](handleEntityNotFound(_0x57ef18,null))['then'](function(_0x5ad289){if(_0x5ad289){_0x2e3ec1[_0x44ac('0x43')]=_['keys'](db[_0x44ac('0x6c')]['rawAttributes']);_0x2e3ec1['query']=_[_0x44ac('0x45')](_0x29d7ed[_0x44ac('0x44')]);_0x2e3ec1[_0x44ac('0x4f')]=_[_0x44ac('0x46')](_0x2e3ec1[_0x44ac('0x43')],_0x2e3ec1['query']);_0x3ec1ef[_0x44ac('0x47')]=_[_0x44ac('0x46')](_0x2e3ec1[_0x44ac('0x43')],qs[_0x44ac('0x48')](_0x29d7ed[_0x44ac('0x44')]['fields']));_0x3ec1ef[_0x44ac('0x47')]=_0x3ec1ef[_0x44ac('0x47')][_0x44ac('0x49')]?_0x3ec1ef[_0x44ac('0x47')]:_0x2e3ec1['model'];if(!_0x29d7ed[_0x44ac('0x44')][_0x44ac('0x4a')](_0x44ac('0x4b'))){_0x3ec1ef['limit']=qs[_0x44ac('0x2f')](_0x29d7ed[_0x44ac('0x44')][_0x44ac('0x2f')]);_0x3ec1ef['offset']=qs['offset'](_0x29d7ed['query'][_0x44ac('0x2e')]);}_0x3ec1ef[_0x44ac('0x4c')]=qs[_0x44ac('0x4d')](_0x29d7ed[_0x44ac('0x44')][_0x44ac('0x4d')]);_0x3ec1ef[_0x44ac('0x52')]=qs[_0x44ac('0x4f')](_[_0x44ac('0x4e')](_0x29d7ed['query'],_0x2e3ec1[_0x44ac('0x4f')]));_0x3ec1ef[_0x44ac('0x52')]['FaxAccountId']=_0x5ad289['id'];if(_0x29d7ed[_0x44ac('0x44')][_0x44ac('0x50')]){_0x3ec1ef[_0x44ac('0x52')]=_['merge'](_0x3ec1ef[_0x44ac('0x52')],{'$or':_[_0x44ac('0x3d')](_0x3ec1ef['attributes'],function(_0x4e02ca){var _0x527cb1={};_0x527cb1[_0x4e02ca]={'$like':'%'+_0x29d7ed[_0x44ac('0x44')][_0x44ac('0x50')]+'%'};return _0x527cb1;})});}_0x3ec1ef=_[_0x44ac('0x51')]({},_0x3ec1ef,_0x29d7ed[_0x44ac('0x54')]);return db['CannedAnswer'][_0x44ac('0x2d')]({'where':_0x3ec1ef['where']})[_0x44ac('0x1e')](function(_0x44f6de){_0x4574a7[_0x44ac('0x2d')]=_0x44f6de;if(_0x29d7ed[_0x44ac('0x44')][_0x44ac('0x55')]){_0x3ec1ef['include']=[{'all':!![]}];}return db[_0x44ac('0x6c')][_0x44ac('0x56')](_0x3ec1ef);})[_0x44ac('0x1e')](function(_0xedae94){_0x4574a7[_0x44ac('0x57')]=_0xedae94;return _0x4574a7;});}})[_0x44ac('0x1e')](respondWithFilteredResult(_0x57ef18,_0x3ec1ef))[_0x44ac('0x29')](handleError(_0x57ef18,null));};exports[_0x44ac('0x6e')]=function(_0x499cf5,_0xf034e5,_0x1c2775){return db['FaxAccount'][_0x44ac('0x5c')]({'where':{'id':_0x499cf5[_0x44ac('0x59')]['id']}})[_0x44ac('0x1e')](handleEntityNotFound(_0xf034e5,null))['then'](function(_0x13e164){if(_0x13e164){return _0x13e164[_0x44ac('0x6e')](_0x499cf5[_0x44ac('0x44')][_0x44ac('0x69')]);}})[_0x44ac('0x1e')](respondWithStatusCode(_0xf034e5,null))['catch'](handleError(_0xf034e5,null));};exports[_0x44ac('0x6f')]=function(_0x2e6c72,_0x3180d6,_0x2ae1cf){return db[_0x44ac('0x70')][_0x44ac('0x5c')]({'where':{'id':_0x2e6c72[_0x44ac('0x59')]['id']}})[_0x44ac('0x1e')](handleEntityNotFound(_0x3180d6,null))['then'](function(_0x48e9a5){if(_0x48e9a5){return _0x48e9a5['addInteraction'](_0x2e6c72['body'][_0x44ac('0x69')],_[_0x44ac('0x71')](_0x2e6c72[_0x44ac('0x62')],['ids','id'])||{});}})[_0x44ac('0x1e')](respondWithResult(_0x3180d6,null))[_0x44ac('0x29')](handleError(_0x3180d6,null));};exports['getInteractions']=function(_0x9e0ed2,_0x21e569,_0x2a4d23){var _0x424ef6={'raw':![],'where':{}};var _0x51f457={};var _0x41d839={'count':0x0,'rows':[]};return db[_0x44ac('0x3e')]['findOne']({'where':{'id':_0x9e0ed2['params']['id']}})[_0x44ac('0x1e')](handleEntityNotFound(_0x21e569,null))['then'](function(_0x5f4427){if(_0x5f4427){_0x51f457[_0x44ac('0x43')]=_[_0x44ac('0x45')](db[_0x44ac('0x70')][_0x44ac('0x3f')]);_0x51f457[_0x44ac('0x44')]=_[_0x44ac('0x45')](_0x9e0ed2['query']);_0x51f457['filters']=_[_0x44ac('0x46')](_0x51f457[_0x44ac('0x43')],_0x51f457['query']);_0x424ef6[_0x44ac('0x47')]=_[_0x44ac('0x46')](_0x51f457[_0x44ac('0x43')],qs[_0x44ac('0x48')](_0x9e0ed2['query'][_0x44ac('0x48')]));_0x424ef6['attributes']=_0x424ef6[_0x44ac('0x47')][_0x44ac('0x49')]?_0x424ef6[_0x44ac('0x47')]:_0x51f457[_0x44ac('0x43')];if(!_0x9e0ed2[_0x44ac('0x44')]['hasOwnProperty']('nolimit')){_0x424ef6[_0x44ac('0x2f')]=qs[_0x44ac('0x2f')](_0x9e0ed2['query'][_0x44ac('0x2f')]);_0x424ef6[_0x44ac('0x2e')]=qs[_0x44ac('0x2e')](_0x9e0ed2[_0x44ac('0x44')][_0x44ac('0x2e')]);}_0x424ef6[_0x44ac('0x4c')]=qs[_0x44ac('0x4d')](_0x9e0ed2[_0x44ac('0x44')][_0x44ac('0x4d')]);_0x424ef6[_0x44ac('0x52')]=qs[_0x44ac('0x4f')](_['pick'](_0x9e0ed2['query'],_0x51f457['filters']));_0x424ef6[_0x44ac('0x52')][_0x44ac('0x6b')]=_0x5f4427['id'];if(_0x9e0ed2['query'][_0x44ac('0x50')]){_0x424ef6[_0x44ac('0x52')]=_[_0x44ac('0x51')](_0x424ef6[_0x44ac('0x52')],{'$or':_[_0x44ac('0x3d')](_0x424ef6[_0x44ac('0x47')],function(_0x4127c3){var _0x21a776={};_0x21a776[_0x4127c3]={'$like':'%'+_0x9e0ed2[_0x44ac('0x44')][_0x44ac('0x50')]+'%'};return _0x21a776;})});}_0x424ef6=_[_0x44ac('0x51')]({},_0x424ef6,_0x9e0ed2[_0x44ac('0x54')]);return db[_0x44ac('0x70')][_0x44ac('0x2d')]({'where':_0x424ef6[_0x44ac('0x52')]})[_0x44ac('0x1e')](function(_0x44b3e8){_0x41d839['count']=_0x44b3e8;if(_0x9e0ed2[_0x44ac('0x44')][_0x44ac('0x55')]){_0x424ef6[_0x44ac('0x5b')]=[{'model':db[_0x44ac('0x72')],'as':_0x44ac('0x73'),'required':![]},{'model':db[_0x44ac('0x74')],'as':'Owner','attributes':[_0x44ac('0x3b'),'fullname',_0x44ac('0x75')],'required':![]},{'model':db['Tag'],'as':_0x44ac('0x76'),'attributes':['id',_0x44ac('0x3b'),_0x44ac('0x77')],'where':_0x9e0ed2[_0x44ac('0x44')]['tag']?{'id':_0x9e0ed2[_0x44ac('0x44')][_0x44ac('0x78')]}:undefined,'required':_0x9e0ed2[_0x44ac('0x44')][_0x44ac('0x78')]?!![]:![]}];}return db[_0x44ac('0x70')]['findAll'](_0x424ef6);})[_0x44ac('0x1e')](function(_0x30a80d){_0x41d839[_0x44ac('0x57')]=_0x30a80d;return _0x41d839;});}})[_0x44ac('0x1e')](respondWithFilteredResult(_0x21e569,_0x424ef6))[_0x44ac('0x29')](handleError(_0x21e569,null));};exports[_0x44ac('0x79')]=function(_0x131e7f,_0x40458b){var _0x5304ac=_0x131e7f[_0x44ac('0x59')]['id'];var _0x1b377f=_0x131e7f['body'];var _0x17a481=0xc8;var _0xa77dd1=null;return db[_0x44ac('0x7a')]['transaction']({'isolationLevel':db[_0x44ac('0x7a')]['Transaction'][_0x44ac('0x7b')][_0x44ac('0x7c')]},function(_0x3173d2){return db['FaxAccount'][_0x44ac('0x66')]({'where':{'id':_0x5304ac},'transaction':_0x3173d2})[_0x44ac('0x1e')](function(_0xdd18ac){if(_0xdd18ac){return db[_0x44ac('0x7d')][_0x44ac('0x35')]({'where':{'FaxAccountId':_0x5304ac},'transaction':_0x3173d2})['then'](function(){var _0x3ad355=_[_0x44ac('0x3d')](_0x1b377f,function(_0x3940f3){_0x3940f3[_0x44ac('0x6b')]=_0x5304ac;return _0x3940f3;});return db[_0x44ac('0x7d')][_0x44ac('0x7e')](_0x3ad355,{'transaction':_0x3173d2});});}else{_0x17a481=0x194;_0xa77dd1=[];}});})[_0x44ac('0x1e')](function(){if(_0x17a481!==0x194){return db[_0x44ac('0x7d')][_0x44ac('0x7f')]({'where':{'FaxAccountId':_0x5304ac},'order':_0x44ac('0x80')})['then'](function(_0xe320f6){_0xa77dd1=_0xe320f6;});}})['catch'](function(_0x43dbd6){_0x17a481=0x1f4;logger['error'](_0x43dbd6[_0x44ac('0x3a')]);if(_0x43dbd6[_0x44ac('0x3b')]){delete _0x43dbd6[_0x44ac('0x3b')];}_0xa77dd1=_0x43dbd6;})[_0x44ac('0x81')](function(){if(_0xa77dd1===null){_0x40458b[_0x44ac('0x39')](_0x17a481);}else{if(_0x17a481===0x1f4){_0x40458b[_0x44ac('0x2b')](_0x17a481)[_0x44ac('0x82')](_0xa77dd1);}else{_0x40458b[_0x44ac('0x2b')](_0x17a481)[_0x44ac('0x31')](_0xa77dd1);}}});};exports[_0x44ac('0x83')]=function(_0x1a3700,_0x563535,_0x2e7e8d){var _0x4bd023={};var _0x350621={};var _0x53fdb5;var _0xc64e2b;return db['FaxAccount'][_0x44ac('0x66')]({'where':{'id':_0x1a3700['params']['id']}})[_0x44ac('0x1e')](handleEntityNotFound(_0x563535,null))[_0x44ac('0x1e')](function(_0xf2a80){if(_0xf2a80){_0x53fdb5=_0xf2a80;_0x350621[_0x44ac('0x43')]=_[_0x44ac('0x45')](db[_0x44ac('0x7d')][_0x44ac('0x3f')]);_0x350621['query']=_['keys'](_0x1a3700[_0x44ac('0x44')]);_0x350621[_0x44ac('0x4f')]=_['intersection'](_0x350621[_0x44ac('0x43')],_0x350621[_0x44ac('0x44')]);_0x4bd023['attributes']=_[_0x44ac('0x46')](_0x350621['model'],qs[_0x44ac('0x48')](_0x1a3700[_0x44ac('0x44')][_0x44ac('0x48')]));_0x4bd023[_0x44ac('0x47')]=_0x4bd023[_0x44ac('0x47')]['length']?_0x4bd023[_0x44ac('0x47')]:_0x350621[_0x44ac('0x43')];_0x4bd023['order']=qs[_0x44ac('0x4d')](_0x1a3700['query'][_0x44ac('0x4d')]);_0x4bd023[_0x44ac('0x52')]=qs[_0x44ac('0x4f')](_['pick'](_0x1a3700[_0x44ac('0x44')],_0x350621['filters']));if(_0x1a3700[_0x44ac('0x44')][_0x44ac('0x50')]){_0x4bd023[_0x44ac('0x52')]=_['merge'](_0x4bd023[_0x44ac('0x52')],{'$or':_['map'](_0x4bd023[_0x44ac('0x47')],function(_0x4e3a0b){var _0x33a55a={};_0x33a55a[_0x4e3a0b]={'$like':'%'+_0x1a3700[_0x44ac('0x44')][_0x44ac('0x50')]+'%'};return _0x33a55a;})});}_0x4bd023=_['merge']({},_0x4bd023,_0x1a3700[_0x44ac('0x54')]);return _0x53fdb5[_0x44ac('0x83')](_0x4bd023);}})[_0x44ac('0x1e')](function(_0x44c93e){if(_0x44c93e){_0xc64e2b=_0x44c93e[_0x44ac('0x49')];if(!_0x1a3700[_0x44ac('0x44')][_0x44ac('0x4a')](_0x44ac('0x4b'))){_0x4bd023['limit']=qs[_0x44ac('0x2f')](_0x1a3700[_0x44ac('0x44')][_0x44ac('0x2f')]);_0x4bd023[_0x44ac('0x2e')]=qs[_0x44ac('0x2e')](_0x1a3700[_0x44ac('0x44')][_0x44ac('0x2e')]);}return _0x53fdb5[_0x44ac('0x83')](_0x4bd023);}})[_0x44ac('0x1e')](function(_0x49447f){if(_0x49447f){return _0x49447f?{'count':_0xc64e2b,'rows':_0x49447f}:null;}})[_0x44ac('0x1e')](respondWithResult(_0x563535,null))[_0x44ac('0x29')](handleError(_0x563535,null));};function Extension(_0x4f94d7,_0x58e41c,_0x17ffe4,_0x47ca3d){this[_0x44ac('0x84')]=_0x44ac('0x85');this[_0x44ac('0x86')]=_0x4f94d7['localstationid'];this[_0x44ac('0x87')]=_0x47ca3d;this['type']=_0x44ac('0x88');this[_0x44ac('0x89')]='Fax\x20Extension';this[_0x44ac('0x6b')]=_0x4f94d7['id'];this[_0x44ac('0x80')]=_0x58e41c;this[_0x44ac('0x8a')]=_0x17ffe4;}function createExtensionsReciveFax(_0x35d880){var _0x3e28c9=0x1;var _0x41ac82=[];_0x41ac82[_0x44ac('0x8b')](new Extension(_0x35d880,_0x3e28c9,'','Answer'));_0x3e28c9+=0x1;_0x41ac82[_0x44ac('0x8b')](new Extension(_0x35d880,_0x3e28c9,_0x44ac('0x8c'),_0x44ac('0x8d')));_0x3e28c9+=0x1;for(var _0x533a8f in _0x35d880){if(_0x35d880['hasOwnProperty'](_0x533a8f)&&(_0x533a8f===_0x44ac('0x8e')||_0x533a8f==='localstationid'||_0x533a8f===_0x44ac('0x8f')||_0x533a8f==='faxdetect'||_0x533a8f===_0x44ac('0x90')||_0x533a8f===_0x44ac('0x91')||_0x533a8f===_0x44ac('0x92')||_0x533a8f===_0x44ac('0x93')||_0x533a8f===_0x44ac('0x94'))){_0x41ac82['push'](new Extension(_0x35d880,_0x3e28c9,_0x44ac('0x95')+_0x533a8f+')='+_0x35d880[_0x533a8f],_0x44ac('0x8d')));_0x3e28c9+=0x1;}}_0x41ac82[_0x44ac('0x8b')](new Extension(_0x35d880,_0x3e28c9,'6',_0x44ac('0x96')));_0x3e28c9+=0x1;_0x41ac82[_0x44ac('0x8b')](new Extension(_0x35d880,_0x3e28c9,_0x44ac('0x97'),_0x44ac('0x98')));_0x3e28c9=0x0;return _0x41ac82;}exports[_0x44ac('0x99')]=function(_0x3b9a11,_0x20483d,_0x48ac61){var _0x2b00e0;return db[_0x44ac('0x7a')][_0x44ac('0x9a')](function(_0x1d4f6c){return db[_0x44ac('0x3e')][_0x44ac('0x5d')](_0x3b9a11[_0x44ac('0x62')],{'transaction':_0x1d4f6c})[_0x44ac('0x1e')](function(_0x241ff7){_0x2b00e0=_0x241ff7[_0x44ac('0x36')]({'plain':!![]});return db['VoiceExtension'][_0x44ac('0x7e')](createExtensionsReciveFax(_0x2b00e0),{'transaction':_0x1d4f6c});});})[_0x44ac('0x1e')](function(){return _0x2b00e0;})[_0x44ac('0x1e')](respondWithResult(_0x20483d,null))[_0x44ac('0x29')](handleError(_0x20483d,null));};exports[_0x44ac('0x9b')]=function(_0x38b196,_0x36ffe6,_0x3bae23){var _0x3e194f;return db[_0x44ac('0x7a')][_0x44ac('0x9a')](function(_0xa18006){return db['FaxAccount'][_0x44ac('0x34')](_0x38b196[_0x44ac('0x62')],{'where':{'id':_0x38b196['body']['id']},'transaction':_0xa18006})[_0x44ac('0x1e')](function(_0xc979b){return db[_0x44ac('0x9c')][_0x44ac('0x35')]({'where':{'FaxAccountId':_0x38b196[_0x44ac('0x62')]['id']},'transaction':_0xa18006})[_0x44ac('0x1e')](function(_0x2b8d47){return db['VoiceExtension'][_0x44ac('0x7e')](createExtensionsReciveFax(_[_0x44ac('0x71')](_0x38b196[_0x44ac('0x62')],['tech',_0x44ac('0x42'),_0x44ac('0x9d'),_0x44ac('0x9e'),_0x44ac('0x9f'),_0x44ac('0xa0')])),{'transaction':_0xa18006});});});})['then'](function(){return db[_0x44ac('0x3e')][_0x44ac('0xa1')](_0x38b196[_0x44ac('0x62')]['id']);})['then'](respondWithResult(_0x36ffe6,null))[_0x44ac('0x29')](handleError(_0x36ffe6,null));};exports[_0x44ac('0xa2')]=function(_0x30bb64,_0x3ebb80,_0x5e47ba){var _0x3d678c={'raw':!![],'where':{}};var _0x3b99df={};var _0x22d3c7={'count':0x0,'rows':[]};return db['FaxAccount'][_0x44ac('0x66')]({'where':{'id':_0x30bb64[_0x44ac('0x59')]['id']}})[_0x44ac('0x1e')](handleEntityNotFound(_0x3ebb80,null))['then'](function(_0x248efa){if(_0x248efa){_0x3b99df['model']=_[_0x44ac('0x45')](db[_0x44ac('0xa3')][_0x44ac('0x3f')]);_0x3b99df[_0x44ac('0x44')]=_[_0x44ac('0x45')](_0x30bb64['query']);_0x3b99df[_0x44ac('0x4f')]=_[_0x44ac('0x46')](_0x3b99df[_0x44ac('0x43')],_0x3b99df[_0x44ac('0x44')]);_0x3d678c[_0x44ac('0x47')]=_[_0x44ac('0x46')](_0x3b99df['model'],qs['fields'](_0x30bb64[_0x44ac('0x44')][_0x44ac('0x48')]));_0x3d678c['attributes']=_0x3d678c[_0x44ac('0x47')]['length']?_0x3d678c[_0x44ac('0x47')]:_0x3b99df['model'];if(!_0x30bb64[_0x44ac('0x44')][_0x44ac('0x4a')](_0x44ac('0x4b'))){_0x3d678c[_0x44ac('0x2f')]=qs['limit'](_0x30bb64['query']['limit']);_0x3d678c['offset']=qs[_0x44ac('0x2e')](_0x30bb64['query'][_0x44ac('0x2e')]);}_0x3d678c[_0x44ac('0x4c')]=qs[_0x44ac('0x4d')](_0x30bb64['query'][_0x44ac('0x4d')]);_0x3d678c[_0x44ac('0x52')]=qs[_0x44ac('0x4f')](_[_0x44ac('0x4e')](_0x30bb64[_0x44ac('0x44')],_0x3b99df[_0x44ac('0x4f')]));_0x3d678c[_0x44ac('0x52')][_0x44ac('0x6b')]=_0x248efa['id'];if(_0x30bb64[_0x44ac('0x44')][_0x44ac('0x50')]){_0x3d678c[_0x44ac('0x52')]=_[_0x44ac('0x51')](_0x3d678c[_0x44ac('0x52')],{'$or':_[_0x44ac('0x3d')](_0x3d678c[_0x44ac('0x47')],function(_0x3f23b9){var _0x399a41={};_0x399a41[_0x3f23b9]={'$like':'%'+_0x30bb64[_0x44ac('0x44')][_0x44ac('0x50')]+'%'};return _0x399a41;})});}if(_0x30bb64[_0x44ac('0x44')]['$gte']){var _0x5a0112=_0x30bb64['query'][_0x44ac('0xa4')][_0x44ac('0xa5')](',');var _0x4e162d={};_0x4e162d[_0x5a0112[0x0]]={'$gte':moment(_0x5a0112[0x1])[_0x44ac('0xa6')](_0x44ac('0xa7'))};_0x3d678c[_0x44ac('0x52')]=_[_0x44ac('0x51')](_0x3d678c[_0x44ac('0x52')],_0x4e162d);}_0x3d678c=_[_0x44ac('0x51')]({},_0x3d678c,_0x30bb64[_0x44ac('0x54')]);return db[_0x44ac('0xa3')][_0x44ac('0x2d')]({'where':_0x3d678c[_0x44ac('0x52')]})[_0x44ac('0x1e')](function(_0x4ede72){_0x22d3c7[_0x44ac('0x2d')]=_0x4ede72;if(_0x30bb64[_0x44ac('0x44')][_0x44ac('0x55')]){_0x3d678c[_0x44ac('0x5b')]=[{'all':!![]}];}return db[_0x44ac('0xa3')][_0x44ac('0x56')](_0x3d678c);})[_0x44ac('0x1e')](function(_0x3bf732){_0x22d3c7['rows']=_0x3bf732;return _0x22d3c7;});}})[_0x44ac('0x1e')](respondWithFilteredResult(_0x3ebb80,_0x3d678c))[_0x44ac('0x29')](handleError(_0x3ebb80,null));};exports[_0x44ac('0x82')]=function(_0x71902e,_0x28723c,_0x9b3cd5){var _0x30a9ee,_0x2af9ba={},_0x90a496;if(_0x71902e[_0x44ac('0x62')]['to']){_0x90a496=_0x71902e[_0x44ac('0x62')]['to'][0x0];}return db[_0x44ac('0x3e')][_0x44ac('0x5c')]({'where':{'id':_0x71902e['params']['id']},'include':[{'model':db['CmList'],'as':_0x44ac('0xa8'),'include':[{'model':db[_0x44ac('0x72')],'as':_0x44ac('0xa9'),'where':{'fax':_0x90a496},'limit':0x1,'order':[[_0x44ac('0x9e'),_0x44ac('0xaa')]]}]}]})[_0x44ac('0x1e')](handleEntityNotFound(_0x28723c,null))['then'](function(_0x4359b5){_0x30a9ee=_0x4359b5;if(_0x71902e[_0x44ac('0x62')][_0x44ac('0xab')]&&_0x71902e['body']['attachments'][_0x44ac('0x49')]){for(var _0x521de1=0x0;_0x521de1<_0x71902e[_0x44ac('0x62')][_0x44ac('0xab')][_0x44ac('0x49')];_0x521de1+=0x1){_0x71902e[_0x44ac('0x62')]['attachments'][_0x521de1]={'filename':_0x71902e[_0x44ac('0x62')][_0x44ac('0xab')][_0x521de1][_0x44ac('0x3b')],'id':_0x71902e['body']['attachments'][_0x521de1]['id'],'path':path['join'](config[_0x44ac('0xac')],'server/files/attachments',_0x71902e['body'][_0x44ac('0xab')][_0x521de1][_0x44ac('0xad')])};}}return respondWithRpcPromise(_0x44ac('0xae'),'CheckAfterSend',{'FaxAccountId':_[_0x44ac('0xaf')](_0x71902e[_0x44ac('0x59')]['id'])?undefined:_0x71902e[_0x44ac('0x59')]['id'],'path':_[_0x44ac('0xaf')](_0x71902e[_0x44ac('0x62')][_0x44ac('0xab')][0x0]['path'])?undefined:_0x71902e[_0x44ac('0x62')][_0x44ac('0xab')][0x0][_0x44ac('0x6')],'fax':_[_0x44ac('0xaf')](_0x71902e[_0x44ac('0x62')]['to'][0x0])?undefined:_0x71902e[_0x44ac('0x62')]['to'][0x0]},client9002);})[_0x44ac('0x1e')](function(){if(_0x30a9ee){if(_[_0x44ac('0xaf')](_0x71902e[_0x44ac('0x62')][_0x44ac('0xb0')])){_0x71902e['body'][_0x44ac('0xb0')]=util[_0x44ac('0xa6')]('\x22%s\x22\x20<%s>',_0x30a9ee[_0x44ac('0x3b')],_0x30a9ee[_0x44ac('0xb1')]);}if(_0x30a9ee['List']){if(_0x30a9ee[_0x44ac('0xa8')][_0x44ac('0xa9')][_0x44ac('0x49')]){return _0x30a9ee[_0x44ac('0xa8')][_0x44ac('0xa9')][0x0];}else{return db[_0x44ac('0x72')][_0x44ac('0x5d')](_[_0x44ac('0x18')](_0x71902e[_0x44ac('0x62')],{'firstName':_0x71902e['body']['to'][0x0],'phone':_0x71902e[_0x44ac('0x62')]['to'][0x0],'fax':_0x71902e[_0x44ac('0x62')]['to'][0x0],'ListId':_0x30a9ee[_0x44ac('0xa0')]}));}}else{throw new Error(_0x44ac('0xb2'));}}else{throw new Error(_0x44ac('0xb3'));}})[_0x44ac('0x1e')](function(_0x37f488){if(_0x37f488){return db[_0x44ac('0x70')][_0x44ac('0x5c')]({'where':{'ContactId':_0x37f488['id'],'closed':![],'FaxAccountId':_0x30a9ee['id']}})['then'](function(_0x3658df){if(_0x3658df){return[_0x3658df,![]];}return db['FaxInteraction']['create']({'UserId':_0x71902e[_0x44ac('0x5e')]['id'],'ContactId':_0x37f488['id'],'FaxAccountId':_0x30a9ee['id'],'fax':_0x71902e[_0x44ac('0x62')]['to'][0x0],'firstMsgDirection':_0x44ac('0xb4'),'Messages':[_[_0x44ac('0x51')](_0x71902e['body'],{'read':![],'body':_0x71902e[_0x44ac('0x62')][_0x44ac('0xab')][0x0][_0x44ac('0xb5')],'FaxAccountId':_0x30a9ee['id'],'UserId':_0x71902e['user']['id'],'ContactId':_0x37f488['id'],'AttachmentId':_0x71902e[_0x44ac('0x62')][_0x44ac('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x44ac('0xa3')],'as':_0x44ac('0xb6')}]})['then'](function(_0x1a1df4){return[_0x1a1df4,!![]];});});}else{throw new Error(_0x44ac('0xb7'));}})[_0x44ac('0xb8')](function(_0x3fef08,_0x1cdb03){if(_0x1cdb03){return _0x3fef08;}return db[_0x44ac('0xa3')][_0x44ac('0x5d')]({'direction':_0x44ac('0xb4'),'read':![],'body':_0x71902e[_0x44ac('0x62')]['attachments'][0x0][_0x44ac('0xb5')],'FaxAccountId':_0x30a9ee['id'],'FaxInteractionId':_0x3fef08['id'],'UserId':_0x71902e[_0x44ac('0x5e')]['id'],'ContactId':_0x3fef08['ContactId'],'AttachmentId':_0x71902e[_0x44ac('0x62')][_0x44ac('0xab')][0x0]['id']})[_0x44ac('0x1e')](function(_0x33e4e0){_0x3fef08[_0x44ac('0xb9')][_0x44ac('0xb6')]=[];_0x3fef08[_0x44ac('0xb9')]['Messages'][_0x44ac('0x8b')](_0x33e4e0[_0x44ac('0xb9')]);return _0x3fef08;});})[_0x44ac('0x1e')](function(_0x5711f0){respondWithRpcPromise(_0x44ac('0xba'),'SendFax',{'FaxAccountId':_[_0x44ac('0xaf')](_0x71902e[_0x44ac('0x59')]['id'])?undefined:_0x71902e[_0x44ac('0x59')]['id'],'path':_[_0x44ac('0xaf')](_0x71902e[_0x44ac('0x62')]['attachments'][0x0][_0x44ac('0x6')])?undefined:_0x71902e['body'][_0x44ac('0xab')][0x0][_0x44ac('0x6')],'fax':_[_0x44ac('0xaf')](_0x71902e[_0x44ac('0x62')]['to'][0x0])?undefined:_0x71902e['body']['to'][0x0],'AttachmentId':_0x71902e['body']['attachments'][0x0]['id']},client9002)['then'](function(_0x4bfe48){logger[_0x44ac('0x1f')](_0x44ac('0xbb'),_0x4bfe48);})[_0x44ac('0x29')](function(_0x5c6646){logger[_0x44ac('0x1f')]('SendFaxRpc,\x20%s',_0x5c6646);});return _0x5711f0;})['then'](respondWithResult(_0x28723c,null))['catch'](handleError(_0x28723c,null));};exports['addAgents']=function(_0x439e10,_0x364683,_0x49c1ee){return db[_0x44ac('0x3e')][_0x44ac('0x5c')]({'where':{'id':_0x439e10['params']['id']}})[_0x44ac('0x1e')](handleEntityNotFound(_0x364683,null))[_0x44ac('0x1e')](function(_0x296614){if(_0x296614){return _0x296614['addAgents'](_0x439e10[_0x44ac('0x62')][_0x44ac('0x69')],_['omit'](_0x439e10['body'],['ids','id'])||{})[_0x44ac('0xb8')](function(_0x27ebc9){for(var _0x413c2a=0x0;_0x413c2a<_0x439e10[_0x44ac('0x62')][_0x44ac('0x69')][_0x44ac('0x49')];_0x413c2a+=0x1){socket[_0x44ac('0xbc')]('userFaxAccount:save',{'UserId':Number(_0x439e10[_0x44ac('0x62')]['ids'][_0x413c2a]),'FaxAccountId':Number(_0x439e10[_0x44ac('0x59')]['id'])});}return _0x27ebc9;});}})[_0x44ac('0x1e')](respondWithResult(_0x364683,null))['catch'](handleError(_0x364683,null));};exports['removeAgents']=function(_0x4070bb,_0x4cd2f7,_0xcc6fa1){return db[_0x44ac('0x3e')][_0x44ac('0x5c')]({'where':{'id':_0x4070bb['params']['id']}})[_0x44ac('0x1e')](handleEntityNotFound(_0x4cd2f7,null))[_0x44ac('0x1e')](function(_0x32c101){if(_0x32c101){return _0x32c101[_0x44ac('0xbd')](_0x4070bb[_0x44ac('0x44')][_0x44ac('0x69')])[_0x44ac('0x1e')](function(){if(_[_0x44ac('0xbe')](_0x4070bb[_0x44ac('0x44')][_0x44ac('0x69')])){for(var _0x9df68d=0x0;_0x9df68d<_0x4070bb[_0x44ac('0x44')][_0x44ac('0x69')]['length'];_0x9df68d+=0x1){socket['emit'](_0x44ac('0xbf'),{'UserId':Number(_0x4070bb[_0x44ac('0x44')][_0x44ac('0x69')][_0x9df68d]),'FaxAccountId':Number(_0x4070bb[_0x44ac('0x59')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x4070bb[_0x44ac('0x44')]['ids']),'FaxAccountId':Number(_0x4070bb[_0x44ac('0x59')]['id'])});}});}})[_0x44ac('0x1e')](respondWithStatusCode(_0x4cd2f7,null))[_0x44ac('0x29')](handleError(_0x4cd2f7,null));};exports[_0x44ac('0xc0')]=function(_0xe924e5,_0x46eca6,_0x22e392){var _0x55be8a={};var _0x2bc3ec={};var _0x1be83e;var _0x4e4616;return db[_0x44ac('0x3e')][_0x44ac('0x66')]({'where':{'id':_0xe924e5[_0x44ac('0x59')]['id']}})['then'](handleEntityNotFound(_0x46eca6,null))[_0x44ac('0x1e')](function(_0x3e6ce3){if(_0x3e6ce3){_0x1be83e=_0x3e6ce3;_0x2bc3ec[_0x44ac('0x43')]=_[_0x44ac('0x45')](db[_0x44ac('0x74')]['rawAttributes']);_0x2bc3ec[_0x44ac('0x44')]=_[_0x44ac('0x45')](_0xe924e5[_0x44ac('0x44')]);_0x2bc3ec['filters']=_['intersection'](_0x2bc3ec['model'],_0x2bc3ec[_0x44ac('0x44')]);_0x55be8a[_0x44ac('0x47')]=_[_0x44ac('0x46')](_0x2bc3ec[_0x44ac('0x43')],qs['fields'](_0xe924e5[_0x44ac('0x44')]['fields']));_0x55be8a['attributes']=_0x55be8a['attributes'][_0x44ac('0x49')]?_0x55be8a[_0x44ac('0x47')]:_0x2bc3ec[_0x44ac('0x43')];_0x55be8a[_0x44ac('0x4c')]=qs[_0x44ac('0x4d')](_0xe924e5[_0x44ac('0x44')][_0x44ac('0x4d')]);_0x55be8a['where']=qs[_0x44ac('0x4f')](_['pick'](_0xe924e5[_0x44ac('0x44')],_0x2bc3ec[_0x44ac('0x4f')]));if(_0xe924e5[_0x44ac('0x44')][_0x44ac('0x50')]){_0x55be8a[_0x44ac('0x52')]=_[_0x44ac('0x51')](_0x55be8a[_0x44ac('0x52')],{'$or':_[_0x44ac('0x3d')](_0x55be8a[_0x44ac('0x47')],function(_0x14f3c5){var _0x2bea44={};_0x2bea44[_0x14f3c5]={'$like':'%'+_0xe924e5['query'][_0x44ac('0x50')]+'%'};return _0x2bea44;})});}_0x55be8a=_[_0x44ac('0x51')]({},_0x55be8a,_0xe924e5[_0x44ac('0x54')]);return _0x1be83e[_0x44ac('0xc0')](_0x55be8a);}})[_0x44ac('0x1e')](function(_0x4af8c5){if(_0x4af8c5){_0x4e4616=_0x4af8c5[_0x44ac('0x49')];if(!_0xe924e5[_0x44ac('0x44')][_0x44ac('0x4a')](_0x44ac('0x4b'))){_0x55be8a[_0x44ac('0x2f')]=qs[_0x44ac('0x2f')](_0xe924e5[_0x44ac('0x44')][_0x44ac('0x2f')]);_0x55be8a[_0x44ac('0x2e')]=qs[_0x44ac('0x2e')](_0xe924e5[_0x44ac('0x44')]['offset']);}return _0x1be83e['getAgents'](_0x55be8a);}})[_0x44ac('0x1e')](function(_0x27cd5e){if(_0x27cd5e){return _0x27cd5e?{'count':_0x4e4616,'rows':_0x27cd5e}:null;}})[_0x44ac('0x1e')](respondWithResult(_0x46eca6,null))[_0x44ac('0x29')](handleError(_0x46eca6,null));}; \ No newline at end of file +var _0x3f17=['socket.io-emitter','./faxAccount.socket','client','http','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','destroy','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','params','options','find','catch','create','user','role','FaxAccounts','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','pick','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','FaxApplication','findAndCountAll','priority','stack','finally','getApplications','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','modem','push','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','addAccountApplications','updateAccountApplications','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost'];(function(_0x209fd5,_0x2035a8){var _0x1f8f75=function(_0x5a0f92){while(--_0x5a0f92){_0x209fd5['push'](_0x209fd5['shift']());}};_0x1f8f75(++_0x2035a8);}(_0x3f17,0x16d));var _0x73f1=function(_0x3e5360,_0x3120c6){_0x3e5360=_0x3e5360-0x0;var _0x533404=_0x3f17[_0x3e5360];return _0x533404;};'use strict';var emlformat=require(_0x73f1('0x0'));var rimraf=require(_0x73f1('0x1'));var zipdir=require(_0x73f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x73f1('0x3'));var BPromise=require(_0x73f1('0x4'));var Mustache=require('mustache');var util=require(_0x73f1('0x5'));var path=require(_0x73f1('0x6'));var sox=require('sox');var csv=require(_0x73f1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73f1('0x8'));var _=require(_0x73f1('0x9'));var squel=require(_0x73f1('0xa'));var crypto=require(_0x73f1('0xb'));var jsforce=require(_0x73f1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x73f1('0x7'));var querystring=require(_0x73f1('0xd'));var Papa=require(_0x73f1('0xe'));var Redis=require(_0x73f1('0xf'));var authService=require(_0x73f1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x73f1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x73f1('0x12'))('api');var utils=require(_0x73f1('0x13'));var config=require(_0x73f1('0x14'));var licenseUtil=require(_0x73f1('0x15'));var db=require(_0x73f1('0x16'))['db'];config[_0x73f1('0x17')]=_['defaults'](config[_0x73f1('0x17')],{'host':_0x73f1('0x18'),'port':0x18eb});var socket=require(_0x73f1('0x19'))(new Redis(config['redis']));require(_0x73f1('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x73f1('0x1b')][_0x73f1('0x1c')]({'port':0x232c});var client9002=jayson[_0x73f1('0x1b')][_0x73f1('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xcb8cb0,_0x1f262c,_0x25cc5a,_0x5f4168){return new BPromise(function(_0x23a988,_0x16498c){var _0x598b09=_0x5f4168||client;return _0x598b09['request'](_0xcb8cb0,_0x25cc5a)['then'](function(_0x16bd9c){logger[_0x73f1('0x1d')](_0x73f1('0x1e'),_0x1f262c,'request\x20sent');logger[_0x73f1('0x1f')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1f262c,_0x73f1('0x20'),JSON[_0x73f1('0x21')](_0x16bd9c));if(_0x16bd9c['error']){if(_0x16bd9c['error'][_0x73f1('0x22')]===0x1f4){logger['error'](_0x73f1('0x1e'),_0x1f262c,_0x16bd9c[_0x73f1('0x23')]['message']);return _0x16498c(_0x16bd9c[_0x73f1('0x23')]['message']);}logger[_0x73f1('0x23')]('FaxAccount,\x20%s,\x20%s',_0x1f262c,_0x16bd9c['error'][_0x73f1('0x24')]);return _0x23a988(_0x16bd9c['error'][_0x73f1('0x24')]);}else{logger[_0x73f1('0x1d')](_0x73f1('0x1e'),_0x1f262c,_0x73f1('0x20'));_0x23a988(_0x16bd9c[_0x73f1('0x25')][_0x73f1('0x24')]);}})['catch'](function(_0x24421d){logger['error'](_0x73f1('0x1e'),_0x1f262c,_0x24421d);_0x16498c(_0x24421d);});});}function respondWithStatusCode(_0x48923a,_0x1aa3ff){_0x1aa3ff=_0x1aa3ff||0xcc;return function(_0x3aa243){if(_0x3aa243){return _0x48923a[_0x73f1('0x26')](_0x1aa3ff);}return _0x48923a[_0x73f1('0x27')](_0x1aa3ff)[_0x73f1('0x28')]();};}function respondWithResult(_0x119f1f,_0x164e70){_0x164e70=_0x164e70||0xc8;return function(_0x59b78c){if(_0x59b78c){return _0x119f1f['status'](_0x164e70)[_0x73f1('0x29')](_0x59b78c);}};}function respondWithFilteredResult(_0x28e702,_0x192d2a){return function(_0x195804){if(_0x195804){var _0x374647=typeof _0x192d2a[_0x73f1('0x2a')]===_0x73f1('0x2b')&&typeof _0x192d2a[_0x73f1('0x2c')]===_0x73f1('0x2b');var _0x5a9c68=_0x195804[_0x73f1('0x2d')];var _0x3bbcbc=_0x374647?0x0:_0x192d2a[_0x73f1('0x2a')];var _0x19f002=_0x374647?_0x195804[_0x73f1('0x2d')]:_0x192d2a[_0x73f1('0x2a')]+_0x192d2a[_0x73f1('0x2c')];var _0x215590;if(_0x19f002>=_0x5a9c68){_0x19f002=_0x5a9c68;_0x215590=0xc8;}else{_0x215590=0xce;}_0x28e702[_0x73f1('0x27')](_0x215590);return _0x28e702[_0x73f1('0x2e')](_0x73f1('0x2f'),_0x3bbcbc+'-'+_0x19f002+'/'+_0x5a9c68)[_0x73f1('0x29')](_0x195804);}return null;};}function patchUpdates(_0x49e136){return function(_0x484299){try{jsonpatch[_0x73f1('0x30')](_0x484299,_0x49e136,!![]);}catch(_0x3c0e06){return BPromise['reject'](_0x3c0e06);}return _0x484299[_0x73f1('0x31')]();};}function saveUpdates(_0x34c479,_0x5c5fa6){return function(_0x3e65bc){if(_0x3e65bc){return _0x3e65bc[_0x73f1('0x32')](_0x34c479)[_0x73f1('0x33')](function(_0x4a2579){return _0x4a2579;});}return null;};}function removeEntity(_0x52ab19,_0x35c4da){return function(_0x26cdcc){if(_0x26cdcc){return _0x26cdcc['destroy']()[_0x73f1('0x33')](function(){var _0x866fd8=_0x26cdcc[_0x73f1('0x34')]({'plain':!![]});var _0x271a3='FaxAccounts';return db['UserProfileResource'][_0x73f1('0x35')]({'where':{'type':_0x271a3,'resourceId':_0x866fd8['id']}})[_0x73f1('0x33')](function(){return _0x26cdcc;});})['then'](function(){_0x52ab19[_0x73f1('0x27')](0xcc)[_0x73f1('0x28')]();});}};}function handleEntityNotFound(_0x3e1388,_0x1cf55b){return function(_0x26a661){if(!_0x26a661){_0x3e1388[_0x73f1('0x26')](0x194);}return _0x26a661;};}function handleError(_0x318700,_0x38fa97){_0x38fa97=_0x38fa97||0x1f4;return function(_0x5974d8){logger[_0x73f1('0x23')](_0x5974d8['stack']);if(_0x5974d8[_0x73f1('0x36')]){delete _0x5974d8[_0x73f1('0x36')];}_0x318700[_0x73f1('0x27')](_0x38fa97)[_0x73f1('0x37')](_0x5974d8);};}exports[_0x73f1('0x38')]=function(_0x38bfb2,_0x54035c){var _0x596c56={'include':[{'model':db[_0x73f1('0x39')],'as':_0x73f1('0x3a')}]},_0x4d1ab1={},_0x3c386b={'count':0x0,'rows':[]};var _0x12430a=_['map'](db[_0x73f1('0x3b')][_0x73f1('0x3c')],function(_0x4a8bff){return{'name':_0x4a8bff[_0x73f1('0x3d')],'type':_0x4a8bff[_0x73f1('0x3e')]['key']};});_0x4d1ab1[_0x73f1('0x3f')]=_[_0x73f1('0x40')](_0x12430a,'name');_0x4d1ab1[_0x73f1('0x41')]=_[_0x73f1('0x42')](_0x38bfb2[_0x73f1('0x41')]);_0x4d1ab1[_0x73f1('0x43')]=_['intersection'](_0x4d1ab1[_0x73f1('0x3f')],_0x4d1ab1['query']);_0x596c56[_0x73f1('0x44')]=_[_0x73f1('0x45')](_0x4d1ab1[_0x73f1('0x3f')],qs[_0x73f1('0x46')](_0x38bfb2[_0x73f1('0x41')][_0x73f1('0x46')]));_0x596c56[_0x73f1('0x44')]=_0x596c56['attributes'][_0x73f1('0x47')]?_0x596c56[_0x73f1('0x44')]:_0x4d1ab1[_0x73f1('0x3f')];if(!_0x38bfb2[_0x73f1('0x41')][_0x73f1('0x48')](_0x73f1('0x49'))){_0x596c56[_0x73f1('0x2c')]=qs[_0x73f1('0x2c')](_0x38bfb2[_0x73f1('0x41')][_0x73f1('0x2c')]);_0x596c56[_0x73f1('0x2a')]=qs['offset'](_0x38bfb2[_0x73f1('0x41')][_0x73f1('0x2a')]);}_0x596c56['order']=qs[_0x73f1('0x4a')](_0x38bfb2[_0x73f1('0x41')]['sort']);_0x596c56[_0x73f1('0x4b')]=qs[_0x73f1('0x43')](_['pick'](_0x38bfb2[_0x73f1('0x41')],_0x4d1ab1['filters']),_0x12430a);if(_0x38bfb2[_0x73f1('0x41')]['filter']){_0x596c56['where']=_['merge'](_0x596c56['where'],{'$or':_[_0x73f1('0x40')](_0x12430a,function(_0x126f76){if(_0x126f76[_0x73f1('0x3e')]!==_0x73f1('0x4c')){var _0x1d34cb={};_0x1d34cb[_0x126f76[_0x73f1('0x36')]]={'$like':'%'+_0x38bfb2[_0x73f1('0x41')][_0x73f1('0x4d')]+'%'};return _0x1d34cb;}})});}_0x596c56=_[_0x73f1('0x4e')]({},_0x596c56,_0x38bfb2['options']);var _0x3b34c7={'where':_0x596c56[_0x73f1('0x4b')]};return db[_0x73f1('0x3b')]['count'](_0x3b34c7)[_0x73f1('0x33')](function(_0x294ff5){_0x3c386b[_0x73f1('0x2d')]=_0x294ff5;if(_0x38bfb2[_0x73f1('0x41')][_0x73f1('0x4f')]){_0x596c56[_0x73f1('0x50')]=[{'all':!![]}];}return db['FaxAccount'][_0x73f1('0x51')](_0x596c56);})['then'](function(_0x5369c0){_0x3c386b[_0x73f1('0x52')]=_0x5369c0;return _0x3c386b;})[_0x73f1('0x33')](respondWithFilteredResult(_0x54035c,_0x596c56))['catch'](handleError(_0x54035c,null));};exports['show']=function(_0x151ec5,_0x120e38){var _0x36ccb4={'raw':![],'where':{'id':_0x151ec5[_0x73f1('0x53')]['id']},'include':[{'model':db[_0x73f1('0x39')],'as':_0x73f1('0x3a')}]},_0x2b532a={};_0x2b532a[_0x73f1('0x3f')]=_[_0x73f1('0x42')](db[_0x73f1('0x3b')][_0x73f1('0x3c')]);_0x2b532a[_0x73f1('0x41')]=_[_0x73f1('0x42')](_0x151ec5[_0x73f1('0x41')]);_0x2b532a[_0x73f1('0x43')]=_[_0x73f1('0x45')](_0x2b532a['model'],_0x2b532a[_0x73f1('0x41')]);_0x36ccb4[_0x73f1('0x44')]=_[_0x73f1('0x45')](_0x2b532a[_0x73f1('0x3f')],qs['fields'](_0x151ec5[_0x73f1('0x41')][_0x73f1('0x46')]));_0x36ccb4[_0x73f1('0x44')]=_0x36ccb4['attributes'][_0x73f1('0x47')]?_0x36ccb4[_0x73f1('0x44')]:_0x2b532a[_0x73f1('0x3f')];if(_0x151ec5[_0x73f1('0x41')][_0x73f1('0x4f')]){_0x36ccb4['include']=[{'all':!![]}];}_0x36ccb4=_[_0x73f1('0x4e')]({},_0x36ccb4,_0x151ec5[_0x73f1('0x54')]);return db[_0x73f1('0x3b')][_0x73f1('0x55')](_0x36ccb4)[_0x73f1('0x33')](handleEntityNotFound(_0x120e38,null))[_0x73f1('0x33')](respondWithResult(_0x120e38,null))[_0x73f1('0x56')](handleError(_0x120e38,null));};exports[_0x73f1('0x57')]=function(_0x42806f,_0x4643a6){return db['FaxAccount'][_0x73f1('0x57')](_0x42806f['body'],{})['then'](function(_0x4260f5){var _0xf222a=_0x42806f[_0x73f1('0x58')][_0x73f1('0x34')]({'plain':!![]});if(!_0xf222a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf222a[_0x73f1('0x59')]==='user'){var _0x3b9bcd=_0x4260f5[_0x73f1('0x34')]({'plain':!![]});var _0x5bc86a=_0x73f1('0x5a');return db['UserProfileSection'][_0x73f1('0x55')]({'where':{'name':_0x5bc86a,'userProfileId':_0xf222a['userProfileId']},'raw':!![]})[_0x73f1('0x33')](function(_0xfae656){if(_0xfae656&&_0xfae656[_0x73f1('0x5b')]===0x0){return db[_0x73f1('0x5c')][_0x73f1('0x57')]({'name':_0x3b9bcd['name'],'resourceId':_0x3b9bcd['id'],'type':_0xfae656['name'],'sectionId':_0xfae656['id']},{})[_0x73f1('0x33')](function(){return _0x4260f5;});}else{return _0x4260f5;}})[_0x73f1('0x56')](function(_0x569633){logger[_0x73f1('0x23')](_0x73f1('0x5d'),_0x569633);throw _0x569633;});}return _0x4260f5;})['then'](respondWithResult(_0x4643a6,0xc9))[_0x73f1('0x56')](handleError(_0x4643a6,null));};exports['update']=function(_0x50961c,_0x2d8b2a){if(_0x50961c['body']['id']){delete _0x50961c[_0x73f1('0x5e')]['id'];}return db[_0x73f1('0x3b')][_0x73f1('0x55')]({'where':{'id':_0x50961c[_0x73f1('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x73f1('0x3a')}]})[_0x73f1('0x33')](handleEntityNotFound(_0x2d8b2a,null))[_0x73f1('0x33')](saveUpdates(_0x50961c[_0x73f1('0x5e')],null))[_0x73f1('0x33')](respondWithResult(_0x2d8b2a,null))['catch'](handleError(_0x2d8b2a,null));};exports[_0x73f1('0x35')]=function(_0x1201af,_0x34bacc){return db[_0x73f1('0x3b')]['find']({'where':{'id':_0x1201af[_0x73f1('0x53')]['id']}})[_0x73f1('0x33')](handleEntityNotFound(_0x34bacc,null))[_0x73f1('0x33')](removeEntity(_0x34bacc,null))[_0x73f1('0x56')](handleError(_0x34bacc,null));};exports[_0x73f1('0x5f')]=function(_0x9a0299,_0x41a5bc){return db[_0x73f1('0x3b')][_0x73f1('0x5f')]()[_0x73f1('0x33')](respondWithResult(_0x41a5bc,null))[_0x73f1('0x56')](handleError(_0x41a5bc,null));};exports[_0x73f1('0x60')]=function(_0x3d8650,_0x54a673,_0x52be24){if(_0x3d8650[_0x73f1('0x5e')]['id']){delete _0x3d8650['body']['id'];}return db[_0x73f1('0x3b')][_0x73f1('0x55')]({'where':{'id':_0x3d8650['params']['id']}})[_0x73f1('0x33')](handleEntityNotFound(_0x54a673,null))[_0x73f1('0x33')](function(_0x342bd7){if(_0x342bd7){_0x3d8650[_0x73f1('0x5e')]['FaxAccountId']=_0x342bd7['id'];return db[_0x73f1('0x61')]['create'](_0x3d8650['body']);}})[_0x73f1('0x33')](respondWithResult(_0x54a673,null))[_0x73f1('0x56')](handleError(_0x54a673,null));};exports[_0x73f1('0x62')]=function(_0x5c86ce,_0x2e2d26,_0x2280f6){var _0x3e0b7e={'raw':![],'where':{}};var _0x242680={};var _0x1d8763={'count':0x0,'rows':[]};return db['FaxAccount'][_0x73f1('0x63')]({'where':{'id':_0x5c86ce[_0x73f1('0x53')]['id']}})[_0x73f1('0x33')](handleEntityNotFound(_0x2e2d26,null))[_0x73f1('0x33')](function(_0x2dd378){if(_0x2dd378){_0x242680['model']=_[_0x73f1('0x42')](db[_0x73f1('0x61')][_0x73f1('0x3c')]);_0x242680[_0x73f1('0x41')]=_[_0x73f1('0x42')](_0x5c86ce[_0x73f1('0x41')]);_0x242680['filters']=_['intersection'](_0x242680[_0x73f1('0x3f')],_0x242680[_0x73f1('0x41')]);_0x3e0b7e[_0x73f1('0x44')]=_[_0x73f1('0x45')](_0x242680[_0x73f1('0x3f')],qs[_0x73f1('0x46')](_0x5c86ce['query'][_0x73f1('0x46')]));_0x3e0b7e[_0x73f1('0x44')]=_0x3e0b7e[_0x73f1('0x44')][_0x73f1('0x47')]?_0x3e0b7e['attributes']:_0x242680[_0x73f1('0x3f')];if(!_0x5c86ce['query']['hasOwnProperty'](_0x73f1('0x49'))){_0x3e0b7e[_0x73f1('0x2c')]=qs[_0x73f1('0x2c')](_0x5c86ce[_0x73f1('0x41')][_0x73f1('0x2c')]);_0x3e0b7e[_0x73f1('0x2a')]=qs['offset'](_0x5c86ce[_0x73f1('0x41')][_0x73f1('0x2a')]);}_0x3e0b7e['order']=qs[_0x73f1('0x4a')](_0x5c86ce['query'][_0x73f1('0x4a')]);_0x3e0b7e[_0x73f1('0x4b')]=qs['filters'](_['pick'](_0x5c86ce[_0x73f1('0x41')],_0x242680[_0x73f1('0x43')]));_0x3e0b7e[_0x73f1('0x4b')][_0x73f1('0x64')]=_0x2dd378['id'];if(_0x5c86ce[_0x73f1('0x41')]['filter']){_0x3e0b7e[_0x73f1('0x4b')]=_['merge'](_0x3e0b7e['where'],{'$or':_[_0x73f1('0x40')](_0x3e0b7e[_0x73f1('0x44')],function(_0x5772fa){var _0x265aa8={};_0x265aa8[_0x5772fa]={'$like':'%'+_0x5c86ce[_0x73f1('0x41')][_0x73f1('0x4d')]+'%'};return _0x265aa8;})});}_0x3e0b7e=_['merge']({},_0x3e0b7e,_0x5c86ce['options']);return db[_0x73f1('0x61')][_0x73f1('0x2d')]({'where':_0x3e0b7e[_0x73f1('0x4b')]})[_0x73f1('0x33')](function(_0x76e007){_0x1d8763['count']=_0x76e007;if(_0x5c86ce[_0x73f1('0x41')][_0x73f1('0x4f')]){_0x3e0b7e[_0x73f1('0x50')]=[{'all':!![]}];}return db[_0x73f1('0x61')][_0x73f1('0x51')](_0x3e0b7e);})[_0x73f1('0x33')](function(_0x824b06){_0x1d8763['rows']=_0x824b06;return _0x1d8763;});}})[_0x73f1('0x33')](respondWithFilteredResult(_0x2e2d26,_0x3e0b7e))[_0x73f1('0x56')](handleError(_0x2e2d26,null));};exports[_0x73f1('0x65')]=function(_0x388968,_0x4a48bb,_0x4c224c){return db['FaxAccount']['find']({'where':{'id':_0x388968[_0x73f1('0x53')]['id']}})[_0x73f1('0x33')](handleEntityNotFound(_0x4a48bb,null))[_0x73f1('0x33')](function(_0x539053){if(_0x539053){return _0x539053[_0x73f1('0x65')](_0x388968[_0x73f1('0x41')][_0x73f1('0x66')]);}})[_0x73f1('0x33')](respondWithStatusCode(_0x4a48bb,null))[_0x73f1('0x56')](handleError(_0x4a48bb,null));};exports[_0x73f1('0x67')]=function(_0x3f4a1,_0x37a03e,_0x3f5cb2){if(_0x3f4a1[_0x73f1('0x5e')]['id']){delete _0x3f4a1['body']['id'];}return db['FaxAccount'][_0x73f1('0x55')]({'where':{'id':_0x3f4a1[_0x73f1('0x53')]['id']}})['then'](handleEntityNotFound(_0x37a03e,null))[_0x73f1('0x33')](function(_0x14c61e){if(_0x14c61e){_0x3f4a1[_0x73f1('0x5e')][_0x73f1('0x64')]=_0x14c61e['id'];return db[_0x73f1('0x68')]['create'](_0x3f4a1[_0x73f1('0x5e')]);}})[_0x73f1('0x33')](respondWithResult(_0x37a03e,null))['catch'](handleError(_0x37a03e,null));};exports[_0x73f1('0x69')]=function(_0x34811f,_0x57b8dd,_0x1f8bfb){var _0x26a104={'raw':![],'where':{}};var _0x6908cb={};var _0x314677={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x34811f[_0x73f1('0x53')]['id']}})[_0x73f1('0x33')](handleEntityNotFound(_0x57b8dd,null))[_0x73f1('0x33')](function(_0x1c7cfc){if(_0x1c7cfc){_0x6908cb[_0x73f1('0x3f')]=_[_0x73f1('0x42')](db['CannedAnswer'][_0x73f1('0x3c')]);_0x6908cb[_0x73f1('0x41')]=_[_0x73f1('0x42')](_0x34811f['query']);_0x6908cb['filters']=_[_0x73f1('0x45')](_0x6908cb[_0x73f1('0x3f')],_0x6908cb['query']);_0x26a104[_0x73f1('0x44')]=_[_0x73f1('0x45')](_0x6908cb[_0x73f1('0x3f')],qs[_0x73f1('0x46')](_0x34811f[_0x73f1('0x41')][_0x73f1('0x46')]));_0x26a104[_0x73f1('0x44')]=_0x26a104[_0x73f1('0x44')][_0x73f1('0x47')]?_0x26a104[_0x73f1('0x44')]:_0x6908cb[_0x73f1('0x3f')];if(!_0x34811f['query'][_0x73f1('0x48')](_0x73f1('0x49'))){_0x26a104[_0x73f1('0x2c')]=qs['limit'](_0x34811f['query']['limit']);_0x26a104[_0x73f1('0x2a')]=qs[_0x73f1('0x2a')](_0x34811f[_0x73f1('0x41')][_0x73f1('0x2a')]);}_0x26a104[_0x73f1('0x6a')]=qs['sort'](_0x34811f[_0x73f1('0x41')][_0x73f1('0x4a')]);_0x26a104[_0x73f1('0x4b')]=qs[_0x73f1('0x43')](_[_0x73f1('0x6b')](_0x34811f['query'],_0x6908cb[_0x73f1('0x43')]));_0x26a104[_0x73f1('0x4b')][_0x73f1('0x64')]=_0x1c7cfc['id'];if(_0x34811f[_0x73f1('0x41')][_0x73f1('0x4d')]){_0x26a104[_0x73f1('0x4b')]=_['merge'](_0x26a104['where'],{'$or':_['map'](_0x26a104[_0x73f1('0x44')],function(_0x21ffce){var _0x1136f0={};_0x1136f0[_0x21ffce]={'$like':'%'+_0x34811f[_0x73f1('0x41')][_0x73f1('0x4d')]+'%'};return _0x1136f0;})});}_0x26a104=_['merge']({},_0x26a104,_0x34811f[_0x73f1('0x54')]);return db[_0x73f1('0x68')][_0x73f1('0x2d')]({'where':_0x26a104[_0x73f1('0x4b')]})[_0x73f1('0x33')](function(_0x34271f){_0x314677[_0x73f1('0x2d')]=_0x34271f;if(_0x34811f['query'][_0x73f1('0x4f')]){_0x26a104[_0x73f1('0x50')]=[{'all':!![]}];}return db[_0x73f1('0x68')]['findAll'](_0x26a104);})[_0x73f1('0x33')](function(_0x35b007){_0x314677[_0x73f1('0x52')]=_0x35b007;return _0x314677;});}})[_0x73f1('0x33')](respondWithFilteredResult(_0x57b8dd,_0x26a104))['catch'](handleError(_0x57b8dd,null));};exports[_0x73f1('0x6c')]=function(_0x5b3835,_0x5202c7,_0x33b18a){return db[_0x73f1('0x3b')][_0x73f1('0x55')]({'where':{'id':_0x5b3835[_0x73f1('0x53')]['id']}})[_0x73f1('0x33')](handleEntityNotFound(_0x5202c7,null))[_0x73f1('0x33')](function(_0x54afb9){if(_0x54afb9){return _0x54afb9[_0x73f1('0x6c')](_0x5b3835[_0x73f1('0x41')]['ids']);}})[_0x73f1('0x33')](respondWithStatusCode(_0x5202c7,null))['catch'](handleError(_0x5202c7,null));};exports[_0x73f1('0x6d')]=function(_0x5c17d6,_0x5bcbb3,_0x3e2df4){return db['FaxInteraction'][_0x73f1('0x55')]({'where':{'id':_0x5c17d6[_0x73f1('0x53')]['id']}})[_0x73f1('0x33')](handleEntityNotFound(_0x5bcbb3,null))[_0x73f1('0x33')](function(_0x3183eb){if(_0x3183eb){return _0x3183eb['addInteraction'](_0x5c17d6['body'][_0x73f1('0x66')],_[_0x73f1('0x6e')](_0x5c17d6[_0x73f1('0x5e')],['ids','id'])||{});}})[_0x73f1('0x33')](respondWithResult(_0x5bcbb3,null))[_0x73f1('0x56')](handleError(_0x5bcbb3,null));};exports[_0x73f1('0x6f')]=function(_0x4a4f2d,_0x20238f,_0x5dd774){var _0x4029cd={'raw':![],'where':{}};var _0x362c35={};var _0x15acfa={'count':0x0,'rows':[]};return db[_0x73f1('0x3b')][_0x73f1('0x63')]({'where':{'id':_0x4a4f2d[_0x73f1('0x53')]['id']}})[_0x73f1('0x33')](handleEntityNotFound(_0x20238f,null))['then'](function(_0x1b0b1d){if(_0x1b0b1d){_0x362c35[_0x73f1('0x3f')]=_[_0x73f1('0x42')](db[_0x73f1('0x70')][_0x73f1('0x3c')]);_0x362c35['query']=_[_0x73f1('0x42')](_0x4a4f2d[_0x73f1('0x41')]);_0x362c35[_0x73f1('0x43')]=_[_0x73f1('0x45')](_0x362c35[_0x73f1('0x3f')],_0x362c35[_0x73f1('0x41')]);_0x4029cd[_0x73f1('0x44')]=_[_0x73f1('0x45')](_0x362c35[_0x73f1('0x3f')],qs[_0x73f1('0x46')](_0x4a4f2d[_0x73f1('0x41')][_0x73f1('0x46')]));_0x4029cd[_0x73f1('0x44')]=_0x4029cd[_0x73f1('0x44')]['length']?_0x4029cd['attributes']:_0x362c35[_0x73f1('0x3f')];if(!_0x4a4f2d[_0x73f1('0x41')]['hasOwnProperty'](_0x73f1('0x49'))){_0x4029cd['limit']=qs[_0x73f1('0x2c')](_0x4a4f2d['query']['limit']);_0x4029cd[_0x73f1('0x2a')]=qs[_0x73f1('0x2a')](_0x4a4f2d[_0x73f1('0x41')]['offset']);}_0x4029cd[_0x73f1('0x6a')]=qs[_0x73f1('0x4a')](_0x4a4f2d[_0x73f1('0x41')][_0x73f1('0x4a')]);_0x4029cd['where']=qs[_0x73f1('0x43')](_[_0x73f1('0x6b')](_0x4a4f2d[_0x73f1('0x41')],_0x362c35[_0x73f1('0x43')]));_0x4029cd[_0x73f1('0x4b')][_0x73f1('0x64')]=_0x1b0b1d['id'];if(_0x4a4f2d[_0x73f1('0x41')][_0x73f1('0x4d')]){_0x4029cd[_0x73f1('0x4b')]=_[_0x73f1('0x4e')](_0x4029cd[_0x73f1('0x4b')],{'$or':_[_0x73f1('0x40')](_0x4029cd[_0x73f1('0x44')],function(_0x5a6531){var _0x4e430d={};_0x4e430d[_0x5a6531]={'$like':'%'+_0x4a4f2d[_0x73f1('0x41')][_0x73f1('0x4d')]+'%'};return _0x4e430d;})});}_0x4029cd=_[_0x73f1('0x4e')]({},_0x4029cd,_0x4a4f2d['options']);return db[_0x73f1('0x70')]['count']({'where':_0x4029cd[_0x73f1('0x4b')]})['then'](function(_0x58f092){_0x15acfa[_0x73f1('0x2d')]=_0x58f092;if(_0x4a4f2d[_0x73f1('0x41')][_0x73f1('0x4f')]){_0x4029cd[_0x73f1('0x50')]=[{'model':db[_0x73f1('0x71')],'as':_0x73f1('0x72'),'required':![]},{'model':db[_0x73f1('0x73')],'as':_0x73f1('0x74'),'attributes':[_0x73f1('0x36'),_0x73f1('0x75'),_0x73f1('0x76')],'required':![]},{'model':db[_0x73f1('0x77')],'as':'Tags','attributes':['id',_0x73f1('0x36'),_0x73f1('0x78')],'where':_0x4a4f2d[_0x73f1('0x41')]['tag']?{'id':_0x4a4f2d[_0x73f1('0x41')]['tag']}:undefined,'required':_0x4a4f2d['query'][_0x73f1('0x79')]?!![]:![]}];}return db[_0x73f1('0x70')][_0x73f1('0x51')](_0x4029cd);})[_0x73f1('0x33')](function(_0x554e5d){_0x15acfa[_0x73f1('0x52')]=_0x554e5d;return _0x15acfa;});}})[_0x73f1('0x33')](respondWithFilteredResult(_0x20238f,_0x4029cd))[_0x73f1('0x56')](handleError(_0x20238f,null));};exports['addApplications']=function(_0x3bf116,_0x2f6f9c){var _0x21a27e=_0x3bf116[_0x73f1('0x53')]['id'];var _0x13d99f=_0x3bf116['body'];var _0x58d66e=0xc8;var _0x372a5f=null;return db[_0x73f1('0x7a')][_0x73f1('0x7b')]({'isolationLevel':db[_0x73f1('0x7a')][_0x73f1('0x7c')][_0x73f1('0x7d')][_0x73f1('0x7e')]},function(_0x11345a){return db[_0x73f1('0x3b')]['findOne']({'where':{'id':_0x21a27e},'transaction':_0x11345a})[_0x73f1('0x33')](function(_0x5c5373){if(_0x5c5373){return db['FaxApplication'][_0x73f1('0x35')]({'where':{'FaxAccountId':_0x21a27e},'transaction':_0x11345a})[_0x73f1('0x33')](function(){var _0xbd0924=_[_0x73f1('0x40')](_0x13d99f,function(_0x1acb20){_0x1acb20[_0x73f1('0x64')]=_0x21a27e;return _0x1acb20;});return db['FaxApplication'][_0x73f1('0x7f')](_0xbd0924,{'transaction':_0x11345a});});}else{_0x58d66e=0x194;_0x372a5f=[];}});})[_0x73f1('0x33')](function(){if(_0x58d66e!==0x194){return db[_0x73f1('0x80')][_0x73f1('0x81')]({'where':{'FaxAccountId':_0x21a27e},'order':_0x73f1('0x82')})['then'](function(_0x1db464){_0x372a5f=_0x1db464;});}})[_0x73f1('0x56')](function(_0x3e6073){_0x58d66e=0x1f4;logger['error'](_0x3e6073[_0x73f1('0x83')]);if(_0x3e6073[_0x73f1('0x36')]){delete _0x3e6073[_0x73f1('0x36')];}_0x372a5f=_0x3e6073;})[_0x73f1('0x84')](function(){if(_0x372a5f===null){_0x2f6f9c['sendStatus'](_0x58d66e);}else{if(_0x58d66e===0x1f4){_0x2f6f9c[_0x73f1('0x27')](_0x58d66e)[_0x73f1('0x37')](_0x372a5f);}else{_0x2f6f9c['status'](_0x58d66e)[_0x73f1('0x29')](_0x372a5f);}}});};exports[_0x73f1('0x85')]=function(_0xf0f43a,_0xd9aa2e,_0x299e46){var _0x505fac={};var _0x5900e7={};var _0x5825d1;var _0xbe1d3f;return db[_0x73f1('0x3b')][_0x73f1('0x63')]({'where':{'id':_0xf0f43a['params']['id']}})[_0x73f1('0x33')](handleEntityNotFound(_0xd9aa2e,null))[_0x73f1('0x33')](function(_0x651d91){if(_0x651d91){_0x5825d1=_0x651d91;_0x5900e7['model']=_['keys'](db[_0x73f1('0x80')][_0x73f1('0x3c')]);_0x5900e7['query']=_[_0x73f1('0x42')](_0xf0f43a[_0x73f1('0x41')]);_0x5900e7[_0x73f1('0x43')]=_['intersection'](_0x5900e7[_0x73f1('0x3f')],_0x5900e7[_0x73f1('0x41')]);_0x505fac[_0x73f1('0x44')]=_[_0x73f1('0x45')](_0x5900e7['model'],qs[_0x73f1('0x46')](_0xf0f43a[_0x73f1('0x41')][_0x73f1('0x46')]));_0x505fac[_0x73f1('0x44')]=_0x505fac[_0x73f1('0x44')][_0x73f1('0x47')]?_0x505fac[_0x73f1('0x44')]:_0x5900e7['model'];_0x505fac[_0x73f1('0x6a')]=qs[_0x73f1('0x4a')](_0xf0f43a[_0x73f1('0x41')][_0x73f1('0x4a')]);_0x505fac[_0x73f1('0x4b')]=qs['filters'](_['pick'](_0xf0f43a['query'],_0x5900e7['filters']));if(_0xf0f43a[_0x73f1('0x41')]['filter']){_0x505fac[_0x73f1('0x4b')]=_[_0x73f1('0x4e')](_0x505fac[_0x73f1('0x4b')],{'$or':_['map'](_0x505fac[_0x73f1('0x44')],function(_0x3dbab7){var _0x1c0fea={};_0x1c0fea[_0x3dbab7]={'$like':'%'+_0xf0f43a['query'][_0x73f1('0x4d')]+'%'};return _0x1c0fea;})});}_0x505fac=_[_0x73f1('0x4e')]({},_0x505fac,_0xf0f43a[_0x73f1('0x54')]);return _0x5825d1[_0x73f1('0x85')](_0x505fac);}})[_0x73f1('0x33')](function(_0x146152){if(_0x146152){_0xbe1d3f=_0x146152['length'];if(!_0xf0f43a[_0x73f1('0x41')]['hasOwnProperty']('nolimit')){_0x505fac[_0x73f1('0x2c')]=qs[_0x73f1('0x2c')](_0xf0f43a[_0x73f1('0x41')][_0x73f1('0x2c')]);_0x505fac['offset']=qs['offset'](_0xf0f43a[_0x73f1('0x41')]['offset']);}return _0x5825d1['getApplications'](_0x505fac);}})[_0x73f1('0x33')](function(_0x3d5241){if(_0x3d5241){return _0x3d5241?{'count':_0xbe1d3f,'rows':_0x3d5241}:null;}})[_0x73f1('0x33')](respondWithResult(_0xd9aa2e,null))[_0x73f1('0x56')](handleError(_0xd9aa2e,null));};function Extension(_0x563810,_0x2c65d9,_0x2a826e,_0x243127){this['context']=_0x73f1('0x86');this[_0x73f1('0x87')]=_0x563810[_0x73f1('0x88')];this[_0x73f1('0x89')]=_0x243127;this['type']='system';this[_0x73f1('0x8a')]=_0x73f1('0x8b');this[_0x73f1('0x64')]=_0x563810['id'];this[_0x73f1('0x82')]=_0x2c65d9;this[_0x73f1('0x8c')]=_0x2a826e;}function createExtensionsReciveFax(_0x1b3296){var _0x1ace39=0x1;var _0x4d1ff6=[];_0x4d1ff6['push'](new Extension(_0x1b3296,_0x1ace39,'',_0x73f1('0x8d')));_0x1ace39+=0x1;_0x4d1ff6['push'](new Extension(_0x1b3296,_0x1ace39,_0x73f1('0x8e'),_0x73f1('0x8f')));_0x1ace39+=0x1;for(var _0x156782 in _0x1b3296){if(_0x1b3296[_0x73f1('0x48')](_0x156782)&&(_0x156782===_0x73f1('0x90')||_0x156782===_0x73f1('0x88')||_0x156782==='gateway'||_0x156782===_0x73f1('0x91')||_0x156782==='headerinfo'||_0x156782==='maxrate'||_0x156782==='minrate'||_0x156782===_0x73f1('0x92')||_0x156782==='t38timeout')){_0x4d1ff6[_0x73f1('0x93')](new Extension(_0x1b3296,_0x1ace39,_0x73f1('0x94')+_0x156782+')='+_0x1b3296[_0x156782],_0x73f1('0x8f')));_0x1ace39+=0x1;}}_0x4d1ff6[_0x73f1('0x93')](new Extension(_0x1b3296,_0x1ace39,'6',_0x73f1('0x95')));_0x1ace39+=0x1;_0x4d1ff6[_0x73f1('0x93')](new Extension(_0x1b3296,_0x1ace39,_0x73f1('0x96'),'ReceiveFax'));_0x1ace39=0x0;return _0x4d1ff6;}exports[_0x73f1('0x97')]=function(_0x460590,_0xd18e0d,_0xe1f100){var _0x29a0a7;return db[_0x73f1('0x7a')][_0x73f1('0x7b')](function(_0x43014e){return db[_0x73f1('0x3b')][_0x73f1('0x57')](_0x460590[_0x73f1('0x5e')],{'transaction':_0x43014e})[_0x73f1('0x33')](function(_0x155091){_0x29a0a7=_0x155091['get']({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x29a0a7),{'transaction':_0x43014e});});})['then'](function(){return _0x29a0a7;})[_0x73f1('0x33')](respondWithResult(_0xd18e0d,null))['catch'](handleError(_0xd18e0d,null));};exports[_0x73f1('0x98')]=function(_0x47a97c,_0x270517,_0x4b1bfb){var _0x177ec2;return db[_0x73f1('0x7a')][_0x73f1('0x7b')](function(_0x3db3c5){return db[_0x73f1('0x3b')][_0x73f1('0x32')](_0x47a97c[_0x73f1('0x5e')],{'where':{'id':_0x47a97c[_0x73f1('0x5e')]['id']},'transaction':_0x3db3c5})[_0x73f1('0x33')](function(_0x1c2613){return db[_0x73f1('0x99')][_0x73f1('0x35')]({'where':{'FaxAccountId':_0x47a97c[_0x73f1('0x5e')]['id']},'transaction':_0x3db3c5})[_0x73f1('0x33')](function(_0x3b891d){return db[_0x73f1('0x99')][_0x73f1('0x7f')](createExtensionsReciveFax(_[_0x73f1('0x6e')](_0x47a97c[_0x73f1('0x5e')],[_0x73f1('0x9a'),_0x73f1('0x9b'),_0x73f1('0x9c'),_0x73f1('0x9d'),_0x73f1('0x9e'),_0x73f1('0x9f')])),{'transaction':_0x3db3c5});});});})['then'](function(){return db['FaxAccount'][_0x73f1('0xa0')](_0x47a97c[_0x73f1('0x5e')]['id']);})[_0x73f1('0x33')](respondWithResult(_0x270517,null))[_0x73f1('0x56')](handleError(_0x270517,null));};exports[_0x73f1('0xa1')]=function(_0x51a6e8,_0x9dbc91,_0x4624b8){var _0x86e8d4={'raw':!![],'where':{}};var _0xfb7406={};var _0x797d59={'count':0x0,'rows':[]};return db[_0x73f1('0x3b')]['findOne']({'where':{'id':_0x51a6e8[_0x73f1('0x53')]['id']}})['then'](handleEntityNotFound(_0x9dbc91,null))[_0x73f1('0x33')](function(_0x1b299b){if(_0x1b299b){_0xfb7406[_0x73f1('0x3f')]=_[_0x73f1('0x42')](db[_0x73f1('0xa2')]['rawAttributes']);_0xfb7406[_0x73f1('0x41')]=_[_0x73f1('0x42')](_0x51a6e8[_0x73f1('0x41')]);_0xfb7406[_0x73f1('0x43')]=_[_0x73f1('0x45')](_0xfb7406[_0x73f1('0x3f')],_0xfb7406[_0x73f1('0x41')]);_0x86e8d4[_0x73f1('0x44')]=_[_0x73f1('0x45')](_0xfb7406[_0x73f1('0x3f')],qs[_0x73f1('0x46')](_0x51a6e8['query'][_0x73f1('0x46')]));_0x86e8d4[_0x73f1('0x44')]=_0x86e8d4[_0x73f1('0x44')][_0x73f1('0x47')]?_0x86e8d4[_0x73f1('0x44')]:_0xfb7406[_0x73f1('0x3f')];if(!_0x51a6e8[_0x73f1('0x41')][_0x73f1('0x48')](_0x73f1('0x49'))){_0x86e8d4['limit']=qs[_0x73f1('0x2c')](_0x51a6e8[_0x73f1('0x41')]['limit']);_0x86e8d4[_0x73f1('0x2a')]=qs[_0x73f1('0x2a')](_0x51a6e8[_0x73f1('0x41')][_0x73f1('0x2a')]);}_0x86e8d4[_0x73f1('0x6a')]=qs[_0x73f1('0x4a')](_0x51a6e8['query']['sort']);_0x86e8d4[_0x73f1('0x4b')]=qs[_0x73f1('0x43')](_[_0x73f1('0x6b')](_0x51a6e8['query'],_0xfb7406['filters']));_0x86e8d4[_0x73f1('0x4b')][_0x73f1('0x64')]=_0x1b299b['id'];if(_0x51a6e8[_0x73f1('0x41')][_0x73f1('0x4d')]){_0x86e8d4[_0x73f1('0x4b')]=_[_0x73f1('0x4e')](_0x86e8d4['where'],{'$or':_[_0x73f1('0x40')](_0x86e8d4['attributes'],function(_0xe1fc71){var _0x54fbdb={};_0x54fbdb[_0xe1fc71]={'$like':'%'+_0x51a6e8[_0x73f1('0x41')]['filter']+'%'};return _0x54fbdb;})});}if(_0x51a6e8['query']['$gte']){var _0x41991e=_0x51a6e8['query'][_0x73f1('0xa3')][_0x73f1('0xa4')](',');var _0x77f998={};_0x77f998[_0x41991e[0x0]]={'$gte':moment(_0x41991e[0x1])[_0x73f1('0xa5')](_0x73f1('0xa6'))};_0x86e8d4[_0x73f1('0x4b')]=_[_0x73f1('0x4e')](_0x86e8d4[_0x73f1('0x4b')],_0x77f998);}_0x86e8d4=_['merge']({},_0x86e8d4,_0x51a6e8[_0x73f1('0x54')]);return db[_0x73f1('0xa2')][_0x73f1('0x2d')]({'where':_0x86e8d4[_0x73f1('0x4b')]})[_0x73f1('0x33')](function(_0x1cefe8){_0x797d59[_0x73f1('0x2d')]=_0x1cefe8;if(_0x51a6e8['query'][_0x73f1('0x4f')]){_0x86e8d4[_0x73f1('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0x73f1('0x51')](_0x86e8d4);})[_0x73f1('0x33')](function(_0x47ce74){_0x797d59[_0x73f1('0x52')]=_0x47ce74;return _0x797d59;});}})[_0x73f1('0x33')](respondWithFilteredResult(_0x9dbc91,_0x86e8d4))[_0x73f1('0x56')](handleError(_0x9dbc91,null));};exports['send']=function(_0x58db15,_0x2ca30d,_0x31da91){var _0x241098,_0x1c8cfc={},_0x5a3c15;if(_0x58db15[_0x73f1('0x5e')]['to']){_0x5a3c15=_0x58db15[_0x73f1('0x5e')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x58db15['params']['id']},'include':[{'model':db[_0x73f1('0xa7')],'as':_0x73f1('0xa8'),'include':[{'model':db[_0x73f1('0x71')],'as':_0x73f1('0xa9'),'where':{'fax':_0x5a3c15},'limit':0x1,'order':[[_0x73f1('0x9d'),_0x73f1('0xaa')]]}]}]})['then'](handleEntityNotFound(_0x2ca30d,null))['then'](function(_0x138d2e){_0x241098=_0x138d2e;if(_0x58db15[_0x73f1('0x5e')][_0x73f1('0xab')]&&_0x58db15[_0x73f1('0x5e')][_0x73f1('0xab')][_0x73f1('0x47')]){for(var _0x4bd397=0x0;_0x4bd397<_0x58db15['body']['attachments'][_0x73f1('0x47')];_0x4bd397+=0x1){_0x58db15[_0x73f1('0x5e')][_0x73f1('0xab')][_0x4bd397]={'filename':_0x58db15[_0x73f1('0x5e')]['attachments'][_0x4bd397][_0x73f1('0x36')],'id':_0x58db15['body'][_0x73f1('0xab')][_0x4bd397]['id'],'path':path[_0x73f1('0xac')](config[_0x73f1('0xad')],'server/files/attachments',_0x58db15[_0x73f1('0x5e')]['attachments'][_0x4bd397][_0x73f1('0xae')])};}}return respondWithRpcPromise(_0x73f1('0xaf'),'CheckAfterSend',{'FaxAccountId':_[_0x73f1('0xb0')](_0x58db15[_0x73f1('0x53')]['id'])?undefined:_0x58db15[_0x73f1('0x53')]['id'],'path':_[_0x73f1('0xb0')](_0x58db15['body'][_0x73f1('0xab')][0x0][_0x73f1('0x6')])?undefined:_0x58db15[_0x73f1('0x5e')][_0x73f1('0xab')][0x0]['path'],'fax':_[_0x73f1('0xb0')](_0x58db15[_0x73f1('0x5e')]['to'][0x0])?undefined:_0x58db15['body']['to'][0x0]},client9002);})['then'](function(){if(_0x241098){if(_[_0x73f1('0xb0')](_0x58db15[_0x73f1('0x5e')][_0x73f1('0xb1')])){_0x58db15[_0x73f1('0x5e')][_0x73f1('0xb1')]=util[_0x73f1('0xa5')](_0x73f1('0xb2'),_0x241098[_0x73f1('0x36')],_0x241098[_0x73f1('0xb3')]);}if(_0x241098[_0x73f1('0xa8')]){if(_0x241098['List'][_0x73f1('0xa9')][_0x73f1('0x47')]){return _0x241098[_0x73f1('0xa8')][_0x73f1('0xa9')][0x0];}else{return db[_0x73f1('0x71')][_0x73f1('0x57')](_['defaults'](_0x58db15['body'],{'firstName':_0x58db15['body']['to'][0x0],'phone':_0x58db15['body']['to'][0x0],'fax':_0x58db15[_0x73f1('0x5e')]['to'][0x0],'ListId':_0x241098['ListId']}));}}else{throw new Error(_0x73f1('0xb4'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x73f1('0x33')](function(_0x33a29d){if(_0x33a29d){return db[_0x73f1('0x70')][_0x73f1('0x55')]({'where':{'ContactId':_0x33a29d['id'],'closed':![],'FaxAccountId':_0x241098['id']}})[_0x73f1('0x33')](function(_0x1daaa6){if(_0x1daaa6){return[_0x1daaa6,![]];}return db[_0x73f1('0x70')][_0x73f1('0x57')]({'UserId':_0x58db15['user']['id'],'ContactId':_0x33a29d['id'],'FaxAccountId':_0x241098['id'],'fax':_0x58db15[_0x73f1('0x5e')]['to'][0x0],'firstMsgDirection':_0x73f1('0xb5'),'Messages':[_[_0x73f1('0x4e')](_0x58db15[_0x73f1('0x5e')],{'read':![],'body':_0x58db15[_0x73f1('0x5e')][_0x73f1('0xab')][0x0][_0x73f1('0xb6')],'FaxAccountId':_0x241098['id'],'UserId':_0x58db15[_0x73f1('0x58')]['id'],'ContactId':_0x33a29d['id'],'AttachmentId':_0x58db15[_0x73f1('0x5e')][_0x73f1('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x73f1('0xa2')],'as':'Messages'}]})[_0x73f1('0x33')](function(_0x200512){return[_0x200512,!![]];});});}else{throw new Error(_0x73f1('0xb7'));}})[_0x73f1('0xb8')](function(_0x55ce04,_0x228b66){if(_0x228b66){return _0x55ce04;}return db[_0x73f1('0xa2')][_0x73f1('0x57')]({'direction':_0x73f1('0xb5'),'read':![],'body':_0x58db15[_0x73f1('0x5e')][_0x73f1('0xab')][0x0][_0x73f1('0xb6')],'FaxAccountId':_0x241098['id'],'FaxInteractionId':_0x55ce04['id'],'UserId':_0x58db15[_0x73f1('0x58')]['id'],'ContactId':_0x55ce04[_0x73f1('0xb9')],'AttachmentId':_0x58db15['body'][_0x73f1('0xab')][0x0]['id']})[_0x73f1('0x33')](function(_0x4b3579){_0x55ce04[_0x73f1('0xba')]['Messages']=[];_0x55ce04[_0x73f1('0xba')][_0x73f1('0xbb')][_0x73f1('0x93')](_0x4b3579[_0x73f1('0xba')]);return _0x55ce04;});})[_0x73f1('0x33')](function(_0x15441a){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0x58db15[_0x73f1('0x53')]['id'])?undefined:_0x58db15[_0x73f1('0x53')]['id'],'path':_[_0x73f1('0xb0')](_0x58db15[_0x73f1('0x5e')]['attachments'][0x0][_0x73f1('0x6')])?undefined:_0x58db15[_0x73f1('0x5e')][_0x73f1('0xab')][0x0][_0x73f1('0x6')],'fax':_['isNil'](_0x58db15[_0x73f1('0x5e')]['to'][0x0])?undefined:_0x58db15[_0x73f1('0x5e')]['to'][0x0],'AttachmentId':_0x58db15[_0x73f1('0x5e')][_0x73f1('0xab')][0x0]['id']},client9002)[_0x73f1('0x33')](function(_0x87dda8){logger['info']('SendFaxRpc,\x20%s',_0x87dda8);})['catch'](function(_0x4ad03f){logger[_0x73f1('0x1d')]('SendFaxRpc,\x20%s',_0x4ad03f);});return _0x15441a;})[_0x73f1('0x33')](respondWithResult(_0x2ca30d,null))['catch'](handleError(_0x2ca30d,null));};exports['addAgents']=function(_0x10f4c,_0x1e1e80,_0x29c0d6){return db[_0x73f1('0x3b')][_0x73f1('0x55')]({'where':{'id':_0x10f4c[_0x73f1('0x53')]['id']}})[_0x73f1('0x33')](handleEntityNotFound(_0x1e1e80,null))[_0x73f1('0x33')](function(_0x50daf7){if(_0x50daf7){return _0x50daf7[_0x73f1('0xbc')](_0x10f4c[_0x73f1('0x5e')][_0x73f1('0x66')],_['omit'](_0x10f4c[_0x73f1('0x5e')],[_0x73f1('0x66'),'id'])||{})[_0x73f1('0xb8')](function(_0x4f4cb6){for(var _0x127f59=0x0;_0x127f59<_0x10f4c[_0x73f1('0x5e')][_0x73f1('0x66')][_0x73f1('0x47')];_0x127f59+=0x1){socket[_0x73f1('0xbd')](_0x73f1('0xbe'),{'UserId':Number(_0x10f4c[_0x73f1('0x5e')][_0x73f1('0x66')][_0x127f59]),'FaxAccountId':Number(_0x10f4c[_0x73f1('0x53')]['id'])});}return _0x4f4cb6;});}})['then'](respondWithResult(_0x1e1e80,null))[_0x73f1('0x56')](handleError(_0x1e1e80,null));};exports[_0x73f1('0xbf')]=function(_0x1726dc,_0x7aa48e,_0x1268df){return db['FaxAccount'][_0x73f1('0x55')]({'where':{'id':_0x1726dc[_0x73f1('0x53')]['id']}})[_0x73f1('0x33')](handleEntityNotFound(_0x7aa48e,null))['then'](function(_0x44811d){if(_0x44811d){return _0x44811d[_0x73f1('0xbf')](_0x1726dc[_0x73f1('0x41')][_0x73f1('0x66')])['then'](function(){if(_[_0x73f1('0xc0')](_0x1726dc[_0x73f1('0x41')]['ids'])){for(var _0xc4d4ae=0x0;_0xc4d4ae<_0x1726dc[_0x73f1('0x41')][_0x73f1('0x66')][_0x73f1('0x47')];_0xc4d4ae+=0x1){socket[_0x73f1('0xbd')](_0x73f1('0xc1'),{'UserId':Number(_0x1726dc[_0x73f1('0x41')][_0x73f1('0x66')][_0xc4d4ae]),'FaxAccountId':Number(_0x1726dc[_0x73f1('0x53')]['id'])});}}else{socket[_0x73f1('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x1726dc[_0x73f1('0x41')][_0x73f1('0x66')]),'FaxAccountId':Number(_0x1726dc[_0x73f1('0x53')]['id'])});}});}})[_0x73f1('0x33')](respondWithStatusCode(_0x7aa48e,null))[_0x73f1('0x56')](handleError(_0x7aa48e,null));};exports[_0x73f1('0xc2')]=function(_0xf16882,_0x57f73e,_0x4aeced){var _0x57c18c={};var _0x2ee0d6={};var _0x9d2c16;var _0x48c3b4;return db[_0x73f1('0x3b')][_0x73f1('0x63')]({'where':{'id':_0xf16882['params']['id']}})['then'](handleEntityNotFound(_0x57f73e,null))['then'](function(_0x3780ca){if(_0x3780ca){_0x9d2c16=_0x3780ca;_0x2ee0d6[_0x73f1('0x3f')]=_[_0x73f1('0x42')](db[_0x73f1('0x73')][_0x73f1('0x3c')]);_0x2ee0d6[_0x73f1('0x41')]=_['keys'](_0xf16882['query']);_0x2ee0d6[_0x73f1('0x43')]=_[_0x73f1('0x45')](_0x2ee0d6[_0x73f1('0x3f')],_0x2ee0d6['query']);_0x57c18c[_0x73f1('0x44')]=_[_0x73f1('0x45')](_0x2ee0d6[_0x73f1('0x3f')],qs[_0x73f1('0x46')](_0xf16882[_0x73f1('0x41')][_0x73f1('0x46')]));_0x57c18c['attributes']=_0x57c18c[_0x73f1('0x44')][_0x73f1('0x47')]?_0x57c18c[_0x73f1('0x44')]:_0x2ee0d6[_0x73f1('0x3f')];_0x57c18c['order']=qs[_0x73f1('0x4a')](_0xf16882[_0x73f1('0x41')][_0x73f1('0x4a')]);_0x57c18c[_0x73f1('0x4b')]=qs[_0x73f1('0x43')](_['pick'](_0xf16882[_0x73f1('0x41')],_0x2ee0d6['filters']));if(_0xf16882[_0x73f1('0x41')][_0x73f1('0x4d')]){_0x57c18c[_0x73f1('0x4b')]=_[_0x73f1('0x4e')](_0x57c18c[_0x73f1('0x4b')],{'$or':_[_0x73f1('0x40')](_0x57c18c['attributes'],function(_0x3b5672){var _0x1c5453={};_0x1c5453[_0x3b5672]={'$like':'%'+_0xf16882[_0x73f1('0x41')][_0x73f1('0x4d')]+'%'};return _0x1c5453;})});}_0x57c18c=_[_0x73f1('0x4e')]({},_0x57c18c,_0xf16882[_0x73f1('0x54')]);return _0x9d2c16['getAgents'](_0x57c18c);}})[_0x73f1('0x33')](function(_0x52d513){if(_0x52d513){_0x48c3b4=_0x52d513[_0x73f1('0x47')];if(!_0xf16882['query']['hasOwnProperty'](_0x73f1('0x49'))){_0x57c18c['limit']=qs[_0x73f1('0x2c')](_0xf16882['query'][_0x73f1('0x2c')]);_0x57c18c['offset']=qs[_0x73f1('0x2a')](_0xf16882[_0x73f1('0x41')][_0x73f1('0x2a')]);}return _0x9d2c16[_0x73f1('0xc2')](_0x57c18c);}})[_0x73f1('0x33')](function(_0x54453d){if(_0x54453d){return _0x54453d?{'count':_0x48c3b4,'rows':_0x54453d}:null;}})['then'](respondWithResult(_0x57f73e,null))['catch'](handleError(_0x57f73e,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 6acf270..3000ae3 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 _0x02d4=['remove','emit','hasOwnProperty','hook','exports','events','FaxAccount','setMaxListeners','save','update'];(function(_0x24a978,_0x24453f){var _0x275b42=function(_0x5965a3){while(--_0x5965a3){_0x24a978['push'](_0x24a978['shift']());}};_0x275b42(++_0x24453f);}(_0x02d4,0x18b));var _0x402d=function(_0x4cf510,_0x2b3b89){_0x4cf510=_0x4cf510-0x0;var _0x5336d4=_0x02d4[_0x4cf510];return _0x5336d4;};'use strict';var EventEmitter=require(_0x402d('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x402d('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x402d('0x2')](0x0);var events={'afterCreate':_0x402d('0x3'),'afterUpdate':_0x402d('0x4'),'afterDestroy':_0x402d('0x5')};function emitEvent(_0x2bea15){return function(_0x1c6c2d,_0x231e14,_0x3578c7){FaxAccountEvents[_0x402d('0x6')](_0x2bea15+':'+_0x1c6c2d['id'],_0x1c6c2d);FaxAccountEvents[_0x402d('0x6')](_0x2bea15,_0x1c6c2d);_0x3578c7(null);};}for(var e in events){if(events[_0x402d('0x7')](e)){var event=events[e];FaxAccount[_0x402d('0x8')](e,emitEvent(event));}}module[_0x402d('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x6f24=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1d0a95,_0x4e7d08){var _0x26d3f6=function(_0x4ef7dc){while(--_0x4ef7dc){_0x1d0a95['push'](_0x1d0a95['shift']());}};_0x26d3f6(++_0x4e7d08);}(_0x6f24,0x76));var _0x46f2=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6f24[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require(_0x46f2('0x0'));var FaxAccount=require(_0x46f2('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x46f2('0x2')](0x0);var events={'afterCreate':_0x46f2('0x3'),'afterUpdate':_0x46f2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2969e4){return function(_0x5d4655,_0x5da2a8,_0x37b138){FaxAccountEvents[_0x46f2('0x5')](_0x2969e4+':'+_0x5d4655['id'],_0x5d4655);FaxAccountEvents[_0x46f2('0x5')](_0x2969e4,_0x5d4655);_0x37b138(null);};}for(var e in events){if(events[_0x46f2('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x46f2('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 96b4e21..88ea756 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 _0xa309=['define','FaxAccount','fax_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa309,0x1cb));var _0x9a30=function(_0x3a17d6,_0x961735){_0x3a17d6=_0x3a17d6-0x0;var _0xb9a405=_0xa309[_0x3a17d6];return _0xb9a405;};'use strict';var _=require('lodash');var util=require(_0x9a30('0x0'));var logger=require(_0x9a30('0x1'))(_0x9a30('0x2'));var moment=require('moment');var BPromise=require(_0x9a30('0x3'));var rp=require(_0x9a30('0x4'));var fs=require('fs');var path=require(_0x9a30('0x5'));var rimraf=require(_0x9a30('0x6'));var config=require(_0x9a30('0x7'));var attributes=require('./faxAccount.attributes');module[_0x9a30('0x8')]=function(_0x2b5c09,_0x3084f3){return _0x2b5c09[_0x9a30('0x9')](_0x9a30('0xa'),attributes,{'tableName':_0x9a30('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ee8=['path','rimraf','../../config/environment','./faxAccount.attributes','exports','fax_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4686f2,_0x3ad978){var _0x2f54dc=function(_0x5cb482){while(--_0x5cb482){_0x4686f2['push'](_0x4686f2['shift']());}};_0x2f54dc(++_0x3ad978);}(_0x1ee8,0x132));var _0x81ee=function(_0x54abb0,_0x235d65){_0x54abb0=_0x54abb0-0x0;var _0x40bced=_0x1ee8[_0x54abb0];return _0x40bced;};'use strict';var _=require('lodash');var util=require(_0x81ee('0x0'));var logger=require(_0x81ee('0x1'))(_0x81ee('0x2'));var moment=require(_0x81ee('0x3'));var BPromise=require(_0x81ee('0x4'));var rp=require(_0x81ee('0x5'));var fs=require('fs');var path=require(_0x81ee('0x6'));var rimraf=require(_0x81ee('0x7'));var config=require(_0x81ee('0x8'));var attributes=require(_0x81ee('0x9'));module[_0x81ee('0xa')]=function(_0x437a84,_0x2e5ef7){return _0x437a84['define']('FaxAccount',attributes,{'tableName':_0x81ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 8825498..09962d0 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 _0x3a74=['interaction','FaxMessage','AttachmentId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','FaxAccount','options','where','attributes','limit','include','map','model','debug','catch','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','DESC','Applications','get','applications','list','priority','asc','length','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created'];(function(_0x3787c6,_0x4cbb38){var _0x5e1eac=function(_0x87dfa2){while(--_0x87dfa2){_0x3787c6['push'](_0x3787c6['shift']());}};_0x5e1eac(++_0x4cbb38);}(_0x3a74,0x112));var _0x43a7=function(_0x58319a,_0x145060){_0x58319a=_0x58319a-0x0;var _0x4cf654=_0x3a74[_0x58319a];return _0x4cf654;};'use strict';var _=require(_0x43a7('0x0'));var util=require('util');var moment=require(_0x43a7('0x1'));var BPromise=require(_0x43a7('0x2'));var rs=require(_0x43a7('0x3'));var fs=require('fs');var Redis=require(_0x43a7('0x4'));var db=require(_0x43a7('0x5'))['db'];var utils=require(_0x43a7('0x6'));var logger=require('../../config/logger')(_0x43a7('0x7'));var config=require(_0x43a7('0x8'));var jayson=require(_0x43a7('0x9'));var client=jayson[_0x43a7('0xa')][_0x43a7('0xb')]({'port':0x232c});config[_0x43a7('0xc')]=_[_0x43a7('0xd')](config[_0x43a7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x43a7('0xe'))(new Redis(config[_0x43a7('0xc')]));require(_0x43a7('0xf'))[_0x43a7('0x10')](socket);function respondWithRpcPromise(_0x393e00,_0x5f3c89,_0x406732){return new BPromise(function(_0x4e25c5,_0x3ceb33){return client['request'](_0x393e00,_0x406732)[_0x43a7('0x11')](function(_0x573692){logger['info'](_0x43a7('0x12'),_0x5f3c89,_0x43a7('0x13'));logger['debug'](_0x43a7('0x14'),_0x5f3c89,_0x43a7('0x13'),JSON[_0x43a7('0x15')](_0x573692));if(_0x573692[_0x43a7('0x16')]){if(_0x573692[_0x43a7('0x16')][_0x43a7('0x17')]===0x1f4){logger['error'](_0x43a7('0x12'),_0x5f3c89,_0x573692[_0x43a7('0x16')]['message']);return _0x3ceb33(_0x573692[_0x43a7('0x16')][_0x43a7('0x18')]);}logger[_0x43a7('0x16')](_0x43a7('0x12'),_0x5f3c89,_0x573692[_0x43a7('0x16')][_0x43a7('0x18')]);return _0x4e25c5(_0x573692[_0x43a7('0x16')][_0x43a7('0x18')]);}else{logger[_0x43a7('0x19')](_0x43a7('0x12'),_0x5f3c89,'request\x20sent');_0x4e25c5(_0x573692[_0x43a7('0x1a')]['message']);}})['catch'](function(_0xa77d70){logger[_0x43a7('0x16')](_0x43a7('0x12'),_0x5f3c89,_0xa77d70);_0x3ceb33(_0xa77d70);});});}exports['GetFaxAccount']=function(_0x5e052f){var _0x1327b0=this;return new Promise(function(_0x4f9dfd,_0xea2f6e){return db[_0x43a7('0x1b')]['findAll']({'raw':_0x5e052f['options']?_0x5e052f['options']['raw']===undefined?!![]:![]:!![],'where':_0x5e052f[_0x43a7('0x1c')]?_0x5e052f[_0x43a7('0x1c')][_0x43a7('0x1d')]||null:null,'attributes':_0x5e052f[_0x43a7('0x1c')]?_0x5e052f[_0x43a7('0x1c')][_0x43a7('0x1e')]||null:null,'limit':_0x5e052f['options']?_0x5e052f['options'][_0x43a7('0x1f')]||null:null,'include':_0x5e052f[_0x43a7('0x1c')]?_0x5e052f[_0x43a7('0x1c')][_0x43a7('0x20')]?_[_0x43a7('0x21')](_0x5e052f[_0x43a7('0x1c')][_0x43a7('0x20')],function(_0x2e6963){return{'model':db[_0x2e6963['model']],'as':_0x2e6963['as'],'attributes':_0x2e6963[_0x43a7('0x1e')],'include':_0x2e6963[_0x43a7('0x20')]?_[_0x43a7('0x21')](_0x2e6963['include'],function(_0x540e6f){return{'model':db[_0x540e6f[_0x43a7('0x22')]],'as':_0x540e6f['as'],'attributes':_0x540e6f[_0x43a7('0x1e')],'include':_0x540e6f[_0x43a7('0x20')]?_[_0x43a7('0x21')](_0x540e6f['include'],function(_0x105ceb){return{'model':db[_0x105ceb['model']],'as':_0x105ceb['as'],'attributes':_0x105ceb[_0x43a7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x43a7('0x11')](function(_0x3bffa5){logger[_0x43a7('0x19')]('GetFaxAccount',_0x5e052f);logger[_0x43a7('0x23')]('GetFaxAccount',_0x5e052f,JSON[_0x43a7('0x15')](_0x3bffa5));_0x4f9dfd(_0x3bffa5);})[_0x43a7('0x24')](function(_0x24f1e9){logger[_0x43a7('0x16')]('GetFaxAccount',_0x24f1e9[_0x43a7('0x18')],_0x5e052f);_0xea2f6e(_0x1327b0['error'](0x1f4,_0x24f1e9[_0x43a7('0x18')]));});});};exports[_0x43a7('0x25')]=function(_0xb578ea,_0x5d5d1c,_0x405e6d){var _0x35c453=this;return new Promise(function(_0x4abee8,_0x1c971f){var _0xe4789c={'body':_0xb578ea[_0x43a7('0x26')],'channel':_0x43a7('0x27')};var _0x2b0064=[];var _0x2266b3=[];var _0x25e2b1={};return db[_0x43a7('0x28')]['describe']()[_0x43a7('0x11')](function(_0xc7aaa2){if(!_0xc7aaa2){throw new db[(_0x43a7('0x29'))][(_0x43a7('0x2a'))](_0x43a7('0x2b'));}_0x2b0064=_[_0x43a7('0x2c')](_[_0x43a7('0x2d')](_0xc7aaa2),[_0x43a7('0x2e'),_0x43a7('0x2f')]);_0x2266b3=_[_0x43a7('0x2c')](_[_0x43a7('0x2d')](_0xc7aaa2),[_0x43a7('0x2e'),_0x43a7('0x2f'),_0x43a7('0x30'),_0x43a7('0x31')]);if(_0xb578ea['body']['id']){delete _0xb578ea[_0x43a7('0x26')]['id'];}if(_[_0x43a7('0x32')](_0xb578ea[_0x43a7('0x26')][_0x43a7('0x33')])){throw new db[(_0x43a7('0x29'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x43a7('0x32')](_0xb578ea[_0x43a7('0x26')][_0x43a7('0x26')])||_0xb578ea[_0x43a7('0x26')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x43a7('0x34'));}if(_[_0x43a7('0x32')](_0xb578ea[_0x43a7('0x26')]['mapKey'])){throw new db[(_0x43a7('0x29'))][(_0x43a7('0x2a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2266b3);}if(!_[_0x43a7('0x35')](_0x2266b3,_0xb578ea['body'][_0x43a7('0x36')])){throw new db[(_0x43a7('0x29'))][(_0x43a7('0x2a'))](_0x43a7('0x37')+_0x2266b3);}_0x25e2b1[_0xb578ea['body'][_0x43a7('0x36')]]=_0xb578ea[_0x43a7('0x26')]['from'];})['then'](function(){return db[_0x43a7('0x1b')]['find']({'where':{'id':_0xb578ea[_0x43a7('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0x43a7('0x39'),'include':[{'model':db[_0x43a7('0x28')],'as':_0x43a7('0x3a'),'where':_0x25e2b1,'limit':0x1,'order':[[_0x43a7('0x2f'),_0x43a7('0x3b')]]}]},{'model':db['FaxApplication'],'as':_0x43a7('0x3c')}]});})['then'](function(_0x31dbd6){if(_0x31dbd6&&_0x31dbd6[_0x43a7('0x39')]){var _0x13f0b2=_0x31dbd6[_0x43a7('0x3d')]({'plain':!![]});_0xe4789c[_0x43a7('0x38')]=_0x13f0b2;_0xe4789c[_0x43a7('0x3e')]=_0x13f0b2[_0x43a7('0x3c')];_0xe4789c[_0x43a7('0x3f')]=_0x13f0b2['List'];_0xe4789c['applications']=_['orderBy'](_0xe4789c[_0x43a7('0x3e')],[_0x43a7('0x40')],[_0x43a7('0x41')]);if(_0xe4789c[_0x43a7('0x38')]['Applications']){delete _0xe4789c['account']['Applications'];}if(_0xe4789c[_0x43a7('0x38')]['List']&&_0xe4789c[_0x43a7('0x38')]['List'][_0x43a7('0x3a')][_0x43a7('0x42')]){return _0xe4789c['account']['List']['Contacts'][0x0];}var _0x47ee59=_[_0x43a7('0xd')](_0xb578ea[_0x43a7('0x26')],{'firstName':_0xb578ea[_0x43a7('0x26')][_0x43a7('0x33')],'ListId':_0x13f0b2[_0x43a7('0x31')]});_0x47ee59[_0xb578ea[_0x43a7('0x26')]['mapKey']]=_0xb578ea[_0x43a7('0x26')]['from'];return db['CmContact'][_0x43a7('0x43')](_0x47ee59,{'fields':_0x2b0064,'raw':!![]});}})[_0x43a7('0x11')](function(_0x4f5cf6){_0xe4789c[_0x43a7('0x44')]=_0x4f5cf6;if(_0x4f5cf6){var _0x4c0361={'ContactId':_0x4f5cf6['id'],'FaxAccountId':_0xb578ea[_0x43a7('0x38')]['id'],'fax':_0x4f5cf6[_0x43a7('0x27')]};return db[_0x43a7('0x45')][_0x43a7('0x46')]({'where':{'ContactId':_0x4f5cf6['id'],'closed':![],'FaxAccountId':_0xb578ea[_0x43a7('0x38')]['id']}})[_0x43a7('0x11')](function(_0x1668c8){if(_0x1668c8){return[_0x1668c8,![]];}return db[_0x43a7('0x45')]['create'](_0x4c0361)[_0x43a7('0x11')](function(_0x21df46){return[_0x21df46,!![]];});});}else{throw new Error(_0x43a7('0x47'));}})[_0x43a7('0x48')](function(_0x13ca70,_0xd8d508){var _0x161101=_0x13ca70[_0x43a7('0x3d')]({'plain':!![]});if(_0xd8d508){if(_0xe4789c['account'][_0x43a7('0x49')]){_0xe4789c['applications'][_0x43a7('0x4a')]({'id':0x0,'priority':_0xe4789c['applications'][_0x43a7('0x42')]+0x1,'app':_0x43a7('0x4b'),'appdata':'unmanaged','interval':_0x43a7('0x4c')});}_0x161101[_0x43a7('0x4d')]=!![];}else{_0x161101[_0x43a7('0x4d')]=![];}_0xe4789c[_0x43a7('0x4e')]=_0x161101;return db[_0x43a7('0x4f')][_0x43a7('0x43')]({'body':_0xb578ea['body'][_0x43a7('0x26')],'FaxAccountId':_0xb578ea[_0x43a7('0x38')]['id'],'FaxInteractionId':_0x13ca70['id'],'direction':'in','ContactId':_0x13ca70['ContactId'],'AttachmentId':_0xb578ea[_0x43a7('0x26')][_0x43a7('0x50')]});})[_0x43a7('0x11')](function(_0x4823ec){_0xe4789c['message']=_0x4823ec;if(_0xe4789c['interaction']['UserId']){return db[_0x43a7('0x51')][_0x43a7('0x46')]({'attributes':['id',_0x43a7('0x52')],'where':{'id':_0xe4789c['interaction']['UserId']}})['then'](function(_0xa0efd3){if(_0xa0efd3){_0xe4789c['applications'][_0x43a7('0x53')]({'id':0x0,'priority':0x0,'app':_0x43a7('0x54'),'appdata':_0xa0efd3['name']+','+(_0xe4789c['account'][_0x43a7('0x55')]||0xa),'interval':_0x43a7('0x4c')});}return respondWithRpcPromise(_0x43a7('0x56'),_0x43a7('0x57'),_0xe4789c);});}return respondWithRpcPromise(_0x43a7('0x56'),_0x43a7('0x57'),_0xe4789c);})[_0x43a7('0x11')](function(_0x31fe2c){_0x4abee8(_0x31fe2c);})[_0x43a7('0x24')](function(_0x4cd7d9){_0x1c971f(_0x35c453['error'](0x1f4,_0x4cd7d9['message']));});});}; \ No newline at end of file +var _0x23c0=['CmList','CmContact','Contacts','Applications','List','get','applications','priority','asc','length','create','contact','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','redis','defaults','socket.io-emitter','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','options','where','attributes','limit','include','map','model','info','NotifyFaxAccount','describe','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','ValidationError','from\x20is\x20mandatory','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account'];(function(_0x44d518,_0x5ec2de){var _0x5c5329=function(_0x3316bd){while(--_0x3316bd){_0x44d518['push'](_0x44d518['shift']());}};_0x5c5329(++_0x5ec2de);}(_0x23c0,0x181));var _0x023c=function(_0x4b4756,_0x4fbd44){_0x4b4756=_0x4b4756-0x0;var _0x3bce27=_0x23c0[_0x4b4756];return _0x3bce27;};'use strict';var _=require(_0x023c('0x0'));var util=require(_0x023c('0x1'));var moment=require(_0x023c('0x2'));var BPromise=require(_0x023c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x023c('0x4'));var db=require(_0x023c('0x5'))['db'];var utils=require(_0x023c('0x6'));var logger=require('../../config/logger')(_0x023c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x023c('0x8')]['http']({'port':0x232c});config[_0x023c('0x9')]=_[_0x023c('0xa')](config[_0x023c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x023c('0xb'))(new Redis(config[_0x023c('0x9')]));require('./faxAccount.socket')[_0x023c('0xc')](socket);function respondWithRpcPromise(_0xe06b43,_0x1f5a86,_0x225055){return new BPromise(function(_0x596d24,_0x53934c){return client[_0x023c('0xd')](_0xe06b43,_0x225055)[_0x023c('0xe')](function(_0x4cdde0){logger['info'](_0x023c('0xf'),_0x1f5a86,_0x023c('0x10'));logger['debug'](_0x023c('0x11'),_0x1f5a86,'request\x20sent',JSON[_0x023c('0x12')](_0x4cdde0));if(_0x4cdde0[_0x023c('0x13')]){if(_0x4cdde0[_0x023c('0x13')][_0x023c('0x14')]===0x1f4){logger['error'](_0x023c('0xf'),_0x1f5a86,_0x4cdde0[_0x023c('0x13')]['message']);return _0x53934c(_0x4cdde0[_0x023c('0x13')][_0x023c('0x15')]);}logger[_0x023c('0x13')]('FaxAccount,\x20%s,\x20%s',_0x1f5a86,_0x4cdde0[_0x023c('0x13')][_0x023c('0x15')]);return _0x596d24(_0x4cdde0[_0x023c('0x13')][_0x023c('0x15')]);}else{logger['info'](_0x023c('0xf'),_0x1f5a86,'request\x20sent');_0x596d24(_0x4cdde0[_0x023c('0x16')]['message']);}})[_0x023c('0x17')](function(_0x515f0d){logger[_0x023c('0x13')](_0x023c('0xf'),_0x1f5a86,_0x515f0d);_0x53934c(_0x515f0d);});});}exports[_0x023c('0x18')]=function(_0x1d0ff9){var _0x5bc7b5=this;return new Promise(function(_0x2e5a53,_0x3cf305){return db['FaxAccount']['findAll']({'raw':_0x1d0ff9[_0x023c('0x19')]?_0x1d0ff9['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d0ff9[_0x023c('0x19')]?_0x1d0ff9[_0x023c('0x19')][_0x023c('0x1a')]||null:null,'attributes':_0x1d0ff9[_0x023c('0x19')]?_0x1d0ff9[_0x023c('0x19')][_0x023c('0x1b')]||null:null,'limit':_0x1d0ff9[_0x023c('0x19')]?_0x1d0ff9[_0x023c('0x19')][_0x023c('0x1c')]||null:null,'include':_0x1d0ff9[_0x023c('0x19')]?_0x1d0ff9[_0x023c('0x19')][_0x023c('0x1d')]?_[_0x023c('0x1e')](_0x1d0ff9[_0x023c('0x19')][_0x023c('0x1d')],function(_0x548af6){return{'model':db[_0x548af6['model']],'as':_0x548af6['as'],'attributes':_0x548af6[_0x023c('0x1b')],'include':_0x548af6[_0x023c('0x1d')]?_[_0x023c('0x1e')](_0x548af6[_0x023c('0x1d')],function(_0x9ea740){return{'model':db[_0x9ea740[_0x023c('0x1f')]],'as':_0x9ea740['as'],'attributes':_0x9ea740[_0x023c('0x1b')],'include':_0x9ea740[_0x023c('0x1d')]?_[_0x023c('0x1e')](_0x9ea740[_0x023c('0x1d')],function(_0x105445){return{'model':db[_0x105445[_0x023c('0x1f')]],'as':_0x105445['as'],'attributes':_0x105445[_0x023c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d651a){logger[_0x023c('0x20')]('GetFaxAccount',_0x1d0ff9);logger['debug'](_0x023c('0x18'),_0x1d0ff9,JSON['stringify'](_0x4d651a));_0x2e5a53(_0x4d651a);})['catch'](function(_0x35aa3d){logger['error'](_0x023c('0x18'),_0x35aa3d[_0x023c('0x15')],_0x1d0ff9);_0x3cf305(_0x5bc7b5[_0x023c('0x13')](0x1f4,_0x35aa3d[_0x023c('0x15')]));});});};exports[_0x023c('0x21')]=function(_0x4bda6b,_0x3672e4,_0x55433f){var _0x3d3928=this;return new Promise(function(_0x31b4d2,_0x9a3f6b){var _0x2f1932={'body':_0x4bda6b['body'],'channel':'fax'};var _0x26f912=[];var _0x4f9dbc=[];var _0x31ca21={};return db['CmContact'][_0x023c('0x22')]()[_0x023c('0xe')](function(_0x2236c6){if(!_0x2236c6){throw new db['Sequelize']['ValidationError'](_0x023c('0x23'));}_0x26f912=_[_0x023c('0x24')](_[_0x023c('0x25')](_0x2236c6),[_0x023c('0x26'),'updatedAt']);_0x4f9dbc=_[_0x023c('0x24')](_[_0x023c('0x25')](_0x2236c6),[_0x023c('0x26'),_0x023c('0x27'),_0x023c('0x28'),_0x023c('0x29')]);if(_0x4bda6b[_0x023c('0x2a')]['id']){delete _0x4bda6b[_0x023c('0x2a')]['id'];}if(_[_0x023c('0x2b')](_0x4bda6b[_0x023c('0x2a')][_0x023c('0x2c')])){throw new db['Sequelize'][(_0x023c('0x2d'))](_0x023c('0x2e'));}if(_[_0x023c('0x2b')](_0x4bda6b['body'][_0x023c('0x2a')])||_0x4bda6b['body'][_0x023c('0x2a')]===''){throw new db[(_0x023c('0x2f'))][(_0x023c('0x2d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x023c('0x2b')](_0x4bda6b['body'][_0x023c('0x30')])){throw new db[(_0x023c('0x2f'))][(_0x023c('0x2d'))](_0x023c('0x31')+_0x4f9dbc);}if(!_[_0x023c('0x32')](_0x4f9dbc,_0x4bda6b[_0x023c('0x2a')][_0x023c('0x30')])){throw new db[(_0x023c('0x2f'))][(_0x023c('0x2d'))](_0x023c('0x33')+_0x4f9dbc);}_0x31ca21[_0x4bda6b[_0x023c('0x2a')][_0x023c('0x30')]]=_0x4bda6b['body'][_0x023c('0x2c')];})[_0x023c('0xe')](function(){return db[_0x023c('0x34')][_0x023c('0x35')]({'where':{'id':_0x4bda6b[_0x023c('0x36')]['id']},'include':[{'model':db[_0x023c('0x37')],'as':'List','include':[{'model':db[_0x023c('0x38')],'as':_0x023c('0x39'),'where':_0x31ca21,'limit':0x1,'order':[[_0x023c('0x27'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0x023c('0x3a')}]});})[_0x023c('0xe')](function(_0x3a60ec){if(_0x3a60ec&&_0x3a60ec[_0x023c('0x3b')]){var _0x548938=_0x3a60ec[_0x023c('0x3c')]({'plain':!![]});_0x2f1932[_0x023c('0x36')]=_0x548938;_0x2f1932[_0x023c('0x3d')]=_0x548938[_0x023c('0x3a')];_0x2f1932['list']=_0x548938[_0x023c('0x3b')];_0x2f1932['applications']=_['orderBy'](_0x2f1932['applications'],[_0x023c('0x3e')],[_0x023c('0x3f')]);if(_0x2f1932[_0x023c('0x36')][_0x023c('0x3a')]){delete _0x2f1932['account'][_0x023c('0x3a')];}if(_0x2f1932['account'][_0x023c('0x3b')]&&_0x2f1932[_0x023c('0x36')][_0x023c('0x3b')][_0x023c('0x39')][_0x023c('0x40')]){return _0x2f1932[_0x023c('0x36')]['List'][_0x023c('0x39')][0x0];}var _0x13d9bf=_[_0x023c('0xa')](_0x4bda6b[_0x023c('0x2a')],{'firstName':_0x4bda6b[_0x023c('0x2a')][_0x023c('0x2c')],'ListId':_0x548938[_0x023c('0x29')]});_0x13d9bf[_0x4bda6b[_0x023c('0x2a')][_0x023c('0x30')]]=_0x4bda6b[_0x023c('0x2a')]['from'];return db[_0x023c('0x38')][_0x023c('0x41')](_0x13d9bf,{'fields':_0x26f912,'raw':!![]});}})[_0x023c('0xe')](function(_0x29fec5){_0x2f1932[_0x023c('0x42')]=_0x29fec5;if(_0x29fec5){var _0x109802={'ContactId':_0x29fec5['id'],'FaxAccountId':_0x4bda6b[_0x023c('0x36')]['id'],'fax':_0x29fec5[_0x023c('0x43')]};return db[_0x023c('0x44')]['find']({'where':{'ContactId':_0x29fec5['id'],'closed':![],'FaxAccountId':_0x4bda6b[_0x023c('0x36')]['id']}})['then'](function(_0x156423){if(_0x156423){return[_0x156423,![]];}return db[_0x023c('0x44')][_0x023c('0x41')](_0x109802)['then'](function(_0x5960e9){return[_0x5960e9,!![]];});});}else{throw new Error(_0x023c('0x45'));}})[_0x023c('0x46')](function(_0x3111da,_0x5215d6){var _0x12b10e=_0x3111da['get']({'plain':!![]});if(_0x5215d6){if(_0x2f1932[_0x023c('0x36')][_0x023c('0x47')]){_0x2f1932[_0x023c('0x3d')][_0x023c('0x48')]({'id':0x0,'priority':_0x2f1932['applications']['length']+0x1,'app':'close','appdata':_0x023c('0x49'),'interval':_0x023c('0x4a')});}_0x12b10e['created']=!![];}else{_0x12b10e[_0x023c('0x4b')]=![];}_0x2f1932['interaction']=_0x12b10e;return db[_0x023c('0x4c')][_0x023c('0x41')]({'body':_0x4bda6b[_0x023c('0x2a')][_0x023c('0x2a')],'FaxAccountId':_0x4bda6b[_0x023c('0x36')]['id'],'FaxInteractionId':_0x3111da['id'],'direction':'in','ContactId':_0x3111da[_0x023c('0x4d')],'AttachmentId':_0x4bda6b['body'][_0x023c('0x4e')]});})['then'](function(_0x9ff191){_0x2f1932[_0x023c('0x15')]=_0x9ff191;if(_0x2f1932[_0x023c('0x4f')][_0x023c('0x50')]){return db[_0x023c('0x51')][_0x023c('0x35')]({'attributes':['id','name'],'where':{'id':_0x2f1932[_0x023c('0x4f')][_0x023c('0x50')]}})[_0x023c('0xe')](function(_0x502b79){if(_0x502b79){_0x2f1932[_0x023c('0x3d')][_0x023c('0x52')]({'id':0x0,'priority':0x0,'app':_0x023c('0x53'),'appdata':_0x502b79[_0x023c('0x54')]+','+(_0x2f1932['account'][_0x023c('0x55')]||0xa),'interval':_0x023c('0x4a')});}return respondWithRpcPromise(_0x023c('0x56'),'startRouting',_0x2f1932);});}return respondWithRpcPromise(_0x023c('0x56'),_0x023c('0x57'),_0x2f1932);})[_0x023c('0xe')](function(_0x44741f){_0x31b4d2(_0x44741f);})[_0x023c('0x17')](function(_0x13e1d2){_0x9a3f6b(_0x3d3928[_0x023c('0x13')](0x1f4,_0x13e1d2[_0x023c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 6c592a8..7d72138 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 _0x3cce=['length','faxAccount:','remove','update','register'];(function(_0x44d902,_0x376b4e){var _0x27aa72=function(_0x5059fd){while(--_0x5059fd){_0x44d902['push'](_0x44d902['shift']());}};_0x27aa72(++_0x376b4e);}(_0x3cce,0x1dd));var _0xe3cc=function(_0x4f2c90,_0x9f453a){_0x4f2c90=_0x4f2c90-0x0;var _0x119aa1=_0x3cce[_0x4f2c90];return _0x119aa1;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save',_0xe3cc('0x0'),_0xe3cc('0x1')];function createListener(_0x4cc90f,_0x78df27){return function(_0x2208c9){_0x78df27['emit'](_0x4cc90f,_0x2208c9);};}function removeListener(_0x128c09,_0x28263a){return function(){FaxAccountEvents['removeListener'](_0x128c09,_0x28263a);};}exports[_0xe3cc('0x2')]=function(_0x516927){for(var _0xb467b1=0x0,_0x21262b=events[_0xe3cc('0x3')];_0xb467b1<_0x21262b;_0xb467b1++){var _0x4ba0a3=events[_0xb467b1];var _0x443d8c=createListener(_0xe3cc('0x4')+_0x4ba0a3,_0x516927);FaxAccountEvents['on'](_0x4ba0a3,_0x443d8c);}}; \ No newline at end of file +var _0xe667=['./faxAccount.events','remove','update','emit','removeListener','register','faxAccount:'];(function(_0x1dae10,_0x270675){var _0x2409c3=function(_0x1e1451){while(--_0x1e1451){_0x1dae10['push'](_0x1dae10['shift']());}};_0x2409c3(++_0x270675);}(_0xe667,0x11f));var _0x7e66=function(_0x3cbef2,_0x49472b){_0x3cbef2=_0x3cbef2-0x0;var _0x1cbb27=_0xe667[_0x3cbef2];return _0x1cbb27;};'use strict';var FaxAccountEvents=require(_0x7e66('0x0'));var events=['save',_0x7e66('0x1'),_0x7e66('0x2')];function createListener(_0x105805,_0x3827fb){return function(_0x125a28){_0x3827fb[_0x7e66('0x3')](_0x105805,_0x125a28);};}function removeListener(_0x32e4b6,_0x30a799){return function(){FaxAccountEvents[_0x7e66('0x4')](_0x32e4b6,_0x30a799);};}exports[_0x7e66('0x5')]=function(_0x80b3d7){for(var _0x4f1e88=0x0,_0x126b1c=events['length'];_0x4f1e88<_0x126b1c;_0x4f1e88++){var _0x43cf33=events[_0x4f1e88];var _0x1e2564=createListener(_0x7e66('0x6')+_0x43cf33,_0x80b3d7);FaxAccountEvents['on'](_0x43cf33,_0x1e2564);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 46dab7e..eca4967 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(_0x4e1235,_0x17d5fc){var _0x592211=function(_0x4f3240){while(--_0x4f3240){_0x4e1235['push'](_0x4e1235['shift']());}};_0x592211(++_0x17d5fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0x32b09a,_0x426696){var _0x1a543e=function(_0xf8e0c){while(--_0xf8e0c){_0x32b09a['push'](_0x32b09a['shift']());}};_0x1a543e(++_0x426696);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 be72fa6..57d8eb8 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 _0x5f4e=['sequelize','STRING','noop','*,*,*,*'];(function(_0x82be27,_0x4c49b3){var _0x4e3785=function(_0x31996a){while(--_0x31996a){_0x82be27['push'](_0x82be27['shift']());}};_0x4e3785(++_0x4c49b3);}(_0x5f4e,0x190));var _0xe5f4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f4e[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xe5f4('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe5f4('0x1')],'allowNull':![],'defaultValue':_0xe5f4('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe5f4('0x1')]},'interval':{'type':Sequelize[_0xe5f4('0x1')],'defaultValue':_0xe5f4('0x3')}}; \ No newline at end of file +var _0xe47b=['INTEGER','STRING','noop','TEXT','sequelize','exports'];(function(_0xd2dd55,_0x5d6a8b){var _0x337a0f=function(_0x1b57d5){while(--_0x1b57d5){_0xd2dd55['push'](_0xd2dd55['shift']());}};_0x337a0f(++_0x5d6a8b);}(_0xe47b,0x12a));var _0xbe47=function(_0x1be333,_0x506f5b){_0x1be333=_0x1be333-0x0;var _0x3fd973=_0xe47b[_0x1be333];return _0x3fd973;};'use strict';var Sequelize=require(_0xbe47('0x0'));module[_0xbe47('0x1')]={'priority':{'type':Sequelize[_0xbe47('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbe47('0x3')],'allowNull':![],'defaultValue':_0xbe47('0x4')},'appdata':{'type':Sequelize[_0xbe47('0x5')]()},'description':{'type':Sequelize[_0xbe47('0x3')]},'interval':{'type':Sequelize[_0xbe47('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index be7ae6e..dbf9ee5 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 _0xd745=['fieldName','type','key','model','query','filters','intersection','fields','attributes','sort','where','filter','merge','VIRTUAL','options','FaxApplication','includeAll','include','rows','catch','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes'];(function(_0x474791,_0x3a2e1a){var _0x20cca5=function(_0x321c1b){while(--_0x321c1b){_0x474791['push'](_0x474791['shift']());}};_0x20cca5(++_0x3a2e1a);}(_0xd745,0x177));var _0x5d74=function(_0xbc1941,_0x4567cf){_0xbc1941=_0xbc1941-0x0;var _0x3e0b67=_0xd745[_0xbc1941];return _0x3e0b67;};'use strict';var emlformat=require(_0x5d74('0x0'));var rimraf=require(_0x5d74('0x1'));var zipdir=require(_0x5d74('0x2'));var jsonpatch=require(_0x5d74('0x3'));var rp=require(_0x5d74('0x4'));var moment=require(_0x5d74('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5d74('0x6'));var util=require(_0x5d74('0x7'));var path=require('path');var sox=require(_0x5d74('0x8'));var csv=require(_0x5d74('0x9'));var ejs=require(_0x5d74('0xa'));var fs=require('fs');var fs_extra=require(_0x5d74('0xb'));var _=require(_0x5d74('0xc'));var squel=require(_0x5d74('0xd'));var crypto=require('crypto');var jsforce=require(_0x5d74('0xe'));var deskjs=require(_0x5d74('0xf'));var toCsv=require(_0x5d74('0x9'));var querystring=require(_0x5d74('0x10'));var Papa=require(_0x5d74('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5d74('0x12'));var hardwareService=require(_0x5d74('0x13'));var logger=require(_0x5d74('0x14'))(_0x5d74('0x15'));var utils=require(_0x5d74('0x16'));var config=require(_0x5d74('0x17'));var licenseUtil=require(_0x5d74('0x18'));var db=require(_0x5d74('0x19'))['db'];function respondWithStatusCode(_0x538541,_0x4ece71){_0x4ece71=_0x4ece71||0xcc;return function(_0x39d9d0){if(_0x39d9d0){return _0x538541['sendStatus'](_0x4ece71);}return _0x538541[_0x5d74('0x1a')](_0x4ece71)[_0x5d74('0x1b')]();};}function respondWithResult(_0x30301e,_0x108475){_0x108475=_0x108475||0xc8;return function(_0x5aef31){if(_0x5aef31){return _0x30301e[_0x5d74('0x1a')](_0x108475)[_0x5d74('0x1c')](_0x5aef31);}};}function respondWithFilteredResult(_0x51f7d5,_0x20961e){return function(_0x23d2d8){if(_0x23d2d8){var _0x27cc6f=typeof _0x20961e[_0x5d74('0x1d')]===_0x5d74('0x1e')&&typeof _0x20961e[_0x5d74('0x1f')]===_0x5d74('0x1e');var _0x274117=_0x23d2d8[_0x5d74('0x20')];var _0x3f3835=_0x27cc6f?0x0:_0x20961e[_0x5d74('0x1d')];var _0x1f5833=_0x27cc6f?_0x23d2d8[_0x5d74('0x20')]:_0x20961e['offset']+_0x20961e['limit'];var _0x5ed6ce;if(_0x1f5833>=_0x274117){_0x1f5833=_0x274117;_0x5ed6ce=0xc8;}else{_0x5ed6ce=0xce;}_0x51f7d5[_0x5d74('0x1a')](_0x5ed6ce);return _0x51f7d5['set'](_0x5d74('0x21'),_0x3f3835+'-'+_0x1f5833+'/'+_0x274117)[_0x5d74('0x1c')](_0x23d2d8);}return null;};}function patchUpdates(_0x4fe467){return function(_0x275963){try{jsonpatch[_0x5d74('0x22')](_0x275963,_0x4fe467,!![]);}catch(_0x498928){return BPromise[_0x5d74('0x23')](_0x498928);}return _0x275963[_0x5d74('0x24')]();};}function saveUpdates(_0x26c289,_0x517799){return function(_0x4ef493){if(_0x4ef493){return _0x4ef493[_0x5d74('0x25')](_0x26c289)[_0x5d74('0x26')](function(_0x592209){return _0x592209;});}return null;};}function removeEntity(_0x184a97,_0x32b3c5){return function(_0x2d599f){if(_0x2d599f){return _0x2d599f[_0x5d74('0x27')]()['then'](function(){_0x184a97[_0x5d74('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x493cdf,_0x331e55){return function(_0x1c2807){if(!_0x1c2807){_0x493cdf['sendStatus'](0x194);}return _0x1c2807;};}function handleError(_0x446736,_0x2b8d86){_0x2b8d86=_0x2b8d86||0x1f4;return function(_0x56f970){logger['error'](_0x56f970[_0x5d74('0x28')]);if(_0x56f970[_0x5d74('0x29')]){delete _0x56f970['name'];}_0x446736['status'](_0x2b8d86)['send'](_0x56f970);};}exports[_0x5d74('0x2a')]=function(_0x221484,_0x1ca1f5){var _0x2c7549={},_0x280108={},_0x5d4920={'count':0x0,'rows':[]};var _0x9b0ba6=_[_0x5d74('0x2b')](db['FaxApplication'][_0x5d74('0x2c')],function(_0x1a18eb){return{'name':_0x1a18eb[_0x5d74('0x2d')],'type':_0x1a18eb[_0x5d74('0x2e')][_0x5d74('0x2f')]};});_0x280108[_0x5d74('0x30')]=_[_0x5d74('0x2b')](_0x9b0ba6,_0x5d74('0x29'));_0x280108[_0x5d74('0x31')]=_['keys'](_0x221484['query']);_0x280108[_0x5d74('0x32')]=_[_0x5d74('0x33')](_0x280108[_0x5d74('0x30')],_0x280108['query']);_0x2c7549['attributes']=_[_0x5d74('0x33')](_0x280108[_0x5d74('0x30')],qs['fields'](_0x221484[_0x5d74('0x31')][_0x5d74('0x34')]));_0x2c7549[_0x5d74('0x35')]=_0x2c7549[_0x5d74('0x35')]['length']?_0x2c7549[_0x5d74('0x35')]:_0x280108[_0x5d74('0x30')];if(!_0x221484[_0x5d74('0x31')]['hasOwnProperty']('nolimit')){_0x2c7549['limit']=qs[_0x5d74('0x1f')](_0x221484[_0x5d74('0x31')]['limit']);_0x2c7549['offset']=qs[_0x5d74('0x1d')](_0x221484['query']['offset']);}_0x2c7549['order']=qs['sort'](_0x221484[_0x5d74('0x31')][_0x5d74('0x36')]);_0x2c7549[_0x5d74('0x37')]=qs[_0x5d74('0x32')](_['pick'](_0x221484['query'],_0x280108[_0x5d74('0x32')]),_0x9b0ba6);if(_0x221484[_0x5d74('0x31')][_0x5d74('0x38')]){_0x2c7549[_0x5d74('0x37')]=_[_0x5d74('0x39')](_0x2c7549[_0x5d74('0x37')],{'$or':_[_0x5d74('0x2b')](_0x9b0ba6,function(_0x4ddd0f){if(_0x4ddd0f['type']!==_0x5d74('0x3a')){var _0x3b0c64={};_0x3b0c64[_0x4ddd0f['name']]={'$like':'%'+_0x221484['query'][_0x5d74('0x38')]+'%'};return _0x3b0c64;}})});}_0x2c7549=_['merge']({},_0x2c7549,_0x221484[_0x5d74('0x3b')]);var _0x566ab5={'where':_0x2c7549[_0x5d74('0x37')]};return db[_0x5d74('0x3c')][_0x5d74('0x20')](_0x566ab5)['then'](function(_0x5c9342){_0x5d4920[_0x5d74('0x20')]=_0x5c9342;if(_0x221484['query'][_0x5d74('0x3d')]){_0x2c7549[_0x5d74('0x3e')]=[{'all':!![]}];}return db[_0x5d74('0x3c')]['findAll'](_0x2c7549);})['then'](function(_0x12dc7a){_0x5d4920[_0x5d74('0x3f')]=_0x12dc7a;return _0x5d4920;})[_0x5d74('0x26')](respondWithFilteredResult(_0x1ca1f5,_0x2c7549))[_0x5d74('0x40')](handleError(_0x1ca1f5,null));};exports['show']=function(_0x4fe978,_0x1eecb1){var _0x1efd1a={'raw':!![],'where':{'id':_0x4fe978['params']['id']}},_0x5e49f8={};_0x5e49f8[_0x5d74('0x30')]=_['keys'](db['FaxApplication'][_0x5d74('0x2c')]);_0x5e49f8[_0x5d74('0x31')]=_['keys'](_0x4fe978[_0x5d74('0x31')]);_0x5e49f8[_0x5d74('0x32')]=_[_0x5d74('0x33')](_0x5e49f8[_0x5d74('0x30')],_0x5e49f8[_0x5d74('0x31')]);_0x1efd1a[_0x5d74('0x35')]=_[_0x5d74('0x33')](_0x5e49f8[_0x5d74('0x30')],qs['fields'](_0x4fe978[_0x5d74('0x31')][_0x5d74('0x34')]));_0x1efd1a[_0x5d74('0x35')]=_0x1efd1a[_0x5d74('0x35')][_0x5d74('0x41')]?_0x1efd1a[_0x5d74('0x35')]:_0x5e49f8[_0x5d74('0x30')];if(_0x4fe978[_0x5d74('0x31')][_0x5d74('0x3d')]){_0x1efd1a[_0x5d74('0x3e')]=[{'all':!![]}];}_0x1efd1a=_[_0x5d74('0x39')]({},_0x1efd1a,_0x4fe978[_0x5d74('0x3b')]);return db[_0x5d74('0x3c')][_0x5d74('0x42')](_0x1efd1a)['then'](handleEntityNotFound(_0x1eecb1,null))[_0x5d74('0x26')](respondWithResult(_0x1eecb1,null))['catch'](handleError(_0x1eecb1,null));};exports['create']=function(_0x4e10b2,_0x5b222d){return db[_0x5d74('0x3c')][_0x5d74('0x43')](_0x4e10b2[_0x5d74('0x44')],{})['then'](respondWithResult(_0x5b222d,0xc9))[_0x5d74('0x40')](handleError(_0x5b222d,null));};exports['update']=function(_0x5f31af,_0x268be1){if(_0x5f31af[_0x5d74('0x44')]['id']){delete _0x5f31af[_0x5d74('0x44')]['id'];}return db[_0x5d74('0x3c')][_0x5d74('0x42')]({'where':{'id':_0x5f31af['params']['id']}})['then'](handleEntityNotFound(_0x268be1,null))[_0x5d74('0x26')](saveUpdates(_0x5f31af['body'],null))['then'](respondWithResult(_0x268be1,null))[_0x5d74('0x40')](handleError(_0x268be1,null));};exports[_0x5d74('0x27')]=function(_0x2e7270,_0x19d2d0){return db[_0x5d74('0x3c')][_0x5d74('0x42')]({'where':{'id':_0x2e7270[_0x5d74('0x45')]['id']}})['then'](handleEntityNotFound(_0x19d2d0,null))[_0x5d74('0x26')](removeEntity(_0x19d2d0,null))[_0x5d74('0x40')](handleError(_0x19d2d0,null));}; \ No newline at end of file +var _0xb040=['model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','show','params','keys','intersection','includeAll','include','options','catch','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','update','then','destroy','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key'];(function(_0x526298,_0x2ec3ba){var _0x467835=function(_0x32d027){while(--_0x32d027){_0x526298['push'](_0x526298['shift']());}};_0x467835(++_0x2ec3ba);}(_0xb040,0xae));var _0x0b04=function(_0xc6b3bd,_0x37a0f3){_0xc6b3bd=_0xc6b3bd-0x0;var _0x44f20d=_0xb040[_0xc6b3bd];return _0x44f20d;};'use strict';var emlformat=require(_0x0b04('0x0'));var rimraf=require(_0x0b04('0x1'));var zipdir=require(_0x0b04('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0b04('0x3'));var BPromise=require(_0x0b04('0x4'));var Mustache=require(_0x0b04('0x5'));var util=require('util');var path=require(_0x0b04('0x6'));var sox=require('sox');var csv=require(_0x0b04('0x7'));var ejs=require(_0x0b04('0x8'));var fs=require('fs');var fs_extra=require(_0x0b04('0x9'));var _=require(_0x0b04('0xa'));var squel=require(_0x0b04('0xb'));var crypto=require(_0x0b04('0xc'));var jsforce=require(_0x0b04('0xd'));var deskjs=require(_0x0b04('0xe'));var toCsv=require(_0x0b04('0x7'));var querystring=require(_0x0b04('0xf'));var Papa=require('papaparse');var Redis=require(_0x0b04('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0b04('0x11'));var as=require(_0x0b04('0x12'));var hardwareService=require(_0x0b04('0x13'));var logger=require('../../config/logger')(_0x0b04('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0b04('0x15'));var db=require(_0x0b04('0x16'))['db'];function respondWithStatusCode(_0x1ee792,_0x95abf9){_0x95abf9=_0x95abf9||0xcc;return function(_0x3d7a0d){if(_0x3d7a0d){return _0x1ee792[_0x0b04('0x17')](_0x95abf9);}return _0x1ee792[_0x0b04('0x18')](_0x95abf9)[_0x0b04('0x19')]();};}function respondWithResult(_0x75d1b2,_0x5a2335){_0x5a2335=_0x5a2335||0xc8;return function(_0x4f1f1e){if(_0x4f1f1e){return _0x75d1b2[_0x0b04('0x18')](_0x5a2335)['json'](_0x4f1f1e);}};}function respondWithFilteredResult(_0x582ad1,_0x1f1fe0){return function(_0x19f0ac){if(_0x19f0ac){var _0x2632a1=typeof _0x1f1fe0['offset']===_0x0b04('0x1a')&&typeof _0x1f1fe0[_0x0b04('0x1b')]===_0x0b04('0x1a');var _0xae4063=_0x19f0ac['count'];var _0x4d1492=_0x2632a1?0x0:_0x1f1fe0[_0x0b04('0x1c')];var _0x6ef482=_0x2632a1?_0x19f0ac[_0x0b04('0x1d')]:_0x1f1fe0['offset']+_0x1f1fe0[_0x0b04('0x1b')];var _0x319ea8;if(_0x6ef482>=_0xae4063){_0x6ef482=_0xae4063;_0x319ea8=0xc8;}else{_0x319ea8=0xce;}_0x582ad1[_0x0b04('0x18')](_0x319ea8);return _0x582ad1['set'](_0x0b04('0x1e'),_0x4d1492+'-'+_0x6ef482+'/'+_0xae4063)[_0x0b04('0x1f')](_0x19f0ac);}return null;};}function patchUpdates(_0x40cbad){return function(_0x5515b4){try{jsonpatch['apply'](_0x5515b4,_0x40cbad,!![]);}catch(_0x58df62){return BPromise['reject'](_0x58df62);}return _0x5515b4['save']();};}function saveUpdates(_0x1222e5,_0x4487a6){return function(_0x400186){if(_0x400186){return _0x400186[_0x0b04('0x20')](_0x1222e5)[_0x0b04('0x21')](function(_0x5a7454){return _0x5a7454;});}return null;};}function removeEntity(_0x543c1b,_0x5b149d){return function(_0x4da9d6){if(_0x4da9d6){return _0x4da9d6[_0x0b04('0x22')]()[_0x0b04('0x21')](function(){_0x543c1b[_0x0b04('0x18')](0xcc)[_0x0b04('0x19')]();});}};}function handleEntityNotFound(_0x33f88e,_0x14a4c2){return function(_0x3ab30a){if(!_0x3ab30a){_0x33f88e['sendStatus'](0x194);}return _0x3ab30a;};}function handleError(_0xdf7f48,_0x4ff4f9){_0x4ff4f9=_0x4ff4f9||0x1f4;return function(_0x3e5c35){logger['error'](_0x3e5c35[_0x0b04('0x23')]);if(_0x3e5c35[_0x0b04('0x24')]){delete _0x3e5c35[_0x0b04('0x24')];}_0xdf7f48[_0x0b04('0x18')](_0x4ff4f9)[_0x0b04('0x25')](_0x3e5c35);};}exports[_0x0b04('0x26')]=function(_0x439bc5,_0x5207b8){var _0x4474f2={},_0x37c892={},_0x28a311={'count':0x0,'rows':[]};var _0x3a50ca=_[_0x0b04('0x27')](db[_0x0b04('0x28')][_0x0b04('0x29')],function(_0x1019db){return{'name':_0x1019db[_0x0b04('0x2a')],'type':_0x1019db[_0x0b04('0x2b')][_0x0b04('0x2c')]};});_0x37c892[_0x0b04('0x2d')]=_[_0x0b04('0x27')](_0x3a50ca,_0x0b04('0x24'));_0x37c892['query']=_['keys'](_0x439bc5[_0x0b04('0x2e')]);_0x37c892[_0x0b04('0x2f')]=_['intersection'](_0x37c892[_0x0b04('0x2d')],_0x37c892['query']);_0x4474f2[_0x0b04('0x30')]=_['intersection'](_0x37c892[_0x0b04('0x2d')],qs[_0x0b04('0x31')](_0x439bc5['query']['fields']));_0x4474f2[_0x0b04('0x30')]=_0x4474f2[_0x0b04('0x30')][_0x0b04('0x32')]?_0x4474f2[_0x0b04('0x30')]:_0x37c892['model'];if(!_0x439bc5[_0x0b04('0x2e')][_0x0b04('0x33')](_0x0b04('0x34'))){_0x4474f2[_0x0b04('0x1b')]=qs[_0x0b04('0x1b')](_0x439bc5[_0x0b04('0x2e')][_0x0b04('0x1b')]);_0x4474f2[_0x0b04('0x1c')]=qs[_0x0b04('0x1c')](_0x439bc5[_0x0b04('0x2e')][_0x0b04('0x1c')]);}_0x4474f2[_0x0b04('0x35')]=qs[_0x0b04('0x36')](_0x439bc5[_0x0b04('0x2e')][_0x0b04('0x36')]);_0x4474f2[_0x0b04('0x37')]=qs[_0x0b04('0x2f')](_[_0x0b04('0x38')](_0x439bc5[_0x0b04('0x2e')],_0x37c892[_0x0b04('0x2f')]),_0x3a50ca);if(_0x439bc5[_0x0b04('0x2e')]['filter']){_0x4474f2[_0x0b04('0x37')]=_[_0x0b04('0x39')](_0x4474f2[_0x0b04('0x37')],{'$or':_['map'](_0x3a50ca,function(_0x3d5ab9){if(_0x3d5ab9[_0x0b04('0x2b')]!==_0x0b04('0x3a')){var _0x4f4452={};_0x4f4452[_0x3d5ab9[_0x0b04('0x24')]]={'$like':'%'+_0x439bc5[_0x0b04('0x2e')][_0x0b04('0x3b')]+'%'};return _0x4f4452;}})});}_0x4474f2=_[_0x0b04('0x39')]({},_0x4474f2,_0x439bc5['options']);var _0x17eab0={'where':_0x4474f2[_0x0b04('0x37')]};return db[_0x0b04('0x28')]['count'](_0x17eab0)[_0x0b04('0x21')](function(_0x5f5c2b){_0x28a311[_0x0b04('0x1d')]=_0x5f5c2b;if(_0x439bc5[_0x0b04('0x2e')]['includeAll']){_0x4474f2['include']=[{'all':!![]}];}return db['FaxApplication'][_0x0b04('0x3c')](_0x4474f2);})[_0x0b04('0x21')](function(_0x20ed3e){_0x28a311[_0x0b04('0x3d')]=_0x20ed3e;return _0x28a311;})[_0x0b04('0x21')](respondWithFilteredResult(_0x5207b8,_0x4474f2))['catch'](handleError(_0x5207b8,null));};exports[_0x0b04('0x3e')]=function(_0x4e766e,_0x2b622e){var _0x729cf={'raw':!![],'where':{'id':_0x4e766e[_0x0b04('0x3f')]['id']}},_0x32d96f={};_0x32d96f['model']=_[_0x0b04('0x40')](db[_0x0b04('0x28')][_0x0b04('0x29')]);_0x32d96f[_0x0b04('0x2e')]=_[_0x0b04('0x40')](_0x4e766e[_0x0b04('0x2e')]);_0x32d96f['filters']=_[_0x0b04('0x41')](_0x32d96f[_0x0b04('0x2d')],_0x32d96f['query']);_0x729cf[_0x0b04('0x30')]=_['intersection'](_0x32d96f[_0x0b04('0x2d')],qs[_0x0b04('0x31')](_0x4e766e[_0x0b04('0x2e')]['fields']));_0x729cf[_0x0b04('0x30')]=_0x729cf[_0x0b04('0x30')][_0x0b04('0x32')]?_0x729cf[_0x0b04('0x30')]:_0x32d96f[_0x0b04('0x2d')];if(_0x4e766e[_0x0b04('0x2e')][_0x0b04('0x42')]){_0x729cf[_0x0b04('0x43')]=[{'all':!![]}];}_0x729cf=_[_0x0b04('0x39')]({},_0x729cf,_0x4e766e[_0x0b04('0x44')]);return db[_0x0b04('0x28')]['find'](_0x729cf)[_0x0b04('0x21')](handleEntityNotFound(_0x2b622e,null))[_0x0b04('0x21')](respondWithResult(_0x2b622e,null))[_0x0b04('0x45')](handleError(_0x2b622e,null));};exports[_0x0b04('0x46')]=function(_0x32e163,_0x2aa9e1){return db[_0x0b04('0x28')]['create'](_0x32e163[_0x0b04('0x47')],{})[_0x0b04('0x21')](respondWithResult(_0x2aa9e1,0xc9))[_0x0b04('0x45')](handleError(_0x2aa9e1,null));};exports['update']=function(_0x3bd764,_0x1124c1){if(_0x3bd764[_0x0b04('0x47')]['id']){delete _0x3bd764[_0x0b04('0x47')]['id'];}return db[_0x0b04('0x28')][_0x0b04('0x48')]({'where':{'id':_0x3bd764[_0x0b04('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1124c1,null))[_0x0b04('0x21')](saveUpdates(_0x3bd764[_0x0b04('0x47')],null))[_0x0b04('0x21')](respondWithResult(_0x1124c1,null))[_0x0b04('0x45')](handleError(_0x1124c1,null));};exports[_0x0b04('0x22')]=function(_0x351745,_0x42d1ea){return db['FaxApplication']['find']({'where':{'id':_0x351745['params']['id']}})[_0x0b04('0x21')](handleEntityNotFound(_0x42d1ea,null))['then'](removeEntity(_0x42d1ea,null))[_0x0b04('0x45')](handleError(_0x42d1ea,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 00f89b1..7c16db9 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 _0x11f3=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','moment','bluebird'];(function(_0x1b925b,_0x1ab3c9){var _0x275f07=function(_0x2ffbe4){while(--_0x2ffbe4){_0x1b925b['push'](_0x1b925b['shift']());}};_0x275f07(++_0x1ab3c9);}(_0x11f3,0x9e));var _0x311f=function(_0x21c6f7,_0x4d96ed){_0x21c6f7=_0x21c6f7-0x0;var _0x1051e2=_0x11f3[_0x21c6f7];return _0x1051e2;};'use strict';var _=require(_0x311f('0x0'));var util=require('util');var logger=require(_0x311f('0x1'))('api');var moment=require(_0x311f('0x2'));var BPromise=require(_0x311f('0x3'));var rp=require(_0x311f('0x4'));var fs=require('fs');var path=require(_0x311f('0x5'));var rimraf=require(_0x311f('0x6'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0x311f('0x7')]=function(_0x597595,_0x31da91){return _0x597595[_0x311f('0x8')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9f3e=['exports','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','./faxApplication.attributes'];(function(_0x1b09f9,_0xe493b8){var _0x20a926=function(_0xb68d1e){while(--_0xb68d1e){_0x1b09f9['push'](_0x1b09f9['shift']());}};_0x20a926(++_0xe493b8);}(_0x9f3e,0xa4));var _0xe9f3=function(_0x18cf68,_0x42f9dd){_0x18cf68=_0x18cf68-0x0;var _0x92d350=_0x9f3e[_0x18cf68];return _0x92d350;};'use strict';var _=require('lodash');var util=require(_0xe9f3('0x0'));var logger=require(_0xe9f3('0x1'))(_0xe9f3('0x2'));var moment=require(_0xe9f3('0x3'));var BPromise=require(_0xe9f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe9f3('0x5'));module[_0xe9f3('0x6')]=function(_0x20b66d,_0x1f4709){return _0x20b66d[_0xe9f3('0x7')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe9f3('0x8'),'collate':_0xe9f3('0x9')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 3a502d7..8259e6e 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 _0xea03=['message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0xea03,0xda));var _0x3ea0=function(_0x3abe58,_0x184dd9){_0x3abe58=_0x3abe58-0x0;var _0x457389=_0xea03[_0x3abe58];return _0x457389;};'use strict';var _=require(_0x3ea0('0x0'));var util=require(_0x3ea0('0x1'));var moment=require(_0x3ea0('0x2'));var BPromise=require(_0x3ea0('0x3'));var rs=require(_0x3ea0('0x4'));var fs=require('fs');var Redis=require(_0x3ea0('0x5'));var db=require(_0x3ea0('0x6'))['db'];var utils=require(_0x3ea0('0x7'));var logger=require(_0x3ea0('0x8'))(_0x3ea0('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3ea0('0xa')][_0x3ea0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10b4d8,_0x24b913,_0x2df498){return new BPromise(function(_0x42c52c,_0x3b3515){return client[_0x3ea0('0xc')](_0x10b4d8,_0x2df498)['then'](function(_0x49b85b){logger[_0x3ea0('0xd')](_0x3ea0('0xe'),_0x24b913,_0x3ea0('0xf'));logger[_0x3ea0('0x10')](_0x3ea0('0x11'),_0x24b913,_0x3ea0('0xf'),JSON['stringify'](_0x49b85b));if(_0x49b85b[_0x3ea0('0x12')]){if(_0x49b85b[_0x3ea0('0x12')][_0x3ea0('0x13')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x24b913,_0x49b85b[_0x3ea0('0x12')][_0x3ea0('0x14')]);return _0x3b3515(_0x49b85b[_0x3ea0('0x12')][_0x3ea0('0x14')]);}logger[_0x3ea0('0x12')]('FaxApplication,\x20%s,\x20%s',_0x24b913,_0x49b85b[_0x3ea0('0x12')][_0x3ea0('0x14')]);return _0x42c52c(_0x49b85b[_0x3ea0('0x12')][_0x3ea0('0x14')]);}else{logger[_0x3ea0('0xd')](_0x3ea0('0xe'),_0x24b913,_0x3ea0('0xf'));_0x42c52c(_0x49b85b[_0x3ea0('0x15')][_0x3ea0('0x14')]);}})[_0x3ea0('0x16')](function(_0x1bdea2){logger[_0x3ea0('0x12')](_0x3ea0('0xe'),_0x24b913,_0x1bdea2);_0x3b3515(_0x1bdea2);});});}exports[_0x3ea0('0x17')]=function(_0x28f935){var _0x387762=this;return new Promise(function(_0x2afd5d,_0x11d07f){return db[_0x3ea0('0x18')][_0x3ea0('0x19')](_0x28f935[_0x3ea0('0x1a')],{'raw':_0x28f935[_0x3ea0('0x1b')]?_0x28f935[_0x3ea0('0x1b')][_0x3ea0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28f935[_0x3ea0('0x1b')]?_0x28f935[_0x3ea0('0x1b')][_0x3ea0('0x1d')]||null:null,'attributes':_0x28f935[_0x3ea0('0x1b')]?_0x28f935[_0x3ea0('0x1b')][_0x3ea0('0x1e')]||null:null,'limit':_0x28f935[_0x3ea0('0x1b')]?_0x28f935[_0x3ea0('0x1b')][_0x3ea0('0x1f')]||null:null})[_0x3ea0('0x20')](function(_0x5a3bf7){logger['info'](_0x3ea0('0x17'),_0x28f935);logger[_0x3ea0('0x10')](_0x3ea0('0x17'),_0x28f935,JSON[_0x3ea0('0x21')](_0x5a3bf7));_0x2afd5d(_0x5a3bf7);})[_0x3ea0('0x16')](function(_0xb08aac){logger[_0x3ea0('0x12')]('UpdateFaxApplication',_0xb08aac['message'],_0x28f935);_0x11d07f(_0x387762[_0x3ea0('0x12')](0x1f4,_0xb08aac[_0x3ea0('0x14')]));});});}; \ No newline at end of file +var _0x2547=['error','code','message','result','catch','FaxApplication','body','options','raw','where','attributes','limit','UpdateFaxApplication','stringify','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s'];(function(_0x55b3b5,_0x254983){var _0x5297a9=function(_0x5f302f){while(--_0x5f302f){_0x55b3b5['push'](_0x55b3b5['shift']());}};_0x5297a9(++_0x254983);}(_0x2547,0x86));var _0x7254=function(_0xf54d30,_0x4d6653){_0xf54d30=_0xf54d30-0x0;var _0x1ade87=_0x2547[_0xf54d30];return _0x1ade87;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7254('0x1'));var fs=require('fs');var Redis=require(_0x7254('0x2'));var db=require(_0x7254('0x3'))['db'];var utils=require(_0x7254('0x4'));var logger=require('../../config/logger')(_0x7254('0x5'));var config=require(_0x7254('0x6'));var jayson=require(_0x7254('0x7'));var client=jayson[_0x7254('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1609a9,_0x11b581,_0x882eae){return new BPromise(function(_0x330d95,_0x2440ad){return client[_0x7254('0x9')](_0x1609a9,_0x882eae)[_0x7254('0xa')](function(_0x1bb605){logger[_0x7254('0xb')](_0x7254('0xc'),_0x11b581,_0x7254('0xd'));logger[_0x7254('0xe')](_0x7254('0xf'),_0x11b581,_0x7254('0xd'),JSON['stringify'](_0x1bb605));if(_0x1bb605[_0x7254('0x10')]){if(_0x1bb605[_0x7254('0x10')][_0x7254('0x11')]===0x1f4){logger[_0x7254('0x10')]('FaxApplication,\x20%s,\x20%s',_0x11b581,_0x1bb605['error'][_0x7254('0x12')]);return _0x2440ad(_0x1bb605[_0x7254('0x10')][_0x7254('0x12')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x11b581,_0x1bb605['error'][_0x7254('0x12')]);return _0x330d95(_0x1bb605[_0x7254('0x10')][_0x7254('0x12')]);}else{logger['info'](_0x7254('0xc'),_0x11b581,_0x7254('0xd'));_0x330d95(_0x1bb605[_0x7254('0x13')][_0x7254('0x12')]);}})[_0x7254('0x14')](function(_0x598529){logger[_0x7254('0x10')]('FaxApplication,\x20%s,\x20%s',_0x11b581,_0x598529);_0x2440ad(_0x598529);});});}exports['UpdateFaxApplication']=function(_0x4b44ff){var _0x30e020=this;return new Promise(function(_0x264a5b,_0x18c92e){return db[_0x7254('0x15')]['update'](_0x4b44ff[_0x7254('0x16')],{'raw':_0x4b44ff[_0x7254('0x17')]?_0x4b44ff[_0x7254('0x17')][_0x7254('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b44ff['options']?_0x4b44ff[_0x7254('0x17')][_0x7254('0x19')]||null:null,'attributes':_0x4b44ff[_0x7254('0x17')]?_0x4b44ff[_0x7254('0x17')][_0x7254('0x1a')]||null:null,'limit':_0x4b44ff[_0x7254('0x17')]?_0x4b44ff[_0x7254('0x17')][_0x7254('0x1b')]||null:null})[_0x7254('0xa')](function(_0xbebf64){logger['info'](_0x7254('0x1c'),_0x4b44ff);logger[_0x7254('0xe')](_0x7254('0x1c'),_0x4b44ff,JSON[_0x7254('0x1d')](_0xbebf64));_0x264a5b(_0xbebf64);})[_0x7254('0x14')](function(_0x1a6e40){logger['error'](_0x7254('0x1c'),_0x1a6e40[_0x7254('0x12')],_0x4b44ff);_0x18c92e(_0x30e020[_0x7254('0x10')](0x1f4,_0x1a6e40['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index cdd7a8c..9603356 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 _0xdd4f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','express'];(function(_0x108b46,_0x3151cc){var _0x5015a1=function(_0x5edfc6){while(--_0x5edfc6){_0x108b46['push'](_0x108b46['shift']());}};_0x5015a1(++_0x3151cc);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x42aeb5,_0x1fa6a8){_0x42aeb5=_0x42aeb5-0x0;var _0x3745fe=_0xdd4f[_0x42aeb5];return _0x3745fe;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd4('0x1'));var router=express[_0xfdd4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfdd4('0x3'));var interaction=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var controller=require('./faxApplication.controller');router[_0xfdd4('0x6')]('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0x8')]);router[_0xfdd4('0x6')](_0xfdd4('0x9'),auth['isAuthenticated'](),controller[_0xfdd4('0xa')]);router['post']('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xb')]);router[_0xfdd4('0xc')]('/:id',auth[_0xfdd4('0x7')](),controller['update']);router[_0xfdd4('0xd')](_0xfdd4('0x9'),auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xe')]);module[_0xfdd4('0xf')]=router; \ No newline at end of file +var _0xdd4f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','express'];(function(_0x19f1ab,_0x254bcc){var _0xeb7831=function(_0x5b500b){while(--_0x5b500b){_0x19f1ab['push'](_0x19f1ab['shift']());}};_0xeb7831(++_0x254bcc);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x152635,_0x5d6f69){_0x152635=_0x152635-0x0;var _0x1d70e2=_0xdd4f[_0x152635];return _0x1d70e2;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd4('0x1'));var router=express[_0xfdd4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfdd4('0x3'));var interaction=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var controller=require('./faxApplication.controller');router[_0xfdd4('0x6')]('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0x8')]);router[_0xfdd4('0x6')](_0xfdd4('0x9'),auth['isAuthenticated'](),controller[_0xfdd4('0xa')]);router['post']('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xb')]);router[_0xfdd4('0xc')]('/:id',auth[_0xfdd4('0x7')](),controller['update']);router[_0xfdd4('0xd')](_0xfdd4('0x9'),auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xe')]);module[_0xfdd4('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 20538bd..f6ba3ca 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 _0x33b9=['DATE','exports','BOOLEAN','STRING','ENUM','out'];(function(_0x1de7e8,_0x355ee5){var _0x41b9ea=function(_0x4742eb){while(--_0x4742eb){_0x1de7e8['push'](_0x1de7e8['shift']());}};_0x41b9ea(++_0x355ee5);}(_0x33b9,0x17b));var _0x933b=function(_0x44ea4d,_0x54c16a){_0x44ea4d=_0x44ea4d-0x0;var _0x5ed077=_0x33b9[_0x44ea4d];return _0x5ed077;};'use strict';var Sequelize=require('sequelize');module[_0x933b('0x0')]={'closed':{'type':Sequelize[_0x933b('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x933b('0x2')]},'thirdDisposition':{'type':Sequelize[_0x933b('0x2')]},'note':{'type':Sequelize[_0x933b('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x933b('0x3')]('in',_0x933b('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x933b('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x933b('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xd01d=['exports','DATE','STRING','ENUM','out'];(function(_0x499850,_0x6998eb){var _0x5c36f5=function(_0x30122b){while(--_0x30122b){_0x499850['push'](_0x499850['shift']());}};_0x5c36f5(++_0x6998eb);}(_0xd01d,0xbe));var _0xdd01=function(_0x158153,_0x19b757){_0x158153=_0x158153-0x0;var _0x1ec496=_0xd01d[_0x158153];return _0x1ec496;};'use strict';var Sequelize=require('sequelize');module[_0xdd01('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdd01('0x1')]},'disposition':{'type':Sequelize[_0xdd01('0x2')]},'secondDisposition':{'type':Sequelize[_0xdd01('0x2')]},'thirdDisposition':{'type':Sequelize[_0xdd01('0x2')]},'note':{'type':Sequelize[_0xdd01('0x2')]},'read1stAt':{'type':Sequelize[_0xdd01('0x1')]},'fax':{'type':Sequelize[_0xdd01('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xdd01('0x3')]('in',_0xdd01('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdd01('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'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 4aa065f..02b5cef 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 _0x6fa8=['merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','show','includeAll','include','options','update','destroy','params','describe','addMessage','FaxMessage','ids','omit','findOne','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','emit','faxInteractionTags:save','removeTags','download','unix','join','server','files','root','attachments','Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','pipe','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','Tags','TagIds','split','forEach','push','catch','waiting','unmanaged','total','UserId','closed','talking','answered','index','map','FaxInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','u.fullname','ui.FaxInteractionId','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','$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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','buildExpression','body','some','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0x6fa8,0x1e3));var _0x86fa=function(_0x41886e,_0x2f9b3e){_0x41886e=_0x41886e-0x0;var _0x10e7f4=_0x6fa8[_0x41886e];return _0x10e7f4;};'use strict';var emlformat=require(_0x86fa('0x0'));var rimraf=require(_0x86fa('0x1'));var zipdir=require(_0x86fa('0x2'));var jsonpatch=require(_0x86fa('0x3'));var rp=require(_0x86fa('0x4'));var moment=require('moment');var BPromise=require(_0x86fa('0x5'));var Mustache=require('mustache');var util=require(_0x86fa('0x6'));var path=require('path');var sox=require(_0x86fa('0x7'));var csv=require(_0x86fa('0x8'));var ejs=require(_0x86fa('0x9'));var fs=require('fs');var fs_extra=require(_0x86fa('0xa'));var _=require(_0x86fa('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86fa('0xc'));var toCsv=require(_0x86fa('0x8'));var querystring=require(_0x86fa('0xd'));var Papa=require(_0x86fa('0xe'));var Redis=require(_0x86fa('0xf'));var authService=require(_0x86fa('0x10'));var qs=require(_0x86fa('0x11'));var as=require(_0x86fa('0x12'));var hardwareService=require(_0x86fa('0x13'));var logger=require('../../config/logger')(_0x86fa('0x14'));var utils=require(_0x86fa('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x86fa('0x16'));var db=require(_0x86fa('0x17'))['db'];config[_0x86fa('0x18')]=_[_0x86fa('0x19')](config[_0x86fa('0x18')],{'host':_0x86fa('0x1a'),'port':0x18eb});var socket=require(_0x86fa('0x1b'))(new Redis(config[_0x86fa('0x18')]));require('./faxInteraction.socket')[_0x86fa('0x1c')](socket);function respondWithStatusCode(_0x4e3efd,_0x26f8c7){_0x26f8c7=_0x26f8c7||0xcc;return function(_0x1154dc){if(_0x1154dc){return _0x4e3efd[_0x86fa('0x1d')](_0x26f8c7);}return _0x4e3efd[_0x86fa('0x1e')](_0x26f8c7)[_0x86fa('0x1f')]();};}function respondWithResult(_0x31962a,_0x1f5b52){_0x1f5b52=_0x1f5b52||0xc8;return function(_0x23d50d){if(_0x23d50d){return _0x31962a[_0x86fa('0x1e')](_0x1f5b52)[_0x86fa('0x20')](_0x23d50d);}};}function respondWithFilteredResult(_0x1a0e7c,_0x2cf73a){return function(_0x13d039){if(_0x13d039){var _0x200b69=typeof _0x2cf73a[_0x86fa('0x21')]===_0x86fa('0x22')&&typeof _0x2cf73a[_0x86fa('0x23')]==='undefined';var _0x51448b=_0x13d039[_0x86fa('0x24')];var _0x2af8d3=_0x200b69?0x0:_0x2cf73a['offset'];var _0x2fb66c=_0x200b69?_0x13d039['count']:_0x2cf73a[_0x86fa('0x21')]+_0x2cf73a[_0x86fa('0x23')];var _0x20518e;if(_0x2fb66c>=_0x51448b){_0x2fb66c=_0x51448b;_0x20518e=0xc8;}else{_0x20518e=0xce;}_0x1a0e7c[_0x86fa('0x1e')](_0x20518e);return _0x1a0e7c[_0x86fa('0x25')](_0x86fa('0x26'),_0x2af8d3+'-'+_0x2fb66c+'/'+_0x51448b)[_0x86fa('0x20')](_0x13d039);}return null;};}function patchUpdates(_0x1c4c0b){return function(_0x1dedb0){try{jsonpatch[_0x86fa('0x27')](_0x1dedb0,_0x1c4c0b,!![]);}catch(_0x2bb30d){return BPromise[_0x86fa('0x28')](_0x2bb30d);}return _0x1dedb0[_0x86fa('0x29')]();};}function saveUpdates(_0x5acf73,_0xdd10db){return function(_0x2aad8e){if(_0x2aad8e){return _0x2aad8e['update'](_0x5acf73)[_0x86fa('0x2a')](function(_0x1387fb){return _0x1387fb;});}return null;};}function removeEntity(_0x5f33c9,_0x90947e){return function(_0x29253c){if(_0x29253c){return _0x29253c['destroy']()[_0x86fa('0x2a')](function(){_0x5f33c9['status'](0xcc)[_0x86fa('0x1f')]();});}};}function handleEntityNotFound(_0x550cb1,_0x1e6805){return function(_0x5dffcb){if(!_0x5dffcb){_0x550cb1[_0x86fa('0x1d')](0x194);}return _0x5dffcb;};}function handleError(_0x4834c3,_0x3f8d0f){_0x3f8d0f=_0x3f8d0f||0x1f4;return function(_0x3d83c7){logger[_0x86fa('0x2b')](_0x3d83c7[_0x86fa('0x2c')]);if(_0x3d83c7[_0x86fa('0x2d')]){delete _0x3d83c7[_0x86fa('0x2d')];}_0x4834c3[_0x86fa('0x1e')](_0x3f8d0f)[_0x86fa('0x2e')](_0x3d83c7);};}function getInteractionUsers(_0x50f832,_0x3ab19e){return new BPromise(function(_0x662a6c,_0x4a6878){try{if(_0x3ab19e[_0x50f832['id']]){_0x50f832['Users']=_['map'](_0x3ab19e[_0x50f832['id']],function(_0x1d3f6f){return{'id':_0x1d3f6f['id'],'fullname':_0x1d3f6f['fullname']};});}}catch(_0x59168e){_0x4a6878(_0x59168e);}_0x662a6c(_0x50f832);});}function getInteractionTags(_0x386d6b,_0x2c4ec6){return new BPromise(function(_0x5b5977,_0x55cf96){try{if(_0x386d6b['TagIds']){_0x386d6b[_0x86fa('0x2f')]=[];_0x386d6b[_0x86fa('0x30')][_0x86fa('0x31')](',')[_0x86fa('0x32')](function(_0x5d334b){_0x386d6b[_0x86fa('0x2f')][_0x86fa('0x33')](_0x2c4ec6[_0x5d334b]);});}delete _0x386d6b['TagIds'];}catch(_0x219845){_0x55cf96(_0x219845);}_0x5b5977(_0x386d6b);});}function updateFaxInteraction(_0x50a02a,_0x2d51e6,_0x2dcd07){return new BPromise(function(_0x2f03c7,_0x49621){return getInteractionUsers(_0x50a02a,_0x2dcd07)[_0x86fa('0x2a')](function(_0x153d16){return getInteractionTags(_0x153d16,_0x2d51e6);})[_0x86fa('0x2a')](function(_0x30b0b3){return getStateInteraction(_0x30b0b3);})[_0x86fa('0x2a')](function(_0x336f92){_0x2f03c7(_0x336f92);})[_0x86fa('0x34')](function(_0x2311a4){_0x49621(_0x2311a4);});});}function getStateInteraction(_0x4b02a0){return new BPromise(function(_0x234d4f){_0x4b02a0[_0x86fa('0x35')]=0x0;_0x4b02a0['talking']=0x0;_0x4b02a0['answered']=0x0;_0x4b02a0[_0x86fa('0x36')]=0x0;_0x4b02a0[_0x86fa('0x37')]=0x0;if(!_0x4b02a0['closed']&&!_0x4b02a0[_0x86fa('0x38')]){_0x4b02a0[_0x86fa('0x35')]+=0x1;}if(!_0x4b02a0[_0x86fa('0x39')]&&_0x4b02a0['UserId']){_0x4b02a0[_0x86fa('0x3a')]+=0x1;if(_0x4b02a0['waiting']){_0x4b02a0[_0x86fa('0x35')]-=0x1;}}if(_0x4b02a0[_0x86fa('0x39')]&&_0x4b02a0[_0x86fa('0x38')]){_0x4b02a0[_0x86fa('0x3b')]+=0x1;if(_0x4b02a0[_0x86fa('0x3a')]){_0x4b02a0[_0x86fa('0x3a')]-=0x1;}}if(_0x4b02a0['closed']&&!_0x4b02a0[_0x86fa('0x38')]){_0x4b02a0[_0x86fa('0x36')]+=0x1;if(_0x4b02a0['waiting']){_0x4b02a0[_0x86fa('0x35')]-=0x1;}}_0x4b02a0[_0x86fa('0x37')]+=0x1;_0x234d4f(_0x4b02a0);});}exports[_0x86fa('0x3c')]=function(_0x94076c,_0x1feb2b){var _0x1df5ea={},_0x816e7a={},_0x572787={'count':0x0,'rows':[]};var _0x353c6a=_[_0x86fa('0x3d')](db[_0x86fa('0x3e')][_0x86fa('0x3f')],function(_0x515ff9){return{'name':_0x515ff9[_0x86fa('0x40')],'type':_0x515ff9[_0x86fa('0x41')]['key']};});_0x816e7a[_0x86fa('0x42')]=_['map'](_0x353c6a,_0x86fa('0x2d'));_0x816e7a[_0x86fa('0x43')]=_[_0x86fa('0x44')](_0x94076c[_0x86fa('0x43')]);_0x816e7a[_0x86fa('0x45')]=_[_0x86fa('0x46')](_0x816e7a[_0x86fa('0x42')],_0x816e7a[_0x86fa('0x43')]);_0x1df5ea[_0x86fa('0x47')]=_[_0x86fa('0x46')](_0x816e7a[_0x86fa('0x42')],qs[_0x86fa('0x48')](_0x94076c[_0x86fa('0x43')][_0x86fa('0x48')]));_0x1df5ea[_0x86fa('0x47')]=_0x1df5ea[_0x86fa('0x47')][_0x86fa('0x49')]?_0x1df5ea[_0x86fa('0x47')]:_0x816e7a[_0x86fa('0x42')];if(!_0x94076c[_0x86fa('0x43')][_0x86fa('0x4a')](_0x86fa('0x4b'))){_0x1df5ea['limit']=qs[_0x86fa('0x23')](_0x94076c[_0x86fa('0x43')][_0x86fa('0x23')]);_0x1df5ea['offset']=qs[_0x86fa('0x21')](_0x94076c['query'][_0x86fa('0x21')]);}_0x1df5ea[_0x86fa('0x4c')]=qs[_0x86fa('0x4d')](_0x94076c[_0x86fa('0x43')][_0x86fa('0x4d')]);_0x1df5ea['where']=qs['filters'](_[_0x86fa('0x4e')](_0x94076c[_0x86fa('0x43')],_0x816e7a[_0x86fa('0x45')]),_0x353c6a);var _0x32b4d5=[];var _0xb000e3=squel[_0x86fa('0x4f')]()[_0x86fa('0x50')]('id')[_0x86fa('0x50')](_0x86fa('0x2d'))[_0x86fa('0x50')](_0x86fa('0x51'))[_0x86fa('0x52')]('tools_tags');var _0x32b91e=squel['select']()['field']('u.id')['field'](_0x86fa('0x53'))[_0x86fa('0x50')](_0x86fa('0x54'))[_0x86fa('0x52')]('user_has_fax_interactions','ui')[_0x86fa('0x55')]('users','u',_0x86fa('0x56'));var _0x43fd91=squel[_0x86fa('0x4f')]()[_0x86fa('0x52')](_0x86fa('0x57'),'i')['left_join'](_0x86fa('0x58'),'c',_0x86fa('0x59'))[_0x86fa('0x55')](_0x86fa('0x5a'),'o',_0x86fa('0x5b'))['left_join'](_0x86fa('0x5c'),'a',_0x86fa('0x5d'))[_0x86fa('0x55')](_0x86fa('0x5e'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x86fa('0x55')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0x86fa('0x55')]('tools_tags','t',_0x86fa('0x5f'));var _0x37a642=squel['expr']();var _0x5cfe44=[];var _0x43a6b2=squel[_0x86fa('0x60')]();var _0x171eb2;if(_0x94076c['query'][_0x86fa('0x61')]){_0x171eb2=as[_0x86fa('0x62')](_0x94076c['query'][_0x86fa('0x61')]);var _0x3b65f4=_0x171eb2[_0x86fa('0x63')];for(var _0x31fe41=0x0;_0x31fe41<_0x171eb2[_0x86fa('0x64')][_0x86fa('0x49')];_0x31fe41++){var _0x229e4c=_0x171eb2[_0x86fa('0x64')][_0x31fe41];var _0x2fc025='i';var _0x5b16fa=_[_0x86fa('0x65')](_0x353c6a,[_0x86fa('0x2d'),_0x229e4c[_0x86fa('0x50')]]);if(!_0x5b16fa){switch(_0x229e4c[_0x86fa('0x50')]){case _0x86fa('0x66'):if(_0x229e4c[_0x86fa('0x67')]==0x1){_0x43fd91[_0x86fa('0x68')]('`'+_0x229e4c[_0x86fa('0x50')]+'`\x20=\x200');}else{_0x43fd91[_0x86fa('0x68')]('`'+_0x229e4c['field']+_0x86fa('0x69'));}break;case'Contact':if(_0x229e4c['operator']===_0x86fa('0x6a')){if(_0x229e4c[_0x86fa('0x67')][_0x86fa('0x31')]('\x20')[_0x86fa('0x49')]>0x1){_0x37a642[_0x3b65f4](_0x86fa('0x6b'),qs[_0x86fa('0x6c')](_0x229e4c[_0x86fa('0x67')]),null);}else{var _0x230ad5='%'+_0x229e4c['value']+'%';_0x37a642[_0x3b65f4](_0x86fa('0x6d'),_0x230ad5,_0x230ad5,_0x230ad5);}}else{_0x5b16fa=_[_0x86fa('0x65')](_0x353c6a,['name',_0x86fa('0x6e')]);_0x229e4c[_0x86fa('0x50')]=_0x86fa('0x6e');_0x405cb4=as['buildExpression'](_0x2fc025,_0x5b16fa[_0x86fa('0x41')],_0x229e4c);_0x37a642[_0x3b65f4](_0x405cb4[_0x86fa('0x6f')],_0x405cb4[_0x86fa('0x67')][_0x86fa('0x70')],_0x405cb4[_0x86fa('0x67')][_0x86fa('0x1f')]);}break;case _0x86fa('0x71'):var _0x3b39ce=_0x229e4c[_0x86fa('0x67')][_0x86fa('0x31')](',')['map'](function(_0x224ce4){return Number(_0x224ce4);});_0x3b39ce['forEach'](function(_0x170a58){_0x43a6b2['or'](_0x86fa('0x72'),'%,'+_0x170a58+',%');});_0x5cfe44=_[_0x86fa('0x73')](_0x5cfe44,_0x3b39ce);break;case _0x86fa('0x74'):if(_0x229e4c['operator']===_0x86fa('0x6a')){_0x37a642[_0x3b65f4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x229e4c['value']+'%',null);}else{_0x5b16fa=_[_0x86fa('0x65')](_0x353c6a,[_0x86fa('0x2d'),_0x86fa('0x38')]);_0x229e4c[_0x86fa('0x50')]=_0x86fa('0x38');_0x405cb4=as[_0x86fa('0x75')](_0x2fc025,_0x5b16fa['type'],_0x229e4c);_0x37a642[_0x3b65f4](_0x405cb4[_0x86fa('0x6f')],_0x405cb4[_0x86fa('0x67')][_0x86fa('0x70')],_0x405cb4[_0x86fa('0x67')][_0x86fa('0x1f')]);}break;case _0x86fa('0x76'):_0x405cb4=as[_0x86fa('0x75')]('me',null,_0x229e4c);_0x37a642[_0x3b65f4](_0x405cb4[_0x86fa('0x6f')],_0x405cb4[_0x86fa('0x67')][_0x86fa('0x70')],_0x405cb4[_0x86fa('0x67')][_0x86fa('0x1f')]);break;}}else{var _0x405cb4=as[_0x86fa('0x75')](_0x2fc025,_0x5b16fa[_0x86fa('0x41')],_0x229e4c);_0x37a642[_0x3b65f4](_0x405cb4[_0x86fa('0x6f')],_0x405cb4['value'][_0x86fa('0x70')],_0x405cb4[_0x86fa('0x67')][_0x86fa('0x1f')]);}}}else{var _0x3680af=_(_0x94076c['query'])['keys']()[_0x86fa('0x3d')](function(_0x67415){return _[_0x86fa('0x77')](_0x353c6a,['name',_0x67415])?_0x67415:undefined;})['compact']()[_0x86fa('0x67')]();if(!_['isEmpty'](_0x3680af)){_0x3680af[_0x86fa('0x32')](function(_0xcf8dad){if(_0xcf8dad===_0x86fa('0x78')){_0x43fd91[_0x86fa('0x79')](_0x86fa('0x7a'),[][_0x86fa('0x7b')](_0x94076c[_0x86fa('0x43')][_0xcf8dad]));}else if(_0xcf8dad===_0x86fa('0x7c')){var _0x3456eb=JSON['parse'](_0x94076c['query'][_0xcf8dad])[_0x86fa('0x7d')];var _0x371310=JSON[_0x86fa('0x7e')](_0x94076c[_0x86fa('0x43')][_0xcf8dad])['$lte'];_0x43fd91[_0x86fa('0x79')](_0x86fa('0x7f'),_0x3456eb,_0x371310);}else{if(_0x94076c['query'][_0xcf8dad]===_0x86fa('0x80')){_0x43fd91[_0x86fa('0x79')]('i.'+_0xcf8dad+_0x86fa('0x81'));}else{_0x43fd91['where']('i.'+_0xcf8dad+'\x20=\x20?',_0x94076c['query'][_0xcf8dad]);}}});}if(_0x94076c[_0x86fa('0x43')][_0x86fa('0x82')]){if(_0x94076c[_0x86fa('0x43')]['read']==0x1){_0x43fd91['having'](_0x86fa('0x83'));}else{_0x43fd91[_0x86fa('0x68')](_0x86fa('0x84'));}}if(_0x94076c[_0x86fa('0x43')][_0x86fa('0x85')]){_0x5cfe44=_['isArray'](_0x94076c[_0x86fa('0x43')]['tag'])?_0x94076c[_0x86fa('0x43')][_0x86fa('0x85')]:new Array(_0x94076c[_0x86fa('0x43')][_0x86fa('0x85')]);_0x5cfe44['forEach'](function(_0x110e89){_0x43a6b2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x110e89+',%');});}if(_0x94076c['query'][_0x86fa('0x86')]){var _0x466cca=_0x94076c[_0x86fa('0x43')][_0x86fa('0x86')][_0x86fa('0x87')]('\x5c','\x5c\x5c')[_0x86fa('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x466cca)){_0x37a642['or'](_0x86fa('0x88'),_0x466cca+'%')['or']('i.fax\x20LIKE\x20?',_0x466cca+'%');}_0x37a642['or'](_0x86fa('0x89'),_0x466cca+'%');}}_0x43fd91['where'](_0x37a642);_0x43fd91['group'](_0x86fa('0x8a'));var _0x3d03c9={'type':db[_0x86fa('0x8b')][_0x86fa('0x8c')][_0x86fa('0x8d')],'raw':!![]};var _0x5bda62=_0x43fd91['clone']();_0x5bda62[_0x86fa('0x50')](_0x86fa('0x8a'));_0x5bda62[_0x86fa('0x50')](_0x86fa('0x8e'),_0x86fa('0x66'));if(_0x1df5ea[_0x86fa('0x4c')]){_0x1df5ea['order']['forEach'](function(_0x3c9568){var _0xd7c06c=_0x3c9568[0x0]===_0x86fa('0x8f')?_0x3c9568[0x0]:'i.'+_0x3c9568[0x0];_0x43fd91['order'](_0xd7c06c,_0x3c9568[0x1]===_0x86fa('0x90')?![]:!![]);});}if(!_[_0x86fa('0x91')](_0x5cfe44)){_0x43fd91[_0x86fa('0x68')](_0x43a6b2);_0x5bda62[_0x86fa('0x79')](_0x86fa('0x92'),_0x5cfe44);}BPromise[_0x86fa('0x93')]()[_0x86fa('0x2a')](function(){if(!_0x171eb2){if(_0x94076c[_0x86fa('0x43')]['FaxAccountId'])return;_0x5bda62[_0x86fa('0x79')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x43fd91[_0x86fa('0x79')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x94076c[_0x86fa('0x94')][_0x86fa('0x95')]!==_0x86fa('0x96'))return;return _0x94076c[_0x86fa('0x94')][_0x86fa('0x97')]({'attributes':['id'],'raw':!![]})[_0x86fa('0x2a')](function(_0x2e305a){if(_[_0x86fa('0x91')](_0x2e305a)){_0x5bda62['where'](_0x86fa('0x98'));_0x43fd91[_0x86fa('0x79')](_0x86fa('0x98'));}else{_0x5bda62[_0x86fa('0x79')](_0x86fa('0x7a'),_[_0x86fa('0x3d')](_0x2e305a,'id'));_0x43fd91['where']('i.FaxAccountId\x20IN\x20?',_[_0x86fa('0x3d')](_0x2e305a,'id'));}});})[_0x86fa('0x2a')](function(){if(_0x94076c[_0x86fa('0x94')][_0x86fa('0x95')]===_0x86fa('0x96')&&!_0x171eb2&&!_0x94076c[_0x86fa('0x43')][_0x86fa('0x78')])return[];return db[_0x86fa('0x99')][_0x86fa('0x43')](_0x5bda62[_0x86fa('0x9a')](),_0x3d03c9);})[_0x86fa('0x2a')](function(_0x578a00){_0x572787[_0x86fa('0x24')]=_0x578a00[_0x86fa('0x49')];if(_0x572787[_0x86fa('0x24')]===0x0)return[];return db[_0x86fa('0x99')][_0x86fa('0x43')](_0xb000e3[_0x86fa('0x9a')](),_0x3d03c9)[_0x86fa('0x2a')](function(_0x16d56){_0x32b4d5=_[_0x86fa('0x9b')](_0x16d56,'id');_0x3d03c9=_[_0x86fa('0x9c')](_0x3d03c9,{'model':db[_0x86fa('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x94076c[_0x86fa('0x43')][_0x86fa('0x48')]){_0x1df5ea[_0x86fa('0x47')]['forEach'](function(_0x42fa1b){_0x43fd91[_0x86fa('0x50')]('i.'+_0x42fa1b);});}else{_0x43fd91['field'](_0x86fa('0x8e'),_0x86fa('0x66'));_0x43fd91[_0x86fa('0x50')](_0x86fa('0x9d'),'Account.key');_0x43fd91[_0x86fa('0x50')](_0x86fa('0x9e'),_0x86fa('0x9f'));_0x43fd91[_0x86fa('0x50')](_0x86fa('0xa0'),_0x86fa('0x8f'));_0x43fd91[_0x86fa('0x50')]('i.*');_0x43fd91[_0x86fa('0x50')](_0x86fa('0xa1'),_0x86fa('0xa2'));_0x43fd91[_0x86fa('0x50')](_0x86fa('0xa3'),_0x86fa('0xa4'));_0x43fd91[_0x86fa('0x50')](_0x86fa('0xa5'),_0x86fa('0xa6'));_0x43fd91[_0x86fa('0x50')](_0x86fa('0xa7'),_0x86fa('0xa8'));_0x43fd91[_0x86fa('0x50')]('c.mobile',_0x86fa('0xa9'));_0x43fd91['field']('c.fax',_0x86fa('0xaa'));_0x43fd91[_0x86fa('0x50')]('o.fullname',_0x86fa('0xab'));_0x43fd91['field'](_0x86fa('0xac'),_0x86fa('0xad'));_0x43fd91['field'](_0x86fa('0xae'),_0x86fa('0x30'));}if(_0x1df5ea[_0x86fa('0x23')])_0x43fd91[_0x86fa('0x23')](_0x1df5ea[_0x86fa('0x23')]);if(_0x1df5ea[_0x86fa('0x21')])_0x43fd91['offset'](_0x1df5ea[_0x86fa('0x21')]);return db[_0x86fa('0x99')][_0x86fa('0x43')](_0x43fd91[_0x86fa('0x9a')](),_0x3d03c9);})[_0x86fa('0x2a')](function(_0x33ad07){if(_0x33ad07[_0x86fa('0x49')]>0x0)_0x32b91e[_0x86fa('0x79')](_0x86fa('0xaf'),_['map'](_0x33ad07,'id'));return db[_0x86fa('0x99')][_0x86fa('0x43')](_0x32b91e[_0x86fa('0x9a')](),_0x3d03c9)[_0x86fa('0x2a')](function(_0x3b898d){var _0x1b7c9a=_['groupBy'](_0x3b898d,_0x86fa('0xb0'));var _0x54526c=[];_0x33ad07[_0x86fa('0x32')](function(_0x18b740){_0x54526c[_0x86fa('0x33')](updateFaxInteraction(_0x18b740,_0x32b4d5,_0x1b7c9a));});return BPromise[_0x86fa('0xb1')](_0x54526c);});});})['then'](function(_0x3dc642){_0x572787['rows']=_0x3dc642;return _0x572787;})[_0x86fa('0x2a')](respondWithFilteredResult(_0x1feb2b,_0x1df5ea))[_0x86fa('0x34')](handleError(_0x1feb2b,null));};exports[_0x86fa('0xb2')]=function(_0x5ce03b,_0x105de9){var _0x1e893f={'raw':![],'where':{'id':_0x5ce03b['params']['id']}},_0x14bf15={};_0x14bf15[_0x86fa('0x42')]=_[_0x86fa('0x44')](db[_0x86fa('0x3e')][_0x86fa('0x3f')]);_0x14bf15[_0x86fa('0x43')]=_[_0x86fa('0x44')](_0x5ce03b[_0x86fa('0x43')]);_0x14bf15[_0x86fa('0x45')]=_[_0x86fa('0x46')](_0x14bf15[_0x86fa('0x42')],_0x14bf15['query']);_0x1e893f[_0x86fa('0x47')]=_['intersection'](_0x14bf15[_0x86fa('0x42')],qs['fields'](_0x5ce03b[_0x86fa('0x43')]['fields']));_0x1e893f[_0x86fa('0x47')]=_0x1e893f[_0x86fa('0x47')]['length']?_0x1e893f[_0x86fa('0x47')]:_0x14bf15[_0x86fa('0x42')];if(_0x5ce03b[_0x86fa('0x43')][_0x86fa('0xb3')]){_0x1e893f[_0x86fa('0xb4')]=[{'all':!![]}];}_0x1e893f=_[_0x86fa('0x9c')]({},_0x1e893f,_0x5ce03b[_0x86fa('0xb5')]);return db[_0x86fa('0x3e')]['find'](_0x1e893f)[_0x86fa('0x2a')](handleEntityNotFound(_0x105de9,null))['then'](respondWithResult(_0x105de9,null))['catch'](handleError(_0x105de9,null));};exports['create']=function(_0x5ad89a,_0x2b3be8){return db[_0x86fa('0x3e')]['create'](_0x5ad89a[_0x86fa('0x76')],{})['then'](respondWithResult(_0x2b3be8,0xc9))[_0x86fa('0x34')](handleError(_0x2b3be8,null));};exports[_0x86fa('0xb6')]=function(_0x36bb44,_0x4edd34){if(_0x36bb44[_0x86fa('0x76')]['id']){delete _0x36bb44['body']['id'];}return db[_0x86fa('0x3e')][_0x86fa('0x65')]({'where':{'id':_0x36bb44['params']['id']}})[_0x86fa('0x2a')](handleEntityNotFound(_0x4edd34,null))[_0x86fa('0x2a')](saveUpdates(_0x36bb44[_0x86fa('0x76')],null))[_0x86fa('0x2a')](respondWithResult(_0x4edd34,null))[_0x86fa('0x34')](handleError(_0x4edd34,null));};exports[_0x86fa('0xb7')]=function(_0x567def,_0x1ade82){return db['FaxInteraction']['find']({'where':{'id':_0x567def[_0x86fa('0xb8')]['id']}})[_0x86fa('0x2a')](handleEntityNotFound(_0x1ade82,null))[_0x86fa('0x2a')](removeEntity(_0x1ade82,null))[_0x86fa('0x34')](handleError(_0x1ade82,null));};exports[_0x86fa('0xb9')]=function(_0x5aabdf,_0x4ceb48){return db[_0x86fa('0x3e')][_0x86fa('0xb9')]()[_0x86fa('0x2a')](respondWithResult(_0x4ceb48,null))['catch'](handleError(_0x4ceb48,null));};exports[_0x86fa('0xba')]=function(_0x115d30,_0x2f3559,_0x495b3f){return db[_0x86fa('0xbb')][_0x86fa('0x65')]({'where':{'id':_0x115d30[_0x86fa('0xb8')]['id']}})['then'](handleEntityNotFound(_0x2f3559,null))[_0x86fa('0x2a')](function(_0x23e20e){if(_0x23e20e){return _0x23e20e[_0x86fa('0xba')](_0x115d30[_0x86fa('0x76')][_0x86fa('0xbc')],_[_0x86fa('0xbd')](_0x115d30[_0x86fa('0x76')],[_0x86fa('0xbc'),'id'])||{});}})[_0x86fa('0x2a')](respondWithResult(_0x2f3559,null))[_0x86fa('0x34')](handleError(_0x2f3559,null));};exports['getMessages']=function(_0x4c8768,_0x1d0180,_0x5b3068){var _0x3d6781={'raw':![],'where':{}};var _0x27ddb1={};var _0x4f67d9={'count':0x0,'rows':[]};return db[_0x86fa('0x3e')][_0x86fa('0xbe')]({'where':{'id':_0x4c8768[_0x86fa('0xb8')]['id']}})[_0x86fa('0x2a')](handleEntityNotFound(_0x1d0180,null))['then'](function(_0x204c6d){if(_0x204c6d){_0x27ddb1[_0x86fa('0x42')]=_[_0x86fa('0x44')](db[_0x86fa('0xbb')][_0x86fa('0x3f')]);_0x27ddb1['query']=_[_0x86fa('0x44')](_0x4c8768['query']);_0x27ddb1[_0x86fa('0x45')]=_['intersection'](_0x27ddb1[_0x86fa('0x42')],_0x27ddb1[_0x86fa('0x43')]);_0x3d6781[_0x86fa('0x47')]=_[_0x86fa('0x46')](_0x27ddb1['model'],qs[_0x86fa('0x48')](_0x4c8768[_0x86fa('0x43')]['fields']));_0x3d6781[_0x86fa('0x47')]=_0x3d6781[_0x86fa('0x47')]['length']?_0x3d6781['attributes']:_0x27ddb1[_0x86fa('0x42')];if(!_0x4c8768['query'][_0x86fa('0x4a')](_0x86fa('0x4b'))){_0x3d6781['limit']=qs[_0x86fa('0x23')](_0x4c8768[_0x86fa('0x43')]['limit']);_0x3d6781[_0x86fa('0x21')]=qs[_0x86fa('0x21')](_0x4c8768[_0x86fa('0x43')][_0x86fa('0x21')]);}_0x3d6781[_0x86fa('0x4c')]=qs[_0x86fa('0x4d')](_0x4c8768[_0x86fa('0x43')][_0x86fa('0x4d')]);_0x3d6781[_0x86fa('0x79')]=qs[_0x86fa('0x45')](_[_0x86fa('0x4e')](_0x4c8768['query'],_0x27ddb1['filters']));_0x3d6781['where'][_0x86fa('0xb0')]=_0x204c6d['id'];if(_0x4c8768[_0x86fa('0x43')]['filter']){_0x3d6781[_0x86fa('0x79')]=_[_0x86fa('0x9c')](_0x3d6781[_0x86fa('0x79')],{'$or':_['map'](_0x3d6781['attributes'],function(_0xea6f89){var _0x28b662={};_0x28b662[_0xea6f89]={'$like':'%'+_0x4c8768[_0x86fa('0x43')][_0x86fa('0x86')]+'%'};return _0x28b662;})});}if(_0x4c8768[_0x86fa('0x43')][_0x86fa('0x7d')]){var _0x524a12=_0x4c8768[_0x86fa('0x43')][_0x86fa('0x7d')][_0x86fa('0x31')](',');var _0x54be75={};_0x54be75[_0x524a12[0x0]]={'$gte':moment(_0x524a12[0x1])['format'](_0x86fa('0xbf'))};_0x3d6781[_0x86fa('0x79')]=_[_0x86fa('0x9c')](_0x3d6781['where'],_0x54be75);}_0x3d6781=_['merge']({},_0x3d6781,_0x4c8768[_0x86fa('0xb5')]);return db[_0x86fa('0xbb')][_0x86fa('0x24')]({'where':_0x3d6781[_0x86fa('0x79')]})[_0x86fa('0x2a')](function(_0x550137){_0x4f67d9[_0x86fa('0x24')]=_0x550137;if(_0x4c8768[_0x86fa('0x43')][_0x86fa('0xb3')]){_0x3d6781[_0x86fa('0xb4')]=[{'all':!![]}];}return db[_0x86fa('0xbb')][_0x86fa('0xc0')](_0x3d6781);})[_0x86fa('0x2a')](function(_0x4b532f){_0x4f67d9[_0x86fa('0xc1')]=_0x4b532f;return _0x4f67d9;});}})[_0x86fa('0x2a')](respondWithFilteredResult(_0x1d0180,_0x3d6781))[_0x86fa('0x34')](handleError(_0x1d0180,null));};exports['addTags']=function(_0x322650,_0x27f604,_0x5e9074){return db[_0x86fa('0x3e')][_0x86fa('0x65')]({'where':{'id':_0x322650[_0x86fa('0xb8')]['id']}})['then'](handleEntityNotFound(_0x27f604,null))['then'](function(_0x4dc3aa){if(_0x4dc3aa){return _0x4dc3aa['setTags'](_0x322650[_0x86fa('0x76')][_0x86fa('0xbc')],_['omit'](_0x322650[_0x86fa('0x76')],[_0x86fa('0xbc'),'id'])||{})['spread'](function(){return db[_0x86fa('0x71')][_0x86fa('0xc0')]({'attributes':['id',_0x86fa('0x2d'),_0x86fa('0x51')],'where':{'id':_0x322650['body']['ids']}});})[_0x86fa('0x2a')](function(_0xa27c3a){socket[_0x86fa('0xc2')](_0x86fa('0xc3'),{'id':Number(_0x322650[_0x86fa('0xb8')]['id']),'tags':_0xa27c3a||[]});return{'id':Number(_0x322650[_0x86fa('0xb8')]['id']),'tags':_0xa27c3a||[]};});}})[_0x86fa('0x2a')](respondWithResult(_0x27f604,null))[_0x86fa('0x34')](handleError(_0x27f604,null));};exports[_0x86fa('0xc4')]=function(_0xb49f40,_0x10a222,_0x2fbb17){return db[_0x86fa('0x3e')]['find']({'where':{'id':_0xb49f40[_0x86fa('0xb8')]['id']}})[_0x86fa('0x2a')](handleEntityNotFound(_0x10a222,null))[_0x86fa('0x2a')](function(_0x211cfc){if(_0x211cfc){return _0x211cfc['removeTags'](_0xb49f40[_0x86fa('0x43')][_0x86fa('0xbc')]);}})[_0x86fa('0x2a')](respondWithStatusCode(_0x10a222,null))[_0x86fa('0x34')](handleError(_0x10a222,null));};exports[_0x86fa('0xc5')]=function(_0x1bb1d6,_0x37460f){var _0x487ca9=moment()[_0x86fa('0xc6')]()[_0x86fa('0x9a')]();var _0x124314=path[_0x86fa('0xc7')](config['root'],_0x86fa('0xc8'),_0x86fa('0xc9'),'tmp');var _0x2dc524=path[_0x86fa('0xc7')](config[_0x86fa('0xca')],_0x86fa('0xc8'),_0x86fa('0xc9'),_0x86fa('0xcb'));var _0x1582da=path['join'](_0x124314,_0x487ca9);var _0x4c7987=util['format']('transcript-%d-%s.zip',_0x1bb1d6['params']['id'],_0x487ca9);var _0x763636=path['join'](_0x124314,_0x4c7987);var _0x44f89d=[];_0x44f89d[_0x86fa('0x33')]({'model':db[_0x86fa('0xcc')],'as':_0x86fa('0xcc'),'raw':!![]});var _0x3428fb=[{'model':db['FaxMessage'],'as':_0x86fa('0xcd'),'attributes':['id','body',_0x86fa('0x7c')],'include':_0x44f89d}];return db[_0x86fa('0x3e')][_0x86fa('0x65')]({'where':{'id':_0x1bb1d6['params']['id']},'include':_0x3428fb})[_0x86fa('0x2a')](handleEntityNotFound(_0x37460f,null))['then'](function(_0x49ddc1){if(_0x49ddc1&&_0x49ddc1[_0x86fa('0xcd')]){var _0x3ccc5e=_0x49ddc1['get']({'plain':!![]});fs[_0x86fa('0xce')](_0x1582da);for(var _0x218ad8=0x0;_0x218ad8<_0x3ccc5e['Messages'][_0x86fa('0x49')];_0x218ad8++){var _0x118807=_0x3ccc5e[_0x86fa('0xcd')][_0x218ad8]['Attachment'];if(_0x118807){var _0x474d93=path['join'](_0x2dc524,_0x118807[_0x86fa('0xcf')]);if(fs[_0x86fa('0xd0')](_0x474d93)){fs[_0x86fa('0xd1')](_0x474d93)[_0x86fa('0xd2')](fs['createWriteStream'](path[_0x86fa('0xc7')](_0x1582da,_0x118807[_0x86fa('0xcf')])));}}}return BPromise[_0x86fa('0x93')]()[_0x86fa('0x2a')](function(){return new BPromise(function(_0x2f8497,_0x45c428){zipdir(_0x1582da,{'saveTo':_0x763636},function(_0x34197a,_0x2f495e){if(_0x34197a)return _0x45c428(_0x34197a);return _0x2f8497(_0x2f495e);});})['then'](function(){return new BPromise(function(_0x88ff24,_0x5aa00a){rimraf(_0x1582da,function(_0x36c9f0){if(_0x36c9f0)_0x5aa00a(_0x36c9f0);return _0x88ff24();});});})[_0x86fa('0x2a')](function(){return _0x37460f['download'](_0x763636,_0x4c7987,function(_0x5b5937){if(_0x5b5937){console[_0x86fa('0xd3')]('err',_0x5b5937);}else{fs[_0x86fa('0xd4')](_0x763636);}});});});}else{return _0x37460f[_0x86fa('0x1d')](0xc8);}})[_0x86fa('0x34')](handleError(_0x37460f,null));}; \ No newline at end of file +var _0x8ea6=['fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','$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','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$lte','null','\x20=\x20?','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','includeAll','include','options','find','create','params','describe','FaxMessage','omit','ids','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','Tag','emit','faxInteractionTags:save','removeTags','download','unix','root','files','tmp','server','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','squel','jsforce','to-csv','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','Users','map','fullname','TagIds','Tags','forEach','push','catch','talking','answered','unmanaged','closed','UserId','waiting','total','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.FaxAccountId','fax_messages'];(function(_0x65c903,_0x41e920){var _0x23e1d7=function(_0x4279cd){while(--_0x4279cd){_0x65c903['push'](_0x65c903['shift']());}};_0x23e1d7(++_0x41e920);}(_0x8ea6,0x162));var _0x68ea=function(_0x3fbdc1,_0x7756c2){_0x3fbdc1=_0x3fbdc1-0x0;var _0x2b045b=_0x8ea6[_0x3fbdc1];return _0x2b045b;};'use strict';var emlformat=require(_0x68ea('0x0'));var rimraf=require(_0x68ea('0x1'));var zipdir=require(_0x68ea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68ea('0x3'));var moment=require(_0x68ea('0x4'));var BPromise=require(_0x68ea('0x5'));var Mustache=require(_0x68ea('0x6'));var util=require('util');var path=require('path');var sox=require(_0x68ea('0x7'));var csv=require('to-csv');var ejs=require(_0x68ea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x68ea('0x9'));var crypto=require('crypto');var jsforce=require(_0x68ea('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x68ea('0xb'));var querystring=require('querystring');var Papa=require(_0x68ea('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x68ea('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x68ea('0xe'))(_0x68ea('0xf'));var utils=require(_0x68ea('0x10'));var config=require(_0x68ea('0x11'));var licenseUtil=require(_0x68ea('0x12'));var db=require(_0x68ea('0x13'))['db'];config[_0x68ea('0x14')]=_[_0x68ea('0x15')](config[_0x68ea('0x14')],{'host':_0x68ea('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x68ea('0x17'))[_0x68ea('0x18')](socket);function respondWithStatusCode(_0xa8f5b4,_0x2cd0fd){_0x2cd0fd=_0x2cd0fd||0xcc;return function(_0x221c58){if(_0x221c58){return _0xa8f5b4['sendStatus'](_0x2cd0fd);}return _0xa8f5b4[_0x68ea('0x19')](_0x2cd0fd)[_0x68ea('0x1a')]();};}function respondWithResult(_0x3fd147,_0x2a586e){_0x2a586e=_0x2a586e||0xc8;return function(_0x2bb45){if(_0x2bb45){return _0x3fd147['status'](_0x2a586e)[_0x68ea('0x1b')](_0x2bb45);}};}function respondWithFilteredResult(_0x350930,_0x28b136){return function(_0x394255){if(_0x394255){var _0x544e84=typeof _0x28b136[_0x68ea('0x1c')]===_0x68ea('0x1d')&&typeof _0x28b136['limit']===_0x68ea('0x1d');var _0x27b833=_0x394255[_0x68ea('0x1e')];var _0x249ea6=_0x544e84?0x0:_0x28b136['offset'];var _0x4fea18=_0x544e84?_0x394255[_0x68ea('0x1e')]:_0x28b136['offset']+_0x28b136[_0x68ea('0x1f')];var _0x173203;if(_0x4fea18>=_0x27b833){_0x4fea18=_0x27b833;_0x173203=0xc8;}else{_0x173203=0xce;}_0x350930['status'](_0x173203);return _0x350930['set'](_0x68ea('0x20'),_0x249ea6+'-'+_0x4fea18+'/'+_0x27b833)[_0x68ea('0x1b')](_0x394255);}return null;};}function patchUpdates(_0xb3ab68){return function(_0x2cf7cc){try{jsonpatch[_0x68ea('0x21')](_0x2cf7cc,_0xb3ab68,!![]);}catch(_0x21f61e){return BPromise['reject'](_0x21f61e);}return _0x2cf7cc[_0x68ea('0x22')]();};}function saveUpdates(_0x1f269c,_0x1a22a1){return function(_0x2d9eca){if(_0x2d9eca){return _0x2d9eca[_0x68ea('0x23')](_0x1f269c)['then'](function(_0x2a79db){return _0x2a79db;});}return null;};}function removeEntity(_0x53d664,_0x17a248){return function(_0x2a8bee){if(_0x2a8bee){return _0x2a8bee[_0x68ea('0x24')]()[_0x68ea('0x25')](function(){_0x53d664[_0x68ea('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44d27a,_0x388910){return function(_0x3f68ed){if(!_0x3f68ed){_0x44d27a[_0x68ea('0x26')](0x194);}return _0x3f68ed;};}function handleError(_0x44c57b,_0x255a68){_0x255a68=_0x255a68||0x1f4;return function(_0x2ddebd){logger['error'](_0x2ddebd[_0x68ea('0x27')]);if(_0x2ddebd[_0x68ea('0x28')]){delete _0x2ddebd[_0x68ea('0x28')];}_0x44c57b[_0x68ea('0x19')](_0x255a68)['send'](_0x2ddebd);};}function getInteractionUsers(_0x43795b,_0x54ef75){return new BPromise(function(_0x4f23e5,_0x2a9d8f){try{if(_0x54ef75[_0x43795b['id']]){_0x43795b[_0x68ea('0x29')]=_[_0x68ea('0x2a')](_0x54ef75[_0x43795b['id']],function(_0x4298a1){return{'id':_0x4298a1['id'],'fullname':_0x4298a1[_0x68ea('0x2b')]};});}}catch(_0x4b8da9){_0x2a9d8f(_0x4b8da9);}_0x4f23e5(_0x43795b);});}function getInteractionTags(_0x267d1c,_0x288802){return new BPromise(function(_0x30d211,_0x32a628){try{if(_0x267d1c[_0x68ea('0x2c')]){_0x267d1c[_0x68ea('0x2d')]=[];_0x267d1c[_0x68ea('0x2c')]['split'](',')[_0x68ea('0x2e')](function(_0x1167e3){_0x267d1c[_0x68ea('0x2d')][_0x68ea('0x2f')](_0x288802[_0x1167e3]);});}delete _0x267d1c[_0x68ea('0x2c')];}catch(_0x2ec198){_0x32a628(_0x2ec198);}_0x30d211(_0x267d1c);});}function updateFaxInteraction(_0x502b62,_0x399b20,_0x2cdcc0){return new BPromise(function(_0x482ba1,_0x30f817){return getInteractionUsers(_0x502b62,_0x2cdcc0)['then'](function(_0xfc9cd4){return getInteractionTags(_0xfc9cd4,_0x399b20);})[_0x68ea('0x25')](function(_0x4828cd){return getStateInteraction(_0x4828cd);})[_0x68ea('0x25')](function(_0x427ecb){_0x482ba1(_0x427ecb);})[_0x68ea('0x30')](function(_0x5e01c9){_0x30f817(_0x5e01c9);});});}function getStateInteraction(_0x58f557){return new BPromise(function(_0x538062){_0x58f557['waiting']=0x0;_0x58f557[_0x68ea('0x31')]=0x0;_0x58f557[_0x68ea('0x32')]=0x0;_0x58f557[_0x68ea('0x33')]=0x0;_0x58f557['total']=0x0;if(!_0x58f557[_0x68ea('0x34')]&&!_0x58f557[_0x68ea('0x35')]){_0x58f557[_0x68ea('0x36')]+=0x1;}if(!_0x58f557['closed']&&_0x58f557['UserId']){_0x58f557['talking']+=0x1;if(_0x58f557[_0x68ea('0x36')]){_0x58f557[_0x68ea('0x36')]-=0x1;}}if(_0x58f557[_0x68ea('0x34')]&&_0x58f557['UserId']){_0x58f557[_0x68ea('0x32')]+=0x1;if(_0x58f557['talking']){_0x58f557['talking']-=0x1;}}if(_0x58f557[_0x68ea('0x34')]&&!_0x58f557[_0x68ea('0x35')]){_0x58f557[_0x68ea('0x33')]+=0x1;if(_0x58f557[_0x68ea('0x36')]){_0x58f557[_0x68ea('0x36')]-=0x1;}}_0x58f557[_0x68ea('0x37')]+=0x1;_0x538062(_0x58f557);});}exports[_0x68ea('0x38')]=function(_0x38a848,_0x5f7993){var _0x4ff13e={},_0x590bfe={},_0x1630e3={'count':0x0,'rows':[]};var _0xe197b1=_[_0x68ea('0x2a')](db[_0x68ea('0x39')][_0x68ea('0x3a')],function(_0x5071f1){return{'name':_0x5071f1[_0x68ea('0x3b')],'type':_0x5071f1[_0x68ea('0x3c')][_0x68ea('0x3d')]};});_0x590bfe[_0x68ea('0x3e')]=_[_0x68ea('0x2a')](_0xe197b1,_0x68ea('0x28'));_0x590bfe[_0x68ea('0x3f')]=_[_0x68ea('0x40')](_0x38a848['query']);_0x590bfe[_0x68ea('0x41')]=_[_0x68ea('0x42')](_0x590bfe['model'],_0x590bfe[_0x68ea('0x3f')]);_0x4ff13e[_0x68ea('0x43')]=_[_0x68ea('0x42')](_0x590bfe[_0x68ea('0x3e')],qs[_0x68ea('0x44')](_0x38a848['query'][_0x68ea('0x44')]));_0x4ff13e[_0x68ea('0x43')]=_0x4ff13e['attributes'][_0x68ea('0x45')]?_0x4ff13e[_0x68ea('0x43')]:_0x590bfe[_0x68ea('0x3e')];if(!_0x38a848[_0x68ea('0x3f')][_0x68ea('0x46')](_0x68ea('0x47'))){_0x4ff13e['limit']=qs[_0x68ea('0x1f')](_0x38a848['query'][_0x68ea('0x1f')]);_0x4ff13e[_0x68ea('0x1c')]=qs[_0x68ea('0x1c')](_0x38a848[_0x68ea('0x3f')][_0x68ea('0x1c')]);}_0x4ff13e[_0x68ea('0x48')]=qs[_0x68ea('0x49')](_0x38a848[_0x68ea('0x3f')][_0x68ea('0x49')]);_0x4ff13e[_0x68ea('0x4a')]=qs[_0x68ea('0x41')](_[_0x68ea('0x4b')](_0x38a848[_0x68ea('0x3f')],_0x590bfe['filters']),_0xe197b1);var _0x3d141f=[];var _0x379cb5=squel[_0x68ea('0x4c')]()[_0x68ea('0x4d')]('id')[_0x68ea('0x4d')](_0x68ea('0x28'))[_0x68ea('0x4d')](_0x68ea('0x4e'))[_0x68ea('0x4f')]('tools_tags');var _0x257320=squel[_0x68ea('0x4c')]()['field'](_0x68ea('0x50'))[_0x68ea('0x4d')](_0x68ea('0x51'))[_0x68ea('0x4d')](_0x68ea('0x52'))['from'](_0x68ea('0x53'),'ui')['left_join'](_0x68ea('0x54'),'u',_0x68ea('0x55'));var _0x3fabff=squel['select']()[_0x68ea('0x4f')](_0x68ea('0x56'),'i')[_0x68ea('0x57')](_0x68ea('0x58'),'c',_0x68ea('0x59'))[_0x68ea('0x57')](_0x68ea('0x54'),'o','o.id\x20=\x20i.UserId')['left_join']('fax_accounts','a',_0x68ea('0x5a'))[_0x68ea('0x57')](_0x68ea('0x5b'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x68ea('0x57')](_0x68ea('0x5c'),'it',_0x68ea('0x5d'))[_0x68ea('0x57')](_0x68ea('0x5e'),'t',_0x68ea('0x5f'));var _0x4476b5=squel[_0x68ea('0x60')]();var _0x524221=[];var _0x1f1f97=squel[_0x68ea('0x60')]();var _0x440293;if(_0x38a848[_0x68ea('0x3f')][_0x68ea('0x61')]){_0x440293=as[_0x68ea('0x62')](_0x38a848[_0x68ea('0x3f')][_0x68ea('0x61')]);var _0x11ce77=_0x440293[_0x68ea('0x63')];for(var _0x43db28=0x0;_0x43db28<_0x440293[_0x68ea('0x64')][_0x68ea('0x45')];_0x43db28++){var _0x190313=_0x440293[_0x68ea('0x64')][_0x43db28];var _0x44a2f4='i';var _0x3b8982=_['find'](_0xe197b1,['name',_0x190313[_0x68ea('0x4d')]]);if(!_0x3b8982){switch(_0x190313[_0x68ea('0x4d')]){case _0x68ea('0x65'):if(_0x190313[_0x68ea('0x66')]==0x1){_0x3fabff[_0x68ea('0x67')]('`'+_0x190313[_0x68ea('0x4d')]+'`\x20=\x200');}else{_0x3fabff['having']('`'+_0x190313['field']+_0x68ea('0x68'));}break;case'Contact':if(_0x190313['operator']===_0x68ea('0x69')){if(_0x190313[_0x68ea('0x66')][_0x68ea('0x6a')]('\x20')[_0x68ea('0x45')]>0x1){_0x4476b5[_0x11ce77](_0x68ea('0x6b'),qs['getFullTextValue'](_0x190313[_0x68ea('0x66')]),null);}else{var _0x3197f5='%'+_0x190313[_0x68ea('0x66')]+'%';_0x4476b5[_0x11ce77](_0x68ea('0x6c'),_0x3197f5,_0x3197f5,_0x3197f5);}}else{_0x3b8982=_['find'](_0xe197b1,[_0x68ea('0x28'),'ContactId']);_0x190313[_0x68ea('0x4d')]=_0x68ea('0x6d');_0x497b37=as[_0x68ea('0x6e')](_0x44a2f4,_0x3b8982[_0x68ea('0x3c')],_0x190313);_0x4476b5[_0x11ce77](_0x497b37['text'],_0x497b37['value']['start'],_0x497b37[_0x68ea('0x66')][_0x68ea('0x1a')]);}break;case'Tag':var _0x523693=_0x190313[_0x68ea('0x66')]['split'](',')[_0x68ea('0x2a')](function(_0x1503da){return Number(_0x1503da);});_0x523693[_0x68ea('0x2e')](function(_0x30be87){_0x1f1f97['or'](_0x68ea('0x6f'),'%,'+_0x30be87+',%');});_0x524221=_[_0x68ea('0x70')](_0x524221,_0x523693);break;case'User':if(_0x190313[_0x68ea('0x71')]==='$substring'){_0x4476b5[_0x11ce77](_0x68ea('0x72'),'%'+_0x190313[_0x68ea('0x66')]+'%',null);}else{_0x3b8982=_['find'](_0xe197b1,[_0x68ea('0x28'),_0x68ea('0x35')]);_0x190313[_0x68ea('0x4d')]=_0x68ea('0x35');_0x497b37=as[_0x68ea('0x6e')](_0x44a2f4,_0x3b8982[_0x68ea('0x3c')],_0x190313);_0x4476b5[_0x11ce77](_0x497b37[_0x68ea('0x73')],_0x497b37['value'][_0x68ea('0x74')],_0x497b37[_0x68ea('0x66')]['end']);}break;case _0x68ea('0x75'):_0x497b37=as[_0x68ea('0x6e')]('me',null,_0x190313);_0x4476b5[_0x11ce77](_0x497b37[_0x68ea('0x73')],_0x497b37[_0x68ea('0x66')][_0x68ea('0x74')],_0x497b37[_0x68ea('0x66')][_0x68ea('0x1a')]);break;}}else{var _0x497b37=as[_0x68ea('0x6e')](_0x44a2f4,_0x3b8982[_0x68ea('0x3c')],_0x190313);_0x4476b5[_0x11ce77](_0x497b37[_0x68ea('0x73')],_0x497b37[_0x68ea('0x66')][_0x68ea('0x74')],_0x497b37['value'][_0x68ea('0x1a')]);}}}else{var _0x27ed1c=_(_0x38a848['query'])[_0x68ea('0x40')]()[_0x68ea('0x2a')](function(_0x4a2994){return _[_0x68ea('0x76')](_0xe197b1,[_0x68ea('0x28'),_0x4a2994])?_0x4a2994:undefined;})[_0x68ea('0x77')]()[_0x68ea('0x66')]();if(!_[_0x68ea('0x78')](_0x27ed1c)){_0x27ed1c[_0x68ea('0x2e')](function(_0x412c41){if(_0x412c41===_0x68ea('0x79')){_0x3fabff[_0x68ea('0x4a')](_0x68ea('0x7a'),[]['concat'](_0x38a848[_0x68ea('0x3f')][_0x412c41]));}else if(_0x412c41===_0x68ea('0x7b')){var _0xe42de=JSON[_0x68ea('0x7c')](_0x38a848[_0x68ea('0x3f')][_0x412c41])['$gte'];var _0x4b1c9c=JSON[_0x68ea('0x7c')](_0x38a848[_0x68ea('0x3f')][_0x412c41])[_0x68ea('0x7d')];_0x3fabff[_0x68ea('0x4a')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xe42de,_0x4b1c9c);}else{if(_0x38a848['query'][_0x412c41]===_0x68ea('0x7e')){_0x3fabff[_0x68ea('0x4a')]('i.'+_0x412c41+'\x20IS\x20NULL');}else{_0x3fabff[_0x68ea('0x4a')]('i.'+_0x412c41+_0x68ea('0x7f'),_0x38a848[_0x68ea('0x3f')][_0x412c41]);}}});}if(_0x38a848[_0x68ea('0x3f')]['read']){if(_0x38a848[_0x68ea('0x3f')][_0x68ea('0x80')]==0x1){_0x3fabff[_0x68ea('0x67')]('`unreadMessages`\x20=\x200');}else{_0x3fabff[_0x68ea('0x67')]('`unreadMessages`\x20>\x200');}}if(_0x38a848[_0x68ea('0x3f')][_0x68ea('0x81')]){_0x524221=_[_0x68ea('0x82')](_0x38a848['query'][_0x68ea('0x81')])?_0x38a848['query'][_0x68ea('0x81')]:new Array(_0x38a848[_0x68ea('0x3f')][_0x68ea('0x81')]);_0x524221[_0x68ea('0x2e')](function(_0x4d2c59){_0x1f1f97['or'](_0x68ea('0x6f'),'%,'+_0x4d2c59+',%');});}if(_0x38a848[_0x68ea('0x3f')][_0x68ea('0x83')]){var _0x148d36=_0x38a848['query']['filter'][_0x68ea('0x84')]('\x5c','\x5c\x5c')[_0x68ea('0x84')](/'/g,'\x27\x27');if(qs[_0x68ea('0x85')](_0x148d36)){_0x4476b5['or'](_0x68ea('0x86'),_0x148d36+'%')['or'](_0x68ea('0x87'),_0x148d36+'%');}_0x4476b5['or'](_0x68ea('0x88'),_0x148d36+'%');}}_0x3fabff[_0x68ea('0x4a')](_0x4476b5);_0x3fabff[_0x68ea('0x89')](_0x68ea('0x8a'));var _0x2a7c71={'type':db[_0x68ea('0x8b')][_0x68ea('0x8c')][_0x68ea('0x8d')],'raw':!![]};var _0x26665a=_0x3fabff[_0x68ea('0x8e')]();_0x26665a[_0x68ea('0x4d')](_0x68ea('0x8a'));_0x26665a[_0x68ea('0x4d')](_0x68ea('0x8f'),'unreadMessages');if(_0x4ff13e[_0x68ea('0x48')]){_0x4ff13e[_0x68ea('0x48')][_0x68ea('0x2e')](function(_0x2688da){var _0xb1b5f1=_0x2688da[0x0]===_0x68ea('0x90')?_0x2688da[0x0]:'i.'+_0x2688da[0x0];_0x3fabff['order'](_0xb1b5f1,_0x2688da[0x1]===_0x68ea('0x91')?![]:!![]);});}if(!_[_0x68ea('0x78')](_0x524221)){_0x3fabff[_0x68ea('0x67')](_0x1f1f97);_0x26665a[_0x68ea('0x4a')](_0x68ea('0x92'),_0x524221);}BPromise[_0x68ea('0x93')]()[_0x68ea('0x25')](function(){if(!_0x440293){if(_0x38a848[_0x68ea('0x3f')][_0x68ea('0x79')])return;_0x26665a[_0x68ea('0x4a')](_0x68ea('0x94'));_0x3fabff[_0x68ea('0x4a')](_0x68ea('0x94'));return;}if(_0x38a848[_0x68ea('0x95')][_0x68ea('0x96')]!==_0x68ea('0x97'))return;return _0x38a848[_0x68ea('0x95')][_0x68ea('0x98')]({'attributes':['id'],'raw':!![]})[_0x68ea('0x25')](function(_0x5cf38d){if(_[_0x68ea('0x78')](_0x5cf38d)){_0x26665a[_0x68ea('0x4a')](_0x68ea('0x99'));_0x3fabff[_0x68ea('0x4a')](_0x68ea('0x99'));}else{_0x26665a[_0x68ea('0x4a')]('i.FaxAccountId\x20IN\x20?',_[_0x68ea('0x2a')](_0x5cf38d,'id'));_0x3fabff[_0x68ea('0x4a')](_0x68ea('0x7a'),_['map'](_0x5cf38d,'id'));}});})[_0x68ea('0x25')](function(){if(_0x38a848[_0x68ea('0x95')][_0x68ea('0x96')]===_0x68ea('0x97')&&!_0x440293&&!_0x38a848[_0x68ea('0x3f')][_0x68ea('0x79')])return[];return db[_0x68ea('0x9a')][_0x68ea('0x3f')](_0x26665a['toString'](),_0x2a7c71);})[_0x68ea('0x25')](function(_0x4c2193){_0x1630e3[_0x68ea('0x1e')]=_0x4c2193[_0x68ea('0x45')];if(_0x1630e3[_0x68ea('0x1e')]===0x0)return[];return db[_0x68ea('0x9a')][_0x68ea('0x3f')](_0x379cb5[_0x68ea('0x9b')](),_0x2a7c71)[_0x68ea('0x25')](function(_0x49e009){_0x3d141f=_[_0x68ea('0x9c')](_0x49e009,'id');_0x2a7c71=_[_0x68ea('0x9d')](_0x2a7c71,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x38a848[_0x68ea('0x3f')][_0x68ea('0x44')]){_0x4ff13e[_0x68ea('0x43')][_0x68ea('0x2e')](function(_0x515047){_0x3fabff[_0x68ea('0x4d')]('i.'+_0x515047);});}else{_0x3fabff[_0x68ea('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x68ea('0x65'));_0x3fabff[_0x68ea('0x4d')](_0x68ea('0x9e'),_0x68ea('0x9f'));_0x3fabff[_0x68ea('0x4d')](_0x68ea('0xa0'),_0x68ea('0xa1'));_0x3fabff[_0x68ea('0x4d')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x3fabff[_0x68ea('0x4d')](_0x68ea('0xa2'));_0x3fabff[_0x68ea('0x4d')]('c.firstName',_0x68ea('0xa3'));_0x3fabff[_0x68ea('0x4d')](_0x68ea('0xa4'),_0x68ea('0xa5'));_0x3fabff['field'](_0x68ea('0xa6'),_0x68ea('0xa7'));_0x3fabff[_0x68ea('0x4d')]('c.phone',_0x68ea('0xa8'));_0x3fabff[_0x68ea('0x4d')](_0x68ea('0xa9'),'Contact.mobile');_0x3fabff['field'](_0x68ea('0xaa'),_0x68ea('0xab'));_0x3fabff[_0x68ea('0x4d')](_0x68ea('0xac'),_0x68ea('0xad'));_0x3fabff[_0x68ea('0x4d')](_0x68ea('0xae'),'Owner.internal');_0x3fabff['field'](_0x68ea('0xaf'),_0x68ea('0x2c'));}if(_0x4ff13e[_0x68ea('0x1f')])_0x3fabff[_0x68ea('0x1f')](_0x4ff13e[_0x68ea('0x1f')]);if(_0x4ff13e[_0x68ea('0x1c')])_0x3fabff[_0x68ea('0x1c')](_0x4ff13e['offset']);return db[_0x68ea('0x9a')][_0x68ea('0x3f')](_0x3fabff['toString'](),_0x2a7c71);})[_0x68ea('0x25')](function(_0x3a3e28){if(_0x3a3e28['length']>0x0)_0x257320['where'](_0x68ea('0xb0'),_[_0x68ea('0x2a')](_0x3a3e28,'id'));return db[_0x68ea('0x9a')]['query'](_0x257320['toString'](),_0x2a7c71)[_0x68ea('0x25')](function(_0x57c15a){var _0x88692=_[_0x68ea('0xb1')](_0x57c15a,_0x68ea('0xb2'));var _0x1ca5eb=[];_0x3a3e28['forEach'](function(_0xe93d44){_0x1ca5eb[_0x68ea('0x2f')](updateFaxInteraction(_0xe93d44,_0x3d141f,_0x88692));});return BPromise[_0x68ea('0xb3')](_0x1ca5eb);});});})['then'](function(_0x141abf){_0x1630e3[_0x68ea('0xb4')]=_0x141abf;return _0x1630e3;})[_0x68ea('0x25')](respondWithFilteredResult(_0x5f7993,_0x4ff13e))[_0x68ea('0x30')](handleError(_0x5f7993,null));};exports[_0x68ea('0xb5')]=function(_0x21f529,_0x21fb9b){var _0x4f574a={'raw':![],'where':{'id':_0x21f529['params']['id']}},_0x2316b4={};_0x2316b4['model']=_[_0x68ea('0x40')](db[_0x68ea('0x39')][_0x68ea('0x3a')]);_0x2316b4[_0x68ea('0x3f')]=_[_0x68ea('0x40')](_0x21f529[_0x68ea('0x3f')]);_0x2316b4[_0x68ea('0x41')]=_[_0x68ea('0x42')](_0x2316b4[_0x68ea('0x3e')],_0x2316b4[_0x68ea('0x3f')]);_0x4f574a['attributes']=_[_0x68ea('0x42')](_0x2316b4[_0x68ea('0x3e')],qs[_0x68ea('0x44')](_0x21f529[_0x68ea('0x3f')]['fields']));_0x4f574a['attributes']=_0x4f574a['attributes'][_0x68ea('0x45')]?_0x4f574a[_0x68ea('0x43')]:_0x2316b4[_0x68ea('0x3e')];if(_0x21f529[_0x68ea('0x3f')][_0x68ea('0xb6')]){_0x4f574a[_0x68ea('0xb7')]=[{'all':!![]}];}_0x4f574a=_['merge']({},_0x4f574a,_0x21f529[_0x68ea('0xb8')]);return db[_0x68ea('0x39')][_0x68ea('0xb9')](_0x4f574a)[_0x68ea('0x25')](handleEntityNotFound(_0x21fb9b,null))[_0x68ea('0x25')](respondWithResult(_0x21fb9b,null))[_0x68ea('0x30')](handleError(_0x21fb9b,null));};exports[_0x68ea('0xba')]=function(_0x30f410,_0x3e9a61){return db[_0x68ea('0x39')][_0x68ea('0xba')](_0x30f410['body'],{})[_0x68ea('0x25')](respondWithResult(_0x3e9a61,0xc9))[_0x68ea('0x30')](handleError(_0x3e9a61,null));};exports[_0x68ea('0x23')]=function(_0x27fe2d,_0x28dfbd){if(_0x27fe2d[_0x68ea('0x75')]['id']){delete _0x27fe2d['body']['id'];}return db['FaxInteraction'][_0x68ea('0xb9')]({'where':{'id':_0x27fe2d[_0x68ea('0xbb')]['id']}})['then'](handleEntityNotFound(_0x28dfbd,null))[_0x68ea('0x25')](saveUpdates(_0x27fe2d['body'],null))[_0x68ea('0x25')](respondWithResult(_0x28dfbd,null))[_0x68ea('0x30')](handleError(_0x28dfbd,null));};exports['destroy']=function(_0x3dd071,_0x10f90){return db[_0x68ea('0x39')]['find']({'where':{'id':_0x3dd071[_0x68ea('0xbb')]['id']}})[_0x68ea('0x25')](handleEntityNotFound(_0x10f90,null))[_0x68ea('0x25')](removeEntity(_0x10f90,null))[_0x68ea('0x30')](handleError(_0x10f90,null));};exports['describe']=function(_0xa8dae4,_0x5c4819){return db[_0x68ea('0x39')][_0x68ea('0xbc')]()[_0x68ea('0x25')](respondWithResult(_0x5c4819,null))['catch'](handleError(_0x5c4819,null));};exports['addMessage']=function(_0x3af8de,_0x2ca542,_0x3109c6){return db[_0x68ea('0xbd')][_0x68ea('0xb9')]({'where':{'id':_0x3af8de[_0x68ea('0xbb')]['id']}})[_0x68ea('0x25')](handleEntityNotFound(_0x2ca542,null))['then'](function(_0xb4fcb6){if(_0xb4fcb6){return _0xb4fcb6['addMessage'](_0x3af8de[_0x68ea('0x75')]['ids'],_[_0x68ea('0xbe')](_0x3af8de[_0x68ea('0x75')],[_0x68ea('0xbf'),'id'])||{});}})['then'](respondWithResult(_0x2ca542,null))[_0x68ea('0x30')](handleError(_0x2ca542,null));};exports[_0x68ea('0xc0')]=function(_0x33450c,_0x2fca79,_0x2d9a60){var _0x486c93={'raw':![],'where':{}};var _0x3ab3e8={};var _0x215eb3={'count':0x0,'rows':[]};return db[_0x68ea('0x39')][_0x68ea('0xc1')]({'where':{'id':_0x33450c[_0x68ea('0xbb')]['id']}})[_0x68ea('0x25')](handleEntityNotFound(_0x2fca79,null))[_0x68ea('0x25')](function(_0x5a9c2a){if(_0x5a9c2a){_0x3ab3e8['model']=_[_0x68ea('0x40')](db['FaxMessage']['rawAttributes']);_0x3ab3e8[_0x68ea('0x3f')]=_['keys'](_0x33450c['query']);_0x3ab3e8[_0x68ea('0x41')]=_[_0x68ea('0x42')](_0x3ab3e8[_0x68ea('0x3e')],_0x3ab3e8[_0x68ea('0x3f')]);_0x486c93[_0x68ea('0x43')]=_[_0x68ea('0x42')](_0x3ab3e8[_0x68ea('0x3e')],qs[_0x68ea('0x44')](_0x33450c[_0x68ea('0x3f')][_0x68ea('0x44')]));_0x486c93[_0x68ea('0x43')]=_0x486c93[_0x68ea('0x43')][_0x68ea('0x45')]?_0x486c93['attributes']:_0x3ab3e8[_0x68ea('0x3e')];if(!_0x33450c['query'][_0x68ea('0x46')]('nolimit')){_0x486c93[_0x68ea('0x1f')]=qs[_0x68ea('0x1f')](_0x33450c[_0x68ea('0x3f')][_0x68ea('0x1f')]);_0x486c93[_0x68ea('0x1c')]=qs[_0x68ea('0x1c')](_0x33450c[_0x68ea('0x3f')][_0x68ea('0x1c')]);}_0x486c93['order']=qs[_0x68ea('0x49')](_0x33450c[_0x68ea('0x3f')][_0x68ea('0x49')]);_0x486c93[_0x68ea('0x4a')]=qs[_0x68ea('0x41')](_[_0x68ea('0x4b')](_0x33450c[_0x68ea('0x3f')],_0x3ab3e8[_0x68ea('0x41')]));_0x486c93[_0x68ea('0x4a')]['FaxInteractionId']=_0x5a9c2a['id'];if(_0x33450c[_0x68ea('0x3f')][_0x68ea('0x83')]){_0x486c93['where']=_['merge'](_0x486c93[_0x68ea('0x4a')],{'$or':_[_0x68ea('0x2a')](_0x486c93['attributes'],function(_0x201241){var _0x490f6c={};_0x490f6c[_0x201241]={'$like':'%'+_0x33450c['query'][_0x68ea('0x83')]+'%'};return _0x490f6c;})});}if(_0x33450c[_0x68ea('0x3f')][_0x68ea('0xc2')]){var _0x470389=_0x33450c[_0x68ea('0x3f')][_0x68ea('0xc2')]['split'](',');var _0x12a9b9={};_0x12a9b9[_0x470389[0x0]]={'$gte':moment(_0x470389[0x1])[_0x68ea('0xc3')](_0x68ea('0xc4'))};_0x486c93[_0x68ea('0x4a')]=_[_0x68ea('0x9d')](_0x486c93[_0x68ea('0x4a')],_0x12a9b9);}_0x486c93=_[_0x68ea('0x9d')]({},_0x486c93,_0x33450c['options']);return db[_0x68ea('0xbd')][_0x68ea('0x1e')]({'where':_0x486c93[_0x68ea('0x4a')]})[_0x68ea('0x25')](function(_0x5d6e3c){_0x215eb3[_0x68ea('0x1e')]=_0x5d6e3c;if(_0x33450c[_0x68ea('0x3f')][_0x68ea('0xb6')]){_0x486c93[_0x68ea('0xb7')]=[{'all':!![]}];}return db['FaxMessage'][_0x68ea('0xc5')](_0x486c93);})[_0x68ea('0x25')](function(_0x3a133a){_0x215eb3['rows']=_0x3a133a;return _0x215eb3;});}})[_0x68ea('0x25')](respondWithFilteredResult(_0x2fca79,_0x486c93))[_0x68ea('0x30')](handleError(_0x2fca79,null));};exports[_0x68ea('0xc6')]=function(_0x1baaec,_0x2b1e72,_0xe0580a){return db['FaxInteraction'][_0x68ea('0xb9')]({'where':{'id':_0x1baaec[_0x68ea('0xbb')]['id']}})[_0x68ea('0x25')](handleEntityNotFound(_0x2b1e72,null))[_0x68ea('0x25')](function(_0x418a3b){if(_0x418a3b){return _0x418a3b[_0x68ea('0xc7')](_0x1baaec[_0x68ea('0x75')][_0x68ea('0xbf')],_[_0x68ea('0xbe')](_0x1baaec[_0x68ea('0x75')],[_0x68ea('0xbf'),'id'])||{})['spread'](function(){return db[_0x68ea('0xc8')][_0x68ea('0xc5')]({'attributes':['id',_0x68ea('0x28'),_0x68ea('0x4e')],'where':{'id':_0x1baaec[_0x68ea('0x75')][_0x68ea('0xbf')]}});})[_0x68ea('0x25')](function(_0x45ea41){socket[_0x68ea('0xc9')](_0x68ea('0xca'),{'id':Number(_0x1baaec['params']['id']),'tags':_0x45ea41||[]});return{'id':Number(_0x1baaec[_0x68ea('0xbb')]['id']),'tags':_0x45ea41||[]};});}})['then'](respondWithResult(_0x2b1e72,null))[_0x68ea('0x30')](handleError(_0x2b1e72,null));};exports['removeTags']=function(_0x304a8f,_0x3bb1ea,_0x4db6df){return db[_0x68ea('0x39')][_0x68ea('0xb9')]({'where':{'id':_0x304a8f['params']['id']}})[_0x68ea('0x25')](handleEntityNotFound(_0x3bb1ea,null))['then'](function(_0x1134b4){if(_0x1134b4){return _0x1134b4[_0x68ea('0xcb')](_0x304a8f[_0x68ea('0x3f')][_0x68ea('0xbf')]);}})[_0x68ea('0x25')](respondWithStatusCode(_0x3bb1ea,null))[_0x68ea('0x30')](handleError(_0x3bb1ea,null));};exports[_0x68ea('0xcc')]=function(_0x2b586d,_0x176216){var _0x4c57dc=moment()[_0x68ea('0xcd')]()[_0x68ea('0x9b')]();var _0x5ea3dc=path['join'](config[_0x68ea('0xce')],'server',_0x68ea('0xcf'),_0x68ea('0xd0'));var _0x3b5584=path['join'](config[_0x68ea('0xce')],_0x68ea('0xd1'),_0x68ea('0xcf'),_0x68ea('0xd2'));var _0x454ddc=path['join'](_0x5ea3dc,_0x4c57dc);var _0x1527a6=util[_0x68ea('0xc3')](_0x68ea('0xd3'),_0x2b586d[_0x68ea('0xbb')]['id'],_0x4c57dc);var _0x408ec2=path['join'](_0x5ea3dc,_0x1527a6);var _0x187d7a=[];_0x187d7a['push']({'model':db[_0x68ea('0xd4')],'as':_0x68ea('0xd4'),'raw':!![]});var _0x590b7a=[{'model':db[_0x68ea('0xbd')],'as':_0x68ea('0xd5'),'attributes':['id','body','createdAt'],'include':_0x187d7a}];return db[_0x68ea('0x39')][_0x68ea('0xb9')]({'where':{'id':_0x2b586d[_0x68ea('0xbb')]['id']},'include':_0x590b7a})[_0x68ea('0x25')](handleEntityNotFound(_0x176216,null))[_0x68ea('0x25')](function(_0x5b3656){if(_0x5b3656&&_0x5b3656[_0x68ea('0xd5')]){var _0x561eac=_0x5b3656['get']({'plain':!![]});fs[_0x68ea('0xd6')](_0x454ddc);for(var _0x4494e5=0x0;_0x4494e5<_0x561eac['Messages'][_0x68ea('0x45')];_0x4494e5++){var _0x17b00e=_0x561eac['Messages'][_0x4494e5]['Attachment'];if(_0x17b00e){var _0x4abe1f=path['join'](_0x3b5584,_0x17b00e[_0x68ea('0xd7')]);if(fs[_0x68ea('0xd8')](_0x4abe1f)){fs[_0x68ea('0xd9')](_0x4abe1f)[_0x68ea('0xda')](fs[_0x68ea('0xdb')](path['join'](_0x454ddc,_0x17b00e['basename'])));}}}return BPromise[_0x68ea('0x93')]()[_0x68ea('0x25')](function(){return new BPromise(function(_0xc51443,_0x5f1e92){zipdir(_0x454ddc,{'saveTo':_0x408ec2},function(_0x4ba4cf,_0x3a8eb5){if(_0x4ba4cf)return _0x5f1e92(_0x4ba4cf);return _0xc51443(_0x3a8eb5);});})['then'](function(){return new BPromise(function(_0x1fdfe2,_0x17037b){rimraf(_0x454ddc,function(_0x1ed8a2){if(_0x1ed8a2)_0x17037b(_0x1ed8a2);return _0x1fdfe2();});});})[_0x68ea('0x25')](function(){return _0x176216[_0x68ea('0xcc')](_0x408ec2,_0x1527a6,function(_0x5463d1){if(_0x5463d1){console[_0x68ea('0xdc')](_0x68ea('0xdd'),_0x5463d1);}else{fs[_0x68ea('0xde')](_0x408ec2);}});});});}else{return _0x176216['sendStatus'](0xc8);}})['catch'](handleError(_0x176216,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index ce58a3d..4a8fc0d 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 _0x1b37=['events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports'];(function(_0x4c8086,_0x5cfe6b){var _0x189364=function(_0xfc0f9f){while(--_0xfc0f9f){_0x4c8086['push'](_0x4c8086['shift']());}};_0x189364(++_0x5cfe6b);}(_0x1b37,0x176));var _0x71b3=function(_0x1bcd54,_0x19f631){_0x1bcd54=_0x1bcd54-0x0;var _0x170e4f=_0x1b37[_0x1bcd54];return _0x170e4f;};'use strict';var EventEmitter=require(_0x71b3('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x71b3('0x1')];var FaxMessage=require(_0x71b3('0x2'))['db'][_0x71b3('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x71b3('0x4')](0x0);var events={'afterCreate':_0x71b3('0x5'),'afterUpdate':_0x71b3('0x6'),'afterDestroy':'remove'};function emitEvent(_0x1ed64a){return function(_0x478881,_0x12e35b,_0x339b78){_0x478881[_0x71b3('0x7')]({'attributes':['id'],'raw':!![]})[_0x71b3('0x8')](function(_0x1f73ff){_0x478881[_0x71b3('0x9')]('Users',_0x1f73ff[_0x71b3('0xa')](function(_0x3ee594){return{'id':_0x3ee594['id']};}));return FaxMessage[_0x71b3('0xb')]({'where':{'FaxInteractionId':_0x478881['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x18b423){_0x478881[_0x71b3('0x9')](_0x71b3('0xc'),_0x18b423['length']);FaxInteractionEvents['emit'](_0x1ed64a+':'+_0x478881['id'],_0x478881);FaxInteractionEvents[_0x71b3('0xd')](_0x1ed64a,_0x478881);_0x339b78(null);})['catch'](_0x339b78(null));};}for(var e in events){if(events[_0x71b3('0xe')](e)){var event=events[e];FaxInteraction[_0x71b3('0xf')](e,emitEvent(event));}}module[_0x71b3('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x3cb5=['emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','save','update','getUsers','then','setDataValue','map','findAll','length'];(function(_0x442415,_0x57a453){var _0xccad62=function(_0x4f887d){while(--_0x4f887d){_0x442415['push'](_0x442415['shift']());}};_0xccad62(++_0x57a453);}(_0x3cb5,0xd5));var _0x53cb=function(_0x235d85,_0x2db080){_0x235d85=_0x235d85-0x0;var _0x559ead=_0x3cb5[_0x235d85];return _0x559ead;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x53cb('0x0'))['db'][_0x53cb('0x1')];var FaxMessage=require(_0x53cb('0x0'))['db'][_0x53cb('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x53cb('0x3'),'afterUpdate':_0x53cb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x35c9da){return function(_0xd16fa7,_0x5dd4cd,_0x3bdd65){_0xd16fa7[_0x53cb('0x5')]({'attributes':['id'],'raw':!![]})[_0x53cb('0x6')](function(_0xc8e4cd){_0xd16fa7[_0x53cb('0x7')]('Users',_0xc8e4cd[_0x53cb('0x8')](function(_0x4b069f){return{'id':_0x4b069f['id']};}));return FaxMessage[_0x53cb('0x9')]({'where':{'FaxInteractionId':_0xd16fa7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2f9c01){_0xd16fa7[_0x53cb('0x7')]('unreadMessages',_0x2f9c01[_0x53cb('0xa')]);FaxInteractionEvents[_0x53cb('0xb')](_0x35c9da+':'+_0xd16fa7['id'],_0xd16fa7);FaxInteractionEvents[_0x53cb('0xb')](_0x35c9da,_0xd16fa7);_0x3bdd65(null);})[_0x53cb('0xc')](_0x3bdd65(null));};}for(var e in events){if(events[_0x53cb('0xd')](e)){var event=events[e];FaxInteraction[_0x53cb('0xe')](e,emitEvent(event));}}module[_0x53cb('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index e445087..2427492 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 _0x0628=['closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','fax_interactions','changed'];(function(_0x1619b6,_0x5c829f){var _0x3bfb60=function(_0x4102ca){while(--_0x4102ca){_0x1619b6['push'](_0x1619b6['shift']());}};_0x3bfb60(++_0x5c829f);}(_0x0628,0x15c));var _0x8062=function(_0x7d76fd,_0x1f5832){_0x7d76fd=_0x7d76fd-0x0;var _0x236d64=_0x0628[_0x7d76fd];return _0x236d64;};'use strict';var _=require(_0x8062('0x0'));var util=require(_0x8062('0x1'));var logger=require('../../config/logger')(_0x8062('0x2'));var moment=require(_0x8062('0x3'));var BPromise=require(_0x8062('0x4'));var rp=require(_0x8062('0x5'));var fs=require('fs');var path=require(_0x8062('0x6'));var rimraf=require('rimraf');var config=require(_0x8062('0x7'));var attributes=require('./faxInteraction.attributes');module[_0x8062('0x8')]=function(_0x232088,_0x28d7d5){return _0x232088[_0x8062('0x9')]('FaxInteraction',attributes,{'tableName':_0x8062('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c5d10,_0x16e0de,_0x3c2a55){if(_0x5c5d10[_0x8062('0xb')](_0x8062('0xc'))){_0x5c5d10[_0x8062('0xd')]=moment()['format'](_0x8062('0xe'));}_0x3c2a55(null,_0x5c5d10);}}});}; \ No newline at end of file +var _0x70f0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x33e215,_0xbf058b){var _0x276c0e=function(_0x30ee69){while(--_0x30ee69){_0x33e215['push'](_0x33e215['shift']());}};_0x276c0e(++_0xbf058b);}(_0x70f0,0x80));var _0x070f=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0x70f0[_0x545a3a];return _0x5a5493;};'use strict';var _=require(_0x070f('0x0'));var util=require(_0x070f('0x1'));var logger=require(_0x070f('0x2'))(_0x070f('0x3'));var moment=require(_0x070f('0x4'));var BPromise=require(_0x070f('0x5'));var rp=require(_0x070f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x070f('0x7'));module[_0x070f('0x8')]=function(_0x252fc6,_0x3014cc){return _0x252fc6[_0x070f('0x9')](_0x070f('0xa'),attributes,{'tableName':_0x070f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2104f1,_0x589fd1,_0x41aece){if(_0x2104f1[_0x070f('0xc')]('closed')){_0x2104f1[_0x070f('0xd')]=moment()[_0x070f('0xe')](_0x070f('0xf'));}_0x41aece(null,_0x2104f1);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index a0d1008..7d7b980 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 _0xd848=['stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','options','raw','where','limit','debug','find','addTags','body','ids','omit','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1c73c0,_0x303428){var _0x58de91=function(_0x520844){while(--_0x520844){_0x1c73c0['push'](_0x1c73c0['shift']());}};_0x58de91(++_0x303428);}(_0xd848,0x172));var _0x8d84=function(_0x590381,_0x5c3948){_0x590381=_0x590381-0x0;var _0xe300df=_0xd848[_0x590381];return _0xe300df;};'use strict';var _=require(_0x8d84('0x0'));var util=require('util');var moment=require(_0x8d84('0x1'));var BPromise=require('bluebird');var rs=require(_0x8d84('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d84('0x3'))['db'];var utils=require(_0x8d84('0x4'));var logger=require(_0x8d84('0x5'))(_0x8d84('0x6'));var config=require('../../config/environment');var jayson=require(_0x8d84('0x7'));var client=jayson[_0x8d84('0x8')][_0x8d84('0x9')]({'port':0x232a});config[_0x8d84('0xa')]=_[_0x8d84('0xb')](config['redis'],{'host':_0x8d84('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8d84('0xa')]));require(_0x8d84('0xd'))[_0x8d84('0xe')](socket);function respondWithRpcPromise(_0x5fbcde,_0x4edf7e,_0x39e0bb){return new BPromise(function(_0x80f32f,_0x2773e0){return client['request'](_0x5fbcde,_0x39e0bb)[_0x8d84('0xf')](function(_0x4c4294){logger[_0x8d84('0x10')](_0x8d84('0x11'),_0x4edf7e,'request\x20sent');logger['debug'](_0x8d84('0x12'),_0x4edf7e,_0x8d84('0x13'),JSON[_0x8d84('0x14')](_0x4c4294));if(_0x4c4294[_0x8d84('0x15')]){if(_0x4c4294['error'][_0x8d84('0x16')]===0x1f4){logger[_0x8d84('0x15')](_0x8d84('0x11'),_0x4edf7e,_0x4c4294[_0x8d84('0x15')][_0x8d84('0x17')]);return _0x2773e0(_0x4c4294['error']['message']);}logger[_0x8d84('0x15')](_0x8d84('0x11'),_0x4edf7e,_0x4c4294[_0x8d84('0x15')]['message']);return _0x80f32f(_0x4c4294['error'][_0x8d84('0x17')]);}else{logger[_0x8d84('0x10')](_0x8d84('0x11'),_0x4edf7e,_0x8d84('0x13'));_0x80f32f(_0x4c4294[_0x8d84('0x18')][_0x8d84('0x17')]);}})[_0x8d84('0x19')](function(_0x2c3daf){logger[_0x8d84('0x15')](_0x8d84('0x11'),_0x4edf7e,_0x2c3daf);_0x2773e0(_0x2c3daf);});});}exports[_0x8d84('0x1a')]=function(_0x3ccc48){var _0x46a353=this;return new Promise(function(_0x3af7fd,_0x2c1b7d){return db[_0x8d84('0x1b')]['update'](_0x3ccc48['body'],{'raw':_0x3ccc48[_0x8d84('0x1c')]?_0x3ccc48['options'][_0x8d84('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ccc48[_0x8d84('0x1c')]?_0x3ccc48[_0x8d84('0x1c')][_0x8d84('0x1e')]||null:null,'attributes':_0x3ccc48[_0x8d84('0x1c')]?_0x3ccc48[_0x8d84('0x1c')]['attributes']||null:null,'limit':_0x3ccc48[_0x8d84('0x1c')]?_0x3ccc48[_0x8d84('0x1c')][_0x8d84('0x1f')]||null:null})[_0x8d84('0xf')](function(_0x4171d0){logger[_0x8d84('0x10')]('UpdateFaxInteraction',_0x3ccc48);logger[_0x8d84('0x20')]('UpdateFaxInteraction',_0x3ccc48,JSON[_0x8d84('0x14')](_0x4171d0));_0x3af7fd(_0x4171d0);})[_0x8d84('0x19')](function(_0x2e9e94){logger[_0x8d84('0x15')](_0x8d84('0x1a'),_0x2e9e94['message'],_0x3ccc48);_0x2c1b7d(_0x46a353[_0x8d84('0x15')](0x1f4,_0x2e9e94[_0x8d84('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x1728d7){return new Promise(function(_0x871fe4,_0x40b8b8){return db['FaxInteraction'][_0x8d84('0x21')]({'where':_0x1728d7['options']?_0x1728d7[_0x8d84('0x1c')][_0x8d84('0x1e')]||null:null})[_0x8d84('0xf')](function(_0x2b1b8c){if(_0x2b1b8c){return _0x2b1b8c[_0x8d84('0x22')](_0x1728d7[_0x8d84('0x23')][_0x8d84('0x24')],_[_0x8d84('0x25')](_0x1728d7[_0x8d84('0x23')],['ids','id'])||{});}})['spread'](function(_0x4ce976){logger[_0x8d84('0x10')]('AddTags',_0x1728d7);logger[_0x8d84('0x20')](_0x8d84('0x26'),_0x1728d7,JSON[_0x8d84('0x14')](_0x4ce976));_0x871fe4(_0x4ce976);})[_0x8d84('0x19')](function(_0x3b38dd){logger['error'](_0x8d84('0x26'),_0x3b38dd[_0x8d84('0x17')],_0x1728d7);_0x40b8b8(_this['error'](0x1f4,_0x3b38dd[_0x8d84('0x17')]));});});}; \ No newline at end of file +var _0x0c71=['catch','UpdateFaxInteraction','body','options','raw','where','limit','debug','AddTagsToFaxInteraction','find','ids','omit','AddTags','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x0c71,0x175));var _0x10c7=function(_0x5e80d6,_0x4ab0d6){_0x5e80d6=_0x5e80d6-0x0;var _0x6835b5=_0x0c71[_0x5e80d6];return _0x6835b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x10c7('0x0'));var BPromise=require('bluebird');var rs=require(_0x10c7('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10c7('0x2'))['db'];var utils=require(_0x10c7('0x3'));var logger=require(_0x10c7('0x4'))('rpc');var config=require(_0x10c7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x10c7('0x6')][_0x10c7('0x7')]({'port':0x232a});config[_0x10c7('0x8')]=_[_0x10c7('0x9')](config[_0x10c7('0x8')],{'host':_0x10c7('0xa'),'port':0x18eb});var socket=require(_0x10c7('0xb'))(new Redis(config['redis']));require(_0x10c7('0xc'))[_0x10c7('0xd')](socket);function respondWithRpcPromise(_0x2876d4,_0x49306d,_0xef9fc9){return new BPromise(function(_0x857e5c,_0x569a4a){return client['request'](_0x2876d4,_0xef9fc9)[_0x10c7('0xe')](function(_0x5c3b33){logger['info'](_0x10c7('0xf'),_0x49306d,_0x10c7('0x10'));logger['debug'](_0x10c7('0x11'),_0x49306d,_0x10c7('0x10'),JSON[_0x10c7('0x12')](_0x5c3b33));if(_0x5c3b33[_0x10c7('0x13')]){if(_0x5c3b33[_0x10c7('0x13')][_0x10c7('0x14')]===0x1f4){logger[_0x10c7('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x49306d,_0x5c3b33[_0x10c7('0x13')][_0x10c7('0x15')]);return _0x569a4a(_0x5c3b33['error'][_0x10c7('0x15')]);}logger[_0x10c7('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x49306d,_0x5c3b33[_0x10c7('0x13')]['message']);return _0x857e5c(_0x5c3b33[_0x10c7('0x13')][_0x10c7('0x15')]);}else{logger[_0x10c7('0x16')](_0x10c7('0xf'),_0x49306d,_0x10c7('0x10'));_0x857e5c(_0x5c3b33['result'][_0x10c7('0x15')]);}})[_0x10c7('0x17')](function(_0x1034cf){logger[_0x10c7('0x13')](_0x10c7('0xf'),_0x49306d,_0x1034cf);_0x569a4a(_0x1034cf);});});}exports[_0x10c7('0x18')]=function(_0x20493c){var _0xb6ea12=this;return new Promise(function(_0x479b2d,_0x2db8f3){return db['FaxInteraction']['update'](_0x20493c[_0x10c7('0x19')],{'raw':_0x20493c[_0x10c7('0x1a')]?_0x20493c[_0x10c7('0x1a')][_0x10c7('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20493c[_0x10c7('0x1a')]?_0x20493c[_0x10c7('0x1a')][_0x10c7('0x1c')]||null:null,'attributes':_0x20493c['options']?_0x20493c[_0x10c7('0x1a')]['attributes']||null:null,'limit':_0x20493c[_0x10c7('0x1a')]?_0x20493c['options'][_0x10c7('0x1d')]||null:null})[_0x10c7('0xe')](function(_0x491738){logger[_0x10c7('0x16')](_0x10c7('0x18'),_0x20493c);logger[_0x10c7('0x1e')](_0x10c7('0x18'),_0x20493c,JSON['stringify'](_0x491738));_0x479b2d(_0x491738);})[_0x10c7('0x17')](function(_0x1ffb23){logger[_0x10c7('0x13')](_0x10c7('0x18'),_0x1ffb23[_0x10c7('0x15')],_0x20493c);_0x2db8f3(_0xb6ea12[_0x10c7('0x13')](0x1f4,_0x1ffb23[_0x10c7('0x15')]));});});};exports[_0x10c7('0x1f')]=function(_0x1c13f7){return new Promise(function(_0x351c24,_0x517b31){return db['FaxInteraction'][_0x10c7('0x20')]({'where':_0x1c13f7[_0x10c7('0x1a')]?_0x1c13f7[_0x10c7('0x1a')][_0x10c7('0x1c')]||null:null})['then'](function(_0x1edbf7){if(_0x1edbf7){return _0x1edbf7['addTags'](_0x1c13f7['body'][_0x10c7('0x21')],_[_0x10c7('0x22')](_0x1c13f7['body'],[_0x10c7('0x21'),'id'])||{});}})['spread'](function(_0x37fb7c){logger[_0x10c7('0x16')]('AddTags',_0x1c13f7);logger[_0x10c7('0x1e')](_0x10c7('0x23'),_0x1c13f7,JSON[_0x10c7('0x12')](_0x37fb7c));_0x351c24(_0x37fb7c);})[_0x10c7('0x17')](function(_0xc5ce6d){logger[_0x10c7('0x13')](_0x10c7('0x23'),_0xc5ce6d['message'],_0x1c13f7);_0x517b31(_this['error'](0x1f4,_0xc5ce6d['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 4d7f809..116d5c0 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 _0x9aad=['faxInteraction:','./faxInteraction.events','remove','update','register','length'];(function(_0x1bb121,_0x5d4138){var _0x5dbb01=function(_0x3c9fa1){while(--_0x3c9fa1){_0x1bb121['push'](_0x1bb121['shift']());}};_0x5dbb01(++_0x5d4138);}(_0x9aad,0x1e7));var _0xd9aa=function(_0x5d203c,_0x14b4e9){_0x5d203c=_0x5d203c-0x0;var _0x4c2e6a=_0x9aad[_0x5d203c];return _0x4c2e6a;};'use strict';var FaxInteractionEvents=require(_0xd9aa('0x0'));var events=['save',_0xd9aa('0x1'),_0xd9aa('0x2')];function createListener(_0x100a36,_0x33a107){return function(_0x25fc64){_0x33a107['emit'](_0x100a36,_0x25fc64);};}function removeListener(_0x179b9a,_0x590239){return function(){FaxInteractionEvents['removeListener'](_0x179b9a,_0x590239);};}exports[_0xd9aa('0x3')]=function(_0x534d30){for(var _0x2cb7db=0x0,_0x2e39b9=events[_0xd9aa('0x4')];_0x2cb7db<_0x2e39b9;_0x2cb7db++){var _0x486d3d=events[_0x2cb7db];var _0x2e6eb1=createListener(_0xd9aa('0x5')+_0x486d3d,_0x534d30);FaxInteractionEvents['on'](_0x486d3d,_0x2e6eb1);}}; \ No newline at end of file +var _0xe37f=['emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xe37f,0x132));var _0xfe37=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0xe37f[_0x30c2ae];return _0x1ee1cc;};'use strict';var FaxInteractionEvents=require(_0xfe37('0x0'));var events=[_0xfe37('0x1'),'remove','update'];function createListener(_0x1fab4a,_0x240098){return function(_0x52da81){_0x240098[_0xfe37('0x2')](_0x1fab4a,_0x52da81);};}function removeListener(_0x2782f9,_0x36109e){return function(){FaxInteractionEvents[_0xfe37('0x3')](_0x2782f9,_0x36109e);};}exports[_0xfe37('0x4')]=function(_0x56e7b8){for(var _0x28f6a0=0x0,_0x2ce404=events[_0xfe37('0x5')];_0x28f6a0<_0x2ce404;_0x28f6a0++){var _0x110159=events[_0x28f6a0];var _0x1bf8e7=createListener(_0xfe37('0x6')+_0x110159,_0x56e7b8);FaxInteractionEvents['on'](_0x110159,_0x1bf8e7);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 9c64a05..c66934b 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 _0xc8e0=['destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','post','addMessage','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','delete','faxinteraction:destroy'];(function(_0x8113c1,_0x598354){var _0x2f67a8=function(_0xbdca4a){while(--_0xbdca4a){_0x8113c1['push'](_0x8113c1['shift']());}};_0x2f67a8(++_0x598354);}(_0xc8e0,0xb7));var _0x0c8e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc8e0[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x0c8e('0x0'));var util=require(_0x0c8e('0x1'));var path=require(_0x0c8e('0x2'));var timeout=require(_0x0c8e('0x3'));var express=require(_0x0c8e('0x4'));var router=express[_0x0c8e('0x5')]();var fs_extra=require(_0x0c8e('0x6'));var auth=require(_0x0c8e('0x7'));var interaction=require(_0x0c8e('0x8'));var config=require(_0x0c8e('0x9'));var controller=require('./faxInteraction.controller');router[_0x0c8e('0xa')]('/',auth[_0x0c8e('0xb')](),controller[_0x0c8e('0xc')]);router[_0x0c8e('0xa')](_0x0c8e('0xd'),auth['isAuthenticated'](),controller[_0x0c8e('0xe')]);router[_0x0c8e('0xa')](_0x0c8e('0xf'),auth['isAuthenticated'](),controller[_0x0c8e('0x10')]);router[_0x0c8e('0xa')]('/:id/messages',auth[_0x0c8e('0xb')](),controller[_0x0c8e('0x11')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x0c8e('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0c8e('0x12')]('/:id/messages',auth[_0x0c8e('0xb')](),controller[_0x0c8e('0x13')]);router[_0x0c8e('0x12')]('/:id/tags',auth[_0x0c8e('0xb')](),interaction[_0x0c8e('0x14')](_0x0c8e('0x15'),_0x0c8e('0x16')),controller['addTags']);router[_0x0c8e('0x17')]('/:id',auth[_0x0c8e('0xb')](),interaction[_0x0c8e('0x14')](_0x0c8e('0x15'),_0x0c8e('0x18')),controller['update']);router[_0x0c8e('0x19')](_0x0c8e('0xf'),auth['isAuthenticated'](),interaction[_0x0c8e('0x14')](_0x0c8e('0x15'),_0x0c8e('0x1a')),controller[_0x0c8e('0x1b')]);router[_0x0c8e('0x19')](_0x0c8e('0x1c'),auth[_0x0c8e('0xb')](),controller[_0x0c8e('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x074b=['isAuthenticated','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','addTags','faxinteraction:update','update','delete','/:id','faxinteraction:destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1e391b,_0x399a7f){var _0x5248e0=function(_0x1f998c){while(--_0x1f998c){_0x1e391b['push'](_0x1e391b['shift']());}};_0x5248e0(++_0x399a7f);}(_0x074b,0x195));var _0xb074=function(_0x31a6af,_0x1eff20){_0x31a6af=_0x31a6af-0x0;var _0x5c0bb0=_0x074b[_0x31a6af];return _0x5c0bb0;};'use strict';var multer=require(_0xb074('0x0'));var util=require(_0xb074('0x1'));var path=require(_0xb074('0x2'));var timeout=require(_0xb074('0x3'));var express=require(_0xb074('0x4'));var router=express[_0xb074('0x5')]();var fs_extra=require(_0xb074('0x6'));var auth=require(_0xb074('0x7'));var interaction=require(_0xb074('0x8'));var config=require(_0xb074('0x9'));var controller=require('./faxInteraction.controller');router[_0xb074('0xa')]('/',auth[_0xb074('0xb')](),controller['index']);router[_0xb074('0xa')](_0xb074('0xc'),auth[_0xb074('0xb')](),controller[_0xb074('0xd')]);router[_0xb074('0xa')]('/:id',auth[_0xb074('0xb')](),controller[_0xb074('0xe')]);router[_0xb074('0xa')](_0xb074('0xf'),auth[_0xb074('0xb')](),controller[_0xb074('0x10')]);router['get'](_0xb074('0x11'),auth['isAuthenticated'](),controller[_0xb074('0x12')]);router[_0xb074('0x13')]('/',auth[_0xb074('0xb')](),controller[_0xb074('0x14')]);router[_0xb074('0x13')](_0xb074('0xf'),auth[_0xb074('0xb')](),controller[_0xb074('0x15')]);router[_0xb074('0x13')](_0xb074('0x16'),auth['isAuthenticated'](),interaction[_0xb074('0x17')](_0xb074('0x18'),'faxinteraction:addtags'),controller[_0xb074('0x19')]);router['put']('/:id',auth[_0xb074('0xb')](),interaction['tracked'](_0xb074('0x18'),_0xb074('0x1a')),controller[_0xb074('0x1b')]);router[_0xb074('0x1c')](_0xb074('0x1d'),auth['isAuthenticated'](),interaction[_0xb074('0x17')](_0xb074('0x18'),_0xb074('0x1e')),controller['destroy']);router[_0xb074('0x1c')](_0xb074('0x16'),auth[_0xb074('0xb')](),controller['removeTags']);module[_0xb074('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 6376ec2..eef66f1 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 _0x6282=['TEXT','medium','out','DATE','sequelize','exports'];(function(_0x199e08,_0x492f72){var _0x558366=function(_0x3e61f1){while(--_0x3e61f1){_0x199e08['push'](_0x199e08['shift']());}};_0x558366(++_0x492f72);}(_0x6282,0x76));var _0x2628=function(_0x382735,_0x383755){_0x382735=_0x382735-0x0;var _0xfe25ae=_0x6282[_0x382735];return _0xfe25ae;};'use strict';var Sequelize=require(_0x2628('0x0'));module[_0x2628('0x1')]={'body':{'type':Sequelize[_0x2628('0x2')](_0x2628('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2628('0x4')),'defaultValue':_0x2628('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x2628('0x5')]}}; \ No newline at end of file +var _0xf0ba=['BOOLEAN','out','DATE','sequelize','exports','TEXT','medium'];(function(_0xa7fe51,_0x188fab){var _0x274596=function(_0x396a2d){while(--_0x396a2d){_0xa7fe51['push'](_0xa7fe51['shift']());}};_0x274596(++_0x188fab);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaf0b('0x0'));module[_0xaf0b('0x1')]={'body':{'type':Sequelize[_0xaf0b('0x2')](_0xaf0b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xaf0b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xaf0b('0x5')),'defaultValue':_0xaf0b('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xaf0b('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 74b4eb5..489e3e3 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 _0xfafd=['Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','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','localhost','socket.io-emitter','redis','./faxMessage.socket','register','jayson/promise','client','http','request','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','then','destroy','end','stack','name','send','index','map','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','VIRTUAL','merge','FaxMessage','includeAll','include','findAll','rows','params','keys','rawAttributes','options','find','update','body','describe','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','contact','User','fullname','email','internal','agent','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','interaction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','SELECT','interface','rejectmessage','findOne'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfafd,0x1bb));var _0xdfaf=function(_0x43ad21,_0x4062a4){_0x43ad21=_0x43ad21-0x0;var _0x5e4d8b=_0xfafd[_0x43ad21];return _0x5e4d8b;};'use strict';var emlformat=require(_0xdfaf('0x0'));var rimraf=require(_0xdfaf('0x1'));var zipdir=require(_0xdfaf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdfaf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdfaf('0x4'));var util=require(_0xdfaf('0x5'));var path=require(_0xdfaf('0x6'));var sox=require(_0xdfaf('0x7'));var csv=require(_0xdfaf('0x8'));var ejs=require(_0xdfaf('0x9'));var fs=require('fs');var fs_extra=require(_0xdfaf('0xa'));var _=require(_0xdfaf('0xb'));var squel=require(_0xdfaf('0xc'));var crypto=require(_0xdfaf('0xd'));var jsforce=require(_0xdfaf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdfaf('0x8'));var querystring=require('querystring');var Papa=require(_0xdfaf('0xf'));var Redis=require(_0xdfaf('0x10'));var authService=require(_0xdfaf('0x11'));var qs=require(_0xdfaf('0x12'));var as=require(_0xdfaf('0x13'));var hardwareService=require(_0xdfaf('0x14'));var logger=require(_0xdfaf('0x15'))('api');var utils=require(_0xdfaf('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfaf('0x17'));var db=require(_0xdfaf('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xdfaf('0x19'),'port':0x18eb});var socket=require(_0xdfaf('0x1a'))(new Redis(config[_0xdfaf('0x1b')]));require(_0xdfaf('0x1c'))[_0xdfaf('0x1d')](socket);var jayson=require(_0xdfaf('0x1e'));var client=jayson[_0xdfaf('0x1f')][_0xdfaf('0x20')]({'port':0x232c});var client9002=jayson[_0xdfaf('0x1f')][_0xdfaf('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5c1262,_0x2e1e18,_0x1766d6,_0x58b27f){return new BPromise(function(_0x34e08b,_0x3d651d){var _0x24859f=_0x58b27f||client;return _0x24859f[_0xdfaf('0x21')](_0x5c1262,_0x1766d6)['then'](function(_0x2c368f){logger['info'](_0xdfaf('0x22'),_0x2e1e18,_0xdfaf('0x23'));logger['debug'](_0xdfaf('0x24'),_0x2e1e18,'request\x20sent',JSON[_0xdfaf('0x25')](_0x2c368f));if(_0x2c368f[_0xdfaf('0x26')]){if(_0x2c368f[_0xdfaf('0x26')][_0xdfaf('0x27')]===0x1f4){logger[_0xdfaf('0x26')](_0xdfaf('0x22'),_0x2e1e18,_0x2c368f['error'][_0xdfaf('0x28')]);return _0x3d651d(_0x2c368f[_0xdfaf('0x26')][_0xdfaf('0x28')]);}logger[_0xdfaf('0x26')](_0xdfaf('0x22'),_0x2e1e18,_0x2c368f[_0xdfaf('0x26')][_0xdfaf('0x28')]);return _0x34e08b(_0x2c368f[_0xdfaf('0x26')]['message']);}else{logger[_0xdfaf('0x29')](_0xdfaf('0x22'),_0x2e1e18,_0xdfaf('0x23'));_0x34e08b(_0x2c368f[_0xdfaf('0x2a')][_0xdfaf('0x28')]);}})[_0xdfaf('0x2b')](function(_0x40dc4d){logger['error'](_0xdfaf('0x22'),_0x2e1e18,_0x40dc4d);_0x3d651d(_0x40dc4d);});});}function respondWithStatusCode(_0x47a934,_0x447931){_0x447931=_0x447931||0xcc;return function(_0x546043){if(_0x546043){return _0x47a934[_0xdfaf('0x2c')](_0x447931);}return _0x47a934[_0xdfaf('0x2d')](_0x447931)['end']();};}function respondWithResult(_0x5114a0,_0x2949eb){_0x2949eb=_0x2949eb||0xc8;return function(_0x2a547a){if(_0x2a547a){return _0x5114a0[_0xdfaf('0x2d')](_0x2949eb)[_0xdfaf('0x2e')](_0x2a547a);}};}function respondWithFilteredResult(_0x513395,_0x1aad69){return function(_0x4a2666){if(_0x4a2666){var _0x33a6e8=typeof _0x1aad69['offset']===_0xdfaf('0x2f')&&typeof _0x1aad69[_0xdfaf('0x30')]===_0xdfaf('0x2f');var _0x34fae8=_0x4a2666['count'];var _0x3add4d=_0x33a6e8?0x0:_0x1aad69[_0xdfaf('0x31')];var _0x4a245f=_0x33a6e8?_0x4a2666[_0xdfaf('0x32')]:_0x1aad69[_0xdfaf('0x31')]+_0x1aad69[_0xdfaf('0x30')];var _0x4fd432;if(_0x4a245f>=_0x34fae8){_0x4a245f=_0x34fae8;_0x4fd432=0xc8;}else{_0x4fd432=0xce;}_0x513395[_0xdfaf('0x2d')](_0x4fd432);return _0x513395[_0xdfaf('0x33')](_0xdfaf('0x34'),_0x3add4d+'-'+_0x4a245f+'/'+_0x34fae8)[_0xdfaf('0x2e')](_0x4a2666);}return null;};}function patchUpdates(_0x559b4e){return function(_0x566b1b){try{jsonpatch['apply'](_0x566b1b,_0x559b4e,!![]);}catch(_0x20e848){return BPromise[_0xdfaf('0x35')](_0x20e848);}return _0x566b1b[_0xdfaf('0x36')]();};}function saveUpdates(_0x14014e,_0x271840){return function(_0x3ca45d){if(_0x3ca45d){return _0x3ca45d['update'](_0x14014e)[_0xdfaf('0x37')](function(_0x40f2a3){return _0x40f2a3;});}return null;};}function removeEntity(_0x5e8700,_0x38f65){return function(_0x55ebaf){if(_0x55ebaf){return _0x55ebaf[_0xdfaf('0x38')]()['then'](function(){_0x5e8700[_0xdfaf('0x2d')](0xcc)[_0xdfaf('0x39')]();});}};}function handleEntityNotFound(_0x3f886c,_0x562b07){return function(_0x339fc6){if(!_0x339fc6){_0x3f886c[_0xdfaf('0x2c')](0x194);}return _0x339fc6;};}function handleError(_0x32c40c,_0xffdd05){_0xffdd05=_0xffdd05||0x1f4;return function(_0x4bf968){logger[_0xdfaf('0x26')](_0x4bf968[_0xdfaf('0x3a')]);if(_0x4bf968[_0xdfaf('0x3b')]){delete _0x4bf968[_0xdfaf('0x3b')];}_0x32c40c[_0xdfaf('0x2d')](_0xffdd05)[_0xdfaf('0x3c')](_0x4bf968);};}exports[_0xdfaf('0x3d')]=function(_0x505c8f,_0x850370){var _0x18ff7e={},_0x142a8b={},_0x375a04={'count':0x0,'rows':[]};var _0x516092=_[_0xdfaf('0x3e')](db['FaxMessage']['rawAttributes'],function(_0x1e7f72){return{'name':_0x1e7f72[_0xdfaf('0x3f')],'type':_0x1e7f72[_0xdfaf('0x40')]['key']};});_0x142a8b[_0xdfaf('0x41')]=_[_0xdfaf('0x3e')](_0x516092,'name');_0x142a8b[_0xdfaf('0x42')]=_['keys'](_0x505c8f[_0xdfaf('0x42')]);_0x142a8b[_0xdfaf('0x43')]=_[_0xdfaf('0x44')](_0x142a8b[_0xdfaf('0x41')],_0x142a8b['query']);_0x18ff7e[_0xdfaf('0x45')]=_[_0xdfaf('0x44')](_0x142a8b[_0xdfaf('0x41')],qs[_0xdfaf('0x46')](_0x505c8f[_0xdfaf('0x42')]['fields']));_0x18ff7e['attributes']=_0x18ff7e[_0xdfaf('0x45')][_0xdfaf('0x47')]?_0x18ff7e[_0xdfaf('0x45')]:_0x142a8b[_0xdfaf('0x41')];if(!_0x505c8f['query']['hasOwnProperty'](_0xdfaf('0x48'))){_0x18ff7e[_0xdfaf('0x30')]=qs[_0xdfaf('0x30')](_0x505c8f['query'][_0xdfaf('0x30')]);_0x18ff7e[_0xdfaf('0x31')]=qs[_0xdfaf('0x31')](_0x505c8f[_0xdfaf('0x42')][_0xdfaf('0x31')]);}_0x18ff7e['order']=qs[_0xdfaf('0x49')](_0x505c8f[_0xdfaf('0x42')]['sort']);_0x18ff7e[_0xdfaf('0x4a')]=qs[_0xdfaf('0x43')](_['pick'](_0x505c8f[_0xdfaf('0x42')],_0x142a8b[_0xdfaf('0x43')]),_0x516092);if(_0x505c8f[_0xdfaf('0x42')][_0xdfaf('0x4b')]){_0x18ff7e['where']=_['merge'](_0x18ff7e[_0xdfaf('0x4a')],{'$or':_[_0xdfaf('0x3e')](_0x516092,function(_0xdd9b6c){if(_0xdd9b6c['type']!==_0xdfaf('0x4c')){var _0x37f0f6={};_0x37f0f6[_0xdd9b6c['name']]={'$like':'%'+_0x505c8f[_0xdfaf('0x42')][_0xdfaf('0x4b')]+'%'};return _0x37f0f6;}})});}_0x18ff7e=_[_0xdfaf('0x4d')]({},_0x18ff7e,_0x505c8f['options']);var _0x5c6263={'where':_0x18ff7e[_0xdfaf('0x4a')]};return db[_0xdfaf('0x4e')][_0xdfaf('0x32')](_0x5c6263)[_0xdfaf('0x37')](function(_0x194ae6){_0x375a04[_0xdfaf('0x32')]=_0x194ae6;if(_0x505c8f[_0xdfaf('0x42')][_0xdfaf('0x4f')]){_0x18ff7e[_0xdfaf('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0xdfaf('0x51')](_0x18ff7e);})[_0xdfaf('0x37')](function(_0x2fd501){_0x375a04[_0xdfaf('0x52')]=_0x2fd501;return _0x375a04;})[_0xdfaf('0x37')](respondWithFilteredResult(_0x850370,_0x18ff7e))[_0xdfaf('0x2b')](handleError(_0x850370,null));};exports['show']=function(_0x2acd08,_0x12905f){var _0x2974a1={'raw':!![],'where':{'id':_0x2acd08[_0xdfaf('0x53')]['id']}},_0x2127a7={};_0x2127a7[_0xdfaf('0x41')]=_[_0xdfaf('0x54')](db[_0xdfaf('0x4e')][_0xdfaf('0x55')]);_0x2127a7[_0xdfaf('0x42')]=_[_0xdfaf('0x54')](_0x2acd08[_0xdfaf('0x42')]);_0x2127a7[_0xdfaf('0x43')]=_[_0xdfaf('0x44')](_0x2127a7[_0xdfaf('0x41')],_0x2127a7['query']);_0x2974a1[_0xdfaf('0x45')]=_[_0xdfaf('0x44')](_0x2127a7[_0xdfaf('0x41')],qs['fields'](_0x2acd08[_0xdfaf('0x42')][_0xdfaf('0x46')]));_0x2974a1[_0xdfaf('0x45')]=_0x2974a1[_0xdfaf('0x45')][_0xdfaf('0x47')]?_0x2974a1[_0xdfaf('0x45')]:_0x2127a7[_0xdfaf('0x41')];if(_0x2acd08[_0xdfaf('0x42')][_0xdfaf('0x4f')]){_0x2974a1[_0xdfaf('0x50')]=[{'all':!![]}];}_0x2974a1=_[_0xdfaf('0x4d')]({},_0x2974a1,_0x2acd08[_0xdfaf('0x56')]);return db[_0xdfaf('0x4e')][_0xdfaf('0x57')](_0x2974a1)[_0xdfaf('0x37')](handleEntityNotFound(_0x12905f,null))[_0xdfaf('0x37')](respondWithResult(_0x12905f,null))[_0xdfaf('0x2b')](handleError(_0x12905f,null));};exports[_0xdfaf('0x58')]=function(_0xf56d15,_0x331b9e){if(_0xf56d15['body']['id']){delete _0xf56d15['body']['id'];}return db[_0xdfaf('0x4e')][_0xdfaf('0x57')]({'where':{'id':_0xf56d15[_0xdfaf('0x53')]['id']}})['then'](handleEntityNotFound(_0x331b9e,null))[_0xdfaf('0x37')](saveUpdates(_0xf56d15[_0xdfaf('0x59')],null))['then'](respondWithResult(_0x331b9e,null))[_0xdfaf('0x2b')](handleError(_0x331b9e,null));};exports[_0xdfaf('0x38')]=function(_0x57cc9a,_0x513dc8){return db[_0xdfaf('0x4e')][_0xdfaf('0x57')]({'where':{'id':_0x57cc9a['params']['id']}})['then'](handleEntityNotFound(_0x513dc8,null))[_0xdfaf('0x37')](removeEntity(_0x513dc8,null))[_0xdfaf('0x2b')](handleError(_0x513dc8,null));};exports[_0xdfaf('0x5a')]=function(_0x3fdaa4,_0x315d0c){return db[_0xdfaf('0x4e')][_0xdfaf('0x5a')]()[_0xdfaf('0x37')](respondWithResult(_0x315d0c,null))['catch'](handleError(_0x315d0c,null));};var interaction_log=require(_0xdfaf('0x15'))(_0xdfaf('0x5b'));exports[_0xdfaf('0x5c')]=function(_0xb42d28,_0x198326,_0x4d730d){var _0x1143d2={'agent':{},'channel':_0xdfaf('0x5d')};if(_0xb42d28[_0xdfaf('0x59')]['id']){delete _0xb42d28[_0xdfaf('0x59')]['id'];}_0xb42d28['body'][_0xdfaf('0x5e')]=!![];_0xb42d28[_0xdfaf('0x59')][_0xdfaf('0x5f')]=moment()['format'](_0xdfaf('0x60'));_0xb42d28['body'][_0xdfaf('0x61')]=_0xb42d28[_0xdfaf('0x59')][_0xdfaf('0x61')]||_0xb42d28[_0xdfaf('0x62')]['id'];_0x1143d2['agent']['id']=_0xb42d28[_0xdfaf('0x59')]['UserId'];return db[_0xdfaf('0x4e')][_0xdfaf('0x57')]({'where':{'id':_0xb42d28[_0xdfaf('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x198326,null))[_0xdfaf('0x37')](saveUpdates(_0xb42d28[_0xdfaf('0x59')],null))[_0xdfaf('0x37')](function(_0x2d286b){if(_0x2d286b){_0x1143d2['message']=_0x2d286b[_0xdfaf('0x63')]({'plain':!![]});return db[_0xdfaf('0x64')]['find']({'where':{'id':_0x2d286b[_0xdfaf('0x65')]}});}return null;})[_0xdfaf('0x37')](handleEntityNotFound(_0x198326,null))[_0xdfaf('0x37')](function(_0x5e2df3){if(_0x5e2df3){return _0x5e2df3['update']({'UserId':_0xb42d28['body']['UserId'],'read1stAt':_[_0xdfaf('0x66')](_0x5e2df3[_0xdfaf('0x67')])?moment()[_0xdfaf('0x68')](_0xdfaf('0x60')):undefined});}return null;})[_0xdfaf('0x37')](function(_0x34784f){if(_0x34784f){_0x1143d2['interaction']=_0x34784f[_0xdfaf('0x63')]({'plain':!![]});interaction_log[_0xdfaf('0x29')](_0xdfaf('0x69'),_0xb42d28[_0xdfaf('0x62')]['id'],_0xb42d28[_0xdfaf('0x62')][_0xdfaf('0x3b')],_0xb42d28[_0xdfaf('0x62')]['role'],_0x1143d2['interaction']['id'],_0xb42d28[_0xdfaf('0x59')]?JSON[_0xdfaf('0x25')](_0xb42d28['body']):_0xdfaf('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x1143d2);}return null;})[_0xdfaf('0x37')](function(_0x2d1402){var _0x2e05df=_0xdfaf('0x6b')+_0x2d1402[_0xdfaf('0x28')]['ContactId'];return db['sequelize']['query'](_0x2e05df,{'type':db[_0xdfaf('0x6c')][_0xdfaf('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0xb76edb){return _0xb76edb;});})['then'](function(_0x5bea76){if(_0x5bea76){_0x1143d2[_0xdfaf('0x28')][_0xdfaf('0x6e')]=_0x5bea76[0x0];if(!_0xb42d28[_0xdfaf('0x59')][_0xdfaf('0x61')])return;return db[_0xdfaf('0x6f')][_0xdfaf('0x57')]({'where':{'id':_0xb42d28[_0xdfaf('0x59')][_0xdfaf('0x61')],'role':'agent'},'attributes':['id','name',_0xdfaf('0x70'),_0xdfaf('0x71'),_0xdfaf('0x72')],'raw':!![]});}return null;})[_0xdfaf('0x37')](function(_0x252515){if(!_0x252515)return null;_0x1143d2[_0xdfaf('0x28')][_0xdfaf('0x73')]=_0x252515;return _0x1143d2;})[_0xdfaf('0x37')](function(_0x4b34d1){if(_0x4b34d1){if(_0xb42d28['body'][_0xdfaf('0x74')]){_0x1143d2['message']['interface']=util[_0xdfaf('0x68')](_0xdfaf('0x75'),_0xb42d28[_0xdfaf('0x62')][_0xdfaf('0x3b')]);_0x1143d2[_0xdfaf('0x28')][_0xdfaf('0x76')]=_0x1143d2[_0xdfaf('0x76')];_0x1143d2['message'][_0xdfaf('0x77')]=_0x1143d2['channel'];_0x1143d2[_0xdfaf('0x28')][_0xdfaf('0x78')]='accept';return respondWithRpcPromise(_0xdfaf('0x79'),_0xdfaf('0x79'),{'event':_0xdfaf('0x7a'),'message':_0x1143d2['message']},client9002)[_0xdfaf('0x37')](function(){return _0x1143d2;});}return _0x1143d2;}return null;})[_0xdfaf('0x37')](respondWithResult(_0x198326,null))[_0xdfaf('0x2b')](handleError(_0x198326,null));};var interaction_log=require(_0xdfaf('0x15'))(_0xdfaf('0x5b'));exports['reject']=function(_0x569b91,_0x1c5cc7,_0x2df3ec){var _0xa6ee23={'agent':{},'channel':'fax'};if(_0x569b91[_0xdfaf('0x59')]['id']){delete _0x569b91['body']['id'];}_0x569b91[_0xdfaf('0x59')]['UserId']=_0x569b91[_0xdfaf('0x59')]['UserId']||_0x569b91[_0xdfaf('0x62')]['id'];_0xa6ee23[_0xdfaf('0x73')]['id']=_0x569b91['body']['UserId'];return db['FaxMessage'][_0xdfaf('0x57')]({'where':{'id':_0x569b91[_0xdfaf('0x53')]['id'],'UserId':null}})[_0xdfaf('0x37')](handleEntityNotFound(_0x1c5cc7,null))['then'](function(_0x1b1953){if(_0x1b1953){_0xa6ee23[_0xdfaf('0x28')]=_0x1b1953[_0xdfaf('0x63')]({'plain':!![]});return db[_0xdfaf('0x64')][_0xdfaf('0x57')]({'where':{'id':_0x1b1953[_0xdfaf('0x65')]}});}return null;})[_0xdfaf('0x37')](handleEntityNotFound(_0x1c5cc7,null))[_0xdfaf('0x37')](function(_0x50ba01){if(_0x50ba01){_0xa6ee23[_0xdfaf('0x7b')]=_0x50ba01['get']({'plain':!![]});interaction_log[_0xdfaf('0x29')](_0xdfaf('0x7c'),_0x569b91[_0xdfaf('0x62')]['id'],_0x569b91['user'][_0xdfaf('0x3b')],_0x569b91[_0xdfaf('0x62')][_0xdfaf('0x7d')],_0xa6ee23[_0xdfaf('0x7b')]['id'],_0x569b91['body']?JSON[_0xdfaf('0x25')](_0x569b91[_0xdfaf('0x59')]):_0xdfaf('0x6a'));return respondWithRpcPromise(_0xdfaf('0x7e'),_0xdfaf('0x7f'),_0xa6ee23);}return null;})[_0xdfaf('0x37')](function(_0x27561a){var _0x2e7e5b=_0xdfaf('0x6b')+_0x27561a[_0xdfaf('0x28')][_0xdfaf('0x80')];return db['sequelize'][_0xdfaf('0x42')](_0x2e7e5b,{'type':db[_0xdfaf('0x6c')][_0xdfaf('0x6d')][_0xdfaf('0x81')],'raw':!![]})[_0xdfaf('0x37')](function(_0x522d9d){return _0x522d9d;});})[_0xdfaf('0x37')](function(_0x354694){if(_0x354694){_0xa6ee23[_0xdfaf('0x28')][_0xdfaf('0x6e')]=_0x354694[0x0];if(!_0x569b91[_0xdfaf('0x59')][_0xdfaf('0x61')])return;return db[_0xdfaf('0x6f')][_0xdfaf('0x57')]({'where':{'id':_0x569b91[_0xdfaf('0x59')][_0xdfaf('0x61')],'role':_0xdfaf('0x73')},'attributes':['id','name',_0xdfaf('0x70'),_0xdfaf('0x71'),_0xdfaf('0x72')],'raw':!![]});}return null;})[_0xdfaf('0x37')](function(_0x3566a0){if(!_0x3566a0)return null;_0xa6ee23[_0xdfaf('0x28')]['agent']=_0x3566a0;return _0xa6ee23;})[_0xdfaf('0x37')](function(_0x2771b0){if(_0x2771b0){_0x2771b0['message'][_0xdfaf('0x82')]=util[_0xdfaf('0x68')](_0xdfaf('0x75'),_0x569b91['user']['name']);_0x2771b0[_0xdfaf('0x28')][_0xdfaf('0x76')]=_0xa6ee23[_0xdfaf('0x76')];_0x2771b0[_0xdfaf('0x28')]['motionChannel']=_0xa6ee23['channel'];_0x2771b0[_0xdfaf('0x28')][_0xdfaf('0x78')]=_0xdfaf('0x35');respondWithRpcPromise(_0xdfaf('0x79'),_0xdfaf('0x79'),{'event':_0xdfaf('0x83'),'message':_0x2771b0[_0xdfaf('0x28')]},client9002);return _0xa6ee23;}return null;})['then'](respondWithResult(_0x1c5cc7,null))[_0xdfaf('0x2b')](handleError(_0x1c5cc7,null));};exports['create']=function(_0x4db497,_0x1bc57b){var _0x219736;return db[_0xdfaf('0x4e')]['create'](_0x4db497[_0xdfaf('0x59')],{})[_0xdfaf('0x37')](function(_0x23b1fd){_0x219736=_0x23b1fd;return db['CmContact'][_0xdfaf('0x84')]({'where':{'id':_0x219736[_0xdfaf('0x80')]}});})[_0xdfaf('0x37')](function(_0x5a8ad8){if(_[_0xdfaf('0x66')](_0x5a8ad8)){return;}else{_0x219736[_0xdfaf('0x5d')]=_0x5a8ad8[_0xdfaf('0x5d')];return db[_0xdfaf('0x85')][_0xdfaf('0x84')]({'where':{'id':_0x219736[_0xdfaf('0x86')]}});}})['then'](function(_0xbdc8fa){return respondWithRpcPromise(_0xdfaf('0x87'),_0xdfaf('0x87'),{'FaxAccountId':_['isNil'](_0x4db497['body'])?undefined:_0x4db497['body'][_0xdfaf('0x88')],'path':_[_0xdfaf('0x66')](_0xbdc8fa)?undefined:util[_0xdfaf('0x68')](_0xdfaf('0x89'),_0xbdc8fa[_0xdfaf('0x8a')]),'fax':_[_0xdfaf('0x66')](_0x219736[_0xdfaf('0x5d')])?undefined:_0x219736[_0xdfaf('0x5d')],'AttachmentId':_0x219736[_0xdfaf('0x86')]},client9002);})[_0xdfaf('0x37')](respondWithResult(_0x1bc57b,0xc9))['catch'](handleError(_0x1bc57b,null));};exports[_0xdfaf('0x8b')]=function(_0x317e7f,_0x4874b7){var _0x5e7bd4=path[_0xdfaf('0x8c')](config[_0xdfaf('0x8d')],_0xdfaf('0x8e'),_0xdfaf('0x8f'),'attachments');return db[_0xdfaf('0x4e')][_0xdfaf('0x57')]({'where':{'id':_0x317e7f[_0xdfaf('0x53')]['id']},'include':[{'model':db[_0xdfaf('0x85')],'as':_0xdfaf('0x85')}]})[_0xdfaf('0x37')](handleEntityNotFound(_0x4874b7,null))[_0xdfaf('0x37')](function(_0x2ba363){if(_0x2ba363){return _0x4874b7[_0xdfaf('0x8b')](path['join'](_0x5e7bd4,_0x2ba363[_0xdfaf('0x85')][_0xdfaf('0x8a')]));}})[_0xdfaf('0x2b')](handleError(_0x4874b7,null));}; \ No newline at end of file +var _0xfbd4=['map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FaxMessage','findAll','rows','show','params','includeAll','include','find','body','describe','fax-interactions','accept','read','readAt','format','UserId','user','agent','FaxInteraction','FaxInteractionId','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','fax','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','SELECT','User','motionChannel','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','client','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','stack','name','send','index'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xfbd4,0x180));var _0x4fbd=function(_0xd28a93,_0x4f9c5f){_0xd28a93=_0xd28a93-0x0;var _0x95ad41=_0xfbd4[_0xd28a93];return _0x95ad41;};'use strict';var emlformat=require(_0x4fbd('0x0'));var rimraf=require(_0x4fbd('0x1'));var zipdir=require(_0x4fbd('0x2'));var jsonpatch=require(_0x4fbd('0x3'));var rp=require(_0x4fbd('0x4'));var moment=require(_0x4fbd('0x5'));var BPromise=require(_0x4fbd('0x6'));var Mustache=require(_0x4fbd('0x7'));var util=require('util');var path=require(_0x4fbd('0x8'));var sox=require('sox');var csv=require(_0x4fbd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4fbd('0xa'));var squel=require(_0x4fbd('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4fbd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4fbd('0xd'));var Papa=require(_0x4fbd('0xe'));var Redis=require(_0x4fbd('0xf'));var authService=require(_0x4fbd('0x10'));var qs=require(_0x4fbd('0x11'));var as=require(_0x4fbd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4fbd('0x13'))(_0x4fbd('0x14'));var utils=require(_0x4fbd('0x15'));var config=require(_0x4fbd('0x16'));var licenseUtil=require(_0x4fbd('0x17'));var db=require(_0x4fbd('0x18'))['db'];config[_0x4fbd('0x19')]=_[_0x4fbd('0x1a')](config[_0x4fbd('0x19')],{'host':_0x4fbd('0x1b'),'port':0x18eb});var socket=require(_0x4fbd('0x1c'))(new Redis(config[_0x4fbd('0x19')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x4fbd('0x1d'));var client=jayson['client'][_0x4fbd('0x1e')]({'port':0x232c});var client9002=jayson[_0x4fbd('0x1f')][_0x4fbd('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xac9c74,_0x468432,_0x385d4d,_0x46724a){return new BPromise(function(_0x5e7e51,_0x5a9db1){var _0x35b498=_0x46724a||client;return _0x35b498[_0x4fbd('0x20')](_0xac9c74,_0x385d4d)[_0x4fbd('0x21')](function(_0x2f2dba){logger[_0x4fbd('0x22')](_0x4fbd('0x23'),_0x468432,_0x4fbd('0x24'));logger[_0x4fbd('0x25')](_0x4fbd('0x26'),_0x468432,_0x4fbd('0x24'),JSON[_0x4fbd('0x27')](_0x2f2dba));if(_0x2f2dba[_0x4fbd('0x28')]){if(_0x2f2dba['error'][_0x4fbd('0x29')]===0x1f4){logger[_0x4fbd('0x28')](_0x4fbd('0x23'),_0x468432,_0x2f2dba[_0x4fbd('0x28')][_0x4fbd('0x2a')]);return _0x5a9db1(_0x2f2dba[_0x4fbd('0x28')]['message']);}logger[_0x4fbd('0x28')](_0x4fbd('0x23'),_0x468432,_0x2f2dba['error']['message']);return _0x5e7e51(_0x2f2dba[_0x4fbd('0x28')][_0x4fbd('0x2a')]);}else{logger[_0x4fbd('0x22')]('FaxMessage,\x20%s,\x20%s',_0x468432,_0x4fbd('0x24'));_0x5e7e51(_0x2f2dba[_0x4fbd('0x2b')]['message']);}})[_0x4fbd('0x2c')](function(_0xb4f4a7){logger[_0x4fbd('0x28')](_0x4fbd('0x23'),_0x468432,_0xb4f4a7);_0x5a9db1(_0xb4f4a7);});});}function respondWithStatusCode(_0x57cfc9,_0x52a9ae){_0x52a9ae=_0x52a9ae||0xcc;return function(_0x1a8b3a){if(_0x1a8b3a){return _0x57cfc9[_0x4fbd('0x2d')](_0x52a9ae);}return _0x57cfc9[_0x4fbd('0x2e')](_0x52a9ae)[_0x4fbd('0x2f')]();};}function respondWithResult(_0x3df4c9,_0x3579f6){_0x3579f6=_0x3579f6||0xc8;return function(_0x517079){if(_0x517079){return _0x3df4c9[_0x4fbd('0x2e')](_0x3579f6)[_0x4fbd('0x30')](_0x517079);}};}function respondWithFilteredResult(_0x21139d,_0x17ff1c){return function(_0x1100b5){if(_0x1100b5){var _0x40d582=typeof _0x17ff1c[_0x4fbd('0x31')]===_0x4fbd('0x32')&&typeof _0x17ff1c['limit']==='undefined';var _0x2f1184=_0x1100b5[_0x4fbd('0x33')];var _0x3f7567=_0x40d582?0x0:_0x17ff1c['offset'];var _0x84cb8e=_0x40d582?_0x1100b5[_0x4fbd('0x33')]:_0x17ff1c[_0x4fbd('0x31')]+_0x17ff1c[_0x4fbd('0x34')];var _0x39b80f;if(_0x84cb8e>=_0x2f1184){_0x84cb8e=_0x2f1184;_0x39b80f=0xc8;}else{_0x39b80f=0xce;}_0x21139d[_0x4fbd('0x2e')](_0x39b80f);return _0x21139d[_0x4fbd('0x35')]('Content-Range',_0x3f7567+'-'+_0x84cb8e+'/'+_0x2f1184)['json'](_0x1100b5);}return null;};}function patchUpdates(_0x25b047){return function(_0x2122ed){try{jsonpatch[_0x4fbd('0x36')](_0x2122ed,_0x25b047,!![]);}catch(_0x16578c){return BPromise[_0x4fbd('0x37')](_0x16578c);}return _0x2122ed[_0x4fbd('0x38')]();};}function saveUpdates(_0x270e31,_0x4ef830){return function(_0x51da3c){if(_0x51da3c){return _0x51da3c[_0x4fbd('0x39')](_0x270e31)['then'](function(_0x2a4ff8){return _0x2a4ff8;});}return null;};}function removeEntity(_0x53113a,_0x6bf455){return function(_0x4e8c49){if(_0x4e8c49){return _0x4e8c49[_0x4fbd('0x3a')]()[_0x4fbd('0x21')](function(){_0x53113a[_0x4fbd('0x2e')](0xcc)[_0x4fbd('0x2f')]();});}};}function handleEntityNotFound(_0x4345fe,_0x34331b){return function(_0x388a94){if(!_0x388a94){_0x4345fe[_0x4fbd('0x2d')](0x194);}return _0x388a94;};}function handleError(_0x580057,_0x3187bf){_0x3187bf=_0x3187bf||0x1f4;return function(_0x5606c2){logger[_0x4fbd('0x28')](_0x5606c2[_0x4fbd('0x3b')]);if(_0x5606c2[_0x4fbd('0x3c')]){delete _0x5606c2[_0x4fbd('0x3c')];}_0x580057[_0x4fbd('0x2e')](_0x3187bf)[_0x4fbd('0x3d')](_0x5606c2);};}exports[_0x4fbd('0x3e')]=function(_0x419992,_0x3e32ad){var _0x171b30={},_0x3b3d17={},_0x3c4041={'count':0x0,'rows':[]};var _0x5ea158=_[_0x4fbd('0x3f')](db['FaxMessage'][_0x4fbd('0x40')],function(_0x1e4f9b){return{'name':_0x1e4f9b[_0x4fbd('0x41')],'type':_0x1e4f9b[_0x4fbd('0x42')][_0x4fbd('0x43')]};});_0x3b3d17[_0x4fbd('0x44')]=_[_0x4fbd('0x3f')](_0x5ea158,_0x4fbd('0x3c'));_0x3b3d17[_0x4fbd('0x45')]=_[_0x4fbd('0x46')](_0x419992[_0x4fbd('0x45')]);_0x3b3d17['filters']=_[_0x4fbd('0x47')](_0x3b3d17['model'],_0x3b3d17['query']);_0x171b30[_0x4fbd('0x48')]=_[_0x4fbd('0x47')](_0x3b3d17[_0x4fbd('0x44')],qs[_0x4fbd('0x49')](_0x419992['query'][_0x4fbd('0x49')]));_0x171b30[_0x4fbd('0x48')]=_0x171b30[_0x4fbd('0x48')][_0x4fbd('0x4a')]?_0x171b30[_0x4fbd('0x48')]:_0x3b3d17[_0x4fbd('0x44')];if(!_0x419992[_0x4fbd('0x45')][_0x4fbd('0x4b')](_0x4fbd('0x4c'))){_0x171b30[_0x4fbd('0x34')]=qs[_0x4fbd('0x34')](_0x419992[_0x4fbd('0x45')][_0x4fbd('0x34')]);_0x171b30[_0x4fbd('0x31')]=qs['offset'](_0x419992[_0x4fbd('0x45')]['offset']);}_0x171b30[_0x4fbd('0x4d')]=qs[_0x4fbd('0x4e')](_0x419992[_0x4fbd('0x45')][_0x4fbd('0x4e')]);_0x171b30[_0x4fbd('0x4f')]=qs[_0x4fbd('0x50')](_[_0x4fbd('0x51')](_0x419992[_0x4fbd('0x45')],_0x3b3d17[_0x4fbd('0x50')]),_0x5ea158);if(_0x419992[_0x4fbd('0x45')][_0x4fbd('0x52')]){_0x171b30[_0x4fbd('0x4f')]=_[_0x4fbd('0x53')](_0x171b30[_0x4fbd('0x4f')],{'$or':_[_0x4fbd('0x3f')](_0x5ea158,function(_0x2afaad){if(_0x2afaad[_0x4fbd('0x42')]!==_0x4fbd('0x54')){var _0x323a5c={};_0x323a5c[_0x2afaad[_0x4fbd('0x3c')]]={'$like':'%'+_0x419992[_0x4fbd('0x45')][_0x4fbd('0x52')]+'%'};return _0x323a5c;}})});}_0x171b30=_[_0x4fbd('0x53')]({},_0x171b30,_0x419992[_0x4fbd('0x55')]);var _0x157759={'where':_0x171b30[_0x4fbd('0x4f')]};return db[_0x4fbd('0x56')][_0x4fbd('0x33')](_0x157759)[_0x4fbd('0x21')](function(_0x11d686){_0x3c4041[_0x4fbd('0x33')]=_0x11d686;if(_0x419992[_0x4fbd('0x45')]['includeAll']){_0x171b30['include']=[{'all':!![]}];}return db['FaxMessage'][_0x4fbd('0x57')](_0x171b30);})[_0x4fbd('0x21')](function(_0x533d9d){_0x3c4041[_0x4fbd('0x58')]=_0x533d9d;return _0x3c4041;})[_0x4fbd('0x21')](respondWithFilteredResult(_0x3e32ad,_0x171b30))[_0x4fbd('0x2c')](handleError(_0x3e32ad,null));};exports[_0x4fbd('0x59')]=function(_0x599cf2,_0x4e98a2){var _0x57d1d6={'raw':!![],'where':{'id':_0x599cf2[_0x4fbd('0x5a')]['id']}},_0x4a97e5={};_0x4a97e5[_0x4fbd('0x44')]=_[_0x4fbd('0x46')](db[_0x4fbd('0x56')]['rawAttributes']);_0x4a97e5[_0x4fbd('0x45')]=_[_0x4fbd('0x46')](_0x599cf2[_0x4fbd('0x45')]);_0x4a97e5[_0x4fbd('0x50')]=_[_0x4fbd('0x47')](_0x4a97e5[_0x4fbd('0x44')],_0x4a97e5[_0x4fbd('0x45')]);_0x57d1d6[_0x4fbd('0x48')]=_['intersection'](_0x4a97e5['model'],qs[_0x4fbd('0x49')](_0x599cf2[_0x4fbd('0x45')][_0x4fbd('0x49')]));_0x57d1d6[_0x4fbd('0x48')]=_0x57d1d6[_0x4fbd('0x48')]['length']?_0x57d1d6[_0x4fbd('0x48')]:_0x4a97e5['model'];if(_0x599cf2[_0x4fbd('0x45')][_0x4fbd('0x5b')]){_0x57d1d6[_0x4fbd('0x5c')]=[{'all':!![]}];}_0x57d1d6=_[_0x4fbd('0x53')]({},_0x57d1d6,_0x599cf2[_0x4fbd('0x55')]);return db[_0x4fbd('0x56')][_0x4fbd('0x5d')](_0x57d1d6)[_0x4fbd('0x21')](handleEntityNotFound(_0x4e98a2,null))[_0x4fbd('0x21')](respondWithResult(_0x4e98a2,null))['catch'](handleError(_0x4e98a2,null));};exports['update']=function(_0x17a0ec,_0xc1f361){if(_0x17a0ec[_0x4fbd('0x5e')]['id']){delete _0x17a0ec['body']['id'];}return db['FaxMessage'][_0x4fbd('0x5d')]({'where':{'id':_0x17a0ec[_0x4fbd('0x5a')]['id']}})['then'](handleEntityNotFound(_0xc1f361,null))[_0x4fbd('0x21')](saveUpdates(_0x17a0ec[_0x4fbd('0x5e')],null))[_0x4fbd('0x21')](respondWithResult(_0xc1f361,null))['catch'](handleError(_0xc1f361,null));};exports['destroy']=function(_0x2c814c,_0x2c234b){return db[_0x4fbd('0x56')][_0x4fbd('0x5d')]({'where':{'id':_0x2c814c[_0x4fbd('0x5a')]['id']}})[_0x4fbd('0x21')](handleEntityNotFound(_0x2c234b,null))[_0x4fbd('0x21')](removeEntity(_0x2c234b,null))[_0x4fbd('0x2c')](handleError(_0x2c234b,null));};exports[_0x4fbd('0x5f')]=function(_0x3feef0,_0x21502d){return db[_0x4fbd('0x56')]['describe']()[_0x4fbd('0x21')](respondWithResult(_0x21502d,null))[_0x4fbd('0x2c')](handleError(_0x21502d,null));};var interaction_log=require('../../config/logger')(_0x4fbd('0x60'));exports[_0x4fbd('0x61')]=function(_0x440003,_0x1dd6f0,_0x25e47b){var _0x2a19a3={'agent':{},'channel':'fax'};if(_0x440003[_0x4fbd('0x5e')]['id']){delete _0x440003[_0x4fbd('0x5e')]['id'];}_0x440003[_0x4fbd('0x5e')][_0x4fbd('0x62')]=!![];_0x440003[_0x4fbd('0x5e')][_0x4fbd('0x63')]=moment()[_0x4fbd('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x440003['body'][_0x4fbd('0x65')]=_0x440003[_0x4fbd('0x5e')][_0x4fbd('0x65')]||_0x440003[_0x4fbd('0x66')]['id'];_0x2a19a3[_0x4fbd('0x67')]['id']=_0x440003[_0x4fbd('0x5e')][_0x4fbd('0x65')];return db[_0x4fbd('0x56')][_0x4fbd('0x5d')]({'where':{'id':_0x440003[_0x4fbd('0x5a')]['id'],'UserId':null}})[_0x4fbd('0x21')](handleEntityNotFound(_0x1dd6f0,null))[_0x4fbd('0x21')](saveUpdates(_0x440003['body'],null))[_0x4fbd('0x21')](function(_0x10f021){if(_0x10f021){_0x2a19a3[_0x4fbd('0x2a')]=_0x10f021['get']({'plain':!![]});return db[_0x4fbd('0x68')][_0x4fbd('0x5d')]({'where':{'id':_0x10f021[_0x4fbd('0x69')]}});}return null;})[_0x4fbd('0x21')](handleEntityNotFound(_0x1dd6f0,null))[_0x4fbd('0x21')](function(_0x7ed68f){if(_0x7ed68f){return _0x7ed68f['update']({'UserId':_0x440003[_0x4fbd('0x5e')][_0x4fbd('0x65')],'read1stAt':_['isNil'](_0x7ed68f[_0x4fbd('0x6a')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4fbd('0x21')](function(_0x5b70fb){if(_0x5b70fb){_0x2a19a3[_0x4fbd('0x6b')]=_0x5b70fb['get']({'plain':!![]});interaction_log[_0x4fbd('0x22')](_0x4fbd('0x6c'),_0x440003[_0x4fbd('0x66')]['id'],_0x440003[_0x4fbd('0x66')]['name'],_0x440003[_0x4fbd('0x66')][_0x4fbd('0x6d')],_0x2a19a3[_0x4fbd('0x6b')]['id'],_0x440003['body']?JSON[_0x4fbd('0x27')](_0x440003['body']):_0x4fbd('0x6e'));return respondWithRpcPromise('AcceptMessage',_0x4fbd('0x6f'),_0x2a19a3);}return null;})[_0x4fbd('0x21')](function(_0xf46b9d){var _0xf70c1d=_0x4fbd('0x70')+_0xf46b9d['message'][_0x4fbd('0x71')];return db['sequelize'][_0x4fbd('0x45')](_0xf70c1d,{'type':db['Sequelize'][_0x4fbd('0x72')]['SELECT'],'raw':!![]})['then'](function(_0x78c60e){return _0x78c60e;});})[_0x4fbd('0x21')](function(_0x3816be){if(_0x3816be){_0x2a19a3['message'][_0x4fbd('0x73')]=_0x3816be[0x0];if(!_0x440003[_0x4fbd('0x5e')][_0x4fbd('0x65')])return;return db['User']['find']({'where':{'id':_0x440003[_0x4fbd('0x5e')][_0x4fbd('0x65')],'role':'agent'},'attributes':['id',_0x4fbd('0x3c'),_0x4fbd('0x74'),_0x4fbd('0x75'),_0x4fbd('0x76')],'raw':!![]});}return null;})[_0x4fbd('0x21')](function(_0x4936c5){if(!_0x4936c5)return null;_0x2a19a3[_0x4fbd('0x2a')][_0x4fbd('0x67')]=_0x4936c5;return _0x2a19a3;})[_0x4fbd('0x21')](function(_0x11a063){if(_0x11a063){if(_0x440003[_0x4fbd('0x5e')][_0x4fbd('0x77')]){_0x2a19a3['message'][_0x4fbd('0x78')]=util['format'](_0x4fbd('0x79'),_0x440003[_0x4fbd('0x66')][_0x4fbd('0x3c')]);_0x2a19a3[_0x4fbd('0x2a')][_0x4fbd('0x7a')]=_0x2a19a3[_0x4fbd('0x7a')];_0x2a19a3[_0x4fbd('0x2a')]['motionChannel']=_0x2a19a3[_0x4fbd('0x7a')];_0x2a19a3[_0x4fbd('0x2a')][_0x4fbd('0x7b')]=_0x4fbd('0x61');return respondWithRpcPromise(_0x4fbd('0x7c'),'EventManager',{'event':'acceptmessage','message':_0x2a19a3[_0x4fbd('0x2a')]},client9002)[_0x4fbd('0x21')](function(){return _0x2a19a3;});}return _0x2a19a3;}return null;})[_0x4fbd('0x21')](respondWithResult(_0x1dd6f0,null))[_0x4fbd('0x2c')](handleError(_0x1dd6f0,null));};var interaction_log=require(_0x4fbd('0x13'))(_0x4fbd('0x60'));exports['reject']=function(_0x2aefef,_0x11a8f1,_0x4058a9){var _0x11833d={'agent':{},'channel':_0x4fbd('0x7d')};if(_0x2aefef[_0x4fbd('0x5e')]['id']){delete _0x2aefef[_0x4fbd('0x5e')]['id'];}_0x2aefef[_0x4fbd('0x5e')][_0x4fbd('0x65')]=_0x2aefef[_0x4fbd('0x5e')][_0x4fbd('0x65')]||_0x2aefef[_0x4fbd('0x66')]['id'];_0x11833d[_0x4fbd('0x67')]['id']=_0x2aefef[_0x4fbd('0x5e')][_0x4fbd('0x65')];return db['FaxMessage']['find']({'where':{'id':_0x2aefef[_0x4fbd('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x11a8f1,null))[_0x4fbd('0x21')](function(_0x59db1e){if(_0x59db1e){_0x11833d[_0x4fbd('0x2a')]=_0x59db1e['get']({'plain':!![]});return db[_0x4fbd('0x68')][_0x4fbd('0x5d')]({'where':{'id':_0x59db1e[_0x4fbd('0x69')]}});}return null;})[_0x4fbd('0x21')](handleEntityNotFound(_0x11a8f1,null))['then'](function(_0x3eb185){if(_0x3eb185){_0x11833d[_0x4fbd('0x6b')]=_0x3eb185[_0x4fbd('0x7e')]({'plain':!![]});interaction_log['info'](_0x4fbd('0x7f'),_0x2aefef[_0x4fbd('0x66')]['id'],_0x2aefef[_0x4fbd('0x66')][_0x4fbd('0x3c')],_0x2aefef[_0x4fbd('0x66')][_0x4fbd('0x6d')],_0x11833d['interaction']['id'],_0x2aefef[_0x4fbd('0x5e')]?JSON[_0x4fbd('0x27')](_0x2aefef[_0x4fbd('0x5e')]):_0x4fbd('0x6e'));return respondWithRpcPromise(_0x4fbd('0x80'),_0x4fbd('0x81'),_0x11833d);}return null;})[_0x4fbd('0x21')](function(_0x524aea){var _0xf1f0e=_0x4fbd('0x70')+_0x524aea['message'][_0x4fbd('0x71')];return db[_0x4fbd('0x82')]['query'](_0xf1f0e,{'type':db[_0x4fbd('0x83')]['QueryTypes'][_0x4fbd('0x84')],'raw':!![]})[_0x4fbd('0x21')](function(_0x5af225){return _0x5af225;});})[_0x4fbd('0x21')](function(_0x18b127){if(_0x18b127){_0x11833d[_0x4fbd('0x2a')][_0x4fbd('0x73')]=_0x18b127[0x0];if(!_0x2aefef[_0x4fbd('0x5e')]['UserId'])return;return db[_0x4fbd('0x85')][_0x4fbd('0x5d')]({'where':{'id':_0x2aefef[_0x4fbd('0x5e')][_0x4fbd('0x65')],'role':'agent'},'attributes':['id',_0x4fbd('0x3c'),_0x4fbd('0x74'),_0x4fbd('0x75'),_0x4fbd('0x76')],'raw':!![]});}return null;})['then'](function(_0x267352){if(!_0x267352)return null;_0x11833d[_0x4fbd('0x2a')]['agent']=_0x267352;return _0x11833d;})[_0x4fbd('0x21')](function(_0x3f84d9){if(_0x3f84d9){_0x3f84d9[_0x4fbd('0x2a')][_0x4fbd('0x78')]=util[_0x4fbd('0x64')]('SIP/%s',_0x2aefef[_0x4fbd('0x66')][_0x4fbd('0x3c')]);_0x3f84d9[_0x4fbd('0x2a')][_0x4fbd('0x7a')]=_0x11833d[_0x4fbd('0x7a')];_0x3f84d9['message'][_0x4fbd('0x86')]=_0x11833d[_0x4fbd('0x7a')];_0x3f84d9[_0x4fbd('0x2a')][_0x4fbd('0x7b')]=_0x4fbd('0x37');respondWithRpcPromise(_0x4fbd('0x7c'),'EventManager',{'event':'rejectmessage','message':_0x3f84d9[_0x4fbd('0x2a')]},client9002);return _0x11833d;}return null;})[_0x4fbd('0x21')](respondWithResult(_0x11a8f1,null))[_0x4fbd('0x2c')](handleError(_0x11a8f1,null));};exports['create']=function(_0x1a78bd,_0xaa9780){var _0x49acd5;return db[_0x4fbd('0x56')]['create'](_0x1a78bd['body'],{})[_0x4fbd('0x21')](function(_0x28da8f){_0x49acd5=_0x28da8f;return db['CmContact'][_0x4fbd('0x87')]({'where':{'id':_0x49acd5[_0x4fbd('0x71')]}});})['then'](function(_0x1aeb71){if(_[_0x4fbd('0x88')](_0x1aeb71)){return;}else{_0x49acd5[_0x4fbd('0x7d')]=_0x1aeb71[_0x4fbd('0x7d')];return db[_0x4fbd('0x89')][_0x4fbd('0x87')]({'where':{'id':_0x49acd5[_0x4fbd('0x8a')]}});}})[_0x4fbd('0x21')](function(_0x187674){return respondWithRpcPromise(_0x4fbd('0x8b'),_0x4fbd('0x8b'),{'FaxAccountId':_[_0x4fbd('0x88')](_0x1a78bd[_0x4fbd('0x5e')])?undefined:_0x1a78bd[_0x4fbd('0x5e')][_0x4fbd('0x8c')],'path':_[_0x4fbd('0x88')](_0x187674)?undefined:util['format'](_0x4fbd('0x8d'),_0x187674[_0x4fbd('0x8e')]),'fax':_[_0x4fbd('0x88')](_0x49acd5['fax'])?undefined:_0x49acd5['fax'],'AttachmentId':_0x49acd5['AttachmentId']},client9002);})[_0x4fbd('0x21')](respondWithResult(_0xaa9780,0xc9))[_0x4fbd('0x2c')](handleError(_0xaa9780,null));};exports[_0x4fbd('0x8f')]=function(_0x29789d,_0x8f074f){var _0x1dd0a3=path[_0x4fbd('0x90')](config[_0x4fbd('0x91')],_0x4fbd('0x92'),_0x4fbd('0x93'),_0x4fbd('0x94'));return db[_0x4fbd('0x56')][_0x4fbd('0x5d')]({'where':{'id':_0x29789d['params']['id']},'include':[{'model':db[_0x4fbd('0x89')],'as':_0x4fbd('0x89')}]})['then'](handleEntityNotFound(_0x8f074f,null))[_0x4fbd('0x21')](function(_0x56961f){if(_0x56961f){return _0x8f074f[_0x4fbd('0x8f')](path[_0x4fbd('0x90')](_0x1dd0a3,_0x56961f[_0x4fbd('0x89')]['basename']));}})['catch'](handleError(_0x8f074f,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 6c1eecd..fb50ac1 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 _0xd046=['update','hasOwnProperty','hook','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd046,0x129));var _0x6d04=function(_0x5ed013,_0xf0c9d){_0x5ed013=_0x5ed013-0x0;var _0x513a0f=_0xd046[_0x5ed013];return _0x513a0f;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x6d04('0x0'))['db'][_0x6d04('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x6d04('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d04('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4d3747){return function(_0x33720a,_0x4d2121,_0x174d65){FaxMessageEvents['emit'](_0x4d3747+':'+_0x33720a['id'],_0x33720a);FaxMessageEvents['emit'](_0x4d3747,_0x33720a);_0x174d65(null);};}for(var e in events){if(events[_0x6d04('0x4')](e)){var event=events[e];FaxMessage[_0x6d04('0x5')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xe260=['remove','emit','hook','exports','events','FaxMessage','setMaxListeners','save','update'];(function(_0x125b5c,_0x3c3e8c){var _0x284b62=function(_0x2f9570){while(--_0x2f9570){_0x125b5c['push'](_0x125b5c['shift']());}};_0x284b62(++_0x3c3e8c);}(_0xe260,0x94));var _0x0e26=function(_0xb91efe,_0x1a5f17){_0xb91efe=_0xb91efe-0x0;var _0x21763a=_0xe260[_0xb91efe];return _0x21763a;};'use strict';var EventEmitter=require(_0x0e26('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x0e26('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x0e26('0x2')](0x0);var events={'afterCreate':_0x0e26('0x3'),'afterUpdate':_0x0e26('0x4'),'afterDestroy':_0x0e26('0x5')};function emitEvent(_0x16613c){return function(_0x4a2388,_0x937f2a,_0x141a58){FaxMessageEvents[_0x0e26('0x6')](_0x16613c+':'+_0x4a2388['id'],_0x4a2388);FaxMessageEvents['emit'](_0x16613c,_0x4a2388);_0x141a58(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x0e26('0x7')](e,emitEvent(event));}}module[_0x0e26('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index ab871cf..bc4572d 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 _0xdf0d=['moment','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2791f2,_0x434775){var _0x137932=function(_0x197588){while(--_0x197588){_0x2791f2['push'](_0x2791f2['shift']());}};_0x137932(++_0x434775);}(_0xdf0d,0x1a9));var _0xddf0=function(_0x3d7d39,_0x2149e1){_0x3d7d39=_0x3d7d39-0x0;var _0x2fccba=_0xdf0d[_0x3d7d39];return _0x2fccba;};'use strict';var _=require(_0xddf0('0x0'));var util=require(_0xddf0('0x1'));var logger=require(_0xddf0('0x2'))(_0xddf0('0x3'));var moment=require(_0xddf0('0x4'));var BPromise=require(_0xddf0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddf0('0x6'));var rimraf=require(_0xddf0('0x7'));var config=require(_0xddf0('0x8'));var attributes=require(_0xddf0('0x9'));module[_0xddf0('0xa')]=function(_0x3a8d57,_0x308bd3){return _0x3a8d57[_0xddf0('0xb')](_0xddf0('0xc'),attributes,{'tableName':_0xddf0('0xd'),'paranoid':![],'indexes':[{'name':_0xddf0('0xe'),'fields':[_0xddf0('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2991ca,_0x5acab2,_0x27e7bc){var _0xe9fe90=_0x3a8d57[_0xddf0('0x10')];var _0xa650c3=_0x2991ca[_0xddf0('0x11')]({'plain':!![]});if(_0xa650c3[_0xddf0('0x12')][_0xddf0('0x13')]()==='in'||_0xa650c3['direction'][_0xddf0('0x13')]()===_0xddf0('0x14')&&!_0xa650c3[_0xddf0('0x15')]&&!_['isNil'](_0xa650c3[_0xddf0('0x16')])){_0xe9fe90[_0xddf0('0x17')][_0xddf0('0x18')]({'where':{'id':_0xa650c3[_0xddf0('0x19')]}})[_0xddf0('0x1a')](function(_0x566935){if(_0x566935){_0x566935[_0xddf0('0x1b')]({'lastMsgAt':_0xa650c3[_0xddf0('0x1c')],'lastMsgDirection':_0xa650c3[_0xddf0('0x12')][_0xddf0('0x13')]()});}})[_0xddf0('0x1d')](function(_0x475002){console[_0xddf0('0x1e')](_0x475002);});}_0x27e7bc();}},'charset':_0xddf0('0x1f'),'collate':_0xddf0('0x20')});}; \ No newline at end of file +var _0xd713=['get','direction','toLowerCase','out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd713,0x10f));var _0x3d71=function(_0x1c9863,_0xe952b2){_0x1c9863=_0x1c9863-0x0;var _0x104660=_0xd713[_0x1c9863];return _0x104660;};'use strict';var _=require(_0x3d71('0x0'));var util=require(_0x3d71('0x1'));var logger=require(_0x3d71('0x2'))('api');var moment=require(_0x3d71('0x3'));var BPromise=require(_0x3d71('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d71('0x5'));var rimraf=require(_0x3d71('0x6'));var config=require(_0x3d71('0x7'));var attributes=require(_0x3d71('0x8'));module[_0x3d71('0x9')]=function(_0x1e7006,_0xa4fcdb){return _0x1e7006[_0x3d71('0xa')](_0x3d71('0xb'),attributes,{'tableName':_0x3d71('0xc'),'paranoid':![],'indexes':[{'name':_0x3d71('0xd'),'fields':[_0x3d71('0xe')],'type':_0x3d71('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3783cb,_0x27a71a,_0xd2ec01){var _0x360382=_0x1e7006[_0x3d71('0x10')];var _0x353d72=_0x3783cb[_0x3d71('0x11')]({'plain':!![]});if(_0x353d72[_0x3d71('0x12')][_0x3d71('0x13')]()==='in'||_0x353d72[_0x3d71('0x12')]['toLowerCase']()===_0x3d71('0x14')&&!_0x353d72[_0x3d71('0x15')]&&!_[_0x3d71('0x16')](_0x353d72['UserId'])){_0x360382[_0x3d71('0x17')][_0x3d71('0x18')]({'where':{'id':_0x353d72[_0x3d71('0x19')]}})[_0x3d71('0x1a')](function(_0x6fb234){if(_0x6fb234){_0x6fb234[_0x3d71('0x1b')]({'lastMsgAt':_0x353d72['createdAt'],'lastMsgDirection':_0x353d72[_0x3d71('0x12')][_0x3d71('0x13')]()});}})[_0x3d71('0x1c')](function(_0xe4fc18){console[_0x3d71('0x1d')](_0xe4fc18);});}_0xd2ec01();}},'charset':_0x3d71('0x1e'),'collate':_0x3d71('0x1f')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 7d7e0d1..dddc7fd 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 _0xeec6=['FaxMessage','create','body','options','then','catch','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage'];(function(_0x5bf34c,_0x31429d){var _0x1c1817=function(_0x2ab0ae){while(--_0x2ab0ae){_0x5bf34c['push'](_0x5bf34c['shift']());}};_0x1c1817(++_0x31429d);}(_0xeec6,0x1c2));var _0x6eec=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0xeec6[_0x5534fe];return _0x3d1dc2;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});config['redis']=_[_0x6eec('0xc')](config[_0x6eec('0xd')],{'host':_0x6eec('0xe'),'port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require(_0x6eec('0x10'))[_0x6eec('0x11')](socket);function respondWithRpcPromise(_0x1c774d,_0x49ad4c,_0x595dd4){return new BPromise(function(_0x5e8aba,_0x295cae){return client[_0x6eec('0x12')](_0x1c774d,_0x595dd4)['then'](function(_0x4b8de1){logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));logger[_0x6eec('0x15')](_0x6eec('0x16'),_0x49ad4c,_0x6eec('0x14'),JSON[_0x6eec('0x17')](_0x4b8de1));if(_0x4b8de1['error']){if(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x19')]===0x1f4){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);return _0x295cae(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);}logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1['error'][_0x6eec('0x1b')]);return _0x5e8aba(_0x4b8de1['error'][_0x6eec('0x1b')]);}else{logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));_0x5e8aba(_0x4b8de1[_0x6eec('0x1c')][_0x6eec('0x1b')]);}})['catch'](function(_0x87f3be){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x87f3be);_0x295cae(_0x87f3be);});});}exports[_0x6eec('0x1d')]=function(_0xd86135){var _0x1761f4=this;return new Promise(function(_0x536429,_0x328693){return db[_0x6eec('0x1e')][_0x6eec('0x1f')](_0xd86135[_0x6eec('0x20')],{'raw':_0xd86135[_0x6eec('0x21')]?_0xd86135[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x6eec('0x22')](function(_0x852d08){logger[_0x6eec('0x13')](_0x6eec('0x1d'),_0xd86135);logger[_0x6eec('0x15')](_0x6eec('0x1d'),_0xd86135,JSON['stringify'](_0x852d08));_0x536429(_0x852d08);})[_0x6eec('0x23')](function(_0x2ad14b){logger[_0x6eec('0x18')](_0x6eec('0x1d'),_0x2ad14b[_0x6eec('0x1b')],_0xd86135);_0x328693(_0x1761f4[_0x6eec('0x18')](0x1f4,_0x2ad14b[_0x6eec('0x1b')]));});});};exports[_0x6eec('0x24')]=function(_0x316317){var _0x58f95c=this;return new Promise(function(_0x1d750c,_0x44b31c){return db[_0x6eec('0x1e')][_0x6eec('0x25')](_0x316317['body'],{'raw':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316317['options']?_0x316317[_0x6eec('0x21')]['where']||null:null,'attributes':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x26')]||null:null,'limit':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x27')]||null:null})[_0x6eec('0x22')](function(_0x33e4a1){logger[_0x6eec('0x13')](_0x6eec('0x24'),_0x316317);logger['debug'](_0x6eec('0x24'),_0x316317,JSON['stringify'](_0x33e4a1));_0x1d750c(_0x33e4a1);})[_0x6eec('0x23')](function(_0x125bfc){logger[_0x6eec('0x18')]('UpdateFaxMessage',_0x125bfc['message'],_0x316317);_0x44b31c(_0x58f95c['error'](0x1f4,_0x125bfc[_0x6eec('0x1b')]));});});}; \ No newline at end of file +var _0xbec5=['then','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','catch','CreateFaxMessage','FaxMessage','create','body','options','UpdateFaxMessage','update','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x364872,_0x344c15){var _0x42e77f=function(_0x6a0cb5){while(--_0x6a0cb5){_0x364872['push'](_0x364872['shift']());}};_0x42e77f(++_0x344c15);}(_0xbec5,0xe5));var _0x5bec=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0xbec5[_0x3ed054];return _0x16dd95;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var moment=require('moment');var BPromise=require(_0x5bec('0x2'));var rs=require(_0x5bec('0x3'));var fs=require('fs');var Redis=require(_0x5bec('0x4'));var db=require(_0x5bec('0x5'))['db'];var utils=require(_0x5bec('0x6'));var logger=require('../../config/logger')(_0x5bec('0x7'));var config=require(_0x5bec('0x8'));var jayson=require(_0x5bec('0x9'));var client=jayson['client'][_0x5bec('0xa')]({'port':0x232a});config[_0x5bec('0xb')]=_[_0x5bec('0xc')](config[_0x5bec('0xb')],{'host':_0x5bec('0xd'),'port':0x18eb});var socket=require(_0x5bec('0xe'))(new Redis(config[_0x5bec('0xb')]));require(_0x5bec('0xf'))['register'](socket);function respondWithRpcPromise(_0x41a827,_0x5c2d67,_0x748f75){return new BPromise(function(_0x2a70a7,_0x117162){return client['request'](_0x41a827,_0x748f75)[_0x5bec('0x10')](function(_0x18fa47){logger[_0x5bec('0x11')]('FaxMessage,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'));logger[_0x5bec('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'),JSON[_0x5bec('0x14')](_0x18fa47));if(_0x18fa47[_0x5bec('0x15')]){if(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x16')]===0x1f4){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);return _0x117162(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47['error']['message']);return _0x2a70a7(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}else{logger[_0x5bec('0x11')](_0x5bec('0x17'),_0x5c2d67,'request\x20sent');_0x2a70a7(_0x18fa47['result'][_0x5bec('0x18')]);}})[_0x5bec('0x19')](function(_0x4e0191){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x4e0191);_0x117162(_0x4e0191);});});}exports[_0x5bec('0x1a')]=function(_0x593786){var _0x554f9f=this;return new Promise(function(_0xab397b,_0x5be91c){return db[_0x5bec('0x1b')][_0x5bec('0x1c')](_0x593786[_0x5bec('0x1d')],{'raw':_0x593786[_0x5bec('0x1e')]?_0x593786[_0x5bec('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x5bec('0x10')](function(_0x4cfcb8){logger[_0x5bec('0x11')](_0x5bec('0x1a'),_0x593786);logger['debug'](_0x5bec('0x1a'),_0x593786,JSON[_0x5bec('0x14')](_0x4cfcb8));_0xab397b(_0x4cfcb8);})['catch'](function(_0x45afb7){logger[_0x5bec('0x15')](_0x5bec('0x1a'),_0x45afb7[_0x5bec('0x18')],_0x593786);_0x5be91c(_0x554f9f[_0x5bec('0x15')](0x1f4,_0x45afb7[_0x5bec('0x18')]));});});};exports[_0x5bec('0x1f')]=function(_0x4de66a){var _0x5b63ab=this;return new Promise(function(_0x5e44b3,_0x2961bd){return db[_0x5bec('0x1b')][_0x5bec('0x20')](_0x4de66a['body'],{'raw':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')]['where']||null:null,'attributes':_0x4de66a['options']?_0x4de66a[_0x5bec('0x1e')][_0x5bec('0x21')]||null:null,'limit':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')][_0x5bec('0x22')]||null:null})[_0x5bec('0x10')](function(_0x5d6621){logger[_0x5bec('0x11')]('UpdateFaxMessage',_0x4de66a);logger[_0x5bec('0x13')](_0x5bec('0x1f'),_0x4de66a,JSON[_0x5bec('0x14')](_0x5d6621));_0x5e44b3(_0x5d6621);})[_0x5bec('0x19')](function(_0x5128c0){logger[_0x5bec('0x15')](_0x5bec('0x1f'),_0x5128c0[_0x5bec('0x18')],_0x4de66a);_0x2961bd(_0x5b63ab['error'](0x1f4,_0x5128c0[_0x5bec('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 9bc961e..1482ae8 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 _0x20a9=['register','length','faxMessage:','./faxMessage.events','save','remove','emit'];(function(_0x458e66,_0x169416){var _0x1913e5=function(_0x47f95e){while(--_0x47f95e){_0x458e66['push'](_0x458e66['shift']());}};_0x1913e5(++_0x169416);}(_0x20a9,0x81));var _0x920a=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x20a9[_0xc4001c];return _0x49f7bc;};'use strict';var FaxMessageEvents=require(_0x920a('0x0'));var events=[_0x920a('0x1'),_0x920a('0x2'),'update'];function createListener(_0x5d0371,_0x103ac5){return function(_0x5b70db){_0x103ac5[_0x920a('0x3')](_0x5d0371,_0x5b70db);};}function removeListener(_0x1d4236,_0x13599b){return function(){FaxMessageEvents['removeListener'](_0x1d4236,_0x13599b);};}exports[_0x920a('0x4')]=function(_0x2dd4d0){for(var _0x7214cc=0x0,_0x4fba74=events[_0x920a('0x5')];_0x7214cc<_0x4fba74;_0x7214cc++){var _0x69f8bd=events[_0x7214cc];var _0x7f445=createListener(_0x920a('0x6')+_0x69f8bd,_0x2dd4d0);FaxMessageEvents['on'](_0x69f8bd,_0x7f445);}}; \ No newline at end of file +var _0x953d=['remove','emit','register','length','faxMessage:','save'];(function(_0x5422a2,_0x53dc4b){var _0x2a5b23=function(_0x4bc25a){while(--_0x4bc25a){_0x5422a2['push'](_0x5422a2['shift']());}};_0x2a5b23(++_0x53dc4b);}(_0x953d,0x12b));var _0xd953=function(_0x241dbf,_0x2fffa5){_0x241dbf=_0x241dbf-0x0;var _0x34b554=_0x953d[_0x241dbf];return _0x34b554;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xd953('0x0'),_0xd953('0x1'),'update'];function createListener(_0x4f1d7a,_0x5a8307){return function(_0x500042){_0x5a8307[_0xd953('0x2')](_0x4f1d7a,_0x500042);};}function removeListener(_0x27ebbd,_0x50637d){return function(){FaxMessageEvents['removeListener'](_0x27ebbd,_0x50637d);};}exports[_0xd953('0x3')]=function(_0x47f755){for(var _0x395939=0x0,_0x235148=events[_0xd953('0x4')];_0x395939<_0x235148;_0x395939++){var _0x3830c1=events[_0x395939];var _0x5b63a1=createListener(_0xd953('0x5')+_0x3830c1,_0x47f755);FaxMessageEvents['on'](_0x3830c1,_0x5b63a1);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 08c5752..6fbc9b5 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 _0x6c76=['path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util'];(function(_0x276468,_0x29685a){var _0x36dc3a=function(_0x291f0a){while(--_0x291f0a){_0x276468['push'](_0x276468['shift']());}};_0x36dc3a(++_0x29685a);}(_0x6c76,0x184));var _0x66c7=function(_0x425132,_0x3111f0){_0x425132=_0x425132-0x0;var _0x53370a=_0x6c76[_0x425132];return _0x53370a;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var controller=require('./faxMessage.controller');router[_0x66c7('0x7')]('/',auth[_0x66c7('0x8')](),controller['index']);router[_0x66c7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x66c7('0x9')]);router[_0x66c7('0x7')](_0x66c7('0xa'),auth['isAuthenticated'](),controller[_0x66c7('0xb')]);router[_0x66c7('0x7')](_0x66c7('0xc'),auth[_0x66c7('0x8')](),controller['download']);router[_0x66c7('0xd')]('/',auth[_0x66c7('0x8')](),interaction[_0x66c7('0xe')](_0x66c7('0xf'),_0x66c7('0x10')),controller[_0x66c7('0x11')]);router[_0x66c7('0x12')]('/:id',auth[_0x66c7('0x8')](),controller[_0x66c7('0x13')]);router[_0x66c7('0x12')](_0x66c7('0x14'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x15')]);router[_0x66c7('0x12')](_0x66c7('0x16'),auth[_0x66c7('0x8')](),controller['reject']);router[_0x66c7('0x17')]('/:id',auth[_0x66c7('0x8')](),controller[_0x66c7('0x18')]);module[_0x66c7('0x19')]=router; \ No newline at end of file +var _0xf290=['/:id','show','/:id/download','download','post','fax','create','put','update','accept','/:id/reject','reject','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x455afc,_0x167fba){var _0x4935a5=function(_0x4f4590){while(--_0x4f4590){_0x455afc['push'](_0x455afc['shift']());}};_0x4935a5(++_0x167fba);}(_0xf290,0xde));var _0x0f29=function(_0x13992d,_0x3029ea){_0x13992d=_0x13992d-0x0;var _0x3d15bf=_0xf290[_0x13992d];return _0x3d15bf;};'use strict';var multer=require('multer');var util=require(_0x0f29('0x0'));var path=require('path');var timeout=require(_0x0f29('0x1'));var express=require('express');var router=express[_0x0f29('0x2')]();var fs_extra=require(_0x0f29('0x3'));var auth=require(_0x0f29('0x4'));var interaction=require(_0x0f29('0x5'));var config=require(_0x0f29('0x6'));var controller=require('./faxMessage.controller');router[_0x0f29('0x7')]('/',auth['isAuthenticated'](),controller[_0x0f29('0x8')]);router[_0x0f29('0x7')](_0x0f29('0x9'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xb')]);router[_0x0f29('0x7')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xd')]);router[_0x0f29('0x7')](_0x0f29('0xe'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xf')]);router[_0x0f29('0x10')]('/',auth[_0x0f29('0xa')](),interaction['tracked'](_0x0f29('0x11'),'faxmessage:create'),controller[_0x0f29('0x12')]);router[_0x0f29('0x13')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x14')]);router[_0x0f29('0x13')]('/:id/accept',auth[_0x0f29('0xa')](),controller[_0x0f29('0x15')]);router[_0x0f29('0x13')](_0x0f29('0x16'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x17')]);router[_0x0f29('0x18')](_0x0f29('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x0f29('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 349f15f..4394d30 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 _0x2eba=['INTEGER','exports','STRING','name','rrmemory','roundrobin'];(function(_0x33f131,_0x476ac2){var _0x28726f=function(_0x4b325e){while(--_0x4b325e){_0x33f131['push'](_0x33f131['shift']());}};_0x28726f(++_0x476ac2);}(_0x2eba,0xc7));var _0xa2eb=function(_0x41c0d0,_0x6cdf4c){_0x41c0d0=_0x41c0d0-0x0;var _0x979747=_0x2eba[_0x41c0d0];return _0x979747;};'use strict';var Sequelize=require('sequelize');module[_0xa2eb('0x0')]={'name':{'type':Sequelize[_0xa2eb('0x1')],'unique':_0xa2eb('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa2eb('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa2eb('0x3'),'beepall',_0xa2eb('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa2eb('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2502=['rrmemory','sequelize','exports','STRING','INTEGER'];(function(_0x1da206,_0x1e0d29){var _0x4c38e4=function(_0x2c0bec){while(--_0x2c0bec){_0x1da206['push'](_0x1da206['shift']());}};_0x4c38e4(++_0x1e0d29);}(_0x2502,0x141));var _0x2250=function(_0x2af805,_0x466a49){_0x2af805=_0x2af805-0x0;var _0x204ee4=_0x2502[_0x2af805];return _0x204ee4;};'use strict';var Sequelize=require(_0x2250('0x0'));module[_0x2250('0x1')]={'name':{'type':Sequelize[_0x2250('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2250('0x2')]},'timeout':{'type':Sequelize[_0x2250('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2250('0x4'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 3fdc017..2a3eda0 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 _0x2244=['interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','select','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','union','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','stack','name','send','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','options','FaxQueue','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserFaxQueue','nolimit','FaxQueueId','findAll','User','faxPause','updatedAt','SIP','createdAt','Team','getTeams','addTeams','ids','Agents','online','voicePause'];(function(_0x5bb077,_0x314590){var _0x487afc=function(_0x1293b3){while(--_0x1293b3){_0x5bb077['push'](_0x5bb077['shift']());}};_0x487afc(++_0x314590);}(_0x2244,0x12f));var _0x4224=function(_0xffff5c,_0x2d58c7){_0xffff5c=_0xffff5c-0x0;var _0x1c0b12=_0x2244[_0xffff5c];return _0x1c0b12;};'use strict';var emlformat=require(_0x4224('0x0'));var rimraf=require(_0x4224('0x1'));var zipdir=require(_0x4224('0x2'));var jsonpatch=require(_0x4224('0x3'));var rp=require(_0x4224('0x4'));var moment=require(_0x4224('0x5'));var BPromise=require(_0x4224('0x6'));var Mustache=require(_0x4224('0x7'));var util=require(_0x4224('0x8'));var path=require(_0x4224('0x9'));var sox=require(_0x4224('0xa'));var csv=require(_0x4224('0xb'));var ejs=require(_0x4224('0xc'));var fs=require('fs');var fs_extra=require(_0x4224('0xd'));var _=require(_0x4224('0xe'));var squel=require(_0x4224('0xf'));var crypto=require('crypto');var jsforce=require(_0x4224('0x10'));var deskjs=require(_0x4224('0x11'));var toCsv=require('to-csv');var querystring=require(_0x4224('0x12'));var Papa=require(_0x4224('0x13'));var Redis=require('ioredis');var authService=require(_0x4224('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4224('0x15'));var logger=require(_0x4224('0x16'))(_0x4224('0x17'));var utils=require(_0x4224('0x18'));var config=require(_0x4224('0x19'));var licenseUtil=require(_0x4224('0x1a'));var db=require(_0x4224('0x1b'))['db'];config[_0x4224('0x1c')]=_[_0x4224('0x1d')](config[_0x4224('0x1c')],{'host':_0x4224('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4224('0x1c')]));require('./faxQueue.socket')[_0x4224('0x1f')](socket);function respondWithStatusCode(_0x37df59,_0x13e70f){_0x13e70f=_0x13e70f||0xcc;return function(_0x2fe89e){if(_0x2fe89e){return _0x37df59[_0x4224('0x20')](_0x13e70f);}return _0x37df59['status'](_0x13e70f)[_0x4224('0x21')]();};}function respondWithResult(_0x3f37c2,_0x1cefc3){_0x1cefc3=_0x1cefc3||0xc8;return function(_0x3d01e8){if(_0x3d01e8){return _0x3f37c2[_0x4224('0x22')](_0x1cefc3)[_0x4224('0x23')](_0x3d01e8);}};}function respondWithFilteredResult(_0x449509,_0x49a31e){return function(_0x27f80d){if(_0x27f80d){var _0x2ba498=typeof _0x49a31e[_0x4224('0x24')]===_0x4224('0x25')&&typeof _0x49a31e['limit']===_0x4224('0x25');var _0x2267f6=_0x27f80d[_0x4224('0x26')];var _0x43c25f=_0x2ba498?0x0:_0x49a31e[_0x4224('0x24')];var _0x4e0328=_0x2ba498?_0x27f80d[_0x4224('0x26')]:_0x49a31e[_0x4224('0x24')]+_0x49a31e[_0x4224('0x27')];var _0x904f7c;if(_0x4e0328>=_0x2267f6){_0x4e0328=_0x2267f6;_0x904f7c=0xc8;}else{_0x904f7c=0xce;}_0x449509[_0x4224('0x22')](_0x904f7c);return _0x449509['set']('Content-Range',_0x43c25f+'-'+_0x4e0328+'/'+_0x2267f6)[_0x4224('0x23')](_0x27f80d);}return null;};}function patchUpdates(_0x4a85f5){return function(_0xaa4e3d){try{jsonpatch[_0x4224('0x28')](_0xaa4e3d,_0x4a85f5,!![]);}catch(_0x2180bb){return BPromise[_0x4224('0x29')](_0x2180bb);}return _0xaa4e3d[_0x4224('0x2a')]();};}function saveUpdates(_0x24d332,_0x5a5025){return function(_0xfb2ac4){if(_0xfb2ac4){return _0xfb2ac4[_0x4224('0x2b')](_0x24d332)[_0x4224('0x2c')](function(_0x355655){return _0x355655;});}return null;};}function removeEntity(_0x23ed75,_0x350ca7){return function(_0x465bb8){if(_0x465bb8){return _0x465bb8[_0x4224('0x2d')]()[_0x4224('0x2c')](function(){var _0x3f9f38=_0x465bb8[_0x4224('0x2e')]({'plain':!![]});var _0x296853=_0x4224('0x2f');return db[_0x4224('0x30')][_0x4224('0x2d')]({'where':{'type':_0x296853,'resourceId':_0x3f9f38['id']}})[_0x4224('0x2c')](function(){return _0x465bb8;});})[_0x4224('0x2c')](function(){_0x23ed75[_0x4224('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47fa50,_0x238c07){return function(_0x133dbb){if(!_0x133dbb){_0x47fa50[_0x4224('0x20')](0x194);}return _0x133dbb;};}function handleError(_0x4c7155,_0x42044d){_0x42044d=_0x42044d||0x1f4;return function(_0x1afe95){logger['error'](_0x1afe95[_0x4224('0x31')]);if(_0x1afe95[_0x4224('0x32')]){delete _0x1afe95[_0x4224('0x32')];}_0x4c7155[_0x4224('0x22')](_0x42044d)[_0x4224('0x33')](_0x1afe95);};}exports['index']=function(_0x4c2202,_0x51b18b){var _0x45f20f={},_0x5a4f94={},_0x9b8ebd={'count':0x0,'rows':[]};var _0x164f3d=_['map'](db['FaxQueue']['rawAttributes'],function(_0x170adc){return{'name':_0x170adc[_0x4224('0x34')],'type':_0x170adc['type']['key']};});_0x5a4f94[_0x4224('0x35')]=_['map'](_0x164f3d,'name');_0x5a4f94[_0x4224('0x36')]=_[_0x4224('0x37')](_0x4c2202[_0x4224('0x36')]);_0x5a4f94[_0x4224('0x38')]=_[_0x4224('0x39')](_0x5a4f94[_0x4224('0x35')],_0x5a4f94['query']);_0x45f20f['attributes']=_[_0x4224('0x39')](_0x5a4f94[_0x4224('0x35')],qs[_0x4224('0x3a')](_0x4c2202[_0x4224('0x36')][_0x4224('0x3a')]));_0x45f20f['attributes']=_0x45f20f[_0x4224('0x3b')][_0x4224('0x3c')]?_0x45f20f[_0x4224('0x3b')]:_0x5a4f94[_0x4224('0x35')];if(!_0x4c2202[_0x4224('0x36')][_0x4224('0x3d')]('nolimit')){_0x45f20f[_0x4224('0x27')]=qs['limit'](_0x4c2202[_0x4224('0x36')]['limit']);_0x45f20f['offset']=qs[_0x4224('0x24')](_0x4c2202[_0x4224('0x36')]['offset']);}_0x45f20f[_0x4224('0x3e')]=qs[_0x4224('0x3f')](_0x4c2202['query'][_0x4224('0x3f')]);_0x45f20f[_0x4224('0x40')]=qs['filters'](_[_0x4224('0x41')](_0x4c2202[_0x4224('0x36')],_0x5a4f94[_0x4224('0x38')]),_0x164f3d);if(_0x4c2202[_0x4224('0x36')][_0x4224('0x42')]){_0x45f20f[_0x4224('0x40')]=_[_0x4224('0x43')](_0x45f20f['where'],{'$or':_[_0x4224('0x44')](_0x164f3d,function(_0x313e66){if(_0x313e66[_0x4224('0x45')]!=='VIRTUAL'){var _0x5622a4={};_0x5622a4[_0x313e66[_0x4224('0x32')]]={'$like':'%'+_0x4c2202[_0x4224('0x36')][_0x4224('0x42')]+'%'};return _0x5622a4;}})});}_0x45f20f=_[_0x4224('0x43')]({},_0x45f20f,_0x4c2202[_0x4224('0x46')]);var _0x5aabe5={'where':_0x45f20f['where']};return db[_0x4224('0x47')]['count'](_0x5aabe5)[_0x4224('0x2c')](function(_0x9e00dc){_0x9b8ebd[_0x4224('0x26')]=_0x9e00dc;if(_0x4c2202[_0x4224('0x36')]['includeAll']){_0x45f20f[_0x4224('0x48')]=[{'all':!![]}];}return db[_0x4224('0x47')]['findAll'](_0x45f20f);})[_0x4224('0x2c')](function(_0x56b4d5){_0x9b8ebd[_0x4224('0x49')]=_0x56b4d5;return _0x9b8ebd;})[_0x4224('0x2c')](respondWithFilteredResult(_0x51b18b,_0x45f20f))[_0x4224('0x4a')](handleError(_0x51b18b,null));};exports[_0x4224('0x4b')]=function(_0x19cde2,_0x5ee683){var _0x1f5fc9={'raw':!![],'where':{'id':_0x19cde2[_0x4224('0x4c')]['id']}},_0x487308={};_0x487308[_0x4224('0x35')]=_[_0x4224('0x37')](db['FaxQueue'][_0x4224('0x4d')]);_0x487308['query']=_[_0x4224('0x37')](_0x19cde2[_0x4224('0x36')]);_0x487308[_0x4224('0x38')]=_['intersection'](_0x487308[_0x4224('0x35')],_0x487308[_0x4224('0x36')]);_0x1f5fc9[_0x4224('0x3b')]=_[_0x4224('0x39')](_0x487308[_0x4224('0x35')],qs['fields'](_0x19cde2[_0x4224('0x36')][_0x4224('0x3a')]));_0x1f5fc9[_0x4224('0x3b')]=_0x1f5fc9[_0x4224('0x3b')][_0x4224('0x3c')]?_0x1f5fc9[_0x4224('0x3b')]:_0x487308[_0x4224('0x35')];if(_0x19cde2[_0x4224('0x36')][_0x4224('0x4e')]){_0x1f5fc9['include']=[{'all':!![]}];}_0x1f5fc9=_[_0x4224('0x43')]({},_0x1f5fc9,_0x19cde2['options']);return db[_0x4224('0x47')][_0x4224('0x4f')](_0x1f5fc9)[_0x4224('0x2c')](handleEntityNotFound(_0x5ee683,null))[_0x4224('0x2c')](respondWithResult(_0x5ee683,null))[_0x4224('0x4a')](handleError(_0x5ee683,null));};exports[_0x4224('0x50')]=function(_0x3dc82a,_0x1064d6){return db[_0x4224('0x47')][_0x4224('0x50')](_0x3dc82a[_0x4224('0x51')],{})['then'](function(_0x3b54bf){var _0x117849=_0x3dc82a['user'][_0x4224('0x2e')]({'plain':!![]});if(!_0x117849)throw new Error(_0x4224('0x52'));if(_0x117849[_0x4224('0x53')]==='user'){var _0x5e4071=_0x3b54bf[_0x4224('0x2e')]({'plain':!![]});var _0x2971a3=_0x4224('0x2f');return db[_0x4224('0x54')][_0x4224('0x4f')]({'where':{'name':_0x2971a3,'userProfileId':_0x117849[_0x4224('0x55')]},'raw':!![]})[_0x4224('0x2c')](function(_0x148e2a){if(_0x148e2a&&_0x148e2a['autoAssociation']===0x0){return db[_0x4224('0x30')][_0x4224('0x50')]({'name':_0x5e4071[_0x4224('0x32')],'resourceId':_0x5e4071['id'],'type':_0x148e2a[_0x4224('0x32')],'sectionId':_0x148e2a['id']},{})[_0x4224('0x2c')](function(){return _0x3b54bf;});}else{return _0x3b54bf;}})[_0x4224('0x4a')](function(_0x476199){logger['error'](_0x4224('0x56'),_0x476199);throw _0x476199;});}return _0x3b54bf;})[_0x4224('0x2c')](respondWithResult(_0x1064d6,0xc9))[_0x4224('0x4a')](handleError(_0x1064d6,null));};exports[_0x4224('0x2b')]=function(_0x503cb1,_0x55d346){if(_0x503cb1[_0x4224('0x51')]['id']){delete _0x503cb1[_0x4224('0x51')]['id'];}return db[_0x4224('0x47')][_0x4224('0x4f')]({'where':{'id':_0x503cb1[_0x4224('0x4c')]['id']}})[_0x4224('0x2c')](handleEntityNotFound(_0x55d346,null))['then'](saveUpdates(_0x503cb1[_0x4224('0x51')],null))['then'](respondWithResult(_0x55d346,null))[_0x4224('0x4a')](handleError(_0x55d346,null));};exports[_0x4224('0x2d')]=function(_0x4d4b2c,_0x36aa4a){return db[_0x4224('0x47')][_0x4224('0x4f')]({'where':{'id':_0x4d4b2c[_0x4224('0x4c')]['id']}})[_0x4224('0x2c')](handleEntityNotFound(_0x36aa4a,null))[_0x4224('0x2c')](removeEntity(_0x36aa4a,null))[_0x4224('0x4a')](handleError(_0x36aa4a,null));};exports['describe']=function(_0x7effb2,_0x1eb86e){return db[_0x4224('0x47')]['describe']()[_0x4224('0x2c')](respondWithResult(_0x1eb86e,null))[_0x4224('0x4a')](handleError(_0x1eb86e,null));};exports[_0x4224('0x57')]=function(_0x37d139,_0x5d1bb8,_0x329f0c){var _0x4450f5={'raw':!![],'where':{}},_0x55d2b7={},_0x538e2f;return db[_0x4224('0x47')][_0x4224('0x58')]({'where':{'id':_0x37d139[_0x4224('0x4c')]['id']}})[_0x4224('0x2c')](handleEntityNotFound(_0x5d1bb8,null))[_0x4224('0x2c')](function(_0x35e077){if(_0x35e077){_0x538e2f=_0x35e077[_0x4224('0x2e')]({'plain':!![]});_0x55d2b7[_0x4224('0x35')]=_[_0x4224('0x37')](db[_0x4224('0x59')][_0x4224('0x4d')]);_0x55d2b7[_0x4224('0x36')]=_[_0x4224('0x37')](_0x37d139['query']);_0x55d2b7[_0x4224('0x38')]=_['intersection'](_0x55d2b7[_0x4224('0x35')],_0x55d2b7[_0x4224('0x36')]);_0x4450f5[_0x4224('0x3b')]=_[_0x4224('0x39')](_0x55d2b7[_0x4224('0x35')],qs['fields'](_0x37d139[_0x4224('0x36')][_0x4224('0x3a')]));_0x4450f5[_0x4224('0x3b')]=_0x4450f5[_0x4224('0x3b')]['length']?_0x4450f5[_0x4224('0x3b')]:_0x55d2b7['model'];if(!_0x37d139[_0x4224('0x36')]['hasOwnProperty'](_0x4224('0x5a'))){_0x4450f5[_0x4224('0x27')]=qs[_0x4224('0x27')](_0x37d139[_0x4224('0x36')][_0x4224('0x27')]);_0x4450f5[_0x4224('0x24')]=qs[_0x4224('0x24')](_0x37d139['query'][_0x4224('0x24')]);}_0x4450f5[_0x4224('0x3e')]=qs[_0x4224('0x3f')](_0x37d139['query'][_0x4224('0x3f')]);_0x4450f5['where']=qs['filters'](_[_0x4224('0x41')](_0x37d139[_0x4224('0x36')],_0x55d2b7[_0x4224('0x38')]));_0x4450f5[_0x4224('0x40')][_0x4224('0x5b')]=_0x35e077['id'];if(_0x37d139[_0x4224('0x36')][_0x4224('0x42')]){_0x4450f5[_0x4224('0x40')]=_['merge'](_0x4450f5[_0x4224('0x40')],{'$or':_['map'](_0x4450f5[_0x4224('0x3b')],function(_0x3aa057){var _0x561b75={};_0x561b75[_0x3aa057]={'$like':'%'+_0x37d139[_0x4224('0x36')][_0x4224('0x42')]+'%'};return _0x561b75;})});}_0x4450f5=_[_0x4224('0x43')]({},_0x4450f5,_0x37d139[_0x4224('0x46')]);return db[_0x4224('0x59')][_0x4224('0x5c')](_0x4450f5);}})[_0x4224('0x2c')](function(_0x435383){if(_0x435383){return db[_0x4224('0x5d')]['findAndCountAll']({'where':{'id':_[_0x4224('0x44')](_0x435383,'UserId'),'role':'agent'},'attributes':['id','name',_0x4224('0x5e'),_0x4224('0x5f'),'createdAt']});}})['then'](function(_0x3088df){if(_0x3088df){return{'count':_0x3088df[_0x4224('0x26')],'rows':_[_0x4224('0x44')](_0x3088df['rows'],function(_0x30d648){return{'membername':_0x30d648['name'],'UserId':_0x30d648['id'],'queue_name':_0x538e2f[_0x4224('0x32')],'FaxQueueId':_0x538e2f['id'],'interface':util['format']('%s/%s',_0x4224('0x60'),_0x30d648[_0x4224('0x32')]),'penalty':0x0,'paused':_0x30d648[_0x4224('0x5e')],'createdAt':_0x30d648[_0x4224('0x61')],'updatedAt':_0x30d648[_0x4224('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4224('0x2c')](respondWithFilteredResult(_0x5d1bb8,_0x4450f5))[_0x4224('0x4a')](handleError(_0x5d1bb8,null));};exports['getTeams']=function(_0x4da594,_0x5a0023,_0x28f88c){var _0x182ee7={};var _0x489a7a={};var _0x1d61a7;var _0x539459;return db[_0x4224('0x47')][_0x4224('0x58')]({'where':{'id':_0x4da594['params']['id']}})[_0x4224('0x2c')](handleEntityNotFound(_0x5a0023,null))[_0x4224('0x2c')](function(_0x22047d){if(_0x22047d){_0x1d61a7=_0x22047d;_0x489a7a[_0x4224('0x35')]=_[_0x4224('0x37')](db[_0x4224('0x62')][_0x4224('0x4d')]);_0x489a7a[_0x4224('0x36')]=_[_0x4224('0x37')](_0x4da594['query']);_0x489a7a[_0x4224('0x38')]=_[_0x4224('0x39')](_0x489a7a[_0x4224('0x35')],_0x489a7a[_0x4224('0x36')]);_0x182ee7[_0x4224('0x3b')]=_[_0x4224('0x39')](_0x489a7a[_0x4224('0x35')],qs[_0x4224('0x3a')](_0x4da594[_0x4224('0x36')][_0x4224('0x3a')]));_0x182ee7[_0x4224('0x3b')]=_0x182ee7['attributes'][_0x4224('0x3c')]?_0x182ee7[_0x4224('0x3b')]:_0x489a7a[_0x4224('0x35')];_0x182ee7['order']=qs[_0x4224('0x3f')](_0x4da594[_0x4224('0x36')][_0x4224('0x3f')]);_0x182ee7[_0x4224('0x40')]=qs[_0x4224('0x38')](_[_0x4224('0x41')](_0x4da594['query'],_0x489a7a['filters']));if(_0x4da594[_0x4224('0x36')][_0x4224('0x42')]){_0x182ee7['where']=_['merge'](_0x182ee7[_0x4224('0x40')],{'$or':_[_0x4224('0x44')](_0x182ee7[_0x4224('0x3b')],function(_0x428cb9){var _0x3e10fe={};_0x3e10fe[_0x428cb9]={'$like':'%'+_0x4da594[_0x4224('0x36')][_0x4224('0x42')]+'%'};return _0x3e10fe;})});}_0x182ee7=_[_0x4224('0x43')]({},_0x182ee7,_0x4da594[_0x4224('0x46')]);return _0x1d61a7[_0x4224('0x63')](_0x182ee7);}})[_0x4224('0x2c')](function(_0x6b25f3){if(_0x6b25f3){_0x539459=_0x6b25f3[_0x4224('0x3c')];if(!_0x4da594['query'][_0x4224('0x3d')](_0x4224('0x5a'))){_0x182ee7[_0x4224('0x27')]=qs[_0x4224('0x27')](_0x4da594[_0x4224('0x36')][_0x4224('0x27')]);_0x182ee7[_0x4224('0x24')]=qs[_0x4224('0x24')](_0x4da594['query'][_0x4224('0x24')]);}return _0x1d61a7[_0x4224('0x63')](_0x182ee7);}})[_0x4224('0x2c')](function(_0x577770){if(_0x577770){return _0x577770?{'count':_0x539459,'rows':_0x577770}:null;}})[_0x4224('0x2c')](respondWithResult(_0x5a0023,null))[_0x4224('0x4a')](handleError(_0x5a0023,null));};exports[_0x4224('0x64')]=function(_0x181bf,_0x209f7e,_0x2a1f03){var _0x1601e5=_0x181bf[_0x4224('0x51')][_0x4224('0x65')];return db['Team'][_0x4224('0x5c')]({'where':{'id':_0x1601e5},'attributes':['id'],'include':[{'model':db[_0x4224('0x5d')],'as':_0x4224('0x66'),'attributes':['id',_0x4224('0x32'),_0x4224('0x67'),_0x4224('0x68'),_0x4224('0x69')],'raw':!![]}]})[_0x4224('0x2c')](function(_0x1f7019){if(_0x1f7019){var _0x358bbe=_[_0x4224('0x6a')](_0x1f7019,function(_0x134c5f){var _0xe32ed7=_0x134c5f[_0x4224('0x2e')]({'plain':!![]});return _0xe32ed7[_0x4224('0x66')];});return db[_0x4224('0x47')][_0x4224('0x4f')]({'where':{'id':_0x181bf['params']['id']}})['then'](function(_0x12605d){return db[_0x4224('0x6b')][_0x4224('0x6c')](function(_0xb2fcb){return _0x12605d[_0x4224('0x64')](_0x1601e5,{'transaction':_0xb2fcb})[_0x4224('0x2c')](function(){return BPromise['each'](_0x358bbe,function(_0x12bec9){return db[_0x4224('0x59')][_0x4224('0x6d')]({'where':{'UserId':_0x12bec9['id'],'FaxQueueId':_0x181bf[_0x4224('0x4c')]['id']},'transaction':_0xb2fcb});});})[_0x4224('0x2c')](function(){_0x358bbe[_0x4224('0x6e')](function(_0x21249f){socket[_0x4224('0x6f')]('userFaxQueue:save',{'UserId':_0x21249f['id'],'FaxQueueId':_0x12605d['id']});});});});});}})['then'](respondWithStatusCode(_0x209f7e,null))[_0x4224('0x4a')](handleError(_0x209f7e,null));};exports[_0x4224('0x70')]=function(_0x4ba5a5,_0x17a793,_0x10d66d){return db['Team'][_0x4224('0x5c')]({'where':{'id':_0x4ba5a5['query'][_0x4224('0x65')]},'attributes':['id'],'include':[{'model':db[_0x4224('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4224('0x2c')](handleEntityNotFound(_0x17a793,null))[_0x4224('0x2c')](function(_0x4dd5c6){var _0x42edd8=_['map'](_0x4dd5c6,'id');var _0x21a3ef=[];var _0x5dca9f=[];var _0x42b1f0=squel[_0x4224('0x71')]();_0x42b1f0['field']('tq.TeamId')[_0x4224('0x72')](_0x4224('0x73'),'tq')[_0x4224('0x74')](_0x4224('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x4224('0x76'),_0x4ba5a5[_0x4224('0x4c')]['id']);for(var _0x2305c0=0x0;_0x2305c0<_0x4dd5c6[_0x4224('0x3c')];_0x2305c0+=0x1){let _0x151fae=_0x4dd5c6[_0x2305c0];for(var _0x3fbe1c=0x0;_0x3fbe1c<_0x151fae[_0x4224('0x66')][_0x4224('0x3c')];_0x3fbe1c+=0x1){let _0x5c05e2=_0x151fae[_0x4224('0x66')][_0x3fbe1c];var _0x44912b=_0x42b1f0[_0x4224('0x77')]();_0x44912b['where'](_0x4224('0x78'),_0x5c05e2['id']);_0x5dca9f[_0x4224('0x79')](db[_0x4224('0x6b')]['query'](_0x44912b[_0x4224('0x7a')](),{'type':db[_0x4224('0x6b')]['QueryTypes']['SELECT']})[_0x4224('0x2c')](function(_0x1497b5){if(_0x1497b5['length']===0x1){return _0x5c05e2['id'];}else{var _0x29b408=_[_0x4224('0x7b')](_[_0x4224('0x44')](_0x1497b5,_0x4224('0x7c')),function(_0x57a644){return _[_0x4224('0x7d')](_0x42edd8,_0x57a644);});if(_0x29b408){return _0x5c05e2['id'];}}}));}}return BPromise[_0x4224('0x7e')](_0x5dca9f)[_0x4224('0x2c')](function(_0x4fa76c){_0x21a3ef=_(_0x21a3ef)[_0x4224('0x7f')](_0x4fa76c)['compact']()['value']();return db['FaxQueue'][_0x4224('0x4f')]({'where':{'id':_0x4ba5a5[_0x4224('0x4c')]['id']}})[_0x4224('0x2c')](function(_0x4864b7){return db['sequelize'][_0x4224('0x6c')](function(_0x24146a){return _0x4864b7[_0x4224('0x70')](_0x4ba5a5[_0x4224('0x36')][_0x4224('0x65')],{'transaction':_0x24146a})[_0x4224('0x2c')](function(){if(!_[_0x4224('0x80')](_0x21a3ef)){return _0x4864b7['removeAgents'](_0x21a3ef,{'transaction':_0x24146a});}})[_0x4224('0x2c')](function(){_0x21a3ef[_0x4224('0x6e')](function(_0x22c888){socket[_0x4224('0x6f')](_0x4224('0x81'),{'UserId':_0x22c888,'FaxQueueId':_0x4864b7['id']});});});});});});})[_0x4224('0x2c')](respondWithStatusCode(_0x17a793,null))[_0x4224('0x4a')](handleError(_0x17a793,null));};exports[_0x4224('0x82')]=function(_0x476411,_0x99fb11,_0x32156e){return db[_0x4224('0x47')]['find']({'where':{'id':_0x476411[_0x4224('0x4c')]['id']}})[_0x4224('0x2c')](handleEntityNotFound(_0x99fb11,null))['then'](function(_0x319dc6){if(_0x319dc6){return _0x319dc6[_0x4224('0x82')](_0x476411[_0x4224('0x51')][_0x4224('0x65')],_[_0x4224('0x83')](_0x476411[_0x4224('0x51')],[_0x4224('0x65'),'id'])||{})[_0x4224('0x84')](function(_0x1d013c){for(var _0x172368=0x0;_0x172368<_0x476411[_0x4224('0x51')]['ids'][_0x4224('0x3c')];_0x172368+=0x1){socket[_0x4224('0x6f')]('userFaxQueue:save',{'UserId':Number(_0x476411[_0x4224('0x51')]['ids'][_0x172368]),'FaxQueueId':Number(_0x476411['params']['id'])});}return _0x1d013c;});}})[_0x4224('0x2c')](respondWithResult(_0x99fb11,null))[_0x4224('0x4a')](handleError(_0x99fb11,null));};exports[_0x4224('0x85')]=function(_0x246c07,_0x2552ac,_0xda8dd3){return db[_0x4224('0x47')][_0x4224('0x4f')]({'where':{'id':_0x246c07['params']['id']}})['then'](handleEntityNotFound(_0x2552ac,null))[_0x4224('0x2c')](function(_0x3bf33e){if(_0x3bf33e){return _0x3bf33e[_0x4224('0x85')](_0x246c07[_0x4224('0x36')]['ids'])[_0x4224('0x2c')](function(){if(_[_0x4224('0x86')](_0x246c07[_0x4224('0x36')]['ids'])){for(var _0x4d68ff=0x0;_0x4d68ff<_0x246c07[_0x4224('0x36')][_0x4224('0x65')][_0x4224('0x3c')];_0x4d68ff+=0x1){socket[_0x4224('0x6f')](_0x4224('0x81'),{'UserId':Number(_0x246c07['query'][_0x4224('0x65')][_0x4d68ff]),'FaxQueueId':Number(_0x246c07[_0x4224('0x4c')]['id'])});}}else{socket[_0x4224('0x6f')](_0x4224('0x81'),{'UserId':Number(_0x246c07[_0x4224('0x36')][_0x4224('0x65')]),'FaxQueueId':Number(_0x246c07[_0x4224('0x4c')]['id'])});}});}})[_0x4224('0x2c')](respondWithStatusCode(_0x2552ac,null))[_0x4224('0x4a')](handleError(_0x2552ac,null));};exports[_0x4224('0x87')]=function(_0x4f078e,_0x1bbc19,_0x414bb7){var _0x2ccf2c={};var _0x36c0e6={};var _0x1e1fe8;var _0x1de7e3;return db[_0x4224('0x47')]['findOne']({'where':{'id':_0x4f078e['params']['id']}})['then'](handleEntityNotFound(_0x1bbc19,null))[_0x4224('0x2c')](function(_0x4c4218){if(_0x4c4218){_0x1e1fe8=_0x4c4218;_0x36c0e6[_0x4224('0x35')]=_[_0x4224('0x37')](db['User']['rawAttributes']);_0x36c0e6[_0x4224('0x36')]=_[_0x4224('0x37')](_0x4f078e['query']);_0x36c0e6[_0x4224('0x38')]=_['intersection'](_0x36c0e6[_0x4224('0x35')],_0x36c0e6[_0x4224('0x36')]);_0x2ccf2c[_0x4224('0x3b')]=_['intersection'](_0x36c0e6[_0x4224('0x35')],qs['fields'](_0x4f078e[_0x4224('0x36')][_0x4224('0x3a')]));_0x2ccf2c['attributes']=_0x2ccf2c['attributes']['length']?_0x2ccf2c[_0x4224('0x3b')]:_0x36c0e6[_0x4224('0x35')];_0x2ccf2c[_0x4224('0x3e')]=qs[_0x4224('0x3f')](_0x4f078e['query'][_0x4224('0x3f')]);_0x2ccf2c[_0x4224('0x40')]=qs[_0x4224('0x38')](_[_0x4224('0x41')](_0x4f078e[_0x4224('0x36')],_0x36c0e6[_0x4224('0x38')]));if(_0x4f078e[_0x4224('0x36')][_0x4224('0x42')]){_0x2ccf2c[_0x4224('0x40')]=_[_0x4224('0x43')](_0x2ccf2c[_0x4224('0x40')],{'$or':_[_0x4224('0x44')](_0x2ccf2c[_0x4224('0x3b')],function(_0x2a8fc3){var _0x583f87={};_0x583f87[_0x2a8fc3]={'$like':'%'+_0x4f078e['query']['filter']+'%'};return _0x583f87;})});}_0x2ccf2c=_[_0x4224('0x43')]({},_0x2ccf2c,_0x4f078e['options']);return _0x1e1fe8[_0x4224('0x87')](_0x2ccf2c);}})[_0x4224('0x2c')](function(_0x730973){if(_0x730973){_0x1de7e3=_0x730973[_0x4224('0x3c')];if(!_0x4f078e[_0x4224('0x36')]['hasOwnProperty'](_0x4224('0x5a'))){_0x2ccf2c[_0x4224('0x27')]=qs[_0x4224('0x27')](_0x4f078e['query'][_0x4224('0x27')]);_0x2ccf2c['offset']=qs['offset'](_0x4f078e[_0x4224('0x36')][_0x4224('0x24')]);}return _0x1e1fe8[_0x4224('0x87')](_0x2ccf2c);}})[_0x4224('0x2c')](function(_0x4d9b0b){if(_0x4d9b0b){return _0x4d9b0b?{'count':_0x1de7e3,'rows':_0x4d9b0b}:null;}})['then'](respondWithResult(_0x1bbc19,null))[_0x4224('0x4a')](handleError(_0x1bbc19,null));}; \ No newline at end of file +var _0x25a1=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','rows','%s/%s','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxQueue.socket','register','sendStatus','status','json','limit','undefined','count','offset','apply','reject','save','then','get','FaxQueues','destroy','end','error','stack','name','send','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','FaxQueue','findAll','catch','show','params','rawAttributes','find','create'];(function(_0x17de8f,_0x2d5177){var _0xc19ec4=function(_0x3424c0){while(--_0x3424c0){_0x17de8f['push'](_0x17de8f['shift']());}};_0xc19ec4(++_0x2d5177);}(_0x25a1,0xcd));var _0x125a=function(_0x11de53,_0x22d9f3){_0x11de53=_0x11de53-0x0;var _0x499bc7=_0x25a1[_0x11de53];return _0x499bc7;};'use strict';var emlformat=require(_0x125a('0x0'));var rimraf=require(_0x125a('0x1'));var zipdir=require(_0x125a('0x2'));var jsonpatch=require(_0x125a('0x3'));var rp=require(_0x125a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x125a('0x5'));var util=require(_0x125a('0x6'));var path=require(_0x125a('0x7'));var sox=require(_0x125a('0x8'));var csv=require(_0x125a('0x9'));var ejs=require(_0x125a('0xa'));var fs=require('fs');var fs_extra=require(_0x125a('0xb'));var _=require('lodash');var squel=require(_0x125a('0xc'));var crypto=require('crypto');var jsforce=require(_0x125a('0xd'));var deskjs=require(_0x125a('0xe'));var toCsv=require(_0x125a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x125a('0xf'));var authService=require(_0x125a('0x10'));var qs=require(_0x125a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x125a('0x12'));var utils=require(_0x125a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x125a('0x14'));var db=require(_0x125a('0x15'))['db'];config['redis']=_[_0x125a('0x16')](config['redis'],{'host':_0x125a('0x17'),'port':0x18eb});var socket=require(_0x125a('0x18'))(new Redis(config[_0x125a('0x19')]));require(_0x125a('0x1a'))[_0x125a('0x1b')](socket);function respondWithStatusCode(_0x49b939,_0x4628fb){_0x4628fb=_0x4628fb||0xcc;return function(_0x2a792a){if(_0x2a792a){return _0x49b939[_0x125a('0x1c')](_0x4628fb);}return _0x49b939[_0x125a('0x1d')](_0x4628fb)['end']();};}function respondWithResult(_0x589d75,_0x390615){_0x390615=_0x390615||0xc8;return function(_0xdb2f25){if(_0xdb2f25){return _0x589d75['status'](_0x390615)[_0x125a('0x1e')](_0xdb2f25);}};}function respondWithFilteredResult(_0x4a8501,_0x101e78){return function(_0x168b1b){if(_0x168b1b){var _0x2b662d=typeof _0x101e78['offset']==='undefined'&&typeof _0x101e78[_0x125a('0x1f')]===_0x125a('0x20');var _0x2ef6bf=_0x168b1b[_0x125a('0x21')];var _0x59f02b=_0x2b662d?0x0:_0x101e78[_0x125a('0x22')];var _0x17eff9=_0x2b662d?_0x168b1b[_0x125a('0x21')]:_0x101e78['offset']+_0x101e78['limit'];var _0x461a7d;if(_0x17eff9>=_0x2ef6bf){_0x17eff9=_0x2ef6bf;_0x461a7d=0xc8;}else{_0x461a7d=0xce;}_0x4a8501[_0x125a('0x1d')](_0x461a7d);return _0x4a8501['set']('Content-Range',_0x59f02b+'-'+_0x17eff9+'/'+_0x2ef6bf)['json'](_0x168b1b);}return null;};}function patchUpdates(_0x20805b){return function(_0x118390){try{jsonpatch[_0x125a('0x23')](_0x118390,_0x20805b,!![]);}catch(_0x1dd0e9){return BPromise[_0x125a('0x24')](_0x1dd0e9);}return _0x118390[_0x125a('0x25')]();};}function saveUpdates(_0x1334cf,_0x380098){return function(_0x3d1e08){if(_0x3d1e08){return _0x3d1e08['update'](_0x1334cf)['then'](function(_0x41718a){return _0x41718a;});}return null;};}function removeEntity(_0x36f02c,_0x424552){return function(_0x2227f5){if(_0x2227f5){return _0x2227f5['destroy']()[_0x125a('0x26')](function(){var _0x12bd54=_0x2227f5[_0x125a('0x27')]({'plain':!![]});var _0x12994e=_0x125a('0x28');return db['UserProfileResource'][_0x125a('0x29')]({'where':{'type':_0x12994e,'resourceId':_0x12bd54['id']}})[_0x125a('0x26')](function(){return _0x2227f5;});})[_0x125a('0x26')](function(){_0x36f02c[_0x125a('0x1d')](0xcc)[_0x125a('0x2a')]();});}};}function handleEntityNotFound(_0x200eab,_0x27a043){return function(_0x232380){if(!_0x232380){_0x200eab[_0x125a('0x1c')](0x194);}return _0x232380;};}function handleError(_0x44f6a8,_0x4fb881){_0x4fb881=_0x4fb881||0x1f4;return function(_0x5e7ba2){logger[_0x125a('0x2b')](_0x5e7ba2[_0x125a('0x2c')]);if(_0x5e7ba2[_0x125a('0x2d')]){delete _0x5e7ba2[_0x125a('0x2d')];}_0x44f6a8['status'](_0x4fb881)[_0x125a('0x2e')](_0x5e7ba2);};}exports[_0x125a('0x2f')]=function(_0x380ab3,_0x16f575){var _0x18e12b={},_0x34df8b={},_0x3c2dc1={'count':0x0,'rows':[]};var _0x2dde1f=_[_0x125a('0x30')](db['FaxQueue']['rawAttributes'],function(_0x4a5797){return{'name':_0x4a5797[_0x125a('0x31')],'type':_0x4a5797[_0x125a('0x32')]['key']};});_0x34df8b[_0x125a('0x33')]=_[_0x125a('0x30')](_0x2dde1f,'name');_0x34df8b[_0x125a('0x34')]=_[_0x125a('0x35')](_0x380ab3[_0x125a('0x34')]);_0x34df8b['filters']=_[_0x125a('0x36')](_0x34df8b[_0x125a('0x33')],_0x34df8b[_0x125a('0x34')]);_0x18e12b[_0x125a('0x37')]=_['intersection'](_0x34df8b[_0x125a('0x33')],qs[_0x125a('0x38')](_0x380ab3[_0x125a('0x34')]['fields']));_0x18e12b[_0x125a('0x37')]=_0x18e12b[_0x125a('0x37')][_0x125a('0x39')]?_0x18e12b['attributes']:_0x34df8b[_0x125a('0x33')];if(!_0x380ab3[_0x125a('0x34')][_0x125a('0x3a')](_0x125a('0x3b'))){_0x18e12b[_0x125a('0x1f')]=qs[_0x125a('0x1f')](_0x380ab3[_0x125a('0x34')]['limit']);_0x18e12b[_0x125a('0x22')]=qs[_0x125a('0x22')](_0x380ab3[_0x125a('0x34')][_0x125a('0x22')]);}_0x18e12b[_0x125a('0x3c')]=qs[_0x125a('0x3d')](_0x380ab3[_0x125a('0x34')][_0x125a('0x3d')]);_0x18e12b[_0x125a('0x3e')]=qs[_0x125a('0x3f')](_[_0x125a('0x40')](_0x380ab3[_0x125a('0x34')],_0x34df8b[_0x125a('0x3f')]),_0x2dde1f);if(_0x380ab3['query'][_0x125a('0x41')]){_0x18e12b[_0x125a('0x3e')]=_[_0x125a('0x42')](_0x18e12b[_0x125a('0x3e')],{'$or':_[_0x125a('0x30')](_0x2dde1f,function(_0x2213e5){if(_0x2213e5[_0x125a('0x32')]!==_0x125a('0x43')){var _0x13edca={};_0x13edca[_0x2213e5[_0x125a('0x2d')]]={'$like':'%'+_0x380ab3[_0x125a('0x34')]['filter']+'%'};return _0x13edca;}})});}_0x18e12b=_[_0x125a('0x42')]({},_0x18e12b,_0x380ab3[_0x125a('0x44')]);var _0x10964f={'where':_0x18e12b[_0x125a('0x3e')]};return db['FaxQueue']['count'](_0x10964f)[_0x125a('0x26')](function(_0x41be6d){_0x3c2dc1[_0x125a('0x21')]=_0x41be6d;if(_0x380ab3[_0x125a('0x34')][_0x125a('0x45')]){_0x18e12b[_0x125a('0x46')]=[{'all':!![]}];}return db[_0x125a('0x47')][_0x125a('0x48')](_0x18e12b);})['then'](function(_0x1aa4d0){_0x3c2dc1['rows']=_0x1aa4d0;return _0x3c2dc1;})['then'](respondWithFilteredResult(_0x16f575,_0x18e12b))[_0x125a('0x49')](handleError(_0x16f575,null));};exports[_0x125a('0x4a')]=function(_0xde2c86,_0x178265){var _0x4f9399={'raw':!![],'where':{'id':_0xde2c86[_0x125a('0x4b')]['id']}},_0x5d2fe8={};_0x5d2fe8[_0x125a('0x33')]=_[_0x125a('0x35')](db[_0x125a('0x47')][_0x125a('0x4c')]);_0x5d2fe8[_0x125a('0x34')]=_[_0x125a('0x35')](_0xde2c86[_0x125a('0x34')]);_0x5d2fe8[_0x125a('0x3f')]=_[_0x125a('0x36')](_0x5d2fe8['model'],_0x5d2fe8['query']);_0x4f9399[_0x125a('0x37')]=_['intersection'](_0x5d2fe8['model'],qs[_0x125a('0x38')](_0xde2c86['query'][_0x125a('0x38')]));_0x4f9399[_0x125a('0x37')]=_0x4f9399[_0x125a('0x37')][_0x125a('0x39')]?_0x4f9399['attributes']:_0x5d2fe8[_0x125a('0x33')];if(_0xde2c86[_0x125a('0x34')][_0x125a('0x45')]){_0x4f9399['include']=[{'all':!![]}];}_0x4f9399=_['merge']({},_0x4f9399,_0xde2c86[_0x125a('0x44')]);return db['FaxQueue'][_0x125a('0x4d')](_0x4f9399)['then'](handleEntityNotFound(_0x178265,null))[_0x125a('0x26')](respondWithResult(_0x178265,null))['catch'](handleError(_0x178265,null));};exports[_0x125a('0x4e')]=function(_0x1fd2b6,_0x103078){return db[_0x125a('0x47')]['create'](_0x1fd2b6['body'],{})['then'](function(_0x34117b){var _0x3e36d9=_0x1fd2b6[_0x125a('0x4f')][_0x125a('0x27')]({'plain':!![]});if(!_0x3e36d9)throw new Error(_0x125a('0x50'));if(_0x3e36d9[_0x125a('0x51')]===_0x125a('0x4f')){var _0x290a54=_0x34117b[_0x125a('0x27')]({'plain':!![]});var _0x3b71fb=_0x125a('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x3b71fb,'userProfileId':_0x3e36d9[_0x125a('0x52')]},'raw':!![]})[_0x125a('0x26')](function(_0x1b7e80){if(_0x1b7e80&&_0x1b7e80['autoAssociation']===0x0){return db[_0x125a('0x53')][_0x125a('0x4e')]({'name':_0x290a54[_0x125a('0x2d')],'resourceId':_0x290a54['id'],'type':_0x1b7e80[_0x125a('0x2d')],'sectionId':_0x1b7e80['id']},{})[_0x125a('0x26')](function(){return _0x34117b;});}else{return _0x34117b;}})[_0x125a('0x49')](function(_0x253b59){logger[_0x125a('0x2b')](_0x125a('0x54'),_0x253b59);throw _0x253b59;});}return _0x34117b;})[_0x125a('0x26')](respondWithResult(_0x103078,0xc9))['catch'](handleError(_0x103078,null));};exports[_0x125a('0x55')]=function(_0x9416a0,_0x1aa834){if(_0x9416a0[_0x125a('0x56')]['id']){delete _0x9416a0[_0x125a('0x56')]['id'];}return db[_0x125a('0x47')][_0x125a('0x4d')]({'where':{'id':_0x9416a0[_0x125a('0x4b')]['id']}})[_0x125a('0x26')](handleEntityNotFound(_0x1aa834,null))['then'](saveUpdates(_0x9416a0[_0x125a('0x56')],null))[_0x125a('0x26')](respondWithResult(_0x1aa834,null))[_0x125a('0x49')](handleError(_0x1aa834,null));};exports[_0x125a('0x29')]=function(_0x5205a9,_0x152e76){return db[_0x125a('0x47')]['find']({'where':{'id':_0x5205a9[_0x125a('0x4b')]['id']}})[_0x125a('0x26')](handleEntityNotFound(_0x152e76,null))[_0x125a('0x26')](removeEntity(_0x152e76,null))[_0x125a('0x49')](handleError(_0x152e76,null));};exports[_0x125a('0x57')]=function(_0xbb96c1,_0x963b06){return db[_0x125a('0x47')][_0x125a('0x57')]()[_0x125a('0x26')](respondWithResult(_0x963b06,null))[_0x125a('0x49')](handleError(_0x963b06,null));};exports[_0x125a('0x58')]=function(_0x248f6e,_0xbd8c55,_0x6792e1){var _0xd53da0={'raw':!![],'where':{}},_0x567351={},_0x4996d6;return db['FaxQueue'][_0x125a('0x59')]({'where':{'id':_0x248f6e[_0x125a('0x4b')]['id']}})[_0x125a('0x26')](handleEntityNotFound(_0xbd8c55,null))['then'](function(_0x41946f){if(_0x41946f){_0x4996d6=_0x41946f['get']({'plain':!![]});_0x567351['model']=_[_0x125a('0x35')](db[_0x125a('0x5a')]['rawAttributes']);_0x567351['query']=_[_0x125a('0x35')](_0x248f6e[_0x125a('0x34')]);_0x567351[_0x125a('0x3f')]=_[_0x125a('0x36')](_0x567351['model'],_0x567351[_0x125a('0x34')]);_0xd53da0[_0x125a('0x37')]=_['intersection'](_0x567351[_0x125a('0x33')],qs[_0x125a('0x38')](_0x248f6e['query'][_0x125a('0x38')]));_0xd53da0[_0x125a('0x37')]=_0xd53da0[_0x125a('0x37')][_0x125a('0x39')]?_0xd53da0['attributes']:_0x567351[_0x125a('0x33')];if(!_0x248f6e[_0x125a('0x34')][_0x125a('0x3a')]('nolimit')){_0xd53da0[_0x125a('0x1f')]=qs[_0x125a('0x1f')](_0x248f6e['query']['limit']);_0xd53da0[_0x125a('0x22')]=qs[_0x125a('0x22')](_0x248f6e[_0x125a('0x34')][_0x125a('0x22')]);}_0xd53da0[_0x125a('0x3c')]=qs[_0x125a('0x3d')](_0x248f6e['query'][_0x125a('0x3d')]);_0xd53da0[_0x125a('0x3e')]=qs['filters'](_[_0x125a('0x40')](_0x248f6e[_0x125a('0x34')],_0x567351[_0x125a('0x3f')]));_0xd53da0[_0x125a('0x3e')][_0x125a('0x5b')]=_0x41946f['id'];if(_0x248f6e['query'][_0x125a('0x41')]){_0xd53da0[_0x125a('0x3e')]=_[_0x125a('0x42')](_0xd53da0['where'],{'$or':_[_0x125a('0x30')](_0xd53da0['attributes'],function(_0x3c7d26){var _0x4a96a6={};_0x4a96a6[_0x3c7d26]={'$like':'%'+_0x248f6e[_0x125a('0x34')][_0x125a('0x41')]+'%'};return _0x4a96a6;})});}_0xd53da0=_[_0x125a('0x42')]({},_0xd53da0,_0x248f6e['options']);return db[_0x125a('0x5a')][_0x125a('0x48')](_0xd53da0);}})[_0x125a('0x26')](function(_0x16524d){if(_0x16524d){return db[_0x125a('0x5c')][_0x125a('0x5d')]({'where':{'id':_[_0x125a('0x30')](_0x16524d,_0x125a('0x5e')),'role':'agent'},'attributes':['id',_0x125a('0x2d'),_0x125a('0x5f'),_0x125a('0x60'),_0x125a('0x61')]});}})[_0x125a('0x26')](function(_0xd37973){if(_0xd37973){return{'count':_0xd37973[_0x125a('0x21')],'rows':_[_0x125a('0x30')](_0xd37973[_0x125a('0x62')],function(_0x967e8c){return{'membername':_0x967e8c[_0x125a('0x2d')],'UserId':_0x967e8c['id'],'queue_name':_0x4996d6[_0x125a('0x2d')],'FaxQueueId':_0x4996d6['id'],'interface':util['format'](_0x125a('0x63'),'SIP',_0x967e8c[_0x125a('0x2d')]),'penalty':0x0,'paused':_0x967e8c['faxPause'],'createdAt':_0x967e8c['createdAt'],'updatedAt':_0x967e8c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xbd8c55,_0xd53da0))[_0x125a('0x49')](handleError(_0xbd8c55,null));};exports[_0x125a('0x64')]=function(_0x578432,_0x10dd6e,_0x18287c){var _0x4aaf9={};var _0x3c40c8={};var _0x33a821;var _0x3c7ddf;return db[_0x125a('0x47')][_0x125a('0x59')]({'where':{'id':_0x578432[_0x125a('0x4b')]['id']}})[_0x125a('0x26')](handleEntityNotFound(_0x10dd6e,null))[_0x125a('0x26')](function(_0x39a1fd){if(_0x39a1fd){_0x33a821=_0x39a1fd;_0x3c40c8[_0x125a('0x33')]=_[_0x125a('0x35')](db[_0x125a('0x65')]['rawAttributes']);_0x3c40c8[_0x125a('0x34')]=_['keys'](_0x578432[_0x125a('0x34')]);_0x3c40c8[_0x125a('0x3f')]=_[_0x125a('0x36')](_0x3c40c8['model'],_0x3c40c8[_0x125a('0x34')]);_0x4aaf9[_0x125a('0x37')]=_[_0x125a('0x36')](_0x3c40c8[_0x125a('0x33')],qs[_0x125a('0x38')](_0x578432['query'][_0x125a('0x38')]));_0x4aaf9['attributes']=_0x4aaf9[_0x125a('0x37')][_0x125a('0x39')]?_0x4aaf9[_0x125a('0x37')]:_0x3c40c8['model'];_0x4aaf9[_0x125a('0x3c')]=qs[_0x125a('0x3d')](_0x578432['query']['sort']);_0x4aaf9['where']=qs['filters'](_[_0x125a('0x40')](_0x578432[_0x125a('0x34')],_0x3c40c8[_0x125a('0x3f')]));if(_0x578432[_0x125a('0x34')]['filter']){_0x4aaf9[_0x125a('0x3e')]=_[_0x125a('0x42')](_0x4aaf9['where'],{'$or':_[_0x125a('0x30')](_0x4aaf9[_0x125a('0x37')],function(_0x49f9b7){var _0xb5315f={};_0xb5315f[_0x49f9b7]={'$like':'%'+_0x578432['query'][_0x125a('0x41')]+'%'};return _0xb5315f;})});}_0x4aaf9=_[_0x125a('0x42')]({},_0x4aaf9,_0x578432[_0x125a('0x44')]);return _0x33a821[_0x125a('0x64')](_0x4aaf9);}})[_0x125a('0x26')](function(_0x4a22e7){if(_0x4a22e7){_0x3c7ddf=_0x4a22e7[_0x125a('0x39')];if(!_0x578432[_0x125a('0x34')][_0x125a('0x3a')](_0x125a('0x3b'))){_0x4aaf9[_0x125a('0x1f')]=qs[_0x125a('0x1f')](_0x578432[_0x125a('0x34')]['limit']);_0x4aaf9['offset']=qs[_0x125a('0x22')](_0x578432['query'][_0x125a('0x22')]);}return _0x33a821[_0x125a('0x64')](_0x4aaf9);}})['then'](function(_0x150249){if(_0x150249){return _0x150249?{'count':_0x3c7ddf,'rows':_0x150249}:null;}})[_0x125a('0x26')](respondWithResult(_0x10dd6e,null))[_0x125a('0x49')](handleError(_0x10dd6e,null));};exports[_0x125a('0x66')]=function(_0x3a9506,_0x256782,_0x41287c){var _0x555d48=_0x3a9506[_0x125a('0x56')][_0x125a('0x67')];return db['Team']['findAll']({'where':{'id':_0x555d48},'attributes':['id'],'include':[{'model':db[_0x125a('0x5c')],'as':_0x125a('0x68'),'attributes':['id',_0x125a('0x2d'),_0x125a('0x69'),_0x125a('0x6a'),_0x125a('0x6b')],'raw':!![]}]})['then'](function(_0x3c17b9){if(_0x3c17b9){var _0x5053f9=_[_0x125a('0x6c')](_0x3c17b9,function(_0x576fd4){var _0x5e9cfc=_0x576fd4[_0x125a('0x27')]({'plain':!![]});return _0x5e9cfc[_0x125a('0x68')];});return db['FaxQueue'][_0x125a('0x4d')]({'where':{'id':_0x3a9506[_0x125a('0x4b')]['id']}})[_0x125a('0x26')](function(_0x4bf8f3){return db[_0x125a('0x6d')][_0x125a('0x6e')](function(_0x346ec8){return _0x4bf8f3[_0x125a('0x66')](_0x555d48,{'transaction':_0x346ec8})[_0x125a('0x26')](function(){return BPromise['each'](_0x5053f9,function(_0x1d8195){return db['UserFaxQueue'][_0x125a('0x6f')]({'where':{'UserId':_0x1d8195['id'],'FaxQueueId':_0x3a9506['params']['id']},'transaction':_0x346ec8});});})[_0x125a('0x26')](function(){_0x5053f9[_0x125a('0x70')](function(_0x41c91e){socket[_0x125a('0x71')](_0x125a('0x72'),{'UserId':_0x41c91e['id'],'FaxQueueId':_0x4bf8f3['id']});});});});});}})[_0x125a('0x26')](respondWithStatusCode(_0x256782,null))[_0x125a('0x49')](handleError(_0x256782,null));};exports['removeTeams']=function(_0x1db931,_0x55cca4,_0x31d69d){return db[_0x125a('0x65')][_0x125a('0x48')]({'where':{'id':_0x1db931[_0x125a('0x34')][_0x125a('0x67')]},'attributes':['id'],'include':[{'model':db[_0x125a('0x5c')],'as':_0x125a('0x68'),'attributes':['id'],'raw':!![]}]})[_0x125a('0x26')](handleEntityNotFound(_0x55cca4,null))['then'](function(_0x2774f4){var _0xc7523f=_[_0x125a('0x30')](_0x2774f4,'id');var _0x3cf5a5=[];var _0x293a49=[];var _0x1089c5=squel[_0x125a('0x73')]();_0x1089c5[_0x125a('0x74')](_0x125a('0x75'))[_0x125a('0x76')](_0x125a('0x77'),'tq')[_0x125a('0x78')](_0x125a('0x79'),'ut',_0x125a('0x7a'))['where'](_0x125a('0x7b'),_0x1db931[_0x125a('0x4b')]['id']);for(var _0x4a14c8=0x0;_0x4a14c8<_0x2774f4[_0x125a('0x39')];_0x4a14c8+=0x1){let _0x9be655=_0x2774f4[_0x4a14c8];for(var _0x5e925f=0x0;_0x5e925f<_0x9be655[_0x125a('0x68')][_0x125a('0x39')];_0x5e925f+=0x1){let _0x4b05be=_0x9be655[_0x125a('0x68')][_0x5e925f];var _0x57a0b3=_0x1089c5[_0x125a('0x7c')]();_0x57a0b3[_0x125a('0x3e')](_0x125a('0x7d'),_0x4b05be['id']);_0x293a49[_0x125a('0x7e')](db[_0x125a('0x6d')]['query'](_0x57a0b3[_0x125a('0x7f')](),{'type':db[_0x125a('0x6d')][_0x125a('0x80')]['SELECT']})[_0x125a('0x26')](function(_0x32485f){if(_0x32485f[_0x125a('0x39')]===0x1){return _0x4b05be['id'];}else{var _0x3dc9c5=_[_0x125a('0x81')](_[_0x125a('0x30')](_0x32485f,'TeamId'),function(_0x55fce4){return _[_0x125a('0x82')](_0xc7523f,_0x55fce4);});if(_0x3dc9c5){return _0x4b05be['id'];}}}));}}return BPromise[_0x125a('0x83')](_0x293a49)[_0x125a('0x26')](function(_0x3bd7aa){_0x3cf5a5=_(_0x3cf5a5)[_0x125a('0x84')](_0x3bd7aa)[_0x125a('0x85')]()[_0x125a('0x86')]();return db['FaxQueue']['find']({'where':{'id':_0x1db931[_0x125a('0x4b')]['id']}})[_0x125a('0x26')](function(_0x42514c){return db['sequelize'][_0x125a('0x6e')](function(_0x575d68){return _0x42514c['removeTeams'](_0x1db931[_0x125a('0x34')]['ids'],{'transaction':_0x575d68})[_0x125a('0x26')](function(){if(!_[_0x125a('0x87')](_0x3cf5a5)){return _0x42514c[_0x125a('0x88')](_0x3cf5a5,{'transaction':_0x575d68});}})[_0x125a('0x26')](function(){_0x3cf5a5[_0x125a('0x70')](function(_0x2b0dcb){socket[_0x125a('0x71')]('userFaxQueue:remove',{'UserId':_0x2b0dcb,'FaxQueueId':_0x42514c['id']});});});});});});})[_0x125a('0x26')](respondWithStatusCode(_0x55cca4,null))[_0x125a('0x49')](handleError(_0x55cca4,null));};exports[_0x125a('0x89')]=function(_0x3389ac,_0x17fb9e,_0x314f43){return db[_0x125a('0x47')][_0x125a('0x4d')]({'where':{'id':_0x3389ac[_0x125a('0x4b')]['id']}})[_0x125a('0x26')](handleEntityNotFound(_0x17fb9e,null))[_0x125a('0x26')](function(_0x44f6a0){if(_0x44f6a0){return _0x44f6a0[_0x125a('0x89')](_0x3389ac[_0x125a('0x56')][_0x125a('0x67')],_['omit'](_0x3389ac[_0x125a('0x56')],[_0x125a('0x67'),'id'])||{})[_0x125a('0x8a')](function(_0x5a066e){for(var _0x5218fc=0x0;_0x5218fc<_0x3389ac[_0x125a('0x56')][_0x125a('0x67')][_0x125a('0x39')];_0x5218fc+=0x1){socket[_0x125a('0x71')](_0x125a('0x72'),{'UserId':Number(_0x3389ac[_0x125a('0x56')][_0x125a('0x67')][_0x5218fc]),'FaxQueueId':Number(_0x3389ac['params']['id'])});}return _0x5a066e;});}})[_0x125a('0x26')](respondWithResult(_0x17fb9e,null))[_0x125a('0x49')](handleError(_0x17fb9e,null));};exports[_0x125a('0x88')]=function(_0x48e974,_0x2f8304,_0x557c4c){return db['FaxQueue'][_0x125a('0x4d')]({'where':{'id':_0x48e974[_0x125a('0x4b')]['id']}})[_0x125a('0x26')](handleEntityNotFound(_0x2f8304,null))['then'](function(_0xeaaf68){if(_0xeaaf68){return _0xeaaf68['removeAgents'](_0x48e974[_0x125a('0x34')][_0x125a('0x67')])['then'](function(){if(_[_0x125a('0x8b')](_0x48e974[_0x125a('0x34')][_0x125a('0x67')])){for(var _0x597883=0x0;_0x597883<_0x48e974['query'][_0x125a('0x67')]['length'];_0x597883+=0x1){socket[_0x125a('0x71')]('userFaxQueue:remove',{'UserId':Number(_0x48e974[_0x125a('0x34')]['ids'][_0x597883]),'FaxQueueId':Number(_0x48e974[_0x125a('0x4b')]['id'])});}}else{socket[_0x125a('0x71')](_0x125a('0x8c'),{'UserId':Number(_0x48e974[_0x125a('0x34')][_0x125a('0x67')]),'FaxQueueId':Number(_0x48e974[_0x125a('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x2f8304,null))['catch'](handleError(_0x2f8304,null));};exports[_0x125a('0x8d')]=function(_0x50bfb9,_0x61153,_0x467010){var _0x4ed790={};var _0x41e955={};var _0x1a3ef2;var _0x5b0fd4;return db[_0x125a('0x47')][_0x125a('0x59')]({'where':{'id':_0x50bfb9[_0x125a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x61153,null))['then'](function(_0x5f5acd){if(_0x5f5acd){_0x1a3ef2=_0x5f5acd;_0x41e955[_0x125a('0x33')]=_[_0x125a('0x35')](db[_0x125a('0x5c')][_0x125a('0x4c')]);_0x41e955['query']=_[_0x125a('0x35')](_0x50bfb9[_0x125a('0x34')]);_0x41e955['filters']=_[_0x125a('0x36')](_0x41e955[_0x125a('0x33')],_0x41e955[_0x125a('0x34')]);_0x4ed790['attributes']=_[_0x125a('0x36')](_0x41e955['model'],qs[_0x125a('0x38')](_0x50bfb9[_0x125a('0x34')]['fields']));_0x4ed790[_0x125a('0x37')]=_0x4ed790['attributes'][_0x125a('0x39')]?_0x4ed790[_0x125a('0x37')]:_0x41e955[_0x125a('0x33')];_0x4ed790[_0x125a('0x3c')]=qs[_0x125a('0x3d')](_0x50bfb9[_0x125a('0x34')][_0x125a('0x3d')]);_0x4ed790[_0x125a('0x3e')]=qs[_0x125a('0x3f')](_[_0x125a('0x40')](_0x50bfb9[_0x125a('0x34')],_0x41e955['filters']));if(_0x50bfb9[_0x125a('0x34')][_0x125a('0x41')]){_0x4ed790[_0x125a('0x3e')]=_[_0x125a('0x42')](_0x4ed790[_0x125a('0x3e')],{'$or':_['map'](_0x4ed790['attributes'],function(_0x4bdc56){var _0x272de2={};_0x272de2[_0x4bdc56]={'$like':'%'+_0x50bfb9[_0x125a('0x34')]['filter']+'%'};return _0x272de2;})});}_0x4ed790=_[_0x125a('0x42')]({},_0x4ed790,_0x50bfb9[_0x125a('0x44')]);return _0x1a3ef2['getAgents'](_0x4ed790);}})[_0x125a('0x26')](function(_0x3d47ba){if(_0x3d47ba){_0x5b0fd4=_0x3d47ba[_0x125a('0x39')];if(!_0x50bfb9[_0x125a('0x34')]['hasOwnProperty']('nolimit')){_0x4ed790[_0x125a('0x1f')]=qs[_0x125a('0x1f')](_0x50bfb9[_0x125a('0x34')][_0x125a('0x1f')]);_0x4ed790[_0x125a('0x22')]=qs['offset'](_0x50bfb9['query'][_0x125a('0x22')]);}return _0x1a3ef2[_0x125a('0x8d')](_0x4ed790);}})[_0x125a('0x26')](function(_0x2a0370){if(_0x2a0370){return _0x2a0370?{'count':_0x5b0fd4,'rows':_0x2a0370}:null;}})[_0x125a('0x26')](respondWithResult(_0x61153,null))[_0x125a('0x49')](handleError(_0x61153,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index d6b4824..d8d9151 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 _0xf537=['FaxQueue','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x18b1a0,_0x5c9dca){var _0x479e9a=function(_0x16f156){while(--_0x16f156){_0x18b1a0['push'](_0x18b1a0['shift']());}};_0x479e9a(++_0x5c9dca);}(_0xf537,0xd8));var _0x7f53=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf537[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0x7f53('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x7f53('0x1')](0x0);var events={'afterCreate':_0x7f53('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x19e19c){return function(_0x233403,_0xbbf1d6,_0x2b442b){FaxQueueEvents[_0x7f53('0x3')](_0x19e19c+':'+_0x233403['id'],_0x233403);FaxQueueEvents[_0x7f53('0x3')](_0x19e19c,_0x233403);_0x2b442b(null);};}for(var e in events){if(events[_0x7f53('0x4')](e)){var event=events[e];FaxQueue[_0x7f53('0x5')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x7be9=['hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x7be9,0x1e6));var _0x97be=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x7be9[_0x307d86];return _0x361745;};'use strict';var EventEmitter=require(_0x97be('0x0'));var FaxQueue=require(_0x97be('0x1'))['db'][_0x97be('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x97be('0x3')](0x0);var events={'afterCreate':_0x97be('0x4'),'afterUpdate':_0x97be('0x5'),'afterDestroy':_0x97be('0x6')};function emitEvent(_0x1c66c6){return function(_0x5acbb8,_0x94523c,_0x4ae5e1){FaxQueueEvents['emit'](_0x1c66c6+':'+_0x5acbb8['id'],_0x5acbb8);FaxQueueEvents[_0x97be('0x7')](_0x1c66c6,_0x5acbb8);_0x4ae5e1(null);};}for(var e in events){if(events[_0x97be('0x8')](e)){var event=events[e];FaxQueue[_0x97be('0x9')](e,emitEvent(event));}}module[_0x97be('0xa')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 9446643..e82d44e 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 _0xd553=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','exports'];(function(_0x411b5e,_0x4710ba){var _0xe38727=function(_0xc67dfa){while(--_0xc67dfa){_0x411b5e['push'](_0x411b5e['shift']());}};_0xe38727(++_0x4710ba);}(_0xd553,0x170));var _0x3d55=function(_0x146be0,_0x39a85e){_0x146be0=_0x146be0-0x0;var _0x1bcc25=_0xd553[_0x146be0];return _0x1bcc25;};'use strict';var _=require(_0x3d55('0x0'));var util=require(_0x3d55('0x1'));var logger=require(_0x3d55('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3d55('0x3'));var rp=require(_0x3d55('0x4'));var fs=require('fs');var path=require(_0x3d55('0x5'));var rimraf=require(_0x3d55('0x6'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x3d55('0x7')]=function(_0x313665,_0x3319c8){return _0x313665['define']('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7976=['./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x38ae29,_0x4b342f){var _0x32fb71=function(_0x469b4e){while(--_0x469b4e){_0x38ae29['push'](_0x38ae29['shift']());}};_0x32fb71(++_0x4b342f);}(_0x7976,0x146));var _0x6797=function(_0x2baed5,_0x46ba32){_0x2baed5=_0x2baed5-0x0;var _0x47eb13=_0x7976[_0x2baed5];return _0x47eb13;};'use strict';var _=require(_0x6797('0x0'));var util=require(_0x6797('0x1'));var logger=require(_0x6797('0x2'))(_0x6797('0x3'));var moment=require(_0x6797('0x4'));var BPromise=require(_0x6797('0x5'));var rp=require(_0x6797('0x6'));var fs=require('fs');var path=require(_0x6797('0x7'));var rimraf=require(_0x6797('0x8'));var config=require(_0x6797('0x9'));var attributes=require(_0x6797('0xa'));module[_0x6797('0xb')]=function(_0x4757aa,_0x576736){return _0x4757aa[_0x6797('0xc')](_0x6797('0xd'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 2791d49..5ae06f7 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 _0xf586=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','request\x20sent','debug','stringify','error','FaxQueue,\x20%s,\x20%s','message','catch','findAll','options','raw','where','attributes','include','map','model','GetFaxQueue','ShowFaxQueue','FaxQueue','find','lodash','util','bluebird'];(function(_0x230639,_0x20f428){var _0x5248d7=function(_0x61b79b){while(--_0x61b79b){_0x230639['push'](_0x230639['shift']());}};_0x5248d7(++_0x20f428);}(_0xf586,0x72));var _0x6f58=function(_0x2586ad,_0x3a2816){_0x2586ad=_0x2586ad-0x0;var _0x4128db=_0xf586[_0x2586ad];return _0x4128db;};'use strict';var _=require(_0x6f58('0x0'));var util=require(_0x6f58('0x1'));var moment=require('moment');var BPromise=require(_0x6f58('0x2'));var rs=require(_0x6f58('0x3'));var fs=require('fs');var Redis=require(_0x6f58('0x4'));var db=require(_0x6f58('0x5'))['db'];var utils=require(_0x6f58('0x6'));var logger=require(_0x6f58('0x7'))('rpc');var config=require(_0x6f58('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6f58('0x9')][_0x6f58('0xa')]({'port':0x232a});config[_0x6f58('0xb')]=_[_0x6f58('0xc')](config[_0x6f58('0xb')],{'host':_0x6f58('0xd'),'port':0x18eb});var socket=require(_0x6f58('0xe'))(new Redis(config['redis']));require(_0x6f58('0xf'))[_0x6f58('0x10')](socket);function respondWithRpcPromise(_0x12027c,_0x40ffa9,_0x5e195a){return new BPromise(function(_0x3e692e,_0x5f4e2f){return client[_0x6f58('0x11')](_0x12027c,_0x5e195a)[_0x6f58('0x12')](function(_0x229dae){logger[_0x6f58('0x13')]('FaxQueue,\x20%s,\x20%s',_0x40ffa9,_0x6f58('0x14'));logger[_0x6f58('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x40ffa9,_0x6f58('0x14'),JSON[_0x6f58('0x16')](_0x229dae));if(_0x229dae['error']){if(_0x229dae[_0x6f58('0x17')]['code']===0x1f4){logger['error'](_0x6f58('0x18'),_0x40ffa9,_0x229dae[_0x6f58('0x17')][_0x6f58('0x19')]);return _0x5f4e2f(_0x229dae[_0x6f58('0x17')]['message']);}logger[_0x6f58('0x17')](_0x6f58('0x18'),_0x40ffa9,_0x229dae[_0x6f58('0x17')]['message']);return _0x3e692e(_0x229dae[_0x6f58('0x17')][_0x6f58('0x19')]);}else{logger[_0x6f58('0x13')](_0x6f58('0x18'),_0x40ffa9,_0x6f58('0x14'));_0x3e692e(_0x229dae['result'][_0x6f58('0x19')]);}})[_0x6f58('0x1a')](function(_0x57ec1b){logger[_0x6f58('0x17')](_0x6f58('0x18'),_0x40ffa9,_0x57ec1b);_0x5f4e2f(_0x57ec1b);});});}exports['GetFaxQueue']=function(_0x1937bf){var _0x5aebf1=this;return new Promise(function(_0x3a66d4,_0x5c2256){return db['FaxQueue'][_0x6f58('0x1b')]({'raw':_0x1937bf[_0x6f58('0x1c')]?_0x1937bf[_0x6f58('0x1c')][_0x6f58('0x1d')]===undefined?!![]:![]:!![],'where':_0x1937bf[_0x6f58('0x1c')]?_0x1937bf[_0x6f58('0x1c')][_0x6f58('0x1e')]||null:null,'attributes':_0x1937bf[_0x6f58('0x1c')]?_0x1937bf[_0x6f58('0x1c')][_0x6f58('0x1f')]||null:null,'limit':_0x1937bf[_0x6f58('0x1c')]?_0x1937bf[_0x6f58('0x1c')]['limit']||null:null,'include':_0x1937bf[_0x6f58('0x1c')]?_0x1937bf[_0x6f58('0x1c')][_0x6f58('0x20')]?_['map'](_0x1937bf[_0x6f58('0x1c')][_0x6f58('0x20')],function(_0xa56589){return{'model':db[_0xa56589['model']],'as':_0xa56589['as'],'attributes':_0xa56589['attributes'],'include':_0xa56589['include']?_[_0x6f58('0x21')](_0xa56589[_0x6f58('0x20')],function(_0xee7092){return{'model':db[_0xee7092['model']],'as':_0xee7092['as'],'attributes':_0xee7092[_0x6f58('0x1f')],'include':_0xee7092['include']?_[_0x6f58('0x21')](_0xee7092[_0x6f58('0x20')],function(_0x2e11af){return{'model':db[_0x2e11af[_0x6f58('0x22')]],'as':_0x2e11af['as'],'attributes':_0x2e11af[_0x6f58('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6f58('0x12')](function(_0xd90dfd){logger[_0x6f58('0x13')]('GetFaxQueue',_0x1937bf);logger[_0x6f58('0x15')](_0x6f58('0x23'),_0x1937bf,JSON[_0x6f58('0x16')](_0xd90dfd));_0x3a66d4(_0xd90dfd);})[_0x6f58('0x1a')](function(_0x20c78d){logger[_0x6f58('0x17')](_0x6f58('0x23'),_0x20c78d['message'],_0x1937bf);_0x5c2256(_0x5aebf1[_0x6f58('0x17')](0x1f4,_0x20c78d[_0x6f58('0x19')]));});});};exports[_0x6f58('0x24')]=function(_0x45dd3a){var _0x1ff63c=this;return new Promise(function(_0x50222b,_0x4c7c3f){return db[_0x6f58('0x25')][_0x6f58('0x26')]({'raw':_0x45dd3a[_0x6f58('0x1c')]?_0x45dd3a[_0x6f58('0x1c')][_0x6f58('0x1d')]===undefined?!![]:![]:!![],'where':_0x45dd3a[_0x6f58('0x1c')]?_0x45dd3a['options'][_0x6f58('0x1e')]||null:null,'attributes':_0x45dd3a[_0x6f58('0x1c')]?_0x45dd3a['options'][_0x6f58('0x1f')]||null:null,'include':_0x45dd3a[_0x6f58('0x1c')]?_0x45dd3a[_0x6f58('0x1c')]['include']?_[_0x6f58('0x21')](_0x45dd3a[_0x6f58('0x1c')][_0x6f58('0x20')],function(_0x3599a8){return{'model':db[_0x3599a8[_0x6f58('0x22')]],'as':_0x3599a8['as'],'attributes':_0x3599a8[_0x6f58('0x1f')],'include':_0x3599a8[_0x6f58('0x20')]?_[_0x6f58('0x21')](_0x3599a8[_0x6f58('0x20')],function(_0x40bf42){return{'model':db[_0x40bf42['model']],'as':_0x40bf42['as'],'attributes':_0x40bf42[_0x6f58('0x1f')],'include':_0x40bf42[_0x6f58('0x20')]?_[_0x6f58('0x21')](_0x40bf42[_0x6f58('0x20')],function(_0x2f547b){return{'model':db[_0x2f547b[_0x6f58('0x22')]],'as':_0x2f547b['as'],'attributes':_0x2f547b[_0x6f58('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6f58('0x12')](function(_0x205de5){logger['info'](_0x6f58('0x24'),_0x45dd3a);logger[_0x6f58('0x15')]('ShowFaxQueue',_0x45dd3a,JSON[_0x6f58('0x16')](_0x205de5));_0x50222b(_0x205de5);})[_0x6f58('0x1a')](function(_0x1fcc61){logger[_0x6f58('0x17')](_0x6f58('0x24'),_0x1fcc61[_0x6f58('0x19')],_0x45dd3a);_0x4c7c3f(_0x1ff63c[_0x6f58('0x17')](0x1f4,_0x1fcc61[_0x6f58('0x19')]));});});}; \ No newline at end of file +var _0x6224=['raw','where','limit','map','include','model','attributes','then','info','GetFaxQueue','catch','ShowFaxQueue','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','request','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueue','options'];(function(_0x30dd26,_0x530333){var _0x457a76=function(_0x26c392){while(--_0x26c392){_0x30dd26['push'](_0x30dd26['shift']());}};_0x457a76(++_0x530333);}(_0x6224,0x147));var _0x4622=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0x6224[_0x9a3e0f];return _0x3d2a9a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4622('0x0'));var BPromise=require(_0x4622('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4622('0x2'));var db=require(_0x4622('0x3'))['db'];var utils=require(_0x4622('0x4'));var logger=require('../../config/logger')(_0x4622('0x5'));var config=require(_0x4622('0x6'));var jayson=require(_0x4622('0x7'));var client=jayson[_0x4622('0x8')][_0x4622('0x9')]({'port':0x232a});config[_0x4622('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4622('0xb'))(new Redis(config[_0x4622('0xa')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3dd22d,_0x304a82,_0x1479f6){return new BPromise(function(_0x540002,_0x446d6e){return client[_0x4622('0xc')](_0x3dd22d,_0x1479f6)['then'](function(_0x51b02a){logger['info'](_0x4622('0xd'),_0x304a82,_0x4622('0xe'));logger[_0x4622('0xf')](_0x4622('0x10'),_0x304a82,_0x4622('0xe'),JSON[_0x4622('0x11')](_0x51b02a));if(_0x51b02a[_0x4622('0x12')]){if(_0x51b02a[_0x4622('0x12')][_0x4622('0x13')]===0x1f4){logger['error'](_0x4622('0xd'),_0x304a82,_0x51b02a['error'][_0x4622('0x14')]);return _0x446d6e(_0x51b02a[_0x4622('0x12')]['message']);}logger[_0x4622('0x12')]('FaxQueue,\x20%s,\x20%s',_0x304a82,_0x51b02a['error']['message']);return _0x540002(_0x51b02a['error'][_0x4622('0x14')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x304a82,'request\x20sent');_0x540002(_0x51b02a['result'][_0x4622('0x14')]);}})['catch'](function(_0x2a5103){logger[_0x4622('0x12')]('FaxQueue,\x20%s,\x20%s',_0x304a82,_0x2a5103);_0x446d6e(_0x2a5103);});});}exports['GetFaxQueue']=function(_0x3a7b71){var _0x4f31b2=this;return new Promise(function(_0x151ad4,_0x53ab97){return db[_0x4622('0x15')]['findAll']({'raw':_0x3a7b71['options']?_0x3a7b71[_0x4622('0x16')][_0x4622('0x17')]===undefined?!![]:![]:!![],'where':_0x3a7b71[_0x4622('0x16')]?_0x3a7b71[_0x4622('0x16')][_0x4622('0x18')]||null:null,'attributes':_0x3a7b71['options']?_0x3a7b71['options']['attributes']||null:null,'limit':_0x3a7b71['options']?_0x3a7b71['options'][_0x4622('0x19')]||null:null,'include':_0x3a7b71['options']?_0x3a7b71[_0x4622('0x16')]['include']?_[_0x4622('0x1a')](_0x3a7b71['options'][_0x4622('0x1b')],function(_0x5be711){return{'model':db[_0x5be711[_0x4622('0x1c')]],'as':_0x5be711['as'],'attributes':_0x5be711[_0x4622('0x1d')],'include':_0x5be711['include']?_['map'](_0x5be711[_0x4622('0x1b')],function(_0x236a12){return{'model':db[_0x236a12[_0x4622('0x1c')]],'as':_0x236a12['as'],'attributes':_0x236a12[_0x4622('0x1d')],'include':_0x236a12[_0x4622('0x1b')]?_[_0x4622('0x1a')](_0x236a12['include'],function(_0xa943f2){return{'model':db[_0xa943f2[_0x4622('0x1c')]],'as':_0xa943f2['as'],'attributes':_0xa943f2['attributes']};}):[]};}):[]};}):[]:[]})[_0x4622('0x1e')](function(_0x370f30){logger[_0x4622('0x1f')](_0x4622('0x20'),_0x3a7b71);logger['debug'](_0x4622('0x20'),_0x3a7b71,JSON[_0x4622('0x11')](_0x370f30));_0x151ad4(_0x370f30);})[_0x4622('0x21')](function(_0x3d40e4){logger[_0x4622('0x12')](_0x4622('0x20'),_0x3d40e4[_0x4622('0x14')],_0x3a7b71);_0x53ab97(_0x4f31b2[_0x4622('0x12')](0x1f4,_0x3d40e4['message']));});});};exports[_0x4622('0x22')]=function(_0x62db35){var _0x331c87=this;return new Promise(function(_0x2fcf41,_0x20c25d){return db[_0x4622('0x15')]['find']({'raw':_0x62db35['options']?_0x62db35['options'][_0x4622('0x17')]===undefined?!![]:![]:!![],'where':_0x62db35[_0x4622('0x16')]?_0x62db35[_0x4622('0x16')][_0x4622('0x18')]||null:null,'attributes':_0x62db35[_0x4622('0x16')]?_0x62db35[_0x4622('0x16')][_0x4622('0x1d')]||null:null,'include':_0x62db35[_0x4622('0x16')]?_0x62db35[_0x4622('0x16')][_0x4622('0x1b')]?_[_0x4622('0x1a')](_0x62db35[_0x4622('0x16')][_0x4622('0x1b')],function(_0x3a906b){return{'model':db[_0x3a906b[_0x4622('0x1c')]],'as':_0x3a906b['as'],'attributes':_0x3a906b['attributes'],'include':_0x3a906b[_0x4622('0x1b')]?_[_0x4622('0x1a')](_0x3a906b[_0x4622('0x1b')],function(_0x4bc317){return{'model':db[_0x4bc317[_0x4622('0x1c')]],'as':_0x4bc317['as'],'attributes':_0x4bc317[_0x4622('0x1d')],'include':_0x4bc317['include']?_[_0x4622('0x1a')](_0x4bc317[_0x4622('0x1b')],function(_0x4dcaae){return{'model':db[_0x4dcaae['model']],'as':_0x4dcaae['as'],'attributes':_0x4dcaae[_0x4622('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4622('0x1e')](function(_0x226ddd){logger[_0x4622('0x1f')]('ShowFaxQueue',_0x62db35);logger[_0x4622('0xf')](_0x4622('0x22'),_0x62db35,JSON[_0x4622('0x11')](_0x226ddd));_0x2fcf41(_0x226ddd);})['catch'](function(_0x48c6f0){logger[_0x4622('0x12')](_0x4622('0x22'),_0x48c6f0['message'],_0x62db35);_0x20c25d(_0x331c87['error'](0x1f4,_0x48c6f0[_0x4622('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 72e3169..4013b18 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 _0x314a=['update','emit','removeListener','length','./faxQueue.events','save','remove'];(function(_0x74d1f7,_0x4ed516){var _0x2cc0c7=function(_0x597220){while(--_0x597220){_0x74d1f7['push'](_0x74d1f7['shift']());}};_0x2cc0c7(++_0x4ed516);}(_0x314a,0xf9));var _0xa314=function(_0x348860,_0x4531f6){_0x348860=_0x348860-0x0;var _0x2fc2ad=_0x314a[_0x348860];return _0x2fc2ad;};'use strict';var FaxQueueEvents=require(_0xa314('0x0'));var events=[_0xa314('0x1'),_0xa314('0x2'),_0xa314('0x3')];function createListener(_0x9f404d,_0x1b0df4){return function(_0x263a7d){_0x1b0df4[_0xa314('0x4')](_0x9f404d,_0x263a7d);};}function removeListener(_0xdca8f5,_0x3f8165){return function(){FaxQueueEvents[_0xa314('0x5')](_0xdca8f5,_0x3f8165);};}exports['register']=function(_0x2e5f37){for(var _0x22425a=0x0,_0x1e0c6d=events[_0xa314('0x6')];_0x22425a<_0x1e0c6d;_0x22425a++){var _0x5ccae1=events[_0x22425a];var _0x494e11=createListener('faxQueue:'+_0x5ccae1,_0x2e5f37);FaxQueueEvents['on'](_0x5ccae1,_0x494e11);}}; \ No newline at end of file +var _0x29e0=['length','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x1a2b3f,_0x36d0ad){var _0xfc98e9=function(_0xa8daf3){while(--_0xa8daf3){_0x1a2b3f['push'](_0x1a2b3f['shift']());}};_0xfc98e9(++_0x36d0ad);}(_0x29e0,0x1c8));var _0x029e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e0[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0x029e('0x0'));var events=[_0x029e('0x1'),_0x029e('0x2'),_0x029e('0x3')];function createListener(_0xe65a,_0x2fcb94){return function(_0x43f715){_0x2fcb94[_0x029e('0x4')](_0xe65a,_0x43f715);};}function removeListener(_0x16358b,_0x37ce30){return function(){FaxQueueEvents[_0x029e('0x5')](_0x16358b,_0x37ce30);};}exports['register']=function(_0x5004ff){for(var _0x2db980=0x0,_0x3571ef=events[_0x029e('0x6')];_0x2db980<_0x3571ef;_0x2db980++){var _0x54cfb2=events[_0x2db980];var _0x21484b=createListener('faxQueue:'+_0x54cfb2,_0x5004ff);FaxQueueEvents['on'](_0x54cfb2,_0x21484b);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index cc43acc..36fb94d 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 _0xfc65=['/describe','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','update','destroy','delete','removeAgents','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index'];(function(_0x22fa64,_0x15c60d){var _0x3b1526=function(_0x194598){while(--_0x194598){_0x22fa64['push'](_0x22fa64['shift']());}};_0x3b1526(++_0x15c60d);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x19872d,_0x36afd3){_0x19872d=_0x19872d-0x0;var _0x512d55=_0xfc65[_0x19872d];return _0x512d55;};'use strict';var multer=require(_0x5fc6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5fc6('0x1'));var express=require(_0x5fc6('0x2'));var router=express[_0x5fc6('0x3')]();var fs_extra=require(_0x5fc6('0x4'));var auth=require(_0x5fc6('0x5'));var interaction=require(_0x5fc6('0x6'));var config=require(_0x5fc6('0x7'));var controller=require(_0x5fc6('0x8'));router[_0x5fc6('0x9')]('/',auth[_0x5fc6('0xa')](),controller[_0x5fc6('0xb')]);router[_0x5fc6('0x9')](_0x5fc6('0xc'),auth['isAuthenticated'](),controller[_0x5fc6('0xd')]);router[_0x5fc6('0x9')](_0x5fc6('0xe'),auth[_0x5fc6('0xa')](),controller[_0x5fc6('0xf')]);router[_0x5fc6('0x9')](_0x5fc6('0x10'),auth[_0x5fc6('0xa')](),controller[_0x5fc6('0x11')]);router[_0x5fc6('0x9')]('/:id/teams',auth[_0x5fc6('0xa')](),controller['getTeams']);router[_0x5fc6('0x9')](_0x5fc6('0x12'),auth[_0x5fc6('0xa')](),controller[_0x5fc6('0x13')]);router['post']('/',auth[_0x5fc6('0xa')](),controller[_0x5fc6('0x14')]);router[_0x5fc6('0x15')](_0x5fc6('0x16'),auth[_0x5fc6('0xa')](),controller[_0x5fc6('0x17')]);router[_0x5fc6('0x15')](_0x5fc6('0x12'),auth[_0x5fc6('0xa')](),controller[_0x5fc6('0x18')]);router['put']('/:id',auth[_0x5fc6('0xa')](),controller[_0x5fc6('0x19')]);router['delete'](_0x5fc6('0xe'),auth[_0x5fc6('0xa')](),controller[_0x5fc6('0x1a')]);router[_0x5fc6('0x1b')](_0x5fc6('0x16'),auth[_0x5fc6('0xa')](),controller['removeTeams']);router[_0x5fc6('0x1b')](_0x5fc6('0x12'),auth[_0x5fc6('0xa')](),controller[_0x5fc6('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x7b84=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','exports','multer','util','path','connect-timeout'];(function(_0x5401ae,_0x5e58ac){var _0x286068=function(_0x2cac88){while(--_0x2cac88){_0x5401ae['push'](_0x5401ae['shift']());}};_0x286068(++_0x5e58ac);}(_0x7b84,0x17c));var _0x47b8=function(_0x4e3d56,_0x1297ed){_0x4e3d56=_0x4e3d56-0x0;var _0x28838e=_0x7b84[_0x4e3d56];return _0x28838e;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var fs_extra=require(_0x47b8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var controller=require(_0x47b8('0x9'));router[_0x47b8('0xa')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0xc')]);router['get'](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xa')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x10')]);router[_0x47b8('0xa')](_0x47b8('0x11'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x12')]);router[_0x47b8('0xa')](_0x47b8('0x13'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x14')]);router[_0x47b8('0xa')](_0x47b8('0x15'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x16')]);router[_0x47b8('0x17')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0x18')]);router[_0x47b8('0x17')](_0x47b8('0x13'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x19')]);router[_0x47b8('0x17')]('/:id/users',auth[_0x47b8('0xb')](),controller[_0x47b8('0x1a')]);router[_0x47b8('0x1b')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x1c')]);router[_0x47b8('0x1d')]('/:id',auth[_0x47b8('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0x47b8('0xb')](),controller[_0x47b8('0x1e')]);router[_0x47b8('0x1d')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x47b8('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index e6e2ffb..c5db6b7 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 _0xbfe8=['sequelize','STRING','DATE'];(function(_0x976235,_0x538763){var _0x56b6c5=function(_0x662c07){while(--_0x662c07){_0x976235['push'](_0x976235['shift']());}};_0x56b6c5(++_0x538763);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x2df416,_0x697e61){_0x2df416=_0x2df416-0x0;var _0x3f12dd=_0xbfe8[_0x2df416];return _0x3f12dd;};'use strict';var moment=require('moment');var Sequelize=require(_0x8bfe('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x8bfe('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x8bfe('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8bfe('0x2')]},'exitAt':{'type':Sequelize[_0x8bfe('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3cd8=['DATE','moment','sequelize','exports','STRING'];(function(_0x3d13bb,_0x262a54){var _0x4b5a1b=function(_0x53417e){while(--_0x53417e){_0x3d13bb['push'](_0x3d13bb['shift']());}};_0x4b5a1b(++_0x262a54);}(_0x3cd8,0x150));var _0x83cd=function(_0x1e03e4,_0x362f76){_0x1e03e4=_0x1e03e4-0x0;var _0x4a887e=_0x3cd8[_0x1e03e4];return _0x4a887e;};'use strict';var moment=require(_0x83cd('0x0'));var Sequelize=require(_0x83cd('0x1'));module[_0x83cd('0x2')]={'uniqueid':{'type':Sequelize[_0x83cd('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x83cd('0x3')]},'joinAt':{'type':Sequelize[_0x83cd('0x4')]},'leaveAt':{'type':Sequelize[_0x83cd('0x4')]},'acceptAt':{'type':Sequelize[_0x83cd('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x83cd('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index bdf7186..adbc0f8 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 _0x7764=['params','options','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','then','end','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','FaxQueueReport','findAll','rows','catch','show'];(function(_0x271537,_0x8b7b3b){var _0x19dc22=function(_0x459bbf){while(--_0x459bbf){_0x271537['push'](_0x271537['shift']());}};_0x19dc22(++_0x8b7b3b);}(_0x7764,0xa4));var _0x4776=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0x7764[_0x3c6ae2];return _0x4edda;};'use strict';var emlformat=require(_0x4776('0x0'));var rimraf=require(_0x4776('0x1'));var zipdir=require(_0x4776('0x2'));var jsonpatch=require(_0x4776('0x3'));var rp=require(_0x4776('0x4'));var moment=require(_0x4776('0x5'));var BPromise=require(_0x4776('0x6'));var Mustache=require(_0x4776('0x7'));var util=require(_0x4776('0x8'));var path=require(_0x4776('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4776('0xa'));var fs=require('fs');var fs_extra=require(_0x4776('0xb'));var _=require('lodash');var squel=require(_0x4776('0xc'));var crypto=require(_0x4776('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4776('0xe'));var querystring=require('querystring');var Papa=require(_0x4776('0xf'));var Redis=require(_0x4776('0x10'));var authService=require(_0x4776('0x11'));var qs=require(_0x4776('0x12'));var as=require(_0x4776('0x13'));var hardwareService=require(_0x4776('0x14'));var logger=require(_0x4776('0x15'))(_0x4776('0x16'));var utils=require(_0x4776('0x17'));var config=require(_0x4776('0x18'));var licenseUtil=require(_0x4776('0x19'));var db=require(_0x4776('0x1a'))['db'];function respondWithStatusCode(_0x1c3363,_0x40e5df){_0x40e5df=_0x40e5df||0xcc;return function(_0x399e40){if(_0x399e40){return _0x1c3363[_0x4776('0x1b')](_0x40e5df);}return _0x1c3363['status'](_0x40e5df)['end']();};}function respondWithResult(_0x472e1b,_0x46429e){_0x46429e=_0x46429e||0xc8;return function(_0x193b42){if(_0x193b42){return _0x472e1b[_0x4776('0x1c')](_0x46429e)[_0x4776('0x1d')](_0x193b42);}};}function respondWithFilteredResult(_0x46e5ef,_0x1ac390){return function(_0x1389ed){if(_0x1389ed){var _0x2256c9=typeof _0x1ac390[_0x4776('0x1e')]==='undefined'&&typeof _0x1ac390[_0x4776('0x1f')]==='undefined';var _0x164474=_0x1389ed[_0x4776('0x20')];var _0x2366da=_0x2256c9?0x0:_0x1ac390[_0x4776('0x1e')];var _0xb5c938=_0x2256c9?_0x1389ed['count']:_0x1ac390[_0x4776('0x1e')]+_0x1ac390[_0x4776('0x1f')];var _0x486040;if(_0xb5c938>=_0x164474){_0xb5c938=_0x164474;_0x486040=0xc8;}else{_0x486040=0xce;}_0x46e5ef[_0x4776('0x1c')](_0x486040);return _0x46e5ef[_0x4776('0x21')](_0x4776('0x22'),_0x2366da+'-'+_0xb5c938+'/'+_0x164474)[_0x4776('0x1d')](_0x1389ed);}return null;};}function patchUpdates(_0x59b540){return function(_0x3e2aa4){try{jsonpatch[_0x4776('0x23')](_0x3e2aa4,_0x59b540,!![]);}catch(_0x40e7b9){return BPromise[_0x4776('0x24')](_0x40e7b9);}return _0x3e2aa4['save']();};}function saveUpdates(_0x105511,_0xaa89dc){return function(_0x32bd33){if(_0x32bd33){return _0x32bd33['update'](_0x105511)[_0x4776('0x25')](function(_0x20c40d){return _0x20c40d;});}return null;};}function removeEntity(_0x7b2012,_0x54f3de){return function(_0x4e0dd1){if(_0x4e0dd1){return _0x4e0dd1['destroy']()[_0x4776('0x25')](function(){_0x7b2012[_0x4776('0x1c')](0xcc)[_0x4776('0x26')]();});}};}function handleEntityNotFound(_0xdfe443,_0x399a4a){return function(_0x20e06a){if(!_0x20e06a){_0xdfe443[_0x4776('0x1b')](0x194);}return _0x20e06a;};}function handleError(_0x5e1dc2,_0x7a0bb8){_0x7a0bb8=_0x7a0bb8||0x1f4;return function(_0x1de3d1){logger['error'](_0x1de3d1[_0x4776('0x27')]);if(_0x1de3d1[_0x4776('0x28')]){delete _0x1de3d1['name'];}_0x5e1dc2[_0x4776('0x1c')](_0x7a0bb8)[_0x4776('0x29')](_0x1de3d1);};}exports[_0x4776('0x2a')]=function(_0x15da31,_0xd8b1e7){var _0x4f57f7={},_0x4bfd4b={},_0x3e65e1={'count':0x0,'rows':[]};var _0x3e7bd4=_[_0x4776('0x2b')](db['FaxQueueReport'][_0x4776('0x2c')],function(_0x51fbc6){return{'name':_0x51fbc6[_0x4776('0x2d')],'type':_0x51fbc6['type'][_0x4776('0x2e')]};});_0x4bfd4b['model']=_[_0x4776('0x2b')](_0x3e7bd4,_0x4776('0x28'));_0x4bfd4b[_0x4776('0x2f')]=_[_0x4776('0x30')](_0x15da31['query']);_0x4bfd4b[_0x4776('0x31')]=_[_0x4776('0x32')](_0x4bfd4b[_0x4776('0x33')],_0x4bfd4b[_0x4776('0x2f')]);_0x4f57f7[_0x4776('0x34')]=_[_0x4776('0x32')](_0x4bfd4b[_0x4776('0x33')],qs['fields'](_0x15da31[_0x4776('0x2f')][_0x4776('0x35')]));_0x4f57f7[_0x4776('0x34')]=_0x4f57f7[_0x4776('0x34')][_0x4776('0x36')]?_0x4f57f7[_0x4776('0x34')]:_0x4bfd4b[_0x4776('0x33')];if(!_0x15da31[_0x4776('0x2f')]['hasOwnProperty'](_0x4776('0x37'))){_0x4f57f7['limit']=qs[_0x4776('0x1f')](_0x15da31[_0x4776('0x2f')][_0x4776('0x1f')]);_0x4f57f7[_0x4776('0x1e')]=qs['offset'](_0x15da31['query'][_0x4776('0x1e')]);}_0x4f57f7[_0x4776('0x38')]=qs['sort'](_0x15da31[_0x4776('0x2f')][_0x4776('0x39')]);_0x4f57f7['where']=qs['filters'](_[_0x4776('0x3a')](_0x15da31[_0x4776('0x2f')],_0x4bfd4b[_0x4776('0x31')]),_0x3e7bd4);if(_0x15da31[_0x4776('0x2f')][_0x4776('0x3b')]){_0x4f57f7[_0x4776('0x3c')]=_[_0x4776('0x3d')](_0x4f57f7['where'],{'$or':_[_0x4776('0x2b')](_0x3e7bd4,function(_0x4ab7af){if(_0x4ab7af[_0x4776('0x3e')]!==_0x4776('0x3f')){var _0x3b48ee={};_0x3b48ee[_0x4ab7af[_0x4776('0x28')]]={'$like':'%'+_0x15da31[_0x4776('0x2f')][_0x4776('0x3b')]+'%'};return _0x3b48ee;}})});}_0x4f57f7=_[_0x4776('0x3d')]({},_0x4f57f7,_0x15da31['options']);var _0xd95447={'where':_0x4f57f7[_0x4776('0x3c')]};return db['FaxQueueReport'][_0x4776('0x20')](_0xd95447)['then'](function(_0x3046a9){_0x3e65e1['count']=_0x3046a9;if(_0x15da31[_0x4776('0x2f')][_0x4776('0x40')]){_0x4f57f7['include']=[{'all':!![]}];}return db[_0x4776('0x41')][_0x4776('0x42')](_0x4f57f7);})[_0x4776('0x25')](function(_0x4f4c44){_0x3e65e1[_0x4776('0x43')]=_0x4f4c44;return _0x3e65e1;})[_0x4776('0x25')](respondWithFilteredResult(_0xd8b1e7,_0x4f57f7))[_0x4776('0x44')](handleError(_0xd8b1e7,null));};exports[_0x4776('0x45')]=function(_0x43090c,_0x30afa7){var _0x351195={'raw':!![],'where':{'id':_0x43090c[_0x4776('0x46')]['id']}},_0x27f762={};_0x27f762['model']=_[_0x4776('0x30')](db[_0x4776('0x41')]['rawAttributes']);_0x27f762[_0x4776('0x2f')]=_['keys'](_0x43090c['query']);_0x27f762[_0x4776('0x31')]=_['intersection'](_0x27f762[_0x4776('0x33')],_0x27f762[_0x4776('0x2f')]);_0x351195[_0x4776('0x34')]=_['intersection'](_0x27f762[_0x4776('0x33')],qs[_0x4776('0x35')](_0x43090c[_0x4776('0x2f')][_0x4776('0x35')]));_0x351195[_0x4776('0x34')]=_0x351195[_0x4776('0x34')][_0x4776('0x36')]?_0x351195[_0x4776('0x34')]:_0x27f762[_0x4776('0x33')];if(_0x43090c[_0x4776('0x2f')][_0x4776('0x40')]){_0x351195['include']=[{'all':!![]}];}_0x351195=_[_0x4776('0x3d')]({},_0x351195,_0x43090c[_0x4776('0x47')]);return db[_0x4776('0x41')][_0x4776('0x48')](_0x351195)['then'](handleEntityNotFound(_0x30afa7,null))['then'](respondWithResult(_0x30afa7,null))[_0x4776('0x44')](handleError(_0x30afa7,null));};exports[_0x4776('0x49')]=function(_0x2645a7,_0x2d2ef0){return db[_0x4776('0x41')][_0x4776('0x49')](_0x2645a7[_0x4776('0x4a')],{})[_0x4776('0x25')](respondWithResult(_0x2d2ef0,0xc9))['catch'](handleError(_0x2d2ef0,null));};exports[_0x4776('0x4b')]=function(_0x389597,_0x287a82){if(_0x389597[_0x4776('0x4a')]['id']){delete _0x389597[_0x4776('0x4a')]['id'];}return db[_0x4776('0x41')][_0x4776('0x48')]({'where':{'id':_0x389597[_0x4776('0x46')]['id']}})['then'](handleEntityNotFound(_0x287a82,null))['then'](saveUpdates(_0x389597[_0x4776('0x4a')],null))['then'](respondWithResult(_0x287a82,null))[_0x4776('0x44')](handleError(_0x287a82,null));};exports[_0x4776('0x4c')]=function(_0x1dd814,_0x20b119){return db[_0x4776('0x41')][_0x4776('0x48')]({'where':{'id':_0x1dd814['params']['id']}})[_0x4776('0x25')](handleEntityNotFound(_0x20b119,null))['then'](removeEntity(_0x20b119,null))[_0x4776('0x44')](handleError(_0x20b119,null));};exports['describe']=function(_0x268e68,_0x52d54c){return db[_0x4776('0x41')][_0x4776('0x4d')]()[_0x4776('0x25')](respondWithResult(_0x52d54c,null))['catch'](handleError(_0x52d54c,null));}; \ No newline at end of file +var _0xc30d=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','update','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','FaxQueueReport','rawAttributes'];(function(_0x2b59c9,_0x1bdf51){var _0x43380c=function(_0x5d4988){while(--_0x5d4988){_0x2b59c9['push'](_0x2b59c9['shift']());}};_0x43380c(++_0x1bdf51);}(_0xc30d,0x6e));var _0xdc30=function(_0x4456a2,_0x376ff2){_0x4456a2=_0x4456a2-0x0;var _0xf36b56=_0xc30d[_0x4456a2];return _0xf36b56;};'use strict';var emlformat=require(_0xdc30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdc30('0x1'));var jsonpatch=require(_0xdc30('0x2'));var rp=require(_0xdc30('0x3'));var moment=require(_0xdc30('0x4'));var BPromise=require(_0xdc30('0x5'));var Mustache=require('mustache');var util=require(_0xdc30('0x6'));var path=require('path');var sox=require(_0xdc30('0x7'));var csv=require(_0xdc30('0x8'));var ejs=require(_0xdc30('0x9'));var fs=require('fs');var fs_extra=require(_0xdc30('0xa'));var _=require(_0xdc30('0xb'));var squel=require(_0xdc30('0xc'));var crypto=require('crypto');var jsforce=require(_0xdc30('0xd'));var deskjs=require(_0xdc30('0xe'));var toCsv=require(_0xdc30('0x8'));var querystring=require(_0xdc30('0xf'));var Papa=require(_0xdc30('0x10'));var Redis=require(_0xdc30('0x11'));var authService=require(_0xdc30('0x12'));var qs=require(_0xdc30('0x13'));var as=require(_0xdc30('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdc30('0x15'));var config=require(_0xdc30('0x16'));var licenseUtil=require(_0xdc30('0x17'));var db=require(_0xdc30('0x18'))['db'];function respondWithStatusCode(_0x4659ab,_0x1241f2){_0x1241f2=_0x1241f2||0xcc;return function(_0x7e4e17){if(_0x7e4e17){return _0x4659ab['sendStatus'](_0x1241f2);}return _0x4659ab[_0xdc30('0x19')](_0x1241f2)[_0xdc30('0x1a')]();};}function respondWithResult(_0x2220e3,_0x502425){_0x502425=_0x502425||0xc8;return function(_0x5a9e68){if(_0x5a9e68){return _0x2220e3[_0xdc30('0x19')](_0x502425)[_0xdc30('0x1b')](_0x5a9e68);}};}function respondWithFilteredResult(_0x3620e9,_0x553b45){return function(_0x21e3f1){if(_0x21e3f1){var _0x160404=typeof _0x553b45[_0xdc30('0x1c')]===_0xdc30('0x1d')&&typeof _0x553b45[_0xdc30('0x1e')]===_0xdc30('0x1d');var _0x37d9bb=_0x21e3f1['count'];var _0x3eff2c=_0x160404?0x0:_0x553b45[_0xdc30('0x1c')];var _0x57a868=_0x160404?_0x21e3f1['count']:_0x553b45[_0xdc30('0x1c')]+_0x553b45[_0xdc30('0x1e')];var _0x28336e;if(_0x57a868>=_0x37d9bb){_0x57a868=_0x37d9bb;_0x28336e=0xc8;}else{_0x28336e=0xce;}_0x3620e9[_0xdc30('0x19')](_0x28336e);return _0x3620e9[_0xdc30('0x1f')](_0xdc30('0x20'),_0x3eff2c+'-'+_0x57a868+'/'+_0x37d9bb)[_0xdc30('0x1b')](_0x21e3f1);}return null;};}function patchUpdates(_0x8dd720){return function(_0x38f237){try{jsonpatch[_0xdc30('0x21')](_0x38f237,_0x8dd720,!![]);}catch(_0x385e08){return BPromise[_0xdc30('0x22')](_0x385e08);}return _0x38f237[_0xdc30('0x23')]();};}function saveUpdates(_0x274d9a,_0x3e7893){return function(_0x453b55){if(_0x453b55){return _0x453b55['update'](_0x274d9a)[_0xdc30('0x24')](function(_0x4ecc39){return _0x4ecc39;});}return null;};}function removeEntity(_0x4ee4be,_0x2bde2e){return function(_0x2f7a75){if(_0x2f7a75){return _0x2f7a75[_0xdc30('0x25')]()['then'](function(){_0x4ee4be[_0xdc30('0x19')](0xcc)[_0xdc30('0x1a')]();});}};}function handleEntityNotFound(_0x4fdafc,_0x21d199){return function(_0x4dc9f8){if(!_0x4dc9f8){_0x4fdafc[_0xdc30('0x26')](0x194);}return _0x4dc9f8;};}function handleError(_0x4c0725,_0x2c1af3){_0x2c1af3=_0x2c1af3||0x1f4;return function(_0x16ee63){logger[_0xdc30('0x27')](_0x16ee63['stack']);if(_0x16ee63['name']){delete _0x16ee63[_0xdc30('0x28')];}_0x4c0725['status'](_0x2c1af3)[_0xdc30('0x29')](_0x16ee63);};}exports[_0xdc30('0x2a')]=function(_0x457574,_0x373ad7){var _0x1f4553={},_0x2c309e={},_0x50fa33={'count':0x0,'rows':[]};var _0x2b29c6=_[_0xdc30('0x2b')](db[_0xdc30('0x2c')][_0xdc30('0x2d')],function(_0x26a250){return{'name':_0x26a250['fieldName'],'type':_0x26a250[_0xdc30('0x2e')][_0xdc30('0x2f')]};});_0x2c309e[_0xdc30('0x30')]=_[_0xdc30('0x2b')](_0x2b29c6,'name');_0x2c309e[_0xdc30('0x31')]=_[_0xdc30('0x32')](_0x457574[_0xdc30('0x31')]);_0x2c309e[_0xdc30('0x33')]=_[_0xdc30('0x34')](_0x2c309e[_0xdc30('0x30')],_0x2c309e[_0xdc30('0x31')]);_0x1f4553[_0xdc30('0x35')]=_[_0xdc30('0x34')](_0x2c309e[_0xdc30('0x30')],qs['fields'](_0x457574[_0xdc30('0x31')][_0xdc30('0x36')]));_0x1f4553[_0xdc30('0x35')]=_0x1f4553[_0xdc30('0x35')][_0xdc30('0x37')]?_0x1f4553['attributes']:_0x2c309e[_0xdc30('0x30')];if(!_0x457574[_0xdc30('0x31')][_0xdc30('0x38')](_0xdc30('0x39'))){_0x1f4553[_0xdc30('0x1e')]=qs[_0xdc30('0x1e')](_0x457574[_0xdc30('0x31')][_0xdc30('0x1e')]);_0x1f4553[_0xdc30('0x1c')]=qs['offset'](_0x457574[_0xdc30('0x31')][_0xdc30('0x1c')]);}_0x1f4553[_0xdc30('0x3a')]=qs[_0xdc30('0x3b')](_0x457574[_0xdc30('0x31')][_0xdc30('0x3b')]);_0x1f4553[_0xdc30('0x3c')]=qs[_0xdc30('0x33')](_[_0xdc30('0x3d')](_0x457574[_0xdc30('0x31')],_0x2c309e[_0xdc30('0x33')]),_0x2b29c6);if(_0x457574[_0xdc30('0x31')][_0xdc30('0x3e')]){_0x1f4553[_0xdc30('0x3c')]=_[_0xdc30('0x3f')](_0x1f4553[_0xdc30('0x3c')],{'$or':_[_0xdc30('0x2b')](_0x2b29c6,function(_0x58ec72){if(_0x58ec72[_0xdc30('0x2e')]!==_0xdc30('0x40')){var _0x5b729d={};_0x5b729d[_0x58ec72[_0xdc30('0x28')]]={'$like':'%'+_0x457574[_0xdc30('0x31')][_0xdc30('0x3e')]+'%'};return _0x5b729d;}})});}_0x1f4553=_[_0xdc30('0x3f')]({},_0x1f4553,_0x457574[_0xdc30('0x41')]);var _0x1d42af={'where':_0x1f4553['where']};return db[_0xdc30('0x2c')]['count'](_0x1d42af)[_0xdc30('0x24')](function(_0x231a19){_0x50fa33['count']=_0x231a19;if(_0x457574[_0xdc30('0x31')][_0xdc30('0x42')]){_0x1f4553[_0xdc30('0x43')]=[{'all':!![]}];}return db[_0xdc30('0x2c')][_0xdc30('0x44')](_0x1f4553);})[_0xdc30('0x24')](function(_0x4315cd){_0x50fa33[_0xdc30('0x45')]=_0x4315cd;return _0x50fa33;})[_0xdc30('0x24')](respondWithFilteredResult(_0x373ad7,_0x1f4553))[_0xdc30('0x46')](handleError(_0x373ad7,null));};exports[_0xdc30('0x47')]=function(_0x5eee5b,_0x36990f){var _0x57017d={'raw':!![],'where':{'id':_0x5eee5b['params']['id']}},_0x3bcf03={};_0x3bcf03[_0xdc30('0x30')]=_[_0xdc30('0x32')](db[_0xdc30('0x2c')]['rawAttributes']);_0x3bcf03[_0xdc30('0x31')]=_[_0xdc30('0x32')](_0x5eee5b['query']);_0x3bcf03[_0xdc30('0x33')]=_[_0xdc30('0x34')](_0x3bcf03[_0xdc30('0x30')],_0x3bcf03[_0xdc30('0x31')]);_0x57017d['attributes']=_[_0xdc30('0x34')](_0x3bcf03[_0xdc30('0x30')],qs[_0xdc30('0x36')](_0x5eee5b[_0xdc30('0x31')][_0xdc30('0x36')]));_0x57017d[_0xdc30('0x35')]=_0x57017d[_0xdc30('0x35')][_0xdc30('0x37')]?_0x57017d[_0xdc30('0x35')]:_0x3bcf03[_0xdc30('0x30')];if(_0x5eee5b[_0xdc30('0x31')][_0xdc30('0x42')]){_0x57017d[_0xdc30('0x43')]=[{'all':!![]}];}_0x57017d=_[_0xdc30('0x3f')]({},_0x57017d,_0x5eee5b['options']);return db['FaxQueueReport'][_0xdc30('0x48')](_0x57017d)[_0xdc30('0x24')](handleEntityNotFound(_0x36990f,null))[_0xdc30('0x24')](respondWithResult(_0x36990f,null))[_0xdc30('0x46')](handleError(_0x36990f,null));};exports[_0xdc30('0x49')]=function(_0x416277,_0x1b6c0b){return db[_0xdc30('0x2c')][_0xdc30('0x49')](_0x416277['body'],{})[_0xdc30('0x24')](respondWithResult(_0x1b6c0b,0xc9))['catch'](handleError(_0x1b6c0b,null));};exports[_0xdc30('0x4a')]=function(_0x5036b2,_0x4afdcf){if(_0x5036b2['body']['id']){delete _0x5036b2[_0xdc30('0x4b')]['id'];}return db[_0xdc30('0x2c')][_0xdc30('0x48')]({'where':{'id':_0x5036b2[_0xdc30('0x4c')]['id']}})[_0xdc30('0x24')](handleEntityNotFound(_0x4afdcf,null))[_0xdc30('0x24')](saveUpdates(_0x5036b2[_0xdc30('0x4b')],null))[_0xdc30('0x24')](respondWithResult(_0x4afdcf,null))[_0xdc30('0x46')](handleError(_0x4afdcf,null));};exports[_0xdc30('0x25')]=function(_0x2282ea,_0x169f1c){return db[_0xdc30('0x2c')]['find']({'where':{'id':_0x2282ea['params']['id']}})[_0xdc30('0x24')](handleEntityNotFound(_0x169f1c,null))[_0xdc30('0x24')](removeEntity(_0x169f1c,null))[_0xdc30('0x46')](handleError(_0x169f1c,null));};exports[_0xdc30('0x4d')]=function(_0x254182,_0x33f4cb){return db[_0xdc30('0x2c')][_0xdc30('0x4d')]()[_0xdc30('0x24')](respondWithResult(_0x33f4cb,null))[_0xdc30('0x46')](handleError(_0x33f4cb,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 3c84f97..6203739 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x1f28be,_0x4b1278){var _0xa46c4c=function(_0x315b39){while(--_0x315b39){_0x1f28be['push'](_0x1f28be['shift']());}};_0xa46c4c(++_0x4b1278);}(_0x326f,0xd1));var _0xf326=function(_0x2a9b47,_0x54d688){_0x2a9b47=_0x2a9b47-0x0;var _0x2e8272=_0x326f[_0x2a9b47];return _0x2e8272;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x32500f,_0x9f4934){var _0x5f4130=function(_0x5aa6d7){while(--_0x5aa6d7){_0x32500f['push'](_0x32500f['shift']());}};_0x5f4130(++_0x9f4934);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x9d39e9,_0x3aebc9){_0x9d39e9=_0x9d39e9-0x0;var _0x4ac75b=_0x7fbe[_0x9d39e9];return _0x4ac75b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('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 65c6b81..8cf39c9 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 _0xf219=['then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','catch','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x37644a,_0x1a223a){var _0x48c516=function(_0x1fa32c){while(--_0x1fa32c){_0x37644a['push'](_0x37644a['shift']());}};_0x48c516(++_0x1a223a);}(_0xf219,0x9a));var _0x9f21=function(_0x10f060,_0x312a7b){_0x10f060=_0x10f060-0x0;var _0x512722=_0xf219[_0x10f060];return _0x512722;};'use strict';var _=require(_0x9f21('0x0'));var util=require(_0x9f21('0x1'));var moment=require('moment');var BPromise=require(_0x9f21('0x2'));var rs=require(_0x9f21('0x3'));var fs=require('fs');var Redis=require(_0x9f21('0x4'));var db=require(_0x9f21('0x5'))['db'];var utils=require(_0x9f21('0x6'));var logger=require('../../config/logger')(_0x9f21('0x7'));var config=require(_0x9f21('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9f21('0x9')][_0x9f21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xaebc2b,_0x331679,_0x1ba9db){return new BPromise(function(_0x2cb78b,_0x4d2f1c){return client['request'](_0xaebc2b,_0x1ba9db)[_0x9f21('0xb')](function(_0x40cd1c){logger[_0x9f21('0xc')](_0x9f21('0xd'),_0x331679,_0x9f21('0xe'));logger[_0x9f21('0xf')](_0x9f21('0x10'),_0x331679,_0x9f21('0xe'),JSON[_0x9f21('0x11')](_0x40cd1c));if(_0x40cd1c[_0x9f21('0x12')]){if(_0x40cd1c[_0x9f21('0x12')][_0x9f21('0x13')]===0x1f4){logger[_0x9f21('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x331679,_0x40cd1c['error'][_0x9f21('0x14')]);return _0x4d2f1c(_0x40cd1c['error'][_0x9f21('0x14')]);}logger[_0x9f21('0x12')](_0x9f21('0xd'),_0x331679,_0x40cd1c[_0x9f21('0x12')][_0x9f21('0x14')]);return _0x2cb78b(_0x40cd1c[_0x9f21('0x12')][_0x9f21('0x14')]);}else{logger[_0x9f21('0xc')](_0x9f21('0xd'),_0x331679,_0x9f21('0xe'));_0x2cb78b(_0x40cd1c[_0x9f21('0x15')][_0x9f21('0x14')]);}})['catch'](function(_0x4e1efb){logger[_0x9f21('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x331679,_0x4e1efb);_0x4d2f1c(_0x4e1efb);});});}exports[_0x9f21('0x16')]=function(_0x52e814){var _0x34a152=this;return new Promise(function(_0x10e9ac,_0x2903e4){return db[_0x9f21('0x17')][_0x9f21('0x18')](_0x52e814[_0x9f21('0x19')],{'raw':_0x52e814[_0x9f21('0x1a')]?_0x52e814[_0x9f21('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4139cc){logger[_0x9f21('0xc')](_0x9f21('0x16'),_0x52e814);logger['debug']('CreateFaxQueueReport',_0x52e814,JSON['stringify'](_0x4139cc));_0x10e9ac(_0x4139cc);})[_0x9f21('0x1b')](function(_0x1c7563){logger[_0x9f21('0x12')]('CreateFaxQueueReport',_0x1c7563[_0x9f21('0x14')],_0x52e814);_0x2903e4(_0x34a152[_0x9f21('0x12')](0x1f4,_0x1c7563[_0x9f21('0x14')]));});});};exports[_0x9f21('0x1c')]=function(_0x6ff615){var _0x4e10a=this;return new Promise(function(_0x392108,_0x15e3c7){return db[_0x9f21('0x17')][_0x9f21('0x1d')](_0x6ff615[_0x9f21('0x19')],{'raw':_0x6ff615[_0x9f21('0x1a')]?_0x6ff615['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6ff615['options']?_0x6ff615[_0x9f21('0x1a')][_0x9f21('0x1e')]||null:null,'attributes':_0x6ff615[_0x9f21('0x1a')]?_0x6ff615[_0x9f21('0x1a')][_0x9f21('0x1f')]||null:null,'limit':_0x6ff615[_0x9f21('0x1a')]?_0x6ff615[_0x9f21('0x1a')][_0x9f21('0x20')]||null:null})[_0x9f21('0xb')](function(_0x3e8392){logger['info']('UpdateFaxQueueReport',_0x6ff615);logger[_0x9f21('0xf')]('UpdateFaxQueueReport',_0x6ff615,JSON[_0x9f21('0x11')](_0x3e8392));_0x392108(_0x3e8392);})[_0x9f21('0x1b')](function(_0x7eeb8c){logger[_0x9f21('0x12')]('UpdateFaxQueueReport',_0x7eeb8c['message'],_0x6ff615);_0x15e3c7(_0x4e10a[_0x9f21('0x12')](0x1f4,_0x7eeb8c['message']));});});}; \ No newline at end of file +var _0x85d6=['rpc','../../config/environment','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','body','options','raw','then','catch','UpdateFaxQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x85d6,0x108));var _0x685d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85d6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x685d('0x0'));var util=require(_0x685d('0x1'));var moment=require(_0x685d('0x2'));var BPromise=require(_0x685d('0x3'));var rs=require(_0x685d('0x4'));var fs=require('fs');var Redis=require(_0x685d('0x5'));var db=require(_0x685d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x685d('0x7'))(_0x685d('0x8'));var config=require(_0x685d('0x9'));var jayson=require(_0x685d('0xa'));var client=jayson[_0x685d('0xb')][_0x685d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x395a70,_0x2cb27b,_0x1f9ea7){return new BPromise(function(_0x8d9d3d,_0x4229b5){return client[_0x685d('0xd')](_0x395a70,_0x1f9ea7)['then'](function(_0x13e22b){logger[_0x685d('0xe')](_0x685d('0xf'),_0x2cb27b,'request\x20sent');logger[_0x685d('0x10')](_0x685d('0x11'),_0x2cb27b,'request\x20sent',JSON[_0x685d('0x12')](_0x13e22b));if(_0x13e22b['error']){if(_0x13e22b[_0x685d('0x13')][_0x685d('0x14')]===0x1f4){logger['error'](_0x685d('0xf'),_0x2cb27b,_0x13e22b[_0x685d('0x13')][_0x685d('0x15')]);return _0x4229b5(_0x13e22b[_0x685d('0x13')][_0x685d('0x15')]);}logger[_0x685d('0x13')](_0x685d('0xf'),_0x2cb27b,_0x13e22b[_0x685d('0x13')][_0x685d('0x15')]);return _0x8d9d3d(_0x13e22b[_0x685d('0x13')]['message']);}else{logger[_0x685d('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x2cb27b,'request\x20sent');_0x8d9d3d(_0x13e22b[_0x685d('0x16')][_0x685d('0x15')]);}})['catch'](function(_0x64eb0d){logger['error'](_0x685d('0xf'),_0x2cb27b,_0x64eb0d);_0x4229b5(_0x64eb0d);});});}exports[_0x685d('0x17')]=function(_0x4f8ea5){var _0x6b3b80=this;return new Promise(function(_0x4949aa,_0x4b2109){return db[_0x685d('0x18')]['create'](_0x4f8ea5[_0x685d('0x19')],{'raw':_0x4f8ea5[_0x685d('0x1a')]?_0x4f8ea5[_0x685d('0x1a')][_0x685d('0x1b')]===undefined?!![]:![]:!![]})[_0x685d('0x1c')](function(_0x45340d){logger[_0x685d('0xe')]('CreateFaxQueueReport',_0x4f8ea5);logger['debug']('CreateFaxQueueReport',_0x4f8ea5,JSON['stringify'](_0x45340d));_0x4949aa(_0x45340d);})[_0x685d('0x1d')](function(_0x10f398){logger[_0x685d('0x13')](_0x685d('0x17'),_0x10f398[_0x685d('0x15')],_0x4f8ea5);_0x4b2109(_0x6b3b80[_0x685d('0x13')](0x1f4,_0x10f398['message']));});});};exports[_0x685d('0x1e')]=function(_0x456e52){var _0x47f389=this;return new Promise(function(_0x2fd836,_0x4c392e){return db[_0x685d('0x18')][_0x685d('0x1f')](_0x456e52[_0x685d('0x19')],{'raw':_0x456e52['options']?_0x456e52[_0x685d('0x1a')][_0x685d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x456e52['options']?_0x456e52[_0x685d('0x1a')][_0x685d('0x20')]||null:null,'attributes':_0x456e52[_0x685d('0x1a')]?_0x456e52[_0x685d('0x1a')][_0x685d('0x21')]||null:null,'limit':_0x456e52[_0x685d('0x1a')]?_0x456e52[_0x685d('0x1a')]['limit']||null:null})[_0x685d('0x1c')](function(_0x4aa8f4){logger[_0x685d('0xe')]('UpdateFaxQueueReport',_0x456e52);logger[_0x685d('0x10')](_0x685d('0x1e'),_0x456e52,JSON[_0x685d('0x12')](_0x4aa8f4));_0x2fd836(_0x4aa8f4);})['catch'](function(_0x2e749d){logger[_0x685d('0x13')](_0x685d('0x1e'),_0x2e749d[_0x685d('0x15')],_0x456e52);_0x4c392e(_0x47f389[_0x685d('0x13')](0x1f4,_0x2e749d['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 9c31211..f7f099e 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 _0x5964=['destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete'];(function(_0x3a4039,_0x5d0402){var _0x56de81=function(_0x52f51c){while(--_0x52f51c){_0x3a4039['push'](_0x3a4039['shift']());}};_0x56de81(++_0x5d0402);}(_0x5964,0x1a3));var _0x4596=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x5964[_0x22b8a3];return _0x199a0c;};'use strict';var multer=require(_0x4596('0x0'));var util=require(_0x4596('0x1'));var path=require('path');var timeout=require(_0x4596('0x2'));var express=require(_0x4596('0x3'));var router=express[_0x4596('0x4')]();var fs_extra=require(_0x4596('0x5'));var auth=require(_0x4596('0x6'));var interaction=require(_0x4596('0x7'));var config=require(_0x4596('0x8'));var controller=require(_0x4596('0x9'));router[_0x4596('0xa')]('/',auth['isAuthenticated'](),controller[_0x4596('0xb')]);router['get'](_0x4596('0xc'),auth[_0x4596('0xd')](),controller[_0x4596('0xe')]);router[_0x4596('0xa')]('/:id',auth[_0x4596('0xd')](),controller['show']);router[_0x4596('0xf')]('/',auth[_0x4596('0xd')](),controller[_0x4596('0x10')]);router[_0x4596('0x11')](_0x4596('0x12'),auth[_0x4596('0xd')](),controller[_0x4596('0x13')]);router[_0x4596('0x14')](_0x4596('0x12'),auth[_0x4596('0xd')](),controller[_0x4596('0x15')]);module['exports']=router; \ No newline at end of file +var _0x8d24=['fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','/:id','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x5cf6a6,_0x4a96f2){var _0x33346f=function(_0x4265ac){while(--_0x4265ac){_0x5cf6a6['push'](_0x5cf6a6['shift']());}};_0x33346f(++_0x4a96f2);}(_0x8d24,0x11b));var _0x48d2=function(_0x4e221e,_0x22329a){_0x4e221e=_0x4e221e-0x0;var _0x2297eb=_0x8d24[_0x4e221e];return _0x2297eb;};'use strict';var multer=require(_0x48d2('0x0'));var util=require('util');var path=require(_0x48d2('0x1'));var timeout=require(_0x48d2('0x2'));var express=require(_0x48d2('0x3'));var router=express[_0x48d2('0x4')]();var fs_extra=require(_0x48d2('0x5'));var auth=require(_0x48d2('0x6'));var interaction=require(_0x48d2('0x7'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x48d2('0x8')](),controller['index']);router[_0x48d2('0x9')](_0x48d2('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x48d2('0x9')](_0x48d2('0xb'),auth[_0x48d2('0x8')](),controller['show']);router[_0x48d2('0xc')]('/',auth[_0x48d2('0x8')](),controller[_0x48d2('0xd')]);router[_0x48d2('0xe')](_0x48d2('0xb'),auth['isAuthenticated'](),controller[_0x48d2('0xf')]);router[_0x48d2('0x10')](_0x48d2('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x48d2('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 9f1229b..ff9c0e3 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x592d48,_0x23f1ba){var _0x5d789e=function(_0x156900){while(--_0x156900){_0x592d48['push'](_0x592d48['shift']());}};_0x5d789e(++_0x23f1ba);}(_0x9bde,0xe1));var _0xe9bd=function(_0x32431b,_0x28c676){_0x32431b=_0x32431b-0x0;var _0x5c3945=_0x9bde[_0x32431b];return _0x5c3945;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5f511c,_0xbfed54){var _0x5d431b=function(_0xc15e1f){while(--_0xc15e1f){_0x5f511c['push'](_0x5f511c['shift']());}};_0x5d431b(++_0xbfed54);}(_0x008c,0x188));var _0xc008=function(_0x3d09e2,_0x58e784){_0x3d09e2=_0x3d09e2-0x0;var _0x5d03cd=_0x008c[_0x3d09e2];return _0x5d03cd;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index fdc0905..0893f98 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 _0x422e=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','set','Content-Range','save','update','then','end','sendStatus','error','stack','name','send','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','findAll','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x422e,0x15b));var _0xe422=function(_0x1b981d,_0x43a59f){_0x1b981d=_0x1b981d-0x0;var _0x44fafc=_0x422e[_0x1b981d];return _0x44fafc;};'use strict';var emlformat=require(_0xe422('0x0'));var rimraf=require(_0xe422('0x1'));var zipdir=require(_0xe422('0x2'));var jsonpatch=require(_0xe422('0x3'));var rp=require('request-promise');var moment=require(_0xe422('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe422('0x5'));var util=require(_0xe422('0x6'));var path=require(_0xe422('0x7'));var sox=require(_0xe422('0x8'));var csv=require(_0xe422('0x9'));var ejs=require(_0xe422('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe422('0xb'));var crypto=require(_0xe422('0xc'));var jsforce=require(_0xe422('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe422('0xe'));var Papa=require(_0xe422('0xf'));var Redis=require(_0xe422('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe422('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe422('0x12'));var logger=require(_0xe422('0x13'))(_0xe422('0x14'));var utils=require('../../config/utils');var config=require(_0xe422('0x15'));var licenseUtil=require(_0xe422('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x174829,_0x3764f5){_0x3764f5=_0x3764f5||0xcc;return function(_0x290137){if(_0x290137){return _0x174829['sendStatus'](_0x3764f5);}return _0x174829[_0xe422('0x17')](_0x3764f5)['end']();};}function respondWithResult(_0x53df89,_0x31fa49){_0x31fa49=_0x31fa49||0xc8;return function(_0x2d375c){if(_0x2d375c){return _0x53df89[_0xe422('0x17')](_0x31fa49)['json'](_0x2d375c);}};}function respondWithFilteredResult(_0xa74c35,_0x15c3db){return function(_0x50b5fc){if(_0x50b5fc){var _0x522fb2=typeof _0x15c3db[_0xe422('0x18')]===_0xe422('0x19')&&typeof _0x15c3db[_0xe422('0x1a')]===_0xe422('0x19');var _0x160c9a=_0x50b5fc[_0xe422('0x1b')];var _0x106f0f=_0x522fb2?0x0:_0x15c3db[_0xe422('0x18')];var _0x5eb65c=_0x522fb2?_0x50b5fc[_0xe422('0x1b')]:_0x15c3db[_0xe422('0x18')]+_0x15c3db[_0xe422('0x1a')];var _0x291248;if(_0x5eb65c>=_0x160c9a){_0x5eb65c=_0x160c9a;_0x291248=0xc8;}else{_0x291248=0xce;}_0xa74c35[_0xe422('0x17')](_0x291248);return _0xa74c35[_0xe422('0x1c')](_0xe422('0x1d'),_0x106f0f+'-'+_0x5eb65c+'/'+_0x160c9a)['json'](_0x50b5fc);}return null;};}function patchUpdates(_0x5221c8){return function(_0x17511c){try{jsonpatch['apply'](_0x17511c,_0x5221c8,!![]);}catch(_0x249f7b){return BPromise['reject'](_0x249f7b);}return _0x17511c[_0xe422('0x1e')]();};}function saveUpdates(_0x12ea6a,_0x2da1bf){return function(_0x3759e2){if(_0x3759e2){return _0x3759e2[_0xe422('0x1f')](_0x12ea6a)[_0xe422('0x20')](function(_0x53b576){return _0x53b576;});}return null;};}function removeEntity(_0x2afc45,_0x2e41ce){return function(_0x5661ea){if(_0x5661ea){return _0x5661ea['destroy']()[_0xe422('0x20')](function(){_0x2afc45[_0xe422('0x17')](0xcc)[_0xe422('0x21')]();});}};}function handleEntityNotFound(_0x27c6c9,_0x2649a6){return function(_0x2eb50e){if(!_0x2eb50e){_0x27c6c9[_0xe422('0x22')](0x194);}return _0x2eb50e;};}function handleError(_0x3b7fac,_0x50f177){_0x50f177=_0x50f177||0x1f4;return function(_0x53281a){logger[_0xe422('0x23')](_0x53281a[_0xe422('0x24')]);if(_0x53281a[_0xe422('0x25')]){delete _0x53281a[_0xe422('0x25')];}_0x3b7fac[_0xe422('0x17')](_0x50f177)[_0xe422('0x26')](_0x53281a);};}exports['index']=function(_0x2abd09,_0x2631e8){var _0x1ad6f4={},_0x5ea2e5={},_0x5680f3={'count':0x0,'rows':[]};var _0x5395f7=_['map'](db[_0xe422('0x27')][_0xe422('0x28')],function(_0x2d581d){return{'name':_0x2d581d[_0xe422('0x29')],'type':_0x2d581d[_0xe422('0x2a')][_0xe422('0x2b')]};});_0x5ea2e5[_0xe422('0x2c')]=_['map'](_0x5395f7,_0xe422('0x25'));_0x5ea2e5[_0xe422('0x2d')]=_[_0xe422('0x2e')](_0x2abd09[_0xe422('0x2d')]);_0x5ea2e5[_0xe422('0x2f')]=_[_0xe422('0x30')](_0x5ea2e5[_0xe422('0x2c')],_0x5ea2e5[_0xe422('0x2d')]);_0x1ad6f4[_0xe422('0x31')]=_['intersection'](_0x5ea2e5['model'],qs[_0xe422('0x32')](_0x2abd09['query']['fields']));_0x1ad6f4['attributes']=_0x1ad6f4[_0xe422('0x31')][_0xe422('0x33')]?_0x1ad6f4[_0xe422('0x31')]:_0x5ea2e5[_0xe422('0x2c')];if(!_0x2abd09[_0xe422('0x2d')][_0xe422('0x34')](_0xe422('0x35'))){_0x1ad6f4['limit']=qs[_0xe422('0x1a')](_0x2abd09['query'][_0xe422('0x1a')]);_0x1ad6f4[_0xe422('0x18')]=qs['offset'](_0x2abd09[_0xe422('0x2d')][_0xe422('0x18')]);}_0x1ad6f4[_0xe422('0x36')]=qs[_0xe422('0x37')](_0x2abd09['query']['sort']);_0x1ad6f4[_0xe422('0x38')]=qs[_0xe422('0x2f')](_['pick'](_0x2abd09[_0xe422('0x2d')],_0x5ea2e5[_0xe422('0x2f')]),_0x5395f7);if(_0x2abd09[_0xe422('0x2d')][_0xe422('0x39')]){_0x1ad6f4[_0xe422('0x38')]=_[_0xe422('0x3a')](_0x1ad6f4[_0xe422('0x38')],{'$or':_[_0xe422('0x3b')](_0x5395f7,function(_0x3ae464){if(_0x3ae464[_0xe422('0x2a')]!==_0xe422('0x3c')){var _0x5b9435={};_0x5b9435[_0x3ae464[_0xe422('0x25')]]={'$like':'%'+_0x2abd09[_0xe422('0x2d')]['filter']+'%'};return _0x5b9435;}})});}_0x1ad6f4=_[_0xe422('0x3a')]({},_0x1ad6f4,_0x2abd09[_0xe422('0x3d')]);var _0x473f90={'where':_0x1ad6f4[_0xe422('0x38')]};return db[_0xe422('0x27')][_0xe422('0x1b')](_0x473f90)[_0xe422('0x20')](function(_0x3cebb2){_0x5680f3['count']=_0x3cebb2;if(_0x2abd09[_0xe422('0x2d')]['includeAll']){_0x1ad6f4['include']=[{'all':!![]}];}return db[_0xe422('0x27')][_0xe422('0x3e')](_0x1ad6f4);})[_0xe422('0x20')](function(_0x10046e){_0x5680f3['rows']=_0x10046e;return _0x5680f3;})[_0xe422('0x20')](respondWithFilteredResult(_0x2631e8,_0x1ad6f4))[_0xe422('0x3f')](handleError(_0x2631e8,null));};exports[_0xe422('0x40')]=function(_0x1d43aa,_0x5d8127){var _0x1df7cb={'raw':!![],'where':{'id':_0x1d43aa[_0xe422('0x41')]['id']}},_0x2f7928={};_0x2f7928[_0xe422('0x2c')]=_['keys'](db[_0xe422('0x27')]['rawAttributes']);_0x2f7928[_0xe422('0x2d')]=_[_0xe422('0x2e')](_0x1d43aa[_0xe422('0x2d')]);_0x2f7928[_0xe422('0x2f')]=_[_0xe422('0x30')](_0x2f7928['model'],_0x2f7928['query']);_0x1df7cb[_0xe422('0x31')]=_['intersection'](_0x2f7928[_0xe422('0x2c')],qs[_0xe422('0x32')](_0x1d43aa[_0xe422('0x2d')][_0xe422('0x32')]));_0x1df7cb['attributes']=_0x1df7cb[_0xe422('0x31')]['length']?_0x1df7cb['attributes']:_0x2f7928[_0xe422('0x2c')];if(_0x1d43aa['query'][_0xe422('0x42')]){_0x1df7cb['include']=[{'all':!![]}];}_0x1df7cb=_[_0xe422('0x3a')]({},_0x1df7cb,_0x1d43aa[_0xe422('0x3d')]);return db['FaxTransferReport'][_0xe422('0x43')](_0x1df7cb)['then'](handleEntityNotFound(_0x5d8127,null))[_0xe422('0x20')](respondWithResult(_0x5d8127,null))[_0xe422('0x3f')](handleError(_0x5d8127,null));};exports[_0xe422('0x44')]=function(_0x3d67d7,_0x566bc9){return db[_0xe422('0x27')][_0xe422('0x44')](_0x3d67d7[_0xe422('0x45')],{})[_0xe422('0x20')](respondWithResult(_0x566bc9,0xc9))[_0xe422('0x3f')](handleError(_0x566bc9,null));};exports[_0xe422('0x1f')]=function(_0x30d733,_0x5259bf){if(_0x30d733[_0xe422('0x45')]['id']){delete _0x30d733[_0xe422('0x45')]['id'];}return db[_0xe422('0x27')]['find']({'where':{'id':_0x30d733[_0xe422('0x41')]['id']}})[_0xe422('0x20')](handleEntityNotFound(_0x5259bf,null))[_0xe422('0x20')](saveUpdates(_0x30d733[_0xe422('0x45')],null))['then'](respondWithResult(_0x5259bf,null))[_0xe422('0x3f')](handleError(_0x5259bf,null));};exports[_0xe422('0x46')]=function(_0x3a2160,_0x39eb2b){return db[_0xe422('0x27')][_0xe422('0x43')]({'where':{'id':_0x3a2160[_0xe422('0x41')]['id']}})[_0xe422('0x20')](handleEntityNotFound(_0x39eb2b,null))['then'](removeEntity(_0x39eb2b,null))[_0xe422('0x3f')](handleError(_0x39eb2b,null));};exports[_0xe422('0x47')]=function(_0x17ec9b,_0x10aef0){return db[_0xe422('0x27')][_0xe422('0x47')]()[_0xe422('0x20')](respondWithResult(_0x10aef0,null))[_0xe422('0x3f')](handleError(_0x10aef0,null));}; \ No newline at end of file +var _0x4316=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','filter','options','rows','catch','include','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x2254cf,_0xc88f40){var _0x2c5881=function(_0x44136d){while(--_0x44136d){_0x2254cf['push'](_0x2254cf['shift']());}};_0x2c5881(++_0xc88f40);}(_0x4316,0x7f));var _0x6431=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4316[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x6431('0x0'));var rimraf=require(_0x6431('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6431('0x2'));var rp=require('request-promise');var moment=require(_0x6431('0x3'));var BPromise=require(_0x6431('0x4'));var Mustache=require(_0x6431('0x5'));var util=require(_0x6431('0x6'));var path=require(_0x6431('0x7'));var sox=require(_0x6431('0x8'));var csv=require(_0x6431('0x9'));var ejs=require(_0x6431('0xa'));var fs=require('fs');var fs_extra=require(_0x6431('0xb'));var _=require(_0x6431('0xc'));var squel=require(_0x6431('0xd'));var crypto=require('crypto');var jsforce=require(_0x6431('0xe'));var deskjs=require(_0x6431('0xf'));var toCsv=require(_0x6431('0x9'));var querystring=require(_0x6431('0x10'));var Papa=require(_0x6431('0x11'));var Redis=require(_0x6431('0x12'));var authService=require(_0x6431('0x13'));var qs=require(_0x6431('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6431('0x15'))(_0x6431('0x16'));var utils=require(_0x6431('0x17'));var config=require(_0x6431('0x18'));var licenseUtil=require(_0x6431('0x19'));var db=require(_0x6431('0x1a'))['db'];function respondWithStatusCode(_0x3fc18b,_0x45db4c){_0x45db4c=_0x45db4c||0xcc;return function(_0x2353a3){if(_0x2353a3){return _0x3fc18b['sendStatus'](_0x45db4c);}return _0x3fc18b[_0x6431('0x1b')](_0x45db4c)['end']();};}function respondWithResult(_0x38d8cd,_0x3c6bcb){_0x3c6bcb=_0x3c6bcb||0xc8;return function(_0x3fa2e8){if(_0x3fa2e8){return _0x38d8cd[_0x6431('0x1b')](_0x3c6bcb)[_0x6431('0x1c')](_0x3fa2e8);}};}function respondWithFilteredResult(_0x2e25d3,_0xa587a5){return function(_0x182af0){if(_0x182af0){var _0x18ee60=typeof _0xa587a5[_0x6431('0x1d')]===_0x6431('0x1e')&&typeof _0xa587a5[_0x6431('0x1f')]===_0x6431('0x1e');var _0xd49a5=_0x182af0[_0x6431('0x20')];var _0x4d7082=_0x18ee60?0x0:_0xa587a5['offset'];var _0x2c80f2=_0x18ee60?_0x182af0['count']:_0xa587a5[_0x6431('0x1d')]+_0xa587a5[_0x6431('0x1f')];var _0x130d15;if(_0x2c80f2>=_0xd49a5){_0x2c80f2=_0xd49a5;_0x130d15=0xc8;}else{_0x130d15=0xce;}_0x2e25d3['status'](_0x130d15);return _0x2e25d3['set'](_0x6431('0x21'),_0x4d7082+'-'+_0x2c80f2+'/'+_0xd49a5)['json'](_0x182af0);}return null;};}function patchUpdates(_0x4b8e2d){return function(_0x288e07){try{jsonpatch[_0x6431('0x22')](_0x288e07,_0x4b8e2d,!![]);}catch(_0x8b3a13){return BPromise[_0x6431('0x23')](_0x8b3a13);}return _0x288e07[_0x6431('0x24')]();};}function saveUpdates(_0x277dda,_0xb3ebbd){return function(_0x1c72ba){if(_0x1c72ba){return _0x1c72ba[_0x6431('0x25')](_0x277dda)[_0x6431('0x26')](function(_0x4474f5){return _0x4474f5;});}return null;};}function removeEntity(_0x52a19b,_0x36b696){return function(_0xda6d3f){if(_0xda6d3f){return _0xda6d3f[_0x6431('0x27')]()['then'](function(){_0x52a19b['status'](0xcc)[_0x6431('0x28')]();});}};}function handleEntityNotFound(_0x2225be,_0x442c51){return function(_0x261f30){if(!_0x261f30){_0x2225be[_0x6431('0x29')](0x194);}return _0x261f30;};}function handleError(_0xd69166,_0x3572a6){_0x3572a6=_0x3572a6||0x1f4;return function(_0x405003){logger['error'](_0x405003[_0x6431('0x2a')]);if(_0x405003[_0x6431('0x2b')]){delete _0x405003[_0x6431('0x2b')];}_0xd69166[_0x6431('0x1b')](_0x3572a6)[_0x6431('0x2c')](_0x405003);};}exports['index']=function(_0x1b1e78,_0x1a6f52){var _0x173aa9={},_0x4c9562={},_0x1267d6={'count':0x0,'rows':[]};var _0x190533=_[_0x6431('0x2d')](db[_0x6431('0x2e')][_0x6431('0x2f')],function(_0x1dba73){return{'name':_0x1dba73[_0x6431('0x30')],'type':_0x1dba73[_0x6431('0x31')]['key']};});_0x4c9562[_0x6431('0x32')]=_[_0x6431('0x2d')](_0x190533,_0x6431('0x2b'));_0x4c9562[_0x6431('0x33')]=_[_0x6431('0x34')](_0x1b1e78[_0x6431('0x33')]);_0x4c9562[_0x6431('0x35')]=_[_0x6431('0x36')](_0x4c9562[_0x6431('0x32')],_0x4c9562[_0x6431('0x33')]);_0x173aa9[_0x6431('0x37')]=_[_0x6431('0x36')](_0x4c9562[_0x6431('0x32')],qs[_0x6431('0x38')](_0x1b1e78[_0x6431('0x33')][_0x6431('0x38')]));_0x173aa9['attributes']=_0x173aa9['attributes'][_0x6431('0x39')]?_0x173aa9[_0x6431('0x37')]:_0x4c9562[_0x6431('0x32')];if(!_0x1b1e78[_0x6431('0x33')]['hasOwnProperty'](_0x6431('0x3a'))){_0x173aa9[_0x6431('0x1f')]=qs['limit'](_0x1b1e78['query'][_0x6431('0x1f')]);_0x173aa9[_0x6431('0x1d')]=qs['offset'](_0x1b1e78[_0x6431('0x33')][_0x6431('0x1d')]);}_0x173aa9['order']=qs[_0x6431('0x3b')](_0x1b1e78['query'][_0x6431('0x3b')]);_0x173aa9[_0x6431('0x3c')]=qs['filters'](_[_0x6431('0x3d')](_0x1b1e78[_0x6431('0x33')],_0x4c9562[_0x6431('0x35')]),_0x190533);if(_0x1b1e78[_0x6431('0x33')]['filter']){_0x173aa9[_0x6431('0x3c')]=_[_0x6431('0x3e')](_0x173aa9[_0x6431('0x3c')],{'$or':_['map'](_0x190533,function(_0x4390a0){if(_0x4390a0['type']!=='VIRTUAL'){var _0x301d05={};_0x301d05[_0x4390a0[_0x6431('0x2b')]]={'$like':'%'+_0x1b1e78[_0x6431('0x33')][_0x6431('0x3f')]+'%'};return _0x301d05;}})});}_0x173aa9=_[_0x6431('0x3e')]({},_0x173aa9,_0x1b1e78[_0x6431('0x40')]);var _0x3f4a1e={'where':_0x173aa9[_0x6431('0x3c')]};return db[_0x6431('0x2e')]['count'](_0x3f4a1e)[_0x6431('0x26')](function(_0x43a377){_0x1267d6['count']=_0x43a377;if(_0x1b1e78['query']['includeAll']){_0x173aa9['include']=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x173aa9);})[_0x6431('0x26')](function(_0x38c06b){_0x1267d6[_0x6431('0x41')]=_0x38c06b;return _0x1267d6;})[_0x6431('0x26')](respondWithFilteredResult(_0x1a6f52,_0x173aa9))[_0x6431('0x42')](handleError(_0x1a6f52,null));};exports['show']=function(_0x4485e0,_0x143414){var _0x1c7bb3={'raw':!![],'where':{'id':_0x4485e0['params']['id']}},_0x5ade2b={};_0x5ade2b[_0x6431('0x32')]=_[_0x6431('0x34')](db[_0x6431('0x2e')][_0x6431('0x2f')]);_0x5ade2b['query']=_[_0x6431('0x34')](_0x4485e0[_0x6431('0x33')]);_0x5ade2b['filters']=_[_0x6431('0x36')](_0x5ade2b[_0x6431('0x32')],_0x5ade2b['query']);_0x1c7bb3['attributes']=_['intersection'](_0x5ade2b[_0x6431('0x32')],qs[_0x6431('0x38')](_0x4485e0[_0x6431('0x33')][_0x6431('0x38')]));_0x1c7bb3[_0x6431('0x37')]=_0x1c7bb3[_0x6431('0x37')][_0x6431('0x39')]?_0x1c7bb3[_0x6431('0x37')]:_0x5ade2b[_0x6431('0x32')];if(_0x4485e0['query']['includeAll']){_0x1c7bb3[_0x6431('0x43')]=[{'all':!![]}];}_0x1c7bb3=_[_0x6431('0x3e')]({},_0x1c7bb3,_0x4485e0[_0x6431('0x40')]);return db[_0x6431('0x2e')]['find'](_0x1c7bb3)[_0x6431('0x26')](handleEntityNotFound(_0x143414,null))[_0x6431('0x26')](respondWithResult(_0x143414,null))['catch'](handleError(_0x143414,null));};exports[_0x6431('0x44')]=function(_0x5c56be,_0x24d726){return db[_0x6431('0x2e')]['create'](_0x5c56be['body'],{})[_0x6431('0x26')](respondWithResult(_0x24d726,0xc9))[_0x6431('0x42')](handleError(_0x24d726,null));};exports[_0x6431('0x25')]=function(_0x454467,_0xa0adad){if(_0x454467['body']['id']){delete _0x454467[_0x6431('0x45')]['id'];}return db[_0x6431('0x2e')][_0x6431('0x46')]({'where':{'id':_0x454467[_0x6431('0x47')]['id']}})[_0x6431('0x26')](handleEntityNotFound(_0xa0adad,null))[_0x6431('0x26')](saveUpdates(_0x454467[_0x6431('0x45')],null))[_0x6431('0x26')](respondWithResult(_0xa0adad,null))[_0x6431('0x42')](handleError(_0xa0adad,null));};exports[_0x6431('0x27')]=function(_0xa45092,_0x2cd327){return db[_0x6431('0x2e')][_0x6431('0x46')]({'where':{'id':_0xa45092[_0x6431('0x47')]['id']}})[_0x6431('0x26')](handleEntityNotFound(_0x2cd327,null))[_0x6431('0x26')](removeEntity(_0x2cd327,null))[_0x6431('0x42')](handleError(_0x2cd327,null));};exports[_0x6431('0x48')]=function(_0x362fde,_0x534f22){return db[_0x6431('0x2e')]['describe']()[_0x6431('0x26')](respondWithResult(_0x534f22,null))[_0x6431('0x42')](handleError(_0x534f22,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index afefd0d..afd9669 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 _0xa4a9=['path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x427484,_0x5c3f13){var _0x582446=function(_0x4c273e){while(--_0x4c273e){_0x427484['push'](_0x427484['shift']());}};_0x582446(++_0x5c3f13);}(_0xa4a9,0x126));var _0x9a4a=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0xa4a9[_0x2d6197];return _0x4d0e75;};'use strict';var _=require(_0x9a4a('0x0'));var util=require(_0x9a4a('0x1'));var logger=require('../../config/logger')(_0x9a4a('0x2'));var moment=require(_0x9a4a('0x3'));var BPromise=require(_0x9a4a('0x4'));var rp=require(_0x9a4a('0x5'));var fs=require('fs');var path=require(_0x9a4a('0x6'));var rimraf=require(_0x9a4a('0x7'));var config=require(_0x9a4a('0x8'));var attributes=require(_0x9a4a('0x9'));module[_0x9a4a('0xa')]=function(_0x31f124,_0x30eaa3){return _0x31f124[_0x9a4a('0xb')](_0x9a4a('0xc'),attributes,{'tableName':_0x9a4a('0xd'),'paranoid':![],'indexes':[{'name':_0x9a4a('0xe'),'fields':[_0x9a4a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x374d=['lodash','util','api','path','rimraf','./faxTransferReport.attributes','define','report_fax_transfer','uniqueid'];(function(_0x4f4cff,_0x5b5110){var _0x43075d=function(_0x4c1d4a){while(--_0x4c1d4a){_0x4f4cff['push'](_0x4f4cff['shift']());}};_0x43075d(++_0x5b5110);}(_0x374d,0x144));var _0xd374=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x374d[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xd374('0x0'));var util=require(_0xd374('0x1'));var logger=require('../../config/logger')(_0xd374('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd374('0x3'));var rimraf=require(_0xd374('0x4'));var config=require('../../config/environment');var attributes=require(_0xd374('0x5'));module['exports']=function(_0x1d9a68,_0x31b2b0){return _0x1d9a68[_0xd374('0x6')]('FaxTransferReport',attributes,{'tableName':_0xd374('0x7'),'paranoid':![],'indexes':[{'name':_0xd374('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 998299f..06484a7 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 _0xb7aa=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0xf877dd,_0x202e2a){var _0x8d9e4f=function(_0x22b762){while(--_0x22b762){_0xf877dd['push'](_0xf877dd['shift']());}};_0x8d9e4f(++_0x202e2a);}(_0xb7aa,0x12c));var _0xab7a=function(_0x139ef0,_0x140473){_0x139ef0=_0x139ef0-0x0;var _0x470856=_0xb7aa[_0x139ef0];return _0x470856;};'use strict';var _=require('lodash');var util=require(_0xab7a('0x0'));var moment=require(_0xab7a('0x1'));var BPromise=require(_0xab7a('0x2'));var rs=require(_0xab7a('0x3'));var fs=require('fs');var Redis=require(_0xab7a('0x4'));var db=require(_0xab7a('0x5'))['db'];var utils=require(_0xab7a('0x6'));var logger=require(_0xab7a('0x7'))('rpc');var config=require(_0xab7a('0x8'));var jayson=require(_0xab7a('0x9'));var client=jayson[_0xab7a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58eb2c,_0x4ba245,_0x275029){return new BPromise(function(_0x1c100b,_0x292fdf){return client[_0xab7a('0xb')](_0x58eb2c,_0x275029)[_0xab7a('0xc')](function(_0x276103){logger[_0xab7a('0xd')](_0xab7a('0xe'),_0x4ba245,_0xab7a('0xf'));logger[_0xab7a('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x4ba245,_0xab7a('0xf'),JSON[_0xab7a('0x11')](_0x276103));if(_0x276103[_0xab7a('0x12')]){if(_0x276103[_0xab7a('0x12')][_0xab7a('0x13')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x4ba245,_0x276103[_0xab7a('0x12')][_0xab7a('0x14')]);return _0x292fdf(_0x276103[_0xab7a('0x12')][_0xab7a('0x14')]);}logger['error'](_0xab7a('0xe'),_0x4ba245,_0x276103['error'][_0xab7a('0x14')]);return _0x1c100b(_0x276103[_0xab7a('0x12')][_0xab7a('0x14')]);}else{logger[_0xab7a('0xd')](_0xab7a('0xe'),_0x4ba245,_0xab7a('0xf'));_0x1c100b(_0x276103[_0xab7a('0x15')]['message']);}})[_0xab7a('0x16')](function(_0xb2a9f6){logger[_0xab7a('0x12')](_0xab7a('0xe'),_0x4ba245,_0xb2a9f6);_0x292fdf(_0xb2a9f6);});});} \ No newline at end of file +var _0xc39b=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x8393eb,_0x2aa2f4){var _0x552712=function(_0x2edc6e){while(--_0x2edc6e){_0x8393eb['push'](_0x8393eb['shift']());}};_0x552712(++_0x2aa2f4);}(_0xc39b,0x14b));var _0xbc39=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xc39b[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xbc39('0x0'));var util=require(_0xbc39('0x1'));var moment=require(_0xbc39('0x2'));var BPromise=require(_0xbc39('0x3'));var rs=require(_0xbc39('0x4'));var fs=require('fs');var Redis=require(_0xbc39('0x5'));var db=require(_0xbc39('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc39('0x7'))(_0xbc39('0x8'));var config=require(_0xbc39('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbc39('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cf1c9,_0x4363a3,_0x1d4b47){return new BPromise(function(_0x145db6,_0x3e642d){return client['request'](_0x3cf1c9,_0x1d4b47)['then'](function(_0x4e2cc3){logger['info'](_0xbc39('0xb'),_0x4363a3,_0xbc39('0xc'));logger['debug'](_0xbc39('0xd'),_0x4363a3,_0xbc39('0xc'),JSON[_0xbc39('0xe')](_0x4e2cc3));if(_0x4e2cc3[_0xbc39('0xf')]){if(_0x4e2cc3[_0xbc39('0xf')][_0xbc39('0x10')]===0x1f4){logger[_0xbc39('0xf')](_0xbc39('0xb'),_0x4363a3,_0x4e2cc3['error'][_0xbc39('0x11')]);return _0x3e642d(_0x4e2cc3[_0xbc39('0xf')][_0xbc39('0x11')]);}logger[_0xbc39('0xf')](_0xbc39('0xb'),_0x4363a3,_0x4e2cc3[_0xbc39('0xf')][_0xbc39('0x11')]);return _0x145db6(_0x4e2cc3[_0xbc39('0xf')][_0xbc39('0x11')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x4363a3,_0xbc39('0xc'));_0x145db6(_0x4e2cc3['result'][_0xbc39('0x11')]);}})[_0xbc39('0x12')](function(_0x18db14){logger[_0xbc39('0xf')](_0xbc39('0xb'),_0x4363a3,_0x18db14);_0x3e642d(_0x18db14);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index fbf0d1a..c849bed 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 _0xd0ce=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','create','put','delete','/:id','destroy','multer','util','path','connect-timeout'];(function(_0x2f92e0,_0x205baa){var _0x6176e3=function(_0x4d6c89){while(--_0x4d6c89){_0x2f92e0['push'](_0x2f92e0['shift']());}};_0x6176e3(++_0x205baa);}(_0xd0ce,0xd8));var _0xed0c=function(_0x3303fb,_0x1266dd){_0x3303fb=_0x3303fb-0x0;var _0x71a686=_0xd0ce[_0x3303fb];return _0x71a686;};'use strict';var multer=require(_0xed0c('0x0'));var util=require(_0xed0c('0x1'));var path=require(_0xed0c('0x2'));var timeout=require(_0xed0c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xed0c('0x4'));var auth=require(_0xed0c('0x5'));var interaction=require(_0xed0c('0x6'));var config=require(_0xed0c('0x7'));var controller=require(_0xed0c('0x8'));router[_0xed0c('0x9')]('/',auth['isAuthenticated'](),controller[_0xed0c('0xa')]);router[_0xed0c('0x9')](_0xed0c('0xb'),auth[_0xed0c('0xc')](),controller[_0xed0c('0xd')]);router[_0xed0c('0x9')]('/:id',auth[_0xed0c('0xc')](),controller[_0xed0c('0xe')]);router['post']('/',auth[_0xed0c('0xc')](),controller[_0xed0c('0xf')]);router[_0xed0c('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xed0c('0x11')](_0xed0c('0x12'),auth[_0xed0c('0xc')](),controller[_0xed0c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x93c5=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','post','create','put','/:id'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x93c5,0xd3));var _0x593c=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x93c5[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require('multer');var util=require(_0x593c('0x0'));var path=require(_0x593c('0x1'));var timeout=require(_0x593c('0x2'));var express=require(_0x593c('0x3'));var router=express[_0x593c('0x4')]();var fs_extra=require(_0x593c('0x5'));var auth=require(_0x593c('0x6'));var interaction=require(_0x593c('0x7'));var config=require('../../config/environment');var controller=require(_0x593c('0x8'));router[_0x593c('0x9')]('/',auth[_0x593c('0xa')](),controller[_0x593c('0xb')]);router[_0x593c('0x9')](_0x593c('0xc'),auth[_0x593c('0xa')](),controller['describe']);router['get']('/:id',auth[_0x593c('0xa')](),controller['show']);router[_0x593c('0xd')]('/',auth[_0x593c('0xa')](),controller[_0x593c('0xe')]);router[_0x593c('0xf')](_0x593c('0x10'),auth[_0x593c('0xa')](),controller['update']);router['delete'](_0x593c('0x10'),auth['isAuthenticated'](),controller[_0x593c('0x11')]);module[_0x593c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index bbaa2df..8aa7014 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 _0x0d02=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d02,0xc4));var _0x20d0=function(_0x59b602,_0x31c169){_0x59b602=_0x59b602-0x0;var _0x569045=_0x0d02[_0x59b602];return _0x569045;};'use strict';var multer=require(_0x20d0('0x0'));var util=require('util');var path=require(_0x20d0('0x1'));var timeout=require(_0x20d0('0x2'));var express=require(_0x20d0('0x3'));var router=express[_0x20d0('0x4')]();var fs_extra=require(_0x20d0('0x5'));var auth=require(_0x20d0('0x6'));var interaction=require(_0x20d0('0x7'));var config=require('../../config/environment');var controller=require(_0x20d0('0x8'));router[_0x20d0('0x9')]('/',auth[_0x20d0('0xa')](),controller[_0x20d0('0xb')]);router[_0x20d0('0x9')]('/:id',auth[_0x20d0('0xa')](),controller[_0x20d0('0xc')]);router[_0x20d0('0x9')](_0x20d0('0xd'),auth[_0x20d0('0xa')](),controller['getConfigurations']);router['get'](_0x20d0('0xe'),auth[_0x20d0('0xa')](),controller['getFields']);router[_0x20d0('0xf')]('/',auth[_0x20d0('0xa')](),controller[_0x20d0('0x10')]);router[_0x20d0('0xf')]('/:id/configurations',auth[_0x20d0('0xa')](),controller[_0x20d0('0x11')]);router[_0x20d0('0x12')](_0x20d0('0x13'),auth[_0x20d0('0xa')](),controller[_0x20d0('0x14')]);router[_0x20d0('0x15')]('/:id',auth[_0x20d0('0xa')](),controller[_0x20d0('0x16')]);module[_0x20d0('0x17')]=router; \ No newline at end of file +var _0x270b=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','destroy','multer'];(function(_0x394b23,_0x36d244){var _0xccfc8b=function(_0x2609f6){while(--_0x2609f6){_0x394b23['push'](_0x394b23['shift']());}};_0xccfc8b(++_0x36d244);}(_0x270b,0xfb));var _0xb270=function(_0x8aa782,_0x15be86){_0x8aa782=_0x8aa782-0x0;var _0x1bfc83=_0x270b[_0x8aa782];return _0x1bfc83;};'use strict';var multer=require(_0xb270('0x0'));var util=require(_0xb270('0x1'));var path=require('path');var timeout=require(_0xb270('0x2'));var express=require(_0xb270('0x3'));var router=express[_0xb270('0x4')]();var fs_extra=require(_0xb270('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb270('0x6'));var config=require(_0xb270('0x7'));var controller=require(_0xb270('0x8'));router[_0xb270('0x9')]('/',auth['isAuthenticated'](),controller[_0xb270('0xa')]);router['get'](_0xb270('0xb'),auth[_0xb270('0xc')](),controller['show']);router[_0xb270('0x9')](_0xb270('0xd'),auth[_0xb270('0xc')](),controller[_0xb270('0xe')]);router[_0xb270('0x9')](_0xb270('0xf'),auth[_0xb270('0xc')](),controller[_0xb270('0x10')]);router[_0xb270('0x11')]('/',auth[_0xb270('0xc')](),controller['create']);router[_0xb270('0x11')]('/:id/configurations',auth[_0xb270('0xc')](),controller['addConfiguration']);router[_0xb270('0x12')]('/:id',auth[_0xb270('0xc')](),controller[_0xb270('0x13')]);router['delete'](_0xb270('0xb'),auth['isAuthenticated'](),controller[_0xb270('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 581b3e8..14039a0 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 _0x1e48=['sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x1459d9,_0x380230){var _0x488424=function(_0x222866){while(--_0x222866){_0x1459d9['push'](_0x1459d9['shift']());}};_0x488424(++_0x380230);}(_0x1e48,0x126));var _0x81e4=function(_0x3f4875,_0x1eee06){_0x3f4875=_0x3f4875-0x0;var _0x1727cf=_0x1e48[_0x3f4875];return _0x1727cf;};'use strict';var Sequelize=require(_0x81e4('0x0'));module[_0x81e4('0x1')]={'name':{'type':Sequelize[_0x81e4('0x2')]},'description':{'type':Sequelize[_0x81e4('0x2')]},'username':{'type':Sequelize[_0x81e4('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x81e4('0x3')](_0x81e4('0x4')),'defaultValue':_0x81e4('0x4')},'password':{'type':Sequelize[_0x81e4('0x2')]},'consumerKey':{'type':Sequelize[_0x81e4('0x2')]},'consumerSecret':{'type':Sequelize[_0x81e4('0x2')]},'token':{'type':Sequelize[_0x81e4('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x81e4('0x3')](_0x81e4('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xd892=['STRING','ENUM','basic','integrationTab','newTab','exports'];(function(_0x36bca0,_0x12dbae){var _0x31487d=function(_0x3c505e){while(--_0x3c505e){_0x36bca0['push'](_0x36bca0['shift']());}};_0x31487d(++_0x12dbae);}(_0xd892,0x18b));var _0x2d89=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xd892[_0x1f9f37];return _0x21c080;};'use strict';var Sequelize=require('sequelize');module[_0x2d89('0x0')]={'name':{'type':Sequelize[_0x2d89('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2d89('0x1')]},'remoteUri':{'type':Sequelize[_0x2d89('0x1')]},'authType':{'type':Sequelize[_0x2d89('0x2')](_0x2d89('0x3')),'defaultValue':_0x2d89('0x3')},'password':{'type':Sequelize[_0x2d89('0x1')]},'consumerKey':{'type':Sequelize[_0x2d89('0x1')]},'consumerSecret':{'type':Sequelize[_0x2d89('0x1')]},'token':{'type':Sequelize[_0x2d89('0x1')]},'tokenSecret':{'type':Sequelize[_0x2d89('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2d89('0x4'),_0x2d89('0x5')),'defaultValue':_0x2d89('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 1c09936..bd319d3 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 _0xbf06=['basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','statusCode','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','send','map','DeskAccount','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','find','catch','create','body','getConfigurations','findOne','DeskConfiguration','merge','addConfiguration','AccountId','Subjects','getDescriptions','DeskField','Descriptions','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','slice','substring','GET','format','%s/custom_fields','application/json'];(function(_0x41f2ef,_0x840163){var _0x5dd268=function(_0x5bb81a){while(--_0x5bb81a){_0x41f2ef['push'](_0x41f2ef['shift']());}};_0x5dd268(++_0x840163);}(_0xbf06,0x82));var _0x6bf0=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xbf06[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require(_0x6bf0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6bf0('0x1'));var jsonpatch=require(_0x6bf0('0x2'));var rp=require('request-promise');var moment=require(_0x6bf0('0x3'));var BPromise=require(_0x6bf0('0x4'));var Mustache=require(_0x6bf0('0x5'));var util=require(_0x6bf0('0x6'));var path=require(_0x6bf0('0x7'));var sox=require(_0x6bf0('0x8'));var csv=require('to-csv');var ejs=require(_0x6bf0('0x9'));var fs=require('fs');var fs_extra=require(_0x6bf0('0xa'));var _=require(_0x6bf0('0xb'));var squel=require(_0x6bf0('0xc'));var crypto=require(_0x6bf0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6bf0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6bf0('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6bf0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6bf0('0x11'));var config=require(_0x6bf0('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x6bf0('0x13'))['db'];var integrations=require(_0x6bf0('0x14'));function respondWithStatusCode(_0x442fbd,_0x12bbe3){_0x12bbe3=_0x12bbe3||0xcc;return function(_0x27b1f5){if(_0x27b1f5){return _0x442fbd[_0x6bf0('0x15')](_0x12bbe3);}return _0x442fbd[_0x6bf0('0x16')](_0x12bbe3)[_0x6bf0('0x17')]();};}function respondWithResult(_0x6ce53a,_0x2a5455){_0x2a5455=_0x2a5455||0xc8;return function(_0x29c906){if(_0x29c906){return _0x6ce53a[_0x6bf0('0x16')](_0x2a5455)[_0x6bf0('0x18')](_0x29c906);}};}function respondWithFilteredResult(_0x10e634,_0x4d5364){return function(_0x24fbd0){if(_0x24fbd0){var _0x1d4998=typeof _0x4d5364[_0x6bf0('0x19')]===_0x6bf0('0x1a')&&typeof _0x4d5364[_0x6bf0('0x1b')]===_0x6bf0('0x1a');var _0x2bae82=_0x24fbd0[_0x6bf0('0x1c')];var _0x30ad75=_0x1d4998?0x0:_0x4d5364[_0x6bf0('0x19')];var _0x59c6f8=_0x1d4998?_0x24fbd0[_0x6bf0('0x1c')]:_0x4d5364[_0x6bf0('0x19')]+_0x4d5364[_0x6bf0('0x1b')];var _0x3679e2;if(_0x59c6f8>=_0x2bae82){_0x59c6f8=_0x2bae82;_0x3679e2=0xc8;}else{_0x3679e2=0xce;}_0x10e634['status'](_0x3679e2);return _0x10e634[_0x6bf0('0x1d')](_0x6bf0('0x1e'),_0x30ad75+'-'+_0x59c6f8+'/'+_0x2bae82)[_0x6bf0('0x18')](_0x24fbd0);}return null;};}function patchUpdates(_0x150d8b){return function(_0x35c895){try{jsonpatch['apply'](_0x35c895,_0x150d8b,!![]);}catch(_0x411002){return BPromise[_0x6bf0('0x1f')](_0x411002);}return _0x35c895['save']();};}function saveUpdates(_0x12af4e,_0x2e266b){return function(_0x5b4a93){if(_0x5b4a93){return _0x5b4a93[_0x6bf0('0x20')](_0x12af4e)[_0x6bf0('0x21')](function(_0x160fef){return _0x160fef;});}return null;};}function removeEntity(_0x8c07ee,_0x2a48f6){return function(_0x2887fe){if(_0x2887fe){return _0x2887fe[_0x6bf0('0x22')]()[_0x6bf0('0x21')](function(){_0x8c07ee[_0x6bf0('0x16')](0xcc)[_0x6bf0('0x17')]();});}};}function handleEntityNotFound(_0x17b50a,_0x4e0ee1){return function(_0x18c90f){if(!_0x18c90f){_0x17b50a[_0x6bf0('0x15')](0x194);}return _0x18c90f;};}function handleError(_0x505d97,_0x1a2c82){_0x1a2c82=_0x1a2c82||0x1f4;return function(_0x3b9eee){logger['error'](_0x3b9eee[_0x6bf0('0x23')]);if(_0x3b9eee[_0x6bf0('0x24')]){delete _0x3b9eee[_0x6bf0('0x24')];}_0x505d97[_0x6bf0('0x16')](_0x1a2c82)[_0x6bf0('0x25')](_0x3b9eee);};}exports['index']=function(_0x5b2bff,_0x3a1628){var _0x691cc6={},_0x192b66={},_0x1dc461={'count':0x0,'rows':[]};var _0x18b194=_[_0x6bf0('0x26')](db[_0x6bf0('0x27')]['rawAttributes'],function(_0x37a465){return{'name':_0x37a465['fieldName'],'type':_0x37a465[_0x6bf0('0x28')][_0x6bf0('0x29')]};});_0x192b66[_0x6bf0('0x2a')]=_['map'](_0x18b194,'name');_0x192b66[_0x6bf0('0x2b')]=_[_0x6bf0('0x2c')](_0x5b2bff[_0x6bf0('0x2b')]);_0x192b66[_0x6bf0('0x2d')]=_['intersection'](_0x192b66[_0x6bf0('0x2a')],_0x192b66['query']);_0x691cc6[_0x6bf0('0x2e')]=_['intersection'](_0x192b66[_0x6bf0('0x2a')],qs[_0x6bf0('0x2f')](_0x5b2bff['query'][_0x6bf0('0x2f')]));_0x691cc6[_0x6bf0('0x2e')]=_0x691cc6[_0x6bf0('0x2e')][_0x6bf0('0x30')]?_0x691cc6['attributes']:_0x192b66[_0x6bf0('0x2a')];if(!_0x5b2bff[_0x6bf0('0x2b')][_0x6bf0('0x31')](_0x6bf0('0x32'))){_0x691cc6[_0x6bf0('0x1b')]=qs[_0x6bf0('0x1b')](_0x5b2bff['query']['limit']);_0x691cc6[_0x6bf0('0x19')]=qs[_0x6bf0('0x19')](_0x5b2bff[_0x6bf0('0x2b')][_0x6bf0('0x19')]);}_0x691cc6[_0x6bf0('0x33')]=qs[_0x6bf0('0x34')](_0x5b2bff[_0x6bf0('0x2b')][_0x6bf0('0x34')]);_0x691cc6[_0x6bf0('0x35')]=qs[_0x6bf0('0x2d')](_[_0x6bf0('0x36')](_0x5b2bff[_0x6bf0('0x2b')],_0x192b66[_0x6bf0('0x2d')]),_0x18b194);if(_0x5b2bff['query'][_0x6bf0('0x37')]){_0x691cc6[_0x6bf0('0x35')]=_['merge'](_0x691cc6[_0x6bf0('0x35')],{'$or':_[_0x6bf0('0x26')](_0x18b194,function(_0x2e9b2a){if(_0x2e9b2a[_0x6bf0('0x28')]!==_0x6bf0('0x38')){var _0x325016={};_0x325016[_0x2e9b2a[_0x6bf0('0x24')]]={'$like':'%'+_0x5b2bff['query'][_0x6bf0('0x37')]+'%'};return _0x325016;}})});}_0x691cc6=_['merge']({},_0x691cc6,_0x5b2bff[_0x6bf0('0x39')]);var _0x501ff5={'where':_0x691cc6[_0x6bf0('0x35')]};return db['DeskAccount'][_0x6bf0('0x1c')](_0x501ff5)[_0x6bf0('0x21')](function(_0x3ba4ff){_0x1dc461[_0x6bf0('0x1c')]=_0x3ba4ff;if(_0x5b2bff[_0x6bf0('0x2b')][_0x6bf0('0x3a')]){_0x691cc6[_0x6bf0('0x3b')]=[{'all':!![]}];}return db[_0x6bf0('0x27')][_0x6bf0('0x3c')](_0x691cc6);})[_0x6bf0('0x21')](function(_0x2c62b2){_0x1dc461[_0x6bf0('0x3d')]=_0x2c62b2;return _0x1dc461;})['then'](respondWithFilteredResult(_0x3a1628,_0x691cc6))['catch'](handleError(_0x3a1628,null));};exports[_0x6bf0('0x3e')]=function(_0x2cbe2e,_0x15bbec){var _0x4cfe11={'raw':![],'where':{'id':_0x2cbe2e[_0x6bf0('0x3f')]['id']}},_0x8e6cd9={};_0x8e6cd9[_0x6bf0('0x2a')]=_[_0x6bf0('0x2c')](db[_0x6bf0('0x27')][_0x6bf0('0x40')]);_0x8e6cd9[_0x6bf0('0x2b')]=_[_0x6bf0('0x2c')](_0x2cbe2e[_0x6bf0('0x2b')]);_0x8e6cd9['filters']=_[_0x6bf0('0x41')](_0x8e6cd9[_0x6bf0('0x2a')],_0x8e6cd9[_0x6bf0('0x2b')]);_0x4cfe11[_0x6bf0('0x2e')]=_['intersection'](_0x8e6cd9[_0x6bf0('0x2a')],qs[_0x6bf0('0x2f')](_0x2cbe2e['query'][_0x6bf0('0x2f')]));_0x4cfe11[_0x6bf0('0x2e')]=_0x4cfe11[_0x6bf0('0x2e')][_0x6bf0('0x30')]?_0x4cfe11[_0x6bf0('0x2e')]:_0x8e6cd9[_0x6bf0('0x2a')];if(_0x2cbe2e[_0x6bf0('0x2b')][_0x6bf0('0x3a')]){_0x4cfe11[_0x6bf0('0x3b')]=[{'all':!![]}];}_0x4cfe11=_['merge']({},_0x4cfe11,_0x2cbe2e['options']);return db[_0x6bf0('0x27')][_0x6bf0('0x42')](_0x4cfe11)[_0x6bf0('0x21')](handleEntityNotFound(_0x15bbec,null))[_0x6bf0('0x21')](respondWithResult(_0x15bbec,null))[_0x6bf0('0x43')](handleError(_0x15bbec,null));};exports[_0x6bf0('0x44')]=function(_0x3fe682,_0x529d1c){return db[_0x6bf0('0x27')][_0x6bf0('0x44')](_0x3fe682[_0x6bf0('0x45')],{})[_0x6bf0('0x21')](respondWithResult(_0x529d1c,0xc9))[_0x6bf0('0x43')](handleError(_0x529d1c,null));};exports['update']=function(_0x4839e6,_0x33dca7){if(_0x4839e6[_0x6bf0('0x45')]['id']){delete _0x4839e6['body']['id'];}return db[_0x6bf0('0x27')]['find']({'where':{'id':_0x4839e6[_0x6bf0('0x3f')]['id']}})[_0x6bf0('0x21')](handleEntityNotFound(_0x33dca7,null))[_0x6bf0('0x21')](saveUpdates(_0x4839e6[_0x6bf0('0x45')],null))[_0x6bf0('0x21')](respondWithResult(_0x33dca7,null))[_0x6bf0('0x43')](handleError(_0x33dca7,null));};exports[_0x6bf0('0x22')]=function(_0x274a8b,_0x5c5f85){return db[_0x6bf0('0x27')]['find']({'where':{'id':_0x274a8b[_0x6bf0('0x3f')]['id']}})[_0x6bf0('0x21')](handleEntityNotFound(_0x5c5f85,null))[_0x6bf0('0x21')](removeEntity(_0x5c5f85,null))[_0x6bf0('0x43')](handleError(_0x5c5f85,null));};exports[_0x6bf0('0x46')]=function(_0x13e97e,_0x4ee30d,_0x195ecc){var _0x21f0f8={};var _0x14134d={};var _0x24e530;var _0x44415a;return db[_0x6bf0('0x27')][_0x6bf0('0x47')]({'where':{'id':_0x13e97e[_0x6bf0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4ee30d,null))['then'](function(_0x36da28){if(_0x36da28){_0x24e530=_0x36da28;_0x14134d['model']=_[_0x6bf0('0x2c')](db[_0x6bf0('0x48')][_0x6bf0('0x40')]);_0x14134d['query']=_[_0x6bf0('0x2c')](_0x13e97e[_0x6bf0('0x2b')]);_0x14134d[_0x6bf0('0x2d')]=_['intersection'](_0x14134d[_0x6bf0('0x2a')],_0x14134d[_0x6bf0('0x2b')]);_0x21f0f8[_0x6bf0('0x2e')]=_[_0x6bf0('0x41')](_0x14134d[_0x6bf0('0x2a')],qs[_0x6bf0('0x2f')](_0x13e97e[_0x6bf0('0x2b')][_0x6bf0('0x2f')]));_0x21f0f8['attributes']=_0x21f0f8['attributes']['length']?_0x21f0f8[_0x6bf0('0x2e')]:_0x14134d[_0x6bf0('0x2a')];_0x21f0f8[_0x6bf0('0x33')]=qs[_0x6bf0('0x34')](_0x13e97e[_0x6bf0('0x2b')]['sort']);_0x21f0f8[_0x6bf0('0x35')]=qs[_0x6bf0('0x2d')](_[_0x6bf0('0x36')](_0x13e97e[_0x6bf0('0x2b')],_0x14134d[_0x6bf0('0x2d')]));if(_0x13e97e[_0x6bf0('0x2b')][_0x6bf0('0x37')]){_0x21f0f8['where']=_[_0x6bf0('0x49')](_0x21f0f8[_0x6bf0('0x35')],{'$or':_[_0x6bf0('0x26')](_0x21f0f8[_0x6bf0('0x2e')],function(_0x43259c){var _0x5a7750={};_0x5a7750[_0x43259c]={'$like':'%'+_0x13e97e[_0x6bf0('0x2b')]['filter']+'%'};return _0x5a7750;})});}_0x21f0f8=_[_0x6bf0('0x49')]({},_0x21f0f8,_0x13e97e[_0x6bf0('0x39')]);return _0x24e530['getConfigurations'](_0x21f0f8);}})[_0x6bf0('0x21')](function(_0x1d713a){if(_0x1d713a){_0x44415a=_0x1d713a[_0x6bf0('0x30')];if(!_0x13e97e[_0x6bf0('0x2b')][_0x6bf0('0x31')](_0x6bf0('0x32'))){_0x21f0f8[_0x6bf0('0x1b')]=qs[_0x6bf0('0x1b')](_0x13e97e[_0x6bf0('0x2b')][_0x6bf0('0x1b')]);_0x21f0f8[_0x6bf0('0x19')]=qs[_0x6bf0('0x19')](_0x13e97e[_0x6bf0('0x2b')][_0x6bf0('0x19')]);}return _0x24e530[_0x6bf0('0x46')](_0x21f0f8);}})['then'](function(_0x3ad4c2){if(_0x3ad4c2){return _0x3ad4c2?{'count':_0x44415a,'rows':_0x3ad4c2}:null;}})[_0x6bf0('0x21')](respondWithResult(_0x4ee30d,null))[_0x6bf0('0x43')](handleError(_0x4ee30d,null));};exports[_0x6bf0('0x4a')]=function(_0x524a67,_0x21d0b6,_0xd9f632){if(_0x524a67[_0x6bf0('0x45')]['id']){delete _0x524a67['body']['id'];}return db[_0x6bf0('0x27')][_0x6bf0('0x47')]({'where':{'id':_0x524a67[_0x6bf0('0x3f')]['id']}})[_0x6bf0('0x21')](handleEntityNotFound(_0x21d0b6,null))[_0x6bf0('0x21')](function(_0xbbd076){if(_0xbbd076){_0x524a67[_0x6bf0('0x45')][_0x6bf0('0x4b')]=_0xbbd076['id'];_0x524a67[_0x6bf0('0x45')][_0x6bf0('0x4c')]=integrations['getSubjects'](_0x524a67[_0x6bf0('0x45')]['channel'],_0x524a67['body']['type']);_0x524a67[_0x6bf0('0x45')]['Descriptions']=integrations[_0x6bf0('0x4d')](_0x524a67['body']['channel'],_0x524a67[_0x6bf0('0x45')][_0x6bf0('0x28')]);return db['DeskConfiguration'][_0x6bf0('0x44')](_0x524a67[_0x6bf0('0x45')],{'include':[{'model':db['DeskField'],'as':_0x6bf0('0x4c')},{'model':db[_0x6bf0('0x4e')],'as':_0x6bf0('0x4f')}]});}return null;})[_0x6bf0('0x21')](respondWithResult(_0x21d0b6,null))[_0x6bf0('0x43')](handleError(_0x21d0b6,null));};exports['getFields']=function(_0x14c6e9,_0xad6aa3,_0x4032f2){var _0x4199c0=[{'name':_0x6bf0('0x50'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2e7954='';return db[_0x6bf0('0x27')][_0x6bf0('0x47')]({'where':{'id':_0x14c6e9[_0x6bf0('0x3f')]['id']},'attributes':['id',_0x6bf0('0x51'),_0x6bf0('0x52'),_0x6bf0('0x53'),_0x6bf0('0x54'),_0x6bf0('0x55'),_0x6bf0('0x56'),_0x6bf0('0x57'),'tokenSecret']})['then'](handleEntityNotFound(_0xad6aa3,null))[_0x6bf0('0x21')](function(_0x1afdcd){if(_0x1afdcd){_0x2e7954=_0x1afdcd['remoteUri'];var _0x53e13f=_0x2e7954[_0x6bf0('0x58')](-0x1);if(_0x53e13f==='/'){_0x2e7954=_0x2e7954[_0x6bf0('0x59')](0x0,_0x2e7954['lastIndexOf'](_0x53e13f));}var _0x4b64c7={'method':_0x6bf0('0x5a'),'uri':util[_0x6bf0('0x5b')](_0x6bf0('0x5c'),_0x2e7954),'headers':{'Content-Type':_0x6bf0('0x5d'),'Accept':'application/json'},'json':!![]};if(_0x1afdcd[_0x6bf0('0x52')]===_0x6bf0('0x5e')){_0x4b64c7[_0x6bf0('0x5f')][_0x6bf0('0x60')]=util['format'](_0x6bf0('0x61'),new Buffer(util[_0x6bf0('0x5b')](_0x6bf0('0x62'),_0x1afdcd['username'],_0x1afdcd['password']))[_0x6bf0('0x63')](_0x6bf0('0x64')));}return rp(_0x4b64c7)['then'](function(_0x525c42){return _0x4199c0[_0x6bf0('0x65')](_['map'](_0x525c42[_0x6bf0('0x66')][_0x6bf0('0x67')],function(_0x18c3f7){return{'id':_0x18c3f7[_0x6bf0('0x24')],'name':_0x18c3f7[_0x6bf0('0x24')],'type':_0x18c3f7[_0x6bf0('0x28')],'active':_0x18c3f7[_0x6bf0('0x68')],'label':_0x18c3f7[_0x6bf0('0x69')],'custom':!![]};}));});}})[_0x6bf0('0x21')](function(_0x285402){return{'count':_0x285402[_0x6bf0('0x30')],'rows':_0x285402};})[_0x6bf0('0x21')](respondWithResult(_0xad6aa3,null))[_0x6bf0('0x43')](function(_0x23844a){var _0x1fe2bb=_0x14c6e9[_0x6bf0('0x2b')][_0x6bf0('0x6a')]?0x1f4:_0x23844a['statusCode']||0x1f4;logger[_0x6bf0('0x6b')](_0x6bf0('0x6c'),_0x6bf0('0x6d'),_0x1fe2bb,JSON[_0x6bf0('0x6e')](_0x23844a));delete _0x23844a[_0x6bf0('0x24')];if(_0x1fe2bb===0x191){_0x1fe2bb=0x190;}_0xad6aa3['status'](_0x1fe2bb)['send'](_0x14c6e9[_0x6bf0('0x2b')][_0x6bf0('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x23844a[_0x6bf0('0x6f')]}:_0x23844a);});}; \ No newline at end of file +var _0x1b31=['fs-extra','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','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','count','offset','limit','set','reject','save','update','then','destroy','end','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','length','find','body','findOne','DeskConfiguration','hasOwnProperty','nolimit','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','create','DeskField','priority','remoteUri','username','password','consumerKey','consumerSecret','token','slice','substring','GET','format','%s/custom_fields','application/json','authType','headers','Authorization','%s:%s','base64','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x28e934,_0x28b6d7){var _0x1c167b=function(_0x6af5e2){while(--_0x6af5e2){_0x28e934['push'](_0x28e934['shift']());}};_0x1c167b(++_0x28b6d7);}(_0x1b31,0x1bf));var _0x11b3=function(_0x560115,_0xd1c404){_0x560115=_0x560115-0x0;var _0x306d28=_0x1b31[_0x560115];return _0x306d28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x11b3('0x0'));var zipdir=require(_0x11b3('0x1'));var jsonpatch=require(_0x11b3('0x2'));var rp=require(_0x11b3('0x3'));var moment=require(_0x11b3('0x4'));var BPromise=require(_0x11b3('0x5'));var Mustache=require(_0x11b3('0x6'));var util=require(_0x11b3('0x7'));var path=require(_0x11b3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x11b3('0x9'));var _=require('lodash');var squel=require(_0x11b3('0xa'));var crypto=require(_0x11b3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x11b3('0xc'));var toCsv=require(_0x11b3('0xd'));var querystring=require(_0x11b3('0xe'));var Papa=require('papaparse');var Redis=require(_0x11b3('0xf'));var authService=require(_0x11b3('0x10'));var qs=require(_0x11b3('0x11'));var as=require(_0x11b3('0x12'));var hardwareService=require(_0x11b3('0x13'));var logger=require(_0x11b3('0x14'))(_0x11b3('0x15'));var utils=require(_0x11b3('0x16'));var config=require(_0x11b3('0x17'));var licenseUtil=require(_0x11b3('0x18'));var db=require(_0x11b3('0x19'))['db'];var integrations=require(_0x11b3('0x1a'));function respondWithStatusCode(_0x41ded6,_0xd19591){_0xd19591=_0xd19591||0xcc;return function(_0x3c0059){if(_0x3c0059){return _0x41ded6[_0x11b3('0x1b')](_0xd19591);}return _0x41ded6['status'](_0xd19591)['end']();};}function respondWithResult(_0x34744c,_0x110225){_0x110225=_0x110225||0xc8;return function(_0x50c50d){if(_0x50c50d){return _0x34744c[_0x11b3('0x1c')](_0x110225)[_0x11b3('0x1d')](_0x50c50d);}};}function respondWithFilteredResult(_0x57eb8b,_0x2e1e9c){return function(_0x36c5af){if(_0x36c5af){var _0x100ed8=typeof _0x2e1e9c['offset']===_0x11b3('0x1e')&&typeof _0x2e1e9c['limit']==='undefined';var _0xb03e05=_0x36c5af[_0x11b3('0x1f')];var _0x2cd857=_0x100ed8?0x0:_0x2e1e9c[_0x11b3('0x20')];var _0x2c197e=_0x100ed8?_0x36c5af['count']:_0x2e1e9c[_0x11b3('0x20')]+_0x2e1e9c[_0x11b3('0x21')];var _0x241cdd;if(_0x2c197e>=_0xb03e05){_0x2c197e=_0xb03e05;_0x241cdd=0xc8;}else{_0x241cdd=0xce;}_0x57eb8b[_0x11b3('0x1c')](_0x241cdd);return _0x57eb8b[_0x11b3('0x22')]('Content-Range',_0x2cd857+'-'+_0x2c197e+'/'+_0xb03e05)[_0x11b3('0x1d')](_0x36c5af);}return null;};}function patchUpdates(_0x4d1889){return function(_0x538f54){try{jsonpatch['apply'](_0x538f54,_0x4d1889,!![]);}catch(_0x194b16){return BPromise[_0x11b3('0x23')](_0x194b16);}return _0x538f54[_0x11b3('0x24')]();};}function saveUpdates(_0x436676,_0x9ae44f){return function(_0x3f5cb8){if(_0x3f5cb8){return _0x3f5cb8[_0x11b3('0x25')](_0x436676)[_0x11b3('0x26')](function(_0x1651bd){return _0x1651bd;});}return null;};}function removeEntity(_0x4dbc71,_0x369d78){return function(_0x5d9b54){if(_0x5d9b54){return _0x5d9b54[_0x11b3('0x27')]()['then'](function(){_0x4dbc71[_0x11b3('0x1c')](0xcc)[_0x11b3('0x28')]();});}};}function handleEntityNotFound(_0x20e4f5,_0x4136af){return function(_0x521be2){if(!_0x521be2){_0x20e4f5[_0x11b3('0x1b')](0x194);}return _0x521be2;};}function handleError(_0x9a5bf2,_0x365ff2){_0x365ff2=_0x365ff2||0x1f4;return function(_0x59e951){logger[_0x11b3('0x29')](_0x59e951[_0x11b3('0x2a')]);if(_0x59e951[_0x11b3('0x2b')]){delete _0x59e951[_0x11b3('0x2b')];}_0x9a5bf2[_0x11b3('0x1c')](_0x365ff2)[_0x11b3('0x2c')](_0x59e951);};}exports[_0x11b3('0x2d')]=function(_0x21c633,_0x41be8c){var _0x1123ba={},_0x1f4c1e={},_0x47c91e={'count':0x0,'rows':[]};var _0xebed0e=_[_0x11b3('0x2e')](db[_0x11b3('0x2f')][_0x11b3('0x30')],function(_0x1a3a90){return{'name':_0x1a3a90[_0x11b3('0x31')],'type':_0x1a3a90[_0x11b3('0x32')][_0x11b3('0x33')]};});_0x1f4c1e[_0x11b3('0x34')]=_[_0x11b3('0x2e')](_0xebed0e,_0x11b3('0x2b'));_0x1f4c1e[_0x11b3('0x35')]=_[_0x11b3('0x36')](_0x21c633[_0x11b3('0x35')]);_0x1f4c1e[_0x11b3('0x37')]=_[_0x11b3('0x38')](_0x1f4c1e[_0x11b3('0x34')],_0x1f4c1e[_0x11b3('0x35')]);_0x1123ba['attributes']=_[_0x11b3('0x38')](_0x1f4c1e[_0x11b3('0x34')],qs['fields'](_0x21c633[_0x11b3('0x35')]['fields']));_0x1123ba[_0x11b3('0x39')]=_0x1123ba[_0x11b3('0x39')]['length']?_0x1123ba[_0x11b3('0x39')]:_0x1f4c1e[_0x11b3('0x34')];if(!_0x21c633[_0x11b3('0x35')]['hasOwnProperty']('nolimit')){_0x1123ba[_0x11b3('0x21')]=qs['limit'](_0x21c633[_0x11b3('0x35')][_0x11b3('0x21')]);_0x1123ba[_0x11b3('0x20')]=qs[_0x11b3('0x20')](_0x21c633[_0x11b3('0x35')][_0x11b3('0x20')]);}_0x1123ba['order']=qs['sort'](_0x21c633[_0x11b3('0x35')][_0x11b3('0x3a')]);_0x1123ba[_0x11b3('0x3b')]=qs[_0x11b3('0x37')](_[_0x11b3('0x3c')](_0x21c633[_0x11b3('0x35')],_0x1f4c1e['filters']),_0xebed0e);if(_0x21c633[_0x11b3('0x35')][_0x11b3('0x3d')]){_0x1123ba[_0x11b3('0x3b')]=_[_0x11b3('0x3e')](_0x1123ba[_0x11b3('0x3b')],{'$or':_[_0x11b3('0x2e')](_0xebed0e,function(_0x5b9a19){if(_0x5b9a19[_0x11b3('0x32')]!==_0x11b3('0x3f')){var _0x2a14d1={};_0x2a14d1[_0x5b9a19[_0x11b3('0x2b')]]={'$like':'%'+_0x21c633[_0x11b3('0x35')][_0x11b3('0x3d')]+'%'};return _0x2a14d1;}})});}_0x1123ba=_[_0x11b3('0x3e')]({},_0x1123ba,_0x21c633[_0x11b3('0x40')]);var _0x5bfd0d={'where':_0x1123ba[_0x11b3('0x3b')]};return db[_0x11b3('0x2f')][_0x11b3('0x1f')](_0x5bfd0d)[_0x11b3('0x26')](function(_0x2f69f9){_0x47c91e[_0x11b3('0x1f')]=_0x2f69f9;if(_0x21c633[_0x11b3('0x35')][_0x11b3('0x41')]){_0x1123ba[_0x11b3('0x42')]=[{'all':!![]}];}return db[_0x11b3('0x2f')][_0x11b3('0x43')](_0x1123ba);})[_0x11b3('0x26')](function(_0x2e5d52){_0x47c91e[_0x11b3('0x44')]=_0x2e5d52;return _0x47c91e;})[_0x11b3('0x26')](respondWithFilteredResult(_0x41be8c,_0x1123ba))[_0x11b3('0x45')](handleError(_0x41be8c,null));};exports['show']=function(_0x45cf3e,_0x2a9ff7){var _0x5b4be6={'raw':![],'where':{'id':_0x45cf3e[_0x11b3('0x46')]['id']}},_0x2150fd={};_0x2150fd[_0x11b3('0x34')]=_['keys'](db[_0x11b3('0x2f')][_0x11b3('0x30')]);_0x2150fd[_0x11b3('0x35')]=_[_0x11b3('0x36')](_0x45cf3e[_0x11b3('0x35')]);_0x2150fd['filters']=_[_0x11b3('0x38')](_0x2150fd['model'],_0x2150fd[_0x11b3('0x35')]);_0x5b4be6[_0x11b3('0x39')]=_['intersection'](_0x2150fd[_0x11b3('0x34')],qs[_0x11b3('0x47')](_0x45cf3e[_0x11b3('0x35')]['fields']));_0x5b4be6[_0x11b3('0x39')]=_0x5b4be6[_0x11b3('0x39')][_0x11b3('0x48')]?_0x5b4be6[_0x11b3('0x39')]:_0x2150fd['model'];if(_0x45cf3e[_0x11b3('0x35')][_0x11b3('0x41')]){_0x5b4be6[_0x11b3('0x42')]=[{'all':!![]}];}_0x5b4be6=_[_0x11b3('0x3e')]({},_0x5b4be6,_0x45cf3e[_0x11b3('0x40')]);return db['DeskAccount'][_0x11b3('0x49')](_0x5b4be6)[_0x11b3('0x26')](handleEntityNotFound(_0x2a9ff7,null))[_0x11b3('0x26')](respondWithResult(_0x2a9ff7,null))[_0x11b3('0x45')](handleError(_0x2a9ff7,null));};exports['create']=function(_0x3a8cc8,_0x3f854c){return db['DeskAccount']['create'](_0x3a8cc8['body'],{})[_0x11b3('0x26')](respondWithResult(_0x3f854c,0xc9))[_0x11b3('0x45')](handleError(_0x3f854c,null));};exports['update']=function(_0x21d314,_0x561c3d){if(_0x21d314[_0x11b3('0x4a')]['id']){delete _0x21d314['body']['id'];}return db['DeskAccount'][_0x11b3('0x49')]({'where':{'id':_0x21d314[_0x11b3('0x46')]['id']}})[_0x11b3('0x26')](handleEntityNotFound(_0x561c3d,null))[_0x11b3('0x26')](saveUpdates(_0x21d314['body'],null))[_0x11b3('0x26')](respondWithResult(_0x561c3d,null))[_0x11b3('0x45')](handleError(_0x561c3d,null));};exports['destroy']=function(_0x8f5850,_0x43d77a){return db[_0x11b3('0x2f')]['find']({'where':{'id':_0x8f5850['params']['id']}})[_0x11b3('0x26')](handleEntityNotFound(_0x43d77a,null))['then'](removeEntity(_0x43d77a,null))['catch'](handleError(_0x43d77a,null));};exports['getConfigurations']=function(_0x196927,_0x4dc6c7,_0x5519be){var _0x3a2b3e={};var _0x43276f={};var _0x5a45be;var _0x2ec239;return db['DeskAccount'][_0x11b3('0x4b')]({'where':{'id':_0x196927[_0x11b3('0x46')]['id']}})[_0x11b3('0x26')](handleEntityNotFound(_0x4dc6c7,null))[_0x11b3('0x26')](function(_0x3b892b){if(_0x3b892b){_0x5a45be=_0x3b892b;_0x43276f[_0x11b3('0x34')]=_[_0x11b3('0x36')](db[_0x11b3('0x4c')][_0x11b3('0x30')]);_0x43276f['query']=_['keys'](_0x196927[_0x11b3('0x35')]);_0x43276f[_0x11b3('0x37')]=_[_0x11b3('0x38')](_0x43276f[_0x11b3('0x34')],_0x43276f[_0x11b3('0x35')]);_0x3a2b3e[_0x11b3('0x39')]=_[_0x11b3('0x38')](_0x43276f[_0x11b3('0x34')],qs[_0x11b3('0x47')](_0x196927[_0x11b3('0x35')][_0x11b3('0x47')]));_0x3a2b3e['attributes']=_0x3a2b3e[_0x11b3('0x39')]['length']?_0x3a2b3e[_0x11b3('0x39')]:_0x43276f['model'];_0x3a2b3e['order']=qs['sort'](_0x196927[_0x11b3('0x35')][_0x11b3('0x3a')]);_0x3a2b3e[_0x11b3('0x3b')]=qs[_0x11b3('0x37')](_['pick'](_0x196927[_0x11b3('0x35')],_0x43276f[_0x11b3('0x37')]));if(_0x196927[_0x11b3('0x35')][_0x11b3('0x3d')]){_0x3a2b3e[_0x11b3('0x3b')]=_['merge'](_0x3a2b3e[_0x11b3('0x3b')],{'$or':_[_0x11b3('0x2e')](_0x3a2b3e[_0x11b3('0x39')],function(_0x5045d3){var _0x44e4bc={};_0x44e4bc[_0x5045d3]={'$like':'%'+_0x196927[_0x11b3('0x35')][_0x11b3('0x3d')]+'%'};return _0x44e4bc;})});}_0x3a2b3e=_['merge']({},_0x3a2b3e,_0x196927['options']);return _0x5a45be['getConfigurations'](_0x3a2b3e);}})[_0x11b3('0x26')](function(_0x1cd9a7){if(_0x1cd9a7){_0x2ec239=_0x1cd9a7['length'];if(!_0x196927[_0x11b3('0x35')][_0x11b3('0x4d')](_0x11b3('0x4e'))){_0x3a2b3e[_0x11b3('0x21')]=qs[_0x11b3('0x21')](_0x196927[_0x11b3('0x35')][_0x11b3('0x21')]);_0x3a2b3e['offset']=qs[_0x11b3('0x20')](_0x196927[_0x11b3('0x35')]['offset']);}return _0x5a45be[_0x11b3('0x4f')](_0x3a2b3e);}})[_0x11b3('0x26')](function(_0xcc728d){if(_0xcc728d){return _0xcc728d?{'count':_0x2ec239,'rows':_0xcc728d}:null;}})['then'](respondWithResult(_0x4dc6c7,null))[_0x11b3('0x45')](handleError(_0x4dc6c7,null));};exports[_0x11b3('0x50')]=function(_0x46e519,_0x1f2de5,_0x4e462b){if(_0x46e519[_0x11b3('0x4a')]['id']){delete _0x46e519[_0x11b3('0x4a')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x46e519[_0x11b3('0x46')]['id']}})[_0x11b3('0x26')](handleEntityNotFound(_0x1f2de5,null))[_0x11b3('0x26')](function(_0x5c639f){if(_0x5c639f){_0x46e519['body'][_0x11b3('0x51')]=_0x5c639f['id'];_0x46e519['body'][_0x11b3('0x52')]=integrations['getSubjects'](_0x46e519[_0x11b3('0x4a')][_0x11b3('0x53')],_0x46e519[_0x11b3('0x4a')][_0x11b3('0x32')]);_0x46e519['body'][_0x11b3('0x54')]=integrations[_0x11b3('0x55')](_0x46e519[_0x11b3('0x4a')][_0x11b3('0x53')],_0x46e519[_0x11b3('0x4a')][_0x11b3('0x32')]);return db['DeskConfiguration'][_0x11b3('0x56')](_0x46e519[_0x11b3('0x4a')],{'include':[{'model':db['DeskField'],'as':_0x11b3('0x52')},{'model':db[_0x11b3('0x57')],'as':'Descriptions'}]});}return null;})[_0x11b3('0x26')](respondWithResult(_0x1f2de5,null))['catch'](handleError(_0x1f2de5,null));};exports['getFields']=function(_0x38b38c,_0x508c2f,_0x10c3a1){var _0x307926=[{'name':_0x11b3('0x58'),'label':_0x11b3('0x58'),'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 _0x42e9c4='';return db['DeskAccount']['findOne']({'where':{'id':_0x38b38c[_0x11b3('0x46')]['id']},'attributes':['id',_0x11b3('0x59'),'authType',_0x11b3('0x5a'),_0x11b3('0x5b'),_0x11b3('0x5c'),_0x11b3('0x5d'),_0x11b3('0x5e'),'tokenSecret']})['then'](handleEntityNotFound(_0x508c2f,null))[_0x11b3('0x26')](function(_0x400b91){if(_0x400b91){_0x42e9c4=_0x400b91['remoteUri'];var _0x49f96d=_0x42e9c4[_0x11b3('0x5f')](-0x1);if(_0x49f96d==='/'){_0x42e9c4=_0x42e9c4[_0x11b3('0x60')](0x0,_0x42e9c4['lastIndexOf'](_0x49f96d));}var _0x24a8e5={'method':_0x11b3('0x61'),'uri':util[_0x11b3('0x62')](_0x11b3('0x63'),_0x42e9c4),'headers':{'Content-Type':_0x11b3('0x64'),'Accept':'application/json'},'json':!![]};if(_0x400b91[_0x11b3('0x65')]==='basic'){_0x24a8e5[_0x11b3('0x66')][_0x11b3('0x67')]=util['format']('Basic\x20%s',new Buffer(util[_0x11b3('0x62')](_0x11b3('0x68'),_0x400b91[_0x11b3('0x5a')],_0x400b91[_0x11b3('0x5b')]))['toString'](_0x11b3('0x69')));}return rp(_0x24a8e5)[_0x11b3('0x26')](function(_0x121525){return _0x307926[_0x11b3('0x6a')](_[_0x11b3('0x2e')](_0x121525['_embedded'][_0x11b3('0x6b')],function(_0x4a4757){return{'id':_0x4a4757[_0x11b3('0x2b')],'name':_0x4a4757['name'],'type':_0x4a4757[_0x11b3('0x32')],'active':_0x4a4757[_0x11b3('0x6c')],'label':_0x4a4757[_0x11b3('0x6d')],'custom':!![]};}));});}})[_0x11b3('0x26')](function(_0x29a3f9){return{'count':_0x29a3f9[_0x11b3('0x48')],'rows':_0x29a3f9};})[_0x11b3('0x26')](respondWithResult(_0x508c2f,null))['catch'](function(_0x2d8afc){var _0x57aa39=_0x38b38c[_0x11b3('0x35')]['test']?0x1f4:_0x2d8afc[_0x11b3('0x6e')]||0x1f4;logger['error'](_0x11b3('0x6f'),_0x11b3('0x70'),_0x57aa39,JSON['stringify'](_0x2d8afc));delete _0x2d8afc[_0x11b3('0x2b')];if(_0x57aa39===0x191){_0x57aa39=0x190;}_0x508c2f[_0x11b3('0x1c')](_0x57aa39)[_0x11b3('0x2c')](_0x38b38c[_0x11b3('0x35')]['test']?{'message':_0x11b3('0x71'),'statusCode':_0x2d8afc['statusCode']}:_0x2d8afc);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index a3befde..19f7d48 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 _0x6a1a=['bluebird','rimraf','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment'];(function(_0x56f6bf,_0x15b0b4){var _0x3f44fe=function(_0x43acc2){while(--_0x43acc2){_0x56f6bf['push'](_0x56f6bf['shift']());}};_0x3f44fe(++_0x15b0b4);}(_0x6a1a,0x8b));var _0xa6a1=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x6a1a[_0xc8a931];return _0x28bd27;};'use strict';var _=require(_0xa6a1('0x0'));var util=require(_0xa6a1('0x1'));var logger=require('../../config/logger')(_0xa6a1('0x2'));var moment=require(_0xa6a1('0x3'));var BPromise=require(_0xa6a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa6a1('0x5'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xa6a1('0x6'));module[_0xa6a1('0x7')]=function(_0x34720e,_0x3b81b3){return _0x34720e[_0xa6a1('0x8')](_0xa6a1('0x9'),attributes,{'tableName':_0xa6a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5481=['api','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5481,0x165));var _0x1548=function(_0x377ae7,_0x4faa35){_0x377ae7=_0x377ae7-0x0;var _0xfcf766=_0x5481[_0x377ae7];return _0xfcf766;};'use strict';var _=require(_0x1548('0x0'));var util=require(_0x1548('0x1'));var logger=require(_0x1548('0x2'))(_0x1548('0x3'));var moment=require('moment');var BPromise=require(_0x1548('0x4'));var rp=require(_0x1548('0x5'));var fs=require('fs');var path=require(_0x1548('0x6'));var rimraf=require(_0x1548('0x7'));var config=require('../../config/environment');var attributes=require(_0x1548('0x8'));var integrations=require(_0x1548('0x9'));module[_0x1548('0xa')]=function(_0x27b53b,_0x34e95c){return _0x27b53b['define']('DeskAccount',attributes,{'tableName':_0x1548('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 84151c0..5bb039e 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 _0x4adb=['DeskAccount','options','raw','where','attributes','limit','map','include','model','stringify','ShowDeskAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDeskAccount'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0x4adb,0x16a));var _0xb4ad=function(_0x4e92bd,_0x56ab53){_0x4e92bd=_0x4e92bd-0x0;var _0x2e0801=_0x4adb[_0x4e92bd];return _0x2e0801;};'use strict';var _=require(_0xb4ad('0x0'));var util=require(_0xb4ad('0x1'));var moment=require(_0xb4ad('0x2'));var BPromise=require(_0xb4ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4ad('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4ad('0x5'));var logger=require(_0xb4ad('0x6'))(_0xb4ad('0x7'));var config=require(_0xb4ad('0x8'));var jayson=require(_0xb4ad('0x9'));var client=jayson['client'][_0xb4ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d1d61,_0x3d7c0b,_0x5436c3){return new BPromise(function(_0x4d5c28,_0x41de2b){return client['request'](_0x4d1d61,_0x5436c3)[_0xb4ad('0xb')](function(_0x590136){logger[_0xb4ad('0xc')](_0xb4ad('0xd'),_0x3d7c0b,_0xb4ad('0xe'));logger[_0xb4ad('0xf')](_0xb4ad('0x10'),_0x3d7c0b,'request\x20sent',JSON['stringify'](_0x590136));if(_0x590136['error']){if(_0x590136[_0xb4ad('0x11')][_0xb4ad('0x12')]===0x1f4){logger[_0xb4ad('0x11')](_0xb4ad('0xd'),_0x3d7c0b,_0x590136[_0xb4ad('0x11')]['message']);return _0x41de2b(_0x590136[_0xb4ad('0x11')]['message']);}logger[_0xb4ad('0x11')](_0xb4ad('0xd'),_0x3d7c0b,_0x590136[_0xb4ad('0x11')][_0xb4ad('0x13')]);return _0x4d5c28(_0x590136[_0xb4ad('0x11')]['message']);}else{logger['info'](_0xb4ad('0xd'),_0x3d7c0b,_0xb4ad('0xe'));_0x4d5c28(_0x590136[_0xb4ad('0x14')]['message']);}})[_0xb4ad('0x15')](function(_0x1f26f9){logger['error'](_0xb4ad('0xd'),_0x3d7c0b,_0x1f26f9);_0x41de2b(_0x1f26f9);});});}exports[_0xb4ad('0x16')]=function(_0x7bc916){var _0x51b7b9=this;return new Promise(function(_0x5798f4,_0x23df5d){return db[_0xb4ad('0x17')]['findAll']({'raw':_0x7bc916['options']?_0x7bc916[_0xb4ad('0x18')][_0xb4ad('0x19')]===undefined?!![]:![]:!![],'where':_0x7bc916[_0xb4ad('0x18')]?_0x7bc916[_0xb4ad('0x18')][_0xb4ad('0x1a')]||null:null,'attributes':_0x7bc916[_0xb4ad('0x18')]?_0x7bc916[_0xb4ad('0x18')][_0xb4ad('0x1b')]||null:null,'limit':_0x7bc916['options']?_0x7bc916[_0xb4ad('0x18')][_0xb4ad('0x1c')]||null:null,'include':_0x7bc916[_0xb4ad('0x18')]?_0x7bc916[_0xb4ad('0x18')]['include']?_[_0xb4ad('0x1d')](_0x7bc916[_0xb4ad('0x18')][_0xb4ad('0x1e')],function(_0x25fc3b){return{'model':db[_0x25fc3b[_0xb4ad('0x1f')]],'as':_0x25fc3b['as'],'attributes':_0x25fc3b[_0xb4ad('0x1b')],'include':_0x25fc3b[_0xb4ad('0x1e')]?_[_0xb4ad('0x1d')](_0x25fc3b[_0xb4ad('0x1e')],function(_0x4eca1d){return{'model':db[_0x4eca1d['model']],'as':_0x4eca1d['as'],'attributes':_0x4eca1d[_0xb4ad('0x1b')],'include':_0x4eca1d[_0xb4ad('0x1e')]?_['map'](_0x4eca1d[_0xb4ad('0x1e')],function(_0xc45e9e){return{'model':db[_0xc45e9e[_0xb4ad('0x1f')]],'as':_0xc45e9e['as'],'attributes':_0xc45e9e[_0xb4ad('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb4ad('0xb')](function(_0x5952ff){logger[_0xb4ad('0xc')](_0xb4ad('0x16'),_0x7bc916);logger[_0xb4ad('0xf')](_0xb4ad('0x16'),_0x7bc916,JSON[_0xb4ad('0x20')](_0x5952ff));_0x5798f4(_0x5952ff);})[_0xb4ad('0x15')](function(_0x481124){logger['error'](_0xb4ad('0x16'),_0x481124[_0xb4ad('0x13')],_0x7bc916);_0x23df5d(_0x51b7b9[_0xb4ad('0x11')](0x1f4,_0x481124[_0xb4ad('0x13')]));});});};exports[_0xb4ad('0x21')]=function(_0x422177){var _0x258ff1=this;return new Promise(function(_0x30fb0d,_0x48ff6f){return db[_0xb4ad('0x17')][_0xb4ad('0x22')]({'raw':_0x422177[_0xb4ad('0x18')]?_0x422177[_0xb4ad('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x422177[_0xb4ad('0x18')]?_0x422177['options']['where']||null:null,'attributes':_0x422177[_0xb4ad('0x18')]?_0x422177[_0xb4ad('0x18')][_0xb4ad('0x1b')]||null:null,'include':_0x422177[_0xb4ad('0x18')]?_0x422177[_0xb4ad('0x18')][_0xb4ad('0x1e')]?_[_0xb4ad('0x1d')](_0x422177[_0xb4ad('0x18')][_0xb4ad('0x1e')],function(_0x259a30){return{'model':db[_0x259a30[_0xb4ad('0x1f')]],'as':_0x259a30['as'],'attributes':_0x259a30[_0xb4ad('0x1b')],'include':_0x259a30[_0xb4ad('0x1e')]?_[_0xb4ad('0x1d')](_0x259a30[_0xb4ad('0x1e')],function(_0x34d600){return{'model':db[_0x34d600[_0xb4ad('0x1f')]],'as':_0x34d600['as'],'attributes':_0x34d600[_0xb4ad('0x1b')],'include':_0x34d600['include']?_[_0xb4ad('0x1d')](_0x34d600[_0xb4ad('0x1e')],function(_0x111e78){return{'model':db[_0x111e78[_0xb4ad('0x1f')]],'as':_0x111e78['as'],'attributes':_0x111e78[_0xb4ad('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb4ad('0xb')](function(_0x457022){logger['info']('ShowDeskAccount',_0x422177);logger[_0xb4ad('0xf')](_0xb4ad('0x21'),_0x422177,JSON['stringify'](_0x457022));_0x30fb0d(_0x457022);})['catch'](function(_0x258bce){logger[_0xb4ad('0x11')](_0xb4ad('0x21'),_0x258bce['message'],_0x422177);_0x48ff6f(_0x258ff1[_0xb4ad('0x11')](0x1f4,_0x258bce[_0xb4ad('0x13')]));});});}; \ No newline at end of file +var _0x1134=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','findAll','options','where','limit','map','include','model','attributes','GetDeskAccount','ShowDeskAccount','find','debug','stringify','lodash','util'];(function(_0x30e644,_0x361e4a){var _0x2962a0=function(_0x561d20){while(--_0x561d20){_0x30e644['push'](_0x30e644['shift']());}};_0x2962a0(++_0x361e4a);}(_0x1134,0x195));var _0x4113=function(_0x3df75f,_0x37a798){_0x3df75f=_0x3df75f-0x0;var _0x3e63b1=_0x1134[_0x3df75f];return _0x3e63b1;};'use strict';var _=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var moment=require(_0x4113('0x2'));var BPromise=require(_0x4113('0x3'));var rs=require(_0x4113('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4113('0x5'))['db'];var utils=require(_0x4113('0x6'));var logger=require(_0x4113('0x7'))(_0x4113('0x8'));var config=require(_0x4113('0x9'));var jayson=require(_0x4113('0xa'));var client=jayson[_0x4113('0xb')][_0x4113('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x184d3f,_0x27dd68,_0x10b01d){return new BPromise(function(_0x19f7e5,_0x2f4b29){return client[_0x4113('0xd')](_0x184d3f,_0x10b01d)[_0x4113('0xe')](function(_0x35402b){logger['info'](_0x4113('0xf'),_0x27dd68,_0x4113('0x10'));logger['debug'](_0x4113('0x11'),_0x27dd68,_0x4113('0x10'),JSON['stringify'](_0x35402b));if(_0x35402b[_0x4113('0x12')]){if(_0x35402b[_0x4113('0x12')][_0x4113('0x13')]===0x1f4){logger[_0x4113('0x12')](_0x4113('0xf'),_0x27dd68,_0x35402b[_0x4113('0x12')][_0x4113('0x14')]);return _0x2f4b29(_0x35402b[_0x4113('0x12')][_0x4113('0x14')]);}logger[_0x4113('0x12')]('DeskAccount,\x20%s,\x20%s',_0x27dd68,_0x35402b[_0x4113('0x12')][_0x4113('0x14')]);return _0x19f7e5(_0x35402b[_0x4113('0x12')][_0x4113('0x14')]);}else{logger[_0x4113('0x15')](_0x4113('0xf'),_0x27dd68,'request\x20sent');_0x19f7e5(_0x35402b[_0x4113('0x16')][_0x4113('0x14')]);}})[_0x4113('0x17')](function(_0x29cb96){logger[_0x4113('0x12')]('DeskAccount,\x20%s,\x20%s',_0x27dd68,_0x29cb96);_0x2f4b29(_0x29cb96);});});}exports['GetDeskAccount']=function(_0x7f75b7){var _0x2f40ae=this;return new Promise(function(_0x51cc70,_0x2ce11b){return db['DeskAccount'][_0x4113('0x18')]({'raw':_0x7f75b7['options']?_0x7f75b7['options']['raw']===undefined?!![]:![]:!![],'where':_0x7f75b7[_0x4113('0x19')]?_0x7f75b7[_0x4113('0x19')][_0x4113('0x1a')]||null:null,'attributes':_0x7f75b7[_0x4113('0x19')]?_0x7f75b7['options']['attributes']||null:null,'limit':_0x7f75b7['options']?_0x7f75b7['options'][_0x4113('0x1b')]||null:null,'include':_0x7f75b7['options']?_0x7f75b7[_0x4113('0x19')]['include']?_[_0x4113('0x1c')](_0x7f75b7[_0x4113('0x19')][_0x4113('0x1d')],function(_0x44c4bb){return{'model':db[_0x44c4bb[_0x4113('0x1e')]],'as':_0x44c4bb['as'],'attributes':_0x44c4bb[_0x4113('0x1f')],'include':_0x44c4bb[_0x4113('0x1d')]?_[_0x4113('0x1c')](_0x44c4bb[_0x4113('0x1d')],function(_0x2c7bc8){return{'model':db[_0x2c7bc8[_0x4113('0x1e')]],'as':_0x2c7bc8['as'],'attributes':_0x2c7bc8[_0x4113('0x1f')],'include':_0x2c7bc8[_0x4113('0x1d')]?_[_0x4113('0x1c')](_0x2c7bc8[_0x4113('0x1d')],function(_0x32d000){return{'model':db[_0x32d000[_0x4113('0x1e')]],'as':_0x32d000['as'],'attributes':_0x32d000[_0x4113('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b9bf9){logger[_0x4113('0x15')]('GetDeskAccount',_0x7f75b7);logger['debug'](_0x4113('0x20'),_0x7f75b7,JSON['stringify'](_0x4b9bf9));_0x51cc70(_0x4b9bf9);})[_0x4113('0x17')](function(_0x56d68f){logger[_0x4113('0x12')]('GetDeskAccount',_0x56d68f[_0x4113('0x14')],_0x7f75b7);_0x2ce11b(_0x2f40ae[_0x4113('0x12')](0x1f4,_0x56d68f[_0x4113('0x14')]));});});};exports[_0x4113('0x21')]=function(_0x54ea26){var _0x20de05=this;return new Promise(function(_0x2b9359,_0x1f92fc){return db['DeskAccount'][_0x4113('0x22')]({'raw':_0x54ea26[_0x4113('0x19')]?_0x54ea26[_0x4113('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x54ea26[_0x4113('0x19')]?_0x54ea26['options'][_0x4113('0x1a')]||null:null,'attributes':_0x54ea26[_0x4113('0x19')]?_0x54ea26[_0x4113('0x19')][_0x4113('0x1f')]||null:null,'include':_0x54ea26[_0x4113('0x19')]?_0x54ea26['options'][_0x4113('0x1d')]?_[_0x4113('0x1c')](_0x54ea26['options'][_0x4113('0x1d')],function(_0x1fa206){return{'model':db[_0x1fa206[_0x4113('0x1e')]],'as':_0x1fa206['as'],'attributes':_0x1fa206[_0x4113('0x1f')],'include':_0x1fa206[_0x4113('0x1d')]?_[_0x4113('0x1c')](_0x1fa206[_0x4113('0x1d')],function(_0x26d424){return{'model':db[_0x26d424[_0x4113('0x1e')]],'as':_0x26d424['as'],'attributes':_0x26d424[_0x4113('0x1f')],'include':_0x26d424[_0x4113('0x1d')]?_[_0x4113('0x1c')](_0x26d424[_0x4113('0x1d')],function(_0x295453){return{'model':db[_0x295453[_0x4113('0x1e')]],'as':_0x295453['as'],'attributes':_0x295453[_0x4113('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fb7bc){logger[_0x4113('0x15')](_0x4113('0x21'),_0x54ea26);logger[_0x4113('0x23')](_0x4113('0x21'),_0x54ea26,JSON[_0x4113('0x24')](_0x3fb7bc));_0x2b9359(_0x3fb7bc);})[_0x4113('0x17')](function(_0x51524f){logger[_0x4113('0x12')](_0x4113('0x21'),_0x51524f[_0x4113('0x14')],_0x54ea26);_0x1f92fc(_0x20de05[_0x4113('0x12')](0x1f4,_0x51524f[_0x4113('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index b88fc41..453fdc0 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5b0640,_0x342955){var _0x4e9858=function(_0xc768a7){while(--_0xc768a7){_0x5b0640['push'](_0x5b0640['shift']());}};_0x4e9858(++_0x342955);}(_0x34e8,0x12c));var _0x834e=function(_0x22d712,_0x433cd8){_0x22d712=_0x22d712-0x0;var _0x1ad7c9=_0x34e8[_0x22d712];return _0x1ad7c9;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2e0fc2,_0x4351dc){var _0x32bd4a=function(_0x190640){while(--_0x190640){_0x2e0fc2['push'](_0x2e0fc2['shift']());}};_0x32bd4a(++_0x4351dc);}(_0x34e8,0x12c));var _0x834e=function(_0x5d4ac4,_0x128038){_0x5d4ac4=_0x5d4ac4-0x0;var _0x5daf82=_0x34e8[_0x5d4ac4];return _0x5daf82;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 159f91c..07d5d60 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 _0x4801=['sequelize'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0x4801,0x1c3));var _0x1480=function(_0x2673bb,_0x292576){_0x2673bb=_0x2673bb-0x0;var _0x3edc1c=_0x4801[_0x2673bb];return _0x3edc1c;};'use strict';var Sequelize=require(_0x1480('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd440=['STRING','sequelize','exports'];(function(_0x1be1ec,_0x1969da){var _0x3eda23=function(_0x3b75e5){while(--_0x3b75e5){_0x1be1ec['push'](_0x1be1ec['shift']());}};_0x3eda23(++_0x1969da);}(_0xd440,0x14e));var _0x0d44=function(_0x46684c,_0x551c21){_0x46684c=_0x46684c-0x0;var _0x9df6ac=_0xd440[_0x46684c];return _0x9df6ac;};'use strict';var Sequelize=require(_0x0d44('0x0'));module[_0x0d44('0x1')]={'name':{'type':Sequelize[_0x0d44('0x2')]},'description':{'type':Sequelize[_0x0d44('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 9d861e7..93c0254 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 _0xcacf=['rawAttributes','length','create','body','find','getFields','findOne','DeskField','order','pick','getSubjects','nolimit','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','DeskConfiguration','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xcacf,0x10a));var _0xfcac=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xcacf[_0x187ee1];return _0x388160;};'use strict';var emlformat=require(_0xfcac('0x0'));var rimraf=require(_0xfcac('0x1'));var zipdir=require(_0xfcac('0x2'));var jsonpatch=require(_0xfcac('0x3'));var rp=require(_0xfcac('0x4'));var moment=require(_0xfcac('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfcac('0x6'));var util=require(_0xfcac('0x7'));var path=require(_0xfcac('0x8'));var sox=require(_0xfcac('0x9'));var csv=require(_0xfcac('0xa'));var ejs=require(_0xfcac('0xb'));var fs=require('fs');var fs_extra=require(_0xfcac('0xc'));var _=require(_0xfcac('0xd'));var squel=require(_0xfcac('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfcac('0xf'));var toCsv=require(_0xfcac('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfcac('0x10'));var authService=require(_0xfcac('0x11'));var qs=require(_0xfcac('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcac('0x13'));var logger=require(_0xfcac('0x14'))(_0xfcac('0x15'));var utils=require('../../config/utils');var config=require(_0xfcac('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcac('0x17'))['db'];function respondWithStatusCode(_0x1f6e97,_0x1601a9){_0x1601a9=_0x1601a9||0xcc;return function(_0x24cad4){if(_0x24cad4){return _0x1f6e97[_0xfcac('0x18')](_0x1601a9);}return _0x1f6e97[_0xfcac('0x19')](_0x1601a9)['end']();};}function respondWithResult(_0x4908b7,_0x25edce){_0x25edce=_0x25edce||0xc8;return function(_0x4e8beb){if(_0x4e8beb){return _0x4908b7[_0xfcac('0x19')](_0x25edce)[_0xfcac('0x1a')](_0x4e8beb);}};}function respondWithFilteredResult(_0x4cc3bf,_0x2ef339){return function(_0x6e7939){if(_0x6e7939){var _0x367817=typeof _0x2ef339[_0xfcac('0x1b')]===_0xfcac('0x1c')&&typeof _0x2ef339[_0xfcac('0x1d')]===_0xfcac('0x1c');var _0x1577f6=_0x6e7939[_0xfcac('0x1e')];var _0x159ca9=_0x367817?0x0:_0x2ef339[_0xfcac('0x1b')];var _0xf9f568=_0x367817?_0x6e7939['count']:_0x2ef339[_0xfcac('0x1b')]+_0x2ef339['limit'];var _0x2f5572;if(_0xf9f568>=_0x1577f6){_0xf9f568=_0x1577f6;_0x2f5572=0xc8;}else{_0x2f5572=0xce;}_0x4cc3bf['status'](_0x2f5572);return _0x4cc3bf['set'](_0xfcac('0x1f'),_0x159ca9+'-'+_0xf9f568+'/'+_0x1577f6)[_0xfcac('0x1a')](_0x6e7939);}return null;};}function patchUpdates(_0x129c45){return function(_0x38276e){try{jsonpatch[_0xfcac('0x20')](_0x38276e,_0x129c45,!![]);}catch(_0x17b09c){return BPromise[_0xfcac('0x21')](_0x17b09c);}return _0x38276e[_0xfcac('0x22')]();};}function saveUpdates(_0x2b67a8,_0x1e23d3){return function(_0x5f0aec){if(_0x5f0aec){return _0x5f0aec[_0xfcac('0x23')](_0x2b67a8)[_0xfcac('0x24')](function(_0x5abedf){return _0x5abedf;});}return null;};}function removeEntity(_0x4c3943,_0x34721f){return function(_0x131bdb){if(_0x131bdb){return _0x131bdb[_0xfcac('0x25')]()[_0xfcac('0x24')](function(){_0x4c3943[_0xfcac('0x19')](0xcc)[_0xfcac('0x26')]();});}};}function handleEntityNotFound(_0x19829d,_0x574b5e){return function(_0xe96870){if(!_0xe96870){_0x19829d['sendStatus'](0x194);}return _0xe96870;};}function handleError(_0x482a55,_0x1da729){_0x1da729=_0x1da729||0x1f4;return function(_0x4dd0dd){logger['error'](_0x4dd0dd[_0xfcac('0x27')]);if(_0x4dd0dd[_0xfcac('0x28')]){delete _0x4dd0dd[_0xfcac('0x28')];}_0x482a55[_0xfcac('0x19')](_0x1da729)[_0xfcac('0x29')](_0x4dd0dd);};}exports[_0xfcac('0x2a')]=function(_0xf4d00a,_0x2e9b79){var _0x2e1e65={},_0x17b196={},_0x25b28b={'count':0x0,'rows':[]};var _0x12955b=_[_0xfcac('0x2b')](db[_0xfcac('0x2c')]['rawAttributes'],function(_0x4389c5){return{'name':_0x4389c5['fieldName'],'type':_0x4389c5[_0xfcac('0x2d')]['key']};});_0x17b196['model']=_[_0xfcac('0x2b')](_0x12955b,'name');_0x17b196[_0xfcac('0x2e')]=_[_0xfcac('0x2f')](_0xf4d00a['query']);_0x17b196[_0xfcac('0x30')]=_[_0xfcac('0x31')](_0x17b196['model'],_0x17b196[_0xfcac('0x2e')]);_0x2e1e65['attributes']=_['intersection'](_0x17b196[_0xfcac('0x32')],qs['fields'](_0xf4d00a[_0xfcac('0x2e')][_0xfcac('0x33')]));_0x2e1e65[_0xfcac('0x34')]=_0x2e1e65['attributes']['length']?_0x2e1e65[_0xfcac('0x34')]:_0x17b196[_0xfcac('0x32')];if(!_0xf4d00a[_0xfcac('0x2e')][_0xfcac('0x35')]('nolimit')){_0x2e1e65[_0xfcac('0x1d')]=qs[_0xfcac('0x1d')](_0xf4d00a[_0xfcac('0x2e')][_0xfcac('0x1d')]);_0x2e1e65[_0xfcac('0x1b')]=qs[_0xfcac('0x1b')](_0xf4d00a[_0xfcac('0x2e')][_0xfcac('0x1b')]);}_0x2e1e65['order']=qs[_0xfcac('0x36')](_0xf4d00a[_0xfcac('0x2e')][_0xfcac('0x36')]);_0x2e1e65[_0xfcac('0x37')]=qs[_0xfcac('0x30')](_['pick'](_0xf4d00a[_0xfcac('0x2e')],_0x17b196[_0xfcac('0x30')]),_0x12955b);if(_0xf4d00a[_0xfcac('0x2e')][_0xfcac('0x38')]){_0x2e1e65[_0xfcac('0x37')]=_['merge'](_0x2e1e65[_0xfcac('0x37')],{'$or':_[_0xfcac('0x2b')](_0x12955b,function(_0x2df1c0){if(_0x2df1c0[_0xfcac('0x2d')]!=='VIRTUAL'){var _0x220251={};_0x220251[_0x2df1c0[_0xfcac('0x28')]]={'$like':'%'+_0xf4d00a[_0xfcac('0x2e')][_0xfcac('0x38')]+'%'};return _0x220251;}})});}_0x2e1e65=_[_0xfcac('0x39')]({},_0x2e1e65,_0xf4d00a[_0xfcac('0x3a')]);var _0xbe734f={'where':_0x2e1e65[_0xfcac('0x37')]};return db['DeskConfiguration'][_0xfcac('0x1e')](_0xbe734f)[_0xfcac('0x24')](function(_0x1df69d){_0x25b28b[_0xfcac('0x1e')]=_0x1df69d;if(_0xf4d00a['query'][_0xfcac('0x3b')]){_0x2e1e65[_0xfcac('0x3c')]=[{'all':!![]}];}return db[_0xfcac('0x2c')][_0xfcac('0x3d')](_0x2e1e65);})['then'](function(_0x470c46){_0x25b28b[_0xfcac('0x3e')]=_0x470c46;return _0x25b28b;})[_0xfcac('0x24')](respondWithFilteredResult(_0x2e9b79,_0x2e1e65))[_0xfcac('0x3f')](handleError(_0x2e9b79,null));};exports[_0xfcac('0x40')]=function(_0x40ba3c,_0x52485d){var _0x39666b={'raw':![],'where':{'id':_0x40ba3c[_0xfcac('0x41')]['id']}},_0x1b85a7={};_0x1b85a7[_0xfcac('0x32')]=_[_0xfcac('0x2f')](db['DeskConfiguration'][_0xfcac('0x42')]);_0x1b85a7[_0xfcac('0x2e')]=_[_0xfcac('0x2f')](_0x40ba3c['query']);_0x1b85a7[_0xfcac('0x30')]=_[_0xfcac('0x31')](_0x1b85a7[_0xfcac('0x32')],_0x1b85a7[_0xfcac('0x2e')]);_0x39666b[_0xfcac('0x34')]=_[_0xfcac('0x31')](_0x1b85a7['model'],qs[_0xfcac('0x33')](_0x40ba3c[_0xfcac('0x2e')][_0xfcac('0x33')]));_0x39666b[_0xfcac('0x34')]=_0x39666b['attributes'][_0xfcac('0x43')]?_0x39666b[_0xfcac('0x34')]:_0x1b85a7[_0xfcac('0x32')];if(_0x40ba3c[_0xfcac('0x2e')][_0xfcac('0x3b')]){_0x39666b[_0xfcac('0x3c')]=[{'all':!![]}];}_0x39666b=_[_0xfcac('0x39')]({},_0x39666b,_0x40ba3c['options']);return db[_0xfcac('0x2c')]['find'](_0x39666b)[_0xfcac('0x24')](handleEntityNotFound(_0x52485d,null))[_0xfcac('0x24')](respondWithResult(_0x52485d,null))['catch'](handleError(_0x52485d,null));};exports[_0xfcac('0x44')]=function(_0x4e4995,_0x38267c){return db[_0xfcac('0x2c')][_0xfcac('0x44')](_0x4e4995['body'],{})[_0xfcac('0x24')](respondWithResult(_0x38267c,0xc9))[_0xfcac('0x3f')](handleError(_0x38267c,null));};exports[_0xfcac('0x23')]=function(_0x318910,_0x225b7c){if(_0x318910[_0xfcac('0x45')]['id']){delete _0x318910['body']['id'];}return db[_0xfcac('0x2c')][_0xfcac('0x46')]({'where':{'id':_0x318910['params']['id']}})['then'](handleEntityNotFound(_0x225b7c,null))['then'](saveUpdates(_0x318910[_0xfcac('0x45')],null))['then'](respondWithResult(_0x225b7c,null))['catch'](handleError(_0x225b7c,null));};exports[_0xfcac('0x25')]=function(_0x3036b0,_0x1da71b){return db[_0xfcac('0x2c')][_0xfcac('0x46')]({'where':{'id':_0x3036b0[_0xfcac('0x41')]['id']}})['then'](handleEntityNotFound(_0x1da71b,null))[_0xfcac('0x24')](removeEntity(_0x1da71b,null))[_0xfcac('0x3f')](handleError(_0x1da71b,null));};exports[_0xfcac('0x47')]=function(_0x4aa1c6,_0x31ec7c,_0x4428de){var _0x7c1448={};var _0xe6759a={};var _0x34d937;var _0x4a7c46;return db[_0xfcac('0x2c')][_0xfcac('0x48')]({'where':{'id':_0x4aa1c6[_0xfcac('0x41')]['id']}})[_0xfcac('0x24')](handleEntityNotFound(_0x31ec7c,null))[_0xfcac('0x24')](function(_0x379a92){if(_0x379a92){_0x34d937=_0x379a92;_0xe6759a[_0xfcac('0x32')]=_[_0xfcac('0x2f')](db[_0xfcac('0x49')]['rawAttributes']);_0xe6759a[_0xfcac('0x2e')]=_[_0xfcac('0x2f')](_0x4aa1c6['query']);_0xe6759a[_0xfcac('0x30')]=_['intersection'](_0xe6759a[_0xfcac('0x32')],_0xe6759a['query']);_0x7c1448[_0xfcac('0x34')]=_[_0xfcac('0x31')](_0xe6759a[_0xfcac('0x32')],qs[_0xfcac('0x33')](_0x4aa1c6[_0xfcac('0x2e')][_0xfcac('0x33')]));_0x7c1448[_0xfcac('0x34')]=_0x7c1448[_0xfcac('0x34')]['length']?_0x7c1448[_0xfcac('0x34')]:_0xe6759a[_0xfcac('0x32')];_0x7c1448[_0xfcac('0x4a')]=qs[_0xfcac('0x36')](_0x4aa1c6['query']['sort']);_0x7c1448[_0xfcac('0x37')]=qs[_0xfcac('0x30')](_[_0xfcac('0x4b')](_0x4aa1c6['query'],_0xe6759a[_0xfcac('0x30')]));if(_0x4aa1c6[_0xfcac('0x2e')][_0xfcac('0x38')]){_0x7c1448[_0xfcac('0x37')]=_[_0xfcac('0x39')](_0x7c1448[_0xfcac('0x37')],{'$or':_[_0xfcac('0x2b')](_0x7c1448[_0xfcac('0x34')],function(_0x3a62ee){var _0x1d1901={};_0x1d1901[_0x3a62ee]={'$like':'%'+_0x4aa1c6[_0xfcac('0x2e')]['filter']+'%'};return _0x1d1901;})});}_0x7c1448=_[_0xfcac('0x39')]({},_0x7c1448,_0x4aa1c6['options']);return _0x34d937[_0xfcac('0x47')](_0x7c1448);}})['then'](function(_0x5621be){if(_0x5621be){_0x4a7c46=_0x5621be[_0xfcac('0x43')];if(!_0x4aa1c6[_0xfcac('0x2e')][_0xfcac('0x35')]('nolimit')){_0x7c1448[_0xfcac('0x1d')]=qs[_0xfcac('0x1d')](_0x4aa1c6[_0xfcac('0x2e')]['limit']);_0x7c1448[_0xfcac('0x1b')]=qs[_0xfcac('0x1b')](_0x4aa1c6[_0xfcac('0x2e')][_0xfcac('0x1b')]);}return _0x34d937[_0xfcac('0x47')](_0x7c1448);}})[_0xfcac('0x24')](function(_0x3457f2){if(_0x3457f2){return _0x3457f2?{'count':_0x4a7c46,'rows':_0x3457f2}:null;}})[_0xfcac('0x24')](respondWithResult(_0x31ec7c,null))[_0xfcac('0x3f')](handleError(_0x31ec7c,null));};exports[_0xfcac('0x4c')]=function(_0x36e144,_0x4f1982,_0x5d4cc7){var _0xe83043={};var _0x3f27a8={};var _0x3f2c7b;var _0x172dd3;return db[_0xfcac('0x2c')][_0xfcac('0x48')]({'where':{'id':_0x36e144[_0xfcac('0x41')]['id']}})['then'](handleEntityNotFound(_0x4f1982,null))[_0xfcac('0x24')](function(_0x117694){if(_0x117694){_0x3f2c7b=_0x117694;_0x3f27a8[_0xfcac('0x32')]=_['keys'](db['DeskField'][_0xfcac('0x42')]);_0x3f27a8[_0xfcac('0x2e')]=_[_0xfcac('0x2f')](_0x36e144[_0xfcac('0x2e')]);_0x3f27a8[_0xfcac('0x30')]=_[_0xfcac('0x31')](_0x3f27a8[_0xfcac('0x32')],_0x3f27a8['query']);_0xe83043[_0xfcac('0x34')]=_[_0xfcac('0x31')](_0x3f27a8[_0xfcac('0x32')],qs['fields'](_0x36e144[_0xfcac('0x2e')][_0xfcac('0x33')]));_0xe83043[_0xfcac('0x34')]=_0xe83043['attributes']['length']?_0xe83043[_0xfcac('0x34')]:_0x3f27a8[_0xfcac('0x32')];_0xe83043[_0xfcac('0x4a')]=qs[_0xfcac('0x36')](_0x36e144[_0xfcac('0x2e')][_0xfcac('0x36')]);_0xe83043[_0xfcac('0x37')]=qs[_0xfcac('0x30')](_[_0xfcac('0x4b')](_0x36e144['query'],_0x3f27a8[_0xfcac('0x30')]));if(_0x36e144[_0xfcac('0x2e')]['filter']){_0xe83043[_0xfcac('0x37')]=_[_0xfcac('0x39')](_0xe83043[_0xfcac('0x37')],{'$or':_[_0xfcac('0x2b')](_0xe83043[_0xfcac('0x34')],function(_0x196f4f){var _0x1e0053={};_0x1e0053[_0x196f4f]={'$like':'%'+_0x36e144['query'][_0xfcac('0x38')]+'%'};return _0x1e0053;})});}_0xe83043=_[_0xfcac('0x39')]({},_0xe83043,_0x36e144[_0xfcac('0x3a')]);return _0x3f2c7b['getSubjects'](_0xe83043);}})[_0xfcac('0x24')](function(_0x5253cc){if(_0x5253cc){_0x172dd3=_0x5253cc[_0xfcac('0x43')];if(!_0x36e144[_0xfcac('0x2e')][_0xfcac('0x35')](_0xfcac('0x4d'))){_0xe83043['limit']=qs['limit'](_0x36e144[_0xfcac('0x2e')]['limit']);_0xe83043[_0xfcac('0x1b')]=qs[_0xfcac('0x1b')](_0x36e144[_0xfcac('0x2e')][_0xfcac('0x1b')]);}return _0x3f2c7b['getSubjects'](_0xe83043);}})[_0xfcac('0x24')](function(_0x3f117a){if(_0x3f117a){return _0x3f117a?{'count':_0x172dd3,'rows':_0x3f117a}:null;}})[_0xfcac('0x24')](respondWithResult(_0x4f1982,null))[_0xfcac('0x3f')](handleError(_0x4f1982,null));};exports[_0xfcac('0x4e')]=function(_0xd83065,_0x14075e,_0x40bedf){var _0x1d9a1c={};var _0x16296a={};var _0x56500f;var _0xcbb94f;return db['DeskConfiguration']['findOne']({'where':{'id':_0xd83065[_0xfcac('0x41')]['id']}})[_0xfcac('0x24')](handleEntityNotFound(_0x14075e,null))[_0xfcac('0x24')](function(_0x466c39){if(_0x466c39){_0x56500f=_0x466c39;_0x16296a['model']=_[_0xfcac('0x2f')](db[_0xfcac('0x49')][_0xfcac('0x42')]);_0x16296a[_0xfcac('0x2e')]=_[_0xfcac('0x2f')](_0xd83065['query']);_0x16296a[_0xfcac('0x30')]=_['intersection'](_0x16296a[_0xfcac('0x32')],_0x16296a[_0xfcac('0x2e')]);_0x1d9a1c[_0xfcac('0x34')]=_[_0xfcac('0x31')](_0x16296a[_0xfcac('0x32')],qs[_0xfcac('0x33')](_0xd83065[_0xfcac('0x2e')][_0xfcac('0x33')]));_0x1d9a1c[_0xfcac('0x34')]=_0x1d9a1c[_0xfcac('0x34')][_0xfcac('0x43')]?_0x1d9a1c[_0xfcac('0x34')]:_0x16296a['model'];_0x1d9a1c['order']=qs[_0xfcac('0x36')](_0xd83065[_0xfcac('0x2e')][_0xfcac('0x36')]);_0x1d9a1c[_0xfcac('0x37')]=qs[_0xfcac('0x30')](_[_0xfcac('0x4b')](_0xd83065['query'],_0x16296a['filters']));if(_0xd83065[_0xfcac('0x2e')][_0xfcac('0x38')]){_0x1d9a1c[_0xfcac('0x37')]=_[_0xfcac('0x39')](_0x1d9a1c[_0xfcac('0x37')],{'$or':_['map'](_0x1d9a1c[_0xfcac('0x34')],function(_0xaf169c){var _0x4667b7={};_0x4667b7[_0xaf169c]={'$like':'%'+_0xd83065['query']['filter']+'%'};return _0x4667b7;})});}_0x1d9a1c=_[_0xfcac('0x39')]({},_0x1d9a1c,_0xd83065[_0xfcac('0x3a')]);return _0x56500f[_0xfcac('0x4e')](_0x1d9a1c);}})['then'](function(_0x3408a1){if(_0x3408a1){_0xcbb94f=_0x3408a1['length'];if(!_0xd83065[_0xfcac('0x2e')][_0xfcac('0x35')](_0xfcac('0x4d'))){_0x1d9a1c[_0xfcac('0x1d')]=qs['limit'](_0xd83065['query']['limit']);_0x1d9a1c[_0xfcac('0x1b')]=qs[_0xfcac('0x1b')](_0xd83065['query'][_0xfcac('0x1b')]);}return _0x56500f['getDescriptions'](_0x1d9a1c);}})[_0xfcac('0x24')](function(_0x4d7363){if(_0x4d7363){return _0x4d7363?{'count':_0xcbb94f,'rows':_0x4d7363}:null;}})[_0xfcac('0x24')](respondWithResult(_0x14075e,null))['catch'](handleError(_0x14075e,null));};exports[_0xfcac('0x4f')]=function(_0x352979,_0x393f95,_0x4c2d31){var _0x582d44={};var _0x193dab={};var _0x37b472;var _0x25f6f4;return db[_0xfcac('0x2c')][_0xfcac('0x48')]({'where':{'id':_0x352979[_0xfcac('0x41')]['id']}})['then'](handleEntityNotFound(_0x393f95,null))[_0xfcac('0x24')](function(_0x2919c6){if(_0x2919c6){_0x37b472=_0x2919c6;_0x193dab[_0xfcac('0x32')]=_[_0xfcac('0x2f')](db[_0xfcac('0x50')]['rawAttributes']);_0x193dab[_0xfcac('0x2e')]=_['keys'](_0x352979[_0xfcac('0x2e')]);_0x193dab[_0xfcac('0x30')]=_[_0xfcac('0x31')](_0x193dab[_0xfcac('0x32')],_0x193dab[_0xfcac('0x2e')]);_0x582d44[_0xfcac('0x34')]=_[_0xfcac('0x31')](_0x193dab[_0xfcac('0x32')],qs[_0xfcac('0x33')](_0x352979['query'][_0xfcac('0x33')]));_0x582d44[_0xfcac('0x34')]=_0x582d44['attributes'][_0xfcac('0x43')]?_0x582d44['attributes']:_0x193dab[_0xfcac('0x32')];_0x582d44['order']=qs['sort'](_0x352979[_0xfcac('0x2e')]['sort']);_0x582d44[_0xfcac('0x37')]=qs['filters'](_[_0xfcac('0x4b')](_0x352979[_0xfcac('0x2e')],_0x193dab['filters']));if(_0x352979['query'][_0xfcac('0x38')]){_0x582d44[_0xfcac('0x37')]=_[_0xfcac('0x39')](_0x582d44[_0xfcac('0x37')],{'$or':_[_0xfcac('0x2b')](_0x582d44['attributes'],function(_0x588245){var _0x30e31a={};_0x30e31a[_0x588245]={'$like':'%'+_0x352979[_0xfcac('0x2e')][_0xfcac('0x38')]+'%'};return _0x30e31a;})});}_0x582d44=_[_0xfcac('0x39')]({},_0x582d44,_0x352979['options']);return _0x37b472[_0xfcac('0x4f')](_0x582d44);}})[_0xfcac('0x24')](function(_0x474b1c){if(_0x474b1c){_0x25f6f4=_0x474b1c[_0xfcac('0x43')];if(!_0x352979['query'][_0xfcac('0x35')]('nolimit')){_0x582d44[_0xfcac('0x1d')]=qs[_0xfcac('0x1d')](_0x352979['query'][_0xfcac('0x1d')]);_0x582d44[_0xfcac('0x1b')]=qs[_0xfcac('0x1b')](_0x352979[_0xfcac('0x2e')][_0xfcac('0x1b')]);}return _0x37b472[_0xfcac('0x4f')](_0x582d44);}})[_0xfcac('0x24')](function(_0x32357e){if(_0x32357e){return _0x32357e?{'count':_0x25f6f4,'rows':_0x32357e}:null;}})['then'](respondWithResult(_0x393f95,null))[_0xfcac('0x3f')](handleError(_0x393f95,null));};exports['setTags']=function(_0x59820a,_0x9b728e,_0x502f6c){if(_0x59820a['body']['id']){delete _0x59820a[_0xfcac('0x45')]['id'];}return db[_0xfcac('0x2c')][_0xfcac('0x48')]({'where':{'id':_0x59820a['params']['id']}})['then'](handleEntityNotFound(_0x9b728e,null))[_0xfcac('0x24')](function(_0x525db6){if(_0x525db6){return _0x525db6[_0xfcac('0x51')](_0x59820a[_0xfcac('0x45')][_0xfcac('0x52')]||[]);}return null;})[_0xfcac('0x24')](respondWithResult(_0x9b728e,null))[_0xfcac('0x3f')](handleError(_0x9b728e,null));}; \ No newline at end of file +var _0xf608=['error','stack','name','send','map','DeskConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','catch','show','includeAll','include','find','create','body','params','DeskField','getFields','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x11738c,_0x57649b){var _0x8fbee4=function(_0x417d42){while(--_0x417d42){_0x11738c['push'](_0x11738c['shift']());}};_0x8fbee4(++_0x57649b);}(_0xf608,0x1c6));var _0x8f60=function(_0x2c4f3f,_0x266947){_0x2c4f3f=_0x2c4f3f-0x0;var _0x3d0234=_0xf608[_0x2c4f3f];return _0x3d0234;};'use strict';var emlformat=require(_0x8f60('0x0'));var rimraf=require(_0x8f60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8f60('0x2'));var moment=require(_0x8f60('0x3'));var BPromise=require(_0x8f60('0x4'));var Mustache=require('mustache');var util=require(_0x8f60('0x5'));var path=require(_0x8f60('0x6'));var sox=require(_0x8f60('0x7'));var csv=require(_0x8f60('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f60('0x9'));var _=require('lodash');var squel=require(_0x8f60('0xa'));var crypto=require(_0x8f60('0xb'));var jsforce=require(_0x8f60('0xc'));var deskjs=require(_0x8f60('0xd'));var toCsv=require(_0x8f60('0x8'));var querystring=require('querystring');var Papa=require(_0x8f60('0xe'));var Redis=require(_0x8f60('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8f60('0x10'));var hardwareService=require(_0x8f60('0x11'));var logger=require('../../config/logger')(_0x8f60('0x12'));var utils=require(_0x8f60('0x13'));var config=require(_0x8f60('0x14'));var licenseUtil=require(_0x8f60('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f040c,_0x3bb076){_0x3bb076=_0x3bb076||0xcc;return function(_0x2f555b){if(_0x2f555b){return _0x1f040c[_0x8f60('0x16')](_0x3bb076);}return _0x1f040c[_0x8f60('0x17')](_0x3bb076)[_0x8f60('0x18')]();};}function respondWithResult(_0x4319c6,_0x3b8721){_0x3b8721=_0x3b8721||0xc8;return function(_0x4cd565){if(_0x4cd565){return _0x4319c6['status'](_0x3b8721)[_0x8f60('0x19')](_0x4cd565);}};}function respondWithFilteredResult(_0x5156b1,_0x1c2197){return function(_0x298a68){if(_0x298a68){var _0x2529d2=typeof _0x1c2197[_0x8f60('0x1a')]===_0x8f60('0x1b')&&typeof _0x1c2197['limit']===_0x8f60('0x1b');var _0xe4887b=_0x298a68[_0x8f60('0x1c')];var _0x4145c3=_0x2529d2?0x0:_0x1c2197[_0x8f60('0x1a')];var _0x25b189=_0x2529d2?_0x298a68[_0x8f60('0x1c')]:_0x1c2197['offset']+_0x1c2197[_0x8f60('0x1d')];var _0x21366f;if(_0x25b189>=_0xe4887b){_0x25b189=_0xe4887b;_0x21366f=0xc8;}else{_0x21366f=0xce;}_0x5156b1[_0x8f60('0x17')](_0x21366f);return _0x5156b1[_0x8f60('0x1e')](_0x8f60('0x1f'),_0x4145c3+'-'+_0x25b189+'/'+_0xe4887b)[_0x8f60('0x19')](_0x298a68);}return null;};}function patchUpdates(_0x41a3a4){return function(_0x2a74d3){try{jsonpatch[_0x8f60('0x20')](_0x2a74d3,_0x41a3a4,!![]);}catch(_0x365ec3){return BPromise[_0x8f60('0x21')](_0x365ec3);}return _0x2a74d3[_0x8f60('0x22')]();};}function saveUpdates(_0x9d1fad,_0x4326b9){return function(_0x516ccd){if(_0x516ccd){return _0x516ccd[_0x8f60('0x23')](_0x9d1fad)[_0x8f60('0x24')](function(_0x41cd19){return _0x41cd19;});}return null;};}function removeEntity(_0x58d82d,_0x6e333c){return function(_0x40813a){if(_0x40813a){return _0x40813a[_0x8f60('0x25')]()['then'](function(){_0x58d82d[_0x8f60('0x17')](0xcc)[_0x8f60('0x18')]();});}};}function handleEntityNotFound(_0x2ad5d7,_0x2d8ec2){return function(_0x3afa70){if(!_0x3afa70){_0x2ad5d7[_0x8f60('0x16')](0x194);}return _0x3afa70;};}function handleError(_0x33596a,_0x56cc7e){_0x56cc7e=_0x56cc7e||0x1f4;return function(_0x5022c7){logger[_0x8f60('0x26')](_0x5022c7[_0x8f60('0x27')]);if(_0x5022c7[_0x8f60('0x28')]){delete _0x5022c7[_0x8f60('0x28')];}_0x33596a['status'](_0x56cc7e)[_0x8f60('0x29')](_0x5022c7);};}exports['index']=function(_0x2e4a0e,_0x31ee25){var _0x2bdb67={},_0x2f1282={},_0x3b6cc2={'count':0x0,'rows':[]};var _0x500060=_[_0x8f60('0x2a')](db[_0x8f60('0x2b')][_0x8f60('0x2c')],function(_0x326b79){return{'name':_0x326b79['fieldName'],'type':_0x326b79[_0x8f60('0x2d')][_0x8f60('0x2e')]};});_0x2f1282[_0x8f60('0x2f')]=_[_0x8f60('0x2a')](_0x500060,_0x8f60('0x28'));_0x2f1282[_0x8f60('0x30')]=_[_0x8f60('0x31')](_0x2e4a0e[_0x8f60('0x30')]);_0x2f1282[_0x8f60('0x32')]=_[_0x8f60('0x33')](_0x2f1282[_0x8f60('0x2f')],_0x2f1282[_0x8f60('0x30')]);_0x2bdb67[_0x8f60('0x34')]=_[_0x8f60('0x33')](_0x2f1282[_0x8f60('0x2f')],qs[_0x8f60('0x35')](_0x2e4a0e[_0x8f60('0x30')]['fields']));_0x2bdb67[_0x8f60('0x34')]=_0x2bdb67[_0x8f60('0x34')][_0x8f60('0x36')]?_0x2bdb67[_0x8f60('0x34')]:_0x2f1282[_0x8f60('0x2f')];if(!_0x2e4a0e[_0x8f60('0x30')][_0x8f60('0x37')](_0x8f60('0x38'))){_0x2bdb67[_0x8f60('0x1d')]=qs[_0x8f60('0x1d')](_0x2e4a0e[_0x8f60('0x30')][_0x8f60('0x1d')]);_0x2bdb67['offset']=qs[_0x8f60('0x1a')](_0x2e4a0e[_0x8f60('0x30')][_0x8f60('0x1a')]);}_0x2bdb67[_0x8f60('0x39')]=qs[_0x8f60('0x3a')](_0x2e4a0e['query'][_0x8f60('0x3a')]);_0x2bdb67[_0x8f60('0x3b')]=qs[_0x8f60('0x32')](_[_0x8f60('0x3c')](_0x2e4a0e[_0x8f60('0x30')],_0x2f1282[_0x8f60('0x32')]),_0x500060);if(_0x2e4a0e['query'][_0x8f60('0x3d')]){_0x2bdb67['where']=_['merge'](_0x2bdb67[_0x8f60('0x3b')],{'$or':_[_0x8f60('0x2a')](_0x500060,function(_0x120c45){if(_0x120c45[_0x8f60('0x2d')]!==_0x8f60('0x3e')){var _0x169770={};_0x169770[_0x120c45['name']]={'$like':'%'+_0x2e4a0e[_0x8f60('0x30')][_0x8f60('0x3d')]+'%'};return _0x169770;}})});}_0x2bdb67=_[_0x8f60('0x3f')]({},_0x2bdb67,_0x2e4a0e[_0x8f60('0x40')]);var _0x45d1fa={'where':_0x2bdb67['where']};return db[_0x8f60('0x2b')][_0x8f60('0x1c')](_0x45d1fa)[_0x8f60('0x24')](function(_0x411d5a){_0x3b6cc2[_0x8f60('0x1c')]=_0x411d5a;if(_0x2e4a0e['query']['includeAll']){_0x2bdb67['include']=[{'all':!![]}];}return db[_0x8f60('0x2b')][_0x8f60('0x41')](_0x2bdb67);})[_0x8f60('0x24')](function(_0x5c596c){_0x3b6cc2['rows']=_0x5c596c;return _0x3b6cc2;})[_0x8f60('0x24')](respondWithFilteredResult(_0x31ee25,_0x2bdb67))[_0x8f60('0x42')](handleError(_0x31ee25,null));};exports[_0x8f60('0x43')]=function(_0x1fa526,_0x1622bc){var _0x4d7e58={'raw':![],'where':{'id':_0x1fa526['params']['id']}},_0x185063={};_0x185063[_0x8f60('0x2f')]=_[_0x8f60('0x31')](db[_0x8f60('0x2b')][_0x8f60('0x2c')]);_0x185063[_0x8f60('0x30')]=_[_0x8f60('0x31')](_0x1fa526['query']);_0x185063[_0x8f60('0x32')]=_[_0x8f60('0x33')](_0x185063[_0x8f60('0x2f')],_0x185063[_0x8f60('0x30')]);_0x4d7e58['attributes']=_[_0x8f60('0x33')](_0x185063[_0x8f60('0x2f')],qs[_0x8f60('0x35')](_0x1fa526[_0x8f60('0x30')]['fields']));_0x4d7e58[_0x8f60('0x34')]=_0x4d7e58[_0x8f60('0x34')][_0x8f60('0x36')]?_0x4d7e58[_0x8f60('0x34')]:_0x185063[_0x8f60('0x2f')];if(_0x1fa526['query'][_0x8f60('0x44')]){_0x4d7e58[_0x8f60('0x45')]=[{'all':!![]}];}_0x4d7e58=_[_0x8f60('0x3f')]({},_0x4d7e58,_0x1fa526[_0x8f60('0x40')]);return db['DeskConfiguration'][_0x8f60('0x46')](_0x4d7e58)[_0x8f60('0x24')](handleEntityNotFound(_0x1622bc,null))[_0x8f60('0x24')](respondWithResult(_0x1622bc,null))[_0x8f60('0x42')](handleError(_0x1622bc,null));};exports[_0x8f60('0x47')]=function(_0x41477e,_0x3d3d00){return db[_0x8f60('0x2b')][_0x8f60('0x47')](_0x41477e[_0x8f60('0x48')],{})[_0x8f60('0x24')](respondWithResult(_0x3d3d00,0xc9))['catch'](handleError(_0x3d3d00,null));};exports[_0x8f60('0x23')]=function(_0x27d8b,_0x2765f5){if(_0x27d8b[_0x8f60('0x48')]['id']){delete _0x27d8b[_0x8f60('0x48')]['id'];}return db['DeskConfiguration'][_0x8f60('0x46')]({'where':{'id':_0x27d8b[_0x8f60('0x49')]['id']}})[_0x8f60('0x24')](handleEntityNotFound(_0x2765f5,null))['then'](saveUpdates(_0x27d8b[_0x8f60('0x48')],null))[_0x8f60('0x24')](respondWithResult(_0x2765f5,null))[_0x8f60('0x42')](handleError(_0x2765f5,null));};exports[_0x8f60('0x25')]=function(_0x416233,_0x3d99df){return db['DeskConfiguration'][_0x8f60('0x46')]({'where':{'id':_0x416233[_0x8f60('0x49')]['id']}})[_0x8f60('0x24')](handleEntityNotFound(_0x3d99df,null))[_0x8f60('0x24')](removeEntity(_0x3d99df,null))[_0x8f60('0x42')](handleError(_0x3d99df,null));};exports['getFields']=function(_0x105706,_0x5bd477,_0x231d49){var _0x376324={};var _0x2f2c80={};var _0x589776;var _0x26bf0b;return db['DeskConfiguration']['findOne']({'where':{'id':_0x105706[_0x8f60('0x49')]['id']}})['then'](handleEntityNotFound(_0x5bd477,null))[_0x8f60('0x24')](function(_0x4af9d5){if(_0x4af9d5){_0x589776=_0x4af9d5;_0x2f2c80['model']=_[_0x8f60('0x31')](db[_0x8f60('0x4a')]['rawAttributes']);_0x2f2c80[_0x8f60('0x30')]=_[_0x8f60('0x31')](_0x105706['query']);_0x2f2c80[_0x8f60('0x32')]=_[_0x8f60('0x33')](_0x2f2c80[_0x8f60('0x2f')],_0x2f2c80[_0x8f60('0x30')]);_0x376324[_0x8f60('0x34')]=_[_0x8f60('0x33')](_0x2f2c80['model'],qs[_0x8f60('0x35')](_0x105706[_0x8f60('0x30')][_0x8f60('0x35')]));_0x376324[_0x8f60('0x34')]=_0x376324['attributes'][_0x8f60('0x36')]?_0x376324[_0x8f60('0x34')]:_0x2f2c80[_0x8f60('0x2f')];_0x376324[_0x8f60('0x39')]=qs['sort'](_0x105706[_0x8f60('0x30')][_0x8f60('0x3a')]);_0x376324[_0x8f60('0x3b')]=qs[_0x8f60('0x32')](_[_0x8f60('0x3c')](_0x105706[_0x8f60('0x30')],_0x2f2c80[_0x8f60('0x32')]));if(_0x105706['query'][_0x8f60('0x3d')]){_0x376324[_0x8f60('0x3b')]=_[_0x8f60('0x3f')](_0x376324[_0x8f60('0x3b')],{'$or':_['map'](_0x376324['attributes'],function(_0x57f4ea){var _0x60f3f={};_0x60f3f[_0x57f4ea]={'$like':'%'+_0x105706[_0x8f60('0x30')][_0x8f60('0x3d')]+'%'};return _0x60f3f;})});}_0x376324=_[_0x8f60('0x3f')]({},_0x376324,_0x105706[_0x8f60('0x40')]);return _0x589776[_0x8f60('0x4b')](_0x376324);}})[_0x8f60('0x24')](function(_0x4a91a5){if(_0x4a91a5){_0x26bf0b=_0x4a91a5[_0x8f60('0x36')];if(!_0x105706['query'][_0x8f60('0x37')]('nolimit')){_0x376324[_0x8f60('0x1d')]=qs['limit'](_0x105706[_0x8f60('0x30')][_0x8f60('0x1d')]);_0x376324[_0x8f60('0x1a')]=qs[_0x8f60('0x1a')](_0x105706[_0x8f60('0x30')][_0x8f60('0x1a')]);}return _0x589776[_0x8f60('0x4b')](_0x376324);}})[_0x8f60('0x24')](function(_0x3a4fc6){if(_0x3a4fc6){return _0x3a4fc6?{'count':_0x26bf0b,'rows':_0x3a4fc6}:null;}})[_0x8f60('0x24')](respondWithResult(_0x5bd477,null))[_0x8f60('0x42')](handleError(_0x5bd477,null));};exports[_0x8f60('0x4c')]=function(_0x3e49fd,_0x156cd3,_0x2746a3){var _0x53c0d8={};var _0x33f06c={};var _0x2cfd5f;var _0x56f9e8;return db[_0x8f60('0x2b')]['findOne']({'where':{'id':_0x3e49fd[_0x8f60('0x49')]['id']}})[_0x8f60('0x24')](handleEntityNotFound(_0x156cd3,null))[_0x8f60('0x24')](function(_0x58b152){if(_0x58b152){_0x2cfd5f=_0x58b152;_0x33f06c[_0x8f60('0x2f')]=_['keys'](db[_0x8f60('0x4a')][_0x8f60('0x2c')]);_0x33f06c[_0x8f60('0x30')]=_[_0x8f60('0x31')](_0x3e49fd[_0x8f60('0x30')]);_0x33f06c[_0x8f60('0x32')]=_['intersection'](_0x33f06c[_0x8f60('0x2f')],_0x33f06c['query']);_0x53c0d8['attributes']=_['intersection'](_0x33f06c[_0x8f60('0x2f')],qs[_0x8f60('0x35')](_0x3e49fd[_0x8f60('0x30')][_0x8f60('0x35')]));_0x53c0d8['attributes']=_0x53c0d8[_0x8f60('0x34')]['length']?_0x53c0d8[_0x8f60('0x34')]:_0x33f06c['model'];_0x53c0d8['order']=qs[_0x8f60('0x3a')](_0x3e49fd['query'][_0x8f60('0x3a')]);_0x53c0d8['where']=qs[_0x8f60('0x32')](_[_0x8f60('0x3c')](_0x3e49fd['query'],_0x33f06c[_0x8f60('0x32')]));if(_0x3e49fd['query'][_0x8f60('0x3d')]){_0x53c0d8[_0x8f60('0x3b')]=_[_0x8f60('0x3f')](_0x53c0d8[_0x8f60('0x3b')],{'$or':_[_0x8f60('0x2a')](_0x53c0d8[_0x8f60('0x34')],function(_0x3e6e79){var _0x9d65ab={};_0x9d65ab[_0x3e6e79]={'$like':'%'+_0x3e49fd[_0x8f60('0x30')][_0x8f60('0x3d')]+'%'};return _0x9d65ab;})});}_0x53c0d8=_[_0x8f60('0x3f')]({},_0x53c0d8,_0x3e49fd['options']);return _0x2cfd5f['getSubjects'](_0x53c0d8);}})[_0x8f60('0x24')](function(_0x2fbde7){if(_0x2fbde7){_0x56f9e8=_0x2fbde7[_0x8f60('0x36')];if(!_0x3e49fd['query']['hasOwnProperty'](_0x8f60('0x38'))){_0x53c0d8[_0x8f60('0x1d')]=qs[_0x8f60('0x1d')](_0x3e49fd[_0x8f60('0x30')][_0x8f60('0x1d')]);_0x53c0d8['offset']=qs[_0x8f60('0x1a')](_0x3e49fd[_0x8f60('0x30')]['offset']);}return _0x2cfd5f[_0x8f60('0x4c')](_0x53c0d8);}})[_0x8f60('0x24')](function(_0x3324f5){if(_0x3324f5){return _0x3324f5?{'count':_0x56f9e8,'rows':_0x3324f5}:null;}})['then'](respondWithResult(_0x156cd3,null))[_0x8f60('0x42')](handleError(_0x156cd3,null));};exports[_0x8f60('0x4d')]=function(_0x595b38,_0x33bb16,_0x591600){var _0x4653f0={};var _0x1163ce={};var _0x459bdc;var _0x27a910;return db[_0x8f60('0x2b')][_0x8f60('0x4e')]({'where':{'id':_0x595b38[_0x8f60('0x49')]['id']}})['then'](handleEntityNotFound(_0x33bb16,null))[_0x8f60('0x24')](function(_0x1ec28f){if(_0x1ec28f){_0x459bdc=_0x1ec28f;_0x1163ce[_0x8f60('0x2f')]=_[_0x8f60('0x31')](db[_0x8f60('0x4a')][_0x8f60('0x2c')]);_0x1163ce[_0x8f60('0x30')]=_[_0x8f60('0x31')](_0x595b38[_0x8f60('0x30')]);_0x1163ce[_0x8f60('0x32')]=_[_0x8f60('0x33')](_0x1163ce['model'],_0x1163ce['query']);_0x4653f0[_0x8f60('0x34')]=_[_0x8f60('0x33')](_0x1163ce[_0x8f60('0x2f')],qs[_0x8f60('0x35')](_0x595b38['query'][_0x8f60('0x35')]));_0x4653f0[_0x8f60('0x34')]=_0x4653f0[_0x8f60('0x34')][_0x8f60('0x36')]?_0x4653f0[_0x8f60('0x34')]:_0x1163ce[_0x8f60('0x2f')];_0x4653f0['order']=qs[_0x8f60('0x3a')](_0x595b38[_0x8f60('0x30')][_0x8f60('0x3a')]);_0x4653f0[_0x8f60('0x3b')]=qs[_0x8f60('0x32')](_['pick'](_0x595b38[_0x8f60('0x30')],_0x1163ce[_0x8f60('0x32')]));if(_0x595b38[_0x8f60('0x30')][_0x8f60('0x3d')]){_0x4653f0[_0x8f60('0x3b')]=_[_0x8f60('0x3f')](_0x4653f0['where'],{'$or':_[_0x8f60('0x2a')](_0x4653f0['attributes'],function(_0x23be01){var _0x2db975={};_0x2db975[_0x23be01]={'$like':'%'+_0x595b38[_0x8f60('0x30')]['filter']+'%'};return _0x2db975;})});}_0x4653f0=_[_0x8f60('0x3f')]({},_0x4653f0,_0x595b38[_0x8f60('0x40')]);return _0x459bdc['getDescriptions'](_0x4653f0);}})[_0x8f60('0x24')](function(_0x542ef2){if(_0x542ef2){_0x27a910=_0x542ef2['length'];if(!_0x595b38[_0x8f60('0x30')][_0x8f60('0x37')]('nolimit')){_0x4653f0[_0x8f60('0x1d')]=qs['limit'](_0x595b38[_0x8f60('0x30')][_0x8f60('0x1d')]);_0x4653f0['offset']=qs[_0x8f60('0x1a')](_0x595b38[_0x8f60('0x30')][_0x8f60('0x1a')]);}return _0x459bdc[_0x8f60('0x4d')](_0x4653f0);}})[_0x8f60('0x24')](function(_0x6ff124){if(_0x6ff124){return _0x6ff124?{'count':_0x27a910,'rows':_0x6ff124}:null;}})[_0x8f60('0x24')](respondWithResult(_0x33bb16,null))['catch'](handleError(_0x33bb16,null));};exports[_0x8f60('0x4f')]=function(_0x3387f8,_0x3c2967,_0x215943){var _0x1cae65={};var _0x63a78f={};var _0x22a7ee;var _0x4d19e5;return db['DeskConfiguration']['findOne']({'where':{'id':_0x3387f8[_0x8f60('0x49')]['id']}})[_0x8f60('0x24')](handleEntityNotFound(_0x3c2967,null))[_0x8f60('0x24')](function(_0x569e30){if(_0x569e30){_0x22a7ee=_0x569e30;_0x63a78f[_0x8f60('0x2f')]=_[_0x8f60('0x31')](db[_0x8f60('0x50')][_0x8f60('0x2c')]);_0x63a78f[_0x8f60('0x30')]=_[_0x8f60('0x31')](_0x3387f8[_0x8f60('0x30')]);_0x63a78f[_0x8f60('0x32')]=_[_0x8f60('0x33')](_0x63a78f[_0x8f60('0x2f')],_0x63a78f['query']);_0x1cae65[_0x8f60('0x34')]=_['intersection'](_0x63a78f[_0x8f60('0x2f')],qs[_0x8f60('0x35')](_0x3387f8[_0x8f60('0x30')]['fields']));_0x1cae65['attributes']=_0x1cae65[_0x8f60('0x34')]['length']?_0x1cae65[_0x8f60('0x34')]:_0x63a78f[_0x8f60('0x2f')];_0x1cae65['order']=qs[_0x8f60('0x3a')](_0x3387f8[_0x8f60('0x30')][_0x8f60('0x3a')]);_0x1cae65['where']=qs[_0x8f60('0x32')](_[_0x8f60('0x3c')](_0x3387f8[_0x8f60('0x30')],_0x63a78f[_0x8f60('0x32')]));if(_0x3387f8[_0x8f60('0x30')][_0x8f60('0x3d')]){_0x1cae65[_0x8f60('0x3b')]=_[_0x8f60('0x3f')](_0x1cae65[_0x8f60('0x3b')],{'$or':_[_0x8f60('0x2a')](_0x1cae65[_0x8f60('0x34')],function(_0x66380b){var _0x366f0a={};_0x366f0a[_0x66380b]={'$like':'%'+_0x3387f8[_0x8f60('0x30')][_0x8f60('0x3d')]+'%'};return _0x366f0a;})});}_0x1cae65=_[_0x8f60('0x3f')]({},_0x1cae65,_0x3387f8['options']);return _0x22a7ee[_0x8f60('0x4f')](_0x1cae65);}})[_0x8f60('0x24')](function(_0x314c14){if(_0x314c14){_0x4d19e5=_0x314c14[_0x8f60('0x36')];if(!_0x3387f8['query'][_0x8f60('0x37')](_0x8f60('0x38'))){_0x1cae65[_0x8f60('0x1d')]=qs[_0x8f60('0x1d')](_0x3387f8['query'][_0x8f60('0x1d')]);_0x1cae65[_0x8f60('0x1a')]=qs[_0x8f60('0x1a')](_0x3387f8[_0x8f60('0x30')][_0x8f60('0x1a')]);}return _0x22a7ee[_0x8f60('0x4f')](_0x1cae65);}})['then'](function(_0x56b7f8){if(_0x56b7f8){return _0x56b7f8?{'count':_0x4d19e5,'rows':_0x56b7f8}:null;}})[_0x8f60('0x24')](respondWithResult(_0x3c2967,null))['catch'](handleError(_0x3c2967,null));};exports[_0x8f60('0x51')]=function(_0x181aaf,_0x39988a,_0x14094d){if(_0x181aaf[_0x8f60('0x48')]['id']){delete _0x181aaf[_0x8f60('0x48')]['id'];}return db[_0x8f60('0x2b')][_0x8f60('0x4e')]({'where':{'id':_0x181aaf['params']['id']}})['then'](handleEntityNotFound(_0x39988a,null))['then'](function(_0x257e38){if(_0x257e38){return _0x257e38[_0x8f60('0x51')](_0x181aaf[_0x8f60('0x48')]['ids']||[]);}return null;})[_0x8f60('0x24')](respondWithResult(_0x39988a,null))['catch'](handleError(_0x39988a,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 37e3994..d533f77 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 _0xfee9=['moment','bluebird','request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash','util','api'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xfee9,0x1ad));var _0x9fee=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfee9[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x9fee('0x0'));var util=require(_0x9fee('0x1'));var logger=require('../../config/logger')(_0x9fee('0x2'));var moment=require(_0x9fee('0x3'));var BPromise=require(_0x9fee('0x4'));var rp=require(_0x9fee('0x5'));var fs=require('fs');var path=require(_0x9fee('0x6'));var rimraf=require('rimraf');var config=require(_0x9fee('0x7'));var attributes=require(_0x9fee('0x8'));module[_0x9fee('0x9')]=function(_0x158363,_0x367de5){return _0x158363[_0x9fee('0xa')](_0x9fee('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1858=['define','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x1858,0x184));var _0x8185=function(_0xaaa4d3,_0x37574b){_0xaaa4d3=_0xaaa4d3-0x0;var _0x1b8bd2=_0x1858[_0xaaa4d3];return _0x1b8bd2;};'use strict';var _=require(_0x8185('0x0'));var util=require('util');var logger=require(_0x8185('0x1'))('api');var moment=require(_0x8185('0x2'));var BPromise=require(_0x8185('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8185('0x4'));var rimraf=require(_0x8185('0x5'));var config=require(_0x8185('0x6'));var attributes=require(_0x8185('0x7'));module['exports']=function(_0x720d96,_0x2555e7){return _0x720d96[_0x8185('0x8')]('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','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 7f8de68..303d43f 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 _0xe5e8=['then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x52327c,_0x4bfb7d){var _0x1ca3d7=function(_0x36bf15){while(--_0x36bf15){_0x52327c['push'](_0x52327c['shift']());}};_0x1ca3d7(++_0x4bfb7d);}(_0xe5e8,0xe7));var _0x8e5e=function(_0x2a95ec,_0x440553){_0x2a95ec=_0x2a95ec-0x0;var _0x7ee8ac=_0xe5e8[_0x2a95ec];return _0x7ee8ac;};'use strict';var _=require(_0x8e5e('0x0'));var util=require(_0x8e5e('0x1'));var moment=require(_0x8e5e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e5e('0x3'))['db'];var utils=require(_0x8e5e('0x4'));var logger=require('../../config/logger')(_0x8e5e('0x5'));var config=require(_0x8e5e('0x6'));var jayson=require(_0x8e5e('0x7'));var client=jayson[_0x8e5e('0x8')][_0x8e5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c823d,_0xb3a3c8,_0xfbc454){return new BPromise(function(_0x10273e,_0x4ad9b0){return client[_0x8e5e('0xa')](_0x4c823d,_0xfbc454)[_0x8e5e('0xb')](function(_0x3f5935){logger[_0x8e5e('0xc')](_0x8e5e('0xd'),_0xb3a3c8,_0x8e5e('0xe'));logger[_0x8e5e('0xf')](_0x8e5e('0x10'),_0xb3a3c8,_0x8e5e('0xe'),JSON[_0x8e5e('0x11')](_0x3f5935));if(_0x3f5935[_0x8e5e('0x12')]){if(_0x3f5935[_0x8e5e('0x12')][_0x8e5e('0x13')]===0x1f4){logger[_0x8e5e('0x12')](_0x8e5e('0xd'),_0xb3a3c8,_0x3f5935[_0x8e5e('0x12')][_0x8e5e('0x14')]);return _0x4ad9b0(_0x3f5935[_0x8e5e('0x12')]['message']);}logger[_0x8e5e('0x12')](_0x8e5e('0xd'),_0xb3a3c8,_0x3f5935[_0x8e5e('0x12')][_0x8e5e('0x14')]);return _0x10273e(_0x3f5935[_0x8e5e('0x12')]['message']);}else{logger[_0x8e5e('0xc')](_0x8e5e('0xd'),_0xb3a3c8,_0x8e5e('0xe'));_0x10273e(_0x3f5935[_0x8e5e('0x15')]['message']);}})['catch'](function(_0x25141d){logger[_0x8e5e('0x12')](_0x8e5e('0xd'),_0xb3a3c8,_0x25141d);_0x4ad9b0(_0x25141d);});});} \ No newline at end of file +var _0x8ad6=['rpc','../../config/environment','jayson/promise','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xfd92c8,_0x464904){var _0x503100=function(_0x120bdb){while(--_0x120bdb){_0xfd92c8['push'](_0xfd92c8['shift']());}};_0x503100(++_0x464904);}(_0x8ad6,0x123));var _0x68ad=function(_0x29dd41,_0x9b7fa){_0x29dd41=_0x29dd41-0x0;var _0x398e94=_0x8ad6[_0x29dd41];return _0x398e94;};'use strict';var _=require(_0x68ad('0x0'));var util=require(_0x68ad('0x1'));var moment=require(_0x68ad('0x2'));var BPromise=require(_0x68ad('0x3'));var rs=require(_0x68ad('0x4'));var fs=require('fs');var Redis=require(_0x68ad('0x5'));var db=require(_0x68ad('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ad('0x7'))(_0x68ad('0x8'));var config=require(_0x68ad('0x9'));var jayson=require(_0x68ad('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x150274,_0x3efd10,_0x11a465){return new BPromise(function(_0x4a57b1,_0x5de7d6){return client[_0x68ad('0xb')](_0x150274,_0x11a465)[_0x68ad('0xc')](function(_0x2fd475){logger[_0x68ad('0xd')](_0x68ad('0xe'),_0x3efd10,_0x68ad('0xf'));logger['debug'](_0x68ad('0x10'),_0x3efd10,_0x68ad('0xf'),JSON[_0x68ad('0x11')](_0x2fd475));if(_0x2fd475[_0x68ad('0x12')]){if(_0x2fd475[_0x68ad('0x12')][_0x68ad('0x13')]===0x1f4){logger['error'](_0x68ad('0xe'),_0x3efd10,_0x2fd475[_0x68ad('0x12')][_0x68ad('0x14')]);return _0x5de7d6(_0x2fd475[_0x68ad('0x12')]['message']);}logger['error'](_0x68ad('0xe'),_0x3efd10,_0x2fd475['error'][_0x68ad('0x14')]);return _0x4a57b1(_0x2fd475[_0x68ad('0x12')][_0x68ad('0x14')]);}else{logger[_0x68ad('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x3efd10,'request\x20sent');_0x4a57b1(_0x2fd475[_0x68ad('0x15')]['message']);}})[_0x68ad('0x16')](function(_0x13907d){logger[_0x68ad('0x12')](_0x68ad('0xe'),_0x3efd10,_0x13907d);_0x5de7d6(_0x13907d);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 301a63a..3f80dff 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 _0x5e6e=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5976f8,_0x1265b7){var _0x179715=function(_0x2b2c4b){while(--_0x2b2c4b){_0x5976f8['push'](_0x5976f8['shift']());}};_0x179715(++_0x1265b7);}(_0x5e6e,0x74));var _0xe5e6=function(_0x56d213,_0x2abf5d){_0x56d213=_0x56d213-0x0;var _0x347d68=_0x5e6e[_0x56d213];return _0x347d68;};'use strict';var multer=require(_0xe5e6('0x0'));var util=require(_0xe5e6('0x1'));var path=require(_0xe5e6('0x2'));var timeout=require(_0xe5e6('0x3'));var express=require(_0xe5e6('0x4'));var router=express[_0xe5e6('0x5')]();var fs_extra=require(_0xe5e6('0x6'));var auth=require(_0xe5e6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe5e6('0x8'));var controller=require(_0xe5e6('0x9'));router[_0xe5e6('0xa')]('/',auth[_0xe5e6('0xb')](),controller[_0xe5e6('0xc')]);router['get'](_0xe5e6('0xd'),auth[_0xe5e6('0xb')](),controller[_0xe5e6('0xe')]);router[_0xe5e6('0xf')]('/',auth[_0xe5e6('0xb')](),controller[_0xe5e6('0x10')]);router['put']('/:id',auth[_0xe5e6('0xb')](),controller['update']);router[_0xe5e6('0x11')](_0xe5e6('0xd'),auth[_0xe5e6('0xb')](),controller[_0xe5e6('0x12')]);module['exports']=router; \ No newline at end of file +var _0x2906=['delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','show','create','put','/:id','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2906,0xe0));var _0x6290=function(_0x45310c,_0x106a46){_0x45310c=_0x45310c-0x0;var _0x5e941f=_0x2906[_0x45310c];return _0x5e941f;};'use strict';var multer=require(_0x6290('0x0'));var util=require(_0x6290('0x1'));var path=require('path');var timeout=require(_0x6290('0x2'));var express=require('express');var router=express[_0x6290('0x3')]();var fs_extra=require(_0x6290('0x4'));var auth=require(_0x6290('0x5'));var interaction=require(_0x6290('0x6'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router['get']('/',auth[_0x6290('0x7')](),controller['index']);router[_0x6290('0x8')]('/:id',auth[_0x6290('0x7')](),controller[_0x6290('0x9')]);router['post']('/',auth[_0x6290('0x7')](),controller[_0x6290('0xa')]);router[_0x6290('0xb')](_0x6290('0xc'),auth[_0x6290('0x7')](),controller[_0x6290('0xd')]);router[_0x6290('0xe')](_0x6290('0xc'),auth[_0x6290('0x7')](),controller[_0x6290('0xf')]);module[_0x6290('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index be138e5..c4e338b 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 _0xcaf3=['string','STRING','ENUM','sequelize','variable','customVariable','keyValue'];(function(_0x41aa9f,_0x345b5a){var _0x2a3d2b=function(_0x553481){while(--_0x553481){_0x41aa9f['push'](_0x41aa9f['shift']());}};_0x2a3d2b(++_0x345b5a);}(_0xcaf3,0x96));var _0x3caf=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0xcaf3[_0x483d8b];return _0x6500f1;};'use strict';var Sequelize=require(_0x3caf('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x3caf('0x1'),_0x3caf('0x2'),_0x3caf('0x3'),'picklist'),'defaultValue':_0x3caf('0x4')},'content':{'type':Sequelize[_0x3caf('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3caf('0x6')](_0x3caf('0x4'),'variable',_0x3caf('0x2'))},'keyContent':{'type':Sequelize[_0x3caf('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3caf('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3caf('0x5')]}}; \ No newline at end of file +var _0x63c8=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports'];(function(_0x3ec6eb,_0x27169e){var _0x441ab1=function(_0x2c7f7a){while(--_0x2c7f7a){_0x3ec6eb['push'](_0x3ec6eb['shift']());}};_0x441ab1(++_0x27169e);}(_0x63c8,0x1ca));var _0x863c=function(_0x27cd3f,_0x27fba0){_0x27cd3f=_0x27cd3f-0x0;var _0x134584=_0x63c8[_0x27cd3f];return _0x134584;};'use strict';var Sequelize=require('sequelize');module[_0x863c('0x0')]={'type':{'type':Sequelize[_0x863c('0x1')](_0x863c('0x2'),_0x863c('0x3'),_0x863c('0x4'),_0x863c('0x5'),_0x863c('0x6')),'defaultValue':_0x863c('0x2')},'content':{'type':Sequelize[_0x863c('0x7')]},'key':{'type':Sequelize[_0x863c('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x863c('0x2'),'variable',_0x863c('0x4'))},'keyContent':{'type':Sequelize[_0x863c('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x863c('0x7')]},'customField':{'type':Sequelize[_0x863c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x863c('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index c1b43de..6d577f5 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 _0x5419=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','DeskField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5419,0x175));var _0x9541=function(_0x1f7191,_0x37bc37){_0x1f7191=_0x1f7191-0x0;var _0x29fd0d=_0x5419[_0x1f7191];return _0x29fd0d;};'use strict';var emlformat=require(_0x9541('0x0'));var rimraf=require(_0x9541('0x1'));var zipdir=require(_0x9541('0x2'));var jsonpatch=require(_0x9541('0x3'));var rp=require(_0x9541('0x4'));var moment=require(_0x9541('0x5'));var BPromise=require(_0x9541('0x6'));var Mustache=require(_0x9541('0x7'));var util=require(_0x9541('0x8'));var path=require(_0x9541('0x9'));var sox=require('sox');var csv=require(_0x9541('0xa'));var ejs=require(_0x9541('0xb'));var fs=require('fs');var fs_extra=require(_0x9541('0xc'));var _=require(_0x9541('0xd'));var squel=require(_0x9541('0xe'));var crypto=require(_0x9541('0xf'));var jsforce=require(_0x9541('0x10'));var deskjs=require(_0x9541('0x11'));var toCsv=require('to-csv');var querystring=require(_0x9541('0x12'));var Papa=require('papaparse');var Redis=require(_0x9541('0x13'));var authService=require(_0x9541('0x14'));var qs=require(_0x9541('0x15'));var as=require(_0x9541('0x16'));var hardwareService=require(_0x9541('0x17'));var logger=require(_0x9541('0x18'))(_0x9541('0x19'));var utils=require('../../config/utils');var config=require(_0x9541('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x75669e,_0x4f97a9){_0x4f97a9=_0x4f97a9||0xcc;return function(_0x40cc60){if(_0x40cc60){return _0x75669e['sendStatus'](_0x4f97a9);}return _0x75669e[_0x9541('0x1b')](_0x4f97a9)[_0x9541('0x1c')]();};}function respondWithResult(_0x1ffa34,_0x38ab15){_0x38ab15=_0x38ab15||0xc8;return function(_0x28316e){if(_0x28316e){return _0x1ffa34[_0x9541('0x1b')](_0x38ab15)['json'](_0x28316e);}};}function respondWithFilteredResult(_0x37a48e,_0x548cdc){return function(_0x64b64a){if(_0x64b64a){var _0x569b6d=typeof _0x548cdc[_0x9541('0x1d')]==='undefined'&&typeof _0x548cdc[_0x9541('0x1e')]===_0x9541('0x1f');var _0xcc7699=_0x64b64a[_0x9541('0x20')];var _0xf5a87e=_0x569b6d?0x0:_0x548cdc[_0x9541('0x1d')];var _0x50e39f=_0x569b6d?_0x64b64a['count']:_0x548cdc[_0x9541('0x1d')]+_0x548cdc[_0x9541('0x1e')];var _0x594ba4;if(_0x50e39f>=_0xcc7699){_0x50e39f=_0xcc7699;_0x594ba4=0xc8;}else{_0x594ba4=0xce;}_0x37a48e['status'](_0x594ba4);return _0x37a48e[_0x9541('0x21')](_0x9541('0x22'),_0xf5a87e+'-'+_0x50e39f+'/'+_0xcc7699)[_0x9541('0x23')](_0x64b64a);}return null;};}function patchUpdates(_0xc6683a){return function(_0xfbcffc){try{jsonpatch[_0x9541('0x24')](_0xfbcffc,_0xc6683a,!![]);}catch(_0xf225bb){return BPromise[_0x9541('0x25')](_0xf225bb);}return _0xfbcffc[_0x9541('0x26')]();};}function saveUpdates(_0x1f2d91,_0x43bb4c){return function(_0x54a827){if(_0x54a827){return _0x54a827[_0x9541('0x27')](_0x1f2d91)[_0x9541('0x28')](function(_0x41abc5){return _0x41abc5;});}return null;};}function removeEntity(_0x244ecc,_0x101374){return function(_0x2f6b0a){if(_0x2f6b0a){return _0x2f6b0a[_0x9541('0x29')]()[_0x9541('0x28')](function(){_0x244ecc[_0x9541('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35ec2c,_0x48987e){return function(_0xbaf6cb){if(!_0xbaf6cb){_0x35ec2c[_0x9541('0x2a')](0x194);}return _0xbaf6cb;};}function handleError(_0x123ed5,_0xc8dcf2){_0xc8dcf2=_0xc8dcf2||0x1f4;return function(_0x4b6faf){logger[_0x9541('0x2b')](_0x4b6faf[_0x9541('0x2c')]);if(_0x4b6faf[_0x9541('0x2d')]){delete _0x4b6faf[_0x9541('0x2d')];}_0x123ed5['status'](_0xc8dcf2)[_0x9541('0x2e')](_0x4b6faf);};}exports['index']=function(_0x40a1bc,_0x19c710){var _0x5869f4={},_0xf82d59={},_0x2b2883={'count':0x0,'rows':[]};var _0x4f4d23=_[_0x9541('0x2f')](db[_0x9541('0x30')]['rawAttributes'],function(_0x259243){return{'name':_0x259243['fieldName'],'type':_0x259243[_0x9541('0x31')][_0x9541('0x32')]};});_0xf82d59[_0x9541('0x33')]=_[_0x9541('0x2f')](_0x4f4d23,_0x9541('0x2d'));_0xf82d59[_0x9541('0x34')]=_[_0x9541('0x35')](_0x40a1bc['query']);_0xf82d59[_0x9541('0x36')]=_[_0x9541('0x37')](_0xf82d59[_0x9541('0x33')],_0xf82d59[_0x9541('0x34')]);_0x5869f4[_0x9541('0x38')]=_[_0x9541('0x37')](_0xf82d59[_0x9541('0x33')],qs[_0x9541('0x39')](_0x40a1bc[_0x9541('0x34')][_0x9541('0x39')]));_0x5869f4[_0x9541('0x38')]=_0x5869f4[_0x9541('0x38')][_0x9541('0x3a')]?_0x5869f4[_0x9541('0x38')]:_0xf82d59[_0x9541('0x33')];if(!_0x40a1bc[_0x9541('0x34')][_0x9541('0x3b')](_0x9541('0x3c'))){_0x5869f4[_0x9541('0x1e')]=qs[_0x9541('0x1e')](_0x40a1bc['query'][_0x9541('0x1e')]);_0x5869f4['offset']=qs['offset'](_0x40a1bc['query']['offset']);}_0x5869f4[_0x9541('0x3d')]=qs[_0x9541('0x3e')](_0x40a1bc[_0x9541('0x34')]['sort']);_0x5869f4[_0x9541('0x3f')]=qs[_0x9541('0x36')](_['pick'](_0x40a1bc[_0x9541('0x34')],_0xf82d59[_0x9541('0x36')]),_0x4f4d23);if(_0x40a1bc[_0x9541('0x34')][_0x9541('0x40')]){_0x5869f4[_0x9541('0x3f')]=_[_0x9541('0x41')](_0x5869f4[_0x9541('0x3f')],{'$or':_[_0x9541('0x2f')](_0x4f4d23,function(_0x39b6d9){if(_0x39b6d9[_0x9541('0x31')]!=='VIRTUAL'){var _0x4d48c0={};_0x4d48c0[_0x39b6d9[_0x9541('0x2d')]]={'$like':'%'+_0x40a1bc[_0x9541('0x34')][_0x9541('0x40')]+'%'};return _0x4d48c0;}})});}_0x5869f4=_[_0x9541('0x41')]({},_0x5869f4,_0x40a1bc[_0x9541('0x42')]);var _0x42f654={'where':_0x5869f4[_0x9541('0x3f')]};return db[_0x9541('0x30')][_0x9541('0x20')](_0x42f654)['then'](function(_0x264f17){_0x2b2883['count']=_0x264f17;if(_0x40a1bc[_0x9541('0x34')][_0x9541('0x43')]){_0x5869f4[_0x9541('0x44')]=[{'all':!![]}];}return db[_0x9541('0x30')]['findAll'](_0x5869f4);})[_0x9541('0x28')](function(_0x2b4b85){_0x2b2883[_0x9541('0x45')]=_0x2b4b85;return _0x2b2883;})[_0x9541('0x28')](respondWithFilteredResult(_0x19c710,_0x5869f4))[_0x9541('0x46')](handleError(_0x19c710,null));};exports[_0x9541('0x47')]=function(_0x3aee70,_0x410a11){var _0x1be782={'raw':!![],'where':{'id':_0x3aee70['params']['id']}},_0x51584e={};_0x51584e[_0x9541('0x33')]=_[_0x9541('0x35')](db[_0x9541('0x30')]['rawAttributes']);_0x51584e[_0x9541('0x34')]=_['keys'](_0x3aee70[_0x9541('0x34')]);_0x51584e['filters']=_[_0x9541('0x37')](_0x51584e[_0x9541('0x33')],_0x51584e[_0x9541('0x34')]);_0x1be782[_0x9541('0x38')]=_['intersection'](_0x51584e[_0x9541('0x33')],qs[_0x9541('0x39')](_0x3aee70[_0x9541('0x34')]['fields']));_0x1be782[_0x9541('0x38')]=_0x1be782[_0x9541('0x38')][_0x9541('0x3a')]?_0x1be782[_0x9541('0x38')]:_0x51584e['model'];if(_0x3aee70['query']['includeAll']){_0x1be782['include']=[{'all':!![]}];}_0x1be782=_[_0x9541('0x41')]({},_0x1be782,_0x3aee70[_0x9541('0x42')]);return db[_0x9541('0x30')][_0x9541('0x48')](_0x1be782)[_0x9541('0x28')](handleEntityNotFound(_0x410a11,null))['then'](respondWithResult(_0x410a11,null))[_0x9541('0x46')](handleError(_0x410a11,null));};exports[_0x9541('0x49')]=function(_0x458b3c,_0x4ca001){return db['DeskField'][_0x9541('0x49')](_0x458b3c[_0x9541('0x4a')],{})[_0x9541('0x28')](respondWithResult(_0x4ca001,0xc9))['catch'](handleError(_0x4ca001,null));};exports['update']=function(_0x47082f,_0x22606e){if(_0x47082f[_0x9541('0x4a')]['id']){delete _0x47082f[_0x9541('0x4a')]['id'];}return db[_0x9541('0x30')][_0x9541('0x48')]({'where':{'id':_0x47082f[_0x9541('0x4b')]['id']}})['then'](handleEntityNotFound(_0x22606e,null))[_0x9541('0x28')](saveUpdates(_0x47082f[_0x9541('0x4a')],null))['then'](respondWithResult(_0x22606e,null))['catch'](handleError(_0x22606e,null));};exports[_0x9541('0x29')]=function(_0x170c93,_0x460051){return db[_0x9541('0x30')][_0x9541('0x48')]({'where':{'id':_0x170c93[_0x9541('0x4b')]['id']}})[_0x9541('0x28')](handleEntityNotFound(_0x460051,null))['then'](removeEntity(_0x460051,null))['catch'](handleError(_0x460051,null));}; \ No newline at end of file +var _0xe641=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','update','then','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','key','query','keys','intersection','attributes','model','fields'];(function(_0x3e433f,_0x3ff971){var _0x3e5788=function(_0x571a76){while(--_0x571a76){_0x3e433f['push'](_0x3e433f['shift']());}};_0x3e5788(++_0x3ff971);}(_0xe641,0x1ec));var _0x1e64=function(_0x536bc7,_0x1e065f){_0x536bc7=_0x536bc7-0x0;var _0x11f83e=_0xe641[_0x536bc7];return _0x11f83e;};'use strict';var emlformat=require(_0x1e64('0x0'));var rimraf=require(_0x1e64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e64('0x2'));var rp=require(_0x1e64('0x3'));var moment=require(_0x1e64('0x4'));var BPromise=require(_0x1e64('0x5'));var Mustache=require(_0x1e64('0x6'));var util=require(_0x1e64('0x7'));var path=require(_0x1e64('0x8'));var sox=require(_0x1e64('0x9'));var csv=require(_0x1e64('0xa'));var ejs=require(_0x1e64('0xb'));var fs=require('fs');var fs_extra=require(_0x1e64('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1e64('0xd'));var jsforce=require(_0x1e64('0xe'));var deskjs=require(_0x1e64('0xf'));var toCsv=require(_0x1e64('0xa'));var querystring=require(_0x1e64('0x10'));var Papa=require('papaparse');var Redis=require(_0x1e64('0x11'));var authService=require(_0x1e64('0x12'));var qs=require(_0x1e64('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e64('0x14'))(_0x1e64('0x15'));var utils=require(_0x1e64('0x16'));var config=require(_0x1e64('0x17'));var licenseUtil=require(_0x1e64('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cadce,_0x39e96d){_0x39e96d=_0x39e96d||0xcc;return function(_0x3a8937){if(_0x3a8937){return _0x3cadce[_0x1e64('0x19')](_0x39e96d);}return _0x3cadce[_0x1e64('0x1a')](_0x39e96d)[_0x1e64('0x1b')]();};}function respondWithResult(_0x2b4a6a,_0x18b771){_0x18b771=_0x18b771||0xc8;return function(_0x4ec92a){if(_0x4ec92a){return _0x2b4a6a[_0x1e64('0x1a')](_0x18b771)[_0x1e64('0x1c')](_0x4ec92a);}};}function respondWithFilteredResult(_0x263c0d,_0x11e4a5){return function(_0x16b1b2){if(_0x16b1b2){var _0x3a513c=typeof _0x11e4a5['offset']==='undefined'&&typeof _0x11e4a5['limit']===_0x1e64('0x1d');var _0x2a48e2=_0x16b1b2[_0x1e64('0x1e')];var _0x959359=_0x3a513c?0x0:_0x11e4a5[_0x1e64('0x1f')];var _0x4b6066=_0x3a513c?_0x16b1b2[_0x1e64('0x1e')]:_0x11e4a5[_0x1e64('0x1f')]+_0x11e4a5[_0x1e64('0x20')];var _0x321e2d;if(_0x4b6066>=_0x2a48e2){_0x4b6066=_0x2a48e2;_0x321e2d=0xc8;}else{_0x321e2d=0xce;}_0x263c0d['status'](_0x321e2d);return _0x263c0d[_0x1e64('0x21')]('Content-Range',_0x959359+'-'+_0x4b6066+'/'+_0x2a48e2)[_0x1e64('0x1c')](_0x16b1b2);}return null;};}function patchUpdates(_0x2d4980){return function(_0x27e368){try{jsonpatch[_0x1e64('0x22')](_0x27e368,_0x2d4980,!![]);}catch(_0x1bbc69){return BPromise['reject'](_0x1bbc69);}return _0x27e368[_0x1e64('0x23')]();};}function saveUpdates(_0x1d32ee,_0x15c18b){return function(_0x1754e8){if(_0x1754e8){return _0x1754e8[_0x1e64('0x24')](_0x1d32ee)[_0x1e64('0x25')](function(_0x5a005f){return _0x5a005f;});}return null;};}function removeEntity(_0x46bb6f,_0x582b6d){return function(_0x5c49b0){if(_0x5c49b0){return _0x5c49b0['destroy']()[_0x1e64('0x25')](function(){_0x46bb6f[_0x1e64('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x546f30,_0x18065d){return function(_0x1b533e){if(!_0x1b533e){_0x546f30[_0x1e64('0x19')](0x194);}return _0x1b533e;};}function handleError(_0x135131,_0x3427d3){_0x3427d3=_0x3427d3||0x1f4;return function(_0x4cda06){logger[_0x1e64('0x26')](_0x4cda06[_0x1e64('0x27')]);if(_0x4cda06[_0x1e64('0x28')]){delete _0x4cda06[_0x1e64('0x28')];}_0x135131[_0x1e64('0x1a')](_0x3427d3)[_0x1e64('0x29')](_0x4cda06);};}exports[_0x1e64('0x2a')]=function(_0x23abcb,_0x5d79f6){var _0x4f861a={},_0x49f0c5={},_0xa530a2={'count':0x0,'rows':[]};var _0x39e763=_[_0x1e64('0x2b')](db[_0x1e64('0x2c')][_0x1e64('0x2d')],function(_0x6b94f0){return{'name':_0x6b94f0[_0x1e64('0x2e')],'type':_0x6b94f0['type'][_0x1e64('0x2f')]};});_0x49f0c5['model']=_[_0x1e64('0x2b')](_0x39e763,_0x1e64('0x28'));_0x49f0c5[_0x1e64('0x30')]=_[_0x1e64('0x31')](_0x23abcb[_0x1e64('0x30')]);_0x49f0c5['filters']=_[_0x1e64('0x32')](_0x49f0c5['model'],_0x49f0c5['query']);_0x4f861a[_0x1e64('0x33')]=_[_0x1e64('0x32')](_0x49f0c5[_0x1e64('0x34')],qs[_0x1e64('0x35')](_0x23abcb[_0x1e64('0x30')][_0x1e64('0x35')]));_0x4f861a[_0x1e64('0x33')]=_0x4f861a[_0x1e64('0x33')][_0x1e64('0x36')]?_0x4f861a[_0x1e64('0x33')]:_0x49f0c5['model'];if(!_0x23abcb[_0x1e64('0x30')][_0x1e64('0x37')](_0x1e64('0x38'))){_0x4f861a[_0x1e64('0x20')]=qs[_0x1e64('0x20')](_0x23abcb['query'][_0x1e64('0x20')]);_0x4f861a[_0x1e64('0x1f')]=qs['offset'](_0x23abcb[_0x1e64('0x30')][_0x1e64('0x1f')]);}_0x4f861a[_0x1e64('0x39')]=qs[_0x1e64('0x3a')](_0x23abcb[_0x1e64('0x30')][_0x1e64('0x3a')]);_0x4f861a[_0x1e64('0x3b')]=qs[_0x1e64('0x3c')](_[_0x1e64('0x3d')](_0x23abcb[_0x1e64('0x30')],_0x49f0c5['filters']),_0x39e763);if(_0x23abcb['query'][_0x1e64('0x3e')]){_0x4f861a[_0x1e64('0x3b')]=_[_0x1e64('0x3f')](_0x4f861a[_0x1e64('0x3b')],{'$or':_[_0x1e64('0x2b')](_0x39e763,function(_0x3c90b7){if(_0x3c90b7[_0x1e64('0x40')]!==_0x1e64('0x41')){var _0x23f08d={};_0x23f08d[_0x3c90b7[_0x1e64('0x28')]]={'$like':'%'+_0x23abcb['query'][_0x1e64('0x3e')]+'%'};return _0x23f08d;}})});}_0x4f861a=_[_0x1e64('0x3f')]({},_0x4f861a,_0x23abcb[_0x1e64('0x42')]);var _0x5a84a4={'where':_0x4f861a[_0x1e64('0x3b')]};return db['DeskField'][_0x1e64('0x1e')](_0x5a84a4)[_0x1e64('0x25')](function(_0x44d930){_0xa530a2[_0x1e64('0x1e')]=_0x44d930;if(_0x23abcb[_0x1e64('0x30')]['includeAll']){_0x4f861a['include']=[{'all':!![]}];}return db[_0x1e64('0x2c')][_0x1e64('0x43')](_0x4f861a);})[_0x1e64('0x25')](function(_0x4b73cb){_0xa530a2[_0x1e64('0x44')]=_0x4b73cb;return _0xa530a2;})[_0x1e64('0x25')](respondWithFilteredResult(_0x5d79f6,_0x4f861a))[_0x1e64('0x45')](handleError(_0x5d79f6,null));};exports[_0x1e64('0x46')]=function(_0x4db661,_0x133976){var _0x335201={'raw':!![],'where':{'id':_0x4db661[_0x1e64('0x47')]['id']}},_0x424d83={};_0x424d83[_0x1e64('0x34')]=_['keys'](db[_0x1e64('0x2c')][_0x1e64('0x2d')]);_0x424d83[_0x1e64('0x30')]=_[_0x1e64('0x31')](_0x4db661[_0x1e64('0x30')]);_0x424d83[_0x1e64('0x3c')]=_['intersection'](_0x424d83[_0x1e64('0x34')],_0x424d83['query']);_0x335201[_0x1e64('0x33')]=_['intersection'](_0x424d83[_0x1e64('0x34')],qs[_0x1e64('0x35')](_0x4db661[_0x1e64('0x30')][_0x1e64('0x35')]));_0x335201[_0x1e64('0x33')]=_0x335201[_0x1e64('0x33')][_0x1e64('0x36')]?_0x335201[_0x1e64('0x33')]:_0x424d83[_0x1e64('0x34')];if(_0x4db661['query'][_0x1e64('0x48')]){_0x335201[_0x1e64('0x49')]=[{'all':!![]}];}_0x335201=_['merge']({},_0x335201,_0x4db661[_0x1e64('0x42')]);return db[_0x1e64('0x2c')][_0x1e64('0x4a')](_0x335201)[_0x1e64('0x25')](handleEntityNotFound(_0x133976,null))[_0x1e64('0x25')](respondWithResult(_0x133976,null))['catch'](handleError(_0x133976,null));};exports[_0x1e64('0x4b')]=function(_0x2c9a4f,_0x417c96){return db['DeskField'][_0x1e64('0x4b')](_0x2c9a4f['body'],{})[_0x1e64('0x25')](respondWithResult(_0x417c96,0xc9))['catch'](handleError(_0x417c96,null));};exports['update']=function(_0x2bc7c8,_0x1e76bd){if(_0x2bc7c8['body']['id']){delete _0x2bc7c8['body']['id'];}return db[_0x1e64('0x2c')]['find']({'where':{'id':_0x2bc7c8[_0x1e64('0x47')]['id']}})[_0x1e64('0x25')](handleEntityNotFound(_0x1e76bd,null))[_0x1e64('0x25')](saveUpdates(_0x2bc7c8[_0x1e64('0x4c')],null))[_0x1e64('0x25')](respondWithResult(_0x1e76bd,null))[_0x1e64('0x45')](handleError(_0x1e76bd,null));};exports[_0x1e64('0x4d')]=function(_0x5a4c57,_0x4dea92){return db[_0x1e64('0x2c')][_0x1e64('0x4a')]({'where':{'id':_0x5a4c57[_0x1e64('0x47')]['id']}})[_0x1e64('0x25')](handleEntityNotFound(_0x4dea92,null))[_0x1e64('0x25')](removeEntity(_0x4dea92,null))[_0x1e64('0x45')](handleError(_0x4dea92,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 10d0daa..3e33e0a 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 _0xe48d=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xe48d,0x70));var _0xde48=function(_0x25efd2,_0x22ff9d){_0x25efd2=_0x25efd2-0x0;var _0x507e82=_0xe48d[_0x25efd2];return _0x507e82;};'use strict';var _=require(_0xde48('0x0'));var util=require(_0xde48('0x1'));var logger=require(_0xde48('0x2'))('api');var moment=require(_0xde48('0x3'));var BPromise=require(_0xde48('0x4'));var rp=require(_0xde48('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde48('0x6'));var config=require(_0xde48('0x7'));var attributes=require(_0xde48('0x8'));module[_0xde48('0x9')]=function(_0x10a39e,_0x1a9198){return _0x10a39e[_0xde48('0xa')](_0xde48('0xb'),attributes,{'tableName':_0xde48('0xc'),'paranoid':![],'indexes':[{'name':_0xde48('0xd'),'fields':[_0xde48('0xe'),_0xde48('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xecf3=['../../config/logger','api','moment','bluebird','path','rimraf','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util'];(function(_0x454282,_0x609e3){var _0x398dff=function(_0x4b5c06){while(--_0x4b5c06){_0x454282['push'](_0x454282['shift']());}};_0x398dff(++_0x609e3);}(_0xecf3,0x1de));var _0x3ecf=function(_0x285de6,_0x2054da){_0x285de6=_0x285de6-0x0;var _0x192f8e=_0xecf3[_0x285de6];return _0x192f8e;};'use strict';var _=require(_0x3ecf('0x0'));var util=require(_0x3ecf('0x1'));var logger=require(_0x3ecf('0x2'))(_0x3ecf('0x3'));var moment=require(_0x3ecf('0x4'));var BPromise=require(_0x3ecf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ecf('0x6'));var rimraf=require(_0x3ecf('0x7'));var config=require('../../config/environment');var attributes=require(_0x3ecf('0x8'));module['exports']=function(_0x3539b7,_0x106f1a){return _0x3539b7[_0x3ecf('0x9')](_0x3ecf('0xa'),attributes,{'tableName':_0x3ecf('0xb'),'paranoid':![],'indexes':[{'name':_0x3ecf('0xc'),'fields':[_0x3ecf('0xd'),_0x3ecf('0xe')],'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 330c4fa..61537b2 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 _0xfcda=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','randomstring'];(function(_0x3c2e0c,_0x62ca5f){var _0xa67634=function(_0x7fe4b5){while(--_0x7fe4b5){_0x3c2e0c['push'](_0x3c2e0c['shift']());}};_0xa67634(++_0x62ca5f);}(_0xfcda,0x1e0));var _0xafcd=function(_0x483ad7,_0x3af6a8){_0x483ad7=_0x483ad7-0x0;var _0x2a85ca=_0xfcda[_0x483ad7];return _0x2a85ca;};'use strict';var _=require(_0xafcd('0x0'));var util=require(_0xafcd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xafcd('0x2'));var fs=require('fs');var Redis=require(_0xafcd('0x3'));var db=require(_0xafcd('0x4'))['db'];var utils=require(_0xafcd('0x5'));var logger=require(_0xafcd('0x6'))('rpc');var config=require(_0xafcd('0x7'));var jayson=require(_0xafcd('0x8'));var client=jayson[_0xafcd('0x9')][_0xafcd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fa9a6,_0x38f1fd,_0x257b82){return new BPromise(function(_0x435b50,_0x4d950d){return client[_0xafcd('0xb')](_0x3fa9a6,_0x257b82)[_0xafcd('0xc')](function(_0x584952){logger[_0xafcd('0xd')](_0xafcd('0xe'),_0x38f1fd,_0xafcd('0xf'));logger[_0xafcd('0x10')](_0xafcd('0x11'),_0x38f1fd,_0xafcd('0xf'),JSON[_0xafcd('0x12')](_0x584952));if(_0x584952[_0xafcd('0x13')]){if(_0x584952['error'][_0xafcd('0x14')]===0x1f4){logger[_0xafcd('0x13')]('DeskField,\x20%s,\x20%s',_0x38f1fd,_0x584952[_0xafcd('0x13')][_0xafcd('0x15')]);return _0x4d950d(_0x584952[_0xafcd('0x13')][_0xafcd('0x15')]);}logger['error'](_0xafcd('0xe'),_0x38f1fd,_0x584952[_0xafcd('0x13')]['message']);return _0x435b50(_0x584952[_0xafcd('0x13')][_0xafcd('0x15')]);}else{logger[_0xafcd('0xd')](_0xafcd('0xe'),_0x38f1fd,_0xafcd('0xf'));_0x435b50(_0x584952[_0xafcd('0x16')][_0xafcd('0x15')]);}})['catch'](function(_0x4ea143){logger[_0xafcd('0x13')](_0xafcd('0xe'),_0x38f1fd,_0x4ea143);_0x4d950d(_0x4ea143);});});} \ No newline at end of file +var _0x1b76=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x78d9a8,_0x126665){var _0x291e16=function(_0x36666c){while(--_0x36666c){_0x78d9a8['push'](_0x78d9a8['shift']());}};_0x291e16(++_0x126665);}(_0x1b76,0x13c));var _0x61b7=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x1b76[_0x4cbf20];return _0x582ae4;};'use strict';var _=require(_0x61b7('0x0'));var util=require(_0x61b7('0x1'));var moment=require(_0x61b7('0x2'));var BPromise=require(_0x61b7('0x3'));var rs=require(_0x61b7('0x4'));var fs=require('fs');var Redis=require(_0x61b7('0x5'));var db=require(_0x61b7('0x6'))['db'];var utils=require(_0x61b7('0x7'));var logger=require(_0x61b7('0x8'))('rpc');var config=require(_0x61b7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x61b7('0xa')][_0x61b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe59ad1,_0x2eb071,_0x411738){return new BPromise(function(_0x288fc1,_0x138f56){return client[_0x61b7('0xc')](_0xe59ad1,_0x411738)[_0x61b7('0xd')](function(_0x233072){logger[_0x61b7('0xe')](_0x61b7('0xf'),_0x2eb071,'request\x20sent');logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x2eb071,_0x61b7('0x10'),JSON[_0x61b7('0x11')](_0x233072));if(_0x233072[_0x61b7('0x12')]){if(_0x233072[_0x61b7('0x12')][_0x61b7('0x13')]===0x1f4){logger[_0x61b7('0x12')]('DeskField,\x20%s,\x20%s',_0x2eb071,_0x233072[_0x61b7('0x12')][_0x61b7('0x14')]);return _0x138f56(_0x233072[_0x61b7('0x12')][_0x61b7('0x14')]);}logger[_0x61b7('0x12')](_0x61b7('0xf'),_0x2eb071,_0x233072[_0x61b7('0x12')][_0x61b7('0x14')]);return _0x288fc1(_0x233072[_0x61b7('0x12')]['message']);}else{logger[_0x61b7('0xe')]('DeskField,\x20%s,\x20%s',_0x2eb071,_0x61b7('0x10'));_0x288fc1(_0x233072[_0x61b7('0x15')]['message']);}})[_0x61b7('0x16')](function(_0x45de50){logger[_0x61b7('0x12')](_0x61b7('0xf'),_0x2eb071,_0x45de50);_0x138f56(_0x45de50);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 629c314..1175061 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 _0xf668=['get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','addConfiguration','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14d45f,_0x2d0dbb){var _0x176c80=function(_0x3c2046){while(--_0x3c2046){_0x14d45f['push'](_0x14d45f['shift']());}};_0x176c80(++_0x2d0dbb);}(_0xf668,0x147));var _0x8f66=function(_0x2a4d7a,_0x16ce79){_0x2a4d7a=_0x2a4d7a-0x0;var _0x3ad48b=_0xf668[_0x2a4d7a];return _0x3ad48b;};'use strict';var multer=require(_0x8f66('0x0'));var util=require(_0x8f66('0x1'));var path=require(_0x8f66('0x2'));var timeout=require(_0x8f66('0x3'));var express=require(_0x8f66('0x4'));var router=express[_0x8f66('0x5')]();var fs_extra=require(_0x8f66('0x6'));var auth=require(_0x8f66('0x7'));var interaction=require(_0x8f66('0x8'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0x8f66('0x9')]('/',auth[_0x8f66('0xa')](),controller[_0x8f66('0xb')]);router[_0x8f66('0x9')](_0x8f66('0xc'),auth[_0x8f66('0xa')](),controller[_0x8f66('0xd')]);router[_0x8f66('0x9')](_0x8f66('0xe'),auth[_0x8f66('0xa')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x8f66('0xa')](),controller[_0x8f66('0xf')]);router[_0x8f66('0x10')]('/',auth[_0x8f66('0xa')](),controller['create']);router['post'](_0x8f66('0xe'),auth[_0x8f66('0xa')](),controller[_0x8f66('0x11')]);router[_0x8f66('0x12')](_0x8f66('0xc'),auth[_0x8f66('0xa')](),controller['update']);router['delete'](_0x8f66('0xc'),auth[_0x8f66('0xa')](),controller[_0x8f66('0x13')]);module[_0x8f66('0x14')]=router; \ No newline at end of file +var _0xa7e5=['fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','put','update','delete','exports','path','express','Router'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa7e5,0x14d));var _0x5a7e=function(_0x4d5932,_0x375e17){_0x4d5932=_0x4d5932-0x0;var _0x46ab06=_0xa7e5[_0x4d5932];return _0x46ab06;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5a7e('0x0'));var timeout=require('connect-timeout');var express=require(_0x5a7e('0x1'));var router=express[_0x5a7e('0x2')]();var fs_extra=require(_0x5a7e('0x3'));var auth=require(_0x5a7e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5a7e('0x5'));var controller=require(_0x5a7e('0x6'));router[_0x5a7e('0x7')]('/',auth[_0x5a7e('0x8')](),controller[_0x5a7e('0x9')]);router[_0x5a7e('0x7')](_0x5a7e('0xa'),auth['isAuthenticated'](),controller[_0x5a7e('0xb')]);router[_0x5a7e('0x7')](_0x5a7e('0xc'),auth['isAuthenticated'](),controller[_0x5a7e('0xd')]);router[_0x5a7e('0x7')](_0x5a7e('0xe'),auth[_0x5a7e('0x8')](),controller[_0x5a7e('0xf')]);router['post']('/',auth[_0x5a7e('0x8')](),controller[_0x5a7e('0x10')]);router['post'](_0x5a7e('0xc'),auth[_0x5a7e('0x8')](),controller['addConfiguration']);router[_0x5a7e('0x11')](_0x5a7e('0xa'),auth[_0x5a7e('0x8')](),controller[_0x5a7e('0x12')]);router[_0x5a7e('0x13')](_0x5a7e('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5a7e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 0881667..f67178f 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 _0xaa37=['exports','STRING','BOOLEAN','sequelize'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xaa37[_0x21549c];return _0x426cbd;};'use strict';var Sequelize=require(_0x7aa3('0x0'));module[_0x7aa3('0x1')]={'name':{'type':Sequelize[_0x7aa3('0x2')]},'username':{'type':Sequelize[_0x7aa3('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x7aa3('0x2')]},'tenantId':{'type':Sequelize[_0x7aa3('0x2')]},'clientId':{'type':Sequelize[_0x7aa3('0x2')]},'clientSecret':{'type':Sequelize[_0x7aa3('0x2')]},'serverUrl':{'type':Sequelize[_0x7aa3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7aa3('0x2')]},'modernAuthentication':{'type':Sequelize[_0x7aa3('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1561=['BOOLEAN','STRING'];(function(_0x5d606f,_0x13329d){var _0x34099d=function(_0xa7f3c2){while(--_0xa7f3c2){_0x5d606f['push'](_0x5d606f['shift']());}};_0x34099d(++_0x13329d);}(_0x1561,0x1bd));var _0x1156=function(_0x1b2f59,_0x33eaf1){_0x1b2f59=_0x1b2f59-0x0;var _0x5d7396=_0x1561[_0x1b2f59];return _0x5d7396;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1156('0x0')]},'username':{'type':Sequelize[_0x1156('0x0')]},'password':{'type':Sequelize[_0x1156('0x0')]},'remoteUri':{'type':Sequelize[_0x1156('0x0')]},'tenantId':{'type':Sequelize[_0x1156('0x0')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1156('0x0')]},'serverUrl':{'type':Sequelize[_0x1156('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x1156('0x0')]},'modernAuthentication':{'type':Sequelize[_0x1156('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 032dbb8..cb0f6d9 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 _0xdba7=['directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','entityimage_timestamp','entityimage_url','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','concat','remoteUri','tenantId','clientId','modernAuthentication','CloudProvider','access_token','data5','data7','/oauth2/token','username','password','clientSecret','GET','4.0','value','MetadataId','EntityDefinitions(','Bearer\x20','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','UserLocalizedLabel','Value','DisplayName','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','options','includeAll','include','rows','catch','show','params','keys','merge','find','create','body','update','getConfigurations','findOne','Dynamics365Configuration','filter','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','title','description','customerid','ownerid','subject','phonenumber','regardingobjectid'];(function(_0x5a5a88,_0x5d0b5b){var _0x2c7efb=function(_0x3cf2d6){while(--_0x3cf2d6){_0x5a5a88['push'](_0x5a5a88['shift']());}};_0x2c7efb(++_0x5d0b5b);}(_0xdba7,0x125));var _0x7dba=function(_0x21b627,_0x20868d){_0x21b627=_0x21b627-0x0;var _0x4b2957=_0xdba7[_0x21b627];return _0x4b2957;};'use strict';var rp=require(_0x7dba('0x0'));var util=require('util');var _=require('lodash');var qs=require(_0x7dba('0x1'));var logger=require(_0x7dba('0x2'))(_0x7dba('0x3'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7dba('0x4'));function respondWithResult(_0x4f07f5,_0x1239f5){_0x1239f5=_0x1239f5||0xc8;return function(_0x521bc7){if(_0x521bc7){return _0x4f07f5['status'](_0x1239f5)[_0x7dba('0x5')](_0x521bc7);}};}function respondWithFilteredResult(_0x1f005f,_0x1c08fc){return function(_0x502eff){if(_0x502eff){var _0x1d6908=typeof _0x1c08fc[_0x7dba('0x6')]===_0x7dba('0x7')&&typeof _0x1c08fc[_0x7dba('0x8')]===_0x7dba('0x7');var _0x32de64=_0x502eff[_0x7dba('0x9')];var _0x4c8f5b=_0x1d6908?0x0:_0x1c08fc[_0x7dba('0x6')];var _0x180490=_0x1d6908?_0x502eff[_0x7dba('0x9')]:_0x1c08fc[_0x7dba('0x6')]+_0x1c08fc[_0x7dba('0x8')];var _0x43c77e;if(_0x180490>=_0x32de64){_0x180490=_0x32de64;_0x43c77e=0xc8;}else{_0x43c77e=0xce;}_0x1f005f[_0x7dba('0xa')](_0x43c77e);return _0x1f005f[_0x7dba('0xb')](_0x7dba('0xc'),_0x4c8f5b+'-'+_0x180490+'/'+_0x32de64)[_0x7dba('0x5')](_0x502eff);}return null;};}function saveUpdates(_0x1d3c8d){return function(_0x17d431){if(_0x17d431){return _0x17d431['update'](_0x1d3c8d)[_0x7dba('0xd')](function(_0x42a170){return _0x42a170;});}return null;};}function removeEntity(_0x1fea5c){return function(_0x56ebe4){if(_0x56ebe4){return _0x56ebe4[_0x7dba('0xe')]()[_0x7dba('0xd')](function(){_0x1fea5c['status'](0xcc)[_0x7dba('0xf')]();});}};}function handleEntityNotFound(_0x1da758){return function(_0x28a92b){if(!_0x28a92b){_0x1da758[_0x7dba('0x10')](0x194);}return _0x28a92b;};}function handleError(_0x386ce4,_0x3e326d){_0x3e326d=_0x3e326d||0x1f4;return function(_0xde4a8){logger[_0x7dba('0x11')](_0xde4a8[_0x7dba('0x12')]);if(_0xde4a8[_0x7dba('0x13')]){delete _0xde4a8[_0x7dba('0x13')];}_0x386ce4[_0x7dba('0xa')](_0x3e326d)[_0x7dba('0x14')](_0xde4a8);};}exports[_0x7dba('0x15')]=function(_0xb58297,_0x1db6d2){var _0x599cf6={},_0x35e587={},_0x2d3a9e={'count':0x0,'rows':[]};var _0x16f3a2=_[_0x7dba('0x16')](db[_0x7dba('0x17')][_0x7dba('0x18')],function(_0x32449c){return{'name':_0x32449c['fieldName'],'type':_0x32449c[_0x7dba('0x19')][_0x7dba('0x1a')]};});_0x35e587[_0x7dba('0x1b')]=_[_0x7dba('0x16')](_0x16f3a2,_0x7dba('0x13'));_0x35e587[_0x7dba('0x1c')]=_['keys'](_0xb58297[_0x7dba('0x1c')]);_0x35e587[_0x7dba('0x1d')]=_[_0x7dba('0x1e')](_0x35e587[_0x7dba('0x1b')],_0x35e587[_0x7dba('0x1c')]);_0x599cf6['attributes']=_['intersection'](_0x35e587[_0x7dba('0x1b')],qs[_0x7dba('0x1f')](_0xb58297['query'][_0x7dba('0x1f')]));_0x599cf6[_0x7dba('0x20')]=_0x599cf6[_0x7dba('0x20')][_0x7dba('0x21')]?_0x599cf6[_0x7dba('0x20')]:_0x35e587[_0x7dba('0x1b')];if(!_0xb58297[_0x7dba('0x1c')][_0x7dba('0x22')]('nolimit')){_0x599cf6['limit']=qs[_0x7dba('0x8')](_0xb58297['query'][_0x7dba('0x8')]);_0x599cf6[_0x7dba('0x6')]=qs[_0x7dba('0x6')](_0xb58297[_0x7dba('0x1c')][_0x7dba('0x6')]);}_0x599cf6['order']=qs[_0x7dba('0x23')](_0xb58297[_0x7dba('0x1c')][_0x7dba('0x23')]);_0x599cf6[_0x7dba('0x24')]=qs[_0x7dba('0x1d')](_[_0x7dba('0x25')](_0xb58297['query'],_0x35e587[_0x7dba('0x1d')]),_0x16f3a2);if(_0xb58297[_0x7dba('0x1c')]['filter']){_0x599cf6[_0x7dba('0x24')]=_['merge'](_0x599cf6[_0x7dba('0x24')],{'$or':_[_0x7dba('0x16')](_0x16f3a2,function(_0x15b8ce){if(_0x15b8ce[_0x7dba('0x19')]!=='VIRTUAL'){var _0x2123d4={};_0x2123d4[_0x15b8ce[_0x7dba('0x13')]]={'$like':'%'+_0xb58297[_0x7dba('0x1c')]['filter']+'%'};return _0x2123d4;}})});}_0x599cf6=_['merge']({},_0x599cf6,_0xb58297[_0x7dba('0x26')]);var _0x355f55={'where':_0x599cf6['where']};return db[_0x7dba('0x17')][_0x7dba('0x9')](_0x355f55)[_0x7dba('0xd')](function(_0x117337){_0x2d3a9e[_0x7dba('0x9')]=_0x117337;if(_0xb58297[_0x7dba('0x1c')][_0x7dba('0x27')]){_0x599cf6[_0x7dba('0x28')]=[{'all':!![]}];}return db[_0x7dba('0x17')]['findAll'](_0x599cf6);})[_0x7dba('0xd')](function(_0x3bdc71){_0x2d3a9e[_0x7dba('0x29')]=_0x3bdc71;return _0x2d3a9e;})[_0x7dba('0xd')](respondWithFilteredResult(_0x1db6d2,_0x599cf6))[_0x7dba('0x2a')](handleError(_0x1db6d2,null));};exports[_0x7dba('0x2b')]=function(_0x8dd14c,_0x4e1936){var _0x3b950d={'raw':![],'where':{'id':_0x8dd14c[_0x7dba('0x2c')]['id']}},_0x216a21={};_0x216a21[_0x7dba('0x1b')]=_[_0x7dba('0x2d')](db['Dynamics365Account'][_0x7dba('0x18')]);_0x216a21[_0x7dba('0x1c')]=_[_0x7dba('0x2d')](_0x8dd14c[_0x7dba('0x1c')]);_0x216a21[_0x7dba('0x1d')]=_['intersection'](_0x216a21[_0x7dba('0x1b')],_0x216a21[_0x7dba('0x1c')]);_0x3b950d['attributes']=_[_0x7dba('0x1e')](_0x216a21[_0x7dba('0x1b')],qs[_0x7dba('0x1f')](_0x8dd14c[_0x7dba('0x1c')][_0x7dba('0x1f')]));_0x3b950d['attributes']=_0x3b950d[_0x7dba('0x20')]['length']?_0x3b950d['attributes']:_0x216a21[_0x7dba('0x1b')];if(_0x8dd14c[_0x7dba('0x1c')][_0x7dba('0x27')]){_0x3b950d[_0x7dba('0x28')]=[{'all':!![]}];}_0x3b950d=_[_0x7dba('0x2e')]({},_0x3b950d,_0x8dd14c['options']);return db[_0x7dba('0x17')][_0x7dba('0x2f')](_0x3b950d)[_0x7dba('0xd')](handleEntityNotFound(_0x4e1936,null))['then'](respondWithResult(_0x4e1936,null))[_0x7dba('0x2a')](handleError(_0x4e1936,null));};exports[_0x7dba('0x30')]=function(_0x56cd63,_0x21152d){return db[_0x7dba('0x17')][_0x7dba('0x30')](_0x56cd63[_0x7dba('0x31')],{})[_0x7dba('0xd')](respondWithResult(_0x21152d,0xc9))[_0x7dba('0x2a')](handleError(_0x21152d,null));};exports[_0x7dba('0x32')]=function(_0x1264d3,_0x2f3ebe){if(_0x1264d3['body']['id']){delete _0x1264d3[_0x7dba('0x31')]['id'];}return db['Dynamics365Account'][_0x7dba('0x2f')]({'where':{'id':_0x1264d3[_0x7dba('0x2c')]['id']}})[_0x7dba('0xd')](handleEntityNotFound(_0x2f3ebe,null))['then'](saveUpdates(_0x1264d3['body'],null))[_0x7dba('0xd')](respondWithResult(_0x2f3ebe,null))[_0x7dba('0x2a')](handleError(_0x2f3ebe,null));};exports[_0x7dba('0xe')]=function(_0x4d0b03,_0x2094a2){return db['Dynamics365Account']['find']({'where':{'id':_0x4d0b03[_0x7dba('0x2c')]['id']}})[_0x7dba('0xd')](handleEntityNotFound(_0x2094a2,null))[_0x7dba('0xd')](removeEntity(_0x2094a2,null))[_0x7dba('0x2a')](handleError(_0x2094a2,null));};exports[_0x7dba('0x33')]=function(_0x47f648,_0x233b8e){var _0x38e3a1={};var _0x1a0648={};var _0x52a5d1;var _0x5a6a8;return db[_0x7dba('0x17')][_0x7dba('0x34')]({'where':{'id':_0x47f648[_0x7dba('0x2c')]['id']}})[_0x7dba('0xd')](handleEntityNotFound(_0x233b8e,null))[_0x7dba('0xd')](function(_0x1da0e6){if(_0x1da0e6){_0x52a5d1=_0x1da0e6;_0x1a0648[_0x7dba('0x1b')]=_[_0x7dba('0x2d')](db[_0x7dba('0x35')][_0x7dba('0x18')]);_0x1a0648[_0x7dba('0x1c')]=_[_0x7dba('0x2d')](_0x47f648[_0x7dba('0x1c')]);_0x1a0648['filters']=_[_0x7dba('0x1e')](_0x1a0648[_0x7dba('0x1b')],_0x1a0648[_0x7dba('0x1c')]);_0x38e3a1[_0x7dba('0x20')]=_[_0x7dba('0x1e')](_0x1a0648[_0x7dba('0x1b')],qs[_0x7dba('0x1f')](_0x47f648[_0x7dba('0x1c')][_0x7dba('0x1f')]));_0x38e3a1[_0x7dba('0x20')]=_0x38e3a1[_0x7dba('0x20')][_0x7dba('0x21')]?_0x38e3a1[_0x7dba('0x20')]:_0x1a0648['model'];_0x38e3a1['order']=qs[_0x7dba('0x23')](_0x47f648[_0x7dba('0x1c')][_0x7dba('0x23')]);_0x38e3a1[_0x7dba('0x24')]=qs['filters'](_['pick'](_0x47f648[_0x7dba('0x1c')],_0x1a0648[_0x7dba('0x1d')]));if(_0x47f648[_0x7dba('0x1c')][_0x7dba('0x36')]){_0x38e3a1['where']=_[_0x7dba('0x2e')](_0x38e3a1['where'],{'$or':_['map'](_0x38e3a1[_0x7dba('0x20')],function(_0x556bea){var _0x4d7059={};_0x4d7059[_0x556bea]={'$like':'%'+_0x47f648['query'][_0x7dba('0x36')]+'%'};return _0x4d7059;})});}_0x38e3a1=_[_0x7dba('0x2e')]({},_0x38e3a1,_0x47f648[_0x7dba('0x26')]);return _0x52a5d1[_0x7dba('0x33')](_0x38e3a1);}})[_0x7dba('0xd')](function(_0x42665f){if(_0x42665f){_0x5a6a8=_0x42665f['length'];if(!_0x47f648['query'][_0x7dba('0x22')](_0x7dba('0x37'))){_0x38e3a1[_0x7dba('0x8')]=qs[_0x7dba('0x8')](_0x47f648[_0x7dba('0x1c')]['limit']);_0x38e3a1[_0x7dba('0x6')]=qs[_0x7dba('0x6')](_0x47f648[_0x7dba('0x1c')]['offset']);}return _0x52a5d1[_0x7dba('0x33')](_0x38e3a1);}})[_0x7dba('0xd')](function(_0x48a1ac){if(_0x48a1ac){return _0x48a1ac?{'count':_0x5a6a8,'rows':_0x48a1ac}:null;}})[_0x7dba('0xd')](respondWithResult(_0x233b8e,null))[_0x7dba('0x2a')](handleError(_0x233b8e,null));};exports[_0x7dba('0x38')]=function(_0x312b0d,_0x3c279c){if(_0x312b0d[_0x7dba('0x31')]['id']){delete _0x312b0d[_0x7dba('0x31')]['id'];}return db[_0x7dba('0x17')][_0x7dba('0x34')]({'where':{'id':_0x312b0d['params']['id']}})[_0x7dba('0xd')](handleEntityNotFound(_0x3c279c,null))[_0x7dba('0xd')](function(_0x5cca98){if(_0x5cca98){_0x312b0d[_0x7dba('0x31')][_0x7dba('0x39')]=_0x5cca98['id'];_0x312b0d['body'][_0x7dba('0x3a')]=integrations[_0x7dba('0x3b')](_0x312b0d[_0x7dba('0x31')][_0x7dba('0x3c')],_0x312b0d[_0x7dba('0x31')][_0x7dba('0x19')]);_0x312b0d[_0x7dba('0x31')][_0x7dba('0x3d')]=integrations[_0x7dba('0x3e')](_0x312b0d[_0x7dba('0x31')][_0x7dba('0x3c')],_0x312b0d[_0x7dba('0x31')][_0x7dba('0x19')]);return db[_0x7dba('0x35')][_0x7dba('0x30')](_0x312b0d[_0x7dba('0x31')],{'include':[{'model':db[_0x7dba('0x3f')],'as':_0x7dba('0x3a')},{'model':db[_0x7dba('0x3f')],'as':_0x7dba('0x3d')}]});}return null;})[_0x7dba('0xd')](respondWithResult(_0x3c279c,null))[_0x7dba('0x2a')](handleError(_0x3c279c,null));};function sanitizeRemoteUri(_0x5640f6){var _0x86405e=_0x5640f6[_0x7dba('0x40')](-0x1);if(_0x86405e==='/')return _0x5640f6[_0x7dba('0x41')](0x0,_0x5640f6[_0x7dba('0x42')](_0x86405e));return _0x5640f6;}function getWebApiUrl(_0x8956ec){return util[_0x7dba('0x43')](_0x7dba('0x44'),_0x8956ec);}exports[_0x7dba('0x45')]=function(_0x1b6613,_0x1c8fe7){var _0x2c996b=_0x1b6613[_0x7dba('0x1c')][_0x7dba('0x46')];var _0x47898=_0x2c996b===_0x7dba('0x47')?'Incident':'PhoneCall';var _0x4213f6='';var _0x2be4f7='';var _0xd7b38f='';var _0x2c7b94='';var _0x31b125='';var _0x538770='';var _0x2d204c='';var _0x1f05b0='';var _0x45a32e=[_0x7dba('0x48'),_0x7dba('0x49'),_0x7dba('0x4a'),_0x7dba('0x4b'),'caseorigincode',_0x7dba('0x4c'),_0x7dba('0x4d'),_0x7dba('0x4e'),_0x7dba('0x4f'),'phonecall_activity_parties'];var _0x45fc06=[_0x7dba('0x50'),_0x7dba('0x51'),_0x7dba('0x52'),_0x7dba('0x53'),'contactidname','contactidyominame',_0x7dba('0x54'),_0x7dba('0x55'),'createdbyexternalpartyname',_0x7dba('0x56'),_0x7dba('0x57'),_0x7dba('0x58'),_0x7dba('0x59'),_0x7dba('0x5a'),_0x7dba('0x5b'),_0x7dba('0x5c'),_0x7dba('0x5d'),'customeridyominame','emailaddress','entitlementidname',_0x7dba('0x5e'),_0x7dba('0x5f'),'escalatedon',_0x7dba('0x60'),'firstresponsebykpiidname',_0x7dba('0x61'),_0x7dba('0x62'),_0x7dba('0x63'),_0x7dba('0x64'),'lastonholdtime','masteridname',_0x7dba('0x65'),_0x7dba('0x66'),_0x7dba('0x67'),_0x7dba('0x68'),_0x7dba('0x69'),'modifiedonbehalfbyname',_0x7dba('0x6a'),_0x7dba('0x6b'),_0x7dba('0x6c'),_0x7dba('0x6d'),'onholdtime',_0x7dba('0x6e'),_0x7dba('0x6f'),_0x7dba('0x70'),_0x7dba('0x71'),'parentcaseidname',_0x7dba('0x72'),'primarycontactidyominame','prioritycodename','productidname',_0x7dba('0x73'),_0x7dba('0x74'),_0x7dba('0x75'),_0x7dba('0x76'),'responsiblecontactidname',_0x7dba('0x77'),_0x7dba('0x78'),_0x7dba('0x79'),_0x7dba('0x7a'),_0x7dba('0x7b'),_0x7dba('0x7c'),_0x7dba('0x7d'),_0x7dba('0x7e'),_0x7dba('0x7f'),_0x7dba('0x80'),'transactioncurrencyidname',_0x7dba('0x81'),_0x7dba('0x82'),'versionnumber'];var _0x43fd5b=_0x45a32e[_0x7dba('0x83')](_0x45fc06);return db[_0x7dba('0x17')][_0x7dba('0x34')]({'where':{'id':_0x1b6613[_0x7dba('0x2c')]['id']},'attributes':['id','username','password',_0x7dba('0x84'),_0x7dba('0x85'),_0x7dba('0x86'),'clientSecret',_0x7dba('0x87')],'include':[{'model':db[_0x7dba('0x88')],'as':'CloudProvider','attributes':['id','data5','data7']}]})[_0x7dba('0xd')](handleEntityNotFound(_0x1c8fe7,null))['then'](function(_0x1f2bea){if(_0x1f2bea){if(_0x1f2bea[_0x7dba('0x87')]){_0x1f2bea[_0x7dba('0x89')]=_0x1f2bea['CloudProvider'][_0x7dba('0x8a')];_0x1f05b0=sanitizeRemoteUri(_0x1f2bea[_0x7dba('0x88')][_0x7dba('0x8b')]);_0x2d204c=getWebApiUrl(_0x1f05b0);return _0x1f2bea;}_0x1f05b0=sanitizeRemoteUri(_0x1f2bea[_0x7dba('0x84')]);_0x2d204c=getWebApiUrl(_0x1f05b0);var _0x48b2b9={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x1f2bea[_0x7dba('0x85')]+_0x7dba('0x8c'),'form':{'client_id':_0x1f2bea[_0x7dba('0x86')],'resource':_0x1f05b0,'username':_0x1f2bea[_0x7dba('0x8d')],'password':_0x1f2bea[_0x7dba('0x8e')],'grant_type':_0x7dba('0x8e'),'client_secret':_0x1f2bea[_0x7dba('0x8f')]},'json':!![]};return rp(_0x48b2b9);}})['then'](function(_0x243828){_0x538770=_0x243828['access_token'];var _0x1d7ceb={'method':_0x7dba('0x90'),'uri':encodeURI(_0x2d204c+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x47898+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x538770,'If-None-Match':null,'OData-Version':_0x7dba('0x91')},'json':!![]};return rp(_0x1d7ceb);})['then'](function(_0x48ecf5){var _0x4766b5=_0x48ecf5[_0x7dba('0x92')][0x0];var _0x2134b5=_0x4766b5[_0x7dba('0x93')];var _0x310524={'method':'GET','uri':_0x2d204c+_0x7dba('0x94')+_0x2134b5+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x7dba('0x95')+_0x538770,'If-None-Match':null,'OData-Version':_0x7dba('0x91')},'json':!![]};return rp(_0x310524);})[_0x7dba('0xd')](function(_0x497d5a){_0x4213f6=_0x497d5a;_0x2be4f7=_0x4213f6[_0x7dba('0x96')];_0x2be4f7=_['remove'](_0x2be4f7,function(_0x53a96a){return!_0x43fd5b[_0x7dba('0x97')](_0x53a96a[_0x7dba('0x98')]);});var _0x407616=[];var _0x29d2ae=[];_0x2be4f7[_0x7dba('0x99')](function(_0x2d7baf){if(_0x2d7baf['@odata.type']){var _0x2660f2=_0x2d7baf['@odata.type'][_0x7dba('0x41')](_0x2d7baf[_0x7dba('0x9a')][_0x7dba('0x42')]('.')+0x1);if(_0x2660f2===_0x7dba('0x9b')){_0x407616['push'](getSelectList(_0x2d204c,_0x2c996b,_0x29d2ae,_0x4213f6[_0x7dba('0x93')],_0x2d7baf[_0x7dba('0x93')],_0x538770));}}});return Promise[_0x7dba('0x9c')](_0x407616);})[_0x7dba('0xd')](function(_0xf6cbe8){_0xd7b38f=_0xf6cbe8[0x0];var _0x199d3c=[];var _0x933e00=[];_0x2be4f7[_0x7dba('0x99')](function(_0x1662cf){if(!_[_0x7dba('0x9d')](_0x1662cf[_0x7dba('0x9a')])){var _0x45334b=_0x1662cf[_0x7dba('0x9a')][_0x7dba('0x41')](_0x1662cf[_0x7dba('0x9a')][_0x7dba('0x42')]('.')+0x1);if(_0x45334b===_0x7dba('0x9e')){_0x199d3c[_0x7dba('0x9f')](getBooleanList(_0x2d204c,_0x2c996b,_0x933e00,_0x4213f6[_0x7dba('0x93')],_0x1662cf[_0x7dba('0x93')],_0x538770));}}});return Promise[_0x7dba('0x9c')](_0x199d3c);})['then'](function(_0x2c5248){_0x2c7b94=_0x2c5248[0x0];var _0xe099bc=[];var _0x20b2ce=[];_0x2be4f7['forEach'](function(_0x8a6f4d){if(_0x8a6f4d[_0x7dba('0x9a')]){var _0x50ab0e=_0x8a6f4d[_0x7dba('0x9a')]['substring'](_0x8a6f4d['@odata.type'][_0x7dba('0x42')]('.')+0x1);if(_0x50ab0e===_0x7dba('0xa0')||_0x50ab0e===_0x7dba('0xa1')||_0x50ab0e===_0x7dba('0xa2')||_0x50ab0e===_0x7dba('0xa3')||_0x50ab0e===_0x7dba('0xa4')||_0x50ab0e===_0x7dba('0xa5')||_0x50ab0e===_0x7dba('0xa6')||_0x50ab0e===_0x7dba('0xa7')||_0x50ab0e===_0x7dba('0xa8')||_0x50ab0e===_0x7dba('0xa9')){_0xe099bc['push'](getInputList(_0x2d204c,_0x2c996b,_0x50ab0e,_0x20b2ce,_0x4213f6[_0x7dba('0x93')],_0x8a6f4d['MetadataId'],_0x538770));}}});return Promise[_0x7dba('0x9c')](_0xe099bc);})[_0x7dba('0xd')](function(_0x24bb63){_0x31b125=_0x24bb63[0x0];var _0x2bf32c=_0xd7b38f['concat'](_0x2c7b94)[_0x7dba('0x83')](_0x31b125);var _0x4aef78={'count':_0x2bf32c[_0x7dba('0x21')],'rows':_0x2bf32c};return _0x4aef78;})[_0x7dba('0xd')](respondWithResult(_0x1c8fe7,null))['catch'](function(_0x52fa3f){var _0x217c18=_0x1b6613['query'][_0x7dba('0xaa')]?0x1f4:_0x52fa3f[_0x7dba('0xab')]||0x1f4;logger[_0x7dba('0x11')](_0x52fa3f[_0x7dba('0x12')]);delete _0x52fa3f['name'];if(_0x217c18===0x191){_0x217c18=0x190;}_0x1c8fe7[_0x7dba('0xa')](_0x217c18)[_0x7dba('0x14')](_0x1b6613[_0x7dba('0x1c')][_0x7dba('0xaa')]?{'message':_0x7dba('0xac'),'statusCode':_0x52fa3f[_0x7dba('0xab')]}:_0x52fa3f);});};function getSelectList(_0x2b8c09,_0xa54d3,_0x1552c0,_0x2fae2d,_0x45dfa2,_0x256c9c){var _0x190b92={'method':'GET','uri':_0x2b8c09+_0x7dba('0x94')+_0x2fae2d+_0x7dba('0xad')+_0x45dfa2+_0x7dba('0xae')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x7dba('0x95')+_0x256c9c,'If-None-Match':null,'OData-Version':_0x7dba('0x91')},'json':!![]};return rp(_0x190b92)[_0x7dba('0xd')](function(_0x5c4e32){var _0x446d2d=[];var _0x45d603=_0x5c4e32[_0x7dba('0xaf')]['Options'];_0x45d603[_0x7dba('0x99')](function(_0x3b826a){_0x446d2d[_0x7dba('0x9f')]({'name':_0x3b826a['Label'][_0x7dba('0xb0')]['Label'],'value':String(_0x3b826a[_0x7dba('0xb1')])});});var _0x157ce6={'id':_0xa54d3+'_'+_0x5c4e32[_0x7dba('0x98')],'name':_0x5c4e32[_0x7dba('0xb2')]['UserLocalizedLabel'][_0x7dba('0xb3')],'custom':![],'options':_0x446d2d};_0x1552c0[_0x7dba('0x9f')](_0x157ce6);return _0x1552c0;});}function getBooleanList(_0x3ab4e3,_0x2af166,_0x37f418,_0x199bb1,_0x205a2d,_0x3b426a){var _0x264e86={'method':'GET','uri':_0x3ab4e3+'EntityDefinitions('+_0x199bb1+_0x7dba('0xad')+_0x205a2d+_0x7dba('0xb4'),'headers':{'Authorization':_0x7dba('0x95')+_0x3b426a,'If-None-Match':null,'OData-Version':_0x7dba('0x91')},'json':!![]};return rp(_0x264e86)[_0x7dba('0xd')](function(_0x4510a1){var _0x166adc=[];_0x166adc[_0x7dba('0x9f')]({'name':_0x4510a1[_0x7dba('0xaf')][_0x7dba('0xb5')][_0x7dba('0xb3')][_0x7dba('0xb0')][_0x7dba('0xb3')],'value':_0x7dba('0xb6')},{'name':_0x4510a1[_0x7dba('0xaf')][_0x7dba('0xb7')][_0x7dba('0xb3')][_0x7dba('0xb0')][_0x7dba('0xb3')],'value':'false'});var _0x357d51={'id':_0x2af166+'_'+_0x4510a1[_0x7dba('0x98')],'name':_0x4510a1['DisplayName'][_0x7dba('0xb0')]['Label'],'custom':![],'options':_0x166adc};_0x37f418[_0x7dba('0x9f')](_0x357d51);return _0x37f418;});}function getInputList(_0x444494,_0x1adbbb,_0x2a180f,_0x1b4180,_0x939da1,_0x20eb1f,_0x3df174){var _0x4cd8b8={'method':'GET','uri':_0x444494+_0x7dba('0x94')+_0x939da1+_0x7dba('0xad')+_0x20eb1f+_0x7dba('0xb8')+_0x2a180f+_0x7dba('0xb9'),'headers':{'Authorization':_0x7dba('0x95')+_0x3df174,'If-None-Match':null,'OData-Version':_0x7dba('0x91')},'json':!![]};return rp(_0x4cd8b8)[_0x7dba('0xd')](function(_0x5574f7){var _0x575afd={'id':_0x1adbbb+'_'+_0x5574f7[_0x7dba('0x98')],'name':_0x5574f7[_0x7dba('0xb2')][_0x7dba('0xb0')]?_0x5574f7[_0x7dba('0xb2')]['UserLocalizedLabel']['Label']:_0x5574f7[_0x7dba('0x98')],'custom':![],'options':[]};_0x1b4180[_0x7dba('0x9f')](_0x575afd);return _0x1b4180;});} \ No newline at end of file +var _0x96da=['contractidname','createdbyexternalpartyyominame','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','statecode','statuscode','subjectidname','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientId','CloudProvider','data5','data7','modernAuthentication','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','value',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','includes','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','MetadataId','all','forEach','isNil','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','stack','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','LogicalName','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','4.0','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','Content-Range','update','then','destroy','sendStatus','error','name','send','index','map','Dynamics365Account','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','findOne','Dynamics365Configuration','length','pick','getConfigurations','addConfiguration','Subjects','channel','getDescriptions','Dynamics365Field','slice','substring','format','%s/api/data/v9.0/','getFields','ticketType','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96da,0x1d2));var _0xa96d=function(_0x3964e5,_0xda3cd8){_0x3964e5=_0x3964e5-0x0;var _0x3dfbfb=_0x96da[_0x3964e5];return _0x3dfbfb;};'use strict';var rp=require(_0xa96d('0x0'));var util=require(_0xa96d('0x1'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0xa96d('0x2'))('api');var db=require(_0xa96d('0x3'))['db'];var integrations=require(_0xa96d('0x4'));function respondWithResult(_0x2d4809,_0x5de63b){_0x5de63b=_0x5de63b||0xc8;return function(_0x1bbedc){if(_0x1bbedc){return _0x2d4809[_0xa96d('0x5')](_0x5de63b)[_0xa96d('0x6')](_0x1bbedc);}};}function respondWithFilteredResult(_0x755b10,_0x181365){return function(_0x29b5aa){if(_0x29b5aa){var _0x1fa927=typeof _0x181365[_0xa96d('0x7')]===_0xa96d('0x8')&&typeof _0x181365['limit']==='undefined';var _0xaa3ec4=_0x29b5aa['count'];var _0x20201a=_0x1fa927?0x0:_0x181365[_0xa96d('0x7')];var _0x553c06=_0x1fa927?_0x29b5aa['count']:_0x181365[_0xa96d('0x7')]+_0x181365[_0xa96d('0x9')];var _0x2daf44;if(_0x553c06>=_0xaa3ec4){_0x553c06=_0xaa3ec4;_0x2daf44=0xc8;}else{_0x2daf44=0xce;}_0x755b10[_0xa96d('0x5')](_0x2daf44);return _0x755b10['set'](_0xa96d('0xa'),_0x20201a+'-'+_0x553c06+'/'+_0xaa3ec4)[_0xa96d('0x6')](_0x29b5aa);}return null;};}function saveUpdates(_0x37525b){return function(_0x35385a){if(_0x35385a){return _0x35385a[_0xa96d('0xb')](_0x37525b)[_0xa96d('0xc')](function(_0x33f79a){return _0x33f79a;});}return null;};}function removeEntity(_0x192b0f){return function(_0x47dd7d){if(_0x47dd7d){return _0x47dd7d[_0xa96d('0xd')]()[_0xa96d('0xc')](function(){_0x192b0f[_0xa96d('0x5')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e09bb){return function(_0x1a7a1b){if(!_0x1a7a1b){_0x1e09bb[_0xa96d('0xe')](0x194);}return _0x1a7a1b;};}function handleError(_0x3eff34,_0x1fac7e){_0x1fac7e=_0x1fac7e||0x1f4;return function(_0x380f8a){logger[_0xa96d('0xf')](_0x380f8a['stack']);if(_0x380f8a[_0xa96d('0x10')]){delete _0x380f8a['name'];}_0x3eff34[_0xa96d('0x5')](_0x1fac7e)[_0xa96d('0x11')](_0x380f8a);};}exports[_0xa96d('0x12')]=function(_0x442723,_0x5e6339){var _0x46a648={},_0x56f49a={},_0x1175aa={'count':0x0,'rows':[]};var _0x23faad=_[_0xa96d('0x13')](db[_0xa96d('0x14')]['rawAttributes'],function(_0x581707){return{'name':_0x581707[_0xa96d('0x15')],'type':_0x581707[_0xa96d('0x16')][_0xa96d('0x17')]};});_0x56f49a[_0xa96d('0x18')]=_['map'](_0x23faad,_0xa96d('0x10'));_0x56f49a['query']=_[_0xa96d('0x19')](_0x442723['query']);_0x56f49a[_0xa96d('0x1a')]=_[_0xa96d('0x1b')](_0x56f49a[_0xa96d('0x18')],_0x56f49a[_0xa96d('0x1c')]);_0x46a648[_0xa96d('0x1d')]=_['intersection'](_0x56f49a[_0xa96d('0x18')],qs[_0xa96d('0x1e')](_0x442723['query'][_0xa96d('0x1e')]));_0x46a648[_0xa96d('0x1d')]=_0x46a648['attributes']['length']?_0x46a648['attributes']:_0x56f49a[_0xa96d('0x18')];if(!_0x442723['query'][_0xa96d('0x1f')](_0xa96d('0x20'))){_0x46a648[_0xa96d('0x9')]=qs[_0xa96d('0x9')](_0x442723[_0xa96d('0x1c')][_0xa96d('0x9')]);_0x46a648[_0xa96d('0x7')]=qs[_0xa96d('0x7')](_0x442723[_0xa96d('0x1c')][_0xa96d('0x7')]);}_0x46a648[_0xa96d('0x21')]=qs[_0xa96d('0x22')](_0x442723[_0xa96d('0x1c')][_0xa96d('0x22')]);_0x46a648[_0xa96d('0x23')]=qs[_0xa96d('0x1a')](_['pick'](_0x442723['query'],_0x56f49a[_0xa96d('0x1a')]),_0x23faad);if(_0x442723[_0xa96d('0x1c')][_0xa96d('0x24')]){_0x46a648[_0xa96d('0x23')]=_['merge'](_0x46a648['where'],{'$or':_['map'](_0x23faad,function(_0x2558a0){if(_0x2558a0[_0xa96d('0x16')]!==_0xa96d('0x25')){var _0x5acd87={};_0x5acd87[_0x2558a0[_0xa96d('0x10')]]={'$like':'%'+_0x442723[_0xa96d('0x1c')]['filter']+'%'};return _0x5acd87;}})});}_0x46a648=_[_0xa96d('0x26')]({},_0x46a648,_0x442723[_0xa96d('0x27')]);var _0x51aa0a={'where':_0x46a648[_0xa96d('0x23')]};return db[_0xa96d('0x14')][_0xa96d('0x28')](_0x51aa0a)[_0xa96d('0xc')](function(_0x1e25b7){_0x1175aa['count']=_0x1e25b7;if(_0x442723[_0xa96d('0x1c')][_0xa96d('0x29')]){_0x46a648[_0xa96d('0x2a')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xa96d('0x2b')](_0x46a648);})[_0xa96d('0xc')](function(_0xf16586){_0x1175aa[_0xa96d('0x2c')]=_0xf16586;return _0x1175aa;})[_0xa96d('0xc')](respondWithFilteredResult(_0x5e6339,_0x46a648))[_0xa96d('0x2d')](handleError(_0x5e6339,null));};exports[_0xa96d('0x2e')]=function(_0x2712dd,_0x2cf93f){var _0x4860ab={'raw':![],'where':{'id':_0x2712dd[_0xa96d('0x2f')]['id']}},_0x30da57={};_0x30da57[_0xa96d('0x18')]=_[_0xa96d('0x19')](db[_0xa96d('0x14')][_0xa96d('0x30')]);_0x30da57[_0xa96d('0x1c')]=_['keys'](_0x2712dd[_0xa96d('0x1c')]);_0x30da57[_0xa96d('0x1a')]=_['intersection'](_0x30da57[_0xa96d('0x18')],_0x30da57[_0xa96d('0x1c')]);_0x4860ab['attributes']=_['intersection'](_0x30da57[_0xa96d('0x18')],qs[_0xa96d('0x1e')](_0x2712dd[_0xa96d('0x1c')][_0xa96d('0x1e')]));_0x4860ab[_0xa96d('0x1d')]=_0x4860ab[_0xa96d('0x1d')]['length']?_0x4860ab['attributes']:_0x30da57[_0xa96d('0x18')];if(_0x2712dd[_0xa96d('0x1c')]['includeAll']){_0x4860ab[_0xa96d('0x2a')]=[{'all':!![]}];}_0x4860ab=_[_0xa96d('0x26')]({},_0x4860ab,_0x2712dd[_0xa96d('0x27')]);return db[_0xa96d('0x14')][_0xa96d('0x31')](_0x4860ab)[_0xa96d('0xc')](handleEntityNotFound(_0x2cf93f,null))[_0xa96d('0xc')](respondWithResult(_0x2cf93f,null))[_0xa96d('0x2d')](handleError(_0x2cf93f,null));};exports[_0xa96d('0x32')]=function(_0x48126f,_0x5d6f8d){return db[_0xa96d('0x14')][_0xa96d('0x32')](_0x48126f[_0xa96d('0x33')],{})[_0xa96d('0xc')](respondWithResult(_0x5d6f8d,0xc9))['catch'](handleError(_0x5d6f8d,null));};exports[_0xa96d('0xb')]=function(_0x5e8d3f,_0x55d279){if(_0x5e8d3f[_0xa96d('0x33')]['id']){delete _0x5e8d3f[_0xa96d('0x33')]['id'];}return db[_0xa96d('0x14')]['find']({'where':{'id':_0x5e8d3f[_0xa96d('0x2f')]['id']}})['then'](handleEntityNotFound(_0x55d279,null))[_0xa96d('0xc')](saveUpdates(_0x5e8d3f['body'],null))['then'](respondWithResult(_0x55d279,null))[_0xa96d('0x2d')](handleError(_0x55d279,null));};exports['destroy']=function(_0x5dfc2f,_0x5886e1){return db[_0xa96d('0x14')][_0xa96d('0x31')]({'where':{'id':_0x5dfc2f[_0xa96d('0x2f')]['id']}})['then'](handleEntityNotFound(_0x5886e1,null))[_0xa96d('0xc')](removeEntity(_0x5886e1,null))[_0xa96d('0x2d')](handleError(_0x5886e1,null));};exports['getConfigurations']=function(_0xa6c192,_0x2ca11c){var _0x46afcf={};var _0x3d820c={};var _0x40fa6a;var _0x3d4791;return db[_0xa96d('0x14')][_0xa96d('0x34')]({'where':{'id':_0xa6c192['params']['id']}})[_0xa96d('0xc')](handleEntityNotFound(_0x2ca11c,null))[_0xa96d('0xc')](function(_0x574040){if(_0x574040){_0x40fa6a=_0x574040;_0x3d820c['model']=_[_0xa96d('0x19')](db[_0xa96d('0x35')][_0xa96d('0x30')]);_0x3d820c[_0xa96d('0x1c')]=_[_0xa96d('0x19')](_0xa6c192[_0xa96d('0x1c')]);_0x3d820c[_0xa96d('0x1a')]=_[_0xa96d('0x1b')](_0x3d820c[_0xa96d('0x18')],_0x3d820c[_0xa96d('0x1c')]);_0x46afcf[_0xa96d('0x1d')]=_[_0xa96d('0x1b')](_0x3d820c[_0xa96d('0x18')],qs[_0xa96d('0x1e')](_0xa6c192['query'][_0xa96d('0x1e')]));_0x46afcf[_0xa96d('0x1d')]=_0x46afcf[_0xa96d('0x1d')][_0xa96d('0x36')]?_0x46afcf[_0xa96d('0x1d')]:_0x3d820c[_0xa96d('0x18')];_0x46afcf[_0xa96d('0x21')]=qs['sort'](_0xa6c192[_0xa96d('0x1c')][_0xa96d('0x22')]);_0x46afcf[_0xa96d('0x23')]=qs[_0xa96d('0x1a')](_[_0xa96d('0x37')](_0xa6c192[_0xa96d('0x1c')],_0x3d820c[_0xa96d('0x1a')]));if(_0xa6c192[_0xa96d('0x1c')][_0xa96d('0x24')]){_0x46afcf[_0xa96d('0x23')]=_[_0xa96d('0x26')](_0x46afcf[_0xa96d('0x23')],{'$or':_[_0xa96d('0x13')](_0x46afcf[_0xa96d('0x1d')],function(_0x47ac72){var _0x233cf1={};_0x233cf1[_0x47ac72]={'$like':'%'+_0xa6c192['query']['filter']+'%'};return _0x233cf1;})});}_0x46afcf=_[_0xa96d('0x26')]({},_0x46afcf,_0xa6c192['options']);return _0x40fa6a[_0xa96d('0x38')](_0x46afcf);}})[_0xa96d('0xc')](function(_0x102733){if(_0x102733){_0x3d4791=_0x102733[_0xa96d('0x36')];if(!_0xa6c192[_0xa96d('0x1c')]['hasOwnProperty'](_0xa96d('0x20'))){_0x46afcf[_0xa96d('0x9')]=qs['limit'](_0xa6c192[_0xa96d('0x1c')]['limit']);_0x46afcf[_0xa96d('0x7')]=qs[_0xa96d('0x7')](_0xa6c192[_0xa96d('0x1c')]['offset']);}return _0x40fa6a[_0xa96d('0x38')](_0x46afcf);}})['then'](function(_0x224298){if(_0x224298){return _0x224298?{'count':_0x3d4791,'rows':_0x224298}:null;}})[_0xa96d('0xc')](respondWithResult(_0x2ca11c,null))['catch'](handleError(_0x2ca11c,null));};exports[_0xa96d('0x39')]=function(_0x3d13f2,_0x305560){if(_0x3d13f2[_0xa96d('0x33')]['id']){delete _0x3d13f2[_0xa96d('0x33')]['id'];}return db[_0xa96d('0x14')][_0xa96d('0x34')]({'where':{'id':_0x3d13f2[_0xa96d('0x2f')]['id']}})[_0xa96d('0xc')](handleEntityNotFound(_0x305560,null))[_0xa96d('0xc')](function(_0x12da7a){if(_0x12da7a){_0x3d13f2['body']['AccountId']=_0x12da7a['id'];_0x3d13f2[_0xa96d('0x33')][_0xa96d('0x3a')]=integrations['getSubjects'](_0x3d13f2[_0xa96d('0x33')][_0xa96d('0x3b')],_0x3d13f2[_0xa96d('0x33')][_0xa96d('0x16')]);_0x3d13f2[_0xa96d('0x33')]['Descriptions']=integrations[_0xa96d('0x3c')](_0x3d13f2[_0xa96d('0x33')]['channel'],_0x3d13f2[_0xa96d('0x33')][_0xa96d('0x16')]);return db['Dynamics365Configuration'][_0xa96d('0x32')](_0x3d13f2['body'],{'include':[{'model':db[_0xa96d('0x3d')],'as':_0xa96d('0x3a')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xa96d('0xc')](respondWithResult(_0x305560,null))[_0xa96d('0x2d')](handleError(_0x305560,null));};function sanitizeRemoteUri(_0xb2225e){var _0x52782c=_0xb2225e[_0xa96d('0x3e')](-0x1);if(_0x52782c==='/')return _0xb2225e[_0xa96d('0x3f')](0x0,_0xb2225e['lastIndexOf'](_0x52782c));return _0xb2225e;}function getWebApiUrl(_0x251224){return util[_0xa96d('0x40')](_0xa96d('0x41'),_0x251224);}exports[_0xa96d('0x42')]=function(_0x5e0cde,_0x4a0a00){var _0x3972b0=_0x5e0cde[_0xa96d('0x1c')][_0xa96d('0x43')];var _0x23b458=_0x3972b0==='incident'?'Incident':_0xa96d('0x44');var _0x64332b='';var _0x5e1d7a='';var _0x4af337='';var _0x25b0cb='';var _0x5cc759='';var _0x48de98='';var _0x222157='';var _0x30e6f0='';var _0x406bc7=[_0xa96d('0x45'),_0xa96d('0x46'),_0xa96d('0x47'),_0xa96d('0x48'),_0xa96d('0x49'),_0xa96d('0x4a'),_0xa96d('0x4b'),_0xa96d('0x4c'),_0xa96d('0x4d'),_0xa96d('0x4e')];var _0x53838a=['accountidname',_0xa96d('0x4f'),_0xa96d('0x50'),_0xa96d('0x51'),_0xa96d('0x52'),'contactidyominame','contractdetailidname',_0xa96d('0x53'),'createdbyexternalpartyname',_0xa96d('0x54'),'createdbyname',_0xa96d('0x55'),'createdon',_0xa96d('0x56'),_0xa96d('0x57'),_0xa96d('0x58'),_0xa96d('0x59'),_0xa96d('0x5a'),'emailaddress',_0xa96d('0x5b'),'entityimage_timestamp',_0xa96d('0x5c'),_0xa96d('0x5d'),'exchangerate',_0xa96d('0x5e'),_0xa96d('0x5f'),_0xa96d('0x60'),'influencescore',_0xa96d('0x61'),_0xa96d('0x62'),_0xa96d('0x63'),_0xa96d('0x64'),_0xa96d('0x65'),'modifiedbyname',_0xa96d('0x66'),_0xa96d('0x67'),_0xa96d('0x68'),'modifiedonbehalfbyyominame',_0xa96d('0x69'),'msdyn_iotalertname',_0xa96d('0x6a'),_0xa96d('0x6b'),_0xa96d('0x6c'),_0xa96d('0x6d'),_0xa96d('0x6e'),_0xa96d('0x6f'),'parentcaseidname',_0xa96d('0x70'),_0xa96d('0x71'),'prioritycodename',_0xa96d('0x72'),_0xa96d('0x73'),'resolveby',_0xa96d('0x74'),_0xa96d('0x75'),'responsiblecontactidname',_0xa96d('0x76'),_0xa96d('0x77'),'slainvokedidname','slaname','socialprofileidname',_0xa96d('0x78'),_0xa96d('0x79'),_0xa96d('0x7a'),'ticketnumber','timezoneruleversionnumber',_0xa96d('0x7b'),_0xa96d('0x7c'),_0xa96d('0x7d'),'versionnumber'];var _0xbaf717=_0x406bc7[_0xa96d('0x7e')](_0x53838a);return db[_0xa96d('0x14')][_0xa96d('0x34')]({'where':{'id':_0x5e0cde[_0xa96d('0x2f')]['id']},'attributes':['id',_0xa96d('0x7f'),_0xa96d('0x80'),_0xa96d('0x81'),_0xa96d('0x82'),_0xa96d('0x83'),'clientSecret','modernAuthentication'],'include':[{'model':db[_0xa96d('0x84')],'as':_0xa96d('0x84'),'attributes':['id',_0xa96d('0x85'),_0xa96d('0x86')]}]})[_0xa96d('0xc')](handleEntityNotFound(_0x4a0a00,null))['then'](function(_0x531063){if(_0x531063){if(_0x531063[_0xa96d('0x87')]){_0x531063[_0xa96d('0x88')]=_0x531063['CloudProvider'][_0xa96d('0x85')];_0x30e6f0=sanitizeRemoteUri(_0x531063['CloudProvider'][_0xa96d('0x86')]);_0x222157=getWebApiUrl(_0x30e6f0);return _0x531063;}_0x30e6f0=sanitizeRemoteUri(_0x531063[_0xa96d('0x81')]);_0x222157=getWebApiUrl(_0x30e6f0);var _0x1a1c4a={'method':_0xa96d('0x89'),'uri':_0xa96d('0x8a')+_0x531063[_0xa96d('0x82')]+_0xa96d('0x8b'),'form':{'client_id':_0x531063['clientId'],'resource':_0x30e6f0,'username':_0x531063[_0xa96d('0x7f')],'password':_0x531063['password'],'grant_type':'password','client_secret':_0x531063[_0xa96d('0x8c')]},'json':!![]};return rp(_0x1a1c4a);}})[_0xa96d('0xc')](function(_0x2212e9){_0x48de98=_0x2212e9[_0xa96d('0x88')];var _0x5a827f={'method':_0xa96d('0x8d'),'uri':encodeURI(_0x222157+_0xa96d('0x8e')+_0x23b458+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x48de98,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5a827f);})[_0xa96d('0xc')](function(_0x5cede8){var _0x487a03=_0x5cede8[_0xa96d('0x8f')][0x0];var _0x413ec1=_0x487a03['MetadataId'];var _0x25e96a={'method':_0xa96d('0x8d'),'uri':_0x222157+'EntityDefinitions('+_0x413ec1+_0xa96d('0x90'),'headers':{'Authorization':_0xa96d('0x91')+_0x48de98,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x25e96a);})['then'](function(_0x1e5aa8){_0x64332b=_0x1e5aa8;_0x5e1d7a=_0x64332b[_0xa96d('0x92')];_0x5e1d7a=_[_0xa96d('0x93')](_0x5e1d7a,function(_0x46460e){return!_0xbaf717[_0xa96d('0x94')](_0x46460e['LogicalName']);});var _0xb38c76=[];var _0x4eba0e=[];_0x5e1d7a['forEach'](function(_0x1e824b){if(_0x1e824b[_0xa96d('0x95')]){var _0xb3add9=_0x1e824b[_0xa96d('0x95')][_0xa96d('0x3f')](_0x1e824b[_0xa96d('0x95')][_0xa96d('0x96')]('.')+0x1);if(_0xb3add9===_0xa96d('0x97')){_0xb38c76[_0xa96d('0x98')](getSelectList(_0x222157,_0x3972b0,_0x4eba0e,_0x64332b['MetadataId'],_0x1e824b[_0xa96d('0x99')],_0x48de98));}}});return Promise[_0xa96d('0x9a')](_0xb38c76);})[_0xa96d('0xc')](function(_0x503e89){_0x4af337=_0x503e89[0x0];var _0x5e6e68=[];var _0x18cec0=[];_0x5e1d7a[_0xa96d('0x9b')](function(_0x34b8fc){if(!_[_0xa96d('0x9c')](_0x34b8fc[_0xa96d('0x95')])){var _0x1a6eba=_0x34b8fc[_0xa96d('0x95')][_0xa96d('0x3f')](_0x34b8fc[_0xa96d('0x95')]['lastIndexOf']('.')+0x1);if(_0x1a6eba==='BooleanAttributeMetadata'){_0x5e6e68['push'](getBooleanList(_0x222157,_0x3972b0,_0x18cec0,_0x64332b[_0xa96d('0x99')],_0x34b8fc[_0xa96d('0x99')],_0x48de98));}}});return Promise[_0xa96d('0x9a')](_0x5e6e68);})[_0xa96d('0xc')](function(_0x3ba0b0){_0x25b0cb=_0x3ba0b0[0x0];var _0x105328=[];var _0x3c0c0b=[];_0x5e1d7a[_0xa96d('0x9b')](function(_0x949efb){if(_0x949efb['@odata.type']){var _0x46073e=_0x949efb['@odata.type'][_0xa96d('0x3f')](_0x949efb[_0xa96d('0x95')]['lastIndexOf']('.')+0x1);if(_0x46073e==='StringAttributeMetadata'||_0x46073e===_0xa96d('0x9d')||_0x46073e===_0xa96d('0x9e')||_0x46073e===_0xa96d('0x9f')||_0x46073e==='MemoAttributeMetadata'||_0x46073e===_0xa96d('0xa0')||_0x46073e===_0xa96d('0xa1')||_0x46073e===_0xa96d('0xa2')||_0x46073e===_0xa96d('0xa3')||_0x46073e==='DecimalAttributeMetadata'){_0x105328['push'](getInputList(_0x222157,_0x3972b0,_0x46073e,_0x3c0c0b,_0x64332b[_0xa96d('0x99')],_0x949efb[_0xa96d('0x99')],_0x48de98));}}});return Promise[_0xa96d('0x9a')](_0x105328);})['then'](function(_0x3bbd4f){_0x5cc759=_0x3bbd4f[0x0];var _0x20ae5d=_0x4af337[_0xa96d('0x7e')](_0x25b0cb)[_0xa96d('0x7e')](_0x5cc759);var _0x108552={'count':_0x20ae5d[_0xa96d('0x36')],'rows':_0x20ae5d};return _0x108552;})[_0xa96d('0xc')](respondWithResult(_0x4a0a00,null))[_0xa96d('0x2d')](function(_0x325237){var _0x5697ad=_0x5e0cde[_0xa96d('0x1c')][_0xa96d('0xa4')]?0x1f4:_0x325237[_0xa96d('0xa5')]||0x1f4;logger['error'](_0x325237[_0xa96d('0xa6')]);delete _0x325237[_0xa96d('0x10')];if(_0x5697ad===0x191){_0x5697ad=0x190;}_0x4a0a00[_0xa96d('0x5')](_0x5697ad)['send'](_0x5e0cde[_0xa96d('0x1c')][_0xa96d('0xa4')]?{'message':'Wrong\x20credentials','statusCode':_0x325237['statusCode']}:_0x325237);});};function getSelectList(_0xfdd4b1,_0x54643a,_0x3ec68b,_0x2f8656,_0xcb0c67,_0xf51eb1){var _0x21e655={'method':'GET','uri':_0xfdd4b1+_0xa96d('0xa7')+_0x2f8656+_0xa96d('0xa8')+_0xcb0c67+_0xa96d('0xa9')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xa96d('0x91')+_0xf51eb1,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x21e655)[_0xa96d('0xc')](function(_0x2737ff){var _0x43bb9c=[];var _0x4dcda8=_0x2737ff[_0xa96d('0xaa')][_0xa96d('0xab')];_0x4dcda8[_0xa96d('0x9b')](function(_0xfa8aff){_0x43bb9c[_0xa96d('0x98')]({'name':_0xfa8aff[_0xa96d('0xac')]['UserLocalizedLabel']['Label'],'value':String(_0xfa8aff['Value'])});});var _0x138531={'id':_0x54643a+'_'+_0x2737ff[_0xa96d('0xad')],'name':_0x2737ff[_0xa96d('0xae')][_0xa96d('0xaf')][_0xa96d('0xac')],'custom':![],'options':_0x43bb9c};_0x3ec68b[_0xa96d('0x98')](_0x138531);return _0x3ec68b;});}function getBooleanList(_0x38bd00,_0x125101,_0x5cd2e9,_0x19ffde,_0x39cbf2,_0xc08793){var _0x3fa500={'method':_0xa96d('0x8d'),'uri':_0x38bd00+_0xa96d('0xa7')+_0x19ffde+_0xa96d('0xa8')+_0x39cbf2+_0xa96d('0xb0'),'headers':{'Authorization':_0xa96d('0x91')+_0xc08793,'If-None-Match':null,'OData-Version':_0xa96d('0xb1')},'json':!![]};return rp(_0x3fa500)['then'](function(_0x4a147b){var _0x258170=[];_0x258170[_0xa96d('0x98')]({'name':_0x4a147b[_0xa96d('0xaa')][_0xa96d('0xb2')][_0xa96d('0xac')][_0xa96d('0xaf')]['Label'],'value':'true'},{'name':_0x4a147b[_0xa96d('0xaa')][_0xa96d('0xb3')][_0xa96d('0xac')]['UserLocalizedLabel']['Label'],'value':_0xa96d('0xb4')});var _0x5556a3={'id':_0x125101+'_'+_0x4a147b[_0xa96d('0xad')],'name':_0x4a147b[_0xa96d('0xae')]['UserLocalizedLabel'][_0xa96d('0xac')],'custom':![],'options':_0x258170};_0x5cd2e9[_0xa96d('0x98')](_0x5556a3);return _0x5cd2e9;});}function getInputList(_0x48800d,_0x4f191d,_0x155d16,_0x4cc536,_0x2a238e,_0xa66b81,_0x4d1b79){var _0x5e4d04={'method':_0xa96d('0x8d'),'uri':_0x48800d+_0xa96d('0xa7')+_0x2a238e+_0xa96d('0xa8')+_0xa66b81+_0xa96d('0xb5')+_0x155d16+_0xa96d('0xb6'),'headers':{'Authorization':_0xa96d('0x91')+_0x4d1b79,'If-None-Match':null,'OData-Version':_0xa96d('0xb1')},'json':!![]};return rp(_0x5e4d04)[_0xa96d('0xc')](function(_0x1ac33c){var _0x1defae={'id':_0x4f191d+'_'+_0x1ac33c['LogicalName'],'name':_0x1ac33c[_0xa96d('0xae')][_0xa96d('0xaf')]?_0x1ac33c[_0xa96d('0xae')][_0xa96d('0xaf')][_0xa96d('0xac')]:_0x1ac33c[_0xa96d('0xad')],'custom':![],'options':[]};_0x4cc536[_0xa96d('0x98')](_0x1defae);return _0x4cc536;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 42e13bb..87a39ce 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x12254f,_0x100cfe){var _0x3a4fa2=function(_0x1ce891){while(--_0x1ce891){_0x12254f['push'](_0x12254f['shift']());}};_0x3a4fa2(++_0x100cfe);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x52bf43,_0xd2a8d6){var _0x109507=function(_0x3dbb93){while(--_0x3dbb93){_0x52bf43['push'](_0x52bf43['shift']());}};_0x109507(++_0xd2a8d6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0xcb91[_0x3861f7];return _0x50879f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 3263f07..1a15de4 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 _0xfb04=['debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetDynamics365Account','options','where','attributes','limit','include','map','model','then','catch','ShowDynamics365Account','Dynamics365Account','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Dynamics365Account,\x20%s,\x20%s'];(function(_0x3a3c90,_0x31c3e5){var _0x4a30ed=function(_0x26d7e3){while(--_0x26d7e3){_0x3a3c90['push'](_0x3a3c90['shift']());}};_0x4a30ed(++_0x31c3e5);}(_0xfb04,0xc3));var _0x4fb0=function(_0x17ad48,_0x397194){_0x17ad48=_0x17ad48-0x0;var _0x57f356=_0xfb04[_0x17ad48];return _0x57f356;};'use strict';var _=require(_0x4fb0('0x0'));var util=require('util');var moment=require(_0x4fb0('0x1'));var BPromise=require(_0x4fb0('0x2'));var rs=require(_0x4fb0('0x3'));var fs=require('fs');var Redis=require(_0x4fb0('0x4'));var db=require(_0x4fb0('0x5'))['db'];var utils=require(_0x4fb0('0x6'));var logger=require(_0x4fb0('0x7'))(_0x4fb0('0x8'));var config=require(_0x4fb0('0x9'));var jayson=require(_0x4fb0('0xa'));var client=jayson['client'][_0x4fb0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdf1848,_0x3dde75,_0x3900d3){return new BPromise(function(_0x36f2ea,_0x21d813){return client[_0x4fb0('0xc')](_0xdf1848,_0x3900d3)['then'](function(_0x5d21ca){logger[_0x4fb0('0xd')](_0x4fb0('0xe'),_0x3dde75,'request\x20sent');logger[_0x4fb0('0xf')](_0x4fb0('0x10'),_0x3dde75,_0x4fb0('0x11'),JSON[_0x4fb0('0x12')](_0x5d21ca));if(_0x5d21ca[_0x4fb0('0x13')]){if(_0x5d21ca['error'][_0x4fb0('0x14')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x3dde75,_0x5d21ca[_0x4fb0('0x13')][_0x4fb0('0x15')]);return _0x21d813(_0x5d21ca[_0x4fb0('0x13')][_0x4fb0('0x15')]);}logger['error'](_0x4fb0('0xe'),_0x3dde75,_0x5d21ca[_0x4fb0('0x13')][_0x4fb0('0x15')]);return _0x36f2ea(_0x5d21ca[_0x4fb0('0x13')]['message']);}else{logger['info'](_0x4fb0('0xe'),_0x3dde75,_0x4fb0('0x11'));_0x36f2ea(_0x5d21ca[_0x4fb0('0x16')]['message']);}})['catch'](function(_0x1e0cb7){logger['error'](_0x4fb0('0xe'),_0x3dde75,_0x1e0cb7);_0x21d813(_0x1e0cb7);});});}exports[_0x4fb0('0x17')]=function(_0x5d83d4){var _0x2791cd=this;return new Promise(function(_0x4b1f03,_0x1f9b8d){return db['Dynamics365Account']['findAll']({'raw':_0x5d83d4[_0x4fb0('0x18')]?_0x5d83d4[_0x4fb0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5d83d4[_0x4fb0('0x18')]?_0x5d83d4[_0x4fb0('0x18')][_0x4fb0('0x19')]||null:null,'attributes':_0x5d83d4[_0x4fb0('0x18')]?_0x5d83d4[_0x4fb0('0x18')][_0x4fb0('0x1a')]||null:null,'limit':_0x5d83d4[_0x4fb0('0x18')]?_0x5d83d4[_0x4fb0('0x18')][_0x4fb0('0x1b')]||null:null,'include':_0x5d83d4['options']?_0x5d83d4[_0x4fb0('0x18')][_0x4fb0('0x1c')]?_[_0x4fb0('0x1d')](_0x5d83d4[_0x4fb0('0x18')]['include'],function(_0x86f6e5){return{'model':db[_0x86f6e5[_0x4fb0('0x1e')]],'as':_0x86f6e5['as'],'attributes':_0x86f6e5['attributes'],'include':_0x86f6e5[_0x4fb0('0x1c')]?_[_0x4fb0('0x1d')](_0x86f6e5[_0x4fb0('0x1c')],function(_0x87254a){return{'model':db[_0x87254a['model']],'as':_0x87254a['as'],'attributes':_0x87254a[_0x4fb0('0x1a')],'include':_0x87254a[_0x4fb0('0x1c')]?_['map'](_0x87254a[_0x4fb0('0x1c')],function(_0x5f5167){return{'model':db[_0x5f5167[_0x4fb0('0x1e')]],'as':_0x5f5167['as'],'attributes':_0x5f5167['attributes']};}):[]};}):[]};}):[]:[]})[_0x4fb0('0x1f')](function(_0x6e0422){logger[_0x4fb0('0xd')](_0x4fb0('0x17'),_0x5d83d4);logger[_0x4fb0('0xf')](_0x4fb0('0x17'),_0x5d83d4,JSON[_0x4fb0('0x12')](_0x6e0422));_0x4b1f03(_0x6e0422);})[_0x4fb0('0x20')](function(_0x2dcc58){logger[_0x4fb0('0x13')](_0x4fb0('0x17'),_0x2dcc58[_0x4fb0('0x15')],_0x5d83d4);_0x1f9b8d(_0x2791cd['error'](0x1f4,_0x2dcc58[_0x4fb0('0x15')]));});});};exports[_0x4fb0('0x21')]=function(_0x6507e7){var _0x2dfa69=this;return new Promise(function(_0x10790e,_0x2f3222){return db[_0x4fb0('0x22')]['find']({'raw':_0x6507e7[_0x4fb0('0x18')]?_0x6507e7[_0x4fb0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x6507e7[_0x4fb0('0x18')]?_0x6507e7[_0x4fb0('0x18')][_0x4fb0('0x19')]||null:null,'attributes':_0x6507e7[_0x4fb0('0x18')]?_0x6507e7['options']['attributes']||null:null,'include':_0x6507e7[_0x4fb0('0x18')]?_0x6507e7['options'][_0x4fb0('0x1c')]?_[_0x4fb0('0x1d')](_0x6507e7[_0x4fb0('0x18')]['include'],function(_0x42035d){return{'model':db[_0x42035d[_0x4fb0('0x1e')]],'as':_0x42035d['as'],'attributes':_0x42035d['attributes'],'include':_0x42035d[_0x4fb0('0x1c')]?_[_0x4fb0('0x1d')](_0x42035d[_0x4fb0('0x1c')],function(_0x1a8f94){return{'model':db[_0x1a8f94[_0x4fb0('0x1e')]],'as':_0x1a8f94['as'],'attributes':_0x1a8f94[_0x4fb0('0x1a')],'include':_0x1a8f94[_0x4fb0('0x1c')]?_[_0x4fb0('0x1d')](_0x1a8f94[_0x4fb0('0x1c')],function(_0x4f006c){return{'model':db[_0x4f006c[_0x4fb0('0x1e')]],'as':_0x4f006c['as'],'attributes':_0x4f006c[_0x4fb0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4fb0('0x1f')](function(_0x5958d1){logger['info'](_0x4fb0('0x21'),_0x6507e7);logger['debug']('ShowDynamics365Account',_0x6507e7,JSON[_0x4fb0('0x12')](_0x5958d1));_0x10790e(_0x5958d1);})[_0x4fb0('0x20')](function(_0x293119){logger['error'](_0x4fb0('0x21'),_0x293119[_0x4fb0('0x15')],_0x6507e7);_0x2f3222(_0x2dfa69[_0x4fb0('0x13')](0x1f4,_0x293119[_0x4fb0('0x15')]));});});}; \ No newline at end of file +var _0x4b78=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','Dynamics365Account','ShowDynamics365Account'];(function(_0x220c84,_0xcf57c6){var _0x1b0d42=function(_0x4d64bf){while(--_0x4d64bf){_0x220c84['push'](_0x220c84['shift']());}};_0x1b0d42(++_0xcf57c6);}(_0x4b78,0x120));var _0x84b7=function(_0x48c6e8,_0x4b27f4){_0x48c6e8=_0x48c6e8-0x0;var _0x10fd41=_0x4b78[_0x48c6e8];return _0x10fd41;};'use strict';var _=require(_0x84b7('0x0'));var util=require(_0x84b7('0x1'));var moment=require(_0x84b7('0x2'));var BPromise=require(_0x84b7('0x3'));var rs=require(_0x84b7('0x4'));var fs=require('fs');var Redis=require(_0x84b7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x84b7('0x6'))(_0x84b7('0x7'));var config=require(_0x84b7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x84b7('0x9')][_0x84b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bd28d,_0xb9861c,_0x27967f){return new BPromise(function(_0x1e452a,_0x1ef098){return client[_0x84b7('0xb')](_0x1bd28d,_0x27967f)[_0x84b7('0xc')](function(_0x1597c9){logger[_0x84b7('0xd')](_0x84b7('0xe'),_0xb9861c,_0x84b7('0xf'));logger[_0x84b7('0x10')](_0x84b7('0x11'),_0xb9861c,_0x84b7('0xf'),JSON[_0x84b7('0x12')](_0x1597c9));if(_0x1597c9['error']){if(_0x1597c9[_0x84b7('0x13')][_0x84b7('0x14')]===0x1f4){logger[_0x84b7('0x13')](_0x84b7('0xe'),_0xb9861c,_0x1597c9['error'][_0x84b7('0x15')]);return _0x1ef098(_0x1597c9[_0x84b7('0x13')][_0x84b7('0x15')]);}logger[_0x84b7('0x13')](_0x84b7('0xe'),_0xb9861c,_0x1597c9[_0x84b7('0x13')][_0x84b7('0x15')]);return _0x1e452a(_0x1597c9[_0x84b7('0x13')][_0x84b7('0x15')]);}else{logger['info'](_0x84b7('0xe'),_0xb9861c,_0x84b7('0xf'));_0x1e452a(_0x1597c9[_0x84b7('0x16')][_0x84b7('0x15')]);}})[_0x84b7('0x17')](function(_0x1599fd){logger[_0x84b7('0x13')](_0x84b7('0xe'),_0xb9861c,_0x1599fd);_0x1ef098(_0x1599fd);});});}exports[_0x84b7('0x18')]=function(_0x10fbed){var _0x594c37=this;return new Promise(function(_0x13398d,_0x1273ca){return db['Dynamics365Account'][_0x84b7('0x19')]({'raw':_0x10fbed[_0x84b7('0x1a')]?_0x10fbed[_0x84b7('0x1a')][_0x84b7('0x1b')]===undefined?!![]:![]:!![],'where':_0x10fbed[_0x84b7('0x1a')]?_0x10fbed[_0x84b7('0x1a')][_0x84b7('0x1c')]||null:null,'attributes':_0x10fbed[_0x84b7('0x1a')]?_0x10fbed[_0x84b7('0x1a')][_0x84b7('0x1d')]||null:null,'limit':_0x10fbed[_0x84b7('0x1a')]?_0x10fbed['options'][_0x84b7('0x1e')]||null:null,'include':_0x10fbed['options']?_0x10fbed['options'][_0x84b7('0x1f')]?_['map'](_0x10fbed[_0x84b7('0x1a')]['include'],function(_0x57611e){return{'model':db[_0x57611e['model']],'as':_0x57611e['as'],'attributes':_0x57611e[_0x84b7('0x1d')],'include':_0x57611e[_0x84b7('0x1f')]?_[_0x84b7('0x20')](_0x57611e[_0x84b7('0x1f')],function(_0x2149d9){return{'model':db[_0x2149d9[_0x84b7('0x21')]],'as':_0x2149d9['as'],'attributes':_0x2149d9[_0x84b7('0x1d')],'include':_0x2149d9[_0x84b7('0x1f')]?_[_0x84b7('0x20')](_0x2149d9['include'],function(_0x4e903d){return{'model':db[_0x4e903d[_0x84b7('0x21')]],'as':_0x4e903d['as'],'attributes':_0x4e903d[_0x84b7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x84b7('0xc')](function(_0x350956){logger[_0x84b7('0xd')](_0x84b7('0x18'),_0x10fbed);logger['debug'](_0x84b7('0x18'),_0x10fbed,JSON[_0x84b7('0x12')](_0x350956));_0x13398d(_0x350956);})[_0x84b7('0x17')](function(_0x458036){logger[_0x84b7('0x13')](_0x84b7('0x18'),_0x458036[_0x84b7('0x15')],_0x10fbed);_0x1273ca(_0x594c37['error'](0x1f4,_0x458036[_0x84b7('0x15')]));});});};exports['ShowDynamics365Account']=function(_0xd12358){var _0x14b940=this;return new Promise(function(_0x32512b,_0x1a94c2){return db[_0x84b7('0x22')]['find']({'raw':_0xd12358[_0x84b7('0x1a')]?_0xd12358[_0x84b7('0x1a')][_0x84b7('0x1b')]===undefined?!![]:![]:!![],'where':_0xd12358['options']?_0xd12358[_0x84b7('0x1a')][_0x84b7('0x1c')]||null:null,'attributes':_0xd12358[_0x84b7('0x1a')]?_0xd12358[_0x84b7('0x1a')][_0x84b7('0x1d')]||null:null,'include':_0xd12358['options']?_0xd12358[_0x84b7('0x1a')][_0x84b7('0x1f')]?_[_0x84b7('0x20')](_0xd12358[_0x84b7('0x1a')][_0x84b7('0x1f')],function(_0x2cec2f){return{'model':db[_0x2cec2f[_0x84b7('0x21')]],'as':_0x2cec2f['as'],'attributes':_0x2cec2f[_0x84b7('0x1d')],'include':_0x2cec2f[_0x84b7('0x1f')]?_[_0x84b7('0x20')](_0x2cec2f[_0x84b7('0x1f')],function(_0x3034d7){return{'model':db[_0x3034d7[_0x84b7('0x21')]],'as':_0x3034d7['as'],'attributes':_0x3034d7[_0x84b7('0x1d')],'include':_0x3034d7[_0x84b7('0x1f')]?_[_0x84b7('0x20')](_0x3034d7[_0x84b7('0x1f')],function(_0x37c908){return{'model':db[_0x37c908[_0x84b7('0x21')]],'as':_0x37c908['as'],'attributes':_0x37c908['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30418b){logger['info'](_0x84b7('0x23'),_0xd12358);logger[_0x84b7('0x10')]('ShowDynamics365Account',_0xd12358,JSON[_0x84b7('0x12')](_0x30418b));_0x32512b(_0x30418b);})[_0x84b7('0x17')](function(_0x29434e){logger[_0x84b7('0x13')](_0x84b7('0x23'),_0x29434e[_0x84b7('0x15')],_0xd12358);_0x1a94c2(_0x14b940[_0x84b7('0x13')](0x1f4,_0x29434e[_0x84b7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index b7bba2e..ba767db 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 _0x6b1e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x15bba7,_0x5b0a39){var _0x327912=function(_0x8fed0e){while(--_0x8fed0e){_0x15bba7['push'](_0x15bba7['shift']());}};_0x327912(++_0x5b0a39);}(_0x6b1e,0xd3));var _0xe6b1=function(_0xce7f62,_0x55acdf){_0xce7f62=_0xce7f62-0x0;var _0x35a598=_0x6b1e[_0xce7f62];return _0x35a598;};'use strict';var multer=require(_0xe6b1('0x0'));var util=require(_0xe6b1('0x1'));var path=require(_0xe6b1('0x2'));var timeout=require(_0xe6b1('0x3'));var express=require(_0xe6b1('0x4'));var router=express[_0xe6b1('0x5')]();var fs_extra=require(_0xe6b1('0x6'));var auth=require(_0xe6b1('0x7'));var interaction=require(_0xe6b1('0x8'));var config=require(_0xe6b1('0x9'));var controller=require(_0xe6b1('0xa'));router[_0xe6b1('0xb')]('/',auth[_0xe6b1('0xc')](),controller[_0xe6b1('0xd')]);router[_0xe6b1('0xb')]('/:id',auth[_0xe6b1('0xc')](),controller[_0xe6b1('0xe')]);router[_0xe6b1('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0xe6b1('0xf')]);router[_0xe6b1('0xb')](_0xe6b1('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xe6b1('0xb')](_0xe6b1('0x11'),auth[_0xe6b1('0xc')](),controller[_0xe6b1('0x12')]);router[_0xe6b1('0x13')]('/',auth['isAuthenticated'](),controller[_0xe6b1('0x14')]);router[_0xe6b1('0x15')](_0xe6b1('0x16'),auth[_0xe6b1('0xc')](),controller[_0xe6b1('0x17')]);router[_0xe6b1('0x18')](_0xe6b1('0x16'),auth[_0xe6b1('0xc')](),controller[_0xe6b1('0x19')]);module[_0xe6b1('0x1a')]=router; \ No newline at end of file +var _0x3bb8=['../../config/environment','./intDynamics365Configuration.controller','index','get','show','/:id/fields','isAuthenticated','getFields','/:id/descriptions','post','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x270c5f,_0x5557f2){var _0x1cf807=function(_0x2f9010){while(--_0x2f9010){_0x270c5f['push'](_0x270c5f['shift']());}};_0x1cf807(++_0x5557f2);}(_0x3bb8,0x173));var _0x83bb=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x3bb8[_0x5a95fa];return _0x1a61b8;};'use strict';var multer=require(_0x83bb('0x0'));var util=require(_0x83bb('0x1'));var path=require(_0x83bb('0x2'));var timeout=require(_0x83bb('0x3'));var express=require(_0x83bb('0x4'));var router=express['Router']();var fs_extra=require(_0x83bb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x83bb('0x6'));var config=require(_0x83bb('0x7'));var controller=require(_0x83bb('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x83bb('0x9')]);router[_0x83bb('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x83bb('0xb')]);router['get'](_0x83bb('0xc'),auth[_0x83bb('0xd')](),controller[_0x83bb('0xe')]);router[_0x83bb('0xa')]('/:id/subjects',auth[_0x83bb('0xd')](),controller['getSubjects']);router[_0x83bb('0xa')](_0x83bb('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x83bb('0x10')]('/',auth[_0x83bb('0xd')](),controller['create']);router['put'](_0x83bb('0x11'),auth[_0x83bb('0xd')](),controller[_0x83bb('0x12')]);router['delete']('/:id',auth[_0x83bb('0xd')](),controller[_0x83bb('0x13')]);module[_0x83bb('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index e5abc72..6887a88 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 _0xd87e=['nothing','exports','STRING','ENUM','incident','phonecall','contact'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0xd87e,0x1f2));var _0xed87=function(_0x5dac46,_0x28e9dc){_0x5dac46=_0x5dac46-0x0;var _0x51095c=_0xd87e[_0x5dac46];return _0x51095c;};'use strict';var Sequelize=require('sequelize');module[_0xed87('0x0')]={'name':{'type':Sequelize[_0xed87('0x1')]},'description':{'type':Sequelize[_0xed87('0x1')]},'ticketType':{'type':Sequelize[_0xed87('0x2')](_0xed87('0x3'),_0xed87('0x4')),'defaultValue':_0xed87('0x3')},'moduleCreate':{'type':Sequelize[_0xed87('0x2')](_0xed87('0x5'),_0xed87('0x6')),'defaultValue':_0xed87('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0xf1e2=['STRING','ENUM','incident','phonecall','contact','sequelize','exports'];(function(_0x3addcd,_0x3f1969){var _0x37c24a=function(_0x33b66b){while(--_0x33b66b){_0x3addcd['push'](_0x3addcd['shift']());}};_0x37c24a(++_0x3f1969);}(_0xf1e2,0x163));var _0x2f1e=function(_0x24c1c1,_0x36d8bb){_0x24c1c1=_0x24c1c1-0x0;var _0x4745eb=_0xf1e2[_0x24c1c1];return _0x4745eb;};'use strict';var Sequelize=require(_0x2f1e('0x0'));module[_0x2f1e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2f1e('0x2')]},'ticketType':{'type':Sequelize[_0x2f1e('0x3')](_0x2f1e('0x4'),_0x2f1e('0x5')),'defaultValue':_0x2f1e('0x4')},'moduleCreate':{'type':Sequelize[_0x2f1e('0x3')](_0x2f1e('0x6'),'nothing'),'defaultValue':_0x2f1e('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 a15f142..6d7ed39 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 _0x7ee8=['../../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','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','find','create','body','params','findOne','Dynamics365Field','length','order','getFields','hasOwnProperty','nolimit','getSubjects','options','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2ee412,_0x25ea61){var _0x224ac6=function(_0x2a1986){while(--_0x2a1986){_0x2ee412['push'](_0x2ee412['shift']());}};_0x224ac6(++_0x25ea61);}(_0x7ee8,0x13a));var _0x87ee=function(_0x1a1460,_0x539531){_0x1a1460=_0x1a1460-0x0;var _0x33ab03=_0x7ee8[_0x1a1460];return _0x33ab03;};'use strict';var emlformat=require(_0x87ee('0x0'));var rimraf=require(_0x87ee('0x1'));var zipdir=require(_0x87ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x87ee('0x3'));var moment=require(_0x87ee('0x4'));var BPromise=require(_0x87ee('0x5'));var Mustache=require(_0x87ee('0x6'));var util=require(_0x87ee('0x7'));var path=require(_0x87ee('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x87ee('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87ee('0xa'));var squel=require(_0x87ee('0xb'));var crypto=require('crypto');var jsforce=require(_0x87ee('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x87ee('0xd'));var querystring=require('querystring');var Papa=require(_0x87ee('0xe'));var Redis=require(_0x87ee('0xf'));var authService=require(_0x87ee('0x10'));var qs=require(_0x87ee('0x11'));var as=require(_0x87ee('0x12'));var hardwareService=require(_0x87ee('0x13'));var logger=require(_0x87ee('0x14'))(_0x87ee('0x15'));var utils=require(_0x87ee('0x16'));var config=require(_0x87ee('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x87ee('0x18'))['db'];function respondWithStatusCode(_0x228f78,_0x4952fc){_0x4952fc=_0x4952fc||0xcc;return function(_0x5e2175){if(_0x5e2175){return _0x228f78[_0x87ee('0x19')](_0x4952fc);}return _0x228f78[_0x87ee('0x1a')](_0x4952fc)[_0x87ee('0x1b')]();};}function respondWithResult(_0x3496ce,_0x5ca58a){_0x5ca58a=_0x5ca58a||0xc8;return function(_0x53803c){if(_0x53803c){return _0x3496ce['status'](_0x5ca58a)[_0x87ee('0x1c')](_0x53803c);}};}function respondWithFilteredResult(_0x1b7a5b,_0x313651){return function(_0x2a9b80){if(_0x2a9b80){var _0x51e0c9=typeof _0x313651[_0x87ee('0x1d')]===_0x87ee('0x1e')&&typeof _0x313651[_0x87ee('0x1f')]==='undefined';var _0x47239=_0x2a9b80[_0x87ee('0x20')];var _0x58ef3f=_0x51e0c9?0x0:_0x313651[_0x87ee('0x1d')];var _0x616d7c=_0x51e0c9?_0x2a9b80['count']:_0x313651[_0x87ee('0x1d')]+_0x313651['limit'];var _0x31907a;if(_0x616d7c>=_0x47239){_0x616d7c=_0x47239;_0x31907a=0xc8;}else{_0x31907a=0xce;}_0x1b7a5b[_0x87ee('0x1a')](_0x31907a);return _0x1b7a5b[_0x87ee('0x21')](_0x87ee('0x22'),_0x58ef3f+'-'+_0x616d7c+'/'+_0x47239)['json'](_0x2a9b80);}return null;};}function patchUpdates(_0x314d8e){return function(_0x236ac7){try{jsonpatch['apply'](_0x236ac7,_0x314d8e,!![]);}catch(_0x4bae38){return BPromise[_0x87ee('0x23')](_0x4bae38);}return _0x236ac7[_0x87ee('0x24')]();};}function saveUpdates(_0x147695,_0x2569e7){return function(_0x5ea1a9){if(_0x5ea1a9){return _0x5ea1a9[_0x87ee('0x25')](_0x147695)[_0x87ee('0x26')](function(_0x4a74c6){return _0x4a74c6;});}return null;};}function removeEntity(_0x53cc53,_0x1c5a2f){return function(_0x203855){if(_0x203855){return _0x203855[_0x87ee('0x27')]()[_0x87ee('0x26')](function(){_0x53cc53[_0x87ee('0x1a')](0xcc)[_0x87ee('0x1b')]();});}};}function handleEntityNotFound(_0x483b60,_0xe84555){return function(_0x3f5edc){if(!_0x3f5edc){_0x483b60[_0x87ee('0x19')](0x194);}return _0x3f5edc;};}function handleError(_0xcad00b,_0x3164ec){_0x3164ec=_0x3164ec||0x1f4;return function(_0x4dd135){logger[_0x87ee('0x28')](_0x4dd135[_0x87ee('0x29')]);if(_0x4dd135[_0x87ee('0x2a')]){delete _0x4dd135[_0x87ee('0x2a')];}_0xcad00b['status'](_0x3164ec)[_0x87ee('0x2b')](_0x4dd135);};}exports[_0x87ee('0x2c')]=function(_0x3ae91e,_0x89a7da){var _0x8352b9={},_0x541f87={},_0x161e8f={'count':0x0,'rows':[]};var _0x25a56e=_[_0x87ee('0x2d')](db[_0x87ee('0x2e')][_0x87ee('0x2f')],function(_0x4a7f7e){return{'name':_0x4a7f7e[_0x87ee('0x30')],'type':_0x4a7f7e['type']['key']};});_0x541f87['model']=_[_0x87ee('0x2d')](_0x25a56e,'name');_0x541f87[_0x87ee('0x31')]=_[_0x87ee('0x32')](_0x3ae91e[_0x87ee('0x31')]);_0x541f87[_0x87ee('0x33')]=_[_0x87ee('0x34')](_0x541f87[_0x87ee('0x35')],_0x541f87[_0x87ee('0x31')]);_0x8352b9['attributes']=_[_0x87ee('0x34')](_0x541f87[_0x87ee('0x35')],qs[_0x87ee('0x36')](_0x3ae91e[_0x87ee('0x31')][_0x87ee('0x36')]));_0x8352b9['attributes']=_0x8352b9[_0x87ee('0x37')]['length']?_0x8352b9[_0x87ee('0x37')]:_0x541f87['model'];if(!_0x3ae91e[_0x87ee('0x31')]['hasOwnProperty']('nolimit')){_0x8352b9[_0x87ee('0x1f')]=qs[_0x87ee('0x1f')](_0x3ae91e[_0x87ee('0x31')]['limit']);_0x8352b9[_0x87ee('0x1d')]=qs[_0x87ee('0x1d')](_0x3ae91e[_0x87ee('0x31')][_0x87ee('0x1d')]);}_0x8352b9['order']=qs[_0x87ee('0x38')](_0x3ae91e[_0x87ee('0x31')][_0x87ee('0x38')]);_0x8352b9[_0x87ee('0x39')]=qs[_0x87ee('0x33')](_[_0x87ee('0x3a')](_0x3ae91e[_0x87ee('0x31')],_0x541f87[_0x87ee('0x33')]),_0x25a56e);if(_0x3ae91e[_0x87ee('0x31')][_0x87ee('0x3b')]){_0x8352b9[_0x87ee('0x39')]=_[_0x87ee('0x3c')](_0x8352b9[_0x87ee('0x39')],{'$or':_['map'](_0x25a56e,function(_0x5c8cf1){if(_0x5c8cf1[_0x87ee('0x3d')]!==_0x87ee('0x3e')){var _0x195837={};_0x195837[_0x5c8cf1[_0x87ee('0x2a')]]={'$like':'%'+_0x3ae91e[_0x87ee('0x31')][_0x87ee('0x3b')]+'%'};return _0x195837;}})});}_0x8352b9=_['merge']({},_0x8352b9,_0x3ae91e['options']);var _0xba6bbd={'where':_0x8352b9[_0x87ee('0x39')]};return db[_0x87ee('0x2e')][_0x87ee('0x20')](_0xba6bbd)[_0x87ee('0x26')](function(_0x14a08c){_0x161e8f[_0x87ee('0x20')]=_0x14a08c;if(_0x3ae91e['query'][_0x87ee('0x3f')]){_0x8352b9[_0x87ee('0x40')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x87ee('0x41')](_0x8352b9);})[_0x87ee('0x26')](function(_0x48e048){_0x161e8f[_0x87ee('0x42')]=_0x48e048;return _0x161e8f;})[_0x87ee('0x26')](respondWithFilteredResult(_0x89a7da,_0x8352b9))[_0x87ee('0x43')](handleError(_0x89a7da,null));};exports[_0x87ee('0x44')]=function(_0x3cff3c,_0xc7e24f){var _0x2f52b7={'raw':![],'where':{'id':_0x3cff3c['params']['id']}},_0x4ce266={};_0x4ce266[_0x87ee('0x35')]=_[_0x87ee('0x32')](db['Dynamics365Configuration'][_0x87ee('0x2f')]);_0x4ce266[_0x87ee('0x31')]=_[_0x87ee('0x32')](_0x3cff3c[_0x87ee('0x31')]);_0x4ce266[_0x87ee('0x33')]=_[_0x87ee('0x34')](_0x4ce266[_0x87ee('0x35')],_0x4ce266[_0x87ee('0x31')]);_0x2f52b7[_0x87ee('0x37')]=_[_0x87ee('0x34')](_0x4ce266['model'],qs[_0x87ee('0x36')](_0x3cff3c[_0x87ee('0x31')]['fields']));_0x2f52b7[_0x87ee('0x37')]=_0x2f52b7['attributes']['length']?_0x2f52b7[_0x87ee('0x37')]:_0x4ce266['model'];if(_0x3cff3c['query']['includeAll']){_0x2f52b7[_0x87ee('0x40')]=[{'all':!![]}];}_0x2f52b7=_[_0x87ee('0x3c')]({},_0x2f52b7,_0x3cff3c['options']);return db[_0x87ee('0x2e')][_0x87ee('0x45')](_0x2f52b7)[_0x87ee('0x26')](handleEntityNotFound(_0xc7e24f,null))[_0x87ee('0x26')](respondWithResult(_0xc7e24f,null))['catch'](handleError(_0xc7e24f,null));};exports[_0x87ee('0x46')]=function(_0x230518,_0x41f7a6){return db[_0x87ee('0x2e')][_0x87ee('0x46')](_0x230518[_0x87ee('0x47')],{})[_0x87ee('0x26')](respondWithResult(_0x41f7a6,0xc9))['catch'](handleError(_0x41f7a6,null));};exports[_0x87ee('0x25')]=function(_0x402bca,_0x202460){if(_0x402bca['body']['id']){delete _0x402bca['body']['id'];}return db[_0x87ee('0x2e')][_0x87ee('0x45')]({'where':{'id':_0x402bca[_0x87ee('0x48')]['id']}})[_0x87ee('0x26')](handleEntityNotFound(_0x202460,null))[_0x87ee('0x26')](saveUpdates(_0x402bca[_0x87ee('0x47')],null))['then'](respondWithResult(_0x202460,null))[_0x87ee('0x43')](handleError(_0x202460,null));};exports[_0x87ee('0x27')]=function(_0x31d312,_0x520da1){return db['Dynamics365Configuration'][_0x87ee('0x45')]({'where':{'id':_0x31d312['params']['id']}})['then'](handleEntityNotFound(_0x520da1,null))['then'](removeEntity(_0x520da1,null))[_0x87ee('0x43')](handleError(_0x520da1,null));};exports['getFields']=function(_0x1fea3f,_0x3b802f,_0x1d3c05){var _0x1998b7={};var _0x32748e={};var _0x197134;var _0x253483;return db[_0x87ee('0x2e')][_0x87ee('0x49')]({'where':{'id':_0x1fea3f[_0x87ee('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b802f,null))['then'](function(_0x434749){if(_0x434749){_0x197134=_0x434749;_0x32748e[_0x87ee('0x35')]=_[_0x87ee('0x32')](db[_0x87ee('0x4a')][_0x87ee('0x2f')]);_0x32748e[_0x87ee('0x31')]=_[_0x87ee('0x32')](_0x1fea3f[_0x87ee('0x31')]);_0x32748e[_0x87ee('0x33')]=_['intersection'](_0x32748e[_0x87ee('0x35')],_0x32748e[_0x87ee('0x31')]);_0x1998b7[_0x87ee('0x37')]=_[_0x87ee('0x34')](_0x32748e[_0x87ee('0x35')],qs[_0x87ee('0x36')](_0x1fea3f[_0x87ee('0x31')]['fields']));_0x1998b7[_0x87ee('0x37')]=_0x1998b7['attributes'][_0x87ee('0x4b')]?_0x1998b7[_0x87ee('0x37')]:_0x32748e[_0x87ee('0x35')];_0x1998b7[_0x87ee('0x4c')]=qs[_0x87ee('0x38')](_0x1fea3f[_0x87ee('0x31')]['sort']);_0x1998b7[_0x87ee('0x39')]=qs[_0x87ee('0x33')](_[_0x87ee('0x3a')](_0x1fea3f['query'],_0x32748e[_0x87ee('0x33')]));if(_0x1fea3f[_0x87ee('0x31')]['filter']){_0x1998b7[_0x87ee('0x39')]=_[_0x87ee('0x3c')](_0x1998b7[_0x87ee('0x39')],{'$or':_[_0x87ee('0x2d')](_0x1998b7[_0x87ee('0x37')],function(_0x148249){var _0x3818d0={};_0x3818d0[_0x148249]={'$like':'%'+_0x1fea3f[_0x87ee('0x31')]['filter']+'%'};return _0x3818d0;})});}_0x1998b7=_['merge']({},_0x1998b7,_0x1fea3f['options']);return _0x197134[_0x87ee('0x4d')](_0x1998b7);}})[_0x87ee('0x26')](function(_0x12bbf2){if(_0x12bbf2){_0x253483=_0x12bbf2[_0x87ee('0x4b')];if(!_0x1fea3f[_0x87ee('0x31')][_0x87ee('0x4e')](_0x87ee('0x4f'))){_0x1998b7[_0x87ee('0x1f')]=qs[_0x87ee('0x1f')](_0x1fea3f[_0x87ee('0x31')][_0x87ee('0x1f')]);_0x1998b7[_0x87ee('0x1d')]=qs['offset'](_0x1fea3f[_0x87ee('0x31')][_0x87ee('0x1d')]);}return _0x197134[_0x87ee('0x4d')](_0x1998b7);}})[_0x87ee('0x26')](function(_0x43a864){if(_0x43a864){return _0x43a864?{'count':_0x253483,'rows':_0x43a864}:null;}})[_0x87ee('0x26')](respondWithResult(_0x3b802f,null))[_0x87ee('0x43')](handleError(_0x3b802f,null));};exports[_0x87ee('0x50')]=function(_0x445673,_0x25f432,_0x2ce27d){var _0x4bdfff={};var _0x547896={};var _0x5863a5;var _0x432fe7;return db[_0x87ee('0x2e')][_0x87ee('0x49')]({'where':{'id':_0x445673[_0x87ee('0x48')]['id']}})[_0x87ee('0x26')](handleEntityNotFound(_0x25f432,null))[_0x87ee('0x26')](function(_0x3fadd6){if(_0x3fadd6){_0x5863a5=_0x3fadd6;_0x547896['model']=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x547896[_0x87ee('0x31')]=_['keys'](_0x445673[_0x87ee('0x31')]);_0x547896['filters']=_['intersection'](_0x547896[_0x87ee('0x35')],_0x547896[_0x87ee('0x31')]);_0x4bdfff['attributes']=_[_0x87ee('0x34')](_0x547896[_0x87ee('0x35')],qs[_0x87ee('0x36')](_0x445673[_0x87ee('0x31')][_0x87ee('0x36')]));_0x4bdfff[_0x87ee('0x37')]=_0x4bdfff[_0x87ee('0x37')][_0x87ee('0x4b')]?_0x4bdfff[_0x87ee('0x37')]:_0x547896[_0x87ee('0x35')];_0x4bdfff[_0x87ee('0x4c')]=qs['sort'](_0x445673[_0x87ee('0x31')]['sort']);_0x4bdfff['where']=qs[_0x87ee('0x33')](_[_0x87ee('0x3a')](_0x445673['query'],_0x547896[_0x87ee('0x33')]));if(_0x445673[_0x87ee('0x31')][_0x87ee('0x3b')]){_0x4bdfff[_0x87ee('0x39')]=_[_0x87ee('0x3c')](_0x4bdfff[_0x87ee('0x39')],{'$or':_[_0x87ee('0x2d')](_0x4bdfff[_0x87ee('0x37')],function(_0x5b3fd1){var _0x11377a={};_0x11377a[_0x5b3fd1]={'$like':'%'+_0x445673[_0x87ee('0x31')][_0x87ee('0x3b')]+'%'};return _0x11377a;})});}_0x4bdfff=_[_0x87ee('0x3c')]({},_0x4bdfff,_0x445673[_0x87ee('0x51')]);return _0x5863a5['getSubjects'](_0x4bdfff);}})[_0x87ee('0x26')](function(_0xde2bac){if(_0xde2bac){_0x432fe7=_0xde2bac[_0x87ee('0x4b')];if(!_0x445673['query']['hasOwnProperty'](_0x87ee('0x4f'))){_0x4bdfff[_0x87ee('0x1f')]=qs[_0x87ee('0x1f')](_0x445673['query'][_0x87ee('0x1f')]);_0x4bdfff[_0x87ee('0x1d')]=qs['offset'](_0x445673[_0x87ee('0x31')][_0x87ee('0x1d')]);}return _0x5863a5['getSubjects'](_0x4bdfff);}})[_0x87ee('0x26')](function(_0x482b03){if(_0x482b03){return _0x482b03?{'count':_0x432fe7,'rows':_0x482b03}:null;}})[_0x87ee('0x26')](respondWithResult(_0x25f432,null))[_0x87ee('0x43')](handleError(_0x25f432,null));};exports[_0x87ee('0x52')]=function(_0xd727a1,_0x11588e,_0x4676ce){var _0x30fce9={};var _0x75b4e4={};var _0x410839;var _0x7ea902;return db[_0x87ee('0x2e')][_0x87ee('0x49')]({'where':{'id':_0xd727a1['params']['id']}})[_0x87ee('0x26')](handleEntityNotFound(_0x11588e,null))[_0x87ee('0x26')](function(_0x2edc2e){if(_0x2edc2e){_0x410839=_0x2edc2e;_0x75b4e4[_0x87ee('0x35')]=_['keys'](db[_0x87ee('0x4a')][_0x87ee('0x2f')]);_0x75b4e4[_0x87ee('0x31')]=_['keys'](_0xd727a1['query']);_0x75b4e4['filters']=_[_0x87ee('0x34')](_0x75b4e4[_0x87ee('0x35')],_0x75b4e4['query']);_0x30fce9[_0x87ee('0x37')]=_[_0x87ee('0x34')](_0x75b4e4[_0x87ee('0x35')],qs['fields'](_0xd727a1['query'][_0x87ee('0x36')]));_0x30fce9['attributes']=_0x30fce9[_0x87ee('0x37')][_0x87ee('0x4b')]?_0x30fce9[_0x87ee('0x37')]:_0x75b4e4['model'];_0x30fce9['order']=qs[_0x87ee('0x38')](_0xd727a1[_0x87ee('0x31')][_0x87ee('0x38')]);_0x30fce9['where']=qs[_0x87ee('0x33')](_[_0x87ee('0x3a')](_0xd727a1[_0x87ee('0x31')],_0x75b4e4[_0x87ee('0x33')]));if(_0xd727a1[_0x87ee('0x31')]['filter']){_0x30fce9[_0x87ee('0x39')]=_['merge'](_0x30fce9[_0x87ee('0x39')],{'$or':_[_0x87ee('0x2d')](_0x30fce9['attributes'],function(_0x3874a0){var _0x4497da={};_0x4497da[_0x3874a0]={'$like':'%'+_0xd727a1[_0x87ee('0x31')][_0x87ee('0x3b')]+'%'};return _0x4497da;})});}_0x30fce9=_[_0x87ee('0x3c')]({},_0x30fce9,_0xd727a1[_0x87ee('0x51')]);return _0x410839[_0x87ee('0x52')](_0x30fce9);}})[_0x87ee('0x26')](function(_0x13b119){if(_0x13b119){_0x7ea902=_0x13b119[_0x87ee('0x4b')];if(!_0xd727a1['query'][_0x87ee('0x4e')](_0x87ee('0x4f'))){_0x30fce9[_0x87ee('0x1f')]=qs['limit'](_0xd727a1[_0x87ee('0x31')][_0x87ee('0x1f')]);_0x30fce9[_0x87ee('0x1d')]=qs[_0x87ee('0x1d')](_0xd727a1['query'][_0x87ee('0x1d')]);}return _0x410839[_0x87ee('0x52')](_0x30fce9);}})[_0x87ee('0x26')](function(_0x2958c9){if(_0x2958c9){return _0x2958c9?{'count':_0x7ea902,'rows':_0x2958c9}:null;}})[_0x87ee('0x26')](respondWithResult(_0x11588e,null))[_0x87ee('0x43')](handleError(_0x11588e,null));}; \ No newline at end of file +var _0xe11d=['fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','filter','where','merge','type','options','include','findAll','rows','catch','show','params','keys','length','includeAll','create','body','find','findOne','Dynamics365Field','getFields','nolimit','getSubjects','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','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','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','name','send','index','map','Dynamics365Configuration','rawAttributes'];(function(_0x84912b,_0x3e8d87){var _0x5370c9=function(_0x1771b2){while(--_0x1771b2){_0x84912b['push'](_0x84912b['shift']());}};_0x5370c9(++_0x3e8d87);}(_0xe11d,0xc3));var _0xde11=function(_0xc0a416,_0x28047c){_0xc0a416=_0xc0a416-0x0;var _0x2e6855=_0xe11d[_0xc0a416];return _0x2e6855;};'use strict';var emlformat=require(_0xde11('0x0'));var rimraf=require(_0xde11('0x1'));var zipdir=require(_0xde11('0x2'));var jsonpatch=require(_0xde11('0x3'));var rp=require(_0xde11('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xde11('0x5'));var util=require(_0xde11('0x6'));var path=require(_0xde11('0x7'));var sox=require('sox');var csv=require(_0xde11('0x8'));var ejs=require(_0xde11('0x9'));var fs=require('fs');var fs_extra=require(_0xde11('0xa'));var _=require('lodash');var squel=require(_0xde11('0xb'));var crypto=require(_0xde11('0xc'));var jsforce=require(_0xde11('0xd'));var deskjs=require(_0xde11('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xde11('0xf'));var Redis=require(_0xde11('0x10'));var authService=require(_0xde11('0x11'));var qs=require(_0xde11('0x12'));var as=require(_0xde11('0x13'));var hardwareService=require(_0xde11('0x14'));var logger=require(_0xde11('0x15'))('api');var utils=require(_0xde11('0x16'));var config=require(_0xde11('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xde11('0x18'))['db'];function respondWithStatusCode(_0x5b57cc,_0x307a0b){_0x307a0b=_0x307a0b||0xcc;return function(_0x372731){if(_0x372731){return _0x5b57cc[_0xde11('0x19')](_0x307a0b);}return _0x5b57cc[_0xde11('0x1a')](_0x307a0b)[_0xde11('0x1b')]();};}function respondWithResult(_0x14e23e,_0xf449e1){_0xf449e1=_0xf449e1||0xc8;return function(_0x5d3b9d){if(_0x5d3b9d){return _0x14e23e[_0xde11('0x1a')](_0xf449e1)[_0xde11('0x1c')](_0x5d3b9d);}};}function respondWithFilteredResult(_0x524282,_0x81fd5f){return function(_0xf0d0ea){if(_0xf0d0ea){var _0x401fce=typeof _0x81fd5f[_0xde11('0x1d')]===_0xde11('0x1e')&&typeof _0x81fd5f[_0xde11('0x1f')]==='undefined';var _0x499ec1=_0xf0d0ea[_0xde11('0x20')];var _0x132572=_0x401fce?0x0:_0x81fd5f[_0xde11('0x1d')];var _0x4677db=_0x401fce?_0xf0d0ea[_0xde11('0x20')]:_0x81fd5f[_0xde11('0x1d')]+_0x81fd5f[_0xde11('0x1f')];var _0x13a37b;if(_0x4677db>=_0x499ec1){_0x4677db=_0x499ec1;_0x13a37b=0xc8;}else{_0x13a37b=0xce;}_0x524282[_0xde11('0x1a')](_0x13a37b);return _0x524282[_0xde11('0x21')]('Content-Range',_0x132572+'-'+_0x4677db+'/'+_0x499ec1)[_0xde11('0x1c')](_0xf0d0ea);}return null;};}function patchUpdates(_0x5eb2c2){return function(_0x144692){try{jsonpatch[_0xde11('0x22')](_0x144692,_0x5eb2c2,!![]);}catch(_0x4acf95){return BPromise['reject'](_0x4acf95);}return _0x144692[_0xde11('0x23')]();};}function saveUpdates(_0x3361c3,_0x3c7acf){return function(_0x33bc66){if(_0x33bc66){return _0x33bc66['update'](_0x3361c3)[_0xde11('0x24')](function(_0x30eafd){return _0x30eafd;});}return null;};}function removeEntity(_0xdaa8bc,_0x4d37f8){return function(_0x388498){if(_0x388498){return _0x388498[_0xde11('0x25')]()[_0xde11('0x24')](function(){_0xdaa8bc[_0xde11('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b5d69,_0x15a8ea){return function(_0x408631){if(!_0x408631){_0x1b5d69['sendStatus'](0x194);}return _0x408631;};}function handleError(_0x6e7c4e,_0x54ddc2){_0x54ddc2=_0x54ddc2||0x1f4;return function(_0x3eac46){logger[_0xde11('0x26')](_0x3eac46['stack']);if(_0x3eac46[_0xde11('0x27')]){delete _0x3eac46[_0xde11('0x27')];}_0x6e7c4e['status'](_0x54ddc2)[_0xde11('0x28')](_0x3eac46);};}exports[_0xde11('0x29')]=function(_0x2879bb,_0x37568c){var _0x406480={},_0x242722={},_0x48665d={'count':0x0,'rows':[]};var _0x4726e6=_[_0xde11('0x2a')](db[_0xde11('0x2b')][_0xde11('0x2c')],function(_0x442273){return{'name':_0x442273[_0xde11('0x2d')],'type':_0x442273['type'][_0xde11('0x2e')]};});_0x242722[_0xde11('0x2f')]=_['map'](_0x4726e6,'name');_0x242722[_0xde11('0x30')]=_['keys'](_0x2879bb[_0xde11('0x30')]);_0x242722[_0xde11('0x31')]=_['intersection'](_0x242722[_0xde11('0x2f')],_0x242722['query']);_0x406480[_0xde11('0x32')]=_[_0xde11('0x33')](_0x242722['model'],qs[_0xde11('0x34')](_0x2879bb[_0xde11('0x30')][_0xde11('0x34')]));_0x406480[_0xde11('0x32')]=_0x406480[_0xde11('0x32')]['length']?_0x406480['attributes']:_0x242722[_0xde11('0x2f')];if(!_0x2879bb[_0xde11('0x30')][_0xde11('0x35')]('nolimit')){_0x406480[_0xde11('0x1f')]=qs[_0xde11('0x1f')](_0x2879bb[_0xde11('0x30')]['limit']);_0x406480[_0xde11('0x1d')]=qs[_0xde11('0x1d')](_0x2879bb['query'][_0xde11('0x1d')]);}_0x406480['order']=qs[_0xde11('0x36')](_0x2879bb[_0xde11('0x30')][_0xde11('0x36')]);_0x406480['where']=qs[_0xde11('0x31')](_[_0xde11('0x37')](_0x2879bb[_0xde11('0x30')],_0x242722['filters']),_0x4726e6);if(_0x2879bb[_0xde11('0x30')][_0xde11('0x38')]){_0x406480[_0xde11('0x39')]=_[_0xde11('0x3a')](_0x406480[_0xde11('0x39')],{'$or':_[_0xde11('0x2a')](_0x4726e6,function(_0x560a5d){if(_0x560a5d[_0xde11('0x3b')]!=='VIRTUAL'){var _0x18e097={};_0x18e097[_0x560a5d[_0xde11('0x27')]]={'$like':'%'+_0x2879bb[_0xde11('0x30')][_0xde11('0x38')]+'%'};return _0x18e097;}})});}_0x406480=_[_0xde11('0x3a')]({},_0x406480,_0x2879bb[_0xde11('0x3c')]);var _0x30d589={'where':_0x406480[_0xde11('0x39')]};return db[_0xde11('0x2b')][_0xde11('0x20')](_0x30d589)[_0xde11('0x24')](function(_0x27cee6){_0x48665d[_0xde11('0x20')]=_0x27cee6;if(_0x2879bb[_0xde11('0x30')]['includeAll']){_0x406480[_0xde11('0x3d')]=[{'all':!![]}];}return db[_0xde11('0x2b')][_0xde11('0x3e')](_0x406480);})['then'](function(_0x3efd13){_0x48665d[_0xde11('0x3f')]=_0x3efd13;return _0x48665d;})['then'](respondWithFilteredResult(_0x37568c,_0x406480))[_0xde11('0x40')](handleError(_0x37568c,null));};exports[_0xde11('0x41')]=function(_0x3800b8,_0x263d53){var _0x49886d={'raw':![],'where':{'id':_0x3800b8[_0xde11('0x42')]['id']}},_0x53644e={};_0x53644e[_0xde11('0x2f')]=_[_0xde11('0x43')](db[_0xde11('0x2b')]['rawAttributes']);_0x53644e['query']=_[_0xde11('0x43')](_0x3800b8[_0xde11('0x30')]);_0x53644e['filters']=_[_0xde11('0x33')](_0x53644e[_0xde11('0x2f')],_0x53644e['query']);_0x49886d[_0xde11('0x32')]=_[_0xde11('0x33')](_0x53644e[_0xde11('0x2f')],qs[_0xde11('0x34')](_0x3800b8[_0xde11('0x30')][_0xde11('0x34')]));_0x49886d['attributes']=_0x49886d[_0xde11('0x32')][_0xde11('0x44')]?_0x49886d[_0xde11('0x32')]:_0x53644e[_0xde11('0x2f')];if(_0x3800b8[_0xde11('0x30')][_0xde11('0x45')]){_0x49886d[_0xde11('0x3d')]=[{'all':!![]}];}_0x49886d=_[_0xde11('0x3a')]({},_0x49886d,_0x3800b8[_0xde11('0x3c')]);return db['Dynamics365Configuration']['find'](_0x49886d)[_0xde11('0x24')](handleEntityNotFound(_0x263d53,null))[_0xde11('0x24')](respondWithResult(_0x263d53,null))[_0xde11('0x40')](handleError(_0x263d53,null));};exports[_0xde11('0x46')]=function(_0xe78c1c,_0x51352c){return db['Dynamics365Configuration'][_0xde11('0x46')](_0xe78c1c[_0xde11('0x47')],{})[_0xde11('0x24')](respondWithResult(_0x51352c,0xc9))[_0xde11('0x40')](handleError(_0x51352c,null));};exports['update']=function(_0x2cfbc2,_0x28d4f0){if(_0x2cfbc2[_0xde11('0x47')]['id']){delete _0x2cfbc2['body']['id'];}return db[_0xde11('0x2b')]['find']({'where':{'id':_0x2cfbc2[_0xde11('0x42')]['id']}})['then'](handleEntityNotFound(_0x28d4f0,null))[_0xde11('0x24')](saveUpdates(_0x2cfbc2[_0xde11('0x47')],null))['then'](respondWithResult(_0x28d4f0,null))[_0xde11('0x40')](handleError(_0x28d4f0,null));};exports['destroy']=function(_0x5568d0,_0x4cfa5f){return db['Dynamics365Configuration'][_0xde11('0x48')]({'where':{'id':_0x5568d0['params']['id']}})['then'](handleEntityNotFound(_0x4cfa5f,null))[_0xde11('0x24')](removeEntity(_0x4cfa5f,null))[_0xde11('0x40')](handleError(_0x4cfa5f,null));};exports['getFields']=function(_0x1e6f23,_0x63fe2,_0x4bd313){var _0x50e900={};var _0x4a50bf={};var _0xf98ce1;var _0x1638a1;return db['Dynamics365Configuration'][_0xde11('0x49')]({'where':{'id':_0x1e6f23[_0xde11('0x42')]['id']}})[_0xde11('0x24')](handleEntityNotFound(_0x63fe2,null))[_0xde11('0x24')](function(_0x251a41){if(_0x251a41){_0xf98ce1=_0x251a41;_0x4a50bf[_0xde11('0x2f')]=_[_0xde11('0x43')](db[_0xde11('0x4a')][_0xde11('0x2c')]);_0x4a50bf[_0xde11('0x30')]=_[_0xde11('0x43')](_0x1e6f23['query']);_0x4a50bf['filters']=_['intersection'](_0x4a50bf[_0xde11('0x2f')],_0x4a50bf['query']);_0x50e900[_0xde11('0x32')]=_[_0xde11('0x33')](_0x4a50bf[_0xde11('0x2f')],qs[_0xde11('0x34')](_0x1e6f23[_0xde11('0x30')][_0xde11('0x34')]));_0x50e900[_0xde11('0x32')]=_0x50e900['attributes'][_0xde11('0x44')]?_0x50e900['attributes']:_0x4a50bf[_0xde11('0x2f')];_0x50e900['order']=qs[_0xde11('0x36')](_0x1e6f23[_0xde11('0x30')][_0xde11('0x36')]);_0x50e900[_0xde11('0x39')]=qs[_0xde11('0x31')](_[_0xde11('0x37')](_0x1e6f23['query'],_0x4a50bf['filters']));if(_0x1e6f23[_0xde11('0x30')]['filter']){_0x50e900[_0xde11('0x39')]=_[_0xde11('0x3a')](_0x50e900[_0xde11('0x39')],{'$or':_['map'](_0x50e900['attributes'],function(_0x505a06){var _0x1ce547={};_0x1ce547[_0x505a06]={'$like':'%'+_0x1e6f23[_0xde11('0x30')][_0xde11('0x38')]+'%'};return _0x1ce547;})});}_0x50e900=_['merge']({},_0x50e900,_0x1e6f23[_0xde11('0x3c')]);return _0xf98ce1[_0xde11('0x4b')](_0x50e900);}})[_0xde11('0x24')](function(_0x1baeba){if(_0x1baeba){_0x1638a1=_0x1baeba['length'];if(!_0x1e6f23['query'][_0xde11('0x35')](_0xde11('0x4c'))){_0x50e900[_0xde11('0x1f')]=qs['limit'](_0x1e6f23[_0xde11('0x30')][_0xde11('0x1f')]);_0x50e900[_0xde11('0x1d')]=qs[_0xde11('0x1d')](_0x1e6f23[_0xde11('0x30')][_0xde11('0x1d')]);}return _0xf98ce1['getFields'](_0x50e900);}})[_0xde11('0x24')](function(_0x5823c1){if(_0x5823c1){return _0x5823c1?{'count':_0x1638a1,'rows':_0x5823c1}:null;}})['then'](respondWithResult(_0x63fe2,null))[_0xde11('0x40')](handleError(_0x63fe2,null));};exports[_0xde11('0x4d')]=function(_0x37c9e5,_0x1e0444,_0x11d5b8){var _0x2e1ef6={};var _0x2a45af={};var _0x52d8af;var _0x14cdd0;return db[_0xde11('0x2b')][_0xde11('0x49')]({'where':{'id':_0x37c9e5[_0xde11('0x42')]['id']}})[_0xde11('0x24')](handleEntityNotFound(_0x1e0444,null))['then'](function(_0x1bd81c){if(_0x1bd81c){_0x52d8af=_0x1bd81c;_0x2a45af[_0xde11('0x2f')]=_[_0xde11('0x43')](db[_0xde11('0x4a')][_0xde11('0x2c')]);_0x2a45af[_0xde11('0x30')]=_[_0xde11('0x43')](_0x37c9e5['query']);_0x2a45af[_0xde11('0x31')]=_['intersection'](_0x2a45af['model'],_0x2a45af['query']);_0x2e1ef6['attributes']=_[_0xde11('0x33')](_0x2a45af[_0xde11('0x2f')],qs['fields'](_0x37c9e5[_0xde11('0x30')][_0xde11('0x34')]));_0x2e1ef6[_0xde11('0x32')]=_0x2e1ef6[_0xde11('0x32')]['length']?_0x2e1ef6['attributes']:_0x2a45af[_0xde11('0x2f')];_0x2e1ef6[_0xde11('0x4e')]=qs[_0xde11('0x36')](_0x37c9e5['query']['sort']);_0x2e1ef6[_0xde11('0x39')]=qs[_0xde11('0x31')](_['pick'](_0x37c9e5[_0xde11('0x30')],_0x2a45af[_0xde11('0x31')]));if(_0x37c9e5[_0xde11('0x30')][_0xde11('0x38')]){_0x2e1ef6[_0xde11('0x39')]=_[_0xde11('0x3a')](_0x2e1ef6[_0xde11('0x39')],{'$or':_['map'](_0x2e1ef6[_0xde11('0x32')],function(_0x2b9852){var _0x2e2bfa={};_0x2e2bfa[_0x2b9852]={'$like':'%'+_0x37c9e5[_0xde11('0x30')][_0xde11('0x38')]+'%'};return _0x2e2bfa;})});}_0x2e1ef6=_[_0xde11('0x3a')]({},_0x2e1ef6,_0x37c9e5[_0xde11('0x3c')]);return _0x52d8af[_0xde11('0x4d')](_0x2e1ef6);}})[_0xde11('0x24')](function(_0x2b1730){if(_0x2b1730){_0x14cdd0=_0x2b1730[_0xde11('0x44')];if(!_0x37c9e5[_0xde11('0x30')][_0xde11('0x35')]('nolimit')){_0x2e1ef6[_0xde11('0x1f')]=qs[_0xde11('0x1f')](_0x37c9e5[_0xde11('0x30')][_0xde11('0x1f')]);_0x2e1ef6[_0xde11('0x1d')]=qs[_0xde11('0x1d')](_0x37c9e5[_0xde11('0x30')][_0xde11('0x1d')]);}return _0x52d8af[_0xde11('0x4d')](_0x2e1ef6);}})[_0xde11('0x24')](function(_0x5e3f3b){if(_0x5e3f3b){return _0x5e3f3b?{'count':_0x14cdd0,'rows':_0x5e3f3b}:null;}})[_0xde11('0x24')](respondWithResult(_0x1e0444,null))[_0xde11('0x40')](handleError(_0x1e0444,null));};exports['getDescriptions']=function(_0x37e984,_0x5a04f4,_0x39122f){var _0x18fd67={};var _0x478c7b={};var _0x222754;var _0x2a897c;return db[_0xde11('0x2b')][_0xde11('0x49')]({'where':{'id':_0x37e984[_0xde11('0x42')]['id']}})[_0xde11('0x24')](handleEntityNotFound(_0x5a04f4,null))[_0xde11('0x24')](function(_0x175687){if(_0x175687){_0x222754=_0x175687;_0x478c7b[_0xde11('0x2f')]=_[_0xde11('0x43')](db['Dynamics365Field']['rawAttributes']);_0x478c7b[_0xde11('0x30')]=_[_0xde11('0x43')](_0x37e984[_0xde11('0x30')]);_0x478c7b[_0xde11('0x31')]=_[_0xde11('0x33')](_0x478c7b['model'],_0x478c7b['query']);_0x18fd67['attributes']=_['intersection'](_0x478c7b[_0xde11('0x2f')],qs[_0xde11('0x34')](_0x37e984['query'][_0xde11('0x34')]));_0x18fd67['attributes']=_0x18fd67[_0xde11('0x32')]['length']?_0x18fd67[_0xde11('0x32')]:_0x478c7b[_0xde11('0x2f')];_0x18fd67[_0xde11('0x4e')]=qs[_0xde11('0x36')](_0x37e984[_0xde11('0x30')][_0xde11('0x36')]);_0x18fd67['where']=qs[_0xde11('0x31')](_[_0xde11('0x37')](_0x37e984[_0xde11('0x30')],_0x478c7b['filters']));if(_0x37e984[_0xde11('0x30')]['filter']){_0x18fd67[_0xde11('0x39')]=_[_0xde11('0x3a')](_0x18fd67[_0xde11('0x39')],{'$or':_['map'](_0x18fd67[_0xde11('0x32')],function(_0x1de823){var _0x1b34cb={};_0x1b34cb[_0x1de823]={'$like':'%'+_0x37e984[_0xde11('0x30')][_0xde11('0x38')]+'%'};return _0x1b34cb;})});}_0x18fd67=_[_0xde11('0x3a')]({},_0x18fd67,_0x37e984[_0xde11('0x3c')]);return _0x222754[_0xde11('0x4f')](_0x18fd67);}})['then'](function(_0x4ab64e){if(_0x4ab64e){_0x2a897c=_0x4ab64e[_0xde11('0x44')];if(!_0x37e984['query'][_0xde11('0x35')](_0xde11('0x4c'))){_0x18fd67[_0xde11('0x1f')]=qs[_0xde11('0x1f')](_0x37e984['query']['limit']);_0x18fd67['offset']=qs[_0xde11('0x1d')](_0x37e984['query'][_0xde11('0x1d')]);}return _0x222754['getDescriptions'](_0x18fd67);}})[_0xde11('0x24')](function(_0x5a4d10){if(_0x5a4d10){return _0x5a4d10?{'count':_0x2a897c,'rows':_0x5a4d10}:null;}})['then'](respondWithResult(_0x5a04f4,null))[_0xde11('0x40')](handleError(_0x5a04f4,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 75f9e97..f66f271 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 _0xbec5=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird'];(function(_0x273eaf,_0x5e27c0){var _0x3ad5e8=function(_0x453d47){while(--_0x453d47){_0x273eaf['push'](_0x273eaf['shift']());}};_0x3ad5e8(++_0x5e27c0);}(_0xbec5,0xe5));var _0x5bec=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xbec5[_0x249e96];return _0x17444c;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf109=['Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x59f3b0,_0x182830){var _0x4f5d1c=function(_0x2b4d73){while(--_0x2b4d73){_0x59f3b0['push'](_0x59f3b0['shift']());}};_0x4f5d1c(++_0x182830);}(_0xf109,0xce));var _0x9f10=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xf109[_0x1a72f3];return _0x57ef47;};'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/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 7738775..a52c3f1 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 _0x83ba=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x83ba,0x147));var _0xa83b=function(_0x450b2c,_0x86c610){_0x450b2c=_0x450b2c-0x0;var _0xd82ad2=_0x83ba[_0x450b2c];return _0xd82ad2;};'use strict';var _=require(_0xa83b('0x0'));var util=require(_0xa83b('0x1'));var moment=require(_0xa83b('0x2'));var BPromise=require('bluebird');var rs=require(_0xa83b('0x3'));var fs=require('fs');var Redis=require(_0xa83b('0x4'));var db=require(_0xa83b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa83b('0x6'))(_0xa83b('0x7'));var config=require(_0xa83b('0x8'));var jayson=require(_0xa83b('0x9'));var client=jayson[_0xa83b('0xa')][_0xa83b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1519dc,_0x18b7d4,_0x4ad155){return new BPromise(function(_0x5ac676,_0x9c5772){return client['request'](_0x1519dc,_0x4ad155)[_0xa83b('0xc')](function(_0x56fa55){logger[_0xa83b('0xd')](_0xa83b('0xe'),_0x18b7d4,'request\x20sent');logger[_0xa83b('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x18b7d4,_0xa83b('0x10'),JSON[_0xa83b('0x11')](_0x56fa55));if(_0x56fa55[_0xa83b('0x12')]){if(_0x56fa55[_0xa83b('0x12')]['code']===0x1f4){logger[_0xa83b('0x12')](_0xa83b('0xe'),_0x18b7d4,_0x56fa55['error'][_0xa83b('0x13')]);return _0x9c5772(_0x56fa55[_0xa83b('0x12')]['message']);}logger[_0xa83b('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x18b7d4,_0x56fa55['error'][_0xa83b('0x13')]);return _0x5ac676(_0x56fa55[_0xa83b('0x12')][_0xa83b('0x13')]);}else{logger['info'](_0xa83b('0xe'),_0x18b7d4,_0xa83b('0x10'));_0x5ac676(_0x56fa55[_0xa83b('0x14')][_0xa83b('0x13')]);}})[_0xa83b('0x15')](function(_0x219305){logger[_0xa83b('0x12')](_0xa83b('0xe'),_0x18b7d4,_0x219305);_0x9c5772(_0x219305);});});} \ No newline at end of file +var _0xfed5=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug'];(function(_0x431099,_0x3a265c){var _0x43b254=function(_0x2cf6ff){while(--_0x2cf6ff){_0x431099['push'](_0x431099['shift']());}};_0x43b254(++_0x3a265c);}(_0xfed5,0x149));var _0x5fed=function(_0x1cc206,_0x297eec){_0x1cc206=_0x1cc206-0x0;var _0x333819=_0xfed5[_0x1cc206];return _0x333819;};'use strict';var _=require(_0x5fed('0x0'));var util=require(_0x5fed('0x1'));var moment=require('moment');var BPromise=require(_0x5fed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fed('0x3'));var db=require(_0x5fed('0x4'))['db'];var utils=require(_0x5fed('0x5'));var logger=require(_0x5fed('0x6'))(_0x5fed('0x7'));var config=require(_0x5fed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5fed('0x9')][_0x5fed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dd7c7,_0x1743e6,_0x4a7917){return new BPromise(function(_0x29148f,_0x5cb20a){return client[_0x5fed('0xb')](_0x4dd7c7,_0x4a7917)[_0x5fed('0xc')](function(_0x29caba){logger[_0x5fed('0xd')](_0x5fed('0xe'),_0x1743e6,'request\x20sent');logger[_0x5fed('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x1743e6,_0x5fed('0x10'),JSON[_0x5fed('0x11')](_0x29caba));if(_0x29caba[_0x5fed('0x12')]){if(_0x29caba[_0x5fed('0x12')][_0x5fed('0x13')]===0x1f4){logger[_0x5fed('0x12')](_0x5fed('0xe'),_0x1743e6,_0x29caba['error'][_0x5fed('0x14')]);return _0x5cb20a(_0x29caba['error'][_0x5fed('0x14')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x1743e6,_0x29caba[_0x5fed('0x12')][_0x5fed('0x14')]);return _0x29148f(_0x29caba['error']['message']);}else{logger[_0x5fed('0xd')](_0x5fed('0xe'),_0x1743e6,'request\x20sent');_0x29148f(_0x29caba[_0x5fed('0x15')][_0x5fed('0x14')]);}})[_0x5fed('0x16')](function(_0x5a0722){logger['error'](_0x5fed('0xe'),_0x1743e6,_0x5a0722);_0x5cb20a(_0x5a0722);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 5cf4166..ef2f09b 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 _0xd38a=['/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x5ca52d,_0x3a4a22){var _0x89e54e=function(_0x54bdf4){while(--_0x54bdf4){_0x5ca52d['push'](_0x5ca52d['shift']());}};_0x89e54e(++_0x3a4a22);}(_0xd38a,0x182));var _0xad38=function(_0x211642,_0x4171a8){_0x211642=_0x211642-0x0;var _0xd6a1a8=_0xd38a[_0x211642];return _0xd6a1a8;};'use strict';var multer=require(_0xad38('0x0'));var util=require(_0xad38('0x1'));var path=require(_0xad38('0x2'));var timeout=require('connect-timeout');var express=require(_0xad38('0x3'));var router=express[_0xad38('0x4')]();var fs_extra=require(_0xad38('0x5'));var auth=require(_0xad38('0x6'));var interaction=require(_0xad38('0x7'));var config=require(_0xad38('0x8'));var controller=require('./intDynamics365Field.controller');router[_0xad38('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xad38('0x9')](_0xad38('0xa'),auth[_0xad38('0xb')](),controller[_0xad38('0xc')]);router[_0xad38('0xd')]('/',auth[_0xad38('0xb')](),controller['create']);router[_0xad38('0xe')]('/:id',auth[_0xad38('0xb')](),controller[_0xad38('0xf')]);router['delete']('/:id',auth[_0xad38('0xb')](),controller[_0xad38('0x10')]);module[_0xad38('0x11')]=router; \ No newline at end of file +var _0x3c55=['update','delete','destroy','multer','connect-timeout','Router','fs-extra','./intDynamics365Field.controller','isAuthenticated','get','/:id','show','post','create','put'];(function(_0x5c9fd1,_0x5edad5){var _0xaaef77=function(_0x5d5c5d){while(--_0x5d5c5d){_0x5c9fd1['push'](_0x5c9fd1['shift']());}};_0xaaef77(++_0x5edad5);}(_0x3c55,0x1b6));var _0x53c5=function(_0x1b87f9,_0x3d7156){_0x1b87f9=_0x1b87f9-0x0;var _0x4ffa3d=_0x3c55[_0x1b87f9];return _0x4ffa3d;};'use strict';var multer=require(_0x53c5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x53c5('0x1'));var express=require('express');var router=express[_0x53c5('0x2')]();var fs_extra=require(_0x53c5('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x53c5('0x4'));router['get']('/',auth[_0x53c5('0x5')](),controller['index']);router[_0x53c5('0x6')](_0x53c5('0x7'),auth[_0x53c5('0x5')](),controller[_0x53c5('0x8')]);router[_0x53c5('0x9')]('/',auth[_0x53c5('0x5')](),controller[_0x53c5('0xa')]);router[_0x53c5('0xb')](_0x53c5('0x7'),auth[_0x53c5('0x5')](),controller[_0x53c5('0xc')]);router[_0x53c5('0xd')](_0x53c5('0x7'),auth['isAuthenticated'](),controller[_0x53c5('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index d965b10..bf00501 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 _0x682a=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x686086,_0x2f84d0){var _0x2ce9b8=function(_0x2ba7d6){while(--_0x2ba7d6){_0x686086['push'](_0x686086['shift']());}};_0x2ce9b8(++_0x2f84d0);}(_0x682a,0x1a9));var _0xa682=function(_0x58d953,_0x5d9393){_0x58d953=_0x58d953-0x0;var _0xf76bb4=_0x682a[_0x58d953];return _0xf76bb4;};'use strict';var Sequelize=require(_0xa682('0x0'));module[_0xa682('0x1')]={'type':{'type':Sequelize[_0xa682('0x2')]('string',_0xa682('0x3'),_0xa682('0x4'),_0xa682('0x5'),_0xa682('0x6')),'defaultValue':_0xa682('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa682('0x2')](_0xa682('0x7'),_0xa682('0x3'),_0xa682('0x4'))},'keyContent':{'type':Sequelize[_0xa682('0x8')]},'idField':{'type':Sequelize[_0xa682('0x8')]},'nameField':{'type':Sequelize[_0xa682('0x8')]},'customField':{'type':Sequelize[_0xa682('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa682('0x8')]}}; \ No newline at end of file +var _0x65e5=['exports','ENUM','string','customVariable','keyValue','STRING','variable','sequelize'];(function(_0x345a43,_0x143677){var _0x5bddf7=function(_0x387588){while(--_0x387588){_0x345a43['push'](_0x345a43['shift']());}};_0x5bddf7(++_0x143677);}(_0x65e5,0x11f));var _0x565e=function(_0x5b0483,_0x1d96a1){_0x5b0483=_0x5b0483-0x0;var _0x29c97d=_0x65e5[_0x5b0483];return _0x29c97d;};'use strict';var Sequelize=require(_0x565e('0x0'));module[_0x565e('0x1')]={'type':{'type':Sequelize[_0x565e('0x2')](_0x565e('0x3'),'variable',_0x565e('0x4'),_0x565e('0x5'),'picklist'),'defaultValue':_0x565e('0x3')},'content':{'type':Sequelize[_0x565e('0x6')]},'key':{'type':Sequelize[_0x565e('0x6')]},'keyType':{'type':Sequelize[_0x565e('0x2')](_0x565e('0x3'),_0x565e('0x7'),_0x565e('0x4'))},'keyContent':{'type':Sequelize[_0x565e('0x6')]},'idField':{'type':Sequelize[_0x565e('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x565e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 0af2fa0..2e4c0a4 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 _0x4c48=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','Dynamics365Field','fieldName'];(function(_0x1f4ef0,_0x599465){var _0x127ebd=function(_0xcab351){while(--_0xcab351){_0x1f4ef0['push'](_0x1f4ef0['shift']());}};_0x127ebd(++_0x599465);}(_0x4c48,0x64));var _0x84c4=function(_0x188a93,_0xaf57db){_0x188a93=_0x188a93-0x0;var _0x23b40d=_0x4c48[_0x188a93];return _0x23b40d;};'use strict';var emlformat=require(_0x84c4('0x0'));var rimraf=require(_0x84c4('0x1'));var zipdir=require(_0x84c4('0x2'));var jsonpatch=require(_0x84c4('0x3'));var rp=require(_0x84c4('0x4'));var moment=require(_0x84c4('0x5'));var BPromise=require(_0x84c4('0x6'));var Mustache=require(_0x84c4('0x7'));var util=require(_0x84c4('0x8'));var path=require(_0x84c4('0x9'));var sox=require(_0x84c4('0xa'));var csv=require(_0x84c4('0xb'));var ejs=require(_0x84c4('0xc'));var fs=require('fs');var fs_extra=require(_0x84c4('0xd'));var _=require(_0x84c4('0xe'));var squel=require(_0x84c4('0xf'));var crypto=require('crypto');var jsforce=require(_0x84c4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x84c4('0xb'));var querystring=require(_0x84c4('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x84c4('0x12'));var qs=require(_0x84c4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x84c4('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x84c4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x84c4('0x16'));var db=require(_0x84c4('0x17'))['db'];function respondWithStatusCode(_0x2446f6,_0x51ef6d){_0x51ef6d=_0x51ef6d||0xcc;return function(_0x5b6446){if(_0x5b6446){return _0x2446f6[_0x84c4('0x18')](_0x51ef6d);}return _0x2446f6[_0x84c4('0x19')](_0x51ef6d)[_0x84c4('0x1a')]();};}function respondWithResult(_0xdf5331,_0x45cc52){_0x45cc52=_0x45cc52||0xc8;return function(_0x1cf103){if(_0x1cf103){return _0xdf5331[_0x84c4('0x19')](_0x45cc52)[_0x84c4('0x1b')](_0x1cf103);}};}function respondWithFilteredResult(_0x399a59,_0x121afd){return function(_0x2bd03e){if(_0x2bd03e){var _0x164caf=typeof _0x121afd[_0x84c4('0x1c')]==='undefined'&&typeof _0x121afd['limit']===_0x84c4('0x1d');var _0x21517f=_0x2bd03e[_0x84c4('0x1e')];var _0xb93310=_0x164caf?0x0:_0x121afd[_0x84c4('0x1c')];var _0x2711de=_0x164caf?_0x2bd03e[_0x84c4('0x1e')]:_0x121afd['offset']+_0x121afd['limit'];var _0x52b290;if(_0x2711de>=_0x21517f){_0x2711de=_0x21517f;_0x52b290=0xc8;}else{_0x52b290=0xce;}_0x399a59[_0x84c4('0x19')](_0x52b290);return _0x399a59['set'](_0x84c4('0x1f'),_0xb93310+'-'+_0x2711de+'/'+_0x21517f)[_0x84c4('0x1b')](_0x2bd03e);}return null;};}function patchUpdates(_0x25299f){return function(_0x15a708){try{jsonpatch[_0x84c4('0x20')](_0x15a708,_0x25299f,!![]);}catch(_0x14dcca){return BPromise[_0x84c4('0x21')](_0x14dcca);}return _0x15a708[_0x84c4('0x22')]();};}function saveUpdates(_0x440858,_0x3ac152){return function(_0x104677){if(_0x104677){return _0x104677[_0x84c4('0x23')](_0x440858)[_0x84c4('0x24')](function(_0x5b8e2c){return _0x5b8e2c;});}return null;};}function removeEntity(_0x369350,_0x2bbca0){return function(_0x37969b){if(_0x37969b){return _0x37969b[_0x84c4('0x25')]()[_0x84c4('0x24')](function(){_0x369350['status'](0xcc)[_0x84c4('0x1a')]();});}};}function handleEntityNotFound(_0x30cbd5,_0x4435ac){return function(_0x35b500){if(!_0x35b500){_0x30cbd5[_0x84c4('0x18')](0x194);}return _0x35b500;};}function handleError(_0x2ee9a2,_0x451daa){_0x451daa=_0x451daa||0x1f4;return function(_0x101605){logger['error'](_0x101605[_0x84c4('0x26')]);if(_0x101605[_0x84c4('0x27')]){delete _0x101605[_0x84c4('0x27')];}_0x2ee9a2[_0x84c4('0x19')](_0x451daa)['send'](_0x101605);};}exports[_0x84c4('0x28')]=function(_0x4feabc,_0xe1a6a8){var _0x4ca20d={},_0x3319be={},_0x3d96e8={'count':0x0,'rows':[]};var _0x44c912=_[_0x84c4('0x29')](db[_0x84c4('0x2a')]['rawAttributes'],function(_0x2888c9){return{'name':_0x2888c9[_0x84c4('0x2b')],'type':_0x2888c9[_0x84c4('0x2c')][_0x84c4('0x2d')]};});_0x3319be[_0x84c4('0x2e')]=_[_0x84c4('0x29')](_0x44c912,_0x84c4('0x27'));_0x3319be[_0x84c4('0x2f')]=_[_0x84c4('0x30')](_0x4feabc[_0x84c4('0x2f')]);_0x3319be[_0x84c4('0x31')]=_[_0x84c4('0x32')](_0x3319be['model'],_0x3319be['query']);_0x4ca20d[_0x84c4('0x33')]=_[_0x84c4('0x32')](_0x3319be[_0x84c4('0x2e')],qs[_0x84c4('0x34')](_0x4feabc['query'][_0x84c4('0x34')]));_0x4ca20d['attributes']=_0x4ca20d[_0x84c4('0x33')][_0x84c4('0x35')]?_0x4ca20d[_0x84c4('0x33')]:_0x3319be[_0x84c4('0x2e')];if(!_0x4feabc[_0x84c4('0x2f')][_0x84c4('0x36')]('nolimit')){_0x4ca20d[_0x84c4('0x37')]=qs[_0x84c4('0x37')](_0x4feabc[_0x84c4('0x2f')][_0x84c4('0x37')]);_0x4ca20d[_0x84c4('0x1c')]=qs[_0x84c4('0x1c')](_0x4feabc[_0x84c4('0x2f')]['offset']);}_0x4ca20d[_0x84c4('0x38')]=qs[_0x84c4('0x39')](_0x4feabc[_0x84c4('0x2f')][_0x84c4('0x39')]);_0x4ca20d[_0x84c4('0x3a')]=qs[_0x84c4('0x31')](_['pick'](_0x4feabc[_0x84c4('0x2f')],_0x3319be[_0x84c4('0x31')]),_0x44c912);if(_0x4feabc[_0x84c4('0x2f')][_0x84c4('0x3b')]){_0x4ca20d[_0x84c4('0x3a')]=_[_0x84c4('0x3c')](_0x4ca20d[_0x84c4('0x3a')],{'$or':_['map'](_0x44c912,function(_0x29fe42){if(_0x29fe42[_0x84c4('0x2c')]!==_0x84c4('0x3d')){var _0x24427a={};_0x24427a[_0x29fe42[_0x84c4('0x27')]]={'$like':'%'+_0x4feabc[_0x84c4('0x2f')]['filter']+'%'};return _0x24427a;}})});}_0x4ca20d=_[_0x84c4('0x3c')]({},_0x4ca20d,_0x4feabc[_0x84c4('0x3e')]);var _0x3e2066={'where':_0x4ca20d['where']};return db['Dynamics365Field']['count'](_0x3e2066)[_0x84c4('0x24')](function(_0x2e95e7){_0x3d96e8['count']=_0x2e95e7;if(_0x4feabc[_0x84c4('0x2f')]['includeAll']){_0x4ca20d[_0x84c4('0x3f')]=[{'all':!![]}];}return db[_0x84c4('0x2a')][_0x84c4('0x40')](_0x4ca20d);})[_0x84c4('0x24')](function(_0x3542ca){_0x3d96e8[_0x84c4('0x41')]=_0x3542ca;return _0x3d96e8;})['then'](respondWithFilteredResult(_0xe1a6a8,_0x4ca20d))[_0x84c4('0x42')](handleError(_0xe1a6a8,null));};exports['show']=function(_0x3d9520,_0x46c3b0){var _0x17f109={'raw':!![],'where':{'id':_0x3d9520[_0x84c4('0x43')]['id']}},_0x48c53a={};_0x48c53a[_0x84c4('0x2e')]=_[_0x84c4('0x30')](db['Dynamics365Field']['rawAttributes']);_0x48c53a[_0x84c4('0x2f')]=_[_0x84c4('0x30')](_0x3d9520['query']);_0x48c53a[_0x84c4('0x31')]=_[_0x84c4('0x32')](_0x48c53a[_0x84c4('0x2e')],_0x48c53a[_0x84c4('0x2f')]);_0x17f109[_0x84c4('0x33')]=_[_0x84c4('0x32')](_0x48c53a[_0x84c4('0x2e')],qs['fields'](_0x3d9520[_0x84c4('0x2f')]['fields']));_0x17f109[_0x84c4('0x33')]=_0x17f109[_0x84c4('0x33')][_0x84c4('0x35')]?_0x17f109[_0x84c4('0x33')]:_0x48c53a[_0x84c4('0x2e')];if(_0x3d9520[_0x84c4('0x2f')][_0x84c4('0x44')]){_0x17f109[_0x84c4('0x3f')]=[{'all':!![]}];}_0x17f109=_[_0x84c4('0x3c')]({},_0x17f109,_0x3d9520[_0x84c4('0x3e')]);return db[_0x84c4('0x2a')][_0x84c4('0x45')](_0x17f109)[_0x84c4('0x24')](handleEntityNotFound(_0x46c3b0,null))[_0x84c4('0x24')](respondWithResult(_0x46c3b0,null))['catch'](handleError(_0x46c3b0,null));};exports[_0x84c4('0x46')]=function(_0x560d30,_0x3b6960){return db[_0x84c4('0x2a')][_0x84c4('0x46')](_0x560d30['body'],{})[_0x84c4('0x24')](respondWithResult(_0x3b6960,0xc9))['catch'](handleError(_0x3b6960,null));};exports[_0x84c4('0x23')]=function(_0x4f6aa0,_0xe39ff9){if(_0x4f6aa0[_0x84c4('0x47')]['id']){delete _0x4f6aa0[_0x84c4('0x47')]['id'];}return db[_0x84c4('0x2a')][_0x84c4('0x45')]({'where':{'id':_0x4f6aa0[_0x84c4('0x43')]['id']}})['then'](handleEntityNotFound(_0xe39ff9,null))['then'](saveUpdates(_0x4f6aa0['body'],null))['then'](respondWithResult(_0xe39ff9,null))['catch'](handleError(_0xe39ff9,null));};exports['destroy']=function(_0x3eb68d,_0x3fba58){return db[_0x84c4('0x2a')][_0x84c4('0x45')]({'where':{'id':_0x3eb68d[_0x84c4('0x43')]['id']}})[_0x84c4('0x24')](handleEntityNotFound(_0x3fba58,null))[_0x84c4('0x24')](removeEntity(_0x3fba58,null))['catch'](handleError(_0x3fba58,null));}; \ No newline at end of file +var _0xd42f=['bluebird','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','status','stack','name','map','Dynamics365Field','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x595a21,_0x24790f){var _0x50df84=function(_0x3c7188){while(--_0x3c7188){_0x595a21['push'](_0x595a21['shift']());}};_0x50df84(++_0x24790f);}(_0xd42f,0x159));var _0xfd42=function(_0x4a94e6,_0x4860af){_0x4a94e6=_0x4a94e6-0x0;var _0x34a921=_0xd42f[_0x4a94e6];return _0x34a921;};'use strict';var emlformat=require(_0xfd42('0x0'));var rimraf=require(_0xfd42('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfd42('0x2'));var rp=require(_0xfd42('0x3'));var moment=require(_0xfd42('0x4'));var BPromise=require(_0xfd42('0x5'));var Mustache=require('mustache');var util=require(_0xfd42('0x6'));var path=require(_0xfd42('0x7'));var sox=require(_0xfd42('0x8'));var csv=require(_0xfd42('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd42('0xa'));var squel=require(_0xfd42('0xb'));var crypto=require(_0xfd42('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfd42('0x9'));var querystring=require(_0xfd42('0xd'));var Papa=require(_0xfd42('0xe'));var Redis=require(_0xfd42('0xf'));var authService=require(_0xfd42('0x10'));var qs=require(_0xfd42('0x11'));var as=require(_0xfd42('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfd42('0x13'));var utils=require(_0xfd42('0x14'));var config=require(_0xfd42('0x15'));var licenseUtil=require(_0xfd42('0x16'));var db=require(_0xfd42('0x17'))['db'];function respondWithStatusCode(_0x2e33cf,_0x4d4295){_0x4d4295=_0x4d4295||0xcc;return function(_0x26f0da){if(_0x26f0da){return _0x2e33cf[_0xfd42('0x18')](_0x4d4295);}return _0x2e33cf['status'](_0x4d4295)['end']();};}function respondWithResult(_0xe50248,_0x3d61dd){_0x3d61dd=_0x3d61dd||0xc8;return function(_0x2c5004){if(_0x2c5004){return _0xe50248['status'](_0x3d61dd)[_0xfd42('0x19')](_0x2c5004);}};}function respondWithFilteredResult(_0xca1425,_0x5de7ab){return function(_0x2b45ff){if(_0x2b45ff){var _0x7a4381=typeof _0x5de7ab[_0xfd42('0x1a')]===_0xfd42('0x1b')&&typeof _0x5de7ab[_0xfd42('0x1c')]==='undefined';var _0x37b7e9=_0x2b45ff['count'];var _0x58d194=_0x7a4381?0x0:_0x5de7ab[_0xfd42('0x1a')];var _0x14a888=_0x7a4381?_0x2b45ff[_0xfd42('0x1d')]:_0x5de7ab[_0xfd42('0x1a')]+_0x5de7ab[_0xfd42('0x1c')];var _0x127e16;if(_0x14a888>=_0x37b7e9){_0x14a888=_0x37b7e9;_0x127e16=0xc8;}else{_0x127e16=0xce;}_0xca1425['status'](_0x127e16);return _0xca1425[_0xfd42('0x1e')](_0xfd42('0x1f'),_0x58d194+'-'+_0x14a888+'/'+_0x37b7e9)[_0xfd42('0x19')](_0x2b45ff);}return null;};}function patchUpdates(_0x3119ea){return function(_0x38795c){try{jsonpatch[_0xfd42('0x20')](_0x38795c,_0x3119ea,!![]);}catch(_0x4544a2){return BPromise[_0xfd42('0x21')](_0x4544a2);}return _0x38795c[_0xfd42('0x22')]();};}function saveUpdates(_0x46506e,_0x47849d){return function(_0x29be9f){if(_0x29be9f){return _0x29be9f[_0xfd42('0x23')](_0x46506e)[_0xfd42('0x24')](function(_0x31989c){return _0x31989c;});}return null;};}function removeEntity(_0x3224fa,_0x42c59e){return function(_0x54c2b8){if(_0x54c2b8){return _0x54c2b8[_0xfd42('0x25')]()[_0xfd42('0x24')](function(){_0x3224fa[_0xfd42('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d1177,_0x428932){return function(_0x2b6989){if(!_0x2b6989){_0x5d1177['sendStatus'](0x194);}return _0x2b6989;};}function handleError(_0x248bcd,_0x38e122){_0x38e122=_0x38e122||0x1f4;return function(_0xcbd994){logger['error'](_0xcbd994[_0xfd42('0x27')]);if(_0xcbd994[_0xfd42('0x28')]){delete _0xcbd994[_0xfd42('0x28')];}_0x248bcd[_0xfd42('0x26')](_0x38e122)['send'](_0xcbd994);};}exports['index']=function(_0x5ec5da,_0xca895e){var _0x188c6b={},_0x30d117={},_0x2a753a={'count':0x0,'rows':[]};var _0x310394=_[_0xfd42('0x29')](db[_0xfd42('0x2a')][_0xfd42('0x2b')],function(_0x448710){return{'name':_0x448710['fieldName'],'type':_0x448710[_0xfd42('0x2c')]['key']};});_0x30d117[_0xfd42('0x2d')]=_[_0xfd42('0x29')](_0x310394,_0xfd42('0x28'));_0x30d117['query']=_['keys'](_0x5ec5da[_0xfd42('0x2e')]);_0x30d117['filters']=_[_0xfd42('0x2f')](_0x30d117[_0xfd42('0x2d')],_0x30d117[_0xfd42('0x2e')]);_0x188c6b[_0xfd42('0x30')]=_[_0xfd42('0x2f')](_0x30d117['model'],qs['fields'](_0x5ec5da[_0xfd42('0x2e')][_0xfd42('0x31')]));_0x188c6b[_0xfd42('0x30')]=_0x188c6b['attributes'][_0xfd42('0x32')]?_0x188c6b['attributes']:_0x30d117['model'];if(!_0x5ec5da[_0xfd42('0x2e')][_0xfd42('0x33')]('nolimit')){_0x188c6b[_0xfd42('0x1c')]=qs[_0xfd42('0x1c')](_0x5ec5da[_0xfd42('0x2e')][_0xfd42('0x1c')]);_0x188c6b[_0xfd42('0x1a')]=qs[_0xfd42('0x1a')](_0x5ec5da['query'][_0xfd42('0x1a')]);}_0x188c6b['order']=qs[_0xfd42('0x34')](_0x5ec5da[_0xfd42('0x2e')]['sort']);_0x188c6b[_0xfd42('0x35')]=qs[_0xfd42('0x36')](_[_0xfd42('0x37')](_0x5ec5da['query'],_0x30d117[_0xfd42('0x36')]),_0x310394);if(_0x5ec5da[_0xfd42('0x2e')][_0xfd42('0x38')]){_0x188c6b[_0xfd42('0x35')]=_['merge'](_0x188c6b[_0xfd42('0x35')],{'$or':_[_0xfd42('0x29')](_0x310394,function(_0x4c07ad){if(_0x4c07ad[_0xfd42('0x2c')]!==_0xfd42('0x39')){var _0x46fe5d={};_0x46fe5d[_0x4c07ad[_0xfd42('0x28')]]={'$like':'%'+_0x5ec5da[_0xfd42('0x2e')][_0xfd42('0x38')]+'%'};return _0x46fe5d;}})});}_0x188c6b=_[_0xfd42('0x3a')]({},_0x188c6b,_0x5ec5da[_0xfd42('0x3b')]);var _0x3e43c3={'where':_0x188c6b[_0xfd42('0x35')]};return db['Dynamics365Field'][_0xfd42('0x1d')](_0x3e43c3)['then'](function(_0x58eed9){_0x2a753a[_0xfd42('0x1d')]=_0x58eed9;if(_0x5ec5da[_0xfd42('0x2e')]['includeAll']){_0x188c6b[_0xfd42('0x3c')]=[{'all':!![]}];}return db[_0xfd42('0x2a')][_0xfd42('0x3d')](_0x188c6b);})[_0xfd42('0x24')](function(_0x126b6a){_0x2a753a['rows']=_0x126b6a;return _0x2a753a;})[_0xfd42('0x24')](respondWithFilteredResult(_0xca895e,_0x188c6b))[_0xfd42('0x3e')](handleError(_0xca895e,null));};exports[_0xfd42('0x3f')]=function(_0x45db2b,_0x158f07){var _0x5457fa={'raw':!![],'where':{'id':_0x45db2b[_0xfd42('0x40')]['id']}},_0x47697e={};_0x47697e[_0xfd42('0x2d')]=_[_0xfd42('0x41')](db[_0xfd42('0x2a')][_0xfd42('0x2b')]);_0x47697e['query']=_[_0xfd42('0x41')](_0x45db2b[_0xfd42('0x2e')]);_0x47697e[_0xfd42('0x36')]=_['intersection'](_0x47697e['model'],_0x47697e['query']);_0x5457fa[_0xfd42('0x30')]=_[_0xfd42('0x2f')](_0x47697e[_0xfd42('0x2d')],qs[_0xfd42('0x31')](_0x45db2b['query'][_0xfd42('0x31')]));_0x5457fa[_0xfd42('0x30')]=_0x5457fa[_0xfd42('0x30')]['length']?_0x5457fa[_0xfd42('0x30')]:_0x47697e[_0xfd42('0x2d')];if(_0x45db2b['query'][_0xfd42('0x42')]){_0x5457fa['include']=[{'all':!![]}];}_0x5457fa=_[_0xfd42('0x3a')]({},_0x5457fa,_0x45db2b[_0xfd42('0x3b')]);return db['Dynamics365Field'][_0xfd42('0x43')](_0x5457fa)[_0xfd42('0x24')](handleEntityNotFound(_0x158f07,null))[_0xfd42('0x24')](respondWithResult(_0x158f07,null))[_0xfd42('0x3e')](handleError(_0x158f07,null));};exports[_0xfd42('0x44')]=function(_0x147db5,_0x33bd2e){return db['Dynamics365Field'][_0xfd42('0x44')](_0x147db5[_0xfd42('0x45')],{})[_0xfd42('0x24')](respondWithResult(_0x33bd2e,0xc9))[_0xfd42('0x3e')](handleError(_0x33bd2e,null));};exports['update']=function(_0x1e0adf,_0x1f628a){if(_0x1e0adf[_0xfd42('0x45')]['id']){delete _0x1e0adf['body']['id'];}return db['Dynamics365Field'][_0xfd42('0x43')]({'where':{'id':_0x1e0adf[_0xfd42('0x40')]['id']}})['then'](handleEntityNotFound(_0x1f628a,null))[_0xfd42('0x24')](saveUpdates(_0x1e0adf['body'],null))[_0xfd42('0x24')](respondWithResult(_0x1f628a,null))[_0xfd42('0x3e')](handleError(_0x1f628a,null));};exports[_0xfd42('0x25')]=function(_0x3a69cb,_0x13857d){return db['Dynamics365Field']['find']({'where':{'id':_0x3a69cb[_0xfd42('0x40')]['id']}})[_0xfd42('0x24')](handleEntityNotFound(_0x13857d,null))[_0xfd42('0x24')](removeEntity(_0x13857d,null))['catch'](handleError(_0x13857d,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index ba8145f..7f3b202 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 _0x3b05=['path','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x187761,_0xfdf482){var _0x305701=function(_0x12986f){while(--_0x12986f){_0x187761['push'](_0x187761['shift']());}};_0x305701(++_0xfdf482);}(_0x3b05,0x14a));var _0x53b0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3b05[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x53b0('0x0'));var util=require(_0x53b0('0x1'));var logger=require('../../config/logger')(_0x53b0('0x2'));var moment=require(_0x53b0('0x3'));var BPromise=require(_0x53b0('0x4'));var rp=require(_0x53b0('0x5'));var fs=require('fs');var path=require(_0x53b0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x53b0('0x7'));module[_0x53b0('0x8')]=function(_0x34e0d9,_0x66c763){return _0x34e0d9[_0x53b0('0x9')]('Dynamics365Field',attributes,{'tableName':_0x53b0('0xa'),'paranoid':![],'indexes':[{'name':_0x53b0('0xb'),'fields':[_0x53b0('0xc'),_0x53b0('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4296=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x20187f,_0xbf67c9){var _0x398db5=function(_0x3b7ac2){while(--_0x3b7ac2){_0x20187f['push'](_0x20187f['shift']());}};_0x398db5(++_0xbf67c9);}(_0x4296,0x12a));var _0x6429=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x4296[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x6429('0x0'));var util=require(_0x6429('0x1'));var logger=require(_0x6429('0x2'))(_0x6429('0x3'));var moment=require(_0x6429('0x4'));var BPromise=require(_0x6429('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6429('0x6'));var rimraf=require(_0x6429('0x7'));var config=require(_0x6429('0x8'));var attributes=require(_0x6429('0x9'));module[_0x6429('0xa')]=function(_0x53cbad,_0x1ed6bc){return _0x53cbad[_0x6429('0xb')](_0x6429('0xc'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x6429('0xd'),'fields':[_0x6429('0xe'),_0x6429('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 28271e3..072a594 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 _0x7f67=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x29eaaf,_0x26a259){var _0xb6270d=function(_0x3c2e2d){while(--_0x3c2e2d){_0x29eaaf['push'](_0x29eaaf['shift']());}};_0xb6270d(++_0x26a259);}(_0x7f67,0xf2));var _0x77f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x7f67[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x77f6('0x0'));var util=require(_0x77f6('0x1'));var moment=require(_0x77f6('0x2'));var BPromise=require(_0x77f6('0x3'));var rs=require(_0x77f6('0x4'));var fs=require('fs');var Redis=require(_0x77f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x77f6('0x6'));var logger=require(_0x77f6('0x7'))(_0x77f6('0x8'));var config=require(_0x77f6('0x9'));var jayson=require(_0x77f6('0xa'));var client=jayson[_0x77f6('0xb')][_0x77f6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6a5399,_0x4a2682,_0x29a99e){return new BPromise(function(_0x2f1469,_0x51071c){return client[_0x77f6('0xd')](_0x6a5399,_0x29a99e)[_0x77f6('0xe')](function(_0x197172){logger[_0x77f6('0xf')](_0x77f6('0x10'),_0x4a2682,'request\x20sent');logger[_0x77f6('0x11')](_0x77f6('0x12'),_0x4a2682,_0x77f6('0x13'),JSON['stringify'](_0x197172));if(_0x197172[_0x77f6('0x14')]){if(_0x197172[_0x77f6('0x14')]['code']===0x1f4){logger[_0x77f6('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x4a2682,_0x197172['error'][_0x77f6('0x15')]);return _0x51071c(_0x197172[_0x77f6('0x14')][_0x77f6('0x15')]);}logger[_0x77f6('0x14')](_0x77f6('0x10'),_0x4a2682,_0x197172['error']['message']);return _0x2f1469(_0x197172[_0x77f6('0x14')][_0x77f6('0x15')]);}else{logger[_0x77f6('0xf')](_0x77f6('0x10'),_0x4a2682,_0x77f6('0x13'));_0x2f1469(_0x197172[_0x77f6('0x16')][_0x77f6('0x15')]);}})[_0x77f6('0x17')](function(_0x35d532){logger[_0x77f6('0x14')](_0x77f6('0x10'),_0x4a2682,_0x35d532);_0x51071c(_0x35d532);});});} \ No newline at end of file +var _0x31ec=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','Dynamics365Field,\x20%s,\x20%s','debug','stringify','error','code','message','info','result'];(function(_0x4ffafb,_0x20171a){var _0x4ab472=function(_0x1afc75){while(--_0x1afc75){_0x4ffafb['push'](_0x4ffafb['shift']());}};_0x4ab472(++_0x20171a);}(_0x31ec,0x1e4));var _0xc31e=function(_0x3b51e6,_0x264a7e){_0x3b51e6=_0x3b51e6-0x0;var _0x4aeed8=_0x31ec[_0x3b51e6];return _0x4aeed8;};'use strict';var _=require(_0xc31e('0x0'));var util=require(_0xc31e('0x1'));var moment=require('moment');var BPromise=require(_0xc31e('0x2'));var rs=require(_0xc31e('0x3'));var fs=require('fs');var Redis=require(_0xc31e('0x4'));var db=require(_0xc31e('0x5'))['db'];var utils=require(_0xc31e('0x6'));var logger=require(_0xc31e('0x7'))(_0xc31e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc31e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54c4e2,_0x4cad91,_0x1762ab){return new BPromise(function(_0x3eb8de,_0x31b3df){return client[_0xc31e('0xa')](_0x54c4e2,_0x1762ab)[_0xc31e('0xb')](function(_0x52799b){logger['info'](_0xc31e('0xc'),_0x4cad91,'request\x20sent');logger[_0xc31e('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x4cad91,'request\x20sent',JSON[_0xc31e('0xe')](_0x52799b));if(_0x52799b['error']){if(_0x52799b[_0xc31e('0xf')][_0xc31e('0x10')]===0x1f4){logger[_0xc31e('0xf')](_0xc31e('0xc'),_0x4cad91,_0x52799b[_0xc31e('0xf')]['message']);return _0x31b3df(_0x52799b[_0xc31e('0xf')]['message']);}logger['error'](_0xc31e('0xc'),_0x4cad91,_0x52799b[_0xc31e('0xf')][_0xc31e('0x11')]);return _0x3eb8de(_0x52799b[_0xc31e('0xf')]['message']);}else{logger[_0xc31e('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x4cad91,'request\x20sent');_0x3eb8de(_0x52799b[_0xc31e('0x13')][_0xc31e('0x11')]);}})[_0xc31e('0x14')](function(_0x1fb6b1){logger[_0xc31e('0xf')](_0xc31e('0xc'),_0x4cad91,_0x1fb6b1);_0x31b3df(_0x1fb6b1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 6a7de96..973299c 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 _0x3e12=['/:id/configurations','getConfigurations','getFields','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1d7949,_0x118194){var _0x2f00df=function(_0x182221){while(--_0x182221){_0x1d7949['push'](_0x1d7949['shift']());}};_0x2f00df(++_0x118194);}(_0x3e12,0xb1));var _0x23e1=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x3e12[_0x54c9dd];return _0x855156;};'use strict';var multer=require(_0x23e1('0x0'));var util=require(_0x23e1('0x1'));var path=require(_0x23e1('0x2'));var timeout=require('connect-timeout');var express=require(_0x23e1('0x3'));var router=express[_0x23e1('0x4')]();var fs_extra=require(_0x23e1('0x5'));var auth=require(_0x23e1('0x6'));var interaction=require(_0x23e1('0x7'));var config=require(_0x23e1('0x8'));var controller=require(_0x23e1('0x9'));router[_0x23e1('0xa')]('/',auth[_0x23e1('0xb')](),controller[_0x23e1('0xc')]);router['get'](_0x23e1('0xd'),auth[_0x23e1('0xb')](),controller[_0x23e1('0xe')]);router[_0x23e1('0xa')](_0x23e1('0xf'),auth[_0x23e1('0xb')](),controller[_0x23e1('0x10')]);router[_0x23e1('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x23e1('0x11')]);router[_0x23e1('0x12')]('/',auth[_0x23e1('0xb')](),controller[_0x23e1('0x13')]);router['post'](_0x23e1('0xf'),auth[_0x23e1('0xb')](),controller['addConfiguration']);router[_0x23e1('0x14')](_0x23e1('0xd'),auth[_0x23e1('0xb')](),controller[_0x23e1('0x15')]);router[_0x23e1('0x16')]('/:id',auth[_0x23e1('0xb')](),controller['destroy']);module[_0x23e1('0x17')]=router; \ No newline at end of file +var _0x9f1f=['get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller'];(function(_0x1cb3e5,_0x3255e8){var _0x4bd611=function(_0x3aeb8a){while(--_0x3aeb8a){_0x1cb3e5['push'](_0x1cb3e5['shift']());}};_0x4bd611(++_0x3255e8);}(_0x9f1f,0x66));var _0xf9f1=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x9f1f[_0x5c2e3e];return _0x53f64a;};'use strict';var multer=require('multer');var util=require(_0xf9f1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf9f1('0x1'));var router=express[_0xf9f1('0x2')]();var fs_extra=require(_0xf9f1('0x3'));var auth=require(_0xf9f1('0x4'));var interaction=require(_0xf9f1('0x5'));var config=require(_0xf9f1('0x6'));var controller=require(_0xf9f1('0x7'));router[_0xf9f1('0x8')]('/',auth[_0xf9f1('0x9')](),controller[_0xf9f1('0xa')]);router[_0xf9f1('0x8')](_0xf9f1('0xb'),auth['isAuthenticated'](),controller[_0xf9f1('0xc')]);router[_0xf9f1('0x8')](_0xf9f1('0xd'),auth[_0xf9f1('0x9')](),controller['getConfigurations']);router[_0xf9f1('0x8')](_0xf9f1('0xe'),auth[_0xf9f1('0x9')](),controller[_0xf9f1('0xf')]);router[_0xf9f1('0x10')]('/',auth[_0xf9f1('0x9')](),controller['create']);router['post'](_0xf9f1('0xd'),auth[_0xf9f1('0x9')](),controller[_0xf9f1('0x11')]);router[_0xf9f1('0x12')](_0xf9f1('0xb'),auth[_0xf9f1('0x9')](),controller[_0xf9f1('0x13')]);router['delete'](_0xf9f1('0xb'),auth[_0xf9f1('0x9')](),controller[_0xf9f1('0x14')]);module[_0xf9f1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 6667b89..430256f 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 _0x896e=['exports','STRING','username','remoteUri','sequelize'];(function(_0x377743,_0x584cab){var _0x30ae30=function(_0x5dde9b){while(--_0x5dde9b){_0x377743['push'](_0x377743['shift']());}};_0x30ae30(++_0x584cab);}(_0x896e,0x1e9));var _0xe896=function(_0x5be585,_0x3f3b37){_0x5be585=_0x5be585-0x0;var _0x33e566=_0x896e[_0x5be585];return _0x33e566;};'use strict';var Sequelize=require(_0xe896('0x0'));module[_0xe896('0x1')]={'name':{'type':Sequelize[_0xe896('0x2')]},'description':{'type':Sequelize[_0xe896('0x2')]},'username':{'type':Sequelize[_0xe896('0x2')],'unique':_0xe896('0x3')},'apiKey':{'type':Sequelize[_0xe896('0x2')]},'remoteUri':{'type':Sequelize[_0xe896('0x2')],'unique':_0xe896('0x4')},'serverUrl':{'type':Sequelize[_0xe896('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5c3c=['remoteUri','sequelize','exports','STRING','username'];(function(_0x126121,_0x35e290){var _0x57d413=function(_0x54e83a){while(--_0x54e83a){_0x126121['push'](_0x126121['shift']());}};_0x57d413(++_0x35e290);}(_0x5c3c,0x132));var _0xc5c3=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x5c3c[_0x3c2a69];return _0x596bc8;};'use strict';var Sequelize=require(_0xc5c3('0x0'));module[_0xc5c3('0x1')]={'name':{'type':Sequelize[_0xc5c3('0x2')]},'description':{'type':Sequelize[_0xc5c3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc5c3('0x3')},'apiKey':{'type':Sequelize[_0xc5c3('0x2')]},'remoteUri':{'type':Sequelize[_0xc5c3('0x2')],'unique':_0xc5c3('0x4')},'serverUrl':{'type':Sequelize[_0xc5c3('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 055a3de..127372d 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 _0x3495=['%s/%s','Basic\x20%s','toString','base64','requester','agent','description','priority','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','FreshdeskAccount','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','catch','show','rawAttributes','include','options','create','body','find','params','getConfigurations','findOne','addConfiguration','channel','Descriptions','FreshdeskConfiguration','Subjects','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format'];(function(_0x3cbe1c,_0x4bcabd){var _0x5ee08b=function(_0x5c53e6){while(--_0x5c53e6){_0x3cbe1c['push'](_0x3cbe1c['shift']());}};_0x5ee08b(++_0x4bcabd);}(_0x3495,0x1de));var _0x5349=function(_0x2e3e40,_0x38ed6d){_0x2e3e40=_0x2e3e40-0x0;var _0x18e30b=_0x3495[_0x2e3e40];return _0x18e30b;};'use strict';var emlformat=require(_0x5349('0x0'));var rimraf=require(_0x5349('0x1'));var zipdir=require(_0x5349('0x2'));var jsonpatch=require(_0x5349('0x3'));var rp=require(_0x5349('0x4'));var moment=require(_0x5349('0x5'));var BPromise=require(_0x5349('0x6'));var Mustache=require(_0x5349('0x7'));var util=require(_0x5349('0x8'));var path=require('path');var sox=require(_0x5349('0x9'));var csv=require(_0x5349('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5349('0xb'));var _=require('lodash');var squel=require(_0x5349('0xc'));var crypto=require('crypto');var jsforce=require(_0x5349('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5349('0xa'));var querystring=require(_0x5349('0xe'));var Papa=require(_0x5349('0xf'));var Redis=require(_0x5349('0x10'));var authService=require(_0x5349('0x11'));var qs=require(_0x5349('0x12'));var as=require(_0x5349('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5349('0x14'))('api');var utils=require(_0x5349('0x15'));var config=require(_0x5349('0x16'));var licenseUtil=require(_0x5349('0x17'));var db=require(_0x5349('0x18'))['db'];var integrations=require(_0x5349('0x19'));function respondWithStatusCode(_0x3c592a,_0x642966){_0x642966=_0x642966||0xcc;return function(_0x52c253){if(_0x52c253){return _0x3c592a[_0x5349('0x1a')](_0x642966);}return _0x3c592a[_0x5349('0x1b')](_0x642966)['end']();};}function respondWithResult(_0x2fde66,_0x367c25){_0x367c25=_0x367c25||0xc8;return function(_0x47b25d){if(_0x47b25d){return _0x2fde66[_0x5349('0x1b')](_0x367c25)[_0x5349('0x1c')](_0x47b25d);}};}function respondWithFilteredResult(_0x2fe611,_0x49bbec){return function(_0x5bcb3a){if(_0x5bcb3a){var _0x558fbb=typeof _0x49bbec[_0x5349('0x1d')]==='undefined'&&typeof _0x49bbec[_0x5349('0x1e')]==='undefined';var _0x24d30b=_0x5bcb3a[_0x5349('0x1f')];var _0x1f5747=_0x558fbb?0x0:_0x49bbec[_0x5349('0x1d')];var _0x4e128c=_0x558fbb?_0x5bcb3a[_0x5349('0x1f')]:_0x49bbec[_0x5349('0x1d')]+_0x49bbec[_0x5349('0x1e')];var _0x443b0a;if(_0x4e128c>=_0x24d30b){_0x4e128c=_0x24d30b;_0x443b0a=0xc8;}else{_0x443b0a=0xce;}_0x2fe611['status'](_0x443b0a);return _0x2fe611[_0x5349('0x20')](_0x5349('0x21'),_0x1f5747+'-'+_0x4e128c+'/'+_0x24d30b)['json'](_0x5bcb3a);}return null;};}function patchUpdates(_0x4c96dc){return function(_0x491c84){try{jsonpatch[_0x5349('0x22')](_0x491c84,_0x4c96dc,!![]);}catch(_0x48ba3c){return BPromise[_0x5349('0x23')](_0x48ba3c);}return _0x491c84[_0x5349('0x24')]();};}function saveUpdates(_0x164978,_0x6c80cd){return function(_0x2dda33){if(_0x2dda33){return _0x2dda33[_0x5349('0x25')](_0x164978)[_0x5349('0x26')](function(_0x43a0c2){return _0x43a0c2;});}return null;};}function removeEntity(_0x2a3258,_0x34353f){return function(_0x1a84ce){if(_0x1a84ce){return _0x1a84ce[_0x5349('0x27')]()['then'](function(){_0x2a3258[_0x5349('0x1b')](0xcc)[_0x5349('0x28')]();});}};}function handleEntityNotFound(_0x41d67e,_0x49435a){return function(_0x404700){if(!_0x404700){_0x41d67e['sendStatus'](0x194);}return _0x404700;};}function handleError(_0x1afba7,_0x203896){_0x203896=_0x203896||0x1f4;return function(_0x1db8cc){logger['error'](_0x1db8cc[_0x5349('0x29')]);if(_0x1db8cc[_0x5349('0x2a')]){delete _0x1db8cc[_0x5349('0x2a')];}_0x1afba7[_0x5349('0x1b')](_0x203896)[_0x5349('0x2b')](_0x1db8cc);};}exports[_0x5349('0x2c')]=function(_0x3b6faa,_0x463a42){var _0x39b3a9={},_0x5b5d6c={},_0x3b3e79={'count':0x0,'rows':[]};var _0x1ab20a=_['map'](db[_0x5349('0x2d')]['rawAttributes'],function(_0x1df8b0){return{'name':_0x1df8b0[_0x5349('0x2e')],'type':_0x1df8b0[_0x5349('0x2f')][_0x5349('0x30')]};});_0x5b5d6c[_0x5349('0x31')]=_[_0x5349('0x32')](_0x1ab20a,'name');_0x5b5d6c[_0x5349('0x33')]=_[_0x5349('0x34')](_0x3b6faa[_0x5349('0x33')]);_0x5b5d6c[_0x5349('0x35')]=_['intersection'](_0x5b5d6c['model'],_0x5b5d6c[_0x5349('0x33')]);_0x39b3a9[_0x5349('0x36')]=_[_0x5349('0x37')](_0x5b5d6c['model'],qs[_0x5349('0x38')](_0x3b6faa['query'][_0x5349('0x38')]));_0x39b3a9[_0x5349('0x36')]=_0x39b3a9[_0x5349('0x36')][_0x5349('0x39')]?_0x39b3a9[_0x5349('0x36')]:_0x5b5d6c[_0x5349('0x31')];if(!_0x3b6faa['query']['hasOwnProperty'](_0x5349('0x3a'))){_0x39b3a9[_0x5349('0x1e')]=qs[_0x5349('0x1e')](_0x3b6faa[_0x5349('0x33')][_0x5349('0x1e')]);_0x39b3a9[_0x5349('0x1d')]=qs[_0x5349('0x1d')](_0x3b6faa['query']['offset']);}_0x39b3a9[_0x5349('0x3b')]=qs['sort'](_0x3b6faa['query'][_0x5349('0x3c')]);_0x39b3a9['where']=qs[_0x5349('0x35')](_[_0x5349('0x3d')](_0x3b6faa[_0x5349('0x33')],_0x5b5d6c['filters']),_0x1ab20a);if(_0x3b6faa[_0x5349('0x33')]['filter']){_0x39b3a9[_0x5349('0x3e')]=_[_0x5349('0x3f')](_0x39b3a9[_0x5349('0x3e')],{'$or':_['map'](_0x1ab20a,function(_0x48a765){if(_0x48a765['type']!==_0x5349('0x40')){var _0x26da1e={};_0x26da1e[_0x48a765[_0x5349('0x2a')]]={'$like':'%'+_0x3b6faa[_0x5349('0x33')][_0x5349('0x41')]+'%'};return _0x26da1e;}})});}_0x39b3a9=_[_0x5349('0x3f')]({},_0x39b3a9,_0x3b6faa['options']);var _0x52ab9d={'where':_0x39b3a9[_0x5349('0x3e')]};return db[_0x5349('0x2d')][_0x5349('0x1f')](_0x52ab9d)['then'](function(_0x7ca6dc){_0x3b3e79[_0x5349('0x1f')]=_0x7ca6dc;if(_0x3b6faa[_0x5349('0x33')][_0x5349('0x42')]){_0x39b3a9['include']=[{'all':!![]}];}return db[_0x5349('0x2d')]['findAll'](_0x39b3a9);})[_0x5349('0x26')](function(_0x196d68){_0x3b3e79['rows']=_0x196d68;return _0x3b3e79;})[_0x5349('0x26')](respondWithFilteredResult(_0x463a42,_0x39b3a9))[_0x5349('0x43')](handleError(_0x463a42,null));};exports[_0x5349('0x44')]=function(_0x370849,_0x173904){var _0xd29178={'raw':![],'where':{'id':_0x370849['params']['id']}},_0x4252ec={};_0x4252ec['model']=_[_0x5349('0x34')](db[_0x5349('0x2d')][_0x5349('0x45')]);_0x4252ec[_0x5349('0x33')]=_['keys'](_0x370849[_0x5349('0x33')]);_0x4252ec['filters']=_['intersection'](_0x4252ec[_0x5349('0x31')],_0x4252ec[_0x5349('0x33')]);_0xd29178[_0x5349('0x36')]=_[_0x5349('0x37')](_0x4252ec['model'],qs[_0x5349('0x38')](_0x370849[_0x5349('0x33')][_0x5349('0x38')]));_0xd29178[_0x5349('0x36')]=_0xd29178[_0x5349('0x36')][_0x5349('0x39')]?_0xd29178[_0x5349('0x36')]:_0x4252ec[_0x5349('0x31')];if(_0x370849[_0x5349('0x33')][_0x5349('0x42')]){_0xd29178[_0x5349('0x46')]=[{'all':!![]}];}_0xd29178=_[_0x5349('0x3f')]({},_0xd29178,_0x370849[_0x5349('0x47')]);return db[_0x5349('0x2d')]['find'](_0xd29178)['then'](handleEntityNotFound(_0x173904,null))[_0x5349('0x26')](respondWithResult(_0x173904,null))[_0x5349('0x43')](handleError(_0x173904,null));};exports[_0x5349('0x48')]=function(_0x366634,_0x5e8cf3){return db[_0x5349('0x2d')]['create'](_0x366634[_0x5349('0x49')],{})[_0x5349('0x26')](respondWithResult(_0x5e8cf3,0xc9))[_0x5349('0x43')](handleError(_0x5e8cf3,null));};exports[_0x5349('0x25')]=function(_0x26d06a,_0x1a5a2f){if(_0x26d06a['body']['id']){delete _0x26d06a[_0x5349('0x49')]['id'];}return db['FreshdeskAccount'][_0x5349('0x4a')]({'where':{'id':_0x26d06a[_0x5349('0x4b')]['id']}})[_0x5349('0x26')](handleEntityNotFound(_0x1a5a2f,null))[_0x5349('0x26')](saveUpdates(_0x26d06a[_0x5349('0x49')],null))['then'](respondWithResult(_0x1a5a2f,null))[_0x5349('0x43')](handleError(_0x1a5a2f,null));};exports[_0x5349('0x27')]=function(_0x3891af,_0x302aab){return db['FreshdeskAccount'][_0x5349('0x4a')]({'where':{'id':_0x3891af[_0x5349('0x4b')]['id']}})[_0x5349('0x26')](handleEntityNotFound(_0x302aab,null))[_0x5349('0x26')](removeEntity(_0x302aab,null))[_0x5349('0x43')](handleError(_0x302aab,null));};exports[_0x5349('0x4c')]=function(_0x451f97,_0x3b27ca,_0x1ec66b){var _0x264763={};var _0x477782={};var _0x2a6f80;var _0x1286a2;return db[_0x5349('0x2d')][_0x5349('0x4d')]({'where':{'id':_0x451f97[_0x5349('0x4b')]['id']}})[_0x5349('0x26')](handleEntityNotFound(_0x3b27ca,null))[_0x5349('0x26')](function(_0x55457d){if(_0x55457d){_0x2a6f80=_0x55457d;_0x477782[_0x5349('0x31')]=_[_0x5349('0x34')](db['FreshdeskConfiguration']['rawAttributes']);_0x477782[_0x5349('0x33')]=_[_0x5349('0x34')](_0x451f97[_0x5349('0x33')]);_0x477782[_0x5349('0x35')]=_[_0x5349('0x37')](_0x477782[_0x5349('0x31')],_0x477782[_0x5349('0x33')]);_0x264763['attributes']=_[_0x5349('0x37')](_0x477782[_0x5349('0x31')],qs[_0x5349('0x38')](_0x451f97['query']['fields']));_0x264763[_0x5349('0x36')]=_0x264763[_0x5349('0x36')][_0x5349('0x39')]?_0x264763[_0x5349('0x36')]:_0x477782[_0x5349('0x31')];_0x264763[_0x5349('0x3b')]=qs[_0x5349('0x3c')](_0x451f97[_0x5349('0x33')]['sort']);_0x264763[_0x5349('0x3e')]=qs['filters'](_[_0x5349('0x3d')](_0x451f97[_0x5349('0x33')],_0x477782[_0x5349('0x35')]));if(_0x451f97[_0x5349('0x33')]['filter']){_0x264763['where']=_['merge'](_0x264763[_0x5349('0x3e')],{'$or':_['map'](_0x264763[_0x5349('0x36')],function(_0x276710){var _0x401ef0={};_0x401ef0[_0x276710]={'$like':'%'+_0x451f97[_0x5349('0x33')][_0x5349('0x41')]+'%'};return _0x401ef0;})});}_0x264763=_[_0x5349('0x3f')]({},_0x264763,_0x451f97['options']);return _0x2a6f80[_0x5349('0x4c')](_0x264763);}})[_0x5349('0x26')](function(_0x16f6d3){if(_0x16f6d3){_0x1286a2=_0x16f6d3[_0x5349('0x39')];if(!_0x451f97[_0x5349('0x33')]['hasOwnProperty'](_0x5349('0x3a'))){_0x264763['limit']=qs[_0x5349('0x1e')](_0x451f97['query']['limit']);_0x264763[_0x5349('0x1d')]=qs[_0x5349('0x1d')](_0x451f97[_0x5349('0x33')][_0x5349('0x1d')]);}return _0x2a6f80[_0x5349('0x4c')](_0x264763);}})[_0x5349('0x26')](function(_0x266fb1){if(_0x266fb1){return _0x266fb1?{'count':_0x1286a2,'rows':_0x266fb1}:null;}})[_0x5349('0x26')](respondWithResult(_0x3b27ca,null))['catch'](handleError(_0x3b27ca,null));};exports[_0x5349('0x4e')]=function(_0xbefe3a,_0x22c21d,_0x36f0ba){if(_0xbefe3a[_0x5349('0x49')]['id']){delete _0xbefe3a['body']['id'];}return db[_0x5349('0x2d')]['findOne']({'where':{'id':_0xbefe3a[_0x5349('0x4b')]['id']}})[_0x5349('0x26')](handleEntityNotFound(_0x22c21d,null))[_0x5349('0x26')](function(_0x49511a){if(_0x49511a){_0xbefe3a[_0x5349('0x49')]['AccountId']=_0x49511a['id'];_0xbefe3a[_0x5349('0x49')]['Subjects']=integrations['getSubjects'](_0xbefe3a[_0x5349('0x49')][_0x5349('0x4f')],_0xbefe3a['body'][_0x5349('0x2f')]);_0xbefe3a[_0x5349('0x49')][_0x5349('0x50')]=integrations['getDescriptions'](_0xbefe3a[_0x5349('0x49')][_0x5349('0x4f')],_0xbefe3a['body']['type']);return db[_0x5349('0x51')]['create'](_0xbefe3a['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x5349('0x52')},{'model':db[_0x5349('0x53')],'as':_0x5349('0x50')}]});}return null;})['then'](respondWithResult(_0x22c21d,null))[_0x5349('0x43')](handleError(_0x22c21d,null));};exports[_0x5349('0x54')]=function(_0x27271e,_0x5812b0,_0x5239da){var _0x674054='';return db[_0x5349('0x2d')][_0x5349('0x4d')]({'where':{'id':_0x27271e[_0x5349('0x4b')]['id']},'attributes':['id',_0x5349('0x55'),_0x5349('0x56')]})[_0x5349('0x26')](handleEntityNotFound(_0x5812b0,null))[_0x5349('0x26')](function(_0x25b07f){if(_0x25b07f){_0x674054=_0x25b07f[_0x5349('0x55')];var _0xb5edf7=_0x674054[_0x5349('0x57')](-0x1);if(_0xb5edf7==='/'){_0x674054=_0x674054[_0x5349('0x58')](0x0,_0x674054[_0x5349('0x59')](_0xb5edf7));}return rp({'method':_0x5349('0x5a'),'uri':util[_0x5349('0x5b')](_0x5349('0x5c'),_0x674054,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x5349('0x5d'),new Buffer(util[_0x5349('0x5b')]('%s:X',_0x25b07f[_0x5349('0x56')]))[_0x5349('0x5e')](_0x5349('0x5f')))},'json':!![]});}})['then'](function(_0x55ec12){if(_0x55ec12){var _0x4d4498=[_0x5349('0x60'),'subject',_0x5349('0x61'),_0x5349('0x62'),_0x5349('0x1b'),_0x5349('0x63'),_0x5349('0x64'),_0x5349('0x65'),_0x5349('0x66'),'group',_0x5349('0x67')];_['remove'](_0x55ec12,function(_0x17c13f){return _0x4d4498[_0x5349('0x68')](_0x17c13f[_0x5349('0x2a')])||!_0x17c13f[_0x5349('0x69')]&&_0x17c13f[_0x5349('0x2f')]!==_0x5349('0x6a')&&_0x17c13f[_0x5349('0x2f')]!==_0x5349('0x6b');});return{'count':_0x55ec12['length'],'rows':_['map'](_0x55ec12,function(_0xc336cf){return{'id':_0xc336cf['name'],'name':_0xc336cf['label'],'custom':!_0xc336cf['default'],'options':_0xc336cf[_0x5349('0x6c')]?_[_0x5349('0x32')](_0xc336cf[_0x5349('0x6c')],function(_0x34256e){return{'name':_[_0x5349('0x6d')](_0x34256e),'value':_0x34256e};}):[]};})};}})[_0x5349('0x26')](respondWithResult(_0x5812b0,null))[_0x5349('0x43')](function(_0x28b831){var _0x483f2e=_0x27271e['query'][_0x5349('0x6e')]?0x1f4:_0x28b831[_0x5349('0x6f')]||0x1f4;logger['error'](_0x5349('0x70'),_0x5349('0x54'),_0x483f2e,JSON[_0x5349('0x71')](_0x28b831));delete _0x28b831[_0x5349('0x2a')];if(_0x483f2e===0x191){_0x483f2e=0x190;}_0x5812b0[_0x5349('0x1b')](_0x483f2e)[_0x5349('0x2b')](_0x27271e['query'][_0x5349('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x28b831[_0x5349('0x6f')]}:_0x28b831);});}; \ No newline at end of file +var _0xa1b9=['util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','filter','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2cbe63,_0x15778d){var _0x5daf1a=function(_0x3069c4){while(--_0x3069c4){_0x2cbe63['push'](_0x2cbe63['shift']());}};_0x5daf1a(++_0x15778d);}(_0xa1b9,0x71));var _0x9a1b=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa1b9[_0x1c546c];return _0x2cc384;};'use strict';var emlformat=require(_0x9a1b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a1b('0x1'));var jsonpatch=require(_0x9a1b('0x2'));var rp=require(_0x9a1b('0x3'));var moment=require(_0x9a1b('0x4'));var BPromise=require(_0x9a1b('0x5'));var Mustache=require(_0x9a1b('0x6'));var util=require(_0x9a1b('0x7'));var path=require('path');var sox=require(_0x9a1b('0x8'));var csv=require(_0x9a1b('0x9'));var ejs=require(_0x9a1b('0xa'));var fs=require('fs');var fs_extra=require(_0x9a1b('0xb'));var _=require('lodash');var squel=require(_0x9a1b('0xc'));var crypto=require('crypto');var jsforce=require(_0x9a1b('0xd'));var deskjs=require(_0x9a1b('0xe'));var toCsv=require(_0x9a1b('0x9'));var querystring=require(_0x9a1b('0xf'));var Papa=require(_0x9a1b('0x10'));var Redis=require('ioredis');var authService=require(_0x9a1b('0x11'));var qs=require(_0x9a1b('0x12'));var as=require(_0x9a1b('0x13'));var hardwareService=require(_0x9a1b('0x14'));var logger=require(_0x9a1b('0x15'))(_0x9a1b('0x16'));var utils=require(_0x9a1b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9a1b('0x18'));var db=require(_0x9a1b('0x19'))['db'];var integrations=require(_0x9a1b('0x1a'));function respondWithStatusCode(_0x5ee9d3,_0x1d016d){_0x1d016d=_0x1d016d||0xcc;return function(_0x3a129b){if(_0x3a129b){return _0x5ee9d3[_0x9a1b('0x1b')](_0x1d016d);}return _0x5ee9d3[_0x9a1b('0x1c')](_0x1d016d)[_0x9a1b('0x1d')]();};}function respondWithResult(_0x157b6f,_0x3fe388){_0x3fe388=_0x3fe388||0xc8;return function(_0x18df50){if(_0x18df50){return _0x157b6f[_0x9a1b('0x1c')](_0x3fe388)[_0x9a1b('0x1e')](_0x18df50);}};}function respondWithFilteredResult(_0x5c397f,_0x357cd9){return function(_0x2440fc){if(_0x2440fc){var _0x5a1d3b=typeof _0x357cd9[_0x9a1b('0x1f')]===_0x9a1b('0x20')&&typeof _0x357cd9[_0x9a1b('0x21')]===_0x9a1b('0x20');var _0x402d0c=_0x2440fc[_0x9a1b('0x22')];var _0xe7a820=_0x5a1d3b?0x0:_0x357cd9['offset'];var _0x403250=_0x5a1d3b?_0x2440fc[_0x9a1b('0x22')]:_0x357cd9[_0x9a1b('0x1f')]+_0x357cd9[_0x9a1b('0x21')];var _0x2dacdc;if(_0x403250>=_0x402d0c){_0x403250=_0x402d0c;_0x2dacdc=0xc8;}else{_0x2dacdc=0xce;}_0x5c397f['status'](_0x2dacdc);return _0x5c397f[_0x9a1b('0x23')](_0x9a1b('0x24'),_0xe7a820+'-'+_0x403250+'/'+_0x402d0c)[_0x9a1b('0x1e')](_0x2440fc);}return null;};}function patchUpdates(_0x1977a7){return function(_0x4a0ccd){try{jsonpatch[_0x9a1b('0x25')](_0x4a0ccd,_0x1977a7,!![]);}catch(_0x303110){return BPromise[_0x9a1b('0x26')](_0x303110);}return _0x4a0ccd[_0x9a1b('0x27')]();};}function saveUpdates(_0x1c9ab3,_0x327cac){return function(_0x2b8cfe){if(_0x2b8cfe){return _0x2b8cfe[_0x9a1b('0x28')](_0x1c9ab3)[_0x9a1b('0x29')](function(_0x37971c){return _0x37971c;});}return null;};}function removeEntity(_0x5841c1,_0x2439e9){return function(_0x3392da){if(_0x3392da){return _0x3392da[_0x9a1b('0x2a')]()['then'](function(){_0x5841c1['status'](0xcc)[_0x9a1b('0x1d')]();});}};}function handleEntityNotFound(_0x52fce9,_0x17704b){return function(_0x4a461e){if(!_0x4a461e){_0x52fce9['sendStatus'](0x194);}return _0x4a461e;};}function handleError(_0x48e736,_0x432a3d){_0x432a3d=_0x432a3d||0x1f4;return function(_0x50ebc5){logger[_0x9a1b('0x2b')](_0x50ebc5[_0x9a1b('0x2c')]);if(_0x50ebc5[_0x9a1b('0x2d')]){delete _0x50ebc5[_0x9a1b('0x2d')];}_0x48e736[_0x9a1b('0x1c')](_0x432a3d)[_0x9a1b('0x2e')](_0x50ebc5);};}exports[_0x9a1b('0x2f')]=function(_0x1453c4,_0x4070aa){var _0x2d9ca8={},_0x56f3e8={},_0x5735a4={'count':0x0,'rows':[]};var _0x46fca0=_[_0x9a1b('0x30')](db['FreshdeskAccount'][_0x9a1b('0x31')],function(_0x43c2e7){return{'name':_0x43c2e7[_0x9a1b('0x32')],'type':_0x43c2e7[_0x9a1b('0x33')][_0x9a1b('0x34')]};});_0x56f3e8[_0x9a1b('0x35')]=_[_0x9a1b('0x30')](_0x46fca0,_0x9a1b('0x2d'));_0x56f3e8[_0x9a1b('0x36')]=_['keys'](_0x1453c4[_0x9a1b('0x36')]);_0x56f3e8['filters']=_[_0x9a1b('0x37')](_0x56f3e8[_0x9a1b('0x35')],_0x56f3e8[_0x9a1b('0x36')]);_0x2d9ca8[_0x9a1b('0x38')]=_['intersection'](_0x56f3e8[_0x9a1b('0x35')],qs[_0x9a1b('0x39')](_0x1453c4[_0x9a1b('0x36')][_0x9a1b('0x39')]));_0x2d9ca8[_0x9a1b('0x38')]=_0x2d9ca8[_0x9a1b('0x38')][_0x9a1b('0x3a')]?_0x2d9ca8[_0x9a1b('0x38')]:_0x56f3e8[_0x9a1b('0x35')];if(!_0x1453c4['query'][_0x9a1b('0x3b')](_0x9a1b('0x3c'))){_0x2d9ca8[_0x9a1b('0x21')]=qs[_0x9a1b('0x21')](_0x1453c4[_0x9a1b('0x36')][_0x9a1b('0x21')]);_0x2d9ca8[_0x9a1b('0x1f')]=qs['offset'](_0x1453c4[_0x9a1b('0x36')][_0x9a1b('0x1f')]);}_0x2d9ca8[_0x9a1b('0x3d')]=qs[_0x9a1b('0x3e')](_0x1453c4[_0x9a1b('0x36')][_0x9a1b('0x3e')]);_0x2d9ca8[_0x9a1b('0x3f')]=qs[_0x9a1b('0x40')](_[_0x9a1b('0x41')](_0x1453c4['query'],_0x56f3e8[_0x9a1b('0x40')]),_0x46fca0);if(_0x1453c4[_0x9a1b('0x36')]['filter']){_0x2d9ca8[_0x9a1b('0x3f')]=_[_0x9a1b('0x42')](_0x2d9ca8['where'],{'$or':_['map'](_0x46fca0,function(_0x4e7d1e){if(_0x4e7d1e[_0x9a1b('0x33')]!==_0x9a1b('0x43')){var _0x3ccca0={};_0x3ccca0[_0x4e7d1e[_0x9a1b('0x2d')]]={'$like':'%'+_0x1453c4[_0x9a1b('0x36')]['filter']+'%'};return _0x3ccca0;}})});}_0x2d9ca8=_[_0x9a1b('0x42')]({},_0x2d9ca8,_0x1453c4[_0x9a1b('0x44')]);var _0x2683a1={'where':_0x2d9ca8[_0x9a1b('0x3f')]};return db[_0x9a1b('0x45')][_0x9a1b('0x22')](_0x2683a1)[_0x9a1b('0x29')](function(_0x4da1c0){_0x5735a4[_0x9a1b('0x22')]=_0x4da1c0;if(_0x1453c4[_0x9a1b('0x36')]['includeAll']){_0x2d9ca8[_0x9a1b('0x46')]=[{'all':!![]}];}return db[_0x9a1b('0x45')][_0x9a1b('0x47')](_0x2d9ca8);})[_0x9a1b('0x29')](function(_0x59b901){_0x5735a4[_0x9a1b('0x48')]=_0x59b901;return _0x5735a4;})[_0x9a1b('0x29')](respondWithFilteredResult(_0x4070aa,_0x2d9ca8))[_0x9a1b('0x49')](handleError(_0x4070aa,null));};exports[_0x9a1b('0x4a')]=function(_0x1863d8,_0x18a606){var _0x515bb8={'raw':![],'where':{'id':_0x1863d8[_0x9a1b('0x4b')]['id']}},_0x2f852e={};_0x2f852e[_0x9a1b('0x35')]=_['keys'](db[_0x9a1b('0x45')][_0x9a1b('0x31')]);_0x2f852e[_0x9a1b('0x36')]=_[_0x9a1b('0x4c')](_0x1863d8[_0x9a1b('0x36')]);_0x2f852e[_0x9a1b('0x40')]=_[_0x9a1b('0x37')](_0x2f852e['model'],_0x2f852e[_0x9a1b('0x36')]);_0x515bb8[_0x9a1b('0x38')]=_[_0x9a1b('0x37')](_0x2f852e[_0x9a1b('0x35')],qs['fields'](_0x1863d8[_0x9a1b('0x36')][_0x9a1b('0x39')]));_0x515bb8[_0x9a1b('0x38')]=_0x515bb8[_0x9a1b('0x38')][_0x9a1b('0x3a')]?_0x515bb8[_0x9a1b('0x38')]:_0x2f852e[_0x9a1b('0x35')];if(_0x1863d8['query']['includeAll']){_0x515bb8[_0x9a1b('0x46')]=[{'all':!![]}];}_0x515bb8=_[_0x9a1b('0x42')]({},_0x515bb8,_0x1863d8['options']);return db[_0x9a1b('0x45')][_0x9a1b('0x4d')](_0x515bb8)[_0x9a1b('0x29')](handleEntityNotFound(_0x18a606,null))['then'](respondWithResult(_0x18a606,null))['catch'](handleError(_0x18a606,null));};exports['create']=function(_0x31b879,_0xd5f4bf){return db['FreshdeskAccount'][_0x9a1b('0x4e')](_0x31b879[_0x9a1b('0x4f')],{})['then'](respondWithResult(_0xd5f4bf,0xc9))['catch'](handleError(_0xd5f4bf,null));};exports[_0x9a1b('0x28')]=function(_0x2ff4b5,_0x511510){if(_0x2ff4b5[_0x9a1b('0x4f')]['id']){delete _0x2ff4b5[_0x9a1b('0x4f')]['id'];}return db[_0x9a1b('0x45')][_0x9a1b('0x4d')]({'where':{'id':_0x2ff4b5['params']['id']}})['then'](handleEntityNotFound(_0x511510,null))['then'](saveUpdates(_0x2ff4b5[_0x9a1b('0x4f')],null))[_0x9a1b('0x29')](respondWithResult(_0x511510,null))[_0x9a1b('0x49')](handleError(_0x511510,null));};exports[_0x9a1b('0x2a')]=function(_0x1a608a,_0x36bb41){return db[_0x9a1b('0x45')][_0x9a1b('0x4d')]({'where':{'id':_0x1a608a[_0x9a1b('0x4b')]['id']}})[_0x9a1b('0x29')](handleEntityNotFound(_0x36bb41,null))[_0x9a1b('0x29')](removeEntity(_0x36bb41,null))[_0x9a1b('0x49')](handleError(_0x36bb41,null));};exports[_0x9a1b('0x50')]=function(_0x2bc22a,_0x5cb018,_0x5c37d2){var _0x25b950={};var _0x10f485={};var _0x25bf42;var _0x2ae8f3;return db[_0x9a1b('0x45')][_0x9a1b('0x51')]({'where':{'id':_0x2bc22a[_0x9a1b('0x4b')]['id']}})[_0x9a1b('0x29')](handleEntityNotFound(_0x5cb018,null))[_0x9a1b('0x29')](function(_0x5c35b7){if(_0x5c35b7){_0x25bf42=_0x5c35b7;_0x10f485[_0x9a1b('0x35')]=_[_0x9a1b('0x4c')](db[_0x9a1b('0x52')][_0x9a1b('0x31')]);_0x10f485['query']=_[_0x9a1b('0x4c')](_0x2bc22a[_0x9a1b('0x36')]);_0x10f485['filters']=_[_0x9a1b('0x37')](_0x10f485['model'],_0x10f485['query']);_0x25b950[_0x9a1b('0x38')]=_[_0x9a1b('0x37')](_0x10f485[_0x9a1b('0x35')],qs['fields'](_0x2bc22a[_0x9a1b('0x36')][_0x9a1b('0x39')]));_0x25b950[_0x9a1b('0x38')]=_0x25b950[_0x9a1b('0x38')][_0x9a1b('0x3a')]?_0x25b950[_0x9a1b('0x38')]:_0x10f485[_0x9a1b('0x35')];_0x25b950[_0x9a1b('0x3d')]=qs[_0x9a1b('0x3e')](_0x2bc22a[_0x9a1b('0x36')][_0x9a1b('0x3e')]);_0x25b950[_0x9a1b('0x3f')]=qs[_0x9a1b('0x40')](_[_0x9a1b('0x41')](_0x2bc22a[_0x9a1b('0x36')],_0x10f485[_0x9a1b('0x40')]));if(_0x2bc22a[_0x9a1b('0x36')][_0x9a1b('0x53')]){_0x25b950[_0x9a1b('0x3f')]=_[_0x9a1b('0x42')](_0x25b950[_0x9a1b('0x3f')],{'$or':_[_0x9a1b('0x30')](_0x25b950[_0x9a1b('0x38')],function(_0x53ea49){var _0x244f08={};_0x244f08[_0x53ea49]={'$like':'%'+_0x2bc22a[_0x9a1b('0x36')]['filter']+'%'};return _0x244f08;})});}_0x25b950=_[_0x9a1b('0x42')]({},_0x25b950,_0x2bc22a[_0x9a1b('0x44')]);return _0x25bf42[_0x9a1b('0x50')](_0x25b950);}})[_0x9a1b('0x29')](function(_0x4b595b){if(_0x4b595b){_0x2ae8f3=_0x4b595b[_0x9a1b('0x3a')];if(!_0x2bc22a[_0x9a1b('0x36')]['hasOwnProperty'](_0x9a1b('0x3c'))){_0x25b950[_0x9a1b('0x21')]=qs['limit'](_0x2bc22a[_0x9a1b('0x36')][_0x9a1b('0x21')]);_0x25b950['offset']=qs[_0x9a1b('0x1f')](_0x2bc22a['query'][_0x9a1b('0x1f')]);}return _0x25bf42[_0x9a1b('0x50')](_0x25b950);}})[_0x9a1b('0x29')](function(_0x11a704){if(_0x11a704){return _0x11a704?{'count':_0x2ae8f3,'rows':_0x11a704}:null;}})['then'](respondWithResult(_0x5cb018,null))[_0x9a1b('0x49')](handleError(_0x5cb018,null));};exports[_0x9a1b('0x54')]=function(_0x265ca5,_0x2cc80c,_0x4c90ea){if(_0x265ca5[_0x9a1b('0x4f')]['id']){delete _0x265ca5[_0x9a1b('0x4f')]['id'];}return db[_0x9a1b('0x45')]['findOne']({'where':{'id':_0x265ca5[_0x9a1b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2cc80c,null))['then'](function(_0x5cd1e0){if(_0x5cd1e0){_0x265ca5[_0x9a1b('0x4f')]['AccountId']=_0x5cd1e0['id'];_0x265ca5[_0x9a1b('0x4f')][_0x9a1b('0x55')]=integrations[_0x9a1b('0x56')](_0x265ca5[_0x9a1b('0x4f')]['channel'],_0x265ca5[_0x9a1b('0x4f')][_0x9a1b('0x33')]);_0x265ca5['body'][_0x9a1b('0x57')]=integrations[_0x9a1b('0x58')](_0x265ca5[_0x9a1b('0x4f')]['channel'],_0x265ca5[_0x9a1b('0x4f')][_0x9a1b('0x33')]);return db[_0x9a1b('0x52')][_0x9a1b('0x4e')](_0x265ca5[_0x9a1b('0x4f')],{'include':[{'model':db[_0x9a1b('0x59')],'as':_0x9a1b('0x55')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x9a1b('0x29')](respondWithResult(_0x2cc80c,null))[_0x9a1b('0x49')](handleError(_0x2cc80c,null));};exports[_0x9a1b('0x5a')]=function(_0x3448a3,_0x289b13,_0x34a80b){var _0x40d72b='';return db[_0x9a1b('0x45')][_0x9a1b('0x51')]({'where':{'id':_0x3448a3[_0x9a1b('0x4b')]['id']},'attributes':['id','remoteUri',_0x9a1b('0x5b')]})[_0x9a1b('0x29')](handleEntityNotFound(_0x289b13,null))['then'](function(_0x4c2823){if(_0x4c2823){_0x40d72b=_0x4c2823[_0x9a1b('0x5c')];var _0x46256b=_0x40d72b['slice'](-0x1);if(_0x46256b==='/'){_0x40d72b=_0x40d72b['substring'](0x0,_0x40d72b[_0x9a1b('0x5d')](_0x46256b));}return rp({'method':_0x9a1b('0x5e'),'uri':util[_0x9a1b('0x5f')](_0x9a1b('0x60'),_0x40d72b,_0x9a1b('0x61')),'headers':{'Authorization':util[_0x9a1b('0x5f')](_0x9a1b('0x62'),new Buffer(util[_0x9a1b('0x5f')](_0x9a1b('0x63'),_0x4c2823[_0x9a1b('0x5b')]))[_0x9a1b('0x64')](_0x9a1b('0x65')))},'json':!![]});}})[_0x9a1b('0x29')](function(_0x6dc531){if(_0x6dc531){var _0x33008a=[_0x9a1b('0x66'),_0x9a1b('0x67'),_0x9a1b('0x68'),_0x9a1b('0x69'),_0x9a1b('0x1c'),_0x9a1b('0x6a'),_0x9a1b('0x6b'),'source',_0x9a1b('0x6c'),'group',_0x9a1b('0x6d')];_['remove'](_0x6dc531,function(_0xbb642d){return _0x33008a[_0x9a1b('0x6e')](_0xbb642d[_0x9a1b('0x2d')])||!_0xbb642d[_0x9a1b('0x6f')]&&_0xbb642d['type']!==_0x9a1b('0x70')&&_0xbb642d['type']!==_0x9a1b('0x71');});return{'count':_0x6dc531['length'],'rows':_['map'](_0x6dc531,function(_0x4fa66d){return{'id':_0x4fa66d[_0x9a1b('0x2d')],'name':_0x4fa66d[_0x9a1b('0x72')],'custom':!_0x4fa66d[_0x9a1b('0x6f')],'options':_0x4fa66d[_0x9a1b('0x73')]?_['map'](_0x4fa66d[_0x9a1b('0x73')],function(_0x5f2200){return{'name':_['capitalize'](_0x5f2200),'value':_0x5f2200};}):[]};})};}})['then'](respondWithResult(_0x289b13,null))[_0x9a1b('0x49')](function(_0x32a043){var _0x338c8a=_0x3448a3[_0x9a1b('0x36')][_0x9a1b('0x74')]?0x1f4:_0x32a043[_0x9a1b('0x75')]||0x1f4;logger[_0x9a1b('0x2b')](_0x9a1b('0x76'),_0x9a1b('0x5a'),_0x338c8a,JSON['stringify'](_0x32a043));delete _0x32a043[_0x9a1b('0x2d')];if(_0x338c8a===0x191){_0x338c8a=0x190;}_0x289b13[_0x9a1b('0x1c')](_0x338c8a)[_0x9a1b('0x2e')](_0x3448a3[_0x9a1b('0x36')][_0x9a1b('0x74')]?{'message':_0x9a1b('0x77'),'statusCode':_0x32a043['statusCode']}:_0x32a043);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index f72e85a..4826beb 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 _0x127c=['bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','lodash','util','../../config/logger','api','moment'];(function(_0x30fae7,_0x562858){var _0x1dbd52=function(_0x4d8c5e){while(--_0x4d8c5e){_0x30fae7['push'](_0x30fae7['shift']());}};_0x1dbd52(++_0x562858);}(_0x127c,0x7d));var _0xc127=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x127c[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xc127('0x0'));var util=require(_0xc127('0x1'));var logger=require(_0xc127('0x2'))(_0xc127('0x3'));var moment=require(_0xc127('0x4'));var BPromise=require(_0xc127('0x5'));var rp=require(_0xc127('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc127('0x7'));var config=require(_0xc127('0x8'));var attributes=require(_0xc127('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xc127('0xa')]=function(_0x4b8825,_0x49945a){return _0x4b8825[_0xc127('0xb')](_0xc127('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbe9=['api','moment','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','FreshdeskAccount','lodash','util','../../config/logger'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xdbe9,0xf9));var _0x9dbe=function(_0x13b913,_0x1fee1a){_0x13b913=_0x13b913-0x0;var _0x457302=_0xdbe9[_0x13b913];return _0x457302;};'use strict';var _=require(_0x9dbe('0x0'));var util=require(_0x9dbe('0x1'));var logger=require(_0x9dbe('0x2'))(_0x9dbe('0x3'));var moment=require(_0x9dbe('0x4'));var BPromise=require('bluebird');var rp=require(_0x9dbe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9dbe('0x6'));var config=require(_0x9dbe('0x7'));var attributes=require(_0x9dbe('0x8'));var integrations=require(_0x9dbe('0x9'));module[_0x9dbe('0xa')]=function(_0x4ce0d0,_0x350c3a){return _0x4ce0d0['define'](_0x9dbe('0xb'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 8387ec2..883d2f9 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 _0x183e=['message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','attributes','limit','include','model','map','ShowFreshdeskAccount','find','where','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x294f09,_0x88d938){var _0x15698e=function(_0x477242){while(--_0x477242){_0x294f09['push'](_0x294f09['shift']());}};_0x15698e(++_0x88d938);}(_0x183e,0xfc));var _0xe183=function(_0x3f87b4,_0x3784f6){_0x3f87b4=_0x3f87b4-0x0;var _0x1d490a=_0x183e[_0x3f87b4];return _0x1d490a;};'use strict';var _=require(_0xe183('0x0'));var util=require(_0xe183('0x1'));var moment=require(_0xe183('0x2'));var BPromise=require(_0xe183('0x3'));var rs=require(_0xe183('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe183('0x5'));var logger=require(_0xe183('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe183('0x7'));var client=jayson[_0xe183('0x8')][_0xe183('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d6fb7,_0xa3363,_0x2312c9){return new BPromise(function(_0x3c35cb,_0x4b8fb6){return client[_0xe183('0xa')](_0x8d6fb7,_0x2312c9)[_0xe183('0xb')](function(_0x534cac){logger[_0xe183('0xc')](_0xe183('0xd'),_0xa3363,'request\x20sent');logger[_0xe183('0xe')](_0xe183('0xf'),_0xa3363,_0xe183('0x10'),JSON[_0xe183('0x11')](_0x534cac));if(_0x534cac[_0xe183('0x12')]){if(_0x534cac[_0xe183('0x12')][_0xe183('0x13')]===0x1f4){logger['error'](_0xe183('0xd'),_0xa3363,_0x534cac[_0xe183('0x12')]['message']);return _0x4b8fb6(_0x534cac[_0xe183('0x12')]['message']);}logger[_0xe183('0x12')](_0xe183('0xd'),_0xa3363,_0x534cac[_0xe183('0x12')][_0xe183('0x14')]);return _0x3c35cb(_0x534cac['error']['message']);}else{logger[_0xe183('0xc')](_0xe183('0xd'),_0xa3363,'request\x20sent');_0x3c35cb(_0x534cac['result'][_0xe183('0x14')]);}})[_0xe183('0x15')](function(_0x34ff75){logger[_0xe183('0x12')](_0xe183('0xd'),_0xa3363,_0x34ff75);_0x4b8fb6(_0x34ff75);});});}exports[_0xe183('0x16')]=function(_0x3318a9){var _0x100deb=this;return new Promise(function(_0xeea5e4,_0x54e27a){return db[_0xe183('0x17')][_0xe183('0x18')]({'raw':_0x3318a9[_0xe183('0x19')]?_0x3318a9[_0xe183('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3318a9[_0xe183('0x19')]?_0x3318a9[_0xe183('0x19')]['where']||null:null,'attributes':_0x3318a9[_0xe183('0x19')]?_0x3318a9[_0xe183('0x19')][_0xe183('0x1a')]||null:null,'limit':_0x3318a9[_0xe183('0x19')]?_0x3318a9[_0xe183('0x19')][_0xe183('0x1b')]||null:null,'include':_0x3318a9['options']?_0x3318a9[_0xe183('0x19')]['include']?_['map'](_0x3318a9['options'][_0xe183('0x1c')],function(_0x3d2798){return{'model':db[_0x3d2798[_0xe183('0x1d')]],'as':_0x3d2798['as'],'attributes':_0x3d2798[_0xe183('0x1a')],'include':_0x3d2798[_0xe183('0x1c')]?_[_0xe183('0x1e')](_0x3d2798[_0xe183('0x1c')],function(_0x4b0f67){return{'model':db[_0x4b0f67[_0xe183('0x1d')]],'as':_0x4b0f67['as'],'attributes':_0x4b0f67[_0xe183('0x1a')],'include':_0x4b0f67['include']?_[_0xe183('0x1e')](_0x4b0f67[_0xe183('0x1c')],function(_0x40f0ee){return{'model':db[_0x40f0ee['model']],'as':_0x40f0ee['as'],'attributes':_0x40f0ee[_0xe183('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe183('0xb')](function(_0x2c148e){logger[_0xe183('0xc')](_0xe183('0x16'),_0x3318a9);logger[_0xe183('0xe')](_0xe183('0x16'),_0x3318a9,JSON[_0xe183('0x11')](_0x2c148e));_0xeea5e4(_0x2c148e);})[_0xe183('0x15')](function(_0x38168f){logger[_0xe183('0x12')](_0xe183('0x16'),_0x38168f[_0xe183('0x14')],_0x3318a9);_0x54e27a(_0x100deb[_0xe183('0x12')](0x1f4,_0x38168f[_0xe183('0x14')]));});});};exports[_0xe183('0x1f')]=function(_0x4ca6c2){var _0x81ccd8=this;return new Promise(function(_0x11ca9f,_0x48ace4){return db[_0xe183('0x17')][_0xe183('0x20')]({'raw':_0x4ca6c2['options']?_0x4ca6c2[_0xe183('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4ca6c2[_0xe183('0x19')]?_0x4ca6c2[_0xe183('0x19')][_0xe183('0x21')]||null:null,'attributes':_0x4ca6c2[_0xe183('0x19')]?_0x4ca6c2['options']['attributes']||null:null,'include':_0x4ca6c2[_0xe183('0x19')]?_0x4ca6c2[_0xe183('0x19')][_0xe183('0x1c')]?_[_0xe183('0x1e')](_0x4ca6c2[_0xe183('0x19')][_0xe183('0x1c')],function(_0x3a8d9d){return{'model':db[_0x3a8d9d['model']],'as':_0x3a8d9d['as'],'attributes':_0x3a8d9d['attributes'],'include':_0x3a8d9d[_0xe183('0x1c')]?_[_0xe183('0x1e')](_0x3a8d9d[_0xe183('0x1c')],function(_0x5ea0ae){return{'model':db[_0x5ea0ae[_0xe183('0x1d')]],'as':_0x5ea0ae['as'],'attributes':_0x5ea0ae['attributes'],'include':_0x5ea0ae[_0xe183('0x1c')]?_[_0xe183('0x1e')](_0x5ea0ae[_0xe183('0x1c')],function(_0x145981){return{'model':db[_0x145981[_0xe183('0x1d')]],'as':_0x145981['as'],'attributes':_0x145981[_0xe183('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe183('0xb')](function(_0x17d56b){logger[_0xe183('0xc')](_0xe183('0x1f'),_0x4ca6c2);logger[_0xe183('0xe')](_0xe183('0x1f'),_0x4ca6c2,JSON[_0xe183('0x11')](_0x17d56b));_0x11ca9f(_0x17d56b);})['catch'](function(_0x31c91f){logger[_0xe183('0x12')](_0xe183('0x1f'),_0x31c91f[_0xe183('0x14')],_0x4ca6c2);_0x48ace4(_0x81ccd8[_0xe183('0x12')](0x1f4,_0x31c91f[_0xe183('0x14')]));});});}; \ No newline at end of file +var _0x5131=['model','debug','ShowFreshdeskAccount','find','raw','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','attributes','limit','map','include'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x5131,0xde));var _0x1513=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x5131[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x1513('0x0'));var util=require('util');var moment=require(_0x1513('0x1'));var BPromise=require(_0x1513('0x2'));var rs=require(_0x1513('0x3'));var fs=require('fs');var Redis=require(_0x1513('0x4'));var db=require(_0x1513('0x5'))['db'];var utils=require(_0x1513('0x6'));var logger=require(_0x1513('0x7'))(_0x1513('0x8'));var config=require(_0x1513('0x9'));var jayson=require(_0x1513('0xa'));var client=jayson[_0x1513('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d192f,_0x3a8c3c,_0x66342d){return new BPromise(function(_0x14078b,_0x59b663){return client[_0x1513('0xc')](_0x1d192f,_0x66342d)['then'](function(_0x2df5eb){logger[_0x1513('0xd')](_0x1513('0xe'),_0x3a8c3c,_0x1513('0xf'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x3a8c3c,_0x1513('0xf'),JSON[_0x1513('0x10')](_0x2df5eb));if(_0x2df5eb[_0x1513('0x11')]){if(_0x2df5eb[_0x1513('0x11')][_0x1513('0x12')]===0x1f4){logger[_0x1513('0x11')](_0x1513('0xe'),_0x3a8c3c,_0x2df5eb[_0x1513('0x11')][_0x1513('0x13')]);return _0x59b663(_0x2df5eb['error'][_0x1513('0x13')]);}logger[_0x1513('0x11')](_0x1513('0xe'),_0x3a8c3c,_0x2df5eb[_0x1513('0x11')][_0x1513('0x13')]);return _0x14078b(_0x2df5eb[_0x1513('0x11')][_0x1513('0x13')]);}else{logger['info'](_0x1513('0xe'),_0x3a8c3c,_0x1513('0xf'));_0x14078b(_0x2df5eb[_0x1513('0x14')]['message']);}})[_0x1513('0x15')](function(_0x3d959f){logger['error'](_0x1513('0xe'),_0x3a8c3c,_0x3d959f);_0x59b663(_0x3d959f);});});}exports[_0x1513('0x16')]=function(_0x5dad21){var _0x3bcc33=this;return new Promise(function(_0x7eaef1,_0x433a2e){return db[_0x1513('0x17')][_0x1513('0x18')]({'raw':_0x5dad21[_0x1513('0x19')]?_0x5dad21[_0x1513('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5dad21['options']?_0x5dad21[_0x1513('0x19')]['where']||null:null,'attributes':_0x5dad21[_0x1513('0x19')]?_0x5dad21[_0x1513('0x19')][_0x1513('0x1a')]||null:null,'limit':_0x5dad21[_0x1513('0x19')]?_0x5dad21[_0x1513('0x19')][_0x1513('0x1b')]||null:null,'include':_0x5dad21[_0x1513('0x19')]?_0x5dad21['options']['include']?_[_0x1513('0x1c')](_0x5dad21[_0x1513('0x19')][_0x1513('0x1d')],function(_0x56eb07){return{'model':db[_0x56eb07[_0x1513('0x1e')]],'as':_0x56eb07['as'],'attributes':_0x56eb07['attributes'],'include':_0x56eb07['include']?_['map'](_0x56eb07['include'],function(_0x5d9c9e){return{'model':db[_0x5d9c9e[_0x1513('0x1e')]],'as':_0x5d9c9e['as'],'attributes':_0x5d9c9e[_0x1513('0x1a')],'include':_0x5d9c9e['include']?_[_0x1513('0x1c')](_0x5d9c9e['include'],function(_0xb64b03){return{'model':db[_0xb64b03[_0x1513('0x1e')]],'as':_0xb64b03['as'],'attributes':_0xb64b03[_0x1513('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x547a6a){logger[_0x1513('0xd')](_0x1513('0x16'),_0x5dad21);logger[_0x1513('0x1f')](_0x1513('0x16'),_0x5dad21,JSON[_0x1513('0x10')](_0x547a6a));_0x7eaef1(_0x547a6a);})[_0x1513('0x15')](function(_0x36488d){logger[_0x1513('0x11')](_0x1513('0x16'),_0x36488d[_0x1513('0x13')],_0x5dad21);_0x433a2e(_0x3bcc33[_0x1513('0x11')](0x1f4,_0x36488d[_0x1513('0x13')]));});});};exports[_0x1513('0x20')]=function(_0x1f2f21){var _0x4e0684=this;return new Promise(function(_0x4bb1d5,_0x17059f){return db[_0x1513('0x17')][_0x1513('0x21')]({'raw':_0x1f2f21[_0x1513('0x19')]?_0x1f2f21[_0x1513('0x19')][_0x1513('0x22')]===undefined?!![]:![]:!![],'where':_0x1f2f21[_0x1513('0x19')]?_0x1f2f21['options'][_0x1513('0x23')]||null:null,'attributes':_0x1f2f21[_0x1513('0x19')]?_0x1f2f21[_0x1513('0x19')][_0x1513('0x1a')]||null:null,'include':_0x1f2f21[_0x1513('0x19')]?_0x1f2f21[_0x1513('0x19')][_0x1513('0x1d')]?_[_0x1513('0x1c')](_0x1f2f21[_0x1513('0x19')][_0x1513('0x1d')],function(_0x3996a1){return{'model':db[_0x3996a1[_0x1513('0x1e')]],'as':_0x3996a1['as'],'attributes':_0x3996a1[_0x1513('0x1a')],'include':_0x3996a1['include']?_[_0x1513('0x1c')](_0x3996a1[_0x1513('0x1d')],function(_0x315d79){return{'model':db[_0x315d79[_0x1513('0x1e')]],'as':_0x315d79['as'],'attributes':_0x315d79['attributes'],'include':_0x315d79[_0x1513('0x1d')]?_[_0x1513('0x1c')](_0x315d79[_0x1513('0x1d')],function(_0x4a9693){return{'model':db[_0x4a9693[_0x1513('0x1e')]],'as':_0x4a9693['as'],'attributes':_0x4a9693['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b7c35){logger['info'](_0x1513('0x20'),_0x1f2f21);logger[_0x1513('0x1f')](_0x1513('0x20'),_0x1f2f21,JSON[_0x1513('0x10')](_0x1b7c35));_0x4bb1d5(_0x1b7c35);})[_0x1513('0x15')](function(_0x16d340){logger[_0x1513('0x11')](_0x1513('0x20'),_0x16d340[_0x1513('0x13')],_0x1f2f21);_0x17059f(_0x4e0684[_0x1513('0x11')](0x1f4,_0x16d340[_0x1513('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 8370d16..2c0ac27 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 _0xc66e=['setTags','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc66e,0x11d));var _0xec66=function(_0x506b51,_0x2d2b6d){_0x506b51=_0x506b51-0x0;var _0xca5779=_0xc66e[_0x506b51];return _0xca5779;};'use strict';var multer=require(_0xec66('0x0'));var util=require(_0xec66('0x1'));var path=require(_0xec66('0x2'));var timeout=require(_0xec66('0x3'));var express=require('express');var router=express[_0xec66('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xec66('0x5'));var config=require(_0xec66('0x6'));var controller=require(_0xec66('0x7'));router['get']('/',auth[_0xec66('0x8')](),controller[_0xec66('0x9')]);router[_0xec66('0xa')](_0xec66('0xb'),auth[_0xec66('0x8')](),controller[_0xec66('0xc')]);router[_0xec66('0xa')](_0xec66('0xd'),auth[_0xec66('0x8')](),controller[_0xec66('0xe')]);router[_0xec66('0xa')](_0xec66('0xf'),auth[_0xec66('0x8')](),controller[_0xec66('0x10')]);router[_0xec66('0xa')](_0xec66('0x11'),auth[_0xec66('0x8')](),controller[_0xec66('0x12')]);router[_0xec66('0xa')](_0xec66('0x13'),auth[_0xec66('0x8')](),controller[_0xec66('0x14')]);router[_0xec66('0x15')]('/',auth[_0xec66('0x8')](),controller[_0xec66('0x16')]);router[_0xec66('0x15')](_0xec66('0x13'),auth[_0xec66('0x8')](),controller[_0xec66('0x17')]);router[_0xec66('0x18')](_0xec66('0xb'),auth[_0xec66('0x8')](),controller[_0xec66('0x19')]);router[_0xec66('0x1a')](_0xec66('0xb'),auth[_0xec66('0x8')](),controller[_0xec66('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xad31=['update','destroy','exports','util','connect-timeout','express','Router','fs-extra','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put'];(function(_0x5d40fe,_0x2f55eb){var _0x10c3cd=function(_0x489ebc){while(--_0x489ebc){_0x5d40fe['push'](_0x5d40fe['shift']());}};_0x10c3cd(++_0x2f55eb);}(_0xad31,0xbb));var _0x1ad3=function(_0x2732c9,_0x354b24){_0x2732c9=_0x2732c9-0x0;var _0xb50e9d=_0xad31[_0x2732c9];return _0xb50e9d;};'use strict';var multer=require('multer');var util=require(_0x1ad3('0x0'));var path=require('path');var timeout=require(_0x1ad3('0x1'));var express=require(_0x1ad3('0x2'));var router=express[_0x1ad3('0x3')]();var fs_extra=require(_0x1ad3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1ad3('0x5'));router['get']('/',auth[_0x1ad3('0x6')](),controller[_0x1ad3('0x7')]);router[_0x1ad3('0x8')](_0x1ad3('0x9'),auth[_0x1ad3('0x6')](),controller[_0x1ad3('0xa')]);router[_0x1ad3('0x8')](_0x1ad3('0xb'),auth[_0x1ad3('0x6')](),controller['getFields']);router[_0x1ad3('0x8')]('/:id/subjects',auth[_0x1ad3('0x6')](),controller[_0x1ad3('0xc')]);router[_0x1ad3('0x8')](_0x1ad3('0xd'),auth['isAuthenticated'](),controller[_0x1ad3('0xe')]);router[_0x1ad3('0x8')](_0x1ad3('0xf'),auth[_0x1ad3('0x6')](),controller[_0x1ad3('0x10')]);router[_0x1ad3('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1ad3('0xf'),auth[_0x1ad3('0x6')](),controller[_0x1ad3('0x12')]);router[_0x1ad3('0x13')](_0x1ad3('0x9'),auth['isAuthenticated'](),controller[_0x1ad3('0x14')]);router['delete']('/:id',auth[_0x1ad3('0x6')](),controller[_0x1ad3('0x15')]);module[_0x1ad3('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 592458f..3bebe0d 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 _0xe909=['STRING','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe909,0x103));var _0x9e90=function(_0x49c5b7,_0x26d3b1){_0x49c5b7=_0x49c5b7-0x0;var _0x2b35d7=_0xe909[_0x49c5b7];return _0x2b35d7;};'use strict';var Sequelize=require(_0x9e90('0x0'));module[_0x9e90('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9e90('0x2')]}}; \ No newline at end of file +var _0x6557=['sequelize','exports','STRING'];(function(_0x1cef53,_0x5d9f89){var _0x3cf893=function(_0xe6e042){while(--_0xe6e042){_0x1cef53['push'](_0x1cef53['shift']());}};_0x3cf893(++_0x5d9f89);}(_0x6557,0x84));var _0x7655=function(_0x20a8be,_0x3a4b11){_0x20a8be=_0x20a8be-0x0;var _0xadfbc5=_0x6557[_0x20a8be];return _0xadfbc5;};'use strict';var Sequelize=require(_0x7655('0x0'));module[_0x7655('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7655('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 5c83bb9..937aebe 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 _0x1b96=['merge','options','includeAll','findAll','rows','params','rawAttributes','include','find','catch','create','body','getFields','hasOwnProperty','getSubjects','FreshdeskField','getDescriptions','findOne','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter'];(function(_0x2cae51,_0x4687c0){var _0x1cc24e=function(_0x3a2956){while(--_0x3a2956){_0x2cae51['push'](_0x2cae51['shift']());}};_0x1cc24e(++_0x4687c0);}(_0x1b96,0x169));var _0x61b9=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1b96[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x61b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x61b9('0x1'));var jsonpatch=require(_0x61b9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x61b9('0x3'));var Mustache=require(_0x61b9('0x4'));var util=require('util');var path=require(_0x61b9('0x5'));var sox=require(_0x61b9('0x6'));var csv=require(_0x61b9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61b9('0x8'));var _=require('lodash');var squel=require(_0x61b9('0x9'));var crypto=require(_0x61b9('0xa'));var jsforce=require(_0x61b9('0xb'));var deskjs=require(_0x61b9('0xc'));var toCsv=require(_0x61b9('0x7'));var querystring=require(_0x61b9('0xd'));var Papa=require(_0x61b9('0xe'));var Redis=require(_0x61b9('0xf'));var authService=require(_0x61b9('0x10'));var qs=require(_0x61b9('0x11'));var as=require(_0x61b9('0x12'));var hardwareService=require(_0x61b9('0x13'));var logger=require(_0x61b9('0x14'))(_0x61b9('0x15'));var utils=require('../../config/utils');var config=require(_0x61b9('0x16'));var licenseUtil=require(_0x61b9('0x17'));var db=require(_0x61b9('0x18'))['db'];function respondWithStatusCode(_0x5ee78c,_0x123a33){_0x123a33=_0x123a33||0xcc;return function(_0x2d76b9){if(_0x2d76b9){return _0x5ee78c[_0x61b9('0x19')](_0x123a33);}return _0x5ee78c['status'](_0x123a33)['end']();};}function respondWithResult(_0xe75812,_0x5010cd){_0x5010cd=_0x5010cd||0xc8;return function(_0x461281){if(_0x461281){return _0xe75812[_0x61b9('0x1a')](_0x5010cd)[_0x61b9('0x1b')](_0x461281);}};}function respondWithFilteredResult(_0x2deb02,_0x33ca60){return function(_0x151d68){if(_0x151d68){var _0x2a4ae0=typeof _0x33ca60[_0x61b9('0x1c')]===_0x61b9('0x1d')&&typeof _0x33ca60['limit']===_0x61b9('0x1d');var _0x193f0c=_0x151d68[_0x61b9('0x1e')];var _0x4f5b3a=_0x2a4ae0?0x0:_0x33ca60[_0x61b9('0x1c')];var _0x2438dd=_0x2a4ae0?_0x151d68['count']:_0x33ca60[_0x61b9('0x1c')]+_0x33ca60[_0x61b9('0x1f')];var _0x8426c;if(_0x2438dd>=_0x193f0c){_0x2438dd=_0x193f0c;_0x8426c=0xc8;}else{_0x8426c=0xce;}_0x2deb02[_0x61b9('0x1a')](_0x8426c);return _0x2deb02[_0x61b9('0x20')](_0x61b9('0x21'),_0x4f5b3a+'-'+_0x2438dd+'/'+_0x193f0c)[_0x61b9('0x1b')](_0x151d68);}return null;};}function patchUpdates(_0x37e5e5){return function(_0x4a9663){try{jsonpatch[_0x61b9('0x22')](_0x4a9663,_0x37e5e5,!![]);}catch(_0x137fab){return BPromise[_0x61b9('0x23')](_0x137fab);}return _0x4a9663['save']();};}function saveUpdates(_0x376309,_0x372969){return function(_0x3b0779){if(_0x3b0779){return _0x3b0779[_0x61b9('0x24')](_0x376309)[_0x61b9('0x25')](function(_0x3acd2d){return _0x3acd2d;});}return null;};}function removeEntity(_0x5f4915,_0x5180d9){return function(_0x217410){if(_0x217410){return _0x217410[_0x61b9('0x26')]()[_0x61b9('0x25')](function(){_0x5f4915[_0x61b9('0x1a')](0xcc)[_0x61b9('0x27')]();});}};}function handleEntityNotFound(_0x169490,_0x24a4d8){return function(_0x41d49c){if(!_0x41d49c){_0x169490[_0x61b9('0x19')](0x194);}return _0x41d49c;};}function handleError(_0x24974b,_0x3a9654){_0x3a9654=_0x3a9654||0x1f4;return function(_0x2e24d6){logger[_0x61b9('0x28')](_0x2e24d6[_0x61b9('0x29')]);if(_0x2e24d6[_0x61b9('0x2a')]){delete _0x2e24d6[_0x61b9('0x2a')];}_0x24974b['status'](_0x3a9654)[_0x61b9('0x2b')](_0x2e24d6);};}exports[_0x61b9('0x2c')]=function(_0x28265d,_0x17b012){var _0x14ba0b={},_0x366c15={},_0x23e2d1={'count':0x0,'rows':[]};var _0x3f9256=_[_0x61b9('0x2d')](db[_0x61b9('0x2e')]['rawAttributes'],function(_0x5deb42){return{'name':_0x5deb42[_0x61b9('0x2f')],'type':_0x5deb42[_0x61b9('0x30')][_0x61b9('0x31')]};});_0x366c15['model']=_[_0x61b9('0x2d')](_0x3f9256,_0x61b9('0x2a'));_0x366c15[_0x61b9('0x32')]=_[_0x61b9('0x33')](_0x28265d[_0x61b9('0x32')]);_0x366c15[_0x61b9('0x34')]=_[_0x61b9('0x35')](_0x366c15[_0x61b9('0x36')],_0x366c15['query']);_0x14ba0b[_0x61b9('0x37')]=_[_0x61b9('0x35')](_0x366c15[_0x61b9('0x36')],qs[_0x61b9('0x38')](_0x28265d[_0x61b9('0x32')][_0x61b9('0x38')]));_0x14ba0b[_0x61b9('0x37')]=_0x14ba0b['attributes'][_0x61b9('0x39')]?_0x14ba0b[_0x61b9('0x37')]:_0x366c15['model'];if(!_0x28265d[_0x61b9('0x32')]['hasOwnProperty'](_0x61b9('0x3a'))){_0x14ba0b[_0x61b9('0x1f')]=qs['limit'](_0x28265d[_0x61b9('0x32')][_0x61b9('0x1f')]);_0x14ba0b[_0x61b9('0x1c')]=qs['offset'](_0x28265d['query'][_0x61b9('0x1c')]);}_0x14ba0b[_0x61b9('0x3b')]=qs[_0x61b9('0x3c')](_0x28265d[_0x61b9('0x32')][_0x61b9('0x3c')]);_0x14ba0b[_0x61b9('0x3d')]=qs[_0x61b9('0x34')](_[_0x61b9('0x3e')](_0x28265d[_0x61b9('0x32')],_0x366c15[_0x61b9('0x34')]),_0x3f9256);if(_0x28265d[_0x61b9('0x32')][_0x61b9('0x3f')]){_0x14ba0b[_0x61b9('0x3d')]=_['merge'](_0x14ba0b[_0x61b9('0x3d')],{'$or':_['map'](_0x3f9256,function(_0x15a965){if(_0x15a965['type']!=='VIRTUAL'){var _0x285436={};_0x285436[_0x15a965[_0x61b9('0x2a')]]={'$like':'%'+_0x28265d['query'][_0x61b9('0x3f')]+'%'};return _0x285436;}})});}_0x14ba0b=_[_0x61b9('0x40')]({},_0x14ba0b,_0x28265d[_0x61b9('0x41')]);var _0x356039={'where':_0x14ba0b[_0x61b9('0x3d')]};return db['FreshdeskConfiguration'][_0x61b9('0x1e')](_0x356039)[_0x61b9('0x25')](function(_0xc6ed5c){_0x23e2d1[_0x61b9('0x1e')]=_0xc6ed5c;if(_0x28265d[_0x61b9('0x32')][_0x61b9('0x42')]){_0x14ba0b['include']=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x61b9('0x43')](_0x14ba0b);})[_0x61b9('0x25')](function(_0x4dfa15){_0x23e2d1[_0x61b9('0x44')]=_0x4dfa15;return _0x23e2d1;})[_0x61b9('0x25')](respondWithFilteredResult(_0x17b012,_0x14ba0b))['catch'](handleError(_0x17b012,null));};exports['show']=function(_0x2576f2,_0x4d5381){var _0x225322={'raw':![],'where':{'id':_0x2576f2[_0x61b9('0x45')]['id']}},_0x2bb97c={};_0x2bb97c[_0x61b9('0x36')]=_[_0x61b9('0x33')](db['FreshdeskConfiguration'][_0x61b9('0x46')]);_0x2bb97c['query']=_['keys'](_0x2576f2['query']);_0x2bb97c['filters']=_[_0x61b9('0x35')](_0x2bb97c[_0x61b9('0x36')],_0x2bb97c['query']);_0x225322[_0x61b9('0x37')]=_[_0x61b9('0x35')](_0x2bb97c[_0x61b9('0x36')],qs[_0x61b9('0x38')](_0x2576f2['query'][_0x61b9('0x38')]));_0x225322[_0x61b9('0x37')]=_0x225322[_0x61b9('0x37')]['length']?_0x225322['attributes']:_0x2bb97c[_0x61b9('0x36')];if(_0x2576f2[_0x61b9('0x32')][_0x61b9('0x42')]){_0x225322[_0x61b9('0x47')]=[{'all':!![]}];}_0x225322=_[_0x61b9('0x40')]({},_0x225322,_0x2576f2[_0x61b9('0x41')]);return db['FreshdeskConfiguration'][_0x61b9('0x48')](_0x225322)[_0x61b9('0x25')](handleEntityNotFound(_0x4d5381,null))[_0x61b9('0x25')](respondWithResult(_0x4d5381,null))[_0x61b9('0x49')](handleError(_0x4d5381,null));};exports[_0x61b9('0x4a')]=function(_0xe4ddb0,_0x7691c){return db[_0x61b9('0x2e')][_0x61b9('0x4a')](_0xe4ddb0[_0x61b9('0x4b')],{})[_0x61b9('0x25')](respondWithResult(_0x7691c,0xc9))['catch'](handleError(_0x7691c,null));};exports[_0x61b9('0x24')]=function(_0x15e499,_0xa617d5){if(_0x15e499[_0x61b9('0x4b')]['id']){delete _0x15e499['body']['id'];}return db['FreshdeskConfiguration'][_0x61b9('0x48')]({'where':{'id':_0x15e499[_0x61b9('0x45')]['id']}})[_0x61b9('0x25')](handleEntityNotFound(_0xa617d5,null))['then'](saveUpdates(_0x15e499[_0x61b9('0x4b')],null))[_0x61b9('0x25')](respondWithResult(_0xa617d5,null))[_0x61b9('0x49')](handleError(_0xa617d5,null));};exports[_0x61b9('0x26')]=function(_0x1c2365,_0x22a226){return db[_0x61b9('0x2e')][_0x61b9('0x48')]({'where':{'id':_0x1c2365[_0x61b9('0x45')]['id']}})[_0x61b9('0x25')](handleEntityNotFound(_0x22a226,null))[_0x61b9('0x25')](removeEntity(_0x22a226,null))[_0x61b9('0x49')](handleError(_0x22a226,null));};exports[_0x61b9('0x4c')]=function(_0x158463,_0x4b8e28,_0xf9cbde){var _0x5b5f3c={};var _0x2ae693={};var _0x56a277;var _0x59c276;return db[_0x61b9('0x2e')]['findOne']({'where':{'id':_0x158463[_0x61b9('0x45')]['id']}})[_0x61b9('0x25')](handleEntityNotFound(_0x4b8e28,null))[_0x61b9('0x25')](function(_0x5a4d99){if(_0x5a4d99){_0x56a277=_0x5a4d99;_0x2ae693['model']=_[_0x61b9('0x33')](db['FreshdeskField'][_0x61b9('0x46')]);_0x2ae693[_0x61b9('0x32')]=_['keys'](_0x158463[_0x61b9('0x32')]);_0x2ae693['filters']=_[_0x61b9('0x35')](_0x2ae693[_0x61b9('0x36')],_0x2ae693[_0x61b9('0x32')]);_0x5b5f3c[_0x61b9('0x37')]=_[_0x61b9('0x35')](_0x2ae693[_0x61b9('0x36')],qs[_0x61b9('0x38')](_0x158463[_0x61b9('0x32')][_0x61b9('0x38')]));_0x5b5f3c[_0x61b9('0x37')]=_0x5b5f3c[_0x61b9('0x37')][_0x61b9('0x39')]?_0x5b5f3c[_0x61b9('0x37')]:_0x2ae693[_0x61b9('0x36')];_0x5b5f3c[_0x61b9('0x3b')]=qs[_0x61b9('0x3c')](_0x158463[_0x61b9('0x32')][_0x61b9('0x3c')]);_0x5b5f3c['where']=qs[_0x61b9('0x34')](_[_0x61b9('0x3e')](_0x158463[_0x61b9('0x32')],_0x2ae693['filters']));if(_0x158463[_0x61b9('0x32')]['filter']){_0x5b5f3c['where']=_[_0x61b9('0x40')](_0x5b5f3c['where'],{'$or':_[_0x61b9('0x2d')](_0x5b5f3c[_0x61b9('0x37')],function(_0x584fad){var _0x546397={};_0x546397[_0x584fad]={'$like':'%'+_0x158463['query'][_0x61b9('0x3f')]+'%'};return _0x546397;})});}_0x5b5f3c=_[_0x61b9('0x40')]({},_0x5b5f3c,_0x158463[_0x61b9('0x41')]);return _0x56a277[_0x61b9('0x4c')](_0x5b5f3c);}})[_0x61b9('0x25')](function(_0x4a215e){if(_0x4a215e){_0x59c276=_0x4a215e[_0x61b9('0x39')];if(!_0x158463[_0x61b9('0x32')][_0x61b9('0x4d')](_0x61b9('0x3a'))){_0x5b5f3c['limit']=qs[_0x61b9('0x1f')](_0x158463['query']['limit']);_0x5b5f3c[_0x61b9('0x1c')]=qs[_0x61b9('0x1c')](_0x158463['query']['offset']);}return _0x56a277[_0x61b9('0x4c')](_0x5b5f3c);}})[_0x61b9('0x25')](function(_0x14cde6){if(_0x14cde6){return _0x14cde6?{'count':_0x59c276,'rows':_0x14cde6}:null;}})[_0x61b9('0x25')](respondWithResult(_0x4b8e28,null))['catch'](handleError(_0x4b8e28,null));};exports[_0x61b9('0x4e')]=function(_0x24f5b8,_0x36f35e,_0x5eba83){var _0x32a903={};var _0x1d94ed={};var _0x1e7869;var _0x69f717;return db[_0x61b9('0x2e')]['findOne']({'where':{'id':_0x24f5b8[_0x61b9('0x45')]['id']}})['then'](handleEntityNotFound(_0x36f35e,null))['then'](function(_0xeba21e){if(_0xeba21e){_0x1e7869=_0xeba21e;_0x1d94ed[_0x61b9('0x36')]=_['keys'](db[_0x61b9('0x4f')][_0x61b9('0x46')]);_0x1d94ed[_0x61b9('0x32')]=_[_0x61b9('0x33')](_0x24f5b8[_0x61b9('0x32')]);_0x1d94ed[_0x61b9('0x34')]=_[_0x61b9('0x35')](_0x1d94ed[_0x61b9('0x36')],_0x1d94ed[_0x61b9('0x32')]);_0x32a903[_0x61b9('0x37')]=_[_0x61b9('0x35')](_0x1d94ed[_0x61b9('0x36')],qs[_0x61b9('0x38')](_0x24f5b8[_0x61b9('0x32')][_0x61b9('0x38')]));_0x32a903['attributes']=_0x32a903[_0x61b9('0x37')]['length']?_0x32a903[_0x61b9('0x37')]:_0x1d94ed['model'];_0x32a903[_0x61b9('0x3b')]=qs[_0x61b9('0x3c')](_0x24f5b8[_0x61b9('0x32')][_0x61b9('0x3c')]);_0x32a903[_0x61b9('0x3d')]=qs[_0x61b9('0x34')](_[_0x61b9('0x3e')](_0x24f5b8[_0x61b9('0x32')],_0x1d94ed[_0x61b9('0x34')]));if(_0x24f5b8[_0x61b9('0x32')]['filter']){_0x32a903[_0x61b9('0x3d')]=_['merge'](_0x32a903['where'],{'$or':_['map'](_0x32a903[_0x61b9('0x37')],function(_0xe085b5){var _0x43f391={};_0x43f391[_0xe085b5]={'$like':'%'+_0x24f5b8[_0x61b9('0x32')][_0x61b9('0x3f')]+'%'};return _0x43f391;})});}_0x32a903=_[_0x61b9('0x40')]({},_0x32a903,_0x24f5b8[_0x61b9('0x41')]);return _0x1e7869[_0x61b9('0x4e')](_0x32a903);}})[_0x61b9('0x25')](function(_0x7ec941){if(_0x7ec941){_0x69f717=_0x7ec941[_0x61b9('0x39')];if(!_0x24f5b8[_0x61b9('0x32')][_0x61b9('0x4d')](_0x61b9('0x3a'))){_0x32a903[_0x61b9('0x1f')]=qs[_0x61b9('0x1f')](_0x24f5b8['query'][_0x61b9('0x1f')]);_0x32a903['offset']=qs[_0x61b9('0x1c')](_0x24f5b8[_0x61b9('0x32')][_0x61b9('0x1c')]);}return _0x1e7869['getSubjects'](_0x32a903);}})[_0x61b9('0x25')](function(_0x4ed91b){if(_0x4ed91b){return _0x4ed91b?{'count':_0x69f717,'rows':_0x4ed91b}:null;}})[_0x61b9('0x25')](respondWithResult(_0x36f35e,null))['catch'](handleError(_0x36f35e,null));};exports[_0x61b9('0x50')]=function(_0x6af7ad,_0xfb2c30,_0x4b95e5){var _0x1d61d5={};var _0x4b5747={};var _0x4b5fd6;var _0x546be3;return db[_0x61b9('0x2e')][_0x61b9('0x51')]({'where':{'id':_0x6af7ad[_0x61b9('0x45')]['id']}})['then'](handleEntityNotFound(_0xfb2c30,null))[_0x61b9('0x25')](function(_0x4cfc55){if(_0x4cfc55){_0x4b5fd6=_0x4cfc55;_0x4b5747[_0x61b9('0x36')]=_[_0x61b9('0x33')](db['FreshdeskField'][_0x61b9('0x46')]);_0x4b5747[_0x61b9('0x32')]=_[_0x61b9('0x33')](_0x6af7ad[_0x61b9('0x32')]);_0x4b5747[_0x61b9('0x34')]=_[_0x61b9('0x35')](_0x4b5747[_0x61b9('0x36')],_0x4b5747[_0x61b9('0x32')]);_0x1d61d5[_0x61b9('0x37')]=_[_0x61b9('0x35')](_0x4b5747[_0x61b9('0x36')],qs[_0x61b9('0x38')](_0x6af7ad[_0x61b9('0x32')][_0x61b9('0x38')]));_0x1d61d5['attributes']=_0x1d61d5[_0x61b9('0x37')][_0x61b9('0x39')]?_0x1d61d5[_0x61b9('0x37')]:_0x4b5747[_0x61b9('0x36')];_0x1d61d5[_0x61b9('0x3b')]=qs[_0x61b9('0x3c')](_0x6af7ad[_0x61b9('0x32')][_0x61b9('0x3c')]);_0x1d61d5[_0x61b9('0x3d')]=qs['filters'](_[_0x61b9('0x3e')](_0x6af7ad['query'],_0x4b5747['filters']));if(_0x6af7ad[_0x61b9('0x32')]['filter']){_0x1d61d5[_0x61b9('0x3d')]=_[_0x61b9('0x40')](_0x1d61d5['where'],{'$or':_[_0x61b9('0x2d')](_0x1d61d5[_0x61b9('0x37')],function(_0x3e30b7){var _0x49a274={};_0x49a274[_0x3e30b7]={'$like':'%'+_0x6af7ad[_0x61b9('0x32')][_0x61b9('0x3f')]+'%'};return _0x49a274;})});}_0x1d61d5=_['merge']({},_0x1d61d5,_0x6af7ad[_0x61b9('0x41')]);return _0x4b5fd6['getDescriptions'](_0x1d61d5);}})['then'](function(_0x14fa82){if(_0x14fa82){_0x546be3=_0x14fa82[_0x61b9('0x39')];if(!_0x6af7ad['query']['hasOwnProperty']('nolimit')){_0x1d61d5[_0x61b9('0x1f')]=qs['limit'](_0x6af7ad['query'][_0x61b9('0x1f')]);_0x1d61d5['offset']=qs[_0x61b9('0x1c')](_0x6af7ad[_0x61b9('0x32')][_0x61b9('0x1c')]);}return _0x4b5fd6['getDescriptions'](_0x1d61d5);}})[_0x61b9('0x25')](function(_0x1014db){if(_0x1014db){return _0x1014db?{'count':_0x546be3,'rows':_0x1014db}:null;}})['then'](respondWithResult(_0xfb2c30,null))[_0x61b9('0x49')](handleError(_0xfb2c30,null));};exports[_0x61b9('0x52')]=function(_0x1dd402,_0x169c0c,_0x3b1b93){var _0x5cce94={};var _0x5f284f={};var _0x20ce30;var _0xd822f1;return db[_0x61b9('0x2e')][_0x61b9('0x51')]({'where':{'id':_0x1dd402[_0x61b9('0x45')]['id']}})[_0x61b9('0x25')](handleEntityNotFound(_0x169c0c,null))[_0x61b9('0x25')](function(_0x23a319){if(_0x23a319){_0x20ce30=_0x23a319;_0x5f284f['model']=_[_0x61b9('0x33')](db['Tag'][_0x61b9('0x46')]);_0x5f284f[_0x61b9('0x32')]=_[_0x61b9('0x33')](_0x1dd402[_0x61b9('0x32')]);_0x5f284f[_0x61b9('0x34')]=_[_0x61b9('0x35')](_0x5f284f[_0x61b9('0x36')],_0x5f284f[_0x61b9('0x32')]);_0x5cce94['attributes']=_['intersection'](_0x5f284f[_0x61b9('0x36')],qs['fields'](_0x1dd402[_0x61b9('0x32')][_0x61b9('0x38')]));_0x5cce94[_0x61b9('0x37')]=_0x5cce94['attributes'][_0x61b9('0x39')]?_0x5cce94[_0x61b9('0x37')]:_0x5f284f[_0x61b9('0x36')];_0x5cce94[_0x61b9('0x3b')]=qs['sort'](_0x1dd402[_0x61b9('0x32')][_0x61b9('0x3c')]);_0x5cce94[_0x61b9('0x3d')]=qs[_0x61b9('0x34')](_[_0x61b9('0x3e')](_0x1dd402[_0x61b9('0x32')],_0x5f284f[_0x61b9('0x34')]));if(_0x1dd402[_0x61b9('0x32')]['filter']){_0x5cce94['where']=_[_0x61b9('0x40')](_0x5cce94[_0x61b9('0x3d')],{'$or':_['map'](_0x5cce94[_0x61b9('0x37')],function(_0x54fd65){var _0x3c7975={};_0x3c7975[_0x54fd65]={'$like':'%'+_0x1dd402[_0x61b9('0x32')][_0x61b9('0x3f')]+'%'};return _0x3c7975;})});}_0x5cce94=_[_0x61b9('0x40')]({},_0x5cce94,_0x1dd402[_0x61b9('0x41')]);return _0x20ce30['getTags'](_0x5cce94);}})[_0x61b9('0x25')](function(_0x2bf890){if(_0x2bf890){_0xd822f1=_0x2bf890[_0x61b9('0x39')];if(!_0x1dd402[_0x61b9('0x32')][_0x61b9('0x4d')](_0x61b9('0x3a'))){_0x5cce94[_0x61b9('0x1f')]=qs[_0x61b9('0x1f')](_0x1dd402[_0x61b9('0x32')][_0x61b9('0x1f')]);_0x5cce94['offset']=qs[_0x61b9('0x1c')](_0x1dd402['query']['offset']);}return _0x20ce30['getTags'](_0x5cce94);}})['then'](function(_0x51731a){if(_0x51731a){return _0x51731a?{'count':_0xd822f1,'rows':_0x51731a}:null;}})[_0x61b9('0x25')](respondWithResult(_0x169c0c,null))[_0x61b9('0x49')](handleError(_0x169c0c,null));};exports[_0x61b9('0x53')]=function(_0x14b31d,_0x532d7b,_0x20b3c1){if(_0x14b31d[_0x61b9('0x4b')]['id']){delete _0x14b31d[_0x61b9('0x4b')]['id'];}return db[_0x61b9('0x2e')][_0x61b9('0x51')]({'where':{'id':_0x14b31d['params']['id']}})[_0x61b9('0x25')](handleEntityNotFound(_0x532d7b,null))[_0x61b9('0x25')](function(_0x39e469){if(_0x39e469){return _0x39e469[_0x61b9('0x53')](_0x14b31d['body'][_0x61b9('0x54')]||[]);}return null;})['then'](respondWithResult(_0x532d7b,null))['catch'](handleError(_0x532d7b,null));}; \ No newline at end of file +var _0x69a4=['FreshdeskField','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','name','send','map','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','FreshdeskConfiguration','includeAll','include','findAll','show','params','rawAttributes','intersection','find','catch','create','body','getFields'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x69a4,0xa9));var _0x469a=function(_0x1d3802,_0x3075bc){_0x1d3802=_0x1d3802-0x0;var _0x3175ca=_0x69a4[_0x1d3802];return _0x3175ca;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x469a('0x0'));var jsonpatch=require(_0x469a('0x1'));var rp=require(_0x469a('0x2'));var moment=require(_0x469a('0x3'));var BPromise=require(_0x469a('0x4'));var Mustache=require(_0x469a('0x5'));var util=require(_0x469a('0x6'));var path=require('path');var sox=require(_0x469a('0x7'));var csv=require(_0x469a('0x8'));var ejs=require(_0x469a('0x9'));var fs=require('fs');var fs_extra=require(_0x469a('0xa'));var _=require(_0x469a('0xb'));var squel=require(_0x469a('0xc'));var crypto=require('crypto');var jsforce=require(_0x469a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x469a('0x8'));var querystring=require(_0x469a('0xe'));var Papa=require(_0x469a('0xf'));var Redis=require(_0x469a('0x10'));var authService=require(_0x469a('0x11'));var qs=require(_0x469a('0x12'));var as=require(_0x469a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x469a('0x14'))(_0x469a('0x15'));var utils=require(_0x469a('0x16'));var config=require(_0x469a('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3053c4,_0x421889){_0x421889=_0x421889||0xcc;return function(_0x9c856){if(_0x9c856){return _0x3053c4[_0x469a('0x18')](_0x421889);}return _0x3053c4[_0x469a('0x19')](_0x421889)[_0x469a('0x1a')]();};}function respondWithResult(_0x447487,_0x493af2){_0x493af2=_0x493af2||0xc8;return function(_0x2cbe59){if(_0x2cbe59){return _0x447487[_0x469a('0x19')](_0x493af2)[_0x469a('0x1b')](_0x2cbe59);}};}function respondWithFilteredResult(_0x172641,_0x282afa){return function(_0x12b4f0){if(_0x12b4f0){var _0x25a084=typeof _0x282afa[_0x469a('0x1c')]===_0x469a('0x1d')&&typeof _0x282afa[_0x469a('0x1e')]===_0x469a('0x1d');var _0x2c0367=_0x12b4f0['count'];var _0x4a1c89=_0x25a084?0x0:_0x282afa[_0x469a('0x1c')];var _0x1d8f1d=_0x25a084?_0x12b4f0[_0x469a('0x1f')]:_0x282afa[_0x469a('0x1c')]+_0x282afa[_0x469a('0x1e')];var _0x9e4971;if(_0x1d8f1d>=_0x2c0367){_0x1d8f1d=_0x2c0367;_0x9e4971=0xc8;}else{_0x9e4971=0xce;}_0x172641[_0x469a('0x19')](_0x9e4971);return _0x172641['set']('Content-Range',_0x4a1c89+'-'+_0x1d8f1d+'/'+_0x2c0367)[_0x469a('0x1b')](_0x12b4f0);}return null;};}function patchUpdates(_0x5ab1d4){return function(_0x351f55){try{jsonpatch[_0x469a('0x20')](_0x351f55,_0x5ab1d4,!![]);}catch(_0x2ca21c){return BPromise['reject'](_0x2ca21c);}return _0x351f55[_0x469a('0x21')]();};}function saveUpdates(_0x5b77b1,_0x5cdb1a){return function(_0x3179a8){if(_0x3179a8){return _0x3179a8[_0x469a('0x22')](_0x5b77b1)[_0x469a('0x23')](function(_0x5022fd){return _0x5022fd;});}return null;};}function removeEntity(_0x2b1df4,_0x372cc8){return function(_0x453549){if(_0x453549){return _0x453549[_0x469a('0x24')]()[_0x469a('0x23')](function(){_0x2b1df4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf92819,_0x2d3893){return function(_0x1cc298){if(!_0x1cc298){_0xf92819['sendStatus'](0x194);}return _0x1cc298;};}function handleError(_0x443bd9,_0x342078){_0x342078=_0x342078||0x1f4;return function(_0x44ebb2){logger[_0x469a('0x25')](_0x44ebb2[_0x469a('0x26')]);if(_0x44ebb2['name']){delete _0x44ebb2[_0x469a('0x27')];}_0x443bd9['status'](_0x342078)[_0x469a('0x28')](_0x44ebb2);};}exports['index']=function(_0x2e80f2,_0x521b94){var _0x3a0917={},_0x3b280d={},_0x342afb={'count':0x0,'rows':[]};var _0x7b9f06=_[_0x469a('0x29')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x379eff){return{'name':_0x379eff['fieldName'],'type':_0x379eff[_0x469a('0x2a')][_0x469a('0x2b')]};});_0x3b280d[_0x469a('0x2c')]=_['map'](_0x7b9f06,_0x469a('0x27'));_0x3b280d[_0x469a('0x2d')]=_[_0x469a('0x2e')](_0x2e80f2[_0x469a('0x2d')]);_0x3b280d[_0x469a('0x2f')]=_['intersection'](_0x3b280d[_0x469a('0x2c')],_0x3b280d[_0x469a('0x2d')]);_0x3a0917[_0x469a('0x30')]=_['intersection'](_0x3b280d['model'],qs[_0x469a('0x31')](_0x2e80f2[_0x469a('0x2d')][_0x469a('0x31')]));_0x3a0917[_0x469a('0x30')]=_0x3a0917[_0x469a('0x30')][_0x469a('0x32')]?_0x3a0917['attributes']:_0x3b280d['model'];if(!_0x2e80f2[_0x469a('0x2d')][_0x469a('0x33')](_0x469a('0x34'))){_0x3a0917['limit']=qs[_0x469a('0x1e')](_0x2e80f2[_0x469a('0x2d')][_0x469a('0x1e')]);_0x3a0917['offset']=qs[_0x469a('0x1c')](_0x2e80f2[_0x469a('0x2d')][_0x469a('0x1c')]);}_0x3a0917[_0x469a('0x35')]=qs[_0x469a('0x36')](_0x2e80f2[_0x469a('0x2d')][_0x469a('0x36')]);_0x3a0917[_0x469a('0x37')]=qs[_0x469a('0x2f')](_[_0x469a('0x38')](_0x2e80f2[_0x469a('0x2d')],_0x3b280d['filters']),_0x7b9f06);if(_0x2e80f2[_0x469a('0x2d')]['filter']){_0x3a0917[_0x469a('0x37')]=_[_0x469a('0x39')](_0x3a0917['where'],{'$or':_[_0x469a('0x29')](_0x7b9f06,function(_0x36270c){if(_0x36270c[_0x469a('0x2a')]!==_0x469a('0x3a')){var _0xf383e2={};_0xf383e2[_0x36270c[_0x469a('0x27')]]={'$like':'%'+_0x2e80f2['query'][_0x469a('0x3b')]+'%'};return _0xf383e2;}})});}_0x3a0917=_[_0x469a('0x39')]({},_0x3a0917,_0x2e80f2[_0x469a('0x3c')]);var _0x500f96={'where':_0x3a0917[_0x469a('0x37')]};return db[_0x469a('0x3d')][_0x469a('0x1f')](_0x500f96)['then'](function(_0x1ac5b7){_0x342afb[_0x469a('0x1f')]=_0x1ac5b7;if(_0x2e80f2[_0x469a('0x2d')][_0x469a('0x3e')]){_0x3a0917[_0x469a('0x3f')]=[{'all':!![]}];}return db[_0x469a('0x3d')][_0x469a('0x40')](_0x3a0917);})['then'](function(_0x407ed2){_0x342afb['rows']=_0x407ed2;return _0x342afb;})[_0x469a('0x23')](respondWithFilteredResult(_0x521b94,_0x3a0917))['catch'](handleError(_0x521b94,null));};exports[_0x469a('0x41')]=function(_0x5ea74d,_0x20b73c){var _0x33c41d={'raw':![],'where':{'id':_0x5ea74d[_0x469a('0x42')]['id']}},_0x525a45={};_0x525a45[_0x469a('0x2c')]=_[_0x469a('0x2e')](db[_0x469a('0x3d')][_0x469a('0x43')]);_0x525a45[_0x469a('0x2d')]=_[_0x469a('0x2e')](_0x5ea74d[_0x469a('0x2d')]);_0x525a45[_0x469a('0x2f')]=_[_0x469a('0x44')](_0x525a45['model'],_0x525a45['query']);_0x33c41d['attributes']=_['intersection'](_0x525a45[_0x469a('0x2c')],qs[_0x469a('0x31')](_0x5ea74d['query']['fields']));_0x33c41d[_0x469a('0x30')]=_0x33c41d[_0x469a('0x30')][_0x469a('0x32')]?_0x33c41d[_0x469a('0x30')]:_0x525a45['model'];if(_0x5ea74d[_0x469a('0x2d')][_0x469a('0x3e')]){_0x33c41d[_0x469a('0x3f')]=[{'all':!![]}];}_0x33c41d=_[_0x469a('0x39')]({},_0x33c41d,_0x5ea74d['options']);return db[_0x469a('0x3d')][_0x469a('0x45')](_0x33c41d)['then'](handleEntityNotFound(_0x20b73c,null))['then'](respondWithResult(_0x20b73c,null))[_0x469a('0x46')](handleError(_0x20b73c,null));};exports['create']=function(_0x1f7817,_0xc3c775){return db[_0x469a('0x3d')][_0x469a('0x47')](_0x1f7817[_0x469a('0x48')],{})[_0x469a('0x23')](respondWithResult(_0xc3c775,0xc9))['catch'](handleError(_0xc3c775,null));};exports[_0x469a('0x22')]=function(_0x582880,_0x4f98d9){if(_0x582880['body']['id']){delete _0x582880[_0x469a('0x48')]['id'];}return db[_0x469a('0x3d')][_0x469a('0x45')]({'where':{'id':_0x582880[_0x469a('0x42')]['id']}})[_0x469a('0x23')](handleEntityNotFound(_0x4f98d9,null))[_0x469a('0x23')](saveUpdates(_0x582880[_0x469a('0x48')],null))['then'](respondWithResult(_0x4f98d9,null))[_0x469a('0x46')](handleError(_0x4f98d9,null));};exports[_0x469a('0x24')]=function(_0x310a35,_0x188837){return db[_0x469a('0x3d')][_0x469a('0x45')]({'where':{'id':_0x310a35['params']['id']}})[_0x469a('0x23')](handleEntityNotFound(_0x188837,null))[_0x469a('0x23')](removeEntity(_0x188837,null))[_0x469a('0x46')](handleError(_0x188837,null));};exports[_0x469a('0x49')]=function(_0x73150a,_0x25a3ee,_0x575471){var _0x1d3d8f={};var _0xaeb205={};var _0x3376c8;var _0x4f5d7f;return db[_0x469a('0x3d')]['findOne']({'where':{'id':_0x73150a[_0x469a('0x42')]['id']}})[_0x469a('0x23')](handleEntityNotFound(_0x25a3ee,null))[_0x469a('0x23')](function(_0x16dfd5){if(_0x16dfd5){_0x3376c8=_0x16dfd5;_0xaeb205[_0x469a('0x2c')]=_[_0x469a('0x2e')](db[_0x469a('0x4a')][_0x469a('0x43')]);_0xaeb205['query']=_[_0x469a('0x2e')](_0x73150a['query']);_0xaeb205[_0x469a('0x2f')]=_[_0x469a('0x44')](_0xaeb205[_0x469a('0x2c')],_0xaeb205[_0x469a('0x2d')]);_0x1d3d8f['attributes']=_[_0x469a('0x44')](_0xaeb205['model'],qs[_0x469a('0x31')](_0x73150a['query']['fields']));_0x1d3d8f[_0x469a('0x30')]=_0x1d3d8f[_0x469a('0x30')][_0x469a('0x32')]?_0x1d3d8f['attributes']:_0xaeb205[_0x469a('0x2c')];_0x1d3d8f['order']=qs[_0x469a('0x36')](_0x73150a['query'][_0x469a('0x36')]);_0x1d3d8f[_0x469a('0x37')]=qs['filters'](_['pick'](_0x73150a['query'],_0xaeb205[_0x469a('0x2f')]));if(_0x73150a[_0x469a('0x2d')][_0x469a('0x3b')]){_0x1d3d8f['where']=_[_0x469a('0x39')](_0x1d3d8f[_0x469a('0x37')],{'$or':_['map'](_0x1d3d8f[_0x469a('0x30')],function(_0x4d0550){var _0x313a84={};_0x313a84[_0x4d0550]={'$like':'%'+_0x73150a[_0x469a('0x2d')][_0x469a('0x3b')]+'%'};return _0x313a84;})});}_0x1d3d8f=_[_0x469a('0x39')]({},_0x1d3d8f,_0x73150a[_0x469a('0x3c')]);return _0x3376c8[_0x469a('0x49')](_0x1d3d8f);}})[_0x469a('0x23')](function(_0x157202){if(_0x157202){_0x4f5d7f=_0x157202[_0x469a('0x32')];if(!_0x73150a['query']['hasOwnProperty'](_0x469a('0x34'))){_0x1d3d8f['limit']=qs[_0x469a('0x1e')](_0x73150a[_0x469a('0x2d')][_0x469a('0x1e')]);_0x1d3d8f[_0x469a('0x1c')]=qs[_0x469a('0x1c')](_0x73150a[_0x469a('0x2d')][_0x469a('0x1c')]);}return _0x3376c8['getFields'](_0x1d3d8f);}})[_0x469a('0x23')](function(_0x492265){if(_0x492265){return _0x492265?{'count':_0x4f5d7f,'rows':_0x492265}:null;}})[_0x469a('0x23')](respondWithResult(_0x25a3ee,null))[_0x469a('0x46')](handleError(_0x25a3ee,null));};exports[_0x469a('0x4b')]=function(_0x2c856c,_0x56cefd,_0x43a66a){var _0x3979f6={};var _0x3be626={};var _0x57c472;var _0x25d30e;return db[_0x469a('0x3d')][_0x469a('0x4c')]({'where':{'id':_0x2c856c['params']['id']}})['then'](handleEntityNotFound(_0x56cefd,null))[_0x469a('0x23')](function(_0x4d053d){if(_0x4d053d){_0x57c472=_0x4d053d;_0x3be626[_0x469a('0x2c')]=_[_0x469a('0x2e')](db[_0x469a('0x4a')][_0x469a('0x43')]);_0x3be626[_0x469a('0x2d')]=_[_0x469a('0x2e')](_0x2c856c['query']);_0x3be626[_0x469a('0x2f')]=_[_0x469a('0x44')](_0x3be626[_0x469a('0x2c')],_0x3be626['query']);_0x3979f6[_0x469a('0x30')]=_[_0x469a('0x44')](_0x3be626[_0x469a('0x2c')],qs[_0x469a('0x31')](_0x2c856c[_0x469a('0x2d')][_0x469a('0x31')]));_0x3979f6[_0x469a('0x30')]=_0x3979f6[_0x469a('0x30')][_0x469a('0x32')]?_0x3979f6[_0x469a('0x30')]:_0x3be626[_0x469a('0x2c')];_0x3979f6[_0x469a('0x35')]=qs[_0x469a('0x36')](_0x2c856c[_0x469a('0x2d')][_0x469a('0x36')]);_0x3979f6[_0x469a('0x37')]=qs['filters'](_['pick'](_0x2c856c[_0x469a('0x2d')],_0x3be626['filters']));if(_0x2c856c[_0x469a('0x2d')][_0x469a('0x3b')]){_0x3979f6[_0x469a('0x37')]=_['merge'](_0x3979f6[_0x469a('0x37')],{'$or':_[_0x469a('0x29')](_0x3979f6[_0x469a('0x30')],function(_0x2c73e7){var _0x2bc7cb={};_0x2bc7cb[_0x2c73e7]={'$like':'%'+_0x2c856c['query'][_0x469a('0x3b')]+'%'};return _0x2bc7cb;})});}_0x3979f6=_['merge']({},_0x3979f6,_0x2c856c['options']);return _0x57c472[_0x469a('0x4b')](_0x3979f6);}})[_0x469a('0x23')](function(_0x4f982d){if(_0x4f982d){_0x25d30e=_0x4f982d[_0x469a('0x32')];if(!_0x2c856c[_0x469a('0x2d')][_0x469a('0x33')](_0x469a('0x34'))){_0x3979f6[_0x469a('0x1e')]=qs[_0x469a('0x1e')](_0x2c856c[_0x469a('0x2d')][_0x469a('0x1e')]);_0x3979f6[_0x469a('0x1c')]=qs['offset'](_0x2c856c[_0x469a('0x2d')]['offset']);}return _0x57c472[_0x469a('0x4b')](_0x3979f6);}})[_0x469a('0x23')](function(_0xc30456){if(_0xc30456){return _0xc30456?{'count':_0x25d30e,'rows':_0xc30456}:null;}})[_0x469a('0x23')](respondWithResult(_0x56cefd,null))[_0x469a('0x46')](handleError(_0x56cefd,null));};exports[_0x469a('0x4d')]=function(_0x5ba2b6,_0x479b7e,_0x50ce27){var _0x35b3de={};var _0x21d7ef={};var _0x3076d5;var _0x2d3b80;return db[_0x469a('0x3d')]['findOne']({'where':{'id':_0x5ba2b6[_0x469a('0x42')]['id']}})[_0x469a('0x23')](handleEntityNotFound(_0x479b7e,null))[_0x469a('0x23')](function(_0x6c7b0f){if(_0x6c7b0f){_0x3076d5=_0x6c7b0f;_0x21d7ef['model']=_[_0x469a('0x2e')](db[_0x469a('0x4a')][_0x469a('0x43')]);_0x21d7ef[_0x469a('0x2d')]=_[_0x469a('0x2e')](_0x5ba2b6[_0x469a('0x2d')]);_0x21d7ef[_0x469a('0x2f')]=_['intersection'](_0x21d7ef[_0x469a('0x2c')],_0x21d7ef[_0x469a('0x2d')]);_0x35b3de['attributes']=_[_0x469a('0x44')](_0x21d7ef[_0x469a('0x2c')],qs[_0x469a('0x31')](_0x5ba2b6[_0x469a('0x2d')][_0x469a('0x31')]));_0x35b3de[_0x469a('0x30')]=_0x35b3de[_0x469a('0x30')][_0x469a('0x32')]?_0x35b3de[_0x469a('0x30')]:_0x21d7ef['model'];_0x35b3de[_0x469a('0x35')]=qs[_0x469a('0x36')](_0x5ba2b6[_0x469a('0x2d')][_0x469a('0x36')]);_0x35b3de[_0x469a('0x37')]=qs['filters'](_[_0x469a('0x38')](_0x5ba2b6[_0x469a('0x2d')],_0x21d7ef[_0x469a('0x2f')]));if(_0x5ba2b6['query']['filter']){_0x35b3de['where']=_['merge'](_0x35b3de[_0x469a('0x37')],{'$or':_[_0x469a('0x29')](_0x35b3de[_0x469a('0x30')],function(_0x2cf71d){var _0x4b3499={};_0x4b3499[_0x2cf71d]={'$like':'%'+_0x5ba2b6['query'][_0x469a('0x3b')]+'%'};return _0x4b3499;})});}_0x35b3de=_[_0x469a('0x39')]({},_0x35b3de,_0x5ba2b6[_0x469a('0x3c')]);return _0x3076d5[_0x469a('0x4d')](_0x35b3de);}})[_0x469a('0x23')](function(_0x3b920f){if(_0x3b920f){_0x2d3b80=_0x3b920f[_0x469a('0x32')];if(!_0x5ba2b6['query'][_0x469a('0x33')]('nolimit')){_0x35b3de[_0x469a('0x1e')]=qs[_0x469a('0x1e')](_0x5ba2b6[_0x469a('0x2d')][_0x469a('0x1e')]);_0x35b3de[_0x469a('0x1c')]=qs[_0x469a('0x1c')](_0x5ba2b6[_0x469a('0x2d')]['offset']);}return _0x3076d5[_0x469a('0x4d')](_0x35b3de);}})[_0x469a('0x23')](function(_0x3fb62f){if(_0x3fb62f){return _0x3fb62f?{'count':_0x2d3b80,'rows':_0x3fb62f}:null;}})[_0x469a('0x23')](respondWithResult(_0x479b7e,null))[_0x469a('0x46')](handleError(_0x479b7e,null));};exports[_0x469a('0x4e')]=function(_0x432fb0,_0x4bce59,_0x4505c0){var _0x2d84cf={};var _0x318e7d={};var _0x33ef3f;var _0x43c19b;return db[_0x469a('0x3d')][_0x469a('0x4c')]({'where':{'id':_0x432fb0[_0x469a('0x42')]['id']}})['then'](handleEntityNotFound(_0x4bce59,null))[_0x469a('0x23')](function(_0x4924c5){if(_0x4924c5){_0x33ef3f=_0x4924c5;_0x318e7d['model']=_[_0x469a('0x2e')](db[_0x469a('0x4f')][_0x469a('0x43')]);_0x318e7d[_0x469a('0x2d')]=_[_0x469a('0x2e')](_0x432fb0[_0x469a('0x2d')]);_0x318e7d[_0x469a('0x2f')]=_[_0x469a('0x44')](_0x318e7d[_0x469a('0x2c')],_0x318e7d[_0x469a('0x2d')]);_0x2d84cf[_0x469a('0x30')]=_[_0x469a('0x44')](_0x318e7d['model'],qs['fields'](_0x432fb0[_0x469a('0x2d')][_0x469a('0x31')]));_0x2d84cf[_0x469a('0x30')]=_0x2d84cf[_0x469a('0x30')][_0x469a('0x32')]?_0x2d84cf[_0x469a('0x30')]:_0x318e7d[_0x469a('0x2c')];_0x2d84cf['order']=qs[_0x469a('0x36')](_0x432fb0['query']['sort']);_0x2d84cf['where']=qs[_0x469a('0x2f')](_['pick'](_0x432fb0[_0x469a('0x2d')],_0x318e7d[_0x469a('0x2f')]));if(_0x432fb0[_0x469a('0x2d')]['filter']){_0x2d84cf[_0x469a('0x37')]=_[_0x469a('0x39')](_0x2d84cf[_0x469a('0x37')],{'$or':_[_0x469a('0x29')](_0x2d84cf[_0x469a('0x30')],function(_0xfc9789){var _0x4c86a1={};_0x4c86a1[_0xfc9789]={'$like':'%'+_0x432fb0[_0x469a('0x2d')][_0x469a('0x3b')]+'%'};return _0x4c86a1;})});}_0x2d84cf=_[_0x469a('0x39')]({},_0x2d84cf,_0x432fb0['options']);return _0x33ef3f[_0x469a('0x4e')](_0x2d84cf);}})[_0x469a('0x23')](function(_0x2e866c){if(_0x2e866c){_0x43c19b=_0x2e866c['length'];if(!_0x432fb0[_0x469a('0x2d')][_0x469a('0x33')](_0x469a('0x34'))){_0x2d84cf[_0x469a('0x1e')]=qs['limit'](_0x432fb0['query'][_0x469a('0x1e')]);_0x2d84cf[_0x469a('0x1c')]=qs[_0x469a('0x1c')](_0x432fb0[_0x469a('0x2d')][_0x469a('0x1c')]);}return _0x33ef3f['getTags'](_0x2d84cf);}})[_0x469a('0x23')](function(_0x525596){if(_0x525596){return _0x525596?{'count':_0x43c19b,'rows':_0x525596}:null;}})[_0x469a('0x23')](respondWithResult(_0x4bce59,null))[_0x469a('0x46')](handleError(_0x4bce59,null));};exports[_0x469a('0x50')]=function(_0x5aac3e,_0x3cf04a,_0x5262cb){if(_0x5aac3e[_0x469a('0x48')]['id']){delete _0x5aac3e['body']['id'];}return db[_0x469a('0x3d')][_0x469a('0x4c')]({'where':{'id':_0x5aac3e[_0x469a('0x42')]['id']}})[_0x469a('0x23')](handleEntityNotFound(_0x3cf04a,null))['then'](function(_0x218c52){if(_0x218c52){return _0x218c52[_0x469a('0x50')](_0x5aac3e[_0x469a('0x48')]['ids']||[]);}return null;})['then'](respondWithResult(_0x3cf04a,null))['catch'](handleError(_0x3cf04a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 909ba33..98ab583 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 _0xc5df=['int_freshdesk_configurations','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration'];(function(_0x573026,_0x9fe267){var _0x2b669e=function(_0xf4421d){while(--_0xf4421d){_0x573026['push'](_0x573026['shift']());}};_0x2b669e(++_0x9fe267);}(_0xc5df,0xbc));var _0xfc5d=function(_0x1c86ce,_0x469440){_0x1c86ce=_0x1c86ce-0x0;var _0x195fd4=_0xc5df[_0x1c86ce];return _0x195fd4;};'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('path');var rimraf=require('rimraf');var config=require(_0xfc5d('0x6'));var attributes=require(_0xfc5d('0x7'));module[_0xfc5d('0x8')]=function(_0x3c0193,_0x5f5c2d){return _0x3c0193['define'](_0xfc5d('0x9'),attributes,{'tableName':_0xfc5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x813a=['define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0x813a,0x1e3));var _0xa813=function(_0xca599a,_0x207dda){_0xca599a=_0xca599a-0x0;var _0x398718=_0x813a[_0xca599a];return _0x398718;};'use strict';var _=require(_0xa813('0x0'));var util=require(_0xa813('0x1'));var logger=require(_0xa813('0x2'))(_0xa813('0x3'));var moment=require(_0xa813('0x4'));var BPromise=require('bluebird');var rp=require(_0xa813('0x5'));var fs=require('fs');var path=require(_0xa813('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x52844f,_0x48cdda){return _0x52844f[_0xa813('0x7')](_0xa813('0x8'),attributes,{'tableName':_0xa813('0x9'),'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 c5bc25f..4ced8a3 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 _0x8950=['http','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x2cb480,_0x220dcd){var _0x2a9d61=function(_0x1454ab){while(--_0x1454ab){_0x2cb480['push'](_0x2cb480['shift']());}};_0x2a9d61(++_0x220dcd);}(_0x8950,0x70));var _0x0895=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8950[_0x432682];return _0x463d05;};'use strict';var _=require(_0x0895('0x0'));var util=require('util');var moment=require(_0x0895('0x1'));var BPromise=require(_0x0895('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0895('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0895('0x4'))(_0x0895('0x5'));var config=require(_0x0895('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0895('0x7')][_0x0895('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bc6d6,_0x3a4c84,_0x351561){return new BPromise(function(_0xb5f690,_0x2b67c9){return client['request'](_0x1bc6d6,_0x351561)[_0x0895('0x9')](function(_0x542fb3){logger[_0x0895('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a4c84,_0x0895('0xb'));logger[_0x0895('0xc')](_0x0895('0xd'),_0x3a4c84,_0x0895('0xb'),JSON[_0x0895('0xe')](_0x542fb3));if(_0x542fb3[_0x0895('0xf')]){if(_0x542fb3['error']['code']===0x1f4){logger[_0x0895('0xf')](_0x0895('0x10'),_0x3a4c84,_0x542fb3[_0x0895('0xf')][_0x0895('0x11')]);return _0x2b67c9(_0x542fb3['error']['message']);}logger[_0x0895('0xf')](_0x0895('0x10'),_0x3a4c84,_0x542fb3[_0x0895('0xf')][_0x0895('0x11')]);return _0xb5f690(_0x542fb3[_0x0895('0xf')]['message']);}else{logger[_0x0895('0xa')](_0x0895('0x10'),_0x3a4c84,_0x0895('0xb'));_0xb5f690(_0x542fb3[_0x0895('0x12')]['message']);}})[_0x0895('0x13')](function(_0x1dbc76){logger[_0x0895('0xf')](_0x0895('0x10'),_0x3a4c84,_0x1dbc76);_0x2b67c9(_0x1dbc76);});});} \ No newline at end of file +var _0x729f=['FreshdeskConfiguration,\x20%s,\x20%s','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x428e2e,_0x439bf4){var _0x337941=function(_0x131536){while(--_0x131536){_0x428e2e['push'](_0x428e2e['shift']());}};_0x337941(++_0x439bf4);}(_0x729f,0xd9));var _0xf729=function(_0x4624dc,_0x2d47e2){_0x4624dc=_0x4624dc-0x0;var _0x230719=_0x729f[_0x4624dc];return _0x230719;};'use strict';var _=require('lodash');var util=require(_0xf729('0x0'));var moment=require(_0xf729('0x1'));var BPromise=require(_0xf729('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf729('0x3'));var db=require(_0xf729('0x4'))['db'];var utils=require(_0xf729('0x5'));var logger=require(_0xf729('0x6'))(_0xf729('0x7'));var config=require('../../config/environment');var jayson=require(_0xf729('0x8'));var client=jayson[_0xf729('0x9')][_0xf729('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x314071,_0x3ec3d5,_0x5560f1){return new BPromise(function(_0xea17c7,_0x592339){return client[_0xf729('0xb')](_0x314071,_0x5560f1)[_0xf729('0xc')](function(_0x450622){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3ec3d5,'request\x20sent');logger[_0xf729('0xd')](_0xf729('0xe'),_0x3ec3d5,_0xf729('0xf'),JSON[_0xf729('0x10')](_0x450622));if(_0x450622[_0xf729('0x11')]){if(_0x450622[_0xf729('0x11')][_0xf729('0x12')]===0x1f4){logger[_0xf729('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3ec3d5,_0x450622[_0xf729('0x11')][_0xf729('0x13')]);return _0x592339(_0x450622['error'][_0xf729('0x13')]);}logger[_0xf729('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3ec3d5,_0x450622[_0xf729('0x11')]['message']);return _0xea17c7(_0x450622['error'][_0xf729('0x13')]);}else{logger[_0xf729('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3ec3d5,_0xf729('0xf'));_0xea17c7(_0x450622[_0xf729('0x15')][_0xf729('0x13')]);}})[_0xf729('0x16')](function(_0x135124){logger[_0xf729('0x11')](_0xf729('0x17'),_0x3ec3d5,_0x135124);_0x592339(_0x135124);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index bfae7ac..41cfc3a 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 _0xaf97=['isAuthenticated','put','update','delete','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','index','get','/:id','show','post'];(function(_0x4f1b76,_0x5ea1e1){var _0x10df51=function(_0x19d95b){while(--_0x19d95b){_0x4f1b76['push'](_0x4f1b76['shift']());}};_0x10df51(++_0x5ea1e1);}(_0xaf97,0xd5));var _0x7af9=function(_0x50be32,_0x5afc3e){_0x50be32=_0x50be32-0x0;var _0x31764c=_0xaf97[_0x50be32];return _0x31764c;};'use strict';var multer=require(_0x7af9('0x0'));var util=require('util');var path=require(_0x7af9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7af9('0x2'));var interaction=require(_0x7af9('0x3'));var config=require(_0x7af9('0x4'));var controller=require(_0x7af9('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x7af9('0x6')]);router[_0x7af9('0x7')](_0x7af9('0x8'),auth['isAuthenticated'](),controller[_0x7af9('0x9')]);router[_0x7af9('0xa')]('/',auth[_0x7af9('0xb')](),controller['create']);router[_0x7af9('0xc')](_0x7af9('0x8'),auth[_0x7af9('0xb')](),controller[_0x7af9('0xd')]);router[_0x7af9('0xe')](_0x7af9('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x7af9('0xf')]=router; \ No newline at end of file +var _0x5db6=['isAuthenticated','index','get','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0x5284c3,_0x26667f){var _0x4b564a=function(_0xade36d){while(--_0xade36d){_0x5284c3['push'](_0x5284c3['shift']());}};_0x4b564a(++_0x26667f);}(_0x5db6,0x1ae));var _0x65db=function(_0x44b585,_0x120e48){_0x44b585=_0x44b585-0x0;var _0x38dd43=_0x5db6[_0x44b585];return _0x38dd43;};'use strict';var multer=require(_0x65db('0x0'));var util=require(_0x65db('0x1'));var path=require(_0x65db('0x2'));var timeout=require(_0x65db('0x3'));var express=require(_0x65db('0x4'));var router=express[_0x65db('0x5')]();var fs_extra=require(_0x65db('0x6'));var auth=require(_0x65db('0x7'));var interaction=require(_0x65db('0x8'));var config=require(_0x65db('0x9'));var controller=require(_0x65db('0xa'));router['get']('/',auth[_0x65db('0xb')](),controller[_0x65db('0xc')]);router[_0x65db('0xd')](_0x65db('0xe'),auth[_0x65db('0xb')](),controller['show']);router[_0x65db('0xf')]('/',auth[_0x65db('0xb')](),controller[_0x65db('0x10')]);router[_0x65db('0x11')](_0x65db('0xe'),auth['isAuthenticated'](),controller[_0x65db('0x12')]);router['delete'](_0x65db('0xe'),auth[_0x65db('0xb')](),controller[_0x65db('0x13')]);module[_0x65db('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index e77036f..be3b054 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 _0xf901=['customVariable','BOOLEAN','string','variable','keyValue','picklist','STRING','ENUM'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xf901,0x16a));var _0x1f90=function(_0x37347b,_0x410c5a){_0x37347b=_0x37347b-0x0;var _0x4bf596=_0xf901[_0x37347b];return _0x4bf596;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x1f90('0x0'),_0x1f90('0x1'),'customVariable',_0x1f90('0x2'),_0x1f90('0x3')),'defaultValue':_0x1f90('0x0')},'content':{'type':Sequelize[_0x1f90('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1f90('0x5')](_0x1f90('0x0'),_0x1f90('0x1'),_0x1f90('0x6'))},'keyContent':{'type':Sequelize[_0x1f90('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1f90('0x4')]},'customField':{'type':Sequelize[_0x1f90('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f90('0x4')]}}; \ No newline at end of file +var _0x27fd=['keyValue','picklist','STRING','variable','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x5a80b3,_0x574647){var _0x2ab3c0=function(_0x2b7781){while(--_0x2b7781){_0x5a80b3['push'](_0x5a80b3['shift']());}};_0x2ab3c0(++_0x574647);}(_0x27fd,0xf9));var _0xd27f=function(_0x2534b5,_0x46d576){_0x2534b5=_0x2534b5-0x0;var _0x58212c=_0x27fd[_0x2534b5];return _0x58212c;};'use strict';var Sequelize=require(_0xd27f('0x0'));module['exports']={'type':{'type':Sequelize[_0xd27f('0x1')](_0xd27f('0x2'),'variable','customVariable',_0xd27f('0x3'),_0xd27f('0x4')),'defaultValue':_0xd27f('0x2')},'content':{'type':Sequelize[_0xd27f('0x5')]},'key':{'type':Sequelize[_0xd27f('0x5')]},'keyType':{'type':Sequelize[_0xd27f('0x1')](_0xd27f('0x2'),_0xd27f('0x6'),_0xd27f('0x7'))},'keyContent':{'type':Sequelize[_0xd27f('0x5')]},'idField':{'type':Sequelize[_0xd27f('0x5')]},'nameField':{'type':Sequelize[_0xd27f('0x5')]},'customField':{'type':Sequelize[_0xd27f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd27f('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 056bb5c..e47926b 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 _0x6f2f=['Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','eml-format','rimraf','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count'];(function(_0x51df00,_0x4ac573){var _0x198328=function(_0x24e0ec){while(--_0x24e0ec){_0x51df00['push'](_0x51df00['shift']());}};_0x198328(++_0x4ac573);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x6f2f[_0x58afd5];return _0x3e503b;};'use strict';var emlformat=require(_0xf6f2('0x0'));var rimraf=require(_0xf6f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf6f2('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf6f2('0x3'));var path=require(_0xf6f2('0x4'));var sox=require(_0xf6f2('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6f2('0x6'));var _=require(_0xf6f2('0x7'));var squel=require(_0xf6f2('0x8'));var crypto=require(_0xf6f2('0x9'));var jsforce=require(_0xf6f2('0xa'));var deskjs=require(_0xf6f2('0xb'));var toCsv=require(_0xf6f2('0xc'));var querystring=require(_0xf6f2('0xd'));var Papa=require(_0xf6f2('0xe'));var Redis=require(_0xf6f2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf6f2('0x10'));var as=require(_0xf6f2('0x11'));var hardwareService=require(_0xf6f2('0x12'));var logger=require(_0xf6f2('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf6f2('0x14'));var db=require(_0xf6f2('0x15'))['db'];function respondWithStatusCode(_0x131a18,_0x4afa2){_0x4afa2=_0x4afa2||0xcc;return function(_0x1626ce){if(_0x1626ce){return _0x131a18[_0xf6f2('0x16')](_0x4afa2);}return _0x131a18['status'](_0x4afa2)[_0xf6f2('0x17')]();};}function respondWithResult(_0x5ef5ac,_0xccf687){_0xccf687=_0xccf687||0xc8;return function(_0x3cf95f){if(_0x3cf95f){return _0x5ef5ac[_0xf6f2('0x18')](_0xccf687)['json'](_0x3cf95f);}};}function respondWithFilteredResult(_0x2b28c1,_0x27c0dc){return function(_0x314f9a){if(_0x314f9a){var _0x26c176=typeof _0x27c0dc[_0xf6f2('0x19')]===_0xf6f2('0x1a')&&typeof _0x27c0dc[_0xf6f2('0x1b')]===_0xf6f2('0x1a');var _0x4115dd=_0x314f9a[_0xf6f2('0x1c')];var _0x400055=_0x26c176?0x0:_0x27c0dc[_0xf6f2('0x19')];var _0x42b93b=_0x26c176?_0x314f9a[_0xf6f2('0x1c')]:_0x27c0dc[_0xf6f2('0x19')]+_0x27c0dc['limit'];var _0x4de8bd;if(_0x42b93b>=_0x4115dd){_0x42b93b=_0x4115dd;_0x4de8bd=0xc8;}else{_0x4de8bd=0xce;}_0x2b28c1[_0xf6f2('0x18')](_0x4de8bd);return _0x2b28c1['set'](_0xf6f2('0x1d'),_0x400055+'-'+_0x42b93b+'/'+_0x4115dd)[_0xf6f2('0x1e')](_0x314f9a);}return null;};}function patchUpdates(_0x312429){return function(_0x1ad76b){try{jsonpatch['apply'](_0x1ad76b,_0x312429,!![]);}catch(_0xd020e6){return BPromise[_0xf6f2('0x1f')](_0xd020e6);}return _0x1ad76b[_0xf6f2('0x20')]();};}function saveUpdates(_0x3321a0,_0x5dce4f){return function(_0x19be8e){if(_0x19be8e){return _0x19be8e['update'](_0x3321a0)[_0xf6f2('0x21')](function(_0x56b97a){return _0x56b97a;});}return null;};}function removeEntity(_0x1e33c,_0x151905){return function(_0x582862){if(_0x582862){return _0x582862[_0xf6f2('0x22')]()[_0xf6f2('0x21')](function(){_0x1e33c[_0xf6f2('0x18')](0xcc)[_0xf6f2('0x17')]();});}};}function handleEntityNotFound(_0x219a12,_0x1f3500){return function(_0x3304ec){if(!_0x3304ec){_0x219a12[_0xf6f2('0x16')](0x194);}return _0x3304ec;};}function handleError(_0x5dac6a,_0x2b233f){_0x2b233f=_0x2b233f||0x1f4;return function(_0x2081f6){logger[_0xf6f2('0x23')](_0x2081f6[_0xf6f2('0x24')]);if(_0x2081f6[_0xf6f2('0x25')]){delete _0x2081f6[_0xf6f2('0x25')];}_0x5dac6a[_0xf6f2('0x18')](_0x2b233f)[_0xf6f2('0x26')](_0x2081f6);};}exports[_0xf6f2('0x27')]=function(_0x40243e,_0x2c643d){var _0x4accfe={},_0x2aa645={},_0x26c4dc={'count':0x0,'rows':[]};var _0x17c63f=_[_0xf6f2('0x28')](db[_0xf6f2('0x29')][_0xf6f2('0x2a')],function(_0x228b24){return{'name':_0x228b24[_0xf6f2('0x2b')],'type':_0x228b24[_0xf6f2('0x2c')][_0xf6f2('0x2d')]};});_0x2aa645[_0xf6f2('0x2e')]=_[_0xf6f2('0x28')](_0x17c63f,'name');_0x2aa645[_0xf6f2('0x2f')]=_[_0xf6f2('0x30')](_0x40243e[_0xf6f2('0x2f')]);_0x2aa645[_0xf6f2('0x31')]=_[_0xf6f2('0x32')](_0x2aa645[_0xf6f2('0x2e')],_0x2aa645[_0xf6f2('0x2f')]);_0x4accfe[_0xf6f2('0x33')]=_[_0xf6f2('0x32')](_0x2aa645[_0xf6f2('0x2e')],qs[_0xf6f2('0x34')](_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x34')]));_0x4accfe['attributes']=_0x4accfe['attributes']['length']?_0x4accfe[_0xf6f2('0x33')]:_0x2aa645[_0xf6f2('0x2e')];if(!_0x40243e['query']['hasOwnProperty'](_0xf6f2('0x35'))){_0x4accfe[_0xf6f2('0x1b')]=qs[_0xf6f2('0x1b')](_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x1b')]);_0x4accfe[_0xf6f2('0x19')]=qs['offset'](_0x40243e[_0xf6f2('0x2f')]['offset']);}_0x4accfe[_0xf6f2('0x36')]=qs[_0xf6f2('0x37')](_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x37')]);_0x4accfe['where']=qs[_0xf6f2('0x31')](_[_0xf6f2('0x38')](_0x40243e[_0xf6f2('0x2f')],_0x2aa645['filters']),_0x17c63f);if(_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x39')]){_0x4accfe[_0xf6f2('0x3a')]=_['merge'](_0x4accfe[_0xf6f2('0x3a')],{'$or':_['map'](_0x17c63f,function(_0x38b20d){if(_0x38b20d[_0xf6f2('0x2c')]!==_0xf6f2('0x3b')){var _0x55e44d={};_0x55e44d[_0x38b20d[_0xf6f2('0x25')]]={'$like':'%'+_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x39')]+'%'};return _0x55e44d;}})});}_0x4accfe=_[_0xf6f2('0x3c')]({},_0x4accfe,_0x40243e[_0xf6f2('0x3d')]);var _0x4ee53f={'where':_0x4accfe[_0xf6f2('0x3a')]};return db[_0xf6f2('0x29')][_0xf6f2('0x1c')](_0x4ee53f)[_0xf6f2('0x21')](function(_0x3986f1){_0x26c4dc[_0xf6f2('0x1c')]=_0x3986f1;if(_0x40243e[_0xf6f2('0x2f')]['includeAll']){_0x4accfe[_0xf6f2('0x3e')]=[{'all':!![]}];}return db[_0xf6f2('0x29')][_0xf6f2('0x3f')](_0x4accfe);})['then'](function(_0x244a8c){_0x26c4dc[_0xf6f2('0x40')]=_0x244a8c;return _0x26c4dc;})[_0xf6f2('0x21')](respondWithFilteredResult(_0x2c643d,_0x4accfe))[_0xf6f2('0x41')](handleError(_0x2c643d,null));};exports[_0xf6f2('0x42')]=function(_0x4c4f17,_0x47090b){var _0x31f367={'raw':!![],'where':{'id':_0x4c4f17[_0xf6f2('0x43')]['id']}},_0x34ba3a={};_0x34ba3a[_0xf6f2('0x2e')]=_['keys'](db[_0xf6f2('0x29')]['rawAttributes']);_0x34ba3a[_0xf6f2('0x2f')]=_[_0xf6f2('0x30')](_0x4c4f17[_0xf6f2('0x2f')]);_0x34ba3a[_0xf6f2('0x31')]=_[_0xf6f2('0x32')](_0x34ba3a[_0xf6f2('0x2e')],_0x34ba3a[_0xf6f2('0x2f')]);_0x31f367[_0xf6f2('0x33')]=_[_0xf6f2('0x32')](_0x34ba3a[_0xf6f2('0x2e')],qs[_0xf6f2('0x34')](_0x4c4f17['query'][_0xf6f2('0x34')]));_0x31f367[_0xf6f2('0x33')]=_0x31f367[_0xf6f2('0x33')]['length']?_0x31f367['attributes']:_0x34ba3a['model'];if(_0x4c4f17[_0xf6f2('0x2f')][_0xf6f2('0x44')]){_0x31f367['include']=[{'all':!![]}];}_0x31f367=_['merge']({},_0x31f367,_0x4c4f17[_0xf6f2('0x3d')]);return db[_0xf6f2('0x29')][_0xf6f2('0x45')](_0x31f367)[_0xf6f2('0x21')](handleEntityNotFound(_0x47090b,null))[_0xf6f2('0x21')](respondWithResult(_0x47090b,null))[_0xf6f2('0x41')](handleError(_0x47090b,null));};exports['create']=function(_0x5b4737,_0x5daa2c){return db['FreshdeskField'][_0xf6f2('0x46')](_0x5b4737['body'],{})[_0xf6f2('0x21')](respondWithResult(_0x5daa2c,0xc9))[_0xf6f2('0x41')](handleError(_0x5daa2c,null));};exports[_0xf6f2('0x47')]=function(_0x3b7d67,_0x28da53){if(_0x3b7d67['body']['id']){delete _0x3b7d67['body']['id'];}return db[_0xf6f2('0x29')]['find']({'where':{'id':_0x3b7d67['params']['id']}})[_0xf6f2('0x21')](handleEntityNotFound(_0x28da53,null))[_0xf6f2('0x21')](saveUpdates(_0x3b7d67[_0xf6f2('0x48')],null))[_0xf6f2('0x21')](respondWithResult(_0x28da53,null))[_0xf6f2('0x41')](handleError(_0x28da53,null));};exports[_0xf6f2('0x22')]=function(_0x5351f5,_0x443277){return db[_0xf6f2('0x29')]['find']({'where':{'id':_0x5351f5[_0xf6f2('0x43')]['id']}})[_0xf6f2('0x21')](handleEntityNotFound(_0x443277,null))[_0xf6f2('0x21')](removeEntity(_0x443277,null))['catch'](handleError(_0x443277,null));}; \ No newline at end of file +var _0x6f2f=['Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','eml-format','rimraf','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0x6f2f,0xbe));var _0xf6f2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6f2f[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xf6f2('0x0'));var rimraf=require(_0xf6f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf6f2('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf6f2('0x3'));var path=require(_0xf6f2('0x4'));var sox=require(_0xf6f2('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6f2('0x6'));var _=require(_0xf6f2('0x7'));var squel=require(_0xf6f2('0x8'));var crypto=require(_0xf6f2('0x9'));var jsforce=require(_0xf6f2('0xa'));var deskjs=require(_0xf6f2('0xb'));var toCsv=require(_0xf6f2('0xc'));var querystring=require(_0xf6f2('0xd'));var Papa=require(_0xf6f2('0xe'));var Redis=require(_0xf6f2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf6f2('0x10'));var as=require(_0xf6f2('0x11'));var hardwareService=require(_0xf6f2('0x12'));var logger=require(_0xf6f2('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf6f2('0x14'));var db=require(_0xf6f2('0x15'))['db'];function respondWithStatusCode(_0x131a18,_0x4afa2){_0x4afa2=_0x4afa2||0xcc;return function(_0x1626ce){if(_0x1626ce){return _0x131a18[_0xf6f2('0x16')](_0x4afa2);}return _0x131a18['status'](_0x4afa2)[_0xf6f2('0x17')]();};}function respondWithResult(_0x5ef5ac,_0xccf687){_0xccf687=_0xccf687||0xc8;return function(_0x3cf95f){if(_0x3cf95f){return _0x5ef5ac[_0xf6f2('0x18')](_0xccf687)['json'](_0x3cf95f);}};}function respondWithFilteredResult(_0x2b28c1,_0x27c0dc){return function(_0x314f9a){if(_0x314f9a){var _0x26c176=typeof _0x27c0dc[_0xf6f2('0x19')]===_0xf6f2('0x1a')&&typeof _0x27c0dc[_0xf6f2('0x1b')]===_0xf6f2('0x1a');var _0x4115dd=_0x314f9a[_0xf6f2('0x1c')];var _0x400055=_0x26c176?0x0:_0x27c0dc[_0xf6f2('0x19')];var _0x42b93b=_0x26c176?_0x314f9a[_0xf6f2('0x1c')]:_0x27c0dc[_0xf6f2('0x19')]+_0x27c0dc['limit'];var _0x4de8bd;if(_0x42b93b>=_0x4115dd){_0x42b93b=_0x4115dd;_0x4de8bd=0xc8;}else{_0x4de8bd=0xce;}_0x2b28c1[_0xf6f2('0x18')](_0x4de8bd);return _0x2b28c1['set'](_0xf6f2('0x1d'),_0x400055+'-'+_0x42b93b+'/'+_0x4115dd)[_0xf6f2('0x1e')](_0x314f9a);}return null;};}function patchUpdates(_0x312429){return function(_0x1ad76b){try{jsonpatch['apply'](_0x1ad76b,_0x312429,!![]);}catch(_0xd020e6){return BPromise[_0xf6f2('0x1f')](_0xd020e6);}return _0x1ad76b[_0xf6f2('0x20')]();};}function saveUpdates(_0x3321a0,_0x5dce4f){return function(_0x19be8e){if(_0x19be8e){return _0x19be8e['update'](_0x3321a0)[_0xf6f2('0x21')](function(_0x56b97a){return _0x56b97a;});}return null;};}function removeEntity(_0x1e33c,_0x151905){return function(_0x582862){if(_0x582862){return _0x582862[_0xf6f2('0x22')]()[_0xf6f2('0x21')](function(){_0x1e33c[_0xf6f2('0x18')](0xcc)[_0xf6f2('0x17')]();});}};}function handleEntityNotFound(_0x219a12,_0x1f3500){return function(_0x3304ec){if(!_0x3304ec){_0x219a12[_0xf6f2('0x16')](0x194);}return _0x3304ec;};}function handleError(_0x5dac6a,_0x2b233f){_0x2b233f=_0x2b233f||0x1f4;return function(_0x2081f6){logger[_0xf6f2('0x23')](_0x2081f6[_0xf6f2('0x24')]);if(_0x2081f6[_0xf6f2('0x25')]){delete _0x2081f6[_0xf6f2('0x25')];}_0x5dac6a[_0xf6f2('0x18')](_0x2b233f)[_0xf6f2('0x26')](_0x2081f6);};}exports[_0xf6f2('0x27')]=function(_0x40243e,_0x2c643d){var _0x4accfe={},_0x2aa645={},_0x26c4dc={'count':0x0,'rows':[]};var _0x17c63f=_[_0xf6f2('0x28')](db[_0xf6f2('0x29')][_0xf6f2('0x2a')],function(_0x228b24){return{'name':_0x228b24[_0xf6f2('0x2b')],'type':_0x228b24[_0xf6f2('0x2c')][_0xf6f2('0x2d')]};});_0x2aa645[_0xf6f2('0x2e')]=_[_0xf6f2('0x28')](_0x17c63f,'name');_0x2aa645[_0xf6f2('0x2f')]=_[_0xf6f2('0x30')](_0x40243e[_0xf6f2('0x2f')]);_0x2aa645[_0xf6f2('0x31')]=_[_0xf6f2('0x32')](_0x2aa645[_0xf6f2('0x2e')],_0x2aa645[_0xf6f2('0x2f')]);_0x4accfe[_0xf6f2('0x33')]=_[_0xf6f2('0x32')](_0x2aa645[_0xf6f2('0x2e')],qs[_0xf6f2('0x34')](_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x34')]));_0x4accfe['attributes']=_0x4accfe['attributes']['length']?_0x4accfe[_0xf6f2('0x33')]:_0x2aa645[_0xf6f2('0x2e')];if(!_0x40243e['query']['hasOwnProperty'](_0xf6f2('0x35'))){_0x4accfe[_0xf6f2('0x1b')]=qs[_0xf6f2('0x1b')](_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x1b')]);_0x4accfe[_0xf6f2('0x19')]=qs['offset'](_0x40243e[_0xf6f2('0x2f')]['offset']);}_0x4accfe[_0xf6f2('0x36')]=qs[_0xf6f2('0x37')](_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x37')]);_0x4accfe['where']=qs[_0xf6f2('0x31')](_[_0xf6f2('0x38')](_0x40243e[_0xf6f2('0x2f')],_0x2aa645['filters']),_0x17c63f);if(_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x39')]){_0x4accfe[_0xf6f2('0x3a')]=_['merge'](_0x4accfe[_0xf6f2('0x3a')],{'$or':_['map'](_0x17c63f,function(_0x38b20d){if(_0x38b20d[_0xf6f2('0x2c')]!==_0xf6f2('0x3b')){var _0x55e44d={};_0x55e44d[_0x38b20d[_0xf6f2('0x25')]]={'$like':'%'+_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x39')]+'%'};return _0x55e44d;}})});}_0x4accfe=_[_0xf6f2('0x3c')]({},_0x4accfe,_0x40243e[_0xf6f2('0x3d')]);var _0x4ee53f={'where':_0x4accfe[_0xf6f2('0x3a')]};return db[_0xf6f2('0x29')][_0xf6f2('0x1c')](_0x4ee53f)[_0xf6f2('0x21')](function(_0x3986f1){_0x26c4dc[_0xf6f2('0x1c')]=_0x3986f1;if(_0x40243e[_0xf6f2('0x2f')]['includeAll']){_0x4accfe[_0xf6f2('0x3e')]=[{'all':!![]}];}return db[_0xf6f2('0x29')][_0xf6f2('0x3f')](_0x4accfe);})['then'](function(_0x244a8c){_0x26c4dc[_0xf6f2('0x40')]=_0x244a8c;return _0x26c4dc;})[_0xf6f2('0x21')](respondWithFilteredResult(_0x2c643d,_0x4accfe))[_0xf6f2('0x41')](handleError(_0x2c643d,null));};exports[_0xf6f2('0x42')]=function(_0x4c4f17,_0x47090b){var _0x31f367={'raw':!![],'where':{'id':_0x4c4f17[_0xf6f2('0x43')]['id']}},_0x34ba3a={};_0x34ba3a[_0xf6f2('0x2e')]=_['keys'](db[_0xf6f2('0x29')]['rawAttributes']);_0x34ba3a[_0xf6f2('0x2f')]=_[_0xf6f2('0x30')](_0x4c4f17[_0xf6f2('0x2f')]);_0x34ba3a[_0xf6f2('0x31')]=_[_0xf6f2('0x32')](_0x34ba3a[_0xf6f2('0x2e')],_0x34ba3a[_0xf6f2('0x2f')]);_0x31f367[_0xf6f2('0x33')]=_[_0xf6f2('0x32')](_0x34ba3a[_0xf6f2('0x2e')],qs[_0xf6f2('0x34')](_0x4c4f17['query'][_0xf6f2('0x34')]));_0x31f367[_0xf6f2('0x33')]=_0x31f367[_0xf6f2('0x33')]['length']?_0x31f367['attributes']:_0x34ba3a['model'];if(_0x4c4f17[_0xf6f2('0x2f')][_0xf6f2('0x44')]){_0x31f367['include']=[{'all':!![]}];}_0x31f367=_['merge']({},_0x31f367,_0x4c4f17[_0xf6f2('0x3d')]);return db[_0xf6f2('0x29')][_0xf6f2('0x45')](_0x31f367)[_0xf6f2('0x21')](handleEntityNotFound(_0x47090b,null))[_0xf6f2('0x21')](respondWithResult(_0x47090b,null))[_0xf6f2('0x41')](handleError(_0x47090b,null));};exports['create']=function(_0x5b4737,_0x5daa2c){return db['FreshdeskField'][_0xf6f2('0x46')](_0x5b4737['body'],{})[_0xf6f2('0x21')](respondWithResult(_0x5daa2c,0xc9))[_0xf6f2('0x41')](handleError(_0x5daa2c,null));};exports[_0xf6f2('0x47')]=function(_0x3b7d67,_0x28da53){if(_0x3b7d67['body']['id']){delete _0x3b7d67['body']['id'];}return db[_0xf6f2('0x29')]['find']({'where':{'id':_0x3b7d67['params']['id']}})[_0xf6f2('0x21')](handleEntityNotFound(_0x28da53,null))[_0xf6f2('0x21')](saveUpdates(_0x3b7d67[_0xf6f2('0x48')],null))[_0xf6f2('0x21')](respondWithResult(_0x28da53,null))[_0xf6f2('0x41')](handleError(_0x28da53,null));};exports[_0xf6f2('0x22')]=function(_0x5351f5,_0x443277){return db[_0xf6f2('0x29')]['find']({'where':{'id':_0x5351f5[_0xf6f2('0x43')]['id']}})[_0xf6f2('0x21')](handleEntityNotFound(_0x443277,null))[_0xf6f2('0x21')](removeEntity(_0x443277,null))['catch'](handleError(_0x443277,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 2545b46..1d406f2 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 _0x8f02=['../../config/logger','api','moment','request-promise','path','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','util'];(function(_0x27e264,_0x1e5beb){var _0xfb1831=function(_0x54adb5){while(--_0x54adb5){_0x27e264['push'](_0x27e264['shift']());}};_0xfb1831(++_0x1e5beb);}(_0x8f02,0x73));var _0x28f0=function(_0x3a635d,_0x41851f){_0x3a635d=_0x3a635d-0x0;var _0x1b44fa=_0x8f02[_0x3a635d];return _0x1b44fa;};'use strict';var _=require(_0x28f0('0x0'));var util=require(_0x28f0('0x1'));var logger=require(_0x28f0('0x2'))(_0x28f0('0x3'));var moment=require(_0x28f0('0x4'));var BPromise=require('bluebird');var rp=require(_0x28f0('0x5'));var fs=require('fs');var path=require(_0x28f0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x28f0('0x7'));module[_0x28f0('0x8')]=function(_0x25689a,_0x4250b4){return _0x25689a['define'](_0x28f0('0x9'),attributes,{'tableName':_0x28f0('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x28f0('0xb'),_0x28f0('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c22=['int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','api','moment','bluebird','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField'];(function(_0x56766c,_0x5af208){var _0xba8e50=function(_0x1c8120){while(--_0x1c8120){_0x56766c['push'](_0x56766c['shift']());}};_0xba8e50(++_0x5af208);}(_0x1c22,0x197));var _0x21c2=function(_0x49d73b,_0x46cd02){_0x49d73b=_0x49d73b-0x0;var _0x8bf584=_0x1c22[_0x49d73b];return _0x8bf584;};'use strict';var _=require('lodash');var util=require(_0x21c2('0x0'));var logger=require('../../config/logger')(_0x21c2('0x1'));var moment=require(_0x21c2('0x2'));var BPromise=require(_0x21c2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x21c2('0x4'));var config=require('../../config/environment');var attributes=require(_0x21c2('0x5'));module[_0x21c2('0x6')]=function(_0x18aeba,_0x234329){return _0x18aeba[_0x21c2('0x7')](_0x21c2('0x8'),attributes,{'tableName':_0x21c2('0x9'),'paranoid':![],'indexes':[{'name':_0x21c2('0xa'),'fields':[_0x21c2('0xb'),_0x21c2('0xc')],'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 54836f6..9926ccd 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 _0xeabf=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment'];(function(_0x4124b3,_0x8dc708){var _0x41b54f=function(_0x50f26c){while(--_0x50f26c){_0x4124b3['push'](_0x4124b3['shift']());}};_0x41b54f(++_0x8dc708);}(_0xeabf,0x90));var _0xfeab=function(_0x2b19ce,_0x422a55){_0x2b19ce=_0x2b19ce-0x0;var _0x4144ec=_0xeabf[_0x2b19ce];return _0x4144ec;};'use strict';var _=require(_0xfeab('0x0'));var util=require(_0xfeab('0x1'));var moment=require(_0xfeab('0x2'));var BPromise=require(_0xfeab('0x3'));var rs=require(_0xfeab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfeab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfeab('0x6'))(_0xfeab('0x7'));var config=require(_0xfeab('0x8'));var jayson=require(_0xfeab('0x9'));var client=jayson[_0xfeab('0xa')][_0xfeab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52fa5f,_0x589e94,_0x9b9c8e){return new BPromise(function(_0x38b6c1,_0x29be32){return client['request'](_0x52fa5f,_0x9b9c8e)[_0xfeab('0xc')](function(_0x38a48f){logger[_0xfeab('0xd')](_0xfeab('0xe'),_0x589e94,_0xfeab('0xf'));logger['debug'](_0xfeab('0x10'),_0x589e94,_0xfeab('0xf'),JSON[_0xfeab('0x11')](_0x38a48f));if(_0x38a48f[_0xfeab('0x12')]){if(_0x38a48f[_0xfeab('0x12')]['code']===0x1f4){logger[_0xfeab('0x12')](_0xfeab('0xe'),_0x589e94,_0x38a48f[_0xfeab('0x12')][_0xfeab('0x13')]);return _0x29be32(_0x38a48f[_0xfeab('0x12')]['message']);}logger[_0xfeab('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x589e94,_0x38a48f[_0xfeab('0x12')][_0xfeab('0x13')]);return _0x38b6c1(_0x38a48f[_0xfeab('0x12')]['message']);}else{logger[_0xfeab('0xd')](_0xfeab('0xe'),_0x589e94,_0xfeab('0xf'));_0x38b6c1(_0x38a48f['result'][_0xfeab('0x13')]);}})[_0xfeab('0x14')](function(_0x46270b){logger[_0xfeab('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x589e94,_0x46270b);_0x29be32(_0x46270b);});});} \ No newline at end of file +var _0x583d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskField,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0xe0077e,_0x2af049){var _0x11d1d0=function(_0x941fbb){while(--_0x941fbb){_0xe0077e['push'](_0xe0077e['shift']());}};_0x11d1d0(++_0x2af049);}(_0x583d,0x139));var _0xd583=function(_0x3f617b,_0x4ac1dd){_0x3f617b=_0x3f617b-0x0;var _0x40f37d=_0x583d[_0x3f617b];return _0x40f37d;};'use strict';var _=require(_0xd583('0x0'));var util=require(_0xd583('0x1'));var moment=require(_0xd583('0x2'));var BPromise=require(_0xd583('0x3'));var rs=require(_0xd583('0x4'));var fs=require('fs');var Redis=require(_0xd583('0x5'));var db=require(_0xd583('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd583('0x7'))('rpc');var config=require(_0xd583('0x8'));var jayson=require(_0xd583('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xcd4c0a,_0x19c3eb,_0x2aa171){return new BPromise(function(_0x415c15,_0x30cb58){return client[_0xd583('0xa')](_0xcd4c0a,_0x2aa171)[_0xd583('0xb')](function(_0x250070){logger[_0xd583('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x19c3eb,_0xd583('0xd'));logger[_0xd583('0xe')](_0xd583('0xf'),_0x19c3eb,'request\x20sent',JSON[_0xd583('0x10')](_0x250070));if(_0x250070[_0xd583('0x11')]){if(_0x250070['error']['code']===0x1f4){logger['error'](_0xd583('0x12'),_0x19c3eb,_0x250070[_0xd583('0x11')][_0xd583('0x13')]);return _0x30cb58(_0x250070[_0xd583('0x11')]['message']);}logger['error'](_0xd583('0x12'),_0x19c3eb,_0x250070['error'][_0xd583('0x13')]);return _0x415c15(_0x250070[_0xd583('0x11')][_0xd583('0x13')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x19c3eb,_0xd583('0xd'));_0x415c15(_0x250070['result'][_0xd583('0x13')]);}})[_0xd583('0x14')](function(_0x4d9598){logger[_0xd583('0x11')](_0xd583('0x12'),_0x19c3eb,_0x4d9598);_0x30cb58(_0x4d9598);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 078ee9b..07ef1e2 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 _0x2547=['addConfiguration','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0xe8c190,_0x149e0d){var _0x1c46c1=function(_0x574005){while(--_0x574005){_0xe8c190['push'](_0xe8c190['shift']());}};_0x1c46c1(++_0x149e0d);}(_0x2547,0x1cd));var _0x7254=function(_0x2e658d,_0x5682d1){_0x2e658d=_0x2e658d-0x0;var _0x1ed659=_0x2547[_0x2e658d];return _0x1ed659;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x11')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0x12')]);router['post'](_0x7254('0xe'),auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['put'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x15')](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x16')]);module[_0x7254('0x17')]=router; \ No newline at end of file +var _0x9c00=['create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x202ee4,_0x5d79d9){var _0x5b95b9=function(_0x14e6be){while(--_0x14e6be){_0x202ee4['push'](_0x202ee4['shift']());}};_0x5b95b9(++_0x5d79d9);}(_0x9c00,0x1a0));var _0x09c0=function(_0x5ec09a,_0x35b386){_0x5ec09a=_0x5ec09a-0x0;var _0x1f3c39=_0x9c00[_0x5ec09a];return _0x1f3c39;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09c0('0x4'));var interaction=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var controller=require(_0x09c0('0x7'));router[_0x09c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x8')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0x8')]('/:id/configurations',auth[_0x09c0('0xa')](),controller[_0x09c0('0xc')]);router[_0x09c0('0x8')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xe')]);router[_0x09c0('0xf')]('/',auth[_0x09c0('0xa')](),controller[_0x09c0('0x10')]);router[_0x09c0('0xf')](_0x09c0('0x11'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x12')]);router[_0x09c0('0x13')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x14')]);router[_0x09c0('0x15')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x16')]);module[_0x09c0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index fb363ef..2b29887 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 _0x77d4=['exports','STRING','username'];(function(_0x2888a4,_0x1fc157){var _0x7f650c=function(_0x5e1880){while(--_0x5e1880){_0x2888a4['push'](_0x2888a4['shift']());}};_0x7f650c(++_0x1fc157);}(_0x77d4,0x108));var _0x477d=function(_0x3a7aa8,_0xcf6f10){_0x3a7aa8=_0x3a7aa8-0x0;var _0x32a6ff=_0x77d4[_0x3a7aa8];return _0x32a6ff;};'use strict';var Sequelize=require('sequelize');module[_0x477d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x477d('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x477d('0x2')},'apiKey':{'type':Sequelize[_0x477d('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x477d('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xfef3=['sequelize','STRING','username','remoteUri'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xfef3,0x118));var _0x3fef=function(_0x466161,_0x29cc00){_0x466161=_0x466161-0x0;var _0x2f9c1d=_0xfef3[_0x466161];return _0x2f9c1d;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fef('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 24f1f7e..cba207c 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 _0xb963=['FreshsalesConfiguration','pick','options','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','FreshsalesField','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','users','email','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','FreshsalesAccount','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','includeAll','findAll','rows','catch','show','include','create','body','params','find','getConfigurations','findOne'];(function(_0x25e40e,_0x4a2bae){var _0x28759d=function(_0x41726c){while(--_0x41726c){_0x25e40e['push'](_0x25e40e['shift']());}};_0x28759d(++_0x4a2bae);}(_0xb963,0xe0));var _0x3b96=function(_0x58c162,_0x4133d4){_0x58c162=_0x58c162-0x0;var _0x5cbbd9=_0xb963[_0x58c162];return _0x5cbbd9;};'use strict';var emlformat=require(_0x3b96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b96('0x1'));var jsonpatch=require(_0x3b96('0x2'));var rp=require(_0x3b96('0x3'));var moment=require('moment');var BPromise=require(_0x3b96('0x4'));var Mustache=require(_0x3b96('0x5'));var util=require(_0x3b96('0x6'));var path=require(_0x3b96('0x7'));var sox=require('sox');var csv=require(_0x3b96('0x8'));var ejs=require(_0x3b96('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3b96('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3b96('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3b96('0xc'));var Papa=require(_0x3b96('0xd'));var Redis=require('ioredis');var authService=require(_0x3b96('0xe'));var qs=require(_0x3b96('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b96('0x10'));var logger=require(_0x3b96('0x11'))('api');var utils=require(_0x3b96('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3b96('0x13'));var db=require(_0x3b96('0x14'))['db'];var integrations=require(_0x3b96('0x15'));function respondWithStatusCode(_0x1fe5ed,_0x54c560){_0x54c560=_0x54c560||0xcc;return function(_0x462f2d){if(_0x462f2d){return _0x1fe5ed[_0x3b96('0x16')](_0x54c560);}return _0x1fe5ed[_0x3b96('0x17')](_0x54c560)[_0x3b96('0x18')]();};}function respondWithResult(_0x18566f,_0xdec742){_0xdec742=_0xdec742||0xc8;return function(_0x4f6cca){if(_0x4f6cca){return _0x18566f[_0x3b96('0x17')](_0xdec742)[_0x3b96('0x19')](_0x4f6cca);}};}function respondWithFilteredResult(_0x5a759f,_0x5df9e9){return function(_0x5468ce){if(_0x5468ce){var _0x57bf21=typeof _0x5df9e9[_0x3b96('0x1a')]===_0x3b96('0x1b')&&typeof _0x5df9e9[_0x3b96('0x1c')]===_0x3b96('0x1b');var _0x15f5c6=_0x5468ce[_0x3b96('0x1d')];var _0x13ed81=_0x57bf21?0x0:_0x5df9e9[_0x3b96('0x1a')];var _0x3608e7=_0x57bf21?_0x5468ce[_0x3b96('0x1d')]:_0x5df9e9[_0x3b96('0x1a')]+_0x5df9e9[_0x3b96('0x1c')];var _0x11c401;if(_0x3608e7>=_0x15f5c6){_0x3608e7=_0x15f5c6;_0x11c401=0xc8;}else{_0x11c401=0xce;}_0x5a759f[_0x3b96('0x17')](_0x11c401);return _0x5a759f[_0x3b96('0x1e')](_0x3b96('0x1f'),_0x13ed81+'-'+_0x3608e7+'/'+_0x15f5c6)[_0x3b96('0x19')](_0x5468ce);}return null;};}function patchUpdates(_0x4bf6b7){return function(_0x48d7d0){try{jsonpatch[_0x3b96('0x20')](_0x48d7d0,_0x4bf6b7,!![]);}catch(_0x703f3e){return BPromise['reject'](_0x703f3e);}return _0x48d7d0[_0x3b96('0x21')]();};}function saveUpdates(_0x260e7a,_0x790892){return function(_0x2b5134){if(_0x2b5134){return _0x2b5134[_0x3b96('0x22')](_0x260e7a)[_0x3b96('0x23')](function(_0x22cb32){return _0x22cb32;});}return null;};}function removeEntity(_0x14e43f,_0x260546){return function(_0x1e369c){if(_0x1e369c){return _0x1e369c[_0x3b96('0x24')]()['then'](function(){_0x14e43f[_0x3b96('0x17')](0xcc)[_0x3b96('0x18')]();});}};}function handleEntityNotFound(_0x3f54d3,_0x1ceaa8){return function(_0x3e24e7){if(!_0x3e24e7){_0x3f54d3[_0x3b96('0x16')](0x194);}return _0x3e24e7;};}function handleError(_0x3fcb3b,_0x474d8e){_0x474d8e=_0x474d8e||0x1f4;return function(_0x1b488c){logger['error'](_0x1b488c[_0x3b96('0x25')]);if(_0x1b488c[_0x3b96('0x26')]){delete _0x1b488c[_0x3b96('0x26')];}_0x3fcb3b[_0x3b96('0x17')](_0x474d8e)[_0x3b96('0x27')](_0x1b488c);};}exports['index']=function(_0x13a8e6,_0x283797){var _0x23a6f0={},_0x1a8ad4={},_0x308e4b={'count':0x0,'rows':[]};var _0x5baf73=_['map'](db[_0x3b96('0x28')][_0x3b96('0x29')],function(_0x39e40c){return{'name':_0x39e40c['fieldName'],'type':_0x39e40c[_0x3b96('0x2a')][_0x3b96('0x2b')]};});_0x1a8ad4[_0x3b96('0x2c')]=_[_0x3b96('0x2d')](_0x5baf73,_0x3b96('0x26'));_0x1a8ad4['query']=_[_0x3b96('0x2e')](_0x13a8e6[_0x3b96('0x2f')]);_0x1a8ad4[_0x3b96('0x30')]=_[_0x3b96('0x31')](_0x1a8ad4[_0x3b96('0x2c')],_0x1a8ad4['query']);_0x23a6f0[_0x3b96('0x32')]=_['intersection'](_0x1a8ad4[_0x3b96('0x2c')],qs[_0x3b96('0x33')](_0x13a8e6[_0x3b96('0x2f')][_0x3b96('0x33')]));_0x23a6f0[_0x3b96('0x32')]=_0x23a6f0[_0x3b96('0x32')][_0x3b96('0x34')]?_0x23a6f0[_0x3b96('0x32')]:_0x1a8ad4[_0x3b96('0x2c')];if(!_0x13a8e6[_0x3b96('0x2f')]['hasOwnProperty']('nolimit')){_0x23a6f0[_0x3b96('0x1c')]=qs[_0x3b96('0x1c')](_0x13a8e6[_0x3b96('0x2f')][_0x3b96('0x1c')]);_0x23a6f0[_0x3b96('0x1a')]=qs['offset'](_0x13a8e6[_0x3b96('0x2f')][_0x3b96('0x1a')]);}_0x23a6f0[_0x3b96('0x35')]=qs['sort'](_0x13a8e6[_0x3b96('0x2f')][_0x3b96('0x36')]);_0x23a6f0[_0x3b96('0x37')]=qs[_0x3b96('0x30')](_['pick'](_0x13a8e6['query'],_0x1a8ad4['filters']),_0x5baf73);if(_0x13a8e6['query'][_0x3b96('0x38')]){_0x23a6f0[_0x3b96('0x37')]=_[_0x3b96('0x39')](_0x23a6f0[_0x3b96('0x37')],{'$or':_[_0x3b96('0x2d')](_0x5baf73,function(_0x3321a0){if(_0x3321a0[_0x3b96('0x2a')]!=='VIRTUAL'){var _0x597d9c={};_0x597d9c[_0x3321a0[_0x3b96('0x26')]]={'$like':'%'+_0x13a8e6[_0x3b96('0x2f')][_0x3b96('0x38')]+'%'};return _0x597d9c;}})});}_0x23a6f0=_[_0x3b96('0x39')]({},_0x23a6f0,_0x13a8e6['options']);var _0x521c94={'where':_0x23a6f0[_0x3b96('0x37')]};return db[_0x3b96('0x28')]['count'](_0x521c94)[_0x3b96('0x23')](function(_0x1449cb){_0x308e4b[_0x3b96('0x1d')]=_0x1449cb;if(_0x13a8e6['query'][_0x3b96('0x3a')]){_0x23a6f0['include']=[{'all':!![]}];}return db[_0x3b96('0x28')][_0x3b96('0x3b')](_0x23a6f0);})[_0x3b96('0x23')](function(_0x4871da){_0x308e4b[_0x3b96('0x3c')]=_0x4871da;return _0x308e4b;})[_0x3b96('0x23')](respondWithFilteredResult(_0x283797,_0x23a6f0))[_0x3b96('0x3d')](handleError(_0x283797,null));};exports[_0x3b96('0x3e')]=function(_0x27190f,_0x5abd32){var _0x317e9e={'raw':![],'where':{'id':_0x27190f['params']['id']}},_0x362c9d={};_0x362c9d[_0x3b96('0x2c')]=_[_0x3b96('0x2e')](db['FreshsalesAccount'][_0x3b96('0x29')]);_0x362c9d['query']=_[_0x3b96('0x2e')](_0x27190f[_0x3b96('0x2f')]);_0x362c9d[_0x3b96('0x30')]=_[_0x3b96('0x31')](_0x362c9d[_0x3b96('0x2c')],_0x362c9d[_0x3b96('0x2f')]);_0x317e9e['attributes']=_[_0x3b96('0x31')](_0x362c9d[_0x3b96('0x2c')],qs['fields'](_0x27190f[_0x3b96('0x2f')][_0x3b96('0x33')]));_0x317e9e[_0x3b96('0x32')]=_0x317e9e[_0x3b96('0x32')]['length']?_0x317e9e[_0x3b96('0x32')]:_0x362c9d['model'];if(_0x27190f['query'][_0x3b96('0x3a')]){_0x317e9e[_0x3b96('0x3f')]=[{'all':!![]}];}_0x317e9e=_['merge']({},_0x317e9e,_0x27190f['options']);return db[_0x3b96('0x28')]['find'](_0x317e9e)['then'](handleEntityNotFound(_0x5abd32,null))[_0x3b96('0x23')](respondWithResult(_0x5abd32,null))['catch'](handleError(_0x5abd32,null));};exports[_0x3b96('0x40')]=function(_0x1c60e5,_0x9c1c25){return db['FreshsalesAccount'][_0x3b96('0x40')](_0x1c60e5[_0x3b96('0x41')],{})[_0x3b96('0x23')](respondWithResult(_0x9c1c25,0xc9))[_0x3b96('0x3d')](handleError(_0x9c1c25,null));};exports[_0x3b96('0x22')]=function(_0x552a70,_0x5b66f4){if(_0x552a70['body']['id']){delete _0x552a70[_0x3b96('0x41')]['id'];}return db[_0x3b96('0x28')]['find']({'where':{'id':_0x552a70[_0x3b96('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b66f4,null))[_0x3b96('0x23')](saveUpdates(_0x552a70[_0x3b96('0x41')],null))[_0x3b96('0x23')](respondWithResult(_0x5b66f4,null))[_0x3b96('0x3d')](handleError(_0x5b66f4,null));};exports[_0x3b96('0x24')]=function(_0x15d86d,_0x335dec){return db['FreshsalesAccount'][_0x3b96('0x43')]({'where':{'id':_0x15d86d['params']['id']}})['then'](handleEntityNotFound(_0x335dec,null))[_0x3b96('0x23')](removeEntity(_0x335dec,null))['catch'](handleError(_0x335dec,null));};exports[_0x3b96('0x44')]=function(_0x475d81,_0x4b3431,_0x2424ca){var _0x4f3336={};var _0x379700={};var _0x37cc0c;var _0x67ff88;return db[_0x3b96('0x28')][_0x3b96('0x45')]({'where':{'id':_0x475d81[_0x3b96('0x42')]['id']}})['then'](handleEntityNotFound(_0x4b3431,null))['then'](function(_0x5c3cc5){if(_0x5c3cc5){_0x37cc0c=_0x5c3cc5;_0x379700['model']=_[_0x3b96('0x2e')](db[_0x3b96('0x46')][_0x3b96('0x29')]);_0x379700[_0x3b96('0x2f')]=_['keys'](_0x475d81[_0x3b96('0x2f')]);_0x379700[_0x3b96('0x30')]=_[_0x3b96('0x31')](_0x379700['model'],_0x379700[_0x3b96('0x2f')]);_0x4f3336[_0x3b96('0x32')]=_[_0x3b96('0x31')](_0x379700[_0x3b96('0x2c')],qs[_0x3b96('0x33')](_0x475d81[_0x3b96('0x2f')][_0x3b96('0x33')]));_0x4f3336[_0x3b96('0x32')]=_0x4f3336[_0x3b96('0x32')][_0x3b96('0x34')]?_0x4f3336['attributes']:_0x379700['model'];_0x4f3336[_0x3b96('0x35')]=qs[_0x3b96('0x36')](_0x475d81[_0x3b96('0x2f')][_0x3b96('0x36')]);_0x4f3336[_0x3b96('0x37')]=qs[_0x3b96('0x30')](_[_0x3b96('0x47')](_0x475d81[_0x3b96('0x2f')],_0x379700['filters']));if(_0x475d81[_0x3b96('0x2f')][_0x3b96('0x38')]){_0x4f3336[_0x3b96('0x37')]=_['merge'](_0x4f3336[_0x3b96('0x37')],{'$or':_[_0x3b96('0x2d')](_0x4f3336[_0x3b96('0x32')],function(_0x1abe23){var _0x160231={};_0x160231[_0x1abe23]={'$like':'%'+_0x475d81['query']['filter']+'%'};return _0x160231;})});}_0x4f3336=_['merge']({},_0x4f3336,_0x475d81[_0x3b96('0x48')]);return _0x37cc0c[_0x3b96('0x44')](_0x4f3336);}})[_0x3b96('0x23')](function(_0x1b9fa2){if(_0x1b9fa2){_0x67ff88=_0x1b9fa2[_0x3b96('0x34')];if(!_0x475d81['query']['hasOwnProperty']('nolimit')){_0x4f3336[_0x3b96('0x1c')]=qs[_0x3b96('0x1c')](_0x475d81[_0x3b96('0x2f')][_0x3b96('0x1c')]);_0x4f3336['offset']=qs['offset'](_0x475d81[_0x3b96('0x2f')][_0x3b96('0x1a')]);}return _0x37cc0c['getConfigurations'](_0x4f3336);}})[_0x3b96('0x23')](function(_0x24d249){if(_0x24d249){return _0x24d249?{'count':_0x67ff88,'rows':_0x24d249}:null;}})[_0x3b96('0x23')](respondWithResult(_0x4b3431,null))[_0x3b96('0x3d')](handleError(_0x4b3431,null));};exports[_0x3b96('0x49')]=function(_0x25dcf0,_0x1a9565,_0x157fea){if(_0x25dcf0[_0x3b96('0x41')]['id']){delete _0x25dcf0[_0x3b96('0x41')]['id'];}return db[_0x3b96('0x28')][_0x3b96('0x45')]({'where':{'id':_0x25dcf0[_0x3b96('0x42')]['id']}})[_0x3b96('0x23')](handleEntityNotFound(_0x1a9565,null))['then'](function(_0x412d13){if(_0x412d13){_0x25dcf0['body'][_0x3b96('0x4a')]=_0x412d13['id'];_0x25dcf0['body'][_0x3b96('0x4b')]=integrations[_0x3b96('0x4c')](_0x25dcf0['body']['channel'],_0x25dcf0[_0x3b96('0x41')][_0x3b96('0x2a')]);_0x25dcf0['body'][_0x3b96('0x4d')]=integrations[_0x3b96('0x4e')](_0x25dcf0[_0x3b96('0x41')]['channel'],_0x25dcf0[_0x3b96('0x41')][_0x3b96('0x2a')]);return db[_0x3b96('0x46')][_0x3b96('0x40')](_0x25dcf0[_0x3b96('0x41')],{'include':[{'model':db[_0x3b96('0x4f')],'as':_0x3b96('0x4b')},{'model':db['FreshsalesField'],'as':_0x3b96('0x4d')}]});}return null;})['then'](respondWithResult(_0x1a9565,null))[_0x3b96('0x3d')](handleError(_0x1a9565,null));};exports['getFields']=function(_0x93f0e0,_0x5ed6d1,_0x73b682){var _0x299dd9='';var _0x2806dc='';return db[_0x3b96('0x28')][_0x3b96('0x45')]({'where':{'id':_0x93f0e0[_0x3b96('0x42')]['id']},'attributes':['id',_0x3b96('0x50'),_0x3b96('0x51'),_0x3b96('0x52')]})[_0x3b96('0x23')](handleEntityNotFound(_0x5ed6d1,null))[_0x3b96('0x23')](function(_0x307b0c){if(_0x307b0c){_0x2806dc=_0x307b0c['username'];_0x299dd9=_0x307b0c['remoteUri'];var _0x296c83=_0x307b0c[_0x3b96('0x51')][_0x3b96('0x53')](-0x1);if(_0x296c83==='/'){_0x299dd9=_0x299dd9['substring'](0x0,_0x299dd9[_0x3b96('0x54')](_0x296c83));}return rp({'method':_0x3b96('0x55'),'uri':util[_0x3b96('0x56')](_0x3b96('0x57'),_0x299dd9,_0x3b96('0x58')),'headers':{'Authorization':'Token\x20token='+_0x307b0c['apiKey']},'json':!![]});}})[_0x3b96('0x23')](function(_0x336c8b){if(_0x336c8b){var _0x57bc79=_0x336c8b[_0x3b96('0x59')];var _0x2984f1=![];var _0x409c66=null;for(_0x409c66=0x0;_0x409c66<_0x57bc79[_0x3b96('0x34')];_0x409c66++){if(_0x57bc79[_0x409c66][_0x3b96('0x5a')]===_0x2806dc){_0x2984f1=!![];}}if(_0x2984f1){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x5ed6d1,null))['catch'](function(_0x3f9f1f){var _0x432e48=_0x93f0e0[_0x3b96('0x2f')][_0x3b96('0x5b')]?0x1f4:_0x3f9f1f[_0x3b96('0x5c')]||0x1f4;logger[_0x3b96('0x5d')](_0x3b96('0x5e'),_0x3b96('0x5f'),_0x432e48,JSON[_0x3b96('0x60')](_0x3f9f1f));delete _0x3f9f1f['name'];if(_0x432e48===0x191){_0x432e48=0x190;}_0x5ed6d1[_0x3b96('0x17')](_0x432e48)['send'](_0x93f0e0[_0x3b96('0x2f')]['test']?{'message':_0x3b96('0x61'),'statusCode':_0x3f9f1f[_0x3b96('0x5c')]}:_0x3f9f1f);});}; \ No newline at end of file +var _0x9675=['Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','remoteUri','slice','substring','lastIndexOf','GET','format','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','fieldName','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','includeAll','catch','show','params','keys','rawAttributes','length','include','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId'];(function(_0xd5245f,_0x115080){var _0x2b9759=function(_0x5adb98){while(--_0x5adb98){_0xd5245f['push'](_0xd5245f['shift']());}};_0x2b9759(++_0x115080);}(_0x9675,0x191));var _0x5967=function(_0x9eff1e,_0x51c1a2){_0x9eff1e=_0x9eff1e-0x0;var _0x47a429=_0x9675[_0x9eff1e];return _0x47a429;};'use strict';var emlformat=require(_0x5967('0x0'));var rimraf=require(_0x5967('0x1'));var zipdir=require(_0x5967('0x2'));var jsonpatch=require(_0x5967('0x3'));var rp=require(_0x5967('0x4'));var moment=require(_0x5967('0x5'));var BPromise=require(_0x5967('0x6'));var Mustache=require(_0x5967('0x7'));var util=require(_0x5967('0x8'));var path=require(_0x5967('0x9'));var sox=require('sox');var csv=require(_0x5967('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5967('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5967('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5967('0xd'));var Papa=require('papaparse');var Redis=require(_0x5967('0xe'));var authService=require(_0x5967('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5967('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5967('0x11'))('api');var utils=require(_0x5967('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5967('0x13'));var db=require(_0x5967('0x14'))['db'];var integrations=require(_0x5967('0x15'));function respondWithStatusCode(_0x575313,_0x544aa4){_0x544aa4=_0x544aa4||0xcc;return function(_0x5bb802){if(_0x5bb802){return _0x575313['sendStatus'](_0x544aa4);}return _0x575313[_0x5967('0x16')](_0x544aa4)[_0x5967('0x17')]();};}function respondWithResult(_0x3e7558,_0x412263){_0x412263=_0x412263||0xc8;return function(_0xed2635){if(_0xed2635){return _0x3e7558[_0x5967('0x16')](_0x412263)[_0x5967('0x18')](_0xed2635);}};}function respondWithFilteredResult(_0x4059e3,_0x104d42){return function(_0x36cd09){if(_0x36cd09){var _0x5b1737=typeof _0x104d42['offset']===_0x5967('0x19')&&typeof _0x104d42[_0x5967('0x1a')]==='undefined';var _0x33a2f7=_0x36cd09[_0x5967('0x1b')];var _0x13ae07=_0x5b1737?0x0:_0x104d42[_0x5967('0x1c')];var _0x108a48=_0x5b1737?_0x36cd09[_0x5967('0x1b')]:_0x104d42[_0x5967('0x1c')]+_0x104d42[_0x5967('0x1a')];var _0x143834;if(_0x108a48>=_0x33a2f7){_0x108a48=_0x33a2f7;_0x143834=0xc8;}else{_0x143834=0xce;}_0x4059e3['status'](_0x143834);return _0x4059e3[_0x5967('0x1d')](_0x5967('0x1e'),_0x13ae07+'-'+_0x108a48+'/'+_0x33a2f7)['json'](_0x36cd09);}return null;};}function patchUpdates(_0x123166){return function(_0x3abc21){try{jsonpatch['apply'](_0x3abc21,_0x123166,!![]);}catch(_0x4159fa){return BPromise[_0x5967('0x1f')](_0x4159fa);}return _0x3abc21['save']();};}function saveUpdates(_0x3ae5df,_0x352ffb){return function(_0x16ef35){if(_0x16ef35){return _0x16ef35[_0x5967('0x20')](_0x3ae5df)[_0x5967('0x21')](function(_0x2b0753){return _0x2b0753;});}return null;};}function removeEntity(_0x23e2a4,_0x19bb70){return function(_0x4f560c){if(_0x4f560c){return _0x4f560c[_0x5967('0x22')]()[_0x5967('0x21')](function(){_0x23e2a4[_0x5967('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b2b32,_0x2223b4){return function(_0x1a3f23){if(!_0x1a3f23){_0x2b2b32['sendStatus'](0x194);}return _0x1a3f23;};}function handleError(_0x2aa935,_0x29f9f6){_0x29f9f6=_0x29f9f6||0x1f4;return function(_0x56c4ac){logger[_0x5967('0x23')](_0x56c4ac[_0x5967('0x24')]);if(_0x56c4ac[_0x5967('0x25')]){delete _0x56c4ac[_0x5967('0x25')];}_0x2aa935[_0x5967('0x16')](_0x29f9f6)[_0x5967('0x26')](_0x56c4ac);};}exports[_0x5967('0x27')]=function(_0x1b8b4f,_0x2b855b){var _0x4510e4={},_0x178ac0={},_0x167acd={'count':0x0,'rows':[]};var _0x4b42d9=_[_0x5967('0x28')](db[_0x5967('0x29')]['rawAttributes'],function(_0x248fff){return{'name':_0x248fff[_0x5967('0x2a')],'type':_0x248fff['type']['key']};});_0x178ac0[_0x5967('0x2b')]=_[_0x5967('0x28')](_0x4b42d9,_0x5967('0x25'));_0x178ac0['query']=_['keys'](_0x1b8b4f[_0x5967('0x2c')]);_0x178ac0[_0x5967('0x2d')]=_['intersection'](_0x178ac0[_0x5967('0x2b')],_0x178ac0[_0x5967('0x2c')]);_0x4510e4[_0x5967('0x2e')]=_[_0x5967('0x2f')](_0x178ac0['model'],qs[_0x5967('0x30')](_0x1b8b4f['query']['fields']));_0x4510e4[_0x5967('0x2e')]=_0x4510e4['attributes']['length']?_0x4510e4[_0x5967('0x2e')]:_0x178ac0[_0x5967('0x2b')];if(!_0x1b8b4f['query'][_0x5967('0x31')]('nolimit')){_0x4510e4[_0x5967('0x1a')]=qs[_0x5967('0x1a')](_0x1b8b4f[_0x5967('0x2c')][_0x5967('0x1a')]);_0x4510e4[_0x5967('0x1c')]=qs['offset'](_0x1b8b4f['query']['offset']);}_0x4510e4[_0x5967('0x32')]=qs[_0x5967('0x33')](_0x1b8b4f[_0x5967('0x2c')][_0x5967('0x33')]);_0x4510e4[_0x5967('0x34')]=qs['filters'](_[_0x5967('0x35')](_0x1b8b4f[_0x5967('0x2c')],_0x178ac0['filters']),_0x4b42d9);if(_0x1b8b4f[_0x5967('0x2c')][_0x5967('0x36')]){_0x4510e4[_0x5967('0x34')]=_['merge'](_0x4510e4[_0x5967('0x34')],{'$or':_[_0x5967('0x28')](_0x4b42d9,function(_0x2f06ea){if(_0x2f06ea[_0x5967('0x37')]!=='VIRTUAL'){var _0x193b79={};_0x193b79[_0x2f06ea[_0x5967('0x25')]]={'$like':'%'+_0x1b8b4f['query'][_0x5967('0x36')]+'%'};return _0x193b79;}})});}_0x4510e4=_[_0x5967('0x38')]({},_0x4510e4,_0x1b8b4f[_0x5967('0x39')]);var _0x3a07b0={'where':_0x4510e4[_0x5967('0x34')]};return db[_0x5967('0x29')][_0x5967('0x1b')](_0x3a07b0)[_0x5967('0x21')](function(_0x333e85){_0x167acd[_0x5967('0x1b')]=_0x333e85;if(_0x1b8b4f[_0x5967('0x2c')][_0x5967('0x3a')]){_0x4510e4['include']=[{'all':!![]}];}return db[_0x5967('0x29')]['findAll'](_0x4510e4);})[_0x5967('0x21')](function(_0x3abca0){_0x167acd['rows']=_0x3abca0;return _0x167acd;})[_0x5967('0x21')](respondWithFilteredResult(_0x2b855b,_0x4510e4))[_0x5967('0x3b')](handleError(_0x2b855b,null));};exports[_0x5967('0x3c')]=function(_0x1abb5f,_0x28a1fe){var _0x1311cf={'raw':![],'where':{'id':_0x1abb5f[_0x5967('0x3d')]['id']}},_0x465715={};_0x465715[_0x5967('0x2b')]=_[_0x5967('0x3e')](db[_0x5967('0x29')][_0x5967('0x3f')]);_0x465715[_0x5967('0x2c')]=_['keys'](_0x1abb5f[_0x5967('0x2c')]);_0x465715[_0x5967('0x2d')]=_[_0x5967('0x2f')](_0x465715[_0x5967('0x2b')],_0x465715['query']);_0x1311cf['attributes']=_[_0x5967('0x2f')](_0x465715['model'],qs[_0x5967('0x30')](_0x1abb5f[_0x5967('0x2c')]['fields']));_0x1311cf[_0x5967('0x2e')]=_0x1311cf[_0x5967('0x2e')][_0x5967('0x40')]?_0x1311cf[_0x5967('0x2e')]:_0x465715[_0x5967('0x2b')];if(_0x1abb5f[_0x5967('0x2c')][_0x5967('0x3a')]){_0x1311cf[_0x5967('0x41')]=[{'all':!![]}];}_0x1311cf=_[_0x5967('0x38')]({},_0x1311cf,_0x1abb5f[_0x5967('0x39')]);return db[_0x5967('0x29')][_0x5967('0x42')](_0x1311cf)[_0x5967('0x21')](handleEntityNotFound(_0x28a1fe,null))[_0x5967('0x21')](respondWithResult(_0x28a1fe,null))[_0x5967('0x3b')](handleError(_0x28a1fe,null));};exports[_0x5967('0x43')]=function(_0x225af0,_0x41c6f0){return db['FreshsalesAccount'][_0x5967('0x43')](_0x225af0[_0x5967('0x44')],{})[_0x5967('0x21')](respondWithResult(_0x41c6f0,0xc9))[_0x5967('0x3b')](handleError(_0x41c6f0,null));};exports[_0x5967('0x20')]=function(_0x554d18,_0x53bd1c){if(_0x554d18['body']['id']){delete _0x554d18[_0x5967('0x44')]['id'];}return db[_0x5967('0x29')][_0x5967('0x42')]({'where':{'id':_0x554d18[_0x5967('0x3d')]['id']}})[_0x5967('0x21')](handleEntityNotFound(_0x53bd1c,null))[_0x5967('0x21')](saveUpdates(_0x554d18[_0x5967('0x44')],null))[_0x5967('0x21')](respondWithResult(_0x53bd1c,null))['catch'](handleError(_0x53bd1c,null));};exports['destroy']=function(_0x4fdfee,_0x3513d7){return db['FreshsalesAccount'][_0x5967('0x42')]({'where':{'id':_0x4fdfee['params']['id']}})['then'](handleEntityNotFound(_0x3513d7,null))[_0x5967('0x21')](removeEntity(_0x3513d7,null))[_0x5967('0x3b')](handleError(_0x3513d7,null));};exports[_0x5967('0x45')]=function(_0x23a80d,_0xcf670b,_0xc19b4c){var _0x2ce277={};var _0x57c1c9={};var _0x37164a;var _0x4a7b68;return db[_0x5967('0x29')][_0x5967('0x46')]({'where':{'id':_0x23a80d[_0x5967('0x3d')]['id']}})[_0x5967('0x21')](handleEntityNotFound(_0xcf670b,null))['then'](function(_0x220833){if(_0x220833){_0x37164a=_0x220833;_0x57c1c9[_0x5967('0x2b')]=_[_0x5967('0x3e')](db[_0x5967('0x47')][_0x5967('0x3f')]);_0x57c1c9[_0x5967('0x2c')]=_[_0x5967('0x3e')](_0x23a80d[_0x5967('0x2c')]);_0x57c1c9[_0x5967('0x2d')]=_[_0x5967('0x2f')](_0x57c1c9['model'],_0x57c1c9[_0x5967('0x2c')]);_0x2ce277[_0x5967('0x2e')]=_['intersection'](_0x57c1c9[_0x5967('0x2b')],qs[_0x5967('0x30')](_0x23a80d[_0x5967('0x2c')][_0x5967('0x30')]));_0x2ce277[_0x5967('0x2e')]=_0x2ce277[_0x5967('0x2e')][_0x5967('0x40')]?_0x2ce277[_0x5967('0x2e')]:_0x57c1c9['model'];_0x2ce277[_0x5967('0x32')]=qs[_0x5967('0x33')](_0x23a80d[_0x5967('0x2c')][_0x5967('0x33')]);_0x2ce277[_0x5967('0x34')]=qs['filters'](_['pick'](_0x23a80d[_0x5967('0x2c')],_0x57c1c9[_0x5967('0x2d')]));if(_0x23a80d[_0x5967('0x2c')][_0x5967('0x36')]){_0x2ce277[_0x5967('0x34')]=_[_0x5967('0x38')](_0x2ce277['where'],{'$or':_[_0x5967('0x28')](_0x2ce277['attributes'],function(_0x429ee1){var _0x4eeed1={};_0x4eeed1[_0x429ee1]={'$like':'%'+_0x23a80d[_0x5967('0x2c')]['filter']+'%'};return _0x4eeed1;})});}_0x2ce277=_[_0x5967('0x38')]({},_0x2ce277,_0x23a80d[_0x5967('0x39')]);return _0x37164a[_0x5967('0x45')](_0x2ce277);}})[_0x5967('0x21')](function(_0x352485){if(_0x352485){_0x4a7b68=_0x352485[_0x5967('0x40')];if(!_0x23a80d[_0x5967('0x2c')][_0x5967('0x31')]('nolimit')){_0x2ce277[_0x5967('0x1a')]=qs[_0x5967('0x1a')](_0x23a80d[_0x5967('0x2c')][_0x5967('0x1a')]);_0x2ce277[_0x5967('0x1c')]=qs[_0x5967('0x1c')](_0x23a80d[_0x5967('0x2c')][_0x5967('0x1c')]);}return _0x37164a['getConfigurations'](_0x2ce277);}})[_0x5967('0x21')](function(_0x384916){if(_0x384916){return _0x384916?{'count':_0x4a7b68,'rows':_0x384916}:null;}})['then'](respondWithResult(_0xcf670b,null))[_0x5967('0x3b')](handleError(_0xcf670b,null));};exports[_0x5967('0x48')]=function(_0x530f7e,_0x416bf9,_0x10011a){if(_0x530f7e['body']['id']){delete _0x530f7e[_0x5967('0x44')]['id'];}return db[_0x5967('0x29')][_0x5967('0x46')]({'where':{'id':_0x530f7e[_0x5967('0x3d')]['id']}})['then'](handleEntityNotFound(_0x416bf9,null))[_0x5967('0x21')](function(_0x5c445a){if(_0x5c445a){_0x530f7e[_0x5967('0x44')][_0x5967('0x49')]=_0x5c445a['id'];_0x530f7e['body'][_0x5967('0x4a')]=integrations[_0x5967('0x4b')](_0x530f7e['body']['channel'],_0x530f7e[_0x5967('0x44')]['type']);_0x530f7e['body'][_0x5967('0x4c')]=integrations[_0x5967('0x4d')](_0x530f7e[_0x5967('0x44')][_0x5967('0x4e')],_0x530f7e['body'][_0x5967('0x37')]);return db[_0x5967('0x47')][_0x5967('0x43')](_0x530f7e['body'],{'include':[{'model':db[_0x5967('0x4f')],'as':_0x5967('0x4a')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0x5967('0x21')](respondWithResult(_0x416bf9,null))[_0x5967('0x3b')](handleError(_0x416bf9,null));};exports['getFields']=function(_0x387ab9,_0x7f8470,_0x5be391){var _0xee93d4='';var _0x473c86='';return db[_0x5967('0x29')][_0x5967('0x46')]({'where':{'id':_0x387ab9['params']['id']},'attributes':['id','username',_0x5967('0x50'),'apiKey']})[_0x5967('0x21')](handleEntityNotFound(_0x7f8470,null))[_0x5967('0x21')](function(_0x3075f){if(_0x3075f){_0x473c86=_0x3075f['username'];_0xee93d4=_0x3075f[_0x5967('0x50')];var _0x2ae168=_0x3075f[_0x5967('0x50')][_0x5967('0x51')](-0x1);if(_0x2ae168==='/'){_0xee93d4=_0xee93d4[_0x5967('0x52')](0x0,_0xee93d4[_0x5967('0x53')](_0x2ae168));}return rp({'method':_0x5967('0x54'),'uri':util[_0x5967('0x55')]('%s%s',_0xee93d4,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x3075f[_0x5967('0x56')]},'json':!![]});}})[_0x5967('0x21')](function(_0x1622cd){if(_0x1622cd){var _0x5364f2=_0x1622cd[_0x5967('0x57')];var _0x2a53c4=![];var _0x415b6a=null;for(_0x415b6a=0x0;_0x415b6a<_0x5364f2[_0x5967('0x40')];_0x415b6a++){if(_0x5364f2[_0x415b6a][_0x5967('0x58')]===_0x473c86){_0x2a53c4=!![];}}if(_0x2a53c4){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x5967('0x59')});}}})[_0x5967('0x21')](respondWithResult(_0x7f8470,null))['catch'](function(_0x5b9542){var _0x49d82d=_0x387ab9[_0x5967('0x2c')][_0x5967('0x5a')]?0x1f4:_0x5b9542[_0x5967('0x5b')]||0x1f4;logger[_0x5967('0x23')](_0x5967('0x5c'),_0x5967('0x5d'),_0x49d82d,JSON[_0x5967('0x5e')](_0x5b9542));delete _0x5b9542[_0x5967('0x25')];if(_0x49d82d===0x191){_0x49d82d=0x190;}_0x7f8470[_0x5967('0x16')](_0x49d82d)[_0x5967('0x26')](_0x387ab9[_0x5967('0x2c')][_0x5967('0x5a')]?{'message':'Wrong\x20credentials','statusCode':_0x5b9542['statusCode']}:_0x5b9542);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index d3b1711..c627b33 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 _0x0120=['../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5a8f0d,_0x1d5da5){var _0x5269ff=function(_0x246f07){while(--_0x246f07){_0x5a8f0d['push'](_0x5a8f0d['shift']());}};_0x5269ff(++_0x1d5da5);}(_0x0120,0x6f));var _0x0012=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x0120[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));var integrations=require(_0x0012('0xb'));module['exports']=function(_0x4b396c,_0x59980a){return _0x4b396c[_0x0012('0xc')](_0x0012('0xd'),attributes,{'tableName':_0x0012('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a37=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util'];(function(_0x483e77,_0x433e9b){var _0x359df0=function(_0x3c3d57){while(--_0x3c3d57){_0x483e77['push'](_0x483e77['shift']());}};_0x359df0(++_0x433e9b);}(_0x1a37,0xb4));var _0x71a3=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x1a37[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var logger=require(_0x71a3('0x2'))(_0x71a3('0x3'));var moment=require(_0x71a3('0x4'));var BPromise=require(_0x71a3('0x5'));var rp=require(_0x71a3('0x6'));var fs=require('fs');var path=require(_0x71a3('0x7'));var rimraf=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x71a3('0xa'));module['exports']=function(_0xd09f7,_0x45050a){return _0xd09f7[_0x71a3('0xb')](_0x71a3('0xc'),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 39f7deb..8c43e79 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 _0x2da6=['info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FreshsalesAccount','options','raw','where','attributes','include','map','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then'];(function(_0x36e059,_0x19ee27){var _0x52ee13=function(_0x3dbfb1){while(--_0x3dbfb1){_0x36e059['push'](_0x36e059['shift']());}};_0x52ee13(++_0x19ee27);}(_0x2da6,0x1dd));var _0x62da=function(_0x59f6fb,_0x3a0307){_0x59f6fb=_0x59f6fb-0x0;var _0x5c0daa=_0x2da6[_0x59f6fb];return _0x5c0daa;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});}exports['GetFreshsalesAccount']=function(_0xa7050b){var _0x4ae4fb=this;return new Promise(function(_0x4d6482,_0x264366){return db[_0x62da('0x18')]['findAll']({'raw':_0xa7050b[_0x62da('0x19')]?_0xa7050b['options'][_0x62da('0x1a')]===undefined?!![]:![]:!![],'where':_0xa7050b[_0x62da('0x19')]?_0xa7050b[_0x62da('0x19')][_0x62da('0x1b')]||null:null,'attributes':_0xa7050b[_0x62da('0x19')]?_0xa7050b[_0x62da('0x19')][_0x62da('0x1c')]||null:null,'limit':_0xa7050b[_0x62da('0x19')]?_0xa7050b[_0x62da('0x19')]['limit']||null:null,'include':_0xa7050b[_0x62da('0x19')]?_0xa7050b[_0x62da('0x19')][_0x62da('0x1d')]?_[_0x62da('0x1e')](_0xa7050b[_0x62da('0x19')][_0x62da('0x1d')],function(_0x24298a){return{'model':db[_0x24298a['model']],'as':_0x24298a['as'],'attributes':_0x24298a['attributes'],'include':_0x24298a['include']?_[_0x62da('0x1e')](_0x24298a[_0x62da('0x1d')],function(_0x14897c){return{'model':db[_0x14897c[_0x62da('0x1f')]],'as':_0x14897c['as'],'attributes':_0x14897c['attributes'],'include':_0x14897c[_0x62da('0x1d')]?_[_0x62da('0x1e')](_0x14897c['include'],function(_0x3ccf96){return{'model':db[_0x3ccf96[_0x62da('0x1f')]],'as':_0x3ccf96['as'],'attributes':_0x3ccf96[_0x62da('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41de3a){logger[_0x62da('0xd')](_0x62da('0x20'),_0xa7050b);logger['debug']('GetFreshsalesAccount',_0xa7050b,JSON[_0x62da('0x12')](_0x41de3a));_0x4d6482(_0x41de3a);})[_0x62da('0x17')](function(_0x220ffc){logger['error'](_0x62da('0x20'),_0x220ffc[_0x62da('0x15')],_0xa7050b);_0x264366(_0x4ae4fb[_0x62da('0x13')](0x1f4,_0x220ffc[_0x62da('0x15')]));});});};exports[_0x62da('0x21')]=function(_0x1cf765){var _0x592c6c=this;return new Promise(function(_0xbe398f,_0x4f71bc){return db[_0x62da('0x18')][_0x62da('0x22')]({'raw':_0x1cf765[_0x62da('0x19')]?_0x1cf765[_0x62da('0x19')][_0x62da('0x1a')]===undefined?!![]:![]:!![],'where':_0x1cf765[_0x62da('0x19')]?_0x1cf765['options'][_0x62da('0x1b')]||null:null,'attributes':_0x1cf765[_0x62da('0x19')]?_0x1cf765[_0x62da('0x19')]['attributes']||null:null,'include':_0x1cf765[_0x62da('0x19')]?_0x1cf765[_0x62da('0x19')][_0x62da('0x1d')]?_['map'](_0x1cf765[_0x62da('0x19')][_0x62da('0x1d')],function(_0x55eda7){return{'model':db[_0x55eda7[_0x62da('0x1f')]],'as':_0x55eda7['as'],'attributes':_0x55eda7[_0x62da('0x1c')],'include':_0x55eda7['include']?_[_0x62da('0x1e')](_0x55eda7[_0x62da('0x1d')],function(_0x11bf73){return{'model':db[_0x11bf73[_0x62da('0x1f')]],'as':_0x11bf73['as'],'attributes':_0x11bf73[_0x62da('0x1c')],'include':_0x11bf73[_0x62da('0x1d')]?_[_0x62da('0x1e')](_0x11bf73[_0x62da('0x1d')],function(_0x2f1115){return{'model':db[_0x2f1115[_0x62da('0x1f')]],'as':_0x2f1115['as'],'attributes':_0x2f1115[_0x62da('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x62da('0xc')](function(_0x3057f6){logger[_0x62da('0xd')](_0x62da('0x21'),_0x1cf765);logger[_0x62da('0xf')](_0x62da('0x21'),_0x1cf765,JSON['stringify'](_0x3057f6));_0xbe398f(_0x3057f6);})[_0x62da('0x17')](function(_0x5e9295){logger[_0x62da('0x13')](_0x62da('0x21'),_0x5e9295[_0x62da('0x15')],_0x1cf765);_0x4f71bc(_0x592c6c['error'](0x1f4,_0x5e9295[_0x62da('0x15')]));});});}; \ No newline at end of file +var _0xb016=['include','model','debug','ShowFreshsalesAccount','find','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xb016,0x159));var _0x6b01=function(_0x55cd37,_0x433927){_0x55cd37=_0x55cd37-0x0;var _0x4a9b83=_0xb016[_0x55cd37];return _0x4a9b83;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});}exports[_0x6b01('0x14')]=function(_0x9c6571){var _0xc4e1b1=this;return new Promise(function(_0x18f336,_0x4f2d08){return db[_0x6b01('0x15')][_0x6b01('0x16')]({'raw':_0x9c6571[_0x6b01('0x17')]?_0x9c6571[_0x6b01('0x17')][_0x6b01('0x18')]===undefined?!![]:![]:!![],'where':_0x9c6571[_0x6b01('0x17')]?_0x9c6571[_0x6b01('0x17')][_0x6b01('0x19')]||null:null,'attributes':_0x9c6571['options']?_0x9c6571[_0x6b01('0x17')][_0x6b01('0x1a')]||null:null,'limit':_0x9c6571[_0x6b01('0x17')]?_0x9c6571[_0x6b01('0x17')][_0x6b01('0x1b')]||null:null,'include':_0x9c6571[_0x6b01('0x17')]?_0x9c6571[_0x6b01('0x17')]['include']?_[_0x6b01('0x1c')](_0x9c6571[_0x6b01('0x17')][_0x6b01('0x1d')],function(_0x51243c){return{'model':db[_0x51243c[_0x6b01('0x1e')]],'as':_0x51243c['as'],'attributes':_0x51243c[_0x6b01('0x1a')],'include':_0x51243c[_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x51243c[_0x6b01('0x1d')],function(_0x2456e9){return{'model':db[_0x2456e9[_0x6b01('0x1e')]],'as':_0x2456e9['as'],'attributes':_0x2456e9[_0x6b01('0x1a')],'include':_0x2456e9[_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x2456e9[_0x6b01('0x1d')],function(_0xa846d8){return{'model':db[_0xa846d8[_0x6b01('0x1e')]],'as':_0xa846d8['as'],'attributes':_0xa846d8['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b01('0xa')](function(_0x220efb){logger[_0x6b01('0xb')](_0x6b01('0x14'),_0x9c6571);logger[_0x6b01('0x1f')]('GetFreshsalesAccount',_0x9c6571,JSON['stringify'](_0x220efb));_0x18f336(_0x220efb);})[_0x6b01('0x13')](function(_0x3df3d4){logger[_0x6b01('0xf')](_0x6b01('0x14'),_0x3df3d4[_0x6b01('0x11')],_0x9c6571);_0x4f2d08(_0xc4e1b1[_0x6b01('0xf')](0x1f4,_0x3df3d4['message']));});});};exports[_0x6b01('0x20')]=function(_0x5482a8){var _0x3942d7=this;return new Promise(function(_0x4e7e32,_0x6920cf){return db[_0x6b01('0x15')][_0x6b01('0x21')]({'raw':_0x5482a8[_0x6b01('0x17')]?_0x5482a8[_0x6b01('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5482a8[_0x6b01('0x17')]?_0x5482a8[_0x6b01('0x17')][_0x6b01('0x19')]||null:null,'attributes':_0x5482a8['options']?_0x5482a8['options'][_0x6b01('0x1a')]||null:null,'include':_0x5482a8['options']?_0x5482a8[_0x6b01('0x17')][_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x5482a8['options'][_0x6b01('0x1d')],function(_0x42d5f7){return{'model':db[_0x42d5f7[_0x6b01('0x1e')]],'as':_0x42d5f7['as'],'attributes':_0x42d5f7['attributes'],'include':_0x42d5f7[_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x42d5f7[_0x6b01('0x1d')],function(_0x2eb34f){return{'model':db[_0x2eb34f[_0x6b01('0x1e')]],'as':_0x2eb34f['as'],'attributes':_0x2eb34f['attributes'],'include':_0x2eb34f[_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x2eb34f[_0x6b01('0x1d')],function(_0x5269c7){return{'model':db[_0x5269c7[_0x6b01('0x1e')]],'as':_0x5269c7['as'],'attributes':_0x5269c7[_0x6b01('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6b01('0xa')](function(_0x3154d7){logger['info'](_0x6b01('0x20'),_0x5482a8);logger['debug'](_0x6b01('0x20'),_0x5482a8,JSON[_0x6b01('0xe')](_0x3154d7));_0x4e7e32(_0x3154d7);})[_0x6b01('0x13')](function(_0x318b8b){logger[_0x6b01('0xf')](_0x6b01('0x20'),_0x318b8b[_0x6b01('0x11')],_0x5482a8);_0x6920cf(_0x3942d7['error'](0x1f4,_0x318b8b[_0x6b01('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 6edea1e..2c56795 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 _0xcb53=['post','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields'];(function(_0x411494,_0x28dcc6){var _0x55cc7b=function(_0x348373){while(--_0x348373){_0x411494['push'](_0x411494['shift']());}};_0x55cc7b(++_0x28dcc6);}(_0xcb53,0x65));var _0x3cb5=function(_0x294624,_0x452540){_0x294624=_0x294624-0x0;var _0x3b9a96=_0xcb53[_0x294624];return _0x3b9a96;};'use strict';var multer=require(_0x3cb5('0x0'));var util=require(_0x3cb5('0x1'));var path=require('path');var timeout=require(_0x3cb5('0x2'));var express=require(_0x3cb5('0x3'));var router=express[_0x3cb5('0x4')]();var fs_extra=require(_0x3cb5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3cb5('0x6'));var config=require(_0x3cb5('0x7'));var controller=require(_0x3cb5('0x8'));router[_0x3cb5('0x9')]('/',auth[_0x3cb5('0xa')](),controller[_0x3cb5('0xb')]);router[_0x3cb5('0x9')](_0x3cb5('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x3cb5('0x9')](_0x3cb5('0xd'),auth[_0x3cb5('0xa')](),controller[_0x3cb5('0xe')]);router[_0x3cb5('0x9')](_0x3cb5('0xf'),auth[_0x3cb5('0xa')](),controller[_0x3cb5('0x10')]);router[_0x3cb5('0x9')](_0x3cb5('0x11'),auth['isAuthenticated'](),controller[_0x3cb5('0x12')]);router[_0x3cb5('0x13')]('/',auth[_0x3cb5('0xa')](),controller['create']);router[_0x3cb5('0x14')]('/:id',auth[_0x3cb5('0xa')](),controller[_0x3cb5('0x15')]);router['delete'](_0x3cb5('0xc'),auth['isAuthenticated'](),controller[_0x3cb5('0x16')]);module[_0x3cb5('0x17')]=router; \ No newline at end of file +var _0xb8b5=['../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id/subjects','getDescriptions','/:id/fields','getFields','post','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0xb8b5,0x121));var _0x5b8b=function(_0x523130,_0x4b34ab){_0x523130=_0x523130-0x0;var _0x394756=_0xb8b5[_0x523130];return _0x394756;};'use strict';var multer=require(_0x5b8b('0x0'));var util=require(_0x5b8b('0x1'));var path=require('path');var timeout=require(_0x5b8b('0x2'));var express=require(_0x5b8b('0x3'));var router=express[_0x5b8b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5b8b('0x5'));var config=require(_0x5b8b('0x6'));var controller=require(_0x5b8b('0x7'));router['get']('/',auth[_0x5b8b('0x8')](),controller[_0x5b8b('0x9')]);router[_0x5b8b('0xa')]('/:id',auth[_0x5b8b('0x8')](),controller['show']);router[_0x5b8b('0xa')](_0x5b8b('0xb'),auth[_0x5b8b('0x8')](),controller['getSubjects']);router[_0x5b8b('0xa')]('/:id/descriptions',auth[_0x5b8b('0x8')](),controller[_0x5b8b('0xc')]);router[_0x5b8b('0xa')](_0x5b8b('0xd'),auth[_0x5b8b('0x8')](),controller[_0x5b8b('0xe')]);router[_0x5b8b('0xf')]('/',auth[_0x5b8b('0x8')](),controller['create']);router[_0x5b8b('0x10')](_0x5b8b('0x11'),auth[_0x5b8b('0x8')](),controller['update']);router[_0x5b8b('0x12')]('/:id',auth[_0x5b8b('0x8')](),controller[_0x5b8b('0x13')]);module[_0x5b8b('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 0446ee1..df01b17 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 _0xb7cb=['sequelize','exports','STRING'];(function(_0x4c2397,_0x4e7548){var _0x51215c=function(_0x18d77d){while(--_0x18d77d){_0x4c2397['push'](_0x4c2397['shift']());}};_0x51215c(++_0x4e7548);}(_0xb7cb,0x120));var _0xbb7c=function(_0x401ccd,_0x140815){_0x401ccd=_0x401ccd-0x0;var _0x5a57ad=_0xb7cb[_0x401ccd];return _0x5a57ad;};'use strict';var Sequelize=require(_0xbb7c('0x0'));module[_0xbb7c('0x1')]={'name':{'type':Sequelize[_0xbb7c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x08b3=['sequelize','STRING'];(function(_0x4fd440,_0x145308){var _0xb93a26=function(_0x3a17f2){while(--_0x3a17f2){_0x4fd440['push'](_0x4fd440['shift']());}};_0xb93a26(++_0x145308);}(_0x08b3,0x1ec));var _0x308b=function(_0x21f1d2,_0x51028e){_0x21f1d2=_0x21f1d2-0x0;var _0x20cc05=_0x08b3[_0x21f1d2];return _0x20cc05;};'use strict';var Sequelize=require(_0x308b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x308b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 665c763..00fcad8 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 _0xe851=['keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','find','create','body','getSubjects','findOne','params','FreshsalesField','getDescriptions','nolimit','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model'];(function(_0x21f847,_0x48f3ca){var _0x51c672=function(_0x46e6a2){while(--_0x46e6a2){_0x21f847['push'](_0x21f847['shift']());}};_0x51c672(++_0x48f3ca);}(_0xe851,0x163));var _0x1e85=function(_0x2f176e,_0x3208e6){_0x2f176e=_0x2f176e-0x0;var _0x1e544d=_0xe851[_0x2f176e];return _0x1e544d;};'use strict';var emlformat=require(_0x1e85('0x0'));var rimraf=require(_0x1e85('0x1'));var zipdir=require(_0x1e85('0x2'));var jsonpatch=require(_0x1e85('0x3'));var rp=require(_0x1e85('0x4'));var moment=require(_0x1e85('0x5'));var BPromise=require(_0x1e85('0x6'));var Mustache=require(_0x1e85('0x7'));var util=require('util');var path=require(_0x1e85('0x8'));var sox=require(_0x1e85('0x9'));var csv=require(_0x1e85('0xa'));var ejs=require(_0x1e85('0xb'));var fs=require('fs');var fs_extra=require(_0x1e85('0xc'));var _=require(_0x1e85('0xd'));var squel=require(_0x1e85('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1e85('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e85('0x10'));var Redis=require(_0x1e85('0x11'));var authService=require(_0x1e85('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1e85('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1e85('0x14'));var utils=require(_0x1e85('0x15'));var config=require(_0x1e85('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1e85('0x17'))['db'];function respondWithStatusCode(_0x4bd06d,_0x584a04){_0x584a04=_0x584a04||0xcc;return function(_0x231137){if(_0x231137){return _0x4bd06d[_0x1e85('0x18')](_0x584a04);}return _0x4bd06d['status'](_0x584a04)[_0x1e85('0x19')]();};}function respondWithResult(_0x53e6e9,_0x58ba9f){_0x58ba9f=_0x58ba9f||0xc8;return function(_0x59705d){if(_0x59705d){return _0x53e6e9[_0x1e85('0x1a')](_0x58ba9f)[_0x1e85('0x1b')](_0x59705d);}};}function respondWithFilteredResult(_0x5157bc,_0x378152){return function(_0x1ef504){if(_0x1ef504){var _0x129b2a=typeof _0x378152['offset']===_0x1e85('0x1c')&&typeof _0x378152['limit']===_0x1e85('0x1c');var _0x441e0e=_0x1ef504['count'];var _0x4f7060=_0x129b2a?0x0:_0x378152[_0x1e85('0x1d')];var _0x284062=_0x129b2a?_0x1ef504['count']:_0x378152[_0x1e85('0x1d')]+_0x378152[_0x1e85('0x1e')];var _0x43c439;if(_0x284062>=_0x441e0e){_0x284062=_0x441e0e;_0x43c439=0xc8;}else{_0x43c439=0xce;}_0x5157bc[_0x1e85('0x1a')](_0x43c439);return _0x5157bc[_0x1e85('0x1f')](_0x1e85('0x20'),_0x4f7060+'-'+_0x284062+'/'+_0x441e0e)['json'](_0x1ef504);}return null;};}function patchUpdates(_0x1a8fe5){return function(_0x427e9d){try{jsonpatch[_0x1e85('0x21')](_0x427e9d,_0x1a8fe5,!![]);}catch(_0x1cad00){return BPromise[_0x1e85('0x22')](_0x1cad00);}return _0x427e9d['save']();};}function saveUpdates(_0x1cd664,_0x2fb3cf){return function(_0x238444){if(_0x238444){return _0x238444[_0x1e85('0x23')](_0x1cd664)[_0x1e85('0x24')](function(_0x5100bc){return _0x5100bc;});}return null;};}function removeEntity(_0x1bb873,_0xb4de9d){return function(_0x21ef42){if(_0x21ef42){return _0x21ef42[_0x1e85('0x25')]()['then'](function(){_0x1bb873[_0x1e85('0x1a')](0xcc)[_0x1e85('0x19')]();});}};}function handleEntityNotFound(_0x181267,_0x4c74d1){return function(_0x2dd7ed){if(!_0x2dd7ed){_0x181267[_0x1e85('0x18')](0x194);}return _0x2dd7ed;};}function handleError(_0x36cdb8,_0x39d50c){_0x39d50c=_0x39d50c||0x1f4;return function(_0x516330){logger[_0x1e85('0x26')](_0x516330[_0x1e85('0x27')]);if(_0x516330['name']){delete _0x516330[_0x1e85('0x28')];}_0x36cdb8['status'](_0x39d50c)[_0x1e85('0x29')](_0x516330);};}exports[_0x1e85('0x2a')]=function(_0x32d2d5,_0x5b6ff9){var _0x3aefc4={},_0x4b10c4={},_0x1c8904={'count':0x0,'rows':[]};var _0x222717=_[_0x1e85('0x2b')](db[_0x1e85('0x2c')][_0x1e85('0x2d')],function(_0x164da6){return{'name':_0x164da6[_0x1e85('0x2e')],'type':_0x164da6[_0x1e85('0x2f')][_0x1e85('0x30')]};});_0x4b10c4[_0x1e85('0x31')]=_[_0x1e85('0x2b')](_0x222717,_0x1e85('0x28'));_0x4b10c4['query']=_[_0x1e85('0x32')](_0x32d2d5[_0x1e85('0x33')]);_0x4b10c4[_0x1e85('0x34')]=_[_0x1e85('0x35')](_0x4b10c4['model'],_0x4b10c4['query']);_0x3aefc4[_0x1e85('0x36')]=_[_0x1e85('0x35')](_0x4b10c4[_0x1e85('0x31')],qs['fields'](_0x32d2d5['query'][_0x1e85('0x37')]));_0x3aefc4[_0x1e85('0x36')]=_0x3aefc4[_0x1e85('0x36')][_0x1e85('0x38')]?_0x3aefc4[_0x1e85('0x36')]:_0x4b10c4['model'];if(!_0x32d2d5[_0x1e85('0x33')][_0x1e85('0x39')]('nolimit')){_0x3aefc4[_0x1e85('0x1e')]=qs[_0x1e85('0x1e')](_0x32d2d5[_0x1e85('0x33')][_0x1e85('0x1e')]);_0x3aefc4[_0x1e85('0x1d')]=qs[_0x1e85('0x1d')](_0x32d2d5['query'][_0x1e85('0x1d')]);}_0x3aefc4['order']=qs['sort'](_0x32d2d5[_0x1e85('0x33')][_0x1e85('0x3a')]);_0x3aefc4['where']=qs['filters'](_[_0x1e85('0x3b')](_0x32d2d5[_0x1e85('0x33')],_0x4b10c4[_0x1e85('0x34')]),_0x222717);if(_0x32d2d5[_0x1e85('0x33')][_0x1e85('0x3c')]){_0x3aefc4['where']=_[_0x1e85('0x3d')](_0x3aefc4[_0x1e85('0x3e')],{'$or':_[_0x1e85('0x2b')](_0x222717,function(_0x3e56e6){if(_0x3e56e6['type']!==_0x1e85('0x3f')){var _0x8a48b5={};_0x8a48b5[_0x3e56e6[_0x1e85('0x28')]]={'$like':'%'+_0x32d2d5['query']['filter']+'%'};return _0x8a48b5;}})});}_0x3aefc4=_[_0x1e85('0x3d')]({},_0x3aefc4,_0x32d2d5[_0x1e85('0x40')]);var _0x1b606f={'where':_0x3aefc4[_0x1e85('0x3e')]};return db[_0x1e85('0x2c')]['count'](_0x1b606f)[_0x1e85('0x24')](function(_0x521e0c){_0x1c8904[_0x1e85('0x41')]=_0x521e0c;if(_0x32d2d5[_0x1e85('0x33')][_0x1e85('0x42')]){_0x3aefc4[_0x1e85('0x43')]=[{'all':!![]}];}return db[_0x1e85('0x2c')][_0x1e85('0x44')](_0x3aefc4);})[_0x1e85('0x24')](function(_0x56b8d3){_0x1c8904[_0x1e85('0x45')]=_0x56b8d3;return _0x1c8904;})[_0x1e85('0x24')](respondWithFilteredResult(_0x5b6ff9,_0x3aefc4))[_0x1e85('0x46')](handleError(_0x5b6ff9,null));};exports['show']=function(_0x177ffc,_0x149f66){var _0x4ed633={'raw':![],'where':{'id':_0x177ffc['params']['id']}},_0x19422f={};_0x19422f[_0x1e85('0x31')]=_['keys'](db[_0x1e85('0x2c')][_0x1e85('0x2d')]);_0x19422f[_0x1e85('0x33')]=_[_0x1e85('0x32')](_0x177ffc['query']);_0x19422f[_0x1e85('0x34')]=_[_0x1e85('0x35')](_0x19422f[_0x1e85('0x31')],_0x19422f[_0x1e85('0x33')]);_0x4ed633['attributes']=_[_0x1e85('0x35')](_0x19422f[_0x1e85('0x31')],qs[_0x1e85('0x37')](_0x177ffc[_0x1e85('0x33')][_0x1e85('0x37')]));_0x4ed633[_0x1e85('0x36')]=_0x4ed633['attributes'][_0x1e85('0x38')]?_0x4ed633[_0x1e85('0x36')]:_0x19422f[_0x1e85('0x31')];if(_0x177ffc[_0x1e85('0x33')][_0x1e85('0x42')]){_0x4ed633[_0x1e85('0x43')]=[{'all':!![]}];}_0x4ed633=_[_0x1e85('0x3d')]({},_0x4ed633,_0x177ffc[_0x1e85('0x40')]);return db['FreshsalesConfiguration'][_0x1e85('0x47')](_0x4ed633)[_0x1e85('0x24')](handleEntityNotFound(_0x149f66,null))[_0x1e85('0x24')](respondWithResult(_0x149f66,null))[_0x1e85('0x46')](handleError(_0x149f66,null));};exports['create']=function(_0x2e962d,_0x48e54e){return db['FreshsalesConfiguration'][_0x1e85('0x48')](_0x2e962d[_0x1e85('0x49')],{})[_0x1e85('0x24')](respondWithResult(_0x48e54e,0xc9))[_0x1e85('0x46')](handleError(_0x48e54e,null));};exports[_0x1e85('0x23')]=function(_0x4189b2,_0x212b8e){if(_0x4189b2[_0x1e85('0x49')]['id']){delete _0x4189b2[_0x1e85('0x49')]['id'];}return db[_0x1e85('0x2c')]['find']({'where':{'id':_0x4189b2['params']['id']}})[_0x1e85('0x24')](handleEntityNotFound(_0x212b8e,null))['then'](saveUpdates(_0x4189b2[_0x1e85('0x49')],null))['then'](respondWithResult(_0x212b8e,null))['catch'](handleError(_0x212b8e,null));};exports[_0x1e85('0x25')]=function(_0x208adc,_0x2e533f){return db['FreshsalesConfiguration'][_0x1e85('0x47')]({'where':{'id':_0x208adc['params']['id']}})['then'](handleEntityNotFound(_0x2e533f,null))[_0x1e85('0x24')](removeEntity(_0x2e533f,null))[_0x1e85('0x46')](handleError(_0x2e533f,null));};exports[_0x1e85('0x4a')]=function(_0x51e74e,_0x4a4343,_0x49f53e){var _0x21e937={};var _0x5be14f={};var _0x4e6af4;var _0x2fdc9f;return db['FreshsalesConfiguration'][_0x1e85('0x4b')]({'where':{'id':_0x51e74e[_0x1e85('0x4c')]['id']}})[_0x1e85('0x24')](handleEntityNotFound(_0x4a4343,null))[_0x1e85('0x24')](function(_0x17dc22){if(_0x17dc22){_0x4e6af4=_0x17dc22;_0x5be14f['model']=_[_0x1e85('0x32')](db[_0x1e85('0x4d')][_0x1e85('0x2d')]);_0x5be14f[_0x1e85('0x33')]=_[_0x1e85('0x32')](_0x51e74e[_0x1e85('0x33')]);_0x5be14f[_0x1e85('0x34')]=_['intersection'](_0x5be14f['model'],_0x5be14f[_0x1e85('0x33')]);_0x21e937[_0x1e85('0x36')]=_[_0x1e85('0x35')](_0x5be14f[_0x1e85('0x31')],qs[_0x1e85('0x37')](_0x51e74e[_0x1e85('0x33')][_0x1e85('0x37')]));_0x21e937[_0x1e85('0x36')]=_0x21e937[_0x1e85('0x36')][_0x1e85('0x38')]?_0x21e937[_0x1e85('0x36')]:_0x5be14f[_0x1e85('0x31')];_0x21e937['order']=qs[_0x1e85('0x3a')](_0x51e74e[_0x1e85('0x33')][_0x1e85('0x3a')]);_0x21e937[_0x1e85('0x3e')]=qs[_0x1e85('0x34')](_[_0x1e85('0x3b')](_0x51e74e['query'],_0x5be14f[_0x1e85('0x34')]));if(_0x51e74e[_0x1e85('0x33')][_0x1e85('0x3c')]){_0x21e937[_0x1e85('0x3e')]=_[_0x1e85('0x3d')](_0x21e937[_0x1e85('0x3e')],{'$or':_[_0x1e85('0x2b')](_0x21e937['attributes'],function(_0x578375){var _0x4a7adc={};_0x4a7adc[_0x578375]={'$like':'%'+_0x51e74e[_0x1e85('0x33')]['filter']+'%'};return _0x4a7adc;})});}_0x21e937=_['merge']({},_0x21e937,_0x51e74e[_0x1e85('0x40')]);return _0x4e6af4[_0x1e85('0x4a')](_0x21e937);}})[_0x1e85('0x24')](function(_0x1ca432){if(_0x1ca432){_0x2fdc9f=_0x1ca432['length'];if(!_0x51e74e['query'][_0x1e85('0x39')]('nolimit')){_0x21e937[_0x1e85('0x1e')]=qs['limit'](_0x51e74e[_0x1e85('0x33')][_0x1e85('0x1e')]);_0x21e937['offset']=qs[_0x1e85('0x1d')](_0x51e74e[_0x1e85('0x33')][_0x1e85('0x1d')]);}return _0x4e6af4[_0x1e85('0x4a')](_0x21e937);}})[_0x1e85('0x24')](function(_0x47fc8e){if(_0x47fc8e){return _0x47fc8e?{'count':_0x2fdc9f,'rows':_0x47fc8e}:null;}})[_0x1e85('0x24')](respondWithResult(_0x4a4343,null))['catch'](handleError(_0x4a4343,null));};exports['getDescriptions']=function(_0x470084,_0x4ede5d,_0x1523fc){var _0x23d670={};var _0x3db97c={};var _0x6df0bd;var _0x504aff;return db[_0x1e85('0x2c')][_0x1e85('0x4b')]({'where':{'id':_0x470084[_0x1e85('0x4c')]['id']}})[_0x1e85('0x24')](handleEntityNotFound(_0x4ede5d,null))[_0x1e85('0x24')](function(_0x2cfdc5){if(_0x2cfdc5){_0x6df0bd=_0x2cfdc5;_0x3db97c[_0x1e85('0x31')]=_[_0x1e85('0x32')](db['FreshsalesField']['rawAttributes']);_0x3db97c[_0x1e85('0x33')]=_[_0x1e85('0x32')](_0x470084[_0x1e85('0x33')]);_0x3db97c[_0x1e85('0x34')]=_[_0x1e85('0x35')](_0x3db97c[_0x1e85('0x31')],_0x3db97c[_0x1e85('0x33')]);_0x23d670[_0x1e85('0x36')]=_['intersection'](_0x3db97c['model'],qs['fields'](_0x470084[_0x1e85('0x33')]['fields']));_0x23d670[_0x1e85('0x36')]=_0x23d670['attributes'][_0x1e85('0x38')]?_0x23d670[_0x1e85('0x36')]:_0x3db97c[_0x1e85('0x31')];_0x23d670['order']=qs[_0x1e85('0x3a')](_0x470084[_0x1e85('0x33')][_0x1e85('0x3a')]);_0x23d670[_0x1e85('0x3e')]=qs['filters'](_[_0x1e85('0x3b')](_0x470084[_0x1e85('0x33')],_0x3db97c['filters']));if(_0x470084[_0x1e85('0x33')]['filter']){_0x23d670['where']=_[_0x1e85('0x3d')](_0x23d670[_0x1e85('0x3e')],{'$or':_['map'](_0x23d670[_0x1e85('0x36')],function(_0x48a40e){var _0x261883={};_0x261883[_0x48a40e]={'$like':'%'+_0x470084['query'][_0x1e85('0x3c')]+'%'};return _0x261883;})});}_0x23d670=_[_0x1e85('0x3d')]({},_0x23d670,_0x470084[_0x1e85('0x40')]);return _0x6df0bd[_0x1e85('0x4e')](_0x23d670);}})['then'](function(_0x4eecf7){if(_0x4eecf7){_0x504aff=_0x4eecf7[_0x1e85('0x38')];if(!_0x470084[_0x1e85('0x33')][_0x1e85('0x39')](_0x1e85('0x4f'))){_0x23d670['limit']=qs['limit'](_0x470084[_0x1e85('0x33')][_0x1e85('0x1e')]);_0x23d670[_0x1e85('0x1d')]=qs['offset'](_0x470084[_0x1e85('0x33')]['offset']);}return _0x6df0bd[_0x1e85('0x4e')](_0x23d670);}})['then'](function(_0x32c17d){if(_0x32c17d){return _0x32c17d?{'count':_0x504aff,'rows':_0x32c17d}:null;}})[_0x1e85('0x24')](respondWithResult(_0x4ede5d,null))['catch'](handleError(_0x4ede5d,null));};exports['getFields']=function(_0x11b37f,_0x56336f,_0x3bbd8e){var _0x7d5a05={};var _0x28eb74={};var _0x4b500d;var _0x5942da;return db[_0x1e85('0x2c')][_0x1e85('0x4b')]({'where':{'id':_0x11b37f[_0x1e85('0x4c')]['id']}})[_0x1e85('0x24')](handleEntityNotFound(_0x56336f,null))[_0x1e85('0x24')](function(_0x4d2d3a){if(_0x4d2d3a){_0x4b500d=_0x4d2d3a;_0x28eb74[_0x1e85('0x31')]=_['keys'](db[_0x1e85('0x4d')]['rawAttributes']);_0x28eb74[_0x1e85('0x33')]=_[_0x1e85('0x32')](_0x11b37f['query']);_0x28eb74[_0x1e85('0x34')]=_['intersection'](_0x28eb74[_0x1e85('0x31')],_0x28eb74[_0x1e85('0x33')]);_0x7d5a05['attributes']=_[_0x1e85('0x35')](_0x28eb74['model'],qs['fields'](_0x11b37f[_0x1e85('0x33')][_0x1e85('0x37')]));_0x7d5a05[_0x1e85('0x36')]=_0x7d5a05['attributes'][_0x1e85('0x38')]?_0x7d5a05['attributes']:_0x28eb74[_0x1e85('0x31')];_0x7d5a05[_0x1e85('0x50')]=qs[_0x1e85('0x3a')](_0x11b37f[_0x1e85('0x33')][_0x1e85('0x3a')]);_0x7d5a05[_0x1e85('0x3e')]=qs[_0x1e85('0x34')](_['pick'](_0x11b37f[_0x1e85('0x33')],_0x28eb74[_0x1e85('0x34')]));if(_0x11b37f[_0x1e85('0x33')][_0x1e85('0x3c')]){_0x7d5a05[_0x1e85('0x3e')]=_[_0x1e85('0x3d')](_0x7d5a05[_0x1e85('0x3e')],{'$or':_[_0x1e85('0x2b')](_0x7d5a05['attributes'],function(_0x25a6e6){var _0x52dabf={};_0x52dabf[_0x25a6e6]={'$like':'%'+_0x11b37f[_0x1e85('0x33')][_0x1e85('0x3c')]+'%'};return _0x52dabf;})});}_0x7d5a05=_[_0x1e85('0x3d')]({},_0x7d5a05,_0x11b37f[_0x1e85('0x40')]);return _0x4b500d['getFields'](_0x7d5a05);}})[_0x1e85('0x24')](function(_0x2efb66){if(_0x2efb66){_0x5942da=_0x2efb66[_0x1e85('0x38')];if(!_0x11b37f['query']['hasOwnProperty'](_0x1e85('0x4f'))){_0x7d5a05[_0x1e85('0x1e')]=qs['limit'](_0x11b37f[_0x1e85('0x33')][_0x1e85('0x1e')]);_0x7d5a05['offset']=qs[_0x1e85('0x1d')](_0x11b37f['query']['offset']);}return _0x4b500d['getFields'](_0x7d5a05);}})[_0x1e85('0x24')](function(_0x28ee5e){if(_0x28ee5e){return _0x28ee5e?{'count':_0x5942da,'rows':_0x28ee5e}:null;}})[_0x1e85('0x24')](respondWithResult(_0x56336f,null))[_0x1e85('0x46')](handleError(_0x56336f,null));}; \ No newline at end of file +var _0x076a=['key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','keys','include','options','find','create','body','params','getSubjects','findOne','FreshsalesField','rawAttributes','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','FreshsalesConfiguration','fieldName','type'];(function(_0x10c314,_0x1cb36d){var _0x2a859a=function(_0x21cb6d){while(--_0x21cb6d){_0x10c314['push'](_0x10c314['shift']());}};_0x2a859a(++_0x1cb36d);}(_0x076a,0x178));var _0xa076=function(_0x1af98d,_0x3c608e){_0x1af98d=_0x1af98d-0x0;var _0x3553ea=_0x076a[_0x1af98d];return _0x3553ea;};'use strict';var emlformat=require(_0xa076('0x0'));var rimraf=require(_0xa076('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa076('0x2'));var rp=require(_0xa076('0x3'));var moment=require(_0xa076('0x4'));var BPromise=require(_0xa076('0x5'));var Mustache=require(_0xa076('0x6'));var util=require(_0xa076('0x7'));var path=require(_0xa076('0x8'));var sox=require(_0xa076('0x9'));var csv=require(_0xa076('0xa'));var ejs=require(_0xa076('0xb'));var fs=require('fs');var fs_extra=require(_0xa076('0xc'));var _=require(_0xa076('0xd'));var squel=require(_0xa076('0xe'));var crypto=require(_0xa076('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa076('0x10'));var toCsv=require(_0xa076('0xa'));var querystring=require(_0xa076('0x11'));var Papa=require(_0xa076('0x12'));var Redis=require('ioredis');var authService=require(_0xa076('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa076('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa076('0x15'))(_0xa076('0x16'));var utils=require(_0xa076('0x17'));var config=require(_0xa076('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa076('0x19'))['db'];function respondWithStatusCode(_0x2d93e0,_0x1c8761){_0x1c8761=_0x1c8761||0xcc;return function(_0x53ab8a){if(_0x53ab8a){return _0x2d93e0[_0xa076('0x1a')](_0x1c8761);}return _0x2d93e0[_0xa076('0x1b')](_0x1c8761)[_0xa076('0x1c')]();};}function respondWithResult(_0x22f104,_0x2cff8d){_0x2cff8d=_0x2cff8d||0xc8;return function(_0x42a7c5){if(_0x42a7c5){return _0x22f104[_0xa076('0x1b')](_0x2cff8d)[_0xa076('0x1d')](_0x42a7c5);}};}function respondWithFilteredResult(_0x32e534,_0x16713c){return function(_0x5bc514){if(_0x5bc514){var _0x30e3e3=typeof _0x16713c[_0xa076('0x1e')]==='undefined'&&typeof _0x16713c[_0xa076('0x1f')]===_0xa076('0x20');var _0x296620=_0x5bc514[_0xa076('0x21')];var _0x2c58e0=_0x30e3e3?0x0:_0x16713c[_0xa076('0x1e')];var _0x55b91d=_0x30e3e3?_0x5bc514[_0xa076('0x21')]:_0x16713c[_0xa076('0x1e')]+_0x16713c['limit'];var _0xcfbfb9;if(_0x55b91d>=_0x296620){_0x55b91d=_0x296620;_0xcfbfb9=0xc8;}else{_0xcfbfb9=0xce;}_0x32e534[_0xa076('0x1b')](_0xcfbfb9);return _0x32e534[_0xa076('0x22')](_0xa076('0x23'),_0x2c58e0+'-'+_0x55b91d+'/'+_0x296620)[_0xa076('0x1d')](_0x5bc514);}return null;};}function patchUpdates(_0x6e4d2b){return function(_0x12d199){try{jsonpatch[_0xa076('0x24')](_0x12d199,_0x6e4d2b,!![]);}catch(_0x3f4786){return BPromise[_0xa076('0x25')](_0x3f4786);}return _0x12d199[_0xa076('0x26')]();};}function saveUpdates(_0x404c7a,_0x28546b){return function(_0x5deb39){if(_0x5deb39){return _0x5deb39[_0xa076('0x27')](_0x404c7a)[_0xa076('0x28')](function(_0x3fddcf){return _0x3fddcf;});}return null;};}function removeEntity(_0x3dcee1,_0x19e1a4){return function(_0x1e2235){if(_0x1e2235){return _0x1e2235[_0xa076('0x29')]()[_0xa076('0x28')](function(){_0x3dcee1[_0xa076('0x1b')](0xcc)[_0xa076('0x1c')]();});}};}function handleEntityNotFound(_0x4bd9ee,_0x12bff4){return function(_0x308d06){if(!_0x308d06){_0x4bd9ee[_0xa076('0x1a')](0x194);}return _0x308d06;};}function handleError(_0x4c80b9,_0x223e67){_0x223e67=_0x223e67||0x1f4;return function(_0x29d8bf){logger[_0xa076('0x2a')](_0x29d8bf['stack']);if(_0x29d8bf[_0xa076('0x2b')]){delete _0x29d8bf[_0xa076('0x2b')];}_0x4c80b9['status'](_0x223e67)[_0xa076('0x2c')](_0x29d8bf);};}exports[_0xa076('0x2d')]=function(_0xe4a4d8,_0x51a998){var _0x6e96b8={},_0x4e3beb={},_0x1cd24b={'count':0x0,'rows':[]};var _0x87efe5=_['map'](db[_0xa076('0x2e')]['rawAttributes'],function(_0xc10b44){return{'name':_0xc10b44[_0xa076('0x2f')],'type':_0xc10b44[_0xa076('0x30')][_0xa076('0x31')]};});_0x4e3beb[_0xa076('0x32')]=_[_0xa076('0x33')](_0x87efe5,_0xa076('0x2b'));_0x4e3beb[_0xa076('0x34')]=_['keys'](_0xe4a4d8[_0xa076('0x34')]);_0x4e3beb[_0xa076('0x35')]=_['intersection'](_0x4e3beb[_0xa076('0x32')],_0x4e3beb['query']);_0x6e96b8[_0xa076('0x36')]=_[_0xa076('0x37')](_0x4e3beb[_0xa076('0x32')],qs[_0xa076('0x38')](_0xe4a4d8['query'][_0xa076('0x38')]));_0x6e96b8[_0xa076('0x36')]=_0x6e96b8[_0xa076('0x36')][_0xa076('0x39')]?_0x6e96b8[_0xa076('0x36')]:_0x4e3beb[_0xa076('0x32')];if(!_0xe4a4d8[_0xa076('0x34')]['hasOwnProperty'](_0xa076('0x3a'))){_0x6e96b8['limit']=qs['limit'](_0xe4a4d8[_0xa076('0x34')][_0xa076('0x1f')]);_0x6e96b8[_0xa076('0x1e')]=qs[_0xa076('0x1e')](_0xe4a4d8[_0xa076('0x34')]['offset']);}_0x6e96b8[_0xa076('0x3b')]=qs[_0xa076('0x3c')](_0xe4a4d8[_0xa076('0x34')][_0xa076('0x3c')]);_0x6e96b8['where']=qs['filters'](_[_0xa076('0x3d')](_0xe4a4d8[_0xa076('0x34')],_0x4e3beb['filters']),_0x87efe5);if(_0xe4a4d8[_0xa076('0x34')][_0xa076('0x3e')]){_0x6e96b8[_0xa076('0x3f')]=_[_0xa076('0x40')](_0x6e96b8[_0xa076('0x3f')],{'$or':_[_0xa076('0x33')](_0x87efe5,function(_0x41f0e4){if(_0x41f0e4[_0xa076('0x30')]!==_0xa076('0x41')){var _0x5d5ebc={};_0x5d5ebc[_0x41f0e4['name']]={'$like':'%'+_0xe4a4d8[_0xa076('0x34')][_0xa076('0x3e')]+'%'};return _0x5d5ebc;}})});}_0x6e96b8=_[_0xa076('0x40')]({},_0x6e96b8,_0xe4a4d8['options']);var _0xd4f682={'where':_0x6e96b8['where']};return db['FreshsalesConfiguration'][_0xa076('0x21')](_0xd4f682)[_0xa076('0x28')](function(_0x335bdd){_0x1cd24b['count']=_0x335bdd;if(_0xe4a4d8[_0xa076('0x34')][_0xa076('0x42')]){_0x6e96b8['include']=[{'all':!![]}];}return db[_0xa076('0x2e')][_0xa076('0x43')](_0x6e96b8);})[_0xa076('0x28')](function(_0x456835){_0x1cd24b[_0xa076('0x44')]=_0x456835;return _0x1cd24b;})[_0xa076('0x28')](respondWithFilteredResult(_0x51a998,_0x6e96b8))[_0xa076('0x45')](handleError(_0x51a998,null));};exports[_0xa076('0x46')]=function(_0x3d539a,_0x4511e8){var _0x497b6d={'raw':![],'where':{'id':_0x3d539a['params']['id']}},_0x202879={};_0x202879[_0xa076('0x32')]=_[_0xa076('0x47')](db[_0xa076('0x2e')]['rawAttributes']);_0x202879[_0xa076('0x34')]=_['keys'](_0x3d539a[_0xa076('0x34')]);_0x202879[_0xa076('0x35')]=_['intersection'](_0x202879[_0xa076('0x32')],_0x202879[_0xa076('0x34')]);_0x497b6d[_0xa076('0x36')]=_[_0xa076('0x37')](_0x202879['model'],qs[_0xa076('0x38')](_0x3d539a[_0xa076('0x34')][_0xa076('0x38')]));_0x497b6d[_0xa076('0x36')]=_0x497b6d['attributes'][_0xa076('0x39')]?_0x497b6d[_0xa076('0x36')]:_0x202879[_0xa076('0x32')];if(_0x3d539a[_0xa076('0x34')][_0xa076('0x42')]){_0x497b6d[_0xa076('0x48')]=[{'all':!![]}];}_0x497b6d=_[_0xa076('0x40')]({},_0x497b6d,_0x3d539a[_0xa076('0x49')]);return db[_0xa076('0x2e')][_0xa076('0x4a')](_0x497b6d)[_0xa076('0x28')](handleEntityNotFound(_0x4511e8,null))[_0xa076('0x28')](respondWithResult(_0x4511e8,null))[_0xa076('0x45')](handleError(_0x4511e8,null));};exports[_0xa076('0x4b')]=function(_0x7997c4,_0x481a16){return db[_0xa076('0x2e')]['create'](_0x7997c4[_0xa076('0x4c')],{})[_0xa076('0x28')](respondWithResult(_0x481a16,0xc9))[_0xa076('0x45')](handleError(_0x481a16,null));};exports[_0xa076('0x27')]=function(_0x4d9bd4,_0x802984){if(_0x4d9bd4[_0xa076('0x4c')]['id']){delete _0x4d9bd4[_0xa076('0x4c')]['id'];}return db[_0xa076('0x2e')][_0xa076('0x4a')]({'where':{'id':_0x4d9bd4[_0xa076('0x4d')]['id']}})[_0xa076('0x28')](handleEntityNotFound(_0x802984,null))['then'](saveUpdates(_0x4d9bd4[_0xa076('0x4c')],null))[_0xa076('0x28')](respondWithResult(_0x802984,null))[_0xa076('0x45')](handleError(_0x802984,null));};exports['destroy']=function(_0x3cd05a,_0x2a007d){return db[_0xa076('0x2e')][_0xa076('0x4a')]({'where':{'id':_0x3cd05a[_0xa076('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2a007d,null))[_0xa076('0x28')](removeEntity(_0x2a007d,null))[_0xa076('0x45')](handleError(_0x2a007d,null));};exports[_0xa076('0x4e')]=function(_0x32d7fb,_0x4c63ee,_0x251e41){var _0x4800aa={};var _0x5c164e={};var _0x1fb0df;var _0x49449e;return db[_0xa076('0x2e')][_0xa076('0x4f')]({'where':{'id':_0x32d7fb[_0xa076('0x4d')]['id']}})[_0xa076('0x28')](handleEntityNotFound(_0x4c63ee,null))['then'](function(_0x3df87e){if(_0x3df87e){_0x1fb0df=_0x3df87e;_0x5c164e['model']=_[_0xa076('0x47')](db[_0xa076('0x50')][_0xa076('0x51')]);_0x5c164e[_0xa076('0x34')]=_[_0xa076('0x47')](_0x32d7fb['query']);_0x5c164e[_0xa076('0x35')]=_[_0xa076('0x37')](_0x5c164e[_0xa076('0x32')],_0x5c164e[_0xa076('0x34')]);_0x4800aa['attributes']=_[_0xa076('0x37')](_0x5c164e[_0xa076('0x32')],qs[_0xa076('0x38')](_0x32d7fb[_0xa076('0x34')][_0xa076('0x38')]));_0x4800aa[_0xa076('0x36')]=_0x4800aa[_0xa076('0x36')][_0xa076('0x39')]?_0x4800aa[_0xa076('0x36')]:_0x5c164e[_0xa076('0x32')];_0x4800aa[_0xa076('0x3b')]=qs[_0xa076('0x3c')](_0x32d7fb[_0xa076('0x34')][_0xa076('0x3c')]);_0x4800aa[_0xa076('0x3f')]=qs[_0xa076('0x35')](_[_0xa076('0x3d')](_0x32d7fb[_0xa076('0x34')],_0x5c164e[_0xa076('0x35')]));if(_0x32d7fb[_0xa076('0x34')]['filter']){_0x4800aa[_0xa076('0x3f')]=_[_0xa076('0x40')](_0x4800aa[_0xa076('0x3f')],{'$or':_[_0xa076('0x33')](_0x4800aa[_0xa076('0x36')],function(_0x31164c){var _0x34ee81={};_0x34ee81[_0x31164c]={'$like':'%'+_0x32d7fb[_0xa076('0x34')][_0xa076('0x3e')]+'%'};return _0x34ee81;})});}_0x4800aa=_['merge']({},_0x4800aa,_0x32d7fb['options']);return _0x1fb0df[_0xa076('0x4e')](_0x4800aa);}})[_0xa076('0x28')](function(_0x1e41cb){if(_0x1e41cb){_0x49449e=_0x1e41cb[_0xa076('0x39')];if(!_0x32d7fb[_0xa076('0x34')][_0xa076('0x52')](_0xa076('0x3a'))){_0x4800aa[_0xa076('0x1f')]=qs[_0xa076('0x1f')](_0x32d7fb[_0xa076('0x34')][_0xa076('0x1f')]);_0x4800aa['offset']=qs[_0xa076('0x1e')](_0x32d7fb[_0xa076('0x34')][_0xa076('0x1e')]);}return _0x1fb0df[_0xa076('0x4e')](_0x4800aa);}})[_0xa076('0x28')](function(_0x11eed){if(_0x11eed){return _0x11eed?{'count':_0x49449e,'rows':_0x11eed}:null;}})[_0xa076('0x28')](respondWithResult(_0x4c63ee,null))[_0xa076('0x45')](handleError(_0x4c63ee,null));};exports[_0xa076('0x53')]=function(_0x2e107d,_0x1a886c,_0x284653){var _0x525663={};var _0x3ebbfa={};var _0x1bbdc5;var _0x10dc7c;return db[_0xa076('0x2e')][_0xa076('0x4f')]({'where':{'id':_0x2e107d['params']['id']}})[_0xa076('0x28')](handleEntityNotFound(_0x1a886c,null))['then'](function(_0x36875d){if(_0x36875d){_0x1bbdc5=_0x36875d;_0x3ebbfa[_0xa076('0x32')]=_[_0xa076('0x47')](db[_0xa076('0x50')][_0xa076('0x51')]);_0x3ebbfa[_0xa076('0x34')]=_[_0xa076('0x47')](_0x2e107d[_0xa076('0x34')]);_0x3ebbfa[_0xa076('0x35')]=_[_0xa076('0x37')](_0x3ebbfa['model'],_0x3ebbfa['query']);_0x525663[_0xa076('0x36')]=_[_0xa076('0x37')](_0x3ebbfa[_0xa076('0x32')],qs[_0xa076('0x38')](_0x2e107d[_0xa076('0x34')]['fields']));_0x525663['attributes']=_0x525663['attributes'][_0xa076('0x39')]?_0x525663[_0xa076('0x36')]:_0x3ebbfa['model'];_0x525663[_0xa076('0x3b')]=qs[_0xa076('0x3c')](_0x2e107d[_0xa076('0x34')]['sort']);_0x525663[_0xa076('0x3f')]=qs[_0xa076('0x35')](_[_0xa076('0x3d')](_0x2e107d[_0xa076('0x34')],_0x3ebbfa[_0xa076('0x35')]));if(_0x2e107d[_0xa076('0x34')]['filter']){_0x525663[_0xa076('0x3f')]=_[_0xa076('0x40')](_0x525663[_0xa076('0x3f')],{'$or':_[_0xa076('0x33')](_0x525663[_0xa076('0x36')],function(_0x221356){var _0x18e2e3={};_0x18e2e3[_0x221356]={'$like':'%'+_0x2e107d['query'][_0xa076('0x3e')]+'%'};return _0x18e2e3;})});}_0x525663=_[_0xa076('0x40')]({},_0x525663,_0x2e107d[_0xa076('0x49')]);return _0x1bbdc5['getDescriptions'](_0x525663);}})[_0xa076('0x28')](function(_0x91e2ff){if(_0x91e2ff){_0x10dc7c=_0x91e2ff[_0xa076('0x39')];if(!_0x2e107d[_0xa076('0x34')][_0xa076('0x52')](_0xa076('0x3a'))){_0x525663[_0xa076('0x1f')]=qs[_0xa076('0x1f')](_0x2e107d[_0xa076('0x34')][_0xa076('0x1f')]);_0x525663[_0xa076('0x1e')]=qs[_0xa076('0x1e')](_0x2e107d[_0xa076('0x34')]['offset']);}return _0x1bbdc5[_0xa076('0x53')](_0x525663);}})[_0xa076('0x28')](function(_0xcdfecb){if(_0xcdfecb){return _0xcdfecb?{'count':_0x10dc7c,'rows':_0xcdfecb}:null;}})[_0xa076('0x28')](respondWithResult(_0x1a886c,null))['catch'](handleError(_0x1a886c,null));};exports[_0xa076('0x54')]=function(_0x2bb60e,_0x2ac4da,_0xe78c5a){var _0x4d3c9a={};var _0xe5bb58={};var _0x4015c3;var _0x46a58e;return db[_0xa076('0x2e')][_0xa076('0x4f')]({'where':{'id':_0x2bb60e['params']['id']}})[_0xa076('0x28')](handleEntityNotFound(_0x2ac4da,null))[_0xa076('0x28')](function(_0x2a8def){if(_0x2a8def){_0x4015c3=_0x2a8def;_0xe5bb58[_0xa076('0x32')]=_['keys'](db[_0xa076('0x50')][_0xa076('0x51')]);_0xe5bb58[_0xa076('0x34')]=_['keys'](_0x2bb60e[_0xa076('0x34')]);_0xe5bb58[_0xa076('0x35')]=_[_0xa076('0x37')](_0xe5bb58['model'],_0xe5bb58['query']);_0x4d3c9a['attributes']=_['intersection'](_0xe5bb58[_0xa076('0x32')],qs[_0xa076('0x38')](_0x2bb60e[_0xa076('0x34')][_0xa076('0x38')]));_0x4d3c9a[_0xa076('0x36')]=_0x4d3c9a[_0xa076('0x36')]['length']?_0x4d3c9a[_0xa076('0x36')]:_0xe5bb58[_0xa076('0x32')];_0x4d3c9a['order']=qs[_0xa076('0x3c')](_0x2bb60e[_0xa076('0x34')][_0xa076('0x3c')]);_0x4d3c9a[_0xa076('0x3f')]=qs['filters'](_[_0xa076('0x3d')](_0x2bb60e['query'],_0xe5bb58[_0xa076('0x35')]));if(_0x2bb60e[_0xa076('0x34')][_0xa076('0x3e')]){_0x4d3c9a[_0xa076('0x3f')]=_['merge'](_0x4d3c9a[_0xa076('0x3f')],{'$or':_[_0xa076('0x33')](_0x4d3c9a[_0xa076('0x36')],function(_0x4887a1){var _0x283d2e={};_0x283d2e[_0x4887a1]={'$like':'%'+_0x2bb60e[_0xa076('0x34')][_0xa076('0x3e')]+'%'};return _0x283d2e;})});}_0x4d3c9a=_[_0xa076('0x40')]({},_0x4d3c9a,_0x2bb60e['options']);return _0x4015c3['getFields'](_0x4d3c9a);}})[_0xa076('0x28')](function(_0x3f3c45){if(_0x3f3c45){_0x46a58e=_0x3f3c45[_0xa076('0x39')];if(!_0x2bb60e[_0xa076('0x34')]['hasOwnProperty'](_0xa076('0x3a'))){_0x4d3c9a[_0xa076('0x1f')]=qs[_0xa076('0x1f')](_0x2bb60e[_0xa076('0x34')][_0xa076('0x1f')]);_0x4d3c9a['offset']=qs['offset'](_0x2bb60e[_0xa076('0x34')]['offset']);}return _0x4015c3[_0xa076('0x54')](_0x4d3c9a);}})[_0xa076('0x28')](function(_0x335f7c){if(_0x335f7c){return _0x335f7c?{'count':_0x46a58e,'rows':_0x335f7c}:null;}})[_0xa076('0x28')](respondWithResult(_0x2ac4da,null))[_0xa076('0x45')](handleError(_0x2ac4da,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 43c76ff..201a809 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 _0xdd45=['../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1e0218,_0x19703f){var _0x164f09=function(_0x52da53){while(--_0x52da53){_0x1e0218['push'](_0x1e0218['shift']());}};_0x164f09(++_0x19703f);}(_0xdd45,0xad));var _0x5dd4=function(_0x5831fc,_0xab9a0a){_0x5831fc=_0x5831fc-0x0;var _0x47c212=_0xdd45[_0x5831fc];return _0x47c212;};'use strict';var _=require(_0x5dd4('0x0'));var util=require('util');var logger=require(_0x5dd4('0x1'))(_0x5dd4('0x2'));var moment=require(_0x5dd4('0x3'));var BPromise=require(_0x5dd4('0x4'));var rp=require(_0x5dd4('0x5'));var fs=require('fs');var path=require(_0x5dd4('0x6'));var rimraf=require('rimraf');var config=require(_0x5dd4('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x5dd4('0x8')]=function(_0x4d9fb6,_0x134e55){return _0x4d9fb6[_0x5dd4('0x9')](_0x5dd4('0xa'),attributes,{'tableName':_0x5dd4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e3d=['path','rimraf','./intFreshsalesConfiguration.attributes','define','lodash','util','../../config/logger','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e3d,0x67));var _0xd9e3=function(_0x31968b,_0x63acae){_0x31968b=_0x31968b-0x0;var _0x307c21=_0x9e3d[_0x31968b];return _0x307c21;};'use strict';var _=require(_0xd9e3('0x0'));var util=require(_0xd9e3('0x1'));var logger=require(_0xd9e3('0x2'))('api');var moment=require(_0xd9e3('0x3'));var BPromise=require('bluebird');var rp=require(_0xd9e3('0x4'));var fs=require('fs');var path=require(_0xd9e3('0x5'));var rimraf=require(_0xd9e3('0x6'));var config=require('../../config/environment');var attributes=require(_0xd9e3('0x7'));module['exports']=function(_0x88fe79,_0x5ae978){return _0x88fe79[_0xd9e3('0x8')]('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 e5be55c..c9bbc50 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 _0xa403=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x1070f3,_0x604e77){var _0x5a237b=function(_0x4c8998){while(--_0x4c8998){_0x1070f3['push'](_0x1070f3['shift']());}};_0x5a237b(++_0x604e77);}(_0xa403,0xb2));var _0x3a40=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xa403[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x3a40('0x0'));var util=require(_0x3a40('0x1'));var moment=require(_0x3a40('0x2'));var BPromise=require(_0x3a40('0x3'));var rs=require(_0x3a40('0x4'));var fs=require('fs');var Redis=require(_0x3a40('0x5'));var db=require(_0x3a40('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a40('0x7'))('rpc');var config=require(_0x3a40('0x8'));var jayson=require(_0x3a40('0x9'));var client=jayson[_0x3a40('0xa')][_0x3a40('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x335f5e,_0x45d65e,_0x58b65b){return new BPromise(function(_0x10637a,_0x24c89d){return client[_0x3a40('0xc')](_0x335f5e,_0x58b65b)['then'](function(_0x488a67){logger[_0x3a40('0xd')](_0x3a40('0xe'),_0x45d65e,_0x3a40('0xf'));logger[_0x3a40('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x45d65e,'request\x20sent',JSON[_0x3a40('0x11')](_0x488a67));if(_0x488a67[_0x3a40('0x12')]){if(_0x488a67['error'][_0x3a40('0x13')]===0x1f4){logger[_0x3a40('0x12')](_0x3a40('0xe'),_0x45d65e,_0x488a67[_0x3a40('0x12')][_0x3a40('0x14')]);return _0x24c89d(_0x488a67[_0x3a40('0x12')][_0x3a40('0x14')]);}logger[_0x3a40('0x12')](_0x3a40('0xe'),_0x45d65e,_0x488a67[_0x3a40('0x12')][_0x3a40('0x14')]);return _0x10637a(_0x488a67[_0x3a40('0x12')]['message']);}else{logger[_0x3a40('0xd')](_0x3a40('0xe'),_0x45d65e,_0x3a40('0xf'));_0x10637a(_0x488a67['result'][_0x3a40('0x14')]);}})[_0x3a40('0x15')](function(_0x5cb266){logger[_0x3a40('0x12')](_0x3a40('0xe'),_0x45d65e,_0x5cb266);_0x24c89d(_0x5cb266);});});} \ No newline at end of file +var _0x2e30=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring'];(function(_0x138ce4,_0x2c73d3){var _0x3f6b3b=function(_0x181cbf){while(--_0x181cbf){_0x138ce4['push'](_0x138ce4['shift']());}};_0x3f6b3b(++_0x2c73d3);}(_0x2e30,0x91));var _0x02e3=function(_0x3f3138,_0x6424b4){_0x3f3138=_0x3f3138-0x0;var _0x3a9f3c=_0x2e30[_0x3f3138];return _0x3a9f3c;};'use strict';var _=require(_0x02e3('0x0'));var util=require(_0x02e3('0x1'));var moment=require(_0x02e3('0x2'));var BPromise=require(_0x02e3('0x3'));var rs=require(_0x02e3('0x4'));var fs=require('fs');var Redis=require(_0x02e3('0x5'));var db=require(_0x02e3('0x6'))['db'];var utils=require(_0x02e3('0x7'));var logger=require(_0x02e3('0x8'))(_0x02e3('0x9'));var config=require(_0x02e3('0xa'));var jayson=require(_0x02e3('0xb'));var client=jayson[_0x02e3('0xc')][_0x02e3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3ff3b4,_0x2a56b6,_0x48e94a){return new BPromise(function(_0xa57ae5,_0x4abcbd){return client[_0x02e3('0xe')](_0x3ff3b4,_0x48e94a)[_0x02e3('0xf')](function(_0x1bf26e){logger[_0x02e3('0x10')](_0x02e3('0x11'),_0x2a56b6,_0x02e3('0x12'));logger[_0x02e3('0x13')](_0x02e3('0x14'),_0x2a56b6,_0x02e3('0x12'),JSON[_0x02e3('0x15')](_0x1bf26e));if(_0x1bf26e[_0x02e3('0x16')]){if(_0x1bf26e[_0x02e3('0x16')][_0x02e3('0x17')]===0x1f4){logger[_0x02e3('0x16')](_0x02e3('0x11'),_0x2a56b6,_0x1bf26e[_0x02e3('0x16')][_0x02e3('0x18')]);return _0x4abcbd(_0x1bf26e[_0x02e3('0x16')][_0x02e3('0x18')]);}logger[_0x02e3('0x16')](_0x02e3('0x11'),_0x2a56b6,_0x1bf26e[_0x02e3('0x16')][_0x02e3('0x18')]);return _0xa57ae5(_0x1bf26e[_0x02e3('0x16')][_0x02e3('0x18')]);}else{logger[_0x02e3('0x10')](_0x02e3('0x11'),_0x2a56b6,_0x02e3('0x12'));_0xa57ae5(_0x1bf26e['result'][_0x02e3('0x18')]);}})['catch'](function(_0x3c6e8c){logger[_0x02e3('0x16')](_0x02e3('0x11'),_0x2a56b6,_0x3c6e8c);_0x4abcbd(_0x3c6e8c);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 16f73ac..f28df17 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 _0xdab2=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5e8a2e,_0x3deead){var _0x20a417=function(_0x146460){while(--_0x146460){_0x5e8a2e['push'](_0x5e8a2e['shift']());}};_0x20a417(++_0x3deead);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var path=require('path');var timeout=require(_0x2dab('0x2'));var express=require(_0x2dab('0x3'));var router=express[_0x2dab('0x4')]();var fs_extra=require(_0x2dab('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2dab('0x6'));var config=require(_0x2dab('0x7'));var controller=require(_0x2dab('0x8'));router[_0x2dab('0x9')]('/',auth[_0x2dab('0xa')](),controller[_0x2dab('0xb')]);router[_0x2dab('0x9')](_0x2dab('0xc'),auth[_0x2dab('0xa')](),controller[_0x2dab('0xd')]);router[_0x2dab('0xe')]('/',auth[_0x2dab('0xa')](),controller[_0x2dab('0xf')]);router['put']('/:id',auth[_0x2dab('0xa')](),controller[_0x2dab('0x10')]);router[_0x2dab('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x2dab('0x12')]);module[_0x2dab('0x13')]=router; \ No newline at end of file +var _0x495e=['fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','post','create','put','/:id','update','destroy','multer','connect-timeout','express','Router'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x495e,0xfb));var _0xe495=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x495e[_0x5a1cc9];return _0x471761;};'use strict';var multer=require(_0xe495('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe495('0x1'));var express=require(_0xe495('0x2'));var router=express[_0xe495('0x3')]();var fs_extra=require(_0xe495('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe495('0x5'));var config=require(_0xe495('0x6'));var controller=require(_0xe495('0x7'));router[_0xe495('0x8')]('/',auth[_0xe495('0x9')](),controller[_0xe495('0xa')]);router[_0xe495('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe495('0xb')]('/',auth['isAuthenticated'](),controller[_0xe495('0xc')]);router[_0xe495('0xd')](_0xe495('0xe'),auth[_0xe495('0x9')](),controller[_0xe495('0xf')]);router['delete'](_0xe495('0xe'),auth[_0xe495('0x9')](),controller[_0xe495('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 1f49cab..805f113 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 _0xad2b=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x273808,_0x453b69){var _0xe8959e=function(_0x3ac804){while(--_0x3ac804){_0x273808['push'](_0x273808['shift']());}};_0xe8959e(++_0x453b69);}(_0xad2b,0x109));var _0xbad2=function(_0x5c72f9,_0x4903a1){_0x5c72f9=_0x5c72f9-0x0;var _0xec19cf=_0xad2b[_0x5c72f9];return _0xec19cf;};'use strict';var Sequelize=require(_0xbad2('0x0'));module[_0xbad2('0x1')]={'type':{'type':Sequelize[_0xbad2('0x2')]('string',_0xbad2('0x3'),_0xbad2('0x4'),_0xbad2('0x5'),_0xbad2('0x6')),'defaultValue':_0xbad2('0x7')},'content':{'type':Sequelize[_0xbad2('0x8')]},'key':{'type':Sequelize[_0xbad2('0x8')]},'keyType':{'type':Sequelize[_0xbad2('0x2')](_0xbad2('0x7'),_0xbad2('0x3'),_0xbad2('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbad2('0x8')]},'customField':{'type':Sequelize[_0xbad2('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbad2('0x8')]}}; \ No newline at end of file +var _0xa3b9=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x1070b7,_0x852593){var _0x1d5a6a=function(_0x6ab134){while(--_0x6ab134){_0x1070b7['push'](_0x1070b7['shift']());}};_0x1d5a6a(++_0x852593);}(_0xa3b9,0x100));var _0x9a3b=function(_0x4731fd,_0x5f36df){_0x4731fd=_0x4731fd-0x0;var _0x27f7e7=_0xa3b9[_0x4731fd];return _0x27f7e7;};'use strict';var Sequelize=require(_0x9a3b('0x0'));module[_0x9a3b('0x1')]={'type':{'type':Sequelize[_0x9a3b('0x2')](_0x9a3b('0x3'),_0x9a3b('0x4'),'customVariable',_0x9a3b('0x5'),_0x9a3b('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9a3b('0x7')]},'key':{'type':Sequelize[_0x9a3b('0x7')]},'keyType':{'type':Sequelize[_0x9a3b('0x2')](_0x9a3b('0x3'),'variable',_0x9a3b('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9a3b('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9a3b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index d5c8b68..8e780bf 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 _0xe391=['query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','FreshsalesField','fieldName','type','key','map'];(function(_0x305e5f,_0x1bb9b2){var _0x25c047=function(_0x3e3d21){while(--_0x3e3d21){_0x305e5f['push'](_0x305e5f['shift']());}};_0x25c047(++_0x1bb9b2);}(_0xe391,0xb0));var _0x1e39=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xe391[_0xf0bc07];return _0x1c50c2;};'use strict';var emlformat=require(_0x1e39('0x0'));var rimraf=require(_0x1e39('0x1'));var zipdir=require(_0x1e39('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e39('0x3'));var moment=require('moment');var BPromise=require(_0x1e39('0x4'));var Mustache=require(_0x1e39('0x5'));var util=require('util');var path=require(_0x1e39('0x6'));var sox=require(_0x1e39('0x7'));var csv=require(_0x1e39('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e39('0x9'));var squel=require(_0x1e39('0xa'));var crypto=require(_0x1e39('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1e39('0xc'));var toCsv=require(_0x1e39('0x8'));var querystring=require(_0x1e39('0xd'));var Papa=require(_0x1e39('0xe'));var Redis=require(_0x1e39('0xf'));var authService=require(_0x1e39('0x10'));var qs=require(_0x1e39('0x11'));var as=require(_0x1e39('0x12'));var hardwareService=require(_0x1e39('0x13'));var logger=require(_0x1e39('0x14'))(_0x1e39('0x15'));var utils=require(_0x1e39('0x16'));var config=require(_0x1e39('0x17'));var licenseUtil=require(_0x1e39('0x18'));var db=require(_0x1e39('0x19'))['db'];function respondWithStatusCode(_0x111e66,_0x36b3ef){_0x36b3ef=_0x36b3ef||0xcc;return function(_0x37c547){if(_0x37c547){return _0x111e66[_0x1e39('0x1a')](_0x36b3ef);}return _0x111e66['status'](_0x36b3ef)[_0x1e39('0x1b')]();};}function respondWithResult(_0x39d6cf,_0x5b2825){_0x5b2825=_0x5b2825||0xc8;return function(_0x3d2976){if(_0x3d2976){return _0x39d6cf[_0x1e39('0x1c')](_0x5b2825)[_0x1e39('0x1d')](_0x3d2976);}};}function respondWithFilteredResult(_0x32f0e0,_0x437266){return function(_0x343044){if(_0x343044){var _0x3a0078=typeof _0x437266[_0x1e39('0x1e')]==='undefined'&&typeof _0x437266[_0x1e39('0x1f')]==='undefined';var _0x54e7f3=_0x343044[_0x1e39('0x20')];var _0x3dd7c0=_0x3a0078?0x0:_0x437266[_0x1e39('0x1e')];var _0x48ccdf=_0x3a0078?_0x343044[_0x1e39('0x20')]:_0x437266['offset']+_0x437266[_0x1e39('0x1f')];var _0x4bed5d;if(_0x48ccdf>=_0x54e7f3){_0x48ccdf=_0x54e7f3;_0x4bed5d=0xc8;}else{_0x4bed5d=0xce;}_0x32f0e0[_0x1e39('0x1c')](_0x4bed5d);return _0x32f0e0[_0x1e39('0x21')]('Content-Range',_0x3dd7c0+'-'+_0x48ccdf+'/'+_0x54e7f3)['json'](_0x343044);}return null;};}function patchUpdates(_0x518695){return function(_0x407008){try{jsonpatch[_0x1e39('0x22')](_0x407008,_0x518695,!![]);}catch(_0x3896f9){return BPromise[_0x1e39('0x23')](_0x3896f9);}return _0x407008[_0x1e39('0x24')]();};}function saveUpdates(_0x4c3788,_0x216225){return function(_0x9fbdf4){if(_0x9fbdf4){return _0x9fbdf4[_0x1e39('0x25')](_0x4c3788)[_0x1e39('0x26')](function(_0x4d72f7){return _0x4d72f7;});}return null;};}function removeEntity(_0x5d4346,_0x7b1774){return function(_0x2b127a){if(_0x2b127a){return _0x2b127a[_0x1e39('0x27')]()['then'](function(){_0x5d4346[_0x1e39('0x1c')](0xcc)[_0x1e39('0x1b')]();});}};}function handleEntityNotFound(_0x47d0c6,_0x11145d){return function(_0x1f68d9){if(!_0x1f68d9){_0x47d0c6[_0x1e39('0x1a')](0x194);}return _0x1f68d9;};}function handleError(_0x1ed40f,_0x4b11e5){_0x4b11e5=_0x4b11e5||0x1f4;return function(_0x2f3529){logger['error'](_0x2f3529[_0x1e39('0x28')]);if(_0x2f3529[_0x1e39('0x29')]){delete _0x2f3529[_0x1e39('0x29')];}_0x1ed40f[_0x1e39('0x1c')](_0x4b11e5)[_0x1e39('0x2a')](_0x2f3529);};}exports[_0x1e39('0x2b')]=function(_0xbd2bae,_0x54c8f8){var _0x8b5ba6={},_0x15fbcb={},_0x2834ed={'count':0x0,'rows':[]};var _0x398ec2=_['map'](db[_0x1e39('0x2c')]['rawAttributes'],function(_0x394aa3){return{'name':_0x394aa3[_0x1e39('0x2d')],'type':_0x394aa3[_0x1e39('0x2e')][_0x1e39('0x2f')]};});_0x15fbcb['model']=_[_0x1e39('0x30')](_0x398ec2,'name');_0x15fbcb[_0x1e39('0x31')]=_[_0x1e39('0x32')](_0xbd2bae[_0x1e39('0x31')]);_0x15fbcb[_0x1e39('0x33')]=_[_0x1e39('0x34')](_0x15fbcb[_0x1e39('0x35')],_0x15fbcb[_0x1e39('0x31')]);_0x8b5ba6[_0x1e39('0x36')]=_[_0x1e39('0x34')](_0x15fbcb[_0x1e39('0x35')],qs[_0x1e39('0x37')](_0xbd2bae['query']['fields']));_0x8b5ba6[_0x1e39('0x36')]=_0x8b5ba6[_0x1e39('0x36')][_0x1e39('0x38')]?_0x8b5ba6[_0x1e39('0x36')]:_0x15fbcb[_0x1e39('0x35')];if(!_0xbd2bae['query'][_0x1e39('0x39')]('nolimit')){_0x8b5ba6[_0x1e39('0x1f')]=qs['limit'](_0xbd2bae[_0x1e39('0x31')][_0x1e39('0x1f')]);_0x8b5ba6[_0x1e39('0x1e')]=qs['offset'](_0xbd2bae['query'][_0x1e39('0x1e')]);}_0x8b5ba6[_0x1e39('0x3a')]=qs[_0x1e39('0x3b')](_0xbd2bae[_0x1e39('0x31')]['sort']);_0x8b5ba6['where']=qs[_0x1e39('0x33')](_[_0x1e39('0x3c')](_0xbd2bae['query'],_0x15fbcb['filters']),_0x398ec2);if(_0xbd2bae[_0x1e39('0x31')][_0x1e39('0x3d')]){_0x8b5ba6[_0x1e39('0x3e')]=_[_0x1e39('0x3f')](_0x8b5ba6[_0x1e39('0x3e')],{'$or':_['map'](_0x398ec2,function(_0x57c5fa){if(_0x57c5fa[_0x1e39('0x2e')]!==_0x1e39('0x40')){var _0x214240={};_0x214240[_0x57c5fa['name']]={'$like':'%'+_0xbd2bae[_0x1e39('0x31')][_0x1e39('0x3d')]+'%'};return _0x214240;}})});}_0x8b5ba6=_[_0x1e39('0x3f')]({},_0x8b5ba6,_0xbd2bae[_0x1e39('0x41')]);var _0x31d398={'where':_0x8b5ba6[_0x1e39('0x3e')]};return db[_0x1e39('0x2c')][_0x1e39('0x20')](_0x31d398)[_0x1e39('0x26')](function(_0x52608b){_0x2834ed[_0x1e39('0x20')]=_0x52608b;if(_0xbd2bae[_0x1e39('0x31')][_0x1e39('0x42')]){_0x8b5ba6[_0x1e39('0x43')]=[{'all':!![]}];}return db[_0x1e39('0x2c')][_0x1e39('0x44')](_0x8b5ba6);})[_0x1e39('0x26')](function(_0x1bc9ec){_0x2834ed[_0x1e39('0x45')]=_0x1bc9ec;return _0x2834ed;})[_0x1e39('0x26')](respondWithFilteredResult(_0x54c8f8,_0x8b5ba6))[_0x1e39('0x46')](handleError(_0x54c8f8,null));};exports[_0x1e39('0x47')]=function(_0x2109f6,_0x379cef){var _0x4a1fa3={'raw':!![],'where':{'id':_0x2109f6[_0x1e39('0x48')]['id']}},_0x2741ed={};_0x2741ed[_0x1e39('0x35')]=_['keys'](db[_0x1e39('0x2c')]['rawAttributes']);_0x2741ed[_0x1e39('0x31')]=_[_0x1e39('0x32')](_0x2109f6[_0x1e39('0x31')]);_0x2741ed['filters']=_[_0x1e39('0x34')](_0x2741ed['model'],_0x2741ed[_0x1e39('0x31')]);_0x4a1fa3[_0x1e39('0x36')]=_['intersection'](_0x2741ed['model'],qs[_0x1e39('0x37')](_0x2109f6[_0x1e39('0x31')]['fields']));_0x4a1fa3[_0x1e39('0x36')]=_0x4a1fa3[_0x1e39('0x36')]['length']?_0x4a1fa3[_0x1e39('0x36')]:_0x2741ed[_0x1e39('0x35')];if(_0x2109f6['query'][_0x1e39('0x42')]){_0x4a1fa3[_0x1e39('0x43')]=[{'all':!![]}];}_0x4a1fa3=_['merge']({},_0x4a1fa3,_0x2109f6[_0x1e39('0x41')]);return db[_0x1e39('0x2c')][_0x1e39('0x49')](_0x4a1fa3)[_0x1e39('0x26')](handleEntityNotFound(_0x379cef,null))[_0x1e39('0x26')](respondWithResult(_0x379cef,null))[_0x1e39('0x46')](handleError(_0x379cef,null));};exports['create']=function(_0x3a7cda,_0x43d7c4){return db[_0x1e39('0x2c')]['create'](_0x3a7cda[_0x1e39('0x4a')],{})[_0x1e39('0x26')](respondWithResult(_0x43d7c4,0xc9))[_0x1e39('0x46')](handleError(_0x43d7c4,null));};exports[_0x1e39('0x25')]=function(_0x155fc9,_0x432f81){if(_0x155fc9[_0x1e39('0x4a')]['id']){delete _0x155fc9[_0x1e39('0x4a')]['id'];}return db[_0x1e39('0x2c')]['find']({'where':{'id':_0x155fc9[_0x1e39('0x48')]['id']}})[_0x1e39('0x26')](handleEntityNotFound(_0x432f81,null))[_0x1e39('0x26')](saveUpdates(_0x155fc9[_0x1e39('0x4a')],null))[_0x1e39('0x26')](respondWithResult(_0x432f81,null))['catch'](handleError(_0x432f81,null));};exports[_0x1e39('0x27')]=function(_0x124109,_0x3dd485){return db[_0x1e39('0x2c')][_0x1e39('0x49')]({'where':{'id':_0x124109[_0x1e39('0x48')]['id']}})[_0x1e39('0x26')](handleEntityNotFound(_0x3dd485,null))[_0x1e39('0x26')](removeEntity(_0x3dd485,null))[_0x1e39('0x46')](handleError(_0x3dd485,null));}; \ No newline at end of file +var _0x48ea=['undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','FreshsalesField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','merge','options','rows','catch','params','length','include','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset'];(function(_0x4a91fc,_0x515ea2){var _0x35de82=function(_0x263978){while(--_0x263978){_0x4a91fc['push'](_0x4a91fc['shift']());}};_0x35de82(++_0x515ea2);}(_0x48ea,0xaf));var _0xa48e=function(_0x82e772,_0x400760){_0x82e772=_0x82e772-0x0;var _0x190f42=_0x48ea[_0x82e772];return _0x190f42;};'use strict';var emlformat=require(_0xa48e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa48e('0x1'));var jsonpatch=require(_0xa48e('0x2'));var rp=require(_0xa48e('0x3'));var moment=require(_0xa48e('0x4'));var BPromise=require(_0xa48e('0x5'));var Mustache=require(_0xa48e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa48e('0x7'));var csv=require(_0xa48e('0x8'));var ejs=require(_0xa48e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa48e('0xa'));var squel=require('squel');var crypto=require(_0xa48e('0xb'));var jsforce=require(_0xa48e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa48e('0xd'));var Redis=require(_0xa48e('0xe'));var authService=require(_0xa48e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa48e('0x10'));var hardwareService=require(_0xa48e('0x11'));var logger=require(_0xa48e('0x12'))(_0xa48e('0x13'));var utils=require('../../config/utils');var config=require(_0xa48e('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55dc96,_0x5a95fe){_0x5a95fe=_0x5a95fe||0xcc;return function(_0x14579a){if(_0x14579a){return _0x55dc96[_0xa48e('0x15')](_0x5a95fe);}return _0x55dc96[_0xa48e('0x16')](_0x5a95fe)[_0xa48e('0x17')]();};}function respondWithResult(_0x4f0339,_0x16306){_0x16306=_0x16306||0xc8;return function(_0x52b144){if(_0x52b144){return _0x4f0339[_0xa48e('0x16')](_0x16306)[_0xa48e('0x18')](_0x52b144);}};}function respondWithFilteredResult(_0x3656f7,_0x566a85){return function(_0x4707b5){if(_0x4707b5){var _0x4c2c58=typeof _0x566a85[_0xa48e('0x19')]===_0xa48e('0x1a')&&typeof _0x566a85[_0xa48e('0x1b')]===_0xa48e('0x1a');var _0x4d1488=_0x4707b5[_0xa48e('0x1c')];var _0x83fae0=_0x4c2c58?0x0:_0x566a85[_0xa48e('0x19')];var _0x38de5b=_0x4c2c58?_0x4707b5[_0xa48e('0x1c')]:_0x566a85['offset']+_0x566a85[_0xa48e('0x1b')];var _0x3d3fec;if(_0x38de5b>=_0x4d1488){_0x38de5b=_0x4d1488;_0x3d3fec=0xc8;}else{_0x3d3fec=0xce;}_0x3656f7['status'](_0x3d3fec);return _0x3656f7[_0xa48e('0x1d')](_0xa48e('0x1e'),_0x83fae0+'-'+_0x38de5b+'/'+_0x4d1488)[_0xa48e('0x18')](_0x4707b5);}return null;};}function patchUpdates(_0x58dbfe){return function(_0x310ef9){try{jsonpatch[_0xa48e('0x1f')](_0x310ef9,_0x58dbfe,!![]);}catch(_0x23d919){return BPromise[_0xa48e('0x20')](_0x23d919);}return _0x310ef9[_0xa48e('0x21')]();};}function saveUpdates(_0x2eb11c,_0x1b06d){return function(_0x381391){if(_0x381391){return _0x381391['update'](_0x2eb11c)[_0xa48e('0x22')](function(_0x50d9f6){return _0x50d9f6;});}return null;};}function removeEntity(_0x3b29d8,_0x3d0ebb){return function(_0x1a9378){if(_0x1a9378){return _0x1a9378[_0xa48e('0x23')]()[_0xa48e('0x22')](function(){_0x3b29d8[_0xa48e('0x16')](0xcc)[_0xa48e('0x17')]();});}};}function handleEntityNotFound(_0x8d9331,_0x29beb5){return function(_0x1d6eee){if(!_0x1d6eee){_0x8d9331[_0xa48e('0x15')](0x194);}return _0x1d6eee;};}function handleError(_0x22f403,_0xfcfd5e){_0xfcfd5e=_0xfcfd5e||0x1f4;return function(_0x47730b){logger[_0xa48e('0x24')](_0x47730b[_0xa48e('0x25')]);if(_0x47730b[_0xa48e('0x26')]){delete _0x47730b[_0xa48e('0x26')];}_0x22f403['status'](_0xfcfd5e)['send'](_0x47730b);};}exports['index']=function(_0x38b3db,_0x2518cb){var _0x137cfd={},_0x32b998={},_0x56d447={'count':0x0,'rows':[]};var _0x2ec0dc=_[_0xa48e('0x27')](db[_0xa48e('0x28')][_0xa48e('0x29')],function(_0x41d6fd){return{'name':_0x41d6fd[_0xa48e('0x2a')],'type':_0x41d6fd[_0xa48e('0x2b')][_0xa48e('0x2c')]};});_0x32b998[_0xa48e('0x2d')]=_[_0xa48e('0x27')](_0x2ec0dc,_0xa48e('0x26'));_0x32b998['query']=_[_0xa48e('0x2e')](_0x38b3db[_0xa48e('0x2f')]);_0x32b998[_0xa48e('0x30')]=_[_0xa48e('0x31')](_0x32b998['model'],_0x32b998[_0xa48e('0x2f')]);_0x137cfd[_0xa48e('0x32')]=_[_0xa48e('0x31')](_0x32b998['model'],qs[_0xa48e('0x33')](_0x38b3db[_0xa48e('0x2f')][_0xa48e('0x33')]));_0x137cfd[_0xa48e('0x32')]=_0x137cfd[_0xa48e('0x32')]['length']?_0x137cfd['attributes']:_0x32b998[_0xa48e('0x2d')];if(!_0x38b3db[_0xa48e('0x2f')][_0xa48e('0x34')](_0xa48e('0x35'))){_0x137cfd['limit']=qs[_0xa48e('0x1b')](_0x38b3db[_0xa48e('0x2f')][_0xa48e('0x1b')]);_0x137cfd[_0xa48e('0x19')]=qs['offset'](_0x38b3db['query']['offset']);}_0x137cfd['order']=qs[_0xa48e('0x36')](_0x38b3db['query'][_0xa48e('0x36')]);_0x137cfd['where']=qs['filters'](_['pick'](_0x38b3db[_0xa48e('0x2f')],_0x32b998[_0xa48e('0x30')]),_0x2ec0dc);if(_0x38b3db['query'][_0xa48e('0x37')]){_0x137cfd['where']=_[_0xa48e('0x38')](_0x137cfd['where'],{'$or':_[_0xa48e('0x27')](_0x2ec0dc,function(_0x4415a8){if(_0x4415a8[_0xa48e('0x2b')]!=='VIRTUAL'){var _0x3ff5bc={};_0x3ff5bc[_0x4415a8[_0xa48e('0x26')]]={'$like':'%'+_0x38b3db[_0xa48e('0x2f')][_0xa48e('0x37')]+'%'};return _0x3ff5bc;}})});}_0x137cfd=_[_0xa48e('0x38')]({},_0x137cfd,_0x38b3db[_0xa48e('0x39')]);var _0x5c4347={'where':_0x137cfd['where']};return db[_0xa48e('0x28')][_0xa48e('0x1c')](_0x5c4347)[_0xa48e('0x22')](function(_0x45414e){_0x56d447[_0xa48e('0x1c')]=_0x45414e;if(_0x38b3db[_0xa48e('0x2f')]['includeAll']){_0x137cfd['include']=[{'all':!![]}];}return db[_0xa48e('0x28')]['findAll'](_0x137cfd);})[_0xa48e('0x22')](function(_0x198f0e){_0x56d447[_0xa48e('0x3a')]=_0x198f0e;return _0x56d447;})['then'](respondWithFilteredResult(_0x2518cb,_0x137cfd))[_0xa48e('0x3b')](handleError(_0x2518cb,null));};exports['show']=function(_0x5aaca2,_0x4d1b49){var _0x21c7fd={'raw':!![],'where':{'id':_0x5aaca2[_0xa48e('0x3c')]['id']}},_0x5dd872={};_0x5dd872[_0xa48e('0x2d')]=_[_0xa48e('0x2e')](db['FreshsalesField'][_0xa48e('0x29')]);_0x5dd872[_0xa48e('0x2f')]=_['keys'](_0x5aaca2[_0xa48e('0x2f')]);_0x5dd872[_0xa48e('0x30')]=_[_0xa48e('0x31')](_0x5dd872['model'],_0x5dd872[_0xa48e('0x2f')]);_0x21c7fd[_0xa48e('0x32')]=_[_0xa48e('0x31')](_0x5dd872['model'],qs[_0xa48e('0x33')](_0x5aaca2[_0xa48e('0x2f')][_0xa48e('0x33')]));_0x21c7fd[_0xa48e('0x32')]=_0x21c7fd[_0xa48e('0x32')][_0xa48e('0x3d')]?_0x21c7fd[_0xa48e('0x32')]:_0x5dd872[_0xa48e('0x2d')];if(_0x5aaca2[_0xa48e('0x2f')]['includeAll']){_0x21c7fd[_0xa48e('0x3e')]=[{'all':!![]}];}_0x21c7fd=_['merge']({},_0x21c7fd,_0x5aaca2['options']);return db['FreshsalesField'][_0xa48e('0x3f')](_0x21c7fd)[_0xa48e('0x22')](handleEntityNotFound(_0x4d1b49,null))[_0xa48e('0x22')](respondWithResult(_0x4d1b49,null))[_0xa48e('0x3b')](handleError(_0x4d1b49,null));};exports[_0xa48e('0x40')]=function(_0x4345d9,_0x3ddade){return db[_0xa48e('0x28')][_0xa48e('0x40')](_0x4345d9[_0xa48e('0x41')],{})[_0xa48e('0x22')](respondWithResult(_0x3ddade,0xc9))[_0xa48e('0x3b')](handleError(_0x3ddade,null));};exports[_0xa48e('0x42')]=function(_0x40b166,_0x2ba4f5){if(_0x40b166[_0xa48e('0x41')]['id']){delete _0x40b166['body']['id'];}return db[_0xa48e('0x28')][_0xa48e('0x3f')]({'where':{'id':_0x40b166[_0xa48e('0x3c')]['id']}})[_0xa48e('0x22')](handleEntityNotFound(_0x2ba4f5,null))[_0xa48e('0x22')](saveUpdates(_0x40b166['body'],null))[_0xa48e('0x22')](respondWithResult(_0x2ba4f5,null))['catch'](handleError(_0x2ba4f5,null));};exports[_0xa48e('0x23')]=function(_0x1b53b9,_0x5eb7b0){return db['FreshsalesField']['find']({'where':{'id':_0x1b53b9['params']['id']}})[_0xa48e('0x22')](handleEntityNotFound(_0x5eb7b0,null))[_0xa48e('0x22')](removeEntity(_0x5eb7b0,null))[_0xa48e('0x3b')](handleError(_0x5eb7b0,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 4d5c1eb..02a8c05 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 _0xf4f4=['int_freshsales_fields','freshsales_unique_index','idField','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','FreshsalesField'];(function(_0x5c355e,_0x3c7cf9){var _0x42f7ed=function(_0x339894){while(--_0x339894){_0x5c355e['push'](_0x5c355e['shift']());}};_0x42f7ed(++_0x3c7cf9);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x41285f,_0x242ecb){_0x41285f=_0x41285f-0x0;var _0x358377=_0xf4f4[_0x41285f];return _0x358377;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var logger=require('../../config/logger')(_0x4f4f('0x2'));var moment=require(_0x4f4f('0x3'));var BPromise=require(_0x4f4f('0x4'));var rp=require(_0x4f4f('0x5'));var fs=require('fs');var path=require(_0x4f4f('0x6'));var rimraf=require('rimraf');var config=require(_0x4f4f('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x4f4f('0x8')]=function(_0x132d5c,_0x20ee6e){return _0x132d5c[_0x4f4f('0x9')](_0x4f4f('0xa'),attributes,{'tableName':_0x4f4f('0xb'),'paranoid':![],'indexes':[{'name':_0x4f4f('0xc'),'fields':[_0x4f4f('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d04=['request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x26ecfd,_0x30feb2){var _0x5c1f06=function(_0x34b0b4){while(--_0x34b0b4){_0x26ecfd['push'](_0x26ecfd['shift']());}};_0x5c1f06(++_0x30feb2);}(_0x3d04,0xbe));var _0x43d0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3d04[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var logger=require(_0x43d0('0x2'))(_0x43d0('0x3'));var moment=require(_0x43d0('0x4'));var BPromise=require(_0x43d0('0x5'));var rp=require(_0x43d0('0x6'));var fs=require('fs');var path=require(_0x43d0('0x7'));var rimraf=require('rimraf');var config=require(_0x43d0('0x8'));var attributes=require(_0x43d0('0x9'));module[_0x43d0('0xa')]=function(_0x617bf,_0x5e284f){return _0x617bf['define']('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x43d0('0xb'),'fields':[_0x43d0('0xc'),_0x43d0('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 803860e..01917c7 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 _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(_0x129b15,_0x1287f4){var _0x9e5334=function(_0x162b05){while(--_0x162b05){_0x129b15['push'](_0x129b15['shift']());}};_0x9e5334(++_0x1287f4);}(_0x2ef3,0xba));var _0x32ef=function(_0x5b6313,_0x47e710){_0x5b6313=_0x5b6313-0x0;var _0x2169f4=_0x2ef3[_0x5b6313];return _0x2169f4;};'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 +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0xf494,0x1c6));var _0x4f49=function(_0x236784,_0x475f23){_0x236784=_0x236784-0x0;var _0x394338=_0xf494[_0x236784];return _0x394338;};'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);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index b7ec556..5ffc104 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 _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(_0x545d9f,_0x3b4587){var _0xa52a37=function(_0x5132a4){while(--_0x5132a4){_0x545d9f['push'](_0x545d9f['shift']());}};_0xa52a37(++_0x3b4587);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x568b42,_0x422e31){var _0x38d93c=function(_0xb13891){while(--_0xb13891){_0x568b42['push'](_0x568b42['shift']());}};_0x38d93c(++_0x422e31);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 238b007..9e63101 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1d4=['newTab','integrationTab','sequelize','STRING','username','ENUM'];(function(_0x2552b0,_0x4d6dee){var _0x10723d=function(_0x44b468){while(--_0x44b468){_0x2552b0['push'](_0x2552b0['shift']());}};_0x10723d(++_0x4d6dee);}(_0xf1d4,0x158));var _0x4f1d=function(_0x5b579d,_0x563fd0){_0x5b579d=_0x5b579d-0x0;var _0x371fad=_0xf1d4[_0x5b579d];return _0x371fad;};'use strict';var Sequelize=require(_0x4f1d('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f1d('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4f1d('0x1')],'unique':_0x4f1d('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4f1d('0x1')]},'clientId':{'type':Sequelize[_0x4f1d('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x4f1d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4f1d('0x3')]('integrationTab',_0x4f1d('0x4')),'defaultValue':_0x4f1d('0x5')}}; \ No newline at end of file +var _0xf15d=['STRING','username','ENUM','newTab','integrationTab','sequelize'];(function(_0xbe6c67,_0x10f3bc){var _0x136b10=function(_0x2380ab){while(--_0x2380ab){_0xbe6c67['push'](_0xbe6c67['shift']());}};_0x136b10(++_0x10f3bc);}(_0xf15d,0x113));var _0xdf15=function(_0x23cfd8,_0xfdc6df){_0x23cfd8=_0x23cfd8-0x0;var _0x47878b=_0xf15d[_0x23cfd8];return _0x47878b;};'use strict';var Sequelize=require(_0xdf15('0x0'));module['exports']={'name':{'type':Sequelize[_0xdf15('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xdf15('0x2')},'remoteUri':{'type':Sequelize[_0xdf15('0x1')]},'password':{'type':Sequelize[_0xdf15('0x1')]},'clientId':{'type':Sequelize[_0xdf15('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xdf15('0x1')]},'serverUrl':{'type':Sequelize[_0xdf15('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdf15('0x3')]('integrationTab',_0xdf15('0x4')),'defaultValue':_0xdf15('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index fc8eff6..25402fa 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 _0x72bd=['rows','catch','show','params','rawAttributes','length','include','find','create','body','destroy','getConfigurations','findOne','pick','addConfiguration','Subjects','channel','getDescriptions','SalesforceConfiguration','SalesforceField','Descriptions','getFields','Task','clientId','clientSecret','remoteUri','slice','substring','lastIndexOf','Connection','username','password','securityToken','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','int','picklist','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','error','name','send','index','map','SalesforceAccount','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll'];(function(_0x18a433,_0x1bb62e){var _0x392384=function(_0x2d3781){while(--_0x2d3781){_0x18a433['push'](_0x18a433['shift']());}};_0x392384(++_0x1bb62e);}(_0x72bd,0x130));var _0xd72b=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x72bd[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require(_0xd72b('0x0'));var rimraf=require(_0xd72b('0x1'));var zipdir=require(_0xd72b('0x2'));var jsonpatch=require(_0xd72b('0x3'));var rp=require('request-promise');var moment=require(_0xd72b('0x4'));var BPromise=require(_0xd72b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd72b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd72b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd72b('0x8'));var squel=require(_0xd72b('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd72b('0xa'));var toCsv=require(_0xd72b('0xb'));var querystring=require(_0xd72b('0xc'));var Papa=require(_0xd72b('0xd'));var Redis=require(_0xd72b('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd72b('0xf'));var hardwareService=require(_0xd72b('0x10'));var logger=require(_0xd72b('0x11'))(_0xd72b('0x12'));var utils=require(_0xd72b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd72b('0x14'));var db=require(_0xd72b('0x15'))['db'];var integrations=require(_0xd72b('0x16'));function respondWithStatusCode(_0xa62263,_0x481b82){_0x481b82=_0x481b82||0xcc;return function(_0x4d75f4){if(_0x4d75f4){return _0xa62263[_0xd72b('0x17')](_0x481b82);}return _0xa62263[_0xd72b('0x18')](_0x481b82)[_0xd72b('0x19')]();};}function respondWithResult(_0x310a18,_0xd27de){_0xd27de=_0xd27de||0xc8;return function(_0x50345f){if(_0x50345f){return _0x310a18['status'](_0xd27de)[_0xd72b('0x1a')](_0x50345f);}};}function respondWithFilteredResult(_0x2a19c0,_0x5cbe3c){return function(_0x498509){if(_0x498509){var _0x859c78=typeof _0x5cbe3c[_0xd72b('0x1b')]===_0xd72b('0x1c')&&typeof _0x5cbe3c[_0xd72b('0x1d')]===_0xd72b('0x1c');var _0x4763b8=_0x498509[_0xd72b('0x1e')];var _0x10420c=_0x859c78?0x0:_0x5cbe3c['offset'];var _0xbcc6b7=_0x859c78?_0x498509[_0xd72b('0x1e')]:_0x5cbe3c[_0xd72b('0x1b')]+_0x5cbe3c[_0xd72b('0x1d')];var _0x1ce9ed;if(_0xbcc6b7>=_0x4763b8){_0xbcc6b7=_0x4763b8;_0x1ce9ed=0xc8;}else{_0x1ce9ed=0xce;}_0x2a19c0[_0xd72b('0x18')](_0x1ce9ed);return _0x2a19c0[_0xd72b('0x1f')]('Content-Range',_0x10420c+'-'+_0xbcc6b7+'/'+_0x4763b8)[_0xd72b('0x1a')](_0x498509);}return null;};}function patchUpdates(_0x49b472){return function(_0x3712c7){try{jsonpatch[_0xd72b('0x20')](_0x3712c7,_0x49b472,!![]);}catch(_0x4561fa){return BPromise[_0xd72b('0x21')](_0x4561fa);}return _0x3712c7['save']();};}function saveUpdates(_0x3fe2e,_0x6fae7c){return function(_0xae8db7){if(_0xae8db7){return _0xae8db7[_0xd72b('0x22')](_0x3fe2e)['then'](function(_0x451f86){return _0x451f86;});}return null;};}function removeEntity(_0x4c771a,_0x43aaba){return function(_0x14f732){if(_0x14f732){return _0x14f732['destroy']()[_0xd72b('0x23')](function(){_0x4c771a[_0xd72b('0x18')](0xcc)[_0xd72b('0x19')]();});}};}function handleEntityNotFound(_0x3982ae,_0x1fd025){return function(_0x367eb3){if(!_0x367eb3){_0x3982ae['sendStatus'](0x194);}return _0x367eb3;};}function handleError(_0x50bf28,_0xef1ded){_0xef1ded=_0xef1ded||0x1f4;return function(_0x5cd355){logger[_0xd72b('0x24')](_0x5cd355['stack']);if(_0x5cd355[_0xd72b('0x25')]){delete _0x5cd355['name'];}_0x50bf28['status'](_0xef1ded)[_0xd72b('0x26')](_0x5cd355);};}exports[_0xd72b('0x27')]=function(_0x2832da,_0xb580ed){var _0x4e98b5={},_0x7f7f68={},_0x480524={'count':0x0,'rows':[]};var _0x1a8e81=_[_0xd72b('0x28')](db[_0xd72b('0x29')]['rawAttributes'],function(_0x13690f){return{'name':_0x13690f[_0xd72b('0x2a')],'type':_0x13690f[_0xd72b('0x2b')][_0xd72b('0x2c')]};});_0x7f7f68[_0xd72b('0x2d')]=_[_0xd72b('0x28')](_0x1a8e81,'name');_0x7f7f68['query']=_[_0xd72b('0x2e')](_0x2832da[_0xd72b('0x2f')]);_0x7f7f68[_0xd72b('0x30')]=_['intersection'](_0x7f7f68[_0xd72b('0x2d')],_0x7f7f68[_0xd72b('0x2f')]);_0x4e98b5[_0xd72b('0x31')]=_[_0xd72b('0x32')](_0x7f7f68[_0xd72b('0x2d')],qs[_0xd72b('0x33')](_0x2832da[_0xd72b('0x2f')][_0xd72b('0x33')]));_0x4e98b5[_0xd72b('0x31')]=_0x4e98b5[_0xd72b('0x31')]['length']?_0x4e98b5[_0xd72b('0x31')]:_0x7f7f68[_0xd72b('0x2d')];if(!_0x2832da[_0xd72b('0x2f')][_0xd72b('0x34')](_0xd72b('0x35'))){_0x4e98b5[_0xd72b('0x1d')]=qs[_0xd72b('0x1d')](_0x2832da['query']['limit']);_0x4e98b5[_0xd72b('0x1b')]=qs[_0xd72b('0x1b')](_0x2832da[_0xd72b('0x2f')][_0xd72b('0x1b')]);}_0x4e98b5[_0xd72b('0x36')]=qs[_0xd72b('0x37')](_0x2832da[_0xd72b('0x2f')][_0xd72b('0x37')]);_0x4e98b5[_0xd72b('0x38')]=qs[_0xd72b('0x30')](_['pick'](_0x2832da[_0xd72b('0x2f')],_0x7f7f68[_0xd72b('0x30')]),_0x1a8e81);if(_0x2832da[_0xd72b('0x2f')][_0xd72b('0x39')]){_0x4e98b5['where']=_[_0xd72b('0x3a')](_0x4e98b5[_0xd72b('0x38')],{'$or':_[_0xd72b('0x28')](_0x1a8e81,function(_0x4d5145){if(_0x4d5145[_0xd72b('0x2b')]!=='VIRTUAL'){var _0x478c6d={};_0x478c6d[_0x4d5145[_0xd72b('0x25')]]={'$like':'%'+_0x2832da['query'][_0xd72b('0x39')]+'%'};return _0x478c6d;}})});}_0x4e98b5=_['merge']({},_0x4e98b5,_0x2832da[_0xd72b('0x3b')]);var _0xea1182={'where':_0x4e98b5[_0xd72b('0x38')]};return db[_0xd72b('0x29')]['count'](_0xea1182)[_0xd72b('0x23')](function(_0xf583a){_0x480524[_0xd72b('0x1e')]=_0xf583a;if(_0x2832da[_0xd72b('0x2f')][_0xd72b('0x3c')]){_0x4e98b5['include']=[{'all':!![]}];}return db[_0xd72b('0x29')][_0xd72b('0x3d')](_0x4e98b5);})[_0xd72b('0x23')](function(_0x369a9f){_0x480524[_0xd72b('0x3e')]=_0x369a9f;return _0x480524;})[_0xd72b('0x23')](respondWithFilteredResult(_0xb580ed,_0x4e98b5))[_0xd72b('0x3f')](handleError(_0xb580ed,null));};exports[_0xd72b('0x40')]=function(_0x2f0a13,_0x525ab6){var _0x59df89={'raw':![],'where':{'id':_0x2f0a13[_0xd72b('0x41')]['id']}},_0x401738={};_0x401738[_0xd72b('0x2d')]=_['keys'](db[_0xd72b('0x29')][_0xd72b('0x42')]);_0x401738[_0xd72b('0x2f')]=_[_0xd72b('0x2e')](_0x2f0a13[_0xd72b('0x2f')]);_0x401738['filters']=_['intersection'](_0x401738[_0xd72b('0x2d')],_0x401738[_0xd72b('0x2f')]);_0x59df89[_0xd72b('0x31')]=_[_0xd72b('0x32')](_0x401738[_0xd72b('0x2d')],qs[_0xd72b('0x33')](_0x2f0a13['query']['fields']));_0x59df89[_0xd72b('0x31')]=_0x59df89[_0xd72b('0x31')][_0xd72b('0x43')]?_0x59df89[_0xd72b('0x31')]:_0x401738[_0xd72b('0x2d')];if(_0x2f0a13[_0xd72b('0x2f')][_0xd72b('0x3c')]){_0x59df89[_0xd72b('0x44')]=[{'all':!![]}];}_0x59df89=_['merge']({},_0x59df89,_0x2f0a13[_0xd72b('0x3b')]);return db[_0xd72b('0x29')][_0xd72b('0x45')](_0x59df89)[_0xd72b('0x23')](handleEntityNotFound(_0x525ab6,null))[_0xd72b('0x23')](respondWithResult(_0x525ab6,null))[_0xd72b('0x3f')](handleError(_0x525ab6,null));};exports[_0xd72b('0x46')]=function(_0x1ab04d,_0x7cafb0){return db['SalesforceAccount'][_0xd72b('0x46')](_0x1ab04d[_0xd72b('0x47')],{})[_0xd72b('0x23')](respondWithResult(_0x7cafb0,0xc9))[_0xd72b('0x3f')](handleError(_0x7cafb0,null));};exports[_0xd72b('0x22')]=function(_0x2d2bb3,_0x494e48){if(_0x2d2bb3[_0xd72b('0x47')]['id']){delete _0x2d2bb3[_0xd72b('0x47')]['id'];}return db['SalesforceAccount'][_0xd72b('0x45')]({'where':{'id':_0x2d2bb3['params']['id']}})[_0xd72b('0x23')](handleEntityNotFound(_0x494e48,null))[_0xd72b('0x23')](saveUpdates(_0x2d2bb3[_0xd72b('0x47')],null))['then'](respondWithResult(_0x494e48,null))['catch'](handleError(_0x494e48,null));};exports[_0xd72b('0x48')]=function(_0x1b80a0,_0x103ece){return db[_0xd72b('0x29')]['find']({'where':{'id':_0x1b80a0['params']['id']}})['then'](handleEntityNotFound(_0x103ece,null))[_0xd72b('0x23')](removeEntity(_0x103ece,null))[_0xd72b('0x3f')](handleError(_0x103ece,null));};exports[_0xd72b('0x49')]=function(_0x35a9d5,_0x131525,_0x26651d){var _0xc551e7={};var _0x3244d4={};var _0x196a3a;var _0x30b201;return db[_0xd72b('0x29')][_0xd72b('0x4a')]({'where':{'id':_0x35a9d5[_0xd72b('0x41')]['id']}})[_0xd72b('0x23')](handleEntityNotFound(_0x131525,null))['then'](function(_0x1bd112){if(_0x1bd112){_0x196a3a=_0x1bd112;_0x3244d4['model']=_[_0xd72b('0x2e')](db['SalesforceConfiguration'][_0xd72b('0x42')]);_0x3244d4[_0xd72b('0x2f')]=_[_0xd72b('0x2e')](_0x35a9d5[_0xd72b('0x2f')]);_0x3244d4[_0xd72b('0x30')]=_[_0xd72b('0x32')](_0x3244d4[_0xd72b('0x2d')],_0x3244d4[_0xd72b('0x2f')]);_0xc551e7[_0xd72b('0x31')]=_[_0xd72b('0x32')](_0x3244d4[_0xd72b('0x2d')],qs[_0xd72b('0x33')](_0x35a9d5[_0xd72b('0x2f')][_0xd72b('0x33')]));_0xc551e7[_0xd72b('0x31')]=_0xc551e7[_0xd72b('0x31')]['length']?_0xc551e7[_0xd72b('0x31')]:_0x3244d4[_0xd72b('0x2d')];_0xc551e7['order']=qs[_0xd72b('0x37')](_0x35a9d5['query'][_0xd72b('0x37')]);_0xc551e7['where']=qs['filters'](_[_0xd72b('0x4b')](_0x35a9d5['query'],_0x3244d4[_0xd72b('0x30')]));if(_0x35a9d5[_0xd72b('0x2f')][_0xd72b('0x39')]){_0xc551e7[_0xd72b('0x38')]=_['merge'](_0xc551e7[_0xd72b('0x38')],{'$or':_[_0xd72b('0x28')](_0xc551e7[_0xd72b('0x31')],function(_0x385915){var _0x593852={};_0x593852[_0x385915]={'$like':'%'+_0x35a9d5[_0xd72b('0x2f')][_0xd72b('0x39')]+'%'};return _0x593852;})});}_0xc551e7=_['merge']({},_0xc551e7,_0x35a9d5[_0xd72b('0x3b')]);return _0x196a3a[_0xd72b('0x49')](_0xc551e7);}})[_0xd72b('0x23')](function(_0x503fa7){if(_0x503fa7){_0x30b201=_0x503fa7[_0xd72b('0x43')];if(!_0x35a9d5[_0xd72b('0x2f')][_0xd72b('0x34')](_0xd72b('0x35'))){_0xc551e7['limit']=qs[_0xd72b('0x1d')](_0x35a9d5['query'][_0xd72b('0x1d')]);_0xc551e7['offset']=qs[_0xd72b('0x1b')](_0x35a9d5['query'][_0xd72b('0x1b')]);}return _0x196a3a[_0xd72b('0x49')](_0xc551e7);}})[_0xd72b('0x23')](function(_0x2f8213){if(_0x2f8213){return _0x2f8213?{'count':_0x30b201,'rows':_0x2f8213}:null;}})[_0xd72b('0x23')](respondWithResult(_0x131525,null))['catch'](handleError(_0x131525,null));};exports[_0xd72b('0x4c')]=function(_0x3e4cb4,_0xd9e808,_0x136c75){if(_0x3e4cb4[_0xd72b('0x47')]['id']){delete _0x3e4cb4['body']['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x3e4cb4['params']['id']}})[_0xd72b('0x23')](handleEntityNotFound(_0xd9e808,null))[_0xd72b('0x23')](function(_0x1afc19){if(_0x1afc19){_0x3e4cb4[_0xd72b('0x47')]['AccountId']=_0x1afc19['id'];_0x3e4cb4['body'][_0xd72b('0x4d')]=integrations['getSubjects'](_0x3e4cb4[_0xd72b('0x47')][_0xd72b('0x4e')],_0x3e4cb4[_0xd72b('0x47')][_0xd72b('0x2b')]);_0x3e4cb4['body']['Descriptions']=integrations[_0xd72b('0x4f')](_0x3e4cb4[_0xd72b('0x47')][_0xd72b('0x4e')],_0x3e4cb4[_0xd72b('0x47')][_0xd72b('0x2b')]);return db[_0xd72b('0x50')][_0xd72b('0x46')](_0x3e4cb4[_0xd72b('0x47')],{'include':[{'model':db[_0xd72b('0x51')],'as':_0xd72b('0x4d')},{'model':db['SalesforceField'],'as':_0xd72b('0x52')}]});}return null;})[_0xd72b('0x23')](respondWithResult(_0xd9e808,null))[_0xd72b('0x3f')](handleError(_0xd9e808,null));};exports[_0xd72b('0x53')]=function(_0x460e33,_0x365460,_0x46cecd){var _0x58437a;var _0x28b5fe='';var _0x1b021c=_0xd72b('0x54');return db[_0xd72b('0x29')]['findOne']({'where':{'id':_0x460e33[_0xd72b('0x41')]['id']},'attributes':['id','remoteUri',_0xd72b('0x55'),_0xd72b('0x56'),'username','password','securityToken']})['then'](handleEntityNotFound(_0x365460,null))[_0xd72b('0x23')](function(_0x241864){if(_0x241864){_0x28b5fe=_0x241864[_0xd72b('0x57')];var _0x360c49=_0x28b5fe[_0xd72b('0x58')](-0x1);if(_0x360c49==='/'){_0x28b5fe=_0x28b5fe[_0xd72b('0x59')](0x0,_0x28b5fe[_0xd72b('0x5a')](_0x360c49));}_0x58437a=new jsforce[(_0xd72b('0x5b'))]({'oauth2':{'loginUrl':_0x28b5fe,'clientId':_0x241864[_0xd72b('0x55')],'clientSecret':_0x241864['clientSecret']}});return _0x58437a['login'](_0x241864[_0xd72b('0x5c')],_0x241864[_0xd72b('0x5d')]['concat'](_0x241864[_0xd72b('0x5e')]));}})['then'](function(_0x1ba597){if(_0x1ba597){if(!_[_0xd72b('0x5f')](_0x460e33[_0xd72b('0x2f')][_0xd72b('0x60')])){_0x1b021c=_0x460e33[_0xd72b('0x2f')][_0xd72b('0x60')];}return _0x58437a[_0xd72b('0x61')](_0x1b021c)['describe']();}})[_0xd72b('0x23')](function(_0x4d9951){var _0x3a09cb=[_0xd72b('0x62'),_0xd72b('0x63'),_0xd72b('0x64'),_0xd72b('0x65'),'Subject',_0xd72b('0x66')];var _0x4b7ced=['string',_0xd72b('0x67'),_0xd72b('0x68'),'boolean',_0xd72b('0x69'),_0xd72b('0x6a'),_0xd72b('0x6b')];if(_0x4d9951){_[_0xd72b('0x6c')](_0x4d9951[_0xd72b('0x33')],function(_0x3a5160){return _0x3a09cb[_0xd72b('0x6d')](_0x3a5160['name'])||!_0x4b7ced[_0xd72b('0x6d')](_0x3a5160[_0xd72b('0x2b')]);});return{'count':_0x4d9951['fields'][_0xd72b('0x43')],'rows':_[_0xd72b('0x28')](_0x4d9951[_0xd72b('0x33')],function(_0x53c327){return{'id':_0x53c327[_0xd72b('0x25')],'name':_0x53c327[_0xd72b('0x6e')],'custom':_0x53c327[_0xd72b('0x6f')],'options':_0x53c327[_0xd72b('0x70')][_0xd72b('0x43')]>0x0?_['map'](_0x53c327[_0xd72b('0x70')],function(_0x3290ef){return{'name':_0x3290ef[_0xd72b('0x6e')],'value':_0x3290ef[_0xd72b('0x71')]};}):_0x53c327['type']=='boolean'?[{'name':_0xd72b('0x72'),'value':_0xd72b('0x73')},{'name':_0xd72b('0x74'),'value':'false'}]:[]};})};}})[_0xd72b('0x23')](respondWithResult(_0x365460,null))[_0xd72b('0x3f')](function(_0x2f0af1){var _0x22b6ab=_0x460e33[_0xd72b('0x2f')][_0xd72b('0x75')]?0x1f4:_0x2f0af1[_0xd72b('0x76')]||0x1f4;logger['error'](_0xd72b('0x77'),_0xd72b('0x53'),_0x22b6ab,JSON[_0xd72b('0x78')](_0x2f0af1));delete _0x2f0af1[_0xd72b('0x25')];if(_0x22b6ab===0x191){_0x22b6ab=0x190;}_0x365460[_0xd72b('0x18')](_0x22b6ab)[_0xd72b('0x26')](_0x460e33['query'][_0xd72b('0x75')]?{'message':_0xd72b('0x79'),'statusCode':_0x2f0af1['statusCode']}:_0x2f0af1);});}; \ No newline at end of file +var _0x4af4=['type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','includeAll','include','rows','catch','show','keys','length','merge','options','create','body','find','getConfigurations','params','findOne','Subjects','getSubjects','Descriptions','channel','SalesforceField','Task','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','email','textarea','phone','includes','label','picklistValues','value','boolean','True','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','then','destroy','name','send','map','SalesforceAccount','rawAttributes','fieldName'];(function(_0x4a116e,_0x1aa87a){var _0x479497=function(_0xc5b914){while(--_0xc5b914){_0x4a116e['push'](_0x4a116e['shift']());}};_0x479497(++_0x1aa87a);}(_0x4af4,0x1ad));var _0x44af=function(_0x2fea53,_0x2aa4c7){_0x2fea53=_0x2fea53-0x0;var _0x4d96fb=_0x4af4[_0x2fea53];return _0x4d96fb;};'use strict';var emlformat=require(_0x44af('0x0'));var rimraf=require(_0x44af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x44af('0x2'));var rp=require(_0x44af('0x3'));var moment=require(_0x44af('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x44af('0x5'));var sox=require(_0x44af('0x6'));var csv=require(_0x44af('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x44af('0x8'));var crypto=require(_0x44af('0x9'));var jsforce=require(_0x44af('0xa'));var deskjs=require(_0x44af('0xb'));var toCsv=require(_0x44af('0x7'));var querystring=require(_0x44af('0xc'));var Papa=require(_0x44af('0xd'));var Redis=require(_0x44af('0xe'));var authService=require(_0x44af('0xf'));var qs=require(_0x44af('0x10'));var as=require(_0x44af('0x11'));var hardwareService=require(_0x44af('0x12'));var logger=require(_0x44af('0x13'))(_0x44af('0x14'));var utils=require('../../config/utils');var config=require(_0x44af('0x15'));var licenseUtil=require(_0x44af('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x44af('0x17'));function respondWithStatusCode(_0x217f8d,_0x5c4aa9){_0x5c4aa9=_0x5c4aa9||0xcc;return function(_0x2dd7d4){if(_0x2dd7d4){return _0x217f8d[_0x44af('0x18')](_0x5c4aa9);}return _0x217f8d[_0x44af('0x19')](_0x5c4aa9)[_0x44af('0x1a')]();};}function respondWithResult(_0x59d594,_0x55f72a){_0x55f72a=_0x55f72a||0xc8;return function(_0x5aa8f7){if(_0x5aa8f7){return _0x59d594[_0x44af('0x19')](_0x55f72a)['json'](_0x5aa8f7);}};}function respondWithFilteredResult(_0x1233d0,_0x5c2739){return function(_0x42af53){if(_0x42af53){var _0x514716=typeof _0x5c2739[_0x44af('0x1b')]===_0x44af('0x1c')&&typeof _0x5c2739[_0x44af('0x1d')]===_0x44af('0x1c');var _0x1e5be2=_0x42af53[_0x44af('0x1e')];var _0x56f7cb=_0x514716?0x0:_0x5c2739[_0x44af('0x1b')];var _0x3ebec6=_0x514716?_0x42af53[_0x44af('0x1e')]:_0x5c2739['offset']+_0x5c2739[_0x44af('0x1d')];var _0x3701b6;if(_0x3ebec6>=_0x1e5be2){_0x3ebec6=_0x1e5be2;_0x3701b6=0xc8;}else{_0x3701b6=0xce;}_0x1233d0[_0x44af('0x19')](_0x3701b6);return _0x1233d0[_0x44af('0x1f')](_0x44af('0x20'),_0x56f7cb+'-'+_0x3ebec6+'/'+_0x1e5be2)[_0x44af('0x21')](_0x42af53);}return null;};}function patchUpdates(_0x3330c0){return function(_0x335489){try{jsonpatch['apply'](_0x335489,_0x3330c0,!![]);}catch(_0x1ccebb){return BPromise['reject'](_0x1ccebb);}return _0x335489[_0x44af('0x22')]();};}function saveUpdates(_0xe82729,_0x45afd6){return function(_0x54b367){if(_0x54b367){return _0x54b367['update'](_0xe82729)[_0x44af('0x23')](function(_0x39b868){return _0x39b868;});}return null;};}function removeEntity(_0x5b3d3,_0x3e5a46){return function(_0x2e8170){if(_0x2e8170){return _0x2e8170[_0x44af('0x24')]()[_0x44af('0x23')](function(){_0x5b3d3['status'](0xcc)[_0x44af('0x1a')]();});}};}function handleEntityNotFound(_0x12dd73,_0x22f4d6){return function(_0x46225d){if(!_0x46225d){_0x12dd73['sendStatus'](0x194);}return _0x46225d;};}function handleError(_0x67c05e,_0x178579){_0x178579=_0x178579||0x1f4;return function(_0x224067){logger['error'](_0x224067['stack']);if(_0x224067['name']){delete _0x224067[_0x44af('0x25')];}_0x67c05e[_0x44af('0x19')](_0x178579)[_0x44af('0x26')](_0x224067);};}exports['index']=function(_0x3d6aa1,_0x5818d4){var _0x2e87c1={},_0x68312c={},_0x3b95eb={'count':0x0,'rows':[]};var _0x56f368=_[_0x44af('0x27')](db[_0x44af('0x28')][_0x44af('0x29')],function(_0x2fd059){return{'name':_0x2fd059[_0x44af('0x2a')],'type':_0x2fd059[_0x44af('0x2b')][_0x44af('0x2c')]};});_0x68312c[_0x44af('0x2d')]=_['map'](_0x56f368,'name');_0x68312c['query']=_['keys'](_0x3d6aa1['query']);_0x68312c['filters']=_['intersection'](_0x68312c[_0x44af('0x2d')],_0x68312c[_0x44af('0x2e')]);_0x2e87c1[_0x44af('0x2f')]=_[_0x44af('0x30')](_0x68312c[_0x44af('0x2d')],qs[_0x44af('0x31')](_0x3d6aa1['query']['fields']));_0x2e87c1[_0x44af('0x2f')]=_0x2e87c1['attributes']['length']?_0x2e87c1[_0x44af('0x2f')]:_0x68312c[_0x44af('0x2d')];if(!_0x3d6aa1[_0x44af('0x2e')][_0x44af('0x32')](_0x44af('0x33'))){_0x2e87c1[_0x44af('0x1d')]=qs['limit'](_0x3d6aa1[_0x44af('0x2e')][_0x44af('0x1d')]);_0x2e87c1[_0x44af('0x1b')]=qs['offset'](_0x3d6aa1[_0x44af('0x2e')][_0x44af('0x1b')]);}_0x2e87c1[_0x44af('0x34')]=qs['sort'](_0x3d6aa1[_0x44af('0x2e')][_0x44af('0x35')]);_0x2e87c1['where']=qs[_0x44af('0x36')](_[_0x44af('0x37')](_0x3d6aa1[_0x44af('0x2e')],_0x68312c[_0x44af('0x36')]),_0x56f368);if(_0x3d6aa1['query'][_0x44af('0x38')]){_0x2e87c1[_0x44af('0x39')]=_['merge'](_0x2e87c1[_0x44af('0x39')],{'$or':_[_0x44af('0x27')](_0x56f368,function(_0x50946b){if(_0x50946b[_0x44af('0x2b')]!==_0x44af('0x3a')){var _0x1712dc={};_0x1712dc[_0x50946b[_0x44af('0x25')]]={'$like':'%'+_0x3d6aa1['query']['filter']+'%'};return _0x1712dc;}})});}_0x2e87c1=_['merge']({},_0x2e87c1,_0x3d6aa1['options']);var _0x1c8c08={'where':_0x2e87c1[_0x44af('0x39')]};return db[_0x44af('0x28')][_0x44af('0x1e')](_0x1c8c08)['then'](function(_0x52e61c){_0x3b95eb[_0x44af('0x1e')]=_0x52e61c;if(_0x3d6aa1['query'][_0x44af('0x3b')]){_0x2e87c1[_0x44af('0x3c')]=[{'all':!![]}];}return db[_0x44af('0x28')]['findAll'](_0x2e87c1);})[_0x44af('0x23')](function(_0xefb73b){_0x3b95eb[_0x44af('0x3d')]=_0xefb73b;return _0x3b95eb;})['then'](respondWithFilteredResult(_0x5818d4,_0x2e87c1))[_0x44af('0x3e')](handleError(_0x5818d4,null));};exports[_0x44af('0x3f')]=function(_0x47d4cb,_0x8ea6fe){var _0x5c3696={'raw':![],'where':{'id':_0x47d4cb['params']['id']}},_0x227138={};_0x227138[_0x44af('0x2d')]=_[_0x44af('0x40')](db[_0x44af('0x28')][_0x44af('0x29')]);_0x227138['query']=_['keys'](_0x47d4cb[_0x44af('0x2e')]);_0x227138[_0x44af('0x36')]=_[_0x44af('0x30')](_0x227138[_0x44af('0x2d')],_0x227138[_0x44af('0x2e')]);_0x5c3696[_0x44af('0x2f')]=_[_0x44af('0x30')](_0x227138[_0x44af('0x2d')],qs[_0x44af('0x31')](_0x47d4cb[_0x44af('0x2e')]['fields']));_0x5c3696[_0x44af('0x2f')]=_0x5c3696[_0x44af('0x2f')][_0x44af('0x41')]?_0x5c3696[_0x44af('0x2f')]:_0x227138[_0x44af('0x2d')];if(_0x47d4cb[_0x44af('0x2e')][_0x44af('0x3b')]){_0x5c3696['include']=[{'all':!![]}];}_0x5c3696=_[_0x44af('0x42')]({},_0x5c3696,_0x47d4cb[_0x44af('0x43')]);return db['SalesforceAccount']['find'](_0x5c3696)['then'](handleEntityNotFound(_0x8ea6fe,null))[_0x44af('0x23')](respondWithResult(_0x8ea6fe,null))['catch'](handleError(_0x8ea6fe,null));};exports[_0x44af('0x44')]=function(_0x1db336,_0x58f55a){return db[_0x44af('0x28')][_0x44af('0x44')](_0x1db336[_0x44af('0x45')],{})[_0x44af('0x23')](respondWithResult(_0x58f55a,0xc9))['catch'](handleError(_0x58f55a,null));};exports['update']=function(_0x7e524d,_0x33224d){if(_0x7e524d[_0x44af('0x45')]['id']){delete _0x7e524d[_0x44af('0x45')]['id'];}return db[_0x44af('0x28')][_0x44af('0x46')]({'where':{'id':_0x7e524d['params']['id']}})[_0x44af('0x23')](handleEntityNotFound(_0x33224d,null))['then'](saveUpdates(_0x7e524d[_0x44af('0x45')],null))['then'](respondWithResult(_0x33224d,null))['catch'](handleError(_0x33224d,null));};exports[_0x44af('0x24')]=function(_0x4924a2,_0xefa4b5){return db['SalesforceAccount']['find']({'where':{'id':_0x4924a2['params']['id']}})[_0x44af('0x23')](handleEntityNotFound(_0xefa4b5,null))['then'](removeEntity(_0xefa4b5,null))['catch'](handleError(_0xefa4b5,null));};exports[_0x44af('0x47')]=function(_0x198954,_0x18ee36,_0x1b21f5){var _0x5b6932={};var _0x4ab175={};var _0x5ec33a;var _0x1e0e85;return db['SalesforceAccount']['findOne']({'where':{'id':_0x198954[_0x44af('0x48')]['id']}})[_0x44af('0x23')](handleEntityNotFound(_0x18ee36,null))[_0x44af('0x23')](function(_0x12ca49){if(_0x12ca49){_0x5ec33a=_0x12ca49;_0x4ab175['model']=_[_0x44af('0x40')](db['SalesforceConfiguration'][_0x44af('0x29')]);_0x4ab175['query']=_[_0x44af('0x40')](_0x198954['query']);_0x4ab175[_0x44af('0x36')]=_[_0x44af('0x30')](_0x4ab175['model'],_0x4ab175[_0x44af('0x2e')]);_0x5b6932['attributes']=_[_0x44af('0x30')](_0x4ab175[_0x44af('0x2d')],qs[_0x44af('0x31')](_0x198954[_0x44af('0x2e')]['fields']));_0x5b6932[_0x44af('0x2f')]=_0x5b6932[_0x44af('0x2f')][_0x44af('0x41')]?_0x5b6932[_0x44af('0x2f')]:_0x4ab175[_0x44af('0x2d')];_0x5b6932[_0x44af('0x34')]=qs[_0x44af('0x35')](_0x198954[_0x44af('0x2e')][_0x44af('0x35')]);_0x5b6932[_0x44af('0x39')]=qs[_0x44af('0x36')](_['pick'](_0x198954[_0x44af('0x2e')],_0x4ab175[_0x44af('0x36')]));if(_0x198954[_0x44af('0x2e')]['filter']){_0x5b6932['where']=_[_0x44af('0x42')](_0x5b6932[_0x44af('0x39')],{'$or':_[_0x44af('0x27')](_0x5b6932[_0x44af('0x2f')],function(_0x43d092){var _0x35984e={};_0x35984e[_0x43d092]={'$like':'%'+_0x198954['query'][_0x44af('0x38')]+'%'};return _0x35984e;})});}_0x5b6932=_[_0x44af('0x42')]({},_0x5b6932,_0x198954[_0x44af('0x43')]);return _0x5ec33a['getConfigurations'](_0x5b6932);}})[_0x44af('0x23')](function(_0x230b76){if(_0x230b76){_0x1e0e85=_0x230b76['length'];if(!_0x198954[_0x44af('0x2e')][_0x44af('0x32')](_0x44af('0x33'))){_0x5b6932['limit']=qs[_0x44af('0x1d')](_0x198954['query'][_0x44af('0x1d')]);_0x5b6932[_0x44af('0x1b')]=qs[_0x44af('0x1b')](_0x198954[_0x44af('0x2e')][_0x44af('0x1b')]);}return _0x5ec33a[_0x44af('0x47')](_0x5b6932);}})[_0x44af('0x23')](function(_0x1f2550){if(_0x1f2550){return _0x1f2550?{'count':_0x1e0e85,'rows':_0x1f2550}:null;}})[_0x44af('0x23')](respondWithResult(_0x18ee36,null))[_0x44af('0x3e')](handleError(_0x18ee36,null));};exports['addConfiguration']=function(_0x156bc4,_0x38ef6a,_0x9e022c){if(_0x156bc4[_0x44af('0x45')]['id']){delete _0x156bc4['body']['id'];}return db[_0x44af('0x28')][_0x44af('0x49')]({'where':{'id':_0x156bc4['params']['id']}})[_0x44af('0x23')](handleEntityNotFound(_0x38ef6a,null))[_0x44af('0x23')](function(_0xf5157e){if(_0xf5157e){_0x156bc4[_0x44af('0x45')]['AccountId']=_0xf5157e['id'];_0x156bc4[_0x44af('0x45')][_0x44af('0x4a')]=integrations[_0x44af('0x4b')](_0x156bc4['body']['channel'],_0x156bc4[_0x44af('0x45')][_0x44af('0x2b')]);_0x156bc4[_0x44af('0x45')][_0x44af('0x4c')]=integrations['getDescriptions'](_0x156bc4[_0x44af('0x45')][_0x44af('0x4d')],_0x156bc4[_0x44af('0x45')][_0x44af('0x2b')]);return db['SalesforceConfiguration'][_0x44af('0x44')](_0x156bc4['body'],{'include':[{'model':db[_0x44af('0x4e')],'as':_0x44af('0x4a')},{'model':db[_0x44af('0x4e')],'as':'Descriptions'}]});}return null;})[_0x44af('0x23')](respondWithResult(_0x38ef6a,null))['catch'](handleError(_0x38ef6a,null));};exports['getFields']=function(_0x193e46,_0x3139c3,_0x32287f){var _0x39b218;var _0x583d71='';var _0x540f33=_0x44af('0x4f');return db[_0x44af('0x28')][_0x44af('0x49')]({'where':{'id':_0x193e46[_0x44af('0x48')]['id']},'attributes':['id','remoteUri',_0x44af('0x50'),_0x44af('0x51'),_0x44af('0x52'),_0x44af('0x53'),_0x44af('0x54')]})[_0x44af('0x23')](handleEntityNotFound(_0x3139c3,null))[_0x44af('0x23')](function(_0x5d5cac){if(_0x5d5cac){_0x583d71=_0x5d5cac['remoteUri'];var _0x23101d=_0x583d71[_0x44af('0x55')](-0x1);if(_0x23101d==='/'){_0x583d71=_0x583d71[_0x44af('0x56')](0x0,_0x583d71[_0x44af('0x57')](_0x23101d));}_0x39b218=new jsforce[(_0x44af('0x58'))]({'oauth2':{'loginUrl':_0x583d71,'clientId':_0x5d5cac[_0x44af('0x50')],'clientSecret':_0x5d5cac[_0x44af('0x51')]}});return _0x39b218['login'](_0x5d5cac[_0x44af('0x52')],_0x5d5cac['password'][_0x44af('0x59')](_0x5d5cac[_0x44af('0x54')]));}})['then'](function(_0x3b7d75){if(_0x3b7d75){if(!_[_0x44af('0x5a')](_0x193e46[_0x44af('0x2e')][_0x44af('0x5b')])){_0x540f33=_0x193e46[_0x44af('0x2e')][_0x44af('0x5b')];}return _0x39b218['sobject'](_0x540f33)[_0x44af('0x5c')]();}})[_0x44af('0x23')](function(_0x3775c2){var _0x24baa6=[_0x44af('0x5d'),_0x44af('0x5e'),_0x44af('0x5f'),_0x44af('0x60'),_0x44af('0x61'),'Description'];var _0x2c1c40=[_0x44af('0x62'),_0x44af('0x63'),_0x44af('0x64'),'boolean',_0x44af('0x65'),_0x44af('0x66'),_0x44af('0x67')];if(_0x3775c2){_['remove'](_0x3775c2[_0x44af('0x31')],function(_0x3393e){return _0x24baa6[_0x44af('0x68')](_0x3393e['name'])||!_0x2c1c40['includes'](_0x3393e[_0x44af('0x2b')]);});return{'count':_0x3775c2[_0x44af('0x31')]['length'],'rows':_[_0x44af('0x27')](_0x3775c2[_0x44af('0x31')],function(_0x4f8658){return{'id':_0x4f8658[_0x44af('0x25')],'name':_0x4f8658[_0x44af('0x69')],'custom':_0x4f8658['custom'],'options':_0x4f8658[_0x44af('0x6a')]['length']>0x0?_[_0x44af('0x27')](_0x4f8658['picklistValues'],function(_0x9625b9){return{'name':_0x9625b9[_0x44af('0x69')],'value':_0x9625b9[_0x44af('0x6b')]};}):_0x4f8658[_0x44af('0x2b')]==_0x44af('0x6c')?[{'name':_0x44af('0x6d'),'value':'true'},{'name':_0x44af('0x6e'),'value':_0x44af('0x6f')}]:[]};})};}})[_0x44af('0x23')](respondWithResult(_0x3139c3,null))[_0x44af('0x3e')](function(_0x56c190){var _0x41c801=_0x193e46[_0x44af('0x2e')][_0x44af('0x70')]?0x1f4:_0x56c190[_0x44af('0x71')]||0x1f4;logger['error'](_0x44af('0x72'),_0x44af('0x73'),_0x41c801,JSON[_0x44af('0x74')](_0x56c190));delete _0x56c190[_0x44af('0x25')];if(_0x41c801===0x191){_0x41c801=0x190;}_0x3139c3['status'](_0x41c801)[_0x44af('0x26')](_0x193e46[_0x44af('0x2e')][_0x44af('0x70')]?{'message':_0x44af('0x75'),'statusCode':_0x56c190[_0x44af('0x71')]}:_0x56c190);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 699b672..7c5e9b3 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 _0x0d06=['rimraf','../../config/environment','exports','define','int_salesforce_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0d06,0x94));var _0x60d0=function(_0xae282f,_0x2d9368){_0xae282f=_0xae282f-0x0;var _0x5f46d4=_0x0d06[_0xae282f];return _0x5f46d4;};'use strict';var _=require(_0x60d0('0x0'));var util=require(_0x60d0('0x1'));var logger=require(_0x60d0('0x2'))('api');var moment=require(_0x60d0('0x3'));var BPromise=require(_0x60d0('0x4'));var rp=require(_0x60d0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x60d0('0x6'));var config=require(_0x60d0('0x7'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x60d0('0x8')]=function(_0x2ffed4,_0x3ad08d){return _0x2ffed4[_0x60d0('0x9')]('SalesforceAccount',attributes,{'tableName':_0x60d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d7d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts'];(function(_0x10b5b5,_0x1f0499){var _0x4a1d46=function(_0x59b58d){while(--_0x59b58d){_0x10b5b5['push'](_0x10b5b5['shift']());}};_0x4a1d46(++_0x1f0499);}(_0x5d7d,0x134));var _0xd5d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d7d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5d7('0x0'));var util=require(_0xd5d7('0x1'));var logger=require(_0xd5d7('0x2'))(_0xd5d7('0x3'));var moment=require(_0xd5d7('0x4'));var BPromise=require(_0xd5d7('0x5'));var rp=require(_0xd5d7('0x6'));var fs=require('fs');var path=require(_0xd5d7('0x7'));var rimraf=require(_0xd5d7('0x8'));var config=require('../../config/environment');var attributes=require(_0xd5d7('0x9'));var integrations=require(_0xd5d7('0xa'));module[_0xd5d7('0xb')]=function(_0x26dc64,_0x2e13fb){return _0x26dc64[_0xd5d7('0xc')]('SalesforceAccount',attributes,{'tableName':_0xd5d7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 2eba51f..1e80029 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 _0xe640=['then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowSalesforceAccount','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x2b4cd2,_0x390e5e){var _0x30d61a=function(_0x58fe39){while(--_0x58fe39){_0x2b4cd2['push'](_0x2b4cd2['shift']());}};_0x30d61a(++_0x390e5e);}(_0xe640,0x174));var _0x0e64=function(_0x13aa83,_0x3a3558){_0x13aa83=_0x13aa83-0x0;var _0x4e6e9f=_0xe640[_0x13aa83];return _0x4e6e9f;};'use strict';var _=require(_0x0e64('0x0'));var util=require(_0x0e64('0x1'));var moment=require(_0x0e64('0x2'));var BPromise=require(_0x0e64('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e64('0x4'));var db=require(_0x0e64('0x5'))['db'];var utils=require(_0x0e64('0x6'));var logger=require(_0x0e64('0x7'))(_0x0e64('0x8'));var config=require(_0x0e64('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0e64('0xa')][_0x0e64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0467,_0x275952,_0xa94b8e){return new BPromise(function(_0x54ee32,_0x598d2e){return client[_0x0e64('0xc')](_0x1f0467,_0xa94b8e)[_0x0e64('0xd')](function(_0x3bfc14){logger['info'](_0x0e64('0xe'),_0x275952,_0x0e64('0xf'));logger[_0x0e64('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x275952,_0x0e64('0xf'),JSON['stringify'](_0x3bfc14));if(_0x3bfc14['error']){if(_0x3bfc14[_0x0e64('0x11')]['code']===0x1f4){logger[_0x0e64('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x275952,_0x3bfc14[_0x0e64('0x11')][_0x0e64('0x12')]);return _0x598d2e(_0x3bfc14[_0x0e64('0x11')][_0x0e64('0x12')]);}logger['error'](_0x0e64('0xe'),_0x275952,_0x3bfc14[_0x0e64('0x11')][_0x0e64('0x12')]);return _0x54ee32(_0x3bfc14[_0x0e64('0x11')][_0x0e64('0x12')]);}else{logger[_0x0e64('0x13')](_0x0e64('0xe'),_0x275952,_0x0e64('0xf'));_0x54ee32(_0x3bfc14[_0x0e64('0x14')][_0x0e64('0x12')]);}})[_0x0e64('0x15')](function(_0x3419e3){logger[_0x0e64('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x275952,_0x3419e3);_0x598d2e(_0x3419e3);});});}exports[_0x0e64('0x16')]=function(_0x28eeaf){var _0x18dcd4=this;return new Promise(function(_0x473f20,_0x5f12f9){return db[_0x0e64('0x17')][_0x0e64('0x18')]({'raw':_0x28eeaf[_0x0e64('0x19')]?_0x28eeaf['options'][_0x0e64('0x1a')]===undefined?!![]:![]:!![],'where':_0x28eeaf[_0x0e64('0x19')]?_0x28eeaf[_0x0e64('0x19')]['where']||null:null,'attributes':_0x28eeaf['options']?_0x28eeaf['options'][_0x0e64('0x1b')]||null:null,'limit':_0x28eeaf[_0x0e64('0x19')]?_0x28eeaf['options'][_0x0e64('0x1c')]||null:null,'include':_0x28eeaf[_0x0e64('0x19')]?_0x28eeaf[_0x0e64('0x19')][_0x0e64('0x1d')]?_[_0x0e64('0x1e')](_0x28eeaf[_0x0e64('0x19')]['include'],function(_0x246d31){return{'model':db[_0x246d31[_0x0e64('0x1f')]],'as':_0x246d31['as'],'attributes':_0x246d31['attributes'],'include':_0x246d31[_0x0e64('0x1d')]?_[_0x0e64('0x1e')](_0x246d31[_0x0e64('0x1d')],function(_0x285ffc){return{'model':db[_0x285ffc[_0x0e64('0x1f')]],'as':_0x285ffc['as'],'attributes':_0x285ffc[_0x0e64('0x1b')],'include':_0x285ffc[_0x0e64('0x1d')]?_[_0x0e64('0x1e')](_0x285ffc[_0x0e64('0x1d')],function(_0x29c8b9){return{'model':db[_0x29c8b9[_0x0e64('0x1f')]],'as':_0x29c8b9['as'],'attributes':_0x29c8b9[_0x0e64('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0e64('0xd')](function(_0x4027cc){logger[_0x0e64('0x13')](_0x0e64('0x16'),_0x28eeaf);logger[_0x0e64('0x10')](_0x0e64('0x16'),_0x28eeaf,JSON[_0x0e64('0x20')](_0x4027cc));_0x473f20(_0x4027cc);})[_0x0e64('0x15')](function(_0x2dfe82){logger[_0x0e64('0x11')]('GetSalesforceAccount',_0x2dfe82[_0x0e64('0x12')],_0x28eeaf);_0x5f12f9(_0x18dcd4[_0x0e64('0x11')](0x1f4,_0x2dfe82[_0x0e64('0x12')]));});});};exports[_0x0e64('0x21')]=function(_0xf05825){var _0x979bef=this;return new Promise(function(_0x5e08d5,_0x5bf883){return db[_0x0e64('0x17')]['find']({'raw':_0xf05825[_0x0e64('0x19')]?_0xf05825[_0x0e64('0x19')][_0x0e64('0x1a')]===undefined?!![]:![]:!![],'where':_0xf05825[_0x0e64('0x19')]?_0xf05825[_0x0e64('0x19')][_0x0e64('0x22')]||null:null,'attributes':_0xf05825[_0x0e64('0x19')]?_0xf05825['options'][_0x0e64('0x1b')]||null:null,'include':_0xf05825[_0x0e64('0x19')]?_0xf05825[_0x0e64('0x19')]['include']?_['map'](_0xf05825[_0x0e64('0x19')][_0x0e64('0x1d')],function(_0x1a2e91){return{'model':db[_0x1a2e91[_0x0e64('0x1f')]],'as':_0x1a2e91['as'],'attributes':_0x1a2e91[_0x0e64('0x1b')],'include':_0x1a2e91['include']?_['map'](_0x1a2e91[_0x0e64('0x1d')],function(_0x2f710a){return{'model':db[_0x2f710a[_0x0e64('0x1f')]],'as':_0x2f710a['as'],'attributes':_0x2f710a[_0x0e64('0x1b')],'include':_0x2f710a[_0x0e64('0x1d')]?_[_0x0e64('0x1e')](_0x2f710a[_0x0e64('0x1d')],function(_0x132c84){return{'model':db[_0x132c84[_0x0e64('0x1f')]],'as':_0x132c84['as'],'attributes':_0x132c84['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e64('0xd')](function(_0x4873c1){logger['info']('ShowSalesforceAccount',_0xf05825);logger[_0x0e64('0x10')](_0x0e64('0x21'),_0xf05825,JSON['stringify'](_0x4873c1));_0x5e08d5(_0x4873c1);})[_0x0e64('0x15')](function(_0x109d97){logger[_0x0e64('0x11')](_0x0e64('0x21'),_0x109d97['message'],_0xf05825);_0x5bf883(_0x979bef[_0x0e64('0x11')](0x1f4,_0x109d97['message']));});});}; \ No newline at end of file +var _0xa5fe=['jayson/promise','client','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','where','include','map','attributes','model','then','catch','find','raw','ShowSalesforceAccount','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x399b09,_0x32e934){var _0x45d4b6=function(_0x3d15c1){while(--_0x3d15c1){_0x399b09['push'](_0x399b09['shift']());}};_0x45d4b6(++_0x32e934);}(_0xa5fe,0x163));var _0xea5f=function(_0x5e42a7,_0x3eba35){_0x5e42a7=_0x5e42a7-0x0;var _0x36d21b=_0xa5fe[_0x5e42a7];return _0x36d21b;};'use strict';var _=require(_0xea5f('0x0'));var util=require(_0xea5f('0x1'));var moment=require(_0xea5f('0x2'));var BPromise=require(_0xea5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea5f('0x4'))['db'];var utils=require(_0xea5f('0x5'));var logger=require('../../config/logger')(_0xea5f('0x6'));var config=require(_0xea5f('0x7'));var jayson=require(_0xea5f('0x8'));var client=jayson[_0xea5f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1eff65,_0x5d2dbe,_0x5c9e3f){return new BPromise(function(_0x1d2e2d,_0x5ba43b){return client['request'](_0x1eff65,_0x5c9e3f)['then'](function(_0x27dd3d){logger[_0xea5f('0xa')](_0xea5f('0xb'),_0x5d2dbe,_0xea5f('0xc'));logger[_0xea5f('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x5d2dbe,_0xea5f('0xc'),JSON[_0xea5f('0xe')](_0x27dd3d));if(_0x27dd3d[_0xea5f('0xf')]){if(_0x27dd3d[_0xea5f('0xf')][_0xea5f('0x10')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x5d2dbe,_0x27dd3d[_0xea5f('0xf')][_0xea5f('0x11')]);return _0x5ba43b(_0x27dd3d[_0xea5f('0xf')][_0xea5f('0x11')]);}logger[_0xea5f('0xf')](_0xea5f('0xb'),_0x5d2dbe,_0x27dd3d[_0xea5f('0xf')][_0xea5f('0x11')]);return _0x1d2e2d(_0x27dd3d[_0xea5f('0xf')]['message']);}else{logger['info'](_0xea5f('0xb'),_0x5d2dbe,_0xea5f('0xc'));_0x1d2e2d(_0x27dd3d[_0xea5f('0x12')][_0xea5f('0x11')]);}})['catch'](function(_0x2efb8b){logger[_0xea5f('0xf')](_0xea5f('0xb'),_0x5d2dbe,_0x2efb8b);_0x5ba43b(_0x2efb8b);});});}exports[_0xea5f('0x13')]=function(_0x5614c0){var _0x54dcad=this;return new Promise(function(_0x39f805,_0x468656){return db[_0xea5f('0x14')][_0xea5f('0x15')]({'raw':_0x5614c0[_0xea5f('0x16')]?_0x5614c0[_0xea5f('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5614c0[_0xea5f('0x16')]?_0x5614c0[_0xea5f('0x16')][_0xea5f('0x17')]||null:null,'attributes':_0x5614c0[_0xea5f('0x16')]?_0x5614c0[_0xea5f('0x16')]['attributes']||null:null,'limit':_0x5614c0[_0xea5f('0x16')]?_0x5614c0[_0xea5f('0x16')]['limit']||null:null,'include':_0x5614c0[_0xea5f('0x16')]?_0x5614c0[_0xea5f('0x16')][_0xea5f('0x18')]?_[_0xea5f('0x19')](_0x5614c0[_0xea5f('0x16')]['include'],function(_0x54b12b){return{'model':db[_0x54b12b['model']],'as':_0x54b12b['as'],'attributes':_0x54b12b[_0xea5f('0x1a')],'include':_0x54b12b[_0xea5f('0x18')]?_[_0xea5f('0x19')](_0x54b12b[_0xea5f('0x18')],function(_0x499927){return{'model':db[_0x499927[_0xea5f('0x1b')]],'as':_0x499927['as'],'attributes':_0x499927['attributes'],'include':_0x499927[_0xea5f('0x18')]?_['map'](_0x499927[_0xea5f('0x18')],function(_0x5eda75){return{'model':db[_0x5eda75[_0xea5f('0x1b')]],'as':_0x5eda75['as'],'attributes':_0x5eda75['attributes']};}):[]};}):[]};}):[]:[]})[_0xea5f('0x1c')](function(_0xbc23ec){logger[_0xea5f('0xa')](_0xea5f('0x13'),_0x5614c0);logger['debug'](_0xea5f('0x13'),_0x5614c0,JSON[_0xea5f('0xe')](_0xbc23ec));_0x39f805(_0xbc23ec);})[_0xea5f('0x1d')](function(_0xe37719){logger['error']('GetSalesforceAccount',_0xe37719[_0xea5f('0x11')],_0x5614c0);_0x468656(_0x54dcad[_0xea5f('0xf')](0x1f4,_0xe37719['message']));});});};exports['ShowSalesforceAccount']=function(_0x5bc0d2){var _0x311c39=this;return new Promise(function(_0x25eeb4,_0x37a965){return db[_0xea5f('0x14')][_0xea5f('0x1e')]({'raw':_0x5bc0d2[_0xea5f('0x16')]?_0x5bc0d2[_0xea5f('0x16')][_0xea5f('0x1f')]===undefined?!![]:![]:!![],'where':_0x5bc0d2['options']?_0x5bc0d2[_0xea5f('0x16')][_0xea5f('0x17')]||null:null,'attributes':_0x5bc0d2[_0xea5f('0x16')]?_0x5bc0d2[_0xea5f('0x16')][_0xea5f('0x1a')]||null:null,'include':_0x5bc0d2[_0xea5f('0x16')]?_0x5bc0d2[_0xea5f('0x16')][_0xea5f('0x18')]?_[_0xea5f('0x19')](_0x5bc0d2['options']['include'],function(_0x346427){return{'model':db[_0x346427['model']],'as':_0x346427['as'],'attributes':_0x346427[_0xea5f('0x1a')],'include':_0x346427[_0xea5f('0x18')]?_[_0xea5f('0x19')](_0x346427[_0xea5f('0x18')],function(_0xeb5cd){return{'model':db[_0xeb5cd[_0xea5f('0x1b')]],'as':_0xeb5cd['as'],'attributes':_0xeb5cd['attributes'],'include':_0xeb5cd[_0xea5f('0x18')]?_[_0xea5f('0x19')](_0xeb5cd[_0xea5f('0x18')],function(_0x1f6a88){return{'model':db[_0x1f6a88[_0xea5f('0x1b')]],'as':_0x1f6a88['as'],'attributes':_0x1f6a88[_0xea5f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xea5f('0x1c')](function(_0x3f4951){logger[_0xea5f('0xa')]('ShowSalesforceAccount',_0x5bc0d2);logger[_0xea5f('0xd')](_0xea5f('0x20'),_0x5bc0d2,JSON['stringify'](_0x3f4951));_0x25eeb4(_0x3f4951);})[_0xea5f('0x1d')](function(_0x107497){logger['error'](_0xea5f('0x20'),_0x107497[_0xea5f('0x11')],_0x5bc0d2);_0x37a965(_0x311c39[_0xea5f('0xf')](0x1f4,_0x107497[_0xea5f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index ae3e631..90158ed 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xdb28,0x106));var _0x8db2=function(_0x172167,_0x25ba03){_0x172167=_0x172167-0x0;var _0x562698=_0xdb28[_0x172167];return _0x562698;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x5744e1,_0x233c7d){var _0x5358ce=function(_0x312b56){while(--_0x312b56){_0x5744e1['push'](_0x5744e1['shift']());}};_0x5358ce(++_0x233c7d);}(_0xadb5,0xad));var _0x5adb=function(_0x2be62d,_0x51dba8){_0x2be62d=_0x2be62d-0x0;var _0x118e4b=_0xadb5[_0x2be62d];return _0x118e4b;};'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('./intSalesforceConfiguration.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('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 2cff18d..c6c0e92 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 _0x78bb=['Task','contact','lead','account_contact_lead','account','contact_lead','nothing','exports','STRING','ENUM'];(function(_0x2bfefa,_0x31c9d5){var _0x4a4fdc=function(_0x4ce6f8){while(--_0x4ce6f8){_0x2bfefa['push'](_0x2bfefa['shift']());}};_0x4a4fdc(++_0x31c9d5);}(_0x78bb,0x151));var _0xb78b=function(_0x32bce8,_0x54f965){_0x32bce8=_0x32bce8-0x0;var _0x38badc=_0x78bb[_0x32bce8];return _0x38badc;};'use strict';var Sequelize=require('sequelize');module[_0xb78b('0x0')]={'name':{'type':Sequelize[_0xb78b('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xb78b('0x2')](_0xb78b('0x3'),'Case'),'defaultValue':_0xb78b('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xb78b('0x4'),_0xb78b('0x5'),_0xb78b('0x6'),_0xb78b('0x7')),'defaultValue':_0xb78b('0x8')},'moduleCreate':{'type':Sequelize[_0xb78b('0x2')](_0xb78b('0x9'),_0xb78b('0x4'),_0xb78b('0x5'),'account'),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xb78b('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xb78b('0x1')]}}; \ No newline at end of file +var _0x2b39=['Case','Task','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','exports','STRING','ENUM'];(function(_0x32e2f6,_0x11e862){var _0x109fa7=function(_0x46232f){while(--_0x46232f){_0x32e2f6['push'](_0x32e2f6['shift']());}};_0x109fa7(++_0x11e862);}(_0x2b39,0x11c));var _0x92b3=function(_0x315316,_0x362653){_0x315316=_0x315316-0x0;var _0x2abab1=_0x2b39[_0x315316];return _0x2abab1;};'use strict';var Sequelize=require(_0x92b3('0x0'));module[_0x92b3('0x1')]={'name':{'type':Sequelize[_0x92b3('0x2')]},'description':{'type':Sequelize[_0x92b3('0x2')]},'ticketType':{'type':Sequelize[_0x92b3('0x3')]('Task',_0x92b3('0x4')),'defaultValue':_0x92b3('0x5')},'moduleSearch':{'type':Sequelize['ENUM'](_0x92b3('0x6'),_0x92b3('0x7'),_0x92b3('0x8'),_0x92b3('0x9'),_0x92b3('0xa')),'defaultValue':_0x92b3('0x6')},'moduleCreate':{'type':Sequelize[_0x92b3('0x3')](_0x92b3('0xb'),_0x92b3('0x7'),_0x92b3('0x8'),'account'),'defaultValue':_0x92b3('0x8')},'leadId':{'type':Sequelize[_0x92b3('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x92b3('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x92b3('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x92b3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index d586b6b..a8ef30d 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 _0xd307=['options','count','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','findOne','SalesforceField','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','map','SalesforceConfiguration','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL'];(function(_0x40c213,_0x4625f1){var _0x6e830f=function(_0x2776c0){while(--_0x2776c0){_0x40c213['push'](_0x40c213['shift']());}};_0x6e830f(++_0x4625f1);}(_0xd307,0x110));var _0x7d30=function(_0x50c422,_0x3bfac7){_0x50c422=_0x50c422-0x0;var _0x5db0e9=_0xd307[_0x50c422];return _0x5db0e9;};'use strict';var emlformat=require(_0x7d30('0x0'));var rimraf=require(_0x7d30('0x1'));var zipdir=require(_0x7d30('0x2'));var jsonpatch=require(_0x7d30('0x3'));var rp=require(_0x7d30('0x4'));var moment=require(_0x7d30('0x5'));var BPromise=require(_0x7d30('0x6'));var Mustache=require(_0x7d30('0x7'));var util=require('util');var path=require(_0x7d30('0x8'));var sox=require(_0x7d30('0x9'));var csv=require('to-csv');var ejs=require(_0x7d30('0xa'));var fs=require('fs');var fs_extra=require(_0x7d30('0xb'));var _=require(_0x7d30('0xc'));var squel=require(_0x7d30('0xd'));var crypto=require(_0x7d30('0xe'));var jsforce=require(_0x7d30('0xf'));var deskjs=require(_0x7d30('0x10'));var toCsv=require(_0x7d30('0x11'));var querystring=require('querystring');var Papa=require(_0x7d30('0x12'));var Redis=require(_0x7d30('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7d30('0x14'));var as=require(_0x7d30('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d30('0x16'));var utils=require(_0x7d30('0x17'));var config=require(_0x7d30('0x18'));var licenseUtil=require(_0x7d30('0x19'));var db=require(_0x7d30('0x1a'))['db'];function respondWithStatusCode(_0x512b76,_0x34e640){_0x34e640=_0x34e640||0xcc;return function(_0x3f3811){if(_0x3f3811){return _0x512b76['sendStatus'](_0x34e640);}return _0x512b76[_0x7d30('0x1b')](_0x34e640)[_0x7d30('0x1c')]();};}function respondWithResult(_0x502a19,_0x2a4edb){_0x2a4edb=_0x2a4edb||0xc8;return function(_0x218876){if(_0x218876){return _0x502a19[_0x7d30('0x1b')](_0x2a4edb)[_0x7d30('0x1d')](_0x218876);}};}function respondWithFilteredResult(_0x4b66b3,_0x2792a6){return function(_0x29a2e9){if(_0x29a2e9){var _0x3ad4e7=typeof _0x2792a6['offset']==='undefined'&&typeof _0x2792a6['limit']===_0x7d30('0x1e');var _0x183e1c=_0x29a2e9['count'];var _0x3417a3=_0x3ad4e7?0x0:_0x2792a6['offset'];var _0x53a1bc=_0x3ad4e7?_0x29a2e9['count']:_0x2792a6[_0x7d30('0x1f')]+_0x2792a6[_0x7d30('0x20')];var _0x23cef7;if(_0x53a1bc>=_0x183e1c){_0x53a1bc=_0x183e1c;_0x23cef7=0xc8;}else{_0x23cef7=0xce;}_0x4b66b3['status'](_0x23cef7);return _0x4b66b3[_0x7d30('0x21')](_0x7d30('0x22'),_0x3417a3+'-'+_0x53a1bc+'/'+_0x183e1c)[_0x7d30('0x1d')](_0x29a2e9);}return null;};}function patchUpdates(_0x3a5849){return function(_0x231306){try{jsonpatch[_0x7d30('0x23')](_0x231306,_0x3a5849,!![]);}catch(_0x894d1a){return BPromise[_0x7d30('0x24')](_0x894d1a);}return _0x231306['save']();};}function saveUpdates(_0x418820,_0x3f8ca2){return function(_0x174649){if(_0x174649){return _0x174649[_0x7d30('0x25')](_0x418820)[_0x7d30('0x26')](function(_0x3e2797){return _0x3e2797;});}return null;};}function removeEntity(_0x27c042,_0x2bc281){return function(_0x246e46){if(_0x246e46){return _0x246e46[_0x7d30('0x27')]()[_0x7d30('0x26')](function(){_0x27c042['status'](0xcc)[_0x7d30('0x1c')]();});}};}function handleEntityNotFound(_0x592aa0,_0x5257e6){return function(_0xf8e859){if(!_0xf8e859){_0x592aa0[_0x7d30('0x28')](0x194);}return _0xf8e859;};}function handleError(_0x422a44,_0x271c0c){_0x271c0c=_0x271c0c||0x1f4;return function(_0x1a894d){logger[_0x7d30('0x29')](_0x1a894d['stack']);if(_0x1a894d[_0x7d30('0x2a')]){delete _0x1a894d[_0x7d30('0x2a')];}_0x422a44[_0x7d30('0x1b')](_0x271c0c)[_0x7d30('0x2b')](_0x1a894d);};}exports['index']=function(_0x5a7b9f,_0x33ccb1){var _0x13e6c6={},_0x866f0c={},_0x21f0dc={'count':0x0,'rows':[]};var _0x30c4d7=_[_0x7d30('0x2c')](db[_0x7d30('0x2d')]['rawAttributes'],function(_0x10f7ab){return{'name':_0x10f7ab[_0x7d30('0x2e')],'type':_0x10f7ab['type'][_0x7d30('0x2f')]};});_0x866f0c[_0x7d30('0x30')]=_[_0x7d30('0x2c')](_0x30c4d7,'name');_0x866f0c['query']=_['keys'](_0x5a7b9f[_0x7d30('0x31')]);_0x866f0c[_0x7d30('0x32')]=_[_0x7d30('0x33')](_0x866f0c[_0x7d30('0x30')],_0x866f0c['query']);_0x13e6c6['attributes']=_[_0x7d30('0x33')](_0x866f0c[_0x7d30('0x30')],qs[_0x7d30('0x34')](_0x5a7b9f[_0x7d30('0x31')]['fields']));_0x13e6c6['attributes']=_0x13e6c6[_0x7d30('0x35')][_0x7d30('0x36')]?_0x13e6c6['attributes']:_0x866f0c[_0x7d30('0x30')];if(!_0x5a7b9f[_0x7d30('0x31')][_0x7d30('0x37')](_0x7d30('0x38'))){_0x13e6c6['limit']=qs['limit'](_0x5a7b9f['query'][_0x7d30('0x20')]);_0x13e6c6['offset']=qs[_0x7d30('0x1f')](_0x5a7b9f['query']['offset']);}_0x13e6c6[_0x7d30('0x39')]=qs[_0x7d30('0x3a')](_0x5a7b9f[_0x7d30('0x31')][_0x7d30('0x3a')]);_0x13e6c6[_0x7d30('0x3b')]=qs[_0x7d30('0x32')](_['pick'](_0x5a7b9f[_0x7d30('0x31')],_0x866f0c[_0x7d30('0x32')]),_0x30c4d7);if(_0x5a7b9f[_0x7d30('0x31')][_0x7d30('0x3c')]){_0x13e6c6[_0x7d30('0x3b')]=_[_0x7d30('0x3d')](_0x13e6c6[_0x7d30('0x3b')],{'$or':_[_0x7d30('0x2c')](_0x30c4d7,function(_0x5c9dd6){if(_0x5c9dd6[_0x7d30('0x3e')]!==_0x7d30('0x3f')){var _0x57bcad={};_0x57bcad[_0x5c9dd6[_0x7d30('0x2a')]]={'$like':'%'+_0x5a7b9f[_0x7d30('0x31')][_0x7d30('0x3c')]+'%'};return _0x57bcad;}})});}_0x13e6c6=_[_0x7d30('0x3d')]({},_0x13e6c6,_0x5a7b9f[_0x7d30('0x40')]);var _0x11d3f1={'where':_0x13e6c6[_0x7d30('0x3b')]};return db[_0x7d30('0x2d')][_0x7d30('0x41')](_0x11d3f1)[_0x7d30('0x26')](function(_0x2d4694){_0x21f0dc[_0x7d30('0x41')]=_0x2d4694;if(_0x5a7b9f[_0x7d30('0x31')][_0x7d30('0x42')]){_0x13e6c6['include']=[{'all':!![]}];}return db[_0x7d30('0x2d')][_0x7d30('0x43')](_0x13e6c6);})[_0x7d30('0x26')](function(_0x5a5c5c){_0x21f0dc[_0x7d30('0x44')]=_0x5a5c5c;return _0x21f0dc;})[_0x7d30('0x26')](respondWithFilteredResult(_0x33ccb1,_0x13e6c6))[_0x7d30('0x45')](handleError(_0x33ccb1,null));};exports[_0x7d30('0x46')]=function(_0x5d6bfc,_0x30a99b){var _0x13d8a9={'raw':![],'where':{'id':_0x5d6bfc[_0x7d30('0x47')]['id']}},_0x4fefd2={};_0x4fefd2['model']=_[_0x7d30('0x48')](db[_0x7d30('0x2d')][_0x7d30('0x49')]);_0x4fefd2['query']=_[_0x7d30('0x48')](_0x5d6bfc[_0x7d30('0x31')]);_0x4fefd2['filters']=_[_0x7d30('0x33')](_0x4fefd2[_0x7d30('0x30')],_0x4fefd2[_0x7d30('0x31')]);_0x13d8a9[_0x7d30('0x35')]=_[_0x7d30('0x33')](_0x4fefd2[_0x7d30('0x30')],qs['fields'](_0x5d6bfc['query'][_0x7d30('0x34')]));_0x13d8a9[_0x7d30('0x35')]=_0x13d8a9['attributes'][_0x7d30('0x36')]?_0x13d8a9['attributes']:_0x4fefd2[_0x7d30('0x30')];if(_0x5d6bfc[_0x7d30('0x31')][_0x7d30('0x42')]){_0x13d8a9[_0x7d30('0x4a')]=[{'all':!![]}];}_0x13d8a9=_[_0x7d30('0x3d')]({},_0x13d8a9,_0x5d6bfc[_0x7d30('0x40')]);return db[_0x7d30('0x2d')][_0x7d30('0x4b')](_0x13d8a9)[_0x7d30('0x26')](handleEntityNotFound(_0x30a99b,null))[_0x7d30('0x26')](respondWithResult(_0x30a99b,null))['catch'](handleError(_0x30a99b,null));};exports[_0x7d30('0x4c')]=function(_0x422c53,_0x566e43){return db['SalesforceConfiguration'][_0x7d30('0x4c')](_0x422c53['body'],{})[_0x7d30('0x26')](respondWithResult(_0x566e43,0xc9))[_0x7d30('0x45')](handleError(_0x566e43,null));};exports[_0x7d30('0x25')]=function(_0x42acf3,_0x394213){if(_0x42acf3[_0x7d30('0x4d')]['id']){delete _0x42acf3[_0x7d30('0x4d')]['id'];}return db[_0x7d30('0x2d')]['find']({'where':{'id':_0x42acf3[_0x7d30('0x47')]['id']}})[_0x7d30('0x26')](handleEntityNotFound(_0x394213,null))['then'](saveUpdates(_0x42acf3[_0x7d30('0x4d')],null))[_0x7d30('0x26')](respondWithResult(_0x394213,null))[_0x7d30('0x45')](handleError(_0x394213,null));};exports[_0x7d30('0x27')]=function(_0x48a065,_0x4f198a){return db[_0x7d30('0x2d')][_0x7d30('0x4b')]({'where':{'id':_0x48a065[_0x7d30('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f198a,null))[_0x7d30('0x26')](removeEntity(_0x4f198a,null))[_0x7d30('0x45')](handleError(_0x4f198a,null));};exports['getFields']=function(_0x5463af,_0xabf7cd,_0x2c4363){var _0x37c805={};var _0x4cf6e4={};var _0x1197f6;var _0x1974bc;return db['SalesforceConfiguration'][_0x7d30('0x4e')]({'where':{'id':_0x5463af[_0x7d30('0x47')]['id']}})[_0x7d30('0x26')](handleEntityNotFound(_0xabf7cd,null))[_0x7d30('0x26')](function(_0x65c879){if(_0x65c879){_0x1197f6=_0x65c879;_0x4cf6e4[_0x7d30('0x30')]=_['keys'](db[_0x7d30('0x4f')]['rawAttributes']);_0x4cf6e4['query']=_[_0x7d30('0x48')](_0x5463af[_0x7d30('0x31')]);_0x4cf6e4[_0x7d30('0x32')]=_['intersection'](_0x4cf6e4['model'],_0x4cf6e4[_0x7d30('0x31')]);_0x37c805['attributes']=_[_0x7d30('0x33')](_0x4cf6e4[_0x7d30('0x30')],qs['fields'](_0x5463af[_0x7d30('0x31')]['fields']));_0x37c805['attributes']=_0x37c805[_0x7d30('0x35')][_0x7d30('0x36')]?_0x37c805['attributes']:_0x4cf6e4['model'];_0x37c805['order']=qs[_0x7d30('0x3a')](_0x5463af[_0x7d30('0x31')]['sort']);_0x37c805[_0x7d30('0x3b')]=qs[_0x7d30('0x32')](_[_0x7d30('0x50')](_0x5463af[_0x7d30('0x31')],_0x4cf6e4[_0x7d30('0x32')]));if(_0x5463af[_0x7d30('0x31')]['filter']){_0x37c805[_0x7d30('0x3b')]=_['merge'](_0x37c805[_0x7d30('0x3b')],{'$or':_[_0x7d30('0x2c')](_0x37c805[_0x7d30('0x35')],function(_0x4a8913){var _0x1388cb={};_0x1388cb[_0x4a8913]={'$like':'%'+_0x5463af['query'][_0x7d30('0x3c')]+'%'};return _0x1388cb;})});}_0x37c805=_['merge']({},_0x37c805,_0x5463af[_0x7d30('0x40')]);return _0x1197f6[_0x7d30('0x51')](_0x37c805);}})['then'](function(_0x490a8f){if(_0x490a8f){_0x1974bc=_0x490a8f[_0x7d30('0x36')];if(!_0x5463af[_0x7d30('0x31')][_0x7d30('0x37')](_0x7d30('0x38'))){_0x37c805[_0x7d30('0x20')]=qs[_0x7d30('0x20')](_0x5463af[_0x7d30('0x31')]['limit']);_0x37c805['offset']=qs[_0x7d30('0x1f')](_0x5463af[_0x7d30('0x31')][_0x7d30('0x1f')]);}return _0x1197f6[_0x7d30('0x51')](_0x37c805);}})[_0x7d30('0x26')](function(_0x45d79a){if(_0x45d79a){return _0x45d79a?{'count':_0x1974bc,'rows':_0x45d79a}:null;}})[_0x7d30('0x26')](respondWithResult(_0xabf7cd,null))['catch'](handleError(_0xabf7cd,null));};exports[_0x7d30('0x52')]=function(_0x47c6dc,_0x2ad4ab,_0x102190){var _0x33e06c={};var _0x2a1e12={};var _0x121731;var _0x3675c6;return db[_0x7d30('0x2d')][_0x7d30('0x4e')]({'where':{'id':_0x47c6dc[_0x7d30('0x47')]['id']}})[_0x7d30('0x26')](handleEntityNotFound(_0x2ad4ab,null))[_0x7d30('0x26')](function(_0x5c851d){if(_0x5c851d){_0x121731=_0x5c851d;_0x2a1e12[_0x7d30('0x30')]=_[_0x7d30('0x48')](db[_0x7d30('0x4f')][_0x7d30('0x49')]);_0x2a1e12[_0x7d30('0x31')]=_[_0x7d30('0x48')](_0x47c6dc['query']);_0x2a1e12[_0x7d30('0x32')]=_[_0x7d30('0x33')](_0x2a1e12['model'],_0x2a1e12[_0x7d30('0x31')]);_0x33e06c['attributes']=_[_0x7d30('0x33')](_0x2a1e12[_0x7d30('0x30')],qs['fields'](_0x47c6dc[_0x7d30('0x31')][_0x7d30('0x34')]));_0x33e06c['attributes']=_0x33e06c[_0x7d30('0x35')]['length']?_0x33e06c['attributes']:_0x2a1e12[_0x7d30('0x30')];_0x33e06c[_0x7d30('0x39')]=qs[_0x7d30('0x3a')](_0x47c6dc[_0x7d30('0x31')]['sort']);_0x33e06c[_0x7d30('0x3b')]=qs['filters'](_[_0x7d30('0x50')](_0x47c6dc[_0x7d30('0x31')],_0x2a1e12['filters']));if(_0x47c6dc[_0x7d30('0x31')]['filter']){_0x33e06c['where']=_[_0x7d30('0x3d')](_0x33e06c[_0x7d30('0x3b')],{'$or':_[_0x7d30('0x2c')](_0x33e06c[_0x7d30('0x35')],function(_0x5be960){var _0x58fff1={};_0x58fff1[_0x5be960]={'$like':'%'+_0x47c6dc[_0x7d30('0x31')][_0x7d30('0x3c')]+'%'};return _0x58fff1;})});}_0x33e06c=_[_0x7d30('0x3d')]({},_0x33e06c,_0x47c6dc[_0x7d30('0x40')]);return _0x121731[_0x7d30('0x52')](_0x33e06c);}})['then'](function(_0x1ecbfb){if(_0x1ecbfb){_0x3675c6=_0x1ecbfb[_0x7d30('0x36')];if(!_0x47c6dc[_0x7d30('0x31')]['hasOwnProperty'](_0x7d30('0x38'))){_0x33e06c[_0x7d30('0x20')]=qs[_0x7d30('0x20')](_0x47c6dc['query'][_0x7d30('0x20')]);_0x33e06c[_0x7d30('0x1f')]=qs['offset'](_0x47c6dc[_0x7d30('0x31')][_0x7d30('0x1f')]);}return _0x121731[_0x7d30('0x52')](_0x33e06c);}})[_0x7d30('0x26')](function(_0x4524a9){if(_0x4524a9){return _0x4524a9?{'count':_0x3675c6,'rows':_0x4524a9}:null;}})[_0x7d30('0x26')](respondWithResult(_0x2ad4ab,null))['catch'](handleError(_0x2ad4ab,null));};exports['getDescriptions']=function(_0x29faca,_0x498db4,_0x145b1b){var _0x36bbb1={};var _0x431426={};var _0xd104e9;var _0x4b3f31;return db[_0x7d30('0x2d')][_0x7d30('0x4e')]({'where':{'id':_0x29faca['params']['id']}})['then'](handleEntityNotFound(_0x498db4,null))['then'](function(_0x51a1e4){if(_0x51a1e4){_0xd104e9=_0x51a1e4;_0x431426['model']=_[_0x7d30('0x48')](db[_0x7d30('0x4f')][_0x7d30('0x49')]);_0x431426[_0x7d30('0x31')]=_['keys'](_0x29faca[_0x7d30('0x31')]);_0x431426[_0x7d30('0x32')]=_[_0x7d30('0x33')](_0x431426[_0x7d30('0x30')],_0x431426[_0x7d30('0x31')]);_0x36bbb1['attributes']=_[_0x7d30('0x33')](_0x431426[_0x7d30('0x30')],qs[_0x7d30('0x34')](_0x29faca[_0x7d30('0x31')][_0x7d30('0x34')]));_0x36bbb1[_0x7d30('0x35')]=_0x36bbb1[_0x7d30('0x35')][_0x7d30('0x36')]?_0x36bbb1[_0x7d30('0x35')]:_0x431426['model'];_0x36bbb1['order']=qs[_0x7d30('0x3a')](_0x29faca['query'][_0x7d30('0x3a')]);_0x36bbb1['where']=qs[_0x7d30('0x32')](_[_0x7d30('0x50')](_0x29faca[_0x7d30('0x31')],_0x431426[_0x7d30('0x32')]));if(_0x29faca[_0x7d30('0x31')][_0x7d30('0x3c')]){_0x36bbb1[_0x7d30('0x3b')]=_[_0x7d30('0x3d')](_0x36bbb1['where'],{'$or':_['map'](_0x36bbb1[_0x7d30('0x35')],function(_0x5a8640){var _0x353402={};_0x353402[_0x5a8640]={'$like':'%'+_0x29faca[_0x7d30('0x31')][_0x7d30('0x3c')]+'%'};return _0x353402;})});}_0x36bbb1=_['merge']({},_0x36bbb1,_0x29faca[_0x7d30('0x40')]);return _0xd104e9[_0x7d30('0x53')](_0x36bbb1);}})[_0x7d30('0x26')](function(_0x88e455){if(_0x88e455){_0x4b3f31=_0x88e455['length'];if(!_0x29faca[_0x7d30('0x31')][_0x7d30('0x37')](_0x7d30('0x38'))){_0x36bbb1[_0x7d30('0x20')]=qs[_0x7d30('0x20')](_0x29faca[_0x7d30('0x31')]['limit']);_0x36bbb1[_0x7d30('0x1f')]=qs[_0x7d30('0x1f')](_0x29faca[_0x7d30('0x31')][_0x7d30('0x1f')]);}return _0xd104e9['getDescriptions'](_0x36bbb1);}})['then'](function(_0x279864){if(_0x279864){return _0x279864?{'count':_0x4b3f31,'rows':_0x279864}:null;}})['then'](respondWithResult(_0x498db4,null))[_0x7d30('0x45')](handleError(_0x498db4,null));}; \ No newline at end of file +var _0x975f=['sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','keys','merge','find','create','body','params','getFields','findOne','SalesforceField','order','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../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','save','update','then','destroy','error','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x497d8c,_0x2904c9){var _0xeafed7=function(_0x3b51e8){while(--_0x3b51e8){_0x497d8c['push'](_0x497d8c['shift']());}};_0xeafed7(++_0x2904c9);}(_0x975f,0x109));var _0xf975=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0x975f[_0x256d6a];return _0x460058;};'use strict';var emlformat=require(_0xf975('0x0'));var rimraf=require(_0xf975('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf975('0x2'));var moment=require(_0xf975('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf975('0x4'));var util=require(_0xf975('0x5'));var path=require(_0xf975('0x6'));var sox=require(_0xf975('0x7'));var csv=require('to-csv');var ejs=require(_0xf975('0x8'));var fs=require('fs');var fs_extra=require(_0xf975('0x9'));var _=require(_0xf975('0xa'));var squel=require(_0xf975('0xb'));var crypto=require('crypto');var jsforce=require(_0xf975('0xc'));var deskjs=require(_0xf975('0xd'));var toCsv=require(_0xf975('0xe'));var querystring=require('querystring');var Papa=require(_0xf975('0xf'));var Redis=require(_0xf975('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf975('0x11'));var as=require(_0xf975('0x12'));var hardwareService=require(_0xf975('0x13'));var logger=require(_0xf975('0x14'))(_0xf975('0x15'));var utils=require(_0xf975('0x16'));var config=require(_0xf975('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf975('0x18'))['db'];function respondWithStatusCode(_0x34111a,_0x4c81f5){_0x4c81f5=_0x4c81f5||0xcc;return function(_0x232b61){if(_0x232b61){return _0x34111a[_0xf975('0x19')](_0x4c81f5);}return _0x34111a[_0xf975('0x1a')](_0x4c81f5)[_0xf975('0x1b')]();};}function respondWithResult(_0x32d59b,_0xcfb90a){_0xcfb90a=_0xcfb90a||0xc8;return function(_0xa84361){if(_0xa84361){return _0x32d59b['status'](_0xcfb90a)[_0xf975('0x1c')](_0xa84361);}};}function respondWithFilteredResult(_0x5e63c1,_0x511aa2){return function(_0x213df9){if(_0x213df9){var _0x168a76=typeof _0x511aa2[_0xf975('0x1d')]===_0xf975('0x1e')&&typeof _0x511aa2[_0xf975('0x1f')]===_0xf975('0x1e');var _0x2cffb6=_0x213df9['count'];var _0x4935c3=_0x168a76?0x0:_0x511aa2[_0xf975('0x1d')];var _0x3040e0=_0x168a76?_0x213df9[_0xf975('0x20')]:_0x511aa2[_0xf975('0x1d')]+_0x511aa2[_0xf975('0x1f')];var _0x1b5b00;if(_0x3040e0>=_0x2cffb6){_0x3040e0=_0x2cffb6;_0x1b5b00=0xc8;}else{_0x1b5b00=0xce;}_0x5e63c1['status'](_0x1b5b00);return _0x5e63c1[_0xf975('0x21')](_0xf975('0x22'),_0x4935c3+'-'+_0x3040e0+'/'+_0x2cffb6)[_0xf975('0x1c')](_0x213df9);}return null;};}function patchUpdates(_0x200fe1){return function(_0x4fb599){try{jsonpatch['apply'](_0x4fb599,_0x200fe1,!![]);}catch(_0x47387d){return BPromise[_0xf975('0x23')](_0x47387d);}return _0x4fb599[_0xf975('0x24')]();};}function saveUpdates(_0x21f02e,_0xa55448){return function(_0x53780d){if(_0x53780d){return _0x53780d[_0xf975('0x25')](_0x21f02e)[_0xf975('0x26')](function(_0x29f7fa){return _0x29f7fa;});}return null;};}function removeEntity(_0x28e4b4,_0x524790){return function(_0x1dfc9d){if(_0x1dfc9d){return _0x1dfc9d[_0xf975('0x27')]()[_0xf975('0x26')](function(){_0x28e4b4[_0xf975('0x1a')](0xcc)[_0xf975('0x1b')]();});}};}function handleEntityNotFound(_0x7f9aaa,_0x5aa9b9){return function(_0x3ee0f5){if(!_0x3ee0f5){_0x7f9aaa[_0xf975('0x19')](0x194);}return _0x3ee0f5;};}function handleError(_0x5bfd59,_0x5202e5){_0x5202e5=_0x5202e5||0x1f4;return function(_0x1ed733){logger[_0xf975('0x28')](_0x1ed733['stack']);if(_0x1ed733[_0xf975('0x29')]){delete _0x1ed733[_0xf975('0x29')];}_0x5bfd59[_0xf975('0x1a')](_0x5202e5)[_0xf975('0x2a')](_0x1ed733);};}exports[_0xf975('0x2b')]=function(_0x20345d,_0x3444a4){var _0x2be08b={},_0x2394de={},_0x2c16a9={'count':0x0,'rows':[]};var _0x37337c=_[_0xf975('0x2c')](db[_0xf975('0x2d')][_0xf975('0x2e')],function(_0x5bfcae){return{'name':_0x5bfcae[_0xf975('0x2f')],'type':_0x5bfcae[_0xf975('0x30')][_0xf975('0x31')]};});_0x2394de[_0xf975('0x32')]=_['map'](_0x37337c,'name');_0x2394de[_0xf975('0x33')]=_['keys'](_0x20345d[_0xf975('0x33')]);_0x2394de[_0xf975('0x34')]=_[_0xf975('0x35')](_0x2394de['model'],_0x2394de[_0xf975('0x33')]);_0x2be08b[_0xf975('0x36')]=_[_0xf975('0x35')](_0x2394de[_0xf975('0x32')],qs[_0xf975('0x37')](_0x20345d[_0xf975('0x33')][_0xf975('0x37')]));_0x2be08b[_0xf975('0x36')]=_0x2be08b[_0xf975('0x36')][_0xf975('0x38')]?_0x2be08b['attributes']:_0x2394de[_0xf975('0x32')];if(!_0x20345d[_0xf975('0x33')][_0xf975('0x39')](_0xf975('0x3a'))){_0x2be08b[_0xf975('0x1f')]=qs[_0xf975('0x1f')](_0x20345d['query'][_0xf975('0x1f')]);_0x2be08b['offset']=qs['offset'](_0x20345d['query'][_0xf975('0x1d')]);}_0x2be08b['order']=qs[_0xf975('0x3b')](_0x20345d['query'][_0xf975('0x3b')]);_0x2be08b[_0xf975('0x3c')]=qs[_0xf975('0x34')](_[_0xf975('0x3d')](_0x20345d['query'],_0x2394de['filters']),_0x37337c);if(_0x20345d[_0xf975('0x33')][_0xf975('0x3e')]){_0x2be08b[_0xf975('0x3c')]=_['merge'](_0x2be08b['where'],{'$or':_[_0xf975('0x2c')](_0x37337c,function(_0x536d12){if(_0x536d12[_0xf975('0x30')]!==_0xf975('0x3f')){var _0x1575b4={};_0x1575b4[_0x536d12[_0xf975('0x29')]]={'$like':'%'+_0x20345d[_0xf975('0x33')][_0xf975('0x3e')]+'%'};return _0x1575b4;}})});}_0x2be08b=_['merge']({},_0x2be08b,_0x20345d[_0xf975('0x40')]);var _0x317f17={'where':_0x2be08b[_0xf975('0x3c')]};return db[_0xf975('0x2d')][_0xf975('0x20')](_0x317f17)['then'](function(_0x2d713d){_0x2c16a9[_0xf975('0x20')]=_0x2d713d;if(_0x20345d['query'][_0xf975('0x41')]){_0x2be08b[_0xf975('0x42')]=[{'all':!![]}];}return db[_0xf975('0x2d')]['findAll'](_0x2be08b);})[_0xf975('0x26')](function(_0xf8ef4a){_0x2c16a9[_0xf975('0x43')]=_0xf8ef4a;return _0x2c16a9;})[_0xf975('0x26')](respondWithFilteredResult(_0x3444a4,_0x2be08b))[_0xf975('0x44')](handleError(_0x3444a4,null));};exports['show']=function(_0xb4ee52,_0x44ab46){var _0x327749={'raw':![],'where':{'id':_0xb4ee52['params']['id']}},_0x2c2bd3={};_0x2c2bd3[_0xf975('0x32')]=_[_0xf975('0x45')](db['SalesforceConfiguration'][_0xf975('0x2e')]);_0x2c2bd3[_0xf975('0x33')]=_[_0xf975('0x45')](_0xb4ee52[_0xf975('0x33')]);_0x2c2bd3[_0xf975('0x34')]=_['intersection'](_0x2c2bd3[_0xf975('0x32')],_0x2c2bd3[_0xf975('0x33')]);_0x327749[_0xf975('0x36')]=_[_0xf975('0x35')](_0x2c2bd3['model'],qs['fields'](_0xb4ee52[_0xf975('0x33')][_0xf975('0x37')]));_0x327749[_0xf975('0x36')]=_0x327749['attributes'][_0xf975('0x38')]?_0x327749[_0xf975('0x36')]:_0x2c2bd3[_0xf975('0x32')];if(_0xb4ee52[_0xf975('0x33')][_0xf975('0x41')]){_0x327749['include']=[{'all':!![]}];}_0x327749=_[_0xf975('0x46')]({},_0x327749,_0xb4ee52[_0xf975('0x40')]);return db['SalesforceConfiguration'][_0xf975('0x47')](_0x327749)['then'](handleEntityNotFound(_0x44ab46,null))['then'](respondWithResult(_0x44ab46,null))[_0xf975('0x44')](handleError(_0x44ab46,null));};exports['create']=function(_0x35107b,_0x21cd9c){return db[_0xf975('0x2d')][_0xf975('0x48')](_0x35107b[_0xf975('0x49')],{})[_0xf975('0x26')](respondWithResult(_0x21cd9c,0xc9))[_0xf975('0x44')](handleError(_0x21cd9c,null));};exports[_0xf975('0x25')]=function(_0x4a785c,_0xa8218b){if(_0x4a785c['body']['id']){delete _0x4a785c[_0xf975('0x49')]['id'];}return db[_0xf975('0x2d')][_0xf975('0x47')]({'where':{'id':_0x4a785c[_0xf975('0x4a')]['id']}})[_0xf975('0x26')](handleEntityNotFound(_0xa8218b,null))['then'](saveUpdates(_0x4a785c[_0xf975('0x49')],null))[_0xf975('0x26')](respondWithResult(_0xa8218b,null))['catch'](handleError(_0xa8218b,null));};exports[_0xf975('0x27')]=function(_0x585263,_0x212a04){return db[_0xf975('0x2d')][_0xf975('0x47')]({'where':{'id':_0x585263[_0xf975('0x4a')]['id']}})[_0xf975('0x26')](handleEntityNotFound(_0x212a04,null))['then'](removeEntity(_0x212a04,null))['catch'](handleError(_0x212a04,null));};exports[_0xf975('0x4b')]=function(_0x305eb4,_0x1f449f,_0x538566){var _0x3851fd={};var _0x2dbc80={};var _0x2f63fe;var _0x1a9669;return db[_0xf975('0x2d')][_0xf975('0x4c')]({'where':{'id':_0x305eb4[_0xf975('0x4a')]['id']}})[_0xf975('0x26')](handleEntityNotFound(_0x1f449f,null))[_0xf975('0x26')](function(_0x2f2e6d){if(_0x2f2e6d){_0x2f63fe=_0x2f2e6d;_0x2dbc80[_0xf975('0x32')]=_['keys'](db[_0xf975('0x4d')][_0xf975('0x2e')]);_0x2dbc80[_0xf975('0x33')]=_[_0xf975('0x45')](_0x305eb4[_0xf975('0x33')]);_0x2dbc80[_0xf975('0x34')]=_[_0xf975('0x35')](_0x2dbc80[_0xf975('0x32')],_0x2dbc80[_0xf975('0x33')]);_0x3851fd['attributes']=_[_0xf975('0x35')](_0x2dbc80[_0xf975('0x32')],qs[_0xf975('0x37')](_0x305eb4[_0xf975('0x33')][_0xf975('0x37')]));_0x3851fd[_0xf975('0x36')]=_0x3851fd[_0xf975('0x36')][_0xf975('0x38')]?_0x3851fd['attributes']:_0x2dbc80[_0xf975('0x32')];_0x3851fd[_0xf975('0x4e')]=qs[_0xf975('0x3b')](_0x305eb4['query'][_0xf975('0x3b')]);_0x3851fd[_0xf975('0x3c')]=qs[_0xf975('0x34')](_[_0xf975('0x3d')](_0x305eb4[_0xf975('0x33')],_0x2dbc80[_0xf975('0x34')]));if(_0x305eb4[_0xf975('0x33')][_0xf975('0x3e')]){_0x3851fd[_0xf975('0x3c')]=_[_0xf975('0x46')](_0x3851fd[_0xf975('0x3c')],{'$or':_[_0xf975('0x2c')](_0x3851fd[_0xf975('0x36')],function(_0x1f7aa2){var _0xc2c6c9={};_0xc2c6c9[_0x1f7aa2]={'$like':'%'+_0x305eb4[_0xf975('0x33')]['filter']+'%'};return _0xc2c6c9;})});}_0x3851fd=_[_0xf975('0x46')]({},_0x3851fd,_0x305eb4[_0xf975('0x40')]);return _0x2f63fe[_0xf975('0x4b')](_0x3851fd);}})[_0xf975('0x26')](function(_0x56c793){if(_0x56c793){_0x1a9669=_0x56c793['length'];if(!_0x305eb4['query'][_0xf975('0x39')](_0xf975('0x3a'))){_0x3851fd[_0xf975('0x1f')]=qs['limit'](_0x305eb4[_0xf975('0x33')]['limit']);_0x3851fd[_0xf975('0x1d')]=qs['offset'](_0x305eb4[_0xf975('0x33')][_0xf975('0x1d')]);}return _0x2f63fe[_0xf975('0x4b')](_0x3851fd);}})[_0xf975('0x26')](function(_0x474b){if(_0x474b){return _0x474b?{'count':_0x1a9669,'rows':_0x474b}:null;}})[_0xf975('0x26')](respondWithResult(_0x1f449f,null))[_0xf975('0x44')](handleError(_0x1f449f,null));};exports[_0xf975('0x4f')]=function(_0x2929cb,_0x55ae8b,_0x441b27){var _0x14691d={};var _0x50d2ce={};var _0x158410;var _0x22e0d8;return db[_0xf975('0x2d')][_0xf975('0x4c')]({'where':{'id':_0x2929cb[_0xf975('0x4a')]['id']}})[_0xf975('0x26')](handleEntityNotFound(_0x55ae8b,null))['then'](function(_0x9c377e){if(_0x9c377e){_0x158410=_0x9c377e;_0x50d2ce[_0xf975('0x32')]=_['keys'](db[_0xf975('0x4d')][_0xf975('0x2e')]);_0x50d2ce[_0xf975('0x33')]=_[_0xf975('0x45')](_0x2929cb[_0xf975('0x33')]);_0x50d2ce[_0xf975('0x34')]=_[_0xf975('0x35')](_0x50d2ce[_0xf975('0x32')],_0x50d2ce[_0xf975('0x33')]);_0x14691d['attributes']=_['intersection'](_0x50d2ce[_0xf975('0x32')],qs['fields'](_0x2929cb[_0xf975('0x33')][_0xf975('0x37')]));_0x14691d[_0xf975('0x36')]=_0x14691d[_0xf975('0x36')][_0xf975('0x38')]?_0x14691d[_0xf975('0x36')]:_0x50d2ce[_0xf975('0x32')];_0x14691d['order']=qs[_0xf975('0x3b')](_0x2929cb[_0xf975('0x33')][_0xf975('0x3b')]);_0x14691d[_0xf975('0x3c')]=qs[_0xf975('0x34')](_['pick'](_0x2929cb[_0xf975('0x33')],_0x50d2ce[_0xf975('0x34')]));if(_0x2929cb['query'][_0xf975('0x3e')]){_0x14691d[_0xf975('0x3c')]=_[_0xf975('0x46')](_0x14691d[_0xf975('0x3c')],{'$or':_[_0xf975('0x2c')](_0x14691d[_0xf975('0x36')],function(_0x1bb87f){var _0x1d655c={};_0x1d655c[_0x1bb87f]={'$like':'%'+_0x2929cb['query']['filter']+'%'};return _0x1d655c;})});}_0x14691d=_['merge']({},_0x14691d,_0x2929cb[_0xf975('0x40')]);return _0x158410[_0xf975('0x4f')](_0x14691d);}})[_0xf975('0x26')](function(_0x159e33){if(_0x159e33){_0x22e0d8=_0x159e33[_0xf975('0x38')];if(!_0x2929cb[_0xf975('0x33')]['hasOwnProperty'](_0xf975('0x3a'))){_0x14691d[_0xf975('0x1f')]=qs[_0xf975('0x1f')](_0x2929cb[_0xf975('0x33')]['limit']);_0x14691d['offset']=qs[_0xf975('0x1d')](_0x2929cb[_0xf975('0x33')][_0xf975('0x1d')]);}return _0x158410[_0xf975('0x4f')](_0x14691d);}})[_0xf975('0x26')](function(_0x152946){if(_0x152946){return _0x152946?{'count':_0x22e0d8,'rows':_0x152946}:null;}})[_0xf975('0x26')](respondWithResult(_0x55ae8b,null))[_0xf975('0x44')](handleError(_0x55ae8b,null));};exports['getDescriptions']=function(_0x11ab3a,_0x23c4a5,_0x20f453){var _0x1f1574={};var _0x4df760={};var _0x177c48;var _0x3aaa27;return db[_0xf975('0x2d')]['findOne']({'where':{'id':_0x11ab3a[_0xf975('0x4a')]['id']}})[_0xf975('0x26')](handleEntityNotFound(_0x23c4a5,null))[_0xf975('0x26')](function(_0x456d84){if(_0x456d84){_0x177c48=_0x456d84;_0x4df760[_0xf975('0x32')]=_[_0xf975('0x45')](db[_0xf975('0x4d')][_0xf975('0x2e')]);_0x4df760[_0xf975('0x33')]=_[_0xf975('0x45')](_0x11ab3a['query']);_0x4df760[_0xf975('0x34')]=_[_0xf975('0x35')](_0x4df760['model'],_0x4df760[_0xf975('0x33')]);_0x1f1574[_0xf975('0x36')]=_[_0xf975('0x35')](_0x4df760[_0xf975('0x32')],qs['fields'](_0x11ab3a[_0xf975('0x33')][_0xf975('0x37')]));_0x1f1574[_0xf975('0x36')]=_0x1f1574[_0xf975('0x36')][_0xf975('0x38')]?_0x1f1574[_0xf975('0x36')]:_0x4df760[_0xf975('0x32')];_0x1f1574[_0xf975('0x4e')]=qs[_0xf975('0x3b')](_0x11ab3a['query']['sort']);_0x1f1574[_0xf975('0x3c')]=qs[_0xf975('0x34')](_[_0xf975('0x3d')](_0x11ab3a[_0xf975('0x33')],_0x4df760[_0xf975('0x34')]));if(_0x11ab3a[_0xf975('0x33')][_0xf975('0x3e')]){_0x1f1574[_0xf975('0x3c')]=_[_0xf975('0x46')](_0x1f1574[_0xf975('0x3c')],{'$or':_['map'](_0x1f1574[_0xf975('0x36')],function(_0x29e8bb){var _0x534752={};_0x534752[_0x29e8bb]={'$like':'%'+_0x11ab3a[_0xf975('0x33')][_0xf975('0x3e')]+'%'};return _0x534752;})});}_0x1f1574=_['merge']({},_0x1f1574,_0x11ab3a['options']);return _0x177c48[_0xf975('0x50')](_0x1f1574);}})[_0xf975('0x26')](function(_0x1e1d5b){if(_0x1e1d5b){_0x3aaa27=_0x1e1d5b[_0xf975('0x38')];if(!_0x11ab3a[_0xf975('0x33')][_0xf975('0x39')](_0xf975('0x3a'))){_0x1f1574[_0xf975('0x1f')]=qs[_0xf975('0x1f')](_0x11ab3a[_0xf975('0x33')]['limit']);_0x1f1574[_0xf975('0x1d')]=qs[_0xf975('0x1d')](_0x11ab3a[_0xf975('0x33')][_0xf975('0x1d')]);}return _0x177c48[_0xf975('0x50')](_0x1f1574);}})[_0xf975('0x26')](function(_0x491743){if(_0x491743){return _0x491743?{'count':_0x3aaa27,'rows':_0x491743}:null;}})[_0xf975('0x26')](respondWithResult(_0x23c4a5,null))['catch'](handleError(_0x23c4a5,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 3b0a5d4..7fb28c4 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 _0xca2a=['path','rimraf','exports','define','int_salesforce_configurations','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x2bbd69,_0x25aa38){var _0x12b5f7=function(_0x2c4993){while(--_0x2c4993){_0x2bbd69['push'](_0x2bbd69['shift']());}};_0x12b5f7(++_0x25aa38);}(_0xca2a,0x19f));var _0xaca2=function(_0x4ee663,_0x4a1578){_0x4ee663=_0x4ee663-0x0;var _0x22370a=_0xca2a[_0x4ee663];return _0x22370a;};'use strict';var _=require(_0xaca2('0x0'));var util=require(_0xaca2('0x1'));var logger=require(_0xaca2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xaca2('0x3'));var rp=require(_0xaca2('0x4'));var fs=require('fs');var path=require(_0xaca2('0x5'));var rimraf=require(_0xaca2('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0xaca2('0x7')]=function(_0x45dcc6,_0x3846b2){return _0x45dcc6[_0xaca2('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0xaca2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6730=['moment','bluebird','request-promise','./intSalesforceConfiguration.attributes','exports','define','lodash','util','api'];(function(_0x2b4404,_0x2548e4){var _0x1397a6=function(_0x486d5a){while(--_0x486d5a){_0x2b4404['push'](_0x2b4404['shift']());}};_0x1397a6(++_0x2548e4);}(_0x6730,0x15c));var _0x0673=function(_0xe72729,_0x503951){_0xe72729=_0xe72729-0x0;var _0x3f679b=_0x6730[_0xe72729];return _0x3f679b;};'use strict';var _=require(_0x0673('0x0'));var util=require(_0x0673('0x1'));var logger=require('../../config/logger')(_0x0673('0x2'));var moment=require(_0x0673('0x3'));var BPromise=require(_0x0673('0x4'));var rp=require(_0x0673('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0673('0x6'));module[_0x0673('0x7')]=function(_0x17d7a3,_0x29cc8d){return _0x17d7a3[_0x0673('0x8')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 2fe95f5..bae1868 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 _0xa483=['error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2a3b40,_0x1c4818){var _0x558cd5=function(_0x5220d3){while(--_0x5220d3){_0x2a3b40['push'](_0x2a3b40['shift']());}};_0x558cd5(++_0x1c4818);}(_0xa483,0xe0));var _0x3a48=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa483[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3a48('0x0'));var util=require(_0x3a48('0x1'));var moment=require(_0x3a48('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a48('0x3'));var db=require(_0x3a48('0x4'))['db'];var utils=require(_0x3a48('0x5'));var logger=require(_0x3a48('0x6'))(_0x3a48('0x7'));var config=require(_0x3a48('0x8'));var jayson=require(_0x3a48('0x9'));var client=jayson[_0x3a48('0xa')][_0x3a48('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f8904,_0x1e333e,_0x253c8b){return new BPromise(function(_0x107292,_0x9038ef){return client['request'](_0x1f8904,_0x253c8b)[_0x3a48('0xc')](function(_0x14f762){logger[_0x3a48('0xd')](_0x3a48('0xe'),_0x1e333e,'request\x20sent');logger['debug'](_0x3a48('0xf'),_0x1e333e,_0x3a48('0x10'),JSON[_0x3a48('0x11')](_0x14f762));if(_0x14f762[_0x3a48('0x12')]){if(_0x14f762[_0x3a48('0x12')][_0x3a48('0x13')]===0x1f4){logger[_0x3a48('0x12')](_0x3a48('0xe'),_0x1e333e,_0x14f762[_0x3a48('0x12')][_0x3a48('0x14')]);return _0x9038ef(_0x14f762[_0x3a48('0x12')][_0x3a48('0x14')]);}logger[_0x3a48('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1e333e,_0x14f762[_0x3a48('0x12')][_0x3a48('0x14')]);return _0x107292(_0x14f762['error'][_0x3a48('0x14')]);}else{logger[_0x3a48('0xd')](_0x3a48('0xe'),_0x1e333e,_0x3a48('0x10'));_0x107292(_0x14f762['result']['message']);}})[_0x3a48('0x15')](function(_0x466135){logger[_0x3a48('0x12')](_0x3a48('0xe'),_0x1e333e,_0x466135);_0x9038ef(_0x466135);});});} \ No newline at end of file +var _0x34ab=['info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x264da6,_0x1bfff1){var _0x44e950=function(_0x5ee72a){while(--_0x5ee72a){_0x264da6['push'](_0x264da6['shift']());}};_0x44e950(++_0x1bfff1);}(_0x34ab,0x7b));var _0xb34a=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0x34ab[_0x34ad72];return _0x5c9aa8;};'use strict';var _=require('lodash');var util=require(_0xb34a('0x0'));var moment=require(_0xb34a('0x1'));var BPromise=require('bluebird');var rs=require(_0xb34a('0x2'));var fs=require('fs');var Redis=require(_0xb34a('0x3'));var db=require(_0xb34a('0x4'))['db'];var utils=require(_0xb34a('0x5'));var logger=require(_0xb34a('0x6'))(_0xb34a('0x7'));var config=require(_0xb34a('0x8'));var jayson=require(_0xb34a('0x9'));var client=jayson[_0xb34a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c6b5e,_0x357ec1,_0x511546){return new BPromise(function(_0x192fb4,_0x45f6da){return client[_0xb34a('0xb')](_0x4c6b5e,_0x511546)[_0xb34a('0xc')](function(_0x322e46){logger['info'](_0xb34a('0xd'),_0x357ec1,_0xb34a('0xe'));logger[_0xb34a('0xf')](_0xb34a('0x10'),_0x357ec1,_0xb34a('0xe'),JSON[_0xb34a('0x11')](_0x322e46));if(_0x322e46[_0xb34a('0x12')]){if(_0x322e46[_0xb34a('0x12')][_0xb34a('0x13')]===0x1f4){logger[_0xb34a('0x12')](_0xb34a('0xd'),_0x357ec1,_0x322e46[_0xb34a('0x12')][_0xb34a('0x14')]);return _0x45f6da(_0x322e46['error']['message']);}logger[_0xb34a('0x12')](_0xb34a('0xd'),_0x357ec1,_0x322e46[_0xb34a('0x12')][_0xb34a('0x14')]);return _0x192fb4(_0x322e46[_0xb34a('0x12')][_0xb34a('0x14')]);}else{logger[_0xb34a('0x15')](_0xb34a('0xd'),_0x357ec1,_0xb34a('0xe'));_0x192fb4(_0x322e46[_0xb34a('0x16')][_0xb34a('0x14')]);}})[_0xb34a('0x17')](function(_0x58903b){logger['error'](_0xb34a('0xd'),_0x357ec1,_0x58903b);_0x45f6da(_0x58903b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 56c9478..203e7d8 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 _0x6c34=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x6c34,0x11f));var _0x46c3=function(_0x166b97,_0x2a4f06){_0x166b97=_0x166b97-0x0;var _0x1d34ea=_0x6c34[_0x166b97];return _0x1d34ea;};'use strict';var multer=require(_0x46c3('0x0'));var util=require(_0x46c3('0x1'));var path=require('path');var timeout=require(_0x46c3('0x2'));var express=require(_0x46c3('0x3'));var router=express[_0x46c3('0x4')]();var fs_extra=require(_0x46c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x46c3('0x6'));var config=require(_0x46c3('0x7'));var controller=require('./intSalesforceField.controller');router[_0x46c3('0x8')]('/',auth[_0x46c3('0x9')](),controller['index']);router[_0x46c3('0x8')](_0x46c3('0xa'),auth[_0x46c3('0x9')](),controller[_0x46c3('0xb')]);router[_0x46c3('0xc')]('/',auth[_0x46c3('0x9')](),controller[_0x46c3('0xd')]);router[_0x46c3('0xe')](_0x46c3('0xa'),auth[_0x46c3('0x9')](),controller[_0x46c3('0xf')]);router['delete']('/:id',auth[_0x46c3('0x9')](),controller[_0x46c3('0x10')]);module[_0x46c3('0x11')]=router; \ No newline at end of file +var _0xb7fc=['create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','post'];(function(_0x42dc85,_0x3d2c84){var _0x3aa919=function(_0x4b7747){while(--_0x4b7747){_0x42dc85['push'](_0x42dc85['shift']());}};_0x3aa919(++_0x3d2c84);}(_0xb7fc,0xa5));var _0xcb7f=function(_0x261840,_0x16b995){_0x261840=_0x261840-0x0;var _0x4a5327=_0xb7fc[_0x261840];return _0x4a5327;};'use strict';var multer=require('multer');var util=require(_0xcb7f('0x0'));var path=require(_0xcb7f('0x1'));var timeout=require(_0xcb7f('0x2'));var express=require(_0xcb7f('0x3'));var router=express[_0xcb7f('0x4')]();var fs_extra=require(_0xcb7f('0x5'));var auth=require(_0xcb7f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0xcb7f('0x7')]('/',auth[_0xcb7f('0x8')](),controller['index']);router[_0xcb7f('0x7')](_0xcb7f('0x9'),auth[_0xcb7f('0x8')](),controller['show']);router[_0xcb7f('0xa')]('/',auth[_0xcb7f('0x8')](),controller[_0xcb7f('0xb')]);router[_0xcb7f('0xc')](_0xcb7f('0x9'),auth[_0xcb7f('0x8')](),controller[_0xcb7f('0xd')]);router['delete'](_0xcb7f('0x9'),auth['isAuthenticated'](),controller[_0xcb7f('0xe')]);module[_0xcb7f('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index b80d55d..b096fe8 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 _0x3697=['customVariable','sequelize','exports','ENUM','string','variable','keyValue','STRING'];(function(_0x319412,_0x3e5995){var _0x2d78b3=function(_0x295ed6){while(--_0x295ed6){_0x319412['push'](_0x319412['shift']());}};_0x2d78b3(++_0x3e5995);}(_0x3697,0x119));var _0x7369=function(_0x535999,_0x1a6d19){_0x535999=_0x535999-0x0;var _0x39560c=_0x3697[_0x535999];return _0x39560c;};'use strict';var Sequelize=require(_0x7369('0x0'));module[_0x7369('0x1')]={'type':{'type':Sequelize[_0x7369('0x2')](_0x7369('0x3'),_0x7369('0x4'),'customVariable',_0x7369('0x5'),'picklist'),'defaultValue':_0x7369('0x3')},'content':{'type':Sequelize[_0x7369('0x6')]},'key':{'type':Sequelize[_0x7369('0x6')]},'keyType':{'type':Sequelize[_0x7369('0x2')](_0x7369('0x3'),_0x7369('0x4'),_0x7369('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7369('0x6')]},'variableName':{'type':Sequelize[_0x7369('0x6')]}}; \ No newline at end of file +var _0x26ef=['string','variable','STRING','customVariable','exports','ENUM'];(function(_0x5d8987,_0x14d054){var _0x2997eb=function(_0x56f92a){while(--_0x56f92a){_0x5d8987['push'](_0x5d8987['shift']());}};_0x2997eb(++_0x14d054);}(_0x26ef,0xee));var _0xf26e=function(_0x10fac6,_0xccb94){_0x10fac6=_0x10fac6-0x0;var _0x4df4e9=_0x26ef[_0x10fac6];return _0x4df4e9;};'use strict';var Sequelize=require('sequelize');module[_0xf26e('0x0')]={'type':{'type':Sequelize[_0xf26e('0x1')](_0xf26e('0x2'),_0xf26e('0x3'),'customVariable','keyValue','picklist'),'defaultValue':_0xf26e('0x2')},'content':{'type':Sequelize[_0xf26e('0x4')]},'key':{'type':Sequelize[_0xf26e('0x4')]},'keyType':{'type':Sequelize[_0xf26e('0x1')](_0xf26e('0x2'),_0xf26e('0x3'),_0xf26e('0x5'))},'keyContent':{'type':Sequelize[_0xf26e('0x4')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xf26e('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 425b154..0b2b6dc 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 _0xac37=['name','send','index','map','SalesforceField','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','where','type','options','includeAll','include','findAll','show','params','length','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','error'];(function(_0x56500a,_0x5953c7){var _0x333977=function(_0x374007){while(--_0x374007){_0x56500a['push'](_0x56500a['shift']());}};_0x333977(++_0x5953c7);}(_0xac37,0x6b));var _0x7ac3=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xac37[_0x9dfc10];return _0x4f938a;};'use strict';var emlformat=require(_0x7ac3('0x0'));var rimraf=require(_0x7ac3('0x1'));var zipdir=require(_0x7ac3('0x2'));var jsonpatch=require(_0x7ac3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7ac3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7ac3('0x5'));var sox=require('sox');var csv=require(_0x7ac3('0x6'));var ejs=require(_0x7ac3('0x7'));var fs=require('fs');var fs_extra=require(_0x7ac3('0x8'));var _=require(_0x7ac3('0x9'));var squel=require(_0x7ac3('0xa'));var crypto=require(_0x7ac3('0xb'));var jsforce=require(_0x7ac3('0xc'));var deskjs=require(_0x7ac3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7ac3('0xe'));var Papa=require(_0x7ac3('0xf'));var Redis=require('ioredis');var authService=require(_0x7ac3('0x10'));var qs=require(_0x7ac3('0x11'));var as=require(_0x7ac3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7ac3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7ac3('0x14'));var db=require(_0x7ac3('0x15'))['db'];function respondWithStatusCode(_0x2af0d3,_0x57bf0a){_0x57bf0a=_0x57bf0a||0xcc;return function(_0x6976b){if(_0x6976b){return _0x2af0d3[_0x7ac3('0x16')](_0x57bf0a);}return _0x2af0d3[_0x7ac3('0x17')](_0x57bf0a)[_0x7ac3('0x18')]();};}function respondWithResult(_0x245603,_0x5418d6){_0x5418d6=_0x5418d6||0xc8;return function(_0x5cb743){if(_0x5cb743){return _0x245603[_0x7ac3('0x17')](_0x5418d6)[_0x7ac3('0x19')](_0x5cb743);}};}function respondWithFilteredResult(_0x56c40d,_0x11b4e0){return function(_0x4ddd26){if(_0x4ddd26){var _0x2a9675=typeof _0x11b4e0['offset']===_0x7ac3('0x1a')&&typeof _0x11b4e0[_0x7ac3('0x1b')]==='undefined';var _0x56dde6=_0x4ddd26[_0x7ac3('0x1c')];var _0x50c018=_0x2a9675?0x0:_0x11b4e0[_0x7ac3('0x1d')];var _0x51ed17=_0x2a9675?_0x4ddd26[_0x7ac3('0x1c')]:_0x11b4e0[_0x7ac3('0x1d')]+_0x11b4e0[_0x7ac3('0x1b')];var _0x199ef8;if(_0x51ed17>=_0x56dde6){_0x51ed17=_0x56dde6;_0x199ef8=0xc8;}else{_0x199ef8=0xce;}_0x56c40d['status'](_0x199ef8);return _0x56c40d['set'](_0x7ac3('0x1e'),_0x50c018+'-'+_0x51ed17+'/'+_0x56dde6)[_0x7ac3('0x19')](_0x4ddd26);}return null;};}function patchUpdates(_0x730405){return function(_0x397392){try{jsonpatch[_0x7ac3('0x1f')](_0x397392,_0x730405,!![]);}catch(_0x47023c){return BPromise[_0x7ac3('0x20')](_0x47023c);}return _0x397392[_0x7ac3('0x21')]();};}function saveUpdates(_0x4c790d,_0x51495){return function(_0x110767){if(_0x110767){return _0x110767['update'](_0x4c790d)[_0x7ac3('0x22')](function(_0x2f4c57){return _0x2f4c57;});}return null;};}function removeEntity(_0x7d93db,_0xeeb8aa){return function(_0x3a9c13){if(_0x3a9c13){return _0x3a9c13[_0x7ac3('0x23')]()[_0x7ac3('0x22')](function(){_0x7d93db[_0x7ac3('0x17')](0xcc)[_0x7ac3('0x18')]();});}};}function handleEntityNotFound(_0x30dcda,_0x4f3f87){return function(_0x2233c5){if(!_0x2233c5){_0x30dcda[_0x7ac3('0x16')](0x194);}return _0x2233c5;};}function handleError(_0x49cc46,_0x74c190){_0x74c190=_0x74c190||0x1f4;return function(_0x43ed8d){logger[_0x7ac3('0x24')](_0x43ed8d['stack']);if(_0x43ed8d[_0x7ac3('0x25')]){delete _0x43ed8d[_0x7ac3('0x25')];}_0x49cc46[_0x7ac3('0x17')](_0x74c190)[_0x7ac3('0x26')](_0x43ed8d);};}exports[_0x7ac3('0x27')]=function(_0x5f8ed6,_0x288600){var _0x324192={},_0x428f77={},_0x575797={'count':0x0,'rows':[]};var _0x3bd157=_[_0x7ac3('0x28')](db[_0x7ac3('0x29')][_0x7ac3('0x2a')],function(_0xa40ae9){return{'name':_0xa40ae9[_0x7ac3('0x2b')],'type':_0xa40ae9['type'][_0x7ac3('0x2c')]};});_0x428f77[_0x7ac3('0x2d')]=_['map'](_0x3bd157,_0x7ac3('0x25'));_0x428f77[_0x7ac3('0x2e')]=_[_0x7ac3('0x2f')](_0x5f8ed6['query']);_0x428f77['filters']=_['intersection'](_0x428f77['model'],_0x428f77[_0x7ac3('0x2e')]);_0x324192[_0x7ac3('0x30')]=_[_0x7ac3('0x31')](_0x428f77[_0x7ac3('0x2d')],qs['fields'](_0x5f8ed6[_0x7ac3('0x2e')][_0x7ac3('0x32')]));_0x324192[_0x7ac3('0x30')]=_0x324192[_0x7ac3('0x30')]['length']?_0x324192['attributes']:_0x428f77['model'];if(!_0x5f8ed6[_0x7ac3('0x2e')][_0x7ac3('0x33')]('nolimit')){_0x324192['limit']=qs['limit'](_0x5f8ed6[_0x7ac3('0x2e')][_0x7ac3('0x1b')]);_0x324192[_0x7ac3('0x1d')]=qs['offset'](_0x5f8ed6[_0x7ac3('0x2e')][_0x7ac3('0x1d')]);}_0x324192[_0x7ac3('0x34')]=qs[_0x7ac3('0x35')](_0x5f8ed6[_0x7ac3('0x2e')][_0x7ac3('0x35')]);_0x324192['where']=qs[_0x7ac3('0x36')](_[_0x7ac3('0x37')](_0x5f8ed6[_0x7ac3('0x2e')],_0x428f77[_0x7ac3('0x36')]),_0x3bd157);if(_0x5f8ed6['query'][_0x7ac3('0x38')]){_0x324192['where']=_[_0x7ac3('0x39')](_0x324192[_0x7ac3('0x3a')],{'$or':_['map'](_0x3bd157,function(_0x3bf296){if(_0x3bf296[_0x7ac3('0x3b')]!=='VIRTUAL'){var _0x315229={};_0x315229[_0x3bf296['name']]={'$like':'%'+_0x5f8ed6[_0x7ac3('0x2e')][_0x7ac3('0x38')]+'%'};return _0x315229;}})});}_0x324192=_[_0x7ac3('0x39')]({},_0x324192,_0x5f8ed6[_0x7ac3('0x3c')]);var _0x5aab1b={'where':_0x324192[_0x7ac3('0x3a')]};return db[_0x7ac3('0x29')]['count'](_0x5aab1b)['then'](function(_0x3788f2){_0x575797[_0x7ac3('0x1c')]=_0x3788f2;if(_0x5f8ed6[_0x7ac3('0x2e')][_0x7ac3('0x3d')]){_0x324192[_0x7ac3('0x3e')]=[{'all':!![]}];}return db[_0x7ac3('0x29')][_0x7ac3('0x3f')](_0x324192);})[_0x7ac3('0x22')](function(_0x2eaea4){_0x575797['rows']=_0x2eaea4;return _0x575797;})[_0x7ac3('0x22')](respondWithFilteredResult(_0x288600,_0x324192))['catch'](handleError(_0x288600,null));};exports[_0x7ac3('0x40')]=function(_0x5a9116,_0x2ccd4e){var _0x347ec7={'raw':!![],'where':{'id':_0x5a9116[_0x7ac3('0x41')]['id']}},_0x3cfde9={};_0x3cfde9[_0x7ac3('0x2d')]=_[_0x7ac3('0x2f')](db[_0x7ac3('0x29')][_0x7ac3('0x2a')]);_0x3cfde9[_0x7ac3('0x2e')]=_[_0x7ac3('0x2f')](_0x5a9116[_0x7ac3('0x2e')]);_0x3cfde9['filters']=_[_0x7ac3('0x31')](_0x3cfde9[_0x7ac3('0x2d')],_0x3cfde9[_0x7ac3('0x2e')]);_0x347ec7[_0x7ac3('0x30')]=_[_0x7ac3('0x31')](_0x3cfde9['model'],qs[_0x7ac3('0x32')](_0x5a9116[_0x7ac3('0x2e')][_0x7ac3('0x32')]));_0x347ec7[_0x7ac3('0x30')]=_0x347ec7[_0x7ac3('0x30')][_0x7ac3('0x42')]?_0x347ec7[_0x7ac3('0x30')]:_0x3cfde9['model'];if(_0x5a9116[_0x7ac3('0x2e')][_0x7ac3('0x3d')]){_0x347ec7[_0x7ac3('0x3e')]=[{'all':!![]}];}_0x347ec7=_[_0x7ac3('0x39')]({},_0x347ec7,_0x5a9116['options']);return db[_0x7ac3('0x29')][_0x7ac3('0x43')](_0x347ec7)['then'](handleEntityNotFound(_0x2ccd4e,null))['then'](respondWithResult(_0x2ccd4e,null))[_0x7ac3('0x44')](handleError(_0x2ccd4e,null));};exports[_0x7ac3('0x45')]=function(_0xfe7ed5,_0x12a0cf){return db[_0x7ac3('0x29')][_0x7ac3('0x45')](_0xfe7ed5[_0x7ac3('0x46')],{})[_0x7ac3('0x22')](respondWithResult(_0x12a0cf,0xc9))['catch'](handleError(_0x12a0cf,null));};exports[_0x7ac3('0x47')]=function(_0x5e79a4,_0x106873){if(_0x5e79a4[_0x7ac3('0x46')]['id']){delete _0x5e79a4['body']['id'];}return db[_0x7ac3('0x29')][_0x7ac3('0x43')]({'where':{'id':_0x5e79a4[_0x7ac3('0x41')]['id']}})[_0x7ac3('0x22')](handleEntityNotFound(_0x106873,null))[_0x7ac3('0x22')](saveUpdates(_0x5e79a4[_0x7ac3('0x46')],null))[_0x7ac3('0x22')](respondWithResult(_0x106873,null))[_0x7ac3('0x44')](handleError(_0x106873,null));};exports[_0x7ac3('0x23')]=function(_0x2d1450,_0xa92c15){return db[_0x7ac3('0x29')][_0x7ac3('0x43')]({'where':{'id':_0x2d1450[_0x7ac3('0x41')]['id']}})[_0x7ac3('0x22')](handleEntityNotFound(_0xa92c15,null))['then'](removeEntity(_0xa92c15,null))[_0x7ac3('0x44')](handleError(_0xa92c15,null));}; \ No newline at end of file +var _0x2c42=['type','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','body','params','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','update','then','destroy','error','stack','name','send','index','SalesforceField','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x501e31,_0x2c8211){var _0x145c92=function(_0x3e3543){while(--_0x3e3543){_0x501e31['push'](_0x501e31['shift']());}};_0x145c92(++_0x2c8211);}(_0x2c42,0x19e));var _0x22c4=function(_0x4e691e,_0x39c719){_0x4e691e=_0x4e691e-0x0;var _0x2d49da=_0x2c42[_0x4e691e];return _0x2d49da;};'use strict';var emlformat=require(_0x22c4('0x0'));var rimraf=require(_0x22c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x22c4('0x2'));var moment=require(_0x22c4('0x3'));var BPromise=require(_0x22c4('0x4'));var Mustache=require(_0x22c4('0x5'));var util=require(_0x22c4('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x22c4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x22c4('0x8'));var crypto=require(_0x22c4('0x9'));var jsforce=require(_0x22c4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x22c4('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x22c4('0xc'));var authService=require(_0x22c4('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x22c4('0xe'));var hardwareService=require(_0x22c4('0xf'));var logger=require(_0x22c4('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x22c4('0x11'));var licenseUtil=require(_0x22c4('0x12'));var db=require(_0x22c4('0x13'))['db'];function respondWithStatusCode(_0x57eac9,_0x4a9c1d){_0x4a9c1d=_0x4a9c1d||0xcc;return function(_0x13e1bc){if(_0x13e1bc){return _0x57eac9[_0x22c4('0x14')](_0x4a9c1d);}return _0x57eac9[_0x22c4('0x15')](_0x4a9c1d)[_0x22c4('0x16')]();};}function respondWithResult(_0x2ee9c8,_0x4f8199){_0x4f8199=_0x4f8199||0xc8;return function(_0x2dc151){if(_0x2dc151){return _0x2ee9c8['status'](_0x4f8199)[_0x22c4('0x17')](_0x2dc151);}};}function respondWithFilteredResult(_0x1be4e4,_0x2ef47e){return function(_0x22dfd7){if(_0x22dfd7){var _0x4c72d4=typeof _0x2ef47e[_0x22c4('0x18')]===_0x22c4('0x19')&&typeof _0x2ef47e[_0x22c4('0x1a')]==='undefined';var _0x3d2b00=_0x22dfd7[_0x22c4('0x1b')];var _0x26ecbf=_0x4c72d4?0x0:_0x2ef47e[_0x22c4('0x18')];var _0x523398=_0x4c72d4?_0x22dfd7[_0x22c4('0x1b')]:_0x2ef47e[_0x22c4('0x18')]+_0x2ef47e[_0x22c4('0x1a')];var _0x25b30d;if(_0x523398>=_0x3d2b00){_0x523398=_0x3d2b00;_0x25b30d=0xc8;}else{_0x25b30d=0xce;}_0x1be4e4[_0x22c4('0x15')](_0x25b30d);return _0x1be4e4['set']('Content-Range',_0x26ecbf+'-'+_0x523398+'/'+_0x3d2b00)[_0x22c4('0x17')](_0x22dfd7);}return null;};}function patchUpdates(_0x4b0122){return function(_0xddf272){try{jsonpatch['apply'](_0xddf272,_0x4b0122,!![]);}catch(_0x3a7bf0){return BPromise['reject'](_0x3a7bf0);}return _0xddf272['save']();};}function saveUpdates(_0x45823c,_0x5be82f){return function(_0x35b5d9){if(_0x35b5d9){return _0x35b5d9[_0x22c4('0x1c')](_0x45823c)[_0x22c4('0x1d')](function(_0x3a2acb){return _0x3a2acb;});}return null;};}function removeEntity(_0x2ce835,_0x5a82a3){return function(_0x406886){if(_0x406886){return _0x406886[_0x22c4('0x1e')]()['then'](function(){_0x2ce835['status'](0xcc)[_0x22c4('0x16')]();});}};}function handleEntityNotFound(_0x1a13d0,_0x2b3a96){return function(_0x261442){if(!_0x261442){_0x1a13d0[_0x22c4('0x14')](0x194);}return _0x261442;};}function handleError(_0x40ef3d,_0x3d376f){_0x3d376f=_0x3d376f||0x1f4;return function(_0x118c45){logger[_0x22c4('0x1f')](_0x118c45[_0x22c4('0x20')]);if(_0x118c45['name']){delete _0x118c45[_0x22c4('0x21')];}_0x40ef3d[_0x22c4('0x15')](_0x3d376f)[_0x22c4('0x22')](_0x118c45);};}exports[_0x22c4('0x23')]=function(_0x1be8a2,_0x34bc66){var _0x2a3b29={},_0x3e4055={},_0x1faac3={'count':0x0,'rows':[]};var _0x2ecdec=_['map'](db[_0x22c4('0x24')][_0x22c4('0x25')],function(_0x362b14){return{'name':_0x362b14[_0x22c4('0x26')],'type':_0x362b14['type'][_0x22c4('0x27')]};});_0x3e4055[_0x22c4('0x28')]=_[_0x22c4('0x29')](_0x2ecdec,'name');_0x3e4055['query']=_[_0x22c4('0x2a')](_0x1be8a2[_0x22c4('0x2b')]);_0x3e4055[_0x22c4('0x2c')]=_['intersection'](_0x3e4055[_0x22c4('0x28')],_0x3e4055[_0x22c4('0x2b')]);_0x2a3b29['attributes']=_[_0x22c4('0x2d')](_0x3e4055[_0x22c4('0x28')],qs[_0x22c4('0x2e')](_0x1be8a2[_0x22c4('0x2b')][_0x22c4('0x2e')]));_0x2a3b29[_0x22c4('0x2f')]=_0x2a3b29[_0x22c4('0x2f')][_0x22c4('0x30')]?_0x2a3b29[_0x22c4('0x2f')]:_0x3e4055['model'];if(!_0x1be8a2['query'][_0x22c4('0x31')](_0x22c4('0x32'))){_0x2a3b29[_0x22c4('0x1a')]=qs['limit'](_0x1be8a2['query'][_0x22c4('0x1a')]);_0x2a3b29[_0x22c4('0x18')]=qs[_0x22c4('0x18')](_0x1be8a2['query'][_0x22c4('0x18')]);}_0x2a3b29['order']=qs[_0x22c4('0x33')](_0x1be8a2[_0x22c4('0x2b')][_0x22c4('0x33')]);_0x2a3b29[_0x22c4('0x34')]=qs[_0x22c4('0x2c')](_['pick'](_0x1be8a2[_0x22c4('0x2b')],_0x3e4055[_0x22c4('0x2c')]),_0x2ecdec);if(_0x1be8a2[_0x22c4('0x2b')][_0x22c4('0x35')]){_0x2a3b29['where']=_[_0x22c4('0x36')](_0x2a3b29[_0x22c4('0x34')],{'$or':_[_0x22c4('0x29')](_0x2ecdec,function(_0x2a7f71){if(_0x2a7f71[_0x22c4('0x37')]!==_0x22c4('0x38')){var _0x2868e3={};_0x2868e3[_0x2a7f71[_0x22c4('0x21')]]={'$like':'%'+_0x1be8a2['query'][_0x22c4('0x35')]+'%'};return _0x2868e3;}})});}_0x2a3b29=_[_0x22c4('0x36')]({},_0x2a3b29,_0x1be8a2[_0x22c4('0x39')]);var _0x1180ab={'where':_0x2a3b29[_0x22c4('0x34')]};return db['SalesforceField']['count'](_0x1180ab)[_0x22c4('0x1d')](function(_0xa2ac0b){_0x1faac3['count']=_0xa2ac0b;if(_0x1be8a2[_0x22c4('0x2b')][_0x22c4('0x3a')]){_0x2a3b29[_0x22c4('0x3b')]=[{'all':!![]}];}return db['SalesforceField'][_0x22c4('0x3c')](_0x2a3b29);})['then'](function(_0x32cf59){_0x1faac3[_0x22c4('0x3d')]=_0x32cf59;return _0x1faac3;})['then'](respondWithFilteredResult(_0x34bc66,_0x2a3b29))['catch'](handleError(_0x34bc66,null));};exports['show']=function(_0x1b9817,_0x299022){var _0xd5a151={'raw':!![],'where':{'id':_0x1b9817['params']['id']}},_0x1cabd2={};_0x1cabd2[_0x22c4('0x28')]=_[_0x22c4('0x2a')](db[_0x22c4('0x24')][_0x22c4('0x25')]);_0x1cabd2[_0x22c4('0x2b')]=_['keys'](_0x1b9817[_0x22c4('0x2b')]);_0x1cabd2[_0x22c4('0x2c')]=_[_0x22c4('0x2d')](_0x1cabd2[_0x22c4('0x28')],_0x1cabd2['query']);_0xd5a151['attributes']=_['intersection'](_0x1cabd2[_0x22c4('0x28')],qs[_0x22c4('0x2e')](_0x1b9817[_0x22c4('0x2b')][_0x22c4('0x2e')]));_0xd5a151['attributes']=_0xd5a151[_0x22c4('0x2f')][_0x22c4('0x30')]?_0xd5a151[_0x22c4('0x2f')]:_0x1cabd2[_0x22c4('0x28')];if(_0x1b9817[_0x22c4('0x2b')][_0x22c4('0x3a')]){_0xd5a151[_0x22c4('0x3b')]=[{'all':!![]}];}_0xd5a151=_[_0x22c4('0x36')]({},_0xd5a151,_0x1b9817[_0x22c4('0x39')]);return db[_0x22c4('0x24')]['find'](_0xd5a151)[_0x22c4('0x1d')](handleEntityNotFound(_0x299022,null))['then'](respondWithResult(_0x299022,null))[_0x22c4('0x3e')](handleError(_0x299022,null));};exports[_0x22c4('0x3f')]=function(_0x2d2178,_0x2aa065){return db[_0x22c4('0x24')][_0x22c4('0x3f')](_0x2d2178[_0x22c4('0x40')],{})['then'](respondWithResult(_0x2aa065,0xc9))[_0x22c4('0x3e')](handleError(_0x2aa065,null));};exports[_0x22c4('0x1c')]=function(_0x2e3cc3,_0x48e2e3){if(_0x2e3cc3['body']['id']){delete _0x2e3cc3[_0x22c4('0x40')]['id'];}return db[_0x22c4('0x24')]['find']({'where':{'id':_0x2e3cc3[_0x22c4('0x41')]['id']}})[_0x22c4('0x1d')](handleEntityNotFound(_0x48e2e3,null))['then'](saveUpdates(_0x2e3cc3[_0x22c4('0x40')],null))[_0x22c4('0x1d')](respondWithResult(_0x48e2e3,null))[_0x22c4('0x3e')](handleError(_0x48e2e3,null));};exports[_0x22c4('0x1e')]=function(_0x346515,_0x29677f){return db[_0x22c4('0x24')][_0x22c4('0x42')]({'where':{'id':_0x346515[_0x22c4('0x41')]['id']}})[_0x22c4('0x1d')](handleEntityNotFound(_0x29677f,null))[_0x22c4('0x1d')](removeEntity(_0x29677f,null))[_0x22c4('0x3e')](handleError(_0x29677f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 78d10d9..90bcbf7 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 _0xc0ce=['moment','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','lodash','util','api'];(function(_0x33df76,_0x30361b){var _0x821b91=function(_0x2eb625){while(--_0x2eb625){_0x33df76['push'](_0x33df76['shift']());}};_0x821b91(++_0x30361b);}(_0xc0ce,0x165));var _0xec0c=function(_0x24df3a,_0x18f5fc){_0x24df3a=_0x24df3a-0x0;var _0x4ea43e=_0xc0ce[_0x24df3a];return _0x4ea43e;};'use strict';var _=require(_0xec0c('0x0'));var util=require(_0xec0c('0x1'));var logger=require('../../config/logger')(_0xec0c('0x2'));var moment=require(_0xec0c('0x3'));var BPromise=require('bluebird');var rp=require(_0xec0c('0x4'));var fs=require('fs');var path=require(_0xec0c('0x5'));var rimraf=require(_0xec0c('0x6'));var config=require(_0xec0c('0x7'));var attributes=require(_0xec0c('0x8'));module[_0xec0c('0x9')]=function(_0x44e513,_0x219b87){return _0x44e513[_0xec0c('0xa')](_0xec0c('0xb'),attributes,{'tableName':_0xec0c('0xc'),'paranoid':![],'indexes':[{'name':_0xec0c('0xd'),'fields':[_0xec0c('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1790=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceField.attributes','define','idField','FieldId','lodash','util'];(function(_0x9c7e00,_0x10070f){var _0x2d60f6=function(_0x22ed7a){while(--_0x22ed7a){_0x9c7e00['push'](_0x9c7e00['shift']());}};_0x2d60f6(++_0x10070f);}(_0x1790,0xca));var _0x0179=function(_0x566b78,_0x37f419){_0x566b78=_0x566b78-0x0;var _0x503256=_0x1790[_0x566b78];return _0x503256;};'use strict';var _=require(_0x0179('0x0'));var util=require(_0x0179('0x1'));var logger=require(_0x0179('0x2'))('api');var moment=require(_0x0179('0x3'));var BPromise=require(_0x0179('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0179('0x5'));var rimraf=require(_0x0179('0x6'));var config=require(_0x0179('0x7'));var attributes=require(_0x0179('0x8'));module['exports']=function(_0x5e633f,_0x584686){return _0x5e633f[_0x0179('0x9')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x0179('0xa'),_0x0179('0xb')],'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 8de4267..6c0b1b8 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 _0x8885=['debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','SalesforceField,\x20%s,\x20%s'];(function(_0x519378,_0x6bec08){var _0x278456=function(_0x51980e){while(--_0x51980e){_0x519378['push'](_0x519378['shift']());}};_0x278456(++_0x6bec08);}(_0x8885,0x1cf));var _0x5888=function(_0x4367f7,_0x2a5fd5){_0x4367f7=_0x4367f7-0x0;var _0x5f0424=_0x8885[_0x4367f7];return _0x5f0424;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5888('0x0'));var BPromise=require('bluebird');var rs=require(_0x5888('0x1'));var fs=require('fs');var Redis=require(_0x5888('0x2'));var db=require(_0x5888('0x3'))['db'];var utils=require(_0x5888('0x4'));var logger=require('../../config/logger')(_0x5888('0x5'));var config=require(_0x5888('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5888('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1cc902,_0x1ae67a,_0x3a131d){return new BPromise(function(_0x33ef56,_0x54a785){return client[_0x5888('0x8')](_0x1cc902,_0x3a131d)[_0x5888('0x9')](function(_0x45645c){logger[_0x5888('0xa')](_0x5888('0xb'),_0x1ae67a,'request\x20sent');logger[_0x5888('0xc')](_0x5888('0xd'),_0x1ae67a,_0x5888('0xe'),JSON['stringify'](_0x45645c));if(_0x45645c[_0x5888('0xf')]){if(_0x45645c[_0x5888('0xf')]['code']===0x1f4){logger[_0x5888('0xf')](_0x5888('0xb'),_0x1ae67a,_0x45645c[_0x5888('0xf')][_0x5888('0x10')]);return _0x54a785(_0x45645c[_0x5888('0xf')]['message']);}logger[_0x5888('0xf')](_0x5888('0xb'),_0x1ae67a,_0x45645c[_0x5888('0xf')][_0x5888('0x10')]);return _0x33ef56(_0x45645c[_0x5888('0xf')][_0x5888('0x10')]);}else{logger[_0x5888('0xa')](_0x5888('0xb'),_0x1ae67a,_0x5888('0xe'));_0x33ef56(_0x45645c[_0x5888('0x11')][_0x5888('0x10')]);}})[_0x5888('0x12')](function(_0x25cbd8){logger[_0x5888('0xf')](_0x5888('0xb'),_0x1ae67a,_0x25cbd8);_0x54a785(_0x25cbd8);});});} \ No newline at end of file +var _0x2141=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4828b1,_0x5c8cf3){var _0x1fec1b=function(_0x3f2e5a){while(--_0x3f2e5a){_0x4828b1['push'](_0x4828b1['shift']());}};_0x1fec1b(++_0x5c8cf3);}(_0x2141,0x7c));var _0x1214=function(_0x486e26,_0x400d73){_0x486e26=_0x486e26-0x0;var _0x3b84a8=_0x2141[_0x486e26];return _0x3b84a8;};'use strict';var _=require(_0x1214('0x0'));var util=require(_0x1214('0x1'));var moment=require(_0x1214('0x2'));var BPromise=require('bluebird');var rs=require(_0x1214('0x3'));var fs=require('fs');var Redis=require(_0x1214('0x4'));var db=require(_0x1214('0x5'))['db'];var utils=require(_0x1214('0x6'));var logger=require(_0x1214('0x7'))(_0x1214('0x8'));var config=require(_0x1214('0x9'));var jayson=require(_0x1214('0xa'));var client=jayson['client'][_0x1214('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b0055,_0xa314f4,_0x30449b){return new BPromise(function(_0xe231b5,_0x2067e2){return client[_0x1214('0xc')](_0x1b0055,_0x30449b)[_0x1214('0xd')](function(_0x508ee6){logger['info'](_0x1214('0xe'),_0xa314f4,'request\x20sent');logger[_0x1214('0xf')](_0x1214('0x10'),_0xa314f4,_0x1214('0x11'),JSON[_0x1214('0x12')](_0x508ee6));if(_0x508ee6[_0x1214('0x13')]){if(_0x508ee6[_0x1214('0x13')][_0x1214('0x14')]===0x1f4){logger['error'](_0x1214('0xe'),_0xa314f4,_0x508ee6[_0x1214('0x13')][_0x1214('0x15')]);return _0x2067e2(_0x508ee6['error'][_0x1214('0x15')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0xa314f4,_0x508ee6[_0x1214('0x13')][_0x1214('0x15')]);return _0xe231b5(_0x508ee6[_0x1214('0x13')]['message']);}else{logger['info'](_0x1214('0xe'),_0xa314f4,'request\x20sent');_0xe231b5(_0x508ee6[_0x1214('0x16')]['message']);}})[_0x1214('0x17')](function(_0x3895ec){logger[_0x1214('0x13')](_0x1214('0xe'),_0xa314f4,_0x3895ec);_0x2067e2(_0x3895ec);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 1123227..f24253e 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 _0x2d47=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','delete','exports','multer','util','connect-timeout','express','Router','../../config/environment','get','isAuthenticated'];(function(_0x2a2836,_0xea13c4){var _0x2a5267=function(_0x1e9e9b){while(--_0x1e9e9b){_0x2a2836['push'](_0x2a2836['shift']());}};_0x2a5267(++_0xea13c4);}(_0x2d47,0x115));var _0x72d4=function(_0x11300a,_0x299176){_0x11300a=_0x11300a-0x0;var _0x85e7a=_0x2d47[_0x11300a];return _0x85e7a;};'use strict';var multer=require(_0x72d4('0x0'));var util=require(_0x72d4('0x1'));var path=require('path');var timeout=require(_0x72d4('0x2'));var express=require(_0x72d4('0x3'));var router=express[_0x72d4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x72d4('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x72d4('0x6')]('/',auth[_0x72d4('0x7')](),controller['index']);router[_0x72d4('0x6')](_0x72d4('0x8'),auth[_0x72d4('0x7')](),controller[_0x72d4('0x9')]);router[_0x72d4('0x6')](_0x72d4('0xa'),auth[_0x72d4('0x7')](),controller[_0x72d4('0xb')]);router[_0x72d4('0x6')](_0x72d4('0xc'),auth[_0x72d4('0x7')](),controller[_0x72d4('0xd')]);router[_0x72d4('0xe')]('/',auth[_0x72d4('0x7')](),controller[_0x72d4('0xf')]);router['post'](_0x72d4('0xa'),auth['isAuthenticated'](),controller[_0x72d4('0x10')]);router['put'](_0x72d4('0x8'),auth[_0x72d4('0x7')](),controller['update']);router[_0x72d4('0x11')]('/:id',auth[_0x72d4('0x7')](),controller['destroy']);module[_0x72d4('0x12')]=router; \ No newline at end of file +var _0xe9fa=['create','post','addConfiguration','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields'];(function(_0x5d1044,_0x18f656){var _0x3cd90e=function(_0x3c40be){while(--_0x3c40be){_0x5d1044['push'](_0x5d1044['shift']());}};_0x3cd90e(++_0x18f656);}(_0xe9fa,0x160));var _0xae9f=function(_0x401aee,_0x210af3){_0x401aee=_0x401aee-0x0;var _0x3511a7=_0xe9fa[_0x401aee];return _0x3511a7;};'use strict';var multer=require('multer');var util=require(_0xae9f('0x0'));var path=require(_0xae9f('0x1'));var timeout=require(_0xae9f('0x2'));var express=require(_0xae9f('0x3'));var router=express['Router']();var fs_extra=require(_0xae9f('0x4'));var auth=require(_0xae9f('0x5'));var interaction=require(_0xae9f('0x6'));var config=require('../../config/environment');var controller=require(_0xae9f('0x7'));router[_0xae9f('0x8')]('/',auth[_0xae9f('0x9')](),controller[_0xae9f('0xa')]);router[_0xae9f('0x8')](_0xae9f('0xb'),auth[_0xae9f('0x9')](),controller[_0xae9f('0xc')]);router[_0xae9f('0x8')](_0xae9f('0xd'),auth[_0xae9f('0x9')](),controller[_0xae9f('0xe')]);router[_0xae9f('0x8')]('/:id/fields',auth[_0xae9f('0x9')](),controller[_0xae9f('0xf')]);router['post']('/',auth[_0xae9f('0x9')](),controller[_0xae9f('0x10')]);router[_0xae9f('0x11')](_0xae9f('0xd'),auth[_0xae9f('0x9')](),controller[_0xae9f('0x12')]);router[_0xae9f('0x13')](_0xae9f('0xb'),auth[_0xae9f('0x9')](),controller[_0xae9f('0x14')]);router[_0xae9f('0x15')](_0xae9f('0xb'),auth[_0xae9f('0x9')](),controller[_0xae9f('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index be8f36b..2352693 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 _0x050a=['sequelize','exports','STRING','remoteUri'];(function(_0x1e3bba,_0x5cab24){var _0x3eb8da=function(_0x4c006b){while(--_0x4c006b){_0x1e3bba['push'](_0x1e3bba['shift']());}};_0x3eb8da(++_0x5cab24);}(_0x050a,0x188));var _0xa050=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x050a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa050('0x0'));module[_0xa050('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa050('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xa050('0x2')]},'email':{'type':Sequelize[_0xa050('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa050('0x3')},'serverUrl':{'type':Sequelize[_0xa050('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x94e6=['username','remoteUri','sequelize','exports','STRING'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x94e6,0x1ec));var _0x694e=function(_0x32f2f0,_0xd7ba0c){_0x32f2f0=_0x32f2f0-0x0;var _0x33bb5f=_0x94e6[_0x32f2f0];return _0x33bb5f;};'use strict';var Sequelize=require(_0x694e('0x0'));module[_0x694e('0x1')]={'name':{'type':Sequelize[_0x694e('0x2')]},'description':{'type':Sequelize[_0x694e('0x2')]},'username':{'type':Sequelize[_0x694e('0x2')],'unique':_0x694e('0x3')},'password':{'type':Sequelize[_0x694e('0x2')]},'email':{'type':Sequelize[_0x694e('0x2')]},'remoteUri':{'type':Sequelize[_0x694e('0x2')],'unique':_0x694e('0x4')},'serverUrl':{'type':Sequelize[_0x694e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 1d6112d..f3a5e11 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 _0x5b24=['activity_due','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','GET','incident?sysparm_display_value=all','result','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','remove','log','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','findAll','catch','show','params','include','options','find','create','body','getConfigurations','findOne','ServicenowConfiguration','order','filter','nolimit','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','Subjects','getFields','made_sla','hold_reason','subcategory','close_code','notify','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','parent_incident','contact_type','incident_state','problem_id','reassignment_count'];(function(_0x545dd3,_0x2a4af4){var _0x2ba373=function(_0x4efc23){while(--_0x4efc23){_0x545dd3['push'](_0x545dd3['shift']());}};_0x2ba373(++_0x2a4af4);}(_0x5b24,0xe5));var _0x45b2=function(_0x38832e,_0x2cc705){_0x38832e=_0x38832e-0x0;var _0x2be939=_0x5b24[_0x38832e];return _0x2be939;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x45b2('0x0'));var zipdir=require(_0x45b2('0x1'));var jsonpatch=require(_0x45b2('0x2'));var rp=require(_0x45b2('0x3'));var moment=require(_0x45b2('0x4'));var BPromise=require(_0x45b2('0x5'));var Mustache=require(_0x45b2('0x6'));var util=require('util');var path=require(_0x45b2('0x7'));var sox=require(_0x45b2('0x8'));var csv=require(_0x45b2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x45b2('0xa'));var _=require(_0x45b2('0xb'));var squel=require(_0x45b2('0xc'));var crypto=require(_0x45b2('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x45b2('0x9'));var querystring=require(_0x45b2('0xe'));var Papa=require(_0x45b2('0xf'));var Redis=require(_0x45b2('0x10'));var authService=require(_0x45b2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x45b2('0x12'));var hardwareService=require(_0x45b2('0x13'));var logger=require(_0x45b2('0x14'))('api');var utils=require(_0x45b2('0x15'));var config=require(_0x45b2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x45b2('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5433f4,_0x4fac07){_0x4fac07=_0x4fac07||0xcc;return function(_0x47cd35){if(_0x47cd35){return _0x5433f4['sendStatus'](_0x4fac07);}return _0x5433f4[_0x45b2('0x18')](_0x4fac07)[_0x45b2('0x19')]();};}function respondWithResult(_0xf797f1,_0x2f0d80){_0x2f0d80=_0x2f0d80||0xc8;return function(_0x20db3d){if(_0x20db3d){return _0xf797f1['status'](_0x2f0d80)['json'](_0x20db3d);}};}function respondWithFilteredResult(_0x116b14,_0x1beee6){return function(_0x150982){if(_0x150982){var _0x231b22=typeof _0x1beee6[_0x45b2('0x1a')]===_0x45b2('0x1b')&&typeof _0x1beee6[_0x45b2('0x1c')]==='undefined';var _0x134733=_0x150982[_0x45b2('0x1d')];var _0x159a37=_0x231b22?0x0:_0x1beee6['offset'];var _0x27f56f=_0x231b22?_0x150982['count']:_0x1beee6[_0x45b2('0x1a')]+_0x1beee6[_0x45b2('0x1c')];var _0x864d5e;if(_0x27f56f>=_0x134733){_0x27f56f=_0x134733;_0x864d5e=0xc8;}else{_0x864d5e=0xce;}_0x116b14['status'](_0x864d5e);return _0x116b14[_0x45b2('0x1e')](_0x45b2('0x1f'),_0x159a37+'-'+_0x27f56f+'/'+_0x134733)[_0x45b2('0x20')](_0x150982);}return null;};}function patchUpdates(_0xc722f1){return function(_0xecb8d0){try{jsonpatch[_0x45b2('0x21')](_0xecb8d0,_0xc722f1,!![]);}catch(_0x2e5085){return BPromise[_0x45b2('0x22')](_0x2e5085);}return _0xecb8d0[_0x45b2('0x23')]();};}function saveUpdates(_0x210b57,_0x2a12e0){return function(_0x4ff73f){if(_0x4ff73f){return _0x4ff73f[_0x45b2('0x24')](_0x210b57)[_0x45b2('0x25')](function(_0x4d8ceb){return _0x4d8ceb;});}return null;};}function removeEntity(_0x2ad607,_0x47b29f){return function(_0x47ce29){if(_0x47ce29){return _0x47ce29[_0x45b2('0x26')]()['then'](function(){_0x2ad607[_0x45b2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d2135,_0x500c67){return function(_0x45edff){if(!_0x45edff){_0x5d2135[_0x45b2('0x27')](0x194);}return _0x45edff;};}function handleError(_0x87a5a3,_0x2c858f){_0x2c858f=_0x2c858f||0x1f4;return function(_0x423f84){logger[_0x45b2('0x28')](_0x423f84[_0x45b2('0x29')]);if(_0x423f84[_0x45b2('0x2a')]){delete _0x423f84[_0x45b2('0x2a')];}_0x87a5a3['status'](_0x2c858f)[_0x45b2('0x2b')](_0x423f84);};}exports[_0x45b2('0x2c')]=function(_0x3d3272,_0x569bb5){var _0x3b7f76={},_0x46f03d={},_0x5e41d1={'count':0x0,'rows':[]};var _0xd59333=_[_0x45b2('0x2d')](db[_0x45b2('0x2e')][_0x45b2('0x2f')],function(_0x929bd9){return{'name':_0x929bd9[_0x45b2('0x30')],'type':_0x929bd9['type']['key']};});_0x46f03d[_0x45b2('0x31')]=_[_0x45b2('0x2d')](_0xd59333,_0x45b2('0x2a'));_0x46f03d[_0x45b2('0x32')]=_[_0x45b2('0x33')](_0x3d3272[_0x45b2('0x32')]);_0x46f03d[_0x45b2('0x34')]=_[_0x45b2('0x35')](_0x46f03d[_0x45b2('0x31')],_0x46f03d['query']);_0x3b7f76['attributes']=_['intersection'](_0x46f03d['model'],qs[_0x45b2('0x36')](_0x3d3272[_0x45b2('0x32')]['fields']));_0x3b7f76['attributes']=_0x3b7f76[_0x45b2('0x37')][_0x45b2('0x38')]?_0x3b7f76[_0x45b2('0x37')]:_0x46f03d['model'];if(!_0x3d3272['query'][_0x45b2('0x39')]('nolimit')){_0x3b7f76[_0x45b2('0x1c')]=qs[_0x45b2('0x1c')](_0x3d3272[_0x45b2('0x32')][_0x45b2('0x1c')]);_0x3b7f76['offset']=qs[_0x45b2('0x1a')](_0x3d3272[_0x45b2('0x32')][_0x45b2('0x1a')]);}_0x3b7f76['order']=qs['sort'](_0x3d3272[_0x45b2('0x32')][_0x45b2('0x3a')]);_0x3b7f76[_0x45b2('0x3b')]=qs[_0x45b2('0x34')](_[_0x45b2('0x3c')](_0x3d3272[_0x45b2('0x32')],_0x46f03d['filters']),_0xd59333);if(_0x3d3272[_0x45b2('0x32')]['filter']){_0x3b7f76[_0x45b2('0x3b')]=_[_0x45b2('0x3d')](_0x3b7f76['where'],{'$or':_[_0x45b2('0x2d')](_0xd59333,function(_0x5b1650){if(_0x5b1650[_0x45b2('0x3e')]!==_0x45b2('0x3f')){var _0x135852={};_0x135852[_0x5b1650['name']]={'$like':'%'+_0x3d3272[_0x45b2('0x32')]['filter']+'%'};return _0x135852;}})});}_0x3b7f76=_[_0x45b2('0x3d')]({},_0x3b7f76,_0x3d3272['options']);var _0x59c4a1={'where':_0x3b7f76[_0x45b2('0x3b')]};return db['ServicenowAccount'][_0x45b2('0x1d')](_0x59c4a1)[_0x45b2('0x25')](function(_0x175bfb){_0x5e41d1['count']=_0x175bfb;if(_0x3d3272[_0x45b2('0x32')]['includeAll']){_0x3b7f76['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x45b2('0x40')](_0x3b7f76);})[_0x45b2('0x25')](function(_0x221b6a){_0x5e41d1['rows']=_0x221b6a;return _0x5e41d1;})[_0x45b2('0x25')](respondWithFilteredResult(_0x569bb5,_0x3b7f76))[_0x45b2('0x41')](handleError(_0x569bb5,null));};exports[_0x45b2('0x42')]=function(_0x24ffdf,_0x59f4d4){var _0x52177a={'raw':![],'where':{'id':_0x24ffdf[_0x45b2('0x43')]['id']}},_0x18b926={};_0x18b926[_0x45b2('0x31')]=_['keys'](db[_0x45b2('0x2e')]['rawAttributes']);_0x18b926[_0x45b2('0x32')]=_[_0x45b2('0x33')](_0x24ffdf['query']);_0x18b926['filters']=_[_0x45b2('0x35')](_0x18b926[_0x45b2('0x31')],_0x18b926[_0x45b2('0x32')]);_0x52177a[_0x45b2('0x37')]=_['intersection'](_0x18b926[_0x45b2('0x31')],qs[_0x45b2('0x36')](_0x24ffdf[_0x45b2('0x32')][_0x45b2('0x36')]));_0x52177a[_0x45b2('0x37')]=_0x52177a[_0x45b2('0x37')][_0x45b2('0x38')]?_0x52177a['attributes']:_0x18b926['model'];if(_0x24ffdf[_0x45b2('0x32')]['includeAll']){_0x52177a[_0x45b2('0x44')]=[{'all':!![]}];}_0x52177a=_[_0x45b2('0x3d')]({},_0x52177a,_0x24ffdf[_0x45b2('0x45')]);return db[_0x45b2('0x2e')][_0x45b2('0x46')](_0x52177a)[_0x45b2('0x25')](handleEntityNotFound(_0x59f4d4,null))['then'](respondWithResult(_0x59f4d4,null))[_0x45b2('0x41')](handleError(_0x59f4d4,null));};exports[_0x45b2('0x47')]=function(_0xc8a853,_0x2c2b9f){return db[_0x45b2('0x2e')][_0x45b2('0x47')](_0xc8a853[_0x45b2('0x48')],{})[_0x45b2('0x25')](respondWithResult(_0x2c2b9f,0xc9))[_0x45b2('0x41')](handleError(_0x2c2b9f,null));};exports['update']=function(_0x4ed71b,_0x327b13){if(_0x4ed71b[_0x45b2('0x48')]['id']){delete _0x4ed71b[_0x45b2('0x48')]['id'];}return db[_0x45b2('0x2e')][_0x45b2('0x46')]({'where':{'id':_0x4ed71b[_0x45b2('0x43')]['id']}})['then'](handleEntityNotFound(_0x327b13,null))['then'](saveUpdates(_0x4ed71b[_0x45b2('0x48')],null))[_0x45b2('0x25')](respondWithResult(_0x327b13,null))['catch'](handleError(_0x327b13,null));};exports['destroy']=function(_0x149cf7,_0x2aed54){return db[_0x45b2('0x2e')]['find']({'where':{'id':_0x149cf7['params']['id']}})['then'](handleEntityNotFound(_0x2aed54,null))[_0x45b2('0x25')](removeEntity(_0x2aed54,null))[_0x45b2('0x41')](handleError(_0x2aed54,null));};exports[_0x45b2('0x49')]=function(_0x156cc0,_0x3c7e12,_0x113085){var _0x1d6568={};var _0x1fba08={};var _0x1847a8;var _0x1715f8;return db[_0x45b2('0x2e')][_0x45b2('0x4a')]({'where':{'id':_0x156cc0['params']['id']}})[_0x45b2('0x25')](handleEntityNotFound(_0x3c7e12,null))['then'](function(_0x10b88a){if(_0x10b88a){_0x1847a8=_0x10b88a;_0x1fba08['model']=_[_0x45b2('0x33')](db[_0x45b2('0x4b')]['rawAttributes']);_0x1fba08[_0x45b2('0x32')]=_['keys'](_0x156cc0[_0x45b2('0x32')]);_0x1fba08[_0x45b2('0x34')]=_[_0x45b2('0x35')](_0x1fba08[_0x45b2('0x31')],_0x1fba08[_0x45b2('0x32')]);_0x1d6568[_0x45b2('0x37')]=_['intersection'](_0x1fba08[_0x45b2('0x31')],qs['fields'](_0x156cc0[_0x45b2('0x32')][_0x45b2('0x36')]));_0x1d6568[_0x45b2('0x37')]=_0x1d6568['attributes']['length']?_0x1d6568[_0x45b2('0x37')]:_0x1fba08[_0x45b2('0x31')];_0x1d6568[_0x45b2('0x4c')]=qs[_0x45b2('0x3a')](_0x156cc0[_0x45b2('0x32')][_0x45b2('0x3a')]);_0x1d6568[_0x45b2('0x3b')]=qs['filters'](_[_0x45b2('0x3c')](_0x156cc0[_0x45b2('0x32')],_0x1fba08[_0x45b2('0x34')]));if(_0x156cc0['query'][_0x45b2('0x4d')]){_0x1d6568['where']=_[_0x45b2('0x3d')](_0x1d6568[_0x45b2('0x3b')],{'$or':_[_0x45b2('0x2d')](_0x1d6568[_0x45b2('0x37')],function(_0x3115fb){var _0x18c9d1={};_0x18c9d1[_0x3115fb]={'$like':'%'+_0x156cc0['query'][_0x45b2('0x4d')]+'%'};return _0x18c9d1;})});}_0x1d6568=_[_0x45b2('0x3d')]({},_0x1d6568,_0x156cc0[_0x45b2('0x45')]);return _0x1847a8[_0x45b2('0x49')](_0x1d6568);}})['then'](function(_0x45fce3){if(_0x45fce3){_0x1715f8=_0x45fce3['length'];if(!_0x156cc0[_0x45b2('0x32')][_0x45b2('0x39')](_0x45b2('0x4e'))){_0x1d6568[_0x45b2('0x1c')]=qs['limit'](_0x156cc0[_0x45b2('0x32')]['limit']);_0x1d6568[_0x45b2('0x1a')]=qs[_0x45b2('0x1a')](_0x156cc0[_0x45b2('0x32')][_0x45b2('0x1a')]);}return _0x1847a8['getConfigurations'](_0x1d6568);}})[_0x45b2('0x25')](function(_0x58df54){if(_0x58df54){return _0x58df54?{'count':_0x1715f8,'rows':_0x58df54}:null;}})[_0x45b2('0x25')](respondWithResult(_0x3c7e12,null))[_0x45b2('0x41')](handleError(_0x3c7e12,null));};exports[_0x45b2('0x4f')]=function(_0x488be7,_0x48479e,_0x13eb94){if(_0x488be7[_0x45b2('0x48')]['id']){delete _0x488be7[_0x45b2('0x48')]['id'];}return db[_0x45b2('0x2e')]['findOne']({'where':{'id':_0x488be7[_0x45b2('0x43')]['id']}})[_0x45b2('0x25')](handleEntityNotFound(_0x48479e,null))[_0x45b2('0x25')](function(_0x61bacf){if(_0x61bacf){_0x488be7[_0x45b2('0x48')]['AccountId']=_0x61bacf['id'];_0x488be7[_0x45b2('0x48')]['Subjects']=integrations[_0x45b2('0x50')](_0x488be7['body'][_0x45b2('0x51')],_0x488be7[_0x45b2('0x48')][_0x45b2('0x3e')]);_0x488be7[_0x45b2('0x48')][_0x45b2('0x52')]=integrations[_0x45b2('0x53')](_0x488be7['body'][_0x45b2('0x51')],_0x488be7[_0x45b2('0x48')][_0x45b2('0x3e')]);return db[_0x45b2('0x4b')][_0x45b2('0x47')](_0x488be7[_0x45b2('0x48')],{'include':[{'model':db[_0x45b2('0x54')],'as':_0x45b2('0x55')},{'model':db[_0x45b2('0x54')],'as':_0x45b2('0x52')}]});}return null;})[_0x45b2('0x25')](respondWithResult(_0x48479e,null))[_0x45b2('0x41')](handleError(_0x48479e,null));};exports[_0x45b2('0x56')]=function(_0x41d856,_0x22ac41,_0x45e58d){var _0x468859=[_0x45b2('0x57'),_0x45b2('0x58'),'knowledge',_0x45b2('0x59'),_0x45b2('0x5a'),_0x45b2('0x5b'),'incident_state',_0x45b2('0x5c'),_0x45b2('0x5d')];var _0x1f259e=[_0x45b2('0x5e'),_0x45b2('0x57'),_0x45b2('0x5f'),_0x45b2('0x60'),_0x45b2('0x61'),_0x45b2('0x62'),_0x45b2('0x63'),_0x45b2('0x58'),_0x45b2('0x64'),_0x45b2('0x65'),_0x45b2('0x66'),_0x45b2('0x67'),_0x45b2('0x68'),_0x45b2('0x69'),'sys_created_on','sys_domain','state','sys_created_by',_0x45b2('0x6a'),_0x45b2('0x4c'),_0x45b2('0x6b'),_0x45b2('0x6c'),_0x45b2('0x6d'),_0x45b2('0x6e'),_0x45b2('0x6f'),_0x45b2('0x70'),_0x45b2('0x71'),_0x45b2('0x72'),'priority',_0x45b2('0x73'),_0x45b2('0x74'),_0x45b2('0x75'),_0x45b2('0x76'),_0x45b2('0x77'),_0x45b2('0x78'),'group_list',_0x45b2('0x79'),_0x45b2('0x7a'),_0x45b2('0x7b'),'caller_id',_0x45b2('0x7c'),_0x45b2('0x59'),_0x45b2('0x7d'),_0x45b2('0x7e'),_0x45b2('0x5a'),_0x45b2('0x7f'),'delivery_task',_0x45b2('0x80'),_0x45b2('0x81'),_0x45b2('0x82'),_0x45b2('0x83'),_0x45b2('0x84'),'calendar_duration','notify',_0x45b2('0x85'),_0x45b2('0x86'),_0x45b2('0x87'),'follow_up',_0x45b2('0x88'),'sys_id',_0x45b2('0x89'),'reopened_by',_0x45b2('0x8a'),'urgency',_0x45b2('0x8b'),'company',_0x45b2('0x8c'),_0x45b2('0x8d'),'assigned_to',_0x45b2('0x5c'),_0x45b2('0x8e'),_0x45b2('0x8f'),'approval',_0x45b2('0x90'),_0x45b2('0x91'),_0x45b2('0x92'),'reopen_count',_0x45b2('0x93'),_0x45b2('0x94'),_0x45b2('0x95'),_0x45b2('0x96'),_0x45b2('0x97'),_0x45b2('0x5d')];var _0x31f6a4='';var _0x360fca='';var _0x231586=[];var _0x48b20f='';var _0xbbbd08='';var _0xf46a5b=[];var _0x1851cc='';var _0x4eb963='';var _0x338f28={};var _0x53606f='';return db['ServicenowAccount'][_0x45b2('0x4a')]({'where':{'id':_0x41d856[_0x45b2('0x43')]['id']},'attributes':['id',_0x45b2('0x98'),_0x45b2('0x99'),_0x45b2('0x9a'),_0x45b2('0x9b'),_0x45b2('0x9c')]})[_0x45b2('0x25')](handleEntityNotFound(_0x22ac41,null))[_0x45b2('0x25')](function(_0x5cad18){if(_0x5cad18){_0x53606f=_0x5cad18[_0x45b2('0x9b')];var _0x19118d=_0x53606f[_0x45b2('0x9d')](-0x1);if(_0x19118d==='/'){_0x53606f=_0x53606f['substring'](0x0,_0x53606f[_0x45b2('0x9e')](_0x19118d));}_0x4eb963=util['format']('%s/api/now/doc/table/schema/',_0x53606f);_0x1851cc=util[_0x45b2('0x9f')]('%s/api/now/table/',_0x53606f);_0x338f28={'user':_0x5cad18['username'],'pass':_0x5cad18[_0x45b2('0x99')]};var _0x5af6b6={'method':_0x45b2('0xa0'),'uri':_0x4eb963+_0x45b2('0xa1'),'auth':_0x338f28,'json':!![]};return rp(_0x5af6b6);}})['then'](function(_0x5a8dc7){if(_0x5a8dc7[_0x45b2('0xa2')][_0x45b2('0x38')]>0x0){_0x31f6a4=_0x5a8dc7[_0x45b2('0xa2')];}console['log']('incident\x20table\x20objects',_0x31f6a4);_0xf46a5b=[];_0x360fca=Object[_0x45b2('0xa3')]([],_0x31f6a4);_['remove'](_0x360fca,function(_0x10a80c){return!_0x468859[_0x45b2('0xa4')](_0x10a80c[_0x45b2('0x2a')]);});_0x360fca[_0x45b2('0xa5')](function(_0x27b3f2){var _0x41770c=createFieldObject(_0x1851cc,_0x338f28,_0x27b3f2[_0x45b2('0xa6')],_0x27b3f2[_0x45b2('0x2a')],_0x27b3f2[_0x45b2('0xa7')],![]);_0xf46a5b[_0x45b2('0xa8')](_0x41770c);});return Promise[_0x45b2('0xa9')](_0xf46a5b);})['then'](function(_0x1fa76f){_0x231586=_0x1fa76f;_0x48b20f=Object[_0x45b2('0xa3')]([],_0x31f6a4);console['log'](_0x45b2('0xaa'),_0x31f6a4);_[_0x45b2('0xab')](_0x48b20f,function(_0x3db913){return _0x1f259e[_0x45b2('0xa4')](_0x3db913[_0x45b2('0x2a')]);});console[_0x45b2('0xac')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x48b20f);_0xf46a5b=[];_0x48b20f[_0x45b2('0xa5')](function(_0x2a740f){var _0x1547f9=createFieldObject(_0x1851cc,_0x338f28,_0x2a740f[_0x45b2('0xa6')],_0x2a740f['name'],_0x2a740f[_0x45b2('0xa7')],!![]);_0xf46a5b['push'](_0x1547f9);});return Promise[_0x45b2('0xa9')](_0xf46a5b);})[_0x45b2('0x25')](function(_0x38439d){_0xbbbd08=_0x38439d;var _0x34e3bf=_0x231586[_0x45b2('0xad')](_0xbbbd08);return{'count':_0x34e3bf['length'],'rows':_0x34e3bf};})[_0x45b2('0x25')](respondWithResult(_0x22ac41,null))[_0x45b2('0x41')](function(_0x3c5666){console[_0x45b2('0xac')](_0x45b2('0xae')+_0x3c5666);var _0x5f5b3a=_0x41d856['query'][_0x45b2('0xaf')]?0x1f4:_0x3c5666[_0x45b2('0xb0')]||0x1f4;logger[_0x45b2('0x28')](_0x3c5666[_0x45b2('0x29')]);delete _0x3c5666[_0x45b2('0x2a')];if(_0x5f5b3a===0x191){_0x5f5b3a=0x190;}_0x22ac41[_0x45b2('0x18')](_0x5f5b3a)['send'](_0x41d856['query'][_0x45b2('0xaf')]?{'message':'Wrong\x20credentials','statusCode':_0x3c5666[_0x45b2('0xb0')]}:_0x3c5666);});};function createFieldObject(_0x2c0d1d,_0x31cba5,_0x3e1ee0,_0x509974,_0x4f4416,_0x3eaecf){return new Promise(function(_0x4dd7af,_0x50d646){var _0x560e82={'id':_0x509974,'name':_0x4f4416,'custom':_0x3eaecf};if(_0x3e1ee0===_0x45b2('0xb1')){_0x560e82['options']=[{'name':_0x45b2('0xb2'),'value':_0x45b2('0xb3')},{'name':_0x45b2('0xb4'),'value':_0x45b2('0xb5')}];_0x4dd7af(_0x560e82);}else{var _0x34904a={'method':_0x45b2('0xa0'),'uri':_0x2c0d1d+_0x45b2('0xb6')+_0x509974,'auth':_0x31cba5,'json':!![]};return rp(_0x34904a)[_0x45b2('0x25')](function(_0x230199){var _0x14d209=[];if(_0x230199[_0x45b2('0xa2')][_0x45b2('0x38')]>0x0){_0x230199['result'][_0x45b2('0xa5')](function(_0x54c442){if(_0x54c442[_0x45b2('0xb7')]===_0x45b2('0xb5')){var _0x5d131f={'name':_0x54c442['label'],'value':_0x54c442[_0x45b2('0xb8')]};_0x14d209['push'](_0x5d131f);}});}_0x560e82[_0x45b2('0x45')]=_0x14d209;if(_0x560e82['options'][_0x45b2('0x38')]>0x0){_0x4dd7af(_0x560e82);}else{if(_0x3eaecf==![]){_0x4dd7af();}else{_0x4dd7af(_0x560e82);}}});}});} \ No newline at end of file +var _0xd2c7=['AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','watch_list','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','work_notes_list','business_service','priority','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','correlation_display','delivery_task','work_start','additional_assignee_list','description','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','company','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','includes','label','push','all','log','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','concat','test','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','catch','getConfigurations','findOne','ServicenowConfiguration','addConfiguration'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0xd2c7,0x67));var _0x7d2c=function(_0x5ab84f,_0x4cdf2a){_0x5ab84f=_0x5ab84f-0x0;var _0x1531c3=_0xd2c7[_0x5ab84f];return _0x1531c3;};'use strict';var emlformat=require(_0x7d2c('0x0'));var rimraf=require(_0x7d2c('0x1'));var zipdir=require(_0x7d2c('0x2'));var jsonpatch=require(_0x7d2c('0x3'));var rp=require('request-promise');var moment=require(_0x7d2c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7d2c('0x5'));var util=require('util');var path=require(_0x7d2c('0x6'));var sox=require(_0x7d2c('0x7'));var csv=require(_0x7d2c('0x8'));var ejs=require(_0x7d2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7d2c('0xa'));var _=require('lodash');var squel=require(_0x7d2c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7d2c('0xc'));var toCsv=require(_0x7d2c('0x8'));var querystring=require('querystring');var Papa=require(_0x7d2c('0xd'));var Redis=require(_0x7d2c('0xe'));var authService=require(_0x7d2c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7d2c('0x10'));var hardwareService=require(_0x7d2c('0x11'));var logger=require(_0x7d2c('0x12'))(_0x7d2c('0x13'));var utils=require(_0x7d2c('0x14'));var config=require(_0x7d2c('0x15'));var licenseUtil=require(_0x7d2c('0x16'));var db=require(_0x7d2c('0x17'))['db'];var integrations=require(_0x7d2c('0x18'));function respondWithStatusCode(_0x1acffd,_0x1e38a9){_0x1e38a9=_0x1e38a9||0xcc;return function(_0x287a4b){if(_0x287a4b){return _0x1acffd[_0x7d2c('0x19')](_0x1e38a9);}return _0x1acffd[_0x7d2c('0x1a')](_0x1e38a9)[_0x7d2c('0x1b')]();};}function respondWithResult(_0x5cded2,_0x1206ad){_0x1206ad=_0x1206ad||0xc8;return function(_0x4f3da1){if(_0x4f3da1){return _0x5cded2[_0x7d2c('0x1a')](_0x1206ad)['json'](_0x4f3da1);}};}function respondWithFilteredResult(_0x279ce9,_0x1b6c4f){return function(_0x49d453){if(_0x49d453){var _0x2a6b87=typeof _0x1b6c4f['offset']===_0x7d2c('0x1c')&&typeof _0x1b6c4f['limit']==='undefined';var _0x3542ac=_0x49d453['count'];var _0x93c74=_0x2a6b87?0x0:_0x1b6c4f['offset'];var _0x4c3c98=_0x2a6b87?_0x49d453[_0x7d2c('0x1d')]:_0x1b6c4f['offset']+_0x1b6c4f[_0x7d2c('0x1e')];var _0x147860;if(_0x4c3c98>=_0x3542ac){_0x4c3c98=_0x3542ac;_0x147860=0xc8;}else{_0x147860=0xce;}_0x279ce9[_0x7d2c('0x1a')](_0x147860);return _0x279ce9['set'](_0x7d2c('0x1f'),_0x93c74+'-'+_0x4c3c98+'/'+_0x3542ac)[_0x7d2c('0x20')](_0x49d453);}return null;};}function patchUpdates(_0x1f9bae){return function(_0x261c94){try{jsonpatch[_0x7d2c('0x21')](_0x261c94,_0x1f9bae,!![]);}catch(_0x5490b8){return BPromise['reject'](_0x5490b8);}return _0x261c94[_0x7d2c('0x22')]();};}function saveUpdates(_0x19426d,_0x22bc10){return function(_0x5bf3e9){if(_0x5bf3e9){return _0x5bf3e9[_0x7d2c('0x23')](_0x19426d)[_0x7d2c('0x24')](function(_0x399e29){return _0x399e29;});}return null;};}function removeEntity(_0x1460de,_0x160175){return function(_0x3b01b1){if(_0x3b01b1){return _0x3b01b1[_0x7d2c('0x25')]()['then'](function(){_0x1460de[_0x7d2c('0x1a')](0xcc)[_0x7d2c('0x1b')]();});}};}function handleEntityNotFound(_0x55f954,_0x57292b){return function(_0x45d1d2){if(!_0x45d1d2){_0x55f954[_0x7d2c('0x19')](0x194);}return _0x45d1d2;};}function handleError(_0x431df4,_0xac9258){_0xac9258=_0xac9258||0x1f4;return function(_0x60d31){logger[_0x7d2c('0x26')](_0x60d31[_0x7d2c('0x27')]);if(_0x60d31[_0x7d2c('0x28')]){delete _0x60d31[_0x7d2c('0x28')];}_0x431df4[_0x7d2c('0x1a')](_0xac9258)[_0x7d2c('0x29')](_0x60d31);};}exports[_0x7d2c('0x2a')]=function(_0x4a9239,_0xcc9286){var _0x52b61c={},_0x174d3a={},_0x4dea77={'count':0x0,'rows':[]};var _0x1cbd1c=_[_0x7d2c('0x2b')](db[_0x7d2c('0x2c')]['rawAttributes'],function(_0x96feeb){return{'name':_0x96feeb['fieldName'],'type':_0x96feeb[_0x7d2c('0x2d')][_0x7d2c('0x2e')]};});_0x174d3a['model']=_[_0x7d2c('0x2b')](_0x1cbd1c,'name');_0x174d3a[_0x7d2c('0x2f')]=_[_0x7d2c('0x30')](_0x4a9239[_0x7d2c('0x2f')]);_0x174d3a[_0x7d2c('0x31')]=_[_0x7d2c('0x32')](_0x174d3a[_0x7d2c('0x33')],_0x174d3a['query']);_0x52b61c[_0x7d2c('0x34')]=_[_0x7d2c('0x32')](_0x174d3a[_0x7d2c('0x33')],qs[_0x7d2c('0x35')](_0x4a9239[_0x7d2c('0x2f')][_0x7d2c('0x35')]));_0x52b61c[_0x7d2c('0x34')]=_0x52b61c[_0x7d2c('0x34')][_0x7d2c('0x36')]?_0x52b61c[_0x7d2c('0x34')]:_0x174d3a[_0x7d2c('0x33')];if(!_0x4a9239[_0x7d2c('0x2f')][_0x7d2c('0x37')](_0x7d2c('0x38'))){_0x52b61c[_0x7d2c('0x1e')]=qs[_0x7d2c('0x1e')](_0x4a9239[_0x7d2c('0x2f')][_0x7d2c('0x1e')]);_0x52b61c[_0x7d2c('0x39')]=qs[_0x7d2c('0x39')](_0x4a9239[_0x7d2c('0x2f')][_0x7d2c('0x39')]);}_0x52b61c[_0x7d2c('0x3a')]=qs[_0x7d2c('0x3b')](_0x4a9239[_0x7d2c('0x2f')][_0x7d2c('0x3b')]);_0x52b61c[_0x7d2c('0x3c')]=qs[_0x7d2c('0x31')](_[_0x7d2c('0x3d')](_0x4a9239['query'],_0x174d3a[_0x7d2c('0x31')]),_0x1cbd1c);if(_0x4a9239['query'][_0x7d2c('0x3e')]){_0x52b61c['where']=_[_0x7d2c('0x3f')](_0x52b61c[_0x7d2c('0x3c')],{'$or':_[_0x7d2c('0x2b')](_0x1cbd1c,function(_0x1eff7d){if(_0x1eff7d[_0x7d2c('0x2d')]!=='VIRTUAL'){var _0x1dcfa3={};_0x1dcfa3[_0x1eff7d[_0x7d2c('0x28')]]={'$like':'%'+_0x4a9239['query']['filter']+'%'};return _0x1dcfa3;}})});}_0x52b61c=_[_0x7d2c('0x3f')]({},_0x52b61c,_0x4a9239[_0x7d2c('0x40')]);var _0x34bda9={'where':_0x52b61c[_0x7d2c('0x3c')]};return db[_0x7d2c('0x2c')][_0x7d2c('0x1d')](_0x34bda9)[_0x7d2c('0x24')](function(_0x37082c){_0x4dea77[_0x7d2c('0x1d')]=_0x37082c;if(_0x4a9239[_0x7d2c('0x2f')][_0x7d2c('0x41')]){_0x52b61c['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x7d2c('0x42')](_0x52b61c);})['then'](function(_0xe5d733){_0x4dea77[_0x7d2c('0x43')]=_0xe5d733;return _0x4dea77;})[_0x7d2c('0x24')](respondWithFilteredResult(_0xcc9286,_0x52b61c))['catch'](handleError(_0xcc9286,null));};exports[_0x7d2c('0x44')]=function(_0x128301,_0x39e3b0){var _0x56adc8={'raw':![],'where':{'id':_0x128301[_0x7d2c('0x45')]['id']}},_0x58340a={};_0x58340a[_0x7d2c('0x33')]=_[_0x7d2c('0x30')](db[_0x7d2c('0x2c')][_0x7d2c('0x46')]);_0x58340a[_0x7d2c('0x2f')]=_['keys'](_0x128301['query']);_0x58340a[_0x7d2c('0x31')]=_['intersection'](_0x58340a['model'],_0x58340a[_0x7d2c('0x2f')]);_0x56adc8[_0x7d2c('0x34')]=_[_0x7d2c('0x32')](_0x58340a[_0x7d2c('0x33')],qs[_0x7d2c('0x35')](_0x128301[_0x7d2c('0x2f')][_0x7d2c('0x35')]));_0x56adc8[_0x7d2c('0x34')]=_0x56adc8[_0x7d2c('0x34')][_0x7d2c('0x36')]?_0x56adc8[_0x7d2c('0x34')]:_0x58340a[_0x7d2c('0x33')];if(_0x128301['query']['includeAll']){_0x56adc8[_0x7d2c('0x47')]=[{'all':!![]}];}_0x56adc8=_[_0x7d2c('0x3f')]({},_0x56adc8,_0x128301[_0x7d2c('0x40')]);return db[_0x7d2c('0x2c')][_0x7d2c('0x48')](_0x56adc8)['then'](handleEntityNotFound(_0x39e3b0,null))['then'](respondWithResult(_0x39e3b0,null))['catch'](handleError(_0x39e3b0,null));};exports[_0x7d2c('0x49')]=function(_0x1a5da6,_0x20ec64){return db['ServicenowAccount'][_0x7d2c('0x49')](_0x1a5da6[_0x7d2c('0x4a')],{})['then'](respondWithResult(_0x20ec64,0xc9))[_0x7d2c('0x4b')](handleError(_0x20ec64,null));};exports[_0x7d2c('0x23')]=function(_0x109ed7,_0x7109c4){if(_0x109ed7[_0x7d2c('0x4a')]['id']){delete _0x109ed7[_0x7d2c('0x4a')]['id'];}return db[_0x7d2c('0x2c')]['find']({'where':{'id':_0x109ed7[_0x7d2c('0x45')]['id']}})['then'](handleEntityNotFound(_0x7109c4,null))[_0x7d2c('0x24')](saveUpdates(_0x109ed7['body'],null))[_0x7d2c('0x24')](respondWithResult(_0x7109c4,null))[_0x7d2c('0x4b')](handleError(_0x7109c4,null));};exports[_0x7d2c('0x25')]=function(_0x37f196,_0x7c6053){return db[_0x7d2c('0x2c')][_0x7d2c('0x48')]({'where':{'id':_0x37f196[_0x7d2c('0x45')]['id']}})[_0x7d2c('0x24')](handleEntityNotFound(_0x7c6053,null))[_0x7d2c('0x24')](removeEntity(_0x7c6053,null))[_0x7d2c('0x4b')](handleError(_0x7c6053,null));};exports[_0x7d2c('0x4c')]=function(_0x45057b,_0x4f037a,_0x271b48){var _0x315785={};var _0x37bc80={};var _0x48140d;var _0x55a4d8;return db[_0x7d2c('0x2c')][_0x7d2c('0x4d')]({'where':{'id':_0x45057b[_0x7d2c('0x45')]['id']}})[_0x7d2c('0x24')](handleEntityNotFound(_0x4f037a,null))[_0x7d2c('0x24')](function(_0x8a0182){if(_0x8a0182){_0x48140d=_0x8a0182;_0x37bc80[_0x7d2c('0x33')]=_[_0x7d2c('0x30')](db[_0x7d2c('0x4e')][_0x7d2c('0x46')]);_0x37bc80[_0x7d2c('0x2f')]=_['keys'](_0x45057b[_0x7d2c('0x2f')]);_0x37bc80['filters']=_['intersection'](_0x37bc80[_0x7d2c('0x33')],_0x37bc80[_0x7d2c('0x2f')]);_0x315785[_0x7d2c('0x34')]=_[_0x7d2c('0x32')](_0x37bc80[_0x7d2c('0x33')],qs[_0x7d2c('0x35')](_0x45057b['query'][_0x7d2c('0x35')]));_0x315785[_0x7d2c('0x34')]=_0x315785[_0x7d2c('0x34')]['length']?_0x315785[_0x7d2c('0x34')]:_0x37bc80['model'];_0x315785['order']=qs[_0x7d2c('0x3b')](_0x45057b[_0x7d2c('0x2f')]['sort']);_0x315785[_0x7d2c('0x3c')]=qs[_0x7d2c('0x31')](_[_0x7d2c('0x3d')](_0x45057b[_0x7d2c('0x2f')],_0x37bc80[_0x7d2c('0x31')]));if(_0x45057b[_0x7d2c('0x2f')]['filter']){_0x315785[_0x7d2c('0x3c')]=_[_0x7d2c('0x3f')](_0x315785['where'],{'$or':_[_0x7d2c('0x2b')](_0x315785[_0x7d2c('0x34')],function(_0x4d69eb){var _0x3bf1c2={};_0x3bf1c2[_0x4d69eb]={'$like':'%'+_0x45057b['query'][_0x7d2c('0x3e')]+'%'};return _0x3bf1c2;})});}_0x315785=_['merge']({},_0x315785,_0x45057b['options']);return _0x48140d[_0x7d2c('0x4c')](_0x315785);}})['then'](function(_0x2ec213){if(_0x2ec213){_0x55a4d8=_0x2ec213[_0x7d2c('0x36')];if(!_0x45057b[_0x7d2c('0x2f')][_0x7d2c('0x37')](_0x7d2c('0x38'))){_0x315785[_0x7d2c('0x1e')]=qs[_0x7d2c('0x1e')](_0x45057b[_0x7d2c('0x2f')][_0x7d2c('0x1e')]);_0x315785['offset']=qs[_0x7d2c('0x39')](_0x45057b[_0x7d2c('0x2f')][_0x7d2c('0x39')]);}return _0x48140d['getConfigurations'](_0x315785);}})[_0x7d2c('0x24')](function(_0x39b409){if(_0x39b409){return _0x39b409?{'count':_0x55a4d8,'rows':_0x39b409}:null;}})[_0x7d2c('0x24')](respondWithResult(_0x4f037a,null))[_0x7d2c('0x4b')](handleError(_0x4f037a,null));};exports[_0x7d2c('0x4f')]=function(_0x256eab,_0x1c16f0,_0x537e35){if(_0x256eab[_0x7d2c('0x4a')]['id']){delete _0x256eab[_0x7d2c('0x4a')]['id'];}return db[_0x7d2c('0x2c')]['findOne']({'where':{'id':_0x256eab[_0x7d2c('0x45')]['id']}})[_0x7d2c('0x24')](handleEntityNotFound(_0x1c16f0,null))[_0x7d2c('0x24')](function(_0x4acb46){if(_0x4acb46){_0x256eab[_0x7d2c('0x4a')][_0x7d2c('0x50')]=_0x4acb46['id'];_0x256eab[_0x7d2c('0x4a')][_0x7d2c('0x51')]=integrations[_0x7d2c('0x52')](_0x256eab['body'][_0x7d2c('0x53')],_0x256eab[_0x7d2c('0x4a')][_0x7d2c('0x2d')]);_0x256eab[_0x7d2c('0x4a')][_0x7d2c('0x54')]=integrations[_0x7d2c('0x55')](_0x256eab['body'][_0x7d2c('0x53')],_0x256eab[_0x7d2c('0x4a')][_0x7d2c('0x2d')]);return db[_0x7d2c('0x4e')]['create'](_0x256eab[_0x7d2c('0x4a')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x7d2c('0x24')](respondWithResult(_0x1c16f0,null))[_0x7d2c('0x4b')](handleError(_0x1c16f0,null));};exports[_0x7d2c('0x56')]=function(_0x9f7ddb,_0x42c36c,_0x5b396e){var _0x1ff4cf=[_0x7d2c('0x57'),_0x7d2c('0x58'),_0x7d2c('0x59'),'subcategory',_0x7d2c('0x5a'),_0x7d2c('0x5b'),_0x7d2c('0x5c'),_0x7d2c('0x5d'),_0x7d2c('0x5e')];var _0xb2ce63=[_0x7d2c('0x5f'),_0x7d2c('0x57'),'caused_by',_0x7d2c('0x60'),'upon_reject',_0x7d2c('0x61'),_0x7d2c('0x62'),_0x7d2c('0x58'),_0x7d2c('0x63'),_0x7d2c('0x64'),'resolved_by',_0x7d2c('0x65'),_0x7d2c('0x66'),_0x7d2c('0x67'),'sys_created_on',_0x7d2c('0x68'),_0x7d2c('0x69'),_0x7d2c('0x6a'),_0x7d2c('0x59'),_0x7d2c('0x3a'),_0x7d2c('0x6b'),'closed_at',_0x7d2c('0x6c'),_0x7d2c('0x6d'),'impact','active',_0x7d2c('0x6e'),_0x7d2c('0x6f'),_0x7d2c('0x70'),'sys_domain_path',_0x7d2c('0x71'),_0x7d2c('0x72'),_0x7d2c('0x73'),_0x7d2c('0x74'),_0x7d2c('0x75'),_0x7d2c('0x76'),_0x7d2c('0x77'),_0x7d2c('0x78'),_0x7d2c('0x79'),_0x7d2c('0x7a'),_0x7d2c('0x7b'),_0x7d2c('0x7c'),'work_notes','short_description',_0x7d2c('0x5a'),_0x7d2c('0x7d'),_0x7d2c('0x7e'),_0x7d2c('0x7f'),'assignment_group','business_stc',_0x7d2c('0x80'),_0x7d2c('0x81'),'calendar_duration',_0x7d2c('0x5b'),'sys_class_name',_0x7d2c('0x82'),_0x7d2c('0x83'),'follow_up',_0x7d2c('0x84'),_0x7d2c('0x85'),_0x7d2c('0x86'),_0x7d2c('0x87'),_0x7d2c('0x5c'),_0x7d2c('0x88'),'problem_id',_0x7d2c('0x89'),'reassignment_count',_0x7d2c('0x8a'),_0x7d2c('0x8b'),_0x7d2c('0x5d'),_0x7d2c('0x8c'),_0x7d2c('0x8d'),_0x7d2c('0x8e'),'comments_and_work_notes',_0x7d2c('0x8f'),_0x7d2c('0x90'),_0x7d2c('0x91'),_0x7d2c('0x92'),_0x7d2c('0x93'),_0x7d2c('0x94'),_0x7d2c('0x95'),_0x7d2c('0x96'),_0x7d2c('0x5e')];var _0x5e98c2='';var _0x31b1cc='';var _0x21835e=[];var _0x39c763='';var _0x58c26a='';var _0x43da25=[];var _0x338e7e='';var _0x3dac1e='';var _0x320164={};var _0x10d33d='';return db[_0x7d2c('0x2c')][_0x7d2c('0x4d')]({'where':{'id':_0x9f7ddb[_0x7d2c('0x45')]['id']},'attributes':['id',_0x7d2c('0x97'),_0x7d2c('0x98'),'email',_0x7d2c('0x99'),_0x7d2c('0x9a')]})['then'](handleEntityNotFound(_0x42c36c,null))[_0x7d2c('0x24')](function(_0x3f60b6){if(_0x3f60b6){_0x10d33d=_0x3f60b6['remoteUri'];var _0x1b883a=_0x10d33d['slice'](-0x1);if(_0x1b883a==='/'){_0x10d33d=_0x10d33d[_0x7d2c('0x9b')](0x0,_0x10d33d[_0x7d2c('0x9c')](_0x1b883a));}_0x3dac1e=util[_0x7d2c('0x9d')](_0x7d2c('0x9e'),_0x10d33d);_0x338e7e=util['format']('%s/api/now/table/',_0x10d33d);_0x320164={'user':_0x3f60b6[_0x7d2c('0x97')],'pass':_0x3f60b6[_0x7d2c('0x98')]};var _0x24ac85={'method':_0x7d2c('0x9f'),'uri':_0x3dac1e+_0x7d2c('0xa0'),'auth':_0x320164,'json':!![]};return rp(_0x24ac85);}})['then'](function(_0x4d2390){if(_0x4d2390['result'][_0x7d2c('0x36')]>0x0){_0x5e98c2=_0x4d2390[_0x7d2c('0xa1')];}console['log'](_0x7d2c('0xa2'),_0x5e98c2);_0x43da25=[];_0x31b1cc=Object[_0x7d2c('0xa3')]([],_0x5e98c2);_['remove'](_0x31b1cc,function(_0x595504){return!_0x1ff4cf[_0x7d2c('0xa4')](_0x595504[_0x7d2c('0x28')]);});_0x31b1cc['forEach'](function(_0x41b838){var _0x32c4da=createFieldObject(_0x338e7e,_0x320164,_0x41b838['internalType'],_0x41b838['name'],_0x41b838[_0x7d2c('0xa5')],![]);_0x43da25[_0x7d2c('0xa6')](_0x32c4da);});return Promise[_0x7d2c('0xa7')](_0x43da25);})[_0x7d2c('0x24')](function(_0x471ba9){_0x21835e=_0x471ba9;_0x39c763=Object[_0x7d2c('0xa3')]([],_0x5e98c2);console[_0x7d2c('0xa8')]('TCL:\x20_object',_0x5e98c2);_[_0x7d2c('0xa9')](_0x39c763,function(_0x415ffc){return _0xb2ce63['includes'](_0x415ffc[_0x7d2c('0x28')]);});console[_0x7d2c('0xa8')](_0x7d2c('0xaa'),_0x39c763);_0x43da25=[];_0x39c763[_0x7d2c('0xab')](function(_0x330881){var _0x12a075=createFieldObject(_0x338e7e,_0x320164,_0x330881[_0x7d2c('0xac')],_0x330881[_0x7d2c('0x28')],_0x330881[_0x7d2c('0xa5')],!![]);_0x43da25[_0x7d2c('0xa6')](_0x12a075);});return Promise['all'](_0x43da25);})['then'](function(_0x334e6b){_0x58c26a=_0x334e6b;var _0x429d5b=_0x21835e[_0x7d2c('0xad')](_0x58c26a);return{'count':_0x429d5b[_0x7d2c('0x36')],'rows':_0x429d5b};})[_0x7d2c('0x24')](respondWithResult(_0x42c36c,null))[_0x7d2c('0x4b')](function(_0x2dcade){console[_0x7d2c('0xa8')]('ServiceNow\x20error:\x20'+_0x2dcade);var _0x52b4bf=_0x9f7ddb['query'][_0x7d2c('0xae')]?0x1f4:_0x2dcade['statusCode']||0x1f4;logger[_0x7d2c('0x26')](_0x2dcade[_0x7d2c('0x27')]);delete _0x2dcade[_0x7d2c('0x28')];if(_0x52b4bf===0x191){_0x52b4bf=0x190;}_0x42c36c[_0x7d2c('0x1a')](_0x52b4bf)['send'](_0x9f7ddb[_0x7d2c('0x2f')][_0x7d2c('0xae')]?{'message':'Wrong\x20credentials','statusCode':_0x2dcade['statusCode']}:_0x2dcade);});};function createFieldObject(_0xd6202e,_0x117996,_0x45283d,_0x3e5a5f,_0x31db12,_0x50617d){return new Promise(function(_0x2f3e7b,_0x4d7e9b){var _0x49b52e={'id':_0x3e5a5f,'name':_0x31db12,'custom':_0x50617d};if(_0x45283d===_0x7d2c('0xaf')){_0x49b52e['options']=[{'name':_0x7d2c('0xb0'),'value':_0x7d2c('0xb1')},{'name':_0x7d2c('0xb2'),'value':_0x7d2c('0xb3')}];_0x2f3e7b(_0x49b52e);}else{var _0xaeb2b8={'method':_0x7d2c('0x9f'),'uri':_0xd6202e+_0x7d2c('0xb4')+_0x3e5a5f,'auth':_0x117996,'json':!![]};return rp(_0xaeb2b8)['then'](function(_0x42352b){var _0x16c33c=[];if(_0x42352b[_0x7d2c('0xa1')][_0x7d2c('0x36')]>0x0){_0x42352b['result'][_0x7d2c('0xab')](function(_0x3150c7){if(_0x3150c7[_0x7d2c('0xb5')]===_0x7d2c('0xb3')){var _0x5718c2={'name':_0x3150c7['label'],'value':_0x3150c7[_0x7d2c('0xb6')]};_0x16c33c[_0x7d2c('0xa6')](_0x5718c2);}});}_0x49b52e[_0x7d2c('0x40')]=_0x16c33c;if(_0x49b52e['options'][_0x7d2c('0x36')]>0x0){_0x2f3e7b(_0x49b52e);}else{if(_0x50617d==![]){_0x2f3e7b();}else{_0x2f3e7b(_0x49b52e);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 6a35d0b..90b2801 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 _0xe2fe=['define','int_servicenow_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x2d5fed,_0x1f36b6){var _0x4bd451=function(_0x5ba4a3){while(--_0x5ba4a3){_0x2d5fed['push'](_0x2d5fed['shift']());}};_0x4bd451(++_0x1f36b6);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xee2f('0x7'));module[_0xee2f('0x8')]=function(_0x49926b,_0x1533a0){return _0x49926b[_0xee2f('0x9')]('ServicenowAccount',attributes,{'tableName':_0xee2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x28e3d3,_0x54fb1b){var _0x257607=function(_0x44366d){while(--_0x44366d){_0x28e3d3['push'](_0x28e3d3['shift']());}};_0x257607(++_0x54fb1b);}(_0x814b,0x1a2));var _0xb814=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x814b[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('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 ef9121b..8d90148 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 _0xcbb2=['attributes','model','find','ShowServicenowAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','limit','map','include'];(function(_0x948681,_0x412af7){var _0x4f7cd2=function(_0x2bc4c9){while(--_0x2bc4c9){_0x948681['push'](_0x948681['shift']());}};_0x4f7cd2(++_0x412af7);}(_0xcbb2,0x6d));var _0x2cbb=function(_0x50f831,_0x330251){_0x50f831=_0x50f831-0x0;var _0x5cd57f=_0xcbb2[_0x50f831];return _0x5cd57f;};'use strict';var _=require(_0x2cbb('0x0'));var util=require('util');var moment=require(_0x2cbb('0x1'));var BPromise=require('bluebird');var rs=require(_0x2cbb('0x2'));var fs=require('fs');var Redis=require(_0x2cbb('0x3'));var db=require(_0x2cbb('0x4'))['db'];var utils=require(_0x2cbb('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2cbb('0x6'));var jayson=require(_0x2cbb('0x7'));var client=jayson['client'][_0x2cbb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x519d77,_0x1ca8f7,_0x422411){return new BPromise(function(_0x37fe69,_0xb90ac6){return client[_0x2cbb('0x9')](_0x519d77,_0x422411)[_0x2cbb('0xa')](function(_0x2e9980){logger['info'](_0x2cbb('0xb'),_0x1ca8f7,_0x2cbb('0xc'));logger[_0x2cbb('0xd')](_0x2cbb('0xe'),_0x1ca8f7,_0x2cbb('0xc'),JSON[_0x2cbb('0xf')](_0x2e9980));if(_0x2e9980[_0x2cbb('0x10')]){if(_0x2e9980['error'][_0x2cbb('0x11')]===0x1f4){logger['error'](_0x2cbb('0xb'),_0x1ca8f7,_0x2e9980[_0x2cbb('0x10')][_0x2cbb('0x12')]);return _0xb90ac6(_0x2e9980['error'][_0x2cbb('0x12')]);}logger[_0x2cbb('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x1ca8f7,_0x2e9980[_0x2cbb('0x10')][_0x2cbb('0x12')]);return _0x37fe69(_0x2e9980[_0x2cbb('0x10')][_0x2cbb('0x12')]);}else{logger[_0x2cbb('0x13')](_0x2cbb('0xb'),_0x1ca8f7,_0x2cbb('0xc'));_0x37fe69(_0x2e9980[_0x2cbb('0x14')]['message']);}})[_0x2cbb('0x15')](function(_0x39aef8){logger[_0x2cbb('0x10')](_0x2cbb('0xb'),_0x1ca8f7,_0x39aef8);_0xb90ac6(_0x39aef8);});});}exports[_0x2cbb('0x16')]=function(_0x47227e){var _0x1944e7=this;return new Promise(function(_0x3df4de,_0x4be133){return db[_0x2cbb('0x17')][_0x2cbb('0x18')]({'raw':_0x47227e[_0x2cbb('0x19')]?_0x47227e[_0x2cbb('0x19')][_0x2cbb('0x1a')]===undefined?!![]:![]:!![],'where':_0x47227e[_0x2cbb('0x19')]?_0x47227e[_0x2cbb('0x19')][_0x2cbb('0x1b')]||null:null,'attributes':_0x47227e[_0x2cbb('0x19')]?_0x47227e[_0x2cbb('0x19')]['attributes']||null:null,'limit':_0x47227e[_0x2cbb('0x19')]?_0x47227e[_0x2cbb('0x19')][_0x2cbb('0x1c')]||null:null,'include':_0x47227e[_0x2cbb('0x19')]?_0x47227e[_0x2cbb('0x19')]['include']?_[_0x2cbb('0x1d')](_0x47227e[_0x2cbb('0x19')][_0x2cbb('0x1e')],function(_0x3ebd10){return{'model':db[_0x3ebd10['model']],'as':_0x3ebd10['as'],'attributes':_0x3ebd10['attributes'],'include':_0x3ebd10[_0x2cbb('0x1e')]?_[_0x2cbb('0x1d')](_0x3ebd10[_0x2cbb('0x1e')],function(_0x4dfb9c){return{'model':db[_0x4dfb9c['model']],'as':_0x4dfb9c['as'],'attributes':_0x4dfb9c[_0x2cbb('0x1f')],'include':_0x4dfb9c['include']?_['map'](_0x4dfb9c[_0x2cbb('0x1e')],function(_0x4f2d6c){return{'model':db[_0x4f2d6c[_0x2cbb('0x20')]],'as':_0x4f2d6c['as'],'attributes':_0x4f2d6c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x130ab2){logger['info'](_0x2cbb('0x16'),_0x47227e);logger[_0x2cbb('0xd')](_0x2cbb('0x16'),_0x47227e,JSON[_0x2cbb('0xf')](_0x130ab2));_0x3df4de(_0x130ab2);})['catch'](function(_0x623880){logger[_0x2cbb('0x10')]('GetServicenowAccount',_0x623880[_0x2cbb('0x12')],_0x47227e);_0x4be133(_0x1944e7[_0x2cbb('0x10')](0x1f4,_0x623880[_0x2cbb('0x12')]));});});};exports['ShowServicenowAccount']=function(_0x3dcc76){var _0x36a6ef=this;return new Promise(function(_0x19dd83,_0x396dd9){return db['ServicenowAccount'][_0x2cbb('0x21')]({'raw':_0x3dcc76['options']?_0x3dcc76[_0x2cbb('0x19')][_0x2cbb('0x1a')]===undefined?!![]:![]:!![],'where':_0x3dcc76[_0x2cbb('0x19')]?_0x3dcc76['options']['where']||null:null,'attributes':_0x3dcc76[_0x2cbb('0x19')]?_0x3dcc76[_0x2cbb('0x19')][_0x2cbb('0x1f')]||null:null,'include':_0x3dcc76[_0x2cbb('0x19')]?_0x3dcc76[_0x2cbb('0x19')]['include']?_[_0x2cbb('0x1d')](_0x3dcc76[_0x2cbb('0x19')]['include'],function(_0x47f1f2){return{'model':db[_0x47f1f2[_0x2cbb('0x20')]],'as':_0x47f1f2['as'],'attributes':_0x47f1f2['attributes'],'include':_0x47f1f2['include']?_['map'](_0x47f1f2[_0x2cbb('0x1e')],function(_0x322a68){return{'model':db[_0x322a68[_0x2cbb('0x20')]],'as':_0x322a68['as'],'attributes':_0x322a68[_0x2cbb('0x1f')],'include':_0x322a68[_0x2cbb('0x1e')]?_[_0x2cbb('0x1d')](_0x322a68[_0x2cbb('0x1e')],function(_0xe344f0){return{'model':db[_0xe344f0['model']],'as':_0xe344f0['as'],'attributes':_0xe344f0[_0x2cbb('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2cbb('0xa')](function(_0x556f60){logger[_0x2cbb('0x13')]('ShowServicenowAccount',_0x3dcc76);logger[_0x2cbb('0xd')](_0x2cbb('0x22'),_0x3dcc76,JSON[_0x2cbb('0xf')](_0x556f60));_0x19dd83(_0x556f60);})[_0x2cbb('0x15')](function(_0x2db618){logger[_0x2cbb('0x10')](_0x2cbb('0x22'),_0x2db618[_0x2cbb('0x12')],_0x3dcc76);_0x396dd9(_0x36a6ef[_0x2cbb('0x10')](0x1f4,_0x2db618[_0x2cbb('0x12')]));});});}; \ No newline at end of file +var _0xfaa2=['limit','include','map','model','debug','ShowServicenowAccount','find','where','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','attributes'];(function(_0x11435c,_0x436ccf){var _0x556167=function(_0x56cf83){while(--_0x56cf83){_0x11435c['push'](_0x11435c['shift']());}};_0x556167(++_0x436ccf);}(_0xfaa2,0x166));var _0x2faa=function(_0x4e9782,_0x46c1a9){_0x4e9782=_0x4e9782-0x0;var _0x4505b5=_0xfaa2[_0x4e9782];return _0x4505b5;};'use strict';var _=require('lodash');var util=require(_0x2faa('0x0'));var moment=require('moment');var BPromise=require(_0x2faa('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2faa('0x2'));var db=require(_0x2faa('0x3'))['db'];var utils=require(_0x2faa('0x4'));var logger=require('../../config/logger')(_0x2faa('0x5'));var config=require(_0x2faa('0x6'));var jayson=require(_0x2faa('0x7'));var client=jayson[_0x2faa('0x8')][_0x2faa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16dd10,_0x3fd36c,_0x317281){return new BPromise(function(_0x1205c3,_0x822851){return client[_0x2faa('0xa')](_0x16dd10,_0x317281)[_0x2faa('0xb')](function(_0x4585fa){logger[_0x2faa('0xc')](_0x2faa('0xd'),_0x3fd36c,'request\x20sent');logger['debug'](_0x2faa('0xe'),_0x3fd36c,'request\x20sent',JSON[_0x2faa('0xf')](_0x4585fa));if(_0x4585fa['error']){if(_0x4585fa[_0x2faa('0x10')][_0x2faa('0x11')]===0x1f4){logger[_0x2faa('0x10')](_0x2faa('0xd'),_0x3fd36c,_0x4585fa[_0x2faa('0x10')][_0x2faa('0x12')]);return _0x822851(_0x4585fa[_0x2faa('0x10')]['message']);}logger[_0x2faa('0x10')](_0x2faa('0xd'),_0x3fd36c,_0x4585fa[_0x2faa('0x10')][_0x2faa('0x12')]);return _0x1205c3(_0x4585fa[_0x2faa('0x10')][_0x2faa('0x12')]);}else{logger[_0x2faa('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x3fd36c,'request\x20sent');_0x1205c3(_0x4585fa[_0x2faa('0x13')][_0x2faa('0x12')]);}})[_0x2faa('0x14')](function(_0x462b66){logger[_0x2faa('0x10')](_0x2faa('0xd'),_0x3fd36c,_0x462b66);_0x822851(_0x462b66);});});}exports[_0x2faa('0x15')]=function(_0x74e6bc){var _0x149f15=this;return new Promise(function(_0x16ce3b,_0xf3bbe6){return db[_0x2faa('0x16')][_0x2faa('0x17')]({'raw':_0x74e6bc[_0x2faa('0x18')]?_0x74e6bc['options'][_0x2faa('0x19')]===undefined?!![]:![]:!![],'where':_0x74e6bc[_0x2faa('0x18')]?_0x74e6bc[_0x2faa('0x18')]['where']||null:null,'attributes':_0x74e6bc['options']?_0x74e6bc[_0x2faa('0x18')][_0x2faa('0x1a')]||null:null,'limit':_0x74e6bc[_0x2faa('0x18')]?_0x74e6bc[_0x2faa('0x18')][_0x2faa('0x1b')]||null:null,'include':_0x74e6bc[_0x2faa('0x18')]?_0x74e6bc[_0x2faa('0x18')][_0x2faa('0x1c')]?_[_0x2faa('0x1d')](_0x74e6bc['options']['include'],function(_0x31e7ac){return{'model':db[_0x31e7ac['model']],'as':_0x31e7ac['as'],'attributes':_0x31e7ac[_0x2faa('0x1a')],'include':_0x31e7ac[_0x2faa('0x1c')]?_[_0x2faa('0x1d')](_0x31e7ac[_0x2faa('0x1c')],function(_0x2cdc9b){return{'model':db[_0x2cdc9b[_0x2faa('0x1e')]],'as':_0x2cdc9b['as'],'attributes':_0x2cdc9b[_0x2faa('0x1a')],'include':_0x2cdc9b[_0x2faa('0x1c')]?_[_0x2faa('0x1d')](_0x2cdc9b['include'],function(_0x4d1040){return{'model':db[_0x4d1040['model']],'as':_0x4d1040['as'],'attributes':_0x4d1040[_0x2faa('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2faa('0xb')](function(_0x529760){logger[_0x2faa('0xc')](_0x2faa('0x15'),_0x74e6bc);logger[_0x2faa('0x1f')](_0x2faa('0x15'),_0x74e6bc,JSON[_0x2faa('0xf')](_0x529760));_0x16ce3b(_0x529760);})['catch'](function(_0x57c586){logger['error']('GetServicenowAccount',_0x57c586[_0x2faa('0x12')],_0x74e6bc);_0xf3bbe6(_0x149f15[_0x2faa('0x10')](0x1f4,_0x57c586[_0x2faa('0x12')]));});});};exports[_0x2faa('0x20')]=function(_0x19d1b6){var _0xa7809a=this;return new Promise(function(_0x31e58,_0x56f7ec){return db['ServicenowAccount'][_0x2faa('0x21')]({'raw':_0x19d1b6['options']?_0x19d1b6[_0x2faa('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x19d1b6[_0x2faa('0x18')]?_0x19d1b6[_0x2faa('0x18')][_0x2faa('0x22')]||null:null,'attributes':_0x19d1b6[_0x2faa('0x18')]?_0x19d1b6[_0x2faa('0x18')][_0x2faa('0x1a')]||null:null,'include':_0x19d1b6[_0x2faa('0x18')]?_0x19d1b6['options']['include']?_['map'](_0x19d1b6[_0x2faa('0x18')][_0x2faa('0x1c')],function(_0x5c4b6b){return{'model':db[_0x5c4b6b[_0x2faa('0x1e')]],'as':_0x5c4b6b['as'],'attributes':_0x5c4b6b['attributes'],'include':_0x5c4b6b['include']?_[_0x2faa('0x1d')](_0x5c4b6b[_0x2faa('0x1c')],function(_0x1da7ae){return{'model':db[_0x1da7ae[_0x2faa('0x1e')]],'as':_0x1da7ae['as'],'attributes':_0x1da7ae[_0x2faa('0x1a')],'include':_0x1da7ae[_0x2faa('0x1c')]?_[_0x2faa('0x1d')](_0x1da7ae[_0x2faa('0x1c')],function(_0x4ae8fe){return{'model':db[_0x4ae8fe[_0x2faa('0x1e')]],'as':_0x4ae8fe['as'],'attributes':_0x4ae8fe[_0x2faa('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5658ae){logger['info'](_0x2faa('0x20'),_0x19d1b6);logger[_0x2faa('0x1f')](_0x2faa('0x20'),_0x19d1b6,JSON[_0x2faa('0xf')](_0x5658ae));_0x31e58(_0x5658ae);})[_0x2faa('0x14')](function(_0x651824){logger['error'](_0x2faa('0x20'),_0x651824[_0x2faa('0x12')],_0x19d1b6);_0x56f7ec(_0xa7809a['error'](0x1f4,_0x651824[_0x2faa('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 0cf88cb..459e6d3 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 _0x0573=['../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','util','path','express','fs-extra'];(function(_0x900d3c,_0x5b6aa3){var _0x502079=function(_0x387ea1){while(--_0x387ea1){_0x900d3c['push'](_0x900d3c['shift']());}};_0x502079(++_0x5b6aa3);}(_0x0573,0x10e));var _0x3057=function(_0x1332e1,_0x56b759){_0x1332e1=_0x1332e1-0x0;var _0x15c32a=_0x0573[_0x1332e1];return _0x15c32a;};'use strict';var multer=require(_0x3057('0x0'));var util=require(_0x3057('0x1'));var path=require(_0x3057('0x2'));var timeout=require('connect-timeout');var express=require(_0x3057('0x3'));var router=express['Router']();var fs_extra=require(_0x3057('0x4'));var auth=require(_0x3057('0x5'));var interaction=require(_0x3057('0x6'));var config=require('../../config/environment');var controller=require(_0x3057('0x7'));router[_0x3057('0x8')]('/',auth['isAuthenticated'](),controller[_0x3057('0x9')]);router[_0x3057('0x8')](_0x3057('0xa'),auth['isAuthenticated'](),controller[_0x3057('0xb')]);router[_0x3057('0x8')](_0x3057('0xc'),auth[_0x3057('0xd')](),controller[_0x3057('0xe')]);router[_0x3057('0x8')](_0x3057('0xf'),auth[_0x3057('0xd')](),controller[_0x3057('0x10')]);router['get'](_0x3057('0x11'),auth[_0x3057('0xd')](),controller[_0x3057('0x12')]);router[_0x3057('0x13')]('/',auth['isAuthenticated'](),controller[_0x3057('0x14')]);router[_0x3057('0x15')](_0x3057('0xa'),auth[_0x3057('0xd')](),controller[_0x3057('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3057('0x17')]);module[_0x3057('0x18')]=router; \ No newline at end of file +var _0x10ba=['../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x2a70db,_0x3f1cee){var _0x1fe1a3=function(_0x533b83){while(--_0x533b83){_0x2a70db['push'](_0x2a70db['shift']());}};_0x1fe1a3(++_0x3f1cee);}(_0x10ba,0xe0));var _0xa10b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x10ba[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xa10b('0x0'));var util=require(_0xa10b('0x1'));var path=require(_0xa10b('0x2'));var timeout=require(_0xa10b('0x3'));var express=require(_0xa10b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa10b('0x5'));var interaction=require(_0xa10b('0x6'));var config=require('../../config/environment');var controller=require(_0xa10b('0x7'));router[_0xa10b('0x8')]('/',auth[_0xa10b('0x9')](),controller['index']);router[_0xa10b('0x8')](_0xa10b('0xa'),auth[_0xa10b('0x9')](),controller[_0xa10b('0xb')]);router[_0xa10b('0x8')](_0xa10b('0xc'),auth[_0xa10b('0x9')](),controller['getFields']);router[_0xa10b('0x8')](_0xa10b('0xd'),auth[_0xa10b('0x9')](),controller[_0xa10b('0xe')]);router[_0xa10b('0x8')](_0xa10b('0xf'),auth['isAuthenticated'](),controller[_0xa10b('0x10')]);router[_0xa10b('0x11')]('/',auth['isAuthenticated'](),controller[_0xa10b('0x12')]);router[_0xa10b('0x13')](_0xa10b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xa10b('0x14')](_0xa10b('0xa'),auth[_0xa10b('0x9')](),controller[_0xa10b('0x15')]);module[_0xa10b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index d628261..0a052a9 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 _0x8adb=['STRING','exports'];(function(_0x2ae489,_0x9f8183){var _0x144cd2=function(_0x3a62b7){while(--_0x3a62b7){_0x2ae489['push'](_0x2ae489['shift']());}};_0x144cd2(++_0x9f8183);}(_0x8adb,0x117));var _0xb8ad=function(_0x44b3ee,_0x207c9a){_0x44b3ee=_0x44b3ee-0x0;var _0x43cc34=_0x8adb[_0x44b3ee];return _0x43cc34;};'use strict';var Sequelize=require('sequelize');module[_0xb8ad('0x0')]={'name':{'type':Sequelize[_0xb8ad('0x1')]},'description':{'type':Sequelize[_0xb8ad('0x1')]}}; \ No newline at end of file +var _0xb8dd=['sequelize','exports','STRING'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0xb8dd,0x1aa));var _0xdb8d=function(_0x1709e3,_0x53bcdf){_0x1709e3=_0x1709e3-0x0;var _0x28683f=_0xb8dd[_0x1709e3];return _0x28683f;};'use strict';var Sequelize=require(_0xdb8d('0x0'));module[_0xdb8d('0x1')]={'name':{'type':Sequelize[_0xdb8d('0x2')]},'description':{'type':Sequelize[_0xdb8d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index a55f380..22902b7 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 _0x782e=['set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','then','include','findAll','catch','show','params','keys','options','find','create','body','destroy','getFields','findOne','ServicenowField','filter','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','count','limit'];(function(_0x3a03a1,_0x24270b){var _0x3b9495=function(_0x373e42){while(--_0x373e42){_0x3a03a1['push'](_0x3a03a1['shift']());}};_0x3b9495(++_0x24270b);}(_0x782e,0xd0));var _0xe782=function(_0x5a4d39,_0x33c27e){_0x5a4d39=_0x5a4d39-0x0;var _0x3de47a=_0x782e[_0x5a4d39];return _0x3de47a;};'use strict';var emlformat=require(_0xe782('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe782('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe782('0x2'));var moment=require(_0xe782('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe782('0x4'));var util=require(_0xe782('0x5'));var path=require(_0xe782('0x6'));var sox=require(_0xe782('0x7'));var csv=require(_0xe782('0x8'));var ejs=require(_0xe782('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe782('0xa'));var crypto=require(_0xe782('0xb'));var jsforce=require(_0xe782('0xc'));var deskjs=require(_0xe782('0xd'));var toCsv=require(_0xe782('0x8'));var querystring=require('querystring');var Papa=require(_0xe782('0xe'));var Redis=require(_0xe782('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe782('0x10'));var hardwareService=require(_0xe782('0x11'));var logger=require(_0xe782('0x12'))(_0xe782('0x13'));var utils=require(_0xe782('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe782('0x15'))['db'];function respondWithStatusCode(_0x437730,_0x5aef5e){_0x5aef5e=_0x5aef5e||0xcc;return function(_0x4adb9b){if(_0x4adb9b){return _0x437730[_0xe782('0x16')](_0x5aef5e);}return _0x437730[_0xe782('0x17')](_0x5aef5e)[_0xe782('0x18')]();};}function respondWithResult(_0x7cc9b5,_0x5eb0cd){_0x5eb0cd=_0x5eb0cd||0xc8;return function(_0x1a7743){if(_0x1a7743){return _0x7cc9b5['status'](_0x5eb0cd)[_0xe782('0x19')](_0x1a7743);}};}function respondWithFilteredResult(_0x1a9c96,_0x51ef24){return function(_0x56f753){if(_0x56f753){var _0x5ba087=typeof _0x51ef24[_0xe782('0x1a')]==='undefined'&&typeof _0x51ef24['limit']==='undefined';var _0x447b58=_0x56f753[_0xe782('0x1b')];var _0x1a6180=_0x5ba087?0x0:_0x51ef24[_0xe782('0x1a')];var _0x44162f=_0x5ba087?_0x56f753[_0xe782('0x1b')]:_0x51ef24[_0xe782('0x1a')]+_0x51ef24[_0xe782('0x1c')];var _0x54cb15;if(_0x44162f>=_0x447b58){_0x44162f=_0x447b58;_0x54cb15=0xc8;}else{_0x54cb15=0xce;}_0x1a9c96[_0xe782('0x17')](_0x54cb15);return _0x1a9c96[_0xe782('0x1d')](_0xe782('0x1e'),_0x1a6180+'-'+_0x44162f+'/'+_0x447b58)[_0xe782('0x19')](_0x56f753);}return null;};}function patchUpdates(_0xc18faa){return function(_0x4f2102){try{jsonpatch[_0xe782('0x1f')](_0x4f2102,_0xc18faa,!![]);}catch(_0x5a8fcd){return BPromise[_0xe782('0x20')](_0x5a8fcd);}return _0x4f2102[_0xe782('0x21')]();};}function saveUpdates(_0x17f200,_0x326d20){return function(_0xc75663){if(_0xc75663){return _0xc75663[_0xe782('0x22')](_0x17f200)['then'](function(_0x552753){return _0x552753;});}return null;};}function removeEntity(_0x487a15,_0x2013e5){return function(_0x320f7d){if(_0x320f7d){return _0x320f7d['destroy']()['then'](function(){_0x487a15['status'](0xcc)[_0xe782('0x18')]();});}};}function handleEntityNotFound(_0x4a3e23,_0x1f2a90){return function(_0x46b99e){if(!_0x46b99e){_0x4a3e23['sendStatus'](0x194);}return _0x46b99e;};}function handleError(_0x3c83d2,_0x1cda4f){_0x1cda4f=_0x1cda4f||0x1f4;return function(_0x251c4e){logger[_0xe782('0x23')](_0x251c4e[_0xe782('0x24')]);if(_0x251c4e[_0xe782('0x25')]){delete _0x251c4e['name'];}_0x3c83d2[_0xe782('0x17')](_0x1cda4f)[_0xe782('0x26')](_0x251c4e);};}exports[_0xe782('0x27')]=function(_0x268bb4,_0x40f882){var _0x1b04eb={},_0x2477e9={},_0x5af039={'count':0x0,'rows':[]};var _0x30f538=_[_0xe782('0x28')](db[_0xe782('0x29')][_0xe782('0x2a')],function(_0x12202e){return{'name':_0x12202e[_0xe782('0x2b')],'type':_0x12202e[_0xe782('0x2c')][_0xe782('0x2d')]};});_0x2477e9[_0xe782('0x2e')]=_['map'](_0x30f538,'name');_0x2477e9[_0xe782('0x2f')]=_['keys'](_0x268bb4['query']);_0x2477e9[_0xe782('0x30')]=_[_0xe782('0x31')](_0x2477e9[_0xe782('0x2e')],_0x2477e9[_0xe782('0x2f')]);_0x1b04eb[_0xe782('0x32')]=_[_0xe782('0x31')](_0x2477e9[_0xe782('0x2e')],qs[_0xe782('0x33')](_0x268bb4['query']['fields']));_0x1b04eb[_0xe782('0x32')]=_0x1b04eb[_0xe782('0x32')][_0xe782('0x34')]?_0x1b04eb['attributes']:_0x2477e9[_0xe782('0x2e')];if(!_0x268bb4['query'][_0xe782('0x35')](_0xe782('0x36'))){_0x1b04eb['limit']=qs[_0xe782('0x1c')](_0x268bb4[_0xe782('0x2f')][_0xe782('0x1c')]);_0x1b04eb[_0xe782('0x1a')]=qs[_0xe782('0x1a')](_0x268bb4['query'][_0xe782('0x1a')]);}_0x1b04eb[_0xe782('0x37')]=qs[_0xe782('0x38')](_0x268bb4[_0xe782('0x2f')]['sort']);_0x1b04eb[_0xe782('0x39')]=qs[_0xe782('0x30')](_[_0xe782('0x3a')](_0x268bb4[_0xe782('0x2f')],_0x2477e9[_0xe782('0x30')]),_0x30f538);if(_0x268bb4[_0xe782('0x2f')]['filter']){_0x1b04eb[_0xe782('0x39')]=_[_0xe782('0x3b')](_0x1b04eb[_0xe782('0x39')],{'$or':_[_0xe782('0x28')](_0x30f538,function(_0x5bcff){if(_0x5bcff[_0xe782('0x2c')]!==_0xe782('0x3c')){var _0x3e6058={};_0x3e6058[_0x5bcff[_0xe782('0x25')]]={'$like':'%'+_0x268bb4[_0xe782('0x2f')]['filter']+'%'};return _0x3e6058;}})});}_0x1b04eb=_[_0xe782('0x3b')]({},_0x1b04eb,_0x268bb4['options']);var _0x1a36cf={'where':_0x1b04eb[_0xe782('0x39')]};return db[_0xe782('0x29')][_0xe782('0x1b')](_0x1a36cf)[_0xe782('0x3d')](function(_0x2b7554){_0x5af039[_0xe782('0x1b')]=_0x2b7554;if(_0x268bb4[_0xe782('0x2f')]['includeAll']){_0x1b04eb[_0xe782('0x3e')]=[{'all':!![]}];}return db[_0xe782('0x29')][_0xe782('0x3f')](_0x1b04eb);})[_0xe782('0x3d')](function(_0x4a9bd1){_0x5af039['rows']=_0x4a9bd1;return _0x5af039;})['then'](respondWithFilteredResult(_0x40f882,_0x1b04eb))[_0xe782('0x40')](handleError(_0x40f882,null));};exports[_0xe782('0x41')]=function(_0x1e41b6,_0x3a21ec){var _0x30f428={'raw':![],'where':{'id':_0x1e41b6[_0xe782('0x42')]['id']}},_0x5b41df={};_0x5b41df[_0xe782('0x2e')]=_[_0xe782('0x43')](db[_0xe782('0x29')][_0xe782('0x2a')]);_0x5b41df[_0xe782('0x2f')]=_[_0xe782('0x43')](_0x1e41b6[_0xe782('0x2f')]);_0x5b41df[_0xe782('0x30')]=_[_0xe782('0x31')](_0x5b41df[_0xe782('0x2e')],_0x5b41df['query']);_0x30f428[_0xe782('0x32')]=_[_0xe782('0x31')](_0x5b41df[_0xe782('0x2e')],qs[_0xe782('0x33')](_0x1e41b6[_0xe782('0x2f')][_0xe782('0x33')]));_0x30f428['attributes']=_0x30f428['attributes'][_0xe782('0x34')]?_0x30f428[_0xe782('0x32')]:_0x5b41df[_0xe782('0x2e')];if(_0x1e41b6[_0xe782('0x2f')]['includeAll']){_0x30f428['include']=[{'all':!![]}];}_0x30f428=_[_0xe782('0x3b')]({},_0x30f428,_0x1e41b6[_0xe782('0x44')]);return db[_0xe782('0x29')][_0xe782('0x45')](_0x30f428)['then'](handleEntityNotFound(_0x3a21ec,null))[_0xe782('0x3d')](respondWithResult(_0x3a21ec,null))[_0xe782('0x40')](handleError(_0x3a21ec,null));};exports['create']=function(_0xcef75,_0x2f464a){return db[_0xe782('0x29')][_0xe782('0x46')](_0xcef75[_0xe782('0x47')],{})[_0xe782('0x3d')](respondWithResult(_0x2f464a,0xc9))[_0xe782('0x40')](handleError(_0x2f464a,null));};exports[_0xe782('0x22')]=function(_0x5c7da6,_0xec0b99){if(_0x5c7da6[_0xe782('0x47')]['id']){delete _0x5c7da6[_0xe782('0x47')]['id'];}return db[_0xe782('0x29')]['find']({'where':{'id':_0x5c7da6[_0xe782('0x42')]['id']}})[_0xe782('0x3d')](handleEntityNotFound(_0xec0b99,null))[_0xe782('0x3d')](saveUpdates(_0x5c7da6[_0xe782('0x47')],null))[_0xe782('0x3d')](respondWithResult(_0xec0b99,null))['catch'](handleError(_0xec0b99,null));};exports[_0xe782('0x48')]=function(_0x1184c2,_0x58cf1e){return db[_0xe782('0x29')][_0xe782('0x45')]({'where':{'id':_0x1184c2['params']['id']}})[_0xe782('0x3d')](handleEntityNotFound(_0x58cf1e,null))[_0xe782('0x3d')](removeEntity(_0x58cf1e,null))[_0xe782('0x40')](handleError(_0x58cf1e,null));};exports[_0xe782('0x49')]=function(_0x3e1884,_0x4da6db,_0x48fe02){var _0x2f1581={};var _0x59999c={};var _0x11dc0d;var _0x2b8f39;return db[_0xe782('0x29')][_0xe782('0x4a')]({'where':{'id':_0x3e1884[_0xe782('0x42')]['id']}})[_0xe782('0x3d')](handleEntityNotFound(_0x4da6db,null))[_0xe782('0x3d')](function(_0x2e1b2e){if(_0x2e1b2e){_0x11dc0d=_0x2e1b2e;_0x59999c[_0xe782('0x2e')]=_[_0xe782('0x43')](db[_0xe782('0x4b')]['rawAttributes']);_0x59999c[_0xe782('0x2f')]=_['keys'](_0x3e1884['query']);_0x59999c[_0xe782('0x30')]=_[_0xe782('0x31')](_0x59999c[_0xe782('0x2e')],_0x59999c[_0xe782('0x2f')]);_0x2f1581[_0xe782('0x32')]=_['intersection'](_0x59999c[_0xe782('0x2e')],qs[_0xe782('0x33')](_0x3e1884[_0xe782('0x2f')][_0xe782('0x33')]));_0x2f1581[_0xe782('0x32')]=_0x2f1581[_0xe782('0x32')][_0xe782('0x34')]?_0x2f1581['attributes']:_0x59999c[_0xe782('0x2e')];_0x2f1581[_0xe782('0x37')]=qs[_0xe782('0x38')](_0x3e1884['query']['sort']);_0x2f1581[_0xe782('0x39')]=qs[_0xe782('0x30')](_[_0xe782('0x3a')](_0x3e1884[_0xe782('0x2f')],_0x59999c['filters']));if(_0x3e1884[_0xe782('0x2f')]['filter']){_0x2f1581['where']=_['merge'](_0x2f1581['where'],{'$or':_[_0xe782('0x28')](_0x2f1581[_0xe782('0x32')],function(_0x5c0c63){var _0x567dde={};_0x567dde[_0x5c0c63]={'$like':'%'+_0x3e1884[_0xe782('0x2f')][_0xe782('0x4c')]+'%'};return _0x567dde;})});}_0x2f1581=_[_0xe782('0x3b')]({},_0x2f1581,_0x3e1884[_0xe782('0x44')]);return _0x11dc0d[_0xe782('0x49')](_0x2f1581);}})[_0xe782('0x3d')](function(_0x35d77f){if(_0x35d77f){_0x2b8f39=_0x35d77f['length'];if(!_0x3e1884['query'][_0xe782('0x35')](_0xe782('0x36'))){_0x2f1581[_0xe782('0x1c')]=qs[_0xe782('0x1c')](_0x3e1884['query'][_0xe782('0x1c')]);_0x2f1581['offset']=qs['offset'](_0x3e1884[_0xe782('0x2f')][_0xe782('0x1a')]);}return _0x11dc0d[_0xe782('0x49')](_0x2f1581);}})[_0xe782('0x3d')](function(_0x1112c5){if(_0x1112c5){return _0x1112c5?{'count':_0x2b8f39,'rows':_0x1112c5}:null;}})[_0xe782('0x3d')](respondWithResult(_0x4da6db,null))[_0xe782('0x40')](handleError(_0x4da6db,null));};exports[_0xe782('0x4d')]=function(_0x255e87,_0x5ebf30,_0x2b0f9c){var _0x3ec741={};var _0x1a4c0e={};var _0x44a786;var _0xd784f;return db['ServicenowConfiguration'][_0xe782('0x4a')]({'where':{'id':_0x255e87[_0xe782('0x42')]['id']}})[_0xe782('0x3d')](handleEntityNotFound(_0x5ebf30,null))[_0xe782('0x3d')](function(_0x1abdd3){if(_0x1abdd3){_0x44a786=_0x1abdd3;_0x1a4c0e[_0xe782('0x2e')]=_['keys'](db['ServicenowField'][_0xe782('0x2a')]);_0x1a4c0e[_0xe782('0x2f')]=_[_0xe782('0x43')](_0x255e87[_0xe782('0x2f')]);_0x1a4c0e[_0xe782('0x30')]=_[_0xe782('0x31')](_0x1a4c0e[_0xe782('0x2e')],_0x1a4c0e[_0xe782('0x2f')]);_0x3ec741[_0xe782('0x32')]=_[_0xe782('0x31')](_0x1a4c0e[_0xe782('0x2e')],qs[_0xe782('0x33')](_0x255e87[_0xe782('0x2f')][_0xe782('0x33')]));_0x3ec741[_0xe782('0x32')]=_0x3ec741[_0xe782('0x32')][_0xe782('0x34')]?_0x3ec741[_0xe782('0x32')]:_0x1a4c0e[_0xe782('0x2e')];_0x3ec741['order']=qs[_0xe782('0x38')](_0x255e87[_0xe782('0x2f')][_0xe782('0x38')]);_0x3ec741[_0xe782('0x39')]=qs[_0xe782('0x30')](_[_0xe782('0x3a')](_0x255e87[_0xe782('0x2f')],_0x1a4c0e['filters']));if(_0x255e87[_0xe782('0x2f')][_0xe782('0x4c')]){_0x3ec741[_0xe782('0x39')]=_[_0xe782('0x3b')](_0x3ec741['where'],{'$or':_[_0xe782('0x28')](_0x3ec741[_0xe782('0x32')],function(_0x5c05de){var _0x21fb29={};_0x21fb29[_0x5c05de]={'$like':'%'+_0x255e87[_0xe782('0x2f')][_0xe782('0x4c')]+'%'};return _0x21fb29;})});}_0x3ec741=_['merge']({},_0x3ec741,_0x255e87['options']);return _0x44a786['getSubjects'](_0x3ec741);}})['then'](function(_0x54badb){if(_0x54badb){_0xd784f=_0x54badb[_0xe782('0x34')];if(!_0x255e87[_0xe782('0x2f')]['hasOwnProperty'](_0xe782('0x36'))){_0x3ec741['limit']=qs[_0xe782('0x1c')](_0x255e87[_0xe782('0x2f')][_0xe782('0x1c')]);_0x3ec741[_0xe782('0x1a')]=qs['offset'](_0x255e87['query'][_0xe782('0x1a')]);}return _0x44a786['getSubjects'](_0x3ec741);}})[_0xe782('0x3d')](function(_0x243d92){if(_0x243d92){return _0x243d92?{'count':_0xd784f,'rows':_0x243d92}:null;}})[_0xe782('0x3d')](respondWithResult(_0x5ebf30,null))[_0xe782('0x40')](handleError(_0x5ebf30,null));};exports[_0xe782('0x4e')]=function(_0x58bafe,_0x156d49,_0x343faf){var _0x161195={};var _0x2d466f={};var _0x39e5ed;var _0x646fe8;return db[_0xe782('0x29')][_0xe782('0x4a')]({'where':{'id':_0x58bafe['params']['id']}})[_0xe782('0x3d')](handleEntityNotFound(_0x156d49,null))[_0xe782('0x3d')](function(_0x457d3d){if(_0x457d3d){_0x39e5ed=_0x457d3d;_0x2d466f[_0xe782('0x2e')]=_[_0xe782('0x43')](db[_0xe782('0x4b')][_0xe782('0x2a')]);_0x2d466f[_0xe782('0x2f')]=_[_0xe782('0x43')](_0x58bafe['query']);_0x2d466f[_0xe782('0x30')]=_[_0xe782('0x31')](_0x2d466f[_0xe782('0x2e')],_0x2d466f[_0xe782('0x2f')]);_0x161195[_0xe782('0x32')]=_[_0xe782('0x31')](_0x2d466f[_0xe782('0x2e')],qs[_0xe782('0x33')](_0x58bafe[_0xe782('0x2f')][_0xe782('0x33')]));_0x161195[_0xe782('0x32')]=_0x161195[_0xe782('0x32')][_0xe782('0x34')]?_0x161195[_0xe782('0x32')]:_0x2d466f['model'];_0x161195[_0xe782('0x37')]=qs['sort'](_0x58bafe[_0xe782('0x2f')][_0xe782('0x38')]);_0x161195[_0xe782('0x39')]=qs[_0xe782('0x30')](_['pick'](_0x58bafe[_0xe782('0x2f')],_0x2d466f[_0xe782('0x30')]));if(_0x58bafe['query']['filter']){_0x161195[_0xe782('0x39')]=_[_0xe782('0x3b')](_0x161195[_0xe782('0x39')],{'$or':_[_0xe782('0x28')](_0x161195['attributes'],function(_0x40bd7b){var _0x48cbf9={};_0x48cbf9[_0x40bd7b]={'$like':'%'+_0x58bafe[_0xe782('0x2f')][_0xe782('0x4c')]+'%'};return _0x48cbf9;})});}_0x161195=_[_0xe782('0x3b')]({},_0x161195,_0x58bafe[_0xe782('0x44')]);return _0x39e5ed[_0xe782('0x4e')](_0x161195);}})[_0xe782('0x3d')](function(_0x347be2){if(_0x347be2){_0x646fe8=_0x347be2[_0xe782('0x34')];if(!_0x58bafe[_0xe782('0x2f')][_0xe782('0x35')](_0xe782('0x36'))){_0x161195['limit']=qs[_0xe782('0x1c')](_0x58bafe[_0xe782('0x2f')][_0xe782('0x1c')]);_0x161195[_0xe782('0x1a')]=qs[_0xe782('0x1a')](_0x58bafe['query']['offset']);}return _0x39e5ed[_0xe782('0x4e')](_0x161195);}})[_0xe782('0x3d')](function(_0x5615d4){if(_0x5615d4){return _0x5615d4?{'count':_0x646fe8,'rows':_0x5615d4}:null;}})[_0xe782('0x3d')](respondWithResult(_0x156d49,null))[_0xe782('0x40')](handleError(_0x156d49,null));}; \ No newline at end of file +var _0x0640=['type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','create','body','find','getFields','findOne','getSubjects','ServicenowField','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','ejs','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','ServicenowConfiguration','rawAttributes','fieldName'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0640,0x15b));var _0x0064=function(_0x13d4c1,_0x400189){_0x13d4c1=_0x13d4c1-0x0;var _0x512203=_0x0640[_0x13d4c1];return _0x512203;};'use strict';var emlformat=require(_0x0064('0x0'));var rimraf=require(_0x0064('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0064('0x2'));var moment=require(_0x0064('0x3'));var BPromise=require(_0x0064('0x4'));var Mustache=require(_0x0064('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0064('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0064('0x7'));var crypto=require(_0x0064('0x8'));var jsforce=require(_0x0064('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x0064('0xa'));var querystring=require(_0x0064('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0064('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x0064('0xd'));var hardwareService=require(_0x0064('0xe'));var logger=require(_0x0064('0xf'))(_0x0064('0x10'));var utils=require(_0x0064('0x11'));var config=require(_0x0064('0x12'));var licenseUtil=require(_0x0064('0x13'));var db=require(_0x0064('0x14'))['db'];function respondWithStatusCode(_0x3f9ca8,_0xa58cdd){_0xa58cdd=_0xa58cdd||0xcc;return function(_0x202576){if(_0x202576){return _0x3f9ca8[_0x0064('0x15')](_0xa58cdd);}return _0x3f9ca8[_0x0064('0x16')](_0xa58cdd)[_0x0064('0x17')]();};}function respondWithResult(_0x12c4ee,_0x21af73){_0x21af73=_0x21af73||0xc8;return function(_0x28cc4b){if(_0x28cc4b){return _0x12c4ee['status'](_0x21af73)[_0x0064('0x18')](_0x28cc4b);}};}function respondWithFilteredResult(_0x538493,_0x48232d){return function(_0x9a45f3){if(_0x9a45f3){var _0x19fe19=typeof _0x48232d[_0x0064('0x19')]===_0x0064('0x1a')&&typeof _0x48232d['limit']===_0x0064('0x1a');var _0x3f3985=_0x9a45f3[_0x0064('0x1b')];var _0xf282eb=_0x19fe19?0x0:_0x48232d[_0x0064('0x19')];var _0x1b2df9=_0x19fe19?_0x9a45f3[_0x0064('0x1b')]:_0x48232d[_0x0064('0x19')]+_0x48232d[_0x0064('0x1c')];var _0x3ef790;if(_0x1b2df9>=_0x3f3985){_0x1b2df9=_0x3f3985;_0x3ef790=0xc8;}else{_0x3ef790=0xce;}_0x538493[_0x0064('0x16')](_0x3ef790);return _0x538493[_0x0064('0x1d')](_0x0064('0x1e'),_0xf282eb+'-'+_0x1b2df9+'/'+_0x3f3985)[_0x0064('0x18')](_0x9a45f3);}return null;};}function patchUpdates(_0x3f0f7a){return function(_0x36de6c){try{jsonpatch[_0x0064('0x1f')](_0x36de6c,_0x3f0f7a,!![]);}catch(_0x5b8582){return BPromise[_0x0064('0x20')](_0x5b8582);}return _0x36de6c[_0x0064('0x21')]();};}function saveUpdates(_0x3e6d2a,_0x25527e){return function(_0x184b93){if(_0x184b93){return _0x184b93[_0x0064('0x22')](_0x3e6d2a)['then'](function(_0x572c10){return _0x572c10;});}return null;};}function removeEntity(_0x48d712,_0x316747){return function(_0x48b4b1){if(_0x48b4b1){return _0x48b4b1[_0x0064('0x23')]()[_0x0064('0x24')](function(){_0x48d712[_0x0064('0x16')](0xcc)[_0x0064('0x17')]();});}};}function handleEntityNotFound(_0x29c156,_0x32fa5d){return function(_0xd90523){if(!_0xd90523){_0x29c156['sendStatus'](0x194);}return _0xd90523;};}function handleError(_0x3a1b57,_0x248f2e){_0x248f2e=_0x248f2e||0x1f4;return function(_0x51a321){logger[_0x0064('0x25')](_0x51a321[_0x0064('0x26')]);if(_0x51a321[_0x0064('0x27')]){delete _0x51a321[_0x0064('0x27')];}_0x3a1b57[_0x0064('0x16')](_0x248f2e)['send'](_0x51a321);};}exports['index']=function(_0x333882,_0x1f956f){var _0x5dd5c2={},_0x5f4d44={},_0x491793={'count':0x0,'rows':[]};var _0x15bbdd=_['map'](db[_0x0064('0x28')][_0x0064('0x29')],function(_0x2ad40a){return{'name':_0x2ad40a[_0x0064('0x2a')],'type':_0x2ad40a[_0x0064('0x2b')][_0x0064('0x2c')]};});_0x5f4d44['model']=_[_0x0064('0x2d')](_0x15bbdd,_0x0064('0x27'));_0x5f4d44[_0x0064('0x2e')]=_[_0x0064('0x2f')](_0x333882[_0x0064('0x2e')]);_0x5f4d44[_0x0064('0x30')]=_['intersection'](_0x5f4d44[_0x0064('0x31')],_0x5f4d44[_0x0064('0x2e')]);_0x5dd5c2[_0x0064('0x32')]=_[_0x0064('0x33')](_0x5f4d44[_0x0064('0x31')],qs[_0x0064('0x34')](_0x333882[_0x0064('0x2e')][_0x0064('0x34')]));_0x5dd5c2['attributes']=_0x5dd5c2[_0x0064('0x32')]['length']?_0x5dd5c2['attributes']:_0x5f4d44[_0x0064('0x31')];if(!_0x333882[_0x0064('0x2e')][_0x0064('0x35')](_0x0064('0x36'))){_0x5dd5c2[_0x0064('0x1c')]=qs[_0x0064('0x1c')](_0x333882['query'][_0x0064('0x1c')]);_0x5dd5c2[_0x0064('0x19')]=qs[_0x0064('0x19')](_0x333882['query']['offset']);}_0x5dd5c2[_0x0064('0x37')]=qs[_0x0064('0x38')](_0x333882['query'][_0x0064('0x38')]);_0x5dd5c2[_0x0064('0x39')]=qs[_0x0064('0x30')](_[_0x0064('0x3a')](_0x333882['query'],_0x5f4d44[_0x0064('0x30')]),_0x15bbdd);if(_0x333882['query'][_0x0064('0x3b')]){_0x5dd5c2['where']=_[_0x0064('0x3c')](_0x5dd5c2[_0x0064('0x39')],{'$or':_[_0x0064('0x2d')](_0x15bbdd,function(_0x80743a){if(_0x80743a[_0x0064('0x2b')]!==_0x0064('0x3d')){var _0x41b9e9={};_0x41b9e9[_0x80743a[_0x0064('0x27')]]={'$like':'%'+_0x333882[_0x0064('0x2e')][_0x0064('0x3b')]+'%'};return _0x41b9e9;}})});}_0x5dd5c2=_[_0x0064('0x3c')]({},_0x5dd5c2,_0x333882[_0x0064('0x3e')]);var _0x50591a={'where':_0x5dd5c2[_0x0064('0x39')]};return db['ServicenowConfiguration']['count'](_0x50591a)[_0x0064('0x24')](function(_0xaea8bd){_0x491793[_0x0064('0x1b')]=_0xaea8bd;if(_0x333882['query'][_0x0064('0x3f')]){_0x5dd5c2['include']=[{'all':!![]}];}return db[_0x0064('0x28')][_0x0064('0x40')](_0x5dd5c2);})[_0x0064('0x24')](function(_0x9ee7ec){_0x491793[_0x0064('0x41')]=_0x9ee7ec;return _0x491793;})[_0x0064('0x24')](respondWithFilteredResult(_0x1f956f,_0x5dd5c2))[_0x0064('0x42')](handleError(_0x1f956f,null));};exports['show']=function(_0x219ec9,_0xed0621){var _0x16d79d={'raw':![],'where':{'id':_0x219ec9[_0x0064('0x43')]['id']}},_0x2c2628={};_0x2c2628[_0x0064('0x31')]=_['keys'](db[_0x0064('0x28')][_0x0064('0x29')]);_0x2c2628[_0x0064('0x2e')]=_[_0x0064('0x2f')](_0x219ec9['query']);_0x2c2628[_0x0064('0x30')]=_[_0x0064('0x33')](_0x2c2628[_0x0064('0x31')],_0x2c2628['query']);_0x16d79d[_0x0064('0x32')]=_[_0x0064('0x33')](_0x2c2628[_0x0064('0x31')],qs[_0x0064('0x34')](_0x219ec9[_0x0064('0x2e')][_0x0064('0x34')]));_0x16d79d[_0x0064('0x32')]=_0x16d79d[_0x0064('0x32')][_0x0064('0x44')]?_0x16d79d[_0x0064('0x32')]:_0x2c2628['model'];if(_0x219ec9[_0x0064('0x2e')][_0x0064('0x3f')]){_0x16d79d[_0x0064('0x45')]=[{'all':!![]}];}_0x16d79d=_[_0x0064('0x3c')]({},_0x16d79d,_0x219ec9['options']);return db[_0x0064('0x28')]['find'](_0x16d79d)['then'](handleEntityNotFound(_0xed0621,null))[_0x0064('0x24')](respondWithResult(_0xed0621,null))[_0x0064('0x42')](handleError(_0xed0621,null));};exports['create']=function(_0x36ed4f,_0x57be46){return db[_0x0064('0x28')][_0x0064('0x46')](_0x36ed4f[_0x0064('0x47')],{})[_0x0064('0x24')](respondWithResult(_0x57be46,0xc9))[_0x0064('0x42')](handleError(_0x57be46,null));};exports[_0x0064('0x22')]=function(_0xb5cabc,_0x493b60){if(_0xb5cabc[_0x0064('0x47')]['id']){delete _0xb5cabc[_0x0064('0x47')]['id'];}return db[_0x0064('0x28')][_0x0064('0x48')]({'where':{'id':_0xb5cabc[_0x0064('0x43')]['id']}})[_0x0064('0x24')](handleEntityNotFound(_0x493b60,null))[_0x0064('0x24')](saveUpdates(_0xb5cabc[_0x0064('0x47')],null))['then'](respondWithResult(_0x493b60,null))[_0x0064('0x42')](handleError(_0x493b60,null));};exports[_0x0064('0x23')]=function(_0x57588a,_0x42e6e0){return db[_0x0064('0x28')][_0x0064('0x48')]({'where':{'id':_0x57588a['params']['id']}})[_0x0064('0x24')](handleEntityNotFound(_0x42e6e0,null))['then'](removeEntity(_0x42e6e0,null))[_0x0064('0x42')](handleError(_0x42e6e0,null));};exports[_0x0064('0x49')]=function(_0x4a5cf9,_0x35e885,_0x321550){var _0x3ad8d0={};var _0x39b1df={};var _0x3ba3d6;var _0x187330;return db[_0x0064('0x28')][_0x0064('0x4a')]({'where':{'id':_0x4a5cf9[_0x0064('0x43')]['id']}})[_0x0064('0x24')](handleEntityNotFound(_0x35e885,null))[_0x0064('0x24')](function(_0x4b3195){if(_0x4b3195){_0x3ba3d6=_0x4b3195;_0x39b1df[_0x0064('0x31')]=_[_0x0064('0x2f')](db['ServicenowField'][_0x0064('0x29')]);_0x39b1df['query']=_[_0x0064('0x2f')](_0x4a5cf9[_0x0064('0x2e')]);_0x39b1df[_0x0064('0x30')]=_['intersection'](_0x39b1df[_0x0064('0x31')],_0x39b1df[_0x0064('0x2e')]);_0x3ad8d0[_0x0064('0x32')]=_[_0x0064('0x33')](_0x39b1df['model'],qs[_0x0064('0x34')](_0x4a5cf9[_0x0064('0x2e')][_0x0064('0x34')]));_0x3ad8d0[_0x0064('0x32')]=_0x3ad8d0['attributes'][_0x0064('0x44')]?_0x3ad8d0[_0x0064('0x32')]:_0x39b1df[_0x0064('0x31')];_0x3ad8d0['order']=qs['sort'](_0x4a5cf9[_0x0064('0x2e')]['sort']);_0x3ad8d0[_0x0064('0x39')]=qs[_0x0064('0x30')](_[_0x0064('0x3a')](_0x4a5cf9[_0x0064('0x2e')],_0x39b1df[_0x0064('0x30')]));if(_0x4a5cf9['query'][_0x0064('0x3b')]){_0x3ad8d0[_0x0064('0x39')]=_[_0x0064('0x3c')](_0x3ad8d0[_0x0064('0x39')],{'$or':_[_0x0064('0x2d')](_0x3ad8d0['attributes'],function(_0x562c84){var _0x1800df={};_0x1800df[_0x562c84]={'$like':'%'+_0x4a5cf9[_0x0064('0x2e')][_0x0064('0x3b')]+'%'};return _0x1800df;})});}_0x3ad8d0=_['merge']({},_0x3ad8d0,_0x4a5cf9['options']);return _0x3ba3d6[_0x0064('0x49')](_0x3ad8d0);}})['then'](function(_0x415a38){if(_0x415a38){_0x187330=_0x415a38[_0x0064('0x44')];if(!_0x4a5cf9[_0x0064('0x2e')][_0x0064('0x35')](_0x0064('0x36'))){_0x3ad8d0['limit']=qs[_0x0064('0x1c')](_0x4a5cf9[_0x0064('0x2e')][_0x0064('0x1c')]);_0x3ad8d0[_0x0064('0x19')]=qs['offset'](_0x4a5cf9[_0x0064('0x2e')][_0x0064('0x19')]);}return _0x3ba3d6[_0x0064('0x49')](_0x3ad8d0);}})[_0x0064('0x24')](function(_0x5314ae){if(_0x5314ae){return _0x5314ae?{'count':_0x187330,'rows':_0x5314ae}:null;}})[_0x0064('0x24')](respondWithResult(_0x35e885,null))[_0x0064('0x42')](handleError(_0x35e885,null));};exports[_0x0064('0x4b')]=function(_0x502ee4,_0x13d9b9,_0x8b1377){var _0x4de405={};var _0x20df5d={};var _0xc47014;var _0x2c0831;return db['ServicenowConfiguration'][_0x0064('0x4a')]({'where':{'id':_0x502ee4['params']['id']}})[_0x0064('0x24')](handleEntityNotFound(_0x13d9b9,null))[_0x0064('0x24')](function(_0x112a1d){if(_0x112a1d){_0xc47014=_0x112a1d;_0x20df5d[_0x0064('0x31')]=_[_0x0064('0x2f')](db[_0x0064('0x4c')]['rawAttributes']);_0x20df5d[_0x0064('0x2e')]=_[_0x0064('0x2f')](_0x502ee4[_0x0064('0x2e')]);_0x20df5d[_0x0064('0x30')]=_[_0x0064('0x33')](_0x20df5d['model'],_0x20df5d['query']);_0x4de405[_0x0064('0x32')]=_[_0x0064('0x33')](_0x20df5d[_0x0064('0x31')],qs[_0x0064('0x34')](_0x502ee4[_0x0064('0x2e')]['fields']));_0x4de405[_0x0064('0x32')]=_0x4de405['attributes'][_0x0064('0x44')]?_0x4de405['attributes']:_0x20df5d[_0x0064('0x31')];_0x4de405[_0x0064('0x37')]=qs[_0x0064('0x38')](_0x502ee4[_0x0064('0x2e')][_0x0064('0x38')]);_0x4de405['where']=qs[_0x0064('0x30')](_[_0x0064('0x3a')](_0x502ee4[_0x0064('0x2e')],_0x20df5d[_0x0064('0x30')]));if(_0x502ee4[_0x0064('0x2e')]['filter']){_0x4de405['where']=_[_0x0064('0x3c')](_0x4de405['where'],{'$or':_[_0x0064('0x2d')](_0x4de405['attributes'],function(_0x3a6980){var _0x479bc1={};_0x479bc1[_0x3a6980]={'$like':'%'+_0x502ee4[_0x0064('0x2e')][_0x0064('0x3b')]+'%'};return _0x479bc1;})});}_0x4de405=_[_0x0064('0x3c')]({},_0x4de405,_0x502ee4[_0x0064('0x3e')]);return _0xc47014[_0x0064('0x4b')](_0x4de405);}})[_0x0064('0x24')](function(_0x11149b){if(_0x11149b){_0x2c0831=_0x11149b['length'];if(!_0x502ee4[_0x0064('0x2e')]['hasOwnProperty'](_0x0064('0x36'))){_0x4de405[_0x0064('0x1c')]=qs[_0x0064('0x1c')](_0x502ee4['query']['limit']);_0x4de405[_0x0064('0x19')]=qs[_0x0064('0x19')](_0x502ee4[_0x0064('0x2e')][_0x0064('0x19')]);}return _0xc47014[_0x0064('0x4b')](_0x4de405);}})[_0x0064('0x24')](function(_0x2fc28d){if(_0x2fc28d){return _0x2fc28d?{'count':_0x2c0831,'rows':_0x2fc28d}:null;}})[_0x0064('0x24')](respondWithResult(_0x13d9b9,null))[_0x0064('0x42')](handleError(_0x13d9b9,null));};exports['getDescriptions']=function(_0x2744df,_0x476a81,_0x465b1a){var _0x189020={};var _0xad7ecd={};var _0x56bbbd;var _0x5a063d;return db[_0x0064('0x28')][_0x0064('0x4a')]({'where':{'id':_0x2744df[_0x0064('0x43')]['id']}})['then'](handleEntityNotFound(_0x476a81,null))[_0x0064('0x24')](function(_0x4a1b36){if(_0x4a1b36){_0x56bbbd=_0x4a1b36;_0xad7ecd['model']=_[_0x0064('0x2f')](db[_0x0064('0x4c')][_0x0064('0x29')]);_0xad7ecd['query']=_[_0x0064('0x2f')](_0x2744df['query']);_0xad7ecd['filters']=_['intersection'](_0xad7ecd[_0x0064('0x31')],_0xad7ecd[_0x0064('0x2e')]);_0x189020[_0x0064('0x32')]=_['intersection'](_0xad7ecd['model'],qs['fields'](_0x2744df[_0x0064('0x2e')][_0x0064('0x34')]));_0x189020[_0x0064('0x32')]=_0x189020[_0x0064('0x32')][_0x0064('0x44')]?_0x189020[_0x0064('0x32')]:_0xad7ecd[_0x0064('0x31')];_0x189020[_0x0064('0x37')]=qs[_0x0064('0x38')](_0x2744df['query']['sort']);_0x189020[_0x0064('0x39')]=qs[_0x0064('0x30')](_[_0x0064('0x3a')](_0x2744df[_0x0064('0x2e')],_0xad7ecd[_0x0064('0x30')]));if(_0x2744df[_0x0064('0x2e')][_0x0064('0x3b')]){_0x189020[_0x0064('0x39')]=_['merge'](_0x189020[_0x0064('0x39')],{'$or':_[_0x0064('0x2d')](_0x189020['attributes'],function(_0x59f8b4){var _0x245690={};_0x245690[_0x59f8b4]={'$like':'%'+_0x2744df[_0x0064('0x2e')][_0x0064('0x3b')]+'%'};return _0x245690;})});}_0x189020=_[_0x0064('0x3c')]({},_0x189020,_0x2744df[_0x0064('0x3e')]);return _0x56bbbd[_0x0064('0x4d')](_0x189020);}})[_0x0064('0x24')](function(_0xa5264b){if(_0xa5264b){_0x5a063d=_0xa5264b['length'];if(!_0x2744df[_0x0064('0x2e')][_0x0064('0x35')](_0x0064('0x36'))){_0x189020[_0x0064('0x1c')]=qs['limit'](_0x2744df[_0x0064('0x2e')][_0x0064('0x1c')]);_0x189020[_0x0064('0x19')]=qs['offset'](_0x2744df[_0x0064('0x2e')][_0x0064('0x19')]);}return _0x56bbbd['getDescriptions'](_0x189020);}})[_0x0064('0x24')](function(_0x188cad){if(_0x188cad){return _0x188cad?{'count':_0x5a063d,'rows':_0x188cad}:null;}})[_0x0064('0x24')](respondWithResult(_0x476a81,null))['catch'](handleError(_0x476a81,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 4441d83..954db49 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 _0xb114=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x5dbe90,_0x183ead){var _0x5cbd0e=function(_0x20ea7f){while(--_0x20ea7f){_0x5dbe90['push'](_0x5dbe90['shift']());}};_0x5cbd0e(++_0x183ead);}(_0xb114,0x11f));var _0x4b11=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xb114[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0x4b11('0x0'));var util=require('util');var logger=require(_0x4b11('0x1'))(_0x4b11('0x2'));var moment=require('moment');var BPromise=require(_0x4b11('0x3'));var rp=require(_0x4b11('0x4'));var fs=require('fs');var path=require(_0x4b11('0x5'));var rimraf=require(_0x4b11('0x6'));var config=require(_0x4b11('0x7'));var attributes=require(_0x4b11('0x8'));module['exports']=function(_0x139a82,_0x57aec8){return _0x139a82[_0x4b11('0x9')](_0x4b11('0xa'),attributes,{'tableName':_0x4b11('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69af=['ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define'];(function(_0xbf1dc1,_0x46e714){var _0x1d2700=function(_0x288d00){while(--_0x288d00){_0xbf1dc1['push'](_0xbf1dc1['shift']());}};_0x1d2700(++_0x46e714);}(_0x69af,0x17b));var _0xf69a=function(_0xd85702,_0x49ec78){_0xd85702=_0xd85702-0x0;var _0x4ce362=_0x69af[_0xd85702];return _0x4ce362;};'use strict';var _=require('lodash');var util=require(_0xf69a('0x0'));var logger=require(_0xf69a('0x1'))(_0xf69a('0x2'));var moment=require(_0xf69a('0x3'));var BPromise=require(_0xf69a('0x4'));var rp=require(_0xf69a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf69a('0x6'));var config=require(_0xf69a('0x7'));var attributes=require(_0xf69a('0x8'));module[_0xf69a('0x9')]=function(_0x723700,_0x5953c9){return _0x723700[_0xf69a('0xa')](_0xf69a('0xb'),attributes,{'tableName':_0xf69a('0xc'),'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 7a78211..bf6362a 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 _0x2899=['ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','info'];(function(_0x2be4ba,_0x3653f0){var _0x1fad73=function(_0x56b47b){while(--_0x56b47b){_0x2be4ba['push'](_0x2be4ba['shift']());}};_0x1fad73(++_0x3653f0);}(_0x2899,0xfe));var _0x9289=function(_0x2b0b03,_0x2a81e4){_0x2b0b03=_0x2b0b03-0x0;var _0x42d297=_0x2899[_0x2b0b03];return _0x42d297;};'use strict';var _=require(_0x9289('0x0'));var util=require(_0x9289('0x1'));var moment=require(_0x9289('0x2'));var BPromise=require(_0x9289('0x3'));var rs=require(_0x9289('0x4'));var fs=require('fs');var Redis=require(_0x9289('0x5'));var db=require(_0x9289('0x6'))['db'];var utils=require(_0x9289('0x7'));var logger=require(_0x9289('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9289('0x9'));var client=jayson['client'][_0x9289('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c6e49,_0x4af961,_0x4e4011){return new BPromise(function(_0x533362,_0x48a40e){return client['request'](_0x5c6e49,_0x4e4011)['then'](function(_0x23dc0a){logger[_0x9289('0xb')](_0x9289('0xc'),_0x4af961,_0x9289('0xd'));logger[_0x9289('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x4af961,_0x9289('0xd'),JSON[_0x9289('0xf')](_0x23dc0a));if(_0x23dc0a[_0x9289('0x10')]){if(_0x23dc0a[_0x9289('0x10')][_0x9289('0x11')]===0x1f4){logger[_0x9289('0x10')](_0x9289('0xc'),_0x4af961,_0x23dc0a[_0x9289('0x10')][_0x9289('0x12')]);return _0x48a40e(_0x23dc0a[_0x9289('0x10')][_0x9289('0x12')]);}logger['error'](_0x9289('0xc'),_0x4af961,_0x23dc0a['error'][_0x9289('0x12')]);return _0x533362(_0x23dc0a[_0x9289('0x10')][_0x9289('0x12')]);}else{logger[_0x9289('0xb')](_0x9289('0xc'),_0x4af961,_0x9289('0xd'));_0x533362(_0x23dc0a['result']['message']);}})['catch'](function(_0x8899a9){logger[_0x9289('0x10')](_0x9289('0xc'),_0x4af961,_0x8899a9);_0x48a40e(_0x8899a9);});});} \ No newline at end of file +var _0x5652=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x30ee8c,_0x5b70b5){var _0x30e2ce=function(_0x499d18){while(--_0x499d18){_0x30ee8c['push'](_0x30ee8c['shift']());}};_0x30e2ce(++_0x5b70b5);}(_0x5652,0xea));var _0x2565=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0x5652[_0x2341c6];return _0x54c34d;};'use strict';var _=require(_0x2565('0x0'));var util=require(_0x2565('0x1'));var moment=require(_0x2565('0x2'));var BPromise=require(_0x2565('0x3'));var rs=require(_0x2565('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2565('0x5'))['db'];var utils=require(_0x2565('0x6'));var logger=require(_0x2565('0x7'))('rpc');var config=require(_0x2565('0x8'));var jayson=require(_0x2565('0x9'));var client=jayson[_0x2565('0xa')][_0x2565('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3968d9,_0x38444f,_0x261402){return new BPromise(function(_0x1ccd55,_0x751b5a){return client[_0x2565('0xc')](_0x3968d9,_0x261402)[_0x2565('0xd')](function(_0x5cdab6){logger[_0x2565('0xe')](_0x2565('0xf'),_0x38444f,_0x2565('0x10'));logger[_0x2565('0x11')](_0x2565('0x12'),_0x38444f,_0x2565('0x10'),JSON['stringify'](_0x5cdab6));if(_0x5cdab6[_0x2565('0x13')]){if(_0x5cdab6['error'][_0x2565('0x14')]===0x1f4){logger['error'](_0x2565('0xf'),_0x38444f,_0x5cdab6[_0x2565('0x13')][_0x2565('0x15')]);return _0x751b5a(_0x5cdab6[_0x2565('0x13')]['message']);}logger[_0x2565('0x13')](_0x2565('0xf'),_0x38444f,_0x5cdab6[_0x2565('0x13')][_0x2565('0x15')]);return _0x1ccd55(_0x5cdab6[_0x2565('0x13')][_0x2565('0x15')]);}else{logger['info'](_0x2565('0xf'),_0x38444f,_0x2565('0x10'));_0x1ccd55(_0x5cdab6['result']['message']);}})[_0x2565('0x16')](function(_0x56a24e){logger[_0x2565('0x13')](_0x2565('0xf'),_0x38444f,_0x56a24e);_0x751b5a(_0x56a24e);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f229c62..a193501 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 _0x3f66=['show','post','isAuthenticated','create','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id'];(function(_0x4992be,_0x555abf){var _0x39e44e=function(_0x286e9f){while(--_0x286e9f){_0x4992be['push'](_0x4992be['shift']());}};_0x39e44e(++_0x555abf);}(_0x3f66,0x185));var _0x63f6=function(_0x3b4932,_0x6ff5be){_0x3b4932=_0x3b4932-0x0;var _0x2b36c9=_0x3f66[_0x3b4932];return _0x2b36c9;};'use strict';var multer=require('multer');var util=require(_0x63f6('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x63f6('0x1'));var router=express[_0x63f6('0x2')]();var fs_extra=require(_0x63f6('0x3'));var auth=require(_0x63f6('0x4'));var interaction=require(_0x63f6('0x5'));var config=require(_0x63f6('0x6'));var controller=require(_0x63f6('0x7'));router[_0x63f6('0x8')]('/',auth['isAuthenticated'](),controller[_0x63f6('0x9')]);router['get'](_0x63f6('0xa'),auth['isAuthenticated'](),controller[_0x63f6('0xb')]);router[_0x63f6('0xc')]('/',auth[_0x63f6('0xd')](),controller[_0x63f6('0xe')]);router[_0x63f6('0xf')]('/:id',auth[_0x63f6('0xd')](),controller[_0x63f6('0x10')]);router[_0x63f6('0x11')](_0x63f6('0xa'),auth[_0x63f6('0xd')](),controller[_0x63f6('0x12')]);module[_0x63f6('0x13')]=router; \ No newline at end of file +var _0xd260=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','post','put','/:id','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x1563c9,_0x216427){var _0x583f13=function(_0x36819a){while(--_0x36819a){_0x1563c9['push'](_0x1563c9['shift']());}};_0x583f13(++_0x216427);}(_0xd260,0x94));var _0x0d26=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0xd260[_0x55c1f0];return _0x1530fa;};'use strict';var multer=require('multer');var util=require(_0x0d26('0x0'));var path=require(_0x0d26('0x1'));var timeout=require(_0x0d26('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0d26('0x3'));var auth=require(_0x0d26('0x4'));var interaction=require(_0x0d26('0x5'));var config=require(_0x0d26('0x6'));var controller=require(_0x0d26('0x7'));router[_0x0d26('0x8')]('/',auth[_0x0d26('0x9')](),controller[_0x0d26('0xa')]);router[_0x0d26('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0d26('0xb')]);router[_0x0d26('0xc')]('/',auth[_0x0d26('0x9')](),controller['create']);router[_0x0d26('0xd')](_0x0d26('0xe'),auth[_0x0d26('0x9')](),controller['update']);router['delete'](_0x0d26('0xe'),auth[_0x0d26('0x9')](),controller[_0x0d26('0xf')]);module[_0x0d26('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 2108260..89827e5 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 _0xd2ba=['customVariable','sequelize','exports','ENUM','string','variable','STRING'];(function(_0x2482dd,_0x4280df){var _0x533faf=function(_0x31e72b){while(--_0x31e72b){_0x2482dd['push'](_0x2482dd['shift']());}};_0x533faf(++_0x4280df);}(_0xd2ba,0x10b));var _0xad2b=function(_0x31e2cd,_0x4c05ba){_0x31e2cd=_0x31e2cd-0x0;var _0x48af4e=_0xd2ba[_0x31e2cd];return _0x48af4e;};'use strict';var Sequelize=require(_0xad2b('0x0'));module[_0xad2b('0x1')]={'type':{'type':Sequelize[_0xad2b('0x2')](_0xad2b('0x3'),_0xad2b('0x4'),'customVariable','keyValue','picklist'),'defaultValue':_0xad2b('0x3')},'content':{'type':Sequelize[_0xad2b('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xad2b('0x2')](_0xad2b('0x3'),_0xad2b('0x4'),_0xad2b('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xad2b('0x5')]},'nameField':{'type':Sequelize[_0xad2b('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xad2b('0x5')]}}; \ No newline at end of file +var _0x9cb6=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x213e14,_0x3f4564){var _0xe1d980=function(_0x30a6e9){while(--_0x30a6e9){_0x213e14['push'](_0x213e14['shift']());}};_0xe1d980(++_0x3f4564);}(_0x9cb6,0x6c));var _0x69cb=function(_0x16583a,_0x204bf6){_0x16583a=_0x16583a-0x0;var _0x39ff12=_0x9cb6[_0x16583a];return _0x39ff12;};'use strict';var Sequelize=require(_0x69cb('0x0'));module[_0x69cb('0x1')]={'type':{'type':Sequelize[_0x69cb('0x2')]('string',_0x69cb('0x3'),_0x69cb('0x4'),_0x69cb('0x5'),_0x69cb('0x6')),'defaultValue':_0x69cb('0x7')},'content':{'type':Sequelize[_0x69cb('0x8')]},'key':{'type':Sequelize[_0x69cb('0x8')]},'keyType':{'type':Sequelize[_0x69cb('0x2')](_0x69cb('0x7'),'variable',_0x69cb('0x4'))},'keyContent':{'type':Sequelize[_0x69cb('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x69cb('0x8')]},'customField':{'type':Sequelize[_0x69cb('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x69cb('0x8')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 522904b..342cfb4 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 _0x82fc=['find','params','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','destroy','then','end','error','stack','send','map','ServicenowField','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','create','body','update'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x82fc,0x122));var _0xc82f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x82fc[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc82f('0x0'));var zipdir=require(_0xc82f('0x1'));var jsonpatch=require(_0xc82f('0x2'));var rp=require('request-promise');var moment=require(_0xc82f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc82f('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc82f('0x5'));var csv=require(_0xc82f('0x6'));var ejs=require(_0xc82f('0x7'));var fs=require('fs');var fs_extra=require(_0xc82f('0x8'));var _=require(_0xc82f('0x9'));var squel=require('squel');var crypto=require(_0xc82f('0xa'));var jsforce=require(_0xc82f('0xb'));var deskjs=require(_0xc82f('0xc'));var toCsv=require(_0xc82f('0x6'));var querystring=require(_0xc82f('0xd'));var Papa=require(_0xc82f('0xe'));var Redis=require(_0xc82f('0xf'));var authService=require(_0xc82f('0x10'));var qs=require(_0xc82f('0x11'));var as=require(_0xc82f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc82f('0x13'))(_0xc82f('0x14'));var utils=require('../../config/utils');var config=require(_0xc82f('0x15'));var licenseUtil=require(_0xc82f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d3a46,_0x5a89da){_0x5a89da=_0x5a89da||0xcc;return function(_0x3bc406){if(_0x3bc406){return _0x3d3a46[_0xc82f('0x17')](_0x5a89da);}return _0x3d3a46[_0xc82f('0x18')](_0x5a89da)['end']();};}function respondWithResult(_0x381a33,_0x560a5c){_0x560a5c=_0x560a5c||0xc8;return function(_0x23f0ee){if(_0x23f0ee){return _0x381a33[_0xc82f('0x18')](_0x560a5c)[_0xc82f('0x19')](_0x23f0ee);}};}function respondWithFilteredResult(_0x4af542,_0x22cf3d){return function(_0x5a3347){if(_0x5a3347){var _0x503e4b=typeof _0x22cf3d[_0xc82f('0x1a')]===_0xc82f('0x1b')&&typeof _0x22cf3d['limit']===_0xc82f('0x1b');var _0x60e500=_0x5a3347[_0xc82f('0x1c')];var _0x9d34b3=_0x503e4b?0x0:_0x22cf3d[_0xc82f('0x1a')];var _0x21087e=_0x503e4b?_0x5a3347[_0xc82f('0x1c')]:_0x22cf3d[_0xc82f('0x1a')]+_0x22cf3d['limit'];var _0x1f58c4;if(_0x21087e>=_0x60e500){_0x21087e=_0x60e500;_0x1f58c4=0xc8;}else{_0x1f58c4=0xce;}_0x4af542[_0xc82f('0x18')](_0x1f58c4);return _0x4af542[_0xc82f('0x1d')](_0xc82f('0x1e'),_0x9d34b3+'-'+_0x21087e+'/'+_0x60e500)[_0xc82f('0x19')](_0x5a3347);}return null;};}function patchUpdates(_0x62e99f){return function(_0x335992){try{jsonpatch[_0xc82f('0x1f')](_0x335992,_0x62e99f,!![]);}catch(_0x10da86){return BPromise[_0xc82f('0x20')](_0x10da86);}return _0x335992['save']();};}function saveUpdates(_0x201069,_0xef5855){return function(_0xda94c0){if(_0xda94c0){return _0xda94c0['update'](_0x201069)['then'](function(_0x3f5372){return _0x3f5372;});}return null;};}function removeEntity(_0x14b384,_0x3bfbd7){return function(_0x816b9){if(_0x816b9){return _0x816b9[_0xc82f('0x21')]()[_0xc82f('0x22')](function(){_0x14b384[_0xc82f('0x18')](0xcc)[_0xc82f('0x23')]();});}};}function handleEntityNotFound(_0x2169a5,_0x3c7abf){return function(_0x547840){if(!_0x547840){_0x2169a5[_0xc82f('0x17')](0x194);}return _0x547840;};}function handleError(_0x14353d,_0x265f0d){_0x265f0d=_0x265f0d||0x1f4;return function(_0x28ad0a){logger[_0xc82f('0x24')](_0x28ad0a[_0xc82f('0x25')]);if(_0x28ad0a['name']){delete _0x28ad0a['name'];}_0x14353d['status'](_0x265f0d)[_0xc82f('0x26')](_0x28ad0a);};}exports['index']=function(_0x3282b0,_0x463c4e){var _0x2fa035={},_0x51d9b0={},_0x48ec9c={'count':0x0,'rows':[]};var _0x4998fc=_[_0xc82f('0x27')](db[_0xc82f('0x28')][_0xc82f('0x29')],function(_0x6b8799){return{'name':_0x6b8799['fieldName'],'type':_0x6b8799[_0xc82f('0x2a')][_0xc82f('0x2b')]};});_0x51d9b0[_0xc82f('0x2c')]=_[_0xc82f('0x27')](_0x4998fc,_0xc82f('0x2d'));_0x51d9b0[_0xc82f('0x2e')]=_[_0xc82f('0x2f')](_0x3282b0[_0xc82f('0x2e')]);_0x51d9b0[_0xc82f('0x30')]=_[_0xc82f('0x31')](_0x51d9b0['model'],_0x51d9b0[_0xc82f('0x2e')]);_0x2fa035[_0xc82f('0x32')]=_[_0xc82f('0x31')](_0x51d9b0[_0xc82f('0x2c')],qs[_0xc82f('0x33')](_0x3282b0[_0xc82f('0x2e')][_0xc82f('0x33')]));_0x2fa035[_0xc82f('0x32')]=_0x2fa035[_0xc82f('0x32')][_0xc82f('0x34')]?_0x2fa035['attributes']:_0x51d9b0['model'];if(!_0x3282b0['query'][_0xc82f('0x35')]('nolimit')){_0x2fa035['limit']=qs[_0xc82f('0x36')](_0x3282b0['query']['limit']);_0x2fa035[_0xc82f('0x1a')]=qs[_0xc82f('0x1a')](_0x3282b0[_0xc82f('0x2e')][_0xc82f('0x1a')]);}_0x2fa035['order']=qs[_0xc82f('0x37')](_0x3282b0[_0xc82f('0x2e')][_0xc82f('0x37')]);_0x2fa035['where']=qs[_0xc82f('0x30')](_[_0xc82f('0x38')](_0x3282b0[_0xc82f('0x2e')],_0x51d9b0[_0xc82f('0x30')]),_0x4998fc);if(_0x3282b0[_0xc82f('0x2e')][_0xc82f('0x39')]){_0x2fa035[_0xc82f('0x3a')]=_['merge'](_0x2fa035[_0xc82f('0x3a')],{'$or':_[_0xc82f('0x27')](_0x4998fc,function(_0x3c6f1a){if(_0x3c6f1a[_0xc82f('0x2a')]!==_0xc82f('0x3b')){var _0x13d7de={};_0x13d7de[_0x3c6f1a['name']]={'$like':'%'+_0x3282b0['query'][_0xc82f('0x39')]+'%'};return _0x13d7de;}})});}_0x2fa035=_[_0xc82f('0x3c')]({},_0x2fa035,_0x3282b0[_0xc82f('0x3d')]);var _0x596bb2={'where':_0x2fa035[_0xc82f('0x3a')]};return db[_0xc82f('0x28')][_0xc82f('0x1c')](_0x596bb2)['then'](function(_0x3d3b5c){_0x48ec9c[_0xc82f('0x1c')]=_0x3d3b5c;if(_0x3282b0[_0xc82f('0x2e')][_0xc82f('0x3e')]){_0x2fa035[_0xc82f('0x3f')]=[{'all':!![]}];}return db[_0xc82f('0x28')][_0xc82f('0x40')](_0x2fa035);})[_0xc82f('0x22')](function(_0x4218da){_0x48ec9c[_0xc82f('0x41')]=_0x4218da;return _0x48ec9c;})['then'](respondWithFilteredResult(_0x463c4e,_0x2fa035))[_0xc82f('0x42')](handleError(_0x463c4e,null));};exports['show']=function(_0x2ffde2,_0x282793){var _0x2fcbad={'raw':!![],'where':{'id':_0x2ffde2['params']['id']}},_0x73c48e={};_0x73c48e[_0xc82f('0x2c')]=_[_0xc82f('0x2f')](db[_0xc82f('0x28')][_0xc82f('0x29')]);_0x73c48e[_0xc82f('0x2e')]=_[_0xc82f('0x2f')](_0x2ffde2['query']);_0x73c48e[_0xc82f('0x30')]=_['intersection'](_0x73c48e[_0xc82f('0x2c')],_0x73c48e[_0xc82f('0x2e')]);_0x2fcbad[_0xc82f('0x32')]=_[_0xc82f('0x31')](_0x73c48e['model'],qs[_0xc82f('0x33')](_0x2ffde2[_0xc82f('0x2e')][_0xc82f('0x33')]));_0x2fcbad['attributes']=_0x2fcbad['attributes'][_0xc82f('0x34')]?_0x2fcbad[_0xc82f('0x32')]:_0x73c48e['model'];if(_0x2ffde2[_0xc82f('0x2e')][_0xc82f('0x3e')]){_0x2fcbad['include']=[{'all':!![]}];}_0x2fcbad=_[_0xc82f('0x3c')]({},_0x2fcbad,_0x2ffde2[_0xc82f('0x3d')]);return db['ServicenowField']['find'](_0x2fcbad)[_0xc82f('0x22')](handleEntityNotFound(_0x282793,null))[_0xc82f('0x22')](respondWithResult(_0x282793,null))['catch'](handleError(_0x282793,null));};exports[_0xc82f('0x43')]=function(_0x406289,_0x3217e4){return db[_0xc82f('0x28')]['create'](_0x406289[_0xc82f('0x44')],{})[_0xc82f('0x22')](respondWithResult(_0x3217e4,0xc9))[_0xc82f('0x42')](handleError(_0x3217e4,null));};exports[_0xc82f('0x45')]=function(_0x367187,_0x27c6cf){if(_0x367187[_0xc82f('0x44')]['id']){delete _0x367187[_0xc82f('0x44')]['id'];}return db['ServicenowField'][_0xc82f('0x46')]({'where':{'id':_0x367187[_0xc82f('0x47')]['id']}})[_0xc82f('0x22')](handleEntityNotFound(_0x27c6cf,null))[_0xc82f('0x22')](saveUpdates(_0x367187[_0xc82f('0x44')],null))[_0xc82f('0x22')](respondWithResult(_0x27c6cf,null))['catch'](handleError(_0x27c6cf,null));};exports[_0xc82f('0x21')]=function(_0xbc4400,_0x4953f6){return db[_0xc82f('0x28')][_0xc82f('0x46')]({'where':{'id':_0xbc4400['params']['id']}})[_0xc82f('0x22')](handleEntityNotFound(_0x4953f6,null))['then'](removeEntity(_0x4953f6,null))[_0xc82f('0x42')](handleError(_0x4953f6,null));}; \ No newline at end of file +var _0xf3d2=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','end','error','name','send','index','map','ServicenowField','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','options','includeAll','include','catch','params','keys','merge','find','create','body','destroy'];(function(_0x4fa892,_0x4e66a0){var _0x260ef6=function(_0x3ac4a5){while(--_0x3ac4a5){_0x4fa892['push'](_0x4fa892['shift']());}};_0x260ef6(++_0x4e66a0);}(_0xf3d2,0x1b0));var _0x2f3d=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0xf3d2[_0x431ff8];return _0x84ccd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f3d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f3d('0x1'));var rp=require(_0x2f3d('0x2'));var moment=require(_0x2f3d('0x3'));var BPromise=require(_0x2f3d('0x4'));var Mustache=require(_0x2f3d('0x5'));var util=require(_0x2f3d('0x6'));var path=require('path');var sox=require(_0x2f3d('0x7'));var csv=require('to-csv');var ejs=require(_0x2f3d('0x8'));var fs=require('fs');var fs_extra=require(_0x2f3d('0x9'));var _=require(_0x2f3d('0xa'));var squel=require(_0x2f3d('0xb'));var crypto=require(_0x2f3d('0xc'));var jsforce=require(_0x2f3d('0xd'));var deskjs=require(_0x2f3d('0xe'));var toCsv=require(_0x2f3d('0xf'));var querystring=require(_0x2f3d('0x10'));var Papa=require('papaparse');var Redis=require(_0x2f3d('0x11'));var authService=require(_0x2f3d('0x12'));var qs=require(_0x2f3d('0x13'));var as=require(_0x2f3d('0x14'));var hardwareService=require(_0x2f3d('0x15'));var logger=require(_0x2f3d('0x16'))(_0x2f3d('0x17'));var utils=require(_0x2f3d('0x18'));var config=require(_0x2f3d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f3d('0x1a'))['db'];function respondWithStatusCode(_0x2743a6,_0x13cdeb){_0x13cdeb=_0x13cdeb||0xcc;return function(_0x2c5626){if(_0x2c5626){return _0x2743a6[_0x2f3d('0x1b')](_0x13cdeb);}return _0x2743a6[_0x2f3d('0x1c')](_0x13cdeb)['end']();};}function respondWithResult(_0x2e2e28,_0x188161){_0x188161=_0x188161||0xc8;return function(_0x1573b6){if(_0x1573b6){return _0x2e2e28[_0x2f3d('0x1c')](_0x188161)['json'](_0x1573b6);}};}function respondWithFilteredResult(_0x5237a6,_0x1e0148){return function(_0x31a0d8){if(_0x31a0d8){var _0x4699fe=typeof _0x1e0148[_0x2f3d('0x1d')]==='undefined'&&typeof _0x1e0148[_0x2f3d('0x1e')]===_0x2f3d('0x1f');var _0x2a1b62=_0x31a0d8[_0x2f3d('0x20')];var _0x55e2cb=_0x4699fe?0x0:_0x1e0148[_0x2f3d('0x1d')];var _0x54bcb4=_0x4699fe?_0x31a0d8[_0x2f3d('0x20')]:_0x1e0148[_0x2f3d('0x1d')]+_0x1e0148[_0x2f3d('0x1e')];var _0x2cd8e4;if(_0x54bcb4>=_0x2a1b62){_0x54bcb4=_0x2a1b62;_0x2cd8e4=0xc8;}else{_0x2cd8e4=0xce;}_0x5237a6[_0x2f3d('0x1c')](_0x2cd8e4);return _0x5237a6[_0x2f3d('0x21')](_0x2f3d('0x22'),_0x55e2cb+'-'+_0x54bcb4+'/'+_0x2a1b62)[_0x2f3d('0x23')](_0x31a0d8);}return null;};}function patchUpdates(_0x4b83aa){return function(_0x579271){try{jsonpatch[_0x2f3d('0x24')](_0x579271,_0x4b83aa,!![]);}catch(_0x33f908){return BPromise['reject'](_0x33f908);}return _0x579271[_0x2f3d('0x25')]();};}function saveUpdates(_0x23540f,_0x64c572){return function(_0xb3e9e2){if(_0xb3e9e2){return _0xb3e9e2[_0x2f3d('0x26')](_0x23540f)[_0x2f3d('0x27')](function(_0x4fd8aa){return _0x4fd8aa;});}return null;};}function removeEntity(_0x102f90,_0x3143e9){return function(_0x271993){if(_0x271993){return _0x271993['destroy']()[_0x2f3d('0x27')](function(){_0x102f90[_0x2f3d('0x1c')](0xcc)[_0x2f3d('0x28')]();});}};}function handleEntityNotFound(_0x5758d4,_0x42bbe9){return function(_0x516e96){if(!_0x516e96){_0x5758d4['sendStatus'](0x194);}return _0x516e96;};}function handleError(_0x246e30,_0x229ec7){_0x229ec7=_0x229ec7||0x1f4;return function(_0x282200){logger[_0x2f3d('0x29')](_0x282200['stack']);if(_0x282200[_0x2f3d('0x2a')]){delete _0x282200['name'];}_0x246e30[_0x2f3d('0x1c')](_0x229ec7)[_0x2f3d('0x2b')](_0x282200);};}exports[_0x2f3d('0x2c')]=function(_0x4de9a8,_0x282691){var _0x2b35ec={},_0x50beef={},_0x14a07e={'count':0x0,'rows':[]};var _0x40cf78=_[_0x2f3d('0x2d')](db[_0x2f3d('0x2e')][_0x2f3d('0x2f')],function(_0x474364){return{'name':_0x474364['fieldName'],'type':_0x474364[_0x2f3d('0x30')]['key']};});_0x50beef[_0x2f3d('0x31')]=_['map'](_0x40cf78,_0x2f3d('0x2a'));_0x50beef[_0x2f3d('0x32')]=_['keys'](_0x4de9a8[_0x2f3d('0x32')]);_0x50beef[_0x2f3d('0x33')]=_['intersection'](_0x50beef[_0x2f3d('0x31')],_0x50beef[_0x2f3d('0x32')]);_0x2b35ec[_0x2f3d('0x34')]=_[_0x2f3d('0x35')](_0x50beef['model'],qs[_0x2f3d('0x36')](_0x4de9a8['query'][_0x2f3d('0x36')]));_0x2b35ec[_0x2f3d('0x34')]=_0x2b35ec['attributes'][_0x2f3d('0x37')]?_0x2b35ec['attributes']:_0x50beef['model'];if(!_0x4de9a8[_0x2f3d('0x32')][_0x2f3d('0x38')]('nolimit')){_0x2b35ec[_0x2f3d('0x1e')]=qs[_0x2f3d('0x1e')](_0x4de9a8[_0x2f3d('0x32')][_0x2f3d('0x1e')]);_0x2b35ec[_0x2f3d('0x1d')]=qs[_0x2f3d('0x1d')](_0x4de9a8[_0x2f3d('0x32')]['offset']);}_0x2b35ec[_0x2f3d('0x39')]=qs[_0x2f3d('0x3a')](_0x4de9a8[_0x2f3d('0x32')]['sort']);_0x2b35ec[_0x2f3d('0x3b')]=qs['filters'](_['pick'](_0x4de9a8[_0x2f3d('0x32')],_0x50beef[_0x2f3d('0x33')]),_0x40cf78);if(_0x4de9a8[_0x2f3d('0x32')][_0x2f3d('0x3c')]){_0x2b35ec[_0x2f3d('0x3b')]=_['merge'](_0x2b35ec[_0x2f3d('0x3b')],{'$or':_[_0x2f3d('0x2d')](_0x40cf78,function(_0xb00895){if(_0xb00895[_0x2f3d('0x30')]!=='VIRTUAL'){var _0x269bf4={};_0x269bf4[_0xb00895[_0x2f3d('0x2a')]]={'$like':'%'+_0x4de9a8['query'][_0x2f3d('0x3c')]+'%'};return _0x269bf4;}})});}_0x2b35ec=_['merge']({},_0x2b35ec,_0x4de9a8[_0x2f3d('0x3d')]);var _0x191934={'where':_0x2b35ec[_0x2f3d('0x3b')]};return db['ServicenowField'][_0x2f3d('0x20')](_0x191934)[_0x2f3d('0x27')](function(_0x37c6aa){_0x14a07e[_0x2f3d('0x20')]=_0x37c6aa;if(_0x4de9a8[_0x2f3d('0x32')][_0x2f3d('0x3e')]){_0x2b35ec[_0x2f3d('0x3f')]=[{'all':!![]}];}return db[_0x2f3d('0x2e')]['findAll'](_0x2b35ec);})['then'](function(_0x3d96fe){_0x14a07e['rows']=_0x3d96fe;return _0x14a07e;})[_0x2f3d('0x27')](respondWithFilteredResult(_0x282691,_0x2b35ec))[_0x2f3d('0x40')](handleError(_0x282691,null));};exports['show']=function(_0x109e5b,_0x223c45){var _0x53a576={'raw':!![],'where':{'id':_0x109e5b[_0x2f3d('0x41')]['id']}},_0x4abdc0={};_0x4abdc0[_0x2f3d('0x31')]=_['keys'](db[_0x2f3d('0x2e')][_0x2f3d('0x2f')]);_0x4abdc0['query']=_[_0x2f3d('0x42')](_0x109e5b[_0x2f3d('0x32')]);_0x4abdc0[_0x2f3d('0x33')]=_['intersection'](_0x4abdc0['model'],_0x4abdc0[_0x2f3d('0x32')]);_0x53a576[_0x2f3d('0x34')]=_['intersection'](_0x4abdc0[_0x2f3d('0x31')],qs[_0x2f3d('0x36')](_0x109e5b[_0x2f3d('0x32')][_0x2f3d('0x36')]));_0x53a576[_0x2f3d('0x34')]=_0x53a576['attributes'][_0x2f3d('0x37')]?_0x53a576[_0x2f3d('0x34')]:_0x4abdc0['model'];if(_0x109e5b[_0x2f3d('0x32')][_0x2f3d('0x3e')]){_0x53a576[_0x2f3d('0x3f')]=[{'all':!![]}];}_0x53a576=_[_0x2f3d('0x43')]({},_0x53a576,_0x109e5b[_0x2f3d('0x3d')]);return db['ServicenowField'][_0x2f3d('0x44')](_0x53a576)['then'](handleEntityNotFound(_0x223c45,null))[_0x2f3d('0x27')](respondWithResult(_0x223c45,null))['catch'](handleError(_0x223c45,null));};exports[_0x2f3d('0x45')]=function(_0xf23286,_0x5e1adf){return db[_0x2f3d('0x2e')][_0x2f3d('0x45')](_0xf23286['body'],{})['then'](respondWithResult(_0x5e1adf,0xc9))[_0x2f3d('0x40')](handleError(_0x5e1adf,null));};exports[_0x2f3d('0x26')]=function(_0x4c65a2,_0x3ffe54){if(_0x4c65a2[_0x2f3d('0x46')]['id']){delete _0x4c65a2[_0x2f3d('0x46')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x4c65a2[_0x2f3d('0x41')]['id']}})[_0x2f3d('0x27')](handleEntityNotFound(_0x3ffe54,null))['then'](saveUpdates(_0x4c65a2[_0x2f3d('0x46')],null))[_0x2f3d('0x27')](respondWithResult(_0x3ffe54,null))[_0x2f3d('0x40')](handleError(_0x3ffe54,null));};exports[_0x2f3d('0x47')]=function(_0x32ca64,_0x2db599){return db[_0x2f3d('0x2e')]['find']({'where':{'id':_0x32ca64[_0x2f3d('0x41')]['id']}})[_0x2f3d('0x27')](handleEntityNotFound(_0x2db599,null))[_0x2f3d('0x27')](removeEntity(_0x2db599,null))[_0x2f3d('0x40')](handleError(_0x2db599,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index c233705..ecd56e0 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 _0x9ade=['define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x9ade,0x8e));var _0xe9ad=function(_0x2ed1a0,_0x36acd9){_0x2ed1a0=_0x2ed1a0-0x0;var _0x3d272e=_0x9ade[_0x2ed1a0];return _0x3d272e;};'use strict';var _=require(_0xe9ad('0x0'));var util=require(_0xe9ad('0x1'));var logger=require(_0xe9ad('0x2'))(_0xe9ad('0x3'));var moment=require(_0xe9ad('0x4'));var BPromise=require(_0xe9ad('0x5'));var rp=require(_0xe9ad('0x6'));var fs=require('fs');var path=require(_0xe9ad('0x7'));var rimraf=require(_0xe9ad('0x8'));var config=require(_0xe9ad('0x9'));var attributes=require('./intServicenowField.attributes');module[_0xe9ad('0xa')]=function(_0x53b3f7,_0x5cf047){return _0x53b3f7[_0xe9ad('0xb')](_0xe9ad('0xc'),attributes,{'tableName':_0xe9ad('0xd'),'paranoid':![],'indexes':[{'name':_0xe9ad('0xe'),'fields':[_0xe9ad('0xf'),_0xe9ad('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x55e6=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField'];(function(_0x54a77b,_0x3055af){var _0x55b372=function(_0x1c1f0f){while(--_0x1c1f0f){_0x54a77b['push'](_0x54a77b['shift']());}};_0x55b372(++_0x3055af);}(_0x55e6,0x74));var _0x655e=function(_0x2a64a9,_0x29a676){_0x2a64a9=_0x2a64a9-0x0;var _0xf85694=_0x55e6[_0x2a64a9];return _0xf85694;};'use strict';var _=require(_0x655e('0x0'));var util=require(_0x655e('0x1'));var logger=require(_0x655e('0x2'))(_0x655e('0x3'));var moment=require(_0x655e('0x4'));var BPromise=require('bluebird');var rp=require(_0x655e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x655e('0x6'));var config=require(_0x655e('0x7'));var attributes=require(_0x655e('0x8'));module[_0x655e('0x9')]=function(_0x2bdb53,_0xf3dedd){return _0x2bdb53[_0x655e('0xa')](_0x655e('0xb'),attributes,{'tableName':_0x655e('0xc'),'paranoid':![],'indexes':[{'name':_0x655e('0xd'),'fields':[_0x655e('0xe'),_0x655e('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 45352de..f30ad69 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 _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4287b0,_0x5e551c){var _0x1e6a1e=function(_0x1b2735){while(--_0x1b2735){_0x4287b0['push'](_0x4287b0['shift']());}};_0x1e6a1e(++_0x5e551c);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2bc559,_0x1a3024){_0x2bc559=_0x2bc559-0x0;var _0x1aeb02=_0xf4eb[_0x2bc559];return _0x1aeb02;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x27c15a,_0x2c008d){var _0x2ea22a=function(_0x369f93){while(--_0x369f93){_0x27c15a['push'](_0x27c15a['shift']());}};_0x2ea22a(++_0x2c008d);}(_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')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 094962a..b9d8685 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(_0x26387c,_0x537788){var _0x2ff342=function(_0x4721b1){while(--_0x4721b1){_0x26387c['push'](_0x26387c['shift']());}};_0x2ff342(++_0x537788);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x2e1eb9,_0x4f536b){var _0x5ec21b=function(_0x40c994){while(--_0x40c994){_0x2e1eb9['push'](_0x2e1eb9['shift']());}};_0x5ec21b(++_0x4f536b);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 16b9f7a..20ace93 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(_0xbc5680,_0xd0710b){var _0x1a9f8a=function(_0xbe595e){while(--_0xbe595e){_0xbc5680['push'](_0xbc5680['shift']());}};_0x1a9f8a(++_0xd0710b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0xfd2fb7,_0x3c054c){var _0x23dad2=function(_0x593009){while(--_0x593009){_0xfd2fb7['push'](_0xfd2fb7['shift']());}};_0x23dad2(++_0x3c054c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index c6b5697..dc8f179 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 _0xe381=['duration_minutes','parent_type','parent_name','direction','password','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','username','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','values','module_fields','includes','label','endsWith','error','test','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','offset','count','Content-Range','save','update','then','destroy','end','stack','name','send','index','SugarcrmAccount','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','params','rawAttributes','includeAll','include','options','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','addConfiguration','AccountId','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','date_start'];(function(_0x101842,_0x4db31b){var _0x45ce04=function(_0x1754a3){while(--_0x1754a3){_0x101842['push'](_0x101842['shift']());}};_0x45ce04(++_0x4db31b);}(_0xe381,0x93));var _0x1e38=function(_0xa041de,_0x3600e2){_0xa041de=_0xa041de-0x0;var _0x1d654c=_0xe381[_0xa041de];return _0x1d654c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e38('0x0'));var zipdir=require(_0x1e38('0x1'));var jsonpatch=require(_0x1e38('0x2'));var rp=require(_0x1e38('0x3'));var moment=require(_0x1e38('0x4'));var BPromise=require(_0x1e38('0x5'));var Mustache=require(_0x1e38('0x6'));var util=require(_0x1e38('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x1e38('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e38('0x9'));var _=require(_0x1e38('0xa'));var squel=require(_0x1e38('0xb'));var crypto=require(_0x1e38('0xc'));var jsforce=require(_0x1e38('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1e38('0x8'));var querystring=require(_0x1e38('0xe'));var Papa=require(_0x1e38('0xf'));var Redis=require(_0x1e38('0x10'));var authService=require(_0x1e38('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1e38('0x12'));var hardwareService=require(_0x1e38('0x13'));var logger=require(_0x1e38('0x14'))('api');var utils=require(_0x1e38('0x15'));var config=require(_0x1e38('0x16'));var licenseUtil=require(_0x1e38('0x17'));var db=require(_0x1e38('0x18'))['db'];var integrations=require(_0x1e38('0x19'));function respondWithStatusCode(_0x3f90b8,_0x524b3d){_0x524b3d=_0x524b3d||0xcc;return function(_0x50dbfe){if(_0x50dbfe){return _0x3f90b8[_0x1e38('0x1a')](_0x524b3d);}return _0x3f90b8[_0x1e38('0x1b')](_0x524b3d)['end']();};}function respondWithResult(_0x22c68a,_0x27a6b7){_0x27a6b7=_0x27a6b7||0xc8;return function(_0x2b3ed8){if(_0x2b3ed8){return _0x22c68a['status'](_0x27a6b7)[_0x1e38('0x1c')](_0x2b3ed8);}};}function respondWithFilteredResult(_0xa7b92b,_0x2d4ffc){return function(_0x4426af){if(_0x4426af){var _0x1bbc65=typeof _0x2d4ffc['offset']===_0x1e38('0x1d')&&typeof _0x2d4ffc[_0x1e38('0x1e')]==='undefined';var _0x30a7f6=_0x4426af['count'];var _0x5047ed=_0x1bbc65?0x0:_0x2d4ffc[_0x1e38('0x1f')];var _0xd27c7b=_0x1bbc65?_0x4426af[_0x1e38('0x20')]:_0x2d4ffc[_0x1e38('0x1f')]+_0x2d4ffc[_0x1e38('0x1e')];var _0x130fbb;if(_0xd27c7b>=_0x30a7f6){_0xd27c7b=_0x30a7f6;_0x130fbb=0xc8;}else{_0x130fbb=0xce;}_0xa7b92b[_0x1e38('0x1b')](_0x130fbb);return _0xa7b92b['set'](_0x1e38('0x21'),_0x5047ed+'-'+_0xd27c7b+'/'+_0x30a7f6)[_0x1e38('0x1c')](_0x4426af);}return null;};}function patchUpdates(_0x5995de){return function(_0x4ce983){try{jsonpatch['apply'](_0x4ce983,_0x5995de,!![]);}catch(_0x541ec8){return BPromise['reject'](_0x541ec8);}return _0x4ce983[_0x1e38('0x22')]();};}function saveUpdates(_0xc9fffd,_0x1cef5e){return function(_0x1fd42c){if(_0x1fd42c){return _0x1fd42c[_0x1e38('0x23')](_0xc9fffd)[_0x1e38('0x24')](function(_0x493ed9){return _0x493ed9;});}return null;};}function removeEntity(_0x47f809,_0x3549f5){return function(_0x4e3ad5){if(_0x4e3ad5){return _0x4e3ad5[_0x1e38('0x25')]()[_0x1e38('0x24')](function(){_0x47f809[_0x1e38('0x1b')](0xcc)[_0x1e38('0x26')]();});}};}function handleEntityNotFound(_0x7cff9f,_0x256646){return function(_0x46fd26){if(!_0x46fd26){_0x7cff9f[_0x1e38('0x1a')](0x194);}return _0x46fd26;};}function handleError(_0x406845,_0xa90d70){_0xa90d70=_0xa90d70||0x1f4;return function(_0xbc9495){logger['error'](_0xbc9495[_0x1e38('0x27')]);if(_0xbc9495[_0x1e38('0x28')]){delete _0xbc9495['name'];}_0x406845[_0x1e38('0x1b')](_0xa90d70)[_0x1e38('0x29')](_0xbc9495);};}exports[_0x1e38('0x2a')]=function(_0x23fdfb,_0x38fc64){var _0x2e780f={},_0x12ba00={},_0x5ec4e5={'count':0x0,'rows':[]};var _0x3bb609=_['map'](db[_0x1e38('0x2b')]['rawAttributes'],function(_0x3f4c3f){return{'name':_0x3f4c3f[_0x1e38('0x2c')],'type':_0x3f4c3f[_0x1e38('0x2d')][_0x1e38('0x2e')]};});_0x12ba00['model']=_[_0x1e38('0x2f')](_0x3bb609,'name');_0x12ba00[_0x1e38('0x30')]=_[_0x1e38('0x31')](_0x23fdfb[_0x1e38('0x30')]);_0x12ba00[_0x1e38('0x32')]=_[_0x1e38('0x33')](_0x12ba00[_0x1e38('0x34')],_0x12ba00[_0x1e38('0x30')]);_0x2e780f['attributes']=_[_0x1e38('0x33')](_0x12ba00[_0x1e38('0x34')],qs[_0x1e38('0x35')](_0x23fdfb[_0x1e38('0x30')][_0x1e38('0x35')]));_0x2e780f[_0x1e38('0x36')]=_0x2e780f['attributes'][_0x1e38('0x37')]?_0x2e780f[_0x1e38('0x36')]:_0x12ba00['model'];if(!_0x23fdfb['query'][_0x1e38('0x38')](_0x1e38('0x39'))){_0x2e780f[_0x1e38('0x1e')]=qs[_0x1e38('0x1e')](_0x23fdfb[_0x1e38('0x30')][_0x1e38('0x1e')]);_0x2e780f[_0x1e38('0x1f')]=qs[_0x1e38('0x1f')](_0x23fdfb[_0x1e38('0x30')]['offset']);}_0x2e780f['order']=qs['sort'](_0x23fdfb[_0x1e38('0x30')][_0x1e38('0x3a')]);_0x2e780f[_0x1e38('0x3b')]=qs['filters'](_[_0x1e38('0x3c')](_0x23fdfb[_0x1e38('0x30')],_0x12ba00[_0x1e38('0x32')]),_0x3bb609);if(_0x23fdfb['query']['filter']){_0x2e780f[_0x1e38('0x3b')]=_[_0x1e38('0x3d')](_0x2e780f[_0x1e38('0x3b')],{'$or':_[_0x1e38('0x2f')](_0x3bb609,function(_0x259e4b){if(_0x259e4b['type']!==_0x1e38('0x3e')){var _0x49f1b3={};_0x49f1b3[_0x259e4b['name']]={'$like':'%'+_0x23fdfb['query'][_0x1e38('0x3f')]+'%'};return _0x49f1b3;}})});}_0x2e780f=_[_0x1e38('0x3d')]({},_0x2e780f,_0x23fdfb['options']);var _0x1cc0e0={'where':_0x2e780f[_0x1e38('0x3b')]};return db[_0x1e38('0x2b')][_0x1e38('0x20')](_0x1cc0e0)[_0x1e38('0x24')](function(_0x473276){_0x5ec4e5[_0x1e38('0x20')]=_0x473276;if(_0x23fdfb[_0x1e38('0x30')]['includeAll']){_0x2e780f['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x1e38('0x40')](_0x2e780f);})[_0x1e38('0x24')](function(_0xb89254){_0x5ec4e5[_0x1e38('0x41')]=_0xb89254;return _0x5ec4e5;})[_0x1e38('0x24')](respondWithFilteredResult(_0x38fc64,_0x2e780f))[_0x1e38('0x42')](handleError(_0x38fc64,null));};exports[_0x1e38('0x43')]=function(_0x2c31c7,_0x3146f3){var _0x1477d5={'raw':![],'where':{'id':_0x2c31c7[_0x1e38('0x44')]['id']}},_0x1bb42f={};_0x1bb42f['model']=_[_0x1e38('0x31')](db[_0x1e38('0x2b')][_0x1e38('0x45')]);_0x1bb42f[_0x1e38('0x30')]=_[_0x1e38('0x31')](_0x2c31c7[_0x1e38('0x30')]);_0x1bb42f[_0x1e38('0x32')]=_[_0x1e38('0x33')](_0x1bb42f['model'],_0x1bb42f[_0x1e38('0x30')]);_0x1477d5[_0x1e38('0x36')]=_[_0x1e38('0x33')](_0x1bb42f[_0x1e38('0x34')],qs[_0x1e38('0x35')](_0x2c31c7['query'][_0x1e38('0x35')]));_0x1477d5[_0x1e38('0x36')]=_0x1477d5['attributes'][_0x1e38('0x37')]?_0x1477d5[_0x1e38('0x36')]:_0x1bb42f[_0x1e38('0x34')];if(_0x2c31c7['query'][_0x1e38('0x46')]){_0x1477d5[_0x1e38('0x47')]=[{'all':!![]}];}_0x1477d5=_[_0x1e38('0x3d')]({},_0x1477d5,_0x2c31c7[_0x1e38('0x48')]);return db['SugarcrmAccount'][_0x1e38('0x49')](_0x1477d5)[_0x1e38('0x24')](handleEntityNotFound(_0x3146f3,null))[_0x1e38('0x24')](respondWithResult(_0x3146f3,null))[_0x1e38('0x42')](handleError(_0x3146f3,null));};exports[_0x1e38('0x4a')]=function(_0x4803eb,_0x23a7b9){return db[_0x1e38('0x2b')][_0x1e38('0x4a')](_0x4803eb['body'],{})['then'](respondWithResult(_0x23a7b9,0xc9))['catch'](handleError(_0x23a7b9,null));};exports[_0x1e38('0x23')]=function(_0x537fc5,_0x2decb3){if(_0x537fc5['body']['id']){delete _0x537fc5[_0x1e38('0x4b')]['id'];}return db[_0x1e38('0x2b')][_0x1e38('0x49')]({'where':{'id':_0x537fc5[_0x1e38('0x44')]['id']}})[_0x1e38('0x24')](handleEntityNotFound(_0x2decb3,null))[_0x1e38('0x24')](saveUpdates(_0x537fc5[_0x1e38('0x4b')],null))['then'](respondWithResult(_0x2decb3,null))[_0x1e38('0x42')](handleError(_0x2decb3,null));};exports[_0x1e38('0x25')]=function(_0x565226,_0x17761a){return db[_0x1e38('0x2b')]['find']({'where':{'id':_0x565226['params']['id']}})[_0x1e38('0x24')](handleEntityNotFound(_0x17761a,null))[_0x1e38('0x24')](removeEntity(_0x17761a,null))[_0x1e38('0x42')](handleError(_0x17761a,null));};exports[_0x1e38('0x4c')]=function(_0x549cc3,_0x4aa7b3,_0x5510ed){var _0x28da5f={};var _0x294816={};var _0x5ef3dd;var _0x46cf53;return db[_0x1e38('0x2b')][_0x1e38('0x4d')]({'where':{'id':_0x549cc3[_0x1e38('0x44')]['id']}})[_0x1e38('0x24')](handleEntityNotFound(_0x4aa7b3,null))[_0x1e38('0x24')](function(_0x2ca079){if(_0x2ca079){_0x5ef3dd=_0x2ca079;_0x294816[_0x1e38('0x34')]=_['keys'](db[_0x1e38('0x4e')][_0x1e38('0x45')]);_0x294816[_0x1e38('0x30')]=_[_0x1e38('0x31')](_0x549cc3[_0x1e38('0x30')]);_0x294816['filters']=_['intersection'](_0x294816[_0x1e38('0x34')],_0x294816[_0x1e38('0x30')]);_0x28da5f[_0x1e38('0x36')]=_[_0x1e38('0x33')](_0x294816[_0x1e38('0x34')],qs['fields'](_0x549cc3[_0x1e38('0x30')][_0x1e38('0x35')]));_0x28da5f[_0x1e38('0x36')]=_0x28da5f['attributes'][_0x1e38('0x37')]?_0x28da5f[_0x1e38('0x36')]:_0x294816['model'];_0x28da5f[_0x1e38('0x4f')]=qs[_0x1e38('0x3a')](_0x549cc3['query'][_0x1e38('0x3a')]);_0x28da5f[_0x1e38('0x3b')]=qs[_0x1e38('0x32')](_[_0x1e38('0x3c')](_0x549cc3[_0x1e38('0x30')],_0x294816[_0x1e38('0x32')]));if(_0x549cc3[_0x1e38('0x30')]['filter']){_0x28da5f[_0x1e38('0x3b')]=_['merge'](_0x28da5f[_0x1e38('0x3b')],{'$or':_['map'](_0x28da5f[_0x1e38('0x36')],function(_0x5ca9d0){var _0x3fee42={};_0x3fee42[_0x5ca9d0]={'$like':'%'+_0x549cc3[_0x1e38('0x30')][_0x1e38('0x3f')]+'%'};return _0x3fee42;})});}_0x28da5f=_[_0x1e38('0x3d')]({},_0x28da5f,_0x549cc3[_0x1e38('0x48')]);return _0x5ef3dd[_0x1e38('0x4c')](_0x28da5f);}})['then'](function(_0x3ddebc){if(_0x3ddebc){_0x46cf53=_0x3ddebc[_0x1e38('0x37')];if(!_0x549cc3[_0x1e38('0x30')][_0x1e38('0x38')](_0x1e38('0x39'))){_0x28da5f[_0x1e38('0x1e')]=qs['limit'](_0x549cc3['query'][_0x1e38('0x1e')]);_0x28da5f[_0x1e38('0x1f')]=qs['offset'](_0x549cc3[_0x1e38('0x30')][_0x1e38('0x1f')]);}return _0x5ef3dd['getConfigurations'](_0x28da5f);}})[_0x1e38('0x24')](function(_0x516965){if(_0x516965){return _0x516965?{'count':_0x46cf53,'rows':_0x516965}:null;}})['then'](respondWithResult(_0x4aa7b3,null))[_0x1e38('0x42')](handleError(_0x4aa7b3,null));};exports[_0x1e38('0x50')]=function(_0x57ca5e,_0x379ad2,_0x52de08){if(_0x57ca5e[_0x1e38('0x4b')]['id']){delete _0x57ca5e[_0x1e38('0x4b')]['id'];}return db[_0x1e38('0x2b')][_0x1e38('0x4d')]({'where':{'id':_0x57ca5e[_0x1e38('0x44')]['id']}})[_0x1e38('0x24')](handleEntityNotFound(_0x379ad2,null))[_0x1e38('0x24')](function(_0x467aa1){if(_0x467aa1){_0x57ca5e[_0x1e38('0x4b')][_0x1e38('0x51')]=_0x467aa1['id'];_0x57ca5e['body']['Subjects']=integrations[_0x1e38('0x52')](_0x57ca5e[_0x1e38('0x4b')][_0x1e38('0x53')],_0x57ca5e['body'][_0x1e38('0x2d')]);_0x57ca5e['body']['Descriptions']=integrations[_0x1e38('0x54')](_0x57ca5e[_0x1e38('0x4b')][_0x1e38('0x53')],_0x57ca5e['body'][_0x1e38('0x2d')]);return db[_0x1e38('0x4e')][_0x1e38('0x4a')](_0x57ca5e['body'],{'include':[{'model':db[_0x1e38('0x55')],'as':'Subjects'},{'model':db[_0x1e38('0x55')],'as':_0x1e38('0x56')}]});}return null;})[_0x1e38('0x24')](respondWithResult(_0x379ad2,null))[_0x1e38('0x42')](handleError(_0x379ad2,null));};exports[_0x1e38('0x57')]=function(_0x4d324a,_0x33cbb1,_0x5ec638){var _0x11ba41='';var _0x59121d=['id',_0x1e38('0x28'),_0x1e38('0x58'),_0x1e38('0x59'),'description',_0x1e38('0x5a'),'duration_hours',_0x1e38('0x5b'),'parent_id',_0x1e38('0x5c'),_0x1e38('0x5d'),_0x1e38('0x5e')];return db[_0x1e38('0x2b')][_0x1e38('0x4d')]({'where':{'id':_0x4d324a['params']['id']},'attributes':['id','username',_0x1e38('0x5f'),'remoteUri']})[_0x1e38('0x24')](handleEntityNotFound(_0x33cbb1,null))[_0x1e38('0x24')](function(_0x83f0e){if(_0x83f0e){_0x11ba41=_0x83f0e['remoteUri'];var _0x32904e=_0x11ba41[_0x1e38('0x60')](-0x1);if(_0x32904e==='/'){_0x11ba41=_0x11ba41[_0x1e38('0x61')](0x0,_0x11ba41[_0x1e38('0x62')](_0x32904e));}return rp({'method':_0x1e38('0x63'),'uri':util[_0x1e38('0x64')](_0x1e38('0x65'),_0x11ba41,_0x1e38('0x66')),'json':!![],'form':{'method':_0x1e38('0x67'),'input_type':_0x1e38('0x68'),'response_type':_0x1e38('0x68'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x83f0e[_0x1e38('0x69')],'password':_0x83f0e[_0x1e38('0x5f')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x1e38('0x24')](function(_0x1c1efb){if(_0x1c1efb&&_0x1c1efb['name']!==_0x1e38('0x6a')&&_0x1c1efb[_0x1e38('0x28')]!==_0x1e38('0x6b')){return rp({'method':_0x1e38('0x63'),'uri':util[_0x1e38('0x64')]('%s%s',_0x11ba41,_0x1e38('0x66')),'json':!![],'form':{'method':_0x1e38('0x6c'),'input_type':_0x1e38('0x68'),'response_type':_0x1e38('0x68'),'rest_data':JSON[_0x1e38('0x6d')]({'session':_0x1c1efb['id'],'module_name':'Calls'})}})[_0x1e38('0x24')](function(_0x1743cd){if(_0x1743cd){var _0x477273=_[_0x1e38('0x6e')](_0x1743cd[_0x1e38('0x6f')]);_['remove'](_0x477273,function(_0x21dcfc){return _0x59121d[_0x1e38('0x70')](_0x21dcfc['name']);});return{'count':_0x477273[_0x1e38('0x37')],'rows':_[_0x1e38('0x2f')](_0x477273,function(_0x48b711){return{'id':_0x48b711[_0x1e38('0x28')],'name':_0x48b711[_0x1e38('0x71')],'custom':_[_0x1e38('0x72')](_0x48b711[_0x1e38('0x28')],'_c')?!![]:![],'options':_0x48b711[_0x1e38('0x48')]?_['map'](_[_0x1e38('0x6e')](_0x48b711[_0x1e38('0x48')]),function(_0x2cea6a){return{'name':_0x2cea6a['value'],'value':_0x2cea6a['name']};}):[]};})};}})[_0x1e38('0x24')](respondWithResult(_0x33cbb1,null))[_0x1e38('0x42')](function(_0x2f3aef){var _0x1d73c8=_0x4d324a[_0x1e38('0x30')]['test']?0x1f4:_0x2f3aef['statusCode']||0x1f4;logger[_0x1e38('0x73')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1d73c8,JSON['stringify'](_0x2f3aef));delete _0x2f3aef['name'];if(_0x1d73c8===0x191){_0x1d73c8=0x190;}_0x33cbb1['status'](_0x1d73c8)['send'](_0x4d324a[_0x1e38('0x30')][_0x1e38('0x74')]?{'message':_0x1e38('0x75'),'statusCode':_0x2f3aef[_0x1e38('0x76')]}:_0x2f3aef);});}else{var _0x558d9e=0x1f4;_0x33cbb1[_0x1e38('0x1b')](_0x558d9e)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x5def=['endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','SugarcrmAccount','includeAll','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','SugarcrmConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','assigned_user_id','created_by','description','date_start','duration_hours','parent_type','parent_name','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Calls','values','module_fields','remove','includes','label'];(function(_0x48e566,_0x590e42){var _0x29878d=function(_0xe6c83d){while(--_0xe6c83d){_0x48e566['push'](_0x48e566['shift']());}};_0x29878d(++_0x590e42);}(_0x5def,0xfb));var _0xf5de=function(_0x5e6fe1,_0x8f80ad){_0x5e6fe1=_0x5e6fe1-0x0;var _0x5a6018=_0x5def[_0x5e6fe1];return _0x5a6018;};'use strict';var emlformat=require(_0xf5de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5de('0x1'));var jsonpatch=require(_0xf5de('0x2'));var rp=require(_0xf5de('0x3'));var moment=require(_0xf5de('0x4'));var BPromise=require(_0xf5de('0x5'));var Mustache=require(_0xf5de('0x6'));var util=require(_0xf5de('0x7'));var path=require(_0xf5de('0x8'));var sox=require(_0xf5de('0x9'));var csv=require(_0xf5de('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf5de('0xb'));var squel=require(_0xf5de('0xc'));var crypto=require(_0xf5de('0xd'));var jsforce=require(_0xf5de('0xe'));var deskjs=require(_0xf5de('0xf'));var toCsv=require(_0xf5de('0xa'));var querystring=require(_0xf5de('0x10'));var Papa=require(_0xf5de('0x11'));var Redis=require(_0xf5de('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf5de('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf5de('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf5de('0x15'));var config=require(_0xf5de('0x16'));var licenseUtil=require(_0xf5de('0x17'));var db=require(_0xf5de('0x18'))['db'];var integrations=require(_0xf5de('0x19'));function respondWithStatusCode(_0x57b29f,_0x309124){_0x309124=_0x309124||0xcc;return function(_0x77124a){if(_0x77124a){return _0x57b29f[_0xf5de('0x1a')](_0x309124);}return _0x57b29f[_0xf5de('0x1b')](_0x309124)[_0xf5de('0x1c')]();};}function respondWithResult(_0x60eab9,_0x29dabb){_0x29dabb=_0x29dabb||0xc8;return function(_0x3d7786){if(_0x3d7786){return _0x60eab9[_0xf5de('0x1b')](_0x29dabb)[_0xf5de('0x1d')](_0x3d7786);}};}function respondWithFilteredResult(_0x4d31d8,_0x4f93e6){return function(_0x4fec83){if(_0x4fec83){var _0x23613d=typeof _0x4f93e6['offset']==='undefined'&&typeof _0x4f93e6[_0xf5de('0x1e')]===_0xf5de('0x1f');var _0x2f8293=_0x4fec83[_0xf5de('0x20')];var _0x5b3d80=_0x23613d?0x0:_0x4f93e6[_0xf5de('0x21')];var _0x37a182=_0x23613d?_0x4fec83['count']:_0x4f93e6['offset']+_0x4f93e6['limit'];var _0x241f2a;if(_0x37a182>=_0x2f8293){_0x37a182=_0x2f8293;_0x241f2a=0xc8;}else{_0x241f2a=0xce;}_0x4d31d8['status'](_0x241f2a);return _0x4d31d8['set']('Content-Range',_0x5b3d80+'-'+_0x37a182+'/'+_0x2f8293)['json'](_0x4fec83);}return null;};}function patchUpdates(_0x2a7c80){return function(_0x23ed72){try{jsonpatch['apply'](_0x23ed72,_0x2a7c80,!![]);}catch(_0x33806e){return BPromise[_0xf5de('0x22')](_0x33806e);}return _0x23ed72[_0xf5de('0x23')]();};}function saveUpdates(_0x1ea3b2,_0x303154){return function(_0x174a60){if(_0x174a60){return _0x174a60[_0xf5de('0x24')](_0x1ea3b2)['then'](function(_0x1d810c){return _0x1d810c;});}return null;};}function removeEntity(_0x2bcfe3,_0x45658b){return function(_0x391480){if(_0x391480){return _0x391480[_0xf5de('0x25')]()[_0xf5de('0x26')](function(){_0x2bcfe3[_0xf5de('0x1b')](0xcc)[_0xf5de('0x1c')]();});}};}function handleEntityNotFound(_0x3ad993,_0x54f877){return function(_0xe67a7){if(!_0xe67a7){_0x3ad993[_0xf5de('0x1a')](0x194);}return _0xe67a7;};}function handleError(_0x133a3c,_0xc7ca10){_0xc7ca10=_0xc7ca10||0x1f4;return function(_0x32cdb6){logger[_0xf5de('0x27')](_0x32cdb6[_0xf5de('0x28')]);if(_0x32cdb6[_0xf5de('0x29')]){delete _0x32cdb6['name'];}_0x133a3c['status'](_0xc7ca10)[_0xf5de('0x2a')](_0x32cdb6);};}exports[_0xf5de('0x2b')]=function(_0x3b8de6,_0x4bc8dc){var _0x4ff84c={},_0x515714={},_0x6f3e74={'count':0x0,'rows':[]};var _0x53856d=_[_0xf5de('0x2c')](db['SugarcrmAccount'][_0xf5de('0x2d')],function(_0x47ffa9){return{'name':_0x47ffa9[_0xf5de('0x2e')],'type':_0x47ffa9['type'][_0xf5de('0x2f')]};});_0x515714['model']=_['map'](_0x53856d,_0xf5de('0x29'));_0x515714[_0xf5de('0x30')]=_['keys'](_0x3b8de6[_0xf5de('0x30')]);_0x515714[_0xf5de('0x31')]=_[_0xf5de('0x32')](_0x515714[_0xf5de('0x33')],_0x515714[_0xf5de('0x30')]);_0x4ff84c['attributes']=_[_0xf5de('0x32')](_0x515714[_0xf5de('0x33')],qs[_0xf5de('0x34')](_0x3b8de6[_0xf5de('0x30')]['fields']));_0x4ff84c[_0xf5de('0x35')]=_0x4ff84c[_0xf5de('0x35')][_0xf5de('0x36')]?_0x4ff84c['attributes']:_0x515714[_0xf5de('0x33')];if(!_0x3b8de6['query'][_0xf5de('0x37')](_0xf5de('0x38'))){_0x4ff84c[_0xf5de('0x1e')]=qs['limit'](_0x3b8de6[_0xf5de('0x30')]['limit']);_0x4ff84c['offset']=qs[_0xf5de('0x21')](_0x3b8de6[_0xf5de('0x30')]['offset']);}_0x4ff84c[_0xf5de('0x39')]=qs[_0xf5de('0x3a')](_0x3b8de6['query'][_0xf5de('0x3a')]);_0x4ff84c[_0xf5de('0x3b')]=qs[_0xf5de('0x31')](_[_0xf5de('0x3c')](_0x3b8de6[_0xf5de('0x30')],_0x515714[_0xf5de('0x31')]),_0x53856d);if(_0x3b8de6[_0xf5de('0x30')]['filter']){_0x4ff84c[_0xf5de('0x3b')]=_[_0xf5de('0x3d')](_0x4ff84c[_0xf5de('0x3b')],{'$or':_[_0xf5de('0x2c')](_0x53856d,function(_0x4b6b67){if(_0x4b6b67[_0xf5de('0x3e')]!==_0xf5de('0x3f')){var _0x333ce7={};_0x333ce7[_0x4b6b67[_0xf5de('0x29')]]={'$like':'%'+_0x3b8de6[_0xf5de('0x30')][_0xf5de('0x40')]+'%'};return _0x333ce7;}})});}_0x4ff84c=_[_0xf5de('0x3d')]({},_0x4ff84c,_0x3b8de6[_0xf5de('0x41')]);var _0x1c6255={'where':_0x4ff84c['where']};return db[_0xf5de('0x42')][_0xf5de('0x20')](_0x1c6255)[_0xf5de('0x26')](function(_0x3c1ba0){_0x6f3e74[_0xf5de('0x20')]=_0x3c1ba0;if(_0x3b8de6['query'][_0xf5de('0x43')]){_0x4ff84c['include']=[{'all':!![]}];}return db[_0xf5de('0x42')][_0xf5de('0x44')](_0x4ff84c);})[_0xf5de('0x26')](function(_0xf93cee){_0x6f3e74[_0xf5de('0x45')]=_0xf93cee;return _0x6f3e74;})[_0xf5de('0x26')](respondWithFilteredResult(_0x4bc8dc,_0x4ff84c))[_0xf5de('0x46')](handleError(_0x4bc8dc,null));};exports[_0xf5de('0x47')]=function(_0x5d8909,_0x2afa6e){var _0x4d7f48={'raw':![],'where':{'id':_0x5d8909[_0xf5de('0x48')]['id']}},_0x52b867={};_0x52b867[_0xf5de('0x33')]=_[_0xf5de('0x49')](db[_0xf5de('0x42')][_0xf5de('0x2d')]);_0x52b867[_0xf5de('0x30')]=_[_0xf5de('0x49')](_0x5d8909[_0xf5de('0x30')]);_0x52b867[_0xf5de('0x31')]=_[_0xf5de('0x32')](_0x52b867[_0xf5de('0x33')],_0x52b867[_0xf5de('0x30')]);_0x4d7f48[_0xf5de('0x35')]=_['intersection'](_0x52b867[_0xf5de('0x33')],qs[_0xf5de('0x34')](_0x5d8909[_0xf5de('0x30')][_0xf5de('0x34')]));_0x4d7f48[_0xf5de('0x35')]=_0x4d7f48[_0xf5de('0x35')]['length']?_0x4d7f48[_0xf5de('0x35')]:_0x52b867[_0xf5de('0x33')];if(_0x5d8909[_0xf5de('0x30')][_0xf5de('0x43')]){_0x4d7f48['include']=[{'all':!![]}];}_0x4d7f48=_[_0xf5de('0x3d')]({},_0x4d7f48,_0x5d8909[_0xf5de('0x41')]);return db['SugarcrmAccount'][_0xf5de('0x4a')](_0x4d7f48)['then'](handleEntityNotFound(_0x2afa6e,null))['then'](respondWithResult(_0x2afa6e,null))[_0xf5de('0x46')](handleError(_0x2afa6e,null));};exports[_0xf5de('0x4b')]=function(_0x5ecf49,_0x4c2a07){return db[_0xf5de('0x42')][_0xf5de('0x4b')](_0x5ecf49[_0xf5de('0x4c')],{})['then'](respondWithResult(_0x4c2a07,0xc9))[_0xf5de('0x46')](handleError(_0x4c2a07,null));};exports[_0xf5de('0x24')]=function(_0x4652dd,_0x18b357){if(_0x4652dd[_0xf5de('0x4c')]['id']){delete _0x4652dd[_0xf5de('0x4c')]['id'];}return db[_0xf5de('0x42')]['find']({'where':{'id':_0x4652dd[_0xf5de('0x48')]['id']}})['then'](handleEntityNotFound(_0x18b357,null))[_0xf5de('0x26')](saveUpdates(_0x4652dd[_0xf5de('0x4c')],null))['then'](respondWithResult(_0x18b357,null))[_0xf5de('0x46')](handleError(_0x18b357,null));};exports['destroy']=function(_0x41b1c4,_0x5f27c6){return db[_0xf5de('0x42')][_0xf5de('0x4a')]({'where':{'id':_0x41b1c4[_0xf5de('0x48')]['id']}})[_0xf5de('0x26')](handleEntityNotFound(_0x5f27c6,null))['then'](removeEntity(_0x5f27c6,null))[_0xf5de('0x46')](handleError(_0x5f27c6,null));};exports[_0xf5de('0x4d')]=function(_0x58a2ab,_0xaccc37,_0x560db5){var _0x323620={};var _0x32131c={};var _0x5690d8;var _0x30473e;return db[_0xf5de('0x42')]['findOne']({'where':{'id':_0x58a2ab['params']['id']}})[_0xf5de('0x26')](handleEntityNotFound(_0xaccc37,null))[_0xf5de('0x26')](function(_0x4f6ddc){if(_0x4f6ddc){_0x5690d8=_0x4f6ddc;_0x32131c[_0xf5de('0x33')]=_[_0xf5de('0x49')](db[_0xf5de('0x4e')][_0xf5de('0x2d')]);_0x32131c[_0xf5de('0x30')]=_[_0xf5de('0x49')](_0x58a2ab[_0xf5de('0x30')]);_0x32131c[_0xf5de('0x31')]=_[_0xf5de('0x32')](_0x32131c[_0xf5de('0x33')],_0x32131c[_0xf5de('0x30')]);_0x323620[_0xf5de('0x35')]=_[_0xf5de('0x32')](_0x32131c[_0xf5de('0x33')],qs[_0xf5de('0x34')](_0x58a2ab[_0xf5de('0x30')][_0xf5de('0x34')]));_0x323620[_0xf5de('0x35')]=_0x323620['attributes'][_0xf5de('0x36')]?_0x323620[_0xf5de('0x35')]:_0x32131c['model'];_0x323620['order']=qs[_0xf5de('0x3a')](_0x58a2ab['query']['sort']);_0x323620[_0xf5de('0x3b')]=qs['filters'](_[_0xf5de('0x3c')](_0x58a2ab[_0xf5de('0x30')],_0x32131c['filters']));if(_0x58a2ab[_0xf5de('0x30')][_0xf5de('0x40')]){_0x323620[_0xf5de('0x3b')]=_[_0xf5de('0x3d')](_0x323620[_0xf5de('0x3b')],{'$or':_[_0xf5de('0x2c')](_0x323620[_0xf5de('0x35')],function(_0x196724){var _0x48cd0e={};_0x48cd0e[_0x196724]={'$like':'%'+_0x58a2ab[_0xf5de('0x30')][_0xf5de('0x40')]+'%'};return _0x48cd0e;})});}_0x323620=_[_0xf5de('0x3d')]({},_0x323620,_0x58a2ab[_0xf5de('0x41')]);return _0x5690d8['getConfigurations'](_0x323620);}})[_0xf5de('0x26')](function(_0x393a4e){if(_0x393a4e){_0x30473e=_0x393a4e['length'];if(!_0x58a2ab[_0xf5de('0x30')]['hasOwnProperty']('nolimit')){_0x323620[_0xf5de('0x1e')]=qs[_0xf5de('0x1e')](_0x58a2ab[_0xf5de('0x30')][_0xf5de('0x1e')]);_0x323620['offset']=qs[_0xf5de('0x21')](_0x58a2ab[_0xf5de('0x30')][_0xf5de('0x21')]);}return _0x5690d8['getConfigurations'](_0x323620);}})['then'](function(_0x530724){if(_0x530724){return _0x530724?{'count':_0x30473e,'rows':_0x530724}:null;}})[_0xf5de('0x26')](respondWithResult(_0xaccc37,null))['catch'](handleError(_0xaccc37,null));};exports['addConfiguration']=function(_0x30dc39,_0x5cd132,_0x514c27){if(_0x30dc39[_0xf5de('0x4c')]['id']){delete _0x30dc39['body']['id'];}return db[_0xf5de('0x42')][_0xf5de('0x4f')]({'where':{'id':_0x30dc39[_0xf5de('0x48')]['id']}})['then'](handleEntityNotFound(_0x5cd132,null))[_0xf5de('0x26')](function(_0x53fafe){if(_0x53fafe){_0x30dc39[_0xf5de('0x4c')][_0xf5de('0x50')]=_0x53fafe['id'];_0x30dc39[_0xf5de('0x4c')][_0xf5de('0x51')]=integrations[_0xf5de('0x52')](_0x30dc39[_0xf5de('0x4c')]['channel'],_0x30dc39[_0xf5de('0x4c')][_0xf5de('0x3e')]);_0x30dc39[_0xf5de('0x4c')][_0xf5de('0x53')]=integrations[_0xf5de('0x54')](_0x30dc39[_0xf5de('0x4c')][_0xf5de('0x55')],_0x30dc39[_0xf5de('0x4c')][_0xf5de('0x3e')]);return db[_0xf5de('0x4e')][_0xf5de('0x4b')](_0x30dc39[_0xf5de('0x4c')],{'include':[{'model':db['SugarcrmField'],'as':_0xf5de('0x51')},{'model':db['SugarcrmField'],'as':_0xf5de('0x53')}]});}return null;})[_0xf5de('0x26')](respondWithResult(_0x5cd132,null))[_0xf5de('0x46')](handleError(_0x5cd132,null));};exports['getFields']=function(_0x4bbd27,_0x1478b0,_0x6c8842){var _0x172a9b='';var _0x12f68d=['id',_0xf5de('0x29'),_0xf5de('0x56'),_0xf5de('0x57'),_0xf5de('0x58'),_0xf5de('0x59'),_0xf5de('0x5a'),'duration_minutes','parent_id',_0xf5de('0x5b'),_0xf5de('0x5c'),'direction'];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x4bbd27[_0xf5de('0x48')]['id']},'attributes':['id','username','password',_0xf5de('0x5d')]})[_0xf5de('0x26')](handleEntityNotFound(_0x1478b0,null))[_0xf5de('0x26')](function(_0x5a5f8b){if(_0x5a5f8b){_0x172a9b=_0x5a5f8b[_0xf5de('0x5d')];var _0x542a9f=_0x172a9b[_0xf5de('0x5e')](-0x1);if(_0x542a9f==='/'){_0x172a9b=_0x172a9b[_0xf5de('0x5f')](0x0,_0x172a9b[_0xf5de('0x60')](_0x542a9f));}return rp({'method':_0xf5de('0x61'),'uri':util[_0xf5de('0x62')](_0xf5de('0x63'),_0x172a9b,_0xf5de('0x64')),'json':!![],'form':{'method':_0xf5de('0x65'),'input_type':_0xf5de('0x66'),'response_type':'JSON','rest_data':JSON[_0xf5de('0x67')]({'user_auth':{'user_name':_0x5a5f8b[_0xf5de('0x68')],'password':_0x5a5f8b[_0xf5de('0x69')],'encryption':_0xf5de('0x6a')},'application':_0xf5de('0x6b')})}});}})[_0xf5de('0x26')](function(_0x46b8a5){if(_0x46b8a5&&_0x46b8a5[_0xf5de('0x29')]!==_0xf5de('0x6c')&&_0x46b8a5['name']!=='Password\x20Expired'){return rp({'method':_0xf5de('0x61'),'uri':util[_0xf5de('0x62')](_0xf5de('0x63'),_0x172a9b,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0xf5de('0x66'),'rest_data':JSON[_0xf5de('0x67')]({'session':_0x46b8a5['id'],'module_name':_0xf5de('0x6d')})}})[_0xf5de('0x26')](function(_0x2b58c5){if(_0x2b58c5){var _0x1ebbd=_[_0xf5de('0x6e')](_0x2b58c5[_0xf5de('0x6f')]);_[_0xf5de('0x70')](_0x1ebbd,function(_0x158d18){return _0x12f68d[_0xf5de('0x71')](_0x158d18[_0xf5de('0x29')]);});return{'count':_0x1ebbd[_0xf5de('0x36')],'rows':_['map'](_0x1ebbd,function(_0x201628){return{'id':_0x201628[_0xf5de('0x29')],'name':_0x201628[_0xf5de('0x72')],'custom':_[_0xf5de('0x73')](_0x201628[_0xf5de('0x29')],'_c')?!![]:![],'options':_0x201628[_0xf5de('0x41')]?_[_0xf5de('0x2c')](_[_0xf5de('0x6e')](_0x201628['options']),function(_0x5f40e2){return{'name':_0x5f40e2[_0xf5de('0x74')],'value':_0x5f40e2[_0xf5de('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x1478b0,null))[_0xf5de('0x46')](function(_0x2fce57){var _0xac0704=_0x4bbd27[_0xf5de('0x30')][_0xf5de('0x75')]?0x1f4:_0x2fce57['statusCode']||0x1f4;logger[_0xf5de('0x27')](_0xf5de('0x76'),_0xf5de('0x77'),_0xac0704,JSON[_0xf5de('0x67')](_0x2fce57));delete _0x2fce57['name'];if(_0xac0704===0x191){_0xac0704=0x190;}_0x1478b0[_0xf5de('0x1b')](_0xac0704)[_0xf5de('0x2a')](_0x4bbd27['query'][_0xf5de('0x75')]?{'message':_0xf5de('0x78'),'statusCode':_0x2fce57[_0xf5de('0x79')]}:_0x2fce57);});}else{var _0x1ee3e8=0x1f4;_0x1478b0[_0xf5de('0x1b')](_0x1ee3e8)[_0xf5de('0x2a')]({'message':_0xf5de('0x78'),'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 c9b8253..8f94fd9 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 _0x717b=['../../components/integrations/configuration','SugarcrmAccount','int_sugarcrm_accounts','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0xcb7d91,_0x5cc4dc){var _0x67722d=function(_0x9a2f14){while(--_0x9a2f14){_0xcb7d91['push'](_0xcb7d91['shift']());}};_0x67722d(++_0x5cc4dc);}(_0x717b,0x111));var _0xb717=function(_0x44ecca,_0x572115){_0x44ecca=_0x44ecca-0x0;var _0x4e0e2d=_0x717b[_0x44ecca];return _0x4e0e2d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb717('0x0'))('api');var moment=require(_0xb717('0x1'));var BPromise=require('bluebird');var rp=require(_0xb717('0x2'));var fs=require('fs');var path=require(_0xb717('0x3'));var rimraf=require(_0xb717('0x4'));var config=require(_0xb717('0x5'));var attributes=require(_0xb717('0x6'));var integrations=require(_0xb717('0x7'));module['exports']=function(_0x234217,_0x549e24){return _0x234217['define'](_0xb717('0x8'),attributes,{'tableName':_0xb717('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a43=['exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration'];(function(_0x50eab9,_0x1a6d00){var _0x102a2f=function(_0x5af23c){while(--_0x5af23c){_0x50eab9['push'](_0x50eab9['shift']());}};_0x102a2f(++_0x1a6d00);}(_0x2a43,0x9a));var _0x32a4=function(_0x49af15,_0x54ff51){_0x49af15=_0x49af15-0x0;var _0x4b0f9b=_0x2a43[_0x49af15];return _0x4b0f9b;};'use strict';var _=require(_0x32a4('0x0'));var util=require(_0x32a4('0x1'));var logger=require(_0x32a4('0x2'))(_0x32a4('0x3'));var moment=require(_0x32a4('0x4'));var BPromise=require(_0x32a4('0x5'));var rp=require(_0x32a4('0x6'));var fs=require('fs');var path=require(_0x32a4('0x7'));var rimraf=require('rimraf');var config=require(_0x32a4('0x8'));var attributes=require(_0x32a4('0x9'));var integrations=require(_0x32a4('0xa'));module[_0x32a4('0xb')]=function(_0x288611,_0x4bf642){return _0x288611[_0x32a4('0xc')](_0x32a4('0xd'),attributes,{'tableName':_0x32a4('0xe'),'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 715fdc5..bdbe2a5 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 _0x3268=['limit','map','include','model','catch','ShowSugarcrmAccount','find','where','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3268,0xf6));var _0x8326=function(_0x1197fd,_0x35dd25){_0x1197fd=_0x1197fd-0x0;var _0x3982bc=_0x3268[_0x1197fd];return _0x3982bc;};'use strict';var _=require(_0x8326('0x0'));var util=require('util');var moment=require(_0x8326('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8326('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8326('0x3'));var logger=require(_0x8326('0x4'))(_0x8326('0x5'));var config=require('../../config/environment');var jayson=require(_0x8326('0x6'));var client=jayson[_0x8326('0x7')][_0x8326('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d220b,_0x145556,_0x3ec322){return new BPromise(function(_0x3cc439,_0x53e1d8){return client['request'](_0x1d220b,_0x3ec322)[_0x8326('0x9')](function(_0x5f154d){logger[_0x8326('0xa')](_0x8326('0xb'),_0x145556,_0x8326('0xc'));logger[_0x8326('0xd')](_0x8326('0xe'),_0x145556,'request\x20sent',JSON[_0x8326('0xf')](_0x5f154d));if(_0x5f154d[_0x8326('0x10')]){if(_0x5f154d[_0x8326('0x10')][_0x8326('0x11')]===0x1f4){logger['error'](_0x8326('0xb'),_0x145556,_0x5f154d[_0x8326('0x10')][_0x8326('0x12')]);return _0x53e1d8(_0x5f154d['error'][_0x8326('0x12')]);}logger[_0x8326('0x10')](_0x8326('0xb'),_0x145556,_0x5f154d[_0x8326('0x10')][_0x8326('0x12')]);return _0x3cc439(_0x5f154d[_0x8326('0x10')]['message']);}else{logger[_0x8326('0xa')]('SugarcrmAccount,\x20%s,\x20%s',_0x145556,_0x8326('0xc'));_0x3cc439(_0x5f154d[_0x8326('0x13')][_0x8326('0x12')]);}})['catch'](function(_0x2c3aee){logger[_0x8326('0x10')](_0x8326('0xb'),_0x145556,_0x2c3aee);_0x53e1d8(_0x2c3aee);});});}exports[_0x8326('0x14')]=function(_0x482e49){var _0x3ec6af=this;return new Promise(function(_0x4800d2,_0x383b1e){return db[_0x8326('0x15')][_0x8326('0x16')]({'raw':_0x482e49[_0x8326('0x17')]?_0x482e49[_0x8326('0x17')][_0x8326('0x18')]===undefined?!![]:![]:!![],'where':_0x482e49['options']?_0x482e49[_0x8326('0x17')]['where']||null:null,'attributes':_0x482e49[_0x8326('0x17')]?_0x482e49['options'][_0x8326('0x19')]||null:null,'limit':_0x482e49[_0x8326('0x17')]?_0x482e49[_0x8326('0x17')][_0x8326('0x1a')]||null:null,'include':_0x482e49[_0x8326('0x17')]?_0x482e49[_0x8326('0x17')]['include']?_[_0x8326('0x1b')](_0x482e49[_0x8326('0x17')][_0x8326('0x1c')],function(_0x59b5bf){return{'model':db[_0x59b5bf[_0x8326('0x1d')]],'as':_0x59b5bf['as'],'attributes':_0x59b5bf['attributes'],'include':_0x59b5bf[_0x8326('0x1c')]?_[_0x8326('0x1b')](_0x59b5bf[_0x8326('0x1c')],function(_0x505474){return{'model':db[_0x505474[_0x8326('0x1d')]],'as':_0x505474['as'],'attributes':_0x505474[_0x8326('0x19')],'include':_0x505474[_0x8326('0x1c')]?_['map'](_0x505474[_0x8326('0x1c')],function(_0x56cdf8){return{'model':db[_0x56cdf8[_0x8326('0x1d')]],'as':_0x56cdf8['as'],'attributes':_0x56cdf8[_0x8326('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8326('0x9')](function(_0x2c91e3){logger[_0x8326('0xa')](_0x8326('0x14'),_0x482e49);logger[_0x8326('0xd')](_0x8326('0x14'),_0x482e49,JSON['stringify'](_0x2c91e3));_0x4800d2(_0x2c91e3);})[_0x8326('0x1e')](function(_0x49ae6d){logger[_0x8326('0x10')](_0x8326('0x14'),_0x49ae6d[_0x8326('0x12')],_0x482e49);_0x383b1e(_0x3ec6af[_0x8326('0x10')](0x1f4,_0x49ae6d[_0x8326('0x12')]));});});};exports[_0x8326('0x1f')]=function(_0x48bc3e){var _0x3e1357=this;return new Promise(function(_0x4dfc15,_0x366dfd){return db[_0x8326('0x15')][_0x8326('0x20')]({'raw':_0x48bc3e[_0x8326('0x17')]?_0x48bc3e[_0x8326('0x17')][_0x8326('0x18')]===undefined?!![]:![]:!![],'where':_0x48bc3e[_0x8326('0x17')]?_0x48bc3e['options'][_0x8326('0x21')]||null:null,'attributes':_0x48bc3e[_0x8326('0x17')]?_0x48bc3e['options']['attributes']||null:null,'include':_0x48bc3e[_0x8326('0x17')]?_0x48bc3e[_0x8326('0x17')][_0x8326('0x1c')]?_[_0x8326('0x1b')](_0x48bc3e['options'][_0x8326('0x1c')],function(_0x29cecd){return{'model':db[_0x29cecd['model']],'as':_0x29cecd['as'],'attributes':_0x29cecd['attributes'],'include':_0x29cecd[_0x8326('0x1c')]?_['map'](_0x29cecd['include'],function(_0x5843a3){return{'model':db[_0x5843a3['model']],'as':_0x5843a3['as'],'attributes':_0x5843a3[_0x8326('0x19')],'include':_0x5843a3[_0x8326('0x1c')]?_[_0x8326('0x1b')](_0x5843a3['include'],function(_0x319e4d){return{'model':db[_0x319e4d[_0x8326('0x1d')]],'as':_0x319e4d['as'],'attributes':_0x319e4d[_0x8326('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8326('0x9')](function(_0x451982){logger[_0x8326('0xa')](_0x8326('0x1f'),_0x48bc3e);logger[_0x8326('0xd')](_0x8326('0x1f'),_0x48bc3e,JSON['stringify'](_0x451982));_0x4dfc15(_0x451982);})['catch'](function(_0x5bc4cd){logger[_0x8326('0x10')](_0x8326('0x1f'),_0x5bc4cd[_0x8326('0x12')],_0x48bc3e);_0x366dfd(_0x3e1357['error'](0x1f4,_0x5bc4cd[_0x8326('0x12')]));});});}; \ No newline at end of file +var _0xcdcb=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','ShowSugarcrmAccount','find','then'];(function(_0x44bd6b,_0x219764){var _0x397d55=function(_0x5bea18){while(--_0x5bea18){_0x44bd6b['push'](_0x44bd6b['shift']());}};_0x397d55(++_0x219764);}(_0xcdcb,0x172));var _0xbcdc=function(_0x529360,_0x1eab66){_0x529360=_0x529360-0x0;var _0xfba538=_0xcdcb[_0x529360];return _0xfba538;};'use strict';var _=require(_0xbcdc('0x0'));var util=require(_0xbcdc('0x1'));var moment=require(_0xbcdc('0x2'));var BPromise=require(_0xbcdc('0x3'));var rs=require(_0xbcdc('0x4'));var fs=require('fs');var Redis=require(_0xbcdc('0x5'));var db=require(_0xbcdc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcdc('0x7'))(_0xbcdc('0x8'));var config=require(_0xbcdc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbcdc('0xa')][_0xbcdc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106ee4,_0xb4ede7,_0x318657){return new BPromise(function(_0x5d3e99,_0x3f9a05){return client[_0xbcdc('0xc')](_0x106ee4,_0x318657)['then'](function(_0x5004bb){logger[_0xbcdc('0xd')](_0xbcdc('0xe'),_0xb4ede7,_0xbcdc('0xf'));logger[_0xbcdc('0x10')](_0xbcdc('0x11'),_0xb4ede7,_0xbcdc('0xf'),JSON[_0xbcdc('0x12')](_0x5004bb));if(_0x5004bb['error']){if(_0x5004bb[_0xbcdc('0x13')][_0xbcdc('0x14')]===0x1f4){logger['error'](_0xbcdc('0xe'),_0xb4ede7,_0x5004bb[_0xbcdc('0x13')][_0xbcdc('0x15')]);return _0x3f9a05(_0x5004bb['error'][_0xbcdc('0x15')]);}logger[_0xbcdc('0x13')](_0xbcdc('0xe'),_0xb4ede7,_0x5004bb['error'][_0xbcdc('0x15')]);return _0x5d3e99(_0x5004bb['error'][_0xbcdc('0x15')]);}else{logger[_0xbcdc('0xd')](_0xbcdc('0xe'),_0xb4ede7,_0xbcdc('0xf'));_0x5d3e99(_0x5004bb[_0xbcdc('0x16')]['message']);}})[_0xbcdc('0x17')](function(_0xa64f4){logger[_0xbcdc('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0xb4ede7,_0xa64f4);_0x3f9a05(_0xa64f4);});});}exports[_0xbcdc('0x18')]=function(_0x5afe51){var _0x148281=this;return new Promise(function(_0x3da267,_0x367169){return db[_0xbcdc('0x19')][_0xbcdc('0x1a')]({'raw':_0x5afe51['options']?_0x5afe51[_0xbcdc('0x1b')][_0xbcdc('0x1c')]===undefined?!![]:![]:!![],'where':_0x5afe51[_0xbcdc('0x1b')]?_0x5afe51[_0xbcdc('0x1b')][_0xbcdc('0x1d')]||null:null,'attributes':_0x5afe51[_0xbcdc('0x1b')]?_0x5afe51[_0xbcdc('0x1b')][_0xbcdc('0x1e')]||null:null,'limit':_0x5afe51['options']?_0x5afe51[_0xbcdc('0x1b')]['limit']||null:null,'include':_0x5afe51[_0xbcdc('0x1b')]?_0x5afe51['options'][_0xbcdc('0x1f')]?_[_0xbcdc('0x20')](_0x5afe51[_0xbcdc('0x1b')][_0xbcdc('0x1f')],function(_0x120807){return{'model':db[_0x120807[_0xbcdc('0x21')]],'as':_0x120807['as'],'attributes':_0x120807[_0xbcdc('0x1e')],'include':_0x120807[_0xbcdc('0x1f')]?_[_0xbcdc('0x20')](_0x120807['include'],function(_0x352e5d){return{'model':db[_0x352e5d[_0xbcdc('0x21')]],'as':_0x352e5d['as'],'attributes':_0x352e5d[_0xbcdc('0x1e')],'include':_0x352e5d[_0xbcdc('0x1f')]?_[_0xbcdc('0x20')](_0x352e5d[_0xbcdc('0x1f')],function(_0x276b9d){return{'model':db[_0x276b9d[_0xbcdc('0x21')]],'as':_0x276b9d['as'],'attributes':_0x276b9d[_0xbcdc('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x333483){logger[_0xbcdc('0xd')]('GetSugarcrmAccount',_0x5afe51);logger[_0xbcdc('0x10')](_0xbcdc('0x18'),_0x5afe51,JSON[_0xbcdc('0x12')](_0x333483));_0x3da267(_0x333483);})[_0xbcdc('0x17')](function(_0x2f3364){logger[_0xbcdc('0x13')]('GetSugarcrmAccount',_0x2f3364[_0xbcdc('0x15')],_0x5afe51);_0x367169(_0x148281[_0xbcdc('0x13')](0x1f4,_0x2f3364[_0xbcdc('0x15')]));});});};exports[_0xbcdc('0x22')]=function(_0x41c29e){var _0x2c0921=this;return new Promise(function(_0x199277,_0x55f540){return db[_0xbcdc('0x19')][_0xbcdc('0x23')]({'raw':_0x41c29e[_0xbcdc('0x1b')]?_0x41c29e[_0xbcdc('0x1b')][_0xbcdc('0x1c')]===undefined?!![]:![]:!![],'where':_0x41c29e[_0xbcdc('0x1b')]?_0x41c29e[_0xbcdc('0x1b')][_0xbcdc('0x1d')]||null:null,'attributes':_0x41c29e[_0xbcdc('0x1b')]?_0x41c29e[_0xbcdc('0x1b')][_0xbcdc('0x1e')]||null:null,'include':_0x41c29e['options']?_0x41c29e[_0xbcdc('0x1b')][_0xbcdc('0x1f')]?_[_0xbcdc('0x20')](_0x41c29e[_0xbcdc('0x1b')][_0xbcdc('0x1f')],function(_0x313794){return{'model':db[_0x313794[_0xbcdc('0x21')]],'as':_0x313794['as'],'attributes':_0x313794[_0xbcdc('0x1e')],'include':_0x313794[_0xbcdc('0x1f')]?_[_0xbcdc('0x20')](_0x313794[_0xbcdc('0x1f')],function(_0x38b013){return{'model':db[_0x38b013[_0xbcdc('0x21')]],'as':_0x38b013['as'],'attributes':_0x38b013[_0xbcdc('0x1e')],'include':_0x38b013[_0xbcdc('0x1f')]?_[_0xbcdc('0x20')](_0x38b013['include'],function(_0x4db060){return{'model':db[_0x4db060[_0xbcdc('0x21')]],'as':_0x4db060['as'],'attributes':_0x4db060[_0xbcdc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbcdc('0x24')](function(_0x474520){logger['info'](_0xbcdc('0x22'),_0x41c29e);logger[_0xbcdc('0x10')](_0xbcdc('0x22'),_0x41c29e,JSON[_0xbcdc('0x12')](_0x474520));_0x199277(_0x474520);})['catch'](function(_0x1ba975){logger[_0xbcdc('0x13')](_0xbcdc('0x22'),_0x1ba975[_0xbcdc('0x15')],_0x41c29e);_0x55f540(_0x2c0921['error'](0x1f4,_0x1ba975[_0xbcdc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index a708073..cbd2a3d 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 _0xc3d8=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','update','delete','exports','multer','util'];(function(_0x5eeb55,_0x5615e6){var _0x5a2296=function(_0x276f15){while(--_0x276f15){_0x5eeb55['push'](_0x5eeb55['shift']());}};_0x5a2296(++_0x5615e6);}(_0xc3d8,0x1de));var _0x8c3d=function(_0x3237a7,_0x2df3ba){_0x3237a7=_0x3237a7-0x0;var _0x393bae=_0xc3d8[_0x3237a7];return _0x393bae;};'use strict';var multer=require(_0x8c3d('0x0'));var util=require(_0x8c3d('0x1'));var path=require('path');var timeout=require(_0x8c3d('0x2'));var express=require(_0x8c3d('0x3'));var router=express[_0x8c3d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8c3d('0x5'));var interaction=require(_0x8c3d('0x6'));var config=require(_0x8c3d('0x7'));var controller=require(_0x8c3d('0x8'));router['get']('/',auth[_0x8c3d('0x9')](),controller[_0x8c3d('0xa')]);router[_0x8c3d('0xb')](_0x8c3d('0xc'),auth[_0x8c3d('0x9')](),controller[_0x8c3d('0xd')]);router[_0x8c3d('0xb')](_0x8c3d('0xe'),auth[_0x8c3d('0x9')](),controller[_0x8c3d('0xf')]);router[_0x8c3d('0xb')](_0x8c3d('0x10'),auth[_0x8c3d('0x9')](),controller['getSubjects']);router[_0x8c3d('0xb')]('/:id/descriptions',auth[_0x8c3d('0x9')](),controller[_0x8c3d('0x11')]);router[_0x8c3d('0x12')]('/',auth['isAuthenticated'](),controller[_0x8c3d('0x13')]);router[_0x8c3d('0x14')](_0x8c3d('0xc'),auth[_0x8c3d('0x9')](),controller[_0x8c3d('0x15')]);router[_0x8c3d('0x16')](_0x8c3d('0xc'),auth[_0x8c3d('0x9')](),controller['destroy']);module[_0x8c3d('0x17')]=router; \ No newline at end of file +var _0x6a56=['/:id/subjects','getSubjects','/:id/descriptions','create','update','delete','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','getFields'];(function(_0x1b9695,_0x29b161){var _0x164b9c=function(_0x3b8990){while(--_0x3b8990){_0x1b9695['push'](_0x1b9695['shift']());}};_0x164b9c(++_0x29b161);}(_0x6a56,0x161));var _0x66a5=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x6a56[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x66a5('0x0'));var util=require(_0x66a5('0x1'));var path=require(_0x66a5('0x2'));var timeout=require(_0x66a5('0x3'));var express=require('express');var router=express[_0x66a5('0x4')]();var fs_extra=require(_0x66a5('0x5'));var auth=require(_0x66a5('0x6'));var interaction=require(_0x66a5('0x7'));var config=require(_0x66a5('0x8'));var controller=require(_0x66a5('0x9'));router[_0x66a5('0xa')]('/',auth[_0x66a5('0xb')](),controller[_0x66a5('0xc')]);router[_0x66a5('0xa')]('/:id',auth[_0x66a5('0xb')](),controller[_0x66a5('0xd')]);router[_0x66a5('0xa')]('/:id/fields',auth[_0x66a5('0xb')](),controller[_0x66a5('0xe')]);router[_0x66a5('0xa')](_0x66a5('0xf'),auth[_0x66a5('0xb')](),controller[_0x66a5('0x10')]);router['get'](_0x66a5('0x11'),auth[_0x66a5('0xb')](),controller['getDescriptions']);router['post']('/',auth[_0x66a5('0xb')](),controller[_0x66a5('0x12')]);router['put']('/:id',auth[_0x66a5('0xb')](),controller[_0x66a5('0x13')]);router[_0x66a5('0x14')](_0x66a5('0x15'),auth[_0x66a5('0xb')](),controller['destroy']);module[_0x66a5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index de91b9c..f0a06f0 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 _0x9f93=['exports','STRING','sequelize'];(function(_0x5220b7,_0x1d70a3){var _0x2fd78d=function(_0x53c154){while(--_0x53c154){_0x5220b7['push'](_0x5220b7['shift']());}};_0x2fd78d(++_0x1d70a3);}(_0x9f93,0x11c));var _0x39f9=function(_0x21ac97,_0x3bc6ef){_0x21ac97=_0x21ac97-0x0;var _0x43432b=_0x9f93[_0x21ac97];return _0x43432b;};'use strict';var Sequelize=require(_0x39f9('0x0'));module[_0x39f9('0x1')]={'name':{'type':Sequelize[_0x39f9('0x2')]},'description':{'type':Sequelize[_0x39f9('0x2')]}}; \ No newline at end of file +var _0x54dd=['exports','STRING','sequelize'];(function(_0x390556,_0x5b64bd){var _0x11868e=function(_0x51bf69){while(--_0x51bf69){_0x390556['push'](_0x390556['shift']());}};_0x11868e(++_0x5b64bd);}(_0x54dd,0x15b));var _0xd54d=function(_0x46076c,_0x3c50ba){_0x46076c=_0x46076c-0x0;var _0x3a762b=_0x54dd[_0x46076c];return _0x3a762b;};'use strict';var Sequelize=require(_0xd54d('0x0'));module[_0xd54d('0x1')]={'name':{'type':Sequelize[_0xd54d('0x2')]},'description':{'type':Sequelize[_0xd54d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 47c15f9..530f1d9 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 _0x7e56=['model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','find','body','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','rawAttributes','getDescriptions','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','json','apply','save','update','then','destroy','error','stack','name','send','index','SugarcrmConfiguration','type'];(function(_0x5d22a0,_0x1b488f){var _0xc6e854=function(_0x86508c){while(--_0x86508c){_0x5d22a0['push'](_0x5d22a0['shift']());}};_0xc6e854(++_0x1b488f);}(_0x7e56,0x1f0));var _0x67e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e56[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x67e5('0x0'));var jsonpatch=require(_0x67e5('0x1'));var rp=require(_0x67e5('0x2'));var moment=require('moment');var BPromise=require(_0x67e5('0x3'));var Mustache=require(_0x67e5('0x4'));var util=require(_0x67e5('0x5'));var path=require(_0x67e5('0x6'));var sox=require('sox');var csv=require(_0x67e5('0x7'));var ejs=require(_0x67e5('0x8'));var fs=require('fs');var fs_extra=require(_0x67e5('0x9'));var _=require(_0x67e5('0xa'));var squel=require(_0x67e5('0xb'));var crypto=require(_0x67e5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x67e5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x67e5('0xe'));var Papa=require(_0x67e5('0xf'));var Redis=require('ioredis');var authService=require(_0x67e5('0x10'));var qs=require(_0x67e5('0x11'));var as=require(_0x67e5('0x12'));var hardwareService=require(_0x67e5('0x13'));var logger=require('../../config/logger')(_0x67e5('0x14'));var utils=require(_0x67e5('0x15'));var config=require(_0x67e5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x67e5('0x17'))['db'];function respondWithStatusCode(_0x267e23,_0x273781){_0x273781=_0x273781||0xcc;return function(_0x49a7ae){if(_0x49a7ae){return _0x267e23[_0x67e5('0x18')](_0x273781);}return _0x267e23[_0x67e5('0x19')](_0x273781)[_0x67e5('0x1a')]();};}function respondWithResult(_0x280ac8,_0x444ea4){_0x444ea4=_0x444ea4||0xc8;return function(_0x24b44f){if(_0x24b44f){return _0x280ac8['status'](_0x444ea4)['json'](_0x24b44f);}};}function respondWithFilteredResult(_0x38d9ac,_0x2e5f3f){return function(_0x5f3b95){if(_0x5f3b95){var _0x2bf2ec=typeof _0x2e5f3f[_0x67e5('0x1b')]===_0x67e5('0x1c')&&typeof _0x2e5f3f[_0x67e5('0x1d')]==='undefined';var _0x126cbd=_0x5f3b95['count'];var _0x4b9bfe=_0x2bf2ec?0x0:_0x2e5f3f[_0x67e5('0x1b')];var _0x3507bc=_0x2bf2ec?_0x5f3b95['count']:_0x2e5f3f[_0x67e5('0x1b')]+_0x2e5f3f[_0x67e5('0x1d')];var _0x1d2e50;if(_0x3507bc>=_0x126cbd){_0x3507bc=_0x126cbd;_0x1d2e50=0xc8;}else{_0x1d2e50=0xce;}_0x38d9ac[_0x67e5('0x19')](_0x1d2e50);return _0x38d9ac['set']('Content-Range',_0x4b9bfe+'-'+_0x3507bc+'/'+_0x126cbd)[_0x67e5('0x1e')](_0x5f3b95);}return null;};}function patchUpdates(_0x30ae0a){return function(_0xa76b95){try{jsonpatch[_0x67e5('0x1f')](_0xa76b95,_0x30ae0a,!![]);}catch(_0x42a2d0){return BPromise['reject'](_0x42a2d0);}return _0xa76b95[_0x67e5('0x20')]();};}function saveUpdates(_0x4b3a34,_0x3103c7){return function(_0x12880d){if(_0x12880d){return _0x12880d[_0x67e5('0x21')](_0x4b3a34)[_0x67e5('0x22')](function(_0x3bdec9){return _0x3bdec9;});}return null;};}function removeEntity(_0x3900c4,_0x16c463){return function(_0x550fd8){if(_0x550fd8){return _0x550fd8[_0x67e5('0x23')]()[_0x67e5('0x22')](function(){_0x3900c4[_0x67e5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa40d3,_0x39c445){return function(_0x4a3f1e){if(!_0x4a3f1e){_0xaa40d3[_0x67e5('0x18')](0x194);}return _0x4a3f1e;};}function handleError(_0x23fa63,_0x59f982){_0x59f982=_0x59f982||0x1f4;return function(_0x3802b6){logger[_0x67e5('0x24')](_0x3802b6[_0x67e5('0x25')]);if(_0x3802b6[_0x67e5('0x26')]){delete _0x3802b6['name'];}_0x23fa63['status'](_0x59f982)[_0x67e5('0x27')](_0x3802b6);};}exports[_0x67e5('0x28')]=function(_0x388fa9,_0x3bb1d3){var _0x5e654b={},_0x33bcd6={},_0x54bdd2={'count':0x0,'rows':[]};var _0x2265cf=_['map'](db[_0x67e5('0x29')]['rawAttributes'],function(_0xafcfd0){return{'name':_0xafcfd0['fieldName'],'type':_0xafcfd0[_0x67e5('0x2a')]['key']};});_0x33bcd6[_0x67e5('0x2b')]=_[_0x67e5('0x2c')](_0x2265cf,_0x67e5('0x26'));_0x33bcd6[_0x67e5('0x2d')]=_[_0x67e5('0x2e')](_0x388fa9[_0x67e5('0x2d')]);_0x33bcd6['filters']=_[_0x67e5('0x2f')](_0x33bcd6[_0x67e5('0x2b')],_0x33bcd6[_0x67e5('0x2d')]);_0x5e654b[_0x67e5('0x30')]=_['intersection'](_0x33bcd6[_0x67e5('0x2b')],qs['fields'](_0x388fa9[_0x67e5('0x2d')][_0x67e5('0x31')]));_0x5e654b[_0x67e5('0x30')]=_0x5e654b[_0x67e5('0x30')][_0x67e5('0x32')]?_0x5e654b[_0x67e5('0x30')]:_0x33bcd6[_0x67e5('0x2b')];if(!_0x388fa9[_0x67e5('0x2d')]['hasOwnProperty'](_0x67e5('0x33'))){_0x5e654b[_0x67e5('0x1d')]=qs[_0x67e5('0x1d')](_0x388fa9[_0x67e5('0x2d')][_0x67e5('0x1d')]);_0x5e654b[_0x67e5('0x1b')]=qs[_0x67e5('0x1b')](_0x388fa9[_0x67e5('0x2d')][_0x67e5('0x1b')]);}_0x5e654b[_0x67e5('0x34')]=qs[_0x67e5('0x35')](_0x388fa9[_0x67e5('0x2d')]['sort']);_0x5e654b['where']=qs[_0x67e5('0x36')](_[_0x67e5('0x37')](_0x388fa9['query'],_0x33bcd6['filters']),_0x2265cf);if(_0x388fa9[_0x67e5('0x2d')][_0x67e5('0x38')]){_0x5e654b[_0x67e5('0x39')]=_[_0x67e5('0x3a')](_0x5e654b[_0x67e5('0x39')],{'$or':_['map'](_0x2265cf,function(_0x1a9816){if(_0x1a9816[_0x67e5('0x2a')]!==_0x67e5('0x3b')){var _0x5b80af={};_0x5b80af[_0x1a9816[_0x67e5('0x26')]]={'$like':'%'+_0x388fa9[_0x67e5('0x2d')]['filter']+'%'};return _0x5b80af;}})});}_0x5e654b=_[_0x67e5('0x3a')]({},_0x5e654b,_0x388fa9[_0x67e5('0x3c')]);var _0x59ca04={'where':_0x5e654b[_0x67e5('0x39')]};return db['SugarcrmConfiguration']['count'](_0x59ca04)['then'](function(_0x37c9e4){_0x54bdd2[_0x67e5('0x3d')]=_0x37c9e4;if(_0x388fa9[_0x67e5('0x2d')][_0x67e5('0x3e')]){_0x5e654b[_0x67e5('0x3f')]=[{'all':!![]}];}return db[_0x67e5('0x29')][_0x67e5('0x40')](_0x5e654b);})['then'](function(_0x39675a){_0x54bdd2['rows']=_0x39675a;return _0x54bdd2;})[_0x67e5('0x22')](respondWithFilteredResult(_0x3bb1d3,_0x5e654b))[_0x67e5('0x41')](handleError(_0x3bb1d3,null));};exports[_0x67e5('0x42')]=function(_0x4cf9ab,_0x47410d){var _0x245249={'raw':![],'where':{'id':_0x4cf9ab[_0x67e5('0x43')]['id']}},_0x35914b={};_0x35914b[_0x67e5('0x2b')]=_[_0x67e5('0x2e')](db[_0x67e5('0x29')]['rawAttributes']);_0x35914b['query']=_['keys'](_0x4cf9ab[_0x67e5('0x2d')]);_0x35914b['filters']=_[_0x67e5('0x2f')](_0x35914b[_0x67e5('0x2b')],_0x35914b[_0x67e5('0x2d')]);_0x245249[_0x67e5('0x30')]=_[_0x67e5('0x2f')](_0x35914b[_0x67e5('0x2b')],qs[_0x67e5('0x31')](_0x4cf9ab[_0x67e5('0x2d')][_0x67e5('0x31')]));_0x245249['attributes']=_0x245249[_0x67e5('0x30')][_0x67e5('0x32')]?_0x245249['attributes']:_0x35914b[_0x67e5('0x2b')];if(_0x4cf9ab[_0x67e5('0x2d')][_0x67e5('0x3e')]){_0x245249[_0x67e5('0x3f')]=[{'all':!![]}];}_0x245249=_['merge']({},_0x245249,_0x4cf9ab[_0x67e5('0x3c')]);return db['SugarcrmConfiguration'][_0x67e5('0x44')](_0x245249)[_0x67e5('0x22')](handleEntityNotFound(_0x47410d,null))[_0x67e5('0x22')](respondWithResult(_0x47410d,null))[_0x67e5('0x41')](handleError(_0x47410d,null));};exports['create']=function(_0x4d3d40,_0x44502c){return db[_0x67e5('0x29')]['create'](_0x4d3d40['body'],{})[_0x67e5('0x22')](respondWithResult(_0x44502c,0xc9))[_0x67e5('0x41')](handleError(_0x44502c,null));};exports['update']=function(_0x4c39b1,_0x576a19){if(_0x4c39b1[_0x67e5('0x45')]['id']){delete _0x4c39b1[_0x67e5('0x45')]['id'];}return db[_0x67e5('0x29')][_0x67e5('0x44')]({'where':{'id':_0x4c39b1['params']['id']}})[_0x67e5('0x22')](handleEntityNotFound(_0x576a19,null))['then'](saveUpdates(_0x4c39b1[_0x67e5('0x45')],null))[_0x67e5('0x22')](respondWithResult(_0x576a19,null))[_0x67e5('0x41')](handleError(_0x576a19,null));};exports[_0x67e5('0x23')]=function(_0x323482,_0x52fb9c){return db['SugarcrmConfiguration'][_0x67e5('0x44')]({'where':{'id':_0x323482[_0x67e5('0x43')]['id']}})[_0x67e5('0x22')](handleEntityNotFound(_0x52fb9c,null))[_0x67e5('0x22')](removeEntity(_0x52fb9c,null))[_0x67e5('0x41')](handleError(_0x52fb9c,null));};exports[_0x67e5('0x46')]=function(_0x522047,_0x1d0716,_0x1636ee){var _0x3308b0={};var _0x2fb58b={};var _0x2db030;var _0x4b468f;return db[_0x67e5('0x29')][_0x67e5('0x47')]({'where':{'id':_0x522047[_0x67e5('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d0716,null))[_0x67e5('0x22')](function(_0x3b9feb){if(_0x3b9feb){_0x2db030=_0x3b9feb;_0x2fb58b[_0x67e5('0x2b')]=_[_0x67e5('0x2e')](db[_0x67e5('0x48')]['rawAttributes']);_0x2fb58b['query']=_[_0x67e5('0x2e')](_0x522047[_0x67e5('0x2d')]);_0x2fb58b['filters']=_[_0x67e5('0x2f')](_0x2fb58b[_0x67e5('0x2b')],_0x2fb58b['query']);_0x3308b0[_0x67e5('0x30')]=_[_0x67e5('0x2f')](_0x2fb58b[_0x67e5('0x2b')],qs[_0x67e5('0x31')](_0x522047[_0x67e5('0x2d')][_0x67e5('0x31')]));_0x3308b0[_0x67e5('0x30')]=_0x3308b0['attributes'][_0x67e5('0x32')]?_0x3308b0['attributes']:_0x2fb58b[_0x67e5('0x2b')];_0x3308b0[_0x67e5('0x34')]=qs['sort'](_0x522047[_0x67e5('0x2d')][_0x67e5('0x35')]);_0x3308b0[_0x67e5('0x39')]=qs[_0x67e5('0x36')](_['pick'](_0x522047[_0x67e5('0x2d')],_0x2fb58b['filters']));if(_0x522047['query']['filter']){_0x3308b0['where']=_['merge'](_0x3308b0[_0x67e5('0x39')],{'$or':_[_0x67e5('0x2c')](_0x3308b0[_0x67e5('0x30')],function(_0x5c1d9a){var _0xfcd204={};_0xfcd204[_0x5c1d9a]={'$like':'%'+_0x522047[_0x67e5('0x2d')][_0x67e5('0x38')]+'%'};return _0xfcd204;})});}_0x3308b0=_[_0x67e5('0x3a')]({},_0x3308b0,_0x522047[_0x67e5('0x3c')]);return _0x2db030[_0x67e5('0x46')](_0x3308b0);}})[_0x67e5('0x22')](function(_0x2b6b87){if(_0x2b6b87){_0x4b468f=_0x2b6b87[_0x67e5('0x32')];if(!_0x522047[_0x67e5('0x2d')][_0x67e5('0x49')](_0x67e5('0x33'))){_0x3308b0[_0x67e5('0x1d')]=qs[_0x67e5('0x1d')](_0x522047['query']['limit']);_0x3308b0['offset']=qs[_0x67e5('0x1b')](_0x522047['query']['offset']);}return _0x2db030[_0x67e5('0x46')](_0x3308b0);}})['then'](function(_0x5cda01){if(_0x5cda01){return _0x5cda01?{'count':_0x4b468f,'rows':_0x5cda01}:null;}})['then'](respondWithResult(_0x1d0716,null))[_0x67e5('0x41')](handleError(_0x1d0716,null));};exports[_0x67e5('0x4a')]=function(_0x2327d0,_0x1efa2f,_0x5d6bc2){var _0xf6e3e8={};var _0x28bcbe={};var _0x1b7d85;var _0x54000e;return db[_0x67e5('0x29')][_0x67e5('0x47')]({'where':{'id':_0x2327d0[_0x67e5('0x43')]['id']}})[_0x67e5('0x22')](handleEntityNotFound(_0x1efa2f,null))[_0x67e5('0x22')](function(_0x5dd33f){if(_0x5dd33f){_0x1b7d85=_0x5dd33f;_0x28bcbe[_0x67e5('0x2b')]=_[_0x67e5('0x2e')](db['SugarcrmField'][_0x67e5('0x4b')]);_0x28bcbe[_0x67e5('0x2d')]=_['keys'](_0x2327d0[_0x67e5('0x2d')]);_0x28bcbe[_0x67e5('0x36')]=_['intersection'](_0x28bcbe[_0x67e5('0x2b')],_0x28bcbe['query']);_0xf6e3e8[_0x67e5('0x30')]=_[_0x67e5('0x2f')](_0x28bcbe[_0x67e5('0x2b')],qs[_0x67e5('0x31')](_0x2327d0['query']['fields']));_0xf6e3e8[_0x67e5('0x30')]=_0xf6e3e8[_0x67e5('0x30')][_0x67e5('0x32')]?_0xf6e3e8[_0x67e5('0x30')]:_0x28bcbe['model'];_0xf6e3e8['order']=qs[_0x67e5('0x35')](_0x2327d0['query'][_0x67e5('0x35')]);_0xf6e3e8[_0x67e5('0x39')]=qs[_0x67e5('0x36')](_[_0x67e5('0x37')](_0x2327d0[_0x67e5('0x2d')],_0x28bcbe[_0x67e5('0x36')]));if(_0x2327d0['query'][_0x67e5('0x38')]){_0xf6e3e8[_0x67e5('0x39')]=_[_0x67e5('0x3a')](_0xf6e3e8[_0x67e5('0x39')],{'$or':_[_0x67e5('0x2c')](_0xf6e3e8[_0x67e5('0x30')],function(_0x599b27){var _0x5df550={};_0x5df550[_0x599b27]={'$like':'%'+_0x2327d0[_0x67e5('0x2d')]['filter']+'%'};return _0x5df550;})});}_0xf6e3e8=_[_0x67e5('0x3a')]({},_0xf6e3e8,_0x2327d0[_0x67e5('0x3c')]);return _0x1b7d85[_0x67e5('0x4a')](_0xf6e3e8);}})[_0x67e5('0x22')](function(_0x310ec3){if(_0x310ec3){_0x54000e=_0x310ec3['length'];if(!_0x2327d0['query'][_0x67e5('0x49')](_0x67e5('0x33'))){_0xf6e3e8['limit']=qs['limit'](_0x2327d0[_0x67e5('0x2d')][_0x67e5('0x1d')]);_0xf6e3e8[_0x67e5('0x1b')]=qs[_0x67e5('0x1b')](_0x2327d0['query'][_0x67e5('0x1b')]);}return _0x1b7d85[_0x67e5('0x4a')](_0xf6e3e8);}})[_0x67e5('0x22')](function(_0x3d10eb){if(_0x3d10eb){return _0x3d10eb?{'count':_0x54000e,'rows':_0x3d10eb}:null;}})['then'](respondWithResult(_0x1efa2f,null))[_0x67e5('0x41')](handleError(_0x1efa2f,null));};exports[_0x67e5('0x4c')]=function(_0x2f5388,_0x39f7e8,_0x3259ec){var _0x34086e={};var _0x1eea5f={};var _0x10f959;var _0x472e22;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x2f5388[_0x67e5('0x43')]['id']}})[_0x67e5('0x22')](handleEntityNotFound(_0x39f7e8,null))[_0x67e5('0x22')](function(_0x2f22fc){if(_0x2f22fc){_0x10f959=_0x2f22fc;_0x1eea5f[_0x67e5('0x2b')]=_[_0x67e5('0x2e')](db['SugarcrmField'][_0x67e5('0x4b')]);_0x1eea5f[_0x67e5('0x2d')]=_['keys'](_0x2f5388[_0x67e5('0x2d')]);_0x1eea5f['filters']=_[_0x67e5('0x2f')](_0x1eea5f[_0x67e5('0x2b')],_0x1eea5f['query']);_0x34086e[_0x67e5('0x30')]=_[_0x67e5('0x2f')](_0x1eea5f[_0x67e5('0x2b')],qs[_0x67e5('0x31')](_0x2f5388[_0x67e5('0x2d')][_0x67e5('0x31')]));_0x34086e['attributes']=_0x34086e['attributes'][_0x67e5('0x32')]?_0x34086e['attributes']:_0x1eea5f[_0x67e5('0x2b')];_0x34086e['order']=qs[_0x67e5('0x35')](_0x2f5388[_0x67e5('0x2d')]['sort']);_0x34086e[_0x67e5('0x39')]=qs[_0x67e5('0x36')](_[_0x67e5('0x37')](_0x2f5388['query'],_0x1eea5f[_0x67e5('0x36')]));if(_0x2f5388[_0x67e5('0x2d')]['filter']){_0x34086e['where']=_['merge'](_0x34086e[_0x67e5('0x39')],{'$or':_['map'](_0x34086e['attributes'],function(_0x32f8a5){var _0x3dc233={};_0x3dc233[_0x32f8a5]={'$like':'%'+_0x2f5388[_0x67e5('0x2d')]['filter']+'%'};return _0x3dc233;})});}_0x34086e=_[_0x67e5('0x3a')]({},_0x34086e,_0x2f5388['options']);return _0x10f959[_0x67e5('0x4c')](_0x34086e);}})[_0x67e5('0x22')](function(_0x3ec216){if(_0x3ec216){_0x472e22=_0x3ec216[_0x67e5('0x32')];if(!_0x2f5388['query'][_0x67e5('0x49')]('nolimit')){_0x34086e[_0x67e5('0x1d')]=qs[_0x67e5('0x1d')](_0x2f5388[_0x67e5('0x2d')][_0x67e5('0x1d')]);_0x34086e[_0x67e5('0x1b')]=qs['offset'](_0x2f5388[_0x67e5('0x2d')][_0x67e5('0x1b')]);}return _0x10f959['getDescriptions'](_0x34086e);}})[_0x67e5('0x22')](function(_0x29079b){if(_0x29079b){return _0x29079b?{'count':_0x472e22,'rows':_0x29079b}:null;}})[_0x67e5('0x22')](respondWithResult(_0x39f7e8,null))[_0x67e5('0x41')](handleError(_0x39f7e8,null));}; \ No newline at end of file +var _0xef30=['util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','name','send','map','SugarcrmConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','create','body','update','params','find','findOne','SugarcrmField','fields','sort','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x59348e,_0x287e99){var _0x5a05ee=function(_0x160dc4){while(--_0x160dc4){_0x59348e['push'](_0x59348e['shift']());}};_0x5a05ee(++_0x287e99);}(_0xef30,0x198));var _0x0ef3=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0xef30[_0x5d8018];return _0x151ac4;};'use strict';var emlformat=require(_0x0ef3('0x0'));var rimraf=require(_0x0ef3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ef3('0x2'));var rp=require(_0x0ef3('0x3'));var moment=require(_0x0ef3('0x4'));var BPromise=require(_0x0ef3('0x5'));var Mustache=require(_0x0ef3('0x6'));var util=require(_0x0ef3('0x7'));var path=require(_0x0ef3('0x8'));var sox=require('sox');var csv=require(_0x0ef3('0x9'));var ejs=require(_0x0ef3('0xa'));var fs=require('fs');var fs_extra=require(_0x0ef3('0xb'));var _=require(_0x0ef3('0xc'));var squel=require(_0x0ef3('0xd'));var crypto=require(_0x0ef3('0xe'));var jsforce=require(_0x0ef3('0xf'));var deskjs=require(_0x0ef3('0x10'));var toCsv=require(_0x0ef3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0ef3('0x11'));var authService=require(_0x0ef3('0x12'));var qs=require(_0x0ef3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ef3('0x14'));var logger=require(_0x0ef3('0x15'))(_0x0ef3('0x16'));var utils=require(_0x0ef3('0x17'));var config=require(_0x0ef3('0x18'));var licenseUtil=require(_0x0ef3('0x19'));var db=require(_0x0ef3('0x1a'))['db'];function respondWithStatusCode(_0x195547,_0x2fe22e){_0x2fe22e=_0x2fe22e||0xcc;return function(_0x35ee51){if(_0x35ee51){return _0x195547[_0x0ef3('0x1b')](_0x2fe22e);}return _0x195547[_0x0ef3('0x1c')](_0x2fe22e)[_0x0ef3('0x1d')]();};}function respondWithResult(_0x26977c,_0x388495){_0x388495=_0x388495||0xc8;return function(_0x5154b3){if(_0x5154b3){return _0x26977c[_0x0ef3('0x1c')](_0x388495)[_0x0ef3('0x1e')](_0x5154b3);}};}function respondWithFilteredResult(_0x36e2b1,_0xcc61a){return function(_0x1f7d98){if(_0x1f7d98){var _0x50f129=typeof _0xcc61a[_0x0ef3('0x1f')]===_0x0ef3('0x20')&&typeof _0xcc61a[_0x0ef3('0x21')]===_0x0ef3('0x20');var _0x3086a1=_0x1f7d98[_0x0ef3('0x22')];var _0x144dc2=_0x50f129?0x0:_0xcc61a[_0x0ef3('0x1f')];var _0x4fb44a=_0x50f129?_0x1f7d98[_0x0ef3('0x22')]:_0xcc61a['offset']+_0xcc61a[_0x0ef3('0x21')];var _0x3ca4e1;if(_0x4fb44a>=_0x3086a1){_0x4fb44a=_0x3086a1;_0x3ca4e1=0xc8;}else{_0x3ca4e1=0xce;}_0x36e2b1[_0x0ef3('0x1c')](_0x3ca4e1);return _0x36e2b1[_0x0ef3('0x23')](_0x0ef3('0x24'),_0x144dc2+'-'+_0x4fb44a+'/'+_0x3086a1)[_0x0ef3('0x1e')](_0x1f7d98);}return null;};}function patchUpdates(_0xd37658){return function(_0x5d5a26){try{jsonpatch[_0x0ef3('0x25')](_0x5d5a26,_0xd37658,!![]);}catch(_0x57a673){return BPromise[_0x0ef3('0x26')](_0x57a673);}return _0x5d5a26['save']();};}function saveUpdates(_0x5e535d,_0x4710b2){return function(_0x12eab8){if(_0x12eab8){return _0x12eab8['update'](_0x5e535d)['then'](function(_0x48ac05){return _0x48ac05;});}return null;};}function removeEntity(_0x425fcf,_0x3a13ce){return function(_0x25a7c0){if(_0x25a7c0){return _0x25a7c0[_0x0ef3('0x27')]()[_0x0ef3('0x28')](function(){_0x425fcf[_0x0ef3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2de466,_0x412d8e){return function(_0x5e67e5){if(!_0x5e67e5){_0x2de466['sendStatus'](0x194);}return _0x5e67e5;};}function handleError(_0x11a342,_0x47467c){_0x47467c=_0x47467c||0x1f4;return function(_0x58fda5){logger['error'](_0x58fda5['stack']);if(_0x58fda5[_0x0ef3('0x29')]){delete _0x58fda5[_0x0ef3('0x29')];}_0x11a342[_0x0ef3('0x1c')](_0x47467c)[_0x0ef3('0x2a')](_0x58fda5);};}exports['index']=function(_0x399cec,_0x5880e6){var _0x264f10={},_0x2f33d4={},_0x52e7ea={'count':0x0,'rows':[]};var _0x130b45=_[_0x0ef3('0x2b')](db[_0x0ef3('0x2c')]['rawAttributes'],function(_0x35f722){return{'name':_0x35f722[_0x0ef3('0x2d')],'type':_0x35f722[_0x0ef3('0x2e')][_0x0ef3('0x2f')]};});_0x2f33d4[_0x0ef3('0x30')]=_[_0x0ef3('0x2b')](_0x130b45,'name');_0x2f33d4[_0x0ef3('0x31')]=_['keys'](_0x399cec[_0x0ef3('0x31')]);_0x2f33d4[_0x0ef3('0x32')]=_[_0x0ef3('0x33')](_0x2f33d4[_0x0ef3('0x30')],_0x2f33d4[_0x0ef3('0x31')]);_0x264f10['attributes']=_['intersection'](_0x2f33d4[_0x0ef3('0x30')],qs['fields'](_0x399cec['query']['fields']));_0x264f10[_0x0ef3('0x34')]=_0x264f10[_0x0ef3('0x34')][_0x0ef3('0x35')]?_0x264f10[_0x0ef3('0x34')]:_0x2f33d4['model'];if(!_0x399cec[_0x0ef3('0x31')]['hasOwnProperty'](_0x0ef3('0x36'))){_0x264f10['limit']=qs[_0x0ef3('0x21')](_0x399cec[_0x0ef3('0x31')][_0x0ef3('0x21')]);_0x264f10[_0x0ef3('0x1f')]=qs[_0x0ef3('0x1f')](_0x399cec['query'][_0x0ef3('0x1f')]);}_0x264f10[_0x0ef3('0x37')]=qs['sort'](_0x399cec[_0x0ef3('0x31')]['sort']);_0x264f10[_0x0ef3('0x38')]=qs['filters'](_[_0x0ef3('0x39')](_0x399cec[_0x0ef3('0x31')],_0x2f33d4[_0x0ef3('0x32')]),_0x130b45);if(_0x399cec[_0x0ef3('0x31')][_0x0ef3('0x3a')]){_0x264f10[_0x0ef3('0x38')]=_[_0x0ef3('0x3b')](_0x264f10[_0x0ef3('0x38')],{'$or':_[_0x0ef3('0x2b')](_0x130b45,function(_0x4934d0){if(_0x4934d0[_0x0ef3('0x2e')]!==_0x0ef3('0x3c')){var _0x53b94e={};_0x53b94e[_0x4934d0[_0x0ef3('0x29')]]={'$like':'%'+_0x399cec[_0x0ef3('0x31')]['filter']+'%'};return _0x53b94e;}})});}_0x264f10=_[_0x0ef3('0x3b')]({},_0x264f10,_0x399cec[_0x0ef3('0x3d')]);var _0x3b0a5a={'where':_0x264f10[_0x0ef3('0x38')]};return db[_0x0ef3('0x2c')][_0x0ef3('0x22')](_0x3b0a5a)['then'](function(_0x80a1dd){_0x52e7ea['count']=_0x80a1dd;if(_0x399cec[_0x0ef3('0x31')]['includeAll']){_0x264f10[_0x0ef3('0x3e')]=[{'all':!![]}];}return db[_0x0ef3('0x2c')][_0x0ef3('0x3f')](_0x264f10);})['then'](function(_0x1836a6){_0x52e7ea[_0x0ef3('0x40')]=_0x1836a6;return _0x52e7ea;})[_0x0ef3('0x28')](respondWithFilteredResult(_0x5880e6,_0x264f10))[_0x0ef3('0x41')](handleError(_0x5880e6,null));};exports[_0x0ef3('0x42')]=function(_0x15a246,_0x26dbb1){var _0x358550={'raw':![],'where':{'id':_0x15a246['params']['id']}},_0x128541={};_0x128541[_0x0ef3('0x30')]=_[_0x0ef3('0x43')](db['SugarcrmConfiguration'][_0x0ef3('0x44')]);_0x128541[_0x0ef3('0x31')]=_[_0x0ef3('0x43')](_0x15a246['query']);_0x128541[_0x0ef3('0x32')]=_[_0x0ef3('0x33')](_0x128541['model'],_0x128541[_0x0ef3('0x31')]);_0x358550['attributes']=_[_0x0ef3('0x33')](_0x128541[_0x0ef3('0x30')],qs['fields'](_0x15a246['query']['fields']));_0x358550['attributes']=_0x358550[_0x0ef3('0x34')][_0x0ef3('0x35')]?_0x358550[_0x0ef3('0x34')]:_0x128541[_0x0ef3('0x30')];if(_0x15a246[_0x0ef3('0x31')][_0x0ef3('0x45')]){_0x358550[_0x0ef3('0x3e')]=[{'all':!![]}];}_0x358550=_[_0x0ef3('0x3b')]({},_0x358550,_0x15a246['options']);return db[_0x0ef3('0x2c')]['find'](_0x358550)[_0x0ef3('0x28')](handleEntityNotFound(_0x26dbb1,null))[_0x0ef3('0x28')](respondWithResult(_0x26dbb1,null))[_0x0ef3('0x41')](handleError(_0x26dbb1,null));};exports[_0x0ef3('0x46')]=function(_0x9ac4dc,_0x3b0760){return db[_0x0ef3('0x2c')][_0x0ef3('0x46')](_0x9ac4dc[_0x0ef3('0x47')],{})['then'](respondWithResult(_0x3b0760,0xc9))[_0x0ef3('0x41')](handleError(_0x3b0760,null));};exports[_0x0ef3('0x48')]=function(_0xa1644c,_0x4d9007){if(_0xa1644c[_0x0ef3('0x47')]['id']){delete _0xa1644c[_0x0ef3('0x47')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0xa1644c[_0x0ef3('0x49')]['id']}})[_0x0ef3('0x28')](handleEntityNotFound(_0x4d9007,null))['then'](saveUpdates(_0xa1644c[_0x0ef3('0x47')],null))[_0x0ef3('0x28')](respondWithResult(_0x4d9007,null))[_0x0ef3('0x41')](handleError(_0x4d9007,null));};exports[_0x0ef3('0x27')]=function(_0x1ff22e,_0x2cde7d){return db[_0x0ef3('0x2c')][_0x0ef3('0x4a')]({'where':{'id':_0x1ff22e[_0x0ef3('0x49')]['id']}})[_0x0ef3('0x28')](handleEntityNotFound(_0x2cde7d,null))[_0x0ef3('0x28')](removeEntity(_0x2cde7d,null))[_0x0ef3('0x41')](handleError(_0x2cde7d,null));};exports['getFields']=function(_0x2b2646,_0x38a3d7,_0x42ff2e){var _0x4181e2={};var _0x49d888={};var _0x6b03d4;var _0xf43c6f;return db[_0x0ef3('0x2c')][_0x0ef3('0x4b')]({'where':{'id':_0x2b2646[_0x0ef3('0x49')]['id']}})[_0x0ef3('0x28')](handleEntityNotFound(_0x38a3d7,null))[_0x0ef3('0x28')](function(_0x310264){if(_0x310264){_0x6b03d4=_0x310264;_0x49d888[_0x0ef3('0x30')]=_['keys'](db[_0x0ef3('0x4c')][_0x0ef3('0x44')]);_0x49d888[_0x0ef3('0x31')]=_[_0x0ef3('0x43')](_0x2b2646[_0x0ef3('0x31')]);_0x49d888['filters']=_[_0x0ef3('0x33')](_0x49d888[_0x0ef3('0x30')],_0x49d888[_0x0ef3('0x31')]);_0x4181e2['attributes']=_[_0x0ef3('0x33')](_0x49d888[_0x0ef3('0x30')],qs['fields'](_0x2b2646[_0x0ef3('0x31')][_0x0ef3('0x4d')]));_0x4181e2[_0x0ef3('0x34')]=_0x4181e2[_0x0ef3('0x34')]['length']?_0x4181e2['attributes']:_0x49d888[_0x0ef3('0x30')];_0x4181e2[_0x0ef3('0x37')]=qs[_0x0ef3('0x4e')](_0x2b2646['query']['sort']);_0x4181e2[_0x0ef3('0x38')]=qs[_0x0ef3('0x32')](_[_0x0ef3('0x39')](_0x2b2646[_0x0ef3('0x31')],_0x49d888[_0x0ef3('0x32')]));if(_0x2b2646[_0x0ef3('0x31')][_0x0ef3('0x3a')]){_0x4181e2[_0x0ef3('0x38')]=_[_0x0ef3('0x3b')](_0x4181e2[_0x0ef3('0x38')],{'$or':_[_0x0ef3('0x2b')](_0x4181e2['attributes'],function(_0x4e163e){var _0x15ff1a={};_0x15ff1a[_0x4e163e]={'$like':'%'+_0x2b2646[_0x0ef3('0x31')][_0x0ef3('0x3a')]+'%'};return _0x15ff1a;})});}_0x4181e2=_[_0x0ef3('0x3b')]({},_0x4181e2,_0x2b2646['options']);return _0x6b03d4[_0x0ef3('0x4f')](_0x4181e2);}})[_0x0ef3('0x28')](function(_0x271fbf){if(_0x271fbf){_0xf43c6f=_0x271fbf[_0x0ef3('0x35')];if(!_0x2b2646[_0x0ef3('0x31')][_0x0ef3('0x50')](_0x0ef3('0x36'))){_0x4181e2[_0x0ef3('0x21')]=qs[_0x0ef3('0x21')](_0x2b2646[_0x0ef3('0x31')][_0x0ef3('0x21')]);_0x4181e2[_0x0ef3('0x1f')]=qs[_0x0ef3('0x1f')](_0x2b2646[_0x0ef3('0x31')][_0x0ef3('0x1f')]);}return _0x6b03d4[_0x0ef3('0x4f')](_0x4181e2);}})[_0x0ef3('0x28')](function(_0x2911dc){if(_0x2911dc){return _0x2911dc?{'count':_0xf43c6f,'rows':_0x2911dc}:null;}})[_0x0ef3('0x28')](respondWithResult(_0x38a3d7,null))[_0x0ef3('0x41')](handleError(_0x38a3d7,null));};exports['getSubjects']=function(_0x16b30d,_0x42f61c,_0x5987be){var _0x176841={};var _0x395397={};var _0x37b892;var _0x278a34;return db[_0x0ef3('0x2c')][_0x0ef3('0x4b')]({'where':{'id':_0x16b30d[_0x0ef3('0x49')]['id']}})[_0x0ef3('0x28')](handleEntityNotFound(_0x42f61c,null))[_0x0ef3('0x28')](function(_0x4c3717){if(_0x4c3717){_0x37b892=_0x4c3717;_0x395397[_0x0ef3('0x30')]=_[_0x0ef3('0x43')](db[_0x0ef3('0x4c')][_0x0ef3('0x44')]);_0x395397['query']=_[_0x0ef3('0x43')](_0x16b30d[_0x0ef3('0x31')]);_0x395397[_0x0ef3('0x32')]=_[_0x0ef3('0x33')](_0x395397[_0x0ef3('0x30')],_0x395397[_0x0ef3('0x31')]);_0x176841['attributes']=_['intersection'](_0x395397[_0x0ef3('0x30')],qs[_0x0ef3('0x4d')](_0x16b30d[_0x0ef3('0x31')][_0x0ef3('0x4d')]));_0x176841[_0x0ef3('0x34')]=_0x176841[_0x0ef3('0x34')][_0x0ef3('0x35')]?_0x176841['attributes']:_0x395397['model'];_0x176841['order']=qs[_0x0ef3('0x4e')](_0x16b30d[_0x0ef3('0x31')][_0x0ef3('0x4e')]);_0x176841[_0x0ef3('0x38')]=qs[_0x0ef3('0x32')](_[_0x0ef3('0x39')](_0x16b30d[_0x0ef3('0x31')],_0x395397[_0x0ef3('0x32')]));if(_0x16b30d[_0x0ef3('0x31')][_0x0ef3('0x3a')]){_0x176841[_0x0ef3('0x38')]=_['merge'](_0x176841[_0x0ef3('0x38')],{'$or':_[_0x0ef3('0x2b')](_0x176841[_0x0ef3('0x34')],function(_0xa0c601){var _0x30fac8={};_0x30fac8[_0xa0c601]={'$like':'%'+_0x16b30d[_0x0ef3('0x31')][_0x0ef3('0x3a')]+'%'};return _0x30fac8;})});}_0x176841=_[_0x0ef3('0x3b')]({},_0x176841,_0x16b30d[_0x0ef3('0x3d')]);return _0x37b892[_0x0ef3('0x51')](_0x176841);}})['then'](function(_0x208abf){if(_0x208abf){_0x278a34=_0x208abf[_0x0ef3('0x35')];if(!_0x16b30d[_0x0ef3('0x31')]['hasOwnProperty'](_0x0ef3('0x36'))){_0x176841['limit']=qs[_0x0ef3('0x21')](_0x16b30d['query'][_0x0ef3('0x21')]);_0x176841[_0x0ef3('0x1f')]=qs[_0x0ef3('0x1f')](_0x16b30d[_0x0ef3('0x31')][_0x0ef3('0x1f')]);}return _0x37b892[_0x0ef3('0x51')](_0x176841);}})[_0x0ef3('0x28')](function(_0x336c22){if(_0x336c22){return _0x336c22?{'count':_0x278a34,'rows':_0x336c22}:null;}})['then'](respondWithResult(_0x42f61c,null))[_0x0ef3('0x41')](handleError(_0x42f61c,null));};exports[_0x0ef3('0x52')]=function(_0x23567d,_0x4adb7d,_0x58f1c0){var _0x3fc204={};var _0x3d113f={};var _0x3431be;var _0x21dda8;return db[_0x0ef3('0x2c')]['findOne']({'where':{'id':_0x23567d[_0x0ef3('0x49')]['id']}})['then'](handleEntityNotFound(_0x4adb7d,null))['then'](function(_0x21dc46){if(_0x21dc46){_0x3431be=_0x21dc46;_0x3d113f[_0x0ef3('0x30')]=_['keys'](db[_0x0ef3('0x4c')][_0x0ef3('0x44')]);_0x3d113f[_0x0ef3('0x31')]=_[_0x0ef3('0x43')](_0x23567d['query']);_0x3d113f[_0x0ef3('0x32')]=_['intersection'](_0x3d113f['model'],_0x3d113f[_0x0ef3('0x31')]);_0x3fc204[_0x0ef3('0x34')]=_[_0x0ef3('0x33')](_0x3d113f[_0x0ef3('0x30')],qs[_0x0ef3('0x4d')](_0x23567d[_0x0ef3('0x31')][_0x0ef3('0x4d')]));_0x3fc204['attributes']=_0x3fc204[_0x0ef3('0x34')][_0x0ef3('0x35')]?_0x3fc204[_0x0ef3('0x34')]:_0x3d113f[_0x0ef3('0x30')];_0x3fc204[_0x0ef3('0x37')]=qs[_0x0ef3('0x4e')](_0x23567d[_0x0ef3('0x31')][_0x0ef3('0x4e')]);_0x3fc204[_0x0ef3('0x38')]=qs['filters'](_['pick'](_0x23567d['query'],_0x3d113f[_0x0ef3('0x32')]));if(_0x23567d[_0x0ef3('0x31')][_0x0ef3('0x3a')]){_0x3fc204[_0x0ef3('0x38')]=_[_0x0ef3('0x3b')](_0x3fc204['where'],{'$or':_[_0x0ef3('0x2b')](_0x3fc204[_0x0ef3('0x34')],function(_0x294bb1){var _0x2b35cd={};_0x2b35cd[_0x294bb1]={'$like':'%'+_0x23567d[_0x0ef3('0x31')][_0x0ef3('0x3a')]+'%'};return _0x2b35cd;})});}_0x3fc204=_[_0x0ef3('0x3b')]({},_0x3fc204,_0x23567d['options']);return _0x3431be['getDescriptions'](_0x3fc204);}})[_0x0ef3('0x28')](function(_0x43addf){if(_0x43addf){_0x21dda8=_0x43addf[_0x0ef3('0x35')];if(!_0x23567d['query']['hasOwnProperty'](_0x0ef3('0x36'))){_0x3fc204[_0x0ef3('0x21')]=qs[_0x0ef3('0x21')](_0x23567d[_0x0ef3('0x31')][_0x0ef3('0x21')]);_0x3fc204[_0x0ef3('0x1f')]=qs[_0x0ef3('0x1f')](_0x23567d[_0x0ef3('0x31')][_0x0ef3('0x1f')]);}return _0x3431be[_0x0ef3('0x52')](_0x3fc204);}})[_0x0ef3('0x28')](function(_0x71683d){if(_0x71683d){return _0x71683d?{'count':_0x21dda8,'rows':_0x71683d}:null;}})['then'](respondWithResult(_0x4adb7d,null))['catch'](handleError(_0x4adb7d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index e07d15c..9e4decf 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 _0xa36a=['moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','int_sugarcrm_configurations','util','../../config/logger'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0xa36a,0xb2));var _0xaa36=function(_0x55b1d2,_0x526d6d){_0x55b1d2=_0x55b1d2-0x0;var _0x312219=_0xa36a[_0x55b1d2];return _0x312219;};'use strict';var _=require('lodash');var util=require(_0xaa36('0x0'));var logger=require(_0xaa36('0x1'))('api');var moment=require(_0xaa36('0x2'));var BPromise=require('bluebird');var rp=require(_0xaa36('0x3'));var fs=require('fs');var path=require(_0xaa36('0x4'));var rimraf=require(_0xaa36('0x5'));var config=require(_0xaa36('0x6'));var attributes=require(_0xaa36('0x7'));module[_0xaa36('0x8')]=function(_0x1c16e4,_0x2c80f9){return _0x1c16e4['define']('SugarcrmConfiguration',attributes,{'tableName':_0xaa36('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc38f=['moment','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','api'];(function(_0x145d1e,_0x527b68){var _0x45d572=function(_0x1ebfd5){while(--_0x1ebfd5){_0x145d1e['push'](_0x145d1e['shift']());}};_0x45d572(++_0x527b68);}(_0xc38f,0xda));var _0xfc38=function(_0xb3829d,_0x1e171d){_0xb3829d=_0xb3829d-0x0;var _0x3370db=_0xc38f[_0xb3829d];return _0x3370db;};'use strict';var _=require(_0xfc38('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfc38('0x1'));var moment=require(_0xfc38('0x2'));var BPromise=require('bluebird');var rp=require(_0xfc38('0x3'));var fs=require('fs');var path=require(_0xfc38('0x4'));var rimraf=require(_0xfc38('0x5'));var config=require('../../config/environment');var attributes=require(_0xfc38('0x6'));module[_0xfc38('0x7')]=function(_0x56fa26,_0x24f938){return _0x56fa26[_0xfc38('0x8')](_0xfc38('0x9'),attributes,{'tableName':_0xfc38('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index d315466..9a0e485 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 _0x466e=['randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x212579,_0xdb4d5a){var _0x55d50e=function(_0x38fa1d){while(--_0x38fa1d){_0x212579['push'](_0x212579['shift']());}};_0x55d50e(++_0xdb4d5a);}(_0x466e,0xa4));var _0xe466=function(_0x39ebee,_0x39c39d){_0x39ebee=_0x39ebee-0x0;var _0x5d0c8c=_0x466e[_0x39ebee];return _0x5d0c8c;};'use strict';var _=require(_0xe466('0x0'));var util=require(_0xe466('0x1'));var moment=require(_0xe466('0x2'));var BPromise=require(_0xe466('0x3'));var rs=require(_0xe466('0x4'));var fs=require('fs');var Redis=require(_0xe466('0x5'));var db=require(_0xe466('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe466('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe466('0x8')][_0xe466('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x525ad8,_0x3dc0a9,_0x3760f0){return new BPromise(function(_0x4192a6,_0x4735a5){return client[_0xe466('0xa')](_0x525ad8,_0x3760f0)[_0xe466('0xb')](function(_0x2ca98d){logger['info'](_0xe466('0xc'),_0x3dc0a9,_0xe466('0xd'));logger[_0xe466('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x3dc0a9,_0xe466('0xd'),JSON[_0xe466('0xf')](_0x2ca98d));if(_0x2ca98d['error']){if(_0x2ca98d[_0xe466('0x10')][_0xe466('0x11')]===0x1f4){logger[_0xe466('0x10')](_0xe466('0xc'),_0x3dc0a9,_0x2ca98d['error'][_0xe466('0x12')]);return _0x4735a5(_0x2ca98d[_0xe466('0x10')]['message']);}logger[_0xe466('0x10')](_0xe466('0xc'),_0x3dc0a9,_0x2ca98d[_0xe466('0x10')][_0xe466('0x12')]);return _0x4192a6(_0x2ca98d[_0xe466('0x10')][_0xe466('0x12')]);}else{logger['info'](_0xe466('0xc'),_0x3dc0a9,_0xe466('0xd'));_0x4192a6(_0x2ca98d[_0xe466('0x13')][_0xe466('0x12')]);}})[_0xe466('0x14')](function(_0x424d19){logger[_0xe466('0x10')](_0xe466('0xc'),_0x3dc0a9,_0x424d19);_0x4735a5(_0x424d19);});});} \ No newline at end of file +var _0xa3fb=['code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa3fb,0x118));var _0xba3f=function(_0x30c20e,_0x22570e){_0x30c20e=_0x30c20e-0x0;var _0x350839=_0xa3fb[_0x30c20e];return _0x350839;};'use strict';var _=require(_0xba3f('0x0'));var util=require(_0xba3f('0x1'));var moment=require(_0xba3f('0x2'));var BPromise=require(_0xba3f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba3f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xba3f('0x5'));var logger=require(_0xba3f('0x6'))(_0xba3f('0x7'));var config=require(_0xba3f('0x8'));var jayson=require(_0xba3f('0x9'));var client=jayson[_0xba3f('0xa')][_0xba3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x314af2,_0x369961,_0x35b029){return new BPromise(function(_0xab1d04,_0x155e3b){return client[_0xba3f('0xc')](_0x314af2,_0x35b029)[_0xba3f('0xd')](function(_0x42db69){logger[_0xba3f('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x369961,_0xba3f('0xf'));logger['debug'](_0xba3f('0x10'),_0x369961,_0xba3f('0xf'),JSON[_0xba3f('0x11')](_0x42db69));if(_0x42db69[_0xba3f('0x12')]){if(_0x42db69[_0xba3f('0x12')][_0xba3f('0x13')]===0x1f4){logger[_0xba3f('0x12')](_0xba3f('0x14'),_0x369961,_0x42db69[_0xba3f('0x12')]['message']);return _0x155e3b(_0x42db69['error'][_0xba3f('0x15')]);}logger[_0xba3f('0x12')](_0xba3f('0x14'),_0x369961,_0x42db69[_0xba3f('0x12')][_0xba3f('0x15')]);return _0xab1d04(_0x42db69['error'][_0xba3f('0x15')]);}else{logger[_0xba3f('0xe')](_0xba3f('0x14'),_0x369961,_0xba3f('0xf'));_0xab1d04(_0x42db69[_0xba3f('0x16')]['message']);}})['catch'](function(_0x256a37){logger[_0xba3f('0x12')](_0xba3f('0x14'),_0x369961,_0x256a37);_0x155e3b(_0x256a37);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 6eca7e2..2303d7d 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 _0xd18c=['delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','post','create','put'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd18c,0x123));var _0xcd18=function(_0x19be15,_0x5271d3){_0x19be15=_0x19be15-0x0;var _0x28b46d=_0xd18c[_0x19be15];return _0x28b46d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xcd18('0x0'));var express=require(_0xcd18('0x1'));var router=express[_0xcd18('0x2')]();var fs_extra=require(_0xcd18('0x3'));var auth=require(_0xcd18('0x4'));var interaction=require(_0xcd18('0x5'));var config=require(_0xcd18('0x6'));var controller=require(_0xcd18('0x7'));router['get']('/',auth[_0xcd18('0x8')](),controller[_0xcd18('0x9')]);router[_0xcd18('0xa')](_0xcd18('0xb'),auth[_0xcd18('0x8')](),controller['show']);router[_0xcd18('0xc')]('/',auth['isAuthenticated'](),controller[_0xcd18('0xd')]);router[_0xcd18('0xe')]('/:id',auth[_0xcd18('0x8')](),controller['update']);router[_0xcd18('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xcd18('0x10')]);module[_0xcd18('0x11')]=router; \ No newline at end of file +var _0x3952=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','/:id','post','create'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3952,0x1e9));var _0x2395=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0x3952[_0x2c7dc6];return _0x10002b;};'use strict';var multer=require(_0x2395('0x0'));var util=require(_0x2395('0x1'));var path=require(_0x2395('0x2'));var timeout=require(_0x2395('0x3'));var express=require(_0x2395('0x4'));var router=express[_0x2395('0x5')]();var fs_extra=require(_0x2395('0x6'));var auth=require(_0x2395('0x7'));var interaction=require(_0x2395('0x8'));var config=require('../../config/environment');var controller=require(_0x2395('0x9'));router[_0x2395('0xa')]('/',auth[_0x2395('0xb')](),controller['index']);router['get'](_0x2395('0xc'),auth[_0x2395('0xb')](),controller['show']);router[_0x2395('0xd')]('/',auth[_0x2395('0xb')](),controller[_0x2395('0xe')]);router['put'](_0x2395('0xc'),auth[_0x2395('0xb')](),controller[_0x2395('0xf')]);router[_0x2395('0x10')](_0x2395('0xc'),auth[_0x2395('0xb')](),controller['destroy']);module[_0x2395('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index e1ed2a4..92c92c1 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 _0xef0b=['ENUM','customVariable','keyValue','string','STRING','variable','exports'];(function(_0x2fa8f8,_0x42adcd){var _0x5832f4=function(_0x1eac57){while(--_0x1eac57){_0x2fa8f8['push'](_0x2fa8f8['shift']());}};_0x5832f4(++_0x42adcd);}(_0xef0b,0x117));var _0xbef0=function(_0x287089,_0x3f4fb5){_0x287089=_0x287089-0x0;var _0x4484bd=_0xef0b[_0x287089];return _0x4484bd;};'use strict';var Sequelize=require('sequelize');module[_0xbef0('0x0')]={'type':{'type':Sequelize[_0xbef0('0x1')]('string','variable',_0xbef0('0x2'),_0xbef0('0x3'),'picklist'),'defaultValue':_0xbef0('0x4')},'content':{'type':Sequelize[_0xbef0('0x5')]},'key':{'type':Sequelize[_0xbef0('0x5')]},'keyType':{'type':Sequelize[_0xbef0('0x1')](_0xbef0('0x4'),_0xbef0('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xbef0('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbef0('0x5')]}}; \ No newline at end of file +var _0xa39e=['picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xa39e,0x175));var _0xea39=function(_0x408e33,_0x3ee9f6){_0x408e33=_0x408e33-0x0;var _0x4d9043=_0xa39e[_0x408e33];return _0x4d9043;};'use strict';var Sequelize=require(_0xea39('0x0'));module[_0xea39('0x1')]={'type':{'type':Sequelize[_0xea39('0x2')](_0xea39('0x3'),_0xea39('0x4'),'customVariable','keyValue',_0xea39('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xea39('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xea39('0x2')](_0xea39('0x3'),'variable',_0xea39('0x7'))},'keyContent':{'type':Sequelize[_0xea39('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xea39('0x6')]},'customField':{'type':Sequelize[_0xea39('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xea39('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index bd701f0..da22545 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 _0x1e73=['end','status','json','offset','count','limit','reject','save','update','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','nolimit','where','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x2f40ef,_0x248133){var _0x46d20c=function(_0xd7a562){while(--_0xd7a562){_0x2f40ef['push'](_0x2f40ef['shift']());}};_0x46d20c(++_0x248133);}(_0x1e73,0x14c));var _0x31e7=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x1e73[_0x8de54f];return _0x14cba4;};'use strict';var emlformat=require(_0x31e7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x31e7('0x1'));var moment=require(_0x31e7('0x2'));var BPromise=require(_0x31e7('0x3'));var Mustache=require('mustache');var util=require(_0x31e7('0x4'));var path=require(_0x31e7('0x5'));var sox=require(_0x31e7('0x6'));var csv=require(_0x31e7('0x7'));var ejs=require(_0x31e7('0x8'));var fs=require('fs');var fs_extra=require(_0x31e7('0x9'));var _=require(_0x31e7('0xa'));var squel=require(_0x31e7('0xb'));var crypto=require(_0x31e7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x31e7('0xd'));var toCsv=require(_0x31e7('0x7'));var querystring=require(_0x31e7('0xe'));var Papa=require(_0x31e7('0xf'));var Redis=require(_0x31e7('0x10'));var authService=require(_0x31e7('0x11'));var qs=require(_0x31e7('0x12'));var as=require(_0x31e7('0x13'));var hardwareService=require(_0x31e7('0x14'));var logger=require(_0x31e7('0x15'))(_0x31e7('0x16'));var utils=require(_0x31e7('0x17'));var config=require(_0x31e7('0x18'));var licenseUtil=require(_0x31e7('0x19'));var db=require(_0x31e7('0x1a'))['db'];function respondWithStatusCode(_0x22f696,_0x1dba57){_0x1dba57=_0x1dba57||0xcc;return function(_0x885675){if(_0x885675){return _0x22f696[_0x31e7('0x1b')](_0x1dba57);}return _0x22f696['status'](_0x1dba57)[_0x31e7('0x1c')]();};}function respondWithResult(_0x5589bf,_0x2a6744){_0x2a6744=_0x2a6744||0xc8;return function(_0x20cbc0){if(_0x20cbc0){return _0x5589bf[_0x31e7('0x1d')](_0x2a6744)[_0x31e7('0x1e')](_0x20cbc0);}};}function respondWithFilteredResult(_0x4f7173,_0x2a0e45){return function(_0x135c35){if(_0x135c35){var _0x40f402=typeof _0x2a0e45[_0x31e7('0x1f')]==='undefined'&&typeof _0x2a0e45['limit']==='undefined';var _0x54d871=_0x135c35[_0x31e7('0x20')];var _0x4ed9b0=_0x40f402?0x0:_0x2a0e45['offset'];var _0x4b264a=_0x40f402?_0x135c35[_0x31e7('0x20')]:_0x2a0e45[_0x31e7('0x1f')]+_0x2a0e45[_0x31e7('0x21')];var _0x4ff851;if(_0x4b264a>=_0x54d871){_0x4b264a=_0x54d871;_0x4ff851=0xc8;}else{_0x4ff851=0xce;}_0x4f7173[_0x31e7('0x1d')](_0x4ff851);return _0x4f7173['set']('Content-Range',_0x4ed9b0+'-'+_0x4b264a+'/'+_0x54d871)[_0x31e7('0x1e')](_0x135c35);}return null;};}function patchUpdates(_0x13ceb0){return function(_0x316bbe){try{jsonpatch['apply'](_0x316bbe,_0x13ceb0,!![]);}catch(_0xa825f9){return BPromise[_0x31e7('0x22')](_0xa825f9);}return _0x316bbe[_0x31e7('0x23')]();};}function saveUpdates(_0x3f51d2,_0x2fe849){return function(_0xc21eb0){if(_0xc21eb0){return _0xc21eb0[_0x31e7('0x24')](_0x3f51d2)[_0x31e7('0x25')](function(_0x5606c7){return _0x5606c7;});}return null;};}function removeEntity(_0x2ab78b,_0x4d7643){return function(_0x2f021f){if(_0x2f021f){return _0x2f021f[_0x31e7('0x26')]()[_0x31e7('0x25')](function(){_0x2ab78b['status'](0xcc)[_0x31e7('0x1c')]();});}};}function handleEntityNotFound(_0x4a37ec,_0x3f63fb){return function(_0x57bce4){if(!_0x57bce4){_0x4a37ec['sendStatus'](0x194);}return _0x57bce4;};}function handleError(_0x375ab8,_0x2f1885){_0x2f1885=_0x2f1885||0x1f4;return function(_0x43b24a){logger[_0x31e7('0x27')](_0x43b24a[_0x31e7('0x28')]);if(_0x43b24a['name']){delete _0x43b24a[_0x31e7('0x29')];}_0x375ab8['status'](_0x2f1885)[_0x31e7('0x2a')](_0x43b24a);};}exports[_0x31e7('0x2b')]=function(_0x166765,_0x25e230){var _0x24e658={},_0x2ec814={},_0x1f38c1={'count':0x0,'rows':[]};var _0x5ead6e=_['map'](db[_0x31e7('0x2c')][_0x31e7('0x2d')],function(_0x42a6f0){return{'name':_0x42a6f0['fieldName'],'type':_0x42a6f0[_0x31e7('0x2e')][_0x31e7('0x2f')]};});_0x2ec814['model']=_['map'](_0x5ead6e,_0x31e7('0x29'));_0x2ec814['query']=_[_0x31e7('0x30')](_0x166765[_0x31e7('0x31')]);_0x2ec814[_0x31e7('0x32')]=_[_0x31e7('0x33')](_0x2ec814[_0x31e7('0x34')],_0x2ec814[_0x31e7('0x31')]);_0x24e658[_0x31e7('0x35')]=_[_0x31e7('0x33')](_0x2ec814[_0x31e7('0x34')],qs[_0x31e7('0x36')](_0x166765['query'][_0x31e7('0x36')]));_0x24e658['attributes']=_0x24e658[_0x31e7('0x35')]['length']?_0x24e658[_0x31e7('0x35')]:_0x2ec814[_0x31e7('0x34')];if(!_0x166765[_0x31e7('0x31')]['hasOwnProperty'](_0x31e7('0x37'))){_0x24e658[_0x31e7('0x21')]=qs[_0x31e7('0x21')](_0x166765[_0x31e7('0x31')][_0x31e7('0x21')]);_0x24e658[_0x31e7('0x1f')]=qs[_0x31e7('0x1f')](_0x166765[_0x31e7('0x31')][_0x31e7('0x1f')]);}_0x24e658['order']=qs['sort'](_0x166765[_0x31e7('0x31')]['sort']);_0x24e658[_0x31e7('0x38')]=qs[_0x31e7('0x32')](_['pick'](_0x166765[_0x31e7('0x31')],_0x2ec814[_0x31e7('0x32')]),_0x5ead6e);if(_0x166765['query'][_0x31e7('0x39')]){_0x24e658[_0x31e7('0x38')]=_[_0x31e7('0x3a')](_0x24e658[_0x31e7('0x38')],{'$or':_[_0x31e7('0x3b')](_0x5ead6e,function(_0x43f61c){if(_0x43f61c['type']!==_0x31e7('0x3c')){var _0x5a423a={};_0x5a423a[_0x43f61c[_0x31e7('0x29')]]={'$like':'%'+_0x166765['query'][_0x31e7('0x39')]+'%'};return _0x5a423a;}})});}_0x24e658=_[_0x31e7('0x3a')]({},_0x24e658,_0x166765[_0x31e7('0x3d')]);var _0x2997a6={'where':_0x24e658[_0x31e7('0x38')]};return db[_0x31e7('0x2c')]['count'](_0x2997a6)[_0x31e7('0x25')](function(_0xa1008e){_0x1f38c1['count']=_0xa1008e;if(_0x166765['query']['includeAll']){_0x24e658[_0x31e7('0x3e')]=[{'all':!![]}];}return db[_0x31e7('0x2c')][_0x31e7('0x3f')](_0x24e658);})[_0x31e7('0x25')](function(_0x237c2c){_0x1f38c1[_0x31e7('0x40')]=_0x237c2c;return _0x1f38c1;})[_0x31e7('0x25')](respondWithFilteredResult(_0x25e230,_0x24e658))[_0x31e7('0x41')](handleError(_0x25e230,null));};exports[_0x31e7('0x42')]=function(_0xd287ed,_0x30ef9b){var _0x2a056d={'raw':!![],'where':{'id':_0xd287ed[_0x31e7('0x43')]['id']}},_0x5a3399={};_0x5a3399[_0x31e7('0x34')]=_[_0x31e7('0x30')](db[_0x31e7('0x2c')][_0x31e7('0x2d')]);_0x5a3399[_0x31e7('0x31')]=_[_0x31e7('0x30')](_0xd287ed['query']);_0x5a3399[_0x31e7('0x32')]=_[_0x31e7('0x33')](_0x5a3399['model'],_0x5a3399[_0x31e7('0x31')]);_0x2a056d[_0x31e7('0x35')]=_[_0x31e7('0x33')](_0x5a3399[_0x31e7('0x34')],qs[_0x31e7('0x36')](_0xd287ed[_0x31e7('0x31')][_0x31e7('0x36')]));_0x2a056d[_0x31e7('0x35')]=_0x2a056d[_0x31e7('0x35')][_0x31e7('0x44')]?_0x2a056d[_0x31e7('0x35')]:_0x5a3399['model'];if(_0xd287ed[_0x31e7('0x31')]['includeAll']){_0x2a056d[_0x31e7('0x3e')]=[{'all':!![]}];}_0x2a056d=_[_0x31e7('0x3a')]({},_0x2a056d,_0xd287ed[_0x31e7('0x3d')]);return db[_0x31e7('0x2c')][_0x31e7('0x45')](_0x2a056d)['then'](handleEntityNotFound(_0x30ef9b,null))[_0x31e7('0x25')](respondWithResult(_0x30ef9b,null))[_0x31e7('0x41')](handleError(_0x30ef9b,null));};exports[_0x31e7('0x46')]=function(_0x59d650,_0x166cc6){return db[_0x31e7('0x2c')]['create'](_0x59d650[_0x31e7('0x47')],{})[_0x31e7('0x25')](respondWithResult(_0x166cc6,0xc9))[_0x31e7('0x41')](handleError(_0x166cc6,null));};exports[_0x31e7('0x24')]=function(_0x1caeb8,_0x41de5e){if(_0x1caeb8[_0x31e7('0x47')]['id']){delete _0x1caeb8['body']['id'];}return db[_0x31e7('0x2c')][_0x31e7('0x45')]({'where':{'id':_0x1caeb8[_0x31e7('0x43')]['id']}})[_0x31e7('0x25')](handleEntityNotFound(_0x41de5e,null))[_0x31e7('0x25')](saveUpdates(_0x1caeb8[_0x31e7('0x47')],null))[_0x31e7('0x25')](respondWithResult(_0x41de5e,null))[_0x31e7('0x41')](handleError(_0x41de5e,null));};exports[_0x31e7('0x26')]=function(_0x19790c,_0x48b0c7){return db[_0x31e7('0x2c')][_0x31e7('0x45')]({'where':{'id':_0x19790c[_0x31e7('0x43')]['id']}})[_0x31e7('0x25')](handleEntityNotFound(_0x48b0c7,null))[_0x31e7('0x25')](removeEntity(_0x48b0c7,null))[_0x31e7('0x41')](handleError(_0x48b0c7,null));}; \ No newline at end of file +var _0x04f7=['path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','SugarcrmField','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x460b98,_0x584dcb){var _0x427817=function(_0x2a1cad){while(--_0x2a1cad){_0x460b98['push'](_0x460b98['shift']());}};_0x427817(++_0x584dcb);}(_0x04f7,0x1cb));var _0x704f=function(_0x596d31,_0x1b1942){_0x596d31=_0x596d31-0x0;var _0x335fd5=_0x04f7[_0x596d31];return _0x335fd5;};'use strict';var emlformat=require(_0x704f('0x0'));var rimraf=require(_0x704f('0x1'));var zipdir=require(_0x704f('0x2'));var jsonpatch=require(_0x704f('0x3'));var rp=require(_0x704f('0x4'));var moment=require(_0x704f('0x5'));var BPromise=require(_0x704f('0x6'));var Mustache=require(_0x704f('0x7'));var util=require(_0x704f('0x8'));var path=require(_0x704f('0x9'));var sox=require(_0x704f('0xa'));var csv=require(_0x704f('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x704f('0xc'));var squel=require('squel');var crypto=require(_0x704f('0xd'));var jsforce=require(_0x704f('0xe'));var deskjs=require(_0x704f('0xf'));var toCsv=require(_0x704f('0xb'));var querystring=require(_0x704f('0x10'));var Papa=require(_0x704f('0x11'));var Redis=require(_0x704f('0x12'));var authService=require(_0x704f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x704f('0x14'));var hardwareService=require(_0x704f('0x15'));var logger=require(_0x704f('0x16'))(_0x704f('0x17'));var utils=require(_0x704f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x704f('0x19'));var db=require(_0x704f('0x1a'))['db'];function respondWithStatusCode(_0x3c5fb0,_0x2aad07){_0x2aad07=_0x2aad07||0xcc;return function(_0x234fa7){if(_0x234fa7){return _0x3c5fb0[_0x704f('0x1b')](_0x2aad07);}return _0x3c5fb0[_0x704f('0x1c')](_0x2aad07)[_0x704f('0x1d')]();};}function respondWithResult(_0x2813ab,_0x4b9a00){_0x4b9a00=_0x4b9a00||0xc8;return function(_0x1d941b){if(_0x1d941b){return _0x2813ab['status'](_0x4b9a00)[_0x704f('0x1e')](_0x1d941b);}};}function respondWithFilteredResult(_0x539f70,_0x57b1a4){return function(_0x55762f){if(_0x55762f){var _0xfde113=typeof _0x57b1a4[_0x704f('0x1f')]==='undefined'&&typeof _0x57b1a4['limit']===_0x704f('0x20');var _0x208416=_0x55762f[_0x704f('0x21')];var _0x20653f=_0xfde113?0x0:_0x57b1a4[_0x704f('0x1f')];var _0x250d58=_0xfde113?_0x55762f[_0x704f('0x21')]:_0x57b1a4[_0x704f('0x1f')]+_0x57b1a4[_0x704f('0x22')];var _0x404c3b;if(_0x250d58>=_0x208416){_0x250d58=_0x208416;_0x404c3b=0xc8;}else{_0x404c3b=0xce;}_0x539f70[_0x704f('0x1c')](_0x404c3b);return _0x539f70[_0x704f('0x23')](_0x704f('0x24'),_0x20653f+'-'+_0x250d58+'/'+_0x208416)[_0x704f('0x1e')](_0x55762f);}return null;};}function patchUpdates(_0x322617){return function(_0x157e4d){try{jsonpatch['apply'](_0x157e4d,_0x322617,!![]);}catch(_0x206a16){return BPromise[_0x704f('0x25')](_0x206a16);}return _0x157e4d[_0x704f('0x26')]();};}function saveUpdates(_0x511b59,_0xdbb335){return function(_0x1e17a9){if(_0x1e17a9){return _0x1e17a9[_0x704f('0x27')](_0x511b59)['then'](function(_0x16ae01){return _0x16ae01;});}return null;};}function removeEntity(_0x1644ce,_0x5f1f3c){return function(_0x53338e){if(_0x53338e){return _0x53338e[_0x704f('0x28')]()[_0x704f('0x29')](function(){_0x1644ce[_0x704f('0x1c')](0xcc)[_0x704f('0x1d')]();});}};}function handleEntityNotFound(_0xe62646,_0x4acc53){return function(_0x501d40){if(!_0x501d40){_0xe62646['sendStatus'](0x194);}return _0x501d40;};}function handleError(_0x20116a,_0x56c42f){_0x56c42f=_0x56c42f||0x1f4;return function(_0x2e207c){logger[_0x704f('0x2a')](_0x2e207c[_0x704f('0x2b')]);if(_0x2e207c[_0x704f('0x2c')]){delete _0x2e207c[_0x704f('0x2c')];}_0x20116a[_0x704f('0x1c')](_0x56c42f)[_0x704f('0x2d')](_0x2e207c);};}exports[_0x704f('0x2e')]=function(_0x38b750,_0x4d0bd5){var _0x239d31={},_0x3a4e25={},_0x47c940={'count':0x0,'rows':[]};var _0x470fd2=_[_0x704f('0x2f')](db[_0x704f('0x30')]['rawAttributes'],function(_0x4279b7){return{'name':_0x4279b7[_0x704f('0x31')],'type':_0x4279b7[_0x704f('0x32')][_0x704f('0x33')]};});_0x3a4e25[_0x704f('0x34')]=_[_0x704f('0x2f')](_0x470fd2,_0x704f('0x2c'));_0x3a4e25[_0x704f('0x35')]=_[_0x704f('0x36')](_0x38b750[_0x704f('0x35')]);_0x3a4e25[_0x704f('0x37')]=_[_0x704f('0x38')](_0x3a4e25['model'],_0x3a4e25[_0x704f('0x35')]);_0x239d31['attributes']=_['intersection'](_0x3a4e25['model'],qs[_0x704f('0x39')](_0x38b750['query'][_0x704f('0x39')]));_0x239d31[_0x704f('0x3a')]=_0x239d31[_0x704f('0x3a')]['length']?_0x239d31[_0x704f('0x3a')]:_0x3a4e25[_0x704f('0x34')];if(!_0x38b750['query'][_0x704f('0x3b')](_0x704f('0x3c'))){_0x239d31[_0x704f('0x22')]=qs['limit'](_0x38b750['query'][_0x704f('0x22')]);_0x239d31[_0x704f('0x1f')]=qs[_0x704f('0x1f')](_0x38b750[_0x704f('0x35')][_0x704f('0x1f')]);}_0x239d31['order']=qs['sort'](_0x38b750[_0x704f('0x35')][_0x704f('0x3d')]);_0x239d31[_0x704f('0x3e')]=qs[_0x704f('0x37')](_['pick'](_0x38b750['query'],_0x3a4e25[_0x704f('0x37')]),_0x470fd2);if(_0x38b750[_0x704f('0x35')][_0x704f('0x3f')]){_0x239d31[_0x704f('0x3e')]=_[_0x704f('0x40')](_0x239d31[_0x704f('0x3e')],{'$or':_['map'](_0x470fd2,function(_0x220810){if(_0x220810['type']!=='VIRTUAL'){var _0x1bf3f6={};_0x1bf3f6[_0x220810[_0x704f('0x2c')]]={'$like':'%'+_0x38b750[_0x704f('0x35')][_0x704f('0x3f')]+'%'};return _0x1bf3f6;}})});}_0x239d31=_[_0x704f('0x40')]({},_0x239d31,_0x38b750[_0x704f('0x41')]);var _0x46888c={'where':_0x239d31[_0x704f('0x3e')]};return db['SugarcrmField'][_0x704f('0x21')](_0x46888c)[_0x704f('0x29')](function(_0x6af4b9){_0x47c940[_0x704f('0x21')]=_0x6af4b9;if(_0x38b750['query']['includeAll']){_0x239d31[_0x704f('0x42')]=[{'all':!![]}];}return db[_0x704f('0x30')][_0x704f('0x43')](_0x239d31);})[_0x704f('0x29')](function(_0x355552){_0x47c940[_0x704f('0x44')]=_0x355552;return _0x47c940;})[_0x704f('0x29')](respondWithFilteredResult(_0x4d0bd5,_0x239d31))[_0x704f('0x45')](handleError(_0x4d0bd5,null));};exports[_0x704f('0x46')]=function(_0x17f691,_0x4607d8){var _0x3f891d={'raw':!![],'where':{'id':_0x17f691[_0x704f('0x47')]['id']}},_0xc9b9e7={};_0xc9b9e7[_0x704f('0x34')]=_[_0x704f('0x36')](db[_0x704f('0x30')][_0x704f('0x48')]);_0xc9b9e7[_0x704f('0x35')]=_[_0x704f('0x36')](_0x17f691[_0x704f('0x35')]);_0xc9b9e7[_0x704f('0x37')]=_[_0x704f('0x38')](_0xc9b9e7[_0x704f('0x34')],_0xc9b9e7[_0x704f('0x35')]);_0x3f891d[_0x704f('0x3a')]=_[_0x704f('0x38')](_0xc9b9e7[_0x704f('0x34')],qs[_0x704f('0x39')](_0x17f691[_0x704f('0x35')]['fields']));_0x3f891d[_0x704f('0x3a')]=_0x3f891d[_0x704f('0x3a')][_0x704f('0x49')]?_0x3f891d[_0x704f('0x3a')]:_0xc9b9e7[_0x704f('0x34')];if(_0x17f691['query'][_0x704f('0x4a')]){_0x3f891d[_0x704f('0x42')]=[{'all':!![]}];}_0x3f891d=_['merge']({},_0x3f891d,_0x17f691[_0x704f('0x41')]);return db[_0x704f('0x30')]['find'](_0x3f891d)[_0x704f('0x29')](handleEntityNotFound(_0x4607d8,null))[_0x704f('0x29')](respondWithResult(_0x4607d8,null))[_0x704f('0x45')](handleError(_0x4607d8,null));};exports[_0x704f('0x4b')]=function(_0x35c00a,_0xcf1dda){return db[_0x704f('0x30')][_0x704f('0x4b')](_0x35c00a['body'],{})[_0x704f('0x29')](respondWithResult(_0xcf1dda,0xc9))['catch'](handleError(_0xcf1dda,null));};exports[_0x704f('0x27')]=function(_0x12d217,_0x30c7d1){if(_0x12d217['body']['id']){delete _0x12d217[_0x704f('0x4c')]['id'];}return db['SugarcrmField'][_0x704f('0x4d')]({'where':{'id':_0x12d217['params']['id']}})[_0x704f('0x29')](handleEntityNotFound(_0x30c7d1,null))['then'](saveUpdates(_0x12d217[_0x704f('0x4c')],null))[_0x704f('0x29')](respondWithResult(_0x30c7d1,null))[_0x704f('0x45')](handleError(_0x30c7d1,null));};exports['destroy']=function(_0x5647b2,_0x47923f){return db[_0x704f('0x30')][_0x704f('0x4d')]({'where':{'id':_0x5647b2['params']['id']}})[_0x704f('0x29')](handleEntityNotFound(_0x47923f,null))[_0x704f('0x29')](removeEntity(_0x47923f,null))[_0x704f('0x45')](handleError(_0x47923f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 152d298..2ba3531 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 _0x79aa=['define','SugarcrmField','int_sugarcrm_fields','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes'];(function(_0x53a3d7,_0x5be9b5){var _0x278183=function(_0x1be282){while(--_0x1be282){_0x53a3d7['push'](_0x53a3d7['shift']());}};_0x278183(++_0x5be9b5);}(_0x79aa,0xc7));var _0xa79a=function(_0x21f28f,_0x3be6b8){_0x21f28f=_0x21f28f-0x0;var _0x180f21=_0x79aa[_0x21f28f];return _0x180f21;};'use strict';var _=require(_0xa79a('0x0'));var util=require(_0xa79a('0x1'));var logger=require(_0xa79a('0x2'))(_0xa79a('0x3'));var moment=require(_0xa79a('0x4'));var BPromise=require(_0xa79a('0x5'));var rp=require(_0xa79a('0x6'));var fs=require('fs');var path=require(_0xa79a('0x7'));var rimraf=require(_0xa79a('0x8'));var config=require(_0xa79a('0x9'));var attributes=require(_0xa79a('0xa'));module['exports']=function(_0x4f0453,_0x2b8ba7){return _0x4f0453[_0xa79a('0xb')](_0xa79a('0xc'),attributes,{'tableName':_0xa79a('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xa79a('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xccb0=['request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util','api','moment','bluebird'];(function(_0x2d056d,_0x53f6c3){var _0x430fca=function(_0x38e4ee){while(--_0x38e4ee){_0x2d056d['push'](_0x2d056d['shift']());}};_0x430fca(++_0x53f6c3);}(_0xccb0,0x19f));var _0x0ccb=function(_0x25d218,_0x64ef1e){_0x25d218=_0x25d218-0x0;var _0x48bd41=_0xccb0[_0x25d218];return _0x48bd41;};'use strict';var _=require(_0x0ccb('0x0'));var util=require(_0x0ccb('0x1'));var logger=require('../../config/logger')(_0x0ccb('0x2'));var moment=require(_0x0ccb('0x3'));var BPromise=require(_0x0ccb('0x4'));var rp=require(_0x0ccb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ccb('0x6'));var config=require(_0x0ccb('0x7'));var attributes=require(_0x0ccb('0x8'));module['exports']=function(_0x85356f,_0x4ea887){return _0x85356f[_0x0ccb('0x9')](_0x0ccb('0xa'),attributes,{'tableName':_0x0ccb('0xb'),'paranoid':![],'indexes':[{'name':_0x0ccb('0xc'),'fields':[_0x0ccb('0xd'),'FieldId'],'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 eec5503..c6ae1c5 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 _0x3bd8=['error','code','SugarcrmField,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x247be6,_0x5a1359){var _0x28a4cf=function(_0x43ffa1){while(--_0x43ffa1){_0x247be6['push'](_0x247be6['shift']());}};_0x28a4cf(++_0x5a1359);}(_0x3bd8,0x181));var _0x83bd=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0x3bd8[_0x5cc8b9];return _0x58892e;};'use strict';var _=require('lodash');var util=require(_0x83bd('0x0'));var moment=require(_0x83bd('0x1'));var BPromise=require(_0x83bd('0x2'));var rs=require(_0x83bd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x83bd('0x5'))(_0x83bd('0x6'));var config=require(_0x83bd('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d4dce,_0x21c9b7,_0x5bc052){return new BPromise(function(_0x27a730,_0x2d1a3d){return client['request'](_0x4d4dce,_0x5bc052)[_0x83bd('0x8')](function(_0x3a8e9a){logger[_0x83bd('0x9')]('SugarcrmField,\x20%s,\x20%s',_0x21c9b7,_0x83bd('0xa'));logger[_0x83bd('0xb')](_0x83bd('0xc'),_0x21c9b7,_0x83bd('0xa'),JSON[_0x83bd('0xd')](_0x3a8e9a));if(_0x3a8e9a['error']){if(_0x3a8e9a[_0x83bd('0xe')][_0x83bd('0xf')]===0x1f4){logger[_0x83bd('0xe')](_0x83bd('0x10'),_0x21c9b7,_0x3a8e9a['error']['message']);return _0x2d1a3d(_0x3a8e9a[_0x83bd('0xe')][_0x83bd('0x11')]);}logger[_0x83bd('0xe')](_0x83bd('0x10'),_0x21c9b7,_0x3a8e9a['error']['message']);return _0x27a730(_0x3a8e9a[_0x83bd('0xe')][_0x83bd('0x11')]);}else{logger['info'](_0x83bd('0x10'),_0x21c9b7,_0x83bd('0xa'));_0x27a730(_0x3a8e9a[_0x83bd('0x12')][_0x83bd('0x11')]);}})['catch'](function(_0xc786cd){logger[_0x83bd('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x21c9b7,_0xc786cd);_0x2d1a3d(_0xc786cd);});});} \ No newline at end of file +var _0xd7d9=['lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','request','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x3a0ea3,_0x5169c9){var _0x4c7765=function(_0x1f50e2){while(--_0x1f50e2){_0x3a0ea3['push'](_0x3a0ea3['shift']());}};_0x4c7765(++_0x5169c9);}(_0xd7d9,0x143));var _0x9d7d=function(_0x682d41,_0x555e2c){_0x682d41=_0x682d41-0x0;var _0x5f6daf=_0xd7d9[_0x682d41];return _0x5f6daf;};'use strict';var _=require(_0x9d7d('0x0'));var util=require(_0x9d7d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d7d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d7d('0x3'))['db'];var utils=require(_0x9d7d('0x4'));var logger=require(_0x9d7d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9d7d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b3b06,_0x5e5f55,_0x1b108f){return new BPromise(function(_0x260e12,_0x404ce4){return client[_0x9d7d('0x7')](_0x4b3b06,_0x1b108f)['then'](function(_0x49cec4){logger['info'](_0x9d7d('0x8'),_0x5e5f55,_0x9d7d('0x9'));logger[_0x9d7d('0xa')](_0x9d7d('0xb'),_0x5e5f55,'request\x20sent',JSON[_0x9d7d('0xc')](_0x49cec4));if(_0x49cec4[_0x9d7d('0xd')]){if(_0x49cec4[_0x9d7d('0xd')][_0x9d7d('0xe')]===0x1f4){logger[_0x9d7d('0xd')](_0x9d7d('0x8'),_0x5e5f55,_0x49cec4[_0x9d7d('0xd')]['message']);return _0x404ce4(_0x49cec4[_0x9d7d('0xd')][_0x9d7d('0xf')]);}logger[_0x9d7d('0xd')](_0x9d7d('0x8'),_0x5e5f55,_0x49cec4['error'][_0x9d7d('0xf')]);return _0x260e12(_0x49cec4[_0x9d7d('0xd')][_0x9d7d('0xf')]);}else{logger['info'](_0x9d7d('0x8'),_0x5e5f55,_0x9d7d('0x9'));_0x260e12(_0x49cec4['result'][_0x9d7d('0xf')]);}})[_0x9d7d('0x10')](function(_0x45f81e){logger[_0x9d7d('0xd')](_0x9d7d('0x8'),_0x5e5f55,_0x45f81e);_0x404ce4(_0x45f81e);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 63eaac7..4475fe6 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 _0xb028=['create','put','update','/:id','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','isAuthenticated','show','get','/:id/configurations','getConfigurations','post'];(function(_0x197f52,_0x56fe75){var _0x22cc9f=function(_0x549103){while(--_0x549103){_0x197f52['push'](_0x197f52['shift']());}};_0x22cc9f(++_0x56fe75);}(_0xb028,0x72));var _0x8b02=function(_0x241ee0,_0x3d2c4d){_0x241ee0=_0x241ee0-0x0;var _0x4f3b96=_0xb028[_0x241ee0];return _0x4f3b96;};'use strict';var multer=require(_0x8b02('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8b02('0x1'));var express=require('express');var router=express[_0x8b02('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8b02('0x3'));var interaction=require(_0x8b02('0x4'));var config=require('../../config/environment');var controller=require(_0x8b02('0x5'));router['get']('/',auth[_0x8b02('0x6')](),controller['index']);router['get']('/:id',auth[_0x8b02('0x6')](),controller[_0x8b02('0x7')]);router[_0x8b02('0x8')](_0x8b02('0x9'),auth[_0x8b02('0x6')](),controller[_0x8b02('0xa')]);router[_0x8b02('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x8b02('0xb')]('/',auth[_0x8b02('0x6')](),controller[_0x8b02('0xc')]);router[_0x8b02('0xb')](_0x8b02('0x9'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x8b02('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x8b02('0xe')]);router['delete'](_0x8b02('0xf'),auth[_0x8b02('0x6')](),controller[_0x8b02('0x10')]);module[_0x8b02('0x11')]=router; \ No newline at end of file +var _0x89fe=['post','create','delete','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields'];(function(_0x3bda84,_0x44e32e){var _0x53cdec=function(_0x59e198){while(--_0x59e198){_0x3bda84['push'](_0x3bda84['shift']());}};_0x53cdec(++_0x44e32e);}(_0x89fe,0x83));var _0xe89f=function(_0x4be420,_0x566e90){_0x4be420=_0x4be420-0x0;var _0x1538cc=_0x89fe[_0x4be420];return _0x1538cc;};'use strict';var multer=require(_0xe89f('0x0'));var util=require(_0xe89f('0x1'));var path=require(_0xe89f('0x2'));var timeout=require(_0xe89f('0x3'));var express=require('express');var router=express[_0xe89f('0x4')]();var fs_extra=require(_0xe89f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe89f('0x6'));var config=require(_0xe89f('0x7'));var controller=require(_0xe89f('0x8'));router[_0xe89f('0x9')]('/',auth[_0xe89f('0xa')](),controller[_0xe89f('0xb')]);router[_0xe89f('0x9')]('/:id',auth[_0xe89f('0xa')](),controller[_0xe89f('0xc')]);router[_0xe89f('0x9')](_0xe89f('0xd'),auth[_0xe89f('0xa')](),controller['getConfigurations']);router[_0xe89f('0x9')](_0xe89f('0xe'),auth[_0xe89f('0xa')](),controller[_0xe89f('0xf')]);router[_0xe89f('0x10')]('/',auth[_0xe89f('0xa')](),controller[_0xe89f('0x11')]);router[_0xe89f('0x10')](_0xe89f('0xd'),auth[_0xe89f('0xa')](),controller['addConfiguration']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe89f('0x12')](_0xe89f('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0xe89f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f514e13..f37169f 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 _0x83a2=['STRING','HelpDesk','sequelize','exports'];(function(_0x5976c6,_0xa78bb2){var _0x1de4b0=function(_0x14c63a){while(--_0x14c63a){_0x5976c6['push'](_0x5976c6['shift']());}};_0x1de4b0(++_0xa78bb2);}(_0x83a2,0x12a));var _0x283a=function(_0xbe1ff9,_0x15ce7f){_0xbe1ff9=_0xbe1ff9-0x0;var _0x4947e3=_0x83a2[_0xbe1ff9];return _0x4947e3;};'use strict';var Sequelize=require(_0x283a('0x0'));module[_0x283a('0x1')]={'name':{'type':Sequelize[_0x283a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x283a('0x2')]},'username':{'type':Sequelize[_0x283a('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x283a('0x2')],'allowNull':![],'defaultValue':_0x283a('0x3')},'remoteUri':{'type':Sequelize[_0x283a('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x283a('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x283a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xde42=['sequelize','STRING','HelpDesk'];(function(_0xcce84a,_0x148a0a){var _0x273e9d=function(_0x318266){while(--_0x318266){_0xcce84a['push'](_0xcce84a['shift']());}};_0x273e9d(++_0x148a0a);}(_0xde42,0x1cb));var _0x2de4=function(_0x117926,_0x268445){_0x117926=_0x117926-0x0;var _0xc34604=_0xde42[_0x117926];return _0xc34604;};'use strict';var Sequelize=require(_0x2de4('0x0'));module['exports']={'name':{'type':Sequelize[_0x2de4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2de4('0x1')]},'username':{'type':Sequelize[_0x2de4('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2de4('0x2')},'remoteUri':{'type':Sequelize[_0x2de4('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x2de4('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 457d327..2982e3b 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 _0xf2a1=['length','order','sort','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','GET','getchallenge','success','POST','login','describe','result','sessionName','owner','remove','includes','editable','false','label','startsWith','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','end','json','offset','undefined','count','limit','status','Content-Range','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','filters','pick','VIRTUAL','filter','merge','options','where','VtigerAccount','includeAll','include','show','params','find','catch','create','body','destroy','getConfigurations','VtigerConfiguration'];(function(_0xdf0296,_0x149741){var _0x7c46db=function(_0x25663d){while(--_0x25663d){_0xdf0296['push'](_0xdf0296['shift']());}};_0x7c46db(++_0x149741);}(_0xf2a1,0x1f1));var _0x1f2a=function(_0x244b6b,_0x23d177){_0x244b6b=_0x244b6b-0x0;var _0x333042=_0xf2a1[_0x244b6b];return _0x333042;};'use strict';var emlformat=require(_0x1f2a('0x0'));var rimraf=require(_0x1f2a('0x1'));var zipdir=require(_0x1f2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f2a('0x3'));var moment=require(_0x1f2a('0x4'));var BPromise=require(_0x1f2a('0x5'));var Mustache=require('mustache');var util=require(_0x1f2a('0x6'));var path=require(_0x1f2a('0x7'));var sox=require(_0x1f2a('0x8'));var csv=require('to-csv');var ejs=require(_0x1f2a('0x9'));var fs=require('fs');var fs_extra=require(_0x1f2a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1f2a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1f2a('0xc'));var Papa=require('papaparse');var Redis=require(_0x1f2a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1f2a('0xe'));var as=require(_0x1f2a('0xf'));var hardwareService=require(_0x1f2a('0x10'));var logger=require(_0x1f2a('0x11'))(_0x1f2a('0x12'));var utils=require(_0x1f2a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1f2a('0x14'))['db'];var integrations=require(_0x1f2a('0x15'));function respondWithStatusCode(_0x977ad8,_0x5455ae){_0x5455ae=_0x5455ae||0xcc;return function(_0x3a128d){if(_0x3a128d){return _0x977ad8['sendStatus'](_0x5455ae);}return _0x977ad8['status'](_0x5455ae)[_0x1f2a('0x16')]();};}function respondWithResult(_0x1715d1,_0x291371){_0x291371=_0x291371||0xc8;return function(_0x4ddd61){if(_0x4ddd61){return _0x1715d1['status'](_0x291371)[_0x1f2a('0x17')](_0x4ddd61);}};}function respondWithFilteredResult(_0x51f553,_0x558a7f){return function(_0x1aa657){if(_0x1aa657){var _0x2ef7e7=typeof _0x558a7f[_0x1f2a('0x18')]===_0x1f2a('0x19')&&typeof _0x558a7f['limit']===_0x1f2a('0x19');var _0x355081=_0x1aa657['count'];var _0x34f419=_0x2ef7e7?0x0:_0x558a7f[_0x1f2a('0x18')];var _0x3b9880=_0x2ef7e7?_0x1aa657[_0x1f2a('0x1a')]:_0x558a7f[_0x1f2a('0x18')]+_0x558a7f[_0x1f2a('0x1b')];var _0x4ebcdb;if(_0x3b9880>=_0x355081){_0x3b9880=_0x355081;_0x4ebcdb=0xc8;}else{_0x4ebcdb=0xce;}_0x51f553[_0x1f2a('0x1c')](_0x4ebcdb);return _0x51f553['set'](_0x1f2a('0x1d'),_0x34f419+'-'+_0x3b9880+'/'+_0x355081)[_0x1f2a('0x17')](_0x1aa657);}return null;};}function patchUpdates(_0x5cb503){return function(_0x235b83){try{jsonpatch['apply'](_0x235b83,_0x5cb503,!![]);}catch(_0x4b494e){return BPromise['reject'](_0x4b494e);}return _0x235b83['save']();};}function saveUpdates(_0x49cb75,_0x37f555){return function(_0x4f2527){if(_0x4f2527){return _0x4f2527['update'](_0x49cb75)[_0x1f2a('0x1e')](function(_0x209aa0){return _0x209aa0;});}return null;};}function removeEntity(_0x50bd3e,_0x576a30){return function(_0x3d31ba){if(_0x3d31ba){return _0x3d31ba['destroy']()[_0x1f2a('0x1e')](function(){_0x50bd3e[_0x1f2a('0x1c')](0xcc)[_0x1f2a('0x16')]();});}};}function handleEntityNotFound(_0x10eb8c,_0x2a1556){return function(_0x944b72){if(!_0x944b72){_0x10eb8c['sendStatus'](0x194);}return _0x944b72;};}function handleError(_0x24789f,_0x17624c){_0x17624c=_0x17624c||0x1f4;return function(_0x447b27){logger[_0x1f2a('0x1f')](_0x447b27[_0x1f2a('0x20')]);if(_0x447b27[_0x1f2a('0x21')]){delete _0x447b27[_0x1f2a('0x21')];}_0x24789f[_0x1f2a('0x1c')](_0x17624c)[_0x1f2a('0x22')](_0x447b27);};}exports[_0x1f2a('0x23')]=function(_0x4c044d,_0x3ca921){var _0x5357f0={},_0x375fcf={},_0xa76596={'count':0x0,'rows':[]};var _0x1be6f2=_[_0x1f2a('0x24')](db['VtigerAccount'][_0x1f2a('0x25')],function(_0x3de9f0){return{'name':_0x3de9f0[_0x1f2a('0x26')],'type':_0x3de9f0[_0x1f2a('0x27')][_0x1f2a('0x28')]};});_0x375fcf[_0x1f2a('0x29')]=_['map'](_0x1be6f2,'name');_0x375fcf[_0x1f2a('0x2a')]=_[_0x1f2a('0x2b')](_0x4c044d[_0x1f2a('0x2a')]);_0x375fcf['filters']=_[_0x1f2a('0x2c')](_0x375fcf[_0x1f2a('0x29')],_0x375fcf[_0x1f2a('0x2a')]);_0x5357f0['attributes']=_[_0x1f2a('0x2c')](_0x375fcf[_0x1f2a('0x29')],qs[_0x1f2a('0x2d')](_0x4c044d[_0x1f2a('0x2a')][_0x1f2a('0x2d')]));_0x5357f0[_0x1f2a('0x2e')]=_0x5357f0[_0x1f2a('0x2e')]['length']?_0x5357f0['attributes']:_0x375fcf['model'];if(!_0x4c044d[_0x1f2a('0x2a')][_0x1f2a('0x2f')](_0x1f2a('0x30'))){_0x5357f0[_0x1f2a('0x1b')]=qs['limit'](_0x4c044d['query']['limit']);_0x5357f0[_0x1f2a('0x18')]=qs[_0x1f2a('0x18')](_0x4c044d[_0x1f2a('0x2a')]['offset']);}_0x5357f0['order']=qs['sort'](_0x4c044d[_0x1f2a('0x2a')]['sort']);_0x5357f0['where']=qs[_0x1f2a('0x31')](_[_0x1f2a('0x32')](_0x4c044d[_0x1f2a('0x2a')],_0x375fcf['filters']),_0x1be6f2);if(_0x4c044d[_0x1f2a('0x2a')]['filter']){_0x5357f0['where']=_['merge'](_0x5357f0['where'],{'$or':_[_0x1f2a('0x24')](_0x1be6f2,function(_0x546f73){if(_0x546f73['type']!==_0x1f2a('0x33')){var _0x5c4b7e={};_0x5c4b7e[_0x546f73[_0x1f2a('0x21')]]={'$like':'%'+_0x4c044d['query'][_0x1f2a('0x34')]+'%'};return _0x5c4b7e;}})});}_0x5357f0=_[_0x1f2a('0x35')]({},_0x5357f0,_0x4c044d[_0x1f2a('0x36')]);var _0x175942={'where':_0x5357f0[_0x1f2a('0x37')]};return db[_0x1f2a('0x38')][_0x1f2a('0x1a')](_0x175942)['then'](function(_0x310597){_0xa76596[_0x1f2a('0x1a')]=_0x310597;if(_0x4c044d[_0x1f2a('0x2a')][_0x1f2a('0x39')]){_0x5357f0[_0x1f2a('0x3a')]=[{'all':!![]}];}return db[_0x1f2a('0x38')]['findAll'](_0x5357f0);})['then'](function(_0x2f6076){_0xa76596['rows']=_0x2f6076;return _0xa76596;})[_0x1f2a('0x1e')](respondWithFilteredResult(_0x3ca921,_0x5357f0))['catch'](handleError(_0x3ca921,null));};exports[_0x1f2a('0x3b')]=function(_0x2b72d5,_0x53d04e){var _0x1b62d0={'raw':![],'where':{'id':_0x2b72d5[_0x1f2a('0x3c')]['id']}},_0x92290e={};_0x92290e['model']=_['keys'](db[_0x1f2a('0x38')][_0x1f2a('0x25')]);_0x92290e[_0x1f2a('0x2a')]=_[_0x1f2a('0x2b')](_0x2b72d5[_0x1f2a('0x2a')]);_0x92290e['filters']=_['intersection'](_0x92290e['model'],_0x92290e[_0x1f2a('0x2a')]);_0x1b62d0['attributes']=_[_0x1f2a('0x2c')](_0x92290e[_0x1f2a('0x29')],qs[_0x1f2a('0x2d')](_0x2b72d5['query'][_0x1f2a('0x2d')]));_0x1b62d0[_0x1f2a('0x2e')]=_0x1b62d0['attributes']['length']?_0x1b62d0[_0x1f2a('0x2e')]:_0x92290e[_0x1f2a('0x29')];if(_0x2b72d5[_0x1f2a('0x2a')]['includeAll']){_0x1b62d0[_0x1f2a('0x3a')]=[{'all':!![]}];}_0x1b62d0=_[_0x1f2a('0x35')]({},_0x1b62d0,_0x2b72d5[_0x1f2a('0x36')]);return db[_0x1f2a('0x38')][_0x1f2a('0x3d')](_0x1b62d0)[_0x1f2a('0x1e')](handleEntityNotFound(_0x53d04e,null))['then'](respondWithResult(_0x53d04e,null))[_0x1f2a('0x3e')](handleError(_0x53d04e,null));};exports[_0x1f2a('0x3f')]=function(_0x2aa367,_0x3b4607){return db[_0x1f2a('0x38')][_0x1f2a('0x3f')](_0x2aa367[_0x1f2a('0x40')],{})[_0x1f2a('0x1e')](respondWithResult(_0x3b4607,0xc9))['catch'](handleError(_0x3b4607,null));};exports['update']=function(_0x332b83,_0x4b0ab5){if(_0x332b83['body']['id']){delete _0x332b83['body']['id'];}return db[_0x1f2a('0x38')]['find']({'where':{'id':_0x332b83[_0x1f2a('0x3c')]['id']}})[_0x1f2a('0x1e')](handleEntityNotFound(_0x4b0ab5,null))[_0x1f2a('0x1e')](saveUpdates(_0x332b83[_0x1f2a('0x40')],null))[_0x1f2a('0x1e')](respondWithResult(_0x4b0ab5,null))[_0x1f2a('0x3e')](handleError(_0x4b0ab5,null));};exports[_0x1f2a('0x41')]=function(_0x27fd10,_0x27c4ad){return db['VtigerAccount']['find']({'where':{'id':_0x27fd10['params']['id']}})[_0x1f2a('0x1e')](handleEntityNotFound(_0x27c4ad,null))['then'](removeEntity(_0x27c4ad,null))['catch'](handleError(_0x27c4ad,null));};exports[_0x1f2a('0x42')]=function(_0x38136b,_0x1cade1,_0xdba947){var _0x2139a9={};var _0x5d7528={};var _0x45f3b4;var _0xde5b53;return db['VtigerAccount']['findOne']({'where':{'id':_0x38136b['params']['id']}})[_0x1f2a('0x1e')](handleEntityNotFound(_0x1cade1,null))['then'](function(_0x308840){if(_0x308840){_0x45f3b4=_0x308840;_0x5d7528[_0x1f2a('0x29')]=_[_0x1f2a('0x2b')](db[_0x1f2a('0x43')]['rawAttributes']);_0x5d7528[_0x1f2a('0x2a')]=_[_0x1f2a('0x2b')](_0x38136b['query']);_0x5d7528[_0x1f2a('0x31')]=_['intersection'](_0x5d7528[_0x1f2a('0x29')],_0x5d7528[_0x1f2a('0x2a')]);_0x2139a9['attributes']=_[_0x1f2a('0x2c')](_0x5d7528[_0x1f2a('0x29')],qs[_0x1f2a('0x2d')](_0x38136b[_0x1f2a('0x2a')][_0x1f2a('0x2d')]));_0x2139a9[_0x1f2a('0x2e')]=_0x2139a9['attributes'][_0x1f2a('0x44')]?_0x2139a9[_0x1f2a('0x2e')]:_0x5d7528['model'];_0x2139a9[_0x1f2a('0x45')]=qs[_0x1f2a('0x46')](_0x38136b[_0x1f2a('0x2a')]['sort']);_0x2139a9['where']=qs[_0x1f2a('0x31')](_['pick'](_0x38136b[_0x1f2a('0x2a')],_0x5d7528[_0x1f2a('0x31')]));if(_0x38136b[_0x1f2a('0x2a')][_0x1f2a('0x34')]){_0x2139a9[_0x1f2a('0x37')]=_[_0x1f2a('0x35')](_0x2139a9[_0x1f2a('0x37')],{'$or':_['map'](_0x2139a9[_0x1f2a('0x2e')],function(_0x41d365){var _0x1cdec7={};_0x1cdec7[_0x41d365]={'$like':'%'+_0x38136b['query']['filter']+'%'};return _0x1cdec7;})});}_0x2139a9=_[_0x1f2a('0x35')]({},_0x2139a9,_0x38136b[_0x1f2a('0x36')]);return _0x45f3b4[_0x1f2a('0x42')](_0x2139a9);}})[_0x1f2a('0x1e')](function(_0x1438d5){if(_0x1438d5){_0xde5b53=_0x1438d5[_0x1f2a('0x44')];if(!_0x38136b[_0x1f2a('0x2a')][_0x1f2a('0x2f')](_0x1f2a('0x30'))){_0x2139a9['limit']=qs[_0x1f2a('0x1b')](_0x38136b['query'][_0x1f2a('0x1b')]);_0x2139a9[_0x1f2a('0x18')]=qs['offset'](_0x38136b[_0x1f2a('0x2a')]['offset']);}return _0x45f3b4['getConfigurations'](_0x2139a9);}})['then'](function(_0x41363c){if(_0x41363c){return _0x41363c?{'count':_0xde5b53,'rows':_0x41363c}:null;}})['then'](respondWithResult(_0x1cade1,null))[_0x1f2a('0x3e')](handleError(_0x1cade1,null));};exports['addConfiguration']=function(_0x483bdf,_0x4102a3,_0x497041){if(_0x483bdf[_0x1f2a('0x40')]['id']){delete _0x483bdf[_0x1f2a('0x40')]['id'];}return db[_0x1f2a('0x38')][_0x1f2a('0x47')]({'where':{'id':_0x483bdf[_0x1f2a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4102a3,null))[_0x1f2a('0x1e')](function(_0x5cd8b4){if(_0x5cd8b4){_0x483bdf[_0x1f2a('0x40')][_0x1f2a('0x48')]=_0x5cd8b4['id'];_0x483bdf['body'][_0x1f2a('0x49')]=integrations[_0x1f2a('0x4a')](_0x483bdf['body'][_0x1f2a('0x4b')],_0x483bdf['body']['type']);_0x483bdf[_0x1f2a('0x40')][_0x1f2a('0x4c')]=integrations['getDescriptions'](_0x483bdf[_0x1f2a('0x40')][_0x1f2a('0x4b')],_0x483bdf[_0x1f2a('0x40')][_0x1f2a('0x27')]);return db[_0x1f2a('0x43')][_0x1f2a('0x3f')](_0x483bdf['body'],{'include':[{'model':db['VtigerField'],'as':_0x1f2a('0x49')},{'model':db[_0x1f2a('0x4d')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4102a3,null))[_0x1f2a('0x3e')](handleError(_0x4102a3,null));};var md5=require(_0x1f2a('0x4e'));exports[_0x1f2a('0x4f')]=function(_0x2c724e,_0x5a470b,_0x135382){var _0x2f3a43=null;var _0x3825db=null;var _0x528aef=null;var _0x3bdcf7=null;var _0x29281a='';return db[_0x1f2a('0x38')]['findOne']({'where':{'id':_0x2c724e[_0x1f2a('0x3c')]['id']},'attributes':['id',_0x1f2a('0x21'),_0x1f2a('0x50'),_0x1f2a('0x51'),_0x1f2a('0x52'),_0x1f2a('0x53'),_0x1f2a('0x54'),_0x1f2a('0x55')]})['then'](handleEntityNotFound(_0x5a470b,null))['then'](function(_0x5abd0a){if(_0x5abd0a){_0x2f3a43=_0x5abd0a[_0x1f2a('0x50')];_0x3825db=_0x5abd0a[_0x1f2a('0x55')];_0x528aef=_0x5abd0a[_0x1f2a('0x52')];_0x29281a=_0x5abd0a[_0x1f2a('0x53')];var _0x2ba76a=_0x29281a[_0x1f2a('0x56')](-0x1);if(_0x2ba76a==='/'){_0x29281a=_0x29281a[_0x1f2a('0x57')](0x0,_0x29281a[_0x1f2a('0x58')](_0x2ba76a));}_0x3bdcf7=util[_0x1f2a('0x59')]('%s/webservice.php',_0x29281a);var _0x750bb9={'method':_0x1f2a('0x5a'),'uri':_0x3bdcf7,'qs':{'operation':_0x1f2a('0x5b'),'username':_0x5abd0a[_0x1f2a('0x50')]},'json':!![]};return rp(_0x750bb9);}})['then'](function(_0x2c8fa3){if(_0x2c8fa3[_0x1f2a('0x5c')]){var _0x436b5c={'method':_0x1f2a('0x5d'),'uri':_0x3bdcf7,'form':{'operation':_0x1f2a('0x5e'),'username':_0x2f3a43,'accessKey':md5(_0x2c8fa3['result']['token']+_0x3825db)},'json':!![]};return rp(_0x436b5c);}})[_0x1f2a('0x1e')](function(_0x254dce){if(_0x254dce[_0x1f2a('0x5c')]){var _0x265439={'method':_0x1f2a('0x5a'),'uri':_0x3bdcf7,'qs':{'operation':_0x1f2a('0x5f'),'username':_0x2f3a43,'sessionName':_0x254dce[_0x1f2a('0x60')][_0x1f2a('0x61')],'elementType':_0x528aef},'json':!![]};return rp(_0x265439);}})[_0x1f2a('0x1e')](function(_0x298a62){if(_0x298a62[_0x1f2a('0x5c')]){var _0xf8d5a8=['autogenerated','reference',_0x1f2a('0x62')];_[_0x1f2a('0x63')](_0x298a62[_0x1f2a('0x60')][_0x1f2a('0x2d')],function(_0x4ee5ff){return _0xf8d5a8[_0x1f2a('0x64')](_0x4ee5ff['type'][_0x1f2a('0x21')]);});_[_0x1f2a('0x63')](_0x298a62[_0x1f2a('0x60')]['fields'],function(_0x341293){return _0x341293[_0x1f2a('0x65')]===_0x1f2a('0x66');});return{'count':_0x298a62['result']['fields'][_0x1f2a('0x44')],'rows':_[_0x1f2a('0x24')](_0x298a62[_0x1f2a('0x60')][_0x1f2a('0x2d')],function(_0x5f4dd6){return{'id':_0x5f4dd6[_0x1f2a('0x21')],'name':_0x5f4dd6[_0x1f2a('0x67')],'custom':_[_0x1f2a('0x68')](_0x5f4dd6[_0x1f2a('0x21')],'cf_')?!![]:![],'options':_0x5f4dd6['type'][_0x1f2a('0x21')]===_0x1f2a('0x69')&&_0x5f4dd6[_0x1f2a('0x27')]['picklistValues'][_0x1f2a('0x44')]>0x0?_['map'](_0x5f4dd6[_0x1f2a('0x27')][_0x1f2a('0x6a')],function(_0x335b5b){return{'name':_0x335b5b[_0x1f2a('0x67')],'value':_0x335b5b[_0x1f2a('0x6b')]};}):[]};})};}})[_0x1f2a('0x1e')](respondWithResult(_0x5a470b,null))[_0x1f2a('0x3e')](function(_0x1f247c){console['log'](_0x1f2a('0x6c')+_0x1f247c);var _0x143836=_0x2c724e[_0x1f2a('0x2a')][_0x1f2a('0x6d')]?0x1f4:_0x1f247c[_0x1f2a('0x6e')]||0x1f4;logger[_0x1f2a('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0x1f2a('0x4f'),_0x143836,JSON[_0x1f2a('0x6f')](_0x1f247c));delete _0x1f247c[_0x1f2a('0x21')];if(_0x143836===0x191){_0x143836=0x190;}_0x5a470b[_0x1f2a('0x1c')](_0x143836)[_0x1f2a('0x22')](_0x2c724e['query']['test']?{'message':_0x1f2a('0x70'),'statusCode':_0x1f247c['statusCode']}:_0x1f247c);});}; \ No newline at end of file +var _0xec29=['remoteUri','serverUrl','slice','substring','%s/webservice.php','GET','success','POST','login','token','describe','result','sessionName','autogenerated','reference','remove','includes','false','picklist','picklistValues','label','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','rows','show','params','keys','find','catch','create','body','getConfigurations','VtigerConfiguration','pick','hasOwnProperty','addConfiguration','findOne','Subjects','getSubjects','Descriptions','getDescriptions','VtigerField','md5','getFields','username','moduleName'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xec29,0x106));var _0x9ec2=function(_0x59d387,_0x1f582c){_0x59d387=_0x59d387-0x0;var _0x18e7e9=_0xec29[_0x59d387];return _0x18e7e9;};'use strict';var emlformat=require(_0x9ec2('0x0'));var rimraf=require(_0x9ec2('0x1'));var zipdir=require(_0x9ec2('0x2'));var jsonpatch=require(_0x9ec2('0x3'));var rp=require(_0x9ec2('0x4'));var moment=require(_0x9ec2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9ec2('0x6'));var sox=require(_0x9ec2('0x7'));var csv=require(_0x9ec2('0x8'));var ejs=require(_0x9ec2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9ec2('0xa'));var squel=require(_0x9ec2('0xb'));var crypto=require('crypto');var jsforce=require(_0x9ec2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9ec2('0x8'));var querystring=require('querystring');var Papa=require(_0x9ec2('0xd'));var Redis=require('ioredis');var authService=require(_0x9ec2('0xe'));var qs=require(_0x9ec2('0xf'));var as=require(_0x9ec2('0x10'));var hardwareService=require(_0x9ec2('0x11'));var logger=require(_0x9ec2('0x12'))(_0x9ec2('0x13'));var utils=require('../../config/utils');var config=require(_0x9ec2('0x14'));var licenseUtil=require(_0x9ec2('0x15'));var db=require(_0x9ec2('0x16'))['db'];var integrations=require(_0x9ec2('0x17'));function respondWithStatusCode(_0x2bf928,_0x480950){_0x480950=_0x480950||0xcc;return function(_0x1ba613){if(_0x1ba613){return _0x2bf928[_0x9ec2('0x18')](_0x480950);}return _0x2bf928[_0x9ec2('0x19')](_0x480950)[_0x9ec2('0x1a')]();};}function respondWithResult(_0x472caa,_0x4993b0){_0x4993b0=_0x4993b0||0xc8;return function(_0x3d97e9){if(_0x3d97e9){return _0x472caa[_0x9ec2('0x19')](_0x4993b0)[_0x9ec2('0x1b')](_0x3d97e9);}};}function respondWithFilteredResult(_0xc4ef57,_0x54677d){return function(_0xe051c4){if(_0xe051c4){var _0x5d142c=typeof _0x54677d[_0x9ec2('0x1c')]==='undefined'&&typeof _0x54677d[_0x9ec2('0x1d')]===_0x9ec2('0x1e');var _0x25c957=_0xe051c4['count'];var _0x40c24e=_0x5d142c?0x0:_0x54677d[_0x9ec2('0x1c')];var _0x1339f9=_0x5d142c?_0xe051c4['count']:_0x54677d[_0x9ec2('0x1c')]+_0x54677d[_0x9ec2('0x1d')];var _0x2cd022;if(_0x1339f9>=_0x25c957){_0x1339f9=_0x25c957;_0x2cd022=0xc8;}else{_0x2cd022=0xce;}_0xc4ef57[_0x9ec2('0x19')](_0x2cd022);return _0xc4ef57[_0x9ec2('0x1f')](_0x9ec2('0x20'),_0x40c24e+'-'+_0x1339f9+'/'+_0x25c957)[_0x9ec2('0x1b')](_0xe051c4);}return null;};}function patchUpdates(_0x2b2c10){return function(_0x5de342){try{jsonpatch[_0x9ec2('0x21')](_0x5de342,_0x2b2c10,!![]);}catch(_0x4783e6){return BPromise[_0x9ec2('0x22')](_0x4783e6);}return _0x5de342['save']();};}function saveUpdates(_0x34789b,_0x406d62){return function(_0x464415){if(_0x464415){return _0x464415[_0x9ec2('0x23')](_0x34789b)[_0x9ec2('0x24')](function(_0x2eb499){return _0x2eb499;});}return null;};}function removeEntity(_0x4f5253,_0x498b5c){return function(_0xb6545d){if(_0xb6545d){return _0xb6545d[_0x9ec2('0x25')]()['then'](function(){_0x4f5253[_0x9ec2('0x19')](0xcc)[_0x9ec2('0x1a')]();});}};}function handleEntityNotFound(_0x365e14,_0xac9974){return function(_0x148377){if(!_0x148377){_0x365e14[_0x9ec2('0x18')](0x194);}return _0x148377;};}function handleError(_0x53162c,_0x26140a){_0x26140a=_0x26140a||0x1f4;return function(_0x471577){logger[_0x9ec2('0x26')](_0x471577[_0x9ec2('0x27')]);if(_0x471577['name']){delete _0x471577[_0x9ec2('0x28')];}_0x53162c['status'](_0x26140a)[_0x9ec2('0x29')](_0x471577);};}exports[_0x9ec2('0x2a')]=function(_0xbfcf0e,_0x21561f){var _0x54fedd={},_0x16d60e={},_0x35b7a2={'count':0x0,'rows':[]};var _0x53ef58=_['map'](db[_0x9ec2('0x2b')][_0x9ec2('0x2c')],function(_0x496590){return{'name':_0x496590[_0x9ec2('0x2d')],'type':_0x496590[_0x9ec2('0x2e')][_0x9ec2('0x2f')]};});_0x16d60e[_0x9ec2('0x30')]=_[_0x9ec2('0x31')](_0x53ef58,'name');_0x16d60e['query']=_['keys'](_0xbfcf0e[_0x9ec2('0x32')]);_0x16d60e[_0x9ec2('0x33')]=_[_0x9ec2('0x34')](_0x16d60e[_0x9ec2('0x30')],_0x16d60e[_0x9ec2('0x32')]);_0x54fedd[_0x9ec2('0x35')]=_[_0x9ec2('0x34')](_0x16d60e[_0x9ec2('0x30')],qs[_0x9ec2('0x36')](_0xbfcf0e[_0x9ec2('0x32')][_0x9ec2('0x36')]));_0x54fedd['attributes']=_0x54fedd[_0x9ec2('0x35')][_0x9ec2('0x37')]?_0x54fedd[_0x9ec2('0x35')]:_0x16d60e['model'];if(!_0xbfcf0e['query']['hasOwnProperty'](_0x9ec2('0x38'))){_0x54fedd['limit']=qs[_0x9ec2('0x1d')](_0xbfcf0e['query'][_0x9ec2('0x1d')]);_0x54fedd['offset']=qs[_0x9ec2('0x1c')](_0xbfcf0e[_0x9ec2('0x32')][_0x9ec2('0x1c')]);}_0x54fedd[_0x9ec2('0x39')]=qs[_0x9ec2('0x3a')](_0xbfcf0e[_0x9ec2('0x32')]['sort']);_0x54fedd[_0x9ec2('0x3b')]=qs[_0x9ec2('0x33')](_['pick'](_0xbfcf0e[_0x9ec2('0x32')],_0x16d60e[_0x9ec2('0x33')]),_0x53ef58);if(_0xbfcf0e[_0x9ec2('0x32')][_0x9ec2('0x3c')]){_0x54fedd[_0x9ec2('0x3b')]=_[_0x9ec2('0x3d')](_0x54fedd['where'],{'$or':_[_0x9ec2('0x31')](_0x53ef58,function(_0x15942d){if(_0x15942d[_0x9ec2('0x2e')]!=='VIRTUAL'){var _0x2cd1c4={};_0x2cd1c4[_0x15942d['name']]={'$like':'%'+_0xbfcf0e[_0x9ec2('0x32')]['filter']+'%'};return _0x2cd1c4;}})});}_0x54fedd=_[_0x9ec2('0x3d')]({},_0x54fedd,_0xbfcf0e[_0x9ec2('0x3e')]);var _0x2c77d6={'where':_0x54fedd['where']};return db[_0x9ec2('0x2b')][_0x9ec2('0x3f')](_0x2c77d6)[_0x9ec2('0x24')](function(_0x2e1625){_0x35b7a2[_0x9ec2('0x3f')]=_0x2e1625;if(_0xbfcf0e[_0x9ec2('0x32')][_0x9ec2('0x40')]){_0x54fedd[_0x9ec2('0x41')]=[{'all':!![]}];}return db[_0x9ec2('0x2b')]['findAll'](_0x54fedd);})[_0x9ec2('0x24')](function(_0x193ffe){_0x35b7a2[_0x9ec2('0x42')]=_0x193ffe;return _0x35b7a2;})[_0x9ec2('0x24')](respondWithFilteredResult(_0x21561f,_0x54fedd))['catch'](handleError(_0x21561f,null));};exports[_0x9ec2('0x43')]=function(_0x232f69,_0x5294ef){var _0x141e5c={'raw':![],'where':{'id':_0x232f69[_0x9ec2('0x44')]['id']}},_0x2e68e={};_0x2e68e['model']=_[_0x9ec2('0x45')](db['VtigerAccount'][_0x9ec2('0x2c')]);_0x2e68e[_0x9ec2('0x32')]=_[_0x9ec2('0x45')](_0x232f69['query']);_0x2e68e[_0x9ec2('0x33')]=_[_0x9ec2('0x34')](_0x2e68e[_0x9ec2('0x30')],_0x2e68e['query']);_0x141e5c[_0x9ec2('0x35')]=_[_0x9ec2('0x34')](_0x2e68e[_0x9ec2('0x30')],qs[_0x9ec2('0x36')](_0x232f69[_0x9ec2('0x32')][_0x9ec2('0x36')]));_0x141e5c['attributes']=_0x141e5c['attributes'][_0x9ec2('0x37')]?_0x141e5c[_0x9ec2('0x35')]:_0x2e68e['model'];if(_0x232f69['query'][_0x9ec2('0x40')]){_0x141e5c[_0x9ec2('0x41')]=[{'all':!![]}];}_0x141e5c=_[_0x9ec2('0x3d')]({},_0x141e5c,_0x232f69['options']);return db[_0x9ec2('0x2b')][_0x9ec2('0x46')](_0x141e5c)[_0x9ec2('0x24')](handleEntityNotFound(_0x5294ef,null))[_0x9ec2('0x24')](respondWithResult(_0x5294ef,null))[_0x9ec2('0x47')](handleError(_0x5294ef,null));};exports['create']=function(_0x2d219f,_0x10147c){return db[_0x9ec2('0x2b')][_0x9ec2('0x48')](_0x2d219f[_0x9ec2('0x49')],{})[_0x9ec2('0x24')](respondWithResult(_0x10147c,0xc9))[_0x9ec2('0x47')](handleError(_0x10147c,null));};exports[_0x9ec2('0x23')]=function(_0x3d82b2,_0x23c98c){if(_0x3d82b2['body']['id']){delete _0x3d82b2[_0x9ec2('0x49')]['id'];}return db[_0x9ec2('0x2b')]['find']({'where':{'id':_0x3d82b2[_0x9ec2('0x44')]['id']}})['then'](handleEntityNotFound(_0x23c98c,null))[_0x9ec2('0x24')](saveUpdates(_0x3d82b2[_0x9ec2('0x49')],null))[_0x9ec2('0x24')](respondWithResult(_0x23c98c,null))[_0x9ec2('0x47')](handleError(_0x23c98c,null));};exports[_0x9ec2('0x25')]=function(_0x38961e,_0x24b863){return db[_0x9ec2('0x2b')][_0x9ec2('0x46')]({'where':{'id':_0x38961e[_0x9ec2('0x44')]['id']}})[_0x9ec2('0x24')](handleEntityNotFound(_0x24b863,null))[_0x9ec2('0x24')](removeEntity(_0x24b863,null))['catch'](handleError(_0x24b863,null));};exports[_0x9ec2('0x4a')]=function(_0x42ed0c,_0x2975cc,_0x4cef32){var _0x571654={};var _0x50c659={};var _0x1f4a69;var _0x54543a;return db[_0x9ec2('0x2b')]['findOne']({'where':{'id':_0x42ed0c['params']['id']}})[_0x9ec2('0x24')](handleEntityNotFound(_0x2975cc,null))[_0x9ec2('0x24')](function(_0x503c3c){if(_0x503c3c){_0x1f4a69=_0x503c3c;_0x50c659[_0x9ec2('0x30')]=_[_0x9ec2('0x45')](db[_0x9ec2('0x4b')][_0x9ec2('0x2c')]);_0x50c659[_0x9ec2('0x32')]=_[_0x9ec2('0x45')](_0x42ed0c[_0x9ec2('0x32')]);_0x50c659[_0x9ec2('0x33')]=_[_0x9ec2('0x34')](_0x50c659['model'],_0x50c659[_0x9ec2('0x32')]);_0x571654[_0x9ec2('0x35')]=_[_0x9ec2('0x34')](_0x50c659[_0x9ec2('0x30')],qs['fields'](_0x42ed0c[_0x9ec2('0x32')][_0x9ec2('0x36')]));_0x571654['attributes']=_0x571654[_0x9ec2('0x35')][_0x9ec2('0x37')]?_0x571654[_0x9ec2('0x35')]:_0x50c659[_0x9ec2('0x30')];_0x571654[_0x9ec2('0x39')]=qs[_0x9ec2('0x3a')](_0x42ed0c[_0x9ec2('0x32')][_0x9ec2('0x3a')]);_0x571654[_0x9ec2('0x3b')]=qs['filters'](_[_0x9ec2('0x4c')](_0x42ed0c['query'],_0x50c659[_0x9ec2('0x33')]));if(_0x42ed0c[_0x9ec2('0x32')][_0x9ec2('0x3c')]){_0x571654['where']=_['merge'](_0x571654[_0x9ec2('0x3b')],{'$or':_[_0x9ec2('0x31')](_0x571654[_0x9ec2('0x35')],function(_0x19b1ae){var _0x5c2726={};_0x5c2726[_0x19b1ae]={'$like':'%'+_0x42ed0c[_0x9ec2('0x32')][_0x9ec2('0x3c')]+'%'};return _0x5c2726;})});}_0x571654=_[_0x9ec2('0x3d')]({},_0x571654,_0x42ed0c[_0x9ec2('0x3e')]);return _0x1f4a69[_0x9ec2('0x4a')](_0x571654);}})[_0x9ec2('0x24')](function(_0x265a12){if(_0x265a12){_0x54543a=_0x265a12['length'];if(!_0x42ed0c[_0x9ec2('0x32')][_0x9ec2('0x4d')](_0x9ec2('0x38'))){_0x571654['limit']=qs[_0x9ec2('0x1d')](_0x42ed0c[_0x9ec2('0x32')][_0x9ec2('0x1d')]);_0x571654['offset']=qs[_0x9ec2('0x1c')](_0x42ed0c[_0x9ec2('0x32')][_0x9ec2('0x1c')]);}return _0x1f4a69[_0x9ec2('0x4a')](_0x571654);}})[_0x9ec2('0x24')](function(_0x5bad70){if(_0x5bad70){return _0x5bad70?{'count':_0x54543a,'rows':_0x5bad70}:null;}})[_0x9ec2('0x24')](respondWithResult(_0x2975cc,null))[_0x9ec2('0x47')](handleError(_0x2975cc,null));};exports[_0x9ec2('0x4e')]=function(_0x1d3835,_0x4e5f1d,_0x43af36){if(_0x1d3835['body']['id']){delete _0x1d3835[_0x9ec2('0x49')]['id'];}return db['VtigerAccount'][_0x9ec2('0x4f')]({'where':{'id':_0x1d3835[_0x9ec2('0x44')]['id']}})[_0x9ec2('0x24')](handleEntityNotFound(_0x4e5f1d,null))[_0x9ec2('0x24')](function(_0x17c5fa){if(_0x17c5fa){_0x1d3835[_0x9ec2('0x49')]['AccountId']=_0x17c5fa['id'];_0x1d3835[_0x9ec2('0x49')][_0x9ec2('0x50')]=integrations[_0x9ec2('0x51')](_0x1d3835[_0x9ec2('0x49')]['channel'],_0x1d3835[_0x9ec2('0x49')][_0x9ec2('0x2e')]);_0x1d3835[_0x9ec2('0x49')][_0x9ec2('0x52')]=integrations[_0x9ec2('0x53')](_0x1d3835['body']['channel'],_0x1d3835[_0x9ec2('0x49')]['type']);return db[_0x9ec2('0x4b')][_0x9ec2('0x48')](_0x1d3835[_0x9ec2('0x49')],{'include':[{'model':db[_0x9ec2('0x54')],'as':_0x9ec2('0x50')},{'model':db[_0x9ec2('0x54')],'as':_0x9ec2('0x52')}]});}return null;})[_0x9ec2('0x24')](respondWithResult(_0x4e5f1d,null))[_0x9ec2('0x47')](handleError(_0x4e5f1d,null));};var md5=require(_0x9ec2('0x55'));exports[_0x9ec2('0x56')]=function(_0x39eb5d,_0x83f5c,_0x59eaf7){var _0x1ff10d=null;var _0x2a8204=null;var _0x271acf=null;var _0x29fac9=null;var _0x2b30de='';return db['VtigerAccount'][_0x9ec2('0x4f')]({'where':{'id':_0x39eb5d[_0x9ec2('0x44')]['id']},'attributes':['id',_0x9ec2('0x28'),_0x9ec2('0x57'),'description',_0x9ec2('0x58'),_0x9ec2('0x59'),_0x9ec2('0x5a'),'accessKey']})[_0x9ec2('0x24')](handleEntityNotFound(_0x83f5c,null))[_0x9ec2('0x24')](function(_0x8c0ec4){if(_0x8c0ec4){_0x1ff10d=_0x8c0ec4[_0x9ec2('0x57')];_0x2a8204=_0x8c0ec4['accessKey'];_0x271acf=_0x8c0ec4[_0x9ec2('0x58')];_0x2b30de=_0x8c0ec4['remoteUri'];var _0x4d0612=_0x2b30de[_0x9ec2('0x5b')](-0x1);if(_0x4d0612==='/'){_0x2b30de=_0x2b30de[_0x9ec2('0x5c')](0x0,_0x2b30de['lastIndexOf'](_0x4d0612));}_0x29fac9=util['format'](_0x9ec2('0x5d'),_0x2b30de);var _0x53a325={'method':_0x9ec2('0x5e'),'uri':_0x29fac9,'qs':{'operation':'getchallenge','username':_0x8c0ec4['username']},'json':!![]};return rp(_0x53a325);}})['then'](function(_0x3acc3e){if(_0x3acc3e[_0x9ec2('0x5f')]){var _0x2280ae={'method':_0x9ec2('0x60'),'uri':_0x29fac9,'form':{'operation':_0x9ec2('0x61'),'username':_0x1ff10d,'accessKey':md5(_0x3acc3e['result'][_0x9ec2('0x62')]+_0x2a8204)},'json':!![]};return rp(_0x2280ae);}})[_0x9ec2('0x24')](function(_0x1d99a1){if(_0x1d99a1['success']){var _0x35a002={'method':_0x9ec2('0x5e'),'uri':_0x29fac9,'qs':{'operation':_0x9ec2('0x63'),'username':_0x1ff10d,'sessionName':_0x1d99a1[_0x9ec2('0x64')][_0x9ec2('0x65')],'elementType':_0x271acf},'json':!![]};return rp(_0x35a002);}})[_0x9ec2('0x24')](function(_0x243457){if(_0x243457[_0x9ec2('0x5f')]){var _0x423d91=[_0x9ec2('0x66'),_0x9ec2('0x67'),'owner'];_[_0x9ec2('0x68')](_0x243457['result'][_0x9ec2('0x36')],function(_0x11dabd){return _0x423d91[_0x9ec2('0x69')](_0x11dabd[_0x9ec2('0x2e')][_0x9ec2('0x28')]);});_[_0x9ec2('0x68')](_0x243457['result'][_0x9ec2('0x36')],function(_0x531c7f){return _0x531c7f['editable']===_0x9ec2('0x6a');});return{'count':_0x243457[_0x9ec2('0x64')]['fields'][_0x9ec2('0x37')],'rows':_[_0x9ec2('0x31')](_0x243457['result'][_0x9ec2('0x36')],function(_0x17433c){return{'id':_0x17433c['name'],'name':_0x17433c['label'],'custom':_['startsWith'](_0x17433c['name'],'cf_')?!![]:![],'options':_0x17433c[_0x9ec2('0x2e')][_0x9ec2('0x28')]===_0x9ec2('0x6b')&&_0x17433c[_0x9ec2('0x2e')][_0x9ec2('0x6c')][_0x9ec2('0x37')]>0x0?_[_0x9ec2('0x31')](_0x17433c['type'][_0x9ec2('0x6c')],function(_0x18fcb4){return{'name':_0x18fcb4[_0x9ec2('0x6d')],'value':_0x18fcb4['value']};}):[]};})};}})[_0x9ec2('0x24')](respondWithResult(_0x83f5c,null))[_0x9ec2('0x47')](function(_0x322a2e){console[_0x9ec2('0x6e')](_0x9ec2('0x6f')+_0x322a2e);var _0x3a7630=_0x39eb5d[_0x9ec2('0x32')][_0x9ec2('0x70')]?0x1f4:_0x322a2e[_0x9ec2('0x71')]||0x1f4;logger[_0x9ec2('0x26')](_0x9ec2('0x72'),'getFields',_0x3a7630,JSON[_0x9ec2('0x73')](_0x322a2e));delete _0x322a2e[_0x9ec2('0x28')];if(_0x3a7630===0x191){_0x3a7630=0x190;}_0x83f5c['status'](_0x3a7630)['send'](_0x39eb5d['query'][_0x9ec2('0x70')]?{'message':_0x9ec2('0x74'),'statusCode':_0x322a2e[_0x9ec2('0x71')]}:_0x322a2e);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 0e770fb..8ee061d 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 _0x9d66=['exports','define','int_vtiger_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes'];(function(_0x11c125,_0x19ea9d){var _0x346551=function(_0x390811){while(--_0x390811){_0x11c125['push'](_0x11c125['shift']());}};_0x346551(++_0x19ea9d);}(_0x9d66,0x184));var _0x69d6=function(_0x25389f,_0x282141){_0x25389f=_0x25389f-0x0;var _0x37a3e6=_0x9d66[_0x25389f];return _0x37a3e6;};'use strict';var _=require(_0x69d6('0x0'));var util=require('util');var logger=require(_0x69d6('0x1'))(_0x69d6('0x2'));var moment=require('moment');var BPromise=require(_0x69d6('0x3'));var rp=require(_0x69d6('0x4'));var fs=require('fs');var path=require(_0x69d6('0x5'));var rimraf=require('rimraf');var config=require(_0x69d6('0x6'));var attributes=require(_0x69d6('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x69d6('0x8')]=function(_0x4d8908,_0x339eb8){return _0x4d8908[_0x69d6('0x9')]('VtigerAccount',attributes,{'tableName':_0x69d6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5aba=['bluebird','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','lodash','util','../../config/logger','api','moment'];(function(_0x577349,_0x5dda52){var _0x4c34bf=function(_0x3fea9d){while(--_0x3fea9d){_0x577349['push'](_0x577349['shift']());}};_0x4c34bf(++_0x5dda52);}(_0x5aba,0x11b));var _0xa5ab=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x5aba[_0x47fd36];return _0x21a0fc;};'use strict';var _=require(_0xa5ab('0x0'));var util=require(_0xa5ab('0x1'));var logger=require(_0xa5ab('0x2'))(_0xa5ab('0x3'));var moment=require(_0xa5ab('0x4'));var BPromise=require(_0xa5ab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa5ab('0x6'));var config=require(_0xa5ab('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xa5ab('0x8'));module[_0xa5ab('0x9')]=function(_0x23aa78,_0x454270){return _0x23aa78[_0xa5ab('0xa')](_0xa5ab('0xb'),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 76c1542..5ca1c19 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 _0x6c76=['findAll','options','raw','where','attributes','map','include','model','GetVtigerAccount','debug','ShowVtigerAccount','VtigerAccount','find','then','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x233ebb,_0x2f4b7a){var _0x57ca4d=function(_0x993462){while(--_0x993462){_0x233ebb['push'](_0x233ebb['shift']());}};_0x57ca4d(++_0x2f4b7a);}(_0x6c76,0x184));var _0x66c7=function(_0x3a0f1e,_0x58e71d){_0x3a0f1e=_0x3a0f1e-0x0;var _0x275c3a=_0x6c76[_0x3a0f1e];return _0x275c3a;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var moment=require(_0x66c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c7('0x3'));var fs=require('fs');var Redis=require(_0x66c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66c7('0x5'))(_0x66c7('0x6'));var config=require('../../config/environment');var jayson=require(_0x66c7('0x7'));var client=jayson[_0x66c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23408c,_0x4dffcd,_0x4fa6ce){return new BPromise(function(_0x208d06,_0x2b0065){return client[_0x66c7('0x9')](_0x23408c,_0x4fa6ce)['then'](function(_0x20c010){logger[_0x66c7('0xa')](_0x66c7('0xb'),_0x4dffcd,_0x66c7('0xc'));logger['debug'](_0x66c7('0xd'),_0x4dffcd,_0x66c7('0xc'),JSON[_0x66c7('0xe')](_0x20c010));if(_0x20c010[_0x66c7('0xf')]){if(_0x20c010[_0x66c7('0xf')][_0x66c7('0x10')]===0x1f4){logger[_0x66c7('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x2b0065(_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);}logger[_0x66c7('0xf')](_0x66c7('0xb'),_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x208d06(_0x20c010[_0x66c7('0xf')]['message']);}else{logger[_0x66c7('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x66c7('0xc'));_0x208d06(_0x20c010[_0x66c7('0x12')][_0x66c7('0x11')]);}})[_0x66c7('0x13')](function(_0x22b262){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x22b262);_0x2b0065(_0x22b262);});});}exports['GetVtigerAccount']=function(_0x5129f6){var _0x8ad572=this;return new Promise(function(_0x19f29d,_0x47a299){return db['VtigerAccount'][_0x66c7('0x14')]({'raw':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x5129f6['options']?_0x5129f6['options'][_0x66c7('0x17')]||null:null,'attributes':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'limit':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['limit']||null:null,'include':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['include']?_[_0x66c7('0x19')](_0x5129f6[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fc9d3){return{'model':db[_0x1fc9d3['model']],'as':_0x1fc9d3['as'],'attributes':_0x1fc9d3[_0x66c7('0x18')],'include':_0x1fc9d3[_0x66c7('0x1a')]?_['map'](_0x1fc9d3[_0x66c7('0x1a')],function(_0x11a6b9){return{'model':db[_0x11a6b9[_0x66c7('0x1b')]],'as':_0x11a6b9['as'],'attributes':_0x11a6b9[_0x66c7('0x18')],'include':_0x11a6b9[_0x66c7('0x1a')]?_['map'](_0x11a6b9['include'],function(_0x4e514a){return{'model':db[_0x4e514a[_0x66c7('0x1b')]],'as':_0x4e514a['as'],'attributes':_0x4e514a[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9afd50){logger[_0x66c7('0xa')](_0x66c7('0x1c'),_0x5129f6);logger[_0x66c7('0x1d')](_0x66c7('0x1c'),_0x5129f6,JSON[_0x66c7('0xe')](_0x9afd50));_0x19f29d(_0x9afd50);})['catch'](function(_0xccefb2){logger[_0x66c7('0xf')](_0x66c7('0x1c'),_0xccefb2[_0x66c7('0x11')],_0x5129f6);_0x47a299(_0x8ad572[_0x66c7('0xf')](0x1f4,_0xccefb2['message']));});});};exports[_0x66c7('0x1e')]=function(_0x4f1a34){var _0xfbd97=this;return new Promise(function(_0x543fbf,_0x296875){return db[_0x66c7('0x1f')][_0x66c7('0x20')]({'raw':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x4f1a34['options']?_0x4f1a34['options'][_0x66c7('0x17')]||null:null,'attributes':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'include':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x1a')]?_[_0x66c7('0x19')](_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fd460){return{'model':db[_0x1fd460[_0x66c7('0x1b')]],'as':_0x1fd460['as'],'attributes':_0x1fd460['attributes'],'include':_0x1fd460['include']?_[_0x66c7('0x19')](_0x1fd460[_0x66c7('0x1a')],function(_0x367ad5){return{'model':db[_0x367ad5[_0x66c7('0x1b')]],'as':_0x367ad5['as'],'attributes':_0x367ad5[_0x66c7('0x18')],'include':_0x367ad5[_0x66c7('0x1a')]?_[_0x66c7('0x19')](_0x367ad5['include'],function(_0x30b90f){return{'model':db[_0x30b90f[_0x66c7('0x1b')]],'as':_0x30b90f['as'],'attributes':_0x30b90f[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x66c7('0x21')](function(_0x1e5993){logger[_0x66c7('0xa')](_0x66c7('0x1e'),_0x4f1a34);logger[_0x66c7('0x1d')](_0x66c7('0x1e'),_0x4f1a34,JSON[_0x66c7('0xe')](_0x1e5993));_0x543fbf(_0x1e5993);})[_0x66c7('0x13')](function(_0x4cd663){logger['error'](_0x66c7('0x1e'),_0x4cd663[_0x66c7('0x11')],_0x4f1a34);_0x296875(_0xfbd97[_0x66c7('0xf')](0x1f4,_0x4cd663['message']));});});}; \ No newline at end of file +var _0x57f8=['request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','options','where','attributes','include','model','map','debug','ShowVtigerAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x408bd4,_0x3c69d2){var _0x29d0b2=function(_0x5c5a03){while(--_0x5c5a03){_0x408bd4['push'](_0x408bd4['shift']());}};_0x29d0b2(++_0x3c69d2);}(_0x57f8,0x198));var _0x857f=function(_0x118749,_0x50e848){_0x118749=_0x118749-0x0;var _0x20d489=_0x57f8[_0x118749];return _0x20d489;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var moment=require(_0x857f('0x1'));var BPromise=require(_0x857f('0x2'));var rs=require(_0x857f('0x3'));var fs=require('fs');var Redis=require(_0x857f('0x4'));var db=require(_0x857f('0x5'))['db'];var utils=require(_0x857f('0x6'));var logger=require(_0x857f('0x7'))(_0x857f('0x8'));var config=require(_0x857f('0x9'));var jayson=require(_0x857f('0xa'));var client=jayson[_0x857f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8380e8,_0x197098,_0x1aaeea){return new BPromise(function(_0x577fc3,_0x5f6a66){return client[_0x857f('0xc')](_0x8380e8,_0x1aaeea)[_0x857f('0xd')](function(_0x4f2b09){logger[_0x857f('0xe')](_0x857f('0xf'),_0x197098,_0x857f('0x10'));logger['debug'](_0x857f('0x11'),_0x197098,_0x857f('0x10'),JSON[_0x857f('0x12')](_0x4f2b09));if(_0x4f2b09[_0x857f('0x13')]){if(_0x4f2b09[_0x857f('0x13')][_0x857f('0x14')]===0x1f4){logger[_0x857f('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x197098,_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);return _0x5f6a66(_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);}logger[_0x857f('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x197098,_0x4f2b09['error'][_0x857f('0x15')]);return _0x577fc3(_0x4f2b09['error'][_0x857f('0x15')]);}else{logger['info'](_0x857f('0xf'),_0x197098,_0x857f('0x10'));_0x577fc3(_0x4f2b09['result'][_0x857f('0x15')]);}})[_0x857f('0x16')](function(_0xdf14fe){logger[_0x857f('0x13')](_0x857f('0xf'),_0x197098,_0xdf14fe);_0x5f6a66(_0xdf14fe);});});}exports[_0x857f('0x17')]=function(_0x1a9ef8){var _0x429e23=this;return new Promise(function(_0x1014ca,_0x38a242){return db[_0x857f('0x18')]['findAll']({'raw':_0x1a9ef8[_0x857f('0x19')]?_0x1a9ef8[_0x857f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1a9ef8[_0x857f('0x19')]?_0x1a9ef8[_0x857f('0x19')][_0x857f('0x1a')]||null:null,'attributes':_0x1a9ef8['options']?_0x1a9ef8['options'][_0x857f('0x1b')]||null:null,'limit':_0x1a9ef8[_0x857f('0x19')]?_0x1a9ef8[_0x857f('0x19')]['limit']||null:null,'include':_0x1a9ef8[_0x857f('0x19')]?_0x1a9ef8[_0x857f('0x19')][_0x857f('0x1c')]?_['map'](_0x1a9ef8[_0x857f('0x19')][_0x857f('0x1c')],function(_0x50bfb7){return{'model':db[_0x50bfb7[_0x857f('0x1d')]],'as':_0x50bfb7['as'],'attributes':_0x50bfb7[_0x857f('0x1b')],'include':_0x50bfb7[_0x857f('0x1c')]?_[_0x857f('0x1e')](_0x50bfb7[_0x857f('0x1c')],function(_0x3b23a7){return{'model':db[_0x3b23a7[_0x857f('0x1d')]],'as':_0x3b23a7['as'],'attributes':_0x3b23a7[_0x857f('0x1b')],'include':_0x3b23a7[_0x857f('0x1c')]?_[_0x857f('0x1e')](_0x3b23a7[_0x857f('0x1c')],function(_0x4782ab){return{'model':db[_0x4782ab[_0x857f('0x1d')]],'as':_0x4782ab['as'],'attributes':_0x4782ab[_0x857f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17e415){logger[_0x857f('0xe')](_0x857f('0x17'),_0x1a9ef8);logger[_0x857f('0x1f')]('GetVtigerAccount',_0x1a9ef8,JSON[_0x857f('0x12')](_0x17e415));_0x1014ca(_0x17e415);})['catch'](function(_0x1b405a){logger[_0x857f('0x13')](_0x857f('0x17'),_0x1b405a[_0x857f('0x15')],_0x1a9ef8);_0x38a242(_0x429e23[_0x857f('0x13')](0x1f4,_0x1b405a[_0x857f('0x15')]));});});};exports[_0x857f('0x20')]=function(_0xe79241){var _0x17e7b6=this;return new Promise(function(_0x41f832,_0x24adc2){return db[_0x857f('0x18')][_0x857f('0x21')]({'raw':_0xe79241['options']?_0xe79241[_0x857f('0x19')][_0x857f('0x22')]===undefined?!![]:![]:!![],'where':_0xe79241['options']?_0xe79241[_0x857f('0x19')][_0x857f('0x1a')]||null:null,'attributes':_0xe79241['options']?_0xe79241[_0x857f('0x19')][_0x857f('0x1b')]||null:null,'include':_0xe79241['options']?_0xe79241[_0x857f('0x19')][_0x857f('0x1c')]?_[_0x857f('0x1e')](_0xe79241[_0x857f('0x19')]['include'],function(_0x596b2f){return{'model':db[_0x596b2f[_0x857f('0x1d')]],'as':_0x596b2f['as'],'attributes':_0x596b2f[_0x857f('0x1b')],'include':_0x596b2f['include']?_[_0x857f('0x1e')](_0x596b2f['include'],function(_0x1ff000){return{'model':db[_0x1ff000[_0x857f('0x1d')]],'as':_0x1ff000['as'],'attributes':_0x1ff000[_0x857f('0x1b')],'include':_0x1ff000[_0x857f('0x1c')]?_[_0x857f('0x1e')](_0x1ff000['include'],function(_0x47cfed){return{'model':db[_0x47cfed[_0x857f('0x1d')]],'as':_0x47cfed['as'],'attributes':_0x47cfed['attributes']};}):[]};}):[]};}):[]:[]})[_0x857f('0xd')](function(_0x227602){logger[_0x857f('0xe')]('ShowVtigerAccount',_0xe79241);logger[_0x857f('0x1f')](_0x857f('0x20'),_0xe79241,JSON[_0x857f('0x12')](_0x227602));_0x41f832(_0x227602);})[_0x857f('0x16')](function(_0x36e6bd){logger[_0x857f('0x13')](_0x857f('0x20'),_0x36e6bd['message'],_0xe79241);_0x24adc2(_0x17e7b6[_0x857f('0x13')](0x1f4,_0x36e6bd[_0x857f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index de26fe7..85a3f51 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 _0x2dae=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x4d58ce,_0x47fb4f){var _0x504769=function(_0x53d920){while(--_0x53d920){_0x4d58ce['push'](_0x4d58ce['shift']());}};_0x504769(++_0x47fb4f);}(_0x2dae,0x14b));var _0xe2da=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x2dae[_0x11ce46];return _0x368a1e;};'use strict';var multer=require(_0xe2da('0x0'));var util=require(_0xe2da('0x1'));var path=require(_0xe2da('0x2'));var timeout=require(_0xe2da('0x3'));var express=require(_0xe2da('0x4'));var router=express['Router']();var fs_extra=require(_0xe2da('0x5'));var auth=require(_0xe2da('0x6'));var interaction=require(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var controller=require(_0xe2da('0x9'));router[_0xe2da('0xa')]('/',auth[_0xe2da('0xb')](),controller['index']);router[_0xe2da('0xa')](_0xe2da('0xc'),auth[_0xe2da('0xb')](),controller['show']);router[_0xe2da('0xa')](_0xe2da('0xd'),auth[_0xe2da('0xb')](),controller[_0xe2da('0xe')]);router[_0xe2da('0xa')](_0xe2da('0xf'),auth[_0xe2da('0xb')](),controller[_0xe2da('0x10')]);router[_0xe2da('0xa')](_0xe2da('0x11'),auth[_0xe2da('0xb')](),controller[_0xe2da('0x12')]);router[_0xe2da('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe2da('0x14')](_0xe2da('0xc'),auth[_0xe2da('0xb')](),controller[_0xe2da('0x15')]);router[_0xe2da('0x16')]('/:id',auth[_0xe2da('0xb')](),controller[_0xe2da('0x17')]);module['exports']=router; \ No newline at end of file +var _0x51cd=['express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','update','delete','destroy','multer','util'];(function(_0x294f1d,_0xee6fb9){var _0xfdc8cb=function(_0x3f5e8e){while(--_0x3f5e8e){_0x294f1d['push'](_0x294f1d['shift']());}};_0xfdc8cb(++_0xee6fb9);}(_0x51cd,0x141));var _0xd51c=function(_0x7719e1,_0x17a548){_0x7719e1=_0x7719e1-0x0;var _0x19ab70=_0x51cd[_0x7719e1];return _0x19ab70;};'use strict';var multer=require(_0xd51c('0x0'));var util=require(_0xd51c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd51c('0x2'));var router=express[_0xd51c('0x3')]();var fs_extra=require(_0xd51c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd51c('0x5'));var controller=require('./intVtigerConfiguration.controller');router[_0xd51c('0x6')]('/',auth[_0xd51c('0x7')](),controller[_0xd51c('0x8')]);router[_0xd51c('0x6')](_0xd51c('0x9'),auth[_0xd51c('0x7')](),controller[_0xd51c('0xa')]);router[_0xd51c('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0xd51c('0xb')]);router[_0xd51c('0x6')](_0xd51c('0xc'),auth[_0xd51c('0x7')](),controller[_0xd51c('0xd')]);router['get'](_0xd51c('0xe'),auth[_0xd51c('0x7')](),controller[_0xd51c('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd51c('0x9'),auth[_0xd51c('0x7')](),controller[_0xd51c('0x10')]);router[_0xd51c('0x11')](_0xd51c('0x9'),auth['isAuthenticated'](),controller[_0xd51c('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index f05d5ab..0ea0182 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 _0x8843=['STRING'];(function(_0x586ece,_0x340ea4){var _0x1e7938=function(_0xea5f53){while(--_0xea5f53){_0x586ece['push'](_0x586ece['shift']());}};_0x1e7938(++_0x340ea4);}(_0x8843,0xea));var _0x3884=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8843[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3884('0x0')]},'description':{'type':Sequelize[_0x3884('0x0')]}}; \ No newline at end of file +var _0x93e0=['exports','STRING'];(function(_0x584b11,_0x4bbe67){var _0x51fa14=function(_0x5515ce){while(--_0x5515ce){_0x584b11['push'](_0x584b11['shift']());}};_0x51fa14(++_0x4bbe67);}(_0x93e0,0x16e));var _0x093e=function(_0x3c08e3,_0x38dd71){_0x3c08e3=_0x3c08e3-0x0;var _0x58b34c=_0x93e0[_0x3c08e3];return _0x58b34c;};'use strict';var Sequelize=require('sequelize');module[_0x093e('0x0')]={'name':{'type':Sequelize[_0x093e('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 72b59c4..4ff94bc 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 _0x1798=['squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','catch','show','params','keys','include','options','find','body','destroy','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash'];(function(_0x955747,_0xd1ab29){var _0x3ff6d5=function(_0x56ef79){while(--_0x56ef79){_0x955747['push'](_0x955747['shift']());}};_0x3ff6d5(++_0xd1ab29);}(_0x1798,0x1d6));var _0x8179=function(_0x12fb08,_0x3eb918){_0x12fb08=_0x12fb08-0x0;var _0x3bef26=_0x1798[_0x12fb08];return _0x3bef26;};'use strict';var emlformat=require(_0x8179('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8179('0x1'));var jsonpatch=require(_0x8179('0x2'));var rp=require('request-promise');var moment=require(_0x8179('0x3'));var BPromise=require(_0x8179('0x4'));var Mustache=require(_0x8179('0x5'));var util=require(_0x8179('0x6'));var path=require('path');var sox=require(_0x8179('0x7'));var csv=require(_0x8179('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8179('0x9'));var squel=require(_0x8179('0xa'));var crypto=require('crypto');var jsforce=require(_0x8179('0xb'));var deskjs=require(_0x8179('0xc'));var toCsv=require(_0x8179('0x8'));var querystring=require(_0x8179('0xd'));var Papa=require(_0x8179('0xe'));var Redis=require('ioredis');var authService=require(_0x8179('0xf'));var qs=require(_0x8179('0x10'));var as=require(_0x8179('0x11'));var hardwareService=require(_0x8179('0x12'));var logger=require(_0x8179('0x13'))('api');var utils=require(_0x8179('0x14'));var config=require(_0x8179('0x15'));var licenseUtil=require(_0x8179('0x16'));var db=require(_0x8179('0x17'))['db'];function respondWithStatusCode(_0x2141b1,_0x54ac0b){_0x54ac0b=_0x54ac0b||0xcc;return function(_0x53c964){if(_0x53c964){return _0x2141b1['sendStatus'](_0x54ac0b);}return _0x2141b1[_0x8179('0x18')](_0x54ac0b)[_0x8179('0x19')]();};}function respondWithResult(_0x5a73ad,_0x38abc5){_0x38abc5=_0x38abc5||0xc8;return function(_0x90b00){if(_0x90b00){return _0x5a73ad[_0x8179('0x18')](_0x38abc5)[_0x8179('0x1a')](_0x90b00);}};}function respondWithFilteredResult(_0x5b59ce,_0x5b4b27){return function(_0x5ed93d){if(_0x5ed93d){var _0x2ecd53=typeof _0x5b4b27[_0x8179('0x1b')]===_0x8179('0x1c')&&typeof _0x5b4b27['limit']==='undefined';var _0x59a92e=_0x5ed93d['count'];var _0x430dcf=_0x2ecd53?0x0:_0x5b4b27['offset'];var _0x3da571=_0x2ecd53?_0x5ed93d['count']:_0x5b4b27[_0x8179('0x1b')]+_0x5b4b27['limit'];var _0x5e0848;if(_0x3da571>=_0x59a92e){_0x3da571=_0x59a92e;_0x5e0848=0xc8;}else{_0x5e0848=0xce;}_0x5b59ce[_0x8179('0x18')](_0x5e0848);return _0x5b59ce[_0x8179('0x1d')](_0x8179('0x1e'),_0x430dcf+'-'+_0x3da571+'/'+_0x59a92e)['json'](_0x5ed93d);}return null;};}function patchUpdates(_0x3304ba){return function(_0x15b008){try{jsonpatch[_0x8179('0x1f')](_0x15b008,_0x3304ba,!![]);}catch(_0x2531ee){return BPromise[_0x8179('0x20')](_0x2531ee);}return _0x15b008[_0x8179('0x21')]();};}function saveUpdates(_0x3cff62,_0x5cc7d5){return function(_0x331559){if(_0x331559){return _0x331559[_0x8179('0x22')](_0x3cff62)['then'](function(_0x156861){return _0x156861;});}return null;};}function removeEntity(_0x13d4a6,_0x52d267){return function(_0x2ae65a){if(_0x2ae65a){return _0x2ae65a['destroy']()[_0x8179('0x23')](function(){_0x13d4a6['status'](0xcc)[_0x8179('0x19')]();});}};}function handleEntityNotFound(_0x4d1a0b,_0x2819d7){return function(_0x1ea4db){if(!_0x1ea4db){_0x4d1a0b['sendStatus'](0x194);}return _0x1ea4db;};}function handleError(_0x2255c8,_0x4c3938){_0x4c3938=_0x4c3938||0x1f4;return function(_0x46da77){logger['error'](_0x46da77[_0x8179('0x24')]);if(_0x46da77[_0x8179('0x25')]){delete _0x46da77[_0x8179('0x25')];}_0x2255c8[_0x8179('0x18')](_0x4c3938)[_0x8179('0x26')](_0x46da77);};}exports[_0x8179('0x27')]=function(_0x23145d,_0x1ebf85){var _0x4b2e1a={},_0x2693e4={},_0x35a265={'count':0x0,'rows':[]};var _0xdb61d1=_[_0x8179('0x28')](db[_0x8179('0x29')][_0x8179('0x2a')],function(_0x35952c){return{'name':_0x35952c[_0x8179('0x2b')],'type':_0x35952c[_0x8179('0x2c')][_0x8179('0x2d')]};});_0x2693e4[_0x8179('0x2e')]=_['map'](_0xdb61d1,_0x8179('0x25'));_0x2693e4[_0x8179('0x2f')]=_['keys'](_0x23145d['query']);_0x2693e4[_0x8179('0x30')]=_[_0x8179('0x31')](_0x2693e4[_0x8179('0x2e')],_0x2693e4[_0x8179('0x2f')]);_0x4b2e1a['attributes']=_[_0x8179('0x31')](_0x2693e4[_0x8179('0x2e')],qs[_0x8179('0x32')](_0x23145d[_0x8179('0x2f')][_0x8179('0x32')]));_0x4b2e1a[_0x8179('0x33')]=_0x4b2e1a[_0x8179('0x33')][_0x8179('0x34')]?_0x4b2e1a['attributes']:_0x2693e4[_0x8179('0x2e')];if(!_0x23145d[_0x8179('0x2f')][_0x8179('0x35')](_0x8179('0x36'))){_0x4b2e1a[_0x8179('0x37')]=qs[_0x8179('0x37')](_0x23145d[_0x8179('0x2f')][_0x8179('0x37')]);_0x4b2e1a[_0x8179('0x1b')]=qs[_0x8179('0x1b')](_0x23145d[_0x8179('0x2f')]['offset']);}_0x4b2e1a['order']=qs[_0x8179('0x38')](_0x23145d[_0x8179('0x2f')]['sort']);_0x4b2e1a[_0x8179('0x39')]=qs[_0x8179('0x30')](_[_0x8179('0x3a')](_0x23145d[_0x8179('0x2f')],_0x2693e4['filters']),_0xdb61d1);if(_0x23145d[_0x8179('0x2f')][_0x8179('0x3b')]){_0x4b2e1a['where']=_[_0x8179('0x3c')](_0x4b2e1a[_0x8179('0x39')],{'$or':_[_0x8179('0x28')](_0xdb61d1,function(_0x4c547b){if(_0x4c547b['type']!==_0x8179('0x3d')){var _0x1b834d={};_0x1b834d[_0x4c547b[_0x8179('0x25')]]={'$like':'%'+_0x23145d[_0x8179('0x2f')]['filter']+'%'};return _0x1b834d;}})});}_0x4b2e1a=_['merge']({},_0x4b2e1a,_0x23145d['options']);var _0xa2067b={'where':_0x4b2e1a[_0x8179('0x39')]};return db['VtigerConfiguration'][_0x8179('0x3e')](_0xa2067b)[_0x8179('0x23')](function(_0x30e086){_0x35a265['count']=_0x30e086;if(_0x23145d[_0x8179('0x2f')][_0x8179('0x3f')]){_0x4b2e1a['include']=[{'all':!![]}];}return db[_0x8179('0x29')][_0x8179('0x40')](_0x4b2e1a);})[_0x8179('0x23')](function(_0x5f3265){_0x35a265['rows']=_0x5f3265;return _0x35a265;})[_0x8179('0x23')](respondWithFilteredResult(_0x1ebf85,_0x4b2e1a))[_0x8179('0x41')](handleError(_0x1ebf85,null));};exports[_0x8179('0x42')]=function(_0x10b2a3,_0x5e5190){var _0x8fd2ab={'raw':![],'where':{'id':_0x10b2a3[_0x8179('0x43')]['id']}},_0x572dfb={};_0x572dfb[_0x8179('0x2e')]=_[_0x8179('0x44')](db[_0x8179('0x29')][_0x8179('0x2a')]);_0x572dfb[_0x8179('0x2f')]=_['keys'](_0x10b2a3[_0x8179('0x2f')]);_0x572dfb[_0x8179('0x30')]=_[_0x8179('0x31')](_0x572dfb[_0x8179('0x2e')],_0x572dfb[_0x8179('0x2f')]);_0x8fd2ab[_0x8179('0x33')]=_[_0x8179('0x31')](_0x572dfb['model'],qs['fields'](_0x10b2a3['query'][_0x8179('0x32')]));_0x8fd2ab[_0x8179('0x33')]=_0x8fd2ab['attributes'][_0x8179('0x34')]?_0x8fd2ab[_0x8179('0x33')]:_0x572dfb['model'];if(_0x10b2a3[_0x8179('0x2f')][_0x8179('0x3f')]){_0x8fd2ab[_0x8179('0x45')]=[{'all':!![]}];}_0x8fd2ab=_[_0x8179('0x3c')]({},_0x8fd2ab,_0x10b2a3[_0x8179('0x46')]);return db[_0x8179('0x29')][_0x8179('0x47')](_0x8fd2ab)[_0x8179('0x23')](handleEntityNotFound(_0x5e5190,null))[_0x8179('0x23')](respondWithResult(_0x5e5190,null))[_0x8179('0x41')](handleError(_0x5e5190,null));};exports['create']=function(_0x2b6f6f,_0x45a9f5){return db['VtigerConfiguration']['create'](_0x2b6f6f['body'],{})['then'](respondWithResult(_0x45a9f5,0xc9))[_0x8179('0x41')](handleError(_0x45a9f5,null));};exports['update']=function(_0x35a463,_0x34daf4){if(_0x35a463[_0x8179('0x48')]['id']){delete _0x35a463[_0x8179('0x48')]['id'];}return db[_0x8179('0x29')]['find']({'where':{'id':_0x35a463[_0x8179('0x43')]['id']}})[_0x8179('0x23')](handleEntityNotFound(_0x34daf4,null))[_0x8179('0x23')](saveUpdates(_0x35a463['body'],null))['then'](respondWithResult(_0x34daf4,null))[_0x8179('0x41')](handleError(_0x34daf4,null));};exports[_0x8179('0x49')]=function(_0x407e41,_0x5aa513){return db['VtigerConfiguration'][_0x8179('0x47')]({'where':{'id':_0x407e41[_0x8179('0x43')]['id']}})[_0x8179('0x23')](handleEntityNotFound(_0x5aa513,null))[_0x8179('0x23')](removeEntity(_0x5aa513,null))['catch'](handleError(_0x5aa513,null));};exports[_0x8179('0x4a')]=function(_0xd66b9d,_0xec73b9,_0x473098){var _0x5364c1={};var _0x172386={};var _0x28bebe;var _0x464cb4;return db[_0x8179('0x29')][_0x8179('0x4b')]({'where':{'id':_0xd66b9d[_0x8179('0x43')]['id']}})[_0x8179('0x23')](handleEntityNotFound(_0xec73b9,null))[_0x8179('0x23')](function(_0x132bf8){if(_0x132bf8){_0x28bebe=_0x132bf8;_0x172386[_0x8179('0x2e')]=_[_0x8179('0x44')](db[_0x8179('0x4c')][_0x8179('0x2a')]);_0x172386[_0x8179('0x2f')]=_[_0x8179('0x44')](_0xd66b9d[_0x8179('0x2f')]);_0x172386['filters']=_[_0x8179('0x31')](_0x172386[_0x8179('0x2e')],_0x172386['query']);_0x5364c1[_0x8179('0x33')]=_[_0x8179('0x31')](_0x172386[_0x8179('0x2e')],qs[_0x8179('0x32')](_0xd66b9d['query'][_0x8179('0x32')]));_0x5364c1['attributes']=_0x5364c1[_0x8179('0x33')][_0x8179('0x34')]?_0x5364c1[_0x8179('0x33')]:_0x172386['model'];_0x5364c1[_0x8179('0x4d')]=qs[_0x8179('0x38')](_0xd66b9d['query'][_0x8179('0x38')]);_0x5364c1['where']=qs[_0x8179('0x30')](_[_0x8179('0x3a')](_0xd66b9d[_0x8179('0x2f')],_0x172386[_0x8179('0x30')]));if(_0xd66b9d[_0x8179('0x2f')][_0x8179('0x3b')]){_0x5364c1[_0x8179('0x39')]=_[_0x8179('0x3c')](_0x5364c1['where'],{'$or':_[_0x8179('0x28')](_0x5364c1['attributes'],function(_0x5a2ab0){var _0x4d1cfa={};_0x4d1cfa[_0x5a2ab0]={'$like':'%'+_0xd66b9d[_0x8179('0x2f')][_0x8179('0x3b')]+'%'};return _0x4d1cfa;})});}_0x5364c1=_[_0x8179('0x3c')]({},_0x5364c1,_0xd66b9d[_0x8179('0x46')]);return _0x28bebe['getFields'](_0x5364c1);}})[_0x8179('0x23')](function(_0x1b2cf0){if(_0x1b2cf0){_0x464cb4=_0x1b2cf0[_0x8179('0x34')];if(!_0xd66b9d[_0x8179('0x2f')][_0x8179('0x35')](_0x8179('0x36'))){_0x5364c1[_0x8179('0x37')]=qs[_0x8179('0x37')](_0xd66b9d[_0x8179('0x2f')][_0x8179('0x37')]);_0x5364c1['offset']=qs[_0x8179('0x1b')](_0xd66b9d[_0x8179('0x2f')][_0x8179('0x1b')]);}return _0x28bebe[_0x8179('0x4a')](_0x5364c1);}})['then'](function(_0xb2b0db){if(_0xb2b0db){return _0xb2b0db?{'count':_0x464cb4,'rows':_0xb2b0db}:null;}})[_0x8179('0x23')](respondWithResult(_0xec73b9,null))[_0x8179('0x41')](handleError(_0xec73b9,null));};exports[_0x8179('0x4e')]=function(_0xcdb63c,_0x2e758b,_0x5b7ff4){var _0x1f51e2={};var _0x381f73={};var _0x42ffda;var _0x2d5118;return db['VtigerConfiguration'][_0x8179('0x4b')]({'where':{'id':_0xcdb63c[_0x8179('0x43')]['id']}})[_0x8179('0x23')](handleEntityNotFound(_0x2e758b,null))[_0x8179('0x23')](function(_0x49854b){if(_0x49854b){_0x42ffda=_0x49854b;_0x381f73[_0x8179('0x2e')]=_[_0x8179('0x44')](db['VtigerField'][_0x8179('0x2a')]);_0x381f73[_0x8179('0x2f')]=_[_0x8179('0x44')](_0xcdb63c['query']);_0x381f73[_0x8179('0x30')]=_['intersection'](_0x381f73['model'],_0x381f73[_0x8179('0x2f')]);_0x1f51e2[_0x8179('0x33')]=_[_0x8179('0x31')](_0x381f73[_0x8179('0x2e')],qs['fields'](_0xcdb63c[_0x8179('0x2f')]['fields']));_0x1f51e2[_0x8179('0x33')]=_0x1f51e2[_0x8179('0x33')][_0x8179('0x34')]?_0x1f51e2['attributes']:_0x381f73['model'];_0x1f51e2[_0x8179('0x4d')]=qs['sort'](_0xcdb63c['query'][_0x8179('0x38')]);_0x1f51e2['where']=qs['filters'](_[_0x8179('0x3a')](_0xcdb63c[_0x8179('0x2f')],_0x381f73['filters']));if(_0xcdb63c[_0x8179('0x2f')][_0x8179('0x3b')]){_0x1f51e2['where']=_[_0x8179('0x3c')](_0x1f51e2[_0x8179('0x39')],{'$or':_[_0x8179('0x28')](_0x1f51e2[_0x8179('0x33')],function(_0x417d03){var _0x2abae8={};_0x2abae8[_0x417d03]={'$like':'%'+_0xcdb63c[_0x8179('0x2f')][_0x8179('0x3b')]+'%'};return _0x2abae8;})});}_0x1f51e2=_[_0x8179('0x3c')]({},_0x1f51e2,_0xcdb63c[_0x8179('0x46')]);return _0x42ffda[_0x8179('0x4e')](_0x1f51e2);}})[_0x8179('0x23')](function(_0x50fd6d){if(_0x50fd6d){_0x2d5118=_0x50fd6d[_0x8179('0x34')];if(!_0xcdb63c[_0x8179('0x2f')]['hasOwnProperty'](_0x8179('0x36'))){_0x1f51e2[_0x8179('0x37')]=qs[_0x8179('0x37')](_0xcdb63c[_0x8179('0x2f')][_0x8179('0x37')]);_0x1f51e2[_0x8179('0x1b')]=qs[_0x8179('0x1b')](_0xcdb63c[_0x8179('0x2f')]['offset']);}return _0x42ffda[_0x8179('0x4e')](_0x1f51e2);}})[_0x8179('0x23')](function(_0x5cdb8d){if(_0x5cdb8d){return _0x5cdb8d?{'count':_0x2d5118,'rows':_0x5cdb8d}:null;}})[_0x8179('0x23')](respondWithResult(_0x2e758b,null))[_0x8179('0x41')](handleError(_0x2e758b,null));};exports[_0x8179('0x4f')]=function(_0x13ebd3,_0x2d9149,_0x50ec69){var _0x1803ae={};var _0x28ad9a={};var _0x360fc3;var _0x365da8;return db[_0x8179('0x29')][_0x8179('0x4b')]({'where':{'id':_0x13ebd3[_0x8179('0x43')]['id']}})[_0x8179('0x23')](handleEntityNotFound(_0x2d9149,null))[_0x8179('0x23')](function(_0x1c8fd1){if(_0x1c8fd1){_0x360fc3=_0x1c8fd1;_0x28ad9a[_0x8179('0x2e')]=_[_0x8179('0x44')](db[_0x8179('0x4c')]['rawAttributes']);_0x28ad9a[_0x8179('0x2f')]=_[_0x8179('0x44')](_0x13ebd3[_0x8179('0x2f')]);_0x28ad9a[_0x8179('0x30')]=_['intersection'](_0x28ad9a[_0x8179('0x2e')],_0x28ad9a[_0x8179('0x2f')]);_0x1803ae[_0x8179('0x33')]=_[_0x8179('0x31')](_0x28ad9a[_0x8179('0x2e')],qs[_0x8179('0x32')](_0x13ebd3['query'][_0x8179('0x32')]));_0x1803ae[_0x8179('0x33')]=_0x1803ae[_0x8179('0x33')][_0x8179('0x34')]?_0x1803ae['attributes']:_0x28ad9a['model'];_0x1803ae['order']=qs[_0x8179('0x38')](_0x13ebd3[_0x8179('0x2f')][_0x8179('0x38')]);_0x1803ae[_0x8179('0x39')]=qs[_0x8179('0x30')](_[_0x8179('0x3a')](_0x13ebd3['query'],_0x28ad9a[_0x8179('0x30')]));if(_0x13ebd3[_0x8179('0x2f')][_0x8179('0x3b')]){_0x1803ae[_0x8179('0x39')]=_['merge'](_0x1803ae[_0x8179('0x39')],{'$or':_['map'](_0x1803ae['attributes'],function(_0x582a63){var _0x2186d8={};_0x2186d8[_0x582a63]={'$like':'%'+_0x13ebd3[_0x8179('0x2f')][_0x8179('0x3b')]+'%'};return _0x2186d8;})});}_0x1803ae=_[_0x8179('0x3c')]({},_0x1803ae,_0x13ebd3['options']);return _0x360fc3['getDescriptions'](_0x1803ae);}})[_0x8179('0x23')](function(_0x4e4835){if(_0x4e4835){_0x365da8=_0x4e4835[_0x8179('0x34')];if(!_0x13ebd3['query']['hasOwnProperty']('nolimit')){_0x1803ae[_0x8179('0x37')]=qs[_0x8179('0x37')](_0x13ebd3[_0x8179('0x2f')]['limit']);_0x1803ae[_0x8179('0x1b')]=qs[_0x8179('0x1b')](_0x13ebd3[_0x8179('0x2f')][_0x8179('0x1b')]);}return _0x360fc3[_0x8179('0x4f')](_0x1803ae);}})['then'](function(_0x4b5368){if(_0x4b5368){return _0x4b5368?{'count':_0x365da8,'rows':_0x4b5368}:null;}})[_0x8179('0x23')](respondWithResult(_0x2d9149,null))[_0x8179('0x41')](handleError(_0x2d9149,null));}; \ No newline at end of file +var _0xa4b1=['to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','VtigerConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','include','findAll','rows','catch','includeAll','options','find','create','body','params','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox'];(function(_0x69a7a4,_0x456834){var _0x29489c=function(_0x59c93c){while(--_0x59c93c){_0x69a7a4['push'](_0x69a7a4['shift']());}};_0x29489c(++_0x456834);}(_0xa4b1,0x133));var _0x1a4b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa4b1[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x1a4b('0x0'));var rimraf=require(_0x1a4b('0x1'));var zipdir=require(_0x1a4b('0x2'));var jsonpatch=require(_0x1a4b('0x3'));var rp=require(_0x1a4b('0x4'));var moment=require('moment');var BPromise=require(_0x1a4b('0x5'));var Mustache=require(_0x1a4b('0x6'));var util=require('util');var path=require(_0x1a4b('0x7'));var sox=require(_0x1a4b('0x8'));var csv=require(_0x1a4b('0x9'));var ejs=require(_0x1a4b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a4b('0xb'));var squel=require(_0x1a4b('0xc'));var crypto=require(_0x1a4b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1a4b('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a4b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a4b('0x10'));var hardwareService=require(_0x1a4b('0x11'));var logger=require('../../config/logger')(_0x1a4b('0x12'));var utils=require(_0x1a4b('0x13'));var config=require(_0x1a4b('0x14'));var licenseUtil=require(_0x1a4b('0x15'));var db=require(_0x1a4b('0x16'))['db'];function respondWithStatusCode(_0x3b29fe,_0x2c76f8){_0x2c76f8=_0x2c76f8||0xcc;return function(_0x18c038){if(_0x18c038){return _0x3b29fe[_0x1a4b('0x17')](_0x2c76f8);}return _0x3b29fe[_0x1a4b('0x18')](_0x2c76f8)[_0x1a4b('0x19')]();};}function respondWithResult(_0x129ba8,_0x28ee0e){_0x28ee0e=_0x28ee0e||0xc8;return function(_0x3c14a6){if(_0x3c14a6){return _0x129ba8['status'](_0x28ee0e)['json'](_0x3c14a6);}};}function respondWithFilteredResult(_0x50265f,_0x4ce061){return function(_0x3fa691){if(_0x3fa691){var _0x48bd3c=typeof _0x4ce061[_0x1a4b('0x1a')]===_0x1a4b('0x1b')&&typeof _0x4ce061[_0x1a4b('0x1c')]===_0x1a4b('0x1b');var _0x3a5df0=_0x3fa691[_0x1a4b('0x1d')];var _0x151026=_0x48bd3c?0x0:_0x4ce061[_0x1a4b('0x1a')];var _0x21cd42=_0x48bd3c?_0x3fa691[_0x1a4b('0x1d')]:_0x4ce061[_0x1a4b('0x1a')]+_0x4ce061[_0x1a4b('0x1c')];var _0x243fa7;if(_0x21cd42>=_0x3a5df0){_0x21cd42=_0x3a5df0;_0x243fa7=0xc8;}else{_0x243fa7=0xce;}_0x50265f['status'](_0x243fa7);return _0x50265f[_0x1a4b('0x1e')](_0x1a4b('0x1f'),_0x151026+'-'+_0x21cd42+'/'+_0x3a5df0)[_0x1a4b('0x20')](_0x3fa691);}return null;};}function patchUpdates(_0x2d5441){return function(_0x1239ff){try{jsonpatch[_0x1a4b('0x21')](_0x1239ff,_0x2d5441,!![]);}catch(_0x5610e3){return BPromise[_0x1a4b('0x22')](_0x5610e3);}return _0x1239ff['save']();};}function saveUpdates(_0x22cd44,_0x3bcd88){return function(_0x2b6448){if(_0x2b6448){return _0x2b6448[_0x1a4b('0x23')](_0x22cd44)[_0x1a4b('0x24')](function(_0x5a4569){return _0x5a4569;});}return null;};}function removeEntity(_0x168456,_0x4e223a){return function(_0x390155){if(_0x390155){return _0x390155[_0x1a4b('0x25')]()[_0x1a4b('0x24')](function(){_0x168456[_0x1a4b('0x18')](0xcc)[_0x1a4b('0x19')]();});}};}function handleEntityNotFound(_0x213bbb,_0x4df4eb){return function(_0xd021cb){if(!_0xd021cb){_0x213bbb[_0x1a4b('0x17')](0x194);}return _0xd021cb;};}function handleError(_0x5e9067,_0x399a71){_0x399a71=_0x399a71||0x1f4;return function(_0x14f68e){logger[_0x1a4b('0x26')](_0x14f68e[_0x1a4b('0x27')]);if(_0x14f68e['name']){delete _0x14f68e[_0x1a4b('0x28')];}_0x5e9067[_0x1a4b('0x18')](_0x399a71)[_0x1a4b('0x29')](_0x14f68e);};}exports[_0x1a4b('0x2a')]=function(_0x5b5733,_0x374c38){var _0xca4ba7={},_0x392576={},_0x5d7754={'count':0x0,'rows':[]};var _0x4d8b8e=_['map'](db[_0x1a4b('0x2b')][_0x1a4b('0x2c')],function(_0x3d09ce){return{'name':_0x3d09ce[_0x1a4b('0x2d')],'type':_0x3d09ce[_0x1a4b('0x2e')]['key']};});_0x392576[_0x1a4b('0x2f')]=_[_0x1a4b('0x30')](_0x4d8b8e,'name');_0x392576[_0x1a4b('0x31')]=_[_0x1a4b('0x32')](_0x5b5733[_0x1a4b('0x31')]);_0x392576[_0x1a4b('0x33')]=_[_0x1a4b('0x34')](_0x392576[_0x1a4b('0x2f')],_0x392576[_0x1a4b('0x31')]);_0xca4ba7[_0x1a4b('0x35')]=_['intersection'](_0x392576['model'],qs['fields'](_0x5b5733['query'][_0x1a4b('0x36')]));_0xca4ba7[_0x1a4b('0x35')]=_0xca4ba7[_0x1a4b('0x35')][_0x1a4b('0x37')]?_0xca4ba7[_0x1a4b('0x35')]:_0x392576['model'];if(!_0x5b5733['query'][_0x1a4b('0x38')](_0x1a4b('0x39'))){_0xca4ba7['limit']=qs['limit'](_0x5b5733[_0x1a4b('0x31')][_0x1a4b('0x1c')]);_0xca4ba7[_0x1a4b('0x1a')]=qs[_0x1a4b('0x1a')](_0x5b5733['query']['offset']);}_0xca4ba7[_0x1a4b('0x3a')]=qs['sort'](_0x5b5733['query'][_0x1a4b('0x3b')]);_0xca4ba7['where']=qs['filters'](_[_0x1a4b('0x3c')](_0x5b5733[_0x1a4b('0x31')],_0x392576[_0x1a4b('0x33')]),_0x4d8b8e);if(_0x5b5733[_0x1a4b('0x31')]['filter']){_0xca4ba7[_0x1a4b('0x3d')]=_[_0x1a4b('0x3e')](_0xca4ba7[_0x1a4b('0x3d')],{'$or':_[_0x1a4b('0x30')](_0x4d8b8e,function(_0x487d5b){if(_0x487d5b['type']!=='VIRTUAL'){var _0x48b025={};_0x48b025[_0x487d5b['name']]={'$like':'%'+_0x5b5733['query'][_0x1a4b('0x3f')]+'%'};return _0x48b025;}})});}_0xca4ba7=_[_0x1a4b('0x3e')]({},_0xca4ba7,_0x5b5733['options']);var _0x248a03={'where':_0xca4ba7[_0x1a4b('0x3d')]};return db[_0x1a4b('0x2b')][_0x1a4b('0x1d')](_0x248a03)[_0x1a4b('0x24')](function(_0x422a04){_0x5d7754[_0x1a4b('0x1d')]=_0x422a04;if(_0x5b5733[_0x1a4b('0x31')]['includeAll']){_0xca4ba7[_0x1a4b('0x40')]=[{'all':!![]}];}return db[_0x1a4b('0x2b')][_0x1a4b('0x41')](_0xca4ba7);})[_0x1a4b('0x24')](function(_0x33d5f5){_0x5d7754[_0x1a4b('0x42')]=_0x33d5f5;return _0x5d7754;})[_0x1a4b('0x24')](respondWithFilteredResult(_0x374c38,_0xca4ba7))[_0x1a4b('0x43')](handleError(_0x374c38,null));};exports['show']=function(_0x24e770,_0x4c6dbc){var _0x4ee0a5={'raw':![],'where':{'id':_0x24e770['params']['id']}},_0x422771={};_0x422771[_0x1a4b('0x2f')]=_[_0x1a4b('0x32')](db['VtigerConfiguration'][_0x1a4b('0x2c')]);_0x422771['query']=_[_0x1a4b('0x32')](_0x24e770[_0x1a4b('0x31')]);_0x422771[_0x1a4b('0x33')]=_[_0x1a4b('0x34')](_0x422771[_0x1a4b('0x2f')],_0x422771['query']);_0x4ee0a5[_0x1a4b('0x35')]=_[_0x1a4b('0x34')](_0x422771[_0x1a4b('0x2f')],qs[_0x1a4b('0x36')](_0x24e770[_0x1a4b('0x31')][_0x1a4b('0x36')]));_0x4ee0a5[_0x1a4b('0x35')]=_0x4ee0a5['attributes'][_0x1a4b('0x37')]?_0x4ee0a5[_0x1a4b('0x35')]:_0x422771['model'];if(_0x24e770[_0x1a4b('0x31')][_0x1a4b('0x44')]){_0x4ee0a5[_0x1a4b('0x40')]=[{'all':!![]}];}_0x4ee0a5=_['merge']({},_0x4ee0a5,_0x24e770[_0x1a4b('0x45')]);return db[_0x1a4b('0x2b')][_0x1a4b('0x46')](_0x4ee0a5)[_0x1a4b('0x24')](handleEntityNotFound(_0x4c6dbc,null))[_0x1a4b('0x24')](respondWithResult(_0x4c6dbc,null))[_0x1a4b('0x43')](handleError(_0x4c6dbc,null));};exports[_0x1a4b('0x47')]=function(_0x54961d,_0x2d0e42){return db[_0x1a4b('0x2b')]['create'](_0x54961d[_0x1a4b('0x48')],{})[_0x1a4b('0x24')](respondWithResult(_0x2d0e42,0xc9))[_0x1a4b('0x43')](handleError(_0x2d0e42,null));};exports['update']=function(_0x9d0bd5,_0x33f9d2){if(_0x9d0bd5[_0x1a4b('0x48')]['id']){delete _0x9d0bd5[_0x1a4b('0x48')]['id'];}return db[_0x1a4b('0x2b')][_0x1a4b('0x46')]({'where':{'id':_0x9d0bd5[_0x1a4b('0x49')]['id']}})[_0x1a4b('0x24')](handleEntityNotFound(_0x33f9d2,null))['then'](saveUpdates(_0x9d0bd5[_0x1a4b('0x48')],null))[_0x1a4b('0x24')](respondWithResult(_0x33f9d2,null))[_0x1a4b('0x43')](handleError(_0x33f9d2,null));};exports[_0x1a4b('0x25')]=function(_0x1dd6e1,_0x4e34a4){return db[_0x1a4b('0x2b')][_0x1a4b('0x46')]({'where':{'id':_0x1dd6e1['params']['id']}})[_0x1a4b('0x24')](handleEntityNotFound(_0x4e34a4,null))['then'](removeEntity(_0x4e34a4,null))[_0x1a4b('0x43')](handleError(_0x4e34a4,null));};exports[_0x1a4b('0x4a')]=function(_0x24689c,_0xb2ae34,_0x52339e){var _0x4d01c8={};var _0x396498={};var _0x1065a9;var _0x45212a;return db[_0x1a4b('0x2b')][_0x1a4b('0x4b')]({'where':{'id':_0x24689c[_0x1a4b('0x49')]['id']}})[_0x1a4b('0x24')](handleEntityNotFound(_0xb2ae34,null))[_0x1a4b('0x24')](function(_0x557da6){if(_0x557da6){_0x1065a9=_0x557da6;_0x396498[_0x1a4b('0x2f')]=_['keys'](db[_0x1a4b('0x4c')]['rawAttributes']);_0x396498['query']=_[_0x1a4b('0x32')](_0x24689c['query']);_0x396498[_0x1a4b('0x33')]=_[_0x1a4b('0x34')](_0x396498[_0x1a4b('0x2f')],_0x396498[_0x1a4b('0x31')]);_0x4d01c8[_0x1a4b('0x35')]=_['intersection'](_0x396498['model'],qs['fields'](_0x24689c[_0x1a4b('0x31')]['fields']));_0x4d01c8[_0x1a4b('0x35')]=_0x4d01c8[_0x1a4b('0x35')][_0x1a4b('0x37')]?_0x4d01c8[_0x1a4b('0x35')]:_0x396498[_0x1a4b('0x2f')];_0x4d01c8[_0x1a4b('0x3a')]=qs[_0x1a4b('0x3b')](_0x24689c[_0x1a4b('0x31')][_0x1a4b('0x3b')]);_0x4d01c8['where']=qs[_0x1a4b('0x33')](_[_0x1a4b('0x3c')](_0x24689c[_0x1a4b('0x31')],_0x396498['filters']));if(_0x24689c[_0x1a4b('0x31')]['filter']){_0x4d01c8['where']=_[_0x1a4b('0x3e')](_0x4d01c8[_0x1a4b('0x3d')],{'$or':_[_0x1a4b('0x30')](_0x4d01c8['attributes'],function(_0x3d7a9d){var _0x442e56={};_0x442e56[_0x3d7a9d]={'$like':'%'+_0x24689c[_0x1a4b('0x31')][_0x1a4b('0x3f')]+'%'};return _0x442e56;})});}_0x4d01c8=_[_0x1a4b('0x3e')]({},_0x4d01c8,_0x24689c['options']);return _0x1065a9[_0x1a4b('0x4a')](_0x4d01c8);}})['then'](function(_0x355f94){if(_0x355f94){_0x45212a=_0x355f94[_0x1a4b('0x37')];if(!_0x24689c[_0x1a4b('0x31')]['hasOwnProperty'](_0x1a4b('0x39'))){_0x4d01c8[_0x1a4b('0x1c')]=qs[_0x1a4b('0x1c')](_0x24689c['query']['limit']);_0x4d01c8['offset']=qs['offset'](_0x24689c[_0x1a4b('0x31')][_0x1a4b('0x1a')]);}return _0x1065a9[_0x1a4b('0x4a')](_0x4d01c8);}})[_0x1a4b('0x24')](function(_0x590af4){if(_0x590af4){return _0x590af4?{'count':_0x45212a,'rows':_0x590af4}:null;}})[_0x1a4b('0x24')](respondWithResult(_0xb2ae34,null))[_0x1a4b('0x43')](handleError(_0xb2ae34,null));};exports['getSubjects']=function(_0x1cbba4,_0x1f7167,_0x193873){var _0x4f6ea3={};var _0x10c948={};var _0x513c89;var _0x360152;return db[_0x1a4b('0x2b')][_0x1a4b('0x4b')]({'where':{'id':_0x1cbba4[_0x1a4b('0x49')]['id']}})[_0x1a4b('0x24')](handleEntityNotFound(_0x1f7167,null))[_0x1a4b('0x24')](function(_0x1e63d8){if(_0x1e63d8){_0x513c89=_0x1e63d8;_0x10c948['model']=_[_0x1a4b('0x32')](db[_0x1a4b('0x4c')][_0x1a4b('0x2c')]);_0x10c948['query']=_['keys'](_0x1cbba4[_0x1a4b('0x31')]);_0x10c948[_0x1a4b('0x33')]=_[_0x1a4b('0x34')](_0x10c948[_0x1a4b('0x2f')],_0x10c948[_0x1a4b('0x31')]);_0x4f6ea3['attributes']=_['intersection'](_0x10c948[_0x1a4b('0x2f')],qs['fields'](_0x1cbba4[_0x1a4b('0x31')][_0x1a4b('0x36')]));_0x4f6ea3[_0x1a4b('0x35')]=_0x4f6ea3[_0x1a4b('0x35')][_0x1a4b('0x37')]?_0x4f6ea3[_0x1a4b('0x35')]:_0x10c948[_0x1a4b('0x2f')];_0x4f6ea3['order']=qs[_0x1a4b('0x3b')](_0x1cbba4['query']['sort']);_0x4f6ea3[_0x1a4b('0x3d')]=qs[_0x1a4b('0x33')](_['pick'](_0x1cbba4['query'],_0x10c948[_0x1a4b('0x33')]));if(_0x1cbba4['query']['filter']){_0x4f6ea3['where']=_[_0x1a4b('0x3e')](_0x4f6ea3['where'],{'$or':_[_0x1a4b('0x30')](_0x4f6ea3[_0x1a4b('0x35')],function(_0x5d16e7){var _0x38a794={};_0x38a794[_0x5d16e7]={'$like':'%'+_0x1cbba4[_0x1a4b('0x31')][_0x1a4b('0x3f')]+'%'};return _0x38a794;})});}_0x4f6ea3=_[_0x1a4b('0x3e')]({},_0x4f6ea3,_0x1cbba4[_0x1a4b('0x45')]);return _0x513c89[_0x1a4b('0x4d')](_0x4f6ea3);}})[_0x1a4b('0x24')](function(_0x4d1b03){if(_0x4d1b03){_0x360152=_0x4d1b03[_0x1a4b('0x37')];if(!_0x1cbba4[_0x1a4b('0x31')][_0x1a4b('0x38')]('nolimit')){_0x4f6ea3[_0x1a4b('0x1c')]=qs[_0x1a4b('0x1c')](_0x1cbba4[_0x1a4b('0x31')][_0x1a4b('0x1c')]);_0x4f6ea3[_0x1a4b('0x1a')]=qs[_0x1a4b('0x1a')](_0x1cbba4[_0x1a4b('0x31')]['offset']);}return _0x513c89['getSubjects'](_0x4f6ea3);}})[_0x1a4b('0x24')](function(_0x3888ff){if(_0x3888ff){return _0x3888ff?{'count':_0x360152,'rows':_0x3888ff}:null;}})['then'](respondWithResult(_0x1f7167,null))[_0x1a4b('0x43')](handleError(_0x1f7167,null));};exports['getDescriptions']=function(_0x4341a3,_0x47e787,_0x3c220b){var _0x40c62a={};var _0x51bfed={};var _0x51e4ac;var _0x4a41f4;return db[_0x1a4b('0x2b')][_0x1a4b('0x4b')]({'where':{'id':_0x4341a3[_0x1a4b('0x49')]['id']}})[_0x1a4b('0x24')](handleEntityNotFound(_0x47e787,null))[_0x1a4b('0x24')](function(_0x380c19){if(_0x380c19){_0x51e4ac=_0x380c19;_0x51bfed[_0x1a4b('0x2f')]=_['keys'](db[_0x1a4b('0x4c')]['rawAttributes']);_0x51bfed[_0x1a4b('0x31')]=_['keys'](_0x4341a3['query']);_0x51bfed[_0x1a4b('0x33')]=_[_0x1a4b('0x34')](_0x51bfed[_0x1a4b('0x2f')],_0x51bfed[_0x1a4b('0x31')]);_0x40c62a['attributes']=_[_0x1a4b('0x34')](_0x51bfed[_0x1a4b('0x2f')],qs[_0x1a4b('0x36')](_0x4341a3['query']['fields']));_0x40c62a['attributes']=_0x40c62a[_0x1a4b('0x35')][_0x1a4b('0x37')]?_0x40c62a['attributes']:_0x51bfed[_0x1a4b('0x2f')];_0x40c62a[_0x1a4b('0x3a')]=qs[_0x1a4b('0x3b')](_0x4341a3[_0x1a4b('0x31')]['sort']);_0x40c62a[_0x1a4b('0x3d')]=qs['filters'](_[_0x1a4b('0x3c')](_0x4341a3[_0x1a4b('0x31')],_0x51bfed[_0x1a4b('0x33')]));if(_0x4341a3['query'][_0x1a4b('0x3f')]){_0x40c62a[_0x1a4b('0x3d')]=_[_0x1a4b('0x3e')](_0x40c62a[_0x1a4b('0x3d')],{'$or':_['map'](_0x40c62a[_0x1a4b('0x35')],function(_0x24ac56){var _0x4d15a8={};_0x4d15a8[_0x24ac56]={'$like':'%'+_0x4341a3[_0x1a4b('0x31')][_0x1a4b('0x3f')]+'%'};return _0x4d15a8;})});}_0x40c62a=_[_0x1a4b('0x3e')]({},_0x40c62a,_0x4341a3['options']);return _0x51e4ac[_0x1a4b('0x4e')](_0x40c62a);}})[_0x1a4b('0x24')](function(_0x525a2d){if(_0x525a2d){_0x4a41f4=_0x525a2d[_0x1a4b('0x37')];if(!_0x4341a3['query']['hasOwnProperty'](_0x1a4b('0x39'))){_0x40c62a[_0x1a4b('0x1c')]=qs[_0x1a4b('0x1c')](_0x4341a3[_0x1a4b('0x31')][_0x1a4b('0x1c')]);_0x40c62a[_0x1a4b('0x1a')]=qs[_0x1a4b('0x1a')](_0x4341a3[_0x1a4b('0x31')][_0x1a4b('0x1a')]);}return _0x51e4ac[_0x1a4b('0x4e')](_0x40c62a);}})[_0x1a4b('0x24')](function(_0x996c74){if(_0x996c74){return _0x996c74?{'count':_0x4a41f4,'rows':_0x996c74}:null;}})[_0x1a4b('0x24')](respondWithResult(_0x47e787,null))[_0x1a4b('0x43')](handleError(_0x47e787,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 57a4056..0d43e2e 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 _0xc77e=['define','VtigerConfiguration','int_vtiger_configurations','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports'];(function(_0x3bf278,_0x5d4aa9){var _0x4789da=function(_0x27fe4b){while(--_0x27fe4b){_0x3bf278['push'](_0x3bf278['shift']());}};_0x4789da(++_0x5d4aa9);}(_0xc77e,0x1ef));var _0xec77=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc77e[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0xec77('0x0'));var logger=require('../../config/logger')(_0xec77('0x1'));var moment=require(_0xec77('0x2'));var BPromise=require(_0xec77('0x3'));var rp=require(_0xec77('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec77('0x5'));var config=require(_0xec77('0x6'));var attributes=require(_0xec77('0x7'));module[_0xec77('0x8')]=function(_0x1de141,_0x360626){return _0x1de141[_0xec77('0x9')](_0xec77('0xa'),attributes,{'tableName':_0xec77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ca4=['bluebird','request-promise','path','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api'];(function(_0x2a6bc,_0x761a07){var _0x288d3a=function(_0x3c52d8){while(--_0x3c52d8){_0x2a6bc['push'](_0x2a6bc['shift']());}};_0x288d3a(++_0x761a07);}(_0x3ca4,0x173));var _0x43ca=function(_0x2a53fc,_0x17af66){_0x2a53fc=_0x2a53fc-0x0;var _0x36fa86=_0x3ca4[_0x2a53fc];return _0x36fa86;};'use strict';var _=require(_0x43ca('0x0'));var util=require('util');var logger=require(_0x43ca('0x1'))(_0x43ca('0x2'));var moment=require('moment');var BPromise=require(_0x43ca('0x3'));var rp=require(_0x43ca('0x4'));var fs=require('fs');var path=require(_0x43ca('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x43ca('0x6'));module[_0x43ca('0x7')]=function(_0x55bc03,_0x434e44){return _0x55bc03[_0x43ca('0x8')](_0x43ca('0x9'),attributes,{'tableName':_0x43ca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index ee0b501..48065cd 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 _0xac96=['debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x36385b,_0x429635){var _0x409886=function(_0x33bfa3){while(--_0x33bfa3){_0x36385b['push'](_0x36385b['shift']());}};_0x409886(++_0x429635);}(_0xac96,0xcf));var _0x6ac9=function(_0x2aae41,_0x16a44b){_0x2aae41=_0x2aae41-0x0;var _0x49ff2f=_0xac96[_0x2aae41];return _0x49ff2f;};'use strict';var _=require(_0x6ac9('0x0'));var util=require('util');var moment=require(_0x6ac9('0x1'));var BPromise=require('bluebird');var rs=require(_0x6ac9('0x2'));var fs=require('fs');var Redis=require(_0x6ac9('0x3'));var db=require(_0x6ac9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ac9('0x5'))(_0x6ac9('0x6'));var config=require(_0x6ac9('0x7'));var jayson=require(_0x6ac9('0x8'));var client=jayson['client'][_0x6ac9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5de774,_0x171767,_0x74d47f){return new BPromise(function(_0x15f1c4,_0x53279f){return client[_0x6ac9('0xa')](_0x5de774,_0x74d47f)['then'](function(_0x5b07a4){logger[_0x6ac9('0xb')](_0x6ac9('0xc'),_0x171767,'request\x20sent');logger[_0x6ac9('0xd')](_0x6ac9('0xe'),_0x171767,'request\x20sent',JSON[_0x6ac9('0xf')](_0x5b07a4));if(_0x5b07a4[_0x6ac9('0x10')]){if(_0x5b07a4[_0x6ac9('0x10')][_0x6ac9('0x11')]===0x1f4){logger['error'](_0x6ac9('0xc'),_0x171767,_0x5b07a4[_0x6ac9('0x10')][_0x6ac9('0x12')]);return _0x53279f(_0x5b07a4[_0x6ac9('0x10')][_0x6ac9('0x12')]);}logger[_0x6ac9('0x10')](_0x6ac9('0xc'),_0x171767,_0x5b07a4[_0x6ac9('0x10')][_0x6ac9('0x12')]);return _0x15f1c4(_0x5b07a4[_0x6ac9('0x10')][_0x6ac9('0x12')]);}else{logger['info'](_0x6ac9('0xc'),_0x171767,'request\x20sent');_0x15f1c4(_0x5b07a4[_0x6ac9('0x13')][_0x6ac9('0x12')]);}})['catch'](function(_0x3253ae){logger['error'](_0x6ac9('0xc'),_0x171767,_0x3253ae);_0x53279f(_0x3253ae);});});} \ No newline at end of file +var _0x755e=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','VtigerConfiguration,\x20%s,\x20%s','message','info','result'];(function(_0x40708f,_0x429c57){var _0x358c8b=function(_0x5e50e4){while(--_0x5e50e4){_0x40708f['push'](_0x40708f['shift']());}};_0x358c8b(++_0x429c57);}(_0x755e,0x146));var _0xe755=function(_0x40ebff,_0x1dd15e){_0x40ebff=_0x40ebff-0x0;var _0x40122a=_0x755e[_0x40ebff];return _0x40122a;};'use strict';var _=require(_0xe755('0x0'));var util=require(_0xe755('0x1'));var moment=require(_0xe755('0x2'));var BPromise=require(_0xe755('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe755('0x4'));var db=require(_0xe755('0x5'))['db'];var utils=require(_0xe755('0x6'));var logger=require(_0xe755('0x7'))(_0xe755('0x8'));var config=require(_0xe755('0x9'));var jayson=require(_0xe755('0xa'));var client=jayson[_0xe755('0xb')][_0xe755('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a3779,_0x45e786,_0x471fc4){return new BPromise(function(_0x2b47dd,_0x7fc331){return client[_0xe755('0xd')](_0x3a3779,_0x471fc4)['then'](function(_0x368f9c){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x45e786,_0xe755('0xe'));logger[_0xe755('0xf')](_0xe755('0x10'),_0x45e786,'request\x20sent',JSON[_0xe755('0x11')](_0x368f9c));if(_0x368f9c['error']){if(_0x368f9c['error'][_0xe755('0x12')]===0x1f4){logger[_0xe755('0x13')](_0xe755('0x14'),_0x45e786,_0x368f9c[_0xe755('0x13')][_0xe755('0x15')]);return _0x7fc331(_0x368f9c[_0xe755('0x13')][_0xe755('0x15')]);}logger['error'](_0xe755('0x14'),_0x45e786,_0x368f9c[_0xe755('0x13')][_0xe755('0x15')]);return _0x2b47dd(_0x368f9c['error'][_0xe755('0x15')]);}else{logger[_0xe755('0x16')](_0xe755('0x14'),_0x45e786,_0xe755('0xe'));_0x2b47dd(_0x368f9c[_0xe755('0x17')][_0xe755('0x15')]);}})[_0xe755('0x18')](function(_0xa4867){logger[_0xe755('0x13')](_0xe755('0x14'),_0x45e786,_0xa4867);_0x7fc331(_0xa4867);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 302d372..1c93690 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 _0xfa76=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4fa899,_0x57d311){var _0x329c29=function(_0x33e65e){while(--_0x33e65e){_0x4fa899['push'](_0x4fa899['shift']());}};_0x329c29(++_0x57d311);}(_0xfa76,0x148));var _0x6fa7=function(_0x52d283,_0x518111){_0x52d283=_0x52d283-0x0;var _0x4ba3f4=_0xfa76[_0x52d283];return _0x4ba3f4;};'use strict';var multer=require(_0x6fa7('0x0'));var util=require(_0x6fa7('0x1'));var path=require(_0x6fa7('0x2'));var timeout=require(_0x6fa7('0x3'));var express=require(_0x6fa7('0x4'));var router=express[_0x6fa7('0x5')]();var fs_extra=require(_0x6fa7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6fa7('0x7'));var config=require(_0x6fa7('0x8'));var controller=require('./intVtigerField.controller');router[_0x6fa7('0x9')]('/',auth[_0x6fa7('0xa')](),controller[_0x6fa7('0xb')]);router[_0x6fa7('0x9')]('/:id',auth[_0x6fa7('0xa')](),controller['show']);router[_0x6fa7('0xc')]('/',auth[_0x6fa7('0xa')](),controller[_0x6fa7('0xd')]);router[_0x6fa7('0xe')](_0x6fa7('0xf'),auth['isAuthenticated'](),controller[_0x6fa7('0x10')]);router[_0x6fa7('0x11')](_0x6fa7('0xf'),auth[_0x6fa7('0xa')](),controller[_0x6fa7('0x12')]);module[_0x6fa7('0x13')]=router; \ No newline at end of file +var _0x5adf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','express'];(function(_0x5cf80f,_0x327ef7){var _0x4fd4e3=function(_0x5f48b9){while(--_0x5f48b9){_0x5cf80f['push'](_0x5cf80f['shift']());}};_0x4fd4e3(++_0x327ef7);}(_0x5adf,0x97));var _0xf5ad=function(_0x3bf87b,_0x39752c){_0x3bf87b=_0x3bf87b-0x0;var _0x2a232d=_0x5adf[_0x3bf87b];return _0x2a232d;};'use strict';var multer=require(_0xf5ad('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf5ad('0x1'));var router=express['Router']();var fs_extra=require(_0xf5ad('0x2'));var auth=require(_0xf5ad('0x3'));var interaction=require(_0xf5ad('0x4'));var config=require(_0xf5ad('0x5'));var controller=require(_0xf5ad('0x6'));router[_0xf5ad('0x7')]('/',auth[_0xf5ad('0x8')](),controller[_0xf5ad('0x9')]);router[_0xf5ad('0x7')](_0xf5ad('0xa'),auth['isAuthenticated'](),controller[_0xf5ad('0xb')]);router['post']('/',auth[_0xf5ad('0x8')](),controller['create']);router[_0xf5ad('0xc')]('/:id',auth[_0xf5ad('0x8')](),controller[_0xf5ad('0xd')]);router[_0xf5ad('0xe')](_0xf5ad('0xa'),auth[_0xf5ad('0x8')](),controller[_0xf5ad('0xf')]);module[_0xf5ad('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index a94298c..4e7f727 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 _0x9056=['keyValue','picklist','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable'];(function(_0x380af2,_0x36cf66){var _0x1789dc=function(_0x37b604){while(--_0x37b604){_0x380af2['push'](_0x380af2['shift']());}};_0x1789dc(++_0x36cf66);}(_0x9056,0x1a0));var _0x6905=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9056[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6905('0x0'));module[_0x6905('0x1')]={'type':{'type':Sequelize[_0x6905('0x2')]('string','variable',_0x6905('0x3'),_0x6905('0x4'),_0x6905('0x5')),'defaultValue':_0x6905('0x6')},'content':{'type':Sequelize[_0x6905('0x7')]},'key':{'type':Sequelize[_0x6905('0x7')]},'keyType':{'type':Sequelize[_0x6905('0x2')]('string',_0x6905('0x8'),_0x6905('0x3'))},'keyContent':{'type':Sequelize[_0x6905('0x7')]},'idField':{'type':Sequelize[_0x6905('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6905('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x055c=['exports','ENUM','customVariable','keyValue','string','STRING','BOOLEAN'];(function(_0x24dae7,_0x30730a){var _0x4dfc67=function(_0x2ed14c){while(--_0x2ed14c){_0x24dae7['push'](_0x24dae7['shift']());}};_0x4dfc67(++_0x30730a);}(_0x055c,0xa1));var _0xc055=function(_0xa4f636,_0xaca1b6){_0xa4f636=_0xa4f636-0x0;var _0x37e02a=_0x055c[_0xa4f636];return _0x37e02a;};'use strict';var Sequelize=require('sequelize');module[_0xc055('0x0')]={'type':{'type':Sequelize[_0xc055('0x1')]('string','variable',_0xc055('0x2'),_0xc055('0x3'),'picklist'),'defaultValue':_0xc055('0x4')},'content':{'type':Sequelize[_0xc055('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc055('0x1')](_0xc055('0x4'),'variable',_0xc055('0x2'))},'keyContent':{'type':Sequelize[_0xc055('0x5')]},'idField':{'type':Sequelize[_0xc055('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc055('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc055('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index cd207fc..c5dca20 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 _0x382c=['undefined','limit','count','Content-Range','reject','save','update','then','end','error','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x44b54f,_0xe07a57){var _0x396a5c=function(_0x3c866d){while(--_0x3c866d){_0x44b54f['push'](_0x44b54f['shift']());}};_0x396a5c(++_0xe07a57);}(_0x382c,0x7b));var _0xc382=function(_0x5e8940,_0x164e8){_0x5e8940=_0x5e8940-0x0;var _0x5d698c=_0x382c[_0x5e8940];return _0x5d698c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc382('0x0'));var zipdir=require(_0xc382('0x1'));var jsonpatch=require(_0xc382('0x2'));var rp=require(_0xc382('0x3'));var moment=require(_0xc382('0x4'));var BPromise=require(_0xc382('0x5'));var Mustache=require('mustache');var util=require(_0xc382('0x6'));var path=require(_0xc382('0x7'));var sox=require(_0xc382('0x8'));var csv=require(_0xc382('0x9'));var ejs=require(_0xc382('0xa'));var fs=require('fs');var fs_extra=require(_0xc382('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc382('0xc'));var jsforce=require(_0xc382('0xd'));var deskjs=require(_0xc382('0xe'));var toCsv=require(_0xc382('0x9'));var querystring=require(_0xc382('0xf'));var Papa=require(_0xc382('0x10'));var Redis=require(_0xc382('0x11'));var authService=require(_0xc382('0x12'));var qs=require(_0xc382('0x13'));var as=require(_0xc382('0x14'));var hardwareService=require(_0xc382('0x15'));var logger=require(_0xc382('0x16'))('api');var utils=require(_0xc382('0x17'));var config=require(_0xc382('0x18'));var licenseUtil=require(_0xc382('0x19'));var db=require(_0xc382('0x1a'))['db'];function respondWithStatusCode(_0x2640b1,_0x152762){_0x152762=_0x152762||0xcc;return function(_0xcfa06a){if(_0xcfa06a){return _0x2640b1[_0xc382('0x1b')](_0x152762);}return _0x2640b1[_0xc382('0x1c')](_0x152762)['end']();};}function respondWithResult(_0xb68bc6,_0x3f5637){_0x3f5637=_0x3f5637||0xc8;return function(_0x57f60e){if(_0x57f60e){return _0xb68bc6[_0xc382('0x1c')](_0x3f5637)[_0xc382('0x1d')](_0x57f60e);}};}function respondWithFilteredResult(_0x2b0fef,_0x3f5063){return function(_0x5c581f){if(_0x5c581f){var _0xa8827=typeof _0x3f5063[_0xc382('0x1e')]===_0xc382('0x1f')&&typeof _0x3f5063[_0xc382('0x20')]==='undefined';var _0x12b946=_0x5c581f[_0xc382('0x21')];var _0x40ee71=_0xa8827?0x0:_0x3f5063[_0xc382('0x1e')];var _0x3a55d1=_0xa8827?_0x5c581f[_0xc382('0x21')]:_0x3f5063[_0xc382('0x1e')]+_0x3f5063[_0xc382('0x20')];var _0x7cf8df;if(_0x3a55d1>=_0x12b946){_0x3a55d1=_0x12b946;_0x7cf8df=0xc8;}else{_0x7cf8df=0xce;}_0x2b0fef[_0xc382('0x1c')](_0x7cf8df);return _0x2b0fef['set'](_0xc382('0x22'),_0x40ee71+'-'+_0x3a55d1+'/'+_0x12b946)[_0xc382('0x1d')](_0x5c581f);}return null;};}function patchUpdates(_0x3aa3f1){return function(_0x4eea92){try{jsonpatch['apply'](_0x4eea92,_0x3aa3f1,!![]);}catch(_0x4bec5c){return BPromise[_0xc382('0x23')](_0x4bec5c);}return _0x4eea92[_0xc382('0x24')]();};}function saveUpdates(_0x202b1b,_0x2e84ad){return function(_0x2eb16d){if(_0x2eb16d){return _0x2eb16d[_0xc382('0x25')](_0x202b1b)[_0xc382('0x26')](function(_0xd9a0da){return _0xd9a0da;});}return null;};}function removeEntity(_0x19a2a6,_0x20da2e){return function(_0x13f83a){if(_0x13f83a){return _0x13f83a['destroy']()[_0xc382('0x26')](function(){_0x19a2a6[_0xc382('0x1c')](0xcc)[_0xc382('0x27')]();});}};}function handleEntityNotFound(_0x5005d2,_0x25c771){return function(_0x11fc32){if(!_0x11fc32){_0x5005d2[_0xc382('0x1b')](0x194);}return _0x11fc32;};}function handleError(_0xf947a3,_0x42784e){_0x42784e=_0x42784e||0x1f4;return function(_0x250e04){logger[_0xc382('0x28')](_0x250e04[_0xc382('0x29')]);if(_0x250e04[_0xc382('0x2a')]){delete _0x250e04[_0xc382('0x2a')];}_0xf947a3[_0xc382('0x1c')](_0x42784e)[_0xc382('0x2b')](_0x250e04);};}exports[_0xc382('0x2c')]=function(_0x4ea9cb,_0x1937e1){var _0x1fa94a={},_0x26966b={},_0x546d2a={'count':0x0,'rows':[]};var _0x42cf62=_['map'](db[_0xc382('0x2d')][_0xc382('0x2e')],function(_0x167e19){return{'name':_0x167e19[_0xc382('0x2f')],'type':_0x167e19[_0xc382('0x30')]['key']};});_0x26966b[_0xc382('0x31')]=_[_0xc382('0x32')](_0x42cf62,'name');_0x26966b[_0xc382('0x33')]=_[_0xc382('0x34')](_0x4ea9cb[_0xc382('0x33')]);_0x26966b[_0xc382('0x35')]=_[_0xc382('0x36')](_0x26966b[_0xc382('0x31')],_0x26966b[_0xc382('0x33')]);_0x1fa94a[_0xc382('0x37')]=_[_0xc382('0x36')](_0x26966b[_0xc382('0x31')],qs[_0xc382('0x38')](_0x4ea9cb[_0xc382('0x33')]['fields']));_0x1fa94a['attributes']=_0x1fa94a[_0xc382('0x37')][_0xc382('0x39')]?_0x1fa94a[_0xc382('0x37')]:_0x26966b[_0xc382('0x31')];if(!_0x4ea9cb[_0xc382('0x33')]['hasOwnProperty'](_0xc382('0x3a'))){_0x1fa94a[_0xc382('0x20')]=qs[_0xc382('0x20')](_0x4ea9cb[_0xc382('0x33')]['limit']);_0x1fa94a[_0xc382('0x1e')]=qs[_0xc382('0x1e')](_0x4ea9cb[_0xc382('0x33')][_0xc382('0x1e')]);}_0x1fa94a[_0xc382('0x3b')]=qs[_0xc382('0x3c')](_0x4ea9cb[_0xc382('0x33')][_0xc382('0x3c')]);_0x1fa94a[_0xc382('0x3d')]=qs[_0xc382('0x35')](_[_0xc382('0x3e')](_0x4ea9cb[_0xc382('0x33')],_0x26966b[_0xc382('0x35')]),_0x42cf62);if(_0x4ea9cb[_0xc382('0x33')][_0xc382('0x3f')]){_0x1fa94a[_0xc382('0x3d')]=_['merge'](_0x1fa94a['where'],{'$or':_['map'](_0x42cf62,function(_0x2744b3){if(_0x2744b3[_0xc382('0x30')]!==_0xc382('0x40')){var _0x1a370e={};_0x1a370e[_0x2744b3['name']]={'$like':'%'+_0x4ea9cb[_0xc382('0x33')][_0xc382('0x3f')]+'%'};return _0x1a370e;}})});}_0x1fa94a=_[_0xc382('0x41')]({},_0x1fa94a,_0x4ea9cb[_0xc382('0x42')]);var _0x424bb5={'where':_0x1fa94a[_0xc382('0x3d')]};return db[_0xc382('0x2d')][_0xc382('0x21')](_0x424bb5)[_0xc382('0x26')](function(_0x48d906){_0x546d2a[_0xc382('0x21')]=_0x48d906;if(_0x4ea9cb[_0xc382('0x33')][_0xc382('0x43')]){_0x1fa94a['include']=[{'all':!![]}];}return db[_0xc382('0x2d')][_0xc382('0x44')](_0x1fa94a);})[_0xc382('0x26')](function(_0x5d167d){_0x546d2a[_0xc382('0x45')]=_0x5d167d;return _0x546d2a;})[_0xc382('0x26')](respondWithFilteredResult(_0x1937e1,_0x1fa94a))[_0xc382('0x46')](handleError(_0x1937e1,null));};exports[_0xc382('0x47')]=function(_0x465415,_0x2acf3d){var _0x5649c0={'raw':!![],'where':{'id':_0x465415[_0xc382('0x48')]['id']}},_0x250b0e={};_0x250b0e[_0xc382('0x31')]=_['keys'](db['VtigerField'][_0xc382('0x2e')]);_0x250b0e['query']=_[_0xc382('0x34')](_0x465415['query']);_0x250b0e[_0xc382('0x35')]=_[_0xc382('0x36')](_0x250b0e[_0xc382('0x31')],_0x250b0e[_0xc382('0x33')]);_0x5649c0[_0xc382('0x37')]=_[_0xc382('0x36')](_0x250b0e[_0xc382('0x31')],qs['fields'](_0x465415['query']['fields']));_0x5649c0['attributes']=_0x5649c0[_0xc382('0x37')][_0xc382('0x39')]?_0x5649c0[_0xc382('0x37')]:_0x250b0e[_0xc382('0x31')];if(_0x465415[_0xc382('0x33')]['includeAll']){_0x5649c0['include']=[{'all':!![]}];}_0x5649c0=_['merge']({},_0x5649c0,_0x465415[_0xc382('0x42')]);return db['VtigerField'][_0xc382('0x49')](_0x5649c0)[_0xc382('0x26')](handleEntityNotFound(_0x2acf3d,null))[_0xc382('0x26')](respondWithResult(_0x2acf3d,null))['catch'](handleError(_0x2acf3d,null));};exports[_0xc382('0x4a')]=function(_0x4adcef,_0x2f5770){return db['VtigerField'][_0xc382('0x4a')](_0x4adcef[_0xc382('0x4b')],{})[_0xc382('0x26')](respondWithResult(_0x2f5770,0xc9))['catch'](handleError(_0x2f5770,null));};exports[_0xc382('0x25')]=function(_0x358365,_0x3355ee){if(_0x358365[_0xc382('0x4b')]['id']){delete _0x358365[_0xc382('0x4b')]['id'];}return db[_0xc382('0x2d')][_0xc382('0x49')]({'where':{'id':_0x358365[_0xc382('0x48')]['id']}})[_0xc382('0x26')](handleEntityNotFound(_0x3355ee,null))[_0xc382('0x26')](saveUpdates(_0x358365[_0xc382('0x4b')],null))[_0xc382('0x26')](respondWithResult(_0x3355ee,null))['catch'](handleError(_0x3355ee,null));};exports[_0xc382('0x4c')]=function(_0x29082f,_0x470e5a){return db['VtigerField'][_0xc382('0x49')]({'where':{'id':_0x29082f[_0xc382('0x48')]['id']}})['then'](handleEntityNotFound(_0x470e5a,null))[_0xc382('0x26')](removeEntity(_0x470e5a,null))[_0xc382('0x46')](handleError(_0x470e5a,null));}; \ No newline at end of file +var _0xd69e=['nolimit','order','sort','where','pick','filter','VIRTUAL','merge','then','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','Content-Range','save','end','error','stack','name','send','index','map','VtigerField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0xd7a9dc,_0x532de4){var _0x294251=function(_0x1560f9){while(--_0x1560f9){_0xd7a9dc['push'](_0xd7a9dc['shift']());}};_0x294251(++_0x532de4);}(_0xd69e,0x13d));var _0xed69=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xd69e[_0x122096];return _0x3d1966;};'use strict';var emlformat=require(_0xed69('0x0'));var rimraf=require(_0xed69('0x1'));var zipdir=require(_0xed69('0x2'));var jsonpatch=require(_0xed69('0x3'));var rp=require('request-promise');var moment=require(_0xed69('0x4'));var BPromise=require(_0xed69('0x5'));var Mustache=require(_0xed69('0x6'));var util=require('util');var path=require(_0xed69('0x7'));var sox=require(_0xed69('0x8'));var csv=require(_0xed69('0x9'));var ejs=require(_0xed69('0xa'));var fs=require('fs');var fs_extra=require(_0xed69('0xb'));var _=require(_0xed69('0xc'));var squel=require(_0xed69('0xd'));var crypto=require(_0xed69('0xe'));var jsforce=require(_0xed69('0xf'));var deskjs=require(_0xed69('0x10'));var toCsv=require(_0xed69('0x9'));var querystring=require(_0xed69('0x11'));var Papa=require('papaparse');var Redis=require(_0xed69('0x12'));var authService=require(_0xed69('0x13'));var qs=require(_0xed69('0x14'));var as=require(_0xed69('0x15'));var hardwareService=require(_0xed69('0x16'));var logger=require(_0xed69('0x17'))(_0xed69('0x18'));var utils=require(_0xed69('0x19'));var config=require(_0xed69('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34f696,_0x364a0e){_0x364a0e=_0x364a0e||0xcc;return function(_0x12d53f){if(_0x12d53f){return _0x34f696[_0xed69('0x1b')](_0x364a0e);}return _0x34f696[_0xed69('0x1c')](_0x364a0e)['end']();};}function respondWithResult(_0x1c7b09,_0x20b3d8){_0x20b3d8=_0x20b3d8||0xc8;return function(_0x46dfd0){if(_0x46dfd0){return _0x1c7b09[_0xed69('0x1c')](_0x20b3d8)['json'](_0x46dfd0);}};}function respondWithFilteredResult(_0x4e52a2,_0x3b92a4){return function(_0x25fafd){if(_0x25fafd){var _0x581784=typeof _0x3b92a4[_0xed69('0x1d')]===_0xed69('0x1e')&&typeof _0x3b92a4['limit']===_0xed69('0x1e');var _0x2eeb8e=_0x25fafd[_0xed69('0x1f')];var _0x158d73=_0x581784?0x0:_0x3b92a4[_0xed69('0x1d')];var _0x1f5f20=_0x581784?_0x25fafd[_0xed69('0x1f')]:_0x3b92a4[_0xed69('0x1d')]+_0x3b92a4[_0xed69('0x20')];var _0xf1d430;if(_0x1f5f20>=_0x2eeb8e){_0x1f5f20=_0x2eeb8e;_0xf1d430=0xc8;}else{_0xf1d430=0xce;}_0x4e52a2[_0xed69('0x1c')](_0xf1d430);return _0x4e52a2['set'](_0xed69('0x21'),_0x158d73+'-'+_0x1f5f20+'/'+_0x2eeb8e)['json'](_0x25fafd);}return null;};}function patchUpdates(_0x5f20cd){return function(_0x3d550a){try{jsonpatch['apply'](_0x3d550a,_0x5f20cd,!![]);}catch(_0x14fdbe){return BPromise['reject'](_0x14fdbe);}return _0x3d550a[_0xed69('0x22')]();};}function saveUpdates(_0x5ba942,_0x432e88){return function(_0x540b9d){if(_0x540b9d){return _0x540b9d['update'](_0x5ba942)['then'](function(_0x405bdf){return _0x405bdf;});}return null;};}function removeEntity(_0x5ad0b0,_0x179535){return function(_0x5f0f00){if(_0x5f0f00){return _0x5f0f00['destroy']()['then'](function(){_0x5ad0b0['status'](0xcc)[_0xed69('0x23')]();});}};}function handleEntityNotFound(_0x1b68a7,_0x175ebe){return function(_0x402b71){if(!_0x402b71){_0x1b68a7['sendStatus'](0x194);}return _0x402b71;};}function handleError(_0xcb69f6,_0x50bad2){_0x50bad2=_0x50bad2||0x1f4;return function(_0x360e64){logger[_0xed69('0x24')](_0x360e64[_0xed69('0x25')]);if(_0x360e64['name']){delete _0x360e64[_0xed69('0x26')];}_0xcb69f6[_0xed69('0x1c')](_0x50bad2)[_0xed69('0x27')](_0x360e64);};}exports[_0xed69('0x28')]=function(_0x135705,_0x2c372b){var _0x54a6cf={},_0x1242b9={},_0xdc03be={'count':0x0,'rows':[]};var _0x2e058d=_[_0xed69('0x29')](db[_0xed69('0x2a')][_0xed69('0x2b')],function(_0x2d78d9){return{'name':_0x2d78d9['fieldName'],'type':_0x2d78d9['type'][_0xed69('0x2c')]};});_0x1242b9[_0xed69('0x2d')]=_[_0xed69('0x29')](_0x2e058d,_0xed69('0x26'));_0x1242b9[_0xed69('0x2e')]=_[_0xed69('0x2f')](_0x135705['query']);_0x1242b9[_0xed69('0x30')]=_[_0xed69('0x31')](_0x1242b9[_0xed69('0x2d')],_0x1242b9[_0xed69('0x2e')]);_0x54a6cf[_0xed69('0x32')]=_[_0xed69('0x31')](_0x1242b9[_0xed69('0x2d')],qs[_0xed69('0x33')](_0x135705[_0xed69('0x2e')]['fields']));_0x54a6cf['attributes']=_0x54a6cf[_0xed69('0x32')]['length']?_0x54a6cf[_0xed69('0x32')]:_0x1242b9[_0xed69('0x2d')];if(!_0x135705['query'][_0xed69('0x34')](_0xed69('0x35'))){_0x54a6cf['limit']=qs[_0xed69('0x20')](_0x135705[_0xed69('0x2e')]['limit']);_0x54a6cf[_0xed69('0x1d')]=qs[_0xed69('0x1d')](_0x135705['query'][_0xed69('0x1d')]);}_0x54a6cf[_0xed69('0x36')]=qs[_0xed69('0x37')](_0x135705[_0xed69('0x2e')]['sort']);_0x54a6cf[_0xed69('0x38')]=qs[_0xed69('0x30')](_[_0xed69('0x39')](_0x135705['query'],_0x1242b9[_0xed69('0x30')]),_0x2e058d);if(_0x135705[_0xed69('0x2e')][_0xed69('0x3a')]){_0x54a6cf[_0xed69('0x38')]=_['merge'](_0x54a6cf[_0xed69('0x38')],{'$or':_['map'](_0x2e058d,function(_0x58bfa7){if(_0x58bfa7['type']!==_0xed69('0x3b')){var _0x49f94d={};_0x49f94d[_0x58bfa7[_0xed69('0x26')]]={'$like':'%'+_0x135705[_0xed69('0x2e')]['filter']+'%'};return _0x49f94d;}})});}_0x54a6cf=_[_0xed69('0x3c')]({},_0x54a6cf,_0x135705['options']);var _0x559aa8={'where':_0x54a6cf[_0xed69('0x38')]};return db[_0xed69('0x2a')][_0xed69('0x1f')](_0x559aa8)[_0xed69('0x3d')](function(_0x2c7bbb){_0xdc03be[_0xed69('0x1f')]=_0x2c7bbb;if(_0x135705[_0xed69('0x2e')][_0xed69('0x3e')]){_0x54a6cf[_0xed69('0x3f')]=[{'all':!![]}];}return db['VtigerField'][_0xed69('0x40')](_0x54a6cf);})[_0xed69('0x3d')](function(_0xb4a1f4){_0xdc03be[_0xed69('0x41')]=_0xb4a1f4;return _0xdc03be;})['then'](respondWithFilteredResult(_0x2c372b,_0x54a6cf))['catch'](handleError(_0x2c372b,null));};exports[_0xed69('0x42')]=function(_0x2bb831,_0x406540){var _0x2154ae={'raw':!![],'where':{'id':_0x2bb831[_0xed69('0x43')]['id']}},_0x3674fc={};_0x3674fc[_0xed69('0x2d')]=_[_0xed69('0x2f')](db[_0xed69('0x2a')]['rawAttributes']);_0x3674fc['query']=_[_0xed69('0x2f')](_0x2bb831[_0xed69('0x2e')]);_0x3674fc[_0xed69('0x30')]=_['intersection'](_0x3674fc['model'],_0x3674fc[_0xed69('0x2e')]);_0x2154ae[_0xed69('0x32')]=_[_0xed69('0x31')](_0x3674fc['model'],qs[_0xed69('0x33')](_0x2bb831[_0xed69('0x2e')][_0xed69('0x33')]));_0x2154ae['attributes']=_0x2154ae[_0xed69('0x32')]['length']?_0x2154ae[_0xed69('0x32')]:_0x3674fc[_0xed69('0x2d')];if(_0x2bb831[_0xed69('0x2e')][_0xed69('0x3e')]){_0x2154ae[_0xed69('0x3f')]=[{'all':!![]}];}_0x2154ae=_['merge']({},_0x2154ae,_0x2bb831[_0xed69('0x44')]);return db[_0xed69('0x2a')]['find'](_0x2154ae)[_0xed69('0x3d')](handleEntityNotFound(_0x406540,null))['then'](respondWithResult(_0x406540,null))[_0xed69('0x45')](handleError(_0x406540,null));};exports[_0xed69('0x46')]=function(_0x1e3a24,_0x127f67){return db[_0xed69('0x2a')][_0xed69('0x46')](_0x1e3a24[_0xed69('0x47')],{})[_0xed69('0x3d')](respondWithResult(_0x127f67,0xc9))[_0xed69('0x45')](handleError(_0x127f67,null));};exports['update']=function(_0x214d96,_0x3e9166){if(_0x214d96[_0xed69('0x47')]['id']){delete _0x214d96[_0xed69('0x47')]['id'];}return db['VtigerField'][_0xed69('0x48')]({'where':{'id':_0x214d96[_0xed69('0x43')]['id']}})[_0xed69('0x3d')](handleEntityNotFound(_0x3e9166,null))[_0xed69('0x3d')](saveUpdates(_0x214d96['body'],null))[_0xed69('0x3d')](respondWithResult(_0x3e9166,null))[_0xed69('0x45')](handleError(_0x3e9166,null));};exports[_0xed69('0x49')]=function(_0x5cb032,_0x1dbebd){return db['VtigerField'][_0xed69('0x48')]({'where':{'id':_0x5cb032[_0xed69('0x43')]['id']}})[_0xed69('0x3d')](handleEntityNotFound(_0x1dbebd,null))['then'](removeEntity(_0x1dbebd,null))['catch'](handleError(_0x1dbebd,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index f8fc3c8..da33c5b 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 _0xfe51=['exports','int_vtiger_fields','vtiger_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x179320,_0x41f6c9){var _0x503481=function(_0x3baea8){while(--_0x3baea8){_0x179320['push'](_0x179320['shift']());}};_0x503481(++_0x41f6c9);}(_0xfe51,0x7a));var _0x1fe5=function(_0x27085c,_0x33dab8){_0x27085c=_0x27085c-0x0;var _0x2598ec=_0xfe51[_0x27085c];return _0x2598ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1fe5('0x0'))(_0x1fe5('0x1'));var moment=require(_0x1fe5('0x2'));var BPromise=require(_0x1fe5('0x3'));var rp=require(_0x1fe5('0x4'));var fs=require('fs');var path=require(_0x1fe5('0x5'));var rimraf=require(_0x1fe5('0x6'));var config=require(_0x1fe5('0x7'));var attributes=require('./intVtigerField.attributes');module[_0x1fe5('0x8')]=function(_0x591e9a,_0x2e4a08){return _0x591e9a['define']('VtigerField',attributes,{'tableName':_0x1fe5('0x9'),'paranoid':![],'indexes':[{'name':_0x1fe5('0xa'),'fields':[_0x1fe5('0xb'),_0x1fe5('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x55b6=['api','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','VtigerField','FieldId','lodash','../../config/logger'];(function(_0x7f9be2,_0x5283a2){var _0x1306ef=function(_0x2a64e7){while(--_0x2a64e7){_0x7f9be2['push'](_0x7f9be2['shift']());}};_0x1306ef(++_0x5283a2);}(_0x55b6,0xc4));var _0x655b=function(_0x12499d,_0x27b90c){_0x12499d=_0x12499d-0x0;var _0x26ad79=_0x55b6[_0x12499d];return _0x26ad79;};'use strict';var _=require(_0x655b('0x0'));var util=require('util');var logger=require(_0x655b('0x1'))(_0x655b('0x2'));var moment=require(_0x655b('0x3'));var BPromise=require(_0x655b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x655b('0x5'));var rimraf=require(_0x655b('0x6'));var config=require(_0x655b('0x7'));var attributes=require(_0x655b('0x8'));module['exports']=function(_0x3ef72b,_0x2787f2){return _0x3ef72b['define'](_0x655b('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0x655b('0xa')],'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 52e83b0..9498759 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 _0xd8d0=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x34c027,_0x123688){var _0x47bff0=function(_0x19c4a9){while(--_0x19c4a9){_0x34c027['push'](_0x34c027['shift']());}};_0x47bff0(++_0x123688);}(_0xd8d0,0x80));var _0x0d8d=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xd8d0[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x0d8d('0x0'));var util=require(_0x0d8d('0x1'));var moment=require(_0x0d8d('0x2'));var BPromise=require(_0x0d8d('0x3'));var rs=require(_0x0d8d('0x4'));var fs=require('fs');var Redis=require(_0x0d8d('0x5'));var db=require(_0x0d8d('0x6'))['db'];var utils=require(_0x0d8d('0x7'));var logger=require(_0x0d8d('0x8'))(_0x0d8d('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4365cc,_0x254eb3,_0x5fc94c){return new BPromise(function(_0x43699a,_0x36d0cc){return client['request'](_0x4365cc,_0x5fc94c)[_0x0d8d('0xb')](function(_0x537dd9){logger[_0x0d8d('0xc')](_0x0d8d('0xd'),_0x254eb3,'request\x20sent');logger[_0x0d8d('0xe')](_0x0d8d('0xf'),_0x254eb3,_0x0d8d('0x10'),JSON[_0x0d8d('0x11')](_0x537dd9));if(_0x537dd9[_0x0d8d('0x12')]){if(_0x537dd9['error'][_0x0d8d('0x13')]===0x1f4){logger['error'](_0x0d8d('0xd'),_0x254eb3,_0x537dd9[_0x0d8d('0x12')][_0x0d8d('0x14')]);return _0x36d0cc(_0x537dd9[_0x0d8d('0x12')][_0x0d8d('0x14')]);}logger[_0x0d8d('0x12')]('VtigerField,\x20%s,\x20%s',_0x254eb3,_0x537dd9[_0x0d8d('0x12')][_0x0d8d('0x14')]);return _0x43699a(_0x537dd9[_0x0d8d('0x12')][_0x0d8d('0x14')]);}else{logger['info'](_0x0d8d('0xd'),_0x254eb3,_0x0d8d('0x10'));_0x43699a(_0x537dd9['result']['message']);}})[_0x0d8d('0x15')](function(_0x22c28d){logger['error'](_0x0d8d('0xd'),_0x254eb3,_0x22c28d);_0x36d0cc(_0x22c28d);});});} \ No newline at end of file +var _0x9f6e=['client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc'];(function(_0x2b297f,_0x115597){var _0x2bcf54=function(_0x2a8d31){while(--_0x2a8d31){_0x2b297f['push'](_0x2b297f['shift']());}};_0x2bcf54(++_0x115597);}(_0x9f6e,0x14e));var _0xe9f6=function(_0x1d88c0,_0x167e77){_0x1d88c0=_0x1d88c0-0x0;var _0x526d1e=_0x9f6e[_0x1d88c0];return _0x526d1e;};'use strict';var _=require(_0xe9f6('0x0'));var util=require(_0xe9f6('0x1'));var moment=require('moment');var BPromise=require(_0xe9f6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9f6('0x4'));var logger=require('../../config/logger')(_0xe9f6('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe9f6('0x6')][_0xe9f6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4a57cd,_0x88359,_0x192eec){return new BPromise(function(_0x5bc605,_0x4525a1){return client[_0xe9f6('0x8')](_0x4a57cd,_0x192eec)[_0xe9f6('0x9')](function(_0xe4950f){logger[_0xe9f6('0xa')](_0xe9f6('0xb'),_0x88359,_0xe9f6('0xc'));logger[_0xe9f6('0xd')](_0xe9f6('0xe'),_0x88359,_0xe9f6('0xc'),JSON[_0xe9f6('0xf')](_0xe4950f));if(_0xe4950f[_0xe9f6('0x10')]){if(_0xe4950f[_0xe9f6('0x10')]['code']===0x1f4){logger[_0xe9f6('0x10')](_0xe9f6('0xb'),_0x88359,_0xe4950f['error'][_0xe9f6('0x11')]);return _0x4525a1(_0xe4950f['error'][_0xe9f6('0x11')]);}logger[_0xe9f6('0x10')](_0xe9f6('0xb'),_0x88359,_0xe4950f[_0xe9f6('0x10')]['message']);return _0x5bc605(_0xe4950f[_0xe9f6('0x10')]['message']);}else{logger['info'](_0xe9f6('0xb'),_0x88359,_0xe9f6('0xc'));_0x5bc605(_0xe4950f[_0xe9f6('0x12')]['message']);}})[_0xe9f6('0x13')](function(_0x4e9680){logger[_0xe9f6('0x10')]('VtigerField,\x20%s,\x20%s',_0x88359,_0x4e9680);_0x4525a1(_0x4e9680);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 02a0d5b..6710034 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 _0x2c92=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x3d89f7,_0x422a00){var _0x45283d=function(_0x4b7761){while(--_0x4b7761){_0x3d89f7['push'](_0x3d89f7['shift']());}};_0x45283d(++_0x422a00);}(_0x2c92,0x93));var _0x22c9=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0x2c92[_0x38af48];return _0x445384;};'use strict';var multer=require('multer');var util=require(_0x22c9('0x0'));var path=require(_0x22c9('0x1'));var timeout=require(_0x22c9('0x2'));var express=require(_0x22c9('0x3'));var router=express[_0x22c9('0x4')]();var fs_extra=require(_0x22c9('0x5'));var auth=require(_0x22c9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x22c9('0x7'));var controller=require(_0x22c9('0x8'));router[_0x22c9('0x9')]('/',auth[_0x22c9('0xa')](),controller[_0x22c9('0xb')]);router[_0x22c9('0x9')]('/:id',auth[_0x22c9('0xa')](),controller[_0x22c9('0xc')]);router[_0x22c9('0x9')](_0x22c9('0xd'),auth['isAuthenticated'](),controller[_0x22c9('0xe')]);router[_0x22c9('0x9')](_0x22c9('0xf'),auth['isAuthenticated'](),controller[_0x22c9('0x10')]);router['post']('/',auth[_0x22c9('0xa')](),controller[_0x22c9('0x11')]);router[_0x22c9('0x12')](_0x22c9('0xd'),auth[_0x22c9('0xa')](),controller['addConfiguration']);router[_0x22c9('0x13')](_0x22c9('0x14'),auth['isAuthenticated'](),controller[_0x22c9('0x15')]);router[_0x22c9('0x16')](_0x22c9('0x14'),auth[_0x22c9('0xa')](),controller[_0x22c9('0x17')]);module[_0x22c9('0x18')]=router; \ No newline at end of file +var _0xbb3e=['getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x47d7e7,_0x227b4c){var _0x24cbc7=function(_0x2f83a0){while(--_0x2f83a0){_0x47d7e7['push'](_0x47d7e7['shift']());}};_0x24cbc7(++_0x227b4c);}(_0xbb3e,0x181));var _0xebb3=function(_0x440d64,_0x335c04){_0x440d64=_0x440d64-0x0;var _0x1a83d6=_0xbb3e[_0x440d64];return _0x1a83d6;};'use strict';var multer=require(_0xebb3('0x0'));var util=require(_0xebb3('0x1'));var path=require(_0xebb3('0x2'));var timeout=require(_0xebb3('0x3'));var express=require('express');var router=express[_0xebb3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xebb3('0x5'));var interaction=require(_0xebb3('0x6'));var config=require(_0xebb3('0x7'));var controller=require(_0xebb3('0x8'));router[_0xebb3('0x9')]('/',auth[_0xebb3('0xa')](),controller[_0xebb3('0xb')]);router[_0xebb3('0x9')](_0xebb3('0xc'),auth[_0xebb3('0xa')](),controller[_0xebb3('0xd')]);router[_0xebb3('0x9')](_0xebb3('0xe'),auth[_0xebb3('0xa')](),controller[_0xebb3('0xf')]);router[_0xebb3('0x9')](_0xebb3('0x10'),auth['isAuthenticated'](),controller[_0xebb3('0x11')]);router[_0xebb3('0x12')]('/',auth['isAuthenticated'](),controller[_0xebb3('0x13')]);router[_0xebb3('0x12')](_0xebb3('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xebb3('0x14')](_0xebb3('0xc'),auth[_0xebb3('0xa')](),controller[_0xebb3('0x15')]);router[_0xebb3('0x16')](_0xebb3('0xc'),auth[_0xebb3('0xa')](),controller[_0xebb3('0x17')]);module[_0xebb3('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 8bf4966..e52781e 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 _0x11c8=['password','token','ENUM','integrationTab','newTab','exports','STRING','username','remoteUri'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x11c8,0x19a));var _0x811c=function(_0x5f4382,_0xcb3195){_0x5f4382=_0x5f4382-0x0;var _0x368006=_0x11c8[_0x5f4382];return _0x368006;};'use strict';var Sequelize=require('sequelize');module[_0x811c('0x0')]={'name':{'type':Sequelize[_0x811c('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x811c('0x1')],'unique':_0x811c('0x2')},'password':{'type':Sequelize[_0x811c('0x1')]},'token':{'type':Sequelize[_0x811c('0x1')]},'remoteUri':{'type':Sequelize[_0x811c('0x1')],'unique':_0x811c('0x3')},'authType':{'type':Sequelize['ENUM'](_0x811c('0x4'),_0x811c('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x811c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x811c('0x6')](_0x811c('0x7'),_0x811c('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x89fb=['password','newTab','integrationTab','exports','STRING','username','remoteUri','ENUM'];(function(_0x48d9df,_0x395e88){var _0x1590c5=function(_0x4fa5d3){while(--_0x4fa5d3){_0x48d9df['push'](_0x48d9df['shift']());}};_0x1590c5(++_0x395e88);}(_0x89fb,0x14b));var _0xb89f=function(_0x28ffd9,_0x52639a){_0x28ffd9=_0x28ffd9-0x0;var _0x35af9f=_0x89fb[_0x28ffd9];return _0x35af9f;};'use strict';var Sequelize=require('sequelize');module[_0xb89f('0x0')]={'name':{'type':Sequelize[_0xb89f('0x1')]},'description':{'type':Sequelize[_0xb89f('0x1')]},'username':{'type':Sequelize[_0xb89f('0x1')],'unique':_0xb89f('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xb89f('0x1')]},'remoteUri':{'type':Sequelize[_0xb89f('0x1')],'unique':_0xb89f('0x3')},'authType':{'type':Sequelize[_0xb89f('0x4')](_0xb89f('0x5'),'token'),'defaultValue':_0xb89f('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb89f('0x4')]('integrationTab',_0xb89f('0x6')),'defaultValue':_0xb89f('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 0db2587..c7be2a1 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 _0xb7e7=['channel','getDescriptions','ZendeskField','Subjects','Descriptions','password','token','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','authType','headers','format','Basic\x20%s','%s:%s','username','base64','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','ZendeskAccount','findAll','rows','show','params','length','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','options','AccountId','getSubjects'];(function(_0x27facb,_0x2063cc){var _0xdebf2a=function(_0x139424){while(--_0x139424){_0x27facb['push'](_0x27facb['shift']());}};_0xdebf2a(++_0x2063cc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xb7e7[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7b7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b7e('0x2'));var moment=require('moment');var BPromise=require(_0x7b7e('0x3'));var Mustache=require('mustache');var util=require(_0x7b7e('0x4'));var path=require(_0x7b7e('0x5'));var sox=require(_0x7b7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b7e('0x7'));var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var licenseUtil=require(_0x7b7e('0x17'));var db=require(_0x7b7e('0x18'))['db'];var integrations=require(_0x7b7e('0x19'));function respondWithStatusCode(_0x54d8ce,_0x267446){_0x267446=_0x267446||0xcc;return function(_0x430eab){if(_0x430eab){return _0x54d8ce['sendStatus'](_0x267446);}return _0x54d8ce[_0x7b7e('0x1a')](_0x267446)['end']();};}function respondWithResult(_0x4c6011,_0x2889ed){_0x2889ed=_0x2889ed||0xc8;return function(_0xd304f5){if(_0xd304f5){return _0x4c6011[_0x7b7e('0x1a')](_0x2889ed)[_0x7b7e('0x1b')](_0xd304f5);}};}function respondWithFilteredResult(_0x3d2fb2,_0x5703fd){return function(_0x51baf6){if(_0x51baf6){var _0xc7f087=typeof _0x5703fd[_0x7b7e('0x1c')]===_0x7b7e('0x1d')&&typeof _0x5703fd[_0x7b7e('0x1e')]===_0x7b7e('0x1d');var _0x3bf2f0=_0x51baf6[_0x7b7e('0x1f')];var _0x200ef7=_0xc7f087?0x0:_0x5703fd[_0x7b7e('0x1c')];var _0x429a0e=_0xc7f087?_0x51baf6[_0x7b7e('0x1f')]:_0x5703fd[_0x7b7e('0x1c')]+_0x5703fd[_0x7b7e('0x1e')];var _0x3bec7d;if(_0x429a0e>=_0x3bf2f0){_0x429a0e=_0x3bf2f0;_0x3bec7d=0xc8;}else{_0x3bec7d=0xce;}_0x3d2fb2[_0x7b7e('0x1a')](_0x3bec7d);return _0x3d2fb2[_0x7b7e('0x20')](_0x7b7e('0x21'),_0x200ef7+'-'+_0x429a0e+'/'+_0x3bf2f0)['json'](_0x51baf6);}return null;};}function patchUpdates(_0x69262b){return function(_0x43db4f){try{jsonpatch[_0x7b7e('0x22')](_0x43db4f,_0x69262b,!![]);}catch(_0x4c0647){return BPromise[_0x7b7e('0x23')](_0x4c0647);}return _0x43db4f[_0x7b7e('0x24')]();};}function saveUpdates(_0x14243b,_0x200156){return function(_0x2b7211){if(_0x2b7211){return _0x2b7211[_0x7b7e('0x25')](_0x14243b)[_0x7b7e('0x26')](function(_0x10a66a){return _0x10a66a;});}return null;};}function removeEntity(_0x53bbb3,_0x5d6215){return function(_0x4a836a){if(_0x4a836a){return _0x4a836a[_0x7b7e('0x27')]()[_0x7b7e('0x26')](function(){_0x53bbb3[_0x7b7e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d3b1,_0x5dadbb){return function(_0x182245){if(!_0x182245){_0x51d3b1[_0x7b7e('0x28')](0x194);}return _0x182245;};}function handleError(_0x16a3c7,_0x7aa71){_0x7aa71=_0x7aa71||0x1f4;return function(_0x3ceaf5){logger['error'](_0x3ceaf5[_0x7b7e('0x29')]);if(_0x3ceaf5[_0x7b7e('0x2a')]){delete _0x3ceaf5['name'];}_0x16a3c7['status'](_0x7aa71)['send'](_0x3ceaf5);};}exports[_0x7b7e('0x2b')]=function(_0x423832,_0x503625){var _0x3db8c4={},_0x51d4b5={},_0x1b4341={'count':0x0,'rows':[]};var _0xb9b6bf=_[_0x7b7e('0x2c')](db['ZendeskAccount'][_0x7b7e('0x2d')],function(_0xe31336){return{'name':_0xe31336[_0x7b7e('0x2e')],'type':_0xe31336[_0x7b7e('0x2f')][_0x7b7e('0x30')]};});_0x51d4b5['model']=_[_0x7b7e('0x2c')](_0xb9b6bf,'name');_0x51d4b5[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x423832[_0x7b7e('0x31')]);_0x51d4b5[_0x7b7e('0x33')]=_[_0x7b7e('0x34')](_0x51d4b5[_0x7b7e('0x35')],_0x51d4b5[_0x7b7e('0x31')]);_0x3db8c4['attributes']=_['intersection'](_0x51d4b5[_0x7b7e('0x35')],qs[_0x7b7e('0x36')](_0x423832['query'][_0x7b7e('0x36')]));_0x3db8c4[_0x7b7e('0x37')]=_0x3db8c4[_0x7b7e('0x37')]['length']?_0x3db8c4[_0x7b7e('0x37')]:_0x51d4b5[_0x7b7e('0x35')];if(!_0x423832[_0x7b7e('0x31')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0x3db8c4[_0x7b7e('0x1e')]=qs[_0x7b7e('0x1e')](_0x423832[_0x7b7e('0x31')][_0x7b7e('0x1e')]);_0x3db8c4[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x423832[_0x7b7e('0x31')][_0x7b7e('0x1c')]);}_0x3db8c4[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x423832[_0x7b7e('0x31')]['sort']);_0x3db8c4[_0x7b7e('0x3c')]=qs[_0x7b7e('0x33')](_[_0x7b7e('0x3d')](_0x423832[_0x7b7e('0x31')],_0x51d4b5[_0x7b7e('0x33')]),_0xb9b6bf);if(_0x423832[_0x7b7e('0x31')][_0x7b7e('0x3e')]){_0x3db8c4[_0x7b7e('0x3c')]=_[_0x7b7e('0x3f')](_0x3db8c4[_0x7b7e('0x3c')],{'$or':_['map'](_0xb9b6bf,function(_0x3d6571){if(_0x3d6571[_0x7b7e('0x2f')]!==_0x7b7e('0x40')){var _0x1d43da={};_0x1d43da[_0x3d6571['name']]={'$like':'%'+_0x423832[_0x7b7e('0x31')][_0x7b7e('0x3e')]+'%'};return _0x1d43da;}})});}_0x3db8c4=_[_0x7b7e('0x3f')]({},_0x3db8c4,_0x423832['options']);var _0x4a2888={'where':_0x3db8c4[_0x7b7e('0x3c')]};return db['ZendeskAccount'][_0x7b7e('0x1f')](_0x4a2888)[_0x7b7e('0x26')](function(_0x4de331){_0x1b4341[_0x7b7e('0x1f')]=_0x4de331;if(_0x423832[_0x7b7e('0x31')][_0x7b7e('0x41')]){_0x3db8c4[_0x7b7e('0x42')]=[{'all':!![]}];}return db[_0x7b7e('0x43')][_0x7b7e('0x44')](_0x3db8c4);})[_0x7b7e('0x26')](function(_0x1d9bb9){_0x1b4341[_0x7b7e('0x45')]=_0x1d9bb9;return _0x1b4341;})['then'](respondWithFilteredResult(_0x503625,_0x3db8c4))['catch'](handleError(_0x503625,null));};exports[_0x7b7e('0x46')]=function(_0x550ea6,_0x41c8a6){var _0x5e8b5d={'raw':![],'where':{'id':_0x550ea6[_0x7b7e('0x47')]['id']}},_0x48dd74={};_0x48dd74['model']=_[_0x7b7e('0x32')](db['ZendeskAccount'][_0x7b7e('0x2d')]);_0x48dd74[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x550ea6[_0x7b7e('0x31')]);_0x48dd74['filters']=_[_0x7b7e('0x34')](_0x48dd74[_0x7b7e('0x35')],_0x48dd74[_0x7b7e('0x31')]);_0x5e8b5d[_0x7b7e('0x37')]=_[_0x7b7e('0x34')](_0x48dd74[_0x7b7e('0x35')],qs['fields'](_0x550ea6['query']['fields']));_0x5e8b5d[_0x7b7e('0x37')]=_0x5e8b5d[_0x7b7e('0x37')][_0x7b7e('0x48')]?_0x5e8b5d[_0x7b7e('0x37')]:_0x48dd74[_0x7b7e('0x35')];if(_0x550ea6[_0x7b7e('0x31')]['includeAll']){_0x5e8b5d[_0x7b7e('0x42')]=[{'all':!![]}];}_0x5e8b5d=_[_0x7b7e('0x3f')]({},_0x5e8b5d,_0x550ea6['options']);return db['ZendeskAccount'][_0x7b7e('0x49')](_0x5e8b5d)[_0x7b7e('0x26')](handleEntityNotFound(_0x41c8a6,null))[_0x7b7e('0x26')](respondWithResult(_0x41c8a6,null))[_0x7b7e('0x4a')](handleError(_0x41c8a6,null));};exports[_0x7b7e('0x4b')]=function(_0xb46776,_0x590154){return db[_0x7b7e('0x43')]['create'](_0xb46776[_0x7b7e('0x4c')],{})[_0x7b7e('0x26')](respondWithResult(_0x590154,0xc9))[_0x7b7e('0x4a')](handleError(_0x590154,null));};exports[_0x7b7e('0x25')]=function(_0x58e4e6,_0x3b649e){if(_0x58e4e6[_0x7b7e('0x4c')]['id']){delete _0x58e4e6[_0x7b7e('0x4c')]['id'];}return db[_0x7b7e('0x43')][_0x7b7e('0x49')]({'where':{'id':_0x58e4e6['params']['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x3b649e,null))[_0x7b7e('0x26')](saveUpdates(_0x58e4e6[_0x7b7e('0x4c')],null))[_0x7b7e('0x26')](respondWithResult(_0x3b649e,null))[_0x7b7e('0x4a')](handleError(_0x3b649e,null));};exports['destroy']=function(_0x1d6d18,_0x29024e){return db[_0x7b7e('0x43')][_0x7b7e('0x49')]({'where':{'id':_0x1d6d18[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x29024e,null))[_0x7b7e('0x26')](removeEntity(_0x29024e,null))['catch'](handleError(_0x29024e,null));};exports[_0x7b7e('0x4d')]=function(_0x5d7c89,_0x16730c,_0x766a54){var _0x570303={};var _0x36f1be={};var _0x44e3a0;var _0x16c81d;return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x5d7c89[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x16730c,null))['then'](function(_0xbf044d){if(_0xbf044d){_0x44e3a0=_0xbf044d;_0x36f1be[_0x7b7e('0x35')]=_[_0x7b7e('0x32')](db[_0x7b7e('0x4f')]['rawAttributes']);_0x36f1be['query']=_['keys'](_0x5d7c89[_0x7b7e('0x31')]);_0x36f1be[_0x7b7e('0x33')]=_[_0x7b7e('0x34')](_0x36f1be['model'],_0x36f1be['query']);_0x570303[_0x7b7e('0x37')]=_[_0x7b7e('0x34')](_0x36f1be['model'],qs[_0x7b7e('0x36')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x36')]));_0x570303['attributes']=_0x570303[_0x7b7e('0x37')][_0x7b7e('0x48')]?_0x570303['attributes']:_0x36f1be[_0x7b7e('0x35')];_0x570303[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3b')]);_0x570303[_0x7b7e('0x3c')]=qs[_0x7b7e('0x33')](_[_0x7b7e('0x3d')](_0x5d7c89[_0x7b7e('0x31')],_0x36f1be['filters']));if(_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3e')]){_0x570303['where']=_[_0x7b7e('0x3f')](_0x570303[_0x7b7e('0x3c')],{'$or':_[_0x7b7e('0x2c')](_0x570303['attributes'],function(_0x1729e0){var _0x4fc349={};_0x4fc349[_0x1729e0]={'$like':'%'+_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3e')]+'%'};return _0x4fc349;})});}_0x570303=_['merge']({},_0x570303,_0x5d7c89[_0x7b7e('0x50')]);return _0x44e3a0[_0x7b7e('0x4d')](_0x570303);}})['then'](function(_0x2dcb35){if(_0x2dcb35){_0x16c81d=_0x2dcb35[_0x7b7e('0x48')];if(!_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x38')]('nolimit')){_0x570303[_0x7b7e('0x1e')]=qs[_0x7b7e('0x1e')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x1e')]);_0x570303[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x1c')]);}return _0x44e3a0[_0x7b7e('0x4d')](_0x570303);}})[_0x7b7e('0x26')](function(_0x5b9010){if(_0x5b9010){return _0x5b9010?{'count':_0x16c81d,'rows':_0x5b9010}:null;}})[_0x7b7e('0x26')](respondWithResult(_0x16730c,null))['catch'](handleError(_0x16730c,null));};exports['addConfiguration']=function(_0x2b105a,_0x7cbe6c,_0x1eb4b1){if(_0x2b105a[_0x7b7e('0x4c')]['id']){delete _0x2b105a['body']['id'];}return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x2b105a[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x7cbe6c,null))[_0x7b7e('0x26')](function(_0x2b2afd){if(_0x2b2afd){_0x2b105a['body'][_0x7b7e('0x51')]=_0x2b2afd['id'];_0x2b105a['body']['Subjects']=integrations[_0x7b7e('0x52')](_0x2b105a['body'][_0x7b7e('0x53')],_0x2b105a['body'][_0x7b7e('0x2f')]);_0x2b105a[_0x7b7e('0x4c')]['Descriptions']=integrations[_0x7b7e('0x54')](_0x2b105a[_0x7b7e('0x4c')]['channel'],_0x2b105a[_0x7b7e('0x4c')][_0x7b7e('0x2f')]);return db[_0x7b7e('0x4f')][_0x7b7e('0x4b')](_0x2b105a[_0x7b7e('0x4c')],{'include':[{'model':db[_0x7b7e('0x55')],'as':_0x7b7e('0x56')},{'model':db[_0x7b7e('0x55')],'as':_0x7b7e('0x57')}]});}return null;})[_0x7b7e('0x26')](respondWithResult(_0x7cbe6c,null))['catch'](handleError(_0x7cbe6c,null));};exports['getFields']=function(_0x34e7df,_0x46ac1f,_0x2c6e3a){var _0x348c77='';return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x34e7df[_0x7b7e('0x47')]['id']},'attributes':['id','username',_0x7b7e('0x58'),_0x7b7e('0x59'),'authType',_0x7b7e('0x5a')]})[_0x7b7e('0x26')](handleEntityNotFound(_0x46ac1f,null))[_0x7b7e('0x26')](function(_0x271318){if(_0x271318){_0x348c77=_0x271318[_0x7b7e('0x5a')];var _0x40f65e=_0x348c77[_0x7b7e('0x5b')](-0x1);if(_0x40f65e==='/'){_0x348c77=_0x348c77[_0x7b7e('0x5c')](0x0,_0x348c77[_0x7b7e('0x5d')](_0x40f65e));}var _0x3b6bc6={'method':_0x7b7e('0x5e'),'uri':util['format'](_0x7b7e('0x5f'),_0x348c77,_0x7b7e('0x60')),'json':!![]};switch(_0x271318[_0x7b7e('0x61')]){case _0x7b7e('0x58'):_0x3b6bc6[_0x7b7e('0x62')]={'Authorization':util[_0x7b7e('0x63')](_0x7b7e('0x64'),new Buffer(util['format'](_0x7b7e('0x65'),_0x271318[_0x7b7e('0x66')],_0x271318[_0x7b7e('0x58')]))['toString'](_0x7b7e('0x67')))};break;case _0x7b7e('0x59'):_0x3b6bc6[_0x7b7e('0x62')]={'Authorization':util[_0x7b7e('0x63')](_0x7b7e('0x64'),new Buffer(util['format']('%s/token:%s',_0x271318['username'],_0x271318[_0x7b7e('0x59')]))[_0x7b7e('0x68')](_0x7b7e('0x67')))};break;default:throw new db['Sequelize'][(_0x7b7e('0x69'))](_0x7b7e('0x6a'));}return rp(_0x3b6bc6);}})[_0x7b7e('0x26')](function(_0x5bf4d1){if(_0x5bf4d1){var _0x2983bf=[_0x7b7e('0x6b'),_0x7b7e('0x6c'),_0x7b7e('0x6d'),'assignee'];_[_0x7b7e('0x6e')](_0x5bf4d1[_0x7b7e('0x60')],function(_0xa52b93){return _0x2983bf[_0x7b7e('0x6f')](_0xa52b93['type']);});return{'count':_0x5bf4d1['ticket_fields'][_0x7b7e('0x48')],'rows':_['map'](_0x5bf4d1[_0x7b7e('0x60')],function(_0x4215b5){return{'id':_0x4215b5['id'],'name':_0x4215b5[_0x7b7e('0x70')]>0x7?_0x4215b5[_0x7b7e('0x71')]:_0x4215b5['type'],'custom':_0x4215b5[_0x7b7e('0x70')]>0x7?!![]:![],'options':_0x4215b5[_0x7b7e('0x72')]?_0x4215b5[_0x7b7e('0x72')]:_0x4215b5[_0x7b7e('0x73')]?_0x4215b5[_0x7b7e('0x73')]:[]};})};}})[_0x7b7e('0x26')](respondWithResult(_0x46ac1f,null))[_0x7b7e('0x4a')](function(_0x372478){var _0x44d8c4=_0x34e7df[_0x7b7e('0x31')][_0x7b7e('0x74')]?0x1f4:_0x372478[_0x7b7e('0x75')]||0x1f4;logger[_0x7b7e('0x76')](_0x7b7e('0x77'),_0x7b7e('0x78'),_0x44d8c4,JSON[_0x7b7e('0x79')](_0x372478));delete _0x372478['name'];if(_0x44d8c4===0x191){_0x44d8c4=0x190;}_0x46ac1f[_0x7b7e('0x1a')](_0x44d8c4)[_0x7b7e('0x7a')](_0x34e7df[_0x7b7e('0x31')][_0x7b7e('0x74')]?{'message':_0x7b7e('0x7b'),'statusCode':_0x372478[_0x7b7e('0x75')]}:_0x372478);});}; \ No newline at end of file +var _0xeb74=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','filter','AccountId','channel','Descriptions','ZendeskField','Subjects','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','%s:%s','toString','base64','Basic\x20%s','%s/token:%s','Sequelize','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xeb74,0xe3));var _0x4eb7=function(_0x11eee6,_0x3f22b5){_0x11eee6=_0x11eee6-0x0;var _0x4427d4=_0xeb74[_0x11eee6];return _0x4427d4;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];var integrations=require(_0x4eb7('0x19'));function respondWithStatusCode(_0x4194e1,_0x3c9f45){_0x3c9f45=_0x3c9f45||0xcc;return function(_0x4c27a4){if(_0x4c27a4){return _0x4194e1['sendStatus'](_0x3c9f45);}return _0x4194e1['status'](_0x3c9f45)[_0x4eb7('0x1a')]();};}function respondWithResult(_0x51f09d,_0x84c68b){_0x84c68b=_0x84c68b||0xc8;return function(_0x119afa){if(_0x119afa){return _0x51f09d[_0x4eb7('0x1b')](_0x84c68b)[_0x4eb7('0x1c')](_0x119afa);}};}function respondWithFilteredResult(_0x5d6d5,_0x21433d){return function(_0x11674f){if(_0x11674f){var _0x76988=typeof _0x21433d[_0x4eb7('0x1d')]===_0x4eb7('0x1e')&&typeof _0x21433d['limit']===_0x4eb7('0x1e');var _0x11ac9f=_0x11674f[_0x4eb7('0x1f')];var _0xf14478=_0x76988?0x0:_0x21433d[_0x4eb7('0x1d')];var _0x44f1b9=_0x76988?_0x11674f[_0x4eb7('0x1f')]:_0x21433d[_0x4eb7('0x1d')]+_0x21433d['limit'];var _0x3cf53a;if(_0x44f1b9>=_0x11ac9f){_0x44f1b9=_0x11ac9f;_0x3cf53a=0xc8;}else{_0x3cf53a=0xce;}_0x5d6d5[_0x4eb7('0x1b')](_0x3cf53a);return _0x5d6d5[_0x4eb7('0x20')](_0x4eb7('0x21'),_0xf14478+'-'+_0x44f1b9+'/'+_0x11ac9f)[_0x4eb7('0x1c')](_0x11674f);}return null;};}function patchUpdates(_0x2efd67){return function(_0x11fb0a){try{jsonpatch['apply'](_0x11fb0a,_0x2efd67,!![]);}catch(_0x214a28){return BPromise[_0x4eb7('0x22')](_0x214a28);}return _0x11fb0a[_0x4eb7('0x23')]();};}function saveUpdates(_0x164515,_0x14a7be){return function(_0x1b4640){if(_0x1b4640){return _0x1b4640[_0x4eb7('0x24')](_0x164515)[_0x4eb7('0x25')](function(_0x1a2b8b){return _0x1a2b8b;});}return null;};}function removeEntity(_0x13e871,_0x4de2d9){return function(_0x3e72cd){if(_0x3e72cd){return _0x3e72cd[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x13e871[_0x4eb7('0x1b')](0xcc)[_0x4eb7('0x1a')]();});}};}function handleEntityNotFound(_0x25eb74,_0x365060){return function(_0xe9db8){if(!_0xe9db8){_0x25eb74[_0x4eb7('0x27')](0x194);}return _0xe9db8;};}function handleError(_0x248759,_0xf83c11){_0xf83c11=_0xf83c11||0x1f4;return function(_0x2984b2){logger[_0x4eb7('0x28')](_0x2984b2[_0x4eb7('0x29')]);if(_0x2984b2[_0x4eb7('0x2a')]){delete _0x2984b2[_0x4eb7('0x2a')];}_0x248759[_0x4eb7('0x1b')](_0xf83c11)[_0x4eb7('0x2b')](_0x2984b2);};}exports[_0x4eb7('0x2c')]=function(_0x28fda8,_0x114c68){var _0x17030a={},_0x3ed224={},_0x50209d={'count':0x0,'rows':[]};var _0x34515c=_['map'](db[_0x4eb7('0x2d')][_0x4eb7('0x2e')],function(_0xc5aa21){return{'name':_0xc5aa21[_0x4eb7('0x2f')],'type':_0xc5aa21[_0x4eb7('0x30')][_0x4eb7('0x31')]};});_0x3ed224[_0x4eb7('0x32')]=_[_0x4eb7('0x33')](_0x34515c,_0x4eb7('0x2a'));_0x3ed224['query']=_[_0x4eb7('0x34')](_0x28fda8['query']);_0x3ed224[_0x4eb7('0x35')]=_[_0x4eb7('0x36')](_0x3ed224['model'],_0x3ed224['query']);_0x17030a[_0x4eb7('0x37')]=_[_0x4eb7('0x36')](_0x3ed224[_0x4eb7('0x32')],qs[_0x4eb7('0x38')](_0x28fda8['query'][_0x4eb7('0x38')]));_0x17030a[_0x4eb7('0x37')]=_0x17030a[_0x4eb7('0x37')][_0x4eb7('0x39')]?_0x17030a[_0x4eb7('0x37')]:_0x3ed224['model'];if(!_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x3b')](_0x4eb7('0x3c'))){_0x17030a['limit']=qs[_0x4eb7('0x3d')](_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x3d')]);_0x17030a['offset']=qs[_0x4eb7('0x1d')](_0x28fda8['query'][_0x4eb7('0x1d')]);}_0x17030a[_0x4eb7('0x3e')]=qs[_0x4eb7('0x3f')](_0x28fda8[_0x4eb7('0x3a')]['sort']);_0x17030a[_0x4eb7('0x40')]=qs[_0x4eb7('0x35')](_[_0x4eb7('0x41')](_0x28fda8[_0x4eb7('0x3a')],_0x3ed224['filters']),_0x34515c);if(_0x28fda8['query']['filter']){_0x17030a[_0x4eb7('0x40')]=_[_0x4eb7('0x42')](_0x17030a[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x33')](_0x34515c,function(_0x210c20){if(_0x210c20[_0x4eb7('0x30')]!==_0x4eb7('0x43')){var _0x20d2bc={};_0x20d2bc[_0x210c20[_0x4eb7('0x2a')]]={'$like':'%'+_0x28fda8[_0x4eb7('0x3a')]['filter']+'%'};return _0x20d2bc;}})});}_0x17030a=_[_0x4eb7('0x42')]({},_0x17030a,_0x28fda8[_0x4eb7('0x44')]);var _0xe04d76={'where':_0x17030a[_0x4eb7('0x40')]};return db[_0x4eb7('0x2d')][_0x4eb7('0x1f')](_0xe04d76)[_0x4eb7('0x25')](function(_0xef998f){_0x50209d[_0x4eb7('0x1f')]=_0xef998f;if(_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x45')]){_0x17030a[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x2d')][_0x4eb7('0x47')](_0x17030a);})[_0x4eb7('0x25')](function(_0x5b819f){_0x50209d[_0x4eb7('0x48')]=_0x5b819f;return _0x50209d;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x114c68,_0x17030a))[_0x4eb7('0x49')](handleError(_0x114c68,null));};exports[_0x4eb7('0x4a')]=function(_0x5eff9e,_0x2fd5c2){var _0x2df542={'raw':![],'where':{'id':_0x5eff9e[_0x4eb7('0x4b')]['id']}},_0x482357={};_0x482357[_0x4eb7('0x32')]=_[_0x4eb7('0x34')](db[_0x4eb7('0x2d')][_0x4eb7('0x2e')]);_0x482357[_0x4eb7('0x3a')]=_['keys'](_0x5eff9e[_0x4eb7('0x3a')]);_0x482357['filters']=_[_0x4eb7('0x36')](_0x482357[_0x4eb7('0x32')],_0x482357[_0x4eb7('0x3a')]);_0x2df542['attributes']=_[_0x4eb7('0x36')](_0x482357[_0x4eb7('0x32')],qs[_0x4eb7('0x38')](_0x5eff9e[_0x4eb7('0x3a')]['fields']));_0x2df542[_0x4eb7('0x37')]=_0x2df542['attributes'][_0x4eb7('0x39')]?_0x2df542[_0x4eb7('0x37')]:_0x482357[_0x4eb7('0x32')];if(_0x5eff9e[_0x4eb7('0x3a')][_0x4eb7('0x45')]){_0x2df542['include']=[{'all':!![]}];}_0x2df542=_['merge']({},_0x2df542,_0x5eff9e[_0x4eb7('0x44')]);return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')](_0x2df542)[_0x4eb7('0x25')](handleEntityNotFound(_0x2fd5c2,null))[_0x4eb7('0x25')](respondWithResult(_0x2fd5c2,null))['catch'](handleError(_0x2fd5c2,null));};exports[_0x4eb7('0x4d')]=function(_0x104284,_0x56609e){return db[_0x4eb7('0x2d')][_0x4eb7('0x4d')](_0x104284['body'],{})[_0x4eb7('0x25')](respondWithResult(_0x56609e,0xc9))[_0x4eb7('0x49')](handleError(_0x56609e,null));};exports[_0x4eb7('0x24')]=function(_0x5774d5,_0x130113){if(_0x5774d5['body']['id']){delete _0x5774d5['body']['id'];}return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')]({'where':{'id':_0x5774d5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x130113,null))[_0x4eb7('0x25')](saveUpdates(_0x5774d5[_0x4eb7('0x4e')],null))[_0x4eb7('0x25')](respondWithResult(_0x130113,null))[_0x4eb7('0x49')](handleError(_0x130113,null));};exports[_0x4eb7('0x26')]=function(_0x23c0d5,_0x42a1d9){return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')]({'where':{'id':_0x23c0d5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x42a1d9,null))[_0x4eb7('0x25')](removeEntity(_0x42a1d9,null))[_0x4eb7('0x49')](handleError(_0x42a1d9,null));};exports[_0x4eb7('0x4f')]=function(_0x1411c9,_0x11cc3d,_0x4cfba8){var _0x3f3d41={};var _0x550888={};var _0x4db5f7;var _0x3f3a5f;return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x1411c9[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x11cc3d,null))['then'](function(_0x4e3163){if(_0x4e3163){_0x4db5f7=_0x4e3163;_0x550888[_0x4eb7('0x32')]=_['keys'](db[_0x4eb7('0x51')][_0x4eb7('0x2e')]);_0x550888[_0x4eb7('0x3a')]=_[_0x4eb7('0x34')](_0x1411c9['query']);_0x550888[_0x4eb7('0x35')]=_[_0x4eb7('0x36')](_0x550888[_0x4eb7('0x32')],_0x550888[_0x4eb7('0x3a')]);_0x3f3d41['attributes']=_[_0x4eb7('0x36')](_0x550888[_0x4eb7('0x32')],qs['fields'](_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x38')]));_0x3f3d41['attributes']=_0x3f3d41[_0x4eb7('0x37')]['length']?_0x3f3d41[_0x4eb7('0x37')]:_0x550888['model'];_0x3f3d41[_0x4eb7('0x3e')]=qs[_0x4eb7('0x3f')](_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x3f')]);_0x3f3d41[_0x4eb7('0x40')]=qs[_0x4eb7('0x35')](_['pick'](_0x1411c9['query'],_0x550888[_0x4eb7('0x35')]));if(_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x52')]){_0x3f3d41[_0x4eb7('0x40')]=_['merge'](_0x3f3d41[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x33')](_0x3f3d41['attributes'],function(_0x452f21){var _0xba9272={};_0xba9272[_0x452f21]={'$like':'%'+_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x52')]+'%'};return _0xba9272;})});}_0x3f3d41=_[_0x4eb7('0x42')]({},_0x3f3d41,_0x1411c9[_0x4eb7('0x44')]);return _0x4db5f7[_0x4eb7('0x4f')](_0x3f3d41);}})['then'](function(_0x5839f1){if(_0x5839f1){_0x3f3a5f=_0x5839f1[_0x4eb7('0x39')];if(!_0x1411c9['query'][_0x4eb7('0x3b')]('nolimit')){_0x3f3d41[_0x4eb7('0x3d')]=qs['limit'](_0x1411c9['query'][_0x4eb7('0x3d')]);_0x3f3d41[_0x4eb7('0x1d')]=qs['offset'](_0x1411c9[_0x4eb7('0x3a')]['offset']);}return _0x4db5f7[_0x4eb7('0x4f')](_0x3f3d41);}})[_0x4eb7('0x25')](function(_0x4ab8e8){if(_0x4ab8e8){return _0x4ab8e8?{'count':_0x3f3a5f,'rows':_0x4ab8e8}:null;}})[_0x4eb7('0x25')](respondWithResult(_0x11cc3d,null))[_0x4eb7('0x49')](handleError(_0x11cc3d,null));};exports['addConfiguration']=function(_0x4b492a,_0x5c8d45,_0x59e2f2){if(_0x4b492a[_0x4eb7('0x4e')]['id']){delete _0x4b492a['body']['id'];}return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x4b492a['params']['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5c8d45,null))[_0x4eb7('0x25')](function(_0x463ab6){if(_0x463ab6){_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x53')]=_0x463ab6['id'];_0x4b492a[_0x4eb7('0x4e')]['Subjects']=integrations['getSubjects'](_0x4b492a['body'][_0x4eb7('0x54')],_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x30')]);_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x55')]=integrations['getDescriptions'](_0x4b492a['body'][_0x4eb7('0x54')],_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x30')]);return db[_0x4eb7('0x51')][_0x4eb7('0x4d')](_0x4b492a['body'],{'include':[{'model':db[_0x4eb7('0x56')],'as':_0x4eb7('0x57')},{'model':db[_0x4eb7('0x56')],'as':_0x4eb7('0x55')}]});}return null;})['then'](respondWithResult(_0x5c8d45,null))['catch'](handleError(_0x5c8d45,null));};exports[_0x4eb7('0x58')]=function(_0x3883f3,_0x4e8125,_0x1911ad){var _0x4b698b='';return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x3883f3[_0x4eb7('0x4b')]['id']},'attributes':['id',_0x4eb7('0x59'),'password',_0x4eb7('0x5a'),_0x4eb7('0x5b'),_0x4eb7('0x5c')]})[_0x4eb7('0x25')](handleEntityNotFound(_0x4e8125,null))[_0x4eb7('0x25')](function(_0x3271d0){if(_0x3271d0){_0x4b698b=_0x3271d0[_0x4eb7('0x5c')];var _0x232242=_0x4b698b[_0x4eb7('0x5d')](-0x1);if(_0x232242==='/'){_0x4b698b=_0x4b698b[_0x4eb7('0x5e')](0x0,_0x4b698b[_0x4eb7('0x5f')](_0x232242));}var _0x713b0a={'method':_0x4eb7('0x60'),'uri':util[_0x4eb7('0x61')](_0x4eb7('0x62'),_0x4b698b,_0x4eb7('0x63')),'json':!![]};switch(_0x3271d0[_0x4eb7('0x5b')]){case _0x4eb7('0x64'):_0x713b0a[_0x4eb7('0x65')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4eb7('0x61')](_0x4eb7('0x66'),_0x3271d0[_0x4eb7('0x59')],_0x3271d0[_0x4eb7('0x64')]))[_0x4eb7('0x67')](_0x4eb7('0x68')))};break;case _0x4eb7('0x5a'):_0x713b0a[_0x4eb7('0x65')]={'Authorization':util['format'](_0x4eb7('0x69'),new Buffer(util[_0x4eb7('0x61')](_0x4eb7('0x6a'),_0x3271d0['username'],_0x3271d0['token']))[_0x4eb7('0x67')](_0x4eb7('0x68')))};break;default:throw new db[(_0x4eb7('0x6b'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x713b0a);}})[_0x4eb7('0x25')](function(_0x1a1525){if(_0x1a1525){var _0x4778f9=[_0x4eb7('0x6c'),_0x4eb7('0x6d'),_0x4eb7('0x6e'),_0x4eb7('0x6f')];_[_0x4eb7('0x70')](_0x1a1525[_0x4eb7('0x63')],function(_0x2e531e){return _0x4778f9[_0x4eb7('0x71')](_0x2e531e[_0x4eb7('0x30')]);});return{'count':_0x1a1525['ticket_fields']['length'],'rows':_[_0x4eb7('0x33')](_0x1a1525[_0x4eb7('0x63')],function(_0x14648d){return{'id':_0x14648d['id'],'name':_0x14648d[_0x4eb7('0x72')]>0x7?_0x14648d[_0x4eb7('0x73')]:_0x14648d[_0x4eb7('0x30')],'custom':_0x14648d['position']>0x7?!![]:![],'options':_0x14648d['system_field_options']?_0x14648d[_0x4eb7('0x74')]:_0x14648d[_0x4eb7('0x75')]?_0x14648d[_0x4eb7('0x75')]:[]};})};}})[_0x4eb7('0x25')](respondWithResult(_0x4e8125,null))[_0x4eb7('0x49')](function(_0x2480ed){var _0x13f574=_0x3883f3[_0x4eb7('0x3a')][_0x4eb7('0x76')]?0x1f4:_0x2480ed[_0x4eb7('0x77')]||0x1f4;logger[_0x4eb7('0x28')](_0x4eb7('0x78'),_0x4eb7('0x58'),_0x13f574,JSON[_0x4eb7('0x79')](_0x2480ed));delete _0x2480ed['name'];if(_0x13f574===0x191){_0x13f574=0x190;}_0x4e8125[_0x4eb7('0x1b')](_0x13f574)[_0x4eb7('0x2b')](_0x3883f3[_0x4eb7('0x3a')][_0x4eb7('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x2480ed[_0x4eb7('0x77')]}:_0x2480ed);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index a153967..16b3740 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 _0x26ab=['rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','ZendeskAccount','int_zendesk_accounts','util','api','moment','bluebird','request-promise','path'];(function(_0x18cea4,_0x5ec50c){var _0x2cac6a=function(_0x49c569){while(--_0x49c569){_0x18cea4['push'](_0x18cea4['shift']());}};_0x2cac6a(++_0x5ec50c);}(_0x26ab,0xec));var _0xb26a=function(_0x54f634,_0x4a8120){_0x54f634=_0x54f634-0x0;var _0x551cd8=_0x26ab[_0x54f634];return _0x551cd8;};'use strict';var _=require('lodash');var util=require(_0xb26a('0x0'));var logger=require('../../config/logger')(_0xb26a('0x1'));var moment=require(_0xb26a('0x2'));var BPromise=require(_0xb26a('0x3'));var rp=require(_0xb26a('0x4'));var fs=require('fs');var path=require(_0xb26a('0x5'));var rimraf=require(_0xb26a('0x6'));var config=require('../../config/environment');var attributes=require(_0xb26a('0x7'));var integrations=require(_0xb26a('0x8'));module['exports']=function(_0x44fcd6,_0x10abbb){return _0x44fcd6['define'](_0xb26a('0x9'),attributes,{'tableName':_0xb26a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36a5=['path','rimraf','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x479033,_0x2d3575){var _0xe343a2=function(_0x1eaf50){while(--_0x1eaf50){_0x479033['push'](_0x479033['shift']());}};_0xe343a2(++_0x2d3575);}(_0x36a5,0x172));var _0x536a=function(_0x1f1cfa,_0x29dc89){_0x1f1cfa=_0x1f1cfa-0x0;var _0x46d60e=_0x36a5[_0x1f1cfa];return _0x46d60e;};'use strict';var _=require(_0x536a('0x0'));var util=require(_0x536a('0x1'));var logger=require(_0x536a('0x2'))(_0x536a('0x3'));var moment=require(_0x536a('0x4'));var BPromise=require(_0x536a('0x5'));var rp=require(_0x536a('0x6'));var fs=require('fs');var path=require(_0x536a('0x7'));var rimraf=require(_0x536a('0x8'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x536a('0x9'));module[_0x536a('0xa')]=function(_0x5dd72e,_0x59544d){return _0x5dd72e[_0x536a('0xb')]('ZendeskAccount',attributes,{'tableName':_0x536a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 6c95b91..21d9b71 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 _0xa0f5=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','limit','include','map','attributes','model','then','ShowZendeskAccount','find','where','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x199688,_0x5757fb){var _0x230a7f=function(_0x2d98fd){while(--_0x2d98fd){_0x199688['push'](_0x199688['shift']());}};_0x230a7f(++_0x5757fb);}(_0xa0f5,0x1ac));var _0x5a0f=function(_0x2a2093,_0x4a495c){_0x2a2093=_0x2a2093-0x0;var _0x47e4a2=_0xa0f5[_0x2a2093];return _0x47e4a2;};'use strict';var _=require('lodash');var util=require(_0x5a0f('0x0'));var moment=require('moment');var BPromise=require(_0x5a0f('0x1'));var rs=require(_0x5a0f('0x2'));var fs=require('fs');var Redis=require(_0x5a0f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a0f('0x4'));var logger=require(_0x5a0f('0x5'))(_0x5a0f('0x6'));var config=require(_0x5a0f('0x7'));var jayson=require(_0x5a0f('0x8'));var client=jayson[_0x5a0f('0x9')][_0x5a0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xac4a30,_0xad5940,_0x3e6585){return new BPromise(function(_0x185be3,_0x5ca336){return client[_0x5a0f('0xb')](_0xac4a30,_0x3e6585)['then'](function(_0xc56cb0){logger[_0x5a0f('0xc')](_0x5a0f('0xd'),_0xad5940,_0x5a0f('0xe'));logger[_0x5a0f('0xf')](_0x5a0f('0x10'),_0xad5940,_0x5a0f('0xe'),JSON[_0x5a0f('0x11')](_0xc56cb0));if(_0xc56cb0[_0x5a0f('0x12')]){if(_0xc56cb0['error'][_0x5a0f('0x13')]===0x1f4){logger['error'](_0x5a0f('0xd'),_0xad5940,_0xc56cb0[_0x5a0f('0x12')]['message']);return _0x5ca336(_0xc56cb0['error'][_0x5a0f('0x14')]);}logger['error'](_0x5a0f('0xd'),_0xad5940,_0xc56cb0[_0x5a0f('0x12')]['message']);return _0x185be3(_0xc56cb0['error'][_0x5a0f('0x14')]);}else{logger[_0x5a0f('0xc')](_0x5a0f('0xd'),_0xad5940,_0x5a0f('0xe'));_0x185be3(_0xc56cb0[_0x5a0f('0x15')][_0x5a0f('0x14')]);}})[_0x5a0f('0x16')](function(_0x3cd9e3){logger[_0x5a0f('0x12')](_0x5a0f('0xd'),_0xad5940,_0x3cd9e3);_0x5ca336(_0x3cd9e3);});});}exports[_0x5a0f('0x17')]=function(_0x18ebaa){var _0x2a52bb=this;return new Promise(function(_0x149d05,_0x22dfba){return db[_0x5a0f('0x18')][_0x5a0f('0x19')]({'raw':_0x18ebaa[_0x5a0f('0x1a')]?_0x18ebaa[_0x5a0f('0x1a')][_0x5a0f('0x1b')]===undefined?!![]:![]:!![],'where':_0x18ebaa[_0x5a0f('0x1a')]?_0x18ebaa[_0x5a0f('0x1a')]['where']||null:null,'attributes':_0x18ebaa[_0x5a0f('0x1a')]?_0x18ebaa[_0x5a0f('0x1a')]['attributes']||null:null,'limit':_0x18ebaa['options']?_0x18ebaa[_0x5a0f('0x1a')][_0x5a0f('0x1c')]||null:null,'include':_0x18ebaa[_0x5a0f('0x1a')]?_0x18ebaa[_0x5a0f('0x1a')][_0x5a0f('0x1d')]?_[_0x5a0f('0x1e')](_0x18ebaa[_0x5a0f('0x1a')][_0x5a0f('0x1d')],function(_0x40bb40){return{'model':db[_0x40bb40['model']],'as':_0x40bb40['as'],'attributes':_0x40bb40[_0x5a0f('0x1f')],'include':_0x40bb40[_0x5a0f('0x1d')]?_['map'](_0x40bb40['include'],function(_0x4cc918){return{'model':db[_0x4cc918['model']],'as':_0x4cc918['as'],'attributes':_0x4cc918['attributes'],'include':_0x4cc918[_0x5a0f('0x1d')]?_[_0x5a0f('0x1e')](_0x4cc918['include'],function(_0x1263df){return{'model':db[_0x1263df[_0x5a0f('0x20')]],'as':_0x1263df['as'],'attributes':_0x1263df['attributes']};}):[]};}):[]};}):[]:[]})[_0x5a0f('0x21')](function(_0x3ba3dd){logger[_0x5a0f('0xc')]('GetZendeskAccount',_0x18ebaa);logger[_0x5a0f('0xf')](_0x5a0f('0x17'),_0x18ebaa,JSON[_0x5a0f('0x11')](_0x3ba3dd));_0x149d05(_0x3ba3dd);})[_0x5a0f('0x16')](function(_0xd2b9dc){logger[_0x5a0f('0x12')](_0x5a0f('0x17'),_0xd2b9dc[_0x5a0f('0x14')],_0x18ebaa);_0x22dfba(_0x2a52bb[_0x5a0f('0x12')](0x1f4,_0xd2b9dc['message']));});});};exports[_0x5a0f('0x22')]=function(_0x1992b6){var _0x178ed1=this;return new Promise(function(_0x470c64,_0x4fa9f5){return db[_0x5a0f('0x18')][_0x5a0f('0x23')]({'raw':_0x1992b6[_0x5a0f('0x1a')]?_0x1992b6[_0x5a0f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1992b6[_0x5a0f('0x1a')]?_0x1992b6['options'][_0x5a0f('0x24')]||null:null,'attributes':_0x1992b6[_0x5a0f('0x1a')]?_0x1992b6[_0x5a0f('0x1a')][_0x5a0f('0x1f')]||null:null,'include':_0x1992b6[_0x5a0f('0x1a')]?_0x1992b6['options'][_0x5a0f('0x1d')]?_[_0x5a0f('0x1e')](_0x1992b6[_0x5a0f('0x1a')][_0x5a0f('0x1d')],function(_0x1dd709){return{'model':db[_0x1dd709[_0x5a0f('0x20')]],'as':_0x1dd709['as'],'attributes':_0x1dd709[_0x5a0f('0x1f')],'include':_0x1dd709['include']?_[_0x5a0f('0x1e')](_0x1dd709[_0x5a0f('0x1d')],function(_0x5645a2){return{'model':db[_0x5645a2[_0x5a0f('0x20')]],'as':_0x5645a2['as'],'attributes':_0x5645a2[_0x5a0f('0x1f')],'include':_0x5645a2[_0x5a0f('0x1d')]?_[_0x5a0f('0x1e')](_0x5645a2['include'],function(_0x26c9fc){return{'model':db[_0x26c9fc[_0x5a0f('0x20')]],'as':_0x26c9fc['as'],'attributes':_0x26c9fc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d190f){logger[_0x5a0f('0xc')]('ShowZendeskAccount',_0x1992b6);logger[_0x5a0f('0xf')](_0x5a0f('0x22'),_0x1992b6,JSON['stringify'](_0x1d190f));_0x470c64(_0x1d190f);})['catch'](function(_0x70edeb){logger[_0x5a0f('0x12')](_0x5a0f('0x22'),_0x70edeb[_0x5a0f('0x14')],_0x1992b6);_0x4fa9f5(_0x178ed1[_0x5a0f('0x12')](0x1f4,_0x70edeb['message']));});});}; \ No newline at end of file +var _0xafc8=['request\x20sent','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','map','include','model','ShowZendeskAccount','find','raw','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0xafc8,0x7a));var _0x8afc=function(_0xc00f64,_0x591df2){_0xc00f64=_0xc00f64-0x0;var _0x2e2c56=_0xafc8[_0xc00f64];return _0x2e2c56;};'use strict';var _=require(_0x8afc('0x0'));var util=require('util');var moment=require(_0x8afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x8afc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8afc('0x3'))['db'];var utils=require(_0x8afc('0x4'));var logger=require(_0x8afc('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8afc('0x6'));var client=jayson[_0x8afc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x131ead,_0x44a27e,_0x3a1850){return new BPromise(function(_0x4fe751,_0x23d286){return client[_0x8afc('0x8')](_0x131ead,_0x3a1850)[_0x8afc('0x9')](function(_0x1ac9c2){logger[_0x8afc('0xa')](_0x8afc('0xb'),_0x44a27e,'request\x20sent');logger[_0x8afc('0xc')](_0x8afc('0xd'),_0x44a27e,_0x8afc('0xe'),JSON[_0x8afc('0xf')](_0x1ac9c2));if(_0x1ac9c2['error']){if(_0x1ac9c2[_0x8afc('0x10')][_0x8afc('0x11')]===0x1f4){logger[_0x8afc('0x10')](_0x8afc('0xb'),_0x44a27e,_0x1ac9c2['error'][_0x8afc('0x12')]);return _0x23d286(_0x1ac9c2[_0x8afc('0x10')][_0x8afc('0x12')]);}logger[_0x8afc('0x10')](_0x8afc('0xb'),_0x44a27e,_0x1ac9c2[_0x8afc('0x10')]['message']);return _0x4fe751(_0x1ac9c2[_0x8afc('0x10')][_0x8afc('0x12')]);}else{logger[_0x8afc('0xa')](_0x8afc('0xb'),_0x44a27e,_0x8afc('0xe'));_0x4fe751(_0x1ac9c2[_0x8afc('0x13')][_0x8afc('0x12')]);}})[_0x8afc('0x14')](function(_0x51e5f5){logger[_0x8afc('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x44a27e,_0x51e5f5);_0x23d286(_0x51e5f5);});});}exports[_0x8afc('0x15')]=function(_0x2e7503){var _0x389393=this;return new Promise(function(_0x12cafb,_0x28b1ac){return db[_0x8afc('0x16')][_0x8afc('0x17')]({'raw':_0x2e7503['options']?_0x2e7503[_0x8afc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2e7503[_0x8afc('0x18')]?_0x2e7503[_0x8afc('0x18')][_0x8afc('0x19')]||null:null,'attributes':_0x2e7503[_0x8afc('0x18')]?_0x2e7503[_0x8afc('0x18')][_0x8afc('0x1a')]||null:null,'limit':_0x2e7503[_0x8afc('0x18')]?_0x2e7503['options'][_0x8afc('0x1b')]||null:null,'include':_0x2e7503[_0x8afc('0x18')]?_0x2e7503[_0x8afc('0x18')]['include']?_[_0x8afc('0x1c')](_0x2e7503[_0x8afc('0x18')][_0x8afc('0x1d')],function(_0x2688eb){return{'model':db[_0x2688eb['model']],'as':_0x2688eb['as'],'attributes':_0x2688eb[_0x8afc('0x1a')],'include':_0x2688eb[_0x8afc('0x1d')]?_[_0x8afc('0x1c')](_0x2688eb['include'],function(_0x224bfa){return{'model':db[_0x224bfa[_0x8afc('0x1e')]],'as':_0x224bfa['as'],'attributes':_0x224bfa[_0x8afc('0x1a')],'include':_0x224bfa[_0x8afc('0x1d')]?_[_0x8afc('0x1c')](_0x224bfa[_0x8afc('0x1d')],function(_0x538ace){return{'model':db[_0x538ace['model']],'as':_0x538ace['as'],'attributes':_0x538ace[_0x8afc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8afc('0x9')](function(_0x55124d){logger['info'](_0x8afc('0x15'),_0x2e7503);logger[_0x8afc('0xc')](_0x8afc('0x15'),_0x2e7503,JSON[_0x8afc('0xf')](_0x55124d));_0x12cafb(_0x55124d);})[_0x8afc('0x14')](function(_0x672f80){logger[_0x8afc('0x10')](_0x8afc('0x15'),_0x672f80[_0x8afc('0x12')],_0x2e7503);_0x28b1ac(_0x389393[_0x8afc('0x10')](0x1f4,_0x672f80['message']));});});};exports[_0x8afc('0x1f')]=function(_0x3db914){var _0x36a6dc=this;return new Promise(function(_0xb292dd,_0x599fd5){return db[_0x8afc('0x16')][_0x8afc('0x20')]({'raw':_0x3db914[_0x8afc('0x18')]?_0x3db914[_0x8afc('0x18')][_0x8afc('0x21')]===undefined?!![]:![]:!![],'where':_0x3db914[_0x8afc('0x18')]?_0x3db914[_0x8afc('0x18')][_0x8afc('0x19')]||null:null,'attributes':_0x3db914[_0x8afc('0x18')]?_0x3db914[_0x8afc('0x18')][_0x8afc('0x1a')]||null:null,'include':_0x3db914['options']?_0x3db914[_0x8afc('0x18')][_0x8afc('0x1d')]?_[_0x8afc('0x1c')](_0x3db914[_0x8afc('0x18')][_0x8afc('0x1d')],function(_0x1af493){return{'model':db[_0x1af493[_0x8afc('0x1e')]],'as':_0x1af493['as'],'attributes':_0x1af493[_0x8afc('0x1a')],'include':_0x1af493[_0x8afc('0x1d')]?_[_0x8afc('0x1c')](_0x1af493[_0x8afc('0x1d')],function(_0x88e51f){return{'model':db[_0x88e51f[_0x8afc('0x1e')]],'as':_0x88e51f['as'],'attributes':_0x88e51f[_0x8afc('0x1a')],'include':_0x88e51f['include']?_[_0x8afc('0x1c')](_0x88e51f[_0x8afc('0x1d')],function(_0x49e5df){return{'model':db[_0x49e5df[_0x8afc('0x1e')]],'as':_0x49e5df['as'],'attributes':_0x49e5df['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x35c56c){logger[_0x8afc('0xa')](_0x8afc('0x1f'),_0x3db914);logger[_0x8afc('0xc')](_0x8afc('0x1f'),_0x3db914,JSON[_0x8afc('0xf')](_0x35c56c));_0xb292dd(_0x35c56c);})[_0x8afc('0x14')](function(_0x2239aa){logger[_0x8afc('0x10')](_0x8afc('0x1f'),_0x2239aa[_0x8afc('0x12')],_0x3db914);_0x599fd5(_0x36a6dc[_0x8afc('0x10')](0x1f4,_0x2239aa['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index bc52bc3..ed7dffb 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 _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x35d16a,_0x41293b){var _0x2980ee=function(_0x23c552){while(--_0x23c552){_0x35d16a['push'](_0x35d16a['shift']());}};_0x2980ee(++_0x41293b);}(_0xb10b,0x12a));var _0xbb10=function(_0x641f18,_0x2919e8){_0x641f18=_0x641f18-0x0;var _0x16eefe=_0xb10b[_0x641f18];return _0x16eefe;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router; \ No newline at end of file +var _0x878f=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','/:id/fields','/:id/subjects','isAuthenticated','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x878f,0x173));var _0xf878=function(_0x141b44,_0x289b85){_0x141b44=_0x141b44-0x0;var _0x244169=_0x878f[_0x141b44];return _0x244169;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xf878('0xa')](_0xf878('0xd'),auth[_0xf878('0xe')](),controller['getSubjects']);router[_0xf878('0xa')](_0xf878('0xf'),auth['isAuthenticated'](),controller[_0xf878('0x10')]);router['get'](_0xf878('0x11'),auth[_0xf878('0xe')](),controller[_0xf878('0x12')]);router['post']('/',auth[_0xf878('0xe')](),controller[_0xf878('0x13')]);router[_0xf878('0x14')]('/:id/tags',auth[_0xf878('0xe')](),controller[_0xf878('0x15')]);router[_0xf878('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xf878('0x17')]);router[_0xf878('0x18')](_0xf878('0xb'),auth[_0xf878('0xe')](),controller[_0xf878('0x19')]);module[_0xf878('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 91d3b8b..bd0f0e7 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 _0x614b=['STRING','sequelize','exports'];(function(_0x364a36,_0x1e2677){var _0x5cd6fa=function(_0x58d692){while(--_0x58d692){_0x364a36['push'](_0x364a36['shift']());}};_0x5cd6fa(++_0x1e2677);}(_0x614b,0x106));var _0xb614=function(_0x585700,_0x5eaa85){_0x585700=_0x585700-0x0;var _0x57eebb=_0x614b[_0x585700];return _0x57eebb;};'use strict';var Sequelize=require(_0xb614('0x0'));module[_0xb614('0x1')]={'name':{'type':Sequelize[_0xb614('0x2')]},'description':{'type':Sequelize[_0xb614('0x2')]}}; \ No newline at end of file +var _0x98ca=['sequelize','exports'];(function(_0x24e6a1,_0x472427){var _0x4f82cf=function(_0x89e5ec){while(--_0x89e5ec){_0x24e6a1['push'](_0x24e6a1['shift']());}};_0x4f82cf(++_0x472427);}(_0x98ca,0xda));var _0xa98c=function(_0x33b573,_0xcaedaa){_0x33b573=_0x33b573-0x0;var _0x57b3a5=_0x98ca[_0x33b573];return _0x57b3a5;};'use strict';var Sequelize=require(_0xa98c('0x0'));module[_0xa98c('0x1')]={'name':{'type':Sequelize['STRING']},'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 88d84ba..8a60bd4 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 _0x790e=['destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','key','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then'];(function(_0xc0f3d0,_0x4cfe98){var _0x1798ba=function(_0xa3446d){while(--_0xa3446d){_0xc0f3d0['push'](_0xc0f3d0['shift']());}};_0x1798ba(++_0x4cfe98);}(_0x790e,0x188));var _0xe790=function(_0x3e82e1,_0x18ac84){_0x3e82e1=_0x3e82e1-0x0;var _0x5ded26=_0x790e[_0x3e82e1];return _0x5ded26;};'use strict';var emlformat=require(_0xe790('0x0'));var rimraf=require(_0xe790('0x1'));var zipdir=require(_0xe790('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe790('0x3'));var moment=require(_0xe790('0x4'));var BPromise=require(_0xe790('0x5'));var Mustache=require(_0xe790('0x6'));var util=require('util');var path=require(_0xe790('0x7'));var sox=require(_0xe790('0x8'));var csv=require('to-csv');var ejs=require(_0xe790('0x9'));var fs=require('fs');var fs_extra=require(_0xe790('0xa'));var _=require(_0xe790('0xb'));var squel=require(_0xe790('0xc'));var crypto=require(_0xe790('0xd'));var jsforce=require(_0xe790('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe790('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe790('0x10'));var authService=require(_0xe790('0x11'));var qs=require(_0xe790('0x12'));var as=require(_0xe790('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe790('0x14'));var utils=require(_0xe790('0x15'));var config=require(_0xe790('0x16'));var licenseUtil=require(_0xe790('0x17'));var db=require(_0xe790('0x18'))['db'];function respondWithStatusCode(_0x238eac,_0x17d3e4){_0x17d3e4=_0x17d3e4||0xcc;return function(_0x217133){if(_0x217133){return _0x238eac['sendStatus'](_0x17d3e4);}return _0x238eac[_0xe790('0x19')](_0x17d3e4)['end']();};}function respondWithResult(_0x53970c,_0x21f607){_0x21f607=_0x21f607||0xc8;return function(_0x57c629){if(_0x57c629){return _0x53970c[_0xe790('0x19')](_0x21f607)[_0xe790('0x1a')](_0x57c629);}};}function respondWithFilteredResult(_0x10e938,_0x50070d){return function(_0x5acb49){if(_0x5acb49){var _0x227a0c=typeof _0x50070d['offset']===_0xe790('0x1b')&&typeof _0x50070d[_0xe790('0x1c')]===_0xe790('0x1b');var _0x1970c7=_0x5acb49[_0xe790('0x1d')];var _0x9471de=_0x227a0c?0x0:_0x50070d['offset'];var _0xb15563=_0x227a0c?_0x5acb49[_0xe790('0x1d')]:_0x50070d[_0xe790('0x1e')]+_0x50070d[_0xe790('0x1c')];var _0xcea8f;if(_0xb15563>=_0x1970c7){_0xb15563=_0x1970c7;_0xcea8f=0xc8;}else{_0xcea8f=0xce;}_0x10e938[_0xe790('0x19')](_0xcea8f);return _0x10e938[_0xe790('0x1f')](_0xe790('0x20'),_0x9471de+'-'+_0xb15563+'/'+_0x1970c7)[_0xe790('0x1a')](_0x5acb49);}return null;};}function patchUpdates(_0x4aafd0){return function(_0x30fd11){try{jsonpatch[_0xe790('0x21')](_0x30fd11,_0x4aafd0,!![]);}catch(_0x29a147){return BPromise[_0xe790('0x22')](_0x29a147);}return _0x30fd11[_0xe790('0x23')]();};}function saveUpdates(_0xa2d793,_0x243896){return function(_0x3970f3){if(_0x3970f3){return _0x3970f3[_0xe790('0x24')](_0xa2d793)[_0xe790('0x25')](function(_0x867e07){return _0x867e07;});}return null;};}function removeEntity(_0x119346,_0x369d80){return function(_0x4f4f62){if(_0x4f4f62){return _0x4f4f62[_0xe790('0x26')]()[_0xe790('0x25')](function(){_0x119346[_0xe790('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x554451,_0x847eb4){return function(_0x152462){if(!_0x152462){_0x554451['sendStatus'](0x194);}return _0x152462;};}function handleError(_0x20f817,_0x51f6dc){_0x51f6dc=_0x51f6dc||0x1f4;return function(_0x173479){logger[_0xe790('0x27')](_0x173479[_0xe790('0x28')]);if(_0x173479[_0xe790('0x29')]){delete _0x173479['name'];}_0x20f817[_0xe790('0x19')](_0x51f6dc)[_0xe790('0x2a')](_0x173479);};}exports[_0xe790('0x2b')]=function(_0x1f2cb1,_0x19f977){var _0xd1d371={},_0x7a1139={},_0x2bfa9f={'count':0x0,'rows':[]};var _0xac0fd2=_[_0xe790('0x2c')](db[_0xe790('0x2d')][_0xe790('0x2e')],function(_0xb1b6f6){return{'name':_0xb1b6f6['fieldName'],'type':_0xb1b6f6[_0xe790('0x2f')][_0xe790('0x30')]};});_0x7a1139['model']=_[_0xe790('0x2c')](_0xac0fd2,_0xe790('0x29'));_0x7a1139['query']=_[_0xe790('0x31')](_0x1f2cb1[_0xe790('0x32')]);_0x7a1139[_0xe790('0x33')]=_[_0xe790('0x34')](_0x7a1139['model'],_0x7a1139['query']);_0xd1d371[_0xe790('0x35')]=_['intersection'](_0x7a1139[_0xe790('0x36')],qs[_0xe790('0x37')](_0x1f2cb1[_0xe790('0x32')]['fields']));_0xd1d371[_0xe790('0x35')]=_0xd1d371[_0xe790('0x35')]['length']?_0xd1d371[_0xe790('0x35')]:_0x7a1139['model'];if(!_0x1f2cb1['query'][_0xe790('0x38')](_0xe790('0x39'))){_0xd1d371[_0xe790('0x1c')]=qs['limit'](_0x1f2cb1[_0xe790('0x32')][_0xe790('0x1c')]);_0xd1d371[_0xe790('0x1e')]=qs[_0xe790('0x1e')](_0x1f2cb1[_0xe790('0x32')][_0xe790('0x1e')]);}_0xd1d371[_0xe790('0x3a')]=qs[_0xe790('0x3b')](_0x1f2cb1[_0xe790('0x32')]['sort']);_0xd1d371[_0xe790('0x3c')]=qs[_0xe790('0x33')](_['pick'](_0x1f2cb1[_0xe790('0x32')],_0x7a1139['filters']),_0xac0fd2);if(_0x1f2cb1[_0xe790('0x32')][_0xe790('0x3d')]){_0xd1d371[_0xe790('0x3c')]=_['merge'](_0xd1d371[_0xe790('0x3c')],{'$or':_[_0xe790('0x2c')](_0xac0fd2,function(_0xc959f4){if(_0xc959f4['type']!==_0xe790('0x3e')){var _0x28ad15={};_0x28ad15[_0xc959f4['name']]={'$like':'%'+_0x1f2cb1[_0xe790('0x32')]['filter']+'%'};return _0x28ad15;}})});}_0xd1d371=_[_0xe790('0x3f')]({},_0xd1d371,_0x1f2cb1[_0xe790('0x40')]);var _0x7e9d46={'where':_0xd1d371[_0xe790('0x3c')]};return db['ZendeskConfiguration'][_0xe790('0x1d')](_0x7e9d46)[_0xe790('0x25')](function(_0x947be){_0x2bfa9f[_0xe790('0x1d')]=_0x947be;if(_0x1f2cb1[_0xe790('0x32')][_0xe790('0x41')]){_0xd1d371[_0xe790('0x42')]=[{'all':!![]}];}return db[_0xe790('0x2d')][_0xe790('0x43')](_0xd1d371);})['then'](function(_0x233e4d){_0x2bfa9f[_0xe790('0x44')]=_0x233e4d;return _0x2bfa9f;})[_0xe790('0x25')](respondWithFilteredResult(_0x19f977,_0xd1d371))[_0xe790('0x45')](handleError(_0x19f977,null));};exports[_0xe790('0x46')]=function(_0xc3f95f,_0x1cc1bf){var _0x1b84fa={'raw':![],'where':{'id':_0xc3f95f[_0xe790('0x47')]['id']}},_0x200f5f={};_0x200f5f['model']=_['keys'](db['ZendeskConfiguration'][_0xe790('0x2e')]);_0x200f5f['query']=_['keys'](_0xc3f95f[_0xe790('0x32')]);_0x200f5f[_0xe790('0x33')]=_['intersection'](_0x200f5f[_0xe790('0x36')],_0x200f5f[_0xe790('0x32')]);_0x1b84fa[_0xe790('0x35')]=_['intersection'](_0x200f5f[_0xe790('0x36')],qs[_0xe790('0x37')](_0xc3f95f[_0xe790('0x32')][_0xe790('0x37')]));_0x1b84fa[_0xe790('0x35')]=_0x1b84fa[_0xe790('0x35')][_0xe790('0x48')]?_0x1b84fa[_0xe790('0x35')]:_0x200f5f['model'];if(_0xc3f95f['query'][_0xe790('0x41')]){_0x1b84fa['include']=[{'all':!![]}];}_0x1b84fa=_['merge']({},_0x1b84fa,_0xc3f95f[_0xe790('0x40')]);return db[_0xe790('0x2d')]['find'](_0x1b84fa)['then'](handleEntityNotFound(_0x1cc1bf,null))[_0xe790('0x25')](respondWithResult(_0x1cc1bf,null))[_0xe790('0x45')](handleError(_0x1cc1bf,null));};exports[_0xe790('0x49')]=function(_0x420e08,_0x478d36){return db[_0xe790('0x2d')]['create'](_0x420e08['body'],{})['then'](respondWithResult(_0x478d36,0xc9))[_0xe790('0x45')](handleError(_0x478d36,null));};exports[_0xe790('0x24')]=function(_0x3deb3a,_0x1a8206){if(_0x3deb3a[_0xe790('0x4a')]['id']){delete _0x3deb3a['body']['id'];}return db[_0xe790('0x2d')][_0xe790('0x4b')]({'where':{'id':_0x3deb3a[_0xe790('0x47')]['id']}})[_0xe790('0x25')](handleEntityNotFound(_0x1a8206,null))[_0xe790('0x25')](saveUpdates(_0x3deb3a[_0xe790('0x4a')],null))[_0xe790('0x25')](respondWithResult(_0x1a8206,null))[_0xe790('0x45')](handleError(_0x1a8206,null));};exports[_0xe790('0x26')]=function(_0x277e61,_0x2cf70a){return db[_0xe790('0x2d')][_0xe790('0x4b')]({'where':{'id':_0x277e61[_0xe790('0x47')]['id']}})[_0xe790('0x25')](handleEntityNotFound(_0x2cf70a,null))['then'](removeEntity(_0x2cf70a,null))[_0xe790('0x45')](handleError(_0x2cf70a,null));};exports[_0xe790('0x4c')]=function(_0x523c49,_0x293a63,_0xe22cbf){var _0xe9c500={};var _0xd6ca9c={};var _0x148c07;var _0x296538;return db['ZendeskConfiguration'][_0xe790('0x4d')]({'where':{'id':_0x523c49['params']['id']}})[_0xe790('0x25')](handleEntityNotFound(_0x293a63,null))[_0xe790('0x25')](function(_0x2e09bb){if(_0x2e09bb){_0x148c07=_0x2e09bb;_0xd6ca9c['model']=_[_0xe790('0x31')](db[_0xe790('0x4e')][_0xe790('0x2e')]);_0xd6ca9c[_0xe790('0x32')]=_['keys'](_0x523c49['query']);_0xd6ca9c[_0xe790('0x33')]=_[_0xe790('0x34')](_0xd6ca9c[_0xe790('0x36')],_0xd6ca9c[_0xe790('0x32')]);_0xe9c500['attributes']=_['intersection'](_0xd6ca9c[_0xe790('0x36')],qs['fields'](_0x523c49[_0xe790('0x32')][_0xe790('0x37')]));_0xe9c500[_0xe790('0x35')]=_0xe9c500[_0xe790('0x35')][_0xe790('0x48')]?_0xe9c500[_0xe790('0x35')]:_0xd6ca9c[_0xe790('0x36')];_0xe9c500[_0xe790('0x3a')]=qs[_0xe790('0x3b')](_0x523c49[_0xe790('0x32')][_0xe790('0x3b')]);_0xe9c500[_0xe790('0x3c')]=qs[_0xe790('0x33')](_['pick'](_0x523c49[_0xe790('0x32')],_0xd6ca9c[_0xe790('0x33')]));if(_0x523c49[_0xe790('0x32')][_0xe790('0x3d')]){_0xe9c500[_0xe790('0x3c')]=_[_0xe790('0x3f')](_0xe9c500['where'],{'$or':_[_0xe790('0x2c')](_0xe9c500[_0xe790('0x35')],function(_0x3f9c49){var _0x1097fb={};_0x1097fb[_0x3f9c49]={'$like':'%'+_0x523c49[_0xe790('0x32')][_0xe790('0x3d')]+'%'};return _0x1097fb;})});}_0xe9c500=_['merge']({},_0xe9c500,_0x523c49[_0xe790('0x40')]);return _0x148c07[_0xe790('0x4c')](_0xe9c500);}})[_0xe790('0x25')](function(_0x346015){if(_0x346015){_0x296538=_0x346015[_0xe790('0x48')];if(!_0x523c49[_0xe790('0x32')][_0xe790('0x38')](_0xe790('0x39'))){_0xe9c500[_0xe790('0x1c')]=qs[_0xe790('0x1c')](_0x523c49[_0xe790('0x32')][_0xe790('0x1c')]);_0xe9c500[_0xe790('0x1e')]=qs[_0xe790('0x1e')](_0x523c49['query']['offset']);}return _0x148c07['getFields'](_0xe9c500);}})[_0xe790('0x25')](function(_0x2b7236){if(_0x2b7236){return _0x2b7236?{'count':_0x296538,'rows':_0x2b7236}:null;}})[_0xe790('0x25')](respondWithResult(_0x293a63,null))[_0xe790('0x45')](handleError(_0x293a63,null));};exports['getSubjects']=function(_0x3ad865,_0x28f9f6,_0x109191){var _0xb202f8={};var _0x5118a7={};var _0xa12664;var _0x276df0;return db[_0xe790('0x2d')][_0xe790('0x4d')]({'where':{'id':_0x3ad865['params']['id']}})[_0xe790('0x25')](handleEntityNotFound(_0x28f9f6,null))[_0xe790('0x25')](function(_0x2c952e){if(_0x2c952e){_0xa12664=_0x2c952e;_0x5118a7[_0xe790('0x36')]=_[_0xe790('0x31')](db[_0xe790('0x4e')][_0xe790('0x2e')]);_0x5118a7[_0xe790('0x32')]=_[_0xe790('0x31')](_0x3ad865[_0xe790('0x32')]);_0x5118a7[_0xe790('0x33')]=_['intersection'](_0x5118a7[_0xe790('0x36')],_0x5118a7[_0xe790('0x32')]);_0xb202f8[_0xe790('0x35')]=_['intersection'](_0x5118a7[_0xe790('0x36')],qs['fields'](_0x3ad865[_0xe790('0x32')][_0xe790('0x37')]));_0xb202f8[_0xe790('0x35')]=_0xb202f8[_0xe790('0x35')]['length']?_0xb202f8[_0xe790('0x35')]:_0x5118a7[_0xe790('0x36')];_0xb202f8[_0xe790('0x3a')]=qs[_0xe790('0x3b')](_0x3ad865[_0xe790('0x32')][_0xe790('0x3b')]);_0xb202f8[_0xe790('0x3c')]=qs[_0xe790('0x33')](_[_0xe790('0x4f')](_0x3ad865[_0xe790('0x32')],_0x5118a7[_0xe790('0x33')]));if(_0x3ad865['query'][_0xe790('0x3d')]){_0xb202f8['where']=_[_0xe790('0x3f')](_0xb202f8['where'],{'$or':_[_0xe790('0x2c')](_0xb202f8['attributes'],function(_0x5691aa){var _0x2904a9={};_0x2904a9[_0x5691aa]={'$like':'%'+_0x3ad865[_0xe790('0x32')]['filter']+'%'};return _0x2904a9;})});}_0xb202f8=_['merge']({},_0xb202f8,_0x3ad865['options']);return _0xa12664[_0xe790('0x50')](_0xb202f8);}})['then'](function(_0x54f71a){if(_0x54f71a){_0x276df0=_0x54f71a[_0xe790('0x48')];if(!_0x3ad865[_0xe790('0x32')][_0xe790('0x38')](_0xe790('0x39'))){_0xb202f8[_0xe790('0x1c')]=qs[_0xe790('0x1c')](_0x3ad865[_0xe790('0x32')]['limit']);_0xb202f8[_0xe790('0x1e')]=qs[_0xe790('0x1e')](_0x3ad865['query'][_0xe790('0x1e')]);}return _0xa12664[_0xe790('0x50')](_0xb202f8);}})[_0xe790('0x25')](function(_0x431c8f){if(_0x431c8f){return _0x431c8f?{'count':_0x276df0,'rows':_0x431c8f}:null;}})[_0xe790('0x25')](respondWithResult(_0x28f9f6,null))[_0xe790('0x45')](handleError(_0x28f9f6,null));};exports[_0xe790('0x51')]=function(_0x506b47,_0x1cd8c0,_0x1d07b0){var _0x5aaf71={};var _0x46094c={};var _0x4dfafd;var _0x43e246;return db[_0xe790('0x2d')][_0xe790('0x4d')]({'where':{'id':_0x506b47['params']['id']}})['then'](handleEntityNotFound(_0x1cd8c0,null))['then'](function(_0x1c8e9e){if(_0x1c8e9e){_0x4dfafd=_0x1c8e9e;_0x46094c[_0xe790('0x36')]=_[_0xe790('0x31')](db['ZendeskField'][_0xe790('0x2e')]);_0x46094c[_0xe790('0x32')]=_['keys'](_0x506b47[_0xe790('0x32')]);_0x46094c[_0xe790('0x33')]=_[_0xe790('0x34')](_0x46094c[_0xe790('0x36')],_0x46094c[_0xe790('0x32')]);_0x5aaf71['attributes']=_[_0xe790('0x34')](_0x46094c[_0xe790('0x36')],qs['fields'](_0x506b47[_0xe790('0x32')]['fields']));_0x5aaf71['attributes']=_0x5aaf71[_0xe790('0x35')]['length']?_0x5aaf71[_0xe790('0x35')]:_0x46094c['model'];_0x5aaf71[_0xe790('0x3a')]=qs[_0xe790('0x3b')](_0x506b47[_0xe790('0x32')][_0xe790('0x3b')]);_0x5aaf71[_0xe790('0x3c')]=qs[_0xe790('0x33')](_['pick'](_0x506b47[_0xe790('0x32')],_0x46094c[_0xe790('0x33')]));if(_0x506b47[_0xe790('0x32')][_0xe790('0x3d')]){_0x5aaf71[_0xe790('0x3c')]=_[_0xe790('0x3f')](_0x5aaf71[_0xe790('0x3c')],{'$or':_[_0xe790('0x2c')](_0x5aaf71[_0xe790('0x35')],function(_0x5306d3){var _0x402896={};_0x402896[_0x5306d3]={'$like':'%'+_0x506b47[_0xe790('0x32')][_0xe790('0x3d')]+'%'};return _0x402896;})});}_0x5aaf71=_['merge']({},_0x5aaf71,_0x506b47[_0xe790('0x40')]);return _0x4dfafd['getDescriptions'](_0x5aaf71);}})['then'](function(_0x3e9374){if(_0x3e9374){_0x43e246=_0x3e9374[_0xe790('0x48')];if(!_0x506b47[_0xe790('0x32')][_0xe790('0x38')](_0xe790('0x39'))){_0x5aaf71[_0xe790('0x1c')]=qs[_0xe790('0x1c')](_0x506b47[_0xe790('0x32')]['limit']);_0x5aaf71[_0xe790('0x1e')]=qs[_0xe790('0x1e')](_0x506b47[_0xe790('0x32')][_0xe790('0x1e')]);}return _0x4dfafd[_0xe790('0x51')](_0x5aaf71);}})[_0xe790('0x25')](function(_0x4e5dfc){if(_0x4e5dfc){return _0x4e5dfc?{'count':_0x43e246,'rows':_0x4e5dfc}:null;}})[_0xe790('0x25')](respondWithResult(_0x1cd8c0,null))[_0xe790('0x45')](handleError(_0x1cd8c0,null));};exports[_0xe790('0x52')]=function(_0x286784,_0x4ac905,_0x564c2d){var _0x280cac={};var _0x5bd43a={};var _0x2fcace;var _0xdde003;return db[_0xe790('0x2d')]['findOne']({'where':{'id':_0x286784[_0xe790('0x47')]['id']}})[_0xe790('0x25')](handleEntityNotFound(_0x4ac905,null))[_0xe790('0x25')](function(_0x3f1dbe){if(_0x3f1dbe){_0x2fcace=_0x3f1dbe;_0x5bd43a['model']=_[_0xe790('0x31')](db[_0xe790('0x53')]['rawAttributes']);_0x5bd43a[_0xe790('0x32')]=_[_0xe790('0x31')](_0x286784[_0xe790('0x32')]);_0x5bd43a['filters']=_['intersection'](_0x5bd43a[_0xe790('0x36')],_0x5bd43a[_0xe790('0x32')]);_0x280cac[_0xe790('0x35')]=_[_0xe790('0x34')](_0x5bd43a[_0xe790('0x36')],qs[_0xe790('0x37')](_0x286784[_0xe790('0x32')][_0xe790('0x37')]));_0x280cac[_0xe790('0x35')]=_0x280cac[_0xe790('0x35')]['length']?_0x280cac[_0xe790('0x35')]:_0x5bd43a[_0xe790('0x36')];_0x280cac[_0xe790('0x3a')]=qs[_0xe790('0x3b')](_0x286784['query'][_0xe790('0x3b')]);_0x280cac['where']=qs['filters'](_[_0xe790('0x4f')](_0x286784[_0xe790('0x32')],_0x5bd43a[_0xe790('0x33')]));if(_0x286784['query'][_0xe790('0x3d')]){_0x280cac[_0xe790('0x3c')]=_[_0xe790('0x3f')](_0x280cac[_0xe790('0x3c')],{'$or':_[_0xe790('0x2c')](_0x280cac[_0xe790('0x35')],function(_0x14866a){var _0x501a38={};_0x501a38[_0x14866a]={'$like':'%'+_0x286784['query']['filter']+'%'};return _0x501a38;})});}_0x280cac=_[_0xe790('0x3f')]({},_0x280cac,_0x286784[_0xe790('0x40')]);return _0x2fcace[_0xe790('0x52')](_0x280cac);}})['then'](function(_0x4dfe32){if(_0x4dfe32){_0xdde003=_0x4dfe32[_0xe790('0x48')];if(!_0x286784[_0xe790('0x32')][_0xe790('0x38')](_0xe790('0x39'))){_0x280cac[_0xe790('0x1c')]=qs[_0xe790('0x1c')](_0x286784[_0xe790('0x32')][_0xe790('0x1c')]);_0x280cac[_0xe790('0x1e')]=qs['offset'](_0x286784[_0xe790('0x32')]['offset']);}return _0x2fcace['getTags'](_0x280cac);}})[_0xe790('0x25')](function(_0x2b469a){if(_0x2b469a){return _0x2b469a?{'count':_0xdde003,'rows':_0x2b469a}:null;}})[_0xe790('0x25')](respondWithResult(_0x4ac905,null))['catch'](handleError(_0x4ac905,null));};exports[_0xe790('0x54')]=function(_0x4fc16e,_0x567c4a,_0x100064){if(_0x4fc16e[_0xe790('0x4a')]['id']){delete _0x4fc16e['body']['id'];}return db[_0xe790('0x2d')]['findOne']({'where':{'id':_0x4fc16e[_0xe790('0x47')]['id']}})[_0xe790('0x25')](handleEntityNotFound(_0x567c4a,null))[_0xe790('0x25')](function(_0x962132){if(_0x962132){return _0x962132['setTags'](_0x4fc16e[_0xe790('0x4a')][_0xe790('0x55')]||[]);}return null;})[_0xe790('0x25')](respondWithResult(_0x567c4a,null))[_0xe790('0x45')](handleError(_0x567c4a,null));}; \ No newline at end of file +var _0x94d4=['includeAll','include','findAll','rows','catch','show','params','ZendeskConfiguration','find','create','body','update','getFields','getSubjects','findOne','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options'];(function(_0x2bd4b7,_0x9a0cb4){var _0x21dd5c=function(_0x73036c){while(--_0x73036c){_0x2bd4b7['push'](_0x2bd4b7['shift']());}};_0x21dd5c(++_0x9a0cb4);}(_0x94d4,0x15d));var _0x494d=function(_0xe58e43,_0x49468c){_0xe58e43=_0xe58e43-0x0;var _0x25ad9b=_0x94d4[_0xe58e43];return _0x25ad9b;};'use strict';var emlformat=require(_0x494d('0x0'));var rimraf=require(_0x494d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x494d('0x2'));var rp=require(_0x494d('0x3'));var moment=require(_0x494d('0x4'));var BPromise=require(_0x494d('0x5'));var Mustache=require(_0x494d('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x494d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x494d('0x8'));var crypto=require(_0x494d('0x9'));var jsforce=require(_0x494d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x494d('0x7'));var querystring=require('querystring');var Papa=require(_0x494d('0xb'));var Redis=require(_0x494d('0xc'));var authService=require(_0x494d('0xd'));var qs=require(_0x494d('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x494d('0xf'));var logger=require(_0x494d('0x10'))(_0x494d('0x11'));var utils=require(_0x494d('0x12'));var config=require(_0x494d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x494d('0x14'))['db'];function respondWithStatusCode(_0x3f0a74,_0x8d4ea9){_0x8d4ea9=_0x8d4ea9||0xcc;return function(_0x314dfa){if(_0x314dfa){return _0x3f0a74[_0x494d('0x15')](_0x8d4ea9);}return _0x3f0a74[_0x494d('0x16')](_0x8d4ea9)[_0x494d('0x17')]();};}function respondWithResult(_0x1e9309,_0x112026){_0x112026=_0x112026||0xc8;return function(_0x359248){if(_0x359248){return _0x1e9309['status'](_0x112026)[_0x494d('0x18')](_0x359248);}};}function respondWithFilteredResult(_0x4511fe,_0x271b36){return function(_0x194fde){if(_0x194fde){var _0x97130a=typeof _0x271b36[_0x494d('0x19')]===_0x494d('0x1a')&&typeof _0x271b36[_0x494d('0x1b')]==='undefined';var _0x386ae6=_0x194fde['count'];var _0x330fc8=_0x97130a?0x0:_0x271b36['offset'];var _0x11bc56=_0x97130a?_0x194fde[_0x494d('0x1c')]:_0x271b36[_0x494d('0x19')]+_0x271b36[_0x494d('0x1b')];var _0x234168;if(_0x11bc56>=_0x386ae6){_0x11bc56=_0x386ae6;_0x234168=0xc8;}else{_0x234168=0xce;}_0x4511fe['status'](_0x234168);return _0x4511fe[_0x494d('0x1d')](_0x494d('0x1e'),_0x330fc8+'-'+_0x11bc56+'/'+_0x386ae6)[_0x494d('0x18')](_0x194fde);}return null;};}function patchUpdates(_0x284ca2){return function(_0x461154){try{jsonpatch['apply'](_0x461154,_0x284ca2,!![]);}catch(_0x4eec90){return BPromise[_0x494d('0x1f')](_0x4eec90);}return _0x461154[_0x494d('0x20')]();};}function saveUpdates(_0xa7c9af,_0x3795e8){return function(_0x23cbbf){if(_0x23cbbf){return _0x23cbbf['update'](_0xa7c9af)[_0x494d('0x21')](function(_0x372bd7){return _0x372bd7;});}return null;};}function removeEntity(_0x42aed1,_0x5a8485){return function(_0x45c276){if(_0x45c276){return _0x45c276[_0x494d('0x22')]()[_0x494d('0x21')](function(){_0x42aed1['status'](0xcc)[_0x494d('0x17')]();});}};}function handleEntityNotFound(_0x56242b,_0x3d68dd){return function(_0x2c6ccf){if(!_0x2c6ccf){_0x56242b[_0x494d('0x15')](0x194);}return _0x2c6ccf;};}function handleError(_0x49c00e,_0x179a28){_0x179a28=_0x179a28||0x1f4;return function(_0x478314){logger['error'](_0x478314[_0x494d('0x23')]);if(_0x478314[_0x494d('0x24')]){delete _0x478314[_0x494d('0x24')];}_0x49c00e[_0x494d('0x16')](_0x179a28)[_0x494d('0x25')](_0x478314);};}exports[_0x494d('0x26')]=function(_0x1c9998,_0x42618c){var _0xf8891e={},_0x1761bb={},_0x5b67cf={'count':0x0,'rows':[]};var _0x15fbb0=_[_0x494d('0x27')](db['ZendeskConfiguration'][_0x494d('0x28')],function(_0x2cc2fb){return{'name':_0x2cc2fb[_0x494d('0x29')],'type':_0x2cc2fb[_0x494d('0x2a')][_0x494d('0x2b')]};});_0x1761bb[_0x494d('0x2c')]=_['map'](_0x15fbb0,_0x494d('0x24'));_0x1761bb['query']=_[_0x494d('0x2d')](_0x1c9998[_0x494d('0x2e')]);_0x1761bb[_0x494d('0x2f')]=_['intersection'](_0x1761bb[_0x494d('0x2c')],_0x1761bb[_0x494d('0x2e')]);_0xf8891e['attributes']=_[_0x494d('0x30')](_0x1761bb[_0x494d('0x2c')],qs[_0x494d('0x31')](_0x1c9998['query'][_0x494d('0x31')]));_0xf8891e[_0x494d('0x32')]=_0xf8891e['attributes'][_0x494d('0x33')]?_0xf8891e['attributes']:_0x1761bb[_0x494d('0x2c')];if(!_0x1c9998[_0x494d('0x2e')][_0x494d('0x34')](_0x494d('0x35'))){_0xf8891e[_0x494d('0x1b')]=qs[_0x494d('0x1b')](_0x1c9998[_0x494d('0x2e')][_0x494d('0x1b')]);_0xf8891e[_0x494d('0x19')]=qs[_0x494d('0x19')](_0x1c9998['query'][_0x494d('0x19')]);}_0xf8891e[_0x494d('0x36')]=qs[_0x494d('0x37')](_0x1c9998['query'][_0x494d('0x37')]);_0xf8891e['where']=qs['filters'](_[_0x494d('0x38')](_0x1c9998[_0x494d('0x2e')],_0x1761bb[_0x494d('0x2f')]),_0x15fbb0);if(_0x1c9998[_0x494d('0x2e')][_0x494d('0x39')]){_0xf8891e[_0x494d('0x3a')]=_[_0x494d('0x3b')](_0xf8891e[_0x494d('0x3a')],{'$or':_['map'](_0x15fbb0,function(_0x2fae2c){if(_0x2fae2c[_0x494d('0x2a')]!=='VIRTUAL'){var _0x3d493a={};_0x3d493a[_0x2fae2c['name']]={'$like':'%'+_0x1c9998[_0x494d('0x2e')]['filter']+'%'};return _0x3d493a;}})});}_0xf8891e=_[_0x494d('0x3b')]({},_0xf8891e,_0x1c9998[_0x494d('0x3c')]);var _0x4dd66b={'where':_0xf8891e[_0x494d('0x3a')]};return db['ZendeskConfiguration']['count'](_0x4dd66b)[_0x494d('0x21')](function(_0x2583b1){_0x5b67cf[_0x494d('0x1c')]=_0x2583b1;if(_0x1c9998[_0x494d('0x2e')][_0x494d('0x3d')]){_0xf8891e[_0x494d('0x3e')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x494d('0x3f')](_0xf8891e);})['then'](function(_0x5ef734){_0x5b67cf[_0x494d('0x40')]=_0x5ef734;return _0x5b67cf;})['then'](respondWithFilteredResult(_0x42618c,_0xf8891e))[_0x494d('0x41')](handleError(_0x42618c,null));};exports[_0x494d('0x42')]=function(_0x4a095b,_0x43b732){var _0x51acd4={'raw':![],'where':{'id':_0x4a095b[_0x494d('0x43')]['id']}},_0x417a1a={};_0x417a1a[_0x494d('0x2c')]=_['keys'](db[_0x494d('0x44')][_0x494d('0x28')]);_0x417a1a['query']=_[_0x494d('0x2d')](_0x4a095b[_0x494d('0x2e')]);_0x417a1a['filters']=_[_0x494d('0x30')](_0x417a1a['model'],_0x417a1a['query']);_0x51acd4[_0x494d('0x32')]=_[_0x494d('0x30')](_0x417a1a[_0x494d('0x2c')],qs[_0x494d('0x31')](_0x4a095b[_0x494d('0x2e')]['fields']));_0x51acd4['attributes']=_0x51acd4[_0x494d('0x32')][_0x494d('0x33')]?_0x51acd4[_0x494d('0x32')]:_0x417a1a[_0x494d('0x2c')];if(_0x4a095b[_0x494d('0x2e')][_0x494d('0x3d')]){_0x51acd4[_0x494d('0x3e')]=[{'all':!![]}];}_0x51acd4=_[_0x494d('0x3b')]({},_0x51acd4,_0x4a095b[_0x494d('0x3c')]);return db[_0x494d('0x44')][_0x494d('0x45')](_0x51acd4)[_0x494d('0x21')](handleEntityNotFound(_0x43b732,null))[_0x494d('0x21')](respondWithResult(_0x43b732,null))[_0x494d('0x41')](handleError(_0x43b732,null));};exports[_0x494d('0x46')]=function(_0x50c847,_0x4062b3){return db[_0x494d('0x44')][_0x494d('0x46')](_0x50c847[_0x494d('0x47')],{})['then'](respondWithResult(_0x4062b3,0xc9))[_0x494d('0x41')](handleError(_0x4062b3,null));};exports[_0x494d('0x48')]=function(_0x56c362,_0x5781fc){if(_0x56c362[_0x494d('0x47')]['id']){delete _0x56c362[_0x494d('0x47')]['id'];}return db[_0x494d('0x44')][_0x494d('0x45')]({'where':{'id':_0x56c362[_0x494d('0x43')]['id']}})['then'](handleEntityNotFound(_0x5781fc,null))[_0x494d('0x21')](saveUpdates(_0x56c362[_0x494d('0x47')],null))[_0x494d('0x21')](respondWithResult(_0x5781fc,null))['catch'](handleError(_0x5781fc,null));};exports[_0x494d('0x22')]=function(_0x359bfc,_0x365e98){return db['ZendeskConfiguration']['find']({'where':{'id':_0x359bfc[_0x494d('0x43')]['id']}})[_0x494d('0x21')](handleEntityNotFound(_0x365e98,null))[_0x494d('0x21')](removeEntity(_0x365e98,null))[_0x494d('0x41')](handleError(_0x365e98,null));};exports[_0x494d('0x49')]=function(_0x40bfbe,_0x48440b,_0x308a6d){var _0x4eed2b={};var _0x35de7e={};var _0xece8be;var _0x4623ac;return db[_0x494d('0x44')]['findOne']({'where':{'id':_0x40bfbe[_0x494d('0x43')]['id']}})[_0x494d('0x21')](handleEntityNotFound(_0x48440b,null))[_0x494d('0x21')](function(_0x40d45c){if(_0x40d45c){_0xece8be=_0x40d45c;_0x35de7e[_0x494d('0x2c')]=_[_0x494d('0x2d')](db['ZendeskField'][_0x494d('0x28')]);_0x35de7e['query']=_[_0x494d('0x2d')](_0x40bfbe[_0x494d('0x2e')]);_0x35de7e[_0x494d('0x2f')]=_['intersection'](_0x35de7e['model'],_0x35de7e['query']);_0x4eed2b[_0x494d('0x32')]=_['intersection'](_0x35de7e[_0x494d('0x2c')],qs[_0x494d('0x31')](_0x40bfbe['query'][_0x494d('0x31')]));_0x4eed2b[_0x494d('0x32')]=_0x4eed2b[_0x494d('0x32')][_0x494d('0x33')]?_0x4eed2b[_0x494d('0x32')]:_0x35de7e[_0x494d('0x2c')];_0x4eed2b[_0x494d('0x36')]=qs[_0x494d('0x37')](_0x40bfbe[_0x494d('0x2e')]['sort']);_0x4eed2b[_0x494d('0x3a')]=qs[_0x494d('0x2f')](_[_0x494d('0x38')](_0x40bfbe[_0x494d('0x2e')],_0x35de7e[_0x494d('0x2f')]));if(_0x40bfbe[_0x494d('0x2e')][_0x494d('0x39')]){_0x4eed2b[_0x494d('0x3a')]=_[_0x494d('0x3b')](_0x4eed2b[_0x494d('0x3a')],{'$or':_[_0x494d('0x27')](_0x4eed2b[_0x494d('0x32')],function(_0x24ab92){var _0x4e7f93={};_0x4e7f93[_0x24ab92]={'$like':'%'+_0x40bfbe[_0x494d('0x2e')]['filter']+'%'};return _0x4e7f93;})});}_0x4eed2b=_[_0x494d('0x3b')]({},_0x4eed2b,_0x40bfbe[_0x494d('0x3c')]);return _0xece8be[_0x494d('0x49')](_0x4eed2b);}})['then'](function(_0xe3ec38){if(_0xe3ec38){_0x4623ac=_0xe3ec38['length'];if(!_0x40bfbe[_0x494d('0x2e')][_0x494d('0x34')]('nolimit')){_0x4eed2b[_0x494d('0x1b')]=qs[_0x494d('0x1b')](_0x40bfbe[_0x494d('0x2e')]['limit']);_0x4eed2b[_0x494d('0x19')]=qs[_0x494d('0x19')](_0x40bfbe[_0x494d('0x2e')]['offset']);}return _0xece8be[_0x494d('0x49')](_0x4eed2b);}})[_0x494d('0x21')](function(_0x370db0){if(_0x370db0){return _0x370db0?{'count':_0x4623ac,'rows':_0x370db0}:null;}})[_0x494d('0x21')](respondWithResult(_0x48440b,null))[_0x494d('0x41')](handleError(_0x48440b,null));};exports[_0x494d('0x4a')]=function(_0x30b709,_0x52041e,_0x133a88){var _0x4e45f7={};var _0x56f0d7={};var _0x759de6;var _0xd400c7;return db[_0x494d('0x44')][_0x494d('0x4b')]({'where':{'id':_0x30b709[_0x494d('0x43')]['id']}})[_0x494d('0x21')](handleEntityNotFound(_0x52041e,null))[_0x494d('0x21')](function(_0x37ed83){if(_0x37ed83){_0x759de6=_0x37ed83;_0x56f0d7[_0x494d('0x2c')]=_['keys'](db['ZendeskField'][_0x494d('0x28')]);_0x56f0d7['query']=_[_0x494d('0x2d')](_0x30b709[_0x494d('0x2e')]);_0x56f0d7[_0x494d('0x2f')]=_['intersection'](_0x56f0d7[_0x494d('0x2c')],_0x56f0d7[_0x494d('0x2e')]);_0x4e45f7[_0x494d('0x32')]=_[_0x494d('0x30')](_0x56f0d7[_0x494d('0x2c')],qs[_0x494d('0x31')](_0x30b709[_0x494d('0x2e')][_0x494d('0x31')]));_0x4e45f7[_0x494d('0x32')]=_0x4e45f7['attributes']['length']?_0x4e45f7[_0x494d('0x32')]:_0x56f0d7[_0x494d('0x2c')];_0x4e45f7[_0x494d('0x36')]=qs[_0x494d('0x37')](_0x30b709['query'][_0x494d('0x37')]);_0x4e45f7[_0x494d('0x3a')]=qs[_0x494d('0x2f')](_[_0x494d('0x38')](_0x30b709[_0x494d('0x2e')],_0x56f0d7[_0x494d('0x2f')]));if(_0x30b709[_0x494d('0x2e')][_0x494d('0x39')]){_0x4e45f7[_0x494d('0x3a')]=_[_0x494d('0x3b')](_0x4e45f7[_0x494d('0x3a')],{'$or':_[_0x494d('0x27')](_0x4e45f7['attributes'],function(_0x301693){var _0x4c09a6={};_0x4c09a6[_0x301693]={'$like':'%'+_0x30b709[_0x494d('0x2e')][_0x494d('0x39')]+'%'};return _0x4c09a6;})});}_0x4e45f7=_[_0x494d('0x3b')]({},_0x4e45f7,_0x30b709[_0x494d('0x3c')]);return _0x759de6[_0x494d('0x4a')](_0x4e45f7);}})[_0x494d('0x21')](function(_0x2b512f){if(_0x2b512f){_0xd400c7=_0x2b512f['length'];if(!_0x30b709[_0x494d('0x2e')]['hasOwnProperty'](_0x494d('0x35'))){_0x4e45f7[_0x494d('0x1b')]=qs[_0x494d('0x1b')](_0x30b709[_0x494d('0x2e')][_0x494d('0x1b')]);_0x4e45f7['offset']=qs[_0x494d('0x19')](_0x30b709[_0x494d('0x2e')][_0x494d('0x19')]);}return _0x759de6[_0x494d('0x4a')](_0x4e45f7);}})[_0x494d('0x21')](function(_0x5b4b23){if(_0x5b4b23){return _0x5b4b23?{'count':_0xd400c7,'rows':_0x5b4b23}:null;}})[_0x494d('0x21')](respondWithResult(_0x52041e,null))[_0x494d('0x41')](handleError(_0x52041e,null));};exports['getDescriptions']=function(_0x3335a6,_0x34266a,_0x595113){var _0x4b27c1={};var _0x46e09c={};var _0x164577;var _0x2a2707;return db[_0x494d('0x44')][_0x494d('0x4b')]({'where':{'id':_0x3335a6[_0x494d('0x43')]['id']}})[_0x494d('0x21')](handleEntityNotFound(_0x34266a,null))[_0x494d('0x21')](function(_0x5b93af){if(_0x5b93af){_0x164577=_0x5b93af;_0x46e09c[_0x494d('0x2c')]=_['keys'](db[_0x494d('0x4c')][_0x494d('0x28')]);_0x46e09c['query']=_[_0x494d('0x2d')](_0x3335a6['query']);_0x46e09c[_0x494d('0x2f')]=_[_0x494d('0x30')](_0x46e09c[_0x494d('0x2c')],_0x46e09c[_0x494d('0x2e')]);_0x4b27c1['attributes']=_[_0x494d('0x30')](_0x46e09c[_0x494d('0x2c')],qs['fields'](_0x3335a6['query']['fields']));_0x4b27c1[_0x494d('0x32')]=_0x4b27c1[_0x494d('0x32')][_0x494d('0x33')]?_0x4b27c1[_0x494d('0x32')]:_0x46e09c[_0x494d('0x2c')];_0x4b27c1['order']=qs[_0x494d('0x37')](_0x3335a6[_0x494d('0x2e')][_0x494d('0x37')]);_0x4b27c1[_0x494d('0x3a')]=qs[_0x494d('0x2f')](_[_0x494d('0x38')](_0x3335a6['query'],_0x46e09c[_0x494d('0x2f')]));if(_0x3335a6['query'][_0x494d('0x39')]){_0x4b27c1[_0x494d('0x3a')]=_[_0x494d('0x3b')](_0x4b27c1['where'],{'$or':_[_0x494d('0x27')](_0x4b27c1['attributes'],function(_0x5b706a){var _0x549d41={};_0x549d41[_0x5b706a]={'$like':'%'+_0x3335a6[_0x494d('0x2e')][_0x494d('0x39')]+'%'};return _0x549d41;})});}_0x4b27c1=_[_0x494d('0x3b')]({},_0x4b27c1,_0x3335a6[_0x494d('0x3c')]);return _0x164577[_0x494d('0x4d')](_0x4b27c1);}})[_0x494d('0x21')](function(_0x3f731c){if(_0x3f731c){_0x2a2707=_0x3f731c[_0x494d('0x33')];if(!_0x3335a6['query'][_0x494d('0x34')](_0x494d('0x35'))){_0x4b27c1[_0x494d('0x1b')]=qs[_0x494d('0x1b')](_0x3335a6[_0x494d('0x2e')][_0x494d('0x1b')]);_0x4b27c1[_0x494d('0x19')]=qs['offset'](_0x3335a6[_0x494d('0x2e')][_0x494d('0x19')]);}return _0x164577[_0x494d('0x4d')](_0x4b27c1);}})['then'](function(_0xb13512){if(_0xb13512){return _0xb13512?{'count':_0x2a2707,'rows':_0xb13512}:null;}})[_0x494d('0x21')](respondWithResult(_0x34266a,null))[_0x494d('0x41')](handleError(_0x34266a,null));};exports[_0x494d('0x4e')]=function(_0x463ebc,_0x51e2df,_0x2f070b){var _0x3ccdee={};var _0x1a8aed={};var _0x1cf8c9;var _0x54f5e0;return db[_0x494d('0x44')][_0x494d('0x4b')]({'where':{'id':_0x463ebc['params']['id']}})[_0x494d('0x21')](handleEntityNotFound(_0x51e2df,null))[_0x494d('0x21')](function(_0x59302d){if(_0x59302d){_0x1cf8c9=_0x59302d;_0x1a8aed[_0x494d('0x2c')]=_[_0x494d('0x2d')](db[_0x494d('0x4f')][_0x494d('0x28')]);_0x1a8aed[_0x494d('0x2e')]=_[_0x494d('0x2d')](_0x463ebc[_0x494d('0x2e')]);_0x1a8aed['filters']=_[_0x494d('0x30')](_0x1a8aed['model'],_0x1a8aed[_0x494d('0x2e')]);_0x3ccdee[_0x494d('0x32')]=_['intersection'](_0x1a8aed[_0x494d('0x2c')],qs[_0x494d('0x31')](_0x463ebc[_0x494d('0x2e')][_0x494d('0x31')]));_0x3ccdee[_0x494d('0x32')]=_0x3ccdee[_0x494d('0x32')][_0x494d('0x33')]?_0x3ccdee[_0x494d('0x32')]:_0x1a8aed[_0x494d('0x2c')];_0x3ccdee['order']=qs[_0x494d('0x37')](_0x463ebc['query'][_0x494d('0x37')]);_0x3ccdee[_0x494d('0x3a')]=qs[_0x494d('0x2f')](_[_0x494d('0x38')](_0x463ebc['query'],_0x1a8aed['filters']));if(_0x463ebc[_0x494d('0x2e')][_0x494d('0x39')]){_0x3ccdee[_0x494d('0x3a')]=_['merge'](_0x3ccdee[_0x494d('0x3a')],{'$or':_['map'](_0x3ccdee[_0x494d('0x32')],function(_0x4b25ff){var _0x50a7a1={};_0x50a7a1[_0x4b25ff]={'$like':'%'+_0x463ebc[_0x494d('0x2e')]['filter']+'%'};return _0x50a7a1;})});}_0x3ccdee=_['merge']({},_0x3ccdee,_0x463ebc[_0x494d('0x3c')]);return _0x1cf8c9['getTags'](_0x3ccdee);}})[_0x494d('0x21')](function(_0x5a44dc){if(_0x5a44dc){_0x54f5e0=_0x5a44dc[_0x494d('0x33')];if(!_0x463ebc['query'][_0x494d('0x34')](_0x494d('0x35'))){_0x3ccdee[_0x494d('0x1b')]=qs[_0x494d('0x1b')](_0x463ebc['query'][_0x494d('0x1b')]);_0x3ccdee[_0x494d('0x19')]=qs[_0x494d('0x19')](_0x463ebc[_0x494d('0x2e')][_0x494d('0x19')]);}return _0x1cf8c9[_0x494d('0x4e')](_0x3ccdee);}})[_0x494d('0x21')](function(_0xf9e719){if(_0xf9e719){return _0xf9e719?{'count':_0x54f5e0,'rows':_0xf9e719}:null;}})[_0x494d('0x21')](respondWithResult(_0x51e2df,null))[_0x494d('0x41')](handleError(_0x51e2df,null));};exports['setTags']=function(_0x6c6d41,_0x1230f2,_0x270bc8){if(_0x6c6d41[_0x494d('0x47')]['id']){delete _0x6c6d41['body']['id'];}return db[_0x494d('0x44')][_0x494d('0x4b')]({'where':{'id':_0x6c6d41[_0x494d('0x43')]['id']}})[_0x494d('0x21')](handleEntityNotFound(_0x1230f2,null))[_0x494d('0x21')](function(_0x234a30){if(_0x234a30){return _0x234a30[_0x494d('0x50')](_0x6c6d41['body'][_0x494d('0x51')]||[]);}return null;})[_0x494d('0x21')](respondWithResult(_0x1230f2,null))[_0x494d('0x41')](handleError(_0x1230f2,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 3951a88..0aa3fda 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 _0x6a95=['bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x4a04ab,_0xc6390d){var _0x19f404=function(_0x33031b){while(--_0x33031b){_0x4a04ab['push'](_0x4a04ab['shift']());}};_0x19f404(++_0xc6390d);}(_0x6a95,0x1db));var _0x56a9=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x6a95[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var logger=require(_0x56a9('0x2'))(_0x56a9('0x3'));var moment=require(_0x56a9('0x4'));var BPromise=require(_0x56a9('0x5'));var rp=require(_0x56a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x56a9('0x7'));var attributes=require(_0x56a9('0x8'));module[_0x56a9('0x9')]=function(_0x2eb132,_0x3c15b6){return _0x2eb132[_0x56a9('0xa')](_0x56a9('0xb'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28f2=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations'];(function(_0x4c764c,_0x5cc40d){var _0x5e219c=function(_0x57678a){while(--_0x57678a){_0x4c764c['push'](_0x4c764c['shift']());}};_0x5e219c(++_0x5cc40d);}(_0x28f2,0x193));var _0x228f=function(_0x68820c,_0x55816d){_0x68820c=_0x68820c-0x0;var _0x4e7d69=_0x28f2[_0x68820c];return _0x4e7d69;};'use strict';var _=require(_0x228f('0x0'));var util=require(_0x228f('0x1'));var logger=require(_0x228f('0x2'))(_0x228f('0x3'));var moment=require(_0x228f('0x4'));var BPromise=require('bluebird');var rp=require(_0x228f('0x5'));var fs=require('fs');var path=require(_0x228f('0x6'));var rimraf=require(_0x228f('0x7'));var config=require(_0x228f('0x8'));var attributes=require(_0x228f('0x9'));module[_0x228f('0xa')]=function(_0x32c5c3,_0x485423){return _0x32c5c3[_0x228f('0xb')]('ZendeskConfiguration',attributes,{'tableName':_0x228f('0xc'),'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 e2df4df..9042298 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 _0xc956=['request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x5f0834,_0x5eb903){var _0x38461a=function(_0x130813){while(--_0x130813){_0x5f0834['push'](_0x5f0834['shift']());}};_0x38461a(++_0x5eb903);}(_0xc956,0x197));var _0x6c95=function(_0x3c991d,_0x44083a){_0x3c991d=_0x3c991d-0x0;var _0x56c6b7=_0xc956[_0x3c991d];return _0x56c6b7;};'use strict';var _=require(_0x6c95('0x0'));var util=require(_0x6c95('0x1'));var moment=require(_0x6c95('0x2'));var BPromise=require(_0x6c95('0x3'));var rs=require(_0x6c95('0x4'));var fs=require('fs');var Redis=require(_0x6c95('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c95('0x6'));var logger=require(_0x6c95('0x7'))('rpc');var config=require(_0x6c95('0x8'));var jayson=require(_0x6c95('0x9'));var client=jayson['client'][_0x6c95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x529900,_0x5cb315,_0x2768e8){return new BPromise(function(_0x364cf3,_0x4afc8b){return client[_0x6c95('0xb')](_0x529900,_0x2768e8)[_0x6c95('0xc')](function(_0x3ee61c){logger[_0x6c95('0xd')](_0x6c95('0xe'),_0x5cb315,_0x6c95('0xf'));logger[_0x6c95('0x10')](_0x6c95('0x11'),_0x5cb315,'request\x20sent',JSON[_0x6c95('0x12')](_0x3ee61c));if(_0x3ee61c[_0x6c95('0x13')]){if(_0x3ee61c[_0x6c95('0x13')][_0x6c95('0x14')]===0x1f4){logger[_0x6c95('0x13')](_0x6c95('0xe'),_0x5cb315,_0x3ee61c['error'][_0x6c95('0x15')]);return _0x4afc8b(_0x3ee61c[_0x6c95('0x13')][_0x6c95('0x15')]);}logger[_0x6c95('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5cb315,_0x3ee61c[_0x6c95('0x13')][_0x6c95('0x15')]);return _0x364cf3(_0x3ee61c[_0x6c95('0x13')][_0x6c95('0x15')]);}else{logger[_0x6c95('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5cb315,_0x6c95('0xf'));_0x364cf3(_0x3ee61c['result'][_0x6c95('0x15')]);}})['catch'](function(_0xda711c){logger[_0x6c95('0x13')](_0x6c95('0xe'),_0x5cb315,_0xda711c);_0x4afc8b(_0xda711c);});});} \ No newline at end of file +var _0xc00d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x52ec6a,_0x40d534){var _0x18fac5=function(_0x3cb1ae){while(--_0x3cb1ae){_0x52ec6a['push'](_0x52ec6a['shift']());}};_0x18fac5(++_0x40d534);}(_0xc00d,0x1c9));var _0xdc00=function(_0x568e2e,_0x3ba013){_0x568e2e=_0x568e2e-0x0;var _0x77e916=_0xc00d[_0x568e2e];return _0x77e916;};'use strict';var _=require(_0xdc00('0x0'));var util=require(_0xdc00('0x1'));var moment=require(_0xdc00('0x2'));var BPromise=require(_0xdc00('0x3'));var rs=require(_0xdc00('0x4'));var fs=require('fs');var Redis=require(_0xdc00('0x5'));var db=require(_0xdc00('0x6'))['db'];var utils=require(_0xdc00('0x7'));var logger=require(_0xdc00('0x8'))(_0xdc00('0x9'));var config=require(_0xdc00('0xa'));var jayson=require(_0xdc00('0xb'));var client=jayson[_0xdc00('0xc')][_0xdc00('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5cb3a3,_0x181891,_0x47f352){return new BPromise(function(_0x385725,_0x156eac){return client['request'](_0x5cb3a3,_0x47f352)[_0xdc00('0xe')](function(_0x1793ac){logger['info'](_0xdc00('0xf'),_0x181891,_0xdc00('0x10'));logger[_0xdc00('0x11')](_0xdc00('0x12'),_0x181891,_0xdc00('0x10'),JSON['stringify'](_0x1793ac));if(_0x1793ac['error']){if(_0x1793ac[_0xdc00('0x13')]['code']===0x1f4){logger[_0xdc00('0x13')](_0xdc00('0xf'),_0x181891,_0x1793ac[_0xdc00('0x13')][_0xdc00('0x14')]);return _0x156eac(_0x1793ac[_0xdc00('0x13')][_0xdc00('0x14')]);}logger[_0xdc00('0x13')](_0xdc00('0xf'),_0x181891,_0x1793ac['error'][_0xdc00('0x14')]);return _0x385725(_0x1793ac[_0xdc00('0x13')][_0xdc00('0x14')]);}else{logger['info'](_0xdc00('0xf'),_0x181891,_0xdc00('0x10'));_0x385725(_0x1793ac['result'][_0xdc00('0x14')]);}})[_0xdc00('0x15')](function(_0x3518d4){logger[_0xdc00('0x13')](_0xdc00('0xf'),_0x181891,_0x3518d4);_0x156eac(_0x3518d4);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 323888d..0c14854 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 _0x74c3=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','update','delete','destroy'];(function(_0x3df681,_0x5f20a3){var _0x1be06e=function(_0x52d1e0){while(--_0x52d1e0){_0x3df681['push'](_0x3df681['shift']());}};_0x1be06e(++_0x5f20a3);}(_0x74c3,0xee));var _0x374c=function(_0x189ad1,_0x4018a6){_0x189ad1=_0x189ad1-0x0;var _0x262530=_0x74c3[_0x189ad1];return _0x262530;};'use strict';var multer=require('multer');var util=require(_0x374c('0x0'));var path=require(_0x374c('0x1'));var timeout=require(_0x374c('0x2'));var express=require('express');var router=express[_0x374c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x374c('0x4'));var interaction=require(_0x374c('0x5'));var config=require(_0x374c('0x6'));var controller=require('./intZendeskField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x374c('0x7')]);router[_0x374c('0x8')](_0x374c('0x9'),auth[_0x374c('0xa')](),controller[_0x374c('0xb')]);router[_0x374c('0xc')]('/',auth[_0x374c('0xa')](),controller[_0x374c('0xd')]);router['put'](_0x374c('0x9'),auth['isAuthenticated'](),controller[_0x374c('0xe')]);router[_0x374c('0xf')](_0x374c('0x9'),auth['isAuthenticated'](),controller[_0x374c('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf9dd=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','show','post'];(function(_0x4fdc26,_0x5765b4){var _0x3df58f=function(_0x284cd0){while(--_0x284cd0){_0x4fdc26['push'](_0x4fdc26['shift']());}};_0x3df58f(++_0x5765b4);}(_0xf9dd,0x7f));var _0xdf9d=function(_0x4c13b8,_0x5f5964){_0x4c13b8=_0x4c13b8-0x0;var _0x5698fc=_0xf9dd[_0x4c13b8];return _0x5698fc;};'use strict';var multer=require(_0xdf9d('0x0'));var util=require(_0xdf9d('0x1'));var path=require(_0xdf9d('0x2'));var timeout=require(_0xdf9d('0x3'));var express=require('express');var router=express[_0xdf9d('0x4')]();var fs_extra=require(_0xdf9d('0x5'));var auth=require(_0xdf9d('0x6'));var interaction=require(_0xdf9d('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router[_0xdf9d('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf9d('0x9')]);router[_0xdf9d('0x8')]('/:id',auth[_0xdf9d('0xa')](),controller[_0xdf9d('0xb')]);router[_0xdf9d('0xc')]('/',auth['isAuthenticated'](),controller[_0xdf9d('0xd')]);router[_0xdf9d('0xe')](_0xdf9d('0xf'),auth[_0xdf9d('0xa')](),controller[_0xdf9d('0x10')]);router[_0xdf9d('0x11')]('/:id',auth[_0xdf9d('0xa')](),controller[_0xdf9d('0x12')]);module[_0xdf9d('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index e1166a1..aacd803 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 _0xf283=['ENUM','string','keyValue','STRING','variable','customVariable','sequelize','exports'];(function(_0x9a6f8a,_0x120b76){var _0x297c03=function(_0x4bda84){while(--_0x4bda84){_0x9a6f8a['push'](_0x9a6f8a['shift']());}};_0x297c03(++_0x120b76);}(_0xf283,0x76));var _0x3f28=function(_0x38f76d,_0x329bf7){_0x38f76d=_0x38f76d-0x0;var _0x3f30da=_0xf283[_0x38f76d];return _0x3f30da;};'use strict';var Sequelize=require(_0x3f28('0x0'));module[_0x3f28('0x1')]={'type':{'type':Sequelize[_0x3f28('0x2')](_0x3f28('0x3'),'variable','customVariable',_0x3f28('0x4'),'picklist'),'defaultValue':_0x3f28('0x3')},'content':{'type':Sequelize[_0x3f28('0x5')]},'key':{'type':Sequelize[_0x3f28('0x5')]},'keyType':{'type':Sequelize[_0x3f28('0x2')](_0x3f28('0x3'),_0x3f28('0x6'),_0x3f28('0x7'))},'keyContent':{'type':Sequelize[_0x3f28('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3f28('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3f28('0x5')]}}; \ No newline at end of file +var _0x04f4=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','picklist','string','customVariable'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x04f4,0xc8));var _0x404f=function(_0x187399,_0x40c56d){_0x187399=_0x187399-0x0;var _0x40fa92=_0x04f4[_0x187399];return _0x40fa92;};'use strict';var Sequelize=require(_0x404f('0x0'));module[_0x404f('0x1')]={'type':{'type':Sequelize[_0x404f('0x2')]('string',_0x404f('0x3'),'customVariable','keyValue',_0x404f('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x404f('0x2')](_0x404f('0x5'),_0x404f('0x3'),_0x404f('0x6'))},'keyContent':{'type':Sequelize[_0x404f('0x7')]},'idField':{'type':Sequelize[_0x404f('0x7')]},'nameField':{'type':Sequelize[_0x404f('0x7')]},'customField':{'type':Sequelize[_0x404f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x404f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index f5fef78..2be4ca6 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 _0x8f2f=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x385467,_0x298239){var _0x5ed67e=function(_0x4b252c){while(--_0x4b252c){_0x385467['push'](_0x385467['shift']());}};_0x5ed67e(++_0x298239);}(_0x8f2f,0x1b6));var _0xf8f2=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x8f2f[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0xf8f2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf8f2('0x1'));var rp=require(_0xf8f2('0x2'));var moment=require(_0xf8f2('0x3'));var BPromise=require(_0xf8f2('0x4'));var Mustache=require(_0xf8f2('0x5'));var util=require('util');var path=require(_0xf8f2('0x6'));var sox=require('sox');var csv=require(_0xf8f2('0x7'));var ejs=require(_0xf8f2('0x8'));var fs=require('fs');var fs_extra=require(_0xf8f2('0x9'));var _=require(_0xf8f2('0xa'));var squel=require('squel');var crypto=require(_0xf8f2('0xb'));var jsforce=require(_0xf8f2('0xc'));var deskjs=require(_0xf8f2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf8f2('0xe'));var Papa=require(_0xf8f2('0xf'));var Redis=require(_0xf8f2('0x10'));var authService=require(_0xf8f2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8f2('0x12'));var logger=require(_0xf8f2('0x13'))(_0xf8f2('0x14'));var utils=require(_0xf8f2('0x15'));var config=require(_0xf8f2('0x16'));var licenseUtil=require(_0xf8f2('0x17'));var db=require(_0xf8f2('0x18'))['db'];function respondWithStatusCode(_0x2c38e6,_0x235f23){_0x235f23=_0x235f23||0xcc;return function(_0x5f3a5d){if(_0x5f3a5d){return _0x2c38e6[_0xf8f2('0x19')](_0x235f23);}return _0x2c38e6[_0xf8f2('0x1a')](_0x235f23)[_0xf8f2('0x1b')]();};}function respondWithResult(_0x1f5fe1,_0x4c4455){_0x4c4455=_0x4c4455||0xc8;return function(_0x473dc9){if(_0x473dc9){return _0x1f5fe1[_0xf8f2('0x1a')](_0x4c4455)[_0xf8f2('0x1c')](_0x473dc9);}};}function respondWithFilteredResult(_0x25618d,_0x335cb4){return function(_0x2c65aa){if(_0x2c65aa){var _0x57974b=typeof _0x335cb4[_0xf8f2('0x1d')]===_0xf8f2('0x1e')&&typeof _0x335cb4[_0xf8f2('0x1f')]===_0xf8f2('0x1e');var _0x42082b=_0x2c65aa[_0xf8f2('0x20')];var _0x1dc7c8=_0x57974b?0x0:_0x335cb4[_0xf8f2('0x1d')];var _0xb9406e=_0x57974b?_0x2c65aa[_0xf8f2('0x20')]:_0x335cb4[_0xf8f2('0x1d')]+_0x335cb4[_0xf8f2('0x1f')];var _0x54649c;if(_0xb9406e>=_0x42082b){_0xb9406e=_0x42082b;_0x54649c=0xc8;}else{_0x54649c=0xce;}_0x25618d[_0xf8f2('0x1a')](_0x54649c);return _0x25618d[_0xf8f2('0x21')]('Content-Range',_0x1dc7c8+'-'+_0xb9406e+'/'+_0x42082b)[_0xf8f2('0x1c')](_0x2c65aa);}return null;};}function patchUpdates(_0x52b228){return function(_0x231f74){try{jsonpatch[_0xf8f2('0x22')](_0x231f74,_0x52b228,!![]);}catch(_0x1bf210){return BPromise[_0xf8f2('0x23')](_0x1bf210);}return _0x231f74[_0xf8f2('0x24')]();};}function saveUpdates(_0x3a2688,_0x4ba90f){return function(_0x15fb75){if(_0x15fb75){return _0x15fb75['update'](_0x3a2688)[_0xf8f2('0x25')](function(_0x234634){return _0x234634;});}return null;};}function removeEntity(_0x4d6c48,_0xda70ae){return function(_0x43d3f4){if(_0x43d3f4){return _0x43d3f4['destroy']()[_0xf8f2('0x25')](function(){_0x4d6c48[_0xf8f2('0x1a')](0xcc)[_0xf8f2('0x1b')]();});}};}function handleEntityNotFound(_0x47816d,_0x1f16b5){return function(_0x13429a){if(!_0x13429a){_0x47816d['sendStatus'](0x194);}return _0x13429a;};}function handleError(_0x102f4f,_0x1f370a){_0x1f370a=_0x1f370a||0x1f4;return function(_0xea99ae){logger[_0xf8f2('0x26')](_0xea99ae[_0xf8f2('0x27')]);if(_0xea99ae[_0xf8f2('0x28')]){delete _0xea99ae['name'];}_0x102f4f[_0xf8f2('0x1a')](_0x1f370a)[_0xf8f2('0x29')](_0xea99ae);};}exports[_0xf8f2('0x2a')]=function(_0x435392,_0x4c4377){var _0x4f124e={},_0x2d4fba={},_0x469f57={'count':0x0,'rows':[]};var _0x303e6d=_[_0xf8f2('0x2b')](db[_0xf8f2('0x2c')][_0xf8f2('0x2d')],function(_0x29a742){return{'name':_0x29a742[_0xf8f2('0x2e')],'type':_0x29a742['type'][_0xf8f2('0x2f')]};});_0x2d4fba[_0xf8f2('0x30')]=_[_0xf8f2('0x2b')](_0x303e6d,_0xf8f2('0x28'));_0x2d4fba[_0xf8f2('0x31')]=_[_0xf8f2('0x32')](_0x435392[_0xf8f2('0x31')]);_0x2d4fba['filters']=_[_0xf8f2('0x33')](_0x2d4fba[_0xf8f2('0x30')],_0x2d4fba[_0xf8f2('0x31')]);_0x4f124e[_0xf8f2('0x34')]=_[_0xf8f2('0x33')](_0x2d4fba[_0xf8f2('0x30')],qs['fields'](_0x435392[_0xf8f2('0x31')][_0xf8f2('0x35')]));_0x4f124e[_0xf8f2('0x34')]=_0x4f124e['attributes'][_0xf8f2('0x36')]?_0x4f124e[_0xf8f2('0x34')]:_0x2d4fba[_0xf8f2('0x30')];if(!_0x435392['query']['hasOwnProperty'](_0xf8f2('0x37'))){_0x4f124e[_0xf8f2('0x1f')]=qs[_0xf8f2('0x1f')](_0x435392[_0xf8f2('0x31')][_0xf8f2('0x1f')]);_0x4f124e[_0xf8f2('0x1d')]=qs[_0xf8f2('0x1d')](_0x435392['query'][_0xf8f2('0x1d')]);}_0x4f124e[_0xf8f2('0x38')]=qs[_0xf8f2('0x39')](_0x435392[_0xf8f2('0x31')][_0xf8f2('0x39')]);_0x4f124e[_0xf8f2('0x3a')]=qs[_0xf8f2('0x3b')](_[_0xf8f2('0x3c')](_0x435392[_0xf8f2('0x31')],_0x2d4fba[_0xf8f2('0x3b')]),_0x303e6d);if(_0x435392[_0xf8f2('0x31')][_0xf8f2('0x3d')]){_0x4f124e[_0xf8f2('0x3a')]=_['merge'](_0x4f124e[_0xf8f2('0x3a')],{'$or':_[_0xf8f2('0x2b')](_0x303e6d,function(_0x5907fe){if(_0x5907fe[_0xf8f2('0x3e')]!==_0xf8f2('0x3f')){var _0x5ca383={};_0x5ca383[_0x5907fe[_0xf8f2('0x28')]]={'$like':'%'+_0x435392[_0xf8f2('0x31')]['filter']+'%'};return _0x5ca383;}})});}_0x4f124e=_['merge']({},_0x4f124e,_0x435392[_0xf8f2('0x40')]);var _0x1c2375={'where':_0x4f124e[_0xf8f2('0x3a')]};return db[_0xf8f2('0x2c')][_0xf8f2('0x20')](_0x1c2375)['then'](function(_0x4444e6){_0x469f57[_0xf8f2('0x20')]=_0x4444e6;if(_0x435392[_0xf8f2('0x31')][_0xf8f2('0x41')]){_0x4f124e[_0xf8f2('0x42')]=[{'all':!![]}];}return db[_0xf8f2('0x2c')][_0xf8f2('0x43')](_0x4f124e);})[_0xf8f2('0x25')](function(_0x1b15b5){_0x469f57[_0xf8f2('0x44')]=_0x1b15b5;return _0x469f57;})[_0xf8f2('0x25')](respondWithFilteredResult(_0x4c4377,_0x4f124e))[_0xf8f2('0x45')](handleError(_0x4c4377,null));};exports['show']=function(_0x1665e2,_0x3590dc){var _0x3c23bd={'raw':!![],'where':{'id':_0x1665e2[_0xf8f2('0x46')]['id']}},_0xddfa5f={};_0xddfa5f[_0xf8f2('0x30')]=_['keys'](db[_0xf8f2('0x2c')][_0xf8f2('0x2d')]);_0xddfa5f[_0xf8f2('0x31')]=_['keys'](_0x1665e2['query']);_0xddfa5f[_0xf8f2('0x3b')]=_[_0xf8f2('0x33')](_0xddfa5f[_0xf8f2('0x30')],_0xddfa5f['query']);_0x3c23bd[_0xf8f2('0x34')]=_[_0xf8f2('0x33')](_0xddfa5f[_0xf8f2('0x30')],qs[_0xf8f2('0x35')](_0x1665e2['query'][_0xf8f2('0x35')]));_0x3c23bd[_0xf8f2('0x34')]=_0x3c23bd[_0xf8f2('0x34')][_0xf8f2('0x36')]?_0x3c23bd[_0xf8f2('0x34')]:_0xddfa5f[_0xf8f2('0x30')];if(_0x1665e2['query'][_0xf8f2('0x41')]){_0x3c23bd[_0xf8f2('0x42')]=[{'all':!![]}];}_0x3c23bd=_['merge']({},_0x3c23bd,_0x1665e2[_0xf8f2('0x40')]);return db[_0xf8f2('0x2c')][_0xf8f2('0x47')](_0x3c23bd)[_0xf8f2('0x25')](handleEntityNotFound(_0x3590dc,null))['then'](respondWithResult(_0x3590dc,null))[_0xf8f2('0x45')](handleError(_0x3590dc,null));};exports[_0xf8f2('0x48')]=function(_0x40607e,_0x5e4b9e){return db[_0xf8f2('0x2c')]['create'](_0x40607e[_0xf8f2('0x49')],{})[_0xf8f2('0x25')](respondWithResult(_0x5e4b9e,0xc9))['catch'](handleError(_0x5e4b9e,null));};exports['update']=function(_0x1baa95,_0x16c12b){if(_0x1baa95[_0xf8f2('0x49')]['id']){delete _0x1baa95['body']['id'];}return db[_0xf8f2('0x2c')]['find']({'where':{'id':_0x1baa95[_0xf8f2('0x46')]['id']}})[_0xf8f2('0x25')](handleEntityNotFound(_0x16c12b,null))['then'](saveUpdates(_0x1baa95[_0xf8f2('0x49')],null))[_0xf8f2('0x25')](respondWithResult(_0x16c12b,null))['catch'](handleError(_0x16c12b,null));};exports[_0xf8f2('0x4a')]=function(_0x10e285,_0x8cc93b){return db['ZendeskField'][_0xf8f2('0x47')]({'where':{'id':_0x10e285[_0xf8f2('0x46')]['id']}})[_0xf8f2('0x25')](handleEntityNotFound(_0x8cc93b,null))['then'](removeEntity(_0x8cc93b,null))[_0xf8f2('0x45')](handleError(_0x8cc93b,null));}; \ No newline at end of file +var _0x624e=['catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','error','stack','name','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','include','findAll','rows','show','params','keys','includeAll','find'];(function(_0x59ce25,_0x534281){var _0x5c6dc2=function(_0x448cc2){while(--_0x448cc2){_0x59ce25['push'](_0x59ce25['shift']());}};_0x5c6dc2(++_0x534281);}(_0x624e,0x171));var _0xe624=function(_0x317b0e,_0x984a20){_0x317b0e=_0x317b0e-0x0;var _0x3cd572=_0x624e[_0x317b0e];return _0x3cd572;};'use strict';var emlformat=require(_0xe624('0x0'));var rimraf=require(_0xe624('0x1'));var zipdir=require(_0xe624('0x2'));var jsonpatch=require(_0xe624('0x3'));var rp=require(_0xe624('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe624('0x5'));var util=require('util');var path=require(_0xe624('0x6'));var sox=require(_0xe624('0x7'));var csv=require(_0xe624('0x8'));var ejs=require(_0xe624('0x9'));var fs=require('fs');var fs_extra=require(_0xe624('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe624('0xb'));var jsforce=require(_0xe624('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe624('0xd'));var Papa=require(_0xe624('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe624('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe624('0x10'));var logger=require(_0xe624('0x11'))(_0xe624('0x12'));var utils=require(_0xe624('0x13'));var config=require(_0xe624('0x14'));var licenseUtil=require(_0xe624('0x15'));var db=require(_0xe624('0x16'))['db'];function respondWithStatusCode(_0x21ffcb,_0x45ac11){_0x45ac11=_0x45ac11||0xcc;return function(_0x42deec){if(_0x42deec){return _0x21ffcb['sendStatus'](_0x45ac11);}return _0x21ffcb[_0xe624('0x17')](_0x45ac11)[_0xe624('0x18')]();};}function respondWithResult(_0x581f66,_0x9be168){_0x9be168=_0x9be168||0xc8;return function(_0x5e2ab7){if(_0x5e2ab7){return _0x581f66[_0xe624('0x17')](_0x9be168)[_0xe624('0x19')](_0x5e2ab7);}};}function respondWithFilteredResult(_0x371736,_0x2dd59f){return function(_0x5c1eed){if(_0x5c1eed){var _0x49f9bb=typeof _0x2dd59f[_0xe624('0x1a')]===_0xe624('0x1b')&&typeof _0x2dd59f[_0xe624('0x1c')]===_0xe624('0x1b');var _0x5b4662=_0x5c1eed[_0xe624('0x1d')];var _0x71db97=_0x49f9bb?0x0:_0x2dd59f[_0xe624('0x1a')];var _0x294b6d=_0x49f9bb?_0x5c1eed[_0xe624('0x1d')]:_0x2dd59f[_0xe624('0x1a')]+_0x2dd59f[_0xe624('0x1c')];var _0xedf295;if(_0x294b6d>=_0x5b4662){_0x294b6d=_0x5b4662;_0xedf295=0xc8;}else{_0xedf295=0xce;}_0x371736[_0xe624('0x17')](_0xedf295);return _0x371736[_0xe624('0x1e')](_0xe624('0x1f'),_0x71db97+'-'+_0x294b6d+'/'+_0x5b4662)[_0xe624('0x19')](_0x5c1eed);}return null;};}function patchUpdates(_0x3d53bd){return function(_0xcc4c77){try{jsonpatch[_0xe624('0x20')](_0xcc4c77,_0x3d53bd,!![]);}catch(_0x3c387c){return BPromise[_0xe624('0x21')](_0x3c387c);}return _0xcc4c77[_0xe624('0x22')]();};}function saveUpdates(_0x51277a,_0x415e2f){return function(_0x333321){if(_0x333321){return _0x333321['update'](_0x51277a)['then'](function(_0x125ee2){return _0x125ee2;});}return null;};}function removeEntity(_0x304e6e,_0x4e10e7){return function(_0x5a699c){if(_0x5a699c){return _0x5a699c[_0xe624('0x23')]()['then'](function(){_0x304e6e['status'](0xcc)[_0xe624('0x18')]();});}};}function handleEntityNotFound(_0x7e7a98,_0x3dba5d){return function(_0x489371){if(!_0x489371){_0x7e7a98['sendStatus'](0x194);}return _0x489371;};}function handleError(_0x2a0c49,_0x457b47){_0x457b47=_0x457b47||0x1f4;return function(_0x5f12f8){logger[_0xe624('0x24')](_0x5f12f8[_0xe624('0x25')]);if(_0x5f12f8[_0xe624('0x26')]){delete _0x5f12f8[_0xe624('0x26')];}_0x2a0c49[_0xe624('0x17')](_0x457b47)['send'](_0x5f12f8);};}exports['index']=function(_0x58f23b,_0x1bb8bc){var _0x2ffdf9={},_0x47fe1a={},_0x2fc1bd={'count':0x0,'rows':[]};var _0x5b0e94=_[_0xe624('0x27')](db[_0xe624('0x28')][_0xe624('0x29')],function(_0x1c76ad){return{'name':_0x1c76ad[_0xe624('0x2a')],'type':_0x1c76ad[_0xe624('0x2b')][_0xe624('0x2c')]};});_0x47fe1a[_0xe624('0x2d')]=_[_0xe624('0x27')](_0x5b0e94,'name');_0x47fe1a[_0xe624('0x2e')]=_['keys'](_0x58f23b['query']);_0x47fe1a[_0xe624('0x2f')]=_[_0xe624('0x30')](_0x47fe1a[_0xe624('0x2d')],_0x47fe1a['query']);_0x2ffdf9[_0xe624('0x31')]=_['intersection'](_0x47fe1a[_0xe624('0x2d')],qs[_0xe624('0x32')](_0x58f23b[_0xe624('0x2e')][_0xe624('0x32')]));_0x2ffdf9[_0xe624('0x31')]=_0x2ffdf9[_0xe624('0x31')]['length']?_0x2ffdf9[_0xe624('0x31')]:_0x47fe1a[_0xe624('0x2d')];if(!_0x58f23b['query'][_0xe624('0x33')](_0xe624('0x34'))){_0x2ffdf9[_0xe624('0x1c')]=qs[_0xe624('0x1c')](_0x58f23b[_0xe624('0x2e')][_0xe624('0x1c')]);_0x2ffdf9[_0xe624('0x1a')]=qs[_0xe624('0x1a')](_0x58f23b[_0xe624('0x2e')][_0xe624('0x1a')]);}_0x2ffdf9['order']=qs['sort'](_0x58f23b[_0xe624('0x2e')][_0xe624('0x35')]);_0x2ffdf9[_0xe624('0x36')]=qs[_0xe624('0x2f')](_[_0xe624('0x37')](_0x58f23b[_0xe624('0x2e')],_0x47fe1a[_0xe624('0x2f')]),_0x5b0e94);if(_0x58f23b[_0xe624('0x2e')][_0xe624('0x38')]){_0x2ffdf9[_0xe624('0x36')]=_[_0xe624('0x39')](_0x2ffdf9[_0xe624('0x36')],{'$or':_[_0xe624('0x27')](_0x5b0e94,function(_0xaa3d59){if(_0xaa3d59[_0xe624('0x2b')]!==_0xe624('0x3a')){var _0x442570={};_0x442570[_0xaa3d59[_0xe624('0x26')]]={'$like':'%'+_0x58f23b[_0xe624('0x2e')][_0xe624('0x38')]+'%'};return _0x442570;}})});}_0x2ffdf9=_[_0xe624('0x39')]({},_0x2ffdf9,_0x58f23b[_0xe624('0x3b')]);var _0x577b77={'where':_0x2ffdf9['where']};return db[_0xe624('0x28')][_0xe624('0x1d')](_0x577b77)[_0xe624('0x3c')](function(_0x75994c){_0x2fc1bd[_0xe624('0x1d')]=_0x75994c;if(_0x58f23b[_0xe624('0x2e')]['includeAll']){_0x2ffdf9[_0xe624('0x3d')]=[{'all':!![]}];}return db[_0xe624('0x28')][_0xe624('0x3e')](_0x2ffdf9);})[_0xe624('0x3c')](function(_0x2f3538){_0x2fc1bd[_0xe624('0x3f')]=_0x2f3538;return _0x2fc1bd;})[_0xe624('0x3c')](respondWithFilteredResult(_0x1bb8bc,_0x2ffdf9))['catch'](handleError(_0x1bb8bc,null));};exports[_0xe624('0x40')]=function(_0x3fbdfb,_0x5bac07){var _0x1e28e7={'raw':!![],'where':{'id':_0x3fbdfb[_0xe624('0x41')]['id']}},_0x63bd66={};_0x63bd66[_0xe624('0x2d')]=_[_0xe624('0x42')](db[_0xe624('0x28')]['rawAttributes']);_0x63bd66['query']=_[_0xe624('0x42')](_0x3fbdfb[_0xe624('0x2e')]);_0x63bd66[_0xe624('0x2f')]=_[_0xe624('0x30')](_0x63bd66[_0xe624('0x2d')],_0x63bd66[_0xe624('0x2e')]);_0x1e28e7[_0xe624('0x31')]=_[_0xe624('0x30')](_0x63bd66['model'],qs[_0xe624('0x32')](_0x3fbdfb[_0xe624('0x2e')]['fields']));_0x1e28e7[_0xe624('0x31')]=_0x1e28e7[_0xe624('0x31')]['length']?_0x1e28e7[_0xe624('0x31')]:_0x63bd66[_0xe624('0x2d')];if(_0x3fbdfb[_0xe624('0x2e')][_0xe624('0x43')]){_0x1e28e7[_0xe624('0x3d')]=[{'all':!![]}];}_0x1e28e7=_[_0xe624('0x39')]({},_0x1e28e7,_0x3fbdfb[_0xe624('0x3b')]);return db[_0xe624('0x28')][_0xe624('0x44')](_0x1e28e7)[_0xe624('0x3c')](handleEntityNotFound(_0x5bac07,null))['then'](respondWithResult(_0x5bac07,null))[_0xe624('0x45')](handleError(_0x5bac07,null));};exports[_0xe624('0x46')]=function(_0x227739,_0x4aa8de){return db[_0xe624('0x28')][_0xe624('0x46')](_0x227739[_0xe624('0x47')],{})['then'](respondWithResult(_0x4aa8de,0xc9))[_0xe624('0x45')](handleError(_0x4aa8de,null));};exports[_0xe624('0x48')]=function(_0x6e88a0,_0x3ae178){if(_0x6e88a0['body']['id']){delete _0x6e88a0[_0xe624('0x47')]['id'];}return db[_0xe624('0x28')]['find']({'where':{'id':_0x6e88a0[_0xe624('0x41')]['id']}})[_0xe624('0x3c')](handleEntityNotFound(_0x3ae178,null))[_0xe624('0x3c')](saveUpdates(_0x6e88a0['body'],null))[_0xe624('0x3c')](respondWithResult(_0x3ae178,null))[_0xe624('0x45')](handleError(_0x3ae178,null));};exports[_0xe624('0x23')]=function(_0x421654,_0x51ab1f){return db['ZendeskField'][_0xe624('0x44')]({'where':{'id':_0x421654[_0xe624('0x41')]['id']}})['then'](handleEntityNotFound(_0x51ab1f,null))['then'](removeEntity(_0x51ab1f,null))['catch'](handleError(_0x51ab1f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index d8ad421..8347c64 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 _0x44b6=['moment','request-promise','path','rimraf','../../config/environment','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x4802db,_0x477795){var _0xc0e9ac=function(_0x2f85d4){while(--_0x2f85d4){_0x4802db['push'](_0x4802db['shift']());}};_0xc0e9ac(++_0x477795);}(_0x44b6,0x14e));var _0x644b=function(_0x3e3d0a,_0x4745dd){_0x3e3d0a=_0x3e3d0a-0x0;var _0x3fc765=_0x44b6[_0x3e3d0a];return _0x3fc765;};'use strict';var _=require(_0x644b('0x0'));var util=require(_0x644b('0x1'));var logger=require(_0x644b('0x2'))(_0x644b('0x3'));var moment=require(_0x644b('0x4'));var BPromise=require('bluebird');var rp=require(_0x644b('0x5'));var fs=require('fs');var path=require(_0x644b('0x6'));var rimraf=require(_0x644b('0x7'));var config=require(_0x644b('0x8'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0xeca114,_0xec27e7){return _0xeca114['define'](_0x644b('0x9'),attributes,{'tableName':_0x644b('0xa'),'paranoid':![],'indexes':[{'name':_0x644b('0xb'),'fields':[_0x644b('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4d76=['FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField'];(function(_0x2f1d1b,_0x3810bb){var _0xd1c196=function(_0x1b39e4){while(--_0x1b39e4){_0x2f1d1b['push'](_0x2f1d1b['shift']());}};_0xd1c196(++_0x3810bb);}(_0x4d76,0x15a));var _0x64d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d76[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x64d7('0x0'));var util=require(_0x64d7('0x1'));var logger=require(_0x64d7('0x2'))('api');var moment=require(_0x64d7('0x3'));var BPromise=require(_0x64d7('0x4'));var rp=require(_0x64d7('0x5'));var fs=require('fs');var path=require(_0x64d7('0x6'));var rimraf=require('rimraf');var config=require(_0x64d7('0x7'));var attributes=require(_0x64d7('0x8'));module[_0x64d7('0x9')]=function(_0x1fb8ac,_0x2d3af4){return _0x1fb8ac[_0x64d7('0xa')](_0x64d7('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x64d7('0xc'),'fields':[_0x64d7('0xd'),_0x64d7('0xe')],'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 3dc864a..cc25c81 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 _0xa4ea=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3a3bd2,_0x2f7d8b){var _0x19cd4b=function(_0x2b2209){while(--_0x2b2209){_0x3a3bd2['push'](_0x3a3bd2['shift']());}};_0x19cd4b(++_0x2f7d8b);}(_0xa4ea,0x124));var _0xaa4e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa4ea[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xaa4e('0x0'));var util=require(_0xaa4e('0x1'));var moment=require(_0xaa4e('0x2'));var BPromise=require(_0xaa4e('0x3'));var rs=require(_0xaa4e('0x4'));var fs=require('fs');var Redis=require(_0xaa4e('0x5'));var db=require(_0xaa4e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa4e('0x7'))('rpc');var config=require(_0xaa4e('0x8'));var jayson=require(_0xaa4e('0x9'));var client=jayson[_0xaa4e('0xa')][_0xaa4e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42e5ff,_0x36ab7e,_0x5db432){return new BPromise(function(_0x559821,_0x5516dd){return client[_0xaa4e('0xc')](_0x42e5ff,_0x5db432)[_0xaa4e('0xd')](function(_0x439556){logger['info'](_0xaa4e('0xe'),_0x36ab7e,_0xaa4e('0xf'));logger[_0xaa4e('0x10')](_0xaa4e('0x11'),_0x36ab7e,_0xaa4e('0xf'),JSON['stringify'](_0x439556));if(_0x439556[_0xaa4e('0x12')]){if(_0x439556[_0xaa4e('0x12')][_0xaa4e('0x13')]===0x1f4){logger[_0xaa4e('0x12')](_0xaa4e('0xe'),_0x36ab7e,_0x439556[_0xaa4e('0x12')][_0xaa4e('0x14')]);return _0x5516dd(_0x439556[_0xaa4e('0x12')]['message']);}logger['error'](_0xaa4e('0xe'),_0x36ab7e,_0x439556[_0xaa4e('0x12')][_0xaa4e('0x14')]);return _0x559821(_0x439556[_0xaa4e('0x12')]['message']);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x36ab7e,_0xaa4e('0xf'));_0x559821(_0x439556[_0xaa4e('0x15')][_0xaa4e('0x14')]);}})[_0xaa4e('0x16')](function(_0x540ecb){logger[_0xaa4e('0x12')](_0xaa4e('0xe'),_0x36ab7e,_0x540ecb);_0x5516dd(_0x540ecb);});});} \ No newline at end of file +var _0x6a1f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a1f,0xae));var _0xf6a1=function(_0xc6c0af,_0x3da21d){_0xc6c0af=_0xc6c0af-0x0;var _0xc057de=_0x6a1f[_0xc6c0af];return _0xc057de;};'use strict';var _=require(_0xf6a1('0x0'));var util=require(_0xf6a1('0x1'));var moment=require('moment');var BPromise=require(_0xf6a1('0x2'));var rs=require(_0xf6a1('0x3'));var fs=require('fs');var Redis=require(_0xf6a1('0x4'));var db=require(_0xf6a1('0x5'))['db'];var utils=require(_0xf6a1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf6a1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf6a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a09ac,_0x57718d,_0x37a60d){return new BPromise(function(_0x2734f3,_0x4895fe){return client[_0xf6a1('0x9')](_0x5a09ac,_0x37a60d)[_0xf6a1('0xa')](function(_0x35b3c5){logger[_0xf6a1('0xb')]('ZendeskField,\x20%s,\x20%s',_0x57718d,_0xf6a1('0xc'));logger[_0xf6a1('0xd')](_0xf6a1('0xe'),_0x57718d,'request\x20sent',JSON[_0xf6a1('0xf')](_0x35b3c5));if(_0x35b3c5[_0xf6a1('0x10')]){if(_0x35b3c5[_0xf6a1('0x10')][_0xf6a1('0x11')]===0x1f4){logger[_0xf6a1('0x10')](_0xf6a1('0x12'),_0x57718d,_0x35b3c5[_0xf6a1('0x10')][_0xf6a1('0x13')]);return _0x4895fe(_0x35b3c5[_0xf6a1('0x10')][_0xf6a1('0x13')]);}logger[_0xf6a1('0x10')]('ZendeskField,\x20%s,\x20%s',_0x57718d,_0x35b3c5[_0xf6a1('0x10')][_0xf6a1('0x13')]);return _0x2734f3(_0x35b3c5[_0xf6a1('0x10')][_0xf6a1('0x13')]);}else{logger[_0xf6a1('0xb')](_0xf6a1('0x12'),_0x57718d,_0xf6a1('0xc'));_0x2734f3(_0x35b3c5[_0xf6a1('0x14')][_0xf6a1('0x13')]);}})[_0xf6a1('0x15')](function(_0x6ff74d){logger[_0xf6a1('0x10')](_0xf6a1('0x12'),_0x57718d,_0x6ff74d);_0x4895fe(_0x6ff74d);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 35d781d..6e70cca 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 _0x8243=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x5e2a77,_0x5a6728){var _0x342831=function(_0x2d614b){while(--_0x2d614b){_0x5e2a77['push'](_0x5e2a77['shift']());}};_0x342831(++_0x5a6728);}(_0x8243,0x103));var _0x3824=function(_0x481c4e,_0x18cd5a){_0x481c4e=_0x481c4e-0x0;var _0x25041c=_0x8243[_0x481c4e];return _0x25041c;};'use strict';var multer=require(_0x3824('0x0'));var util=require(_0x3824('0x1'));var path=require(_0x3824('0x2'));var timeout=require('connect-timeout');var express=require(_0x3824('0x3'));var router=express[_0x3824('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3824('0x5'));var interaction=require(_0x3824('0x6'));var config=require(_0x3824('0x7'));var controller=require(_0x3824('0x8'));router[_0x3824('0x9')]('/',auth[_0x3824('0xa')](),controller[_0x3824('0xb')]);router['get'](_0x3824('0xc'),auth[_0x3824('0xa')](),controller[_0x3824('0xd')]);router[_0x3824('0x9')]('/:id/configurations',auth[_0x3824('0xa')](),controller[_0x3824('0xe')]);router[_0x3824('0x9')]('/:id/fields',auth[_0x3824('0xa')](),controller[_0x3824('0xf')]);router[_0x3824('0x10')]('/',auth[_0x3824('0xa')](),controller[_0x3824('0x11')]);router[_0x3824('0x10')](_0x3824('0x12'),auth[_0x3824('0xa')](),controller[_0x3824('0x13')]);router[_0x3824('0x14')]('/:id',auth[_0x3824('0xa')](),controller['update']);router[_0x3824('0x15')](_0x3824('0xc'),auth[_0x3824('0xa')](),controller[_0x3824('0x16')]);module[_0x3824('0x17')]=router; \ No newline at end of file +var _0xdae6=['fs-extra','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','/:id','destroy','multer','util','connect-timeout','express','Router'];(function(_0x25abff,_0x3cc7c4){var _0x5af6e2=function(_0x2d1294){while(--_0x2d1294){_0x25abff['push'](_0x25abff['shift']());}};_0x5af6e2(++_0x3cc7c4);}(_0xdae6,0x15b));var _0x6dae=function(_0x3827d6,_0x1c11fc){_0x3827d6=_0x3827d6-0x0;var _0x48653e=_0xdae6[_0x3827d6];return _0x48653e;};'use strict';var multer=require(_0x6dae('0x0'));var util=require(_0x6dae('0x1'));var path=require('path');var timeout=require(_0x6dae('0x2'));var express=require(_0x6dae('0x3'));var router=express[_0x6dae('0x4')]();var fs_extra=require(_0x6dae('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6dae('0x6'));var controller=require(_0x6dae('0x7'));router['get']('/',auth[_0x6dae('0x8')](),controller[_0x6dae('0x9')]);router[_0x6dae('0xa')]('/:id',auth[_0x6dae('0x8')](),controller[_0x6dae('0xb')]);router[_0x6dae('0xa')](_0x6dae('0xc'),auth[_0x6dae('0x8')](),controller[_0x6dae('0xd')]);router[_0x6dae('0xa')](_0x6dae('0xe'),auth[_0x6dae('0x8')](),controller[_0x6dae('0xf')]);router[_0x6dae('0x10')]('/',auth['isAuthenticated'](),controller[_0x6dae('0x11')]);router[_0x6dae('0x10')](_0x6dae('0xc'),auth[_0x6dae('0x8')](),controller['addConfiguration']);router[_0x6dae('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x6dae('0x13')]);router['delete'](_0x6dae('0x14'),auth[_0x6dae('0x8')](),controller[_0x6dae('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 373a1ac..62b474b 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 _0xd2ea=['sequelize','exports','STRING'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xd2ea,0x15f));var _0xad2e=function(_0x1465ee,_0xfd164d){_0x1465ee=_0x1465ee-0x0;var _0x2e57d5=_0xd2ea[_0x1465ee];return _0x2e57d5;};'use strict';var Sequelize=require(_0xad2e('0x0'));module[_0xad2e('0x1')]={'name':{'type':Sequelize[_0xad2e('0x2')]},'description':{'type':Sequelize[_0xad2e('0x2')]},'host':{'type':Sequelize[_0xad2e('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xad2e('0x2')]},'clientSecret':{'type':Sequelize[_0xad2e('0x2')]},'serverUrl':{'type':Sequelize[_0xad2e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xad2e('0x2')]},'refreshToken':{'type':Sequelize[_0xad2e('0x2')]}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','STRING'];(function(_0x1cf987,_0x51a548){var _0x87ab90=function(_0x453a52){while(--_0x453a52){_0x1cf987['push'](_0x1cf987['shift']());}};_0x87ab90(++_0x51a548);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 b53cea1..fd791fb 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 _0xb75a=['util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','destroy','findOne','order','pick','getConfigurations','hasOwnProperty','Subjects','channel','getDescriptions','ZohoConfiguration','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','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','serverUrl','code','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','data_type','pick_list_values','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x3de8a2,_0x1c8615){var _0x267573=function(_0x51af8f){while(--_0x51af8f){_0x3de8a2['push'](_0x3de8a2['shift']());}};_0x267573(++_0x1c8615);}(_0xb75a,0xfb));var _0xab75=function(_0x3d3e50,_0x67882c){_0x3d3e50=_0x3d3e50-0x0;var _0x4273cb=_0xb75a[_0x3d3e50];return _0x4273cb;};'use strict';var emlformat=require(_0xab75('0x0'));var rimraf=require(_0xab75('0x1'));var zipdir=require(_0xab75('0x2'));var jsonpatch=require(_0xab75('0x3'));var rp=require(_0xab75('0x4'));var moment=require(_0xab75('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xab75('0x6'));var util=require(_0xab75('0x7'));var path=require(_0xab75('0x8'));var sox=require(_0xab75('0x9'));var csv=require('to-csv');var ejs=require(_0xab75('0xa'));var fs=require('fs');var fs_extra=require(_0xab75('0xb'));var _=require(_0xab75('0xc'));var squel=require(_0xab75('0xd'));var crypto=require(_0xab75('0xe'));var jsforce=require(_0xab75('0xf'));var deskjs=require(_0xab75('0x10'));var toCsv=require('to-csv');var querystring=require(_0xab75('0x11'));var Papa=require('papaparse');var Redis=require(_0xab75('0x12'));var authService=require(_0xab75('0x13'));var qs=require(_0xab75('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab75('0x15'));var logger=require('../../config/logger')(_0xab75('0x16'));var utils=require(_0xab75('0x17'));var config=require(_0xab75('0x18'));var licenseUtil=require(_0xab75('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x92062a,_0x4e474c){_0x4e474c=_0x4e474c||0xcc;return function(_0x4513d4){if(_0x4513d4){return _0x92062a[_0xab75('0x1a')](_0x4e474c);}return _0x92062a[_0xab75('0x1b')](_0x4e474c)[_0xab75('0x1c')]();};}function respondWithResult(_0x2fa0a2,_0x601da7){_0x601da7=_0x601da7||0xc8;return function(_0x44226a){if(_0x44226a){return _0x2fa0a2[_0xab75('0x1b')](_0x601da7)[_0xab75('0x1d')](_0x44226a);}};}function respondWithFilteredResult(_0x12f982,_0x42574a){return function(_0x53c8f6){if(_0x53c8f6){var _0x147611=typeof _0x42574a[_0xab75('0x1e')]===_0xab75('0x1f')&&typeof _0x42574a[_0xab75('0x20')]===_0xab75('0x1f');var _0x2c754f=_0x53c8f6[_0xab75('0x21')];var _0x43c20b=_0x147611?0x0:_0x42574a[_0xab75('0x1e')];var _0x90ba21=_0x147611?_0x53c8f6['count']:_0x42574a[_0xab75('0x1e')]+_0x42574a['limit'];var _0x3c3fa3;if(_0x90ba21>=_0x2c754f){_0x90ba21=_0x2c754f;_0x3c3fa3=0xc8;}else{_0x3c3fa3=0xce;}_0x12f982[_0xab75('0x1b')](_0x3c3fa3);return _0x12f982['set'](_0xab75('0x22'),_0x43c20b+'-'+_0x90ba21+'/'+_0x2c754f)['json'](_0x53c8f6);}return null;};}function patchUpdates(_0x5698b9){return function(_0x5d838c){try{jsonpatch['apply'](_0x5d838c,_0x5698b9,!![]);}catch(_0xd9e65f){return BPromise[_0xab75('0x23')](_0xd9e65f);}return _0x5d838c['save']();};}function saveUpdates(_0x55d337,_0x49c62c){return function(_0x1cf298){if(_0x1cf298){return _0x1cf298[_0xab75('0x24')](_0x55d337)['then'](function(_0x38ddf3){return _0x38ddf3;});}return null;};}function removeEntity(_0xf13de7,_0x5d8058){return function(_0x3f4373){if(_0x3f4373){return _0x3f4373['destroy']()[_0xab75('0x25')](function(){_0xf13de7[_0xab75('0x1b')](0xcc)[_0xab75('0x1c')]();});}};}function handleEntityNotFound(_0x51e358,_0x1c9a67){return function(_0x2ab629){if(!_0x2ab629){_0x51e358[_0xab75('0x1a')](0x194);}return _0x2ab629;};}function handleError(_0x2e13a6,_0x2e9011){_0x2e9011=_0x2e9011||0x1f4;return function(_0x3a4d44){logger['error'](_0x3a4d44[_0xab75('0x26')]);if(_0x3a4d44['name']){delete _0x3a4d44[_0xab75('0x27')];}_0x2e13a6[_0xab75('0x1b')](_0x2e9011)[_0xab75('0x28')](_0x3a4d44);};}exports[_0xab75('0x29')]=function(_0x4d0214,_0x4885cc){var _0x19dad9={},_0x5a71f2={},_0x310a0f={'count':0x0,'rows':[]};var _0x40e3cd=_[_0xab75('0x2a')](db[_0xab75('0x2b')][_0xab75('0x2c')],function(_0x1d3f97){return{'name':_0x1d3f97[_0xab75('0x2d')],'type':_0x1d3f97[_0xab75('0x2e')]['key']};});_0x5a71f2['model']=_['map'](_0x40e3cd,'name');_0x5a71f2['query']=_[_0xab75('0x2f')](_0x4d0214[_0xab75('0x30')]);_0x5a71f2['filters']=_[_0xab75('0x31')](_0x5a71f2[_0xab75('0x32')],_0x5a71f2[_0xab75('0x30')]);_0x19dad9[_0xab75('0x33')]=_[_0xab75('0x31')](_0x5a71f2[_0xab75('0x32')],qs[_0xab75('0x34')](_0x4d0214[_0xab75('0x30')][_0xab75('0x34')]));_0x19dad9[_0xab75('0x33')]=_0x19dad9[_0xab75('0x33')][_0xab75('0x35')]?_0x19dad9[_0xab75('0x33')]:_0x5a71f2[_0xab75('0x32')];if(!_0x4d0214['query']['hasOwnProperty'](_0xab75('0x36'))){_0x19dad9[_0xab75('0x20')]=qs[_0xab75('0x20')](_0x4d0214[_0xab75('0x30')][_0xab75('0x20')]);_0x19dad9[_0xab75('0x1e')]=qs[_0xab75('0x1e')](_0x4d0214['query'][_0xab75('0x1e')]);}_0x19dad9['order']=qs[_0xab75('0x37')](_0x4d0214[_0xab75('0x30')]['sort']);_0x19dad9[_0xab75('0x38')]=qs[_0xab75('0x39')](_['pick'](_0x4d0214[_0xab75('0x30')],_0x5a71f2[_0xab75('0x39')]),_0x40e3cd);if(_0x4d0214['query'][_0xab75('0x3a')]){_0x19dad9[_0xab75('0x38')]=_[_0xab75('0x3b')](_0x19dad9['where'],{'$or':_['map'](_0x40e3cd,function(_0x237a6b){if(_0x237a6b[_0xab75('0x2e')]!==_0xab75('0x3c')){var _0x66ac04={};_0x66ac04[_0x237a6b['name']]={'$like':'%'+_0x4d0214[_0xab75('0x30')][_0xab75('0x3a')]+'%'};return _0x66ac04;}})});}_0x19dad9=_[_0xab75('0x3b')]({},_0x19dad9,_0x4d0214[_0xab75('0x3d')]);var _0x5ab2a4={'where':_0x19dad9[_0xab75('0x38')]};return db[_0xab75('0x2b')][_0xab75('0x21')](_0x5ab2a4)['then'](function(_0x3a769b){_0x310a0f[_0xab75('0x21')]=_0x3a769b;if(_0x4d0214['query'][_0xab75('0x3e')]){_0x19dad9[_0xab75('0x3f')]=[{'all':!![]}];}return db[_0xab75('0x2b')]['findAll'](_0x19dad9);})[_0xab75('0x25')](function(_0x400fcb){_0x310a0f[_0xab75('0x40')]=_0x400fcb;return _0x310a0f;})[_0xab75('0x25')](respondWithFilteredResult(_0x4885cc,_0x19dad9))[_0xab75('0x41')](handleError(_0x4885cc,null));};exports[_0xab75('0x42')]=function(_0x2d8b1d,_0x5a547c){var _0x361602={'raw':![],'where':{'id':_0x2d8b1d['params']['id']}},_0x1110bd={};_0x1110bd[_0xab75('0x32')]=_[_0xab75('0x2f')](db['ZohoAccount'][_0xab75('0x2c')]);_0x1110bd[_0xab75('0x30')]=_['keys'](_0x2d8b1d[_0xab75('0x30')]);_0x1110bd[_0xab75('0x39')]=_[_0xab75('0x31')](_0x1110bd['model'],_0x1110bd[_0xab75('0x30')]);_0x361602[_0xab75('0x33')]=_[_0xab75('0x31')](_0x1110bd['model'],qs['fields'](_0x2d8b1d[_0xab75('0x30')][_0xab75('0x34')]));_0x361602[_0xab75('0x33')]=_0x361602[_0xab75('0x33')][_0xab75('0x35')]?_0x361602[_0xab75('0x33')]:_0x1110bd[_0xab75('0x32')];if(_0x2d8b1d[_0xab75('0x30')][_0xab75('0x3e')]){_0x361602[_0xab75('0x3f')]=[{'all':!![]}];}_0x361602=_[_0xab75('0x3b')]({},_0x361602,_0x2d8b1d[_0xab75('0x3d')]);return db[_0xab75('0x2b')][_0xab75('0x43')](_0x361602)['then'](handleEntityNotFound(_0x5a547c,null))[_0xab75('0x25')](respondWithResult(_0x5a547c,null))['catch'](handleError(_0x5a547c,null));};exports[_0xab75('0x44')]=function(_0x491bac,_0x48db2c){return db[_0xab75('0x2b')]['create'](_0x491bac['body'],{})['then'](respondWithResult(_0x48db2c,0xc9))[_0xab75('0x41')](handleError(_0x48db2c,null));};exports[_0xab75('0x24')]=function(_0xbeb27,_0x5762be){if(_0xbeb27[_0xab75('0x45')]['id']){delete _0xbeb27[_0xab75('0x45')]['id'];}return db[_0xab75('0x2b')][_0xab75('0x43')]({'where':{'id':_0xbeb27[_0xab75('0x46')]['id']}})[_0xab75('0x25')](handleEntityNotFound(_0x5762be,null))['then'](saveUpdates(_0xbeb27['body'],null))[_0xab75('0x25')](respondWithResult(_0x5762be,null))['catch'](handleError(_0x5762be,null));};exports[_0xab75('0x47')]=function(_0x41c0fd,_0x2bddfe){return db[_0xab75('0x2b')][_0xab75('0x43')]({'where':{'id':_0x41c0fd['params']['id']}})[_0xab75('0x25')](handleEntityNotFound(_0x2bddfe,null))[_0xab75('0x25')](removeEntity(_0x2bddfe,null))['catch'](handleError(_0x2bddfe,null));};exports['getConfigurations']=function(_0x32628d,_0x275da7,_0x38842a){var _0x485edc={};var _0x8517db={};var _0x47ab9c;var _0x4e9af0;return db[_0xab75('0x2b')][_0xab75('0x48')]({'where':{'id':_0x32628d['params']['id']}})[_0xab75('0x25')](handleEntityNotFound(_0x275da7,null))[_0xab75('0x25')](function(_0x558f22){if(_0x558f22){_0x47ab9c=_0x558f22;_0x8517db[_0xab75('0x32')]=_[_0xab75('0x2f')](db['ZohoConfiguration'][_0xab75('0x2c')]);_0x8517db['query']=_[_0xab75('0x2f')](_0x32628d['query']);_0x8517db['filters']=_[_0xab75('0x31')](_0x8517db['model'],_0x8517db['query']);_0x485edc[_0xab75('0x33')]=_[_0xab75('0x31')](_0x8517db['model'],qs[_0xab75('0x34')](_0x32628d[_0xab75('0x30')][_0xab75('0x34')]));_0x485edc[_0xab75('0x33')]=_0x485edc[_0xab75('0x33')][_0xab75('0x35')]?_0x485edc[_0xab75('0x33')]:_0x8517db['model'];_0x485edc[_0xab75('0x49')]=qs['sort'](_0x32628d[_0xab75('0x30')][_0xab75('0x37')]);_0x485edc[_0xab75('0x38')]=qs[_0xab75('0x39')](_[_0xab75('0x4a')](_0x32628d[_0xab75('0x30')],_0x8517db[_0xab75('0x39')]));if(_0x32628d[_0xab75('0x30')]['filter']){_0x485edc[_0xab75('0x38')]=_[_0xab75('0x3b')](_0x485edc[_0xab75('0x38')],{'$or':_[_0xab75('0x2a')](_0x485edc[_0xab75('0x33')],function(_0xb27c77){var _0xe81ec1={};_0xe81ec1[_0xb27c77]={'$like':'%'+_0x32628d[_0xab75('0x30')][_0xab75('0x3a')]+'%'};return _0xe81ec1;})});}_0x485edc=_[_0xab75('0x3b')]({},_0x485edc,_0x32628d[_0xab75('0x3d')]);return _0x47ab9c[_0xab75('0x4b')](_0x485edc);}})['then'](function(_0x40b04e){if(_0x40b04e){_0x4e9af0=_0x40b04e[_0xab75('0x35')];if(!_0x32628d[_0xab75('0x30')][_0xab75('0x4c')]('nolimit')){_0x485edc[_0xab75('0x20')]=qs['limit'](_0x32628d[_0xab75('0x30')][_0xab75('0x20')]);_0x485edc[_0xab75('0x1e')]=qs[_0xab75('0x1e')](_0x32628d[_0xab75('0x30')][_0xab75('0x1e')]);}return _0x47ab9c[_0xab75('0x4b')](_0x485edc);}})['then'](function(_0x59d818){if(_0x59d818){return _0x59d818?{'count':_0x4e9af0,'rows':_0x59d818}:null;}})['then'](respondWithResult(_0x275da7,null))['catch'](handleError(_0x275da7,null));};exports['addConfiguration']=function(_0x1bfbbb,_0x4f9a23,_0x2c7dd8){if(_0x1bfbbb[_0xab75('0x45')]['id']){delete _0x1bfbbb[_0xab75('0x45')]['id'];}return db['ZohoAccount'][_0xab75('0x48')]({'where':{'id':_0x1bfbbb[_0xab75('0x46')]['id']}})[_0xab75('0x25')](handleEntityNotFound(_0x4f9a23,null))[_0xab75('0x25')](function(_0x28fc97){if(_0x28fc97){_0x1bfbbb[_0xab75('0x45')]['AccountId']=_0x28fc97['id'];_0x1bfbbb[_0xab75('0x45')][_0xab75('0x4d')]=integrations['getSubjects'](_0x1bfbbb[_0xab75('0x45')][_0xab75('0x4e')],_0x1bfbbb[_0xab75('0x45')][_0xab75('0x2e')]);_0x1bfbbb[_0xab75('0x45')]['Descriptions']=integrations[_0xab75('0x4f')](_0x1bfbbb['body'][_0xab75('0x4e')],_0x1bfbbb[_0xab75('0x45')][_0xab75('0x2e')]);return db[_0xab75('0x50')][_0xab75('0x44')](_0x1bfbbb[_0xab75('0x45')],{'include':[{'model':db[_0xab75('0x51')],'as':'Subjects'},{'model':db[_0xab75('0x51')],'as':_0xab75('0x52')}]});}return null;})[_0xab75('0x25')](respondWithResult(_0x4f9a23,null))[_0xab75('0x41')](handleError(_0x4f9a23,null));};function getAccessToken(_0x2e19c7){return new Promise(function(_0x269dad,_0x439975){var _0x226f56;switch(_0x2e19c7[_0xab75('0x53')]){case'US':_0x226f56=_0xab75('0x54');break;case'AU':_0x226f56=_0xab75('0x55');break;case'EU':_0x226f56=_0xab75('0x56');break;case'IN':_0x226f56=_0xab75('0x57');break;case'CN':_0x226f56=_0xab75('0x58');break;default:_0x226f56=_0xab75('0x56');break;}var _0x2eb519={'method':_0xab75('0x59'),'uri':_0x226f56+_0xab75('0x5a'),'qs':{'refresh_token':_0x2e19c7[_0xab75('0x5b')],'client_id':_0x2e19c7[_0xab75('0x5c')],'client_secret':_0x2e19c7[_0xab75('0x5d')],'grant_type':_0xab75('0x5e')},'json':!![]};return rp(_0x2eb519)[_0xab75('0x25')](function(_0x1e81ea){if(_0x1e81ea[_0xab75('0x5f')]){_0x269dad(_0x1e81ea[_0xab75('0x5f')]);}else{_0x439975('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xab75('0x41')](function(_0x2c8459){_0x439975(_0x2c8459);});});}exports[_0xab75('0x60')]=function(_0xaf6cb5,_0x356fd3,_0x470daf){var _0x2f7644,_0x39fc6c,_0x24eb89,_0x185566,_0x18775b;return db[_0xab75('0x2b')][_0xab75('0x48')]({'where':{'id':_0xaf6cb5['params']['id']},'attributes':['id',_0xab75('0x61'),_0xab75('0x53'),_0xab75('0x5c'),_0xab75('0x5d'),_0xab75('0x62'),_0xab75('0x63'),'refreshToken']})[_0xab75('0x25')](handleEntityNotFound(_0x356fd3,null))[_0xab75('0x25')](function(_0x1c36fc){_0x18775b=_0x1c36fc;_0x2f7644=_0x18775b[_0xab75('0x61')];_0x39fc6c=_0x2f7644===_0xab75('0x64')?'eu':'com';_0x24eb89=_0x18775b[_0xab75('0x62')];var _0x58b8fc=_0x24eb89[_0xab75('0x65')](-0x1);if(_0x58b8fc==='/'||_0x58b8fc==='\x5c'||_0x58b8fc===':'){_0x24eb89=_0x24eb89[_0xab75('0x66')](0x0,_0x24eb89[_0xab75('0x67')](_0x58b8fc));}if(!_0x18775b[_0xab75('0x5b')]){throw new Error(_0xab75('0x68'));}return getAccessToken(_0x18775b);})[_0xab75('0x25')](function(_0x5ad8f0){if(_0x5ad8f0){return rp({'method':_0xab75('0x69'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x39fc6c),'qs':{'module':_0xab75('0x6a')},'headers':{'Authorization':_0xab75('0x6b')+_0x5ad8f0},'json':!![]});}})['then'](function(_0x54f169){if(_0x54f169){if(_0x54f169['response']&&_0x54f169[_0xab75('0x6c')]['error']){throw new Error(_0x54f169[_0xab75('0x6c')]['error'][_0xab75('0x6d')]);}var _0x99bbd1=[];var _0xee68b4=[];var _0x2e90ee=[_0xab75('0x6e'),_0xab75('0x6f'),_0xab75('0x70'),_0xab75('0x71'),_0xab75('0x72'),_0xab75('0x73'),_0xab75('0x74'),'Call_Type'];_0xee68b4=_[_0xab75('0x75')](_0x54f169[_0xab75('0x34')],function(_0x4ee462){return _0x2e90ee[_0xab75('0x76')](_0x4ee462[_0xab75('0x77')]);});for(var _0x2b10f5=0x0;_0x2b10f5<_0xee68b4['length'];_0x2b10f5++){if(_0xee68b4[_0x2b10f5][_0xab75('0x78')]===![]){_0x99bbd1[_0xab75('0x79')]({'id':_0xee68b4[_0x2b10f5]['id'],'name':_0xee68b4[_0x2b10f5][_0xab75('0x7a')],'custom':_0xee68b4[_0x2b10f5]['custom_field'],'options':_0xee68b4[_0x2b10f5][_0xab75('0x7b')]==='picklist'&&_0xee68b4[_0x2b10f5][_0xab75('0x7c')][_0xab75('0x35')]>-0x1?_[_0xab75('0x2a')](_0xee68b4[_0x2b10f5][_0xab75('0x7c')],function(_0x5e745d){return{'name':_0x5e745d,'value':_0x5e745d};}):[]});}}return{'count':_0x99bbd1[_0xab75('0x35')],'rows':_0x99bbd1};}else{return{'count':0x0,'rows':[]};}})[_0xab75('0x25')](respondWithResult(_0x356fd3,null))['catch'](function(_0x414f09){var _0x572e92=_0xaf6cb5[_0xab75('0x30')]['test']?0x1f4:_0x414f09[_0xab75('0x7d')]||0x1f4;logger[_0xab75('0x7e')](_0xab75('0x7f'),_0xab75('0x60'),_0x572e92,JSON['stringify'](_0x414f09));delete _0x414f09['name'];if(_0x572e92===0x191){_0x572e92=0x190;}_0x356fd3[_0xab75('0x1b')](_0x572e92)[_0xab75('0x28')](_0xaf6cb5[_0xab75('0x30')]['test']?{'message':_0xab75('0x80'),'statusCode':_0x414f09[_0xab75('0x7d')]}:_0x414f09);});}; \ No newline at end of file +var _0x7f83=['mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','options','ZohoAccount','includeAll','findAll','rows','catch','show','params','length','include','merge','create','body','findOne','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoConfiguration','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','serverUrl','code','host','zoho.eu','com','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','fast-json-patch','request-promise','moment'];(function(_0x5a17d6,_0x514820){var _0x409d71=function(_0x583acd){while(--_0x583acd){_0x5a17d6['push'](_0x5a17d6['shift']());}};_0x409d71(++_0x514820);}(_0x7f83,0x10d));var _0x37f8=function(_0x12d3b7,_0xb5d931){_0x12d3b7=_0x12d3b7-0x0;var _0x28b021=_0x7f83[_0x12d3b7];return _0x28b021;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x37f8('0x0'));var rp=require(_0x37f8('0x1'));var moment=require(_0x37f8('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x37f8('0x3'));var util=require(_0x37f8('0x4'));var path=require('path');var sox=require(_0x37f8('0x5'));var csv=require('to-csv');var ejs=require(_0x37f8('0x6'));var fs=require('fs');var fs_extra=require(_0x37f8('0x7'));var _=require(_0x37f8('0x8'));var squel=require(_0x37f8('0x9'));var crypto=require(_0x37f8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x37f8('0xb'));var toCsv=require(_0x37f8('0xc'));var querystring=require(_0x37f8('0xd'));var Papa=require(_0x37f8('0xe'));var Redis=require('ioredis');var authService=require(_0x37f8('0xf'));var qs=require(_0x37f8('0x10'));var as=require(_0x37f8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x37f8('0x12'))('api');var utils=require(_0x37f8('0x13'));var config=require(_0x37f8('0x14'));var licenseUtil=require(_0x37f8('0x15'));var db=require(_0x37f8('0x16'))['db'];var integrations=require(_0x37f8('0x17'));function respondWithStatusCode(_0x23e70e,_0x3b905c){_0x3b905c=_0x3b905c||0xcc;return function(_0x1ee8a7){if(_0x1ee8a7){return _0x23e70e[_0x37f8('0x18')](_0x3b905c);}return _0x23e70e['status'](_0x3b905c)[_0x37f8('0x19')]();};}function respondWithResult(_0x46faaa,_0x50a556){_0x50a556=_0x50a556||0xc8;return function(_0x2976e4){if(_0x2976e4){return _0x46faaa[_0x37f8('0x1a')](_0x50a556)[_0x37f8('0x1b')](_0x2976e4);}};}function respondWithFilteredResult(_0x312acb,_0x4ac9c7){return function(_0x109fd6){if(_0x109fd6){var _0x23f49c=typeof _0x4ac9c7[_0x37f8('0x1c')]===_0x37f8('0x1d')&&typeof _0x4ac9c7[_0x37f8('0x1e')]===_0x37f8('0x1d');var _0x230754=_0x109fd6[_0x37f8('0x1f')];var _0x379ec5=_0x23f49c?0x0:_0x4ac9c7[_0x37f8('0x1c')];var _0x26966d=_0x23f49c?_0x109fd6[_0x37f8('0x1f')]:_0x4ac9c7[_0x37f8('0x1c')]+_0x4ac9c7['limit'];var _0x3ecb3;if(_0x26966d>=_0x230754){_0x26966d=_0x230754;_0x3ecb3=0xc8;}else{_0x3ecb3=0xce;}_0x312acb[_0x37f8('0x1a')](_0x3ecb3);return _0x312acb[_0x37f8('0x20')](_0x37f8('0x21'),_0x379ec5+'-'+_0x26966d+'/'+_0x230754)[_0x37f8('0x1b')](_0x109fd6);}return null;};}function patchUpdates(_0x5554bd){return function(_0x4490f6){try{jsonpatch[_0x37f8('0x22')](_0x4490f6,_0x5554bd,!![]);}catch(_0x2db23e){return BPromise[_0x37f8('0x23')](_0x2db23e);}return _0x4490f6[_0x37f8('0x24')]();};}function saveUpdates(_0x4e8f99,_0x1a8c5e){return function(_0x4f2dcc){if(_0x4f2dcc){return _0x4f2dcc[_0x37f8('0x25')](_0x4e8f99)[_0x37f8('0x26')](function(_0x2ffc9d){return _0x2ffc9d;});}return null;};}function removeEntity(_0x30f65b,_0x12c1cb){return function(_0xcbee76){if(_0xcbee76){return _0xcbee76[_0x37f8('0x27')]()[_0x37f8('0x26')](function(){_0x30f65b[_0x37f8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dec29,_0x3723e3){return function(_0x17d11f){if(!_0x17d11f){_0x1dec29[_0x37f8('0x18')](0x194);}return _0x17d11f;};}function handleError(_0x3da7ef,_0x4eae69){_0x4eae69=_0x4eae69||0x1f4;return function(_0x344d11){logger[_0x37f8('0x28')](_0x344d11[_0x37f8('0x29')]);if(_0x344d11[_0x37f8('0x2a')]){delete _0x344d11[_0x37f8('0x2a')];}_0x3da7ef[_0x37f8('0x1a')](_0x4eae69)[_0x37f8('0x2b')](_0x344d11);};}exports[_0x37f8('0x2c')]=function(_0x295f3f,_0x12a1cd){var _0x2d47da={},_0x178043={},_0xb7799={'count':0x0,'rows':[]};var _0x4f7f74=_['map'](db['ZohoAccount'][_0x37f8('0x2d')],function(_0x3d5370){return{'name':_0x3d5370[_0x37f8('0x2e')],'type':_0x3d5370[_0x37f8('0x2f')]['key']};});_0x178043[_0x37f8('0x30')]=_[_0x37f8('0x31')](_0x4f7f74,_0x37f8('0x2a'));_0x178043[_0x37f8('0x32')]=_[_0x37f8('0x33')](_0x295f3f[_0x37f8('0x32')]);_0x178043[_0x37f8('0x34')]=_[_0x37f8('0x35')](_0x178043[_0x37f8('0x30')],_0x178043[_0x37f8('0x32')]);_0x2d47da[_0x37f8('0x36')]=_[_0x37f8('0x35')](_0x178043[_0x37f8('0x30')],qs[_0x37f8('0x37')](_0x295f3f['query'][_0x37f8('0x37')]));_0x2d47da[_0x37f8('0x36')]=_0x2d47da['attributes']['length']?_0x2d47da[_0x37f8('0x36')]:_0x178043[_0x37f8('0x30')];if(!_0x295f3f[_0x37f8('0x32')][_0x37f8('0x38')]('nolimit')){_0x2d47da['limit']=qs[_0x37f8('0x1e')](_0x295f3f[_0x37f8('0x32')][_0x37f8('0x1e')]);_0x2d47da[_0x37f8('0x1c')]=qs[_0x37f8('0x1c')](_0x295f3f[_0x37f8('0x32')][_0x37f8('0x1c')]);}_0x2d47da[_0x37f8('0x39')]=qs[_0x37f8('0x3a')](_0x295f3f[_0x37f8('0x32')][_0x37f8('0x3a')]);_0x2d47da[_0x37f8('0x3b')]=qs[_0x37f8('0x34')](_[_0x37f8('0x3c')](_0x295f3f[_0x37f8('0x32')],_0x178043[_0x37f8('0x34')]),_0x4f7f74);if(_0x295f3f[_0x37f8('0x32')][_0x37f8('0x3d')]){_0x2d47da[_0x37f8('0x3b')]=_['merge'](_0x2d47da[_0x37f8('0x3b')],{'$or':_[_0x37f8('0x31')](_0x4f7f74,function(_0x246bbc){if(_0x246bbc['type']!=='VIRTUAL'){var _0x10de4e={};_0x10de4e[_0x246bbc['name']]={'$like':'%'+_0x295f3f['query'][_0x37f8('0x3d')]+'%'};return _0x10de4e;}})});}_0x2d47da=_['merge']({},_0x2d47da,_0x295f3f[_0x37f8('0x3e')]);var _0x418fc3={'where':_0x2d47da['where']};return db[_0x37f8('0x3f')][_0x37f8('0x1f')](_0x418fc3)[_0x37f8('0x26')](function(_0x453de5){_0xb7799[_0x37f8('0x1f')]=_0x453de5;if(_0x295f3f[_0x37f8('0x32')][_0x37f8('0x40')]){_0x2d47da['include']=[{'all':!![]}];}return db[_0x37f8('0x3f')][_0x37f8('0x41')](_0x2d47da);})['then'](function(_0x7b9b51){_0xb7799[_0x37f8('0x42')]=_0x7b9b51;return _0xb7799;})[_0x37f8('0x26')](respondWithFilteredResult(_0x12a1cd,_0x2d47da))[_0x37f8('0x43')](handleError(_0x12a1cd,null));};exports[_0x37f8('0x44')]=function(_0x56f870,_0xb47332){var _0x42892b={'raw':![],'where':{'id':_0x56f870[_0x37f8('0x45')]['id']}},_0x2195cd={};_0x2195cd['model']=_[_0x37f8('0x33')](db[_0x37f8('0x3f')][_0x37f8('0x2d')]);_0x2195cd[_0x37f8('0x32')]=_[_0x37f8('0x33')](_0x56f870['query']);_0x2195cd[_0x37f8('0x34')]=_[_0x37f8('0x35')](_0x2195cd[_0x37f8('0x30')],_0x2195cd[_0x37f8('0x32')]);_0x42892b[_0x37f8('0x36')]=_['intersection'](_0x2195cd[_0x37f8('0x30')],qs[_0x37f8('0x37')](_0x56f870[_0x37f8('0x32')][_0x37f8('0x37')]));_0x42892b[_0x37f8('0x36')]=_0x42892b['attributes'][_0x37f8('0x46')]?_0x42892b['attributes']:_0x2195cd[_0x37f8('0x30')];if(_0x56f870['query'][_0x37f8('0x40')]){_0x42892b[_0x37f8('0x47')]=[{'all':!![]}];}_0x42892b=_[_0x37f8('0x48')]({},_0x42892b,_0x56f870[_0x37f8('0x3e')]);return db[_0x37f8('0x3f')]['find'](_0x42892b)[_0x37f8('0x26')](handleEntityNotFound(_0xb47332,null))['then'](respondWithResult(_0xb47332,null))[_0x37f8('0x43')](handleError(_0xb47332,null));};exports[_0x37f8('0x49')]=function(_0x4752fd,_0x3c49f2){return db[_0x37f8('0x3f')]['create'](_0x4752fd[_0x37f8('0x4a')],{})['then'](respondWithResult(_0x3c49f2,0xc9))[_0x37f8('0x43')](handleError(_0x3c49f2,null));};exports['update']=function(_0x2600af,_0x1cfa5b){if(_0x2600af[_0x37f8('0x4a')]['id']){delete _0x2600af['body']['id'];}return db[_0x37f8('0x3f')]['find']({'where':{'id':_0x2600af[_0x37f8('0x45')]['id']}})[_0x37f8('0x26')](handleEntityNotFound(_0x1cfa5b,null))[_0x37f8('0x26')](saveUpdates(_0x2600af[_0x37f8('0x4a')],null))[_0x37f8('0x26')](respondWithResult(_0x1cfa5b,null))[_0x37f8('0x43')](handleError(_0x1cfa5b,null));};exports[_0x37f8('0x27')]=function(_0xe92353,_0xa9a7d8){return db['ZohoAccount']['find']({'where':{'id':_0xe92353[_0x37f8('0x45')]['id']}})[_0x37f8('0x26')](handleEntityNotFound(_0xa9a7d8,null))[_0x37f8('0x26')](removeEntity(_0xa9a7d8,null))[_0x37f8('0x43')](handleError(_0xa9a7d8,null));};exports['getConfigurations']=function(_0x452e70,_0x2c6804,_0x1b215d){var _0x8e3e4c={};var _0x1e3b6a={};var _0x1c2761;var _0x16ab03;return db[_0x37f8('0x3f')][_0x37f8('0x4b')]({'where':{'id':_0x452e70[_0x37f8('0x45')]['id']}})[_0x37f8('0x26')](handleEntityNotFound(_0x2c6804,null))[_0x37f8('0x26')](function(_0x5a02a1){if(_0x5a02a1){_0x1c2761=_0x5a02a1;_0x1e3b6a[_0x37f8('0x30')]=_[_0x37f8('0x33')](db['ZohoConfiguration']['rawAttributes']);_0x1e3b6a['query']=_['keys'](_0x452e70[_0x37f8('0x32')]);_0x1e3b6a['filters']=_[_0x37f8('0x35')](_0x1e3b6a['model'],_0x1e3b6a[_0x37f8('0x32')]);_0x8e3e4c[_0x37f8('0x36')]=_['intersection'](_0x1e3b6a[_0x37f8('0x30')],qs[_0x37f8('0x37')](_0x452e70[_0x37f8('0x32')][_0x37f8('0x37')]));_0x8e3e4c['attributes']=_0x8e3e4c[_0x37f8('0x36')][_0x37f8('0x46')]?_0x8e3e4c[_0x37f8('0x36')]:_0x1e3b6a[_0x37f8('0x30')];_0x8e3e4c[_0x37f8('0x39')]=qs[_0x37f8('0x3a')](_0x452e70['query'][_0x37f8('0x3a')]);_0x8e3e4c['where']=qs[_0x37f8('0x34')](_['pick'](_0x452e70['query'],_0x1e3b6a[_0x37f8('0x34')]));if(_0x452e70[_0x37f8('0x32')]['filter']){_0x8e3e4c['where']=_[_0x37f8('0x48')](_0x8e3e4c[_0x37f8('0x3b')],{'$or':_[_0x37f8('0x31')](_0x8e3e4c[_0x37f8('0x36')],function(_0xb72fd3){var _0x407b76={};_0x407b76[_0xb72fd3]={'$like':'%'+_0x452e70['query']['filter']+'%'};return _0x407b76;})});}_0x8e3e4c=_[_0x37f8('0x48')]({},_0x8e3e4c,_0x452e70[_0x37f8('0x3e')]);return _0x1c2761[_0x37f8('0x4c')](_0x8e3e4c);}})[_0x37f8('0x26')](function(_0x437d80){if(_0x437d80){_0x16ab03=_0x437d80[_0x37f8('0x46')];if(!_0x452e70['query'][_0x37f8('0x38')](_0x37f8('0x4d'))){_0x8e3e4c[_0x37f8('0x1e')]=qs['limit'](_0x452e70[_0x37f8('0x32')][_0x37f8('0x1e')]);_0x8e3e4c[_0x37f8('0x1c')]=qs[_0x37f8('0x1c')](_0x452e70['query'][_0x37f8('0x1c')]);}return _0x1c2761[_0x37f8('0x4c')](_0x8e3e4c);}})['then'](function(_0x2bb78e){if(_0x2bb78e){return _0x2bb78e?{'count':_0x16ab03,'rows':_0x2bb78e}:null;}})['then'](respondWithResult(_0x2c6804,null))[_0x37f8('0x43')](handleError(_0x2c6804,null));};exports[_0x37f8('0x4e')]=function(_0x5590c5,_0x903a86,_0x3213e0){if(_0x5590c5['body']['id']){delete _0x5590c5['body']['id'];}return db['ZohoAccount'][_0x37f8('0x4b')]({'where':{'id':_0x5590c5[_0x37f8('0x45')]['id']}})[_0x37f8('0x26')](handleEntityNotFound(_0x903a86,null))[_0x37f8('0x26')](function(_0x1ebf3a){if(_0x1ebf3a){_0x5590c5['body'][_0x37f8('0x4f')]=_0x1ebf3a['id'];_0x5590c5['body'][_0x37f8('0x50')]=integrations[_0x37f8('0x51')](_0x5590c5[_0x37f8('0x4a')]['channel'],_0x5590c5[_0x37f8('0x4a')][_0x37f8('0x2f')]);_0x5590c5[_0x37f8('0x4a')][_0x37f8('0x52')]=integrations[_0x37f8('0x53')](_0x5590c5[_0x37f8('0x4a')][_0x37f8('0x54')],_0x5590c5[_0x37f8('0x4a')][_0x37f8('0x2f')]);return db[_0x37f8('0x55')][_0x37f8('0x49')](_0x5590c5[_0x37f8('0x4a')],{'include':[{'model':db[_0x37f8('0x56')],'as':_0x37f8('0x50')},{'model':db[_0x37f8('0x56')],'as':_0x37f8('0x52')}]});}return null;})[_0x37f8('0x26')](respondWithResult(_0x903a86,null))['catch'](handleError(_0x903a86,null));};function getAccessToken(_0x2665b6){return new Promise(function(_0x3b49af,_0x4c6ec1){var _0x383a40;switch(_0x2665b6['zone']){case'US':_0x383a40=_0x37f8('0x57');break;case'AU':_0x383a40=_0x37f8('0x58');break;case'EU':_0x383a40=_0x37f8('0x59');break;case'IN':_0x383a40=_0x37f8('0x5a');break;case'CN':_0x383a40=_0x37f8('0x5b');break;default:_0x383a40='https://accounts.zoho.eu';break;}var _0x7c3fae={'method':_0x37f8('0x5c'),'uri':_0x383a40+_0x37f8('0x5d'),'qs':{'refresh_token':_0x2665b6[_0x37f8('0x5e')],'client_id':_0x2665b6[_0x37f8('0x5f')],'client_secret':_0x2665b6[_0x37f8('0x60')],'grant_type':_0x37f8('0x61')},'json':!![]};return rp(_0x7c3fae)[_0x37f8('0x26')](function(_0x283bbe){if(_0x283bbe['access_token']){_0x3b49af(_0x283bbe[_0x37f8('0x62')]);}else{_0x4c6ec1(_0x37f8('0x63'));}})['catch'](function(_0x4dba5){_0x4c6ec1(_0x4dba5);});});}exports[_0x37f8('0x64')]=function(_0x4fd7dc,_0x4e23d8,_0x48f863){var _0x2c2781,_0x30ab01,_0x4e8f87,_0x3dcba5,_0x442179;return db['ZohoAccount'][_0x37f8('0x4b')]({'where':{'id':_0x4fd7dc[_0x37f8('0x45')]['id']},'attributes':['id','host',_0x37f8('0x65'),'clientId',_0x37f8('0x60'),_0x37f8('0x66'),_0x37f8('0x67'),_0x37f8('0x5e')]})[_0x37f8('0x26')](handleEntityNotFound(_0x4e23d8,null))['then'](function(_0x2f3f18){_0x442179=_0x2f3f18;_0x2c2781=_0x442179[_0x37f8('0x68')];_0x30ab01=_0x2c2781===_0x37f8('0x69')?'eu':_0x37f8('0x6a');_0x4e8f87=_0x442179[_0x37f8('0x66')];var _0x2156d4=_0x4e8f87[_0x37f8('0x6b')](-0x1);if(_0x2156d4==='/'||_0x2156d4==='\x5c'||_0x2156d4===':'){_0x4e8f87=_0x4e8f87[_0x37f8('0x6c')](0x0,_0x4e8f87[_0x37f8('0x6d')](_0x2156d4));}if(!_0x442179[_0x37f8('0x5e')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x442179);})[_0x37f8('0x26')](function(_0x446083){if(_0x446083){return rp({'method':_0x37f8('0x6e'),'uri':util[_0x37f8('0x6f')](_0x37f8('0x70'),_0x30ab01),'qs':{'module':_0x37f8('0x71')},'headers':{'Authorization':_0x37f8('0x72')+_0x446083},'json':!![]});}})['then'](function(_0x43f003){if(_0x43f003){if(_0x43f003[_0x37f8('0x73')]&&_0x43f003[_0x37f8('0x73')][_0x37f8('0x28')]){throw new Error(_0x43f003['response'][_0x37f8('0x28')]['message']);}var _0x32732e=[];var _0x158c78=[];var _0x45dc87=[_0x37f8('0x74'),_0x37f8('0x75'),'Description',_0x37f8('0x76'),_0x37f8('0x77'),_0x37f8('0x78'),_0x37f8('0x79'),_0x37f8('0x7a')];_0x158c78=_[_0x37f8('0x7b')](_0x43f003[_0x37f8('0x37')],function(_0x37cf49){return _0x45dc87[_0x37f8('0x7c')](_0x37cf49[_0x37f8('0x7d')]);});for(var _0xcc4744=0x0;_0xcc4744<_0x158c78[_0x37f8('0x46')];_0xcc4744++){if(_0x158c78[_0xcc4744][_0x37f8('0x7e')]===![]){_0x32732e['push']({'id':_0x158c78[_0xcc4744]['id'],'name':_0x158c78[_0xcc4744][_0x37f8('0x7f')],'custom':_0x158c78[_0xcc4744]['custom_field'],'options':_0x158c78[_0xcc4744][_0x37f8('0x80')]===_0x37f8('0x81')&&_0x158c78[_0xcc4744][_0x37f8('0x82')][_0x37f8('0x46')]>-0x1?_['map'](_0x158c78[_0xcc4744][_0x37f8('0x82')],function(_0x2764e2){return{'name':_0x2764e2,'value':_0x2764e2};}):[]});}}return{'count':_0x32732e[_0x37f8('0x46')],'rows':_0x32732e};}else{return{'count':0x0,'rows':[]};}})[_0x37f8('0x26')](respondWithResult(_0x4e23d8,null))[_0x37f8('0x43')](function(_0x1c396c){var _0x5f3ff3=_0x4fd7dc[_0x37f8('0x32')][_0x37f8('0x83')]?0x1f4:_0x1c396c[_0x37f8('0x84')]||0x1f4;logger['error'](_0x37f8('0x85'),'getFields',_0x5f3ff3,JSON[_0x37f8('0x86')](_0x1c396c));delete _0x1c396c[_0x37f8('0x2a')];if(_0x5f3ff3===0x191){_0x5f3ff3=0x190;}_0x4e23d8[_0x37f8('0x1a')](_0x5f3ff3)[_0x37f8('0x2b')](_0x4fd7dc[_0x37f8('0x32')]['test']?{'message':_0x37f8('0x87'),'statusCode':_0x1c396c[_0x37f8('0x84')]}:_0x1c396c);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index f4c5f46..dc4e072 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 _0x1374=['slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','/oauth/v2/token','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_zoho_accounts','serverUrl','changed','clientId','clientSecret','code','host'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1374,0x181));var _0x4137=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1374[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x4137('0x0'));var logger=require(_0x4137('0x1'))('api');var moment=require(_0x4137('0x2'));var BPromise=require(_0x4137('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4137('0x4'));var config=require(_0x4137('0x5'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x4137('0x6'));module[_0x4137('0x7')]=function(_0x26fa6f,_0x45f948){return _0x26fa6f['define']('ZohoAccount',attributes,{'tableName':_0x4137('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xd3d213,_0x126029,_0x3d13c6){if(_0xd3d213['changed']('zone')||_0xd3d213['changed'](_0x4137('0x9'))||_0xd3d213[_0x4137('0xa')](_0x4137('0xb'))||_0xd3d213['changed'](_0x4137('0xc'))||_0xd3d213['changed'](_0x4137('0xd'))||_0xd3d213[_0x4137('0xa')](_0x4137('0xe'))){var _0x204647,_0x125722;_0x204647=_0xd3d213[_0x4137('0x9')];var _0x181aed=_0x204647[_0x4137('0xf')](-0x1);if(_0x181aed==='/'||_0x181aed==='\x5c'||_0x181aed===':'){_0x204647=_0x204647[_0x4137('0x10')](0x0,_0x204647[_0x4137('0x11')](_0x181aed));}switch(_0xd3d213[_0x4137('0x12')]){case'US':_0x125722=_0x4137('0x13');break;case'AU':_0x125722=_0x4137('0x14');break;case'IN':_0x125722=_0x4137('0x15');break;case'CN':_0x125722=_0x4137('0x16');break;default:_0x125722=_0x4137('0x17');break;}var _0x35fea2={'method':_0x4137('0x18'),'uri':_0x125722+'/oauth/v2/token','form':{'grant_type':_0x4137('0x19'),'client_id':_0xd3d213[_0x4137('0xb')],'client_secret':_0xd3d213[_0x4137('0xc')],'redirect_uri':_0xd3d213[_0x4137('0x9')],'code':_0xd3d213[_0x4137('0xd')]},'headers':{'Content-Type':_0x4137('0x1a')}};return rp(_0x35fea2)[_0x4137('0x1b')](function(_0x49ceb5){var _0x18c354=JSON[_0x4137('0x1c')](_0x49ceb5);if(_0x18c354[_0x4137('0x1d')]){_0xd3d213[_0x4137('0x1e')]=_0x18c354[_0x4137('0x1d')];logger[_0x4137('0x1f')](util[_0x4137('0x20')](_0x4137('0x21'),_0xd3d213[_0x4137('0x22')],_0xd3d213['id']));}else{logger[_0x4137('0x23')](util[_0x4137('0x20')](_0x4137('0x24'),_0xd3d213[_0x4137('0x22')],_0xd3d213['id']),util[_0x4137('0x25')](_0x18c354,{'showHidden':![],'depth':null}));}return _0x3d13c6(null,_0x126029);})[_0x4137('0x26')](function(_0x3cacca){logger[_0x4137('0x23')](util[_0x4137('0x20')](_0x4137('0x24'),_0xd3d213[_0x4137('0x22')],_0xd3d213['id']),util[_0x4137('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x3d13c6(_0x3cacca);});}else{return _0x3d13c6(null,_0x126029);}},'beforeUpdate':function(_0x1fda03,_0x3a9dc5,_0x48f396){if(_0x1fda03[_0x4137('0xa')](_0x4137('0x12'))||_0x1fda03[_0x4137('0xa')](_0x4137('0x9'))||_0x1fda03[_0x4137('0xa')](_0x4137('0xb'))||_0x1fda03[_0x4137('0xa')](_0x4137('0xc'))||_0x1fda03[_0x4137('0xa')](_0x4137('0xd'))||_0x1fda03[_0x4137('0xa')](_0x4137('0xe'))){var _0x48cd95,_0x24989a;_0x48cd95=_0x1fda03[_0x4137('0x9')];var _0xb2f7ca=_0x48cd95['slice'](-0x1);if(_0xb2f7ca==='/'||_0xb2f7ca==='\x5c'||_0xb2f7ca===':'){_0x48cd95=_0x48cd95['substring'](0x0,_0x48cd95[_0x4137('0x11')](_0xb2f7ca));}switch(_0x1fda03[_0x4137('0x12')]){case'US':_0x24989a='https://accounts.zoho.com';break;case'AU':_0x24989a=_0x4137('0x14');break;case'IN':_0x24989a=_0x4137('0x15');break;case'CN':_0x24989a=_0x4137('0x16');break;default:_0x24989a=_0x4137('0x17');break;}var _0x4537d8={'method':_0x4137('0x18'),'uri':_0x24989a+_0x4137('0x27'),'form':{'grant_type':_0x4137('0x19'),'client_id':_0x1fda03[_0x4137('0xb')],'client_secret':_0x1fda03[_0x4137('0xc')],'redirect_uri':_0x1fda03[_0x4137('0x9')],'code':_0x1fda03[_0x4137('0xd')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4537d8)['then'](function(_0x304140){var _0x1f482c=JSON[_0x4137('0x1c')](_0x304140);if(_0x1f482c[_0x4137('0x1d')]){_0x1fda03['refreshToken']=_0x1f482c[_0x4137('0x1d')];logger[_0x4137('0x1f')](util[_0x4137('0x20')](_0x4137('0x21'),_0x1fda03[_0x4137('0x22')],_0x1fda03['id']));}else{logger[_0x4137('0x23')](util[_0x4137('0x20')](_0x4137('0x24'),_0x1fda03[_0x4137('0x22')],_0x1fda03['id']),util[_0x4137('0x25')](_0x1f482c,{'showHidden':![],'depth':null}));}return _0x48f396(null,_0x3a9dc5);})['catch'](function(_0x344228){logger[_0x4137('0x23')](util[_0x4137('0x20')](_0x4137('0x24'),_0x1fda03[_0x4137('0x22')],_0x1fda03['id']),util[_0x4137('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x48f396(_0x344228);});}else{return _0x48f396(null,_0x3a9dc5);}}}});}; \ No newline at end of file +var _0x3854=['code','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','clientId','substring','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientSecret'];(function(_0x106b18,_0x45ddeb){var _0xcb5725=function(_0x1908d4){while(--_0x1908d4){_0x106b18['push'](_0x106b18['shift']());}};_0xcb5725(++_0x45ddeb);}(_0x3854,0x1d2));var _0x4385=function(_0x19a863,_0x1c61ea){_0x19a863=_0x19a863-0x0;var _0x56bfb2=_0x3854[_0x19a863];return _0x56bfb2;};'use strict';var _=require('lodash');var util=require(_0x4385('0x0'));var logger=require(_0x4385('0x1'))('api');var moment=require(_0x4385('0x2'));var BPromise=require(_0x4385('0x3'));var rp=require(_0x4385('0x4'));var fs=require('fs');var path=require(_0x4385('0x5'));var rimraf=require(_0x4385('0x6'));var config=require(_0x4385('0x7'));var attributes=require(_0x4385('0x8'));var integrations=require(_0x4385('0x9'));module[_0x4385('0xa')]=function(_0x269c10,_0x301e39){return _0x269c10[_0x4385('0xb')](_0x4385('0xc'),attributes,{'tableName':_0x4385('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1c793f,_0x236b8f,_0x116336){if(_0x1c793f['changed'](_0x4385('0xe'))||_0x1c793f[_0x4385('0xf')](_0x4385('0x10'))||_0x1c793f[_0x4385('0xf')]('clientId')||_0x1c793f['changed'](_0x4385('0x11'))||_0x1c793f['changed'](_0x4385('0x12'))||_0x1c793f[_0x4385('0xf')](_0x4385('0x13'))){var _0x2e1d3c,_0x528abc;_0x2e1d3c=_0x1c793f[_0x4385('0x10')];var _0x5d4e5c=_0x2e1d3c[_0x4385('0x14')](-0x1);if(_0x5d4e5c==='/'||_0x5d4e5c==='\x5c'||_0x5d4e5c===':'){_0x2e1d3c=_0x2e1d3c['substring'](0x0,_0x2e1d3c[_0x4385('0x15')](_0x5d4e5c));}switch(_0x1c793f[_0x4385('0xe')]){case'US':_0x528abc=_0x4385('0x16');break;case'AU':_0x528abc=_0x4385('0x17');break;case'IN':_0x528abc=_0x4385('0x18');break;case'CN':_0x528abc=_0x4385('0x19');break;default:_0x528abc=_0x4385('0x1a');break;}var _0x3a575c={'method':_0x4385('0x1b'),'uri':_0x528abc+_0x4385('0x1c'),'form':{'grant_type':'authorization_code','client_id':_0x1c793f['clientId'],'client_secret':_0x1c793f[_0x4385('0x11')],'redirect_uri':_0x1c793f['serverUrl'],'code':_0x1c793f[_0x4385('0x12')]},'headers':{'Content-Type':_0x4385('0x1d')}};return rp(_0x3a575c)[_0x4385('0x1e')](function(_0x2d2338){var _0x473438=JSON[_0x4385('0x1f')](_0x2d2338);if(_0x473438[_0x4385('0x20')]){_0x1c793f[_0x4385('0x21')]=_0x473438[_0x4385('0x20')];logger[_0x4385('0x22')](util[_0x4385('0x23')](_0x4385('0x24'),_0x1c793f['name'],_0x1c793f['id']));}else{logger[_0x4385('0x25')](util[_0x4385('0x23')](_0x4385('0x26'),_0x1c793f[_0x4385('0x27')],_0x1c793f['id']),util[_0x4385('0x28')](_0x473438,{'showHidden':![],'depth':null}));}return _0x116336(null,_0x236b8f);})[_0x4385('0x29')](function(_0x177791){logger[_0x4385('0x25')](util[_0x4385('0x23')](_0x4385('0x26'),_0x1c793f['name'],_0x1c793f['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x116336(_0x177791);});}else{return _0x116336(null,_0x236b8f);}},'beforeUpdate':function(_0x4daf98,_0x59dcc9,_0x2791d4){if(_0x4daf98[_0x4385('0xf')](_0x4385('0xe'))||_0x4daf98[_0x4385('0xf')](_0x4385('0x10'))||_0x4daf98[_0x4385('0xf')](_0x4385('0x2a'))||_0x4daf98[_0x4385('0xf')](_0x4385('0x11'))||_0x4daf98[_0x4385('0xf')]('code')||_0x4daf98['changed']('host')){var _0x2c8714,_0x3941cf;_0x2c8714=_0x4daf98[_0x4385('0x10')];var _0x211591=_0x2c8714[_0x4385('0x14')](-0x1);if(_0x211591==='/'||_0x211591==='\x5c'||_0x211591===':'){_0x2c8714=_0x2c8714[_0x4385('0x2b')](0x0,_0x2c8714['lastIndexOf'](_0x211591));}switch(_0x4daf98[_0x4385('0xe')]){case'US':_0x3941cf=_0x4385('0x16');break;case'AU':_0x3941cf=_0x4385('0x17');break;case'IN':_0x3941cf='https://accounts.zoho.in';break;case'CN':_0x3941cf=_0x4385('0x19');break;default:_0x3941cf=_0x4385('0x1a');break;}var _0x4c7f12={'method':_0x4385('0x1b'),'uri':_0x3941cf+_0x4385('0x1c'),'form':{'grant_type':'authorization_code','client_id':_0x4daf98[_0x4385('0x2a')],'client_secret':_0x4daf98['clientSecret'],'redirect_uri':_0x4daf98[_0x4385('0x10')],'code':_0x4daf98['code']},'headers':{'Content-Type':_0x4385('0x1d')}};return rp(_0x4c7f12)[_0x4385('0x1e')](function(_0x2739cd){var _0x429430=JSON['parse'](_0x2739cd);if(_0x429430[_0x4385('0x20')]){_0x4daf98['refreshToken']=_0x429430[_0x4385('0x20')];logger[_0x4385('0x22')](util[_0x4385('0x23')](_0x4385('0x24'),_0x4daf98[_0x4385('0x27')],_0x4daf98['id']));}else{logger[_0x4385('0x25')](util[_0x4385('0x23')](_0x4385('0x26'),_0x4daf98[_0x4385('0x27')],_0x4daf98['id']),util[_0x4385('0x28')](_0x429430,{'showHidden':![],'depth':null}));}return _0x2791d4(null,_0x59dcc9);})['catch'](function(_0x2b9a93){logger[_0x4385('0x25')](util[_0x4385('0x23')](_0x4385('0x26'),_0x4daf98[_0x4385('0x27')],_0x4daf98['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x2791d4(_0x2b9a93);});}else{return _0x2791d4(null,_0x59dcc9);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 0707230..4c459b9 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 _0xf562=['stringify','error','message','ZohoAccount,\x20%s,\x20%s','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','debug'];(function(_0x360423,_0x1e05d0){var _0xe29430=function(_0x5a2b91){while(--_0x5a2b91){_0x360423['push'](_0x360423['shift']());}};_0xe29430(++_0x1e05d0);}(_0xf562,0x100));var _0x2f56=function(_0x5320e6,_0x403a75){_0x5320e6=_0x5320e6-0x0;var _0x43f8c1=_0xf562[_0x5320e6];return _0x43f8c1;};'use strict';var _=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var moment=require(_0x2f56('0x2'));var BPromise=require(_0x2f56('0x3'));var rs=require(_0x2f56('0x4'));var fs=require('fs');var Redis=require(_0x2f56('0x5'));var db=require(_0x2f56('0x6'))['db'];var utils=require(_0x2f56('0x7'));var logger=require(_0x2f56('0x8'))('rpc');var config=require(_0x2f56('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2f56('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fd9d8,_0x3c4002,_0x25f51a){return new BPromise(function(_0x1add20,_0x46799e){return client[_0x2f56('0xb')](_0x1fd9d8,_0x25f51a)[_0x2f56('0xc')](function(_0x2d549e){logger[_0x2f56('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x3c4002,_0x2f56('0xe'));logger[_0x2f56('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3c4002,_0x2f56('0xe'),JSON[_0x2f56('0x10')](_0x2d549e));if(_0x2d549e['error']){if(_0x2d549e[_0x2f56('0x11')]['code']===0x1f4){logger[_0x2f56('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x3c4002,_0x2d549e[_0x2f56('0x11')][_0x2f56('0x12')]);return _0x46799e(_0x2d549e[_0x2f56('0x11')][_0x2f56('0x12')]);}logger[_0x2f56('0x11')](_0x2f56('0x13'),_0x3c4002,_0x2d549e[_0x2f56('0x11')][_0x2f56('0x12')]);return _0x1add20(_0x2d549e['error'][_0x2f56('0x12')]);}else{logger[_0x2f56('0xd')](_0x2f56('0x13'),_0x3c4002,_0x2f56('0xe'));_0x1add20(_0x2d549e[_0x2f56('0x14')]['message']);}})[_0x2f56('0x15')](function(_0x144edd){logger[_0x2f56('0x11')](_0x2f56('0x13'),_0x3c4002,_0x144edd);_0x46799e(_0x144edd);});});}exports[_0x2f56('0x16')]=function(_0x59db1d){var _0x37c404=this;return new Promise(function(_0x33b43f,_0x1cba6a){return db[_0x2f56('0x17')][_0x2f56('0x18')]({'raw':_0x59db1d['options']?_0x59db1d[_0x2f56('0x19')][_0x2f56('0x1a')]===undefined?!![]:![]:!![],'where':_0x59db1d[_0x2f56('0x19')]?_0x59db1d[_0x2f56('0x19')][_0x2f56('0x1b')]||null:null,'attributes':_0x59db1d[_0x2f56('0x19')]?_0x59db1d[_0x2f56('0x19')][_0x2f56('0x1c')]||null:null,'limit':_0x59db1d['options']?_0x59db1d[_0x2f56('0x19')]['limit']||null:null,'include':_0x59db1d['options']?_0x59db1d[_0x2f56('0x19')][_0x2f56('0x1d')]?_[_0x2f56('0x1e')](_0x59db1d[_0x2f56('0x19')][_0x2f56('0x1d')],function(_0x433f0b){return{'model':db[_0x433f0b[_0x2f56('0x1f')]],'as':_0x433f0b['as'],'attributes':_0x433f0b['attributes'],'include':_0x433f0b['include']?_[_0x2f56('0x1e')](_0x433f0b[_0x2f56('0x1d')],function(_0x38b366){return{'model':db[_0x38b366[_0x2f56('0x1f')]],'as':_0x38b366['as'],'attributes':_0x38b366[_0x2f56('0x1c')],'include':_0x38b366['include']?_[_0x2f56('0x1e')](_0x38b366[_0x2f56('0x1d')],function(_0x861e9c){return{'model':db[_0x861e9c[_0x2f56('0x1f')]],'as':_0x861e9c['as'],'attributes':_0x861e9c[_0x2f56('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2f56('0xc')](function(_0xc4c095){logger[_0x2f56('0xd')](_0x2f56('0x16'),_0x59db1d);logger['debug'](_0x2f56('0x16'),_0x59db1d,JSON['stringify'](_0xc4c095));_0x33b43f(_0xc4c095);})['catch'](function(_0x284252){logger[_0x2f56('0x11')](_0x2f56('0x16'),_0x284252['message'],_0x59db1d);_0x1cba6a(_0x37c404['error'](0x1f4,_0x284252['message']));});});};exports[_0x2f56('0x20')]=function(_0x219653){var _0xa785a5=this;return new Promise(function(_0x44afc9,_0x31a537){return db[_0x2f56('0x17')][_0x2f56('0x21')]({'raw':_0x219653['options']?_0x219653[_0x2f56('0x19')][_0x2f56('0x1a')]===undefined?!![]:![]:!![],'where':_0x219653[_0x2f56('0x19')]?_0x219653['options'][_0x2f56('0x1b')]||null:null,'attributes':_0x219653[_0x2f56('0x19')]?_0x219653[_0x2f56('0x19')][_0x2f56('0x1c')]||null:null,'include':_0x219653[_0x2f56('0x19')]?_0x219653[_0x2f56('0x19')][_0x2f56('0x1d')]?_['map'](_0x219653[_0x2f56('0x19')][_0x2f56('0x1d')],function(_0x4e68bf){return{'model':db[_0x4e68bf[_0x2f56('0x1f')]],'as':_0x4e68bf['as'],'attributes':_0x4e68bf[_0x2f56('0x1c')],'include':_0x4e68bf['include']?_[_0x2f56('0x1e')](_0x4e68bf['include'],function(_0x47f1a2){return{'model':db[_0x47f1a2[_0x2f56('0x1f')]],'as':_0x47f1a2['as'],'attributes':_0x47f1a2[_0x2f56('0x1c')],'include':_0x47f1a2[_0x2f56('0x1d')]?_['map'](_0x47f1a2[_0x2f56('0x1d')],function(_0x552769){return{'model':db[_0x552769[_0x2f56('0x1f')]],'as':_0x552769['as'],'attributes':_0x552769['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f56('0xc')](function(_0x455723){logger[_0x2f56('0xd')]('ShowZohoAccount',_0x219653);logger[_0x2f56('0xf')](_0x2f56('0x20'),_0x219653,JSON[_0x2f56('0x10')](_0x455723));_0x44afc9(_0x455723);})[_0x2f56('0x15')](function(_0x3abc03){logger[_0x2f56('0x11')]('ShowZohoAccount',_0x3abc03[_0x2f56('0x12')],_0x219653);_0x31a537(_0xa785a5[_0x2f56('0x11')](0x1f4,_0x3abc03[_0x2f56('0x12')]));});});}; \ No newline at end of file +var _0xc692=['findAll','options','where','attributes','map','include','model','info','find','raw','ShowZohoAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZohoAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetZohoAccount','ZohoAccount'];(function(_0x20a599,_0x4e5a44){var _0x5dac8f=function(_0x29e04b){while(--_0x29e04b){_0x20a599['push'](_0x20a599['shift']());}};_0x5dac8f(++_0x4e5a44);}(_0xc692,0x15f));var _0x2c69=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xc692[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x2c69('0x0'));var util=require(_0x2c69('0x1'));var moment=require(_0x2c69('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c69('0x3'));var db=require(_0x2c69('0x4'))['db'];var utils=require(_0x2c69('0x5'));var logger=require(_0x2c69('0x6'))(_0x2c69('0x7'));var config=require(_0x2c69('0x8'));var jayson=require(_0x2c69('0x9'));var client=jayson['client'][_0x2c69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4da70c,_0x5c1260,_0x31688a){return new BPromise(function(_0x7a913a,_0xfc5ebb){return client[_0x2c69('0xb')](_0x4da70c,_0x31688a)[_0x2c69('0xc')](function(_0x131313){logger['info'](_0x2c69('0xd'),_0x5c1260,'request\x20sent');logger[_0x2c69('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5c1260,_0x2c69('0xf'),JSON[_0x2c69('0x10')](_0x131313));if(_0x131313[_0x2c69('0x11')]){if(_0x131313[_0x2c69('0x11')][_0x2c69('0x12')]===0x1f4){logger[_0x2c69('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x5c1260,_0x131313[_0x2c69('0x11')]['message']);return _0xfc5ebb(_0x131313[_0x2c69('0x11')][_0x2c69('0x13')]);}logger[_0x2c69('0x11')](_0x2c69('0xd'),_0x5c1260,_0x131313[_0x2c69('0x11')][_0x2c69('0x13')]);return _0x7a913a(_0x131313['error'][_0x2c69('0x13')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x5c1260,_0x2c69('0xf'));_0x7a913a(_0x131313['result'][_0x2c69('0x13')]);}})[_0x2c69('0x14')](function(_0x59e48a){logger['error'](_0x2c69('0xd'),_0x5c1260,_0x59e48a);_0xfc5ebb(_0x59e48a);});});}exports[_0x2c69('0x15')]=function(_0xa1c51){var _0x5b4ca0=this;return new Promise(function(_0x57fe09,_0x4e597d){return db[_0x2c69('0x16')][_0x2c69('0x17')]({'raw':_0xa1c51['options']?_0xa1c51[_0x2c69('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xa1c51[_0x2c69('0x18')]?_0xa1c51[_0x2c69('0x18')][_0x2c69('0x19')]||null:null,'attributes':_0xa1c51[_0x2c69('0x18')]?_0xa1c51['options'][_0x2c69('0x1a')]||null:null,'limit':_0xa1c51[_0x2c69('0x18')]?_0xa1c51[_0x2c69('0x18')]['limit']||null:null,'include':_0xa1c51[_0x2c69('0x18')]?_0xa1c51['options']['include']?_[_0x2c69('0x1b')](_0xa1c51[_0x2c69('0x18')][_0x2c69('0x1c')],function(_0x4c8402){return{'model':db[_0x4c8402['model']],'as':_0x4c8402['as'],'attributes':_0x4c8402[_0x2c69('0x1a')],'include':_0x4c8402[_0x2c69('0x1c')]?_[_0x2c69('0x1b')](_0x4c8402[_0x2c69('0x1c')],function(_0x12dbca){return{'model':db[_0x12dbca[_0x2c69('0x1d')]],'as':_0x12dbca['as'],'attributes':_0x12dbca[_0x2c69('0x1a')],'include':_0x12dbca[_0x2c69('0x1c')]?_[_0x2c69('0x1b')](_0x12dbca['include'],function(_0x7dd85a){return{'model':db[_0x7dd85a[_0x2c69('0x1d')]],'as':_0x7dd85a['as'],'attributes':_0x7dd85a['attributes']};}):[]};}):[]};}):[]:[]})[_0x2c69('0xc')](function(_0xd85b20){logger[_0x2c69('0x1e')]('GetZohoAccount',_0xa1c51);logger[_0x2c69('0xe')](_0x2c69('0x15'),_0xa1c51,JSON['stringify'](_0xd85b20));_0x57fe09(_0xd85b20);})[_0x2c69('0x14')](function(_0x3d6e87){logger[_0x2c69('0x11')](_0x2c69('0x15'),_0x3d6e87['message'],_0xa1c51);_0x4e597d(_0x5b4ca0[_0x2c69('0x11')](0x1f4,_0x3d6e87[_0x2c69('0x13')]));});});};exports['ShowZohoAccount']=function(_0x5c56a9){var _0x4ada2a=this;return new Promise(function(_0x41d912,_0x5cd649){return db['ZohoAccount'][_0x2c69('0x1f')]({'raw':_0x5c56a9[_0x2c69('0x18')]?_0x5c56a9[_0x2c69('0x18')][_0x2c69('0x20')]===undefined?!![]:![]:!![],'where':_0x5c56a9[_0x2c69('0x18')]?_0x5c56a9['options'][_0x2c69('0x19')]||null:null,'attributes':_0x5c56a9[_0x2c69('0x18')]?_0x5c56a9[_0x2c69('0x18')][_0x2c69('0x1a')]||null:null,'include':_0x5c56a9['options']?_0x5c56a9[_0x2c69('0x18')][_0x2c69('0x1c')]?_[_0x2c69('0x1b')](_0x5c56a9[_0x2c69('0x18')][_0x2c69('0x1c')],function(_0x57acc7){return{'model':db[_0x57acc7[_0x2c69('0x1d')]],'as':_0x57acc7['as'],'attributes':_0x57acc7[_0x2c69('0x1a')],'include':_0x57acc7[_0x2c69('0x1c')]?_[_0x2c69('0x1b')](_0x57acc7[_0x2c69('0x1c')],function(_0x2faa99){return{'model':db[_0x2faa99['model']],'as':_0x2faa99['as'],'attributes':_0x2faa99['attributes'],'include':_0x2faa99[_0x2c69('0x1c')]?_[_0x2c69('0x1b')](_0x2faa99[_0x2c69('0x1c')],function(_0x572319){return{'model':db[_0x572319[_0x2c69('0x1d')]],'as':_0x572319['as'],'attributes':_0x572319[_0x2c69('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2c69('0xc')](function(_0x5d178c){logger[_0x2c69('0x1e')](_0x2c69('0x21'),_0x5c56a9);logger[_0x2c69('0xe')](_0x2c69('0x21'),_0x5c56a9,JSON[_0x2c69('0x10')](_0x5d178c));_0x41d912(_0x5d178c);})['catch'](function(_0x45cca4){logger[_0x2c69('0x11')](_0x2c69('0x21'),_0x45cca4[_0x2c69('0x13')],_0x5c56a9);_0x5cd649(_0x4ada2a[_0x2c69('0x11')](0x1f4,_0x45cca4['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 5270ed1..27b9dea 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 _0x8e5a=['show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id'];(function(_0x49110d,_0x165d11){var _0xf4e18a=function(_0x298bd0){while(--_0x298bd0){_0x49110d['push'](_0x49110d['shift']());}};_0xf4e18a(++_0x165d11);}(_0x8e5a,0x1ee));var _0xa8e5=function(_0x3f32ad,_0x1e107e){_0x3f32ad=_0x3f32ad-0x0;var _0x5f19ab=_0x8e5a[_0x3f32ad];return _0x5f19ab;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa8e5('0x0'));var express=require(_0xa8e5('0x1'));var router=express[_0xa8e5('0x2')]();var fs_extra=require(_0xa8e5('0x3'));var auth=require(_0xa8e5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa8e5('0x5'));var controller=require(_0xa8e5('0x6'));router[_0xa8e5('0x7')]('/',auth[_0xa8e5('0x8')](),controller['index']);router[_0xa8e5('0x7')](_0xa8e5('0x9'),auth[_0xa8e5('0x8')](),controller[_0xa8e5('0xa')]);router[_0xa8e5('0x7')](_0xa8e5('0xb'),auth[_0xa8e5('0x8')](),controller['getFields']);router[_0xa8e5('0x7')](_0xa8e5('0xc'),auth[_0xa8e5('0x8')](),controller[_0xa8e5('0xd')]);router['get'](_0xa8e5('0xe'),auth[_0xa8e5('0x8')](),controller[_0xa8e5('0xf')]);router[_0xa8e5('0x10')]('/',auth['isAuthenticated'](),controller[_0xa8e5('0x11')]);router[_0xa8e5('0x12')](_0xa8e5('0x9'),auth[_0xa8e5('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa8e5('0x13')]);module[_0xa8e5('0x14')]=router; \ No newline at end of file +var _0x341d=['getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x341d,0x171));var _0xd341=function(_0xe776ba,_0x2e9fe2){_0xe776ba=_0xe776ba-0x0;var _0x2509b7=_0x341d[_0xe776ba];return _0x2509b7;};'use strict';var multer=require('multer');var util=require(_0xd341('0x0'));var path=require(_0xd341('0x1'));var timeout=require(_0xd341('0x2'));var express=require('express');var router=express[_0xd341('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd341('0x4'));var interaction=require(_0xd341('0x5'));var config=require(_0xd341('0x6'));var controller=require(_0xd341('0x7'));router[_0xd341('0x8')]('/',auth[_0xd341('0x9')](),controller[_0xd341('0xa')]);router[_0xd341('0x8')](_0xd341('0xb'),auth[_0xd341('0x9')](),controller[_0xd341('0xc')]);router[_0xd341('0x8')]('/:id/fields',auth[_0xd341('0x9')](),controller[_0xd341('0xd')]);router[_0xd341('0x8')](_0xd341('0xe'),auth['isAuthenticated'](),controller[_0xd341('0xf')]);router[_0xd341('0x8')](_0xd341('0x10'),auth[_0xd341('0x9')](),controller['getDescriptions']);router[_0xd341('0x11')]('/',auth[_0xd341('0x9')](),controller[_0xd341('0x12')]);router[_0xd341('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd341('0x14')]);router[_0xd341('0x15')](_0xd341('0xb'),auth[_0xd341('0x9')](),controller[_0xd341('0x16')]);module[_0xd341('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 8df9ee1..08790f4 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 _0x3a32=['contact','nothing','contact_lead','sequelize','exports','STRING','ENUM','lead'];(function(_0x4306cc,_0x2327eb){var _0x5cabff=function(_0x2cbff2){while(--_0x2cbff2){_0x4306cc['push'](_0x4306cc['shift']());}};_0x5cabff(++_0x2327eb);}(_0x3a32,0x9b));var _0x23a3=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3a32[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x23a3('0x0'));module[_0x23a3('0x1')]={'name':{'type':Sequelize[_0x23a3('0x2')]},'moduleCreate':{'type':Sequelize[_0x23a3('0x3')](_0x23a3('0x4'),_0x23a3('0x5'),_0x23a3('0x6')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0x23a3('0x7'),_0x23a3('0x5'),'lead'),'defaultValue':_0x23a3('0x7')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb2d5=['lead','contact','nothing','contact_lead','sequelize','STRING','ENUM'];(function(_0x5e0dec,_0x23f8ab){var _0x1d75b4=function(_0x24948c){while(--_0x24948c){_0x5e0dec['push'](_0x5e0dec['shift']());}};_0x1d75b4(++_0x23f8ab);}(_0xb2d5,0x11c));var _0x5b2d=function(_0x2ee01d,_0x48f7a7){_0x2ee01d=_0x2ee01d-0x0;var _0x24bc9f=_0xb2d5[_0x2ee01d];return _0x24bc9f;};'use strict';var Sequelize=require(_0x5b2d('0x0'));module['exports']={'name':{'type':Sequelize[_0x5b2d('0x1')]},'moduleCreate':{'type':Sequelize[_0x5b2d('0x2')](_0x5b2d('0x3'),_0x5b2d('0x4'),_0x5b2d('0x5')),'defaultValue':_0x5b2d('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x5b2d('0x6'),_0x5b2d('0x4'),_0x5b2d('0x3')),'defaultValue':_0x5b2d('0x6')},'description':{'type':Sequelize[_0x5b2d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 85bcbdd..a189c08 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 _0xdf55=['sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','keys','filters','query','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','params','intersection','merge','options','find','create','body','findOne','ZohoField','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util'];(function(_0x215bb6,_0x1e7167){var _0x39a2c2=function(_0x22e464){while(--_0x22e464){_0x215bb6['push'](_0x215bb6['shift']());}};_0x39a2c2(++_0x1e7167);}(_0xdf55,0x189));var _0x5df5=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0xdf55[_0x71b765];return _0x34cb24;};'use strict';var emlformat=require(_0x5df5('0x0'));var rimraf=require(_0x5df5('0x1'));var zipdir=require(_0x5df5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5df5('0x3'));var moment=require('moment');var BPromise=require(_0x5df5('0x4'));var Mustache=require(_0x5df5('0x5'));var util=require(_0x5df5('0x6'));var path=require('path');var sox=require(_0x5df5('0x7'));var csv=require(_0x5df5('0x8'));var ejs=require(_0x5df5('0x9'));var fs=require('fs');var fs_extra=require(_0x5df5('0xa'));var _=require(_0x5df5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5df5('0x8'));var querystring=require(_0x5df5('0xc'));var Papa=require(_0x5df5('0xd'));var Redis=require(_0x5df5('0xe'));var authService=require(_0x5df5('0xf'));var qs=require(_0x5df5('0x10'));var as=require(_0x5df5('0x11'));var hardwareService=require(_0x5df5('0x12'));var logger=require(_0x5df5('0x13'))(_0x5df5('0x14'));var utils=require('../../config/utils');var config=require(_0x5df5('0x15'));var licenseUtil=require(_0x5df5('0x16'));var db=require(_0x5df5('0x17'))['db'];function respondWithStatusCode(_0x16175f,_0x35d30){_0x35d30=_0x35d30||0xcc;return function(_0x3da063){if(_0x3da063){return _0x16175f[_0x5df5('0x18')](_0x35d30);}return _0x16175f[_0x5df5('0x19')](_0x35d30)[_0x5df5('0x1a')]();};}function respondWithResult(_0x164657,_0x24d974){_0x24d974=_0x24d974||0xc8;return function(_0x51b39c){if(_0x51b39c){return _0x164657[_0x5df5('0x19')](_0x24d974)[_0x5df5('0x1b')](_0x51b39c);}};}function respondWithFilteredResult(_0x4e7d31,_0x4b1bcc){return function(_0x5d3047){if(_0x5d3047){var _0x4bae7c=typeof _0x4b1bcc[_0x5df5('0x1c')]===_0x5df5('0x1d')&&typeof _0x4b1bcc[_0x5df5('0x1e')]==='undefined';var _0x1993ac=_0x5d3047[_0x5df5('0x1f')];var _0x473b89=_0x4bae7c?0x0:_0x4b1bcc[_0x5df5('0x1c')];var _0x18e559=_0x4bae7c?_0x5d3047[_0x5df5('0x1f')]:_0x4b1bcc[_0x5df5('0x1c')]+_0x4b1bcc[_0x5df5('0x1e')];var _0x1ce260;if(_0x18e559>=_0x1993ac){_0x18e559=_0x1993ac;_0x1ce260=0xc8;}else{_0x1ce260=0xce;}_0x4e7d31[_0x5df5('0x19')](_0x1ce260);return _0x4e7d31[_0x5df5('0x20')]('Content-Range',_0x473b89+'-'+_0x18e559+'/'+_0x1993ac)['json'](_0x5d3047);}return null;};}function patchUpdates(_0x458da0){return function(_0x525ede){try{jsonpatch['apply'](_0x525ede,_0x458da0,!![]);}catch(_0x3dfeb9){return BPromise[_0x5df5('0x21')](_0x3dfeb9);}return _0x525ede['save']();};}function saveUpdates(_0x5b20e0,_0x103547){return function(_0xed20e){if(_0xed20e){return _0xed20e[_0x5df5('0x22')](_0x5b20e0)[_0x5df5('0x23')](function(_0x438a0c){return _0x438a0c;});}return null;};}function removeEntity(_0x50b194,_0x604c58){return function(_0x1400e9){if(_0x1400e9){return _0x1400e9[_0x5df5('0x24')]()['then'](function(){_0x50b194['status'](0xcc)[_0x5df5('0x1a')]();});}};}function handleEntityNotFound(_0x337561,_0x38bba4){return function(_0x5e53ce){if(!_0x5e53ce){_0x337561[_0x5df5('0x18')](0x194);}return _0x5e53ce;};}function handleError(_0x4d6a06,_0x444f0c){_0x444f0c=_0x444f0c||0x1f4;return function(_0x2c045e){logger[_0x5df5('0x25')](_0x2c045e[_0x5df5('0x26')]);if(_0x2c045e[_0x5df5('0x27')]){delete _0x2c045e[_0x5df5('0x27')];}_0x4d6a06[_0x5df5('0x19')](_0x444f0c)['send'](_0x2c045e);};}exports[_0x5df5('0x28')]=function(_0x3a0574,_0x4c9735){var _0x156cb0={},_0x24a552={},_0x35a232={'count':0x0,'rows':[]};var _0x33112f=_['map'](db['ZohoConfiguration'][_0x5df5('0x29')],function(_0x158038){return{'name':_0x158038[_0x5df5('0x2a')],'type':_0x158038[_0x5df5('0x2b')][_0x5df5('0x2c')]};});_0x24a552[_0x5df5('0x2d')]=_[_0x5df5('0x2e')](_0x33112f,_0x5df5('0x27'));_0x24a552['query']=_[_0x5df5('0x2f')](_0x3a0574['query']);_0x24a552[_0x5df5('0x30')]=_['intersection'](_0x24a552[_0x5df5('0x2d')],_0x24a552[_0x5df5('0x31')]);_0x156cb0[_0x5df5('0x32')]=_['intersection'](_0x24a552['model'],qs[_0x5df5('0x33')](_0x3a0574['query'][_0x5df5('0x33')]));_0x156cb0[_0x5df5('0x32')]=_0x156cb0['attributes'][_0x5df5('0x34')]?_0x156cb0['attributes']:_0x24a552[_0x5df5('0x2d')];if(!_0x3a0574['query']['hasOwnProperty']('nolimit')){_0x156cb0[_0x5df5('0x1e')]=qs[_0x5df5('0x1e')](_0x3a0574[_0x5df5('0x31')][_0x5df5('0x1e')]);_0x156cb0['offset']=qs['offset'](_0x3a0574[_0x5df5('0x31')][_0x5df5('0x1c')]);}_0x156cb0[_0x5df5('0x35')]=qs[_0x5df5('0x36')](_0x3a0574['query'][_0x5df5('0x36')]);_0x156cb0[_0x5df5('0x37')]=qs[_0x5df5('0x30')](_[_0x5df5('0x38')](_0x3a0574[_0x5df5('0x31')],_0x24a552[_0x5df5('0x30')]),_0x33112f);if(_0x3a0574[_0x5df5('0x31')][_0x5df5('0x39')]){_0x156cb0[_0x5df5('0x37')]=_['merge'](_0x156cb0[_0x5df5('0x37')],{'$or':_[_0x5df5('0x2e')](_0x33112f,function(_0x3c10ed){if(_0x3c10ed[_0x5df5('0x2b')]!==_0x5df5('0x3a')){var _0x2e568a={};_0x2e568a[_0x3c10ed[_0x5df5('0x27')]]={'$like':'%'+_0x3a0574[_0x5df5('0x31')][_0x5df5('0x39')]+'%'};return _0x2e568a;}})});}_0x156cb0=_['merge']({},_0x156cb0,_0x3a0574['options']);var _0x2c2003={'where':_0x156cb0[_0x5df5('0x37')]};return db[_0x5df5('0x3b')][_0x5df5('0x1f')](_0x2c2003)[_0x5df5('0x23')](function(_0x235bac){_0x35a232['count']=_0x235bac;if(_0x3a0574[_0x5df5('0x31')][_0x5df5('0x3c')]){_0x156cb0[_0x5df5('0x3d')]=[{'all':!![]}];}return db[_0x5df5('0x3b')][_0x5df5('0x3e')](_0x156cb0);})[_0x5df5('0x23')](function(_0x54932b){_0x35a232[_0x5df5('0x3f')]=_0x54932b;return _0x35a232;})['then'](respondWithFilteredResult(_0x4c9735,_0x156cb0))[_0x5df5('0x40')](handleError(_0x4c9735,null));};exports[_0x5df5('0x41')]=function(_0x30b618,_0x32e54b){var _0x5dd75b={'raw':![],'where':{'id':_0x30b618[_0x5df5('0x42')]['id']}},_0x1f0090={};_0x1f0090['model']=_['keys'](db[_0x5df5('0x3b')][_0x5df5('0x29')]);_0x1f0090[_0x5df5('0x31')]=_[_0x5df5('0x2f')](_0x30b618[_0x5df5('0x31')]);_0x1f0090[_0x5df5('0x30')]=_[_0x5df5('0x43')](_0x1f0090[_0x5df5('0x2d')],_0x1f0090[_0x5df5('0x31')]);_0x5dd75b[_0x5df5('0x32')]=_[_0x5df5('0x43')](_0x1f0090['model'],qs[_0x5df5('0x33')](_0x30b618['query'][_0x5df5('0x33')]));_0x5dd75b[_0x5df5('0x32')]=_0x5dd75b['attributes'][_0x5df5('0x34')]?_0x5dd75b[_0x5df5('0x32')]:_0x1f0090[_0x5df5('0x2d')];if(_0x30b618[_0x5df5('0x31')][_0x5df5('0x3c')]){_0x5dd75b[_0x5df5('0x3d')]=[{'all':!![]}];}_0x5dd75b=_[_0x5df5('0x44')]({},_0x5dd75b,_0x30b618[_0x5df5('0x45')]);return db[_0x5df5('0x3b')][_0x5df5('0x46')](_0x5dd75b)[_0x5df5('0x23')](handleEntityNotFound(_0x32e54b,null))[_0x5df5('0x23')](respondWithResult(_0x32e54b,null))['catch'](handleError(_0x32e54b,null));};exports[_0x5df5('0x47')]=function(_0x4a92c8,_0x14ba4f){return db['ZohoConfiguration'][_0x5df5('0x47')](_0x4a92c8[_0x5df5('0x48')],{})['then'](respondWithResult(_0x14ba4f,0xc9))[_0x5df5('0x40')](handleError(_0x14ba4f,null));};exports['update']=function(_0x17205a,_0x4ca925){if(_0x17205a['body']['id']){delete _0x17205a[_0x5df5('0x48')]['id'];}return db[_0x5df5('0x3b')][_0x5df5('0x46')]({'where':{'id':_0x17205a[_0x5df5('0x42')]['id']}})[_0x5df5('0x23')](handleEntityNotFound(_0x4ca925,null))[_0x5df5('0x23')](saveUpdates(_0x17205a[_0x5df5('0x48')],null))[_0x5df5('0x23')](respondWithResult(_0x4ca925,null))[_0x5df5('0x40')](handleError(_0x4ca925,null));};exports[_0x5df5('0x24')]=function(_0x534694,_0x3643c0){return db[_0x5df5('0x3b')][_0x5df5('0x46')]({'where':{'id':_0x534694[_0x5df5('0x42')]['id']}})['then'](handleEntityNotFound(_0x3643c0,null))[_0x5df5('0x23')](removeEntity(_0x3643c0,null))[_0x5df5('0x40')](handleError(_0x3643c0,null));};exports['getFields']=function(_0x171c4e,_0x580e04,_0xeb6705){var _0x3eca17={};var _0x1e75c7={};var _0x1b0124;var _0xf49d95;return db[_0x5df5('0x3b')][_0x5df5('0x49')]({'where':{'id':_0x171c4e[_0x5df5('0x42')]['id']}})['then'](handleEntityNotFound(_0x580e04,null))[_0x5df5('0x23')](function(_0x59d733){if(_0x59d733){_0x1b0124=_0x59d733;_0x1e75c7[_0x5df5('0x2d')]=_[_0x5df5('0x2f')](db[_0x5df5('0x4a')][_0x5df5('0x29')]);_0x1e75c7[_0x5df5('0x31')]=_[_0x5df5('0x2f')](_0x171c4e['query']);_0x1e75c7[_0x5df5('0x30')]=_[_0x5df5('0x43')](_0x1e75c7[_0x5df5('0x2d')],_0x1e75c7['query']);_0x3eca17[_0x5df5('0x32')]=_['intersection'](_0x1e75c7['model'],qs[_0x5df5('0x33')](_0x171c4e['query'][_0x5df5('0x33')]));_0x3eca17[_0x5df5('0x32')]=_0x3eca17['attributes'][_0x5df5('0x34')]?_0x3eca17['attributes']:_0x1e75c7[_0x5df5('0x2d')];_0x3eca17[_0x5df5('0x35')]=qs[_0x5df5('0x36')](_0x171c4e[_0x5df5('0x31')][_0x5df5('0x36')]);_0x3eca17['where']=qs[_0x5df5('0x30')](_[_0x5df5('0x38')](_0x171c4e['query'],_0x1e75c7['filters']));if(_0x171c4e['query'][_0x5df5('0x39')]){_0x3eca17[_0x5df5('0x37')]=_[_0x5df5('0x44')](_0x3eca17[_0x5df5('0x37')],{'$or':_['map'](_0x3eca17['attributes'],function(_0x56ea23){var _0x189e30={};_0x189e30[_0x56ea23]={'$like':'%'+_0x171c4e[_0x5df5('0x31')]['filter']+'%'};return _0x189e30;})});}_0x3eca17=_[_0x5df5('0x44')]({},_0x3eca17,_0x171c4e[_0x5df5('0x45')]);return _0x1b0124[_0x5df5('0x4b')](_0x3eca17);}})['then'](function(_0x540593){if(_0x540593){_0xf49d95=_0x540593['length'];if(!_0x171c4e[_0x5df5('0x31')][_0x5df5('0x4c')](_0x5df5('0x4d'))){_0x3eca17[_0x5df5('0x1e')]=qs[_0x5df5('0x1e')](_0x171c4e[_0x5df5('0x31')][_0x5df5('0x1e')]);_0x3eca17['offset']=qs[_0x5df5('0x1c')](_0x171c4e['query'][_0x5df5('0x1c')]);}return _0x1b0124[_0x5df5('0x4b')](_0x3eca17);}})['then'](function(_0x18bd7b){if(_0x18bd7b){return _0x18bd7b?{'count':_0xf49d95,'rows':_0x18bd7b}:null;}})['then'](respondWithResult(_0x580e04,null))[_0x5df5('0x40')](handleError(_0x580e04,null));};exports[_0x5df5('0x4e')]=function(_0x20c69b,_0x4f9f0e,_0x212a64){var _0x273918={};var _0x32cd6f={};var _0x2cb7ee;var _0x206104;return db[_0x5df5('0x3b')][_0x5df5('0x49')]({'where':{'id':_0x20c69b[_0x5df5('0x42')]['id']}})[_0x5df5('0x23')](handleEntityNotFound(_0x4f9f0e,null))[_0x5df5('0x23')](function(_0x2ca3ab){if(_0x2ca3ab){_0x2cb7ee=_0x2ca3ab;_0x32cd6f[_0x5df5('0x2d')]=_[_0x5df5('0x2f')](db[_0x5df5('0x4a')]['rawAttributes']);_0x32cd6f[_0x5df5('0x31')]=_[_0x5df5('0x2f')](_0x20c69b['query']);_0x32cd6f['filters']=_[_0x5df5('0x43')](_0x32cd6f[_0x5df5('0x2d')],_0x32cd6f['query']);_0x273918['attributes']=_[_0x5df5('0x43')](_0x32cd6f['model'],qs[_0x5df5('0x33')](_0x20c69b[_0x5df5('0x31')][_0x5df5('0x33')]));_0x273918[_0x5df5('0x32')]=_0x273918[_0x5df5('0x32')][_0x5df5('0x34')]?_0x273918[_0x5df5('0x32')]:_0x32cd6f[_0x5df5('0x2d')];_0x273918[_0x5df5('0x35')]=qs[_0x5df5('0x36')](_0x20c69b[_0x5df5('0x31')][_0x5df5('0x36')]);_0x273918['where']=qs[_0x5df5('0x30')](_[_0x5df5('0x38')](_0x20c69b[_0x5df5('0x31')],_0x32cd6f[_0x5df5('0x30')]));if(_0x20c69b['query'][_0x5df5('0x39')]){_0x273918[_0x5df5('0x37')]=_[_0x5df5('0x44')](_0x273918['where'],{'$or':_[_0x5df5('0x2e')](_0x273918[_0x5df5('0x32')],function(_0x117444){var _0x369f1a={};_0x369f1a[_0x117444]={'$like':'%'+_0x20c69b['query'][_0x5df5('0x39')]+'%'};return _0x369f1a;})});}_0x273918=_[_0x5df5('0x44')]({},_0x273918,_0x20c69b[_0x5df5('0x45')]);return _0x2cb7ee[_0x5df5('0x4e')](_0x273918);}})[_0x5df5('0x23')](function(_0x21e23c){if(_0x21e23c){_0x206104=_0x21e23c[_0x5df5('0x34')];if(!_0x20c69b[_0x5df5('0x31')][_0x5df5('0x4c')]('nolimit')){_0x273918[_0x5df5('0x1e')]=qs[_0x5df5('0x1e')](_0x20c69b[_0x5df5('0x31')]['limit']);_0x273918[_0x5df5('0x1c')]=qs['offset'](_0x20c69b[_0x5df5('0x31')]['offset']);}return _0x2cb7ee[_0x5df5('0x4e')](_0x273918);}})['then'](function(_0x40b490){if(_0x40b490){return _0x40b490?{'count':_0x206104,'rows':_0x40b490}:null;}})[_0x5df5('0x23')](respondWithResult(_0x4f9f0e,null))[_0x5df5('0x40')](handleError(_0x4f9f0e,null));};exports['getDescriptions']=function(_0x3f2d60,_0x3bd1d6,_0x3b9e96){var _0xaaa8a5={};var _0x1d51eb={};var _0x4adea1;var _0x3a12df;return db[_0x5df5('0x3b')][_0x5df5('0x49')]({'where':{'id':_0x3f2d60[_0x5df5('0x42')]['id']}})[_0x5df5('0x23')](handleEntityNotFound(_0x3bd1d6,null))['then'](function(_0x5a3afb){if(_0x5a3afb){_0x4adea1=_0x5a3afb;_0x1d51eb['model']=_['keys'](db['ZohoField'][_0x5df5('0x29')]);_0x1d51eb[_0x5df5('0x31')]=_[_0x5df5('0x2f')](_0x3f2d60[_0x5df5('0x31')]);_0x1d51eb[_0x5df5('0x30')]=_['intersection'](_0x1d51eb[_0x5df5('0x2d')],_0x1d51eb['query']);_0xaaa8a5[_0x5df5('0x32')]=_[_0x5df5('0x43')](_0x1d51eb[_0x5df5('0x2d')],qs['fields'](_0x3f2d60[_0x5df5('0x31')][_0x5df5('0x33')]));_0xaaa8a5[_0x5df5('0x32')]=_0xaaa8a5['attributes'][_0x5df5('0x34')]?_0xaaa8a5[_0x5df5('0x32')]:_0x1d51eb[_0x5df5('0x2d')];_0xaaa8a5[_0x5df5('0x35')]=qs[_0x5df5('0x36')](_0x3f2d60['query'][_0x5df5('0x36')]);_0xaaa8a5[_0x5df5('0x37')]=qs[_0x5df5('0x30')](_[_0x5df5('0x38')](_0x3f2d60[_0x5df5('0x31')],_0x1d51eb['filters']));if(_0x3f2d60[_0x5df5('0x31')][_0x5df5('0x39')]){_0xaaa8a5['where']=_[_0x5df5('0x44')](_0xaaa8a5[_0x5df5('0x37')],{'$or':_[_0x5df5('0x2e')](_0xaaa8a5[_0x5df5('0x32')],function(_0x393433){var _0x4040e3={};_0x4040e3[_0x393433]={'$like':'%'+_0x3f2d60[_0x5df5('0x31')][_0x5df5('0x39')]+'%'};return _0x4040e3;})});}_0xaaa8a5=_[_0x5df5('0x44')]({},_0xaaa8a5,_0x3f2d60[_0x5df5('0x45')]);return _0x4adea1['getDescriptions'](_0xaaa8a5);}})[_0x5df5('0x23')](function(_0x3b9d68){if(_0x3b9d68){_0x3a12df=_0x3b9d68[_0x5df5('0x34')];if(!_0x3f2d60['query'][_0x5df5('0x4c')](_0x5df5('0x4d'))){_0xaaa8a5[_0x5df5('0x1e')]=qs['limit'](_0x3f2d60[_0x5df5('0x31')][_0x5df5('0x1e')]);_0xaaa8a5[_0x5df5('0x1c')]=qs[_0x5df5('0x1c')](_0x3f2d60[_0x5df5('0x31')][_0x5df5('0x1c')]);}return _0x4adea1[_0x5df5('0x4f')](_0xaaa8a5);}})['then'](function(_0x769518){if(_0x769518){return _0x769518?{'count':_0x3a12df,'rows':_0x769518}:null;}})[_0x5df5('0x23')](respondWithResult(_0x3bd1d6,null))[_0x5df5('0x40')](handleError(_0x3bd1d6,null));}; \ No newline at end of file +var _0x47f0=['then','end','error','stack','name','send','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','destroy','getFields','ZohoField','findOne','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','offset','undefined','limit','count','status','set','json','reject','update'];(function(_0x46fe02,_0x5f0e57){var _0x312a81=function(_0x40f396){while(--_0x40f396){_0x46fe02['push'](_0x46fe02['shift']());}};_0x312a81(++_0x5f0e57);}(_0x47f0,0xcb));var _0x047f=function(_0x995dff,_0x349b8e){_0x995dff=_0x995dff-0x0;var _0x403beb=_0x47f0[_0x995dff];return _0x403beb;};'use strict';var emlformat=require(_0x047f('0x0'));var rimraf=require(_0x047f('0x1'));var zipdir=require(_0x047f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x047f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x047f('0x4'));var util=require(_0x047f('0x5'));var path=require(_0x047f('0x6'));var sox=require(_0x047f('0x7'));var csv=require(_0x047f('0x8'));var ejs=require(_0x047f('0x9'));var fs=require('fs');var fs_extra=require(_0x047f('0xa'));var _=require('lodash');var squel=require(_0x047f('0xb'));var crypto=require(_0x047f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x047f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x047f('0xe'));var Papa=require(_0x047f('0xf'));var Redis=require(_0x047f('0x10'));var authService=require(_0x047f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x047f('0x12'));var hardwareService=require(_0x047f('0x13'));var logger=require(_0x047f('0x14'))('api');var utils=require(_0x047f('0x15'));var config=require(_0x047f('0x16'));var licenseUtil=require(_0x047f('0x17'));var db=require(_0x047f('0x18'))['db'];function respondWithStatusCode(_0x37281a,_0x34132b){_0x34132b=_0x34132b||0xcc;return function(_0x46f937){if(_0x46f937){return _0x37281a['sendStatus'](_0x34132b);}return _0x37281a['status'](_0x34132b)['end']();};}function respondWithResult(_0x2c7b70,_0x116cec){_0x116cec=_0x116cec||0xc8;return function(_0x19eeb8){if(_0x19eeb8){return _0x2c7b70['status'](_0x116cec)['json'](_0x19eeb8);}};}function respondWithFilteredResult(_0x24b912,_0xb5f52f){return function(_0x597789){if(_0x597789){var _0x35a3f0=typeof _0xb5f52f[_0x047f('0x19')]===_0x047f('0x1a')&&typeof _0xb5f52f[_0x047f('0x1b')]==='undefined';var _0x4d12a2=_0x597789[_0x047f('0x1c')];var _0x11288a=_0x35a3f0?0x0:_0xb5f52f[_0x047f('0x19')];var _0x3ac8fa=_0x35a3f0?_0x597789['count']:_0xb5f52f[_0x047f('0x19')]+_0xb5f52f['limit'];var _0x59e5b9;if(_0x3ac8fa>=_0x4d12a2){_0x3ac8fa=_0x4d12a2;_0x59e5b9=0xc8;}else{_0x59e5b9=0xce;}_0x24b912[_0x047f('0x1d')](_0x59e5b9);return _0x24b912[_0x047f('0x1e')]('Content-Range',_0x11288a+'-'+_0x3ac8fa+'/'+_0x4d12a2)[_0x047f('0x1f')](_0x597789);}return null;};}function patchUpdates(_0x37b73d){return function(_0x1079c1){try{jsonpatch['apply'](_0x1079c1,_0x37b73d,!![]);}catch(_0x6bae8d){return BPromise[_0x047f('0x20')](_0x6bae8d);}return _0x1079c1['save']();};}function saveUpdates(_0x4d02f8,_0x3e5724){return function(_0x1bf682){if(_0x1bf682){return _0x1bf682[_0x047f('0x21')](_0x4d02f8)[_0x047f('0x22')](function(_0x6cb8f5){return _0x6cb8f5;});}return null;};}function removeEntity(_0x4f317a,_0x20c801){return function(_0x1c0b93){if(_0x1c0b93){return _0x1c0b93['destroy']()['then'](function(){_0x4f317a[_0x047f('0x1d')](0xcc)[_0x047f('0x23')]();});}};}function handleEntityNotFound(_0x30b43c,_0xa73980){return function(_0x1269d2){if(!_0x1269d2){_0x30b43c['sendStatus'](0x194);}return _0x1269d2;};}function handleError(_0x2ee856,_0x1e1ae3){_0x1e1ae3=_0x1e1ae3||0x1f4;return function(_0x1887da){logger[_0x047f('0x24')](_0x1887da[_0x047f('0x25')]);if(_0x1887da[_0x047f('0x26')]){delete _0x1887da[_0x047f('0x26')];}_0x2ee856['status'](_0x1e1ae3)[_0x047f('0x27')](_0x1887da);};}exports['index']=function(_0x124a78,_0x47dbe2){var _0x8b782c={},_0x465b51={},_0x50a8a6={'count':0x0,'rows':[]};var _0x597b7f=_['map'](db[_0x047f('0x28')]['rawAttributes'],function(_0x56c203){return{'name':_0x56c203[_0x047f('0x29')],'type':_0x56c203[_0x047f('0x2a')][_0x047f('0x2b')]};});_0x465b51[_0x047f('0x2c')]=_['map'](_0x597b7f,_0x047f('0x26'));_0x465b51[_0x047f('0x2d')]=_[_0x047f('0x2e')](_0x124a78[_0x047f('0x2d')]);_0x465b51[_0x047f('0x2f')]=_['intersection'](_0x465b51[_0x047f('0x2c')],_0x465b51[_0x047f('0x2d')]);_0x8b782c[_0x047f('0x30')]=_[_0x047f('0x31')](_0x465b51['model'],qs['fields'](_0x124a78[_0x047f('0x2d')][_0x047f('0x32')]));_0x8b782c['attributes']=_0x8b782c[_0x047f('0x30')][_0x047f('0x33')]?_0x8b782c[_0x047f('0x30')]:_0x465b51['model'];if(!_0x124a78[_0x047f('0x2d')][_0x047f('0x34')](_0x047f('0x35'))){_0x8b782c[_0x047f('0x1b')]=qs[_0x047f('0x1b')](_0x124a78[_0x047f('0x2d')]['limit']);_0x8b782c['offset']=qs[_0x047f('0x19')](_0x124a78[_0x047f('0x2d')]['offset']);}_0x8b782c['order']=qs[_0x047f('0x36')](_0x124a78[_0x047f('0x2d')][_0x047f('0x36')]);_0x8b782c[_0x047f('0x37')]=qs[_0x047f('0x2f')](_[_0x047f('0x38')](_0x124a78['query'],_0x465b51[_0x047f('0x2f')]),_0x597b7f);if(_0x124a78[_0x047f('0x2d')][_0x047f('0x39')]){_0x8b782c[_0x047f('0x37')]=_[_0x047f('0x3a')](_0x8b782c[_0x047f('0x37')],{'$or':_[_0x047f('0x3b')](_0x597b7f,function(_0xe1c1b9){if(_0xe1c1b9[_0x047f('0x2a')]!==_0x047f('0x3c')){var _0x564024={};_0x564024[_0xe1c1b9['name']]={'$like':'%'+_0x124a78[_0x047f('0x2d')][_0x047f('0x39')]+'%'};return _0x564024;}})});}_0x8b782c=_[_0x047f('0x3a')]({},_0x8b782c,_0x124a78[_0x047f('0x3d')]);var _0x36d7cb={'where':_0x8b782c[_0x047f('0x37')]};return db['ZohoConfiguration'][_0x047f('0x1c')](_0x36d7cb)['then'](function(_0xff7bc9){_0x50a8a6['count']=_0xff7bc9;if(_0x124a78[_0x047f('0x2d')]['includeAll']){_0x8b782c[_0x047f('0x3e')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x047f('0x3f')](_0x8b782c);})['then'](function(_0x18c56d){_0x50a8a6[_0x047f('0x40')]=_0x18c56d;return _0x50a8a6;})[_0x047f('0x22')](respondWithFilteredResult(_0x47dbe2,_0x8b782c))[_0x047f('0x41')](handleError(_0x47dbe2,null));};exports[_0x047f('0x42')]=function(_0x1861ad,_0x92ecf1){var _0x42adf7={'raw':![],'where':{'id':_0x1861ad['params']['id']}},_0x3dfe27={};_0x3dfe27[_0x047f('0x2c')]=_['keys'](db[_0x047f('0x28')][_0x047f('0x43')]);_0x3dfe27[_0x047f('0x2d')]=_['keys'](_0x1861ad[_0x047f('0x2d')]);_0x3dfe27[_0x047f('0x2f')]=_[_0x047f('0x31')](_0x3dfe27[_0x047f('0x2c')],_0x3dfe27[_0x047f('0x2d')]);_0x42adf7[_0x047f('0x30')]=_[_0x047f('0x31')](_0x3dfe27[_0x047f('0x2c')],qs[_0x047f('0x32')](_0x1861ad[_0x047f('0x2d')][_0x047f('0x32')]));_0x42adf7[_0x047f('0x30')]=_0x42adf7[_0x047f('0x30')][_0x047f('0x33')]?_0x42adf7[_0x047f('0x30')]:_0x3dfe27['model'];if(_0x1861ad[_0x047f('0x2d')]['includeAll']){_0x42adf7['include']=[{'all':!![]}];}_0x42adf7=_[_0x047f('0x3a')]({},_0x42adf7,_0x1861ad[_0x047f('0x3d')]);return db[_0x047f('0x28')][_0x047f('0x44')](_0x42adf7)[_0x047f('0x22')](handleEntityNotFound(_0x92ecf1,null))[_0x047f('0x22')](respondWithResult(_0x92ecf1,null))[_0x047f('0x41')](handleError(_0x92ecf1,null));};exports[_0x047f('0x45')]=function(_0xab79b,_0x28fce0){return db['ZohoConfiguration'][_0x047f('0x45')](_0xab79b[_0x047f('0x46')],{})[_0x047f('0x22')](respondWithResult(_0x28fce0,0xc9))[_0x047f('0x41')](handleError(_0x28fce0,null));};exports[_0x047f('0x21')]=function(_0x47a6f6,_0x41e5fd){if(_0x47a6f6[_0x047f('0x46')]['id']){delete _0x47a6f6['body']['id'];}return db[_0x047f('0x28')][_0x047f('0x44')]({'where':{'id':_0x47a6f6[_0x047f('0x47')]['id']}})[_0x047f('0x22')](handleEntityNotFound(_0x41e5fd,null))[_0x047f('0x22')](saveUpdates(_0x47a6f6[_0x047f('0x46')],null))[_0x047f('0x22')](respondWithResult(_0x41e5fd,null))['catch'](handleError(_0x41e5fd,null));};exports[_0x047f('0x48')]=function(_0x2d8e4d,_0x5c600e){return db[_0x047f('0x28')][_0x047f('0x44')]({'where':{'id':_0x2d8e4d[_0x047f('0x47')]['id']}})[_0x047f('0x22')](handleEntityNotFound(_0x5c600e,null))['then'](removeEntity(_0x5c600e,null))['catch'](handleError(_0x5c600e,null));};exports[_0x047f('0x49')]=function(_0x4f3356,_0x3a2843,_0x78c326){var _0x3ab8e0={};var _0x1a8523={};var _0x1545f9;var _0x57a54f;return db[_0x047f('0x28')]['findOne']({'where':{'id':_0x4f3356[_0x047f('0x47')]['id']}})[_0x047f('0x22')](handleEntityNotFound(_0x3a2843,null))[_0x047f('0x22')](function(_0x3bc229){if(_0x3bc229){_0x1545f9=_0x3bc229;_0x1a8523[_0x047f('0x2c')]=_[_0x047f('0x2e')](db[_0x047f('0x4a')][_0x047f('0x43')]);_0x1a8523[_0x047f('0x2d')]=_[_0x047f('0x2e')](_0x4f3356[_0x047f('0x2d')]);_0x1a8523['filters']=_[_0x047f('0x31')](_0x1a8523[_0x047f('0x2c')],_0x1a8523[_0x047f('0x2d')]);_0x3ab8e0['attributes']=_[_0x047f('0x31')](_0x1a8523[_0x047f('0x2c')],qs[_0x047f('0x32')](_0x4f3356[_0x047f('0x2d')][_0x047f('0x32')]));_0x3ab8e0[_0x047f('0x30')]=_0x3ab8e0['attributes'][_0x047f('0x33')]?_0x3ab8e0[_0x047f('0x30')]:_0x1a8523[_0x047f('0x2c')];_0x3ab8e0['order']=qs['sort'](_0x4f3356[_0x047f('0x2d')][_0x047f('0x36')]);_0x3ab8e0['where']=qs[_0x047f('0x2f')](_[_0x047f('0x38')](_0x4f3356['query'],_0x1a8523[_0x047f('0x2f')]));if(_0x4f3356['query'][_0x047f('0x39')]){_0x3ab8e0[_0x047f('0x37')]=_[_0x047f('0x3a')](_0x3ab8e0[_0x047f('0x37')],{'$or':_[_0x047f('0x3b')](_0x3ab8e0[_0x047f('0x30')],function(_0x485f50){var _0x389743={};_0x389743[_0x485f50]={'$like':'%'+_0x4f3356[_0x047f('0x2d')][_0x047f('0x39')]+'%'};return _0x389743;})});}_0x3ab8e0=_['merge']({},_0x3ab8e0,_0x4f3356[_0x047f('0x3d')]);return _0x1545f9[_0x047f('0x49')](_0x3ab8e0);}})['then'](function(_0x57abcf){if(_0x57abcf){_0x57a54f=_0x57abcf['length'];if(!_0x4f3356[_0x047f('0x2d')][_0x047f('0x34')](_0x047f('0x35'))){_0x3ab8e0[_0x047f('0x1b')]=qs[_0x047f('0x1b')](_0x4f3356[_0x047f('0x2d')][_0x047f('0x1b')]);_0x3ab8e0[_0x047f('0x19')]=qs[_0x047f('0x19')](_0x4f3356[_0x047f('0x2d')][_0x047f('0x19')]);}return _0x1545f9[_0x047f('0x49')](_0x3ab8e0);}})[_0x047f('0x22')](function(_0x31eab5){if(_0x31eab5){return _0x31eab5?{'count':_0x57a54f,'rows':_0x31eab5}:null;}})[_0x047f('0x22')](respondWithResult(_0x3a2843,null))[_0x047f('0x41')](handleError(_0x3a2843,null));};exports['getSubjects']=function(_0x4bf3e1,_0x5ab170,_0x189e25){var _0x144ec2={};var _0x3d21ad={};var _0x107e66;var _0x38ff4d;return db[_0x047f('0x28')][_0x047f('0x4b')]({'where':{'id':_0x4bf3e1['params']['id']}})[_0x047f('0x22')](handleEntityNotFound(_0x5ab170,null))[_0x047f('0x22')](function(_0x16ca85){if(_0x16ca85){_0x107e66=_0x16ca85;_0x3d21ad[_0x047f('0x2c')]=_[_0x047f('0x2e')](db[_0x047f('0x4a')][_0x047f('0x43')]);_0x3d21ad['query']=_[_0x047f('0x2e')](_0x4bf3e1[_0x047f('0x2d')]);_0x3d21ad[_0x047f('0x2f')]=_['intersection'](_0x3d21ad[_0x047f('0x2c')],_0x3d21ad[_0x047f('0x2d')]);_0x144ec2['attributes']=_[_0x047f('0x31')](_0x3d21ad[_0x047f('0x2c')],qs['fields'](_0x4bf3e1[_0x047f('0x2d')][_0x047f('0x32')]));_0x144ec2['attributes']=_0x144ec2['attributes'][_0x047f('0x33')]?_0x144ec2['attributes']:_0x3d21ad[_0x047f('0x2c')];_0x144ec2[_0x047f('0x4c')]=qs['sort'](_0x4bf3e1[_0x047f('0x2d')]['sort']);_0x144ec2[_0x047f('0x37')]=qs[_0x047f('0x2f')](_[_0x047f('0x38')](_0x4bf3e1[_0x047f('0x2d')],_0x3d21ad[_0x047f('0x2f')]));if(_0x4bf3e1[_0x047f('0x2d')][_0x047f('0x39')]){_0x144ec2[_0x047f('0x37')]=_['merge'](_0x144ec2[_0x047f('0x37')],{'$or':_[_0x047f('0x3b')](_0x144ec2[_0x047f('0x30')],function(_0xdbc09){var _0x4287ca={};_0x4287ca[_0xdbc09]={'$like':'%'+_0x4bf3e1[_0x047f('0x2d')]['filter']+'%'};return _0x4287ca;})});}_0x144ec2=_[_0x047f('0x3a')]({},_0x144ec2,_0x4bf3e1['options']);return _0x107e66[_0x047f('0x4d')](_0x144ec2);}})[_0x047f('0x22')](function(_0x22595d){if(_0x22595d){_0x38ff4d=_0x22595d[_0x047f('0x33')];if(!_0x4bf3e1[_0x047f('0x2d')]['hasOwnProperty'](_0x047f('0x35'))){_0x144ec2[_0x047f('0x1b')]=qs[_0x047f('0x1b')](_0x4bf3e1['query'][_0x047f('0x1b')]);_0x144ec2[_0x047f('0x19')]=qs[_0x047f('0x19')](_0x4bf3e1[_0x047f('0x2d')]['offset']);}return _0x107e66[_0x047f('0x4d')](_0x144ec2);}})[_0x047f('0x22')](function(_0x156bb4){if(_0x156bb4){return _0x156bb4?{'count':_0x38ff4d,'rows':_0x156bb4}:null;}})['then'](respondWithResult(_0x5ab170,null))[_0x047f('0x41')](handleError(_0x5ab170,null));};exports[_0x047f('0x4e')]=function(_0x3ef8eb,_0x5844f5,_0x58c0c2){var _0x302530={};var _0x592137={};var _0x32006c;var _0x4baf07;return db[_0x047f('0x28')][_0x047f('0x4b')]({'where':{'id':_0x3ef8eb[_0x047f('0x47')]['id']}})[_0x047f('0x22')](handleEntityNotFound(_0x5844f5,null))['then'](function(_0x4c3488){if(_0x4c3488){_0x32006c=_0x4c3488;_0x592137['model']=_[_0x047f('0x2e')](db['ZohoField'][_0x047f('0x43')]);_0x592137['query']=_[_0x047f('0x2e')](_0x3ef8eb[_0x047f('0x2d')]);_0x592137[_0x047f('0x2f')]=_['intersection'](_0x592137['model'],_0x592137[_0x047f('0x2d')]);_0x302530['attributes']=_[_0x047f('0x31')](_0x592137[_0x047f('0x2c')],qs[_0x047f('0x32')](_0x3ef8eb['query'][_0x047f('0x32')]));_0x302530['attributes']=_0x302530[_0x047f('0x30')][_0x047f('0x33')]?_0x302530[_0x047f('0x30')]:_0x592137['model'];_0x302530[_0x047f('0x4c')]=qs['sort'](_0x3ef8eb[_0x047f('0x2d')][_0x047f('0x36')]);_0x302530['where']=qs[_0x047f('0x2f')](_['pick'](_0x3ef8eb[_0x047f('0x2d')],_0x592137[_0x047f('0x2f')]));if(_0x3ef8eb[_0x047f('0x2d')]['filter']){_0x302530[_0x047f('0x37')]=_[_0x047f('0x3a')](_0x302530[_0x047f('0x37')],{'$or':_['map'](_0x302530[_0x047f('0x30')],function(_0xd10759){var _0x54ad66={};_0x54ad66[_0xd10759]={'$like':'%'+_0x3ef8eb[_0x047f('0x2d')][_0x047f('0x39')]+'%'};return _0x54ad66;})});}_0x302530=_[_0x047f('0x3a')]({},_0x302530,_0x3ef8eb[_0x047f('0x3d')]);return _0x32006c[_0x047f('0x4e')](_0x302530);}})[_0x047f('0x22')](function(_0x12330a){if(_0x12330a){_0x4baf07=_0x12330a[_0x047f('0x33')];if(!_0x3ef8eb[_0x047f('0x2d')]['hasOwnProperty']('nolimit')){_0x302530[_0x047f('0x1b')]=qs[_0x047f('0x1b')](_0x3ef8eb[_0x047f('0x2d')][_0x047f('0x1b')]);_0x302530[_0x047f('0x19')]=qs[_0x047f('0x19')](_0x3ef8eb[_0x047f('0x2d')][_0x047f('0x19')]);}return _0x32006c[_0x047f('0x4e')](_0x302530);}})[_0x047f('0x22')](function(_0x5c4f38){if(_0x5c4f38){return _0x5c4f38?{'count':_0x4baf07,'rows':_0x5c4f38}:null;}})[_0x047f('0x22')](respondWithResult(_0x5844f5,null))[_0x047f('0x41')](handleError(_0x5844f5,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 95c8c9a..3c258af 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 _0x2ae5=['api','bluebird','path','../../config/environment','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger'];(function(_0x2cb111,_0x3c5f83){var _0x52d31d=function(_0x39395e){while(--_0x39395e){_0x2cb111['push'](_0x2cb111['shift']());}};_0x52d31d(++_0x3c5f83);}(_0x2ae5,0xd5));var _0x52ae=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x2ae5[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x52ae('0x0'));var util=require(_0x52ae('0x1'));var logger=require(_0x52ae('0x2'))(_0x52ae('0x3'));var moment=require('moment');var BPromise=require(_0x52ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52ae('0x5'));var rimraf=require('rimraf');var config=require(_0x52ae('0x6'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x223ea2,_0x7e242c){return _0x223ea2['define'](_0x52ae('0x7'),attributes,{'tableName':_0x52ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ca2=['../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x261310,_0x29f0b1){var _0x483c08=function(_0xd9e704){while(--_0xd9e704){_0x261310['push'](_0x261310['shift']());}};_0x483c08(++_0x29f0b1);}(_0x9ca2,0x91));var _0x29ca=function(_0x5b7143,_0x36b142){_0x5b7143=_0x5b7143-0x0;var _0x2279e9=_0x9ca2[_0x5b7143];return _0x2279e9;};'use strict';var _=require(_0x29ca('0x0'));var util=require(_0x29ca('0x1'));var logger=require(_0x29ca('0x2'))(_0x29ca('0x3'));var moment=require(_0x29ca('0x4'));var BPromise=require(_0x29ca('0x5'));var rp=require(_0x29ca('0x6'));var fs=require('fs');var path=require(_0x29ca('0x7'));var rimraf=require(_0x29ca('0x8'));var config=require(_0x29ca('0x9'));var attributes=require(_0x29ca('0xa'));module[_0x29ca('0xb')]=function(_0x119904,_0x4e01f7){return _0x119904[_0x29ca('0xc')]('ZohoConfiguration',attributes,{'tableName':_0x29ca('0xd'),'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 937894c..b5f1180 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 _0xc148=['ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xf75187,_0x398958){var _0x295303=function(_0x495970){while(--_0x495970){_0xf75187['push'](_0xf75187['shift']());}};_0x295303(++_0x398958);}(_0xc148,0x73));var _0x8c14=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xc148[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x8c14('0x0'));var util=require(_0x8c14('0x1'));var moment=require(_0x8c14('0x2'));var BPromise=require(_0x8c14('0x3'));var rs=require(_0x8c14('0x4'));var fs=require('fs');var Redis=require(_0x8c14('0x5'));var db=require(_0x8c14('0x6'))['db'];var utils=require(_0x8c14('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8c14('0x8'));var client=jayson[_0x8c14('0x9')][_0x8c14('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58ecff,_0x3fa5d8,_0x2d24d6){return new BPromise(function(_0x434872,_0xc5e123){return client['request'](_0x58ecff,_0x2d24d6)[_0x8c14('0xb')](function(_0x2bd6a8){logger[_0x8c14('0xc')](_0x8c14('0xd'),_0x3fa5d8,_0x8c14('0xe'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3fa5d8,_0x8c14('0xe'),JSON[_0x8c14('0xf')](_0x2bd6a8));if(_0x2bd6a8['error']){if(_0x2bd6a8['error']['code']===0x1f4){logger[_0x8c14('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3fa5d8,_0x2bd6a8[_0x8c14('0x10')][_0x8c14('0x11')]);return _0xc5e123(_0x2bd6a8['error'][_0x8c14('0x11')]);}logger[_0x8c14('0x10')](_0x8c14('0xd'),_0x3fa5d8,_0x2bd6a8['error'][_0x8c14('0x11')]);return _0x434872(_0x2bd6a8[_0x8c14('0x10')][_0x8c14('0x11')]);}else{logger[_0x8c14('0xc')](_0x8c14('0xd'),_0x3fa5d8,'request\x20sent');_0x434872(_0x2bd6a8[_0x8c14('0x12')][_0x8c14('0x11')]);}})[_0x8c14('0x13')](function(_0x9828e){logger[_0x8c14('0x10')](_0x8c14('0xd'),_0x3fa5d8,_0x9828e);_0xc5e123(_0x9828e);});});} \ No newline at end of file +var _0x1726=['request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x54ba78,_0x5f5bb9){var _0x47343e=function(_0x559082){while(--_0x559082){_0x54ba78['push'](_0x54ba78['shift']());}};_0x47343e(++_0x5f5bb9);}(_0x1726,0x1ad));var _0x6172=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0x1726[_0x28f1de];return _0x5b5dad;};'use strict';var _=require(_0x6172('0x0'));var util=require(_0x6172('0x1'));var moment=require(_0x6172('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6172('0x3'));var db=require(_0x6172('0x4'))['db'];var utils=require(_0x6172('0x5'));var logger=require(_0x6172('0x6'))(_0x6172('0x7'));var config=require('../../config/environment');var jayson=require(_0x6172('0x8'));var client=jayson[_0x6172('0x9')][_0x6172('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b71b5,_0x580e9d,_0x163207){return new BPromise(function(_0x5c4027,_0x3c42e1){return client[_0x6172('0xb')](_0x4b71b5,_0x163207)[_0x6172('0xc')](function(_0x5042df){logger[_0x6172('0xd')](_0x6172('0xe'),_0x580e9d,_0x6172('0xf'));logger[_0x6172('0x10')](_0x6172('0x11'),_0x580e9d,'request\x20sent',JSON[_0x6172('0x12')](_0x5042df));if(_0x5042df[_0x6172('0x13')]){if(_0x5042df[_0x6172('0x13')][_0x6172('0x14')]===0x1f4){logger['error'](_0x6172('0xe'),_0x580e9d,_0x5042df['error']['message']);return _0x3c42e1(_0x5042df[_0x6172('0x13')][_0x6172('0x15')]);}logger[_0x6172('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x580e9d,_0x5042df[_0x6172('0x13')]['message']);return _0x5c4027(_0x5042df[_0x6172('0x13')][_0x6172('0x15')]);}else{logger[_0x6172('0xd')](_0x6172('0xe'),_0x580e9d,'request\x20sent');_0x5c4027(_0x5042df['result'][_0x6172('0x15')]);}})['catch'](function(_0x5f42f1){logger[_0x6172('0x13')](_0x6172('0xe'),_0x580e9d,_0x5f42f1);_0x3c42e1(_0x5f42f1);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index fa76209..deb041e 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 _0xdb4d=['create','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','./intZohoField.controller','get','index','/:id','post','isAuthenticated'];(function(_0x32a254,_0x14e1d0){var _0x799afb=function(_0x47e462){while(--_0x47e462){_0x32a254['push'](_0x32a254['shift']());}};_0x799afb(++_0x14e1d0);}(_0xdb4d,0x1e1));var _0xddb4=function(_0x31862d,_0x38cf85){_0x31862d=_0x31862d-0x0;var _0x5e7ce6=_0xdb4d[_0x31862d];return _0x5e7ce6;};'use strict';var multer=require(_0xddb4('0x0'));var util=require(_0xddb4('0x1'));var path=require(_0xddb4('0x2'));var timeout=require('connect-timeout');var express=require(_0xddb4('0x3'));var router=express['Router']();var fs_extra=require(_0xddb4('0x4'));var auth=require(_0xddb4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xddb4('0x6'));router[_0xddb4('0x7')]('/',auth['isAuthenticated'](),controller[_0xddb4('0x8')]);router['get'](_0xddb4('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xddb4('0xa')]('/',auth[_0xddb4('0xb')](),controller[_0xddb4('0xc')]);router[_0xddb4('0xd')](_0xddb4('0x9'),auth[_0xddb4('0xb')](),controller[_0xddb4('0xe')]);router[_0xddb4('0xf')]('/:id',auth[_0xddb4('0xb')](),controller['destroy']);module[_0xddb4('0x10')]=router; \ No newline at end of file +var _0x4a31=['index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated'];(function(_0x1bfd18,_0x3ba1ab){var _0x17c907=function(_0x1e25cd){while(--_0x1e25cd){_0x1bfd18['push'](_0x1bfd18['shift']());}};_0x17c907(++_0x3ba1ab);}(_0x4a31,0x12f));var _0x14a3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4a31[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x14a3('0x0'));var util=require(_0x14a3('0x1'));var path=require(_0x14a3('0x2'));var timeout=require(_0x14a3('0x3'));var express=require(_0x14a3('0x4'));var router=express[_0x14a3('0x5')]();var fs_extra=require(_0x14a3('0x6'));var auth=require(_0x14a3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x14a3('0x8'));var controller=require(_0x14a3('0x9'));router[_0x14a3('0xa')]('/',auth[_0x14a3('0xb')](),controller[_0x14a3('0xc')]);router[_0x14a3('0xa')](_0x14a3('0xd'),auth[_0x14a3('0xb')](),controller[_0x14a3('0xe')]);router[_0x14a3('0xf')]('/',auth['isAuthenticated'](),controller[_0x14a3('0x10')]);router[_0x14a3('0x11')](_0x14a3('0xd'),auth[_0x14a3('0xb')](),controller['update']);router[_0x14a3('0x12')]('/:id',auth[_0x14a3('0xb')](),controller[_0x14a3('0x13')]);module[_0x14a3('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 3937781..7150cb7 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 _0xe2d9=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x16bb5a,_0x4621a8){var _0x265b98=function(_0x34fd2b){while(--_0x34fd2b){_0x16bb5a['push'](_0x16bb5a['shift']());}};_0x265b98(++_0x4621a8);}(_0xe2d9,0xa8));var _0x9e2d=function(_0x161210,_0x18bf05){_0x161210=_0x161210-0x0;var _0xa28987=_0xe2d9[_0x161210];return _0xa28987;};'use strict';var Sequelize=require(_0x9e2d('0x0'));module[_0x9e2d('0x1')]={'type':{'type':Sequelize[_0x9e2d('0x2')](_0x9e2d('0x3'),_0x9e2d('0x4'),_0x9e2d('0x5'),_0x9e2d('0x6'),_0x9e2d('0x7')),'defaultValue':_0x9e2d('0x3')},'content':{'type':Sequelize[_0x9e2d('0x8')]},'key':{'type':Sequelize[_0x9e2d('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x9e2d('0x3'),_0x9e2d('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x9e2d('0x8')]},'idField':{'type':Sequelize[_0x9e2d('0x8')]},'nameField':{'type':Sequelize[_0x9e2d('0x8')]},'customField':{'type':Sequelize[_0x9e2d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9e2d('0x8')]}}; \ No newline at end of file +var _0xc7eb=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','exports'];(function(_0x104a02,_0x4ff9be){var _0x2666a7=function(_0x2fd172){while(--_0x2fd172){_0x104a02['push'](_0x104a02['shift']());}};_0x2666a7(++_0x4ff9be);}(_0xc7eb,0x7d));var _0xbc7e=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0xc7eb[_0x95942];return _0x6d7f81;};'use strict';var Sequelize=require('sequelize');module[_0xbc7e('0x0')]={'type':{'type':Sequelize['ENUM'](_0xbc7e('0x1'),_0xbc7e('0x2'),_0xbc7e('0x3'),_0xbc7e('0x4'),_0xbc7e('0x5')),'defaultValue':_0xbc7e('0x1')},'content':{'type':Sequelize[_0xbc7e('0x6')]},'key':{'type':Sequelize[_0xbc7e('0x6')]},'keyType':{'type':Sequelize[_0xbc7e('0x7')](_0xbc7e('0x1'),'variable',_0xbc7e('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xbc7e('0x6')]},'nameField':{'type':Sequelize[_0xbc7e('0x6')]},'customField':{'type':Sequelize[_0xbc7e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbc7e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 9f8bebb..306f12a 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 _0x76f4=['../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','apply','reject','save','update','then','destroy','error','stack','name','map','ZohoField','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','includeAll','include','findAll','fields','find','create','body','catch','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2c96f6,_0x877207){var _0x6d4808=function(_0x567e0c){while(--_0x567e0c){_0x2c96f6['push'](_0x2c96f6['shift']());}};_0x6d4808(++_0x877207);}(_0x76f4,0x1e0));var _0x476f=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x76f4[_0xc6be3a];return _0x56a310;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x476f('0x0'));var jsonpatch=require(_0x476f('0x1'));var rp=require(_0x476f('0x2'));var moment=require(_0x476f('0x3'));var BPromise=require(_0x476f('0x4'));var Mustache=require(_0x476f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x476f('0x6'));var csv=require(_0x476f('0x7'));var ejs=require(_0x476f('0x8'));var fs=require('fs');var fs_extra=require(_0x476f('0x9'));var _=require(_0x476f('0xa'));var squel=require(_0x476f('0xb'));var crypto=require(_0x476f('0xc'));var jsforce=require(_0x476f('0xd'));var deskjs=require(_0x476f('0xe'));var toCsv=require(_0x476f('0x7'));var querystring=require(_0x476f('0xf'));var Papa=require(_0x476f('0x10'));var Redis=require(_0x476f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x476f('0x12'));var as=require(_0x476f('0x13'));var hardwareService=require(_0x476f('0x14'));var logger=require(_0x476f('0x15'))(_0x476f('0x16'));var utils=require(_0x476f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x476f('0x18'));var db=require(_0x476f('0x19'))['db'];function respondWithStatusCode(_0x2cd221,_0x166dd5){_0x166dd5=_0x166dd5||0xcc;return function(_0x2269cf){if(_0x2269cf){return _0x2cd221[_0x476f('0x1a')](_0x166dd5);}return _0x2cd221['status'](_0x166dd5)[_0x476f('0x1b')]();};}function respondWithResult(_0xd96e1f,_0x228f07){_0x228f07=_0x228f07||0xc8;return function(_0x559fb7){if(_0x559fb7){return _0xd96e1f['status'](_0x228f07)[_0x476f('0x1c')](_0x559fb7);}};}function respondWithFilteredResult(_0x3209cc,_0x763405){return function(_0x539a57){if(_0x539a57){var _0x9a7aad=typeof _0x763405[_0x476f('0x1d')]==='undefined'&&typeof _0x763405[_0x476f('0x1e')]===_0x476f('0x1f');var _0x44b6c3=_0x539a57[_0x476f('0x20')];var _0x4e7674=_0x9a7aad?0x0:_0x763405['offset'];var _0x1b1185=_0x9a7aad?_0x539a57[_0x476f('0x20')]:_0x763405[_0x476f('0x1d')]+_0x763405[_0x476f('0x1e')];var _0xb952e;if(_0x1b1185>=_0x44b6c3){_0x1b1185=_0x44b6c3;_0xb952e=0xc8;}else{_0xb952e=0xce;}_0x3209cc[_0x476f('0x21')](_0xb952e);return _0x3209cc[_0x476f('0x22')]('Content-Range',_0x4e7674+'-'+_0x1b1185+'/'+_0x44b6c3)['json'](_0x539a57);}return null;};}function patchUpdates(_0x1bfb1e){return function(_0x4932f5){try{jsonpatch[_0x476f('0x23')](_0x4932f5,_0x1bfb1e,!![]);}catch(_0x5b99bb){return BPromise[_0x476f('0x24')](_0x5b99bb);}return _0x4932f5[_0x476f('0x25')]();};}function saveUpdates(_0x56675a,_0x2cf353){return function(_0x1cbe06){if(_0x1cbe06){return _0x1cbe06[_0x476f('0x26')](_0x56675a)[_0x476f('0x27')](function(_0x12931f){return _0x12931f;});}return null;};}function removeEntity(_0x1f446b,_0x59bf13){return function(_0x3944b7){if(_0x3944b7){return _0x3944b7[_0x476f('0x28')]()[_0x476f('0x27')](function(){_0x1f446b['status'](0xcc)[_0x476f('0x1b')]();});}};}function handleEntityNotFound(_0x101acc,_0x37b6dd){return function(_0x1690a2){if(!_0x1690a2){_0x101acc[_0x476f('0x1a')](0x194);}return _0x1690a2;};}function handleError(_0x2a1f15,_0x2fc035){_0x2fc035=_0x2fc035||0x1f4;return function(_0x137c9a){logger[_0x476f('0x29')](_0x137c9a[_0x476f('0x2a')]);if(_0x137c9a['name']){delete _0x137c9a[_0x476f('0x2b')];}_0x2a1f15[_0x476f('0x21')](_0x2fc035)['send'](_0x137c9a);};}exports['index']=function(_0x35e86a,_0xa2a186){var _0x1d1e98={},_0x49ba87={},_0x9218c4={'count':0x0,'rows':[]};var _0x19f580=_[_0x476f('0x2c')](db[_0x476f('0x2d')][_0x476f('0x2e')],function(_0x57e30f){return{'name':_0x57e30f[_0x476f('0x2f')],'type':_0x57e30f['type'][_0x476f('0x30')]};});_0x49ba87[_0x476f('0x31')]=_['map'](_0x19f580,'name');_0x49ba87[_0x476f('0x32')]=_[_0x476f('0x33')](_0x35e86a[_0x476f('0x32')]);_0x49ba87['filters']=_['intersection'](_0x49ba87[_0x476f('0x31')],_0x49ba87[_0x476f('0x32')]);_0x1d1e98[_0x476f('0x34')]=_[_0x476f('0x35')](_0x49ba87[_0x476f('0x31')],qs['fields'](_0x35e86a[_0x476f('0x32')]['fields']));_0x1d1e98[_0x476f('0x34')]=_0x1d1e98[_0x476f('0x34')][_0x476f('0x36')]?_0x1d1e98['attributes']:_0x49ba87[_0x476f('0x31')];if(!_0x35e86a[_0x476f('0x32')][_0x476f('0x37')](_0x476f('0x38'))){_0x1d1e98['limit']=qs[_0x476f('0x1e')](_0x35e86a[_0x476f('0x32')][_0x476f('0x1e')]);_0x1d1e98[_0x476f('0x1d')]=qs[_0x476f('0x1d')](_0x35e86a[_0x476f('0x32')]['offset']);}_0x1d1e98['order']=qs['sort'](_0x35e86a[_0x476f('0x32')][_0x476f('0x39')]);_0x1d1e98[_0x476f('0x3a')]=qs['filters'](_['pick'](_0x35e86a[_0x476f('0x32')],_0x49ba87[_0x476f('0x3b')]),_0x19f580);if(_0x35e86a[_0x476f('0x32')][_0x476f('0x3c')]){_0x1d1e98[_0x476f('0x3a')]=_['merge'](_0x1d1e98[_0x476f('0x3a')],{'$or':_[_0x476f('0x2c')](_0x19f580,function(_0x3d8058){if(_0x3d8058['type']!==_0x476f('0x3d')){var _0x42068d={};_0x42068d[_0x3d8058[_0x476f('0x2b')]]={'$like':'%'+_0x35e86a[_0x476f('0x32')]['filter']+'%'};return _0x42068d;}})});}_0x1d1e98=_[_0x476f('0x3e')]({},_0x1d1e98,_0x35e86a['options']);var _0x12e420={'where':_0x1d1e98[_0x476f('0x3a')]};return db['ZohoField'][_0x476f('0x20')](_0x12e420)[_0x476f('0x27')](function(_0x8dfddd){_0x9218c4[_0x476f('0x20')]=_0x8dfddd;if(_0x35e86a['query'][_0x476f('0x3f')]){_0x1d1e98[_0x476f('0x40')]=[{'all':!![]}];}return db[_0x476f('0x2d')][_0x476f('0x41')](_0x1d1e98);})[_0x476f('0x27')](function(_0x1cad34){_0x9218c4['rows']=_0x1cad34;return _0x9218c4;})[_0x476f('0x27')](respondWithFilteredResult(_0xa2a186,_0x1d1e98))['catch'](handleError(_0xa2a186,null));};exports['show']=function(_0x29da73,_0x1fe5d5){var _0x194a8c={'raw':!![],'where':{'id':_0x29da73['params']['id']}},_0x157a93={};_0x157a93[_0x476f('0x31')]=_[_0x476f('0x33')](db[_0x476f('0x2d')]['rawAttributes']);_0x157a93[_0x476f('0x32')]=_['keys'](_0x29da73['query']);_0x157a93['filters']=_[_0x476f('0x35')](_0x157a93[_0x476f('0x31')],_0x157a93['query']);_0x194a8c['attributes']=_[_0x476f('0x35')](_0x157a93[_0x476f('0x31')],qs[_0x476f('0x42')](_0x29da73[_0x476f('0x32')][_0x476f('0x42')]));_0x194a8c['attributes']=_0x194a8c['attributes'][_0x476f('0x36')]?_0x194a8c[_0x476f('0x34')]:_0x157a93[_0x476f('0x31')];if(_0x29da73[_0x476f('0x32')][_0x476f('0x3f')]){_0x194a8c[_0x476f('0x40')]=[{'all':!![]}];}_0x194a8c=_[_0x476f('0x3e')]({},_0x194a8c,_0x29da73['options']);return db[_0x476f('0x2d')][_0x476f('0x43')](_0x194a8c)[_0x476f('0x27')](handleEntityNotFound(_0x1fe5d5,null))['then'](respondWithResult(_0x1fe5d5,null))['catch'](handleError(_0x1fe5d5,null));};exports[_0x476f('0x44')]=function(_0x341d72,_0x108151){return db[_0x476f('0x2d')]['create'](_0x341d72[_0x476f('0x45')],{})[_0x476f('0x27')](respondWithResult(_0x108151,0xc9))[_0x476f('0x46')](handleError(_0x108151,null));};exports[_0x476f('0x26')]=function(_0x12c6f3,_0x92ab2f){if(_0x12c6f3[_0x476f('0x45')]['id']){delete _0x12c6f3['body']['id'];}return db['ZohoField'][_0x476f('0x43')]({'where':{'id':_0x12c6f3[_0x476f('0x47')]['id']}})['then'](handleEntityNotFound(_0x92ab2f,null))[_0x476f('0x27')](saveUpdates(_0x12c6f3[_0x476f('0x45')],null))['then'](respondWithResult(_0x92ab2f,null))['catch'](handleError(_0x92ab2f,null));};exports[_0x476f('0x28')]=function(_0x5d49d4,_0x1aebb6){return db[_0x476f('0x2d')][_0x476f('0x43')]({'where':{'id':_0x5d49d4['params']['id']}})[_0x476f('0x27')](handleEntityNotFound(_0x1aebb6,null))[_0x476f('0x27')](removeEntity(_0x1aebb6,null))[_0x476f('0x46')](handleError(_0x1aebb6,null));}; \ No newline at end of file +var _0x600f=['query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','filter','options','ZohoField','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','destroy','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','rawAttributes','fieldName','key','model'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x600f,0x6c));var _0xf600=function(_0x456904,_0x4cb25c){_0x456904=_0x456904-0x0;var _0x4b0063=_0x600f[_0x456904];return _0x4b0063;};'use strict';var emlformat=require(_0xf600('0x0'));var rimraf=require(_0xf600('0x1'));var zipdir=require(_0xf600('0x2'));var jsonpatch=require(_0xf600('0x3'));var rp=require(_0xf600('0x4'));var moment=require(_0xf600('0x5'));var BPromise=require(_0xf600('0x6'));var Mustache=require(_0xf600('0x7'));var util=require(_0xf600('0x8'));var path=require(_0xf600('0x9'));var sox=require(_0xf600('0xa'));var csv=require(_0xf600('0xb'));var ejs=require(_0xf600('0xc'));var fs=require('fs');var fs_extra=require(_0xf600('0xd'));var _=require('lodash');var squel=require(_0xf600('0xe'));var crypto=require(_0xf600('0xf'));var jsforce=require(_0xf600('0x10'));var deskjs=require(_0xf600('0x11'));var toCsv=require(_0xf600('0xb'));var querystring=require(_0xf600('0x12'));var Papa=require(_0xf600('0x13'));var Redis=require(_0xf600('0x14'));var authService=require(_0xf600('0x15'));var qs=require(_0xf600('0x16'));var as=require(_0xf600('0x17'));var hardwareService=require(_0xf600('0x18'));var logger=require('../../config/logger')(_0xf600('0x19'));var utils=require(_0xf600('0x1a'));var config=require(_0xf600('0x1b'));var licenseUtil=require(_0xf600('0x1c'));var db=require(_0xf600('0x1d'))['db'];function respondWithStatusCode(_0x12bbd3,_0x118874){_0x118874=_0x118874||0xcc;return function(_0x4b6685){if(_0x4b6685){return _0x12bbd3[_0xf600('0x1e')](_0x118874);}return _0x12bbd3[_0xf600('0x1f')](_0x118874)[_0xf600('0x20')]();};}function respondWithResult(_0x243878,_0x3ed274){_0x3ed274=_0x3ed274||0xc8;return function(_0x6b1d7f){if(_0x6b1d7f){return _0x243878['status'](_0x3ed274)[_0xf600('0x21')](_0x6b1d7f);}};}function respondWithFilteredResult(_0x5d1e19,_0x4a9cf0){return function(_0x133293){if(_0x133293){var _0x1add9c=typeof _0x4a9cf0[_0xf600('0x22')]===_0xf600('0x23')&&typeof _0x4a9cf0[_0xf600('0x24')]===_0xf600('0x23');var _0x116ca0=_0x133293[_0xf600('0x25')];var _0x3fdad5=_0x1add9c?0x0:_0x4a9cf0['offset'];var _0x2c543c=_0x1add9c?_0x133293[_0xf600('0x25')]:_0x4a9cf0[_0xf600('0x22')]+_0x4a9cf0[_0xf600('0x24')];var _0x158189;if(_0x2c543c>=_0x116ca0){_0x2c543c=_0x116ca0;_0x158189=0xc8;}else{_0x158189=0xce;}_0x5d1e19[_0xf600('0x1f')](_0x158189);return _0x5d1e19['set'](_0xf600('0x26'),_0x3fdad5+'-'+_0x2c543c+'/'+_0x116ca0)['json'](_0x133293);}return null;};}function patchUpdates(_0x5770b5){return function(_0x729009){try{jsonpatch[_0xf600('0x27')](_0x729009,_0x5770b5,!![]);}catch(_0x3f0639){return BPromise[_0xf600('0x28')](_0x3f0639);}return _0x729009['save']();};}function saveUpdates(_0x263618,_0x5e44b8){return function(_0x36132a){if(_0x36132a){return _0x36132a[_0xf600('0x29')](_0x263618)[_0xf600('0x2a')](function(_0x5cb33e){return _0x5cb33e;});}return null;};}function removeEntity(_0xc41254,_0x33f658){return function(_0x424e49){if(_0x424e49){return _0x424e49['destroy']()[_0xf600('0x2a')](function(){_0xc41254[_0xf600('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ccb8c,_0x590f4d){return function(_0x311b64){if(!_0x311b64){_0x1ccb8c['sendStatus'](0x194);}return _0x311b64;};}function handleError(_0x2099d0,_0x594fd9){_0x594fd9=_0x594fd9||0x1f4;return function(_0x5cb3f9){logger[_0xf600('0x2b')](_0x5cb3f9['stack']);if(_0x5cb3f9[_0xf600('0x2c')]){delete _0x5cb3f9['name'];}_0x2099d0[_0xf600('0x1f')](_0x594fd9)[_0xf600('0x2d')](_0x5cb3f9);};}exports['index']=function(_0xf03f6f,_0x22911b){var _0x2e01b1={},_0x339c1d={},_0x5f5e0f={'count':0x0,'rows':[]};var _0x997d56=_['map'](db['ZohoField'][_0xf600('0x2e')],function(_0x463191){return{'name':_0x463191[_0xf600('0x2f')],'type':_0x463191['type'][_0xf600('0x30')]};});_0x339c1d[_0xf600('0x31')]=_['map'](_0x997d56,_0xf600('0x2c'));_0x339c1d['query']=_['keys'](_0xf03f6f[_0xf600('0x32')]);_0x339c1d[_0xf600('0x33')]=_[_0xf600('0x34')](_0x339c1d['model'],_0x339c1d[_0xf600('0x32')]);_0x2e01b1[_0xf600('0x35')]=_[_0xf600('0x34')](_0x339c1d[_0xf600('0x31')],qs[_0xf600('0x36')](_0xf03f6f[_0xf600('0x32')][_0xf600('0x36')]));_0x2e01b1[_0xf600('0x35')]=_0x2e01b1[_0xf600('0x35')][_0xf600('0x37')]?_0x2e01b1[_0xf600('0x35')]:_0x339c1d['model'];if(!_0xf03f6f[_0xf600('0x32')][_0xf600('0x38')]('nolimit')){_0x2e01b1[_0xf600('0x24')]=qs['limit'](_0xf03f6f[_0xf600('0x32')][_0xf600('0x24')]);_0x2e01b1['offset']=qs['offset'](_0xf03f6f['query'][_0xf600('0x22')]);}_0x2e01b1[_0xf600('0x39')]=qs['sort'](_0xf03f6f[_0xf600('0x32')][_0xf600('0x3a')]);_0x2e01b1[_0xf600('0x3b')]=qs[_0xf600('0x33')](_[_0xf600('0x3c')](_0xf03f6f[_0xf600('0x32')],_0x339c1d[_0xf600('0x33')]),_0x997d56);if(_0xf03f6f['query']['filter']){_0x2e01b1[_0xf600('0x3b')]=_[_0xf600('0x3d')](_0x2e01b1[_0xf600('0x3b')],{'$or':_[_0xf600('0x3e')](_0x997d56,function(_0x1650e7){if(_0x1650e7['type']!==_0xf600('0x3f')){var _0xccabed={};_0xccabed[_0x1650e7[_0xf600('0x2c')]]={'$like':'%'+_0xf03f6f[_0xf600('0x32')][_0xf600('0x40')]+'%'};return _0xccabed;}})});}_0x2e01b1=_['merge']({},_0x2e01b1,_0xf03f6f[_0xf600('0x41')]);var _0x1f221f={'where':_0x2e01b1[_0xf600('0x3b')]};return db[_0xf600('0x42')]['count'](_0x1f221f)[_0xf600('0x2a')](function(_0xfe4faa){_0x5f5e0f[_0xf600('0x25')]=_0xfe4faa;if(_0xf03f6f[_0xf600('0x32')]['includeAll']){_0x2e01b1[_0xf600('0x43')]=[{'all':!![]}];}return db[_0xf600('0x42')][_0xf600('0x44')](_0x2e01b1);})[_0xf600('0x2a')](function(_0x446292){_0x5f5e0f[_0xf600('0x45')]=_0x446292;return _0x5f5e0f;})['then'](respondWithFilteredResult(_0x22911b,_0x2e01b1))[_0xf600('0x46')](handleError(_0x22911b,null));};exports[_0xf600('0x47')]=function(_0x2c1225,_0x29ab98){var _0x2cd31c={'raw':!![],'where':{'id':_0x2c1225[_0xf600('0x48')]['id']}},_0x49cce6={};_0x49cce6[_0xf600('0x31')]=_[_0xf600('0x49')](db['ZohoField'][_0xf600('0x2e')]);_0x49cce6[_0xf600('0x32')]=_[_0xf600('0x49')](_0x2c1225[_0xf600('0x32')]);_0x49cce6['filters']=_[_0xf600('0x34')](_0x49cce6[_0xf600('0x31')],_0x49cce6[_0xf600('0x32')]);_0x2cd31c['attributes']=_[_0xf600('0x34')](_0x49cce6[_0xf600('0x31')],qs[_0xf600('0x36')](_0x2c1225[_0xf600('0x32')][_0xf600('0x36')]));_0x2cd31c[_0xf600('0x35')]=_0x2cd31c[_0xf600('0x35')]['length']?_0x2cd31c[_0xf600('0x35')]:_0x49cce6[_0xf600('0x31')];if(_0x2c1225['query'][_0xf600('0x4a')]){_0x2cd31c[_0xf600('0x43')]=[{'all':!![]}];}_0x2cd31c=_['merge']({},_0x2cd31c,_0x2c1225['options']);return db[_0xf600('0x42')][_0xf600('0x4b')](_0x2cd31c)[_0xf600('0x2a')](handleEntityNotFound(_0x29ab98,null))[_0xf600('0x2a')](respondWithResult(_0x29ab98,null))[_0xf600('0x46')](handleError(_0x29ab98,null));};exports[_0xf600('0x4c')]=function(_0x370086,_0x173935){return db[_0xf600('0x42')]['create'](_0x370086[_0xf600('0x4d')],{})['then'](respondWithResult(_0x173935,0xc9))[_0xf600('0x46')](handleError(_0x173935,null));};exports[_0xf600('0x29')]=function(_0xc4493a,_0xda6f57){if(_0xc4493a[_0xf600('0x4d')]['id']){delete _0xc4493a[_0xf600('0x4d')]['id'];}return db['ZohoField']['find']({'where':{'id':_0xc4493a[_0xf600('0x48')]['id']}})[_0xf600('0x2a')](handleEntityNotFound(_0xda6f57,null))[_0xf600('0x2a')](saveUpdates(_0xc4493a[_0xf600('0x4d')],null))[_0xf600('0x2a')](respondWithResult(_0xda6f57,null))[_0xf600('0x46')](handleError(_0xda6f57,null));};exports[_0xf600('0x4e')]=function(_0x5ce952,_0x36db4f){return db[_0xf600('0x42')][_0xf600('0x4b')]({'where':{'id':_0x5ce952['params']['id']}})[_0xf600('0x2a')](handleEntityNotFound(_0x36db4f,null))['then'](removeEntity(_0x36db4f,null))[_0xf600('0x46')](handleError(_0x36db4f,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index fa88e3b..6ac0be4 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 _0x3a6d=['../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x2e440a,_0x46451a){var _0x43c79a=function(_0x1fc6ee){while(--_0x1fc6ee){_0x2e440a['push'](_0x2e440a['shift']());}};_0x43c79a(++_0x46451a);}(_0x3a6d,0x143));var _0xd3a6=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x3a6d[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var logger=require('../../config/logger')(_0xd3a6('0x2'));var moment=require(_0xd3a6('0x3'));var BPromise=require(_0xd3a6('0x4'));var rp=require(_0xd3a6('0x5'));var fs=require('fs');var path=require(_0xd3a6('0x6'));var rimraf=require('rimraf');var config=require(_0xd3a6('0x7'));var attributes=require(_0xd3a6('0x8'));module[_0xd3a6('0x9')]=function(_0x1fc450,_0x25b042){return _0x1fc450[_0xd3a6('0xa')]('ZohoField',attributes,{'tableName':_0xd3a6('0xb'),'paranoid':![],'indexes':[{'name':_0xd3a6('0xc'),'fields':[_0xd3a6('0xd'),_0xd3a6('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8aad=['request-promise','../../config/environment','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','bluebird'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x8aad,0x146));var _0xd8aa=function(_0x40c4d9,_0x10ab89){_0x40c4d9=_0x40c4d9-0x0;var _0x270fe8=_0x8aad[_0x40c4d9];return _0x270fe8;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require('../../config/logger')(_0xd8aa('0x2'));var moment=require('moment');var BPromise=require(_0xd8aa('0x3'));var rp=require(_0xd8aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8aa('0x5'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x16b648,_0x43ddeb){return _0x16b648[_0xd8aa('0x6')]('ZohoField',attributes,{'tableName':_0xd8aa('0x7'),'paranoid':![],'indexes':[{'name':_0xd8aa('0x8'),'fields':[_0xd8aa('0x9'),_0xd8aa('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 3bad175..ca011bb 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 _0x4196=['../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x29c6de,_0x194ca8){var _0x18385f=function(_0x51c2da){while(--_0x51c2da){_0x29c6de['push'](_0x29c6de['shift']());}};_0x18385f(++_0x194ca8);}(_0x4196,0xf6));var _0x6419=function(_0x11973d,_0x68c443){_0x11973d=_0x11973d-0x0;var _0x2875e3=_0x4196[_0x11973d];return _0x2875e3;};'use strict';var _=require(_0x6419('0x0'));var util=require(_0x6419('0x1'));var moment=require(_0x6419('0x2'));var BPromise=require(_0x6419('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6419('0x4'));var db=require(_0x6419('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6419('0x6'))('rpc');var config=require(_0x6419('0x7'));var jayson=require(_0x6419('0x8'));var client=jayson[_0x6419('0x9')][_0x6419('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56ee8c,_0x54f9aa,_0x55748){return new BPromise(function(_0x2449b0,_0x16930a){return client[_0x6419('0xb')](_0x56ee8c,_0x55748)[_0x6419('0xc')](function(_0x113e03){logger['info'](_0x6419('0xd'),_0x54f9aa,'request\x20sent');logger[_0x6419('0xe')](_0x6419('0xf'),_0x54f9aa,'request\x20sent',JSON['stringify'](_0x113e03));if(_0x113e03['error']){if(_0x113e03[_0x6419('0x10')][_0x6419('0x11')]===0x1f4){logger['error'](_0x6419('0xd'),_0x54f9aa,_0x113e03['error'][_0x6419('0x12')]);return _0x16930a(_0x113e03['error'][_0x6419('0x12')]);}logger['error'](_0x6419('0xd'),_0x54f9aa,_0x113e03[_0x6419('0x10')]['message']);return _0x2449b0(_0x113e03[_0x6419('0x10')][_0x6419('0x12')]);}else{logger[_0x6419('0x13')](_0x6419('0xd'),_0x54f9aa,_0x6419('0x14'));_0x2449b0(_0x113e03[_0x6419('0x15')][_0x6419('0x12')]);}})[_0x6419('0x16')](function(_0x244e10){logger['error'](_0x6419('0xd'),_0x54f9aa,_0x244e10);_0x16930a(_0x244e10);});});} \ No newline at end of file +var _0x7f44=['debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x120f67,_0x70c3af){var _0x1c117e=function(_0x3539e2){while(--_0x3539e2){_0x120f67['push'](_0x120f67['shift']());}};_0x1c117e(++_0x70c3af);}(_0x7f44,0xa8));var _0x47f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7f44[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x47f4('0x0'));var util=require(_0x47f4('0x1'));var moment=require(_0x47f4('0x2'));var BPromise=require(_0x47f4('0x3'));var rs=require(_0x47f4('0x4'));var fs=require('fs');var Redis=require(_0x47f4('0x5'));var db=require(_0x47f4('0x6'))['db'];var utils=require(_0x47f4('0x7'));var logger=require('../../config/logger')(_0x47f4('0x8'));var config=require(_0x47f4('0x9'));var jayson=require(_0x47f4('0xa'));var client=jayson['client'][_0x47f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d370a,_0x5d3200,_0x2a67a7){return new BPromise(function(_0x4d0081,_0x331146){return client[_0x47f4('0xc')](_0x1d370a,_0x2a67a7)['then'](function(_0x20e5ad){logger[_0x47f4('0xd')](_0x47f4('0xe'),_0x5d3200,_0x47f4('0xf'));logger[_0x47f4('0x10')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x5d3200,_0x47f4('0xf'),JSON[_0x47f4('0x11')](_0x20e5ad));if(_0x20e5ad[_0x47f4('0x12')]){if(_0x20e5ad[_0x47f4('0x12')][_0x47f4('0x13')]===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x5d3200,_0x20e5ad['error'][_0x47f4('0x14')]);return _0x331146(_0x20e5ad[_0x47f4('0x12')][_0x47f4('0x14')]);}logger['error'](_0x47f4('0xe'),_0x5d3200,_0x20e5ad[_0x47f4('0x12')][_0x47f4('0x14')]);return _0x4d0081(_0x20e5ad[_0x47f4('0x12')][_0x47f4('0x14')]);}else{logger[_0x47f4('0xd')](_0x47f4('0xe'),_0x5d3200,_0x47f4('0xf'));_0x4d0081(_0x20e5ad[_0x47f4('0x15')][_0x47f4('0x14')]);}})[_0x47f4('0x16')](function(_0x3e8506){logger[_0x47f4('0x12')](_0x47f4('0xe'),_0x5d3200,_0x3e8506);_0x331146(_0x3e8506);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 55de030..52e54a2 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5a3a12,_0x143319){var _0x988fe9=function(_0x4d401d){while(--_0x4d401d){_0x5a3a12['push'](_0x5a3a12['shift']());}};_0x988fe9(++_0x143319);}(_0xe706,0xa3));var _0x6e70=function(_0x20c757,_0xf1f53b){_0x20c757=_0x20c757-0x0;var _0x2720f3=_0xe706[_0x20c757];return _0x2720f3;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x16aab9,_0x54bfdc){var _0x502923=function(_0x580a44){while(--_0x580a44){_0x16aab9['push'](_0x16aab9['shift']());}};_0x502923(++_0x54bfdc);}(_0xedd9,0xfc));var _0x9edd=function(_0x3b8b97,_0x3f7991){_0x3b8b97=_0x3b8b97-0x0;var _0x34c233=_0xedd9[_0x3b8b97];return _0x34c233;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 5404061..3a70f76 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 _0x7b05=['STRING','unique_name_and_version','app.js','INTEGER','state','sequelize','exports'];(function(_0x4bd533,_0x4ffe6e){var _0x2d2196=function(_0x1f68cc){while(--_0x1f68cc){_0x4bd533['push'](_0x4bd533['shift']());}};_0x2d2196(++_0x4ffe6e);}(_0x7b05,0x91));var _0x57b0=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0x7b05[_0x5ec454];return _0x5ebf50;};'use strict';var Sequelize=require(_0x57b0('0x0'));module[_0x57b0('0x1')]={'name':{'type':Sequelize[_0x57b0('0x2')],'allowNull':![],'unique':_0x57b0('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x57b0('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x57b0('0x4')},'filename':{'type':Sequelize[_0x57b0('0x2')]},'path':{'type':Sequelize[_0x57b0('0x2')]},'type':{'type':Sequelize[_0x57b0('0x2')]},'size':{'type':Sequelize[_0x57b0('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x57b0('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x57b0('0x2')],'unique':_0x57b0('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x4679=['state','sequelize','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x30be97,_0x3ea719){var _0x1d3a90=function(_0x512e8a){while(--_0x512e8a){_0x30be97['push'](_0x30be97['shift']());}};_0x1d3a90(++_0x3ea719);}(_0x4679,0xb0));var _0x9467=function(_0x33e16b,_0x5d4326){_0x33e16b=_0x33e16b-0x0;var _0x8dd4ff=_0x4679[_0x33e16b];return _0x8dd4ff;};'use strict';var Sequelize=require(_0x9467('0x0'));module['exports']={'name':{'type':Sequelize[_0x9467('0x1')],'allowNull':![],'unique':_0x9467('0x2')},'version':{'type':Sequelize[_0x9467('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x9467('0x1')],'defaultValue':_0x9467('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x9467('0x4')]},'active':{'type':Sequelize[_0x9467('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x9467('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0x9467('0x6')},'description':{'type':Sequelize[_0x9467('0x1')]},'title':{'type':Sequelize[_0x9467('0x1')]},'remoteUri':{'type':Sequelize[_0x9467('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 3fe6c20..f8a53cc 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 _0x687b=['order','sort','where','filter','VIRTUAL','options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x1f9ee0,_0x2152a2){var _0x4274b5=function(_0x4c72bd){while(--_0x4c72bd){_0x1f9ee0['push'](_0x1f9ee0['shift']());}};_0x4274b5(++_0x2152a2);}(_0x687b,0x14a));var _0xb687=function(_0x3245f7,_0x26bfad){_0x3245f7=_0x3245f7-0x0;var _0x472f77=_0x687b[_0x3245f7];return _0x472f77;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['Integration'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['Integration']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));}; \ No newline at end of file +var _0xfcf0=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','model','map','keys','query','filters'];(function(_0x39feff,_0x112cb6){var _0x563a66=function(_0xdb9814){while(--_0xdb9814){_0x39feff['push'](_0x39feff['shift']());}};_0x563a66(++_0x112cb6);}(_0xfcf0,0x138));var _0x0fcf=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0xfcf0[_0x2d982d];return _0x4f36b0;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 50cafcf..411fa0a 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 _0x3e6d=['moment','bluebird','path','rimraf','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger'];(function(_0x51bad2,_0x531872){var _0x21d085=function(_0xa8fd03){while(--_0xa8fd03){_0x51bad2['push'](_0x51bad2['shift']());}};_0x21d085(++_0x531872);}(_0x3e6d,0x99));var _0xd3e6=function(_0x2868e9,_0x199937){_0x2868e9=_0x2868e9-0x0;var _0x5b6e90=_0x3e6d[_0x2868e9];return _0x5b6e90;};'use strict';var _=require(_0xd3e6('0x0'));var util=require(_0xd3e6('0x1'));var logger=require(_0xd3e6('0x2'))('api');var moment=require(_0xd3e6('0x3'));var BPromise=require(_0xd3e6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3e6('0x5'));var rimraf=require(_0xd3e6('0x6'));var config=require('../../config/environment');var attributes=require(_0xd3e6('0x7'));module[_0xd3e6('0x8')]=function(_0x225c29,_0x2d8fe6){return _0x225c29[_0xd3e6('0x9')](_0xd3e6('0xa'),attributes,{'tableName':_0xd3e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf866=['integrations','lodash','../../config/logger','api','moment','request-promise','rimraf','./integration.attributes','exports'];(function(_0x4b00fb,_0x1962b4){var _0x36b890=function(_0x4f237f){while(--_0x4f237f){_0x4b00fb['push'](_0x4b00fb['shift']());}};_0x36b890(++_0x1962b4);}(_0xf866,0x9a));var _0x6f86=function(_0x207df2,_0x2ecf7b){_0x207df2=_0x207df2-0x0;var _0xc4ef06=_0xf866[_0x207df2];return _0xc4ef06;};'use strict';var _=require(_0x6f86('0x0'));var util=require('util');var logger=require(_0x6f86('0x1'))(_0x6f86('0x2'));var moment=require(_0x6f86('0x3'));var BPromise=require('bluebird');var rp=require(_0x6f86('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f86('0x5'));var config=require('../../config/environment');var attributes=require(_0x6f86('0x6'));module[_0x6f86('0x7')]=function(_0x2766ff,_0x596bee){return _0x2766ff['define']('Integration',attributes,{'tableName':_0x6f86('0x8'),'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 775f155..b23d0e1 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2a43fc,_0x3f309f){var _0x3c5022=function(_0x257102){while(--_0x257102){_0x2a43fc['push'](_0x2a43fc['shift']());}};_0x3c5022(++_0x3f309f);}(_0x2ef3,0xba));var _0x32ef=function(_0x46cb77,_0x167558){_0x46cb77=_0x46cb77-0x0;var _0x441362=_0x2ef3[_0x46cb77];return _0x441362;};'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')]('Integration,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('Integration,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x896e=['Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x5f1fe5,_0x48e260){var _0x4169be=function(_0x38e261){while(--_0x38e261){_0x5f1fe5['push'](_0x5f1fe5['shift']());}};_0x4169be(++_0x48e260);}(_0x896e,0x1e9));var _0xe896=function(_0x4aaf57,_0x21bdc1){_0x4aaf57=_0x4aaf57-0x0;var _0x16db25=_0x896e[_0x4aaf57];return _0x16db25;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('Integration,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('Integration,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 4cb8f26..0d7b7de 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x55da42,_0x1e3f2b){var _0x43b074=function(_0x10da8c){while(--_0x10da8c){_0x55da42['push'](_0x55da42['shift']());}};_0x43b074(++_0x1e3f2b);}(_0x2542,0x169));var _0x2254=function(_0x39d388,_0x1687ae){_0x39d388=_0x39d388-0x0;var _0xdddc85=_0x2542[_0x39d388];return _0xdddc85;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router; \ No newline at end of file +var _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(_0x445527,_0x8227b9){var _0xb915c7=function(_0x1fb76b){while(--_0x1fb76b){_0x445527['push'](_0x445527['shift']());}};_0xb915c7(++_0x8227b9);}(_0x1261,0x144));var _0x1126=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0x1261[_0x2a558d];return _0xa7bc9c;};'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 59cbeb6..e919434 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 _0x1386=['SENDING','RECEIVED','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','SENT'];(function(_0xd4b59c,_0x3aace8){var _0x979293=function(_0xeae34d){while(--_0xeae34d){_0xd4b59c['push'](_0xd4b59c['shift']());}};_0x979293(++_0x3aace8);}(_0x1386,0x1f2));var _0x6138=function(_0x4624c4,_0x2620c9){_0x4624c4=_0x4624c4-0x0;var _0x3c0d60=_0x1386[_0x4624c4];return _0x3c0d60;};'use strict';var Sequelize=require(_0x6138('0x0'));module[_0x6138('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x6138('0x2')]},'exitStatus':{'type':Sequelize[_0x6138('0x2')]},'ticketId':{'type':Sequelize[_0x6138('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x6138('0x2')]},'uniqueid':{'type':Sequelize[_0x6138('0x2')]},'calleridnum':{'type':Sequelize[_0x6138('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x6138('0x2')]},'interface':{'type':Sequelize[_0x6138('0x2')]},'membername':{'type':Sequelize[_0x6138('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x6138('0x3')]},'holdtime':{'type':Sequelize[_0x6138('0x4')]},'agentcomplete':{'type':Sequelize[_0x6138('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6138('0x3')]},'talktime':{'type':Sequelize[_0x6138('0x4')]},'agentacw':{'type':Sequelize[_0x6138('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6138('0x4')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x6138('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6138('0x3')]},'agentdump':{'type':Sequelize[_0x6138('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6138('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6138('0x4')]},'channelstatedesc':{'type':Sequelize[_0x6138('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6138('0x2')]},'connectedlinename':{'type':Sequelize[_0x6138('0x2')]},'language':{'type':Sequelize[_0x6138('0x2')]},'accountcode':{'type':Sequelize[_0x6138('0x2')]},'context':{'type':Sequelize[_0x6138('0x2')]},'exten':{'type':Sequelize[_0x6138('0x2')]},'priority':{'type':Sequelize[_0x6138('0x2')]},'destchannel':{'type':Sequelize[_0x6138('0x2')]},'destchannelstate':{'type':Sequelize[_0x6138('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x6138('0x2')]},'destcalleridnum':{'type':Sequelize[_0x6138('0x2')]},'destcalleridname':{'type':Sequelize[_0x6138('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x6138('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6138('0x2')]},'destlanguage':{'type':Sequelize[_0x6138('0x2')]},'destaccountcode':{'type':Sequelize[_0x6138('0x2')]},'destcontext':{'type':Sequelize[_0x6138('0x2')]},'destexten':{'type':Sequelize[_0x6138('0x2')]},'destpriority':{'type':Sequelize[_0x6138('0x2')]},'destuniqueid':{'type':Sequelize[_0x6138('0x2')]},'messageId':{'type':Sequelize[_0x6138('0x2')]},'inReplyTo':{'type':Sequelize[_0x6138('0x2')]},'subject':{'type':Sequelize[_0x6138('0x2')]},'from':{'type':Sequelize[_0x6138('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6138('0x2')]},'attachment':{'type':Sequelize[_0x6138('0x6')]},'html':{'type':Sequelize[_0x6138('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0x6138('0x7'),_0x6138('0x8'),_0x6138('0x9'),_0x6138('0xa'))},'url':{'type':Sequelize[_0x6138('0x2')]},'app':{'type':Sequelize[_0x6138('0x2')]},'appdata':{'type':Sequelize[_0x6138('0x2')]},'projectId':{'type':Sequelize[_0x6138('0x4')]}}; \ No newline at end of file +var _0xc13b=['TEXT','ENUM','SENDING','sequelize','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x20e166,_0x284483){var _0x4e6887=function(_0x31d4ef){while(--_0x31d4ef){_0x20e166['push'](_0x20e166['shift']());}};_0x4e6887(++_0x284483);}(_0xc13b,0x1db));var _0xbc13=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xc13b[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require(_0xbc13('0x0'));module['exports']={'integration':{'type':Sequelize[_0xbc13('0x1')]},'eventChannel':{'type':Sequelize[_0xbc13('0x1')]},'exitStatus':{'type':Sequelize[_0xbc13('0x1')]},'ticketId':{'type':Sequelize[_0xbc13('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xbc13('0x1')]},'uniqueid':{'type':Sequelize[_0xbc13('0x1')]},'calleridnum':{'type':Sequelize[_0xbc13('0x1')]},'calleridname':{'type':Sequelize[_0xbc13('0x1')]},'queue':{'type':Sequelize[_0xbc13('0x1')]},'interface':{'type':Sequelize[_0xbc13('0x1')]},'membername':{'type':Sequelize[_0xbc13('0x1')]},'agentcalledAt':{'type':Sequelize[_0xbc13('0x2')]},'agentconnectAt':{'type':Sequelize[_0xbc13('0x2')]},'holdtime':{'type':Sequelize[_0xbc13('0x3')]},'agentcomplete':{'type':Sequelize[_0xbc13('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xbc13('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbc13('0x3')]},'reason':{'type':Sequelize[_0xbc13('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xbc13('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xbc13('0x2')]},'agentdump':{'type':Sequelize[_0xbc13('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbc13('0x1')]},'channelstate':{'type':Sequelize[_0xbc13('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xbc13('0x1')]},'language':{'type':Sequelize[_0xbc13('0x1')]},'accountcode':{'type':Sequelize[_0xbc13('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xbc13('0x1')]},'priority':{'type':Sequelize[_0xbc13('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xbc13('0x1')]},'destcalleridnum':{'type':Sequelize[_0xbc13('0x1')]},'destcalleridname':{'type':Sequelize[_0xbc13('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xbc13('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xbc13('0x1')]},'destlanguage':{'type':Sequelize[_0xbc13('0x1')]},'destaccountcode':{'type':Sequelize[_0xbc13('0x1')]},'destcontext':{'type':Sequelize[_0xbc13('0x1')]},'destexten':{'type':Sequelize[_0xbc13('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xbc13('0x1')]},'messageId':{'type':Sequelize[_0xbc13('0x1')]},'inReplyTo':{'type':Sequelize[_0xbc13('0x1')]},'subject':{'type':Sequelize[_0xbc13('0x1')]},'from':{'type':Sequelize[_0xbc13('0x1')]},'to':{'type':Sequelize[_0xbc13('0x1')]},'cc':{'type':Sequelize[_0xbc13('0x1')]},'attachment':{'type':Sequelize[_0xbc13('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xbc13('0x5')]},'status':{'type':Sequelize[_0xbc13('0x6')]('SENT',_0xbc13('0x7'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0xbc13('0x1')]},'app':{'type':Sequelize[_0xbc13('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xbc13('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index a076ac1..720013b 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 _0x31e4=['stack','name','send','index','map','IntegrationReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','count','includeAll','include','findAll','show','params','keys','rawAttributes','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error'];(function(_0xda788c,_0x1528eb){var _0x1bc137=function(_0x2a5bdc){while(--_0x2a5bdc){_0xda788c['push'](_0xda788c['shift']());}};_0x1bc137(++_0x1528eb);}(_0x31e4,0xf9));var _0x431e=function(_0x3dc089,_0x5ccb0d){_0x3dc089=_0x3dc089-0x0;var _0x34d9d3=_0x31e4[_0x3dc089];return _0x34d9d3;};'use strict';var emlformat=require(_0x431e('0x0'));var rimraf=require(_0x431e('0x1'));var zipdir=require(_0x431e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x431e('0x3'));var moment=require(_0x431e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x431e('0x5'));var sox=require(_0x431e('0x6'));var csv=require(_0x431e('0x7'));var ejs=require(_0x431e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x431e('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x431e('0xa'));var deskjs=require(_0x431e('0xb'));var toCsv=require(_0x431e('0x7'));var querystring=require('querystring');var Papa=require(_0x431e('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x431e('0xd'));var as=require(_0x431e('0xe'));var hardwareService=require(_0x431e('0xf'));var logger=require(_0x431e('0x10'))(_0x431e('0x11'));var utils=require(_0x431e('0x12'));var config=require(_0x431e('0x13'));var licenseUtil=require(_0x431e('0x14'));var db=require(_0x431e('0x15'))['db'];function respondWithStatusCode(_0x30363c,_0x4dbada){_0x4dbada=_0x4dbada||0xcc;return function(_0x1ad8f6){if(_0x1ad8f6){return _0x30363c['sendStatus'](_0x4dbada);}return _0x30363c[_0x431e('0x16')](_0x4dbada)[_0x431e('0x17')]();};}function respondWithResult(_0x54c42d,_0x25d358){_0x25d358=_0x25d358||0xc8;return function(_0x227844){if(_0x227844){return _0x54c42d['status'](_0x25d358)['json'](_0x227844);}};}function respondWithFilteredResult(_0x1b9c6a,_0x5b8828){return function(_0xd9f351){if(_0xd9f351){var _0x24186a=typeof _0x5b8828['offset']==='undefined'&&typeof _0x5b8828['limit']==='undefined';var _0x2b8399=_0xd9f351['count'];var _0x3876fb=_0x24186a?0x0:_0x5b8828[_0x431e('0x18')];var _0x48e7ee=_0x24186a?_0xd9f351['count']:_0x5b8828[_0x431e('0x18')]+_0x5b8828[_0x431e('0x19')];var _0x3e6e14;if(_0x48e7ee>=_0x2b8399){_0x48e7ee=_0x2b8399;_0x3e6e14=0xc8;}else{_0x3e6e14=0xce;}_0x1b9c6a['status'](_0x3e6e14);return _0x1b9c6a['set'](_0x431e('0x1a'),_0x3876fb+'-'+_0x48e7ee+'/'+_0x2b8399)[_0x431e('0x1b')](_0xd9f351);}return null;};}function patchUpdates(_0x3ecac0){return function(_0x157849){try{jsonpatch[_0x431e('0x1c')](_0x157849,_0x3ecac0,!![]);}catch(_0x4d58ed){return BPromise[_0x431e('0x1d')](_0x4d58ed);}return _0x157849[_0x431e('0x1e')]();};}function saveUpdates(_0x4ac4bb,_0xd60ce){return function(_0x2d476a){if(_0x2d476a){return _0x2d476a[_0x431e('0x1f')](_0x4ac4bb)[_0x431e('0x20')](function(_0x4f871d){return _0x4f871d;});}return null;};}function removeEntity(_0x111409,_0x5a85a5){return function(_0x4ee8a8){if(_0x4ee8a8){return _0x4ee8a8[_0x431e('0x21')]()['then'](function(){_0x111409[_0x431e('0x16')](0xcc)[_0x431e('0x17')]();});}};}function handleEntityNotFound(_0x49b213,_0xbd5713){return function(_0x3a97c6){if(!_0x3a97c6){_0x49b213['sendStatus'](0x194);}return _0x3a97c6;};}function handleError(_0x30f9d9,_0x417d8e){_0x417d8e=_0x417d8e||0x1f4;return function(_0x4945ba){logger[_0x431e('0x22')](_0x4945ba[_0x431e('0x23')]);if(_0x4945ba[_0x431e('0x24')]){delete _0x4945ba[_0x431e('0x24')];}_0x30f9d9[_0x431e('0x16')](_0x417d8e)[_0x431e('0x25')](_0x4945ba);};}exports[_0x431e('0x26')]=function(_0x1d3203,_0x1d4fa3){var _0x5d873b={},_0xd6014d={},_0x1f0c29={'count':0x0,'rows':[]};var _0x1668e1=_[_0x431e('0x27')](db[_0x431e('0x28')]['rawAttributes'],function(_0x73292b){return{'name':_0x73292b[_0x431e('0x29')],'type':_0x73292b[_0x431e('0x2a')][_0x431e('0x2b')]};});_0xd6014d[_0x431e('0x2c')]=_[_0x431e('0x27')](_0x1668e1,_0x431e('0x24'));_0xd6014d[_0x431e('0x2d')]=_['keys'](_0x1d3203[_0x431e('0x2d')]);_0xd6014d[_0x431e('0x2e')]=_[_0x431e('0x2f')](_0xd6014d['model'],_0xd6014d[_0x431e('0x2d')]);_0x5d873b[_0x431e('0x30')]=_['intersection'](_0xd6014d['model'],qs['fields'](_0x1d3203[_0x431e('0x2d')][_0x431e('0x31')]));_0x5d873b['attributes']=_0x5d873b[_0x431e('0x30')][_0x431e('0x32')]?_0x5d873b['attributes']:_0xd6014d[_0x431e('0x2c')];if(!_0x1d3203[_0x431e('0x2d')][_0x431e('0x33')]('nolimit')){_0x5d873b[_0x431e('0x19')]=qs[_0x431e('0x19')](_0x1d3203[_0x431e('0x2d')]['limit']);_0x5d873b[_0x431e('0x18')]=qs[_0x431e('0x18')](_0x1d3203[_0x431e('0x2d')][_0x431e('0x18')]);}_0x5d873b['order']=qs[_0x431e('0x34')](_0x1d3203[_0x431e('0x2d')][_0x431e('0x34')]);_0x5d873b['where']=qs[_0x431e('0x2e')](_[_0x431e('0x35')](_0x1d3203[_0x431e('0x2d')],_0xd6014d['filters']),_0x1668e1);if(_0x1d3203[_0x431e('0x2d')][_0x431e('0x36')]){_0x5d873b['where']=_[_0x431e('0x37')](_0x5d873b[_0x431e('0x38')],{'$or':_[_0x431e('0x27')](_0x1668e1,function(_0x3dbbb6){if(_0x3dbbb6[_0x431e('0x2a')]!=='VIRTUAL'){var _0x243cd0={};_0x243cd0[_0x3dbbb6[_0x431e('0x24')]]={'$like':'%'+_0x1d3203['query'][_0x431e('0x36')]+'%'};return _0x243cd0;}})});}_0x5d873b=_[_0x431e('0x37')]({},_0x5d873b,_0x1d3203['options']);var _0x520c63={'where':_0x5d873b[_0x431e('0x38')]};return db[_0x431e('0x28')][_0x431e('0x39')](_0x520c63)[_0x431e('0x20')](function(_0x112466){_0x1f0c29[_0x431e('0x39')]=_0x112466;if(_0x1d3203['query'][_0x431e('0x3a')]){_0x5d873b[_0x431e('0x3b')]=[{'all':!![]}];}return db[_0x431e('0x28')][_0x431e('0x3c')](_0x5d873b);})[_0x431e('0x20')](function(_0x77452b){_0x1f0c29['rows']=_0x77452b;return _0x1f0c29;})[_0x431e('0x20')](respondWithFilteredResult(_0x1d4fa3,_0x5d873b))['catch'](handleError(_0x1d4fa3,null));};exports[_0x431e('0x3d')]=function(_0x4dccf8,_0x5273ba){var _0x5bc5c4={'raw':![],'where':{'id':_0x4dccf8[_0x431e('0x3e')]['id']}},_0x22b217={};_0x22b217[_0x431e('0x2c')]=_[_0x431e('0x3f')](db[_0x431e('0x28')][_0x431e('0x40')]);_0x22b217[_0x431e('0x2d')]=_[_0x431e('0x3f')](_0x4dccf8[_0x431e('0x2d')]);_0x22b217[_0x431e('0x2e')]=_[_0x431e('0x2f')](_0x22b217[_0x431e('0x2c')],_0x22b217['query']);_0x5bc5c4[_0x431e('0x30')]=_[_0x431e('0x2f')](_0x22b217[_0x431e('0x2c')],qs['fields'](_0x4dccf8[_0x431e('0x2d')][_0x431e('0x31')]));_0x5bc5c4['attributes']=_0x5bc5c4[_0x431e('0x30')][_0x431e('0x32')]?_0x5bc5c4[_0x431e('0x30')]:_0x22b217[_0x431e('0x2c')];if(_0x4dccf8[_0x431e('0x2d')][_0x431e('0x3a')]){_0x5bc5c4['include']=[{'all':!![]}];}_0x5bc5c4=_['merge']({},_0x5bc5c4,_0x4dccf8[_0x431e('0x41')]);return db[_0x431e('0x28')][_0x431e('0x42')](_0x5bc5c4)['then'](handleEntityNotFound(_0x5273ba,null))[_0x431e('0x20')](respondWithResult(_0x5273ba,null))[_0x431e('0x43')](handleError(_0x5273ba,null));};exports[_0x431e('0x44')]=function(_0x3cbd19,_0x3b2624){return db[_0x431e('0x28')][_0x431e('0x44')](_0x3cbd19[_0x431e('0x45')],{})[_0x431e('0x20')](respondWithResult(_0x3b2624,0xc9))['catch'](handleError(_0x3b2624,null));};exports[_0x431e('0x1f')]=function(_0x1dc40c,_0x5474a9){if(_0x1dc40c[_0x431e('0x45')]['id']){delete _0x1dc40c[_0x431e('0x45')]['id'];}return db[_0x431e('0x28')][_0x431e('0x42')]({'where':{'id':_0x1dc40c[_0x431e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5474a9,null))[_0x431e('0x20')](saveUpdates(_0x1dc40c[_0x431e('0x45')],null))[_0x431e('0x20')](respondWithResult(_0x5474a9,null))['catch'](handleError(_0x5474a9,null));};exports[_0x431e('0x21')]=function(_0x1c4d0a,_0x40c18){return db[_0x431e('0x28')][_0x431e('0x42')]({'where':{'id':_0x1c4d0a['params']['id']}})[_0x431e('0x20')](handleEntityNotFound(_0x40c18,null))['then'](removeEntity(_0x40c18,null))[_0x431e('0x43')](handleError(_0x40c18,null));};exports[_0x431e('0x46')]=function(_0x4fee19,_0x25fe33){return db['IntegrationReport'][_0x431e('0x46')]()[_0x431e('0x20')](respondWithResult(_0x25fe33,null))[_0x431e('0x43')](handleError(_0x25fe33,null));}; \ No newline at end of file +var _0xdbde=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','keys','options','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs'];(function(_0x50188e,_0x592524){var _0x475c54=function(_0x376cf6){while(--_0x376cf6){_0x50188e['push'](_0x50188e['shift']());}};_0x475c54(++_0x592524);}(_0xdbde,0xda));var _0xedbd=function(_0x4cc158,_0x2589e2){_0x4cc158=_0x4cc158-0x0;var _0x2ebd84=_0xdbde[_0x4cc158];return _0x2ebd84;};'use strict';var emlformat=require(_0xedbd('0x0'));var rimraf=require(_0xedbd('0x1'));var zipdir=require(_0xedbd('0x2'));var jsonpatch=require(_0xedbd('0x3'));var rp=require(_0xedbd('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xedbd('0x5'));var util=require(_0xedbd('0x6'));var path=require(_0xedbd('0x7'));var sox=require('sox');var csv=require(_0xedbd('0x8'));var ejs=require(_0xedbd('0x9'));var fs=require('fs');var fs_extra=require(_0xedbd('0xa'));var _=require(_0xedbd('0xb'));var squel=require(_0xedbd('0xc'));var crypto=require('crypto');var jsforce=require(_0xedbd('0xd'));var deskjs=require(_0xedbd('0xe'));var toCsv=require(_0xedbd('0x8'));var querystring=require(_0xedbd('0xf'));var Papa=require(_0xedbd('0x10'));var Redis=require('ioredis');var authService=require(_0xedbd('0x11'));var qs=require(_0xedbd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedbd('0x13'));var logger=require('../../config/logger')(_0xedbd('0x14'));var utils=require(_0xedbd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xedbd('0x16'));var db=require(_0xedbd('0x17'))['db'];function respondWithStatusCode(_0x572ff4,_0x203586){_0x203586=_0x203586||0xcc;return function(_0x38a4eb){if(_0x38a4eb){return _0x572ff4[_0xedbd('0x18')](_0x203586);}return _0x572ff4['status'](_0x203586)[_0xedbd('0x19')]();};}function respondWithResult(_0x107e89,_0x56914b){_0x56914b=_0x56914b||0xc8;return function(_0x3baf64){if(_0x3baf64){return _0x107e89[_0xedbd('0x1a')](_0x56914b)['json'](_0x3baf64);}};}function respondWithFilteredResult(_0x2a5b64,_0x2b8171){return function(_0x2c4219){if(_0x2c4219){var _0x50de89=typeof _0x2b8171[_0xedbd('0x1b')]==='undefined'&&typeof _0x2b8171['limit']===_0xedbd('0x1c');var _0x243586=_0x2c4219[_0xedbd('0x1d')];var _0x2b5bcf=_0x50de89?0x0:_0x2b8171[_0xedbd('0x1b')];var _0xdcc4d2=_0x50de89?_0x2c4219[_0xedbd('0x1d')]:_0x2b8171[_0xedbd('0x1b')]+_0x2b8171[_0xedbd('0x1e')];var _0xe0816e;if(_0xdcc4d2>=_0x243586){_0xdcc4d2=_0x243586;_0xe0816e=0xc8;}else{_0xe0816e=0xce;}_0x2a5b64[_0xedbd('0x1a')](_0xe0816e);return _0x2a5b64[_0xedbd('0x1f')]('Content-Range',_0x2b5bcf+'-'+_0xdcc4d2+'/'+_0x243586)[_0xedbd('0x20')](_0x2c4219);}return null;};}function patchUpdates(_0x5b184c){return function(_0x5067a1){try{jsonpatch[_0xedbd('0x21')](_0x5067a1,_0x5b184c,!![]);}catch(_0xc80c82){return BPromise[_0xedbd('0x22')](_0xc80c82);}return _0x5067a1[_0xedbd('0x23')]();};}function saveUpdates(_0x26e56f,_0x4a6567){return function(_0x154de1){if(_0x154de1){return _0x154de1[_0xedbd('0x24')](_0x26e56f)[_0xedbd('0x25')](function(_0x987189){return _0x987189;});}return null;};}function removeEntity(_0x3cc79e,_0x293e42){return function(_0x5d222f){if(_0x5d222f){return _0x5d222f[_0xedbd('0x26')]()[_0xedbd('0x25')](function(){_0x3cc79e['status'](0xcc)[_0xedbd('0x19')]();});}};}function handleEntityNotFound(_0x113184,_0x4b1da4){return function(_0x2601bc){if(!_0x2601bc){_0x113184[_0xedbd('0x18')](0x194);}return _0x2601bc;};}function handleError(_0x5e9f2e,_0x2695a5){_0x2695a5=_0x2695a5||0x1f4;return function(_0x3dd67d){logger[_0xedbd('0x27')](_0x3dd67d[_0xedbd('0x28')]);if(_0x3dd67d[_0xedbd('0x29')]){delete _0x3dd67d[_0xedbd('0x29')];}_0x5e9f2e[_0xedbd('0x1a')](_0x2695a5)[_0xedbd('0x2a')](_0x3dd67d);};}exports[_0xedbd('0x2b')]=function(_0x1e6b2b,_0x287f46){var _0x24b24d={},_0x1ba0e1={},_0x27ead5={'count':0x0,'rows':[]};var _0x2f175e=_[_0xedbd('0x2c')](db[_0xedbd('0x2d')][_0xedbd('0x2e')],function(_0xae287c){return{'name':_0xae287c['fieldName'],'type':_0xae287c[_0xedbd('0x2f')][_0xedbd('0x30')]};});_0x1ba0e1[_0xedbd('0x31')]=_[_0xedbd('0x2c')](_0x2f175e,'name');_0x1ba0e1[_0xedbd('0x32')]=_['keys'](_0x1e6b2b['query']);_0x1ba0e1[_0xedbd('0x33')]=_[_0xedbd('0x34')](_0x1ba0e1[_0xedbd('0x31')],_0x1ba0e1[_0xedbd('0x32')]);_0x24b24d['attributes']=_[_0xedbd('0x34')](_0x1ba0e1[_0xedbd('0x31')],qs[_0xedbd('0x35')](_0x1e6b2b[_0xedbd('0x32')][_0xedbd('0x35')]));_0x24b24d[_0xedbd('0x36')]=_0x24b24d[_0xedbd('0x36')][_0xedbd('0x37')]?_0x24b24d[_0xedbd('0x36')]:_0x1ba0e1[_0xedbd('0x31')];if(!_0x1e6b2b[_0xedbd('0x32')][_0xedbd('0x38')](_0xedbd('0x39'))){_0x24b24d[_0xedbd('0x1e')]=qs[_0xedbd('0x1e')](_0x1e6b2b[_0xedbd('0x32')][_0xedbd('0x1e')]);_0x24b24d[_0xedbd('0x1b')]=qs['offset'](_0x1e6b2b[_0xedbd('0x32')][_0xedbd('0x1b')]);}_0x24b24d['order']=qs['sort'](_0x1e6b2b[_0xedbd('0x32')]['sort']);_0x24b24d[_0xedbd('0x3a')]=qs[_0xedbd('0x33')](_[_0xedbd('0x3b')](_0x1e6b2b[_0xedbd('0x32')],_0x1ba0e1[_0xedbd('0x33')]),_0x2f175e);if(_0x1e6b2b[_0xedbd('0x32')][_0xedbd('0x3c')]){_0x24b24d['where']=_[_0xedbd('0x3d')](_0x24b24d[_0xedbd('0x3a')],{'$or':_[_0xedbd('0x2c')](_0x2f175e,function(_0x2fbeca){if(_0x2fbeca[_0xedbd('0x2f')]!==_0xedbd('0x3e')){var _0x35a663={};_0x35a663[_0x2fbeca['name']]={'$like':'%'+_0x1e6b2b[_0xedbd('0x32')][_0xedbd('0x3c')]+'%'};return _0x35a663;}})});}_0x24b24d=_[_0xedbd('0x3d')]({},_0x24b24d,_0x1e6b2b['options']);var _0xaccf69={'where':_0x24b24d['where']};return db['IntegrationReport'][_0xedbd('0x1d')](_0xaccf69)[_0xedbd('0x25')](function(_0xd4c6a2){_0x27ead5[_0xedbd('0x1d')]=_0xd4c6a2;if(_0x1e6b2b[_0xedbd('0x32')][_0xedbd('0x3f')]){_0x24b24d[_0xedbd('0x40')]=[{'all':!![]}];}return db[_0xedbd('0x2d')][_0xedbd('0x41')](_0x24b24d);})[_0xedbd('0x25')](function(_0x11f6ad){_0x27ead5[_0xedbd('0x42')]=_0x11f6ad;return _0x27ead5;})[_0xedbd('0x25')](respondWithFilteredResult(_0x287f46,_0x24b24d))['catch'](handleError(_0x287f46,null));};exports[_0xedbd('0x43')]=function(_0x3be838,_0x443656){var _0x43045c={'raw':![],'where':{'id':_0x3be838['params']['id']}},_0x5bb795={};_0x5bb795[_0xedbd('0x31')]=_[_0xedbd('0x44')](db[_0xedbd('0x2d')][_0xedbd('0x2e')]);_0x5bb795[_0xedbd('0x32')]=_[_0xedbd('0x44')](_0x3be838[_0xedbd('0x32')]);_0x5bb795[_0xedbd('0x33')]=_[_0xedbd('0x34')](_0x5bb795[_0xedbd('0x31')],_0x5bb795[_0xedbd('0x32')]);_0x43045c[_0xedbd('0x36')]=_['intersection'](_0x5bb795['model'],qs['fields'](_0x3be838[_0xedbd('0x32')]['fields']));_0x43045c[_0xedbd('0x36')]=_0x43045c[_0xedbd('0x36')][_0xedbd('0x37')]?_0x43045c[_0xedbd('0x36')]:_0x5bb795[_0xedbd('0x31')];if(_0x3be838[_0xedbd('0x32')][_0xedbd('0x3f')]){_0x43045c[_0xedbd('0x40')]=[{'all':!![]}];}_0x43045c=_['merge']({},_0x43045c,_0x3be838[_0xedbd('0x45')]);return db['IntegrationReport'][_0xedbd('0x46')](_0x43045c)[_0xedbd('0x25')](handleEntityNotFound(_0x443656,null))[_0xedbd('0x25')](respondWithResult(_0x443656,null))[_0xedbd('0x47')](handleError(_0x443656,null));};exports[_0xedbd('0x48')]=function(_0x1b8aa3,_0x361988){return db[_0xedbd('0x2d')][_0xedbd('0x48')](_0x1b8aa3['body'],{})[_0xedbd('0x25')](respondWithResult(_0x361988,0xc9))[_0xedbd('0x47')](handleError(_0x361988,null));};exports['update']=function(_0x5238a6,_0x5afc0e){if(_0x5238a6[_0xedbd('0x49')]['id']){delete _0x5238a6[_0xedbd('0x49')]['id'];}return db[_0xedbd('0x2d')][_0xedbd('0x46')]({'where':{'id':_0x5238a6[_0xedbd('0x4a')]['id']}})[_0xedbd('0x25')](handleEntityNotFound(_0x5afc0e,null))[_0xedbd('0x25')](saveUpdates(_0x5238a6[_0xedbd('0x49')],null))[_0xedbd('0x25')](respondWithResult(_0x5afc0e,null))[_0xedbd('0x47')](handleError(_0x5afc0e,null));};exports[_0xedbd('0x26')]=function(_0x5a16b3,_0x2d613e){return db[_0xedbd('0x2d')][_0xedbd('0x46')]({'where':{'id':_0x5a16b3[_0xedbd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2d613e,null))[_0xedbd('0x25')](removeEntity(_0x2d613e,null))[_0xedbd('0x47')](handleError(_0x2d613e,null));};exports[_0xedbd('0x4b')]=function(_0xcb07f1,_0x40239c){return db['IntegrationReport'][_0xedbd('0x4b')]()[_0xedbd('0x25')](respondWithResult(_0x40239c,null))[_0xedbd('0x47')](handleError(_0x40239c,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 278c386..2e6c4b7 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 _0x2a9c=['request-promise','path','rimraf','define','IntegrationReport','report_integration','../../config/logger','api','moment','bluebird'];(function(_0x15ac53,_0x38ae68){var _0x5adc85=function(_0x5580c1){while(--_0x5580c1){_0x15ac53['push'](_0x15ac53['shift']());}};_0x5adc85(++_0x38ae68);}(_0x2a9c,0xba));var _0xc2a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc2a9('0x0'))(_0xc2a9('0x1'));var moment=require(_0xc2a9('0x2'));var BPromise=require(_0xc2a9('0x3'));var rp=require(_0xc2a9('0x4'));var fs=require('fs');var path=require(_0xc2a9('0x5'));var rimraf=require(_0xc2a9('0x6'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module['exports']=function(_0x25b8cb,_0x50366e){return _0x25b8cb[_0xc2a9('0x7')](_0xc2a9('0x8'),attributes,{'tableName':_0xc2a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeeb5=['moment','rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration','lodash','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xeeb5,0xe3));var _0x5eeb=function(_0x4ae8f3,_0x3a27cf){_0x4ae8f3=_0x4ae8f3-0x0;var _0x1bcedd=_0xeeb5[_0x4ae8f3];return _0x1bcedd;};'use strict';var _=require(_0x5eeb('0x0'));var util=require('util');var logger=require(_0x5eeb('0x1'))(_0x5eeb('0x2'));var moment=require(_0x5eeb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5eeb('0x4'));var config=require(_0x5eeb('0x5'));var attributes=require(_0x5eeb('0x6'));module[_0x5eeb('0x7')]=function(_0x3a6008,_0x5ccdcb){return _0x3a6008[_0x5eeb('0x8')]('IntegrationReport',attributes,{'tableName':_0x5eeb('0x9'),'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 b5460eb..6c638ea 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 _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x33519a,_0x4f7d3a){_0x33519a=_0x33519a-0x0;var _0x551e54=_0x3f8a[_0x33519a];return _0x551e54;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('IntegrationReport,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x53ec,0x192));var _0xc53e=function(_0x45521d,_0x169dfe){_0x45521d=_0x45521d-0x0;var _0x24f9ed=_0x53ec[_0x45521d];return _0x24f9ed;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index a513393..51de186 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 _0xe4d9=['show','/:id/sub_intervals','isAuthenticated','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./interval.controller','get','index'];(function(_0x134058,_0x423995){var _0x14a1a9=function(_0x47a2c9){while(--_0x47a2c9){_0x134058['push'](_0x134058['shift']());}};_0x14a1a9(++_0x423995);}(_0xe4d9,0x141));var _0x9e4d=function(_0x22255f,_0x137328){_0x22255f=_0x22255f-0x0;var _0x470164=_0xe4d9[_0x22255f];return _0x470164;};'use strict';var multer=require(_0x9e4d('0x0'));var util=require(_0x9e4d('0x1'));var path=require(_0x9e4d('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e4d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9e4d('0x4'));var interaction=require(_0x9e4d('0x5'));var config=require('../../config/environment');var controller=require(_0x9e4d('0x6'));router[_0x9e4d('0x7')]('/',auth['isAuthenticated'](),controller[_0x9e4d('0x8')]);router[_0x9e4d('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9e4d('0x9')]);router['get'](_0x9e4d('0xa'),auth[_0x9e4d('0xb')](),controller['getIntervals']);router[_0x9e4d('0xc')]('/',auth[_0x9e4d('0xb')](),controller[_0x9e4d('0xd')]);router[_0x9e4d('0xc')](_0x9e4d('0xa'),auth[_0x9e4d('0xb')](),controller[_0x9e4d('0xe')]);router[_0x9e4d('0xc')](_0x9e4d('0xf'),auth[_0x9e4d('0xb')](),controller[_0x9e4d('0x10')]);router[_0x9e4d('0x11')](_0x9e4d('0x12'),auth[_0x9e4d('0xb')](),controller[_0x9e4d('0x13')]);router['delete'](_0x9e4d('0x12'),auth[_0x9e4d('0xb')](),controller[_0x9e4d('0x14')]);module[_0x9e4d('0x15')]=router; \ No newline at end of file +var _0x6dd4=['post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','/:id','show','isAuthenticated','getIntervals'];(function(_0x5ecd9f,_0x5451fa){var _0x2e6980=function(_0x1d51b8){while(--_0x1d51b8){_0x5ecd9f['push'](_0x5ecd9f['shift']());}};_0x2e6980(++_0x5451fa);}(_0x6dd4,0x129));var _0x46dd=function(_0x216fde,_0x1759e0){_0x216fde=_0x216fde-0x0;var _0x5b34f0=_0x6dd4[_0x216fde];return _0x5b34f0;};'use strict';var multer=require(_0x46dd('0x0'));var util=require(_0x46dd('0x1'));var path=require(_0x46dd('0x2'));var timeout=require(_0x46dd('0x3'));var express=require(_0x46dd('0x4'));var router=express[_0x46dd('0x5')]();var fs_extra=require(_0x46dd('0x6'));var auth=require(_0x46dd('0x7'));var interaction=require(_0x46dd('0x8'));var config=require('../../config/environment');var controller=require(_0x46dd('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x46dd('0xa')](_0x46dd('0xb'),auth['isAuthenticated'](),controller[_0x46dd('0xc')]);router[_0x46dd('0xa')]('/:id/sub_intervals',auth[_0x46dd('0xd')](),controller[_0x46dd('0xe')]);router[_0x46dd('0xf')]('/',auth[_0x46dd('0xd')](),controller[_0x46dd('0x10')]);router['post'](_0x46dd('0x11'),auth[_0x46dd('0xd')](),controller[_0x46dd('0x12')]);router['post'](_0x46dd('0x13'),auth['isAuthenticated'](),controller[_0x46dd('0x14')]);router[_0x46dd('0x15')](_0x46dd('0xb'),auth[_0x46dd('0xd')](),controller[_0x46dd('0x16')]);router['delete'](_0x46dd('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x46dd('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index bcb6d05..1134db8 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 _0xb9bd=['STRING','sequelize','exports'];(function(_0x540181,_0x5d883b){var _0x441dc6=function(_0x1f3a64){while(--_0x1f3a64){_0x540181['push'](_0x540181['shift']());}};_0x441dc6(++_0x5d883b);}(_0xb9bd,0x1c3));var _0xdb9b=function(_0x3b26a5,_0x53d5d7){_0x3b26a5=_0x3b26a5-0x0;var _0x3342a7=_0xb9bd[_0x3b26a5];return _0x3342a7;};'use strict';var Sequelize=require(_0xdb9b('0x0'));module[_0xdb9b('0x1')]={'name':{'type':Sequelize[_0xdb9b('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xdb9b('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x3bc5=['STRING','sequelize'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x3bc5,0x1cb));var _0x53bc=function(_0x429fcb,_0x370661){_0x429fcb=_0x429fcb-0x0;var _0x4f5f13=_0x3bc5[_0x429fcb];return _0x4f5f13;};'use strict';var Sequelize=require(_0x53bc('0x0'));module['exports']={'name':{'type':Sequelize[_0x53bc('0x1')]},'description':{'type':Sequelize[_0x53bc('0x1')]},'interval':{'type':Sequelize[_0x53bc('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index c67e7f6..15942ed 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 _0x8cd4=['getIntervals','pick','where','addIntervals','findOne','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','status','set','Content-Range','save','update','then','destroy','get','Intervals','end','error','stack','name','send','index','map','Interval','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','count','includeAll','findAll','rows','params','keys','rawAttributes','intersection','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8cd4,0x11a));var _0x48cd=function(_0x3b375e,_0x565734){_0x3b375e=_0x3b375e-0x0;var _0x55419f=_0x8cd4[_0x3b375e];return _0x55419f;};'use strict';var emlformat=require(_0x48cd('0x0'));var rimraf=require(_0x48cd('0x1'));var zipdir=require(_0x48cd('0x2'));var jsonpatch=require(_0x48cd('0x3'));var rp=require(_0x48cd('0x4'));var moment=require(_0x48cd('0x5'));var BPromise=require(_0x48cd('0x6'));var Mustache=require(_0x48cd('0x7'));var util=require(_0x48cd('0x8'));var path=require(_0x48cd('0x9'));var sox=require('sox');var csv=require(_0x48cd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48cd('0xb'));var _=require(_0x48cd('0xc'));var squel=require(_0x48cd('0xd'));var crypto=require(_0x48cd('0xe'));var jsforce=require(_0x48cd('0xf'));var deskjs=require(_0x48cd('0x10'));var toCsv=require(_0x48cd('0xa'));var querystring=require(_0x48cd('0x11'));var Papa=require('papaparse');var Redis=require(_0x48cd('0x12'));var authService=require(_0x48cd('0x13'));var qs=require(_0x48cd('0x14'));var as=require(_0x48cd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x48cd('0x16'))(_0x48cd('0x17'));var utils=require(_0x48cd('0x18'));var config=require(_0x48cd('0x19'));var licenseUtil=require(_0x48cd('0x1a'));var db=require(_0x48cd('0x1b'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0xf19923,_0x3d7e5e){_0x3d7e5e=_0x3d7e5e||0xcc;return function(_0x40b5cb){if(_0x40b5cb){return _0xf19923[_0x48cd('0x1c')](_0x3d7e5e);}return _0xf19923['status'](_0x3d7e5e)['end']();};}function respondWithResult(_0x75c9ca,_0x55fa5e){_0x55fa5e=_0x55fa5e||0xc8;return function(_0x465429){if(_0x465429){return _0x75c9ca['status'](_0x55fa5e)[_0x48cd('0x1d')](_0x465429);}};}function respondWithFilteredResult(_0x13c0a5,_0x5e2977){return function(_0x1e8a37){if(_0x1e8a37){var _0x58cceb=typeof _0x5e2977[_0x48cd('0x1e')]==='undefined'&&typeof _0x5e2977[_0x48cd('0x1f')]===_0x48cd('0x20');var _0x183da5=_0x1e8a37['count'];var _0x18edc6=_0x58cceb?0x0:_0x5e2977[_0x48cd('0x1e')];var _0x4b5865=_0x58cceb?_0x1e8a37['count']:_0x5e2977[_0x48cd('0x1e')]+_0x5e2977[_0x48cd('0x1f')];var _0x4ffbaa;if(_0x4b5865>=_0x183da5){_0x4b5865=_0x183da5;_0x4ffbaa=0xc8;}else{_0x4ffbaa=0xce;}_0x13c0a5[_0x48cd('0x21')](_0x4ffbaa);return _0x13c0a5[_0x48cd('0x22')](_0x48cd('0x23'),_0x18edc6+'-'+_0x4b5865+'/'+_0x183da5)[_0x48cd('0x1d')](_0x1e8a37);}return null;};}function patchUpdates(_0xc73aa7){return function(_0x12d1bb){try{jsonpatch['apply'](_0x12d1bb,_0xc73aa7,!![]);}catch(_0x3dd1a3){return BPromise['reject'](_0x3dd1a3);}return _0x12d1bb[_0x48cd('0x24')]();};}function saveUpdates(_0xac9cd8,_0x31efd9){return function(_0x63a2f1){if(_0x63a2f1){return _0x63a2f1[_0x48cd('0x25')](_0xac9cd8)[_0x48cd('0x26')](function(_0x490039){return _0x490039;});}return null;};}function removeEntity(_0x129a7e,_0xdaf3e4){return function(_0x542356){if(_0x542356){return _0x542356[_0x48cd('0x27')]()[_0x48cd('0x26')](function(){var _0x3ad6b8=_0x542356[_0x48cd('0x28')]({'plain':!![]});var _0x1785c5=_0x48cd('0x29');return db['UserProfileResource'][_0x48cd('0x27')]({'where':{'type':_0x1785c5,'resourceId':_0x3ad6b8['id']}})[_0x48cd('0x26')](function(){return _0x542356;});})['then'](function(){_0x129a7e[_0x48cd('0x21')](0xcc)[_0x48cd('0x2a')]();});}};}function handleEntityNotFound(_0x39cfd8,_0x5e5049){return function(_0x424476){if(!_0x424476){_0x39cfd8[_0x48cd('0x1c')](0x194);}return _0x424476;};}function handleError(_0x541ccf,_0x41c240){_0x41c240=_0x41c240||0x1f4;return function(_0x3dfc26){logger[_0x48cd('0x2b')](_0x3dfc26[_0x48cd('0x2c')]);if(_0x3dfc26['name']){delete _0x3dfc26[_0x48cd('0x2d')];}_0x541ccf[_0x48cd('0x21')](_0x41c240)[_0x48cd('0x2e')](_0x3dfc26);};}exports[_0x48cd('0x2f')]=function(_0x1b4948,_0x3b47bc){var _0x306f6a={},_0x22093c={},_0x575484={'count':0x0,'rows':[]};var _0x25a735=_[_0x48cd('0x30')](db[_0x48cd('0x31')]['rawAttributes'],function(_0x77cd5e){return{'name':_0x77cd5e[_0x48cd('0x32')],'type':_0x77cd5e[_0x48cd('0x33')][_0x48cd('0x34')]};});_0x22093c[_0x48cd('0x35')]=_[_0x48cd('0x30')](_0x25a735,'name');_0x22093c[_0x48cd('0x36')]=_['keys'](_0x1b4948[_0x48cd('0x36')]);_0x22093c[_0x48cd('0x37')]=_['intersection'](_0x22093c[_0x48cd('0x35')],_0x22093c[_0x48cd('0x36')]);_0x306f6a[_0x48cd('0x38')]=_['intersection'](_0x22093c[_0x48cd('0x35')],qs[_0x48cd('0x39')](_0x1b4948[_0x48cd('0x36')][_0x48cd('0x39')]));_0x306f6a[_0x48cd('0x38')]=_0x306f6a[_0x48cd('0x38')][_0x48cd('0x3a')]?_0x306f6a['attributes']:_0x22093c[_0x48cd('0x35')];if(!_0x1b4948['query'][_0x48cd('0x3b')]('nolimit')){_0x306f6a[_0x48cd('0x1f')]=qs[_0x48cd('0x1f')](_0x1b4948['query']['limit']);_0x306f6a['offset']=qs[_0x48cd('0x1e')](_0x1b4948[_0x48cd('0x36')][_0x48cd('0x1e')]);}_0x306f6a[_0x48cd('0x3c')]=qs[_0x48cd('0x3d')](_0x1b4948[_0x48cd('0x36')][_0x48cd('0x3d')]);_0x306f6a['where']=qs['filters'](_['pick'](_0x1b4948[_0x48cd('0x36')],_0x22093c[_0x48cd('0x37')]),_0x25a735);if(_0x1b4948[_0x48cd('0x36')]['filter']){_0x306f6a['where']=_['merge'](_0x306f6a['where'],{'$or':_['map'](_0x25a735,function(_0x43465d){if(_0x43465d[_0x48cd('0x33')]!=='VIRTUAL'){var _0x1b1449={};_0x1b1449[_0x43465d[_0x48cd('0x2d')]]={'$like':'%'+_0x1b4948[_0x48cd('0x36')][_0x48cd('0x3e')]+'%'};return _0x1b1449;}})});}_0x306f6a=_[_0x48cd('0x3f')]({},_0x306f6a,_0x1b4948['options']);var _0x4f2a24={'where':_0x306f6a['where']};return db[_0x48cd('0x31')][_0x48cd('0x40')](_0x4f2a24)[_0x48cd('0x26')](function(_0x554678){_0x575484['count']=_0x554678;if(_0x1b4948['query'][_0x48cd('0x41')]){_0x306f6a['include']=[{'all':!![]}];}return db['Interval'][_0x48cd('0x42')](_0x306f6a);})[_0x48cd('0x26')](function(_0x1a6800){_0x575484[_0x48cd('0x43')]=_0x1a6800;return _0x575484;})[_0x48cd('0x26')](respondWithFilteredResult(_0x3b47bc,_0x306f6a))['catch'](handleError(_0x3b47bc,null));};exports['show']=function(_0x32001c,_0x56a479){var _0x27ae66={'raw':!![],'where':{'id':_0x32001c[_0x48cd('0x44')]['id']}},_0x5d29b1={};_0x5d29b1[_0x48cd('0x35')]=_[_0x48cd('0x45')](db[_0x48cd('0x31')][_0x48cd('0x46')]);_0x5d29b1[_0x48cd('0x36')]=_[_0x48cd('0x45')](_0x32001c[_0x48cd('0x36')]);_0x5d29b1[_0x48cd('0x37')]=_[_0x48cd('0x47')](_0x5d29b1[_0x48cd('0x35')],_0x5d29b1[_0x48cd('0x36')]);_0x27ae66[_0x48cd('0x38')]=_[_0x48cd('0x47')](_0x5d29b1['model'],qs[_0x48cd('0x39')](_0x32001c[_0x48cd('0x36')][_0x48cd('0x39')]));_0x27ae66['attributes']=_0x27ae66['attributes'][_0x48cd('0x3a')]?_0x27ae66['attributes']:_0x5d29b1[_0x48cd('0x35')];if(_0x32001c[_0x48cd('0x36')]['includeAll']){_0x27ae66[_0x48cd('0x48')]=[{'all':!![]}];}_0x27ae66=_[_0x48cd('0x3f')]({},_0x27ae66,_0x32001c[_0x48cd('0x49')]);return db[_0x48cd('0x31')][_0x48cd('0x4a')](_0x27ae66)['then'](handleEntityNotFound(_0x56a479,null))[_0x48cd('0x26')](respondWithResult(_0x56a479,null))['catch'](handleError(_0x56a479,null));};exports[_0x48cd('0x4b')]=function(_0x401873,_0x69dd8b){return db['Interval'][_0x48cd('0x4b')](_0x401873[_0x48cd('0x4c')],{})['then'](function(_0x252261){var _0x120e2a=_0x401873[_0x48cd('0x4d')]['get']({'plain':!![]});if(!_0x120e2a)throw new Error(_0x48cd('0x4e'));if(_0x120e2a[_0x48cd('0x4f')]==='user'){var _0x521cd3=_0x252261[_0x48cd('0x28')]({'plain':!![]});var _0x4b5500=_0x48cd('0x29');return db[_0x48cd('0x50')][_0x48cd('0x4a')]({'where':{'name':_0x4b5500,'userProfileId':_0x120e2a['userProfileId']},'raw':!![]})['then'](function(_0x723aee){if(_0x723aee&&_0x723aee[_0x48cd('0x51')]===0x0){return db[_0x48cd('0x52')][_0x48cd('0x4b')]({'name':_0x521cd3['name'],'resourceId':_0x521cd3['id'],'type':_0x723aee['name'],'sectionId':_0x723aee['id']},{})[_0x48cd('0x26')](function(){return _0x252261;});}else{return _0x252261;}})[_0x48cd('0x53')](function(_0x52a7c5){logger[_0x48cd('0x2b')](_0x48cd('0x54'),_0x52a7c5);throw _0x52a7c5;});}return _0x252261;})[_0x48cd('0x26')](respondWithResult(_0x69dd8b,0xc9))[_0x48cd('0x53')](handleError(_0x69dd8b,null));};exports['update']=function(_0x4ab751,_0x5eeec7){if(_0x4ab751[_0x48cd('0x4c')]['id']){delete _0x4ab751[_0x48cd('0x4c')]['id'];}return db[_0x48cd('0x31')][_0x48cd('0x4a')]({'where':{'id':_0x4ab751['params']['id']}})['then'](handleEntityNotFound(_0x5eeec7,null))[_0x48cd('0x26')](saveUpdates(_0x4ab751[_0x48cd('0x4c')],null))['then'](respondWithResult(_0x5eeec7,null))[_0x48cd('0x53')](handleError(_0x5eeec7,null));};exports['destroy']=function(_0x6db46c,_0x539cd8){return db[_0x48cd('0x31')][_0x48cd('0x4a')]({'where':{'id':_0x6db46c[_0x48cd('0x44')]['id']}})['then'](handleEntityNotFound(_0x539cd8,null))['then'](removeEntity(_0x539cd8,null))[_0x48cd('0x53')](handleError(_0x539cd8,null));};exports['addInterval']=function(_0x317b64,_0x81129d,_0x123f9b){if(_0x317b64['body']['id']){delete _0x317b64[_0x48cd('0x4c')]['id'];}return db[_0x48cd('0x31')]['find']({'where':{'id':_0x317b64[_0x48cd('0x44')]['id']}})[_0x48cd('0x26')](handleEntityNotFound(_0x81129d,null))[_0x48cd('0x26')](function(_0x3389d3){if(_0x3389d3){_0x317b64['body'][_0x48cd('0x55')]=_0x3389d3['id'];return db[_0x48cd('0x31')][_0x48cd('0x4b')](_0x317b64[_0x48cd('0x4c')]);}})[_0x48cd('0x26')](respondWithResult(_0x81129d,null))['catch'](handleError(_0x81129d,null));};exports[_0x48cd('0x56')]=function(_0x2243a1,_0x56650c,_0x12c74e){var _0x33e1e9={};var _0x17feb5={};var _0x12d509;var _0x42b1db;return db[_0x48cd('0x31')]['findOne']({'where':{'id':_0x2243a1[_0x48cd('0x44')]['id']}})[_0x48cd('0x26')](handleEntityNotFound(_0x56650c,null))[_0x48cd('0x26')](function(_0x1d2360){if(_0x1d2360){_0x12d509=_0x1d2360;_0x17feb5[_0x48cd('0x35')]=_[_0x48cd('0x45')](db[_0x48cd('0x31')][_0x48cd('0x46')]);_0x17feb5['query']=_[_0x48cd('0x45')](_0x2243a1['query']);_0x17feb5['filters']=_[_0x48cd('0x47')](_0x17feb5['model'],_0x17feb5[_0x48cd('0x36')]);_0x33e1e9[_0x48cd('0x38')]=_[_0x48cd('0x47')](_0x17feb5[_0x48cd('0x35')],qs[_0x48cd('0x39')](_0x2243a1[_0x48cd('0x36')][_0x48cd('0x39')]));_0x33e1e9['attributes']=_0x33e1e9['attributes'][_0x48cd('0x3a')]?_0x33e1e9[_0x48cd('0x38')]:_0x17feb5[_0x48cd('0x35')];_0x33e1e9['order']=qs[_0x48cd('0x3d')](_0x2243a1[_0x48cd('0x36')][_0x48cd('0x3d')]);_0x33e1e9['where']=qs[_0x48cd('0x37')](_[_0x48cd('0x57')](_0x2243a1['query'],_0x17feb5[_0x48cd('0x37')]));if(_0x2243a1[_0x48cd('0x36')]['filter']){_0x33e1e9[_0x48cd('0x58')]=_['merge'](_0x33e1e9[_0x48cd('0x58')],{'$or':_['map'](_0x33e1e9[_0x48cd('0x38')],function(_0x3fe373){var _0x1fa68f={};_0x1fa68f[_0x3fe373]={'$like':'%'+_0x2243a1[_0x48cd('0x36')][_0x48cd('0x3e')]+'%'};return _0x1fa68f;})});}_0x33e1e9=_['merge']({},_0x33e1e9,_0x2243a1[_0x48cd('0x49')]);return _0x12d509[_0x48cd('0x56')](_0x33e1e9);}})['then'](function(_0x1a687d){if(_0x1a687d){_0x42b1db=_0x1a687d[_0x48cd('0x3a')];if(!_0x2243a1[_0x48cd('0x36')]['hasOwnProperty']('nolimit')){_0x33e1e9[_0x48cd('0x1f')]=qs['limit'](_0x2243a1[_0x48cd('0x36')][_0x48cd('0x1f')]);_0x33e1e9[_0x48cd('0x1e')]=qs[_0x48cd('0x1e')](_0x2243a1[_0x48cd('0x36')][_0x48cd('0x1e')]);}return _0x12d509[_0x48cd('0x56')](_0x33e1e9);}})[_0x48cd('0x26')](function(_0x269134){if(_0x269134){return _0x269134?{'count':_0x42b1db,'rows':_0x269134}:null;}})[_0x48cd('0x26')](respondWithResult(_0x56650c,null))[_0x48cd('0x53')](handleError(_0x56650c,null));};exports[_0x48cd('0x59')]=function(_0xfa41e3,_0x1d9ab3,_0x25c199){return db[_0x48cd('0x31')][_0x48cd('0x5a')]({'where':{'id':_0xfa41e3[_0x48cd('0x44')]['id']}})[_0x48cd('0x26')](handleEntityNotFound(_0x1d9ab3,null))[_0x48cd('0x26')](function(_0x5c76e8){if(_0x5c76e8){return db['sequelize'][_0x48cd('0x5b')](function(_0x1da7dd){return db['Interval'][_0x48cd('0x27')]({'where':{'IntervalId':_0xfa41e3[_0x48cd('0x44')]['id']},'transaction':_0x1da7dd})[_0x48cd('0x26')](function(_0x5a600d){var _0x25a65b=_[_0x48cd('0x30')](_0xfa41e3[_0x48cd('0x4c')],function(_0x309442){delete _0x309442['id'];_0x309442[_0x48cd('0x55')]=_0xfa41e3[_0x48cd('0x44')]['id'];return _0x309442;});return db[_0x48cd('0x31')]['bulkCreate'](_0x25a65b,{'transaction':_0x1da7dd});});})['then'](function(){return db[_0x48cd('0x31')]['findAll']({'where':{'IntervalId':_0xfa41e3[_0x48cd('0x44')]['id']}});});}})[_0x48cd('0x26')](respondWithResult(_0x1d9ab3,null))[_0x48cd('0x53')](handleError(_0x1d9ab3,null));}; \ No newline at end of file +var _0xa596=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Intervals','error','stack','name','send','map','Interval','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys','rawAttributes','intersection','options','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','findOne','order','getIntervals','addIntervals','IntervalId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis'];(function(_0x3c858f,_0x235201){var _0x198090=function(_0xc4c406){while(--_0xc4c406){_0x3c858f['push'](_0x3c858f['shift']());}};_0x198090(++_0x235201);}(_0xa596,0xa6));var _0x6a59=function(_0x4211c9,_0x1a59b6){_0x4211c9=_0x4211c9-0x0;var _0x5dab16=_0xa596[_0x4211c9];return _0x5dab16;};'use strict';var emlformat=require(_0x6a59('0x0'));var rimraf=require(_0x6a59('0x1'));var zipdir=require(_0x6a59('0x2'));var jsonpatch=require(_0x6a59('0x3'));var rp=require(_0x6a59('0x4'));var moment=require(_0x6a59('0x5'));var BPromise=require(_0x6a59('0x6'));var Mustache=require(_0x6a59('0x7'));var util=require('util');var path=require(_0x6a59('0x8'));var sox=require(_0x6a59('0x9'));var csv=require('to-csv');var ejs=require(_0x6a59('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a59('0xb'));var squel=require(_0x6a59('0xc'));var crypto=require('crypto');var jsforce=require(_0x6a59('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6a59('0xe'));var querystring=require(_0x6a59('0xf'));var Papa=require(_0x6a59('0x10'));var Redis=require(_0x6a59('0x11'));var authService=require(_0x6a59('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6a59('0x13'));var hardwareService=require(_0x6a59('0x14'));var logger=require(_0x6a59('0x15'))(_0x6a59('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6a59('0x17'));var db=require('../../mysqldb')['db'];var extensions=require(_0x6a59('0x18'));function respondWithStatusCode(_0x1dc0b0,_0x364dbd){_0x364dbd=_0x364dbd||0xcc;return function(_0x180c0){if(_0x180c0){return _0x1dc0b0[_0x6a59('0x19')](_0x364dbd);}return _0x1dc0b0[_0x6a59('0x1a')](_0x364dbd)[_0x6a59('0x1b')]();};}function respondWithResult(_0x431bd4,_0x4a89b8){_0x4a89b8=_0x4a89b8||0xc8;return function(_0x5a8a40){if(_0x5a8a40){return _0x431bd4['status'](_0x4a89b8)[_0x6a59('0x1c')](_0x5a8a40);}};}function respondWithFilteredResult(_0x4d5b3a,_0x1c0e70){return function(_0x198a6b){if(_0x198a6b){var _0x270059=typeof _0x1c0e70[_0x6a59('0x1d')]===_0x6a59('0x1e')&&typeof _0x1c0e70[_0x6a59('0x1f')]===_0x6a59('0x1e');var _0x836ab7=_0x198a6b[_0x6a59('0x20')];var _0x544106=_0x270059?0x0:_0x1c0e70[_0x6a59('0x1d')];var _0x240cbc=_0x270059?_0x198a6b[_0x6a59('0x20')]:_0x1c0e70['offset']+_0x1c0e70[_0x6a59('0x1f')];var _0xa7430e;if(_0x240cbc>=_0x836ab7){_0x240cbc=_0x836ab7;_0xa7430e=0xc8;}else{_0xa7430e=0xce;}_0x4d5b3a['status'](_0xa7430e);return _0x4d5b3a[_0x6a59('0x21')](_0x6a59('0x22'),_0x544106+'-'+_0x240cbc+'/'+_0x836ab7)[_0x6a59('0x1c')](_0x198a6b);}return null;};}function patchUpdates(_0x4527dd){return function(_0x3cafd7){try{jsonpatch[_0x6a59('0x23')](_0x3cafd7,_0x4527dd,!![]);}catch(_0xfcbc4d){return BPromise[_0x6a59('0x24')](_0xfcbc4d);}return _0x3cafd7[_0x6a59('0x25')]();};}function saveUpdates(_0x4c4158,_0x41f28e){return function(_0x11c8b0){if(_0x11c8b0){return _0x11c8b0[_0x6a59('0x26')](_0x4c4158)[_0x6a59('0x27')](function(_0x511296){return _0x511296;});}return null;};}function removeEntity(_0x1496c9,_0x11bcef){return function(_0x457ea5){if(_0x457ea5){return _0x457ea5[_0x6a59('0x28')]()[_0x6a59('0x27')](function(){var _0x4c76f6=_0x457ea5['get']({'plain':!![]});var _0x4a6024=_0x6a59('0x29');return db['UserProfileResource'][_0x6a59('0x28')]({'where':{'type':_0x4a6024,'resourceId':_0x4c76f6['id']}})[_0x6a59('0x27')](function(){return _0x457ea5;});})[_0x6a59('0x27')](function(){_0x1496c9[_0x6a59('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x594de6,_0xb8cb5e){return function(_0x43a0c2){if(!_0x43a0c2){_0x594de6[_0x6a59('0x19')](0x194);}return _0x43a0c2;};}function handleError(_0x37a5ac,_0x4429cb){_0x4429cb=_0x4429cb||0x1f4;return function(_0x132a5e){logger[_0x6a59('0x2a')](_0x132a5e[_0x6a59('0x2b')]);if(_0x132a5e[_0x6a59('0x2c')]){delete _0x132a5e[_0x6a59('0x2c')];}_0x37a5ac[_0x6a59('0x1a')](_0x4429cb)[_0x6a59('0x2d')](_0x132a5e);};}exports['index']=function(_0x48081b,_0x2529bf){var _0x496d68={},_0x2f3374={},_0x174b43={'count':0x0,'rows':[]};var _0x5270f0=_[_0x6a59('0x2e')](db[_0x6a59('0x2f')]['rawAttributes'],function(_0x25ec59){return{'name':_0x25ec59['fieldName'],'type':_0x25ec59[_0x6a59('0x30')][_0x6a59('0x31')]};});_0x2f3374[_0x6a59('0x32')]=_['map'](_0x5270f0,_0x6a59('0x2c'));_0x2f3374[_0x6a59('0x33')]=_['keys'](_0x48081b[_0x6a59('0x33')]);_0x2f3374['filters']=_['intersection'](_0x2f3374['model'],_0x2f3374[_0x6a59('0x33')]);_0x496d68[_0x6a59('0x34')]=_['intersection'](_0x2f3374[_0x6a59('0x32')],qs[_0x6a59('0x35')](_0x48081b['query'][_0x6a59('0x35')]));_0x496d68[_0x6a59('0x34')]=_0x496d68[_0x6a59('0x34')][_0x6a59('0x36')]?_0x496d68[_0x6a59('0x34')]:_0x2f3374[_0x6a59('0x32')];if(!_0x48081b['query'][_0x6a59('0x37')](_0x6a59('0x38'))){_0x496d68['limit']=qs[_0x6a59('0x1f')](_0x48081b['query'][_0x6a59('0x1f')]);_0x496d68[_0x6a59('0x1d')]=qs[_0x6a59('0x1d')](_0x48081b['query'][_0x6a59('0x1d')]);}_0x496d68['order']=qs[_0x6a59('0x39')](_0x48081b[_0x6a59('0x33')][_0x6a59('0x39')]);_0x496d68[_0x6a59('0x3a')]=qs[_0x6a59('0x3b')](_[_0x6a59('0x3c')](_0x48081b[_0x6a59('0x33')],_0x2f3374['filters']),_0x5270f0);if(_0x48081b[_0x6a59('0x33')][_0x6a59('0x3d')]){_0x496d68['where']=_[_0x6a59('0x3e')](_0x496d68[_0x6a59('0x3a')],{'$or':_[_0x6a59('0x2e')](_0x5270f0,function(_0x1127be){if(_0x1127be[_0x6a59('0x30')]!==_0x6a59('0x3f')){var _0x430003={};_0x430003[_0x1127be[_0x6a59('0x2c')]]={'$like':'%'+_0x48081b['query']['filter']+'%'};return _0x430003;}})});}_0x496d68=_['merge']({},_0x496d68,_0x48081b['options']);var _0x4f63b6={'where':_0x496d68[_0x6a59('0x3a')]};return db['Interval']['count'](_0x4f63b6)[_0x6a59('0x27')](function(_0xda9c02){_0x174b43[_0x6a59('0x20')]=_0xda9c02;if(_0x48081b['query'][_0x6a59('0x40')]){_0x496d68[_0x6a59('0x41')]=[{'all':!![]}];}return db[_0x6a59('0x2f')]['findAll'](_0x496d68);})['then'](function(_0x89ace3){_0x174b43[_0x6a59('0x42')]=_0x89ace3;return _0x174b43;})[_0x6a59('0x27')](respondWithFilteredResult(_0x2529bf,_0x496d68))['catch'](handleError(_0x2529bf,null));};exports[_0x6a59('0x43')]=function(_0x5a4203,_0x764462){var _0x4f82b8={'raw':!![],'where':{'id':_0x5a4203[_0x6a59('0x44')]['id']}},_0x55b897={};_0x55b897[_0x6a59('0x32')]=_[_0x6a59('0x45')](db[_0x6a59('0x2f')][_0x6a59('0x46')]);_0x55b897[_0x6a59('0x33')]=_[_0x6a59('0x45')](_0x5a4203[_0x6a59('0x33')]);_0x55b897[_0x6a59('0x3b')]=_[_0x6a59('0x47')](_0x55b897[_0x6a59('0x32')],_0x55b897[_0x6a59('0x33')]);_0x4f82b8[_0x6a59('0x34')]=_[_0x6a59('0x47')](_0x55b897[_0x6a59('0x32')],qs['fields'](_0x5a4203['query'][_0x6a59('0x35')]));_0x4f82b8[_0x6a59('0x34')]=_0x4f82b8[_0x6a59('0x34')]['length']?_0x4f82b8[_0x6a59('0x34')]:_0x55b897[_0x6a59('0x32')];if(_0x5a4203[_0x6a59('0x33')][_0x6a59('0x40')]){_0x4f82b8[_0x6a59('0x41')]=[{'all':!![]}];}_0x4f82b8=_['merge']({},_0x4f82b8,_0x5a4203[_0x6a59('0x48')]);return db[_0x6a59('0x2f')]['find'](_0x4f82b8)[_0x6a59('0x27')](handleEntityNotFound(_0x764462,null))[_0x6a59('0x27')](respondWithResult(_0x764462,null))[_0x6a59('0x49')](handleError(_0x764462,null));};exports['create']=function(_0x5f030a,_0x46d1fb){return db[_0x6a59('0x2f')][_0x6a59('0x4a')](_0x5f030a[_0x6a59('0x4b')],{})['then'](function(_0x3f9db0){var _0x30fc60=_0x5f030a['user'][_0x6a59('0x4c')]({'plain':!![]});if(!_0x30fc60)throw new Error(_0x6a59('0x4d'));if(_0x30fc60[_0x6a59('0x4e')]===_0x6a59('0x4f')){var _0x38371c=_0x3f9db0[_0x6a59('0x4c')]({'plain':!![]});var _0x1fee69='Intervals';return db[_0x6a59('0x50')][_0x6a59('0x51')]({'where':{'name':_0x1fee69,'userProfileId':_0x30fc60[_0x6a59('0x52')]},'raw':!![]})[_0x6a59('0x27')](function(_0x9a5a7b){if(_0x9a5a7b&&_0x9a5a7b['autoAssociation']===0x0){return db[_0x6a59('0x53')][_0x6a59('0x4a')]({'name':_0x38371c[_0x6a59('0x2c')],'resourceId':_0x38371c['id'],'type':_0x9a5a7b[_0x6a59('0x2c')],'sectionId':_0x9a5a7b['id']},{})[_0x6a59('0x27')](function(){return _0x3f9db0;});}else{return _0x3f9db0;}})[_0x6a59('0x49')](function(_0xf8e27b){logger[_0x6a59('0x2a')](_0x6a59('0x54'),_0xf8e27b);throw _0xf8e27b;});}return _0x3f9db0;})[_0x6a59('0x27')](respondWithResult(_0x46d1fb,0xc9))[_0x6a59('0x49')](handleError(_0x46d1fb,null));};exports['update']=function(_0x47eab2,_0x1f8a69){if(_0x47eab2[_0x6a59('0x4b')]['id']){delete _0x47eab2[_0x6a59('0x4b')]['id'];}return db[_0x6a59('0x2f')][_0x6a59('0x51')]({'where':{'id':_0x47eab2[_0x6a59('0x44')]['id']}})[_0x6a59('0x27')](handleEntityNotFound(_0x1f8a69,null))[_0x6a59('0x27')](saveUpdates(_0x47eab2[_0x6a59('0x4b')],null))[_0x6a59('0x27')](respondWithResult(_0x1f8a69,null))[_0x6a59('0x49')](handleError(_0x1f8a69,null));};exports[_0x6a59('0x28')]=function(_0x27d369,_0x9c5a1e){return db['Interval'][_0x6a59('0x51')]({'where':{'id':_0x27d369[_0x6a59('0x44')]['id']}})[_0x6a59('0x27')](handleEntityNotFound(_0x9c5a1e,null))[_0x6a59('0x27')](removeEntity(_0x9c5a1e,null))[_0x6a59('0x49')](handleError(_0x9c5a1e,null));};exports[_0x6a59('0x55')]=function(_0x1a1022,_0x49f779,_0x2a6483){if(_0x1a1022[_0x6a59('0x4b')]['id']){delete _0x1a1022[_0x6a59('0x4b')]['id'];}return db[_0x6a59('0x2f')][_0x6a59('0x51')]({'where':{'id':_0x1a1022[_0x6a59('0x44')]['id']}})['then'](handleEntityNotFound(_0x49f779,null))['then'](function(_0x10aa58){if(_0x10aa58){_0x1a1022[_0x6a59('0x4b')]['IntervalId']=_0x10aa58['id'];return db[_0x6a59('0x2f')][_0x6a59('0x4a')](_0x1a1022[_0x6a59('0x4b')]);}})['then'](respondWithResult(_0x49f779,null))[_0x6a59('0x49')](handleError(_0x49f779,null));};exports['getIntervals']=function(_0x4f5264,_0x192305,_0x2d96ec){var _0x28e88d={};var _0x543371={};var _0x5a40bc;var _0x1a2d62;return db['Interval'][_0x6a59('0x56')]({'where':{'id':_0x4f5264[_0x6a59('0x44')]['id']}})[_0x6a59('0x27')](handleEntityNotFound(_0x192305,null))[_0x6a59('0x27')](function(_0xc6e081){if(_0xc6e081){_0x5a40bc=_0xc6e081;_0x543371[_0x6a59('0x32')]=_[_0x6a59('0x45')](db[_0x6a59('0x2f')][_0x6a59('0x46')]);_0x543371[_0x6a59('0x33')]=_[_0x6a59('0x45')](_0x4f5264[_0x6a59('0x33')]);_0x543371[_0x6a59('0x3b')]=_[_0x6a59('0x47')](_0x543371['model'],_0x543371['query']);_0x28e88d[_0x6a59('0x34')]=_[_0x6a59('0x47')](_0x543371['model'],qs[_0x6a59('0x35')](_0x4f5264[_0x6a59('0x33')][_0x6a59('0x35')]));_0x28e88d[_0x6a59('0x34')]=_0x28e88d[_0x6a59('0x34')]['length']?_0x28e88d['attributes']:_0x543371['model'];_0x28e88d[_0x6a59('0x57')]=qs[_0x6a59('0x39')](_0x4f5264['query'][_0x6a59('0x39')]);_0x28e88d['where']=qs['filters'](_['pick'](_0x4f5264['query'],_0x543371[_0x6a59('0x3b')]));if(_0x4f5264[_0x6a59('0x33')]['filter']){_0x28e88d[_0x6a59('0x3a')]=_[_0x6a59('0x3e')](_0x28e88d['where'],{'$or':_[_0x6a59('0x2e')](_0x28e88d[_0x6a59('0x34')],function(_0x329946){var _0x597d1e={};_0x597d1e[_0x329946]={'$like':'%'+_0x4f5264[_0x6a59('0x33')]['filter']+'%'};return _0x597d1e;})});}_0x28e88d=_[_0x6a59('0x3e')]({},_0x28e88d,_0x4f5264['options']);return _0x5a40bc['getIntervals'](_0x28e88d);}})[_0x6a59('0x27')](function(_0x169eb6){if(_0x169eb6){_0x1a2d62=_0x169eb6[_0x6a59('0x36')];if(!_0x4f5264[_0x6a59('0x33')][_0x6a59('0x37')](_0x6a59('0x38'))){_0x28e88d['limit']=qs[_0x6a59('0x1f')](_0x4f5264[_0x6a59('0x33')][_0x6a59('0x1f')]);_0x28e88d[_0x6a59('0x1d')]=qs['offset'](_0x4f5264[_0x6a59('0x33')][_0x6a59('0x1d')]);}return _0x5a40bc[_0x6a59('0x58')](_0x28e88d);}})[_0x6a59('0x27')](function(_0x5e1f9f){if(_0x5e1f9f){return _0x5e1f9f?{'count':_0x1a2d62,'rows':_0x5e1f9f}:null;}})[_0x6a59('0x27')](respondWithResult(_0x192305,null))[_0x6a59('0x49')](handleError(_0x192305,null));};exports[_0x6a59('0x59')]=function(_0x4587f5,_0xb3cbf0,_0x3947a1){return db[_0x6a59('0x2f')][_0x6a59('0x56')]({'where':{'id':_0x4587f5[_0x6a59('0x44')]['id']}})[_0x6a59('0x27')](handleEntityNotFound(_0xb3cbf0,null))[_0x6a59('0x27')](function(_0x2aded1){if(_0x2aded1){return db['sequelize']['transaction'](function(_0x58dc3e){return db[_0x6a59('0x2f')]['destroy']({'where':{'IntervalId':_0x4587f5[_0x6a59('0x44')]['id']},'transaction':_0x58dc3e})[_0x6a59('0x27')](function(_0x3b7264){var _0x2ace06=_[_0x6a59('0x2e')](_0x4587f5['body'],function(_0xa684c7){delete _0xa684c7['id'];_0xa684c7[_0x6a59('0x5a')]=_0x4587f5['params']['id'];return _0xa684c7;});return db['Interval']['bulkCreate'](_0x2ace06,{'transaction':_0x58dc3e});});})['then'](function(){return db[_0x6a59('0x2f')][_0x6a59('0x5b')]({'where':{'IntervalId':_0x4587f5[_0x6a59('0x44')]['id']}});});}})[_0x6a59('0x27')](respondWithResult(_0xb3cbf0,null))[_0x6a59('0x49')](handleError(_0xb3cbf0,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index b554a48..0ff9de2 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 _0x004d=['rewrite','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./interval.attributes','exports','tools_intervals'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0x004d,0xc1));var _0xd004=function(_0x2e10b2,_0x1528d6){_0x2e10b2=_0x2e10b2-0x0;var _0x26f462=_0x004d[_0x2e10b2];return _0x26f462;};'use strict';var _=require(_0xd004('0x0'));var util=require('util');var logger=require(_0xd004('0x1'))(_0xd004('0x2'));var moment=require(_0xd004('0x3'));var BPromise=require(_0xd004('0x4'));var rp=require(_0xd004('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd004('0x6'));var config=require(_0xd004('0x7'));var attributes=require(_0xd004('0x8'));var extensions=require('../../components/extensions/rewrite');module[_0xd004('0x9')]=function(_0x4354dc,_0x25d7ec){return _0x4354dc['define']('Interval',attributes,{'tableName':_0xd004('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ed7b0,_0xf0a844){extensions[_0xd004('0xb')](_0x4354dc,_0x3ed7b0);},'afterBulkCreate':function(_0x3563a3,_0x527347,_0x50f39b){_0x50f39b();extensions[_0xd004('0xb')](_0x4354dc,_0x3563a3[0x0]);},'afterUpdate':function(_0x96943d,_0x330fd5){extensions[_0xd004('0xb')](_0x4354dc,_0x96943d);},'afterDestroy':function(_0x24efe6,_0x49f4ee){extensions[_0xd004('0xb')](_0x4354dc,_0x24efe6);}}});}; \ No newline at end of file +var _0x7374=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite'];(function(_0x5ba066,_0x51d83c){var _0x11ff8d=function(_0x4a81d4){while(--_0x4a81d4){_0x5ba066['push'](_0x5ba066['shift']());}};_0x11ff8d(++_0x51d83c);}(_0x7374,0x138));var _0x4737=function(_0x255286,_0x411f72){_0x255286=_0x255286-0x0;var _0x2aa88c=_0x7374[_0x255286];return _0x2aa88c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4737('0x0'))(_0x4737('0x1'));var moment=require(_0x4737('0x2'));var BPromise=require(_0x4737('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4737('0x4'));var rimraf=require(_0x4737('0x5'));var config=require(_0x4737('0x6'));var attributes=require(_0x4737('0x7'));var extensions=require(_0x4737('0x8'));module[_0x4737('0x9')]=function(_0x3adad4,_0x1618ce){return _0x3adad4['define'](_0x4737('0xa'),attributes,{'tableName':_0x4737('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ba638,_0x309e47){extensions[_0x4737('0xc')](_0x3adad4,_0x1ba638);},'afterBulkCreate':function(_0x5c20dc,_0x4e6207,_0x2b332d){_0x2b332d();extensions['rewrite'](_0x3adad4,_0x5c20dc[0x0]);},'afterUpdate':function(_0x32d8dc,_0x4e81e9){extensions[_0x4737('0xc')](_0x3adad4,_0x32d8dc);},'afterDestroy':function(_0xce944f,_0x457b8e){extensions['rewrite'](_0x3adad4,_0xce944f);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 3be8c66..732ab38 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(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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(_0x5235dd,_0x3f91cf){var _0x13059d=function(_0x355a98){while(--_0x355a98){_0x5235dd['push'](_0x5235dd['shift']());}};_0x13059d(++_0x3f91cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 1153cb7..cc3cb46 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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x4e8ceb,_0x2a1665){var _0x28bc5b=function(_0x35f67e){while(--_0x35f67e){_0x4e8ceb['push'](_0x4e8ceb['shift']());}};_0x28bc5b(++_0x2a1665);}(_0x2ef3,0xba));var _0x32ef=function(_0x1b780b,_0x109106){_0x1b780b=_0x1b780b-0x0;var _0x4540e4=_0x2ef3[_0x1b780b];return _0x4540e4;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xb10b,0x12a));var _0xbb10=function(_0x34620e,_0x582015){_0x34620e=_0x34620e-0x0;var _0x3d33cd=_0xb10b[_0x34620e];return _0x3d33cd;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 77bccd4..20327a5 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 _0x8d74=['setEncoding','utf8','data','end','status','statusCode','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','send','headers','connection','remoteAddress','socket','body','https','../../config/logger','api','3eAmWpBVP0','key','summary','\x20from\x20','issuetype','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','fields','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','stringify','request'];(function(_0x77b027,_0x5a935a){var _0x2f1e0b=function(_0x48ec38){while(--_0x48ec38){_0x77b027['push'](_0x77b027['shift']());}};_0x2f1e0b(++_0x5a935a);}(_0x8d74,0x1ea));var _0x48d7=function(_0x447e98,_0x24ce35){_0x447e98=_0x447e98-0x0;var _0xefd7db=_0x8d74[_0x447e98];return _0xefd7db;};'use strict';var BPromise=require('bluebird');var https=require(_0x48d7('0x0'));var logger=require(_0x48d7('0x1'))(_0x48d7('0x2'));var USERNAME='support';var PASSWORD=_0x48d7('0x3');function openIssue(_0x39093a,_0x525344){var _0x34b783={'fields':{'project':{'key':_0x39093a[_0x48d7('0x4')]||'MOTGUI'},'summary':(_0x39093a[_0x48d7('0x5')]||'Report')+_0x48d7('0x6')+_0x39093a['ip'],'description':_0x39093a['description']||JSON['stringify'](_0x39093a),'issuetype':{'name':_0x39093a[_0x48d7('0x7')]||'Bug'}}};_0x34b783['fields'][_0x48d7('0x8')]=_0x39093a[_0x48d7('0x9')];_0x34b783['fields'][_0x48d7('0xa')]=_0x39093a['oldToken'];_0x34b783['fields'][_0x48d7('0xb')]=_0x39093a[_0x48d7('0xc')];_0x34b783['fields'][_0x48d7('0xd')]=_0x39093a[_0x48d7('0xe')];_0x34b783[_0x48d7('0xf')]['customfield_11504']=_0x39093a[_0x48d7('0x10')];_0x34b783[_0x48d7('0xf')][_0x48d7('0x11')]=_0x39093a['ip'];var _0x24e695={'host':_0x48d7('0x12'),'port':0x1bb,'path':_0x48d7('0x13'),'method':_0x48d7('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x48d7('0x15'),'Authorization':_0x48d7('0x16')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x48d7('0x17'))}};var _0xf37265=JSON[_0x48d7('0x18')](_0x34b783);var _0x449668=https[_0x48d7('0x19')](_0x24e695,function(_0x5515c5){_0x5515c5[_0x48d7('0x1a')](_0x48d7('0x1b'));var _0xc113bd='';_0x5515c5['on'](_0x48d7('0x1c'),function(_0x5b57c5){_0xc113bd+=_0x5b57c5;});_0x5515c5['on'](_0x48d7('0x1d'),function(){if(_0x525344){return _0x525344[_0x48d7('0x1e')](_0x5515c5[_0x48d7('0x1f')])['json'](JSON[_0x48d7('0x20')](_0xc113bd));}});});_0x449668['on'](_0x48d7('0x21'),function(_0x3f2806){if(_0x525344){return _0x525344[_0x48d7('0x1e')](0x1f4)[_0x48d7('0x22')]({'errors':[{'message':_0x48d7('0x23'),'type':'api.jira'}]});}});_0x449668[_0x48d7('0x24')](_0xf37265);_0x449668[_0x48d7('0x1d')]();}exports['openIssue']=openIssue;exports[_0x48d7('0x25')]=function(_0x4b992d,_0x15ae30){_0x4b992d['body']['ip']=_0x4b992d[_0x48d7('0x26')]['x-forwarded-for']||_0x4b992d[_0x48d7('0x27')][_0x48d7('0x28')]||_0x4b992d[_0x48d7('0x29')]['remoteAddress']||_0x4b992d[_0x48d7('0x27')][_0x48d7('0x29')][_0x48d7('0x28')];return openIssue(_0x4b992d[_0x48d7('0x2a')],_0x15ae30);}; \ No newline at end of file +var _0x098f=['email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','utf8','data','status','statusCode','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','socket','remoteAddress','connection','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','Bug','fields','customfield_11500'];(function(_0x58d68d,_0x5d8990){var _0x1df18a=function(_0x138066){while(--_0x138066){_0x58d68d['push'](_0x58d68d['shift']());}};_0x1df18a(++_0x5d8990);}(_0x098f,0x7e));var _0xf098=function(_0x2f39c8,_0x1c48a6){_0x2f39c8=_0x2f39c8-0x0;var _0x2cded3=_0x098f[_0x2f39c8];return _0x2cded3;};'use strict';var BPromise=require(_0xf098('0x0'));var https=require(_0xf098('0x1'));var logger=require(_0xf098('0x2'))(_0xf098('0x3'));var USERNAME=_0xf098('0x4');var PASSWORD=_0xf098('0x5');function openIssue(_0x171c98,_0x14565e){var _0x283930={'fields':{'project':{'key':_0x171c98[_0xf098('0x6')]||_0xf098('0x7')},'summary':(_0x171c98[_0xf098('0x8')]||'Report')+_0xf098('0x9')+_0x171c98['ip'],'description':_0x171c98[_0xf098('0xa')]||JSON[_0xf098('0xb')](_0x171c98),'issuetype':{'name':_0x171c98['issuetype']||_0xf098('0xc')}}};_0x283930[_0xf098('0xd')][_0xf098('0xe')]=_0x171c98[_0xf098('0xf')];_0x283930[_0xf098('0xd')][_0xf098('0x10')]=_0x171c98[_0xf098('0x11')];_0x283930[_0xf098('0xd')][_0xf098('0x12')]=_0x171c98[_0xf098('0x13')];_0x283930[_0xf098('0xd')][_0xf098('0x14')]=_0x171c98[_0xf098('0x15')];_0x283930['fields'][_0xf098('0x16')]=_0x171c98[_0xf098('0x17')];_0x283930[_0xf098('0xd')]['customfield_10102']=_0x171c98['ip'];var _0x437fa9={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xf098('0x18'),'method':_0xf098('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0xf098('0x1a'),'Authorization':_0xf098('0x1b')+new Buffer(USERNAME+':'+PASSWORD)[_0xf098('0x1c')](_0xf098('0x1d'))}};var _0x37b798=JSON[_0xf098('0xb')](_0x283930);var _0x25d05e=https[_0xf098('0x1e')](_0x437fa9,function(_0xd039a7){_0xd039a7['setEncoding'](_0xf098('0x1f'));var _0x133952='';_0xd039a7['on'](_0xf098('0x20'),function(_0x1178b5){_0x133952+=_0x1178b5;});_0xd039a7['on']('end',function(){if(_0x14565e){return _0x14565e[_0xf098('0x21')](_0xd039a7[_0xf098('0x22')])[_0xf098('0x23')](JSON['parse'](_0x133952));}});});_0x25d05e['on']('error',function(_0x299091){if(_0x14565e){return _0x14565e[_0xf098('0x21')](0x1f4)['json']({'errors':[{'message':_0xf098('0x24'),'type':_0xf098('0x25')}]});}});_0x25d05e[_0xf098('0x26')](_0x37b798);_0x25d05e['end']();}exports[_0xf098('0x27')]=openIssue;exports[_0xf098('0x28')]=function(_0x2bfea4,_0x1d22af){_0x2bfea4[_0xf098('0x29')]['ip']=_0x2bfea4[_0xf098('0x2a')][_0xf098('0x2b')]||_0x2bfea4['connection']['remoteAddress']||_0x2bfea4[_0xf098('0x2c')][_0xf098('0x2d')]||_0x2bfea4[_0xf098('0x2e')][_0xf098('0x2c')][_0xf098('0x2d')];return openIssue(_0x2bfea4[_0xf098('0x29')],_0x1d22af);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index d6d599e..07bc603 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 _0xcb91=['get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller'];(function(_0x4aadc0,_0x504755){var _0x5571d1=function(_0x3888fa){while(--_0x3888fa){_0x4aadc0['push'](_0x4aadc0['shift']());}};_0x5571d1(++_0x504755);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x49cb71,_0x2f0149){_0x49cb71=_0x49cb71-0x0;var _0x3a50fd=_0xcb91[_0x49cb71];return _0x3a50fd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4ea3=['multer','util','path','connect-timeout','Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','post','update','destroy','exports'];(function(_0x48b5a2,_0x5014c7){var _0xc7f542=function(_0xa288f5){while(--_0xa288f5){_0x48b5a2['push'](_0x48b5a2['shift']());}};_0xc7f542(++_0x5014c7);}(_0x4ea3,0x70));var _0x34ea=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4ea3[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var path=require(_0x34ea('0x2'));var timeout=require(_0x34ea('0x3'));var express=require('express');var router=express[_0x34ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34ea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x34ea('0x6'));router[_0x34ea('0x7')]('/',auth[_0x34ea('0x8')](),controller[_0x34ea('0x9')]);router[_0x34ea('0x7')](_0x34ea('0xa'),auth[_0x34ea('0x8')](),controller['describe']);router[_0x34ea('0x7')](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller['show']);router[_0x34ea('0xc')]('/',auth[_0x34ea('0x8')](),controller['create']);router['put'](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xd')]);router['delete'](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xe')]);module[_0x34ea('0xf')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index f8d7ee2..4e187d7 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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x3239d,_0x7459ca){_0x3239d=_0x3239d-0x0;var _0x1a0966=_0x7a54[_0x3239d];return _0x1a0966;};'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(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x7a54,0x106));var _0x47a5=function(_0x146f1d,_0x2837ea){_0x146f1d=_0x146f1d-0x0;var _0x16d71d=_0x7a54[_0x146f1d];return _0x16d71d;};'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 6b207b7..81b4afc 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 _0x4074=['params','rawAttributes','intersection','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','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','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','error','stack','name','index','fieldName','type','key','model','map','query','keys','attributes','fields','length','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','JscriptyAnswerReport','then','includeAll','findAll','rows','show'];(function(_0x2afd65,_0x24a12b){var _0x13d426=function(_0x1bd035){while(--_0x1bd035){_0x2afd65['push'](_0x2afd65['shift']());}};_0x13d426(++_0x24a12b);}(_0x4074,0xf0));var _0x4407=function(_0x230360,_0x3d1d4d){_0x230360=_0x230360-0x0;var _0x5712a1=_0x4074[_0x230360];return _0x5712a1;};'use strict';var emlformat=require(_0x4407('0x0'));var rimraf=require(_0x4407('0x1'));var zipdir=require(_0x4407('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4407('0x3'));var moment=require(_0x4407('0x4'));var BPromise=require(_0x4407('0x5'));var Mustache=require(_0x4407('0x6'));var util=require(_0x4407('0x7'));var path=require(_0x4407('0x8'));var sox=require(_0x4407('0x9'));var csv=require(_0x4407('0xa'));var ejs=require(_0x4407('0xb'));var fs=require('fs');var fs_extra=require(_0x4407('0xc'));var _=require('lodash');var squel=require(_0x4407('0xd'));var crypto=require('crypto');var jsforce=require(_0x4407('0xe'));var deskjs=require(_0x4407('0xf'));var toCsv=require(_0x4407('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4407('0x10'));var qs=require(_0x4407('0x11'));var as=require(_0x4407('0x12'));var hardwareService=require(_0x4407('0x13'));var logger=require(_0x4407('0x14'))(_0x4407('0x15'));var utils=require(_0x4407('0x16'));var config=require(_0x4407('0x17'));var licenseUtil=require(_0x4407('0x18'));var db=require(_0x4407('0x19'))['db'];function respondWithStatusCode(_0x14f398,_0x5d0c41){_0x5d0c41=_0x5d0c41||0xcc;return function(_0x3f8f23){if(_0x3f8f23){return _0x14f398[_0x4407('0x1a')](_0x5d0c41);}return _0x14f398['status'](_0x5d0c41)[_0x4407('0x1b')]();};}function respondWithResult(_0x4c62b9,_0x1d2ec8){_0x1d2ec8=_0x1d2ec8||0xc8;return function(_0x27724a){if(_0x27724a){return _0x4c62b9[_0x4407('0x1c')](_0x1d2ec8)[_0x4407('0x1d')](_0x27724a);}};}function respondWithFilteredResult(_0x1840dd,_0x417e19){return function(_0x1c5a0c){if(_0x1c5a0c){var _0x2e709f=typeof _0x417e19['offset']===_0x4407('0x1e')&&typeof _0x417e19[_0x4407('0x1f')]===_0x4407('0x1e');var _0x367d55=_0x1c5a0c[_0x4407('0x20')];var _0x5b50b7=_0x2e709f?0x0:_0x417e19[_0x4407('0x21')];var _0x54caa1=_0x2e709f?_0x1c5a0c[_0x4407('0x20')]:_0x417e19[_0x4407('0x21')]+_0x417e19[_0x4407('0x1f')];var _0x2db8b2;if(_0x54caa1>=_0x367d55){_0x54caa1=_0x367d55;_0x2db8b2=0xc8;}else{_0x2db8b2=0xce;}_0x1840dd[_0x4407('0x1c')](_0x2db8b2);return _0x1840dd['set'](_0x4407('0x22'),_0x5b50b7+'-'+_0x54caa1+'/'+_0x367d55)['json'](_0x1c5a0c);}return null;};}function patchUpdates(_0x36a948){return function(_0x28bb2c){try{jsonpatch[_0x4407('0x23')](_0x28bb2c,_0x36a948,!![]);}catch(_0x445fe6){return BPromise['reject'](_0x445fe6);}return _0x28bb2c[_0x4407('0x24')]();};}function saveUpdates(_0x1fa9f1,_0x137f8e){return function(_0x2c880a){if(_0x2c880a){return _0x2c880a[_0x4407('0x25')](_0x1fa9f1)['then'](function(_0xa7265d){return _0xa7265d;});}return null;};}function removeEntity(_0x16272f,_0x5e214c){return function(_0x21b048){if(_0x21b048){return _0x21b048[_0x4407('0x26')]()['then'](function(){_0x16272f[_0x4407('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309274,_0x5386f4){return function(_0x40fb1e){if(!_0x40fb1e){_0x309274['sendStatus'](0x194);}return _0x40fb1e;};}function handleError(_0x374754,_0x4bf227){_0x4bf227=_0x4bf227||0x1f4;return function(_0x57ba27){logger[_0x4407('0x27')](_0x57ba27[_0x4407('0x28')]);if(_0x57ba27[_0x4407('0x29')]){delete _0x57ba27['name'];}_0x374754['status'](_0x4bf227)['send'](_0x57ba27);};}exports[_0x4407('0x2a')]=function(_0x2feb6b,_0x1f9828){var _0x84a8a={},_0x1d6b3d={},_0x37fba1={'count':0x0,'rows':[]};var _0x182bd9=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0x28e99e){return{'name':_0x28e99e[_0x4407('0x2b')],'type':_0x28e99e[_0x4407('0x2c')][_0x4407('0x2d')]};});_0x1d6b3d[_0x4407('0x2e')]=_[_0x4407('0x2f')](_0x182bd9,_0x4407('0x29'));_0x1d6b3d[_0x4407('0x30')]=_[_0x4407('0x31')](_0x2feb6b[_0x4407('0x30')]);_0x1d6b3d['filters']=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],_0x1d6b3d[_0x4407('0x30')]);_0x84a8a[_0x4407('0x32')]=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],qs[_0x4407('0x33')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x33')]));_0x84a8a[_0x4407('0x32')]=_0x84a8a['attributes'][_0x4407('0x34')]?_0x84a8a['attributes']:_0x1d6b3d[_0x4407('0x2e')];if(!_0x2feb6b['query']['hasOwnProperty'](_0x4407('0x35'))){_0x84a8a[_0x4407('0x1f')]=qs[_0x4407('0x1f')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x1f')]);_0x84a8a[_0x4407('0x21')]=qs[_0x4407('0x21')](_0x2feb6b['query'][_0x4407('0x21')]);}_0x84a8a[_0x4407('0x36')]=qs[_0x4407('0x37')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x37')]);_0x84a8a['where']=qs[_0x4407('0x38')](_['pick'](_0x2feb6b[_0x4407('0x30')],_0x1d6b3d[_0x4407('0x38')]),_0x182bd9);if(_0x2feb6b[_0x4407('0x30')][_0x4407('0x39')]){_0x84a8a['where']=_[_0x4407('0x3a')](_0x84a8a[_0x4407('0x3b')],{'$or':_[_0x4407('0x2f')](_0x182bd9,function(_0x1bf4e2){if(_0x1bf4e2[_0x4407('0x2c')]!==_0x4407('0x3c')){var _0x30de66={};_0x30de66[_0x1bf4e2[_0x4407('0x29')]]={'$like':'%'+_0x2feb6b[_0x4407('0x30')]['filter']+'%'};return _0x30de66;}})});}_0x84a8a=_['merge']({},_0x84a8a,_0x2feb6b[_0x4407('0x3d')]);var _0xc47d0e={'where':_0x84a8a[_0x4407('0x3b')]};return db[_0x4407('0x3e')]['count'](_0xc47d0e)[_0x4407('0x3f')](function(_0x2cb65e){_0x37fba1[_0x4407('0x20')]=_0x2cb65e;if(_0x2feb6b['query'][_0x4407('0x40')]){_0x84a8a['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4407('0x41')](_0x84a8a);})[_0x4407('0x3f')](function(_0x234fa5){_0x37fba1[_0x4407('0x42')]=_0x234fa5;return _0x37fba1;})[_0x4407('0x3f')](respondWithFilteredResult(_0x1f9828,_0x84a8a))['catch'](handleError(_0x1f9828,null));};exports[_0x4407('0x43')]=function(_0xf79768,_0x819b8b){var _0x15ba7b={'raw':!![],'where':{'id':_0xf79768[_0x4407('0x44')]['id']}},_0x5b41cf={};_0x5b41cf[_0x4407('0x2e')]=_[_0x4407('0x31')](db[_0x4407('0x3e')][_0x4407('0x45')]);_0x5b41cf['query']=_[_0x4407('0x31')](_0xf79768['query']);_0x5b41cf['filters']=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],_0x5b41cf['query']);_0x15ba7b[_0x4407('0x32')]=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],qs[_0x4407('0x33')](_0xf79768['query'][_0x4407('0x33')]));_0x15ba7b[_0x4407('0x32')]=_0x15ba7b[_0x4407('0x32')][_0x4407('0x34')]?_0x15ba7b[_0x4407('0x32')]:_0x5b41cf['model'];if(_0xf79768[_0x4407('0x30')][_0x4407('0x40')]){_0x15ba7b[_0x4407('0x47')]=[{'all':!![]}];}_0x15ba7b=_[_0x4407('0x3a')]({},_0x15ba7b,_0xf79768[_0x4407('0x3d')]);return db['JscriptyAnswerReport'][_0x4407('0x48')](_0x15ba7b)[_0x4407('0x3f')](handleEntityNotFound(_0x819b8b,null))[_0x4407('0x3f')](respondWithResult(_0x819b8b,null))[_0x4407('0x49')](handleError(_0x819b8b,null));};exports['create']=function(_0x18ff16,_0x2b18b8){return db['JscriptyAnswerReport'][_0x4407('0x4a')](_0x18ff16[_0x4407('0x4b')],{})['then'](respondWithResult(_0x2b18b8,0xc9))[_0x4407('0x49')](handleError(_0x2b18b8,null));};exports[_0x4407('0x25')]=function(_0x5ea36,_0x4fbc1f){if(_0x5ea36[_0x4407('0x4b')]['id']){delete _0x5ea36['body']['id'];}return db['JscriptyAnswerReport'][_0x4407('0x48')]({'where':{'id':_0x5ea36[_0x4407('0x44')]['id']}})['then'](handleEntityNotFound(_0x4fbc1f,null))[_0x4407('0x3f')](saveUpdates(_0x5ea36[_0x4407('0x4b')],null))[_0x4407('0x3f')](respondWithResult(_0x4fbc1f,null))[_0x4407('0x49')](handleError(_0x4fbc1f,null));};exports[_0x4407('0x26')]=function(_0x5a2c2b,_0x39865e){return db[_0x4407('0x3e')][_0x4407('0x48')]({'where':{'id':_0x5a2c2b[_0x4407('0x44')]['id']}})[_0x4407('0x3f')](handleEntityNotFound(_0x39865e,null))[_0x4407('0x3f')](removeEntity(_0x39865e,null))[_0x4407('0x49')](handleError(_0x39865e,null));};exports[_0x4407('0x4c')]=function(_0xd1dd66,_0x55f0ef){return db[_0x4407('0x3e')]['describe']()[_0x4407('0x3f')](respondWithResult(_0x55f0ef,null))[_0x4407('0x49')](handleError(_0x55f0ef,null));}; \ No newline at end of file +var _0x291c=['options','find','create','body','catch','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','sendStatus','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','merge','filter','then','include','rows','show','params','fields','includeAll'];(function(_0x25963b,_0x428fac){var _0x4f4c22=function(_0x5b749a){while(--_0x5b749a){_0x25963b['push'](_0x25963b['shift']());}};_0x4f4c22(++_0x428fac);}(_0x291c,0x137));var _0xc291=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x291c[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xc291('0x0'));var rimraf=require(_0xc291('0x1'));var zipdir=require(_0xc291('0x2'));var jsonpatch=require(_0xc291('0x3'));var rp=require(_0xc291('0x4'));var moment=require(_0xc291('0x5'));var BPromise=require(_0xc291('0x6'));var Mustache=require(_0xc291('0x7'));var util=require(_0xc291('0x8'));var path=require(_0xc291('0x9'));var sox=require(_0xc291('0xa'));var csv=require('to-csv');var ejs=require(_0xc291('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc291('0xc'));var crypto=require(_0xc291('0xd'));var jsforce=require(_0xc291('0xe'));var deskjs=require(_0xc291('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc291('0x10'));var Papa=require(_0xc291('0x11'));var Redis=require(_0xc291('0x12'));var authService=require(_0xc291('0x13'));var qs=require(_0xc291('0x14'));var as=require(_0xc291('0x15'));var hardwareService=require(_0xc291('0x16'));var logger=require(_0xc291('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc291('0x18'));var db=require(_0xc291('0x19'))['db'];function respondWithStatusCode(_0x3c7a29,_0x4d5eda){_0x4d5eda=_0x4d5eda||0xcc;return function(_0x3b8310){if(_0x3b8310){return _0x3c7a29['sendStatus'](_0x4d5eda);}return _0x3c7a29[_0xc291('0x1a')](_0x4d5eda)[_0xc291('0x1b')]();};}function respondWithResult(_0x1217f8,_0x31f272){_0x31f272=_0x31f272||0xc8;return function(_0x3c9877){if(_0x3c9877){return _0x1217f8[_0xc291('0x1a')](_0x31f272)[_0xc291('0x1c')](_0x3c9877);}};}function respondWithFilteredResult(_0x409efe,_0x1fe920){return function(_0x7eb5f1){if(_0x7eb5f1){var _0x5495ff=typeof _0x1fe920[_0xc291('0x1d')]===_0xc291('0x1e')&&typeof _0x1fe920['limit']===_0xc291('0x1e');var _0x54105c=_0x7eb5f1['count'];var _0x4c4286=_0x5495ff?0x0:_0x1fe920[_0xc291('0x1d')];var _0x32baae=_0x5495ff?_0x7eb5f1[_0xc291('0x1f')]:_0x1fe920[_0xc291('0x1d')]+_0x1fe920[_0xc291('0x20')];var _0x38cd5e;if(_0x32baae>=_0x54105c){_0x32baae=_0x54105c;_0x38cd5e=0xc8;}else{_0x38cd5e=0xce;}_0x409efe[_0xc291('0x1a')](_0x38cd5e);return _0x409efe[_0xc291('0x21')](_0xc291('0x22'),_0x4c4286+'-'+_0x32baae+'/'+_0x54105c)[_0xc291('0x1c')](_0x7eb5f1);}return null;};}function patchUpdates(_0x4b511c){return function(_0x42ac65){try{jsonpatch[_0xc291('0x23')](_0x42ac65,_0x4b511c,!![]);}catch(_0x1c4daf){return BPromise['reject'](_0x1c4daf);}return _0x42ac65[_0xc291('0x24')]();};}function saveUpdates(_0x56f7f9,_0x50fbda){return function(_0xd4e0cf){if(_0xd4e0cf){return _0xd4e0cf['update'](_0x56f7f9)['then'](function(_0x1b79af){return _0x1b79af;});}return null;};}function removeEntity(_0x1cec23,_0x359c1c){return function(_0x47a504){if(_0x47a504){return _0x47a504[_0xc291('0x25')]()['then'](function(){_0x1cec23[_0xc291('0x1a')](0xcc)[_0xc291('0x1b')]();});}};}function handleEntityNotFound(_0x2410f8,_0x773903){return function(_0x879898){if(!_0x879898){_0x2410f8[_0xc291('0x26')](0x194);}return _0x879898;};}function handleError(_0x26ae0e,_0x37d5a1){_0x37d5a1=_0x37d5a1||0x1f4;return function(_0x4d8647){logger[_0xc291('0x27')](_0x4d8647[_0xc291('0x28')]);if(_0x4d8647[_0xc291('0x29')]){delete _0x4d8647['name'];}_0x26ae0e[_0xc291('0x1a')](_0x37d5a1)[_0xc291('0x2a')](_0x4d8647);};}exports[_0xc291('0x2b')]=function(_0xd38395,_0xec5f68){var _0x48e001={},_0x192f4c={},_0x269c8e={'count':0x0,'rows':[]};var _0x98d30e=_['map'](db[_0xc291('0x2c')][_0xc291('0x2d')],function(_0x30a3d3){return{'name':_0x30a3d3[_0xc291('0x2e')],'type':_0x30a3d3['type']['key']};});_0x192f4c['model']=_[_0xc291('0x2f')](_0x98d30e,'name');_0x192f4c['query']=_[_0xc291('0x30')](_0xd38395[_0xc291('0x31')]);_0x192f4c[_0xc291('0x32')]=_[_0xc291('0x33')](_0x192f4c[_0xc291('0x34')],_0x192f4c[_0xc291('0x31')]);_0x48e001[_0xc291('0x35')]=_[_0xc291('0x33')](_0x192f4c[_0xc291('0x34')],qs['fields'](_0xd38395[_0xc291('0x31')]['fields']));_0x48e001[_0xc291('0x35')]=_0x48e001[_0xc291('0x35')][_0xc291('0x36')]?_0x48e001['attributes']:_0x192f4c[_0xc291('0x34')];if(!_0xd38395[_0xc291('0x31')]['hasOwnProperty'](_0xc291('0x37'))){_0x48e001[_0xc291('0x20')]=qs[_0xc291('0x20')](_0xd38395[_0xc291('0x31')][_0xc291('0x20')]);_0x48e001[_0xc291('0x1d')]=qs[_0xc291('0x1d')](_0xd38395[_0xc291('0x31')][_0xc291('0x1d')]);}_0x48e001[_0xc291('0x38')]=qs['sort'](_0xd38395[_0xc291('0x31')][_0xc291('0x39')]);_0x48e001[_0xc291('0x3a')]=qs[_0xc291('0x32')](_[_0xc291('0x3b')](_0xd38395[_0xc291('0x31')],_0x192f4c['filters']),_0x98d30e);if(_0xd38395[_0xc291('0x31')]['filter']){_0x48e001['where']=_[_0xc291('0x3c')](_0x48e001[_0xc291('0x3a')],{'$or':_[_0xc291('0x2f')](_0x98d30e,function(_0x2adc0b){if(_0x2adc0b['type']!=='VIRTUAL'){var _0x175aaa={};_0x175aaa[_0x2adc0b['name']]={'$like':'%'+_0xd38395['query'][_0xc291('0x3d')]+'%'};return _0x175aaa;}})});}_0x48e001=_[_0xc291('0x3c')]({},_0x48e001,_0xd38395['options']);var _0x45c951={'where':_0x48e001['where']};return db[_0xc291('0x2c')][_0xc291('0x1f')](_0x45c951)[_0xc291('0x3e')](function(_0x35964c){_0x269c8e[_0xc291('0x1f')]=_0x35964c;if(_0xd38395[_0xc291('0x31')]['includeAll']){_0x48e001[_0xc291('0x3f')]=[{'all':!![]}];}return db[_0xc291('0x2c')]['findAll'](_0x48e001);})['then'](function(_0x31f0b1){_0x269c8e[_0xc291('0x40')]=_0x31f0b1;return _0x269c8e;})[_0xc291('0x3e')](respondWithFilteredResult(_0xec5f68,_0x48e001))['catch'](handleError(_0xec5f68,null));};exports[_0xc291('0x41')]=function(_0x3c0f7e,_0x57ea24){var _0x1004f0={'raw':!![],'where':{'id':_0x3c0f7e[_0xc291('0x42')]['id']}},_0x54680e={};_0x54680e[_0xc291('0x34')]=_['keys'](db[_0xc291('0x2c')][_0xc291('0x2d')]);_0x54680e[_0xc291('0x31')]=_[_0xc291('0x30')](_0x3c0f7e[_0xc291('0x31')]);_0x54680e[_0xc291('0x32')]=_['intersection'](_0x54680e[_0xc291('0x34')],_0x54680e[_0xc291('0x31')]);_0x1004f0[_0xc291('0x35')]=_[_0xc291('0x33')](_0x54680e[_0xc291('0x34')],qs['fields'](_0x3c0f7e['query'][_0xc291('0x43')]));_0x1004f0['attributes']=_0x1004f0['attributes'][_0xc291('0x36')]?_0x1004f0[_0xc291('0x35')]:_0x54680e[_0xc291('0x34')];if(_0x3c0f7e[_0xc291('0x31')][_0xc291('0x44')]){_0x1004f0[_0xc291('0x3f')]=[{'all':!![]}];}_0x1004f0=_[_0xc291('0x3c')]({},_0x1004f0,_0x3c0f7e[_0xc291('0x45')]);return db[_0xc291('0x2c')][_0xc291('0x46')](_0x1004f0)['then'](handleEntityNotFound(_0x57ea24,null))[_0xc291('0x3e')](respondWithResult(_0x57ea24,null))['catch'](handleError(_0x57ea24,null));};exports[_0xc291('0x47')]=function(_0x3bec61,_0x273440){return db[_0xc291('0x2c')][_0xc291('0x47')](_0x3bec61[_0xc291('0x48')],{})['then'](respondWithResult(_0x273440,0xc9))[_0xc291('0x49')](handleError(_0x273440,null));};exports[_0xc291('0x4a')]=function(_0x25857a,_0x3f4c27){if(_0x25857a[_0xc291('0x48')]['id']){delete _0x25857a['body']['id'];}return db[_0xc291('0x2c')]['find']({'where':{'id':_0x25857a['params']['id']}})['then'](handleEntityNotFound(_0x3f4c27,null))[_0xc291('0x3e')](saveUpdates(_0x25857a[_0xc291('0x48')],null))[_0xc291('0x3e')](respondWithResult(_0x3f4c27,null))[_0xc291('0x49')](handleError(_0x3f4c27,null));};exports['destroy']=function(_0x82a20d,_0x428704){return db['JscriptyAnswerReport'][_0xc291('0x46')]({'where':{'id':_0x82a20d['params']['id']}})[_0xc291('0x3e')](handleEntityNotFound(_0x428704,null))['then'](removeEntity(_0x428704,null))[_0xc291('0x49')](handleError(_0x428704,null));};exports[_0xc291('0x4b')]=function(_0x3d3e9b,_0x39d910){return db['JscriptyAnswerReport'][_0xc291('0x4b')]()[_0xc291('0x3e')](respondWithResult(_0x39d910,null))[_0xc291('0x49')](handleError(_0x39d910,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index ca5a858..7f45685 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 _0x7bf9=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define'];(function(_0x22a14b,_0x366644){var _0x2de792=function(_0x493ce9){while(--_0x493ce9){_0x22a14b['push'](_0x22a14b['shift']());}};_0x2de792(++_0x366644);}(_0x7bf9,0xda));var _0x97bf=function(_0x612703,_0x24de39){_0x612703=_0x612703-0x0;var _0x5d258a=_0x7bf9[_0x612703];return _0x5d258a;};'use strict';var _=require(_0x97bf('0x0'));var util=require(_0x97bf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x97bf('0x2'));var BPromise=require(_0x97bf('0x3'));var rp=require(_0x97bf('0x4'));var fs=require('fs');var path=require(_0x97bf('0x5'));var rimraf=require('rimraf');var config=require(_0x97bf('0x6'));var attributes=require(_0x97bf('0x7'));module[_0x97bf('0x8')]=function(_0x571c9d,_0x116f84){return _0x571c9d[_0x97bf('0x9')](_0x97bf('0xa'),attributes,{'tableName':_0x97bf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20c1=['api','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','util','../../config/logger'];(function(_0x5dd776,_0x42f5da){var _0x4e5cb5=function(_0x633ae8){while(--_0x633ae8){_0x5dd776['push'](_0x5dd776['shift']());}};_0x4e5cb5(++_0x42f5da);}(_0x20c1,0x110));var _0x120c=function(_0x291092,_0x186dd5){_0x291092=_0x291092-0x0;var _0x5bdc8f=_0x20c1[_0x291092];return _0x5bdc8f;};'use strict';var _=require(_0x120c('0x0'));var util=require(_0x120c('0x1'));var logger=require(_0x120c('0x2'))(_0x120c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x120c('0x4'));var fs=require('fs');var path=require(_0x120c('0x5'));var rimraf=require(_0x120c('0x6'));var config=require('../../config/environment');var attributes=require(_0x120c('0x7'));module[_0x120c('0x8')]=function(_0x4af355,_0x3c08a2){return _0x4af355[_0x120c('0x9')](_0x120c('0xa'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 06f32e2..d83d52c 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 _0x7e85=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7e85,0x7b));var _0x57e8=function(_0x4df04b,_0x52b8cb){_0x4df04b=_0x4df04b-0x0;var _0x5ce10e=_0x7e85[_0x4df04b];return _0x5ce10e;};'use strict';var _=require(_0x57e8('0x0'));var util=require(_0x57e8('0x1'));var moment=require(_0x57e8('0x2'));var BPromise=require('bluebird');var rs=require(_0x57e8('0x3'));var fs=require('fs');var Redis=require(_0x57e8('0x4'));var db=require(_0x57e8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x57e8('0x6'));var config=require('../../config/environment');var jayson=require(_0x57e8('0x7'));var client=jayson[_0x57e8('0x8')][_0x57e8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb4b5,_0x36a34c,_0xf718d0){return new BPromise(function(_0x71e292,_0x561503){return client[_0x57e8('0xa')](_0x5eb4b5,_0xf718d0)[_0x57e8('0xb')](function(_0x1ad184){logger[_0x57e8('0xc')](_0x57e8('0xd'),_0x36a34c,'request\x20sent');logger[_0x57e8('0xe')](_0x57e8('0xf'),_0x36a34c,_0x57e8('0x10'),JSON[_0x57e8('0x11')](_0x1ad184));if(_0x1ad184[_0x57e8('0x12')]){if(_0x1ad184[_0x57e8('0x12')][_0x57e8('0x13')]===0x1f4){logger['error'](_0x57e8('0xd'),_0x36a34c,_0x1ad184[_0x57e8('0x12')][_0x57e8('0x14')]);return _0x561503(_0x1ad184['error'][_0x57e8('0x14')]);}logger['error'](_0x57e8('0xd'),_0x36a34c,_0x1ad184[_0x57e8('0x12')][_0x57e8('0x14')]);return _0x71e292(_0x1ad184['error'][_0x57e8('0x14')]);}else{logger[_0x57e8('0xc')](_0x57e8('0xd'),_0x36a34c,'request\x20sent');_0x71e292(_0x1ad184[_0x57e8('0x15')]['message']);}})[_0x57e8('0x16')](function(_0x5d0a3c){logger[_0x57e8('0x12')](_0x57e8('0xd'),_0x36a34c,_0x5d0a3c);_0x561503(_0x5d0a3c);});});} \ No newline at end of file +var _0xe228=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3ec759,_0x3aca05){var _0x53473a=function(_0x36a7f7){while(--_0x36a7f7){_0x3ec759['push'](_0x3ec759['shift']());}};_0x53473a(++_0x3aca05);}(_0xe228,0x188));var _0x8e22=function(_0x5c21e3,_0x121753){_0x5c21e3=_0x5c21e3-0x0;var _0x282548=_0xe228[_0x5c21e3];return _0x282548;};'use strict';var _=require(_0x8e22('0x0'));var util=require(_0x8e22('0x1'));var moment=require(_0x8e22('0x2'));var BPromise=require(_0x8e22('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e22('0x4'))['db'];var utils=require(_0x8e22('0x5'));var logger=require(_0x8e22('0x6'))(_0x8e22('0x7'));var config=require(_0x8e22('0x8'));var jayson=require(_0x8e22('0x9'));var client=jayson['client'][_0x8e22('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37f9ed,_0x3709cc,_0x2080de){return new BPromise(function(_0x40ea77,_0x26aeed){return client[_0x8e22('0xb')](_0x37f9ed,_0x2080de)[_0x8e22('0xc')](function(_0x872aa9){logger[_0x8e22('0xd')](_0x8e22('0xe'),_0x3709cc,_0x8e22('0xf'));logger[_0x8e22('0x10')](_0x8e22('0x11'),_0x3709cc,_0x8e22('0xf'),JSON[_0x8e22('0x12')](_0x872aa9));if(_0x872aa9[_0x8e22('0x13')]){if(_0x872aa9[_0x8e22('0x13')][_0x8e22('0x14')]===0x1f4){logger[_0x8e22('0x13')](_0x8e22('0xe'),_0x3709cc,_0x872aa9[_0x8e22('0x13')][_0x8e22('0x15')]);return _0x26aeed(_0x872aa9[_0x8e22('0x13')][_0x8e22('0x15')]);}logger[_0x8e22('0x13')](_0x8e22('0xe'),_0x3709cc,_0x872aa9[_0x8e22('0x13')]['message']);return _0x40ea77(_0x872aa9[_0x8e22('0x13')][_0x8e22('0x15')]);}else{logger['info'](_0x8e22('0xe'),_0x3709cc,_0x8e22('0xf'));_0x40ea77(_0x872aa9[_0x8e22('0x16')][_0x8e22('0x15')]);}})[_0x8e22('0x17')](function(_0x5670bf){logger['error'](_0x8e22('0xe'),_0x3709cc,_0x5670bf);_0x26aeed(_0x5670bf);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 71d6f92..06d49bd 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 _0xec94=['/:id/sessions','getSessions','getAnswers','getSummary','post','/:id/clone','clone','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xec94,0x1c3));var _0x4ec9=function(_0x3530d0,_0x4dfb47){_0x3530d0=_0x3530d0-0x0;var _0x2165c6=_0xec94[_0x3530d0];return _0x2165c6;};'use strict';var multer=require(_0x4ec9('0x0'));var util=require(_0x4ec9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4ec9('0x2'));var router=express[_0x4ec9('0x3')]();var fs_extra=require(_0x4ec9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4ec9('0x5'));var config=require(_0x4ec9('0x6'));var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0x4ec9('0x7')](),controller[_0x4ec9('0x8')]);router[_0x4ec9('0x9')]('/:id',auth[_0x4ec9('0x7')](),controller[_0x4ec9('0xa')]);router[_0x4ec9('0x9')](_0x4ec9('0xb'),auth['isAuthenticated'](),controller[_0x4ec9('0xc')]);router[_0x4ec9('0x9')]('/:id/answers',auth['isAuthenticated'](),controller[_0x4ec9('0xd')]);router[_0x4ec9('0x9')]('/:id/summary',auth[_0x4ec9('0x7')](),timeout('30s'),controller[_0x4ec9('0xe')]);router[_0x4ec9('0xf')]('/',auth[_0x4ec9('0x7')](),controller['create']);router[_0x4ec9('0xf')](_0x4ec9('0x10'),auth[_0x4ec9('0x7')](),controller[_0x4ec9('0x11')]);router['put'](_0x4ec9('0x12'),auth[_0x4ec9('0x7')](),controller['update']);router[_0x4ec9('0x13')](_0x4ec9('0x12'),auth[_0x4ec9('0x7')](),controller[_0x4ec9('0x14')]);module[_0x4ec9('0x15')]=router; \ No newline at end of file +var _0x1681=['exports','multer','util','connect-timeout','Router','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','show','/:id/sessions','getSessions','get','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','post','/:id/clone','put','/:id','update'];(function(_0x64b210,_0x301877){var _0x232a2b=function(_0x1056fd){while(--_0x1056fd){_0x64b210['push'](_0x64b210['shift']());}};_0x232a2b(++_0x301877);}(_0x1681,0x181));var _0x1168=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1681[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1168('0x0'));var util=require(_0x1168('0x1'));var path=require('path');var timeout=require(_0x1168('0x2'));var express=require('express');var router=express[_0x1168('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1168('0x4'));var controller=require(_0x1168('0x5'));router['get']('/',auth[_0x1168('0x6')](),controller[_0x1168('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1168('0x8')]);router['get'](_0x1168('0x9'),auth[_0x1168('0x6')](),controller[_0x1168('0xa')]);router[_0x1168('0xb')](_0x1168('0xc'),auth['isAuthenticated'](),controller[_0x1168('0xd')]);router[_0x1168('0xb')](_0x1168('0xe'),auth[_0x1168('0x6')](),timeout(_0x1168('0xf')),controller[_0x1168('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1168('0x11')]);router[_0x1168('0x12')](_0x1168('0x13'),auth[_0x1168('0x6')](),controller['clone']);router[_0x1168('0x14')](_0x1168('0x15'),auth['isAuthenticated'](),controller[_0x1168('0x16')]);router['delete'](_0x1168('0x15'),auth[_0x1168('0x6')](),controller['destroy']);module[_0x1168('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index b398791..8647e3e 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 _0xc84e=['isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','exports','name','STRING','long','isObjectLike','formData','stringify'];(function(_0x77dadd,_0x1ad4a4){var _0x3b8b7e=function(_0xa25516){while(--_0xa25516){_0x77dadd['push'](_0x77dadd['shift']());}};_0x3b8b7e(++_0x1ad4a4);}(_0xc84e,0x116));var _0xec84=function(_0x55e088,_0xcb7638){_0x55e088=_0x55e088-0x0;var _0x436151=_0xc84e[_0x55e088];return _0x436151;};'use strict';var Sequelize=require(_0xec84('0x0'));var _=require(_0xec84('0x1'));var util=require(_0xec84('0x2'));module[_0xec84('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0xec84('0x4')},'description':{'type':Sequelize[_0xec84('0x5')]},'formData':{'type':Sequelize['TEXT'](_0xec84('0x6')),'set':function(_0x45650c){if(_[_0xec84('0x7')](_0x45650c)){this['setDataValue'](_0xec84('0x8'),JSON[_0xec84('0x9')](_0x45650c));}else if(_[_0xec84('0xa')](_0x45650c)){this[_0xec84('0xb')](_0xec84('0x8'),_0x45650c);}else{this['setDataValue']('formData',util[_0xec84('0xc')](_0xec84('0xd'),this[_0xec84('0xe')](_0xec84('0x4'))||'',this[_0xec84('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xec84('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x657f=['getDataValue','name','description','BOOLEAN','lodash','exports','STRING','TEXT','long','isObjectLike','setDataValue','formData','isString','format'];(function(_0x111a7e,_0x525d7b){var _0x12b727=function(_0x48161c){while(--_0x48161c){_0x111a7e['push'](_0x111a7e['shift']());}};_0x12b727(++_0x525d7b);}(_0x657f,0x19a));var _0xf657=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0x657f[_0x146484];return _0x4c7aa3;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf657('0x0'));var util=require('util');module[_0xf657('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xf657('0x2')]},'formData':{'type':Sequelize[_0xf657('0x3')](_0xf657('0x4')),'set':function(_0x269cd2){if(_[_0xf657('0x5')](_0x269cd2)){this[_0xf657('0x6')](_0xf657('0x7'),JSON['stringify'](_0x269cd2));}else if(_[_0xf657('0x8')](_0x269cd2)){this[_0xf657('0x6')]('formData',_0x269cd2);}else{this['setDataValue']('formData',util[_0xf657('0x9')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xf657('0xa')](_0xf657('0xb'))||'',this['getDataValue'](_0xf657('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf657('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf657('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 8cb8e7b..0ba1420 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 _0xa3c3=['error','stack','name','send','index','JscriptyProject','rawAttributes','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','getSessions','JscriptySessionReport','keys','pick','ProjectId','getAnswers','findOne','JscriptyAnswerReport','number','indexOf','toString','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Projects'];(function(_0x7e2042,_0x376bea){var _0x10868c=function(_0x2c1467){while(--_0x2c1467){_0x7e2042['push'](_0x7e2042['shift']());}};_0x10868c(++_0x376bea);}(_0xa3c3,0xcc));var _0x3a3c=function(_0x223caa,_0x588636){_0x223caa=_0x223caa-0x0;var _0x22a861=_0xa3c3[_0x223caa];return _0x22a861;};'use strict';var emlformat=require(_0x3a3c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a3c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a3c('0x2'));var moment=require('moment');var BPromise=require(_0x3a3c('0x3'));var Mustache=require(_0x3a3c('0x4'));var util=require('util');var path=require(_0x3a3c('0x5'));var sox=require(_0x3a3c('0x6'));var csv=require(_0x3a3c('0x7'));var ejs=require(_0x3a3c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3a3c('0x9'));var crypto=require(_0x3a3c('0xa'));var jsforce=require(_0x3a3c('0xb'));var deskjs=require(_0x3a3c('0xc'));var toCsv=require(_0x3a3c('0x7'));var querystring=require('querystring');var Papa=require(_0x3a3c('0xd'));var Redis=require(_0x3a3c('0xe'));var authService=require(_0x3a3c('0xf'));var qs=require(_0x3a3c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a3c('0x11'));var logger=require(_0x3a3c('0x12'))(_0x3a3c('0x13'));var utils=require(_0x3a3c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3a3c('0x15'));var db=require(_0x3a3c('0x16'))['db'];function respondWithStatusCode(_0xfd482e,_0x3c0888){_0x3c0888=_0x3c0888||0xcc;return function(_0xbcc66e){if(_0xbcc66e){return _0xfd482e[_0x3a3c('0x17')](_0x3c0888);}return _0xfd482e[_0x3a3c('0x18')](_0x3c0888)[_0x3a3c('0x19')]();};}function respondWithResult(_0x1a3d3f,_0x1e3364){_0x1e3364=_0x1e3364||0xc8;return function(_0x479a40){if(_0x479a40){return _0x1a3d3f[_0x3a3c('0x18')](_0x1e3364)[_0x3a3c('0x1a')](_0x479a40);}};}function respondWithFilteredResult(_0x48da64,_0x40da17){return function(_0x2e31e5){if(_0x2e31e5){var _0x2dc0d9=typeof _0x40da17[_0x3a3c('0x1b')]===_0x3a3c('0x1c')&&typeof _0x40da17[_0x3a3c('0x1d')]===_0x3a3c('0x1c');var _0x43c87c=_0x2e31e5[_0x3a3c('0x1e')];var _0x9cf87e=_0x2dc0d9?0x0:_0x40da17[_0x3a3c('0x1b')];var _0x1e38b0=_0x2dc0d9?_0x2e31e5[_0x3a3c('0x1e')]:_0x40da17[_0x3a3c('0x1b')]+_0x40da17['limit'];var _0x35825a;if(_0x1e38b0>=_0x43c87c){_0x1e38b0=_0x43c87c;_0x35825a=0xc8;}else{_0x35825a=0xce;}_0x48da64[_0x3a3c('0x18')](_0x35825a);return _0x48da64[_0x3a3c('0x1f')](_0x3a3c('0x20'),_0x9cf87e+'-'+_0x1e38b0+'/'+_0x43c87c)[_0x3a3c('0x1a')](_0x2e31e5);}return null;};}function patchUpdates(_0x56079e){return function(_0x24af26){try{jsonpatch[_0x3a3c('0x21')](_0x24af26,_0x56079e,!![]);}catch(_0x1ca24a){return BPromise[_0x3a3c('0x22')](_0x1ca24a);}return _0x24af26[_0x3a3c('0x23')]();};}function saveUpdates(_0x42fa28,_0x17a04c){return function(_0x97e5c8){if(_0x97e5c8){return _0x97e5c8[_0x3a3c('0x24')](_0x42fa28)[_0x3a3c('0x25')](function(_0x28ff23){return _0x28ff23;});}return null;};}function removeEntity(_0x36691a,_0x2fb642){return function(_0x49df72){if(_0x49df72){return _0x49df72[_0x3a3c('0x26')]()[_0x3a3c('0x25')](function(){var _0x48f474=_0x49df72['get']({'plain':!![]});var _0x1b2144=_0x3a3c('0x27');return db['UserProfileResource'][_0x3a3c('0x26')]({'where':{'type':_0x1b2144,'resourceId':_0x48f474['id']}})[_0x3a3c('0x25')](function(){return _0x49df72;});})['then'](function(){_0x36691a[_0x3a3c('0x18')](0xcc)[_0x3a3c('0x19')]();});}};}function handleEntityNotFound(_0x42ffb8,_0x4eeacf){return function(_0x3d0c54){if(!_0x3d0c54){_0x42ffb8[_0x3a3c('0x17')](0x194);}return _0x3d0c54;};}function handleError(_0x9b4ef,_0x22c16f){_0x22c16f=_0x22c16f||0x1f4;return function(_0x28a0c7){logger[_0x3a3c('0x28')](_0x28a0c7[_0x3a3c('0x29')]);if(_0x28a0c7['name']){delete _0x28a0c7[_0x3a3c('0x2a')];}_0x9b4ef[_0x3a3c('0x18')](_0x22c16f)[_0x3a3c('0x2b')](_0x28a0c7);};}exports[_0x3a3c('0x2c')]=function(_0x1f5595,_0x34aa92){var _0x44f2a0={},_0x553072={},_0x8e167d={'count':0x0,'rows':[]};var _0x3533ca=_['map'](db[_0x3a3c('0x2d')][_0x3a3c('0x2e')],function(_0x3b3208){return{'name':_0x3b3208['fieldName'],'type':_0x3b3208['type'][_0x3a3c('0x2f')]};});_0x553072['model']=_[_0x3a3c('0x30')](_0x3533ca,'name');_0x553072[_0x3a3c('0x31')]=_['keys'](_0x1f5595[_0x3a3c('0x31')]);_0x553072[_0x3a3c('0x32')]=_[_0x3a3c('0x33')](_0x553072[_0x3a3c('0x34')],_0x553072['query']);_0x44f2a0[_0x3a3c('0x35')]=_['intersection'](_0x553072['model'],qs['fields'](_0x1f5595[_0x3a3c('0x31')][_0x3a3c('0x36')]));_0x44f2a0[_0x3a3c('0x35')]=_0x44f2a0[_0x3a3c('0x35')]['length']?_0x44f2a0['attributes']:_0x553072[_0x3a3c('0x34')];if(!_0x1f5595[_0x3a3c('0x31')][_0x3a3c('0x37')](_0x3a3c('0x38'))){_0x44f2a0[_0x3a3c('0x1d')]=qs[_0x3a3c('0x1d')](_0x1f5595['query'][_0x3a3c('0x1d')]);_0x44f2a0[_0x3a3c('0x1b')]=qs['offset'](_0x1f5595[_0x3a3c('0x31')]['offset']);}_0x44f2a0[_0x3a3c('0x39')]=qs[_0x3a3c('0x3a')](_0x1f5595['query'][_0x3a3c('0x3a')]);_0x44f2a0[_0x3a3c('0x3b')]=qs['filters'](_['pick'](_0x1f5595[_0x3a3c('0x31')],_0x553072['filters']),_0x3533ca);if(_0x1f5595[_0x3a3c('0x31')][_0x3a3c('0x3c')]){_0x44f2a0[_0x3a3c('0x3b')]=_[_0x3a3c('0x3d')](_0x44f2a0[_0x3a3c('0x3b')],{'$or':_[_0x3a3c('0x30')](_0x3533ca,function(_0x17418a){if(_0x17418a[_0x3a3c('0x3e')]!==_0x3a3c('0x3f')){var _0x29bdbf={};_0x29bdbf[_0x17418a[_0x3a3c('0x2a')]]={'$like':'%'+_0x1f5595['query'][_0x3a3c('0x3c')]+'%'};return _0x29bdbf;}})});}_0x44f2a0=_[_0x3a3c('0x3d')]({},_0x44f2a0,_0x1f5595[_0x3a3c('0x40')]);var _0x39922f={'where':_0x44f2a0[_0x3a3c('0x3b')]};return db[_0x3a3c('0x2d')]['count'](_0x39922f)[_0x3a3c('0x25')](function(_0xa4197f){_0x8e167d['count']=_0xa4197f;if(_0x1f5595[_0x3a3c('0x31')]['includeAll']){_0x44f2a0[_0x3a3c('0x41')]=[{'all':!![]}];}return db[_0x3a3c('0x2d')][_0x3a3c('0x42')](_0x44f2a0);})[_0x3a3c('0x25')](function(_0x48204b){_0x8e167d[_0x3a3c('0x43')]=_0x48204b;return _0x8e167d;})[_0x3a3c('0x25')](respondWithFilteredResult(_0x34aa92,_0x44f2a0))['catch'](handleError(_0x34aa92,null));};exports[_0x3a3c('0x44')]=function(_0x14ba42,_0x43b0b1){var _0x33e61c={'raw':![],'where':{'id':_0x14ba42[_0x3a3c('0x45')]['id']}},_0x19b05c={};_0x19b05c['model']=_['keys'](db[_0x3a3c('0x2d')][_0x3a3c('0x2e')]);_0x19b05c[_0x3a3c('0x31')]=_['keys'](_0x14ba42[_0x3a3c('0x31')]);_0x19b05c['filters']=_[_0x3a3c('0x33')](_0x19b05c['model'],_0x19b05c[_0x3a3c('0x31')]);_0x33e61c[_0x3a3c('0x35')]=_[_0x3a3c('0x33')](_0x19b05c[_0x3a3c('0x34')],qs[_0x3a3c('0x36')](_0x14ba42[_0x3a3c('0x31')][_0x3a3c('0x36')]));_0x33e61c[_0x3a3c('0x35')]=_0x33e61c[_0x3a3c('0x35')][_0x3a3c('0x46')]?_0x33e61c['attributes']:_0x19b05c[_0x3a3c('0x34')];if(_0x14ba42[_0x3a3c('0x31')][_0x3a3c('0x47')]){_0x33e61c['include']=[{'all':!![]}];}_0x33e61c=_['merge']({},_0x33e61c,_0x14ba42[_0x3a3c('0x40')]);return db[_0x3a3c('0x2d')][_0x3a3c('0x48')](_0x33e61c)['then'](handleEntityNotFound(_0x43b0b1,null))[_0x3a3c('0x25')](respondWithResult(_0x43b0b1,null))[_0x3a3c('0x49')](handleError(_0x43b0b1,null));};exports[_0x3a3c('0x4a')]=function(_0x2f7527,_0x25d481){return db[_0x3a3c('0x2d')][_0x3a3c('0x4a')](_0x2f7527[_0x3a3c('0x4b')],{})[_0x3a3c('0x25')](function(_0x109624){var _0x47e969=_0x2f7527[_0x3a3c('0x4c')][_0x3a3c('0x4d')]({'plain':!![]});if(!_0x47e969)throw new Error(_0x3a3c('0x4e'));if(_0x47e969[_0x3a3c('0x4f')]===_0x3a3c('0x4c')){var _0x1edbd5=_0x109624[_0x3a3c('0x4d')]({'plain':!![]});var _0x36e58f=_0x3a3c('0x27');return db[_0x3a3c('0x50')]['find']({'where':{'name':_0x36e58f,'userProfileId':_0x47e969['userProfileId']},'raw':!![]})['then'](function(_0x17dc7b){if(_0x17dc7b&&_0x17dc7b[_0x3a3c('0x51')]===0x0){return db[_0x3a3c('0x52')]['create']({'name':_0x1edbd5[_0x3a3c('0x2a')],'resourceId':_0x1edbd5['id'],'type':_0x17dc7b[_0x3a3c('0x2a')],'sectionId':_0x17dc7b['id']},{})[_0x3a3c('0x25')](function(){return _0x109624;});}else{return _0x109624;}})[_0x3a3c('0x49')](function(_0x283cc8){logger['error'](_0x3a3c('0x53'),_0x283cc8);throw _0x283cc8;});}return _0x109624;})[_0x3a3c('0x25')](respondWithResult(_0x25d481,0xc9))['catch'](handleError(_0x25d481,null));};exports[_0x3a3c('0x54')]=function(_0x5664ba,_0x444e0d){var _0x1c5891={'where':{'id':_0x5664ba['params']['id']}},_0x10f35f={};_0x10f35f[_0x3a3c('0x34')]=_['keys'](db[_0x3a3c('0x2d')][_0x3a3c('0x2e')]);_0x1c5891[_0x3a3c('0x35')]=_[_0x3a3c('0x33')](_0x10f35f[_0x3a3c('0x34')],qs[_0x3a3c('0x36')](_0x5664ba['query'][_0x3a3c('0x36')]));_0x1c5891[_0x3a3c('0x35')]=_0x1c5891['attributes'][_0x3a3c('0x46')]?_0x1c5891[_0x3a3c('0x35')]:_0x10f35f[_0x3a3c('0x34')];if(_0x5664ba[_0x3a3c('0x31')][_0x3a3c('0x47')]){_0x1c5891[_0x3a3c('0x41')]=[{'all':!![]}];}_0x1c5891=_['merge']({},_0x1c5891,_0x5664ba[_0x3a3c('0x40')]);return db[_0x3a3c('0x2d')][_0x3a3c('0x48')](_0x1c5891)[_0x3a3c('0x25')](handleEntityNotFound(_0x444e0d,null))['then'](function(_0x5c71e1){if(_0x5c71e1){var _0x32c26d=_0x5c71e1[_0x3a3c('0x4d')]({'plain':!![]});_0x32c26d=qs[_0x3a3c('0x55')](_0x32c26d,['id',_0x3a3c('0x56'),_0x3a3c('0x57')]);_0x5664ba['body']=_[_0x3a3c('0x55')](_0x5664ba[_0x3a3c('0x4b')],['id',_0x3a3c('0x56'),'updatedAt']);return db[_0x3a3c('0x2d')]['create'](_[_0x3a3c('0x3d')](_0x32c26d,_0x5664ba[_0x3a3c('0x4b')]),{'include':_0x5664ba[_0x3a3c('0x31')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2c5a9f){var _0x5d5c76=_0x5664ba[_0x3a3c('0x4c')][_0x3a3c('0x4d')]({'plain':!![]});if(!_0x5d5c76)throw new Error(_0x3a3c('0x4e'));if(_0x5d5c76['role']===_0x3a3c('0x4c')){var _0xbf031b=_0x2c5a9f[_0x3a3c('0x4d')]({'plain':!![]});var _0xde93dd=_0x3a3c('0x27');return db[_0x3a3c('0x50')][_0x3a3c('0x48')]({'where':{'name':_0xde93dd,'userProfileId':_0x5d5c76[_0x3a3c('0x58')]},'raw':!![]})['then'](function(_0x45f670){if(_0x45f670&&_0x45f670['autoAssociation']===0x0){return db[_0x3a3c('0x52')]['create']({'name':_0xbf031b[_0x3a3c('0x2a')],'resourceId':_0xbf031b['id'],'type':_0x45f670[_0x3a3c('0x2a')],'sectionId':_0x45f670['id']},{})[_0x3a3c('0x25')](function(){return _0x2c5a9f;});}else{return _0x2c5a9f;}})[_0x3a3c('0x49')](function(_0x511341){logger[_0x3a3c('0x28')](_0x3a3c('0x53'),_0x511341);throw _0x511341;});}return _0x2c5a9f;});}})['then'](respondWithResult(_0x444e0d,0xc9))['catch'](handleError(_0x444e0d,null));};exports[_0x3a3c('0x24')]=function(_0x718999,_0x4b715a){if(_0x718999[_0x3a3c('0x4b')]['id']){delete _0x718999[_0x3a3c('0x4b')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x718999['params']['id']}})[_0x3a3c('0x25')](handleEntityNotFound(_0x4b715a,null))[_0x3a3c('0x25')](saveUpdates(_0x718999['body'],null))[_0x3a3c('0x25')](respondWithResult(_0x4b715a,null))['catch'](handleError(_0x4b715a,null));};exports[_0x3a3c('0x26')]=function(_0x314b19,_0x4b000c){return db[_0x3a3c('0x2d')][_0x3a3c('0x48')]({'where':{'id':_0x314b19['params']['id']}})['then'](handleEntityNotFound(_0x4b000c,null))[_0x3a3c('0x25')](removeEntity(_0x4b000c,null))[_0x3a3c('0x49')](handleError(_0x4b000c,null));};exports[_0x3a3c('0x59')]=function(_0x405f1f,_0x38dc67,_0xd42228){var _0x2c9895={'raw':!![],'where':{}};var _0x1c9646={};var _0x22042c={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x405f1f[_0x3a3c('0x45')]['id']}})[_0x3a3c('0x25')](handleEntityNotFound(_0x38dc67,null))['then'](function(_0x4f39ec){if(_0x4f39ec){_0x1c9646[_0x3a3c('0x34')]=_['keys'](db[_0x3a3c('0x5a')][_0x3a3c('0x2e')]);_0x1c9646[_0x3a3c('0x31')]=_[_0x3a3c('0x5b')](_0x405f1f['query']);_0x1c9646['filters']=_[_0x3a3c('0x33')](_0x1c9646[_0x3a3c('0x34')],_0x1c9646[_0x3a3c('0x31')]);_0x2c9895[_0x3a3c('0x35')]=_[_0x3a3c('0x33')](_0x1c9646[_0x3a3c('0x34')],qs[_0x3a3c('0x36')](_0x405f1f[_0x3a3c('0x31')][_0x3a3c('0x36')]));_0x2c9895[_0x3a3c('0x35')]=_0x2c9895[_0x3a3c('0x35')][_0x3a3c('0x46')]?_0x2c9895[_0x3a3c('0x35')]:_0x1c9646[_0x3a3c('0x34')];if(!_0x405f1f[_0x3a3c('0x31')][_0x3a3c('0x37')](_0x3a3c('0x38'))){_0x2c9895[_0x3a3c('0x1d')]=qs[_0x3a3c('0x1d')](_0x405f1f[_0x3a3c('0x31')][_0x3a3c('0x1d')]);_0x2c9895[_0x3a3c('0x1b')]=qs[_0x3a3c('0x1b')](_0x405f1f[_0x3a3c('0x31')][_0x3a3c('0x1b')]);}_0x2c9895[_0x3a3c('0x39')]=qs[_0x3a3c('0x3a')](_0x405f1f['query'][_0x3a3c('0x3a')]);_0x2c9895[_0x3a3c('0x3b')]=qs[_0x3a3c('0x32')](_[_0x3a3c('0x5c')](_0x405f1f[_0x3a3c('0x31')],_0x1c9646['filters']));_0x2c9895[_0x3a3c('0x3b')][_0x3a3c('0x5d')]=_0x4f39ec['id'];if(_0x405f1f['query'][_0x3a3c('0x3c')]){_0x2c9895[_0x3a3c('0x3b')]=_[_0x3a3c('0x3d')](_0x2c9895[_0x3a3c('0x3b')],{'$or':_['map'](_0x2c9895['attributes'],function(_0x4e5fcb){var _0x437fd1={};_0x437fd1[_0x4e5fcb]={'$like':'%'+_0x405f1f[_0x3a3c('0x31')]['filter']+'%'};return _0x437fd1;})});}_0x2c9895=_[_0x3a3c('0x3d')]({},_0x2c9895,_0x405f1f[_0x3a3c('0x40')]);return db[_0x3a3c('0x5a')][_0x3a3c('0x1e')]({'where':_0x2c9895[_0x3a3c('0x3b')]})[_0x3a3c('0x25')](function(_0x5e76c4){_0x22042c[_0x3a3c('0x1e')]=_0x5e76c4;if(_0x405f1f[_0x3a3c('0x31')][_0x3a3c('0x47')]){_0x2c9895['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x3a3c('0x42')](_0x2c9895);})['then'](function(_0x1c812b){_0x22042c[_0x3a3c('0x43')]=_0x1c812b;return _0x22042c;});}})[_0x3a3c('0x25')](respondWithFilteredResult(_0x38dc67,_0x2c9895))[_0x3a3c('0x49')](handleError(_0x38dc67,null));};exports[_0x3a3c('0x5e')]=function(_0x52d3ae,_0x156824,_0x1b7b81){var _0x39cdff={'raw':!![],'where':{}};var _0x24aabd={};var _0x3b5fd2={'count':0x0,'rows':[]};return db[_0x3a3c('0x2d')][_0x3a3c('0x5f')]({'where':{'id':_0x52d3ae[_0x3a3c('0x45')]['id']}})[_0x3a3c('0x25')](handleEntityNotFound(_0x156824,null))['then'](function(_0x94119e){if(_0x94119e){_0x24aabd[_0x3a3c('0x34')]=_[_0x3a3c('0x5b')](db['JscriptyAnswerReport'][_0x3a3c('0x2e')]);_0x24aabd['query']=_[_0x3a3c('0x5b')](_0x52d3ae[_0x3a3c('0x31')]);_0x24aabd[_0x3a3c('0x32')]=_[_0x3a3c('0x33')](_0x24aabd[_0x3a3c('0x34')],_0x24aabd[_0x3a3c('0x31')]);_0x39cdff['attributes']=_[_0x3a3c('0x33')](_0x24aabd['model'],qs['fields'](_0x52d3ae[_0x3a3c('0x31')][_0x3a3c('0x36')]));_0x39cdff[_0x3a3c('0x35')]=_0x39cdff[_0x3a3c('0x35')][_0x3a3c('0x46')]?_0x39cdff[_0x3a3c('0x35')]:_0x24aabd[_0x3a3c('0x34')];if(!_0x52d3ae[_0x3a3c('0x31')]['hasOwnProperty']('nolimit')){_0x39cdff[_0x3a3c('0x1d')]=qs[_0x3a3c('0x1d')](_0x52d3ae[_0x3a3c('0x31')][_0x3a3c('0x1d')]);_0x39cdff[_0x3a3c('0x1b')]=qs[_0x3a3c('0x1b')](_0x52d3ae['query'][_0x3a3c('0x1b')]);}_0x39cdff[_0x3a3c('0x39')]=qs[_0x3a3c('0x3a')](_0x52d3ae[_0x3a3c('0x31')][_0x3a3c('0x3a')]);_0x39cdff['where']=qs[_0x3a3c('0x32')](_[_0x3a3c('0x5c')](_0x52d3ae['query'],_0x24aabd['filters']));_0x39cdff[_0x3a3c('0x3b')][_0x3a3c('0x5d')]=_0x94119e['id'];if(_0x52d3ae[_0x3a3c('0x31')][_0x3a3c('0x3c')]){_0x39cdff['where']=_['merge'](_0x39cdff[_0x3a3c('0x3b')],{'$or':_[_0x3a3c('0x30')](_0x39cdff['attributes'],function(_0x12cda2){var _0x5abbbe={};_0x5abbbe[_0x12cda2]={'$like':'%'+_0x52d3ae[_0x3a3c('0x31')][_0x3a3c('0x3c')]+'%'};return _0x5abbbe;})});}_0x39cdff=_[_0x3a3c('0x3d')]({},_0x39cdff,_0x52d3ae['options']);return db['JscriptyAnswerReport'][_0x3a3c('0x1e')]({'where':_0x39cdff[_0x3a3c('0x3b')]})[_0x3a3c('0x25')](function(_0x62784){_0x3b5fd2[_0x3a3c('0x1e')]=_0x62784;if(_0x52d3ae['query'][_0x3a3c('0x47')]){_0x39cdff[_0x3a3c('0x41')]=[{'all':!![]}];}return db[_0x3a3c('0x60')][_0x3a3c('0x42')](_0x39cdff);})[_0x3a3c('0x25')](function(_0x59765c){_0x3b5fd2[_0x3a3c('0x43')]=_0x59765c;return _0x3b5fd2;});}})[_0x3a3c('0x25')](respondWithFilteredResult(_0x156824,_0x39cdff))[_0x3a3c('0x49')](handleError(_0x156824,null));};function char(_0x285857){return _0x3a3c('0x61')===typeof _0x285857?String['fromCharCode'][_0x3a3c('0x21')](null,arguments):_0x285857;}function needsEncapsulation(_0x3a176f){return!!_0x3a176f&&(_0x3a176f['toString']()[_0x3a3c('0x62')](char(0xd))>=0x0||_0x3a176f['toString']()[_0x3a3c('0x62')](char(0xa))>=0x0||_0x3a176f['toString']()[_0x3a3c('0x62')](char(0x2c))>=0x0||_0x3a176f[_0x3a3c('0x63')]()[_0x3a3c('0x62')](char(0x22))>=0x0);}function encapsulate(_0x562cd5){var _0x17d83d=char(0x22),_0x548876='\x5c'+char(0x22),_0x695dad=_0x562cd5[_0x3a3c('0x63')]()[_0x3a3c('0x64')](new RegExp(_0x17d83d,'g'),_0x548876);return _0x17d83d+_0x695dad+_0x17d83d;}exports[_0x3a3c('0x65')]=function(_0x2db12b,_0x2d10fe,_0x1556b5){var _0x4c5768,_0x321382;var _0x439daa={'where':{'ProjectId':_0x2db12b['params']['id']}};if(_0x2db12b[_0x3a3c('0x31')][_0x3a3c('0x66')]){_0x439daa['where']['starttime']=JSON[_0x3a3c('0x67')](_0x2db12b[_0x3a3c('0x31')][_0x3a3c('0x66')]);}return db['JscriptySessionReport'][_0x3a3c('0x42')](_0x439daa)['then'](handleEntityNotFound(_0x2d10fe,null))[_0x3a3c('0x25')](function(_0x3bc744){if(_0x3bc744){_0x4c5768=_0x3bc744;return db[_0x3a3c('0x68')]['findAll']({'where':{'SessionId':{'$in':_[_0x3a3c('0x30')](_0x4c5768,'id')},'ProjectId':_0x2db12b[_0x3a3c('0x45')]['id']},'order':_0x3a3c('0x69')});}})[_0x3a3c('0x25')](handleEntityNotFound(_0x2d10fe,null))['then'](function(_0x105bb9){if(_0x105bb9){_0x321382=_0x105bb9;var _0x31ac2b={};for(var _0x1c7359=0x0,_0x585144=_0x321382[_0x3a3c('0x46')];_0x1c7359<_0x585144;_0x1c7359++){if(!_0x31ac2b[_0x3a3c('0x37')](_0x321382[_0x1c7359]['questionId'])){_0x31ac2b[_0x321382[_0x1c7359][_0x3a3c('0x6a')]]=needsEncapsulation(_0x321382[_0x1c7359]['question'])?encapsulate(_0x321382[_0x1c7359][_0x3a3c('0x6b')]):_0x321382[_0x1c7359][_0x3a3c('0x6b')];}}var _0x40e8a3=[],_0x5a76cc={};for(var _0x35a758=0x0,_0x1e3e0c=_0x4c5768['length'];_0x35a758<_0x1e3e0c;_0x35a758++){_0x5a76cc={'ProjectId':_0x2db12b['params']['id'],'SessionId':_0x4c5768[_0x35a758]['id'],'StartTime':moment(_0x4c5768[_0x35a758][_0x3a3c('0x6c')])[_0x3a3c('0x6d')](_0x3a3c('0x6e'))};for(var _0xa58a92=0x0,_0x2af349=_0x321382[_0x3a3c('0x46')];_0xa58a92<_0x2af349;_0xa58a92++){if(_0x321382[_0xa58a92][_0x3a3c('0x6f')]==_0x4c5768[_0x35a758]['id']&&_0x31ac2b['hasOwnProperty'](_0x321382[_0xa58a92]['questionId'])){_0x5a76cc[_0x31ac2b[_0x321382[_0xa58a92]['questionId']]]=_0x321382[_0xa58a92][_0x3a3c('0x70')];}}for(var _0xbe4b73 in _0x31ac2b){if(!_0x5a76cc['hasOwnProperty'](_0x31ac2b[_0xbe4b73])){_0x5a76cc[_0x31ac2b[_0xbe4b73]]=null;}}_0x40e8a3['push'](_0x5a76cc);}return _0x40e8a3;}})[_0x3a3c('0x25')](function(_0x599af1){if(!_[_0x3a3c('0x71')](_0x599af1)){var _0x4ac1f7=toCsv(_0x599af1);var _0xca4643=Date[_0x3a3c('0x72')]();fs[_0x3a3c('0x73')](util[_0x3a3c('0x6d')](_0x3a3c('0x74'),_0x2db12b[_0x3a3c('0x45')]['id'],_0xca4643),_0x4ac1f7);_0x2d10fe[_0x3a3c('0x75')]('Content-disposition','attachment;\x20filename='+util['format'](_0x3a3c('0x76'),_0x2db12b['params']['id'],_0xca4643));_0x2d10fe[_0x3a3c('0x75')](_0x3a3c('0x77'),_0x3a3c('0x78'));return _0x2d10fe[_0x3a3c('0x79')](util[_0x3a3c('0x6d')](_0x3a3c('0x74'),_0x2db12b[_0x3a3c('0x45')]['id'],_0xca4643));}else{return _0x2d10fe['sendStatus'](0xcc);}})[_0x3a3c('0x49')](handleError(_0x2d10fe,null));}; \ No newline at end of file +var _0x7732=['Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','sendStatus','name','send','map','JscriptyProject','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','findOne','JscriptySessionReport','pick','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader'];(function(_0x1ed47e,_0x2a0ff3){var _0x3b05bb=function(_0x37d4c7){while(--_0x37d4c7){_0x1ed47e['push'](_0x1ed47e['shift']());}};_0x3b05bb(++_0x2a0ff3);}(_0x7732,0x7d));var _0x2773=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x7732[_0x817d9b];return _0x2752e1;};'use strict';var emlformat=require(_0x2773('0x0'));var rimraf=require(_0x2773('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2773('0x2'));var rp=require(_0x2773('0x3'));var moment=require(_0x2773('0x4'));var BPromise=require(_0x2773('0x5'));var Mustache=require(_0x2773('0x6'));var util=require(_0x2773('0x7'));var path=require(_0x2773('0x8'));var sox=require(_0x2773('0x9'));var csv=require('to-csv');var ejs=require(_0x2773('0xa'));var fs=require('fs');var fs_extra=require(_0x2773('0xb'));var _=require('lodash');var squel=require(_0x2773('0xc'));var crypto=require(_0x2773('0xd'));var jsforce=require(_0x2773('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2773('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2773('0x10'));var qs=require(_0x2773('0x11'));var as=require(_0x2773('0x12'));var hardwareService=require(_0x2773('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2773('0x14'));var config=require(_0x2773('0x15'));var licenseUtil=require(_0x2773('0x16'));var db=require(_0x2773('0x17'))['db'];function respondWithStatusCode(_0x48a5fe,_0x2624ed){_0x2624ed=_0x2624ed||0xcc;return function(_0x4d8c06){if(_0x4d8c06){return _0x48a5fe['sendStatus'](_0x2624ed);}return _0x48a5fe[_0x2773('0x18')](_0x2624ed)[_0x2773('0x19')]();};}function respondWithResult(_0x13f322,_0x40a91b){_0x40a91b=_0x40a91b||0xc8;return function(_0x242bda){if(_0x242bda){return _0x13f322[_0x2773('0x18')](_0x40a91b)[_0x2773('0x1a')](_0x242bda);}};}function respondWithFilteredResult(_0x84a0d9,_0x2889b6){return function(_0x421c9b){if(_0x421c9b){var _0x26ce19=typeof _0x2889b6[_0x2773('0x1b')]===_0x2773('0x1c')&&typeof _0x2889b6['limit']==='undefined';var _0xa44f8d=_0x421c9b[_0x2773('0x1d')];var _0x541424=_0x26ce19?0x0:_0x2889b6[_0x2773('0x1b')];var _0x39f152=_0x26ce19?_0x421c9b[_0x2773('0x1d')]:_0x2889b6[_0x2773('0x1b')]+_0x2889b6[_0x2773('0x1e')];var _0x346204;if(_0x39f152>=_0xa44f8d){_0x39f152=_0xa44f8d;_0x346204=0xc8;}else{_0x346204=0xce;}_0x84a0d9[_0x2773('0x18')](_0x346204);return _0x84a0d9['set'](_0x2773('0x1f'),_0x541424+'-'+_0x39f152+'/'+_0xa44f8d)[_0x2773('0x1a')](_0x421c9b);}return null;};}function patchUpdates(_0x3a4130){return function(_0x458c91){try{jsonpatch[_0x2773('0x20')](_0x458c91,_0x3a4130,!![]);}catch(_0x4f7aea){return BPromise[_0x2773('0x21')](_0x4f7aea);}return _0x458c91[_0x2773('0x22')]();};}function saveUpdates(_0x34c956,_0x4a56ff){return function(_0xbf45a8){if(_0xbf45a8){return _0xbf45a8[_0x2773('0x23')](_0x34c956)[_0x2773('0x24')](function(_0x56ecde){return _0x56ecde;});}return null;};}function removeEntity(_0x1e3a80,_0x55dff7){return function(_0xab42c2){if(_0xab42c2){return _0xab42c2[_0x2773('0x25')]()[_0x2773('0x24')](function(){var _0x49b537=_0xab42c2[_0x2773('0x26')]({'plain':!![]});var _0x579b20=_0x2773('0x27');return db[_0x2773('0x28')][_0x2773('0x25')]({'where':{'type':_0x579b20,'resourceId':_0x49b537['id']}})['then'](function(){return _0xab42c2;});})[_0x2773('0x24')](function(){_0x1e3a80['status'](0xcc)[_0x2773('0x19')]();});}};}function handleEntityNotFound(_0x478da4,_0x3aa282){return function(_0x149790){if(!_0x149790){_0x478da4[_0x2773('0x29')](0x194);}return _0x149790;};}function handleError(_0x2cf303,_0x21ad6b){_0x21ad6b=_0x21ad6b||0x1f4;return function(_0xe02608){logger['error'](_0xe02608['stack']);if(_0xe02608['name']){delete _0xe02608[_0x2773('0x2a')];}_0x2cf303[_0x2773('0x18')](_0x21ad6b)[_0x2773('0x2b')](_0xe02608);};}exports['index']=function(_0x428f13,_0x44227c){var _0x286edb={},_0x5d6855={},_0x18c1e6={'count':0x0,'rows':[]};var _0x5a91f1=_[_0x2773('0x2c')](db[_0x2773('0x2d')]['rawAttributes'],function(_0x21ea54){return{'name':_0x21ea54[_0x2773('0x2e')],'type':_0x21ea54[_0x2773('0x2f')][_0x2773('0x30')]};});_0x5d6855[_0x2773('0x31')]=_[_0x2773('0x2c')](_0x5a91f1,_0x2773('0x2a'));_0x5d6855['query']=_['keys'](_0x428f13[_0x2773('0x32')]);_0x5d6855[_0x2773('0x33')]=_[_0x2773('0x34')](_0x5d6855['model'],_0x5d6855[_0x2773('0x32')]);_0x286edb[_0x2773('0x35')]=_[_0x2773('0x34')](_0x5d6855[_0x2773('0x31')],qs[_0x2773('0x36')](_0x428f13[_0x2773('0x32')][_0x2773('0x36')]));_0x286edb['attributes']=_0x286edb[_0x2773('0x35')][_0x2773('0x37')]?_0x286edb['attributes']:_0x5d6855[_0x2773('0x31')];if(!_0x428f13['query'][_0x2773('0x38')](_0x2773('0x39'))){_0x286edb[_0x2773('0x1e')]=qs[_0x2773('0x1e')](_0x428f13['query'][_0x2773('0x1e')]);_0x286edb[_0x2773('0x1b')]=qs[_0x2773('0x1b')](_0x428f13[_0x2773('0x32')][_0x2773('0x1b')]);}_0x286edb[_0x2773('0x3a')]=qs[_0x2773('0x3b')](_0x428f13[_0x2773('0x32')][_0x2773('0x3b')]);_0x286edb[_0x2773('0x3c')]=qs[_0x2773('0x33')](_['pick'](_0x428f13['query'],_0x5d6855['filters']),_0x5a91f1);if(_0x428f13[_0x2773('0x32')][_0x2773('0x3d')]){_0x286edb[_0x2773('0x3c')]=_['merge'](_0x286edb[_0x2773('0x3c')],{'$or':_[_0x2773('0x2c')](_0x5a91f1,function(_0x46aa0b){if(_0x46aa0b[_0x2773('0x2f')]!==_0x2773('0x3e')){var _0x215d39={};_0x215d39[_0x46aa0b[_0x2773('0x2a')]]={'$like':'%'+_0x428f13[_0x2773('0x32')][_0x2773('0x3d')]+'%'};return _0x215d39;}})});}_0x286edb=_[_0x2773('0x3f')]({},_0x286edb,_0x428f13[_0x2773('0x40')]);var _0x5bcfcf={'where':_0x286edb[_0x2773('0x3c')]};return db[_0x2773('0x2d')][_0x2773('0x1d')](_0x5bcfcf)['then'](function(_0x1bd090){_0x18c1e6['count']=_0x1bd090;if(_0x428f13[_0x2773('0x32')][_0x2773('0x41')]){_0x286edb[_0x2773('0x42')]=[{'all':!![]}];}return db[_0x2773('0x2d')][_0x2773('0x43')](_0x286edb);})[_0x2773('0x24')](function(_0x232853){_0x18c1e6[_0x2773('0x44')]=_0x232853;return _0x18c1e6;})[_0x2773('0x24')](respondWithFilteredResult(_0x44227c,_0x286edb))[_0x2773('0x45')](handleError(_0x44227c,null));};exports[_0x2773('0x46')]=function(_0x571f5a,_0x469d9a){var _0x14ca4a={'raw':![],'where':{'id':_0x571f5a[_0x2773('0x47')]['id']}},_0x1848e1={};_0x1848e1[_0x2773('0x31')]=_[_0x2773('0x48')](db['JscriptyProject'][_0x2773('0x49')]);_0x1848e1[_0x2773('0x32')]=_[_0x2773('0x48')](_0x571f5a[_0x2773('0x32')]);_0x1848e1[_0x2773('0x33')]=_['intersection'](_0x1848e1[_0x2773('0x31')],_0x1848e1[_0x2773('0x32')]);_0x14ca4a[_0x2773('0x35')]=_[_0x2773('0x34')](_0x1848e1[_0x2773('0x31')],qs[_0x2773('0x36')](_0x571f5a[_0x2773('0x32')][_0x2773('0x36')]));_0x14ca4a['attributes']=_0x14ca4a[_0x2773('0x35')]['length']?_0x14ca4a[_0x2773('0x35')]:_0x1848e1[_0x2773('0x31')];if(_0x571f5a[_0x2773('0x32')][_0x2773('0x41')]){_0x14ca4a['include']=[{'all':!![]}];}_0x14ca4a=_[_0x2773('0x3f')]({},_0x14ca4a,_0x571f5a['options']);return db[_0x2773('0x2d')][_0x2773('0x4a')](_0x14ca4a)['then'](handleEntityNotFound(_0x469d9a,null))[_0x2773('0x24')](respondWithResult(_0x469d9a,null))[_0x2773('0x45')](handleError(_0x469d9a,null));};exports['create']=function(_0x40f0a3,_0x40a72b){return db[_0x2773('0x2d')][_0x2773('0x4b')](_0x40f0a3[_0x2773('0x4c')],{})['then'](function(_0xed2922){var _0x3716e9=_0x40f0a3[_0x2773('0x4d')][_0x2773('0x26')]({'plain':!![]});if(!_0x3716e9)throw new Error(_0x2773('0x4e'));if(_0x3716e9[_0x2773('0x4f')]===_0x2773('0x4d')){var _0x181d03=_0xed2922[_0x2773('0x26')]({'plain':!![]});var _0x171952=_0x2773('0x27');return db[_0x2773('0x50')]['find']({'where':{'name':_0x171952,'userProfileId':_0x3716e9[_0x2773('0x51')]},'raw':!![]})[_0x2773('0x24')](function(_0x18db9c){if(_0x18db9c&&_0x18db9c[_0x2773('0x52')]===0x0){return db[_0x2773('0x28')][_0x2773('0x4b')]({'name':_0x181d03[_0x2773('0x2a')],'resourceId':_0x181d03['id'],'type':_0x18db9c[_0x2773('0x2a')],'sectionId':_0x18db9c['id']},{})[_0x2773('0x24')](function(){return _0xed2922;});}else{return _0xed2922;}})[_0x2773('0x45')](function(_0x4b3099){logger[_0x2773('0x53')](_0x2773('0x54'),_0x4b3099);throw _0x4b3099;});}return _0xed2922;})[_0x2773('0x24')](respondWithResult(_0x40a72b,0xc9))['catch'](handleError(_0x40a72b,null));};exports[_0x2773('0x55')]=function(_0x505355,_0x474e3a){var _0x51dde5={'where':{'id':_0x505355['params']['id']}},_0x1e1e59={};_0x1e1e59[_0x2773('0x31')]=_[_0x2773('0x48')](db['JscriptyProject'][_0x2773('0x49')]);_0x51dde5[_0x2773('0x35')]=_['intersection'](_0x1e1e59[_0x2773('0x31')],qs['fields'](_0x505355[_0x2773('0x32')]['fields']));_0x51dde5[_0x2773('0x35')]=_0x51dde5[_0x2773('0x35')][_0x2773('0x37')]?_0x51dde5[_0x2773('0x35')]:_0x1e1e59['model'];if(_0x505355[_0x2773('0x32')][_0x2773('0x41')]){_0x51dde5[_0x2773('0x42')]=[{'all':!![]}];}_0x51dde5=_[_0x2773('0x3f')]({},_0x51dde5,_0x505355[_0x2773('0x40')]);return db[_0x2773('0x2d')]['find'](_0x51dde5)[_0x2773('0x24')](handleEntityNotFound(_0x474e3a,null))[_0x2773('0x24')](function(_0x2cfa80){if(_0x2cfa80){var _0x485fd6=_0x2cfa80[_0x2773('0x26')]({'plain':!![]});_0x485fd6=qs[_0x2773('0x56')](_0x485fd6,['id','createdAt',_0x2773('0x57')]);_0x505355['body']=_[_0x2773('0x56')](_0x505355[_0x2773('0x4c')],['id','createdAt',_0x2773('0x57')]);return db[_0x2773('0x2d')][_0x2773('0x4b')](_[_0x2773('0x3f')](_0x485fd6,_0x505355[_0x2773('0x4c')]),{'include':_0x505355['query'][_0x2773('0x41')]?[{'all':!![]}]:undefined})[_0x2773('0x24')](function(_0x4b32b0){var _0x16309d=_0x505355[_0x2773('0x4d')][_0x2773('0x26')]({'plain':!![]});if(!_0x16309d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16309d[_0x2773('0x4f')]==='user'){var _0x209c70=_0x4b32b0[_0x2773('0x26')]({'plain':!![]});var _0xe3e465='Projects';return db['UserProfileSection'][_0x2773('0x4a')]({'where':{'name':_0xe3e465,'userProfileId':_0x16309d[_0x2773('0x51')]},'raw':!![]})['then'](function(_0xa5688c){if(_0xa5688c&&_0xa5688c[_0x2773('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x209c70['name'],'resourceId':_0x209c70['id'],'type':_0xa5688c[_0x2773('0x2a')],'sectionId':_0xa5688c['id']},{})[_0x2773('0x24')](function(){return _0x4b32b0;});}else{return _0x4b32b0;}})['catch'](function(_0x56bba9){logger[_0x2773('0x53')](_0x2773('0x54'),_0x56bba9);throw _0x56bba9;});}return _0x4b32b0;});}})[_0x2773('0x24')](respondWithResult(_0x474e3a,0xc9))[_0x2773('0x45')](handleError(_0x474e3a,null));};exports[_0x2773('0x23')]=function(_0x143cfc,_0x56e04d){if(_0x143cfc[_0x2773('0x4c')]['id']){delete _0x143cfc[_0x2773('0x4c')]['id'];}return db['JscriptyProject'][_0x2773('0x4a')]({'where':{'id':_0x143cfc['params']['id']}})['then'](handleEntityNotFound(_0x56e04d,null))['then'](saveUpdates(_0x143cfc[_0x2773('0x4c')],null))[_0x2773('0x24')](respondWithResult(_0x56e04d,null))[_0x2773('0x45')](handleError(_0x56e04d,null));};exports[_0x2773('0x25')]=function(_0x176b27,_0x133915){return db[_0x2773('0x2d')][_0x2773('0x4a')]({'where':{'id':_0x176b27[_0x2773('0x47')]['id']}})[_0x2773('0x24')](handleEntityNotFound(_0x133915,null))[_0x2773('0x24')](removeEntity(_0x133915,null))['catch'](handleError(_0x133915,null));};exports['getSessions']=function(_0x42f6a7,_0x5d8e1c,_0x358563){var _0x368ff8={'raw':!![],'where':{}};var _0x37e581={};var _0x34acc0={'count':0x0,'rows':[]};return db[_0x2773('0x2d')][_0x2773('0x58')]({'where':{'id':_0x42f6a7[_0x2773('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d8e1c,null))[_0x2773('0x24')](function(_0x3878dc){if(_0x3878dc){_0x37e581[_0x2773('0x31')]=_[_0x2773('0x48')](db[_0x2773('0x59')][_0x2773('0x49')]);_0x37e581[_0x2773('0x32')]=_['keys'](_0x42f6a7[_0x2773('0x32')]);_0x37e581['filters']=_[_0x2773('0x34')](_0x37e581['model'],_0x37e581['query']);_0x368ff8[_0x2773('0x35')]=_[_0x2773('0x34')](_0x37e581[_0x2773('0x31')],qs['fields'](_0x42f6a7[_0x2773('0x32')]['fields']));_0x368ff8[_0x2773('0x35')]=_0x368ff8['attributes'][_0x2773('0x37')]?_0x368ff8[_0x2773('0x35')]:_0x37e581['model'];if(!_0x42f6a7[_0x2773('0x32')][_0x2773('0x38')](_0x2773('0x39'))){_0x368ff8['limit']=qs[_0x2773('0x1e')](_0x42f6a7['query'][_0x2773('0x1e')]);_0x368ff8['offset']=qs[_0x2773('0x1b')](_0x42f6a7[_0x2773('0x32')]['offset']);}_0x368ff8[_0x2773('0x3a')]=qs['sort'](_0x42f6a7['query'][_0x2773('0x3b')]);_0x368ff8[_0x2773('0x3c')]=qs[_0x2773('0x33')](_[_0x2773('0x5a')](_0x42f6a7[_0x2773('0x32')],_0x37e581[_0x2773('0x33')]));_0x368ff8['where'][_0x2773('0x5b')]=_0x3878dc['id'];if(_0x42f6a7[_0x2773('0x32')][_0x2773('0x3d')]){_0x368ff8[_0x2773('0x3c')]=_[_0x2773('0x3f')](_0x368ff8[_0x2773('0x3c')],{'$or':_[_0x2773('0x2c')](_0x368ff8[_0x2773('0x35')],function(_0x1582af){var _0x268d9a={};_0x268d9a[_0x1582af]={'$like':'%'+_0x42f6a7['query'][_0x2773('0x3d')]+'%'};return _0x268d9a;})});}_0x368ff8=_[_0x2773('0x3f')]({},_0x368ff8,_0x42f6a7[_0x2773('0x40')]);return db['JscriptySessionReport'][_0x2773('0x1d')]({'where':_0x368ff8[_0x2773('0x3c')]})[_0x2773('0x24')](function(_0x3ee52b){_0x34acc0[_0x2773('0x1d')]=_0x3ee52b;if(_0x42f6a7[_0x2773('0x32')][_0x2773('0x41')]){_0x368ff8['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x368ff8);})[_0x2773('0x24')](function(_0x47ee3e){_0x34acc0[_0x2773('0x44')]=_0x47ee3e;return _0x34acc0;});}})[_0x2773('0x24')](respondWithFilteredResult(_0x5d8e1c,_0x368ff8))[_0x2773('0x45')](handleError(_0x5d8e1c,null));};exports[_0x2773('0x5c')]=function(_0x23dd30,_0x14dffd,_0x54ba29){var _0x2abb32={'raw':!![],'where':{}};var _0x3cbe44={};var _0x3e71ce={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x2773('0x58')]({'where':{'id':_0x23dd30[_0x2773('0x47')]['id']}})[_0x2773('0x24')](handleEntityNotFound(_0x14dffd,null))[_0x2773('0x24')](function(_0x3b67f8){if(_0x3b67f8){_0x3cbe44[_0x2773('0x31')]=_[_0x2773('0x48')](db[_0x2773('0x5d')][_0x2773('0x49')]);_0x3cbe44[_0x2773('0x32')]=_[_0x2773('0x48')](_0x23dd30['query']);_0x3cbe44['filters']=_[_0x2773('0x34')](_0x3cbe44[_0x2773('0x31')],_0x3cbe44[_0x2773('0x32')]);_0x2abb32[_0x2773('0x35')]=_[_0x2773('0x34')](_0x3cbe44[_0x2773('0x31')],qs[_0x2773('0x36')](_0x23dd30[_0x2773('0x32')][_0x2773('0x36')]));_0x2abb32[_0x2773('0x35')]=_0x2abb32[_0x2773('0x35')][_0x2773('0x37')]?_0x2abb32['attributes']:_0x3cbe44[_0x2773('0x31')];if(!_0x23dd30[_0x2773('0x32')][_0x2773('0x38')](_0x2773('0x39'))){_0x2abb32[_0x2773('0x1e')]=qs[_0x2773('0x1e')](_0x23dd30[_0x2773('0x32')][_0x2773('0x1e')]);_0x2abb32[_0x2773('0x1b')]=qs[_0x2773('0x1b')](_0x23dd30['query'][_0x2773('0x1b')]);}_0x2abb32['order']=qs[_0x2773('0x3b')](_0x23dd30[_0x2773('0x32')][_0x2773('0x3b')]);_0x2abb32[_0x2773('0x3c')]=qs[_0x2773('0x33')](_[_0x2773('0x5a')](_0x23dd30[_0x2773('0x32')],_0x3cbe44[_0x2773('0x33')]));_0x2abb32['where']['ProjectId']=_0x3b67f8['id'];if(_0x23dd30[_0x2773('0x32')][_0x2773('0x3d')]){_0x2abb32['where']=_[_0x2773('0x3f')](_0x2abb32['where'],{'$or':_[_0x2773('0x2c')](_0x2abb32[_0x2773('0x35')],function(_0x962729){var _0x2b89c7={};_0x2b89c7[_0x962729]={'$like':'%'+_0x23dd30[_0x2773('0x32')][_0x2773('0x3d')]+'%'};return _0x2b89c7;})});}_0x2abb32=_[_0x2773('0x3f')]({},_0x2abb32,_0x23dd30['options']);return db[_0x2773('0x5d')][_0x2773('0x1d')]({'where':_0x2abb32[_0x2773('0x3c')]})[_0x2773('0x24')](function(_0x133d6e){_0x3e71ce[_0x2773('0x1d')]=_0x133d6e;if(_0x23dd30[_0x2773('0x32')][_0x2773('0x41')]){_0x2abb32[_0x2773('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x2abb32);})['then'](function(_0x115762){_0x3e71ce['rows']=_0x115762;return _0x3e71ce;});}})[_0x2773('0x24')](respondWithFilteredResult(_0x14dffd,_0x2abb32))['catch'](handleError(_0x14dffd,null));};function char(_0x5f1085){return _0x2773('0x5e')===typeof _0x5f1085?String[_0x2773('0x5f')][_0x2773('0x20')](null,arguments):_0x5f1085;}function needsEncapsulation(_0x1e5fea){return!!_0x1e5fea&&(_0x1e5fea[_0x2773('0x60')]()[_0x2773('0x61')](char(0xd))>=0x0||_0x1e5fea[_0x2773('0x60')]()[_0x2773('0x61')](char(0xa))>=0x0||_0x1e5fea[_0x2773('0x60')]()[_0x2773('0x61')](char(0x2c))>=0x0||_0x1e5fea['toString']()[_0x2773('0x61')](char(0x22))>=0x0);}function encapsulate(_0x3cf49f){var _0x53e08c=char(0x22),_0x51fbf9='\x5c'+char(0x22),_0x3323f1=_0x3cf49f[_0x2773('0x60')]()[_0x2773('0x62')](new RegExp(_0x53e08c,'g'),_0x51fbf9);return _0x53e08c+_0x3323f1+_0x53e08c;}exports[_0x2773('0x63')]=function(_0x2f2ddb,_0xada81d,_0x36d317){var _0x4d0cf5,_0x210da0;var _0x30d8ce={'where':{'ProjectId':_0x2f2ddb[_0x2773('0x47')]['id']}};if(_0x2f2ddb[_0x2773('0x32')][_0x2773('0x64')]){_0x30d8ce[_0x2773('0x3c')][_0x2773('0x65')]=JSON[_0x2773('0x66')](_0x2f2ddb['query'][_0x2773('0x64')]);}return db[_0x2773('0x59')][_0x2773('0x43')](_0x30d8ce)[_0x2773('0x24')](handleEntityNotFound(_0xada81d,null))['then'](function(_0x51e073){if(_0x51e073){_0x4d0cf5=_0x51e073;return db[_0x2773('0x67')][_0x2773('0x43')]({'where':{'SessionId':{'$in':_[_0x2773('0x2c')](_0x4d0cf5,'id')},'ProjectId':_0x2f2ddb['params']['id']},'order':_0x2773('0x68')});}})[_0x2773('0x24')](handleEntityNotFound(_0xada81d,null))[_0x2773('0x24')](function(_0x40588e){if(_0x40588e){_0x210da0=_0x40588e;var _0x261ee9={};for(var _0x8af64d=0x0,_0x4a11db=_0x210da0['length'];_0x8af64d<_0x4a11db;_0x8af64d++){if(!_0x261ee9['hasOwnProperty'](_0x210da0[_0x8af64d][_0x2773('0x69')])){_0x261ee9[_0x210da0[_0x8af64d][_0x2773('0x69')]]=needsEncapsulation(_0x210da0[_0x8af64d][_0x2773('0x6a')])?encapsulate(_0x210da0[_0x8af64d]['question']):_0x210da0[_0x8af64d][_0x2773('0x6a')];}}var _0x315b80=[],_0x3bc3e4={};for(var _0x46491f=0x0,_0x1861ab=_0x4d0cf5[_0x2773('0x37')];_0x46491f<_0x1861ab;_0x46491f++){_0x3bc3e4={'ProjectId':_0x2f2ddb['params']['id'],'SessionId':_0x4d0cf5[_0x46491f]['id'],'StartTime':moment(_0x4d0cf5[_0x46491f][_0x2773('0x65')])['format'](_0x2773('0x6b'))};for(var _0x2ee625=0x0,_0x45faa1=_0x210da0['length'];_0x2ee625<_0x45faa1;_0x2ee625++){if(_0x210da0[_0x2ee625][_0x2773('0x6c')]==_0x4d0cf5[_0x46491f]['id']&&_0x261ee9[_0x2773('0x38')](_0x210da0[_0x2ee625][_0x2773('0x69')])){_0x3bc3e4[_0x261ee9[_0x210da0[_0x2ee625]['questionId']]]=_0x210da0[_0x2ee625][_0x2773('0x6d')];}}for(var _0x41698d in _0x261ee9){if(!_0x3bc3e4[_0x2773('0x38')](_0x261ee9[_0x41698d])){_0x3bc3e4[_0x261ee9[_0x41698d]]=null;}}_0x315b80[_0x2773('0x6e')](_0x3bc3e4);}return _0x315b80;}})[_0x2773('0x24')](function(_0x35622f){if(!_[_0x2773('0x6f')](_0x35622f)){var _0xcca37f=toCsv(_0x35622f);var _0x4c6d9f=Date[_0x2773('0x70')]();fs[_0x2773('0x71')](util[_0x2773('0x72')](_0x2773('0x73'),_0x2f2ddb[_0x2773('0x47')]['id'],_0x4c6d9f),_0xcca37f);_0xada81d[_0x2773('0x74')](_0x2773('0x75'),_0x2773('0x76')+util[_0x2773('0x72')](_0x2773('0x77'),_0x2f2ddb[_0x2773('0x47')]['id'],_0x4c6d9f));_0xada81d[_0x2773('0x74')]('Content-type',_0x2773('0x78'));return _0xada81d['download'](util[_0x2773('0x72')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2f2ddb['params']['id'],_0x4c6d9f));}else{return _0xada81d[_0x2773('0x29')](0xcc);}})[_0x2773('0x45')](handleError(_0xada81d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index c9b5364..0cf748f 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 _0xcb99=['../../config/logger','bluebird','request-promise','path','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash'];(function(_0x89bde,_0x4c9f88){var _0xb11164=function(_0x3841b8){while(--_0x3841b8){_0x89bde['push'](_0x89bde['shift']());}};_0xb11164(++_0x4c9f88);}(_0xcb99,0x8b));var _0x9cb9=function(_0x4eb7e6,_0x451464){_0x4eb7e6=_0x4eb7e6-0x0;var _0x3cf508=_0xcb99[_0x4eb7e6];return _0x3cf508;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var logger=require(_0x9cb9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9cb9('0x2'));var rp=require(_0x9cb9('0x3'));var fs=require('fs');var path=require(_0x9cb9('0x4'));var rimraf=require('rimraf');var config=require(_0x9cb9('0x5'));var attributes=require(_0x9cb9('0x6'));module['exports']=function(_0x214b72,_0x509cfc){return _0x214b72[_0x9cb9('0x7')](_0x9cb9('0x8'),attributes,{'tableName':_0x9cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fda=['bluebird','request-promise','path','rimraf','exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment'];(function(_0x3bfb1b,_0xf90d2e){var _0x2ca6c1=function(_0x3234e8){while(--_0x3234e8){_0x3bfb1b['push'](_0x3bfb1b['shift']());}};_0x2ca6c1(++_0xf90d2e);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x12ca37,_0x5d53c3){_0x12ca37=_0x12ca37-0x0;var _0x2980b7=_0x0fda[_0x12ca37];return _0x2980b7;};'use strict';var _=require(_0xa0fd('0x0'));var util=require('util');var logger=require(_0xa0fd('0x1'))(_0xa0fd('0x2'));var moment=require(_0xa0fd('0x3'));var BPromise=require(_0xa0fd('0x4'));var rp=require(_0xa0fd('0x5'));var fs=require('fs');var path=require(_0xa0fd('0x6'));var rimraf=require(_0xa0fd('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0xa0fd('0x8')]=function(_0x4aec58,_0x49b3c1){return _0x4aec58[_0xa0fd('0x9')](_0xa0fd('0xa'),attributes,{'tableName':_0xa0fd('0xb'),'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 4c75573..cc75a7d 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 _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4ac3a3,_0x5df7d0){var _0x141949=function(_0xcda288){while(--_0xcda288){_0x4ac3a3['push'](_0x4ac3a3['shift']());}};_0x141949(++_0x5df7d0);}(_0xe706,0xa3));var _0x6e70=function(_0x5eb4bb,_0xbd4598){_0x5eb4bb=_0x5eb4bb-0x0;var _0x12d25b=_0xe706[_0x5eb4bb];return _0x12d25b;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x50cadb,_0x38e7fa){var _0x177113=function(_0x225153){while(--_0x225153){_0x50cadb['push'](_0x50cadb['shift']());}};_0x177113(++_0x38e7fa);}(_0xe706,0xa3));var _0x6e70=function(_0x5da048,_0xca5c85){_0x5da048=_0x5da048-0x0;var _0x13dfc5=_0xe706[_0x5da048];return _0x13dfc5;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index aad8238..2686c8f 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 _0x7bf8=['../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x36734a,_0xdd12e1){var _0x565da1=function(_0x4e27d3){while(--_0x4e27d3){_0x36734a['push'](_0x36734a['shift']());}};_0x565da1(++_0xdd12e1);}(_0x7bf8,0x159));var _0x87bf=function(_0x4ecaec,_0x10e565){_0x4ecaec=_0x4ecaec-0x0;var _0x7209f8=_0x7bf8[_0x4ecaec];return _0x7209f8;};'use strict';var multer=require(_0x87bf('0x0'));var util=require(_0x87bf('0x1'));var path=require(_0x87bf('0x2'));var timeout=require('connect-timeout');var express=require(_0x87bf('0x3'));var router=express[_0x87bf('0x4')]();var fs_extra=require(_0x87bf('0x5'));var auth=require(_0x87bf('0x6'));var interaction=require(_0x87bf('0x7'));var config=require(_0x87bf('0x8'));var controller=require(_0x87bf('0x9'));router[_0x87bf('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x87bf('0xb'),auth['isAuthenticated'](),controller[_0x87bf('0xc')]);router[_0x87bf('0xa')](_0x87bf('0xd'),auth[_0x87bf('0xe')](),controller[_0x87bf('0xf')]);router['post']('/',auth[_0x87bf('0xe')](),controller[_0x87bf('0x10')]);router[_0x87bf('0x11')](_0x87bf('0xd'),auth['isAuthenticated'](),controller[_0x87bf('0x12')]);router[_0x87bf('0x13')](_0x87bf('0xd'),auth[_0x87bf('0xe')](),controller[_0x87bf('0x14')]);module[_0x87bf('0x15')]=router; \ No newline at end of file +var _0x73ee=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','describe','/:id','post','isAuthenticated','create','put','destroy','exports','multer','path','connect-timeout','express'];(function(_0x206d3d,_0x3ef2b7){var _0x4197fe=function(_0x2603dc){while(--_0x2603dc){_0x206d3d['push'](_0x206d3d['shift']());}};_0x4197fe(++_0x3ef2b7);}(_0x73ee,0xb0));var _0xe73e=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x73ee[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0xe73e('0x0'));var util=require('util');var path=require(_0xe73e('0x1'));var timeout=require(_0xe73e('0x2'));var express=require(_0xe73e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe73e('0x4'));var interaction=require(_0xe73e('0x5'));var config=require(_0xe73e('0x6'));var controller=require(_0xe73e('0x7'));router[_0xe73e('0x8')]('/',auth['isAuthenticated'](),controller[_0xe73e('0x9')]);router[_0xe73e('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xe73e('0xa')]);router[_0xe73e('0x8')](_0xe73e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe73e('0xc')]('/',auth[_0xe73e('0xd')](),controller[_0xe73e('0xe')]);router[_0xe73e('0xf')](_0xe73e('0xb'),auth[_0xe73e('0xd')](),controller['update']);router['delete'](_0xe73e('0xb'),auth[_0xe73e('0xd')](),controller[_0xe73e('0x10')]);module[_0xe73e('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 9ba0e97..92e4ecf 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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x1b245f,_0x3018b2){_0x1b245f=_0x1b245f-0x0;var _0x401bc6=_0x7a54[_0x1b245f];return _0x401bc6;};'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(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x7a54,0x106));var _0x47a5=function(_0x3545a4,_0x14d84a){_0x3545a4=_0x3545a4-0x0;var _0x4cb35d=_0x7a54[_0x3545a4];return _0x4cb35d;};'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 5d6f6c9..4a5e768 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 _0x0ede=['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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','Content-Range','reject','save','then','stack','name','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','JscriptyQuestionReport','includeAll','include','findAll','rows','show','length','find','create','body','update','catch','destroy','params','describe','eml-format','moment','bluebird','util','path'];(function(_0x5cde63,_0x5dc416){var _0x425e37=function(_0x1914f7){while(--_0x1914f7){_0x5cde63['push'](_0x5cde63['shift']());}};_0x425e37(++_0x5dc416);}(_0x0ede,0x168));var _0xe0ed=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0ede[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xe0ed('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe0ed('0x1'));var BPromise=require(_0xe0ed('0x2'));var Mustache=require('mustache');var util=require(_0xe0ed('0x3'));var path=require(_0xe0ed('0x4'));var sox=require(_0xe0ed('0x5'));var csv=require(_0xe0ed('0x6'));var ejs=require(_0xe0ed('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0ed('0x8'));var squel=require(_0xe0ed('0x9'));var crypto=require(_0xe0ed('0xa'));var jsforce=require(_0xe0ed('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe0ed('0x6'));var querystring=require(_0xe0ed('0xc'));var Papa=require(_0xe0ed('0xd'));var Redis=require(_0xe0ed('0xe'));var authService=require(_0xe0ed('0xf'));var qs=require(_0xe0ed('0x10'));var as=require(_0xe0ed('0x11'));var hardwareService=require(_0xe0ed('0x12'));var logger=require(_0xe0ed('0x13'))('api');var utils=require(_0xe0ed('0x14'));var config=require(_0xe0ed('0x15'));var licenseUtil=require(_0xe0ed('0x16'));var db=require(_0xe0ed('0x17'))['db'];function respondWithStatusCode(_0x5a6e97,_0x4378cf){_0x4378cf=_0x4378cf||0xcc;return function(_0x3de6a0){if(_0x3de6a0){return _0x5a6e97[_0xe0ed('0x18')](_0x4378cf);}return _0x5a6e97['status'](_0x4378cf)[_0xe0ed('0x19')]();};}function respondWithResult(_0x26541e,_0x8de986){_0x8de986=_0x8de986||0xc8;return function(_0x3badb1){if(_0x3badb1){return _0x26541e[_0xe0ed('0x1a')](_0x8de986)[_0xe0ed('0x1b')](_0x3badb1);}};}function respondWithFilteredResult(_0x539a0a,_0x18e4cf){return function(_0x3793d9){if(_0x3793d9){var _0x24af77=typeof _0x18e4cf[_0xe0ed('0x1c')]==='undefined'&&typeof _0x18e4cf[_0xe0ed('0x1d')]==='undefined';var _0xc33dc=_0x3793d9[_0xe0ed('0x1e')];var _0x2a8366=_0x24af77?0x0:_0x18e4cf['offset'];var _0x3242ca=_0x24af77?_0x3793d9[_0xe0ed('0x1e')]:_0x18e4cf[_0xe0ed('0x1c')]+_0x18e4cf[_0xe0ed('0x1d')];var _0x5efca4;if(_0x3242ca>=_0xc33dc){_0x3242ca=_0xc33dc;_0x5efca4=0xc8;}else{_0x5efca4=0xce;}_0x539a0a[_0xe0ed('0x1a')](_0x5efca4);return _0x539a0a['set'](_0xe0ed('0x1f'),_0x2a8366+'-'+_0x3242ca+'/'+_0xc33dc)[_0xe0ed('0x1b')](_0x3793d9);}return null;};}function patchUpdates(_0x3eeacd){return function(_0x3d18bb){try{jsonpatch['apply'](_0x3d18bb,_0x3eeacd,!![]);}catch(_0x1f7f45){return BPromise[_0xe0ed('0x20')](_0x1f7f45);}return _0x3d18bb[_0xe0ed('0x21')]();};}function saveUpdates(_0x337347,_0x4dcf4e){return function(_0x3ef008){if(_0x3ef008){return _0x3ef008['update'](_0x337347)['then'](function(_0x84f08c){return _0x84f08c;});}return null;};}function removeEntity(_0x2e3726,_0x5b18e1){return function(_0x3a2487){if(_0x3a2487){return _0x3a2487['destroy']()[_0xe0ed('0x22')](function(){_0x2e3726[_0xe0ed('0x1a')](0xcc)[_0xe0ed('0x19')]();});}};}function handleEntityNotFound(_0x49e975,_0xd5e051){return function(_0x53370b){if(!_0x53370b){_0x49e975['sendStatus'](0x194);}return _0x53370b;};}function handleError(_0x4cfef3,_0x3469b3){_0x3469b3=_0x3469b3||0x1f4;return function(_0x4df944){logger['error'](_0x4df944[_0xe0ed('0x23')]);if(_0x4df944[_0xe0ed('0x24')]){delete _0x4df944[_0xe0ed('0x24')];}_0x4cfef3[_0xe0ed('0x1a')](_0x3469b3)['send'](_0x4df944);};}exports[_0xe0ed('0x25')]=function(_0x42c270,_0x351df0){var _0x2db9cd={},_0x442370={},_0x1b9bde={'count':0x0,'rows':[]};var _0x52fcf6=_['map'](db['JscriptyQuestionReport'][_0xe0ed('0x26')],function(_0x24ac77){return{'name':_0x24ac77[_0xe0ed('0x27')],'type':_0x24ac77[_0xe0ed('0x28')]['key']};});_0x442370['model']=_[_0xe0ed('0x29')](_0x52fcf6,_0xe0ed('0x24'));_0x442370[_0xe0ed('0x2a')]=_[_0xe0ed('0x2b')](_0x42c270[_0xe0ed('0x2a')]);_0x442370[_0xe0ed('0x2c')]=_[_0xe0ed('0x2d')](_0x442370[_0xe0ed('0x2e')],_0x442370[_0xe0ed('0x2a')]);_0x2db9cd[_0xe0ed('0x2f')]=_[_0xe0ed('0x2d')](_0x442370[_0xe0ed('0x2e')],qs[_0xe0ed('0x30')](_0x42c270[_0xe0ed('0x2a')][_0xe0ed('0x30')]));_0x2db9cd[_0xe0ed('0x2f')]=_0x2db9cd['attributes']['length']?_0x2db9cd[_0xe0ed('0x2f')]:_0x442370[_0xe0ed('0x2e')];if(!_0x42c270['query'][_0xe0ed('0x31')]('nolimit')){_0x2db9cd[_0xe0ed('0x1d')]=qs[_0xe0ed('0x1d')](_0x42c270[_0xe0ed('0x2a')]['limit']);_0x2db9cd[_0xe0ed('0x1c')]=qs['offset'](_0x42c270[_0xe0ed('0x2a')][_0xe0ed('0x1c')]);}_0x2db9cd[_0xe0ed('0x32')]=qs[_0xe0ed('0x33')](_0x42c270[_0xe0ed('0x2a')]['sort']);_0x2db9cd[_0xe0ed('0x34')]=qs[_0xe0ed('0x2c')](_[_0xe0ed('0x35')](_0x42c270[_0xe0ed('0x2a')],_0x442370[_0xe0ed('0x2c')]),_0x52fcf6);if(_0x42c270[_0xe0ed('0x2a')]['filter']){_0x2db9cd[_0xe0ed('0x34')]=_['merge'](_0x2db9cd[_0xe0ed('0x34')],{'$or':_[_0xe0ed('0x29')](_0x52fcf6,function(_0x5d0157){if(_0x5d0157[_0xe0ed('0x28')]!==_0xe0ed('0x36')){var _0x30cbc2={};_0x30cbc2[_0x5d0157[_0xe0ed('0x24')]]={'$like':'%'+_0x42c270[_0xe0ed('0x2a')][_0xe0ed('0x37')]+'%'};return _0x30cbc2;}})});}_0x2db9cd=_[_0xe0ed('0x38')]({},_0x2db9cd,_0x42c270[_0xe0ed('0x39')]);var _0x15c0e9={'where':_0x2db9cd[_0xe0ed('0x34')]};return db[_0xe0ed('0x3a')][_0xe0ed('0x1e')](_0x15c0e9)[_0xe0ed('0x22')](function(_0x4eb92d){_0x1b9bde['count']=_0x4eb92d;if(_0x42c270[_0xe0ed('0x2a')][_0xe0ed('0x3b')]){_0x2db9cd[_0xe0ed('0x3c')]=[{'all':!![]}];}return db[_0xe0ed('0x3a')][_0xe0ed('0x3d')](_0x2db9cd);})[_0xe0ed('0x22')](function(_0x412fea){_0x1b9bde[_0xe0ed('0x3e')]=_0x412fea;return _0x1b9bde;})['then'](respondWithFilteredResult(_0x351df0,_0x2db9cd))['catch'](handleError(_0x351df0,null));};exports[_0xe0ed('0x3f')]=function(_0x26d4dc,_0x5bac9e){var _0x49d914={'raw':!![],'where':{'id':_0x26d4dc['params']['id']}},_0x352aac={};_0x352aac[_0xe0ed('0x2e')]=_[_0xe0ed('0x2b')](db[_0xe0ed('0x3a')][_0xe0ed('0x26')]);_0x352aac[_0xe0ed('0x2a')]=_[_0xe0ed('0x2b')](_0x26d4dc[_0xe0ed('0x2a')]);_0x352aac[_0xe0ed('0x2c')]=_[_0xe0ed('0x2d')](_0x352aac[_0xe0ed('0x2e')],_0x352aac[_0xe0ed('0x2a')]);_0x49d914[_0xe0ed('0x2f')]=_[_0xe0ed('0x2d')](_0x352aac[_0xe0ed('0x2e')],qs[_0xe0ed('0x30')](_0x26d4dc[_0xe0ed('0x2a')][_0xe0ed('0x30')]));_0x49d914[_0xe0ed('0x2f')]=_0x49d914[_0xe0ed('0x2f')][_0xe0ed('0x40')]?_0x49d914[_0xe0ed('0x2f')]:_0x352aac[_0xe0ed('0x2e')];if(_0x26d4dc['query'][_0xe0ed('0x3b')]){_0x49d914[_0xe0ed('0x3c')]=[{'all':!![]}];}_0x49d914=_[_0xe0ed('0x38')]({},_0x49d914,_0x26d4dc['options']);return db['JscriptyQuestionReport'][_0xe0ed('0x41')](_0x49d914)[_0xe0ed('0x22')](handleEntityNotFound(_0x5bac9e,null))[_0xe0ed('0x22')](respondWithResult(_0x5bac9e,null))['catch'](handleError(_0x5bac9e,null));};exports[_0xe0ed('0x42')]=function(_0x5aec83,_0x3cb1f1){return db[_0xe0ed('0x3a')][_0xe0ed('0x42')](_0x5aec83[_0xe0ed('0x43')],{})[_0xe0ed('0x22')](respondWithResult(_0x3cb1f1,0xc9))['catch'](handleError(_0x3cb1f1,null));};exports[_0xe0ed('0x44')]=function(_0x213d5a,_0x4bd620){if(_0x213d5a[_0xe0ed('0x43')]['id']){delete _0x213d5a[_0xe0ed('0x43')]['id'];}return db[_0xe0ed('0x3a')][_0xe0ed('0x41')]({'where':{'id':_0x213d5a['params']['id']}})[_0xe0ed('0x22')](handleEntityNotFound(_0x4bd620,null))[_0xe0ed('0x22')](saveUpdates(_0x213d5a['body'],null))[_0xe0ed('0x22')](respondWithResult(_0x4bd620,null))[_0xe0ed('0x45')](handleError(_0x4bd620,null));};exports[_0xe0ed('0x46')]=function(_0x27e56c,_0x4c82c4){return db[_0xe0ed('0x3a')]['find']({'where':{'id':_0x27e56c[_0xe0ed('0x47')]['id']}})[_0xe0ed('0x22')](handleEntityNotFound(_0x4c82c4,null))['then'](removeEntity(_0x4c82c4,null))[_0xe0ed('0x45')](handleError(_0x4c82c4,null));};exports[_0xe0ed('0x48')]=function(_0x42f4af,_0xbaaf50){return db['JscriptyQuestionReport'][_0xe0ed('0x48')]()['then'](respondWithResult(_0xbaaf50,null))['catch'](handleError(_0xbaaf50,null));}; \ No newline at end of file +var _0xcdb0=['bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','key','model','query','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','rows','catch','show','params','keys','find','create','update','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0xcdb0,0x8b));var _0x0cdb=function(_0x338cb3,_0x5f5542){_0x338cb3=_0x338cb3-0x0;var _0x49493d=_0xcdb0[_0x338cb3];return _0x49493d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0cdb('0x0'));var zipdir=require(_0x0cdb('0x1'));var jsonpatch=require(_0x0cdb('0x2'));var rp=require(_0x0cdb('0x3'));var moment=require(_0x0cdb('0x4'));var BPromise=require(_0x0cdb('0x5'));var Mustache=require(_0x0cdb('0x6'));var util=require(_0x0cdb('0x7'));var path=require(_0x0cdb('0x8'));var sox=require('sox');var csv=require(_0x0cdb('0x9'));var ejs=require(_0x0cdb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0cdb('0xb'));var squel=require(_0x0cdb('0xc'));var crypto=require(_0x0cdb('0xd'));var jsforce=require(_0x0cdb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0cdb('0x9'));var querystring=require(_0x0cdb('0xf'));var Papa=require(_0x0cdb('0x10'));var Redis=require(_0x0cdb('0x11'));var authService=require(_0x0cdb('0x12'));var qs=require(_0x0cdb('0x13'));var as=require(_0x0cdb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0cdb('0x15'));var utils=require('../../config/utils');var config=require(_0x0cdb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0cdb('0x17'))['db'];function respondWithStatusCode(_0x5c4a8e,_0x5e9999){_0x5e9999=_0x5e9999||0xcc;return function(_0x12d212){if(_0x12d212){return _0x5c4a8e[_0x0cdb('0x18')](_0x5e9999);}return _0x5c4a8e['status'](_0x5e9999)[_0x0cdb('0x19')]();};}function respondWithResult(_0x2930dc,_0x26401f){_0x26401f=_0x26401f||0xc8;return function(_0x41cbcb){if(_0x41cbcb){return _0x2930dc[_0x0cdb('0x1a')](_0x26401f)[_0x0cdb('0x1b')](_0x41cbcb);}};}function respondWithFilteredResult(_0x1a14e0,_0x391297){return function(_0x28f991){if(_0x28f991){var _0x5028d0=typeof _0x391297[_0x0cdb('0x1c')]===_0x0cdb('0x1d')&&typeof _0x391297[_0x0cdb('0x1e')]==='undefined';var _0x4f3f21=_0x28f991['count'];var _0x56f06c=_0x5028d0?0x0:_0x391297[_0x0cdb('0x1c')];var _0x276728=_0x5028d0?_0x28f991['count']:_0x391297[_0x0cdb('0x1c')]+_0x391297['limit'];var _0xebec25;if(_0x276728>=_0x4f3f21){_0x276728=_0x4f3f21;_0xebec25=0xc8;}else{_0xebec25=0xce;}_0x1a14e0[_0x0cdb('0x1a')](_0xebec25);return _0x1a14e0[_0x0cdb('0x1f')](_0x0cdb('0x20'),_0x56f06c+'-'+_0x276728+'/'+_0x4f3f21)[_0x0cdb('0x1b')](_0x28f991);}return null;};}function patchUpdates(_0xaf4bef){return function(_0x15a86c){try{jsonpatch[_0x0cdb('0x21')](_0x15a86c,_0xaf4bef,!![]);}catch(_0x5766c7){return BPromise['reject'](_0x5766c7);}return _0x15a86c[_0x0cdb('0x22')]();};}function saveUpdates(_0x492cff,_0x379e21){return function(_0x28d693){if(_0x28d693){return _0x28d693['update'](_0x492cff)['then'](function(_0x326d84){return _0x326d84;});}return null;};}function removeEntity(_0x3a329d,_0x10b4f5){return function(_0x33fb1a){if(_0x33fb1a){return _0x33fb1a[_0x0cdb('0x23')]()[_0x0cdb('0x24')](function(){_0x3a329d['status'](0xcc)[_0x0cdb('0x19')]();});}};}function handleEntityNotFound(_0x3cbe55,_0x2942a3){return function(_0x30c1bf){if(!_0x30c1bf){_0x3cbe55['sendStatus'](0x194);}return _0x30c1bf;};}function handleError(_0x3ea458,_0x22e847){_0x22e847=_0x22e847||0x1f4;return function(_0x6f9a9){logger[_0x0cdb('0x25')](_0x6f9a9[_0x0cdb('0x26')]);if(_0x6f9a9[_0x0cdb('0x27')]){delete _0x6f9a9[_0x0cdb('0x27')];}_0x3ea458[_0x0cdb('0x1a')](_0x22e847)[_0x0cdb('0x28')](_0x6f9a9);};}exports[_0x0cdb('0x29')]=function(_0x1a782d,_0x1ffaa8){var _0x1b2329={},_0x46d58f={},_0x37ef4={'count':0x0,'rows':[]};var _0x263acf=_[_0x0cdb('0x2a')](db[_0x0cdb('0x2b')][_0x0cdb('0x2c')],function(_0x2ec4b7){return{'name':_0x2ec4b7['fieldName'],'type':_0x2ec4b7['type'][_0x0cdb('0x2d')]};});_0x46d58f[_0x0cdb('0x2e')]=_[_0x0cdb('0x2a')](_0x263acf,_0x0cdb('0x27'));_0x46d58f['query']=_['keys'](_0x1a782d[_0x0cdb('0x2f')]);_0x46d58f[_0x0cdb('0x30')]=_[_0x0cdb('0x31')](_0x46d58f['model'],_0x46d58f[_0x0cdb('0x2f')]);_0x1b2329['attributes']=_[_0x0cdb('0x31')](_0x46d58f[_0x0cdb('0x2e')],qs['fields'](_0x1a782d['query']['fields']));_0x1b2329[_0x0cdb('0x32')]=_0x1b2329[_0x0cdb('0x32')][_0x0cdb('0x33')]?_0x1b2329[_0x0cdb('0x32')]:_0x46d58f[_0x0cdb('0x2e')];if(!_0x1a782d[_0x0cdb('0x2f')]['hasOwnProperty'](_0x0cdb('0x34'))){_0x1b2329[_0x0cdb('0x1e')]=qs['limit'](_0x1a782d['query'][_0x0cdb('0x1e')]);_0x1b2329[_0x0cdb('0x1c')]=qs[_0x0cdb('0x1c')](_0x1a782d[_0x0cdb('0x2f')][_0x0cdb('0x1c')]);}_0x1b2329['order']=qs[_0x0cdb('0x35')](_0x1a782d[_0x0cdb('0x2f')][_0x0cdb('0x35')]);_0x1b2329[_0x0cdb('0x36')]=qs[_0x0cdb('0x30')](_[_0x0cdb('0x37')](_0x1a782d[_0x0cdb('0x2f')],_0x46d58f[_0x0cdb('0x30')]),_0x263acf);if(_0x1a782d[_0x0cdb('0x2f')][_0x0cdb('0x38')]){_0x1b2329['where']=_['merge'](_0x1b2329['where'],{'$or':_['map'](_0x263acf,function(_0x4b551d){if(_0x4b551d['type']!=='VIRTUAL'){var _0x243ab5={};_0x243ab5[_0x4b551d['name']]={'$like':'%'+_0x1a782d[_0x0cdb('0x2f')][_0x0cdb('0x38')]+'%'};return _0x243ab5;}})});}_0x1b2329=_[_0x0cdb('0x39')]({},_0x1b2329,_0x1a782d[_0x0cdb('0x3a')]);var _0x3d84e6={'where':_0x1b2329[_0x0cdb('0x36')]};return db[_0x0cdb('0x2b')][_0x0cdb('0x3b')](_0x3d84e6)['then'](function(_0x5e06ce){_0x37ef4[_0x0cdb('0x3b')]=_0x5e06ce;if(_0x1a782d[_0x0cdb('0x2f')][_0x0cdb('0x3c')]){_0x1b2329[_0x0cdb('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x1b2329);})[_0x0cdb('0x24')](function(_0x56cbbb){_0x37ef4[_0x0cdb('0x3e')]=_0x56cbbb;return _0x37ef4;})['then'](respondWithFilteredResult(_0x1ffaa8,_0x1b2329))[_0x0cdb('0x3f')](handleError(_0x1ffaa8,null));};exports[_0x0cdb('0x40')]=function(_0x36fe15,_0x3c4813){var _0x27860b={'raw':!![],'where':{'id':_0x36fe15[_0x0cdb('0x41')]['id']}},_0x293112={};_0x293112[_0x0cdb('0x2e')]=_['keys'](db[_0x0cdb('0x2b')]['rawAttributes']);_0x293112['query']=_[_0x0cdb('0x42')](_0x36fe15[_0x0cdb('0x2f')]);_0x293112[_0x0cdb('0x30')]=_[_0x0cdb('0x31')](_0x293112['model'],_0x293112['query']);_0x27860b[_0x0cdb('0x32')]=_[_0x0cdb('0x31')](_0x293112[_0x0cdb('0x2e')],qs['fields'](_0x36fe15[_0x0cdb('0x2f')]['fields']));_0x27860b[_0x0cdb('0x32')]=_0x27860b[_0x0cdb('0x32')][_0x0cdb('0x33')]?_0x27860b[_0x0cdb('0x32')]:_0x293112[_0x0cdb('0x2e')];if(_0x36fe15[_0x0cdb('0x2f')][_0x0cdb('0x3c')]){_0x27860b['include']=[{'all':!![]}];}_0x27860b=_[_0x0cdb('0x39')]({},_0x27860b,_0x36fe15[_0x0cdb('0x3a')]);return db[_0x0cdb('0x2b')][_0x0cdb('0x43')](_0x27860b)['then'](handleEntityNotFound(_0x3c4813,null))['then'](respondWithResult(_0x3c4813,null))[_0x0cdb('0x3f')](handleError(_0x3c4813,null));};exports[_0x0cdb('0x44')]=function(_0x4cf594,_0x890a64){return db[_0x0cdb('0x2b')][_0x0cdb('0x44')](_0x4cf594['body'],{})['then'](respondWithResult(_0x890a64,0xc9))[_0x0cdb('0x3f')](handleError(_0x890a64,null));};exports[_0x0cdb('0x45')]=function(_0x40abc7,_0x58e99d){if(_0x40abc7[_0x0cdb('0x46')]['id']){delete _0x40abc7[_0x0cdb('0x46')]['id'];}return db[_0x0cdb('0x2b')][_0x0cdb('0x43')]({'where':{'id':_0x40abc7['params']['id']}})['then'](handleEntityNotFound(_0x58e99d,null))[_0x0cdb('0x24')](saveUpdates(_0x40abc7[_0x0cdb('0x46')],null))[_0x0cdb('0x24')](respondWithResult(_0x58e99d,null))[_0x0cdb('0x3f')](handleError(_0x58e99d,null));};exports['destroy']=function(_0x2f782f,_0x3c380b){return db[_0x0cdb('0x2b')][_0x0cdb('0x43')]({'where':{'id':_0x2f782f['params']['id']}})[_0x0cdb('0x24')](handleEntityNotFound(_0x3c380b,null))[_0x0cdb('0x24')](removeEntity(_0x3c380b,null))['catch'](handleError(_0x3c380b,null));};exports['describe']=function(_0x5972d6,_0x4e50d9){return db[_0x0cdb('0x2b')][_0x0cdb('0x47')]()[_0x0cdb('0x24')](respondWithResult(_0x4e50d9,null))[_0x0cdb('0x3f')](handleError(_0x4e50d9,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 0dbad4c..0632e25 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 _0x67e6=['report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x67e6,0x197));var _0x667e=function(_0x11b3cb,_0x44b528){_0x11b3cb=_0x11b3cb-0x0;var _0x45d5cf=_0x67e6[_0x11b3cb];return _0x45d5cf;};'use strict';var _=require(_0x667e('0x0'));var util=require(_0x667e('0x1'));var logger=require(_0x667e('0x2'))(_0x667e('0x3'));var moment=require(_0x667e('0x4'));var BPromise=require(_0x667e('0x5'));var rp=require(_0x667e('0x6'));var fs=require('fs');var path=require(_0x667e('0x7'));var rimraf=require(_0x667e('0x8'));var config=require(_0x667e('0x9'));var attributes=require(_0x667e('0xa'));module['exports']=function(_0x1fef74,_0x5003dd){return _0x1fef74[_0x667e('0xb')](_0x667e('0xc'),attributes,{'tableName':_0x667e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3b7=['api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','util','../../config/logger'];(function(_0x8c522,_0x2ce42a){var _0xeaf37b=function(_0x1b3fd9){while(--_0x1b3fd9){_0x8c522['push'](_0x8c522['shift']());}};_0xeaf37b(++_0x2ce42a);}(_0xb3b7,0x136));var _0x7b3b=function(_0x586a08,_0x2dce85){_0x586a08=_0x586a08-0x0;var _0x5b33b0=_0xb3b7[_0x586a08];return _0x5b33b0;};'use strict';var _=require('lodash');var util=require(_0x7b3b('0x0'));var logger=require(_0x7b3b('0x1'))(_0x7b3b('0x2'));var moment=require(_0x7b3b('0x3'));var BPromise=require(_0x7b3b('0x4'));var rp=require(_0x7b3b('0x5'));var fs=require('fs');var path=require(_0x7b3b('0x6'));var rimraf=require('rimraf');var config=require(_0x7b3b('0x7'));var attributes=require(_0x7b3b('0x8'));module[_0x7b3b('0x9')]=function(_0x466123,_0x559ebc){return _0x466123[_0x7b3b('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x7b3b('0xb'),'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 eef715b..181957b 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 _0x6bf8=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5dedc8,_0x55fe53){var _0x10d4c5=function(_0x4f60f1){while(--_0x4f60f1){_0x5dedc8['push'](_0x5dedc8['shift']());}};_0x10d4c5(++_0x55fe53);}(_0x6bf8,0x196));var _0x86bf=function(_0x550eb7,_0x465856){_0x550eb7=_0x550eb7-0x0;var _0x33bffe=_0x6bf8[_0x550eb7];return _0x33bffe;};'use strict';var _=require(_0x86bf('0x0'));var util=require(_0x86bf('0x1'));var moment=require(_0x86bf('0x2'));var BPromise=require(_0x86bf('0x3'));var rs=require(_0x86bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x86bf('0x5'));var logger=require(_0x86bf('0x6'))('rpc');var config=require(_0x86bf('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x86bf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19936d,_0x45aafc,_0x466095){return new BPromise(function(_0x557548,_0x2e20d4){return client[_0x86bf('0x9')](_0x19936d,_0x466095)[_0x86bf('0xa')](function(_0x312c9c){logger[_0x86bf('0xb')](_0x86bf('0xc'),_0x45aafc,_0x86bf('0xd'));logger[_0x86bf('0xe')](_0x86bf('0xf'),_0x45aafc,_0x86bf('0xd'),JSON['stringify'](_0x312c9c));if(_0x312c9c['error']){if(_0x312c9c[_0x86bf('0x10')][_0x86bf('0x11')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x45aafc,_0x312c9c[_0x86bf('0x10')][_0x86bf('0x12')]);return _0x2e20d4(_0x312c9c[_0x86bf('0x10')][_0x86bf('0x12')]);}logger[_0x86bf('0x10')](_0x86bf('0xc'),_0x45aafc,_0x312c9c['error'][_0x86bf('0x12')]);return _0x557548(_0x312c9c[_0x86bf('0x10')][_0x86bf('0x12')]);}else{logger[_0x86bf('0xb')](_0x86bf('0xc'),_0x45aafc,_0x86bf('0xd'));_0x557548(_0x312c9c[_0x86bf('0x13')]['message']);}})[_0x86bf('0x14')](function(_0x1efa9c){logger[_0x86bf('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x45aafc,_0x1efa9c);_0x2e20d4(_0x1efa9c);});});} \ No newline at end of file +var _0xb1f7=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x559aef,_0x2bd29f){var _0x2470a5=function(_0x5c9d62){while(--_0x5c9d62){_0x559aef['push'](_0x559aef['shift']());}};_0x2470a5(++_0x2bd29f);}(_0xb1f7,0x1ca));var _0x7b1f=function(_0x2360bc,_0x514ee9){_0x2360bc=_0x2360bc-0x0;var _0x58e698=_0xb1f7[_0x2360bc];return _0x58e698;};'use strict';var _=require(_0x7b1f('0x0'));var util=require(_0x7b1f('0x1'));var moment=require(_0x7b1f('0x2'));var BPromise=require(_0x7b1f('0x3'));var rs=require(_0x7b1f('0x4'));var fs=require('fs');var Redis=require(_0x7b1f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b1f('0x6'));var logger=require(_0x7b1f('0x7'))(_0x7b1f('0x8'));var config=require('../../config/environment');var jayson=require(_0x7b1f('0x9'));var client=jayson[_0x7b1f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aab0e,_0x11e0a4,_0x5150d4){return new BPromise(function(_0x50e4cf,_0x4a75d2){return client[_0x7b1f('0xb')](_0x4aab0e,_0x5150d4)['then'](function(_0x35dc5f){logger[_0x7b1f('0xc')](_0x7b1f('0xd'),_0x11e0a4,'request\x20sent');logger[_0x7b1f('0xe')](_0x7b1f('0xf'),_0x11e0a4,_0x7b1f('0x10'),JSON[_0x7b1f('0x11')](_0x35dc5f));if(_0x35dc5f['error']){if(_0x35dc5f[_0x7b1f('0x12')][_0x7b1f('0x13')]===0x1f4){logger['error'](_0x7b1f('0xd'),_0x11e0a4,_0x35dc5f[_0x7b1f('0x12')]['message']);return _0x4a75d2(_0x35dc5f[_0x7b1f('0x12')][_0x7b1f('0x14')]);}logger[_0x7b1f('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x11e0a4,_0x35dc5f[_0x7b1f('0x12')]['message']);return _0x50e4cf(_0x35dc5f[_0x7b1f('0x12')][_0x7b1f('0x14')]);}else{logger[_0x7b1f('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x11e0a4,'request\x20sent');_0x50e4cf(_0x35dc5f[_0x7b1f('0x15')][_0x7b1f('0x14')]);}})[_0x7b1f('0x16')](function(_0x3b7e74){logger[_0x7b1f('0x12')](_0x7b1f('0xd'),_0x11e0a4,_0x3b7e74);_0x4a75d2(_0x3b7e74);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 4296c27..66a9d31 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 _0x1dfb=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./jscriptySessionReport.controller','/describe','get','/:id','isAuthenticated','show','getQuestions','put','update','delete'];(function(_0x5302fb,_0x1a2db3){var _0x43e6a4=function(_0x324ae6){while(--_0x324ae6){_0x5302fb['push'](_0x5302fb['shift']());}};_0x43e6a4(++_0x1a2db3);}(_0x1dfb,0x74));var _0xb1df=function(_0x4a291d,_0x3ec980){_0x4a291d=_0x4a291d-0x0;var _0x17ea20=_0x1dfb[_0x4a291d];return _0x17ea20;};'use strict';var multer=require(_0xb1df('0x0'));var util=require(_0xb1df('0x1'));var path=require(_0xb1df('0x2'));var timeout=require(_0xb1df('0x3'));var express=require(_0xb1df('0x4'));var router=express[_0xb1df('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb1df('0x6'));var controller=require(_0xb1df('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb1df('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xb1df('0x9')](_0xb1df('0xa'),auth[_0xb1df('0xb')](),controller[_0xb1df('0xc')]);router[_0xb1df('0x9')]('/:id/questions',auth[_0xb1df('0xb')](),controller[_0xb1df('0xd')]);router['post']('/',auth[_0xb1df('0xb')](),controller['create']);router[_0xb1df('0xe')](_0xb1df('0xa'),auth[_0xb1df('0xb')](),controller[_0xb1df('0xf')]);router[_0xb1df('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb1df('0x11')]);module[_0xb1df('0x12')]=router; \ No newline at end of file +var _0xac0d=['./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id','show','getQuestions','post','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5e7e1a,_0x38a7c6){var _0x46b94f=function(_0x4d6e22){while(--_0x4d6e22){_0x5e7e1a['push'](_0x5e7e1a['shift']());}};_0x46b94f(++_0x38a7c6);}(_0xac0d,0xe8));var _0xdac0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xac0d[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xdac0('0x0'));var util=require(_0xdac0('0x1'));var path=require('path');var timeout=require(_0xdac0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdac0('0x3'));var auth=require(_0xdac0('0x4'));var interaction=require(_0xdac0('0x5'));var config=require('../../config/environment');var controller=require(_0xdac0('0x6'));router[_0xdac0('0x7')]('/',auth[_0xdac0('0x8')](),controller[_0xdac0('0x9')]);router[_0xdac0('0x7')](_0xdac0('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xdac0('0x7')](_0xdac0('0xb'),auth[_0xdac0('0x8')](),controller[_0xdac0('0xc')]);router[_0xdac0('0x7')]('/:id/questions',auth[_0xdac0('0x8')](),controller[_0xdac0('0xd')]);router[_0xdac0('0xe')]('/',auth[_0xdac0('0x8')](),controller['create']);router['put'](_0xdac0('0xb'),auth[_0xdac0('0x8')](),controller['update']);router['delete']('/:id',auth[_0xdac0('0x8')](),controller[_0xdac0('0xf')]);module[_0xdac0('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index e8f63cc..367cc94 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 _0x6cd6=['YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','sequelize','setDataValue','endtime','format'];(function(_0x511ff0,_0x5f7232){var _0x5ddae4=function(_0x2bc913){while(--_0x2bc913){_0x511ff0['push'](_0x511ff0['shift']());}};_0x5ddae4(++_0x5f7232);}(_0x6cd6,0x67));var _0x66cd=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6cd6[_0x40a045];return _0x1a687c;};'use strict';var moment=require(_0x66cd('0x0'));var Sequelize=require(_0x66cd('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0xa332a9){this[_0x66cd('0x2')]('starttime',_0xa332a9);this[_0x66cd('0x2')](_0x66cd('0x3'),moment()[_0x66cd('0x4')](_0x66cd('0x5')));}},'endtime':{'type':Sequelize[_0x66cd('0x6')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x66cd('0x7')]},'completed':{'type':Sequelize[_0x66cd('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x556a=['DATE','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x597ed3,_0x504502){var _0x1a8218=function(_0x47e85f){while(--_0x47e85f){_0x597ed3['push'](_0x597ed3['shift']());}};_0x1a8218(++_0x504502);}(_0x556a,0x1dd));var _0xa556=function(_0x145c09,_0x2be697){_0x145c09=_0x145c09-0x0;var _0x241deb=_0x556a[_0x145c09];return _0x241deb;};'use strict';var moment=require(_0xa556('0x0'));var Sequelize=require(_0xa556('0x1'));module[_0xa556('0x2')]={'starttime':{'type':Sequelize[_0xa556('0x3')],'set':function(_0x30a5ab){this[_0xa556('0x4')](_0xa556('0x5'),_0x30a5ab);this[_0xa556('0x4')](_0xa556('0x6'),moment()['format'](_0xa556('0x7')));}},'endtime':{'type':Sequelize[_0xa556('0x3')]},'membername':{'type':Sequelize[_0xa556('0x8')]},'projectname':{'type':Sequelize[_0xa556('0x8')]},'queue':{'type':Sequelize[_0xa556('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa556('0x8')]},'calleridnum':{'type':Sequelize[_0xa556('0x8')]},'completed':{'type':Sequelize[_0xa556('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 09f02a7..76acf19 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 _0xc72e=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','merge','find','create','body','params','destroy','describe','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','rimraf','zip-dir','fast-json-patch'];(function(_0x580fe1,_0x48dff8){var _0x2d3bf0=function(_0x2ff34f){while(--_0x2ff34f){_0x580fe1['push'](_0x580fe1['shift']());}};_0x2d3bf0(++_0x48dff8);}(_0xc72e,0x1e9));var _0xec72=function(_0xe128d9,_0x1d21aa){_0xe128d9=_0xe128d9-0x0;var _0x22f08e=_0xc72e[_0xe128d9];return _0x22f08e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec72('0x0'));var zipdir=require(_0xec72('0x1'));var jsonpatch=require(_0xec72('0x2'));var rp=require('request-promise');var moment=require(_0xec72('0x3'));var BPromise=require(_0xec72('0x4'));var Mustache=require(_0xec72('0x5'));var util=require(_0xec72('0x6'));var path=require(_0xec72('0x7'));var sox=require(_0xec72('0x8'));var csv=require(_0xec72('0x9'));var ejs=require(_0xec72('0xa'));var fs=require('fs');var fs_extra=require(_0xec72('0xb'));var _=require(_0xec72('0xc'));var squel=require(_0xec72('0xd'));var crypto=require('crypto');var jsforce=require(_0xec72('0xe'));var deskjs=require(_0xec72('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xec72('0x10'));var Redis=require('ioredis');var authService=require(_0xec72('0x11'));var qs=require(_0xec72('0x12'));var as=require(_0xec72('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec72('0x14'))(_0xec72('0x15'));var utils=require('../../config/utils');var config=require(_0xec72('0x16'));var licenseUtil=require(_0xec72('0x17'));var db=require(_0xec72('0x18'))['db'];function respondWithStatusCode(_0xbecb5f,_0x3222c7){_0x3222c7=_0x3222c7||0xcc;return function(_0x552140){if(_0x552140){return _0xbecb5f[_0xec72('0x19')](_0x3222c7);}return _0xbecb5f[_0xec72('0x1a')](_0x3222c7)[_0xec72('0x1b')]();};}function respondWithResult(_0x2fa061,_0xeba7ec){_0xeba7ec=_0xeba7ec||0xc8;return function(_0x585320){if(_0x585320){return _0x2fa061['status'](_0xeba7ec)[_0xec72('0x1c')](_0x585320);}};}function respondWithFilteredResult(_0x51b75c,_0x22561e){return function(_0x2b0b5e){if(_0x2b0b5e){var _0x5ad1c4=typeof _0x22561e[_0xec72('0x1d')]==='undefined'&&typeof _0x22561e['limit']===_0xec72('0x1e');var _0x2f4101=_0x2b0b5e['count'];var _0x8f3a3b=_0x5ad1c4?0x0:_0x22561e[_0xec72('0x1d')];var _0x1bdf3c=_0x5ad1c4?_0x2b0b5e[_0xec72('0x1f')]:_0x22561e['offset']+_0x22561e[_0xec72('0x20')];var _0x5ee71b;if(_0x1bdf3c>=_0x2f4101){_0x1bdf3c=_0x2f4101;_0x5ee71b=0xc8;}else{_0x5ee71b=0xce;}_0x51b75c[_0xec72('0x1a')](_0x5ee71b);return _0x51b75c[_0xec72('0x21')](_0xec72('0x22'),_0x8f3a3b+'-'+_0x1bdf3c+'/'+_0x2f4101)[_0xec72('0x1c')](_0x2b0b5e);}return null;};}function patchUpdates(_0x3cb70c){return function(_0x1fc79b){try{jsonpatch[_0xec72('0x23')](_0x1fc79b,_0x3cb70c,!![]);}catch(_0x1ae538){return BPromise[_0xec72('0x24')](_0x1ae538);}return _0x1fc79b[_0xec72('0x25')]();};}function saveUpdates(_0x40598d,_0x5292e3){return function(_0xec07ef){if(_0xec07ef){return _0xec07ef[_0xec72('0x26')](_0x40598d)[_0xec72('0x27')](function(_0x5d0c54){return _0x5d0c54;});}return null;};}function removeEntity(_0x46c71d,_0x22b5b3){return function(_0x522949){if(_0x522949){return _0x522949['destroy']()[_0xec72('0x27')](function(){_0x46c71d[_0xec72('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x532436,_0x106153){return function(_0x12e7ae){if(!_0x12e7ae){_0x532436[_0xec72('0x19')](0x194);}return _0x12e7ae;};}function handleError(_0x55d1f4,_0x1b69c3){_0x1b69c3=_0x1b69c3||0x1f4;return function(_0x1d8bd2){logger[_0xec72('0x28')](_0x1d8bd2[_0xec72('0x29')]);if(_0x1d8bd2[_0xec72('0x2a')]){delete _0x1d8bd2[_0xec72('0x2a')];}_0x55d1f4['status'](_0x1b69c3)[_0xec72('0x2b')](_0x1d8bd2);};}exports[_0xec72('0x2c')]=function(_0x2ee7f5,_0x2689c9){var _0x3ad058={},_0x29248f={},_0x67fb1f={'count':0x0,'rows':[]};var _0x317425=_[_0xec72('0x2d')](db[_0xec72('0x2e')][_0xec72('0x2f')],function(_0x1440b3){return{'name':_0x1440b3['fieldName'],'type':_0x1440b3['type'][_0xec72('0x30')]};});_0x29248f[_0xec72('0x31')]=_['map'](_0x317425,_0xec72('0x2a'));_0x29248f['query']=_[_0xec72('0x32')](_0x2ee7f5['query']);_0x29248f[_0xec72('0x33')]=_[_0xec72('0x34')](_0x29248f[_0xec72('0x31')],_0x29248f[_0xec72('0x35')]);_0x3ad058[_0xec72('0x36')]=_[_0xec72('0x34')](_0x29248f['model'],qs[_0xec72('0x37')](_0x2ee7f5[_0xec72('0x35')][_0xec72('0x37')]));_0x3ad058['attributes']=_0x3ad058[_0xec72('0x36')][_0xec72('0x38')]?_0x3ad058['attributes']:_0x29248f[_0xec72('0x31')];if(!_0x2ee7f5['query']['hasOwnProperty'](_0xec72('0x39'))){_0x3ad058[_0xec72('0x20')]=qs[_0xec72('0x20')](_0x2ee7f5['query'][_0xec72('0x20')]);_0x3ad058[_0xec72('0x1d')]=qs[_0xec72('0x1d')](_0x2ee7f5[_0xec72('0x35')][_0xec72('0x1d')]);}_0x3ad058[_0xec72('0x3a')]=qs[_0xec72('0x3b')](_0x2ee7f5[_0xec72('0x35')]['sort']);_0x3ad058['where']=qs[_0xec72('0x33')](_[_0xec72('0x3c')](_0x2ee7f5[_0xec72('0x35')],_0x29248f[_0xec72('0x33')]),_0x317425);if(_0x2ee7f5['query']['filter']){_0x3ad058[_0xec72('0x3d')]=_['merge'](_0x3ad058[_0xec72('0x3d')],{'$or':_[_0xec72('0x2d')](_0x317425,function(_0x572e10){if(_0x572e10[_0xec72('0x3e')]!==_0xec72('0x3f')){var _0x45e737={};_0x45e737[_0x572e10[_0xec72('0x2a')]]={'$like':'%'+_0x2ee7f5['query'][_0xec72('0x40')]+'%'};return _0x45e737;}})});}_0x3ad058=_['merge']({},_0x3ad058,_0x2ee7f5[_0xec72('0x41')]);var _0x386f63={'where':_0x3ad058['where']};return db[_0xec72('0x2e')]['count'](_0x386f63)['then'](function(_0x2597fd){_0x67fb1f['count']=_0x2597fd;if(_0x2ee7f5['query'][_0xec72('0x42')]){_0x3ad058[_0xec72('0x43')]=[{'all':!![]}];}return db[_0xec72('0x2e')][_0xec72('0x44')](_0x3ad058);})['then'](function(_0x15f053){_0x67fb1f[_0xec72('0x45')]=_0x15f053;return _0x67fb1f;})[_0xec72('0x27')](respondWithFilteredResult(_0x2689c9,_0x3ad058))[_0xec72('0x46')](handleError(_0x2689c9,null));};exports['show']=function(_0x13d125,_0xac6487){var _0x3e2945={'raw':!![],'where':{'id':_0x13d125['params']['id']}},_0xaed50={};_0xaed50['model']=_[_0xec72('0x32')](db[_0xec72('0x2e')][_0xec72('0x2f')]);_0xaed50['query']=_[_0xec72('0x32')](_0x13d125[_0xec72('0x35')]);_0xaed50[_0xec72('0x33')]=_[_0xec72('0x34')](_0xaed50[_0xec72('0x31')],_0xaed50['query']);_0x3e2945[_0xec72('0x36')]=_['intersection'](_0xaed50[_0xec72('0x31')],qs[_0xec72('0x37')](_0x13d125[_0xec72('0x35')][_0xec72('0x37')]));_0x3e2945['attributes']=_0x3e2945['attributes'][_0xec72('0x38')]?_0x3e2945['attributes']:_0xaed50[_0xec72('0x31')];if(_0x13d125[_0xec72('0x35')]['includeAll']){_0x3e2945[_0xec72('0x43')]=[{'all':!![]}];}_0x3e2945=_[_0xec72('0x47')]({},_0x3e2945,_0x13d125[_0xec72('0x41')]);return db[_0xec72('0x2e')][_0xec72('0x48')](_0x3e2945)['then'](handleEntityNotFound(_0xac6487,null))[_0xec72('0x27')](respondWithResult(_0xac6487,null))['catch'](handleError(_0xac6487,null));};exports[_0xec72('0x49')]=function(_0x3ca041,_0x463085){return db[_0xec72('0x2e')][_0xec72('0x49')](_0x3ca041[_0xec72('0x4a')],{})['then'](respondWithResult(_0x463085,0xc9))['catch'](handleError(_0x463085,null));};exports[_0xec72('0x26')]=function(_0x24551b,_0x1d3110){if(_0x24551b['body']['id']){delete _0x24551b[_0xec72('0x4a')]['id'];}return db[_0xec72('0x2e')][_0xec72('0x48')]({'where':{'id':_0x24551b[_0xec72('0x4b')]['id']}})[_0xec72('0x27')](handleEntityNotFound(_0x1d3110,null))[_0xec72('0x27')](saveUpdates(_0x24551b[_0xec72('0x4a')],null))[_0xec72('0x27')](respondWithResult(_0x1d3110,null))[_0xec72('0x46')](handleError(_0x1d3110,null));};exports[_0xec72('0x4c')]=function(_0x3b0429,_0x4041de){return db[_0xec72('0x2e')][_0xec72('0x48')]({'where':{'id':_0x3b0429[_0xec72('0x4b')]['id']}})[_0xec72('0x27')](handleEntityNotFound(_0x4041de,null))[_0xec72('0x27')](removeEntity(_0x4041de,null))[_0xec72('0x46')](handleError(_0x4041de,null));};exports['describe']=function(_0x3f5b8f,_0x517f60){return db['JscriptySessionReport'][_0xec72('0x4d')]()['then'](respondWithResult(_0x517f60,null))[_0xec72('0x46')](handleError(_0x517f60,null));};exports['getQuestions']=function(_0x52eb01,_0x555180,_0x307bf4){var _0x1ab04b={'raw':!![],'where':{}};var _0x15f93a={};var _0x38107a={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xec72('0x4e')]({'where':{'id':_0x52eb01['params']['id']}})[_0xec72('0x27')](handleEntityNotFound(_0x555180,null))[_0xec72('0x27')](function(_0x34bb80){if(_0x34bb80){_0x15f93a[_0xec72('0x31')]=_[_0xec72('0x32')](db[_0xec72('0x4f')][_0xec72('0x2f')]);_0x15f93a[_0xec72('0x35')]=_[_0xec72('0x32')](_0x52eb01[_0xec72('0x35')]);_0x15f93a['filters']=_[_0xec72('0x34')](_0x15f93a[_0xec72('0x31')],_0x15f93a[_0xec72('0x35')]);_0x1ab04b['attributes']=_[_0xec72('0x34')](_0x15f93a['model'],qs[_0xec72('0x37')](_0x52eb01[_0xec72('0x35')][_0xec72('0x37')]));_0x1ab04b['attributes']=_0x1ab04b[_0xec72('0x36')][_0xec72('0x38')]?_0x1ab04b['attributes']:_0x15f93a[_0xec72('0x31')];if(!_0x52eb01[_0xec72('0x35')][_0xec72('0x50')](_0xec72('0x39'))){_0x1ab04b['limit']=qs[_0xec72('0x20')](_0x52eb01[_0xec72('0x35')][_0xec72('0x20')]);_0x1ab04b['offset']=qs[_0xec72('0x1d')](_0x52eb01['query'][_0xec72('0x1d')]);}_0x1ab04b[_0xec72('0x3a')]=qs['sort'](_0x52eb01[_0xec72('0x35')][_0xec72('0x3b')]);_0x1ab04b[_0xec72('0x3d')]=qs[_0xec72('0x33')](_[_0xec72('0x3c')](_0x52eb01['query'],_0x15f93a[_0xec72('0x33')]));_0x1ab04b[_0xec72('0x3d')][_0xec72('0x51')]=_0x34bb80['id'];if(_0x52eb01[_0xec72('0x35')][_0xec72('0x40')]){_0x1ab04b[_0xec72('0x3d')]=_[_0xec72('0x47')](_0x1ab04b[_0xec72('0x3d')],{'$or':_[_0xec72('0x2d')](_0x1ab04b[_0xec72('0x36')],function(_0x2aab99){var _0x1c7944={};_0x1c7944[_0x2aab99]={'$like':'%'+_0x52eb01['query'][_0xec72('0x40')]+'%'};return _0x1c7944;})});}_0x1ab04b=_['merge']({},_0x1ab04b,_0x52eb01[_0xec72('0x41')]);return db[_0xec72('0x4f')][_0xec72('0x1f')]({'where':_0x1ab04b['where']})['then'](function(_0xb46253){_0x38107a[_0xec72('0x1f')]=_0xb46253;if(_0x52eb01['query'][_0xec72('0x42')]){_0x1ab04b[_0xec72('0x43')]=[{'all':!![]}];}return db[_0xec72('0x4f')][_0xec72('0x44')](_0x1ab04b);})['then'](function(_0x516011){_0x38107a[_0xec72('0x45')]=_0x516011;return _0x38107a;});}})[_0xec72('0x27')](respondWithFilteredResult(_0x555180,_0x1ab04b))[_0xec72('0x46')](handleError(_0x555180,null));}; \ No newline at end of file +var _0xaa4c=['where','pick','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','fields','options','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','merge','zip-dir','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x273c5e,_0x250533){var _0x41f46e=function(_0x507a20){while(--_0x507a20){_0x273c5e['push'](_0x273c5e['shift']());}};_0x41f46e(++_0x250533);}(_0xaa4c,0x192));var _0xcaa4=function(_0x8b982,_0x5650d9){_0x8b982=_0x8b982-0x0;var _0x1583e3=_0xaa4c[_0x8b982];return _0x1583e3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcaa4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcaa4('0x1'));var BPromise=require(_0xcaa4('0x2'));var Mustache=require('mustache');var util=require(_0xcaa4('0x3'));var path=require('path');var sox=require(_0xcaa4('0x4'));var csv=require(_0xcaa4('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcaa4('0x6'));var _=require(_0xcaa4('0x7'));var squel=require(_0xcaa4('0x8'));var crypto=require(_0xcaa4('0x9'));var jsforce=require(_0xcaa4('0xa'));var deskjs=require(_0xcaa4('0xb'));var toCsv=require(_0xcaa4('0x5'));var querystring=require('querystring');var Papa=require(_0xcaa4('0xc'));var Redis=require(_0xcaa4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xcaa4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcaa4('0xf'));var logger=require(_0xcaa4('0x10'))(_0xcaa4('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcaa4('0x12'));var db=require(_0xcaa4('0x13'))['db'];function respondWithStatusCode(_0xdec332,_0x2b7100){_0x2b7100=_0x2b7100||0xcc;return function(_0x7e654d){if(_0x7e654d){return _0xdec332[_0xcaa4('0x14')](_0x2b7100);}return _0xdec332[_0xcaa4('0x15')](_0x2b7100)[_0xcaa4('0x16')]();};}function respondWithResult(_0x4a1530,_0x4bb451){_0x4bb451=_0x4bb451||0xc8;return function(_0x2ac41e){if(_0x2ac41e){return _0x4a1530['status'](_0x4bb451)[_0xcaa4('0x17')](_0x2ac41e);}};}function respondWithFilteredResult(_0xdaeda,_0xca743f){return function(_0x37dbcf){if(_0x37dbcf){var _0x5deea7=typeof _0xca743f[_0xcaa4('0x18')]===_0xcaa4('0x19')&&typeof _0xca743f['limit']===_0xcaa4('0x19');var _0x21f3ac=_0x37dbcf['count'];var _0x286ccd=_0x5deea7?0x0:_0xca743f[_0xcaa4('0x18')];var _0x26a266=_0x5deea7?_0x37dbcf['count']:_0xca743f['offset']+_0xca743f['limit'];var _0x4dec21;if(_0x26a266>=_0x21f3ac){_0x26a266=_0x21f3ac;_0x4dec21=0xc8;}else{_0x4dec21=0xce;}_0xdaeda['status'](_0x4dec21);return _0xdaeda[_0xcaa4('0x1a')](_0xcaa4('0x1b'),_0x286ccd+'-'+_0x26a266+'/'+_0x21f3ac)[_0xcaa4('0x17')](_0x37dbcf);}return null;};}function patchUpdates(_0x56f3ef){return function(_0x6ac025){try{jsonpatch[_0xcaa4('0x1c')](_0x6ac025,_0x56f3ef,!![]);}catch(_0x3e8b07){return BPromise[_0xcaa4('0x1d')](_0x3e8b07);}return _0x6ac025[_0xcaa4('0x1e')]();};}function saveUpdates(_0x10805b,_0x787229){return function(_0x2dc337){if(_0x2dc337){return _0x2dc337[_0xcaa4('0x1f')](_0x10805b)[_0xcaa4('0x20')](function(_0x1a8233){return _0x1a8233;});}return null;};}function removeEntity(_0x4c4727,_0x11af49){return function(_0x227850){if(_0x227850){return _0x227850[_0xcaa4('0x21')]()['then'](function(){_0x4c4727[_0xcaa4('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5362e2,_0x182ae2){return function(_0xfb4c1f){if(!_0xfb4c1f){_0x5362e2['sendStatus'](0x194);}return _0xfb4c1f;};}function handleError(_0x13e03f,_0x15231d){_0x15231d=_0x15231d||0x1f4;return function(_0x222b22){logger['error'](_0x222b22[_0xcaa4('0x22')]);if(_0x222b22[_0xcaa4('0x23')]){delete _0x222b22[_0xcaa4('0x23')];}_0x13e03f[_0xcaa4('0x15')](_0x15231d)[_0xcaa4('0x24')](_0x222b22);};}exports[_0xcaa4('0x25')]=function(_0x965616,_0xb19cb8){var _0x12df16={},_0x4f2f59={},_0x3f36ae={'count':0x0,'rows':[]};var _0x3bc8d0=_[_0xcaa4('0x26')](db[_0xcaa4('0x27')][_0xcaa4('0x28')],function(_0x53a2b6){return{'name':_0x53a2b6['fieldName'],'type':_0x53a2b6[_0xcaa4('0x29')]['key']};});_0x4f2f59['model']=_[_0xcaa4('0x26')](_0x3bc8d0,_0xcaa4('0x23'));_0x4f2f59[_0xcaa4('0x2a')]=_[_0xcaa4('0x2b')](_0x965616['query']);_0x4f2f59[_0xcaa4('0x2c')]=_['intersection'](_0x4f2f59[_0xcaa4('0x2d')],_0x4f2f59[_0xcaa4('0x2a')]);_0x12df16[_0xcaa4('0x2e')]=_[_0xcaa4('0x2f')](_0x4f2f59['model'],qs['fields'](_0x965616[_0xcaa4('0x2a')]['fields']));_0x12df16[_0xcaa4('0x2e')]=_0x12df16[_0xcaa4('0x2e')][_0xcaa4('0x30')]?_0x12df16[_0xcaa4('0x2e')]:_0x4f2f59[_0xcaa4('0x2d')];if(!_0x965616[_0xcaa4('0x2a')][_0xcaa4('0x31')](_0xcaa4('0x32'))){_0x12df16['limit']=qs[_0xcaa4('0x33')](_0x965616['query'][_0xcaa4('0x33')]);_0x12df16[_0xcaa4('0x18')]=qs['offset'](_0x965616[_0xcaa4('0x2a')][_0xcaa4('0x18')]);}_0x12df16[_0xcaa4('0x34')]=qs['sort'](_0x965616['query'][_0xcaa4('0x35')]);_0x12df16[_0xcaa4('0x36')]=qs[_0xcaa4('0x2c')](_[_0xcaa4('0x37')](_0x965616[_0xcaa4('0x2a')],_0x4f2f59['filters']),_0x3bc8d0);if(_0x965616['query']['filter']){_0x12df16[_0xcaa4('0x36')]=_['merge'](_0x12df16['where'],{'$or':_[_0xcaa4('0x26')](_0x3bc8d0,function(_0x5cb777){if(_0x5cb777[_0xcaa4('0x29')]!==_0xcaa4('0x38')){var _0x2fd9e3={};_0x2fd9e3[_0x5cb777[_0xcaa4('0x23')]]={'$like':'%'+_0x965616['query'][_0xcaa4('0x39')]+'%'};return _0x2fd9e3;}})});}_0x12df16=_['merge']({},_0x12df16,_0x965616['options']);var _0x91dc7c={'where':_0x12df16[_0xcaa4('0x36')]};return db['JscriptySessionReport']['count'](_0x91dc7c)[_0xcaa4('0x20')](function(_0x2911e4){_0x3f36ae[_0xcaa4('0x3a')]=_0x2911e4;if(_0x965616[_0xcaa4('0x2a')][_0xcaa4('0x3b')]){_0x12df16[_0xcaa4('0x3c')]=[{'all':!![]}];}return db[_0xcaa4('0x27')][_0xcaa4('0x3d')](_0x12df16);})[_0xcaa4('0x20')](function(_0x1eb890){_0x3f36ae[_0xcaa4('0x3e')]=_0x1eb890;return _0x3f36ae;})[_0xcaa4('0x20')](respondWithFilteredResult(_0xb19cb8,_0x12df16))[_0xcaa4('0x3f')](handleError(_0xb19cb8,null));};exports[_0xcaa4('0x40')]=function(_0x9120d2,_0x52e459){var _0x3c94ba={'raw':!![],'where':{'id':_0x9120d2[_0xcaa4('0x41')]['id']}},_0x1a6ba0={};_0x1a6ba0[_0xcaa4('0x2d')]=_[_0xcaa4('0x2b')](db[_0xcaa4('0x27')][_0xcaa4('0x28')]);_0x1a6ba0['query']=_[_0xcaa4('0x2b')](_0x9120d2[_0xcaa4('0x2a')]);_0x1a6ba0[_0xcaa4('0x2c')]=_[_0xcaa4('0x2f')](_0x1a6ba0['model'],_0x1a6ba0[_0xcaa4('0x2a')]);_0x3c94ba[_0xcaa4('0x2e')]=_['intersection'](_0x1a6ba0[_0xcaa4('0x2d')],qs[_0xcaa4('0x42')](_0x9120d2[_0xcaa4('0x2a')][_0xcaa4('0x42')]));_0x3c94ba[_0xcaa4('0x2e')]=_0x3c94ba[_0xcaa4('0x2e')][_0xcaa4('0x30')]?_0x3c94ba[_0xcaa4('0x2e')]:_0x1a6ba0['model'];if(_0x9120d2['query'][_0xcaa4('0x3b')]){_0x3c94ba[_0xcaa4('0x3c')]=[{'all':!![]}];}_0x3c94ba=_['merge']({},_0x3c94ba,_0x9120d2[_0xcaa4('0x43')]);return db[_0xcaa4('0x27')]['find'](_0x3c94ba)[_0xcaa4('0x20')](handleEntityNotFound(_0x52e459,null))[_0xcaa4('0x20')](respondWithResult(_0x52e459,null))[_0xcaa4('0x3f')](handleError(_0x52e459,null));};exports['create']=function(_0x359321,_0x13fae3){return db['JscriptySessionReport'][_0xcaa4('0x44')](_0x359321['body'],{})[_0xcaa4('0x20')](respondWithResult(_0x13fae3,0xc9))[_0xcaa4('0x3f')](handleError(_0x13fae3,null));};exports['update']=function(_0x1fa112,_0x785b86){if(_0x1fa112[_0xcaa4('0x45')]['id']){delete _0x1fa112[_0xcaa4('0x45')]['id'];}return db['JscriptySessionReport'][_0xcaa4('0x46')]({'where':{'id':_0x1fa112[_0xcaa4('0x41')]['id']}})[_0xcaa4('0x20')](handleEntityNotFound(_0x785b86,null))['then'](saveUpdates(_0x1fa112[_0xcaa4('0x45')],null))[_0xcaa4('0x20')](respondWithResult(_0x785b86,null))[_0xcaa4('0x3f')](handleError(_0x785b86,null));};exports[_0xcaa4('0x21')]=function(_0x595277,_0x1bf5ee){return db[_0xcaa4('0x27')][_0xcaa4('0x46')]({'where':{'id':_0x595277['params']['id']}})[_0xcaa4('0x20')](handleEntityNotFound(_0x1bf5ee,null))['then'](removeEntity(_0x1bf5ee,null))[_0xcaa4('0x3f')](handleError(_0x1bf5ee,null));};exports[_0xcaa4('0x47')]=function(_0x4bced8,_0xd5fe5b){return db[_0xcaa4('0x27')][_0xcaa4('0x47')]()['then'](respondWithResult(_0xd5fe5b,null))['catch'](handleError(_0xd5fe5b,null));};exports[_0xcaa4('0x48')]=function(_0x1193e5,_0x48e3d4,_0x4663f4){var _0xb6560b={'raw':!![],'where':{}};var _0x507604={};var _0x2ecf79={'count':0x0,'rows':[]};return db[_0xcaa4('0x27')][_0xcaa4('0x49')]({'where':{'id':_0x1193e5[_0xcaa4('0x41')]['id']}})['then'](handleEntityNotFound(_0x48e3d4,null))[_0xcaa4('0x20')](function(_0x26ef09){if(_0x26ef09){_0x507604['model']=_[_0xcaa4('0x2b')](db[_0xcaa4('0x4a')][_0xcaa4('0x28')]);_0x507604[_0xcaa4('0x2a')]=_[_0xcaa4('0x2b')](_0x1193e5['query']);_0x507604[_0xcaa4('0x2c')]=_[_0xcaa4('0x2f')](_0x507604['model'],_0x507604[_0xcaa4('0x2a')]);_0xb6560b[_0xcaa4('0x2e')]=_[_0xcaa4('0x2f')](_0x507604[_0xcaa4('0x2d')],qs[_0xcaa4('0x42')](_0x1193e5['query'][_0xcaa4('0x42')]));_0xb6560b[_0xcaa4('0x2e')]=_0xb6560b[_0xcaa4('0x2e')]['length']?_0xb6560b[_0xcaa4('0x2e')]:_0x507604[_0xcaa4('0x2d')];if(!_0x1193e5[_0xcaa4('0x2a')][_0xcaa4('0x31')](_0xcaa4('0x32'))){_0xb6560b[_0xcaa4('0x33')]=qs['limit'](_0x1193e5[_0xcaa4('0x2a')][_0xcaa4('0x33')]);_0xb6560b[_0xcaa4('0x18')]=qs[_0xcaa4('0x18')](_0x1193e5[_0xcaa4('0x2a')][_0xcaa4('0x18')]);}_0xb6560b[_0xcaa4('0x34')]=qs[_0xcaa4('0x35')](_0x1193e5[_0xcaa4('0x2a')][_0xcaa4('0x35')]);_0xb6560b[_0xcaa4('0x36')]=qs[_0xcaa4('0x2c')](_[_0xcaa4('0x37')](_0x1193e5[_0xcaa4('0x2a')],_0x507604['filters']));_0xb6560b[_0xcaa4('0x36')]['SessionId']=_0x26ef09['id'];if(_0x1193e5[_0xcaa4('0x2a')]['filter']){_0xb6560b[_0xcaa4('0x36')]=_['merge'](_0xb6560b[_0xcaa4('0x36')],{'$or':_[_0xcaa4('0x26')](_0xb6560b[_0xcaa4('0x2e')],function(_0x56da61){var _0x461145={};_0x461145[_0x56da61]={'$like':'%'+_0x1193e5[_0xcaa4('0x2a')][_0xcaa4('0x39')]+'%'};return _0x461145;})});}_0xb6560b=_[_0xcaa4('0x4b')]({},_0xb6560b,_0x1193e5[_0xcaa4('0x43')]);return db[_0xcaa4('0x4a')][_0xcaa4('0x3a')]({'where':_0xb6560b[_0xcaa4('0x36')]})[_0xcaa4('0x20')](function(_0x48fc55){_0x2ecf79[_0xcaa4('0x3a')]=_0x48fc55;if(_0x1193e5['query']['includeAll']){_0xb6560b[_0xcaa4('0x3c')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0xb6560b);})[_0xcaa4('0x20')](function(_0x5f1142){_0x2ecf79[_0xcaa4('0x3e')]=_0x5f1142;return _0x2ecf79;});}})['then'](respondWithFilteredResult(_0x48e3d4,_0xb6560b))[_0xcaa4('0x3f')](handleError(_0x48e3d4,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index c5819ca..fb8d242 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x5aaf93,_0x5c0001){var _0x17d307=function(_0x21d77a){while(--_0x21d77a){_0x5aaf93['push'](_0x5aaf93['shift']());}};_0x17d307(++_0x5c0001);}(_0x7a54,0x106));var _0x47a5=function(_0x5eed11,_0x178c6b){_0x5eed11=_0x5eed11-0x0;var _0x2dbbfa=_0x7a54[_0x5eed11];return _0x2dbbfa;};'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 _0x4975=['./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2e8892,_0x16d9dd){var _0x2b4559=function(_0xdadcb){while(--_0xdadcb){_0x2e8892['push'](_0x2e8892['shift']());}};_0x2b4559(++_0x16d9dd);}(_0x4975,0x86));var _0x5497=function(_0x2a60d0,_0x3a59b9){_0x2a60d0=_0x2a60d0-0x0;var _0x35ae33=_0x4975[_0x2a60d0];return _0x35ae33;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 590e812..f5732d2 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptySessionReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x22844a,_0x40508b){var _0x4e706c=function(_0x52b2ca){while(--_0x52b2ca){_0x22844a['push'](_0x22844a['shift']());}};_0x4e706c(++_0x40508b);}(_0x5fab,0x177));var _0xb5fa=function(_0x5a709c,_0x1e6cfe){_0x5a709c=_0x5a709c-0x0;var _0x719025=_0x5fab[_0x5a709c];return _0x719025;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file +var _0x7a54=['info','JscriptySessionReport,\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(_0x3ac579,_0x14e904){_0x3ac579=_0x3ac579-0x0;var _0x100892=_0x7a54[_0x3ac579];return _0x100892;};'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')]('JscriptySessionReport,\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/license/index.js b/server/api/license/index.js index d692fdd..1e59ed0 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 _0x4102=['../../components/interaction/service','../../config/environment','./license.controller','get','index','update','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x4c6bca,_0x3de390){var _0x29d58e=function(_0x1ac871){while(--_0x1ac871){_0x4c6bca['push'](_0x4c6bca['shift']());}};_0x29d58e(++_0x3de390);}(_0x4102,0xc5));var _0x2410=function(_0x10c727,_0x970da8){_0x10c727=_0x10c727-0x0;var _0x275ac0=_0x4102[_0x10c727];return _0x275ac0;};'use strict';var multer=require(_0x2410('0x0'));var util=require(_0x2410('0x1'));var path=require(_0x2410('0x2'));var timeout=require(_0x2410('0x3'));var express=require('express');var router=express[_0x2410('0x4')]();var fs_extra=require(_0x2410('0x5'));var auth=require(_0x2410('0x6'));var interaction=require(_0x2410('0x7'));var config=require(_0x2410('0x8'));var controller=require(_0x2410('0x9'));router[_0x2410('0xa')]('/',controller[_0x2410('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2410('0xc')]);router['get'](_0x2410('0xd'),auth[_0x2410('0xe')](),controller[_0x2410('0xf')]);module[_0x2410('0x10')]=router; \ No newline at end of file +var _0x6374=['get','/download_log_file','downloadLogFile','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','index','put','/:id','isAuthenticated','update'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x6374,0x102));var _0x4637=function(_0x5abb74,_0x5e7ad2){_0x5abb74=_0x5abb74-0x0;var _0x298478=_0x6374[_0x5abb74];return _0x298478;};'use strict';var multer=require('multer');var util=require(_0x4637('0x0'));var path=require(_0x4637('0x1'));var timeout=require(_0x4637('0x2'));var express=require(_0x4637('0x3'));var router=express[_0x4637('0x4')]();var fs_extra=require(_0x4637('0x5'));var auth=require(_0x4637('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4637('0x7'));var controller=require(_0x4637('0x8'));router['get']('/',controller[_0x4637('0x9')]);router[_0x4637('0xa')](_0x4637('0xb'),auth[_0x4637('0xc')](),controller[_0x4637('0xd')]);router[_0x4637('0xe')](_0x4637('0xf'),auth['isAuthenticated'](),controller[_0x4637('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 4d2c153..0c48590 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 _0x8da8=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x23fb11,_0x451fb9){var _0x48ee21=function(_0x2527a2){while(--_0x2527a2){_0x23fb11['push'](_0x23fb11['shift']());}};_0x48ee21(++_0x451fb9);}(_0x8da8,0xdd));var _0x88da=function(_0xfa7455,_0x1f81a2){_0xfa7455=_0xfa7455-0x0;var _0xe92c1a=_0x8da8[_0xfa7455];return _0xe92c1a;};'use strict';var Sequelize=require(_0x88da('0x0'));module[_0x88da('0x1')]={'license':{'type':Sequelize[_0x88da('0x2')]},'data1':{'type':Sequelize[_0x88da('0x3')]},'data2':{'type':Sequelize[_0x88da('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x88da('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe773=['TEXT','STRING','INTEGER','sequelize'];(function(_0x1cdf3a,_0x2f57dc){var _0x5bcaba=function(_0x5cc2ee){while(--_0x5cc2ee){_0x1cdf3a['push'](_0x1cdf3a['shift']());}};_0x5bcaba(++_0x2f57dc);}(_0xe773,0x1db));var _0x3e77=function(_0xbf8627,_0xce8e10){_0xbf8627=_0xbf8627-0x0;var _0x5c6000=_0xe773[_0xbf8627];return _0x5c6000;};'use strict';var Sequelize=require(_0x3e77('0x0'));module['exports']={'license':{'type':Sequelize[_0x3e77('0x1')]},'data1':{'type':Sequelize[_0x3e77('0x2')]},'data2':{'type':Sequelize[_0x3e77('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x3e77('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 337337f..259c280 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 _0x4026=['/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','../../config/license/util','model','License','rawAttributes','query','keys','intersection','fields','attributes','length','merge','options','catch','find','params','checkLicense','body','demo','downloadLogFile','join'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4026,0x161));var _0x6402=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4026[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6402('0x0'));var rimraf=require(_0x6402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6402('0x2'));var rp=require(_0x6402('0x3'));var moment=require(_0x6402('0x4'));var BPromise=require(_0x6402('0x5'));var Mustache=require(_0x6402('0x6'));var util=require(_0x6402('0x7'));var path=require(_0x6402('0x8'));var sox=require(_0x6402('0x9'));var csv=require(_0x6402('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6402('0xb'));var _=require(_0x6402('0xc'));var squel=require('squel');var crypto=require(_0x6402('0xd'));var jsforce=require(_0x6402('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6402('0xf'));var Papa=require('papaparse');var Redis=require(_0x6402('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6402('0x11'));var as=require(_0x6402('0x12'));var hardwareService=require(_0x6402('0x13'));var logger=require(_0x6402('0x14'))(_0x6402('0x15'));var utils=require(_0x6402('0x16'));var config=require(_0x6402('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6402('0x18'))['db'];function respondWithStatusCode(_0x275b66,_0x49c55c){_0x49c55c=_0x49c55c||0xcc;return function(_0x4da5e7){if(_0x4da5e7){return _0x275b66[_0x6402('0x19')](_0x49c55c);}return _0x275b66[_0x6402('0x1a')](_0x49c55c)['end']();};}function respondWithResult(_0x4448a3,_0x3ce4ae){_0x3ce4ae=_0x3ce4ae||0xc8;return function(_0x30f0cc){if(_0x30f0cc){return _0x4448a3[_0x6402('0x1a')](_0x3ce4ae)[_0x6402('0x1b')](_0x30f0cc);}};}function respondWithFilteredResult(_0x54c277,_0x1ebaaa){return function(_0x2aa723){if(_0x2aa723){var _0x438896=typeof _0x1ebaaa[_0x6402('0x1c')]===_0x6402('0x1d')&&typeof _0x1ebaaa['limit']===_0x6402('0x1d');var _0x3874c4=_0x2aa723[_0x6402('0x1e')];var _0x598f13=_0x438896?0x0:_0x1ebaaa[_0x6402('0x1c')];var _0x44f687=_0x438896?_0x2aa723[_0x6402('0x1e')]:_0x1ebaaa[_0x6402('0x1c')]+_0x1ebaaa['limit'];var _0x12c41b;if(_0x44f687>=_0x3874c4){_0x44f687=_0x3874c4;_0x12c41b=0xc8;}else{_0x12c41b=0xce;}_0x54c277[_0x6402('0x1a')](_0x12c41b);return _0x54c277[_0x6402('0x1f')]('Content-Range',_0x598f13+'-'+_0x44f687+'/'+_0x3874c4)[_0x6402('0x1b')](_0x2aa723);}return null;};}function patchUpdates(_0x3e3851){return function(_0x445591){try{jsonpatch[_0x6402('0x20')](_0x445591,_0x3e3851,!![]);}catch(_0x138d62){return BPromise[_0x6402('0x21')](_0x138d62);}return _0x445591[_0x6402('0x22')]();};}function saveUpdates(_0xaec3d0,_0x21e4e1){return function(_0x20929d){if(_0x20929d){return _0x20929d[_0x6402('0x23')](_0xaec3d0)[_0x6402('0x24')](function(_0x4ac45a){return _0x4ac45a;});}return null;};}function removeEntity(_0x297831,_0x298d3c){return function(_0x43411f){if(_0x43411f){return _0x43411f['destroy']()['then'](function(){_0x297831[_0x6402('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31b06f,_0x5495ea){return function(_0x2d0fd2){if(!_0x2d0fd2){_0x31b06f[_0x6402('0x19')](0x194);}return _0x2d0fd2;};}function handleError(_0x59bc8d,_0x5442a8){_0x5442a8=_0x5442a8||0x1f4;return function(_0x408618){logger[_0x6402('0x25')](_0x408618[_0x6402('0x26')]);if(_0x408618[_0x6402('0x27')]){delete _0x408618[_0x6402('0x27')];}_0x59bc8d[_0x6402('0x1a')](_0x5442a8)[_0x6402('0x28')](_0x408618);};}var utilLicense=require(_0x6402('0x29'));exports['index']=function(_0x349eb0,_0x1307fe){var _0x4c94a1={'raw':!![],'where':{'id':0x1}},_0x2526cf={};_0x2526cf[_0x6402('0x2a')]=_['keys'](db[_0x6402('0x2b')][_0x6402('0x2c')]);_0x2526cf[_0x6402('0x2d')]=_[_0x6402('0x2e')](_0x349eb0[_0x6402('0x2d')]);_0x2526cf['filters']=_[_0x6402('0x2f')](_0x2526cf['model'],_0x2526cf[_0x6402('0x2d')]);_0x4c94a1['attributes']=_[_0x6402('0x2f')](_0x2526cf['model'],qs['fields'](_0x349eb0[_0x6402('0x2d')][_0x6402('0x30')]));_0x4c94a1[_0x6402('0x31')]=_0x4c94a1[_0x6402('0x31')][_0x6402('0x32')]?_0x4c94a1['attributes']:_0x2526cf['model'];_0x4c94a1=_[_0x6402('0x33')]({},_0x4c94a1,_0x349eb0[_0x6402('0x34')]);return utilLicense['getLicense'](_0x4c94a1)['then'](respondWithResult(_0x1307fe,null))[_0x6402('0x35')](handleError(_0x1307fe,null));};exports[_0x6402('0x23')]=function(_0x7d57ac,_0x1ff8c9){if(_0x7d57ac['body']['id']){delete _0x7d57ac['body']['id'];}return db[_0x6402('0x2b')][_0x6402('0x36')]({'where':{'id':_0x7d57ac[_0x6402('0x37')]['id']}})[_0x6402('0x24')](handleEntityNotFound(_0x1ff8c9,null))['then'](function(_0x9cf6f8){var _0x28c782=_0x9cf6f8['get']({'plain':!![]});return utilLicense[_0x6402('0x38')](_0x28c782,_0x7d57ac[_0x6402('0x39')]['key']);})['then'](function(_0x26c0f6){if(!_0x26c0f6[_0x6402('0x3a')]){return saveUpdates(_0x7d57ac[_0x6402('0x39')],null);}return _0x26c0f6;})['then'](respondWithResult(_0x1ff8c9,null))[_0x6402('0x35')](handleError(_0x1ff8c9,null));};exports[_0x6402('0x3b')]=function(_0x2720a8,_0x3ac038){var _0x51c9fd='license-info.log';var _0x3b82da=path[_0x6402('0x3c')](_0x6402('0x3d'),'log',_0x6402('0x3e'),_0x51c9fd);_0x3ac038[_0x6402('0x3f')](_0x6402('0x40'),_0x6402('0x41')+_0x51c9fd);_0x3ac038[_0x6402('0x1f')](_0x6402('0x42'),_0x6402('0x43'));_0x3ac038[_0x6402('0x44')](_0x3b82da);}; \ No newline at end of file +var _0x2e16=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','error','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','getLicense','catch','update','body','find','params','checkLicense','key','downloadLogFile','license-info.log','join','/var','xcally','attachment;\x20filename=','Content-Type','text/plain','download','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x8fb7a4,_0x607700){var _0x1fdca2=function(_0x300754){while(--_0x300754){_0x8fb7a4['push'](_0x8fb7a4['shift']());}};_0x1fdca2(++_0x607700);}(_0x2e16,0xc6));var _0x62e1=function(_0x5f1f8c,_0x40cad2){_0x5f1f8c=_0x5f1f8c-0x0;var _0x53fca7=_0x2e16[_0x5f1f8c];return _0x53fca7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62e1('0x0'));var zipdir=require(_0x62e1('0x1'));var jsonpatch=require(_0x62e1('0x2'));var rp=require('request-promise');var moment=require(_0x62e1('0x3'));var BPromise=require(_0x62e1('0x4'));var Mustache=require(_0x62e1('0x5'));var util=require(_0x62e1('0x6'));var path=require('path');var sox=require(_0x62e1('0x7'));var csv=require(_0x62e1('0x8'));var ejs=require(_0x62e1('0x9'));var fs=require('fs');var fs_extra=require(_0x62e1('0xa'));var _=require(_0x62e1('0xb'));var squel=require(_0x62e1('0xc'));var crypto=require('crypto');var jsforce=require(_0x62e1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x62e1('0x8'));var querystring=require(_0x62e1('0xe'));var Papa=require('papaparse');var Redis=require(_0x62e1('0xf'));var authService=require(_0x62e1('0x10'));var qs=require(_0x62e1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62e1('0x12'));var logger=require(_0x62e1('0x13'))(_0x62e1('0x14'));var utils=require('../../config/utils');var config=require(_0x62e1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x62e1('0x16'))['db'];function respondWithStatusCode(_0x2cb81f,_0x326bc9){_0x326bc9=_0x326bc9||0xcc;return function(_0x2f4806){if(_0x2f4806){return _0x2cb81f[_0x62e1('0x17')](_0x326bc9);}return _0x2cb81f[_0x62e1('0x18')](_0x326bc9)[_0x62e1('0x19')]();};}function respondWithResult(_0x3d9b45,_0x34989d){_0x34989d=_0x34989d||0xc8;return function(_0x595e3f){if(_0x595e3f){return _0x3d9b45[_0x62e1('0x18')](_0x34989d)[_0x62e1('0x1a')](_0x595e3f);}};}function respondWithFilteredResult(_0xdb6ab6,_0x6923a2){return function(_0x1a33d5){if(_0x1a33d5){var _0x324d8a=typeof _0x6923a2[_0x62e1('0x1b')]===_0x62e1('0x1c')&&typeof _0x6923a2[_0x62e1('0x1d')]===_0x62e1('0x1c');var _0x119146=_0x1a33d5[_0x62e1('0x1e')];var _0x49830a=_0x324d8a?0x0:_0x6923a2['offset'];var _0x325cf7=_0x324d8a?_0x1a33d5[_0x62e1('0x1e')]:_0x6923a2['offset']+_0x6923a2[_0x62e1('0x1d')];var _0x1ba24a;if(_0x325cf7>=_0x119146){_0x325cf7=_0x119146;_0x1ba24a=0xc8;}else{_0x1ba24a=0xce;}_0xdb6ab6[_0x62e1('0x18')](_0x1ba24a);return _0xdb6ab6[_0x62e1('0x1f')](_0x62e1('0x20'),_0x49830a+'-'+_0x325cf7+'/'+_0x119146)[_0x62e1('0x1a')](_0x1a33d5);}return null;};}function patchUpdates(_0x57dc2e){return function(_0x3058cb){try{jsonpatch[_0x62e1('0x21')](_0x3058cb,_0x57dc2e,!![]);}catch(_0x19764b){return BPromise['reject'](_0x19764b);}return _0x3058cb['save']();};}function saveUpdates(_0x14de6b,_0x5a74e5){return function(_0x6fe02e){if(_0x6fe02e){return _0x6fe02e['update'](_0x14de6b)[_0x62e1('0x22')](function(_0x297de2){return _0x297de2;});}return null;};}function removeEntity(_0x4ff0ba,_0x367378){return function(_0x21141f){if(_0x21141f){return _0x21141f['destroy']()[_0x62e1('0x22')](function(){_0x4ff0ba[_0x62e1('0x18')](0xcc)[_0x62e1('0x19')]();});}};}function handleEntityNotFound(_0x175e62,_0x4dcee1){return function(_0x3a8748){if(!_0x3a8748){_0x175e62['sendStatus'](0x194);}return _0x3a8748;};}function handleError(_0x5e922c,_0x405db2){_0x405db2=_0x405db2||0x1f4;return function(_0x486156){logger[_0x62e1('0x23')](_0x486156['stack']);if(_0x486156[_0x62e1('0x24')]){delete _0x486156[_0x62e1('0x24')];}_0x5e922c['status'](_0x405db2)[_0x62e1('0x25')](_0x486156);};}var utilLicense=require(_0x62e1('0x26'));exports[_0x62e1('0x27')]=function(_0x26dedc,_0x483bd9){var _0x2ab983={'raw':!![],'where':{'id':0x1}},_0x178cd7={};_0x178cd7[_0x62e1('0x28')]=_[_0x62e1('0x29')](db[_0x62e1('0x2a')][_0x62e1('0x2b')]);_0x178cd7[_0x62e1('0x2c')]=_[_0x62e1('0x29')](_0x26dedc['query']);_0x178cd7[_0x62e1('0x2d')]=_[_0x62e1('0x2e')](_0x178cd7[_0x62e1('0x28')],_0x178cd7[_0x62e1('0x2c')]);_0x2ab983[_0x62e1('0x2f')]=_['intersection'](_0x178cd7[_0x62e1('0x28')],qs[_0x62e1('0x30')](_0x26dedc['query'][_0x62e1('0x30')]));_0x2ab983[_0x62e1('0x2f')]=_0x2ab983[_0x62e1('0x2f')][_0x62e1('0x31')]?_0x2ab983[_0x62e1('0x2f')]:_0x178cd7[_0x62e1('0x28')];_0x2ab983=_[_0x62e1('0x32')]({},_0x2ab983,_0x26dedc['options']);return utilLicense[_0x62e1('0x33')](_0x2ab983)[_0x62e1('0x22')](respondWithResult(_0x483bd9,null))[_0x62e1('0x34')](handleError(_0x483bd9,null));};exports[_0x62e1('0x35')]=function(_0x399b77,_0x519ca9){if(_0x399b77[_0x62e1('0x36')]['id']){delete _0x399b77['body']['id'];}return db[_0x62e1('0x2a')][_0x62e1('0x37')]({'where':{'id':_0x399b77[_0x62e1('0x38')]['id']}})[_0x62e1('0x22')](handleEntityNotFound(_0x519ca9,null))[_0x62e1('0x22')](function(_0x2581aa){var _0x220473=_0x2581aa['get']({'plain':!![]});return utilLicense[_0x62e1('0x39')](_0x220473,_0x399b77[_0x62e1('0x36')][_0x62e1('0x3a')]);})['then'](function(_0x137cbc){if(!_0x137cbc['demo']){return saveUpdates(_0x399b77[_0x62e1('0x36')],null);}return _0x137cbc;})[_0x62e1('0x22')](respondWithResult(_0x519ca9,null))[_0x62e1('0x34')](handleError(_0x519ca9,null));};exports[_0x62e1('0x3b')]=function(_0x3e6923,_0x1c5cc5){var _0x5b3b71=_0x62e1('0x3c');var _0x48da48=path[_0x62e1('0x3d')](_0x62e1('0x3e'),'log',_0x62e1('0x3f'),_0x5b3b71);_0x1c5cc5['setHeader']('Content-disposition',_0x62e1('0x40')+_0x5b3b71);_0x1c5cc5[_0x62e1('0x1f')](_0x62e1('0x41'),_0x62e1('0x42'));_0x1c5cc5[_0x62e1('0x43')](_0x48da48);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index f13b8a3..55faec9 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 _0xc385=['./license.attributes','exports','define','License','license','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x3c6c4d,_0x3b3c92){var _0x3bea7c=function(_0x298c23){while(--_0x298c23){_0x3c6c4d['push'](_0x3c6c4d['shift']());}};_0x3bea7c(++_0x3b3c92);}(_0xc385,0x65));var _0x5c38=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xc385[_0x1a9204];return _0x17ca68;};'use strict';var _=require(_0x5c38('0x0'));var util=require(_0x5c38('0x1'));var logger=require(_0x5c38('0x2'))(_0x5c38('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5c38('0x4'));var fs=require('fs');var path=require(_0x5c38('0x5'));var rimraf=require(_0x5c38('0x6'));var config=require('../../config/environment');var attributes=require(_0x5c38('0x7'));module[_0x5c38('0x8')]=function(_0x5abae3,_0x93220e){return _0x5abae3[_0x5c38('0x9')](_0x5c38('0xa'),attributes,{'tableName':_0x5c38('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e79=['License','license','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./license.attributes','exports','define'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7e79,0xab));var _0x97e7=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7e79[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x97e7('0x0'));var util=require(_0x97e7('0x1'));var logger=require(_0x97e7('0x2'))(_0x97e7('0x3'));var moment=require('moment');var BPromise=require(_0x97e7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97e7('0x5'));var rimraf=require(_0x97e7('0x6'));var config=require(_0x97e7('0x7'));var attributes=require(_0x97e7('0x8'));module[_0x97e7('0x9')]=function(_0x18be16,_0x33f357){return _0x18be16[_0x97e7('0xa')](_0x97e7('0xb'),attributes,{'tableName':_0x97e7('0xc'),'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 3039c54..79b6d87 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 _0x4304=['../../mysqldb','../../config/utils','../../config/environment','http','request','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','License,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4e72a5,_0x59d207){var _0x5c608f=function(_0x5e0632){while(--_0x5e0632){_0x4e72a5['push'](_0x4e72a5['shift']());}};_0x5c608f(++_0x59d207);}(_0x4304,0x67));var _0x4430=function(_0xa4c082,_0xdda144){_0xa4c082=_0xa4c082-0x0;var _0x4ba32=_0x4304[_0xa4c082];return _0x4ba32;};'use strict';var _=require(_0x4430('0x0'));var util=require(_0x4430('0x1'));var moment=require('moment');var BPromise=require(_0x4430('0x2'));var rs=require(_0x4430('0x3'));var fs=require('fs');var Redis=require(_0x4430('0x4'));var db=require(_0x4430('0x5'))['db'];var utils=require(_0x4430('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4430('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4430('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f1478,_0x552d7d,_0x26d38d){return new BPromise(function(_0x240232,_0x34f38e){return client[_0x4430('0x9')](_0x4f1478,_0x26d38d)['then'](function(_0x30e3fb){logger[_0x4430('0xa')]('License,\x20%s,\x20%s',_0x552d7d,_0x4430('0xb'));logger[_0x4430('0xc')](_0x4430('0xd'),_0x552d7d,'request\x20sent',JSON['stringify'](_0x30e3fb));if(_0x30e3fb[_0x4430('0xe')]){if(_0x30e3fb[_0x4430('0xe')]['code']===0x1f4){logger['error'](_0x4430('0xf'),_0x552d7d,_0x30e3fb[_0x4430('0xe')][_0x4430('0x10')]);return _0x34f38e(_0x30e3fb[_0x4430('0xe')][_0x4430('0x10')]);}logger['error'](_0x4430('0xf'),_0x552d7d,_0x30e3fb[_0x4430('0xe')][_0x4430('0x10')]);return _0x240232(_0x30e3fb[_0x4430('0xe')][_0x4430('0x10')]);}else{logger[_0x4430('0xa')](_0x4430('0xf'),_0x552d7d,_0x4430('0xb'));_0x240232(_0x30e3fb[_0x4430('0x11')][_0x4430('0x10')]);}})['catch'](function(_0x585372){logger[_0x4430('0xe')](_0x4430('0xf'),_0x552d7d,_0x585372);_0x34f38e(_0x585372);});});} \ No newline at end of file +var _0x7655=['client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4aa975,_0x2136e2){var _0x3a5cd3=function(_0x17379f){while(--_0x17379f){_0x4aa975['push'](_0x4aa975['shift']());}};_0x3a5cd3(++_0x2136e2);}(_0x7655,0xef));var _0x5765=function(_0x4cdbbb,_0x14f674){_0x4cdbbb=_0x4cdbbb-0x0;var _0x525a97=_0x7655[_0x4cdbbb];return _0x525a97;};'use strict';var _=require(_0x5765('0x0'));var util=require(_0x5765('0x1'));var moment=require(_0x5765('0x2'));var BPromise=require(_0x5765('0x3'));var rs=require(_0x5765('0x4'));var fs=require('fs');var Redis=require(_0x5765('0x5'));var db=require(_0x5765('0x6'))['db'];var utils=require(_0x5765('0x7'));var logger=require(_0x5765('0x8'))(_0x5765('0x9'));var config=require('../../config/environment');var jayson=require(_0x5765('0xa'));var client=jayson[_0x5765('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b1b29,_0x31a579,_0x4a0d39){return new BPromise(function(_0x45dc0b,_0x4360f5){return client[_0x5765('0xc')](_0x5b1b29,_0x4a0d39)[_0x5765('0xd')](function(_0x4152fe){logger[_0x5765('0xe')](_0x5765('0xf'),_0x31a579,_0x5765('0x10'));logger[_0x5765('0x11')](_0x5765('0x12'),_0x31a579,_0x5765('0x10'),JSON[_0x5765('0x13')](_0x4152fe));if(_0x4152fe[_0x5765('0x14')]){if(_0x4152fe['error'][_0x5765('0x15')]===0x1f4){logger['error'](_0x5765('0xf'),_0x31a579,_0x4152fe[_0x5765('0x14')][_0x5765('0x16')]);return _0x4360f5(_0x4152fe[_0x5765('0x14')][_0x5765('0x16')]);}logger['error'](_0x5765('0xf'),_0x31a579,_0x4152fe[_0x5765('0x14')][_0x5765('0x16')]);return _0x45dc0b(_0x4152fe['error'][_0x5765('0x16')]);}else{logger['info']('License,\x20%s,\x20%s',_0x31a579,_0x5765('0x10'));_0x45dc0b(_0x4152fe[_0x5765('0x17')]['message']);}})[_0x5765('0x18')](function(_0x4a45a8){logger[_0x5765('0x14')]('License,\x20%s,\x20%s',_0x31a579,_0x4a45a8);_0x4360f5(_0x4a45a8);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index deabcac..a4ccdf1 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 _0xde98=['express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getSmtp','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','delete','removeDispositions','removeImap','/:id/out_servers','/:id/users','removeAgents','exports','multer','util'];(function(_0x744aa6,_0x22934c){var _0x57ab6c=function(_0x2b94f3){while(--_0x2b94f3){_0x744aa6['push'](_0x744aa6['shift']());}};_0x57ab6c(++_0x22934c);}(_0xde98,0x181));var _0x8de9=function(_0x4e5bb7,_0x1171fa){_0x4e5bb7=_0x4e5bb7-0x0;var _0x3b573c=_0xde98[_0x4e5bb7];return _0x3b573c;};'use strict';var multer=require(_0x8de9('0x0'));var util=require(_0x8de9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8de9('0x2'));var router=express['Router']();var fs_extra=require(_0x8de9('0x3'));var auth=require(_0x8de9('0x4'));var interaction=require(_0x8de9('0x5'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x8de9('0x6')]('/',auth[_0x8de9('0x7')](),controller['index']);router[_0x8de9('0x6')](_0x8de9('0x8'),auth[_0x8de9('0x7')](),controller[_0x8de9('0x9')]);router['get'](_0x8de9('0xa'),auth[_0x8de9('0x7')](),controller[_0x8de9('0xb')]);router[_0x8de9('0x6')](_0x8de9('0xc'),auth['isAuthenticated'](),controller[_0x8de9('0xd')]);router[_0x8de9('0x6')](_0x8de9('0xe'),auth['isAuthenticated'](),controller[_0x8de9('0xf')]);router[_0x8de9('0x6')]('/:id/in_servers',auth[_0x8de9('0x7')](),controller['getImap']);router['get']('/:id/out_servers',auth[_0x8de9('0x7')](),controller[_0x8de9('0x10')]);router['get']('/:id/interactions',auth[_0x8de9('0x7')](),controller[_0x8de9('0x11')]);router['get'](_0x8de9('0x12'),auth[_0x8de9('0x7')](),controller[_0x8de9('0x13')]);router[_0x8de9('0x6')]('/:id/messages',auth[_0x8de9('0x7')](),controller[_0x8de9('0x14')]);router['get'](_0x8de9('0x15'),auth[_0x8de9('0x7')](),controller[_0x8de9('0x16')]);router['get']('/:id/users',auth[_0x8de9('0x7')](),controller['getAgents']);router[_0x8de9('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8de9('0x18')]);router[_0x8de9('0x17')]('/:id/canned_answers',auth[_0x8de9('0x7')](),controller[_0x8de9('0x19')]);router['post']('/',auth[_0x8de9('0x7')](),controller[_0x8de9('0x1a')]);router['post'](_0x8de9('0x1b'),auth[_0x8de9('0x7')](),controller[_0x8de9('0x1c')]);router[_0x8de9('0x17')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x8de9('0x1d')]);router[_0x8de9('0x17')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x8de9('0x1e')]);router[_0x8de9('0x17')](_0x8de9('0x12'),auth[_0x8de9('0x7')](),controller[_0x8de9('0x1f')]);router[_0x8de9('0x17')](_0x8de9('0x20'),auth[_0x8de9('0x7')](),controller[_0x8de9('0x21')]);router['post']('/:id/users',auth[_0x8de9('0x7')](),controller[_0x8de9('0x22')]);router[_0x8de9('0x23')](_0x8de9('0xa'),auth[_0x8de9('0x7')](),controller['update']);router[_0x8de9('0x24')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8de9('0x25')]);router[_0x8de9('0x24')](_0x8de9('0xe'),auth[_0x8de9('0x7')](),controller['removeAnswers']);router[_0x8de9('0x24')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x8de9('0x26')]);router[_0x8de9('0x24')](_0x8de9('0x27'),auth[_0x8de9('0x7')](),controller['removeSmtp']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x8de9('0x28'),auth['isAuthenticated'](),controller[_0x8de9('0x29')]);module[_0x8de9('0x2a')]=router; \ No newline at end of file +var _0x1ff7=['/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','addAgents','/:id','update','delete','removeDispositions','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','index','get','/describe','isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1ff7,0xdd));var _0x71ff=function(_0xc56cbf,_0x2c4d11){_0xc56cbf=_0xc56cbf-0x0;var _0x1e6118=_0x1ff7[_0xc56cbf];return _0x1e6118;};'use strict';var multer=require(_0x71ff('0x0'));var util=require(_0x71ff('0x1'));var path=require(_0x71ff('0x2'));var timeout=require(_0x71ff('0x3'));var express=require('express');var router=express[_0x71ff('0x4')]();var fs_extra=require(_0x71ff('0x5'));var auth=require(_0x71ff('0x6'));var interaction=require(_0x71ff('0x7'));var config=require('../../config/environment');var controller=require(_0x71ff('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x71ff('0x9')]);router[_0x71ff('0xa')](_0x71ff('0xb'),auth[_0x71ff('0xc')](),controller['describe']);router[_0x71ff('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x71ff('0xa')](_0x71ff('0xd'),auth['isAuthenticated'](),controller[_0x71ff('0xe')]);router[_0x71ff('0xa')](_0x71ff('0xf'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x10')]);router[_0x71ff('0xa')](_0x71ff('0x11'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x12')]);router['get'](_0x71ff('0x13'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x14')]);router[_0x71ff('0xa')](_0x71ff('0x15'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x16')]);router[_0x71ff('0xa')]('/:id/applications',auth[_0x71ff('0xc')](),controller[_0x71ff('0x17')]);router[_0x71ff('0xa')](_0x71ff('0x18'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x19')]);router[_0x71ff('0xa')]('/:id/verify',auth[_0x71ff('0xc')](),controller[_0x71ff('0x1a')]);router['get'](_0x71ff('0x1b'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x1c')]);router[_0x71ff('0x1d')](_0x71ff('0xd'),auth['isAuthenticated'](),controller[_0x71ff('0x1e')]);router[_0x71ff('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x71ff('0x1f')]);router[_0x71ff('0x1d')]('/',auth['isAuthenticated'](),controller[_0x71ff('0x20')]);router['post'](_0x71ff('0x11'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x21')]);router[_0x71ff('0x1d')](_0x71ff('0x13'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x22')]);router[_0x71ff('0x1d')](_0x71ff('0x15'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x23')]);router['post'](_0x71ff('0x24'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x25')]);router[_0x71ff('0x1d')](_0x71ff('0x26'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x27')]);router['post'](_0x71ff('0x1b'),auth['isAuthenticated'](),controller[_0x71ff('0x28')]);router['put'](_0x71ff('0x29'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x2a')]);router[_0x71ff('0x2b')]('/:id/dispositions',auth[_0x71ff('0xc')](),controller[_0x71ff('0x2c')]);router['delete'](_0x71ff('0xf'),auth[_0x71ff('0xc')](),controller['removeAnswers']);router[_0x71ff('0x2b')](_0x71ff('0x11'),auth[_0x71ff('0xc')](),controller['removeImap']);router[_0x71ff('0x2b')](_0x71ff('0x13'),auth[_0x71ff('0xc')](),controller['removeSmtp']);router[_0x71ff('0x2b')]('/:id',auth['isAuthenticated'](),controller[_0x71ff('0x2d')]);router[_0x71ff('0x2b')](_0x71ff('0x1b'),auth[_0x71ff('0xc')](),controller[_0x71ff('0x2e')]);module[_0x71ff('0x2f')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 74c5d34..60b89dd 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 _0x2eab=['hotmail','yahoo','outlook365','provider','getDataValue','custom','sequelize','exports','STRING','BOOLEAN','TEXT','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail'];(function(_0x28a91b,_0x285061){var _0x43440e=function(_0x51121c){while(--_0x51121c){_0x28a91b['push'](_0x28a91b['shift']());}};_0x43440e(++_0x285061);}(_0x2eab,0x1ce));var _0xb2ea=function(_0x1a6600,_0x1562b8){_0x1a6600=_0x1a6600-0x0;var _0x49284c=_0x2eab[_0x1a6600];return _0x49284c;};'use strict';var Sequelize=require(_0xb2ea('0x0'));module[_0xb2ea('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xb2ea('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xb2ea('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb2ea('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xb2ea('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xb2ea('0x4')]},'markAsUnread':{'type':Sequelize[_0xb2ea('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xb2ea('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xb2ea('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb2ea('0x6');}},'notificationSound':{'type':Sequelize[_0xb2ea('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb2ea('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb2ea('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb2ea('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb2ea('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xb2ea('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xb2ea('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xcdda2b){if(!_0xcdda2b)this[_0xb2ea('0x9')](_0xb2ea('0xa'),null);this['setDataValue'](_0xb2ea('0xb'),_0xcdda2b);}},'provider':{'type':Sequelize['ENUM'](_0xb2ea('0xc'),_0xb2ea('0xd'),_0xb2ea('0xe'),_0xb2ea('0xf')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0xb2ea('0x10')))return'custom';return this[_0xb2ea('0x11')]('provider');},'set':function(_0x301db9){if(_0x301db9===_0xb2ea('0x12'))_0x301db9=null;return this[_0xb2ea('0x9')]('provider',_0x301db9);}}}; \ No newline at end of file +var _0x6cf8=['UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x3288aa,_0x3c1d24){var _0x537609=function(_0x581368){while(--_0x581368){_0x3288aa['push'](_0x3288aa['shift']());}};_0x537609(++_0x3c1d24);}(_0x6cf8,0x64));var _0x86cf=function(_0x11a461,_0x32370f){_0x11a461=_0x11a461-0x0;var _0x2d5169=_0x6cf8[_0x11a461];return _0x2d5169;};'use strict';var Sequelize=require('sequelize');module[_0x86cf('0x0')]={'description':{'type':Sequelize[_0x86cf('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x86cf('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x86cf('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x86cf('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x86cf('0x3')]},'markAsUnread':{'type':Sequelize[_0x86cf('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x86cf('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x86cf('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x86cf('0x3')],'defaultValue':function(){return _0x86cf('0x6');}},'notificationSound':{'type':Sequelize[_0x86cf('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x86cf('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x86cf('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x86cf('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x86cf('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x86cf('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x86cf('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x86cf('0x2')],'defaultValue':![],'comment':_0x86cf('0x9'),'set':function(_0x406486){if(!_0x406486)this[_0x86cf('0xa')](_0x86cf('0xb'),null);this[_0x86cf('0xa')](_0x86cf('0xc'),_0x406486);}},'provider':{'type':Sequelize[_0x86cf('0xd')](_0x86cf('0xe'),_0x86cf('0xf'),_0x86cf('0x10'),_0x86cf('0x11')),'defaultValue':null,'get':function(){if(!this[_0x86cf('0x12')](_0x86cf('0x13')))return _0x86cf('0x14');return this['getDataValue'](_0x86cf('0x13'));},'set':function(_0x499b27){if(_0x499b27===_0x86cf('0x14'))_0x499b27=null;return this[_0x86cf('0xa')](_0x86cf('0x13'),_0x499b27);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index c4fce6f..036fb5e 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 _0x9e0f=['body','CloudProviderId','mandatoryDispositionPause','update','describe','addDisposition','MailAccountId','findOne','Disposition','hasOwnProperty','findAll','removeDispositions','ids','CannedAnswer','create','getAnswers','removeAnswers','custom','provider','email','ListId','isNil','active','description','user','password','modernAuthentication','service','host','authentication','username','pass','port','Unable\x20to\x20retrieve\x20the\x20current\x20user','MailAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','getInteractions','CmContact','Contact','User','fullname','Tag','Tags','color','tag','transaction','sequelize','READ_COMMITTED','MailApplication','findAndCountAll','priority','stack','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','split','CmList','updatedAt','DESC','%s\x20<%s>','attachments','join','server/files/attachments','basename','auth','secure','sendMail','List','Contacts','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','CloudProvider','VerifySmtp','ValidationError','addAgents','omit','spread','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','get','UserProfileResource','destroy','name','send','index','Imap','MailServerOut','Smtp','Pause','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','MailServerIn','include','MailAccount','find'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x9e0f,0x1d7));var _0xf9e0=function(_0x4a7685,_0x4b1411){_0x4a7685=_0x4a7685-0x0;var _0x461b64=_0x9e0f[_0x4a7685];return _0x461b64;};'use strict';var moment=require(_0xf9e0('0x0'));var BPromise=require(_0xf9e0('0x1'));var util=require(_0xf9e0('0x2'));var path=require(_0xf9e0('0x3'));var _=require(_0xf9e0('0x4'));var juice=require(_0xf9e0('0x5'));var Redis=require(_0xf9e0('0x6'));var qs=require(_0xf9e0('0x7'));var logger=require(_0xf9e0('0x8'))(_0xf9e0('0x9'));var config=require(_0xf9e0('0xa'));var db=require(_0xf9e0('0xb'))['db'];config['redis']=_[_0xf9e0('0xc')](config[_0xf9e0('0xd')],{'host':_0xf9e0('0xe'),'port':0x18eb});var socket=require(_0xf9e0('0xf'))(new Redis(config['redis']));require('./mailAccount.socket')[_0xf9e0('0x10')](socket);var jayson=require(_0xf9e0('0x11'));var client=jayson['client'][_0xf9e0('0x12')]({'port':0x232b});function respondWithRpcPromise(_0x25de22,_0x24e1da,_0x3b3c93,_0x1de12f){return new BPromise(function(_0x254bbd,_0x124aab){var _0x5854ee=_0x1de12f||client;return _0x5854ee[_0xf9e0('0x13')](_0x25de22,_0x3b3c93)[_0xf9e0('0x14')](function(_0x4a85ff){logger[_0xf9e0('0x15')](_0xf9e0('0x16'),_0x24e1da,'request\x20sent');logger[_0xf9e0('0x17')](_0xf9e0('0x18'),_0x24e1da,_0xf9e0('0x19'),JSON[_0xf9e0('0x1a')](_0x4a85ff));if(_0x4a85ff[_0xf9e0('0x1b')]){if(_0x4a85ff[_0xf9e0('0x1b')][_0xf9e0('0x1c')]===0x1f4){logger[_0xf9e0('0x1b')](_0xf9e0('0x16'),_0x24e1da,_0x4a85ff[_0xf9e0('0x1b')][_0xf9e0('0x1d')]);return _0x124aab(_0x4a85ff[_0xf9e0('0x1b')][_0xf9e0('0x1d')]);}logger[_0xf9e0('0x1b')](_0xf9e0('0x16'),_0x24e1da,_0x4a85ff[_0xf9e0('0x1b')][_0xf9e0('0x1d')]);return _0x254bbd(_0x4a85ff[_0xf9e0('0x1b')]['message']);}else{logger[_0xf9e0('0x15')](_0xf9e0('0x16'),_0x24e1da,_0xf9e0('0x19'));_0x254bbd(_0x4a85ff[_0xf9e0('0x1e')][_0xf9e0('0x1d')]);}})[_0xf9e0('0x1f')](function(_0x228109){logger['error'](_0xf9e0('0x16'),_0x24e1da,_0x228109);_0x124aab(_0x228109);});});}function respondWithStatusCode(_0xeab63b,_0x30b517){_0x30b517=_0x30b517||0xcc;return function(_0x3bb976){if(_0x3bb976){return _0xeab63b[_0xf9e0('0x20')](_0x30b517);}return _0xeab63b[_0xf9e0('0x21')](_0x30b517)[_0xf9e0('0x22')]();};}function respondWithResult(_0x23fc7d,_0x51cb62){_0x51cb62=_0x51cb62||0xc8;return function(_0x1ad1b6){if(_0x1ad1b6){return _0x23fc7d[_0xf9e0('0x21')](_0x51cb62)['json'](_0x1ad1b6);}};}function respondWithFilteredResult(_0x4433fa,_0x4e3798){return function(_0x13ccfd){if(_0x13ccfd){var _0xdb94c5=typeof _0x4e3798['offset']===_0xf9e0('0x23')&&typeof _0x4e3798['limit']===_0xf9e0('0x23');var _0x96665d=_0x13ccfd[_0xf9e0('0x24')];var _0x548d0d=_0xdb94c5?0x0:_0x4e3798[_0xf9e0('0x25')];var _0x429c5e=_0xdb94c5?_0x13ccfd[_0xf9e0('0x24')]:_0x4e3798[_0xf9e0('0x25')]+_0x4e3798['limit'];var _0x3e8638;if(_0x429c5e>=_0x96665d){_0x429c5e=_0x96665d;_0x3e8638=0xc8;}else{_0x3e8638=0xce;}_0x4433fa['status'](_0x3e8638);return _0x4433fa[_0xf9e0('0x26')](_0xf9e0('0x27'),_0x548d0d+'-'+_0x429c5e+'/'+_0x96665d)[_0xf9e0('0x28')](_0x13ccfd);}return null;};}function saveUpdates(_0x19a1bd){return function(_0x5458ee){if(_0x5458ee){return _0x5458ee['update'](_0x19a1bd)[_0xf9e0('0x14')](function(_0x1b6c97){return _0x1b6c97;});}return null;};}function removeEntity(_0x3abe9e){return function(_0x6cd713){if(_0x6cd713){return _0x6cd713['destroy']()[_0xf9e0('0x14')](function(){var _0x14186c=_0x6cd713[_0xf9e0('0x29')]({'plain':!![]});var _0x5c66d4='MailAccounts';return db[_0xf9e0('0x2a')][_0xf9e0('0x2b')]({'where':{'type':_0x5c66d4,'resourceId':_0x14186c['id']}})['then'](function(){return _0x6cd713;});})['then'](function(){_0x3abe9e[_0xf9e0('0x21')](0xcc)[_0xf9e0('0x22')]();});}};}function handleEntityNotFound(_0x3a23d6){return function(_0x557ee5){if(!_0x557ee5){_0x3a23d6[_0xf9e0('0x20')](0x194);}return _0x557ee5;};}function handleError(_0x447fda,_0x4bb860){_0x4bb860=_0x4bb860||0x1f4;return function(_0x44a65f){logger[_0xf9e0('0x1b')](_0x44a65f['stack']);if(_0x44a65f['name']){delete _0x44a65f[_0xf9e0('0x2c')];}_0x447fda[_0xf9e0('0x21')](_0x4bb860)[_0xf9e0('0x2d')](_0x44a65f);};}exports[_0xf9e0('0x2e')]=function(_0x391ddd,_0x5d71d4){var _0x4682b9={'include':[{'model':db['MailServerIn'],'as':_0xf9e0('0x2f')},{'model':db[_0xf9e0('0x30')],'as':_0xf9e0('0x31')},{'model':db[_0xf9e0('0x32')],'as':'mandatoryDispositionPause'}]},_0x2d9e9d={},_0x20fd1c={'count':0x0,'rows':[]};var _0x5694ec=_[_0xf9e0('0x33')](db['MailAccount'][_0xf9e0('0x34')],function(_0x15b1e8){return{'name':_0x15b1e8[_0xf9e0('0x35')],'type':_0x15b1e8[_0xf9e0('0x36')]['key']};});_0x2d9e9d[_0xf9e0('0x37')]=_[_0xf9e0('0x33')](_0x5694ec,_0xf9e0('0x2c'));_0x2d9e9d[_0xf9e0('0x38')]=_[_0xf9e0('0x39')](_0x391ddd[_0xf9e0('0x38')]);_0x2d9e9d['filters']=_[_0xf9e0('0x3a')](_0x2d9e9d[_0xf9e0('0x37')],_0x2d9e9d[_0xf9e0('0x38')]);_0x4682b9[_0xf9e0('0x3b')]=_[_0xf9e0('0x3a')](_0x2d9e9d[_0xf9e0('0x37')],qs[_0xf9e0('0x3c')](_0x391ddd['query'][_0xf9e0('0x3c')]));_0x4682b9[_0xf9e0('0x3b')]=_0x4682b9[_0xf9e0('0x3b')][_0xf9e0('0x3d')]?_0x4682b9['attributes']:_0x2d9e9d['model'];if(!_0x391ddd['query']['hasOwnProperty'](_0xf9e0('0x3e'))){_0x4682b9[_0xf9e0('0x3f')]=qs[_0xf9e0('0x3f')](_0x391ddd[_0xf9e0('0x38')]['limit']);_0x4682b9[_0xf9e0('0x25')]=qs[_0xf9e0('0x25')](_0x391ddd[_0xf9e0('0x38')][_0xf9e0('0x25')]);}_0x4682b9[_0xf9e0('0x40')]=qs[_0xf9e0('0x41')](_0x391ddd[_0xf9e0('0x38')][_0xf9e0('0x41')]);_0x4682b9[_0xf9e0('0x42')]=qs[_0xf9e0('0x43')](_[_0xf9e0('0x44')](_0x391ddd['query'],_0x2d9e9d['filters']),_0x5694ec);if(_0x391ddd[_0xf9e0('0x38')][_0xf9e0('0x45')]){_0x4682b9['where']=_[_0xf9e0('0x46')](_0x4682b9[_0xf9e0('0x42')],{'$or':_[_0xf9e0('0x33')](_0x5694ec,function(_0x574a27){if(_0x574a27['type']!==_0xf9e0('0x47')){var _0x2a84d8={};_0x2a84d8[_0x574a27[_0xf9e0('0x2c')]]={'$like':'%'+_0x391ddd['query'][_0xf9e0('0x45')]+'%'};return _0x2a84d8;}})});}_0x4682b9=_[_0xf9e0('0x46')]({},_0x4682b9,_0x391ddd[_0xf9e0('0x48')]);var _0xeff4ae={'where':_0x4682b9['where']};return db['MailAccount']['count'](_0xeff4ae)[_0xf9e0('0x14')](function(_0x4b94a7){_0x20fd1c[_0xf9e0('0x24')]=_0x4b94a7;if(_0x391ddd[_0xf9e0('0x38')][_0xf9e0('0x49')]){_0x4682b9['include']=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x4682b9);})[_0xf9e0('0x14')](function(_0x3564bf){_0x20fd1c[_0xf9e0('0x4a')]=_0x3564bf;return _0x20fd1c;})[_0xf9e0('0x14')](respondWithFilteredResult(_0x5d71d4,_0x4682b9))['catch'](handleError(_0x5d71d4,null));};exports[_0xf9e0('0x4b')]=function(_0x43cfe2,_0x28a0ad){var _0x35fa88={'raw':![],'where':{'id':_0x43cfe2[_0xf9e0('0x4c')]['id']},'include':[{'model':db[_0xf9e0('0x4d')],'as':_0xf9e0('0x2f')},{'model':db['MailServerOut'],'as':_0xf9e0('0x31')},{'model':db[_0xf9e0('0x32')],'as':'mandatoryDispositionPause'}]},_0x51e13e={};_0x51e13e[_0xf9e0('0x37')]=_[_0xf9e0('0x39')](db['MailAccount'][_0xf9e0('0x34')]);_0x51e13e[_0xf9e0('0x38')]=_[_0xf9e0('0x39')](_0x43cfe2[_0xf9e0('0x38')]);_0x51e13e[_0xf9e0('0x43')]=_[_0xf9e0('0x3a')](_0x51e13e[_0xf9e0('0x37')],_0x51e13e['query']);_0x35fa88[_0xf9e0('0x3b')]=_[_0xf9e0('0x3a')](_0x51e13e['model'],qs[_0xf9e0('0x3c')](_0x43cfe2[_0xf9e0('0x38')][_0xf9e0('0x3c')]));_0x35fa88['attributes']=_0x35fa88['attributes'][_0xf9e0('0x3d')]?_0x35fa88[_0xf9e0('0x3b')]:_0x51e13e[_0xf9e0('0x37')];if(_0x43cfe2[_0xf9e0('0x38')][_0xf9e0('0x49')]){_0x35fa88[_0xf9e0('0x4e')]=[{'all':!![]}];}_0x35fa88=_['merge']({},_0x35fa88,_0x43cfe2[_0xf9e0('0x48')]);return db[_0xf9e0('0x4f')][_0xf9e0('0x50')](_0x35fa88)[_0xf9e0('0x14')](handleEntityNotFound(_0x28a0ad,null))[_0xf9e0('0x14')](respondWithResult(_0x28a0ad,null))[_0xf9e0('0x1f')](handleError(_0x28a0ad,null));};exports['update']=function(_0x597716,_0x187867){if(_0x597716[_0xf9e0('0x51')]['id']){delete _0x597716[_0xf9e0('0x51')]['id'];}if(_0x597716[_0xf9e0('0x51')][_0xf9e0('0x2f')]){if(!_0x597716[_0xf9e0('0x51')][_0xf9e0('0x2f')]['modernAuthentication']){_0x597716[_0xf9e0('0x51')][_0xf9e0('0x2f')]['CloudProviderId']=null;}}if(_0x597716[_0xf9e0('0x51')][_0xf9e0('0x31')]){if(!_0x597716['body'][_0xf9e0('0x31')]['modernAuthentication']){_0x597716['body'][_0xf9e0('0x31')][_0xf9e0('0x52')]=null;}}return db['MailAccount'][_0xf9e0('0x50')]({'where':{'id':_0x597716['params']['id']},'include':[{'model':db[_0xf9e0('0x4d')],'as':'Imap'},{'model':db[_0xf9e0('0x30')],'as':'Smtp'},{'model':db[_0xf9e0('0x32')],'as':_0xf9e0('0x53')}]})['then'](handleEntityNotFound(_0x187867,null))[_0xf9e0('0x14')](saveUpdates(_0x597716[_0xf9e0('0x51')],null))['then'](function(_0x2ce16e){if(_0x2ce16e&&_0x597716[_0xf9e0('0x51')]['Imap']){return db[_0xf9e0('0x4d')][_0xf9e0('0x54')](_0x597716['body'][_0xf9e0('0x2f')],{'where':{'MailAccountId':_0x2ce16e['id']}})[_0xf9e0('0x14')](function(){return _0x2ce16e;});}return _0x2ce16e;})[_0xf9e0('0x14')](function(_0x2abc98){if(_0x2abc98&&_0x597716[_0xf9e0('0x51')]['Smtp']){return db[_0xf9e0('0x30')][_0xf9e0('0x54')](_0x597716['body'][_0xf9e0('0x31')],{'where':{'MailAccountId':_0x2abc98['id']}})['then'](function(){return _0x2abc98;});}return _0x2abc98;})['then'](respondWithResult(_0x187867,null))[_0xf9e0('0x1f')](handleError(_0x187867,null));};exports[_0xf9e0('0x55')]=function(_0x5481ba,_0x12b3e8){return db[_0xf9e0('0x4f')]['describe']()['then'](respondWithResult(_0x12b3e8,null))[_0xf9e0('0x1f')](handleError(_0x12b3e8,null));};exports[_0xf9e0('0x56')]=function(_0x2b5bef,_0x3070d6){if(_0x2b5bef[_0xf9e0('0x51')]['id']){delete _0x2b5bef['body']['id'];}return db[_0xf9e0('0x4f')][_0xf9e0('0x50')]({'where':{'id':_0x2b5bef[_0xf9e0('0x4c')]['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x3070d6,null))[_0xf9e0('0x14')](function(_0x2ef03d){if(_0x2ef03d){_0x2b5bef[_0xf9e0('0x51')][_0xf9e0('0x57')]=_0x2ef03d['id'];return db['Disposition']['create'](_0x2b5bef[_0xf9e0('0x51')]);}})['then'](respondWithResult(_0x3070d6,null))[_0xf9e0('0x1f')](handleError(_0x3070d6,null));};exports['getDispositions']=function(_0x3e1816,_0x248367){var _0x3cd3c4={'raw':![],'where':{}};var _0x4bad69={};var _0x591f25={'count':0x0,'rows':[]};return db[_0xf9e0('0x4f')][_0xf9e0('0x58')]({'where':{'id':_0x3e1816['params']['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x248367,null))[_0xf9e0('0x14')](function(_0xd0d68){if(_0xd0d68){_0x4bad69[_0xf9e0('0x37')]=_[_0xf9e0('0x39')](db[_0xf9e0('0x59')][_0xf9e0('0x34')]);_0x4bad69[_0xf9e0('0x38')]=_[_0xf9e0('0x39')](_0x3e1816[_0xf9e0('0x38')]);_0x4bad69[_0xf9e0('0x43')]=_[_0xf9e0('0x3a')](_0x4bad69[_0xf9e0('0x37')],_0x4bad69[_0xf9e0('0x38')]);_0x3cd3c4[_0xf9e0('0x3b')]=_[_0xf9e0('0x3a')](_0x4bad69[_0xf9e0('0x37')],qs[_0xf9e0('0x3c')](_0x3e1816['query'][_0xf9e0('0x3c')]));_0x3cd3c4[_0xf9e0('0x3b')]=_0x3cd3c4['attributes'][_0xf9e0('0x3d')]?_0x3cd3c4['attributes']:_0x4bad69[_0xf9e0('0x37')];if(!_0x3e1816['query'][_0xf9e0('0x5a')](_0xf9e0('0x3e'))){_0x3cd3c4[_0xf9e0('0x3f')]=qs[_0xf9e0('0x3f')](_0x3e1816[_0xf9e0('0x38')][_0xf9e0('0x3f')]);_0x3cd3c4[_0xf9e0('0x25')]=qs[_0xf9e0('0x25')](_0x3e1816[_0xf9e0('0x38')][_0xf9e0('0x25')]);}_0x3cd3c4[_0xf9e0('0x40')]=qs[_0xf9e0('0x41')](_0x3e1816[_0xf9e0('0x38')][_0xf9e0('0x41')]);_0x3cd3c4[_0xf9e0('0x42')]=qs[_0xf9e0('0x43')](_[_0xf9e0('0x44')](_0x3e1816[_0xf9e0('0x38')],_0x4bad69[_0xf9e0('0x43')]));_0x3cd3c4[_0xf9e0('0x42')][_0xf9e0('0x57')]=_0xd0d68['id'];if(_0x3e1816['query'][_0xf9e0('0x45')]){_0x3cd3c4[_0xf9e0('0x42')]=_['merge'](_0x3cd3c4[_0xf9e0('0x42')],{'$or':_[_0xf9e0('0x33')](_0x3cd3c4[_0xf9e0('0x3b')],function(_0x5c17fd){var _0x41a13a={};_0x41a13a[_0x5c17fd]={'$like':'%'+_0x3e1816[_0xf9e0('0x38')][_0xf9e0('0x45')]+'%'};return _0x41a13a;})});}_0x3cd3c4=_[_0xf9e0('0x46')]({},_0x3cd3c4,_0x3e1816[_0xf9e0('0x48')]);return db[_0xf9e0('0x59')][_0xf9e0('0x24')]({'where':_0x3cd3c4[_0xf9e0('0x42')]})[_0xf9e0('0x14')](function(_0x7be67c){_0x591f25[_0xf9e0('0x24')]=_0x7be67c;if(_0x3e1816[_0xf9e0('0x38')][_0xf9e0('0x49')]){_0x3cd3c4[_0xf9e0('0x4e')]=[{'all':!![]}];}return db['Disposition'][_0xf9e0('0x5b')](_0x3cd3c4);})[_0xf9e0('0x14')](function(_0x58322e){_0x591f25[_0xf9e0('0x4a')]=_0x58322e;return _0x591f25;});}})[_0xf9e0('0x14')](respondWithFilteredResult(_0x248367,_0x3cd3c4))[_0xf9e0('0x1f')](handleError(_0x248367,null));};exports[_0xf9e0('0x5c')]=function(_0x41cae9,_0x1f0e18){return db[_0xf9e0('0x4f')]['find']({'where':{'id':_0x41cae9['params']['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x1f0e18,null))[_0xf9e0('0x14')](function(_0x52cd9e){if(_0x52cd9e){return _0x52cd9e[_0xf9e0('0x5c')](_0x41cae9[_0xf9e0('0x38')][_0xf9e0('0x5d')]);}})[_0xf9e0('0x14')](respondWithStatusCode(_0x1f0e18,null))['catch'](handleError(_0x1f0e18,null));};exports['addAnswer']=function(_0x294712,_0x340e4e){if(_0x294712[_0xf9e0('0x51')]['id']){delete _0x294712['body']['id'];}return db[_0xf9e0('0x4f')][_0xf9e0('0x50')]({'where':{'id':_0x294712[_0xf9e0('0x4c')]['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x340e4e,null))[_0xf9e0('0x14')](function(_0x3a31fd){if(_0x3a31fd){_0x294712['body']['MailAccountId']=_0x3a31fd['id'];return db[_0xf9e0('0x5e')][_0xf9e0('0x5f')](_0x294712[_0xf9e0('0x51')]);}})['then'](respondWithResult(_0x340e4e,null))[_0xf9e0('0x1f')](handleError(_0x340e4e,null));};exports[_0xf9e0('0x60')]=function(_0x3068c7,_0x5c9bf0){var _0x3cfc5a={'raw':![],'where':{}};var _0x316a10={};var _0x4fff1f={'count':0x0,'rows':[]};return db[_0xf9e0('0x4f')][_0xf9e0('0x58')]({'where':{'id':_0x3068c7[_0xf9e0('0x4c')]['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x5c9bf0,null))['then'](function(_0x1576ca){if(_0x1576ca){_0x316a10[_0xf9e0('0x37')]=_[_0xf9e0('0x39')](db[_0xf9e0('0x5e')][_0xf9e0('0x34')]);_0x316a10[_0xf9e0('0x38')]=_[_0xf9e0('0x39')](_0x3068c7[_0xf9e0('0x38')]);_0x316a10[_0xf9e0('0x43')]=_['intersection'](_0x316a10[_0xf9e0('0x37')],_0x316a10[_0xf9e0('0x38')]);_0x3cfc5a[_0xf9e0('0x3b')]=_['intersection'](_0x316a10[_0xf9e0('0x37')],qs['fields'](_0x3068c7['query'][_0xf9e0('0x3c')]));_0x3cfc5a[_0xf9e0('0x3b')]=_0x3cfc5a[_0xf9e0('0x3b')]['length']?_0x3cfc5a[_0xf9e0('0x3b')]:_0x316a10['model'];if(!_0x3068c7[_0xf9e0('0x38')]['hasOwnProperty']('nolimit')){_0x3cfc5a[_0xf9e0('0x3f')]=qs[_0xf9e0('0x3f')](_0x3068c7[_0xf9e0('0x38')]['limit']);_0x3cfc5a[_0xf9e0('0x25')]=qs[_0xf9e0('0x25')](_0x3068c7['query'][_0xf9e0('0x25')]);}_0x3cfc5a[_0xf9e0('0x40')]=qs['sort'](_0x3068c7[_0xf9e0('0x38')][_0xf9e0('0x41')]);_0x3cfc5a['where']=qs[_0xf9e0('0x43')](_[_0xf9e0('0x44')](_0x3068c7[_0xf9e0('0x38')],_0x316a10[_0xf9e0('0x43')]));_0x3cfc5a['where'][_0xf9e0('0x57')]=_0x1576ca['id'];if(_0x3068c7[_0xf9e0('0x38')][_0xf9e0('0x45')]){_0x3cfc5a['where']=_[_0xf9e0('0x46')](_0x3cfc5a['where'],{'$or':_[_0xf9e0('0x33')](_0x3cfc5a['attributes'],function(_0x421b48){var _0x2a269c={};_0x2a269c[_0x421b48]={'$like':'%'+_0x3068c7[_0xf9e0('0x38')][_0xf9e0('0x45')]+'%'};return _0x2a269c;})});}_0x3cfc5a=_['merge']({},_0x3cfc5a,_0x3068c7[_0xf9e0('0x48')]);return db[_0xf9e0('0x5e')][_0xf9e0('0x24')]({'where':_0x3cfc5a[_0xf9e0('0x42')]})[_0xf9e0('0x14')](function(_0x1bfc82){_0x4fff1f[_0xf9e0('0x24')]=_0x1bfc82;if(_0x3068c7['query']['includeAll']){_0x3cfc5a[_0xf9e0('0x4e')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3cfc5a);})['then'](function(_0x31321e){_0x4fff1f[_0xf9e0('0x4a')]=_0x31321e;return _0x4fff1f;});}})[_0xf9e0('0x14')](respondWithFilteredResult(_0x5c9bf0,_0x3cfc5a))[_0xf9e0('0x1f')](handleError(_0x5c9bf0,null));};exports[_0xf9e0('0x61')]=function(_0x2e0fe,_0x502709){return db[_0xf9e0('0x4f')]['find']({'where':{'id':_0x2e0fe[_0xf9e0('0x4c')]['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x502709,null))[_0xf9e0('0x14')](function(_0x5b7485){if(_0x5b7485){return _0x5b7485['removeAnswers'](_0x2e0fe[_0xf9e0('0x38')][_0xf9e0('0x5d')]);}})[_0xf9e0('0x14')](respondWithStatusCode(_0x502709,null))['catch'](handleError(_0x502709,null));};exports['create']=function(_0x488ef3,_0x1ac5c7){var _0x59ad55={'name':_0x488ef3['body'][_0xf9e0('0x2c')],'key':_0x488ef3[_0xf9e0('0x51')]['key'],'provider':_0x488ef3[_0xf9e0('0x51')]['provider']===_0xf9e0('0x62')?null:_0x488ef3[_0xf9e0('0x51')][_0xf9e0('0x63')],'email':_0x488ef3['body'][_0xf9e0('0x64')],'ListId':_0x488ef3[_0xf9e0('0x51')][_0xf9e0('0x65')],'active':!_[_0xf9e0('0x66')](_0x488ef3[_0xf9e0('0x51')][_0xf9e0('0x67')])?_0x488ef3[_0xf9e0('0x51')][_0xf9e0('0x67')]:!![],'description':_0x488ef3[_0xf9e0('0x51')][_0xf9e0('0x68')]||null,'Imap':{},'Smtp':{}};if(_0x59ad55['provider']){_0x59ad55[_0xf9e0('0x2f')][_0xf9e0('0x69')]=_0x59ad55[_0xf9e0('0x31')]['user']=_0x488ef3[_0xf9e0('0x51')]['username'];_0x59ad55[_0xf9e0('0x2f')][_0xf9e0('0x6a')]=_0x59ad55[_0xf9e0('0x31')]['pass']=_0x488ef3[_0xf9e0('0x51')]['password'];if(_0x488ef3[_0xf9e0('0x51')]['modernAuthentication']){_0x59ad55[_0xf9e0('0x2f')][_0xf9e0('0x6b')]=_0x59ad55[_0xf9e0('0x31')]['modernAuthentication']=!![];_0x59ad55[_0xf9e0('0x2f')][_0xf9e0('0x52')]=_0x59ad55['Smtp'][_0xf9e0('0x52')]=_0x488ef3[_0xf9e0('0x51')][_0xf9e0('0x52')];_0x59ad55[_0xf9e0('0x2f')][_0xf9e0('0x6a')]=_0x59ad55[_0xf9e0('0x31')]['pass']=null;}else{_0x59ad55[_0xf9e0('0x2f')]['CloudProviderId']=_0x59ad55[_0xf9e0('0x31')]['CloudProviderId']=null;}_0x59ad55[_0xf9e0('0x2f')][_0xf9e0('0x6c')]=_0x59ad55[_0xf9e0('0x31')]['service']=null;_0x59ad55[_0xf9e0('0x2f')][_0xf9e0('0x6d')]=_0x59ad55['Smtp'][_0xf9e0('0x6d')]=null;_0x59ad55[_0xf9e0('0x2f')]['port']=_0x59ad55[_0xf9e0('0x31')]['port']=null;}else{if(_0x488ef3[_0xf9e0('0x51')][_0xf9e0('0x6e')]){_0x59ad55[_0xf9e0('0x2f')][_0xf9e0('0x69')]=_0x59ad55[_0xf9e0('0x31')]['user']=_0x488ef3[_0xf9e0('0x51')][_0xf9e0('0x6f')];_0x59ad55['Imap'][_0xf9e0('0x6a')]=_0x59ad55['Smtp'][_0xf9e0('0x70')]=_0x488ef3[_0xf9e0('0x51')]['password'];}else{_0x59ad55[_0xf9e0('0x2f')][_0xf9e0('0x6e')]=_0x59ad55[_0xf9e0('0x31')][_0xf9e0('0x6e')]=![];_0x59ad55[_0xf9e0('0x2f')][_0xf9e0('0x69')]=_0x59ad55['Smtp']['user']=null;_0x59ad55['Imap'][_0xf9e0('0x6a')]=_0x59ad55[_0xf9e0('0x31')][_0xf9e0('0x70')]=null;}_0x59ad55['Imap'][_0xf9e0('0x6d')]=_0x488ef3['body'][_0xf9e0('0x2f')][_0xf9e0('0x6d')];_0x59ad55[_0xf9e0('0x2f')][_0xf9e0('0x71')]=_0x488ef3[_0xf9e0('0x51')][_0xf9e0('0x2f')][_0xf9e0('0x71')];_0x59ad55[_0xf9e0('0x31')][_0xf9e0('0x6d')]=_0x488ef3[_0xf9e0('0x51')]['Smtp'][_0xf9e0('0x6d')];_0x59ad55[_0xf9e0('0x31')][_0xf9e0('0x71')]=_0x488ef3[_0xf9e0('0x51')][_0xf9e0('0x31')][_0xf9e0('0x71')];}return db['MailAccount'][_0xf9e0('0x5f')](_0x59ad55,{'include':[{'model':db[_0xf9e0('0x30')],'as':_0xf9e0('0x31')},{'model':db[_0xf9e0('0x4d')],'as':_0xf9e0('0x2f')}]})['then'](function(_0x51256e){var _0x6785a7=_0x488ef3[_0xf9e0('0x69')]['get']({'plain':!![]});if(!_0x6785a7)throw new Error(_0xf9e0('0x72'));if(_0x6785a7['role']===_0xf9e0('0x69')){var _0x1de3b2=_0x51256e[_0xf9e0('0x29')]({'plain':!![]});return db['UserProfileSection'][_0xf9e0('0x50')]({'where':{'name':_0xf9e0('0x73'),'userProfileId':_0x6785a7['userProfileId']},'raw':!![]})[_0xf9e0('0x14')](function(_0x54b196){if(_0x54b196&&_0x54b196[_0xf9e0('0x74')]===0x0){return db[_0xf9e0('0x2a')]['create']({'name':_0x1de3b2[_0xf9e0('0x2c')],'resourceId':_0x1de3b2['id'],'type':_0x54b196[_0xf9e0('0x2c')],'sectionId':_0x54b196['id']},{})[_0xf9e0('0x14')](function(){return _0x51256e;});}else{return _0x51256e;}})['catch'](function(_0x2a4274){logger['error'](_0xf9e0('0x75'),_0x2a4274);throw _0x2a4274;});}return _0x51256e;})[_0xf9e0('0x14')](respondWithResult(_0x1ac5c7,0xc9))[_0xf9e0('0x1f')](handleError(_0x1ac5c7,null));};exports[_0xf9e0('0x76')]=function(_0x4f05e4,_0x500a63){return db[_0xf9e0('0x4f')][_0xf9e0('0x58')]({'where':{'id':_0x4f05e4[_0xf9e0('0x4c')]['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x500a63,null))[_0xf9e0('0x14')](function(_0x53c626){if(_0x53c626){return _0x53c626['getImap']();}return null;})[_0xf9e0('0x14')](respondWithResult(_0x500a63,null))['catch'](handleError(_0x500a63,null));};exports[_0xf9e0('0x77')]=function(_0x4d2bbf,_0x1c4a86){if(_0x4d2bbf['body']['id']){delete _0x4d2bbf['body']['id'];}return db[_0xf9e0('0x4f')][_0xf9e0('0x50')]({'where':{'id':_0x4d2bbf['params']['id']}})['then'](handleEntityNotFound(_0x1c4a86,null))[_0xf9e0('0x14')](function(_0xd0b6f8){if(_0xd0b6f8){_0x4d2bbf[_0xf9e0('0x51')][_0xf9e0('0x57')]=_0xd0b6f8['id'];return db[_0xf9e0('0x4d')][_0xf9e0('0x5f')](_0x4d2bbf[_0xf9e0('0x51')]);}})[_0xf9e0('0x14')](respondWithResult(_0x1c4a86,null))['catch'](handleError(_0x1c4a86,null));};exports[_0xf9e0('0x78')]=function(_0x2ab7c4,_0x1d29d6){return db[_0xf9e0('0x4f')]['findOne']({'where':{'id':_0x2ab7c4['params']['id']}})['then'](handleEntityNotFound(_0x1d29d6,null))[_0xf9e0('0x14')](function(_0x51e693){if(_0x51e693){return _0x51e693[_0xf9e0('0x79')](null);}return null;})[_0xf9e0('0x14')](respondWithStatusCode(_0x1d29d6,null))[_0xf9e0('0x1f')](handleError(_0x1d29d6,null));};exports[_0xf9e0('0x7a')]=function(_0x254cd1,_0x3acd97){return db[_0xf9e0('0x4f')]['findOne']({'where':{'id':_0x254cd1[_0xf9e0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3acd97,null))['then'](function(_0x4109dc){if(_0x4109dc){return _0x4109dc[_0xf9e0('0x7a')]();}return null;})['then'](respondWithResult(_0x3acd97,null))[_0xf9e0('0x1f')](handleError(_0x3acd97,null));};exports[_0xf9e0('0x7b')]=function(_0x45864f,_0x22a32c){if(_0x45864f[_0xf9e0('0x51')]['id']){delete _0x45864f[_0xf9e0('0x51')]['id'];}return db[_0xf9e0('0x4f')][_0xf9e0('0x50')]({'where':{'id':_0x45864f[_0xf9e0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x22a32c,null))[_0xf9e0('0x14')](function(_0x4261db){if(_0x4261db){_0x45864f[_0xf9e0('0x51')]['MailAccountId']=_0x4261db['id'];return db['MailServerOut'][_0xf9e0('0x5f')](_0x45864f[_0xf9e0('0x51')]);}})['then'](respondWithResult(_0x22a32c,null))[_0xf9e0('0x1f')](handleError(_0x22a32c,null));};exports[_0xf9e0('0x7c')]=function(_0x1c2d4b,_0x50a90e){return db[_0xf9e0('0x4f')][_0xf9e0('0x58')]({'where':{'id':_0x1c2d4b[_0xf9e0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x50a90e,null))['then'](function(_0x4907c4){if(_0x4907c4){return _0x4907c4[_0xf9e0('0x7d')](null);}return null;})[_0xf9e0('0x14')](respondWithStatusCode(_0x50a90e,null))['catch'](handleError(_0x50a90e,null));};exports['addInteraction']=function(_0x89076c,_0x253962){return db[_0xf9e0('0x7e')][_0xf9e0('0x50')]({'where':{'id':_0x89076c[_0xf9e0('0x4c')]['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x253962,null))[_0xf9e0('0x14')](function(_0x2df0da){if(_0x2df0da){return _0x2df0da[_0xf9e0('0x7f')](_0x89076c[_0xf9e0('0x51')]['ids'],_['omit'](_0x89076c[_0xf9e0('0x51')],[_0xf9e0('0x5d'),'id'])||{});}})[_0xf9e0('0x14')](respondWithResult(_0x253962,null))[_0xf9e0('0x1f')](handleError(_0x253962,null));};exports[_0xf9e0('0x80')]=function(_0x48cf8e,_0x8e28e){var _0x1c1092={'raw':![],'where':{}};var _0x40eba0={};var _0x4757a4={'count':0x0,'rows':[]};return db[_0xf9e0('0x4f')][_0xf9e0('0x58')]({'where':{'id':_0x48cf8e[_0xf9e0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x8e28e,null))['then'](function(_0x465dc0){if(_0x465dc0){_0x40eba0[_0xf9e0('0x37')]=_[_0xf9e0('0x39')](db[_0xf9e0('0x7e')][_0xf9e0('0x34')]);_0x40eba0[_0xf9e0('0x38')]=_[_0xf9e0('0x39')](_0x48cf8e['query']);_0x40eba0[_0xf9e0('0x43')]=_[_0xf9e0('0x3a')](_0x40eba0[_0xf9e0('0x37')],_0x40eba0[_0xf9e0('0x38')]);_0x1c1092[_0xf9e0('0x3b')]=_[_0xf9e0('0x3a')](_0x40eba0['model'],qs[_0xf9e0('0x3c')](_0x48cf8e[_0xf9e0('0x38')][_0xf9e0('0x3c')]));_0x1c1092[_0xf9e0('0x3b')]=_0x1c1092[_0xf9e0('0x3b')]['length']?_0x1c1092[_0xf9e0('0x3b')]:_0x40eba0[_0xf9e0('0x37')];if(!_0x48cf8e[_0xf9e0('0x38')][_0xf9e0('0x5a')]('nolimit')){_0x1c1092[_0xf9e0('0x3f')]=qs['limit'](_0x48cf8e['query'][_0xf9e0('0x3f')]);_0x1c1092[_0xf9e0('0x25')]=qs[_0xf9e0('0x25')](_0x48cf8e[_0xf9e0('0x38')][_0xf9e0('0x25')]);}_0x1c1092[_0xf9e0('0x40')]=qs[_0xf9e0('0x41')](_0x48cf8e[_0xf9e0('0x38')][_0xf9e0('0x41')]);_0x1c1092['where']=qs[_0xf9e0('0x43')](_[_0xf9e0('0x44')](_0x48cf8e[_0xf9e0('0x38')],_0x40eba0[_0xf9e0('0x43')]));_0x1c1092[_0xf9e0('0x42')][_0xf9e0('0x57')]=_0x465dc0['id'];if(_0x48cf8e[_0xf9e0('0x38')][_0xf9e0('0x45')]){_0x1c1092[_0xf9e0('0x42')]=_['merge'](_0x1c1092[_0xf9e0('0x42')],{'$or':_['map'](_0x1c1092[_0xf9e0('0x3b')],function(_0x39287f){var _0x27eff7={};_0x27eff7[_0x39287f]={'$like':'%'+_0x48cf8e['query'][_0xf9e0('0x45')]+'%'};return _0x27eff7;})});}_0x1c1092=_[_0xf9e0('0x46')]({},_0x1c1092,_0x48cf8e['options']);return db['MailInteraction'][_0xf9e0('0x24')]({'where':_0x1c1092[_0xf9e0('0x42')]})['then'](function(_0x482c5e){_0x4757a4[_0xf9e0('0x24')]=_0x482c5e;if(_0x48cf8e[_0xf9e0('0x38')]['includeAll']){_0x1c1092['include']=[{'model':db[_0xf9e0('0x81')],'as':_0xf9e0('0x82'),'required':![]},{'model':db[_0xf9e0('0x83')],'as':'Owner','attributes':[_0xf9e0('0x2c'),_0xf9e0('0x84'),'internal'],'required':![]},{'model':db[_0xf9e0('0x85')],'as':_0xf9e0('0x86'),'attributes':['id',_0xf9e0('0x2c'),_0xf9e0('0x87')],'where':_0x48cf8e[_0xf9e0('0x38')]['tag']?{'id':_0x48cf8e[_0xf9e0('0x38')]['tag']}:undefined,'required':_0x48cf8e[_0xf9e0('0x38')][_0xf9e0('0x88')]?!![]:![]}];}return db['MailInteraction'][_0xf9e0('0x5b')](_0x1c1092);})[_0xf9e0('0x14')](function(_0x3ec9a1){_0x4757a4[_0xf9e0('0x4a')]=_0x3ec9a1;return _0x4757a4;});}})['then'](respondWithFilteredResult(_0x8e28e,_0x1c1092))[_0xf9e0('0x1f')](handleError(_0x8e28e,null));};exports['addApplications']=function addApplications(_0x1a62e1,_0x1d4e4e){var _0x561b1a=_0x1a62e1[_0xf9e0('0x4c')]['id'];var _0x14bbce=_0x1a62e1[_0xf9e0('0x51')];var _0x4fea4c=0xc8;var _0x227cfe=null;return db['sequelize'][_0xf9e0('0x89')]({'isolationLevel':db[_0xf9e0('0x8a')]['Transaction']['ISOLATION_LEVELS'][_0xf9e0('0x8b')]},function(_0x2f6bc4){return db[_0xf9e0('0x4f')][_0xf9e0('0x58')]({'where':{'id':_0x561b1a},'transaction':_0x2f6bc4})['then'](function(_0x31550f){if(_0x31550f){return db[_0xf9e0('0x8c')][_0xf9e0('0x2b')]({'where':{'MailAccountId':_0x561b1a},'transaction':_0x2f6bc4})['then'](function(){var _0x1347d8=_['map'](_0x14bbce,function(_0x23db8e){_0x23db8e[_0xf9e0('0x57')]=_0x561b1a;return _0x23db8e;});return db['MailApplication']['bulkCreate'](_0x1347d8,{'transaction':_0x2f6bc4});});}else{_0x4fea4c=0x194;_0x227cfe=[];}});})[_0xf9e0('0x14')](function(){if(_0x4fea4c!==0x194){return db[_0xf9e0('0x8c')][_0xf9e0('0x8d')]({'where':{'MailAccountId':_0x561b1a},'order':_0xf9e0('0x8e')})['then'](function(_0x32d9e9){_0x227cfe=_0x32d9e9;});}})[_0xf9e0('0x1f')](function(_0x52b70f){_0x4fea4c=0x1f4;logger[_0xf9e0('0x1b')](_0x52b70f[_0xf9e0('0x8f')]);if(_0x52b70f[_0xf9e0('0x2c')]){delete _0x52b70f[_0xf9e0('0x2c')];}_0x227cfe=_0x52b70f;})['finally'](function(){if(_0x227cfe===null){_0x1d4e4e['sendStatus'](_0x4fea4c);}else{if(_0x4fea4c===0x1f4){_0x1d4e4e[_0xf9e0('0x21')](_0x4fea4c)['send'](_0x227cfe);}else{_0x1d4e4e[_0xf9e0('0x21')](_0x4fea4c)[_0xf9e0('0x28')](_0x227cfe);}}});};exports['getApplications']=function(_0x16bf16,_0x48d04e){var _0x16c910={};var _0x8ece60={};var _0x2068bf;var _0x2453ea;return db[_0xf9e0('0x4f')][_0xf9e0('0x58')]({'where':{'id':_0x16bf16['params']['id']}})['then'](handleEntityNotFound(_0x48d04e,null))['then'](function(_0x56f43a){if(_0x56f43a){_0x2068bf=_0x56f43a;_0x8ece60['model']=_['keys'](db[_0xf9e0('0x8c')][_0xf9e0('0x34')]);_0x8ece60[_0xf9e0('0x38')]=_[_0xf9e0('0x39')](_0x16bf16[_0xf9e0('0x38')]);_0x8ece60[_0xf9e0('0x43')]=_['intersection'](_0x8ece60['model'],_0x8ece60[_0xf9e0('0x38')]);_0x16c910[_0xf9e0('0x3b')]=_[_0xf9e0('0x3a')](_0x8ece60[_0xf9e0('0x37')],qs[_0xf9e0('0x3c')](_0x16bf16[_0xf9e0('0x38')]['fields']));_0x16c910[_0xf9e0('0x3b')]=_0x16c910[_0xf9e0('0x3b')][_0xf9e0('0x3d')]?_0x16c910[_0xf9e0('0x3b')]:_0x8ece60['model'];_0x16c910[_0xf9e0('0x40')]=qs[_0xf9e0('0x41')](_0x16bf16[_0xf9e0('0x38')][_0xf9e0('0x41')]);_0x16c910[_0xf9e0('0x42')]=qs[_0xf9e0('0x43')](_[_0xf9e0('0x44')](_0x16bf16[_0xf9e0('0x38')],_0x8ece60[_0xf9e0('0x43')]));if(_0x16bf16[_0xf9e0('0x38')][_0xf9e0('0x45')]){_0x16c910[_0xf9e0('0x42')]=_[_0xf9e0('0x46')](_0x16c910[_0xf9e0('0x42')],{'$or':_['map'](_0x16c910[_0xf9e0('0x3b')],function(_0x3c45bf){var _0x15a48f={};_0x15a48f[_0x3c45bf]={'$like':'%'+_0x16bf16[_0xf9e0('0x38')]['filter']+'%'};return _0x15a48f;})});}_0x16c910=_['merge']({},_0x16c910,_0x16bf16[_0xf9e0('0x48')]);return _0x2068bf[_0xf9e0('0x90')](_0x16c910);}})['then'](function(_0x55fdbd){if(_0x55fdbd){_0x2453ea=_0x55fdbd[_0xf9e0('0x3d')];if(!_0x16bf16['query'][_0xf9e0('0x5a')](_0xf9e0('0x3e'))){_0x16c910[_0xf9e0('0x3f')]=qs[_0xf9e0('0x3f')](_0x16bf16['query'][_0xf9e0('0x3f')]);_0x16c910['offset']=qs[_0xf9e0('0x25')](_0x16bf16[_0xf9e0('0x38')][_0xf9e0('0x25')]);}return _0x2068bf[_0xf9e0('0x90')](_0x16c910);}})['then'](function(_0x346744){if(_0x346744){return _0x346744?{'count':_0x2453ea,'rows':_0x346744}:null;}})[_0xf9e0('0x14')](respondWithResult(_0x48d04e,null))[_0xf9e0('0x1f')](handleError(_0x48d04e,null));};exports[_0xf9e0('0x91')]=function(_0x2e283a,_0x1252a2){var _0x96a860={'raw':!![],'where':{}};var _0x2b29a6={};var _0x694577={'count':0x0,'rows':[]};return db[_0xf9e0('0x4f')][_0xf9e0('0x58')]({'where':{'id':_0x2e283a[_0xf9e0('0x4c')]['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x1252a2,null))[_0xf9e0('0x14')](function(_0x14feb8){if(_0x14feb8){_0x2b29a6[_0xf9e0('0x37')]=_[_0xf9e0('0x39')](db[_0xf9e0('0x92')][_0xf9e0('0x34')]);_0x2b29a6['query']=_[_0xf9e0('0x39')](_0x2e283a['query']);_0x2b29a6[_0xf9e0('0x43')]=_[_0xf9e0('0x3a')](_0x2b29a6['model'],_0x2b29a6[_0xf9e0('0x38')]);_0x96a860[_0xf9e0('0x3b')]=_[_0xf9e0('0x3a')](_0x2b29a6['model'],qs[_0xf9e0('0x3c')](_0x2e283a[_0xf9e0('0x38')][_0xf9e0('0x3c')]));_0x96a860[_0xf9e0('0x3b')]=_0x96a860[_0xf9e0('0x3b')][_0xf9e0('0x3d')]?_0x96a860[_0xf9e0('0x3b')]:_0x2b29a6[_0xf9e0('0x37')];if(!_0x2e283a[_0xf9e0('0x38')]['hasOwnProperty'](_0xf9e0('0x3e'))){_0x96a860[_0xf9e0('0x3f')]=qs[_0xf9e0('0x3f')](_0x2e283a[_0xf9e0('0x38')][_0xf9e0('0x3f')]);_0x96a860[_0xf9e0('0x25')]=qs['offset'](_0x2e283a[_0xf9e0('0x38')][_0xf9e0('0x25')]);}_0x96a860['order']=qs[_0xf9e0('0x41')](_0x2e283a['query'][_0xf9e0('0x41')]);_0x96a860['where']=qs[_0xf9e0('0x43')](_[_0xf9e0('0x44')](_0x2e283a[_0xf9e0('0x38')],_0x2b29a6[_0xf9e0('0x43')]));_0x96a860['where'][_0xf9e0('0x57')]=_0x14feb8['id'];if(_0x2e283a[_0xf9e0('0x38')][_0xf9e0('0x45')]){_0x96a860[_0xf9e0('0x42')]=_[_0xf9e0('0x46')](_0x96a860['where'],{'$or':_[_0xf9e0('0x33')](_0x96a860[_0xf9e0('0x3b')],function(_0x40f62f){var _0x3f73b2={};_0x3f73b2[_0x40f62f]={'$like':'%'+_0x2e283a[_0xf9e0('0x38')]['filter']+'%'};return _0x3f73b2;})});}if(_0x2e283a['query']['$gte']){var _0x210b5b=_0x2e283a[_0xf9e0('0x38')][_0xf9e0('0x93')]['split'](',');var _0x5345b3={};_0x5345b3[_0x210b5b[0x0]]={'$gte':moment(_0x210b5b[0x1])[_0xf9e0('0x94')](_0xf9e0('0x95'))};_0x96a860[_0xf9e0('0x42')]=_['merge'](_0x96a860[_0xf9e0('0x42')],_0x5345b3);}_0x96a860=_[_0xf9e0('0x46')]({},_0x96a860,_0x2e283a[_0xf9e0('0x48')]);return db['MailMessage'][_0xf9e0('0x24')]({'where':_0x96a860[_0xf9e0('0x42')]})['then'](function(_0x111675){_0x694577[_0xf9e0('0x24')]=_0x111675;if(_0x2e283a[_0xf9e0('0x38')]['includeAll']){_0x96a860[_0xf9e0('0x4e')]=[{'all':!![]}];}return db[_0xf9e0('0x92')][_0xf9e0('0x5b')](_0x96a860);})['then'](function(_0x55a00d){if(_0x2e283a[_0xf9e0('0x38')][_0xf9e0('0x96')]==='true'){for(var _0x46a965=0x0;_0x46a965<_0x55a00d['length'];_0x46a965++){_0x55a00d[_0x46a965][_0xf9e0('0x51')]=juice(_0x55a00d[_0x46a965][_0xf9e0('0x51')]);}}_0x694577[_0xf9e0('0x4a')]=_0x55a00d;return _0x694577;});}})[_0xf9e0('0x14')](respondWithFilteredResult(_0x1252a2,_0x96a860))[_0xf9e0('0x1f')](handleError(_0x1252a2,null));};exports[_0xf9e0('0x2d')]=function(_0x20ba23,_0x7b18c5){var _0x5f542e,_0x572b8e={},_0x40c6f2;if(_0x20ba23[_0xf9e0('0x51')]['to']){_0x40c6f2=_0x20ba23[_0xf9e0('0x51')]['to'][_0xf9e0('0x97')](',')[0x0];}return db['MailAccount'][_0xf9e0('0x50')]({'where':{'id':_0x20ba23[_0xf9e0('0x4c')]['id']},'include':[{'model':db[_0xf9e0('0x98')],'as':'List','include':[{'model':db[_0xf9e0('0x81')],'as':'Contacts','where':{'email':_0x40c6f2},'limit':0x1,'order':[[_0xf9e0('0x99'),_0xf9e0('0x9a')]]}]},{'model':db[_0xf9e0('0x30')],'as':_0xf9e0('0x31'),'raw':!![]}]})['then'](handleEntityNotFound(_0x7b18c5,null))[_0xf9e0('0x14')](function(_0xefd7f6){if(_0xefd7f6){_0x5f542e=_0xefd7f6;if(_0xefd7f6[_0xf9e0('0x31')]){if(_[_0xf9e0('0x66')](_0x20ba23[_0xf9e0('0x51')]['from'])){_0x20ba23[_0xf9e0('0x51')]['from']=util[_0xf9e0('0x94')](_0xf9e0('0x9b'),_0xefd7f6[_0xf9e0('0x2c')],_0xefd7f6[_0xf9e0('0x64')]||_0xefd7f6['Smtp'][_0xf9e0('0x69')]);}if(_0x20ba23[_0xf9e0('0x51')][_0xf9e0('0x9c')]&&_0x20ba23[_0xf9e0('0x51')][_0xf9e0('0x9c')][_0xf9e0('0x3d')]){for(var _0x12d00f=0x0;_0x12d00f<_0x20ba23[_0xf9e0('0x51')][_0xf9e0('0x9c')][_0xf9e0('0x3d')];_0x12d00f+=0x1){_0x20ba23[_0xf9e0('0x51')]['attachments'][_0x12d00f]={'filename':_0x20ba23[_0xf9e0('0x51')]['attachments'][_0x12d00f][_0xf9e0('0x2c')],'path':path[_0xf9e0('0x9d')](config['root'],_0xf9e0('0x9e'),_0x20ba23[_0xf9e0('0x51')][_0xf9e0('0x9c')][_0x12d00f][_0xf9e0('0x9f')])};}}var _0x14b367={'tls':{'rejectUnauthorized':![]}};if(_[_0xf9e0('0x66')](_0xefd7f6['Smtp'][_0xf9e0('0x6c')])){if(_0xefd7f6[_0xf9e0('0x31')][_0xf9e0('0x6e')]){_0x14b367[_0xf9e0('0xa0')]={'user':_0xefd7f6[_0xf9e0('0x31')][_0xf9e0('0x69')],'pass':_0xefd7f6[_0xf9e0('0x31')][_0xf9e0('0x70')]};}_0x14b367[_0xf9e0('0x6d')]=_0xefd7f6[_0xf9e0('0x31')]['host'];_0x14b367[_0xf9e0('0x71')]=_0xefd7f6[_0xf9e0('0x31')][_0xf9e0('0x71')];_0x14b367['secure']=_0xefd7f6['Smtp'][_0xf9e0('0xa1')];}else{_0x14b367[_0xf9e0('0x6c')]=_0xefd7f6[_0xf9e0('0x31')][_0xf9e0('0x6c')];_0x14b367[_0xf9e0('0xa0')]={'user':_0xefd7f6[_0xf9e0('0x31')][_0xf9e0('0x69')],'pass':_0xefd7f6[_0xf9e0('0x31')][_0xf9e0('0x70')]};}return respondWithRpcPromise('SendMail',_0xf9e0('0xa2'),{'account':_0x14b367,'message':_0x20ba23[_0xf9e0('0x51')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x1a8477){if(_0x1a8477){_0x572b8e=_0x1a8477;if(_0x5f542e[_0xf9e0('0xa3')]){if(_0x5f542e[_0xf9e0('0xa3')][_0xf9e0('0xa4')][_0xf9e0('0x3d')]){return _0x5f542e[_0xf9e0('0xa3')][_0xf9e0('0xa4')][0x0];}else{return db[_0xf9e0('0x81')][_0xf9e0('0x5f')](_[_0xf9e0('0xc')](_0x20ba23[_0xf9e0('0x51')],{'firstName':_0x20ba23[_0xf9e0('0x51')]['to'],'email':_0x20ba23['body']['to'],'phone':_0x20ba23[_0xf9e0('0x51')]['to'],'ListId':_0x5f542e[_0xf9e0('0x65')]}));}}else{throw new Error(_0xf9e0('0xa5'));}}})[_0xf9e0('0x14')](function(_0x8c980f){if(_0x8c980f){var _0x564ccf={'UserId':_0x20ba23['user']['id'],'ContactId':_0x8c980f['id'],'MailAccountId':_0x5f542e['id'],'inReplyTo':_0x572b8e[_0xf9e0('0xa6')],'to':_0x20ba23['body']['from'],'cc':_0x20ba23['body']['cc'],'subject':_0x20ba23[_0xf9e0('0x51')][_0xf9e0('0xa7')],'attach':_0x20ba23[_0xf9e0('0x51')][_0xf9e0('0xa8')],'firstMsgDirection':_0xf9e0('0xa9'),'lastMsgAt':moment()[_0xf9e0('0x94')](_0xf9e0('0x95')),'lastMsgDirection':_0xf9e0('0xa9'),'Messages':[_[_0xf9e0('0x46')](_0x20ba23['body'],{'messageId':_0x572b8e['messageId'],'sentAt':moment()[_0xf9e0('0x94')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x5f542e['id'],'UserId':_0x20ba23[_0xf9e0('0x69')]['id'],'ContactId':_0x8c980f['id']})]};if(_0x20ba23[_0xf9e0('0x51')][_0xf9e0('0xaa')]){_0x564ccf=_[_0xf9e0('0x46')](_0x564ccf,_0x20ba23[_0xf9e0('0x51')]['Interaction']);}return db[_0xf9e0('0x7e')][_0xf9e0('0x5f')](_0x564ccf,{'include':[{'model':db[_0xf9e0('0x92')],'as':_0xf9e0('0xab')}]});}})[_0xf9e0('0x14')](respondWithResult(_0x7b18c5,null))[_0xf9e0('0x1f')](handleError(_0x7b18c5,null));};exports[_0xf9e0('0xac')]=function(_0xfc8b38,_0xfffa2a){return db[_0xf9e0('0x4f')][_0xf9e0('0x50')]({'where':{'id':_0xfc8b38[_0xf9e0('0x4c')]['id']},'include':[{'model':db[_0xf9e0('0x30')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf9e0('0xad')],'as':_0xf9e0('0xad'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0xfffa2a,null))[_0xf9e0('0x14')](function(_0xd97ad3){if(!_0xd97ad3['Smtp'])return;var _0x3d678f={'id':_0xd97ad3['id'],'tls':{'rejectUnauthorized':![]}};if(_0xd97ad3[_0xf9e0('0x63')]!==_0xf9e0('0x62')){_0x3d678f[_0xf9e0('0x6c')]=_0xd97ad3[_0xf9e0('0x63')];}else{_0x3d678f['host']=_0xd97ad3['Smtp']['host'];_0x3d678f[_0xf9e0('0x71')]=_0xd97ad3['Smtp'][_0xf9e0('0x71')];_0x3d678f[_0xf9e0('0xa1')]=_0xd97ad3[_0xf9e0('0x31')][_0xf9e0('0xa1')];}if(_0xd97ad3[_0xf9e0('0x31')][_0xf9e0('0x6e')]){if(_0xd97ad3[_0xf9e0('0x31')]['modernAuthentication']){_0x3d678f[_0xf9e0('0xa0')]={'type':'OAuth2','user':_0xd97ad3[_0xf9e0('0x31')][_0xf9e0('0x69')],'accessToken':_0xd97ad3[_0xf9e0('0x31')][_0xf9e0('0xad')]['data5']};}else{_0x3d678f[_0xf9e0('0xa0')]={'user':_0xd97ad3[_0xf9e0('0x31')][_0xf9e0('0x69')],'pass':_0xd97ad3[_0xf9e0('0x31')][_0xf9e0('0x70')]};}}return respondWithRpcPromise(_0xf9e0('0xae'),_0xf9e0('0xac'),{'account':_0x3d678f});})[_0xf9e0('0x14')](respondWithResult(_0xfffa2a,null))['catch'](handleError(_0xfffa2a,null));};exports[_0xf9e0('0x2b')]=function(_0x5559c4,_0x18d519){return db['MailAccount'][_0xf9e0('0x50')]({'where':{'id':_0x5559c4[_0xf9e0('0x4c')]['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x18d519,null))[_0xf9e0('0x14')](function(_0x1ec4f6){if(_0x1ec4f6&&_0x1ec4f6[_0xf9e0('0x6c')]){throw new db['Sequelize'][(_0xf9e0('0xaf'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1ec4f6;})['then'](removeEntity(_0x18d519,null))[_0xf9e0('0x1f')](handleError(_0x18d519,null));};exports[_0xf9e0('0xb0')]=function(_0x5934c6,_0x5ee68a){return db[_0xf9e0('0x4f')][_0xf9e0('0x50')]({'where':{'id':_0x5934c6[_0xf9e0('0x4c')]['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x5ee68a,null))[_0xf9e0('0x14')](function(_0x2269e4){if(_0x2269e4){return _0x2269e4[_0xf9e0('0xb0')](_0x5934c6['body'][_0xf9e0('0x5d')],_[_0xf9e0('0xb1')](_0x5934c6[_0xf9e0('0x51')],[_0xf9e0('0x5d'),'id'])||{})[_0xf9e0('0xb2')](function(_0x38e0f7){for(var _0x331d7d=0x0;_0x331d7d<_0x5934c6[_0xf9e0('0x51')]['ids'][_0xf9e0('0x3d')];_0x331d7d+=0x1){socket['emit'](_0xf9e0('0xb3'),{'UserId':Number(_0x5934c6[_0xf9e0('0x51')][_0xf9e0('0x5d')][_0x331d7d]),'MailAccountId':Number(_0x5934c6[_0xf9e0('0x4c')]['id'])});}return _0x38e0f7;});}})[_0xf9e0('0x14')](respondWithResult(_0x5ee68a,null))[_0xf9e0('0x1f')](handleError(_0x5ee68a,null));};exports[_0xf9e0('0xb4')]=function(_0x45f0f7,_0x29e886){return db[_0xf9e0('0x4f')][_0xf9e0('0x50')]({'where':{'id':_0x45f0f7[_0xf9e0('0x4c')]['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x29e886,null))[_0xf9e0('0x14')](function(_0x427c97){if(_0x427c97){return _0x427c97[_0xf9e0('0xb4')](_0x45f0f7[_0xf9e0('0x38')][_0xf9e0('0x5d')])['then'](function(){if(_[_0xf9e0('0xb5')](_0x45f0f7[_0xf9e0('0x38')]['ids'])){for(var _0x5c1e22=0x0;_0x5c1e22<_0x45f0f7[_0xf9e0('0x38')][_0xf9e0('0x5d')][_0xf9e0('0x3d')];_0x5c1e22+=0x1){socket['emit'](_0xf9e0('0xb6'),{'UserId':Number(_0x45f0f7[_0xf9e0('0x38')][_0xf9e0('0x5d')][_0x5c1e22]),'MailAccountId':Number(_0x45f0f7[_0xf9e0('0x4c')]['id'])});}}else{socket['emit'](_0xf9e0('0xb6'),{'UserId':Number(_0x45f0f7[_0xf9e0('0x38')][_0xf9e0('0x5d')]),'MailAccountId':Number(_0x45f0f7[_0xf9e0('0x4c')]['id'])});}});}})[_0xf9e0('0x14')](respondWithStatusCode(_0x29e886,null))['catch'](handleError(_0x29e886,null));};exports[_0xf9e0('0xb7')]=function(_0x1bfe7e,_0x30efaf){var _0x58a325={};var _0xa9fe44={};var _0x3927db;var _0x3f1aeb;return db[_0xf9e0('0x4f')][_0xf9e0('0x58')]({'where':{'id':_0x1bfe7e[_0xf9e0('0x4c')]['id']}})[_0xf9e0('0x14')](handleEntityNotFound(_0x30efaf,null))['then'](function(_0x2a69d2){if(_0x2a69d2){_0x3927db=_0x2a69d2;_0xa9fe44[_0xf9e0('0x37')]=_['keys'](db['User'][_0xf9e0('0x34')]);_0xa9fe44['query']=_[_0xf9e0('0x39')](_0x1bfe7e['query']);_0xa9fe44['filters']=_[_0xf9e0('0x3a')](_0xa9fe44[_0xf9e0('0x37')],_0xa9fe44[_0xf9e0('0x38')]);_0x58a325[_0xf9e0('0x3b')]=_[_0xf9e0('0x3a')](_0xa9fe44[_0xf9e0('0x37')],qs['fields'](_0x1bfe7e[_0xf9e0('0x38')]['fields']));_0x58a325['attributes']=_0x58a325[_0xf9e0('0x3b')][_0xf9e0('0x3d')]?_0x58a325['attributes']:_0xa9fe44['model'];_0x58a325[_0xf9e0('0x40')]=qs[_0xf9e0('0x41')](_0x1bfe7e[_0xf9e0('0x38')]['sort']);_0x58a325[_0xf9e0('0x42')]=qs[_0xf9e0('0x43')](_[_0xf9e0('0x44')](_0x1bfe7e[_0xf9e0('0x38')],_0xa9fe44[_0xf9e0('0x43')]));if(_0x1bfe7e[_0xf9e0('0x38')][_0xf9e0('0x45')]){_0x58a325['where']=_[_0xf9e0('0x46')](_0x58a325[_0xf9e0('0x42')],{'$or':_[_0xf9e0('0x33')](_0x58a325[_0xf9e0('0x3b')],function(_0x1a359a){var _0xbbf972={};_0xbbf972[_0x1a359a]={'$like':'%'+_0x1bfe7e[_0xf9e0('0x38')][_0xf9e0('0x45')]+'%'};return _0xbbf972;})});}_0x58a325=_[_0xf9e0('0x46')]({},_0x58a325,_0x1bfe7e[_0xf9e0('0x48')]);return _0x3927db[_0xf9e0('0xb7')](_0x58a325);}})[_0xf9e0('0x14')](function(_0x4aa778){if(_0x4aa778){_0x3f1aeb=_0x4aa778['length'];if(!_0x1bfe7e[_0xf9e0('0x38')][_0xf9e0('0x5a')](_0xf9e0('0x3e'))){_0x58a325[_0xf9e0('0x3f')]=qs[_0xf9e0('0x3f')](_0x1bfe7e[_0xf9e0('0x38')][_0xf9e0('0x3f')]);_0x58a325['offset']=qs['offset'](_0x1bfe7e[_0xf9e0('0x38')][_0xf9e0('0x25')]);}return _0x3927db[_0xf9e0('0xb7')](_0x58a325);}})[_0xf9e0('0x14')](function(_0xb6201e){if(_0xb6201e){return _0xb6201e?{'count':_0x3f1aeb,'rows':_0xb6201e}:null;}})[_0xf9e0('0x14')](respondWithResult(_0x30efaf,null))[_0xf9e0('0x1f')](handleError(_0x30efaf,null));}; \ No newline at end of file +var _0x7721=['rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailAccount','includeAll','include','rows','MailServerIn','find','body','modernAuthentication','CloudProviderId','params','describe','addDisposition','getDispositions','MailAccountId','Disposition','findAll','removeDispositions','addAnswer','create','findOne','CannedAnswer','removeAnswers','provider','custom','email','active','description','user','username','password','service','host','port','pass','authentication','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','ids','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','send','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','DESC','isNil','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','secure','SendMail','sendMail','List\x20not\x20found','Contacts','ListId','messageId','subject','out','Interaction','Messages','verifySmtp','CloudProvider','OAuth2','data5','auth','Sequelize','ValidationError','omit','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','path','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailAccount.socket','register','client','http','info','MailAccount,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','get','MailAccounts','sendStatus','stack','name','index','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map'];(function(_0x2b84f9,_0x4123fa){var _0x10ec9f=function(_0x3c1462){while(--_0x3c1462){_0x2b84f9['push'](_0x2b84f9['shift']());}};_0x10ec9f(++_0x4123fa);}(_0x7721,0x1e0));var _0x1772=function(_0x2c8574,_0x2c6cde){_0x2c8574=_0x2c8574-0x0;var _0x4c8129=_0x7721[_0x2c8574];return _0x4c8129;};'use strict';var moment=require(_0x1772('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x1772('0x1'));var _=require(_0x1772('0x2'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x1772('0x3'));var logger=require(_0x1772('0x4'))('api');var config=require(_0x1772('0x5'));var db=require(_0x1772('0x6'))['db'];config['redis']=_[_0x1772('0x7')](config['redis'],{'host':_0x1772('0x8'),'port':0x18eb});var socket=require(_0x1772('0x9'))(new Redis(config[_0x1772('0xa')]));require(_0x1772('0xb'))[_0x1772('0xc')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1772('0xd')][_0x1772('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x27cfbb,_0xb93c5b,_0x859bed,_0x33bee6){return new BPromise(function(_0x1a5ebc,_0x3d7c30){var _0x1f7d2e=_0x33bee6||client;return _0x1f7d2e['request'](_0x27cfbb,_0x859bed)['then'](function(_0x48e26d){logger[_0x1772('0xf')](_0x1772('0x10'),_0xb93c5b,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0xb93c5b,'request\x20sent',JSON[_0x1772('0x11')](_0x48e26d));if(_0x48e26d[_0x1772('0x12')]){if(_0x48e26d['error'][_0x1772('0x13')]===0x1f4){logger['error'](_0x1772('0x10'),_0xb93c5b,_0x48e26d[_0x1772('0x12')][_0x1772('0x14')]);return _0x3d7c30(_0x48e26d['error'][_0x1772('0x14')]);}logger[_0x1772('0x12')](_0x1772('0x10'),_0xb93c5b,_0x48e26d[_0x1772('0x12')][_0x1772('0x14')]);return _0x1a5ebc(_0x48e26d[_0x1772('0x12')]['message']);}else{logger[_0x1772('0xf')](_0x1772('0x10'),_0xb93c5b,_0x1772('0x15'));_0x1a5ebc(_0x48e26d[_0x1772('0x16')]['message']);}})[_0x1772('0x17')](function(_0x5965aa){logger[_0x1772('0x12')](_0x1772('0x10'),_0xb93c5b,_0x5965aa);_0x3d7c30(_0x5965aa);});});}function respondWithStatusCode(_0x1b0692,_0xa1a495){_0xa1a495=_0xa1a495||0xcc;return function(_0x5d436a){if(_0x5d436a){return _0x1b0692['sendStatus'](_0xa1a495);}return _0x1b0692[_0x1772('0x18')](_0xa1a495)[_0x1772('0x19')]();};}function respondWithResult(_0x1db202,_0x393d47){_0x393d47=_0x393d47||0xc8;return function(_0x232a50){if(_0x232a50){return _0x1db202[_0x1772('0x18')](_0x393d47)[_0x1772('0x1a')](_0x232a50);}};}function respondWithFilteredResult(_0xf7b1c9,_0x198587){return function(_0xfc4a12){if(_0xfc4a12){var _0x2f9246=typeof _0x198587[_0x1772('0x1b')]===_0x1772('0x1c')&&typeof _0x198587['limit']===_0x1772('0x1c');var _0x49322f=_0xfc4a12[_0x1772('0x1d')];var _0x24883c=_0x2f9246?0x0:_0x198587[_0x1772('0x1b')];var _0x95428=_0x2f9246?_0xfc4a12['count']:_0x198587['offset']+_0x198587[_0x1772('0x1e')];var _0x59ba8e;if(_0x95428>=_0x49322f){_0x95428=_0x49322f;_0x59ba8e=0xc8;}else{_0x59ba8e=0xce;}_0xf7b1c9[_0x1772('0x18')](_0x59ba8e);return _0xf7b1c9[_0x1772('0x1f')](_0x1772('0x20'),_0x24883c+'-'+_0x95428+'/'+_0x49322f)['json'](_0xfc4a12);}return null;};}function saveUpdates(_0x585421){return function(_0x1817bc){if(_0x1817bc){return _0x1817bc[_0x1772('0x21')](_0x585421)['then'](function(_0xeebb05){return _0xeebb05;});}return null;};}function removeEntity(_0x34496a){return function(_0x53fabe){if(_0x53fabe){return _0x53fabe[_0x1772('0x22')]()[_0x1772('0x23')](function(){var _0x5cbea7=_0x53fabe[_0x1772('0x24')]({'plain':!![]});var _0x471402=_0x1772('0x25');return db['UserProfileResource'][_0x1772('0x22')]({'where':{'type':_0x471402,'resourceId':_0x5cbea7['id']}})[_0x1772('0x23')](function(){return _0x53fabe;});})[_0x1772('0x23')](function(){_0x34496a['status'](0xcc)[_0x1772('0x19')]();});}};}function handleEntityNotFound(_0x5b6e3c){return function(_0x1c6882){if(!_0x1c6882){_0x5b6e3c[_0x1772('0x26')](0x194);}return _0x1c6882;};}function handleError(_0x403fc1,_0x58b2d4){_0x58b2d4=_0x58b2d4||0x1f4;return function(_0x4b86e7){logger['error'](_0x4b86e7[_0x1772('0x27')]);if(_0x4b86e7[_0x1772('0x28')]){delete _0x4b86e7['name'];}_0x403fc1[_0x1772('0x18')](_0x58b2d4)['send'](_0x4b86e7);};}exports[_0x1772('0x29')]=function(_0x52cc6b,_0x4216ec){var _0x219ce9={'include':[{'model':db['MailServerIn'],'as':_0x1772('0x2a')},{'model':db[_0x1772('0x2b')],'as':_0x1772('0x2c')},{'model':db[_0x1772('0x2d')],'as':_0x1772('0x2e')}]},_0x1e3a2e={},_0x41e826={'count':0x0,'rows':[]};var _0x5acbd3=_[_0x1772('0x2f')](db['MailAccount'][_0x1772('0x30')],function(_0x324c5b){return{'name':_0x324c5b['fieldName'],'type':_0x324c5b[_0x1772('0x31')][_0x1772('0x32')]};});_0x1e3a2e[_0x1772('0x33')]=_[_0x1772('0x2f')](_0x5acbd3,'name');_0x1e3a2e['query']=_[_0x1772('0x34')](_0x52cc6b[_0x1772('0x35')]);_0x1e3a2e[_0x1772('0x36')]=_[_0x1772('0x37')](_0x1e3a2e[_0x1772('0x33')],_0x1e3a2e[_0x1772('0x35')]);_0x219ce9[_0x1772('0x38')]=_[_0x1772('0x37')](_0x1e3a2e[_0x1772('0x33')],qs[_0x1772('0x39')](_0x52cc6b[_0x1772('0x35')][_0x1772('0x39')]));_0x219ce9[_0x1772('0x38')]=_0x219ce9['attributes'][_0x1772('0x3a')]?_0x219ce9[_0x1772('0x38')]:_0x1e3a2e[_0x1772('0x33')];if(!_0x52cc6b[_0x1772('0x35')][_0x1772('0x3b')](_0x1772('0x3c'))){_0x219ce9['limit']=qs[_0x1772('0x1e')](_0x52cc6b[_0x1772('0x35')][_0x1772('0x1e')]);_0x219ce9[_0x1772('0x1b')]=qs[_0x1772('0x1b')](_0x52cc6b[_0x1772('0x35')]['offset']);}_0x219ce9[_0x1772('0x3d')]=qs[_0x1772('0x3e')](_0x52cc6b[_0x1772('0x35')]['sort']);_0x219ce9[_0x1772('0x3f')]=qs['filters'](_[_0x1772('0x40')](_0x52cc6b[_0x1772('0x35')],_0x1e3a2e[_0x1772('0x36')]),_0x5acbd3);if(_0x52cc6b[_0x1772('0x35')][_0x1772('0x41')]){_0x219ce9['where']=_[_0x1772('0x42')](_0x219ce9[_0x1772('0x3f')],{'$or':_[_0x1772('0x2f')](_0x5acbd3,function(_0x5a3b68){if(_0x5a3b68[_0x1772('0x31')]!==_0x1772('0x43')){var _0x61dd63={};_0x61dd63[_0x5a3b68[_0x1772('0x28')]]={'$like':'%'+_0x52cc6b['query'][_0x1772('0x41')]+'%'};return _0x61dd63;}})});}_0x219ce9=_[_0x1772('0x42')]({},_0x219ce9,_0x52cc6b[_0x1772('0x44')]);var _0x162a31={'where':_0x219ce9[_0x1772('0x3f')]};return db[_0x1772('0x45')][_0x1772('0x1d')](_0x162a31)[_0x1772('0x23')](function(_0x12db62){_0x41e826['count']=_0x12db62;if(_0x52cc6b['query'][_0x1772('0x46')]){_0x219ce9[_0x1772('0x47')]=[{'all':!![]}];}return db[_0x1772('0x45')]['findAll'](_0x219ce9);})[_0x1772('0x23')](function(_0x2ce79d){_0x41e826[_0x1772('0x48')]=_0x2ce79d;return _0x41e826;})['then'](respondWithFilteredResult(_0x4216ec,_0x219ce9))[_0x1772('0x17')](handleError(_0x4216ec,null));};exports['show']=function(_0x50702f,_0x13383a){var _0x380125={'raw':![],'where':{'id':_0x50702f['params']['id']},'include':[{'model':db[_0x1772('0x49')],'as':_0x1772('0x2a')},{'model':db[_0x1772('0x2b')],'as':_0x1772('0x2c')},{'model':db[_0x1772('0x2d')],'as':'mandatoryDispositionPause'}]},_0x298fb4={};_0x298fb4[_0x1772('0x33')]=_[_0x1772('0x34')](db[_0x1772('0x45')][_0x1772('0x30')]);_0x298fb4[_0x1772('0x35')]=_[_0x1772('0x34')](_0x50702f['query']);_0x298fb4[_0x1772('0x36')]=_[_0x1772('0x37')](_0x298fb4['model'],_0x298fb4['query']);_0x380125[_0x1772('0x38')]=_['intersection'](_0x298fb4['model'],qs[_0x1772('0x39')](_0x50702f[_0x1772('0x35')][_0x1772('0x39')]));_0x380125['attributes']=_0x380125[_0x1772('0x38')][_0x1772('0x3a')]?_0x380125[_0x1772('0x38')]:_0x298fb4['model'];if(_0x50702f[_0x1772('0x35')][_0x1772('0x46')]){_0x380125['include']=[{'all':!![]}];}_0x380125=_[_0x1772('0x42')]({},_0x380125,_0x50702f[_0x1772('0x44')]);return db[_0x1772('0x45')][_0x1772('0x4a')](_0x380125)['then'](handleEntityNotFound(_0x13383a,null))[_0x1772('0x23')](respondWithResult(_0x13383a,null))[_0x1772('0x17')](handleError(_0x13383a,null));};exports['update']=function(_0x8812f4,_0x51834f){if(_0x8812f4[_0x1772('0x4b')]['id']){delete _0x8812f4[_0x1772('0x4b')]['id'];}if(_0x8812f4[_0x1772('0x4b')]['Imap']){if(!_0x8812f4[_0x1772('0x4b')][_0x1772('0x2a')][_0x1772('0x4c')]){_0x8812f4[_0x1772('0x4b')][_0x1772('0x2a')]['CloudProviderId']=null;}}if(_0x8812f4['body'][_0x1772('0x2c')]){if(!_0x8812f4[_0x1772('0x4b')][_0x1772('0x2c')][_0x1772('0x4c')]){_0x8812f4[_0x1772('0x4b')][_0x1772('0x2c')][_0x1772('0x4d')]=null;}}return db[_0x1772('0x45')][_0x1772('0x4a')]({'where':{'id':_0x8812f4[_0x1772('0x4e')]['id']},'include':[{'model':db[_0x1772('0x49')],'as':_0x1772('0x2a')},{'model':db['MailServerOut'],'as':_0x1772('0x2c')},{'model':db[_0x1772('0x2d')],'as':_0x1772('0x2e')}]})[_0x1772('0x23')](handleEntityNotFound(_0x51834f,null))[_0x1772('0x23')](saveUpdates(_0x8812f4[_0x1772('0x4b')],null))[_0x1772('0x23')](function(_0x24e0b1){if(_0x24e0b1&&_0x8812f4[_0x1772('0x4b')][_0x1772('0x2a')]){return db['MailServerIn'][_0x1772('0x21')](_0x8812f4[_0x1772('0x4b')]['Imap'],{'where':{'MailAccountId':_0x24e0b1['id']}})[_0x1772('0x23')](function(){return _0x24e0b1;});}return _0x24e0b1;})[_0x1772('0x23')](function(_0x3d5f69){if(_0x3d5f69&&_0x8812f4['body'][_0x1772('0x2c')]){return db[_0x1772('0x2b')][_0x1772('0x21')](_0x8812f4[_0x1772('0x4b')][_0x1772('0x2c')],{'where':{'MailAccountId':_0x3d5f69['id']}})[_0x1772('0x23')](function(){return _0x3d5f69;});}return _0x3d5f69;})[_0x1772('0x23')](respondWithResult(_0x51834f,null))[_0x1772('0x17')](handleError(_0x51834f,null));};exports[_0x1772('0x4f')]=function(_0x363b27,_0x28b587){return db['MailAccount'][_0x1772('0x4f')]()[_0x1772('0x23')](respondWithResult(_0x28b587,null))[_0x1772('0x17')](handleError(_0x28b587,null));};exports[_0x1772('0x50')]=function(_0xd848a0,_0x17fe05){if(_0xd848a0[_0x1772('0x4b')]['id']){delete _0xd848a0['body']['id'];}return db['MailAccount'][_0x1772('0x4a')]({'where':{'id':_0xd848a0[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x17fe05,null))['then'](function(_0x1fb780){if(_0x1fb780){_0xd848a0[_0x1772('0x4b')]['MailAccountId']=_0x1fb780['id'];return db['Disposition']['create'](_0xd848a0[_0x1772('0x4b')]);}})['then'](respondWithResult(_0x17fe05,null))[_0x1772('0x17')](handleError(_0x17fe05,null));};exports[_0x1772('0x51')]=function(_0x9b429d,_0x104cc7){var _0x470b80={'raw':![],'where':{}};var _0x1df59b={};var _0x3ae819={'count':0x0,'rows':[]};return db[_0x1772('0x45')]['findOne']({'where':{'id':_0x9b429d['params']['id']}})['then'](handleEntityNotFound(_0x104cc7,null))[_0x1772('0x23')](function(_0x3a83e7){if(_0x3a83e7){_0x1df59b[_0x1772('0x33')]=_[_0x1772('0x34')](db['Disposition']['rawAttributes']);_0x1df59b[_0x1772('0x35')]=_[_0x1772('0x34')](_0x9b429d[_0x1772('0x35')]);_0x1df59b[_0x1772('0x36')]=_[_0x1772('0x37')](_0x1df59b[_0x1772('0x33')],_0x1df59b['query']);_0x470b80[_0x1772('0x38')]=_[_0x1772('0x37')](_0x1df59b['model'],qs[_0x1772('0x39')](_0x9b429d['query'][_0x1772('0x39')]));_0x470b80[_0x1772('0x38')]=_0x470b80['attributes'][_0x1772('0x3a')]?_0x470b80['attributes']:_0x1df59b[_0x1772('0x33')];if(!_0x9b429d[_0x1772('0x35')][_0x1772('0x3b')](_0x1772('0x3c'))){_0x470b80[_0x1772('0x1e')]=qs[_0x1772('0x1e')](_0x9b429d[_0x1772('0x35')][_0x1772('0x1e')]);_0x470b80[_0x1772('0x1b')]=qs[_0x1772('0x1b')](_0x9b429d[_0x1772('0x35')][_0x1772('0x1b')]);}_0x470b80[_0x1772('0x3d')]=qs['sort'](_0x9b429d[_0x1772('0x35')]['sort']);_0x470b80['where']=qs[_0x1772('0x36')](_[_0x1772('0x40')](_0x9b429d['query'],_0x1df59b[_0x1772('0x36')]));_0x470b80[_0x1772('0x3f')][_0x1772('0x52')]=_0x3a83e7['id'];if(_0x9b429d['query'][_0x1772('0x41')]){_0x470b80[_0x1772('0x3f')]=_[_0x1772('0x42')](_0x470b80[_0x1772('0x3f')],{'$or':_['map'](_0x470b80[_0x1772('0x38')],function(_0x2e8571){var _0x556654={};_0x556654[_0x2e8571]={'$like':'%'+_0x9b429d['query'][_0x1772('0x41')]+'%'};return _0x556654;})});}_0x470b80=_[_0x1772('0x42')]({},_0x470b80,_0x9b429d[_0x1772('0x44')]);return db[_0x1772('0x53')][_0x1772('0x1d')]({'where':_0x470b80[_0x1772('0x3f')]})['then'](function(_0x39add4){_0x3ae819[_0x1772('0x1d')]=_0x39add4;if(_0x9b429d['query'][_0x1772('0x46')]){_0x470b80[_0x1772('0x47')]=[{'all':!![]}];}return db[_0x1772('0x53')][_0x1772('0x54')](_0x470b80);})['then'](function(_0x4cc70b){_0x3ae819['rows']=_0x4cc70b;return _0x3ae819;});}})['then'](respondWithFilteredResult(_0x104cc7,_0x470b80))[_0x1772('0x17')](handleError(_0x104cc7,null));};exports[_0x1772('0x55')]=function(_0x1c51aa,_0x988263){return db[_0x1772('0x45')]['find']({'where':{'id':_0x1c51aa[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x988263,null))['then'](function(_0xd4cece){if(_0xd4cece){return _0xd4cece[_0x1772('0x55')](_0x1c51aa[_0x1772('0x35')]['ids']);}})[_0x1772('0x23')](respondWithStatusCode(_0x988263,null))[_0x1772('0x17')](handleError(_0x988263,null));};exports[_0x1772('0x56')]=function(_0x261c38,_0x5caaa4){if(_0x261c38[_0x1772('0x4b')]['id']){delete _0x261c38[_0x1772('0x4b')]['id'];}return db[_0x1772('0x45')][_0x1772('0x4a')]({'where':{'id':_0x261c38['params']['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x5caaa4,null))[_0x1772('0x23')](function(_0x227d9f){if(_0x227d9f){_0x261c38[_0x1772('0x4b')][_0x1772('0x52')]=_0x227d9f['id'];return db['CannedAnswer'][_0x1772('0x57')](_0x261c38[_0x1772('0x4b')]);}})[_0x1772('0x23')](respondWithResult(_0x5caaa4,null))[_0x1772('0x17')](handleError(_0x5caaa4,null));};exports['getAnswers']=function(_0x231c90,_0x3b0ae9){var _0x15e2ce={'raw':![],'where':{}};var _0x345f78={};var _0x82710={'count':0x0,'rows':[]};return db['MailAccount'][_0x1772('0x58')]({'where':{'id':_0x231c90[_0x1772('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3b0ae9,null))['then'](function(_0x3bbfeb){if(_0x3bbfeb){_0x345f78[_0x1772('0x33')]=_[_0x1772('0x34')](db[_0x1772('0x59')][_0x1772('0x30')]);_0x345f78[_0x1772('0x35')]=_[_0x1772('0x34')](_0x231c90[_0x1772('0x35')]);_0x345f78['filters']=_[_0x1772('0x37')](_0x345f78[_0x1772('0x33')],_0x345f78[_0x1772('0x35')]);_0x15e2ce[_0x1772('0x38')]=_['intersection'](_0x345f78[_0x1772('0x33')],qs[_0x1772('0x39')](_0x231c90['query'][_0x1772('0x39')]));_0x15e2ce[_0x1772('0x38')]=_0x15e2ce[_0x1772('0x38')][_0x1772('0x3a')]?_0x15e2ce[_0x1772('0x38')]:_0x345f78['model'];if(!_0x231c90['query'][_0x1772('0x3b')](_0x1772('0x3c'))){_0x15e2ce[_0x1772('0x1e')]=qs[_0x1772('0x1e')](_0x231c90[_0x1772('0x35')][_0x1772('0x1e')]);_0x15e2ce[_0x1772('0x1b')]=qs[_0x1772('0x1b')](_0x231c90[_0x1772('0x35')]['offset']);}_0x15e2ce[_0x1772('0x3d')]=qs[_0x1772('0x3e')](_0x231c90[_0x1772('0x35')][_0x1772('0x3e')]);_0x15e2ce[_0x1772('0x3f')]=qs[_0x1772('0x36')](_['pick'](_0x231c90['query'],_0x345f78[_0x1772('0x36')]));_0x15e2ce['where'][_0x1772('0x52')]=_0x3bbfeb['id'];if(_0x231c90['query']['filter']){_0x15e2ce['where']=_[_0x1772('0x42')](_0x15e2ce[_0x1772('0x3f')],{'$or':_[_0x1772('0x2f')](_0x15e2ce['attributes'],function(_0x3f93d2){var _0x27bc38={};_0x27bc38[_0x3f93d2]={'$like':'%'+_0x231c90[_0x1772('0x35')][_0x1772('0x41')]+'%'};return _0x27bc38;})});}_0x15e2ce=_['merge']({},_0x15e2ce,_0x231c90[_0x1772('0x44')]);return db['CannedAnswer'][_0x1772('0x1d')]({'where':_0x15e2ce['where']})[_0x1772('0x23')](function(_0x53294f){_0x82710[_0x1772('0x1d')]=_0x53294f;if(_0x231c90[_0x1772('0x35')][_0x1772('0x46')]){_0x15e2ce[_0x1772('0x47')]=[{'all':!![]}];}return db[_0x1772('0x59')][_0x1772('0x54')](_0x15e2ce);})['then'](function(_0x53fb0d){_0x82710[_0x1772('0x48')]=_0x53fb0d;return _0x82710;});}})['then'](respondWithFilteredResult(_0x3b0ae9,_0x15e2ce))[_0x1772('0x17')](handleError(_0x3b0ae9,null));};exports[_0x1772('0x5a')]=function(_0x5178ac,_0xe16d05){return db[_0x1772('0x45')][_0x1772('0x4a')]({'where':{'id':_0x5178ac[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0xe16d05,null))[_0x1772('0x23')](function(_0x44f200){if(_0x44f200){return _0x44f200[_0x1772('0x5a')](_0x5178ac['query']['ids']);}})[_0x1772('0x23')](respondWithStatusCode(_0xe16d05,null))[_0x1772('0x17')](handleError(_0xe16d05,null));};exports[_0x1772('0x57')]=function(_0x4f3e96,_0x47ca97){var _0x3c96ce={'name':_0x4f3e96[_0x1772('0x4b')][_0x1772('0x28')],'key':_0x4f3e96[_0x1772('0x4b')][_0x1772('0x32')],'provider':_0x4f3e96[_0x1772('0x4b')][_0x1772('0x5b')]===_0x1772('0x5c')?null:_0x4f3e96[_0x1772('0x4b')][_0x1772('0x5b')],'email':_0x4f3e96[_0x1772('0x4b')][_0x1772('0x5d')],'ListId':_0x4f3e96[_0x1772('0x4b')]['ListId'],'active':!_['isNil'](_0x4f3e96[_0x1772('0x4b')]['active'])?_0x4f3e96['body'][_0x1772('0x5e')]:!![],'description':_0x4f3e96['body'][_0x1772('0x5f')]||null,'Imap':{},'Smtp':{}};if(_0x3c96ce[_0x1772('0x5b')]){_0x3c96ce['Imap'][_0x1772('0x60')]=_0x3c96ce['Smtp'][_0x1772('0x60')]=_0x4f3e96[_0x1772('0x4b')][_0x1772('0x61')];_0x3c96ce[_0x1772('0x2a')][_0x1772('0x62')]=_0x3c96ce[_0x1772('0x2c')]['pass']=_0x4f3e96[_0x1772('0x4b')][_0x1772('0x62')];if(_0x4f3e96[_0x1772('0x4b')][_0x1772('0x4c')]){_0x3c96ce[_0x1772('0x2a')]['modernAuthentication']=_0x3c96ce[_0x1772('0x2c')][_0x1772('0x4c')]=!![];_0x3c96ce[_0x1772('0x2a')][_0x1772('0x4d')]=_0x3c96ce[_0x1772('0x2c')]['CloudProviderId']=_0x4f3e96[_0x1772('0x4b')][_0x1772('0x4d')];_0x3c96ce[_0x1772('0x2a')]['password']=_0x3c96ce[_0x1772('0x2c')]['pass']=null;}else{_0x3c96ce['Imap'][_0x1772('0x4d')]=_0x3c96ce[_0x1772('0x2c')]['CloudProviderId']=null;}_0x3c96ce['Imap']['service']=_0x3c96ce['Smtp'][_0x1772('0x63')]=null;_0x3c96ce[_0x1772('0x2a')][_0x1772('0x64')]=_0x3c96ce['Smtp'][_0x1772('0x64')]=null;_0x3c96ce[_0x1772('0x2a')][_0x1772('0x65')]=_0x3c96ce[_0x1772('0x2c')][_0x1772('0x65')]=null;}else{if(_0x4f3e96[_0x1772('0x4b')]['authentication']){_0x3c96ce[_0x1772('0x2a')][_0x1772('0x60')]=_0x3c96ce['Smtp'][_0x1772('0x60')]=_0x4f3e96[_0x1772('0x4b')][_0x1772('0x61')];_0x3c96ce[_0x1772('0x2a')][_0x1772('0x62')]=_0x3c96ce[_0x1772('0x2c')][_0x1772('0x66')]=_0x4f3e96[_0x1772('0x4b')][_0x1772('0x62')];}else{_0x3c96ce['Imap'][_0x1772('0x67')]=_0x3c96ce['Smtp']['authentication']=![];_0x3c96ce[_0x1772('0x2a')][_0x1772('0x60')]=_0x3c96ce[_0x1772('0x2c')]['user']=null;_0x3c96ce['Imap'][_0x1772('0x62')]=_0x3c96ce[_0x1772('0x2c')][_0x1772('0x66')]=null;}_0x3c96ce[_0x1772('0x2a')][_0x1772('0x64')]=_0x4f3e96['body'][_0x1772('0x2a')][_0x1772('0x64')];_0x3c96ce['Imap'][_0x1772('0x65')]=_0x4f3e96['body']['Imap'][_0x1772('0x65')];_0x3c96ce[_0x1772('0x2c')][_0x1772('0x64')]=_0x4f3e96['body']['Smtp'][_0x1772('0x64')];_0x3c96ce[_0x1772('0x2c')][_0x1772('0x65')]=_0x4f3e96[_0x1772('0x4b')]['Smtp'][_0x1772('0x65')];}return db[_0x1772('0x45')][_0x1772('0x57')](_0x3c96ce,{'include':[{'model':db[_0x1772('0x2b')],'as':_0x1772('0x2c')},{'model':db['MailServerIn'],'as':_0x1772('0x2a')}]})['then'](function(_0x164437){var _0x276fc5=_0x4f3e96[_0x1772('0x60')][_0x1772('0x24')]({'plain':!![]});if(!_0x276fc5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x276fc5[_0x1772('0x68')]==='user'){var _0x3debb8=_0x164437[_0x1772('0x24')]({'plain':!![]});return db[_0x1772('0x69')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x276fc5['userProfileId']},'raw':!![]})[_0x1772('0x23')](function(_0x358991){if(_0x358991&&_0x358991['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3debb8['name'],'resourceId':_0x3debb8['id'],'type':_0x358991['name'],'sectionId':_0x358991['id']},{})[_0x1772('0x23')](function(){return _0x164437;});}else{return _0x164437;}})['catch'](function(_0x574c80){logger[_0x1772('0x12')](_0x1772('0x6a'),_0x574c80);throw _0x574c80;});}return _0x164437;})[_0x1772('0x23')](respondWithResult(_0x47ca97,0xc9))['catch'](handleError(_0x47ca97,null));};exports[_0x1772('0x6b')]=function(_0x112fb7,_0x5785ae){return db[_0x1772('0x45')][_0x1772('0x58')]({'where':{'id':_0x112fb7[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x5785ae,null))[_0x1772('0x23')](function(_0x29bb66){if(_0x29bb66){return _0x29bb66[_0x1772('0x6b')]();}return null;})[_0x1772('0x23')](respondWithResult(_0x5785ae,null))['catch'](handleError(_0x5785ae,null));};exports[_0x1772('0x6c')]=function(_0x35168c,_0x4b2c70){if(_0x35168c[_0x1772('0x4b')]['id']){delete _0x35168c['body']['id'];}return db[_0x1772('0x45')][_0x1772('0x4a')]({'where':{'id':_0x35168c['params']['id']}})['then'](handleEntityNotFound(_0x4b2c70,null))['then'](function(_0x2a4528){if(_0x2a4528){_0x35168c[_0x1772('0x4b')][_0x1772('0x52')]=_0x2a4528['id'];return db[_0x1772('0x49')][_0x1772('0x57')](_0x35168c[_0x1772('0x4b')]);}})[_0x1772('0x23')](respondWithResult(_0x4b2c70,null))['catch'](handleError(_0x4b2c70,null));};exports[_0x1772('0x6d')]=function(_0x2aca4f,_0x2a13c2){return db[_0x1772('0x45')][_0x1772('0x58')]({'where':{'id':_0x2aca4f[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x2a13c2,null))[_0x1772('0x23')](function(_0x50ddbd){if(_0x50ddbd){return _0x50ddbd['setImap'](null);}return null;})[_0x1772('0x23')](respondWithStatusCode(_0x2a13c2,null))['catch'](handleError(_0x2a13c2,null));};exports['getSmtp']=function(_0x416fc7,_0x27fafc){return db['MailAccount'][_0x1772('0x58')]({'where':{'id':_0x416fc7[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x27fafc,null))[_0x1772('0x23')](function(_0x596d0a){if(_0x596d0a){return _0x596d0a[_0x1772('0x6e')]();}return null;})[_0x1772('0x23')](respondWithResult(_0x27fafc,null))[_0x1772('0x17')](handleError(_0x27fafc,null));};exports[_0x1772('0x6f')]=function(_0x114a96,_0x790db5){if(_0x114a96['body']['id']){delete _0x114a96['body']['id'];}return db[_0x1772('0x45')][_0x1772('0x4a')]({'where':{'id':_0x114a96[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x790db5,null))[_0x1772('0x23')](function(_0x421e35){if(_0x421e35){_0x114a96[_0x1772('0x4b')][_0x1772('0x52')]=_0x421e35['id'];return db[_0x1772('0x2b')][_0x1772('0x57')](_0x114a96[_0x1772('0x4b')]);}})[_0x1772('0x23')](respondWithResult(_0x790db5,null))[_0x1772('0x17')](handleError(_0x790db5,null));};exports[_0x1772('0x70')]=function(_0x639620,_0x4b787d){return db['MailAccount']['findOne']({'where':{'id':_0x639620[_0x1772('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4b787d,null))['then'](function(_0x159380){if(_0x159380){return _0x159380['setSmtp'](null);}return null;})[_0x1772('0x23')](respondWithStatusCode(_0x4b787d,null))['catch'](handleError(_0x4b787d,null));};exports[_0x1772('0x71')]=function(_0x57b413,_0x52993f){return db[_0x1772('0x72')][_0x1772('0x4a')]({'where':{'id':_0x57b413['params']['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x52993f,null))[_0x1772('0x23')](function(_0x50c8cd){if(_0x50c8cd){return _0x50c8cd[_0x1772('0x71')](_0x57b413[_0x1772('0x4b')][_0x1772('0x73')],_['omit'](_0x57b413['body'],[_0x1772('0x73'),'id'])||{});}})[_0x1772('0x23')](respondWithResult(_0x52993f,null))['catch'](handleError(_0x52993f,null));};exports['getInteractions']=function(_0x1debf6,_0x26d2c8){var _0x3c8ca1={'raw':![],'where':{}};var _0x5602ca={};var _0x280eee={'count':0x0,'rows':[]};return db[_0x1772('0x45')][_0x1772('0x58')]({'where':{'id':_0x1debf6[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x26d2c8,null))[_0x1772('0x23')](function(_0x47e7d0){if(_0x47e7d0){_0x5602ca['model']=_['keys'](db[_0x1772('0x72')][_0x1772('0x30')]);_0x5602ca[_0x1772('0x35')]=_[_0x1772('0x34')](_0x1debf6[_0x1772('0x35')]);_0x5602ca[_0x1772('0x36')]=_[_0x1772('0x37')](_0x5602ca[_0x1772('0x33')],_0x5602ca[_0x1772('0x35')]);_0x3c8ca1[_0x1772('0x38')]=_[_0x1772('0x37')](_0x5602ca[_0x1772('0x33')],qs['fields'](_0x1debf6[_0x1772('0x35')][_0x1772('0x39')]));_0x3c8ca1[_0x1772('0x38')]=_0x3c8ca1[_0x1772('0x38')][_0x1772('0x3a')]?_0x3c8ca1[_0x1772('0x38')]:_0x5602ca['model'];if(!_0x1debf6[_0x1772('0x35')][_0x1772('0x3b')](_0x1772('0x3c'))){_0x3c8ca1[_0x1772('0x1e')]=qs[_0x1772('0x1e')](_0x1debf6['query'][_0x1772('0x1e')]);_0x3c8ca1[_0x1772('0x1b')]=qs['offset'](_0x1debf6['query'][_0x1772('0x1b')]);}_0x3c8ca1['order']=qs[_0x1772('0x3e')](_0x1debf6['query'][_0x1772('0x3e')]);_0x3c8ca1['where']=qs[_0x1772('0x36')](_[_0x1772('0x40')](_0x1debf6[_0x1772('0x35')],_0x5602ca[_0x1772('0x36')]));_0x3c8ca1[_0x1772('0x3f')]['MailAccountId']=_0x47e7d0['id'];if(_0x1debf6[_0x1772('0x35')]['filter']){_0x3c8ca1[_0x1772('0x3f')]=_[_0x1772('0x42')](_0x3c8ca1['where'],{'$or':_['map'](_0x3c8ca1[_0x1772('0x38')],function(_0x2f89b2){var _0xbfb393={};_0xbfb393[_0x2f89b2]={'$like':'%'+_0x1debf6[_0x1772('0x35')][_0x1772('0x41')]+'%'};return _0xbfb393;})});}_0x3c8ca1=_['merge']({},_0x3c8ca1,_0x1debf6[_0x1772('0x44')]);return db['MailInteraction'][_0x1772('0x1d')]({'where':_0x3c8ca1['where']})[_0x1772('0x23')](function(_0x1e872f){_0x280eee[_0x1772('0x1d')]=_0x1e872f;if(_0x1debf6[_0x1772('0x35')][_0x1772('0x46')]){_0x3c8ca1[_0x1772('0x47')]=[{'model':db[_0x1772('0x74')],'as':_0x1772('0x75'),'required':![]},{'model':db[_0x1772('0x76')],'as':_0x1772('0x77'),'attributes':[_0x1772('0x28'),_0x1772('0x78'),'internal'],'required':![]},{'model':db[_0x1772('0x79')],'as':_0x1772('0x7a'),'attributes':['id',_0x1772('0x28'),_0x1772('0x7b')],'where':_0x1debf6[_0x1772('0x35')]['tag']?{'id':_0x1debf6[_0x1772('0x35')][_0x1772('0x7c')]}:undefined,'required':_0x1debf6[_0x1772('0x35')][_0x1772('0x7c')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x3c8ca1);})['then'](function(_0x5d65e1){_0x280eee[_0x1772('0x48')]=_0x5d65e1;return _0x280eee;});}})['then'](respondWithFilteredResult(_0x26d2c8,_0x3c8ca1))[_0x1772('0x17')](handleError(_0x26d2c8,null));};exports['addApplications']=function addApplications(_0x66514d,_0x48bea8){var _0x538837=_0x66514d[_0x1772('0x4e')]['id'];var _0x33e720=_0x66514d['body'];var _0x418bab=0xc8;var _0x51dd7a=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x1772('0x7d')]['ISOLATION_LEVELS'][_0x1772('0x7e')]},function(_0x58da19){return db[_0x1772('0x45')][_0x1772('0x58')]({'where':{'id':_0x538837},'transaction':_0x58da19})['then'](function(_0x520541){if(_0x520541){return db[_0x1772('0x7f')][_0x1772('0x22')]({'where':{'MailAccountId':_0x538837},'transaction':_0x58da19})[_0x1772('0x23')](function(){var _0x1dc4c1=_[_0x1772('0x2f')](_0x33e720,function(_0x461adb){_0x461adb[_0x1772('0x52')]=_0x538837;return _0x461adb;});return db[_0x1772('0x7f')][_0x1772('0x80')](_0x1dc4c1,{'transaction':_0x58da19});});}else{_0x418bab=0x194;_0x51dd7a=[];}});})[_0x1772('0x23')](function(){if(_0x418bab!==0x194){return db['MailApplication'][_0x1772('0x81')]({'where':{'MailAccountId':_0x538837},'order':'priority'})[_0x1772('0x23')](function(_0x5572f4){_0x51dd7a=_0x5572f4;});}})[_0x1772('0x17')](function(_0x595051){_0x418bab=0x1f4;logger[_0x1772('0x12')](_0x595051[_0x1772('0x27')]);if(_0x595051['name']){delete _0x595051[_0x1772('0x28')];}_0x51dd7a=_0x595051;})[_0x1772('0x82')](function(){if(_0x51dd7a===null){_0x48bea8['sendStatus'](_0x418bab);}else{if(_0x418bab===0x1f4){_0x48bea8[_0x1772('0x18')](_0x418bab)[_0x1772('0x83')](_0x51dd7a);}else{_0x48bea8['status'](_0x418bab)[_0x1772('0x1a')](_0x51dd7a);}}});};exports[_0x1772('0x84')]=function(_0x1e98f8,_0x14f05b){var _0x2b3efd={};var _0x1f303d={};var _0x4c026b;var _0x9a6d2b;return db['MailAccount'][_0x1772('0x58')]({'where':{'id':_0x1e98f8['params']['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x14f05b,null))[_0x1772('0x23')](function(_0x255f1d){if(_0x255f1d){_0x4c026b=_0x255f1d;_0x1f303d[_0x1772('0x33')]=_[_0x1772('0x34')](db['MailApplication'][_0x1772('0x30')]);_0x1f303d['query']=_[_0x1772('0x34')](_0x1e98f8[_0x1772('0x35')]);_0x1f303d[_0x1772('0x36')]=_[_0x1772('0x37')](_0x1f303d[_0x1772('0x33')],_0x1f303d[_0x1772('0x35')]);_0x2b3efd[_0x1772('0x38')]=_[_0x1772('0x37')](_0x1f303d[_0x1772('0x33')],qs[_0x1772('0x39')](_0x1e98f8[_0x1772('0x35')][_0x1772('0x39')]));_0x2b3efd['attributes']=_0x2b3efd[_0x1772('0x38')]['length']?_0x2b3efd[_0x1772('0x38')]:_0x1f303d['model'];_0x2b3efd[_0x1772('0x3d')]=qs['sort'](_0x1e98f8[_0x1772('0x35')][_0x1772('0x3e')]);_0x2b3efd[_0x1772('0x3f')]=qs['filters'](_['pick'](_0x1e98f8['query'],_0x1f303d['filters']));if(_0x1e98f8[_0x1772('0x35')][_0x1772('0x41')]){_0x2b3efd[_0x1772('0x3f')]=_[_0x1772('0x42')](_0x2b3efd[_0x1772('0x3f')],{'$or':_[_0x1772('0x2f')](_0x2b3efd[_0x1772('0x38')],function(_0x9946d2){var _0xe3511e={};_0xe3511e[_0x9946d2]={'$like':'%'+_0x1e98f8[_0x1772('0x35')]['filter']+'%'};return _0xe3511e;})});}_0x2b3efd=_['merge']({},_0x2b3efd,_0x1e98f8[_0x1772('0x44')]);return _0x4c026b[_0x1772('0x84')](_0x2b3efd);}})[_0x1772('0x23')](function(_0x4809c5){if(_0x4809c5){_0x9a6d2b=_0x4809c5['length'];if(!_0x1e98f8['query']['hasOwnProperty'](_0x1772('0x3c'))){_0x2b3efd['limit']=qs['limit'](_0x1e98f8[_0x1772('0x35')]['limit']);_0x2b3efd['offset']=qs['offset'](_0x1e98f8['query'][_0x1772('0x1b')]);}return _0x4c026b[_0x1772('0x84')](_0x2b3efd);}})[_0x1772('0x23')](function(_0x2cdd5a){if(_0x2cdd5a){return _0x2cdd5a?{'count':_0x9a6d2b,'rows':_0x2cdd5a}:null;}})['then'](respondWithResult(_0x14f05b,null))[_0x1772('0x17')](handleError(_0x14f05b,null));};exports[_0x1772('0x85')]=function(_0x167330,_0xe061db){var _0x5441d4={'raw':!![],'where':{}};var _0x5b7f55={};var _0x3c7e93={'count':0x0,'rows':[]};return db['MailAccount'][_0x1772('0x58')]({'where':{'id':_0x167330[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0xe061db,null))[_0x1772('0x23')](function(_0x30e17c){if(_0x30e17c){_0x5b7f55[_0x1772('0x33')]=_[_0x1772('0x34')](db[_0x1772('0x86')]['rawAttributes']);_0x5b7f55[_0x1772('0x35')]=_[_0x1772('0x34')](_0x167330['query']);_0x5b7f55[_0x1772('0x36')]=_[_0x1772('0x37')](_0x5b7f55['model'],_0x5b7f55[_0x1772('0x35')]);_0x5441d4[_0x1772('0x38')]=_[_0x1772('0x37')](_0x5b7f55['model'],qs[_0x1772('0x39')](_0x167330[_0x1772('0x35')][_0x1772('0x39')]));_0x5441d4[_0x1772('0x38')]=_0x5441d4[_0x1772('0x38')][_0x1772('0x3a')]?_0x5441d4['attributes']:_0x5b7f55[_0x1772('0x33')];if(!_0x167330[_0x1772('0x35')][_0x1772('0x3b')](_0x1772('0x3c'))){_0x5441d4[_0x1772('0x1e')]=qs[_0x1772('0x1e')](_0x167330[_0x1772('0x35')][_0x1772('0x1e')]);_0x5441d4['offset']=qs[_0x1772('0x1b')](_0x167330['query']['offset']);}_0x5441d4['order']=qs[_0x1772('0x3e')](_0x167330['query'][_0x1772('0x3e')]);_0x5441d4[_0x1772('0x3f')]=qs[_0x1772('0x36')](_[_0x1772('0x40')](_0x167330[_0x1772('0x35')],_0x5b7f55[_0x1772('0x36')]));_0x5441d4[_0x1772('0x3f')][_0x1772('0x52')]=_0x30e17c['id'];if(_0x167330[_0x1772('0x35')][_0x1772('0x41')]){_0x5441d4[_0x1772('0x3f')]=_[_0x1772('0x42')](_0x5441d4[_0x1772('0x3f')],{'$or':_[_0x1772('0x2f')](_0x5441d4[_0x1772('0x38')],function(_0x45dd2a){var _0x3b2790={};_0x3b2790[_0x45dd2a]={'$like':'%'+_0x167330[_0x1772('0x35')][_0x1772('0x41')]+'%'};return _0x3b2790;})});}if(_0x167330['query']['$gte']){var _0x22a1bd=_0x167330[_0x1772('0x35')][_0x1772('0x87')][_0x1772('0x88')](',');var _0x3e3edc={};_0x3e3edc[_0x22a1bd[0x0]]={'$gte':moment(_0x22a1bd[0x1])[_0x1772('0x89')](_0x1772('0x8a'))};_0x5441d4[_0x1772('0x3f')]=_[_0x1772('0x42')](_0x5441d4[_0x1772('0x3f')],_0x3e3edc);}_0x5441d4=_[_0x1772('0x42')]({},_0x5441d4,_0x167330[_0x1772('0x44')]);return db[_0x1772('0x86')][_0x1772('0x1d')]({'where':_0x5441d4[_0x1772('0x3f')]})['then'](function(_0xdf23c3){_0x3c7e93[_0x1772('0x1d')]=_0xdf23c3;if(_0x167330[_0x1772('0x35')][_0x1772('0x46')]){_0x5441d4[_0x1772('0x47')]=[{'all':!![]}];}return db['MailMessage'][_0x1772('0x54')](_0x5441d4);})[_0x1772('0x23')](function(_0x42efa4){if(_0x167330[_0x1772('0x35')][_0x1772('0x8b')]==='true'){for(var _0x244e54=0x0;_0x244e54<_0x42efa4[_0x1772('0x3a')];_0x244e54++){_0x42efa4[_0x244e54][_0x1772('0x4b')]=juice(_0x42efa4[_0x244e54][_0x1772('0x4b')]);}}_0x3c7e93[_0x1772('0x48')]=_0x42efa4;return _0x3c7e93;});}})[_0x1772('0x23')](respondWithFilteredResult(_0xe061db,_0x5441d4))[_0x1772('0x17')](handleError(_0xe061db,null));};exports[_0x1772('0x83')]=function(_0x5b0f55,_0x556568){var _0xf215e8,_0x16d0b2={},_0x12ee78;if(_0x5b0f55['body']['to']){_0x12ee78=_0x5b0f55[_0x1772('0x4b')]['to'][_0x1772('0x88')](',')[0x0];}return db[_0x1772('0x45')][_0x1772('0x4a')]({'where':{'id':_0x5b0f55['params']['id']},'include':[{'model':db[_0x1772('0x8c')],'as':_0x1772('0x8d'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x12ee78},'limit':0x1,'order':[['updatedAt',_0x1772('0x8e')]]}]},{'model':db[_0x1772('0x2b')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x556568,null))[_0x1772('0x23')](function(_0x1e01f6){if(_0x1e01f6){_0xf215e8=_0x1e01f6;if(_0x1e01f6[_0x1772('0x2c')]){if(_[_0x1772('0x8f')](_0x5b0f55['body']['from'])){_0x5b0f55[_0x1772('0x4b')][_0x1772('0x90')]=util[_0x1772('0x89')](_0x1772('0x91'),_0x1e01f6[_0x1772('0x28')],_0x1e01f6[_0x1772('0x5d')]||_0x1e01f6[_0x1772('0x2c')][_0x1772('0x60')]);}if(_0x5b0f55['body']['attachments']&&_0x5b0f55[_0x1772('0x4b')][_0x1772('0x92')][_0x1772('0x3a')]){for(var _0x4aabeb=0x0;_0x4aabeb<_0x5b0f55[_0x1772('0x4b')]['attachments'][_0x1772('0x3a')];_0x4aabeb+=0x1){_0x5b0f55[_0x1772('0x4b')][_0x1772('0x92')][_0x4aabeb]={'filename':_0x5b0f55[_0x1772('0x4b')][_0x1772('0x92')][_0x4aabeb]['name'],'path':path[_0x1772('0x93')](config[_0x1772('0x94')],_0x1772('0x95'),_0x5b0f55[_0x1772('0x4b')][_0x1772('0x92')][_0x4aabeb][_0x1772('0x96')])};}}var _0xeafc19={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x1e01f6[_0x1772('0x2c')]['service'])){if(_0x1e01f6[_0x1772('0x2c')]['authentication']){_0xeafc19['auth']={'user':_0x1e01f6[_0x1772('0x2c')][_0x1772('0x60')],'pass':_0x1e01f6[_0x1772('0x2c')]['pass']};}_0xeafc19['host']=_0x1e01f6[_0x1772('0x2c')][_0x1772('0x64')];_0xeafc19[_0x1772('0x65')]=_0x1e01f6[_0x1772('0x2c')][_0x1772('0x65')];_0xeafc19['secure']=_0x1e01f6['Smtp'][_0x1772('0x97')];}else{_0xeafc19[_0x1772('0x63')]=_0x1e01f6[_0x1772('0x2c')][_0x1772('0x63')];_0xeafc19['auth']={'user':_0x1e01f6['Smtp'][_0x1772('0x60')],'pass':_0x1e01f6[_0x1772('0x2c')][_0x1772('0x66')]};}return respondWithRpcPromise(_0x1772('0x98'),_0x1772('0x99'),{'account':_0xeafc19,'message':_0x5b0f55['body']});}else{throw new Error(_0x1772('0x9a'));}}})[_0x1772('0x23')](function(_0x2e793c){if(_0x2e793c){_0x16d0b2=_0x2e793c;if(_0xf215e8[_0x1772('0x8d')]){if(_0xf215e8[_0x1772('0x8d')][_0x1772('0x9b')][_0x1772('0x3a')]){return _0xf215e8[_0x1772('0x8d')][_0x1772('0x9b')][0x0];}else{return db[_0x1772('0x74')]['create'](_[_0x1772('0x7')](_0x5b0f55['body'],{'firstName':_0x5b0f55[_0x1772('0x4b')]['to'],'email':_0x5b0f55[_0x1772('0x4b')]['to'],'phone':_0x5b0f55['body']['to'],'ListId':_0xf215e8[_0x1772('0x9c')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x4f81c0){if(_0x4f81c0){var _0x5d4b54={'UserId':_0x5b0f55['user']['id'],'ContactId':_0x4f81c0['id'],'MailAccountId':_0xf215e8['id'],'inReplyTo':_0x16d0b2[_0x1772('0x9d')],'to':_0x5b0f55[_0x1772('0x4b')][_0x1772('0x90')],'cc':_0x5b0f55[_0x1772('0x4b')]['cc'],'subject':_0x5b0f55[_0x1772('0x4b')][_0x1772('0x9e')],'attach':_0x5b0f55['body']['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0x1772('0x89')](_0x1772('0x8a')),'lastMsgDirection':_0x1772('0x9f'),'Messages':[_['merge'](_0x5b0f55[_0x1772('0x4b')],{'messageId':_0x16d0b2['messageId'],'sentAt':moment()[_0x1772('0x89')](_0x1772('0x8a')),'read':!![],'MailAccountId':_0xf215e8['id'],'UserId':_0x5b0f55[_0x1772('0x60')]['id'],'ContactId':_0x4f81c0['id']})]};if(_0x5b0f55['body'][_0x1772('0xa0')]){_0x5d4b54=_[_0x1772('0x42')](_0x5d4b54,_0x5b0f55[_0x1772('0x4b')]['Interaction']);}return db['MailInteraction']['create'](_0x5d4b54,{'include':[{'model':db[_0x1772('0x86')],'as':_0x1772('0xa1')}]});}})[_0x1772('0x23')](respondWithResult(_0x556568,null))['catch'](handleError(_0x556568,null));};exports[_0x1772('0xa2')]=function(_0x4c0a2f,_0x4829d4){return db['MailAccount']['find']({'where':{'id':_0x4c0a2f[_0x1772('0x4e')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x1772('0x2c'),'raw':!![],'include':[{'model':db[_0x1772('0xa3')],'as':_0x1772('0xa3'),'raw':!![]}]}]})[_0x1772('0x23')](handleEntityNotFound(_0x4829d4,null))[_0x1772('0x23')](function(_0xd8da78){if(!_0xd8da78[_0x1772('0x2c')])return;var _0x20d39c={'id':_0xd8da78['id'],'tls':{'rejectUnauthorized':![]}};if(_0xd8da78['provider']!==_0x1772('0x5c')){_0x20d39c[_0x1772('0x63')]=_0xd8da78[_0x1772('0x5b')];}else{_0x20d39c[_0x1772('0x64')]=_0xd8da78[_0x1772('0x2c')][_0x1772('0x64')];_0x20d39c[_0x1772('0x65')]=_0xd8da78['Smtp'][_0x1772('0x65')];_0x20d39c['secure']=_0xd8da78[_0x1772('0x2c')]['secure'];}if(_0xd8da78[_0x1772('0x2c')][_0x1772('0x67')]){if(_0xd8da78[_0x1772('0x2c')][_0x1772('0x4c')]){_0x20d39c['auth']={'type':_0x1772('0xa4'),'user':_0xd8da78[_0x1772('0x2c')]['user'],'accessToken':_0xd8da78[_0x1772('0x2c')]['CloudProvider'][_0x1772('0xa5')]};}else{_0x20d39c[_0x1772('0xa6')]={'user':_0xd8da78['Smtp'][_0x1772('0x60')],'pass':_0xd8da78[_0x1772('0x2c')]['pass']};}}return respondWithRpcPromise('VerifySmtp',_0x1772('0xa2'),{'account':_0x20d39c});})[_0x1772('0x23')](respondWithResult(_0x4829d4,null))[_0x1772('0x17')](handleError(_0x4829d4,null));};exports[_0x1772('0x22')]=function(_0x5ebb35,_0xc3c06b){return db[_0x1772('0x45')][_0x1772('0x4a')]({'where':{'id':_0x5ebb35[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0xc3c06b,null))['then'](function(_0x27d78a){if(_0x27d78a&&_0x27d78a[_0x1772('0x63')]){throw new db[(_0x1772('0xa7'))][(_0x1772('0xa8'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x27d78a;})[_0x1772('0x23')](removeEntity(_0xc3c06b,null))[_0x1772('0x17')](handleError(_0xc3c06b,null));};exports['addAgents']=function(_0x3bfc51,_0x99797){return db['MailAccount'][_0x1772('0x4a')]({'where':{'id':_0x3bfc51[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x99797,null))[_0x1772('0x23')](function(_0xe68ebb){if(_0xe68ebb){return _0xe68ebb['addAgents'](_0x3bfc51[_0x1772('0x4b')][_0x1772('0x73')],_[_0x1772('0xa9')](_0x3bfc51['body'],[_0x1772('0x73'),'id'])||{})['spread'](function(_0x2f2aed){for(var _0x43491e=0x0;_0x43491e<_0x3bfc51[_0x1772('0x4b')][_0x1772('0x73')][_0x1772('0x3a')];_0x43491e+=0x1){socket['emit'](_0x1772('0xaa'),{'UserId':Number(_0x3bfc51[_0x1772('0x4b')][_0x1772('0x73')][_0x43491e]),'MailAccountId':Number(_0x3bfc51[_0x1772('0x4e')]['id'])});}return _0x2f2aed;});}})[_0x1772('0x23')](respondWithResult(_0x99797,null))['catch'](handleError(_0x99797,null));};exports[_0x1772('0xab')]=function(_0x1152f1,_0x19b9e1){return db[_0x1772('0x45')][_0x1772('0x4a')]({'where':{'id':_0x1152f1[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x19b9e1,null))['then'](function(_0x4287b7){if(_0x4287b7){return _0x4287b7['removeAgents'](_0x1152f1[_0x1772('0x35')][_0x1772('0x73')])['then'](function(){if(_[_0x1772('0xac')](_0x1152f1['query'][_0x1772('0x73')])){for(var _0x424fb1=0x0;_0x424fb1<_0x1152f1[_0x1772('0x35')][_0x1772('0x73')][_0x1772('0x3a')];_0x424fb1+=0x1){socket[_0x1772('0xad')](_0x1772('0xae'),{'UserId':Number(_0x1152f1[_0x1772('0x35')][_0x1772('0x73')][_0x424fb1]),'MailAccountId':Number(_0x1152f1['params']['id'])});}}else{socket[_0x1772('0xad')](_0x1772('0xae'),{'UserId':Number(_0x1152f1[_0x1772('0x35')][_0x1772('0x73')]),'MailAccountId':Number(_0x1152f1[_0x1772('0x4e')]['id'])});}});}})[_0x1772('0x23')](respondWithStatusCode(_0x19b9e1,null))['catch'](handleError(_0x19b9e1,null));};exports[_0x1772('0xaf')]=function(_0xf53cb5,_0x134cb3){var _0xc382fa={};var _0x217aca={};var _0x8ef265;var _0x46641a;return db['MailAccount'][_0x1772('0x58')]({'where':{'id':_0xf53cb5[_0x1772('0x4e')]['id']}})[_0x1772('0x23')](handleEntityNotFound(_0x134cb3,null))[_0x1772('0x23')](function(_0x1e0f3f){if(_0x1e0f3f){_0x8ef265=_0x1e0f3f;_0x217aca[_0x1772('0x33')]=_[_0x1772('0x34')](db[_0x1772('0x76')][_0x1772('0x30')]);_0x217aca['query']=_[_0x1772('0x34')](_0xf53cb5['query']);_0x217aca[_0x1772('0x36')]=_['intersection'](_0x217aca[_0x1772('0x33')],_0x217aca[_0x1772('0x35')]);_0xc382fa[_0x1772('0x38')]=_[_0x1772('0x37')](_0x217aca[_0x1772('0x33')],qs['fields'](_0xf53cb5['query']['fields']));_0xc382fa['attributes']=_0xc382fa[_0x1772('0x38')][_0x1772('0x3a')]?_0xc382fa[_0x1772('0x38')]:_0x217aca[_0x1772('0x33')];_0xc382fa[_0x1772('0x3d')]=qs[_0x1772('0x3e')](_0xf53cb5['query'][_0x1772('0x3e')]);_0xc382fa[_0x1772('0x3f')]=qs['filters'](_[_0x1772('0x40')](_0xf53cb5[_0x1772('0x35')],_0x217aca[_0x1772('0x36')]));if(_0xf53cb5[_0x1772('0x35')]['filter']){_0xc382fa['where']=_['merge'](_0xc382fa[_0x1772('0x3f')],{'$or':_['map'](_0xc382fa[_0x1772('0x38')],function(_0x282789){var _0x1d4e9={};_0x1d4e9[_0x282789]={'$like':'%'+_0xf53cb5['query'][_0x1772('0x41')]+'%'};return _0x1d4e9;})});}_0xc382fa=_[_0x1772('0x42')]({},_0xc382fa,_0xf53cb5[_0x1772('0x44')]);return _0x8ef265[_0x1772('0xaf')](_0xc382fa);}})[_0x1772('0x23')](function(_0x46f5c8){if(_0x46f5c8){_0x46641a=_0x46f5c8[_0x1772('0x3a')];if(!_0xf53cb5['query']['hasOwnProperty'](_0x1772('0x3c'))){_0xc382fa['limit']=qs['limit'](_0xf53cb5[_0x1772('0x35')][_0x1772('0x1e')]);_0xc382fa[_0x1772('0x1b')]=qs['offset'](_0xf53cb5['query'][_0x1772('0x1b')]);}return _0x8ef265[_0x1772('0xaf')](_0xc382fa);}})[_0x1772('0x23')](function(_0x5b6a31){if(_0x5b6a31){return _0x5b6a31?{'count':_0x46641a,'rows':_0x5b6a31}:null;}})[_0x1772('0x23')](respondWithResult(_0x134cb3,null))[_0x1772('0x17')](handleError(_0x134cb3,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 9ff94bf..81db8a6 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 _0xce04=['events','MailAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x47794f,_0x12c9b3){var _0x2ca51d=function(_0x43deb3){while(--_0x43deb3){_0x47794f['push'](_0x47794f['shift']());}};_0x2ca51d(++_0x12c9b3);}(_0xce04,0xc0));var _0x4ce0=function(_0x46f386,_0x2f7819){_0x46f386=_0x46f386-0x0;var _0x31d3c7=_0xce04[_0x46f386];return _0x31d3c7;};'use strict';var EventEmitter=require(_0x4ce0('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x4ce0('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x4ce0('0x2')](0x0);var events={'afterCreate':_0x4ce0('0x3'),'afterUpdate':'update','afterDestroy':_0x4ce0('0x4')};function emitEvent(_0x52ddc4){return function(_0x561bdf,_0x4bf347,_0x2af4b9){MailAccountEvents[_0x4ce0('0x5')](_0x52ddc4+':'+_0x561bdf['id'],_0x561bdf);MailAccountEvents['emit'](_0x52ddc4,_0x561bdf);_0x2af4b9(null);};}for(var e in events){if(events[_0x4ce0('0x6')](e)){var event=events[e];MailAccount[_0x4ce0('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x458a=['emit','exports','events','setMaxListeners','save','remove'];(function(_0x356b9e,_0x306f73){var _0x15e910=function(_0x476146){while(--_0x476146){_0x356b9e['push'](_0x356b9e['shift']());}};_0x15e910(++_0x306f73);}(_0x458a,0x110));var _0xa458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x458a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xa458('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xa458('0x1')](0x0);var events={'afterCreate':_0xa458('0x2'),'afterUpdate':'update','afterDestroy':_0xa458('0x3')};function emitEvent(_0x3ae6c1){return function(_0xd8f327,_0x953f51,_0x306a40){MailAccountEvents[_0xa458('0x4')](_0x3ae6c1+':'+_0xd8f327['id'],_0xd8f327);MailAccountEvents['emit'](_0x3ae6c1,_0xd8f327);_0x306a40(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xa458('0x5')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 62de082..d59e3f2 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 _0x9552=['mail_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailAccount.attributes','define'];(function(_0x249479,_0x5a7d21){var _0x4dcb87=function(_0x5b3fd0){while(--_0x5b3fd0){_0x249479['push'](_0x249479['shift']());}};_0x4dcb87(++_0x5a7d21);}(_0x9552,0x139));var _0x2955=function(_0x187395,_0xb6cc95){_0x187395=_0x187395-0x0;var _0x2ee6a5=_0x9552[_0x187395];return _0x2ee6a5;};'use strict';var _=require(_0x2955('0x0'));var util=require(_0x2955('0x1'));var logger=require(_0x2955('0x2'))(_0x2955('0x3'));var moment=require(_0x2955('0x4'));var BPromise=require(_0x2955('0x5'));var rp=require(_0x2955('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2955('0x7'));var config=require(_0x2955('0x8'));var attributes=require(_0x2955('0x9'));module['exports']=function(_0x2bf1d1,_0x8fa5e8){return _0x2bf1d1[_0x2955('0xa')]('MailAccount',attributes,{'tableName':_0x2955('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b4b=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','MailAccount','mail_accounts','lodash'];(function(_0x5af0b6,_0xe03d16){var _0x6012c3=function(_0x2ca21b){while(--_0x2ca21b){_0x5af0b6['push'](_0x5af0b6['shift']());}};_0x6012c3(++_0xe03d16);}(_0x3b4b,0x1df));var _0xb3b4=function(_0x2394fd,_0x5e8f2b){_0x2394fd=_0x2394fd-0x0;var _0x4caa72=_0x3b4b[_0x2394fd];return _0x4caa72;};'use strict';var _=require(_0xb3b4('0x0'));var util=require(_0xb3b4('0x1'));var logger=require(_0xb3b4('0x2'))('api');var moment=require(_0xb3b4('0x3'));var BPromise=require(_0xb3b4('0x4'));var rp=require(_0xb3b4('0x5'));var fs=require('fs');var path=require(_0xb3b4('0x6'));var rimraf=require(_0xb3b4('0x7'));var config=require(_0xb3b4('0x8'));var attributes=require(_0xb3b4('0x9'));module['exports']=function(_0x240862,_0x47a6ea){return _0x240862['define'](_0xb3b4('0xa'),attributes,{'tableName':_0xb3b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 6b7eebc..8ac4467 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 _0x2cc2=['applications','orderBy','priority','autoclose','push','length','close','List\x20not\x20found','messageId','subject','attach','format','Messages','inReplyTo','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','MailMessage','contact','originTo','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','findAll','options','raw','attributes','limit','include','model','map','catch','ShowMailAccount','where','NotifyMailAccount','body','mail','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','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','MailAccount','find','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','list'];(function(_0x1d051e,_0x7bc37){var _0x12381e=function(_0x150a5b){while(--_0x150a5b){_0x1d051e['push'](_0x1d051e['shift']());}};_0x12381e(++_0x7bc37);}(_0x2cc2,0xfa));var _0x22cc=function(_0x4abb10,_0x26897f){_0x4abb10=_0x4abb10-0x0;var _0x2494fe=_0x2cc2[_0x4abb10];return _0x2494fe;};'use strict';var _=require(_0x22cc('0x0'));var util=require('util');var moment=require(_0x22cc('0x1'));var BPromise=require(_0x22cc('0x2'));var rs=require(_0x22cc('0x3'));var fs=require('fs');var Redis=require(_0x22cc('0x4'));var db=require(_0x22cc('0x5'))['db'];var utils=require(_0x22cc('0x6'));var logger=require(_0x22cc('0x7'))(_0x22cc('0x8'));var config=require(_0x22cc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x22cc('0xa')][_0x22cc('0xb')]({'port':0x232c});config[_0x22cc('0xc')]=_[_0x22cc('0xd')](config['redis'],{'host':_0x22cc('0xe'),'port':0x18eb});var socket=require(_0x22cc('0xf'))(new Redis(config[_0x22cc('0xc')]));require(_0x22cc('0x10'))[_0x22cc('0x11')](socket);function respondWithRpcPromise(_0x175145,_0x1324c1,_0xbc43fe){return new BPromise(function(_0x340da5,_0x310f7b){return client[_0x22cc('0x12')](_0x175145,_0xbc43fe)[_0x22cc('0x13')](function(_0x4894e1){logger[_0x22cc('0x14')]('MailAccount,\x20%s,\x20%s',_0x1324c1,_0x22cc('0x15'));logger[_0x22cc('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x1324c1,_0x22cc('0x15'),JSON[_0x22cc('0x17')](_0x4894e1));if(_0x4894e1[_0x22cc('0x18')]){if(_0x4894e1[_0x22cc('0x18')][_0x22cc('0x19')]===0x1f4){logger['error'](_0x22cc('0x1a'),_0x1324c1,_0x4894e1['error'][_0x22cc('0x1b')]);return _0x310f7b(_0x4894e1['error'][_0x22cc('0x1b')]);}logger[_0x22cc('0x18')](_0x22cc('0x1a'),_0x1324c1,_0x4894e1[_0x22cc('0x18')][_0x22cc('0x1b')]);return _0x340da5(_0x4894e1[_0x22cc('0x18')][_0x22cc('0x1b')]);}else{logger[_0x22cc('0x14')](_0x22cc('0x1a'),_0x1324c1,_0x22cc('0x15'));_0x340da5(_0x4894e1[_0x22cc('0x1c')][_0x22cc('0x1b')]);}})['catch'](function(_0x35d461){logger[_0x22cc('0x18')](_0x22cc('0x1a'),_0x1324c1,_0x35d461);_0x310f7b(_0x35d461);});});}exports[_0x22cc('0x1d')]=function(_0x336fe2){var _0x5d3022=this;return new Promise(function(_0x4757ec,_0x1a4b7e){return db['MailAccount'][_0x22cc('0x1e')]({'raw':_0x336fe2[_0x22cc('0x1f')]?_0x336fe2[_0x22cc('0x1f')][_0x22cc('0x20')]===undefined?!![]:![]:!![],'where':_0x336fe2[_0x22cc('0x1f')]?_0x336fe2[_0x22cc('0x1f')]['where']||null:null,'attributes':_0x336fe2[_0x22cc('0x1f')]?_0x336fe2[_0x22cc('0x1f')][_0x22cc('0x21')]||null:null,'limit':_0x336fe2['options']?_0x336fe2[_0x22cc('0x1f')][_0x22cc('0x22')]||null:null,'include':_0x336fe2[_0x22cc('0x1f')]?_0x336fe2[_0x22cc('0x1f')][_0x22cc('0x23')]?_['map'](_0x336fe2[_0x22cc('0x1f')][_0x22cc('0x23')],function(_0x3703dd){return{'model':db[_0x3703dd['model']],'as':_0x3703dd['as'],'attributes':_0x3703dd[_0x22cc('0x21')],'include':_0x3703dd[_0x22cc('0x23')]?_['map'](_0x3703dd[_0x22cc('0x23')],function(_0x13ba07){return{'model':db[_0x13ba07[_0x22cc('0x24')]],'as':_0x13ba07['as'],'attributes':_0x13ba07[_0x22cc('0x21')],'include':_0x13ba07[_0x22cc('0x23')]?_[_0x22cc('0x25')](_0x13ba07[_0x22cc('0x23')],function(_0x1a6315){return{'model':db[_0x1a6315[_0x22cc('0x24')]],'as':_0x1a6315['as'],'attributes':_0x1a6315[_0x22cc('0x21')]};}):[]};}):[]};}):[]:[]})[_0x22cc('0x13')](function(_0x4641d8){logger[_0x22cc('0x14')](_0x22cc('0x1d'),_0x336fe2);logger[_0x22cc('0x16')](_0x22cc('0x1d'),_0x336fe2,JSON['stringify'](_0x4641d8));_0x4757ec(_0x4641d8);})[_0x22cc('0x26')](function(_0x17f0b9){logger[_0x22cc('0x18')](_0x22cc('0x1d'),_0x17f0b9[_0x22cc('0x1b')],_0x336fe2);_0x1a4b7e(_0x5d3022[_0x22cc('0x18')](0x1f4,_0x17f0b9[_0x22cc('0x1b')]));});});};exports[_0x22cc('0x27')]=function(_0x5aff62){var _0x123f41=this;return new Promise(function(_0x493886,_0x27210c){return db['MailAccount']['find']({'raw':_0x5aff62[_0x22cc('0x1f')]?_0x5aff62[_0x22cc('0x1f')][_0x22cc('0x20')]===undefined?!![]:![]:!![],'where':_0x5aff62[_0x22cc('0x1f')]?_0x5aff62[_0x22cc('0x1f')][_0x22cc('0x28')]||null:null,'attributes':_0x5aff62[_0x22cc('0x1f')]?_0x5aff62[_0x22cc('0x1f')][_0x22cc('0x21')]||null:null,'include':_0x5aff62[_0x22cc('0x1f')]?_0x5aff62[_0x22cc('0x1f')]['include']?_[_0x22cc('0x25')](_0x5aff62[_0x22cc('0x1f')][_0x22cc('0x23')],function(_0x284641){return{'model':db[_0x284641['model']],'as':_0x284641['as'],'attributes':_0x284641[_0x22cc('0x21')],'include':_0x284641['include']?_['map'](_0x284641[_0x22cc('0x23')],function(_0x325a44){return{'model':db[_0x325a44['model']],'as':_0x325a44['as'],'attributes':_0x325a44[_0x22cc('0x21')],'include':_0x325a44[_0x22cc('0x23')]?_[_0x22cc('0x25')](_0x325a44[_0x22cc('0x23')],function(_0x25f2b4){return{'model':db[_0x25f2b4[_0x22cc('0x24')]],'as':_0x25f2b4['as'],'attributes':_0x25f2b4[_0x22cc('0x21')]};}):[]};}):[]};}):[]:[]})[_0x22cc('0x13')](function(_0x41f7c7){logger[_0x22cc('0x14')](_0x22cc('0x27'),_0x5aff62);logger[_0x22cc('0x16')](_0x22cc('0x27'),_0x5aff62,JSON[_0x22cc('0x17')](_0x41f7c7));_0x493886(_0x41f7c7);})[_0x22cc('0x26')](function(_0x37b972){logger[_0x22cc('0x18')](_0x22cc('0x27'),_0x37b972[_0x22cc('0x1b')],_0x5aff62);_0x27210c(_0x123f41[_0x22cc('0x18')](0x1f4,_0x37b972[_0x22cc('0x1b')]));});});};exports[_0x22cc('0x29')]=function(_0x1e96f7){var _0x416528=this;return new Promise(function(_0x21182b,_0x3fe28b){var _0x58255b={'body':_0x1e96f7[_0x22cc('0x2a')],'channel':_0x22cc('0x2b')};var _0x458d5b=_['difference'](_['keys'](db[_0x22cc('0x2c')][_0x22cc('0x2d')]),[_0x22cc('0x2e'),_0x22cc('0x2f'),_0x22cc('0x30'),_0x22cc('0x31')]);var _0x556149=![];if(_0x1e96f7[_0x22cc('0x2a')]['id']){delete _0x1e96f7[_0x22cc('0x2a')]['id'];}if(_['isNil'](_0x1e96f7['body']['from'])){return _0x3fe28b(_0x416528[_0x22cc('0x18')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x22cc('0x32')](_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x2a')])||_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x2a')]===''){return _0x3fe28b(_0x416528['error'](0x1f4,_0x22cc('0x33')));}if(_[_0x22cc('0x32')](_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x34')])){return _0x3fe28b(_0x416528[_0x22cc('0x18')](0x1f4,_0x22cc('0x35')+_0x458d5b));}if(!_[_0x22cc('0x36')](_0x458d5b,_0x1e96f7[_0x22cc('0x2a')]['mapKey'])){return _0x3fe28b(_0x416528['error'](0x1f4,_0x22cc('0x37')+_0x458d5b));}var _0x9df84b={};_0x9df84b[_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x34')]]=_0x1e96f7['body'][_0x22cc('0x38')];return db[_0x22cc('0x39')][_0x22cc('0x3a')]({'where':{'id':_0x1e96f7[_0x22cc('0x3b')]['id']},'include':[{'model':db[_0x22cc('0x3c')],'as':_0x22cc('0x3d'),'include':[{'model':db[_0x22cc('0x2c')],'as':_0x22cc('0x3e'),'where':_0x9df84b,'limit':0x1,'order':[[_0x22cc('0x2f'),_0x22cc('0x3f')]]}]},{'model':db[_0x22cc('0x40')],'as':_0x22cc('0x41')},{'model':db[_0x22cc('0x42')],'as':_0x22cc('0x43')}]})[_0x22cc('0x13')](function(_0x548774){if(_0x548774&&_0x548774[_0x22cc('0x3d')]){var _0x162133=_0x548774[_0x22cc('0x44')]({'plain':!![]});_0x58255b['account']=_[_0x22cc('0x45')](_0x162133,['Applications',_0x22cc('0x3d')]);_0x58255b['applications']=_0x162133[_0x22cc('0x41')];_0x58255b[_0x22cc('0x46')]=_0x162133['List'];_0x58255b[_0x22cc('0x47')]=_[_0x22cc('0x48')](_0x58255b[_0x22cc('0x47')],[_0x22cc('0x49')],['asc']);if(_0x58255b['account']&&_0x58255b[_0x22cc('0x3b')][_0x22cc('0x4a')]){_0x58255b['applications'][_0x22cc('0x4b')]({'id':0x0,'priority':_0x58255b[_0x22cc('0x47')][_0x22cc('0x4c')]+0x1,'app':_0x22cc('0x4d'),'appdata':_0x22cc('0x4a'),'interval':'*,*,*,*'});}if(_0x58255b['account'][_0x22cc('0x41')]){delete _0x58255b['account']['Applications'];}if(_0x58255b['account'][_0x22cc('0x3d')]){delete _0x58255b[_0x22cc('0x3b')][_0x22cc('0x3d')];}if(_0x162133[_0x22cc('0x3d')][_0x22cc('0x3e')][_0x22cc('0x4c')]){return _0x162133['List'][_0x22cc('0x3e')][0x0];}var _0x4294fa=_['defaults'](_0x1e96f7[_0x22cc('0x2a')],{'firstName':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x38')],'ListId':_0x162133[_0x22cc('0x31')]});_0x4294fa[_0x1e96f7['body'][_0x22cc('0x34')]]=_0x1e96f7[_0x22cc('0x2a')]['from'];return db[_0x22cc('0x2c')]['create'](_0x4294fa);}else{throw new Error(_0x22cc('0x4e'));}})['then'](function(_0x9190b4){_0x58255b['contact']=_0x9190b4;if(_0x9190b4){if(!_0x1e96f7['body'][_0x22cc('0x1b')][_0x22cc('0x4f')]){_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')][_0x22cc('0x4f')]=rs['generate']()+'\x20'+_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')][_0x22cc('0x38')];}var _0xbf72c5={'ContactId':_0x9190b4['id'],'MailAccountId':_0x1e96f7[_0x22cc('0x3b')]['id'],'inReplyTo':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')][_0x22cc('0x4f')],'to':_0x1e96f7['body'][_0x22cc('0x1b')]['from'],'cc':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')]['cc'],'subject':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')][_0x22cc('0x50')],'attach':_0x1e96f7['body'][_0x22cc('0x1b')][_0x22cc('0x51')],'lastMsgAt':moment()[_0x22cc('0x52')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x1e96f7[_0x22cc('0x3b')]['id']},'include':[{'model':db['MailMessage'],'as':_0x22cc('0x53'),'attributes':[_0x22cc('0x4f')],'where':{'messageId':_0x1e96f7['body'][_0x22cc('0x1b')][_0x22cc('0x54')]}}]})[_0x22cc('0x13')](function(_0x48ecfe){if(_0x48ecfe){return[_0x48ecfe,![]];}return db['MailInteraction']['create'](_0xbf72c5)[_0x22cc('0x13')](function(_0x282bc9){return[_0x282bc9,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x22cc('0x55')](function(_0x2f6dc4,_0x3cf177){if(_0x2f6dc4){_0x556149=_0x3cf177;if(!_0x3cf177){return _0x2f6dc4[_0x22cc('0x56')]({'inReplyTo':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')][_0x22cc('0x4f')],'to':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')][_0x22cc('0x38')],'cc':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')]['cc'],'subject':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')][_0x22cc('0x50')],'attach':_0x2f6dc4[_0x22cc('0x51')]?_0x2f6dc4[_0x22cc('0x51')]:_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')][_0x22cc('0x51')],'substatus':null,'substatusAt':moment()[_0x22cc('0x52')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x22cc('0x52')](_0x22cc('0x57')),'lastMsgDirection':'in'});}else{return _0x2f6dc4;}}})[_0x22cc('0x13')](function(_0x48d62e){_0x58255b['interaction']=_0x48d62e[_0x22cc('0x44')]({'plain':!![]});_0x58255b[_0x22cc('0x58')][_0x22cc('0x59')]=_0x556149;return db[_0x22cc('0x5a')]['create']({'body':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x2a')],'MailAccountId':_0x1e96f7['account']['id'],'MailInteractionId':_0x48d62e['id'],'direction':'in','ContactId':_0x58255b[_0x22cc('0x5b')]['id'],'messageId':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')][_0x22cc('0x4f')],'from':_0x1e96f7['body'][_0x22cc('0x1b')][_0x22cc('0x38')],'to':_0x1e96f7['body']['message']['to'],'cc':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')]['cc'],'subject':_0x1e96f7['body']['message'][_0x22cc('0x50')],'attach':_0x1e96f7[_0x22cc('0x2a')]['message']['attach'],'Attachments':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')]['attachments'],'originTo':_0x1e96f7['body'][_0x22cc('0x1b')][_0x22cc('0x5c')],'originCc':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')]['originCc'],'bcc':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')][_0x22cc('0x5d')],'ChatWebsiteId':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')][_0x22cc('0x5e')]||null,'originChannel':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')]['originChannel']||_0x22cc('0x5f'),'ChatOfflineMessageId':_0x1e96f7[_0x22cc('0x2a')][_0x22cc('0x1b')][_0x22cc('0x60')]||null},{'include':[{'model':db[_0x22cc('0x61')],'as':_0x22cc('0x62')}]});})['then'](function(_0x43f5b4){_0x58255b['message']=_0x43f5b4;if(_0x58255b['interaction'][_0x22cc('0x63')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x58255b[_0x22cc('0x58')]['UserId']}})[_0x22cc('0x13')](function(_0x25f892){if(_0x25f892){_0x58255b[_0x22cc('0x47')][_0x22cc('0x64')]({'id':0x0,'priority':0x0,'app':_0x22cc('0x65'),'appdata':_0x25f892[_0x22cc('0x66')]+','+(_0x58255b[_0x22cc('0x3b')][_0x22cc('0x67')]||0xa),'interval':_0x22cc('0x68')});}return respondWithRpcPromise('Start',_0x22cc('0x69'),_0x58255b);});}return respondWithRpcPromise(_0x22cc('0x6a'),_0x22cc('0x69'),_0x58255b);})['then'](function(_0x1463f2){_0x21182b(_0x1463f2);})[_0x22cc('0x26')](function(_0x5416ba){_0x3fe28b(_0x416528[_0x22cc('0x18')](0x1f4,_0x5416ba[_0x22cc('0x1b')]));});});}; \ No newline at end of file +var _0x1bac=['orderBy','priority','asc','autoclose','*,*,*,*','length','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','spread','update','get','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','interaction','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','MailAccount','options','raw','where','attributes','limit','include','map','model','GetMailAccount','ShowMailAccount','find','debug','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','DESC','MailApplication','Applications','applications','list'];(function(_0x4ba46e,_0x5a40be){var _0xfa2d05=function(_0x5aee28){while(--_0x5aee28){_0x4ba46e['push'](_0x4ba46e['shift']());}};_0xfa2d05(++_0x5a40be);}(_0x1bac,0x153));var _0xc1ba=function(_0x38086d,_0x5f5cff){_0x38086d=_0x38086d-0x0;var _0x4b8c39=_0x1bac[_0x38086d];return _0x4b8c39;};'use strict';var _=require(_0xc1ba('0x0'));var util=require(_0xc1ba('0x1'));var moment=require(_0xc1ba('0x2'));var BPromise=require(_0xc1ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1ba('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc1ba('0x5'));var config=require(_0xc1ba('0x6'));var jayson=require(_0xc1ba('0x7'));var client=jayson[_0xc1ba('0x8')][_0xc1ba('0x9')]({'port':0x232c});config[_0xc1ba('0xa')]=_[_0xc1ba('0xb')](config[_0xc1ba('0xa')],{'host':_0xc1ba('0xc'),'port':0x18eb});var socket=require(_0xc1ba('0xd'))(new Redis(config[_0xc1ba('0xa')]));require('./mailAccount.socket')[_0xc1ba('0xe')](socket);function respondWithRpcPromise(_0x13707d,_0x39e00f,_0x257615){return new BPromise(function(_0x403115,_0x2b8ea3){return client[_0xc1ba('0xf')](_0x13707d,_0x257615)[_0xc1ba('0x10')](function(_0x3c2251){logger[_0xc1ba('0x11')]('MailAccount,\x20%s,\x20%s',_0x39e00f,_0xc1ba('0x12'));logger['debug'](_0xc1ba('0x13'),_0x39e00f,_0xc1ba('0x12'),JSON[_0xc1ba('0x14')](_0x3c2251));if(_0x3c2251[_0xc1ba('0x15')]){if(_0x3c2251[_0xc1ba('0x15')][_0xc1ba('0x16')]===0x1f4){logger['error'](_0xc1ba('0x17'),_0x39e00f,_0x3c2251[_0xc1ba('0x15')][_0xc1ba('0x18')]);return _0x2b8ea3(_0x3c2251['error']['message']);}logger[_0xc1ba('0x15')]('MailAccount,\x20%s,\x20%s',_0x39e00f,_0x3c2251[_0xc1ba('0x15')][_0xc1ba('0x18')]);return _0x403115(_0x3c2251[_0xc1ba('0x15')][_0xc1ba('0x18')]);}else{logger[_0xc1ba('0x11')]('MailAccount,\x20%s,\x20%s',_0x39e00f,_0xc1ba('0x12'));_0x403115(_0x3c2251[_0xc1ba('0x19')][_0xc1ba('0x18')]);}})[_0xc1ba('0x1a')](function(_0x49aad9){logger[_0xc1ba('0x15')](_0xc1ba('0x17'),_0x39e00f,_0x49aad9);_0x2b8ea3(_0x49aad9);});});}exports['GetMailAccount']=function(_0x238321){var _0x3b99ec=this;return new Promise(function(_0x251d6d,_0x4111a6){return db[_0xc1ba('0x1b')]['findAll']({'raw':_0x238321[_0xc1ba('0x1c')]?_0x238321[_0xc1ba('0x1c')][_0xc1ba('0x1d')]===undefined?!![]:![]:!![],'where':_0x238321[_0xc1ba('0x1c')]?_0x238321[_0xc1ba('0x1c')][_0xc1ba('0x1e')]||null:null,'attributes':_0x238321[_0xc1ba('0x1c')]?_0x238321['options'][_0xc1ba('0x1f')]||null:null,'limit':_0x238321[_0xc1ba('0x1c')]?_0x238321[_0xc1ba('0x1c')][_0xc1ba('0x20')]||null:null,'include':_0x238321['options']?_0x238321[_0xc1ba('0x1c')][_0xc1ba('0x21')]?_[_0xc1ba('0x22')](_0x238321[_0xc1ba('0x1c')][_0xc1ba('0x21')],function(_0x35ee9b){return{'model':db[_0x35ee9b['model']],'as':_0x35ee9b['as'],'attributes':_0x35ee9b[_0xc1ba('0x1f')],'include':_0x35ee9b[_0xc1ba('0x21')]?_[_0xc1ba('0x22')](_0x35ee9b['include'],function(_0x1f16e0){return{'model':db[_0x1f16e0[_0xc1ba('0x23')]],'as':_0x1f16e0['as'],'attributes':_0x1f16e0[_0xc1ba('0x1f')],'include':_0x1f16e0[_0xc1ba('0x21')]?_[_0xc1ba('0x22')](_0x1f16e0[_0xc1ba('0x21')],function(_0x562de8){return{'model':db[_0x562de8[_0xc1ba('0x23')]],'as':_0x562de8['as'],'attributes':_0x562de8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x38a482){logger['info'](_0xc1ba('0x24'),_0x238321);logger['debug'](_0xc1ba('0x24'),_0x238321,JSON[_0xc1ba('0x14')](_0x38a482));_0x251d6d(_0x38a482);})[_0xc1ba('0x1a')](function(_0x1aaafb){logger[_0xc1ba('0x15')](_0xc1ba('0x24'),_0x1aaafb[_0xc1ba('0x18')],_0x238321);_0x4111a6(_0x3b99ec['error'](0x1f4,_0x1aaafb[_0xc1ba('0x18')]));});});};exports[_0xc1ba('0x25')]=function(_0x1a9f09){var _0x4a2d59=this;return new Promise(function(_0x593983,_0x360c75){return db['MailAccount'][_0xc1ba('0x26')]({'raw':_0x1a9f09['options']?_0x1a9f09[_0xc1ba('0x1c')][_0xc1ba('0x1d')]===undefined?!![]:![]:!![],'where':_0x1a9f09[_0xc1ba('0x1c')]?_0x1a9f09['options'][_0xc1ba('0x1e')]||null:null,'attributes':_0x1a9f09[_0xc1ba('0x1c')]?_0x1a9f09[_0xc1ba('0x1c')]['attributes']||null:null,'include':_0x1a9f09[_0xc1ba('0x1c')]?_0x1a9f09[_0xc1ba('0x1c')][_0xc1ba('0x21')]?_['map'](_0x1a9f09['options'][_0xc1ba('0x21')],function(_0x2097f5){return{'model':db[_0x2097f5[_0xc1ba('0x23')]],'as':_0x2097f5['as'],'attributes':_0x2097f5['attributes'],'include':_0x2097f5[_0xc1ba('0x21')]?_['map'](_0x2097f5['include'],function(_0xa7d3c7){return{'model':db[_0xa7d3c7[_0xc1ba('0x23')]],'as':_0xa7d3c7['as'],'attributes':_0xa7d3c7[_0xc1ba('0x1f')],'include':_0xa7d3c7[_0xc1ba('0x21')]?_[_0xc1ba('0x22')](_0xa7d3c7[_0xc1ba('0x21')],function(_0x36f075){return{'model':db[_0x36f075[_0xc1ba('0x23')]],'as':_0x36f075['as'],'attributes':_0x36f075[_0xc1ba('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x209527){logger['info'](_0xc1ba('0x25'),_0x1a9f09);logger[_0xc1ba('0x27')](_0xc1ba('0x25'),_0x1a9f09,JSON[_0xc1ba('0x14')](_0x209527));_0x593983(_0x209527);})[_0xc1ba('0x1a')](function(_0x1e4ac2){logger['error'](_0xc1ba('0x25'),_0x1e4ac2[_0xc1ba('0x18')],_0x1a9f09);_0x360c75(_0x4a2d59[_0xc1ba('0x15')](0x1f4,_0x1e4ac2['message']));});});};exports[_0xc1ba('0x28')]=function(_0x39c687){var _0x3e7ead=this;return new Promise(function(_0x4fbb31,_0xaa6754){var _0x896a17={'body':_0x39c687[_0xc1ba('0x29')],'channel':_0xc1ba('0x2a')};var _0x8edc3f=_[_0xc1ba('0x2b')](_[_0xc1ba('0x2c')](db[_0xc1ba('0x2d')][_0xc1ba('0x2e')]),[_0xc1ba('0x2f'),_0xc1ba('0x30'),'CompanyId',_0xc1ba('0x31')]);var _0x19aa96=![];if(_0x39c687['body']['id']){delete _0x39c687['body']['id'];}if(_[_0xc1ba('0x32')](_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x33')])){return _0xaa6754(_0x3e7ead[_0xc1ba('0x15')](0x1f4,_0xc1ba('0x34')));}if(_[_0xc1ba('0x32')](_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x29')])||_0x39c687['body'][_0xc1ba('0x29')]===''){return _0xaa6754(_0x3e7ead[_0xc1ba('0x15')](0x1f4,_0xc1ba('0x35')));}if(_[_0xc1ba('0x32')](_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x36')])){return _0xaa6754(_0x3e7ead[_0xc1ba('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x8edc3f));}if(!_[_0xc1ba('0x37')](_0x8edc3f,_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x36')])){return _0xaa6754(_0x3e7ead[_0xc1ba('0x15')](0x1f4,_0xc1ba('0x38')+_0x8edc3f));}var _0x5361f5={};_0x5361f5[_0x39c687['body'][_0xc1ba('0x36')]]=_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x33')];return db[_0xc1ba('0x1b')][_0xc1ba('0x26')]({'where':{'id':_0x39c687[_0xc1ba('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0xc1ba('0x3a'),'include':[{'model':db[_0xc1ba('0x2d')],'as':_0xc1ba('0x3b'),'where':_0x5361f5,'limit':0x1,'order':[[_0xc1ba('0x30'),_0xc1ba('0x3c')]]}]},{'model':db[_0xc1ba('0x3d')],'as':_0xc1ba('0x3e')},{'model':db['MailServerOut'],'as':'Smtp'}]})['then'](function(_0x1c5689){if(_0x1c5689&&_0x1c5689['List']){var _0x59e812=_0x1c5689['get']({'plain':!![]});_0x896a17[_0xc1ba('0x39')]=_['omit'](_0x59e812,[_0xc1ba('0x3e'),'List']);_0x896a17[_0xc1ba('0x3f')]=_0x59e812[_0xc1ba('0x3e')];_0x896a17[_0xc1ba('0x40')]=_0x59e812[_0xc1ba('0x3a')];_0x896a17[_0xc1ba('0x3f')]=_[_0xc1ba('0x41')](_0x896a17['applications'],[_0xc1ba('0x42')],[_0xc1ba('0x43')]);if(_0x896a17[_0xc1ba('0x39')]&&_0x896a17['account'][_0xc1ba('0x44')]){_0x896a17[_0xc1ba('0x3f')]['push']({'id':0x0,'priority':_0x896a17['applications']['length']+0x1,'app':'close','appdata':'autoclose','interval':_0xc1ba('0x45')});}if(_0x896a17[_0xc1ba('0x39')][_0xc1ba('0x3e')]){delete _0x896a17[_0xc1ba('0x39')][_0xc1ba('0x3e')];}if(_0x896a17[_0xc1ba('0x39')][_0xc1ba('0x3a')]){delete _0x896a17['account'][_0xc1ba('0x3a')];}if(_0x59e812[_0xc1ba('0x3a')][_0xc1ba('0x3b')][_0xc1ba('0x46')]){return _0x59e812[_0xc1ba('0x3a')]['Contacts'][0x0];}var _0x11268b=_['defaults'](_0x39c687[_0xc1ba('0x29')],{'firstName':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x33')],'ListId':_0x59e812['ListId']});_0x11268b[_0x39c687[_0xc1ba('0x29')]['mapKey']]=_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x33')];return db['CmContact']['create'](_0x11268b);}else{throw new Error('List\x20not\x20found');}})[_0xc1ba('0x10')](function(_0x236155){_0x896a17['contact']=_0x236155;if(_0x236155){if(!_0x39c687[_0xc1ba('0x29')]['message']['messageId']){_0x39c687['body'][_0xc1ba('0x18')][_0xc1ba('0x47')]=rs[_0xc1ba('0x48')]()+'\x20'+_0x39c687['body'][_0xc1ba('0x18')][_0xc1ba('0x33')];}var _0x4d1dc1={'ContactId':_0x236155['id'],'MailAccountId':_0x39c687[_0xc1ba('0x39')]['id'],'inReplyTo':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')][_0xc1ba('0x47')],'to':_0x39c687['body']['message'][_0xc1ba('0x33')],'cc':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')]['cc'],'subject':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')][_0xc1ba('0x49')],'attach':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')][_0xc1ba('0x4a')],'lastMsgAt':moment()[_0xc1ba('0x4b')](_0xc1ba('0x4c')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xc1ba('0x26')]({'where':{'closed':![],'MailAccountId':_0x39c687['account']['id']},'include':[{'model':db['MailMessage'],'as':_0xc1ba('0x4d'),'attributes':[_0xc1ba('0x47')],'where':{'messageId':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')][_0xc1ba('0x4e')]}}]})[_0xc1ba('0x10')](function(_0x43d397){if(_0x43d397){return[_0x43d397,![]];}return db[_0xc1ba('0x4f')]['create'](_0x4d1dc1)['then'](function(_0x5cb43c){return[_0x5cb43c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xc1ba('0x50')](function(_0x52e672,_0x312ad5){if(_0x52e672){_0x19aa96=_0x312ad5;if(!_0x312ad5){return _0x52e672[_0xc1ba('0x51')]({'inReplyTo':_0x39c687[_0xc1ba('0x29')]['message'][_0xc1ba('0x47')],'to':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')][_0xc1ba('0x33')],'cc':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')]['cc'],'subject':_0x39c687['body'][_0xc1ba('0x18')][_0xc1ba('0x49')],'attach':_0x52e672['attach']?_0x52e672[_0xc1ba('0x4a')]:_0x39c687[_0xc1ba('0x29')]['message'][_0xc1ba('0x4a')],'substatus':null,'substatusAt':moment()['format'](_0xc1ba('0x4c')),'lastMsgAt':moment()[_0xc1ba('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x52e672;}}})[_0xc1ba('0x10')](function(_0x1e657f){_0x896a17['interaction']=_0x1e657f[_0xc1ba('0x52')]({'plain':!![]});_0x896a17['interaction'][_0xc1ba('0x53')]=_0x19aa96;return db['MailMessage']['create']({'body':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x29')],'MailAccountId':_0x39c687['account']['id'],'MailInteractionId':_0x1e657f['id'],'direction':'in','ContactId':_0x896a17[_0xc1ba('0x54')]['id'],'messageId':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')]['messageId'],'from':_0x39c687[_0xc1ba('0x29')]['message']['from'],'to':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')]['to'],'cc':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')]['cc'],'subject':_0x39c687['body'][_0xc1ba('0x18')][_0xc1ba('0x49')],'attach':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')]['attach'],'Attachments':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')][_0xc1ba('0x55')],'originTo':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')][_0xc1ba('0x56')],'originCc':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')][_0xc1ba('0x57')],'bcc':_0x39c687['body'][_0xc1ba('0x18')][_0xc1ba('0x58')],'ChatWebsiteId':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')][_0xc1ba('0x59')]||null,'originChannel':_0x39c687['body'][_0xc1ba('0x18')]['originChannel']||_0xc1ba('0x5a'),'ChatOfflineMessageId':_0x39c687[_0xc1ba('0x29')][_0xc1ba('0x18')][_0xc1ba('0x5b')]||null},{'include':[{'model':db[_0xc1ba('0x5c')],'as':_0xc1ba('0x5d')}]});})[_0xc1ba('0x10')](function(_0x34593a){_0x896a17[_0xc1ba('0x18')]=_0x34593a;if(_0x896a17['interaction'][_0xc1ba('0x5e')]){return db['User'][_0xc1ba('0x26')]({'attributes':['id',_0xc1ba('0x5f')],'where':{'id':_0x896a17[_0xc1ba('0x60')]['UserId']}})[_0xc1ba('0x10')](function(_0x377709){if(_0x377709){_0x896a17[_0xc1ba('0x3f')][_0xc1ba('0x61')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x377709[_0xc1ba('0x5f')]+','+(_0x896a17[_0xc1ba('0x39')][_0xc1ba('0x62')]||0xa),'interval':_0xc1ba('0x45')});}return respondWithRpcPromise(_0xc1ba('0x63'),'startRouting',_0x896a17);});}return respondWithRpcPromise(_0xc1ba('0x63'),_0xc1ba('0x64'),_0x896a17);})[_0xc1ba('0x10')](function(_0x4f0533){_0x4fbb31(_0x4f0533);})[_0xc1ba('0x1a')](function(_0x15d032){_0xaa6754(_0x3e7ead[_0xc1ba('0x15')](0x1f4,_0x15d032[_0xc1ba('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index e216784..1b7bf3c 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 _0xafa7=['length','mailAccount:','./mailAccount.events','save','update','emit','removeListener','register'];(function(_0x3f7256,_0x20f2ee){var _0x579344=function(_0x16978e){while(--_0x16978e){_0x3f7256['push'](_0x3f7256['shift']());}};_0x579344(++_0x20f2ee);}(_0xafa7,0x122));var _0x7afa=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0xafa7[_0xd02bb];return _0x1cdf23;};'use strict';var MailAccountEvents=require(_0x7afa('0x0'));var events=[_0x7afa('0x1'),'remove',_0x7afa('0x2')];function createListener(_0x5b74f7,_0x38f6b0){return function(_0x35b2f4){_0x38f6b0[_0x7afa('0x3')](_0x5b74f7,_0x35b2f4);};}function removeListener(_0x5eda37,_0x4e4126){return function(){MailAccountEvents[_0x7afa('0x4')](_0x5eda37,_0x4e4126);};}exports[_0x7afa('0x5')]=function(_0x2713c7){for(var _0x27a3ae=0x0,_0x2243f6=events[_0x7afa('0x6')];_0x27a3ae<_0x2243f6;_0x27a3ae++){var _0x59c1f0=events[_0x27a3ae];var _0xde102c=createListener(_0x7afa('0x7')+_0x59c1f0,_0x2713c7);MailAccountEvents['on'](_0x59c1f0,_0xde102c);}}; \ No newline at end of file +var _0x50e4=['emit','register','length','./mailAccount.events','save'];(function(_0x180a6e,_0x334c98){var _0x14cd6f=function(_0x371b43){while(--_0x371b43){_0x180a6e['push'](_0x180a6e['shift']());}};_0x14cd6f(++_0x334c98);}(_0x50e4,0x1c5));var _0x450e=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x50e4[_0x1992f1];return _0x413dfe;};'use strict';var MailAccountEvents=require(_0x450e('0x0'));var events=[_0x450e('0x1'),'remove','update'];function createListener(_0x41647d,_0x1466fc){return function(_0x2f8393){_0x1466fc[_0x450e('0x2')](_0x41647d,_0x2f8393);};}function removeListener(_0x51cd35,_0x448c96){return function(){MailAccountEvents['removeListener'](_0x51cd35,_0x448c96);};}exports[_0x450e('0x3')]=function(_0x3414c2){for(var _0x143fa6=0x0,_0x46a0ba=events[_0x450e('0x4')];_0x143fa6<_0x46a0ba;_0x143fa6++){var _0x3402ac=events[_0x143fa6];var _0x185363=createListener('mailAccount:'+_0x3402ac,_0x3414c2);MailAccountEvents['on'](_0x3402ac,_0x185363);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index c89acbe..27eadcd 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 _0x7c45=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','put','update','delete'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x7c45,0x161));var _0x57c4=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x7c45[_0x476bf4];return _0x788ffe;};'use strict';var multer=require(_0x57c4('0x0'));var util=require(_0x57c4('0x1'));var path=require(_0x57c4('0x2'));var timeout=require(_0x57c4('0x3'));var express=require(_0x57c4('0x4'));var router=express[_0x57c4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x57c4('0x6'));var config=require(_0x57c4('0x7'));var controller=require(_0x57c4('0x8'));router[_0x57c4('0x9')](_0x57c4('0xa'),auth[_0x57c4('0xb')](),controller['show']);router[_0x57c4('0xc')](_0x57c4('0xa'),auth[_0x57c4('0xb')](),controller[_0x57c4('0xd')]);router[_0x57c4('0xe')](_0x57c4('0xa'),auth[_0x57c4('0xb')](),controller['destroy']);module[_0x57c4('0xf')]=router; \ No newline at end of file +var _0x47e9=['delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','show','put','/:id','isAuthenticated','update'];(function(_0x2a4d83,_0x2f548c){var _0x1f223d=function(_0x513327){while(--_0x513327){_0x2a4d83['push'](_0x2a4d83['shift']());}};_0x1f223d(++_0x2f548c);}(_0x47e9,0x1dd));var _0x947e=function(_0x53e7f8,_0x335d35){_0x53e7f8=_0x53e7f8-0x0;var _0x3140c0=_0x47e9[_0x53e7f8];return _0x3140c0;};'use strict';var multer=require(_0x947e('0x0'));var util=require(_0x947e('0x1'));var path=require(_0x947e('0x2'));var timeout=require(_0x947e('0x3'));var express=require(_0x947e('0x4'));var router=express[_0x947e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x947e('0x6'));var interaction=require(_0x947e('0x7'));var config=require(_0x947e('0x8'));var controller=require(_0x947e('0x9'));router[_0x947e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x947e('0xb')]);router[_0x947e('0xc')](_0x947e('0xd'),auth[_0x947e('0xe')](),controller[_0x947e('0xf')]);router[_0x947e('0x10')](_0x947e('0xd'),auth[_0x947e('0xe')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 15860c1..226f7c6 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 _0xa857=['INTEGER','STRING','noop','*,*,*,*','exports'];(function(_0x157112,_0x59def3){var _0x9d3138=function(_0x1d299e){while(--_0x1d299e){_0x157112['push'](_0x157112['shift']());}};_0x9d3138(++_0x59def3);}(_0xa857,0x1b2));var _0x7a85=function(_0x4f2019,_0x2c223e){_0x4f2019=_0x4f2019-0x0;var _0x349ecd=_0xa857[_0x4f2019];return _0x349ecd;};'use strict';var Sequelize=require('sequelize');module[_0x7a85('0x0')]={'priority':{'type':Sequelize[_0x7a85('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7a85('0x2')],'allowNull':![],'defaultValue':_0x7a85('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7a85('0x2')]},'interval':{'type':Sequelize[_0x7a85('0x2')],'defaultValue':_0x7a85('0x4')}}; \ No newline at end of file +var _0x9eff=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x3fccec,_0x451371){var _0x3049c1=function(_0x12fb65){while(--_0x12fb65){_0x3fccec['push'](_0x3fccec['shift']());}};_0x3049c1(++_0x451371);}(_0x9eff,0x172));var _0xf9ef=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9eff[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xf9ef('0x0'));module[_0xf9ef('0x1')]={'priority':{'type':Sequelize[_0xf9ef('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf9ef('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf9ef('0x4')]()},'description':{'type':Sequelize[_0xf9ef('0x3')]},'interval':{'type':Sequelize[_0xf9ef('0x3')],'defaultValue':_0xf9ef('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 683f080..cd95dda 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 _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x479988,_0x17b763){var _0x17610c=function(_0x1dc420){while(--_0x1dc420){_0x479988['push'](_0x479988['shift']());}};_0x17610c(++_0x17b763);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));}; \ No newline at end of file +var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x3e32a8,_0x255953){var _0x2997b0=function(_0x2d564a){while(--_0x2d564a){_0x3e32a8['push'](_0x3e32a8['shift']());}};_0x2997b0(++_0x255953);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x30ba61,_0x48b905){_0x30ba61=_0x30ba61-0x0;var _0x7300ad=_0xbdb7[_0x30ba61];return _0x7300ad;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index b828ced..c3c8726 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 _0x4de9=['request-promise','../../config/environment','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x23d878,_0x425718){var _0x3bf4a5=function(_0x356bd0){while(--_0x356bd0){_0x23d878['push'](_0x23d878['shift']());}};_0x3bf4a5(++_0x425718);}(_0x4de9,0x97));var _0x94de=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0x4de9[_0x1e393b];return _0x3d0bfe;};'use strict';var _=require(_0x94de('0x0'));var util=require('util');var logger=require(_0x94de('0x1'))(_0x94de('0x2'));var moment=require(_0x94de('0x3'));var BPromise=require(_0x94de('0x4'));var rp=require(_0x94de('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x94de('0x6'));var attributes=require('./mailApplication.attributes');module[_0x94de('0x7')]=function(_0x69eb35,_0x437e42){return _0x69eb35['define'](_0x94de('0x8'),attributes,{'tableName':_0x94de('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x94de('0xa'),'collate':_0x94de('0xb')});}; \ No newline at end of file +var _0xc445=['moment','bluebird','path','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xe62388,_0x20a8dc){var _0x364a83=function(_0x3c3718){while(--_0x3c3718){_0xe62388['push'](_0xe62388['shift']());}};_0x364a83(++_0x20a8dc);}(_0xc445,0x102));var _0x5c44=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc445[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x5c44('0x0'));var util=require(_0x5c44('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5c44('0x2'));var BPromise=require(_0x5c44('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5c44('0x4'));var rimraf=require('rimraf');var config=require(_0x5c44('0x5'));var attributes=require(_0x5c44('0x6'));module[_0x5c44('0x7')]=function(_0x1463a,_0x2318ee){return _0x1463a[_0x5c44('0x8')](_0x5c44('0x9'),attributes,{'tableName':_0x5c44('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5c44('0xb'),'collate':_0x5c44('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 4367123..abe9668 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 _0x98dc=['where','then','UpdateMailApplication','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MailApplication','update','body','options','raw'];(function(_0x4f3b21,_0x4c8aa0){var _0x3f6ae7=function(_0x39a0c0){while(--_0x39a0c0){_0x4f3b21['push'](_0x4f3b21['shift']());}};_0x3f6ae7(++_0x4c8aa0);}(_0x98dc,0x18a));var _0xc98d=function(_0x59904d,_0x513297){_0x59904d=_0x59904d-0x0;var _0x499ecb=_0x98dc[_0x59904d];return _0x499ecb;};'use strict';var _=require(_0xc98d('0x0'));var util=require(_0xc98d('0x1'));var moment=require(_0xc98d('0x2'));var BPromise=require(_0xc98d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc98d('0x4'))['db'];var utils=require(_0xc98d('0x5'));var logger=require(_0xc98d('0x6'))(_0xc98d('0x7'));var config=require(_0xc98d('0x8'));var jayson=require(_0xc98d('0x9'));var client=jayson['client'][_0xc98d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3066b0,_0x4abcb0,_0x2d9c7f){return new BPromise(function(_0x21e3d8,_0x569366){return client['request'](_0x3066b0,_0x2d9c7f)['then'](function(_0x27ca31){logger[_0xc98d('0xb')](_0xc98d('0xc'),_0x4abcb0,_0xc98d('0xd'));logger[_0xc98d('0xe')](_0xc98d('0xf'),_0x4abcb0,_0xc98d('0xd'),JSON[_0xc98d('0x10')](_0x27ca31));if(_0x27ca31[_0xc98d('0x11')]){if(_0x27ca31[_0xc98d('0x11')][_0xc98d('0x12')]===0x1f4){logger[_0xc98d('0x11')]('MailApplication,\x20%s,\x20%s',_0x4abcb0,_0x27ca31['error'][_0xc98d('0x13')]);return _0x569366(_0x27ca31['error']['message']);}logger[_0xc98d('0x11')](_0xc98d('0xc'),_0x4abcb0,_0x27ca31[_0xc98d('0x11')][_0xc98d('0x13')]);return _0x21e3d8(_0x27ca31[_0xc98d('0x11')]['message']);}else{logger[_0xc98d('0xb')]('MailApplication,\x20%s,\x20%s',_0x4abcb0,_0xc98d('0xd'));_0x21e3d8(_0x27ca31[_0xc98d('0x14')][_0xc98d('0x13')]);}})['catch'](function(_0x10f96f){logger[_0xc98d('0x11')](_0xc98d('0xc'),_0x4abcb0,_0x10f96f);_0x569366(_0x10f96f);});});}exports['UpdateMailApplication']=function(_0x12e159){var _0xf1f9e6=this;return new Promise(function(_0xa93e99,_0x293d85){return db[_0xc98d('0x15')][_0xc98d('0x16')](_0x12e159[_0xc98d('0x17')],{'raw':_0x12e159[_0xc98d('0x18')]?_0x12e159[_0xc98d('0x18')][_0xc98d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12e159[_0xc98d('0x18')]?_0x12e159[_0xc98d('0x18')][_0xc98d('0x1a')]||null:null,'attributes':_0x12e159[_0xc98d('0x18')]?_0x12e159[_0xc98d('0x18')]['attributes']||null:null,'limit':_0x12e159['options']?_0x12e159[_0xc98d('0x18')]['limit']||null:null})[_0xc98d('0x1b')](function(_0x2c0b00){logger['info']('UpdateMailApplication',_0x12e159);logger[_0xc98d('0xe')](_0xc98d('0x1c'),_0x12e159,JSON[_0xc98d('0x10')](_0x2c0b00));_0xa93e99(_0x2c0b00);})[_0xc98d('0x1d')](function(_0x5aa506){logger[_0xc98d('0x11')]('UpdateMailApplication',_0x5aa506[_0xc98d('0x13')],_0x12e159);_0x293d85(_0xf1f9e6['error'](0x1f4,_0x5aa506['message']));});});}; \ No newline at end of file +var _0xc710=['MailApplication','update','body','options','raw','where','attributes','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UpdateMailApplication'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc710,0x163));var _0x0c71=function(_0x4a9702,_0x21a7ef){_0x4a9702=_0x4a9702-0x0;var _0x5df85f=_0xc710[_0x4a9702];return _0x5df85f;};'use strict';var _=require(_0x0c71('0x0'));var util=require('util');var moment=require(_0x0c71('0x1'));var BPromise=require('bluebird');var rs=require(_0x0c71('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c71('0x3'))['db'];var utils=require(_0x0c71('0x4'));var logger=require(_0x0c71('0x5'))(_0x0c71('0x6'));var config=require(_0x0c71('0x7'));var jayson=require(_0x0c71('0x8'));var client=jayson['client'][_0x0c71('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe8eedc,_0x2c580e,_0x5e44b3){return new BPromise(function(_0x52c58a,_0x2b1ef5){return client[_0x0c71('0xa')](_0xe8eedc,_0x5e44b3)[_0x0c71('0xb')](function(_0x38ca13){logger[_0x0c71('0xc')](_0x0c71('0xd'),_0x2c580e,'request\x20sent');logger[_0x0c71('0xe')](_0x0c71('0xf'),_0x2c580e,_0x0c71('0x10'),JSON[_0x0c71('0x11')](_0x38ca13));if(_0x38ca13[_0x0c71('0x12')]){if(_0x38ca13[_0x0c71('0x12')][_0x0c71('0x13')]===0x1f4){logger[_0x0c71('0x12')]('MailApplication,\x20%s,\x20%s',_0x2c580e,_0x38ca13[_0x0c71('0x12')][_0x0c71('0x14')]);return _0x2b1ef5(_0x38ca13[_0x0c71('0x12')][_0x0c71('0x14')]);}logger[_0x0c71('0x12')](_0x0c71('0xd'),_0x2c580e,_0x38ca13['error'][_0x0c71('0x14')]);return _0x52c58a(_0x38ca13[_0x0c71('0x12')]['message']);}else{logger[_0x0c71('0xc')](_0x0c71('0xd'),_0x2c580e,_0x0c71('0x10'));_0x52c58a(_0x38ca13['result'][_0x0c71('0x14')]);}})['catch'](function(_0x3a9794){logger[_0x0c71('0x12')](_0x0c71('0xd'),_0x2c580e,_0x3a9794);_0x2b1ef5(_0x3a9794);});});}exports[_0x0c71('0x15')]=function(_0x12e6b3){var _0xd9640e=this;return new Promise(function(_0x39b1b4,_0x21edba){return db[_0x0c71('0x16')][_0x0c71('0x17')](_0x12e6b3[_0x0c71('0x18')],{'raw':_0x12e6b3[_0x0c71('0x19')]?_0x12e6b3['options'][_0x0c71('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12e6b3[_0x0c71('0x19')]?_0x12e6b3['options'][_0x0c71('0x1b')]||null:null,'attributes':_0x12e6b3[_0x0c71('0x19')]?_0x12e6b3['options'][_0x0c71('0x1c')]||null:null,'limit':_0x12e6b3[_0x0c71('0x19')]?_0x12e6b3[_0x0c71('0x19')]['limit']||null:null})[_0x0c71('0xb')](function(_0x591535){logger[_0x0c71('0xc')](_0x0c71('0x15'),_0x12e6b3);logger['debug'](_0x0c71('0x15'),_0x12e6b3,JSON[_0x0c71('0x11')](_0x591535));_0x39b1b4(_0x591535);})['catch'](function(_0x1656c8){logger['error'](_0x0c71('0x15'),_0x1656c8[_0x0c71('0x14')],_0x12e6b3);_0x21edba(_0xd9640e['error'](0x1f4,_0x1656c8['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 25432dc..d5a796f 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 _0x9b59=['/:id/messages','getMessages','/:id/download','download','create','post','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update','delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x400322,_0x4353a8){var _0xfdd597=function(_0xd914b6){while(--_0xd914b6){_0x400322['push'](_0x400322['shift']());}};_0xfdd597(++_0x4353a8);}(_0x9b59,0x82));var _0x99b5=function(_0x338319,_0xf421b){_0x338319=_0x338319-0x0;var _0x6f1073=_0x9b59[_0x338319];return _0x6f1073;};'use strict';var express=require('express');var router=express[_0x99b5('0x0')]();var auth=require(_0x99b5('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x99b5('0x2'));router[_0x99b5('0x3')]('/',auth[_0x99b5('0x4')](),controller[_0x99b5('0x5')]);router[_0x99b5('0x3')](_0x99b5('0x6'),auth['isAuthenticated'](),controller[_0x99b5('0x7')]);router[_0x99b5('0x3')](_0x99b5('0x8'),auth[_0x99b5('0x4')](),controller[_0x99b5('0x9')]);router[_0x99b5('0x3')](_0x99b5('0xa'),auth[_0x99b5('0x4')](),controller[_0x99b5('0xb')]);router['get'](_0x99b5('0xc'),auth['isAuthenticated'](),controller[_0x99b5('0xd')]);router['post']('/',auth[_0x99b5('0x4')](),controller[_0x99b5('0xe')]);router[_0x99b5('0xf')]('/:id/messages',auth[_0x99b5('0x4')](),controller['addMessage']);router[_0x99b5('0xf')](_0x99b5('0x10'),auth[_0x99b5('0x4')](),interaction[_0x99b5('0x11')](_0x99b5('0x12'),_0x99b5('0x13')),controller[_0x99b5('0x14')]);router[_0x99b5('0x15')](_0x99b5('0x8'),auth[_0x99b5('0x4')](),interaction['tracked'](_0x99b5('0x12'),'mailinteraction:update'),controller[_0x99b5('0x16')]);router[_0x99b5('0x17')](_0x99b5('0x8'),auth[_0x99b5('0x4')](),interaction[_0x99b5('0x11')](_0x99b5('0x12'),_0x99b5('0x18')),controller[_0x99b5('0x19')]);router[_0x99b5('0x17')](_0x99b5('0x10'),auth[_0x99b5('0x4')](),controller[_0x99b5('0x1a')]);module[_0x99b5('0x1b')]=router; \ No newline at end of file +var _0x740c=['../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','/:id','tracked','mail','update','destroy','delete','removeTags','exports','Router','../../components/auth/service'];(function(_0x489be6,_0x422c90){var _0x2cb375=function(_0x52ce01){while(--_0x52ce01){_0x489be6['push'](_0x489be6['shift']());}};_0x2cb375(++_0x422c90);}(_0x740c,0x106));var _0xc740=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x740c[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express[_0xc740('0x0')]();var auth=require(_0xc740('0x1'));var interaction=require(_0xc740('0x2'));var controller=require(_0xc740('0x3'));router[_0xc740('0x4')]('/',auth[_0xc740('0x5')](),controller[_0xc740('0x6')]);router[_0xc740('0x4')](_0xc740('0x7'),auth[_0xc740('0x5')](),controller['describe']);router[_0xc740('0x4')]('/:id',auth[_0xc740('0x5')](),controller[_0xc740('0x8')]);router[_0xc740('0x4')](_0xc740('0x9'),auth[_0xc740('0x5')](),controller['getMessages']);router[_0xc740('0x4')](_0xc740('0xa'),auth['isAuthenticated'](),controller[_0xc740('0xb')]);router[_0xc740('0xc')]('/',auth['isAuthenticated'](),controller[_0xc740('0xd')]);router[_0xc740('0xc')]('/:id/messages',auth[_0xc740('0x5')](),controller[_0xc740('0xe')]);router['post'](_0xc740('0xf'),auth[_0xc740('0x5')](),interaction['tracked']('mail','mailinteraction:addtags'),controller['addTags']);router['put'](_0xc740('0x10'),auth['isAuthenticated'](),interaction[_0xc740('0x11')](_0xc740('0x12'),'mailinteraction:update'),controller[_0xc740('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0xc740('0x11')](_0xc740('0x12'),'mailinteraction:destroy'),controller[_0xc740('0x14')]);router[_0xc740('0x15')]('/:id/tags',auth[_0xc740('0x5')](),controller[_0xc740('0x16')]);module[_0xc740('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index f71a793..ec6e25a 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 _0xa26d=['BOOLEAN','ENUM','out','sequelize','exports','DATE','STRING','long','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa26d,0x1d7));var _0xda26=function(_0x45b04f,_0x6867c5){_0x45b04f=_0x45b04f-0x0;var _0x1c3707=_0xa26d[_0x45b04f];return _0x1c3707;};'use strict';var Sequelize=require(_0xda26('0x0'));var iconv=require('iconv');module[_0xda26('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xda26('0x2')]},'disposition':{'type':Sequelize[_0xda26('0x3')]},'secondDisposition':{'type':Sequelize[_0xda26('0x3')]},'thirdDisposition':{'type':Sequelize[_0xda26('0x3')]},'note':{'type':Sequelize[_0xda26('0x3')]},'inReplyTo':{'type':Sequelize[_0xda26('0x3')](0x1fe)},'to':{'type':Sequelize[_0xda26('0x3')]},'cc':{'type':Sequelize['TEXT'](_0xda26('0x4'))},'subject':{'type':Sequelize[_0xda26('0x5')]()},'attach':{'type':Sequelize[_0xda26('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xda26('0x2')]},'substatus':{'type':Sequelize[_0xda26('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xda26('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xda26('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xda26('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xda26('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xda26('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x4bc3=['long','out','ENUM','sequelize','DATE','STRING','TEXT'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0x4bc3,0x130));var _0x34bc=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x4bc3[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0x34bc('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x34bc('0x1')]},'disposition':{'type':Sequelize[_0x34bc('0x2')]},'secondDisposition':{'type':Sequelize[_0x34bc('0x2')]},'thirdDisposition':{'type':Sequelize[_0x34bc('0x2')]},'note':{'type':Sequelize[_0x34bc('0x2')]},'inReplyTo':{'type':Sequelize[_0x34bc('0x2')](0x1fe)},'to':{'type':Sequelize[_0x34bc('0x2')]},'cc':{'type':Sequelize[_0x34bc('0x3')](_0x34bc('0x4'))},'subject':{'type':Sequelize[_0x34bc('0x3')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x34bc('0x1')]},'substatus':{'type':Sequelize[_0x34bc('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x34bc('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x34bc('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x34bc('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x34bc('0x6')]('in',_0x34bc('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 79b3aa8..49304ba 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 _0x4f0d=['status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','Users','fullname','TagIds','Tags','split','push','MailMessage','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','talking','unmanaged','closed','UserId','answered','index','MailInteraction','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.MailInteractionId','from','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','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','t.id\x20=\x20it.TagId','expr','parseSearch','search','length','conditions','unreadMessages','value','having','`\x20=\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','find','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','replace','isNumeric','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','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.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','all','rows','show','params','includeAll','merge','options','create','body','describe','addMessage','ids','omit','sort','filter','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','inlineCss','true','spread','Tag','emit','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachments','Messages','bcc','subject','createdAt','get','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','build','writeFileSync','download','util','path','lodash','juice','../../components/parsers/advancedSearch','api','../../config/environment','html-entities','redis','defaults','localhost','./mailInteraction.socket'];(function(_0x5ed2d5,_0x34f066){var _0x483e1d=function(_0x25e27d){while(--_0x25e27d){_0x5ed2d5['push'](_0x5ed2d5['shift']());}};_0x483e1d(++_0x34f066);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x4649c4,_0x4c8c1a){_0x4649c4=_0x4649c4-0x0;var _0x4166e2=_0x4f0d[_0x4649c4];return _0x4166e2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xd4f0('0x0'));var path=require(_0xd4f0('0x1'));var fs=require('fs');var _=require(_0xd4f0('0x2'));var squel=require('squel');var juice=require(_0xd4f0('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0xd4f0('0x4'));var logger=require('../../config/logger')(_0xd4f0('0x5'));var config=require(_0xd4f0('0x6'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xd4f0('0x7'));config[_0xd4f0('0x8')]=_[_0xd4f0('0x9')](config[_0xd4f0('0x8')],{'host':_0xd4f0('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd4f0('0x8')]));require(_0xd4f0('0xb'))['register'](socket);function respondWithStatusCode(_0x5225c7,_0x1b59bd){_0x1b59bd=_0x1b59bd||0xcc;return function(_0x3e3bff){if(_0x3e3bff){return _0x5225c7['sendStatus'](_0x1b59bd);}return _0x5225c7[_0xd4f0('0xc')](_0x1b59bd)[_0xd4f0('0xd')]();};}function respondWithResult(_0x20c407,_0x2cd80d){_0x2cd80d=_0x2cd80d||0xc8;return function(_0x333ea5){if(_0x333ea5){return _0x20c407['status'](_0x2cd80d)[_0xd4f0('0xe')](_0x333ea5);}};}function respondWithFilteredResult(_0x2c3e99,_0x53e881){return function(_0x46b4de){if(_0x46b4de){var _0x2fbeab=typeof _0x53e881[_0xd4f0('0xf')]===_0xd4f0('0x10')&&typeof _0x53e881[_0xd4f0('0x11')]===_0xd4f0('0x10');var _0x21eb54=_0x46b4de[_0xd4f0('0x12')];var _0x2dd02d=_0x2fbeab?0x0:_0x53e881['offset'];var _0x5adf8a=_0x2fbeab?_0x46b4de[_0xd4f0('0x12')]:_0x53e881[_0xd4f0('0xf')]+_0x53e881[_0xd4f0('0x11')];var _0x7b2ca4;if(_0x5adf8a>=_0x21eb54){_0x5adf8a=_0x21eb54;_0x7b2ca4=0xc8;}else{_0x7b2ca4=0xce;}_0x2c3e99['status'](_0x7b2ca4);return _0x2c3e99['set'](_0xd4f0('0x13'),_0x2dd02d+'-'+_0x5adf8a+'/'+_0x21eb54)[_0xd4f0('0xe')](_0x46b4de);}return null;};}function saveUpdates(_0xe4318b){return function(_0x2e4351){if(_0x2e4351){return _0x2e4351[_0xd4f0('0x14')](_0xe4318b)[_0xd4f0('0x15')](function(_0x57d418){return _0x57d418;});}return null;};}function removeEntity(_0x149e62){return function(_0x2f0b79){if(_0x2f0b79){return _0x2f0b79[_0xd4f0('0x16')]()['then'](function(){_0x149e62[_0xd4f0('0xc')](0xcc)[_0xd4f0('0xd')]();});}};}function handleEntityNotFound(_0xa16111){return function(_0x49be54){if(!_0x49be54){_0xa16111[_0xd4f0('0x17')](0x194);}return _0x49be54;};}function handleError(_0x31c7a0,_0x655480){_0x655480=_0x655480||0x1f4;return function(_0x5b94bb){logger[_0xd4f0('0x18')](_0x5b94bb[_0xd4f0('0x19')]);if(_0x5b94bb[_0xd4f0('0x1a')]){delete _0x5b94bb[_0xd4f0('0x1a')];}_0x31c7a0['status'](_0x655480)[_0xd4f0('0x1b')](_0x5b94bb);};}function getInteractionUsers(_0x3345c6,_0x9a1fe6){return new BPromise(function(_0x4315be,_0x5f4858){try{if(_0x9a1fe6[_0x3345c6['id']]){_0x3345c6[_0xd4f0('0x1c')]=_['map'](_0x9a1fe6[_0x3345c6['id']],function(_0x15e310){return{'id':_0x15e310['id'],'fullname':_0x15e310[_0xd4f0('0x1d')]};});}}catch(_0x7552ec){_0x5f4858(_0x7552ec);}_0x4315be(_0x3345c6);});}function getInteractionTags(_0x22d385,_0x114c9c){return new BPromise(function(_0x2f4291,_0x1dd584){try{if(_0x22d385[_0xd4f0('0x1e')]){_0x22d385[_0xd4f0('0x1f')]=[];_0x22d385[_0xd4f0('0x1e')][_0xd4f0('0x20')](',')['forEach'](function(_0x13a3c2){_0x22d385[_0xd4f0('0x1f')][_0xd4f0('0x21')](_0x114c9c[_0x13a3c2]);});}delete _0x22d385[_0xd4f0('0x1e')];}catch(_0x54cb05){_0x1dd584(_0x54cb05);}_0x2f4291(_0x22d385);});}function getLastMessageText(_0x427051){return new BPromise(function(_0x27427c,_0x401a5b){return db[_0xd4f0('0x22')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x427051['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd4f0('0x23')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xd4f0('0x24')],'order':_0xd4f0('0x25'),'raw':!![]})[_0xd4f0('0x15')](function(_0x5a560c){if(_0x5a560c&&_0x5a560c[_0xd4f0('0x24')]){_0x427051[_0xd4f0('0x26')]=_[_0xd4f0('0x27')](_0x5a560c[_0xd4f0('0x24')]);}_0x27427c(_0x427051);})[_0xd4f0('0x28')](function(_0xb3b945){_0x401a5b(_0xb3b945);});});}function updateMailInteraction(_0x3eb203,_0x283e1b,_0x177f7c,_0x2ffc3b){return new BPromise(function(_0x2abe9a,_0x48bcc0){return getInteractionUsers(_0x3eb203,_0x177f7c)[_0xd4f0('0x15')](function(_0x1ab407){return getInteractionTags(_0x1ab407,_0x283e1b);})[_0xd4f0('0x15')](function(_0x413af8){return getStateInteraction(_0x413af8);})[_0xd4f0('0x15')](function(_0x5a48a3){if(_0x2ffc3b){_0x2abe9a(getLastMessageText(_0x5a48a3));}else{_0x2abe9a(_0x5a48a3);}})[_0xd4f0('0x28')](function(_0x46e74d){_0x48bcc0(_0x46e74d);});});}function getStateInteraction(_0x515aad){return new BPromise(function(_0x431118){_0x515aad[_0xd4f0('0x29')]=0x0;_0x515aad[_0xd4f0('0x2a')]=0x0;_0x515aad['answered']=0x0;_0x515aad[_0xd4f0('0x2b')]=0x0;_0x515aad['total']=0x0;if(!_0x515aad['closed']&&!_0x515aad['UserId']){_0x515aad[_0xd4f0('0x29')]+=0x1;}if(!_0x515aad[_0xd4f0('0x2c')]&&_0x515aad[_0xd4f0('0x2d')]){_0x515aad[_0xd4f0('0x2a')]+=0x1;if(_0x515aad[_0xd4f0('0x29')]){_0x515aad['waiting']-=0x1;}}if(_0x515aad['closed']&&_0x515aad[_0xd4f0('0x2d')]){_0x515aad[_0xd4f0('0x2e')]+=0x1;if(_0x515aad[_0xd4f0('0x2a')]){_0x515aad['talking']-=0x1;}}if(_0x515aad[_0xd4f0('0x2c')]&&!_0x515aad[_0xd4f0('0x2d')]){_0x515aad[_0xd4f0('0x2b')]+=0x1;if(_0x515aad['waiting']){_0x515aad[_0xd4f0('0x29')]-=0x1;}}_0x515aad['total']+=0x1;_0x431118(_0x515aad);});}exports[_0xd4f0('0x2f')]=function(_0x301a85,_0x108c4e){var _0x33f303={},_0x1c61d3={},_0x17e564={'count':0x0,'rows':[]};var _0x50904e=_['map'](db[_0xd4f0('0x30')][_0xd4f0('0x31')],function(_0x4bad3c){return{'name':_0x4bad3c[_0xd4f0('0x32')],'type':_0x4bad3c[_0xd4f0('0x33')][_0xd4f0('0x34')]};});_0x1c61d3[_0xd4f0('0x35')]=_[_0xd4f0('0x36')](_0x50904e,_0xd4f0('0x1a'));_0x1c61d3['query']=_[_0xd4f0('0x37')](_0x301a85[_0xd4f0('0x38')]);_0x1c61d3[_0xd4f0('0x39')]=_[_0xd4f0('0x3a')](_0x1c61d3[_0xd4f0('0x35')],_0x1c61d3[_0xd4f0('0x38')]);_0x33f303['attributes']=_[_0xd4f0('0x3a')](_0x1c61d3[_0xd4f0('0x35')],qs['fields'](_0x301a85['query'][_0xd4f0('0x3b')]));_0x33f303[_0xd4f0('0x3c')]=_0x33f303[_0xd4f0('0x3c')]['length']?_0x33f303['attributes']:_0x1c61d3[_0xd4f0('0x35')];if(!_0x301a85[_0xd4f0('0x38')][_0xd4f0('0x3d')](_0xd4f0('0x3e'))){_0x33f303[_0xd4f0('0x11')]=qs[_0xd4f0('0x11')](_0x301a85[_0xd4f0('0x38')][_0xd4f0('0x11')]);_0x33f303[_0xd4f0('0xf')]=qs[_0xd4f0('0xf')](_0x301a85[_0xd4f0('0x38')][_0xd4f0('0xf')]);}_0x33f303[_0xd4f0('0x3f')]=qs['sort'](_0x301a85[_0xd4f0('0x38')]['sort']);_0x33f303[_0xd4f0('0x40')]=qs['filters'](_[_0xd4f0('0x41')](_0x301a85[_0xd4f0('0x38')],_0x1c61d3[_0xd4f0('0x39')]),_0x50904e);var _0x4d07c1=[];var _0x109307=squel[_0xd4f0('0x42')]()['field']('id')[_0xd4f0('0x43')]('name')[_0xd4f0('0x43')](_0xd4f0('0x44'))['from'](_0xd4f0('0x45'));var _0x373762=squel[_0xd4f0('0x42')]()[_0xd4f0('0x43')](_0xd4f0('0x46'))[_0xd4f0('0x43')](_0xd4f0('0x47'))[_0xd4f0('0x43')](_0xd4f0('0x48'))[_0xd4f0('0x49')](_0xd4f0('0x4a'),'ui')[_0xd4f0('0x4b')]('users','u',_0xd4f0('0x4c'));var _0x3cb364=squel[_0xd4f0('0x42')]()[_0xd4f0('0x49')](_0xd4f0('0x4d'),'i')['left_join'](_0xd4f0('0x4e'),'c',_0xd4f0('0x4f'))[_0xd4f0('0x4b')](_0xd4f0('0x50'),'o',_0xd4f0('0x51'))[_0xd4f0('0x4b')](_0xd4f0('0x52'),'a',_0xd4f0('0x53'))[_0xd4f0('0x4b')](_0xd4f0('0x54'),'me',_0xd4f0('0x55'))[_0xd4f0('0x4b')](_0xd4f0('0x56'),'it',_0xd4f0('0x57'))[_0xd4f0('0x4b')]('tools_tags','t',_0xd4f0('0x58'));var _0x4e3b6f=squel[_0xd4f0('0x59')]();var _0x1d42d1=[];var _0x21a936=squel['expr']();var _0x3b5237;if(_0x301a85[_0xd4f0('0x38')]['search']){_0x3b5237=as[_0xd4f0('0x5a')](_0x301a85[_0xd4f0('0x38')][_0xd4f0('0x5b')]);var _0x3afe0b=_0x3b5237['sqlOperator'];for(var _0x1505ac=0x0;_0x1505ac<_0x3b5237['conditions'][_0xd4f0('0x5c')];_0x1505ac++){var _0x2bdfa0=_0x3b5237[_0xd4f0('0x5d')][_0x1505ac];var _0x2b2266='i';var _0x2c9478=_['find'](_0x50904e,['name',_0x2bdfa0[_0xd4f0('0x43')]]);if(!_0x2c9478){switch(_0x2bdfa0[_0xd4f0('0x43')]){case _0xd4f0('0x5e'):if(_0x2bdfa0[_0xd4f0('0x5f')]==0x1){_0x3cb364[_0xd4f0('0x60')]('`'+_0x2bdfa0[_0xd4f0('0x43')]+_0xd4f0('0x61'));}else{_0x3cb364[_0xd4f0('0x60')]('`'+_0x2bdfa0[_0xd4f0('0x43')]+'`\x20>\x200');}break;case _0xd4f0('0x62'):if(_0x2bdfa0[_0xd4f0('0x63')]==='$substring'){if(_0x2bdfa0[_0xd4f0('0x5f')][_0xd4f0('0x20')]('\x20')[_0xd4f0('0x5c')]>0x1){_0x4e3b6f[_0x3afe0b](_0xd4f0('0x64'),qs['getFullTextValue'](_0x2bdfa0['value']),null);}else{var _0x461626='%'+_0x2bdfa0[_0xd4f0('0x5f')]+'%';_0x4e3b6f[_0x3afe0b]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x461626,_0x461626,_0x461626);}}else{_0x2c9478=_['find'](_0x50904e,[_0xd4f0('0x1a'),_0xd4f0('0x65')]);_0x2bdfa0[_0xd4f0('0x43')]='ContactId';_0x203e43=as[_0xd4f0('0x66')](_0x2b2266,_0x2c9478[_0xd4f0('0x33')],_0x2bdfa0);_0x4e3b6f[_0x3afe0b](_0x203e43[_0xd4f0('0x67')],_0x203e43[_0xd4f0('0x5f')]['start'],_0x203e43['value'][_0xd4f0('0xd')]);}break;case'Tag':var _0x680ba9=_0x2bdfa0['value'][_0xd4f0('0x20')](',')[_0xd4f0('0x36')](function(_0x5a333c){return Number(_0x5a333c);});_0x680ba9[_0xd4f0('0x68')](function(_0x42c0e9){_0x21a936['or'](_0xd4f0('0x69'),'%,'+_0x42c0e9+',%');});_0x1d42d1=_[_0xd4f0('0x6a')](_0x1d42d1,_0x680ba9);break;case _0xd4f0('0x6b'):if(_0x2bdfa0[_0xd4f0('0x63')]===_0xd4f0('0x6c')){_0x4e3b6f[_0x3afe0b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2bdfa0['value']+'%',null);}else{_0x2c9478=_[_0xd4f0('0x6d')](_0x50904e,[_0xd4f0('0x1a'),'UserId']);_0x2bdfa0[_0xd4f0('0x43')]='UserId';_0x203e43=as[_0xd4f0('0x66')](_0x2b2266,_0x2c9478[_0xd4f0('0x33')],_0x2bdfa0);_0x4e3b6f[_0x3afe0b](_0x203e43[_0xd4f0('0x67')],_0x203e43[_0xd4f0('0x5f')][_0xd4f0('0x6e')],_0x203e43[_0xd4f0('0x5f')][_0xd4f0('0xd')]);}break;case'plainBody':_0x203e43=as[_0xd4f0('0x66')]('me',null,_0x2bdfa0);_0x4e3b6f[_0x3afe0b](_0x203e43['text'],_0x203e43[_0xd4f0('0x5f')][_0xd4f0('0x6e')],_0x203e43[_0xd4f0('0x5f')][_0xd4f0('0xd')]);break;}}else{var _0x203e43=as['buildExpression'](_0x2b2266,_0x2c9478[_0xd4f0('0x33')],_0x2bdfa0);_0x4e3b6f[_0x3afe0b](_0x203e43['text'],_0x203e43[_0xd4f0('0x5f')][_0xd4f0('0x6e')],_0x203e43['value'][_0xd4f0('0xd')]);}}}else{var _0x45427c=_(_0x301a85['query'])[_0xd4f0('0x37')]()[_0xd4f0('0x36')](function(_0x6217bd){return _[_0xd4f0('0x6f')](_0x50904e,[_0xd4f0('0x1a'),_0x6217bd])?_0x6217bd:undefined;})[_0xd4f0('0x70')]()['value']();if(!_[_0xd4f0('0x71')](_0x45427c)){_0x45427c[_0xd4f0('0x68')](function(_0x43357b){if(_0x43357b==='MailAccountId'){_0x3cb364[_0xd4f0('0x40')](_0xd4f0('0x72'),[][_0xd4f0('0x73')](_0x301a85[_0xd4f0('0x38')][_0x43357b]));}else if(_0x43357b==='createdAt'){var _0x53d7cf=JSON[_0xd4f0('0x74')](_0x301a85['query'][_0x43357b])[_0xd4f0('0x75')];var _0x5d3d41=JSON[_0xd4f0('0x74')](_0x301a85[_0xd4f0('0x38')][_0x43357b])[_0xd4f0('0x76')];_0x3cb364[_0xd4f0('0x40')](_0xd4f0('0x77'),_0x53d7cf,_0x5d3d41);}else{if(_0x301a85[_0xd4f0('0x38')][_0x43357b]===_0xd4f0('0x78')){_0x3cb364[_0xd4f0('0x40')]('i.'+_0x43357b+_0xd4f0('0x79'));}else{_0x3cb364[_0xd4f0('0x40')]('i.'+_0x43357b+'\x20=\x20?',_0x301a85['query'][_0x43357b]);}}});}if(_0x301a85[_0xd4f0('0x38')][_0xd4f0('0x7a')]){if(_0x301a85[_0xd4f0('0x38')][_0xd4f0('0x7a')]==0x1){_0x3cb364['having'](_0xd4f0('0x7b'));}else{_0x3cb364['having']('`unreadMessages`\x20>\x200');}}if(_0x301a85['query'][_0xd4f0('0x7c')]){_0x1d42d1=_[_0xd4f0('0x7d')](_0x301a85['query'][_0xd4f0('0x7c')])?_0x301a85[_0xd4f0('0x38')][_0xd4f0('0x7c')]:new Array(_0x301a85[_0xd4f0('0x38')][_0xd4f0('0x7c')]);_0x1d42d1[_0xd4f0('0x68')](function(_0x2f680f){_0x21a936['or'](_0xd4f0('0x69'),'%,'+_0x2f680f+',%');});}if(_0x301a85[_0xd4f0('0x38')]['filter']){var _0x403d3b=_0x301a85[_0xd4f0('0x38')]['filter'][_0xd4f0('0x7e')]('\x5c','\x5c\x5c')[_0xd4f0('0x7e')](/'/g,'\x27\x27');if(qs[_0xd4f0('0x7f')](_0x403d3b)){_0x4e3b6f['or']('i.id\x20LIKE\x20?',_0x403d3b+'%');}else if(qs[_0xd4f0('0x80')](_0x403d3b)){_0x4e3b6f['or'](_0xd4f0('0x81'),_0x403d3b+'%');}else{_0x4e3b6f['or'](_0xd4f0('0x82'),qs[_0xd4f0('0x83')](_0x403d3b))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd4f0('0x83')](_0x403d3b));}}}_0x3cb364[_0xd4f0('0x40')](_0x4e3b6f);_0x3cb364[_0xd4f0('0x84')](_0xd4f0('0x85'));var _0x166c47={'type':db['Sequelize']['QueryTypes'][_0xd4f0('0x86')],'raw':!![]};var _0x1a6650=_0x3cb364[_0xd4f0('0x87')]();_0x1a6650[_0xd4f0('0x43')]('i.id');_0x1a6650[_0xd4f0('0x43')](_0xd4f0('0x88'),_0xd4f0('0x5e'));if(_0x33f303[_0xd4f0('0x3f')]){_0x33f303['order'][_0xd4f0('0x68')](function(_0x4829b7){var _0x34c967=_0x4829b7[0x0]===_0xd4f0('0x89')?_0x4829b7[0x0]:'i.'+_0x4829b7[0x0];_0x3cb364[_0xd4f0('0x3f')](_0x34c967,_0x4829b7[0x1]===_0xd4f0('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x1d42d1)){_0x3cb364[_0xd4f0('0x60')](_0x21a936);_0x1a6650[_0xd4f0('0x40')](_0xd4f0('0x8b'),_0x1d42d1);}BPromise[_0xd4f0('0x8c')]()[_0xd4f0('0x15')](function(){if(!_0x3b5237){if(_0x301a85['query'][_0xd4f0('0x8d')])return;_0x1a6650[_0xd4f0('0x40')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x3cb364[_0xd4f0('0x40')](_0xd4f0('0x8e'));return;}if(_0x301a85[_0xd4f0('0x8f')][_0xd4f0('0x90')]!==_0xd4f0('0x91'))return;return _0x301a85['user'][_0xd4f0('0x92')]({'attributes':['id'],'raw':!![]})[_0xd4f0('0x15')](function(_0x14becf){if(_[_0xd4f0('0x71')](_0x14becf)){_0x1a6650[_0xd4f0('0x40')](_0xd4f0('0x93'));_0x3cb364[_0xd4f0('0x40')]('i.MailAccountId\x20IS\x20NULL');}else{_0x1a6650[_0xd4f0('0x40')](_0xd4f0('0x72'),_[_0xd4f0('0x36')](_0x14becf,'id'));_0x3cb364[_0xd4f0('0x40')](_0xd4f0('0x72'),_[_0xd4f0('0x36')](_0x14becf,'id'));}});})['then'](function(){if(_0x301a85['user'][_0xd4f0('0x90')]===_0xd4f0('0x91')&&!_0x3b5237&&!_0x301a85[_0xd4f0('0x38')][_0xd4f0('0x8d')])return[];return db[_0xd4f0('0x94')][_0xd4f0('0x38')](_0x1a6650[_0xd4f0('0x95')](),_0x166c47);})[_0xd4f0('0x15')](function(_0x5cd947){_0x17e564[_0xd4f0('0x12')]=_0x5cd947[_0xd4f0('0x5c')];if(_0x17e564['count']===0x0)return[];return db[_0xd4f0('0x94')]['query'](_0x109307[_0xd4f0('0x95')](),_0x166c47)['then'](function(_0x3fa381){_0x4d07c1=_[_0xd4f0('0x96')](_0x3fa381,'id');_0x166c47=_['merge'](_0x166c47,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x301a85[_0xd4f0('0x38')]['fields']){_0x33f303[_0xd4f0('0x3c')]['forEach'](function(_0x2fdb8d){_0x3cb364[_0xd4f0('0x43')]('i.'+_0x2fdb8d);});}else{_0x3cb364['field'](_0xd4f0('0x88'),_0xd4f0('0x5e'));_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0x97'),_0xd4f0('0x98'));_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0x99'),_0xd4f0('0x9a'));_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0x9b'),_0xd4f0('0x89'));_0x3cb364['field'](_0xd4f0('0x85'));_0x3cb364['field']('i.createdAt');_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0x9c'));_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0x9d'));_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0x9e'));_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0x9f'));_0x3cb364[_0xd4f0('0x43')]('i.lastMsgAt');_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0xa0'));_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0xa1'));_0x3cb364['field'](_0xd4f0('0xa2'));_0x3cb364[_0xd4f0('0x43')]('i.secondDisposition');_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0xa3'));_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0xa4'));_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0xa5'));_0x3cb364[_0xd4f0('0x43')]('i.ContactId');_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0xa6'));_0x3cb364[_0xd4f0('0x43')]('i.UserId');_0x3cb364[_0xd4f0('0x43')]('c.firstName',_0xd4f0('0xa7'));_0x3cb364['field'](_0xd4f0('0xa8'),'Contact.lastName');_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0xa9'),'Contact.email');_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0xaa'),_0xd4f0('0xab'));_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0xac'),'Contact.mobile');_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0xad'),_0xd4f0('0xae'));_0x3cb364['field'](_0xd4f0('0xaf'),_0xd4f0('0xb0'));_0x3cb364['field']('o.internal',_0xd4f0('0xb1'));_0x3cb364[_0xd4f0('0x43')](_0xd4f0('0xb2'),_0xd4f0('0x1e'));}if(_0x33f303['limit'])_0x3cb364[_0xd4f0('0x11')](_0x33f303[_0xd4f0('0x11')]);if(_0x33f303[_0xd4f0('0xf')])_0x3cb364[_0xd4f0('0xf')](_0x33f303['offset']);return db[_0xd4f0('0x94')][_0xd4f0('0x38')](_0x3cb364[_0xd4f0('0x95')](),_0x166c47);})['then'](function(_0x43eeec){if(_0x43eeec['length']>0x0)_0x373762[_0xd4f0('0x40')](_0xd4f0('0xb3'),_[_0xd4f0('0x36')](_0x43eeec,'id'));return db[_0xd4f0('0x94')][_0xd4f0('0x38')](_0x373762[_0xd4f0('0x95')](),_0x166c47)[_0xd4f0('0x15')](function(_0x455904){var _0x13da81=_[_0xd4f0('0xb4')](_0x455904,_0xd4f0('0xb5'));var _0x1bb6f0=[];return db[_0xd4f0('0xb6')][_0xd4f0('0xb7')]({'attributes':[_0xd4f0('0xb8')],'raw':!![]})[_0xd4f0('0x15')](function(_0x5448a3){var _0x1b02fc=_0x5448a3[_0xd4f0('0xb8')];_0x43eeec[_0xd4f0('0x68')](function(_0x5cd908){_0x1bb6f0['push'](updateMailInteraction(_0x5cd908,_0x4d07c1,_0x13da81,_0x1b02fc));});return BPromise[_0xd4f0('0xb9')](_0x1bb6f0);});});});})['then'](function(_0x15b2e2){_0x17e564[_0xd4f0('0xba')]=_0x15b2e2;return _0x17e564;})[_0xd4f0('0x15')](respondWithFilteredResult(_0x108c4e,_0x33f303))['catch'](handleError(_0x108c4e,null));};exports[_0xd4f0('0xbb')]=function(_0x1dc125,_0xc3a627){var _0x2545fd={'raw':![],'where':{'id':_0x1dc125[_0xd4f0('0xbc')]['id']}},_0x354ed4={};_0x354ed4[_0xd4f0('0x35')]=_[_0xd4f0('0x37')](db[_0xd4f0('0x30')][_0xd4f0('0x31')]);_0x354ed4[_0xd4f0('0x38')]=_[_0xd4f0('0x37')](_0x1dc125['query']);_0x354ed4[_0xd4f0('0x39')]=_['intersection'](_0x354ed4[_0xd4f0('0x35')],_0x354ed4[_0xd4f0('0x38')]);_0x2545fd['attributes']=_[_0xd4f0('0x3a')](_0x354ed4[_0xd4f0('0x35')],qs[_0xd4f0('0x3b')](_0x1dc125[_0xd4f0('0x38')]['fields']));_0x2545fd[_0xd4f0('0x3c')]=_0x2545fd[_0xd4f0('0x3c')][_0xd4f0('0x5c')]?_0x2545fd[_0xd4f0('0x3c')]:_0x354ed4[_0xd4f0('0x35')];if(_0x1dc125[_0xd4f0('0x38')][_0xd4f0('0xbd')]){_0x2545fd['include']=[{'all':!![]}];}_0x2545fd=_[_0xd4f0('0xbe')]({},_0x2545fd,_0x1dc125[_0xd4f0('0xbf')]);return db[_0xd4f0('0x30')][_0xd4f0('0x6d')](_0x2545fd)[_0xd4f0('0x15')](handleEntityNotFound(_0xc3a627,null))[_0xd4f0('0x15')](respondWithResult(_0xc3a627,null))[_0xd4f0('0x28')](handleError(_0xc3a627,null));};exports[_0xd4f0('0xc0')]=function(_0x15354e,_0x535c11){return db[_0xd4f0('0x30')]['create'](_0x15354e[_0xd4f0('0xc1')],{})[_0xd4f0('0x15')](respondWithResult(_0x535c11,0xc9))[_0xd4f0('0x28')](handleError(_0x535c11,null));};exports[_0xd4f0('0x14')]=function(_0x44f54e,_0x3395bb){if(_0x44f54e[_0xd4f0('0xc1')]['id']){delete _0x44f54e[_0xd4f0('0xc1')]['id'];}return db[_0xd4f0('0x30')][_0xd4f0('0x6d')]({'where':{'id':_0x44f54e[_0xd4f0('0xbc')]['id']}})[_0xd4f0('0x15')](handleEntityNotFound(_0x3395bb,null))[_0xd4f0('0x15')](saveUpdates(_0x44f54e['body'],null))[_0xd4f0('0x15')](respondWithResult(_0x3395bb,null))[_0xd4f0('0x28')](handleError(_0x3395bb,null));};exports['destroy']=function(_0x3540ba,_0x5904d4){return db[_0xd4f0('0x30')]['find']({'where':{'id':_0x3540ba['params']['id']}})['then'](handleEntityNotFound(_0x5904d4,null))[_0xd4f0('0x15')](removeEntity(_0x5904d4,null))['catch'](handleError(_0x5904d4,null));};exports[_0xd4f0('0xc2')]=function(_0x491c7e,_0x5afc58){return db['MailInteraction']['describe']()['then'](respondWithResult(_0x5afc58,null))[_0xd4f0('0x28')](handleError(_0x5afc58,null));};exports[_0xd4f0('0xc3')]=function(_0x3618e2,_0x2b905d){return db[_0xd4f0('0x22')][_0xd4f0('0x6d')]({'where':{'id':_0x3618e2[_0xd4f0('0xbc')]['id']}})[_0xd4f0('0x15')](handleEntityNotFound(_0x2b905d,null))[_0xd4f0('0x15')](function(_0x320938){if(_0x320938){return _0x320938['addMessage'](_0x3618e2[_0xd4f0('0xc1')][_0xd4f0('0xc4')],_[_0xd4f0('0xc5')](_0x3618e2[_0xd4f0('0xc1')],[_0xd4f0('0xc4'),'id'])||{});}})[_0xd4f0('0x15')](respondWithResult(_0x2b905d,null))[_0xd4f0('0x28')](handleError(_0x2b905d,null));};exports['getMessages']=function(_0x4c6fb8,_0x524e65){var _0x182fc8={'raw':![],'where':{}};var _0x56ad71={};var _0x97d11e={'count':0x0,'rows':[]};return db[_0xd4f0('0x30')][_0xd4f0('0xb7')]({'where':{'id':_0x4c6fb8['params']['id']}})[_0xd4f0('0x15')](handleEntityNotFound(_0x524e65,null))[_0xd4f0('0x15')](function(_0x3d3064){if(_0x3d3064){_0x56ad71[_0xd4f0('0x35')]=_[_0xd4f0('0x37')](db[_0xd4f0('0x22')]['rawAttributes']);_0x56ad71['query']=_['keys'](_0x4c6fb8[_0xd4f0('0x38')]);_0x56ad71[_0xd4f0('0x39')]=_[_0xd4f0('0x3a')](_0x56ad71['model'],_0x56ad71[_0xd4f0('0x38')]);_0x182fc8[_0xd4f0('0x3c')]=_[_0xd4f0('0x3a')](_0x56ad71[_0xd4f0('0x35')],qs[_0xd4f0('0x3b')](_0x4c6fb8['query']['fields']));_0x182fc8['attributes']=_0x182fc8[_0xd4f0('0x3c')][_0xd4f0('0x5c')]?_0x182fc8[_0xd4f0('0x3c')]:_0x56ad71[_0xd4f0('0x35')];if(!_0x4c6fb8[_0xd4f0('0x38')][_0xd4f0('0x3d')](_0xd4f0('0x3e'))){_0x182fc8[_0xd4f0('0x11')]=qs[_0xd4f0('0x11')](_0x4c6fb8['query'][_0xd4f0('0x11')]);_0x182fc8[_0xd4f0('0xf')]=qs[_0xd4f0('0xf')](_0x4c6fb8[_0xd4f0('0x38')][_0xd4f0('0xf')]);}_0x182fc8[_0xd4f0('0x3f')]=qs[_0xd4f0('0xc6')](_0x4c6fb8[_0xd4f0('0x38')]['sort']);_0x182fc8[_0xd4f0('0x40')]=qs[_0xd4f0('0x39')](_[_0xd4f0('0x41')](_0x4c6fb8[_0xd4f0('0x38')],_0x56ad71[_0xd4f0('0x39')]));_0x182fc8[_0xd4f0('0x40')][_0xd4f0('0xb5')]=_0x3d3064['id'];if(_0x4c6fb8['query']['filter']){_0x182fc8['where']=_['merge'](_0x182fc8[_0xd4f0('0x40')],{'$or':_['map'](_0x182fc8[_0xd4f0('0x3c')],function(_0x205a43){var _0x55547b={};_0x55547b[_0x205a43]={'$like':'%'+_0x4c6fb8[_0xd4f0('0x38')][_0xd4f0('0xc7')]+'%'};return _0x55547b;})});}if(_0x4c6fb8[_0xd4f0('0x38')][_0xd4f0('0x75')]){var _0x2fd1cb=_0x4c6fb8[_0xd4f0('0x38')][_0xd4f0('0x75')][_0xd4f0('0x20')](',');var _0x59f5cd={};_0x59f5cd[_0x2fd1cb[0x0]]={'$gte':moment(_0x2fd1cb[0x1])[_0xd4f0('0xc8')](_0xd4f0('0xc9'))};_0x182fc8[_0xd4f0('0x40')]=_['merge'](_0x182fc8[_0xd4f0('0x40')],_0x59f5cd);}_0x182fc8=_[_0xd4f0('0xbe')]({},_0x182fc8,_0x4c6fb8['options']);return db[_0xd4f0('0x22')][_0xd4f0('0x12')]({'where':_0x182fc8['where']})[_0xd4f0('0x15')](function(_0x17dded){_0x97d11e[_0xd4f0('0x12')]=_0x17dded;if(_0x4c6fb8[_0xd4f0('0x38')]['includeAll']){_0x182fc8[_0xd4f0('0xca')]=[{'all':!![]}];}return db[_0xd4f0('0x22')][_0xd4f0('0xcb')](_0x182fc8);})[_0xd4f0('0x15')](function(_0x465053){if(_0x4c6fb8[_0xd4f0('0x38')][_0xd4f0('0xcc')]===_0xd4f0('0xcd')){for(var _0x5d1ba9=0x0;_0x5d1ba9<_0x465053[_0xd4f0('0x5c')];_0x5d1ba9++){_0x465053[_0x5d1ba9][_0xd4f0('0xc1')]=juice(_0x465053[_0x5d1ba9][_0xd4f0('0xc1')]);}}_0x97d11e[_0xd4f0('0xba')]=_0x465053;return _0x97d11e;});}})['then'](respondWithFilteredResult(_0x524e65,_0x182fc8))['catch'](handleError(_0x524e65,null));};exports['addTags']=function(_0x18cbaa,_0x176a8d){return db['MailInteraction'][_0xd4f0('0x6d')]({'where':{'id':_0x18cbaa[_0xd4f0('0xbc')]['id']}})[_0xd4f0('0x15')](handleEntityNotFound(_0x176a8d,null))['then'](function(_0x2baa4f){if(_0x2baa4f){return _0x2baa4f['setTags'](_0x18cbaa[_0xd4f0('0xc1')][_0xd4f0('0xc4')],_[_0xd4f0('0xc5')](_0x18cbaa[_0xd4f0('0xc1')],[_0xd4f0('0xc4'),'id'])||{})[_0xd4f0('0xce')](function(){return db[_0xd4f0('0xcf')]['findAll']({'attributes':['id',_0xd4f0('0x1a'),_0xd4f0('0x44')],'where':{'id':_0x18cbaa[_0xd4f0('0xc1')][_0xd4f0('0xc4')]}});})[_0xd4f0('0x15')](function(_0x552474){socket[_0xd4f0('0xd0')]('mailInteractionTags:save',{'id':Number(_0x18cbaa[_0xd4f0('0xbc')]['id']),'tags':_0x552474||[]});return{'id':Number(_0x18cbaa[_0xd4f0('0xbc')]['id']),'tags':_0x552474||[]};});}})['then'](respondWithResult(_0x176a8d,null))[_0xd4f0('0x28')](handleError(_0x176a8d,null));};exports[_0xd4f0('0xd1')]=function(_0xd3f8d5,_0x465f55){return db[_0xd4f0('0x30')][_0xd4f0('0x6d')]({'where':{'id':_0xd3f8d5[_0xd4f0('0xbc')]['id']}})[_0xd4f0('0x15')](handleEntityNotFound(_0x465f55,null))[_0xd4f0('0x15')](function(_0x26450e){if(_0x26450e){return _0x26450e[_0xd4f0('0xd1')](_0xd3f8d5['query'][_0xd4f0('0xc4')]);}})[_0xd4f0('0x15')](respondWithStatusCode(_0x465f55,null))['catch'](handleError(_0x465f55,null));};exports['download']=function(_0x3bd6a0,_0x35a19b){var _0x2d7754=moment()[_0xd4f0('0xd2')]()[_0xd4f0('0x95')]();var _0x7ebea1=path[_0xd4f0('0xd3')](config[_0xd4f0('0xd4')],_0xd4f0('0xd5'),'files','tmp');var _0x1a3124=path['join'](config[_0xd4f0('0xd4')],_0xd4f0('0xd5'),_0xd4f0('0xd6'),_0xd4f0('0xd7'));var _0x3a236c=path[_0xd4f0('0xd3')](_0x7ebea1,_0x2d7754);var _0x1e56ea=util[_0xd4f0('0xc8')](_0xd4f0('0xd8'),_0x3bd6a0['params']['id'],_0x2d7754);var _0x71e2fd=path[_0xd4f0('0xd3')](_0x7ebea1,_0x1e56ea);var _0x5517eb=[];if(_0x3bd6a0[_0xd4f0('0x38')][_0xd4f0('0xd7')]){_0x5517eb['push']({'model':db['Attachment'],'as':_0xd4f0('0xd9'),'raw':!![]});}var _0x234453=[{'model':db[_0xd4f0('0x22')],'as':_0xd4f0('0xda'),'attributes':['id',_0xd4f0('0xc1'),_0xd4f0('0x49'),'to','cc',_0xd4f0('0xdb'),_0xd4f0('0xdc'),_0xd4f0('0xdd')],'where':{'secret':![]},'order':qs[_0xd4f0('0xc6')]('id'),'include':_0x5517eb}];return db[_0xd4f0('0x30')][_0xd4f0('0x6d')]({'where':{'id':_0x3bd6a0[_0xd4f0('0xbc')]['id']},'include':_0x234453})[_0xd4f0('0x15')](handleEntityNotFound(_0x35a19b,null))[_0xd4f0('0x15')](function(_0x3dd2bf){if(_0x3dd2bf&&_0x3dd2bf[_0xd4f0('0xda')]){var _0x414af0=_0x3dd2bf[_0xd4f0('0xde')]({'plain':!![]});fs['mkdirSync'](_0x3a236c);return BPromise['each'](_0x414af0[_0xd4f0('0xda')],function(_0x21cd76,_0x23d7e6){var _0x4f6370={'from':_0x21cd76['from'],'to':_0x21cd76['to'],'subject':_0x21cd76['subject'],'html':htmlEntities[_0xd4f0('0xdf')](_0x21cd76[_0xd4f0('0xc1')]),'headers':{'Date':moment(_0x21cd76[_0xd4f0('0xdd')])[_0xd4f0('0xc8')](_0xd4f0('0xe0'))},'attachments':[]};if(_0x21cd76['cc']){_0x4f6370[_0xd4f0('0xe1')]['Cc']=_0x21cd76['cc'];}if(_0x21cd76[_0xd4f0('0xdb')]){_0x4f6370[_0xd4f0('0xe1')]['Bcc']=_0x21cd76['bcc'];}return new BPromise(function(_0x1cff58,_0x49ecf8){if(_0x21cd76['Attachments']){for(var _0x521c86=0x0;_0x521c86<_0x21cd76[_0xd4f0('0xd9')]['length'];_0x521c86++){var _0x32e0cc=_0x21cd76[_0xd4f0('0xd9')][_0x521c86];var _0x444e5b=path[_0xd4f0('0xd3')](_0x1a3124,_0x32e0cc[_0xd4f0('0xe2')]);if(fs[_0xd4f0('0xe3')](_0x444e5b)){_0x4f6370[_0xd4f0('0xd7')][_0xd4f0('0x21')]({'name':_0x32e0cc['name'],'contentType':_0x32e0cc[_0xd4f0('0x33')],'data':fs['readFileSync'](_0x444e5b)});}}}emlformat[_0xd4f0('0xe4')](_0x4f6370,function(_0x4b2bbd,_0x251b79){if(_0x4b2bbd)return _0x49ecf8(_0x4b2bbd);fs[_0xd4f0('0xe5')](path[_0xd4f0('0xd3')](_0x3a236c,util[_0xd4f0('0xc8')]('message%d.eml',_0x23d7e6)),_0x251b79);return _0x1cff58(_0x251b79);});});})[_0xd4f0('0x15')](function(){return new BPromise(function(_0x326fd4,_0x1c1012){zipdir(_0x3a236c,{'saveTo':_0x71e2fd},function(_0x39c3e6,_0x4fd6f2){if(_0x39c3e6)return _0x1c1012(_0x39c3e6);return _0x326fd4(_0x4fd6f2);});})[_0xd4f0('0x15')](function(){return new BPromise(function(_0x4f7193,_0x3309c5){rimraf(_0x3a236c,function(_0x720eb){if(_0x720eb)_0x3309c5(_0x720eb);return _0x4f7193();});});})['then'](function(){return _0x35a19b[_0xd4f0('0xe6')](_0x71e2fd,_0x1e56ea,function(_0x4b4887){if(!_0x4b4887)fs['unlinkSync'](_0x71e2fd);});});});}else{return _0x35a19b[_0xd4f0('0x17')](0xc8);}})[_0xd4f0('0x28')](handleError(_0x35a19b,null));}; \ No newline at end of file +var _0xa6ce=['DESC','isEmpty','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','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','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','MailInteractionId','Setting','enableEmailPreview','all','rows','show','filters','includeAll','create','body','params','destroy','describe','addMessage','MailMessage','ids','omit','getMessages','hasOwnProperty','merge','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','true','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','server','join','root','files','attachments','Attachment','Attachments','Messages','subject','createdAt','get','mkdirSync','each','decode','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','util','path','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','stack','send','Users','fullname','TagIds','Tags','split','forEach','push','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','talking','answered','unmanaged','closed','UserId','total','map','rawAttributes','fieldName','model','name','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','type','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','isNumeric','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)'];(function(_0x15525e,_0x154656){var _0x2f3ad7=function(_0x4075cc){while(--_0x4075cc){_0x15525e['push'](_0x15525e['shift']());}};_0x2f3ad7(++_0x154656);}(_0xa6ce,0x15e));var _0xea6c=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0xa6ce[_0x216d45];return _0xbaac0b;};'use strict';var emlformat=require(_0xea6c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea6c('0x1'));var moment=require(_0xea6c('0x2'));var BPromise=require('bluebird');var util=require(_0xea6c('0x3'));var path=require(_0xea6c('0x4'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var juice=require(_0xea6c('0x5'));var Redis=require(_0xea6c('0x6'));var qs=require(_0xea6c('0x7'));var as=require(_0xea6c('0x8'));var logger=require(_0xea6c('0x9'))(_0xea6c('0xa'));var config=require('../../config/environment');var db=require(_0xea6c('0xb'))['db'];var htmlEntities=require(_0xea6c('0xc'));config[_0xea6c('0xd')]=_[_0xea6c('0xe')](config[_0xea6c('0xd')],{'host':_0xea6c('0xf'),'port':0x18eb});var socket=require(_0xea6c('0x10'))(new Redis(config[_0xea6c('0xd')]));require(_0xea6c('0x11'))[_0xea6c('0x12')](socket);function respondWithStatusCode(_0x2def55,_0xb1e8b5){_0xb1e8b5=_0xb1e8b5||0xcc;return function(_0xfc7a5e){if(_0xfc7a5e){return _0x2def55[_0xea6c('0x13')](_0xb1e8b5);}return _0x2def55['status'](_0xb1e8b5)[_0xea6c('0x14')]();};}function respondWithResult(_0x1b28ac,_0x36c0a8){_0x36c0a8=_0x36c0a8||0xc8;return function(_0x5a7dcd){if(_0x5a7dcd){return _0x1b28ac[_0xea6c('0x15')](_0x36c0a8)[_0xea6c('0x16')](_0x5a7dcd);}};}function respondWithFilteredResult(_0x4db782,_0x3dba01){return function(_0x3a0a37){if(_0x3a0a37){var _0x13fd94=typeof _0x3dba01[_0xea6c('0x17')]===_0xea6c('0x18')&&typeof _0x3dba01[_0xea6c('0x19')]==='undefined';var _0x43cf5b=_0x3a0a37['count'];var _0x25b150=_0x13fd94?0x0:_0x3dba01[_0xea6c('0x17')];var _0x12768a=_0x13fd94?_0x3a0a37[_0xea6c('0x1a')]:_0x3dba01[_0xea6c('0x17')]+_0x3dba01['limit'];var _0x2dbbcb;if(_0x12768a>=_0x43cf5b){_0x12768a=_0x43cf5b;_0x2dbbcb=0xc8;}else{_0x2dbbcb=0xce;}_0x4db782[_0xea6c('0x15')](_0x2dbbcb);return _0x4db782[_0xea6c('0x1b')](_0xea6c('0x1c'),_0x25b150+'-'+_0x12768a+'/'+_0x43cf5b)[_0xea6c('0x16')](_0x3a0a37);}return null;};}function saveUpdates(_0x257707){return function(_0x43a03a){if(_0x43a03a){return _0x43a03a[_0xea6c('0x1d')](_0x257707)[_0xea6c('0x1e')](function(_0x16a6dd){return _0x16a6dd;});}return null;};}function removeEntity(_0x52a322){return function(_0x4043c8){if(_0x4043c8){return _0x4043c8['destroy']()[_0xea6c('0x1e')](function(){_0x52a322['status'](0xcc)[_0xea6c('0x14')]();});}};}function handleEntityNotFound(_0x341139){return function(_0x1d3eca){if(!_0x1d3eca){_0x341139['sendStatus'](0x194);}return _0x1d3eca;};}function handleError(_0x417cfa,_0x371327){_0x371327=_0x371327||0x1f4;return function(_0x499ea6){logger['error'](_0x499ea6[_0xea6c('0x1f')]);if(_0x499ea6['name']){delete _0x499ea6['name'];}_0x417cfa[_0xea6c('0x15')](_0x371327)[_0xea6c('0x20')](_0x499ea6);};}function getInteractionUsers(_0x3e0864,_0x10a229){return new BPromise(function(_0x303303,_0x4fa0ea){try{if(_0x10a229[_0x3e0864['id']]){_0x3e0864[_0xea6c('0x21')]=_['map'](_0x10a229[_0x3e0864['id']],function(_0x5df5e9){return{'id':_0x5df5e9['id'],'fullname':_0x5df5e9[_0xea6c('0x22')]};});}}catch(_0x52953a){_0x4fa0ea(_0x52953a);}_0x303303(_0x3e0864);});}function getInteractionTags(_0x281717,_0x43ca90){return new BPromise(function(_0x4dcd26,_0x269b48){try{if(_0x281717[_0xea6c('0x23')]){_0x281717[_0xea6c('0x24')]=[];_0x281717[_0xea6c('0x23')][_0xea6c('0x25')](',')[_0xea6c('0x26')](function(_0x118385){_0x281717[_0xea6c('0x24')][_0xea6c('0x27')](_0x43ca90[_0x118385]);});}delete _0x281717['TagIds'];}catch(_0x2e076b){_0x269b48(_0x2e076b);}_0x4dcd26(_0x281717);});}function getLastMessageText(_0x408d98){return new BPromise(function(_0x4941fc,_0x559953){return db['MailMessage'][_0xea6c('0x28')]({'where':{'$and':[{'MailInteractionId':_0x408d98['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xea6c('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xea6c('0x2a')],'order':_0xea6c('0x2b'),'raw':!![]})[_0xea6c('0x1e')](function(_0x39fcf5){if(_0x39fcf5&&_0x39fcf5[_0xea6c('0x2a')]){_0x408d98[_0xea6c('0x2c')]=_[_0xea6c('0x2d')](_0x39fcf5['plainBody']);}_0x4941fc(_0x408d98);})[_0xea6c('0x2e')](function(_0xf7b677){_0x559953(_0xf7b677);});});}function updateMailInteraction(_0x439013,_0x321d21,_0x3c5530,_0x37830a){return new BPromise(function(_0x52cf2d,_0xc0c5b9){return getInteractionUsers(_0x439013,_0x3c5530)[_0xea6c('0x1e')](function(_0x4a3332){return getInteractionTags(_0x4a3332,_0x321d21);})[_0xea6c('0x1e')](function(_0x20a333){return getStateInteraction(_0x20a333);})[_0xea6c('0x1e')](function(_0x4ca2a4){if(_0x37830a){_0x52cf2d(getLastMessageText(_0x4ca2a4));}else{_0x52cf2d(_0x4ca2a4);}})['catch'](function(_0x4fa399){_0xc0c5b9(_0x4fa399);});});}function getStateInteraction(_0x50870f){return new BPromise(function(_0x544184){_0x50870f[_0xea6c('0x2f')]=0x0;_0x50870f[_0xea6c('0x30')]=0x0;_0x50870f[_0xea6c('0x31')]=0x0;_0x50870f[_0xea6c('0x32')]=0x0;_0x50870f['total']=0x0;if(!_0x50870f[_0xea6c('0x33')]&&!_0x50870f[_0xea6c('0x34')]){_0x50870f[_0xea6c('0x2f')]+=0x1;}if(!_0x50870f['closed']&&_0x50870f[_0xea6c('0x34')]){_0x50870f[_0xea6c('0x30')]+=0x1;if(_0x50870f['waiting']){_0x50870f[_0xea6c('0x2f')]-=0x1;}}if(_0x50870f[_0xea6c('0x33')]&&_0x50870f[_0xea6c('0x34')]){_0x50870f[_0xea6c('0x31')]+=0x1;if(_0x50870f[_0xea6c('0x30')]){_0x50870f[_0xea6c('0x30')]-=0x1;}}if(_0x50870f[_0xea6c('0x33')]&&!_0x50870f[_0xea6c('0x34')]){_0x50870f[_0xea6c('0x32')]+=0x1;if(_0x50870f[_0xea6c('0x2f')]){_0x50870f[_0xea6c('0x2f')]-=0x1;}}_0x50870f[_0xea6c('0x35')]+=0x1;_0x544184(_0x50870f);});}exports['index']=function(_0x21b561,_0x4af25e){var _0xf8919b={},_0x2cb749={},_0x328934={'count':0x0,'rows':[]};var _0x2f7713=_[_0xea6c('0x36')](db['MailInteraction'][_0xea6c('0x37')],function(_0x15bd0b){return{'name':_0x15bd0b[_0xea6c('0x38')],'type':_0x15bd0b['type']['key']};});_0x2cb749[_0xea6c('0x39')]=_['map'](_0x2f7713,_0xea6c('0x3a'));_0x2cb749[_0xea6c('0x3b')]=_[_0xea6c('0x3c')](_0x21b561[_0xea6c('0x3b')]);_0x2cb749['filters']=_[_0xea6c('0x3d')](_0x2cb749[_0xea6c('0x39')],_0x2cb749[_0xea6c('0x3b')]);_0xf8919b['attributes']=_[_0xea6c('0x3d')](_0x2cb749['model'],qs[_0xea6c('0x3e')](_0x21b561[_0xea6c('0x3b')]['fields']));_0xf8919b[_0xea6c('0x3f')]=_0xf8919b[_0xea6c('0x3f')][_0xea6c('0x40')]?_0xf8919b[_0xea6c('0x3f')]:_0x2cb749[_0xea6c('0x39')];if(!_0x21b561[_0xea6c('0x3b')]['hasOwnProperty'](_0xea6c('0x41'))){_0xf8919b[_0xea6c('0x19')]=qs[_0xea6c('0x19')](_0x21b561[_0xea6c('0x3b')][_0xea6c('0x19')]);_0xf8919b[_0xea6c('0x17')]=qs[_0xea6c('0x17')](_0x21b561[_0xea6c('0x3b')][_0xea6c('0x17')]);}_0xf8919b[_0xea6c('0x42')]=qs[_0xea6c('0x43')](_0x21b561[_0xea6c('0x3b')][_0xea6c('0x43')]);_0xf8919b[_0xea6c('0x44')]=qs['filters'](_[_0xea6c('0x45')](_0x21b561[_0xea6c('0x3b')],_0x2cb749['filters']),_0x2f7713);var _0x54f9f7=[];var _0x280107=squel[_0xea6c('0x46')]()[_0xea6c('0x47')]('id')[_0xea6c('0x47')](_0xea6c('0x3a'))[_0xea6c('0x47')](_0xea6c('0x48'))[_0xea6c('0x49')](_0xea6c('0x4a'));var _0x14f8cc=squel['select']()['field'](_0xea6c('0x4b'))[_0xea6c('0x47')](_0xea6c('0x4c'))['field'](_0xea6c('0x4d'))['from'](_0xea6c('0x4e'),'ui')[_0xea6c('0x4f')](_0xea6c('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x2ca3fb=squel['select']()[_0xea6c('0x49')](_0xea6c('0x51'),'i')[_0xea6c('0x4f')](_0xea6c('0x52'),'c',_0xea6c('0x53'))[_0xea6c('0x4f')](_0xea6c('0x50'),'o',_0xea6c('0x54'))[_0xea6c('0x4f')](_0xea6c('0x55'),'a',_0xea6c('0x56'))[_0xea6c('0x4f')](_0xea6c('0x57'),'me',_0xea6c('0x58'))[_0xea6c('0x4f')](_0xea6c('0x59'),'it',_0xea6c('0x5a'))[_0xea6c('0x4f')](_0xea6c('0x4a'),'t',_0xea6c('0x5b'));var _0x294424=squel['expr']();var _0x503037=[];var _0x2b1616=squel[_0xea6c('0x5c')]();var _0x16c97d;if(_0x21b561[_0xea6c('0x3b')][_0xea6c('0x5d')]){_0x16c97d=as['parseSearch'](_0x21b561[_0xea6c('0x3b')][_0xea6c('0x5d')]);var _0x3ac40c=_0x16c97d[_0xea6c('0x5e')];for(var _0x1abe2a=0x0;_0x1abe2a<_0x16c97d[_0xea6c('0x5f')]['length'];_0x1abe2a++){var _0x9bf57c=_0x16c97d['conditions'][_0x1abe2a];var _0x1dccf1='i';var _0x222d79=_['find'](_0x2f7713,[_0xea6c('0x3a'),_0x9bf57c['field']]);if(!_0x222d79){switch(_0x9bf57c['field']){case _0xea6c('0x60'):if(_0x9bf57c[_0xea6c('0x61')]==0x1){_0x2ca3fb[_0xea6c('0x62')]('`'+_0x9bf57c[_0xea6c('0x47')]+_0xea6c('0x63'));}else{_0x2ca3fb[_0xea6c('0x62')]('`'+_0x9bf57c[_0xea6c('0x47')]+_0xea6c('0x64'));}break;case'Contact':if(_0x9bf57c['operator']==='$substring'){if(_0x9bf57c[_0xea6c('0x61')][_0xea6c('0x25')]('\x20')[_0xea6c('0x40')]>0x1){_0x294424[_0x3ac40c](_0xea6c('0x65'),qs[_0xea6c('0x66')](_0x9bf57c[_0xea6c('0x61')]),null);}else{var _0x5e6646='%'+_0x9bf57c[_0xea6c('0x61')]+'%';_0x294424[_0x3ac40c](_0xea6c('0x67'),_0x5e6646,_0x5e6646,_0x5e6646);}}else{_0x222d79=_[_0xea6c('0x68')](_0x2f7713,[_0xea6c('0x3a'),'ContactId']);_0x9bf57c[_0xea6c('0x47')]=_0xea6c('0x69');_0x39b852=as['buildExpression'](_0x1dccf1,_0x222d79['type'],_0x9bf57c);_0x294424[_0x3ac40c](_0x39b852[_0xea6c('0x6a')],_0x39b852[_0xea6c('0x61')][_0xea6c('0x6b')],_0x39b852[_0xea6c('0x61')][_0xea6c('0x14')]);}break;case _0xea6c('0x6c'):var _0x27b7d5=_0x9bf57c[_0xea6c('0x61')][_0xea6c('0x25')](',')[_0xea6c('0x36')](function(_0x14e9c9){return Number(_0x14e9c9);});_0x27b7d5[_0xea6c('0x26')](function(_0x40ed48){_0x2b1616['or'](_0xea6c('0x6d'),'%,'+_0x40ed48+',%');});_0x503037=_['union'](_0x503037,_0x27b7d5);break;case _0xea6c('0x6e'):if(_0x9bf57c[_0xea6c('0x6f')]==='$substring'){_0x294424[_0x3ac40c](_0xea6c('0x70'),'%'+_0x9bf57c['value']+'%',null);}else{_0x222d79=_[_0xea6c('0x68')](_0x2f7713,['name',_0xea6c('0x34')]);_0x9bf57c['field']=_0xea6c('0x34');_0x39b852=as[_0xea6c('0x71')](_0x1dccf1,_0x222d79['type'],_0x9bf57c);_0x294424[_0x3ac40c](_0x39b852[_0xea6c('0x6a')],_0x39b852['value'][_0xea6c('0x6b')],_0x39b852[_0xea6c('0x61')]['end']);}break;case _0xea6c('0x2a'):_0x39b852=as[_0xea6c('0x71')]('me',null,_0x9bf57c);_0x294424[_0x3ac40c](_0x39b852[_0xea6c('0x6a')],_0x39b852[_0xea6c('0x61')]['start'],_0x39b852[_0xea6c('0x61')][_0xea6c('0x14')]);break;}}else{var _0x39b852=as[_0xea6c('0x71')](_0x1dccf1,_0x222d79[_0xea6c('0x72')],_0x9bf57c);_0x294424[_0x3ac40c](_0x39b852['text'],_0x39b852[_0xea6c('0x61')][_0xea6c('0x6b')],_0x39b852[_0xea6c('0x61')][_0xea6c('0x14')]);}}}else{var _0x3c519b=_(_0x21b561[_0xea6c('0x3b')])['keys']()[_0xea6c('0x36')](function(_0x3afc03){return _[_0xea6c('0x73')](_0x2f7713,[_0xea6c('0x3a'),_0x3afc03])?_0x3afc03:undefined;})[_0xea6c('0x74')]()[_0xea6c('0x61')]();if(!_['isEmpty'](_0x3c519b)){_0x3c519b['forEach'](function(_0x561994){if(_0x561994===_0xea6c('0x75')){_0x2ca3fb[_0xea6c('0x44')](_0xea6c('0x76'),[][_0xea6c('0x77')](_0x21b561[_0xea6c('0x3b')][_0x561994]));}else if(_0x561994==='createdAt'){var _0x3be0a5=JSON[_0xea6c('0x78')](_0x21b561[_0xea6c('0x3b')][_0x561994])[_0xea6c('0x79')];var _0x400e4a=JSON['parse'](_0x21b561[_0xea6c('0x3b')][_0x561994])['$lte'];_0x2ca3fb['where'](_0xea6c('0x7a'),_0x3be0a5,_0x400e4a);}else{if(_0x21b561[_0xea6c('0x3b')][_0x561994]==='null'){_0x2ca3fb['where']('i.'+_0x561994+_0xea6c('0x7b'));}else{_0x2ca3fb['where']('i.'+_0x561994+_0xea6c('0x7c'),_0x21b561[_0xea6c('0x3b')][_0x561994]);}}});}if(_0x21b561['query'][_0xea6c('0x7d')]){if(_0x21b561[_0xea6c('0x3b')][_0xea6c('0x7d')]==0x1){_0x2ca3fb['having'](_0xea6c('0x7e'));}else{_0x2ca3fb[_0xea6c('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x21b561[_0xea6c('0x3b')][_0xea6c('0x7f')]){_0x503037=_[_0xea6c('0x80')](_0x21b561[_0xea6c('0x3b')]['tag'])?_0x21b561['query'][_0xea6c('0x7f')]:new Array(_0x21b561[_0xea6c('0x3b')][_0xea6c('0x7f')]);_0x503037[_0xea6c('0x26')](function(_0x2c4913){_0x2b1616['or'](_0xea6c('0x6d'),'%,'+_0x2c4913+',%');});}if(_0x21b561[_0xea6c('0x3b')][_0xea6c('0x81')]){var _0x564c3e=_0x21b561[_0xea6c('0x3b')][_0xea6c('0x81')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xea6c('0x82')](_0x564c3e)){_0x294424['or']('i.id\x20LIKE\x20?',_0x564c3e+'%');}else if(qs[_0xea6c('0x83')](_0x564c3e)){_0x294424['or'](_0xea6c('0x84'),_0x564c3e+'%');}else{_0x294424['or'](_0xea6c('0x85'),qs[_0xea6c('0x66')](_0x564c3e))['or'](_0xea6c('0x86'),qs[_0xea6c('0x66')](_0x564c3e));}}}_0x2ca3fb['where'](_0x294424);_0x2ca3fb[_0xea6c('0x87')](_0xea6c('0x88'));var _0x255563={'type':db[_0xea6c('0x89')][_0xea6c('0x8a')][_0xea6c('0x8b')],'raw':!![]};var _0x20acc6=_0x2ca3fb[_0xea6c('0x8c')]();_0x20acc6[_0xea6c('0x47')](_0xea6c('0x88'));_0x20acc6[_0xea6c('0x47')](_0xea6c('0x8d'),_0xea6c('0x60'));if(_0xf8919b['order']){_0xf8919b[_0xea6c('0x42')][_0xea6c('0x26')](function(_0x1dc234){var _0x1c1402=_0x1dc234[0x0]==='contactName'?_0x1dc234[0x0]:'i.'+_0x1dc234[0x0];_0x2ca3fb[_0xea6c('0x42')](_0x1c1402,_0x1dc234[0x1]===_0xea6c('0x8e')?![]:!![]);});}if(!_[_0xea6c('0x8f')](_0x503037)){_0x2ca3fb['having'](_0x2b1616);_0x20acc6['where'](_0xea6c('0x90'),_0x503037);}BPromise[_0xea6c('0x91')]()[_0xea6c('0x1e')](function(){if(!_0x16c97d){if(_0x21b561[_0xea6c('0x3b')][_0xea6c('0x75')])return;_0x20acc6[_0xea6c('0x44')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x2ca3fb[_0xea6c('0x44')](_0xea6c('0x92'));return;}if(_0x21b561[_0xea6c('0x93')][_0xea6c('0x94')]!==_0xea6c('0x95'))return;return _0x21b561[_0xea6c('0x93')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xea6c('0x1e')](function(_0x307738){if(_[_0xea6c('0x8f')](_0x307738)){_0x20acc6[_0xea6c('0x44')](_0xea6c('0x96'));_0x2ca3fb[_0xea6c('0x44')]('i.MailAccountId\x20IS\x20NULL');}else{_0x20acc6[_0xea6c('0x44')](_0xea6c('0x76'),_[_0xea6c('0x36')](_0x307738,'id'));_0x2ca3fb['where'](_0xea6c('0x76'),_[_0xea6c('0x36')](_0x307738,'id'));}});})[_0xea6c('0x1e')](function(){if(_0x21b561[_0xea6c('0x93')][_0xea6c('0x94')]===_0xea6c('0x95')&&!_0x16c97d&&!_0x21b561[_0xea6c('0x3b')][_0xea6c('0x75')])return[];return db['sequelize'][_0xea6c('0x3b')](_0x20acc6['toString'](),_0x255563);})[_0xea6c('0x1e')](function(_0x126036){_0x328934[_0xea6c('0x1a')]=_0x126036[_0xea6c('0x40')];if(_0x328934[_0xea6c('0x1a')]===0x0)return[];return db[_0xea6c('0x97')][_0xea6c('0x3b')](_0x280107[_0xea6c('0x98')](),_0x255563)[_0xea6c('0x1e')](function(_0x48e1f3){_0x54f9f7=_[_0xea6c('0x99')](_0x48e1f3,'id');_0x255563=_['merge'](_0x255563,{'model':db[_0xea6c('0x9a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x21b561['query']['fields']){_0xf8919b[_0xea6c('0x3f')][_0xea6c('0x26')](function(_0x2458ef){_0x2ca3fb[_0xea6c('0x47')]('i.'+_0x2458ef);});}else{_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0x8d'),'unreadMessages');_0x2ca3fb['field'](_0xea6c('0x9b'),_0xea6c('0x9c'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0x9d'),_0xea6c('0x9e'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0x9f'),_0xea6c('0xa0'));_0x2ca3fb[_0xea6c('0x47')]('i.id');_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xa1'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xa2'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xa3'));_0x2ca3fb['field'](_0xea6c('0xa4'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xa5'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xa6'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xa7'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xa8'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xa9'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xaa'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xab'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xac'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xad'));_0x2ca3fb[_0xea6c('0x47')]('i.ContactId');_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xae'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xaf'));_0x2ca3fb['field'](_0xea6c('0xb0'),_0xea6c('0xb1'));_0x2ca3fb[_0xea6c('0x47')]('c.lastName','Contact.lastName');_0x2ca3fb['field'](_0xea6c('0xb2'),_0xea6c('0xb3'));_0x2ca3fb[_0xea6c('0x47')]('c.phone',_0xea6c('0xb4'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xb5'),_0xea6c('0xb6'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xb7'),_0xea6c('0xb8'));_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xb9'),'Owner.fullname');_0x2ca3fb[_0xea6c('0x47')](_0xea6c('0xba'),_0xea6c('0xbb'));_0x2ca3fb['field'](_0xea6c('0xbc'),_0xea6c('0x23'));}if(_0xf8919b[_0xea6c('0x19')])_0x2ca3fb[_0xea6c('0x19')](_0xf8919b[_0xea6c('0x19')]);if(_0xf8919b['offset'])_0x2ca3fb[_0xea6c('0x17')](_0xf8919b['offset']);return db['sequelize'][_0xea6c('0x3b')](_0x2ca3fb[_0xea6c('0x98')](),_0x255563);})[_0xea6c('0x1e')](function(_0x249b42){if(_0x249b42['length']>0x0)_0x14f8cc['where']('ui.MailInteractionId\x20IN\x20?',_[_0xea6c('0x36')](_0x249b42,'id'));return db['sequelize']['query'](_0x14f8cc[_0xea6c('0x98')](),_0x255563)[_0xea6c('0x1e')](function(_0x16beef){var _0x387202=_['groupBy'](_0x16beef,_0xea6c('0xbd'));var _0x363763=[];return db[_0xea6c('0xbe')][_0xea6c('0x28')]({'attributes':['enableEmailPreview'],'raw':!![]})['then'](function(_0x5c79d5){var _0x4cbac7=_0x5c79d5[_0xea6c('0xbf')];_0x249b42[_0xea6c('0x26')](function(_0x2b345c){_0x363763[_0xea6c('0x27')](updateMailInteraction(_0x2b345c,_0x54f9f7,_0x387202,_0x4cbac7));});return BPromise[_0xea6c('0xc0')](_0x363763);});});});})['then'](function(_0x2ed5bd){_0x328934[_0xea6c('0xc1')]=_0x2ed5bd;return _0x328934;})[_0xea6c('0x1e')](respondWithFilteredResult(_0x4af25e,_0xf8919b))[_0xea6c('0x2e')](handleError(_0x4af25e,null));};exports[_0xea6c('0xc2')]=function(_0x9d8b7c,_0x212bc4){var _0x1081e9={'raw':![],'where':{'id':_0x9d8b7c['params']['id']}},_0x5f50d8={};_0x5f50d8[_0xea6c('0x39')]=_[_0xea6c('0x3c')](db[_0xea6c('0x9a')][_0xea6c('0x37')]);_0x5f50d8[_0xea6c('0x3b')]=_[_0xea6c('0x3c')](_0x9d8b7c['query']);_0x5f50d8[_0xea6c('0xc3')]=_[_0xea6c('0x3d')](_0x5f50d8[_0xea6c('0x39')],_0x5f50d8[_0xea6c('0x3b')]);_0x1081e9[_0xea6c('0x3f')]=_['intersection'](_0x5f50d8[_0xea6c('0x39')],qs[_0xea6c('0x3e')](_0x9d8b7c[_0xea6c('0x3b')]['fields']));_0x1081e9[_0xea6c('0x3f')]=_0x1081e9[_0xea6c('0x3f')][_0xea6c('0x40')]?_0x1081e9[_0xea6c('0x3f')]:_0x5f50d8[_0xea6c('0x39')];if(_0x9d8b7c[_0xea6c('0x3b')][_0xea6c('0xc4')]){_0x1081e9['include']=[{'all':!![]}];}_0x1081e9=_['merge']({},_0x1081e9,_0x9d8b7c['options']);return db['MailInteraction']['find'](_0x1081e9)[_0xea6c('0x1e')](handleEntityNotFound(_0x212bc4,null))[_0xea6c('0x1e')](respondWithResult(_0x212bc4,null))[_0xea6c('0x2e')](handleError(_0x212bc4,null));};exports[_0xea6c('0xc5')]=function(_0x1b28f5,_0x3e0be9){return db[_0xea6c('0x9a')][_0xea6c('0xc5')](_0x1b28f5[_0xea6c('0xc6')],{})['then'](respondWithResult(_0x3e0be9,0xc9))[_0xea6c('0x2e')](handleError(_0x3e0be9,null));};exports[_0xea6c('0x1d')]=function(_0x47d9a7,_0x11e0f4){if(_0x47d9a7[_0xea6c('0xc6')]['id']){delete _0x47d9a7[_0xea6c('0xc6')]['id'];}return db[_0xea6c('0x9a')][_0xea6c('0x68')]({'where':{'id':_0x47d9a7[_0xea6c('0xc7')]['id']}})[_0xea6c('0x1e')](handleEntityNotFound(_0x11e0f4,null))[_0xea6c('0x1e')](saveUpdates(_0x47d9a7['body'],null))[_0xea6c('0x1e')](respondWithResult(_0x11e0f4,null))[_0xea6c('0x2e')](handleError(_0x11e0f4,null));};exports[_0xea6c('0xc8')]=function(_0x251217,_0x1895a7){return db[_0xea6c('0x9a')][_0xea6c('0x68')]({'where':{'id':_0x251217[_0xea6c('0xc7')]['id']}})[_0xea6c('0x1e')](handleEntityNotFound(_0x1895a7,null))[_0xea6c('0x1e')](removeEntity(_0x1895a7,null))[_0xea6c('0x2e')](handleError(_0x1895a7,null));};exports[_0xea6c('0xc9')]=function(_0xa310c0,_0x56dc45){return db[_0xea6c('0x9a')][_0xea6c('0xc9')]()[_0xea6c('0x1e')](respondWithResult(_0x56dc45,null))[_0xea6c('0x2e')](handleError(_0x56dc45,null));};exports[_0xea6c('0xca')]=function(_0x1e97cb,_0x5dc571){return db[_0xea6c('0xcb')][_0xea6c('0x68')]({'where':{'id':_0x1e97cb[_0xea6c('0xc7')]['id']}})[_0xea6c('0x1e')](handleEntityNotFound(_0x5dc571,null))[_0xea6c('0x1e')](function(_0xa388b){if(_0xa388b){return _0xa388b[_0xea6c('0xca')](_0x1e97cb[_0xea6c('0xc6')][_0xea6c('0xcc')],_[_0xea6c('0xcd')](_0x1e97cb['body'],['ids','id'])||{});}})[_0xea6c('0x1e')](respondWithResult(_0x5dc571,null))[_0xea6c('0x2e')](handleError(_0x5dc571,null));};exports[_0xea6c('0xce')]=function(_0x174cdb,_0x21db63){var _0x30046a={'raw':![],'where':{}};var _0x4ac8b3={};var _0x1b737d={'count':0x0,'rows':[]};return db[_0xea6c('0x9a')][_0xea6c('0x28')]({'where':{'id':_0x174cdb[_0xea6c('0xc7')]['id']}})[_0xea6c('0x1e')](handleEntityNotFound(_0x21db63,null))[_0xea6c('0x1e')](function(_0x1f8ca2){if(_0x1f8ca2){_0x4ac8b3[_0xea6c('0x39')]=_['keys'](db[_0xea6c('0xcb')][_0xea6c('0x37')]);_0x4ac8b3[_0xea6c('0x3b')]=_[_0xea6c('0x3c')](_0x174cdb[_0xea6c('0x3b')]);_0x4ac8b3[_0xea6c('0xc3')]=_[_0xea6c('0x3d')](_0x4ac8b3[_0xea6c('0x39')],_0x4ac8b3[_0xea6c('0x3b')]);_0x30046a['attributes']=_[_0xea6c('0x3d')](_0x4ac8b3[_0xea6c('0x39')],qs['fields'](_0x174cdb[_0xea6c('0x3b')]['fields']));_0x30046a[_0xea6c('0x3f')]=_0x30046a['attributes'][_0xea6c('0x40')]?_0x30046a[_0xea6c('0x3f')]:_0x4ac8b3['model'];if(!_0x174cdb['query'][_0xea6c('0xcf')](_0xea6c('0x41'))){_0x30046a[_0xea6c('0x19')]=qs[_0xea6c('0x19')](_0x174cdb[_0xea6c('0x3b')][_0xea6c('0x19')]);_0x30046a[_0xea6c('0x17')]=qs[_0xea6c('0x17')](_0x174cdb[_0xea6c('0x3b')][_0xea6c('0x17')]);}_0x30046a['order']=qs[_0xea6c('0x43')](_0x174cdb[_0xea6c('0x3b')][_0xea6c('0x43')]);_0x30046a[_0xea6c('0x44')]=qs['filters'](_[_0xea6c('0x45')](_0x174cdb[_0xea6c('0x3b')],_0x4ac8b3[_0xea6c('0xc3')]));_0x30046a[_0xea6c('0x44')][_0xea6c('0xbd')]=_0x1f8ca2['id'];if(_0x174cdb[_0xea6c('0x3b')][_0xea6c('0x81')]){_0x30046a['where']=_[_0xea6c('0xd0')](_0x30046a[_0xea6c('0x44')],{'$or':_[_0xea6c('0x36')](_0x30046a[_0xea6c('0x3f')],function(_0x270e1e){var _0x28bf2f={};_0x28bf2f[_0x270e1e]={'$like':'%'+_0x174cdb[_0xea6c('0x3b')]['filter']+'%'};return _0x28bf2f;})});}if(_0x174cdb[_0xea6c('0x3b')]['$gte']){var _0x5ee3b6=_0x174cdb['query'][_0xea6c('0x79')]['split'](',');var _0xd8b695={};_0xd8b695[_0x5ee3b6[0x0]]={'$gte':moment(_0x5ee3b6[0x1])['format'](_0xea6c('0xd1'))};_0x30046a[_0xea6c('0x44')]=_['merge'](_0x30046a[_0xea6c('0x44')],_0xd8b695);}_0x30046a=_[_0xea6c('0xd0')]({},_0x30046a,_0x174cdb[_0xea6c('0xd2')]);return db[_0xea6c('0xcb')][_0xea6c('0x1a')]({'where':_0x30046a[_0xea6c('0x44')]})[_0xea6c('0x1e')](function(_0x4f80aa){_0x1b737d['count']=_0x4f80aa;if(_0x174cdb['query']['includeAll']){_0x30046a['include']=[{'all':!![]}];}return db['MailMessage'][_0xea6c('0xd3')](_0x30046a);})[_0xea6c('0x1e')](function(_0x528a0d){if(_0x174cdb['query'][_0xea6c('0xd4')]===_0xea6c('0xd5')){for(var _0x4f59af=0x0;_0x4f59af<_0x528a0d['length'];_0x4f59af++){_0x528a0d[_0x4f59af][_0xea6c('0xc6')]=juice(_0x528a0d[_0x4f59af][_0xea6c('0xc6')]);}}_0x1b737d['rows']=_0x528a0d;return _0x1b737d;});}})['then'](respondWithFilteredResult(_0x21db63,_0x30046a))[_0xea6c('0x2e')](handleError(_0x21db63,null));};exports[_0xea6c('0xd6')]=function(_0x5cd424,_0x3acf2d){return db[_0xea6c('0x9a')][_0xea6c('0x68')]({'where':{'id':_0x5cd424[_0xea6c('0xc7')]['id']}})[_0xea6c('0x1e')](handleEntityNotFound(_0x3acf2d,null))[_0xea6c('0x1e')](function(_0x4c10ec){if(_0x4c10ec){return _0x4c10ec[_0xea6c('0xd7')](_0x5cd424[_0xea6c('0xc6')][_0xea6c('0xcc')],_[_0xea6c('0xcd')](_0x5cd424[_0xea6c('0xc6')],[_0xea6c('0xcc'),'id'])||{})[_0xea6c('0xd8')](function(){return db[_0xea6c('0x6c')][_0xea6c('0xd3')]({'attributes':['id',_0xea6c('0x3a'),_0xea6c('0x48')],'where':{'id':_0x5cd424[_0xea6c('0xc6')][_0xea6c('0xcc')]}});})[_0xea6c('0x1e')](function(_0x3631d7){socket[_0xea6c('0xd9')](_0xea6c('0xda'),{'id':Number(_0x5cd424['params']['id']),'tags':_0x3631d7||[]});return{'id':Number(_0x5cd424['params']['id']),'tags':_0x3631d7||[]};});}})['then'](respondWithResult(_0x3acf2d,null))[_0xea6c('0x2e')](handleError(_0x3acf2d,null));};exports[_0xea6c('0xdb')]=function(_0x28f392,_0x3a7200){return db['MailInteraction']['find']({'where':{'id':_0x28f392['params']['id']}})[_0xea6c('0x1e')](handleEntityNotFound(_0x3a7200,null))[_0xea6c('0x1e')](function(_0x521d7f){if(_0x521d7f){return _0x521d7f[_0xea6c('0xdb')](_0x28f392[_0xea6c('0x3b')][_0xea6c('0xcc')]);}})[_0xea6c('0x1e')](respondWithStatusCode(_0x3a7200,null))[_0xea6c('0x2e')](handleError(_0x3a7200,null));};exports[_0xea6c('0xdc')]=function(_0x48c38c,_0x376d45){var _0x3c7384=moment()[_0xea6c('0xdd')]()[_0xea6c('0x98')]();var _0x220c94=path['join'](config['root'],_0xea6c('0xde'),'files','tmp');var _0x26dd58=path[_0xea6c('0xdf')](config[_0xea6c('0xe0')],_0xea6c('0xde'),_0xea6c('0xe1'),_0xea6c('0xe2'));var _0x1fcca5=path[_0xea6c('0xdf')](_0x220c94,_0x3c7384);var _0x1482be=util['format']('transcript-%d-%s.zip',_0x48c38c['params']['id'],_0x3c7384);var _0x1284eb=path['join'](_0x220c94,_0x1482be);var _0x42f417=[];if(_0x48c38c[_0xea6c('0x3b')]['attachments']){_0x42f417[_0xea6c('0x27')]({'model':db[_0xea6c('0xe3')],'as':_0xea6c('0xe4'),'raw':!![]});}var _0x20e31a=[{'model':db[_0xea6c('0xcb')],'as':_0xea6c('0xe5'),'attributes':['id',_0xea6c('0xc6'),_0xea6c('0x49'),'to','cc','bcc',_0xea6c('0xe6'),_0xea6c('0xe7')],'where':{'secret':![]},'order':qs[_0xea6c('0x43')]('id'),'include':_0x42f417}];return db[_0xea6c('0x9a')][_0xea6c('0x68')]({'where':{'id':_0x48c38c[_0xea6c('0xc7')]['id']},'include':_0x20e31a})[_0xea6c('0x1e')](handleEntityNotFound(_0x376d45,null))['then'](function(_0x512cab){if(_0x512cab&&_0x512cab[_0xea6c('0xe5')]){var _0x379714=_0x512cab[_0xea6c('0xe8')]({'plain':!![]});fs[_0xea6c('0xe9')](_0x1fcca5);return BPromise[_0xea6c('0xea')](_0x379714[_0xea6c('0xe5')],function(_0x3af754,_0x1f6377){var _0x2b439f={'from':_0x3af754[_0xea6c('0x49')],'to':_0x3af754['to'],'subject':_0x3af754[_0xea6c('0xe6')],'html':htmlEntities[_0xea6c('0xeb')](_0x3af754['body']),'headers':{'Date':moment(_0x3af754['createdAt'])[_0xea6c('0xec')](_0xea6c('0xed'))},'attachments':[]};if(_0x3af754['cc']){_0x2b439f[_0xea6c('0xee')]['Cc']=_0x3af754['cc'];}if(_0x3af754['bcc']){_0x2b439f[_0xea6c('0xee')][_0xea6c('0xef')]=_0x3af754[_0xea6c('0xf0')];}return new BPromise(function(_0x4a1b8c,_0x512851){if(_0x3af754[_0xea6c('0xe4')]){for(var _0x3272b0=0x0;_0x3272b0<_0x3af754['Attachments'][_0xea6c('0x40')];_0x3272b0++){var _0x1538dd=_0x3af754[_0xea6c('0xe4')][_0x3272b0];var _0x360722=path[_0xea6c('0xdf')](_0x26dd58,_0x1538dd[_0xea6c('0xf1')]);if(fs[_0xea6c('0xf2')](_0x360722)){_0x2b439f[_0xea6c('0xe2')][_0xea6c('0x27')]({'name':_0x1538dd[_0xea6c('0x3a')],'contentType':_0x1538dd[_0xea6c('0x72')],'data':fs['readFileSync'](_0x360722)});}}}emlformat[_0xea6c('0xf3')](_0x2b439f,function(_0x2422d8,_0x461c85){if(_0x2422d8)return _0x512851(_0x2422d8);fs['writeFileSync'](path['join'](_0x1fcca5,util[_0xea6c('0xec')](_0xea6c('0xf4'),_0x1f6377)),_0x461c85);return _0x4a1b8c(_0x461c85);});});})[_0xea6c('0x1e')](function(){return new BPromise(function(_0x87dc51,_0x10c166){zipdir(_0x1fcca5,{'saveTo':_0x1284eb},function(_0x39b5ad,_0x42bfe2){if(_0x39b5ad)return _0x10c166(_0x39b5ad);return _0x87dc51(_0x42bfe2);});})['then'](function(){return new BPromise(function(_0x339c87,_0x1934ea){rimraf(_0x1fcca5,function(_0xf6b239){if(_0xf6b239)_0x1934ea(_0xf6b239);return _0x339c87();});});})['then'](function(){return _0x376d45[_0xea6c('0xdc')](_0x1284eb,_0x1482be,function(_0x37f230){if(!_0x37f230)fs[_0xea6c('0xf5')](_0x1284eb);});});});}else{return _0x376d45[_0xea6c('0x13')](0xc8);}})[_0xea6c('0x2e')](handleError(_0x376d45,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 3acb326..24eaa61 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 _0xa04e=['MailMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailInteraction'];(function(_0x113696,_0x1843cc){var _0x1fb234=function(_0x5f1185){while(--_0x5f1185){_0x113696['push'](_0x113696['shift']());}};_0x1fb234(++_0x1843cc);}(_0xa04e,0x95));var _0xea04=function(_0xe5ebe8,_0x4b82ad){_0xe5ebe8=_0xe5ebe8-0x0;var _0x456030=_0xa04e[_0xe5ebe8];return _0x456030;};'use strict';var EventEmitter=require(_0xea04('0x0'));var MailInteraction=require(_0xea04('0x1'))['db'][_0xea04('0x2')];var MailMessage=require(_0xea04('0x1'))['db'][_0xea04('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xea04('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xea04('0x5'),'afterDestroy':_0xea04('0x6')};function emitEvent(_0x552342){return function(_0x56a986,_0x5b871c,_0x2bc0d6){_0x56a986[_0xea04('0x7')]({'attributes':['id'],'raw':!![]})[_0xea04('0x8')](function(_0x18ffca){_0x56a986[_0xea04('0x9')](_0xea04('0xa'),_0x18ffca[_0xea04('0xb')](function(_0x5f3c17){return{'id':_0x5f3c17['id']};}));return MailMessage[_0xea04('0xc')]({'where':{'MailInteractionId':_0x56a986['id'],'direction':'in','read':![]},'raw':!![]});})[_0xea04('0x8')](function(_0x375cc4){_0x56a986[_0xea04('0x9')](_0xea04('0xd'),_0x375cc4[_0xea04('0xe')]);MailInteractionEvents[_0xea04('0xf')](_0x552342+':'+_0x56a986['id'],_0x56a986);MailInteractionEvents[_0xea04('0xf')](_0x552342,_0x56a986);_0x2bc0d6(null);})[_0xea04('0x10')](_0x2bc0d6(null));};}for(var e in events){if(events[_0xea04('0x11')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xea04('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0x60bb=['findAll','then','setDataValue','length','emit','hasOwnProperty','hook','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','map'];(function(_0x56a9a6,_0xe9c115){var _0x3d5f05=function(_0x4a6ff0){while(--_0x4a6ff0){_0x56a9a6['push'](_0x56a9a6['shift']());}};_0x3d5f05(++_0xe9c115);}(_0x60bb,0x1b7));var _0xb60b=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0x60bb[_0x476c7];return _0x47ae56;};'use strict';var EventEmitter=require(_0xb60b('0x0'));var MailInteraction=require(_0xb60b('0x1'))['db'][_0xb60b('0x2')];var MailMessage=require(_0xb60b('0x1'))['db'][_0xb60b('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xb60b('0x4')](0x0);var events={'afterCreate':_0xb60b('0x5'),'afterUpdate':'update','afterDestroy':_0xb60b('0x6')};function emitEvent(_0x4deaeb){return function(_0x60191d,_0x32da21,_0x49433b){_0x60191d[_0xb60b('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x558fc6){_0x60191d['setDataValue']('Users',_0x558fc6[_0xb60b('0x8')](function(_0x3b94c7){return{'id':_0x3b94c7['id']};}));return MailMessage[_0xb60b('0x9')]({'where':{'MailInteractionId':_0x60191d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb60b('0xa')](function(_0x32af16){_0x60191d[_0xb60b('0xb')]('unreadMessages',_0x32af16[_0xb60b('0xc')]);MailInteractionEvents[_0xb60b('0xd')](_0x4deaeb+':'+_0x60191d['id'],_0x60191d);MailInteractionEvents['emit'](_0x4deaeb,_0x60191d);_0x49433b(null);})['catch'](_0x49433b(null));};}for(var e in events){if(events[_0xb60b('0xe')](e)){var event=events[e];MailInteraction[_0xb60b('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index f7c0ae7..9cd4a4f 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 _0xeaa8=['format','changed','models','get','update','then','catch','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','rimraf','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt'];(function(_0x39d868,_0x3d3f10){var _0x476786=function(_0x159795){while(--_0x159795){_0x39d868['push'](_0x39d868['shift']());}};_0x476786(++_0x3d3f10);}(_0xeaa8,0x1d0));var _0x8eaa=function(_0x271688,_0x3be140){_0x271688=_0x271688-0x0;var _0x37c1fa=_0xeaa8[_0x271688];return _0x37c1fa;};'use strict';var _=require(_0x8eaa('0x0'));var util=require('util');var logger=require(_0x8eaa('0x1'))('api');var moment=require(_0x8eaa('0x2'));var BPromise=require(_0x8eaa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8eaa('0x4'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0x8eaa('0x5')]=function(_0x303a0e,_0x4d1492){return _0x303a0e[_0x8eaa('0x6')](_0x8eaa('0x7'),attributes,{'tableName':_0x8eaa('0x8'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x8eaa('0x9'),'to'],'type':_0x8eaa('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x6e12aa,_0x1efd1f,_0x4d1651){if(_0x6e12aa[_0x8eaa('0xb')]){_0x6e12aa[_0x8eaa('0xc')]=moment()['format'](_0x8eaa('0xd'));}if(_0x6e12aa[_0x8eaa('0xe')]){_0x6e12aa[_0x8eaa('0xf')]=moment()[_0x8eaa('0x10')](_0x8eaa('0xd'));}_0x4d1651(null,_0x1efd1f);},'beforeUpdate':function(_0x1aded9,_0x1933ea,_0x4454bf){if(_0x1aded9[_0x8eaa('0x11')]('substatus')){_0x1aded9['substatusAt']=_0x1aded9[_0x8eaa('0xb')]?moment()[_0x8eaa('0x10')](_0x8eaa('0xd')):null;}if(_0x1aded9[_0x8eaa('0x11')]('closed')){_0x1aded9[_0x8eaa('0xf')]=moment()[_0x8eaa('0x10')](_0x8eaa('0xd'));_0x1aded9[_0x8eaa('0xb')]=null;_0x1aded9[_0x8eaa('0xc')]=null;}_0x4454bf(null,_0x1aded9);},'afterUpdate':function(_0xa5bb93,_0x501a62,_0x50e5da){var _0x4cbcd2=_0x303a0e[_0x8eaa('0x12')];var _0x5c8ba1=_0xa5bb93[_0x8eaa('0x13')]({'plain':!![]});if(_0x5c8ba1[_0x8eaa('0xe')]){return _0x4cbcd2['MailMessage'][_0x8eaa('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x5c8ba1['id']}})[_0x8eaa('0x15')](function(){_0x50e5da();})[_0x8eaa('0x16')](function(_0x354b99){_0x50e5da(_0x354b99);});}else{_0x50e5da();}}},'charset':'utf8mb4','collate':_0x8eaa('0x17')});}; \ No newline at end of file +var _0xc71b=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','get','update','catch','utf8mb4'];(function(_0x85506e,_0x4fd073){var _0x58b1ee=function(_0x2e6576){while(--_0x2e6576){_0x85506e['push'](_0x85506e['shift']());}};_0x58b1ee(++_0x4fd073);}(_0xc71b,0x1c3));var _0xbc71=function(_0x4716c2,_0x3629e5){_0x4716c2=_0x4716c2-0x0;var _0xf3168c=_0xc71b[_0x4716c2];return _0xf3168c;};'use strict';var _=require(_0xbc71('0x0'));var util=require('util');var logger=require(_0xbc71('0x1'))('api');var moment=require(_0xbc71('0x2'));var BPromise=require(_0xbc71('0x3'));var rp=require(_0xbc71('0x4'));var fs=require('fs');var path=require(_0xbc71('0x5'));var rimraf=require('rimraf');var config=require(_0xbc71('0x6'));var attributes=require(_0xbc71('0x7'));module[_0xbc71('0x8')]=function(_0x3b8097,_0x2db617){return _0x3b8097[_0xbc71('0x9')](_0xbc71('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xbc71('0xb'),'fields':[_0xbc71('0xc'),'to'],'type':_0xbc71('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4ad191,_0x23847b,_0x33654d){if(_0x4ad191[_0xbc71('0xe')]){_0x4ad191[_0xbc71('0xf')]=moment()[_0xbc71('0x10')](_0xbc71('0x11'));}if(_0x4ad191[_0xbc71('0x12')]){_0x4ad191['closedAt']=moment()[_0xbc71('0x10')](_0xbc71('0x11'));}_0x33654d(null,_0x23847b);},'beforeUpdate':function(_0x8d4d50,_0x23ede5,_0x2e3e45){if(_0x8d4d50[_0xbc71('0x13')](_0xbc71('0xe'))){_0x8d4d50[_0xbc71('0xf')]=_0x8d4d50[_0xbc71('0xe')]?moment()[_0xbc71('0x10')](_0xbc71('0x11')):null;}if(_0x8d4d50[_0xbc71('0x13')](_0xbc71('0x12'))){_0x8d4d50['closedAt']=moment()[_0xbc71('0x10')](_0xbc71('0x11'));_0x8d4d50[_0xbc71('0xe')]=null;_0x8d4d50[_0xbc71('0xf')]=null;}_0x2e3e45(null,_0x8d4d50);},'afterUpdate':function(_0x130ae1,_0x59cbc4,_0x2646a6){var _0x5931e1=_0x3b8097['models'];var _0x301346=_0x130ae1[_0xbc71('0x14')]({'plain':!![]});if(_0x301346['closed']){return _0x5931e1['MailMessage'][_0xbc71('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x301346['id']}})['then'](function(){_0x2646a6();})[_0xbc71('0x16')](function(_0x33f683){_0x2646a6(_0x33f683);});}else{_0x2646a6();}}},'charset':_0xbc71('0x17'),'collate':_0xbc71('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 7b2e15d..fdfbf4c 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 _0xb19a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateMailInteraction','update','body','options','raw','where','attributes','limit','stringify','MailInteraction','find','addTags','ids','omit','spread','AddTags','lodash'];(function(_0x5b8296,_0x21487c){var _0x1229d7=function(_0x526aea){while(--_0x526aea){_0x5b8296['push'](_0x5b8296['shift']());}};_0x1229d7(++_0x21487c);}(_0xb19a,0x12c));var _0xab19=function(_0x535003,_0x3e2ede){_0x535003=_0x535003-0x0;var _0xa60f5d=_0xb19a[_0x535003];return _0xa60f5d;};'use strict';var _=require(_0xab19('0x0'));var util=require(_0xab19('0x1'));var moment=require(_0xab19('0x2'));var BPromise=require(_0xab19('0x3'));var rs=require(_0xab19('0x4'));var fs=require('fs');var Redis=require(_0xab19('0x5'));var db=require(_0xab19('0x6'))['db'];var utils=require(_0xab19('0x7'));var logger=require(_0xab19('0x8'))(_0xab19('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xab19('0xa')]['http']({'port':0x232a});config[_0xab19('0xb')]=_[_0xab19('0xc')](config['redis'],{'host':_0xab19('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab19('0xb')]));require(_0xab19('0xe'))['register'](socket);function respondWithRpcPromise(_0x72193d,_0x557c33,_0x10c312){return new BPromise(function(_0x2b9303,_0x315688){return client[_0xab19('0xf')](_0x72193d,_0x10c312)[_0xab19('0x10')](function(_0x42d9e8){logger[_0xab19('0x11')](_0xab19('0x12'),_0x557c33,'request\x20sent');logger[_0xab19('0x13')](_0xab19('0x14'),_0x557c33,_0xab19('0x15'),JSON['stringify'](_0x42d9e8));if(_0x42d9e8[_0xab19('0x16')]){if(_0x42d9e8[_0xab19('0x16')][_0xab19('0x17')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x557c33,_0x42d9e8[_0xab19('0x16')]['message']);return _0x315688(_0x42d9e8[_0xab19('0x16')]['message']);}logger[_0xab19('0x16')]('MailInteraction,\x20%s,\x20%s',_0x557c33,_0x42d9e8[_0xab19('0x16')][_0xab19('0x18')]);return _0x2b9303(_0x42d9e8[_0xab19('0x16')][_0xab19('0x18')]);}else{logger[_0xab19('0x11')](_0xab19('0x12'),_0x557c33,_0xab19('0x15'));_0x2b9303(_0x42d9e8[_0xab19('0x19')][_0xab19('0x18')]);}})[_0xab19('0x1a')](function(_0x4c029d){logger[_0xab19('0x16')](_0xab19('0x12'),_0x557c33,_0x4c029d);_0x315688(_0x4c029d);});});}exports[_0xab19('0x1b')]=function(_0x2480ae){var _0xc7c716=this;return new Promise(function(_0x50c053,_0x1d6e38){return db['MailInteraction'][_0xab19('0x1c')](_0x2480ae[_0xab19('0x1d')],{'raw':_0x2480ae[_0xab19('0x1e')]?_0x2480ae[_0xab19('0x1e')][_0xab19('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2480ae['options']?_0x2480ae[_0xab19('0x1e')][_0xab19('0x20')]||null:null,'attributes':_0x2480ae[_0xab19('0x1e')]?_0x2480ae[_0xab19('0x1e')][_0xab19('0x21')]||null:null,'limit':_0x2480ae[_0xab19('0x1e')]?_0x2480ae[_0xab19('0x1e')][_0xab19('0x22')]||null:null})['then'](function(_0x7b3bca){logger[_0xab19('0x11')](_0xab19('0x1b'),_0x2480ae);logger['debug']('UpdateMailInteraction',_0x2480ae,JSON[_0xab19('0x23')](_0x7b3bca));_0x50c053(_0x7b3bca);})[_0xab19('0x1a')](function(_0x464acd){logger[_0xab19('0x16')](_0xab19('0x1b'),_0x464acd['message'],_0x2480ae);_0x1d6e38(_0xc7c716['error'](0x1f4,_0x464acd[_0xab19('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x3d4224){return new Promise(function(_0x421d96,_0x5ed4de){return db[_0xab19('0x24')][_0xab19('0x25')]({'where':_0x3d4224[_0xab19('0x1e')]?_0x3d4224['options']['where']||null:null})[_0xab19('0x10')](function(_0x26e338){if(_0x26e338){return _0x26e338[_0xab19('0x26')](_0x3d4224['body'][_0xab19('0x27')],_[_0xab19('0x28')](_0x3d4224['body'],[_0xab19('0x27'),'id'])||{});}})[_0xab19('0x29')](function(_0x3ea3ac){logger[_0xab19('0x11')](_0xab19('0x2a'),_0x3d4224);logger[_0xab19('0x13')](_0xab19('0x2a'),_0x3d4224,JSON[_0xab19('0x23')](_0x3ea3ac));_0x421d96(_0x3ea3ac);})['catch'](function(_0xc8ee97){logger[_0xab19('0x16')](_0xab19('0x2a'),_0xc8ee97[_0xab19('0x18')],_0x3d4224);_0x5ed4de(_this['error'](0x1f4,_0xc8ee97[_0xab19('0x18')]));});});}; \ No newline at end of file +var _0x9e2e=['util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','update','body','options','where','attributes','limit','AddTagsToMailInteraction','MailInteraction','addTags','ids','omit','spread','AddTags','lodash'];(function(_0x5a49c8,_0x442e34){var _0x1e99eb=function(_0x1339cb){while(--_0x1339cb){_0x5a49c8['push'](_0x5a49c8['shift']());}};_0x1e99eb(++_0x442e34);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x19776e,_0x3690de){_0x19776e=_0x19776e-0x0;var _0xce4b5f=_0x9e2e[_0x19776e];return _0xce4b5f;};'use strict';var _=require(_0xe9e2('0x0'));var util=require(_0xe9e2('0x1'));var moment=require(_0xe9e2('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9e2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9e2('0x4'));var logger=require(_0xe9e2('0x5'))(_0xe9e2('0x6'));var config=require(_0xe9e2('0x7'));var jayson=require(_0xe9e2('0x8'));var client=jayson[_0xe9e2('0x9')][_0xe9e2('0xa')]({'port':0x232a});config['redis']=_[_0xe9e2('0xb')](config['redis'],{'host':_0xe9e2('0xc'),'port':0x18eb});var socket=require(_0xe9e2('0xd'))(new Redis(config['redis']));require(_0xe9e2('0xe'))[_0xe9e2('0xf')](socket);function respondWithRpcPromise(_0x5d065f,_0x20a3e9,_0xe1c4d3){return new BPromise(function(_0x56264f,_0x53e3c5){return client[_0xe9e2('0x10')](_0x5d065f,_0xe1c4d3)[_0xe9e2('0x11')](function(_0x2e02c8){logger[_0xe9e2('0x12')]('MailInteraction,\x20%s,\x20%s',_0x20a3e9,'request\x20sent');logger[_0xe9e2('0x13')](_0xe9e2('0x14'),_0x20a3e9,_0xe9e2('0x15'),JSON[_0xe9e2('0x16')](_0x2e02c8));if(_0x2e02c8[_0xe9e2('0x17')]){if(_0x2e02c8[_0xe9e2('0x17')][_0xe9e2('0x18')]===0x1f4){logger[_0xe9e2('0x17')](_0xe9e2('0x19'),_0x20a3e9,_0x2e02c8[_0xe9e2('0x17')]['message']);return _0x53e3c5(_0x2e02c8['error'][_0xe9e2('0x1a')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x20a3e9,_0x2e02c8[_0xe9e2('0x17')][_0xe9e2('0x1a')]);return _0x56264f(_0x2e02c8[_0xe9e2('0x17')][_0xe9e2('0x1a')]);}else{logger[_0xe9e2('0x12')](_0xe9e2('0x19'),_0x20a3e9,'request\x20sent');_0x56264f(_0x2e02c8[_0xe9e2('0x1b')][_0xe9e2('0x1a')]);}})[_0xe9e2('0x1c')](function(_0x5b804f){logger[_0xe9e2('0x17')](_0xe9e2('0x19'),_0x20a3e9,_0x5b804f);_0x53e3c5(_0x5b804f);});});}exports[_0xe9e2('0x1d')]=function(_0x4e10cd){var _0x2c09aa=this;return new Promise(function(_0x1d8dc2,_0x6d8193){return db['MailInteraction'][_0xe9e2('0x1e')](_0x4e10cd[_0xe9e2('0x1f')],{'raw':_0x4e10cd[_0xe9e2('0x20')]?_0x4e10cd[_0xe9e2('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e10cd[_0xe9e2('0x20')]?_0x4e10cd[_0xe9e2('0x20')][_0xe9e2('0x21')]||null:null,'attributes':_0x4e10cd[_0xe9e2('0x20')]?_0x4e10cd[_0xe9e2('0x20')][_0xe9e2('0x22')]||null:null,'limit':_0x4e10cd[_0xe9e2('0x20')]?_0x4e10cd[_0xe9e2('0x20')][_0xe9e2('0x23')]||null:null})[_0xe9e2('0x11')](function(_0x1c22f6){logger[_0xe9e2('0x12')](_0xe9e2('0x1d'),_0x4e10cd);logger[_0xe9e2('0x13')](_0xe9e2('0x1d'),_0x4e10cd,JSON[_0xe9e2('0x16')](_0x1c22f6));_0x1d8dc2(_0x1c22f6);})[_0xe9e2('0x1c')](function(_0x4d4343){logger[_0xe9e2('0x17')](_0xe9e2('0x1d'),_0x4d4343[_0xe9e2('0x1a')],_0x4e10cd);_0x6d8193(_0x2c09aa[_0xe9e2('0x17')](0x1f4,_0x4d4343['message']));});});};exports[_0xe9e2('0x24')]=function(_0x2e746d){return new Promise(function(_0x13d181,_0x39c4a9){return db[_0xe9e2('0x25')]['find']({'where':_0x2e746d['options']?_0x2e746d[_0xe9e2('0x20')][_0xe9e2('0x21')]||null:null})[_0xe9e2('0x11')](function(_0x39e7c5){if(_0x39e7c5){return _0x39e7c5[_0xe9e2('0x26')](_0x2e746d[_0xe9e2('0x1f')][_0xe9e2('0x27')],_[_0xe9e2('0x28')](_0x2e746d[_0xe9e2('0x1f')],[_0xe9e2('0x27'),'id'])||{});}})[_0xe9e2('0x29')](function(_0xbeb203){logger[_0xe9e2('0x12')](_0xe9e2('0x2a'),_0x2e746d);logger['debug']('AddTags',_0x2e746d,JSON[_0xe9e2('0x16')](_0xbeb203));_0x13d181(_0xbeb203);})[_0xe9e2('0x1c')](function(_0x498e12){logger[_0xe9e2('0x17')](_0xe9e2('0x2a'),_0x498e12[_0xe9e2('0x1a')],_0x2e746d);_0x39c4a9(_this['error'](0x1f4,_0x498e12[_0xe9e2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 41fadd8..16c25c6 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 _0xf934=['register','mailInteraction:','remove','update','removeListener'];(function(_0x208ca4,_0x4a028c){var _0x5b299f=function(_0x1b89ba){while(--_0x1b89ba){_0x208ca4['push'](_0x208ca4['shift']());}};_0x5b299f(++_0x4a028c);}(_0xf934,0x16a));var _0x4f93=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xf934[_0x5f3f88];return _0xd08119;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0x4f93('0x0'),_0x4f93('0x1')];function createListener(_0x127644,_0x9d5bbf){return function(_0x2477eb){_0x9d5bbf['emit'](_0x127644,_0x2477eb);};}function removeListener(_0x550721,_0x2213d3){return function(){MailInteractionEvents[_0x4f93('0x2')](_0x550721,_0x2213d3);};}exports[_0x4f93('0x3')]=function(_0x266773){for(var _0x4a88e6=0x0,_0x58175c=events['length'];_0x4a88e6<_0x58175c;_0x4a88e6++){var _0x3fdb41=events[_0x4a88e6];var _0x3fa834=createListener(_0x4f93('0x4')+_0x3fdb41,_0x266773);MailInteractionEvents['on'](_0x3fdb41,_0x3fa834);}}; \ No newline at end of file +var _0x2c3d=['register','mailInteraction:','./mailInteraction.events','update','emit','removeListener'];(function(_0x367ea1,_0x5512b6){var _0x1605c7=function(_0x18840e){while(--_0x18840e){_0x367ea1['push'](_0x367ea1['shift']());}};_0x1605c7(++_0x5512b6);}(_0x2c3d,0x86));var _0xd2c3=function(_0x4e0e72,_0x421ba7){_0x4e0e72=_0x4e0e72-0x0;var _0x300a13=_0x2c3d[_0x4e0e72];return _0x300a13;};'use strict';var MailInteractionEvents=require(_0xd2c3('0x0'));var events=['save','remove',_0xd2c3('0x1')];function createListener(_0xdf613f,_0x56fa25){return function(_0x18b04c){_0x56fa25[_0xd2c3('0x2')](_0xdf613f,_0x18b04c);};}function removeListener(_0xa68318,_0x1875e2){return function(){MailInteractionEvents[_0xd2c3('0x3')](_0xa68318,_0x1875e2);};}exports[_0xd2c3('0x4')]=function(_0x3c62d7){for(var _0x51760b=0x0,_0x344655=events['length'];_0x51760b<_0x344655;_0x51760b++){var _0x36f00c=events[_0x51760b];var _0xdec00f=createListener(_0xd2c3('0x5')+_0x36f00c,_0x3c62d7);MailInteractionEvents['on'](_0x36f00c,_0xdec00f);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 28d83a4..023177a 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 _0xcf9d=['index','get','/describe','describe','/:id','show','/:id/download','download','post','mail','mailmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','isAuthenticated'];(function(_0x3f8d04,_0x13b55c){var _0x53ef79=function(_0x248f28){while(--_0x248f28){_0x3f8d04['push'](_0x3f8d04['shift']());}};_0x53ef79(++_0x13b55c);}(_0xcf9d,0x147));var _0xdcf9=function(_0x4cd940,_0x3315d4){_0x4cd940=_0x4cd940-0x0;var _0x39eb66=_0xcf9d[_0x4cd940];return _0x39eb66;};'use strict';var multer=require('multer');var util=require(_0xdcf9('0x0'));var path=require(_0xdcf9('0x1'));var timeout=require(_0xdcf9('0x2'));var express=require(_0xdcf9('0x3'));var router=express[_0xdcf9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdcf9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdcf9('0x6'));var controller=require(_0xdcf9('0x7'));router['get']('/',auth[_0xdcf9('0x8')](),controller[_0xdcf9('0x9')]);router[_0xdcf9('0xa')](_0xdcf9('0xb'),auth[_0xdcf9('0x8')](),controller[_0xdcf9('0xc')]);router[_0xdcf9('0xa')](_0xdcf9('0xd'),auth[_0xdcf9('0x8')](),controller[_0xdcf9('0xe')]);router[_0xdcf9('0xa')](_0xdcf9('0xf'),auth[_0xdcf9('0x8')](),controller[_0xdcf9('0x10')]);router[_0xdcf9('0x11')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xdcf9('0x12'),_0xdcf9('0x13')),controller[_0xdcf9('0x14')]);router[_0xdcf9('0x15')](_0xdcf9('0xd'),auth[_0xdcf9('0x8')](),controller[_0xdcf9('0x16')]);router[_0xdcf9('0x15')]('/:id/accept',auth[_0xdcf9('0x8')](),controller[_0xdcf9('0x17')]);router['put'](_0xdcf9('0x18'),auth[_0xdcf9('0x8')](),controller[_0xdcf9('0x19')]);router[_0xdcf9('0x1a')](_0xdcf9('0xd'),auth[_0xdcf9('0x8')](),controller[_0xdcf9('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x682e=['./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1081d9,_0x1c875f){var _0xd3b6dc=function(_0x965ad7){while(--_0x965ad7){_0x1081d9['push'](_0x1081d9['shift']());}};_0xd3b6dc(++_0x1c875f);}(_0x682e,0x119));var _0xe682=function(_0x536c73,_0x3069a3){_0x536c73=_0x536c73-0x0;var _0x3db4c6=_0x682e[_0x536c73];return _0x3db4c6;};'use strict';var multer=require(_0xe682('0x0'));var util=require('util');var path=require(_0xe682('0x1'));var timeout=require(_0xe682('0x2'));var express=require(_0xe682('0x3'));var router=express[_0xe682('0x4')]();var fs_extra=require(_0xe682('0x5'));var auth=require(_0xe682('0x6'));var interaction=require(_0xe682('0x7'));var config=require(_0xe682('0x8'));var controller=require(_0xe682('0x9'));router[_0xe682('0xa')]('/',auth[_0xe682('0xb')](),controller['index']);router[_0xe682('0xa')](_0xe682('0xc'),auth[_0xe682('0xb')](),controller[_0xe682('0xd')]);router['get'](_0xe682('0xe'),auth[_0xe682('0xb')](),controller[_0xe682('0xf')]);router[_0xe682('0xa')](_0xe682('0x10'),auth[_0xe682('0xb')](),controller['download']);router[_0xe682('0x11')]('/',auth[_0xe682('0xb')](),interaction['tracked'](_0xe682('0x12'),_0xe682('0x13')),controller[_0xe682('0x14')]);router[_0xe682('0x15')](_0xe682('0xe'),auth[_0xe682('0xb')](),controller[_0xe682('0x16')]);router['put'](_0xe682('0x17'),auth[_0xe682('0xb')](),controller[_0xe682('0x18')]);router[_0xe682('0x15')](_0xe682('0x19'),auth[_0xe682('0xb')](),controller[_0xe682('0x1a')]);router['delete']('/:id',auth[_0xe682('0xb')](),controller[_0xe682('0x1b')]);module[_0xe682('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index c6c6a3b..231b767 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 _0xf37c=['ENUM','Chat','Email','sequelize','exports','long','TEXT','out','STRING','DATE','INTEGER'];(function(_0x11407c,_0x1d4209){var _0x5326b0=function(_0x423be8){while(--_0x423be8){_0x11407c['push'](_0x11407c['shift']());}};_0x5326b0(++_0x1d4209);}(_0xf37c,0xbe));var _0xcf37=function(_0x3d8b1d,_0x1c0f88){_0x3d8b1d=_0x3d8b1d-0x0;var _0x2bb57a=_0xf37c[_0x3d8b1d];return _0x2bb57a;};'use strict';var Sequelize=require(_0xcf37('0x0'));var _=require('lodash');module[_0xcf37('0x1')]={'body':{'type':Sequelize['TEXT'](_0xcf37('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xcf37('0x3')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xcf37('0x4')),'defaultValue':_0xcf37('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcf37('0x5')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xcf37('0x3')](_0xcf37('0x2'))},'cc':{'type':Sequelize[_0xcf37('0x3')](_0xcf37('0x2'))},'bcc':{'type':Sequelize[_0xcf37('0x3')]('long')},'subject':{'type':Sequelize[_0xcf37('0x3')]},'sentAt':{'type':Sequelize[_0xcf37('0x6')]},'attach':{'type':Sequelize[_0xcf37('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xcf37('0x6')]},'originTo':{'type':Sequelize[_0xcf37('0x3')](_0xcf37('0x2'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0xcf37('0x8')]('Email',_0xcf37('0x9')),'defaultValue':_0xcf37('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x1e00=['TEXT','medium','out','STRING','long','DATE','INTEGER','Chat','Email','sequelize','exports'];(function(_0x266484,_0x545b27){var _0x5a866e=function(_0xea8921){while(--_0xea8921){_0x266484['push'](_0x266484['shift']());}};_0x5a866e(++_0x545b27);}(_0x1e00,0xa3));var _0x01e0=function(_0x403285,_0x11f9a3){_0x403285=_0x403285-0x0;var _0x23176f=_0x1e00[_0x403285];return _0x23176f;};'use strict';var Sequelize=require(_0x01e0('0x0'));var _=require('lodash');module[_0x01e0('0x1')]={'body':{'type':Sequelize[_0x01e0('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x01e0('0x2')](_0x01e0('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x01e0('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x01e0('0x5')](0x1fe)},'from':{'type':Sequelize[_0x01e0('0x5')]},'to':{'type':Sequelize[_0x01e0('0x2')](_0x01e0('0x6'))},'cc':{'type':Sequelize['TEXT'](_0x01e0('0x6'))},'bcc':{'type':Sequelize[_0x01e0('0x2')](_0x01e0('0x6'))},'subject':{'type':Sequelize[_0x01e0('0x2')]},'sentAt':{'type':Sequelize[_0x01e0('0x7')]},'attach':{'type':Sequelize[_0x01e0('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x01e0('0x2')](_0x01e0('0x6'))},'originCc':{'type':Sequelize['TEXT'](_0x01e0('0x6'))},'originChannel':{'type':Sequelize['ENUM']('Email',_0x01e0('0x9')),'defaultValue':_0x01e0('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 b04ec32..3ce92f4 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 _0x831e=['message','catch','status','json','undefined','limit','offset','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','body','describe','create','direction','secret','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','ListId','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','UserId','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','agent','fullname','email','internal','manual','channel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','User','interface','SIP/%s','motionChannel','rejectmessage','download','toString','server','tmp','files','message-%s.eml','from','bcc','createdAt','Attachment','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','readFileSync','build','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x831e,0x1cb));var _0xe831=function(_0x27e015,_0x490074){_0x27e015=_0x27e015-0x0;var _0x2c5d5a=_0x831e[_0x27e015];return _0x2c5d5a;};'use strict';var emlformat=require(_0xe831('0x0'));var moment=require(_0xe831('0x1'));var BPromise=require(_0xe831('0x2'));var util=require(_0xe831('0x3'));var path=require(_0xe831('0x4'));var fs=require('fs');var _=require(_0xe831('0x5'));var Redis=require(_0xe831('0x6'));var htmlToText=require(_0xe831('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0xe831('0x8'))(_0xe831('0x9'));var interaction_log=require(_0xe831('0x8'))(_0xe831('0xa'));var config=require(_0xe831('0xb'));var db=require(_0xe831('0xc'))['db'];config['redis']=_[_0xe831('0xd')](config['redis'],{'host':_0xe831('0xe'),'port':0x18eb});var socket=require(_0xe831('0xf'))(new Redis(config[_0xe831('0x10')]));var htmlEntities=require('html-entities');require(_0xe831('0x11'))['register'](socket);var jayson=require(_0xe831('0x12'));var client=jayson[_0xe831('0x13')]['http']({'port':0x232c});var client9003=jayson[_0xe831('0x13')][_0xe831('0x14')]({'port':0x232b});var client9002=jayson[_0xe831('0x13')][_0xe831('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x2b380b,_0x4a46b4,_0x8b8761,_0x1e670f){return new BPromise(function(_0x140e5f,_0x51d60f){var _0x1ee481=_0x1e670f||client;return _0x1ee481[_0xe831('0x15')](_0x2b380b,_0x8b8761)[_0xe831('0x16')](function(_0x1329d0){logger[_0xe831('0x17')](_0xe831('0x18'),_0x4a46b4,_0xe831('0x19'));logger[_0xe831('0x1a')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4a46b4,'request\x20sent',JSON[_0xe831('0x1b')](_0x1329d0));if(_0x1329d0['error']){if(_0x1329d0[_0xe831('0x1c')][_0xe831('0x1d')]===0x1f4){logger['error'](_0xe831('0x18'),_0x4a46b4,_0x1329d0[_0xe831('0x1c')]['message']);return _0x51d60f(_0x1329d0[_0xe831('0x1c')][_0xe831('0x1e')]);}logger[_0xe831('0x1c')]('MailMessage,\x20%s,\x20%s',_0x4a46b4,_0x1329d0[_0xe831('0x1c')][_0xe831('0x1e')]);return _0x140e5f(_0x1329d0[_0xe831('0x1c')][_0xe831('0x1e')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x4a46b4,_0xe831('0x19'));_0x140e5f(_0x1329d0['result']['message']);}})[_0xe831('0x1f')](function(_0x18ddc2){logger[_0xe831('0x1c')](_0xe831('0x18'),_0x4a46b4,_0x18ddc2);_0x51d60f(_0x18ddc2);});});}function respondWithResult(_0x273fce,_0x395391){_0x395391=_0x395391||0xc8;return function(_0x27c928){if(_0x27c928){return _0x273fce[_0xe831('0x20')](_0x395391)[_0xe831('0x21')](_0x27c928);}};}function respondWithFilteredResult(_0x484058,_0x4f00f3){return function(_0x2605ea){if(_0x2605ea){var _0x3b219f=typeof _0x4f00f3['offset']===_0xe831('0x22')&&typeof _0x4f00f3[_0xe831('0x23')]===_0xe831('0x22');var _0x535ec0=_0x2605ea['count'];var _0x1651d8=_0x3b219f?0x0:_0x4f00f3[_0xe831('0x24')];var _0x3bfd43=_0x3b219f?_0x2605ea[_0xe831('0x25')]:_0x4f00f3[_0xe831('0x24')]+_0x4f00f3[_0xe831('0x23')];var _0x18cdd1;if(_0x3bfd43>=_0x535ec0){_0x3bfd43=_0x535ec0;_0x18cdd1=0xc8;}else{_0x18cdd1=0xce;}_0x484058[_0xe831('0x20')](_0x18cdd1);return _0x484058[_0xe831('0x26')](_0xe831('0x27'),_0x1651d8+'-'+_0x3bfd43+'/'+_0x535ec0)[_0xe831('0x21')](_0x2605ea);}return null;};}function saveUpdates(_0x137e37){return function(_0x1cfd80){if(_0x1cfd80){return _0x1cfd80[_0xe831('0x28')](_0x137e37)[_0xe831('0x16')](function(_0x421691){return _0x421691;});}return null;};}function removeEntity(_0x1b385d){return function(_0x317459){if(_0x317459){return _0x317459[_0xe831('0x29')]()[_0xe831('0x16')](function(){_0x1b385d['status'](0xcc)[_0xe831('0x2a')]();});}};}function handleEntityNotFound(_0x9cd95c){return function(_0x55c232){if(!_0x55c232){_0x9cd95c[_0xe831('0x2b')](0x194);}return _0x55c232;};}function handleError(_0x1a948d,_0x33b213){_0x33b213=_0x33b213||0x1f4;return function(_0xd45ab0){logger[_0xe831('0x1c')](_0xd45ab0[_0xe831('0x2c')]);if(_0xd45ab0[_0xe831('0x2d')]){delete _0xd45ab0[_0xe831('0x2d')];}_0x1a948d[_0xe831('0x20')](_0x33b213)['send'](_0xd45ab0);};}exports[_0xe831('0x2e')]=function(_0x23b5c4,_0x2678ce){var _0x47311e={},_0x4765a4={},_0x54939c={'count':0x0,'rows':[]};var _0x1dc23b=_[_0xe831('0x2f')](db[_0xe831('0x30')][_0xe831('0x31')],function(_0x47bf53){return{'name':_0x47bf53[_0xe831('0x32')],'type':_0x47bf53['type'][_0xe831('0x33')]};});_0x4765a4[_0xe831('0x34')]=_[_0xe831('0x2f')](_0x1dc23b,'name');_0x4765a4['query']=_[_0xe831('0x35')](_0x23b5c4['query']);_0x4765a4[_0xe831('0x36')]=_[_0xe831('0x37')](_0x4765a4['model'],_0x4765a4[_0xe831('0x38')]);_0x47311e['attributes']=_[_0xe831('0x37')](_0x4765a4[_0xe831('0x34')],qs[_0xe831('0x39')](_0x23b5c4[_0xe831('0x38')][_0xe831('0x39')]));_0x47311e['attributes']=_0x47311e[_0xe831('0x3a')][_0xe831('0x3b')]?_0x47311e[_0xe831('0x3a')]:_0x4765a4[_0xe831('0x34')];if(!_0x23b5c4['query'][_0xe831('0x3c')](_0xe831('0x3d'))){_0x47311e[_0xe831('0x23')]=qs[_0xe831('0x23')](_0x23b5c4[_0xe831('0x38')][_0xe831('0x23')]);_0x47311e[_0xe831('0x24')]=qs[_0xe831('0x24')](_0x23b5c4[_0xe831('0x38')]['offset']);}_0x47311e[_0xe831('0x3e')]=qs['sort'](_0x23b5c4['query']['sort']);_0x47311e[_0xe831('0x3f')]=qs[_0xe831('0x36')](_[_0xe831('0x40')](_0x23b5c4[_0xe831('0x38')],_0x4765a4[_0xe831('0x36')]),_0x1dc23b);if(_0x23b5c4[_0xe831('0x38')][_0xe831('0x41')]){_0x47311e['where']=_[_0xe831('0x42')](_0x47311e[_0xe831('0x3f')],{'$or':_[_0xe831('0x2f')](_0x1dc23b,function(_0x836c4d){if(_0x836c4d['type']!==_0xe831('0x43')){var _0xee3cbe={};_0xee3cbe[_0x836c4d['name']]={'$like':'%'+_0x23b5c4['query']['filter']+'%'};return _0xee3cbe;}})});}_0x47311e=_['merge']({},_0x47311e,_0x23b5c4[_0xe831('0x44')]);var _0x4c3784={'where':_0x47311e[_0xe831('0x3f')]};return db[_0xe831('0x30')][_0xe831('0x25')](_0x4c3784)['then'](function(_0x35194f){_0x54939c[_0xe831('0x25')]=_0x35194f;if(_0x23b5c4['query'][_0xe831('0x45')]){_0x47311e[_0xe831('0x46')]=[{'all':!![]}];}return db[_0xe831('0x30')][_0xe831('0x47')](_0x47311e);})[_0xe831('0x16')](function(_0xfc5d31){_0x54939c[_0xe831('0x48')]=_0xfc5d31;return _0x54939c;})['then'](respondWithFilteredResult(_0x2678ce,_0x47311e))[_0xe831('0x1f')](handleError(_0x2678ce,null));};exports['show']=function(_0x260de3,_0x3f7b3e){var _0x21f8aa={'raw':!![],'where':{'id':_0x260de3[_0xe831('0x49')]['id']}},_0x3f4d13={};_0x3f4d13[_0xe831('0x34')]=_[_0xe831('0x35')](db[_0xe831('0x30')][_0xe831('0x31')]);_0x3f4d13['query']=_['keys'](_0x260de3[_0xe831('0x38')]);_0x3f4d13[_0xe831('0x36')]=_['intersection'](_0x3f4d13[_0xe831('0x34')],_0x3f4d13[_0xe831('0x38')]);_0x21f8aa[_0xe831('0x3a')]=_[_0xe831('0x37')](_0x3f4d13[_0xe831('0x34')],qs[_0xe831('0x39')](_0x260de3[_0xe831('0x38')][_0xe831('0x39')]));_0x21f8aa[_0xe831('0x3a')]=_0x21f8aa[_0xe831('0x3a')]['length']?_0x21f8aa[_0xe831('0x3a')]:_0x3f4d13[_0xe831('0x34')];if(_0x260de3[_0xe831('0x38')]['includeAll']){_0x21f8aa['include']=[{'all':!![]}];}_0x21f8aa=_[_0xe831('0x42')]({},_0x21f8aa,_0x260de3['options']);return db[_0xe831('0x30')][_0xe831('0x4a')](_0x21f8aa)['then'](handleEntityNotFound(_0x3f7b3e,null))[_0xe831('0x16')](respondWithResult(_0x3f7b3e,null))[_0xe831('0x1f')](handleError(_0x3f7b3e,null));};exports['update']=function(_0x111abe,_0x45b2c3){if(_0x111abe[_0xe831('0x4b')]['id']){delete _0x111abe[_0xe831('0x4b')]['id'];}return db[_0xe831('0x30')][_0xe831('0x4a')]({'where':{'id':_0x111abe['params']['id']}})[_0xe831('0x16')](handleEntityNotFound(_0x45b2c3,null))['then'](saveUpdates(_0x111abe['body'],null))[_0xe831('0x16')](respondWithResult(_0x45b2c3,null))[_0xe831('0x1f')](handleError(_0x45b2c3,null));};exports[_0xe831('0x29')]=function(_0x139851,_0x1c1dcd){return db[_0xe831('0x30')][_0xe831('0x4a')]({'where':{'id':_0x139851[_0xe831('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c1dcd,null))[_0xe831('0x16')](removeEntity(_0x1c1dcd,null))[_0xe831('0x1f')](handleError(_0x1c1dcd,null));};exports[_0xe831('0x4c')]=function(_0xd34d85,_0x8ca8b0){return db[_0xe831('0x30')][_0xe831('0x4c')]()[_0xe831('0x16')](respondWithResult(_0x8ca8b0,null))[_0xe831('0x1f')](handleError(_0x8ca8b0,null));};exports[_0xe831('0x4d')]=function(_0x2ffb84,_0xb90c73){return db[_0xe831('0x30')][_0xe831('0x4d')](_0x2ffb84['body'])['then'](function(_0x380eec){if(_0x380eec){if(_0x380eec[_0xe831('0x4e')]==='out'&&!_0x380eec[_0xe831('0x4f')]){var _0x40f99b,_0x57ae4e,_0xf40095;if(_0x2ffb84[_0xe831('0x4b')]['to']){_0x57ae4e=_0x2ffb84[_0xe831('0x4b')]['to']['split'](',')[0x0];}return db['MailAccount'][_0xe831('0x50')]({'where':{'id':_0x380eec[_0xe831('0x51')]},'include':[{'model':db[_0xe831('0x52')],'as':_0xe831('0x53'),'include':[{'model':db[_0xe831('0x54')],'as':_0xe831('0x55'),'where':{'email':_0x57ae4e},'limit':0x1,'order':[[_0xe831('0x56'),_0xe831('0x57')]]}]},{'model':db[_0xe831('0x58')],'as':_0xe831('0x59'),'raw':!![]}]})['then'](function(_0x1225fd){_0x40f99b=_0x1225fd;if(_0x40f99b&&_0x40f99b['Smtp']){var _0xa0784f={'tls':{'rejectUnauthorized':![]}};if(_[_0xe831('0x5a')](_0x40f99b[_0xe831('0x59')][_0xe831('0x5b')])){_0xa0784f['host']=_0x40f99b[_0xe831('0x59')][_0xe831('0x5c')];_0xa0784f[_0xe831('0x5d')]=_0x40f99b[_0xe831('0x59')]['port'];_0xa0784f[_0xe831('0x5e')]=_0x40f99b[_0xe831('0x59')][_0xe831('0x5e')];if(_0x40f99b[_0xe831('0x59')][_0xe831('0x5f')]){_0xa0784f[_0xe831('0x60')]={'user':_0x40f99b['Smtp'][_0xe831('0x61')],'pass':_0x40f99b[_0xe831('0x59')][_0xe831('0x62')]};}}else{_0xa0784f[_0xe831('0x5b')]=_0x40f99b[_0xe831('0x59')]['service'];_0xa0784f[_0xe831('0x60')]={'user':_0x40f99b['Smtp'][_0xe831('0x61')],'pass':_0x40f99b['Smtp'][_0xe831('0x62')]};_0xa0784f[_0xe831('0x5e')]=_0x40f99b[_0xe831('0x59')][_0xe831('0x5e')];}if(_0x2ffb84[_0xe831('0x4b')]['attachments']&&_0x2ffb84[_0xe831('0x4b')][_0xe831('0x63')][_0xe831('0x3b')]){for(var _0x5c8bd9=0x0;_0x5c8bd9<_0x2ffb84[_0xe831('0x4b')][_0xe831('0x63')][_0xe831('0x3b')];_0x5c8bd9+=0x1){_0x2ffb84[_0xe831('0x4b')][_0xe831('0x63')][_0x5c8bd9]={'filename':_0x2ffb84[_0xe831('0x4b')]['attachments'][_0x5c8bd9][_0xe831('0x2d')],'path':path[_0xe831('0x64')](config[_0xe831('0x65')],_0xe831('0x66'),_0x2ffb84[_0xe831('0x4b')][_0xe831('0x63')][_0x5c8bd9]['basename'])};}}_0xf40095={'account':_0xa0784f,'message':_0x2ffb84[_0xe831('0x4b')]};return;}})[_0xe831('0x16')](function(){if(_0x40f99b[_0xe831('0x53')]){if(_0x40f99b[_0xe831('0x53')]['Contacts'][_0xe831('0x3b')]){return _0x40f99b[_0xe831('0x53')][_0xe831('0x55')][0x0];}else{return db[_0xe831('0x54')][_0xe831('0x4d')](_['defaults'](_0x2ffb84[_0xe831('0x4b')],{'firstName':_0x2ffb84['body']['to'],'email':_0x2ffb84[_0xe831('0x4b')]['to'],'phone':_0x2ffb84[_0xe831('0x4b')]['to'],'ListId':_0x40f99b[_0xe831('0x67')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0xf40095){return respondWithRpcPromise('SendMail','sendMail',_0xf40095,client9003)[_0xe831('0x16')](function(_0x2c0db2){return _0x380eec[_0xe831('0x28')]({'read':!![],'messageId':_0x2c0db2[_0xe831('0x68')],'sentAt':moment()[_0xe831('0x69')](_0xe831('0x6a'))});})[_0xe831('0x1f')](function(_0x169559){logger[_0xe831('0x1c')]('%s',JSON['stringify'](_0x169559));return _0x380eec;});}return _0x380eec;});}return _0x380eec;}})[_0xe831('0x16')](respondWithResult(_0xb90c73,0xc9))[_0xe831('0x1f')](handleError(_0xb90c73,null));};exports[_0xe831('0x6b')]=function(_0x136f0f,_0x39dfdf){var _0x9830c={'agent':{},'channel':_0xe831('0x6c')};if(_0x136f0f[_0xe831('0x4b')]['id']){delete _0x136f0f['body']['id'];}_0x136f0f[_0xe831('0x4b')]['read']=!![];_0x136f0f[_0xe831('0x4b')]['readAt']=moment()[_0xe831('0x69')](_0xe831('0x6a'));_0x136f0f[_0xe831('0x4b')][_0xe831('0x6d')]=_0x136f0f['body']['UserId']||_0x136f0f[_0xe831('0x61')]['id'];_0x9830c['agent']['id']=_0x136f0f[_0xe831('0x4b')][_0xe831('0x6d')];return db[_0xe831('0x30')][_0xe831('0x4a')]({'where':{'id':_0x136f0f[_0xe831('0x49')]['id'],'UserId':null}})[_0xe831('0x16')](handleEntityNotFound(_0x39dfdf,null))[_0xe831('0x16')](saveUpdates(_0x136f0f['body'],null))[_0xe831('0x16')](function(_0x406c93){if(_0x406c93){_0x9830c[_0xe831('0x1e')]=_0x406c93[_0xe831('0x6e')]({'plain':!![]});return db[_0xe831('0x6f')]['find']({'where':{'id':_0x406c93['MailInteractionId']}});}return null;})[_0xe831('0x16')](handleEntityNotFound(_0x39dfdf,null))['then'](function(_0xdd8955){if(_0xdd8955){return _0xdd8955[_0xe831('0x28')]({'UserId':_0x136f0f[_0xe831('0x4b')]['UserId'],'read1stAt':_['isNil'](_0xdd8955[_0xe831('0x70')])?moment()[_0xe831('0x69')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2d66f3){if(_0x2d66f3){_0x9830c[_0xe831('0x71')]=_0x2d66f3[_0xe831('0x6e')]({'plain':!![]});interaction_log[_0xe831('0x17')](_0xe831('0x72'),_0x136f0f[_0xe831('0x61')]['id'],_0x136f0f[_0xe831('0x61')]['name'],_0x136f0f[_0xe831('0x61')]['role'],_0x9830c[_0xe831('0x71')]['id'],_0x136f0f[_0xe831('0x4b')]?JSON[_0xe831('0x1b')](_0x136f0f[_0xe831('0x4b')]):_0xe831('0x73'));return respondWithRpcPromise(_0xe831('0x74'),_0xe831('0x75'),_0x9830c);}return null;})['then'](function(_0x3e1ebb){var _0xad1f4d=_0xe831('0x76')+_0x3e1ebb[_0xe831('0x1e')][_0xe831('0x77')];return db[_0xe831('0x78')][_0xe831('0x38')](_0xad1f4d,{'type':db[_0xe831('0x79')][_0xe831('0x7a')][_0xe831('0x7b')],'raw':!![]})[_0xe831('0x16')](function(_0xafed4){return _0xafed4;});})[_0xe831('0x16')](function(_0x3f0652){if(_0x3f0652){_0x9830c['message']['contact']=_0x3f0652[0x0];if(!_0x136f0f[_0xe831('0x4b')][_0xe831('0x6d')])return;return db['User'][_0xe831('0x4a')]({'where':{'id':_0x136f0f['body'][_0xe831('0x6d')],'role':_0xe831('0x7c')},'attributes':['id',_0xe831('0x2d'),_0xe831('0x7d'),_0xe831('0x7e'),_0xe831('0x7f')],'raw':!![]});}return null;})[_0xe831('0x16')](function(_0xb04a3e){if(!_0xb04a3e)return null;_0x9830c[_0xe831('0x1e')][_0xe831('0x7c')]=_0xb04a3e;return _0x9830c;})[_0xe831('0x16')](function(_0xf97d68){if(_0xf97d68){if(_0x136f0f[_0xe831('0x4b')][_0xe831('0x80')]){_0x9830c[_0xe831('0x1e')]['interface']=util['format']('SIP/%s',_0x136f0f[_0xe831('0x61')][_0xe831('0x2d')]);_0x9830c[_0xe831('0x1e')][_0xe831('0x81')]=_0x9830c[_0xe831('0x81')];_0x9830c[_0xe831('0x1e')]['motionChannel']=_0x9830c[_0xe831('0x81')];_0x9830c[_0xe831('0x1e')][_0xe831('0x82')]=_0xe831('0x6b');_0x9830c[_0xe831('0x1e')]['body']=htmlToText[_0xe831('0x83')](_0x9830c[_0xe831('0x1e')]['body']);return respondWithRpcPromise(_0xe831('0x84'),_0xe831('0x84'),{'event':_0xe831('0x85'),'message':_0x9830c['message']},client9002)[_0xe831('0x16')](function(){return _0x9830c;});}return _0x9830c;}return null;})[_0xe831('0x16')](respondWithResult(_0x39dfdf,null))[_0xe831('0x1f')](handleError(_0x39dfdf,null));};exports[_0xe831('0x86')]=function(_0x20ebfc,_0x1fffc0){var _0x5803e7={'agent':{},'channel':'mail'};if(_0x20ebfc['body']['id']){delete _0x20ebfc['body']['id'];}_0x20ebfc[_0xe831('0x4b')]['UserId']=_0x20ebfc[_0xe831('0x4b')]['UserId']||_0x20ebfc[_0xe831('0x61')]['id'];_0x5803e7['agent']['id']=_0x20ebfc[_0xe831('0x4b')]['UserId'];return db[_0xe831('0x30')]['find']({'where':{'id':_0x20ebfc['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1fffc0,null))[_0xe831('0x16')](function(_0x1859b1){if(_0x1859b1){_0x5803e7[_0xe831('0x1e')]=_0x1859b1[_0xe831('0x6e')]({'plain':!![]});return db['MailInteraction'][_0xe831('0x4a')]({'where':{'id':_0x1859b1['MailInteractionId']}});}return null;})[_0xe831('0x16')](handleEntityNotFound(_0x1fffc0,null))[_0xe831('0x16')](function(_0x48b7ed){if(_0x48b7ed){_0x5803e7[_0xe831('0x71')]=_0x48b7ed[_0xe831('0x6e')]({'plain':!![]});interaction_log[_0xe831('0x17')](_0xe831('0x87'),_0x20ebfc[_0xe831('0x61')]['id'],_0x20ebfc[_0xe831('0x61')]['name'],_0x20ebfc['user'][_0xe831('0x88')],_0x5803e7[_0xe831('0x71')]['id'],_0x20ebfc['body']?JSON[_0xe831('0x1b')](_0x20ebfc[_0xe831('0x4b')]):_0xe831('0x73'));return respondWithRpcPromise('RejectMessage',_0xe831('0x89'),_0x5803e7);}return null;})['then'](function(_0x109b40){var _0x57f3af=_0xe831('0x76')+_0x109b40[_0xe831('0x1e')][_0xe831('0x77')];return db[_0xe831('0x78')][_0xe831('0x38')](_0x57f3af,{'type':db[_0xe831('0x79')]['QueryTypes']['SELECT'],'raw':!![]})[_0xe831('0x16')](function(_0x1e8f6f){return _0x1e8f6f;});})[_0xe831('0x16')](function(_0x15b7f0){if(_0x15b7f0){_0x5803e7[_0xe831('0x1e')]['contact']=_0x15b7f0[0x0];if(!_0x20ebfc['body'][_0xe831('0x6d')])return;return db[_0xe831('0x8a')][_0xe831('0x4a')]({'where':{'id':_0x20ebfc['body']['UserId'],'role':_0xe831('0x7c')},'attributes':['id','name','fullname',_0xe831('0x7e'),'internal'],'raw':!![]});}return null;})[_0xe831('0x16')](function(_0x407d53){if(!_0x407d53)return null;_0x5803e7[_0xe831('0x1e')][_0xe831('0x7c')]=_0x407d53;return _0x5803e7;})[_0xe831('0x16')](function(_0x1c2fed){if(_0x1c2fed){_0x1c2fed['message'][_0xe831('0x8b')]=util[_0xe831('0x69')](_0xe831('0x8c'),_0x20ebfc['user'][_0xe831('0x2d')]);_0x1c2fed[_0xe831('0x1e')][_0xe831('0x81')]=_0x5803e7[_0xe831('0x81')];_0x1c2fed['message'][_0xe831('0x8d')]=_0x5803e7[_0xe831('0x81')];_0x1c2fed[_0xe831('0x1e')]['event']=_0xe831('0x86');_0x1c2fed[_0xe831('0x1e')]['body']=htmlToText[_0xe831('0x83')](_0x5803e7['message'][_0xe831('0x4b')]);respondWithRpcPromise(_0xe831('0x84'),'EventManager',{'event':_0xe831('0x8e'),'message':_0x1c2fed[_0xe831('0x1e')]},client9002);return _0x5803e7;}return null;})[_0xe831('0x16')](respondWithResult(_0x1fffc0,null))[_0xe831('0x1f')](handleError(_0x1fffc0,null));};exports[_0xe831('0x8f')]=function(_0x21ba18,_0x2ee941){var _0x552582=moment()['unix']()[_0xe831('0x90')]();var _0x47fd6b=path[_0xe831('0x64')](config[_0xe831('0x65')],_0xe831('0x91'),'files',_0xe831('0x92'));var _0x411a9a=path[_0xe831('0x64')](config[_0xe831('0x65')],_0xe831('0x91'),_0xe831('0x93'),_0xe831('0x63'));var _0x2f661f=util[_0xe831('0x69')](_0xe831('0x94'),_0x552582);return db[_0xe831('0x30')][_0xe831('0x4a')]({'where':{'id':_0x21ba18[_0xe831('0x49')]['id']},'attributes':['id',_0xe831('0x4b'),_0xe831('0x95'),'to','cc',_0xe831('0x96'),'subject',_0xe831('0x97')],'include':_0x21ba18[_0xe831('0x38')]['attachments']?[{'model':db[_0xe831('0x98')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x2ee941,null))['then'](function(_0x87ded7){if(_0x87ded7){var _0x5049d1=_0x87ded7;var _0x4607c8={'from':_0x5049d1[_0xe831('0x95')],'to':_0x5049d1['to'],'subject':_0x5049d1[_0xe831('0x99')],'html':htmlEntities[_0xe831('0x9a')](_0x5049d1[_0xe831('0x4b')]),'headers':{'Date':moment(_0x5049d1[_0xe831('0x97')])[_0xe831('0x69')](_0xe831('0x9b'))},'attachments':[]};if(_0x87ded7['cc']){_0x4607c8[_0xe831('0x9c')]['Cc']=_0x87ded7['cc'];}if(_0x87ded7[_0xe831('0x96')]){_0x4607c8[_0xe831('0x9c')][_0xe831('0x9d')]=_0x87ded7[_0xe831('0x96')];}return new BPromise(function(_0x401907,_0x10e427){if(_0x87ded7[_0xe831('0x9e')]){for(var _0x495579=0x0;_0x495579<_0x87ded7[_0xe831('0x9e')][_0xe831('0x3b')];_0x495579++){var _0x473add=_0x87ded7['Attachments'][_0x495579];var _0x37b951=path[_0xe831('0x64')](_0x411a9a,_0x473add['basename']);if(fs[_0xe831('0x9f')](_0x37b951)){_0x4607c8[_0xe831('0x63')]['push']({'name':_0x473add[_0xe831('0x2d')],'contentType':_0x473add['type'],'data':fs[_0xe831('0xa0')](_0x37b951)});}}}emlformat[_0xe831('0xa1')](_0x4607c8,function(_0x137f9c,_0x4334e3){if(_0x137f9c)return _0x10e427(_0x137f9c);fs['writeFileSync'](path[_0xe831('0x64')](_0x47fd6b,_0x2f661f),_0x4334e3);return _0x401907(_0x4334e3);});});}})[_0xe831('0x16')](function(_0x533539){if(_0x533539){return _0x2ee941[_0xe831('0x8f')](path[_0xe831('0x64')](_0x47fd6b,_0x2f661f),_0x2f661f,function(_0x301d31){if(!_0x301d31)fs[_0xe831('0xa2')](path[_0xe831('0x64')](_0x47fd6b,_0x2f661f));});}})[_0xe831('0x1f')](handleError(_0x2ee941,null));}; \ No newline at end of file +var _0x6805=['root','server/files/attachments','basename','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','agent','get','MailInteraction','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','reject','MailInteractionId','rejectMessage','QueryTypes','fullname','email','rejectmessage','unix','toString','server','tmp','files','message-%s.eml','from','bcc','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','push','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','offset','count','limit','set','Content-Range','json','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','filter','VIRTUAL','merge','options','MailMessage','include','findAll','show','params','keys','length','includeAll','find','update','body','destroy','describe','create','direction','secret','split','MailAccount','findOne','CmList','List','CmContact','Contacts','updatedAt','DESC','Smtp','isNil','host','port','secure','authentication','auth','user','service','pass','attachments','join'];(function(_0x3e21cc,_0x5e8602){var _0xd89cb3=function(_0x1ab357){while(--_0x1ab357){_0x3e21cc['push'](_0x3e21cc['shift']());}};_0xd89cb3(++_0x5e8602);}(_0x6805,0x18b));var _0x5680=function(_0x44dbfb,_0x46aa41){_0x44dbfb=_0x44dbfb-0x0;var _0x540754=_0x6805[_0x44dbfb];return _0x540754;};'use strict';var emlformat=require(_0x5680('0x0'));var moment=require(_0x5680('0x1'));var BPromise=require(_0x5680('0x2'));var util=require(_0x5680('0x3'));var path=require(_0x5680('0x4'));var fs=require('fs');var _=require(_0x5680('0x5'));var Redis=require(_0x5680('0x6'));var htmlToText=require(_0x5680('0x7'));var qs=require(_0x5680('0x8'));var logger=require('../../config/logger')(_0x5680('0x9'));var interaction_log=require(_0x5680('0xa'))(_0x5680('0xb'));var config=require(_0x5680('0xc'));var db=require(_0x5680('0xd'))['db'];config[_0x5680('0xe')]=_[_0x5680('0xf')](config[_0x5680('0xe')],{'host':_0x5680('0x10'),'port':0x18eb});var socket=require(_0x5680('0x11'))(new Redis(config[_0x5680('0xe')]));var htmlEntities=require(_0x5680('0x12'));require(_0x5680('0x13'))[_0x5680('0x14')](socket);var jayson=require(_0x5680('0x15'));var client=jayson[_0x5680('0x16')][_0x5680('0x17')]({'port':0x232c});var client9003=jayson[_0x5680('0x16')][_0x5680('0x17')]({'port':0x232b});var client9002=jayson[_0x5680('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0xeda472,_0x4cdccf,_0x3085f3,_0x4049e1){return new BPromise(function(_0x207a52,_0x1a4193){var _0x41df70=_0x4049e1||client;return _0x41df70['request'](_0xeda472,_0x3085f3)[_0x5680('0x18')](function(_0x460628){logger['info'](_0x5680('0x19'),_0x4cdccf,_0x5680('0x1a'));logger[_0x5680('0x1b')](_0x5680('0x1c'),_0x4cdccf,_0x5680('0x1a'),JSON[_0x5680('0x1d')](_0x460628));if(_0x460628[_0x5680('0x1e')]){if(_0x460628[_0x5680('0x1e')]['code']===0x1f4){logger[_0x5680('0x1e')](_0x5680('0x19'),_0x4cdccf,_0x460628[_0x5680('0x1e')]['message']);return _0x1a4193(_0x460628[_0x5680('0x1e')][_0x5680('0x1f')]);}logger[_0x5680('0x1e')](_0x5680('0x19'),_0x4cdccf,_0x460628[_0x5680('0x1e')][_0x5680('0x1f')]);return _0x207a52(_0x460628['error'][_0x5680('0x1f')]);}else{logger[_0x5680('0x20')](_0x5680('0x19'),_0x4cdccf,_0x5680('0x1a'));_0x207a52(_0x460628[_0x5680('0x21')][_0x5680('0x1f')]);}})[_0x5680('0x22')](function(_0x19186d){logger[_0x5680('0x1e')](_0x5680('0x19'),_0x4cdccf,_0x19186d);_0x1a4193(_0x19186d);});});}function respondWithResult(_0x2fa4cd,_0x21624f){_0x21624f=_0x21624f||0xc8;return function(_0x3ba413){if(_0x3ba413){return _0x2fa4cd[_0x5680('0x23')](_0x21624f)['json'](_0x3ba413);}};}function respondWithFilteredResult(_0x2dce01,_0x5485f2){return function(_0x5c58ae){if(_0x5c58ae){var _0x961a54=typeof _0x5485f2[_0x5680('0x24')]==='undefined'&&typeof _0x5485f2['limit']==='undefined';var _0x2ab81a=_0x5c58ae[_0x5680('0x25')];var _0x4ee26e=_0x961a54?0x0:_0x5485f2[_0x5680('0x24')];var _0x3decf0=_0x961a54?_0x5c58ae['count']:_0x5485f2[_0x5680('0x24')]+_0x5485f2[_0x5680('0x26')];var _0x53eb2a;if(_0x3decf0>=_0x2ab81a){_0x3decf0=_0x2ab81a;_0x53eb2a=0xc8;}else{_0x53eb2a=0xce;}_0x2dce01['status'](_0x53eb2a);return _0x2dce01[_0x5680('0x27')](_0x5680('0x28'),_0x4ee26e+'-'+_0x3decf0+'/'+_0x2ab81a)[_0x5680('0x29')](_0x5c58ae);}return null;};}function saveUpdates(_0x5eb415){return function(_0x41e26a){if(_0x41e26a){return _0x41e26a['update'](_0x5eb415)[_0x5680('0x18')](function(_0x42d8cc){return _0x42d8cc;});}return null;};}function removeEntity(_0x350d82){return function(_0x275d6f){if(_0x275d6f){return _0x275d6f['destroy']()[_0x5680('0x18')](function(){_0x350d82[_0x5680('0x23')](0xcc)[_0x5680('0x2a')]();});}};}function handleEntityNotFound(_0x1e0be2){return function(_0x564876){if(!_0x564876){_0x1e0be2[_0x5680('0x2b')](0x194);}return _0x564876;};}function handleError(_0xd0abf7,_0xd4fe9c){_0xd4fe9c=_0xd4fe9c||0x1f4;return function(_0x5680b8){logger[_0x5680('0x1e')](_0x5680b8[_0x5680('0x2c')]);if(_0x5680b8[_0x5680('0x2d')]){delete _0x5680b8['name'];}_0xd0abf7['status'](_0xd4fe9c)[_0x5680('0x2e')](_0x5680b8);};}exports[_0x5680('0x2f')]=function(_0x4d21e4,_0x31990a){var _0x2a3ac6={},_0x210bf9={},_0x18d50a={'count':0x0,'rows':[]};var _0x5aa396=_[_0x5680('0x30')](db['MailMessage'][_0x5680('0x31')],function(_0x57c5fd){return{'name':_0x57c5fd[_0x5680('0x32')],'type':_0x57c5fd[_0x5680('0x33')][_0x5680('0x34')]};});_0x210bf9[_0x5680('0x35')]=_[_0x5680('0x30')](_0x5aa396,_0x5680('0x2d'));_0x210bf9[_0x5680('0x36')]=_['keys'](_0x4d21e4[_0x5680('0x36')]);_0x210bf9['filters']=_[_0x5680('0x37')](_0x210bf9['model'],_0x210bf9[_0x5680('0x36')]);_0x2a3ac6[_0x5680('0x38')]=_[_0x5680('0x37')](_0x210bf9[_0x5680('0x35')],qs[_0x5680('0x39')](_0x4d21e4[_0x5680('0x36')][_0x5680('0x39')]));_0x2a3ac6['attributes']=_0x2a3ac6[_0x5680('0x38')]['length']?_0x2a3ac6[_0x5680('0x38')]:_0x210bf9[_0x5680('0x35')];if(!_0x4d21e4[_0x5680('0x36')][_0x5680('0x3a')]('nolimit')){_0x2a3ac6[_0x5680('0x26')]=qs[_0x5680('0x26')](_0x4d21e4['query'][_0x5680('0x26')]);_0x2a3ac6[_0x5680('0x24')]=qs[_0x5680('0x24')](_0x4d21e4['query'][_0x5680('0x24')]);}_0x2a3ac6['order']=qs['sort'](_0x4d21e4[_0x5680('0x36')][_0x5680('0x3b')]);_0x2a3ac6[_0x5680('0x3c')]=qs[_0x5680('0x3d')](_['pick'](_0x4d21e4[_0x5680('0x36')],_0x210bf9[_0x5680('0x3d')]),_0x5aa396);if(_0x4d21e4[_0x5680('0x36')][_0x5680('0x3e')]){_0x2a3ac6[_0x5680('0x3c')]=_['merge'](_0x2a3ac6['where'],{'$or':_[_0x5680('0x30')](_0x5aa396,function(_0x2f8b2a){if(_0x2f8b2a[_0x5680('0x33')]!==_0x5680('0x3f')){var _0x260f84={};_0x260f84[_0x2f8b2a[_0x5680('0x2d')]]={'$like':'%'+_0x4d21e4[_0x5680('0x36')][_0x5680('0x3e')]+'%'};return _0x260f84;}})});}_0x2a3ac6=_[_0x5680('0x40')]({},_0x2a3ac6,_0x4d21e4[_0x5680('0x41')]);var _0x5e28f7={'where':_0x2a3ac6['where']};return db[_0x5680('0x42')][_0x5680('0x25')](_0x5e28f7)[_0x5680('0x18')](function(_0x290d69){_0x18d50a[_0x5680('0x25')]=_0x290d69;if(_0x4d21e4[_0x5680('0x36')]['includeAll']){_0x2a3ac6[_0x5680('0x43')]=[{'all':!![]}];}return db[_0x5680('0x42')][_0x5680('0x44')](_0x2a3ac6);})['then'](function(_0x5272ef){_0x18d50a['rows']=_0x5272ef;return _0x18d50a;})[_0x5680('0x18')](respondWithFilteredResult(_0x31990a,_0x2a3ac6))[_0x5680('0x22')](handleError(_0x31990a,null));};exports[_0x5680('0x45')]=function(_0x26a0c6,_0x14458f){var _0x27d971={'raw':!![],'where':{'id':_0x26a0c6[_0x5680('0x46')]['id']}},_0xd25e98={};_0xd25e98[_0x5680('0x35')]=_[_0x5680('0x47')](db['MailMessage'][_0x5680('0x31')]);_0xd25e98['query']=_[_0x5680('0x47')](_0x26a0c6[_0x5680('0x36')]);_0xd25e98[_0x5680('0x3d')]=_['intersection'](_0xd25e98['model'],_0xd25e98['query']);_0x27d971[_0x5680('0x38')]=_[_0x5680('0x37')](_0xd25e98['model'],qs[_0x5680('0x39')](_0x26a0c6[_0x5680('0x36')][_0x5680('0x39')]));_0x27d971[_0x5680('0x38')]=_0x27d971[_0x5680('0x38')][_0x5680('0x48')]?_0x27d971[_0x5680('0x38')]:_0xd25e98[_0x5680('0x35')];if(_0x26a0c6[_0x5680('0x36')][_0x5680('0x49')]){_0x27d971[_0x5680('0x43')]=[{'all':!![]}];}_0x27d971=_[_0x5680('0x40')]({},_0x27d971,_0x26a0c6['options']);return db[_0x5680('0x42')][_0x5680('0x4a')](_0x27d971)[_0x5680('0x18')](handleEntityNotFound(_0x14458f,null))[_0x5680('0x18')](respondWithResult(_0x14458f,null))[_0x5680('0x22')](handleError(_0x14458f,null));};exports[_0x5680('0x4b')]=function(_0xb15f5f,_0x36f453){if(_0xb15f5f[_0x5680('0x4c')]['id']){delete _0xb15f5f[_0x5680('0x4c')]['id'];}return db[_0x5680('0x42')][_0x5680('0x4a')]({'where':{'id':_0xb15f5f[_0x5680('0x46')]['id']}})[_0x5680('0x18')](handleEntityNotFound(_0x36f453,null))[_0x5680('0x18')](saveUpdates(_0xb15f5f['body'],null))[_0x5680('0x18')](respondWithResult(_0x36f453,null))[_0x5680('0x22')](handleError(_0x36f453,null));};exports[_0x5680('0x4d')]=function(_0x86e1eb,_0x5b1b44){return db['MailMessage']['find']({'where':{'id':_0x86e1eb[_0x5680('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b1b44,null))[_0x5680('0x18')](removeEntity(_0x5b1b44,null))[_0x5680('0x22')](handleError(_0x5b1b44,null));};exports[_0x5680('0x4e')]=function(_0x49d7d7,_0x5a9c2a){return db['MailMessage']['describe']()[_0x5680('0x18')](respondWithResult(_0x5a9c2a,null))[_0x5680('0x22')](handleError(_0x5a9c2a,null));};exports[_0x5680('0x4f')]=function(_0x4db797,_0xc060a9){return db[_0x5680('0x42')][_0x5680('0x4f')](_0x4db797[_0x5680('0x4c')])[_0x5680('0x18')](function(_0x3e1b52){if(_0x3e1b52){if(_0x3e1b52[_0x5680('0x50')]==='out'&&!_0x3e1b52[_0x5680('0x51')]){var _0xc9aa52,_0x241c36,_0x5972f9;if(_0x4db797[_0x5680('0x4c')]['to']){_0x241c36=_0x4db797[_0x5680('0x4c')]['to'][_0x5680('0x52')](',')[0x0];}return db[_0x5680('0x53')][_0x5680('0x54')]({'where':{'id':_0x3e1b52['MailAccountId']},'include':[{'model':db[_0x5680('0x55')],'as':_0x5680('0x56'),'include':[{'model':db[_0x5680('0x57')],'as':_0x5680('0x58'),'where':{'email':_0x241c36},'limit':0x1,'order':[[_0x5680('0x59'),_0x5680('0x5a')]]}]},{'model':db['MailServerOut'],'as':_0x5680('0x5b'),'raw':!![]}]})[_0x5680('0x18')](function(_0x50fda0){_0xc9aa52=_0x50fda0;if(_0xc9aa52&&_0xc9aa52[_0x5680('0x5b')]){var _0x3b988f={'tls':{'rejectUnauthorized':![]}};if(_[_0x5680('0x5c')](_0xc9aa52[_0x5680('0x5b')]['service'])){_0x3b988f[_0x5680('0x5d')]=_0xc9aa52[_0x5680('0x5b')][_0x5680('0x5d')];_0x3b988f[_0x5680('0x5e')]=_0xc9aa52[_0x5680('0x5b')][_0x5680('0x5e')];_0x3b988f['secure']=_0xc9aa52[_0x5680('0x5b')][_0x5680('0x5f')];if(_0xc9aa52[_0x5680('0x5b')][_0x5680('0x60')]){_0x3b988f[_0x5680('0x61')]={'user':_0xc9aa52['Smtp'][_0x5680('0x62')],'pass':_0xc9aa52[_0x5680('0x5b')]['pass']};}}else{_0x3b988f['service']=_0xc9aa52[_0x5680('0x5b')][_0x5680('0x63')];_0x3b988f['auth']={'user':_0xc9aa52[_0x5680('0x5b')][_0x5680('0x62')],'pass':_0xc9aa52[_0x5680('0x5b')][_0x5680('0x64')]};_0x3b988f['secure']=_0xc9aa52[_0x5680('0x5b')][_0x5680('0x5f')];}if(_0x4db797[_0x5680('0x4c')][_0x5680('0x65')]&&_0x4db797[_0x5680('0x4c')][_0x5680('0x65')][_0x5680('0x48')]){for(var _0x419653=0x0;_0x419653<_0x4db797[_0x5680('0x4c')][_0x5680('0x65')][_0x5680('0x48')];_0x419653+=0x1){_0x4db797[_0x5680('0x4c')][_0x5680('0x65')][_0x419653]={'filename':_0x4db797['body'][_0x5680('0x65')][_0x419653][_0x5680('0x2d')],'path':path[_0x5680('0x66')](config[_0x5680('0x67')],_0x5680('0x68'),_0x4db797[_0x5680('0x4c')]['attachments'][_0x419653][_0x5680('0x69')])};}}_0x5972f9={'account':_0x3b988f,'message':_0x4db797[_0x5680('0x4c')]};return;}})[_0x5680('0x18')](function(){if(_0xc9aa52[_0x5680('0x56')]){if(_0xc9aa52[_0x5680('0x56')][_0x5680('0x58')]['length']){return _0xc9aa52['List'][_0x5680('0x58')][0x0];}else{return db['CmContact']['create'](_[_0x5680('0xf')](_0x4db797[_0x5680('0x4c')],{'firstName':_0x4db797[_0x5680('0x4c')]['to'],'email':_0x4db797['body']['to'],'phone':_0x4db797[_0x5680('0x4c')]['to'],'ListId':_0xc9aa52[_0x5680('0x6a')]}));}}else{throw new Error(_0x5680('0x6b'));}})[_0x5680('0x18')](function(){if(_0x5972f9){return respondWithRpcPromise('SendMail',_0x5680('0x6c'),_0x5972f9,client9003)[_0x5680('0x18')](function(_0x2637ef){return _0x3e1b52[_0x5680('0x4b')]({'read':!![],'messageId':_0x2637ef[_0x5680('0x6d')],'sentAt':moment()[_0x5680('0x6e')](_0x5680('0x6f'))});})[_0x5680('0x22')](function(_0x553357){logger['error']('%s',JSON[_0x5680('0x1d')](_0x553357));return _0x3e1b52;});}return _0x3e1b52;});}return _0x3e1b52;}})[_0x5680('0x18')](respondWithResult(_0xc060a9,0xc9))[_0x5680('0x22')](handleError(_0xc060a9,null));};exports['accept']=function(_0x533466,_0x53437){var _0x4da221={'agent':{},'channel':_0x5680('0x70')};if(_0x533466['body']['id']){delete _0x533466[_0x5680('0x4c')]['id'];}_0x533466[_0x5680('0x4c')][_0x5680('0x71')]=!![];_0x533466['body'][_0x5680('0x72')]=moment()[_0x5680('0x6e')]('YYYY-MM-DD\x20HH:mm:ss');_0x533466[_0x5680('0x4c')]['UserId']=_0x533466['body'][_0x5680('0x73')]||_0x533466[_0x5680('0x62')]['id'];_0x4da221[_0x5680('0x74')]['id']=_0x533466[_0x5680('0x4c')]['UserId'];return db[_0x5680('0x42')][_0x5680('0x4a')]({'where':{'id':_0x533466[_0x5680('0x46')]['id'],'UserId':null}})[_0x5680('0x18')](handleEntityNotFound(_0x53437,null))[_0x5680('0x18')](saveUpdates(_0x533466[_0x5680('0x4c')],null))[_0x5680('0x18')](function(_0xc7fafa){if(_0xc7fafa){_0x4da221[_0x5680('0x1f')]=_0xc7fafa[_0x5680('0x75')]({'plain':!![]});return db[_0x5680('0x76')][_0x5680('0x4a')]({'where':{'id':_0xc7fafa['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x53437,null))[_0x5680('0x18')](function(_0x21d5f8){if(_0x21d5f8){return _0x21d5f8['update']({'UserId':_0x533466[_0x5680('0x4c')]['UserId'],'read1stAt':_[_0x5680('0x5c')](_0x21d5f8['read1stAt'])?moment()[_0x5680('0x6e')](_0x5680('0x6f')):undefined});}return null;})[_0x5680('0x18')](function(_0x44ffbc){if(_0x44ffbc){_0x4da221[_0x5680('0x77')]=_0x44ffbc[_0x5680('0x75')]({'plain':!![]});interaction_log[_0x5680('0x20')](_0x5680('0x78'),_0x533466[_0x5680('0x62')]['id'],_0x533466[_0x5680('0x62')][_0x5680('0x2d')],_0x533466[_0x5680('0x62')][_0x5680('0x79')],_0x4da221[_0x5680('0x77')]['id'],_0x533466[_0x5680('0x4c')]?JSON[_0x5680('0x1d')](_0x533466['body']):_0x5680('0x7a'));return respondWithRpcPromise(_0x5680('0x7b'),'acceptMessage',_0x4da221);}return null;})[_0x5680('0x18')](function(_0x1ed68b){var _0x5cc524=_0x5680('0x7c')+_0x1ed68b['message'][_0x5680('0x7d')];return db[_0x5680('0x7e')][_0x5680('0x36')](_0x5cc524,{'type':db[_0x5680('0x7f')]['QueryTypes']['SELECT'],'raw':!![]})[_0x5680('0x18')](function(_0x21d96d){return _0x21d96d;});})[_0x5680('0x18')](function(_0x48a13b){if(_0x48a13b){_0x4da221[_0x5680('0x1f')][_0x5680('0x80')]=_0x48a13b[0x0];if(!_0x533466[_0x5680('0x4c')][_0x5680('0x73')])return;return db['User'][_0x5680('0x4a')]({'where':{'id':_0x533466[_0x5680('0x4c')][_0x5680('0x73')],'role':'agent'},'attributes':['id','name','fullname','email',_0x5680('0x81')],'raw':!![]});}return null;})[_0x5680('0x18')](function(_0xa23062){if(!_0xa23062)return null;_0x4da221[_0x5680('0x1f')][_0x5680('0x74')]=_0xa23062;return _0x4da221;})[_0x5680('0x18')](function(_0x5f3a8c){if(_0x5f3a8c){if(_0x533466[_0x5680('0x4c')][_0x5680('0x82')]){_0x4da221['message'][_0x5680('0x83')]=util['format'](_0x5680('0x84'),_0x533466[_0x5680('0x62')][_0x5680('0x2d')]);_0x4da221[_0x5680('0x1f')][_0x5680('0x85')]=_0x4da221[_0x5680('0x85')];_0x4da221[_0x5680('0x1f')][_0x5680('0x86')]=_0x4da221[_0x5680('0x85')];_0x4da221[_0x5680('0x1f')][_0x5680('0x87')]=_0x5680('0x88');_0x4da221['message']['body']=htmlToText[_0x5680('0x89')](_0x4da221[_0x5680('0x1f')][_0x5680('0x4c')]);return respondWithRpcPromise('EventManager',_0x5680('0x8a'),{'event':'acceptmessage','message':_0x4da221[_0x5680('0x1f')]},client9002)[_0x5680('0x18')](function(){return _0x4da221;});}return _0x4da221;}return null;})[_0x5680('0x18')](respondWithResult(_0x53437,null))['catch'](handleError(_0x53437,null));};exports[_0x5680('0x8b')]=function(_0x8b4782,_0x2511fa){var _0x3f5065={'agent':{},'channel':_0x5680('0x70')};if(_0x8b4782['body']['id']){delete _0x8b4782[_0x5680('0x4c')]['id'];}_0x8b4782[_0x5680('0x4c')]['UserId']=_0x8b4782[_0x5680('0x4c')][_0x5680('0x73')]||_0x8b4782[_0x5680('0x62')]['id'];_0x3f5065['agent']['id']=_0x8b4782[_0x5680('0x4c')][_0x5680('0x73')];return db['MailMessage'][_0x5680('0x4a')]({'where':{'id':_0x8b4782[_0x5680('0x46')]['id'],'UserId':null}})[_0x5680('0x18')](handleEntityNotFound(_0x2511fa,null))[_0x5680('0x18')](function(_0x5ace2c){if(_0x5ace2c){_0x3f5065[_0x5680('0x1f')]=_0x5ace2c[_0x5680('0x75')]({'plain':!![]});return db[_0x5680('0x76')][_0x5680('0x4a')]({'where':{'id':_0x5ace2c[_0x5680('0x8c')]}});}return null;})[_0x5680('0x18')](handleEntityNotFound(_0x2511fa,null))[_0x5680('0x18')](function(_0x9bac3d){if(_0x9bac3d){_0x3f5065[_0x5680('0x77')]=_0x9bac3d[_0x5680('0x75')]({'plain':!![]});interaction_log[_0x5680('0x20')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x8b4782['user']['id'],_0x8b4782[_0x5680('0x62')][_0x5680('0x2d')],_0x8b4782['user']['role'],_0x3f5065['interaction']['id'],_0x8b4782['body']?JSON[_0x5680('0x1d')](_0x8b4782[_0x5680('0x4c')]):_0x5680('0x7a'));return respondWithRpcPromise('RejectMessage',_0x5680('0x8d'),_0x3f5065);}return null;})['then'](function(_0x51d6bc){var _0x5c8434=_0x5680('0x7c')+_0x51d6bc[_0x5680('0x1f')][_0x5680('0x7d')];return db[_0x5680('0x7e')][_0x5680('0x36')](_0x5c8434,{'type':db[_0x5680('0x7f')][_0x5680('0x8e')]['SELECT'],'raw':!![]})[_0x5680('0x18')](function(_0x4a693d){return _0x4a693d;});})[_0x5680('0x18')](function(_0x32415c){if(_0x32415c){_0x3f5065[_0x5680('0x1f')]['contact']=_0x32415c[0x0];if(!_0x8b4782[_0x5680('0x4c')][_0x5680('0x73')])return;return db['User'][_0x5680('0x4a')]({'where':{'id':_0x8b4782[_0x5680('0x4c')][_0x5680('0x73')],'role':_0x5680('0x74')},'attributes':['id',_0x5680('0x2d'),_0x5680('0x8f'),_0x5680('0x90'),'internal'],'raw':!![]});}return null;})[_0x5680('0x18')](function(_0x12b337){if(!_0x12b337)return null;_0x3f5065[_0x5680('0x1f')]['agent']=_0x12b337;return _0x3f5065;})[_0x5680('0x18')](function(_0x3a4cbc){if(_0x3a4cbc){_0x3a4cbc[_0x5680('0x1f')][_0x5680('0x83')]=util[_0x5680('0x6e')](_0x5680('0x84'),_0x8b4782[_0x5680('0x62')]['name']);_0x3a4cbc[_0x5680('0x1f')][_0x5680('0x85')]=_0x3f5065['channel'];_0x3a4cbc[_0x5680('0x1f')][_0x5680('0x86')]=_0x3f5065['channel'];_0x3a4cbc[_0x5680('0x1f')][_0x5680('0x87')]=_0x5680('0x8b');_0x3a4cbc[_0x5680('0x1f')]['body']=htmlToText['fromString'](_0x3f5065[_0x5680('0x1f')][_0x5680('0x4c')]);respondWithRpcPromise(_0x5680('0x8a'),_0x5680('0x8a'),{'event':_0x5680('0x91'),'message':_0x3a4cbc[_0x5680('0x1f')]},client9002);return _0x3f5065;}return null;})[_0x5680('0x18')](respondWithResult(_0x2511fa,null))[_0x5680('0x22')](handleError(_0x2511fa,null));};exports['download']=function(_0x385743,_0x4488d7){var _0x1e7e30=moment()[_0x5680('0x92')]()[_0x5680('0x93')]();var _0x295ec0=path[_0x5680('0x66')](config[_0x5680('0x67')],_0x5680('0x94'),'files',_0x5680('0x95'));var _0x553fa8=path[_0x5680('0x66')](config[_0x5680('0x67')],'server',_0x5680('0x96'),_0x5680('0x65'));var _0xb95b57=util['format'](_0x5680('0x97'),_0x1e7e30);return db[_0x5680('0x42')][_0x5680('0x4a')]({'where':{'id':_0x385743[_0x5680('0x46')]['id']},'attributes':['id',_0x5680('0x4c'),_0x5680('0x98'),'to','cc',_0x5680('0x99'),_0x5680('0x9a'),_0x5680('0x9b')],'include':_0x385743['query'][_0x5680('0x65')]?[{'model':db['Attachment'],'as':_0x5680('0x9c')}]:undefined})[_0x5680('0x18')](handleEntityNotFound(_0x4488d7,null))[_0x5680('0x18')](function(_0x1f35d5){if(_0x1f35d5){var _0x5c0900=_0x1f35d5;var _0x2603b9={'from':_0x5c0900[_0x5680('0x98')],'to':_0x5c0900['to'],'subject':_0x5c0900[_0x5680('0x9a')],'html':htmlEntities[_0x5680('0x9d')](_0x5c0900[_0x5680('0x4c')]),'headers':{'Date':moment(_0x5c0900[_0x5680('0x9b')])[_0x5680('0x6e')](_0x5680('0x9e'))},'attachments':[]};if(_0x1f35d5['cc']){_0x2603b9[_0x5680('0x9f')]['Cc']=_0x1f35d5['cc'];}if(_0x1f35d5[_0x5680('0x99')]){_0x2603b9[_0x5680('0x9f')]['Bcc']=_0x1f35d5[_0x5680('0x99')];}return new BPromise(function(_0x11af20,_0x3a64e4){if(_0x1f35d5['Attachments']){for(var _0xd484b=0x0;_0xd484b<_0x1f35d5[_0x5680('0x9c')][_0x5680('0x48')];_0xd484b++){var _0x966f46=_0x1f35d5['Attachments'][_0xd484b];var _0x409b72=path[_0x5680('0x66')](_0x553fa8,_0x966f46[_0x5680('0x69')]);if(fs['existsSync'](_0x409b72)){_0x2603b9[_0x5680('0x65')][_0x5680('0xa0')]({'name':_0x966f46['name'],'contentType':_0x966f46[_0x5680('0x33')],'data':fs[_0x5680('0xa1')](_0x409b72)});}}}emlformat[_0x5680('0xa2')](_0x2603b9,function(_0x36e62a,_0x396c5e){if(_0x36e62a)return _0x3a64e4(_0x36e62a);fs[_0x5680('0xa3')](path['join'](_0x295ec0,_0xb95b57),_0x396c5e);return _0x11af20(_0x396c5e);});});}})[_0x5680('0x18')](function(_0x522d0a){if(_0x522d0a){return _0x4488d7[_0x5680('0xa4')](path['join'](_0x295ec0,_0xb95b57),_0xb95b57,function(_0x1dbd88){if(!_0x1dbd88)fs[_0x5680('0xa5')](path[_0x5680('0x66')](_0x295ec0,_0xb95b57));});}})['catch'](handleError(_0x4488d7,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 5a7710d..2be5b2c 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 _0x9474=['emit','hook','exports','events','../../mysqldb'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0x9474,0x1cf));var _0x4947=function(_0x2dd752,_0x59b4fc){_0x2dd752=_0x2dd752-0x0;var _0x297823=_0x9474[_0x2dd752];return _0x297823;};'use strict';var EventEmitter=require(_0x4947('0x0'));var MailMessage=require(_0x4947('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5eaa24){return function(_0x3fef2f,_0x2ad3a1,_0x25b59e){MailMessageEvents['emit'](_0x5eaa24+':'+_0x3fef2f['id'],_0x3fef2f);MailMessageEvents[_0x4947('0x2')](_0x5eaa24,_0x3fef2f);_0x25b59e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x4947('0x3')](e,emitEvent(event));}}module[_0x4947('0x4')]=MailMessageEvents; \ No newline at end of file +var _0xc08d=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x5f1b03,_0x27facc){var _0x51f01b=function(_0x26864e){while(--_0x26864e){_0x5f1b03['push'](_0x5f1b03['shift']());}};_0x51f01b(++_0x27facc);}(_0xc08d,0xf5));var _0xdc08=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xc08d[_0x369151];return _0x4292d5;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xdc08('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xdc08('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdc08('0x2'),'afterDestroy':_0xdc08('0x3')};function emitEvent(_0x5b1bdc){return function(_0x3bdc9b,_0x183b5c,_0x48fa0f){MailMessageEvents[_0xdc08('0x4')](_0x5b1bdc+':'+_0x3bdc9b['id'],_0x3bdc9b);MailMessageEvents['emit'](_0x5b1bdc,_0x3bdc9b);_0x48fa0f(null);};}for(var e in events){if(events[_0xdc08('0x5')](e)){var event=events[e];MailMessage[_0xdc08('0x6')](e,emitEvent(event));}}module[_0xdc08('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 62e49f9..c915a9f 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 _0x7c50=['define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','get','direction','toLowerCase','out','UserId','MailInteraction','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','html-to-text','path','rimraf','../../config/environment','exports'];(function(_0x142136,_0x299f33){var _0x549126=function(_0x113edf){while(--_0x113edf){_0x142136['push'](_0x142136['shift']());}};_0x549126(++_0x299f33);}(_0x7c50,0x135));var _0x07c5=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x7c50[_0x292f93];return _0x5a94b1;};'use strict';var _=require(_0x07c5('0x0'));var util=require(_0x07c5('0x1'));var logger=require(_0x07c5('0x2'))(_0x07c5('0x3'));var moment=require(_0x07c5('0x4'));var BPromise=require('bluebird');var rp=require(_0x07c5('0x5'));var htmlToText=require(_0x07c5('0x6'));var fs=require('fs');var path=require(_0x07c5('0x7'));var rimraf=require(_0x07c5('0x8'));var config=require(_0x07c5('0x9'));var attributes=require('./mailMessage.attributes');module[_0x07c5('0xa')]=function(_0xcc3d92,_0x16d0a2){return _0xcc3d92[_0x07c5('0xb')](_0x07c5('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x07c5('0xd'),'fields':[_0x07c5('0xd')]},{'name':_0x07c5('0xe'),'fields':[_0x07c5('0xf'),_0x07c5('0x10')],'type':_0x07c5('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x365507,_0x2f0fe3,_0x52d08e){if(_0x365507['body']){_0x365507[_0x07c5('0xf')]=htmlToText[_0x07c5('0x12')](_0x365507[_0x07c5('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x52d08e(null,_0x2f0fe3);},'afterCreate':function(_0x222342,_0x4b585c,_0x3805a0){var _0x58d468=_0xcc3d92['models'];var _0x326e6d=_0x222342[_0x07c5('0x14')]({'plain':!![]});if(_0x326e6d[_0x07c5('0x15')][_0x07c5('0x16')]()==='in'||_0x326e6d['direction'][_0x07c5('0x16')]()===_0x07c5('0x17')&&!_0x326e6d['secret']&&!_['isNil'](_0x326e6d[_0x07c5('0x18')])){_0x58d468[_0x07c5('0x19')]['findOne']({'where':{'id':_0x326e6d['MailInteractionId']}})[_0x07c5('0x1a')](function(_0x5c8f9c){if(_0x5c8f9c){_0x5c8f9c[_0x07c5('0x1b')]({'lastMsgAt':_0x326e6d['createdAt'],'lastMsgDirection':_0x326e6d[_0x07c5('0x15')]['toLowerCase']()});}})[_0x07c5('0x1c')](function(_0x22724e){console[_0x07c5('0x1d')](_0x22724e);});}_0x3805a0();}},'charset':_0x07c5('0x1e'),'collate':_0x07c5('0x1f')});}; \ No newline at end of file +var _0xc689=['secret','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','html-to-text','path','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out'];(function(_0x35f58e,_0x36c73c){var _0x307911=function(_0x49824d){while(--_0x49824d){_0x35f58e['push'](_0x35f58e['shift']());}};_0x307911(++_0x36c73c);}(_0xc689,0x12a));var _0x9c68=function(_0xd8a8af,_0x1e93f0){_0xd8a8af=_0xd8a8af-0x0;var _0x5b7278=_0xc689[_0xd8a8af];return _0x5b7278;};'use strict';var _=require(_0x9c68('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9c68('0x1'));var moment=require(_0x9c68('0x2'));var BPromise=require(_0x9c68('0x3'));var rp=require('request-promise');var htmlToText=require(_0x9c68('0x4'));var fs=require('fs');var path=require(_0x9c68('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0x9c68('0x6')]=function(_0x37ad01,_0x3b2505){return _0x37ad01[_0x9c68('0x7')](_0x9c68('0x8'),attributes,{'tableName':_0x9c68('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x9c68('0xa')]},{'name':_0x9c68('0xb'),'fields':[_0x9c68('0xc'),_0x9c68('0xd')],'type':_0x9c68('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5a7919,_0x598017,_0x31b6eb){if(_0x5a7919[_0x9c68('0xf')]){_0x5a7919['plainBody']=htmlToText[_0x9c68('0x10')](_0x5a7919[_0x9c68('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x31b6eb(null,_0x598017);},'afterCreate':function(_0x3e3001,_0x45bbc1,_0x19835e){var _0x5a00be=_0x37ad01[_0x9c68('0x11')];var _0x24b78d=_0x3e3001[_0x9c68('0x12')]({'plain':!![]});if(_0x24b78d[_0x9c68('0x13')]['toLowerCase']()==='in'||_0x24b78d[_0x9c68('0x13')][_0x9c68('0x14')]()===_0x9c68('0x15')&&!_0x24b78d[_0x9c68('0x16')]&&!_['isNil'](_0x24b78d[_0x9c68('0x17')])){_0x5a00be[_0x9c68('0x18')][_0x9c68('0x19')]({'where':{'id':_0x24b78d[_0x9c68('0x1a')]}})['then'](function(_0x469f4b){if(_0x469f4b){_0x469f4b[_0x9c68('0x1b')]({'lastMsgAt':_0x24b78d[_0x9c68('0x1c')],'lastMsgDirection':_0x24b78d[_0x9c68('0x13')][_0x9c68('0x14')]()});}})['catch'](function(_0x4d5c96){console[_0x9c68('0x1d')](_0x4d5c96);});}_0x19835e();}},'charset':_0x9c68('0x1e'),'collate':_0x9c68('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 0b26bea..fc28256 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 _0x80ed=['create','options','raw','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateMailMessage','MailMessage'];(function(_0x2f6902,_0x1c2968){var _0x24b591=function(_0x29d4dd){while(--_0x29d4dd){_0x2f6902['push'](_0x2f6902['shift']());}};_0x24b591(++_0x1c2968);}(_0x80ed,0x11c));var _0xd80e=function(_0x4afb67,_0x1a7583){_0x4afb67=_0x4afb67-0x0;var _0x1b11c6=_0x80ed[_0x4afb67];return _0x1b11c6;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});config['redis']=_[_0xd80e('0xb')](config[_0xd80e('0xc')],{'host':_0xd80e('0xd'),'port':0x18eb});var socket=require(_0xd80e('0xe'))(new Redis(config[_0xd80e('0xc')]));require(_0xd80e('0xf'))[_0xd80e('0x10')](socket);function respondWithRpcPromise(_0x2457f5,_0x68625,_0x7f93b4){return new BPromise(function(_0x4eee08,_0x450b44){return client[_0xd80e('0x11')](_0x2457f5,_0x7f93b4)[_0xd80e('0x12')](function(_0x30c9d0){logger[_0xd80e('0x13')](_0xd80e('0x14'),_0x68625,_0xd80e('0x15'));logger[_0xd80e('0x16')](_0xd80e('0x17'),_0x68625,'request\x20sent',JSON['stringify'](_0x30c9d0));if(_0x30c9d0['error']){if(_0x30c9d0['error'][_0xd80e('0x18')]===0x1f4){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x450b44(_0x30c9d0['error'][_0xd80e('0x1a')]);}logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x4eee08(_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);}else{logger[_0xd80e('0x13')]('MailMessage,\x20%s,\x20%s',_0x68625,_0xd80e('0x15'));_0x4eee08(_0x30c9d0[_0xd80e('0x1b')][_0xd80e('0x1a')]);}})[_0xd80e('0x1c')](function(_0x593af6){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x593af6);_0x450b44(_0x593af6);});});}exports[_0xd80e('0x1d')]=function(_0x527237){var _0x41417d=this;return new Promise(function(_0x2ef8a1,_0x2765ea){return db[_0xd80e('0x1e')][_0xd80e('0x1f')](_0x527237['body'],{'raw':_0x527237['options']?_0x527237[_0xd80e('0x20')][_0xd80e('0x21')]===undefined?!![]:![]:!![]})[_0xd80e('0x12')](function(_0x2d46e7){logger[_0xd80e('0x13')](_0xd80e('0x1d'),_0x527237);logger[_0xd80e('0x16')]('CreateMailMessage',_0x527237,JSON[_0xd80e('0x22')](_0x2d46e7));_0x2ef8a1(_0x2d46e7);})[_0xd80e('0x1c')](function(_0x170109){logger['error'](_0xd80e('0x1d'),_0x170109[_0xd80e('0x1a')],_0x527237);_0x2765ea(_0x41417d[_0xd80e('0x19')](0x1f4,_0x170109['message']));});});}; \ No newline at end of file +var _0x1eba=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','then','info','request\x20sent','debug','error','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0x1eba[_0x1f44e4];return _0x591989;};'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});config[_0xa1eb('0xc')]=_[_0xa1eb('0xd')](config[_0xa1eb('0xc')],{'host':_0xa1eb('0xe'),'port':0x18eb});var socket=require(_0xa1eb('0xf'))(new Redis(config['redis']));require(_0xa1eb('0x10'))['register'](socket);function respondWithRpcPromise(_0x219802,_0x54cdad,_0x3f53ff){return new BPromise(function(_0x5d7101,_0x41a7bc){return client['request'](_0x219802,_0x3f53ff)[_0xa1eb('0x11')](function(_0x325d13){logger[_0xa1eb('0x12')]('MailMessage,\x20%s,\x20%s',_0x54cdad,_0xa1eb('0x13'));logger[_0xa1eb('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x54cdad,_0xa1eb('0x13'),JSON['stringify'](_0x325d13));if(_0x325d13['error']){if(_0x325d13[_0xa1eb('0x15')]['code']===0x1f4){logger[_0xa1eb('0x15')](_0xa1eb('0x16'),_0x54cdad,_0x325d13[_0xa1eb('0x15')][_0xa1eb('0x17')]);return _0x41a7bc(_0x325d13[_0xa1eb('0x15')][_0xa1eb('0x17')]);}logger[_0xa1eb('0x15')](_0xa1eb('0x16'),_0x54cdad,_0x325d13[_0xa1eb('0x15')]['message']);return _0x5d7101(_0x325d13[_0xa1eb('0x15')]['message']);}else{logger[_0xa1eb('0x12')](_0xa1eb('0x16'),_0x54cdad,_0xa1eb('0x13'));_0x5d7101(_0x325d13[_0xa1eb('0x18')]['message']);}})[_0xa1eb('0x19')](function(_0x22cd44){logger[_0xa1eb('0x15')](_0xa1eb('0x16'),_0x54cdad,_0x22cd44);_0x41a7bc(_0x22cd44);});});}exports[_0xa1eb('0x1a')]=function(_0x3b8607){var _0x2143e6=this;return new Promise(function(_0x166f7f,_0x4fc14a){return db[_0xa1eb('0x1b')]['create'](_0x3b8607[_0xa1eb('0x1c')],{'raw':_0x3b8607[_0xa1eb('0x1d')]?_0x3b8607[_0xa1eb('0x1d')][_0xa1eb('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x539634){logger[_0xa1eb('0x12')](_0xa1eb('0x1a'),_0x3b8607);logger['debug'](_0xa1eb('0x1a'),_0x3b8607,JSON[_0xa1eb('0x1f')](_0x539634));_0x166f7f(_0x539634);})[_0xa1eb('0x19')](function(_0xa6b20c){logger[_0xa1eb('0x15')](_0xa1eb('0x1a'),_0xa6b20c[_0xa1eb('0x17')],_0x3b8607);_0x4fc14a(_0x2143e6[_0xa1eb('0x15')](0x1f4,_0xa6b20c[_0xa1eb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index d650bd0..28c37bf 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 _0x7e67=['save','remove','update','emit','removeListener','register','./mailMessage.events'];(function(_0x5ee228,_0x1567bf){var _0x85aa82=function(_0x9d58f9){while(--_0x9d58f9){_0x5ee228['push'](_0x5ee228['shift']());}};_0x85aa82(++_0x1567bf);}(_0x7e67,0xca));var _0x77e6=function(_0x1a7e3c,_0x1b7f75){_0x1a7e3c=_0x1a7e3c-0x0;var _0x3a34ea=_0x7e67[_0x1a7e3c];return _0x3a34ea;};'use strict';var MailMessageEvents=require(_0x77e6('0x0'));var events=[_0x77e6('0x1'),_0x77e6('0x2'),_0x77e6('0x3')];function createListener(_0x3a2d51,_0xb30bcc){return function(_0x114eec){_0xb30bcc[_0x77e6('0x4')](_0x3a2d51,_0x114eec);};}function removeListener(_0x3a18c1,_0x46b339){return function(){MailMessageEvents[_0x77e6('0x5')](_0x3a18c1,_0x46b339);};}exports[_0x77e6('0x6')]=function(_0x35aae7){for(var _0xb61cc4=0x0,_0x326b92=events['length'];_0xb61cc4<_0x326b92;_0xb61cc4++){var _0x2332b1=events[_0xb61cc4];var _0x30a33f=createListener('mailMessage:'+_0x2332b1,_0x35aae7);MailMessageEvents['on'](_0x2332b1,_0x30a33f);}}; \ No newline at end of file +var _0x097c=['save','remove','emit','register','./mailMessage.events'];(function(_0x3976c7,_0x5667f3){var _0x39e6b6=function(_0x5a2e0c){while(--_0x5a2e0c){_0x3976c7['push'](_0x3976c7['shift']());}};_0x39e6b6(++_0x5667f3);}(_0x097c,0x1d5));var _0xc097=function(_0x61c5f4,_0x37c1fd){_0x61c5f4=_0x61c5f4-0x0;var _0x3a169c=_0x097c[_0x61c5f4];return _0x3a169c;};'use strict';var MailMessageEvents=require(_0xc097('0x0'));var events=[_0xc097('0x1'),_0xc097('0x2'),'update'];function createListener(_0x1eb862,_0x5b478f){return function(_0x23e66a){_0x5b478f[_0xc097('0x3')](_0x1eb862,_0x23e66a);};}function removeListener(_0x5aa3c1,_0x265284){return function(){MailMessageEvents['removeListener'](_0x5aa3c1,_0x265284);};}exports[_0xc097('0x4')]=function(_0x3c9603){for(var _0x31bc9a=0x0,_0x32493e=events['length'];_0x31bc9a<_0x32493e;_0x31bc9a++){var _0x3f67a4=events[_0x31bc9a];var _0x4d95d9=createListener('mailMessage:'+_0x3f67a4,_0x3c9603);MailMessageEvents['on'](_0x3f67a4,_0x4d95d9);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index b4996ee..70d79c2 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 _0x8dae=['/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','delete','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/describe','isAuthenticated','describe','get','/:id','show','/:id/members','getMembers','getTeams'];(function(_0xd13979,_0x2b5160){var _0xd153f6=function(_0x906e24){while(--_0x906e24){_0xd13979['push'](_0xd13979['shift']());}};_0xd153f6(++_0x2b5160);}(_0x8dae,0xb2));var _0xe8da=function(_0x2544f1,_0xb653af){_0x2544f1=_0x2544f1-0x0;var _0x3cab4f=_0x8dae[_0x2544f1];return _0x3cab4f;};'use strict';var multer=require(_0xe8da('0x0'));var util=require('util');var path=require(_0xe8da('0x1'));var timeout=require(_0xe8da('0x2'));var express=require(_0xe8da('0x3'));var router=express[_0xe8da('0x4')]();var fs_extra=require(_0xe8da('0x5'));var auth=require(_0xe8da('0x6'));var interaction=require(_0xe8da('0x7'));var config=require(_0xe8da('0x8'));var controller=require('./mailQueue.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe8da('0x9'),auth[_0xe8da('0xa')](),controller[_0xe8da('0xb')]);router[_0xe8da('0xc')](_0xe8da('0xd'),auth['isAuthenticated'](),controller[_0xe8da('0xe')]);router[_0xe8da('0xc')](_0xe8da('0xf'),auth['isAuthenticated'](),controller[_0xe8da('0x10')]);router['get']('/:id/teams',auth[_0xe8da('0xa')](),controller[_0xe8da('0x11')]);router[_0xe8da('0xc')](_0xe8da('0x12'),auth[_0xe8da('0xa')](),controller[_0xe8da('0x13')]);router[_0xe8da('0x14')]('/',auth[_0xe8da('0xa')](),controller['create']);router[_0xe8da('0x14')](_0xe8da('0x15'),auth['isAuthenticated'](),controller[_0xe8da('0x16')]);router[_0xe8da('0x14')](_0xe8da('0x12'),auth['isAuthenticated'](),controller[_0xe8da('0x17')]);router[_0xe8da('0x18')](_0xe8da('0xd'),auth[_0xe8da('0xa')](),controller['update']);router[_0xe8da('0x19')](_0xe8da('0xd'),auth[_0xe8da('0xa')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xe8da('0xa')](),controller['removeTeams']);router[_0xe8da('0x19')](_0xe8da('0x12'),auth[_0xe8da('0xa')](),controller[_0xe8da('0x1a')]);module[_0xe8da('0x1b')]=router; \ No newline at end of file +var _0x57f3=['index','describe','/:id/members','getMembers','/:id/teams','/:id/users','post','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','util','path','express','Router','../../config/environment','get','isAuthenticated'];(function(_0x9d4625,_0x4db8bf){var _0x4e4203=function(_0x45df0c){while(--_0x45df0c){_0x9d4625['push'](_0x9d4625['shift']());}};_0x4e4203(++_0x4db8bf);}(_0x57f3,0xf6));var _0x357f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x57f3[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x357f('0x0'));var path=require(_0x357f('0x1'));var timeout=require('connect-timeout');var express=require(_0x357f('0x2'));var router=express[_0x357f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x357f('0x4'));var controller=require('./mailQueue.controller');router[_0x357f('0x5')]('/',auth[_0x357f('0x6')](),controller[_0x357f('0x7')]);router['get']('/describe',auth[_0x357f('0x6')](),controller[_0x357f('0x8')]);router[_0x357f('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x357f('0x5')](_0x357f('0x9'),auth[_0x357f('0x6')](),controller[_0x357f('0xa')]);router[_0x357f('0x5')](_0x357f('0xb'),auth['isAuthenticated'](),controller['getTeams']);router[_0x357f('0x5')](_0x357f('0xc'),auth[_0x357f('0x6')](),controller['getAgents']);router['post']('/',auth[_0x357f('0x6')](),controller['create']);router[_0x357f('0xd')]('/:id/teams',auth[_0x357f('0x6')](),controller[_0x357f('0xe')]);router['post'](_0x357f('0xc'),auth[_0x357f('0x6')](),controller[_0x357f('0xf')]);router[_0x357f('0x10')](_0x357f('0x11'),auth['isAuthenticated'](),controller[_0x357f('0x12')]);router[_0x357f('0x13')](_0x357f('0x11'),auth[_0x357f('0x6')](),controller[_0x357f('0x14')]);router['delete'](_0x357f('0xb'),auth[_0x357f('0x6')](),controller[_0x357f('0x15')]);router[_0x357f('0x13')](_0x357f('0xc'),auth['isAuthenticated'](),controller[_0x357f('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 1698b91..2676101 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 _0x4da4=['rrmemory','beepall','roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM'];(function(_0x173465,_0x3e4f73){var _0x5d3808=function(_0xea984a){while(--_0xea984a){_0x173465['push'](_0x173465['shift']());}};_0x5d3808(++_0x3e4f73);}(_0x4da4,0xc9));var _0x44da=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0x4da4[_0x5dee2a];return _0x31e98e;};'use strict';var Sequelize=require(_0x44da('0x0'));module[_0x44da('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x44da('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x44da('0x3')]},'timeout':{'type':Sequelize[_0x44da('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x44da('0x5')](_0x44da('0x6'),_0x44da('0x7'),_0x44da('0x8'))}}; \ No newline at end of file +var _0xc446=['beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x166c1e,_0x1e0242){var _0x259514=function(_0x49498a){while(--_0x49498a){_0x166c1e['push'](_0x166c1e['shift']());}};_0x259514(++_0x1e0242);}(_0xc446,0x1a6));var _0x6c44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc446[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6c44('0x0'));module[_0x6c44('0x1')]={'name':{'type':Sequelize[_0x6c44('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6c44('0x2')]},'timeout':{'type':Sequelize[_0x6c44('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6c44('0x4')]('rrmemory',_0x6c44('0x5'),_0x6c44('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 04c98ce..4a42b4f 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 _0x2d32=['status','offset','undefined','count','set','Content-Range','json','save','update','then','destroy','get','UserProfileResource','name','send','map','MailQueue','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','intersection','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','UserMailQueue','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','createdAt','%s/%s','updatedAt','findOne','getTeams','addTeams','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','ids','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','./mailQueue.socket','sendStatus','end'];(function(_0x8410a,_0x1bac9a){var _0x1f4cdb=function(_0x5e9059){while(--_0x5e9059){_0x8410a['push'](_0x8410a['shift']());}};_0x1f4cdb(++_0x1bac9a);}(_0x2d32,0xf5));var _0x22d3=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x2d32[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0x22d3('0x0'));var rimraf=require(_0x22d3('0x1'));var zipdir=require(_0x22d3('0x2'));var jsonpatch=require(_0x22d3('0x3'));var rp=require(_0x22d3('0x4'));var moment=require(_0x22d3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x22d3('0x6'));var util=require(_0x22d3('0x7'));var path=require('path');var sox=require(_0x22d3('0x8'));var csv=require('to-csv');var ejs=require(_0x22d3('0x9'));var fs=require('fs');var fs_extra=require(_0x22d3('0xa'));var _=require(_0x22d3('0xb'));var squel=require(_0x22d3('0xc'));var crypto=require(_0x22d3('0xd'));var jsforce=require(_0x22d3('0xe'));var deskjs=require(_0x22d3('0xf'));var toCsv=require(_0x22d3('0x10'));var querystring=require(_0x22d3('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x22d3('0x12'));var qs=require(_0x22d3('0x13'));var as=require(_0x22d3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x22d3('0x15'))(_0x22d3('0x16'));var utils=require(_0x22d3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x22d3('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x22d3('0x19')](config[_0x22d3('0x1a')],{'host':_0x22d3('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x22d3('0x1a')]));require(_0x22d3('0x1c'))['register'](socket);function respondWithStatusCode(_0x1b957e,_0x336c18){_0x336c18=_0x336c18||0xcc;return function(_0x5863f1){if(_0x5863f1){return _0x1b957e[_0x22d3('0x1d')](_0x336c18);}return _0x1b957e['status'](_0x336c18)[_0x22d3('0x1e')]();};}function respondWithResult(_0x46bc23,_0x32e364){_0x32e364=_0x32e364||0xc8;return function(_0x50115d){if(_0x50115d){return _0x46bc23[_0x22d3('0x1f')](_0x32e364)['json'](_0x50115d);}};}function respondWithFilteredResult(_0x596638,_0x59cb91){return function(_0x23edbf){if(_0x23edbf){var _0x47639d=typeof _0x59cb91[_0x22d3('0x20')]==='undefined'&&typeof _0x59cb91['limit']===_0x22d3('0x21');var _0x5dfc6b=_0x23edbf[_0x22d3('0x22')];var _0x4b3aa3=_0x47639d?0x0:_0x59cb91[_0x22d3('0x20')];var _0x1cb040=_0x47639d?_0x23edbf[_0x22d3('0x22')]:_0x59cb91[_0x22d3('0x20')]+_0x59cb91['limit'];var _0x424cdb;if(_0x1cb040>=_0x5dfc6b){_0x1cb040=_0x5dfc6b;_0x424cdb=0xc8;}else{_0x424cdb=0xce;}_0x596638['status'](_0x424cdb);return _0x596638[_0x22d3('0x23')](_0x22d3('0x24'),_0x4b3aa3+'-'+_0x1cb040+'/'+_0x5dfc6b)[_0x22d3('0x25')](_0x23edbf);}return null;};}function patchUpdates(_0x4a547b){return function(_0x50967c){try{jsonpatch['apply'](_0x50967c,_0x4a547b,!![]);}catch(_0x45a5e9){return BPromise['reject'](_0x45a5e9);}return _0x50967c[_0x22d3('0x26')]();};}function saveUpdates(_0x10c5a4,_0x130d4e){return function(_0x4c32e8){if(_0x4c32e8){return _0x4c32e8[_0x22d3('0x27')](_0x10c5a4)[_0x22d3('0x28')](function(_0x36ebd7){return _0x36ebd7;});}return null;};}function removeEntity(_0x5a5028,_0x3519e2){return function(_0x15f0d4){if(_0x15f0d4){return _0x15f0d4[_0x22d3('0x29')]()[_0x22d3('0x28')](function(){var _0x1ff420=_0x15f0d4[_0x22d3('0x2a')]({'plain':!![]});var _0x1ceadc='MailQueues';return db[_0x22d3('0x2b')][_0x22d3('0x29')]({'where':{'type':_0x1ceadc,'resourceId':_0x1ff420['id']}})['then'](function(){return _0x15f0d4;});})['then'](function(){_0x5a5028[_0x22d3('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e3706,_0x2b16f8){return function(_0x5d299d){if(!_0x5d299d){_0x4e3706[_0x22d3('0x1d')](0x194);}return _0x5d299d;};}function handleError(_0x3690da,_0x3d678d){_0x3d678d=_0x3d678d||0x1f4;return function(_0x27e21c){logger['error'](_0x27e21c['stack']);if(_0x27e21c[_0x22d3('0x2c')]){delete _0x27e21c['name'];}_0x3690da['status'](_0x3d678d)[_0x22d3('0x2d')](_0x27e21c);};}exports['index']=function(_0x174bb5,_0x4bd23f){var _0x746ca0={},_0x482d15={},_0x1f7fcf={'count':0x0,'rows':[]};var _0x16c5a0=_[_0x22d3('0x2e')](db[_0x22d3('0x2f')][_0x22d3('0x30')],function(_0x3071a4){return{'name':_0x3071a4[_0x22d3('0x31')],'type':_0x3071a4[_0x22d3('0x32')]['key']};});_0x482d15['model']=_['map'](_0x16c5a0,'name');_0x482d15[_0x22d3('0x33')]=_[_0x22d3('0x34')](_0x174bb5['query']);_0x482d15[_0x22d3('0x35')]=_['intersection'](_0x482d15[_0x22d3('0x36')],_0x482d15[_0x22d3('0x33')]);_0x746ca0[_0x22d3('0x37')]=_['intersection'](_0x482d15[_0x22d3('0x36')],qs[_0x22d3('0x38')](_0x174bb5[_0x22d3('0x33')][_0x22d3('0x38')]));_0x746ca0[_0x22d3('0x37')]=_0x746ca0[_0x22d3('0x37')][_0x22d3('0x39')]?_0x746ca0[_0x22d3('0x37')]:_0x482d15[_0x22d3('0x36')];if(!_0x174bb5[_0x22d3('0x33')][_0x22d3('0x3a')](_0x22d3('0x3b'))){_0x746ca0[_0x22d3('0x3c')]=qs['limit'](_0x174bb5[_0x22d3('0x33')]['limit']);_0x746ca0[_0x22d3('0x20')]=qs[_0x22d3('0x20')](_0x174bb5[_0x22d3('0x33')][_0x22d3('0x20')]);}_0x746ca0[_0x22d3('0x3d')]=qs[_0x22d3('0x3e')](_0x174bb5[_0x22d3('0x33')]['sort']);_0x746ca0[_0x22d3('0x3f')]=qs['filters'](_[_0x22d3('0x40')](_0x174bb5[_0x22d3('0x33')],_0x482d15[_0x22d3('0x35')]),_0x16c5a0);if(_0x174bb5[_0x22d3('0x33')]['filter']){_0x746ca0[_0x22d3('0x3f')]=_[_0x22d3('0x41')](_0x746ca0['where'],{'$or':_[_0x22d3('0x2e')](_0x16c5a0,function(_0x151b33){if(_0x151b33[_0x22d3('0x32')]!==_0x22d3('0x42')){var _0x3037fe={};_0x3037fe[_0x151b33[_0x22d3('0x2c')]]={'$like':'%'+_0x174bb5[_0x22d3('0x33')][_0x22d3('0x43')]+'%'};return _0x3037fe;}})});}_0x746ca0=_[_0x22d3('0x41')]({},_0x746ca0,_0x174bb5[_0x22d3('0x44')]);var _0x10b2e0={'where':_0x746ca0['where']};return db['MailQueue'][_0x22d3('0x22')](_0x10b2e0)[_0x22d3('0x28')](function(_0x566a1d){_0x1f7fcf['count']=_0x566a1d;if(_0x174bb5[_0x22d3('0x33')][_0x22d3('0x45')]){_0x746ca0[_0x22d3('0x46')]=[{'all':!![]}];}return db[_0x22d3('0x2f')][_0x22d3('0x47')](_0x746ca0);})[_0x22d3('0x28')](function(_0x41fc3d){_0x1f7fcf[_0x22d3('0x48')]=_0x41fc3d;return _0x1f7fcf;})['then'](respondWithFilteredResult(_0x4bd23f,_0x746ca0))[_0x22d3('0x49')](handleError(_0x4bd23f,null));};exports['show']=function(_0xb222fc,_0x30e8ef){var _0x31658f={'raw':!![],'where':{'id':_0xb222fc[_0x22d3('0x4a')]['id']}},_0x462a4d={};_0x462a4d[_0x22d3('0x36')]=_['keys'](db[_0x22d3('0x2f')]['rawAttributes']);_0x462a4d[_0x22d3('0x33')]=_['keys'](_0xb222fc[_0x22d3('0x33')]);_0x462a4d['filters']=_[_0x22d3('0x4b')](_0x462a4d[_0x22d3('0x36')],_0x462a4d[_0x22d3('0x33')]);_0x31658f[_0x22d3('0x37')]=_['intersection'](_0x462a4d[_0x22d3('0x36')],qs[_0x22d3('0x38')](_0xb222fc[_0x22d3('0x33')][_0x22d3('0x38')]));_0x31658f[_0x22d3('0x37')]=_0x31658f[_0x22d3('0x37')]['length']?_0x31658f[_0x22d3('0x37')]:_0x462a4d[_0x22d3('0x36')];if(_0xb222fc[_0x22d3('0x33')]['includeAll']){_0x31658f['include']=[{'all':!![]}];}_0x31658f=_[_0x22d3('0x41')]({},_0x31658f,_0xb222fc[_0x22d3('0x44')]);return db['MailQueue']['find'](_0x31658f)['then'](handleEntityNotFound(_0x30e8ef,null))[_0x22d3('0x28')](respondWithResult(_0x30e8ef,null))[_0x22d3('0x49')](handleError(_0x30e8ef,null));};exports['create']=function(_0x294610,_0x528575){return db[_0x22d3('0x2f')]['create'](_0x294610['body'],{})[_0x22d3('0x28')](function(_0xb529c1){var _0x2c55ef=_0x294610[_0x22d3('0x4c')][_0x22d3('0x2a')]({'plain':!![]});if(!_0x2c55ef)throw new Error(_0x22d3('0x4d'));if(_0x2c55ef[_0x22d3('0x4e')]===_0x22d3('0x4c')){var _0x1635a8=_0xb529c1[_0x22d3('0x2a')]({'plain':!![]});var _0x2d0102=_0x22d3('0x4f');return db[_0x22d3('0x50')]['find']({'where':{'name':_0x2d0102,'userProfileId':_0x2c55ef[_0x22d3('0x51')]},'raw':!![]})[_0x22d3('0x28')](function(_0xe5b469){if(_0xe5b469&&_0xe5b469[_0x22d3('0x52')]===0x0){return db[_0x22d3('0x2b')][_0x22d3('0x53')]({'name':_0x1635a8[_0x22d3('0x2c')],'resourceId':_0x1635a8['id'],'type':_0xe5b469[_0x22d3('0x2c')],'sectionId':_0xe5b469['id']},{})['then'](function(){return _0xb529c1;});}else{return _0xb529c1;}})[_0x22d3('0x49')](function(_0x58e00c){logger[_0x22d3('0x54')](_0x22d3('0x55'),_0x58e00c);throw _0x58e00c;});}return _0xb529c1;})['then'](respondWithResult(_0x528575,0xc9))['catch'](handleError(_0x528575,null));};exports[_0x22d3('0x27')]=function(_0x16e56b,_0x4aa97c){if(_0x16e56b[_0x22d3('0x56')]['id']){delete _0x16e56b['body']['id'];}return db[_0x22d3('0x2f')][_0x22d3('0x57')]({'where':{'id':_0x16e56b[_0x22d3('0x4a')]['id']}})[_0x22d3('0x28')](handleEntityNotFound(_0x4aa97c,null))[_0x22d3('0x28')](saveUpdates(_0x16e56b[_0x22d3('0x56')],null))[_0x22d3('0x28')](respondWithResult(_0x4aa97c,null))[_0x22d3('0x49')](handleError(_0x4aa97c,null));};exports['destroy']=function(_0x17ff98,_0x255051){return db['MailQueue']['find']({'where':{'id':_0x17ff98[_0x22d3('0x4a')]['id']}})[_0x22d3('0x28')](handleEntityNotFound(_0x255051,null))[_0x22d3('0x28')](removeEntity(_0x255051,null))[_0x22d3('0x49')](handleError(_0x255051,null));};exports[_0x22d3('0x58')]=function(_0x272ab2,_0x39e95f){return db[_0x22d3('0x2f')][_0x22d3('0x58')]()[_0x22d3('0x28')](respondWithResult(_0x39e95f,null))[_0x22d3('0x49')](handleError(_0x39e95f,null));};exports['getMembers']=function(_0x208436,_0x31fe9e,_0x552239){var _0x399222={'raw':!![],'where':{}},_0x2cd862={},_0x34add8;return db[_0x22d3('0x2f')]['findOne']({'where':{'id':_0x208436['params']['id']}})[_0x22d3('0x28')](handleEntityNotFound(_0x31fe9e,null))['then'](function(_0x43fe7e){if(_0x43fe7e){_0x34add8=_0x43fe7e[_0x22d3('0x2a')]({'plain':!![]});_0x2cd862[_0x22d3('0x36')]=_[_0x22d3('0x34')](db[_0x22d3('0x59')][_0x22d3('0x30')]);_0x2cd862[_0x22d3('0x33')]=_[_0x22d3('0x34')](_0x208436[_0x22d3('0x33')]);_0x2cd862[_0x22d3('0x35')]=_[_0x22d3('0x4b')](_0x2cd862['model'],_0x2cd862[_0x22d3('0x33')]);_0x399222[_0x22d3('0x37')]=_['intersection'](_0x2cd862[_0x22d3('0x36')],qs['fields'](_0x208436[_0x22d3('0x33')][_0x22d3('0x38')]));_0x399222[_0x22d3('0x37')]=_0x399222['attributes'][_0x22d3('0x39')]?_0x399222[_0x22d3('0x37')]:_0x2cd862[_0x22d3('0x36')];if(!_0x208436[_0x22d3('0x33')][_0x22d3('0x3a')]('nolimit')){_0x399222[_0x22d3('0x3c')]=qs[_0x22d3('0x3c')](_0x208436[_0x22d3('0x33')][_0x22d3('0x3c')]);_0x399222[_0x22d3('0x20')]=qs[_0x22d3('0x20')](_0x208436[_0x22d3('0x33')][_0x22d3('0x20')]);}_0x399222[_0x22d3('0x3d')]=qs[_0x22d3('0x3e')](_0x208436[_0x22d3('0x33')][_0x22d3('0x3e')]);_0x399222['where']=qs[_0x22d3('0x35')](_[_0x22d3('0x40')](_0x208436[_0x22d3('0x33')],_0x2cd862[_0x22d3('0x35')]));_0x399222['where'][_0x22d3('0x5a')]=_0x43fe7e['id'];if(_0x208436['query'][_0x22d3('0x43')]){_0x399222[_0x22d3('0x3f')]=_['merge'](_0x399222[_0x22d3('0x3f')],{'$or':_[_0x22d3('0x2e')](_0x399222['attributes'],function(_0x92f208){var _0x1cfd2b={};_0x1cfd2b[_0x92f208]={'$like':'%'+_0x208436[_0x22d3('0x33')][_0x22d3('0x43')]+'%'};return _0x1cfd2b;})});}_0x399222=_['merge']({},_0x399222,_0x208436[_0x22d3('0x44')]);return db[_0x22d3('0x59')][_0x22d3('0x47')](_0x399222);}})['then'](function(_0x22fde0){if(_0x22fde0){return db[_0x22d3('0x5b')][_0x22d3('0x5c')]({'where':{'id':_[_0x22d3('0x2e')](_0x22fde0,_0x22d3('0x5d')),'role':_0x22d3('0x5e')},'attributes':['id',_0x22d3('0x2c'),_0x22d3('0x5f'),'updatedAt',_0x22d3('0x60')]});}})[_0x22d3('0x28')](function(_0x58bf67){if(_0x58bf67){return{'count':_0x58bf67[_0x22d3('0x22')],'rows':_[_0x22d3('0x2e')](_0x58bf67['rows'],function(_0x3c9458){return{'membername':_0x3c9458[_0x22d3('0x2c')],'UserId':_0x3c9458['id'],'queue_name':_0x34add8['name'],'MailQueueId':_0x34add8['id'],'interface':util['format'](_0x22d3('0x61'),'SIP',_0x3c9458[_0x22d3('0x2c')]),'penalty':0x0,'paused':_0x3c9458[_0x22d3('0x5f')],'createdAt':_0x3c9458[_0x22d3('0x60')],'updatedAt':_0x3c9458[_0x22d3('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x22d3('0x28')](respondWithFilteredResult(_0x31fe9e,_0x399222))[_0x22d3('0x49')](handleError(_0x31fe9e,null));};exports['getTeams']=function(_0x168aee,_0xe43a9d,_0x48a19a){var _0x5aebf0={};var _0x59f74e={};var _0xb5dfc2;var _0x2da16c;return db[_0x22d3('0x2f')][_0x22d3('0x63')]({'where':{'id':_0x168aee[_0x22d3('0x4a')]['id']}})[_0x22d3('0x28')](handleEntityNotFound(_0xe43a9d,null))[_0x22d3('0x28')](function(_0x4d84c3){if(_0x4d84c3){_0xb5dfc2=_0x4d84c3;_0x59f74e[_0x22d3('0x36')]=_[_0x22d3('0x34')](db['Team'][_0x22d3('0x30')]);_0x59f74e[_0x22d3('0x33')]=_[_0x22d3('0x34')](_0x168aee[_0x22d3('0x33')]);_0x59f74e[_0x22d3('0x35')]=_[_0x22d3('0x4b')](_0x59f74e[_0x22d3('0x36')],_0x59f74e[_0x22d3('0x33')]);_0x5aebf0['attributes']=_[_0x22d3('0x4b')](_0x59f74e[_0x22d3('0x36')],qs[_0x22d3('0x38')](_0x168aee['query'][_0x22d3('0x38')]));_0x5aebf0[_0x22d3('0x37')]=_0x5aebf0[_0x22d3('0x37')][_0x22d3('0x39')]?_0x5aebf0[_0x22d3('0x37')]:_0x59f74e[_0x22d3('0x36')];_0x5aebf0['order']=qs[_0x22d3('0x3e')](_0x168aee['query'][_0x22d3('0x3e')]);_0x5aebf0[_0x22d3('0x3f')]=qs['filters'](_[_0x22d3('0x40')](_0x168aee['query'],_0x59f74e['filters']));if(_0x168aee[_0x22d3('0x33')][_0x22d3('0x43')]){_0x5aebf0[_0x22d3('0x3f')]=_['merge'](_0x5aebf0[_0x22d3('0x3f')],{'$or':_[_0x22d3('0x2e')](_0x5aebf0[_0x22d3('0x37')],function(_0x1c9bfa){var _0x529304={};_0x529304[_0x1c9bfa]={'$like':'%'+_0x168aee['query']['filter']+'%'};return _0x529304;})});}_0x5aebf0=_['merge']({},_0x5aebf0,_0x168aee['options']);return _0xb5dfc2[_0x22d3('0x64')](_0x5aebf0);}})[_0x22d3('0x28')](function(_0x16626c){if(_0x16626c){_0x2da16c=_0x16626c[_0x22d3('0x39')];if(!_0x168aee[_0x22d3('0x33')][_0x22d3('0x3a')](_0x22d3('0x3b'))){_0x5aebf0['limit']=qs[_0x22d3('0x3c')](_0x168aee[_0x22d3('0x33')][_0x22d3('0x3c')]);_0x5aebf0[_0x22d3('0x20')]=qs['offset'](_0x168aee[_0x22d3('0x33')][_0x22d3('0x20')]);}return _0xb5dfc2[_0x22d3('0x64')](_0x5aebf0);}})['then'](function(_0x10492e){if(_0x10492e){return _0x10492e?{'count':_0x2da16c,'rows':_0x10492e}:null;}})[_0x22d3('0x28')](respondWithResult(_0xe43a9d,null))[_0x22d3('0x49')](handleError(_0xe43a9d,null));};exports[_0x22d3('0x65')]=function(_0x42c1d1,_0x511a05,_0x1c8b1a){var _0x4b8e0e=_0x42c1d1[_0x22d3('0x56')]['ids'];return db['Team'][_0x22d3('0x47')]({'where':{'id':_0x4b8e0e},'attributes':['id'],'include':[{'model':db[_0x22d3('0x5b')],'as':_0x22d3('0x66'),'attributes':['id','name',_0x22d3('0x67'),_0x22d3('0x68'),'interface'],'raw':!![]}]})[_0x22d3('0x28')](function(_0x398ded){if(_0x398ded){var _0x110d4d=_[_0x22d3('0x69')](_0x398ded,function(_0x569828){var _0x1b74f6=_0x569828['get']({'plain':!![]});return _0x1b74f6[_0x22d3('0x66')];});return db[_0x22d3('0x2f')][_0x22d3('0x57')]({'where':{'id':_0x42c1d1[_0x22d3('0x4a')]['id']}})[_0x22d3('0x28')](function(_0x4dcc46){return db[_0x22d3('0x6a')][_0x22d3('0x6b')](function(_0x4bf8a8){return _0x4dcc46['addTeams'](_0x4b8e0e,{'transaction':_0x4bf8a8})[_0x22d3('0x28')](function(){return BPromise[_0x22d3('0x6c')](_0x110d4d,function(_0x12c68d){return db['UserMailQueue'][_0x22d3('0x6d')]({'where':{'UserId':_0x12c68d['id'],'MailQueueId':_0x42c1d1[_0x22d3('0x4a')]['id']},'transaction':_0x4bf8a8});});})[_0x22d3('0x28')](function(){_0x110d4d['forEach'](function(_0x40a8e3){socket[_0x22d3('0x6e')]('userMailQueue:save',{'UserId':_0x40a8e3['id'],'MailQueueId':_0x4dcc46['id']});});});});});}})['then'](respondWithStatusCode(_0x511a05,null))[_0x22d3('0x49')](handleError(_0x511a05,null));};exports[_0x22d3('0x6f')]=function(_0x4a64dc,_0x1b4ddf,_0x68abca){return db['Team'][_0x22d3('0x47')]({'where':{'id':_0x4a64dc[_0x22d3('0x33')][_0x22d3('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x22d3('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1b4ddf,null))['then'](function(_0x4803b0){var _0x5ca726=_[_0x22d3('0x2e')](_0x4803b0,'id');var _0xf9ca8c=[];var _0x5be70b=[];var _0x493c66=squel[_0x22d3('0x71')]();_0x493c66[_0x22d3('0x72')](_0x22d3('0x73'))['from']('team_has_mail_queues','tq')['join'](_0x22d3('0x74'),'ut',_0x22d3('0x75'))[_0x22d3('0x3f')](_0x22d3('0x76'),_0x4a64dc[_0x22d3('0x4a')]['id']);for(var _0x449d29=0x0;_0x449d29<_0x4803b0['length'];_0x449d29+=0x1){let _0x328c3f=_0x4803b0[_0x449d29];for(var _0x1cad46=0x0;_0x1cad46<_0x328c3f[_0x22d3('0x66')]['length'];_0x1cad46+=0x1){let _0x205d38=_0x328c3f[_0x22d3('0x66')][_0x1cad46];var _0x418f25=_0x493c66['clone']();_0x418f25[_0x22d3('0x3f')](_0x22d3('0x77'),_0x205d38['id']);_0x5be70b[_0x22d3('0x78')](db[_0x22d3('0x6a')][_0x22d3('0x33')](_0x418f25[_0x22d3('0x79')](),{'type':db[_0x22d3('0x6a')]['QueryTypes'][_0x22d3('0x7a')]})['then'](function(_0xa6c769){if(_0xa6c769[_0x22d3('0x39')]===0x1){return _0x205d38['id'];}else{var _0x86b053=_[_0x22d3('0x7b')](_['map'](_0xa6c769,_0x22d3('0x7c')),function(_0x4af076){return _['includes'](_0x5ca726,_0x4af076);});if(_0x86b053){return _0x205d38['id'];}}}));}}return BPromise[_0x22d3('0x7d')](_0x5be70b)[_0x22d3('0x28')](function(_0x81c7c0){_0xf9ca8c=_(_0xf9ca8c)[_0x22d3('0x7e')](_0x81c7c0)[_0x22d3('0x7f')]()[_0x22d3('0x80')]();return db[_0x22d3('0x2f')]['find']({'where':{'id':_0x4a64dc[_0x22d3('0x4a')]['id']}})[_0x22d3('0x28')](function(_0x3e7eda){return db[_0x22d3('0x6a')]['transaction'](function(_0x593bf6){return _0x3e7eda['removeTeams'](_0x4a64dc[_0x22d3('0x33')][_0x22d3('0x70')],{'transaction':_0x593bf6})[_0x22d3('0x28')](function(){if(!_[_0x22d3('0x81')](_0xf9ca8c)){return _0x3e7eda[_0x22d3('0x82')](_0xf9ca8c,{'transaction':_0x593bf6});}})[_0x22d3('0x28')](function(){_0xf9ca8c[_0x22d3('0x83')](function(_0x145eab){socket['emit'](_0x22d3('0x84'),{'UserId':_0x145eab,'MailQueueId':_0x3e7eda['id']});});});});});});})[_0x22d3('0x28')](respondWithStatusCode(_0x1b4ddf,null))['catch'](handleError(_0x1b4ddf,null));};exports[_0x22d3('0x85')]=function(_0x144685,_0x1194e9,_0x38f1bc){return db[_0x22d3('0x2f')][_0x22d3('0x57')]({'where':{'id':_0x144685[_0x22d3('0x4a')]['id']}})[_0x22d3('0x28')](handleEntityNotFound(_0x1194e9,null))[_0x22d3('0x28')](function(_0x1f56cd){if(_0x1f56cd){return _0x1f56cd[_0x22d3('0x85')](_0x144685[_0x22d3('0x56')]['ids'],_[_0x22d3('0x86')](_0x144685[_0x22d3('0x56')],[_0x22d3('0x70'),'id'])||{})[_0x22d3('0x87')](function(_0x5119ae){for(var _0xc9c39c=0x0;_0xc9c39c<_0x144685[_0x22d3('0x56')][_0x22d3('0x70')]['length'];_0xc9c39c+=0x1){socket['emit'](_0x22d3('0x88'),{'UserId':Number(_0x144685['body'][_0x22d3('0x70')][_0xc9c39c]),'MailQueueId':Number(_0x144685[_0x22d3('0x4a')]['id'])});}return _0x5119ae;});}})['then'](respondWithResult(_0x1194e9,null))[_0x22d3('0x49')](handleError(_0x1194e9,null));};exports[_0x22d3('0x82')]=function(_0x18e275,_0x280f76,_0xe8dc5){return db[_0x22d3('0x2f')][_0x22d3('0x57')]({'where':{'id':_0x18e275[_0x22d3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x280f76,null))['then'](function(_0x18d646){if(_0x18d646){return _0x18d646[_0x22d3('0x82')](_0x18e275[_0x22d3('0x33')][_0x22d3('0x70')])['then'](function(){if(_['isArray'](_0x18e275[_0x22d3('0x33')][_0x22d3('0x70')])){for(var _0x50397f=0x0;_0x50397f<_0x18e275['query'][_0x22d3('0x70')][_0x22d3('0x39')];_0x50397f+=0x1){socket[_0x22d3('0x6e')]('userMailQueue:remove',{'UserId':Number(_0x18e275[_0x22d3('0x33')][_0x22d3('0x70')][_0x50397f]),'MailQueueId':Number(_0x18e275['params']['id'])});}}else{socket[_0x22d3('0x6e')](_0x22d3('0x84'),{'UserId':Number(_0x18e275[_0x22d3('0x33')][_0x22d3('0x70')]),'MailQueueId':Number(_0x18e275[_0x22d3('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x280f76,null))[_0x22d3('0x49')](handleError(_0x280f76,null));};exports[_0x22d3('0x89')]=function(_0x4f71d6,_0x1c0989,_0x5d3142){var _0x294ee1={};var _0x580d5a={};var _0x249116;var _0x277680;return db[_0x22d3('0x2f')][_0x22d3('0x63')]({'where':{'id':_0x4f71d6[_0x22d3('0x4a')]['id']}})[_0x22d3('0x28')](handleEntityNotFound(_0x1c0989,null))[_0x22d3('0x28')](function(_0x34d4d5){if(_0x34d4d5){_0x249116=_0x34d4d5;_0x580d5a[_0x22d3('0x36')]=_['keys'](db[_0x22d3('0x5b')][_0x22d3('0x30')]);_0x580d5a['query']=_['keys'](_0x4f71d6[_0x22d3('0x33')]);_0x580d5a[_0x22d3('0x35')]=_[_0x22d3('0x4b')](_0x580d5a[_0x22d3('0x36')],_0x580d5a[_0x22d3('0x33')]);_0x294ee1[_0x22d3('0x37')]=_[_0x22d3('0x4b')](_0x580d5a[_0x22d3('0x36')],qs[_0x22d3('0x38')](_0x4f71d6[_0x22d3('0x33')][_0x22d3('0x38')]));_0x294ee1[_0x22d3('0x37')]=_0x294ee1[_0x22d3('0x37')][_0x22d3('0x39')]?_0x294ee1[_0x22d3('0x37')]:_0x580d5a['model'];_0x294ee1[_0x22d3('0x3d')]=qs[_0x22d3('0x3e')](_0x4f71d6[_0x22d3('0x33')][_0x22d3('0x3e')]);_0x294ee1['where']=qs['filters'](_[_0x22d3('0x40')](_0x4f71d6[_0x22d3('0x33')],_0x580d5a[_0x22d3('0x35')]));if(_0x4f71d6[_0x22d3('0x33')][_0x22d3('0x43')]){_0x294ee1[_0x22d3('0x3f')]=_[_0x22d3('0x41')](_0x294ee1[_0x22d3('0x3f')],{'$or':_['map'](_0x294ee1['attributes'],function(_0x414a40){var _0x39c3ee={};_0x39c3ee[_0x414a40]={'$like':'%'+_0x4f71d6[_0x22d3('0x33')]['filter']+'%'};return _0x39c3ee;})});}_0x294ee1=_['merge']({},_0x294ee1,_0x4f71d6[_0x22d3('0x44')]);return _0x249116[_0x22d3('0x89')](_0x294ee1);}})['then'](function(_0x113718){if(_0x113718){_0x277680=_0x113718['length'];if(!_0x4f71d6[_0x22d3('0x33')]['hasOwnProperty'](_0x22d3('0x3b'))){_0x294ee1[_0x22d3('0x3c')]=qs[_0x22d3('0x3c')](_0x4f71d6[_0x22d3('0x33')][_0x22d3('0x3c')]);_0x294ee1['offset']=qs[_0x22d3('0x20')](_0x4f71d6[_0x22d3('0x33')]['offset']);}return _0x249116[_0x22d3('0x89')](_0x294ee1);}})[_0x22d3('0x28')](function(_0x34a604){if(_0x34a604){return _0x34a604?{'count':_0x277680,'rows':_0x34a604}:null;}})[_0x22d3('0x28')](respondWithResult(_0x1c0989,null))[_0x22d3('0x49')](handleError(_0x1c0989,null));}; \ No newline at end of file +var _0x4de5=['%s/%s','SIP','updatedAt','findOne','Team','getTeams','addTeams','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','ids','field','tq.TeamId','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','redis','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','json','offset','undefined','limit','count','apply','reject','save','update','then','get','UserProfileResource','destroy','status','end','error','send','index','map','MailQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','name','filter','options','include','findAll','rows','catch','show','fields','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','UserMailQueue','MailQueueId','User','findAndCountAll','mailPause','createdAt','format'];(function(_0x36b96a,_0x594e2e){var _0x1cc314=function(_0x2e9d19){while(--_0x2e9d19){_0x36b96a['push'](_0x36b96a['shift']());}};_0x1cc314(++_0x594e2e);}(_0x4de5,0xbb));var _0x54de=function(_0x5a03b2,_0x40dbb3){_0x5a03b2=_0x5a03b2-0x0;var _0x17295f=_0x4de5[_0x5a03b2];return _0x17295f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54de('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54de('0x1'));var rp=require(_0x54de('0x2'));var moment=require(_0x54de('0x3'));var BPromise=require(_0x54de('0x4'));var Mustache=require(_0x54de('0x5'));var util=require(_0x54de('0x6'));var path=require(_0x54de('0x7'));var sox=require(_0x54de('0x8'));var csv=require(_0x54de('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54de('0xa'));var _=require('lodash');var squel=require(_0x54de('0xb'));var crypto=require(_0x54de('0xc'));var jsforce=require(_0x54de('0xd'));var deskjs=require(_0x54de('0xe'));var toCsv=require(_0x54de('0x9'));var querystring=require(_0x54de('0xf'));var Papa=require(_0x54de('0x10'));var Redis=require(_0x54de('0x11'));var authService=require(_0x54de('0x12'));var qs=require(_0x54de('0x13'));var as=require(_0x54de('0x14'));var hardwareService=require(_0x54de('0x15'));var logger=require('../../config/logger')(_0x54de('0x16'));var utils=require(_0x54de('0x17'));var config=require(_0x54de('0x18'));var licenseUtil=require(_0x54de('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x54de('0x1a')],{'host':_0x54de('0x1b'),'port':0x18eb});var socket=require(_0x54de('0x1c'))(new Redis(config[_0x54de('0x1a')]));require(_0x54de('0x1d'))['register'](socket);function respondWithStatusCode(_0x30b3de,_0x180d5d){_0x180d5d=_0x180d5d||0xcc;return function(_0x1a29b0){if(_0x1a29b0){return _0x30b3de[_0x54de('0x1e')](_0x180d5d);}return _0x30b3de['status'](_0x180d5d)['end']();};}function respondWithResult(_0x13884c,_0x4e1d23){_0x4e1d23=_0x4e1d23||0xc8;return function(_0x3be6df){if(_0x3be6df){return _0x13884c['status'](_0x4e1d23)[_0x54de('0x1f')](_0x3be6df);}};}function respondWithFilteredResult(_0x2a2e7c,_0x4703ca){return function(_0x2a684d){if(_0x2a684d){var _0x4b8d2e=typeof _0x4703ca[_0x54de('0x20')]===_0x54de('0x21')&&typeof _0x4703ca[_0x54de('0x22')]===_0x54de('0x21');var _0x31d7e8=_0x2a684d[_0x54de('0x23')];var _0x47f051=_0x4b8d2e?0x0:_0x4703ca[_0x54de('0x20')];var _0x4f2b22=_0x4b8d2e?_0x2a684d['count']:_0x4703ca[_0x54de('0x20')]+_0x4703ca[_0x54de('0x22')];var _0xbfe252;if(_0x4f2b22>=_0x31d7e8){_0x4f2b22=_0x31d7e8;_0xbfe252=0xc8;}else{_0xbfe252=0xce;}_0x2a2e7c['status'](_0xbfe252);return _0x2a2e7c['set']('Content-Range',_0x47f051+'-'+_0x4f2b22+'/'+_0x31d7e8)[_0x54de('0x1f')](_0x2a684d);}return null;};}function patchUpdates(_0x2b02e6){return function(_0x4cf489){try{jsonpatch[_0x54de('0x24')](_0x4cf489,_0x2b02e6,!![]);}catch(_0x1a6f59){return BPromise[_0x54de('0x25')](_0x1a6f59);}return _0x4cf489[_0x54de('0x26')]();};}function saveUpdates(_0x4e24e1,_0x4275a9){return function(_0x5ed452){if(_0x5ed452){return _0x5ed452[_0x54de('0x27')](_0x4e24e1)[_0x54de('0x28')](function(_0x1bfeb8){return _0x1bfeb8;});}return null;};}function removeEntity(_0x1b6e1a,_0x25c7dc){return function(_0x5a0a7e){if(_0x5a0a7e){return _0x5a0a7e['destroy']()[_0x54de('0x28')](function(){var _0x369a10=_0x5a0a7e[_0x54de('0x29')]({'plain':!![]});var _0x4f3790='MailQueues';return db[_0x54de('0x2a')][_0x54de('0x2b')]({'where':{'type':_0x4f3790,'resourceId':_0x369a10['id']}})[_0x54de('0x28')](function(){return _0x5a0a7e;});})[_0x54de('0x28')](function(){_0x1b6e1a[_0x54de('0x2c')](0xcc)[_0x54de('0x2d')]();});}};}function handleEntityNotFound(_0x58e0d7,_0x3ceabe){return function(_0x5ef25a){if(!_0x5ef25a){_0x58e0d7[_0x54de('0x1e')](0x194);}return _0x5ef25a;};}function handleError(_0x3fd1b0,_0x3cc323){_0x3cc323=_0x3cc323||0x1f4;return function(_0x3e12d2){logger[_0x54de('0x2e')](_0x3e12d2['stack']);if(_0x3e12d2['name']){delete _0x3e12d2['name'];}_0x3fd1b0[_0x54de('0x2c')](_0x3cc323)[_0x54de('0x2f')](_0x3e12d2);};}exports[_0x54de('0x30')]=function(_0x31f6ec,_0x33c0bb){var _0x24dc5b={},_0x310f27={},_0x337c1e={'count':0x0,'rows':[]};var _0x13f815=_[_0x54de('0x31')](db[_0x54de('0x32')][_0x54de('0x33')],function(_0x4627dc){return{'name':_0x4627dc[_0x54de('0x34')],'type':_0x4627dc['type']['key']};});_0x310f27[_0x54de('0x35')]=_[_0x54de('0x31')](_0x13f815,'name');_0x310f27[_0x54de('0x36')]=_[_0x54de('0x37')](_0x31f6ec['query']);_0x310f27[_0x54de('0x38')]=_[_0x54de('0x39')](_0x310f27[_0x54de('0x35')],_0x310f27[_0x54de('0x36')]);_0x24dc5b[_0x54de('0x3a')]=_[_0x54de('0x39')](_0x310f27[_0x54de('0x35')],qs['fields'](_0x31f6ec[_0x54de('0x36')]['fields']));_0x24dc5b[_0x54de('0x3a')]=_0x24dc5b['attributes'][_0x54de('0x3b')]?_0x24dc5b['attributes']:_0x310f27[_0x54de('0x35')];if(!_0x31f6ec[_0x54de('0x36')][_0x54de('0x3c')](_0x54de('0x3d'))){_0x24dc5b[_0x54de('0x22')]=qs[_0x54de('0x22')](_0x31f6ec[_0x54de('0x36')]['limit']);_0x24dc5b['offset']=qs['offset'](_0x31f6ec[_0x54de('0x36')]['offset']);}_0x24dc5b[_0x54de('0x3e')]=qs[_0x54de('0x3f')](_0x31f6ec['query'][_0x54de('0x3f')]);_0x24dc5b[_0x54de('0x40')]=qs[_0x54de('0x38')](_[_0x54de('0x41')](_0x31f6ec['query'],_0x310f27[_0x54de('0x38')]),_0x13f815);if(_0x31f6ec['query']['filter']){_0x24dc5b['where']=_[_0x54de('0x42')](_0x24dc5b['where'],{'$or':_[_0x54de('0x31')](_0x13f815,function(_0x5afa2a){if(_0x5afa2a[_0x54de('0x43')]!==_0x54de('0x44')){var _0x20bc8a={};_0x20bc8a[_0x5afa2a[_0x54de('0x45')]]={'$like':'%'+_0x31f6ec[_0x54de('0x36')][_0x54de('0x46')]+'%'};return _0x20bc8a;}})});}_0x24dc5b=_[_0x54de('0x42')]({},_0x24dc5b,_0x31f6ec[_0x54de('0x47')]);var _0x1f5405={'where':_0x24dc5b[_0x54de('0x40')]};return db[_0x54de('0x32')][_0x54de('0x23')](_0x1f5405)[_0x54de('0x28')](function(_0x394824){_0x337c1e[_0x54de('0x23')]=_0x394824;if(_0x31f6ec[_0x54de('0x36')]['includeAll']){_0x24dc5b[_0x54de('0x48')]=[{'all':!![]}];}return db[_0x54de('0x32')][_0x54de('0x49')](_0x24dc5b);})[_0x54de('0x28')](function(_0x3605a4){_0x337c1e[_0x54de('0x4a')]=_0x3605a4;return _0x337c1e;})[_0x54de('0x28')](respondWithFilteredResult(_0x33c0bb,_0x24dc5b))[_0x54de('0x4b')](handleError(_0x33c0bb,null));};exports[_0x54de('0x4c')]=function(_0x20a9f1,_0x33e8f0){var _0x21620d={'raw':!![],'where':{'id':_0x20a9f1['params']['id']}},_0x5f34dd={};_0x5f34dd['model']=_[_0x54de('0x37')](db[_0x54de('0x32')][_0x54de('0x33')]);_0x5f34dd[_0x54de('0x36')]=_[_0x54de('0x37')](_0x20a9f1[_0x54de('0x36')]);_0x5f34dd[_0x54de('0x38')]=_[_0x54de('0x39')](_0x5f34dd[_0x54de('0x35')],_0x5f34dd['query']);_0x21620d[_0x54de('0x3a')]=_[_0x54de('0x39')](_0x5f34dd[_0x54de('0x35')],qs[_0x54de('0x4d')](_0x20a9f1[_0x54de('0x36')][_0x54de('0x4d')]));_0x21620d[_0x54de('0x3a')]=_0x21620d[_0x54de('0x3a')][_0x54de('0x3b')]?_0x21620d[_0x54de('0x3a')]:_0x5f34dd[_0x54de('0x35')];if(_0x20a9f1['query'][_0x54de('0x4e')]){_0x21620d[_0x54de('0x48')]=[{'all':!![]}];}_0x21620d=_['merge']({},_0x21620d,_0x20a9f1['options']);return db[_0x54de('0x32')][_0x54de('0x4f')](_0x21620d)[_0x54de('0x28')](handleEntityNotFound(_0x33e8f0,null))[_0x54de('0x28')](respondWithResult(_0x33e8f0,null))['catch'](handleError(_0x33e8f0,null));};exports[_0x54de('0x50')]=function(_0x44931b,_0xbdb03a){return db[_0x54de('0x32')][_0x54de('0x50')](_0x44931b['body'],{})[_0x54de('0x28')](function(_0x5efade){var _0x337b74=_0x44931b[_0x54de('0x51')][_0x54de('0x29')]({'plain':!![]});if(!_0x337b74)throw new Error(_0x54de('0x52'));if(_0x337b74[_0x54de('0x53')]===_0x54de('0x51')){var _0x408c72=_0x5efade[_0x54de('0x29')]({'plain':!![]});var _0x1939a8=_0x54de('0x54');return db[_0x54de('0x55')]['find']({'where':{'name':_0x1939a8,'userProfileId':_0x337b74[_0x54de('0x56')]},'raw':!![]})[_0x54de('0x28')](function(_0xc723d8){if(_0xc723d8&&_0xc723d8[_0x54de('0x57')]===0x0){return db['UserProfileResource'][_0x54de('0x50')]({'name':_0x408c72['name'],'resourceId':_0x408c72['id'],'type':_0xc723d8['name'],'sectionId':_0xc723d8['id']},{})[_0x54de('0x28')](function(){return _0x5efade;});}else{return _0x5efade;}})['catch'](function(_0x51d0d1){logger[_0x54de('0x2e')](_0x54de('0x58'),_0x51d0d1);throw _0x51d0d1;});}return _0x5efade;})['then'](respondWithResult(_0xbdb03a,0xc9))[_0x54de('0x4b')](handleError(_0xbdb03a,null));};exports[_0x54de('0x27')]=function(_0x11060a,_0x53e6fe){if(_0x11060a[_0x54de('0x59')]['id']){delete _0x11060a[_0x54de('0x59')]['id'];}return db['MailQueue'][_0x54de('0x4f')]({'where':{'id':_0x11060a[_0x54de('0x5a')]['id']}})[_0x54de('0x28')](handleEntityNotFound(_0x53e6fe,null))[_0x54de('0x28')](saveUpdates(_0x11060a[_0x54de('0x59')],null))[_0x54de('0x28')](respondWithResult(_0x53e6fe,null))[_0x54de('0x4b')](handleError(_0x53e6fe,null));};exports[_0x54de('0x2b')]=function(_0x29dfd0,_0x39dcdc){return db['MailQueue'][_0x54de('0x4f')]({'where':{'id':_0x29dfd0[_0x54de('0x5a')]['id']}})['then'](handleEntityNotFound(_0x39dcdc,null))['then'](removeEntity(_0x39dcdc,null))[_0x54de('0x4b')](handleError(_0x39dcdc,null));};exports[_0x54de('0x5b')]=function(_0x1503c4,_0x4d2a9c){return db[_0x54de('0x32')][_0x54de('0x5b')]()[_0x54de('0x28')](respondWithResult(_0x4d2a9c,null))[_0x54de('0x4b')](handleError(_0x4d2a9c,null));};exports['getMembers']=function(_0x48957d,_0x1d9ef4,_0xac8c48){var _0x424374={'raw':!![],'where':{}},_0x379cdb={},_0x59e4ea;return db[_0x54de('0x32')]['findOne']({'where':{'id':_0x48957d[_0x54de('0x5a')]['id']}})[_0x54de('0x28')](handleEntityNotFound(_0x1d9ef4,null))[_0x54de('0x28')](function(_0x1c8532){if(_0x1c8532){_0x59e4ea=_0x1c8532[_0x54de('0x29')]({'plain':!![]});_0x379cdb[_0x54de('0x35')]=_[_0x54de('0x37')](db[_0x54de('0x5c')]['rawAttributes']);_0x379cdb[_0x54de('0x36')]=_[_0x54de('0x37')](_0x48957d[_0x54de('0x36')]);_0x379cdb[_0x54de('0x38')]=_[_0x54de('0x39')](_0x379cdb[_0x54de('0x35')],_0x379cdb['query']);_0x424374[_0x54de('0x3a')]=_[_0x54de('0x39')](_0x379cdb['model'],qs['fields'](_0x48957d['query'][_0x54de('0x4d')]));_0x424374['attributes']=_0x424374[_0x54de('0x3a')][_0x54de('0x3b')]?_0x424374[_0x54de('0x3a')]:_0x379cdb[_0x54de('0x35')];if(!_0x48957d[_0x54de('0x36')][_0x54de('0x3c')](_0x54de('0x3d'))){_0x424374[_0x54de('0x22')]=qs[_0x54de('0x22')](_0x48957d[_0x54de('0x36')][_0x54de('0x22')]);_0x424374[_0x54de('0x20')]=qs[_0x54de('0x20')](_0x48957d[_0x54de('0x36')][_0x54de('0x20')]);}_0x424374[_0x54de('0x3e')]=qs[_0x54de('0x3f')](_0x48957d[_0x54de('0x36')][_0x54de('0x3f')]);_0x424374['where']=qs[_0x54de('0x38')](_[_0x54de('0x41')](_0x48957d[_0x54de('0x36')],_0x379cdb[_0x54de('0x38')]));_0x424374[_0x54de('0x40')][_0x54de('0x5d')]=_0x1c8532['id'];if(_0x48957d[_0x54de('0x36')][_0x54de('0x46')]){_0x424374[_0x54de('0x40')]=_[_0x54de('0x42')](_0x424374[_0x54de('0x40')],{'$or':_[_0x54de('0x31')](_0x424374[_0x54de('0x3a')],function(_0x467163){var _0x9b6bad={};_0x9b6bad[_0x467163]={'$like':'%'+_0x48957d['query']['filter']+'%'};return _0x9b6bad;})});}_0x424374=_[_0x54de('0x42')]({},_0x424374,_0x48957d[_0x54de('0x47')]);return db[_0x54de('0x5c')][_0x54de('0x49')](_0x424374);}})[_0x54de('0x28')](function(_0x3557e2){if(_0x3557e2){return db[_0x54de('0x5e')][_0x54de('0x5f')]({'where':{'id':_['map'](_0x3557e2,'UserId'),'role':'agent'},'attributes':['id',_0x54de('0x45'),_0x54de('0x60'),'updatedAt',_0x54de('0x61')]});}})[_0x54de('0x28')](function(_0xc8353){if(_0xc8353){return{'count':_0xc8353[_0x54de('0x23')],'rows':_[_0x54de('0x31')](_0xc8353['rows'],function(_0xc8fab6){return{'membername':_0xc8fab6[_0x54de('0x45')],'UserId':_0xc8fab6['id'],'queue_name':_0x59e4ea[_0x54de('0x45')],'MailQueueId':_0x59e4ea['id'],'interface':util[_0x54de('0x62')](_0x54de('0x63'),_0x54de('0x64'),_0xc8fab6['name']),'penalty':0x0,'paused':_0xc8fab6['mailPause'],'createdAt':_0xc8fab6[_0x54de('0x61')],'updatedAt':_0xc8fab6[_0x54de('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x54de('0x28')](respondWithFilteredResult(_0x1d9ef4,_0x424374))[_0x54de('0x4b')](handleError(_0x1d9ef4,null));};exports['getTeams']=function(_0x59a37d,_0x10987c,_0x14d74a){var _0x5b7b68={};var _0x5e9473={};var _0x1f1d9c;var _0x2b7577;return db[_0x54de('0x32')][_0x54de('0x66')]({'where':{'id':_0x59a37d[_0x54de('0x5a')]['id']}})[_0x54de('0x28')](handleEntityNotFound(_0x10987c,null))[_0x54de('0x28')](function(_0x9737a2){if(_0x9737a2){_0x1f1d9c=_0x9737a2;_0x5e9473[_0x54de('0x35')]=_['keys'](db[_0x54de('0x67')][_0x54de('0x33')]);_0x5e9473[_0x54de('0x36')]=_[_0x54de('0x37')](_0x59a37d[_0x54de('0x36')]);_0x5e9473[_0x54de('0x38')]=_['intersection'](_0x5e9473[_0x54de('0x35')],_0x5e9473[_0x54de('0x36')]);_0x5b7b68['attributes']=_['intersection'](_0x5e9473[_0x54de('0x35')],qs['fields'](_0x59a37d[_0x54de('0x36')]['fields']));_0x5b7b68[_0x54de('0x3a')]=_0x5b7b68[_0x54de('0x3a')][_0x54de('0x3b')]?_0x5b7b68[_0x54de('0x3a')]:_0x5e9473['model'];_0x5b7b68[_0x54de('0x3e')]=qs[_0x54de('0x3f')](_0x59a37d[_0x54de('0x36')][_0x54de('0x3f')]);_0x5b7b68[_0x54de('0x40')]=qs[_0x54de('0x38')](_[_0x54de('0x41')](_0x59a37d[_0x54de('0x36')],_0x5e9473[_0x54de('0x38')]));if(_0x59a37d[_0x54de('0x36')][_0x54de('0x46')]){_0x5b7b68[_0x54de('0x40')]=_[_0x54de('0x42')](_0x5b7b68['where'],{'$or':_['map'](_0x5b7b68[_0x54de('0x3a')],function(_0x1f040f){var _0x2c581f={};_0x2c581f[_0x1f040f]={'$like':'%'+_0x59a37d[_0x54de('0x36')][_0x54de('0x46')]+'%'};return _0x2c581f;})});}_0x5b7b68=_[_0x54de('0x42')]({},_0x5b7b68,_0x59a37d['options']);return _0x1f1d9c[_0x54de('0x68')](_0x5b7b68);}})[_0x54de('0x28')](function(_0x3b7db2){if(_0x3b7db2){_0x2b7577=_0x3b7db2[_0x54de('0x3b')];if(!_0x59a37d[_0x54de('0x36')]['hasOwnProperty'](_0x54de('0x3d'))){_0x5b7b68['limit']=qs[_0x54de('0x22')](_0x59a37d[_0x54de('0x36')][_0x54de('0x22')]);_0x5b7b68[_0x54de('0x20')]=qs[_0x54de('0x20')](_0x59a37d[_0x54de('0x36')]['offset']);}return _0x1f1d9c['getTeams'](_0x5b7b68);}})[_0x54de('0x28')](function(_0x183508){if(_0x183508){return _0x183508?{'count':_0x2b7577,'rows':_0x183508}:null;}})[_0x54de('0x28')](respondWithResult(_0x10987c,null))['catch'](handleError(_0x10987c,null));};exports[_0x54de('0x69')]=function(_0x450512,_0x4fe217,_0x4ef74e){var _0x2df606=_0x450512[_0x54de('0x59')]['ids'];return db[_0x54de('0x67')][_0x54de('0x49')]({'where':{'id':_0x2df606},'attributes':['id'],'include':[{'model':db[_0x54de('0x5e')],'as':_0x54de('0x6a'),'attributes':['id','name',_0x54de('0x6b'),'voicePause',_0x54de('0x6c')],'raw':!![]}]})[_0x54de('0x28')](function(_0x5542ce){if(_0x5542ce){var _0x38cf42=_[_0x54de('0x6d')](_0x5542ce,function(_0x16e1e){var _0x4d9253=_0x16e1e[_0x54de('0x29')]({'plain':!![]});return _0x4d9253[_0x54de('0x6a')];});return db[_0x54de('0x32')][_0x54de('0x4f')]({'where':{'id':_0x450512[_0x54de('0x5a')]['id']}})[_0x54de('0x28')](function(_0x55e605){return db[_0x54de('0x6e')][_0x54de('0x6f')](function(_0x2f0aa6){return _0x55e605[_0x54de('0x69')](_0x2df606,{'transaction':_0x2f0aa6})['then'](function(){return BPromise[_0x54de('0x70')](_0x38cf42,function(_0x1f5c8e){return db[_0x54de('0x5c')][_0x54de('0x71')]({'where':{'UserId':_0x1f5c8e['id'],'MailQueueId':_0x450512[_0x54de('0x5a')]['id']},'transaction':_0x2f0aa6});});})['then'](function(){_0x38cf42[_0x54de('0x72')](function(_0x517053){socket['emit'](_0x54de('0x73'),{'UserId':_0x517053['id'],'MailQueueId':_0x55e605['id']});});});});});}})[_0x54de('0x28')](respondWithStatusCode(_0x4fe217,null))['catch'](handleError(_0x4fe217,null));};exports['removeTeams']=function(_0x148e08,_0x12d473,_0x349dea){return db[_0x54de('0x67')][_0x54de('0x49')]({'where':{'id':_0x148e08['query'][_0x54de('0x74')]},'attributes':['id'],'include':[{'model':db[_0x54de('0x5e')],'as':_0x54de('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x54de('0x28')](handleEntityNotFound(_0x12d473,null))[_0x54de('0x28')](function(_0x28a68f){var _0x4762bd=_[_0x54de('0x31')](_0x28a68f,'id');var _0x3977aa=[];var _0x102839=[];var _0x45b3ff=squel['select']();_0x45b3ff[_0x54de('0x75')](_0x54de('0x76'))['from']('team_has_mail_queues','tq')[_0x54de('0x77')](_0x54de('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x54de('0x79'),_0x148e08[_0x54de('0x5a')]['id']);for(var _0x23f034=0x0;_0x23f034<_0x28a68f[_0x54de('0x3b')];_0x23f034+=0x1){let _0x15aef4=_0x28a68f[_0x23f034];for(var _0x206870=0x0;_0x206870<_0x15aef4[_0x54de('0x6a')][_0x54de('0x3b')];_0x206870+=0x1){let _0x2dfffa=_0x15aef4[_0x54de('0x6a')][_0x206870];var _0x11baf8=_0x45b3ff[_0x54de('0x7a')]();_0x11baf8[_0x54de('0x40')](_0x54de('0x7b'),_0x2dfffa['id']);_0x102839[_0x54de('0x7c')](db['sequelize'][_0x54de('0x36')](_0x11baf8['toString'](),{'type':db[_0x54de('0x6e')][_0x54de('0x7d')][_0x54de('0x7e')]})[_0x54de('0x28')](function(_0x1d8f37){if(_0x1d8f37[_0x54de('0x3b')]===0x1){return _0x2dfffa['id'];}else{var _0x7047fb=_[_0x54de('0x7f')](_[_0x54de('0x31')](_0x1d8f37,_0x54de('0x80')),function(_0x3fc125){return _[_0x54de('0x81')](_0x4762bd,_0x3fc125);});if(_0x7047fb){return _0x2dfffa['id'];}}}));}}return BPromise['all'](_0x102839)[_0x54de('0x28')](function(_0x1777bc){_0x3977aa=_(_0x3977aa)[_0x54de('0x82')](_0x1777bc)[_0x54de('0x83')]()[_0x54de('0x84')]();return db[_0x54de('0x32')][_0x54de('0x4f')]({'where':{'id':_0x148e08['params']['id']}})['then'](function(_0x588f3d){return db['sequelize'][_0x54de('0x6f')](function(_0x11f329){return _0x588f3d[_0x54de('0x85')](_0x148e08[_0x54de('0x36')][_0x54de('0x74')],{'transaction':_0x11f329})[_0x54de('0x28')](function(){if(!_[_0x54de('0x86')](_0x3977aa)){return _0x588f3d[_0x54de('0x87')](_0x3977aa,{'transaction':_0x11f329});}})['then'](function(){_0x3977aa['forEach'](function(_0x22318e){socket['emit'](_0x54de('0x88'),{'UserId':_0x22318e,'MailQueueId':_0x588f3d['id']});});});});});});})[_0x54de('0x28')](respondWithStatusCode(_0x12d473,null))['catch'](handleError(_0x12d473,null));};exports[_0x54de('0x89')]=function(_0x3cb471,_0x435c9e,_0x159c5d){return db[_0x54de('0x32')][_0x54de('0x4f')]({'where':{'id':_0x3cb471[_0x54de('0x5a')]['id']}})[_0x54de('0x28')](handleEntityNotFound(_0x435c9e,null))[_0x54de('0x28')](function(_0x5c5f90){if(_0x5c5f90){return _0x5c5f90['addAgents'](_0x3cb471[_0x54de('0x59')]['ids'],_[_0x54de('0x8a')](_0x3cb471[_0x54de('0x59')],['ids','id'])||{})[_0x54de('0x8b')](function(_0x2d631a){for(var _0x3e149d=0x0;_0x3e149d<_0x3cb471[_0x54de('0x59')]['ids'][_0x54de('0x3b')];_0x3e149d+=0x1){socket[_0x54de('0x8c')](_0x54de('0x73'),{'UserId':Number(_0x3cb471['body'][_0x54de('0x74')][_0x3e149d]),'MailQueueId':Number(_0x3cb471['params']['id'])});}return _0x2d631a;});}})[_0x54de('0x28')](respondWithResult(_0x435c9e,null))['catch'](handleError(_0x435c9e,null));};exports[_0x54de('0x87')]=function(_0x1ed570,_0x3a4e8a,_0xd0934d){return db[_0x54de('0x32')][_0x54de('0x4f')]({'where':{'id':_0x1ed570[_0x54de('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3a4e8a,null))['then'](function(_0x4dfc33){if(_0x4dfc33){return _0x4dfc33[_0x54de('0x87')](_0x1ed570[_0x54de('0x36')][_0x54de('0x74')])['then'](function(){if(_[_0x54de('0x8d')](_0x1ed570[_0x54de('0x36')]['ids'])){for(var _0x14d2ba=0x0;_0x14d2ba<_0x1ed570[_0x54de('0x36')]['ids'][_0x54de('0x3b')];_0x14d2ba+=0x1){socket[_0x54de('0x8c')]('userMailQueue:remove',{'UserId':Number(_0x1ed570[_0x54de('0x36')][_0x54de('0x74')][_0x14d2ba]),'MailQueueId':Number(_0x1ed570['params']['id'])});}}else{socket[_0x54de('0x8c')]('userMailQueue:remove',{'UserId':Number(_0x1ed570[_0x54de('0x36')][_0x54de('0x74')]),'MailQueueId':Number(_0x1ed570[_0x54de('0x5a')]['id'])});}});}})[_0x54de('0x28')](respondWithStatusCode(_0x3a4e8a,null))[_0x54de('0x4b')](handleError(_0x3a4e8a,null));};exports[_0x54de('0x8e')]=function(_0x335d59,_0x253d0e,_0xeacb9d){var _0x44930b={};var _0x156f2a={};var _0x5783a1;var _0x5c1fc1;return db['MailQueue']['findOne']({'where':{'id':_0x335d59[_0x54de('0x5a')]['id']}})['then'](handleEntityNotFound(_0x253d0e,null))[_0x54de('0x28')](function(_0xe7b038){if(_0xe7b038){_0x5783a1=_0xe7b038;_0x156f2a[_0x54de('0x35')]=_[_0x54de('0x37')](db[_0x54de('0x5e')][_0x54de('0x33')]);_0x156f2a['query']=_[_0x54de('0x37')](_0x335d59['query']);_0x156f2a['filters']=_[_0x54de('0x39')](_0x156f2a[_0x54de('0x35')],_0x156f2a['query']);_0x44930b[_0x54de('0x3a')]=_['intersection'](_0x156f2a[_0x54de('0x35')],qs[_0x54de('0x4d')](_0x335d59['query'][_0x54de('0x4d')]));_0x44930b['attributes']=_0x44930b[_0x54de('0x3a')][_0x54de('0x3b')]?_0x44930b[_0x54de('0x3a')]:_0x156f2a[_0x54de('0x35')];_0x44930b['order']=qs[_0x54de('0x3f')](_0x335d59[_0x54de('0x36')][_0x54de('0x3f')]);_0x44930b[_0x54de('0x40')]=qs[_0x54de('0x38')](_[_0x54de('0x41')](_0x335d59[_0x54de('0x36')],_0x156f2a[_0x54de('0x38')]));if(_0x335d59[_0x54de('0x36')][_0x54de('0x46')]){_0x44930b[_0x54de('0x40')]=_['merge'](_0x44930b[_0x54de('0x40')],{'$or':_[_0x54de('0x31')](_0x44930b[_0x54de('0x3a')],function(_0x598a46){var _0x316ce9={};_0x316ce9[_0x598a46]={'$like':'%'+_0x335d59[_0x54de('0x36')][_0x54de('0x46')]+'%'};return _0x316ce9;})});}_0x44930b=_[_0x54de('0x42')]({},_0x44930b,_0x335d59['options']);return _0x5783a1[_0x54de('0x8e')](_0x44930b);}})['then'](function(_0x86b1e5){if(_0x86b1e5){_0x5c1fc1=_0x86b1e5['length'];if(!_0x335d59[_0x54de('0x36')][_0x54de('0x3c')](_0x54de('0x3d'))){_0x44930b['limit']=qs[_0x54de('0x22')](_0x335d59[_0x54de('0x36')][_0x54de('0x22')]);_0x44930b['offset']=qs[_0x54de('0x20')](_0x335d59[_0x54de('0x36')][_0x54de('0x20')]);}return _0x5783a1['getAgents'](_0x44930b);}})[_0x54de('0x28')](function(_0x1b40c7){if(_0x1b40c7){return _0x1b40c7?{'count':_0x5c1fc1,'rows':_0x1b40c7}:null;}})[_0x54de('0x28')](respondWithResult(_0x253d0e,null))['catch'](handleError(_0x253d0e,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 015ed0a..a5371a5 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 _0xd1e6=['../../mysqldb','MailQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x41babc,_0x2bed0d){var _0xe58aab=function(_0x4fcf9d){while(--_0x4fcf9d){_0x41babc['push'](_0x41babc['shift']());}};_0xe58aab(++_0x2bed0d);}(_0xd1e6,0x149));var _0x6d1e=function(_0x23559f,_0x4e71b4){_0x23559f=_0x23559f-0x0;var _0x4f4d5e=_0xd1e6[_0x23559f];return _0x4f4d5e;};'use strict';var EventEmitter=require(_0x6d1e('0x0'));var MailQueue=require(_0x6d1e('0x1'))['db'][_0x6d1e('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6d1e('0x3')](0x0);var events={'afterCreate':_0x6d1e('0x4'),'afterUpdate':_0x6d1e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58859e){return function(_0x2c264f,_0x3d6625,_0xe7f809){MailQueueEvents[_0x6d1e('0x6')](_0x58859e+':'+_0x2c264f['id'],_0x2c264f);MailQueueEvents[_0x6d1e('0x6')](_0x58859e,_0x2c264f);_0xe7f809(null);};}for(var e in events){if(events[_0x6d1e('0x7')](e)){var event=events[e];MailQueue[_0x6d1e('0x8')](e,emitEvent(event));}}module[_0x6d1e('0x9')]=MailQueueEvents; \ No newline at end of file +var _0xcd3f=['MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcd3f,0x1ca));var _0xfcd3=function(_0x47b038,_0x1b0295){_0x47b038=_0x47b038-0x0;var _0xf5a7f1=_0xcd3f[_0x47b038];return _0xf5a7f1;};'use strict';var EventEmitter=require(_0xfcd3('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xfcd3('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xfcd3('0x2')](0x0);var events={'afterCreate':_0xfcd3('0x3'),'afterUpdate':_0xfcd3('0x4'),'afterDestroy':_0xfcd3('0x5')};function emitEvent(_0x30d80b){return function(_0x2daab3,_0xc6a8f1,_0x5255d9){MailQueueEvents['emit'](_0x30d80b+':'+_0x2daab3['id'],_0x2daab3);MailQueueEvents[_0xfcd3('0x6')](_0x30d80b,_0x2daab3);_0x5255d9(null);};}for(var e in events){if(events[_0xfcd3('0x7')](e)){var event=events[e];MailQueue[_0xfcd3('0x8')](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 18e3e3d..a683ef5 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 _0x6209=['exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./mailQueue.attributes'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6209,0x108));var _0x9620=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x6209[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x9620('0x0'));var util=require(_0x9620('0x1'));var logger=require(_0x9620('0x2'))(_0x9620('0x3'));var moment=require(_0x9620('0x4'));var BPromise=require('bluebird');var rp=require(_0x9620('0x5'));var fs=require('fs');var path=require(_0x9620('0x6'));var rimraf=require(_0x9620('0x7'));var config=require('../../config/environment');var attributes=require(_0x9620('0x8'));module[_0x9620('0x9')]=function(_0x162d94,_0x53450d){return _0x162d94[_0x9620('0xa')](_0x9620('0xb'),attributes,{'tableName':_0x9620('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c18=['api','moment','request-promise','path','rimraf','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','../../config/logger'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x7c18,0xf0));var _0x87c1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7c18[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x87c1('0x0'));var util=require('util');var logger=require(_0x87c1('0x1'))(_0x87c1('0x2'));var moment=require(_0x87c1('0x3'));var BPromise=require('bluebird');var rp=require(_0x87c1('0x4'));var fs=require('fs');var path=require(_0x87c1('0x5'));var rimraf=require(_0x87c1('0x6'));var config=require('../../config/environment');var attributes=require(_0x87c1('0x7'));module['exports']=function(_0x3a80cd,_0x2282e0){return _0x3a80cd[_0x87c1('0x8')](_0x87c1('0x9'),attributes,{'tableName':_0x87c1('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 90bd893..6d277f9 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 _0x20a9=['options','raw','attributes','limit','model','map','include','where','ShowMailQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue'];(function(_0x594f5a,_0xda07f0){var _0x45b7fd=function(_0x16725c){while(--_0x16725c){_0x594f5a['push'](_0x594f5a['shift']());}};_0x45b7fd(++_0xda07f0);}(_0x20a9,0x113));var _0x920a=function(_0x187399,_0x40c56d){_0x187399=_0x187399-0x0;var _0x40fa92=_0x20a9[_0x187399];return _0x40fa92;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x920a('0x0'));var BPromise=require(_0x920a('0x1'));var rs=require(_0x920a('0x2'));var fs=require('fs');var Redis=require(_0x920a('0x3'));var db=require(_0x920a('0x4'))['db'];var utils=require(_0x920a('0x5'));var logger=require(_0x920a('0x6'))(_0x920a('0x7'));var config=require(_0x920a('0x8'));var jayson=require(_0x920a('0x9'));var client=jayson[_0x920a('0xa')]['http']({'port':0x232a});config[_0x920a('0xb')]=_[_0x920a('0xc')](config['redis'],{'host':_0x920a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x920a('0xb')]));require('./mailQueue.socket')[_0x920a('0xe')](socket);function respondWithRpcPromise(_0x2eb7d0,_0x3019b4,_0x2d1302){return new BPromise(function(_0x350f30,_0x2c0471){return client[_0x920a('0xf')](_0x2eb7d0,_0x2d1302)[_0x920a('0x10')](function(_0x7f2792){logger[_0x920a('0x11')]('MailQueue,\x20%s,\x20%s',_0x3019b4,_0x920a('0x12'));logger[_0x920a('0x13')](_0x920a('0x14'),_0x3019b4,_0x920a('0x12'),JSON[_0x920a('0x15')](_0x7f2792));if(_0x7f2792[_0x920a('0x16')]){if(_0x7f2792[_0x920a('0x16')][_0x920a('0x17')]===0x1f4){logger[_0x920a('0x16')](_0x920a('0x18'),_0x3019b4,_0x7f2792[_0x920a('0x16')][_0x920a('0x19')]);return _0x2c0471(_0x7f2792[_0x920a('0x16')][_0x920a('0x19')]);}logger['error']('MailQueue,\x20%s,\x20%s',_0x3019b4,_0x7f2792[_0x920a('0x16')]['message']);return _0x350f30(_0x7f2792[_0x920a('0x16')][_0x920a('0x19')]);}else{logger[_0x920a('0x11')](_0x920a('0x18'),_0x3019b4,_0x920a('0x12'));_0x350f30(_0x7f2792[_0x920a('0x1a')][_0x920a('0x19')]);}})[_0x920a('0x1b')](function(_0x3247f5){logger[_0x920a('0x16')](_0x920a('0x18'),_0x3019b4,_0x3247f5);_0x2c0471(_0x3247f5);});});}exports[_0x920a('0x1c')]=function(_0x5b446f){var _0x294c46=this;return new Promise(function(_0x3a39c1,_0x1c0c55){return db['MailQueue']['findAll']({'raw':_0x5b446f[_0x920a('0x1d')]?_0x5b446f[_0x920a('0x1d')][_0x920a('0x1e')]===undefined?!![]:![]:!![],'where':_0x5b446f[_0x920a('0x1d')]?_0x5b446f[_0x920a('0x1d')]['where']||null:null,'attributes':_0x5b446f[_0x920a('0x1d')]?_0x5b446f[_0x920a('0x1d')][_0x920a('0x1f')]||null:null,'limit':_0x5b446f[_0x920a('0x1d')]?_0x5b446f[_0x920a('0x1d')][_0x920a('0x20')]||null:null,'include':_0x5b446f[_0x920a('0x1d')]?_0x5b446f[_0x920a('0x1d')]['include']?_['map'](_0x5b446f[_0x920a('0x1d')]['include'],function(_0x36d050){return{'model':db[_0x36d050[_0x920a('0x21')]],'as':_0x36d050['as'],'attributes':_0x36d050['attributes'],'include':_0x36d050['include']?_[_0x920a('0x22')](_0x36d050['include'],function(_0xf2653d){return{'model':db[_0xf2653d[_0x920a('0x21')]],'as':_0xf2653d['as'],'attributes':_0xf2653d[_0x920a('0x1f')],'include':_0xf2653d[_0x920a('0x23')]?_['map'](_0xf2653d[_0x920a('0x23')],function(_0x5d19fb){return{'model':db[_0x5d19fb[_0x920a('0x21')]],'as':_0x5d19fb['as'],'attributes':_0x5d19fb[_0x920a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x920a('0x10')](function(_0x357cda){logger[_0x920a('0x11')](_0x920a('0x1c'),_0x5b446f);logger['debug'](_0x920a('0x1c'),_0x5b446f,JSON[_0x920a('0x15')](_0x357cda));_0x3a39c1(_0x357cda);})['catch'](function(_0x5b434b){logger[_0x920a('0x16')](_0x920a('0x1c'),_0x5b434b[_0x920a('0x19')],_0x5b446f);_0x1c0c55(_0x294c46[_0x920a('0x16')](0x1f4,_0x5b434b[_0x920a('0x19')]));});});};exports['ShowMailQueue']=function(_0x3f3dd9){var _0x2934bf=this;return new Promise(function(_0x2c492e,_0x2b19a3){return db['MailQueue']['find']({'raw':_0x3f3dd9['options']?_0x3f3dd9[_0x920a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3f3dd9[_0x920a('0x1d')]?_0x3f3dd9[_0x920a('0x1d')][_0x920a('0x24')]||null:null,'attributes':_0x3f3dd9['options']?_0x3f3dd9[_0x920a('0x1d')]['attributes']||null:null,'include':_0x3f3dd9[_0x920a('0x1d')]?_0x3f3dd9[_0x920a('0x1d')][_0x920a('0x23')]?_['map'](_0x3f3dd9[_0x920a('0x1d')]['include'],function(_0x58f529){return{'model':db[_0x58f529[_0x920a('0x21')]],'as':_0x58f529['as'],'attributes':_0x58f529[_0x920a('0x1f')],'include':_0x58f529[_0x920a('0x23')]?_[_0x920a('0x22')](_0x58f529[_0x920a('0x23')],function(_0x34f094){return{'model':db[_0x34f094[_0x920a('0x21')]],'as':_0x34f094['as'],'attributes':_0x34f094['attributes'],'include':_0x34f094[_0x920a('0x23')]?_[_0x920a('0x22')](_0x34f094[_0x920a('0x23')],function(_0x4532b2){return{'model':db[_0x4532b2[_0x920a('0x21')]],'as':_0x4532b2['as'],'attributes':_0x4532b2[_0x920a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x920a('0x10')](function(_0x2da8b6){logger[_0x920a('0x11')]('ShowMailQueue',_0x3f3dd9);logger[_0x920a('0x13')](_0x920a('0x25'),_0x3f3dd9,JSON[_0x920a('0x15')](_0x2da8b6));_0x2c492e(_0x2da8b6);})[_0x920a('0x1b')](function(_0x2eac31){logger['error']('ShowMailQueue',_0x2eac31[_0x920a('0x19')],_0x3f3dd9);_0x2b19a3(_0x2934bf[_0x920a('0x16')](0x1f4,_0x2eac31[_0x920a('0x19')]));});});}; \ No newline at end of file +var _0x1fa6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','where','attributes','limit','include','map','model','ShowMailQueue','find','raw','info','lodash','util','moment'];(function(_0x335d51,_0x4f48a1){var _0x54e66d=function(_0x20df73){while(--_0x20df73){_0x335d51['push'](_0x335d51['shift']());}};_0x54e66d(++_0x4f48a1);}(_0x1fa6,0x10b));var _0x61fa=function(_0x581d40,_0x3e1b11){_0x581d40=_0x581d40-0x0;var _0x4fe168=_0x1fa6[_0x581d40];return _0x4fe168;};'use strict';var _=require(_0x61fa('0x0'));var util=require(_0x61fa('0x1'));var moment=require(_0x61fa('0x2'));var BPromise=require(_0x61fa('0x3'));var rs=require(_0x61fa('0x4'));var fs=require('fs');var Redis=require(_0x61fa('0x5'));var db=require(_0x61fa('0x6'))['db'];var utils=require(_0x61fa('0x7'));var logger=require(_0x61fa('0x8'))(_0x61fa('0x9'));var config=require(_0x61fa('0xa'));var jayson=require(_0x61fa('0xb'));var client=jayson[_0x61fa('0xc')][_0x61fa('0xd')]({'port':0x232a});config[_0x61fa('0xe')]=_[_0x61fa('0xf')](config[_0x61fa('0xe')],{'host':_0x61fa('0x10'),'port':0x18eb});var socket=require(_0x61fa('0x11'))(new Redis(config['redis']));require(_0x61fa('0x12'))[_0x61fa('0x13')](socket);function respondWithRpcPromise(_0x3cd219,_0x5206ec,_0x10b670){return new BPromise(function(_0x5677ed,_0x1e7be9){return client[_0x61fa('0x14')](_0x3cd219,_0x10b670)[_0x61fa('0x15')](function(_0x2ecbb2){logger['info'](_0x61fa('0x16'),_0x5206ec,_0x61fa('0x17'));logger[_0x61fa('0x18')](_0x61fa('0x19'),_0x5206ec,_0x61fa('0x17'),JSON[_0x61fa('0x1a')](_0x2ecbb2));if(_0x2ecbb2[_0x61fa('0x1b')]){if(_0x2ecbb2[_0x61fa('0x1b')][_0x61fa('0x1c')]===0x1f4){logger[_0x61fa('0x1b')](_0x61fa('0x16'),_0x5206ec,_0x2ecbb2[_0x61fa('0x1b')][_0x61fa('0x1d')]);return _0x1e7be9(_0x2ecbb2[_0x61fa('0x1b')][_0x61fa('0x1d')]);}logger[_0x61fa('0x1b')](_0x61fa('0x16'),_0x5206ec,_0x2ecbb2[_0x61fa('0x1b')][_0x61fa('0x1d')]);return _0x5677ed(_0x2ecbb2['error']['message']);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x5206ec,'request\x20sent');_0x5677ed(_0x2ecbb2[_0x61fa('0x1e')][_0x61fa('0x1d')]);}})[_0x61fa('0x1f')](function(_0x58dd9b){logger[_0x61fa('0x1b')]('MailQueue,\x20%s,\x20%s',_0x5206ec,_0x58dd9b);_0x1e7be9(_0x58dd9b);});});}exports[_0x61fa('0x20')]=function(_0x140875){var _0x38b247=this;return new Promise(function(_0xeb57d9,_0x596513){return db[_0x61fa('0x21')]['findAll']({'raw':_0x140875['options']?_0x140875['options']['raw']===undefined?!![]:![]:!![],'where':_0x140875[_0x61fa('0x22')]?_0x140875[_0x61fa('0x22')][_0x61fa('0x23')]||null:null,'attributes':_0x140875[_0x61fa('0x22')]?_0x140875[_0x61fa('0x22')][_0x61fa('0x24')]||null:null,'limit':_0x140875['options']?_0x140875[_0x61fa('0x22')][_0x61fa('0x25')]||null:null,'include':_0x140875[_0x61fa('0x22')]?_0x140875[_0x61fa('0x22')][_0x61fa('0x26')]?_[_0x61fa('0x27')](_0x140875[_0x61fa('0x22')][_0x61fa('0x26')],function(_0x51f5a4){return{'model':db[_0x51f5a4[_0x61fa('0x28')]],'as':_0x51f5a4['as'],'attributes':_0x51f5a4['attributes'],'include':_0x51f5a4['include']?_['map'](_0x51f5a4[_0x61fa('0x26')],function(_0x279ed3){return{'model':db[_0x279ed3[_0x61fa('0x28')]],'as':_0x279ed3['as'],'attributes':_0x279ed3[_0x61fa('0x24')],'include':_0x279ed3['include']?_['map'](_0x279ed3[_0x61fa('0x26')],function(_0x4ac1e6){return{'model':db[_0x4ac1e6[_0x61fa('0x28')]],'as':_0x4ac1e6['as'],'attributes':_0x4ac1e6[_0x61fa('0x24')]};}):[]};}):[]};}):[]:[]})[_0x61fa('0x15')](function(_0x28ef9e){logger['info'](_0x61fa('0x20'),_0x140875);logger[_0x61fa('0x18')](_0x61fa('0x20'),_0x140875,JSON[_0x61fa('0x1a')](_0x28ef9e));_0xeb57d9(_0x28ef9e);})[_0x61fa('0x1f')](function(_0x14f953){logger[_0x61fa('0x1b')](_0x61fa('0x20'),_0x14f953[_0x61fa('0x1d')],_0x140875);_0x596513(_0x38b247[_0x61fa('0x1b')](0x1f4,_0x14f953['message']));});});};exports[_0x61fa('0x29')]=function(_0x499baa){var _0x1bfc14=this;return new Promise(function(_0x3aff25,_0x275547){return db[_0x61fa('0x21')][_0x61fa('0x2a')]({'raw':_0x499baa[_0x61fa('0x22')]?_0x499baa[_0x61fa('0x22')][_0x61fa('0x2b')]===undefined?!![]:![]:!![],'where':_0x499baa[_0x61fa('0x22')]?_0x499baa[_0x61fa('0x22')]['where']||null:null,'attributes':_0x499baa[_0x61fa('0x22')]?_0x499baa['options']['attributes']||null:null,'include':_0x499baa[_0x61fa('0x22')]?_0x499baa['options']['include']?_[_0x61fa('0x27')](_0x499baa[_0x61fa('0x22')][_0x61fa('0x26')],function(_0x202e41){return{'model':db[_0x202e41['model']],'as':_0x202e41['as'],'attributes':_0x202e41[_0x61fa('0x24')],'include':_0x202e41[_0x61fa('0x26')]?_[_0x61fa('0x27')](_0x202e41[_0x61fa('0x26')],function(_0x2c1814){return{'model':db[_0x2c1814[_0x61fa('0x28')]],'as':_0x2c1814['as'],'attributes':_0x2c1814[_0x61fa('0x24')],'include':_0x2c1814['include']?_[_0x61fa('0x27')](_0x2c1814[_0x61fa('0x26')],function(_0x961002){return{'model':db[_0x961002[_0x61fa('0x28')]],'as':_0x961002['as'],'attributes':_0x961002['attributes']};}):[]};}):[]};}):[]:[]})[_0x61fa('0x15')](function(_0x290429){logger[_0x61fa('0x2c')]('ShowMailQueue',_0x499baa);logger[_0x61fa('0x18')](_0x61fa('0x29'),_0x499baa,JSON[_0x61fa('0x1a')](_0x290429));_0x3aff25(_0x290429);})[_0x61fa('0x1f')](function(_0x37ca12){logger[_0x61fa('0x1b')](_0x61fa('0x29'),_0x37ca12[_0x61fa('0x1d')],_0x499baa);_0x275547(_0x1bfc14[_0x61fa('0x1b')](0x1f4,_0x37ca12[_0x61fa('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index b86a7f1..fb927b7 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 _0x1fe1=['emit','register','length','./mailQueue.events','save','remove'];(function(_0x1b68ba,_0x23687a){var _0xf49b11=function(_0x5732c6){while(--_0x5732c6){_0x1b68ba['push'](_0x1b68ba['shift']());}};_0xf49b11(++_0x23687a);}(_0x1fe1,0xbd));var _0x11fe=function(_0x3851b2,_0xf67c5d){_0x3851b2=_0x3851b2-0x0;var _0x3a8ee0=_0x1fe1[_0x3851b2];return _0x3a8ee0;};'use strict';var MailQueueEvents=require(_0x11fe('0x0'));var events=[_0x11fe('0x1'),_0x11fe('0x2'),'update'];function createListener(_0xf94be8,_0x3f08ed){return function(_0x44dfd3){_0x3f08ed[_0x11fe('0x3')](_0xf94be8,_0x44dfd3);};}function removeListener(_0x4af7d3,_0x563842){return function(){MailQueueEvents['removeListener'](_0x4af7d3,_0x563842);};}exports[_0x11fe('0x4')]=function(_0x458d89){for(var _0x4e29a3=0x0,_0x59f77b=events[_0x11fe('0x5')];_0x4e29a3<_0x59f77b;_0x4e29a3++){var _0x341cc8=events[_0x4e29a3];var _0x650285=createListener('mailQueue:'+_0x341cc8,_0x458d89);MailQueueEvents['on'](_0x341cc8,_0x650285);}}; \ No newline at end of file +var _0xb75e=['length','mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x322e82,_0x30091f){var _0x50aa5a=function(_0x2a84af){while(--_0x2a84af){_0x322e82['push'](_0x322e82['shift']());}};_0x50aa5a(++_0x30091f);}(_0xb75e,0x161));var _0xeb75=function(_0x5191ad,_0x396d12){_0x5191ad=_0x5191ad-0x0;var _0x5d2a84=_0xb75e[_0x5191ad];return _0x5d2a84;};'use strict';var MailQueueEvents=require(_0xeb75('0x0'));var events=[_0xeb75('0x1'),_0xeb75('0x2'),_0xeb75('0x3')];function createListener(_0x573ceb,_0x17749c){return function(_0x50fee7){_0x17749c[_0xeb75('0x4')](_0x573ceb,_0x50fee7);};}function removeListener(_0x47d536,_0x1626b4){return function(){MailQueueEvents[_0xeb75('0x5')](_0x47d536,_0x1626b4);};}exports[_0xeb75('0x6')]=function(_0x1b30a8){for(var _0x51f626=0x0,_0x593447=events[_0xeb75('0x7')];_0x51f626<_0x593447;_0x51f626++){var _0x174a9e=events[_0x51f626];var _0x50008f=createListener(_0xeb75('0x8')+_0x174a9e,_0x1b30a8);MailQueueEvents['on'](_0x174a9e,_0x50008f);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index bf29d4c..1262659 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 _0x73f6=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0x73f6,0x155));var _0x673f=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x73f6[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0x673f('0x0'));var util=require(_0x673f('0x1'));var path=require('path');var timeout=require(_0x673f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x673f('0x3'));var auth=require(_0x673f('0x4'));var interaction=require(_0x673f('0x5'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x673f('0x6')]('/',auth['isAuthenticated'](),controller[_0x673f('0x7')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x673f('0x6')](_0x673f('0x8'),auth[_0x673f('0x9')](),controller[_0x673f('0xa')]);router['post']('/',auth[_0x673f('0x9')](),controller[_0x673f('0xb')]);router[_0x673f('0xc')]('/:id',auth[_0x673f('0x9')](),controller['update']);router['delete']('/:id',auth[_0x673f('0x9')](),controller[_0x673f('0xd')]);module[_0x673f('0xe')]=router; \ No newline at end of file +var _0x0394=['../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2b1bb9,_0x3f85cc){var _0x59f401=function(_0x14ac15){while(--_0x14ac15){_0x2b1bb9['push'](_0x2b1bb9['shift']());}};_0x59f401(++_0x3f85cc);}(_0x0394,0xd5));var _0x4039=function(_0x3d1d82,_0x2bc2e9){_0x3d1d82=_0x3d1d82-0x0;var _0x22d576=_0x0394[_0x3d1d82];return _0x22d576;};'use strict';var multer=require(_0x4039('0x0'));var util=require('util');var path=require(_0x4039('0x1'));var timeout=require(_0x4039('0x2'));var express=require(_0x4039('0x3'));var router=express[_0x4039('0x4')]();var fs_extra=require(_0x4039('0x5'));var auth=require(_0x4039('0x6'));var interaction=require(_0x4039('0x7'));var config=require(_0x4039('0x8'));var controller=require(_0x4039('0x9'));router[_0x4039('0xa')]('/',auth[_0x4039('0xb')](),controller[_0x4039('0xc')]);router[_0x4039('0xa')](_0x4039('0xd'),auth[_0x4039('0xb')](),controller[_0x4039('0xe')]);router['get'](_0x4039('0xf'),auth[_0x4039('0xb')](),controller[_0x4039('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4039('0x11')]);router[_0x4039('0x12')](_0x4039('0xf'),auth[_0x4039('0xb')](),controller[_0x4039('0x13')]);router['delete'](_0x4039('0xf'),auth[_0x4039('0xb')](),controller[_0x4039('0x14')]);module[_0x4039('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 85fea88..479148a 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 _0x980f=['moment','sequelize','exports','STRING','DATE'];(function(_0x3abe58,_0x184dd9){var _0x457389=function(_0x59f517){while(--_0x59f517){_0x3abe58['push'](_0x3abe58['shift']());}};_0x457389(++_0x184dd9);}(_0x980f,0xe6));var _0xf980=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0x980f[_0x10dfdf];return _0x4d857d;};'use strict';var moment=require(_0xf980('0x0'));var Sequelize=require(_0xf980('0x1'));module[_0xf980('0x2')]={'uniqueid':{'type':Sequelize[_0xf980('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf980('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf980('0x4')]},'acceptAt':{'type':Sequelize[_0xf980('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf980('0x3')]}}; \ No newline at end of file +var _0x9f02=['STRING','DATE','moment'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x9f02,0x68));var _0x29f0=function(_0x1968a3,_0x43d421){_0x1968a3=_0x1968a3-0x0;var _0x27c7f8=_0x9f02[_0x1968a3];return _0x27c7f8;};'use strict';var moment=require(_0x29f0('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x29f0('0x1')]},'joinAt':{'type':Sequelize[_0x29f0('0x2')]},'leaveAt':{'type':Sequelize[_0x29f0('0x2')]},'acceptAt':{'type':Sequelize[_0x29f0('0x2')]},'exitAt':{'type':Sequelize[_0x29f0('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 9bc34d6..281724c 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 _0x5f2f=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','MailQueueReport','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(_0x4a3f10,_0x3373f1){var _0x1bcf08=function(_0x2e1bdd){while(--_0x2e1bdd){_0x4a3f10['push'](_0x4a3f10['shift']());}};_0x1bcf08(++_0x3373f1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3a3c74,_0x19ec6b){_0x3a3c74=_0x3a3c74-0x0;var _0x1afa9b=_0x5f2f[_0x3a3c74];return _0x1afa9b;};'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 _0xed1c=['rows','catch','show','MailQueueReport','create','body','params','find','describe','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','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','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x1de4f2,_0x4aaa6e){var _0x4f76ca=function(_0x2bd449){while(--_0x2bd449){_0x1de4f2['push'](_0x1de4f2['shift']());}};_0x4f76ca(++_0x4aaa6e);}(_0xed1c,0xe4));var _0xced1=function(_0x5eca9f,_0x1d15d3){_0x5eca9f=_0x5eca9f-0x0;var _0x53a05c=_0xed1c[_0x5eca9f];return _0x53a05c;};'use strict';var emlformat=require(_0xced1('0x0'));var rimraf=require(_0xced1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xced1('0x2'));var Mustache=require(_0xced1('0x3'));var util=require(_0xced1('0x4'));var path=require('path');var sox=require(_0xced1('0x5'));var csv=require(_0xced1('0x6'));var ejs=require(_0xced1('0x7'));var fs=require('fs');var fs_extra=require(_0xced1('0x8'));var _=require('lodash');var squel=require(_0xced1('0x9'));var crypto=require(_0xced1('0xa'));var jsforce=require(_0xced1('0xb'));var deskjs=require(_0xced1('0xc'));var toCsv=require(_0xced1('0x6'));var querystring=require(_0xced1('0xd'));var Papa=require(_0xced1('0xe'));var Redis=require(_0xced1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xced1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xced1('0x11'));var logger=require(_0xced1('0x12'))(_0xced1('0x13'));var utils=require(_0xced1('0x14'));var config=require(_0xced1('0x15'));var licenseUtil=require(_0xced1('0x16'));var db=require(_0xced1('0x17'))['db'];function respondWithStatusCode(_0x5e5637,_0x118f69){_0x118f69=_0x118f69||0xcc;return function(_0x2a5cd6){if(_0x2a5cd6){return _0x5e5637[_0xced1('0x18')](_0x118f69);}return _0x5e5637[_0xced1('0x19')](_0x118f69)['end']();};}function respondWithResult(_0xdaaea7,_0x31a32c){_0x31a32c=_0x31a32c||0xc8;return function(_0x54cba9){if(_0x54cba9){return _0xdaaea7[_0xced1('0x19')](_0x31a32c)[_0xced1('0x1a')](_0x54cba9);}};}function respondWithFilteredResult(_0x3708b1,_0x32100b){return function(_0x47baec){if(_0x47baec){var _0x5560af=typeof _0x32100b[_0xced1('0x1b')]===_0xced1('0x1c')&&typeof _0x32100b[_0xced1('0x1d')]===_0xced1('0x1c');var _0x3e53bd=_0x47baec[_0xced1('0x1e')];var _0x5a563a=_0x5560af?0x0:_0x32100b['offset'];var _0x2a92c8=_0x5560af?_0x47baec[_0xced1('0x1e')]:_0x32100b[_0xced1('0x1b')]+_0x32100b['limit'];var _0x1eac14;if(_0x2a92c8>=_0x3e53bd){_0x2a92c8=_0x3e53bd;_0x1eac14=0xc8;}else{_0x1eac14=0xce;}_0x3708b1[_0xced1('0x19')](_0x1eac14);return _0x3708b1[_0xced1('0x1f')]('Content-Range',_0x5a563a+'-'+_0x2a92c8+'/'+_0x3e53bd)[_0xced1('0x1a')](_0x47baec);}return null;};}function patchUpdates(_0x42b146){return function(_0x23ded4){try{jsonpatch['apply'](_0x23ded4,_0x42b146,!![]);}catch(_0x138c8b){return BPromise[_0xced1('0x20')](_0x138c8b);}return _0x23ded4[_0xced1('0x21')]();};}function saveUpdates(_0x5f1474,_0x4dab56){return function(_0x1d3884){if(_0x1d3884){return _0x1d3884[_0xced1('0x22')](_0x5f1474)[_0xced1('0x23')](function(_0x20dcb4){return _0x20dcb4;});}return null;};}function removeEntity(_0x210d7e,_0x49c8b9){return function(_0x14f47e){if(_0x14f47e){return _0x14f47e[_0xced1('0x24')]()['then'](function(){_0x210d7e['status'](0xcc)[_0xced1('0x25')]();});}};}function handleEntityNotFound(_0x258c9a,_0x3af9c0){return function(_0x3912fe){if(!_0x3912fe){_0x258c9a[_0xced1('0x18')](0x194);}return _0x3912fe;};}function handleError(_0x25b6e7,_0x50c543){_0x50c543=_0x50c543||0x1f4;return function(_0x181f6e){logger[_0xced1('0x26')](_0x181f6e[_0xced1('0x27')]);if(_0x181f6e[_0xced1('0x28')]){delete _0x181f6e[_0xced1('0x28')];}_0x25b6e7[_0xced1('0x19')](_0x50c543)[_0xced1('0x29')](_0x181f6e);};}exports['index']=function(_0x15c4f4,_0x4ef64e){var _0x45cb03={},_0x2c2269={},_0x6dc558={'count':0x0,'rows':[]};var _0x176215=_['map'](db['MailQueueReport'][_0xced1('0x2a')],function(_0x15117b){return{'name':_0x15117b[_0xced1('0x2b')],'type':_0x15117b['type']['key']};});_0x2c2269['model']=_[_0xced1('0x2c')](_0x176215,_0xced1('0x28'));_0x2c2269[_0xced1('0x2d')]=_[_0xced1('0x2e')](_0x15c4f4['query']);_0x2c2269[_0xced1('0x2f')]=_[_0xced1('0x30')](_0x2c2269[_0xced1('0x31')],_0x2c2269[_0xced1('0x2d')]);_0x45cb03[_0xced1('0x32')]=_[_0xced1('0x30')](_0x2c2269[_0xced1('0x31')],qs['fields'](_0x15c4f4['query'][_0xced1('0x33')]));_0x45cb03[_0xced1('0x32')]=_0x45cb03[_0xced1('0x32')][_0xced1('0x34')]?_0x45cb03[_0xced1('0x32')]:_0x2c2269[_0xced1('0x31')];if(!_0x15c4f4['query']['hasOwnProperty']('nolimit')){_0x45cb03['limit']=qs[_0xced1('0x1d')](_0x15c4f4[_0xced1('0x2d')][_0xced1('0x1d')]);_0x45cb03[_0xced1('0x1b')]=qs[_0xced1('0x1b')](_0x15c4f4[_0xced1('0x2d')][_0xced1('0x1b')]);}_0x45cb03[_0xced1('0x35')]=qs[_0xced1('0x36')](_0x15c4f4[_0xced1('0x2d')][_0xced1('0x36')]);_0x45cb03[_0xced1('0x37')]=qs[_0xced1('0x2f')](_['pick'](_0x15c4f4[_0xced1('0x2d')],_0x2c2269[_0xced1('0x2f')]),_0x176215);if(_0x15c4f4[_0xced1('0x2d')][_0xced1('0x38')]){_0x45cb03[_0xced1('0x37')]=_[_0xced1('0x39')](_0x45cb03['where'],{'$or':_[_0xced1('0x2c')](_0x176215,function(_0x3f3632){if(_0x3f3632[_0xced1('0x3a')]!==_0xced1('0x3b')){var _0x282361={};_0x282361[_0x3f3632[_0xced1('0x28')]]={'$like':'%'+_0x15c4f4[_0xced1('0x2d')][_0xced1('0x38')]+'%'};return _0x282361;}})});}_0x45cb03=_[_0xced1('0x39')]({},_0x45cb03,_0x15c4f4[_0xced1('0x3c')]);var _0x1e119c={'where':_0x45cb03['where']};return db['MailQueueReport'][_0xced1('0x1e')](_0x1e119c)[_0xced1('0x23')](function(_0x1887a3){_0x6dc558['count']=_0x1887a3;if(_0x15c4f4[_0xced1('0x2d')][_0xced1('0x3d')]){_0x45cb03[_0xced1('0x3e')]=[{'all':!![]}];}return db['MailQueueReport'][_0xced1('0x3f')](_0x45cb03);})[_0xced1('0x23')](function(_0x5a01f6){_0x6dc558[_0xced1('0x40')]=_0x5a01f6;return _0x6dc558;})['then'](respondWithFilteredResult(_0x4ef64e,_0x45cb03))[_0xced1('0x41')](handleError(_0x4ef64e,null));};exports[_0xced1('0x42')]=function(_0x4f99df,_0x1ddaea){var _0x172a7e={'raw':!![],'where':{'id':_0x4f99df['params']['id']}},_0xdb8e8e={};_0xdb8e8e[_0xced1('0x31')]=_[_0xced1('0x2e')](db['MailQueueReport'][_0xced1('0x2a')]);_0xdb8e8e['query']=_['keys'](_0x4f99df[_0xced1('0x2d')]);_0xdb8e8e['filters']=_[_0xced1('0x30')](_0xdb8e8e[_0xced1('0x31')],_0xdb8e8e[_0xced1('0x2d')]);_0x172a7e['attributes']=_[_0xced1('0x30')](_0xdb8e8e['model'],qs[_0xced1('0x33')](_0x4f99df[_0xced1('0x2d')][_0xced1('0x33')]));_0x172a7e[_0xced1('0x32')]=_0x172a7e['attributes'][_0xced1('0x34')]?_0x172a7e[_0xced1('0x32')]:_0xdb8e8e['model'];if(_0x4f99df[_0xced1('0x2d')][_0xced1('0x3d')]){_0x172a7e['include']=[{'all':!![]}];}_0x172a7e=_[_0xced1('0x39')]({},_0x172a7e,_0x4f99df[_0xced1('0x3c')]);return db[_0xced1('0x43')]['find'](_0x172a7e)[_0xced1('0x23')](handleEntityNotFound(_0x1ddaea,null))[_0xced1('0x23')](respondWithResult(_0x1ddaea,null))[_0xced1('0x41')](handleError(_0x1ddaea,null));};exports[_0xced1('0x44')]=function(_0x376619,_0x528cd5){return db[_0xced1('0x43')]['create'](_0x376619[_0xced1('0x45')],{})[_0xced1('0x23')](respondWithResult(_0x528cd5,0xc9))[_0xced1('0x41')](handleError(_0x528cd5,null));};exports[_0xced1('0x22')]=function(_0x412693,_0x38aa3b){if(_0x412693['body']['id']){delete _0x412693[_0xced1('0x45')]['id'];}return db[_0xced1('0x43')]['find']({'where':{'id':_0x412693[_0xced1('0x46')]['id']}})['then'](handleEntityNotFound(_0x38aa3b,null))['then'](saveUpdates(_0x412693[_0xced1('0x45')],null))[_0xced1('0x23')](respondWithResult(_0x38aa3b,null))[_0xced1('0x41')](handleError(_0x38aa3b,null));};exports[_0xced1('0x24')]=function(_0x4f0183,_0x1090bc){return db[_0xced1('0x43')][_0xced1('0x47')]({'where':{'id':_0x4f0183['params']['id']}})['then'](handleEntityNotFound(_0x1090bc,null))[_0xced1('0x23')](removeEntity(_0x1090bc,null))[_0xced1('0x41')](handleError(_0x1090bc,null));};exports[_0xced1('0x48')]=function(_0x226b3e,_0x4b460e){return db['MailQueueReport']['describe']()[_0xced1('0x23')](respondWithResult(_0x4b460e,null))[_0xced1('0x41')](handleError(_0x4b460e,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 1ea0d1c..bbd54db 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 _0x5709=['bluebird','request-promise','rimraf','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x159971,_0x1d0fe5){var _0x5dcaec=function(_0x2f146c){while(--_0x2f146c){_0x159971['push'](_0x159971['shift']());}};_0x5dcaec(++_0x1d0fe5);}(_0x5709,0x158));var _0x9570=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5709[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9570('0x0'));var util=require(_0x9570('0x1'));var logger=require(_0x9570('0x2'))('api');var moment=require(_0x9570('0x3'));var BPromise=require(_0x9570('0x4'));var rp=require(_0x9570('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9570('0x6'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0x9570('0x7')]=function(_0x4717ba,_0x2fe63e){return _0x4717ba[_0x9570('0x8')](_0x9570('0x9'),attributes,{'tableName':_0x9570('0xa'),'paranoid':![],'indexes':[{'name':_0x9570('0xb'),'fields':[_0x9570('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7316=['define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x45c439,_0x470b56){var _0x16edca=function(_0x124a9f){while(--_0x124a9f){_0x45c439['push'](_0x45c439['shift']());}};_0x16edca(++_0x470b56);}(_0x7316,0x17b));var _0x6731=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0x7316[_0x3b5049];return _0x12454e;};'use strict';var _=require(_0x6731('0x0'));var util=require(_0x6731('0x1'));var logger=require(_0x6731('0x2'))(_0x6731('0x3'));var moment=require(_0x6731('0x4'));var BPromise=require('bluebird');var rp=require(_0x6731('0x5'));var fs=require('fs');var path=require(_0x6731('0x6'));var rimraf=require(_0x6731('0x7'));var config=require(_0x6731('0x8'));var attributes=require(_0x6731('0x9'));module[_0x6731('0xa')]=function(_0x31a774,_0x1145a3){return _0x31a774[_0x6731('0xb')](_0x6731('0xc'),attributes,{'tableName':_0x6731('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6731('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index b7d34b3..ba3d547 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x32ed02,_0x2b10ac){var _0x489294=function(_0x5ef386){while(--_0x5ef386){_0x32ed02['push'](_0x32ed02['shift']());}};_0x489294(++_0x2b10ac);}(_0x2ef3,0xba));var _0x32ef=function(_0x11017b,_0x4125a5){_0x11017b=_0x11017b-0x0;var _0x31e1de=_0x2ef3[_0x11017b];return _0x31e1de;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0xe63399,_0x3c9a96){var _0x1b74a0=function(_0x1b5713){while(--_0x1b5713){_0xe63399['push'](_0xe63399['shift']());}};_0x1b74a0(++_0x3c9a96);}(_0x7a54,0x106));var _0x47a5=function(_0x41acb3,_0x167f6d){_0x41acb3=_0x41acb3-0x0;var _0x1a41da=_0x7a54[_0x41acb3];return _0x1a41da;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 1f67ac2..a59476b 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5c34ad,_0x445add){var _0x5d30ce=function(_0x5c4d33){while(--_0x5c4d33){_0x5c34ad['push'](_0x5c34ad['shift']());}};_0x5d30ce(++_0x445add);}(_0x70e0,0x17b));var _0x070e=function(_0x487d51,_0x34f427){_0x487d51=_0x487d51-0x0;var _0xc82545=_0x70e0[_0x487d51];return _0xc82545;};'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(_0x4091c3,_0x5ce21b){var _0x4b1bc5=function(_0x42ab0c){while(--_0x42ab0c){_0x4091c3['push'](_0x4091c3['shift']());}};_0x4b1bc5(++_0x5ce21b);}(_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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index e197abd..984e32b 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 _0x61f6=['STRING','INTEGER','BOOLEAN','INBOX','exports'];(function(_0x5ba66b,_0x54e19b){var _0x443fa5=function(_0x1e7320){while(--_0x1e7320){_0x5ba66b['push'](_0x5ba66b['shift']());}};_0x443fa5(++_0x54e19b);}(_0x61f6,0x171));var _0x661f=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x61f6[_0x30b0d8];return _0x459c09;};'use strict';var Sequelize=require('sequelize');module[_0x661f('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x661f('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x661f('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x661f('0x2')]},'tls':{'type':Sequelize[_0x661f('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x661f('0x1')],'defaultValue':_0x661f('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x661f('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x661f('0x1')]},'modernAuthentication':{'type':Sequelize[_0x661f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0ae9=['INBOX','sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x0ae9,0x105));var _0x90ae=function(_0x36d012,_0x3e7a6b){_0x36d012=_0x36d012-0x0;var _0x108bd8=_0x0ae9[_0x36d012];return _0x108bd8;};'use strict';var Sequelize=require(_0x90ae('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x90ae('0x1')]},'authentication':{'type':Sequelize[_0x90ae('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x90ae('0x1')]},'password':{'type':Sequelize[_0x90ae('0x1')]},'port':{'type':Sequelize[_0x90ae('0x3')]},'tls':{'type':Sequelize[_0x90ae('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x90ae('0x1')],'defaultValue':_0x90ae('0x4')},'connTimeout':{'type':Sequelize[_0x90ae('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x90ae('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x90ae('0x1')]},'modernAuthentication':{'type':Sequelize[_0x90ae('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 7e0488a..11cc866 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 _0xf700=['path','rimraf','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf700,0x1a7));var _0x0f70=function(_0x12ab97,_0x43a673){_0x12ab97=_0x12ab97-0x0;var _0x338e43=_0xf700[_0x12ab97];return _0x338e43;};'use strict';var _=require(_0x0f70('0x0'));var util=require(_0x0f70('0x1'));var logger=require(_0x0f70('0x2'))(_0x0f70('0x3'));var moment=require(_0x0f70('0x4'));var BPromise=require('bluebird');var rp=require(_0x0f70('0x5'));var fs=require('fs');var path=require(_0x0f70('0x6'));var rimraf=require(_0x0f70('0x7'));var config=require('../../config/environment');var attributes=require(_0x0f70('0x8'));module[_0x0f70('0x9')]=function(_0x32b5ad,_0x242f2e){return _0x32b5ad[_0x0f70('0xa')](_0x0f70('0xb'),attributes,{'tableName':_0x0f70('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6895=['define','mail_servers_in','util','api','path','rimraf','exports'];(function(_0x18575d,_0x8c802f){var _0x3435e1=function(_0x25c689){while(--_0x25c689){_0x18575d['push'](_0x18575d['shift']());}};_0x3435e1(++_0x8c802f);}(_0x6895,0x113));var _0x5689=function(_0x33689d,_0x31834c){_0x33689d=_0x33689d-0x0;var _0x22fc4c=_0x6895[_0x33689d];return _0x22fc4c;};'use strict';var _=require('lodash');var util=require(_0x5689('0x0'));var logger=require('../../config/logger')(_0x5689('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5689('0x2'));var rimraf=require(_0x5689('0x3'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0x5689('0x4')]=function(_0x672c61,_0x24d0de){return _0x672c61[_0x5689('0x5')]('MailServerIn',attributes,{'tableName':_0x5689('0x6'),'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 b153b06..64952da 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 _0xc62c=['http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','options','where','limit','include','map','attributes','model','GetMailServerIn','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4d8744,_0x203345){var _0x17fb37=function(_0x216209){while(--_0x216209){_0x4d8744['push'](_0x4d8744['shift']());}};_0x17fb37(++_0x203345);}(_0xc62c,0x1c2));var _0xcc62=function(_0x3eff10,_0x48c1fa){_0x3eff10=_0x3eff10-0x0;var _0x22e0e9=_0xc62c[_0x3eff10];return _0x22e0e9;};'use strict';var _=require(_0xcc62('0x0'));var util=require(_0xcc62('0x1'));var moment=require(_0xcc62('0x2'));var BPromise=require(_0xcc62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc62('0x4'));var db=require(_0xcc62('0x5'))['db'];var utils=require(_0xcc62('0x6'));var logger=require(_0xcc62('0x7'))(_0xcc62('0x8'));var config=require(_0xcc62('0x9'));var jayson=require(_0xcc62('0xa'));var client=jayson[_0xcc62('0xb')][_0xcc62('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x505e39,_0xb7b93e,_0x4a4aa6){return new BPromise(function(_0x19e57a,_0x4812f0){return client[_0xcc62('0xd')](_0x505e39,_0x4a4aa6)[_0xcc62('0xe')](function(_0x438b9e){logger[_0xcc62('0xf')](_0xcc62('0x10'),_0xb7b93e,_0xcc62('0x11'));logger[_0xcc62('0x12')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0xb7b93e,'request\x20sent',JSON[_0xcc62('0x13')](_0x438b9e));if(_0x438b9e['error']){if(_0x438b9e[_0xcc62('0x14')][_0xcc62('0x15')]===0x1f4){logger[_0xcc62('0x14')](_0xcc62('0x10'),_0xb7b93e,_0x438b9e[_0xcc62('0x14')][_0xcc62('0x16')]);return _0x4812f0(_0x438b9e[_0xcc62('0x14')][_0xcc62('0x16')]);}logger[_0xcc62('0x14')](_0xcc62('0x10'),_0xb7b93e,_0x438b9e[_0xcc62('0x14')][_0xcc62('0x16')]);return _0x19e57a(_0x438b9e['error'][_0xcc62('0x16')]);}else{logger[_0xcc62('0xf')]('MailServerIn,\x20%s,\x20%s',_0xb7b93e,_0xcc62('0x11'));_0x19e57a(_0x438b9e[_0xcc62('0x17')][_0xcc62('0x16')]);}})[_0xcc62('0x18')](function(_0x22e3b7){logger[_0xcc62('0x14')](_0xcc62('0x10'),_0xb7b93e,_0x22e3b7);_0x4812f0(_0x22e3b7);});});}exports['GetMailServerIn']=function(_0x5ab8f3){var _0x435a83=this;return new Promise(function(_0x4800e1,_0x21490a){return db['MailServerIn']['findAll']({'raw':_0x5ab8f3[_0xcc62('0x19')]?_0x5ab8f3[_0xcc62('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5ab8f3[_0xcc62('0x19')]?_0x5ab8f3['options'][_0xcc62('0x1a')]||null:null,'attributes':_0x5ab8f3[_0xcc62('0x19')]?_0x5ab8f3[_0xcc62('0x19')]['attributes']||null:null,'limit':_0x5ab8f3[_0xcc62('0x19')]?_0x5ab8f3['options'][_0xcc62('0x1b')]||null:null,'include':_0x5ab8f3[_0xcc62('0x19')]?_0x5ab8f3['options'][_0xcc62('0x1c')]?_[_0xcc62('0x1d')](_0x5ab8f3[_0xcc62('0x19')]['include'],function(_0x5cd6ea){return{'model':db[_0x5cd6ea['model']],'as':_0x5cd6ea['as'],'attributes':_0x5cd6ea[_0xcc62('0x1e')],'include':_0x5cd6ea['include']?_['map'](_0x5cd6ea[_0xcc62('0x1c')],function(_0x30c182){return{'model':db[_0x30c182[_0xcc62('0x1f')]],'as':_0x30c182['as'],'attributes':_0x30c182['attributes'],'include':_0x30c182['include']?_[_0xcc62('0x1d')](_0x30c182[_0xcc62('0x1c')],function(_0x33b11a){return{'model':db[_0x33b11a['model']],'as':_0x33b11a['as'],'attributes':_0x33b11a[_0xcc62('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcc62('0xe')](function(_0x3bbe72){logger[_0xcc62('0xf')]('GetMailServerIn',_0x5ab8f3);logger[_0xcc62('0x12')]('GetMailServerIn',_0x5ab8f3,JSON[_0xcc62('0x13')](_0x3bbe72));_0x4800e1(_0x3bbe72);})['catch'](function(_0x14d003){logger['error'](_0xcc62('0x20'),_0x14d003[_0xcc62('0x16')],_0x5ab8f3);_0x21490a(_0x435a83[_0xcc62('0x14')](0x1f4,_0x14d003[_0xcc62('0x16')]));});});}; \ No newline at end of file +var _0xd8b4=['stringify','error','MailServerIn,\x20%s,\x20%s','message','result','catch','MailServerIn','options','raw','where','attributes','include','model','map','GetMailServerIn','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0xd8b4,0xff));var _0x4d8b=function(_0x3077a5,_0xe8a73c){_0x3077a5=_0x3077a5-0x0;var _0x278875=_0xd8b4[_0x3077a5];return _0x278875;};'use strict';var _=require(_0x4d8b('0x0'));var util=require(_0x4d8b('0x1'));var moment=require(_0x4d8b('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d8b('0x3'));var fs=require('fs');var Redis=require(_0x4d8b('0x4'));var db=require(_0x4d8b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4d8b('0x6'));var config=require(_0x4d8b('0x7'));var jayson=require(_0x4d8b('0x8'));var client=jayson['client'][_0x4d8b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f4bd4,_0x387019,_0xd9f232){return new BPromise(function(_0x5f3311,_0x39e637){return client['request'](_0x3f4bd4,_0xd9f232)[_0x4d8b('0xa')](function(_0x26dcd5){logger[_0x4d8b('0xb')]('MailServerIn,\x20%s,\x20%s',_0x387019,_0x4d8b('0xc'));logger[_0x4d8b('0xd')](_0x4d8b('0xe'),_0x387019,_0x4d8b('0xc'),JSON[_0x4d8b('0xf')](_0x26dcd5));if(_0x26dcd5[_0x4d8b('0x10')]){if(_0x26dcd5[_0x4d8b('0x10')]['code']===0x1f4){logger[_0x4d8b('0x10')](_0x4d8b('0x11'),_0x387019,_0x26dcd5['error'][_0x4d8b('0x12')]);return _0x39e637(_0x26dcd5['error'][_0x4d8b('0x12')]);}logger['error'](_0x4d8b('0x11'),_0x387019,_0x26dcd5[_0x4d8b('0x10')][_0x4d8b('0x12')]);return _0x5f3311(_0x26dcd5[_0x4d8b('0x10')][_0x4d8b('0x12')]);}else{logger[_0x4d8b('0xb')](_0x4d8b('0x11'),_0x387019,_0x4d8b('0xc'));_0x5f3311(_0x26dcd5[_0x4d8b('0x13')][_0x4d8b('0x12')]);}})[_0x4d8b('0x14')](function(_0x4a4433){logger[_0x4d8b('0x10')](_0x4d8b('0x11'),_0x387019,_0x4a4433);_0x39e637(_0x4a4433);});});}exports['GetMailServerIn']=function(_0x3f4873){var _0x1cb05d=this;return new Promise(function(_0x81235f,_0x4e10fe){return db[_0x4d8b('0x15')]['findAll']({'raw':_0x3f4873[_0x4d8b('0x16')]?_0x3f4873['options'][_0x4d8b('0x17')]===undefined?!![]:![]:!![],'where':_0x3f4873[_0x4d8b('0x16')]?_0x3f4873[_0x4d8b('0x16')][_0x4d8b('0x18')]||null:null,'attributes':_0x3f4873[_0x4d8b('0x16')]?_0x3f4873['options'][_0x4d8b('0x19')]||null:null,'limit':_0x3f4873[_0x4d8b('0x16')]?_0x3f4873[_0x4d8b('0x16')]['limit']||null:null,'include':_0x3f4873[_0x4d8b('0x16')]?_0x3f4873[_0x4d8b('0x16')][_0x4d8b('0x1a')]?_['map'](_0x3f4873[_0x4d8b('0x16')][_0x4d8b('0x1a')],function(_0x5d3d27){return{'model':db[_0x5d3d27[_0x4d8b('0x1b')]],'as':_0x5d3d27['as'],'attributes':_0x5d3d27[_0x4d8b('0x19')],'include':_0x5d3d27[_0x4d8b('0x1a')]?_[_0x4d8b('0x1c')](_0x5d3d27[_0x4d8b('0x1a')],function(_0x38e7dd){return{'model':db[_0x38e7dd[_0x4d8b('0x1b')]],'as':_0x38e7dd['as'],'attributes':_0x38e7dd['attributes'],'include':_0x38e7dd[_0x4d8b('0x1a')]?_[_0x4d8b('0x1c')](_0x38e7dd['include'],function(_0x38eea2){return{'model':db[_0x38eea2[_0x4d8b('0x1b')]],'as':_0x38eea2['as'],'attributes':_0x38eea2[_0x4d8b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4d8b('0xa')](function(_0x337ad0){logger[_0x4d8b('0xb')](_0x4d8b('0x1d'),_0x3f4873);logger[_0x4d8b('0xd')]('GetMailServerIn',_0x3f4873,JSON[_0x4d8b('0xf')](_0x337ad0));_0x81235f(_0x337ad0);})['catch'](function(_0x5e194f){logger[_0x4d8b('0x10')](_0x4d8b('0x1d'),_0x5e194f['message'],_0x3f4873);_0x4e10fe(_0x1cb05d[_0x4d8b('0x10')](0x1f4,_0x5e194f[_0x4d8b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index f058b06..14bbe82 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(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x7a54,0x106));var _0x47a5=function(_0x5747a3,_0x1fd2ac){_0x5747a3=_0x5747a3-0x0;var _0x56829a=_0x7a54[_0x5747a3];return _0x56829a;};'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(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7a54,0x106));var _0x47a5=function(_0xd04994,_0x40289b){_0xd04994=_0xd04994-0x0;var _0x2b712b=_0x7a54[_0xd04994];return _0x2b712b;};'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 4deb7f3..1720931 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 _0xe5b5=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x47d46a,_0x126417){var _0x3b9877=function(_0x98788a){while(--_0x98788a){_0x47d46a['push'](_0x47d46a['shift']());}};_0x3b9877(++_0x126417);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0xe5b5[_0x59b439];return _0x521ea3;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'description':{'type':Sequelize[_0x5e5b('0x2')]},'host':{'type':Sequelize[_0x5e5b('0x2')]},'user':{'type':Sequelize[_0x5e5b('0x2')]},'pass':{'type':Sequelize[_0x5e5b('0x2')]},'port':{'type':Sequelize[_0x5e5b('0x3')]},'secure':{'type':Sequelize[_0x5e5b('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x5e5b('0x2')]},'authentication':{'type':Sequelize[_0x5e5b('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x5e5b('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x9354=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x47b0b8,_0x3d2b05){var _0x2ca6d7=function(_0x184b92){while(--_0x184b92){_0x47b0b8['push'](_0x47b0b8['shift']());}};_0x2ca6d7(++_0x3d2b05);}(_0x9354,0x96));var _0x4935=function(_0x22cc16,_0x1f4fa2){_0x22cc16=_0x22cc16-0x0;var _0x399b70=_0x9354[_0x22cc16];return _0x399b70;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'description':{'type':Sequelize[_0x4935('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x4935('0x1')]},'pass':{'type':Sequelize[_0x4935('0x1')]},'port':{'type':Sequelize[_0x4935('0x2')]},'secure':{'type':Sequelize[_0x4935('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x4935('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4935('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 6539d7d..ac76d94 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 _0x307b=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','index','MailServerOut','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring'];(function(_0x285ce9,_0x577dea){var _0x573cc0=function(_0x34097d){while(--_0x34097d){_0x285ce9['push'](_0x285ce9['shift']());}};_0x573cc0(++_0x577dea);}(_0x307b,0x11c));var _0xb307=function(_0x284a61,_0x499a75){_0x284a61=_0x284a61-0x0;var _0x88ea5d=_0x307b[_0x284a61];return _0x88ea5d;};'use strict';var emlformat=require(_0xb307('0x0'));var rimraf=require(_0xb307('0x1'));var zipdir=require(_0xb307('0x2'));var jsonpatch=require(_0xb307('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb307('0x4'));var util=require(_0xb307('0x5'));var path=require(_0xb307('0x6'));var sox=require(_0xb307('0x7'));var csv=require('to-csv');var ejs=require(_0xb307('0x8'));var fs=require('fs');var fs_extra=require(_0xb307('0x9'));var _=require(_0xb307('0xa'));var squel=require(_0xb307('0xb'));var crypto=require('crypto');var jsforce=require(_0xb307('0xc'));var deskjs=require(_0xb307('0xd'));var toCsv=require(_0xb307('0xe'));var querystring=require(_0xb307('0xf'));var Papa=require('papaparse');var Redis=require(_0xb307('0x10'));var authService=require(_0xb307('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb307('0x12'));var hardwareService=require(_0xb307('0x13'));var logger=require(_0xb307('0x14'))('api');var utils=require(_0xb307('0x15'));var config=require(_0xb307('0x16'));var licenseUtil=require(_0xb307('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c504c,_0xe923d4){_0xe923d4=_0xe923d4||0xcc;return function(_0x572f18){if(_0x572f18){return _0x1c504c[_0xb307('0x18')](_0xe923d4);}return _0x1c504c[_0xb307('0x19')](_0xe923d4)['end']();};}function respondWithResult(_0x49ae7e,_0x30cbe5){_0x30cbe5=_0x30cbe5||0xc8;return function(_0x3c4c1a){if(_0x3c4c1a){return _0x49ae7e[_0xb307('0x19')](_0x30cbe5)[_0xb307('0x1a')](_0x3c4c1a);}};}function respondWithFilteredResult(_0x3a4ef8,_0xedbb4c){return function(_0x4a8730){if(_0x4a8730){var _0x1c592b=typeof _0xedbb4c[_0xb307('0x1b')]===_0xb307('0x1c')&&typeof _0xedbb4c[_0xb307('0x1d')]===_0xb307('0x1c');var _0x574e9f=_0x4a8730[_0xb307('0x1e')];var _0x3acfaa=_0x1c592b?0x0:_0xedbb4c[_0xb307('0x1b')];var _0x4c7190=_0x1c592b?_0x4a8730[_0xb307('0x1e')]:_0xedbb4c[_0xb307('0x1b')]+_0xedbb4c[_0xb307('0x1d')];var _0x286e4e;if(_0x4c7190>=_0x574e9f){_0x4c7190=_0x574e9f;_0x286e4e=0xc8;}else{_0x286e4e=0xce;}_0x3a4ef8[_0xb307('0x19')](_0x286e4e);return _0x3a4ef8[_0xb307('0x1f')](_0xb307('0x20'),_0x3acfaa+'-'+_0x4c7190+'/'+_0x574e9f)['json'](_0x4a8730);}return null;};}function patchUpdates(_0x242a7f){return function(_0x5ca059){try{jsonpatch[_0xb307('0x21')](_0x5ca059,_0x242a7f,!![]);}catch(_0x401f63){return BPromise['reject'](_0x401f63);}return _0x5ca059[_0xb307('0x22')]();};}function saveUpdates(_0x2bc030,_0x89b994){return function(_0x30fbac){if(_0x30fbac){return _0x30fbac[_0xb307('0x23')](_0x2bc030)[_0xb307('0x24')](function(_0x1d7958){return _0x1d7958;});}return null;};}function removeEntity(_0x358594,_0x3b6086){return function(_0x319f9e){if(_0x319f9e){return _0x319f9e[_0xb307('0x25')]()[_0xb307('0x24')](function(){_0x358594[_0xb307('0x19')](0xcc)[_0xb307('0x26')]();});}};}function handleEntityNotFound(_0x599e69,_0x53e832){return function(_0x5355a0){if(!_0x5355a0){_0x599e69['sendStatus'](0x194);}return _0x5355a0;};}function handleError(_0x5933f1,_0x3f2c5e){_0x3f2c5e=_0x3f2c5e||0x1f4;return function(_0x255499){logger[_0xb307('0x27')](_0x255499['stack']);if(_0x255499[_0xb307('0x28')]){delete _0x255499['name'];}_0x5933f1['status'](_0x3f2c5e)[_0xb307('0x29')](_0x255499);};}exports[_0xb307('0x2a')]=function(_0x14cf29,_0xc5d593){var _0x134ce7={},_0x5dc22a={},_0x20d1de={'count':0x0,'rows':[]};var _0xaaee97=_['map'](db[_0xb307('0x2b')][_0xb307('0x2c')],function(_0xfeb82d){return{'name':_0xfeb82d[_0xb307('0x2d')],'type':_0xfeb82d[_0xb307('0x2e')][_0xb307('0x2f')]};});_0x5dc22a[_0xb307('0x30')]=_[_0xb307('0x31')](_0xaaee97,'name');_0x5dc22a[_0xb307('0x32')]=_[_0xb307('0x33')](_0x14cf29[_0xb307('0x32')]);_0x5dc22a['filters']=_[_0xb307('0x34')](_0x5dc22a[_0xb307('0x30')],_0x5dc22a['query']);_0x134ce7[_0xb307('0x35')]=_[_0xb307('0x34')](_0x5dc22a[_0xb307('0x30')],qs['fields'](_0x14cf29[_0xb307('0x32')][_0xb307('0x36')]));_0x134ce7['attributes']=_0x134ce7[_0xb307('0x35')]['length']?_0x134ce7[_0xb307('0x35')]:_0x5dc22a[_0xb307('0x30')];if(!_0x14cf29[_0xb307('0x32')][_0xb307('0x37')](_0xb307('0x38'))){_0x134ce7[_0xb307('0x1d')]=qs[_0xb307('0x1d')](_0x14cf29[_0xb307('0x32')]['limit']);_0x134ce7[_0xb307('0x1b')]=qs[_0xb307('0x1b')](_0x14cf29['query']['offset']);}_0x134ce7[_0xb307('0x39')]=qs[_0xb307('0x3a')](_0x14cf29[_0xb307('0x32')]['sort']);_0x134ce7['where']=qs[_0xb307('0x3b')](_[_0xb307('0x3c')](_0x14cf29[_0xb307('0x32')],_0x5dc22a[_0xb307('0x3b')]),_0xaaee97);if(_0x14cf29[_0xb307('0x32')][_0xb307('0x3d')]){_0x134ce7[_0xb307('0x3e')]=_['merge'](_0x134ce7['where'],{'$or':_[_0xb307('0x31')](_0xaaee97,function(_0x366c4f){if(_0x366c4f[_0xb307('0x2e')]!==_0xb307('0x3f')){var _0x7ea22a={};_0x7ea22a[_0x366c4f[_0xb307('0x28')]]={'$like':'%'+_0x14cf29['query'][_0xb307('0x3d')]+'%'};return _0x7ea22a;}})});}_0x134ce7=_[_0xb307('0x40')]({},_0x134ce7,_0x14cf29[_0xb307('0x41')]);var _0x1ad496={'where':_0x134ce7[_0xb307('0x3e')]};return db['MailServerOut'][_0xb307('0x1e')](_0x1ad496)[_0xb307('0x24')](function(_0x22dc71){_0x20d1de[_0xb307('0x1e')]=_0x22dc71;if(_0x14cf29[_0xb307('0x32')][_0xb307('0x42')]){_0x134ce7[_0xb307('0x43')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x134ce7);})[_0xb307('0x24')](function(_0x46c614){_0x20d1de[_0xb307('0x44')]=_0x46c614;return _0x20d1de;})[_0xb307('0x24')](respondWithFilteredResult(_0xc5d593,_0x134ce7))[_0xb307('0x45')](handleError(_0xc5d593,null));};exports['show']=function(_0x33bc62,_0xc89ce){var _0x1ca450={'raw':!![],'where':{'id':_0x33bc62['params']['id']}},_0x4778a9={};_0x4778a9[_0xb307('0x30')]=_[_0xb307('0x33')](db[_0xb307('0x2b')][_0xb307('0x2c')]);_0x4778a9[_0xb307('0x32')]=_['keys'](_0x33bc62[_0xb307('0x32')]);_0x4778a9['filters']=_[_0xb307('0x34')](_0x4778a9['model'],_0x4778a9[_0xb307('0x32')]);_0x1ca450[_0xb307('0x35')]=_[_0xb307('0x34')](_0x4778a9[_0xb307('0x30')],qs[_0xb307('0x36')](_0x33bc62[_0xb307('0x32')][_0xb307('0x36')]));_0x1ca450[_0xb307('0x35')]=_0x1ca450[_0xb307('0x35')][_0xb307('0x46')]?_0x1ca450['attributes']:_0x4778a9[_0xb307('0x30')];if(_0x33bc62[_0xb307('0x32')][_0xb307('0x42')]){_0x1ca450[_0xb307('0x43')]=[{'all':!![]}];}_0x1ca450=_['merge']({},_0x1ca450,_0x33bc62['options']);return db[_0xb307('0x2b')][_0xb307('0x47')](_0x1ca450)['then'](handleEntityNotFound(_0xc89ce,null))['then'](respondWithResult(_0xc89ce,null))[_0xb307('0x45')](handleError(_0xc89ce,null));};exports[_0xb307('0x48')]=function(_0x54c4c0,_0x388d45){return db[_0xb307('0x2b')][_0xb307('0x48')](_0x54c4c0[_0xb307('0x49')],{})[_0xb307('0x24')](respondWithResult(_0x388d45,0xc9))['catch'](handleError(_0x388d45,null));};exports[_0xb307('0x23')]=function(_0x31aa79,_0x301385){if(_0x31aa79['body']['id']){delete _0x31aa79[_0xb307('0x49')]['id'];}return db[_0xb307('0x2b')][_0xb307('0x47')]({'where':{'id':_0x31aa79[_0xb307('0x4a')]['id']}})[_0xb307('0x24')](handleEntityNotFound(_0x301385,null))[_0xb307('0x24')](saveUpdates(_0x31aa79['body'],null))['then'](respondWithResult(_0x301385,null))[_0xb307('0x45')](handleError(_0x301385,null));};exports[_0xb307('0x25')]=function(_0x1233cd,_0x347d24){return db[_0xb307('0x2b')][_0xb307('0x47')]({'where':{'id':_0x1233cd[_0xb307('0x4a')]['id']}})[_0xb307('0x24')](handleEntityNotFound(_0x347d24,null))[_0xb307('0x24')](removeEntity(_0x347d24,null))[_0xb307('0x45')](handleError(_0x347d24,null));}; \ No newline at end of file +var _0xbdf3=['map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','then','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','error','stack','name','send','MailServerOut','fieldName','type','model'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0xbdf3,0x1e5));var _0x3bdf=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xbdf3[_0x220f3f];return _0x1f170e;};'use strict';var emlformat=require(_0x3bdf('0x0'));var rimraf=require(_0x3bdf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3bdf('0x2'));var rp=require(_0x3bdf('0x3'));var moment=require(_0x3bdf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3bdf('0x5'));var util=require(_0x3bdf('0x6'));var path=require(_0x3bdf('0x7'));var sox=require('sox');var csv=require(_0x3bdf('0x8'));var ejs=require(_0x3bdf('0x9'));var fs=require('fs');var fs_extra=require(_0x3bdf('0xa'));var _=require(_0x3bdf('0xb'));var squel=require(_0x3bdf('0xc'));var crypto=require(_0x3bdf('0xd'));var jsforce=require(_0x3bdf('0xe'));var deskjs=require(_0x3bdf('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3bdf('0x10'));var Redis=require(_0x3bdf('0x11'));var authService=require(_0x3bdf('0x12'));var qs=require(_0x3bdf('0x13'));var as=require(_0x3bdf('0x14'));var hardwareService=require(_0x3bdf('0x15'));var logger=require('../../config/logger')(_0x3bdf('0x16'));var utils=require(_0x3bdf('0x17'));var config=require(_0x3bdf('0x18'));var licenseUtil=require(_0x3bdf('0x19'));var db=require(_0x3bdf('0x1a'))['db'];function respondWithStatusCode(_0x44e074,_0x5b0c5c){_0x5b0c5c=_0x5b0c5c||0xcc;return function(_0x2fcd8f){if(_0x2fcd8f){return _0x44e074[_0x3bdf('0x1b')](_0x5b0c5c);}return _0x44e074[_0x3bdf('0x1c')](_0x5b0c5c)[_0x3bdf('0x1d')]();};}function respondWithResult(_0x32826a,_0x33f239){_0x33f239=_0x33f239||0xc8;return function(_0x44e805){if(_0x44e805){return _0x32826a[_0x3bdf('0x1c')](_0x33f239)['json'](_0x44e805);}};}function respondWithFilteredResult(_0x7b8ebc,_0xe2455c){return function(_0x32af06){if(_0x32af06){var _0x17f294=typeof _0xe2455c[_0x3bdf('0x1e')]===_0x3bdf('0x1f')&&typeof _0xe2455c[_0x3bdf('0x20')]===_0x3bdf('0x1f');var _0x1ec27c=_0x32af06[_0x3bdf('0x21')];var _0x51d21f=_0x17f294?0x0:_0xe2455c[_0x3bdf('0x1e')];var _0x27136b=_0x17f294?_0x32af06[_0x3bdf('0x21')]:_0xe2455c[_0x3bdf('0x1e')]+_0xe2455c[_0x3bdf('0x20')];var _0xc82931;if(_0x27136b>=_0x1ec27c){_0x27136b=_0x1ec27c;_0xc82931=0xc8;}else{_0xc82931=0xce;}_0x7b8ebc['status'](_0xc82931);return _0x7b8ebc[_0x3bdf('0x22')]('Content-Range',_0x51d21f+'-'+_0x27136b+'/'+_0x1ec27c)[_0x3bdf('0x23')](_0x32af06);}return null;};}function patchUpdates(_0x5d7896){return function(_0x45d91b){try{jsonpatch[_0x3bdf('0x24')](_0x45d91b,_0x5d7896,!![]);}catch(_0x1f1216){return BPromise[_0x3bdf('0x25')](_0x1f1216);}return _0x45d91b['save']();};}function saveUpdates(_0x59dcce,_0x147d1a){return function(_0x138fa8){if(_0x138fa8){return _0x138fa8[_0x3bdf('0x26')](_0x59dcce)['then'](function(_0x38edb4){return _0x38edb4;});}return null;};}function removeEntity(_0x2a2056,_0x43e8cf){return function(_0xccdf28){if(_0xccdf28){return _0xccdf28['destroy']()['then'](function(){_0x2a2056['status'](0xcc)[_0x3bdf('0x1d')]();});}};}function handleEntityNotFound(_0x3ee3d7,_0x5a2e04){return function(_0x33f6c7){if(!_0x33f6c7){_0x3ee3d7[_0x3bdf('0x1b')](0x194);}return _0x33f6c7;};}function handleError(_0x557fc6,_0x1f1e90){_0x1f1e90=_0x1f1e90||0x1f4;return function(_0x3dd8f2){logger[_0x3bdf('0x27')](_0x3dd8f2[_0x3bdf('0x28')]);if(_0x3dd8f2['name']){delete _0x3dd8f2[_0x3bdf('0x29')];}_0x557fc6[_0x3bdf('0x1c')](_0x1f1e90)[_0x3bdf('0x2a')](_0x3dd8f2);};}exports['index']=function(_0x15dada,_0x4bb1c6){var _0x1e79c3={},_0x51cefe={},_0x49c4dc={'count':0x0,'rows':[]};var _0x112aca=_['map'](db[_0x3bdf('0x2b')]['rawAttributes'],function(_0x46c7bc){return{'name':_0x46c7bc[_0x3bdf('0x2c')],'type':_0x46c7bc[_0x3bdf('0x2d')]['key']};});_0x51cefe[_0x3bdf('0x2e')]=_[_0x3bdf('0x2f')](_0x112aca,_0x3bdf('0x29'));_0x51cefe[_0x3bdf('0x30')]=_[_0x3bdf('0x31')](_0x15dada[_0x3bdf('0x30')]);_0x51cefe['filters']=_[_0x3bdf('0x32')](_0x51cefe['model'],_0x51cefe[_0x3bdf('0x30')]);_0x1e79c3[_0x3bdf('0x33')]=_[_0x3bdf('0x32')](_0x51cefe[_0x3bdf('0x2e')],qs['fields'](_0x15dada[_0x3bdf('0x30')][_0x3bdf('0x34')]));_0x1e79c3['attributes']=_0x1e79c3[_0x3bdf('0x33')][_0x3bdf('0x35')]?_0x1e79c3[_0x3bdf('0x33')]:_0x51cefe[_0x3bdf('0x2e')];if(!_0x15dada[_0x3bdf('0x30')][_0x3bdf('0x36')](_0x3bdf('0x37'))){_0x1e79c3[_0x3bdf('0x20')]=qs['limit'](_0x15dada[_0x3bdf('0x30')]['limit']);_0x1e79c3[_0x3bdf('0x1e')]=qs['offset'](_0x15dada[_0x3bdf('0x30')][_0x3bdf('0x1e')]);}_0x1e79c3[_0x3bdf('0x38')]=qs[_0x3bdf('0x39')](_0x15dada[_0x3bdf('0x30')][_0x3bdf('0x39')]);_0x1e79c3[_0x3bdf('0x3a')]=qs[_0x3bdf('0x3b')](_[_0x3bdf('0x3c')](_0x15dada[_0x3bdf('0x30')],_0x51cefe[_0x3bdf('0x3b')]),_0x112aca);if(_0x15dada[_0x3bdf('0x30')]['filter']){_0x1e79c3['where']=_['merge'](_0x1e79c3[_0x3bdf('0x3a')],{'$or':_[_0x3bdf('0x2f')](_0x112aca,function(_0x161189){if(_0x161189[_0x3bdf('0x2d')]!==_0x3bdf('0x3d')){var _0x4fbee9={};_0x4fbee9[_0x161189[_0x3bdf('0x29')]]={'$like':'%'+_0x15dada[_0x3bdf('0x30')]['filter']+'%'};return _0x4fbee9;}})});}_0x1e79c3=_[_0x3bdf('0x3e')]({},_0x1e79c3,_0x15dada[_0x3bdf('0x3f')]);var _0x3ecec0={'where':_0x1e79c3[_0x3bdf('0x3a')]};return db[_0x3bdf('0x2b')]['count'](_0x3ecec0)[_0x3bdf('0x40')](function(_0x4d9197){_0x49c4dc[_0x3bdf('0x21')]=_0x4d9197;if(_0x15dada[_0x3bdf('0x30')][_0x3bdf('0x41')]){_0x1e79c3[_0x3bdf('0x42')]=[{'all':!![]}];}return db[_0x3bdf('0x2b')]['findAll'](_0x1e79c3);})[_0x3bdf('0x40')](function(_0x163ccb){_0x49c4dc[_0x3bdf('0x43')]=_0x163ccb;return _0x49c4dc;})['then'](respondWithFilteredResult(_0x4bb1c6,_0x1e79c3))['catch'](handleError(_0x4bb1c6,null));};exports[_0x3bdf('0x44')]=function(_0x4efffd,_0x48bdaa){var _0x1215a3={'raw':!![],'where':{'id':_0x4efffd[_0x3bdf('0x45')]['id']}},_0x951a14={};_0x951a14[_0x3bdf('0x2e')]=_[_0x3bdf('0x31')](db['MailServerOut'][_0x3bdf('0x46')]);_0x951a14[_0x3bdf('0x30')]=_[_0x3bdf('0x31')](_0x4efffd[_0x3bdf('0x30')]);_0x951a14[_0x3bdf('0x3b')]=_[_0x3bdf('0x32')](_0x951a14[_0x3bdf('0x2e')],_0x951a14[_0x3bdf('0x30')]);_0x1215a3[_0x3bdf('0x33')]=_[_0x3bdf('0x32')](_0x951a14['model'],qs[_0x3bdf('0x34')](_0x4efffd[_0x3bdf('0x30')][_0x3bdf('0x34')]));_0x1215a3['attributes']=_0x1215a3[_0x3bdf('0x33')][_0x3bdf('0x35')]?_0x1215a3[_0x3bdf('0x33')]:_0x951a14[_0x3bdf('0x2e')];if(_0x4efffd[_0x3bdf('0x30')][_0x3bdf('0x41')]){_0x1215a3[_0x3bdf('0x42')]=[{'all':!![]}];}_0x1215a3=_[_0x3bdf('0x3e')]({},_0x1215a3,_0x4efffd[_0x3bdf('0x3f')]);return db[_0x3bdf('0x2b')][_0x3bdf('0x47')](_0x1215a3)[_0x3bdf('0x40')](handleEntityNotFound(_0x48bdaa,null))[_0x3bdf('0x40')](respondWithResult(_0x48bdaa,null))[_0x3bdf('0x48')](handleError(_0x48bdaa,null));};exports[_0x3bdf('0x49')]=function(_0x2ae316,_0x289cf8){return db['MailServerOut'][_0x3bdf('0x49')](_0x2ae316[_0x3bdf('0x4a')],{})['then'](respondWithResult(_0x289cf8,0xc9))['catch'](handleError(_0x289cf8,null));};exports[_0x3bdf('0x26')]=function(_0x1feab8,_0x2bec2b){if(_0x1feab8[_0x3bdf('0x4a')]['id']){delete _0x1feab8[_0x3bdf('0x4a')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x1feab8[_0x3bdf('0x45')]['id']}})['then'](handleEntityNotFound(_0x2bec2b,null))['then'](saveUpdates(_0x1feab8[_0x3bdf('0x4a')],null))[_0x3bdf('0x40')](respondWithResult(_0x2bec2b,null))['catch'](handleError(_0x2bec2b,null));};exports[_0x3bdf('0x4b')]=function(_0x4cb9a2,_0xeb69f0){return db[_0x3bdf('0x2b')][_0x3bdf('0x47')]({'where':{'id':_0x4cb9a2[_0x3bdf('0x45')]['id']}})['then'](handleEntityNotFound(_0xeb69f0,null))[_0x3bdf('0x40')](removeEntity(_0xeb69f0,null))[_0x3bdf('0x48')](handleError(_0xeb69f0,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 642063f..9b785d0 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 _0x6217=['util','api','bluebird','path','exports','define','MailServerOut','lodash'];(function(_0x571330,_0x4d638b){var _0x17f423=function(_0x553942){while(--_0x553942){_0x571330['push'](_0x571330['shift']());}};_0x17f423(++_0x4d638b);}(_0x6217,0x1e7));var _0x7621=function(_0x46451c,_0x88ddd){_0x46451c=_0x46451c-0x0;var _0x12dce4=_0x6217[_0x46451c];return _0x12dce4;};'use strict';var _=require(_0x7621('0x0'));var util=require(_0x7621('0x1'));var logger=require('../../config/logger')(_0x7621('0x2'));var moment=require('moment');var BPromise=require(_0x7621('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7621('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module[_0x7621('0x5')]=function(_0x26b319,_0x4062f2){return _0x26b319[_0x7621('0x6')](_0x7621('0x7'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9b8=['mail_servers_out','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','MailServerOut'];(function(_0x26cbcc,_0x4ad337){var _0x128040=function(_0x490a5a){while(--_0x490a5a){_0x26cbcc['push'](_0x26cbcc['shift']());}};_0x128040(++_0x4ad337);}(_0xf9b8,0x11f));var _0x8f9b=function(_0xc11464,_0xeb3e9e){_0xc11464=_0xc11464-0x0;var _0x3b3dd5=_0xf9b8[_0xc11464];return _0x3b3dd5;};'use strict';var _=require(_0x8f9b('0x0'));var util=require(_0x8f9b('0x1'));var logger=require(_0x8f9b('0x2'))('api');var moment=require(_0x8f9b('0x3'));var BPromise=require(_0x8f9b('0x4'));var rp=require(_0x8f9b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f9b('0x6'));var config=require(_0x8f9b('0x7'));var attributes=require(_0x8f9b('0x8'));module['exports']=function(_0x214e4a,_0x2f5878){return _0x214e4a['define'](_0x8f9b('0x9'),attributes,{'tableName':_0x8f9b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 536f3df..138dd5f 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 _0x7a54=['info','MailServerOut,\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(_0x456999,_0x18aa10){_0x456999=_0x456999-0x0;var _0x11e2d0=_0x7a54[_0x456999];return _0x11e2d0;};'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')]('MailServerOut,\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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1dd3a0,_0x5ed386){var _0x3bc2e8=function(_0x311607){while(--_0x311607){_0x1dd3a0['push'](_0x1dd3a0['shift']());}};_0x3bc2e8(++_0x5ed386);}(_0x5f2f,0x73));var _0xf5f2=function(_0x235eac,_0xf25db6){_0x235eac=_0x235eac-0x0;var _0xe32582=_0x5f2f[_0x235eac];return _0xe32582;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 74b1480..736746c 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 _0x2c92=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete'];(function(_0x2fdbf8,_0x461a51){var _0x5dc976=function(_0xb9cea4){while(--_0xb9cea4){_0x2fdbf8['push'](_0x2fdbf8['shift']());}};_0x5dc976(++_0x461a51);}(_0x2c92,0x1ce));var _0x22c9=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x2c92[_0x381589];return _0x2a075d;};'use strict';var multer=require(_0x22c9('0x0'));var util=require(_0x22c9('0x1'));var path=require(_0x22c9('0x2'));var timeout=require(_0x22c9('0x3'));var express=require(_0x22c9('0x4'));var router=express[_0x22c9('0x5')]();var fs_extra=require(_0x22c9('0x6'));var auth=require(_0x22c9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x22c9('0x8'));var controller=require(_0x22c9('0x9'));router[_0x22c9('0xa')]('/',auth[_0x22c9('0xb')](),controller[_0x22c9('0xc')]);router[_0x22c9('0xa')](_0x22c9('0xd'),auth[_0x22c9('0xb')](),controller['describe']);router[_0x22c9('0xa')](_0x22c9('0xe'),auth[_0x22c9('0xb')](),controller[_0x22c9('0xf')]);router[_0x22c9('0x10')]('/',auth[_0x22c9('0xb')](),controller[_0x22c9('0x11')]);router[_0x22c9('0x12')](_0x22c9('0xe'),auth['isAuthenticated'](),controller[_0x22c9('0x13')]);router[_0x22c9('0x14')]('/:id',auth[_0x22c9('0xb')](),controller[_0x22c9('0x15')]);module[_0x22c9('0x16')]=router; \ No newline at end of file +var _0x6f8e=['isAuthenticated','index','get','/describe','describe','/:id','show','put','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller'];(function(_0xd720d0,_0x2e05e6){var _0x7a2a44=function(_0x5c3d8b){while(--_0x5c3d8b){_0xd720d0['push'](_0xd720d0['shift']());}};_0x7a2a44(++_0x2e05e6);}(_0x6f8e,0x1cc));var _0xe6f8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6f8e[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xe6f8('0x0'));var util=require(_0xe6f8('0x1'));var path=require('path');var timeout=require(_0xe6f8('0x2'));var express=require('express');var router=express[_0xe6f8('0x3')]();var fs_extra=require(_0xe6f8('0x4'));var auth=require(_0xe6f8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe6f8('0x6'));var controller=require(_0xe6f8('0x7'));router['get']('/',auth[_0xe6f8('0x8')](),controller[_0xe6f8('0x9')]);router[_0xe6f8('0xa')](_0xe6f8('0xb'),auth[_0xe6f8('0x8')](),controller[_0xe6f8('0xc')]);router[_0xe6f8('0xa')](_0xe6f8('0xd'),auth['isAuthenticated'](),controller[_0xe6f8('0xe')]);router['post']('/',auth[_0xe6f8('0x8')](),controller['create']);router[_0xe6f8('0xf')](_0xe6f8('0xd'),auth[_0xe6f8('0x8')](),controller[_0xe6f8('0x10')]);router['delete'](_0xe6f8('0xd'),auth[_0xe6f8('0x8')](),controller['destroy']);module[_0xe6f8('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index c643c0c..b149726 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 _0xbff5=['sequelize','exports','STRING','name'];(function(_0x4269ae,_0xbee855){var _0x43cbe8=function(_0xbeb349){while(--_0xbeb349){_0x4269ae['push'](_0x4269ae['shift']());}};_0x43cbe8(++_0xbee855);}(_0xbff5,0x1bc));var _0x5bff=function(_0xec2e0e,_0x462046){_0xec2e0e=_0xec2e0e-0x0;var _0x45ebba=_0xbff5[_0xec2e0e];return _0x45ebba;};'use strict';var Sequelize=require(_0x5bff('0x0'));module[_0x5bff('0x1')]={'name':{'type':Sequelize[_0x5bff('0x2')],'unique':_0x5bff('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5bff('0x2')]}}; \ No newline at end of file +var _0x885a=['exports','STRING','name'];(function(_0x2431d6,_0x25189a){var _0x4d0f9b=function(_0x52cd84){while(--_0x52cd84){_0x2431d6['push'](_0x2431d6['shift']());}};_0x4d0f9b(++_0x25189a);}(_0x885a,0x180));var _0xa885=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x885a[_0x413feb];return _0x40ee88;};'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 f84262e..3e178a2 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 _0xd754=['order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','MailSubstatus','rows','catch','show','create','body','find','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','error','stack','name','send','index','map','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x57c22b,_0x54a1fa){var _0x5c982e=function(_0x52dab3){while(--_0x52dab3){_0x57c22b['push'](_0x57c22b['shift']());}};_0x5c982e(++_0x54a1fa);}(_0xd754,0xad));var _0x4d75=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xd754[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0x4d75('0x0'));var rimraf=require(_0x4d75('0x1'));var zipdir=require(_0x4d75('0x2'));var jsonpatch=require(_0x4d75('0x3'));var rp=require(_0x4d75('0x4'));var moment=require(_0x4d75('0x5'));var BPromise=require(_0x4d75('0x6'));var Mustache=require(_0x4d75('0x7'));var util=require(_0x4d75('0x8'));var path=require(_0x4d75('0x9'));var sox=require(_0x4d75('0xa'));var csv=require(_0x4d75('0xb'));var ejs=require(_0x4d75('0xc'));var fs=require('fs');var fs_extra=require(_0x4d75('0xd'));var _=require('lodash');var squel=require(_0x4d75('0xe'));var crypto=require('crypto');var jsforce=require(_0x4d75('0xf'));var deskjs=require(_0x4d75('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4d75('0x11'));var Papa=require('papaparse');var Redis=require(_0x4d75('0x12'));var authService=require(_0x4d75('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4d75('0x14'));var hardwareService=require(_0x4d75('0x15'));var logger=require('../../config/logger')(_0x4d75('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4d75('0x17'));var db=require(_0x4d75('0x18'))['db'];function respondWithStatusCode(_0x40d606,_0x5547f8){_0x5547f8=_0x5547f8||0xcc;return function(_0x1478c0){if(_0x1478c0){return _0x40d606[_0x4d75('0x19')](_0x5547f8);}return _0x40d606[_0x4d75('0x1a')](_0x5547f8)[_0x4d75('0x1b')]();};}function respondWithResult(_0x175f2c,_0x345974){_0x345974=_0x345974||0xc8;return function(_0x221a7a){if(_0x221a7a){return _0x175f2c[_0x4d75('0x1a')](_0x345974)[_0x4d75('0x1c')](_0x221a7a);}};}function respondWithFilteredResult(_0x1754fb,_0x415925){return function(_0x5d9c9e){if(_0x5d9c9e){var _0x5c3e32=typeof _0x415925[_0x4d75('0x1d')]==='undefined'&&typeof _0x415925[_0x4d75('0x1e')]===_0x4d75('0x1f');var _0xbd08d3=_0x5d9c9e['count'];var _0x390418=_0x5c3e32?0x0:_0x415925[_0x4d75('0x1d')];var _0x37bb19=_0x5c3e32?_0x5d9c9e[_0x4d75('0x20')]:_0x415925[_0x4d75('0x1d')]+_0x415925[_0x4d75('0x1e')];var _0x2a78aa;if(_0x37bb19>=_0xbd08d3){_0x37bb19=_0xbd08d3;_0x2a78aa=0xc8;}else{_0x2a78aa=0xce;}_0x1754fb[_0x4d75('0x1a')](_0x2a78aa);return _0x1754fb['set'](_0x4d75('0x21'),_0x390418+'-'+_0x37bb19+'/'+_0xbd08d3)[_0x4d75('0x1c')](_0x5d9c9e);}return null;};}function patchUpdates(_0x47faab){return function(_0x161460){try{jsonpatch['apply'](_0x161460,_0x47faab,!![]);}catch(_0x4dfb9b){return BPromise[_0x4d75('0x22')](_0x4dfb9b);}return _0x161460[_0x4d75('0x23')]();};}function saveUpdates(_0x4ef1f5,_0x2c8f67){return function(_0x499d80){if(_0x499d80){return _0x499d80[_0x4d75('0x24')](_0x4ef1f5)['then'](function(_0x1fac97){return _0x1fac97;});}return null;};}function removeEntity(_0x50fd7f,_0x510c1a){return function(_0x4e06a6){if(_0x4e06a6){return _0x4e06a6['destroy']()[_0x4d75('0x25')](function(){_0x50fd7f[_0x4d75('0x1a')](0xcc)[_0x4d75('0x1b')]();});}};}function handleEntityNotFound(_0x401169,_0x3b983e){return function(_0x320133){if(!_0x320133){_0x401169['sendStatus'](0x194);}return _0x320133;};}function handleError(_0x2679bd,_0x4ac06d){_0x4ac06d=_0x4ac06d||0x1f4;return function(_0x2076ba){logger[_0x4d75('0x26')](_0x2076ba[_0x4d75('0x27')]);if(_0x2076ba['name']){delete _0x2076ba[_0x4d75('0x28')];}_0x2679bd[_0x4d75('0x1a')](_0x4ac06d)[_0x4d75('0x29')](_0x2076ba);};}exports[_0x4d75('0x2a')]=function(_0x310520,_0x223138){var _0x44981e={},_0x22a37f={},_0x5867eb={'count':0x0,'rows':[]};var _0x30e2d9=_[_0x4d75('0x2b')](db['MailSubstatus']['rawAttributes'],function(_0x357146){return{'name':_0x357146['fieldName'],'type':_0x357146[_0x4d75('0x2c')][_0x4d75('0x2d')]};});_0x22a37f[_0x4d75('0x2e')]=_[_0x4d75('0x2b')](_0x30e2d9,'name');_0x22a37f[_0x4d75('0x2f')]=_[_0x4d75('0x30')](_0x310520[_0x4d75('0x2f')]);_0x22a37f['filters']=_['intersection'](_0x22a37f[_0x4d75('0x2e')],_0x22a37f[_0x4d75('0x2f')]);_0x44981e[_0x4d75('0x31')]=_[_0x4d75('0x32')](_0x22a37f[_0x4d75('0x2e')],qs[_0x4d75('0x33')](_0x310520['query'][_0x4d75('0x33')]));_0x44981e[_0x4d75('0x31')]=_0x44981e['attributes'][_0x4d75('0x34')]?_0x44981e[_0x4d75('0x31')]:_0x22a37f[_0x4d75('0x2e')];if(!_0x310520[_0x4d75('0x2f')][_0x4d75('0x35')](_0x4d75('0x36'))){_0x44981e['limit']=qs[_0x4d75('0x1e')](_0x310520[_0x4d75('0x2f')][_0x4d75('0x1e')]);_0x44981e[_0x4d75('0x1d')]=qs['offset'](_0x310520[_0x4d75('0x2f')]['offset']);}_0x44981e[_0x4d75('0x37')]=qs['sort'](_0x310520[_0x4d75('0x2f')][_0x4d75('0x38')]);_0x44981e['where']=qs[_0x4d75('0x39')](_[_0x4d75('0x3a')](_0x310520[_0x4d75('0x2f')],_0x22a37f[_0x4d75('0x39')]),_0x30e2d9);if(_0x310520[_0x4d75('0x2f')]['filter']){_0x44981e[_0x4d75('0x3b')]=_[_0x4d75('0x3c')](_0x44981e[_0x4d75('0x3b')],{'$or':_[_0x4d75('0x2b')](_0x30e2d9,function(_0x3e60f8){if(_0x3e60f8[_0x4d75('0x2c')]!==_0x4d75('0x3d')){var _0x274191={};_0x274191[_0x3e60f8[_0x4d75('0x28')]]={'$like':'%'+_0x310520[_0x4d75('0x2f')][_0x4d75('0x3e')]+'%'};return _0x274191;}})});}_0x44981e=_[_0x4d75('0x3c')]({},_0x44981e,_0x310520[_0x4d75('0x3f')]);var _0x3089bd={'where':_0x44981e[_0x4d75('0x3b')]};return db['MailSubstatus'][_0x4d75('0x20')](_0x3089bd)['then'](function(_0x1bb713){_0x5867eb['count']=_0x1bb713;if(_0x310520[_0x4d75('0x2f')][_0x4d75('0x40')]){_0x44981e[_0x4d75('0x41')]=[{'all':!![]}];}return db[_0x4d75('0x42')]['findAll'](_0x44981e);})['then'](function(_0x487d29){_0x5867eb[_0x4d75('0x43')]=_0x487d29;return _0x5867eb;})[_0x4d75('0x25')](respondWithFilteredResult(_0x223138,_0x44981e))[_0x4d75('0x44')](handleError(_0x223138,null));};exports[_0x4d75('0x45')]=function(_0x3b8bce,_0x2a09e8){var _0x108fd3={'raw':!![],'where':{'id':_0x3b8bce['params']['id']}},_0x122591={};_0x122591[_0x4d75('0x2e')]=_['keys'](db[_0x4d75('0x42')]['rawAttributes']);_0x122591[_0x4d75('0x2f')]=_[_0x4d75('0x30')](_0x3b8bce[_0x4d75('0x2f')]);_0x122591['filters']=_[_0x4d75('0x32')](_0x122591[_0x4d75('0x2e')],_0x122591[_0x4d75('0x2f')]);_0x108fd3['attributes']=_['intersection'](_0x122591['model'],qs[_0x4d75('0x33')](_0x3b8bce['query']['fields']));_0x108fd3[_0x4d75('0x31')]=_0x108fd3['attributes'][_0x4d75('0x34')]?_0x108fd3[_0x4d75('0x31')]:_0x122591[_0x4d75('0x2e')];if(_0x3b8bce[_0x4d75('0x2f')][_0x4d75('0x40')]){_0x108fd3['include']=[{'all':!![]}];}_0x108fd3=_['merge']({},_0x108fd3,_0x3b8bce['options']);return db['MailSubstatus']['find'](_0x108fd3)['then'](handleEntityNotFound(_0x2a09e8,null))[_0x4d75('0x25')](respondWithResult(_0x2a09e8,null))[_0x4d75('0x44')](handleError(_0x2a09e8,null));};exports[_0x4d75('0x46')]=function(_0x1bd5fe,_0x14d68f){return db['MailSubstatus'][_0x4d75('0x46')](_0x1bd5fe['body'],{})[_0x4d75('0x25')](respondWithResult(_0x14d68f,0xc9))['catch'](handleError(_0x14d68f,null));};exports[_0x4d75('0x24')]=function(_0x1bb47c,_0x213687){if(_0x1bb47c[_0x4d75('0x47')]['id']){delete _0x1bb47c[_0x4d75('0x47')]['id'];}return db[_0x4d75('0x42')][_0x4d75('0x48')]({'where':{'id':_0x1bb47c['params']['id']}})[_0x4d75('0x25')](handleEntityNotFound(_0x213687,null))['then'](saveUpdates(_0x1bb47c[_0x4d75('0x47')],null))[_0x4d75('0x25')](respondWithResult(_0x213687,null))[_0x4d75('0x44')](handleError(_0x213687,null));};exports[_0x4d75('0x49')]=function(_0x1f017d,_0x18b5a4){return db[_0x4d75('0x42')]['find']({'where':{'id':_0x1f017d[_0x4d75('0x4a')]['id']}})[_0x4d75('0x25')](handleEntityNotFound(_0x18b5a4,null))['then'](removeEntity(_0x18b5a4,null))[_0x4d75('0x44')](handleError(_0x18b5a4,null));};exports['describe']=function(_0x6f3627,_0x1c2b7b){return db['MailSubstatus'][_0x4d75('0x4b')]()[_0x4d75('0x25')](respondWithResult(_0x1c2b7b,null))[_0x4d75('0x44')](handleError(_0x1c2b7b,null));}; \ No newline at end of file +var _0xc7bd=['find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','end','sendStatus','error','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','MailSubstatus','includeAll','include','findAll','params','keys','fields'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc7bd,0x16d));var _0xdc7b=function(_0x166417,_0x4d4806){_0x166417=_0x166417-0x0;var _0x590af8=_0xc7bd[_0x166417];return _0x590af8;};'use strict';var emlformat=require(_0xdc7b('0x0'));var rimraf=require(_0xdc7b('0x1'));var zipdir=require(_0xdc7b('0x2'));var jsonpatch=require(_0xdc7b('0x3'));var rp=require(_0xdc7b('0x4'));var moment=require(_0xdc7b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdc7b('0x6'));var path=require(_0xdc7b('0x7'));var sox=require(_0xdc7b('0x8'));var csv=require(_0xdc7b('0x9'));var ejs=require(_0xdc7b('0xa'));var fs=require('fs');var fs_extra=require(_0xdc7b('0xb'));var _=require(_0xdc7b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdc7b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdc7b('0x9'));var querystring=require(_0xdc7b('0xe'));var Papa=require(_0xdc7b('0xf'));var Redis=require(_0xdc7b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdc7b('0x11'));var as=require(_0xdc7b('0x12'));var hardwareService=require(_0xdc7b('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xdc7b('0x14'));var config=require(_0xdc7b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc7b('0x16'))['db'];function respondWithStatusCode(_0x40dbb0,_0xa77588){_0xa77588=_0xa77588||0xcc;return function(_0x496f2d){if(_0x496f2d){return _0x40dbb0['sendStatus'](_0xa77588);}return _0x40dbb0[_0xdc7b('0x17')](_0xa77588)['end']();};}function respondWithResult(_0x1ca15b,_0x392303){_0x392303=_0x392303||0xc8;return function(_0x52470c){if(_0x52470c){return _0x1ca15b[_0xdc7b('0x17')](_0x392303)[_0xdc7b('0x18')](_0x52470c);}};}function respondWithFilteredResult(_0xfa6558,_0x3c5b92){return function(_0x5444de){if(_0x5444de){var _0x3d8270=typeof _0x3c5b92[_0xdc7b('0x19')]===_0xdc7b('0x1a')&&typeof _0x3c5b92[_0xdc7b('0x1b')]==='undefined';var _0x493c0c=_0x5444de[_0xdc7b('0x1c')];var _0x35c941=_0x3d8270?0x0:_0x3c5b92[_0xdc7b('0x19')];var _0x3de6ac=_0x3d8270?_0x5444de['count']:_0x3c5b92[_0xdc7b('0x19')]+_0x3c5b92[_0xdc7b('0x1b')];var _0x42ba7c;if(_0x3de6ac>=_0x493c0c){_0x3de6ac=_0x493c0c;_0x42ba7c=0xc8;}else{_0x42ba7c=0xce;}_0xfa6558[_0xdc7b('0x17')](_0x42ba7c);return _0xfa6558[_0xdc7b('0x1d')](_0xdc7b('0x1e'),_0x35c941+'-'+_0x3de6ac+'/'+_0x493c0c)['json'](_0x5444de);}return null;};}function patchUpdates(_0x544ae7){return function(_0x221f2e){try{jsonpatch['apply'](_0x221f2e,_0x544ae7,!![]);}catch(_0x4113f1){return BPromise[_0xdc7b('0x1f')](_0x4113f1);}return _0x221f2e[_0xdc7b('0x20')]();};}function saveUpdates(_0x34bcd5,_0x43ad73){return function(_0xd9f57e){if(_0xd9f57e){return _0xd9f57e[_0xdc7b('0x21')](_0x34bcd5)['then'](function(_0x2f7dac){return _0x2f7dac;});}return null;};}function removeEntity(_0x401409,_0x1b7ccd){return function(_0x4e9a9e){if(_0x4e9a9e){return _0x4e9a9e[_0xdc7b('0x22')]()[_0xdc7b('0x23')](function(){_0x401409[_0xdc7b('0x17')](0xcc)[_0xdc7b('0x24')]();});}};}function handleEntityNotFound(_0x2bb5cf,_0x1a0904){return function(_0xa67e21){if(!_0xa67e21){_0x2bb5cf[_0xdc7b('0x25')](0x194);}return _0xa67e21;};}function handleError(_0x410406,_0x22362c){_0x22362c=_0x22362c||0x1f4;return function(_0x20ac40){logger[_0xdc7b('0x26')](_0x20ac40['stack']);if(_0x20ac40[_0xdc7b('0x27')]){delete _0x20ac40[_0xdc7b('0x27')];}_0x410406[_0xdc7b('0x17')](_0x22362c)[_0xdc7b('0x28')](_0x20ac40);};}exports['index']=function(_0x34c2e8,_0x4238f2){var _0x45e215={},_0x449c29={},_0x5001ea={'count':0x0,'rows':[]};var _0x889885=_['map'](db['MailSubstatus'][_0xdc7b('0x29')],function(_0x28d83b){return{'name':_0x28d83b[_0xdc7b('0x2a')],'type':_0x28d83b[_0xdc7b('0x2b')][_0xdc7b('0x2c')]};});_0x449c29[_0xdc7b('0x2d')]=_[_0xdc7b('0x2e')](_0x889885,_0xdc7b('0x27'));_0x449c29[_0xdc7b('0x2f')]=_['keys'](_0x34c2e8[_0xdc7b('0x2f')]);_0x449c29[_0xdc7b('0x30')]=_[_0xdc7b('0x31')](_0x449c29[_0xdc7b('0x2d')],_0x449c29['query']);_0x45e215[_0xdc7b('0x32')]=_['intersection'](_0x449c29[_0xdc7b('0x2d')],qs['fields'](_0x34c2e8[_0xdc7b('0x2f')]['fields']));_0x45e215[_0xdc7b('0x32')]=_0x45e215['attributes'][_0xdc7b('0x33')]?_0x45e215['attributes']:_0x449c29[_0xdc7b('0x2d')];if(!_0x34c2e8[_0xdc7b('0x2f')]['hasOwnProperty']('nolimit')){_0x45e215[_0xdc7b('0x1b')]=qs[_0xdc7b('0x1b')](_0x34c2e8['query'][_0xdc7b('0x1b')]);_0x45e215[_0xdc7b('0x19')]=qs['offset'](_0x34c2e8[_0xdc7b('0x2f')][_0xdc7b('0x19')]);}_0x45e215[_0xdc7b('0x34')]=qs['sort'](_0x34c2e8['query'][_0xdc7b('0x35')]);_0x45e215[_0xdc7b('0x36')]=qs[_0xdc7b('0x30')](_[_0xdc7b('0x37')](_0x34c2e8[_0xdc7b('0x2f')],_0x449c29[_0xdc7b('0x30')]),_0x889885);if(_0x34c2e8[_0xdc7b('0x2f')][_0xdc7b('0x38')]){_0x45e215[_0xdc7b('0x36')]=_[_0xdc7b('0x39')](_0x45e215[_0xdc7b('0x36')],{'$or':_['map'](_0x889885,function(_0x4e518e){if(_0x4e518e[_0xdc7b('0x2b')]!==_0xdc7b('0x3a')){var _0x8f1565={};_0x8f1565[_0x4e518e[_0xdc7b('0x27')]]={'$like':'%'+_0x34c2e8['query']['filter']+'%'};return _0x8f1565;}})});}_0x45e215=_[_0xdc7b('0x39')]({},_0x45e215,_0x34c2e8[_0xdc7b('0x3b')]);var _0x3564aa={'where':_0x45e215[_0xdc7b('0x36')]};return db[_0xdc7b('0x3c')][_0xdc7b('0x1c')](_0x3564aa)['then'](function(_0x5ec96e){_0x5001ea[_0xdc7b('0x1c')]=_0x5ec96e;if(_0x34c2e8[_0xdc7b('0x2f')][_0xdc7b('0x3d')]){_0x45e215[_0xdc7b('0x3e')]=[{'all':!![]}];}return db['MailSubstatus'][_0xdc7b('0x3f')](_0x45e215);})[_0xdc7b('0x23')](function(_0x30981c){_0x5001ea['rows']=_0x30981c;return _0x5001ea;})[_0xdc7b('0x23')](respondWithFilteredResult(_0x4238f2,_0x45e215))['catch'](handleError(_0x4238f2,null));};exports['show']=function(_0x2eac54,_0x579291){var _0x2adc0c={'raw':!![],'where':{'id':_0x2eac54[_0xdc7b('0x40')]['id']}},_0x2c9253={};_0x2c9253['model']=_[_0xdc7b('0x41')](db[_0xdc7b('0x3c')][_0xdc7b('0x29')]);_0x2c9253[_0xdc7b('0x2f')]=_[_0xdc7b('0x41')](_0x2eac54[_0xdc7b('0x2f')]);_0x2c9253[_0xdc7b('0x30')]=_[_0xdc7b('0x31')](_0x2c9253[_0xdc7b('0x2d')],_0x2c9253[_0xdc7b('0x2f')]);_0x2adc0c[_0xdc7b('0x32')]=_[_0xdc7b('0x31')](_0x2c9253[_0xdc7b('0x2d')],qs[_0xdc7b('0x42')](_0x2eac54[_0xdc7b('0x2f')]['fields']));_0x2adc0c[_0xdc7b('0x32')]=_0x2adc0c[_0xdc7b('0x32')][_0xdc7b('0x33')]?_0x2adc0c[_0xdc7b('0x32')]:_0x2c9253[_0xdc7b('0x2d')];if(_0x2eac54[_0xdc7b('0x2f')]['includeAll']){_0x2adc0c[_0xdc7b('0x3e')]=[{'all':!![]}];}_0x2adc0c=_[_0xdc7b('0x39')]({},_0x2adc0c,_0x2eac54[_0xdc7b('0x3b')]);return db['MailSubstatus'][_0xdc7b('0x43')](_0x2adc0c)[_0xdc7b('0x23')](handleEntityNotFound(_0x579291,null))[_0xdc7b('0x23')](respondWithResult(_0x579291,null))[_0xdc7b('0x44')](handleError(_0x579291,null));};exports[_0xdc7b('0x45')]=function(_0x182ed7,_0x4bf422){return db[_0xdc7b('0x3c')][_0xdc7b('0x45')](_0x182ed7['body'],{})[_0xdc7b('0x23')](respondWithResult(_0x4bf422,0xc9))[_0xdc7b('0x44')](handleError(_0x4bf422,null));};exports[_0xdc7b('0x21')]=function(_0x399490,_0x40bbd2){if(_0x399490[_0xdc7b('0x46')]['id']){delete _0x399490[_0xdc7b('0x46')]['id'];}return db[_0xdc7b('0x3c')][_0xdc7b('0x43')]({'where':{'id':_0x399490[_0xdc7b('0x40')]['id']}})[_0xdc7b('0x23')](handleEntityNotFound(_0x40bbd2,null))[_0xdc7b('0x23')](saveUpdates(_0x399490[_0xdc7b('0x46')],null))[_0xdc7b('0x23')](respondWithResult(_0x40bbd2,null))[_0xdc7b('0x44')](handleError(_0x40bbd2,null));};exports[_0xdc7b('0x22')]=function(_0x4fffdd,_0x17a086){return db[_0xdc7b('0x3c')][_0xdc7b('0x43')]({'where':{'id':_0x4fffdd[_0xdc7b('0x40')]['id']}})['then'](handleEntityNotFound(_0x17a086,null))[_0xdc7b('0x23')](removeEntity(_0x17a086,null))[_0xdc7b('0x44')](handleError(_0x17a086,null));};exports[_0xdc7b('0x47')]=function(_0x398ae1,_0x2830fb){return db['MailSubstatus'][_0xdc7b('0x47')]()[_0xdc7b('0x23')](respondWithResult(_0x2830fb,null))['catch'](handleError(_0x2830fb,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index db5d819..cd62c79 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 _0xa4c7=['../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa4c7,0x16c));var _0x7a4c=function(_0x55f2c7,_0x47961f){_0x55f2c7=_0x55f2c7-0x0;var _0x245a38=_0xa4c7[_0x55f2c7];return _0x245a38;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x7a4c('0x0'))['db'][_0x7a4c('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x7a4c('0x2')](0x0);var events={'afterUpdate':_0x7a4c('0x3')};function emitEvent(_0x4063d2){return function(_0x1c0fca,_0x171a0d,_0x581816){MailSubstatusEvents[_0x7a4c('0x4')](_0x4063d2+':'+_0x1c0fca['id'],_0x1c0fca);MailSubstatusEvents[_0x7a4c('0x4')](_0x4063d2,_0x1c0fca);_0x581816(null);};}for(var e in events){if(events[_0x7a4c('0x5')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x7a4c('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0x142f=['../../mysqldb','setMaxListeners','update','emit','hook','exports'];(function(_0x4a62dd,_0x1baa20){var _0x2f88bf=function(_0x43fb10){while(--_0x43fb10){_0x4a62dd['push'](_0x4a62dd['shift']());}};_0x2f88bf(++_0x1baa20);}(_0x142f,0x78));var _0xf142=function(_0x270aab,_0x30dbfa){_0x270aab=_0x270aab-0x0;var _0x3b4064=_0x142f[_0x270aab];return _0x3b4064;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xf142('0x0'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xf142('0x1')](0x0);var events={'afterUpdate':_0xf142('0x2')};function emitEvent(_0x4c93cd){return function(_0xdd2d4b,_0x29d43f,_0x2aa883){MailSubstatusEvents['emit'](_0x4c93cd+':'+_0xdd2d4b['id'],_0xdd2d4b);MailSubstatusEvents[_0xf142('0x3')](_0x4c93cd,_0xdd2d4b);_0x2aa883(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xf142('0x4')](e,emitEvent(event));}}module[_0xf142('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 7d4c037..9d4061c 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 _0x5c70=['Condition','name','mailSubstatus','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses'];(function(_0xe9fab2,_0x36c8aa){var _0xe74509=function(_0x40e83d){while(--_0x40e83d){_0xe9fab2['push'](_0xe9fab2['shift']());}};_0xe74509(++_0x36c8aa);}(_0x5c70,0x123));var _0x05c7=function(_0x84ff0a,_0x1c0f7d){_0x84ff0a=_0x84ff0a-0x0;var _0x9862f=_0x5c70[_0x84ff0a];return _0x9862f;};'use strict';var attributes=require(_0x05c7('0x0'));module[_0x05c7('0x1')]=function(_0x58b2c5){var _0x573e05=_0x58b2c5[_0x05c7('0x2')];return _0x58b2c5[_0x05c7('0x3')](_0x05c7('0x4'),attributes,{'tableName':_0x05c7('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x264dbe,_0x40209f,_0x5b9fc6){return _0x573e05[_0x05c7('0x6')]['update']({'value':_0x264dbe[_0x05c7('0x7')]},{'where':{'field':_0x05c7('0x8'),'value':_0x264dbe['_previousDataValues'][_0x05c7('0x7')]}})[_0x05c7('0x9')](function(){_0x5b9fc6();})[_0x05c7('0xa')](function(_0x5ee95c){_0x5b9fc6(_0x5ee95c);});}}});}; \ No newline at end of file +var _0xa332=['then','catch','./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses','Condition','update','_previousDataValues','name'];(function(_0x480730,_0x9b660c){var _0x4a246b=function(_0x27853b){while(--_0x27853b){_0x480730['push'](_0x480730['shift']());}};_0x4a246b(++_0x9b660c);}(_0xa332,0x1ce));var _0x2a33=function(_0x370e5f,_0x27842f){_0x370e5f=_0x370e5f-0x0;var _0xb078d2=_0xa332[_0x370e5f];return _0xb078d2;};'use strict';var attributes=require(_0x2a33('0x0'));module[_0x2a33('0x1')]=function(_0x3399de){var _0x5c679b=_0x3399de['models'];return _0x3399de['define'](_0x2a33('0x2'),attributes,{'tableName':_0x2a33('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x12f499,_0x4cdb1b,_0x147e49){return _0x5c679b[_0x2a33('0x4')][_0x2a33('0x5')]({'value':_0x12f499['name']},{'where':{'field':'mailSubstatus','value':_0x12f499[_0x2a33('0x6')][_0x2a33('0x7')]}})[_0x2a33('0x8')](function(){_0x147e49();})[_0x2a33('0x9')](function(_0x14ff6d){_0x147e49(_0x14ff6d);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index b2c241a..7612248 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 _0xf61e=['../../config/environment','jayson/promise','client','http','request','then','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailSubstatus,\x20%s,\x20%s','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5c7023,_0x57f231){var _0x1a7ccb=function(_0x4e782f){while(--_0x4e782f){_0x5c7023['push'](_0x5c7023['shift']());}};_0x1a7ccb(++_0x57f231);}(_0xf61e,0x82));var _0xef61=function(_0x3247cd,_0x3f4379){_0x3247cd=_0x3247cd-0x0;var _0x32e101=_0xf61e[_0x3247cd];return _0x32e101;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef61('0x3'));var db=require(_0xef61('0x4'))['db'];var utils=require(_0xef61('0x5'));var logger=require(_0xef61('0x6'))(_0xef61('0x7'));var config=require(_0xef61('0x8'));var jayson=require(_0xef61('0x9'));var client=jayson[_0xef61('0xa')][_0xef61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ba3f,_0x2a9a98,_0x4c82d6){return new BPromise(function(_0x3bcbd0,_0x269fd9){return client[_0xef61('0xc')](_0x47ba3f,_0x4c82d6)[_0xef61('0xd')](function(_0x38546c){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x2a9a98,'request\x20sent');logger[_0xef61('0xe')](_0xef61('0xf'),_0x2a9a98,_0xef61('0x10'),JSON['stringify'](_0x38546c));if(_0x38546c[_0xef61('0x11')]){if(_0x38546c['error'][_0xef61('0x12')]===0x1f4){logger[_0xef61('0x11')](_0xef61('0x13'),_0x2a9a98,_0x38546c[_0xef61('0x11')]['message']);return _0x269fd9(_0x38546c[_0xef61('0x11')]['message']);}logger[_0xef61('0x11')](_0xef61('0x13'),_0x2a9a98,_0x38546c[_0xef61('0x11')][_0xef61('0x14')]);return _0x3bcbd0(_0x38546c[_0xef61('0x11')][_0xef61('0x14')]);}else{logger[_0xef61('0x15')]('MailSubstatus,\x20%s,\x20%s',_0x2a9a98,_0xef61('0x10'));_0x3bcbd0(_0x38546c['result'][_0xef61('0x14')]);}})[_0xef61('0x16')](function(_0x2227d5){logger[_0xef61('0x11')](_0xef61('0x13'),_0x2a9a98,_0x2227d5);_0x269fd9(_0x2227d5);});});} \ No newline at end of file +var _0x025f=['client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x43444b,_0x8cf95b){var _0x392fe5=function(_0x7a1a82){while(--_0x7a1a82){_0x43444b['push'](_0x43444b['shift']());}};_0x392fe5(++_0x8cf95b);}(_0x025f,0x1c1));var _0xf025=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x025f[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xf025('0x0'));var util=require('util');var moment=require(_0xf025('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf025('0x2'));var logger=require(_0xf025('0x3'))(_0xf025('0x4'));var config=require(_0xf025('0x5'));var jayson=require(_0xf025('0x6'));var client=jayson[_0xf025('0x7')][_0xf025('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12dde8,_0x2e5f1a,_0x5ce57b){return new BPromise(function(_0x165234,_0x2fe30f){return client['request'](_0x12dde8,_0x5ce57b)[_0xf025('0x9')](function(_0x51756f){logger[_0xf025('0xa')](_0xf025('0xb'),_0x2e5f1a,_0xf025('0xc'));logger[_0xf025('0xd')](_0xf025('0xe'),_0x2e5f1a,_0xf025('0xc'),JSON['stringify'](_0x51756f));if(_0x51756f[_0xf025('0xf')]){if(_0x51756f[_0xf025('0xf')][_0xf025('0x10')]===0x1f4){logger[_0xf025('0xf')](_0xf025('0xb'),_0x2e5f1a,_0x51756f[_0xf025('0xf')]['message']);return _0x2fe30f(_0x51756f['error'][_0xf025('0x11')]);}logger[_0xf025('0xf')](_0xf025('0xb'),_0x2e5f1a,_0x51756f[_0xf025('0xf')]['message']);return _0x165234(_0x51756f[_0xf025('0xf')][_0xf025('0x11')]);}else{logger[_0xf025('0xa')](_0xf025('0xb'),_0x2e5f1a,_0xf025('0xc'));_0x165234(_0x51756f[_0xf025('0x12')][_0xf025('0x11')]);}})['catch'](function(_0x3e5ebf){logger[_0xf025('0xf')](_0xf025('0xb'),_0x2e5f1a,_0x3e5ebf);_0x2fe30f(_0x3e5ebf);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 717fb3b..ebe0bc6 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 _0xf6a1=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0xf6a1,0x1a7));var _0x1f6a=function(_0xfd1502,_0xa85d32){_0xfd1502=_0xfd1502-0x0;var _0x329267=_0xf6a1[_0xfd1502];return _0x329267;};'use strict';var multer=require(_0x1f6a('0x0'));var util=require(_0x1f6a('0x1'));var path=require('path');var timeout=require(_0x1f6a('0x2'));var express=require(_0x1f6a('0x3'));var router=express[_0x1f6a('0x4')]();var fs_extra=require(_0x1f6a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1f6a('0x6'));var config=require('../../config/environment');var controller=require(_0x1f6a('0x7'));router[_0x1f6a('0x8')]('/',auth['isAuthenticated'](),controller[_0x1f6a('0x9')]);router['get'](_0x1f6a('0xa'),auth[_0x1f6a('0xb')](),controller[_0x1f6a('0xc')]);router[_0x1f6a('0x8')](_0x1f6a('0xd'),auth['isAuthenticated'](),controller[_0x1f6a('0xe')]);router[_0x1f6a('0xf')]('/',auth[_0x1f6a('0xb')](),controller['create']);router[_0x1f6a('0x10')](_0x1f6a('0xd'),auth[_0x1f6a('0xb')](),controller[_0x1f6a('0x11')]);router[_0x1f6a('0x12')]('/:id',auth[_0x1f6a('0xb')](),controller[_0x1f6a('0x13')]);module[_0x1f6a('0x14')]=router; \ No newline at end of file +var _0xb4ff=['delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xb4ff,0x157));var _0xfb4f=function(_0x32e38e,_0x4bd7a8){_0x32e38e=_0x32e38e-0x0;var _0x3bff5d=_0xb4ff[_0x32e38e];return _0x3bff5d;};'use strict';var multer=require(_0xfb4f('0x0'));var util=require('util');var path=require(_0xfb4f('0x1'));var timeout=require(_0xfb4f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfb4f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfb4f('0x4'));var config=require(_0xfb4f('0x5'));var controller=require(_0xfb4f('0x6'));router[_0xfb4f('0x7')]('/',auth[_0xfb4f('0x8')](),controller[_0xfb4f('0x9')]);router['get'](_0xfb4f('0xa'),auth[_0xfb4f('0x8')](),controller[_0xfb4f('0xb')]);router[_0xfb4f('0x7')](_0xfb4f('0xc'),auth['isAuthenticated'](),controller[_0xfb4f('0xd')]);router[_0xfb4f('0xe')]('/',auth[_0xfb4f('0x8')](),controller[_0xfb4f('0xf')]);router[_0xfb4f('0x10')](_0xfb4f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xfb4f('0x11')]('/:id',auth[_0xfb4f('0x8')](),controller[_0xfb4f('0x12')]);module[_0xfb4f('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 4be5379..b8528c7 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x392603,_0x15c33e){var _0x59b68f=function(_0x44940a){while(--_0x44940a){_0x392603['push'](_0x392603['shift']());}};_0x59b68f(++_0x15c33e);}(_0x70e0,0x17b));var _0x070e=function(_0x595f2a,_0x1e02bd){_0x595f2a=_0x595f2a-0x0;var _0x486bc4=_0x70e0[_0x595f2a];return _0x486bc4;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x24559c,_0x4f52f7){var _0xdb1e01=function(_0x14d647){while(--_0x14d647){_0x24559c['push'](_0x24559c['shift']());}};_0xdb1e01(++_0x4f52f7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2673c1,_0x489c00){_0x2673c1=_0x2673c1-0x0;var _0x46bde=_0xf3cd[_0x2673c1];return _0x46bde;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 0eb2d42..6340f34 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 _0x2f3a=['../../config/logger','api','../../config/environment','../../mysqldb','status','json','undefined','limit','offset','set','Content-Range','apply','update','then','end','sendStatus','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','type','model','map','query','intersection','attributes','length','order','sort','filters','pick','where','merge','VIRTUAL','filter','count','findAll','rows','catch','show','params','keys','fields','includeAll','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x2e2336,_0x5a24e5){var _0x231a7e=function(_0x53f76f){while(--_0x53f76f){_0x2e2336['push'](_0x2e2336['shift']());}};_0x231a7e(++_0x5a24e5);}(_0x2f3a,0x1ae));var _0xa2f3=function(_0x589346,_0x1dc37a){_0x589346=_0x589346-0x0;var _0xf1f1d5=_0x2f3a[_0x589346];return _0xf1f1d5;};'use strict';var emlformat=require(_0xa2f3('0x0'));var rimraf=require(_0xa2f3('0x1'));var zipdir=require(_0xa2f3('0x2'));var jsonpatch=require(_0xa2f3('0x3'));var rp=require(_0xa2f3('0x4'));var moment=require(_0xa2f3('0x5'));var BPromise=require(_0xa2f3('0x6'));var Mustache=require(_0xa2f3('0x7'));var util=require(_0xa2f3('0x8'));var path=require(_0xa2f3('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa2f3('0xa'));var fs=require('fs');var fs_extra=require(_0xa2f3('0xb'));var _=require(_0xa2f3('0xc'));var squel=require('squel');var crypto=require(_0xa2f3('0xd'));var jsforce=require(_0xa2f3('0xe'));var deskjs=require(_0xa2f3('0xf'));var toCsv=require(_0xa2f3('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa2f3('0x11'));var authService=require(_0xa2f3('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa2f3('0x13'));var logger=require(_0xa2f3('0x14'))(_0xa2f3('0x15'));var utils=require('../../config/utils');var config=require(_0xa2f3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2f3('0x17'))['db'];function respondWithStatusCode(_0x1c62c8,_0x1a3764){_0x1a3764=_0x1a3764||0xcc;return function(_0x5eeef0){if(_0x5eeef0){return _0x1c62c8['sendStatus'](_0x1a3764);}return _0x1c62c8[_0xa2f3('0x18')](_0x1a3764)['end']();};}function respondWithResult(_0x596222,_0x237062){_0x237062=_0x237062||0xc8;return function(_0x42a6ac){if(_0x42a6ac){return _0x596222['status'](_0x237062)[_0xa2f3('0x19')](_0x42a6ac);}};}function respondWithFilteredResult(_0x270468,_0x400c4d){return function(_0x4eb6be){if(_0x4eb6be){var _0x365b01=typeof _0x400c4d['offset']===_0xa2f3('0x1a')&&typeof _0x400c4d[_0xa2f3('0x1b')]===_0xa2f3('0x1a');var _0x1511b1=_0x4eb6be['count'];var _0x38034c=_0x365b01?0x0:_0x400c4d['offset'];var _0x51a4ea=_0x365b01?_0x4eb6be['count']:_0x400c4d[_0xa2f3('0x1c')]+_0x400c4d[_0xa2f3('0x1b')];var _0x375798;if(_0x51a4ea>=_0x1511b1){_0x51a4ea=_0x1511b1;_0x375798=0xc8;}else{_0x375798=0xce;}_0x270468[_0xa2f3('0x18')](_0x375798);return _0x270468[_0xa2f3('0x1d')](_0xa2f3('0x1e'),_0x38034c+'-'+_0x51a4ea+'/'+_0x1511b1)[_0xa2f3('0x19')](_0x4eb6be);}return null;};}function patchUpdates(_0x3bc9c2){return function(_0x179bc1){try{jsonpatch[_0xa2f3('0x1f')](_0x179bc1,_0x3bc9c2,!![]);}catch(_0x160e45){return BPromise['reject'](_0x160e45);}return _0x179bc1['save']();};}function saveUpdates(_0x4e0b0b,_0x316c02){return function(_0x43943f){if(_0x43943f){return _0x43943f[_0xa2f3('0x20')](_0x4e0b0b)[_0xa2f3('0x21')](function(_0xb4ad5a){return _0xb4ad5a;});}return null;};}function removeEntity(_0x473a30,_0x32c21d){return function(_0x4ab1b1){if(_0x4ab1b1){return _0x4ab1b1['destroy']()[_0xa2f3('0x21')](function(){_0x473a30[_0xa2f3('0x18')](0xcc)[_0xa2f3('0x22')]();});}};}function handleEntityNotFound(_0x577334,_0x1b5041){return function(_0x5e7f83){if(!_0x5e7f83){_0x577334[_0xa2f3('0x23')](0x194);}return _0x5e7f83;};}function handleError(_0x3e4ff0,_0x21a9e7){_0x21a9e7=_0x21a9e7||0x1f4;return function(_0x412e99){logger[_0xa2f3('0x24')](_0x412e99[_0xa2f3('0x25')]);if(_0x412e99['name']){delete _0x412e99[_0xa2f3('0x26')];}_0x3e4ff0['status'](_0x21a9e7)[_0xa2f3('0x27')](_0x412e99);};}exports[_0xa2f3('0x28')]=function(_0x1f173b,_0x3de921){var _0x5c8eea={},_0xa56b5d={},_0x3fb828={'count':0x0,'rows':[]};var _0x430a6e=_['map'](db[_0xa2f3('0x29')][_0xa2f3('0x2a')],function(_0x2890ee){return{'name':_0x2890ee[_0xa2f3('0x2b')],'type':_0x2890ee[_0xa2f3('0x2c')]['key']};});_0xa56b5d[_0xa2f3('0x2d')]=_[_0xa2f3('0x2e')](_0x430a6e,'name');_0xa56b5d[_0xa2f3('0x2f')]=_['keys'](_0x1f173b[_0xa2f3('0x2f')]);_0xa56b5d['filters']=_[_0xa2f3('0x30')](_0xa56b5d[_0xa2f3('0x2d')],_0xa56b5d[_0xa2f3('0x2f')]);_0x5c8eea[_0xa2f3('0x31')]=_['intersection'](_0xa56b5d[_0xa2f3('0x2d')],qs['fields'](_0x1f173b['query']['fields']));_0x5c8eea[_0xa2f3('0x31')]=_0x5c8eea[_0xa2f3('0x31')][_0xa2f3('0x32')]?_0x5c8eea[_0xa2f3('0x31')]:_0xa56b5d[_0xa2f3('0x2d')];if(!_0x1f173b[_0xa2f3('0x2f')]['hasOwnProperty']('nolimit')){_0x5c8eea[_0xa2f3('0x1b')]=qs['limit'](_0x1f173b[_0xa2f3('0x2f')][_0xa2f3('0x1b')]);_0x5c8eea[_0xa2f3('0x1c')]=qs[_0xa2f3('0x1c')](_0x1f173b['query']['offset']);}_0x5c8eea[_0xa2f3('0x33')]=qs[_0xa2f3('0x34')](_0x1f173b[_0xa2f3('0x2f')][_0xa2f3('0x34')]);_0x5c8eea['where']=qs[_0xa2f3('0x35')](_[_0xa2f3('0x36')](_0x1f173b[_0xa2f3('0x2f')],_0xa56b5d[_0xa2f3('0x35')]),_0x430a6e);if(_0x1f173b[_0xa2f3('0x2f')]['filter']){_0x5c8eea[_0xa2f3('0x37')]=_[_0xa2f3('0x38')](_0x5c8eea[_0xa2f3('0x37')],{'$or':_[_0xa2f3('0x2e')](_0x430a6e,function(_0x1953c9){if(_0x1953c9[_0xa2f3('0x2c')]!==_0xa2f3('0x39')){var _0x59b37e={};_0x59b37e[_0x1953c9['name']]={'$like':'%'+_0x1f173b[_0xa2f3('0x2f')][_0xa2f3('0x3a')]+'%'};return _0x59b37e;}})});}_0x5c8eea=_[_0xa2f3('0x38')]({},_0x5c8eea,_0x1f173b['options']);var _0xf54d53={'where':_0x5c8eea[_0xa2f3('0x37')]};return db[_0xa2f3('0x29')][_0xa2f3('0x3b')](_0xf54d53)[_0xa2f3('0x21')](function(_0x540f21){_0x3fb828[_0xa2f3('0x3b')]=_0x540f21;if(_0x1f173b[_0xa2f3('0x2f')]['includeAll']){_0x5c8eea['include']=[{'all':!![]}];}return db[_0xa2f3('0x29')][_0xa2f3('0x3c')](_0x5c8eea);})[_0xa2f3('0x21')](function(_0xd4a035){_0x3fb828[_0xa2f3('0x3d')]=_0xd4a035;return _0x3fb828;})[_0xa2f3('0x21')](respondWithFilteredResult(_0x3de921,_0x5c8eea))[_0xa2f3('0x3e')](handleError(_0x3de921,null));};exports[_0xa2f3('0x3f')]=function(_0xd45cf3,_0x56676b){var _0x4a0b0a={'raw':!![],'where':{'id':_0xd45cf3[_0xa2f3('0x40')]['id']}},_0x19482c={};_0x19482c[_0xa2f3('0x2d')]=_[_0xa2f3('0x41')](db[_0xa2f3('0x29')][_0xa2f3('0x2a')]);_0x19482c[_0xa2f3('0x2f')]=_[_0xa2f3('0x41')](_0xd45cf3[_0xa2f3('0x2f')]);_0x19482c[_0xa2f3('0x35')]=_[_0xa2f3('0x30')](_0x19482c['model'],_0x19482c['query']);_0x4a0b0a['attributes']=_[_0xa2f3('0x30')](_0x19482c[_0xa2f3('0x2d')],qs[_0xa2f3('0x42')](_0xd45cf3[_0xa2f3('0x2f')][_0xa2f3('0x42')]));_0x4a0b0a[_0xa2f3('0x31')]=_0x4a0b0a[_0xa2f3('0x31')][_0xa2f3('0x32')]?_0x4a0b0a['attributes']:_0x19482c[_0xa2f3('0x2d')];if(_0xd45cf3[_0xa2f3('0x2f')][_0xa2f3('0x43')]){_0x4a0b0a[_0xa2f3('0x44')]=[{'all':!![]}];}_0x4a0b0a=_[_0xa2f3('0x38')]({},_0x4a0b0a,_0xd45cf3[_0xa2f3('0x45')]);return db[_0xa2f3('0x29')][_0xa2f3('0x46')](_0x4a0b0a)[_0xa2f3('0x21')](handleEntityNotFound(_0x56676b,null))[_0xa2f3('0x21')](respondWithResult(_0x56676b,null))['catch'](handleError(_0x56676b,null));};exports[_0xa2f3('0x47')]=function(_0x4119e5,_0x1f0869){return db[_0xa2f3('0x29')][_0xa2f3('0x47')](_0x4119e5[_0xa2f3('0x48')],{})[_0xa2f3('0x21')](respondWithResult(_0x1f0869,0xc9))[_0xa2f3('0x3e')](handleError(_0x1f0869,null));};exports[_0xa2f3('0x20')]=function(_0x39b3ad,_0x23dd88){if(_0x39b3ad[_0xa2f3('0x48')]['id']){delete _0x39b3ad['body']['id'];}return db[_0xa2f3('0x29')][_0xa2f3('0x46')]({'where':{'id':_0x39b3ad[_0xa2f3('0x40')]['id']}})[_0xa2f3('0x21')](handleEntityNotFound(_0x23dd88,null))['then'](saveUpdates(_0x39b3ad['body'],null))[_0xa2f3('0x21')](respondWithResult(_0x23dd88,null))[_0xa2f3('0x3e')](handleError(_0x23dd88,null));};exports[_0xa2f3('0x49')]=function(_0xe6c854,_0x176066){return db['MailTransferReport'][_0xa2f3('0x46')]({'where':{'id':_0xe6c854['params']['id']}})[_0xa2f3('0x21')](handleEntityNotFound(_0x176066,null))[_0xa2f3('0x21')](removeEntity(_0x176066,null))[_0xa2f3('0x3e')](handleError(_0x176066,null));};exports[_0xa2f3('0x4a')]=function(_0x5437a0,_0x1430d9){return db[_0xa2f3('0x29')]['describe']()[_0xa2f3('0x21')](respondWithResult(_0x1430d9,null))[_0xa2f3('0x3e')](handleError(_0x1430d9,null));}; \ No newline at end of file +var _0xb3b0=['sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','MailTransferReport','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','body','find','describe','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x1c2847,_0x59751b){var _0x16672=function(_0x5b1cdb){while(--_0x5b1cdb){_0x1c2847['push'](_0x1c2847['shift']());}};_0x16672(++_0x59751b);}(_0xb3b0,0x1b3));var _0x0b3b=function(_0x30412c,_0x392ba3){_0x30412c=_0x30412c-0x0;var _0x2aa3dd=_0xb3b0[_0x30412c];return _0x2aa3dd;};'use strict';var emlformat=require(_0x0b3b('0x0'));var rimraf=require(_0x0b3b('0x1'));var zipdir=require(_0x0b3b('0x2'));var jsonpatch=require(_0x0b3b('0x3'));var rp=require(_0x0b3b('0x4'));var moment=require(_0x0b3b('0x5'));var BPromise=require(_0x0b3b('0x6'));var Mustache=require(_0x0b3b('0x7'));var util=require(_0x0b3b('0x8'));var path=require(_0x0b3b('0x9'));var sox=require(_0x0b3b('0xa'));var csv=require(_0x0b3b('0xb'));var ejs=require(_0x0b3b('0xc'));var fs=require('fs');var fs_extra=require(_0x0b3b('0xd'));var _=require(_0x0b3b('0xe'));var squel=require(_0x0b3b('0xf'));var crypto=require(_0x0b3b('0x10'));var jsforce=require(_0x0b3b('0x11'));var deskjs=require(_0x0b3b('0x12'));var toCsv=require(_0x0b3b('0xb'));var querystring=require(_0x0b3b('0x13'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0b3b('0x14'));var qs=require(_0x0b3b('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b3b('0x16'));var logger=require(_0x0b3b('0x17'))(_0x0b3b('0x18'));var utils=require('../../config/utils');var config=require(_0x0b3b('0x19'));var licenseUtil=require(_0x0b3b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e2251,_0x3f0123){_0x3f0123=_0x3f0123||0xcc;return function(_0x193a4d){if(_0x193a4d){return _0x2e2251[_0x0b3b('0x1b')](_0x3f0123);}return _0x2e2251[_0x0b3b('0x1c')](_0x3f0123)[_0x0b3b('0x1d')]();};}function respondWithResult(_0x129456,_0xda6c44){_0xda6c44=_0xda6c44||0xc8;return function(_0x4b5ea6){if(_0x4b5ea6){return _0x129456[_0x0b3b('0x1c')](_0xda6c44)[_0x0b3b('0x1e')](_0x4b5ea6);}};}function respondWithFilteredResult(_0x57d753,_0x3e6251){return function(_0x417b8c){if(_0x417b8c){var _0x119d0f=typeof _0x3e6251['offset']==='undefined'&&typeof _0x3e6251['limit']===_0x0b3b('0x1f');var _0x111fdf=_0x417b8c[_0x0b3b('0x20')];var _0x2091e2=_0x119d0f?0x0:_0x3e6251['offset'];var _0x1a26f2=_0x119d0f?_0x417b8c[_0x0b3b('0x20')]:_0x3e6251[_0x0b3b('0x21')]+_0x3e6251[_0x0b3b('0x22')];var _0x5f588c;if(_0x1a26f2>=_0x111fdf){_0x1a26f2=_0x111fdf;_0x5f588c=0xc8;}else{_0x5f588c=0xce;}_0x57d753[_0x0b3b('0x1c')](_0x5f588c);return _0x57d753[_0x0b3b('0x23')](_0x0b3b('0x24'),_0x2091e2+'-'+_0x1a26f2+'/'+_0x111fdf)[_0x0b3b('0x1e')](_0x417b8c);}return null;};}function patchUpdates(_0xbf90f2){return function(_0x5f485f){try{jsonpatch[_0x0b3b('0x25')](_0x5f485f,_0xbf90f2,!![]);}catch(_0x286fe4){return BPromise[_0x0b3b('0x26')](_0x286fe4);}return _0x5f485f[_0x0b3b('0x27')]();};}function saveUpdates(_0x2333b5,_0x1ecc5d){return function(_0x2c7cdd){if(_0x2c7cdd){return _0x2c7cdd[_0x0b3b('0x28')](_0x2333b5)[_0x0b3b('0x29')](function(_0x1e2c57){return _0x1e2c57;});}return null;};}function removeEntity(_0x5a9575,_0x5d736b){return function(_0x3321a3){if(_0x3321a3){return _0x3321a3[_0x0b3b('0x2a')]()[_0x0b3b('0x29')](function(){_0x5a9575[_0x0b3b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f8a9b,_0x1e277f){return function(_0x32f4c9){if(!_0x32f4c9){_0x4f8a9b[_0x0b3b('0x1b')](0x194);}return _0x32f4c9;};}function handleError(_0x33c6b5,_0x291a45){_0x291a45=_0x291a45||0x1f4;return function(_0x31b7b7){logger[_0x0b3b('0x2b')](_0x31b7b7[_0x0b3b('0x2c')]);if(_0x31b7b7['name']){delete _0x31b7b7[_0x0b3b('0x2d')];}_0x33c6b5[_0x0b3b('0x1c')](_0x291a45)['send'](_0x31b7b7);};}exports[_0x0b3b('0x2e')]=function(_0x2ba99b,_0xd23b6){var _0x4acc68={},_0x15ff1c={},_0x2f3641={'count':0x0,'rows':[]};var _0x4b5057=_[_0x0b3b('0x2f')](db[_0x0b3b('0x30')]['rawAttributes'],function(_0x32f5f1){return{'name':_0x32f5f1['fieldName'],'type':_0x32f5f1['type'][_0x0b3b('0x31')]};});_0x15ff1c[_0x0b3b('0x32')]=_[_0x0b3b('0x2f')](_0x4b5057,'name');_0x15ff1c[_0x0b3b('0x33')]=_[_0x0b3b('0x34')](_0x2ba99b[_0x0b3b('0x33')]);_0x15ff1c[_0x0b3b('0x35')]=_[_0x0b3b('0x36')](_0x15ff1c['model'],_0x15ff1c[_0x0b3b('0x33')]);_0x4acc68['attributes']=_[_0x0b3b('0x36')](_0x15ff1c['model'],qs[_0x0b3b('0x37')](_0x2ba99b[_0x0b3b('0x33')][_0x0b3b('0x37')]));_0x4acc68['attributes']=_0x4acc68[_0x0b3b('0x38')][_0x0b3b('0x39')]?_0x4acc68['attributes']:_0x15ff1c[_0x0b3b('0x32')];if(!_0x2ba99b[_0x0b3b('0x33')][_0x0b3b('0x3a')]('nolimit')){_0x4acc68['limit']=qs[_0x0b3b('0x22')](_0x2ba99b[_0x0b3b('0x33')][_0x0b3b('0x22')]);_0x4acc68[_0x0b3b('0x21')]=qs[_0x0b3b('0x21')](_0x2ba99b[_0x0b3b('0x33')][_0x0b3b('0x21')]);}_0x4acc68[_0x0b3b('0x3b')]=qs[_0x0b3b('0x3c')](_0x2ba99b[_0x0b3b('0x33')][_0x0b3b('0x3c')]);_0x4acc68[_0x0b3b('0x3d')]=qs['filters'](_['pick'](_0x2ba99b[_0x0b3b('0x33')],_0x15ff1c[_0x0b3b('0x35')]),_0x4b5057);if(_0x2ba99b[_0x0b3b('0x33')][_0x0b3b('0x3e')]){_0x4acc68[_0x0b3b('0x3d')]=_[_0x0b3b('0x3f')](_0x4acc68['where'],{'$or':_[_0x0b3b('0x2f')](_0x4b5057,function(_0x2221d7){if(_0x2221d7[_0x0b3b('0x40')]!==_0x0b3b('0x41')){var _0x2417ed={};_0x2417ed[_0x2221d7['name']]={'$like':'%'+_0x2ba99b[_0x0b3b('0x33')][_0x0b3b('0x3e')]+'%'};return _0x2417ed;}})});}_0x4acc68=_['merge']({},_0x4acc68,_0x2ba99b[_0x0b3b('0x42')]);var _0x484988={'where':_0x4acc68[_0x0b3b('0x3d')]};return db[_0x0b3b('0x30')][_0x0b3b('0x20')](_0x484988)['then'](function(_0x3d40a9){_0x2f3641['count']=_0x3d40a9;if(_0x2ba99b[_0x0b3b('0x33')][_0x0b3b('0x43')]){_0x4acc68[_0x0b3b('0x44')]=[{'all':!![]}];}return db[_0x0b3b('0x30')][_0x0b3b('0x45')](_0x4acc68);})[_0x0b3b('0x29')](function(_0x292786){_0x2f3641['rows']=_0x292786;return _0x2f3641;})[_0x0b3b('0x29')](respondWithFilteredResult(_0xd23b6,_0x4acc68))[_0x0b3b('0x46')](handleError(_0xd23b6,null));};exports[_0x0b3b('0x47')]=function(_0x4d2781,_0xd8b315){var _0x26664e={'raw':!![],'where':{'id':_0x4d2781[_0x0b3b('0x48')]['id']}},_0x31ceef={};_0x31ceef['model']=_[_0x0b3b('0x34')](db['MailTransferReport'][_0x0b3b('0x49')]);_0x31ceef[_0x0b3b('0x33')]=_[_0x0b3b('0x34')](_0x4d2781['query']);_0x31ceef[_0x0b3b('0x35')]=_[_0x0b3b('0x36')](_0x31ceef[_0x0b3b('0x32')],_0x31ceef['query']);_0x26664e[_0x0b3b('0x38')]=_['intersection'](_0x31ceef['model'],qs[_0x0b3b('0x37')](_0x4d2781['query']['fields']));_0x26664e[_0x0b3b('0x38')]=_0x26664e[_0x0b3b('0x38')][_0x0b3b('0x39')]?_0x26664e[_0x0b3b('0x38')]:_0x31ceef['model'];if(_0x4d2781[_0x0b3b('0x33')][_0x0b3b('0x43')]){_0x26664e[_0x0b3b('0x44')]=[{'all':!![]}];}_0x26664e=_[_0x0b3b('0x3f')]({},_0x26664e,_0x4d2781['options']);return db[_0x0b3b('0x30')]['find'](_0x26664e)[_0x0b3b('0x29')](handleEntityNotFound(_0xd8b315,null))['then'](respondWithResult(_0xd8b315,null))[_0x0b3b('0x46')](handleError(_0xd8b315,null));};exports['create']=function(_0x4332e1,_0x10a3f6){return db['MailTransferReport']['create'](_0x4332e1['body'],{})[_0x0b3b('0x29')](respondWithResult(_0x10a3f6,0xc9))[_0x0b3b('0x46')](handleError(_0x10a3f6,null));};exports[_0x0b3b('0x28')]=function(_0x3d969c,_0x43e914){if(_0x3d969c[_0x0b3b('0x4a')]['id']){delete _0x3d969c[_0x0b3b('0x4a')]['id'];}return db[_0x0b3b('0x30')][_0x0b3b('0x4b')]({'where':{'id':_0x3d969c[_0x0b3b('0x48')]['id']}})[_0x0b3b('0x29')](handleEntityNotFound(_0x43e914,null))[_0x0b3b('0x29')](saveUpdates(_0x3d969c[_0x0b3b('0x4a')],null))['then'](respondWithResult(_0x43e914,null))[_0x0b3b('0x46')](handleError(_0x43e914,null));};exports['destroy']=function(_0x30101a,_0x96078d){return db[_0x0b3b('0x30')][_0x0b3b('0x4b')]({'where':{'id':_0x30101a['params']['id']}})[_0x0b3b('0x29')](handleEntityNotFound(_0x96078d,null))['then'](removeEntity(_0x96078d,null))[_0x0b3b('0x46')](handleError(_0x96078d,null));};exports[_0x0b3b('0x4c')]=function(_0x1e163e,_0x22ef3f){return db[_0x0b3b('0x30')][_0x0b3b('0x4c')]()[_0x0b3b('0x29')](respondWithResult(_0x22ef3f,null))[_0x0b3b('0x46')](handleError(_0x22ef3f,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 2801262..6a7c0cb 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 _0x84e7=['report_mail_transfer','uniqueid','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0x46ab4c,_0x561ca8){var _0x4ef7e1=function(_0x56c4c2){while(--_0x56c4c2){_0x46ab4c['push'](_0x46ab4c['shift']());}};_0x4ef7e1(++_0x561ca8);}(_0x84e7,0x122));var _0x784e=function(_0x2fcf52,_0x19b8e0){_0x2fcf52=_0x2fcf52-0x0;var _0x478580=_0x84e7[_0x2fcf52];return _0x478580;};'use strict';var _=require('lodash');var util=require(_0x784e('0x0'));var logger=require(_0x784e('0x1'))('api');var moment=require(_0x784e('0x2'));var BPromise=require(_0x784e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x784e('0x4'));var rimraf=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var attributes=require(_0x784e('0x7'));module[_0x784e('0x8')]=function(_0x133296,_0x48ed22){return _0x133296[_0x784e('0x9')]('MailTransferReport',attributes,{'tableName':_0x784e('0xa'),'paranoid':![],'indexes':[{'name':_0x784e('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','lodash','util','moment'];(function(_0x40eb1d,_0x35c52d){var _0x5023e8=function(_0x347464){while(--_0x347464){_0x40eb1d['push'](_0x40eb1d['shift']());}};_0x5023e8(++_0x35c52d);}(_0xe14b,0x93));var _0xbe14=function(_0x145d55,_0x58ad79){_0x145d55=_0x145d55-0x0;var _0x488aa6=_0xe14b[_0x145d55];return _0x488aa6;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index c75bfe3..5179d57 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 _0x8957=['MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8957,0x167));var _0x7895=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x8957[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x7895('0x0'));var util=require('util');var moment=require(_0x7895('0x1'));var BPromise=require(_0x7895('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7895('0x3'));var db=require(_0x7895('0x4'))['db'];var utils=require(_0x7895('0x5'));var logger=require(_0x7895('0x6'))(_0x7895('0x7'));var config=require(_0x7895('0x8'));var jayson=require(_0x7895('0x9'));var client=jayson[_0x7895('0xa')][_0x7895('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19728a,_0x1e3a17,_0x42241b){return new BPromise(function(_0x1bab40,_0x2817d7){return client['request'](_0x19728a,_0x42241b)['then'](function(_0x4d188d){logger[_0x7895('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x1e3a17,_0x7895('0xd'));logger[_0x7895('0xe')](_0x7895('0xf'),_0x1e3a17,_0x7895('0xd'),JSON[_0x7895('0x10')](_0x4d188d));if(_0x4d188d[_0x7895('0x11')]){if(_0x4d188d[_0x7895('0x11')][_0x7895('0x12')]===0x1f4){logger[_0x7895('0x11')](_0x7895('0x13'),_0x1e3a17,_0x4d188d[_0x7895('0x11')]['message']);return _0x2817d7(_0x4d188d[_0x7895('0x11')]['message']);}logger[_0x7895('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x1e3a17,_0x4d188d[_0x7895('0x11')][_0x7895('0x14')]);return _0x1bab40(_0x4d188d['error'][_0x7895('0x14')]);}else{logger[_0x7895('0xc')](_0x7895('0x13'),_0x1e3a17,_0x7895('0xd'));_0x1bab40(_0x4d188d[_0x7895('0x15')][_0x7895('0x14')]);}})['catch'](function(_0x468322){logger['error'](_0x7895('0x13'),_0x1e3a17,_0x468322);_0x2817d7(_0x468322);});});} \ No newline at end of file +var _0xdeae=['MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xdeae,0xe5));var _0xedea=function(_0x168cd7,_0x1faa84){_0x168cd7=_0x168cd7-0x0;var _0x512a7=_0xdeae[_0x168cd7];return _0x512a7;};'use strict';var _=require('lodash');var util=require(_0xedea('0x0'));var moment=require(_0xedea('0x1'));var BPromise=require(_0xedea('0x2'));var rs=require(_0xedea('0x3'));var fs=require('fs');var Redis=require(_0xedea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xedea('0x5'));var logger=require(_0xedea('0x6'))(_0xedea('0x7'));var config=require(_0xedea('0x8'));var jayson=require(_0xedea('0x9'));var client=jayson[_0xedea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x388f5b,_0x4709f0,_0x1f77bb){return new BPromise(function(_0x389bb,_0x5d5803){return client[_0xedea('0xb')](_0x388f5b,_0x1f77bb)['then'](function(_0x2c90c2){logger[_0xedea('0xc')](_0xedea('0xd'),_0x4709f0,_0xedea('0xe'));logger[_0xedea('0xf')](_0xedea('0x10'),_0x4709f0,'request\x20sent',JSON[_0xedea('0x11')](_0x2c90c2));if(_0x2c90c2[_0xedea('0x12')]){if(_0x2c90c2[_0xedea('0x12')][_0xedea('0x13')]===0x1f4){logger[_0xedea('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x4709f0,_0x2c90c2['error']['message']);return _0x5d5803(_0x2c90c2[_0xedea('0x12')][_0xedea('0x14')]);}logger[_0xedea('0x12')](_0xedea('0xd'),_0x4709f0,_0x2c90c2[_0xedea('0x12')][_0xedea('0x14')]);return _0x389bb(_0x2c90c2[_0xedea('0x12')][_0xedea('0x14')]);}else{logger[_0xedea('0xc')](_0xedea('0xd'),_0x4709f0,_0xedea('0xe'));_0x389bb(_0x2c90c2[_0xedea('0x15')][_0xedea('0x14')]);}})['catch'](function(_0xd5ac62){logger['error'](_0xedea('0xd'),_0x4709f0,_0xd5ac62);_0x5d5803(_0xd5ac62);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index dfcb49e..8cb47f8 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 _0xcd16=['create','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post'];(function(_0x5b1b21,_0x26c3e8){var _0x4e0d1a=function(_0x5f227b){while(--_0x5f227b){_0x5b1b21['push'](_0x5b1b21['shift']());}};_0x4e0d1a(++_0x26c3e8);}(_0xcd16,0x12a));var _0x6cd1=function(_0x4dc023,_0x15e381){_0x4dc023=_0x4dc023-0x0;var _0x147063=_0xcd16[_0x4dc023];return _0x147063;};'use strict';var multer=require('multer');var util=require(_0x6cd1('0x0'));var path=require(_0x6cd1('0x1'));var timeout=require(_0x6cd1('0x2'));var express=require(_0x6cd1('0x3'));var router=express['Router']();var fs_extra=require(_0x6cd1('0x4'));var auth=require(_0x6cd1('0x5'));var interaction=require(_0x6cd1('0x6'));var config=require(_0x6cd1('0x7'));var controller=require(_0x6cd1('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6cd1('0x9')]);router[_0x6cd1('0xa')](_0x6cd1('0xb'),auth['isAuthenticated'](),controller[_0x6cd1('0xc')]);router[_0x6cd1('0xa')](_0x6cd1('0xd'),auth[_0x6cd1('0xe')](),controller[_0x6cd1('0xf')]);router[_0x6cd1('0x10')]('/',auth[_0x6cd1('0xe')](),controller[_0x6cd1('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6cd1('0x12')]);router['delete'](_0x6cd1('0xd'),auth[_0x6cd1('0xe')](),controller[_0x6cd1('0x13')]);module[_0x6cd1('0x14')]=router; \ No newline at end of file +var _0x7d20=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','show','post','/:id','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d20,0x1c8));var _0x07d2=function(_0x426f1e,_0x20496a){_0x426f1e=_0x426f1e-0x0;var _0x3c3281=_0x7d20[_0x426f1e];return _0x3c3281;};'use strict';var multer=require(_0x07d2('0x0'));var util=require(_0x07d2('0x1'));var path=require('path');var timeout=require(_0x07d2('0x2'));var express=require(_0x07d2('0x3'));var router=express[_0x07d2('0x4')]();var fs_extra=require(_0x07d2('0x5'));var auth=require(_0x07d2('0x6'));var interaction=require(_0x07d2('0x7'));var config=require(_0x07d2('0x8'));var controller=require(_0x07d2('0x9'));router[_0x07d2('0xa')]('/',auth[_0x07d2('0xb')](),controller[_0x07d2('0xc')]);router[_0x07d2('0xa')](_0x07d2('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x07d2('0xa')]('/:id',auth[_0x07d2('0xb')](),controller[_0x07d2('0xe')]);router[_0x07d2('0xf')]('/',auth[_0x07d2('0xb')](),controller['create']);router['put'](_0x07d2('0x10'),auth['isAuthenticated'](),controller[_0x07d2('0x11')]);router['delete'](_0x07d2('0x10'),auth['isAuthenticated'](),controller[_0x07d2('0x12')]);module[_0x07d2('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 4aa0777..f308176 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 _0xf696=['STRING','DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','INTEGER','sequelize','exports'];(function(_0x44e63a,_0xc23bce){var _0x35d870=function(_0x50e4bf){while(--_0x50e4bf){_0x44e63a['push'](_0x44e63a['shift']());}};_0x35d870(++_0xc23bce);}(_0xf696,0x10e));var _0x6f69=function(_0x1053b3,_0x4d328d){_0x1053b3=_0x1053b3-0x0;var _0x55db36=_0xf696[_0x1053b3];return _0x55db36;};'use strict';var Sequelize=require(_0x6f69('0x0'));var moment=require('moment');module[_0x6f69('0x1')]={'channel':{'type':Sequelize[_0x6f69('0x2')]},'membername':{'type':Sequelize[_0x6f69('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6f69('0x2')],'defaultValue':_0x6f69('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x6f69('0x4')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0xa45e99){var _0x5a7208=moment(_0xa45e99);var _0x11fc78=moment(this[_0x6f69('0x5')](_0x6f69('0x6')));var _0x4c1b87=_0x5a7208[_0x6f69('0x7')](_0x11fc78,_0x6f69('0x8'));this[_0x6f69('0x9')](_0x6f69('0xa'),_0xa45e99);this[_0x6f69('0x9')](_0x6f69('0xb'),_0x4c1b87>=0x0?_0x4c1b87:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x6f69('0xc')},'data2':{'type':Sequelize[_0x6f69('0x2')],'comment':_0x6f69('0xd')},'data3':{'type':Sequelize[_0x6f69('0x2')],'comment':_0x6f69('0xe')},'data4':{'type':Sequelize[_0x6f69('0x2')],'comment':_0x6f69('0xf')},'data5':{'type':Sequelize[_0x6f69('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x6f69('0x2')]},'internal':{'type':Sequelize[_0x6f69('0x10')]},'uniqueid':{'type':Sequelize[_0x6f69('0x2')]}}; \ No newline at end of file +var _0x2b3d=['exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[queue]'];(function(_0x330706,_0x49ebd2){var _0x244995=function(_0x5b8866){while(--_0x5b8866){_0x330706['push'](_0x330706['shift']());}};_0x244995(++_0x49ebd2);}(_0x2b3d,0xb4));var _0xd2b3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2b3d[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xd2b3('0x0')]={'channel':{'type':Sequelize[_0xd2b3('0x1')]},'membername':{'type':Sequelize[_0xd2b3('0x1')]},'interface':{'type':Sequelize[_0xd2b3('0x1')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xd2b3('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xd2b3('0x3')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd2b3('0x4')],'set':function(_0x5b49d7){var _0x598ad1=moment(_0x5b49d7);var _0x4b2d31=moment(this[_0xd2b3('0x5')](_0xd2b3('0x6')));var _0x18ecb1=_0x598ad1[_0xd2b3('0x7')](_0x4b2d31,_0xd2b3('0x8'));this[_0xd2b3('0x9')](_0xd2b3('0xa'),_0x5b49d7);this[_0xd2b3('0x9')](_0xd2b3('0xb'),_0x18ecb1>=0x0?_0x18ecb1:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xd2b3('0xc')},'data2':{'type':Sequelize[_0xd2b3('0x1')],'comment':_0xd2b3('0xd')},'data3':{'type':Sequelize[_0xd2b3('0x1')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xd2b3('0x1')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xd2b3('0x1')],'comment':_0xd2b3('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xd2b3('0x3')]},'uniqueid':{'type':Sequelize[_0xd2b3('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index ed4fc7c..b9dfa99 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 _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x24e4ef,_0x5581ff){var _0x498021=function(_0x580466){while(--_0x580466){_0x24e4ef['push'](_0x24e4ef['shift']());}};_0x498021(++_0x5581ff);}(_0x7217,0x19e));var _0x7721=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x7217[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));}; \ No newline at end of file +var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xedd9,0xfc));var _0x9edd=function(_0x5c2a51,_0x3678f1){_0x5c2a51=_0x5c2a51-0x0;var _0x157df4=_0xedd9[_0x5c2a51];return _0x157df4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index f5b08dd..f8da766 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 _0xe364=['exports','report_member','membername','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./memberReport.attributes'];(function(_0x273b44,_0x2acc30){var _0x2321c1=function(_0x409c16){while(--_0x409c16){_0x273b44['push'](_0x273b44['shift']());}};_0x2321c1(++_0x2acc30);}(_0xe364,0x1ed));var _0x4e36=function(_0x1de43c,_0xaa29de){_0x1de43c=_0x1de43c-0x0;var _0x296d3e=_0xe364[_0x1de43c];return _0x296d3e;};'use strict';var _=require(_0x4e36('0x0'));var util=require('util');var logger=require(_0x4e36('0x1'))(_0x4e36('0x2'));var moment=require(_0x4e36('0x3'));var BPromise=require('bluebird');var rp=require(_0x4e36('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4e36('0x5'));var attributes=require(_0x4e36('0x6'));module[_0x4e36('0x7')]=function(_0x2f9c48,_0x3c5633){return _0x2f9c48['define']('MemberReport',attributes,{'tableName':_0x4e36('0x8'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x4e36('0x9'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b07=['request-promise','path','rimraf','../../config/environment','exports','define','MemberReport','membername_interface','membername','interface','lodash','util','../../config/logger','bluebird'];(function(_0x44429a,_0x45ee8b){var _0x3a1a72=function(_0x4d3c9c){while(--_0x4d3c9c){_0x44429a['push'](_0x44429a['shift']());}};_0x3a1a72(++_0x45ee8b);}(_0x1b07,0x1ca));var _0x71b0=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x1b07[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0x71b0('0x0'));var util=require(_0x71b0('0x1'));var logger=require(_0x71b0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x71b0('0x3'));var rp=require(_0x71b0('0x4'));var fs=require('fs');var path=require(_0x71b0('0x5'));var rimraf=require(_0x71b0('0x6'));var config=require(_0x71b0('0x7'));var attributes=require('./memberReport.attributes');module[_0x71b0('0x8')]=function(_0x4e0da3,_0x225d7b){return _0x4e0da3[_0x71b0('0x9')](_0x71b0('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x71b0('0xb'),'fields':[_0x71b0('0xc'),_0x71b0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 2726e1f..84c55a9 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 _0xcfef=['options','where','include','map','attributes','model','info','CreateMemberReport','create','body','raw','UpdateMemberReport','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','then','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll'];(function(_0x5427ad,_0x5bc3d8){var _0x2ce28c=function(_0x57c7a0){while(--_0x57c7a0){_0x5427ad['push'](_0x5427ad['shift']());}};_0x2ce28c(++_0x5bc3d8);}(_0xcfef,0x1cc));var _0xfcfe=function(_0x124408,_0xa14998){_0x124408=_0x124408-0x0;var _0x3c9581=_0xcfef[_0x124408];return _0x3c9581;};'use strict';var _=require('lodash');var util=require(_0xfcfe('0x0'));var moment=require(_0xfcfe('0x1'));var BPromise=require(_0xfcfe('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(_0xfcfe('0x3'))(_0xfcfe('0x4'));var config=require(_0xfcfe('0x5'));var jayson=require(_0xfcfe('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2aecec,_0x584f29,_0x28fe66){return new BPromise(function(_0x1d7307,_0x39d07c){return client['request'](_0x2aecec,_0x28fe66)[_0xfcfe('0x7')](function(_0x5c6211){logger['info'](_0xfcfe('0x8'),_0x584f29,'request\x20sent');logger[_0xfcfe('0x9')](_0xfcfe('0xa'),_0x584f29,_0xfcfe('0xb'),JSON[_0xfcfe('0xc')](_0x5c6211));if(_0x5c6211[_0xfcfe('0xd')]){if(_0x5c6211[_0xfcfe('0xd')]['code']===0x1f4){logger[_0xfcfe('0xd')]('MemberReport,\x20%s,\x20%s',_0x584f29,_0x5c6211['error'][_0xfcfe('0xe')]);return _0x39d07c(_0x5c6211['error'][_0xfcfe('0xe')]);}logger[_0xfcfe('0xd')](_0xfcfe('0x8'),_0x584f29,_0x5c6211[_0xfcfe('0xd')][_0xfcfe('0xe')]);return _0x1d7307(_0x5c6211[_0xfcfe('0xd')][_0xfcfe('0xe')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x584f29,_0xfcfe('0xb'));_0x1d7307(_0x5c6211[_0xfcfe('0xf')][_0xfcfe('0xe')]);}})[_0xfcfe('0x10')](function(_0x5414b1){logger['error'](_0xfcfe('0x8'),_0x584f29,_0x5414b1);_0x39d07c(_0x5414b1);});});}exports[_0xfcfe('0x11')]=function(_0x4393e4){var _0x58dc99=this;return new Promise(function(_0x386a5d,_0x4c36b9){return db[_0xfcfe('0x12')][_0xfcfe('0x13')]({'raw':_0x4393e4['options']?_0x4393e4[_0xfcfe('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4393e4[_0xfcfe('0x14')]?_0x4393e4[_0xfcfe('0x14')][_0xfcfe('0x15')]||null:null,'attributes':_0x4393e4[_0xfcfe('0x14')]?_0x4393e4[_0xfcfe('0x14')]['attributes']||null:null,'limit':_0x4393e4[_0xfcfe('0x14')]?_0x4393e4['options']['limit']||null:null,'include':_0x4393e4[_0xfcfe('0x14')]?_0x4393e4[_0xfcfe('0x14')][_0xfcfe('0x16')]?_[_0xfcfe('0x17')](_0x4393e4[_0xfcfe('0x14')]['include'],function(_0x131384){return{'model':db[_0x131384['model']],'as':_0x131384['as'],'attributes':_0x131384[_0xfcfe('0x18')],'include':_0x131384[_0xfcfe('0x16')]?_[_0xfcfe('0x17')](_0x131384['include'],function(_0x3ebd99){return{'model':db[_0x3ebd99[_0xfcfe('0x19')]],'as':_0x3ebd99['as'],'attributes':_0x3ebd99[_0xfcfe('0x18')],'include':_0x3ebd99[_0xfcfe('0x16')]?_['map'](_0x3ebd99[_0xfcfe('0x16')],function(_0x24f3a7){return{'model':db[_0x24f3a7[_0xfcfe('0x19')]],'as':_0x24f3a7['as'],'attributes':_0x24f3a7[_0xfcfe('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfcfe('0x7')](function(_0x41e60d){logger[_0xfcfe('0x1a')](_0xfcfe('0x11'),_0x4393e4);logger[_0xfcfe('0x9')](_0xfcfe('0x11'),_0x4393e4,JSON[_0xfcfe('0xc')](_0x41e60d));_0x386a5d(_0x41e60d);})[_0xfcfe('0x10')](function(_0x12a91b){logger[_0xfcfe('0xd')](_0xfcfe('0x11'),_0x12a91b[_0xfcfe('0xe')],_0x4393e4);_0x4c36b9(_0x58dc99['error'](0x1f4,_0x12a91b[_0xfcfe('0xe')]));});});};exports[_0xfcfe('0x1b')]=function(_0x2c0998){var _0xa2c262=this;return new Promise(function(_0x1a7f54,_0x1d7134){return db[_0xfcfe('0x12')][_0xfcfe('0x1c')](_0x2c0998[_0xfcfe('0x1d')],{'raw':_0x2c0998[_0xfcfe('0x14')]?_0x2c0998['options'][_0xfcfe('0x1e')]===undefined?!![]:![]:!![]})[_0xfcfe('0x7')](function(_0x58e2e5){logger[_0xfcfe('0x1a')](_0xfcfe('0x1b'),_0x2c0998);logger[_0xfcfe('0x9')](_0xfcfe('0x1b'),_0x2c0998,JSON[_0xfcfe('0xc')](_0x58e2e5));_0x1a7f54(_0x58e2e5);})['catch'](function(_0x2ebb88){logger['error'](_0xfcfe('0x1b'),_0x2ebb88[_0xfcfe('0xe')],_0x2c0998);_0x1d7134(_0xa2c262[_0xfcfe('0xd')](0x1f4,_0x2ebb88[_0xfcfe('0xe')]));});});};exports[_0xfcfe('0x1f')]=function(_0x415996){var _0x46a7dc=this;return new Promise(function(_0x489709,_0x200109){return db['MemberReport']['update'](_0x415996[_0xfcfe('0x1d')],{'raw':_0x415996[_0xfcfe('0x14')]?_0x415996[_0xfcfe('0x14')][_0xfcfe('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x415996[_0xfcfe('0x14')]?_0x415996[_0xfcfe('0x14')][_0xfcfe('0x15')]||null:null,'attributes':_0x415996[_0xfcfe('0x14')]?_0x415996[_0xfcfe('0x14')][_0xfcfe('0x18')]||null:null,'limit':_0x415996[_0xfcfe('0x14')]?_0x415996[_0xfcfe('0x14')]['limit']||null:null})[_0xfcfe('0x7')](function(_0x321f42){logger[_0xfcfe('0x1a')](_0xfcfe('0x1f'),_0x415996);logger[_0xfcfe('0x9')](_0xfcfe('0x1f'),_0x415996,JSON['stringify'](_0x321f42));_0x489709(_0x321f42);})[_0xfcfe('0x10')](function(_0x33b884){logger[_0xfcfe('0xd')](_0xfcfe('0x1f'),_0x33b884[_0xfcfe('0xe')],_0x415996);_0x200109(_0x46a7dc[_0xfcfe('0xd')](0x1f4,_0x33b884['message']));});});}; \ No newline at end of file +var _0xcd59=['error','message','result','catch','GetMemberReport','MemberReport','options','raw','attributes','limit','include','model','map','CreateMemberReport','create','body','UpdateMemberReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x503490,_0x43a3c4){var _0x533e3d=function(_0x1b4821){while(--_0x1b4821){_0x503490['push'](_0x503490['shift']());}};_0x533e3d(++_0x43a3c4);}(_0xcd59,0x14b));var _0x9cd5=function(_0x254635,_0x472b4c){_0x254635=_0x254635-0x0;var _0x35293c=_0xcd59[_0x254635];return _0x35293c;};'use strict';var _=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var moment=require(_0x9cd5('0x2'));var BPromise=require(_0x9cd5('0x3'));var rs=require(_0x9cd5('0x4'));var fs=require('fs');var Redis=require(_0x9cd5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9cd5('0x6'));var logger=require(_0x9cd5('0x7'))(_0x9cd5('0x8'));var config=require(_0x9cd5('0x9'));var jayson=require(_0x9cd5('0xa'));var client=jayson[_0x9cd5('0xb')][_0x9cd5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2cd19a,_0x214256,_0x3f888f){return new BPromise(function(_0x545407,_0x10162d){return client[_0x9cd5('0xd')](_0x2cd19a,_0x3f888f)[_0x9cd5('0xe')](function(_0x23e524){logger[_0x9cd5('0xf')](_0x9cd5('0x10'),_0x214256,_0x9cd5('0x11'));logger[_0x9cd5('0x12')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x214256,_0x9cd5('0x11'),JSON[_0x9cd5('0x13')](_0x23e524));if(_0x23e524[_0x9cd5('0x14')]){if(_0x23e524[_0x9cd5('0x14')]['code']===0x1f4){logger['error'](_0x9cd5('0x10'),_0x214256,_0x23e524[_0x9cd5('0x14')][_0x9cd5('0x15')]);return _0x10162d(_0x23e524[_0x9cd5('0x14')][_0x9cd5('0x15')]);}logger[_0x9cd5('0x14')]('MemberReport,\x20%s,\x20%s',_0x214256,_0x23e524[_0x9cd5('0x14')][_0x9cd5('0x15')]);return _0x545407(_0x23e524[_0x9cd5('0x14')]['message']);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x214256,_0x9cd5('0x11'));_0x545407(_0x23e524[_0x9cd5('0x16')]['message']);}})[_0x9cd5('0x17')](function(_0x11a7d2){logger[_0x9cd5('0x14')]('MemberReport,\x20%s,\x20%s',_0x214256,_0x11a7d2);_0x10162d(_0x11a7d2);});});}exports[_0x9cd5('0x18')]=function(_0x2d1863){var _0x3a364f=this;return new Promise(function(_0x3a6f01,_0x21da57){return db[_0x9cd5('0x19')]['findAll']({'raw':_0x2d1863[_0x9cd5('0x1a')]?_0x2d1863[_0x9cd5('0x1a')][_0x9cd5('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d1863[_0x9cd5('0x1a')]?_0x2d1863[_0x9cd5('0x1a')]['where']||null:null,'attributes':_0x2d1863[_0x9cd5('0x1a')]?_0x2d1863[_0x9cd5('0x1a')][_0x9cd5('0x1c')]||null:null,'limit':_0x2d1863[_0x9cd5('0x1a')]?_0x2d1863[_0x9cd5('0x1a')][_0x9cd5('0x1d')]||null:null,'include':_0x2d1863[_0x9cd5('0x1a')]?_0x2d1863[_0x9cd5('0x1a')][_0x9cd5('0x1e')]?_['map'](_0x2d1863[_0x9cd5('0x1a')][_0x9cd5('0x1e')],function(_0x1a88e3){return{'model':db[_0x1a88e3[_0x9cd5('0x1f')]],'as':_0x1a88e3['as'],'attributes':_0x1a88e3['attributes'],'include':_0x1a88e3[_0x9cd5('0x1e')]?_[_0x9cd5('0x20')](_0x1a88e3[_0x9cd5('0x1e')],function(_0xe36f86){return{'model':db[_0xe36f86[_0x9cd5('0x1f')]],'as':_0xe36f86['as'],'attributes':_0xe36f86[_0x9cd5('0x1c')],'include':_0xe36f86[_0x9cd5('0x1e')]?_['map'](_0xe36f86[_0x9cd5('0x1e')],function(_0x64a1c4){return{'model':db[_0x64a1c4[_0x9cd5('0x1f')]],'as':_0x64a1c4['as'],'attributes':_0x64a1c4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e45a3){logger['info']('GetMemberReport',_0x2d1863);logger[_0x9cd5('0x12')](_0x9cd5('0x18'),_0x2d1863,JSON[_0x9cd5('0x13')](_0x2e45a3));_0x3a6f01(_0x2e45a3);})['catch'](function(_0x40461a){logger[_0x9cd5('0x14')](_0x9cd5('0x18'),_0x40461a[_0x9cd5('0x15')],_0x2d1863);_0x21da57(_0x3a364f[_0x9cd5('0x14')](0x1f4,_0x40461a[_0x9cd5('0x15')]));});});};exports[_0x9cd5('0x21')]=function(_0x9d054d){var _0x36b0ad=this;return new Promise(function(_0x1c81fd,_0x3dc2c0){return db[_0x9cd5('0x19')][_0x9cd5('0x22')](_0x9d054d[_0x9cd5('0x23')],{'raw':_0x9d054d['options']?_0x9d054d[_0x9cd5('0x1a')][_0x9cd5('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x589958){logger[_0x9cd5('0xf')](_0x9cd5('0x21'),_0x9d054d);logger['debug'](_0x9cd5('0x21'),_0x9d054d,JSON['stringify'](_0x589958));_0x1c81fd(_0x589958);})['catch'](function(_0x7622d8){logger[_0x9cd5('0x14')](_0x9cd5('0x21'),_0x7622d8[_0x9cd5('0x15')],_0x9d054d);_0x3dc2c0(_0x36b0ad['error'](0x1f4,_0x7622d8[_0x9cd5('0x15')]));});});};exports[_0x9cd5('0x24')]=function(_0x403779){var _0x5362f1=this;return new Promise(function(_0x201a54,_0x1f15fa){return db[_0x9cd5('0x19')][_0x9cd5('0x25')](_0x403779[_0x9cd5('0x23')],{'raw':_0x403779[_0x9cd5('0x1a')]?_0x403779[_0x9cd5('0x1a')][_0x9cd5('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x403779[_0x9cd5('0x1a')]?_0x403779[_0x9cd5('0x1a')][_0x9cd5('0x26')]||null:null,'attributes':_0x403779['options']?_0x403779[_0x9cd5('0x1a')]['attributes']||null:null,'limit':_0x403779['options']?_0x403779[_0x9cd5('0x1a')][_0x9cd5('0x1d')]||null:null})[_0x9cd5('0xe')](function(_0x18e616){logger['info'](_0x9cd5('0x24'),_0x403779);logger[_0x9cd5('0x12')](_0x9cd5('0x24'),_0x403779,JSON[_0x9cd5('0x13')](_0x18e616));_0x201a54(_0x18e616);})['catch'](function(_0x36e22c){logger[_0x9cd5('0x14')](_0x9cd5('0x24'),_0x36e22c[_0x9cd5('0x15')],_0x403779);_0x1f15fa(_0x5362f1[_0x9cd5('0x14')](0x1f4,_0x36e22c[_0x9cd5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index f745285..013f100 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 _0x2739=['fs-extra','../../components/interaction/service','index','exports','multer','path','connect-timeout'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2739,0x10e));var _0x9273=function(_0x3ba83d,_0x4c24ab){_0x3ba83d=_0x3ba83d-0x0;var _0x229478=_0x2739[_0x3ba83d];return _0x229478;};'use strict';var multer=require(_0x9273('0x0'));var util=require('util');var path=require(_0x9273('0x1'));var timeout=require(_0x9273('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9273('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9273('0x4'));var config=require('../../config/environment');var controller=require('./migration.controller');router['get']('/',controller[_0x9273('0x5')]);module[_0x9273('0x6')]=router; \ No newline at end of file +var _0x652f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./migration.controller','index','exports','util','connect-timeout'];(function(_0x4664f0,_0x588afb){var _0x18a311=function(_0x31186e){while(--_0x31186e){_0x4664f0['push'](_0x4664f0['shift']());}};_0x18a311(++_0x588afb);}(_0x652f,0xf1));var _0xf652=function(_0x5d6f30,_0x167b83){_0x5d6f30=_0x5d6f30-0x0;var _0x2977b6=_0x652f[_0x5d6f30];return _0x2977b6;};'use strict';var multer=require('multer');var util=require(_0xf652('0x0'));var path=require('path');var timeout=require(_0xf652('0x1'));var express=require('express');var router=express[_0xf652('0x2')]();var fs_extra=require(_0xf652('0x3'));var auth=require(_0xf652('0x4'));var interaction=require(_0xf652('0x5'));var config=require('../../config/environment');var controller=require(_0xf652('0x6'));router['get']('/',controller[_0xf652('0x7')]);module[_0xf652('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index c89d46c..bd33c94 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 _0x5d8e=['version','exports'];(function(_0x1722ff,_0x10f7ad){var _0x247293=function(_0x52fefc){while(--_0x52fefc){_0x1722ff['push'](_0x1722ff['shift']());}};_0x247293(++_0x10f7ad);}(_0x5d8e,0x1cb));var _0xe5d8=function(_0x290cbc,_0x4b1ef7){_0x290cbc=_0x290cbc-0x0;var _0x11ef9c=_0x5d8e[_0x290cbc];return _0x11ef9c;};'use strict';var Sequelize=require('sequelize');module[_0xe5d8('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0xe5d8('0x1')}}; \ No newline at end of file +var _0x9f9e=['exports','STRING','version','sequelize'];(function(_0xf0fe86,_0x9b8e69){var _0x2fe82c=function(_0x3c7549){while(--_0x3c7549){_0xf0fe86['push'](_0xf0fe86['shift']());}};_0x2fe82c(++_0x9b8e69);}(_0x9f9e,0x1bf));var _0xe9f9=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0x9f9e[_0x57486e];return _0x5f110b;};'use strict';var Sequelize=require(_0xe9f9('0x0'));module[_0xe9f9('0x1')]={'version':{'type':Sequelize[_0xe9f9('0x2')],'unique':_0xe9f9('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index b0dd68b..db65e31 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 _0xbd53=['ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','Migration','include','rows','rimraf','zip-dir','request-promise','moment','mustache','path'];(function(_0x257354,_0x59d591){var _0x54d46e=function(_0x4ffd83){while(--_0x4ffd83){_0x257354['push'](_0x257354['shift']());}};_0x54d46e(++_0x59d591);}(_0xbd53,0x7a));var _0x3bd5=function(_0x551940,_0x238fb6){_0x551940=_0x551940-0x0;var _0x3e9578=_0xbd53[_0x551940];return _0x3e9578;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bd5('0x0'));var zipdir=require(_0x3bd5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3bd5('0x2'));var moment=require(_0x3bd5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3bd5('0x4'));var util=require('util');var path=require(_0x3bd5('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3bd5('0x6'));var fs=require('fs');var fs_extra=require(_0x3bd5('0x7'));var _=require(_0x3bd5('0x8'));var squel=require(_0x3bd5('0x9'));var crypto=require(_0x3bd5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3bd5('0xb'));var toCsv=require(_0x3bd5('0xc'));var querystring=require(_0x3bd5('0xd'));var Papa=require(_0x3bd5('0xe'));var Redis=require(_0x3bd5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3bd5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bd5('0x11'));var logger=require(_0x3bd5('0x12'))(_0x3bd5('0x13'));var utils=require(_0x3bd5('0x14'));var config=require(_0x3bd5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3bd5('0x16'))['db'];function respondWithStatusCode(_0x4e5e87,_0x19b267){_0x19b267=_0x19b267||0xcc;return function(_0x223d53){if(_0x223d53){return _0x4e5e87[_0x3bd5('0x17')](_0x19b267);}return _0x4e5e87[_0x3bd5('0x18')](_0x19b267)[_0x3bd5('0x19')]();};}function respondWithResult(_0x4f6e6c,_0x52419f){_0x52419f=_0x52419f||0xc8;return function(_0x622625){if(_0x622625){return _0x4f6e6c[_0x3bd5('0x18')](_0x52419f)[_0x3bd5('0x1a')](_0x622625);}};}function respondWithFilteredResult(_0x5dce83,_0x149532){return function(_0x37a866){if(_0x37a866){var _0x8b66e9=typeof _0x149532[_0x3bd5('0x1b')]===_0x3bd5('0x1c')&&typeof _0x149532[_0x3bd5('0x1d')]===_0x3bd5('0x1c');var _0x435816=_0x37a866[_0x3bd5('0x1e')];var _0x18634c=_0x8b66e9?0x0:_0x149532['offset'];var _0x47929a=_0x8b66e9?_0x37a866[_0x3bd5('0x1e')]:_0x149532[_0x3bd5('0x1b')]+_0x149532[_0x3bd5('0x1d')];var _0x1d2427;if(_0x47929a>=_0x435816){_0x47929a=_0x435816;_0x1d2427=0xc8;}else{_0x1d2427=0xce;}_0x5dce83[_0x3bd5('0x18')](_0x1d2427);return _0x5dce83['set'](_0x3bd5('0x1f'),_0x18634c+'-'+_0x47929a+'/'+_0x435816)[_0x3bd5('0x1a')](_0x37a866);}return null;};}function patchUpdates(_0x5db307){return function(_0x486d7e){try{jsonpatch[_0x3bd5('0x20')](_0x486d7e,_0x5db307,!![]);}catch(_0x15b7cb){return BPromise['reject'](_0x15b7cb);}return _0x486d7e[_0x3bd5('0x21')]();};}function saveUpdates(_0x4ab7a0,_0x14cba5){return function(_0x202247){if(_0x202247){return _0x202247[_0x3bd5('0x22')](_0x4ab7a0)[_0x3bd5('0x23')](function(_0x191ba7){return _0x191ba7;});}return null;};}function removeEntity(_0x1d22d1,_0x1279d8){return function(_0x5962c8){if(_0x5962c8){return _0x5962c8['destroy']()['then'](function(){_0x1d22d1[_0x3bd5('0x18')](0xcc)[_0x3bd5('0x19')]();});}};}function handleEntityNotFound(_0x1fc037,_0x2694a5){return function(_0x1abfab){if(!_0x1abfab){_0x1fc037[_0x3bd5('0x17')](0x194);}return _0x1abfab;};}function handleError(_0x519751,_0x41fa7b){_0x41fa7b=_0x41fa7b||0x1f4;return function(_0x349cc6){logger[_0x3bd5('0x24')](_0x349cc6[_0x3bd5('0x25')]);if(_0x349cc6[_0x3bd5('0x26')]){delete _0x349cc6[_0x3bd5('0x26')];}_0x519751[_0x3bd5('0x18')](_0x41fa7b)['send'](_0x349cc6);};}exports[_0x3bd5('0x27')]=function(_0x1f6c9f,_0x4c9e60){var _0x135f2a={},_0x50aa9a={},_0x50499b={'count':0x0,'rows':[]};var _0x592860=_[_0x3bd5('0x28')](db['Migration'][_0x3bd5('0x29')],function(_0x26bc22){return{'name':_0x26bc22[_0x3bd5('0x2a')],'type':_0x26bc22[_0x3bd5('0x2b')][_0x3bd5('0x2c')]};});_0x50aa9a[_0x3bd5('0x2d')]=_[_0x3bd5('0x28')](_0x592860,_0x3bd5('0x26'));_0x50aa9a[_0x3bd5('0x2e')]=_[_0x3bd5('0x2f')](_0x1f6c9f[_0x3bd5('0x2e')]);_0x50aa9a[_0x3bd5('0x30')]=_[_0x3bd5('0x31')](_0x50aa9a[_0x3bd5('0x2d')],_0x50aa9a[_0x3bd5('0x2e')]);_0x135f2a[_0x3bd5('0x32')]=_[_0x3bd5('0x31')](_0x50aa9a['model'],qs[_0x3bd5('0x33')](_0x1f6c9f[_0x3bd5('0x2e')][_0x3bd5('0x33')]));_0x135f2a[_0x3bd5('0x32')]=_0x135f2a[_0x3bd5('0x32')][_0x3bd5('0x34')]?_0x135f2a[_0x3bd5('0x32')]:_0x50aa9a['model'];if(!_0x1f6c9f[_0x3bd5('0x2e')]['hasOwnProperty'](_0x3bd5('0x35'))){_0x135f2a[_0x3bd5('0x1d')]=qs[_0x3bd5('0x1d')](_0x1f6c9f[_0x3bd5('0x2e')][_0x3bd5('0x1d')]);_0x135f2a[_0x3bd5('0x1b')]=qs[_0x3bd5('0x1b')](_0x1f6c9f['query'][_0x3bd5('0x1b')]);}_0x135f2a[_0x3bd5('0x36')]=qs[_0x3bd5('0x37')](_0x1f6c9f[_0x3bd5('0x2e')]['sort']);_0x135f2a['where']=qs[_0x3bd5('0x30')](_[_0x3bd5('0x38')](_0x1f6c9f[_0x3bd5('0x2e')],_0x50aa9a['filters']),_0x592860);if(_0x1f6c9f[_0x3bd5('0x2e')][_0x3bd5('0x39')]){_0x135f2a[_0x3bd5('0x3a')]=_['merge'](_0x135f2a[_0x3bd5('0x3a')],{'$or':_[_0x3bd5('0x28')](_0x592860,function(_0x72bffa){if(_0x72bffa[_0x3bd5('0x2b')]!==_0x3bd5('0x3b')){var _0x17a8a8={};_0x17a8a8[_0x72bffa[_0x3bd5('0x26')]]={'$like':'%'+_0x1f6c9f['query'][_0x3bd5('0x39')]+'%'};return _0x17a8a8;}})});}_0x135f2a=_[_0x3bd5('0x3c')]({},_0x135f2a,_0x1f6c9f['options']);var _0x4d1e94={'where':_0x135f2a[_0x3bd5('0x3a')]};return db[_0x3bd5('0x3d')][_0x3bd5('0x1e')](_0x4d1e94)[_0x3bd5('0x23')](function(_0x26c319){_0x50499b[_0x3bd5('0x1e')]=_0x26c319;if(_0x1f6c9f[_0x3bd5('0x2e')]['includeAll']){_0x135f2a[_0x3bd5('0x3e')]=[{'all':!![]}];}return db[_0x3bd5('0x3d')]['findAll'](_0x135f2a);})[_0x3bd5('0x23')](function(_0x1371e4){_0x50499b[_0x3bd5('0x3f')]=_0x1371e4;return _0x50499b;})[_0x3bd5('0x23')](respondWithFilteredResult(_0x4c9e60,_0x135f2a))['catch'](handleError(_0x4c9e60,null));}; \ No newline at end of file +var _0xeeaa=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','Migration','findAll','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x339da3,_0x6cf9a8){var _0x2ed7c4=function(_0x588933){while(--_0x588933){_0x339da3['push'](_0x339da3['shift']());}};_0x2ed7c4(++_0x6cf9a8);}(_0xeeaa,0x1b7));var _0xaeea=function(_0x440305,_0x21d7b8){_0x440305=_0x440305-0x0;var _0x50a9f1=_0xeeaa[_0x440305];return _0x50a9f1;};'use strict';var emlformat=require(_0xaeea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaeea('0x1'));var jsonpatch=require(_0xaeea('0x2'));var rp=require(_0xaeea('0x3'));var moment=require(_0xaeea('0x4'));var BPromise=require(_0xaeea('0x5'));var Mustache=require(_0xaeea('0x6'));var util=require(_0xaeea('0x7'));var path=require(_0xaeea('0x8'));var sox=require(_0xaeea('0x9'));var csv=require(_0xaeea('0xa'));var ejs=require(_0xaeea('0xb'));var fs=require('fs');var fs_extra=require(_0xaeea('0xc'));var _=require('lodash');var squel=require(_0xaeea('0xd'));var crypto=require(_0xaeea('0xe'));var jsforce=require(_0xaeea('0xf'));var deskjs=require(_0xaeea('0x10'));var toCsv=require(_0xaeea('0xa'));var querystring=require(_0xaeea('0x11'));var Papa=require('papaparse');var Redis=require(_0xaeea('0x12'));var authService=require(_0xaeea('0x13'));var qs=require(_0xaeea('0x14'));var as=require(_0xaeea('0x15'));var hardwareService=require(_0xaeea('0x16'));var logger=require(_0xaeea('0x17'))(_0xaeea('0x18'));var utils=require(_0xaeea('0x19'));var config=require(_0xaeea('0x1a'));var licenseUtil=require(_0xaeea('0x1b'));var db=require(_0xaeea('0x1c'))['db'];function respondWithStatusCode(_0x432a30,_0x14ded0){_0x14ded0=_0x14ded0||0xcc;return function(_0x4c80df){if(_0x4c80df){return _0x432a30['sendStatus'](_0x14ded0);}return _0x432a30[_0xaeea('0x1d')](_0x14ded0)[_0xaeea('0x1e')]();};}function respondWithResult(_0x9529cc,_0xd2fab1){_0xd2fab1=_0xd2fab1||0xc8;return function(_0x3763c9){if(_0x3763c9){return _0x9529cc[_0xaeea('0x1d')](_0xd2fab1)[_0xaeea('0x1f')](_0x3763c9);}};}function respondWithFilteredResult(_0xdb3894,_0x5ad640){return function(_0x184bd7){if(_0x184bd7){var _0x5108e8=typeof _0x5ad640[_0xaeea('0x20')]===_0xaeea('0x21')&&typeof _0x5ad640['limit']===_0xaeea('0x21');var _0x5e8555=_0x184bd7[_0xaeea('0x22')];var _0x4fa66b=_0x5108e8?0x0:_0x5ad640[_0xaeea('0x20')];var _0x1cd29a=_0x5108e8?_0x184bd7[_0xaeea('0x22')]:_0x5ad640[_0xaeea('0x20')]+_0x5ad640[_0xaeea('0x23')];var _0x5ef6bf;if(_0x1cd29a>=_0x5e8555){_0x1cd29a=_0x5e8555;_0x5ef6bf=0xc8;}else{_0x5ef6bf=0xce;}_0xdb3894[_0xaeea('0x1d')](_0x5ef6bf);return _0xdb3894[_0xaeea('0x24')](_0xaeea('0x25'),_0x4fa66b+'-'+_0x1cd29a+'/'+_0x5e8555)[_0xaeea('0x1f')](_0x184bd7);}return null;};}function patchUpdates(_0x1a4896){return function(_0x5a39a5){try{jsonpatch[_0xaeea('0x26')](_0x5a39a5,_0x1a4896,!![]);}catch(_0x3f9b38){return BPromise[_0xaeea('0x27')](_0x3f9b38);}return _0x5a39a5[_0xaeea('0x28')]();};}function saveUpdates(_0x374982,_0x497167){return function(_0x52de17){if(_0x52de17){return _0x52de17[_0xaeea('0x29')](_0x374982)[_0xaeea('0x2a')](function(_0x4f5ff8){return _0x4f5ff8;});}return null;};}function removeEntity(_0x8effd5,_0x23ca15){return function(_0x1b11a6){if(_0x1b11a6){return _0x1b11a6[_0xaeea('0x2b')]()[_0xaeea('0x2a')](function(){_0x8effd5[_0xaeea('0x1d')](0xcc)[_0xaeea('0x1e')]();});}};}function handleEntityNotFound(_0x2706cf,_0x3b6f62){return function(_0xfd382d){if(!_0xfd382d){_0x2706cf[_0xaeea('0x2c')](0x194);}return _0xfd382d;};}function handleError(_0x3aaee4,_0x264ae7){_0x264ae7=_0x264ae7||0x1f4;return function(_0x78fddb){logger[_0xaeea('0x2d')](_0x78fddb[_0xaeea('0x2e')]);if(_0x78fddb[_0xaeea('0x2f')]){delete _0x78fddb[_0xaeea('0x2f')];}_0x3aaee4[_0xaeea('0x1d')](_0x264ae7)[_0xaeea('0x30')](_0x78fddb);};}exports[_0xaeea('0x31')]=function(_0x3cc6ac,_0x496f5a){var _0x5daecf={},_0x1b98df={},_0x17e409={'count':0x0,'rows':[]};var _0x3fa1ed=_[_0xaeea('0x32')](db['Migration'][_0xaeea('0x33')],function(_0x5f1634){return{'name':_0x5f1634[_0xaeea('0x34')],'type':_0x5f1634[_0xaeea('0x35')][_0xaeea('0x36')]};});_0x1b98df[_0xaeea('0x37')]=_['map'](_0x3fa1ed,_0xaeea('0x2f'));_0x1b98df[_0xaeea('0x38')]=_[_0xaeea('0x39')](_0x3cc6ac['query']);_0x1b98df[_0xaeea('0x3a')]=_[_0xaeea('0x3b')](_0x1b98df[_0xaeea('0x37')],_0x1b98df[_0xaeea('0x38')]);_0x5daecf['attributes']=_[_0xaeea('0x3b')](_0x1b98df['model'],qs[_0xaeea('0x3c')](_0x3cc6ac[_0xaeea('0x38')][_0xaeea('0x3c')]));_0x5daecf['attributes']=_0x5daecf[_0xaeea('0x3d')][_0xaeea('0x3e')]?_0x5daecf[_0xaeea('0x3d')]:_0x1b98df[_0xaeea('0x37')];if(!_0x3cc6ac[_0xaeea('0x38')][_0xaeea('0x3f')](_0xaeea('0x40'))){_0x5daecf['limit']=qs[_0xaeea('0x23')](_0x3cc6ac[_0xaeea('0x38')][_0xaeea('0x23')]);_0x5daecf[_0xaeea('0x20')]=qs[_0xaeea('0x20')](_0x3cc6ac['query']['offset']);}_0x5daecf['order']=qs[_0xaeea('0x41')](_0x3cc6ac['query'][_0xaeea('0x41')]);_0x5daecf['where']=qs[_0xaeea('0x3a')](_['pick'](_0x3cc6ac['query'],_0x1b98df[_0xaeea('0x3a')]),_0x3fa1ed);if(_0x3cc6ac['query']['filter']){_0x5daecf[_0xaeea('0x42')]=_[_0xaeea('0x43')](_0x5daecf[_0xaeea('0x42')],{'$or':_['map'](_0x3fa1ed,function(_0x3edb6b){if(_0x3edb6b['type']!==_0xaeea('0x44')){var _0x450f7f={};_0x450f7f[_0x3edb6b['name']]={'$like':'%'+_0x3cc6ac['query'][_0xaeea('0x45')]+'%'};return _0x450f7f;}})});}_0x5daecf=_[_0xaeea('0x43')]({},_0x5daecf,_0x3cc6ac[_0xaeea('0x46')]);var _0x17902b={'where':_0x5daecf[_0xaeea('0x42')]};return db['Migration'][_0xaeea('0x22')](_0x17902b)[_0xaeea('0x2a')](function(_0x5360a2){_0x17e409[_0xaeea('0x22')]=_0x5360a2;if(_0x3cc6ac[_0xaeea('0x38')][_0xaeea('0x47')]){_0x5daecf[_0xaeea('0x48')]=[{'all':!![]}];}return db[_0xaeea('0x49')][_0xaeea('0x4a')](_0x5daecf);})[_0xaeea('0x2a')](function(_0x40749b){_0x17e409['rows']=_0x40749b;return _0x17e409;})[_0xaeea('0x2a')](respondWithFilteredResult(_0x496f5a,_0x5daecf))[_0xaeea('0x4b')](handleError(_0x496f5a,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 35d862e..b8637ef 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 _0x14d5=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations','lodash','util'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x14d5,0x1ba));var _0x514d=function(_0x8261bb,_0x48e718){_0x8261bb=_0x8261bb-0x0;var _0x530867=_0x14d5[_0x8261bb];return _0x530867;};'use strict';var _=require(_0x514d('0x0'));var util=require(_0x514d('0x1'));var logger=require(_0x514d('0x2'))('api');var moment=require(_0x514d('0x3'));var BPromise=require(_0x514d('0x4'));var rp=require(_0x514d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x514d('0x6'));var config=require(_0x514d('0x7'));var attributes=require(_0x514d('0x8'));module[_0x514d('0x9')]=function(_0x482a9c,_0x22334e){return _0x482a9c['define'](_0x514d('0xa'),attributes,{'tableName':_0x514d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15a1=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','Migration'];(function(_0x36ec25,_0xa43a45){var _0x21f506=function(_0x567f38){while(--_0x567f38){_0x36ec25['push'](_0x36ec25['shift']());}};_0x21f506(++_0xa43a45);}(_0x15a1,0x197));var _0x115a=function(_0x428888,_0x4feddd){_0x428888=_0x428888-0x0;var _0x4a5dcc=_0x15a1[_0x428888];return _0x4a5dcc;};'use strict';var _=require(_0x115a('0x0'));var util=require('util');var logger=require(_0x115a('0x1'))(_0x115a('0x2'));var moment=require(_0x115a('0x3'));var BPromise=require('bluebird');var rp=require(_0x115a('0x4'));var fs=require('fs');var path=require(_0x115a('0x5'));var rimraf=require(_0x115a('0x6'));var config=require(_0x115a('0x7'));var attributes=require(_0x115a('0x8'));module[_0x115a('0x9')]=function(_0x1b91c3,_0x168f9a){return _0x1b91c3['define'](_0x115a('0xa'),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 b399206..85801c2 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 _0x3402=['jayson/promise','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x3402,0x1f0));var _0x2340=function(_0x161348,_0x570cbd){_0x161348=_0x161348-0x0;var _0x138670=_0x3402[_0x161348];return _0x138670;};'use strict';var _=require(_0x2340('0x0'));var util=require('util');var moment=require(_0x2340('0x1'));var BPromise=require(_0x2340('0x2'));var rs=require(_0x2340('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2340('0x4'));var logger=require(_0x2340('0x5'))(_0x2340('0x6'));var config=require(_0x2340('0x7'));var jayson=require(_0x2340('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc37850,_0x1deef4,_0x16174f){return new BPromise(function(_0x225250,_0x152e52){return client['request'](_0xc37850,_0x16174f)[_0x2340('0x9')](function(_0x1da381){logger[_0x2340('0xa')](_0x2340('0xb'),_0x1deef4,_0x2340('0xc'));logger['debug'](_0x2340('0xd'),_0x1deef4,_0x2340('0xc'),JSON['stringify'](_0x1da381));if(_0x1da381['error']){if(_0x1da381[_0x2340('0xe')]['code']===0x1f4){logger[_0x2340('0xe')]('Migration,\x20%s,\x20%s',_0x1deef4,_0x1da381[_0x2340('0xe')][_0x2340('0xf')]);return _0x152e52(_0x1da381[_0x2340('0xe')][_0x2340('0xf')]);}logger[_0x2340('0xe')](_0x2340('0xb'),_0x1deef4,_0x1da381[_0x2340('0xe')]['message']);return _0x225250(_0x1da381[_0x2340('0xe')][_0x2340('0xf')]);}else{logger[_0x2340('0xa')]('Migration,\x20%s,\x20%s',_0x1deef4,_0x2340('0xc'));_0x225250(_0x1da381[_0x2340('0x10')][_0x2340('0xf')]);}})[_0x2340('0x11')](function(_0x4dcab6){logger[_0x2340('0xe')](_0x2340('0xb'),_0x1deef4,_0x4dcab6);_0x152e52(_0x4dcab6);});});} \ No newline at end of file +var _0x205d=['Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4161c2,_0x1daec7){var _0x5bf9df=function(_0x12c04c){while(--_0x12c04c){_0x4161c2['push'](_0x4161c2['shift']());}};_0x5bf9df(++_0x1daec7);}(_0x205d,0xf6));var _0xd205=function(_0x1419f6,_0x4180de){_0x1419f6=_0x1419f6-0x0;var _0x5b07c7=_0x205d[_0x1419f6];return _0x5b07c7;};'use strict';var _=require(_0xd205('0x0'));var util=require(_0xd205('0x1'));var moment=require(_0xd205('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd205('0x3'));var db=require(_0xd205('0x4'))['db'];var utils=require(_0xd205('0x5'));var logger=require('../../config/logger')(_0xd205('0x6'));var config=require(_0xd205('0x7'));var jayson=require(_0xd205('0x8'));var client=jayson[_0xd205('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2614e7,_0x2b6078,_0xdb99a8){return new BPromise(function(_0x372211,_0x3ce946){return client[_0xd205('0xa')](_0x2614e7,_0xdb99a8)[_0xd205('0xb')](function(_0x1cd484){logger[_0xd205('0xc')]('Migration,\x20%s,\x20%s',_0x2b6078,_0xd205('0xd'));logger[_0xd205('0xe')](_0xd205('0xf'),_0x2b6078,_0xd205('0xd'),JSON['stringify'](_0x1cd484));if(_0x1cd484[_0xd205('0x10')]){if(_0x1cd484[_0xd205('0x10')][_0xd205('0x11')]===0x1f4){logger[_0xd205('0x10')](_0xd205('0x12'),_0x2b6078,_0x1cd484[_0xd205('0x10')][_0xd205('0x13')]);return _0x3ce946(_0x1cd484['error'][_0xd205('0x13')]);}logger[_0xd205('0x10')](_0xd205('0x12'),_0x2b6078,_0x1cd484['error']['message']);return _0x372211(_0x1cd484[_0xd205('0x10')]['message']);}else{logger[_0xd205('0xc')]('Migration,\x20%s,\x20%s',_0x2b6078,_0xd205('0xd'));_0x372211(_0x1cd484[_0xd205('0x14')][_0xd205('0x13')]);}})[_0xd205('0x15')](function(_0x57201a){logger[_0xd205('0x10')](_0xd205('0x12'),_0x2b6078,_0x57201a);_0x3ce946(_0x57201a);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 60b8cd0..b8736a7 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 _0xee2c=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xee2c,0x1c7));var _0xcee2=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xee2c[_0x42bdad];return _0x122626;};'use strict';var multer=require(_0xcee2('0x0'));var util=require('util');var path=require(_0xcee2('0x1'));var timeout=require(_0xcee2('0x2'));var express=require(_0xcee2('0x3'));var router=express[_0xcee2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcee2('0x5'));var config=require(_0xcee2('0x6'));var controller=require('./network.controller');router[_0xcee2('0x7')]('/',auth[_0xcee2('0x8')](),controller[_0xcee2('0x9')]);router[_0xcee2('0x7')](_0xcee2('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xcee2('0xb')]('/',auth[_0xcee2('0x8')](),controller[_0xcee2('0xc')]);router[_0xcee2('0xd')](_0xcee2('0xa'),auth[_0xcee2('0x8')](),controller[_0xcee2('0xe')]);router[_0xcee2('0xf')]('/:id',auth[_0xcee2('0x8')](),controller[_0xcee2('0x10')]);module[_0xcee2('0x11')]=router; \ No newline at end of file +var _0xd47f=['isAuthenticated','index','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get'];(function(_0x452c06,_0x2d6a45){var _0x3c4e54=function(_0x4ad95c){while(--_0x4ad95c){_0x452c06['push'](_0x452c06['shift']());}};_0x3c4e54(++_0x2d6a45);}(_0xd47f,0x1bd));var _0xfd47=function(_0x4d3329,_0x53e55b){_0x4d3329=_0x4d3329-0x0;var _0x3abb35=_0xd47f[_0x4d3329];return _0x3abb35;};'use strict';var multer=require(_0xfd47('0x0'));var util=require('util');var path=require(_0xfd47('0x1'));var timeout=require(_0xfd47('0x2'));var express=require(_0xfd47('0x3'));var router=express[_0xfd47('0x4')]();var fs_extra=require(_0xfd47('0x5'));var auth=require(_0xfd47('0x6'));var interaction=require(_0xfd47('0x7'));var config=require(_0xfd47('0x8'));var controller=require(_0xfd47('0x9'));router[_0xfd47('0xa')]('/',auth[_0xfd47('0xb')](),controller[_0xfd47('0xc')]);router['get']('/:id',auth[_0xfd47('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xfd47('0xd')]);router[_0xfd47('0xe')](_0xfd47('0xf'),auth[_0xfd47('0xb')](),controller[_0xfd47('0x10')]);router[_0xfd47('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xfd47('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 2fcb181..5d3a6d4 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 _0x0a5f=['ENUM','localnet','externip','stun','STRING','sequelize','exports'];(function(_0x40c0e4,_0x3df6e5){var _0x29177d=function(_0x292f11){while(--_0x292f11){_0x40c0e4['push'](_0x40c0e4['shift']());}};_0x29177d(++_0x3df6e5);}(_0x0a5f,0x155));var _0xf0a5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0a5f[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xf0a5('0x0'));module[_0xf0a5('0x1')]={'type':{'type':Sequelize[_0xf0a5('0x2')](_0xf0a5('0x3'),_0xf0a5('0x4'),_0xf0a5('0x5'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf0a5('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd096=['localnet','externip','stun','turn','STRING','sequelize'];(function(_0x2c7414,_0x339083){var _0x16a25f=function(_0x28d41f){while(--_0x28d41f){_0x2c7414['push'](_0x2c7414['shift']());}};_0x16a25f(++_0x339083);}(_0xd096,0xd7));var _0x6d09=function(_0x37085b,_0x22c88a){_0x37085b=_0x37085b-0x0;var _0x54335f=_0xd096[_0x37085b];return _0x54335f;};'use strict';var Sequelize=require(_0x6d09('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6d09('0x1'),_0x6d09('0x2'),_0x6d09('0x3'),_0x6d09('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6d09('0x5')]},'password':{'type':Sequelize[_0x6d09('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 6f89bc7..63a9fa4 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 _0x5144=['sequelize','params','STUN','/etc/asterisk/stun_xcally.conf','chan_sip.so','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','Network','includeAll','include','findAll','rows','show','find','transaction','create','body','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','Reload','res_stun_monitor.so','toUpperCase','TURN','join','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf'];(function(_0x23a477,_0x36bd86){var _0x1a6fb2=function(_0x4e9f26){while(--_0x4e9f26){_0x23a477['push'](_0x23a477['shift']());}};_0x1a6fb2(++_0x36bd86);}(_0x5144,0xe2));var _0x4514=function(_0x2e3773,_0x3309e2){_0x2e3773=_0x2e3773-0x0;var _0x328f39=_0x5144[_0x2e3773];return _0x328f39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4514('0x0'));var zipdir=require(_0x4514('0x1'));var jsonpatch=require(_0x4514('0x2'));var rp=require(_0x4514('0x3'));var moment=require(_0x4514('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4514('0x5'));var util=require('util');var path=require(_0x4514('0x6'));var sox=require(_0x4514('0x7'));var csv=require(_0x4514('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4514('0x9'));var _=require(_0x4514('0xa'));var squel=require(_0x4514('0xb'));var crypto=require(_0x4514('0xc'));var jsforce=require(_0x4514('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4514('0xe'));var Papa=require(_0x4514('0xf'));var Redis=require(_0x4514('0x10'));var authService=require(_0x4514('0x11'));var qs=require(_0x4514('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4514('0x13'))(_0x4514('0x14'));var utils=require(_0x4514('0x15'));var config=require(_0x4514('0x16'));var licenseUtil=require(_0x4514('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4514('0x18'));var client=jayson[_0x4514('0x19')][_0x4514('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x51d9ed,_0x346178,_0x3ad0bc,_0x496170){return new BPromise(function(_0x1ff147,_0x19b115){var _0x1386d8=_0x496170||client;return _0x1386d8['request'](_0x51d9ed,_0x3ad0bc)[_0x4514('0x1b')](function(_0x47bc87){logger[_0x4514('0x1c')](_0x4514('0x1d'),_0x346178,_0x4514('0x1e'));logger[_0x4514('0x1f')](_0x4514('0x20'),_0x346178,_0x4514('0x1e'),JSON[_0x4514('0x21')](_0x47bc87));if(_0x47bc87[_0x4514('0x22')]){if(_0x47bc87[_0x4514('0x22')][_0x4514('0x23')]===0x1f4){logger[_0x4514('0x22')](_0x4514('0x1d'),_0x346178,_0x47bc87[_0x4514('0x22')]['message']);return _0x19b115(_0x47bc87[_0x4514('0x22')][_0x4514('0x24')]);}logger[_0x4514('0x22')](_0x4514('0x1d'),_0x346178,_0x47bc87[_0x4514('0x22')][_0x4514('0x24')]);return _0x1ff147(_0x47bc87['error'][_0x4514('0x24')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x346178,_0x4514('0x1e'));_0x1ff147(_0x47bc87['result'][_0x4514('0x24')]);}})[_0x4514('0x25')](function(_0x4c89b4){logger['error']('Network,\x20%s,\x20%s',_0x346178,_0x4c89b4);_0x19b115(_0x4c89b4);});});}function respondWithStatusCode(_0x519818,_0x4f3066){_0x4f3066=_0x4f3066||0xcc;return function(_0x2bc1e3){if(_0x2bc1e3){return _0x519818[_0x4514('0x26')](_0x4f3066);}return _0x519818[_0x4514('0x27')](_0x4f3066)[_0x4514('0x28')]();};}function respondWithResult(_0x21250e,_0x58e6d6){_0x58e6d6=_0x58e6d6||0xc8;return function(_0x44b4ce){if(_0x44b4ce){return _0x21250e[_0x4514('0x27')](_0x58e6d6)[_0x4514('0x29')](_0x44b4ce);}};}function respondWithFilteredResult(_0xea9665,_0x4f90a4){return function(_0x1a4b9b){if(_0x1a4b9b){var _0xa02f87=typeof _0x4f90a4[_0x4514('0x2a')]==='undefined'&&typeof _0x4f90a4[_0x4514('0x2b')]===_0x4514('0x2c');var _0x11dc89=_0x1a4b9b[_0x4514('0x2d')];var _0x4f02a2=_0xa02f87?0x0:_0x4f90a4[_0x4514('0x2a')];var _0x46af3e=_0xa02f87?_0x1a4b9b['count']:_0x4f90a4[_0x4514('0x2a')]+_0x4f90a4[_0x4514('0x2b')];var _0x18c468;if(_0x46af3e>=_0x11dc89){_0x46af3e=_0x11dc89;_0x18c468=0xc8;}else{_0x18c468=0xce;}_0xea9665[_0x4514('0x27')](_0x18c468);return _0xea9665[_0x4514('0x2e')](_0x4514('0x2f'),_0x4f02a2+'-'+_0x46af3e+'/'+_0x11dc89)[_0x4514('0x29')](_0x1a4b9b);}return null;};}function patchUpdates(_0x3935a3){return function(_0x3213b9){try{jsonpatch[_0x4514('0x30')](_0x3213b9,_0x3935a3,!![]);}catch(_0xbda39c){return BPromise[_0x4514('0x31')](_0xbda39c);}return _0x3213b9[_0x4514('0x32')]();};}function saveUpdates(_0x5da059,_0x22deb2){return function(_0x3b81b0){if(_0x3b81b0){return _0x3b81b0[_0x4514('0x33')](_0x5da059)[_0x4514('0x1b')](function(_0x2142f7){return _0x2142f7;});}return null;};}function removeEntity(_0x4f366d,_0x1168ff){return function(_0x5cee5e){if(_0x5cee5e){return _0x5cee5e[_0x4514('0x34')]()[_0x4514('0x1b')](function(){_0x4f366d[_0x4514('0x27')](0xcc)[_0x4514('0x28')]();});}};}function handleEntityNotFound(_0x2fceda,_0xb2d6c){return function(_0x19680f){if(!_0x19680f){_0x2fceda[_0x4514('0x26')](0x194);}return _0x19680f;};}function handleError(_0x3d46d3,_0x762c90){_0x762c90=_0x762c90||0x1f4;return function(_0x35c1a8){logger['error'](_0x35c1a8[_0x4514('0x35')]);if(_0x35c1a8[_0x4514('0x36')]){delete _0x35c1a8[_0x4514('0x36')];}_0x3d46d3[_0x4514('0x27')](_0x762c90)[_0x4514('0x37')](_0x35c1a8);};}exports[_0x4514('0x38')]=function(_0x39388c,_0x5dc5f0){var _0x4251a7={},_0x56cb5f={},_0x567876={'count':0x0,'rows':[]};var _0x43e061=_['map'](db['Network'][_0x4514('0x39')],function(_0x118bab){return{'name':_0x118bab['fieldName'],'type':_0x118bab['type'][_0x4514('0x3a')]};});_0x56cb5f['model']=_[_0x4514('0x3b')](_0x43e061,'name');_0x56cb5f[_0x4514('0x3c')]=_[_0x4514('0x3d')](_0x39388c[_0x4514('0x3c')]);_0x56cb5f[_0x4514('0x3e')]=_[_0x4514('0x3f')](_0x56cb5f[_0x4514('0x40')],_0x56cb5f[_0x4514('0x3c')]);_0x4251a7[_0x4514('0x41')]=_['intersection'](_0x56cb5f[_0x4514('0x40')],qs[_0x4514('0x42')](_0x39388c[_0x4514('0x3c')][_0x4514('0x42')]));_0x4251a7[_0x4514('0x41')]=_0x4251a7['attributes'][_0x4514('0x43')]?_0x4251a7[_0x4514('0x41')]:_0x56cb5f[_0x4514('0x40')];if(!_0x39388c['query'][_0x4514('0x44')](_0x4514('0x45'))){_0x4251a7['limit']=qs[_0x4514('0x2b')](_0x39388c[_0x4514('0x3c')][_0x4514('0x2b')]);_0x4251a7['offset']=qs[_0x4514('0x2a')](_0x39388c[_0x4514('0x3c')][_0x4514('0x2a')]);}_0x4251a7[_0x4514('0x46')]=qs[_0x4514('0x47')](_0x39388c[_0x4514('0x3c')]['sort']);_0x4251a7[_0x4514('0x48')]=qs['filters'](_[_0x4514('0x49')](_0x39388c['query'],_0x56cb5f['filters']),_0x43e061);if(_0x39388c[_0x4514('0x3c')][_0x4514('0x4a')]){_0x4251a7[_0x4514('0x48')]=_['merge'](_0x4251a7[_0x4514('0x48')],{'$or':_[_0x4514('0x3b')](_0x43e061,function(_0x3835a9){if(_0x3835a9[_0x4514('0x4b')]!=='VIRTUAL'){var _0x3f06a={};_0x3f06a[_0x3835a9[_0x4514('0x36')]]={'$like':'%'+_0x39388c['query']['filter']+'%'};return _0x3f06a;}})});}_0x4251a7=_[_0x4514('0x4c')]({},_0x4251a7,_0x39388c[_0x4514('0x4d')]);var _0x5fefe1={'where':_0x4251a7[_0x4514('0x48')]};return db[_0x4514('0x4e')][_0x4514('0x2d')](_0x5fefe1)['then'](function(_0xcd10c2){_0x567876[_0x4514('0x2d')]=_0xcd10c2;if(_0x39388c[_0x4514('0x3c')][_0x4514('0x4f')]){_0x4251a7[_0x4514('0x50')]=[{'all':!![]}];}return db[_0x4514('0x4e')][_0x4514('0x51')](_0x4251a7);})['then'](function(_0x2783b8){_0x567876[_0x4514('0x52')]=_0x2783b8;return _0x567876;})[_0x4514('0x1b')](respondWithFilteredResult(_0x5dc5f0,_0x4251a7))['catch'](handleError(_0x5dc5f0,null));};exports[_0x4514('0x53')]=function(_0x20fdce,_0x9b1eff){var _0x4d441a={'raw':!![],'where':{'id':_0x20fdce['params']['id']}},_0x328b7b={};_0x328b7b[_0x4514('0x40')]=_[_0x4514('0x3d')](db[_0x4514('0x4e')][_0x4514('0x39')]);_0x328b7b[_0x4514('0x3c')]=_[_0x4514('0x3d')](_0x20fdce[_0x4514('0x3c')]);_0x328b7b[_0x4514('0x3e')]=_['intersection'](_0x328b7b[_0x4514('0x40')],_0x328b7b[_0x4514('0x3c')]);_0x4d441a[_0x4514('0x41')]=_[_0x4514('0x3f')](_0x328b7b[_0x4514('0x40')],qs[_0x4514('0x42')](_0x20fdce[_0x4514('0x3c')]['fields']));_0x4d441a[_0x4514('0x41')]=_0x4d441a[_0x4514('0x41')][_0x4514('0x43')]?_0x4d441a[_0x4514('0x41')]:_0x328b7b[_0x4514('0x40')];if(_0x20fdce[_0x4514('0x3c')]['includeAll']){_0x4d441a[_0x4514('0x50')]=[{'all':!![]}];}_0x4d441a=_[_0x4514('0x4c')]({},_0x4d441a,_0x20fdce[_0x4514('0x4d')]);return db[_0x4514('0x4e')][_0x4514('0x54')](_0x4d441a)[_0x4514('0x1b')](handleEntityNotFound(_0x9b1eff,null))[_0x4514('0x1b')](respondWithResult(_0x9b1eff,null))[_0x4514('0x25')](handleError(_0x9b1eff,null));};exports['create']=function(_0x5e1905,_0x5cb185,_0x47f425){var _0x1c2268;return db['sequelize'][_0x4514('0x55')](function(_0x500eb6){return db['Network'][_0x4514('0x56')](_0x5e1905[_0x4514('0x57')],{'raw':!![]})[_0x4514('0x1b')](function(_0x6a9943){_0x1c2268=_0x6a9943;return db['Network'][_0x4514('0x51')]({'where':{'type':_0x5e1905['body']['type']},'raw':!![]});})[_0x4514('0x1b')](function(_0x1d8067){if(_0x1c2268[_0x4514('0x4b')]['toUpperCase']()=='STUN'){var _0x325a8d=fs[_0x4514('0x58')](path['join'](config[_0x4514('0x59')],_0x4514('0x5a')),_0x4514('0x5b'));var _0x27ac20=ejs[_0x4514('0x5c')](_0x325a8d,{'networks':_0x1d8067||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x27ac20);return respondWithRpcPromise(_0x4514('0x5d'),'create',{'module':_0x4514('0x5e')});}else if(_0x1c2268[_0x4514('0x4b')][_0x4514('0x5f')]()==_0x4514('0x60')){var _0x520d11=fs[_0x4514('0x58')](path[_0x4514('0x61')](config[_0x4514('0x59')],_0x4514('0x62')),_0x4514('0x5b'));var _0x3f9a16=ejs['render'](_0x520d11,{'networks':_0x1d8067||[]});fs[_0x4514('0x63')](_0x4514('0x64'),_0x3f9a16);return respondWithRpcPromise(_0x4514('0x5d'),_0x4514('0x56'),{'module':_0x4514('0x5e')});}else{var _0x321e43=fs[_0x4514('0x58')](path[_0x4514('0x61')](config[_0x4514('0x59')],_0x4514('0x65')),_0x4514('0x5b'));var _0x520c91=ejs[_0x4514('0x5c')](_0x321e43,{'networks':_0x1d8067||[]});fs[_0x4514('0x63')](util[_0x4514('0x66')](_0x4514('0x67'),_0x5e1905[_0x4514('0x57')][_0x4514('0x4b')]['toLowerCase']()),_0x520c91);return respondWithRpcPromise(_0x4514('0x5d'),_0x4514('0x56'),{'module':'chan_sip.so'});}return null;})[_0x4514('0x1b')](function(){return _0x1c2268;});})['then'](respondWithResult(_0x5cb185,0xc9))[_0x4514('0x25')](handleError(_0x5cb185,null));};exports[_0x4514('0x33')]=function(_0x171420,_0x31a10c,_0x1192c4){var _0x6cac02;return db[_0x4514('0x68')][_0x4514('0x55')](function(_0x272c78){return db[_0x4514('0x4e')][_0x4514('0x54')]({'where':{'id':_0x171420[_0x4514('0x69')]['id']}})[_0x4514('0x1b')](handleEntityNotFound(_0x31a10c,null))[_0x4514('0x1b')](saveUpdates(_0x171420[_0x4514('0x57')],null))['then'](function(_0x49339b){if(_0x49339b){_0x6cac02=_0x49339b;return db[_0x4514('0x4e')][_0x4514('0x51')]({'where':{'type':_0x6cac02[_0x4514('0x4b')]},'raw':!![]});}return null;})['then'](function(_0x488e1f){if(_0x6cac02[_0x4514('0x4b')][_0x4514('0x5f')]()==_0x4514('0x6a')){var _0x3d8b25=fs[_0x4514('0x58')](path[_0x4514('0x61')](config[_0x4514('0x59')],'server/files/templates/stun_multiple.ejs'),_0x4514('0x5b'));var _0x5be551=ejs[_0x4514('0x5c')](_0x3d8b25,{'networks':_0x488e1f||[]});fs[_0x4514('0x63')](_0x4514('0x6b'),_0x5be551);return respondWithRpcPromise('Reload','update',{'module':'res_stun_monitor.so'});}else if(_0x6cac02[_0x4514('0x4b')][_0x4514('0x5f')]()==_0x4514('0x60')){var _0x30ea9c=fs['readFileSync'](path[_0x4514('0x61')](config[_0x4514('0x59')],_0x4514('0x62')),_0x4514('0x5b'));var _0x181e58=ejs[_0x4514('0x5c')](_0x30ea9c,{'networks':_0x488e1f||[]});fs[_0x4514('0x63')](_0x4514('0x64'),_0x181e58);return respondWithRpcPromise(_0x4514('0x5d'),_0x4514('0x33'),{'module':_0x4514('0x5e')});}else{var _0x592f73=fs[_0x4514('0x58')](path[_0x4514('0x61')](config[_0x4514('0x59')],_0x4514('0x65')),_0x4514('0x5b'));var _0xdabb91=ejs[_0x4514('0x5c')](_0x592f73,{'networks':_0x488e1f||[]});fs[_0x4514('0x63')](util[_0x4514('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x171420[_0x4514('0x57')]['type']['toLowerCase']()),_0xdabb91);return respondWithRpcPromise(_0x4514('0x5d'),_0x4514('0x33'),{'module':_0x4514('0x6c')});}return null;})[_0x4514('0x1b')](function(_0x5d4c5f){if(_0x5d4c5f){return _0x6cac02;}return null;});})[_0x4514('0x1b')](respondWithResult(_0x31a10c,null))[_0x4514('0x25')](handleError(_0x31a10c,null));};exports['destroy']=function(_0x273127,_0x24328c,_0x1a486e){var _0x26ba5d;return db[_0x4514('0x4e')]['find']({'where':{'id':_0x273127[_0x4514('0x69')]['id']}})[_0x4514('0x1b')](function(_0x27add8){_0x26ba5d=_0x27add8;return _0x27add8;})['then'](handleEntityNotFound(_0x24328c,null))[_0x4514('0x1b')](removeEntity(_0x24328c,null))[_0x4514('0x1b')](function(){if(_0x26ba5d){return db[_0x4514('0x4e')][_0x4514('0x51')]({'where':{'type':_0x26ba5d[_0x4514('0x4b')]},'raw':!![]});}})[_0x4514('0x1b')](function(_0x8d2542){if(_0x26ba5d[_0x4514('0x4b')][_0x4514('0x5f')]()==_0x4514('0x6a')){var _0x12047d=fs[_0x4514('0x58')](path['join'](config['root'],_0x4514('0x5a')),_0x4514('0x5b'));var _0x4ed54f=ejs['render'](_0x12047d,{'networks':_0x8d2542||[]});fs[_0x4514('0x63')](_0x4514('0x6b'),_0x4ed54f);return respondWithRpcPromise(_0x4514('0x5d'),_0x4514('0x34'),{'module':_0x4514('0x5e')});}else if(_0x26ba5d['type'][_0x4514('0x5f')]()=='TURN'){var _0x7c64a1=fs[_0x4514('0x58')](path[_0x4514('0x61')](config['root'],_0x4514('0x62')),'utf8');var _0x22d1b3=ejs[_0x4514('0x5c')](_0x7c64a1,{'networks':_0x8d2542||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x22d1b3);return respondWithRpcPromise(_0x4514('0x5d'),_0x4514('0x34'),{'module':'res_stun_monitor.so'});}else{var _0x41729b=fs[_0x4514('0x58')](path[_0x4514('0x61')](config[_0x4514('0x59')],_0x4514('0x65')),_0x4514('0x5b'));var _0x5bb83b=ejs['render'](_0x41729b,{'networks':_0x8d2542||[]});fs[_0x4514('0x63')](util[_0x4514('0x66')](_0x4514('0x67'),_0x273127[_0x4514('0x57')][_0x4514('0x4b')][_0x4514('0x6d')]()),_0x5bb83b);return respondWithRpcPromise(_0x4514('0x5d'),_0x4514('0x34'),{'module':_0x4514('0x6c')});}return null;})['catch'](handleError(_0x24328c,null));}; \ No newline at end of file +var _0x7ff1=['attributes','fields','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','type','options','Network','includeAll','include','findAll','rows','params','length','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','render','/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','root','utf8','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection'];(function(_0x55ae5b,_0x5d06ee){var _0x5ad873=function(_0x1745f9){while(--_0x1745f9){_0x55ae5b['push'](_0x55ae5b['shift']());}};_0x5ad873(++_0x5d06ee);}(_0x7ff1,0x93));var _0x17ff=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x7ff1[_0x466af7];return _0x348c96;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x17ff('0x0'));var zipdir=require(_0x17ff('0x1'));var jsonpatch=require(_0x17ff('0x2'));var rp=require(_0x17ff('0x3'));var moment=require(_0x17ff('0x4'));var BPromise=require(_0x17ff('0x5'));var Mustache=require('mustache');var util=require(_0x17ff('0x6'));var path=require(_0x17ff('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x17ff('0x8'));var fs=require('fs');var fs_extra=require(_0x17ff('0x9'));var _=require(_0x17ff('0xa'));var squel=require(_0x17ff('0xb'));var crypto=require(_0x17ff('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x17ff('0xd'));var toCsv=require(_0x17ff('0xe'));var querystring=require('querystring');var Papa=require(_0x17ff('0xf'));var Redis=require('ioredis');var authService=require(_0x17ff('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x17ff('0x11'));var hardwareService=require(_0x17ff('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x17ff('0x13'));var config=require(_0x17ff('0x14'));var licenseUtil=require(_0x17ff('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x17ff('0x16'));var client=jayson[_0x17ff('0x17')][_0x17ff('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xc0e1db,_0x59bdc8,_0x249d4c,_0x54ba69){return new BPromise(function(_0x529a6a,_0x2704e1){var _0x2ba9e3=_0x54ba69||client;return _0x2ba9e3[_0x17ff('0x19')](_0xc0e1db,_0x249d4c)['then'](function(_0x2c5a0c){logger[_0x17ff('0x1a')](_0x17ff('0x1b'),_0x59bdc8,_0x17ff('0x1c'));logger[_0x17ff('0x1d')]('Network,\x20%s,\x20%s,\x20%s',_0x59bdc8,'request\x20sent',JSON[_0x17ff('0x1e')](_0x2c5a0c));if(_0x2c5a0c[_0x17ff('0x1f')]){if(_0x2c5a0c[_0x17ff('0x1f')]['code']===0x1f4){logger[_0x17ff('0x1f')](_0x17ff('0x1b'),_0x59bdc8,_0x2c5a0c[_0x17ff('0x1f')]['message']);return _0x2704e1(_0x2c5a0c[_0x17ff('0x1f')]['message']);}logger[_0x17ff('0x1f')](_0x17ff('0x1b'),_0x59bdc8,_0x2c5a0c[_0x17ff('0x1f')]['message']);return _0x529a6a(_0x2c5a0c[_0x17ff('0x1f')][_0x17ff('0x20')]);}else{logger[_0x17ff('0x1a')](_0x17ff('0x1b'),_0x59bdc8,_0x17ff('0x1c'));_0x529a6a(_0x2c5a0c['result'][_0x17ff('0x20')]);}})[_0x17ff('0x21')](function(_0x1f6938){logger[_0x17ff('0x1f')](_0x17ff('0x1b'),_0x59bdc8,_0x1f6938);_0x2704e1(_0x1f6938);});});}function respondWithStatusCode(_0x49989c,_0x4cadb6){_0x4cadb6=_0x4cadb6||0xcc;return function(_0x1413d3){if(_0x1413d3){return _0x49989c[_0x17ff('0x22')](_0x4cadb6);}return _0x49989c[_0x17ff('0x23')](_0x4cadb6)[_0x17ff('0x24')]();};}function respondWithResult(_0x31c293,_0x19c45b){_0x19c45b=_0x19c45b||0xc8;return function(_0x47617e){if(_0x47617e){return _0x31c293['status'](_0x19c45b)[_0x17ff('0x25')](_0x47617e);}};}function respondWithFilteredResult(_0x926243,_0x4ea437){return function(_0x3a0ea6){if(_0x3a0ea6){var _0x3460bf=typeof _0x4ea437['offset']===_0x17ff('0x26')&&typeof _0x4ea437['limit']===_0x17ff('0x26');var _0x4b3fb4=_0x3a0ea6['count'];var _0x18c21f=_0x3460bf?0x0:_0x4ea437['offset'];var _0x10d04c=_0x3460bf?_0x3a0ea6[_0x17ff('0x27')]:_0x4ea437[_0x17ff('0x28')]+_0x4ea437['limit'];var _0x1493bb;if(_0x10d04c>=_0x4b3fb4){_0x10d04c=_0x4b3fb4;_0x1493bb=0xc8;}else{_0x1493bb=0xce;}_0x926243['status'](_0x1493bb);return _0x926243[_0x17ff('0x29')](_0x17ff('0x2a'),_0x18c21f+'-'+_0x10d04c+'/'+_0x4b3fb4)[_0x17ff('0x25')](_0x3a0ea6);}return null;};}function patchUpdates(_0xf51430){return function(_0x1ea5e0){try{jsonpatch[_0x17ff('0x2b')](_0x1ea5e0,_0xf51430,!![]);}catch(_0x19c16b){return BPromise[_0x17ff('0x2c')](_0x19c16b);}return _0x1ea5e0[_0x17ff('0x2d')]();};}function saveUpdates(_0x1e5795,_0x1fe874){return function(_0x491f04){if(_0x491f04){return _0x491f04[_0x17ff('0x2e')](_0x1e5795)[_0x17ff('0x2f')](function(_0x43d877){return _0x43d877;});}return null;};}function removeEntity(_0x736494,_0x4f3629){return function(_0x377219){if(_0x377219){return _0x377219[_0x17ff('0x30')]()[_0x17ff('0x2f')](function(){_0x736494[_0x17ff('0x23')](0xcc)[_0x17ff('0x24')]();});}};}function handleEntityNotFound(_0x811b38,_0x35f8c3){return function(_0x30f9af){if(!_0x30f9af){_0x811b38[_0x17ff('0x22')](0x194);}return _0x30f9af;};}function handleError(_0x113c71,_0x31064c){_0x31064c=_0x31064c||0x1f4;return function(_0x11fb1c){logger[_0x17ff('0x1f')](_0x11fb1c[_0x17ff('0x31')]);if(_0x11fb1c[_0x17ff('0x32')]){delete _0x11fb1c[_0x17ff('0x32')];}_0x113c71[_0x17ff('0x23')](_0x31064c)['send'](_0x11fb1c);};}exports[_0x17ff('0x33')]=function(_0x299284,_0x5f5bc0){var _0x15c092={},_0x2ef753={},_0x1d9e23={'count':0x0,'rows':[]};var _0x858127=_['map'](db['Network'][_0x17ff('0x34')],function(_0x6ffda2){return{'name':_0x6ffda2[_0x17ff('0x35')],'type':_0x6ffda2['type'][_0x17ff('0x36')]};});_0x2ef753[_0x17ff('0x37')]=_[_0x17ff('0x38')](_0x858127,_0x17ff('0x32'));_0x2ef753[_0x17ff('0x39')]=_[_0x17ff('0x3a')](_0x299284['query']);_0x2ef753[_0x17ff('0x3b')]=_[_0x17ff('0x3c')](_0x2ef753[_0x17ff('0x37')],_0x2ef753['query']);_0x15c092[_0x17ff('0x3d')]=_[_0x17ff('0x3c')](_0x2ef753[_0x17ff('0x37')],qs['fields'](_0x299284[_0x17ff('0x39')][_0x17ff('0x3e')]));_0x15c092[_0x17ff('0x3d')]=_0x15c092['attributes']['length']?_0x15c092['attributes']:_0x2ef753['model'];if(!_0x299284['query'][_0x17ff('0x3f')](_0x17ff('0x40'))){_0x15c092[_0x17ff('0x41')]=qs[_0x17ff('0x41')](_0x299284[_0x17ff('0x39')][_0x17ff('0x41')]);_0x15c092[_0x17ff('0x28')]=qs['offset'](_0x299284[_0x17ff('0x39')][_0x17ff('0x28')]);}_0x15c092[_0x17ff('0x42')]=qs['sort'](_0x299284[_0x17ff('0x39')]['sort']);_0x15c092[_0x17ff('0x43')]=qs['filters'](_[_0x17ff('0x44')](_0x299284[_0x17ff('0x39')],_0x2ef753[_0x17ff('0x3b')]),_0x858127);if(_0x299284[_0x17ff('0x39')][_0x17ff('0x45')]){_0x15c092['where']=_[_0x17ff('0x46')](_0x15c092[_0x17ff('0x43')],{'$or':_[_0x17ff('0x38')](_0x858127,function(_0xb72a3d){if(_0xb72a3d[_0x17ff('0x47')]!=='VIRTUAL'){var _0x316157={};_0x316157[_0xb72a3d[_0x17ff('0x32')]]={'$like':'%'+_0x299284[_0x17ff('0x39')][_0x17ff('0x45')]+'%'};return _0x316157;}})});}_0x15c092=_[_0x17ff('0x46')]({},_0x15c092,_0x299284[_0x17ff('0x48')]);var _0x527890={'where':_0x15c092[_0x17ff('0x43')]};return db[_0x17ff('0x49')][_0x17ff('0x27')](_0x527890)[_0x17ff('0x2f')](function(_0x3c4957){_0x1d9e23[_0x17ff('0x27')]=_0x3c4957;if(_0x299284['query'][_0x17ff('0x4a')]){_0x15c092[_0x17ff('0x4b')]=[{'all':!![]}];}return db[_0x17ff('0x49')][_0x17ff('0x4c')](_0x15c092);})[_0x17ff('0x2f')](function(_0x14fa8d){_0x1d9e23[_0x17ff('0x4d')]=_0x14fa8d;return _0x1d9e23;})['then'](respondWithFilteredResult(_0x5f5bc0,_0x15c092))[_0x17ff('0x21')](handleError(_0x5f5bc0,null));};exports['show']=function(_0x621fd2,_0x22a877){var _0xfb586d={'raw':!![],'where':{'id':_0x621fd2[_0x17ff('0x4e')]['id']}},_0x189121={};_0x189121[_0x17ff('0x37')]=_[_0x17ff('0x3a')](db[_0x17ff('0x49')][_0x17ff('0x34')]);_0x189121[_0x17ff('0x39')]=_['keys'](_0x621fd2[_0x17ff('0x39')]);_0x189121['filters']=_[_0x17ff('0x3c')](_0x189121[_0x17ff('0x37')],_0x189121[_0x17ff('0x39')]);_0xfb586d[_0x17ff('0x3d')]=_[_0x17ff('0x3c')](_0x189121[_0x17ff('0x37')],qs[_0x17ff('0x3e')](_0x621fd2['query'][_0x17ff('0x3e')]));_0xfb586d[_0x17ff('0x3d')]=_0xfb586d['attributes'][_0x17ff('0x4f')]?_0xfb586d['attributes']:_0x189121[_0x17ff('0x37')];if(_0x621fd2[_0x17ff('0x39')][_0x17ff('0x4a')]){_0xfb586d[_0x17ff('0x4b')]=[{'all':!![]}];}_0xfb586d=_[_0x17ff('0x46')]({},_0xfb586d,_0x621fd2['options']);return db['Network'][_0x17ff('0x50')](_0xfb586d)[_0x17ff('0x2f')](handleEntityNotFound(_0x22a877,null))[_0x17ff('0x2f')](respondWithResult(_0x22a877,null))[_0x17ff('0x21')](handleError(_0x22a877,null));};exports[_0x17ff('0x51')]=function(_0x414b52,_0x654630,_0x25b627){var _0x47a0fe;return db[_0x17ff('0x52')][_0x17ff('0x53')](function(_0x1d0d3a){return db[_0x17ff('0x49')][_0x17ff('0x51')](_0x414b52[_0x17ff('0x54')],{'raw':!![]})[_0x17ff('0x2f')](function(_0x8b64b9){_0x47a0fe=_0x8b64b9;return db['Network'][_0x17ff('0x4c')]({'where':{'type':_0x414b52[_0x17ff('0x54')][_0x17ff('0x47')]},'raw':!![]});})[_0x17ff('0x2f')](function(_0x2fff90){if(_0x47a0fe[_0x17ff('0x47')][_0x17ff('0x55')]()==_0x17ff('0x56')){var _0x1edb07=fs[_0x17ff('0x57')](path[_0x17ff('0x58')](config['root'],_0x17ff('0x59')),'utf8');var _0x19edd1=ejs[_0x17ff('0x5a')](_0x1edb07,{'networks':_0x2fff90||[]});fs['writeFileSync'](_0x17ff('0x5b'),_0x19edd1);return respondWithRpcPromise(_0x17ff('0x5c'),_0x17ff('0x51'),{'module':'res_stun_monitor.so'});}else if(_0x47a0fe[_0x17ff('0x47')][_0x17ff('0x55')]()==_0x17ff('0x5d')){var _0x1a93e6=fs[_0x17ff('0x57')](path[_0x17ff('0x58')](config['root'],_0x17ff('0x5e')),'utf8');var _0x3cff43=ejs['render'](_0x1a93e6,{'networks':_0x2fff90||[]});fs[_0x17ff('0x5f')](_0x17ff('0x60'),_0x3cff43);return respondWithRpcPromise(_0x17ff('0x5c'),'create',{'module':_0x17ff('0x61')});}else{var _0x276c26=fs[_0x17ff('0x57')](path['join'](config[_0x17ff('0x62')],'server/files/templates/network.ejs'),_0x17ff('0x63'));var _0x2f821c=ejs[_0x17ff('0x5a')](_0x276c26,{'networks':_0x2fff90||[]});fs[_0x17ff('0x5f')](util[_0x17ff('0x64')](_0x17ff('0x65'),_0x414b52[_0x17ff('0x54')][_0x17ff('0x47')][_0x17ff('0x66')]()),_0x2f821c);return respondWithRpcPromise('Reload','create',{'module':_0x17ff('0x67')});}return null;})[_0x17ff('0x2f')](function(){return _0x47a0fe;});})[_0x17ff('0x2f')](respondWithResult(_0x654630,0xc9))[_0x17ff('0x21')](handleError(_0x654630,null));};exports[_0x17ff('0x2e')]=function(_0x7df558,_0x158524,_0x346cab){var _0x24d4d0;return db[_0x17ff('0x52')][_0x17ff('0x53')](function(_0x3f9b32){return db[_0x17ff('0x49')][_0x17ff('0x50')]({'where':{'id':_0x7df558[_0x17ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x158524,null))[_0x17ff('0x2f')](saveUpdates(_0x7df558[_0x17ff('0x54')],null))[_0x17ff('0x2f')](function(_0x14f6d8){if(_0x14f6d8){_0x24d4d0=_0x14f6d8;return db[_0x17ff('0x49')][_0x17ff('0x4c')]({'where':{'type':_0x24d4d0[_0x17ff('0x47')]},'raw':!![]});}return null;})[_0x17ff('0x2f')](function(_0x35972e){if(_0x24d4d0[_0x17ff('0x47')][_0x17ff('0x55')]()=='STUN'){var _0x2268b2=fs[_0x17ff('0x57')](path[_0x17ff('0x58')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x36047d=ejs[_0x17ff('0x5a')](_0x2268b2,{'networks':_0x35972e||[]});fs[_0x17ff('0x5f')](_0x17ff('0x5b'),_0x36047d);return respondWithRpcPromise('Reload',_0x17ff('0x2e'),{'module':_0x17ff('0x61')});}else if(_0x24d4d0['type'][_0x17ff('0x55')]()=='TURN'){var _0x316c43=fs[_0x17ff('0x57')](path[_0x17ff('0x58')](config[_0x17ff('0x62')],'server/files/templates/turn_multiple.ejs'),_0x17ff('0x63'));var _0x2b1d6e=ejs[_0x17ff('0x5a')](_0x316c43,{'networks':_0x35972e||[]});fs[_0x17ff('0x5f')](_0x17ff('0x60'),_0x2b1d6e);return respondWithRpcPromise(_0x17ff('0x5c'),_0x17ff('0x2e'),{'module':_0x17ff('0x61')});}else{var _0x54a97a=fs[_0x17ff('0x57')](path[_0x17ff('0x58')](config['root'],'server/files/templates/network.ejs'),_0x17ff('0x63'));var _0x1ae48c=ejs[_0x17ff('0x5a')](_0x54a97a,{'networks':_0x35972e||[]});fs['writeFileSync'](util[_0x17ff('0x64')](_0x17ff('0x65'),_0x7df558['body'][_0x17ff('0x47')][_0x17ff('0x66')]()),_0x1ae48c);return respondWithRpcPromise('Reload',_0x17ff('0x2e'),{'module':'chan_sip.so'});}return null;})[_0x17ff('0x2f')](function(_0x579526){if(_0x579526){return _0x24d4d0;}return null;});})[_0x17ff('0x2f')](respondWithResult(_0x158524,null))['catch'](handleError(_0x158524,null));};exports[_0x17ff('0x30')]=function(_0x57f2d7,_0x77a750,_0x4f8bac){var _0x3dda4c;return db['Network'][_0x17ff('0x50')]({'where':{'id':_0x57f2d7[_0x17ff('0x4e')]['id']}})['then'](function(_0x319bad){_0x3dda4c=_0x319bad;return _0x319bad;})[_0x17ff('0x2f')](handleEntityNotFound(_0x77a750,null))[_0x17ff('0x2f')](removeEntity(_0x77a750,null))['then'](function(){if(_0x3dda4c){return db[_0x17ff('0x49')][_0x17ff('0x4c')]({'where':{'type':_0x3dda4c[_0x17ff('0x47')]},'raw':!![]});}})[_0x17ff('0x2f')](function(_0x3341d7){if(_0x3dda4c[_0x17ff('0x47')][_0x17ff('0x55')]()==_0x17ff('0x56')){var _0x27bde3=fs['readFileSync'](path[_0x17ff('0x58')](config[_0x17ff('0x62')],_0x17ff('0x59')),_0x17ff('0x63'));var _0x43f882=ejs[_0x17ff('0x5a')](_0x27bde3,{'networks':_0x3341d7||[]});fs[_0x17ff('0x5f')](_0x17ff('0x5b'),_0x43f882);return respondWithRpcPromise(_0x17ff('0x5c'),_0x17ff('0x30'),{'module':_0x17ff('0x61')});}else if(_0x3dda4c[_0x17ff('0x47')][_0x17ff('0x55')]()==_0x17ff('0x5d')){var _0x15b3da=fs[_0x17ff('0x57')](path[_0x17ff('0x58')](config[_0x17ff('0x62')],_0x17ff('0x5e')),_0x17ff('0x63'));var _0x3e2c24=ejs[_0x17ff('0x5a')](_0x15b3da,{'networks':_0x3341d7||[]});fs[_0x17ff('0x5f')](_0x17ff('0x60'),_0x3e2c24);return respondWithRpcPromise(_0x17ff('0x5c'),_0x17ff('0x30'),{'module':_0x17ff('0x61')});}else{var _0xc694f7=fs['readFileSync'](path[_0x17ff('0x58')](config[_0x17ff('0x62')],'server/files/templates/network.ejs'),'utf8');var _0x2e4bf7=ejs['render'](_0xc694f7,{'networks':_0x3341d7||[]});fs['writeFileSync'](util[_0x17ff('0x64')](_0x17ff('0x65'),_0x57f2d7[_0x17ff('0x54')][_0x17ff('0x47')]['toLowerCase']()),_0x2e4bf7);return respondWithRpcPromise(_0x17ff('0x5c'),_0x17ff('0x30'),{'module':_0x17ff('0x67')});}return null;})[_0x17ff('0x21')](handleError(_0x77a750,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 1895a79..8154f36 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 _0x073e=['rimraf','../../config/environment','define','Network','network','lodash','util','../../config/logger','api','path'];(function(_0x492bd0,_0x2baf97){var _0x572551=function(_0x591f15){while(--_0x591f15){_0x492bd0['push'](_0x492bd0['shift']());}};_0x572551(++_0x2baf97);}(_0x073e,0x181));var _0xe073=function(_0x279d40,_0x58c583){_0x279d40=_0x279d40-0x0;var _0x5c3b0d=_0x073e[_0x279d40];return _0x5c3b0d;};'use strict';var _=require(_0xe073('0x0'));var util=require(_0xe073('0x1'));var logger=require(_0xe073('0x2'))(_0xe073('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe073('0x4'));var rimraf=require(_0xe073('0x5'));var config=require(_0xe073('0x6'));var attributes=require('./network.attributes');module['exports']=function(_0x4bc6b3,_0x45995e){return _0x4bc6b3[_0xe073('0x7')](_0xe073('0x8'),attributes,{'tableName':_0xe073('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2b3=['network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./network.attributes','exports','define','Network'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0xb2b3,0x71));var _0x3b2b=function(_0x2b4d42,_0x216440){_0x2b4d42=_0x2b4d42-0x0;var _0x418dc6=_0xb2b3[_0x2b4d42];return _0x418dc6;};'use strict';var _=require(_0x3b2b('0x0'));var util=require(_0x3b2b('0x1'));var logger=require(_0x3b2b('0x2'))(_0x3b2b('0x3'));var moment=require(_0x3b2b('0x4'));var BPromise=require(_0x3b2b('0x5'));var rp=require(_0x3b2b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b2b('0x7'));var config=require(_0x3b2b('0x8'));var attributes=require(_0x3b2b('0x9'));module[_0x3b2b('0xa')]=function(_0x2581eb,_0xc53a84){return _0x2581eb[_0x3b2b('0xb')](_0x3b2b('0xc'),attributes,{'tableName':_0x3b2b('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 4ebbc35..4d9ba48 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x19fbc9,_0xc7a98f){var _0x5381b0=function(_0x43cd31){while(--_0x43cd31){_0x19fbc9['push'](_0x19fbc9['shift']());}};_0x5381b0(++_0xc7a98f);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _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(_0x5d1e5c,_0x78d237){_0x5d1e5c=_0x5d1e5c-0x0;var _0xd948b3=_0x7a54[_0x5d1e5c];return _0xd948b3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 3c2d873..a89e8ea 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 _0x8a2c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','addApplications','addAgents','/:id/send','send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports'];(function(_0x4c4a02,_0x33ccb6){var _0x4c4d5c=function(_0x127d70){while(--_0x127d70){_0x4c4a02['push'](_0x4c4a02['shift']());}};_0x4c4d5c(++_0x33ccb6);}(_0x8a2c,0x128));var _0xc8a2=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x8a2c[_0x334841];return _0x5beb4b;};'use strict';var multer=require(_0xc8a2('0x0'));var util=require(_0xc8a2('0x1'));var path=require(_0xc8a2('0x2'));var timeout=require(_0xc8a2('0x3'));var express=require(_0xc8a2('0x4'));var router=express[_0xc8a2('0x5')]();var fs_extra=require(_0xc8a2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc8a2('0x7'));var controller=require('./openchannelAccount.controller');router[_0xc8a2('0x8')]('/',auth[_0xc8a2('0x9')](),controller['index']);router[_0xc8a2('0x8')](_0xc8a2('0xa'),auth[_0xc8a2('0x9')](),controller[_0xc8a2('0xb')]);router[_0xc8a2('0x8')](_0xc8a2('0xc'),auth[_0xc8a2('0x9')](),controller[_0xc8a2('0xd')]);router[_0xc8a2('0x8')]('/:id/dispositions',auth[_0xc8a2('0x9')](),controller['getDispositions']);router[_0xc8a2('0x8')](_0xc8a2('0xe'),auth[_0xc8a2('0x9')](),controller[_0xc8a2('0xf')]);router[_0xc8a2('0x8')](_0xc8a2('0x10'),auth['isAuthenticated'](),controller[_0xc8a2('0x11')]);router[_0xc8a2('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc8a2('0x12')]);router['get'](_0xc8a2('0x13'),auth['isAuthenticated'](),controller[_0xc8a2('0x14')]);router[_0xc8a2('0x15')]('/',auth['isAuthenticated'](),controller[_0xc8a2('0x16')]);router['post']('/:id/dispositions',auth[_0xc8a2('0x9')](),controller[_0xc8a2('0x17')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0xc8a2('0x18'),controller[_0xc8a2('0x19')]);router['post'](_0xc8a2('0x10'),auth[_0xc8a2('0x9')](),controller[_0xc8a2('0x1a')]);router[_0xc8a2('0x15')](_0xc8a2('0x13'),auth[_0xc8a2('0x9')](),controller[_0xc8a2('0x1b')]);router['post'](_0xc8a2('0x1c'),auth['isAuthenticated'](),controller[_0xc8a2('0x1d')]);router['put'](_0xc8a2('0xc'),auth[_0xc8a2('0x9')](),controller[_0xc8a2('0x1e')]);router[_0xc8a2('0x1f')](_0xc8a2('0xc'),auth[_0xc8a2('0x9')](),controller[_0xc8a2('0x20')]);router[_0xc8a2('0x1f')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc8a2('0x21')]);router[_0xc8a2('0x1f')](_0xc8a2('0xe'),auth['isAuthenticated'](),controller[_0xc8a2('0x22')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xc8a2('0x23')]);module[_0xc8a2('0x24')]=router; \ No newline at end of file +var _0x4f41=['addApplications','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','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/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','/:id/users','getAgents','create','post','addDisposition','addAnswer','/:id/notify','notify','/:id/applications'];(function(_0x3559b0,_0x10cf18){var _0xab1f55=function(_0x4dfda5){while(--_0x4dfda5){_0x3559b0['push'](_0x3559b0['shift']());}};_0xab1f55(++_0x10cf18);}(_0x4f41,0x121));var _0x14f4=function(_0x4d8744,_0x203345){_0x4d8744=_0x4d8744-0x0;var _0x17fb37=_0x4f41[_0x4d8744];return _0x17fb37;};'use strict';var multer=require(_0x14f4('0x0'));var util=require('util');var path=require(_0x14f4('0x1'));var timeout=require(_0x14f4('0x2'));var express=require(_0x14f4('0x3'));var router=express[_0x14f4('0x4')]();var fs_extra=require(_0x14f4('0x5'));var auth=require(_0x14f4('0x6'));var interaction=require(_0x14f4('0x7'));var config=require(_0x14f4('0x8'));var controller=require('./openchannelAccount.controller');router[_0x14f4('0x9')]('/',auth[_0x14f4('0xa')](),controller[_0x14f4('0xb')]);router[_0x14f4('0x9')](_0x14f4('0xc'),auth['isAuthenticated'](),controller[_0x14f4('0xd')]);router[_0x14f4('0x9')](_0x14f4('0xe'),auth[_0x14f4('0xa')](),controller[_0x14f4('0xf')]);router[_0x14f4('0x9')](_0x14f4('0x10'),auth['isAuthenticated'](),controller[_0x14f4('0x11')]);router[_0x14f4('0x9')](_0x14f4('0x12'),auth[_0x14f4('0xa')](),controller[_0x14f4('0x13')]);router[_0x14f4('0x9')]('/:id/applications',auth[_0x14f4('0xa')](),controller[_0x14f4('0x14')]);router[_0x14f4('0x9')](_0x14f4('0x15'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x14f4('0x9')](_0x14f4('0x16'),auth['isAuthenticated'](),controller[_0x14f4('0x17')]);router['post']('/',auth[_0x14f4('0xa')](),controller[_0x14f4('0x18')]);router[_0x14f4('0x19')](_0x14f4('0x10'),auth['isAuthenticated'](),controller[_0x14f4('0x1a')]);router[_0x14f4('0x19')](_0x14f4('0x12'),auth[_0x14f4('0xa')](),controller[_0x14f4('0x1b')]);router[_0x14f4('0x19')](_0x14f4('0x1c'),controller[_0x14f4('0x1d')]);router['post'](_0x14f4('0x1e'),auth[_0x14f4('0xa')](),controller[_0x14f4('0x1f')]);router[_0x14f4('0x19')]('/:id/users',auth[_0x14f4('0xa')](),controller['addAgents']);router[_0x14f4('0x19')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x14f4('0x20')]('/:id',auth['isAuthenticated'](),controller[_0x14f4('0x21')]);router[_0x14f4('0x22')](_0x14f4('0xe'),auth['isAuthenticated'](),controller[_0x14f4('0x23')]);router['delete'](_0x14f4('0x10'),auth[_0x14f4('0xa')](),controller[_0x14f4('0x24')]);router[_0x14f4('0x22')]('/:id/canned_answers',auth[_0x14f4('0xa')](),controller[_0x14f4('0x25')]);router['delete']('/:id/users',auth[_0x14f4('0xa')](),controller[_0x14f4('0x26')]);module[_0x14f4('0x27')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 893261f..185b5bd 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 _0x4571=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','exports','name','STRING'];(function(_0x4aa21f,_0x441927){var _0x4055b8=function(_0x1b0f5c){while(--_0x1b0f5c){_0x4aa21f['push'](_0x4aa21f['shift']());}};_0x4055b8(++_0x441927);}(_0x4571,0xc7));var _0x1457=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0x4571[_0x4b6830];return _0x239e4a;};'use strict';var Sequelize=require(_0x1457('0x0'));var rs=require(_0x1457('0x1'));module[_0x1457('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x1457('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x1457('0x4')]},'token':{'type':Sequelize[_0x1457('0x4')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x1457('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1457('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1457('0x5')],'defaultValue':function(){return _0x1457('0x6');}},'notificationSound':{'type':Sequelize[_0x1457('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1457('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1457('0x4')]},'queueTransfer':{'type':Sequelize[_0x1457('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1457('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1457('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1457('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x1457('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1457('0xa'),'set':function(_0xd6ba91){if(!_0xd6ba91)this[_0x1457('0xb')]('mandatoryDispositionPauseId',null);this[_0x1457('0xb')]('mandatoryDisposition',_0xd6ba91);}}}; \ No newline at end of file +var _0xca7f=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x89ca73,_0x131eb9){var _0x1645c7=function(_0x20df3a){while(--_0x20df3a){_0x89ca73['push'](_0x89ca73['shift']());}};_0x1645c7(++_0x131eb9);}(_0xca7f,0x9f));var _0xfca7=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0xca7f[_0x4e170e];return _0x338291;};'use strict';var Sequelize=require(_0xfca7('0x0'));var rs=require(_0xfca7('0x1'));module['exports']={'name':{'type':Sequelize[_0xfca7('0x2')],'unique':_0xfca7('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xfca7('0x2')]},'token':{'type':Sequelize[_0xfca7('0x2')],'defaultValue':function(){return rs[_0xfca7('0x4')]();}},'replyUri':{'type':Sequelize[_0xfca7('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfca7('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xfca7('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfca7('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfca7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xfca7('0x2')]},'queueTransfer':{'type':Sequelize[_0xfca7('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfca7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfca7('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfca7('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xfca7('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1ced1d){if(!_0x1ced1d)this[_0xfca7('0x9')](_0xfca7('0xa'),null);this[_0xfca7('0x9')](_0xfca7('0xb'),_0x1ced1d);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 7feeec3..62d3555 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 _0x146b=['addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','DESC','Applications','account','applications','list','List','orderBy','priority','asc','Contacts','CmContact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','created','interaction','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','addApplications','sequelize','Transaction','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','order','removeDispositions'];(function(_0x592992,_0x5c5297){var _0x116413=function(_0x4bfb07){while(--_0x4bfb07){_0x592992['push'](_0x592992['shift']());}};_0x116413(++_0x5c5297);}(_0x146b,0x10d));var _0xb146=function(_0x38f730,_0x2c7523){_0x38f730=_0x38f730-0x0;var _0x233bf4=_0x146b[_0x38f730];return _0x233bf4;};'use strict';var emlformat=require(_0xb146('0x0'));var rimraf=require(_0xb146('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb146('0x2'));var rp=require(_0xb146('0x3'));var moment=require(_0xb146('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb146('0x5'));var util=require(_0xb146('0x6'));var path=require(_0xb146('0x7'));var sox=require(_0xb146('0x8'));var csv=require(_0xb146('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb146('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb146('0xb'));var jsforce=require(_0xb146('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb146('0xd'));var Papa=require(_0xb146('0xe'));var Redis=require('ioredis');var authService=require(_0xb146('0xf'));var qs=require(_0xb146('0x10'));var as=require(_0xb146('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb146('0x12'))(_0xb146('0x13'));var utils=require(_0xb146('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb146('0x15'));var db=require(_0xb146('0x16'))['db'];config[_0xb146('0x17')]=_[_0xb146('0x18')](config[_0xb146('0x17')],{'host':_0xb146('0x19'),'port':0x18eb});var socket=require(_0xb146('0x1a'))(new Redis(config[_0xb146('0x17')]));require(_0xb146('0x1b'))[_0xb146('0x1c')](socket);var jayson=require(_0xb146('0x1d'));var client=jayson[_0xb146('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xb146('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c3337,_0x171188,_0xb56bf9,_0x524564){return new BPromise(function(_0x2ecbd1,_0x9d2837){var _0x55a526=_0x524564||client;return _0x55a526[_0xb146('0x1f')](_0x2c3337,_0xb56bf9)[_0xb146('0x20')](function(_0xe86be9){logger[_0xb146('0x21')](_0xb146('0x22'),_0x171188,_0xb146('0x23'));logger[_0xb146('0x24')](_0xb146('0x25'),_0x171188,_0xb146('0x23'),JSON[_0xb146('0x26')](_0xe86be9));if(_0xe86be9[_0xb146('0x27')]){if(_0xe86be9['error'][_0xb146('0x28')]===0x1f4){logger[_0xb146('0x27')](_0xb146('0x22'),_0x171188,_0xe86be9[_0xb146('0x27')][_0xb146('0x29')]);return _0x9d2837(_0xe86be9['error']['message']);}logger[_0xb146('0x27')](_0xb146('0x22'),_0x171188,_0xe86be9[_0xb146('0x27')][_0xb146('0x29')]);return _0x2ecbd1(_0xe86be9[_0xb146('0x27')][_0xb146('0x29')]);}else{logger[_0xb146('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x171188,_0xb146('0x23'));_0x2ecbd1(_0xe86be9['result'][_0xb146('0x29')]);}})[_0xb146('0x2a')](function(_0x2afa8d){logger['error'](_0xb146('0x22'),_0x171188,_0x2afa8d);_0x9d2837(_0x2afa8d);});});}function respondWithStatusCode(_0xdd20fd,_0x3a92ce){_0x3a92ce=_0x3a92ce||0xcc;return function(_0x14df2d){if(_0x14df2d){return _0xdd20fd['sendStatus'](_0x3a92ce);}return _0xdd20fd[_0xb146('0x2b')](_0x3a92ce)[_0xb146('0x2c')]();};}function respondWithResult(_0x2f2b30,_0x394436){_0x394436=_0x394436||0xc8;return function(_0x3f96f8){if(_0x3f96f8){return _0x2f2b30[_0xb146('0x2b')](_0x394436)[_0xb146('0x2d')](_0x3f96f8);}};}function respondWithFilteredResult(_0x4add2c,_0x5024e5){return function(_0x22217a){if(_0x22217a){var _0x136883=typeof _0x5024e5[_0xb146('0x2e')]===_0xb146('0x2f')&&typeof _0x5024e5[_0xb146('0x30')]===_0xb146('0x2f');var _0x34c16=_0x22217a[_0xb146('0x31')];var _0x3334d2=_0x136883?0x0:_0x5024e5[_0xb146('0x2e')];var _0x2cab02=_0x136883?_0x22217a[_0xb146('0x31')]:_0x5024e5[_0xb146('0x2e')]+_0x5024e5[_0xb146('0x30')];var _0x3d512d;if(_0x2cab02>=_0x34c16){_0x2cab02=_0x34c16;_0x3d512d=0xc8;}else{_0x3d512d=0xce;}_0x4add2c['status'](_0x3d512d);return _0x4add2c['set'](_0xb146('0x32'),_0x3334d2+'-'+_0x2cab02+'/'+_0x34c16)['json'](_0x22217a);}return null;};}function patchUpdates(_0x1c64c1){return function(_0x44a359){try{jsonpatch['apply'](_0x44a359,_0x1c64c1,!![]);}catch(_0x18923d){return BPromise[_0xb146('0x33')](_0x18923d);}return _0x44a359[_0xb146('0x34')]();};}function saveUpdates(_0x1428cd,_0x5de737){return function(_0x1760ce){if(_0x1760ce){return _0x1760ce[_0xb146('0x35')](_0x1428cd)[_0xb146('0x20')](function(_0x200ee8){return _0x200ee8;});}return null;};}function removeEntity(_0x2f4aa6,_0x2a4ea1){return function(_0x3f6963){if(_0x3f6963){return _0x3f6963[_0xb146('0x36')]()[_0xb146('0x20')](function(){var _0x2df390=_0x3f6963[_0xb146('0x37')]({'plain':!![]});var _0x311162=_0xb146('0x38');return db[_0xb146('0x39')][_0xb146('0x36')]({'where':{'type':_0x311162,'resourceId':_0x2df390['id']}})[_0xb146('0x20')](function(){return _0x3f6963;});})[_0xb146('0x20')](function(){_0x2f4aa6['status'](0xcc)[_0xb146('0x2c')]();});}};}function handleEntityNotFound(_0x5ad0f5,_0x127d38){return function(_0x29a343){if(!_0x29a343){_0x5ad0f5[_0xb146('0x3a')](0x194);}return _0x29a343;};}function handleError(_0x175d9c,_0x2953eb){_0x2953eb=_0x2953eb||0x1f4;return function(_0x5c4c30){logger['error'](_0x5c4c30[_0xb146('0x3b')]);if(_0x5c4c30['name']){delete _0x5c4c30[_0xb146('0x3c')];}_0x175d9c['status'](_0x2953eb)[_0xb146('0x3d')](_0x5c4c30);};}exports[_0xb146('0x3e')]=function(_0x2b56ca,_0x305060){var _0x4bc738={'include':[{'model':db[_0xb146('0x3f')],'as':_0xb146('0x40')}]},_0x23ab02={},_0x1443ef={'count':0x0,'rows':[]};var _0x23eb54=_[_0xb146('0x41')](db[_0xb146('0x42')][_0xb146('0x43')],function(_0x16430c){return{'name':_0x16430c[_0xb146('0x44')],'type':_0x16430c['type']['key']};});_0x23ab02['model']=_[_0xb146('0x41')](_0x23eb54,_0xb146('0x3c'));_0x23ab02[_0xb146('0x45')]=_[_0xb146('0x46')](_0x2b56ca[_0xb146('0x45')]);_0x23ab02[_0xb146('0x47')]=_[_0xb146('0x48')](_0x23ab02[_0xb146('0x49')],_0x23ab02[_0xb146('0x45')]);_0x4bc738['attributes']=_['intersection'](_0x23ab02[_0xb146('0x49')],qs[_0xb146('0x4a')](_0x2b56ca[_0xb146('0x45')]['fields']));_0x4bc738[_0xb146('0x4b')]=_0x4bc738[_0xb146('0x4b')][_0xb146('0x4c')]?_0x4bc738[_0xb146('0x4b')]:_0x23ab02['model'];if(!_0x2b56ca[_0xb146('0x45')][_0xb146('0x4d')](_0xb146('0x4e'))){_0x4bc738[_0xb146('0x30')]=qs['limit'](_0x2b56ca[_0xb146('0x45')][_0xb146('0x30')]);_0x4bc738[_0xb146('0x2e')]=qs['offset'](_0x2b56ca[_0xb146('0x45')][_0xb146('0x2e')]);}_0x4bc738['order']=qs[_0xb146('0x4f')](_0x2b56ca[_0xb146('0x45')][_0xb146('0x4f')]);_0x4bc738['where']=qs['filters'](_[_0xb146('0x50')](_0x2b56ca[_0xb146('0x45')],_0x23ab02[_0xb146('0x47')]),_0x23eb54);if(_0x2b56ca['query'][_0xb146('0x51')]){_0x4bc738[_0xb146('0x52')]=_[_0xb146('0x53')](_0x4bc738[_0xb146('0x52')],{'$or':_['map'](_0x23eb54,function(_0x42660c){if(_0x42660c['type']!==_0xb146('0x54')){var _0x38fd0c={};_0x38fd0c[_0x42660c[_0xb146('0x3c')]]={'$like':'%'+_0x2b56ca[_0xb146('0x45')][_0xb146('0x51')]+'%'};return _0x38fd0c;}})});}_0x4bc738=_['merge']({},_0x4bc738,_0x2b56ca['options']);var _0x1305d7={'where':_0x4bc738[_0xb146('0x52')]};return db['OpenchannelAccount'][_0xb146('0x31')](_0x1305d7)[_0xb146('0x20')](function(_0x34b197){_0x1443ef[_0xb146('0x31')]=_0x34b197;if(_0x2b56ca[_0xb146('0x45')][_0xb146('0x55')]){_0x4bc738[_0xb146('0x56')]=[{'all':!![]}];}return db[_0xb146('0x42')][_0xb146('0x57')](_0x4bc738);})[_0xb146('0x20')](function(_0x98d74){_0x1443ef[_0xb146('0x58')]=_0x98d74;return _0x1443ef;})[_0xb146('0x20')](respondWithFilteredResult(_0x305060,_0x4bc738))['catch'](handleError(_0x305060,null));};exports['show']=function(_0x1315ba,_0x1df3ef){var _0x131c12={'raw':![],'where':{'id':_0x1315ba[_0xb146('0x59')]['id']},'include':[{'model':db[_0xb146('0x3f')],'as':_0xb146('0x40')}]},_0x4dc247={};_0x4dc247['model']=_[_0xb146('0x46')](db[_0xb146('0x42')]['rawAttributes']);_0x4dc247[_0xb146('0x45')]=_[_0xb146('0x46')](_0x1315ba[_0xb146('0x45')]);_0x4dc247[_0xb146('0x47')]=_[_0xb146('0x48')](_0x4dc247['model'],_0x4dc247[_0xb146('0x45')]);_0x131c12['attributes']=_['intersection'](_0x4dc247[_0xb146('0x49')],qs[_0xb146('0x4a')](_0x1315ba['query'][_0xb146('0x4a')]));_0x131c12[_0xb146('0x4b')]=_0x131c12[_0xb146('0x4b')][_0xb146('0x4c')]?_0x131c12[_0xb146('0x4b')]:_0x4dc247[_0xb146('0x49')];if(_0x1315ba[_0xb146('0x45')][_0xb146('0x55')]){_0x131c12[_0xb146('0x56')]=[{'all':!![]}];}_0x131c12=_[_0xb146('0x53')]({},_0x131c12,_0x1315ba[_0xb146('0x5a')]);return db[_0xb146('0x42')][_0xb146('0x5b')](_0x131c12)['then'](handleEntityNotFound(_0x1df3ef,null))[_0xb146('0x20')](respondWithResult(_0x1df3ef,null))[_0xb146('0x2a')](handleError(_0x1df3ef,null));};exports[_0xb146('0x5c')]=function(_0x59e71c,_0x4ef8c1){return db['OpenchannelAccount'][_0xb146('0x5c')](_0x59e71c[_0xb146('0x5d')],{})[_0xb146('0x20')](function(_0x5de2a1){var _0x19b2a5=_0x59e71c[_0xb146('0x5e')]['get']({'plain':!![]});if(!_0x19b2a5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19b2a5[_0xb146('0x5f')]===_0xb146('0x5e')){var _0x123b46=_0x5de2a1[_0xb146('0x37')]({'plain':!![]});var _0x5a2441='OpenchannelAccounts';return db[_0xb146('0x60')]['find']({'where':{'name':_0x5a2441,'userProfileId':_0x19b2a5[_0xb146('0x61')]},'raw':!![]})[_0xb146('0x20')](function(_0x2e7e06){if(_0x2e7e06&&_0x2e7e06[_0xb146('0x62')]===0x0){return db[_0xb146('0x39')][_0xb146('0x5c')]({'name':_0x123b46[_0xb146('0x3c')],'resourceId':_0x123b46['id'],'type':_0x2e7e06['name'],'sectionId':_0x2e7e06['id']},{})[_0xb146('0x20')](function(){return _0x5de2a1;});}else{return _0x5de2a1;}})[_0xb146('0x2a')](function(_0x58454c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58454c);throw _0x58454c;});}return _0x5de2a1;})['then'](respondWithResult(_0x4ef8c1,0xc9))['catch'](handleError(_0x4ef8c1,null));};exports['update']=function(_0x4810c6,_0x469122){if(_0x4810c6[_0xb146('0x5d')]['id']){delete _0x4810c6[_0xb146('0x5d')]['id'];}return db[_0xb146('0x42')][_0xb146('0x5b')]({'where':{'id':_0x4810c6[_0xb146('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0xb146('0x40')}]})[_0xb146('0x20')](handleEntityNotFound(_0x469122,null))[_0xb146('0x20')](saveUpdates(_0x4810c6[_0xb146('0x5d')],null))[_0xb146('0x20')](respondWithResult(_0x469122,null))[_0xb146('0x2a')](handleError(_0x469122,null));};exports[_0xb146('0x36')]=function(_0x30cc91,_0x52eb05){return db[_0xb146('0x42')][_0xb146('0x5b')]({'where':{'id':_0x30cc91['params']['id']}})[_0xb146('0x20')](handleEntityNotFound(_0x52eb05,null))[_0xb146('0x20')](removeEntity(_0x52eb05,null))[_0xb146('0x2a')](handleError(_0x52eb05,null));};exports[_0xb146('0x63')]=function(_0x4b3afb,_0x795fa0){return db[_0xb146('0x42')]['describe']()[_0xb146('0x20')](respondWithResult(_0x795fa0,null))[_0xb146('0x2a')](handleError(_0x795fa0,null));};exports[_0xb146('0x64')]=function(_0x144b58,_0x4d4466,_0x379ea7){if(_0x144b58[_0xb146('0x5d')]['id']){delete _0x144b58['body']['id'];}return db[_0xb146('0x42')][_0xb146('0x5b')]({'where':{'id':_0x144b58['params']['id']}})[_0xb146('0x20')](handleEntityNotFound(_0x4d4466,null))[_0xb146('0x20')](function(_0x5ad464){if(_0x5ad464){_0x144b58[_0xb146('0x5d')][_0xb146('0x65')]=_0x5ad464['id'];return db['Disposition']['create'](_0x144b58['body']);}})[_0xb146('0x20')](respondWithResult(_0x4d4466,null))[_0xb146('0x2a')](handleError(_0x4d4466,null));};exports[_0xb146('0x66')]=function(_0x377a23,_0x10ad97,_0x3f29b2){var _0x2d1813={'raw':![],'where':{}};var _0x2fdaf4={};var _0x14cbb8={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xb146('0x67')]({'where':{'id':_0x377a23[_0xb146('0x59')]['id']}})[_0xb146('0x20')](handleEntityNotFound(_0x10ad97,null))[_0xb146('0x20')](function(_0x1109b0){if(_0x1109b0){_0x2fdaf4[_0xb146('0x49')]=_[_0xb146('0x46')](db[_0xb146('0x68')][_0xb146('0x43')]);_0x2fdaf4['query']=_[_0xb146('0x46')](_0x377a23[_0xb146('0x45')]);_0x2fdaf4[_0xb146('0x47')]=_[_0xb146('0x48')](_0x2fdaf4[_0xb146('0x49')],_0x2fdaf4[_0xb146('0x45')]);_0x2d1813[_0xb146('0x4b')]=_[_0xb146('0x48')](_0x2fdaf4[_0xb146('0x49')],qs[_0xb146('0x4a')](_0x377a23[_0xb146('0x45')]['fields']));_0x2d1813['attributes']=_0x2d1813[_0xb146('0x4b')][_0xb146('0x4c')]?_0x2d1813[_0xb146('0x4b')]:_0x2fdaf4[_0xb146('0x49')];if(!_0x377a23[_0xb146('0x45')][_0xb146('0x4d')](_0xb146('0x4e'))){_0x2d1813[_0xb146('0x30')]=qs['limit'](_0x377a23[_0xb146('0x45')][_0xb146('0x30')]);_0x2d1813['offset']=qs[_0xb146('0x2e')](_0x377a23[_0xb146('0x45')][_0xb146('0x2e')]);}_0x2d1813[_0xb146('0x69')]=qs[_0xb146('0x4f')](_0x377a23[_0xb146('0x45')][_0xb146('0x4f')]);_0x2d1813['where']=qs[_0xb146('0x47')](_[_0xb146('0x50')](_0x377a23[_0xb146('0x45')],_0x2fdaf4['filters']));_0x2d1813[_0xb146('0x52')]['OpenchannelAccountId']=_0x1109b0['id'];if(_0x377a23['query']['filter']){_0x2d1813[_0xb146('0x52')]=_[_0xb146('0x53')](_0x2d1813['where'],{'$or':_['map'](_0x2d1813[_0xb146('0x4b')],function(_0x23b96b){var _0x94cb9={};_0x94cb9[_0x23b96b]={'$like':'%'+_0x377a23[_0xb146('0x45')]['filter']+'%'};return _0x94cb9;})});}_0x2d1813=_[_0xb146('0x53')]({},_0x2d1813,_0x377a23[_0xb146('0x5a')]);return db[_0xb146('0x68')][_0xb146('0x31')]({'where':_0x2d1813[_0xb146('0x52')]})['then'](function(_0x1be598){_0x14cbb8['count']=_0x1be598;if(_0x377a23[_0xb146('0x45')][_0xb146('0x55')]){_0x2d1813[_0xb146('0x56')]=[{'all':!![]}];}return db[_0xb146('0x68')][_0xb146('0x57')](_0x2d1813);})[_0xb146('0x20')](function(_0x35dde7){_0x14cbb8[_0xb146('0x58')]=_0x35dde7;return _0x14cbb8;});}})[_0xb146('0x20')](respondWithFilteredResult(_0x10ad97,_0x2d1813))[_0xb146('0x2a')](handleError(_0x10ad97,null));};exports[_0xb146('0x6a')]=function(_0x511e2d,_0x57232f,_0x49518e){return db[_0xb146('0x42')][_0xb146('0x5b')]({'where':{'id':_0x511e2d[_0xb146('0x59')]['id']}})[_0xb146('0x20')](handleEntityNotFound(_0x57232f,null))[_0xb146('0x20')](function(_0x232c3f){if(_0x232c3f){return _0x232c3f[_0xb146('0x6a')](_0x511e2d[_0xb146('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x57232f,null))[_0xb146('0x2a')](handleError(_0x57232f,null));};exports[_0xb146('0x6b')]=function(_0x3e25c6,_0x12a014,_0x57ff54){if(_0x3e25c6[_0xb146('0x5d')]['id']){delete _0x3e25c6['body']['id'];}return db[_0xb146('0x42')][_0xb146('0x5b')]({'where':{'id':_0x3e25c6['params']['id']}})['then'](handleEntityNotFound(_0x12a014,null))[_0xb146('0x20')](function(_0x43261a){if(_0x43261a){_0x3e25c6[_0xb146('0x5d')][_0xb146('0x65')]=_0x43261a['id'];return db[_0xb146('0x6c')][_0xb146('0x5c')](_0x3e25c6[_0xb146('0x5d')]);}})[_0xb146('0x20')](respondWithResult(_0x12a014,null))['catch'](handleError(_0x12a014,null));};exports[_0xb146('0x6d')]=function(_0x13ac87,_0x405fe7,_0x1b3e4a){var _0xb3a75d={'raw':![],'where':{}};var _0x528e97={};var _0x55d1f1={'count':0x0,'rows':[]};return db[_0xb146('0x42')]['findOne']({'where':{'id':_0x13ac87['params']['id']}})[_0xb146('0x20')](handleEntityNotFound(_0x405fe7,null))[_0xb146('0x20')](function(_0x43c967){if(_0x43c967){_0x528e97[_0xb146('0x49')]=_[_0xb146('0x46')](db[_0xb146('0x6c')][_0xb146('0x43')]);_0x528e97['query']=_[_0xb146('0x46')](_0x13ac87[_0xb146('0x45')]);_0x528e97[_0xb146('0x47')]=_['intersection'](_0x528e97[_0xb146('0x49')],_0x528e97[_0xb146('0x45')]);_0xb3a75d[_0xb146('0x4b')]=_['intersection'](_0x528e97[_0xb146('0x49')],qs[_0xb146('0x4a')](_0x13ac87[_0xb146('0x45')][_0xb146('0x4a')]));_0xb3a75d[_0xb146('0x4b')]=_0xb3a75d[_0xb146('0x4b')]['length']?_0xb3a75d[_0xb146('0x4b')]:_0x528e97[_0xb146('0x49')];if(!_0x13ac87[_0xb146('0x45')]['hasOwnProperty'](_0xb146('0x4e'))){_0xb3a75d['limit']=qs[_0xb146('0x30')](_0x13ac87[_0xb146('0x45')][_0xb146('0x30')]);_0xb3a75d[_0xb146('0x2e')]=qs[_0xb146('0x2e')](_0x13ac87[_0xb146('0x45')][_0xb146('0x2e')]);}_0xb3a75d['order']=qs[_0xb146('0x4f')](_0x13ac87[_0xb146('0x45')][_0xb146('0x4f')]);_0xb3a75d['where']=qs[_0xb146('0x47')](_[_0xb146('0x50')](_0x13ac87[_0xb146('0x45')],_0x528e97[_0xb146('0x47')]));_0xb3a75d['where'][_0xb146('0x65')]=_0x43c967['id'];if(_0x13ac87[_0xb146('0x45')][_0xb146('0x51')]){_0xb3a75d[_0xb146('0x52')]=_['merge'](_0xb3a75d['where'],{'$or':_['map'](_0xb3a75d[_0xb146('0x4b')],function(_0x11fccc){var _0x5bbcc5={};_0x5bbcc5[_0x11fccc]={'$like':'%'+_0x13ac87['query'][_0xb146('0x51')]+'%'};return _0x5bbcc5;})});}_0xb3a75d=_[_0xb146('0x53')]({},_0xb3a75d,_0x13ac87[_0xb146('0x5a')]);return db['CannedAnswer'][_0xb146('0x31')]({'where':_0xb3a75d[_0xb146('0x52')]})[_0xb146('0x20')](function(_0x313e03){_0x55d1f1['count']=_0x313e03;if(_0x13ac87[_0xb146('0x45')][_0xb146('0x55')]){_0xb3a75d[_0xb146('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb146('0x57')](_0xb3a75d);})[_0xb146('0x20')](function(_0x1cc95b){_0x55d1f1['rows']=_0x1cc95b;return _0x55d1f1;});}})['then'](respondWithFilteredResult(_0x405fe7,_0xb3a75d))[_0xb146('0x2a')](handleError(_0x405fe7,null));};exports[_0xb146('0x6e')]=function(_0x455889,_0x5c16c8,_0x4e6754){return db['OpenchannelAccount'][_0xb146('0x5b')]({'where':{'id':_0x455889[_0xb146('0x59')]['id']}})[_0xb146('0x20')](handleEntityNotFound(_0x5c16c8,null))['then'](function(_0x45279c){if(_0x45279c){return _0x45279c[_0xb146('0x6e')](_0x455889[_0xb146('0x45')][_0xb146('0x6f')]);}})[_0xb146('0x20')](respondWithStatusCode(_0x5c16c8,null))[_0xb146('0x2a')](handleError(_0x5c16c8,null));};exports[_0xb146('0x70')]=function(_0x25d368,_0x5df4da,_0x22165f){var _0x29966f={'body':_0x25d368['body'],'channel':'openchannel'};var _0x16e8b6=[];var _0x38c463=[];var _0x43a176={};var _0x19a63c=![];return db['CmContact'][_0xb146('0x63')]()[_0xb146('0x20')](function(_0x41ce27){if(!_0x41ce27){throw new db[(_0xb146('0x71'))][(_0xb146('0x72'))]('no\x20available\x20attributes');}_0x16e8b6=_[_0xb146('0x73')](_['keys'](_0x41ce27),[_0xb146('0x74'),_0xb146('0x75')]);_0x38c463=_[_0xb146('0x73')](_['keys'](_0x41ce27),['createdAt',_0xb146('0x75'),_0xb146('0x76'),_0xb146('0x77')]);if(_0x25d368[_0xb146('0x5d')]['id']){delete _0x25d368[_0xb146('0x5d')]['id'];}if(_['isNil'](_0x25d368[_0xb146('0x5d')]['from'])){throw new db[(_0xb146('0x71'))]['ValidationError'](_0xb146('0x78'));}if(_[_0xb146('0x79')](_0x25d368[_0xb146('0x5d')][_0xb146('0x5d')])||_0x25d368[_0xb146('0x5d')][_0xb146('0x5d')]===''){throw new db[(_0xb146('0x71'))][(_0xb146('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb146('0x79')](_0x25d368[_0xb146('0x5d')][_0xb146('0x7a')])){throw new db[(_0xb146('0x71'))][(_0xb146('0x72'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x38c463);}if(!_[_0xb146('0x7b')](_0x38c463,_0x25d368[_0xb146('0x5d')][_0xb146('0x7a')])){throw new db[(_0xb146('0x71'))][(_0xb146('0x72'))](_0xb146('0x7c')+_0x38c463);}_0x43a176[_0x25d368[_0xb146('0x5d')][_0xb146('0x7a')]]=_0x25d368[_0xb146('0x5d')][_0xb146('0x7d')];})[_0xb146('0x20')](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x25d368[_0xb146('0x59')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x43a176,'limit':0x1,'order':[['updatedAt',_0xb146('0x7e')]]}]},{'model':db['OpenchannelApplication'],'as':_0xb146('0x7f')}]});})[_0xb146('0x20')](handleEntityNotFound(_0x5df4da,null))[_0xb146('0x20')](function(_0x2813d5){if(_0x2813d5&&_0x2813d5['List']){_0x29966f[_0xb146('0x80')]=_0x2813d5;_0x29966f[_0xb146('0x81')]=_0x2813d5['Applications'];_0x29966f[_0xb146('0x82')]=_0x2813d5[_0xb146('0x83')];_0x29966f[_0xb146('0x81')]=_[_0xb146('0x84')](_0x29966f['applications'],[_0xb146('0x85')],[_0xb146('0x86')]);if(_0x29966f[_0xb146('0x80')][_0xb146('0x7f')]){delete _0x29966f[_0xb146('0x80')]['Applications'];}if(_0x29966f['account']['List']&&_0x29966f['account'][_0xb146('0x83')][_0xb146('0x87')][_0xb146('0x4c')]){return _0x29966f[_0xb146('0x80')][_0xb146('0x83')][_0xb146('0x87')][0x0];}var _0x2905ef=_[_0xb146('0x18')](_0x25d368[_0xb146('0x5d')],{'firstName':_0x25d368[_0xb146('0x5d')]['from'],'ListId':_0x2813d5['ListId']});_0x2905ef[_0x25d368[_0xb146('0x5d')][_0xb146('0x7a')]]=_0x25d368[_0xb146('0x5d')][_0xb146('0x7d')];return db[_0xb146('0x88')][_0xb146('0x5c')](_0x2905ef,{'fields':_0x16e8b6,'raw':!![]});}})['then'](handleEntityNotFound(_0x5df4da,null))[_0xb146('0x20')](function(_0x110095){_0x29966f['contact']=_0x110095;if(_0x110095){var _0x87a946={'ContactId':_0x110095['id'],'OpenchannelAccountId':_0x25d368['params']['id'],'from':(_0x110095['firstName']||'')+'\x20'+(_0x110095[_0xb146('0x89')]||'')};var _0x21521={'OpenchannelAccountId':_0x25d368[_0xb146('0x59')]['id'],'closed':![]};if(_0x25d368[_0xb146('0x5d')][_0xb146('0x8a')]){_0x21521['threadId']=_0x25d368[_0xb146('0x5d')][_0xb146('0x8a')];return db[_0xb146('0x8b')][_0xb146('0x5b')]({'where':_0x21521})[_0xb146('0x20')](function(_0x4c1730){if(_0x4c1730){return[_0x4c1730,![]];}_0x87a946[_0xb146('0x8a')]=_0x25d368[_0xb146('0x5d')]['threadId'];_0x87a946['externalUrl']=_0x25d368['body'][_0xb146('0x8c')];return db[_0xb146('0x8b')][_0xb146('0x5c')](_0x87a946)[_0xb146('0x20')](function(_0x14f508){return[_0x14f508,!![]];});});}else{_0x21521[_0xb146('0x8a')]=null;}_0x21521[_0xb146('0x8d')]=_0x110095['id'];return db['OpenchannelInteraction'][_0xb146('0x5b')]({'where':_0x21521})[_0xb146('0x20')](function(_0x4e0565){if(_0x4e0565){return[_0x4e0565,![]];}return db[_0xb146('0x8b')]['create'](_0x87a946)[_0xb146('0x20')](function(_0x4fbbf8){return[_0x4fbbf8,!![]];});});}})[_0xb146('0x8e')](function(_0x2a01b0,_0x578fbb){if(_0x2a01b0){_0x19a63c=_0x578fbb;if(!_0x578fbb){var _0x40a29c={'from':(_0x29966f['contact']['firstName']||'')+'\x20'+(_0x29966f[_0xb146('0x8f')][_0xb146('0x89')]||'')};if(_0x25d368[_0xb146('0x5d')][_0xb146('0x8a')]&&_0x25d368[_0xb146('0x5d')]['messageId']&&_0x25d368[_0xb146('0x5d')][_0xb146('0x8a')]!=_0x25d368['body'][_0xb146('0x90')]){_0x40a29c[_0xb146('0x8a')]=_0x25d368['body']['messageId'];}return _0x2a01b0[_0xb146('0x35')](_0x40a29c);}else{return _0x2a01b0;}}})[_0xb146('0x20')](function(_0x509acc){_0x29966f['interaction']=_0x509acc[_0xb146('0x37')]({'plain':!![]});_0x29966f['interaction'][_0xb146('0x91')]=_0x19a63c;if(_0x29966f[_0xb146('0x92')]['created']){if(_0x29966f['account'][_0xb146('0x93')]){_0x29966f[_0xb146('0x81')][_0xb146('0x94')]({'id':0x0,'priority':_0x29966f[_0xb146('0x81')][_0xb146('0x4c')]+0x1,'app':'close','appdata':_0xb146('0x95'),'interval':_0xb146('0x96')});}}return db[_0xb146('0x97')][_0xb146('0x5c')]({'body':_0x25d368[_0xb146('0x5d')][_0xb146('0x5d')],'OpenchannelAccountId':_0x25d368[_0xb146('0x59')]['id'],'OpenchannelInteractionId':_0x509acc['id'],'direction':'in','ContactId':_0x29966f[_0xb146('0x8f')]['id'],'AttachmentId':_0x25d368[_0xb146('0x5d')][_0xb146('0x98')]});})[_0xb146('0x20')](function(_0x52fe67){_0x29966f[_0xb146('0x29')]=_0x52fe67;if(_0x29966f['interaction'][_0xb146('0x99')]){return db[_0xb146('0x9a')][_0xb146('0x5b')]({'attributes':['id',_0xb146('0x3c')],'where':{'id':_0x29966f['interaction'][_0xb146('0x99')]}})[_0xb146('0x20')](function(_0x2675ba){if(_0x2675ba){_0x29966f[_0xb146('0x81')][_0xb146('0x9b')]({'id':0x0,'priority':0x0,'app':_0xb146('0x9c'),'appdata':_0x2675ba['name']+','+(_0x29966f[_0xb146('0x80')][_0xb146('0x9d')]||0xa),'interval':_0xb146('0x96')});_0x29966f['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0xb146('0x9e'),_0x29966f);});}return respondWithRpcPromise(_0xb146('0x9f'),_0xb146('0x9e'),_0x29966f);})['then'](function(_0x3f2ee1){respondWithRpcPromise(_0xb146('0xa0'),_0xb146('0xa0'),{'event':_0xb146('0x70'),'message':_0x3f2ee1},client9002);return _0x3f2ee1;})['then'](respondWithResult(_0x5df4da,null))[_0xb146('0x2a')](handleError(_0x5df4da,null));};exports[_0xb146('0xa1')]=function(_0x1443c6,_0x2954c9){var _0x25e80a=_0x1443c6['params']['id'];var _0x156d6d=_0x1443c6[_0xb146('0x5d')];var _0x45d050=0xc8;var _0x440db2=null;return db[_0xb146('0xa2')]['transaction']({'isolationLevel':db[_0xb146('0xa2')][_0xb146('0xa3')]['ISOLATION_LEVELS'][_0xb146('0xa4')]},function(_0x431aeb){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x25e80a},'transaction':_0x431aeb})[_0xb146('0x20')](function(_0xf7ea51){if(_0xf7ea51){return db[_0xb146('0xa5')][_0xb146('0x36')]({'where':{'OpenchannelAccountId':_0x25e80a},'transaction':_0x431aeb})[_0xb146('0x20')](function(){var _0x53a01d=_['map'](_0x156d6d,function(_0x55ad78){_0x55ad78['OpenchannelAccountId']=_0x25e80a;return _0x55ad78;});return db[_0xb146('0xa5')][_0xb146('0xa6')](_0x53a01d,{'transaction':_0x431aeb});});}else{_0x45d050=0x194;_0x440db2=[];}});})[_0xb146('0x20')](function(){if(_0x45d050!==0x194){return db['OpenchannelApplication'][_0xb146('0xa7')]({'where':{'OpenchannelAccountId':_0x25e80a},'order':_0xb146('0x85')})[_0xb146('0x20')](function(_0x38cc22){_0x440db2=_0x38cc22;});}})[_0xb146('0x2a')](function(_0x574e74){_0x45d050=0x1f4;logger[_0xb146('0x27')](_0x574e74[_0xb146('0x3b')]);if(_0x574e74[_0xb146('0x3c')]){delete _0x574e74[_0xb146('0x3c')];}_0x440db2=_0x574e74;})[_0xb146('0xa8')](function(){if(_0x440db2===null){_0x2954c9[_0xb146('0x3a')](_0x45d050);}else{if(_0x45d050===0x1f4){_0x2954c9[_0xb146('0x2b')](_0x45d050)[_0xb146('0x3d')](_0x440db2);}else{_0x2954c9[_0xb146('0x2b')](_0x45d050)[_0xb146('0x2d')](_0x440db2);}}});};exports[_0xb146('0xa9')]=function(_0x26b6c1,_0x5338e8,_0x288208){var _0x504cbf={};var _0x2a5e63={};var _0xb0f52e;var _0x576398;return db[_0xb146('0x42')][_0xb146('0x67')]({'where':{'id':_0x26b6c1[_0xb146('0x59')]['id']}})[_0xb146('0x20')](handleEntityNotFound(_0x5338e8,null))['then'](function(_0x4d417c){if(_0x4d417c){_0xb0f52e=_0x4d417c;_0x2a5e63['model']=_['keys'](db[_0xb146('0xa5')][_0xb146('0x43')]);_0x2a5e63[_0xb146('0x45')]=_[_0xb146('0x46')](_0x26b6c1[_0xb146('0x45')]);_0x2a5e63['filters']=_[_0xb146('0x48')](_0x2a5e63[_0xb146('0x49')],_0x2a5e63[_0xb146('0x45')]);_0x504cbf['attributes']=_[_0xb146('0x48')](_0x2a5e63[_0xb146('0x49')],qs[_0xb146('0x4a')](_0x26b6c1[_0xb146('0x45')][_0xb146('0x4a')]));_0x504cbf[_0xb146('0x4b')]=_0x504cbf[_0xb146('0x4b')][_0xb146('0x4c')]?_0x504cbf['attributes']:_0x2a5e63['model'];_0x504cbf['order']=qs[_0xb146('0x4f')](_0x26b6c1[_0xb146('0x45')][_0xb146('0x4f')]);_0x504cbf[_0xb146('0x52')]=qs[_0xb146('0x47')](_[_0xb146('0x50')](_0x26b6c1[_0xb146('0x45')],_0x2a5e63[_0xb146('0x47')]));if(_0x26b6c1['query'][_0xb146('0x51')]){_0x504cbf[_0xb146('0x52')]=_[_0xb146('0x53')](_0x504cbf['where'],{'$or':_[_0xb146('0x41')](_0x504cbf[_0xb146('0x4b')],function(_0x3846c7){var _0x1aa83a={};_0x1aa83a[_0x3846c7]={'$like':'%'+_0x26b6c1[_0xb146('0x45')][_0xb146('0x51')]+'%'};return _0x1aa83a;})});}_0x504cbf=_[_0xb146('0x53')]({},_0x504cbf,_0x26b6c1['options']);return _0xb0f52e[_0xb146('0xa9')](_0x504cbf);}})[_0xb146('0x20')](function(_0x1a0e82){if(_0x1a0e82){_0x576398=_0x1a0e82[_0xb146('0x4c')];if(!_0x26b6c1[_0xb146('0x45')]['hasOwnProperty'](_0xb146('0x4e'))){_0x504cbf[_0xb146('0x30')]=qs['limit'](_0x26b6c1[_0xb146('0x45')][_0xb146('0x30')]);_0x504cbf[_0xb146('0x2e')]=qs['offset'](_0x26b6c1[_0xb146('0x45')]['offset']);}return _0xb0f52e['getApplications'](_0x504cbf);}})['then'](function(_0x1ba334){if(_0x1ba334){return _0x1ba334?{'count':_0x576398,'rows':_0x1ba334}:null;}})[_0xb146('0x20')](respondWithResult(_0x5338e8,null))[_0xb146('0x2a')](handleError(_0x5338e8,null));};exports[_0xb146('0xaa')]=function(_0x56c7e9,_0x30212f,_0x461176){var _0x49c3ea={'raw':![],'where':{}};var _0x2f48c3={};var _0x372839={'count':0x0,'rows':[]};return db[_0xb146('0x42')][_0xb146('0x67')]({'where':{'id':_0x56c7e9[_0xb146('0x59')]['id']}})[_0xb146('0x20')](handleEntityNotFound(_0x30212f,null))[_0xb146('0x20')](function(_0x176363){if(_0x176363){_0x2f48c3['model']=_[_0xb146('0x46')](db['OpenchannelInteraction'][_0xb146('0x43')]);_0x2f48c3[_0xb146('0x45')]=_['keys'](_0x56c7e9[_0xb146('0x45')]);_0x2f48c3[_0xb146('0x47')]=_[_0xb146('0x48')](_0x2f48c3[_0xb146('0x49')],_0x2f48c3[_0xb146('0x45')]);_0x49c3ea[_0xb146('0x4b')]=_[_0xb146('0x48')](_0x2f48c3['model'],qs[_0xb146('0x4a')](_0x56c7e9[_0xb146('0x45')][_0xb146('0x4a')]));_0x49c3ea['attributes']=_0x49c3ea['attributes'][_0xb146('0x4c')]?_0x49c3ea[_0xb146('0x4b')]:_0x2f48c3['model'];if(!_0x56c7e9[_0xb146('0x45')][_0xb146('0x4d')](_0xb146('0x4e'))){_0x49c3ea['limit']=qs[_0xb146('0x30')](_0x56c7e9[_0xb146('0x45')][_0xb146('0x30')]);_0x49c3ea[_0xb146('0x2e')]=qs[_0xb146('0x2e')](_0x56c7e9['query']['offset']);}_0x49c3ea['order']=qs[_0xb146('0x4f')](_0x56c7e9[_0xb146('0x45')]['sort']);_0x49c3ea[_0xb146('0x52')]=qs['filters'](_[_0xb146('0x50')](_0x56c7e9[_0xb146('0x45')],_0x2f48c3[_0xb146('0x47')]));_0x49c3ea[_0xb146('0x52')][_0xb146('0x65')]=_0x176363['id'];if(_0x56c7e9[_0xb146('0x45')]['filter']){_0x49c3ea[_0xb146('0x52')]=_[_0xb146('0x53')](_0x49c3ea[_0xb146('0x52')],{'$or':_[_0xb146('0x41')](_0x49c3ea[_0xb146('0x4b')],function(_0x3e1fb4){var _0x31cc03={};_0x31cc03[_0x3e1fb4]={'$like':'%'+_0x56c7e9['query'][_0xb146('0x51')]+'%'};return _0x31cc03;})});}_0x49c3ea=_[_0xb146('0x53')]({},_0x49c3ea,_0x56c7e9['options']);return db[_0xb146('0x8b')]['count']({'where':_0x49c3ea[_0xb146('0x52')]})[_0xb146('0x20')](function(_0xa9fac){_0x372839['count']=_0xa9fac;if(_0x56c7e9['query']['includeAll']){_0x49c3ea['include']=[{'model':db[_0xb146('0x88')],'as':_0xb146('0xab'),'required':![]},{'model':db[_0xb146('0x9a')],'as':'Owner','attributes':[_0xb146('0x3c'),_0xb146('0xac'),_0xb146('0xad')],'required':![]},{'model':db[_0xb146('0xae')],'as':'Tags','attributes':['id',_0xb146('0x3c'),_0xb146('0xaf')],'where':_0x56c7e9['query'][_0xb146('0xb0')]?{'id':_0x56c7e9[_0xb146('0x45')][_0xb146('0xb0')]}:undefined,'required':_0x56c7e9[_0xb146('0x45')][_0xb146('0xb0')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xb146('0x57')](_0x49c3ea);})['then'](function(_0x5b592d){_0x372839[_0xb146('0x58')]=_0x5b592d;return _0x372839;});}})['then'](respondWithFilteredResult(_0x30212f,_0x49c3ea))['catch'](handleError(_0x30212f,null));};exports[_0xb146('0xb1')]=function(_0x21ff34,_0x1ed2a7,_0x101393){return db[_0xb146('0x42')][_0xb146('0x5b')]({'where':{'id':_0x21ff34[_0xb146('0x59')]['id']}})[_0xb146('0x20')](handleEntityNotFound(_0x1ed2a7,null))[_0xb146('0x20')](function(_0x4a2548){if(_0x4a2548){return _0x4a2548[_0xb146('0xb1')](_0x21ff34[_0xb146('0x5d')][_0xb146('0x6f')],_[_0xb146('0xb2')](_0x21ff34[_0xb146('0x5d')],[_0xb146('0x6f'),'id'])||{})[_0xb146('0x8e')](function(_0x1adeba){for(var _0x5b1450=0x0;_0x5b1450<_0x21ff34[_0xb146('0x5d')][_0xb146('0x6f')][_0xb146('0x4c')];_0x5b1450+=0x1){socket[_0xb146('0xb3')](_0xb146('0xb4'),{'UserId':Number(_0x21ff34[_0xb146('0x5d')][_0xb146('0x6f')][_0x5b1450]),'OpenchannelAccountId':Number(_0x21ff34['params']['id'])});}return _0x1adeba;});}})['then'](respondWithResult(_0x1ed2a7,null))['catch'](handleError(_0x1ed2a7,null));};exports[_0xb146('0xb5')]=function(_0x1b11c2,_0x3ba820,_0x51a2d8){return db['OpenchannelAccount'][_0xb146('0x5b')]({'where':{'id':_0x1b11c2[_0xb146('0x59')]['id']}})[_0xb146('0x20')](handleEntityNotFound(_0x3ba820,null))['then'](function(_0x517c59){if(_0x517c59){return _0x517c59['removeAgents'](_0x1b11c2['query'][_0xb146('0x6f')])['then'](function(){if(_[_0xb146('0xb6')](_0x1b11c2[_0xb146('0x45')][_0xb146('0x6f')])){for(var _0x54e7d8=0x0;_0x54e7d8<_0x1b11c2[_0xb146('0x45')][_0xb146('0x6f')][_0xb146('0x4c')];_0x54e7d8+=0x1){socket[_0xb146('0xb3')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1b11c2[_0xb146('0x45')][_0xb146('0x6f')][_0x54e7d8]),'OpenchannelAccountId':Number(_0x1b11c2['params']['id'])});}}else{socket[_0xb146('0xb3')](_0xb146('0xb7'),{'UserId':Number(_0x1b11c2[_0xb146('0x45')][_0xb146('0x6f')]),'OpenchannelAccountId':Number(_0x1b11c2[_0xb146('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x3ba820,null))[_0xb146('0x2a')](handleError(_0x3ba820,null));};exports['getAgents']=function(_0x3c6b1f,_0x169390,_0x55ff2d){var _0x501c09={};var _0x4d5a25={};var _0xd643a2;var _0x530937;return db[_0xb146('0x42')][_0xb146('0x67')]({'where':{'id':_0x3c6b1f[_0xb146('0x59')]['id']}})[_0xb146('0x20')](handleEntityNotFound(_0x169390,null))[_0xb146('0x20')](function(_0x1ac26f){if(_0x1ac26f){_0xd643a2=_0x1ac26f;_0x4d5a25['model']=_[_0xb146('0x46')](db[_0xb146('0x9a')]['rawAttributes']);_0x4d5a25[_0xb146('0x45')]=_[_0xb146('0x46')](_0x3c6b1f[_0xb146('0x45')]);_0x4d5a25['filters']=_[_0xb146('0x48')](_0x4d5a25[_0xb146('0x49')],_0x4d5a25[_0xb146('0x45')]);_0x501c09[_0xb146('0x4b')]=_[_0xb146('0x48')](_0x4d5a25[_0xb146('0x49')],qs['fields'](_0x3c6b1f[_0xb146('0x45')][_0xb146('0x4a')]));_0x501c09[_0xb146('0x4b')]=_0x501c09['attributes'][_0xb146('0x4c')]?_0x501c09['attributes']:_0x4d5a25[_0xb146('0x49')];_0x501c09['order']=qs[_0xb146('0x4f')](_0x3c6b1f[_0xb146('0x45')][_0xb146('0x4f')]);_0x501c09[_0xb146('0x52')]=qs[_0xb146('0x47')](_[_0xb146('0x50')](_0x3c6b1f[_0xb146('0x45')],_0x4d5a25[_0xb146('0x47')]));if(_0x3c6b1f[_0xb146('0x45')]['filter']){_0x501c09[_0xb146('0x52')]=_['merge'](_0x501c09[_0xb146('0x52')],{'$or':_[_0xb146('0x41')](_0x501c09[_0xb146('0x4b')],function(_0x3c27c4){var _0x85131b={};_0x85131b[_0x3c27c4]={'$like':'%'+_0x3c6b1f[_0xb146('0x45')]['filter']+'%'};return _0x85131b;})});}_0x501c09=_[_0xb146('0x53')]({},_0x501c09,_0x3c6b1f[_0xb146('0x5a')]);return _0xd643a2[_0xb146('0xb8')](_0x501c09);}})[_0xb146('0x20')](function(_0x5cb56f){if(_0x5cb56f){_0x530937=_0x5cb56f[_0xb146('0x4c')];if(!_0x3c6b1f['query'][_0xb146('0x4d')](_0xb146('0x4e'))){_0x501c09[_0xb146('0x30')]=qs['limit'](_0x3c6b1f[_0xb146('0x45')]['limit']);_0x501c09[_0xb146('0x2e')]=qs[_0xb146('0x2e')](_0x3c6b1f[_0xb146('0x45')][_0xb146('0x2e')]);}return _0xd643a2[_0xb146('0xb8')](_0x501c09);}})[_0xb146('0x20')](function(_0x41470a){if(_0x41470a){return _0x41470a?{'count':_0x530937,'rows':_0x41470a}:null;}})[_0xb146('0x20')](respondWithResult(_0x169390,null))['catch'](handleError(_0x169390,null));};exports[_0xb146('0x3d')]=function(_0x2b3e00,_0x3190dc,_0x25dd0d){var _0x459099,_0x93a465,_0x1a29e5;if(_[_0xb146('0x79')](_0x2b3e00[_0xb146('0x5d')]['body'])||_0x2b3e00[_0xb146('0x5d')][_0xb146('0x5d')]===''){throw new db['Sequelize'][(_0xb146('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb146('0x79')](_0x2b3e00[_0xb146('0x5d')]['to'])){}_0x459099=_0x2b3e00[_0xb146('0x5d')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2b3e00[_0xb146('0x59')]['id']}})['then'](handleEntityNotFound(_0x3190dc,null))[_0xb146('0x20')](function(_0x4d7e99){if(_0x4d7e99){return db['OpenchannelAccount'][_0xb146('0x5b')]({'where':{'id':_0x4d7e99['id']},'include':[{'model':db['CmList'],'as':_0xb146('0x83'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x4d7e99['mapKey']]:_0x459099},'limit':0x1,'order':[[_0xb146('0x75'),_0xb146('0x7e')]]}]}]})[_0xb146('0x20')](handleEntityNotFound(_0x3190dc,null))[_0xb146('0x20')](function(_0x188c1d){if(_0x188c1d&&_0x188c1d['List']){_0x93a465=_0x188c1d[_0xb146('0x37')]({'plain':!![]});if(_0x93a465[_0xb146('0x83')]&&_0x93a465[_0xb146('0x83')]['Contacts'][_0xb146('0x4c')]){return _0x93a465[_0xb146('0x83')][_0xb146('0x87')][0x0];}return db['CmContact']['create'](_['defaults'](_0x2b3e00[_0xb146('0x5d')],{'firstName':_0x459099,[_0x188c1d[_0xb146('0x7a')]]:_0x459099,'phone':_0x459099,'ListId':_0x93a465[_0xb146('0x77')]}));}})[_0xb146('0x20')](handleEntityNotFound(_0x3190dc,null))['then'](function(_0x3af6ad){if(_0x3af6ad){_0x1a29e5=_0x3af6ad;return db['OpenchannelInteraction'][_0xb146('0x5b')]({'where':{'ContactId':_0x1a29e5['id'],'closed':![],'OpenchannelAccountId':_0x93a465['id']}})[_0xb146('0x20')](function(_0x4284dc){if(_0x4284dc){return[_0x4284dc,![]];}return db[_0xb146('0x8b')][_0xb146('0x5c')]({'UserId':_0x2b3e00[_0xb146('0x5e')]['id'],'ContactId':_0x1a29e5['id'],'OpenchannelAccountId':_0x93a465['id'],'lastMsgDirection':_0xb146('0xb9'),'Messages':[_[_0xb146('0x53')](_0x2b3e00[_0xb146('0x5d')],{'read':![],'body':_0x2b3e00[_0xb146('0x5d')]['body'],'OpenchannelAccountId':_0x93a465['id'],'UserId':_0x2b3e00[_0xb146('0x5e')]['id'],'ContactId':_0x1a29e5['id']})]},{'include':[{'model':db[_0xb146('0x97')],'as':_0xb146('0xba')}]})[_0xb146('0x20')](function(_0x5692a0){return[_0x5692a0,!![]];});});}})[_0xb146('0x8e')](function(_0x370cfb,_0x541c4b){if(_0x541c4b){return _0x370cfb;}return db[_0xb146('0x97')][_0xb146('0x5c')](_[_0xb146('0x53')](_0x2b3e00['body'],{'read':![],'body':_0x2b3e00['body']['body'],'OpenchannelAccountId':_0x93a465['id'],'OpenchannelInteractionId':_0x370cfb['id'],'UserId':_0x2b3e00[_0xb146('0x5e')]['id'],'ContactId':_0x1a29e5['id']}))['then'](function(_0x3cca9f){_0x370cfb[_0xb146('0xbb')][_0xb146('0xba')]=[];_0x370cfb[_0xb146('0xbb')][_0xb146('0xba')][_0xb146('0x94')](_0x3cca9f['dataValues']);return _0x370cfb;});});}})[_0xb146('0x20')](respondWithResult(_0x3190dc,null))[_0xb146('0x2a')](handleError(_0x3190dc,null));}; \ No newline at end of file +var _0x5fb0=['count','Content-Range','apply','reject','save','update','then','get','OpenchannelAccounts','sendStatus','name','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','query','keys','filters','attributes','intersection','model','fields','length','nolimit','limit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','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','params','destroy','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','applications','priority','asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','interaction','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','notify','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','getApplications','getInteractions','Contact','Owner','fullname','Tag','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0x5fb0,0x14d));var _0x05fb=function(_0x17a09f,_0xf8ba3b){_0x17a09f=_0x17a09f-0x0;var _0x5e3d1a=_0x5fb0[_0x17a09f];return _0x5e3d1a;};'use strict';var emlformat=require(_0x05fb('0x0'));var rimraf=require(_0x05fb('0x1'));var zipdir=require(_0x05fb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05fb('0x3'));var moment=require(_0x05fb('0x4'));var BPromise=require(_0x05fb('0x5'));var Mustache=require(_0x05fb('0x6'));var util=require('util');var path=require(_0x05fb('0x7'));var sox=require('sox');var csv=require(_0x05fb('0x8'));var ejs=require(_0x05fb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05fb('0xa'));var squel=require(_0x05fb('0xb'));var crypto=require(_0x05fb('0xc'));var jsforce=require(_0x05fb('0xd'));var deskjs=require(_0x05fb('0xe'));var toCsv=require(_0x05fb('0x8'));var querystring=require(_0x05fb('0xf'));var Papa=require(_0x05fb('0x10'));var Redis=require(_0x05fb('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x05fb('0x12'));var hardwareService=require(_0x05fb('0x13'));var logger=require('../../config/logger')(_0x05fb('0x14'));var utils=require(_0x05fb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x05fb('0x16'));var db=require(_0x05fb('0x17'))['db'];config[_0x05fb('0x18')]=_[_0x05fb('0x19')](config['redis'],{'host':_0x05fb('0x1a'),'port':0x18eb});var socket=require(_0x05fb('0x1b'))(new Redis(config[_0x05fb('0x18')]));require(_0x05fb('0x1c'))[_0x05fb('0x1d')](socket);var jayson=require(_0x05fb('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x05fb('0x1f')][_0x05fb('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3a7454,_0x214e99,_0x3325a0,_0x298c76){return new BPromise(function(_0x5bfcbe,_0x2c8e67){var _0x83bb27=_0x298c76||client;return _0x83bb27['request'](_0x3a7454,_0x3325a0)['then'](function(_0x178fa8){logger[_0x05fb('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x214e99,_0x05fb('0x22'));logger[_0x05fb('0x23')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x214e99,_0x05fb('0x22'),JSON[_0x05fb('0x24')](_0x178fa8));if(_0x178fa8[_0x05fb('0x25')]){if(_0x178fa8[_0x05fb('0x25')][_0x05fb('0x26')]===0x1f4){logger[_0x05fb('0x25')](_0x05fb('0x27'),_0x214e99,_0x178fa8[_0x05fb('0x25')][_0x05fb('0x28')]);return _0x2c8e67(_0x178fa8[_0x05fb('0x25')][_0x05fb('0x28')]);}logger[_0x05fb('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x214e99,_0x178fa8['error'][_0x05fb('0x28')]);return _0x5bfcbe(_0x178fa8[_0x05fb('0x25')][_0x05fb('0x28')]);}else{logger[_0x05fb('0x21')](_0x05fb('0x27'),_0x214e99,_0x05fb('0x22'));_0x5bfcbe(_0x178fa8[_0x05fb('0x29')][_0x05fb('0x28')]);}})[_0x05fb('0x2a')](function(_0x3cffe3){logger[_0x05fb('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x214e99,_0x3cffe3);_0x2c8e67(_0x3cffe3);});});}function respondWithStatusCode(_0x2228af,_0x424e53){_0x424e53=_0x424e53||0xcc;return function(_0x498cbf){if(_0x498cbf){return _0x2228af['sendStatus'](_0x424e53);}return _0x2228af[_0x05fb('0x2b')](_0x424e53)['end']();};}function respondWithResult(_0xcce80f,_0x212bf0){_0x212bf0=_0x212bf0||0xc8;return function(_0x400b12){if(_0x400b12){return _0xcce80f['status'](_0x212bf0)[_0x05fb('0x2c')](_0x400b12);}};}function respondWithFilteredResult(_0x5dd0fe,_0x5679ef){return function(_0x42ecf7){if(_0x42ecf7){var _0x19274f=typeof _0x5679ef[_0x05fb('0x2d')]===_0x05fb('0x2e')&&typeof _0x5679ef['limit']===_0x05fb('0x2e');var _0x52c9c5=_0x42ecf7[_0x05fb('0x2f')];var _0x2ae534=_0x19274f?0x0:_0x5679ef[_0x05fb('0x2d')];var _0x5cdcde=_0x19274f?_0x42ecf7[_0x05fb('0x2f')]:_0x5679ef[_0x05fb('0x2d')]+_0x5679ef['limit'];var _0x53f1e9;if(_0x5cdcde>=_0x52c9c5){_0x5cdcde=_0x52c9c5;_0x53f1e9=0xc8;}else{_0x53f1e9=0xce;}_0x5dd0fe[_0x05fb('0x2b')](_0x53f1e9);return _0x5dd0fe['set'](_0x05fb('0x30'),_0x2ae534+'-'+_0x5cdcde+'/'+_0x52c9c5)[_0x05fb('0x2c')](_0x42ecf7);}return null;};}function patchUpdates(_0x76814c){return function(_0x49cd31){try{jsonpatch[_0x05fb('0x31')](_0x49cd31,_0x76814c,!![]);}catch(_0x4c8e47){return BPromise[_0x05fb('0x32')](_0x4c8e47);}return _0x49cd31[_0x05fb('0x33')]();};}function saveUpdates(_0x1aae60,_0xe153ff){return function(_0x526282){if(_0x526282){return _0x526282[_0x05fb('0x34')](_0x1aae60)[_0x05fb('0x35')](function(_0x1ba1f7){return _0x1ba1f7;});}return null;};}function removeEntity(_0x5101af,_0x3dddc3){return function(_0x35893e){if(_0x35893e){return _0x35893e['destroy']()[_0x05fb('0x35')](function(){var _0x2d0a09=_0x35893e[_0x05fb('0x36')]({'plain':!![]});var _0x45ea2c=_0x05fb('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x45ea2c,'resourceId':_0x2d0a09['id']}})[_0x05fb('0x35')](function(){return _0x35893e;});})[_0x05fb('0x35')](function(){_0x5101af['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20b21b,_0xb894cd){return function(_0x4d2ba){if(!_0x4d2ba){_0x20b21b[_0x05fb('0x38')](0x194);}return _0x4d2ba;};}function handleError(_0x4de045,_0x2d10cb){_0x2d10cb=_0x2d10cb||0x1f4;return function(_0x575418){logger[_0x05fb('0x25')](_0x575418['stack']);if(_0x575418[_0x05fb('0x39')]){delete _0x575418['name'];}_0x4de045[_0x05fb('0x2b')](_0x2d10cb)['send'](_0x575418);};}exports['index']=function(_0x59ff2a,_0x53595a){var _0x353049={'include':[{'model':db[_0x05fb('0x3a')],'as':_0x05fb('0x3b')}]},_0x23f282={},_0x2aa53c={'count':0x0,'rows':[]};var _0x52fbdd=_[_0x05fb('0x3c')](db[_0x05fb('0x3d')]['rawAttributes'],function(_0x416424){return{'name':_0x416424[_0x05fb('0x3e')],'type':_0x416424['type']['key']};});_0x23f282['model']=_['map'](_0x52fbdd,'name');_0x23f282[_0x05fb('0x3f')]=_[_0x05fb('0x40')](_0x59ff2a['query']);_0x23f282[_0x05fb('0x41')]=_['intersection'](_0x23f282['model'],_0x23f282[_0x05fb('0x3f')]);_0x353049[_0x05fb('0x42')]=_[_0x05fb('0x43')](_0x23f282[_0x05fb('0x44')],qs[_0x05fb('0x45')](_0x59ff2a['query'][_0x05fb('0x45')]));_0x353049[_0x05fb('0x42')]=_0x353049[_0x05fb('0x42')][_0x05fb('0x46')]?_0x353049[_0x05fb('0x42')]:_0x23f282[_0x05fb('0x44')];if(!_0x59ff2a[_0x05fb('0x3f')]['hasOwnProperty'](_0x05fb('0x47'))){_0x353049[_0x05fb('0x48')]=qs[_0x05fb('0x48')](_0x59ff2a['query'][_0x05fb('0x48')]);_0x353049[_0x05fb('0x2d')]=qs[_0x05fb('0x2d')](_0x59ff2a['query']['offset']);}_0x353049[_0x05fb('0x49')]=qs[_0x05fb('0x4a')](_0x59ff2a[_0x05fb('0x3f')]['sort']);_0x353049['where']=qs[_0x05fb('0x41')](_['pick'](_0x59ff2a[_0x05fb('0x3f')],_0x23f282[_0x05fb('0x41')]),_0x52fbdd);if(_0x59ff2a[_0x05fb('0x3f')][_0x05fb('0x4b')]){_0x353049[_0x05fb('0x4c')]=_[_0x05fb('0x4d')](_0x353049[_0x05fb('0x4c')],{'$or':_[_0x05fb('0x3c')](_0x52fbdd,function(_0x82542c){if(_0x82542c['type']!=='VIRTUAL'){var _0x444ff9={};_0x444ff9[_0x82542c[_0x05fb('0x39')]]={'$like':'%'+_0x59ff2a[_0x05fb('0x3f')][_0x05fb('0x4b')]+'%'};return _0x444ff9;}})});}_0x353049=_[_0x05fb('0x4d')]({},_0x353049,_0x59ff2a[_0x05fb('0x4e')]);var _0x3c46df={'where':_0x353049[_0x05fb('0x4c')]};return db[_0x05fb('0x3d')][_0x05fb('0x2f')](_0x3c46df)[_0x05fb('0x35')](function(_0xc3e577){_0x2aa53c[_0x05fb('0x2f')]=_0xc3e577;if(_0x59ff2a[_0x05fb('0x3f')][_0x05fb('0x4f')]){_0x353049[_0x05fb('0x50')]=[{'all':!![]}];}return db[_0x05fb('0x3d')][_0x05fb('0x51')](_0x353049);})['then'](function(_0x4652fc){_0x2aa53c[_0x05fb('0x52')]=_0x4652fc;return _0x2aa53c;})['then'](respondWithFilteredResult(_0x53595a,_0x353049))[_0x05fb('0x2a')](handleError(_0x53595a,null));};exports['show']=function(_0x1f76e4,_0x206660){var _0x1f822f={'raw':![],'where':{'id':_0x1f76e4['params']['id']},'include':[{'model':db[_0x05fb('0x3a')],'as':'mandatoryDispositionPause'}]},_0x359db8={};_0x359db8[_0x05fb('0x44')]=_[_0x05fb('0x40')](db[_0x05fb('0x3d')][_0x05fb('0x53')]);_0x359db8[_0x05fb('0x3f')]=_[_0x05fb('0x40')](_0x1f76e4['query']);_0x359db8['filters']=_[_0x05fb('0x43')](_0x359db8[_0x05fb('0x44')],_0x359db8['query']);_0x1f822f[_0x05fb('0x42')]=_[_0x05fb('0x43')](_0x359db8['model'],qs[_0x05fb('0x45')](_0x1f76e4[_0x05fb('0x3f')][_0x05fb('0x45')]));_0x1f822f[_0x05fb('0x42')]=_0x1f822f[_0x05fb('0x42')][_0x05fb('0x46')]?_0x1f822f[_0x05fb('0x42')]:_0x359db8[_0x05fb('0x44')];if(_0x1f76e4['query'][_0x05fb('0x4f')]){_0x1f822f[_0x05fb('0x50')]=[{'all':!![]}];}_0x1f822f=_['merge']({},_0x1f822f,_0x1f76e4[_0x05fb('0x4e')]);return db[_0x05fb('0x3d')][_0x05fb('0x54')](_0x1f822f)['then'](handleEntityNotFound(_0x206660,null))[_0x05fb('0x35')](respondWithResult(_0x206660,null))[_0x05fb('0x2a')](handleError(_0x206660,null));};exports[_0x05fb('0x55')]=function(_0x5cabbe,_0x5f1dd6){return db[_0x05fb('0x3d')][_0x05fb('0x55')](_0x5cabbe[_0x05fb('0x56')],{})[_0x05fb('0x35')](function(_0x3f1bd2){var _0xd23207=_0x5cabbe[_0x05fb('0x57')][_0x05fb('0x36')]({'plain':!![]});if(!_0xd23207)throw new Error(_0x05fb('0x58'));if(_0xd23207[_0x05fb('0x59')]===_0x05fb('0x57')){var _0x5c1d15=_0x3f1bd2[_0x05fb('0x36')]({'plain':!![]});var _0x432806=_0x05fb('0x37');return db[_0x05fb('0x5a')][_0x05fb('0x54')]({'where':{'name':_0x432806,'userProfileId':_0xd23207[_0x05fb('0x5b')]},'raw':!![]})[_0x05fb('0x35')](function(_0x48d179){if(_0x48d179&&_0x48d179['autoAssociation']===0x0){return db['UserProfileResource'][_0x05fb('0x55')]({'name':_0x5c1d15[_0x05fb('0x39')],'resourceId':_0x5c1d15['id'],'type':_0x48d179[_0x05fb('0x39')],'sectionId':_0x48d179['id']},{})[_0x05fb('0x35')](function(){return _0x3f1bd2;});}else{return _0x3f1bd2;}})[_0x05fb('0x2a')](function(_0x5f2226){logger[_0x05fb('0x25')](_0x05fb('0x5c'),_0x5f2226);throw _0x5f2226;});}return _0x3f1bd2;})[_0x05fb('0x35')](respondWithResult(_0x5f1dd6,0xc9))[_0x05fb('0x2a')](handleError(_0x5f1dd6,null));};exports[_0x05fb('0x34')]=function(_0x45e1a9,_0x27c7ff){if(_0x45e1a9[_0x05fb('0x56')]['id']){delete _0x45e1a9['body']['id'];}return db[_0x05fb('0x3d')][_0x05fb('0x54')]({'where':{'id':_0x45e1a9[_0x05fb('0x5d')]['id']},'include':[{'model':db[_0x05fb('0x3a')],'as':'mandatoryDispositionPause'}]})[_0x05fb('0x35')](handleEntityNotFound(_0x27c7ff,null))[_0x05fb('0x35')](saveUpdates(_0x45e1a9[_0x05fb('0x56')],null))['then'](respondWithResult(_0x27c7ff,null))[_0x05fb('0x2a')](handleError(_0x27c7ff,null));};exports[_0x05fb('0x5e')]=function(_0x52ef5c,_0x421f5b){return db[_0x05fb('0x3d')][_0x05fb('0x54')]({'where':{'id':_0x52ef5c[_0x05fb('0x5d')]['id']}})[_0x05fb('0x35')](handleEntityNotFound(_0x421f5b,null))[_0x05fb('0x35')](removeEntity(_0x421f5b,null))[_0x05fb('0x2a')](handleError(_0x421f5b,null));};exports[_0x05fb('0x5f')]=function(_0x56517e,_0x460159){return db[_0x05fb('0x3d')][_0x05fb('0x5f')]()[_0x05fb('0x35')](respondWithResult(_0x460159,null))[_0x05fb('0x2a')](handleError(_0x460159,null));};exports[_0x05fb('0x60')]=function(_0x5e9fb2,_0x5bd2fb,_0x5db53b){if(_0x5e9fb2['body']['id']){delete _0x5e9fb2[_0x05fb('0x56')]['id'];}return db[_0x05fb('0x3d')][_0x05fb('0x54')]({'where':{'id':_0x5e9fb2[_0x05fb('0x5d')]['id']}})[_0x05fb('0x35')](handleEntityNotFound(_0x5bd2fb,null))['then'](function(_0x39f104){if(_0x39f104){_0x5e9fb2[_0x05fb('0x56')][_0x05fb('0x61')]=_0x39f104['id'];return db[_0x05fb('0x62')][_0x05fb('0x55')](_0x5e9fb2[_0x05fb('0x56')]);}})[_0x05fb('0x35')](respondWithResult(_0x5bd2fb,null))[_0x05fb('0x2a')](handleError(_0x5bd2fb,null));};exports[_0x05fb('0x63')]=function(_0x35d19c,_0x9c4772,_0x2ec25c){var _0x3198fe={'raw':![],'where':{}};var _0x17d5b9={};var _0x1b0d1c={'count':0x0,'rows':[]};return db[_0x05fb('0x3d')][_0x05fb('0x64')]({'where':{'id':_0x35d19c[_0x05fb('0x5d')]['id']}})['then'](handleEntityNotFound(_0x9c4772,null))[_0x05fb('0x35')](function(_0x3cd9bf){if(_0x3cd9bf){_0x17d5b9[_0x05fb('0x44')]=_['keys'](db[_0x05fb('0x62')]['rawAttributes']);_0x17d5b9[_0x05fb('0x3f')]=_[_0x05fb('0x40')](_0x35d19c[_0x05fb('0x3f')]);_0x17d5b9['filters']=_[_0x05fb('0x43')](_0x17d5b9[_0x05fb('0x44')],_0x17d5b9[_0x05fb('0x3f')]);_0x3198fe[_0x05fb('0x42')]=_[_0x05fb('0x43')](_0x17d5b9[_0x05fb('0x44')],qs['fields'](_0x35d19c[_0x05fb('0x3f')][_0x05fb('0x45')]));_0x3198fe[_0x05fb('0x42')]=_0x3198fe['attributes']['length']?_0x3198fe[_0x05fb('0x42')]:_0x17d5b9['model'];if(!_0x35d19c['query'][_0x05fb('0x65')](_0x05fb('0x47'))){_0x3198fe[_0x05fb('0x48')]=qs[_0x05fb('0x48')](_0x35d19c[_0x05fb('0x3f')][_0x05fb('0x48')]);_0x3198fe['offset']=qs[_0x05fb('0x2d')](_0x35d19c[_0x05fb('0x3f')]['offset']);}_0x3198fe[_0x05fb('0x49')]=qs[_0x05fb('0x4a')](_0x35d19c[_0x05fb('0x3f')]['sort']);_0x3198fe[_0x05fb('0x4c')]=qs[_0x05fb('0x41')](_[_0x05fb('0x66')](_0x35d19c[_0x05fb('0x3f')],_0x17d5b9[_0x05fb('0x41')]));_0x3198fe[_0x05fb('0x4c')][_0x05fb('0x61')]=_0x3cd9bf['id'];if(_0x35d19c[_0x05fb('0x3f')][_0x05fb('0x4b')]){_0x3198fe[_0x05fb('0x4c')]=_[_0x05fb('0x4d')](_0x3198fe['where'],{'$or':_[_0x05fb('0x3c')](_0x3198fe[_0x05fb('0x42')],function(_0x149410){var _0x2791b7={};_0x2791b7[_0x149410]={'$like':'%'+_0x35d19c[_0x05fb('0x3f')][_0x05fb('0x4b')]+'%'};return _0x2791b7;})});}_0x3198fe=_[_0x05fb('0x4d')]({},_0x3198fe,_0x35d19c[_0x05fb('0x4e')]);return db[_0x05fb('0x62')]['count']({'where':_0x3198fe[_0x05fb('0x4c')]})[_0x05fb('0x35')](function(_0x53cee9){_0x1b0d1c['count']=_0x53cee9;if(_0x35d19c[_0x05fb('0x3f')][_0x05fb('0x4f')]){_0x3198fe[_0x05fb('0x50')]=[{'all':!![]}];}return db[_0x05fb('0x62')][_0x05fb('0x51')](_0x3198fe);})[_0x05fb('0x35')](function(_0x2c2c6e){_0x1b0d1c[_0x05fb('0x52')]=_0x2c2c6e;return _0x1b0d1c;});}})['then'](respondWithFilteredResult(_0x9c4772,_0x3198fe))[_0x05fb('0x2a')](handleError(_0x9c4772,null));};exports[_0x05fb('0x67')]=function(_0x5e770b,_0x50b06c,_0x21f7bf){return db[_0x05fb('0x3d')][_0x05fb('0x54')]({'where':{'id':_0x5e770b[_0x05fb('0x5d')]['id']}})['then'](handleEntityNotFound(_0x50b06c,null))[_0x05fb('0x35')](function(_0x7bb9dd){if(_0x7bb9dd){return _0x7bb9dd[_0x05fb('0x67')](_0x5e770b['query'][_0x05fb('0x68')]);}})['then'](respondWithStatusCode(_0x50b06c,null))['catch'](handleError(_0x50b06c,null));};exports[_0x05fb('0x69')]=function(_0x11f76b,_0x58c72c,_0x2a116e){if(_0x11f76b[_0x05fb('0x56')]['id']){delete _0x11f76b[_0x05fb('0x56')]['id'];}return db[_0x05fb('0x3d')]['find']({'where':{'id':_0x11f76b[_0x05fb('0x5d')]['id']}})[_0x05fb('0x35')](handleEntityNotFound(_0x58c72c,null))[_0x05fb('0x35')](function(_0x2109a7){if(_0x2109a7){_0x11f76b['body'][_0x05fb('0x61')]=_0x2109a7['id'];return db['CannedAnswer'][_0x05fb('0x55')](_0x11f76b[_0x05fb('0x56')]);}})[_0x05fb('0x35')](respondWithResult(_0x58c72c,null))[_0x05fb('0x2a')](handleError(_0x58c72c,null));};exports[_0x05fb('0x6a')]=function(_0x1c49cd,_0x565108,_0x2eb872){var _0x3b5987={'raw':![],'where':{}};var _0x163015={};var _0x307a49={'count':0x0,'rows':[]};return db[_0x05fb('0x3d')][_0x05fb('0x64')]({'where':{'id':_0x1c49cd[_0x05fb('0x5d')]['id']}})['then'](handleEntityNotFound(_0x565108,null))[_0x05fb('0x35')](function(_0x4971f0){if(_0x4971f0){_0x163015[_0x05fb('0x44')]=_[_0x05fb('0x40')](db[_0x05fb('0x6b')]['rawAttributes']);_0x163015[_0x05fb('0x3f')]=_[_0x05fb('0x40')](_0x1c49cd['query']);_0x163015[_0x05fb('0x41')]=_['intersection'](_0x163015[_0x05fb('0x44')],_0x163015['query']);_0x3b5987[_0x05fb('0x42')]=_[_0x05fb('0x43')](_0x163015[_0x05fb('0x44')],qs[_0x05fb('0x45')](_0x1c49cd[_0x05fb('0x3f')][_0x05fb('0x45')]));_0x3b5987[_0x05fb('0x42')]=_0x3b5987[_0x05fb('0x42')]['length']?_0x3b5987[_0x05fb('0x42')]:_0x163015[_0x05fb('0x44')];if(!_0x1c49cd['query'][_0x05fb('0x65')](_0x05fb('0x47'))){_0x3b5987[_0x05fb('0x48')]=qs[_0x05fb('0x48')](_0x1c49cd[_0x05fb('0x3f')][_0x05fb('0x48')]);_0x3b5987['offset']=qs[_0x05fb('0x2d')](_0x1c49cd[_0x05fb('0x3f')][_0x05fb('0x2d')]);}_0x3b5987[_0x05fb('0x49')]=qs[_0x05fb('0x4a')](_0x1c49cd['query'][_0x05fb('0x4a')]);_0x3b5987[_0x05fb('0x4c')]=qs['filters'](_[_0x05fb('0x66')](_0x1c49cd[_0x05fb('0x3f')],_0x163015['filters']));_0x3b5987['where'][_0x05fb('0x61')]=_0x4971f0['id'];if(_0x1c49cd['query'][_0x05fb('0x4b')]){_0x3b5987[_0x05fb('0x4c')]=_['merge'](_0x3b5987[_0x05fb('0x4c')],{'$or':_['map'](_0x3b5987[_0x05fb('0x42')],function(_0x12bfa9){var _0x2accff={};_0x2accff[_0x12bfa9]={'$like':'%'+_0x1c49cd['query'][_0x05fb('0x4b')]+'%'};return _0x2accff;})});}_0x3b5987=_[_0x05fb('0x4d')]({},_0x3b5987,_0x1c49cd[_0x05fb('0x4e')]);return db[_0x05fb('0x6b')][_0x05fb('0x2f')]({'where':_0x3b5987['where']})[_0x05fb('0x35')](function(_0x48d172){_0x307a49[_0x05fb('0x2f')]=_0x48d172;if(_0x1c49cd[_0x05fb('0x3f')][_0x05fb('0x4f')]){_0x3b5987['include']=[{'all':!![]}];}return db[_0x05fb('0x6b')]['findAll'](_0x3b5987);})[_0x05fb('0x35')](function(_0x78d5a8){_0x307a49[_0x05fb('0x52')]=_0x78d5a8;return _0x307a49;});}})['then'](respondWithFilteredResult(_0x565108,_0x3b5987))[_0x05fb('0x2a')](handleError(_0x565108,null));};exports[_0x05fb('0x6c')]=function(_0x4cd50d,_0x36c220,_0x23a1c3){return db['OpenchannelAccount'][_0x05fb('0x54')]({'where':{'id':_0x4cd50d[_0x05fb('0x5d')]['id']}})['then'](handleEntityNotFound(_0x36c220,null))[_0x05fb('0x35')](function(_0x54dad6){if(_0x54dad6){return _0x54dad6[_0x05fb('0x6c')](_0x4cd50d[_0x05fb('0x3f')][_0x05fb('0x68')]);}})['then'](respondWithStatusCode(_0x36c220,null))['catch'](handleError(_0x36c220,null));};exports['notify']=function(_0x3e9735,_0x42659f,_0xbc9e21){var _0x14527b={'body':_0x3e9735[_0x05fb('0x56')],'channel':_0x05fb('0x6d')};var _0x171ac1=[];var _0x3b3459=[];var _0x5c127e={};var _0x3c7642=![];return db[_0x05fb('0x6e')][_0x05fb('0x5f')]()[_0x05fb('0x35')](function(_0x413b48){if(!_0x413b48){throw new db[(_0x05fb('0x6f'))][(_0x05fb('0x70'))](_0x05fb('0x71'));}_0x171ac1=_[_0x05fb('0x72')](_['keys'](_0x413b48),[_0x05fb('0x73'),_0x05fb('0x74')]);_0x3b3459=_[_0x05fb('0x72')](_['keys'](_0x413b48),[_0x05fb('0x73'),_0x05fb('0x74'),'CompanyId',_0x05fb('0x75')]);if(_0x3e9735[_0x05fb('0x56')]['id']){delete _0x3e9735[_0x05fb('0x56')]['id'];}if(_[_0x05fb('0x76')](_0x3e9735[_0x05fb('0x56')][_0x05fb('0x77')])){throw new db[(_0x05fb('0x6f'))][(_0x05fb('0x70'))](_0x05fb('0x78'));}if(_[_0x05fb('0x76')](_0x3e9735[_0x05fb('0x56')][_0x05fb('0x56')])||_0x3e9735[_0x05fb('0x56')]['body']===''){throw new db[(_0x05fb('0x6f'))]['ValidationError'](_0x05fb('0x79'));}if(_[_0x05fb('0x76')](_0x3e9735[_0x05fb('0x56')]['mapKey'])){throw new db[(_0x05fb('0x6f'))][(_0x05fb('0x70'))](_0x05fb('0x7a')+_0x3b3459);}if(!_[_0x05fb('0x7b')](_0x3b3459,_0x3e9735[_0x05fb('0x56')][_0x05fb('0x7c')])){throw new db[(_0x05fb('0x6f'))][(_0x05fb('0x70'))](_0x05fb('0x7d')+_0x3b3459);}_0x5c127e[_0x3e9735['body'][_0x05fb('0x7c')]]=_0x3e9735[_0x05fb('0x56')][_0x05fb('0x77')];})[_0x05fb('0x35')](function(){return db['OpenchannelAccount'][_0x05fb('0x54')]({'where':{'id':_0x3e9735[_0x05fb('0x5d')]['id']},'include':[{'model':db[_0x05fb('0x7e')],'as':_0x05fb('0x7f'),'include':[{'model':db['CmContact'],'as':_0x05fb('0x80'),'where':_0x5c127e,'limit':0x1,'order':[['updatedAt',_0x05fb('0x81')]]}]},{'model':db[_0x05fb('0x82')],'as':_0x05fb('0x83')}]});})['then'](handleEntityNotFound(_0x42659f,null))['then'](function(_0x1d49f2){if(_0x1d49f2&&_0x1d49f2[_0x05fb('0x7f')]){_0x14527b['account']=_0x1d49f2;_0x14527b[_0x05fb('0x84')]=_0x1d49f2[_0x05fb('0x83')];_0x14527b['list']=_0x1d49f2[_0x05fb('0x7f')];_0x14527b[_0x05fb('0x84')]=_['orderBy'](_0x14527b[_0x05fb('0x84')],[_0x05fb('0x85')],[_0x05fb('0x86')]);if(_0x14527b[_0x05fb('0x87')][_0x05fb('0x83')]){delete _0x14527b[_0x05fb('0x87')]['Applications'];}if(_0x14527b[_0x05fb('0x87')][_0x05fb('0x7f')]&&_0x14527b['account'][_0x05fb('0x7f')]['Contacts'][_0x05fb('0x46')]){return _0x14527b[_0x05fb('0x87')][_0x05fb('0x7f')][_0x05fb('0x80')][0x0];}var _0x40ac16=_[_0x05fb('0x19')](_0x3e9735[_0x05fb('0x56')],{'firstName':_0x3e9735[_0x05fb('0x56')][_0x05fb('0x77')],'ListId':_0x1d49f2[_0x05fb('0x75')]});_0x40ac16[_0x3e9735[_0x05fb('0x56')]['mapKey']]=_0x3e9735[_0x05fb('0x56')][_0x05fb('0x77')];return db['CmContact'][_0x05fb('0x55')](_0x40ac16,{'fields':_0x171ac1,'raw':!![]});}})[_0x05fb('0x35')](handleEntityNotFound(_0x42659f,null))[_0x05fb('0x35')](function(_0x166e50){_0x14527b[_0x05fb('0x88')]=_0x166e50;if(_0x166e50){var _0x2108ea={'ContactId':_0x166e50['id'],'OpenchannelAccountId':_0x3e9735[_0x05fb('0x5d')]['id'],'from':(_0x166e50[_0x05fb('0x89')]||'')+'\x20'+(_0x166e50[_0x05fb('0x8a')]||'')};var _0x2d300d={'OpenchannelAccountId':_0x3e9735['params']['id'],'closed':![]};if(_0x3e9735[_0x05fb('0x56')]['threadId']){_0x2d300d[_0x05fb('0x8b')]=_0x3e9735[_0x05fb('0x56')][_0x05fb('0x8b')];return db[_0x05fb('0x8c')][_0x05fb('0x54')]({'where':_0x2d300d})[_0x05fb('0x35')](function(_0x1fe0df){if(_0x1fe0df){return[_0x1fe0df,![]];}_0x2108ea['threadId']=_0x3e9735[_0x05fb('0x56')][_0x05fb('0x8b')];_0x2108ea[_0x05fb('0x8d')]=_0x3e9735[_0x05fb('0x56')][_0x05fb('0x8d')];return db[_0x05fb('0x8c')]['create'](_0x2108ea)['then'](function(_0x551e6f){return[_0x551e6f,!![]];});});}else{_0x2d300d['threadId']=null;}_0x2d300d[_0x05fb('0x8e')]=_0x166e50['id'];return db[_0x05fb('0x8c')][_0x05fb('0x54')]({'where':_0x2d300d})['then'](function(_0x446660){if(_0x446660){return[_0x446660,![]];}return db[_0x05fb('0x8c')][_0x05fb('0x55')](_0x2108ea)[_0x05fb('0x35')](function(_0x51dd42){return[_0x51dd42,!![]];});});}})[_0x05fb('0x8f')](function(_0x838751,_0x23fabc){if(_0x838751){_0x3c7642=_0x23fabc;if(!_0x23fabc){var _0x1cf23c={'from':(_0x14527b[_0x05fb('0x88')]['firstName']||'')+'\x20'+(_0x14527b[_0x05fb('0x88')][_0x05fb('0x8a')]||'')};if(_0x3e9735[_0x05fb('0x56')]['threadId']&&_0x3e9735[_0x05fb('0x56')]['messageId']&&_0x3e9735[_0x05fb('0x56')][_0x05fb('0x8b')]!=_0x3e9735[_0x05fb('0x56')][_0x05fb('0x90')]){_0x1cf23c[_0x05fb('0x8b')]=_0x3e9735['body'][_0x05fb('0x90')];}return _0x838751[_0x05fb('0x34')](_0x1cf23c);}else{return _0x838751;}}})[_0x05fb('0x35')](function(_0x28f341){_0x14527b['interaction']=_0x28f341['get']({'plain':!![]});_0x14527b['interaction'][_0x05fb('0x91')]=_0x3c7642;if(_0x14527b['interaction'][_0x05fb('0x91')]){if(_0x14527b[_0x05fb('0x87')][_0x05fb('0x92')]){_0x14527b[_0x05fb('0x84')][_0x05fb('0x93')]({'id':0x0,'priority':_0x14527b[_0x05fb('0x84')][_0x05fb('0x46')]+0x1,'app':_0x05fb('0x94'),'appdata':'unmanaged','interval':_0x05fb('0x95')});}}return db[_0x05fb('0x96')][_0x05fb('0x55')]({'body':_0x3e9735[_0x05fb('0x56')]['body'],'OpenchannelAccountId':_0x3e9735['params']['id'],'OpenchannelInteractionId':_0x28f341['id'],'direction':'in','ContactId':_0x14527b['contact']['id'],'AttachmentId':_0x3e9735[_0x05fb('0x56')][_0x05fb('0x97')]});})[_0x05fb('0x35')](function(_0x3b5c50){_0x14527b[_0x05fb('0x28')]=_0x3b5c50;if(_0x14527b[_0x05fb('0x98')][_0x05fb('0x99')]){return db[_0x05fb('0x9a')]['find']({'attributes':['id',_0x05fb('0x39')],'where':{'id':_0x14527b[_0x05fb('0x98')]['UserId']}})[_0x05fb('0x35')](function(_0x20ee47){if(_0x20ee47){_0x14527b[_0x05fb('0x84')][_0x05fb('0x9b')]({'id':0x0,'priority':0x0,'app':_0x05fb('0x9c'),'appdata':_0x20ee47[_0x05fb('0x39')]+','+(_0x14527b['account'][_0x05fb('0x9d')]||0xa),'interval':_0x05fb('0x95')});_0x14527b[_0x05fb('0x9e')]=![];}return respondWithRpcPromise('Start',_0x05fb('0x9f'),_0x14527b);});}return respondWithRpcPromise('Start',_0x05fb('0x9f'),_0x14527b);})[_0x05fb('0x35')](function(_0x3f3ed6){respondWithRpcPromise('EventManager',_0x05fb('0xa0'),{'event':_0x05fb('0xa1'),'message':_0x3f3ed6},client9002);return _0x3f3ed6;})[_0x05fb('0x35')](respondWithResult(_0x42659f,null))['catch'](handleError(_0x42659f,null));};exports[_0x05fb('0xa2')]=function(_0x15fcbf,_0x238716){var _0x10a831=_0x15fcbf['params']['id'];var _0x1253d1=_0x15fcbf[_0x05fb('0x56')];var _0x3ec3f0=0xc8;var _0x2a839d=null;return db[_0x05fb('0xa3')][_0x05fb('0xa4')]({'isolationLevel':db[_0x05fb('0xa3')][_0x05fb('0xa5')][_0x05fb('0xa6')][_0x05fb('0xa7')]},function(_0x52da25){return db[_0x05fb('0x3d')]['findOne']({'where':{'id':_0x10a831},'transaction':_0x52da25})[_0x05fb('0x35')](function(_0x3873f8){if(_0x3873f8){return db[_0x05fb('0x82')][_0x05fb('0x5e')]({'where':{'OpenchannelAccountId':_0x10a831},'transaction':_0x52da25})[_0x05fb('0x35')](function(){var _0x19e1b4=_[_0x05fb('0x3c')](_0x1253d1,function(_0x2908d2){_0x2908d2['OpenchannelAccountId']=_0x10a831;return _0x2908d2;});return db[_0x05fb('0x82')][_0x05fb('0xa8')](_0x19e1b4,{'transaction':_0x52da25});});}else{_0x3ec3f0=0x194;_0x2a839d=[];}});})[_0x05fb('0x35')](function(){if(_0x3ec3f0!==0x194){return db[_0x05fb('0x82')][_0x05fb('0xa9')]({'where':{'OpenchannelAccountId':_0x10a831},'order':_0x05fb('0x85')})[_0x05fb('0x35')](function(_0x140f87){_0x2a839d=_0x140f87;});}})['catch'](function(_0x37ad63){_0x3ec3f0=0x1f4;logger[_0x05fb('0x25')](_0x37ad63[_0x05fb('0xaa')]);if(_0x37ad63['name']){delete _0x37ad63['name'];}_0x2a839d=_0x37ad63;})['finally'](function(){if(_0x2a839d===null){_0x238716['sendStatus'](_0x3ec3f0);}else{if(_0x3ec3f0===0x1f4){_0x238716[_0x05fb('0x2b')](_0x3ec3f0)['send'](_0x2a839d);}else{_0x238716[_0x05fb('0x2b')](_0x3ec3f0)[_0x05fb('0x2c')](_0x2a839d);}}});};exports[_0x05fb('0xab')]=function(_0x47cafd,_0x2daa3b,_0x516911){var _0x42de9e={};var _0x27ef9b={};var _0x12c64d;var _0x816097;return db[_0x05fb('0x3d')][_0x05fb('0x64')]({'where':{'id':_0x47cafd['params']['id']}})[_0x05fb('0x35')](handleEntityNotFound(_0x2daa3b,null))[_0x05fb('0x35')](function(_0x4503fc){if(_0x4503fc){_0x12c64d=_0x4503fc;_0x27ef9b[_0x05fb('0x44')]=_['keys'](db[_0x05fb('0x82')]['rawAttributes']);_0x27ef9b[_0x05fb('0x3f')]=_[_0x05fb('0x40')](_0x47cafd[_0x05fb('0x3f')]);_0x27ef9b[_0x05fb('0x41')]=_[_0x05fb('0x43')](_0x27ef9b[_0x05fb('0x44')],_0x27ef9b[_0x05fb('0x3f')]);_0x42de9e[_0x05fb('0x42')]=_['intersection'](_0x27ef9b[_0x05fb('0x44')],qs[_0x05fb('0x45')](_0x47cafd[_0x05fb('0x3f')][_0x05fb('0x45')]));_0x42de9e[_0x05fb('0x42')]=_0x42de9e[_0x05fb('0x42')][_0x05fb('0x46')]?_0x42de9e[_0x05fb('0x42')]:_0x27ef9b[_0x05fb('0x44')];_0x42de9e[_0x05fb('0x49')]=qs['sort'](_0x47cafd['query'][_0x05fb('0x4a')]);_0x42de9e[_0x05fb('0x4c')]=qs[_0x05fb('0x41')](_['pick'](_0x47cafd[_0x05fb('0x3f')],_0x27ef9b['filters']));if(_0x47cafd[_0x05fb('0x3f')][_0x05fb('0x4b')]){_0x42de9e[_0x05fb('0x4c')]=_[_0x05fb('0x4d')](_0x42de9e[_0x05fb('0x4c')],{'$or':_['map'](_0x42de9e[_0x05fb('0x42')],function(_0x233336){var _0x5b903b={};_0x5b903b[_0x233336]={'$like':'%'+_0x47cafd[_0x05fb('0x3f')][_0x05fb('0x4b')]+'%'};return _0x5b903b;})});}_0x42de9e=_[_0x05fb('0x4d')]({},_0x42de9e,_0x47cafd[_0x05fb('0x4e')]);return _0x12c64d['getApplications'](_0x42de9e);}})['then'](function(_0x4a2f30){if(_0x4a2f30){_0x816097=_0x4a2f30['length'];if(!_0x47cafd[_0x05fb('0x3f')]['hasOwnProperty'](_0x05fb('0x47'))){_0x42de9e[_0x05fb('0x48')]=qs[_0x05fb('0x48')](_0x47cafd['query']['limit']);_0x42de9e[_0x05fb('0x2d')]=qs[_0x05fb('0x2d')](_0x47cafd[_0x05fb('0x3f')][_0x05fb('0x2d')]);}return _0x12c64d[_0x05fb('0xab')](_0x42de9e);}})[_0x05fb('0x35')](function(_0x338e18){if(_0x338e18){return _0x338e18?{'count':_0x816097,'rows':_0x338e18}:null;}})[_0x05fb('0x35')](respondWithResult(_0x2daa3b,null))[_0x05fb('0x2a')](handleError(_0x2daa3b,null));};exports[_0x05fb('0xac')]=function(_0x1fbd58,_0x5a8484,_0x54d974){var _0x4a58b0={'raw':![],'where':{}};var _0x9ba181={};var _0x15bb23={'count':0x0,'rows':[]};return db[_0x05fb('0x3d')][_0x05fb('0x64')]({'where':{'id':_0x1fbd58[_0x05fb('0x5d')]['id']}})[_0x05fb('0x35')](handleEntityNotFound(_0x5a8484,null))[_0x05fb('0x35')](function(_0x24e148){if(_0x24e148){_0x9ba181[_0x05fb('0x44')]=_[_0x05fb('0x40')](db[_0x05fb('0x8c')][_0x05fb('0x53')]);_0x9ba181[_0x05fb('0x3f')]=_[_0x05fb('0x40')](_0x1fbd58[_0x05fb('0x3f')]);_0x9ba181[_0x05fb('0x41')]=_['intersection'](_0x9ba181[_0x05fb('0x44')],_0x9ba181[_0x05fb('0x3f')]);_0x4a58b0[_0x05fb('0x42')]=_[_0x05fb('0x43')](_0x9ba181['model'],qs[_0x05fb('0x45')](_0x1fbd58[_0x05fb('0x3f')][_0x05fb('0x45')]));_0x4a58b0[_0x05fb('0x42')]=_0x4a58b0[_0x05fb('0x42')][_0x05fb('0x46')]?_0x4a58b0['attributes']:_0x9ba181[_0x05fb('0x44')];if(!_0x1fbd58[_0x05fb('0x3f')][_0x05fb('0x65')](_0x05fb('0x47'))){_0x4a58b0['limit']=qs[_0x05fb('0x48')](_0x1fbd58[_0x05fb('0x3f')][_0x05fb('0x48')]);_0x4a58b0[_0x05fb('0x2d')]=qs[_0x05fb('0x2d')](_0x1fbd58[_0x05fb('0x3f')][_0x05fb('0x2d')]);}_0x4a58b0[_0x05fb('0x49')]=qs[_0x05fb('0x4a')](_0x1fbd58[_0x05fb('0x3f')]['sort']);_0x4a58b0[_0x05fb('0x4c')]=qs[_0x05fb('0x41')](_[_0x05fb('0x66')](_0x1fbd58[_0x05fb('0x3f')],_0x9ba181['filters']));_0x4a58b0[_0x05fb('0x4c')][_0x05fb('0x61')]=_0x24e148['id'];if(_0x1fbd58[_0x05fb('0x3f')]['filter']){_0x4a58b0[_0x05fb('0x4c')]=_[_0x05fb('0x4d')](_0x4a58b0[_0x05fb('0x4c')],{'$or':_[_0x05fb('0x3c')](_0x4a58b0[_0x05fb('0x42')],function(_0x2d3a4e){var _0x42451b={};_0x42451b[_0x2d3a4e]={'$like':'%'+_0x1fbd58[_0x05fb('0x3f')]['filter']+'%'};return _0x42451b;})});}_0x4a58b0=_[_0x05fb('0x4d')]({},_0x4a58b0,_0x1fbd58[_0x05fb('0x4e')]);return db[_0x05fb('0x8c')][_0x05fb('0x2f')]({'where':_0x4a58b0[_0x05fb('0x4c')]})[_0x05fb('0x35')](function(_0x3fd4a6){_0x15bb23[_0x05fb('0x2f')]=_0x3fd4a6;if(_0x1fbd58[_0x05fb('0x3f')][_0x05fb('0x4f')]){_0x4a58b0[_0x05fb('0x50')]=[{'model':db[_0x05fb('0x6e')],'as':_0x05fb('0xad'),'required':![]},{'model':db[_0x05fb('0x9a')],'as':_0x05fb('0xae'),'attributes':[_0x05fb('0x39'),_0x05fb('0xaf'),'internal'],'required':![]},{'model':db[_0x05fb('0xb0')],'as':'Tags','attributes':['id',_0x05fb('0x39'),_0x05fb('0xb1')],'where':_0x1fbd58[_0x05fb('0x3f')][_0x05fb('0xb2')]?{'id':_0x1fbd58[_0x05fb('0x3f')]['tag']}:undefined,'required':_0x1fbd58[_0x05fb('0x3f')][_0x05fb('0xb2')]?!![]:![]}];}return db[_0x05fb('0x8c')]['findAll'](_0x4a58b0);})[_0x05fb('0x35')](function(_0x24467c){_0x15bb23[_0x05fb('0x52')]=_0x24467c;return _0x15bb23;});}})[_0x05fb('0x35')](respondWithFilteredResult(_0x5a8484,_0x4a58b0))[_0x05fb('0x2a')](handleError(_0x5a8484,null));};exports[_0x05fb('0xb3')]=function(_0x4baef1,_0x22810d,_0x4646dd){return db[_0x05fb('0x3d')]['find']({'where':{'id':_0x4baef1[_0x05fb('0x5d')]['id']}})[_0x05fb('0x35')](handleEntityNotFound(_0x22810d,null))[_0x05fb('0x35')](function(_0x4ac854){if(_0x4ac854){return _0x4ac854['addAgents'](_0x4baef1[_0x05fb('0x56')][_0x05fb('0x68')],_['omit'](_0x4baef1[_0x05fb('0x56')],[_0x05fb('0x68'),'id'])||{})[_0x05fb('0x8f')](function(_0x38c352){for(var _0x1166a1=0x0;_0x1166a1<_0x4baef1[_0x05fb('0x56')][_0x05fb('0x68')][_0x05fb('0x46')];_0x1166a1+=0x1){socket[_0x05fb('0xb4')](_0x05fb('0xb5'),{'UserId':Number(_0x4baef1[_0x05fb('0x56')]['ids'][_0x1166a1]),'OpenchannelAccountId':Number(_0x4baef1['params']['id'])});}return _0x38c352;});}})['then'](respondWithResult(_0x22810d,null))[_0x05fb('0x2a')](handleError(_0x22810d,null));};exports['removeAgents']=function(_0x534715,_0x18144d,_0x2b2e3f){return db[_0x05fb('0x3d')][_0x05fb('0x54')]({'where':{'id':_0x534715[_0x05fb('0x5d')]['id']}})['then'](handleEntityNotFound(_0x18144d,null))['then'](function(_0x3b79e7){if(_0x3b79e7){return _0x3b79e7[_0x05fb('0xb6')](_0x534715[_0x05fb('0x3f')]['ids'])[_0x05fb('0x35')](function(){if(_[_0x05fb('0xb7')](_0x534715[_0x05fb('0x3f')][_0x05fb('0x68')])){for(var _0x3195c3=0x0;_0x3195c3<_0x534715[_0x05fb('0x3f')][_0x05fb('0x68')][_0x05fb('0x46')];_0x3195c3+=0x1){socket[_0x05fb('0xb4')](_0x05fb('0xb8'),{'UserId':Number(_0x534715[_0x05fb('0x3f')][_0x05fb('0x68')][_0x3195c3]),'OpenchannelAccountId':Number(_0x534715[_0x05fb('0x5d')]['id'])});}}else{socket[_0x05fb('0xb4')](_0x05fb('0xb8'),{'UserId':Number(_0x534715[_0x05fb('0x3f')]['ids']),'OpenchannelAccountId':Number(_0x534715[_0x05fb('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x18144d,null))[_0x05fb('0x2a')](handleError(_0x18144d,null));};exports[_0x05fb('0xb9')]=function(_0x4792f6,_0x307dff,_0x631640){var _0x9aa83f={};var _0x44f483={};var _0x4db8f2;var _0x3c53f5;return db[_0x05fb('0x3d')][_0x05fb('0x64')]({'where':{'id':_0x4792f6[_0x05fb('0x5d')]['id']}})[_0x05fb('0x35')](handleEntityNotFound(_0x307dff,null))['then'](function(_0x10aad7){if(_0x10aad7){_0x4db8f2=_0x10aad7;_0x44f483[_0x05fb('0x44')]=_[_0x05fb('0x40')](db[_0x05fb('0x9a')][_0x05fb('0x53')]);_0x44f483[_0x05fb('0x3f')]=_[_0x05fb('0x40')](_0x4792f6[_0x05fb('0x3f')]);_0x44f483[_0x05fb('0x41')]=_['intersection'](_0x44f483[_0x05fb('0x44')],_0x44f483['query']);_0x9aa83f['attributes']=_['intersection'](_0x44f483[_0x05fb('0x44')],qs[_0x05fb('0x45')](_0x4792f6[_0x05fb('0x3f')][_0x05fb('0x45')]));_0x9aa83f['attributes']=_0x9aa83f['attributes']['length']?_0x9aa83f[_0x05fb('0x42')]:_0x44f483[_0x05fb('0x44')];_0x9aa83f[_0x05fb('0x49')]=qs[_0x05fb('0x4a')](_0x4792f6[_0x05fb('0x3f')][_0x05fb('0x4a')]);_0x9aa83f[_0x05fb('0x4c')]=qs[_0x05fb('0x41')](_['pick'](_0x4792f6[_0x05fb('0x3f')],_0x44f483[_0x05fb('0x41')]));if(_0x4792f6['query'][_0x05fb('0x4b')]){_0x9aa83f[_0x05fb('0x4c')]=_[_0x05fb('0x4d')](_0x9aa83f[_0x05fb('0x4c')],{'$or':_[_0x05fb('0x3c')](_0x9aa83f[_0x05fb('0x42')],function(_0x2e044c){var _0x41b4a2={};_0x41b4a2[_0x2e044c]={'$like':'%'+_0x4792f6[_0x05fb('0x3f')][_0x05fb('0x4b')]+'%'};return _0x41b4a2;})});}_0x9aa83f=_[_0x05fb('0x4d')]({},_0x9aa83f,_0x4792f6[_0x05fb('0x4e')]);return _0x4db8f2[_0x05fb('0xb9')](_0x9aa83f);}})[_0x05fb('0x35')](function(_0x2465f6){if(_0x2465f6){_0x3c53f5=_0x2465f6[_0x05fb('0x46')];if(!_0x4792f6['query'][_0x05fb('0x65')](_0x05fb('0x47'))){_0x9aa83f[_0x05fb('0x48')]=qs[_0x05fb('0x48')](_0x4792f6[_0x05fb('0x3f')][_0x05fb('0x48')]);_0x9aa83f['offset']=qs['offset'](_0x4792f6[_0x05fb('0x3f')][_0x05fb('0x2d')]);}return _0x4db8f2[_0x05fb('0xb9')](_0x9aa83f);}})[_0x05fb('0x35')](function(_0x1755fe){if(_0x1755fe){return _0x1755fe?{'count':_0x3c53f5,'rows':_0x1755fe}:null;}})['then'](respondWithResult(_0x307dff,null))['catch'](handleError(_0x307dff,null));};exports[_0x05fb('0xba')]=function(_0x1e8a7b,_0x4763c5,_0x2198e0){var _0x3293ff,_0x1457da,_0x41743c;if(_[_0x05fb('0x76')](_0x1e8a7b[_0x05fb('0x56')][_0x05fb('0x56')])||_0x1e8a7b[_0x05fb('0x56')][_0x05fb('0x56')]===''){throw new db[(_0x05fb('0x6f'))][(_0x05fb('0x70'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x05fb('0x76')](_0x1e8a7b[_0x05fb('0x56')]['to'])){}_0x3293ff=_0x1e8a7b[_0x05fb('0x56')]['to'];return db[_0x05fb('0x3d')][_0x05fb('0x64')]({'where':{'id':_0x1e8a7b[_0x05fb('0x5d')]['id']}})[_0x05fb('0x35')](handleEntityNotFound(_0x4763c5,null))[_0x05fb('0x35')](function(_0x2a5898){if(_0x2a5898){return db[_0x05fb('0x3d')][_0x05fb('0x54')]({'where':{'id':_0x2a5898['id']},'include':[{'model':db[_0x05fb('0x7e')],'as':_0x05fb('0x7f'),'include':[{'model':db[_0x05fb('0x6e')],'as':_0x05fb('0x80'),'where':{[_0x2a5898['mapKey']]:_0x3293ff},'limit':0x1,'order':[[_0x05fb('0x74'),'DESC']]}]}]})[_0x05fb('0x35')](handleEntityNotFound(_0x4763c5,null))[_0x05fb('0x35')](function(_0x4d9970){if(_0x4d9970&&_0x4d9970[_0x05fb('0x7f')]){_0x1457da=_0x4d9970['get']({'plain':!![]});if(_0x1457da['List']&&_0x1457da[_0x05fb('0x7f')]['Contacts'][_0x05fb('0x46')]){return _0x1457da[_0x05fb('0x7f')]['Contacts'][0x0];}return db[_0x05fb('0x6e')]['create'](_[_0x05fb('0x19')](_0x1e8a7b[_0x05fb('0x56')],{'firstName':_0x3293ff,[_0x4d9970[_0x05fb('0x7c')]]:_0x3293ff,'phone':_0x3293ff,'ListId':_0x1457da['ListId']}));}})['then'](handleEntityNotFound(_0x4763c5,null))[_0x05fb('0x35')](function(_0x23325e){if(_0x23325e){_0x41743c=_0x23325e;return db[_0x05fb('0x8c')][_0x05fb('0x54')]({'where':{'ContactId':_0x41743c['id'],'closed':![],'OpenchannelAccountId':_0x1457da['id']}})[_0x05fb('0x35')](function(_0x35ed05){if(_0x35ed05){return[_0x35ed05,![]];}return db['OpenchannelInteraction'][_0x05fb('0x55')]({'UserId':_0x1e8a7b[_0x05fb('0x57')]['id'],'ContactId':_0x41743c['id'],'OpenchannelAccountId':_0x1457da['id'],'lastMsgDirection':_0x05fb('0xbb'),'Messages':[_['merge'](_0x1e8a7b['body'],{'read':![],'body':_0x1e8a7b[_0x05fb('0x56')]['body'],'OpenchannelAccountId':_0x1457da['id'],'UserId':_0x1e8a7b[_0x05fb('0x57')]['id'],'ContactId':_0x41743c['id']})]},{'include':[{'model':db[_0x05fb('0x96')],'as':_0x05fb('0xbc')}]})['then'](function(_0x1982ba){return[_0x1982ba,!![]];});});}})['spread'](function(_0x53bde5,_0x29637a){if(_0x29637a){return _0x53bde5;}return db['OpenchannelMessage']['create'](_[_0x05fb('0x4d')](_0x1e8a7b[_0x05fb('0x56')],{'read':![],'body':_0x1e8a7b['body']['body'],'OpenchannelAccountId':_0x1457da['id'],'OpenchannelInteractionId':_0x53bde5['id'],'UserId':_0x1e8a7b[_0x05fb('0x57')]['id'],'ContactId':_0x41743c['id']}))[_0x05fb('0x35')](function(_0xd684dc){_0x53bde5[_0x05fb('0xbd')][_0x05fb('0xbc')]=[];_0x53bde5['dataValues'][_0x05fb('0xbc')][_0x05fb('0x93')](_0xd684dc[_0x05fb('0xbd')]);return _0x53bde5;});});}})[_0x05fb('0x35')](respondWithResult(_0x4763c5,null))[_0x05fb('0x2a')](handleError(_0x4763c5,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 4659aa2..454bf02 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 _0x878f=['hook','exports','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit'];(function(_0x8ddc49,_0x3b20b6){var _0x54ccf9=function(_0x2d77f2){while(--_0x2d77f2){_0x8ddc49['push'](_0x8ddc49['shift']());}};_0x54ccf9(++_0x3b20b6);}(_0x878f,0x173));var _0xf878=function(_0xb8d0f2,_0x2d1d9d){_0xb8d0f2=_0xb8d0f2-0x0;var _0x25a5e3=_0x878f[_0xb8d0f2];return _0x25a5e3;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xf878('0x0'))['db'][_0xf878('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xf878('0x2')](0x0);var events={'afterCreate':_0xf878('0x3'),'afterUpdate':_0xf878('0x4'),'afterDestroy':_0xf878('0x5')};function emitEvent(_0x9e6783){return function(_0x45a37b,_0x240b48,_0xcf1927){OpenchannelAccountEvents[_0xf878('0x6')](_0x9e6783+':'+_0x45a37b['id'],_0x45a37b);OpenchannelAccountEvents['emit'](_0x9e6783,_0x45a37b);_0xcf1927(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xf878('0x7')](e,emitEvent(event));}}module[_0xf878('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xf109=['OpenchannelAccount','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x29f89d,_0x5c4731){var _0x5d5fae=function(_0x4f6645){while(--_0x4f6645){_0x29f89d['push'](_0x29f89d['shift']());}};_0x5d5fae(++_0x5c4731);}(_0xf109,0xce));var _0x9f10=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0xf109[_0x2b9b7f];return _0x4ed19a;};'use strict';var EventEmitter=require(_0x9f10('0x0'));var OpenchannelAccount=require(_0x9f10('0x1'))['db'][_0x9f10('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9f10('0x3')};function emitEvent(_0x74f517){return function(_0x74d0ee,_0x26f01c,_0x4027f4){OpenchannelAccountEvents[_0x9f10('0x4')](_0x74f517+':'+_0x74d0ee['id'],_0x74d0ee);OpenchannelAccountEvents[_0x9f10('0x4')](_0x74f517,_0x74d0ee);_0x4027f4(null);};}for(var e in events){if(events[_0x9f10('0x5')](e)){var event=events[e];OpenchannelAccount[_0x9f10('0x6')](e,emitEvent(event));}}module[_0x9f10('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 1a1699a..b462413 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(_0x1c103e,_0x446e17){var _0x319de8=function(_0x49312c){while(--_0x49312c){_0x1c103e['push'](_0x1c103e['shift']());}};_0x319de8(++_0x446e17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x199fc2,_0x58e864){var _0x3cadbb=function(_0x242462){while(--_0x242462){_0x199fc2['push'](_0x199fc2['shift']());}};_0x3cadbb(++_0x58e864);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 1601a8e..5da3871 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 _0xdb94=['randomstring','../../mysqldb','../../config/utils','../../config/environment','http','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','request','info','debug','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird'];(function(_0x36ea99,_0x29e1f9){var _0x113a32=function(_0xf0ae90){while(--_0xf0ae90){_0x36ea99['push'](_0x36ea99['shift']());}};_0x113a32(++_0x29e1f9);}(_0xdb94,0xab));var _0x4db9=function(_0x4cfb9b,_0x32218c){_0x4cfb9b=_0x4cfb9b-0x0;var _0x58bda0=_0xdb94[_0x4cfb9b];return _0x58bda0;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rs=require(_0x4db9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4db9('0x5'))['db'];var utils=require(_0x4db9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4db9('0x8')]({'port':0x232a});config['redis']=_[_0x4db9('0x9')](config['redis'],{'host':_0x4db9('0xa'),'port':0x18eb});var socket=require(_0x4db9('0xb'))(new Redis(config[_0x4db9('0xc')]));require(_0x4db9('0xd'))[_0x4db9('0xe')](socket);function respondWithRpcPromise(_0x242116,_0x45c0e4,_0xeb2168){return new BPromise(function(_0x26f3ae,_0x2bf991){return client[_0x4db9('0xf')](_0x242116,_0xeb2168)['then'](function(_0x451970){logger[_0x4db9('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x45c0e4,'request\x20sent');logger[_0x4db9('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x45c0e4,'request\x20sent',JSON[_0x4db9('0x12')](_0x451970));if(_0x451970[_0x4db9('0x13')]){if(_0x451970['error'][_0x4db9('0x14')]===0x1f4){logger[_0x4db9('0x13')](_0x4db9('0x15'),_0x45c0e4,_0x451970[_0x4db9('0x13')]['message']);return _0x2bf991(_0x451970['error'][_0x4db9('0x16')]);}logger[_0x4db9('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x45c0e4,_0x451970[_0x4db9('0x13')][_0x4db9('0x16')]);return _0x26f3ae(_0x451970['error']['message']);}else{logger[_0x4db9('0x10')](_0x4db9('0x15'),_0x45c0e4,_0x4db9('0x17'));_0x26f3ae(_0x451970[_0x4db9('0x18')][_0x4db9('0x16')]);}})['catch'](function(_0x3b1f87){logger[_0x4db9('0x13')](_0x4db9('0x15'),_0x45c0e4,_0x3b1f87);_0x2bf991(_0x3b1f87);});});} \ No newline at end of file +var _0xab40=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','register','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x3799bf,_0x937a88){var _0x633b0a=function(_0x192fc7){while(--_0x192fc7){_0x3799bf['push'](_0x3799bf['shift']());}};_0x633b0a(++_0x937a88);}(_0xab40,0xcd));var _0x0ab4=function(_0x4c18bc,_0x21ca46){_0x4c18bc=_0x4c18bc-0x0;var _0x3e9910=_0xab40[_0x4c18bc];return _0x3e9910;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});config[_0x0ab4('0x8')]=_[_0x0ab4('0x9')](config[_0x0ab4('0x8')],{'host':_0x0ab4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x0ab4('0xb')](socket);function respondWithRpcPromise(_0x30e726,_0x40e4d1,_0x464f7e){return new BPromise(function(_0x413d9b,_0x24c6c1){return client[_0x0ab4('0xc')](_0x30e726,_0x464f7e)[_0x0ab4('0xd')](function(_0x4e1708){logger['info'](_0x0ab4('0xe'),_0x40e4d1,'request\x20sent');logger[_0x0ab4('0xf')](_0x0ab4('0x10'),_0x40e4d1,_0x0ab4('0x11'),JSON[_0x0ab4('0x12')](_0x4e1708));if(_0x4e1708[_0x0ab4('0x13')]){if(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x14')]===0x1f4){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x24c6c1(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);}logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x413d9b(_0x4e1708[_0x0ab4('0x13')]['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x40e4d1,_0x0ab4('0x11'));_0x413d9b(_0x4e1708[_0x0ab4('0x16')][_0x0ab4('0x15')]);}})['catch'](function(_0x1e3fe2){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x1e3fe2);_0x24c6c1(_0x1e3fe2);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index bb7a52a..45c1599 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 _0xbb53=['length','./openchannelAccount.events','save','remove','update','emit'];(function(_0x433cce,_0x308d6e){var _0x52525e=function(_0x53f7e6){while(--_0x53f7e6){_0x433cce['push'](_0x433cce['shift']());}};_0x52525e(++_0x308d6e);}(_0xbb53,0x121));var _0x3bb5=function(_0x2ef593,_0x4719f4){_0x2ef593=_0x2ef593-0x0;var _0x494095=_0xbb53[_0x2ef593];return _0x494095;};'use strict';var OpenchannelAccountEvents=require(_0x3bb5('0x0'));var events=[_0x3bb5('0x1'),_0x3bb5('0x2'),_0x3bb5('0x3')];function createListener(_0x20c8b6,_0x226d39){return function(_0x414da7){_0x226d39[_0x3bb5('0x4')](_0x20c8b6,_0x414da7);};}function removeListener(_0x83e44b,_0x450d9e){return function(){OpenchannelAccountEvents['removeListener'](_0x83e44b,_0x450d9e);};}exports['register']=function(_0x23f11e){for(var _0x2460b0=0x0,_0x28aa7d=events[_0x3bb5('0x5')];_0x2460b0<_0x28aa7d;_0x2460b0++){var _0x22f92f=events[_0x2460b0];var _0x480f9c=createListener('openchannelAccount:'+_0x22f92f,_0x23f11e);OpenchannelAccountEvents['on'](_0x22f92f,_0x480f9c);}}; \ No newline at end of file +var _0x6931=['./openchannelAccount.events','save','removeListener','length','openchannelAccount:'];(function(_0x571bd7,_0x6b811f){var _0x250c83=function(_0x4568c4){while(--_0x4568c4){_0x571bd7['push'](_0x571bd7['shift']());}};_0x250c83(++_0x6b811f);}(_0x6931,0xa5));var _0x1693=function(_0x135465,_0x4496e0){_0x135465=_0x135465-0x0;var _0x3b7717=_0x6931[_0x135465];return _0x3b7717;};'use strict';var OpenchannelAccountEvents=require(_0x1693('0x0'));var events=[_0x1693('0x1'),'remove','update'];function createListener(_0x7828b9,_0x190052){return function(_0x37c53b){_0x190052['emit'](_0x7828b9,_0x37c53b);};}function removeListener(_0x1c8ac6,_0x3ea966){return function(){OpenchannelAccountEvents[_0x1693('0x2')](_0x1c8ac6,_0x3ea966);};}exports['register']=function(_0x361381){for(var _0x4bd166=0x0,_0x3594e0=events[_0x1693('0x3')];_0x4bd166<_0x3594e0;_0x4bd166++){var _0x328cfc=events[_0x4bd166];var _0x2ab0a0=createListener(_0x1693('0x4')+_0x328cfc,_0x361381);OpenchannelAccountEvents['on'](_0x328cfc,_0x2ab0a0);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index cbf7633..ab5492a 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 _0xf95b=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','post','create','put'];(function(_0x36b331,_0x5dcda4){var _0x2f0d1a=function(_0x1b8360){while(--_0x1b8360){_0x36b331['push'](_0x36b331['shift']());}};_0x2f0d1a(++_0x5dcda4);}(_0xf95b,0x1a8));var _0xbf95=function(_0x4baa18,_0xc613b2){_0x4baa18=_0x4baa18-0x0;var _0x3912cc=_0xf95b[_0x4baa18];return _0x3912cc;};'use strict';var multer=require(_0xbf95('0x0'));var util=require(_0xbf95('0x1'));var path=require('path');var timeout=require(_0xbf95('0x2'));var express=require(_0xbf95('0x3'));var router=express[_0xbf95('0x4')]();var fs_extra=require(_0xbf95('0x5'));var auth=require(_0xbf95('0x6'));var interaction=require(_0xbf95('0x7'));var config=require(_0xbf95('0x8'));var controller=require(_0xbf95('0x9'));router[_0xbf95('0xa')]('/',auth[_0xbf95('0xb')](),controller['index']);router[_0xbf95('0xa')](_0xbf95('0xc'),auth[_0xbf95('0xb')](),controller['show']);router[_0xbf95('0xd')]('/',auth[_0xbf95('0xb')](),controller[_0xbf95('0xe')]);router[_0xbf95('0xf')](_0xbf95('0xc'),auth[_0xbf95('0xb')](),controller[_0xbf95('0x10')]);router[_0xbf95('0x11')](_0xbf95('0xc'),auth['isAuthenticated'](),controller[_0xbf95('0x12')]);module[_0xbf95('0x13')]=router; \ No newline at end of file +var _0x00af=['isAuthenticated','show','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','/:id'];(function(_0x541c71,_0x6efa46){var _0x4b4438=function(_0x2eb1a5){while(--_0x2eb1a5){_0x541c71['push'](_0x541c71['shift']());}};_0x4b4438(++_0x6efa46);}(_0x00af,0x115));var _0xf00a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x00af[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xf00a('0x0'));var util=require(_0xf00a('0x1'));var path=require(_0xf00a('0x2'));var timeout=require(_0xf00a('0x3'));var express=require(_0xf00a('0x4'));var router=express[_0xf00a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf00a('0x6'));var interaction=require(_0xf00a('0x7'));var config=require('../../config/environment');var controller=require(_0xf00a('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf00a('0x9')](_0xf00a('0xa'),auth[_0xf00a('0xb')](),controller[_0xf00a('0xc')]);router['post']('/',auth[_0xf00a('0xb')](),controller['create']);router[_0xf00a('0xd')](_0xf00a('0xa'),auth['isAuthenticated'](),controller[_0xf00a('0xe')]);router['delete'](_0xf00a('0xa'),auth['isAuthenticated'](),controller[_0xf00a('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 54b0864..ed2ffc8 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 _0xd8b2=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x568a36,_0x3de9fc){var _0x3e9991=function(_0x1bd795){while(--_0x1bd795){_0x568a36['push'](_0x568a36['shift']());}};_0x3e9991(++_0x3de9fc);}(_0xd8b2,0x190));var _0x2d8b=function(_0x355db,_0x2f7b81){_0x355db=_0x355db-0x0;var _0x176a86=_0xd8b2[_0x355db];return _0x176a86;};'use strict';var Sequelize=require(_0x2d8b('0x0'));module[_0x2d8b('0x1')]={'priority':{'type':Sequelize[_0x2d8b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2d8b('0x3')],'allowNull':![],'defaultValue':_0x2d8b('0x4')},'appdata':{'type':Sequelize[_0x2d8b('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2d8b('0x3')],'defaultValue':_0x2d8b('0x6')}}; \ No newline at end of file +var _0xa81f=['sequelize','STRING','noop','TEXT','*,*,*,*'];(function(_0x9720d1,_0x2d74dc){var _0x585551=function(_0x1db836){while(--_0x1db836){_0x9720d1['push'](_0x9720d1['shift']());}};_0x585551(++_0x2d74dc);}(_0xa81f,0x11d));var _0xfa81=function(_0x2e7a43,_0x3b3df4){_0x2e7a43=_0x2e7a43-0x0;var _0x52e9e1=_0xa81f[_0x2e7a43];return _0x52e9e1;};'use strict';var Sequelize=require(_0xfa81('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xfa81('0x1')],'allowNull':![],'defaultValue':_0xfa81('0x2')},'appdata':{'type':Sequelize[_0xfa81('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfa81('0x1')],'defaultValue':_0xfa81('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 4cf36d4..8f0ed62 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 _0x0ab2=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','includeAll','include','rows','catch','show','keys','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x154d9c,_0x3caf83){var _0x3ec5ec=function(_0x2cbd5f){while(--_0x2cbd5f){_0x154d9c['push'](_0x154d9c['shift']());}};_0x3ec5ec(++_0x3caf83);}(_0x0ab2,0x1e9));var _0x20ab=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x0ab2[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20ab('0x0'));var zipdir=require(_0x20ab('0x1'));var jsonpatch=require(_0x20ab('0x2'));var rp=require('request-promise');var moment=require(_0x20ab('0x3'));var BPromise=require(_0x20ab('0x4'));var Mustache=require(_0x20ab('0x5'));var util=require(_0x20ab('0x6'));var path=require(_0x20ab('0x7'));var sox=require('sox');var csv=require(_0x20ab('0x8'));var ejs=require(_0x20ab('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x20ab('0xa'));var squel=require(_0x20ab('0xb'));var crypto=require(_0x20ab('0xc'));var jsforce=require(_0x20ab('0xd'));var deskjs=require(_0x20ab('0xe'));var toCsv=require(_0x20ab('0x8'));var querystring=require(_0x20ab('0xf'));var Papa=require(_0x20ab('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x20ab('0x11'));var as=require(_0x20ab('0x12'));var hardwareService=require(_0x20ab('0x13'));var logger=require(_0x20ab('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x20ab('0x15'));var licenseUtil=require(_0x20ab('0x16'));var db=require(_0x20ab('0x17'))['db'];function respondWithStatusCode(_0x4d9f38,_0x5cf484){_0x5cf484=_0x5cf484||0xcc;return function(_0x1dced6){if(_0x1dced6){return _0x4d9f38[_0x20ab('0x18')](_0x5cf484);}return _0x4d9f38[_0x20ab('0x19')](_0x5cf484)[_0x20ab('0x1a')]();};}function respondWithResult(_0x2af464,_0x3b23ee){_0x3b23ee=_0x3b23ee||0xc8;return function(_0x49d29e){if(_0x49d29e){return _0x2af464[_0x20ab('0x19')](_0x3b23ee)[_0x20ab('0x1b')](_0x49d29e);}};}function respondWithFilteredResult(_0x3bbe56,_0x5916f7){return function(_0xca679d){if(_0xca679d){var _0x5a1c50=typeof _0x5916f7[_0x20ab('0x1c')]===_0x20ab('0x1d')&&typeof _0x5916f7[_0x20ab('0x1e')]===_0x20ab('0x1d');var _0x3f21e8=_0xca679d['count'];var _0x125ccf=_0x5a1c50?0x0:_0x5916f7['offset'];var _0x1becf4=_0x5a1c50?_0xca679d[_0x20ab('0x1f')]:_0x5916f7[_0x20ab('0x1c')]+_0x5916f7['limit'];var _0x5f0f5e;if(_0x1becf4>=_0x3f21e8){_0x1becf4=_0x3f21e8;_0x5f0f5e=0xc8;}else{_0x5f0f5e=0xce;}_0x3bbe56['status'](_0x5f0f5e);return _0x3bbe56[_0x20ab('0x20')](_0x20ab('0x21'),_0x125ccf+'-'+_0x1becf4+'/'+_0x3f21e8)[_0x20ab('0x1b')](_0xca679d);}return null;};}function patchUpdates(_0x2c620f){return function(_0x5031eb){try{jsonpatch[_0x20ab('0x22')](_0x5031eb,_0x2c620f,!![]);}catch(_0x5a3685){return BPromise[_0x20ab('0x23')](_0x5a3685);}return _0x5031eb[_0x20ab('0x24')]();};}function saveUpdates(_0x1d7a99,_0x2b5a88){return function(_0xa0827c){if(_0xa0827c){return _0xa0827c[_0x20ab('0x25')](_0x1d7a99)[_0x20ab('0x26')](function(_0x156205){return _0x156205;});}return null;};}function removeEntity(_0x9b1101,_0x3001d5){return function(_0x3d4537){if(_0x3d4537){return _0x3d4537[_0x20ab('0x27')]()[_0x20ab('0x26')](function(){_0x9b1101['status'](0xcc)[_0x20ab('0x1a')]();});}};}function handleEntityNotFound(_0x5b5423,_0x5b68d9){return function(_0x182dc7){if(!_0x182dc7){_0x5b5423[_0x20ab('0x18')](0x194);}return _0x182dc7;};}function handleError(_0x5dca44,_0xf77c79){_0xf77c79=_0xf77c79||0x1f4;return function(_0x59838a){logger['error'](_0x59838a[_0x20ab('0x28')]);if(_0x59838a[_0x20ab('0x29')]){delete _0x59838a[_0x20ab('0x29')];}_0x5dca44[_0x20ab('0x19')](_0xf77c79)[_0x20ab('0x2a')](_0x59838a);};}exports[_0x20ab('0x2b')]=function(_0x34a20f,_0x50ca2d){var _0x4c9b51={},_0xdd3154={},_0x516d73={'count':0x0,'rows':[]};var _0x48af2b=_['map'](db[_0x20ab('0x2c')][_0x20ab('0x2d')],function(_0x11d83f){return{'name':_0x11d83f[_0x20ab('0x2e')],'type':_0x11d83f[_0x20ab('0x2f')][_0x20ab('0x30')]};});_0xdd3154[_0x20ab('0x31')]=_[_0x20ab('0x32')](_0x48af2b,'name');_0xdd3154[_0x20ab('0x33')]=_['keys'](_0x34a20f[_0x20ab('0x33')]);_0xdd3154[_0x20ab('0x34')]=_[_0x20ab('0x35')](_0xdd3154['model'],_0xdd3154[_0x20ab('0x33')]);_0x4c9b51[_0x20ab('0x36')]=_[_0x20ab('0x35')](_0xdd3154[_0x20ab('0x31')],qs[_0x20ab('0x37')](_0x34a20f['query'][_0x20ab('0x37')]));_0x4c9b51[_0x20ab('0x36')]=_0x4c9b51[_0x20ab('0x36')][_0x20ab('0x38')]?_0x4c9b51[_0x20ab('0x36')]:_0xdd3154['model'];if(!_0x34a20f['query'][_0x20ab('0x39')](_0x20ab('0x3a'))){_0x4c9b51[_0x20ab('0x1e')]=qs[_0x20ab('0x1e')](_0x34a20f[_0x20ab('0x33')][_0x20ab('0x1e')]);_0x4c9b51[_0x20ab('0x1c')]=qs['offset'](_0x34a20f['query']['offset']);}_0x4c9b51[_0x20ab('0x3b')]=qs['sort'](_0x34a20f[_0x20ab('0x33')]['sort']);_0x4c9b51[_0x20ab('0x3c')]=qs['filters'](_['pick'](_0x34a20f[_0x20ab('0x33')],_0xdd3154[_0x20ab('0x34')]),_0x48af2b);if(_0x34a20f[_0x20ab('0x33')][_0x20ab('0x3d')]){_0x4c9b51['where']=_[_0x20ab('0x3e')](_0x4c9b51[_0x20ab('0x3c')],{'$or':_['map'](_0x48af2b,function(_0x5a569f){if(_0x5a569f[_0x20ab('0x2f')]!=='VIRTUAL'){var _0x2add74={};_0x2add74[_0x5a569f[_0x20ab('0x29')]]={'$like':'%'+_0x34a20f[_0x20ab('0x33')][_0x20ab('0x3d')]+'%'};return _0x2add74;}})});}_0x4c9b51=_[_0x20ab('0x3e')]({},_0x4c9b51,_0x34a20f['options']);var _0x16448f={'where':_0x4c9b51[_0x20ab('0x3c')]};return db[_0x20ab('0x2c')][_0x20ab('0x1f')](_0x16448f)[_0x20ab('0x26')](function(_0x2b7aea){_0x516d73[_0x20ab('0x1f')]=_0x2b7aea;if(_0x34a20f[_0x20ab('0x33')][_0x20ab('0x3f')]){_0x4c9b51[_0x20ab('0x40')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x4c9b51);})[_0x20ab('0x26')](function(_0x56a9c2){_0x516d73[_0x20ab('0x41')]=_0x56a9c2;return _0x516d73;})[_0x20ab('0x26')](respondWithFilteredResult(_0x50ca2d,_0x4c9b51))[_0x20ab('0x42')](handleError(_0x50ca2d,null));};exports[_0x20ab('0x43')]=function(_0x5249cd,_0x31bf0a){var _0x28f5b4={'raw':!![],'where':{'id':_0x5249cd['params']['id']}},_0xf58a4b={};_0xf58a4b['model']=_['keys'](db[_0x20ab('0x2c')][_0x20ab('0x2d')]);_0xf58a4b['query']=_[_0x20ab('0x44')](_0x5249cd[_0x20ab('0x33')]);_0xf58a4b[_0x20ab('0x34')]=_[_0x20ab('0x35')](_0xf58a4b[_0x20ab('0x31')],_0xf58a4b[_0x20ab('0x33')]);_0x28f5b4[_0x20ab('0x36')]=_[_0x20ab('0x35')](_0xf58a4b[_0x20ab('0x31')],qs[_0x20ab('0x37')](_0x5249cd[_0x20ab('0x33')][_0x20ab('0x37')]));_0x28f5b4[_0x20ab('0x36')]=_0x28f5b4[_0x20ab('0x36')]['length']?_0x28f5b4[_0x20ab('0x36')]:_0xf58a4b['model'];if(_0x5249cd['query']['includeAll']){_0x28f5b4[_0x20ab('0x40')]=[{'all':!![]}];}_0x28f5b4=_[_0x20ab('0x3e')]({},_0x28f5b4,_0x5249cd[_0x20ab('0x45')]);return db[_0x20ab('0x2c')][_0x20ab('0x46')](_0x28f5b4)[_0x20ab('0x26')](handleEntityNotFound(_0x31bf0a,null))['then'](respondWithResult(_0x31bf0a,null))[_0x20ab('0x42')](handleError(_0x31bf0a,null));};exports[_0x20ab('0x47')]=function(_0x389132,_0x3ccc98){return db[_0x20ab('0x2c')]['create'](_0x389132[_0x20ab('0x48')],{})[_0x20ab('0x26')](respondWithResult(_0x3ccc98,0xc9))[_0x20ab('0x42')](handleError(_0x3ccc98,null));};exports['update']=function(_0x9da289,_0x446527){if(_0x9da289['body']['id']){delete _0x9da289[_0x20ab('0x48')]['id'];}return db[_0x20ab('0x2c')][_0x20ab('0x46')]({'where':{'id':_0x9da289['params']['id']}})['then'](handleEntityNotFound(_0x446527,null))[_0x20ab('0x26')](saveUpdates(_0x9da289[_0x20ab('0x48')],null))[_0x20ab('0x26')](respondWithResult(_0x446527,null))[_0x20ab('0x42')](handleError(_0x446527,null));};exports[_0x20ab('0x27')]=function(_0x532f4f,_0x2fbf3f){return db['OpenchannelApplication'][_0x20ab('0x46')]({'where':{'id':_0x532f4f[_0x20ab('0x49')]['id']}})[_0x20ab('0x26')](handleEntityNotFound(_0x2fbf3f,null))[_0x20ab('0x26')](removeEntity(_0x2fbf3f,null))[_0x20ab('0x42')](handleError(_0x2fbf3f,null));}; \ No newline at end of file +var _0x27ca=['zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','key','query','filters','model','attributes','fields','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','OpenchannelApplication','includeAll','catch','params','keys','intersection','length','merge','find','create','body','destroy','eml-format','rimraf'];(function(_0x2f6466,_0x2c2d32){var _0x359d30=function(_0x385ce7){while(--_0x385ce7){_0x2f6466['push'](_0x2f6466['shift']());}};_0x359d30(++_0x2c2d32);}(_0x27ca,0x1c0));var _0xa27c=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x27ca[_0x43d11d];return _0x38cd08;};'use strict';var emlformat=require(_0xa27c('0x0'));var rimraf=require(_0xa27c('0x1'));var zipdir=require(_0xa27c('0x2'));var jsonpatch=require(_0xa27c('0x3'));var rp=require(_0xa27c('0x4'));var moment=require('moment');var BPromise=require(_0xa27c('0x5'));var Mustache=require('mustache');var util=require(_0xa27c('0x6'));var path=require('path');var sox=require(_0xa27c('0x7'));var csv=require('to-csv');var ejs=require(_0xa27c('0x8'));var fs=require('fs');var fs_extra=require(_0xa27c('0x9'));var _=require('lodash');var squel=require(_0xa27c('0xa'));var crypto=require(_0xa27c('0xb'));var jsforce=require(_0xa27c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa27c('0xd'));var querystring=require(_0xa27c('0xe'));var Papa=require(_0xa27c('0xf'));var Redis=require(_0xa27c('0x10'));var authService=require(_0xa27c('0x11'));var qs=require(_0xa27c('0x12'));var as=require(_0xa27c('0x13'));var hardwareService=require(_0xa27c('0x14'));var logger=require('../../config/logger')(_0xa27c('0x15'));var utils=require(_0xa27c('0x16'));var config=require(_0xa27c('0x17'));var licenseUtil=require(_0xa27c('0x18'));var db=require(_0xa27c('0x19'))['db'];function respondWithStatusCode(_0x1ffe40,_0x456da2){_0x456da2=_0x456da2||0xcc;return function(_0x492f0f){if(_0x492f0f){return _0x1ffe40[_0xa27c('0x1a')](_0x456da2);}return _0x1ffe40[_0xa27c('0x1b')](_0x456da2)[_0xa27c('0x1c')]();};}function respondWithResult(_0x53f66c,_0x2f415a){_0x2f415a=_0x2f415a||0xc8;return function(_0x3ea9b3){if(_0x3ea9b3){return _0x53f66c[_0xa27c('0x1b')](_0x2f415a)[_0xa27c('0x1d')](_0x3ea9b3);}};}function respondWithFilteredResult(_0x1eaedb,_0x374922){return function(_0x39a2d2){if(_0x39a2d2){var _0x42eab0=typeof _0x374922[_0xa27c('0x1e')]===_0xa27c('0x1f')&&typeof _0x374922[_0xa27c('0x20')]==='undefined';var _0xaf08ee=_0x39a2d2[_0xa27c('0x21')];var _0x6fd1a6=_0x42eab0?0x0:_0x374922[_0xa27c('0x1e')];var _0x458474=_0x42eab0?_0x39a2d2[_0xa27c('0x21')]:_0x374922[_0xa27c('0x1e')]+_0x374922[_0xa27c('0x20')];var _0x1a8621;if(_0x458474>=_0xaf08ee){_0x458474=_0xaf08ee;_0x1a8621=0xc8;}else{_0x1a8621=0xce;}_0x1eaedb[_0xa27c('0x1b')](_0x1a8621);return _0x1eaedb[_0xa27c('0x22')](_0xa27c('0x23'),_0x6fd1a6+'-'+_0x458474+'/'+_0xaf08ee)[_0xa27c('0x1d')](_0x39a2d2);}return null;};}function patchUpdates(_0x3b08f3){return function(_0x28f4c3){try{jsonpatch[_0xa27c('0x24')](_0x28f4c3,_0x3b08f3,!![]);}catch(_0x3b98b4){return BPromise[_0xa27c('0x25')](_0x3b98b4);}return _0x28f4c3[_0xa27c('0x26')]();};}function saveUpdates(_0x280e74,_0x85798a){return function(_0xe7d4be){if(_0xe7d4be){return _0xe7d4be[_0xa27c('0x27')](_0x280e74)['then'](function(_0x27c78a){return _0x27c78a;});}return null;};}function removeEntity(_0x5695d8,_0x550417){return function(_0x573942){if(_0x573942){return _0x573942['destroy']()[_0xa27c('0x28')](function(){_0x5695d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f4e7,_0x345ff0){return function(_0x4c4532){if(!_0x4c4532){_0x40f4e7[_0xa27c('0x1a')](0x194);}return _0x4c4532;};}function handleError(_0x1f0e4b,_0x2000f6){_0x2000f6=_0x2000f6||0x1f4;return function(_0x22b9e7){logger[_0xa27c('0x29')](_0x22b9e7[_0xa27c('0x2a')]);if(_0x22b9e7[_0xa27c('0x2b')]){delete _0x22b9e7[_0xa27c('0x2b')];}_0x1f0e4b['status'](_0x2000f6)[_0xa27c('0x2c')](_0x22b9e7);};}exports['index']=function(_0x588308,_0x395e95){var _0x39a7e4={},_0x180351={},_0x9b7572={'count':0x0,'rows':[]};var _0xa61fa8=_[_0xa27c('0x2d')](db['OpenchannelApplication'][_0xa27c('0x2e')],function(_0x16873e){return{'name':_0x16873e[_0xa27c('0x2f')],'type':_0x16873e['type'][_0xa27c('0x30')]};});_0x180351['model']=_[_0xa27c('0x2d')](_0xa61fa8,'name');_0x180351[_0xa27c('0x31')]=_['keys'](_0x588308[_0xa27c('0x31')]);_0x180351[_0xa27c('0x32')]=_['intersection'](_0x180351[_0xa27c('0x33')],_0x180351['query']);_0x39a7e4[_0xa27c('0x34')]=_['intersection'](_0x180351['model'],qs[_0xa27c('0x35')](_0x588308[_0xa27c('0x31')][_0xa27c('0x35')]));_0x39a7e4[_0xa27c('0x34')]=_0x39a7e4['attributes']['length']?_0x39a7e4[_0xa27c('0x34')]:_0x180351['model'];if(!_0x588308['query']['hasOwnProperty'](_0xa27c('0x36'))){_0x39a7e4[_0xa27c('0x20')]=qs[_0xa27c('0x20')](_0x588308['query'][_0xa27c('0x20')]);_0x39a7e4[_0xa27c('0x1e')]=qs['offset'](_0x588308['query']['offset']);}_0x39a7e4[_0xa27c('0x37')]=qs['sort'](_0x588308['query'][_0xa27c('0x38')]);_0x39a7e4[_0xa27c('0x39')]=qs[_0xa27c('0x32')](_[_0xa27c('0x3a')](_0x588308[_0xa27c('0x31')],_0x180351['filters']),_0xa61fa8);if(_0x588308['query'][_0xa27c('0x3b')]){_0x39a7e4[_0xa27c('0x39')]=_['merge'](_0x39a7e4[_0xa27c('0x39')],{'$or':_[_0xa27c('0x2d')](_0xa61fa8,function(_0xa65a72){if(_0xa65a72[_0xa27c('0x3c')]!==_0xa27c('0x3d')){var _0x3771a0={};_0x3771a0[_0xa65a72['name']]={'$like':'%'+_0x588308[_0xa27c('0x31')][_0xa27c('0x3b')]+'%'};return _0x3771a0;}})});}_0x39a7e4=_['merge']({},_0x39a7e4,_0x588308[_0xa27c('0x3e')]);var _0x1961e8={'where':_0x39a7e4[_0xa27c('0x39')]};return db[_0xa27c('0x3f')][_0xa27c('0x21')](_0x1961e8)[_0xa27c('0x28')](function(_0x2a5e4a){_0x9b7572[_0xa27c('0x21')]=_0x2a5e4a;if(_0x588308[_0xa27c('0x31')][_0xa27c('0x40')]){_0x39a7e4['include']=[{'all':!![]}];}return db[_0xa27c('0x3f')]['findAll'](_0x39a7e4);})[_0xa27c('0x28')](function(_0x59ad3f){_0x9b7572['rows']=_0x59ad3f;return _0x9b7572;})[_0xa27c('0x28')](respondWithFilteredResult(_0x395e95,_0x39a7e4))[_0xa27c('0x41')](handleError(_0x395e95,null));};exports['show']=function(_0x3d8512,_0x1a3f09){var _0x15cbd8={'raw':!![],'where':{'id':_0x3d8512[_0xa27c('0x42')]['id']}},_0x2f4c17={};_0x2f4c17['model']=_[_0xa27c('0x43')](db['OpenchannelApplication'][_0xa27c('0x2e')]);_0x2f4c17[_0xa27c('0x31')]=_[_0xa27c('0x43')](_0x3d8512['query']);_0x2f4c17[_0xa27c('0x32')]=_[_0xa27c('0x44')](_0x2f4c17[_0xa27c('0x33')],_0x2f4c17['query']);_0x15cbd8[_0xa27c('0x34')]=_[_0xa27c('0x44')](_0x2f4c17[_0xa27c('0x33')],qs[_0xa27c('0x35')](_0x3d8512[_0xa27c('0x31')][_0xa27c('0x35')]));_0x15cbd8[_0xa27c('0x34')]=_0x15cbd8[_0xa27c('0x34')][_0xa27c('0x45')]?_0x15cbd8['attributes']:_0x2f4c17[_0xa27c('0x33')];if(_0x3d8512['query']['includeAll']){_0x15cbd8['include']=[{'all':!![]}];}_0x15cbd8=_[_0xa27c('0x46')]({},_0x15cbd8,_0x3d8512['options']);return db[_0xa27c('0x3f')][_0xa27c('0x47')](_0x15cbd8)[_0xa27c('0x28')](handleEntityNotFound(_0x1a3f09,null))[_0xa27c('0x28')](respondWithResult(_0x1a3f09,null))[_0xa27c('0x41')](handleError(_0x1a3f09,null));};exports[_0xa27c('0x48')]=function(_0x5388,_0x2b3ec6){return db['OpenchannelApplication']['create'](_0x5388[_0xa27c('0x49')],{})[_0xa27c('0x28')](respondWithResult(_0x2b3ec6,0xc9))['catch'](handleError(_0x2b3ec6,null));};exports[_0xa27c('0x27')]=function(_0x1b9d61,_0x581385){if(_0x1b9d61[_0xa27c('0x49')]['id']){delete _0x1b9d61[_0xa27c('0x49')]['id'];}return db['OpenchannelApplication'][_0xa27c('0x47')]({'where':{'id':_0x1b9d61[_0xa27c('0x42')]['id']}})['then'](handleEntityNotFound(_0x581385,null))[_0xa27c('0x28')](saveUpdates(_0x1b9d61['body'],null))[_0xa27c('0x28')](respondWithResult(_0x581385,null))[_0xa27c('0x41')](handleError(_0x581385,null));};exports[_0xa27c('0x4a')]=function(_0x563760,_0x338f2e){return db[_0xa27c('0x3f')][_0xa27c('0x47')]({'where':{'id':_0x563760[_0xa27c('0x42')]['id']}})['then'](handleEntityNotFound(_0x338f2e,null))[_0xa27c('0x28')](removeEntity(_0x338f2e,null))['catch'](handleError(_0x338f2e,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index c344c7f..e8af36b 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 _0xe89e=['openchannel_applications','utf8mb4','util','../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelApplication'];(function(_0x53a9cb,_0x387c38){var _0x49ab92=function(_0x5b3a5d){while(--_0x5b3a5d){_0x53a9cb['push'](_0x53a9cb['shift']());}};_0x49ab92(++_0x387c38);}(_0xe89e,0x1e6));var _0xee89=function(_0x78b35a,_0x50c228){_0x78b35a=_0x78b35a-0x0;var _0x334388=_0xe89e[_0x78b35a];return _0x334388;};'use strict';var _=require('lodash');var util=require(_0xee89('0x0'));var logger=require(_0xee89('0x1'))('api');var moment=require('moment');var BPromise=require(_0xee89('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee89('0x3'));var rimraf=require(_0xee89('0x4'));var config=require(_0xee89('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0xee89('0x6')]=function(_0x4b69cb,_0x56d632){return _0x4b69cb[_0xee89('0x7')](_0xee89('0x8'),attributes,{'tableName':_0xee89('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee89('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4f86=['../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x21d76a,_0x5c686d){var _0x4e0ea8=function(_0x341a6a){while(--_0x341a6a){_0x21d76a['push'](_0x21d76a['shift']());}};_0x4e0ea8(++_0x5c686d);}(_0x4f86,0xdc));var _0x64f8=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x4f86[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x64f8('0x0'));var util=require(_0x64f8('0x1'));var logger=require(_0x64f8('0x2'))(_0x64f8('0x3'));var moment=require(_0x64f8('0x4'));var BPromise=require('bluebird');var rp=require(_0x64f8('0x5'));var fs=require('fs');var path=require(_0x64f8('0x6'));var rimraf=require(_0x64f8('0x7'));var config=require(_0x64f8('0x8'));var attributes=require(_0x64f8('0x9'));module['exports']=function(_0x1d448e,_0x43fc6d){return _0x1d448e[_0x64f8('0xa')](_0x64f8('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 4477043..f328d38 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 _0x5a05=['stringify','error','code','message','result','catch','OpenchannelApplication','update','options','raw','attributes','limit','UpdateOpenchannelApplication','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1e25dc,_0x3ca500){var _0x417ca9=function(_0xaea897){while(--_0xaea897){_0x1e25dc['push'](_0x1e25dc['shift']());}};_0x417ca9(++_0x3ca500);}(_0x5a05,0xd1));var _0x55a0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5a05[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x55a0('0x0'));var util=require(_0x55a0('0x1'));var moment=require('moment');var BPromise=require(_0x55a0('0x2'));var rs=require(_0x55a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x55a0('0x4'))['db'];var utils=require(_0x55a0('0x5'));var logger=require(_0x55a0('0x6'))('rpc');var config=require(_0x55a0('0x7'));var jayson=require(_0x55a0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f5712,_0xc2a7c5,_0x20c76e){return new BPromise(function(_0x231cf0,_0x53ccb5){return client[_0x55a0('0x9')](_0x5f5712,_0x20c76e)[_0x55a0('0xa')](function(_0x25ee1b){logger[_0x55a0('0xb')](_0x55a0('0xc'),_0xc2a7c5,_0x55a0('0xd'));logger[_0x55a0('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0xc2a7c5,_0x55a0('0xd'),JSON[_0x55a0('0xf')](_0x25ee1b));if(_0x25ee1b[_0x55a0('0x10')]){if(_0x25ee1b[_0x55a0('0x10')][_0x55a0('0x11')]===0x1f4){logger[_0x55a0('0x10')](_0x55a0('0xc'),_0xc2a7c5,_0x25ee1b[_0x55a0('0x10')][_0x55a0('0x12')]);return _0x53ccb5(_0x25ee1b[_0x55a0('0x10')][_0x55a0('0x12')]);}logger[_0x55a0('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0xc2a7c5,_0x25ee1b[_0x55a0('0x10')]['message']);return _0x231cf0(_0x25ee1b[_0x55a0('0x10')][_0x55a0('0x12')]);}else{logger[_0x55a0('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0xc2a7c5,_0x55a0('0xd'));_0x231cf0(_0x25ee1b[_0x55a0('0x13')][_0x55a0('0x12')]);}})[_0x55a0('0x14')](function(_0x337c7f){logger['error'](_0x55a0('0xc'),_0xc2a7c5,_0x337c7f);_0x53ccb5(_0x337c7f);});});}exports['UpdateOpenchannelApplication']=function(_0x4e1ed9){var _0x55ed29=this;return new Promise(function(_0x366d81,_0x20cb81){return db[_0x55a0('0x15')][_0x55a0('0x16')](_0x4e1ed9['body'],{'raw':_0x4e1ed9[_0x55a0('0x17')]?_0x4e1ed9[_0x55a0('0x17')][_0x55a0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e1ed9[_0x55a0('0x17')]?_0x4e1ed9[_0x55a0('0x17')]['where']||null:null,'attributes':_0x4e1ed9[_0x55a0('0x17')]?_0x4e1ed9[_0x55a0('0x17')][_0x55a0('0x19')]||null:null,'limit':_0x4e1ed9[_0x55a0('0x17')]?_0x4e1ed9[_0x55a0('0x17')][_0x55a0('0x1a')]||null:null})[_0x55a0('0xa')](function(_0x4210a4){logger[_0x55a0('0xb')](_0x55a0('0x1b'),_0x4e1ed9);logger[_0x55a0('0xe')](_0x55a0('0x1b'),_0x4e1ed9,JSON[_0x55a0('0xf')](_0x4210a4));_0x366d81(_0x4210a4);})['catch'](function(_0x83c4ec){logger[_0x55a0('0x10')](_0x55a0('0x1b'),_0x83c4ec['message'],_0x4e1ed9);_0x20cb81(_0x55ed29[_0x55a0('0x10')](0x1f4,_0x83c4ec[_0x55a0('0x12')]));});});}; \ No newline at end of file +var _0xad9f=['randomstring','../../config/utils','../../config/logger','../../config/environment','client','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','update','body','options','raw','where','attributes','limit','moment'];(function(_0xf15762,_0x57b898){var _0x38bd81=function(_0x5230ca){while(--_0x5230ca){_0xf15762['push'](_0xf15762['shift']());}};_0x38bd81(++_0x57b898);}(_0xad9f,0x103));var _0xfad9=function(_0x49c4b3,_0x697ef3){_0x49c4b3=_0x49c4b3-0x0;var _0x15c594=_0xad9f[_0x49c4b3];return _0x15c594;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfad9('0x0'));var BPromise=require('bluebird');var rs=require(_0xfad9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfad9('0x2'));var logger=require(_0xfad9('0x3'))('rpc');var config=require(_0xfad9('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xfad9('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x439efd,_0x50f61c,_0x2ceb19){return new BPromise(function(_0x2275fe,_0x4e4032){return client['request'](_0x439efd,_0x2ceb19)[_0xfad9('0x6')](function(_0x20ab15){logger[_0xfad9('0x7')](_0xfad9('0x8'),_0x50f61c,_0xfad9('0x9'));logger[_0xfad9('0xa')](_0xfad9('0xb'),_0x50f61c,_0xfad9('0x9'),JSON[_0xfad9('0xc')](_0x20ab15));if(_0x20ab15[_0xfad9('0xd')]){if(_0x20ab15[_0xfad9('0xd')][_0xfad9('0xe')]===0x1f4){logger['error'](_0xfad9('0x8'),_0x50f61c,_0x20ab15[_0xfad9('0xd')][_0xfad9('0xf')]);return _0x4e4032(_0x20ab15[_0xfad9('0xd')]['message']);}logger[_0xfad9('0xd')](_0xfad9('0x8'),_0x50f61c,_0x20ab15[_0xfad9('0xd')][_0xfad9('0xf')]);return _0x2275fe(_0x20ab15['error'][_0xfad9('0xf')]);}else{logger[_0xfad9('0x7')]('OpenchannelApplication,\x20%s,\x20%s',_0x50f61c,_0xfad9('0x9'));_0x2275fe(_0x20ab15[_0xfad9('0x10')][_0xfad9('0xf')]);}})[_0xfad9('0x11')](function(_0x41271f){logger['error'](_0xfad9('0x8'),_0x50f61c,_0x41271f);_0x4e4032(_0x41271f);});});}exports[_0xfad9('0x12')]=function(_0x58d8f2){var _0x245979=this;return new Promise(function(_0x13ceb4,_0x451252){return db['OpenchannelApplication'][_0xfad9('0x13')](_0x58d8f2[_0xfad9('0x14')],{'raw':_0x58d8f2[_0xfad9('0x15')]?_0x58d8f2[_0xfad9('0x15')][_0xfad9('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58d8f2[_0xfad9('0x15')]?_0x58d8f2['options'][_0xfad9('0x17')]||null:null,'attributes':_0x58d8f2['options']?_0x58d8f2[_0xfad9('0x15')][_0xfad9('0x18')]||null:null,'limit':_0x58d8f2[_0xfad9('0x15')]?_0x58d8f2['options'][_0xfad9('0x19')]||null:null})[_0xfad9('0x6')](function(_0x283d70){logger[_0xfad9('0x7')]('UpdateOpenchannelApplication',_0x58d8f2);logger[_0xfad9('0xa')](_0xfad9('0x12'),_0x58d8f2,JSON[_0xfad9('0xc')](_0x283d70));_0x13ceb4(_0x283d70);})['catch'](function(_0x2b974d){logger[_0xfad9('0xd')]('UpdateOpenchannelApplication',_0x2b974d[_0xfad9('0xf')],_0x58d8f2);_0x451252(_0x245979[_0xfad9('0xd')](0x1f4,_0x2b974d[_0xfad9('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 1eb3900..b92495a 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 _0x35da=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','getMessages','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update'];(function(_0x406ca2,_0xa7b5d7){var _0x41b7a9=function(_0x49a2fa){while(--_0x49a2fa){_0x406ca2['push'](_0x406ca2['shift']());}};_0x41b7a9(++_0xa7b5d7);}(_0x35da,0xa3));var _0xa35d=function(_0x5469b2,_0x239648){_0x5469b2=_0x5469b2-0x0;var _0x389089=_0x35da[_0x5469b2];return _0x389089;};'use strict';var multer=require(_0xa35d('0x0'));var util=require(_0xa35d('0x1'));var path=require('path');var timeout=require(_0xa35d('0x2'));var express=require(_0xa35d('0x3'));var router=express[_0xa35d('0x4')]();var fs_extra=require(_0xa35d('0x5'));var auth=require(_0xa35d('0x6'));var interaction=require(_0xa35d('0x7'));var config=require(_0xa35d('0x8'));var controller=require(_0xa35d('0x9'));router[_0xa35d('0xa')]('/',auth[_0xa35d('0xb')](),controller['index']);router[_0xa35d('0xa')](_0xa35d('0xc'),auth[_0xa35d('0xb')](),controller[_0xa35d('0xd')]);router[_0xa35d('0xa')](_0xa35d('0xe'),auth['isAuthenticated'](),controller[_0xa35d('0xf')]);router[_0xa35d('0xa')]('/:id/messages',auth[_0xa35d('0xb')](),controller[_0xa35d('0x10')]);router['get']('/:id/download',auth[_0xa35d('0xb')](),controller[_0xa35d('0x11')]);router[_0xa35d('0x12')]('/',auth[_0xa35d('0xb')](),controller[_0xa35d('0x13')]);router[_0xa35d('0x12')](_0xa35d('0x14'),auth['isAuthenticated'](),controller[_0xa35d('0x15')]);router[_0xa35d('0x12')](_0xa35d('0x16'),auth['isAuthenticated'](),interaction[_0xa35d('0x17')](_0xa35d('0x18'),_0xa35d('0x19')),controller[_0xa35d('0x1a')]);router[_0xa35d('0x1b')](_0xa35d('0xe'),auth['isAuthenticated'](),interaction[_0xa35d('0x17')](_0xa35d('0x18'),_0xa35d('0x1c')),controller['update']);router[_0xa35d('0x1d')](_0xa35d('0xe'),auth[_0xa35d('0xb')](),interaction[_0xa35d('0x17')](_0xa35d('0x18'),'openchannelinteraction:destroy'),controller[_0xa35d('0x1e')]);router['delete'](_0xa35d('0x16'),auth[_0xa35d('0xb')](),controller['removeTags']);module[_0xa35d('0x1f')]=router; \ No newline at end of file +var _0x8d53=['put','openchannel','openchannelinteraction:update','update','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0x8d53,0x1f4));var _0x38d5=function(_0x5f2545,_0x25df1d){_0x5f2545=_0x5f2545-0x0;var _0x164433=_0x8d53[_0x5f2545];return _0x164433;};'use strict';var multer=require(_0x38d5('0x0'));var util=require(_0x38d5('0x1'));var path=require(_0x38d5('0x2'));var timeout=require(_0x38d5('0x3'));var express=require(_0x38d5('0x4'));var router=express[_0x38d5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x38d5('0x6'));var interaction=require(_0x38d5('0x7'));var config=require('../../config/environment');var controller=require(_0x38d5('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x38d5('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x38d5('0xa')]);router['get'](_0x38d5('0xb'),auth[_0x38d5('0xc')](),controller[_0x38d5('0xd')]);router[_0x38d5('0x9')](_0x38d5('0xe'),auth['isAuthenticated'](),controller[_0x38d5('0xf')]);router[_0x38d5('0x9')](_0x38d5('0x10'),auth[_0x38d5('0xc')](),controller[_0x38d5('0x11')]);router[_0x38d5('0x12')]('/',auth[_0x38d5('0xc')](),controller['create']);router[_0x38d5('0x12')](_0x38d5('0xe'),auth[_0x38d5('0xc')](),controller[_0x38d5('0x13')]);router[_0x38d5('0x12')](_0x38d5('0x14'),auth[_0x38d5('0xc')](),interaction[_0x38d5('0x15')]('openchannel','openchannelinteraction:addtags'),controller['addTags']);router[_0x38d5('0x16')](_0x38d5('0xb'),auth['isAuthenticated'](),interaction[_0x38d5('0x15')](_0x38d5('0x17'),_0x38d5('0x18')),controller[_0x38d5('0x19')]);router['delete']('/:id',auth[_0x38d5('0xc')](),interaction[_0x38d5('0x15')]('openchannel','openchannelinteraction:destroy'),controller[_0x38d5('0x1a')]);router['delete'](_0x38d5('0x14'),auth[_0x38d5('0xc')](),controller[_0x38d5('0x1b')]);module[_0x38d5('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 51dbe07..8146940 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 _0xdd54=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x3a2734,_0x4cf230){var _0x3c960e=function(_0x523c96){while(--_0x523c96){_0x3a2734['push'](_0x3a2734['shift']());}};_0x3c960e(++_0x4cf230);}(_0xdd54,0x159));var _0x4dd5=function(_0x5e5f5a,_0x5cb19a){_0x5e5f5a=_0x5e5f5a-0x0;var _0x4141ae=_0xdd54[_0x5e5f5a];return _0x4141ae;};'use strict';var Sequelize=require(_0x4dd5('0x0'));module[_0x4dd5('0x1')]={'closed':{'type':Sequelize[_0x4dd5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4dd5('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4dd5('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4dd5('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x4dd5('0x4')]},'externalUrl':{'type':Sequelize[_0x4dd5('0x4')]},'lastMsgAt':{'type':Sequelize[_0x4dd5('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4dd5('0x5')]('in',_0x4dd5('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x4dd5('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x4dd5('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5178=['BOOLEAN','DATE','STRING','out','exports'];(function(_0x4382f7,_0x469668){var _0x46f0f2=function(_0x218261){while(--_0x218261){_0x4382f7['push'](_0x4382f7['shift']());}};_0x46f0f2(++_0x469668);}(_0x5178,0x171));var _0x8517=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x5178[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require('sequelize');module[_0x8517('0x0')]={'closed':{'type':Sequelize[_0x8517('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8517('0x2')]},'disposition':{'type':Sequelize[_0x8517('0x3')]},'secondDisposition':{'type':Sequelize[_0x8517('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x8517('0x2')]},'threadId':{'type':Sequelize[_0x8517('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x8517('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8517('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x8517('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x8517('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index a85c8b8..d63e984 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 _0x1f0f=['existsSync','createReadStream','pipe','createWriteStream','direction','out','System','lastName','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','sendStatus','status','end','undefined','offset','count','set','apply','reject','save','update','destroy','then','error','stack','send','fullname','TagIds','split','Tags','push','catch','waiting','talking','answered','total','closed','UserId','unmanaged','index','OpenchannelInteraction','fieldName','type','key','model','map','name','query','intersection','attributes','fields','length','limit','sort','where','filters','pick','field','color','from','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','select','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_messages','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','buildExpression','keys','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','all','rows','show','params','rawAttributes','include','options','create','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','omit','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','firstName','createdAt','secret','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','Messages','Attachment','basename'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1f0f,0x107));var _0xf1f0=function(_0x56ac80,_0x3f181c){_0x56ac80=_0x56ac80-0x0;var _0x2298b5=_0x1f0f[_0x56ac80];return _0x2298b5;};'use strict';var emlformat=require(_0xf1f0('0x0'));var rimraf=require(_0xf1f0('0x1'));var zipdir=require(_0xf1f0('0x2'));var jsonpatch=require(_0xf1f0('0x3'));var rp=require(_0xf1f0('0x4'));var moment=require(_0xf1f0('0x5'));var BPromise=require(_0xf1f0('0x6'));var Mustache=require('mustache');var util=require(_0xf1f0('0x7'));var path=require(_0xf1f0('0x8'));var sox=require(_0xf1f0('0x9'));var csv=require(_0xf1f0('0xa'));var ejs=require(_0xf1f0('0xb'));var fs=require('fs');var fs_extra=require(_0xf1f0('0xc'));var _=require(_0xf1f0('0xd'));var squel=require(_0xf1f0('0xe'));var crypto=require(_0xf1f0('0xf'));var jsforce=require(_0xf1f0('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xf1f0('0xa'));var querystring=require(_0xf1f0('0x11'));var Papa=require(_0xf1f0('0x12'));var Redis=require(_0xf1f0('0x13'));var authService=require(_0xf1f0('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xf1f0('0x15'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1f0('0x16'))(_0xf1f0('0x17'));var utils=require(_0xf1f0('0x18'));var config=require(_0xf1f0('0x19'));var licenseUtil=require(_0xf1f0('0x1a'));var db=require(_0xf1f0('0x1b'))['db'];config['redis']=_[_0xf1f0('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf1f0('0x1d'))(new Redis(config['redis']));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x2e4a48,_0x6e8993){_0x6e8993=_0x6e8993||0xcc;return function(_0x54a1e5){if(_0x54a1e5){return _0x2e4a48[_0xf1f0('0x1e')](_0x6e8993);}return _0x2e4a48[_0xf1f0('0x1f')](_0x6e8993)[_0xf1f0('0x20')]();};}function respondWithResult(_0x8758dc,_0x1b6d83){_0x1b6d83=_0x1b6d83||0xc8;return function(_0x3c0775){if(_0x3c0775){return _0x8758dc['status'](_0x1b6d83)['json'](_0x3c0775);}};}function respondWithFilteredResult(_0x19873f,_0x58ec2f){return function(_0x2abc82){if(_0x2abc82){var _0x18ae3e=typeof _0x58ec2f['offset']==='undefined'&&typeof _0x58ec2f['limit']===_0xf1f0('0x21');var _0x1a7b32=_0x2abc82['count'];var _0x16b96a=_0x18ae3e?0x0:_0x58ec2f[_0xf1f0('0x22')];var _0x4aea34=_0x18ae3e?_0x2abc82[_0xf1f0('0x23')]:_0x58ec2f[_0xf1f0('0x22')]+_0x58ec2f['limit'];var _0x2f0c5e;if(_0x4aea34>=_0x1a7b32){_0x4aea34=_0x1a7b32;_0x2f0c5e=0xc8;}else{_0x2f0c5e=0xce;}_0x19873f[_0xf1f0('0x1f')](_0x2f0c5e);return _0x19873f[_0xf1f0('0x24')]('Content-Range',_0x16b96a+'-'+_0x4aea34+'/'+_0x1a7b32)['json'](_0x2abc82);}return null;};}function patchUpdates(_0x3676b9){return function(_0x6d9a22){try{jsonpatch[_0xf1f0('0x25')](_0x6d9a22,_0x3676b9,!![]);}catch(_0x3299a6){return BPromise[_0xf1f0('0x26')](_0x3299a6);}return _0x6d9a22[_0xf1f0('0x27')]();};}function saveUpdates(_0x1189c8,_0x2e0af3){return function(_0x16f424){if(_0x16f424){return _0x16f424[_0xf1f0('0x28')](_0x1189c8)['then'](function(_0x2d2d7c){return _0x2d2d7c;});}return null;};}function removeEntity(_0x1b695f,_0x2821d2){return function(_0x51e958){if(_0x51e958){return _0x51e958[_0xf1f0('0x29')]()[_0xf1f0('0x2a')](function(){_0x1b695f[_0xf1f0('0x1f')](0xcc)[_0xf1f0('0x20')]();});}};}function handleEntityNotFound(_0x5169e6,_0x10d34c){return function(_0x18a7d1){if(!_0x18a7d1){_0x5169e6['sendStatus'](0x194);}return _0x18a7d1;};}function handleError(_0x27d38d,_0x34a15a){_0x34a15a=_0x34a15a||0x1f4;return function(_0x5c3209){logger[_0xf1f0('0x2b')](_0x5c3209[_0xf1f0('0x2c')]);if(_0x5c3209['name']){delete _0x5c3209['name'];}_0x27d38d['status'](_0x34a15a)[_0xf1f0('0x2d')](_0x5c3209);};}function getInteractionUsers(_0x2790ab,_0x1bb05e){return new BPromise(function(_0x173f39,_0x2e8634){try{if(_0x1bb05e[_0x2790ab['id']]){_0x2790ab['Users']=_['map'](_0x1bb05e[_0x2790ab['id']],function(_0xbc8e75){return{'id':_0xbc8e75['id'],'fullname':_0xbc8e75[_0xf1f0('0x2e')]};});}}catch(_0x79cc3b){_0x2e8634(_0x79cc3b);}_0x173f39(_0x2790ab);});}function getInteractionTags(_0x515584,_0x3d7a69){return new BPromise(function(_0x382c98,_0x3b5465){try{if(_0x515584[_0xf1f0('0x2f')]){_0x515584['Tags']=[];_0x515584[_0xf1f0('0x2f')][_0xf1f0('0x30')](',')['forEach'](function(_0x4a1392){_0x515584[_0xf1f0('0x31')][_0xf1f0('0x32')](_0x3d7a69[_0x4a1392]);});}delete _0x515584[_0xf1f0('0x2f')];}catch(_0x419e30){_0x3b5465(_0x419e30);}_0x382c98(_0x515584);});}function updateOpenchannelInteraction(_0x296413,_0x2186e5,_0x2b1752){return new BPromise(function(_0x101c61,_0x16488e){return getInteractionUsers(_0x296413,_0x2b1752)[_0xf1f0('0x2a')](function(_0x3244dd){return getInteractionTags(_0x3244dd,_0x2186e5);})[_0xf1f0('0x2a')](function(_0x264efd){return getStateInteraction(_0x264efd);})[_0xf1f0('0x2a')](function(_0x422f03){_0x101c61(_0x422f03);})[_0xf1f0('0x33')](function(_0x7f69f8){_0x16488e(_0x7f69f8);});});}function getStateInteraction(_0x5aa5d1){return new BPromise(function(_0x435444){_0x5aa5d1[_0xf1f0('0x34')]=0x0;_0x5aa5d1[_0xf1f0('0x35')]=0x0;_0x5aa5d1[_0xf1f0('0x36')]=0x0;_0x5aa5d1['unmanaged']=0x0;_0x5aa5d1[_0xf1f0('0x37')]=0x0;if(!_0x5aa5d1[_0xf1f0('0x38')]&&!_0x5aa5d1['UserId']){_0x5aa5d1['waiting']+=0x1;}if(!_0x5aa5d1['closed']&&_0x5aa5d1[_0xf1f0('0x39')]){_0x5aa5d1['talking']+=0x1;if(_0x5aa5d1['waiting']){_0x5aa5d1[_0xf1f0('0x34')]-=0x1;}}if(_0x5aa5d1[_0xf1f0('0x38')]&&_0x5aa5d1['UserId']){_0x5aa5d1['answered']+=0x1;if(_0x5aa5d1[_0xf1f0('0x35')]){_0x5aa5d1[_0xf1f0('0x35')]-=0x1;}}if(_0x5aa5d1[_0xf1f0('0x38')]&&!_0x5aa5d1['UserId']){_0x5aa5d1[_0xf1f0('0x3a')]+=0x1;if(_0x5aa5d1[_0xf1f0('0x34')]){_0x5aa5d1[_0xf1f0('0x34')]-=0x1;}}_0x5aa5d1[_0xf1f0('0x37')]+=0x1;_0x435444(_0x5aa5d1);});}exports[_0xf1f0('0x3b')]=function(_0x36bf21,_0x221c69){var _0x3d410f={},_0x27cbb4={},_0x33dd9d={'count':0x0,'rows':[]};var _0xe609fe=_['map'](db[_0xf1f0('0x3c')]['rawAttributes'],function(_0x2ef958){return{'name':_0x2ef958[_0xf1f0('0x3d')],'type':_0x2ef958[_0xf1f0('0x3e')][_0xf1f0('0x3f')]};});_0x27cbb4[_0xf1f0('0x40')]=_[_0xf1f0('0x41')](_0xe609fe,_0xf1f0('0x42'));_0x27cbb4[_0xf1f0('0x43')]=_['keys'](_0x36bf21[_0xf1f0('0x43')]);_0x27cbb4['filters']=_[_0xf1f0('0x44')](_0x27cbb4[_0xf1f0('0x40')],_0x27cbb4[_0xf1f0('0x43')]);_0x3d410f[_0xf1f0('0x45')]=_['intersection'](_0x27cbb4['model'],qs[_0xf1f0('0x46')](_0x36bf21[_0xf1f0('0x43')][_0xf1f0('0x46')]));_0x3d410f[_0xf1f0('0x45')]=_0x3d410f['attributes'][_0xf1f0('0x47')]?_0x3d410f[_0xf1f0('0x45')]:_0x27cbb4[_0xf1f0('0x40')];if(!_0x36bf21[_0xf1f0('0x43')]['hasOwnProperty']('nolimit')){_0x3d410f[_0xf1f0('0x48')]=qs[_0xf1f0('0x48')](_0x36bf21['query'][_0xf1f0('0x48')]);_0x3d410f[_0xf1f0('0x22')]=qs[_0xf1f0('0x22')](_0x36bf21[_0xf1f0('0x43')]['offset']);}_0x3d410f['order']=qs[_0xf1f0('0x49')](_0x36bf21[_0xf1f0('0x43')][_0xf1f0('0x49')]);_0x3d410f[_0xf1f0('0x4a')]=qs[_0xf1f0('0x4b')](_[_0xf1f0('0x4c')](_0x36bf21[_0xf1f0('0x43')],_0x27cbb4[_0xf1f0('0x4b')]),_0xe609fe);var _0x2618fd=[];var _0x2e0537=squel['select']()[_0xf1f0('0x4d')]('id')[_0xf1f0('0x4d')](_0xf1f0('0x42'))[_0xf1f0('0x4d')](_0xf1f0('0x4e'))[_0xf1f0('0x4f')]('tools_tags');var _0x51926e=squel['select']()[_0xf1f0('0x4d')](_0xf1f0('0x50'))['field'](_0xf1f0('0x51'))[_0xf1f0('0x4d')](_0xf1f0('0x52'))[_0xf1f0('0x4f')]('user_has_openchannel_interactions','ui')[_0xf1f0('0x53')](_0xf1f0('0x54'),'u',_0xf1f0('0x55'));var _0x1c1e90=squel[_0xf1f0('0x56')]()[_0xf1f0('0x4f')]('openchannel_interactions','i')[_0xf1f0('0x53')]('cm_contacts','c',_0xf1f0('0x57'))[_0xf1f0('0x53')](_0xf1f0('0x54'),'o',_0xf1f0('0x58'))[_0xf1f0('0x53')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0xf1f0('0x53')](_0xf1f0('0x59'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xf1f0('0x53')](_0xf1f0('0x5a'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0xf1f0('0x53')]('tools_tags','t',_0xf1f0('0x5b'));var _0x2235e7=squel[_0xf1f0('0x5c')]();var _0xf0dfc5=[];var _0x4ce7ab=squel[_0xf1f0('0x5c')]();var _0x2f29d0;if(_0x36bf21[_0xf1f0('0x43')][_0xf1f0('0x5d')]){_0x2f29d0=as[_0xf1f0('0x5e')](_0x36bf21[_0xf1f0('0x43')][_0xf1f0('0x5d')]);var _0xefa5ae=_0x2f29d0[_0xf1f0('0x5f')];for(var _0x3dfe09=0x0;_0x3dfe09<_0x2f29d0['conditions'][_0xf1f0('0x47')];_0x3dfe09++){var _0x419b2b=_0x2f29d0[_0xf1f0('0x60')][_0x3dfe09];var _0x11e9e7='i';var _0x237512=_[_0xf1f0('0x61')](_0xe609fe,['name',_0x419b2b[_0xf1f0('0x4d')]]);if(!_0x237512){switch(_0x419b2b['field']){case'unreadMessages':if(_0x419b2b['value']==0x1){_0x1c1e90['having']('`'+_0x419b2b['field']+'`\x20=\x200');}else{_0x1c1e90[_0xf1f0('0x62')]('`'+_0x419b2b[_0xf1f0('0x4d')]+_0xf1f0('0x63'));}break;case _0xf1f0('0x64'):if(_0x419b2b[_0xf1f0('0x65')]===_0xf1f0('0x66')){if(_0x419b2b[_0xf1f0('0x67')][_0xf1f0('0x30')]('\x20')[_0xf1f0('0x47')]>0x1){_0x2235e7[_0xefa5ae](_0xf1f0('0x68'),qs[_0xf1f0('0x69')](_0x419b2b['value']),null);}else{var _0x2f92f6='%'+_0x419b2b[_0xf1f0('0x67')]+'%';_0x2235e7[_0xefa5ae](_0xf1f0('0x6a'),_0x2f92f6,_0x2f92f6,_0x2f92f6);}}else{_0x237512=_['find'](_0xe609fe,[_0xf1f0('0x42'),_0xf1f0('0x6b')]);_0x419b2b[_0xf1f0('0x4d')]=_0xf1f0('0x6b');_0x1571b8=as['buildExpression'](_0x11e9e7,_0x237512[_0xf1f0('0x3e')],_0x419b2b);_0x2235e7[_0xefa5ae](_0x1571b8[_0xf1f0('0x6c')],_0x1571b8[_0xf1f0('0x67')][_0xf1f0('0x6d')],_0x1571b8[_0xf1f0('0x67')]['end']);}break;case _0xf1f0('0x6e'):var _0x49d580=_0x419b2b[_0xf1f0('0x67')][_0xf1f0('0x30')](',')[_0xf1f0('0x41')](function(_0x4c6492){return Number(_0x4c6492);});_0x49d580[_0xf1f0('0x6f')](function(_0x4504cc){_0x4ce7ab['or'](_0xf1f0('0x70'),'%,'+_0x4504cc+',%');});_0xf0dfc5=_[_0xf1f0('0x71')](_0xf0dfc5,_0x49d580);break;case _0xf1f0('0x72'):if(_0x419b2b[_0xf1f0('0x65')]==='$substring'){_0x2235e7[_0xefa5ae](_0xf1f0('0x73'),'%'+_0x419b2b['value']+'%',null);}else{_0x237512=_[_0xf1f0('0x61')](_0xe609fe,['name',_0xf1f0('0x39')]);_0x419b2b[_0xf1f0('0x4d')]=_0xf1f0('0x39');_0x1571b8=as['buildExpression'](_0x11e9e7,_0x237512[_0xf1f0('0x3e')],_0x419b2b);_0x2235e7[_0xefa5ae](_0x1571b8['text'],_0x1571b8[_0xf1f0('0x67')]['start'],_0x1571b8['value']['end']);}break;case _0xf1f0('0x74'):_0x1571b8=as['buildExpression']('me',null,_0x419b2b);_0x2235e7[_0xefa5ae](_0x1571b8[_0xf1f0('0x6c')],_0x1571b8[_0xf1f0('0x67')][_0xf1f0('0x6d')],_0x1571b8['value'][_0xf1f0('0x20')]);break;}}else{var _0x1571b8=as[_0xf1f0('0x75')](_0x11e9e7,_0x237512['type'],_0x419b2b);_0x2235e7[_0xefa5ae](_0x1571b8['text'],_0x1571b8['value'][_0xf1f0('0x6d')],_0x1571b8[_0xf1f0('0x67')][_0xf1f0('0x20')]);}}}else{var _0x93c853=_(_0x36bf21[_0xf1f0('0x43')])[_0xf1f0('0x76')]()[_0xf1f0('0x41')](function(_0x468556){return _[_0xf1f0('0x77')](_0xe609fe,[_0xf1f0('0x42'),_0x468556])?_0x468556:undefined;})[_0xf1f0('0x78')]()[_0xf1f0('0x67')]();if(!_[_0xf1f0('0x79')](_0x93c853)){_0x93c853[_0xf1f0('0x6f')](function(_0x4f0471){if(_0x4f0471==='OpenchannelAccountId'){_0x1c1e90[_0xf1f0('0x4a')](_0xf1f0('0x7a'),[][_0xf1f0('0x7b')](_0x36bf21[_0xf1f0('0x43')][_0x4f0471]));}else if(_0x4f0471==='createdAt'){var _0x55947f=JSON[_0xf1f0('0x7c')](_0x36bf21[_0xf1f0('0x43')][_0x4f0471])[_0xf1f0('0x7d')];var _0x1bc313=JSON[_0xf1f0('0x7c')](_0x36bf21[_0xf1f0('0x43')][_0x4f0471])[_0xf1f0('0x7e')];_0x1c1e90[_0xf1f0('0x4a')](_0xf1f0('0x7f'),_0x55947f,_0x1bc313);}else{if(_0x36bf21[_0xf1f0('0x43')][_0x4f0471]==='null'){_0x1c1e90[_0xf1f0('0x4a')]('i.'+_0x4f0471+_0xf1f0('0x80'));}else{_0x1c1e90[_0xf1f0('0x4a')]('i.'+_0x4f0471+_0xf1f0('0x81'),_0x36bf21[_0xf1f0('0x43')][_0x4f0471]);}}});}if(_0x36bf21[_0xf1f0('0x43')][_0xf1f0('0x82')]){if(_0x36bf21[_0xf1f0('0x43')][_0xf1f0('0x82')]==0x1){_0x1c1e90['having'](_0xf1f0('0x83'));}else{_0x1c1e90[_0xf1f0('0x62')](_0xf1f0('0x84'));}}if(_0x36bf21['query'][_0xf1f0('0x85')]){_0xf0dfc5=_[_0xf1f0('0x86')](_0x36bf21[_0xf1f0('0x43')][_0xf1f0('0x85')])?_0x36bf21['query']['tag']:new Array(_0x36bf21[_0xf1f0('0x43')][_0xf1f0('0x85')]);_0xf0dfc5['forEach'](function(_0x5c6a61){_0x4ce7ab['or'](_0xf1f0('0x70'),'%,'+_0x5c6a61+',%');});}if(_0x36bf21[_0xf1f0('0x43')][_0xf1f0('0x87')]){var _0x22f3bd=_0x36bf21[_0xf1f0('0x43')]['filter'][_0xf1f0('0x88')]('\x5c','\x5c\x5c')[_0xf1f0('0x88')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x22f3bd)){_0x2235e7['or'](_0xf1f0('0x89'),_0x22f3bd+'%');}else{_0x2235e7['or'](_0xf1f0('0x8a'),qs[_0xf1f0('0x69')](_0x22f3bd))['or']('i.from\x20LIKE\x20?',_0x22f3bd+'%')['or'](_0xf1f0('0x8b'),_0x22f3bd+'%');}}}_0x1c1e90[_0xf1f0('0x4a')](_0x2235e7);_0x1c1e90['group']('i.id');var _0x381900={'type':db[_0xf1f0('0x8c')][_0xf1f0('0x8d')][_0xf1f0('0x8e')],'raw':!![]};var _0x1c8e8a=_0x1c1e90['clone']();_0x1c8e8a[_0xf1f0('0x4d')](_0xf1f0('0x8f'));_0x1c8e8a[_0xf1f0('0x4d')](_0xf1f0('0x90'),_0xf1f0('0x91'));if(_0x3d410f[_0xf1f0('0x92')]){_0x3d410f[_0xf1f0('0x92')][_0xf1f0('0x6f')](function(_0x1ece20){var _0x158534=_0x1ece20[0x0]===_0xf1f0('0x93')?_0x1ece20[0x0]:'i.'+_0x1ece20[0x0];_0x1c1e90[_0xf1f0('0x92')](_0x158534,_0x1ece20[0x1]===_0xf1f0('0x94')?![]:!![]);});}if(!_[_0xf1f0('0x79')](_0xf0dfc5)){_0x1c1e90[_0xf1f0('0x62')](_0x4ce7ab);_0x1c8e8a['where'](_0xf1f0('0x95'),_0xf0dfc5);}BPromise[_0xf1f0('0x96')]()[_0xf1f0('0x2a')](function(){if(!_0x2f29d0){if(_0x36bf21[_0xf1f0('0x43')][_0xf1f0('0x97')])return;_0x1c8e8a['where'](_0xf1f0('0x98'));_0x1c1e90[_0xf1f0('0x4a')](_0xf1f0('0x98'));return;}if(_0x36bf21['user']['role']!==_0xf1f0('0x99'))return;return _0x36bf21[_0xf1f0('0x9a')][_0xf1f0('0x9b')]({'attributes':['id'],'raw':!![]})[_0xf1f0('0x2a')](function(_0x3317f6){if(_['isEmpty'](_0x3317f6)){_0x1c8e8a[_0xf1f0('0x4a')](_0xf1f0('0x9c'));_0x1c1e90[_0xf1f0('0x4a')](_0xf1f0('0x9c'));}else{_0x1c8e8a['where'](_0xf1f0('0x7a'),_[_0xf1f0('0x41')](_0x3317f6,'id'));_0x1c1e90['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0xf1f0('0x41')](_0x3317f6,'id'));}});})[_0xf1f0('0x2a')](function(){if(_0x36bf21[_0xf1f0('0x9a')][_0xf1f0('0x9d')]===_0xf1f0('0x99')&&!_0x2f29d0&&!_0x36bf21[_0xf1f0('0x43')][_0xf1f0('0x97')])return[];return db[_0xf1f0('0x9e')][_0xf1f0('0x43')](_0x1c8e8a['toString'](),_0x381900);})['then'](function(_0x141c77){_0x33dd9d['count']=_0x141c77['length'];if(_0x33dd9d[_0xf1f0('0x23')]===0x0)return[];return db[_0xf1f0('0x9e')][_0xf1f0('0x43')](_0x2e0537[_0xf1f0('0x9f')](),_0x381900)[_0xf1f0('0x2a')](function(_0x1cd2b3){_0x2618fd=_[_0xf1f0('0xa0')](_0x1cd2b3,'id');_0x381900=_[_0xf1f0('0xa1')](_0x381900,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x36bf21['query'][_0xf1f0('0x46')]){_0x3d410f[_0xf1f0('0x45')][_0xf1f0('0x6f')](function(_0x28fd67){_0x1c1e90['field']('i.'+_0x28fd67);});}else{_0x1c1e90[_0xf1f0('0x4d')](_0xf1f0('0x90'),_0xf1f0('0x91'));_0x1c1e90[_0xf1f0('0x4d')](_0xf1f0('0xa2'),_0xf1f0('0xa3'));_0x1c1e90[_0xf1f0('0x4d')](_0xf1f0('0xa4'),_0xf1f0('0xa5'));_0x1c1e90[_0xf1f0('0x4d')](_0xf1f0('0xa6'),_0xf1f0('0x93'));_0x1c1e90[_0xf1f0('0x4d')]('i.*');_0x1c1e90[_0xf1f0('0x4d')](_0xf1f0('0xa7'),_0xf1f0('0xa8'));_0x1c1e90['field'](_0xf1f0('0xa9'),_0xf1f0('0xaa'));_0x1c1e90[_0xf1f0('0x4d')](_0xf1f0('0xab'),_0xf1f0('0xac'));_0x1c1e90[_0xf1f0('0x4d')](_0xf1f0('0xad'),'Contact.phone');_0x1c1e90[_0xf1f0('0x4d')](_0xf1f0('0xae'),_0xf1f0('0xaf'));_0x1c1e90[_0xf1f0('0x4d')](_0xf1f0('0xb0'),_0xf1f0('0xb1'));_0x1c1e90['field'](_0xf1f0('0xb2'),_0xf1f0('0xb3'));_0x1c1e90[_0xf1f0('0x4d')](_0xf1f0('0xb4'),'Owner.internal');_0x1c1e90['field'](_0xf1f0('0xb5'),_0xf1f0('0x2f'));}if(_0x3d410f[_0xf1f0('0x48')])_0x1c1e90[_0xf1f0('0x48')](_0x3d410f['limit']);if(_0x3d410f[_0xf1f0('0x22')])_0x1c1e90[_0xf1f0('0x22')](_0x3d410f[_0xf1f0('0x22')]);return db[_0xf1f0('0x9e')][_0xf1f0('0x43')](_0x1c1e90[_0xf1f0('0x9f')](),_0x381900);})[_0xf1f0('0x2a')](function(_0x5525a5){if(_0x5525a5['length']>0x0)_0x51926e[_0xf1f0('0x4a')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xf1f0('0x41')](_0x5525a5,'id'));return db['sequelize']['query'](_0x51926e['toString'](),_0x381900)['then'](function(_0x512afd){var _0x269267=_[_0xf1f0('0xb6')](_0x512afd,_0xf1f0('0xb7'));var _0x4986ea=[];_0x5525a5[_0xf1f0('0x6f')](function(_0x390e60){_0x4986ea[_0xf1f0('0x32')](updateOpenchannelInteraction(_0x390e60,_0x2618fd,_0x269267));});return BPromise[_0xf1f0('0xb8')](_0x4986ea);});});})[_0xf1f0('0x2a')](function(_0x46e4e4){_0x33dd9d[_0xf1f0('0xb9')]=_0x46e4e4;return _0x33dd9d;})[_0xf1f0('0x2a')](respondWithFilteredResult(_0x221c69,_0x3d410f))[_0xf1f0('0x33')](handleError(_0x221c69,null));};exports[_0xf1f0('0xba')]=function(_0x1dd34d,_0x426415){var _0x3093df={};if(_0x1dd34d[_0xf1f0('0x43')]['type']&&_0x1dd34d[_0xf1f0('0x43')][_0xf1f0('0x3e')]==='from'){_0x3093df['from']=_0x1dd34d[_0xf1f0('0xbb')]['id'];}else{_0x3093df['id']=_0x1dd34d[_0xf1f0('0xbb')]['id'];}var _0x16737a={'raw':![],'where':_0x3093df},_0x5d9530={};_0x5d9530[_0xf1f0('0x40')]=_[_0xf1f0('0x76')](db['OpenchannelInteraction'][_0xf1f0('0xbc')]);_0x5d9530['query']=_['keys'](_0x1dd34d['query']);_0x5d9530[_0xf1f0('0x4b')]=_[_0xf1f0('0x44')](_0x5d9530[_0xf1f0('0x40')],_0x5d9530['query']);_0x16737a[_0xf1f0('0x45')]=_[_0xf1f0('0x44')](_0x5d9530[_0xf1f0('0x40')],qs[_0xf1f0('0x46')](_0x1dd34d[_0xf1f0('0x43')][_0xf1f0('0x46')]));_0x16737a[_0xf1f0('0x45')]=_0x16737a['attributes'][_0xf1f0('0x47')]?_0x16737a[_0xf1f0('0x45')]:_0x5d9530['model'];if(_0x1dd34d['query']['includeAll']){_0x16737a[_0xf1f0('0xbd')]=[{'all':!![]}];}_0x16737a=_['merge']({},_0x16737a,_0x1dd34d[_0xf1f0('0xbe')]);return db[_0xf1f0('0x3c')][_0xf1f0('0x61')](_0x16737a)['then'](handleEntityNotFound(_0x426415,null))[_0xf1f0('0x2a')](respondWithResult(_0x426415,null))[_0xf1f0('0x33')](handleError(_0x426415,null));};exports[_0xf1f0('0xbf')]=function(_0x12fc19,_0x4aa6f6){return db[_0xf1f0('0x3c')][_0xf1f0('0xbf')](_0x12fc19[_0xf1f0('0x74')],{})[_0xf1f0('0x2a')](respondWithResult(_0x4aa6f6,0xc9))[_0xf1f0('0x33')](handleError(_0x4aa6f6,null));};exports[_0xf1f0('0x28')]=function(_0x1cfcf1,_0x292841){if(_0x1cfcf1[_0xf1f0('0x74')]['id']){delete _0x1cfcf1[_0xf1f0('0x74')]['id'];}return db[_0xf1f0('0x3c')][_0xf1f0('0x61')]({'where':{'id':_0x1cfcf1['params']['id']}})[_0xf1f0('0x2a')](handleEntityNotFound(_0x292841,null))[_0xf1f0('0x2a')](saveUpdates(_0x1cfcf1['body'],null))['then'](respondWithResult(_0x292841,null))[_0xf1f0('0x33')](handleError(_0x292841,null));};exports[_0xf1f0('0x29')]=function(_0x13b11c,_0x37ca77){return db[_0xf1f0('0x3c')]['find']({'where':{'id':_0x13b11c['params']['id']}})[_0xf1f0('0x2a')](handleEntityNotFound(_0x37ca77,null))[_0xf1f0('0x2a')](removeEntity(_0x37ca77,null))[_0xf1f0('0x33')](handleError(_0x37ca77,null));};exports[_0xf1f0('0xc0')]=function(_0x1e91a5,_0x5afd33){return db[_0xf1f0('0x3c')]['describe']()[_0xf1f0('0x2a')](respondWithResult(_0x5afd33,null))['catch'](handleError(_0x5afd33,null));};exports[_0xf1f0('0xc1')]=function(_0x2a10f4,_0x2744c1,_0xd51b3c){return db[_0xf1f0('0xc2')]['find']({'where':{'id':_0x2a10f4[_0xf1f0('0xbb')]['id']}})[_0xf1f0('0x2a')](handleEntityNotFound(_0x2744c1,null))[_0xf1f0('0x2a')](function(_0x596cc4){if(_0x596cc4){return _0x596cc4[_0xf1f0('0xc1')](_0x2a10f4[_0xf1f0('0x74')][_0xf1f0('0xc3')],_['omit'](_0x2a10f4[_0xf1f0('0x74')],[_0xf1f0('0xc3'),'id'])||{});}})['then'](respondWithResult(_0x2744c1,null))[_0xf1f0('0x33')](handleError(_0x2744c1,null));};exports[_0xf1f0('0xc4')]=function(_0x280820,_0x476e4a,_0x268ab2){var _0x1148b2={'raw':![],'where':{}};var _0x3bfaed={};var _0x1c0dff={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xf1f0('0xc5')]({'where':{'id':_0x280820[_0xf1f0('0xbb')]['id']}})['then'](handleEntityNotFound(_0x476e4a,null))[_0xf1f0('0x2a')](function(_0x1e730e){if(_0x1e730e){_0x3bfaed['model']=_[_0xf1f0('0x76')](db[_0xf1f0('0xc2')][_0xf1f0('0xbc')]);_0x3bfaed[_0xf1f0('0x43')]=_[_0xf1f0('0x76')](_0x280820['query']);_0x3bfaed[_0xf1f0('0x4b')]=_['intersection'](_0x3bfaed[_0xf1f0('0x40')],_0x3bfaed[_0xf1f0('0x43')]);_0x1148b2[_0xf1f0('0x45')]=_[_0xf1f0('0x44')](_0x3bfaed['model'],qs['fields'](_0x280820[_0xf1f0('0x43')][_0xf1f0('0x46')]));_0x1148b2['attributes']=_0x1148b2[_0xf1f0('0x45')][_0xf1f0('0x47')]?_0x1148b2[_0xf1f0('0x45')]:_0x3bfaed[_0xf1f0('0x40')];if(!_0x280820[_0xf1f0('0x43')][_0xf1f0('0xc6')]('nolimit')){_0x1148b2[_0xf1f0('0x48')]=qs[_0xf1f0('0x48')](_0x280820['query'][_0xf1f0('0x48')]);_0x1148b2[_0xf1f0('0x22')]=qs['offset'](_0x280820[_0xf1f0('0x43')][_0xf1f0('0x22')]);}_0x1148b2[_0xf1f0('0x92')]=qs[_0xf1f0('0x49')](_0x280820[_0xf1f0('0x43')][_0xf1f0('0x49')]);_0x1148b2[_0xf1f0('0x4a')]=qs[_0xf1f0('0x4b')](_[_0xf1f0('0x4c')](_0x280820[_0xf1f0('0x43')],_0x3bfaed[_0xf1f0('0x4b')]));_0x1148b2[_0xf1f0('0x4a')][_0xf1f0('0xb7')]=_0x1e730e['id'];if(_0x280820[_0xf1f0('0x43')][_0xf1f0('0x87')]){_0x1148b2['where']=_['merge'](_0x1148b2[_0xf1f0('0x4a')],{'$or':_[_0xf1f0('0x41')](_0x1148b2[_0xf1f0('0x45')],function(_0x2ed471){var _0x48cdb5={};_0x48cdb5[_0x2ed471]={'$like':'%'+_0x280820[_0xf1f0('0x43')]['filter']+'%'};return _0x48cdb5;})});}if(_0x280820[_0xf1f0('0x43')][_0xf1f0('0x7d')]){var _0xea1a37=_0x280820[_0xf1f0('0x43')][_0xf1f0('0x7d')][_0xf1f0('0x30')](',');var _0x4929c2={};_0x4929c2[_0xea1a37[0x0]]={'$gte':moment(_0xea1a37[0x1])[_0xf1f0('0xc7')](_0xf1f0('0xc8'))};_0x1148b2['where']=_[_0xf1f0('0xa1')](_0x1148b2[_0xf1f0('0x4a')],_0x4929c2);}_0x1148b2=_[_0xf1f0('0xa1')]({},_0x1148b2,_0x280820[_0xf1f0('0xbe')]);return db['OpenchannelMessage']['count']({'where':_0x1148b2[_0xf1f0('0x4a')]})[_0xf1f0('0x2a')](function(_0x107802){_0x1c0dff['count']=_0x107802;if(_0x280820[_0xf1f0('0x43')][_0xf1f0('0xc9')]){_0x1148b2['include']=[{'all':!![]}];}return db[_0xf1f0('0xc2')][_0xf1f0('0xca')](_0x1148b2);})[_0xf1f0('0x2a')](function(_0x1116da){_0x1c0dff[_0xf1f0('0xb9')]=_0x1116da;return _0x1c0dff;});}})['then'](respondWithFilteredResult(_0x476e4a,_0x1148b2))['catch'](handleError(_0x476e4a,null));};exports[_0xf1f0('0xcb')]=function(_0x2dc638,_0xadeda4,_0x443238){return db['OpenchannelInteraction'][_0xf1f0('0x61')]({'where':{'id':_0x2dc638['params']['id']}})['then'](handleEntityNotFound(_0xadeda4,null))[_0xf1f0('0x2a')](function(_0x40cef4){if(_0x40cef4){return _0x40cef4[_0xf1f0('0xcc')](_0x2dc638[_0xf1f0('0x74')]['ids'],_[_0xf1f0('0xcd')](_0x2dc638[_0xf1f0('0x74')],[_0xf1f0('0xc3'),'id'])||{})['spread'](function(){return db[_0xf1f0('0x6e')]['findAll']({'attributes':['id',_0xf1f0('0x42'),_0xf1f0('0x4e')],'where':{'id':_0x2dc638[_0xf1f0('0x74')][_0xf1f0('0xc3')]}});})[_0xf1f0('0x2a')](function(_0x2c7d14){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x2dc638['params']['id']),'tags':_0x2c7d14||[]});return{'id':Number(_0x2dc638[_0xf1f0('0xbb')]['id']),'tags':_0x2c7d14||[]};});}})['then'](respondWithResult(_0xadeda4,null))['catch'](handleError(_0xadeda4,null));};exports['removeTags']=function(_0x3146ac,_0x23e7b5,_0x9d4d){return db['OpenchannelInteraction'][_0xf1f0('0x61')]({'where':{'id':_0x3146ac[_0xf1f0('0xbb')]['id']}})['then'](handleEntityNotFound(_0x23e7b5,null))['then'](function(_0x1027db){if(_0x1027db){return _0x1027db[_0xf1f0('0xce')](_0x3146ac[_0xf1f0('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x23e7b5,null))['catch'](handleError(_0x23e7b5,null));};exports['download']=function(_0x2f62bb,_0x42eb12){var _0x48cc99=moment()[_0xf1f0('0xcf')]()[_0xf1f0('0x9f')]();var _0x998a7b=path[_0xf1f0('0xd0')](config[_0xf1f0('0xd1')],_0xf1f0('0xd2'),_0xf1f0('0xd3'),'tmp');var _0x37dec=path['join'](config[_0xf1f0('0xd1')],'server',_0xf1f0('0xd3'),_0xf1f0('0xd4'));var _0x3af8a6=path[_0xf1f0('0xd0')](_0x998a7b,_0x48cc99);var _0x48bcb7=util[_0xf1f0('0xc7')](_0xf1f0('0xd5'),_0x2f62bb['params']['id'],_0x48cc99);var _0x1b5c61=path['join'](_0x998a7b,_0x48bcb7);var _0x42d619=[];_0x42d619[_0xf1f0('0x32')]({'model':db['User'],'as':_0xf1f0('0x72'),'attributes':['id',_0xf1f0('0x2e')],'raw':!![]});_0x42d619['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xf1f0('0xd6'),'lastName'],'raw':!![]});if(_0x2f62bb[_0xf1f0('0x43')][_0xf1f0('0xd4')]){_0x42d619['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x2b07e3=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0xf1f0('0x74'),_0xf1f0('0xd7'),'direction',_0xf1f0('0xd8'),_0xf1f0('0x82')],'include':_0x42d619}];_0x2b07e3[_0xf1f0('0x32')]({'model':db['OpenchannelAccount'],'as':_0xf1f0('0xd9'),'attributes':['id',_0xf1f0('0x42')]});_0x2b07e3['push']({'model':db['User'],'as':_0xf1f0('0xda'),'attributes':['id',_0xf1f0('0x2e')]});return db[_0xf1f0('0x3c')][_0xf1f0('0x61')]({'where':{'id':_0x2f62bb[_0xf1f0('0xbb')]['id']},'include':_0x2b07e3})[_0xf1f0('0x2a')](handleEntityNotFound(_0x42eb12,null))['then'](function(_0x1b2ea3){if(_0x1b2ea3){var _0x26236d=_0x1b2ea3[_0xf1f0('0xdb')]({'plain':!![]});fs[_0xf1f0('0xdc')](_0x3af8a6);var _0x39abea={'channel':_0xf1f0('0xdd'),'account':_0x26236d[_0xf1f0('0xd9')][_0xf1f0('0x42')],'agent':_0x26236d[_0xf1f0('0xda')]?_0x26236d['Owner'][_0xf1f0('0x2e')]:_0xf1f0('0xde'),'createdAt':moment(_0x26236d['createdAt'])[_0xf1f0('0xc7')](_0xf1f0('0xc8'))[_0xf1f0('0x9f')](),'closedAt':_0x26236d[_0xf1f0('0x38')]?moment(_0x26236d[_0xf1f0('0xdf')])[_0xf1f0('0xc7')](_0xf1f0('0xc8'))['toString']():'','disposition':_0x26236d[_0xf1f0('0xe0')],'visibility':_0x26236d[_0xf1f0('0xe1')]?_0xf1f0('0xe2'):_0xf1f0('0xe3'),'messages':_(_0x26236d[_0xf1f0('0xe4')])['filter']({'secret':![]})[_0xf1f0('0x41')](function(_0xcb221b){if(_0xcb221b[_0xf1f0('0xe5')]){var _0x738407=path[_0xf1f0('0xd0')](_0x37dec,_0xcb221b[_0xf1f0('0xe5')][_0xf1f0('0xe6')]);if(fs[_0xf1f0('0xe7')](_0x738407)){fs[_0xf1f0('0xe8')](_0x738407)[_0xf1f0('0xe9')](fs[_0xf1f0('0xea')](path[_0xf1f0('0xd0')](_0x3af8a6,_0xcb221b['Attachment'][_0xf1f0('0xe6')])));}}return{'date':moment(_0xcb221b[_0xf1f0('0xd7')])[_0xf1f0('0xc7')](_0xf1f0('0xc8'))['toString'](),'sender':_0xcb221b[_0xf1f0('0xeb')]===_0xf1f0('0xec')?_0xcb221b[_0xf1f0('0x72')]?_0xcb221b[_0xf1f0('0x72')]['fullname']:_0xf1f0('0xed'):_0xcb221b[_0xf1f0('0x64')]['firstName']+(_0xcb221b[_0xf1f0('0x64')][_0xf1f0('0xee')]?'\x20'+_0xcb221b[_0xf1f0('0x64')][_0xf1f0('0xee')]:''),'body':_0xcb221b[_0xf1f0('0xe5')]?_0xcb221b['Attachment'][_0xf1f0('0xe6')]:_0xcb221b[_0xf1f0('0x74')],'direction':_0xcb221b[_0xf1f0('0xeb')]==='out'?'A':'C','secret':_0xcb221b[_0xf1f0('0xd8')],'read':_0xcb221b[_0xf1f0('0x82')],'attachment':_0xcb221b[_0xf1f0('0xe5')]};})[_0xf1f0('0x67')]()};return ejs[_0xf1f0('0xef')](path['join'](config[_0xf1f0('0xd1')],_0xf1f0('0xd2'),_0xf1f0('0xf0'),_0xf1f0('0xf1')),{'interaction':_0x39abea})[_0xf1f0('0x2a')](function(_0x27e2c7){var _0x561491=path[_0xf1f0('0xd0')](_0x3af8a6,'transcript-'+_0x26236d['id']+'-'+_0x48cc99+_0xf1f0('0xf2'));var _0x10b068={'path':_0x561491,'channel':_0xf1f0('0xdd'),'interactionId':_0x26236d['id']};return pdf[_0xf1f0('0xf3')](_0x27e2c7,_0x10b068);})[_0xf1f0('0x2a')](function(){return new BPromise(function(_0x22e91a,_0x1ced1f){zipdir(_0x3af8a6,{'saveTo':_0x1b5c61},function(_0x3ee1a3,_0x4ab0f7){if(_0x3ee1a3)return _0x1ced1f(_0x3ee1a3);return _0x22e91a(_0x4ab0f7);});})[_0xf1f0('0x2a')](function(){return new BPromise(function(_0x1ec70a,_0x3c05be){rimraf(_0x3af8a6,function(_0x5e85e4){if(_0x5e85e4)_0x3c05be(_0x5e85e4);return _0x1ec70a();});});})[_0xf1f0('0x2a')](function(){return _0x42eb12[_0xf1f0('0xf4')](_0x1b5c61,_0x48bcb7,function(_0x4aaf7b){if(_0x4aaf7b){console[_0xf1f0('0xf5')](_0xf1f0('0xf6'),_0x4aaf7b);}else{fs['unlinkSync'](_0x1b5c61);}});});});}else{return _0x42eb12[_0xf1f0('0x1e')](0xc8);}})['catch'](handleError(_0x42eb12,null));}; \ No newline at end of file +var _0x2b7d=['merge','fields','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','catch','show','params','includeAll','include','options','create','update','describe','OpenchannelMessage','ids','getMessages','findOne','hasOwnProperty','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','omit','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','User','CmContact','lastName','attachments','Attachment','Messages','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','closedAt','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','System','Contact','firstName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','stack','send','Users','map','fullname','TagIds','Tags','split','forEach','push','answered','unmanaged','total','closed','UserId','waiting','talking','OpenchannelInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','select','field','name','color','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','isEmpty','OpenchannelAccountId','concat','createdAt','$gte','parse','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy'];(function(_0x2cd86c,_0x8573d2){var _0x1a822b=function(_0x157981){while(--_0x157981){_0x2cd86c['push'](_0x2cd86c['shift']());}};_0x1a822b(++_0x8573d2);}(_0x2b7d,0x14d));var _0xd2b7=function(_0x3f84d2,_0x536106){_0x3f84d2=_0x3f84d2-0x0;var _0x440900=_0x2b7d[_0x3f84d2];return _0x440900;};'use strict';var emlformat=require(_0xd2b7('0x0'));var rimraf=require(_0xd2b7('0x1'));var zipdir=require(_0xd2b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd2b7('0x3'));var moment=require(_0xd2b7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd2b7('0x5'));var path=require(_0xd2b7('0x6'));var sox=require(_0xd2b7('0x7'));var csv=require(_0xd2b7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd2b7('0x9'));var _=require(_0xd2b7('0xa'));var squel=require('squel');var crypto=require(_0xd2b7('0xb'));var jsforce=require(_0xd2b7('0xc'));var deskjs=require(_0xd2b7('0xd'));var toCsv=require(_0xd2b7('0x8'));var querystring=require('querystring');var Papa=require(_0xd2b7('0xe'));var Redis=require(_0xd2b7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd2b7('0x10'));var as=require(_0xd2b7('0x11'));var pdf=require(_0xd2b7('0x12'));var hardwareService=require(_0xd2b7('0x13'));var logger=require(_0xd2b7('0x14'))(_0xd2b7('0x15'));var utils=require(_0xd2b7('0x16'));var config=require(_0xd2b7('0x17'));var licenseUtil=require(_0xd2b7('0x18'));var db=require(_0xd2b7('0x19'))['db'];config[_0xd2b7('0x1a')]=_['defaults'](config[_0xd2b7('0x1a')],{'host':_0xd2b7('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd2b7('0x1a')]));require(_0xd2b7('0x1c'))[_0xd2b7('0x1d')](socket);function respondWithStatusCode(_0xdbae87,_0x29ef92){_0x29ef92=_0x29ef92||0xcc;return function(_0xc5f9ea){if(_0xc5f9ea){return _0xdbae87[_0xd2b7('0x1e')](_0x29ef92);}return _0xdbae87[_0xd2b7('0x1f')](_0x29ef92)['end']();};}function respondWithResult(_0x194415,_0x1b22da){_0x1b22da=_0x1b22da||0xc8;return function(_0x39695b){if(_0x39695b){return _0x194415['status'](_0x1b22da)[_0xd2b7('0x20')](_0x39695b);}};}function respondWithFilteredResult(_0x27ea90,_0x383b47){return function(_0x182a24){if(_0x182a24){var _0x4151f0=typeof _0x383b47[_0xd2b7('0x21')]===_0xd2b7('0x22')&&typeof _0x383b47['limit']===_0xd2b7('0x22');var _0x3aeebb=_0x182a24[_0xd2b7('0x23')];var _0x166aed=_0x4151f0?0x0:_0x383b47[_0xd2b7('0x21')];var _0x1e6eab=_0x4151f0?_0x182a24['count']:_0x383b47[_0xd2b7('0x21')]+_0x383b47[_0xd2b7('0x24')];var _0x3f3de2;if(_0x1e6eab>=_0x3aeebb){_0x1e6eab=_0x3aeebb;_0x3f3de2=0xc8;}else{_0x3f3de2=0xce;}_0x27ea90[_0xd2b7('0x1f')](_0x3f3de2);return _0x27ea90[_0xd2b7('0x25')](_0xd2b7('0x26'),_0x166aed+'-'+_0x1e6eab+'/'+_0x3aeebb)['json'](_0x182a24);}return null;};}function patchUpdates(_0x4229d8){return function(_0x2f5c84){try{jsonpatch[_0xd2b7('0x27')](_0x2f5c84,_0x4229d8,!![]);}catch(_0x40eccb){return BPromise['reject'](_0x40eccb);}return _0x2f5c84[_0xd2b7('0x28')]();};}function saveUpdates(_0x286441,_0x323935){return function(_0x32a30a){if(_0x32a30a){return _0x32a30a['update'](_0x286441)[_0xd2b7('0x29')](function(_0x47cd20){return _0x47cd20;});}return null;};}function removeEntity(_0x42c654,_0x348bc7){return function(_0xf81722){if(_0xf81722){return _0xf81722[_0xd2b7('0x2a')]()[_0xd2b7('0x29')](function(){_0x42c654[_0xd2b7('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x389e76,_0x25c41c){return function(_0x1fe1a4){if(!_0x1fe1a4){_0x389e76[_0xd2b7('0x1e')](0x194);}return _0x1fe1a4;};}function handleError(_0x1ea8b6,_0x134a7a){_0x134a7a=_0x134a7a||0x1f4;return function(_0x1bb368){logger['error'](_0x1bb368[_0xd2b7('0x2b')]);if(_0x1bb368['name']){delete _0x1bb368['name'];}_0x1ea8b6['status'](_0x134a7a)[_0xd2b7('0x2c')](_0x1bb368);};}function getInteractionUsers(_0x65aba8,_0x11bc8e){return new BPromise(function(_0x5b41ca,_0x45a0df){try{if(_0x11bc8e[_0x65aba8['id']]){_0x65aba8[_0xd2b7('0x2d')]=_[_0xd2b7('0x2e')](_0x11bc8e[_0x65aba8['id']],function(_0x38abb6){return{'id':_0x38abb6['id'],'fullname':_0x38abb6[_0xd2b7('0x2f')]};});}}catch(_0x4ede63){_0x45a0df(_0x4ede63);}_0x5b41ca(_0x65aba8);});}function getInteractionTags(_0x39aafe,_0x450765){return new BPromise(function(_0xca00da,_0x554363){try{if(_0x39aafe[_0xd2b7('0x30')]){_0x39aafe[_0xd2b7('0x31')]=[];_0x39aafe[_0xd2b7('0x30')][_0xd2b7('0x32')](',')[_0xd2b7('0x33')](function(_0x11435c){_0x39aafe[_0xd2b7('0x31')][_0xd2b7('0x34')](_0x450765[_0x11435c]);});}delete _0x39aafe[_0xd2b7('0x30')];}catch(_0x74e540){_0x554363(_0x74e540);}_0xca00da(_0x39aafe);});}function updateOpenchannelInteraction(_0x906228,_0x4da70b,_0x103c67){return new BPromise(function(_0x38a235,_0x44cbe9){return getInteractionUsers(_0x906228,_0x103c67)[_0xd2b7('0x29')](function(_0x2b6fc1){return getInteractionTags(_0x2b6fc1,_0x4da70b);})['then'](function(_0x15a06f){return getStateInteraction(_0x15a06f);})[_0xd2b7('0x29')](function(_0x7783ec){_0x38a235(_0x7783ec);})['catch'](function(_0x572355){_0x44cbe9(_0x572355);});});}function getStateInteraction(_0x5bb91a){return new BPromise(function(_0xa3bfd){_0x5bb91a['waiting']=0x0;_0x5bb91a['talking']=0x0;_0x5bb91a[_0xd2b7('0x35')]=0x0;_0x5bb91a[_0xd2b7('0x36')]=0x0;_0x5bb91a[_0xd2b7('0x37')]=0x0;if(!_0x5bb91a[_0xd2b7('0x38')]&&!_0x5bb91a[_0xd2b7('0x39')]){_0x5bb91a[_0xd2b7('0x3a')]+=0x1;}if(!_0x5bb91a[_0xd2b7('0x38')]&&_0x5bb91a[_0xd2b7('0x39')]){_0x5bb91a[_0xd2b7('0x3b')]+=0x1;if(_0x5bb91a[_0xd2b7('0x3a')]){_0x5bb91a[_0xd2b7('0x3a')]-=0x1;}}if(_0x5bb91a[_0xd2b7('0x38')]&&_0x5bb91a[_0xd2b7('0x39')]){_0x5bb91a[_0xd2b7('0x35')]+=0x1;if(_0x5bb91a[_0xd2b7('0x3b')]){_0x5bb91a[_0xd2b7('0x3b')]-=0x1;}}if(_0x5bb91a[_0xd2b7('0x38')]&&!_0x5bb91a[_0xd2b7('0x39')]){_0x5bb91a[_0xd2b7('0x36')]+=0x1;if(_0x5bb91a[_0xd2b7('0x3a')]){_0x5bb91a[_0xd2b7('0x3a')]-=0x1;}}_0x5bb91a['total']+=0x1;_0xa3bfd(_0x5bb91a);});}exports['index']=function(_0x45dbb2,_0x4998ab){var _0x4dc347={},_0x41ed11={},_0x65bcc8={'count':0x0,'rows':[]};var _0x448491=_['map'](db[_0xd2b7('0x3c')][_0xd2b7('0x3d')],function(_0x40ccd1){return{'name':_0x40ccd1[_0xd2b7('0x3e')],'type':_0x40ccd1[_0xd2b7('0x3f')][_0xd2b7('0x40')]};});_0x41ed11['model']=_[_0xd2b7('0x2e')](_0x448491,'name');_0x41ed11[_0xd2b7('0x41')]=_[_0xd2b7('0x42')](_0x45dbb2[_0xd2b7('0x41')]);_0x41ed11[_0xd2b7('0x43')]=_[_0xd2b7('0x44')](_0x41ed11[_0xd2b7('0x45')],_0x41ed11[_0xd2b7('0x41')]);_0x4dc347[_0xd2b7('0x46')]=_[_0xd2b7('0x44')](_0x41ed11[_0xd2b7('0x45')],qs['fields'](_0x45dbb2[_0xd2b7('0x41')]['fields']));_0x4dc347['attributes']=_0x4dc347[_0xd2b7('0x46')][_0xd2b7('0x47')]?_0x4dc347[_0xd2b7('0x46')]:_0x41ed11[_0xd2b7('0x45')];if(!_0x45dbb2[_0xd2b7('0x41')]['hasOwnProperty'](_0xd2b7('0x48'))){_0x4dc347[_0xd2b7('0x24')]=qs['limit'](_0x45dbb2[_0xd2b7('0x41')][_0xd2b7('0x24')]);_0x4dc347[_0xd2b7('0x21')]=qs[_0xd2b7('0x21')](_0x45dbb2[_0xd2b7('0x41')][_0xd2b7('0x21')]);}_0x4dc347[_0xd2b7('0x49')]=qs[_0xd2b7('0x4a')](_0x45dbb2[_0xd2b7('0x41')][_0xd2b7('0x4a')]);_0x4dc347[_0xd2b7('0x4b')]=qs[_0xd2b7('0x43')](_[_0xd2b7('0x4c')](_0x45dbb2[_0xd2b7('0x41')],_0x41ed11[_0xd2b7('0x43')]),_0x448491);var _0x5820f6=[];var _0x134f5c=squel[_0xd2b7('0x4d')]()['field']('id')[_0xd2b7('0x4e')](_0xd2b7('0x4f'))[_0xd2b7('0x4e')](_0xd2b7('0x50'))[_0xd2b7('0x51')](_0xd2b7('0x52'));var _0x519240=squel['select']()[_0xd2b7('0x4e')](_0xd2b7('0x53'))[_0xd2b7('0x4e')](_0xd2b7('0x54'))['field']('ui.OpenchannelInteractionId')[_0xd2b7('0x51')](_0xd2b7('0x55'),'ui')[_0xd2b7('0x56')](_0xd2b7('0x57'),'u',_0xd2b7('0x58'));var _0x4d86ef=squel[_0xd2b7('0x4d')]()[_0xd2b7('0x51')](_0xd2b7('0x59'),'i')[_0xd2b7('0x56')](_0xd2b7('0x5a'),'c',_0xd2b7('0x5b'))[_0xd2b7('0x56')]('users','o',_0xd2b7('0x5c'))[_0xd2b7('0x56')](_0xd2b7('0x5d'),'a',_0xd2b7('0x5e'))['left_join'](_0xd2b7('0x5f'),'me',_0xd2b7('0x60'))[_0xd2b7('0x56')](_0xd2b7('0x61'),'it',_0xd2b7('0x62'))[_0xd2b7('0x56')](_0xd2b7('0x52'),'t','t.id\x20=\x20it.TagId');var _0x99f70a=squel[_0xd2b7('0x63')]();var _0x4b526d=[];var _0x27e686=squel['expr']();var _0x251f49;if(_0x45dbb2[_0xd2b7('0x41')]['search']){_0x251f49=as[_0xd2b7('0x64')](_0x45dbb2[_0xd2b7('0x41')]['search']);var _0x37d941=_0x251f49[_0xd2b7('0x65')];for(var _0x44b39e=0x0;_0x44b39e<_0x251f49['conditions']['length'];_0x44b39e++){var _0x261fdc=_0x251f49[_0xd2b7('0x66')][_0x44b39e];var _0x221565='i';var _0x29384d=_[_0xd2b7('0x67')](_0x448491,[_0xd2b7('0x4f'),_0x261fdc[_0xd2b7('0x4e')]]);if(!_0x29384d){switch(_0x261fdc[_0xd2b7('0x4e')]){case _0xd2b7('0x68'):if(_0x261fdc[_0xd2b7('0x69')]==0x1){_0x4d86ef[_0xd2b7('0x6a')]('`'+_0x261fdc[_0xd2b7('0x4e')]+_0xd2b7('0x6b'));}else{_0x4d86ef['having']('`'+_0x261fdc[_0xd2b7('0x4e')]+'`\x20>\x200');}break;case'Contact':if(_0x261fdc[_0xd2b7('0x6c')]===_0xd2b7('0x6d')){if(_0x261fdc['value'][_0xd2b7('0x32')]('\x20')[_0xd2b7('0x47')]>0x1){_0x99f70a[_0x37d941](_0xd2b7('0x6e'),qs[_0xd2b7('0x6f')](_0x261fdc['value']),null);}else{var _0x2c4178='%'+_0x261fdc[_0xd2b7('0x69')]+'%';_0x99f70a[_0x37d941]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2c4178,_0x2c4178,_0x2c4178);}}else{_0x29384d=_['find'](_0x448491,[_0xd2b7('0x4f'),_0xd2b7('0x70')]);_0x261fdc[_0xd2b7('0x4e')]=_0xd2b7('0x70');_0x56c413=as[_0xd2b7('0x71')](_0x221565,_0x29384d['type'],_0x261fdc);_0x99f70a[_0x37d941](_0x56c413[_0xd2b7('0x72')],_0x56c413[_0xd2b7('0x69')][_0xd2b7('0x73')],_0x56c413[_0xd2b7('0x69')][_0xd2b7('0x74')]);}break;case _0xd2b7('0x75'):var _0x3547be=_0x261fdc['value'][_0xd2b7('0x32')](',')[_0xd2b7('0x2e')](function(_0x2315aa){return Number(_0x2315aa);});_0x3547be[_0xd2b7('0x33')](function(_0x47835c){_0x27e686['or'](_0xd2b7('0x76'),'%,'+_0x47835c+',%');});_0x4b526d=_[_0xd2b7('0x77')](_0x4b526d,_0x3547be);break;case'User':if(_0x261fdc['operator']===_0xd2b7('0x6d')){_0x99f70a[_0x37d941](_0xd2b7('0x78'),'%'+_0x261fdc[_0xd2b7('0x69')]+'%',null);}else{_0x29384d=_['find'](_0x448491,[_0xd2b7('0x4f'),_0xd2b7('0x39')]);_0x261fdc[_0xd2b7('0x4e')]=_0xd2b7('0x39');_0x56c413=as[_0xd2b7('0x71')](_0x221565,_0x29384d[_0xd2b7('0x3f')],_0x261fdc);_0x99f70a[_0x37d941](_0x56c413[_0xd2b7('0x72')],_0x56c413['value']['start'],_0x56c413['value'][_0xd2b7('0x74')]);}break;case _0xd2b7('0x79'):_0x56c413=as['buildExpression']('me',null,_0x261fdc);_0x99f70a[_0x37d941](_0x56c413[_0xd2b7('0x72')],_0x56c413[_0xd2b7('0x69')][_0xd2b7('0x73')],_0x56c413[_0xd2b7('0x69')][_0xd2b7('0x74')]);break;}}else{var _0x56c413=as[_0xd2b7('0x71')](_0x221565,_0x29384d[_0xd2b7('0x3f')],_0x261fdc);_0x99f70a[_0x37d941](_0x56c413[_0xd2b7('0x72')],_0x56c413['value'][_0xd2b7('0x73')],_0x56c413['value'][_0xd2b7('0x74')]);}}}else{var _0x44083d=_(_0x45dbb2[_0xd2b7('0x41')])[_0xd2b7('0x42')]()[_0xd2b7('0x2e')](function(_0x21186e){return _['some'](_0x448491,[_0xd2b7('0x4f'),_0x21186e])?_0x21186e:undefined;})['compact']()['value']();if(!_[_0xd2b7('0x7a')](_0x44083d)){_0x44083d[_0xd2b7('0x33')](function(_0x6d00b8){if(_0x6d00b8===_0xd2b7('0x7b')){_0x4d86ef[_0xd2b7('0x4b')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xd2b7('0x7c')](_0x45dbb2[_0xd2b7('0x41')][_0x6d00b8]));}else if(_0x6d00b8===_0xd2b7('0x7d')){var _0x3f3e35=JSON['parse'](_0x45dbb2[_0xd2b7('0x41')][_0x6d00b8])[_0xd2b7('0x7e')];var _0x59de89=JSON[_0xd2b7('0x7f')](_0x45dbb2[_0xd2b7('0x41')][_0x6d00b8])['$lte'];_0x4d86ef[_0xd2b7('0x4b')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3f3e35,_0x59de89);}else{if(_0x45dbb2[_0xd2b7('0x41')][_0x6d00b8]==='null'){_0x4d86ef['where']('i.'+_0x6d00b8+_0xd2b7('0x80'));}else{_0x4d86ef[_0xd2b7('0x4b')]('i.'+_0x6d00b8+_0xd2b7('0x81'),_0x45dbb2[_0xd2b7('0x41')][_0x6d00b8]);}}});}if(_0x45dbb2[_0xd2b7('0x41')]['read']){if(_0x45dbb2['query'][_0xd2b7('0x82')]==0x1){_0x4d86ef[_0xd2b7('0x6a')](_0xd2b7('0x83'));}else{_0x4d86ef['having'](_0xd2b7('0x84'));}}if(_0x45dbb2[_0xd2b7('0x41')][_0xd2b7('0x85')]){_0x4b526d=_['isArray'](_0x45dbb2[_0xd2b7('0x41')][_0xd2b7('0x85')])?_0x45dbb2['query'][_0xd2b7('0x85')]:new Array(_0x45dbb2[_0xd2b7('0x41')]['tag']);_0x4b526d['forEach'](function(_0x29fa60){_0x27e686['or'](_0xd2b7('0x76'),'%,'+_0x29fa60+',%');});}if(_0x45dbb2[_0xd2b7('0x41')]['filter']){var _0x18717f=_0x45dbb2['query'][_0xd2b7('0x86')][_0xd2b7('0x87')]('\x5c','\x5c\x5c')[_0xd2b7('0x87')](/'/g,'\x27\x27');if(qs[_0xd2b7('0x88')](_0x18717f)){_0x99f70a['or'](_0xd2b7('0x89'),_0x18717f+'%');}else{_0x99f70a['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd2b7('0x6f')](_0x18717f))['or'](_0xd2b7('0x8a'),_0x18717f+'%')['or'](_0xd2b7('0x8b'),_0x18717f+'%');}}}_0x4d86ef[_0xd2b7('0x4b')](_0x99f70a);_0x4d86ef[_0xd2b7('0x8c')](_0xd2b7('0x8d'));var _0x3c503b={'type':db[_0xd2b7('0x8e')]['QueryTypes'][_0xd2b7('0x8f')],'raw':!![]};var _0x5aaaf9=_0x4d86ef[_0xd2b7('0x90')]();_0x5aaaf9['field'](_0xd2b7('0x8d'));_0x5aaaf9[_0xd2b7('0x4e')](_0xd2b7('0x91'),'unreadMessages');if(_0x4dc347[_0xd2b7('0x49')]){_0x4dc347['order']['forEach'](function(_0x407aff){var _0x34b6c8=_0x407aff[0x0]===_0xd2b7('0x92')?_0x407aff[0x0]:'i.'+_0x407aff[0x0];_0x4d86ef['order'](_0x34b6c8,_0x407aff[0x1]===_0xd2b7('0x93')?![]:!![]);});}if(!_['isEmpty'](_0x4b526d)){_0x4d86ef[_0xd2b7('0x6a')](_0x27e686);_0x5aaaf9[_0xd2b7('0x4b')]('t.id\x20IN\x20?',_0x4b526d);}BPromise[_0xd2b7('0x94')]()['then'](function(){if(!_0x251f49){if(_0x45dbb2[_0xd2b7('0x41')][_0xd2b7('0x7b')])return;_0x5aaaf9['where'](_0xd2b7('0x95'));_0x4d86ef[_0xd2b7('0x4b')](_0xd2b7('0x95'));return;}if(_0x45dbb2[_0xd2b7('0x96')][_0xd2b7('0x97')]!==_0xd2b7('0x98'))return;return _0x45dbb2['user'][_0xd2b7('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4986ad){if(_[_0xd2b7('0x7a')](_0x4986ad)){_0x5aaaf9[_0xd2b7('0x4b')](_0xd2b7('0x9a'));_0x4d86ef[_0xd2b7('0x4b')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x5aaaf9[_0xd2b7('0x4b')](_0xd2b7('0x9b'),_[_0xd2b7('0x2e')](_0x4986ad,'id'));_0x4d86ef['where'](_0xd2b7('0x9b'),_[_0xd2b7('0x2e')](_0x4986ad,'id'));}});})['then'](function(){if(_0x45dbb2['user']['role']===_0xd2b7('0x98')&&!_0x251f49&&!_0x45dbb2['query'][_0xd2b7('0x7b')])return[];return db[_0xd2b7('0x9c')][_0xd2b7('0x41')](_0x5aaaf9[_0xd2b7('0x9d')](),_0x3c503b);})[_0xd2b7('0x29')](function(_0x413606){_0x65bcc8[_0xd2b7('0x23')]=_0x413606[_0xd2b7('0x47')];if(_0x65bcc8[_0xd2b7('0x23')]===0x0)return[];return db[_0xd2b7('0x9c')][_0xd2b7('0x41')](_0x134f5c['toString'](),_0x3c503b)[_0xd2b7('0x29')](function(_0x2f6dcb){_0x5820f6=_[_0xd2b7('0x9e')](_0x2f6dcb,'id');_0x3c503b=_[_0xd2b7('0x9f')](_0x3c503b,{'model':db[_0xd2b7('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x45dbb2[_0xd2b7('0x41')][_0xd2b7('0xa0')]){_0x4dc347[_0xd2b7('0x46')]['forEach'](function(_0x417ca0){_0x4d86ef[_0xd2b7('0x4e')]('i.'+_0x417ca0);});}else{_0x4d86ef[_0xd2b7('0x4e')](_0xd2b7('0x91'),_0xd2b7('0x68'));_0x4d86ef[_0xd2b7('0x4e')](_0xd2b7('0xa1'),'Account.key');_0x4d86ef[_0xd2b7('0x4e')](_0xd2b7('0xa2'),_0xd2b7('0xa3'));_0x4d86ef[_0xd2b7('0x4e')]('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',_0xd2b7('0x92'));_0x4d86ef[_0xd2b7('0x4e')](_0xd2b7('0xa4'));_0x4d86ef['field'](_0xd2b7('0xa5'),'Contact.firstName');_0x4d86ef[_0xd2b7('0x4e')]('c.lastName',_0xd2b7('0xa6'));_0x4d86ef['field'](_0xd2b7('0xa7'),'Contact.email');_0x4d86ef[_0xd2b7('0x4e')](_0xd2b7('0xa8'),'Contact.phone');_0x4d86ef[_0xd2b7('0x4e')](_0xd2b7('0xa9'),_0xd2b7('0xaa'));_0x4d86ef[_0xd2b7('0x4e')](_0xd2b7('0xab'),_0xd2b7('0xac'));_0x4d86ef[_0xd2b7('0x4e')](_0xd2b7('0xad'),'Owner.fullname');_0x4d86ef[_0xd2b7('0x4e')](_0xd2b7('0xae'),_0xd2b7('0xaf'));_0x4d86ef[_0xd2b7('0x4e')](_0xd2b7('0xb0'),'TagIds');}if(_0x4dc347[_0xd2b7('0x24')])_0x4d86ef[_0xd2b7('0x24')](_0x4dc347[_0xd2b7('0x24')]);if(_0x4dc347['offset'])_0x4d86ef[_0xd2b7('0x21')](_0x4dc347[_0xd2b7('0x21')]);return db[_0xd2b7('0x9c')]['query'](_0x4d86ef['toString'](),_0x3c503b);})[_0xd2b7('0x29')](function(_0x3606da){if(_0x3606da[_0xd2b7('0x47')]>0x0)_0x519240[_0xd2b7('0x4b')](_0xd2b7('0xb1'),_['map'](_0x3606da,'id'));return db['sequelize'][_0xd2b7('0x41')](_0x519240['toString'](),_0x3c503b)[_0xd2b7('0x29')](function(_0x3e1c21){var _0x4665d3=_[_0xd2b7('0xb2')](_0x3e1c21,'OpenchannelInteractionId');var _0x4119c9=[];_0x3606da[_0xd2b7('0x33')](function(_0x271116){_0x4119c9[_0xd2b7('0x34')](updateOpenchannelInteraction(_0x271116,_0x5820f6,_0x4665d3));});return BPromise[_0xd2b7('0xb3')](_0x4119c9);});});})[_0xd2b7('0x29')](function(_0x1ab4b0){_0x65bcc8['rows']=_0x1ab4b0;return _0x65bcc8;})[_0xd2b7('0x29')](respondWithFilteredResult(_0x4998ab,_0x4dc347))[_0xd2b7('0xb4')](handleError(_0x4998ab,null));};exports[_0xd2b7('0xb5')]=function(_0x3bb02a,_0x2885dc){var _0x1d9279={};if(_0x3bb02a[_0xd2b7('0x41')][_0xd2b7('0x3f')]&&_0x3bb02a[_0xd2b7('0x41')][_0xd2b7('0x3f')]==='from'){_0x1d9279['from']=_0x3bb02a[_0xd2b7('0xb6')]['id'];}else{_0x1d9279['id']=_0x3bb02a['params']['id'];}var _0x5141a6={'raw':![],'where':_0x1d9279},_0x366d7e={};_0x366d7e[_0xd2b7('0x45')]=_[_0xd2b7('0x42')](db[_0xd2b7('0x3c')][_0xd2b7('0x3d')]);_0x366d7e[_0xd2b7('0x41')]=_['keys'](_0x3bb02a[_0xd2b7('0x41')]);_0x366d7e[_0xd2b7('0x43')]=_[_0xd2b7('0x44')](_0x366d7e[_0xd2b7('0x45')],_0x366d7e[_0xd2b7('0x41')]);_0x5141a6[_0xd2b7('0x46')]=_[_0xd2b7('0x44')](_0x366d7e[_0xd2b7('0x45')],qs['fields'](_0x3bb02a[_0xd2b7('0x41')][_0xd2b7('0xa0')]));_0x5141a6[_0xd2b7('0x46')]=_0x5141a6[_0xd2b7('0x46')][_0xd2b7('0x47')]?_0x5141a6[_0xd2b7('0x46')]:_0x366d7e[_0xd2b7('0x45')];if(_0x3bb02a[_0xd2b7('0x41')][_0xd2b7('0xb7')]){_0x5141a6[_0xd2b7('0xb8')]=[{'all':!![]}];}_0x5141a6=_[_0xd2b7('0x9f')]({},_0x5141a6,_0x3bb02a[_0xd2b7('0xb9')]);return db[_0xd2b7('0x3c')][_0xd2b7('0x67')](_0x5141a6)[_0xd2b7('0x29')](handleEntityNotFound(_0x2885dc,null))[_0xd2b7('0x29')](respondWithResult(_0x2885dc,null))['catch'](handleError(_0x2885dc,null));};exports[_0xd2b7('0xba')]=function(_0x5a126c,_0x27b7c3){return db[_0xd2b7('0x3c')][_0xd2b7('0xba')](_0x5a126c[_0xd2b7('0x79')],{})[_0xd2b7('0x29')](respondWithResult(_0x27b7c3,0xc9))[_0xd2b7('0xb4')](handleError(_0x27b7c3,null));};exports[_0xd2b7('0xbb')]=function(_0x24cf69,_0x51364f){if(_0x24cf69[_0xd2b7('0x79')]['id']){delete _0x24cf69[_0xd2b7('0x79')]['id'];}return db['OpenchannelInteraction'][_0xd2b7('0x67')]({'where':{'id':_0x24cf69[_0xd2b7('0xb6')]['id']}})[_0xd2b7('0x29')](handleEntityNotFound(_0x51364f,null))['then'](saveUpdates(_0x24cf69[_0xd2b7('0x79')],null))[_0xd2b7('0x29')](respondWithResult(_0x51364f,null))['catch'](handleError(_0x51364f,null));};exports['destroy']=function(_0x19e37b,_0x29459e){return db[_0xd2b7('0x3c')]['find']({'where':{'id':_0x19e37b['params']['id']}})[_0xd2b7('0x29')](handleEntityNotFound(_0x29459e,null))['then'](removeEntity(_0x29459e,null))[_0xd2b7('0xb4')](handleError(_0x29459e,null));};exports[_0xd2b7('0xbc')]=function(_0x514bd4,_0x1c7e8d){return db[_0xd2b7('0x3c')][_0xd2b7('0xbc')]()[_0xd2b7('0x29')](respondWithResult(_0x1c7e8d,null))[_0xd2b7('0xb4')](handleError(_0x1c7e8d,null));};exports['addMessage']=function(_0x3b1874,_0x49e122,_0x323522){return db[_0xd2b7('0xbd')][_0xd2b7('0x67')]({'where':{'id':_0x3b1874[_0xd2b7('0xb6')]['id']}})[_0xd2b7('0x29')](handleEntityNotFound(_0x49e122,null))[_0xd2b7('0x29')](function(_0x1581d2){if(_0x1581d2){return _0x1581d2['addMessage'](_0x3b1874[_0xd2b7('0x79')][_0xd2b7('0xbe')],_['omit'](_0x3b1874[_0xd2b7('0x79')],[_0xd2b7('0xbe'),'id'])||{});}})[_0xd2b7('0x29')](respondWithResult(_0x49e122,null))[_0xd2b7('0xb4')](handleError(_0x49e122,null));};exports[_0xd2b7('0xbf')]=function(_0x172da3,_0x3f72ba,_0x483fb1){var _0x25d730={'raw':![],'where':{}};var _0x290862={};var _0x298328={'count':0x0,'rows':[]};return db[_0xd2b7('0x3c')][_0xd2b7('0xc0')]({'where':{'id':_0x172da3['params']['id']}})[_0xd2b7('0x29')](handleEntityNotFound(_0x3f72ba,null))['then'](function(_0x1e5c60){if(_0x1e5c60){_0x290862[_0xd2b7('0x45')]=_['keys'](db[_0xd2b7('0xbd')][_0xd2b7('0x3d')]);_0x290862[_0xd2b7('0x41')]=_[_0xd2b7('0x42')](_0x172da3['query']);_0x290862['filters']=_[_0xd2b7('0x44')](_0x290862['model'],_0x290862[_0xd2b7('0x41')]);_0x25d730[_0xd2b7('0x46')]=_['intersection'](_0x290862[_0xd2b7('0x45')],qs[_0xd2b7('0xa0')](_0x172da3[_0xd2b7('0x41')][_0xd2b7('0xa0')]));_0x25d730[_0xd2b7('0x46')]=_0x25d730[_0xd2b7('0x46')][_0xd2b7('0x47')]?_0x25d730[_0xd2b7('0x46')]:_0x290862['model'];if(!_0x172da3[_0xd2b7('0x41')][_0xd2b7('0xc1')]('nolimit')){_0x25d730[_0xd2b7('0x24')]=qs['limit'](_0x172da3['query']['limit']);_0x25d730[_0xd2b7('0x21')]=qs[_0xd2b7('0x21')](_0x172da3[_0xd2b7('0x41')]['offset']);}_0x25d730[_0xd2b7('0x49')]=qs['sort'](_0x172da3[_0xd2b7('0x41')][_0xd2b7('0x4a')]);_0x25d730[_0xd2b7('0x4b')]=qs[_0xd2b7('0x43')](_[_0xd2b7('0x4c')](_0x172da3[_0xd2b7('0x41')],_0x290862[_0xd2b7('0x43')]));_0x25d730[_0xd2b7('0x4b')][_0xd2b7('0xc2')]=_0x1e5c60['id'];if(_0x172da3[_0xd2b7('0x41')][_0xd2b7('0x86')]){_0x25d730[_0xd2b7('0x4b')]=_['merge'](_0x25d730[_0xd2b7('0x4b')],{'$or':_[_0xd2b7('0x2e')](_0x25d730[_0xd2b7('0x46')],function(_0x143346){var _0x365eee={};_0x365eee[_0x143346]={'$like':'%'+_0x172da3['query'][_0xd2b7('0x86')]+'%'};return _0x365eee;})});}if(_0x172da3[_0xd2b7('0x41')]['$gte']){var _0x942bf8=_0x172da3['query'][_0xd2b7('0x7e')][_0xd2b7('0x32')](',');var _0x15fdf9={};_0x15fdf9[_0x942bf8[0x0]]={'$gte':moment(_0x942bf8[0x1])[_0xd2b7('0xc3')](_0xd2b7('0xc4'))};_0x25d730[_0xd2b7('0x4b')]=_[_0xd2b7('0x9f')](_0x25d730['where'],_0x15fdf9);}_0x25d730=_[_0xd2b7('0x9f')]({},_0x25d730,_0x172da3[_0xd2b7('0xb9')]);return db[_0xd2b7('0xbd')][_0xd2b7('0x23')]({'where':_0x25d730[_0xd2b7('0x4b')]})[_0xd2b7('0x29')](function(_0x3abb33){_0x298328[_0xd2b7('0x23')]=_0x3abb33;if(_0x172da3[_0xd2b7('0x41')]['includeAll']){_0x25d730[_0xd2b7('0xb8')]=[{'all':!![]}];}return db[_0xd2b7('0xbd')][_0xd2b7('0xc5')](_0x25d730);})[_0xd2b7('0x29')](function(_0x38e239){_0x298328[_0xd2b7('0xc6')]=_0x38e239;return _0x298328;});}})[_0xd2b7('0x29')](respondWithFilteredResult(_0x3f72ba,_0x25d730))[_0xd2b7('0xb4')](handleError(_0x3f72ba,null));};exports[_0xd2b7('0xc7')]=function(_0x3e7778,_0x31d505,_0x3cab9a){return db[_0xd2b7('0x3c')][_0xd2b7('0x67')]({'where':{'id':_0x3e7778[_0xd2b7('0xb6')]['id']}})[_0xd2b7('0x29')](handleEntityNotFound(_0x31d505,null))['then'](function(_0xde75eb){if(_0xde75eb){return _0xde75eb['setTags'](_0x3e7778[_0xd2b7('0x79')]['ids'],_[_0xd2b7('0xc8')](_0x3e7778[_0xd2b7('0x79')],[_0xd2b7('0xbe'),'id'])||{})['spread'](function(){return db[_0xd2b7('0x75')][_0xd2b7('0xc5')]({'attributes':['id',_0xd2b7('0x4f'),_0xd2b7('0x50')],'where':{'id':_0x3e7778[_0xd2b7('0x79')][_0xd2b7('0xbe')]}});})[_0xd2b7('0x29')](function(_0x354660){socket[_0xd2b7('0xc9')](_0xd2b7('0xca'),{'id':Number(_0x3e7778[_0xd2b7('0xb6')]['id']),'tags':_0x354660||[]});return{'id':Number(_0x3e7778[_0xd2b7('0xb6')]['id']),'tags':_0x354660||[]};});}})[_0xd2b7('0x29')](respondWithResult(_0x31d505,null))[_0xd2b7('0xb4')](handleError(_0x31d505,null));};exports[_0xd2b7('0xcb')]=function(_0x39bc2f,_0x196a17,_0x53f0e6){return db[_0xd2b7('0x3c')]['find']({'where':{'id':_0x39bc2f[_0xd2b7('0xb6')]['id']}})['then'](handleEntityNotFound(_0x196a17,null))[_0xd2b7('0x29')](function(_0x3da8a6){if(_0x3da8a6){return _0x3da8a6['removeTags'](_0x39bc2f[_0xd2b7('0x41')][_0xd2b7('0xbe')]);}})[_0xd2b7('0x29')](respondWithStatusCode(_0x196a17,null))[_0xd2b7('0xb4')](handleError(_0x196a17,null));};exports[_0xd2b7('0xcc')]=function(_0x410c3d,_0x325ebf){var _0xaffdc4=moment()[_0xd2b7('0xcd')]()[_0xd2b7('0x9d')]();var _0x4bfed2=path['join'](config[_0xd2b7('0xce')],_0xd2b7('0xcf'),_0xd2b7('0xd0'),_0xd2b7('0xd1'));var _0x5ea0bd=path[_0xd2b7('0xd2')](config[_0xd2b7('0xce')],'server',_0xd2b7('0xd0'),'attachments');var _0x38afab=path['join'](_0x4bfed2,_0xaffdc4);var _0x5e7dd9=util['format']('transcript-%d-%s.zip',_0x410c3d[_0xd2b7('0xb6')]['id'],_0xaffdc4);var _0x25d0b5=path[_0xd2b7('0xd2')](_0x4bfed2,_0x5e7dd9);var _0xe0f97=[];_0xe0f97[_0xd2b7('0x34')]({'model':db[_0xd2b7('0xd3')],'as':_0xd2b7('0xd3'),'attributes':['id','fullname'],'raw':!![]});_0xe0f97[_0xd2b7('0x34')]({'model':db[_0xd2b7('0xd4')],'as':'Contact','attributes':['id','firstName',_0xd2b7('0xd5')],'raw':!![]});if(_0x410c3d[_0xd2b7('0x41')][_0xd2b7('0xd6')]){_0xe0f97[_0xd2b7('0x34')]({'model':db['Attachment'],'as':_0xd2b7('0xd7'),'raw':!![]});}var _0x414eca=[{'model':db[_0xd2b7('0xbd')],'as':_0xd2b7('0xd8'),'attributes':['id',_0xd2b7('0x79'),'createdAt','direction',_0xd2b7('0xd9'),_0xd2b7('0x82')],'include':_0xe0f97}];_0x414eca['push']({'model':db[_0xd2b7('0xda')],'as':_0xd2b7('0xdb'),'attributes':['id',_0xd2b7('0x4f')]});_0x414eca[_0xd2b7('0x34')]({'model':db[_0xd2b7('0xd3')],'as':_0xd2b7('0xdc'),'attributes':['id','fullname']});return db['OpenchannelInteraction']['find']({'where':{'id':_0x410c3d[_0xd2b7('0xb6')]['id']},'include':_0x414eca})[_0xd2b7('0x29')](handleEntityNotFound(_0x325ebf,null))['then'](function(_0x15ec2e){if(_0x15ec2e){var _0x5b5925=_0x15ec2e[_0xd2b7('0xdd')]({'plain':!![]});fs[_0xd2b7('0xde')](_0x38afab);var _0x339e24={'channel':_0xd2b7('0xdf'),'account':_0x5b5925[_0xd2b7('0xdb')][_0xd2b7('0x4f')],'agent':_0x5b5925[_0xd2b7('0xdc')]?_0x5b5925[_0xd2b7('0xdc')][_0xd2b7('0x2f')]:'N.A.','createdAt':moment(_0x5b5925[_0xd2b7('0x7d')])[_0xd2b7('0xc3')](_0xd2b7('0xc4'))[_0xd2b7('0x9d')](),'closedAt':_0x5b5925[_0xd2b7('0x38')]?moment(_0x5b5925[_0xd2b7('0xe0')])[_0xd2b7('0xc3')](_0xd2b7('0xc4'))[_0xd2b7('0x9d')]():'','disposition':_0x5b5925['disposition'],'visibility':_0x5b5925[_0xd2b7('0xe1')]?_0xd2b7('0xe2'):_0xd2b7('0xe3'),'messages':_(_0x5b5925['Messages'])[_0xd2b7('0x86')]({'secret':![]})[_0xd2b7('0x2e')](function(_0xd8d23c){if(_0xd8d23c[_0xd2b7('0xd7')]){var _0x4aab3e=path['join'](_0x5ea0bd,_0xd8d23c[_0xd2b7('0xd7')]['basename']);if(fs[_0xd2b7('0xe4')](_0x4aab3e)){fs[_0xd2b7('0xe5')](_0x4aab3e)[_0xd2b7('0xe6')](fs[_0xd2b7('0xe7')](path[_0xd2b7('0xd2')](_0x38afab,_0xd8d23c[_0xd2b7('0xd7')][_0xd2b7('0xe8')])));}}return{'date':moment(_0xd8d23c[_0xd2b7('0x7d')])[_0xd2b7('0xc3')](_0xd2b7('0xc4'))[_0xd2b7('0x9d')](),'sender':_0xd8d23c[_0xd2b7('0xe9')]===_0xd2b7('0xea')?_0xd8d23c['User']?_0xd8d23c['User'][_0xd2b7('0x2f')]:_0xd2b7('0xeb'):_0xd8d23c[_0xd2b7('0xec')][_0xd2b7('0xed')]+(_0xd8d23c[_0xd2b7('0xec')][_0xd2b7('0xd5')]?'\x20'+_0xd8d23c['Contact'][_0xd2b7('0xd5')]:''),'body':_0xd8d23c['Attachment']?_0xd8d23c[_0xd2b7('0xd7')][_0xd2b7('0xe8')]:_0xd8d23c[_0xd2b7('0x79')],'direction':_0xd8d23c[_0xd2b7('0xe9')]===_0xd2b7('0xea')?'A':'C','secret':_0xd8d23c[_0xd2b7('0xd9')],'read':_0xd8d23c['read'],'attachment':_0xd8d23c[_0xd2b7('0xd7')]};})[_0xd2b7('0x69')]()};return ejs['renderFile'](path['join'](config['root'],_0xd2b7('0xcf'),_0xd2b7('0xee'),_0xd2b7('0xef')),{'interaction':_0x339e24})['then'](function(_0x176963){var _0x5042f5=path[_0xd2b7('0xd2')](_0x38afab,_0xd2b7('0xf0')+_0x5b5925['id']+'-'+_0xaffdc4+_0xd2b7('0xf1'));var _0x1f02e8={'path':_0x5042f5,'channel':_0xd2b7('0xdf'),'interactionId':_0x5b5925['id']};return pdf[_0xd2b7('0xf2')](_0x176963,_0x1f02e8);})['then'](function(){return new BPromise(function(_0x31ffc0,_0x492093){zipdir(_0x38afab,{'saveTo':_0x25d0b5},function(_0x5d3e21,_0x51ee63){if(_0x5d3e21)return _0x492093(_0x5d3e21);return _0x31ffc0(_0x51ee63);});})['then'](function(){return new BPromise(function(_0x1924d4,_0x26084a){rimraf(_0x38afab,function(_0x20383e){if(_0x20383e)_0x26084a(_0x20383e);return _0x1924d4();});});})['then'](function(){return _0x325ebf[_0xd2b7('0xcc')](_0x25d0b5,_0x5e7dd9,function(_0x3c30e6){if(_0x3c30e6){console[_0xd2b7('0xf3')](_0xd2b7('0xf4'),_0x3c30e6);}else{fs[_0xd2b7('0xf5')](_0x25d0b5);}});});});}else{return _0x325ebf[_0xd2b7('0x1e')](0xc8);}})[_0xd2b7('0xb4')](handleError(_0x325ebf,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index ad3efc4..0b12867 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 _0x43a3=['setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x43a3,0x150));var _0x343a=function(_0x39a6a2,_0x588903){_0x39a6a2=_0x39a6a2-0x0;var _0x1fdb09=_0x43a3[_0x39a6a2];return _0x1fdb09;};'use strict';var EventEmitter=require(_0x343a('0x0'));var OpenchannelInteraction=require(_0x343a('0x1'))['db'][_0x343a('0x2')];var OpenchannelMessage=require(_0x343a('0x1'))['db'][_0x343a('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x343a('0x4')](0x0);var events={'afterCreate':_0x343a('0x5'),'afterUpdate':_0x343a('0x6'),'afterDestroy':_0x343a('0x7')};function emitEvent(_0x4bf3eb){return function(_0x2bd7e5,_0x1ce02d,_0x44f063){_0x2bd7e5['getUsers']({'attributes':['id'],'raw':!![]})[_0x343a('0x8')](function(_0x37c4c1){_0x2bd7e5[_0x343a('0x9')](_0x343a('0xa'),_0x37c4c1[_0x343a('0xb')](function(_0x46a6ef){return{'id':_0x46a6ef['id']};}));return OpenchannelMessage[_0x343a('0xc')]({'where':{'OpenchannelInteractionId':_0x2bd7e5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x343a('0x8')](function(_0x43f57c){_0x2bd7e5[_0x343a('0x9')](_0x343a('0xd'),_0x43f57c[_0x343a('0xe')]);OpenchannelInteractionEvents[_0x343a('0xf')](_0x4bf3eb+':'+_0x2bd7e5['id'],_0x2bd7e5);OpenchannelInteractionEvents[_0x343a('0xf')](_0x4bf3eb,_0x2bd7e5);_0x44f063(null);})[_0x343a('0x10')](_0x44f063(null));};}for(var e in events){if(events[_0x343a('0x11')](e)){var event=events[e];OpenchannelInteraction[_0x343a('0x12')](e,emitEvent(event));}}module[_0x343a('0x13')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xbf3b=['setDataValue','Users','findAll','unreadMessages','length','catch','hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then'];(function(_0x538375,_0x365e8d){var _0x1c3531=function(_0x7dc57f){while(--_0x7dc57f){_0x538375['push'](_0x538375['shift']());}};_0x1c3531(++_0x365e8d);}(_0xbf3b,0x129));var _0xbbf3=function(_0x2bcf6f,_0x2ab475){_0x2bcf6f=_0x2bcf6f-0x0;var _0x447655=_0xbf3b[_0x2bcf6f];return _0x447655;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xbbf3('0x0'))['db'][_0xbbf3('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xbbf3('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xbbf3('0x3')](0x0);var events={'afterCreate':_0xbbf3('0x4'),'afterUpdate':_0xbbf3('0x5'),'afterDestroy':_0xbbf3('0x6')};function emitEvent(_0x51a0ed){return function(_0x440ef9,_0x41a466,_0x4948c8){_0x440ef9[_0xbbf3('0x7')]({'attributes':['id'],'raw':!![]})[_0xbbf3('0x8')](function(_0x591940){_0x440ef9[_0xbbf3('0x9')](_0xbbf3('0xa'),_0x591940['map'](function(_0x2071a4){return{'id':_0x2071a4['id']};}));return OpenchannelMessage[_0xbbf3('0xb')]({'where':{'OpenchannelInteractionId':_0x440ef9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbbf3('0x8')](function(_0x4f72d3){_0x440ef9[_0xbbf3('0x9')](_0xbbf3('0xc'),_0x4f72d3[_0xbbf3('0xd')]);OpenchannelInteractionEvents['emit'](_0x51a0ed+':'+_0x440ef9['id'],_0x440ef9);OpenchannelInteractionEvents['emit'](_0x51a0ed,_0x440ef9);_0x4948c8(null);})[_0xbbf3('0xe')](_0x4948c8(null));};}for(var e in events){if(events[_0xbbf3('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xbbf3('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 651a7d8..691068e 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 _0x296e=['bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment'];(function(_0x13a836,_0x23d029){var _0x20d4fa=function(_0x152b32){while(--_0x152b32){_0x13a836['push'](_0x13a836['shift']());}};_0x20d4fa(++_0x23d029);}(_0x296e,0x11d));var _0xe296=function(_0x4e5d27,_0x331b0d){_0x4e5d27=_0x4e5d27-0x0;var _0x4b128e=_0x296e[_0x4e5d27];return _0x4b128e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe296('0x0'))(_0xe296('0x1'));var moment=require(_0xe296('0x2'));var BPromise=require(_0xe296('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe296('0x4'));var rimraf=require(_0xe296('0x5'));var config=require(_0xe296('0x6'));var attributes=require(_0xe296('0x7'));module[_0xe296('0x8')]=function(_0x5994d8,_0x4f18c9){return _0x5994d8[_0xe296('0x9')](_0xe296('0xa'),attributes,{'tableName':_0xe296('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe296('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x91b8ee,_0xcd1962,_0x19e043){if(_0x91b8ee[_0xe296('0xd')](_0xe296('0xe'))){_0x91b8ee[_0xe296('0xf')]=moment()[_0xe296('0x10')](_0xe296('0x11'));}_0x19e043(null,_0x91b8ee);}}});}; \ No newline at end of file +var _0x6441=['moment','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api'];(function(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0x6441,0x96));var _0x1644=function(_0x26f08b,_0x5137b7){_0x26f08b=_0x26f08b-0x0;var _0x151875=_0x6441[_0x26f08b];return _0x151875;};'use strict';var _=require('lodash');var util=require(_0x1644('0x0'));var logger=require(_0x1644('0x1'))(_0x1644('0x2'));var moment=require(_0x1644('0x3'));var BPromise=require('bluebird');var rp=require(_0x1644('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1644('0x5'));var config=require(_0x1644('0x6'));var attributes=require(_0x1644('0x7'));module['exports']=function(_0x28dd39,_0x38c1dd){return _0x28dd39['define'](_0x1644('0x8'),attributes,{'tableName':_0x1644('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1644('0xa'),'collate':_0x1644('0xb'),'hooks':{'beforeUpdate':function(_0x39a698,_0x4658ad,_0x41929d){if(_0x39a698[_0x1644('0xc')](_0x1644('0xd'))){_0x39a698[_0x1644('0xe')]=moment()[_0x1644('0xf')](_0x1644('0x10'));}_0x41929d(null,_0x39a698);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index d938ff3..c7a73f4 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 _0x9279=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x9b0e10,_0x336842){var _0x1b531d=function(_0x498da0){while(--_0x498da0){_0x9b0e10['push'](_0x9b0e10['shift']());}};_0x1b531d(++_0x336842);}(_0x9279,0xf2));var _0x9927=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x9279[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x9927('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9927('0x1'));var fs=require('fs');var Redis=require(_0x9927('0x2'));var db=require(_0x9927('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9927('0x4'))(_0x9927('0x5'));var config=require(_0x9927('0x6'));var jayson=require(_0x9927('0x7'));var client=jayson[_0x9927('0x8')][_0x9927('0x9')]({'port':0x232a});config[_0x9927('0xa')]=_[_0x9927('0xb')](config[_0x9927('0xa')],{'host':_0x9927('0xc'),'port':0x18eb});var socket=require(_0x9927('0xd'))(new Redis(config[_0x9927('0xa')]));require('./openchannelInteraction.socket')[_0x9927('0xe')](socket);function respondWithRpcPromise(_0x2d8134,_0x5cedba,_0x34635e){return new BPromise(function(_0x4b8f58,_0x3c9616){return client[_0x9927('0xf')](_0x2d8134,_0x34635e)[_0x9927('0x10')](function(_0x272f85){logger[_0x9927('0x11')](_0x9927('0x12'),_0x5cedba,_0x9927('0x13'));logger['debug'](_0x9927('0x14'),_0x5cedba,_0x9927('0x13'),JSON[_0x9927('0x15')](_0x272f85));if(_0x272f85['error']){if(_0x272f85[_0x9927('0x16')][_0x9927('0x17')]===0x1f4){logger[_0x9927('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5cedba,_0x272f85['error'][_0x9927('0x18')]);return _0x3c9616(_0x272f85[_0x9927('0x16')][_0x9927('0x18')]);}logger['error'](_0x9927('0x12'),_0x5cedba,_0x272f85[_0x9927('0x16')][_0x9927('0x18')]);return _0x4b8f58(_0x272f85[_0x9927('0x16')]['message']);}else{logger[_0x9927('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5cedba,_0x9927('0x13'));_0x4b8f58(_0x272f85[_0x9927('0x19')][_0x9927('0x18')]);}})['catch'](function(_0x51238b){logger[_0x9927('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5cedba,_0x51238b);_0x3c9616(_0x51238b);});});}exports[_0x9927('0x1a')]=function(_0x4998da){var _0x359dfd=this;return new Promise(function(_0x4ebd5c,_0x3d85ed){return db[_0x9927('0x1b')][_0x9927('0x1c')](_0x4998da[_0x9927('0x1d')],{'raw':_0x4998da[_0x9927('0x1e')]?_0x4998da[_0x9927('0x1e')][_0x9927('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4998da['options']?_0x4998da['options'][_0x9927('0x20')]||null:null,'attributes':_0x4998da['options']?_0x4998da[_0x9927('0x1e')][_0x9927('0x21')]||null:null,'limit':_0x4998da[_0x9927('0x1e')]?_0x4998da['options'][_0x9927('0x22')]||null:null})[_0x9927('0x10')](function(_0x4931a2){logger[_0x9927('0x11')]('UpdateOpenchannelInteraction',_0x4998da);logger['debug'](_0x9927('0x1a'),_0x4998da,JSON['stringify'](_0x4931a2));_0x4ebd5c(_0x4931a2);})['catch'](function(_0x5186fe){logger[_0x9927('0x16')](_0x9927('0x1a'),_0x5186fe[_0x9927('0x18')],_0x4998da);_0x3d85ed(_0x359dfd['error'](0x1f4,_0x5186fe['message']));});});};exports[_0x9927('0x23')]=function(_0x3c7ec6){return new Promise(function(_0x5f0380,_0x3dd263){return db[_0x9927('0x1b')][_0x9927('0x24')]({'where':_0x3c7ec6['options']?_0x3c7ec6[_0x9927('0x1e')]['where']||null:null})[_0x9927('0x10')](function(_0x478888){if(_0x478888){return _0x478888['addTags'](_0x3c7ec6['body'][_0x9927('0x25')],_[_0x9927('0x26')](_0x3c7ec6[_0x9927('0x1d')],[_0x9927('0x25'),'id'])||{});}})[_0x9927('0x27')](function(_0x3d6866){logger[_0x9927('0x11')](_0x9927('0x28'),_0x3c7ec6);logger[_0x9927('0x29')](_0x9927('0x28'),_0x3c7ec6,JSON[_0x9927('0x15')](_0x3d6866));_0x5f0380(_0x3d6866);})['catch'](function(_0xac3dc5){logger[_0x9927('0x16')]('AddTags',_0xac3dc5[_0x9927('0x18')],_0x3c7ec6);_0x3dd263(_this[_0x9927('0x16')](0x1f4,_0xac3dc5[_0x9927('0x18')]));});});}; \ No newline at end of file +var _0x76c3=['request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','info','result','catch','OpenchannelInteraction','update','options','raw','where','limit','UpdateOpenchannelInteraction','stringify','AddTagsToOpenchannelInteraction','find','addTags','body','omit','ids','spread','AddTags','lodash','util','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','register','request','then'];(function(_0x365b7e,_0x349816){var _0x4b02e3=function(_0x3a8ff6){while(--_0x3a8ff6){_0x365b7e['push'](_0x365b7e['shift']());}};_0x4b02e3(++_0x349816);}(_0x76c3,0x12b));var _0x376c=function(_0x1206de,_0x319d1d){_0x1206de=_0x1206de-0x0;var _0x1822f6=_0x76c3[_0x1206de];return _0x1822f6;};'use strict';var _=require(_0x376c('0x0'));var util=require(_0x376c('0x1'));var moment=require('moment');var BPromise=require(_0x376c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x376c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x376c('0x4'))('rpc');var config=require(_0x376c('0x5'));var jayson=require(_0x376c('0x6'));var client=jayson[_0x376c('0x7')][_0x376c('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x376c('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x376c('0x9')]));require('./openchannelInteraction.socket')[_0x376c('0xa')](socket);function respondWithRpcPromise(_0x520814,_0x575a2b,_0xfd4832){return new BPromise(function(_0x1abde8,_0x448d7b){return client[_0x376c('0xb')](_0x520814,_0xfd4832)[_0x376c('0xc')](function(_0x556b27){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x575a2b,_0x376c('0xd'));logger[_0x376c('0xe')](_0x376c('0xf'),_0x575a2b,_0x376c('0xd'),JSON['stringify'](_0x556b27));if(_0x556b27['error']){if(_0x556b27[_0x376c('0x10')][_0x376c('0x11')]===0x1f4){logger[_0x376c('0x10')](_0x376c('0x12'),_0x575a2b,_0x556b27['error'][_0x376c('0x13')]);return _0x448d7b(_0x556b27[_0x376c('0x10')][_0x376c('0x13')]);}logger[_0x376c('0x10')](_0x376c('0x12'),_0x575a2b,_0x556b27[_0x376c('0x10')][_0x376c('0x13')]);return _0x1abde8(_0x556b27[_0x376c('0x10')][_0x376c('0x13')]);}else{logger[_0x376c('0x14')](_0x376c('0x12'),_0x575a2b,_0x376c('0xd'));_0x1abde8(_0x556b27[_0x376c('0x15')][_0x376c('0x13')]);}})[_0x376c('0x16')](function(_0x5e779e){logger[_0x376c('0x10')](_0x376c('0x12'),_0x575a2b,_0x5e779e);_0x448d7b(_0x5e779e);});});}exports['UpdateOpenchannelInteraction']=function(_0x54c4d7){var _0x42ccd7=this;return new Promise(function(_0x39e5dd,_0x5554b7){return db[_0x376c('0x17')][_0x376c('0x18')](_0x54c4d7['body'],{'raw':_0x54c4d7[_0x376c('0x19')]?_0x54c4d7[_0x376c('0x19')][_0x376c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54c4d7[_0x376c('0x19')]?_0x54c4d7['options'][_0x376c('0x1b')]||null:null,'attributes':_0x54c4d7['options']?_0x54c4d7[_0x376c('0x19')]['attributes']||null:null,'limit':_0x54c4d7[_0x376c('0x19')]?_0x54c4d7['options'][_0x376c('0x1c')]||null:null})[_0x376c('0xc')](function(_0x1a1bee){logger[_0x376c('0x14')](_0x376c('0x1d'),_0x54c4d7);logger[_0x376c('0xe')](_0x376c('0x1d'),_0x54c4d7,JSON[_0x376c('0x1e')](_0x1a1bee));_0x39e5dd(_0x1a1bee);})[_0x376c('0x16')](function(_0x28ea80){logger['error'](_0x376c('0x1d'),_0x28ea80[_0x376c('0x13')],_0x54c4d7);_0x5554b7(_0x42ccd7['error'](0x1f4,_0x28ea80[_0x376c('0x13')]));});});};exports[_0x376c('0x1f')]=function(_0x1fa8de){return new Promise(function(_0x56811c,_0x4da19a){return db[_0x376c('0x17')][_0x376c('0x20')]({'where':_0x1fa8de['options']?_0x1fa8de[_0x376c('0x19')][_0x376c('0x1b')]||null:null})[_0x376c('0xc')](function(_0x3fe9c7){if(_0x3fe9c7){return _0x3fe9c7[_0x376c('0x21')](_0x1fa8de[_0x376c('0x22')]['ids'],_[_0x376c('0x23')](_0x1fa8de[_0x376c('0x22')],[_0x376c('0x24'),'id'])||{});}})[_0x376c('0x25')](function(_0x418ea9){logger[_0x376c('0x14')](_0x376c('0x26'),_0x1fa8de);logger[_0x376c('0xe')](_0x376c('0x26'),_0x1fa8de,JSON[_0x376c('0x1e')](_0x418ea9));_0x56811c(_0x418ea9);})[_0x376c('0x16')](function(_0x2942bd){logger[_0x376c('0x10')](_0x376c('0x26'),_0x2942bd[_0x376c('0x13')],_0x1fa8de);_0x4da19a(_this[_0x376c('0x10')](0x1f4,_0x2942bd[_0x376c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 5053e94..0eaa3a2 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 _0x1138=['./openchannelInteraction.events','save','remove','removeListener','register','length','openchannelInteraction:'];(function(_0x5d6888,_0x536275){var _0x41cd6a=function(_0x4b98d6){while(--_0x4b98d6){_0x5d6888['push'](_0x5d6888['shift']());}};_0x41cd6a(++_0x536275);}(_0x1138,0x16c));var _0x8113=function(_0x455b4b,_0x253f52){_0x455b4b=_0x455b4b-0x0;var _0x299f6d=_0x1138[_0x455b4b];return _0x299f6d;};'use strict';var OpenchannelInteractionEvents=require(_0x8113('0x0'));var events=[_0x8113('0x1'),_0x8113('0x2'),'update'];function createListener(_0x472d1b,_0x887384){return function(_0x25812b){_0x887384['emit'](_0x472d1b,_0x25812b);};}function removeListener(_0x1a583b,_0x44e52e){return function(){OpenchannelInteractionEvents[_0x8113('0x3')](_0x1a583b,_0x44e52e);};}exports[_0x8113('0x4')]=function(_0x56d23f){for(var _0x57bfae=0x0,_0x536161=events[_0x8113('0x5')];_0x57bfae<_0x536161;_0x57bfae++){var _0x3286b8=events[_0x57bfae];var _0x17bf86=createListener(_0x8113('0x6')+_0x3286b8,_0x56d23f);OpenchannelInteractionEvents['on'](_0x3286b8,_0x17bf86);}}; \ No newline at end of file +var _0xc577=['removeListener','register','length','save','remove','update','emit'];(function(_0x241526,_0x556811){var _0x1bb362=function(_0x3db32a){while(--_0x3db32a){_0x241526['push'](_0x241526['shift']());}};_0x1bb362(++_0x556811);}(_0xc577,0x1d8));var _0x7c57=function(_0x53d17e,_0xf979c9){_0x53d17e=_0x53d17e-0x0;var _0x35b0cc=_0xc577[_0x53d17e];return _0x35b0cc;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x7c57('0x0'),_0x7c57('0x1'),_0x7c57('0x2')];function createListener(_0xeb47e2,_0x3bf03e){return function(_0x125786){_0x3bf03e[_0x7c57('0x3')](_0xeb47e2,_0x125786);};}function removeListener(_0x3df427,_0x32a914){return function(){OpenchannelInteractionEvents[_0x7c57('0x4')](_0x3df427,_0x32a914);};}exports[_0x7c57('0x5')]=function(_0x1920ee){for(var _0x3034c6=0x0,_0x681f7c=events[_0x7c57('0x6')];_0x3034c6<_0x681f7c;_0x3034c6++){var _0x4902ad=events[_0x3034c6];var _0x1008ca=createListener('openchannelInteraction:'+_0x4902ad,_0x1920ee);OpenchannelInteractionEvents['on'](_0x4902ad,_0x1008ca);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index fc6b155..043c705 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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x22700b,_0x32764f){var _0x58ee05=function(_0x5baa85){while(--_0x5baa85){_0x22700b['push'](_0x22700b['shift']());}};_0x58ee05(++_0x32764f);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x4dc87b,_0x684680){var _0x3403af=function(_0x11a262){while(--_0x11a262){_0x4dc87b['push'](_0x4dc87b['shift']());}};_0x3403af(++_0x684680);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index af2ea77..55845bb 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 _0x8383=['sequelize','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x4344a2,_0x4798ee){var _0x3dc2cb=function(_0x1a127d){while(--_0x1a127d){_0x4344a2['push'](_0x4344a2['shift']());}};_0x3dc2cb(++_0x4798ee);}(_0x8383,0x98));var _0x3838=function(_0x432503,_0x501c9c){_0x432503=_0x432503-0x0;var _0x2f5c48=_0x8383[_0x432503];return _0x2f5c48;};'use strict';var Sequelize=require(_0x3838('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x3838('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3838('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3838('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3838('0x3')]('in',_0x3838('0x4')),'defaultValue':_0x3838('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3838('0x5')]},'providerName':{'type':Sequelize[_0x3838('0x6')]},'providerResponse':{'type':Sequelize[_0x3838('0x7')]}}; \ No newline at end of file +var _0x06ef=['out','DATE','TEXT'];(function(_0x32a74e,_0x5b3443){var _0x1aad7d=function(_0x3c29bc){while(--_0x3c29bc){_0x32a74e['push'](_0x32a74e['shift']());}};_0x1aad7d(++_0x5b3443);}(_0x06ef,0x185));var _0xf06e=function(_0x5d6098,_0x604466){_0x5d6098=_0x5d6098-0x0;var _0xe2b365=_0x06ef[_0x5d6098];return _0xe2b365;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xf06e('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf06e('0x1')),'defaultValue':_0xf06e('0x1'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf06e('0x2')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xf06e('0x0')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 3e3f107..48dfacd 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 _0x15c1=['body','params','destroy','describe','openchannel-interactions','accept','read','readAt','format','UserId','user','agent','get','OpenchannelInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','openchannel','OpenchannelInteractionId','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','ContactId','sequelize','SELECT','motionChannel','event','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','merge','type','VIRTUAL','filter','where','includeAll','findAll','rows','show','keys','length','include','find'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x15c1,0x1b8));var _0x115c=function(_0x397127,_0x31429d){_0x397127=_0x397127-0x0;var _0x1d5516=_0x15c1[_0x397127];return _0x1d5516;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x115c('0x0'));var jsonpatch=require(_0x115c('0x1'));var rp=require(_0x115c('0x2'));var moment=require(_0x115c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x115c('0x4'));var sox=require(_0x115c('0x5'));var csv=require('to-csv');var ejs=require(_0x115c('0x6'));var fs=require('fs');var fs_extra=require(_0x115c('0x7'));var _=require(_0x115c('0x8'));var squel=require(_0x115c('0x9'));var crypto=require(_0x115c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x115c('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x115c('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x115c('0xd'));var as=require(_0x115c('0xe'));var hardwareService=require(_0x115c('0xf'));var logger=require(_0x115c('0x10'))(_0x115c('0x11'));var utils=require(_0x115c('0x12'));var config=require(_0x115c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x115c('0x14'))['db'];config['redis']=_[_0x115c('0x15')](config[_0x115c('0x16')],{'host':_0x115c('0x17'),'port':0x18eb});var socket=require(_0x115c('0x18'))(new Redis(config[_0x115c('0x16')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x115c('0x19')][_0x115c('0x1a')]({'port':0x232c});var client9002=jayson[_0x115c('0x19')][_0x115c('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4d255b,_0x5d515c,_0x74d46c,_0xd18183){return new BPromise(function(_0x16e04f,_0x28174d){var _0x146297=_0xd18183||client;return _0x146297[_0x115c('0x1b')](_0x4d255b,_0x74d46c)[_0x115c('0x1c')](function(_0x1ec5de){logger[_0x115c('0x1d')](_0x115c('0x1e'),_0x5d515c,_0x115c('0x1f'));logger[_0x115c('0x20')](_0x115c('0x21'),_0x5d515c,_0x115c('0x1f'),JSON['stringify'](_0x1ec5de));if(_0x1ec5de[_0x115c('0x22')]){if(_0x1ec5de[_0x115c('0x22')][_0x115c('0x23')]===0x1f4){logger[_0x115c('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x5d515c,_0x1ec5de[_0x115c('0x22')][_0x115c('0x24')]);return _0x28174d(_0x1ec5de['error'][_0x115c('0x24')]);}logger[_0x115c('0x22')](_0x115c('0x1e'),_0x5d515c,_0x1ec5de[_0x115c('0x22')][_0x115c('0x24')]);return _0x16e04f(_0x1ec5de[_0x115c('0x22')][_0x115c('0x24')]);}else{logger['info'](_0x115c('0x1e'),_0x5d515c,_0x115c('0x1f'));_0x16e04f(_0x1ec5de[_0x115c('0x25')][_0x115c('0x24')]);}})[_0x115c('0x26')](function(_0x55cf15){logger['error'](_0x115c('0x1e'),_0x5d515c,_0x55cf15);_0x28174d(_0x55cf15);});});}function respondWithStatusCode(_0x53235e,_0x29e6ae){_0x29e6ae=_0x29e6ae||0xcc;return function(_0xf71a08){if(_0xf71a08){return _0x53235e[_0x115c('0x27')](_0x29e6ae);}return _0x53235e[_0x115c('0x28')](_0x29e6ae)[_0x115c('0x29')]();};}function respondWithResult(_0x38cb69,_0x5b8865){_0x5b8865=_0x5b8865||0xc8;return function(_0x272593){if(_0x272593){return _0x38cb69[_0x115c('0x28')](_0x5b8865)[_0x115c('0x2a')](_0x272593);}};}function respondWithFilteredResult(_0x2daa2d,_0xf079e2){return function(_0x4c5f70){if(_0x4c5f70){var _0x1d6a71=typeof _0xf079e2[_0x115c('0x2b')]===_0x115c('0x2c')&&typeof _0xf079e2[_0x115c('0x2d')]===_0x115c('0x2c');var _0xe8df55=_0x4c5f70['count'];var _0x40aa41=_0x1d6a71?0x0:_0xf079e2['offset'];var _0x11ae07=_0x1d6a71?_0x4c5f70[_0x115c('0x2e')]:_0xf079e2[_0x115c('0x2b')]+_0xf079e2[_0x115c('0x2d')];var _0x364620;if(_0x11ae07>=_0xe8df55){_0x11ae07=_0xe8df55;_0x364620=0xc8;}else{_0x364620=0xce;}_0x2daa2d['status'](_0x364620);return _0x2daa2d[_0x115c('0x2f')]('Content-Range',_0x40aa41+'-'+_0x11ae07+'/'+_0xe8df55)['json'](_0x4c5f70);}return null;};}function patchUpdates(_0x215636){return function(_0xaabc4f){try{jsonpatch[_0x115c('0x30')](_0xaabc4f,_0x215636,!![]);}catch(_0x1ea24d){return BPromise[_0x115c('0x31')](_0x1ea24d);}return _0xaabc4f[_0x115c('0x32')]();};}function saveUpdates(_0x161954,_0x213c5f){return function(_0xa13166){if(_0xa13166){return _0xa13166[_0x115c('0x33')](_0x161954)[_0x115c('0x1c')](function(_0x5f3b31){return _0x5f3b31;});}return null;};}function removeEntity(_0x33fd34,_0x4851e8){return function(_0x25313d){if(_0x25313d){return _0x25313d['destroy']()['then'](function(){_0x33fd34['status'](0xcc)[_0x115c('0x29')]();});}};}function handleEntityNotFound(_0x5ed2b0,_0x4887ae){return function(_0x4f2e50){if(!_0x4f2e50){_0x5ed2b0[_0x115c('0x27')](0x194);}return _0x4f2e50;};}function handleError(_0x51b9cc,_0x11423b){_0x11423b=_0x11423b||0x1f4;return function(_0x4d3da2){logger[_0x115c('0x22')](_0x4d3da2[_0x115c('0x34')]);if(_0x4d3da2[_0x115c('0x35')]){delete _0x4d3da2[_0x115c('0x35')];}_0x51b9cc[_0x115c('0x28')](_0x11423b)[_0x115c('0x36')](_0x4d3da2);};}exports[_0x115c('0x37')]=function(_0xf32caf,_0x52633a){var _0x15243e={},_0x58b781={},_0x3b4c79={'count':0x0,'rows':[]};var _0x34f042=_[_0x115c('0x38')](db[_0x115c('0x39')][_0x115c('0x3a')],function(_0x3420de){return{'name':_0x3420de[_0x115c('0x3b')],'type':_0x3420de['type'][_0x115c('0x3c')]};});_0x58b781[_0x115c('0x3d')]=_[_0x115c('0x38')](_0x34f042,_0x115c('0x35'));_0x58b781['query']=_['keys'](_0xf32caf[_0x115c('0x3e')]);_0x58b781[_0x115c('0x3f')]=_['intersection'](_0x58b781['model'],_0x58b781['query']);_0x15243e[_0x115c('0x40')]=_[_0x115c('0x41')](_0x58b781[_0x115c('0x3d')],qs[_0x115c('0x42')](_0xf32caf[_0x115c('0x3e')]['fields']));_0x15243e['attributes']=_0x15243e['attributes']['length']?_0x15243e[_0x115c('0x40')]:_0x58b781[_0x115c('0x3d')];if(!_0xf32caf[_0x115c('0x3e')][_0x115c('0x43')](_0x115c('0x44'))){_0x15243e[_0x115c('0x2d')]=qs[_0x115c('0x2d')](_0xf32caf[_0x115c('0x3e')]['limit']);_0x15243e[_0x115c('0x2b')]=qs[_0x115c('0x2b')](_0xf32caf[_0x115c('0x3e')][_0x115c('0x2b')]);}_0x15243e[_0x115c('0x45')]=qs['sort'](_0xf32caf[_0x115c('0x3e')][_0x115c('0x46')]);_0x15243e['where']=qs['filters'](_['pick'](_0xf32caf[_0x115c('0x3e')],_0x58b781[_0x115c('0x3f')]),_0x34f042);if(_0xf32caf[_0x115c('0x3e')]['filter']){_0x15243e['where']=_[_0x115c('0x47')](_0x15243e['where'],{'$or':_[_0x115c('0x38')](_0x34f042,function(_0x3c608e){if(_0x3c608e[_0x115c('0x48')]!==_0x115c('0x49')){var _0x40f22d={};_0x40f22d[_0x3c608e[_0x115c('0x35')]]={'$like':'%'+_0xf32caf[_0x115c('0x3e')][_0x115c('0x4a')]+'%'};return _0x40f22d;}})});}_0x15243e=_[_0x115c('0x47')]({},_0x15243e,_0xf32caf['options']);var _0x32bf20={'where':_0x15243e[_0x115c('0x4b')]};return db[_0x115c('0x39')]['count'](_0x32bf20)[_0x115c('0x1c')](function(_0x30f244){_0x3b4c79[_0x115c('0x2e')]=_0x30f244;if(_0xf32caf[_0x115c('0x3e')][_0x115c('0x4c')]){_0x15243e['include']=[{'all':!![]}];}return db[_0x115c('0x39')][_0x115c('0x4d')](_0x15243e);})[_0x115c('0x1c')](function(_0x51f469){_0x3b4c79[_0x115c('0x4e')]=_0x51f469;return _0x3b4c79;})[_0x115c('0x1c')](respondWithFilteredResult(_0x52633a,_0x15243e))[_0x115c('0x26')](handleError(_0x52633a,null));};exports[_0x115c('0x4f')]=function(_0x47ab46,_0x110556){var _0x479201={'raw':!![],'where':{'id':_0x47ab46['params']['id']}},_0x1d5076={};_0x1d5076[_0x115c('0x3d')]=_[_0x115c('0x50')](db[_0x115c('0x39')]['rawAttributes']);_0x1d5076[_0x115c('0x3e')]=_[_0x115c('0x50')](_0x47ab46[_0x115c('0x3e')]);_0x1d5076[_0x115c('0x3f')]=_[_0x115c('0x41')](_0x1d5076[_0x115c('0x3d')],_0x1d5076[_0x115c('0x3e')]);_0x479201[_0x115c('0x40')]=_['intersection'](_0x1d5076[_0x115c('0x3d')],qs[_0x115c('0x42')](_0x47ab46['query'][_0x115c('0x42')]));_0x479201['attributes']=_0x479201[_0x115c('0x40')][_0x115c('0x51')]?_0x479201[_0x115c('0x40')]:_0x1d5076[_0x115c('0x3d')];if(_0x47ab46[_0x115c('0x3e')][_0x115c('0x4c')]){_0x479201[_0x115c('0x52')]=[{'all':!![]}];}_0x479201=_[_0x115c('0x47')]({},_0x479201,_0x47ab46['options']);return db['OpenchannelMessage'][_0x115c('0x53')](_0x479201)[_0x115c('0x1c')](handleEntityNotFound(_0x110556,null))[_0x115c('0x1c')](respondWithResult(_0x110556,null))[_0x115c('0x26')](handleError(_0x110556,null));};exports['create']=function(_0x2b3a14,_0xb83d4d){return db['OpenchannelMessage']['create'](_0x2b3a14['body'],{})[_0x115c('0x1c')](respondWithResult(_0xb83d4d,0xc9))[_0x115c('0x26')](handleError(_0xb83d4d,null));};exports[_0x115c('0x33')]=function(_0x51106b,_0x9e29be){if(_0x51106b[_0x115c('0x54')]['id']){delete _0x51106b[_0x115c('0x54')]['id'];}return db[_0x115c('0x39')][_0x115c('0x53')]({'where':{'id':_0x51106b[_0x115c('0x55')]['id']}})['then'](handleEntityNotFound(_0x9e29be,null))[_0x115c('0x1c')](saveUpdates(_0x51106b[_0x115c('0x54')],null))[_0x115c('0x1c')](respondWithResult(_0x9e29be,null))['catch'](handleError(_0x9e29be,null));};exports[_0x115c('0x56')]=function(_0x217416,_0x4da81f){return db[_0x115c('0x39')][_0x115c('0x53')]({'where':{'id':_0x217416[_0x115c('0x55')]['id']}})[_0x115c('0x1c')](handleEntityNotFound(_0x4da81f,null))['then'](removeEntity(_0x4da81f,null))['catch'](handleError(_0x4da81f,null));};exports[_0x115c('0x57')]=function(_0x169f90,_0x29b7db){return db['OpenchannelMessage'][_0x115c('0x57')]()[_0x115c('0x1c')](respondWithResult(_0x29b7db,null))[_0x115c('0x26')](handleError(_0x29b7db,null));};var interaction_log=require(_0x115c('0x10'))(_0x115c('0x58'));exports[_0x115c('0x59')]=function(_0x372a2d,_0x5c295c,_0x338b98){var _0x1bde9a={'agent':{},'channel':'openchannel'};if(_0x372a2d[_0x115c('0x54')]['id']){delete _0x372a2d[_0x115c('0x54')]['id'];}_0x372a2d[_0x115c('0x54')][_0x115c('0x5a')]=!![];_0x372a2d[_0x115c('0x54')][_0x115c('0x5b')]=moment()[_0x115c('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x372a2d[_0x115c('0x54')][_0x115c('0x5d')]=_0x372a2d[_0x115c('0x54')]['UserId']||_0x372a2d[_0x115c('0x5e')]['id'];_0x1bde9a[_0x115c('0x5f')]['id']=_0x372a2d['body']['UserId'];return db[_0x115c('0x39')][_0x115c('0x53')]({'where':{'id':_0x372a2d[_0x115c('0x55')]['id'],'UserId':null}})[_0x115c('0x1c')](handleEntityNotFound(_0x5c295c,null))[_0x115c('0x1c')](saveUpdates(_0x372a2d[_0x115c('0x54')],null))['then'](function(_0x4f1fa3){if(_0x4f1fa3){_0x1bde9a['message']=_0x4f1fa3[_0x115c('0x60')]({'plain':!![]});return db[_0x115c('0x61')][_0x115c('0x53')]({'where':{'id':_0x4f1fa3['OpenchannelInteractionId']}});}return null;})[_0x115c('0x1c')](handleEntityNotFound(_0x5c295c,null))[_0x115c('0x1c')](function(_0x52d128){if(_0x52d128){return _0x52d128['update']({'UserId':_0x372a2d[_0x115c('0x54')]['UserId'],'read1stAt':_[_0x115c('0x62')](_0x52d128['read1stAt'])?moment()['format'](_0x115c('0x63')):undefined});}return null;})[_0x115c('0x1c')](function(_0x405b7a){if(_0x405b7a){_0x1bde9a['interaction']=_0x405b7a[_0x115c('0x60')]({'plain':!![]});interaction_log[_0x115c('0x1d')](_0x115c('0x64'),_0x372a2d[_0x115c('0x5e')]['id'],_0x372a2d[_0x115c('0x5e')][_0x115c('0x35')],_0x372a2d[_0x115c('0x5e')]['role'],_0x1bde9a['interaction']['id'],_0x372a2d[_0x115c('0x54')]?JSON['stringify'](_0x372a2d[_0x115c('0x54')]):_0x115c('0x65'));return respondWithRpcPromise(_0x115c('0x66'),_0x115c('0x67'),_0x1bde9a);}return null;})[_0x115c('0x1c')](function(_0x58ef5d){var _0xfe393b=_0x115c('0x68')+_0x58ef5d[_0x115c('0x24')]['ContactId'];return db['sequelize'][_0x115c('0x3e')](_0xfe393b,{'type':db[_0x115c('0x69')][_0x115c('0x6a')]['SELECT'],'raw':!![]})[_0x115c('0x1c')](function(_0x2e22ee){return _0x2e22ee;});})['then'](function(_0x5d6a6c){if(_0x5d6a6c){_0x1bde9a[_0x115c('0x24')][_0x115c('0x6b')]=_0x5d6a6c[0x0];if(!_0x372a2d[_0x115c('0x54')][_0x115c('0x5d')])return;return db[_0x115c('0x6c')][_0x115c('0x53')]({'where':{'id':_0x372a2d['body'][_0x115c('0x5d')],'role':_0x115c('0x5f')},'attributes':['id',_0x115c('0x35'),_0x115c('0x6d'),_0x115c('0x6e'),_0x115c('0x6f')],'raw':!![]});}return null;})[_0x115c('0x1c')](function(_0x4c77d){if(!_0x4c77d)return null;_0x1bde9a[_0x115c('0x24')][_0x115c('0x5f')]=_0x4c77d;return _0x1bde9a;})[_0x115c('0x1c')](function(_0x4a644c){if(_0x4a644c){if(_0x372a2d[_0x115c('0x54')][_0x115c('0x70')]){_0x1bde9a[_0x115c('0x24')][_0x115c('0x71')]=util[_0x115c('0x5c')](_0x115c('0x72'),_0x372a2d['user'][_0x115c('0x35')]);_0x1bde9a[_0x115c('0x24')][_0x115c('0x73')]=_0x1bde9a['channel'];_0x1bde9a[_0x115c('0x24')]['motionChannel']=_0x1bde9a[_0x115c('0x73')];_0x1bde9a[_0x115c('0x24')]['event']=_0x115c('0x59');return respondWithRpcPromise(_0x115c('0x74'),_0x115c('0x74'),{'event':_0x115c('0x75'),'message':_0x1bde9a[_0x115c('0x24')]},client9002)[_0x115c('0x1c')](function(){return _0x1bde9a;});}return _0x1bde9a;}return null;})[_0x115c('0x1c')](respondWithResult(_0x5c295c,null))[_0x115c('0x26')](handleError(_0x5c295c,null));};var interaction_log=require(_0x115c('0x10'))('openchannel-interactions');exports[_0x115c('0x31')]=function(_0x1df266,_0x20713f,_0x13eb08){var _0x378ec8={'agent':{},'channel':_0x115c('0x76')};if(_0x1df266[_0x115c('0x54')]['id']){delete _0x1df266[_0x115c('0x54')]['id'];}_0x1df266['body']['UserId']=_0x1df266[_0x115c('0x54')][_0x115c('0x5d')]||_0x1df266[_0x115c('0x5e')]['id'];_0x378ec8[_0x115c('0x5f')]['id']=_0x1df266[_0x115c('0x54')][_0x115c('0x5d')];return db['OpenchannelMessage'][_0x115c('0x53')]({'where':{'id':_0x1df266[_0x115c('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x20713f,null))[_0x115c('0x1c')](function(_0x17aa0c){if(_0x17aa0c){_0x378ec8[_0x115c('0x24')]=_0x17aa0c[_0x115c('0x60')]({'plain':!![]});return db['OpenchannelInteraction'][_0x115c('0x53')]({'where':{'id':_0x17aa0c[_0x115c('0x77')]}});}return null;})[_0x115c('0x1c')](handleEntityNotFound(_0x20713f,null))[_0x115c('0x1c')](function(_0x3a28c9){if(_0x3a28c9){_0x378ec8[_0x115c('0x78')]=_0x3a28c9['get']({'plain':!![]});interaction_log['info'](_0x115c('0x79'),_0x1df266['user']['id'],_0x1df266[_0x115c('0x5e')][_0x115c('0x35')],_0x1df266['user'][_0x115c('0x7a')],_0x378ec8[_0x115c('0x78')]['id'],_0x1df266[_0x115c('0x54')]?JSON[_0x115c('0x7b')](_0x1df266[_0x115c('0x54')]):_0x115c('0x65'));return respondWithRpcPromise(_0x115c('0x7c'),'rejectMessage',_0x378ec8);}return null;})[_0x115c('0x1c')](function(_0xab394f){var _0xbc7991='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xab394f[_0x115c('0x24')][_0x115c('0x7d')];return db[_0x115c('0x7e')]['query'](_0xbc7991,{'type':db['Sequelize'][_0x115c('0x6a')][_0x115c('0x7f')],'raw':!![]})[_0x115c('0x1c')](function(_0x25fb93){return _0x25fb93;});})['then'](function(_0x374e14){if(_0x374e14){_0x378ec8[_0x115c('0x24')][_0x115c('0x6b')]=_0x374e14[0x0];if(!_0x1df266[_0x115c('0x54')][_0x115c('0x5d')])return;return db[_0x115c('0x6c')][_0x115c('0x53')]({'where':{'id':_0x1df266[_0x115c('0x54')]['UserId'],'role':_0x115c('0x5f')},'attributes':['id',_0x115c('0x35'),_0x115c('0x6d'),'email',_0x115c('0x6f')],'raw':!![]});}return null;})[_0x115c('0x1c')](function(_0x53c0b3){if(!_0x53c0b3)return null;_0x378ec8[_0x115c('0x24')]['agent']=_0x53c0b3;return _0x378ec8;})[_0x115c('0x1c')](function(_0x4ce265){if(_0x4ce265){_0x4ce265[_0x115c('0x24')]['interface']=util['format'](_0x115c('0x72'),_0x1df266['user'][_0x115c('0x35')]);_0x4ce265['message'][_0x115c('0x73')]=_0x378ec8['channel'];_0x4ce265[_0x115c('0x24')][_0x115c('0x80')]=_0x378ec8[_0x115c('0x73')];_0x4ce265[_0x115c('0x24')][_0x115c('0x81')]=_0x115c('0x31');respondWithRpcPromise(_0x115c('0x74'),_0x115c('0x74'),{'event':_0x115c('0x82'),'message':_0x4ce265[_0x115c('0x24')]},client9002);return _0x378ec8;}return null;})[_0x115c('0x1c')](respondWithResult(_0x20713f,null))[_0x115c('0x26')](handleError(_0x20713f,null));}; \ No newline at end of file +var _0x39e7=['stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','OpenchannelMessage','findAll','rows','show','params','length','find','catch','create','body','describe','openchannel-interactions','accept','read','readAt','format','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','user','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','internal','manual','SIP/%s','channel','event','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','email','interface','motionChannel','EventManager','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./openchannelMessage.socket','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','save','update','destroy'];(function(_0x5a1cc9,_0x28f54d){var _0x471761=function(_0xda51c0){while(--_0xda51c0){_0x5a1cc9['push'](_0x5a1cc9['shift']());}};_0x471761(++_0x28f54d);}(_0x39e7,0x1d4));var _0x739e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x39e7[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x739e('0x0'));var rimraf=require(_0x739e('0x1'));var zipdir=require(_0x739e('0x2'));var jsonpatch=require(_0x739e('0x3'));var rp=require(_0x739e('0x4'));var moment=require(_0x739e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x739e('0x6'));var util=require(_0x739e('0x7'));var path=require(_0x739e('0x8'));var sox=require(_0x739e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x739e('0xa'));var squel=require(_0x739e('0xb'));var crypto=require(_0x739e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x739e('0xd'));var Papa=require(_0x739e('0xe'));var Redis=require(_0x739e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x739e('0x10'));var as=require(_0x739e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x739e('0x12'))(_0x739e('0x13'));var utils=require(_0x739e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x739e('0x15'));var db=require(_0x739e('0x16'))['db'];config[_0x739e('0x17')]=_[_0x739e('0x18')](config[_0x739e('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x739e('0x17')]));require(_0x739e('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x739e('0x1a')][_0x739e('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa7690e,_0x119ae1,_0x132ec0,_0x3c70a0){return new BPromise(function(_0x1d8def,_0x4b2189){var _0x4516a3=_0x3c70a0||client;return _0x4516a3[_0x739e('0x1c')](_0xa7690e,_0x132ec0)[_0x739e('0x1d')](function(_0x40f774){logger[_0x739e('0x1e')](_0x739e('0x1f'),_0x119ae1,_0x739e('0x20'));logger[_0x739e('0x21')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x119ae1,_0x739e('0x20'),JSON[_0x739e('0x22')](_0x40f774));if(_0x40f774[_0x739e('0x23')]){if(_0x40f774[_0x739e('0x23')][_0x739e('0x24')]===0x1f4){logger[_0x739e('0x23')](_0x739e('0x1f'),_0x119ae1,_0x40f774[_0x739e('0x23')][_0x739e('0x25')]);return _0x4b2189(_0x40f774[_0x739e('0x23')]['message']);}logger[_0x739e('0x23')](_0x739e('0x1f'),_0x119ae1,_0x40f774[_0x739e('0x23')]['message']);return _0x1d8def(_0x40f774['error'][_0x739e('0x25')]);}else{logger['info'](_0x739e('0x1f'),_0x119ae1,_0x739e('0x20'));_0x1d8def(_0x40f774[_0x739e('0x26')][_0x739e('0x25')]);}})['catch'](function(_0x25c339){logger['error'](_0x739e('0x1f'),_0x119ae1,_0x25c339);_0x4b2189(_0x25c339);});});}function respondWithStatusCode(_0x4c383b,_0xb8e546){_0xb8e546=_0xb8e546||0xcc;return function(_0x8910b){if(_0x8910b){return _0x4c383b[_0x739e('0x27')](_0xb8e546);}return _0x4c383b[_0x739e('0x28')](_0xb8e546)[_0x739e('0x29')]();};}function respondWithResult(_0x131f9a,_0x3c543e){_0x3c543e=_0x3c543e||0xc8;return function(_0x4b2ba4){if(_0x4b2ba4){return _0x131f9a[_0x739e('0x28')](_0x3c543e)['json'](_0x4b2ba4);}};}function respondWithFilteredResult(_0x4fc251,_0x228333){return function(_0x12d990){if(_0x12d990){var _0x162c46=typeof _0x228333['offset']===_0x739e('0x2a')&&typeof _0x228333[_0x739e('0x2b')]===_0x739e('0x2a');var _0x3d60d9=_0x12d990['count'];var _0x45a304=_0x162c46?0x0:_0x228333[_0x739e('0x2c')];var _0x3e7135=_0x162c46?_0x12d990[_0x739e('0x2d')]:_0x228333['offset']+_0x228333[_0x739e('0x2b')];var _0x1724f1;if(_0x3e7135>=_0x3d60d9){_0x3e7135=_0x3d60d9;_0x1724f1=0xc8;}else{_0x1724f1=0xce;}_0x4fc251[_0x739e('0x28')](_0x1724f1);return _0x4fc251[_0x739e('0x2e')](_0x739e('0x2f'),_0x45a304+'-'+_0x3e7135+'/'+_0x3d60d9)[_0x739e('0x30')](_0x12d990);}return null;};}function patchUpdates(_0x498dab){return function(_0x214bf5){try{jsonpatch['apply'](_0x214bf5,_0x498dab,!![]);}catch(_0x3e7aac){return BPromise['reject'](_0x3e7aac);}return _0x214bf5[_0x739e('0x31')]();};}function saveUpdates(_0x4ccd47,_0x12c7cb){return function(_0x9a959f){if(_0x9a959f){return _0x9a959f[_0x739e('0x32')](_0x4ccd47)[_0x739e('0x1d')](function(_0x295933){return _0x295933;});}return null;};}function removeEntity(_0x2b6058,_0x5eeee3){return function(_0x571d78){if(_0x571d78){return _0x571d78[_0x739e('0x33')]()[_0x739e('0x1d')](function(){_0x2b6058[_0x739e('0x28')](0xcc)[_0x739e('0x29')]();});}};}function handleEntityNotFound(_0x3b086f,_0x2a91fe){return function(_0x436f44){if(!_0x436f44){_0x3b086f[_0x739e('0x27')](0x194);}return _0x436f44;};}function handleError(_0x347543,_0x1d37ea){_0x1d37ea=_0x1d37ea||0x1f4;return function(_0x5273f4){logger[_0x739e('0x23')](_0x5273f4[_0x739e('0x34')]);if(_0x5273f4[_0x739e('0x35')]){delete _0x5273f4[_0x739e('0x35')];}_0x347543[_0x739e('0x28')](_0x1d37ea)[_0x739e('0x36')](_0x5273f4);};}exports[_0x739e('0x37')]=function(_0xa318b3,_0x3f2cf6){var _0x300183={},_0x58af70={},_0x7d454b={'count':0x0,'rows':[]};var _0x3bcec2=_[_0x739e('0x38')](db['OpenchannelMessage'][_0x739e('0x39')],function(_0x21713b){return{'name':_0x21713b[_0x739e('0x3a')],'type':_0x21713b[_0x739e('0x3b')][_0x739e('0x3c')]};});_0x58af70['model']=_[_0x739e('0x38')](_0x3bcec2,_0x739e('0x35'));_0x58af70['query']=_[_0x739e('0x3d')](_0xa318b3[_0x739e('0x3e')]);_0x58af70[_0x739e('0x3f')]=_[_0x739e('0x40')](_0x58af70['model'],_0x58af70[_0x739e('0x3e')]);_0x300183[_0x739e('0x41')]=_[_0x739e('0x40')](_0x58af70[_0x739e('0x42')],qs['fields'](_0xa318b3['query'][_0x739e('0x43')]));_0x300183[_0x739e('0x41')]=_0x300183[_0x739e('0x41')]['length']?_0x300183[_0x739e('0x41')]:_0x58af70[_0x739e('0x42')];if(!_0xa318b3[_0x739e('0x3e')][_0x739e('0x44')]('nolimit')){_0x300183[_0x739e('0x2b')]=qs[_0x739e('0x2b')](_0xa318b3[_0x739e('0x3e')]['limit']);_0x300183[_0x739e('0x2c')]=qs['offset'](_0xa318b3['query'][_0x739e('0x2c')]);}_0x300183[_0x739e('0x45')]=qs[_0x739e('0x46')](_0xa318b3[_0x739e('0x3e')][_0x739e('0x46')]);_0x300183[_0x739e('0x47')]=qs[_0x739e('0x3f')](_[_0x739e('0x48')](_0xa318b3[_0x739e('0x3e')],_0x58af70[_0x739e('0x3f')]),_0x3bcec2);if(_0xa318b3[_0x739e('0x3e')][_0x739e('0x49')]){_0x300183[_0x739e('0x47')]=_[_0x739e('0x4a')](_0x300183['where'],{'$or':_['map'](_0x3bcec2,function(_0x2f37c9){if(_0x2f37c9[_0x739e('0x3b')]!==_0x739e('0x4b')){var _0x202b0a={};_0x202b0a[_0x2f37c9[_0x739e('0x35')]]={'$like':'%'+_0xa318b3['query'][_0x739e('0x49')]+'%'};return _0x202b0a;}})});}_0x300183=_[_0x739e('0x4a')]({},_0x300183,_0xa318b3[_0x739e('0x4c')]);var _0x186069={'where':_0x300183[_0x739e('0x47')]};return db['OpenchannelMessage'][_0x739e('0x2d')](_0x186069)['then'](function(_0x4e0c4b){_0x7d454b[_0x739e('0x2d')]=_0x4e0c4b;if(_0xa318b3[_0x739e('0x3e')][_0x739e('0x4d')]){_0x300183[_0x739e('0x4e')]=[{'all':!![]}];}return db[_0x739e('0x4f')][_0x739e('0x50')](_0x300183);})[_0x739e('0x1d')](function(_0x3161e9){_0x7d454b[_0x739e('0x51')]=_0x3161e9;return _0x7d454b;})['then'](respondWithFilteredResult(_0x3f2cf6,_0x300183))['catch'](handleError(_0x3f2cf6,null));};exports[_0x739e('0x52')]=function(_0xb86558,_0x5930c8){var _0x43bb73={'raw':!![],'where':{'id':_0xb86558[_0x739e('0x53')]['id']}},_0x756c98={};_0x756c98['model']=_[_0x739e('0x3d')](db[_0x739e('0x4f')]['rawAttributes']);_0x756c98[_0x739e('0x3e')]=_[_0x739e('0x3d')](_0xb86558[_0x739e('0x3e')]);_0x756c98[_0x739e('0x3f')]=_[_0x739e('0x40')](_0x756c98[_0x739e('0x42')],_0x756c98['query']);_0x43bb73[_0x739e('0x41')]=_['intersection'](_0x756c98[_0x739e('0x42')],qs[_0x739e('0x43')](_0xb86558[_0x739e('0x3e')][_0x739e('0x43')]));_0x43bb73[_0x739e('0x41')]=_0x43bb73[_0x739e('0x41')][_0x739e('0x54')]?_0x43bb73[_0x739e('0x41')]:_0x756c98['model'];if(_0xb86558[_0x739e('0x3e')][_0x739e('0x4d')]){_0x43bb73[_0x739e('0x4e')]=[{'all':!![]}];}_0x43bb73=_[_0x739e('0x4a')]({},_0x43bb73,_0xb86558[_0x739e('0x4c')]);return db[_0x739e('0x4f')][_0x739e('0x55')](_0x43bb73)['then'](handleEntityNotFound(_0x5930c8,null))['then'](respondWithResult(_0x5930c8,null))[_0x739e('0x56')](handleError(_0x5930c8,null));};exports[_0x739e('0x57')]=function(_0x4d093d,_0x20849b){return db[_0x739e('0x4f')]['create'](_0x4d093d[_0x739e('0x58')],{})[_0x739e('0x1d')](respondWithResult(_0x20849b,0xc9))[_0x739e('0x56')](handleError(_0x20849b,null));};exports[_0x739e('0x32')]=function(_0x3aeb91,_0x3e96db){if(_0x3aeb91[_0x739e('0x58')]['id']){delete _0x3aeb91[_0x739e('0x58')]['id'];}return db[_0x739e('0x4f')][_0x739e('0x55')]({'where':{'id':_0x3aeb91[_0x739e('0x53')]['id']}})[_0x739e('0x1d')](handleEntityNotFound(_0x3e96db,null))[_0x739e('0x1d')](saveUpdates(_0x3aeb91[_0x739e('0x58')],null))[_0x739e('0x1d')](respondWithResult(_0x3e96db,null))['catch'](handleError(_0x3e96db,null));};exports['destroy']=function(_0x1dcc38,_0x32c793){return db[_0x739e('0x4f')][_0x739e('0x55')]({'where':{'id':_0x1dcc38[_0x739e('0x53')]['id']}})['then'](handleEntityNotFound(_0x32c793,null))[_0x739e('0x1d')](removeEntity(_0x32c793,null))['catch'](handleError(_0x32c793,null));};exports[_0x739e('0x59')]=function(_0x48a36a,_0x1eb078){return db[_0x739e('0x4f')][_0x739e('0x59')]()[_0x739e('0x1d')](respondWithResult(_0x1eb078,null))[_0x739e('0x56')](handleError(_0x1eb078,null));};var interaction_log=require(_0x739e('0x12'))(_0x739e('0x5a'));exports[_0x739e('0x5b')]=function(_0x947067,_0x16d9b5,_0x4d3332){var _0x34f13e={'agent':{},'channel':'openchannel'};if(_0x947067[_0x739e('0x58')]['id']){delete _0x947067[_0x739e('0x58')]['id'];}_0x947067['body'][_0x739e('0x5c')]=!![];_0x947067['body'][_0x739e('0x5d')]=moment()[_0x739e('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x947067[_0x739e('0x58')][_0x739e('0x5f')]=_0x947067['body'][_0x739e('0x5f')]||_0x947067['user']['id'];_0x34f13e['agent']['id']=_0x947067[_0x739e('0x58')]['UserId'];return db[_0x739e('0x4f')][_0x739e('0x55')]({'where':{'id':_0x947067[_0x739e('0x53')]['id'],'UserId':null}})[_0x739e('0x1d')](handleEntityNotFound(_0x16d9b5,null))[_0x739e('0x1d')](saveUpdates(_0x947067[_0x739e('0x58')],null))[_0x739e('0x1d')](function(_0x5d6d28){if(_0x5d6d28){_0x34f13e[_0x739e('0x25')]=_0x5d6d28[_0x739e('0x60')]({'plain':!![]});return db[_0x739e('0x61')][_0x739e('0x55')]({'where':{'id':_0x5d6d28[_0x739e('0x62')]}});}return null;})[_0x739e('0x1d')](handleEntityNotFound(_0x16d9b5,null))['then'](function(_0x39e4d3){if(_0x39e4d3){return _0x39e4d3[_0x739e('0x32')]({'UserId':_0x947067[_0x739e('0x58')][_0x739e('0x5f')],'read1stAt':_[_0x739e('0x63')](_0x39e4d3['read1stAt'])?moment()['format'](_0x739e('0x64')):undefined});}return null;})[_0x739e('0x1d')](function(_0x2dc699){if(_0x2dc699){_0x34f13e[_0x739e('0x65')]=_0x2dc699['get']({'plain':!![]});interaction_log[_0x739e('0x1e')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x947067[_0x739e('0x66')]['id'],_0x947067[_0x739e('0x66')][_0x739e('0x35')],_0x947067[_0x739e('0x66')][_0x739e('0x67')],_0x34f13e[_0x739e('0x65')]['id'],_0x947067[_0x739e('0x58')]?JSON['stringify'](_0x947067[_0x739e('0x58')]):_0x739e('0x68'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x34f13e);}return null;})[_0x739e('0x1d')](function(_0x29b7ce){var _0x47a5ca=_0x739e('0x69')+_0x29b7ce[_0x739e('0x25')][_0x739e('0x6a')];return db[_0x739e('0x6b')][_0x739e('0x3e')](_0x47a5ca,{'type':db[_0x739e('0x6c')][_0x739e('0x6d')][_0x739e('0x6e')],'raw':!![]})['then'](function(_0x61ae32){return _0x61ae32;});})[_0x739e('0x1d')](function(_0x51717b){if(_0x51717b){_0x34f13e['message']['contact']=_0x51717b[0x0];if(!_0x947067[_0x739e('0x58')][_0x739e('0x5f')])return;return db[_0x739e('0x6f')][_0x739e('0x55')]({'where':{'id':_0x947067['body'][_0x739e('0x5f')],'role':_0x739e('0x70')},'attributes':['id',_0x739e('0x35'),_0x739e('0x71'),'email',_0x739e('0x72')],'raw':!![]});}return null;})[_0x739e('0x1d')](function(_0x59a3c2){if(!_0x59a3c2)return null;_0x34f13e[_0x739e('0x25')][_0x739e('0x70')]=_0x59a3c2;return _0x34f13e;})['then'](function(_0x53d5fb){if(_0x53d5fb){if(_0x947067[_0x739e('0x58')][_0x739e('0x73')]){_0x34f13e[_0x739e('0x25')]['interface']=util[_0x739e('0x5e')](_0x739e('0x74'),_0x947067[_0x739e('0x66')][_0x739e('0x35')]);_0x34f13e[_0x739e('0x25')][_0x739e('0x75')]=_0x34f13e[_0x739e('0x75')];_0x34f13e[_0x739e('0x25')]['motionChannel']=_0x34f13e['channel'];_0x34f13e[_0x739e('0x25')][_0x739e('0x76')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x739e('0x77'),'message':_0x34f13e['message']},client9002)[_0x739e('0x1d')](function(){return _0x34f13e;});}return _0x34f13e;}return null;})[_0x739e('0x1d')](respondWithResult(_0x16d9b5,null))[_0x739e('0x56')](handleError(_0x16d9b5,null));};var interaction_log=require(_0x739e('0x12'))('openchannel-interactions');exports['reject']=function(_0x3c153d,_0x5d77d3,_0x44774c){var _0x1fb9ff={'agent':{},'channel':_0x739e('0x78')};if(_0x3c153d[_0x739e('0x58')]['id']){delete _0x3c153d[_0x739e('0x58')]['id'];}_0x3c153d[_0x739e('0x58')][_0x739e('0x5f')]=_0x3c153d[_0x739e('0x58')][_0x739e('0x5f')]||_0x3c153d[_0x739e('0x66')]['id'];_0x1fb9ff[_0x739e('0x70')]['id']=_0x3c153d[_0x739e('0x58')][_0x739e('0x5f')];return db[_0x739e('0x4f')][_0x739e('0x55')]({'where':{'id':_0x3c153d[_0x739e('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5d77d3,null))[_0x739e('0x1d')](function(_0x6e17ef){if(_0x6e17ef){_0x1fb9ff[_0x739e('0x25')]=_0x6e17ef[_0x739e('0x60')]({'plain':!![]});return db[_0x739e('0x61')][_0x739e('0x55')]({'where':{'id':_0x6e17ef[_0x739e('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x5d77d3,null))[_0x739e('0x1d')](function(_0x4cfc99){if(_0x4cfc99){_0x1fb9ff[_0x739e('0x65')]=_0x4cfc99[_0x739e('0x60')]({'plain':!![]});interaction_log[_0x739e('0x1e')](_0x739e('0x79'),_0x3c153d[_0x739e('0x66')]['id'],_0x3c153d['user'][_0x739e('0x35')],_0x3c153d[_0x739e('0x66')][_0x739e('0x67')],_0x1fb9ff[_0x739e('0x65')]['id'],_0x3c153d[_0x739e('0x58')]?JSON[_0x739e('0x22')](_0x3c153d['body']):_0x739e('0x68'));return respondWithRpcPromise(_0x739e('0x7a'),_0x739e('0x7b'),_0x1fb9ff);}return null;})[_0x739e('0x1d')](function(_0x3ce4bd){var _0x58bba3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ce4bd[_0x739e('0x25')]['ContactId'];return db[_0x739e('0x6b')][_0x739e('0x3e')](_0x58bba3,{'type':db[_0x739e('0x6c')][_0x739e('0x6d')][_0x739e('0x6e')],'raw':!![]})[_0x739e('0x1d')](function(_0x16ce69){return _0x16ce69;});})['then'](function(_0x231608){if(_0x231608){_0x1fb9ff[_0x739e('0x25')][_0x739e('0x7c')]=_0x231608[0x0];if(!_0x3c153d[_0x739e('0x58')][_0x739e('0x5f')])return;return db[_0x739e('0x6f')][_0x739e('0x55')]({'where':{'id':_0x3c153d[_0x739e('0x58')][_0x739e('0x5f')],'role':'agent'},'attributes':['id',_0x739e('0x35'),'fullname',_0x739e('0x7d'),_0x739e('0x72')],'raw':!![]});}return null;})[_0x739e('0x1d')](function(_0xa52645){if(!_0xa52645)return null;_0x1fb9ff[_0x739e('0x25')][_0x739e('0x70')]=_0xa52645;return _0x1fb9ff;})[_0x739e('0x1d')](function(_0x37f1dc){if(_0x37f1dc){_0x37f1dc[_0x739e('0x25')][_0x739e('0x7e')]=util[_0x739e('0x5e')](_0x739e('0x74'),_0x3c153d[_0x739e('0x66')]['name']);_0x37f1dc[_0x739e('0x25')][_0x739e('0x75')]=_0x1fb9ff[_0x739e('0x75')];_0x37f1dc['message'][_0x739e('0x7f')]=_0x1fb9ff['channel'];_0x37f1dc['message'][_0x739e('0x76')]='reject';respondWithRpcPromise(_0x739e('0x80'),_0x739e('0x80'),{'event':_0x739e('0x81'),'message':_0x37f1dc[_0x739e('0x25')]},client9002);return _0x1fb9ff;}return null;})[_0x739e('0x1d')](respondWithResult(_0x5d77d3,null))[_0x739e('0x56')](handleError(_0x5d77d3,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 78aadbf..a497500 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 _0xae62=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3c8d56,_0x29bc42){var _0x4b2ca9=function(_0x5669f8){while(--_0x5669f8){_0x3c8d56['push'](_0x3c8d56['shift']());}};_0x4b2ca9(++_0x29bc42);}(_0xae62,0x1f0));var _0x2ae6=function(_0xa65515,_0x16ff56){_0xa65515=_0xa65515-0x0;var _0x183ca4=_0xae62[_0xa65515];return _0x183ca4;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x2ae6('0x0'))['db'][_0x2ae6('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2ae6('0x2')](0x0);var events={'afterCreate':_0x2ae6('0x3'),'afterUpdate':_0x2ae6('0x4'),'afterDestroy':_0x2ae6('0x5')};function emitEvent(_0x29845a){return function(_0x2b0c7d,_0x132a6e,_0x104fe7){OpenchannelMessageEvents[_0x2ae6('0x6')](_0x29845a+':'+_0x2b0c7d['id'],_0x2b0c7d);OpenchannelMessageEvents[_0x2ae6('0x6')](_0x29845a,_0x2b0c7d);_0x104fe7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x2ae6('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x67e3=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','OpenchannelMessage'];(function(_0x50c20a,_0x98d395){var _0x294866=function(_0x56b767){while(--_0x56b767){_0x50c20a['push'](_0x50c20a['shift']());}};_0x294866(++_0x98d395);}(_0x67e3,0x66));var _0x367e=function(_0x358508,_0x1cf179){_0x358508=_0x358508-0x0;var _0x4538c7=_0x67e3[_0x358508];return _0x4538c7;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x367e('0x0'))['db'][_0x367e('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x367e('0x2'),'afterUpdate':_0x367e('0x3'),'afterDestroy':_0x367e('0x4')};function emitEvent(_0x2114d7){return function(_0x1d62a9,_0xeebd60,_0x4f31cb){OpenchannelMessageEvents[_0x367e('0x5')](_0x2114d7+':'+_0x1d62a9['id'],_0x1d62a9);OpenchannelMessageEvents[_0x367e('0x5')](_0x2114d7,_0x1d62a9);_0x4f31cb(null);};}for(var e in events){if(events[_0x367e('0x6')](e)){var event=events[e];OpenchannelMessage[_0x367e('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index de27660..3a27398 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 _0xed3c=['OpenchannelInteractionId','createdAt','catch','error','CmContact','describe','find','OpenchannelAccountId','Interactions','Contact','keys','then','get','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','omit','replyUri','GET','POST','body','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','OpenchannelMessage,\x20%s,\x20%s','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','./openchannelMessage.attributes','exports','fti_openchannel_messages','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne'];(function(_0x385eb1,_0x497a94){var _0x5d40eb=function(_0x159029){while(--_0x159029){_0x385eb1['push'](_0x385eb1['shift']());}};_0x5d40eb(++_0x497a94);}(_0xed3c,0x1a6));var _0xced3=function(_0x13cd20,_0x1d9211){_0x13cd20=_0x13cd20-0x0;var _0x22b6de=_0xed3c[_0x13cd20];return _0x22b6de;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var logger=require(_0xced3('0x2'))(_0xced3('0x3'));var moment=require('moment');var BPromise=require(_0xced3('0x4'));var rp=require(_0xced3('0x5'));var fs=require('fs');var path=require(_0xced3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xced3('0x7'));module[_0xced3('0x8')]=function(_0x2f92f8,_0x1cd694){return _0x2f92f8['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xced3('0x9'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4be020,_0x19a727,_0x321c42){var _0x3e5a04=_0x2f92f8[_0xced3('0xa')];var _0x1cb639=_0x4be020['get']({'plain':!![]});if(_0x1cb639[_0xced3('0xb')][_0xced3('0xc')]()==='in'||_0x1cb639[_0xced3('0xb')]['toLowerCase']()===_0xced3('0xd')&&!_0x1cb639[_0xced3('0xe')]&&!_[_0xced3('0xf')](_0x1cb639[_0xced3('0x10')])){_0x3e5a04[_0xced3('0x11')][_0xced3('0x12')]({'where':{'id':_0x1cb639[_0xced3('0x13')]}})['then'](function(_0x65bb58){if(_0x65bb58){_0x65bb58['update']({'lastMsgAt':_0x1cb639[_0xced3('0x14')],'lastMsgDirection':_0x1cb639[_0xced3('0xb')][_0xced3('0xc')]()});}})[_0xced3('0x15')](function(_0x4dd4c3){console[_0xced3('0x16')](_0x4dd4c3);});}if(_0x1cb639[_0xced3('0xb')]==='out'&&!_0x1cb639[_0xced3('0xe')]){var _0x37e2d5;_0x3e5a04[_0xced3('0x17')][_0xced3('0x18')]()['then'](function(_0x4569af){return _0x3e5a04['OpenchannelAccount'][_0xced3('0x19')]({'where':{'id':_0x1cb639[_0xced3('0x1a')]},'include':[{'model':_0x3e5a04[_0xced3('0x11')],'as':_0xced3('0x1b'),'where':{'id':_0x1cb639[_0xced3('0x13')]},'limit':0x1,'include':[{'model':_0x3e5a04[_0xced3('0x17')],'as':_0xced3('0x1c'),'attributes':_[_0xced3('0x1d')](_0x4569af)}]}]});})[_0xced3('0x1e')](function(_0x17c011){_0x37e2d5=_0x17c011[_0xced3('0x1f')]({'plain':!![]});if(_0x37e2d5&&_0x37e2d5['replyUri']){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xced3('0x20'),util[_0xced3('0x21')](_0xced3('0x22'),_0x1cb639['id'],_0x37e2d5['replyUri']));if(_0x37e2d5[_0xced3('0x1b')]&&_0x37e2d5[_0xced3('0x1b')]['length']){_0x1cb639['Interaction']=_[_0xced3('0x23')](_0x37e2d5[_0xced3('0x1b')][0x0],_0xced3('0x1c'));_0x1cb639[_0xced3('0x1c')]=_0x37e2d5['Interactions'][0x0][_0xced3('0x1c')];}var _0x19a727={'method':'POST','uri':encodeURI(_0x37e2d5[_0xced3('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x19a727['method']){case _0xced3('0x25'):_0x19a727['qs']=_0x1cb639;break;case _0xced3('0x26'):_0x19a727[_0xced3('0x27')]=_0x1cb639;break;}return rp(_0x19a727)[_0xced3('0x1e')](function(_0x2ec2c4){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xced3('0x20'),util['format'](_0xced3('0x28'),_0x1cb639['id'],_0x37e2d5[_0xced3('0x24')]));if(_0x2ec2c4['body'][_0xced3('0x29')]&&_0x2ec2c4[_0xced3('0x27')][_0xced3('0x29')]!=_0x1cb639[_0xced3('0x2a')][_0xced3('0x29')]){return _0x3e5a04[_0xced3('0x11')][_0xced3('0x2b')]({'threadId':_0x2ec2c4[_0xced3('0x27')][_0xced3('0x29')]},{'logging':!![],'where':{'id':_0x1cb639['Interaction']['id']}});}else{return;}})[_0xced3('0x1e')](function(){return _0x4be020[_0xced3('0x2b')]({'read':!![]});})[_0xced3('0x15')](function(_0x5867af){logger[_0xced3('0x16')](_0xced3('0x2c'),_0xced3('0x20'),util[_0xced3('0x2d')](_0x5867af,{'showHidden':![],'depth':null}));_0x321c42();});}else{_0x321c42();}})[_0xced3('0x2e')](function(){_0x321c42();});}else{_0x321c42();}}},'charset':_0xced3('0x2f'),'collate':_0xced3('0x30')});}; \ No newline at end of file +var _0x4213=['describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','CmContact','Contact','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','GET','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch'];(function(_0x774b6f,_0x1717fe){var _0x38cf6b=function(_0x17639c){while(--_0x17639c){_0x774b6f['push'](_0x774b6f['shift']());}};_0x38cf6b(++_0x1717fe);}(_0x4213,0x77));var _0x3421=function(_0x424e85,_0xb22273){_0x424e85=_0x424e85-0x0;var _0xc8b642=_0x4213[_0x424e85];return _0xc8b642;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var logger=require(_0x3421('0x2'))(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var BPromise=require(_0x3421('0x5'));var rp=require(_0x3421('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3421('0x7'));var config=require('../../config/environment');var attributes=require(_0x3421('0x8'));module[_0x3421('0x9')]=function(_0x2155f8,_0x2a04e0){return _0x2155f8['define'](_0x3421('0xa'),attributes,{'tableName':_0x3421('0xb'),'paranoid':![],'indexes':[{'name':_0x3421('0xc'),'fields':[_0x3421('0xd')],'type':_0x3421('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ddfce,_0x1f20cf,_0x58d511){var _0x4ff986=_0x2155f8[_0x3421('0xf')];var _0x4b9d24=_0x4ddfce[_0x3421('0x10')]({'plain':!![]});if(_0x4b9d24[_0x3421('0x11')][_0x3421('0x12')]()==='in'||_0x4b9d24[_0x3421('0x11')][_0x3421('0x12')]()===_0x3421('0x13')&&!_0x4b9d24[_0x3421('0x14')]&&!_['isNil'](_0x4b9d24[_0x3421('0x15')])){_0x4ff986[_0x3421('0x16')][_0x3421('0x17')]({'where':{'id':_0x4b9d24[_0x3421('0x18')]}})[_0x3421('0x19')](function(_0x3f4672){if(_0x3f4672){_0x3f4672[_0x3421('0x1a')]({'lastMsgAt':_0x4b9d24['createdAt'],'lastMsgDirection':_0x4b9d24[_0x3421('0x11')]['toLowerCase']()});}})[_0x3421('0x1b')](function(_0x5257ad){console['error'](_0x5257ad);});}if(_0x4b9d24[_0x3421('0x11')]==='out'&&!_0x4b9d24[_0x3421('0x14')]){var _0x23694b;_0x4ff986['CmContact'][_0x3421('0x1c')]()[_0x3421('0x19')](function(_0x130d3c){return _0x4ff986[_0x3421('0x1d')][_0x3421('0x1e')]({'where':{'id':_0x4b9d24[_0x3421('0x1f')]},'include':[{'model':_0x4ff986[_0x3421('0x16')],'as':_0x3421('0x20'),'where':{'id':_0x4b9d24[_0x3421('0x18')]},'limit':0x1,'include':[{'model':_0x4ff986[_0x3421('0x21')],'as':_0x3421('0x22'),'attributes':_['keys'](_0x130d3c)}]}]});})[_0x3421('0x19')](function(_0x4b59a5){_0x23694b=_0x4b59a5['get']({'plain':!![]});if(_0x23694b&&_0x23694b['replyUri']){logger[_0x3421('0x23')](_0x3421('0x24'),_0x3421('0x25'),util[_0x3421('0x26')](_0x3421('0x27'),_0x4b9d24['id'],_0x23694b[_0x3421('0x28')]));if(_0x23694b[_0x3421('0x20')]&&_0x23694b[_0x3421('0x20')][_0x3421('0x29')]){_0x4b9d24[_0x3421('0x2a')]=_['omit'](_0x23694b['Interactions'][0x0],'Contact');_0x4b9d24[_0x3421('0x22')]=_0x23694b[_0x3421('0x20')][0x0][_0x3421('0x22')];}var _0x1f20cf={'method':'POST','uri':encodeURI(_0x23694b[_0x3421('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1f20cf['method']){case _0x3421('0x2b'):_0x1f20cf['qs']=_0x4b9d24;break;case'POST':_0x1f20cf[_0x3421('0xd')]=_0x4b9d24;break;}return rp(_0x1f20cf)[_0x3421('0x19')](function(_0x36d75f){logger[_0x3421('0x23')](_0x3421('0x24'),'afterCreate',util[_0x3421('0x26')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4b9d24['id'],_0x23694b['replyUri']));if(_0x36d75f[_0x3421('0xd')]['threadId']&&_0x36d75f['body'][_0x3421('0x2c')]!=_0x4b9d24['Interaction'][_0x3421('0x2c')]){return _0x4ff986['OpenchannelInteraction'][_0x3421('0x1a')]({'threadId':_0x36d75f[_0x3421('0xd')]['threadId']},{'logging':!![],'where':{'id':_0x4b9d24[_0x3421('0x2a')]['id']}});}else{return;}})[_0x3421('0x19')](function(){return _0x4ddfce[_0x3421('0x1a')]({'read':!![]});})['catch'](function(_0x3a89b6){logger['error'](_0x3421('0x24'),_0x3421('0x25'),util[_0x3421('0x2d')](_0x3a89b6,{'showHidden':![],'depth':null}));_0x58d511();});}else{_0x58d511();}})[_0x3421('0x2e')](function(){_0x58d511();});}else{_0x58d511();}}},'charset':_0x3421('0x2f'),'collate':_0x3421('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index d6541b0..ace2492 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x187a7e,_0x540966){var _0x2afcba=function(_0x266fd3){while(--_0x266fd3){_0x187a7e['push'](_0x187a7e['shift']());}};_0x2afcba(++_0x540966);}(_0x1261,0x144));var _0x1126=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0x1261[_0x187d80];return _0x498a77;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +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(_0x2dacc2,_0x19c5d9){var _0x5d1a7c=function(_0x343c6f){while(--_0x343c6f){_0x2dacc2['push'](_0x2dacc2['shift']());}};_0x5d1a7c(++_0x19c5d9);}(_0xadb5,0xad));var _0x5adb=function(_0x4ad64b,_0x117b10){_0x4ad64b=_0x4ad64b-0x0;var _0x24c24d=_0xadb5[_0x4ad64b];return _0x24c24d;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index c137451..a183e13 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 _0x334b=['update','register','length','openchannelMessage:','save','remove'];(function(_0x2d5805,_0x21954e){var _0x1cae4f=function(_0x53ff24){while(--_0x53ff24){_0x2d5805['push'](_0x2d5805['shift']());}};_0x1cae4f(++_0x21954e);}(_0x334b,0x154));var _0xb334=function(_0x3db4e6,_0x6cb2de){_0x3db4e6=_0x3db4e6-0x0;var _0x56802e=_0x334b[_0x3db4e6];return _0x56802e;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xb334('0x0'),_0xb334('0x1'),_0xb334('0x2')];function createListener(_0x304cd4,_0x1a9baa){return function(_0xd33a82){_0x1a9baa['emit'](_0x304cd4,_0xd33a82);};}function removeListener(_0x185532,_0x3f58e0){return function(){OpenchannelMessageEvents['removeListener'](_0x185532,_0x3f58e0);};}exports[_0xb334('0x3')]=function(_0x3852ef){for(var _0x25a420=0x0,_0x52fef0=events[_0xb334('0x4')];_0x25a420<_0x52fef0;_0x25a420++){var _0x39c658=events[_0x25a420];var _0x408c14=createListener(_0xb334('0x5')+_0x39c658,_0x3852ef);OpenchannelMessageEvents['on'](_0x39c658,_0x408c14);}}; \ No newline at end of file +var _0x5c91=['save','remove','emit','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x30aadd,_0x20a265){var _0x428865=function(_0x40e630){while(--_0x40e630){_0x30aadd['push'](_0x30aadd['shift']());}};_0x428865(++_0x20a265);}(_0x5c91,0x1e9));var _0x15c9=function(_0x208481,_0x5bd9fa){_0x208481=_0x208481-0x0;var _0x10c588=_0x5c91[_0x208481];return _0x10c588;};'use strict';var OpenchannelMessageEvents=require(_0x15c9('0x0'));var events=[_0x15c9('0x1'),_0x15c9('0x2'),'update'];function createListener(_0x169444,_0x37629c){return function(_0x17453e){_0x37629c[_0x15c9('0x3')](_0x169444,_0x17453e);};}function removeListener(_0x29353f,_0x3c7189){return function(){OpenchannelMessageEvents['removeListener'](_0x29353f,_0x3c7189);};}exports[_0x15c9('0x4')]=function(_0x216469){for(var _0x1ce11a=0x0,_0x42bcb6=events[_0x15c9('0x5')];_0x1ce11a<_0x42bcb6;_0x1ce11a++){var _0x51a779=events[_0x1ce11a];var _0x191695=createListener(_0x15c9('0x6')+_0x51a779,_0x216469);OpenchannelMessageEvents['on'](_0x51a779,_0x191695);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index f8ca298..3fd6aa4 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 _0x9179=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/:id','show','/:id/members','getMembers','getTeams','/:id/users','create','/:id/teams','post','addAgents','put','update','delete','destroy','removeTeams','multer'];(function(_0x17e1d7,_0x20ce0f){var _0x43f6e9=function(_0x4ab606){while(--_0x4ab606){_0x17e1d7['push'](_0x17e1d7['shift']());}};_0x43f6e9(++_0x20ce0f);}(_0x9179,0x12b));var _0x9917=function(_0x5d64ac,_0x46e6fa){_0x5d64ac=_0x5d64ac-0x0;var _0x2f5c48=_0x9179[_0x5d64ac];return _0x2f5c48;};'use strict';var multer=require(_0x9917('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9917('0x1'));var express=require(_0x9917('0x2'));var router=express[_0x9917('0x3')]();var fs_extra=require(_0x9917('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9917('0x5'));var config=require(_0x9917('0x6'));var controller=require(_0x9917('0x7'));router[_0x9917('0x8')]('/',auth[_0x9917('0x9')](),controller['index']);router[_0x9917('0x8')]('/describe',auth[_0x9917('0x9')](),controller['describe']);router['get'](_0x9917('0xa'),auth[_0x9917('0x9')](),controller[_0x9917('0xb')]);router[_0x9917('0x8')](_0x9917('0xc'),auth[_0x9917('0x9')](),controller[_0x9917('0xd')]);router[_0x9917('0x8')]('/:id/teams',auth[_0x9917('0x9')](),controller[_0x9917('0xe')]);router['get'](_0x9917('0xf'),auth[_0x9917('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x9917('0x10')]);router['post'](_0x9917('0x11'),auth[_0x9917('0x9')](),controller['addTeams']);router[_0x9917('0x12')]('/:id/users',auth[_0x9917('0x9')](),controller[_0x9917('0x13')]);router[_0x9917('0x14')]('/:id',auth[_0x9917('0x9')](),controller[_0x9917('0x15')]);router[_0x9917('0x16')]('/:id',auth[_0x9917('0x9')](),controller[_0x9917('0x17')]);router[_0x9917('0x16')](_0x9917('0x11'),auth[_0x9917('0x9')](),controller[_0x9917('0x18')]);router['delete'](_0x9917('0xf'),auth[_0x9917('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x6230=['Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout'];(function(_0x2b04c7,_0x544682){var _0x279f78=function(_0x24f025){while(--_0x24f025){_0x2b04c7['push'](_0x2b04c7['shift']());}};_0x279f78(++_0x544682);}(_0x6230,0xce));var _0x0623=function(_0x25010a,_0x5e2dbb){_0x25010a=_0x25010a-0x0;var _0x431b1c=_0x6230[_0x25010a];return _0x431b1c;};'use strict';var multer=require(_0x0623('0x0'));var util=require(_0x0623('0x1'));var path=require(_0x0623('0x2'));var timeout=require(_0x0623('0x3'));var express=require('express');var router=express[_0x0623('0x4')]();var fs_extra=require(_0x0623('0x5'));var auth=require(_0x0623('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0623('0x7'));var controller=require(_0x0623('0x8'));router[_0x0623('0x9')]('/',auth[_0x0623('0xa')](),controller[_0x0623('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0623('0xc')]);router[_0x0623('0x9')](_0x0623('0xd'),auth['isAuthenticated'](),controller[_0x0623('0xe')]);router[_0x0623('0x9')](_0x0623('0xf'),auth[_0x0623('0xa')](),controller[_0x0623('0x10')]);router[_0x0623('0x9')](_0x0623('0x11'),auth['isAuthenticated'](),controller[_0x0623('0x12')]);router[_0x0623('0x9')](_0x0623('0x13'),auth[_0x0623('0xa')](),controller[_0x0623('0x14')]);router['post']('/',auth[_0x0623('0xa')](),controller[_0x0623('0x15')]);router[_0x0623('0x16')](_0x0623('0x11'),auth[_0x0623('0xa')](),controller[_0x0623('0x17')]);router[_0x0623('0x16')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x0623('0x18')](_0x0623('0xd'),auth[_0x0623('0xa')](),controller[_0x0623('0x19')]);router[_0x0623('0x1a')](_0x0623('0xd'),auth[_0x0623('0xa')](),controller[_0x0623('0x1b')]);router[_0x0623('0x1a')](_0x0623('0x11'),auth['isAuthenticated'](),controller[_0x0623('0x1c')]);router[_0x0623('0x1a')](_0x0623('0x13'),auth[_0x0623('0xa')](),controller['removeAgents']);module[_0x0623('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 6855a09..6f2b24d 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 _0x9a49=['roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x3de185,_0x18ba84){var _0x53d36c=function(_0xabda4c){while(--_0xabda4c){_0x3de185['push'](_0x3de185['shift']());}};_0x53d36c(++_0x18ba84);}(_0x9a49,0x1d1));var _0x99a4=function(_0x312f8a,_0x2e9a07){_0x312f8a=_0x312f8a-0x0;var _0x35e8d6=_0x9a49[_0x312f8a];return _0x35e8d6;};'use strict';var Sequelize=require(_0x99a4('0x0'));module['exports']={'name':{'type':Sequelize[_0x99a4('0x1')],'unique':_0x99a4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x99a4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x99a4('0x4')](_0x99a4('0x5'),_0x99a4('0x6'),_0x99a4('0x7'))}}; \ No newline at end of file +var _0x4fb9=['INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING','name'];(function(_0x4b2e52,_0x2da13b){var _0x2b1453=function(_0x2c8795){while(--_0x2c8795){_0x4b2e52['push'](_0x4b2e52['shift']());}};_0x2b1453(++_0x2da13b);}(_0x4fb9,0xbb));var _0x94fb=function(_0x5d1f1d,_0x3bfe16){_0x5d1f1d=_0x5d1f1d-0x0;var _0x21ddb5=_0x4fb9[_0x5d1f1d];return _0x21ddb5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x94fb('0x0')],'unique':_0x94fb('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x94fb('0x0')]},'timeout':{'type':Sequelize[_0x94fb('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x94fb('0x3')](_0x94fb('0x4'),_0x94fb('0x5'),_0x94fb('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index ecc104d..974124e 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 _0x31df=['userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','keys','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','format','SIP','openchannelPause','createdAt','updatedAt','getTeams','Team','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x31df,0x1cb));var _0xf31d=function(_0x1a7fbf,_0x43931c){_0x1a7fbf=_0x1a7fbf-0x0;var _0x3107bb=_0x31df[_0x1a7fbf];return _0x3107bb;};'use strict';var emlformat=require(_0xf31d('0x0'));var rimraf=require(_0xf31d('0x1'));var zipdir=require(_0xf31d('0x2'));var jsonpatch=require(_0xf31d('0x3'));var rp=require(_0xf31d('0x4'));var moment=require('moment');var BPromise=require(_0xf31d('0x5'));var Mustache=require('mustache');var util=require(_0xf31d('0x6'));var path=require(_0xf31d('0x7'));var sox=require('sox');var csv=require(_0xf31d('0x8'));var ejs=require(_0xf31d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf31d('0xa'));var crypto=require(_0xf31d('0xb'));var jsforce=require(_0xf31d('0xc'));var deskjs=require(_0xf31d('0xd'));var toCsv=require(_0xf31d('0x8'));var querystring=require(_0xf31d('0xe'));var Papa=require(_0xf31d('0xf'));var Redis=require('ioredis');var authService=require(_0xf31d('0x10'));var qs=require(_0xf31d('0x11'));var as=require(_0xf31d('0x12'));var hardwareService=require(_0xf31d('0x13'));var logger=require(_0xf31d('0x14'))(_0xf31d('0x15'));var utils=require('../../config/utils');var config=require(_0xf31d('0x16'));var licenseUtil=require(_0xf31d('0x17'));var db=require(_0xf31d('0x18'))['db'];config[_0xf31d('0x19')]=_[_0xf31d('0x1a')](config[_0xf31d('0x19')],{'host':_0xf31d('0x1b'),'port':0x18eb});var socket=require(_0xf31d('0x1c'))(new Redis(config[_0xf31d('0x19')]));require('./openchannelQueue.socket')[_0xf31d('0x1d')](socket);function respondWithStatusCode(_0xbb494b,_0x2d5e2b){_0x2d5e2b=_0x2d5e2b||0xcc;return function(_0x4baa2d){if(_0x4baa2d){return _0xbb494b[_0xf31d('0x1e')](_0x2d5e2b);}return _0xbb494b['status'](_0x2d5e2b)[_0xf31d('0x1f')]();};}function respondWithResult(_0x395362,_0x387a20){_0x387a20=_0x387a20||0xc8;return function(_0x5034f3){if(_0x5034f3){return _0x395362[_0xf31d('0x20')](_0x387a20)[_0xf31d('0x21')](_0x5034f3);}};}function respondWithFilteredResult(_0x141139,_0x297856){return function(_0x3f4b31){if(_0x3f4b31){var _0x3b8eee=typeof _0x297856[_0xf31d('0x22')]===_0xf31d('0x23')&&typeof _0x297856[_0xf31d('0x24')]===_0xf31d('0x23');var _0x27efda=_0x3f4b31[_0xf31d('0x25')];var _0x532ac5=_0x3b8eee?0x0:_0x297856['offset'];var _0x48f924=_0x3b8eee?_0x3f4b31[_0xf31d('0x25')]:_0x297856[_0xf31d('0x22')]+_0x297856[_0xf31d('0x24')];var _0xd16098;if(_0x48f924>=_0x27efda){_0x48f924=_0x27efda;_0xd16098=0xc8;}else{_0xd16098=0xce;}_0x141139['status'](_0xd16098);return _0x141139[_0xf31d('0x26')]('Content-Range',_0x532ac5+'-'+_0x48f924+'/'+_0x27efda)[_0xf31d('0x21')](_0x3f4b31);}return null;};}function patchUpdates(_0x64ddd9){return function(_0x4c4445){try{jsonpatch['apply'](_0x4c4445,_0x64ddd9,!![]);}catch(_0x1dedf6){return BPromise[_0xf31d('0x27')](_0x1dedf6);}return _0x4c4445['save']();};}function saveUpdates(_0x1f16c2,_0x327eec){return function(_0x1ae1b0){if(_0x1ae1b0){return _0x1ae1b0[_0xf31d('0x28')](_0x1f16c2)[_0xf31d('0x29')](function(_0x1de4ee){return _0x1de4ee;});}return null;};}function removeEntity(_0x1600d2,_0x1aee4a){return function(_0x5040f6){if(_0x5040f6){return _0x5040f6[_0xf31d('0x2a')]()[_0xf31d('0x29')](function(){var _0x15b4ea=_0x5040f6[_0xf31d('0x2b')]({'plain':!![]});var _0x5a9b5f='OpenchannelQueues';return db['UserProfileResource'][_0xf31d('0x2a')]({'where':{'type':_0x5a9b5f,'resourceId':_0x15b4ea['id']}})[_0xf31d('0x29')](function(){return _0x5040f6;});})[_0xf31d('0x29')](function(){_0x1600d2['status'](0xcc)[_0xf31d('0x1f')]();});}};}function handleEntityNotFound(_0xeff029,_0x4b9a6e){return function(_0x2662ba){if(!_0x2662ba){_0xeff029[_0xf31d('0x1e')](0x194);}return _0x2662ba;};}function handleError(_0x30df3e,_0x5126d7){_0x5126d7=_0x5126d7||0x1f4;return function(_0x1d1ed5){logger[_0xf31d('0x2c')](_0x1d1ed5[_0xf31d('0x2d')]);if(_0x1d1ed5[_0xf31d('0x2e')]){delete _0x1d1ed5[_0xf31d('0x2e')];}_0x30df3e['status'](_0x5126d7)[_0xf31d('0x2f')](_0x1d1ed5);};}exports[_0xf31d('0x30')]=function(_0xbafec8,_0x2eaeba){var _0x59499b={},_0x4e6e47={},_0x4f457d={'count':0x0,'rows':[]};var _0x177ece=_['map'](db['OpenchannelQueue'][_0xf31d('0x31')],function(_0x107ebe){return{'name':_0x107ebe[_0xf31d('0x32')],'type':_0x107ebe[_0xf31d('0x33')][_0xf31d('0x34')]};});_0x4e6e47['model']=_[_0xf31d('0x35')](_0x177ece,_0xf31d('0x2e'));_0x4e6e47[_0xf31d('0x36')]=_['keys'](_0xbafec8[_0xf31d('0x36')]);_0x4e6e47[_0xf31d('0x37')]=_[_0xf31d('0x38')](_0x4e6e47[_0xf31d('0x39')],_0x4e6e47[_0xf31d('0x36')]);_0x59499b[_0xf31d('0x3a')]=_['intersection'](_0x4e6e47[_0xf31d('0x39')],qs[_0xf31d('0x3b')](_0xbafec8['query'][_0xf31d('0x3b')]));_0x59499b[_0xf31d('0x3a')]=_0x59499b[_0xf31d('0x3a')][_0xf31d('0x3c')]?_0x59499b[_0xf31d('0x3a')]:_0x4e6e47['model'];if(!_0xbafec8['query'][_0xf31d('0x3d')](_0xf31d('0x3e'))){_0x59499b[_0xf31d('0x24')]=qs[_0xf31d('0x24')](_0xbafec8[_0xf31d('0x36')][_0xf31d('0x24')]);_0x59499b[_0xf31d('0x22')]=qs[_0xf31d('0x22')](_0xbafec8['query'][_0xf31d('0x22')]);}_0x59499b[_0xf31d('0x3f')]=qs[_0xf31d('0x40')](_0xbafec8[_0xf31d('0x36')][_0xf31d('0x40')]);_0x59499b[_0xf31d('0x41')]=qs['filters'](_['pick'](_0xbafec8[_0xf31d('0x36')],_0x4e6e47[_0xf31d('0x37')]),_0x177ece);if(_0xbafec8[_0xf31d('0x36')][_0xf31d('0x42')]){_0x59499b[_0xf31d('0x41')]=_['merge'](_0x59499b[_0xf31d('0x41')],{'$or':_[_0xf31d('0x35')](_0x177ece,function(_0x5c4167){if(_0x5c4167[_0xf31d('0x33')]!==_0xf31d('0x43')){var _0xd63d54={};_0xd63d54[_0x5c4167[_0xf31d('0x2e')]]={'$like':'%'+_0xbafec8['query'][_0xf31d('0x42')]+'%'};return _0xd63d54;}})});}_0x59499b=_[_0xf31d('0x44')]({},_0x59499b,_0xbafec8[_0xf31d('0x45')]);var _0x1f44ce={'where':_0x59499b[_0xf31d('0x41')]};return db[_0xf31d('0x46')][_0xf31d('0x25')](_0x1f44ce)[_0xf31d('0x29')](function(_0x3fdd88){_0x4f457d[_0xf31d('0x25')]=_0x3fdd88;if(_0xbafec8['query'][_0xf31d('0x47')]){_0x59499b[_0xf31d('0x48')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xf31d('0x49')](_0x59499b);})['then'](function(_0x1f3cab){_0x4f457d[_0xf31d('0x4a')]=_0x1f3cab;return _0x4f457d;})[_0xf31d('0x29')](respondWithFilteredResult(_0x2eaeba,_0x59499b))[_0xf31d('0x4b')](handleError(_0x2eaeba,null));};exports[_0xf31d('0x4c')]=function(_0x41d212,_0x3d4bda){var _0xf383={'raw':!![],'where':{'id':_0x41d212[_0xf31d('0x4d')]['id']}},_0x2c2b72={};_0x2c2b72[_0xf31d('0x39')]=_[_0xf31d('0x4e')](db[_0xf31d('0x46')][_0xf31d('0x31')]);_0x2c2b72['query']=_[_0xf31d('0x4e')](_0x41d212['query']);_0x2c2b72[_0xf31d('0x37')]=_[_0xf31d('0x38')](_0x2c2b72['model'],_0x2c2b72[_0xf31d('0x36')]);_0xf383['attributes']=_['intersection'](_0x2c2b72[_0xf31d('0x39')],qs[_0xf31d('0x3b')](_0x41d212[_0xf31d('0x36')][_0xf31d('0x3b')]));_0xf383[_0xf31d('0x3a')]=_0xf383[_0xf31d('0x3a')][_0xf31d('0x3c')]?_0xf383['attributes']:_0x2c2b72['model'];if(_0x41d212[_0xf31d('0x36')]['includeAll']){_0xf383['include']=[{'all':!![]}];}_0xf383=_['merge']({},_0xf383,_0x41d212['options']);return db[_0xf31d('0x46')]['find'](_0xf383)[_0xf31d('0x29')](handleEntityNotFound(_0x3d4bda,null))[_0xf31d('0x29')](respondWithResult(_0x3d4bda,null))[_0xf31d('0x4b')](handleError(_0x3d4bda,null));};exports[_0xf31d('0x4f')]=function(_0x1a021b,_0x26df29){return db['OpenchannelQueue'][_0xf31d('0x4f')](_0x1a021b['body'],{})[_0xf31d('0x29')](function(_0x3f510b){var _0xa2fccd=_0x1a021b['user'][_0xf31d('0x2b')]({'plain':!![]});if(!_0xa2fccd)throw new Error(_0xf31d('0x50'));if(_0xa2fccd[_0xf31d('0x51')]==='user'){var _0x20d6e5=_0x3f510b[_0xf31d('0x2b')]({'plain':!![]});var _0x583af6=_0xf31d('0x52');return db[_0xf31d('0x53')][_0xf31d('0x54')]({'where':{'name':_0x583af6,'userProfileId':_0xa2fccd[_0xf31d('0x55')]},'raw':!![]})[_0xf31d('0x29')](function(_0xbd61ea){if(_0xbd61ea&&_0xbd61ea[_0xf31d('0x56')]===0x0){return db[_0xf31d('0x57')]['create']({'name':_0x20d6e5['name'],'resourceId':_0x20d6e5['id'],'type':_0xbd61ea[_0xf31d('0x2e')],'sectionId':_0xbd61ea['id']},{})[_0xf31d('0x29')](function(){return _0x3f510b;});}else{return _0x3f510b;}})['catch'](function(_0x34a245){logger[_0xf31d('0x2c')](_0xf31d('0x58'),_0x34a245);throw _0x34a245;});}return _0x3f510b;})['then'](respondWithResult(_0x26df29,0xc9))['catch'](handleError(_0x26df29,null));};exports[_0xf31d('0x28')]=function(_0x287eb8,_0x1ac7d7){if(_0x287eb8[_0xf31d('0x59')]['id']){delete _0x287eb8[_0xf31d('0x59')]['id'];}return db['OpenchannelQueue'][_0xf31d('0x54')]({'where':{'id':_0x287eb8[_0xf31d('0x4d')]['id']}})[_0xf31d('0x29')](handleEntityNotFound(_0x1ac7d7,null))[_0xf31d('0x29')](saveUpdates(_0x287eb8[_0xf31d('0x59')],null))[_0xf31d('0x29')](respondWithResult(_0x1ac7d7,null))['catch'](handleError(_0x1ac7d7,null));};exports[_0xf31d('0x2a')]=function(_0x46fc96,_0x4a8246){return db[_0xf31d('0x46')][_0xf31d('0x54')]({'where':{'id':_0x46fc96[_0xf31d('0x4d')]['id']}})[_0xf31d('0x29')](handleEntityNotFound(_0x4a8246,null))[_0xf31d('0x29')](removeEntity(_0x4a8246,null))[_0xf31d('0x4b')](handleError(_0x4a8246,null));};exports[_0xf31d('0x5a')]=function(_0x20f101,_0x47ae43){return db[_0xf31d('0x46')][_0xf31d('0x5a')]()[_0xf31d('0x29')](respondWithResult(_0x47ae43,null))[_0xf31d('0x4b')](handleError(_0x47ae43,null));};exports[_0xf31d('0x5b')]=function(_0x1914ee,_0x36ff17,_0x4929b5){var _0x213952={'raw':!![],'where':{}},_0x51e489={},_0x804f08;return db[_0xf31d('0x46')][_0xf31d('0x5c')]({'where':{'id':_0x1914ee[_0xf31d('0x4d')]['id']}})[_0xf31d('0x29')](handleEntityNotFound(_0x36ff17,null))[_0xf31d('0x29')](function(_0x43d92a){if(_0x43d92a){_0x804f08=_0x43d92a[_0xf31d('0x2b')]({'plain':!![]});_0x51e489[_0xf31d('0x39')]=_[_0xf31d('0x4e')](db[_0xf31d('0x5d')][_0xf31d('0x31')]);_0x51e489[_0xf31d('0x36')]=_[_0xf31d('0x4e')](_0x1914ee[_0xf31d('0x36')]);_0x51e489['filters']=_[_0xf31d('0x38')](_0x51e489[_0xf31d('0x39')],_0x51e489[_0xf31d('0x36')]);_0x213952['attributes']=_[_0xf31d('0x38')](_0x51e489[_0xf31d('0x39')],qs['fields'](_0x1914ee[_0xf31d('0x36')][_0xf31d('0x3b')]));_0x213952[_0xf31d('0x3a')]=_0x213952[_0xf31d('0x3a')]['length']?_0x213952[_0xf31d('0x3a')]:_0x51e489['model'];if(!_0x1914ee[_0xf31d('0x36')][_0xf31d('0x3d')](_0xf31d('0x3e'))){_0x213952['limit']=qs[_0xf31d('0x24')](_0x1914ee[_0xf31d('0x36')][_0xf31d('0x24')]);_0x213952[_0xf31d('0x22')]=qs[_0xf31d('0x22')](_0x1914ee[_0xf31d('0x36')][_0xf31d('0x22')]);}_0x213952[_0xf31d('0x3f')]=qs[_0xf31d('0x40')](_0x1914ee[_0xf31d('0x36')][_0xf31d('0x40')]);_0x213952[_0xf31d('0x41')]=qs[_0xf31d('0x37')](_['pick'](_0x1914ee[_0xf31d('0x36')],_0x51e489[_0xf31d('0x37')]));_0x213952['where']['OpenchannelQueueId']=_0x43d92a['id'];if(_0x1914ee[_0xf31d('0x36')][_0xf31d('0x42')]){_0x213952[_0xf31d('0x41')]=_[_0xf31d('0x44')](_0x213952[_0xf31d('0x41')],{'$or':_[_0xf31d('0x35')](_0x213952[_0xf31d('0x3a')],function(_0x138ba2){var _0x210697={};_0x210697[_0x138ba2]={'$like':'%'+_0x1914ee[_0xf31d('0x36')][_0xf31d('0x42')]+'%'};return _0x210697;})});}_0x213952=_['merge']({},_0x213952,_0x1914ee[_0xf31d('0x45')]);return db['UserOpenchannelQueue']['findAll'](_0x213952);}})[_0xf31d('0x29')](function(_0x57abdc){if(_0x57abdc){return db[_0xf31d('0x5e')][_0xf31d('0x5f')]({'where':{'id':_['map'](_0x57abdc,_0xf31d('0x60')),'role':_0xf31d('0x61')},'attributes':['id',_0xf31d('0x2e'),'openchannelPause','updatedAt','createdAt']});}})['then'](function(_0x20c370){if(_0x20c370){return{'count':_0x20c370[_0xf31d('0x25')],'rows':_[_0xf31d('0x35')](_0x20c370[_0xf31d('0x4a')],function(_0x28f353){return{'membername':_0x28f353[_0xf31d('0x2e')],'UserId':_0x28f353['id'],'queue_name':_0x804f08[_0xf31d('0x2e')],'OpenchannelQueueId':_0x804f08['id'],'interface':util[_0xf31d('0x62')]('%s/%s',_0xf31d('0x63'),_0x28f353[_0xf31d('0x2e')]),'penalty':0x0,'paused':_0x28f353[_0xf31d('0x64')],'createdAt':_0x28f353[_0xf31d('0x65')],'updatedAt':_0x28f353[_0xf31d('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf31d('0x29')](respondWithFilteredResult(_0x36ff17,_0x213952))['catch'](handleError(_0x36ff17,null));};exports[_0xf31d('0x67')]=function(_0x25e6b9,_0x11a040,_0x2e90f1){var _0x2669cb={};var _0xd63937={};var _0x46aede;var _0x138544;return db['OpenchannelQueue'][_0xf31d('0x5c')]({'where':{'id':_0x25e6b9[_0xf31d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x11a040,null))[_0xf31d('0x29')](function(_0x1ff75e){if(_0x1ff75e){_0x46aede=_0x1ff75e;_0xd63937[_0xf31d('0x39')]=_[_0xf31d('0x4e')](db[_0xf31d('0x68')][_0xf31d('0x31')]);_0xd63937[_0xf31d('0x36')]=_[_0xf31d('0x4e')](_0x25e6b9[_0xf31d('0x36')]);_0xd63937[_0xf31d('0x37')]=_[_0xf31d('0x38')](_0xd63937[_0xf31d('0x39')],_0xd63937['query']);_0x2669cb[_0xf31d('0x3a')]=_[_0xf31d('0x38')](_0xd63937[_0xf31d('0x39')],qs['fields'](_0x25e6b9[_0xf31d('0x36')][_0xf31d('0x3b')]));_0x2669cb[_0xf31d('0x3a')]=_0x2669cb[_0xf31d('0x3a')]['length']?_0x2669cb[_0xf31d('0x3a')]:_0xd63937[_0xf31d('0x39')];_0x2669cb[_0xf31d('0x3f')]=qs[_0xf31d('0x40')](_0x25e6b9[_0xf31d('0x36')][_0xf31d('0x40')]);_0x2669cb[_0xf31d('0x41')]=qs[_0xf31d('0x37')](_['pick'](_0x25e6b9[_0xf31d('0x36')],_0xd63937[_0xf31d('0x37')]));if(_0x25e6b9[_0xf31d('0x36')][_0xf31d('0x42')]){_0x2669cb['where']=_[_0xf31d('0x44')](_0x2669cb[_0xf31d('0x41')],{'$or':_['map'](_0x2669cb[_0xf31d('0x3a')],function(_0x59a285){var _0x157b33={};_0x157b33[_0x59a285]={'$like':'%'+_0x25e6b9[_0xf31d('0x36')][_0xf31d('0x42')]+'%'};return _0x157b33;})});}_0x2669cb=_[_0xf31d('0x44')]({},_0x2669cb,_0x25e6b9[_0xf31d('0x45')]);return _0x46aede[_0xf31d('0x67')](_0x2669cb);}})[_0xf31d('0x29')](function(_0x355286){if(_0x355286){_0x138544=_0x355286[_0xf31d('0x3c')];if(!_0x25e6b9[_0xf31d('0x36')][_0xf31d('0x3d')]('nolimit')){_0x2669cb[_0xf31d('0x24')]=qs['limit'](_0x25e6b9[_0xf31d('0x36')]['limit']);_0x2669cb['offset']=qs[_0xf31d('0x22')](_0x25e6b9['query'][_0xf31d('0x22')]);}return _0x46aede[_0xf31d('0x67')](_0x2669cb);}})[_0xf31d('0x29')](function(_0x541aad){if(_0x541aad){return _0x541aad?{'count':_0x138544,'rows':_0x541aad}:null;}})[_0xf31d('0x29')](respondWithResult(_0x11a040,null))[_0xf31d('0x4b')](handleError(_0x11a040,null));};exports['addTeams']=function(_0xe76bdd,_0x1950d1,_0x2b852e){var _0xba1382=_0xe76bdd[_0xf31d('0x59')][_0xf31d('0x69')];return db[_0xf31d('0x68')][_0xf31d('0x49')]({'where':{'id':_0xba1382},'attributes':['id'],'include':[{'model':db[_0xf31d('0x5e')],'as':_0xf31d('0x6a'),'attributes':['id',_0xf31d('0x2e'),_0xf31d('0x6b'),_0xf31d('0x6c'),'interface'],'raw':!![]}]})[_0xf31d('0x29')](function(_0x4ded15){if(_0x4ded15){var _0x5d7ef2=_[_0xf31d('0x6d')](_0x4ded15,function(_0x2b156f){var _0x2e2fc7=_0x2b156f['get']({'plain':!![]});return _0x2e2fc7[_0xf31d('0x6a')];});return db[_0xf31d('0x46')][_0xf31d('0x54')]({'where':{'id':_0xe76bdd['params']['id']}})['then'](function(_0x4c7368){return db[_0xf31d('0x6e')][_0xf31d('0x6f')](function(_0x7a36fa){return _0x4c7368[_0xf31d('0x70')](_0xba1382,{'transaction':_0x7a36fa})[_0xf31d('0x29')](function(){return BPromise[_0xf31d('0x71')](_0x5d7ef2,function(_0x3ea8c9){return db[_0xf31d('0x5d')][_0xf31d('0x72')]({'where':{'UserId':_0x3ea8c9['id'],'OpenchannelQueueId':_0xe76bdd[_0xf31d('0x4d')]['id']},'transaction':_0x7a36fa});});})[_0xf31d('0x29')](function(){_0x5d7ef2[_0xf31d('0x73')](function(_0x5bb80b){socket[_0xf31d('0x74')](_0xf31d('0x75'),{'UserId':_0x5bb80b['id'],'OpenchannelQueueId':_0x4c7368['id']});});});});});}})['then'](respondWithStatusCode(_0x1950d1,null))[_0xf31d('0x4b')](handleError(_0x1950d1,null));};exports[_0xf31d('0x76')]=function(_0x3058c4,_0x4e4808,_0x28946f){return db['Team'][_0xf31d('0x49')]({'where':{'id':_0x3058c4[_0xf31d('0x36')][_0xf31d('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf31d('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xf31d('0x29')](handleEntityNotFound(_0x4e4808,null))[_0xf31d('0x29')](function(_0x4164e4){var _0x3b6a6e=_[_0xf31d('0x35')](_0x4164e4,'id');var _0x1f32d6=[];var _0x564b9e=[];var _0xdab7fa=squel[_0xf31d('0x77')]();_0xdab7fa[_0xf31d('0x78')](_0xf31d('0x79'))[_0xf31d('0x7a')](_0xf31d('0x7b'),'tq')[_0xf31d('0x7c')](_0xf31d('0x7d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf31d('0x41')](_0xf31d('0x7e'),_0x3058c4[_0xf31d('0x4d')]['id']);for(var _0x5824ca=0x0;_0x5824ca<_0x4164e4[_0xf31d('0x3c')];_0x5824ca+=0x1){let _0x29acc4=_0x4164e4[_0x5824ca];for(var _0x11f7a9=0x0;_0x11f7a9<_0x29acc4['Agents'][_0xf31d('0x3c')];_0x11f7a9+=0x1){let _0x203741=_0x29acc4[_0xf31d('0x6a')][_0x11f7a9];var _0x3403ba=_0xdab7fa[_0xf31d('0x7f')]();_0x3403ba[_0xf31d('0x41')](_0xf31d('0x80'),_0x203741['id']);_0x564b9e[_0xf31d('0x81')](db['sequelize'][_0xf31d('0x36')](_0x3403ba[_0xf31d('0x82')](),{'type':db['sequelize'][_0xf31d('0x83')]['SELECT']})[_0xf31d('0x29')](function(_0x2ee957){if(_0x2ee957[_0xf31d('0x3c')]===0x1){return _0x203741['id'];}else{var _0x2747e7=_[_0xf31d('0x84')](_[_0xf31d('0x35')](_0x2ee957,_0xf31d('0x85')),function(_0x1f5cd1){return _[_0xf31d('0x86')](_0x3b6a6e,_0x1f5cd1);});if(_0x2747e7){return _0x203741['id'];}}}));}}return BPromise[_0xf31d('0x87')](_0x564b9e)[_0xf31d('0x29')](function(_0x77e3a6){_0x1f32d6=_(_0x1f32d6)['union'](_0x77e3a6)[_0xf31d('0x88')]()['value']();return db[_0xf31d('0x46')][_0xf31d('0x54')]({'where':{'id':_0x3058c4['params']['id']}})['then'](function(_0x3069e9){return db['sequelize'][_0xf31d('0x6f')](function(_0x5d6146){return _0x3069e9[_0xf31d('0x76')](_0x3058c4['query'][_0xf31d('0x69')],{'transaction':_0x5d6146})[_0xf31d('0x29')](function(){if(!_['isEmpty'](_0x1f32d6)){return _0x3069e9[_0xf31d('0x89')](_0x1f32d6,{'transaction':_0x5d6146});}})[_0xf31d('0x29')](function(){_0x1f32d6[_0xf31d('0x73')](function(_0x127502){socket[_0xf31d('0x74')](_0xf31d('0x8a'),{'UserId':_0x127502,'OpenchannelQueueId':_0x3069e9['id']});});});});});});})[_0xf31d('0x29')](respondWithStatusCode(_0x4e4808,null))[_0xf31d('0x4b')](handleError(_0x4e4808,null));};exports['addAgents']=function(_0x501508,_0x42b65b,_0x1beb81){return db[_0xf31d('0x46')][_0xf31d('0x54')]({'where':{'id':_0x501508[_0xf31d('0x4d')]['id']}})[_0xf31d('0x29')](handleEntityNotFound(_0x42b65b,null))[_0xf31d('0x29')](function(_0x39f7eb){if(_0x39f7eb){return _0x39f7eb[_0xf31d('0x8b')](_0x501508['body'][_0xf31d('0x69')],_[_0xf31d('0x8c')](_0x501508[_0xf31d('0x59')],[_0xf31d('0x69'),'id'])||{})['spread'](function(_0x9a16ca){for(var _0x36aeb6=0x0;_0x36aeb6<_0x501508[_0xf31d('0x59')]['ids'][_0xf31d('0x3c')];_0x36aeb6+=0x1){socket['emit'](_0xf31d('0x75'),{'UserId':Number(_0x501508[_0xf31d('0x59')][_0xf31d('0x69')][_0x36aeb6]),'OpenchannelQueueId':Number(_0x501508[_0xf31d('0x4d')]['id'])});}return _0x9a16ca;});}})[_0xf31d('0x29')](respondWithResult(_0x42b65b,null))[_0xf31d('0x4b')](handleError(_0x42b65b,null));};exports['removeAgents']=function(_0xdfebac,_0x151a2d,_0xfbefce){return db[_0xf31d('0x46')][_0xf31d('0x54')]({'where':{'id':_0xdfebac[_0xf31d('0x4d')]['id']}})[_0xf31d('0x29')](handleEntityNotFound(_0x151a2d,null))[_0xf31d('0x29')](function(_0x2edb61){if(_0x2edb61){return _0x2edb61[_0xf31d('0x89')](_0xdfebac[_0xf31d('0x36')][_0xf31d('0x69')])[_0xf31d('0x29')](function(){if(_[_0xf31d('0x8d')](_0xdfebac['query']['ids'])){for(var _0x3d2de8=0x0;_0x3d2de8<_0xdfebac[_0xf31d('0x36')][_0xf31d('0x69')][_0xf31d('0x3c')];_0x3d2de8+=0x1){socket[_0xf31d('0x74')]('userOpenchannelQueue:remove',{'UserId':Number(_0xdfebac[_0xf31d('0x36')][_0xf31d('0x69')][_0x3d2de8]),'OpenchannelQueueId':Number(_0xdfebac['params']['id'])});}}else{socket[_0xf31d('0x74')](_0xf31d('0x8a'),{'UserId':Number(_0xdfebac[_0xf31d('0x36')][_0xf31d('0x69')]),'OpenchannelQueueId':Number(_0xdfebac['params']['id'])});}});}})['then'](respondWithStatusCode(_0x151a2d,null))[_0xf31d('0x4b')](handleError(_0x151a2d,null));};exports[_0xf31d('0x8e')]=function(_0x5e24c0,_0x15bbe1,_0x3b575f){var _0x5b2177={};var _0x2b7fcf={};var _0x3ffc66;var _0x2be66a;return db[_0xf31d('0x46')]['findOne']({'where':{'id':_0x5e24c0[_0xf31d('0x4d')]['id']}})[_0xf31d('0x29')](handleEntityNotFound(_0x15bbe1,null))[_0xf31d('0x29')](function(_0x5ea3e4){if(_0x5ea3e4){_0x3ffc66=_0x5ea3e4;_0x2b7fcf[_0xf31d('0x39')]=_['keys'](db['User'][_0xf31d('0x31')]);_0x2b7fcf[_0xf31d('0x36')]=_['keys'](_0x5e24c0['query']);_0x2b7fcf['filters']=_[_0xf31d('0x38')](_0x2b7fcf[_0xf31d('0x39')],_0x2b7fcf['query']);_0x5b2177[_0xf31d('0x3a')]=_[_0xf31d('0x38')](_0x2b7fcf[_0xf31d('0x39')],qs[_0xf31d('0x3b')](_0x5e24c0[_0xf31d('0x36')][_0xf31d('0x3b')]));_0x5b2177[_0xf31d('0x3a')]=_0x5b2177['attributes'][_0xf31d('0x3c')]?_0x5b2177['attributes']:_0x2b7fcf[_0xf31d('0x39')];_0x5b2177[_0xf31d('0x3f')]=qs[_0xf31d('0x40')](_0x5e24c0['query']['sort']);_0x5b2177[_0xf31d('0x41')]=qs[_0xf31d('0x37')](_[_0xf31d('0x8f')](_0x5e24c0['query'],_0x2b7fcf[_0xf31d('0x37')]));if(_0x5e24c0[_0xf31d('0x36')][_0xf31d('0x42')]){_0x5b2177[_0xf31d('0x41')]=_[_0xf31d('0x44')](_0x5b2177[_0xf31d('0x41')],{'$or':_[_0xf31d('0x35')](_0x5b2177[_0xf31d('0x3a')],function(_0x19aa6f){var _0x3f0437={};_0x3f0437[_0x19aa6f]={'$like':'%'+_0x5e24c0[_0xf31d('0x36')][_0xf31d('0x42')]+'%'};return _0x3f0437;})});}_0x5b2177=_['merge']({},_0x5b2177,_0x5e24c0[_0xf31d('0x45')]);return _0x3ffc66['getAgents'](_0x5b2177);}})[_0xf31d('0x29')](function(_0x3d8ca3){if(_0x3d8ca3){_0x2be66a=_0x3d8ca3[_0xf31d('0x3c')];if(!_0x5e24c0[_0xf31d('0x36')]['hasOwnProperty']('nolimit')){_0x5b2177[_0xf31d('0x24')]=qs[_0xf31d('0x24')](_0x5e24c0[_0xf31d('0x36')][_0xf31d('0x24')]);_0x5b2177[_0xf31d('0x22')]=qs[_0xf31d('0x22')](_0x5e24c0[_0xf31d('0x36')]['offset']);}return _0x3ffc66[_0xf31d('0x8e')](_0x5b2177);}})[_0xf31d('0x29')](function(_0xe38870){if(_0xe38870){return _0xe38870?{'count':_0x2be66a,'rows':_0xe38870}:null;}})['then'](respondWithResult(_0x15bbe1,null))[_0xf31d('0x4b')](handleError(_0x15bbe1,null));}; \ No newline at end of file +var _0x7f37=['isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','get','OpenchannelQueues','destroy','error','stack','name','send','map','OpenchannelQueue','rawAttributes','type','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','fields','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','options','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','hasOwnProperty','getTeams','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','Team','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','value','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread'];(function(_0x113696,_0x1843cc){var _0x1fb234=function(_0x5f1185){while(--_0x5f1185){_0x113696['push'](_0x113696['shift']());}};_0x1fb234(++_0x1843cc);}(_0x7f37,0x11e));var _0x77f3=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7f37[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x77f3('0x0'));var rimraf=require(_0x77f3('0x1'));var zipdir=require(_0x77f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x77f3('0x3'));var moment=require(_0x77f3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x77f3('0x5'));var path=require(_0x77f3('0x6'));var sox=require('sox');var csv=require(_0x77f3('0x7'));var ejs=require(_0x77f3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77f3('0x9'));var squel=require(_0x77f3('0xa'));var crypto=require(_0x77f3('0xb'));var jsforce=require(_0x77f3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x77f3('0x7'));var querystring=require(_0x77f3('0xd'));var Papa=require('papaparse');var Redis=require(_0x77f3('0xe'));var authService=require(_0x77f3('0xf'));var qs=require(_0x77f3('0x10'));var as=require(_0x77f3('0x11'));var hardwareService=require(_0x77f3('0x12'));var logger=require('../../config/logger')(_0x77f3('0x13'));var utils=require(_0x77f3('0x14'));var config=require(_0x77f3('0x15'));var licenseUtil=require(_0x77f3('0x16'));var db=require(_0x77f3('0x17'))['db'];config[_0x77f3('0x18')]=_[_0x77f3('0x19')](config['redis'],{'host':_0x77f3('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x77f3('0x1b')](socket);function respondWithStatusCode(_0x5e5b18,_0x4cd526){_0x4cd526=_0x4cd526||0xcc;return function(_0x1c8b98){if(_0x1c8b98){return _0x5e5b18[_0x77f3('0x1c')](_0x4cd526);}return _0x5e5b18[_0x77f3('0x1d')](_0x4cd526)[_0x77f3('0x1e')]();};}function respondWithResult(_0x4effd5,_0x2a6d16){_0x2a6d16=_0x2a6d16||0xc8;return function(_0x875398){if(_0x875398){return _0x4effd5[_0x77f3('0x1d')](_0x2a6d16)[_0x77f3('0x1f')](_0x875398);}};}function respondWithFilteredResult(_0x37d185,_0x462614){return function(_0x27aa86){if(_0x27aa86){var _0x4896a2=typeof _0x462614['offset']===_0x77f3('0x20')&&typeof _0x462614[_0x77f3('0x21')]==='undefined';var _0x11ddc6=_0x27aa86[_0x77f3('0x22')];var _0x3b711a=_0x4896a2?0x0:_0x462614[_0x77f3('0x23')];var _0xb12282=_0x4896a2?_0x27aa86['count']:_0x462614[_0x77f3('0x23')]+_0x462614['limit'];var _0x494cfc;if(_0xb12282>=_0x11ddc6){_0xb12282=_0x11ddc6;_0x494cfc=0xc8;}else{_0x494cfc=0xce;}_0x37d185[_0x77f3('0x1d')](_0x494cfc);return _0x37d185[_0x77f3('0x24')]('Content-Range',_0x3b711a+'-'+_0xb12282+'/'+_0x11ddc6)[_0x77f3('0x1f')](_0x27aa86);}return null;};}function patchUpdates(_0x5573ba){return function(_0x4346c7){try{jsonpatch[_0x77f3('0x25')](_0x4346c7,_0x5573ba,!![]);}catch(_0x3ba5a3){return BPromise['reject'](_0x3ba5a3);}return _0x4346c7[_0x77f3('0x26')]();};}function saveUpdates(_0x4af7f1,_0x561b49){return function(_0x355ef3){if(_0x355ef3){return _0x355ef3[_0x77f3('0x27')](_0x4af7f1)[_0x77f3('0x28')](function(_0x417792){return _0x417792;});}return null;};}function removeEntity(_0x43a772,_0xeaa837){return function(_0xba85b5){if(_0xba85b5){return _0xba85b5['destroy']()[_0x77f3('0x28')](function(){var _0x46c3b8=_0xba85b5[_0x77f3('0x29')]({'plain':!![]});var _0x557d27=_0x77f3('0x2a');return db['UserProfileResource'][_0x77f3('0x2b')]({'where':{'type':_0x557d27,'resourceId':_0x46c3b8['id']}})[_0x77f3('0x28')](function(){return _0xba85b5;});})[_0x77f3('0x28')](function(){_0x43a772['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x377b30,_0x2f8af1){return function(_0x50481c){if(!_0x50481c){_0x377b30['sendStatus'](0x194);}return _0x50481c;};}function handleError(_0x8cf006,_0x1d1181){_0x1d1181=_0x1d1181||0x1f4;return function(_0x2a0f0a){logger[_0x77f3('0x2c')](_0x2a0f0a[_0x77f3('0x2d')]);if(_0x2a0f0a[_0x77f3('0x2e')]){delete _0x2a0f0a[_0x77f3('0x2e')];}_0x8cf006[_0x77f3('0x1d')](_0x1d1181)[_0x77f3('0x2f')](_0x2a0f0a);};}exports['index']=function(_0x2cf0fd,_0xd7143b){var _0x1f73c9={},_0x7fc644={},_0x2f19f0={'count':0x0,'rows':[]};var _0x3df3ff=_[_0x77f3('0x30')](db[_0x77f3('0x31')][_0x77f3('0x32')],function(_0x2bfafc){return{'name':_0x2bfafc['fieldName'],'type':_0x2bfafc[_0x77f3('0x33')][_0x77f3('0x34')]};});_0x7fc644[_0x77f3('0x35')]=_['map'](_0x3df3ff,'name');_0x7fc644[_0x77f3('0x36')]=_[_0x77f3('0x37')](_0x2cf0fd[_0x77f3('0x36')]);_0x7fc644['filters']=_[_0x77f3('0x38')](_0x7fc644[_0x77f3('0x35')],_0x7fc644[_0x77f3('0x36')]);_0x1f73c9['attributes']=_[_0x77f3('0x38')](_0x7fc644[_0x77f3('0x35')],qs['fields'](_0x2cf0fd[_0x77f3('0x36')]['fields']));_0x1f73c9[_0x77f3('0x39')]=_0x1f73c9[_0x77f3('0x39')][_0x77f3('0x3a')]?_0x1f73c9[_0x77f3('0x39')]:_0x7fc644[_0x77f3('0x35')];if(!_0x2cf0fd[_0x77f3('0x36')]['hasOwnProperty'](_0x77f3('0x3b'))){_0x1f73c9['limit']=qs[_0x77f3('0x21')](_0x2cf0fd[_0x77f3('0x36')]['limit']);_0x1f73c9['offset']=qs['offset'](_0x2cf0fd['query']['offset']);}_0x1f73c9[_0x77f3('0x3c')]=qs[_0x77f3('0x3d')](_0x2cf0fd[_0x77f3('0x36')]['sort']);_0x1f73c9['where']=qs[_0x77f3('0x3e')](_[_0x77f3('0x3f')](_0x2cf0fd[_0x77f3('0x36')],_0x7fc644[_0x77f3('0x3e')]),_0x3df3ff);if(_0x2cf0fd[_0x77f3('0x36')][_0x77f3('0x40')]){_0x1f73c9[_0x77f3('0x41')]=_[_0x77f3('0x42')](_0x1f73c9['where'],{'$or':_[_0x77f3('0x30')](_0x3df3ff,function(_0x14a0d6){if(_0x14a0d6['type']!==_0x77f3('0x43')){var _0x441799={};_0x441799[_0x14a0d6[_0x77f3('0x2e')]]={'$like':'%'+_0x2cf0fd[_0x77f3('0x36')][_0x77f3('0x40')]+'%'};return _0x441799;}})});}_0x1f73c9=_[_0x77f3('0x42')]({},_0x1f73c9,_0x2cf0fd['options']);var _0xa6ee10={'where':_0x1f73c9['where']};return db[_0x77f3('0x31')][_0x77f3('0x22')](_0xa6ee10)[_0x77f3('0x28')](function(_0x1307b6){_0x2f19f0['count']=_0x1307b6;if(_0x2cf0fd['query'][_0x77f3('0x44')]){_0x1f73c9[_0x77f3('0x45')]=[{'all':!![]}];}return db[_0x77f3('0x31')][_0x77f3('0x46')](_0x1f73c9);})[_0x77f3('0x28')](function(_0xd3b160){_0x2f19f0[_0x77f3('0x47')]=_0xd3b160;return _0x2f19f0;})[_0x77f3('0x28')](respondWithFilteredResult(_0xd7143b,_0x1f73c9))[_0x77f3('0x48')](handleError(_0xd7143b,null));};exports['show']=function(_0x350358,_0x49db8f){var _0x3ec6af={'raw':!![],'where':{'id':_0x350358[_0x77f3('0x49')]['id']}},_0x278a61={};_0x278a61[_0x77f3('0x35')]=_[_0x77f3('0x37')](db[_0x77f3('0x31')][_0x77f3('0x32')]);_0x278a61['query']=_[_0x77f3('0x37')](_0x350358[_0x77f3('0x36')]);_0x278a61[_0x77f3('0x3e')]=_['intersection'](_0x278a61['model'],_0x278a61[_0x77f3('0x36')]);_0x3ec6af[_0x77f3('0x39')]=_['intersection'](_0x278a61[_0x77f3('0x35')],qs[_0x77f3('0x4a')](_0x350358[_0x77f3('0x36')][_0x77f3('0x4a')]));_0x3ec6af[_0x77f3('0x39')]=_0x3ec6af[_0x77f3('0x39')][_0x77f3('0x3a')]?_0x3ec6af['attributes']:_0x278a61[_0x77f3('0x35')];if(_0x350358[_0x77f3('0x36')][_0x77f3('0x44')]){_0x3ec6af['include']=[{'all':!![]}];}_0x3ec6af=_['merge']({},_0x3ec6af,_0x350358['options']);return db[_0x77f3('0x31')]['find'](_0x3ec6af)[_0x77f3('0x28')](handleEntityNotFound(_0x49db8f,null))[_0x77f3('0x28')](respondWithResult(_0x49db8f,null))[_0x77f3('0x48')](handleError(_0x49db8f,null));};exports[_0x77f3('0x4b')]=function(_0x23ca7a,_0x285671){return db[_0x77f3('0x31')][_0x77f3('0x4b')](_0x23ca7a[_0x77f3('0x4c')],{})[_0x77f3('0x28')](function(_0x2c7bfe){var _0x235478=_0x23ca7a['user'][_0x77f3('0x29')]({'plain':!![]});if(!_0x235478)throw new Error(_0x77f3('0x4d'));if(_0x235478[_0x77f3('0x4e')]===_0x77f3('0x4f')){var _0x5af173=_0x2c7bfe['get']({'plain':!![]});var _0x562f23=_0x77f3('0x2a');return db[_0x77f3('0x50')][_0x77f3('0x51')]({'where':{'name':_0x562f23,'userProfileId':_0x235478[_0x77f3('0x52')]},'raw':!![]})['then'](function(_0x319cbb){if(_0x319cbb&&_0x319cbb[_0x77f3('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x5af173[_0x77f3('0x2e')],'resourceId':_0x5af173['id'],'type':_0x319cbb[_0x77f3('0x2e')],'sectionId':_0x319cbb['id']},{})[_0x77f3('0x28')](function(){return _0x2c7bfe;});}else{return _0x2c7bfe;}})[_0x77f3('0x48')](function(_0x3927de){logger[_0x77f3('0x2c')](_0x77f3('0x54'),_0x3927de);throw _0x3927de;});}return _0x2c7bfe;})['then'](respondWithResult(_0x285671,0xc9))['catch'](handleError(_0x285671,null));};exports[_0x77f3('0x27')]=function(_0x53105d,_0xb2379b){if(_0x53105d[_0x77f3('0x4c')]['id']){delete _0x53105d[_0x77f3('0x4c')]['id'];}return db['OpenchannelQueue'][_0x77f3('0x51')]({'where':{'id':_0x53105d[_0x77f3('0x49')]['id']}})[_0x77f3('0x28')](handleEntityNotFound(_0xb2379b,null))[_0x77f3('0x28')](saveUpdates(_0x53105d[_0x77f3('0x4c')],null))['then'](respondWithResult(_0xb2379b,null))[_0x77f3('0x48')](handleError(_0xb2379b,null));};exports[_0x77f3('0x2b')]=function(_0x2c8ad0,_0x150c1b){return db[_0x77f3('0x31')][_0x77f3('0x51')]({'where':{'id':_0x2c8ad0[_0x77f3('0x49')]['id']}})[_0x77f3('0x28')](handleEntityNotFound(_0x150c1b,null))[_0x77f3('0x28')](removeEntity(_0x150c1b,null))[_0x77f3('0x48')](handleError(_0x150c1b,null));};exports['describe']=function(_0x37a855,_0x264c30){return db[_0x77f3('0x31')][_0x77f3('0x55')]()[_0x77f3('0x28')](respondWithResult(_0x264c30,null))[_0x77f3('0x48')](handleError(_0x264c30,null));};exports[_0x77f3('0x56')]=function(_0x26010a,_0x508a9e,_0x4bac59){var _0x4f7521={'raw':!![],'where':{}},_0x343ccc={},_0x33f364;return db['OpenchannelQueue'][_0x77f3('0x57')]({'where':{'id':_0x26010a[_0x77f3('0x49')]['id']}})[_0x77f3('0x28')](handleEntityNotFound(_0x508a9e,null))['then'](function(_0x1b432b){if(_0x1b432b){_0x33f364=_0x1b432b['get']({'plain':!![]});_0x343ccc['model']=_[_0x77f3('0x37')](db[_0x77f3('0x58')][_0x77f3('0x32')]);_0x343ccc[_0x77f3('0x36')]=_[_0x77f3('0x37')](_0x26010a['query']);_0x343ccc[_0x77f3('0x3e')]=_[_0x77f3('0x38')](_0x343ccc[_0x77f3('0x35')],_0x343ccc['query']);_0x4f7521['attributes']=_[_0x77f3('0x38')](_0x343ccc['model'],qs['fields'](_0x26010a[_0x77f3('0x36')]['fields']));_0x4f7521[_0x77f3('0x39')]=_0x4f7521['attributes'][_0x77f3('0x3a')]?_0x4f7521[_0x77f3('0x39')]:_0x343ccc[_0x77f3('0x35')];if(!_0x26010a[_0x77f3('0x36')]['hasOwnProperty']('nolimit')){_0x4f7521[_0x77f3('0x21')]=qs[_0x77f3('0x21')](_0x26010a['query'][_0x77f3('0x21')]);_0x4f7521[_0x77f3('0x23')]=qs['offset'](_0x26010a['query']['offset']);}_0x4f7521[_0x77f3('0x3c')]=qs[_0x77f3('0x3d')](_0x26010a[_0x77f3('0x36')]['sort']);_0x4f7521['where']=qs[_0x77f3('0x3e')](_[_0x77f3('0x3f')](_0x26010a[_0x77f3('0x36')],_0x343ccc[_0x77f3('0x3e')]));_0x4f7521[_0x77f3('0x41')]['OpenchannelQueueId']=_0x1b432b['id'];if(_0x26010a['query'][_0x77f3('0x40')]){_0x4f7521[_0x77f3('0x41')]=_['merge'](_0x4f7521[_0x77f3('0x41')],{'$or':_[_0x77f3('0x30')](_0x4f7521['attributes'],function(_0x473c15){var _0x1cfb49={};_0x1cfb49[_0x473c15]={'$like':'%'+_0x26010a[_0x77f3('0x36')]['filter']+'%'};return _0x1cfb49;})});}_0x4f7521=_[_0x77f3('0x42')]({},_0x4f7521,_0x26010a[_0x77f3('0x59')]);return db['UserOpenchannelQueue']['findAll'](_0x4f7521);}})[_0x77f3('0x28')](function(_0x66965){if(_0x66965){return db[_0x77f3('0x5a')][_0x77f3('0x5b')]({'where':{'id':_[_0x77f3('0x30')](_0x66965,_0x77f3('0x5c')),'role':_0x77f3('0x5d')},'attributes':['id','name',_0x77f3('0x5e'),_0x77f3('0x5f'),_0x77f3('0x60')]});}})[_0x77f3('0x28')](function(_0x42ccee){if(_0x42ccee){return{'count':_0x42ccee[_0x77f3('0x22')],'rows':_[_0x77f3('0x30')](_0x42ccee[_0x77f3('0x47')],function(_0x3fa047){return{'membername':_0x3fa047[_0x77f3('0x2e')],'UserId':_0x3fa047['id'],'queue_name':_0x33f364[_0x77f3('0x2e')],'OpenchannelQueueId':_0x33f364['id'],'interface':util[_0x77f3('0x61')](_0x77f3('0x62'),_0x77f3('0x63'),_0x3fa047[_0x77f3('0x2e')]),'penalty':0x0,'paused':_0x3fa047[_0x77f3('0x5e')],'createdAt':_0x3fa047[_0x77f3('0x60')],'updatedAt':_0x3fa047[_0x77f3('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x77f3('0x28')](respondWithFilteredResult(_0x508a9e,_0x4f7521))[_0x77f3('0x48')](handleError(_0x508a9e,null));};exports['getTeams']=function(_0x5bf7bd,_0x5a08b9,_0x2d7c45){var _0x37ea16={};var _0x18bb0a={};var _0x43a102;var _0x473425;return db['OpenchannelQueue'][_0x77f3('0x57')]({'where':{'id':_0x5bf7bd['params']['id']}})[_0x77f3('0x28')](handleEntityNotFound(_0x5a08b9,null))['then'](function(_0x4a2eba){if(_0x4a2eba){_0x43a102=_0x4a2eba;_0x18bb0a[_0x77f3('0x35')]=_[_0x77f3('0x37')](db['Team']['rawAttributes']);_0x18bb0a[_0x77f3('0x36')]=_[_0x77f3('0x37')](_0x5bf7bd[_0x77f3('0x36')]);_0x18bb0a[_0x77f3('0x3e')]=_[_0x77f3('0x38')](_0x18bb0a[_0x77f3('0x35')],_0x18bb0a[_0x77f3('0x36')]);_0x37ea16[_0x77f3('0x39')]=_[_0x77f3('0x38')](_0x18bb0a[_0x77f3('0x35')],qs[_0x77f3('0x4a')](_0x5bf7bd[_0x77f3('0x36')][_0x77f3('0x4a')]));_0x37ea16[_0x77f3('0x39')]=_0x37ea16[_0x77f3('0x39')][_0x77f3('0x3a')]?_0x37ea16[_0x77f3('0x39')]:_0x18bb0a[_0x77f3('0x35')];_0x37ea16[_0x77f3('0x3c')]=qs['sort'](_0x5bf7bd[_0x77f3('0x36')][_0x77f3('0x3d')]);_0x37ea16['where']=qs[_0x77f3('0x3e')](_['pick'](_0x5bf7bd[_0x77f3('0x36')],_0x18bb0a[_0x77f3('0x3e')]));if(_0x5bf7bd[_0x77f3('0x36')][_0x77f3('0x40')]){_0x37ea16[_0x77f3('0x41')]=_[_0x77f3('0x42')](_0x37ea16['where'],{'$or':_[_0x77f3('0x30')](_0x37ea16[_0x77f3('0x39')],function(_0x56f449){var _0x11da18={};_0x11da18[_0x56f449]={'$like':'%'+_0x5bf7bd[_0x77f3('0x36')][_0x77f3('0x40')]+'%'};return _0x11da18;})});}_0x37ea16=_[_0x77f3('0x42')]({},_0x37ea16,_0x5bf7bd[_0x77f3('0x59')]);return _0x43a102['getTeams'](_0x37ea16);}})['then'](function(_0x34899a){if(_0x34899a){_0x473425=_0x34899a[_0x77f3('0x3a')];if(!_0x5bf7bd['query'][_0x77f3('0x64')](_0x77f3('0x3b'))){_0x37ea16['limit']=qs[_0x77f3('0x21')](_0x5bf7bd[_0x77f3('0x36')][_0x77f3('0x21')]);_0x37ea16[_0x77f3('0x23')]=qs[_0x77f3('0x23')](_0x5bf7bd[_0x77f3('0x36')]['offset']);}return _0x43a102[_0x77f3('0x65')](_0x37ea16);}})['then'](function(_0x4f3eca){if(_0x4f3eca){return _0x4f3eca?{'count':_0x473425,'rows':_0x4f3eca}:null;}})[_0x77f3('0x28')](respondWithResult(_0x5a08b9,null))[_0x77f3('0x48')](handleError(_0x5a08b9,null));};exports[_0x77f3('0x66')]=function(_0x5cf16c,_0x26286c,_0x42432e){var _0x57d459=_0x5cf16c[_0x77f3('0x4c')][_0x77f3('0x67')];return db['Team'][_0x77f3('0x46')]({'where':{'id':_0x57d459},'attributes':['id'],'include':[{'model':db[_0x77f3('0x5a')],'as':_0x77f3('0x68'),'attributes':['id',_0x77f3('0x2e'),_0x77f3('0x69'),_0x77f3('0x6a'),'interface'],'raw':!![]}]})[_0x77f3('0x28')](function(_0x5847c0){if(_0x5847c0){var _0x4ca061=_[_0x77f3('0x6b')](_0x5847c0,function(_0x4a5ddc){var _0x50da07=_0x4a5ddc['get']({'plain':!![]});return _0x50da07['Agents'];});return db[_0x77f3('0x31')]['find']({'where':{'id':_0x5cf16c[_0x77f3('0x49')]['id']}})[_0x77f3('0x28')](function(_0x4a10c8){return db[_0x77f3('0x6c')][_0x77f3('0x6d')](function(_0xffbef2){return _0x4a10c8[_0x77f3('0x66')](_0x57d459,{'transaction':_0xffbef2})[_0x77f3('0x28')](function(){return BPromise[_0x77f3('0x6e')](_0x4ca061,function(_0x4d89a7){return db[_0x77f3('0x58')][_0x77f3('0x6f')]({'where':{'UserId':_0x4d89a7['id'],'OpenchannelQueueId':_0x5cf16c[_0x77f3('0x49')]['id']},'transaction':_0xffbef2});});})[_0x77f3('0x28')](function(){_0x4ca061['forEach'](function(_0x1f51bc){socket[_0x77f3('0x70')](_0x77f3('0x71'),{'UserId':_0x1f51bc['id'],'OpenchannelQueueId':_0x4a10c8['id']});});});});});}})[_0x77f3('0x28')](respondWithStatusCode(_0x26286c,null))[_0x77f3('0x48')](handleError(_0x26286c,null));};exports['removeTeams']=function(_0x1355c0,_0x3446ed,_0x7af9a0){return db[_0x77f3('0x72')]['findAll']({'where':{'id':_0x1355c0[_0x77f3('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x77f3('0x5a')],'as':_0x77f3('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3446ed,null))[_0x77f3('0x28')](function(_0x17ce29){var _0xf66f8=_[_0x77f3('0x30')](_0x17ce29,'id');var _0x324f54=[];var _0x35f242=[];var _0x5039bf=squel[_0x77f3('0x73')]();_0x5039bf[_0x77f3('0x74')]('tq.TeamId')[_0x77f3('0x75')](_0x77f3('0x76'),'tq')[_0x77f3('0x77')](_0x77f3('0x78'),'ut',_0x77f3('0x79'))[_0x77f3('0x41')](_0x77f3('0x7a'),_0x1355c0['params']['id']);for(var _0x130536=0x0;_0x130536<_0x17ce29[_0x77f3('0x3a')];_0x130536+=0x1){let _0x1c866c=_0x17ce29[_0x130536];for(var _0x41cd18=0x0;_0x41cd18<_0x1c866c['Agents'][_0x77f3('0x3a')];_0x41cd18+=0x1){let _0x2d2513=_0x1c866c['Agents'][_0x41cd18];var _0x1ac4b7=_0x5039bf[_0x77f3('0x7b')]();_0x1ac4b7['where'](_0x77f3('0x7c'),_0x2d2513['id']);_0x35f242[_0x77f3('0x7d')](db['sequelize']['query'](_0x1ac4b7[_0x77f3('0x7e')](),{'type':db[_0x77f3('0x6c')][_0x77f3('0x7f')][_0x77f3('0x80')]})[_0x77f3('0x28')](function(_0x36660e){if(_0x36660e[_0x77f3('0x3a')]===0x1){return _0x2d2513['id'];}else{var _0x3f0b3a=_[_0x77f3('0x81')](_['map'](_0x36660e,'TeamId'),function(_0x3e0abd){return _[_0x77f3('0x82')](_0xf66f8,_0x3e0abd);});if(_0x3f0b3a){return _0x2d2513['id'];}}}));}}return BPromise['all'](_0x35f242)[_0x77f3('0x28')](function(_0x5d6c0f){_0x324f54=_(_0x324f54)[_0x77f3('0x83')](_0x5d6c0f)['compact']()[_0x77f3('0x84')]();return db['OpenchannelQueue'][_0x77f3('0x51')]({'where':{'id':_0x1355c0[_0x77f3('0x49')]['id']}})[_0x77f3('0x28')](function(_0x521d3c){return db[_0x77f3('0x6c')][_0x77f3('0x6d')](function(_0x1f3e3a){return _0x521d3c['removeTeams'](_0x1355c0[_0x77f3('0x36')][_0x77f3('0x67')],{'transaction':_0x1f3e3a})['then'](function(){if(!_[_0x77f3('0x85')](_0x324f54)){return _0x521d3c[_0x77f3('0x86')](_0x324f54,{'transaction':_0x1f3e3a});}})[_0x77f3('0x28')](function(){_0x324f54[_0x77f3('0x87')](function(_0x4b1327){socket[_0x77f3('0x70')](_0x77f3('0x88'),{'UserId':_0x4b1327,'OpenchannelQueueId':_0x521d3c['id']});});});});});});})[_0x77f3('0x28')](respondWithStatusCode(_0x3446ed,null))['catch'](handleError(_0x3446ed,null));};exports[_0x77f3('0x89')]=function(_0x565d39,_0x519489,_0x2fd5d5){return db['OpenchannelQueue'][_0x77f3('0x51')]({'where':{'id':_0x565d39[_0x77f3('0x49')]['id']}})['then'](handleEntityNotFound(_0x519489,null))[_0x77f3('0x28')](function(_0x22dcdf){if(_0x22dcdf){return _0x22dcdf[_0x77f3('0x89')](_0x565d39[_0x77f3('0x4c')][_0x77f3('0x67')],_[_0x77f3('0x8a')](_0x565d39[_0x77f3('0x4c')],[_0x77f3('0x67'),'id'])||{})[_0x77f3('0x8b')](function(_0xc98171){for(var _0x1ca9a3=0x0;_0x1ca9a3<_0x565d39['body']['ids'][_0x77f3('0x3a')];_0x1ca9a3+=0x1){socket['emit'](_0x77f3('0x71'),{'UserId':Number(_0x565d39['body'][_0x77f3('0x67')][_0x1ca9a3]),'OpenchannelQueueId':Number(_0x565d39['params']['id'])});}return _0xc98171;});}})[_0x77f3('0x28')](respondWithResult(_0x519489,null))[_0x77f3('0x48')](handleError(_0x519489,null));};exports[_0x77f3('0x86')]=function(_0x3b0bf9,_0x51249b,_0x29ae8e){return db['OpenchannelQueue'][_0x77f3('0x51')]({'where':{'id':_0x3b0bf9[_0x77f3('0x49')]['id']}})[_0x77f3('0x28')](handleEntityNotFound(_0x51249b,null))[_0x77f3('0x28')](function(_0xf552a3){if(_0xf552a3){return _0xf552a3[_0x77f3('0x86')](_0x3b0bf9[_0x77f3('0x36')][_0x77f3('0x67')])[_0x77f3('0x28')](function(){if(_[_0x77f3('0x8c')](_0x3b0bf9['query'][_0x77f3('0x67')])){for(var _0x402d0b=0x0;_0x402d0b<_0x3b0bf9[_0x77f3('0x36')][_0x77f3('0x67')][_0x77f3('0x3a')];_0x402d0b+=0x1){socket[_0x77f3('0x70')]('userOpenchannelQueue:remove',{'UserId':Number(_0x3b0bf9[_0x77f3('0x36')][_0x77f3('0x67')][_0x402d0b]),'OpenchannelQueueId':Number(_0x3b0bf9[_0x77f3('0x49')]['id'])});}}else{socket[_0x77f3('0x70')](_0x77f3('0x88'),{'UserId':Number(_0x3b0bf9[_0x77f3('0x36')][_0x77f3('0x67')]),'OpenchannelQueueId':Number(_0x3b0bf9['params']['id'])});}});}})[_0x77f3('0x28')](respondWithStatusCode(_0x51249b,null))[_0x77f3('0x48')](handleError(_0x51249b,null));};exports[_0x77f3('0x8d')]=function(_0x27de55,_0x591add,_0x4107e3){var _0x189aa6={};var _0x3e6565={};var _0x4fe3cd;var _0x201b71;return db[_0x77f3('0x31')][_0x77f3('0x57')]({'where':{'id':_0x27de55[_0x77f3('0x49')]['id']}})['then'](handleEntityNotFound(_0x591add,null))['then'](function(_0x85fe7e){if(_0x85fe7e){_0x4fe3cd=_0x85fe7e;_0x3e6565['model']=_['keys'](db[_0x77f3('0x5a')]['rawAttributes']);_0x3e6565['query']=_['keys'](_0x27de55['query']);_0x3e6565[_0x77f3('0x3e')]=_[_0x77f3('0x38')](_0x3e6565['model'],_0x3e6565[_0x77f3('0x36')]);_0x189aa6['attributes']=_['intersection'](_0x3e6565[_0x77f3('0x35')],qs[_0x77f3('0x4a')](_0x27de55[_0x77f3('0x36')][_0x77f3('0x4a')]));_0x189aa6[_0x77f3('0x39')]=_0x189aa6[_0x77f3('0x39')][_0x77f3('0x3a')]?_0x189aa6[_0x77f3('0x39')]:_0x3e6565[_0x77f3('0x35')];_0x189aa6[_0x77f3('0x3c')]=qs['sort'](_0x27de55[_0x77f3('0x36')]['sort']);_0x189aa6[_0x77f3('0x41')]=qs[_0x77f3('0x3e')](_[_0x77f3('0x3f')](_0x27de55['query'],_0x3e6565[_0x77f3('0x3e')]));if(_0x27de55['query'][_0x77f3('0x40')]){_0x189aa6[_0x77f3('0x41')]=_['merge'](_0x189aa6[_0x77f3('0x41')],{'$or':_[_0x77f3('0x30')](_0x189aa6[_0x77f3('0x39')],function(_0x30f63a){var _0x4a9234={};_0x4a9234[_0x30f63a]={'$like':'%'+_0x27de55[_0x77f3('0x36')]['filter']+'%'};return _0x4a9234;})});}_0x189aa6=_['merge']({},_0x189aa6,_0x27de55[_0x77f3('0x59')]);return _0x4fe3cd['getAgents'](_0x189aa6);}})[_0x77f3('0x28')](function(_0x4f9339){if(_0x4f9339){_0x201b71=_0x4f9339[_0x77f3('0x3a')];if(!_0x27de55[_0x77f3('0x36')][_0x77f3('0x64')](_0x77f3('0x3b'))){_0x189aa6[_0x77f3('0x21')]=qs[_0x77f3('0x21')](_0x27de55[_0x77f3('0x36')][_0x77f3('0x21')]);_0x189aa6[_0x77f3('0x23')]=qs[_0x77f3('0x23')](_0x27de55[_0x77f3('0x36')][_0x77f3('0x23')]);}return _0x4fe3cd[_0x77f3('0x8d')](_0x189aa6);}})[_0x77f3('0x28')](function(_0x427933){if(_0x427933){return _0x427933?{'count':_0x201b71,'rows':_0x427933}:null;}})[_0x77f3('0x28')](respondWithResult(_0x591add,null))[_0x77f3('0x48')](handleError(_0x591add,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 29c9c0d..ab86a11 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 _0x410c=['save','update','remove','emit','hasOwnProperty','hook','exports','OpenchannelQueue','setMaxListeners'];(function(_0x31d101,_0x6d94d4){var _0x3ec836=function(_0x49da3e){while(--_0x49da3e){_0x31d101['push'](_0x31d101['shift']());}};_0x3ec836(++_0x6d94d4);}(_0x410c,0x127));var _0xc410=function(_0xa56e31,_0x4b04a5){_0xa56e31=_0xa56e31-0x0;var _0x4912c3=_0x410c[_0xa56e31];return _0x4912c3;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0xc410('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc410('0x1')](0x0);var events={'afterCreate':_0xc410('0x2'),'afterUpdate':_0xc410('0x3'),'afterDestroy':_0xc410('0x4')};function emitEvent(_0x1b0c9a){return function(_0x2ee234,_0x103f4f,_0x1b776c){OpenchannelQueueEvents[_0xc410('0x5')](_0x1b0c9a+':'+_0x2ee234['id'],_0x2ee234);OpenchannelQueueEvents[_0xc410('0x5')](_0x1b0c9a,_0x2ee234);_0x1b776c(null);};}for(var e in events){if(events[_0xc410('0x6')](e)){var event=events[e];OpenchannelQueue[_0xc410('0x7')](e,emitEvent(event));}}module[_0xc410('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x68ac=['hasOwnProperty','hook','exports','../../mysqldb','OpenchannelQueue','save','update','remove','emit'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x68ac,0x11a));var _0xc68a=function(_0x1d54a9,_0x69e7ce){_0x1d54a9=_0x1d54a9-0x0;var _0x1c0ea1=_0x68ac[_0x1d54a9];return _0x1c0ea1;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xc68a('0x0'))['db'][_0xc68a('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc68a('0x2'),'afterUpdate':_0xc68a('0x3'),'afterDestroy':_0xc68a('0x4')};function emitEvent(_0x17bbf6){return function(_0x21e41e,_0xd472bb,_0x512c92){OpenchannelQueueEvents[_0xc68a('0x5')](_0x17bbf6+':'+_0x21e41e['id'],_0x21e41e);OpenchannelQueueEvents[_0xc68a('0x5')](_0x17bbf6,_0x21e41e);_0x512c92(null);};}for(var e in events){if(events[_0xc68a('0x6')](e)){var event=events[e];OpenchannelQueue[_0xc68a('0x7')](e,emitEvent(event));}}module[_0xc68a('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 2b7eb8d..57675c6 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 _0xd37c=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','../../config/logger','api','moment','path'];(function(_0x507090,_0x597282){var _0x5dfaf8=function(_0x5108d6){while(--_0x5108d6){_0x507090['push'](_0x507090['shift']());}};_0x5dfaf8(++_0x597282);}(_0xd37c,0x186));var _0xcd37=function(_0x31ec1c,_0x44aaad){_0x31ec1c=_0x31ec1c-0x0;var _0x76f6c1=_0xd37c[_0x31ec1c];return _0x76f6c1;};'use strict';var _=require(_0xcd37('0x0'));var util=require(_0xcd37('0x1'));var logger=require(_0xcd37('0x2'))(_0xcd37('0x3'));var moment=require(_0xcd37('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd37('0x5'));var rimraf=require(_0xcd37('0x6'));var config=require(_0xcd37('0x7'));var attributes=require(_0xcd37('0x8'));module[_0xcd37('0x9')]=function(_0x32a5c3,_0x417849){return _0x32a5c3[_0xcd37('0xa')]('OpenchannelQueue',attributes,{'tableName':_0xcd37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7176=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x47b501,_0x3e7122){var _0xe2d2d5=function(_0x1c30dd){while(--_0x1c30dd){_0x47b501['push'](_0x47b501['shift']());}};_0xe2d2d5(++_0x3e7122);}(_0x7176,0xcc));var _0x6717=function(_0x1baa24,_0x525fd5){_0x1baa24=_0x1baa24-0x0;var _0x392c7a=_0x7176[_0x1baa24];return _0x392c7a;};'use strict';var _=require(_0x6717('0x0'));var util=require('util');var logger=require(_0x6717('0x1'))(_0x6717('0x2'));var moment=require(_0x6717('0x3'));var BPromise=require(_0x6717('0x4'));var rp=require(_0x6717('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6717('0x6'));var attributes=require(_0x6717('0x7'));module[_0x6717('0x8')]=function(_0x2d2828,_0x200392){return _0x2d2828[_0x6717('0x9')](_0x6717('0xa'),attributes,{'tableName':_0x6717('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 444d6ad..2ede4e6 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 _0x6a38=['defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','ShowOpenchannelQueue','find','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis'];(function(_0x272d90,_0x5e70ff){var _0x2bf4a2=function(_0x544da6){while(--_0x544da6){_0x272d90['push'](_0x272d90['shift']());}};_0x2bf4a2(++_0x5e70ff);}(_0x6a38,0x18f));var _0x86a3=function(_0xa3883d,_0xbf9c9c){_0xa3883d=_0xa3883d-0x0;var _0x447325=_0x6a38[_0xa3883d];return _0x447325;};'use strict';var _=require(_0x86a3('0x0'));var util=require('util');var moment=require(_0x86a3('0x1'));var BPromise=require('bluebird');var rs=require(_0x86a3('0x2'));var fs=require('fs');var Redis=require(_0x86a3('0x3'));var db=require(_0x86a3('0x4'))['db'];var utils=require(_0x86a3('0x5'));var logger=require(_0x86a3('0x6'))('rpc');var config=require(_0x86a3('0x7'));var jayson=require(_0x86a3('0x8'));var client=jayson['client'][_0x86a3('0x9')]({'port':0x232a});config[_0x86a3('0xa')]=_[_0x86a3('0xb')](config[_0x86a3('0xa')],{'host':_0x86a3('0xc'),'port':0x18eb});var socket=require(_0x86a3('0xd'))(new Redis(config[_0x86a3('0xa')]));require(_0x86a3('0xe'))[_0x86a3('0xf')](socket);function respondWithRpcPromise(_0x3da8e8,_0x2da13c,_0x1d684b){return new BPromise(function(_0x3303c2,_0x110cd8){return client[_0x86a3('0x10')](_0x3da8e8,_0x1d684b)[_0x86a3('0x11')](function(_0x324810){logger[_0x86a3('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x2da13c,_0x86a3('0x13'));logger[_0x86a3('0x14')](_0x86a3('0x15'),_0x2da13c,_0x86a3('0x13'),JSON['stringify'](_0x324810));if(_0x324810[_0x86a3('0x16')]){if(_0x324810[_0x86a3('0x16')][_0x86a3('0x17')]===0x1f4){logger['error'](_0x86a3('0x18'),_0x2da13c,_0x324810['error'][_0x86a3('0x19')]);return _0x110cd8(_0x324810[_0x86a3('0x16')]['message']);}logger[_0x86a3('0x16')](_0x86a3('0x18'),_0x2da13c,_0x324810['error'][_0x86a3('0x19')]);return _0x3303c2(_0x324810['error']['message']);}else{logger[_0x86a3('0x12')](_0x86a3('0x18'),_0x2da13c,'request\x20sent');_0x3303c2(_0x324810[_0x86a3('0x1a')][_0x86a3('0x19')]);}})[_0x86a3('0x1b')](function(_0x269011){logger[_0x86a3('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x2da13c,_0x269011);_0x110cd8(_0x269011);});});}exports[_0x86a3('0x1c')]=function(_0x39772d){var _0x31044d=this;return new Promise(function(_0x440741,_0xaeca23){return db[_0x86a3('0x1d')][_0x86a3('0x1e')]({'raw':_0x39772d[_0x86a3('0x1f')]?_0x39772d[_0x86a3('0x1f')][_0x86a3('0x20')]===undefined?!![]:![]:!![],'where':_0x39772d['options']?_0x39772d['options'][_0x86a3('0x21')]||null:null,'attributes':_0x39772d['options']?_0x39772d[_0x86a3('0x1f')][_0x86a3('0x22')]||null:null,'limit':_0x39772d['options']?_0x39772d[_0x86a3('0x1f')]['limit']||null:null,'include':_0x39772d['options']?_0x39772d[_0x86a3('0x1f')][_0x86a3('0x23')]?_[_0x86a3('0x24')](_0x39772d[_0x86a3('0x1f')][_0x86a3('0x23')],function(_0x138f5a){return{'model':db[_0x138f5a[_0x86a3('0x25')]],'as':_0x138f5a['as'],'attributes':_0x138f5a['attributes'],'include':_0x138f5a[_0x86a3('0x23')]?_[_0x86a3('0x24')](_0x138f5a['include'],function(_0x5ebb6d){return{'model':db[_0x5ebb6d[_0x86a3('0x25')]],'as':_0x5ebb6d['as'],'attributes':_0x5ebb6d[_0x86a3('0x22')],'include':_0x5ebb6d['include']?_['map'](_0x5ebb6d[_0x86a3('0x23')],function(_0x252441){return{'model':db[_0x252441['model']],'as':_0x252441['as'],'attributes':_0x252441[_0x86a3('0x22')]};}):[]};}):[]};}):[]:[]})[_0x86a3('0x11')](function(_0x1500fd){logger[_0x86a3('0x12')]('GetOpenchannelQueue',_0x39772d);logger['debug'](_0x86a3('0x1c'),_0x39772d,JSON['stringify'](_0x1500fd));_0x440741(_0x1500fd);})[_0x86a3('0x1b')](function(_0x48ef7c){logger[_0x86a3('0x16')](_0x86a3('0x1c'),_0x48ef7c[_0x86a3('0x19')],_0x39772d);_0xaeca23(_0x31044d[_0x86a3('0x16')](0x1f4,_0x48ef7c[_0x86a3('0x19')]));});});};exports[_0x86a3('0x26')]=function(_0x3462b2){var _0x152d6e=this;return new Promise(function(_0x5a04dc,_0x49769c){return db[_0x86a3('0x1d')][_0x86a3('0x27')]({'raw':_0x3462b2[_0x86a3('0x1f')]?_0x3462b2[_0x86a3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3462b2['options']?_0x3462b2[_0x86a3('0x1f')]['where']||null:null,'attributes':_0x3462b2[_0x86a3('0x1f')]?_0x3462b2[_0x86a3('0x1f')][_0x86a3('0x22')]||null:null,'include':_0x3462b2['options']?_0x3462b2[_0x86a3('0x1f')][_0x86a3('0x23')]?_[_0x86a3('0x24')](_0x3462b2[_0x86a3('0x1f')][_0x86a3('0x23')],function(_0x5ed478){return{'model':db[_0x5ed478[_0x86a3('0x25')]],'as':_0x5ed478['as'],'attributes':_0x5ed478[_0x86a3('0x22')],'include':_0x5ed478['include']?_['map'](_0x5ed478[_0x86a3('0x23')],function(_0x18a2f6){return{'model':db[_0x18a2f6[_0x86a3('0x25')]],'as':_0x18a2f6['as'],'attributes':_0x18a2f6[_0x86a3('0x22')],'include':_0x18a2f6[_0x86a3('0x23')]?_[_0x86a3('0x24')](_0x18a2f6[_0x86a3('0x23')],function(_0x102226){return{'model':db[_0x102226[_0x86a3('0x25')]],'as':_0x102226['as'],'attributes':_0x102226[_0x86a3('0x22')]};}):[]};}):[]};}):[]:[]})[_0x86a3('0x11')](function(_0x4cf134){logger[_0x86a3('0x12')](_0x86a3('0x26'),_0x3462b2);logger[_0x86a3('0x14')](_0x86a3('0x26'),_0x3462b2,JSON[_0x86a3('0x28')](_0x4cf134));_0x5a04dc(_0x4cf134);})[_0x86a3('0x1b')](function(_0x5e44d2){logger[_0x86a3('0x16')]('ShowOpenchannelQueue',_0x5e44d2[_0x86a3('0x19')],_0x3462b2);_0x49769c(_0x152d6e[_0x86a3('0x16')](0x1f4,_0x5e44d2['message']));});});}; \ No newline at end of file +var _0xde7f=['register','request','then','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelQueue,\x20%s,\x20%s','result','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','map','model','debug','catch','ShowOpenchannelQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket'];(function(_0x427ff1,_0x3ec546){var _0x2abe10=function(_0x3b9e03){while(--_0x3b9e03){_0x427ff1['push'](_0x427ff1['shift']());}};_0x2abe10(++_0x3ec546);}(_0xde7f,0x8e));var _0xfde7=function(_0x458626,_0xee5f22){_0x458626=_0x458626-0x0;var _0x2a82b1=_0xde7f[_0x458626];return _0x2a82b1;};'use strict';var _=require(_0xfde7('0x0'));var util=require('util');var moment=require(_0xfde7('0x1'));var BPromise=require(_0xfde7('0x2'));var rs=require(_0xfde7('0x3'));var fs=require('fs');var Redis=require(_0xfde7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfde7('0x5'))(_0xfde7('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfde7('0x7')][_0xfde7('0x8')]({'port':0x232a});config[_0xfde7('0x9')]=_[_0xfde7('0xa')](config[_0xfde7('0x9')],{'host':_0xfde7('0xb'),'port':0x18eb});var socket=require(_0xfde7('0xc'))(new Redis(config[_0xfde7('0x9')]));require(_0xfde7('0xd'))[_0xfde7('0xe')](socket);function respondWithRpcPromise(_0x233c15,_0x457f26,_0x43259a){return new BPromise(function(_0x4e706f,_0x3e5356){return client[_0xfde7('0xf')](_0x233c15,_0x43259a)[_0xfde7('0x10')](function(_0x4a3dc6){logger[_0xfde7('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x457f26,_0xfde7('0x12'));logger['debug'](_0xfde7('0x13'),_0x457f26,_0xfde7('0x12'),JSON[_0xfde7('0x14')](_0x4a3dc6));if(_0x4a3dc6[_0xfde7('0x15')]){if(_0x4a3dc6[_0xfde7('0x15')][_0xfde7('0x16')]===0x1f4){logger[_0xfde7('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x457f26,_0x4a3dc6[_0xfde7('0x15')]['message']);return _0x3e5356(_0x4a3dc6[_0xfde7('0x15')][_0xfde7('0x17')]);}logger[_0xfde7('0x15')](_0xfde7('0x18'),_0x457f26,_0x4a3dc6[_0xfde7('0x15')][_0xfde7('0x17')]);return _0x4e706f(_0x4a3dc6[_0xfde7('0x15')][_0xfde7('0x17')]);}else{logger['info'](_0xfde7('0x18'),_0x457f26,'request\x20sent');_0x4e706f(_0x4a3dc6[_0xfde7('0x19')][_0xfde7('0x17')]);}})['catch'](function(_0x3a8dd2){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x457f26,_0x3a8dd2);_0x3e5356(_0x3a8dd2);});});}exports[_0xfde7('0x1a')]=function(_0x5505a0){var _0x5f4999=this;return new Promise(function(_0x1be3aa,_0x235d2c){return db[_0xfde7('0x1b')]['findAll']({'raw':_0x5505a0[_0xfde7('0x1c')]?_0x5505a0[_0xfde7('0x1c')][_0xfde7('0x1d')]===undefined?!![]:![]:!![],'where':_0x5505a0[_0xfde7('0x1c')]?_0x5505a0[_0xfde7('0x1c')][_0xfde7('0x1e')]||null:null,'attributes':_0x5505a0[_0xfde7('0x1c')]?_0x5505a0[_0xfde7('0x1c')][_0xfde7('0x1f')]||null:null,'limit':_0x5505a0[_0xfde7('0x1c')]?_0x5505a0['options'][_0xfde7('0x20')]||null:null,'include':_0x5505a0[_0xfde7('0x1c')]?_0x5505a0['options'][_0xfde7('0x21')]?_[_0xfde7('0x22')](_0x5505a0['options'][_0xfde7('0x21')],function(_0x3b9b22){return{'model':db[_0x3b9b22[_0xfde7('0x23')]],'as':_0x3b9b22['as'],'attributes':_0x3b9b22[_0xfde7('0x1f')],'include':_0x3b9b22[_0xfde7('0x21')]?_['map'](_0x3b9b22['include'],function(_0x1a3e03){return{'model':db[_0x1a3e03[_0xfde7('0x23')]],'as':_0x1a3e03['as'],'attributes':_0x1a3e03[_0xfde7('0x1f')],'include':_0x1a3e03['include']?_['map'](_0x1a3e03[_0xfde7('0x21')],function(_0x95a984){return{'model':db[_0x95a984['model']],'as':_0x95a984['as'],'attributes':_0x95a984[_0xfde7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfde7('0x10')](function(_0x4914f0){logger[_0xfde7('0x11')](_0xfde7('0x1a'),_0x5505a0);logger[_0xfde7('0x24')]('GetOpenchannelQueue',_0x5505a0,JSON[_0xfde7('0x14')](_0x4914f0));_0x1be3aa(_0x4914f0);})[_0xfde7('0x25')](function(_0x5c7505){logger[_0xfde7('0x15')]('GetOpenchannelQueue',_0x5c7505[_0xfde7('0x17')],_0x5505a0);_0x235d2c(_0x5f4999[_0xfde7('0x15')](0x1f4,_0x5c7505[_0xfde7('0x17')]));});});};exports[_0xfde7('0x26')]=function(_0x36ce7b){var _0x1ad222=this;return new Promise(function(_0x376fdf,_0x5904b1){return db[_0xfde7('0x1b')]['find']({'raw':_0x36ce7b[_0xfde7('0x1c')]?_0x36ce7b[_0xfde7('0x1c')][_0xfde7('0x1d')]===undefined?!![]:![]:!![],'where':_0x36ce7b[_0xfde7('0x1c')]?_0x36ce7b[_0xfde7('0x1c')][_0xfde7('0x1e')]||null:null,'attributes':_0x36ce7b[_0xfde7('0x1c')]?_0x36ce7b[_0xfde7('0x1c')][_0xfde7('0x1f')]||null:null,'include':_0x36ce7b['options']?_0x36ce7b['options'][_0xfde7('0x21')]?_[_0xfde7('0x22')](_0x36ce7b[_0xfde7('0x1c')][_0xfde7('0x21')],function(_0x37729b){return{'model':db[_0x37729b[_0xfde7('0x23')]],'as':_0x37729b['as'],'attributes':_0x37729b[_0xfde7('0x1f')],'include':_0x37729b[_0xfde7('0x21')]?_[_0xfde7('0x22')](_0x37729b[_0xfde7('0x21')],function(_0x45e89c){return{'model':db[_0x45e89c[_0xfde7('0x23')]],'as':_0x45e89c['as'],'attributes':_0x45e89c[_0xfde7('0x1f')],'include':_0x45e89c[_0xfde7('0x21')]?_[_0xfde7('0x22')](_0x45e89c[_0xfde7('0x21')],function(_0x5d336f){return{'model':db[_0x5d336f[_0xfde7('0x23')]],'as':_0x5d336f['as'],'attributes':_0x5d336f[_0xfde7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfde7('0x10')](function(_0x921e1e){logger['info'](_0xfde7('0x26'),_0x36ce7b);logger[_0xfde7('0x24')]('ShowOpenchannelQueue',_0x36ce7b,JSON[_0xfde7('0x14')](_0x921e1e));_0x376fdf(_0x921e1e);})[_0xfde7('0x25')](function(_0x2c5b74){logger[_0xfde7('0x15')]('ShowOpenchannelQueue',_0x2c5b74[_0xfde7('0x17')],_0x36ce7b);_0x5904b1(_0x1ad222[_0xfde7('0x15')](0x1f4,_0x2c5b74[_0xfde7('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index c96831a..4fc0685 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 _0x9d51=['save','remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x2aac1f,_0x3e2f1c){var _0xfec4a2=function(_0x4235c5){while(--_0x4235c5){_0x2aac1f['push'](_0x2aac1f['shift']());}};_0xfec4a2(++_0x3e2f1c);}(_0x9d51,0xe0));var _0x19d5=function(_0x248155,_0x27c15f){_0x248155=_0x248155-0x0;var _0x4deac9=_0x9d51[_0x248155];return _0x4deac9;};'use strict';var OpenchannelQueueEvents=require(_0x19d5('0x0'));var events=[_0x19d5('0x1'),_0x19d5('0x2'),_0x19d5('0x3')];function createListener(_0x3ad076,_0x2d3d12){return function(_0x1ffdb3){_0x2d3d12[_0x19d5('0x4')](_0x3ad076,_0x1ffdb3);};}function removeListener(_0xc517ca,_0x4324e2){return function(){OpenchannelQueueEvents[_0x19d5('0x5')](_0xc517ca,_0x4324e2);};}exports[_0x19d5('0x6')]=function(_0xbe6efc){for(var _0x555687=0x0,_0x1a5ee7=events[_0x19d5('0x7')];_0x555687<_0x1a5ee7;_0x555687++){var _0x5315d6=events[_0x555687];var _0x3981e9=createListener(_0x19d5('0x8')+_0x5315d6,_0xbe6efc);OpenchannelQueueEvents['on'](_0x5315d6,_0x3981e9);}}; \ No newline at end of file +var _0x414d=['openchannelQueue:','./openchannelQueue.events','remove','update','emit','removeListener','register','length'];(function(_0x236e37,_0x4e523){var _0x236c11=function(_0x4ca15d){while(--_0x4ca15d){_0x236e37['push'](_0x236e37['shift']());}};_0x236c11(++_0x4e523);}(_0x414d,0x161));var _0xd414=function(_0x27ffd5,_0x8eb63f){_0x27ffd5=_0x27ffd5-0x0;var _0x4f07dc=_0x414d[_0x27ffd5];return _0x4f07dc;};'use strict';var OpenchannelQueueEvents=require(_0xd414('0x0'));var events=['save',_0xd414('0x1'),_0xd414('0x2')];function createListener(_0x379558,_0x1a6d82){return function(_0x4fbb70){_0x1a6d82[_0xd414('0x3')](_0x379558,_0x4fbb70);};}function removeListener(_0x2eb3cf,_0x3914d1){return function(){OpenchannelQueueEvents[_0xd414('0x4')](_0x2eb3cf,_0x3914d1);};}exports[_0xd414('0x5')]=function(_0x1808ee){for(var _0x2d5c37=0x0,_0x944c32=events[_0xd414('0x6')];_0x2d5c37<_0x944c32;_0x2d5c37++){var _0x59baea=events[_0x2d5c37];var _0x4e2ef5=createListener(_0xd414('0x7')+_0x59baea,_0x1808ee);OpenchannelQueueEvents['on'](_0x59baea,_0x4e2ef5);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 673f388..5df1d5f 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 _0x6377=['delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','create','update'];(function(_0x51d958,_0x1aaa67){var _0x7d6412=function(_0x2e9eee){while(--_0x2e9eee){_0x51d958['push'](_0x51d958['shift']());}};_0x7d6412(++_0x1aaa67);}(_0x6377,0x1a0));var _0x7637=function(_0xc8069a,_0x2968fc){_0xc8069a=_0xc8069a-0x0;var _0x16bc69=_0x6377[_0xc8069a];return _0x16bc69;};'use strict';var multer=require('multer');var util=require(_0x7637('0x0'));var path=require('path');var timeout=require(_0x7637('0x1'));var express=require(_0x7637('0x2'));var router=express[_0x7637('0x3')]();var fs_extra=require(_0x7637('0x4'));var auth=require(_0x7637('0x5'));var interaction=require(_0x7637('0x6'));var config=require(_0x7637('0x7'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7637('0x8')]);router[_0x7637('0x9')](_0x7637('0xa'),auth[_0x7637('0xb')](),controller[_0x7637('0xc')]);router[_0x7637('0x9')](_0x7637('0xd'),auth[_0x7637('0xb')](),controller['show']);router['post']('/',auth[_0x7637('0xb')](),controller[_0x7637('0xe')]);router['put'](_0x7637('0xd'),auth[_0x7637('0xb')](),controller[_0x7637('0xf')]);router[_0x7637('0x10')]('/:id',auth[_0x7637('0xb')](),controller['destroy']);module[_0x7637('0x11')]=router; \ No newline at end of file +var _0xf70a=['/describe','/:id','show','post','create','put','update','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf70a,0x67));var _0xaf70=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0xf70a[_0xa4928c];return _0x27cc29;};'use strict';var multer=require(_0xaf70('0x0'));var util=require('util');var path=require(_0xaf70('0x1'));var timeout=require('connect-timeout');var express=require(_0xaf70('0x2'));var router=express[_0xaf70('0x3')]();var fs_extra=require(_0xaf70('0x4'));var auth=require(_0xaf70('0x5'));var interaction=require(_0xaf70('0x6'));var config=require('../../config/environment');var controller=require(_0xaf70('0x7'));router[_0xaf70('0x8')]('/',auth[_0xaf70('0x9')](),controller[_0xaf70('0xa')]);router[_0xaf70('0x8')](_0xaf70('0xb'),auth[_0xaf70('0x9')](),controller['describe']);router[_0xaf70('0x8')](_0xaf70('0xc'),auth[_0xaf70('0x9')](),controller[_0xaf70('0xd')]);router[_0xaf70('0xe')]('/',auth['isAuthenticated'](),controller[_0xaf70('0xf')]);router[_0xaf70('0x10')]('/:id',auth[_0xaf70('0x9')](),controller[_0xaf70('0x11')]);router[_0xaf70('0x12')](_0xaf70('0xc'),auth[_0xaf70('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index b900b0a..529ca60 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 _0xf7d5=['DATE','sequelize','exports','STRING'];(function(_0x3777ca,_0xbf2b8a){var _0x5ce8ca=function(_0x57bf95){while(--_0x57bf95){_0x3777ca['push'](_0x3777ca['shift']());}};_0x5ce8ca(++_0xbf2b8a);}(_0xf7d5,0x189));var _0x5f7d=function(_0x57f8c0,_0x136cf6){_0x57f8c0=_0x57f8c0-0x0;var _0x117f08=_0xf7d5[_0x57f8c0];return _0x117f08;};'use strict';var moment=require('moment');var Sequelize=require(_0x5f7d('0x0'));module[_0x5f7d('0x1')]={'uniqueid':{'type':Sequelize[_0x5f7d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5f7d('0x2')]},'joinAt':{'type':Sequelize[_0x5f7d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5f7d('0x3')]},'exitAt':{'type':Sequelize[_0x5f7d('0x3')]},'reason':{'type':Sequelize[_0x5f7d('0x2')]}}; \ No newline at end of file +var _0xbedd=['exports','STRING','DATE','moment'];(function(_0x397ff0,_0x9b4d7c){var _0x16bbce=function(_0x347b20){while(--_0x347b20){_0x397ff0['push'](_0x397ff0['shift']());}};_0x16bbce(++_0x9b4d7c);}(_0xbedd,0xf3));var _0xdbed=function(_0x217832,_0x34fdea){_0x217832=_0x217832-0x0;var _0x5c0a8b=_0xbedd[_0x217832];return _0x5c0a8b;};'use strict';var moment=require(_0xdbed('0x0'));var Sequelize=require('sequelize');module[_0xdbed('0x1')]={'uniqueid':{'type':Sequelize[_0xdbed('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdbed('0x2')]},'joinAt':{'type':Sequelize[_0xdbed('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xdbed('0x3')]},'reason':{'type':Sequelize[_0xdbed('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 29a7e21..af4c7d1 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 _0x889b=['../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','json','limit','undefined','offset','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','index','map','OpenchannelQueueReport','type','keys','filters','intersection','model','attributes','query','fields','nolimit','order','sort','where','pick','merge','filter','count','includeAll','include','rows','catch','show','params','rawAttributes','length','options','find','create','body','describe','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x889b,0x7d));var _0xb889=function(_0x20d434,_0x3fb64f){_0x20d434=_0x20d434-0x0;var _0x1d90f1=_0x889b[_0x20d434];return _0x1d90f1;};'use strict';var emlformat=require(_0xb889('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb889('0x1'));var rp=require(_0xb889('0x2'));var moment=require('moment');var BPromise=require(_0xb889('0x3'));var Mustache=require('mustache');var util=require(_0xb889('0x4'));var path=require(_0xb889('0x5'));var sox=require(_0xb889('0x6'));var csv=require(_0xb889('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb889('0x8'));var _=require(_0xb889('0x9'));var squel=require(_0xb889('0xa'));var crypto=require(_0xb889('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb889('0xc'));var toCsv=require(_0xb889('0x7'));var querystring=require(_0xb889('0xd'));var Papa=require(_0xb889('0xe'));var Redis=require(_0xb889('0xf'));var authService=require(_0xb889('0x10'));var qs=require(_0xb889('0x11'));var as=require(_0xb889('0x12'));var hardwareService=require(_0xb889('0x13'));var logger=require(_0xb889('0x14'))('api');var utils=require(_0xb889('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb889('0x16'))['db'];function respondWithStatusCode(_0x416a9c,_0x20e5bb){_0x20e5bb=_0x20e5bb||0xcc;return function(_0x19b361){if(_0x19b361){return _0x416a9c['sendStatus'](_0x20e5bb);}return _0x416a9c[_0xb889('0x17')](_0x20e5bb)['end']();};}function respondWithResult(_0x205c10,_0x3d5f56){_0x3d5f56=_0x3d5f56||0xc8;return function(_0x164f3c){if(_0x164f3c){return _0x205c10[_0xb889('0x17')](_0x3d5f56)[_0xb889('0x18')](_0x164f3c);}};}function respondWithFilteredResult(_0x20fd66,_0x31d958){return function(_0x4c2311){if(_0x4c2311){var _0x5dc770=typeof _0x31d958['offset']==='undefined'&&typeof _0x31d958[_0xb889('0x19')]===_0xb889('0x1a');var _0x473ded=_0x4c2311['count'];var _0xc3a780=_0x5dc770?0x0:_0x31d958['offset'];var _0x3a7bf5=_0x5dc770?_0x4c2311['count']:_0x31d958[_0xb889('0x1b')]+_0x31d958[_0xb889('0x19')];var _0x5b5722;if(_0x3a7bf5>=_0x473ded){_0x3a7bf5=_0x473ded;_0x5b5722=0xc8;}else{_0x5b5722=0xce;}_0x20fd66['status'](_0x5b5722);return _0x20fd66[_0xb889('0x1c')](_0xb889('0x1d'),_0xc3a780+'-'+_0x3a7bf5+'/'+_0x473ded)[_0xb889('0x18')](_0x4c2311);}return null;};}function patchUpdates(_0x398159){return function(_0x35b6fa){try{jsonpatch[_0xb889('0x1e')](_0x35b6fa,_0x398159,!![]);}catch(_0x2925f1){return BPromise[_0xb889('0x1f')](_0x2925f1);}return _0x35b6fa[_0xb889('0x20')]();};}function saveUpdates(_0x49b512,_0x435d99){return function(_0xf3cdb9){if(_0xf3cdb9){return _0xf3cdb9['update'](_0x49b512)[_0xb889('0x21')](function(_0x5f0c98){return _0x5f0c98;});}return null;};}function removeEntity(_0x479337,_0x4ff595){return function(_0x9a225){if(_0x9a225){return _0x9a225[_0xb889('0x22')]()[_0xb889('0x21')](function(){_0x479337['status'](0xcc)[_0xb889('0x23')]();});}};}function handleEntityNotFound(_0x267dde,_0x3496dd){return function(_0x33a8a5){if(!_0x33a8a5){_0x267dde[_0xb889('0x24')](0x194);}return _0x33a8a5;};}function handleError(_0x154ddd,_0x5d3053){_0x5d3053=_0x5d3053||0x1f4;return function(_0x44f446){logger[_0xb889('0x25')](_0x44f446[_0xb889('0x26')]);if(_0x44f446[_0xb889('0x27')]){delete _0x44f446[_0xb889('0x27')];}_0x154ddd[_0xb889('0x17')](_0x5d3053)['send'](_0x44f446);};}exports[_0xb889('0x28')]=function(_0x287e40,_0x4eabea){var _0xefe8c5={},_0x2219e4={},_0x54bdf4={'count':0x0,'rows':[]};var _0x4973f1=_[_0xb889('0x29')](db[_0xb889('0x2a')]['rawAttributes'],function(_0x165d43){return{'name':_0x165d43['fieldName'],'type':_0x165d43[_0xb889('0x2b')]['key']};});_0x2219e4['model']=_['map'](_0x4973f1,_0xb889('0x27'));_0x2219e4['query']=_[_0xb889('0x2c')](_0x287e40['query']);_0x2219e4[_0xb889('0x2d')]=_[_0xb889('0x2e')](_0x2219e4[_0xb889('0x2f')],_0x2219e4['query']);_0xefe8c5[_0xb889('0x30')]=_['intersection'](_0x2219e4[_0xb889('0x2f')],qs['fields'](_0x287e40[_0xb889('0x31')][_0xb889('0x32')]));_0xefe8c5[_0xb889('0x30')]=_0xefe8c5['attributes']['length']?_0xefe8c5[_0xb889('0x30')]:_0x2219e4[_0xb889('0x2f')];if(!_0x287e40[_0xb889('0x31')]['hasOwnProperty'](_0xb889('0x33'))){_0xefe8c5[_0xb889('0x19')]=qs['limit'](_0x287e40['query'][_0xb889('0x19')]);_0xefe8c5[_0xb889('0x1b')]=qs[_0xb889('0x1b')](_0x287e40['query'][_0xb889('0x1b')]);}_0xefe8c5[_0xb889('0x34')]=qs[_0xb889('0x35')](_0x287e40['query'][_0xb889('0x35')]);_0xefe8c5[_0xb889('0x36')]=qs[_0xb889('0x2d')](_[_0xb889('0x37')](_0x287e40[_0xb889('0x31')],_0x2219e4[_0xb889('0x2d')]),_0x4973f1);if(_0x287e40['query']['filter']){_0xefe8c5[_0xb889('0x36')]=_[_0xb889('0x38')](_0xefe8c5[_0xb889('0x36')],{'$or':_[_0xb889('0x29')](_0x4973f1,function(_0x2a4dbb){if(_0x2a4dbb[_0xb889('0x2b')]!=='VIRTUAL'){var _0x41b8d6={};_0x41b8d6[_0x2a4dbb[_0xb889('0x27')]]={'$like':'%'+_0x287e40[_0xb889('0x31')][_0xb889('0x39')]+'%'};return _0x41b8d6;}})});}_0xefe8c5=_[_0xb889('0x38')]({},_0xefe8c5,_0x287e40['options']);var _0x51b574={'where':_0xefe8c5[_0xb889('0x36')]};return db[_0xb889('0x2a')][_0xb889('0x3a')](_0x51b574)[_0xb889('0x21')](function(_0x4b5e4b){_0x54bdf4[_0xb889('0x3a')]=_0x4b5e4b;if(_0x287e40[_0xb889('0x31')][_0xb889('0x3b')]){_0xefe8c5[_0xb889('0x3c')]=[{'all':!![]}];}return db[_0xb889('0x2a')]['findAll'](_0xefe8c5);})[_0xb889('0x21')](function(_0x556b0c){_0x54bdf4[_0xb889('0x3d')]=_0x556b0c;return _0x54bdf4;})[_0xb889('0x21')](respondWithFilteredResult(_0x4eabea,_0xefe8c5))[_0xb889('0x3e')](handleError(_0x4eabea,null));};exports[_0xb889('0x3f')]=function(_0x13719a,_0x283ea6){var _0x2703e5={'raw':!![],'where':{'id':_0x13719a[_0xb889('0x40')]['id']}},_0x1ece02={};_0x1ece02[_0xb889('0x2f')]=_[_0xb889('0x2c')](db[_0xb889('0x2a')][_0xb889('0x41')]);_0x1ece02[_0xb889('0x31')]=_['keys'](_0x13719a[_0xb889('0x31')]);_0x1ece02['filters']=_[_0xb889('0x2e')](_0x1ece02['model'],_0x1ece02[_0xb889('0x31')]);_0x2703e5[_0xb889('0x30')]=_['intersection'](_0x1ece02[_0xb889('0x2f')],qs[_0xb889('0x32')](_0x13719a[_0xb889('0x31')][_0xb889('0x32')]));_0x2703e5[_0xb889('0x30')]=_0x2703e5[_0xb889('0x30')][_0xb889('0x42')]?_0x2703e5[_0xb889('0x30')]:_0x1ece02[_0xb889('0x2f')];if(_0x13719a[_0xb889('0x31')][_0xb889('0x3b')]){_0x2703e5['include']=[{'all':!![]}];}_0x2703e5=_[_0xb889('0x38')]({},_0x2703e5,_0x13719a[_0xb889('0x43')]);return db['OpenchannelQueueReport'][_0xb889('0x44')](_0x2703e5)[_0xb889('0x21')](handleEntityNotFound(_0x283ea6,null))['then'](respondWithResult(_0x283ea6,null))['catch'](handleError(_0x283ea6,null));};exports[_0xb889('0x45')]=function(_0x4c9b3a,_0x161031){return db['OpenchannelQueueReport'][_0xb889('0x45')](_0x4c9b3a[_0xb889('0x46')],{})[_0xb889('0x21')](respondWithResult(_0x161031,0xc9))[_0xb889('0x3e')](handleError(_0x161031,null));};exports['update']=function(_0x5368f1,_0x38c541){if(_0x5368f1['body']['id']){delete _0x5368f1[_0xb889('0x46')]['id'];}return db[_0xb889('0x2a')][_0xb889('0x44')]({'where':{'id':_0x5368f1[_0xb889('0x40')]['id']}})['then'](handleEntityNotFound(_0x38c541,null))[_0xb889('0x21')](saveUpdates(_0x5368f1[_0xb889('0x46')],null))[_0xb889('0x21')](respondWithResult(_0x38c541,null))[_0xb889('0x3e')](handleError(_0x38c541,null));};exports[_0xb889('0x22')]=function(_0x5880a4,_0x449f0d){return db[_0xb889('0x2a')][_0xb889('0x44')]({'where':{'id':_0x5880a4[_0xb889('0x40')]['id']}})[_0xb889('0x21')](handleEntityNotFound(_0x449f0d,null))['then'](removeEntity(_0x449f0d,null))[_0xb889('0x3e')](handleError(_0x449f0d,null));};exports['describe']=function(_0x21b382,_0x3278a9){return db['OpenchannelQueueReport'][_0xb889('0x47')]()['then'](respondWithResult(_0x3278a9,null))[_0xb889('0x3e')](handleError(_0x3278a9,null));}; \ No newline at end of file +var _0x095b=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','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','json','offset','undefined','limit','count','status','set','reject','save','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format'];(function(_0x4bdbeb,_0x293ffc){var _0xaf8acc=function(_0x1d579b){while(--_0x1d579b){_0x4bdbeb['push'](_0x4bdbeb['shift']());}};_0xaf8acc(++_0x293ffc);}(_0x095b,0x9f));var _0xb095=function(_0x10f102,_0x5be523){_0x10f102=_0x10f102-0x0;var _0x107b93=_0x095b[_0x10f102];return _0x107b93;};'use strict';var emlformat=require(_0xb095('0x0'));var rimraf=require(_0xb095('0x1'));var zipdir=require(_0xb095('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb095('0x3'));var moment=require(_0xb095('0x4'));var BPromise=require(_0xb095('0x5'));var Mustache=require(_0xb095('0x6'));var util=require(_0xb095('0x7'));var path=require(_0xb095('0x8'));var sox=require('sox');var csv=require(_0xb095('0x9'));var ejs=require(_0xb095('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb095('0xb'));var squel=require(_0xb095('0xc'));var crypto=require(_0xb095('0xd'));var jsforce=require(_0xb095('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb095('0x9'));var querystring=require(_0xb095('0xf'));var Papa=require('papaparse');var Redis=require(_0xb095('0x10'));var authService=require(_0xb095('0x11'));var qs=require(_0xb095('0x12'));var as=require(_0xb095('0x13'));var hardwareService=require(_0xb095('0x14'));var logger=require(_0xb095('0x15'))(_0xb095('0x16'));var utils=require(_0xb095('0x17'));var config=require(_0xb095('0x18'));var licenseUtil=require(_0xb095('0x19'));var db=require(_0xb095('0x1a'))['db'];function respondWithStatusCode(_0x47ad9c,_0x18a927){_0x18a927=_0x18a927||0xcc;return function(_0x59cf24){if(_0x59cf24){return _0x47ad9c[_0xb095('0x1b')](_0x18a927);}return _0x47ad9c['status'](_0x18a927)['end']();};}function respondWithResult(_0xf7454b,_0x191218){_0x191218=_0x191218||0xc8;return function(_0x805b32){if(_0x805b32){return _0xf7454b['status'](_0x191218)[_0xb095('0x1c')](_0x805b32);}};}function respondWithFilteredResult(_0x568d3c,_0x345304){return function(_0x434805){if(_0x434805){var _0x5a4c6d=typeof _0x345304[_0xb095('0x1d')]===_0xb095('0x1e')&&typeof _0x345304[_0xb095('0x1f')]===_0xb095('0x1e');var _0x47d294=_0x434805[_0xb095('0x20')];var _0x2e7f2a=_0x5a4c6d?0x0:_0x345304[_0xb095('0x1d')];var _0x233d7d=_0x5a4c6d?_0x434805[_0xb095('0x20')]:_0x345304[_0xb095('0x1d')]+_0x345304[_0xb095('0x1f')];var _0x1b2eb3;if(_0x233d7d>=_0x47d294){_0x233d7d=_0x47d294;_0x1b2eb3=0xc8;}else{_0x1b2eb3=0xce;}_0x568d3c[_0xb095('0x21')](_0x1b2eb3);return _0x568d3c[_0xb095('0x22')]('Content-Range',_0x2e7f2a+'-'+_0x233d7d+'/'+_0x47d294)['json'](_0x434805);}return null;};}function patchUpdates(_0x40bfc4){return function(_0x8bab0d){try{jsonpatch['apply'](_0x8bab0d,_0x40bfc4,!![]);}catch(_0x4ee0f9){return BPromise[_0xb095('0x23')](_0x4ee0f9);}return _0x8bab0d[_0xb095('0x24')]();};}function saveUpdates(_0x1c7bfd,_0x122214){return function(_0x1f2596){if(_0x1f2596){return _0x1f2596[_0xb095('0x25')](_0x1c7bfd)[_0xb095('0x26')](function(_0x1c3da7){return _0x1c3da7;});}return null;};}function removeEntity(_0x35a3be,_0xbdc0b7){return function(_0x353fb9){if(_0x353fb9){return _0x353fb9[_0xb095('0x27')]()[_0xb095('0x26')](function(){_0x35a3be[_0xb095('0x21')](0xcc)[_0xb095('0x28')]();});}};}function handleEntityNotFound(_0x3e936c,_0x3c9234){return function(_0x2902c7){if(!_0x2902c7){_0x3e936c['sendStatus'](0x194);}return _0x2902c7;};}function handleError(_0x25f643,_0x3e75c4){_0x3e75c4=_0x3e75c4||0x1f4;return function(_0x23bead){logger[_0xb095('0x29')](_0x23bead[_0xb095('0x2a')]);if(_0x23bead[_0xb095('0x2b')]){delete _0x23bead['name'];}_0x25f643[_0xb095('0x21')](_0x3e75c4)[_0xb095('0x2c')](_0x23bead);};}exports[_0xb095('0x2d')]=function(_0x1c48fa,_0xcfde4f){var _0x414e9e={},_0x4960a8={},_0x5c4f1d={'count':0x0,'rows':[]};var _0x5f014f=_[_0xb095('0x2e')](db[_0xb095('0x2f')][_0xb095('0x30')],function(_0x56f9ce){return{'name':_0x56f9ce[_0xb095('0x31')],'type':_0x56f9ce[_0xb095('0x32')][_0xb095('0x33')]};});_0x4960a8[_0xb095('0x34')]=_[_0xb095('0x2e')](_0x5f014f,_0xb095('0x2b'));_0x4960a8[_0xb095('0x35')]=_[_0xb095('0x36')](_0x1c48fa[_0xb095('0x35')]);_0x4960a8[_0xb095('0x37')]=_[_0xb095('0x38')](_0x4960a8[_0xb095('0x34')],_0x4960a8[_0xb095('0x35')]);_0x414e9e['attributes']=_[_0xb095('0x38')](_0x4960a8[_0xb095('0x34')],qs[_0xb095('0x39')](_0x1c48fa[_0xb095('0x35')][_0xb095('0x39')]));_0x414e9e[_0xb095('0x3a')]=_0x414e9e[_0xb095('0x3a')][_0xb095('0x3b')]?_0x414e9e[_0xb095('0x3a')]:_0x4960a8[_0xb095('0x34')];if(!_0x1c48fa['query'][_0xb095('0x3c')](_0xb095('0x3d'))){_0x414e9e[_0xb095('0x1f')]=qs[_0xb095('0x1f')](_0x1c48fa[_0xb095('0x35')]['limit']);_0x414e9e['offset']=qs['offset'](_0x1c48fa[_0xb095('0x35')]['offset']);}_0x414e9e[_0xb095('0x3e')]=qs['sort'](_0x1c48fa[_0xb095('0x35')][_0xb095('0x3f')]);_0x414e9e[_0xb095('0x40')]=qs[_0xb095('0x37')](_[_0xb095('0x41')](_0x1c48fa[_0xb095('0x35')],_0x4960a8[_0xb095('0x37')]),_0x5f014f);if(_0x1c48fa[_0xb095('0x35')][_0xb095('0x42')]){_0x414e9e[_0xb095('0x40')]=_[_0xb095('0x43')](_0x414e9e[_0xb095('0x40')],{'$or':_[_0xb095('0x2e')](_0x5f014f,function(_0x55e6a7){if(_0x55e6a7[_0xb095('0x32')]!==_0xb095('0x44')){var _0x476e5f={};_0x476e5f[_0x55e6a7['name']]={'$like':'%'+_0x1c48fa[_0xb095('0x35')][_0xb095('0x42')]+'%'};return _0x476e5f;}})});}_0x414e9e=_['merge']({},_0x414e9e,_0x1c48fa['options']);var _0x2e8cc5={'where':_0x414e9e['where']};return db['OpenchannelQueueReport'][_0xb095('0x20')](_0x2e8cc5)[_0xb095('0x26')](function(_0x3d8806){_0x5c4f1d[_0xb095('0x20')]=_0x3d8806;if(_0x1c48fa['query'][_0xb095('0x45')]){_0x414e9e[_0xb095('0x46')]=[{'all':!![]}];}return db[_0xb095('0x2f')][_0xb095('0x47')](_0x414e9e);})['then'](function(_0x8a83ae){_0x5c4f1d[_0xb095('0x48')]=_0x8a83ae;return _0x5c4f1d;})[_0xb095('0x26')](respondWithFilteredResult(_0xcfde4f,_0x414e9e))[_0xb095('0x49')](handleError(_0xcfde4f,null));};exports[_0xb095('0x4a')]=function(_0x387636,_0x51acad){var _0x15d58c={'raw':!![],'where':{'id':_0x387636['params']['id']}},_0xe2198={};_0xe2198[_0xb095('0x34')]=_[_0xb095('0x36')](db['OpenchannelQueueReport'][_0xb095('0x30')]);_0xe2198[_0xb095('0x35')]=_[_0xb095('0x36')](_0x387636[_0xb095('0x35')]);_0xe2198[_0xb095('0x37')]=_['intersection'](_0xe2198[_0xb095('0x34')],_0xe2198[_0xb095('0x35')]);_0x15d58c[_0xb095('0x3a')]=_['intersection'](_0xe2198['model'],qs[_0xb095('0x39')](_0x387636['query'][_0xb095('0x39')]));_0x15d58c[_0xb095('0x3a')]=_0x15d58c[_0xb095('0x3a')][_0xb095('0x3b')]?_0x15d58c[_0xb095('0x3a')]:_0xe2198[_0xb095('0x34')];if(_0x387636[_0xb095('0x35')][_0xb095('0x45')]){_0x15d58c[_0xb095('0x46')]=[{'all':!![]}];}_0x15d58c=_[_0xb095('0x43')]({},_0x15d58c,_0x387636['options']);return db['OpenchannelQueueReport'][_0xb095('0x4b')](_0x15d58c)[_0xb095('0x26')](handleEntityNotFound(_0x51acad,null))['then'](respondWithResult(_0x51acad,null))[_0xb095('0x49')](handleError(_0x51acad,null));};exports[_0xb095('0x4c')]=function(_0x4555ac,_0x2dd3be){return db[_0xb095('0x2f')][_0xb095('0x4c')](_0x4555ac[_0xb095('0x4d')],{})[_0xb095('0x26')](respondWithResult(_0x2dd3be,0xc9))[_0xb095('0x49')](handleError(_0x2dd3be,null));};exports['update']=function(_0x31eb85,_0x34430b){if(_0x31eb85['body']['id']){delete _0x31eb85[_0xb095('0x4d')]['id'];}return db[_0xb095('0x2f')][_0xb095('0x4b')]({'where':{'id':_0x31eb85[_0xb095('0x4e')]['id']}})[_0xb095('0x26')](handleEntityNotFound(_0x34430b,null))[_0xb095('0x26')](saveUpdates(_0x31eb85[_0xb095('0x4d')],null))[_0xb095('0x26')](respondWithResult(_0x34430b,null))[_0xb095('0x49')](handleError(_0x34430b,null));};exports['destroy']=function(_0x472b3f,_0x346547){return db[_0xb095('0x2f')][_0xb095('0x4b')]({'where':{'id':_0x472b3f[_0xb095('0x4e')]['id']}})[_0xb095('0x26')](handleEntityNotFound(_0x346547,null))[_0xb095('0x26')](removeEntity(_0x346547,null))[_0xb095('0x49')](handleError(_0x346547,null));};exports[_0xb095('0x4f')]=function(_0x3d5088,_0x51e17){return db[_0xb095('0x2f')][_0xb095('0x4f')]()['then'](respondWithResult(_0x51e17,null))['catch'](handleError(_0x51e17,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 699efd4..55ef840 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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0xbe7ba2,_0x471ee0){var _0x5e7208=function(_0x42767a){while(--_0x42767a){_0xbe7ba2['push'](_0xbe7ba2['shift']());}};_0x5e7208(++_0x471ee0);}(_0x1261,0x144));var _0x1126=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0x1261[_0x3b19ea];return _0x40ece9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x251ea1,_0x4271e8){var _0x144bf6=function(_0x2952f0){while(--_0x2952f0){_0x251ea1['push'](_0x251ea1['shift']());}};_0x144bf6(++_0x4271e8);}(_0x7a54,0x106));var _0x47a5=function(_0x17269a,_0x5e759d){_0x17269a=_0x17269a-0x0;var _0x26aedc=_0x7a54[_0x17269a];return _0x26aedc;};'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/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 50b6f67..723b21d 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 _0xa866=['catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result'];(function(_0x51cb49,_0x433990){var _0x3aff08=function(_0x3a456c){while(--_0x3a456c){_0x51cb49['push'](_0x51cb49['shift']());}};_0x3aff08(++_0x433990);}(_0xa866,0x6a));var _0x6a86=function(_0x65d0b7,_0x1814ea){_0x65d0b7=_0x65d0b7-0x0;var _0x400c42=_0xa866[_0x65d0b7];return _0x400c42;};'use strict';var _=require(_0x6a86('0x0'));var util=require(_0x6a86('0x1'));var moment=require(_0x6a86('0x2'));var BPromise=require(_0x6a86('0x3'));var rs=require(_0x6a86('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a86('0x5'))['db'];var utils=require(_0x6a86('0x6'));var logger=require(_0x6a86('0x7'))('rpc');var config=require(_0x6a86('0x8'));var jayson=require(_0x6a86('0x9'));var client=jayson[_0x6a86('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183997,_0x288910,_0x3ed589){return new BPromise(function(_0x1330e1,_0x37e3ee){return client[_0x6a86('0xb')](_0x183997,_0x3ed589)[_0x6a86('0xc')](function(_0x4a83c9){logger[_0x6a86('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x288910,_0x6a86('0xe'));logger[_0x6a86('0xf')](_0x6a86('0x10'),_0x288910,'request\x20sent',JSON[_0x6a86('0x11')](_0x4a83c9));if(_0x4a83c9[_0x6a86('0x12')]){if(_0x4a83c9['error']['code']===0x1f4){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);return _0x37e3ee(_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);}logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9['error'][_0x6a86('0x14')]);return _0x1330e1(_0x4a83c9[_0x6a86('0x12')]['message']);}else{logger[_0x6a86('0xd')](_0x6a86('0x13'),_0x288910,_0x6a86('0xe'));_0x1330e1(_0x4a83c9[_0x6a86('0x15')][_0x6a86('0x14')]);}})[_0x6a86('0x16')](function(_0x500b59){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x500b59);_0x37e3ee(_0x500b59);});});}exports['CreateOpenchannelQueueReport']=function(_0x50024d){var _0x11fe3b=this;return new Promise(function(_0x535fd9,_0x588a2f){return db[_0x6a86('0x17')][_0x6a86('0x18')](_0x50024d[_0x6a86('0x19')],{'raw':_0x50024d['options']?_0x50024d[_0x6a86('0x1a')][_0x6a86('0x1b')]===undefined?!![]:![]:!![]})[_0x6a86('0xc')](function(_0x262bf5){logger[_0x6a86('0xd')](_0x6a86('0x1c'),_0x50024d);logger['debug']('CreateOpenchannelQueueReport',_0x50024d,JSON['stringify'](_0x262bf5));_0x535fd9(_0x262bf5);})[_0x6a86('0x16')](function(_0x2007c7){logger[_0x6a86('0x12')](_0x6a86('0x1c'),_0x2007c7['message'],_0x50024d);_0x588a2f(_0x11fe3b[_0x6a86('0x12')](0x1f4,_0x2007c7[_0x6a86('0x14')]));});});};exports[_0x6a86('0x1d')]=function(_0x3f2b70){var _0x19382d=this;return new Promise(function(_0x1c41a7,_0x46f6c7){return db[_0x6a86('0x17')][_0x6a86('0x1e')](_0x3f2b70['body'],{'raw':_0x3f2b70['options']?_0x3f2b70[_0x6a86('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f2b70[_0x6a86('0x1a')]?_0x3f2b70[_0x6a86('0x1a')]['where']||null:null,'attributes':_0x3f2b70[_0x6a86('0x1a')]?_0x3f2b70[_0x6a86('0x1a')][_0x6a86('0x1f')]||null:null,'limit':_0x3f2b70['options']?_0x3f2b70[_0x6a86('0x1a')]['limit']||null:null})['then'](function(_0x4d8bf0){logger[_0x6a86('0xd')](_0x6a86('0x1d'),_0x3f2b70);logger[_0x6a86('0xf')]('UpdateOpenchannelQueueReport',_0x3f2b70,JSON[_0x6a86('0x11')](_0x4d8bf0));_0x1c41a7(_0x4d8bf0);})[_0x6a86('0x16')](function(_0x1bb745){logger[_0x6a86('0x12')]('UpdateOpenchannelQueueReport',_0x1bb745[_0x6a86('0x14')],_0x3f2b70);_0x46f6c7(_0x19382d['error'](0x1f4,_0x1bb745[_0x6a86('0x14')]));});});}; \ No newline at end of file +var _0x7382=['error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xdc02cd,_0x3064f6){var _0x328c00=function(_0x152ed9){while(--_0x152ed9){_0xdc02cd['push'](_0xdc02cd['shift']());}};_0x328c00(++_0x3064f6);}(_0x7382,0x111));var _0x2738=function(_0x34c84d,_0xa94d7e){_0x34c84d=_0x34c84d-0x0;var _0x55f3af=_0x7382[_0x34c84d];return _0x55f3af;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2738('0x1'));var logger=require(_0x2738('0x2'))(_0x2738('0x3'));var config=require(_0x2738('0x4'));var jayson=require(_0x2738('0x5'));var client=jayson['client'][_0x2738('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2bc38a,_0xd74b07,_0x523aef){return new BPromise(function(_0x4235e7,_0x487d14){return client[_0x2738('0x7')](_0x2bc38a,_0x523aef)['then'](function(_0x476864){logger[_0x2738('0x8')](_0x2738('0x9'),_0xd74b07,'request\x20sent');logger[_0x2738('0xa')](_0x2738('0xb'),_0xd74b07,_0x2738('0xc'),JSON['stringify'](_0x476864));if(_0x476864['error']){if(_0x476864[_0x2738('0xd')][_0x2738('0xe')]===0x1f4){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')][_0x2738('0xf')]);return _0x487d14(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')]['message']);return _0x4235e7(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}else{logger['info'](_0x2738('0x9'),_0xd74b07,'request\x20sent');_0x4235e7(_0x476864[_0x2738('0x10')]['message']);}})[_0x2738('0x11')](function(_0x568065){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x568065);_0x487d14(_0x568065);});});}exports[_0x2738('0x12')]=function(_0x3c6810){var _0x1d0aca=this;return new Promise(function(_0x1e0f57,_0x42685a){return db[_0x2738('0x13')]['create'](_0x3c6810[_0x2738('0x14')],{'raw':_0x3c6810['options']?_0x3c6810[_0x2738('0x15')][_0x2738('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5a1d61){logger[_0x2738('0x8')](_0x2738('0x12'),_0x3c6810);logger[_0x2738('0xa')](_0x2738('0x12'),_0x3c6810,JSON[_0x2738('0x17')](_0x5a1d61));_0x1e0f57(_0x5a1d61);})[_0x2738('0x11')](function(_0x18e1d8){logger[_0x2738('0xd')](_0x2738('0x12'),_0x18e1d8[_0x2738('0xf')],_0x3c6810);_0x42685a(_0x1d0aca[_0x2738('0xd')](0x1f4,_0x18e1d8['message']));});});};exports[_0x2738('0x18')]=function(_0x537c5f){var _0x51ee19=this;return new Promise(function(_0x3e3b2d,_0x2d8c5b){return db[_0x2738('0x13')][_0x2738('0x19')](_0x537c5f[_0x2738('0x14')],{'raw':_0x537c5f[_0x2738('0x15')]?_0x537c5f[_0x2738('0x15')][_0x2738('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x537c5f['options']?_0x537c5f[_0x2738('0x15')]['where']||null:null,'attributes':_0x537c5f[_0x2738('0x15')]?_0x537c5f[_0x2738('0x15')]['attributes']||null:null,'limit':_0x537c5f[_0x2738('0x15')]?_0x537c5f[_0x2738('0x15')]['limit']||null:null})['then'](function(_0x4fad4c){logger['info'](_0x2738('0x18'),_0x537c5f);logger[_0x2738('0xa')](_0x2738('0x18'),_0x537c5f,JSON[_0x2738('0x17')](_0x4fad4c));_0x3e3b2d(_0x4fad4c);})[_0x2738('0x11')](function(_0x2b317c){logger['error'](_0x2738('0x18'),_0x2b317c[_0x2738('0xf')],_0x537c5f);_0x2d8c5b(_0x51ee19[_0x2738('0xd')](0x1f4,_0x2b317c[_0x2738('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index aed6b62..a939b75 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 _0x0f87=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','post','create','put','update','delete','destroy'];(function(_0x5bec3d,_0x58f3ba){var _0x1d9907=function(_0x1b36d6){while(--_0x1b36d6){_0x5bec3d['push'](_0x5bec3d['shift']());}};_0x1d9907(++_0x58f3ba);}(_0x0f87,0xd3));var _0x70f8=function(_0x457b2e,_0x1803c0){_0x457b2e=_0x457b2e-0x0;var _0x4124a0=_0x0f87[_0x457b2e];return _0x4124a0;};'use strict';var multer=require(_0x70f8('0x0'));var util=require(_0x70f8('0x1'));var path=require(_0x70f8('0x2'));var timeout=require(_0x70f8('0x3'));var express=require('express');var router=express[_0x70f8('0x4')]();var fs_extra=require(_0x70f8('0x5'));var auth=require(_0x70f8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x70f8('0x7'));var controller=require(_0x70f8('0x8'));router['get']('/',auth[_0x70f8('0x9')](),controller['index']);router[_0x70f8('0xa')](_0x70f8('0xb'),auth[_0x70f8('0x9')](),controller[_0x70f8('0xc')]);router['get'](_0x70f8('0xd'),auth[_0x70f8('0x9')](),controller['show']);router[_0x70f8('0xe')]('/',auth['isAuthenticated'](),controller[_0x70f8('0xf')]);router[_0x70f8('0x10')](_0x70f8('0xd'),auth['isAuthenticated'](),controller[_0x70f8('0x11')]);router[_0x70f8('0x12')](_0x70f8('0xd'),auth[_0x70f8('0x9')](),controller[_0x70f8('0x13')]);module[_0x70f8('0x14')]=router; \ No newline at end of file +var _0x7bf8=['isAuthenticated','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get'];(function(_0x12ec56,_0x423f22){var _0x1c6668=function(_0x20361f){while(--_0x20361f){_0x12ec56['push'](_0x12ec56['shift']());}};_0x1c6668(++_0x423f22);}(_0x7bf8,0x16f));var _0x87bf=function(_0x583c79,_0x24cd4b){_0x583c79=_0x583c79-0x0;var _0x5b2142=_0x7bf8[_0x583c79];return _0x5b2142;};'use strict';var multer=require(_0x87bf('0x0'));var util=require(_0x87bf('0x1'));var path=require(_0x87bf('0x2'));var timeout=require(_0x87bf('0x3'));var express=require(_0x87bf('0x4'));var router=express[_0x87bf('0x5')]();var fs_extra=require(_0x87bf('0x6'));var auth=require(_0x87bf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x87bf('0x8'));var controller=require(_0x87bf('0x9'));router[_0x87bf('0xa')]('/',auth[_0x87bf('0xb')](),controller['index']);router[_0x87bf('0xa')](_0x87bf('0xc'),auth[_0x87bf('0xb')](),controller[_0x87bf('0xd')]);router[_0x87bf('0xa')](_0x87bf('0xe'),auth['isAuthenticated'](),controller[_0x87bf('0xf')]);router[_0x87bf('0x10')]('/',auth[_0x87bf('0xb')](),controller['create']);router['put'](_0x87bf('0xe'),auth[_0x87bf('0xb')](),controller[_0x87bf('0x11')]);router[_0x87bf('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x87bf('0x13')]);module[_0x87bf('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index c477969..8248dca 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x4c04a1,_0x41ede1){var _0x352e1e=function(_0x352c83){while(--_0x352c83){_0x4c04a1['push'](_0x4c04a1['shift']());}};_0x352e1e(++_0x41ede1);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0x4b84[_0x1e4f2f];return _0xccea89;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x36feb2,_0x53abef){var _0x292b43=function(_0x52a460){while(--_0x52a460){_0x36feb2['push'](_0x36feb2['shift']());}};_0x292b43(++_0x53abef);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5024f2,_0x161d6d){_0x5024f2=_0x5024f2-0x0;var _0x4383f8=_0xb43b[_0x5024f2];return _0x4383f8;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 9d3039e..b13da93 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 _0x4f43=['merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','findAll','rows','catch','show','keys','intersection','length','include','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','type','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2f0125,_0x43c00f){var _0x15a766=function(_0x1a3e71){while(--_0x1a3e71){_0x2f0125['push'](_0x2f0125['shift']());}};_0x15a766(++_0x43c00f);}(_0x4f43,0x142));var _0x34f4=function(_0x405803,_0x39b8b9){_0x405803=_0x405803-0x0;var _0x448d8f=_0x4f43[_0x405803];return _0x448d8f;};'use strict';var emlformat=require(_0x34f4('0x0'));var rimraf=require(_0x34f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34f4('0x2'));var rp=require(_0x34f4('0x3'));var moment=require(_0x34f4('0x4'));var BPromise=require(_0x34f4('0x5'));var Mustache=require('mustache');var util=require(_0x34f4('0x6'));var path=require('path');var sox=require(_0x34f4('0x7'));var csv=require(_0x34f4('0x8'));var ejs=require(_0x34f4('0x9'));var fs=require('fs');var fs_extra=require(_0x34f4('0xa'));var _=require(_0x34f4('0xb'));var squel=require(_0x34f4('0xc'));var crypto=require('crypto');var jsforce=require(_0x34f4('0xd'));var deskjs=require(_0x34f4('0xe'));var toCsv=require(_0x34f4('0x8'));var querystring=require(_0x34f4('0xf'));var Papa=require(_0x34f4('0x10'));var Redis=require('ioredis');var authService=require(_0x34f4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x34f4('0x12'));var hardwareService=require(_0x34f4('0x13'));var logger=require(_0x34f4('0x14'))(_0x34f4('0x15'));var utils=require(_0x34f4('0x16'));var config=require(_0x34f4('0x17'));var licenseUtil=require(_0x34f4('0x18'));var db=require(_0x34f4('0x19'))['db'];function respondWithStatusCode(_0x562f9c,_0x5ce710){_0x5ce710=_0x5ce710||0xcc;return function(_0x1d9f20){if(_0x1d9f20){return _0x562f9c[_0x34f4('0x1a')](_0x5ce710);}return _0x562f9c[_0x34f4('0x1b')](_0x5ce710)[_0x34f4('0x1c')]();};}function respondWithResult(_0x33e233,_0x38cad3){_0x38cad3=_0x38cad3||0xc8;return function(_0x216e78){if(_0x216e78){return _0x33e233[_0x34f4('0x1b')](_0x38cad3)[_0x34f4('0x1d')](_0x216e78);}};}function respondWithFilteredResult(_0x5091e5,_0x54e6d7){return function(_0x5da570){if(_0x5da570){var _0x1384bf=typeof _0x54e6d7[_0x34f4('0x1e')]==='undefined'&&typeof _0x54e6d7[_0x34f4('0x1f')]===_0x34f4('0x20');var _0x524791=_0x5da570[_0x34f4('0x21')];var _0x43a6f4=_0x1384bf?0x0:_0x54e6d7[_0x34f4('0x1e')];var _0xd1bfc6=_0x1384bf?_0x5da570[_0x34f4('0x21')]:_0x54e6d7[_0x34f4('0x1e')]+_0x54e6d7[_0x34f4('0x1f')];var _0x54d643;if(_0xd1bfc6>=_0x524791){_0xd1bfc6=_0x524791;_0x54d643=0xc8;}else{_0x54d643=0xce;}_0x5091e5['status'](_0x54d643);return _0x5091e5[_0x34f4('0x22')]('Content-Range',_0x43a6f4+'-'+_0xd1bfc6+'/'+_0x524791)[_0x34f4('0x1d')](_0x5da570);}return null;};}function patchUpdates(_0x435c23){return function(_0x128f97){try{jsonpatch[_0x34f4('0x23')](_0x128f97,_0x435c23,!![]);}catch(_0x5965c9){return BPromise[_0x34f4('0x24')](_0x5965c9);}return _0x128f97['save']();};}function saveUpdates(_0x2076f6,_0x2a7ce8){return function(_0x1fdba0){if(_0x1fdba0){return _0x1fdba0[_0x34f4('0x25')](_0x2076f6)[_0x34f4('0x26')](function(_0x2c4bdd){return _0x2c4bdd;});}return null;};}function removeEntity(_0x34ba58,_0x3d4106){return function(_0x4761d5){if(_0x4761d5){return _0x4761d5['destroy']()[_0x34f4('0x26')](function(){_0x34ba58[_0x34f4('0x1b')](0xcc)[_0x34f4('0x1c')]();});}};}function handleEntityNotFound(_0x366124,_0x32d91d){return function(_0x2cd1ef){if(!_0x2cd1ef){_0x366124[_0x34f4('0x1a')](0x194);}return _0x2cd1ef;};}function handleError(_0x13e748,_0x1bfc78){_0x1bfc78=_0x1bfc78||0x1f4;return function(_0x5bd2aa){logger[_0x34f4('0x27')](_0x5bd2aa[_0x34f4('0x28')]);if(_0x5bd2aa[_0x34f4('0x29')]){delete _0x5bd2aa[_0x34f4('0x29')];}_0x13e748[_0x34f4('0x1b')](_0x1bfc78)[_0x34f4('0x2a')](_0x5bd2aa);};}exports[_0x34f4('0x2b')]=function(_0x41c9f7,_0x26ba3c){var _0x2ac8ce={},_0x54bc50={},_0x5ae0e2={'count':0x0,'rows':[]};var _0x40931a=_[_0x34f4('0x2c')](db['OpenchannelTransferReport'][_0x34f4('0x2d')],function(_0x1ccfd3){return{'name':_0x1ccfd3['fieldName'],'type':_0x1ccfd3[_0x34f4('0x2e')]['key']};});_0x54bc50[_0x34f4('0x2f')]=_[_0x34f4('0x2c')](_0x40931a,_0x34f4('0x29'));_0x54bc50[_0x34f4('0x30')]=_['keys'](_0x41c9f7['query']);_0x54bc50[_0x34f4('0x31')]=_['intersection'](_0x54bc50[_0x34f4('0x2f')],_0x54bc50['query']);_0x2ac8ce[_0x34f4('0x32')]=_['intersection'](_0x54bc50[_0x34f4('0x2f')],qs[_0x34f4('0x33')](_0x41c9f7[_0x34f4('0x30')]['fields']));_0x2ac8ce[_0x34f4('0x32')]=_0x2ac8ce['attributes']['length']?_0x2ac8ce[_0x34f4('0x32')]:_0x54bc50[_0x34f4('0x2f')];if(!_0x41c9f7[_0x34f4('0x30')][_0x34f4('0x34')](_0x34f4('0x35'))){_0x2ac8ce[_0x34f4('0x1f')]=qs['limit'](_0x41c9f7[_0x34f4('0x30')][_0x34f4('0x1f')]);_0x2ac8ce['offset']=qs['offset'](_0x41c9f7[_0x34f4('0x30')][_0x34f4('0x1e')]);}_0x2ac8ce[_0x34f4('0x36')]=qs[_0x34f4('0x37')](_0x41c9f7[_0x34f4('0x30')]['sort']);_0x2ac8ce[_0x34f4('0x38')]=qs[_0x34f4('0x31')](_[_0x34f4('0x39')](_0x41c9f7[_0x34f4('0x30')],_0x54bc50[_0x34f4('0x31')]),_0x40931a);if(_0x41c9f7[_0x34f4('0x30')]['filter']){_0x2ac8ce[_0x34f4('0x38')]=_[_0x34f4('0x3a')](_0x2ac8ce[_0x34f4('0x38')],{'$or':_[_0x34f4('0x2c')](_0x40931a,function(_0x4b4687){if(_0x4b4687[_0x34f4('0x2e')]!==_0x34f4('0x3b')){var _0x28328a={};_0x28328a[_0x4b4687[_0x34f4('0x29')]]={'$like':'%'+_0x41c9f7[_0x34f4('0x30')]['filter']+'%'};return _0x28328a;}})});}_0x2ac8ce=_[_0x34f4('0x3a')]({},_0x2ac8ce,_0x41c9f7[_0x34f4('0x3c')]);var _0xd1286a={'where':_0x2ac8ce[_0x34f4('0x38')]};return db[_0x34f4('0x3d')][_0x34f4('0x21')](_0xd1286a)['then'](function(_0x40b5a5){_0x5ae0e2[_0x34f4('0x21')]=_0x40b5a5;if(_0x41c9f7[_0x34f4('0x30')][_0x34f4('0x3e')]){_0x2ac8ce['include']=[{'all':!![]}];}return db[_0x34f4('0x3d')][_0x34f4('0x3f')](_0x2ac8ce);})[_0x34f4('0x26')](function(_0x1270be){_0x5ae0e2[_0x34f4('0x40')]=_0x1270be;return _0x5ae0e2;})[_0x34f4('0x26')](respondWithFilteredResult(_0x26ba3c,_0x2ac8ce))[_0x34f4('0x41')](handleError(_0x26ba3c,null));};exports[_0x34f4('0x42')]=function(_0x298f93,_0x39ad2e){var _0x5f5792={'raw':!![],'where':{'id':_0x298f93['params']['id']}},_0x6010bc={};_0x6010bc[_0x34f4('0x2f')]=_[_0x34f4('0x43')](db[_0x34f4('0x3d')][_0x34f4('0x2d')]);_0x6010bc[_0x34f4('0x30')]=_[_0x34f4('0x43')](_0x298f93[_0x34f4('0x30')]);_0x6010bc[_0x34f4('0x31')]=_['intersection'](_0x6010bc[_0x34f4('0x2f')],_0x6010bc[_0x34f4('0x30')]);_0x5f5792[_0x34f4('0x32')]=_[_0x34f4('0x44')](_0x6010bc['model'],qs[_0x34f4('0x33')](_0x298f93['query'][_0x34f4('0x33')]));_0x5f5792[_0x34f4('0x32')]=_0x5f5792['attributes'][_0x34f4('0x45')]?_0x5f5792['attributes']:_0x6010bc[_0x34f4('0x2f')];if(_0x298f93[_0x34f4('0x30')][_0x34f4('0x3e')]){_0x5f5792[_0x34f4('0x46')]=[{'all':!![]}];}_0x5f5792=_['merge']({},_0x5f5792,_0x298f93[_0x34f4('0x3c')]);return db[_0x34f4('0x3d')][_0x34f4('0x47')](_0x5f5792)[_0x34f4('0x26')](handleEntityNotFound(_0x39ad2e,null))[_0x34f4('0x26')](respondWithResult(_0x39ad2e,null))[_0x34f4('0x41')](handleError(_0x39ad2e,null));};exports[_0x34f4('0x48')]=function(_0x42998a,_0x44e382){return db[_0x34f4('0x3d')][_0x34f4('0x48')](_0x42998a[_0x34f4('0x49')],{})[_0x34f4('0x26')](respondWithResult(_0x44e382,0xc9))[_0x34f4('0x41')](handleError(_0x44e382,null));};exports[_0x34f4('0x25')]=function(_0x1eaa19,_0x42e977){if(_0x1eaa19['body']['id']){delete _0x1eaa19[_0x34f4('0x49')]['id'];}return db[_0x34f4('0x3d')][_0x34f4('0x47')]({'where':{'id':_0x1eaa19[_0x34f4('0x4a')]['id']}})[_0x34f4('0x26')](handleEntityNotFound(_0x42e977,null))[_0x34f4('0x26')](saveUpdates(_0x1eaa19[_0x34f4('0x49')],null))['then'](respondWithResult(_0x42e977,null))['catch'](handleError(_0x42e977,null));};exports['destroy']=function(_0x56d77d,_0x2f3d54){return db[_0x34f4('0x3d')][_0x34f4('0x47')]({'where':{'id':_0x56d77d[_0x34f4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2f3d54,null))[_0x34f4('0x26')](removeEntity(_0x2f3d54,null))[_0x34f4('0x41')](handleError(_0x2f3d54,null));};exports[_0x34f4('0x4b')]=function(_0x3fd15b,_0x5a7b5e){return db[_0x34f4('0x3d')]['describe']()[_0x34f4('0x26')](respondWithResult(_0x5a7b5e,null))[_0x34f4('0x41')](handleError(_0x5a7b5e,null));}; \ No newline at end of file +var _0xcedf=['filter','merge','type','VIRTUAL','options','OpenchannelTransferReport','count','findAll','rows','catch','show','intersection','includeAll','include','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','map','rawAttributes','fieldName','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x4bf5cd,_0xddf2f2){var _0x2f9e5a=function(_0x32acef){while(--_0x32acef){_0x4bf5cd['push'](_0x4bf5cd['shift']());}};_0x2f9e5a(++_0xddf2f2);}(_0xcedf,0x14c));var _0xfced=function(_0x3c9eb8,_0x278a24){_0x3c9eb8=_0x3c9eb8-0x0;var _0x1b3109=_0xcedf[_0x3c9eb8];return _0x1b3109;};'use strict';var emlformat=require(_0xfced('0x0'));var rimraf=require(_0xfced('0x1'));var zipdir=require(_0xfced('0x2'));var jsonpatch=require(_0xfced('0x3'));var rp=require(_0xfced('0x4'));var moment=require(_0xfced('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfced('0x6'));var util=require(_0xfced('0x7'));var path=require(_0xfced('0x8'));var sox=require('sox');var csv=require(_0xfced('0x9'));var ejs=require(_0xfced('0xa'));var fs=require('fs');var fs_extra=require(_0xfced('0xb'));var _=require(_0xfced('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfced('0xd'));var deskjs=require(_0xfced('0xe'));var toCsv=require(_0xfced('0x9'));var querystring=require(_0xfced('0xf'));var Papa=require(_0xfced('0x10'));var Redis=require(_0xfced('0x11'));var authService=require(_0xfced('0x12'));var qs=require(_0xfced('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfced('0x14'));var logger=require(_0xfced('0x15'))(_0xfced('0x16'));var utils=require(_0xfced('0x17'));var config=require(_0xfced('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfced('0x19'))['db'];function respondWithStatusCode(_0x1c564c,_0xa1b34b){_0xa1b34b=_0xa1b34b||0xcc;return function(_0x5a4c54){if(_0x5a4c54){return _0x1c564c[_0xfced('0x1a')](_0xa1b34b);}return _0x1c564c[_0xfced('0x1b')](_0xa1b34b)['end']();};}function respondWithResult(_0x21418d,_0x142736){_0x142736=_0x142736||0xc8;return function(_0x59d22b){if(_0x59d22b){return _0x21418d[_0xfced('0x1b')](_0x142736)[_0xfced('0x1c')](_0x59d22b);}};}function respondWithFilteredResult(_0x1e3a67,_0x3003af){return function(_0x34af7e){if(_0x34af7e){var _0x3cb101=typeof _0x3003af['offset']===_0xfced('0x1d')&&typeof _0x3003af['limit']==='undefined';var _0x2b0a23=_0x34af7e['count'];var _0x554551=_0x3cb101?0x0:_0x3003af['offset'];var _0x5cc8f6=_0x3cb101?_0x34af7e['count']:_0x3003af[_0xfced('0x1e')]+_0x3003af[_0xfced('0x1f')];var _0x17eb88;if(_0x5cc8f6>=_0x2b0a23){_0x5cc8f6=_0x2b0a23;_0x17eb88=0xc8;}else{_0x17eb88=0xce;}_0x1e3a67[_0xfced('0x1b')](_0x17eb88);return _0x1e3a67[_0xfced('0x20')](_0xfced('0x21'),_0x554551+'-'+_0x5cc8f6+'/'+_0x2b0a23)[_0xfced('0x1c')](_0x34af7e);}return null;};}function patchUpdates(_0x197c42){return function(_0x24918b){try{jsonpatch[_0xfced('0x22')](_0x24918b,_0x197c42,!![]);}catch(_0x4dcb57){return BPromise[_0xfced('0x23')](_0x4dcb57);}return _0x24918b['save']();};}function saveUpdates(_0x4f6e67,_0x306579){return function(_0x4c191d){if(_0x4c191d){return _0x4c191d[_0xfced('0x24')](_0x4f6e67)[_0xfced('0x25')](function(_0x4be32f){return _0x4be32f;});}return null;};}function removeEntity(_0x5043cf,_0x42aead){return function(_0x5ef456){if(_0x5ef456){return _0x5ef456['destroy']()[_0xfced('0x25')](function(){_0x5043cf[_0xfced('0x1b')](0xcc)[_0xfced('0x26')]();});}};}function handleEntityNotFound(_0x28c399,_0x7be14a){return function(_0x3c129c){if(!_0x3c129c){_0x28c399['sendStatus'](0x194);}return _0x3c129c;};}function handleError(_0x2e5bd3,_0x122e9d){_0x122e9d=_0x122e9d||0x1f4;return function(_0x4de033){logger[_0xfced('0x27')](_0x4de033[_0xfced('0x28')]);if(_0x4de033[_0xfced('0x29')]){delete _0x4de033[_0xfced('0x29')];}_0x2e5bd3[_0xfced('0x1b')](_0x122e9d)[_0xfced('0x2a')](_0x4de033);};}exports['index']=function(_0xfd5687,_0x3c2b5e){var _0x47ff83={},_0x50d5e7={},_0x3efad3={'count':0x0,'rows':[]};var _0x30d151=_[_0xfced('0x2b')](db['OpenchannelTransferReport'][_0xfced('0x2c')],function(_0x51a3c2){return{'name':_0x51a3c2[_0xfced('0x2d')],'type':_0x51a3c2['type'][_0xfced('0x2e')]};});_0x50d5e7[_0xfced('0x2f')]=_[_0xfced('0x2b')](_0x30d151,_0xfced('0x29'));_0x50d5e7['query']=_[_0xfced('0x30')](_0xfd5687['query']);_0x50d5e7[_0xfced('0x31')]=_['intersection'](_0x50d5e7[_0xfced('0x2f')],_0x50d5e7[_0xfced('0x32')]);_0x47ff83[_0xfced('0x33')]=_['intersection'](_0x50d5e7[_0xfced('0x2f')],qs[_0xfced('0x34')](_0xfd5687[_0xfced('0x32')][_0xfced('0x34')]));_0x47ff83['attributes']=_0x47ff83['attributes'][_0xfced('0x35')]?_0x47ff83[_0xfced('0x33')]:_0x50d5e7[_0xfced('0x2f')];if(!_0xfd5687['query'][_0xfced('0x36')](_0xfced('0x37'))){_0x47ff83[_0xfced('0x1f')]=qs['limit'](_0xfd5687['query'][_0xfced('0x1f')]);_0x47ff83['offset']=qs[_0xfced('0x1e')](_0xfd5687['query'][_0xfced('0x1e')]);}_0x47ff83['order']=qs[_0xfced('0x38')](_0xfd5687[_0xfced('0x32')][_0xfced('0x38')]);_0x47ff83[_0xfced('0x39')]=qs[_0xfced('0x31')](_['pick'](_0xfd5687[_0xfced('0x32')],_0x50d5e7['filters']),_0x30d151);if(_0xfd5687[_0xfced('0x32')][_0xfced('0x3a')]){_0x47ff83[_0xfced('0x39')]=_[_0xfced('0x3b')](_0x47ff83['where'],{'$or':_[_0xfced('0x2b')](_0x30d151,function(_0x54c985){if(_0x54c985[_0xfced('0x3c')]!==_0xfced('0x3d')){var _0x25594e={};_0x25594e[_0x54c985[_0xfced('0x29')]]={'$like':'%'+_0xfd5687[_0xfced('0x32')]['filter']+'%'};return _0x25594e;}})});}_0x47ff83=_[_0xfced('0x3b')]({},_0x47ff83,_0xfd5687[_0xfced('0x3e')]);var _0x547b38={'where':_0x47ff83[_0xfced('0x39')]};return db[_0xfced('0x3f')][_0xfced('0x40')](_0x547b38)[_0xfced('0x25')](function(_0x4f4de4){_0x3efad3[_0xfced('0x40')]=_0x4f4de4;if(_0xfd5687[_0xfced('0x32')]['includeAll']){_0x47ff83['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xfced('0x41')](_0x47ff83);})[_0xfced('0x25')](function(_0x3e4792){_0x3efad3[_0xfced('0x42')]=_0x3e4792;return _0x3efad3;})[_0xfced('0x25')](respondWithFilteredResult(_0x3c2b5e,_0x47ff83))[_0xfced('0x43')](handleError(_0x3c2b5e,null));};exports[_0xfced('0x44')]=function(_0x353e23,_0x162e99){var _0x5c6a5c={'raw':!![],'where':{'id':_0x353e23['params']['id']}},_0x4ff93b={};_0x4ff93b[_0xfced('0x2f')]=_[_0xfced('0x30')](db[_0xfced('0x3f')][_0xfced('0x2c')]);_0x4ff93b['query']=_[_0xfced('0x30')](_0x353e23[_0xfced('0x32')]);_0x4ff93b[_0xfced('0x31')]=_[_0xfced('0x45')](_0x4ff93b[_0xfced('0x2f')],_0x4ff93b['query']);_0x5c6a5c['attributes']=_[_0xfced('0x45')](_0x4ff93b[_0xfced('0x2f')],qs['fields'](_0x353e23[_0xfced('0x32')][_0xfced('0x34')]));_0x5c6a5c[_0xfced('0x33')]=_0x5c6a5c[_0xfced('0x33')]['length']?_0x5c6a5c[_0xfced('0x33')]:_0x4ff93b['model'];if(_0x353e23[_0xfced('0x32')][_0xfced('0x46')]){_0x5c6a5c[_0xfced('0x47')]=[{'all':!![]}];}_0x5c6a5c=_[_0xfced('0x3b')]({},_0x5c6a5c,_0x353e23[_0xfced('0x3e')]);return db[_0xfced('0x3f')][_0xfced('0x48')](_0x5c6a5c)[_0xfced('0x25')](handleEntityNotFound(_0x162e99,null))['then'](respondWithResult(_0x162e99,null))[_0xfced('0x43')](handleError(_0x162e99,null));};exports[_0xfced('0x49')]=function(_0x3aad90,_0x119ed1){return db[_0xfced('0x3f')]['create'](_0x3aad90[_0xfced('0x4a')],{})[_0xfced('0x25')](respondWithResult(_0x119ed1,0xc9))[_0xfced('0x43')](handleError(_0x119ed1,null));};exports[_0xfced('0x24')]=function(_0x57dfc0,_0x37d06c){if(_0x57dfc0['body']['id']){delete _0x57dfc0['body']['id'];}return db[_0xfced('0x3f')][_0xfced('0x48')]({'where':{'id':_0x57dfc0[_0xfced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x37d06c,null))['then'](saveUpdates(_0x57dfc0[_0xfced('0x4a')],null))[_0xfced('0x25')](respondWithResult(_0x37d06c,null))['catch'](handleError(_0x37d06c,null));};exports[_0xfced('0x4c')]=function(_0x203ed5,_0x1a5ab1){return db[_0xfced('0x3f')][_0xfced('0x48')]({'where':{'id':_0x203ed5['params']['id']}})['then'](handleEntityNotFound(_0x1a5ab1,null))[_0xfced('0x25')](removeEntity(_0x1a5ab1,null))[_0xfced('0x43')](handleError(_0x1a5ab1,null));};exports[_0xfced('0x4d')]=function(_0x47175f,_0x513be8){return db[_0xfced('0x3f')][_0xfced('0x4d')]()[_0xfced('0x25')](respondWithResult(_0x513be8,null))['catch'](handleError(_0x513be8,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index f9a3db9..d30f415 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 _0xa496=['./openchannelTransferReport.attributes','define','OpenchannelTransferReport','uniqueid','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2c1457,_0x1becb3){var _0x28ae4e=function(_0x2768cc){while(--_0x2768cc){_0x2c1457['push'](_0x2c1457['shift']());}};_0x28ae4e(++_0x1becb3);}(_0xa496,0x14e));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6a49('0x0'));var logger=require('../../config/logger')(_0x6a49('0x1'));var moment=require('moment');var BPromise=require(_0x6a49('0x2'));var rp=require(_0x6a49('0x3'));var fs=require('fs');var path=require(_0x6a49('0x4'));var rimraf=require(_0x6a49('0x5'));var config=require(_0x6a49('0x6'));var attributes=require(_0x6a49('0x7'));module['exports']=function(_0x35ffc8,_0x2ebd77){return _0x35ffc8[_0x6a49('0x8')](_0x6a49('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x6a49('0xa'),'fields':[_0x6a49('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x253f=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x253f,0xc1));var _0xf253=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x253f[_0x187ee1];return _0x388160;};'use strict';var _=require(_0xf253('0x0'));var util=require(_0xf253('0x1'));var logger=require(_0xf253('0x2'))(_0xf253('0x3'));var moment=require(_0xf253('0x4'));var BPromise=require('bluebird');var rp=require(_0xf253('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf253('0x6'));var config=require('../../config/environment');var attributes=require(_0xf253('0x7'));module['exports']=function(_0x37dc83,_0x3450a4){return _0x37dc83[_0xf253('0x8')](_0xf253('0x9'),attributes,{'tableName':_0xf253('0xa'),'paranoid':![],'indexes':[{'name':_0xf253('0xb'),'fields':[_0xf253('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 630c27e..68636cd 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 _0x291c=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','code'];(function(_0x393de3,_0x3b9c0d){var _0x4bb83c=function(_0x2b367b){while(--_0x2b367b){_0x393de3['push'](_0x393de3['shift']());}};_0x4bb83c(++_0x3b9c0d);}(_0x291c,0x137));var _0xc291=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x291c[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xc291('0x0'));var util=require(_0xc291('0x1'));var moment=require(_0xc291('0x2'));var BPromise=require(_0xc291('0x3'));var rs=require(_0xc291('0x4'));var fs=require('fs');var Redis=require(_0xc291('0x5'));var db=require(_0xc291('0x6'))['db'];var utils=require(_0xc291('0x7'));var logger=require(_0xc291('0x8'))(_0xc291('0x9'));var config=require(_0xc291('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc291('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a7459,_0x40dc89,_0x2d3526){return new BPromise(function(_0x42a6ac,_0x26e775){return client['request'](_0x5a7459,_0x2d3526)[_0xc291('0xc')](function(_0x2beb3b){logger[_0xc291('0xd')](_0xc291('0xe'),_0x40dc89,_0xc291('0xf'));logger[_0xc291('0x10')](_0xc291('0x11'),_0x40dc89,_0xc291('0xf'),JSON['stringify'](_0x2beb3b));if(_0x2beb3b['error']){if(_0x2beb3b['error'][_0xc291('0x12')]===0x1f4){logger[_0xc291('0x13')](_0xc291('0xe'),_0x40dc89,_0x2beb3b['error'][_0xc291('0x14')]);return _0x26e775(_0x2beb3b['error'][_0xc291('0x14')]);}logger[_0xc291('0x13')](_0xc291('0xe'),_0x40dc89,_0x2beb3b[_0xc291('0x13')][_0xc291('0x14')]);return _0x42a6ac(_0x2beb3b[_0xc291('0x13')][_0xc291('0x14')]);}else{logger[_0xc291('0xd')](_0xc291('0xe'),_0x40dc89,_0xc291('0xf'));_0x42a6ac(_0x2beb3b['result'][_0xc291('0x14')]);}})[_0xc291('0x15')](function(_0x5888de){logger[_0xc291('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x40dc89,_0x5888de);_0x26e775(_0x5888de);});});} \ No newline at end of file +var _0x3bd7=['request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bd7,0x199));var _0x73bd=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x3bd7[_0x3358ba];return _0x296e73;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x73bd('0x0'));var BPromise=require(_0x73bd('0x1'));var rs=require(_0x73bd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73bd('0x3'))['db'];var utils=require(_0x73bd('0x4'));var logger=require(_0x73bd('0x5'))('rpc');var config=require(_0x73bd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x73bd('0x7')][_0x73bd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bca41,_0x38ffbb,_0x4c1254){return new BPromise(function(_0x569bef,_0x549abe){return client[_0x73bd('0x9')](_0x4bca41,_0x4c1254)['then'](function(_0x4f627c){logger[_0x73bd('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x38ffbb,_0x73bd('0xb'));logger[_0x73bd('0xc')](_0x73bd('0xd'),_0x38ffbb,_0x73bd('0xb'),JSON[_0x73bd('0xe')](_0x4f627c));if(_0x4f627c[_0x73bd('0xf')]){if(_0x4f627c['error'][_0x73bd('0x10')]===0x1f4){logger[_0x73bd('0xf')](_0x73bd('0x11'),_0x38ffbb,_0x4f627c[_0x73bd('0xf')][_0x73bd('0x12')]);return _0x549abe(_0x4f627c[_0x73bd('0xf')]['message']);}logger[_0x73bd('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x38ffbb,_0x4f627c[_0x73bd('0xf')][_0x73bd('0x12')]);return _0x569bef(_0x4f627c[_0x73bd('0xf')][_0x73bd('0x12')]);}else{logger[_0x73bd('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x38ffbb,_0x73bd('0xb'));_0x569bef(_0x4f627c[_0x73bd('0x13')][_0x73bd('0x12')]);}})[_0x73bd('0x14')](function(_0x411931){logger[_0x73bd('0xf')](_0x73bd('0x11'),_0x38ffbb,_0x411931);_0x549abe(_0x411931);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 10f41b1..0a4d18b 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 _0x697e=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports'];(function(_0x592dd5,_0x181b7c){var _0x2f7e5b=function(_0x226759){while(--_0x226759){_0x592dd5['push'](_0x592dd5['shift']());}};_0x2f7e5b(++_0x181b7c);}(_0x697e,0xe4));var _0xe697=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x697e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xe697('0x0'));var path=require(_0xe697('0x1'));var timeout=require(_0xe697('0x2'));var express=require(_0xe697('0x3'));var router=express[_0xe697('0x4')]();var fs_extra=require(_0xe697('0x5'));var auth=require(_0xe697('0x6'));var interaction=require(_0xe697('0x7'));var config=require(_0xe697('0x8'));var controller=require('./pause.controller');router[_0xe697('0x9')]('/',auth[_0xe697('0xa')](),controller['index']);router[_0xe697('0x9')]('/:id',auth[_0xe697('0xa')](),controller[_0xe697('0xb')]);router['post']('/',auth[_0xe697('0xa')](),controller[_0xe697('0xc')]);router[_0xe697('0xd')](_0xe697('0xe'),auth[_0xe697('0xa')](),controller[_0xe697('0xf')]);router[_0xe697('0x10')](_0xe697('0xe'),auth[_0xe697('0xa')](),controller[_0xe697('0x11')]);module[_0xe697('0x12')]=router; \ No newline at end of file +var _0x5b2a=['../../components/interaction/service','./pause.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','path','express','fs-extra'];(function(_0x2cbd58,_0x278e75){var _0x42ef2a=function(_0x4d2ceb){while(--_0x4d2ceb){_0x2cbd58['push'](_0x2cbd58['shift']());}};_0x42ef2a(++_0x278e75);}(_0x5b2a,0x150));var _0xa5b2=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x5b2a[_0x1ccdf7];return _0x52a0ae;};'use strict';var multer=require(_0xa5b2('0x0'));var util=require('util');var path=require(_0xa5b2('0x1'));var timeout=require('connect-timeout');var express=require(_0xa5b2('0x2'));var router=express['Router']();var fs_extra=require(_0xa5b2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa5b2('0x4'));var config=require('../../config/environment');var controller=require(_0xa5b2('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xa5b2('0x6')]);router[_0xa5b2('0x7')](_0xa5b2('0x8'),auth[_0xa5b2('0x9')](),controller[_0xa5b2('0xa')]);router[_0xa5b2('0xb')]('/',auth[_0xa5b2('0x9')](),controller[_0xa5b2('0xc')]);router[_0xa5b2('0xd')](_0xa5b2('0x8'),auth[_0xa5b2('0x9')](),controller[_0xa5b2('0xe')]);router[_0xa5b2('0xf')]('/:id',auth[_0xa5b2('0x9')](),controller[_0xa5b2('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 8cf4698..518e747 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 _0x9681=['exports','STRING','sequelize'];(function(_0xd43e,_0x2cd5ef){var _0x247169=function(_0x43540e){while(--_0x43540e){_0xd43e['push'](_0xd43e['shift']());}};_0x247169(++_0x2cd5ef);}(_0x9681,0x18b));var _0x1968=function(_0xb866cf,_0x4762aa){_0xb866cf=_0xb866cf-0x0;var _0x1caced=_0x9681[_0xb866cf];return _0x1caced;};'use strict';var Sequelize=require(_0x1968('0x0'));module[_0x1968('0x1')]={'name':{'type':Sequelize[_0x1968('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9659=['sequelize','STRING','name'];(function(_0xcd3768,_0x2500f5){var _0x2bf388=function(_0x988219){while(--_0x988219){_0xcd3768['push'](_0xcd3768['shift']());}};_0x2bf388(++_0x2500f5);}(_0x9659,0x9f));var _0x9965=function(_0x2d2731,_0x354409){_0x2d2731=_0x2d2731-0x0;var _0x5e88f0=_0x9659[_0x2d2731];return _0x5e88f0;};'use strict';var Sequelize=require(_0x9965('0x0'));module['exports']={'name':{'type':Sequelize[_0x9965('0x1')],'unique':_0x9965('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9965('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 5e83b76..75f17ca 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 _0x36c4=['filters','attributes','fields','nolimit','order','where','pick','filter','merge','map','Pause','includeAll','include','findAll','rows','catch','params','intersection','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Pauses','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','offset','count','status','set','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','model','query','keys'];(function(_0xd0f230,_0x1e22ad){var _0x110649=function(_0x11d53c){while(--_0x11d53c){_0xd0f230['push'](_0xd0f230['shift']());}};_0x110649(++_0x1e22ad);}(_0x36c4,0xb6));var _0x436c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36c4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x436c('0x0'));var rimraf=require(_0x436c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x436c('0x2'));var rp=require(_0x436c('0x3'));var moment=require(_0x436c('0x4'));var BPromise=require(_0x436c('0x5'));var Mustache=require(_0x436c('0x6'));var util=require('util');var path=require(_0x436c('0x7'));var sox=require(_0x436c('0x8'));var csv=require(_0x436c('0x9'));var ejs=require(_0x436c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x436c('0xb'));var crypto=require(_0x436c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x436c('0x9'));var querystring=require(_0x436c('0xd'));var Papa=require('papaparse');var Redis=require(_0x436c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x436c('0xf'));var logger=require(_0x436c('0x10'))(_0x436c('0x11'));var utils=require(_0x436c('0x12'));var config=require(_0x436c('0x13'));var licenseUtil=require(_0x436c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x504e21,_0x106770){_0x106770=_0x106770||0xcc;return function(_0x32d323){if(_0x32d323){return _0x504e21[_0x436c('0x15')](_0x106770);}return _0x504e21['status'](_0x106770)[_0x436c('0x16')]();};}function respondWithResult(_0x2374f5,_0x2e7ec5){_0x2e7ec5=_0x2e7ec5||0xc8;return function(_0x288872){if(_0x288872){return _0x2374f5['status'](_0x2e7ec5)[_0x436c('0x17')](_0x288872);}};}function respondWithFilteredResult(_0x25bb28,_0x4ffd5d){return function(_0x48b1c1){if(_0x48b1c1){var _0x2994f0=typeof _0x4ffd5d['offset']===_0x436c('0x18')&&typeof _0x4ffd5d[_0x436c('0x19')]===_0x436c('0x18');var _0x52d6e3=_0x48b1c1['count'];var _0x4139b0=_0x2994f0?0x0:_0x4ffd5d[_0x436c('0x1a')];var _0x23c125=_0x2994f0?_0x48b1c1[_0x436c('0x1b')]:_0x4ffd5d[_0x436c('0x1a')]+_0x4ffd5d[_0x436c('0x19')];var _0x4b68c5;if(_0x23c125>=_0x52d6e3){_0x23c125=_0x52d6e3;_0x4b68c5=0xc8;}else{_0x4b68c5=0xce;}_0x25bb28[_0x436c('0x1c')](_0x4b68c5);return _0x25bb28[_0x436c('0x1d')](_0x436c('0x1e'),_0x4139b0+'-'+_0x23c125+'/'+_0x52d6e3)['json'](_0x48b1c1);}return null;};}function patchUpdates(_0x135cdc){return function(_0x373005){try{jsonpatch['apply'](_0x373005,_0x135cdc,!![]);}catch(_0x15fefa){return BPromise[_0x436c('0x1f')](_0x15fefa);}return _0x373005[_0x436c('0x20')]();};}function saveUpdates(_0x40b3f5,_0x5223cc){return function(_0x58ccac){if(_0x58ccac){return _0x58ccac[_0x436c('0x21')](_0x40b3f5)['then'](function(_0x39fec5){return _0x39fec5;});}return null;};}function removeEntity(_0x6f6597,_0x14fc1f){return function(_0x3a3dde){if(_0x3a3dde){return _0x3a3dde[_0x436c('0x22')]()[_0x436c('0x23')](function(){var _0x3ad67f=_0x3a3dde[_0x436c('0x24')]({'plain':!![]});var _0x2089d5='Pauses';return db[_0x436c('0x25')][_0x436c('0x22')]({'where':{'type':_0x2089d5,'resourceId':_0x3ad67f['id']}})[_0x436c('0x23')](function(){return _0x3a3dde;});})[_0x436c('0x23')](function(){_0x6f6597[_0x436c('0x1c')](0xcc)[_0x436c('0x16')]();});}};}function handleEntityNotFound(_0x4412c7,_0x23521d){return function(_0x51a309){if(!_0x51a309){_0x4412c7[_0x436c('0x15')](0x194);}return _0x51a309;};}function handleError(_0x40bd52,_0x22650e){_0x22650e=_0x22650e||0x1f4;return function(_0x5ec6e5){logger[_0x436c('0x26')](_0x5ec6e5[_0x436c('0x27')]);if(_0x5ec6e5['name']){delete _0x5ec6e5[_0x436c('0x28')];}_0x40bd52[_0x436c('0x1c')](_0x22650e)[_0x436c('0x29')](_0x5ec6e5);};}exports[_0x436c('0x2a')]=function(_0x323954,_0x2da213){var _0x3746ce={},_0x3ad5b9={},_0x3884fc={'count':0x0,'rows':[]};var _0x28dc4d=_['map'](db['Pause'][_0x436c('0x2b')],function(_0x29f8dd){return{'name':_0x29f8dd[_0x436c('0x2c')],'type':_0x29f8dd[_0x436c('0x2d')]['key']};});_0x3ad5b9[_0x436c('0x2e')]=_['map'](_0x28dc4d,'name');_0x3ad5b9[_0x436c('0x2f')]=_[_0x436c('0x30')](_0x323954['query']);_0x3ad5b9[_0x436c('0x31')]=_['intersection'](_0x3ad5b9['model'],_0x3ad5b9[_0x436c('0x2f')]);_0x3746ce[_0x436c('0x32')]=_['intersection'](_0x3ad5b9[_0x436c('0x2e')],qs[_0x436c('0x33')](_0x323954[_0x436c('0x2f')]['fields']));_0x3746ce[_0x436c('0x32')]=_0x3746ce[_0x436c('0x32')]['length']?_0x3746ce[_0x436c('0x32')]:_0x3ad5b9['model'];if(!_0x323954[_0x436c('0x2f')]['hasOwnProperty'](_0x436c('0x34'))){_0x3746ce[_0x436c('0x19')]=qs[_0x436c('0x19')](_0x323954[_0x436c('0x2f')][_0x436c('0x19')]);_0x3746ce[_0x436c('0x1a')]=qs[_0x436c('0x1a')](_0x323954[_0x436c('0x2f')][_0x436c('0x1a')]);}_0x3746ce[_0x436c('0x35')]=qs['sort'](_0x323954[_0x436c('0x2f')]['sort']);_0x3746ce[_0x436c('0x36')]=qs['filters'](_[_0x436c('0x37')](_0x323954['query'],_0x3ad5b9[_0x436c('0x31')]),_0x28dc4d);if(_0x323954[_0x436c('0x2f')][_0x436c('0x38')]){_0x3746ce[_0x436c('0x36')]=_[_0x436c('0x39')](_0x3746ce[_0x436c('0x36')],{'$or':_[_0x436c('0x3a')](_0x28dc4d,function(_0x3eb437){if(_0x3eb437['type']!=='VIRTUAL'){var _0x4fe380={};_0x4fe380[_0x3eb437[_0x436c('0x28')]]={'$like':'%'+_0x323954[_0x436c('0x2f')][_0x436c('0x38')]+'%'};return _0x4fe380;}})});}_0x3746ce=_['merge']({},_0x3746ce,_0x323954['options']);var _0x29a77c={'where':_0x3746ce[_0x436c('0x36')]};return db[_0x436c('0x3b')][_0x436c('0x1b')](_0x29a77c)[_0x436c('0x23')](function(_0x4cb6f3){_0x3884fc[_0x436c('0x1b')]=_0x4cb6f3;if(_0x323954[_0x436c('0x2f')][_0x436c('0x3c')]){_0x3746ce[_0x436c('0x3d')]=[{'all':!![]}];}return db[_0x436c('0x3b')][_0x436c('0x3e')](_0x3746ce);})[_0x436c('0x23')](function(_0x577071){_0x3884fc[_0x436c('0x3f')]=_0x577071;return _0x3884fc;})['then'](respondWithFilteredResult(_0x2da213,_0x3746ce))[_0x436c('0x40')](handleError(_0x2da213,null));};exports['show']=function(_0x4df80b,_0x214470){var _0x25ea46={'raw':!![],'where':{'id':_0x4df80b[_0x436c('0x41')]['id']}},_0x304114={};_0x304114[_0x436c('0x2e')]=_[_0x436c('0x30')](db[_0x436c('0x3b')]['rawAttributes']);_0x304114[_0x436c('0x2f')]=_[_0x436c('0x30')](_0x4df80b['query']);_0x304114[_0x436c('0x31')]=_[_0x436c('0x42')](_0x304114['model'],_0x304114[_0x436c('0x2f')]);_0x25ea46[_0x436c('0x32')]=_[_0x436c('0x42')](_0x304114[_0x436c('0x2e')],qs[_0x436c('0x33')](_0x4df80b[_0x436c('0x2f')]['fields']));_0x25ea46['attributes']=_0x25ea46[_0x436c('0x32')][_0x436c('0x43')]?_0x25ea46['attributes']:_0x304114[_0x436c('0x2e')];if(_0x4df80b[_0x436c('0x2f')][_0x436c('0x3c')]){_0x25ea46[_0x436c('0x3d')]=[{'all':!![]}];}_0x25ea46=_[_0x436c('0x39')]({},_0x25ea46,_0x4df80b['options']);return db['Pause'][_0x436c('0x44')](_0x25ea46)['then'](handleEntityNotFound(_0x214470,null))[_0x436c('0x23')](respondWithResult(_0x214470,null))[_0x436c('0x40')](handleError(_0x214470,null));};exports[_0x436c('0x45')]=function(_0x99a829,_0x14edc6){return db[_0x436c('0x3b')][_0x436c('0x45')](_0x99a829[_0x436c('0x46')],{})[_0x436c('0x23')](function(_0x51ee0e){var _0x4dbb1d=_0x99a829['user']['get']({'plain':!![]});if(!_0x4dbb1d)throw new Error(_0x436c('0x47'));if(_0x4dbb1d['role']===_0x436c('0x48')){var _0x5152e9=_0x51ee0e['get']({'plain':!![]});var _0x1707d0=_0x436c('0x49');return db[_0x436c('0x4a')][_0x436c('0x44')]({'where':{'name':_0x1707d0,'userProfileId':_0x4dbb1d['userProfileId']},'raw':!![]})['then'](function(_0x4f9d78){if(_0x4f9d78&&_0x4f9d78[_0x436c('0x4b')]===0x0){return db[_0x436c('0x25')][_0x436c('0x45')]({'name':_0x5152e9['name'],'resourceId':_0x5152e9['id'],'type':_0x4f9d78[_0x436c('0x28')],'sectionId':_0x4f9d78['id']},{})['then'](function(){return _0x51ee0e;});}else{return _0x51ee0e;}})[_0x436c('0x40')](function(_0x56c025){logger[_0x436c('0x26')](_0x436c('0x4c'),_0x56c025);throw _0x56c025;});}return _0x51ee0e;})[_0x436c('0x23')](respondWithResult(_0x14edc6,0xc9))[_0x436c('0x40')](handleError(_0x14edc6,null));};exports['update']=function(_0x361d3f,_0x71a19f){if(_0x361d3f[_0x436c('0x46')]['id']){delete _0x361d3f[_0x436c('0x46')]['id'];}return db[_0x436c('0x3b')][_0x436c('0x44')]({'where':{'id':_0x361d3f[_0x436c('0x41')]['id']}})[_0x436c('0x23')](handleEntityNotFound(_0x71a19f,null))[_0x436c('0x23')](saveUpdates(_0x361d3f[_0x436c('0x46')],null))[_0x436c('0x23')](respondWithResult(_0x71a19f,null))[_0x436c('0x40')](handleError(_0x71a19f,null));};exports[_0x436c('0x22')]=function(_0x5f39a2,_0x10bcaa){return db['Pause']['find']({'where':{'id':_0x5f39a2[_0x436c('0x41')]['id']}})[_0x436c('0x23')](handleEntityNotFound(_0x10bcaa,null))[_0x436c('0x23')](removeEntity(_0x10bcaa,null))[_0x436c('0x40')](handleError(_0x10bcaa,null));}; \ No newline at end of file +var _0xbcd3=['destroy','end','sendStatus','error','name','send','index','map','Pause','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','count','includeAll','include','rows','catch','show','params','find','create','role','user','userProfileId','autoAssociation','body','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','set','Content-Range','apply','reject','update','then','get','Pauses','UserProfileResource'];(function(_0x5c2130,_0x340012){var _0xb5c227=function(_0x1efaed){while(--_0x1efaed){_0x5c2130['push'](_0x5c2130['shift']());}};_0xb5c227(++_0x340012);}(_0xbcd3,0xc8));var _0x3bcd=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xbcd3[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bcd('0x0'));var zipdir=require(_0x3bcd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3bcd('0x2'));var moment=require('moment');var BPromise=require(_0x3bcd('0x3'));var Mustache=require(_0x3bcd('0x4'));var util=require(_0x3bcd('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x3bcd('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3bcd('0x7'));var _=require(_0x3bcd('0x8'));var squel=require(_0x3bcd('0x9'));var crypto=require(_0x3bcd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3bcd('0xb'));var toCsv=require(_0x3bcd('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3bcd('0xc'));var authService=require(_0x3bcd('0xd'));var qs=require(_0x3bcd('0xe'));var as=require(_0x3bcd('0xf'));var hardwareService=require(_0x3bcd('0x10'));var logger=require(_0x3bcd('0x11'))(_0x3bcd('0x12'));var utils=require(_0x3bcd('0x13'));var config=require(_0x3bcd('0x14'));var licenseUtil=require(_0x3bcd('0x15'));var db=require(_0x3bcd('0x16'))['db'];function respondWithStatusCode(_0x162317,_0x28c308){_0x28c308=_0x28c308||0xcc;return function(_0x3efc49){if(_0x3efc49){return _0x162317['sendStatus'](_0x28c308);}return _0x162317[_0x3bcd('0x17')](_0x28c308)['end']();};}function respondWithResult(_0x1ff479,_0x354adc){_0x354adc=_0x354adc||0xc8;return function(_0x4515c2){if(_0x4515c2){return _0x1ff479[_0x3bcd('0x17')](_0x354adc)[_0x3bcd('0x18')](_0x4515c2);}};}function respondWithFilteredResult(_0x15da21,_0x49512b){return function(_0x42a484){if(_0x42a484){var _0x1422ed=typeof _0x49512b['offset']===_0x3bcd('0x19')&&typeof _0x49512b[_0x3bcd('0x1a')]===_0x3bcd('0x19');var _0x131034=_0x42a484['count'];var _0x28d943=_0x1422ed?0x0:_0x49512b['offset'];var _0x51aa0f=_0x1422ed?_0x42a484['count']:_0x49512b[_0x3bcd('0x1b')]+_0x49512b['limit'];var _0x12b646;if(_0x51aa0f>=_0x131034){_0x51aa0f=_0x131034;_0x12b646=0xc8;}else{_0x12b646=0xce;}_0x15da21[_0x3bcd('0x17')](_0x12b646);return _0x15da21[_0x3bcd('0x1c')](_0x3bcd('0x1d'),_0x28d943+'-'+_0x51aa0f+'/'+_0x131034)[_0x3bcd('0x18')](_0x42a484);}return null;};}function patchUpdates(_0x10d561){return function(_0x5aa1a){try{jsonpatch[_0x3bcd('0x1e')](_0x5aa1a,_0x10d561,!![]);}catch(_0x4fe86c){return BPromise[_0x3bcd('0x1f')](_0x4fe86c);}return _0x5aa1a['save']();};}function saveUpdates(_0x419372,_0x1beb4b){return function(_0x43cb38){if(_0x43cb38){return _0x43cb38[_0x3bcd('0x20')](_0x419372)[_0x3bcd('0x21')](function(_0x25cfeb){return _0x25cfeb;});}return null;};}function removeEntity(_0x1c9126,_0x299883){return function(_0x457337){if(_0x457337){return _0x457337['destroy']()[_0x3bcd('0x21')](function(){var _0x1bea69=_0x457337[_0x3bcd('0x22')]({'plain':!![]});var _0x3ff680=_0x3bcd('0x23');return db[_0x3bcd('0x24')][_0x3bcd('0x25')]({'where':{'type':_0x3ff680,'resourceId':_0x1bea69['id']}})[_0x3bcd('0x21')](function(){return _0x457337;});})[_0x3bcd('0x21')](function(){_0x1c9126[_0x3bcd('0x17')](0xcc)[_0x3bcd('0x26')]();});}};}function handleEntityNotFound(_0x194c76,_0x282aa1){return function(_0xe4984c){if(!_0xe4984c){_0x194c76[_0x3bcd('0x27')](0x194);}return _0xe4984c;};}function handleError(_0x42bd22,_0x265d89){_0x265d89=_0x265d89||0x1f4;return function(_0x441032){logger[_0x3bcd('0x28')](_0x441032['stack']);if(_0x441032[_0x3bcd('0x29')]){delete _0x441032[_0x3bcd('0x29')];}_0x42bd22['status'](_0x265d89)[_0x3bcd('0x2a')](_0x441032);};}exports[_0x3bcd('0x2b')]=function(_0x3115d9,_0x20f726){var _0x28d2b1={},_0x3a9904={},_0x566cd5={'count':0x0,'rows':[]};var _0x1b9a93=_[_0x3bcd('0x2c')](db[_0x3bcd('0x2d')]['rawAttributes'],function(_0xb2f29b){return{'name':_0xb2f29b['fieldName'],'type':_0xb2f29b['type'][_0x3bcd('0x2e')]};});_0x3a9904[_0x3bcd('0x2f')]=_[_0x3bcd('0x2c')](_0x1b9a93,_0x3bcd('0x29'));_0x3a9904[_0x3bcd('0x30')]=_[_0x3bcd('0x31')](_0x3115d9[_0x3bcd('0x30')]);_0x3a9904['filters']=_[_0x3bcd('0x32')](_0x3a9904['model'],_0x3a9904['query']);_0x28d2b1[_0x3bcd('0x33')]=_[_0x3bcd('0x32')](_0x3a9904[_0x3bcd('0x2f')],qs[_0x3bcd('0x34')](_0x3115d9['query']['fields']));_0x28d2b1['attributes']=_0x28d2b1[_0x3bcd('0x33')][_0x3bcd('0x35')]?_0x28d2b1['attributes']:_0x3a9904[_0x3bcd('0x2f')];if(!_0x3115d9[_0x3bcd('0x30')][_0x3bcd('0x36')](_0x3bcd('0x37'))){_0x28d2b1[_0x3bcd('0x1a')]=qs[_0x3bcd('0x1a')](_0x3115d9['query'][_0x3bcd('0x1a')]);_0x28d2b1[_0x3bcd('0x1b')]=qs[_0x3bcd('0x1b')](_0x3115d9[_0x3bcd('0x30')][_0x3bcd('0x1b')]);}_0x28d2b1['order']=qs[_0x3bcd('0x38')](_0x3115d9[_0x3bcd('0x30')][_0x3bcd('0x38')]);_0x28d2b1['where']=qs[_0x3bcd('0x39')](_[_0x3bcd('0x3a')](_0x3115d9[_0x3bcd('0x30')],_0x3a9904[_0x3bcd('0x39')]),_0x1b9a93);if(_0x3115d9[_0x3bcd('0x30')][_0x3bcd('0x3b')]){_0x28d2b1['where']=_['merge'](_0x28d2b1[_0x3bcd('0x3c')],{'$or':_[_0x3bcd('0x2c')](_0x1b9a93,function(_0x81064d){if(_0x81064d[_0x3bcd('0x3d')]!==_0x3bcd('0x3e')){var _0x3ce7f4={};_0x3ce7f4[_0x81064d[_0x3bcd('0x29')]]={'$like':'%'+_0x3115d9[_0x3bcd('0x30')][_0x3bcd('0x3b')]+'%'};return _0x3ce7f4;}})});}_0x28d2b1=_[_0x3bcd('0x3f')]({},_0x28d2b1,_0x3115d9[_0x3bcd('0x40')]);var _0x35d124={'where':_0x28d2b1[_0x3bcd('0x3c')]};return db[_0x3bcd('0x2d')][_0x3bcd('0x41')](_0x35d124)['then'](function(_0x2f5a25){_0x566cd5[_0x3bcd('0x41')]=_0x2f5a25;if(_0x3115d9[_0x3bcd('0x30')][_0x3bcd('0x42')]){_0x28d2b1[_0x3bcd('0x43')]=[{'all':!![]}];}return db[_0x3bcd('0x2d')]['findAll'](_0x28d2b1);})[_0x3bcd('0x21')](function(_0x52562e){_0x566cd5[_0x3bcd('0x44')]=_0x52562e;return _0x566cd5;})[_0x3bcd('0x21')](respondWithFilteredResult(_0x20f726,_0x28d2b1))[_0x3bcd('0x45')](handleError(_0x20f726,null));};exports[_0x3bcd('0x46')]=function(_0x28e9de,_0x5f0e62){var _0x59d3aa={'raw':!![],'where':{'id':_0x28e9de[_0x3bcd('0x47')]['id']}},_0x2a0034={};_0x2a0034[_0x3bcd('0x2f')]=_[_0x3bcd('0x31')](db[_0x3bcd('0x2d')]['rawAttributes']);_0x2a0034[_0x3bcd('0x30')]=_[_0x3bcd('0x31')](_0x28e9de[_0x3bcd('0x30')]);_0x2a0034[_0x3bcd('0x39')]=_['intersection'](_0x2a0034[_0x3bcd('0x2f')],_0x2a0034['query']);_0x59d3aa['attributes']=_[_0x3bcd('0x32')](_0x2a0034['model'],qs['fields'](_0x28e9de[_0x3bcd('0x30')][_0x3bcd('0x34')]));_0x59d3aa[_0x3bcd('0x33')]=_0x59d3aa[_0x3bcd('0x33')]['length']?_0x59d3aa[_0x3bcd('0x33')]:_0x2a0034[_0x3bcd('0x2f')];if(_0x28e9de[_0x3bcd('0x30')][_0x3bcd('0x42')]){_0x59d3aa[_0x3bcd('0x43')]=[{'all':!![]}];}_0x59d3aa=_['merge']({},_0x59d3aa,_0x28e9de[_0x3bcd('0x40')]);return db[_0x3bcd('0x2d')][_0x3bcd('0x48')](_0x59d3aa)['then'](handleEntityNotFound(_0x5f0e62,null))[_0x3bcd('0x21')](respondWithResult(_0x5f0e62,null))[_0x3bcd('0x45')](handleError(_0x5f0e62,null));};exports[_0x3bcd('0x49')]=function(_0x2936a3,_0x14cfa4){return db[_0x3bcd('0x2d')]['create'](_0x2936a3['body'],{})['then'](function(_0x548afe){var _0x2c66a3=_0x2936a3['user'][_0x3bcd('0x22')]({'plain':!![]});if(!_0x2c66a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c66a3[_0x3bcd('0x4a')]===_0x3bcd('0x4b')){var _0x930bce=_0x548afe[_0x3bcd('0x22')]({'plain':!![]});var _0x3fe8a4=_0x3bcd('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x3fe8a4,'userProfileId':_0x2c66a3[_0x3bcd('0x4c')]},'raw':!![]})['then'](function(_0xb21067){if(_0xb21067&&_0xb21067[_0x3bcd('0x4d')]===0x0){return db[_0x3bcd('0x24')][_0x3bcd('0x49')]({'name':_0x930bce[_0x3bcd('0x29')],'resourceId':_0x930bce['id'],'type':_0xb21067['name'],'sectionId':_0xb21067['id']},{})['then'](function(){return _0x548afe;});}else{return _0x548afe;}})[_0x3bcd('0x45')](function(_0x48fd85){logger[_0x3bcd('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48fd85);throw _0x48fd85;});}return _0x548afe;})[_0x3bcd('0x21')](respondWithResult(_0x14cfa4,0xc9))[_0x3bcd('0x45')](handleError(_0x14cfa4,null));};exports[_0x3bcd('0x20')]=function(_0x3ff99e,_0x18fc17){if(_0x3ff99e[_0x3bcd('0x4e')]['id']){delete _0x3ff99e['body']['id'];}return db[_0x3bcd('0x2d')][_0x3bcd('0x48')]({'where':{'id':_0x3ff99e[_0x3bcd('0x47')]['id']}})[_0x3bcd('0x21')](handleEntityNotFound(_0x18fc17,null))[_0x3bcd('0x21')](saveUpdates(_0x3ff99e[_0x3bcd('0x4e')],null))[_0x3bcd('0x21')](respondWithResult(_0x18fc17,null))[_0x3bcd('0x45')](handleError(_0x18fc17,null));};exports['destroy']=function(_0x482e86,_0x270b96){return db['Pause'][_0x3bcd('0x48')]({'where':{'id':_0x482e86[_0x3bcd('0x47')]['id']}})[_0x3bcd('0x21')](handleEntityNotFound(_0x270b96,null))[_0x3bcd('0x21')](removeEntity(_0x270b96,null))[_0x3bcd('0x45')](handleError(_0x270b96,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index b7544b7..7eab3ac 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 _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x216494,_0x21a0b4){_0x216494=_0x216494-0x0;var _0x3fce22=_0x7fbe[_0x216494];return _0x3fce22;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x3916fb,_0x5c59ee){var _0x410626=function(_0x166219){while(--_0x166219){_0x3916fb['push'](_0x3916fb['shift']());}};_0x410626(++_0x5c59ee);}(_0x53ec,0x192));var _0xc53e=function(_0x325ee2,_0xaf1371){_0x325ee2=_0x325ee2-0x0;var _0x7f2741=_0x53ec[_0x325ee2];return _0x7f2741;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),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 2ef5457..fcd1b07 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x2376fb,_0x974f92){var _0x2a7006=function(_0xf9e55){while(--_0xf9e55){_0x2376fb['push'](_0x2376fb['shift']());}};_0x2a7006(++_0x974f92);}(_0xb10b,0x12a));var _0xbb10=function(_0x49684e,_0x9a24fb){_0x49684e=_0x49684e-0x0;var _0x54062f=_0xb10b[_0x49684e];return _0x54062f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _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(_0x5ae684,_0x206daf){var _0x3f58fc=function(_0x3062a3){while(--_0x3062a3){_0x5ae684['push'](_0x5ae684['shift']());}};_0x3f58fc(++_0x206daf);}(_0x7a54,0x106));var _0x47a5=function(_0x42bb98,_0x1fbede){_0x42bb98=_0x42bb98-0x0;var _0x992c9f=_0x7a54[_0x42bb98];return _0x992c9f;};'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 diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 0b0a43a..62bead4 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 _0x984b=['Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/webhook','webhookGet','/:id','show','get','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','extname','now','post','file','upload','put','update','delete','exports','connect-timeout','express'];(function(_0x3d71bc,_0xb15466){var _0xabb3f2=function(_0x50557b){while(--_0x50557b){_0x3d71bc['push'](_0x3d71bc['shift']());}};_0xabb3f2(++_0xb15466);}(_0x984b,0xee));var _0xb984=function(_0x4cd5cc,_0x3deffe){_0x4cd5cc=_0x4cd5cc-0x0;var _0x25c01a=_0x984b[_0x4cd5cc];return _0x25c01a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb984('0x0'));var express=require(_0xb984('0x1'));var router=express[_0xb984('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb984('0x3'));var config=require(_0xb984('0x4'));var controller=require('./plugin.controller');router['get']('/',auth[_0xb984('0x5')](),controller[_0xb984('0x6')]);router['get'](_0xb984('0x7'),controller[_0xb984('0x8')]);router['get'](_0xb984('0x9'),auth['isAuthenticated'](),controller[_0xb984('0xa')]);router[_0xb984('0xb')](_0xb984('0xc'),auth[_0xb984('0x5')](),controller[_0xb984('0xd')]);var upload=multer({'storage':multer[_0xb984('0xe')]({'destination':function(_0x11525c,_0xfca315,_0x16d46f){_0x16d46f(null,path[_0xb984('0xf')](config[_0xb984('0x10')],_0xb984('0x11')));},'filename':function(_0x5b4add,_0x1b922b,_0x4b9c75){_0x1b922b[_0xb984('0x12')]=_0x1b922b[_0xb984('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4b9c75(null,util[_0xb984('0x13')](_0xb984('0x14'),path['basename'](_0x1b922b[_0xb984('0x12')],path[_0xb984('0x15')](_0x1b922b['originalname'])),Date[_0xb984('0x16')](),path[_0xb984('0x15')](_0x1b922b['originalname'])));}})});router[_0xb984('0x17')]('/',upload['single'](_0xb984('0x18')),controller[_0xb984('0x19')]);router[_0xb984('0x17')](_0xb984('0x7'),controller['webhookPost']);router[_0xb984('0x1a')](_0xb984('0x9'),auth[_0xb984('0x5')](),controller[_0xb984('0x1b')]);router[_0xb984('0x1c')](_0xb984('0x9'),auth['isAuthenticated'](),controller[_0xb984('0x1c')]);module[_0xb984('0x1d')]=router; \ No newline at end of file +var _0x4bc3=['single','file','webhookPost','put','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','/:id','show','/:id/download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post'];(function(_0x427cdc,_0x243c96){var _0x43c4c0=function(_0x42fbc9){while(--_0x42fbc9){_0x427cdc['push'](_0x427cdc['shift']());}};_0x43c4c0(++_0x243c96);}(_0x4bc3,0x16e));var _0x34bc=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x4bc3[_0x599e60];return _0x468e19;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var fs_extra=require(_0x34bc('0x4'));var auth=require(_0x34bc('0x5'));var interaction=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var controller=require(_0x34bc('0x8'));router[_0x34bc('0x9')]('/',auth[_0x34bc('0xa')](),controller['index']);router[_0x34bc('0x9')]('/webhook',controller['webhookGet']);router[_0x34bc('0x9')](_0x34bc('0xb'),auth[_0x34bc('0xa')](),controller[_0x34bc('0xc')]);router[_0x34bc('0x9')](_0x34bc('0xd'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x34bc('0xe')]({'destination':function(_0x33025c,_0x2a35f3,_0x5a608a){_0x5a608a(null,path[_0x34bc('0xf')](config['root'],_0x34bc('0x10')));},'filename':function(_0x124b87,_0x164fb2,_0x536ebd){_0x164fb2[_0x34bc('0x11')]=_0x164fb2['originalname'][_0x34bc('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x536ebd(null,util[_0x34bc('0x13')](_0x34bc('0x14'),path['basename'](_0x164fb2['originalname'],path[_0x34bc('0x15')](_0x164fb2['originalname'])),Date[_0x34bc('0x16')](),path[_0x34bc('0x15')](_0x164fb2[_0x34bc('0x11')])));}})});router[_0x34bc('0x17')]('/',upload[_0x34bc('0x18')](_0x34bc('0x19')),controller['upload']);router['post']('/webhook',controller[_0x34bc('0x1a')]);router[_0x34bc('0x1b')](_0x34bc('0xb'),auth[_0x34bc('0xa')](),controller['update']);router[_0x34bc('0x1c')](_0x34bc('0xb'),auth['isAuthenticated'](),controller[_0x34bc('0x1c')]);module[_0x34bc('0x1d')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index cbba528..6aa4460 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 _0xa909=['never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','ENUM','adminOnly','agentOnly','always'];(function(_0x5b6568,_0xbabae4){var _0x59ddbf=function(_0x41670b){while(--_0x41670b){_0x5b6568['push'](_0x5b6568['shift']());}};_0x59ddbf(++_0xbabae4);}(_0xa909,0x9c));var _0x9a90=function(_0x19ae67,_0x254c46){_0x19ae67=_0x19ae67-0x0;var _0x5c8e72=_0xa909[_0x19ae67];return _0x5c8e72;};'use strict';var Sequelize=require(_0x9a90('0x0'));module[_0x9a90('0x1')]={'name':{'type':Sequelize[_0x9a90('0x2')]},'type':{'type':Sequelize['ENUM'](_0x9a90('0x3'),_0x9a90('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x9a90('0x5')]},'path':{'type':Sequelize[_0x9a90('0x2')],'comment':_0x9a90('0x6')},'active':{'type':Sequelize[_0x9a90('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x9a90('0x8')](_0x9a90('0x9'),_0x9a90('0xa'),_0x9a90('0xb'),_0x9a90('0xc')),'defaultValue':_0x9a90('0xb'),'comment':_0x9a90('0xd')},'icon':{'type':Sequelize[_0x9a90('0x2')]},'adminUrl':{'type':Sequelize[_0x9a90('0x2')]},'agentUrl':{'type':Sequelize[_0x9a90('0x2')]},'scriptName':{'type':Sequelize[_0x9a90('0x2')]},'scriptPath':{'type':Sequelize[_0x9a90('0x2')]}}; \ No newline at end of file +var _0xac6d=['exports','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','never','sequelize'];(function(_0x174a72,_0x46034c){var _0x32cecd=function(_0x188a47){while(--_0x188a47){_0x174a72['push'](_0x174a72['shift']());}};_0x32cecd(++_0x46034c);}(_0xac6d,0x1ed));var _0xdac6=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0xac6d[_0x1a8f86];return _0x20d876;};'use strict';var Sequelize=require(_0xdac6('0x0'));module[_0xdac6('0x1')]={'name':{'type':Sequelize[_0xdac6('0x2')]},'type':{'type':Sequelize['ENUM'](_0xdac6('0x3'),_0xdac6('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xdac6('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0xdac6('0x6')},'active':{'type':Sequelize[_0xdac6('0x7')],'defaultValue':0x0,'comment':_0xdac6('0x8')},'sidebar':{'type':Sequelize[_0xdac6('0x9')](_0xdac6('0xa'),_0xdac6('0xb'),'always',_0xdac6('0xc')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xdac6('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xdac6('0x2')]},'scriptName':{'type':Sequelize[_0xdac6('0x2')]},'scriptPath':{'type':Sequelize[_0xdac6('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index c9ee042..dc0e638 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 _0x8cc4=['../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Plugins','UserProfileResource','send','index','rawAttributes','fieldName','type','key','map','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','Plugin','findAll','params','keys','find','catch','download','join','root','format','%s.zip','basename','createWriteStream','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','html','views','parameters','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','icon-apps','admin','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','test','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x55ca3f,_0xd1ab6f){var _0x5c61cc=function(_0x445afe){while(--_0x445afe){_0x55ca3f['push'](_0x55ca3f['shift']());}};_0x5c61cc(++_0xd1ab6f);}(_0x8cc4,0x1cd));var _0x48cc=function(_0x9148ba,_0x2cb1b5){_0x9148ba=_0x9148ba-0x0;var _0x355e3b=_0x8cc4[_0x9148ba];return _0x355e3b;};'use strict';var emlformat=require(_0x48cc('0x0'));var rimraf=require(_0x48cc('0x1'));var zipdir=require(_0x48cc('0x2'));var jsonpatch=require(_0x48cc('0x3'));var rp=require('request-promise');var moment=require(_0x48cc('0x4'));var BPromise=require(_0x48cc('0x5'));var Mustache=require(_0x48cc('0x6'));var util=require(_0x48cc('0x7'));var path=require(_0x48cc('0x8'));var sox=require(_0x48cc('0x9'));var csv=require(_0x48cc('0xa'));var ejs=require(_0x48cc('0xb'));var fs=require('fs');var fs_extra=require(_0x48cc('0xc'));var _=require(_0x48cc('0xd'));var squel=require(_0x48cc('0xe'));var crypto=require('crypto');var jsforce=require(_0x48cc('0xf'));var deskjs=require(_0x48cc('0x10'));var toCsv=require(_0x48cc('0xa'));var querystring=require(_0x48cc('0x11'));var Papa=require(_0x48cc('0x12'));var extract=require('extract-zip');var rimraf=require(_0x48cc('0x1'));var archiver=require('archiver');var Redis=require(_0x48cc('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x48cc('0x14'));var as=require(_0x48cc('0x15'));var hardwareService=require(_0x48cc('0x16'));var logger=require('../../config/logger')(_0x48cc('0x17'));var utils=require(_0x48cc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x48cc('0x19'));var db=require(_0x48cc('0x1a'))['db'];config[_0x48cc('0x1b')]=_['defaults'](config[_0x48cc('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x48cc('0x1c'))(new Redis(config[_0x48cc('0x1b')]));require(_0x48cc('0x1d'))[_0x48cc('0x1e')](socket);function respondWithStatusCode(_0xd6b7e8,_0x3fafea){_0x3fafea=_0x3fafea||0xcc;return function(_0x3e2bbd){if(_0x3e2bbd){return _0xd6b7e8[_0x48cc('0x1f')](_0x3fafea);}return _0xd6b7e8['status'](_0x3fafea)[_0x48cc('0x20')]();};}function respondWithResult(_0x2a66db,_0x4e2bcc){_0x4e2bcc=_0x4e2bcc||0xc8;return function(_0x58a3a5){if(_0x58a3a5){return _0x2a66db[_0x48cc('0x21')](_0x4e2bcc)[_0x48cc('0x22')](_0x58a3a5);}};}function respondWithFilteredResult(_0x12103,_0x5bbe3d){return function(_0x1f3b6f){if(_0x1f3b6f){var _0x2da1b4=typeof _0x5bbe3d[_0x48cc('0x23')]===_0x48cc('0x24')&&typeof _0x5bbe3d[_0x48cc('0x25')]===_0x48cc('0x24');var _0x53a7f8=_0x1f3b6f[_0x48cc('0x26')];var _0x268152=_0x2da1b4?0x0:_0x5bbe3d[_0x48cc('0x23')];var _0x8f0637=_0x2da1b4?_0x1f3b6f[_0x48cc('0x26')]:_0x5bbe3d['offset']+_0x5bbe3d['limit'];var _0x525f9e;if(_0x8f0637>=_0x53a7f8){_0x8f0637=_0x53a7f8;_0x525f9e=0xc8;}else{_0x525f9e=0xce;}_0x12103[_0x48cc('0x21')](_0x525f9e);return _0x12103[_0x48cc('0x27')]('Content-Range',_0x268152+'-'+_0x8f0637+'/'+_0x53a7f8)['json'](_0x1f3b6f);}return null;};}function patchUpdates(_0xcb7275){return function(_0x20471e){try{jsonpatch[_0x48cc('0x28')](_0x20471e,_0xcb7275,!![]);}catch(_0xa04c11){return BPromise['reject'](_0xa04c11);}return _0x20471e[_0x48cc('0x29')]();};}function saveUpdates(_0x4777c0,_0x3c1470){return function(_0x5c4f1d){if(_0x5c4f1d){return _0x5c4f1d[_0x48cc('0x2a')](_0x4777c0)[_0x48cc('0x2b')](function(_0x240cc8){return _0x240cc8;});}return null;};}function removeEntity(_0x40d5b5,_0x3ce472){return function(_0x35746d){if(_0x35746d){return _0x35746d[_0x48cc('0x2c')]()[_0x48cc('0x2b')](function(){var _0x24c0b6=_0x35746d[_0x48cc('0x2d')]({'plain':!![]});var _0x9a6eff=_0x48cc('0x2e');return db[_0x48cc('0x2f')][_0x48cc('0x2c')]({'where':{'type':_0x9a6eff,'resourceId':_0x24c0b6['id']}})[_0x48cc('0x2b')](function(){return _0x35746d;});})[_0x48cc('0x2b')](function(){_0x40d5b5['status'](0xcc)[_0x48cc('0x20')]();});}};}function handleEntityNotFound(_0x30f667,_0xa5e789){return function(_0x13c480){if(!_0x13c480){_0x30f667[_0x48cc('0x1f')](0x194);}return _0x13c480;};}function handleError(_0xe496b1,_0x5f2058){_0x5f2058=_0x5f2058||0x1f4;return function(_0x301c01){logger['error'](_0x301c01['stack']);if(_0x301c01['name']){delete _0x301c01['name'];}_0xe496b1['status'](_0x5f2058)[_0x48cc('0x30')](_0x301c01);};}exports[_0x48cc('0x31')]=function(_0x5b8e0e,_0x4e9112){var _0x3e8846={},_0x1fbc5b={},_0x3d5bae={'count':0x0,'rows':[]};var _0x5f5774=_['map'](db['Plugin'][_0x48cc('0x32')],function(_0x2aaadc){return{'name':_0x2aaadc[_0x48cc('0x33')],'type':_0x2aaadc[_0x48cc('0x34')][_0x48cc('0x35')]};});_0x1fbc5b['model']=_[_0x48cc('0x36')](_0x5f5774,_0x48cc('0x37'));_0x1fbc5b['query']=_['keys'](_0x5b8e0e[_0x48cc('0x38')]);_0x1fbc5b[_0x48cc('0x39')]=_[_0x48cc('0x3a')](_0x1fbc5b[_0x48cc('0x3b')],_0x1fbc5b[_0x48cc('0x38')]);_0x3e8846[_0x48cc('0x3c')]=_[_0x48cc('0x3a')](_0x1fbc5b['model'],qs[_0x48cc('0x3d')](_0x5b8e0e[_0x48cc('0x38')][_0x48cc('0x3d')]));_0x3e8846['attributes']=_0x3e8846['attributes'][_0x48cc('0x3e')]?_0x3e8846[_0x48cc('0x3c')]:_0x1fbc5b[_0x48cc('0x3b')];if(!_0x5b8e0e[_0x48cc('0x38')][_0x48cc('0x3f')]('nolimit')){_0x3e8846[_0x48cc('0x25')]=qs['limit'](_0x5b8e0e[_0x48cc('0x38')]['limit']);_0x3e8846['offset']=qs[_0x48cc('0x23')](_0x5b8e0e['query'][_0x48cc('0x23')]);}_0x3e8846[_0x48cc('0x40')]=qs[_0x48cc('0x41')](_0x5b8e0e['query'][_0x48cc('0x41')]);_0x3e8846[_0x48cc('0x42')]=qs[_0x48cc('0x39')](_[_0x48cc('0x43')](_0x5b8e0e[_0x48cc('0x38')],_0x1fbc5b[_0x48cc('0x39')]),_0x5f5774);if(_0x5b8e0e[_0x48cc('0x38')][_0x48cc('0x44')]){_0x3e8846[_0x48cc('0x42')]=_['merge'](_0x3e8846[_0x48cc('0x42')],{'$or':_[_0x48cc('0x36')](_0x5f5774,function(_0xf4535f){if(_0xf4535f[_0x48cc('0x34')]!=='VIRTUAL'){var _0x4c421f={};_0x4c421f[_0xf4535f[_0x48cc('0x37')]]={'$like':'%'+_0x5b8e0e[_0x48cc('0x38')][_0x48cc('0x44')]+'%'};return _0x4c421f;}})});}_0x3e8846=_[_0x48cc('0x45')]({},_0x3e8846,_0x5b8e0e[_0x48cc('0x46')]);var _0x5e64bf={'where':_0x3e8846[_0x48cc('0x42')]};return db['Plugin'][_0x48cc('0x26')](_0x5e64bf)['then'](function(_0x1a17ef){_0x3d5bae[_0x48cc('0x26')]=_0x1a17ef;if(_0x5b8e0e[_0x48cc('0x38')]['includeAll']){_0x3e8846[_0x48cc('0x47')]=[{'all':!![]}];}return db[_0x48cc('0x48')][_0x48cc('0x49')](_0x3e8846);})[_0x48cc('0x2b')](function(_0x5b8d6d){_0x3d5bae['rows']=_0x5b8d6d;return _0x3d5bae;})[_0x48cc('0x2b')](respondWithFilteredResult(_0x4e9112,_0x3e8846))['catch'](handleError(_0x4e9112,null));};exports['show']=function(_0xf8fa46,_0x34004e){var _0x4b1050={'raw':!![],'where':{'id':_0xf8fa46[_0x48cc('0x4a')]['id']}},_0x1fd697={};_0x1fd697['model']=_[_0x48cc('0x4b')](db[_0x48cc('0x48')]['rawAttributes']);_0x1fd697[_0x48cc('0x38')]=_[_0x48cc('0x4b')](_0xf8fa46[_0x48cc('0x38')]);_0x1fd697[_0x48cc('0x39')]=_[_0x48cc('0x3a')](_0x1fd697[_0x48cc('0x3b')],_0x1fd697[_0x48cc('0x38')]);_0x4b1050[_0x48cc('0x3c')]=_[_0x48cc('0x3a')](_0x1fd697['model'],qs[_0x48cc('0x3d')](_0xf8fa46[_0x48cc('0x38')][_0x48cc('0x3d')]));_0x4b1050[_0x48cc('0x3c')]=_0x4b1050[_0x48cc('0x3c')]['length']?_0x4b1050['attributes']:_0x1fd697[_0x48cc('0x3b')];if(_0xf8fa46[_0x48cc('0x38')]['includeAll']){_0x4b1050['include']=[{'all':!![]}];}_0x4b1050=_['merge']({},_0x4b1050,_0xf8fa46[_0x48cc('0x46')]);return db['Plugin'][_0x48cc('0x4c')](_0x4b1050)[_0x48cc('0x2b')](handleEntityNotFound(_0x34004e,null))[_0x48cc('0x2b')](respondWithResult(_0x34004e,null))[_0x48cc('0x4d')](handleError(_0x34004e,null));};exports[_0x48cc('0x4e')]=function(_0xe09a7d,_0x453993,_0x445ee0){return db[_0x48cc('0x48')][_0x48cc('0x4c')]({'where':{'id':_0xe09a7d[_0x48cc('0x4a')]['id']},'attributes':[_0x48cc('0x37'),_0x48cc('0x8')],'raw':!![]})[_0x48cc('0x2b')](handleEntityNotFound(_0x453993,null))[_0x48cc('0x2b')](function(_0x5a9552){if(_0x5a9552){var _0x11046c=path[_0x48cc('0x4f')](config[_0x48cc('0x50')],'server/files/plugins',util[_0x48cc('0x51')](_0x48cc('0x52'),path[_0x48cc('0x53')](_0x5a9552[_0x48cc('0x8')])));var _0x382aae=fs[_0x48cc('0x54')](_0x11046c);var _0x3d3ada=archiver('zip',{'zlib':{'level':0x9}});_0x3d3ada['on']('warning',function(_0x79ebe1){if(_0x79ebe1[_0x48cc('0x55')]===_0x48cc('0x56')){logger[_0x48cc('0x57')](_0x79ebe1);}else{throw new db[(_0x48cc('0x58'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x3d3ada['on']('error',function(_0x32e609){throw new db[(_0x48cc('0x58'))][(_0x48cc('0x59'))](_0x48cc('0x5a'));});_0x3d3ada['pipe'](_0x382aae);_0x3d3ada['glob']('**/*',{'cwd':path['join'](config[_0x48cc('0x50')],_0x48cc('0x5b'),path[_0x48cc('0x5c')](_0x5a9552[_0x48cc('0x8')])),'ignore':[path[_0x48cc('0x4f')](path[_0x48cc('0x53')](_0x5a9552[_0x48cc('0x8')]),_0x48cc('0x5d')),path['join'](path[_0x48cc('0x53')](_0x5a9552[_0x48cc('0x8')]),_0x48cc('0x5e'))],'nodir':!![]})['finalize']();_0x382aae['on']('close',function(){if(!fs['existsSync'](_0x11046c)){throw new db[(_0x48cc('0x58'))][(_0x48cc('0x59'))](_0x48cc('0x5f'));}return _0x453993[_0x48cc('0x4e')](_0x11046c,util[_0x48cc('0x51')](_0x48cc('0x52'),path[_0x48cc('0x53')](_0x5a9552['path'])),function(_0x58789b){if(_0x58789b){throw new db['Sequelize'][(_0x48cc('0x59'))](_0x48cc('0x60'));}fs[_0x48cc('0x61')](_0x11046c);logger[_0x48cc('0x62')]('Download\x20completed');logger[_0x48cc('0x62')](_0x48cc('0x63'));});});}return null;})[_0x48cc('0x4d')](handleError(_0x453993,null));};exports[_0x48cc('0x64')]=function(_0x942c7,_0x44b2d0,_0x33bc0e){var _0x45398e=path[_0x48cc('0x53')](_0x942c7[_0x48cc('0x65')]['filename'],path[_0x48cc('0x66')](_0x942c7[_0x48cc('0x65')][_0x48cc('0x67')]));var _0x5e3055=path[_0x48cc('0x4f')](config['root'],'server/files/plugins',_0x942c7[_0x48cc('0x65')][_0x48cc('0x67')]);var _0x31acaf=path[_0x48cc('0x4f')](config[_0x48cc('0x50')],_0x48cc('0x5b'),_0x45398e);logger[_0x48cc('0x62')](_0x48cc('0x68'),_0x5e3055);logger['info'](_0x48cc('0x69'),_0x31acaf);try{fs['chmodSync'](_0x5e3055,parseInt(_0x48cc('0x6a'),0x8));extract(_0x5e3055,{'dir':_0x31acaf},function(_0x2536d4){if(_0x2536d4){logger[_0x48cc('0x57')](_0x2536d4);handleError(_0x2536d4,!![]);};var _0x388462=fs[_0x48cc('0x6b')](_0x31acaf);if(_0x388462[_0x48cc('0x3e')]>0x1){removeReferences(_0x5e3055,_0x31acaf);logger[_0x48cc('0x57')](_0x48cc('0x6c'));return _0x33bc0e(new Error('Invalid\x20plugin\x20structure'));}var _0x5788d4=fs['lstatSync'](path[_0x48cc('0x4f')](_0x31acaf,_0x388462[0x0]));if(_0x5788d4[_0x48cc('0x6d')]()){removeReferences(_0x5e3055,_0x31acaf);logger[_0x48cc('0x57')](_0x48cc('0x6c'));return _0x33bc0e(new Error(_0x48cc('0x6c')));}if(_0x5788d4[_0x48cc('0x6e')]()){var _0x1e2f1d=fs[_0x48cc('0x6b')](path[_0x48cc('0x4f')](_0x31acaf,_0x388462[0x0]));if(_0x1e2f1d[_0x48cc('0x3e')]===0x0){removeReferences(_0x5e3055,_0x31acaf);logger[_0x48cc('0x57')](_0x48cc('0x6c'));return _0x33bc0e(new Error(_0x48cc('0x6c')));}var _0x2e803d=_0x1e2f1d[_0x48cc('0x6f')](function(_0x2616da){return _0x2616da===_0x48cc('0x70');});if(!_0x2e803d){return _0x33bc0e(new Error('Plugin\x20manifest\x20missing'));}var _0xce9347=fs[_0x48cc('0x71')](path[_0x48cc('0x4f')](_0x31acaf,_0x388462[0x0],'manifest.json'));var _0x14d79f=JSON[_0x48cc('0x72')](_0xce9347);if(_0x48cc('0x24')==typeof _0x14d79f[_0x48cc('0x37')]){return _0x33bc0e(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x48cc('0x24')==typeof _0x14d79f[_0x48cc('0x34')]){return _0x33bc0e(new Error(_0x48cc('0x73')));}if('undefined'==typeof _0x14d79f[_0x48cc('0x74')]){return _0x33bc0e(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x48cc('0x24')==typeof _0x14d79f['parameters']){return _0x33bc0e(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x14d79f[_0x48cc('0x34')]===_0x48cc('0x75')){if(_0x48cc('0x24')==typeof _0x14d79f['parameters'][_0x48cc('0x76')]){return _0x33bc0e(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x48cc('0x24')==typeof _0x14d79f[_0x48cc('0x77')][_0x48cc('0x76')]['admin']&&_0x48cc('0x24')==typeof _0x14d79f[_0x48cc('0x77')][_0x48cc('0x76')][_0x48cc('0x78')]){return _0x33bc0e(new Error(_0x48cc('0x79')));}}else if(_0x14d79f[_0x48cc('0x34')]===_0x48cc('0x7a')){if(_0x48cc('0x24')==typeof _0x14d79f[_0x48cc('0x77')][_0x48cc('0x7b')]){return _0x33bc0e(new Error(_0x48cc('0x7c')));}if(_0x48cc('0x24')==typeof _0x14d79f[_0x48cc('0x77')]['scriptPath']){return _0x33bc0e(new Error(_0x48cc('0x7d')));}}else{return _0x33bc0e(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x17173a=_0x14d79f[_0x48cc('0x37')];var _0x2a8521=_0x14d79f['description'];var _0x258974=_0x14d79f['type'];var _0x51e790=_0x14d79f['sidebar']?_0x14d79f[_0x48cc('0x7e')]:_0x48cc('0x7f');var _0x4aeb1b=_0x14d79f[_0x48cc('0x80')]?_0x14d79f['icon']:_0x48cc('0x81');var _0x13c469='';var _0x69b2df='';var _0x455799='';var _0x1c3c02='';var _0x553930=_0x14d79f[_0x48cc('0x74')];if(_0x258974==='html'){if(_0x48cc('0x24')!=typeof _0x14d79f[_0x48cc('0x77')]['views'][_0x48cc('0x82')]){var _0x40ebc3=_0x14d79f[_0x48cc('0x77')]['views'][_0x48cc('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x40ebc3)){_0x13c469=path[_0x48cc('0x4f')](_0x48cc('0x83'),_0x45398e,_0x388462[0x0],_0x40ebc3);}else{_0x13c469=_0x40ebc3;}}else{logger[_0x48cc('0x62')](_0x48cc('0x84'));}if(_0x48cc('0x24')!=typeof _0x14d79f[_0x48cc('0x77')][_0x48cc('0x76')][_0x48cc('0x78')]){var _0x5b2a50=_0x14d79f[_0x48cc('0x77')][_0x48cc('0x76')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5b2a50)){_0x69b2df=path[_0x48cc('0x4f')](_0x48cc('0x83'),_0x45398e,_0x388462[0x0],_0x5b2a50);}else{_0x69b2df=_0x5b2a50;}}else{logger['info'](_0x48cc('0x85'));}}else if(_0x258974===_0x48cc('0x7a')){_0x455799=_0x14d79f[_0x48cc('0x77')]['scriptName'];_0x1c3c02=_0x14d79f[_0x48cc('0x77')]['scriptPath'];if(_0x48cc('0x24')!=typeof _0x14d79f[_0x48cc('0x77')][_0x48cc('0x76')]){if(_0x48cc('0x24')!=typeof _0x14d79f[_0x48cc('0x77')][_0x48cc('0x76')][_0x48cc('0x82')]){var _0x40ebc3=_0x14d79f['parameters'][_0x48cc('0x76')][_0x48cc('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x48cc('0x86')](_0x40ebc3)){_0x13c469=path[_0x48cc('0x4f')](_0x48cc('0x83'),_0x45398e,_0x388462[0x0],_0x40ebc3);}else{_0x13c469=_0x40ebc3;}}if(_0x48cc('0x24')!=typeof _0x14d79f[_0x48cc('0x77')]['views'][_0x48cc('0x78')]){var _0x5b2a50=_0x14d79f[_0x48cc('0x77')][_0x48cc('0x76')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5b2a50)){_0x69b2df=path['join'](_0x48cc('0x83'),_0x45398e,_0x388462[0x0],_0x5b2a50);}else{_0x69b2df=_0x5b2a50;}}}}var _0x37df5f={'name':_0x17173a,'description':_0x2a8521,'path':path[_0x48cc('0x4f')](_0x45398e,_0x388462[0x0]),'type':_0x258974,'sidebar':_0x51e790,'icon':_0x4aeb1b,'adminUrl':_0x13c469,'agentUrl':_0x69b2df,'scriptName':_0x455799,'scriptPath':_0x1c3c02,'version':_0x553930};removeReferences(_0x5e3055,null);return db['Plugin'][_0x48cc('0x87')](_0x37df5f)['then'](function(_0x338e56){var _0x298181={'role':_0x942c7[_0x48cc('0x88')][_0x48cc('0x89')],'userProfileId':_0x942c7[_0x48cc('0x88')][_0x48cc('0x8a')]};if(!_0x298181)throw new Error(_0x48cc('0x8b'));if(_0x298181[_0x48cc('0x89')]==='user'){var _0x4e6b92=_0x338e56[_0x48cc('0x2d')]({'plain':!![]});return db['UserProfileSection'][_0x48cc('0x4c')]({'where':{'name':_0x48cc('0x2e'),'userProfileId':_0x298181[_0x48cc('0x8a')]},'raw':!![]})['then'](function(_0x126a2d){if(_0x126a2d&&_0x126a2d[_0x48cc('0x8c')]===0x0){return db[_0x48cc('0x2f')][_0x48cc('0x87')]({'name':_0x4e6b92['name'],'resourceId':_0x4e6b92['id'],'type':_0x126a2d[_0x48cc('0x37')],'sectionId':_0x126a2d['id']},{})[_0x48cc('0x2b')](function(){return _0x338e56;});}else{return _0x338e56;}})[_0x48cc('0x4d')](function(_0x557929){logger[_0x48cc('0x57')](_0x48cc('0x8d'),_0x557929);throw _0x557929;});}return _0x338e56;})[_0x48cc('0x2b')](respondWithResult(_0x44b2d0,null))[_0x48cc('0x4d')](handleError(_0x44b2d0,null));}});}catch(_0x27e762){_0x44b2d0['status'](0x1f4)[_0x48cc('0x30')](_0x27e762);}};function removeReferences(_0x4a69aa,_0x2d2484){try{if(_0x4a69aa){fs[_0x48cc('0x61')](_0x4a69aa);logger[_0x48cc('0x62')](_0x48cc('0x8e'));}if(_0x2d2484){rimraf(_0x2d2484,function(){});logger[_0x48cc('0x62')](_0x48cc('0x8f'));}}catch(_0x559ad1){logger[_0x48cc('0x57')](_0x559ad1);}}exports[_0x48cc('0x2a')]=function(_0x1c5995,_0x230acc,_0x3dad23){return db['Plugin'][_0x48cc('0x4c')]({'where':{'id':_0x1c5995['params']['id']}})[_0x48cc('0x2b')](handleEntityNotFound(_0x230acc,null))[_0x48cc('0x2b')](saveUpdates(_0x1c5995['body'],null))[_0x48cc('0x2b')](respondWithResult(_0x230acc,null))[_0x48cc('0x4d')](handleError(_0x230acc,null));};exports[_0x48cc('0x90')]=function(_0x51fe8a,_0x1290ab,_0x43fc8a){return db[_0x48cc('0x48')][_0x48cc('0x4c')]({'where':{'id':_0x51fe8a[_0x48cc('0x4a')]['id']}})[_0x48cc('0x2b')](function(_0x49a15b){if(_0x49a15b){return _0x49a15b[_0x48cc('0x2c')]();}})['then'](function(_0x476df7){rimraf(path[_0x48cc('0x4f')](config[_0x48cc('0x50')],_0x48cc('0x5b'),path[_0x48cc('0x5c')](_0x476df7[_0x48cc('0x8')])),function(){});return _0x476df7;})[_0x48cc('0x2b')](handleEntityNotFound(_0x1290ab,null))['then'](respondWithStatusCode(_0x1290ab,null))['catch'](handleError(_0x1290ab,null));};exports[_0x48cc('0x91')]=function(_0x52956f,_0x236858,_0x53d0d2){return BPromise[_0x48cc('0x92')]()['then'](function(){if(!_0x52956f[_0x48cc('0x38')][_0x48cc('0x8')]){throw new Error(_0x48cc('0x93'));}if(!_0x52956f['query'][_0x48cc('0x94')]){throw new Error(_0x48cc('0x95'));}var _0x1e702c=_0x52956f[_0x48cc('0x38')]['hostname']?_0x52956f[_0x48cc('0x38')][_0x48cc('0x96')]+':'+_0x52956f['query'][_0x48cc('0x94')]:_0x48cc('0x97')+_0x52956f[_0x48cc('0x38')][_0x48cc('0x94')];var _0x146757=_0x52956f[_0x48cc('0x38')][_0x48cc('0x22')]?_0x52956f[_0x48cc('0x38')][_0x48cc('0x22')]:!![];var _0x385372=_0x52956f[_0x48cc('0x38')][_0x48cc('0x98')]?_0x52956f['query'][_0x48cc('0x98')]:null;var _0x5c7761={'method':_0x52956f[_0x48cc('0x99')],'uri':util[_0x48cc('0x51')](_0x48cc('0x9a'),_0x1e702c,_0x52956f[_0x48cc('0x38')]['path']),'json':_0x146757,'resolveWithFullResponse':!![],'encoding':_0x385372,'qs':_0x52956f['query']};if(_0x52956f[_0x48cc('0x9b')]){_0x5c7761['headers']=_0x52956f['headers'];if(_0x5c7761[_0x48cc('0x9b')][_0x48cc('0x9c')]){delete _0x5c7761[_0x48cc('0x9b')][_0x48cc('0x9c')];}}if(_0x5c7761['headers']['content-type']){delete _0x5c7761[_0x48cc('0x9b')][_0x48cc('0x9d')];}return rp(_0x5c7761);})[_0x48cc('0x2b')](function(_0x30b334){if(_0x30b334){_0x236858[_0x48cc('0x27')](_0x30b334['headers']);logger['info'](_0x30b334[_0x48cc('0x88')]);if(_[_0x48cc('0x9e')](_0x52956f[_0x48cc('0x38')][_0x48cc('0x8')],'download')&&_0x30b334[_0x48cc('0x9f')]==0x1f4){return _0x236858[_0x48cc('0x1f')](_0x30b334[_0x48cc('0x9f')]);}else{return _0x236858['status'](_0x30b334[_0x48cc('0x9f')])['send'](_0x30b334['body']);}}else{return _0x236858[_0x48cc('0x1f')](0xc8);}})['catch'](handleError(_0x236858,null));};exports[_0x48cc('0xa0')]=function(_0x8daca3,_0xa9ebf5,_0x2f77e6){return BPromise[_0x48cc('0x92')]()[_0x48cc('0x2b')](function(){if(!_0x8daca3[_0x48cc('0x38')][_0x48cc('0x8')]){throw new Error(_0x48cc('0x93'));}if(!_0x8daca3[_0x48cc('0x38')]['port']){throw new Error(_0x48cc('0x95'));}var _0x29f6e2=_0x8daca3[_0x48cc('0x38')][_0x48cc('0x96')]?_0x8daca3['query'][_0x48cc('0x96')]+':'+_0x8daca3[_0x48cc('0x38')][_0x48cc('0x94')]:_0x48cc('0x97')+_0x8daca3[_0x48cc('0x38')]['port'];var _0x3bea33=_0x8daca3['query'][_0x48cc('0x22')]?_0x8daca3[_0x48cc('0x38')][_0x48cc('0x22')]:!![];var _0x26b453=_0x8daca3[_0x48cc('0x38')][_0x48cc('0x98')]?_0x8daca3[_0x48cc('0x38')][_0x48cc('0x98')]:null;var _0x5ca98f={'method':_0x8daca3[_0x48cc('0x99')],'uri':util[_0x48cc('0x51')](_0x48cc('0x9a'),_0x29f6e2,_0x8daca3[_0x48cc('0x38')][_0x48cc('0x8')]),'json':_0x3bea33,'resolveWithFullResponse':!![],'encoding':_0x26b453,'body':_0x8daca3[_0x48cc('0x88')]};if(_0x8daca3['headers']){_0x5ca98f[_0x48cc('0x9b')]=_0x8daca3[_0x48cc('0x9b')];if(_0x5ca98f[_0x48cc('0x9b')][_0x48cc('0x9c')]){delete _0x5ca98f[_0x48cc('0x9b')][_0x48cc('0x9c')];}}if(_0x5ca98f[_0x48cc('0x9b')]['content-type']){delete _0x5ca98f[_0x48cc('0x9b')][_0x48cc('0x9d')];}return rp(_0x5ca98f);})['then'](function(_0x31c765){if(_0x31c765){_0xa9ebf5[_0x48cc('0x27')](_0x31c765['headers']);logger[_0x48cc('0x62')](_0x31c765['body']);return _0xa9ebf5[_0x48cc('0x21')](_0x31c765[_0x48cc('0x9f')])[_0x48cc('0x30')](_0x31c765[_0x48cc('0x88')]);}else{return _0xa9ebf5[_0x48cc('0x1f')](0xc8);}})[_0x48cc('0x4d')](handleError(_0xa9ebf5,null));}; \ No newline at end of file +var _0x6d9d=['attributes','intersection','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','Plugin','include','findAll','rows','catch','show','params','fields','includeAll','options','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','Invalid\x20manifest:\x20views\x20missing','admin','views','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','script','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','encoding','method','headers','content-length','content-type','set','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','offset','limit','count','Content-Range','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query'];(function(_0xf31a,_0x5f5b89){var _0x4df458=function(_0x1ceeaf){while(--_0x1ceeaf){_0xf31a['push'](_0xf31a['shift']());}};_0x4df458(++_0x5f5b89);}(_0x6d9d,0x11b));var _0xd6d9=function(_0x11328d,_0x43855c){_0x11328d=_0x11328d-0x0;var _0x1cd6a1=_0x6d9d[_0x11328d];return _0x1cd6a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6d9('0x0'));var zipdir=require(_0xd6d9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd6d9('0x2'));var BPromise=require(_0xd6d9('0x3'));var Mustache=require('mustache');var util=require(_0xd6d9('0x4'));var path=require(_0xd6d9('0x5'));var sox=require(_0xd6d9('0x6'));var csv=require(_0xd6d9('0x7'));var ejs=require(_0xd6d9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd6d9('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd6d9('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd6d9('0x7'));var querystring=require(_0xd6d9('0xb'));var Papa=require(_0xd6d9('0xc'));var extract=require(_0xd6d9('0xd'));var rimraf=require(_0xd6d9('0x0'));var archiver=require(_0xd6d9('0xe'));var Redis=require(_0xd6d9('0xf'));var authService=require(_0xd6d9('0x10'));var qs=require(_0xd6d9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6d9('0x12'));var logger=require(_0xd6d9('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd6d9('0x14'));var db=require(_0xd6d9('0x15'))['db'];config[_0xd6d9('0x16')]=_[_0xd6d9('0x17')](config[_0xd6d9('0x16')],{'host':_0xd6d9('0x18'),'port':0x18eb});var socket=require(_0xd6d9('0x19'))(new Redis(config[_0xd6d9('0x16')]));require(_0xd6d9('0x1a'))[_0xd6d9('0x1b')](socket);function respondWithStatusCode(_0x509188,_0x405fad){_0x405fad=_0x405fad||0xcc;return function(_0x3d1d85){if(_0x3d1d85){return _0x509188[_0xd6d9('0x1c')](_0x405fad);}return _0x509188[_0xd6d9('0x1d')](_0x405fad)[_0xd6d9('0x1e')]();};}function respondWithResult(_0x1f2c46,_0xd901c1){_0xd901c1=_0xd901c1||0xc8;return function(_0x5eb16e){if(_0x5eb16e){return _0x1f2c46[_0xd6d9('0x1d')](_0xd901c1)['json'](_0x5eb16e);}};}function respondWithFilteredResult(_0x2d793a,_0x4478af){return function(_0x5c36a1){if(_0x5c36a1){var _0x123d16=typeof _0x4478af[_0xd6d9('0x1f')]==='undefined'&&typeof _0x4478af[_0xd6d9('0x20')]==='undefined';var _0xbc3650=_0x5c36a1[_0xd6d9('0x21')];var _0x1af7b2=_0x123d16?0x0:_0x4478af[_0xd6d9('0x1f')];var _0x484c3c=_0x123d16?_0x5c36a1[_0xd6d9('0x21')]:_0x4478af[_0xd6d9('0x1f')]+_0x4478af[_0xd6d9('0x20')];var _0x46bc99;if(_0x484c3c>=_0xbc3650){_0x484c3c=_0xbc3650;_0x46bc99=0xc8;}else{_0x46bc99=0xce;}_0x2d793a[_0xd6d9('0x1d')](_0x46bc99);return _0x2d793a['set'](_0xd6d9('0x22'),_0x1af7b2+'-'+_0x484c3c+'/'+_0xbc3650)['json'](_0x5c36a1);}return null;};}function patchUpdates(_0x1e50c5){return function(_0x30b65a){try{jsonpatch['apply'](_0x30b65a,_0x1e50c5,!![]);}catch(_0x250216){return BPromise['reject'](_0x250216);}return _0x30b65a['save']();};}function saveUpdates(_0x527b14,_0x366e2d){return function(_0x2a6730){if(_0x2a6730){return _0x2a6730[_0xd6d9('0x23')](_0x527b14)[_0xd6d9('0x24')](function(_0xe9877f){return _0xe9877f;});}return null;};}function removeEntity(_0x1cb95f,_0x100d65){return function(_0x44e87d){if(_0x44e87d){return _0x44e87d[_0xd6d9('0x25')]()['then'](function(){var _0x387d7b=_0x44e87d[_0xd6d9('0x26')]({'plain':!![]});var _0x3ec7ba=_0xd6d9('0x27');return db[_0xd6d9('0x28')][_0xd6d9('0x25')]({'where':{'type':_0x3ec7ba,'resourceId':_0x387d7b['id']}})[_0xd6d9('0x24')](function(){return _0x44e87d;});})[_0xd6d9('0x24')](function(){_0x1cb95f[_0xd6d9('0x1d')](0xcc)[_0xd6d9('0x1e')]();});}};}function handleEntityNotFound(_0x38f6ce,_0x4cfd8b){return function(_0xd7e8d7){if(!_0xd7e8d7){_0x38f6ce[_0xd6d9('0x1c')](0x194);}return _0xd7e8d7;};}function handleError(_0x30d22e,_0x57cfd3){_0x57cfd3=_0x57cfd3||0x1f4;return function(_0x5b02b1){logger[_0xd6d9('0x29')](_0x5b02b1[_0xd6d9('0x2a')]);if(_0x5b02b1[_0xd6d9('0x2b')]){delete _0x5b02b1['name'];}_0x30d22e[_0xd6d9('0x1d')](_0x57cfd3)[_0xd6d9('0x2c')](_0x5b02b1);};}exports[_0xd6d9('0x2d')]=function(_0x53dd25,_0x2ff44a){var _0x2b5e25={},_0x20eebe={},_0x1de7fb={'count':0x0,'rows':[]};var _0x3fccf2=_[_0xd6d9('0x2e')](db['Plugin'][_0xd6d9('0x2f')],function(_0x8dde86){return{'name':_0x8dde86['fieldName'],'type':_0x8dde86[_0xd6d9('0x30')][_0xd6d9('0x31')]};});_0x20eebe[_0xd6d9('0x32')]=_[_0xd6d9('0x2e')](_0x3fccf2,_0xd6d9('0x2b'));_0x20eebe['query']=_[_0xd6d9('0x33')](_0x53dd25[_0xd6d9('0x34')]);_0x20eebe['filters']=_['intersection'](_0x20eebe[_0xd6d9('0x32')],_0x20eebe['query']);_0x2b5e25[_0xd6d9('0x35')]=_[_0xd6d9('0x36')](_0x20eebe[_0xd6d9('0x32')],qs['fields'](_0x53dd25[_0xd6d9('0x34')]['fields']));_0x2b5e25[_0xd6d9('0x35')]=_0x2b5e25[_0xd6d9('0x35')][_0xd6d9('0x37')]?_0x2b5e25[_0xd6d9('0x35')]:_0x20eebe[_0xd6d9('0x32')];if(!_0x53dd25[_0xd6d9('0x34')][_0xd6d9('0x38')](_0xd6d9('0x39'))){_0x2b5e25[_0xd6d9('0x20')]=qs['limit'](_0x53dd25[_0xd6d9('0x34')]['limit']);_0x2b5e25[_0xd6d9('0x1f')]=qs[_0xd6d9('0x1f')](_0x53dd25[_0xd6d9('0x34')][_0xd6d9('0x1f')]);}_0x2b5e25[_0xd6d9('0x3a')]=qs[_0xd6d9('0x3b')](_0x53dd25[_0xd6d9('0x34')][_0xd6d9('0x3b')]);_0x2b5e25['where']=qs[_0xd6d9('0x3c')](_[_0xd6d9('0x3d')](_0x53dd25['query'],_0x20eebe[_0xd6d9('0x3c')]),_0x3fccf2);if(_0x53dd25[_0xd6d9('0x34')][_0xd6d9('0x3e')]){_0x2b5e25['where']=_[_0xd6d9('0x3f')](_0x2b5e25[_0xd6d9('0x40')],{'$or':_[_0xd6d9('0x2e')](_0x3fccf2,function(_0x25fac3){if(_0x25fac3[_0xd6d9('0x30')]!==_0xd6d9('0x41')){var _0x3e33ba={};_0x3e33ba[_0x25fac3[_0xd6d9('0x2b')]]={'$like':'%'+_0x53dd25[_0xd6d9('0x34')][_0xd6d9('0x3e')]+'%'};return _0x3e33ba;}})});}_0x2b5e25=_[_0xd6d9('0x3f')]({},_0x2b5e25,_0x53dd25['options']);var _0x1541fd={'where':_0x2b5e25[_0xd6d9('0x40')]};return db[_0xd6d9('0x42')]['count'](_0x1541fd)[_0xd6d9('0x24')](function(_0x53e85d){_0x1de7fb['count']=_0x53e85d;if(_0x53dd25[_0xd6d9('0x34')]['includeAll']){_0x2b5e25[_0xd6d9('0x43')]=[{'all':!![]}];}return db['Plugin'][_0xd6d9('0x44')](_0x2b5e25);})['then'](function(_0x15fc8c){_0x1de7fb[_0xd6d9('0x45')]=_0x15fc8c;return _0x1de7fb;})[_0xd6d9('0x24')](respondWithFilteredResult(_0x2ff44a,_0x2b5e25))[_0xd6d9('0x46')](handleError(_0x2ff44a,null));};exports[_0xd6d9('0x47')]=function(_0x5dfc08,_0x1f8c74){var _0x2d8d75={'raw':!![],'where':{'id':_0x5dfc08[_0xd6d9('0x48')]['id']}},_0x27249a={};_0x27249a[_0xd6d9('0x32')]=_[_0xd6d9('0x33')](db[_0xd6d9('0x42')][_0xd6d9('0x2f')]);_0x27249a[_0xd6d9('0x34')]=_['keys'](_0x5dfc08[_0xd6d9('0x34')]);_0x27249a[_0xd6d9('0x3c')]=_[_0xd6d9('0x36')](_0x27249a[_0xd6d9('0x32')],_0x27249a[_0xd6d9('0x34')]);_0x2d8d75['attributes']=_['intersection'](_0x27249a[_0xd6d9('0x32')],qs[_0xd6d9('0x49')](_0x5dfc08[_0xd6d9('0x34')][_0xd6d9('0x49')]));_0x2d8d75[_0xd6d9('0x35')]=_0x2d8d75[_0xd6d9('0x35')][_0xd6d9('0x37')]?_0x2d8d75[_0xd6d9('0x35')]:_0x27249a['model'];if(_0x5dfc08[_0xd6d9('0x34')][_0xd6d9('0x4a')]){_0x2d8d75['include']=[{'all':!![]}];}_0x2d8d75=_[_0xd6d9('0x3f')]({},_0x2d8d75,_0x5dfc08[_0xd6d9('0x4b')]);return db[_0xd6d9('0x42')][_0xd6d9('0x4c')](_0x2d8d75)[_0xd6d9('0x24')](handleEntityNotFound(_0x1f8c74,null))['then'](respondWithResult(_0x1f8c74,null))[_0xd6d9('0x46')](handleError(_0x1f8c74,null));};exports[_0xd6d9('0x4d')]=function(_0x1d46a1,_0x3c4851,_0x1cd729){return db['Plugin'][_0xd6d9('0x4c')]({'where':{'id':_0x1d46a1['params']['id']},'attributes':[_0xd6d9('0x2b'),_0xd6d9('0x5')],'raw':!![]})['then'](handleEntityNotFound(_0x3c4851,null))[_0xd6d9('0x24')](function(_0x1ab39a){if(_0x1ab39a){var _0x301c1f=path[_0xd6d9('0x4e')](config[_0xd6d9('0x4f')],_0xd6d9('0x50'),util[_0xd6d9('0x51')](_0xd6d9('0x52'),path[_0xd6d9('0x53')](_0x1ab39a[_0xd6d9('0x5')])));var _0x1938b8=fs[_0xd6d9('0x54')](_0x301c1f);var _0x547b1a=archiver(_0xd6d9('0x55'),{'zlib':{'level':0x9}});_0x547b1a['on'](_0xd6d9('0x56'),function(_0x1f6a67){if(_0x1f6a67['code']===_0xd6d9('0x57')){logger[_0xd6d9('0x29')](_0x1f6a67);}else{throw new db[(_0xd6d9('0x58'))][(_0xd6d9('0x59'))](_0xd6d9('0x5a'));}});_0x547b1a['on'](_0xd6d9('0x29'),function(_0x3c461c){throw new db[(_0xd6d9('0x58'))][(_0xd6d9('0x59'))](_0xd6d9('0x5a'));});_0x547b1a['pipe'](_0x1938b8);_0x547b1a[_0xd6d9('0x5b')](_0xd6d9('0x5c'),{'cwd':path['join'](config[_0xd6d9('0x4f')],_0xd6d9('0x50'),path[_0xd6d9('0x5d')](_0x1ab39a[_0xd6d9('0x5')])),'ignore':[path[_0xd6d9('0x4e')](path['basename'](_0x1ab39a[_0xd6d9('0x5')]),_0xd6d9('0x5e')),path['join'](path[_0xd6d9('0x53')](_0x1ab39a[_0xd6d9('0x5')]),_0xd6d9('0x5f'))],'nodir':!![]})[_0xd6d9('0x60')]();_0x1938b8['on']('close',function(){if(!fs[_0xd6d9('0x61')](_0x301c1f)){throw new db['Sequelize'][(_0xd6d9('0x59'))](_0xd6d9('0x62'));}return _0x3c4851['download'](_0x301c1f,util[_0xd6d9('0x51')](_0xd6d9('0x52'),path['basename'](_0x1ab39a[_0xd6d9('0x5')])),function(_0x15f6b7){if(_0x15f6b7){throw new db[(_0xd6d9('0x58'))][(_0xd6d9('0x59'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xd6d9('0x63')](_0x301c1f);logger[_0xd6d9('0x64')](_0xd6d9('0x65'));logger[_0xd6d9('0x64')](_0xd6d9('0x66'));});});}return null;})['catch'](handleError(_0x3c4851,null));};exports['upload']=function(_0x3e8e7d,_0x4fded8,_0x203953){var _0x16c1b5=path[_0xd6d9('0x53')](_0x3e8e7d[_0xd6d9('0x67')][_0xd6d9('0x68')],path[_0xd6d9('0x69')](_0x3e8e7d[_0xd6d9('0x67')][_0xd6d9('0x68')]));var _0x2a9893=path[_0xd6d9('0x4e')](config['root'],_0xd6d9('0x50'),_0x3e8e7d[_0xd6d9('0x67')][_0xd6d9('0x68')]);var _0x7318df=path[_0xd6d9('0x4e')](config[_0xd6d9('0x4f')],_0xd6d9('0x50'),_0x16c1b5);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x2a9893);logger[_0xd6d9('0x64')](_0xd6d9('0x6a'),_0x7318df);try{fs[_0xd6d9('0x6b')](_0x2a9893,parseInt(_0xd6d9('0x6c'),0x8));extract(_0x2a9893,{'dir':_0x7318df},function(_0x2d9bb3){if(_0x2d9bb3){logger[_0xd6d9('0x29')](_0x2d9bb3);handleError(_0x2d9bb3,!![]);};var _0x5b806d=fs[_0xd6d9('0x6d')](_0x7318df);if(_0x5b806d[_0xd6d9('0x37')]>0x1){removeReferences(_0x2a9893,_0x7318df);logger[_0xd6d9('0x29')](_0xd6d9('0x6e'));return _0x203953(new Error(_0xd6d9('0x6e')));}var _0x29c2a6=fs[_0xd6d9('0x6f')](path['join'](_0x7318df,_0x5b806d[0x0]));if(_0x29c2a6[_0xd6d9('0x70')]()){removeReferences(_0x2a9893,_0x7318df);logger[_0xd6d9('0x29')](_0xd6d9('0x6e'));return _0x203953(new Error(_0xd6d9('0x6e')));}if(_0x29c2a6[_0xd6d9('0x71')]()){var _0x28070b=fs[_0xd6d9('0x6d')](path[_0xd6d9('0x4e')](_0x7318df,_0x5b806d[0x0]));if(_0x28070b[_0xd6d9('0x37')]===0x0){removeReferences(_0x2a9893,_0x7318df);logger[_0xd6d9('0x29')](_0xd6d9('0x6e'));return _0x203953(new Error('Invalid\x20plugin\x20structure'));}var _0x59df2c=_0x28070b[_0xd6d9('0x72')](function(_0x27bb41){return _0x27bb41===_0xd6d9('0x73');});if(!_0x59df2c){return _0x203953(new Error(_0xd6d9('0x74')));}var _0x5dbb97=fs['readFileSync'](path[_0xd6d9('0x4e')](_0x7318df,_0x5b806d[0x0],_0xd6d9('0x73')));var _0x4ad897=JSON[_0xd6d9('0x75')](_0x5dbb97);if(_0xd6d9('0x76')==typeof _0x4ad897[_0xd6d9('0x2b')]){return _0x203953(new Error(_0xd6d9('0x77')));}if(_0xd6d9('0x76')==typeof _0x4ad897[_0xd6d9('0x30')]){return _0x203953(new Error(_0xd6d9('0x78')));}if('undefined'==typeof _0x4ad897[_0xd6d9('0x79')]){return _0x203953(new Error(_0xd6d9('0x7a')));}if(_0xd6d9('0x76')==typeof _0x4ad897[_0xd6d9('0x7b')]){return _0x203953(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4ad897[_0xd6d9('0x30')]===_0xd6d9('0x7c')){if(_0xd6d9('0x76')==typeof _0x4ad897['parameters']['views']){return _0x203953(new Error(_0xd6d9('0x7d')));}if(_0xd6d9('0x76')==typeof _0x4ad897[_0xd6d9('0x7b')]['views'][_0xd6d9('0x7e')]&&'undefined'==typeof _0x4ad897[_0xd6d9('0x7b')][_0xd6d9('0x7f')]['agent']){return _0x203953(new Error(_0xd6d9('0x80')));}}else if(_0x4ad897['type']==='script'){if(_0xd6d9('0x76')==typeof _0x4ad897['parameters'][_0xd6d9('0x81')]){return _0x203953(new Error(_0xd6d9('0x82')));}if(_0xd6d9('0x76')==typeof _0x4ad897[_0xd6d9('0x7b')][_0xd6d9('0x83')]){return _0x203953(new Error(_0xd6d9('0x84')));}}else{return _0x203953(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x577924=_0x4ad897[_0xd6d9('0x2b')];var _0x2e7a15=_0x4ad897['description'];var _0x5d9e6c=_0x4ad897[_0xd6d9('0x30')];var _0x2a9058=_0x4ad897[_0xd6d9('0x85')]?_0x4ad897[_0xd6d9('0x85')]:'always';var _0x47167b=_0x4ad897[_0xd6d9('0x86')]?_0x4ad897['icon']:_0xd6d9('0x87');var _0x27300e='';var _0x45dedf='';var _0x44eddf='';var _0x1844b7='';var _0x1cb017=_0x4ad897[_0xd6d9('0x79')];if(_0x5d9e6c==='html'){if(_0xd6d9('0x76')!=typeof _0x4ad897['parameters']['views'][_0xd6d9('0x7e')]){var _0x539287=_0x4ad897[_0xd6d9('0x7b')][_0xd6d9('0x7f')][_0xd6d9('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xd6d9('0x88')](_0x539287)){_0x27300e=path['join'](_0xd6d9('0x89'),_0x16c1b5,_0x5b806d[0x0],_0x539287);}else{_0x27300e=_0x539287;}}else{logger[_0xd6d9('0x64')](_0xd6d9('0x8a'));}if(_0xd6d9('0x76')!=typeof _0x4ad897['parameters'][_0xd6d9('0x7f')]['agent']){var _0x4f5084=_0x4ad897[_0xd6d9('0x7b')][_0xd6d9('0x7f')][_0xd6d9('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0xd6d9('0x88')](_0x4f5084)){_0x45dedf=path[_0xd6d9('0x4e')]('plugins',_0x16c1b5,_0x5b806d[0x0],_0x4f5084);}else{_0x45dedf=_0x4f5084;}}else{logger[_0xd6d9('0x64')](_0xd6d9('0x8c'));}}else if(_0x5d9e6c===_0xd6d9('0x8d')){_0x44eddf=_0x4ad897['parameters'][_0xd6d9('0x81')];_0x1844b7=_0x4ad897[_0xd6d9('0x7b')]['scriptPath'];if('undefined'!=typeof _0x4ad897[_0xd6d9('0x7b')][_0xd6d9('0x7f')]){if(_0xd6d9('0x76')!=typeof _0x4ad897['parameters']['views'][_0xd6d9('0x7e')]){var _0x539287=_0x4ad897[_0xd6d9('0x7b')]['views'][_0xd6d9('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x539287)){_0x27300e=path['join'](_0xd6d9('0x89'),_0x16c1b5,_0x5b806d[0x0],_0x539287);}else{_0x27300e=_0x539287;}}if(_0xd6d9('0x76')!=typeof _0x4ad897[_0xd6d9('0x7b')][_0xd6d9('0x7f')][_0xd6d9('0x8b')]){var _0x4f5084=_0x4ad897[_0xd6d9('0x7b')][_0xd6d9('0x7f')][_0xd6d9('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0xd6d9('0x88')](_0x4f5084)){_0x45dedf=path['join'](_0xd6d9('0x89'),_0x16c1b5,_0x5b806d[0x0],_0x4f5084);}else{_0x45dedf=_0x4f5084;}}}}var _0x42ff25={'name':_0x577924,'description':_0x2e7a15,'path':path[_0xd6d9('0x4e')](_0x16c1b5,_0x5b806d[0x0]),'type':_0x5d9e6c,'sidebar':_0x2a9058,'icon':_0x47167b,'adminUrl':_0x27300e,'agentUrl':_0x45dedf,'scriptName':_0x44eddf,'scriptPath':_0x1844b7,'version':_0x1cb017};removeReferences(_0x2a9893,null);return db['Plugin']['create'](_0x42ff25)['then'](function(_0x3caca6){var _0x10ec3e={'role':_0x3e8e7d[_0xd6d9('0x8e')][_0xd6d9('0x8f')],'userProfileId':_0x3e8e7d[_0xd6d9('0x8e')][_0xd6d9('0x90')]};if(!_0x10ec3e)throw new Error(_0xd6d9('0x91'));if(_0x10ec3e[_0xd6d9('0x8f')]==='user'){var _0x2e4753=_0x3caca6[_0xd6d9('0x26')]({'plain':!![]});return db[_0xd6d9('0x92')][_0xd6d9('0x4c')]({'where':{'name':_0xd6d9('0x27'),'userProfileId':_0x10ec3e['userProfileId']},'raw':!![]})[_0xd6d9('0x24')](function(_0x44bd5b){if(_0x44bd5b&&_0x44bd5b[_0xd6d9('0x93')]===0x0){return db[_0xd6d9('0x28')][_0xd6d9('0x94')]({'name':_0x2e4753[_0xd6d9('0x2b')],'resourceId':_0x2e4753['id'],'type':_0x44bd5b[_0xd6d9('0x2b')],'sectionId':_0x44bd5b['id']},{})['then'](function(){return _0x3caca6;});}else{return _0x3caca6;}})[_0xd6d9('0x46')](function(_0x658138){logger[_0xd6d9('0x29')](_0xd6d9('0x95'),_0x658138);throw _0x658138;});}return _0x3caca6;})['then'](respondWithResult(_0x4fded8,null))[_0xd6d9('0x46')](handleError(_0x4fded8,null));}});}catch(_0x1f2d2b){_0x4fded8[_0xd6d9('0x1d')](0x1f4)['send'](_0x1f2d2b);}};function removeReferences(_0x486560,_0x2a14a7){try{if(_0x486560){fs[_0xd6d9('0x63')](_0x486560);logger['info'](_0xd6d9('0x96'));}if(_0x2a14a7){rimraf(_0x2a14a7,function(){});logger[_0xd6d9('0x64')](_0xd6d9('0x97'));}}catch(_0x1cadb3){logger[_0xd6d9('0x29')](_0x1cadb3);}}exports[_0xd6d9('0x23')]=function(_0xf75d06,_0xc10244,_0x49d97a){return db[_0xd6d9('0x42')]['find']({'where':{'id':_0xf75d06['params']['id']}})[_0xd6d9('0x24')](handleEntityNotFound(_0xc10244,null))[_0xd6d9('0x24')](saveUpdates(_0xf75d06[_0xd6d9('0x8e')],null))[_0xd6d9('0x24')](respondWithResult(_0xc10244,null))['catch'](handleError(_0xc10244,null));};exports['delete']=function(_0x349226,_0x30e235,_0x24ccd8){return db[_0xd6d9('0x42')][_0xd6d9('0x4c')]({'where':{'id':_0x349226[_0xd6d9('0x48')]['id']}})[_0xd6d9('0x24')](function(_0xc0d281){if(_0xc0d281){return _0xc0d281['destroy']();}})[_0xd6d9('0x24')](function(_0x3e6720){rimraf(path['join'](config[_0xd6d9('0x4f')],_0xd6d9('0x50'),path[_0xd6d9('0x5d')](_0x3e6720[_0xd6d9('0x5')])),function(){});return _0x3e6720;})[_0xd6d9('0x24')](handleEntityNotFound(_0x30e235,null))['then'](respondWithStatusCode(_0x30e235,null))[_0xd6d9('0x46')](handleError(_0x30e235,null));};exports['webhookGet']=function(_0x5399d8,_0x15bf39,_0x43696f){return BPromise[_0xd6d9('0x98')]()[_0xd6d9('0x24')](function(){if(!_0x5399d8['query'][_0xd6d9('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5399d8[_0xd6d9('0x34')][_0xd6d9('0x99')]){throw new Error(_0xd6d9('0x9a'));}var _0x2cc4df=_0x5399d8[_0xd6d9('0x34')][_0xd6d9('0x9b')]?_0x5399d8[_0xd6d9('0x34')]['hostname']+':'+_0x5399d8[_0xd6d9('0x34')]['port']:_0xd6d9('0x9c')+_0x5399d8[_0xd6d9('0x34')][_0xd6d9('0x99')];var _0x851e0f=_0x5399d8['query'][_0xd6d9('0x9d')]?_0x5399d8[_0xd6d9('0x34')][_0xd6d9('0x9d')]:!![];var _0x1c0de6=_0x5399d8[_0xd6d9('0x34')][_0xd6d9('0x9e')]?_0x5399d8['query'][_0xd6d9('0x9e')]:null;var _0x4bd1bb={'method':_0x5399d8[_0xd6d9('0x9f')],'uri':util[_0xd6d9('0x51')]('%s%s',_0x2cc4df,_0x5399d8[_0xd6d9('0x34')]['path']),'json':_0x851e0f,'resolveWithFullResponse':!![],'encoding':_0x1c0de6,'qs':_0x5399d8['query']};if(_0x5399d8[_0xd6d9('0xa0')]){_0x4bd1bb['headers']=_0x5399d8[_0xd6d9('0xa0')];if(_0x4bd1bb[_0xd6d9('0xa0')]['content-length']){delete _0x4bd1bb[_0xd6d9('0xa0')][_0xd6d9('0xa1')];}}if(_0x4bd1bb[_0xd6d9('0xa0')][_0xd6d9('0xa2')]){delete _0x4bd1bb[_0xd6d9('0xa0')]['content-type'];}return rp(_0x4bd1bb);})[_0xd6d9('0x24')](function(_0x25e341){if(_0x25e341){_0x15bf39[_0xd6d9('0xa3')](_0x25e341[_0xd6d9('0xa0')]);logger[_0xd6d9('0x64')](_0x25e341['body']);if(_[_0xd6d9('0xa4')](_0x5399d8[_0xd6d9('0x34')]['path'],_0xd6d9('0x4d'))&&_0x25e341[_0xd6d9('0xa5')]==0x1f4){return _0x15bf39[_0xd6d9('0x1c')](_0x25e341[_0xd6d9('0xa5')]);}else{return _0x15bf39[_0xd6d9('0x1d')](_0x25e341[_0xd6d9('0xa5')])[_0xd6d9('0x2c')](_0x25e341[_0xd6d9('0x8e')]);}}else{return _0x15bf39[_0xd6d9('0x1c')](0xc8);}})[_0xd6d9('0x46')](handleError(_0x15bf39,null));};exports['webhookPost']=function(_0x57b97b,_0x1e76cc,_0x3b0578){return BPromise[_0xd6d9('0x98')]()[_0xd6d9('0x24')](function(){if(!_0x57b97b['query'][_0xd6d9('0x5')]){throw new Error(_0xd6d9('0xa6'));}if(!_0x57b97b[_0xd6d9('0x34')]['port']){throw new Error(_0xd6d9('0x9a'));}var _0x1912b8=_0x57b97b['query']['hostname']?_0x57b97b[_0xd6d9('0x34')][_0xd6d9('0x9b')]+':'+_0x57b97b[_0xd6d9('0x34')][_0xd6d9('0x99')]:_0xd6d9('0x9c')+_0x57b97b[_0xd6d9('0x34')][_0xd6d9('0x99')];var _0x38b019=_0x57b97b[_0xd6d9('0x34')][_0xd6d9('0x9d')]?_0x57b97b[_0xd6d9('0x34')][_0xd6d9('0x9d')]:!![];var _0x59597e=_0x57b97b[_0xd6d9('0x34')][_0xd6d9('0x9e')]?_0x57b97b['query'][_0xd6d9('0x9e')]:null;var _0x7000c1={'method':_0x57b97b['method'],'uri':util['format'](_0xd6d9('0xa7'),_0x1912b8,_0x57b97b[_0xd6d9('0x34')][_0xd6d9('0x5')]),'json':_0x38b019,'resolveWithFullResponse':!![],'encoding':_0x59597e,'body':_0x57b97b[_0xd6d9('0x8e')]};if(_0x57b97b['headers']){_0x7000c1[_0xd6d9('0xa0')]=_0x57b97b[_0xd6d9('0xa0')];if(_0x7000c1[_0xd6d9('0xa0')][_0xd6d9('0xa1')]){delete _0x7000c1['headers'][_0xd6d9('0xa1')];}}if(_0x7000c1[_0xd6d9('0xa0')]['content-type']){delete _0x7000c1[_0xd6d9('0xa0')][_0xd6d9('0xa2')];}return rp(_0x7000c1);})[_0xd6d9('0x24')](function(_0x39cc23){if(_0x39cc23){_0x1e76cc['set'](_0x39cc23[_0xd6d9('0xa0')]);logger[_0xd6d9('0x64')](_0x39cc23['body']);return _0x1e76cc['status'](_0x39cc23[_0xd6d9('0xa5')])['send'](_0x39cc23[_0xd6d9('0x8e')]);}else{return _0x1e76cc['sendStatus'](0xc8);}})[_0xd6d9('0x46')](handleError(_0x1e76cc,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index a13c97c..6da0549 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 _0xb7ac=['emit','hasOwnProperty','events','../../mysqldb','Plugin','setMaxListeners','save','remove'];(function(_0x1746ab,_0x2d903a){var _0x1cc101=function(_0x5dd85d){while(--_0x5dd85d){_0x1746ab['push'](_0x1746ab['shift']());}};_0x1cc101(++_0x2d903a);}(_0xb7ac,0x18a));var _0xcb7a=function(_0x5cbe4e,_0x390e81){_0x5cbe4e=_0x5cbe4e-0x0;var _0x2392bc=_0xb7ac[_0x5cbe4e];return _0x2392bc;};'use strict';var EventEmitter=require(_0xcb7a('0x0'));var Plugin=require(_0xcb7a('0x1'))['db'][_0xcb7a('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xcb7a('0x3')](0x0);var events={'afterCreate':_0xcb7a('0x4'),'afterUpdate':'update','afterDestroy':_0xcb7a('0x5')};function emitEvent(_0x4817ac){return function(_0x41408c,_0xaa5a21,_0x50be72){PluginEvents[_0xcb7a('0x6')](_0x4817ac+':'+_0x41408c['id'],_0x41408c);PluginEvents[_0xcb7a('0x6')](_0x4817ac,_0x41408c);_0x50be72(null);};}for(var e in events){if(events[_0xcb7a('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xc9c3=['Plugin','save','update','remove','hook','exports'];(function(_0x40a1fd,_0x358d91){var _0x1f97ee=function(_0x9ef0db){while(--_0x9ef0db){_0x40a1fd['push'](_0x40a1fd['shift']());}};_0x1f97ee(++_0x358d91);}(_0xc9c3,0x96));var _0x3c9c=function(_0x57f80b,_0x1a43b2){_0x57f80b=_0x57f80b-0x0;var _0x57a2d2=_0xc9c3[_0x57f80b];return _0x57a2d2;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0x3c9c('0x0')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3c9c('0x1'),'afterUpdate':_0x3c9c('0x2'),'afterDestroy':_0x3c9c('0x3')};function emitEvent(_0x2ec103){return function(_0x2b0045,_0xe07e05,_0x143bfe){PluginEvents['emit'](_0x2ec103+':'+_0x2b0045['id'],_0x2b0045);PluginEvents['emit'](_0x2ec103,_0x2b0045);_0x143bfe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x3c9c('0x4')](e,emitEvent(event));}}module[_0x3c9c('0x5')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 7966bd4..9df4c4f 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 _0xb748=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','moment','request-promise'];(function(_0x5341ff,_0x1de6df){var _0x53be58=function(_0x4da0da){while(--_0x4da0da){_0x5341ff['push'](_0x5341ff['shift']());}};_0x53be58(++_0x1de6df);}(_0xb748,0xd7));var _0x8b74=function(_0x5ef058,_0x133f71){_0x5ef058=_0x5ef058-0x0;var _0x824d1e=_0xb748[_0x5ef058];return _0x824d1e;};'use strict';var _=require(_0x8b74('0x0'));var util=require(_0x8b74('0x1'));var logger=require(_0x8b74('0x2'))('api');var moment=require(_0x8b74('0x3'));var BPromise=require('bluebird');var rp=require(_0x8b74('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8b74('0x5'));var attributes=require(_0x8b74('0x6'));module[_0x8b74('0x7')]=function(_0xa407cf,_0x596ed8){return _0xa407cf[_0x8b74('0x8')](_0x8b74('0x9'),attributes,{'tableName':_0x8b74('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36ea=['rimraf','../../config/environment','./plugin.attributes','exports','define','plugins','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x111dde,_0x313c12){var _0x2c47d9=function(_0x7c9e80){while(--_0x7c9e80){_0x111dde['push'](_0x111dde['shift']());}};_0x2c47d9(++_0x313c12);}(_0x36ea,0xc1));var _0xa36e=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0x36ea[_0x2a0183];return _0x158c3a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa36e('0x0'))('api');var moment=require(_0xa36e('0x1'));var BPromise=require(_0xa36e('0x2'));var rp=require(_0xa36e('0x3'));var fs=require('fs');var path=require(_0xa36e('0x4'));var rimraf=require(_0xa36e('0x5'));var config=require(_0xa36e('0x6'));var attributes=require(_0xa36e('0x7'));module[_0xa36e('0x8')]=function(_0x5b51e7,_0x17c9c5){return _0x5b51e7[_0xa36e('0x9')]('Plugin',attributes,{'tableName':_0xa36e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 4469db4..9e800ae 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 _0xe9aa=['catch','Plugin','create','options','CreatePlugin','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./plugin.socket','request','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x547af,_0x17abff){var _0x22f7f4=function(_0x5f0384){while(--_0x5f0384){_0x547af['push'](_0x547af['shift']());}};_0x22f7f4(++_0x17abff);}(_0xe9aa,0x1b7));var _0xae9a=function(_0x5c1701,_0x11d4d4){_0x5c1701=_0x5c1701-0x0;var _0x40c3e3=_0xe9aa[_0x5c1701];return _0x40c3e3;};'use strict';var _=require(_0xae9a('0x0'));var util=require(_0xae9a('0x1'));var moment=require(_0xae9a('0x2'));var BPromise=require(_0xae9a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae9a('0x4'));var db=require(_0xae9a('0x5'))['db'];var utils=require(_0xae9a('0x6'));var logger=require(_0xae9a('0x7'))('rpc');var config=require(_0xae9a('0x8'));var jayson=require(_0xae9a('0x9'));var client=jayson[_0xae9a('0xa')]['http']({'port':0x232a});config['redis']=_[_0xae9a('0xb')](config['redis'],{'host':_0xae9a('0xc'),'port':0x18eb});var socket=require(_0xae9a('0xd'))(new Redis(config[_0xae9a('0xe')]));require(_0xae9a('0xf'))['register'](socket);function respondWithRpcPromise(_0x97e996,_0x150ac7,_0x527426){return new BPromise(function(_0x59c14e,_0x1cf701){return client[_0xae9a('0x10')](_0x97e996,_0x527426)['then'](function(_0x148a84){logger['info'](_0xae9a('0x11'),_0x150ac7,_0xae9a('0x12'));logger[_0xae9a('0x13')](_0xae9a('0x14'),_0x150ac7,'request\x20sent',JSON['stringify'](_0x148a84));if(_0x148a84[_0xae9a('0x15')]){if(_0x148a84[_0xae9a('0x15')][_0xae9a('0x16')]===0x1f4){logger[_0xae9a('0x15')]('Plugin,\x20%s,\x20%s',_0x150ac7,_0x148a84[_0xae9a('0x15')][_0xae9a('0x17')]);return _0x1cf701(_0x148a84[_0xae9a('0x15')][_0xae9a('0x17')]);}logger[_0xae9a('0x15')]('Plugin,\x20%s,\x20%s',_0x150ac7,_0x148a84[_0xae9a('0x15')][_0xae9a('0x17')]);return _0x59c14e(_0x148a84['error'][_0xae9a('0x17')]);}else{logger[_0xae9a('0x18')](_0xae9a('0x11'),_0x150ac7,_0xae9a('0x12'));_0x59c14e(_0x148a84[_0xae9a('0x19')][_0xae9a('0x17')]);}})[_0xae9a('0x1a')](function(_0x45abdb){logger[_0xae9a('0x15')](_0xae9a('0x11'),_0x150ac7,_0x45abdb);_0x1cf701(_0x45abdb);});});}exports['CreatePlugin']=function(_0x59bba1){var _0x3e1253=this;return new Promise(function(_0x18f206,_0x4f2a98){return db[_0xae9a('0x1b')][_0xae9a('0x1c')](_0x59bba1['body'],{'raw':_0x59bba1[_0xae9a('0x1d')]?_0x59bba1[_0xae9a('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x47c58d){logger[_0xae9a('0x18')](_0xae9a('0x1e'),_0x59bba1);logger[_0xae9a('0x13')](_0xae9a('0x1e'),_0x59bba1,JSON['stringify'](_0x47c58d));_0x18f206(_0x47c58d);})[_0xae9a('0x1a')](function(_0x4c5a12){logger['error'](_0xae9a('0x1e'),_0x4c5a12[_0xae9a('0x17')],_0x59bba1);_0x4f2a98(_0x3e1253['error'](0x1f4,_0x4c5a12[_0xae9a('0x17')]));});});}; \ No newline at end of file +var _0x8987=['stringify','error','message','result','CreatePlugin','Plugin','create','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s'];(function(_0x2f94d3,_0x57ca4a){var _0x468b67=function(_0x13de04){while(--_0x13de04){_0x2f94d3['push'](_0x2f94d3['shift']());}};_0x468b67(++_0x57ca4a);}(_0x8987,0x13d));var _0x7898=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8987[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x7898('0x0'));var moment=require(_0x7898('0x1'));var BPromise=require(_0x7898('0x2'));var rs=require(_0x7898('0x3'));var fs=require('fs');var Redis=require(_0x7898('0x4'));var db=require(_0x7898('0x5'))['db'];var utils=require(_0x7898('0x6'));var logger=require(_0x7898('0x7'))(_0x7898('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7898('0x9')][_0x7898('0xa')]({'port':0x232a});config['redis']=_[_0x7898('0xb')](config[_0x7898('0xc')],{'host':_0x7898('0xd'),'port':0x18eb});var socket=require(_0x7898('0xe'))(new Redis(config['redis']));require('./plugin.socket')[_0x7898('0xf')](socket);function respondWithRpcPromise(_0x323136,_0x2d550b,_0x4d75dd){return new BPromise(function(_0x1e3aab,_0x58d482){return client[_0x7898('0x10')](_0x323136,_0x4d75dd)[_0x7898('0x11')](function(_0x1df05){logger[_0x7898('0x12')](_0x7898('0x13'),_0x2d550b,_0x7898('0x14'));logger[_0x7898('0x15')](_0x7898('0x16'),_0x2d550b,_0x7898('0x14'),JSON[_0x7898('0x17')](_0x1df05));if(_0x1df05['error']){if(_0x1df05['error']['code']===0x1f4){logger['error'](_0x7898('0x13'),_0x2d550b,_0x1df05[_0x7898('0x18')][_0x7898('0x19')]);return _0x58d482(_0x1df05[_0x7898('0x18')][_0x7898('0x19')]);}logger[_0x7898('0x18')](_0x7898('0x13'),_0x2d550b,_0x1df05[_0x7898('0x18')][_0x7898('0x19')]);return _0x1e3aab(_0x1df05[_0x7898('0x18')]['message']);}else{logger[_0x7898('0x12')](_0x7898('0x13'),_0x2d550b,_0x7898('0x14'));_0x1e3aab(_0x1df05[_0x7898('0x1a')][_0x7898('0x19')]);}})['catch'](function(_0x507e41){logger[_0x7898('0x18')](_0x7898('0x13'),_0x2d550b,_0x507e41);_0x58d482(_0x507e41);});});}exports[_0x7898('0x1b')]=function(_0x5b20ce){var _0x5e61d8=this;return new Promise(function(_0x1a6101,_0x3041a9){return db[_0x7898('0x1c')][_0x7898('0x1d')](_0x5b20ce[_0x7898('0x1e')],{'raw':_0x5b20ce['options']?_0x5b20ce[_0x7898('0x1f')][_0x7898('0x20')]===undefined?!![]:![]:!![]})[_0x7898('0x11')](function(_0x3faa1f){logger[_0x7898('0x12')](_0x7898('0x1b'),_0x5b20ce);logger[_0x7898('0x15')](_0x7898('0x1b'),_0x5b20ce,JSON[_0x7898('0x17')](_0x3faa1f));_0x1a6101(_0x3faa1f);})[_0x7898('0x21')](function(_0x238340){logger['error'](_0x7898('0x1b'),_0x238340['message'],_0x5b20ce);_0x3041a9(_0x5e61d8[_0x7898('0x18')](0x1f4,_0x238340[_0x7898('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index f42c5b7..abf8c5c 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 _0x5d54=['./plugin.events','save','emit','removeListener','length','plugin:'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x5d54,0x8a));var _0x45d5=function(_0x55b588,_0x46a403){_0x55b588=_0x55b588-0x0;var _0x199918=_0x5d54[_0x55b588];return _0x199918;};'use strict';var PluginEvents=require(_0x45d5('0x0'));var events=[_0x45d5('0x1'),'remove','update'];function createListener(_0x15b62f,_0x5c0063){return function(_0x1b3003){_0x5c0063[_0x45d5('0x2')](_0x15b62f,_0x1b3003);};}function removeListener(_0x1460b5,_0x4452c2){return function(){PluginEvents[_0x45d5('0x3')](_0x1460b5,_0x4452c2);};}exports['register']=function(_0x5870c0){for(var _0x49f2c4=0x0,_0x1d1fe3=events[_0x45d5('0x4')];_0x49f2c4<_0x1d1fe3;_0x49f2c4++){var _0x578fa4=events[_0x49f2c4];var _0xbc104d=createListener(_0x45d5('0x5')+_0x578fa4,_0x5870c0);PluginEvents['on'](_0x578fa4,_0xbc104d);}}; \ No newline at end of file +var _0x3fed=['removeListener','register','length','plugin:','./plugin.events','update','emit'];(function(_0x367054,_0x3ae59c){var _0x54fbd8=function(_0x1b4ac1){while(--_0x1b4ac1){_0x367054['push'](_0x367054['shift']());}};_0x54fbd8(++_0x3ae59c);}(_0x3fed,0x9e));var _0xd3fe=function(_0x4959f7,_0x462933){_0x4959f7=_0x4959f7-0x0;var _0xd57311=_0x3fed[_0x4959f7];return _0xd57311;};'use strict';var PluginEvents=require(_0xd3fe('0x0'));var events=['save','remove',_0xd3fe('0x1')];function createListener(_0x2eb770,_0x2b806a){return function(_0x3c5e38){_0x2b806a[_0xd3fe('0x2')](_0x2eb770,_0x3c5e38);};}function removeListener(_0x1f08ee,_0x1f82b1){return function(){PluginEvents[_0xd3fe('0x3')](_0x1f08ee,_0x1f82b1);};}exports[_0xd3fe('0x4')]=function(_0x40df81){for(var _0x1c9c20=0x0,_0x2e7b8f=events[_0xd3fe('0x5')];_0x1c9c20<_0x2e7b8f;_0x1c9c20++){var _0x125a32=events[_0x1c9c20];var _0x12c335=createListener(_0xd3fe('0x6')+_0x125a32,_0x40df81);PluginEvents['on'](_0x125a32,_0x12c335);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 43af214..d551006 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(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x8dc03,_0x26c90c){var _0x430518=function(_0xcbf9a4){while(--_0xcbf9a4){_0x8dc03['push'](_0x8dc03['shift']());}};_0x430518(++_0x26c90c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 684d06c..36537fe 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 _0xbb53=['send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','status','json','error','stack','name','npm\x20install','info','index','then','reject','motion2','length','catch','show','params','body','script','join','../../files/plugins','cwd','chdir','dirname','dump'];(function(_0x554d5a,_0x56572b){var _0x58ded4=function(_0x4acf94){while(--_0x4acf94){_0x554d5a['push'](_0x554d5a['shift']());}};_0x58ded4(++_0x56572b);}(_0xbb53,0x121));var _0x3bb5=function(_0x277a1f,_0x43b9cc){_0x277a1f=_0x277a1f-0x0;var _0x521edb=_0xbb53[_0x277a1f];return _0x521edb;};'use strict';var _=require(_0x3bb5('0x0'));var pm2=require(_0x3bb5('0x1'));var logger=require(_0x3bb5('0x2'))(_0x3bb5('0x3'));var path=require(_0x3bb5('0x4'));var exec=require(_0x3bb5('0x5'))[_0x3bb5('0x6')];var BPromise=require(_0x3bb5('0x7'));function handleEntityNotFound(_0x83e44b,_0x450d9e){return function(_0x55fdaf){if(!_0x55fdaf){_0x83e44b['sendStatus'](0x194);;}return _0x55fdaf;};}function respondWithResult(_0x23f11e,_0x2460b0){_0x2460b0=_0x2460b0||0xc8;return function(_0x28aa7d){if(_0x28aa7d){return _0x23f11e[_0x3bb5('0x8')](_0x2460b0)[_0x3bb5('0x9')](_0x28aa7d);}return null;};}function handleError(_0x480f9c,_0x5a4ae3){_0x5a4ae3=_0x5a4ae3||0x1f4;return function(_0x4cfdd7){logger[_0x3bb5('0xa')](_0x4cfdd7[_0x3bb5('0xb')]);if(_0x4cfdd7[_0x3bb5('0xc')]){delete _0x4cfdd7['name'];}_0x480f9c[_0x3bb5('0x8')](_0x5a4ae3)['send'](_0x4cfdd7);};}function execChildProcess(){return new BPromise(function(_0x53af18,_0xd8d9bf){exec(_0x3bb5('0xd'),function(_0x5cfc6b,_0xe00ace,_0x511e41){logger[_0x3bb5('0xe')](_0xe00ace);logger['info'](_0x511e41);if(_0x5cfc6b){logger['error'](_0x5cfc6b);return _0xd8d9bf(_0x5cfc6b);}return _0x53af18(_0xe00ace);});});}exports[_0x3bb5('0xf')]=function(_0x35a99b,_0x1e46a5){return pm2['list']()[_0x3bb5('0x10')](function(_0x12e409){if(_0x12e409){var _0x519123=_[_0x3bb5('0x11')](_0x12e409,function(_0x15c369){return _0x15c369['name']==='express'||_0x15c369['name']===_0x3bb5('0x12');});return{'rows':_0x519123,'count':_0x519123[_0x3bb5('0x13')]};}return null;})['then'](respondWithResult(_0x1e46a5,null))[_0x3bb5('0x14')](handleError(_0x1e46a5,null));};exports[_0x3bb5('0x15')]=function(_0x4656c4,_0x262059){return pm2['describe'](_0x4656c4[_0x3bb5('0x16')]['id'])[_0x3bb5('0x10')](respondWithResult(_0x262059,null))[_0x3bb5('0x10')](handleEntityNotFound(_0x262059,null))['catch'](handleError(_0x262059,null));};exports['create']=function(_0x19b177,_0x478021){if(_0x19b177[_0x3bb5('0x17')]['name']&&_0x19b177[_0x3bb5('0x17')][_0x3bb5('0x18')]){var _0x3f94ad=path[_0x3bb5('0x19')](__dirname,_0x3bb5('0x1a'),_0x19b177[_0x3bb5('0x17')]['script']);var _0x37444e=process[_0x3bb5('0x1b')]();process[_0x3bb5('0x1c')](path[_0x3bb5('0x1d')](_0x3f94ad));return execChildProcess()[_0x3bb5('0x10')](function(_0xfb9e8){process[_0x3bb5('0x1c')](_0x37444e);return pm2['start']({'name':_0x19b177[_0x3bb5('0x17')][_0x3bb5('0xc')],'script':_0x3f94ad});})['then'](function(_0x4fc81b){pm2[_0x3bb5('0x1e')]();return _0x4fc81b[0x0];})[_0x3bb5('0x10')](respondWithResult(_0x478021,0xc9))['catch'](handleError(_0x478021,null));}else{return _0x478021['status'](0x1f4)[_0x3bb5('0x1f')]({'message':_0x3bb5('0x20')});}};exports[_0x3bb5('0x21')]=function(_0xc1c149,_0x57abf4){if(_0xc1c149['body']['id']){delete _0xc1c149[_0x3bb5('0x17')]['id'];}var _0x4e8c65={'online':_0x3bb5('0x22'),'stopped':_0x3bb5('0x23')};if(_0x4e8c65[_0x3bb5('0x24')](_0xc1c149['body']['status'])){return pm2[_0x4e8c65[_0xc1c149[_0x3bb5('0x17')][_0x3bb5('0x8')]]](_0xc1c149[_0x3bb5('0x16')]['id'])[_0x3bb5('0x10')](respondWithResult(_0x57abf4,0xc8))[_0x3bb5('0x14')](handleError(_0x57abf4,null));}else{return _0x57abf4[_0x3bb5('0x8')](0x1f4)[_0x3bb5('0x1f')]({'message':'Unknown\x20status'});}};exports[_0x3bb5('0x25')]=function(_0xa643c9,_0x5ebd0a){if(_0xa643c9[_0x3bb5('0x17')]['id']){delete _0xa643c9[_0x3bb5('0x17')]['id'];}if(_0xa643c9[_0x3bb5('0x16')]['id']){return pm2[_0x3bb5('0x26')](_0xa643c9['params']['id'])[_0x3bb5('0x10')](function(_0x25ba4c){pm2['dump']();return _0x25ba4c[0x0];})[_0x3bb5('0x10')](respondWithResult(_0x5ebd0a,null))[_0x3bb5('0x14')](handleError(_0x5ebd0a,null));}else{return _0x5ebd0a[_0x3bb5('0x8')](0x1f4)[_0x3bb5('0x1f')]({'message':_0x3bb5('0x27')});}}; \ No newline at end of file +var _0xbfcc=['exec','sendStatus','json','stack','name','status','send','npm\x20install','info','error','index','list','then','reject','express','motion2','catch','show','params','create','body','script','../../files/plugins','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','api','path','child_process'];(function(_0x5b740b,_0x381833){var _0x6f8f4e=function(_0x86d068){while(--_0x86d068){_0x5b740b['push'](_0x5b740b['shift']());}};_0x6f8f4e(++_0x381833);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xbfcc[_0x373dee];return _0x46798f;};'use strict';var _=require(_0xcbfc('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xcbfc('0x1'));var path=require(_0xcbfc('0x2'));var exec=require(_0xcbfc('0x3'))[_0xcbfc('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x59b1de,_0x54f81b){return function(_0x4b8361){if(!_0x4b8361){_0x59b1de[_0xcbfc('0x5')](0x194);;}return _0x4b8361;};}function respondWithResult(_0x2dbb05,_0x537813){_0x537813=_0x537813||0xc8;return function(_0x1b3917){if(_0x1b3917){return _0x2dbb05['status'](_0x537813)[_0xcbfc('0x6')](_0x1b3917);}return null;};}function handleError(_0x1f8b71,_0x1b1377){_0x1b1377=_0x1b1377||0x1f4;return function(_0xa1c83b){logger['error'](_0xa1c83b[_0xcbfc('0x7')]);if(_0xa1c83b[_0xcbfc('0x8')]){delete _0xa1c83b[_0xcbfc('0x8')];}_0x1f8b71[_0xcbfc('0x9')](_0x1b1377)[_0xcbfc('0xa')](_0xa1c83b);};}function execChildProcess(){return new BPromise(function(_0x3498c7,_0x4b34aa){exec(_0xcbfc('0xb'),function(_0x376a4c,_0x1e0d79,_0xbbb176){logger[_0xcbfc('0xc')](_0x1e0d79);logger['info'](_0xbbb176);if(_0x376a4c){logger[_0xcbfc('0xd')](_0x376a4c);return _0x4b34aa(_0x376a4c);}return _0x3498c7(_0x1e0d79);});});}exports[_0xcbfc('0xe')]=function(_0x80d08d,_0x5ba249){return pm2[_0xcbfc('0xf')]()[_0xcbfc('0x10')](function(_0x2f2bdd){if(_0x2f2bdd){var _0x45a5cc=_[_0xcbfc('0x11')](_0x2f2bdd,function(_0x53a7ea){return _0x53a7ea[_0xcbfc('0x8')]===_0xcbfc('0x12')||_0x53a7ea[_0xcbfc('0x8')]===_0xcbfc('0x13');});return{'rows':_0x45a5cc,'count':_0x45a5cc['length']};}return null;})['then'](respondWithResult(_0x5ba249,null))[_0xcbfc('0x14')](handleError(_0x5ba249,null));};exports[_0xcbfc('0x15')]=function(_0xa65368,_0x4d6946){return pm2['describe'](_0xa65368[_0xcbfc('0x16')]['id'])[_0xcbfc('0x10')](respondWithResult(_0x4d6946,null))[_0xcbfc('0x10')](handleEntityNotFound(_0x4d6946,null))['catch'](handleError(_0x4d6946,null));};exports[_0xcbfc('0x17')]=function(_0x552777,_0x28f7fb){if(_0x552777[_0xcbfc('0x18')][_0xcbfc('0x8')]&&_0x552777[_0xcbfc('0x18')][_0xcbfc('0x19')]){var _0x2653b1=path['join'](__dirname,_0xcbfc('0x1a'),_0x552777[_0xcbfc('0x18')]['script']);var _0x1da958=process['cwd']();process['chdir'](path['dirname'](_0x2653b1));return execChildProcess()[_0xcbfc('0x10')](function(_0x4a0fcb){process['chdir'](_0x1da958);return pm2[_0xcbfc('0x1b')]({'name':_0x552777[_0xcbfc('0x18')][_0xcbfc('0x8')],'script':_0x2653b1});})[_0xcbfc('0x10')](function(_0x49f5bf){pm2[_0xcbfc('0x1c')]();return _0x49f5bf[0x0];})['then'](respondWithResult(_0x28f7fb,0xc9))[_0xcbfc('0x14')](handleError(_0x28f7fb,null));}else{return _0x28f7fb[_0xcbfc('0x9')](0x1f4)['send']({'message':_0xcbfc('0x1d')});}};exports[_0xcbfc('0x1e')]=function(_0x4ab48e,_0x1b2c01){if(_0x4ab48e[_0xcbfc('0x18')]['id']){delete _0x4ab48e[_0xcbfc('0x18')]['id'];}var _0x41f3b8={'online':'restart','stopped':_0xcbfc('0x1f')};if(_0x41f3b8[_0xcbfc('0x20')](_0x4ab48e['body'][_0xcbfc('0x9')])){return pm2[_0x41f3b8[_0x4ab48e[_0xcbfc('0x18')][_0xcbfc('0x9')]]](_0x4ab48e[_0xcbfc('0x16')]['id'])[_0xcbfc('0x10')](respondWithResult(_0x1b2c01,0xc8))[_0xcbfc('0x14')](handleError(_0x1b2c01,null));}else{return _0x1b2c01[_0xcbfc('0x9')](0x1f4)['send']({'message':_0xcbfc('0x21')});}};exports[_0xcbfc('0x22')]=function(_0x3f9d20,_0x20a378){if(_0x3f9d20['body']['id']){delete _0x3f9d20[_0xcbfc('0x18')]['id'];}if(_0x3f9d20[_0xcbfc('0x16')]['id']){return pm2[_0xcbfc('0x23')](_0x3f9d20[_0xcbfc('0x16')]['id'])[_0xcbfc('0x10')](function(_0x34baa6){pm2[_0xcbfc('0x1c')]();return _0x34baa6[0x0];})['then'](respondWithResult(_0x20a378,null))[_0xcbfc('0x14')](handleError(_0x20a378,null));}else{return _0x20a378[_0xcbfc('0x9')](0x1f4)['send']({'message':_0xcbfc('0x24')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index adbb962..4bbfe40 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 _0x02e0=['get','/agents','isAuthenticated','getAgents','/queues','getQueues','exports','express','../../components/auth/service','./realtime.controller'];(function(_0x59bd84,_0x4d93e8){var _0x1c73ca=function(_0x49b658){while(--_0x49b658){_0x59bd84['push'](_0x59bd84['shift']());}};_0x1c73ca(++_0x4d93e8);}(_0x02e0,0x11f));var _0x002e=function(_0x38edf,_0x5bb034){_0x38edf=_0x38edf-0x0;var _0x52364a=_0x02e0[_0x38edf];return _0x52364a;};'use strict';var express=require(_0x002e('0x0'));var router=express['Router']();var auth=require(_0x002e('0x1'));var controller=require(_0x002e('0x2'));router[_0x002e('0x3')](_0x002e('0x4'),auth[_0x002e('0x5')](),controller[_0x002e('0x6')]);router[_0x002e('0x3')](_0x002e('0x7'),auth[_0x002e('0x5')](),controller[_0x002e('0x8')]);module[_0x002e('0x9')]=router; \ No newline at end of file +var _0x3be7=['isAuthenticated','getAgents','/queues','getQueues','exports','./realtime.controller','get','/agents'];(function(_0x5b6ec8,_0x2943fd){var _0x379161=function(_0x4e9091){while(--_0x4e9091){_0x5b6ec8['push'](_0x5b6ec8['shift']());}};_0x379161(++_0x2943fd);}(_0x3be7,0x6d));var _0x73be=function(_0x40266b,_0x11a609){_0x40266b=_0x40266b-0x0;var _0x1befe8=_0x3be7[_0x40266b];return _0x1befe8;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x73be('0x0'));router[_0x73be('0x1')](_0x73be('0x2'),auth[_0x73be('0x3')](),controller[_0x73be('0x4')]);router['get'](_0x73be('0x5'),auth[_0x73be('0x3')](),controller[_0x73be('0x6')]);module[_0x73be('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index f966e53..bbd962d 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 _0x01d9=['erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','paused','loggedInDb','busy','pick','filter','queue','length','some','connectedlinenum','internal','toString','find','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','Pause','startCase','idle','unknown','unavailable','ringing','isNil','chatPause','openchannelPause','smsPause','voicePause','whatsappPause','every','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','mailPause','faxPause','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','type','key','query','role','agent','getOptions','raw','user','userProfileId','nolimit','sort','UserProfile','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','chat','openchannel','whatsapp','toLowerCase','Invalid\x20channel','channel','rawAttributes','outbound','all','util','lodash','jayson/promise','../../components/parsers/qs','api','../../mysqldb','client','http','offset','undefined','limit','count','set','Content-Range','json','error','stack','name','status','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','voice','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','loggedIn','available','waiting','talking','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond'];(function(_0x17266e,_0x5d273d){var _0x8eeaf4=function(_0xda6721){while(--_0xda6721){_0x17266e['push'](_0x17266e['shift']());}};_0x8eeaf4(++_0x5d273d);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x901d('0x0'));var _=require(_0x901d('0x1'));var jayson=require(_0x901d('0x2'));var qs=require(_0x901d('0x3'));var logger=require('../../config/logger')(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var amiClient=jayson[_0x901d('0x6')][_0x901d('0x7')]({'port':0x232a});var routingClient=jayson[_0x901d('0x6')][_0x901d('0x7')]({'port':0x232c});function respondWithFilteredResult(_0xb96b86,_0x4e7842){return function(_0x1e5d7d){if(_0x1e5d7d){var _0x6c9ac8=typeof _0x4e7842[_0x901d('0x8')]===_0x901d('0x9')&&typeof _0x4e7842[_0x901d('0xa')]===_0x901d('0x9');var _0x202568=_0x1e5d7d[_0x901d('0xb')];var _0x15076e=_0x6c9ac8?0x0:_0x4e7842[_0x901d('0x8')];var _0x440fb0=_0x6c9ac8?_0x1e5d7d[_0x901d('0xb')]:_0x4e7842[_0x901d('0x8')]+_0x4e7842['limit'];var _0x439f17;if(_0x440fb0>=_0x202568){_0x440fb0=_0x202568;_0x439f17=0xc8;}else{_0x439f17=0xce;}_0xb96b86['status'](_0x439f17);return _0xb96b86[_0x901d('0xc')](_0x901d('0xd'),_0x15076e+'-'+_0x440fb0+'/'+_0x202568)[_0x901d('0xe')](_0x1e5d7d);}return null;};}function handleError(_0x42ce79,_0x15ebaf){_0x15ebaf=_0x15ebaf||0x1f4;return function(_0x5d2345){logger[_0x901d('0xf')](_0x5d2345[_0x901d('0x10')]);if(_0x5d2345[_0x901d('0x11')]){delete _0x5d2345[_0x901d('0x11')];}_0x42ce79[_0x901d('0x12')](_0x15ebaf)[_0x901d('0x13')](_0x5d2345);};}function getRealtimeAgents(){return new Promise(function(_0x530a2b,_0x991ee2){return amiClient[_0x901d('0x14')](_0x901d('0x15'),{})[_0x901d('0x16')](function(_0x1aba97){if(_0x1aba97[_0x901d('0xf')])throw new Error(_0x901d('0x17'));var _0x407215=_0x1aba97[_0x901d('0x18')];return routingClient[_0x901d('0x14')](_0x901d('0x15'),{})[_0x901d('0x16')](function(_0x285353){if(_0x285353[_0x901d('0xf')])throw new Error(_0x901d('0x19'));var _0x414171=_0x285353[_0x901d('0x18')];return _0x530a2b(_[_0x901d('0x1a')]({},_0x407215,_0x414171));});})['catch'](function(_0x430634){_0x991ee2(_0x430634);});});}function getRealtimeQueues(_0x2f32f8,_0x4d27db){return new Promise(function(_0x5bdff4,_0x496a06){var _0x53f8ae=_0x4d27db===_0x901d('0x1b')?amiClient:routingClient;return _0x53f8ae[_0x901d('0x14')](_['startCase'](_0x4d27db)+_0x901d('0x1c'),_0x2f32f8)[_0x901d('0x16')](function(_0x488e24){if(_0x488e24[_0x901d('0xf')])throw new Error(util[_0x901d('0x1d')](_0x901d('0x1e'),_0x4d27db));return _0x5bdff4(_0x488e24[_0x901d('0x18')]);})[_0x901d('0x1f')](function(_0x1818d3){_0x496a06(_0x1818d3);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x46e5c6,_0x45b6a8){return amiClient['request'](_0x901d('0x20'),{})[_0x901d('0x16')](function(_0xbc89a5){if(_0xbc89a5[_0x901d('0xf')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x46e5c6(_0xbc89a5[_0x901d('0x18')]);})[_0x901d('0x1f')](function(_0x27f4ca){_0x45b6a8(_0x27f4ca);});});}function initializeQueues(_0x3cbe43,_0x133bff,_0x56e4ec,_0x21fbb9){var _0xc52d0f=[_0x901d('0x21'),_0x901d('0x22'),_0x901d('0x23'),_0x901d('0x24'),'paused'];if(_0x56e4ec===_0x901d('0x1b')&&_0x21fbb9==='outbound'){_0xc52d0f[_0x901d('0x25')](_0x901d('0x26'),_0x901d('0x27'),_0x901d('0x28'),_0x901d('0x29'),_0x901d('0x2a'),_0x901d('0x2b'),_0x901d('0x2c'),_0x901d('0x2d'),_0x901d('0x2e'),_0x901d('0x2f'),_0x901d('0x30'),_0x901d('0x31'),_0x901d('0x32'),_0x901d('0x33'),'dialPredictiveIntervalMinThreshold',_0x901d('0x34'),_0x901d('0x35'),_0x901d('0x36'),'predictiveIntervalDroppedCallsTimeout',_0x901d('0x37'),_0x901d('0x38'),_0x901d('0x39'));}return _0x3cbe43[_0x901d('0x3a')](function(_0x444bff){var _0x3962c2=_0x444bff[_0x901d('0x3b')]({'plain':!![]});_0x3962c2[_0x901d('0x3c')]=[];_0x3962c2[_0x901d('0x3d')]=0x0;_0x3962c2[_0x901d('0x3e')]=0x0;_0x3962c2['loggedIn']=0x0;_0x3962c2['available']=0x0;_0x3962c2[_0x901d('0x23')]=0x0;if(_0x56e4ec==='voice'){_0x3962c2[_0x901d('0x24')]=0x0;_0x3962c2[_0x901d('0x3f')]=0x0;if(_0x21fbb9==='outbound'){_0x3962c2[_0x901d('0x26')]=0x0;_0x3962c2[_0x901d('0x27')]=0x0;}}var _0x2f5e22=_['find'](_0x133bff,['id',_0x3962c2['id']]);if(_0x2f5e22)_[_0x901d('0x1a')](_0x3962c2,_[_0x901d('0x40')](_0x2f5e22,_0xc52d0f));return _0x3962c2;});}function updateAgentVoiceStatus(_0x1a1f9c,_0x13f5d1,_0x37bd5b){var _0x32aa29=_[_0x901d('0x41')](_0x37bd5b,[_0x901d('0x42'),_0x13f5d1[_0x901d('0x11')]]);if(_0x32aa29[_0x901d('0x43')]===0x0)return _0x1a1f9c[_0x901d('0x3f')]=!![];if(_[_0x901d('0x44')](_0x32aa29,[_0x901d('0x45'),_0x1a1f9c[_0x901d('0x46')][_0x901d('0x47')]()]))return _0x1a1f9c[_0x901d('0x24')]=!![];if(!_0x1a1f9c['talking'])return _0x1a1f9c[_0x901d('0x3f')]=!![];}function getVoiceQueueAgents(_0x423cab,_0x5abca2,_0x47fcb5,_0x28725d){var _0x5adf16=_[_0x901d('0x48')](_0x5abca2,['id',_0x423cab['id']]);if(!_0x5adf16)return _0x423cab;return _0x5adf16[_0x901d('0x49')]({'raw':!![]})[_0x901d('0x16')](function(_0x2c6cd9){for(var _0x4ec53f=0x0;_0x4ec53f<_0x2c6cd9[_0x901d('0x43')];_0x4ec53f++){var _0x5df4cb=_['find'](_0x47fcb5,['id',_0x2c6cd9[_0x4ec53f]['UserId']]);if(!_0x5df4cb){_0x5df4cb={'id':_0x2c6cd9[_0x4ec53f]['UserId'],'name':_0x2c6cd9[_0x4ec53f][_0x901d('0x4a')],'accountcode':'','online':![]};}var _0x26f2fe={'id':_0x5df4cb['id'],'name':_0x5df4cb['name'],'internal':_0x5df4cb[_0x901d('0x4b')],'online':Boolean(_0x5df4cb[_0x901d('0x4c')]),'paused':Boolean(_0x2c6cd9[_0x4ec53f]['paused'])};if(_0x5df4cb[_0x901d('0x4d')]===_0x901d('0x24'))updateAgentVoiceStatus(_0x26f2fe,_0x423cab,_0x28725d);if(_0x26f2fe[_0x901d('0x4c')])_0x423cab[_0x901d('0x3e')]++;if(_0x26f2fe['busy'])_0x423cab['busy']++;if(_0x26f2fe[_0x901d('0x3d')]&&!_0x26f2fe[_0x901d('0x3f')]&&!_0x26f2fe[_0x901d('0x24')])_0x423cab[_0x901d('0x3d')]++;_0x423cab[_0x901d('0x3c')][_0x901d('0x25')](_0x26f2fe);}return _0x423cab;});}function getQueueAgents(_0x88bb50,_0x904a94,_0x431204){var _0x2b23bc=_0x901d('0x4e')+_['startCase'](_0x431204)+_0x901d('0x4f');var _0x4d2b1c=_0x431204+_0x901d('0x50');return db[_0x2b23bc]['findAll']({'where':{[_[_0x901d('0x51')](_0x431204)+'QueueId']:_0x88bb50['id']},'raw':!![]})[_0x901d('0x16')](function(_0x12ac04){for(var _0x2f63e8=0x0;_0x2f63e8<_0x12ac04[_0x901d('0x43')];_0x2f63e8++){var _0x2fc1d2=_[_0x901d('0x48')](_0x904a94,['id',_0x12ac04[_0x2f63e8][_0x901d('0x4a')]]);if(!_0x2fc1d2){_0x2fc1d2={'id':_0x12ac04[_0x2f63e8][_0x901d('0x4a')],'name':_0x12ac04[_0x2f63e8][_0x901d('0x4a')],'online':![],['pauseField']:![]};}var _0x430beb={'id':_0x2fc1d2['id'],'name':_0x2fc1d2[_0x901d('0x11')],'online':Boolean(_0x2fc1d2['online']),'paused':Boolean(_0x2fc1d2[_0x4d2b1c])};if(_0x430beb[_0x901d('0x4c')])_0x88bb50[_0x901d('0x3e')]++;_0x88bb50[_0x901d('0x3c')][_0x901d('0x25')](_0x430beb);}return _0x88bb50;});}function isIdle(_0x3b75a3){return _0x3b75a3===_0x901d('0x52')||_0x3b75a3===_0x901d('0x53')||_0x3b75a3===_0x901d('0x54')||_0x3b75a3===_0x901d('0x55')||_[_0x901d('0x56')](_0x3b75a3);}function isAgentPaused(_0x3e01fd,_0x107017){var _0x2cd965=[_0x3e01fd[_0x901d('0x57')],_0x3e01fd['faxPause'],_0x3e01fd['mailPause'],_0x3e01fd[_0x901d('0x58')],_0x3e01fd[_0x901d('0x59')],_0x3e01fd[_0x901d('0x5a')],_0x3e01fd[_0x901d('0x5b')]];if(!_0x107017)return _[_0x901d('0x5c')](_0x2cd965);var _0x5cbc90=_['filter'](_0x2cd965);return _0x5cbc90[_0x901d('0x43')]>0x0&&_0x5cbc90[_0x901d('0x43')]<_0x2cd965['length']?!![]:![];}function isAgentIdle(_0x23673d){if(_0x23673d[_0x901d('0x4d')]!=='idle'&&_0x23673d[_0x901d('0x5a')]){_0x23673d['voiceStatus']=_0x901d('0x5d');return![];}return _[_0x901d('0x5c')]([_0x23673d[_0x901d('0x5e')],_0x23673d[_0x901d('0x5f')],_0x23673d['mailStatus'],_0x23673d[_0x901d('0x60')],_0x23673d[_0x901d('0x61')],_0x23673d[_0x901d('0x4d')],_0x23673d[_0x901d('0x62')]],isIdle);}function getAgentStatus(_0x10c51c){var _0x11953e=_0x901d('0x53');if(isAgentPaused(_0x10c51c))_0x11953e=_0x901d('0x5d');else if(isAgentPaused(_0x10c51c,!![]))_0x11953e=_0x901d('0x63');else if(isAgentIdle(_0x10c51c))_0x11953e=_0x901d('0x52');else _0x11953e='busy';return _0x11953e;}exports[_0x901d('0x64')]=function(_0x4afe28,_0xd7fbb3){var _0x26e6a2={'count':0x0,'rows':[]},_0xaa7394={},_0x2aa9b4,_0x3e3487,_0x21f3bd=[_0x901d('0x65'),'online',_0x901d('0x66'),_0x901d('0x67'),_0x901d('0x68'),'lastPauseAt',_0x901d('0x46'),'address',_0x901d('0x57'),_0x901d('0x58'),_0x901d('0x69'),'smsPause',_0x901d('0x5b'),_0x901d('0x6a'),_0x901d('0x5a'),_0x901d('0x6b'),_0x901d('0x6c'),_0x901d('0x6d'),'smsCapacity',_0x901d('0x6e'),_0x901d('0x6f'),_0x901d('0x70'),_0x901d('0x71'),_0x901d('0x72'),_0x901d('0x73'),'whatsappCurrentCapacity',_0x901d('0x74'),'chatStatus','openchannelStatus','mailStatus','smsStatus',_0x901d('0x62'),_0x901d('0x5f'),_0x901d('0x4d'),'chatStatusTime',_0x901d('0x75'),'mailStatusTime',_0x901d('0x76'),_0x901d('0x77'),_0x901d('0x78'),_0x901d('0x79'),_0x901d('0x42'),_0x901d('0x7a'),_0x901d('0x7b'),_0x901d('0x7c'),_0x901d('0x7d'),_0x901d('0x7e')],_0x45c730=[_0x901d('0x57'),_0x901d('0x58'),_0x901d('0x69'),_0x901d('0x59'),'whatsappPause','faxPause',_0x901d('0x5a'),_0x901d('0x4c')];Promise[_0x901d('0x7f')]()[_0x901d('0x16')](function(){var _0x109e0a=_[_0x901d('0x3a')](db[_0x901d('0x4e')]['rawAttributes'],function(_0x596a04){return{'name':_0x596a04['fieldName'],'type':_0x596a04[_0x901d('0x80')][_0x901d('0x81')]};});_0x4afe28[_0x901d('0x82')][_0x901d('0x83')]=_0x901d('0x84');_0x4afe28[_0x901d('0x82')][_0x901d('0x4c')]=!![];_0xaa7394=qs[_0x901d('0x85')](_0x109e0a,_0x4afe28);_0xaa7394[_0x901d('0x86')]=!![];if(_0x4afe28['user']['role']===_0x901d('0x87')){var _0x2df0e2={'params':{'id':_0x4afe28[_0x901d('0x87')][_0x901d('0x88')]},'query':{'section':_0x901d('0x15'),'role':_0x901d('0x84'),'online':!![],'nolimit':_0x4afe28[_0x901d('0x82')][_0x901d('0x89')],'sort':_0x4afe28[_0x901d('0x82')][_0x901d('0x8a')],'filter':_0x4afe28['query'][_0x901d('0x41')],'raw':!![]}};return db[_0x901d('0x8b')]['getResources'](_0x2df0e2);}return db['User'][_0x901d('0x8c')](_0xaa7394);})[_0x901d('0x16')](function(_0x4b156c){_0x26e6a2[_0x901d('0xb')]=_0x4b156c[_0x901d('0xb')];_0x2aa9b4=_0x4b156c[_0x901d('0x8d')];return getRealtimeAgents();})[_0x901d('0x16')](function(_0x56c84f){_0x3e3487=_0x56c84f[_0x901d('0x8d')];return _0x2aa9b4[_0x901d('0x3a')](function(_0x461d92){var _0x36f4b2=_[_0x901d('0x48')](_0x3e3487,['id',_0x461d92['id']]);if(_0x36f4b2)_[_0x901d('0x1a')](_0x461d92,_['pick'](_[_0x901d('0x8e')](_0x36f4b2,_0x45c730),_0x21f3bd));_0x461d92[_0x901d('0x8f')]=getAgentStatus(_0x461d92);return _0x461d92;});})[_0x901d('0x16')](function(_0x5763ef){if(_0x4afe28[_0x901d('0x82')][_0x901d('0x90')]){var _0x40ac8e=_['filter'](_0x5763ef,['globalStatus',_0x4afe28['query'][_0x901d('0x90')]]);if(_0x4afe28[_0x901d('0x82')]['pauseTypeFilter']){_0x40ac8e=_['filter'](_0x40ac8e,[_0x901d('0x68'),_0x4afe28[_0x901d('0x82')][_0x901d('0x91')]]);}}_0x26e6a2[_0x901d('0x8d')]=_0x40ac8e||_0x5763ef;return _0x26e6a2;})[_0x901d('0x16')](respondWithFilteredResult(_0xd7fbb3,_0xaa7394))['catch'](handleError(_0xd7fbb3,null));};exports[_0x901d('0x92')]=function(_0x1bd974,_0x1df423){var _0x1db2d9=['mail',_0x901d('0x93'),'sms',_0x901d('0x94'),'fax',_0x901d('0x95'),_0x901d('0x1b')];var _0x2782cf={'count':0x0,'rows':[]},_0x225a90={},_0x1c7b52,_0xb7f695,_0x408194,_0x598a53,_0x4461ab;Promise[_0x901d('0x7f')]()['then'](function(){if(_0x1bd974[_0x901d('0x82')]['channel']){if(!_['includes'](_0x1db2d9,_0x1bd974['query']['channel'][_0x901d('0x96')]()))throw new Error(_0x901d('0x97'));_0x1c7b52=_0x1bd974['query'][_0x901d('0x98')][_0x901d('0x96')]();}var _0x36d240=_[_0x901d('0x51')](_0x1c7b52)+_0x901d('0x4f');var _0x5135b6=_[_0x901d('0x3a')](db[_0x36d240][_0x901d('0x99')],function(_0x412e5b){return{'name':_0x412e5b['fieldName'],'type':_0x412e5b[_0x901d('0x80')][_0x901d('0x81')]};});_0x225a90=qs[_0x901d('0x85')](_0x5135b6,_0x1bd974);if(_0x1bd974[_0x901d('0x87')][_0x901d('0x83')]===_0x901d('0x87')){var _0x283ccf={'params':{'id':_0x1bd974[_0x901d('0x87')][_0x901d('0x88')]},'query':{'section':_0x1c7b52===_0x901d('0x1b')&&_0x1bd974[_0x901d('0x82')][_0x901d('0x80')]===_0x901d('0x9a')?'QueueCampaigns':_[_0x901d('0x51')](_0x1c7b52)+_0x901d('0x1c'),'type':_0x1bd974[_0x901d('0x82')][_0x901d('0x80')],'nolimit':!![],'sort':_0x901d('0x11'),'filter':_0x1bd974[_0x901d('0x82')][_0x901d('0x41')]}};return db[_0x901d('0x8b')]['getResources'](_0x283ccf);}return db[_0x36d240][_0x901d('0x8c')](_0x225a90);})[_0x901d('0x16')](function(_0x448f71){_0x2782cf['count']=_0x448f71[_0x901d('0xb')];_0xb7f695=_0x448f71[_0x901d('0x8d')];return getRealtimeQueues(_0x1bd974,_0x1c7b52);})[_0x901d('0x16')](function(_0x34f33f){_0x598a53=_0x34f33f[_0x901d('0x8d')];return getRealtimeAgents();})[_0x901d('0x16')](function(_0xbcdf2b){_0x408194=_0xbcdf2b[_0x901d('0x8d')];if(_0x1c7b52!=_0x901d('0x1b'))return;return getRealtimeVoiceQueueChannels();})[_0x901d('0x16')](function(_0x28b640){_0x4461ab=_0x28b640?_0x28b640[_0x901d('0x8d')]:[];return initializeQueues(_0xb7f695,_0x598a53,_0x1c7b52,_0x1bd974[_0x901d('0x82')][_0x901d('0x80')]);})[_0x901d('0x16')](function(_0x368b79){var _0x5a95a9=_0x368b79[_0x901d('0x3a')](function(_0x263297){if(_0x1c7b52===_0x901d('0x1b'))return getVoiceQueueAgents(_0x263297,_0xb7f695,_0x408194,_0x4461ab);else return getQueueAgents(_0x263297,_0x408194,_0x1c7b52);});return Promise[_0x901d('0x9b')](_0x5a95a9);})[_0x901d('0x16')](function(_0x35317f){_0x2782cf['rows']=_0x35317f;return _0x2782cf;})[_0x901d('0x16')](respondWithFilteredResult(_0x1df423,_0x225a90))[_0x901d('0x1f')](handleError(_0x1df423,null));}; \ No newline at end of file +var _0x5d17=['Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','loggedIn','available','waiting','outbound','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','paused','talking','busy','originated','find','pick','length','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','loggedInDb','push','User','Queue','findAll','QueueId','idle','unknown','unavailable','ringing','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','every','filter','pause','faxStatus','mailStatus','openchannelStatus','whatsappStatus','getAgents','userpic','lastPauseAt','chatPause','smsPause','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','smsStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','resolve','rawAttributes','fieldName','type','key','role','agent','query','getOptions','raw','user','userProfileId','sort','UserProfile','getResources','findAndCountAll','count','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','pauseType','getQueues','mail','chat','sms','openchannel','fax','whatsapp','channel','includes','toLowerCase','QueueCampaigns','all','util','lodash','../../config/logger','api','../../mysqldb','http','client','offset','undefined','limit','status','set','Content-Range','json','error','stack','name','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','Queues'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5d17,0x114));var _0x75d1=function(_0xee4c5f,_0x1bf72d){_0xee4c5f=_0xee4c5f-0x0;var _0x5accbc=_0x5d17[_0xee4c5f];return _0x5accbc;};'use strict';var util=require(_0x75d1('0x0'));var _=require(_0x75d1('0x1'));var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require(_0x75d1('0x2'))(_0x75d1('0x3'));var db=require(_0x75d1('0x4'))['db'];var amiClient=jayson['client'][_0x75d1('0x5')]({'port':0x232a});var routingClient=jayson[_0x75d1('0x6')][_0x75d1('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x32bd45,_0x56ac0a){return function(_0x458681){if(_0x458681){var _0x116a51=typeof _0x56ac0a[_0x75d1('0x7')]===_0x75d1('0x8')&&typeof _0x56ac0a[_0x75d1('0x9')]===_0x75d1('0x8');var _0xf9f8e=_0x458681['count'];var _0x4cf632=_0x116a51?0x0:_0x56ac0a[_0x75d1('0x7')];var _0x4a3bb3=_0x116a51?_0x458681['count']:_0x56ac0a[_0x75d1('0x7')]+_0x56ac0a[_0x75d1('0x9')];var _0x4d4aa1;if(_0x4a3bb3>=_0xf9f8e){_0x4a3bb3=_0xf9f8e;_0x4d4aa1=0xc8;}else{_0x4d4aa1=0xce;}_0x32bd45[_0x75d1('0xa')](_0x4d4aa1);return _0x32bd45[_0x75d1('0xb')](_0x75d1('0xc'),_0x4cf632+'-'+_0x4a3bb3+'/'+_0xf9f8e)[_0x75d1('0xd')](_0x458681);}return null;};}function handleError(_0x6c1265,_0xd089cf){_0xd089cf=_0xd089cf||0x1f4;return function(_0x49667a){logger[_0x75d1('0xe')](_0x49667a[_0x75d1('0xf')]);if(_0x49667a[_0x75d1('0x10')]){delete _0x49667a[_0x75d1('0x10')];}_0x6c1265['status'](_0xd089cf)['send'](_0x49667a);};}function getRealtimeAgents(){return new Promise(function(_0x55b8a0,_0x24ba98){return amiClient[_0x75d1('0x11')](_0x75d1('0x12'),{})['then'](function(_0x1f9620){if(_0x1f9620[_0x75d1('0xe')])throw new Error(_0x75d1('0x13'));var _0x269e82=_0x1f9620[_0x75d1('0x14')];return routingClient[_0x75d1('0x11')](_0x75d1('0x12'),{})[_0x75d1('0x15')](function(_0x1bc5de){if(_0x1bc5de[_0x75d1('0xe')])throw new Error(_0x75d1('0x16'));var _0x5761db=_0x1bc5de['result'];return _0x55b8a0(_[_0x75d1('0x17')]({},_0x269e82,_0x5761db));});})[_0x75d1('0x18')](function(_0x56730d){_0x24ba98(_0x56730d);});});}function getRealtimeQueues(_0x31eb88,_0x406143){return new Promise(function(_0x579731,_0xf6cc70){var _0xa42dbe=_0x406143===_0x75d1('0x19')?amiClient:routingClient;return _0xa42dbe['request'](_[_0x75d1('0x1a')](_0x406143)+_0x75d1('0x1b'),_0x31eb88)['then'](function(_0x1cb58c){if(_0x1cb58c[_0x75d1('0xe')])throw new Error(util['format'](_0x75d1('0x1c'),_0x406143));return _0x579731(_0x1cb58c['result']);})[_0x75d1('0x18')](function(_0xc256af){_0xf6cc70(_0xc256af);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x345cf5,_0x4b2a25){return amiClient['request'](_0x75d1('0x1d'),{})[_0x75d1('0x15')](function(_0x315ce5){if(_0x315ce5[_0x75d1('0xe')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x345cf5(_0x315ce5[_0x75d1('0x14')]);})[_0x75d1('0x18')](function(_0x367238){_0x4b2a25(_0x367238);});});}function initializeQueues(_0x51138e,_0x54095d,_0x57efd6,_0x364dc9){var _0x30d9f3=[_0x75d1('0x1e'),_0x75d1('0x1f'),_0x75d1('0x20'),'talking','paused'];if(_0x57efd6===_0x75d1('0x19')&&_0x364dc9===_0x75d1('0x21')){_0x30d9f3['push'](_0x75d1('0x22'),'originated',_0x75d1('0x23'),_0x75d1('0x24'),_0x75d1('0x25'),_0x75d1('0x26'),_0x75d1('0x27'),'startProgressive',_0x75d1('0x28'),_0x75d1('0x29'),_0x75d1('0x2a'),_0x75d1('0x2b'),'dialPredictiveInterval',_0x75d1('0x2c'),'dialPredictiveIntervalMinThreshold',_0x75d1('0x2d'),_0x75d1('0x2e'),'predictiveIntervalAnsweredCalls',_0x75d1('0x2f'),_0x75d1('0x30'),_0x75d1('0x31'),_0x75d1('0x32'));}return _0x51138e[_0x75d1('0x33')](function(_0x495aa4){var _0x23f94a=_0x495aa4[_0x75d1('0x34')]({'plain':!![]});_0x23f94a[_0x75d1('0x35')]=[];_0x23f94a[_0x75d1('0x36')]=0x0;_0x23f94a['loggedInDb']=0x0;_0x23f94a['loggedIn']=0x0;_0x23f94a['available']=0x0;_0x23f94a[_0x75d1('0x20')]=0x0;if(_0x57efd6===_0x75d1('0x19')){_0x23f94a[_0x75d1('0x37')]=0x0;_0x23f94a[_0x75d1('0x38')]=0x0;if(_0x364dc9===_0x75d1('0x21')){_0x23f94a[_0x75d1('0x22')]=0x0;_0x23f94a[_0x75d1('0x39')]=0x0;}}var _0x2dce68=_[_0x75d1('0x3a')](_0x54095d,['id',_0x23f94a['id']]);if(_0x2dce68)_['merge'](_0x23f94a,_[_0x75d1('0x3b')](_0x2dce68,_0x30d9f3));return _0x23f94a;});}function updateAgentVoiceStatus(_0x429c38,_0x39ac3e,_0x62b37e){var _0x6d48a5=_['filter'](_0x62b37e,['queue',_0x39ac3e['name']]);if(_0x6d48a5[_0x75d1('0x3c')]===0x0)return _0x429c38[_0x75d1('0x38')]=!![];if(_[_0x75d1('0x3d')](_0x6d48a5,[_0x75d1('0x3e'),_0x429c38[_0x75d1('0x3f')][_0x75d1('0x40')]()]))return _0x429c38['talking']=!![];if(!_0x429c38['talking'])return _0x429c38['busy']=!![];}function getVoiceQueueAgents(_0x3f2569,_0x4cb084,_0x53a1af,_0x450aa5){var _0x21bfd8=_[_0x75d1('0x3a')](_0x4cb084,['id',_0x3f2569['id']]);if(!_0x21bfd8)return _0x3f2569;return _0x21bfd8[_0x75d1('0x41')]({'raw':!![]})['then'](function(_0x44e6c2){for(var _0x2acdc8=0x0;_0x2acdc8<_0x44e6c2[_0x75d1('0x3c')];_0x2acdc8++){var _0x3d4137=_[_0x75d1('0x3a')](_0x53a1af,['id',_0x44e6c2[_0x2acdc8][_0x75d1('0x42')]]);if(!_0x3d4137){_0x3d4137={'id':_0x44e6c2[_0x2acdc8][_0x75d1('0x42')],'name':_0x44e6c2[_0x2acdc8][_0x75d1('0x42')],'accountcode':'','online':![]};}var _0x2c88f2={'id':_0x3d4137['id'],'name':_0x3d4137[_0x75d1('0x10')],'internal':_0x3d4137[_0x75d1('0x43')],'online':Boolean(_0x3d4137[_0x75d1('0x44')]),'paused':Boolean(_0x44e6c2[_0x2acdc8][_0x75d1('0x36')])};if(_0x3d4137[_0x75d1('0x45')]===_0x75d1('0x37'))updateAgentVoiceStatus(_0x2c88f2,_0x3f2569,_0x450aa5);if(_0x2c88f2[_0x75d1('0x44')])_0x3f2569[_0x75d1('0x46')]++;if(_0x2c88f2[_0x75d1('0x38')])_0x3f2569[_0x75d1('0x38')]++;if(_0x2c88f2[_0x75d1('0x36')]&&!_0x2c88f2[_0x75d1('0x38')]&&!_0x2c88f2[_0x75d1('0x37')])_0x3f2569['paused']++;_0x3f2569['agents'][_0x75d1('0x47')](_0x2c88f2);}return _0x3f2569;});}function getQueueAgents(_0x40b74e,_0x429909,_0x1d9853){var _0x4af3bb=_0x75d1('0x48')+_[_0x75d1('0x1a')](_0x1d9853)+_0x75d1('0x49');var _0x329cec=_0x1d9853+'Pause';return db[_0x4af3bb][_0x75d1('0x4a')]({'where':{[_[_0x75d1('0x1a')](_0x1d9853)+_0x75d1('0x4b')]:_0x40b74e['id']},'raw':!![]})[_0x75d1('0x15')](function(_0x5b486d){for(var _0x34d132=0x0;_0x34d132<_0x5b486d['length'];_0x34d132++){var _0x130dd3=_[_0x75d1('0x3a')](_0x429909,['id',_0x5b486d[_0x34d132][_0x75d1('0x42')]]);if(!_0x130dd3){_0x130dd3={'id':_0x5b486d[_0x34d132][_0x75d1('0x42')],'name':_0x5b486d[_0x34d132][_0x75d1('0x42')],'online':![],['pauseField']:![]};}var _0x2137e1={'id':_0x130dd3['id'],'name':_0x130dd3['name'],'online':Boolean(_0x130dd3[_0x75d1('0x44')]),'paused':Boolean(_0x130dd3[_0x329cec])};if(_0x2137e1['online'])_0x40b74e['loggedInDb']++;_0x40b74e[_0x75d1('0x35')][_0x75d1('0x47')](_0x2137e1);}return _0x40b74e;});}function isIdle(_0x4760cf){return _0x4760cf===_0x75d1('0x4c')||_0x4760cf===_0x75d1('0x4d')||_0x4760cf===_0x75d1('0x4e')||_0x4760cf===_0x75d1('0x4f')||_['isNil'](_0x4760cf);}function isAgentPaused(_0x5d7ebf,_0x1edc9d){var _0x8ce3d2=[_0x5d7ebf['chatPause'],_0x5d7ebf[_0x75d1('0x50')],_0x5d7ebf[_0x75d1('0x51')],_0x5d7ebf[_0x75d1('0x52')],_0x5d7ebf['smsPause'],_0x5d7ebf[_0x75d1('0x53')],_0x5d7ebf[_0x75d1('0x54')]];if(!_0x1edc9d)return _[_0x75d1('0x55')](_0x8ce3d2);var _0x3be4b5=_[_0x75d1('0x56')](_0x8ce3d2);return _0x3be4b5[_0x75d1('0x3c')]>0x0&&_0x3be4b5[_0x75d1('0x3c')]<_0x8ce3d2['length']?!![]:![];}function isAgentIdle(_0x1eaa66){if(_0x1eaa66[_0x75d1('0x45')]!==_0x75d1('0x4c')&&_0x1eaa66[_0x75d1('0x53')]){_0x1eaa66[_0x75d1('0x45')]=_0x75d1('0x57');return![];}return _[_0x75d1('0x55')]([_0x1eaa66['chatStatus'],_0x1eaa66[_0x75d1('0x58')],_0x1eaa66[_0x75d1('0x59')],_0x1eaa66[_0x75d1('0x5a')],_0x1eaa66['smsStatus'],_0x1eaa66[_0x75d1('0x45')],_0x1eaa66[_0x75d1('0x5b')]],isIdle);}function getAgentStatus(_0x16c51){var _0x382760=_0x75d1('0x4d');if(isAgentPaused(_0x16c51))_0x382760=_0x75d1('0x57');else if(isAgentPaused(_0x16c51,!![]))_0x382760='*pause';else if(isAgentIdle(_0x16c51))_0x382760=_0x75d1('0x4c');else _0x382760=_0x75d1('0x38');return _0x382760;}exports[_0x75d1('0x5c')]=function(_0x46e665,_0x2e746a){var _0x2f6048={'count':0x0,'rows':[]},_0x2d1648={},_0x104a44,_0x131082,_0x43769e=[_0x75d1('0x5d'),'online','lastLoginAt',_0x75d1('0x5e'),'pauseType',_0x75d1('0x5e'),_0x75d1('0x3f'),'address',_0x75d1('0x5f'),_0x75d1('0x52'),_0x75d1('0x51'),_0x75d1('0x60'),_0x75d1('0x54'),_0x75d1('0x50'),_0x75d1('0x53'),'chatCapacity',_0x75d1('0x61'),_0x75d1('0x62'),_0x75d1('0x63'),_0x75d1('0x64'),_0x75d1('0x65'),_0x75d1('0x66'),_0x75d1('0x67'),_0x75d1('0x68'),_0x75d1('0x69'),_0x75d1('0x6a'),'faxCurrentCapacity','chatStatus',_0x75d1('0x5a'),_0x75d1('0x59'),_0x75d1('0x6b'),'whatsappStatus',_0x75d1('0x58'),'voiceStatus',_0x75d1('0x6c'),_0x75d1('0x6d'),_0x75d1('0x6e'),_0x75d1('0x6f'),'whatsappStatusTime',_0x75d1('0x70'),'voiceStatusTime','queue',_0x75d1('0x71'),_0x75d1('0x72'),_0x75d1('0x73'),_0x75d1('0x74'),'routealias'],_0x1038d2=['chatPause',_0x75d1('0x52'),_0x75d1('0x51'),_0x75d1('0x60'),_0x75d1('0x54'),_0x75d1('0x50'),'voicePause',_0x75d1('0x44')];Promise[_0x75d1('0x75')]()[_0x75d1('0x15')](function(){var _0x3c6bd7=_[_0x75d1('0x33')](db[_0x75d1('0x48')][_0x75d1('0x76')],function(_0x1092fb){return{'name':_0x1092fb[_0x75d1('0x77')],'type':_0x1092fb[_0x75d1('0x78')][_0x75d1('0x79')]};});_0x46e665['query'][_0x75d1('0x7a')]=_0x75d1('0x7b');_0x46e665[_0x75d1('0x7c')][_0x75d1('0x44')]=!![];_0x2d1648=qs[_0x75d1('0x7d')](_0x3c6bd7,_0x46e665);_0x2d1648[_0x75d1('0x7e')]=!![];if(_0x46e665[_0x75d1('0x7f')]['role']==='user'){var _0x1b1cc4={'params':{'id':_0x46e665[_0x75d1('0x7f')][_0x75d1('0x80')]},'query':{'section':_0x75d1('0x12'),'role':_0x75d1('0x7b'),'online':!![],'nolimit':_0x46e665['query']['nolimit'],'sort':_0x46e665[_0x75d1('0x7c')][_0x75d1('0x81')],'filter':_0x46e665['query'][_0x75d1('0x56')],'raw':!![]}};return db[_0x75d1('0x82')][_0x75d1('0x83')](_0x1b1cc4);}return db[_0x75d1('0x48')][_0x75d1('0x84')](_0x2d1648);})[_0x75d1('0x15')](function(_0x5a4abc){_0x2f6048['count']=_0x5a4abc[_0x75d1('0x85')];_0x104a44=_0x5a4abc[_0x75d1('0x86')];return getRealtimeAgents();})['then'](function(_0x45e61a){_0x131082=_0x45e61a['rows'];return _0x104a44[_0x75d1('0x33')](function(_0x2730f6){var _0x30fd13=_['find'](_0x131082,['id',_0x2730f6['id']]);if(_0x30fd13)_[_0x75d1('0x17')](_0x2730f6,_[_0x75d1('0x3b')](_[_0x75d1('0x87')](_0x30fd13,_0x1038d2),_0x43769e));_0x2730f6[_0x75d1('0x88')]=getAgentStatus(_0x2730f6);return _0x2730f6;});})[_0x75d1('0x15')](function(_0x50d202){if(_0x46e665['query'][_0x75d1('0x89')]){var _0x58d20b=_[_0x75d1('0x56')](_0x50d202,[_0x75d1('0x88'),_0x46e665[_0x75d1('0x7c')]['globalStatusFilter']]);if(_0x46e665['query'][_0x75d1('0x8a')]){_0x58d20b=_['filter'](_0x58d20b,[_0x75d1('0x8b'),_0x46e665[_0x75d1('0x7c')][_0x75d1('0x8a')]]);}}_0x2f6048['rows']=_0x58d20b||_0x50d202;return _0x2f6048;})[_0x75d1('0x15')](respondWithFilteredResult(_0x2e746a,_0x2d1648))[_0x75d1('0x18')](handleError(_0x2e746a,null));};exports[_0x75d1('0x8c')]=function(_0x41981f,_0x3e2334){var _0x1a40b5=[_0x75d1('0x8d'),_0x75d1('0x8e'),_0x75d1('0x8f'),_0x75d1('0x90'),_0x75d1('0x91'),_0x75d1('0x92'),_0x75d1('0x19')];var _0x44ef76={'count':0x0,'rows':[]},_0x4b4a52={},_0x574cb0,_0x410fa1,_0x1eb55e,_0x58079c,_0xf54f;Promise['resolve']()['then'](function(){if(_0x41981f['query'][_0x75d1('0x93')]){if(!_[_0x75d1('0x94')](_0x1a40b5,_0x41981f[_0x75d1('0x7c')][_0x75d1('0x93')][_0x75d1('0x95')]()))throw new Error('Invalid\x20channel');_0x574cb0=_0x41981f[_0x75d1('0x7c')][_0x75d1('0x93')][_0x75d1('0x95')]();}var _0x13f54a=_[_0x75d1('0x1a')](_0x574cb0)+'Queue';var _0x1113a8=_['map'](db[_0x13f54a][_0x75d1('0x76')],function(_0x26e1ad){return{'name':_0x26e1ad[_0x75d1('0x77')],'type':_0x26e1ad['type']['key']};});_0x4b4a52=qs['getOptions'](_0x1113a8,_0x41981f);if(_0x41981f[_0x75d1('0x7f')][_0x75d1('0x7a')]===_0x75d1('0x7f')){var _0x22caf3={'params':{'id':_0x41981f[_0x75d1('0x7f')][_0x75d1('0x80')]},'query':{'section':_0x574cb0==='voice'&&_0x41981f[_0x75d1('0x7c')][_0x75d1('0x78')]==='outbound'?_0x75d1('0x96'):_['startCase'](_0x574cb0)+'Queues','type':_0x41981f['query'][_0x75d1('0x78')],'nolimit':!![],'sort':'name','filter':_0x41981f['query'][_0x75d1('0x56')]}};return db['UserProfile'][_0x75d1('0x83')](_0x22caf3);}return db[_0x13f54a][_0x75d1('0x84')](_0x4b4a52);})[_0x75d1('0x15')](function(_0xc939c9){_0x44ef76[_0x75d1('0x85')]=_0xc939c9[_0x75d1('0x85')];_0x410fa1=_0xc939c9[_0x75d1('0x86')];return getRealtimeQueues(_0x41981f,_0x574cb0);})[_0x75d1('0x15')](function(_0x51b682){_0x58079c=_0x51b682[_0x75d1('0x86')];return getRealtimeAgents();})['then'](function(_0x9ec663){_0x1eb55e=_0x9ec663[_0x75d1('0x86')];if(_0x574cb0!=_0x75d1('0x19'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x10bc92){_0xf54f=_0x10bc92?_0x10bc92[_0x75d1('0x86')]:[];return initializeQueues(_0x410fa1,_0x58079c,_0x574cb0,_0x41981f[_0x75d1('0x7c')][_0x75d1('0x78')]);})[_0x75d1('0x15')](function(_0x2ee3a0){var _0x1bb574=_0x2ee3a0['map'](function(_0xccae6a){if(_0x574cb0===_0x75d1('0x19'))return getVoiceQueueAgents(_0xccae6a,_0x410fa1,_0x1eb55e,_0xf54f);else return getQueueAgents(_0xccae6a,_0x1eb55e,_0x574cb0);});return Promise[_0x75d1('0x97')](_0x1bb574);})[_0x75d1('0x15')](function(_0x44143e){_0x44ef76['rows']=_0x44143e;return _0x44ef76;})['then'](respondWithFilteredResult(_0x3e2334,_0x4b4a52))[_0x75d1('0x18')](handleError(_0x3e2334,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index ea2acd1..e6d014e 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2499ae,_0x1fcdd5){var _0x3edc63=function(_0x470324){while(--_0x470324){_0x2499ae['push'](_0x2499ae['shift']());}};_0x3edc63(++_0x1fcdd5);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4e37b7,_0x208193){var _0x3da8fb=function(_0x186080){while(--_0x186080){_0x4e37b7['push'](_0x4e37b7['shift']());}};_0x3da8fb(++_0x208193);}(_0xedd9,0xfc));var _0x9edd=function(_0x213b6c,_0x233918){_0x213b6c=_0x213b6c-0x0;var _0x1f5760=_0xedd9[_0x213b6c];return _0x1f5760;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index d093eb7..a8d5503 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 _0xa1f6=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x369e09,_0x4ca9b1){var _0x2b1dbb=function(_0x1082e5){while(--_0x1082e5){_0x369e09['push'](_0x369e09['shift']());}};_0x2b1dbb(++_0x4ca9b1);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0xa1f6[_0x1f1511];return _0x1d9ab8;};'use strict';var Sequelize=require(_0x6a1f('0x0'));module[_0x6a1f('0x1')]={'state':{'type':Sequelize[_0x6a1f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6a1f('0x3')]},'scheduledat':{'type':Sequelize[_0x6a1f('0x4')]},'uniqueid':{'type':Sequelize[_0x6a1f('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6a1f('0x3')]}}; \ No newline at end of file +var _0x7217=['STRING','DATE','sequelize','INTEGER'];(function(_0x2ca517,_0x4ae303){var _0x5086c0=function(_0x4b3466){while(--_0x4b3466){_0x2ca517['push'](_0x2ca517['shift']());}};_0x5086c0(++_0x4ae303);}(_0x7217,0x19e));var _0x7721=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x7217[_0x3e112d];return _0x531c31;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'state':{'type':Sequelize[_0x7721('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x7721('0x2')]},'scheduledat':{'type':Sequelize[_0x7721('0x3')]},'uniqueid':{'type':Sequelize[_0x7721('0x2')]},'starttime':{'type':Sequelize[_0x7721('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7721('0x2')]},'campaigntype':{'type':Sequelize[_0x7721('0x2')]},'membername':{'type':Sequelize[_0x7721('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index dbfdcf5..b17b5db 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 _0x6218=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','report_agent_preview'];(function(_0x13910b,_0x587ebb){var _0x2acd22=function(_0x5ed2d1){while(--_0x5ed2d1){_0x13910b['push'](_0x13910b['shift']());}};_0x2acd22(++_0x587ebb);}(_0x6218,0x120));var _0x8621=function(_0x119a07,_0x2289f6){_0x119a07=_0x119a07-0x0;var _0x36025c=_0x6218[_0x119a07];return _0x36025c;};'use strict';var _=require(_0x8621('0x0'));var util=require(_0x8621('0x1'));var logger=require(_0x8621('0x2'))(_0x8621('0x3'));var moment=require(_0x8621('0x4'));var BPromise=require('bluebird');var rp=require(_0x8621('0x5'));var fs=require('fs');var path=require(_0x8621('0x6'));var rimraf=require(_0x8621('0x7'));var config=require(_0x8621('0x8'));var attributes=require(_0x8621('0x9'));module[_0x8621('0xa')]=function(_0x433c61,_0x437693){return _0x433c61['define']('ReportAgentPreview',attributes,{'tableName':_0x8621('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa770=['lodash','util','moment','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview'];(function(_0x2df709,_0xeacf9f){var _0x4d04ca=function(_0x5e2828){while(--_0x5e2828){_0x2df709['push'](_0x2df709['shift']());}};_0x4d04ca(++_0xeacf9f);}(_0xa770,0x15c));var _0x0a77=function(_0x25ccde,_0x3f5fac){_0x25ccde=_0x25ccde-0x0;var _0x4c92c9=_0xa770[_0x25ccde];return _0x4c92c9;};'use strict';var _=require(_0x0a77('0x0'));var util=require(_0x0a77('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a77('0x2'));var BPromise=require(_0x0a77('0x3'));var rp=require(_0x0a77('0x4'));var fs=require('fs');var path=require(_0x0a77('0x5'));var rimraf=require('rimraf');var config=require(_0x0a77('0x6'));var attributes=require(_0x0a77('0x7'));module[_0x0a77('0x8')]=function(_0x8879b0,_0x38c818){return _0x8879b0[_0x0a77('0x9')](_0x0a77('0xa'),attributes,{'tableName':_0x0a77('0xb'),'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 493918e..ee4e1e3 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 _0xf875=['util','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','lodash'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xf875,0x185));var _0x5f87=function(_0x502a8e,_0x238224){_0x502a8e=_0x502a8e-0x0;var _0x5c7054=_0xf875[_0x502a8e];return _0x5c7054;};'use strict';var _=require(_0x5f87('0x0'));var util=require(_0x5f87('0x1'));var moment=require('moment');var BPromise=require(_0x5f87('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f87('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f87('0x4'))(_0x5f87('0x5'));var config=require('../../config/environment');var jayson=require(_0x5f87('0x6'));var client=jayson[_0x5f87('0x7')][_0x5f87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f0a8e,_0x3528c0,_0x3eff83){return new BPromise(function(_0x1b5a5a,_0x4569ff){return client[_0x5f87('0x9')](_0x3f0a8e,_0x3eff83)[_0x5f87('0xa')](function(_0x4ee678){logger[_0x5f87('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x3528c0,'request\x20sent');logger[_0x5f87('0xc')](_0x5f87('0xd'),_0x3528c0,_0x5f87('0xe'),JSON['stringify'](_0x4ee678));if(_0x4ee678[_0x5f87('0xf')]){if(_0x4ee678[_0x5f87('0xf')]['code']===0x1f4){logger[_0x5f87('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x3528c0,_0x4ee678[_0x5f87('0xf')][_0x5f87('0x10')]);return _0x4569ff(_0x4ee678[_0x5f87('0xf')][_0x5f87('0x10')]);}logger['error'](_0x5f87('0x11'),_0x3528c0,_0x4ee678[_0x5f87('0xf')][_0x5f87('0x10')]);return _0x1b5a5a(_0x4ee678[_0x5f87('0xf')][_0x5f87('0x10')]);}else{logger['info'](_0x5f87('0x11'),_0x3528c0,_0x5f87('0xe'));_0x1b5a5a(_0x4ee678[_0x5f87('0x12')][_0x5f87('0x10')]);}})[_0x5f87('0x13')](function(_0x1f27f0){logger['error'](_0x5f87('0x11'),_0x3528c0,_0x1f27f0);_0x4569ff(_0x1f27f0);});});}exports['CreateReportAgentPreview']=function(_0x14291b){var _0x2768fd=this;return new Promise(function(_0x3d5335,_0x280928){return db[_0x5f87('0x14')][_0x5f87('0x15')](_0x14291b[_0x5f87('0x16')],{'raw':_0x14291b['options']?_0x14291b[_0x5f87('0x17')][_0x5f87('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4ed94a){logger[_0x5f87('0xb')](_0x5f87('0x19'),_0x14291b);logger[_0x5f87('0xc')](_0x5f87('0x19'),_0x14291b,JSON['stringify'](_0x4ed94a));_0x3d5335(_0x4ed94a);})[_0x5f87('0x13')](function(_0x19eb29){logger['error'](_0x5f87('0x19'),_0x19eb29[_0x5f87('0x10')],_0x14291b);_0x280928(_0x2768fd[_0x5f87('0xf')](0x1f4,_0x19eb29[_0x5f87('0x10')]));});});}; \ No newline at end of file +var _0x5662=['result','catch','create','body','options','raw','then','CreateReportAgentPreview','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5d054e,_0x19c2e0){var _0x28db29=function(_0x55886e){while(--_0x55886e){_0x5d054e['push'](_0x5d054e['shift']());}};_0x28db29(++_0x19c2e0);}(_0x5662,0x68));var _0x2566=function(_0x4eb42e,_0x38dff1){_0x4eb42e=_0x4eb42e-0x0;var _0x1987ea=_0x5662[_0x4eb42e];return _0x1987ea;};'use strict';var _=require(_0x2566('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2566('0x1'));var rs=require(_0x2566('0x2'));var fs=require('fs');var Redis=require(_0x2566('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2566('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x2566('0x5'));var jayson=require(_0x2566('0x6'));var client=jayson['client'][_0x2566('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x82ddc2,_0x3ea455,_0x48df0e){return new BPromise(function(_0x194dc0,_0x51fb6b){return client['request'](_0x82ddc2,_0x48df0e)['then'](function(_0x136b04){logger[_0x2566('0x8')](_0x2566('0x9'),_0x3ea455,_0x2566('0xa'));logger[_0x2566('0xb')](_0x2566('0xc'),_0x3ea455,_0x2566('0xa'),JSON[_0x2566('0xd')](_0x136b04));if(_0x136b04[_0x2566('0xe')]){if(_0x136b04[_0x2566('0xe')]['code']===0x1f4){logger[_0x2566('0xe')](_0x2566('0x9'),_0x3ea455,_0x136b04[_0x2566('0xe')][_0x2566('0xf')]);return _0x51fb6b(_0x136b04[_0x2566('0xe')][_0x2566('0xf')]);}logger[_0x2566('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x3ea455,_0x136b04[_0x2566('0xe')][_0x2566('0xf')]);return _0x194dc0(_0x136b04[_0x2566('0xe')]['message']);}else{logger['info'](_0x2566('0x9'),_0x3ea455,_0x2566('0xa'));_0x194dc0(_0x136b04[_0x2566('0x10')]['message']);}})[_0x2566('0x11')](function(_0x1dc707){logger[_0x2566('0xe')](_0x2566('0x9'),_0x3ea455,_0x1dc707);_0x51fb6b(_0x1dc707);});});}exports['CreateReportAgentPreview']=function(_0x551812){var _0x45bf1f=this;return new Promise(function(_0x3f0551,_0x4f5871){return db['ReportAgentPreview'][_0x2566('0x12')](_0x551812[_0x2566('0x13')],{'raw':_0x551812[_0x2566('0x14')]?_0x551812[_0x2566('0x14')][_0x2566('0x15')]===undefined?!![]:![]:!![]})[_0x2566('0x16')](function(_0x2728ac){logger['info'](_0x2566('0x17'),_0x551812);logger[_0x2566('0xb')](_0x2566('0x17'),_0x551812,JSON[_0x2566('0xd')](_0x2728ac));_0x3f0551(_0x2728ac);})[_0x2566('0x11')](function(_0x13c95c){logger['error'](_0x2566('0x17'),_0x13c95c[_0x2566('0xf')],_0x551812);_0x4f5871(_0x45bf1f[_0x2566('0xe')](0x1f4,_0x13c95c[_0x2566('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 6e55f7f..4599fef 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 _0x5e84=['chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','util','path','express','../../components/auth/service','./rpc.controller','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','mail','/mail/queues/:id','post','/chat/queues/:id/notify','queueNotify'];(function(_0x48d033,_0x2d5aa8){var _0x4a4216=function(_0x4cca4d){while(--_0x4cca4d){_0x48d033['push'](_0x48d033['shift']());}};_0x4a4216(++_0x2d5aa8);}(_0x5e84,0xb8));var _0x45e8=function(_0x72d5d5,_0x1196ff){_0x72d5d5=_0x72d5d5-0x0;var _0x380d68=_0x5e84[_0x72d5d5];return _0x380d68;};'use strict';var multer=require('multer');var util=require(_0x45e8('0x0'));var path=require(_0x45e8('0x1'));var express=require(_0x45e8('0x2'));var router=express['Router']();var auth=require(_0x45e8('0x3'));var controller=require(_0x45e8('0x4'));router['get']('/voice/channels',auth[_0x45e8('0x5')](),controller['voiceChannels']);router[_0x45e8('0x6')](_0x45e8('0x7'),auth[_0x45e8('0x5')](),controller['voiceChannelMixMonitor']);router[_0x45e8('0x6')](_0x45e8('0x8'),auth[_0x45e8('0x5')](),controller['voiceChannelStopMixMonitor']);router[_0x45e8('0x6')](_0x45e8('0x9'),auth['isAuthenticated'](),controller[_0x45e8('0xa')]);router['get']('/chat/queues',auth['isAuthenticated'](),controller[_0x45e8('0xb')]);router[_0x45e8('0x6')](_0x45e8('0xc'),auth[_0x45e8('0x5')](),controller[_0x45e8('0xd')]);router[_0x45e8('0x6')](_0x45e8('0xe'),auth[_0x45e8('0x5')](),controller[_0x45e8('0xf')]);router[_0x45e8('0x6')](_0x45e8('0x10'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x11')]);router[_0x45e8('0x6')](_0x45e8('0x12'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x13')]);router['get'](_0x45e8('0x14'),auth['isAuthenticated'](),controller[_0x45e8('0x15')]);router[_0x45e8('0x6')]('/fax/queues',auth[_0x45e8('0x5')](),controller[_0x45e8('0x16')]);router[_0x45e8('0x6')]('/voice/queues/preview/:id',auth[_0x45e8('0x5')](),controller[_0x45e8('0x17')]);router[_0x45e8('0x6')](_0x45e8('0x18'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x19')]);router['get'](_0x45e8('0x1a'),auth[_0x45e8('0x5')](),controller['voiceQueuesChannel']);router[_0x45e8('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0x45e8('0x1b')]);router[_0x45e8('0x6')](_0x45e8('0x1c'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x1d')]);router[_0x45e8('0x6')](_0x45e8('0x1e'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x1f')]);router[_0x45e8('0x20')](_0x45e8('0x1e'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x21')]);router[_0x45e8('0x6')]('/outbound',auth[_0x45e8('0x5')](),controller[_0x45e8('0x22')]);router[_0x45e8('0x6')]('/outbound/channels',auth[_0x45e8('0x5')](),controller[_0x45e8('0x23')]);router['get'](_0x45e8('0x24'),auth['isAuthenticated'](),controller[_0x45e8('0x25')]);router[_0x45e8('0x20')](_0x45e8('0x26'),auth['isAuthenticated'](),controller[_0x45e8('0x27')]);router[_0x45e8('0x6')](_0x45e8('0x28'),auth[_0x45e8('0x5')](),controller['telephones']);router['get'](_0x45e8('0x29'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x2a')]);router[_0x45e8('0x6')](_0x45e8('0x2b'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x2c')]);router[_0x45e8('0x6')](_0x45e8('0x2d'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x2e')]);router[_0x45e8('0x6')](_0x45e8('0x2f'),auth['isAuthenticated'](),controller[_0x45e8('0x30')]);router[_0x45e8('0x6')](_0x45e8('0x31'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x32')]);router[_0x45e8('0x6')]('/openchannel/queues/waitinginteractions',auth[_0x45e8('0x5')](),controller[_0x45e8('0x33')]);router[_0x45e8('0x6')]('/openchannel/queues/:id/waitinginteractions',auth[_0x45e8('0x5')](),controller[_0x45e8('0x34')]);router[_0x45e8('0x6')](_0x45e8('0x35'),auth['isAuthenticated'](),controller[_0x45e8('0x36')]);router[_0x45e8('0x6')]('/whatsapp/queues/waitinginteractions',auth[_0x45e8('0x5')](),controller[_0x45e8('0x37')]);router[_0x45e8('0x6')]('/fax/queues/waitinginteractions',auth[_0x45e8('0x5')](),controller[_0x45e8('0x38')]);router['post']('/mail/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x45e8('0x39')));router[_0x45e8('0x6')](_0x45e8('0x3a'),auth[_0x45e8('0x5')](),controller['showMailQueues']);router[_0x45e8('0x3b')](_0x45e8('0x3c'),auth['isAuthenticated'](),controller[_0x45e8('0x3d')](_0x45e8('0x3e')));router[_0x45e8('0x6')](_0x45e8('0x3f'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x40')]);router[_0x45e8('0x3b')](_0x45e8('0x41'),auth['isAuthenticated'](),controller[_0x45e8('0x3d')](_0x45e8('0x42')));router[_0x45e8('0x6')](_0x45e8('0x43'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x44')]);router[_0x45e8('0x3b')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x45e8('0x3d')](_0x45e8('0x45')));router[_0x45e8('0x6')](_0x45e8('0x46'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x47')]);router['post'](_0x45e8('0x48'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x3d')](_0x45e8('0x49')));router[_0x45e8('0x3b')](_0x45e8('0x4a'),auth['isAuthenticated'](),controller[_0x45e8('0x3d')](_0x45e8('0x4b')));router[_0x45e8('0x6')](_0x45e8('0x4c'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x4d')]);router['get'](_0x45e8('0x4e'),auth[_0x45e8('0x5')](),controller['showWhatsappQueues']);router[_0x45e8('0x3b')](_0x45e8('0x4f'),auth[_0x45e8('0x5')](),controller[_0x45e8('0x50')]);module[_0x45e8('0x51')]=router; \ No newline at end of file +var _0x8c8a=['/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','showVoiceQueues','put','/outbound','outbound','outboundChannels','/agents','agents','agentCapacity','/telephones','telephones','/trunks','campaigns','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel'];(function(_0x3974bc,_0x566eb5){var _0x3e36ef=function(_0x4545da){while(--_0x4545da){_0x3974bc['push'](_0x3974bc['shift']());}};_0x3e36ef(++_0x566eb5);}(_0x8c8a,0x1c6));var _0xa8c8=function(_0x49052b,_0x1612f7){_0x49052b=_0x49052b-0x0;var _0x2f40cf=_0x8c8a[_0x49052b];return _0x2f40cf;};'use strict';var multer=require(_0xa8c8('0x0'));var util=require(_0xa8c8('0x1'));var path=require('path');var express=require('express');var router=express[_0xa8c8('0x2')]();var auth=require(_0xa8c8('0x3'));var controller=require(_0xa8c8('0x4'));router[_0xa8c8('0x5')](_0xa8c8('0x6'),auth[_0xa8c8('0x7')](),controller['voiceChannels']);router[_0xa8c8('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x8')]);router[_0xa8c8('0x5')](_0xa8c8('0x9'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0xa')]);router[_0xa8c8('0x5')](_0xa8c8('0xb'),auth[_0xa8c8('0x7')](),controller['voiceQueues']);router['get'](_0xa8c8('0xc'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0xd')]);router['get']('/mail/queues',auth[_0xa8c8('0x7')](),controller['mailQueues']);router[_0xa8c8('0x5')](_0xa8c8('0xe'),auth['isAuthenticated'](),controller[_0xa8c8('0xf')]);router[_0xa8c8('0x5')]('/openchannel/queues',auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x10')]);router[_0xa8c8('0x5')](_0xa8c8('0x11'),auth['isAuthenticated'](),controller[_0xa8c8('0x12')]);router[_0xa8c8('0x5')]('/whatsapp/queues',auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x13')]);router[_0xa8c8('0x5')](_0xa8c8('0x14'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x15')]);router[_0xa8c8('0x5')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller['voiceQueuesPreview']);router['get'](_0xa8c8('0x16'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x17')]);router[_0xa8c8('0x5')](_0xa8c8('0x18'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x19')]);router[_0xa8c8('0x5')](_0xa8c8('0x1a'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x1b')]);router[_0xa8c8('0x5')](_0xa8c8('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router['get']('/voice/queues/:id',auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x1d')]);router[_0xa8c8('0x1e')]('/voice/queues/:id',auth['isAuthenticated'](),controller['updateVoiceQueue']);router[_0xa8c8('0x5')](_0xa8c8('0x1f'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x20')]);router[_0xa8c8('0x5')]('/outbound/channels',auth['isAuthenticated'](),controller[_0xa8c8('0x21')]);router[_0xa8c8('0x5')](_0xa8c8('0x22'),auth['isAuthenticated'](),controller[_0xa8c8('0x23')]);router['put']('/agents/:id/capacity',auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x24')]);router['get'](_0xa8c8('0x25'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x26')]);router['get'](_0xa8c8('0x27'),auth[_0xa8c8('0x7')](),controller['trunks']);router[_0xa8c8('0x5')]('/campaigns',auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x28')]);router[_0xa8c8('0x5')]('/fax/accounts',auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x29')]);router[_0xa8c8('0x5')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xa8c8('0x2a')]);router[_0xa8c8('0x5')](_0xa8c8('0x2b'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x2c')]);router[_0xa8c8('0x5')]('/openchannel/queues/waitinginteractions',auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x2d')]);router['get'](_0xa8c8('0x2e'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x2f')]);router['get'](_0xa8c8('0x30'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x31')]);router['get'](_0xa8c8('0x32'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x33')]);router[_0xa8c8('0x5')](_0xa8c8('0x34'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x35')]);router[_0xa8c8('0x36')](_0xa8c8('0x37'),auth[_0xa8c8('0x7')](),controller['queueNotify'](_0xa8c8('0x38')));router[_0xa8c8('0x5')](_0xa8c8('0x39'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x3a')]);router[_0xa8c8('0x36')](_0xa8c8('0x3b'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x3c')]('chat'));router['get'](_0xa8c8('0x3d'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0xa8c8('0x36')](_0xa8c8('0x3e'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x3c')]('fax'));router['get'](_0xa8c8('0x3f'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x40')]);router['post'](_0xa8c8('0x41'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x3c')](_0xa8c8('0x42')));router[_0xa8c8('0x5')](_0xa8c8('0x43'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x44')]);router['post'](_0xa8c8('0x45'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x3c')](_0xa8c8('0x46')));router['post'](_0xa8c8('0x47'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x3c')](_0xa8c8('0x48')));router[_0xa8c8('0x5')](_0xa8c8('0x49'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x4a')]);router[_0xa8c8('0x5')](_0xa8c8('0x4b'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x4c')]);router[_0xa8c8('0x36')](_0xa8c8('0x4d'),auth[_0xa8c8('0x7')](),controller[_0xa8c8('0x4e')]);module[_0xa8c8('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 02bf80b..7286a5f 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 _0xdc97=['agents','Agents','agentCapacity','user','interaction','hasOwnProperty','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','rows','filter','map','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Interaction','update','MessageId','From','TransferReport','create','Start','queue','*,*,*,*','channel','User','Agent\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','InteractionId','bluebird','moment','lodash','../../mysqldb','api','jayson/promise','http','client','request','then','error','code','message','json','sendStatus','name','status','send','isNil','find','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesChannels','VoiceQueuesChannel','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','OutboundChannels'];(function(_0x558159,_0xdbc71b){var _0x2c0713=function(_0x5eeedf){while(--_0x5eeedf){_0x558159['push'](_0x558159['shift']());}};_0x2c0713(++_0xdbc71b);}(_0xdc97,0x13b));var _0x7dc9=function(_0x36758c,_0xd234b0){_0x36758c=_0x36758c-0x0;var _0x4c83fb=_0xdc97[_0x36758c];return _0x4c83fb;};'use strict';var BPromise=require(_0x7dc9('0x0'));var moment=require(_0x7dc9('0x1'));var _=require(_0x7dc9('0x2'));var util=require('util');var db=require(_0x7dc9('0x3'))['db'];var logger=require('../../config/logger')(_0x7dc9('0x4'));var jayson=require(_0x7dc9('0x5'));var amiClient=jayson['client'][_0x7dc9('0x6')]({'port':0x232a});var mailClient=jayson[_0x7dc9('0x7')][_0x7dc9('0x6')]({'port':0x232b});var routingClient=jayson[_0x7dc9('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2636ef,_0x4f91c7,_0x4b3229){return new BPromise(function(_0x2ff923,_0x23737d){var _0x3318ea=_0x4b3229?_0x4b3229:amiClient;return _0x3318ea[_0x7dc9('0x8')](_0x2636ef,_0x4f91c7)[_0x7dc9('0x9')](function(_0x5ca05b){if(_0x5ca05b[_0x7dc9('0xa')]){if(_0x5ca05b[_0x7dc9('0xa')][_0x7dc9('0xb')]===0x1f4){return _0x23737d(_0x5ca05b[_0x7dc9('0xa')][_0x7dc9('0xc')]);}return _0x2ff923(_0x5ca05b[_0x7dc9('0xa')][_0x7dc9('0xc')]);}else{_0x2ff923(_0x5ca05b['result']);}})['catch'](function(_0x4be1c8){_0x23737d(_0x4be1c8);});});}function respondWithResult(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xc8;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['status'](_0x94c75a)[_0x7dc9('0xd')](_0x14e5db);}return _0x599ef1[_0x7dc9('0xe')](0x194);};}function handleError(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0x1f4;return function(_0x31d43d){logger[_0x7dc9('0xa')](_0x31d43d['stack']);if(_0x31d43d[_0x7dc9('0xf')]){delete _0x31d43d[_0x7dc9('0xf')];}_0xaadf2[_0x7dc9('0x10')](_0xf37bc7)[_0x7dc9('0x11')](_0x31d43d);};}function findById(_0x11606f){return function(_0xbe0437){if(!_[_0x7dc9('0x12')](_0x11606f)&&!_[_0x7dc9('0x12')](_0xbe0437)&&!_[_0x7dc9('0x12')](_0xbe0437['rows'])){return _[_0x7dc9('0x13')](_0xbe0437['rows'],function(_0x1f5906){return _0x1f5906['id']==_0x11606f;});}return null;};}exports[_0x7dc9('0x14')]=function(_0x5d61d7,_0x41f66e){return respondWithRpcPromise(_0x7dc9('0x15'),_0x5d61d7[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x41f66e,null))[_0x7dc9('0x17')](handleError(_0x41f66e,null));};exports[_0x7dc9('0x18')]=function(_0x2dad65,_0x2895f5){return respondWithRpcPromise(_0x7dc9('0x19'),_[_0x7dc9('0x1a')](_0x2dad65['query'],_0x2dad65['params']))[_0x7dc9('0x9')](respondWithResult(_0x2895f5,null))[_0x7dc9('0x17')](handleError(_0x2895f5,null));};exports['voiceChannelStopMixMonitor']=function(_0x349001,_0x27f7fa){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x7dc9('0x1a')](_0x349001[_0x7dc9('0x16')],_0x349001[_0x7dc9('0x1b')]))['then'](respondWithResult(_0x27f7fa,null))[_0x7dc9('0x17')](handleError(_0x27f7fa,null));};exports[_0x7dc9('0x1c')]=function(_0xf95336,_0x55a482){return respondWithRpcPromise('VoiceQueues',_0xf95336['query'])[_0x7dc9('0x9')](respondWithResult(_0x55a482,null))[_0x7dc9('0x17')](handleError(_0x55a482,null));};exports['showVoiceQueues']=function(_0x585eef,_0x47771b){return respondWithRpcPromise('VoiceQueues',_0x585eef[_0x7dc9('0x16')])[_0x7dc9('0x9')](findById(_0x585eef[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0x47771b,null))[_0x7dc9('0x17')](handleError(_0x47771b,null));};exports[_0x7dc9('0x1d')]=function(_0x236d42,_0x229f8e){return respondWithRpcPromise(_0x7dc9('0x1e'),_[_0x7dc9('0x1a')](_0x236d42[_0x7dc9('0x1f')],_0x236d42[_0x7dc9('0x1b')]))['then'](respondWithResult(_0x229f8e,null))['catch'](handleError(_0x229f8e,null));};exports['voiceQueuesPreview']=function(_0x49a4a5,_0x4a68f0){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x49a4a5['query'],_0x49a4a5[_0x7dc9('0x1b')]))[_0x7dc9('0x9')](respondWithResult(_0x4a68f0,null))[_0x7dc9('0x17')](handleError(_0x4a68f0,null));};exports[_0x7dc9('0x20')]=function(_0x3300ff,_0x154e22){return respondWithRpcPromise('VoiceQueuesChannels',_0x3300ff['query'])['then'](respondWithResult(_0x154e22,null))[_0x7dc9('0x17')](handleError(_0x154e22,null));};exports['voiceQueuesChannel']=function(_0x2b9ca0,_0x448e46){return respondWithRpcPromise(_0x7dc9('0x21'),_[_0x7dc9('0x1a')](_0x2b9ca0[_0x7dc9('0x16')],_0x2b9ca0[_0x7dc9('0x1b')]))[_0x7dc9('0x9')](respondWithResult(_0x448e46,null))[_0x7dc9('0x17')](handleError(_0x448e46,null));};exports['voiceQueuesChannelHangup']=function(_0x2b56d7,_0x4cdec4){return respondWithRpcPromise(_0x7dc9('0x22'),_[_0x7dc9('0x1a')](_0x2b56d7[_0x7dc9('0x16')],_0x2b56d7[_0x7dc9('0x1b')]))['then'](respondWithResult(_0x4cdec4,null))[_0x7dc9('0x17')](handleError(_0x4cdec4,null));};exports['voiceQueuesChannelRedirect']=function(_0x289560,_0x4f47af){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x7dc9('0x1a')](_0x289560[_0x7dc9('0x16')],_0x289560[_0x7dc9('0x1b')]))[_0x7dc9('0x9')](respondWithResult(_0x4f47af,null))['catch'](handleError(_0x4f47af,null));};exports[_0x7dc9('0x23')]=function(_0x183d87,_0x138f33){return respondWithRpcPromise(_0x7dc9('0x24'),_0x183d87[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x138f33,null))[_0x7dc9('0x17')](handleError(_0x138f33,null));};exports[_0x7dc9('0x25')]=function(_0x166906,_0x21bcfc){return respondWithRpcPromise(_0x7dc9('0x26'),_0x166906[_0x7dc9('0x16')])['then'](respondWithResult(_0x21bcfc,null))[_0x7dc9('0x17')](handleError(_0x21bcfc,null));};exports[_0x7dc9('0x27')]=function(_0x466b02,_0xfd2612){var _0x4bcdce;return respondWithRpcPromise(_0x7dc9('0x28'),_0x466b02[_0x7dc9('0x16')])[_0x7dc9('0x9')](function(_0x3876b6){_0x4bcdce=_0x3876b6;return respondWithRpcPromise(_0x7dc9('0x28'),_0x466b02[_0x7dc9('0x16')],routingClient);})['then'](function(_0x553230){return _[_0x7dc9('0x1a')]({},_0x553230,_0x4bcdce);})[_0x7dc9('0x9')](respondWithResult(_0xfd2612,null))['catch'](handleError(_0xfd2612,null));};exports[_0x7dc9('0x29')]=function(_0x4a37ec,_0x315d65){if(_0x4a37ec[_0x7dc9('0x1f')]&&_0x4a37ec[_0x7dc9('0x1f')]['interaction']&&_0x4a37ec[_0x7dc9('0x2a')]&&_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0xf')]){for(var _0x95513c in _0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')]){if(_0x4a37ec[_0x7dc9('0x1f')]['interaction'][_0x7dc9('0x2c')](_0x95513c)){db['MemberReport']['findAll']({'where':{'channel':_0x95513c,'membername':_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0xf')],'type':_0x7dc9('0x2d'),'exitAt':null,'uniqueid':_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c]&&_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x7dc9('0x2e')]?{'$notIn':_0x4a37ec[_0x7dc9('0x1f')]['interaction'][_0x95513c]}:{'$ne':null}}})[_0x7dc9('0x9')](function(_0x1971c7){var _0x3c4d4c=moment()[_0x7dc9('0x2f')](_0x7dc9('0x30'));for(var _0x19957f=0x0,_0x575393=_0x1971c7[_0x7dc9('0x2e')];_0x19957f<_0x575393;_0x19957f+=0x1){_0x1971c7[_0x19957f][_0x7dc9('0x31')]({'exitAt':_0x3c4d4c});}});for(var _0x49bffe=0x0;_0x49bffe<_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x7dc9('0x2e')];_0x49bffe+=0x1){db['MemberReport'][_0x7dc9('0x32')]({'where':{'channel':_0x95513c,'membername':_0x4a37ec['user']['name'],'type':_0x7dc9('0x2d'),'uniqueid':_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x49bffe],'exitAt':null},'defaults':{'channel':_0x95513c,'membername':_0x4a37ec['user']['name'],'interface':_[_0x7dc9('0x12')](_0x4a37ec['user'][_0x7dc9('0x33')])?util[_0x7dc9('0x2f')]('SIP/%s',_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0xf')]):_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0x33')],'type':_0x7dc9('0x2d'),'enterAt':moment()[_0x7dc9('0x2f')](_0x7dc9('0x30')),'role':_0x7dc9('0x34'),'internal':_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0x35')],'uniqueid':_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x49bffe]}});}}}}return respondWithRpcPromise(_0x7dc9('0x36'),{'id':_0x4a37ec['params']['id'],'capacity':_0x4a37ec[_0x7dc9('0x1f')]['capacity']},routingClient)['then'](respondWithResult(_0x315d65,null))[_0x7dc9('0x17')](handleError(_0x315d65,null));};exports[_0x7dc9('0x37')]=function(_0x40e382,_0x3902aa){return respondWithRpcPromise(_0x7dc9('0x38'),_0x40e382['query'])[_0x7dc9('0x9')](respondWithResult(_0x3902aa,null))[_0x7dc9('0x17')](handleError(_0x3902aa,null));};exports[_0x7dc9('0x39')]=function(_0x4a9b75,_0x341909){return respondWithRpcPromise(_0x7dc9('0x3a'),_0x4a9b75[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x341909,null))[_0x7dc9('0x17')](handleError(_0x341909,null));};exports[_0x7dc9('0x3b')]=function(_0x593132,_0x366b8b){return respondWithRpcPromise(_0x7dc9('0x3c'),_0x593132[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x17')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x3d')]=function(_0x31baf1,_0x24abb6){return respondWithRpcPromise(_0x7dc9('0x3e'),_0x31baf1[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x24abb6,null))[_0x7dc9('0x17')](handleError(_0x24abb6,null));};exports['showChatQueues']=function(_0x1767b6,_0x39be46){return respondWithRpcPromise(_0x7dc9('0x3e'),_0x1767b6[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x1767b6['params']['id']))[_0x7dc9('0x9')](respondWithResult(_0x39be46,null))[_0x7dc9('0x17')](handleError(_0x39be46,null));};exports[_0x7dc9('0x3f')]=function(_0x17ed6c,_0x2a1db8){return respondWithRpcPromise(_0x7dc9('0x40'),_0x17ed6c['query'],routingClient)['then'](respondWithResult(_0x2a1db8,null))['catch'](handleError(_0x2a1db8,null));};exports[_0x7dc9('0x41')]=function(_0x3daf33,_0x32a64f){return respondWithRpcPromise(_0x7dc9('0x40'),_0x3daf33['query'],routingClient)['then'](findById(_0x3daf33[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0x32a64f,null))[_0x7dc9('0x17')](handleError(_0x32a64f,null));};exports[_0x7dc9('0x42')]=function(_0x2caf7f,_0x2272ef){return respondWithRpcPromise(_0x7dc9('0x43'),_0x2caf7f['query'],mailClient)[_0x7dc9('0x9')](respondWithResult(_0x2272ef,null))[_0x7dc9('0x17')](handleError(_0x2272ef,null));};exports[_0x7dc9('0x44')]=function(_0x1dad95,_0x4683b3){return respondWithRpcPromise('OpenchannelQueues',_0x1dad95[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x4683b3,null))[_0x7dc9('0x17')](handleError(_0x4683b3,null));};exports[_0x7dc9('0x45')]=function(_0x2454d7,_0x3a93c4){return respondWithRpcPromise(_0x7dc9('0x46'),_0x2454d7[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x2454d7[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0x3a93c4,null))[_0x7dc9('0x17')](handleError(_0x3a93c4,null));};exports[_0x7dc9('0x47')]=function(_0x5eee27,_0x3485b6){return respondWithRpcPromise('SmsQueues',_0x5eee27[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x3485b6,null))['catch'](handleError(_0x3485b6,null));};exports[_0x7dc9('0x48')]=function(_0x24d2c7,_0x50e9a9){return respondWithRpcPromise(_0x7dc9('0x49'),_0x24d2c7[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x24d2c7['params']['id']))['then'](respondWithResult(_0x50e9a9,null))[_0x7dc9('0x17')](handleError(_0x50e9a9,null));};exports[_0x7dc9('0x4a')]=function(_0x4ed60e,_0x3aba59){return respondWithRpcPromise(_0x7dc9('0x4b'),_0x4ed60e[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x3aba59,null))[_0x7dc9('0x17')](handleError(_0x3aba59,null));};exports[_0x7dc9('0x4c')]=function(_0x51b834,_0x35f31e){return respondWithRpcPromise(_0x7dc9('0x4b'),_0x51b834[_0x7dc9('0x16')],routingClient)['then'](findById(_0x51b834['params']['id']))[_0x7dc9('0x9')](respondWithResult(_0x35f31e,null))[_0x7dc9('0x17')](handleError(_0x35f31e,null));};exports[_0x7dc9('0x4d')]=function(_0x2cf485,_0x59f3bd){return respondWithRpcPromise('FaxQueues',_0x2cf485[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x59f3bd,null))[_0x7dc9('0x17')](handleError(_0x59f3bd,null));};exports[_0x7dc9('0x4e')]=function(_0x5d211b,_0xea1728){return respondWithRpcPromise(_0x7dc9('0x4f'),_0x5d211b[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x5d211b[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0xea1728,null))[_0x7dc9('0x17')](handleError(_0xea1728,null));};exports['faxAccounts']=function(_0x2d7c33,_0x2cde0c){return respondWithRpcPromise('FaxAccounts',_0x2d7c33['query'])[_0x7dc9('0x9')](respondWithResult(_0x2cde0c,null))['catch'](handleError(_0x2cde0c,null));};exports[_0x7dc9('0x50')]=function(_0x466602,_0xd99a2){return respondWithRpcPromise(_0x7dc9('0x51'),_0x466602[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0xd99a2,null))[_0x7dc9('0x17')](handleError(_0xd99a2,null));};exports[_0x7dc9('0x52')]=function(_0x25f970,_0x30ce2f){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x25f970[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x30ce2f,null))[_0x7dc9('0x17')](handleError(_0x30ce2f,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x45c1b3,_0x585e42){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x45c1b3[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x585e42,null))['catch'](handleError(_0x585e42,null));};exports[_0x7dc9('0x53')]=function(_0x533738,_0x5a585a){return respondWithRpcPromise(_0x7dc9('0x54'),_0x533738[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](function(_0xb8be9){if(_0x533738['query'][_0x7dc9('0x55')]!==undefined){var _0xe944a4=_(_0xb8be9[_0x7dc9('0x56')])[_0x7dc9('0x57')]([_0x533738[_0x7dc9('0x16')][_0x7dc9('0x55')],_0x533738[_0x7dc9('0x1b')]['id']])[_0x7dc9('0x58')]('queue_id')['uniq']()[_0x7dc9('0x59')]();return _0xb8be9['rows'][_0x7dc9('0x57')](function(_0x1da142){return _0xe944a4[_0x7dc9('0x5a')](_0x1da142[_0x7dc9('0x5b')])>-0x1;});}else{return _0xb8be9['rows'][_0x7dc9('0x57')](function(_0x51a7e5){return _0x51a7e5['queue_id']===parseInt(_0x533738[_0x7dc9('0x1b')]['id']);});}})[_0x7dc9('0x9')](respondWithResult(_0x5a585a,null))[_0x7dc9('0x17')](handleError(_0x5a585a,null));};exports[_0x7dc9('0x5c')]=function(_0x5bc1c3,_0x2c3434){return respondWithRpcPromise(_0x7dc9('0x5d'),_0x5bc1c3['query'],routingClient)['then'](respondWithResult(_0x2c3434,null))[_0x7dc9('0x17')](handleError(_0x2c3434,null));};exports[_0x7dc9('0x5e')]=function(_0x49d7ef,_0x114078){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x49d7ef[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x114078,null))[_0x7dc9('0x17')](handleError(_0x114078,null));};exports['faxQueuesWaitingInteractions']=function(_0x33d68c,_0x3c7daf){return respondWithRpcPromise(_0x7dc9('0x5f'),_0x33d68c['query'],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x3c7daf,null))['catch'](handleError(_0x3c7daf,null));};exports['queueNotify']=function(_0xa899){return function(_0x26244a,_0x31faa4){var _0x3657b6,_0x26d94e;var _0x56a00d=_[_0x7dc9('0x60')](_0xa899);var _0x1daf80=_0xa899===_0x7dc9('0x61')?_0x7dc9('0x62'):_0x7dc9('0x63');return db[_0x56a00d+'Queue'][_0x7dc9('0x64')]({'raw':!![],'where':{'id':_0x26244a[_0x7dc9('0x1b')]['id']}})[_0x7dc9('0x9')](function(_0x200df7){if(_['isNil'](_0x200df7)){throw new Error(_0x56a00d+_0x7dc9('0x65'));}_0x3657b6=_0x200df7;return db[_0x56a00d+'Message']['findOne']({'where':{'id':_0x26244a[_0x7dc9('0x1f')]['messageId']},'include':[{'model':db[_0x56a00d+_0x7dc9('0x66')],'as':_0x7dc9('0x66')},{'model':db[_0x56a00d+_0x1daf80],'as':_0x7dc9('0x63')}]});})[_0x7dc9('0x9')](function(_0x38dccc){if(_[_0x7dc9('0x12')](_0x38dccc)){throw new Error(_0x56a00d+'\x20Message\x20not\x20found');}_0x26d94e=_0x38dccc;return _0x38dccc[_0x7dc9('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0x7dc9('0x9')](function(){var _0x1a4bfb={'uniqueid':_0xa899+'.'+_0x26d94e['id']+'.'+_0x26d94e[_0x7dc9('0x66')]['id'],'FromUserId':_0x26244a[_0x7dc9('0x2a')]['id'],'type':'queue'};_0x1a4bfb[_0x56a00d+_0x7dc9('0x68')]=_0x26d94e['id'];_0x1a4bfb[_0x56a00d+'InteractionId']=_0x26d94e[_0x7dc9('0x66')]['id'];_0x1a4bfb[_0x7dc9('0x69')+_0x56a00d+_0x1daf80+'Id']=_0x26d94e[_0x7dc9('0x63')]['id'];_0x1a4bfb['To'+_0x56a00d+'QueueId']=_0x3657b6['id'];return db[_0x56a00d+_0x7dc9('0x6a')][_0x7dc9('0x6b')](_0x1a4bfb);})['then'](function(){return respondWithRpcPromise(_0x7dc9('0x6c'),{'channel':_0xa899,'interaction':_0x26d94e[_0x7dc9('0x66')],'message':_0x26d94e,'account':_0x26d94e[_0x7dc9('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7dc9('0x6d'),'appdata':_0x3657b6['name']+','+(_0x26d94e[_0x7dc9('0x63')]['queueTransferTimeout']||0x12c),'interval':_0x7dc9('0x6e')}]},routingClient);})[_0x7dc9('0x9')](respondWithResult(_0x31faa4,null))[_0x7dc9('0x17')](handleError(_0x31faa4,null));};};exports['agentNotify']=function(_0x160bf0,_0x4588a7){var _0x23da2e,_0x568705;if(_['isNil'](_0x160bf0[_0x7dc9('0x1f')][_0x7dc9('0x6f')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x573fa9=_0x160bf0[_0x7dc9('0x1f')][_0x7dc9('0x6f')];var _0x5f3487=_[_0x7dc9('0x60')](_0x573fa9);var _0x5a44a1=_0x573fa9===_0x7dc9('0x61')?_0x7dc9('0x62'):_0x7dc9('0x63');return db[_0x7dc9('0x70')][_0x7dc9('0x64')]({'raw':!![],'where':{'id':_0x160bf0[_0x7dc9('0x1b')]['id'],'role':'agent'}})[_0x7dc9('0x9')](function(_0x3fb268){if(_[_0x7dc9('0x12')](_0x3fb268)){throw new Error(_0x7dc9('0x71'));}_0x23da2e=_0x3fb268;return db[_0x5f3487+_0x7dc9('0x72')]['findOne']({'where':{'id':_0x160bf0[_0x7dc9('0x1f')][_0x7dc9('0x73')]},'include':[{'model':db[_0x5f3487+_0x7dc9('0x66')],'as':_0x7dc9('0x66')},{'model':db[_0x5f3487+_0x5a44a1],'as':'Account'}]});})[_0x7dc9('0x9')](function(_0x54bd64){if(_['isNil'](_0x54bd64)){throw new Error(_0x5f3487+_0x7dc9('0x74'));}_0x568705=_0x54bd64;return _0x54bd64['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x7dc9('0x9')](function(){var _0x19c880={'uniqueid':_0x573fa9+'.'+_0x568705['id']+'.'+_0x568705[_0x7dc9('0x66')]['id'],'FromUserId':_0x160bf0[_0x7dc9('0x2a')]['id'],'type':_0x7dc9('0x6d'),'ToUserId':_0x23da2e['id']};_0x19c880[_0x5f3487+_0x7dc9('0x68')]=_0x568705['id'];_0x19c880[_0x5f3487+_0x7dc9('0x75')]=_0x568705[_0x7dc9('0x66')]['id'];_0x19c880['From'+_0x5f3487+_0x5a44a1+'Id']=_0x568705[_0x7dc9('0x63')]['id'];return db[_0x5f3487+_0x7dc9('0x6a')][_0x7dc9('0x6b')](_0x19c880);})[_0x7dc9('0x9')](function(){return respondWithRpcPromise(_0x7dc9('0x6c'),{'channel':_0x573fa9,'interaction':_0x568705['Interaction'],'message':_0x568705,'account':_0x568705[_0x7dc9('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7dc9('0x34'),'appdata':_0x23da2e[_0x7dc9('0xf')]+','+(_0x568705[_0x7dc9('0x63')]['agentTransferTimeout']||0x12c),'interval':_0x7dc9('0x6e')}]},routingClient);})['then'](respondWithResult(_0x4588a7,null))[_0x7dc9('0x17')](handleError(_0x4588a7,null));}; \ No newline at end of file +var _0x5fc3=['openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','chat','User','\x20Message\x20not\x20found','Start','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','status','json','sendStatus','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','format','length','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions'];(function(_0x35d226,_0x2d068a){var _0x455065=function(_0x37bcb5){while(--_0x37bcb5){_0x35d226['push'](_0x35d226['shift']());}};_0x455065(++_0x2d068a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x5fc3[_0x1ae4a9];return _0x54d0b0;};'use strict';var BPromise=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var _=require('lodash');var util=require(_0x35fc('0x2'));var db=require(_0x35fc('0x3'))['db'];var logger=require(_0x35fc('0x4'))(_0x35fc('0x5'));var jayson=require(_0x35fc('0x6'));var amiClient=jayson['client'][_0x35fc('0x7')]({'port':0x232a});var mailClient=jayson[_0x35fc('0x8')][_0x35fc('0x7')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){var _0x1e5f90=_0x16e153?_0x16e153:amiClient;return _0x1e5f90[_0x35fc('0x9')](_0x19a0d1,_0x508b32)[_0x35fc('0xa')](function(_0x2051ab){if(_0x2051ab['error']){if(_0x2051ab[_0x35fc('0xb')][_0x35fc('0xc')]===0x1f4){return _0xc72d93(_0x2051ab['error'][_0x35fc('0xd')]);}return _0x27524f(_0x2051ab[_0x35fc('0xb')]['message']);}else{_0x27524f(_0x2051ab[_0x35fc('0xe')]);}})[_0x35fc('0xf')](function(_0x5469f5){_0xc72d93(_0x5469f5);});});}function respondWithResult(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xc8;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x10')](_0x409357)[_0x35fc('0x11')](_0x5d462a);}return _0x4cbe74[_0x35fc('0x12')](0x194);};}function handleError(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0x1f4;return function(_0x5cfe94){logger['error'](_0x5cfe94['stack']);if(_0x5cfe94['name']){delete _0x5cfe94[_0x35fc('0x13')];}_0x29730f[_0x35fc('0x10')](_0x38d9f2)[_0x35fc('0x14')](_0x5cfe94);};}function findById(_0x154958){return function(_0x227a49){if(!_[_0x35fc('0x15')](_0x154958)&&!_['isNil'](_0x227a49)&&!_[_0x35fc('0x15')](_0x227a49[_0x35fc('0x16')])){return _['find'](_0x227a49[_0x35fc('0x16')],function(_0x363e47){return _0x363e47['id']==_0x154958;});}return null;};}exports[_0x35fc('0x17')]=function(_0x5f56c6,_0x1a86e9){return respondWithRpcPromise(_0x35fc('0x18'),_0x5f56c6[_0x35fc('0x19')])['then'](respondWithResult(_0x1a86e9,null))[_0x35fc('0xf')](handleError(_0x1a86e9,null));};exports[_0x35fc('0x1a')]=function(_0x3229d1,_0x251a1f){return respondWithRpcPromise(_0x35fc('0x1b'),_[_0x35fc('0x1c')](_0x3229d1[_0x35fc('0x19')],_0x3229d1[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x251a1f,null))[_0x35fc('0xf')](handleError(_0x251a1f,null));};exports['voiceChannelStopMixMonitor']=function(_0x323aee,_0xd5399f){return respondWithRpcPromise(_0x35fc('0x1e'),_[_0x35fc('0x1c')](_0x323aee[_0x35fc('0x19')],_0x323aee['params']))[_0x35fc('0xa')](respondWithResult(_0xd5399f,null))[_0x35fc('0xf')](handleError(_0xd5399f,null));};exports['voiceQueues']=function(_0x265324,_0x5a93df){return respondWithRpcPromise(_0x35fc('0x1f'),_0x265324['query'])[_0x35fc('0xa')](respondWithResult(_0x5a93df,null))['catch'](handleError(_0x5a93df,null));};exports[_0x35fc('0x20')]=function(_0xdfab9f,_0x5cb986){return respondWithRpcPromise('VoiceQueues',_0xdfab9f[_0x35fc('0x19')])['then'](findById(_0xdfab9f[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x5cb986,null))['catch'](handleError(_0x5cb986,null));};exports[_0x35fc('0x21')]=function(_0x645eac,_0x383837){return respondWithRpcPromise(_0x35fc('0x22'),_[_0x35fc('0x1c')](_0x645eac[_0x35fc('0x23')],_0x645eac[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x383837,null))['catch'](handleError(_0x383837,null));};exports[_0x35fc('0x24')]=function(_0x220931,_0x22af18){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x35fc('0x1c')](_0x220931[_0x35fc('0x19')],_0x220931[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x22af18,null))[_0x35fc('0xf')](handleError(_0x22af18,null));};exports[_0x35fc('0x25')]=function(_0x222ddb,_0x37b435){return respondWithRpcPromise(_0x35fc('0x26'),_0x222ddb[_0x35fc('0x19')])['then'](respondWithResult(_0x37b435,null))['catch'](handleError(_0x37b435,null));};exports[_0x35fc('0x27')]=function(_0x4af5fe,_0x37b394){return respondWithRpcPromise(_0x35fc('0x28'),_[_0x35fc('0x1c')](_0x4af5fe[_0x35fc('0x19')],_0x4af5fe[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x37b394,null))['catch'](handleError(_0x37b394,null));};exports[_0x35fc('0x29')]=function(_0x330a14,_0x46b9ef){return respondWithRpcPromise(_0x35fc('0x2a'),_[_0x35fc('0x1c')](_0x330a14[_0x35fc('0x19')],_0x330a14['params']))[_0x35fc('0xa')](respondWithResult(_0x46b9ef,null))[_0x35fc('0xf')](handleError(_0x46b9ef,null));};exports[_0x35fc('0x2b')]=function(_0x52f53d,_0x2c657d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x35fc('0x1c')](_0x52f53d[_0x35fc('0x19')],_0x52f53d[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x2c657d,null))['catch'](handleError(_0x2c657d,null));};exports['outbound']=function(_0x59e4fb,_0x20f5fe){return respondWithRpcPromise('Outbound',_0x59e4fb[_0x35fc('0x19')])['then'](respondWithResult(_0x20f5fe,null))[_0x35fc('0xf')](handleError(_0x20f5fe,null));};exports[_0x35fc('0x2c')]=function(_0x2ca9ac,_0x22b724){return respondWithRpcPromise(_0x35fc('0x2d'),_0x2ca9ac[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x22b724,null))['catch'](handleError(_0x22b724,null));};exports[_0x35fc('0x2e')]=function(_0x16087d,_0x4e0ce3){var _0x1feda5;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d[_0x35fc('0x19')])[_0x35fc('0xa')](function(_0x813866){_0x1feda5=_0x813866;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d['query'],routingClient);})[_0x35fc('0xa')](function(_0x267858){return _[_0x35fc('0x1c')]({},_0x267858,_0x1feda5);})['then'](respondWithResult(_0x4e0ce3,null))[_0x35fc('0xf')](handleError(_0x4e0ce3,null));};exports[_0x35fc('0x30')]=function(_0x596919,_0x237548){if(_0x596919[_0x35fc('0x23')]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]&&_0x596919[_0x35fc('0x32')]&&_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]){for(var _0x3ec51f in _0x596919['body']['interaction']){if(_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]['hasOwnProperty'](_0x3ec51f)){db['MemberReport']['findAll']({'where':{'channel':_0x3ec51f,'membername':_0x596919[_0x35fc('0x32')][_0x35fc('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length']?{'$notIn':_0x596919['body']['interaction'][_0x3ec51f]}:{'$ne':null}}})['then'](function(_0x56bdb9){var _0xb26e3f=moment()[_0x35fc('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x119925=0x0,_0x56cf1f=_0x56bdb9[_0x35fc('0x34')];_0x119925<_0x56cf1f;_0x119925+=0x1){_0x56bdb9[_0x119925][_0x35fc('0x35')]({'exitAt':_0xb26e3f});}});for(var _0x350237=0x0;_0x350237<_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length'];_0x350237+=0x1){db[_0x35fc('0x36')][_0x35fc('0x37')]({'where':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'type':_0x35fc('0x38'),'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237],'exitAt':null},'defaults':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'interface':_['isNil'](_0x596919['user'][_0x35fc('0x39')])?util[_0x35fc('0x33')](_0x35fc('0x3a'),_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]):_0x596919[_0x35fc('0x32')][_0x35fc('0x39')],'type':_0x35fc('0x38'),'enterAt':moment()['format'](_0x35fc('0x3b')),'role':_0x35fc('0x3c'),'internal':_0x596919[_0x35fc('0x32')][_0x35fc('0x3d')],'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237]}});}}}}return respondWithRpcPromise(_0x35fc('0x3e'),{'id':_0x596919[_0x35fc('0x1d')]['id'],'capacity':_0x596919[_0x35fc('0x23')][_0x35fc('0x3f')]},routingClient)[_0x35fc('0xa')](respondWithResult(_0x237548,null))[_0x35fc('0xf')](handleError(_0x237548,null));};exports[_0x35fc('0x40')]=function(_0x3146e2,_0x59c666){return respondWithRpcPromise('Telephones',_0x3146e2[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x59c666,null))[_0x35fc('0xf')](handleError(_0x59c666,null));};exports[_0x35fc('0x41')]=function(_0x3ee296,_0x3e6494){return respondWithRpcPromise('Trunks',_0x3ee296['query'])[_0x35fc('0xa')](respondWithResult(_0x3e6494,null))[_0x35fc('0xf')](handleError(_0x3e6494,null));};exports[_0x35fc('0x42')]=function(_0x38bc78,_0x5b2595){return respondWithRpcPromise(_0x35fc('0x43'),_0x38bc78[_0x35fc('0x19')])['then'](respondWithResult(_0x5b2595,null))[_0x35fc('0xf')](handleError(_0x5b2595,null));};exports[_0x35fc('0x44')]=function(_0x590faa,_0x3e12e4){return respondWithRpcPromise(_0x35fc('0x45'),_0x590faa[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x3e12e4,null))['catch'](handleError(_0x3e12e4,null));};exports['showChatQueues']=function(_0x502a15,_0x240338){return respondWithRpcPromise(_0x35fc('0x45'),_0x502a15['query'],routingClient)[_0x35fc('0xa')](findById(_0x502a15[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x240338,null))[_0x35fc('0xf')](handleError(_0x240338,null));};exports[_0x35fc('0x46')]=function(_0x538be0,_0x2d9d45){return respondWithRpcPromise(_0x35fc('0x47'),_0x538be0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x2d9d45,null))[_0x35fc('0xf')](handleError(_0x2d9d45,null));};exports[_0x35fc('0x48')]=function(_0x47fb1a,_0x35a676){return respondWithRpcPromise(_0x35fc('0x47'),_0x47fb1a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x47fb1a[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x35a676,null))[_0x35fc('0xf')](handleError(_0x35a676,null));};exports[_0x35fc('0x49')]=function(_0x53a79d,_0x10a5b8){return respondWithRpcPromise(_0x35fc('0x4a'),_0x53a79d[_0x35fc('0x19')],mailClient)['then'](respondWithResult(_0x10a5b8,null))[_0x35fc('0xf')](handleError(_0x10a5b8,null));};exports['openchannelQueues']=function(_0x4ceacc,_0x5d4a39){return respondWithRpcPromise(_0x35fc('0x4b'),_0x4ceacc[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x5d4a39,null))[_0x35fc('0xf')](handleError(_0x5d4a39,null));};exports[_0x35fc('0x4c')]=function(_0x4bbea0,_0x579f5a){return respondWithRpcPromise('OpenchannelQueues',_0x4bbea0['query'],routingClient)['then'](findById(_0x4bbea0[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x579f5a,null))[_0x35fc('0xf')](handleError(_0x579f5a,null));};exports[_0x35fc('0x4d')]=function(_0x511e8b,_0x458eb8){return respondWithRpcPromise(_0x35fc('0x4e'),_0x511e8b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x458eb8,null))[_0x35fc('0xf')](handleError(_0x458eb8,null));};exports[_0x35fc('0x4f')]=function(_0x27071b,_0x2127e0){return respondWithRpcPromise(_0x35fc('0x4e'),_0x27071b['query'],routingClient)[_0x35fc('0xa')](findById(_0x27071b['params']['id']))[_0x35fc('0xa')](respondWithResult(_0x2127e0,null))[_0x35fc('0xf')](handleError(_0x2127e0,null));};exports[_0x35fc('0x50')]=function(_0x2bc76c,_0x4bdde7){return respondWithRpcPromise(_0x35fc('0x51'),_0x2bc76c['query'],routingClient)['then'](respondWithResult(_0x4bdde7,null))['catch'](handleError(_0x4bdde7,null));};exports[_0x35fc('0x52')]=function(_0x5dfeb7,_0x3c9027){return respondWithRpcPromise('WhatsappQueues',_0x5dfeb7[_0x35fc('0x19')],routingClient)['then'](findById(_0x5dfeb7[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x3c9027,null))[_0x35fc('0xf')](handleError(_0x3c9027,null));};exports[_0x35fc('0x53')]=function(_0x5c2ec0,_0x3d0ecc){return respondWithRpcPromise(_0x35fc('0x54'),_0x5c2ec0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x3d0ecc,null))[_0x35fc('0xf')](handleError(_0x3d0ecc,null));};exports[_0x35fc('0x55')]=function(_0x37764b,_0x3c1b56){return respondWithRpcPromise(_0x35fc('0x54'),_0x37764b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x37764b[_0x35fc('0x1d')]['id']))['then'](respondWithResult(_0x3c1b56,null))[_0x35fc('0xf')](handleError(_0x3c1b56,null));};exports[_0x35fc('0x56')]=function(_0x2600d2,_0x4a926d){return respondWithRpcPromise(_0x35fc('0x57'),_0x2600d2[_0x35fc('0x19')])['then'](respondWithResult(_0x4a926d,null))['catch'](handleError(_0x4a926d,null));};exports[_0x35fc('0x58')]=function(_0x4835c2,_0x223ad3){return respondWithRpcPromise(_0x35fc('0x59'),_0x4835c2[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x223ad3,null))[_0x35fc('0xf')](handleError(_0x223ad3,null));};exports[_0x35fc('0x5a')]=function(_0x13f602,_0x104b1d){return respondWithRpcPromise(_0x35fc('0x5b'),_0x13f602[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x104b1d,null))[_0x35fc('0xf')](handleError(_0x104b1d,null));};exports[_0x35fc('0x5c')]=function(_0x9f034e,_0x184f28){return respondWithRpcPromise(_0x35fc('0x5d'),_0x9f034e[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x184f28,null))[_0x35fc('0xf')](handleError(_0x184f28,null));};exports[_0x35fc('0x5e')]=function(_0x4ba1b0,_0x1797d0){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4ba1b0[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](function(_0x2185ce){if(_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')]!==undefined){var _0x3f56f4=_(_0x2185ce[_0x35fc('0x16')])[_0x35fc('0x60')]([_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')],_0x4ba1b0[_0x35fc('0x1d')]['id']])['map'](_0x35fc('0x61'))[_0x35fc('0x62')]()[_0x35fc('0x63')]();return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x41a6de){return _0x3f56f4['indexOf'](_0x41a6de[_0x35fc('0x61')])>-0x1;});}else{return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x23206d){return _0x23206d[_0x35fc('0x61')]===parseInt(_0x4ba1b0[_0x35fc('0x1d')]['id']);});}})[_0x35fc('0xa')](respondWithResult(_0x1797d0,null))[_0x35fc('0xf')](handleError(_0x1797d0,null));};exports[_0x35fc('0x64')]=function(_0x5f23d8,_0x28f02b){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x5f23d8[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x28f02b,null))['catch'](handleError(_0x28f02b,null));};exports[_0x35fc('0x65')]=function(_0x41002a,_0xcaa49){return respondWithRpcPromise(_0x35fc('0x66'),_0x41002a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0xcaa49,null))[_0x35fc('0xf')](handleError(_0xcaa49,null));};exports[_0x35fc('0x67')]=function(_0x25ee61,_0x5806bf){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x25ee61['query'],routingClient)['then'](respondWithResult(_0x5806bf,null))[_0x35fc('0xf')](handleError(_0x5806bf,null));};exports[_0x35fc('0x68')]=function(_0x8fc410){return function(_0x1f5cbc,_0x35ef53){var _0x4f535a,_0x226fdf;var _0x19682e=_[_0x35fc('0x69')](_0x8fc410);var _0x169ea2=_0x8fc410==='chat'?_0x35fc('0x6a'):_0x35fc('0x6b');return db[_0x19682e+_0x35fc('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x1f5cbc[_0x35fc('0x1d')]['id']}})[_0x35fc('0xa')](function(_0x319033){if(_[_0x35fc('0x15')](_0x319033)){throw new Error(_0x19682e+_0x35fc('0x6d'));}_0x4f535a=_0x319033;return db[_0x19682e+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x1f5cbc[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x19682e+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x19682e+_0x169ea2],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x221c5b){if(_[_0x35fc('0x15')](_0x221c5b)){throw new Error(_0x19682e+'\x20Message\x20not\x20found');}_0x226fdf=_0x221c5b;return _0x221c5b[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4855ee={'uniqueid':_0x8fc410+'.'+_0x226fdf['id']+'.'+_0x226fdf[_0x35fc('0x70')]['id'],'FromUserId':_0x1f5cbc['user']['id'],'type':_0x35fc('0x72')};_0x4855ee[_0x19682e+_0x35fc('0x73')]=_0x226fdf['id'];_0x4855ee[_0x19682e+_0x35fc('0x74')]=_0x226fdf['Interaction']['id'];_0x4855ee[_0x35fc('0x75')+_0x19682e+_0x169ea2+'Id']=_0x226fdf[_0x35fc('0x6b')]['id'];_0x4855ee['To'+_0x19682e+_0x35fc('0x76')]=_0x4f535a['id'];return db[_0x19682e+_0x35fc('0x77')][_0x35fc('0x78')](_0x4855ee);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x8fc410,'interaction':_0x226fdf['Interaction'],'message':_0x226fdf,'account':_0x226fdf[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4f535a[_0x35fc('0x13')]+','+(_0x226fdf[_0x35fc('0x6b')][_0x35fc('0x79')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})['then'](respondWithResult(_0x35ef53,null))[_0x35fc('0xf')](handleError(_0x35ef53,null));};};exports[_0x35fc('0x7b')]=function(_0x312827,_0x47c507){var _0x128286,_0x175cc7;if(_[_0x35fc('0x15')](_0x312827['body']['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x32b9e1=_0x312827[_0x35fc('0x23')][_0x35fc('0x7c')];var _0x3858a9=_['capitalize'](_0x32b9e1);var _0x3ead4e=_0x32b9e1===_0x35fc('0x7d')?'Website':'Account';return db[_0x35fc('0x7e')][_0x35fc('0x6f')]({'raw':!![],'where':{'id':_0x312827[_0x35fc('0x1d')]['id'],'role':'agent'}})['then'](function(_0x134e60){if(_[_0x35fc('0x15')](_0x134e60)){throw new Error('Agent\x20not\x20found');}_0x128286=_0x134e60;return db[_0x3858a9+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x312827[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x3858a9+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x3858a9+_0x3ead4e],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x4fd676){if(_[_0x35fc('0x15')](_0x4fd676)){throw new Error(_0x3858a9+_0x35fc('0x7f'));}_0x175cc7=_0x4fd676;return _0x4fd676[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x96dfc={'uniqueid':_0x32b9e1+'.'+_0x175cc7['id']+'.'+_0x175cc7[_0x35fc('0x70')]['id'],'FromUserId':_0x312827[_0x35fc('0x32')]['id'],'type':'queue','ToUserId':_0x128286['id']};_0x96dfc[_0x3858a9+_0x35fc('0x73')]=_0x175cc7['id'];_0x96dfc[_0x3858a9+_0x35fc('0x74')]=_0x175cc7['Interaction']['id'];_0x96dfc[_0x35fc('0x75')+_0x3858a9+_0x3ead4e+'Id']=_0x175cc7[_0x35fc('0x6b')]['id'];return db[_0x3858a9+_0x35fc('0x77')][_0x35fc('0x78')](_0x96dfc);})[_0x35fc('0xa')](function(){return respondWithRpcPromise(_0x35fc('0x80'),{'channel':_0x32b9e1,'interaction':_0x175cc7[_0x35fc('0x70')],'message':_0x175cc7,'account':_0x175cc7[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x35fc('0x3c'),'appdata':_0x128286['name']+','+(_0x175cc7[_0x35fc('0x6b')][_0x35fc('0x81')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})[_0x35fc('0xa')](respondWithResult(_0x47c507,null))['catch'](handleError(_0x47c507,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index c010924..11b79f7 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 _0xa876=['run','post','create','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/run'];(function(_0x5113dc,_0x4ec48b){var _0x3ace28=function(_0x49a891){while(--_0x49a891){_0x5113dc['push'](_0x5113dc['shift']());}};_0x3ace28(++_0x4ec48b);}(_0xa876,0x133));var _0x6a87=function(_0x2b7780,_0x3fadcb){_0x2b7780=_0x2b7780-0x0;var _0x5826bd=_0xa876[_0x2b7780];return _0x5826bd;};'use strict';var multer=require('multer');var util=require(_0x6a87('0x0'));var path=require(_0x6a87('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a87('0x2'));var router=express[_0x6a87('0x3')]();var fs_extra=require(_0x6a87('0x4'));var auth=require(_0x6a87('0x5'));var interaction=require(_0x6a87('0x6'));var config=require(_0x6a87('0x7'));var controller=require('./schedule.controller');router[_0x6a87('0x8')]('/',auth[_0x6a87('0x9')](),controller[_0x6a87('0xa')]);router[_0x6a87('0x8')](_0x6a87('0xb'),auth[_0x6a87('0x9')](),controller['show']);router['get'](_0x6a87('0xc'),auth[_0x6a87('0x9')](),controller[_0x6a87('0xd')]);router[_0x6a87('0xe')]('/',auth[_0x6a87('0x9')](),controller[_0x6a87('0xf')]);router['put'](_0x6a87('0xb'),auth['isAuthenticated'](),controller[_0x6a87('0x10')]);router[_0x6a87('0x11')](_0x6a87('0xb'),auth[_0x6a87('0x9')](),controller[_0x6a87('0x12')]);module[_0x6a87('0x13')]=router; \ No newline at end of file +var _0x1616=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/run','run','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1befee,_0x1f0b9d){var _0x416eda=function(_0x62ce82){while(--_0x62ce82){_0x1befee['push'](_0x1befee['shift']());}};_0x416eda(++_0x1f0b9d);}(_0x1616,0xe0));var _0x6161=function(_0x1e1fe9,_0x216dd9){_0x1e1fe9=_0x1e1fe9-0x0;var _0x4eeb06=_0x1616[_0x1e1fe9];return _0x4eeb06;};'use strict';var multer=require(_0x6161('0x0'));var util=require(_0x6161('0x1'));var path=require(_0x6161('0x2'));var timeout=require(_0x6161('0x3'));var express=require(_0x6161('0x4'));var router=express[_0x6161('0x5')]();var fs_extra=require(_0x6161('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6161('0x7'));var config=require(_0x6161('0x8'));var controller=require('./schedule.controller');router[_0x6161('0x9')]('/',auth[_0x6161('0xa')](),controller[_0x6161('0xb')]);router[_0x6161('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6161('0xc')]);router[_0x6161('0x9')](_0x6161('0xd'),auth[_0x6161('0xa')](),controller[_0x6161('0xe')]);router['post']('/',auth[_0x6161('0xa')](),controller[_0x6161('0xf')]);router[_0x6161('0x10')](_0x6161('0x11'),auth[_0x6161('0xa')](),controller[_0x6161('0x12')]);router[_0x6161('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6161('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 96b74c4..eb22d13 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 _0xaa9b=['custom','default','TEXT','BOOLEAN','sequelize','STRING','0\x200\x20*\x20*\x20*','DATE','years','quarters','weeks','days','hours','minutes','csv','ENUM'];(function(_0x1ddbb5,_0x506c2e){var _0x42a370=function(_0x5bcbea){while(--_0x5bcbea){_0x1ddbb5['push'](_0x1ddbb5['shift']());}};_0x42a370(++_0x506c2e);}(_0xaa9b,0xc4));var _0xbaa9=function(_0x58f626,_0x5cadb3){_0x58f626=_0x58f626-0x0;var _0x25aa35=_0xaa9b[_0x58f626];return _0x25aa35;};'use strict';var Sequelize=require(_0xbaa9('0x0'));module['exports']={'name':{'type':Sequelize[_0xbaa9('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xbaa9('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xbaa9('0x1')],'allowNull':![],'defaultValue':_0xbaa9('0x2')},'startAt':{'type':Sequelize[_0xbaa9('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xbaa9('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xbaa9('0x4'),_0xbaa9('0x5'),'months',_0xbaa9('0x6'),_0xbaa9('0x7'),_0xbaa9('0x8'),_0xbaa9('0x9')),'allowNull':![],'defaultValue':_0xbaa9('0x7')},'output':{'type':Sequelize['ENUM'](_0xbaa9('0xa'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xbaa9('0xb')](_0xbaa9('0xc'),_0xbaa9('0xd')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xbaa9('0x1')]},'cc':{'type':Sequelize[_0xbaa9('0xe')]},'bcc':{'type':Sequelize[_0xbaa9('0xe')]},'sendIfEmpty':{'type':Sequelize[_0xbaa9('0xf')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa6ed=['ENUM','years','quarters','months','days','hours','minutes','pdf','xlsx','csv','custom','TEXT','sequelize','STRING','BOOLEAN','DATE','INTEGER'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0xa6ed,0x83));var _0xda6e=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xa6ed[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0xda6e('0x0'));module['exports']={'name':{'type':Sequelize[_0xda6e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xda6e('0x1')]},'active':{'type':Sequelize[_0xda6e('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xda6e('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xda6e('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xda6e('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xda6e('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xda6e('0x5')](_0xda6e('0x6'),_0xda6e('0x7'),_0xda6e('0x8'),'weeks',_0xda6e('0x9'),_0xda6e('0xa'),_0xda6e('0xb')),'allowNull':![],'defaultValue':_0xda6e('0x9')},'output':{'type':Sequelize[_0xda6e('0x5')]('csv',_0xda6e('0xc'),_0xda6e('0xd')),'allowNull':![],'defaultValue':_0xda6e('0xe')},'type':{'type':Sequelize[_0xda6e('0x5')](_0xda6e('0xf'),'default'),'allowNull':![],'defaultValue':_0xda6e('0xf')},'sendMail':{'type':Sequelize[_0xda6e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xda6e('0x1')]},'cc':{'type':Sequelize[_0xda6e('0x10')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xda6e('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 29dfc9d..e193286 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 _0x4422=['sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','name','send','index','map','Schedule','rawAttributes','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','intersection','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4422,0x8e));var _0x2442=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4422[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x2442('0x0'));var rimraf=require(_0x2442('0x1'));var zipdir=require(_0x2442('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2442('0x3'));var moment=require(_0x2442('0x4'));var BPromise=require(_0x2442('0x5'));var Mustache=require(_0x2442('0x6'));var util=require('util');var path=require(_0x2442('0x7'));var sox=require('sox');var csv=require(_0x2442('0x8'));var ejs=require(_0x2442('0x9'));var fs=require('fs');var fs_extra=require(_0x2442('0xa'));var _=require(_0x2442('0xb'));var squel=require(_0x2442('0xc'));var crypto=require(_0x2442('0xd'));var jsforce=require(_0x2442('0xe'));var deskjs=require(_0x2442('0xf'));var toCsv=require(_0x2442('0x8'));var querystring=require(_0x2442('0x10'));var Papa=require(_0x2442('0x11'));var Redis=require(_0x2442('0x12'));var authService=require(_0x2442('0x13'));var qs=require(_0x2442('0x14'));var as=require(_0x2442('0x15'));var hardwareService=require(_0x2442('0x16'));var logger=require(_0x2442('0x17'))(_0x2442('0x18'));var utils=require(_0x2442('0x19'));var config=require(_0x2442('0x1a'));var licenseUtil=require(_0x2442('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x197e3e,_0x28b911){_0x28b911=_0x28b911||0xcc;return function(_0x2b845d){if(_0x2b845d){return _0x197e3e[_0x2442('0x1c')](_0x28b911);}return _0x197e3e['status'](_0x28b911)[_0x2442('0x1d')]();};}function respondWithResult(_0x4b262b,_0xc55101){_0xc55101=_0xc55101||0xc8;return function(_0x5ca2f2){if(_0x5ca2f2){return _0x4b262b[_0x2442('0x1e')](_0xc55101)[_0x2442('0x1f')](_0x5ca2f2);}};}function respondWithFilteredResult(_0x3ecc33,_0x250020){return function(_0x15c6a5){if(_0x15c6a5){var _0x1fb808=typeof _0x250020[_0x2442('0x20')]==='undefined'&&typeof _0x250020[_0x2442('0x21')]===_0x2442('0x22');var _0x22e196=_0x15c6a5[_0x2442('0x23')];var _0x35c867=_0x1fb808?0x0:_0x250020['offset'];var _0x5538d3=_0x1fb808?_0x15c6a5[_0x2442('0x23')]:_0x250020[_0x2442('0x20')]+_0x250020[_0x2442('0x21')];var _0x2e5c03;if(_0x5538d3>=_0x22e196){_0x5538d3=_0x22e196;_0x2e5c03=0xc8;}else{_0x2e5c03=0xce;}_0x3ecc33[_0x2442('0x1e')](_0x2e5c03);return _0x3ecc33[_0x2442('0x24')](_0x2442('0x25'),_0x35c867+'-'+_0x5538d3+'/'+_0x22e196)[_0x2442('0x1f')](_0x15c6a5);}return null;};}function patchUpdates(_0x5043c8){return function(_0x30f930){try{jsonpatch[_0x2442('0x26')](_0x30f930,_0x5043c8,!![]);}catch(_0x41b6b4){return BPromise[_0x2442('0x27')](_0x41b6b4);}return _0x30f930[_0x2442('0x28')]();};}function saveUpdates(_0x59d2f9,_0x4c5e08){return function(_0x54d7aa){if(_0x54d7aa){return _0x54d7aa[_0x2442('0x29')](_0x59d2f9)[_0x2442('0x2a')](function(_0x23d38b){return _0x23d38b;});}return null;};}function removeEntity(_0x567170,_0x16eb49){return function(_0xf69654){if(_0xf69654){return _0xf69654[_0x2442('0x2b')]()[_0x2442('0x2a')](function(){var _0x38909e=_0xf69654[_0x2442('0x2c')]({'plain':!![]});var _0x215c5b=_0x2442('0x2d');return db[_0x2442('0x2e')]['destroy']({'where':{'type':_0x215c5b,'resourceId':_0x38909e['id']}})[_0x2442('0x2a')](function(){return _0xf69654;});})['then'](function(){_0x567170[_0x2442('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcd835,_0x57d2d6){return function(_0x32cf1d){if(!_0x32cf1d){_0xcd835[_0x2442('0x1c')](0x194);}return _0x32cf1d;};}function handleError(_0x401ea7,_0x5e5927){_0x5e5927=_0x5e5927||0x1f4;return function(_0x544ed2){logger['error'](_0x544ed2['stack']);if(_0x544ed2[_0x2442('0x2f')]){delete _0x544ed2['name'];}_0x401ea7['status'](_0x5e5927)[_0x2442('0x30')](_0x544ed2);};}exports[_0x2442('0x31')]=function(_0x1cec37,_0xc348f7){var _0x22428f={},_0x185cac={},_0x58fd34={'count':0x0,'rows':[]};var _0x39b5d5=_[_0x2442('0x32')](db[_0x2442('0x33')][_0x2442('0x34')],function(_0x197fb6){return{'name':_0x197fb6['fieldName'],'type':_0x197fb6[_0x2442('0x35')]['key']};});_0x185cac[_0x2442('0x36')]=_[_0x2442('0x32')](_0x39b5d5,_0x2442('0x2f'));_0x185cac[_0x2442('0x37')]=_['keys'](_0x1cec37['query']);_0x185cac[_0x2442('0x38')]=_['intersection'](_0x185cac['model'],_0x185cac['query']);_0x22428f[_0x2442('0x39')]=_['intersection'](_0x185cac['model'],qs[_0x2442('0x3a')](_0x1cec37[_0x2442('0x37')][_0x2442('0x3a')]));_0x22428f['attributes']=_0x22428f[_0x2442('0x39')][_0x2442('0x3b')]?_0x22428f[_0x2442('0x39')]:_0x185cac['model'];if(!_0x1cec37[_0x2442('0x37')][_0x2442('0x3c')](_0x2442('0x3d'))){_0x22428f['limit']=qs[_0x2442('0x21')](_0x1cec37['query']['limit']);_0x22428f[_0x2442('0x20')]=qs[_0x2442('0x20')](_0x1cec37[_0x2442('0x37')]['offset']);}_0x22428f['order']=qs[_0x2442('0x3e')](_0x1cec37[_0x2442('0x37')][_0x2442('0x3e')]);_0x22428f[_0x2442('0x3f')]=qs[_0x2442('0x38')](_['pick'](_0x1cec37['query'],_0x185cac[_0x2442('0x38')]),_0x39b5d5);if(_0x1cec37[_0x2442('0x37')][_0x2442('0x40')]){_0x22428f['where']=_[_0x2442('0x41')](_0x22428f[_0x2442('0x3f')],{'$or':_[_0x2442('0x32')](_0x39b5d5,function(_0x4d2ddc){if(_0x4d2ddc[_0x2442('0x35')]!==_0x2442('0x42')){var _0x4785c8={};_0x4785c8[_0x4d2ddc[_0x2442('0x2f')]]={'$like':'%'+_0x1cec37[_0x2442('0x37')][_0x2442('0x40')]+'%'};return _0x4785c8;}})});}_0x22428f=_[_0x2442('0x41')]({},_0x22428f,_0x1cec37['options']);var _0x31acff={'where':_0x22428f[_0x2442('0x3f')]};return db[_0x2442('0x33')][_0x2442('0x23')](_0x31acff)[_0x2442('0x2a')](function(_0x1c3389){_0x58fd34[_0x2442('0x23')]=_0x1c3389;if(_0x1cec37[_0x2442('0x37')][_0x2442('0x43')]){_0x22428f[_0x2442('0x44')]=[{'all':!![]}];}return db[_0x2442('0x33')][_0x2442('0x45')](_0x22428f);})['then'](function(_0x87b940){_0x58fd34['rows']=_0x87b940;return _0x58fd34;})[_0x2442('0x2a')](respondWithFilteredResult(_0xc348f7,_0x22428f))[_0x2442('0x46')](handleError(_0xc348f7,null));};exports[_0x2442('0x47')]=function(_0x1a697f,_0x56ab8e){var _0x7cb0b5={'raw':![],'where':{'id':_0x1a697f['params']['id']}},_0x241633={};_0x241633['model']=_[_0x2442('0x48')](db[_0x2442('0x33')]['rawAttributes']);_0x241633[_0x2442('0x37')]=_[_0x2442('0x48')](_0x1a697f[_0x2442('0x37')]);_0x241633[_0x2442('0x38')]=_[_0x2442('0x49')](_0x241633[_0x2442('0x36')],_0x241633['query']);_0x7cb0b5[_0x2442('0x39')]=_[_0x2442('0x49')](_0x241633[_0x2442('0x36')],qs['fields'](_0x1a697f[_0x2442('0x37')][_0x2442('0x3a')]));_0x7cb0b5[_0x2442('0x39')]=_0x7cb0b5[_0x2442('0x39')][_0x2442('0x3b')]?_0x7cb0b5['attributes']:_0x241633[_0x2442('0x36')];if(_0x1a697f[_0x2442('0x37')][_0x2442('0x43')]){_0x7cb0b5['include']=[{'all':!![]}];}_0x7cb0b5=_['merge']({},_0x7cb0b5,_0x1a697f[_0x2442('0x4a')]);return db[_0x2442('0x33')][_0x2442('0x4b')](_0x7cb0b5)[_0x2442('0x2a')](handleEntityNotFound(_0x56ab8e,null))['then'](respondWithResult(_0x56ab8e,null))['catch'](handleError(_0x56ab8e,null));};exports['create']=function(_0x4d3334,_0x122a5c){return db[_0x2442('0x33')][_0x2442('0x4c')](_0x4d3334['body'],{})['then'](function(_0x3c173f){var _0x30e658=_0x4d3334[_0x2442('0x4d')][_0x2442('0x2c')]({'plain':!![]});if(!_0x30e658)throw new Error(_0x2442('0x4e'));if(_0x30e658[_0x2442('0x4f')]==='user'){var _0x28db89=_0x3c173f[_0x2442('0x2c')]({'plain':!![]});var _0x30488b='Scheduler';return db['UserProfileSection'][_0x2442('0x4b')]({'where':{'name':_0x30488b,'userProfileId':_0x30e658['userProfileId']},'raw':!![]})[_0x2442('0x2a')](function(_0x597026){if(_0x597026&&_0x597026['autoAssociation']===0x0){return db[_0x2442('0x2e')][_0x2442('0x4c')]({'name':_0x28db89[_0x2442('0x2f')],'resourceId':_0x28db89['id'],'type':_0x597026[_0x2442('0x2f')],'sectionId':_0x597026['id']},{})[_0x2442('0x2a')](function(){return _0x3c173f;});}else{return _0x3c173f;}})[_0x2442('0x46')](function(_0x4a016d){logger[_0x2442('0x50')](_0x2442('0x51'),_0x4a016d);throw _0x4a016d;});}return _0x3c173f;})[_0x2442('0x2a')](respondWithResult(_0x122a5c,0xc9))['catch'](handleError(_0x122a5c,null));};exports[_0x2442('0x29')]=function(_0x1b563f,_0x17fc5b){if(_0x1b563f[_0x2442('0x52')]['id']){delete _0x1b563f[_0x2442('0x52')]['id'];}return db[_0x2442('0x33')][_0x2442('0x4b')]({'where':{'id':_0x1b563f[_0x2442('0x53')]['id']}})[_0x2442('0x2a')](handleEntityNotFound(_0x17fc5b,null))[_0x2442('0x2a')](saveUpdates(_0x1b563f[_0x2442('0x52')],null))[_0x2442('0x2a')](respondWithResult(_0x17fc5b,null))[_0x2442('0x46')](handleError(_0x17fc5b,null));};exports['destroy']=function(_0x1ae52b,_0x3287d0){return db['Schedule']['find']({'where':{'id':_0x1ae52b[_0x2442('0x53')]['id']}})[_0x2442('0x2a')](handleEntityNotFound(_0x3287d0,null))[_0x2442('0x2a')](removeEntity(_0x3287d0,null))[_0x2442('0x46')](handleError(_0x3287d0,null));};exports['run']=function(_0x583a40,_0x115157,_0x5f2cf1){var _0x59ff29=require('../../config/schedule');return db['Schedule'][_0x2442('0x4b')]({'where':{'id':_0x583a40['params']['id']},'raw':!![]})[_0x2442('0x2a')](handleEntityNotFound(_0x115157,null))['then'](function(){_0x59ff29[_0x2442('0x54')](_0x583a40[_0x2442('0x53')]['id']);})[_0x2442('0x2a')](respondWithStatusCode(_0x115157,null))[_0x2442('0x46')](handleError(_0x115157,null));}; \ No newline at end of file +var _0xcea8=['map','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','Schedule','findAll','rows','catch','show','rawAttributes','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','params','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','apply','save','update','destroy','then','get','Scheduler','UserProfileResource','error','name','send','index'];(function(_0x5b6e34,_0x59b7a0){var _0x325267=function(_0x342e8b){while(--_0x342e8b){_0x5b6e34['push'](_0x5b6e34['shift']());}};_0x325267(++_0x59b7a0);}(_0xcea8,0x1b7));var _0x8cea=function(_0x5950bd,_0x103e16){_0x5950bd=_0x5950bd-0x0;var _0x33e816=_0xcea8[_0x5950bd];return _0x33e816;};'use strict';var emlformat=require(_0x8cea('0x0'));var rimraf=require(_0x8cea('0x1'));var zipdir=require(_0x8cea('0x2'));var jsonpatch=require(_0x8cea('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8cea('0x4'));var Mustache=require(_0x8cea('0x5'));var util=require(_0x8cea('0x6'));var path=require(_0x8cea('0x7'));var sox=require(_0x8cea('0x8'));var csv=require(_0x8cea('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8cea('0xa'));var deskjs=require(_0x8cea('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8cea('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8cea('0xd'));var qs=require(_0x8cea('0xe'));var as=require(_0x8cea('0xf'));var hardwareService=require(_0x8cea('0x10'));var logger=require(_0x8cea('0x11'))(_0x8cea('0x12'));var utils=require('../../config/utils');var config=require(_0x8cea('0x13'));var licenseUtil=require(_0x8cea('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4efa56,_0x27888b){_0x27888b=_0x27888b||0xcc;return function(_0x2f5fdf){if(_0x2f5fdf){return _0x4efa56[_0x8cea('0x15')](_0x27888b);}return _0x4efa56['status'](_0x27888b)[_0x8cea('0x16')]();};}function respondWithResult(_0x773c48,_0xae5e56){_0xae5e56=_0xae5e56||0xc8;return function(_0x57f60e){if(_0x57f60e){return _0x773c48[_0x8cea('0x17')](_0xae5e56)[_0x8cea('0x18')](_0x57f60e);}};}function respondWithFilteredResult(_0x447dfd,_0x5974be){return function(_0x5dbbfe){if(_0x5dbbfe){var _0x45486d=typeof _0x5974be[_0x8cea('0x19')]==='undefined'&&typeof _0x5974be[_0x8cea('0x1a')]===_0x8cea('0x1b');var _0x13dfbf=_0x5dbbfe['count'];var _0x3a6441=_0x45486d?0x0:_0x5974be['offset'];var _0x2ce646=_0x45486d?_0x5dbbfe[_0x8cea('0x1c')]:_0x5974be[_0x8cea('0x19')]+_0x5974be[_0x8cea('0x1a')];var _0x2bb62d;if(_0x2ce646>=_0x13dfbf){_0x2ce646=_0x13dfbf;_0x2bb62d=0xc8;}else{_0x2bb62d=0xce;}_0x447dfd[_0x8cea('0x17')](_0x2bb62d);return _0x447dfd['set']('Content-Range',_0x3a6441+'-'+_0x2ce646+'/'+_0x13dfbf)[_0x8cea('0x18')](_0x5dbbfe);}return null;};}function patchUpdates(_0x1a20d8){return function(_0xea163f){try{jsonpatch[_0x8cea('0x1d')](_0xea163f,_0x1a20d8,!![]);}catch(_0x50c6b6){return BPromise['reject'](_0x50c6b6);}return _0xea163f[_0x8cea('0x1e')]();};}function saveUpdates(_0x4702e4,_0x1edcaa){return function(_0x1b2227){if(_0x1b2227){return _0x1b2227[_0x8cea('0x1f')](_0x4702e4)['then'](function(_0x3aa7c3){return _0x3aa7c3;});}return null;};}function removeEntity(_0x12aeaa,_0x28d6d8){return function(_0x2c9ba7){if(_0x2c9ba7){return _0x2c9ba7[_0x8cea('0x20')]()[_0x8cea('0x21')](function(){var _0x4f6958=_0x2c9ba7[_0x8cea('0x22')]({'plain':!![]});var _0x16e0f0=_0x8cea('0x23');return db[_0x8cea('0x24')][_0x8cea('0x20')]({'where':{'type':_0x16e0f0,'resourceId':_0x4f6958['id']}})[_0x8cea('0x21')](function(){return _0x2c9ba7;});})[_0x8cea('0x21')](function(){_0x12aeaa['status'](0xcc)[_0x8cea('0x16')]();});}};}function handleEntityNotFound(_0x1c1760,_0x160256){return function(_0x16f29f){if(!_0x16f29f){_0x1c1760['sendStatus'](0x194);}return _0x16f29f;};}function handleError(_0x535efd,_0x53e1ce){_0x53e1ce=_0x53e1ce||0x1f4;return function(_0x57c7bc){logger[_0x8cea('0x25')](_0x57c7bc['stack']);if(_0x57c7bc['name']){delete _0x57c7bc[_0x8cea('0x26')];}_0x535efd['status'](_0x53e1ce)[_0x8cea('0x27')](_0x57c7bc);};}exports[_0x8cea('0x28')]=function(_0x9731da,_0x5dbf72){var _0x5b718f={},_0x720c34={},_0x1ba076={'count':0x0,'rows':[]};var _0x5863cd=_[_0x8cea('0x29')](db['Schedule']['rawAttributes'],function(_0x178c8a){return{'name':_0x178c8a['fieldName'],'type':_0x178c8a['type'][_0x8cea('0x2a')]};});_0x720c34[_0x8cea('0x2b')]=_[_0x8cea('0x29')](_0x5863cd,'name');_0x720c34[_0x8cea('0x2c')]=_[_0x8cea('0x2d')](_0x9731da[_0x8cea('0x2c')]);_0x720c34[_0x8cea('0x2e')]=_[_0x8cea('0x2f')](_0x720c34[_0x8cea('0x2b')],_0x720c34['query']);_0x5b718f[_0x8cea('0x30')]=_[_0x8cea('0x2f')](_0x720c34[_0x8cea('0x2b')],qs[_0x8cea('0x31')](_0x9731da[_0x8cea('0x2c')]['fields']));_0x5b718f[_0x8cea('0x30')]=_0x5b718f[_0x8cea('0x30')]['length']?_0x5b718f[_0x8cea('0x30')]:_0x720c34[_0x8cea('0x2b')];if(!_0x9731da['query'][_0x8cea('0x32')](_0x8cea('0x33'))){_0x5b718f[_0x8cea('0x1a')]=qs['limit'](_0x9731da[_0x8cea('0x2c')][_0x8cea('0x1a')]);_0x5b718f[_0x8cea('0x19')]=qs[_0x8cea('0x19')](_0x9731da['query'][_0x8cea('0x19')]);}_0x5b718f[_0x8cea('0x34')]=qs[_0x8cea('0x35')](_0x9731da[_0x8cea('0x2c')][_0x8cea('0x35')]);_0x5b718f[_0x8cea('0x36')]=qs['filters'](_[_0x8cea('0x37')](_0x9731da[_0x8cea('0x2c')],_0x720c34[_0x8cea('0x2e')]),_0x5863cd);if(_0x9731da[_0x8cea('0x2c')][_0x8cea('0x38')]){_0x5b718f['where']=_[_0x8cea('0x39')](_0x5b718f[_0x8cea('0x36')],{'$or':_[_0x8cea('0x29')](_0x5863cd,function(_0x3a2585){if(_0x3a2585[_0x8cea('0x3a')]!==_0x8cea('0x3b')){var _0x128f70={};_0x128f70[_0x3a2585[_0x8cea('0x26')]]={'$like':'%'+_0x9731da['query'][_0x8cea('0x38')]+'%'};return _0x128f70;}})});}_0x5b718f=_[_0x8cea('0x39')]({},_0x5b718f,_0x9731da[_0x8cea('0x3c')]);var _0x4bc09f={'where':_0x5b718f['where']};return db['Schedule']['count'](_0x4bc09f)[_0x8cea('0x21')](function(_0x1aea82){_0x1ba076[_0x8cea('0x1c')]=_0x1aea82;if(_0x9731da[_0x8cea('0x2c')][_0x8cea('0x3d')]){_0x5b718f['include']=[{'all':!![]}];}return db[_0x8cea('0x3e')][_0x8cea('0x3f')](_0x5b718f);})[_0x8cea('0x21')](function(_0x4ed2cf){_0x1ba076[_0x8cea('0x40')]=_0x4ed2cf;return _0x1ba076;})[_0x8cea('0x21')](respondWithFilteredResult(_0x5dbf72,_0x5b718f))[_0x8cea('0x41')](handleError(_0x5dbf72,null));};exports[_0x8cea('0x42')]=function(_0x5be4fb,_0x122b48){var _0x396096={'raw':![],'where':{'id':_0x5be4fb['params']['id']}},_0x4cf54d={};_0x4cf54d[_0x8cea('0x2b')]=_['keys'](db[_0x8cea('0x3e')][_0x8cea('0x43')]);_0x4cf54d[_0x8cea('0x2c')]=_[_0x8cea('0x2d')](_0x5be4fb[_0x8cea('0x2c')]);_0x4cf54d[_0x8cea('0x2e')]=_[_0x8cea('0x2f')](_0x4cf54d[_0x8cea('0x2b')],_0x4cf54d[_0x8cea('0x2c')]);_0x396096[_0x8cea('0x30')]=_[_0x8cea('0x2f')](_0x4cf54d[_0x8cea('0x2b')],qs[_0x8cea('0x31')](_0x5be4fb['query'][_0x8cea('0x31')]));_0x396096[_0x8cea('0x30')]=_0x396096[_0x8cea('0x30')][_0x8cea('0x44')]?_0x396096[_0x8cea('0x30')]:_0x4cf54d['model'];if(_0x5be4fb[_0x8cea('0x2c')][_0x8cea('0x3d')]){_0x396096['include']=[{'all':!![]}];}_0x396096=_[_0x8cea('0x39')]({},_0x396096,_0x5be4fb[_0x8cea('0x3c')]);return db['Schedule'][_0x8cea('0x45')](_0x396096)[_0x8cea('0x21')](handleEntityNotFound(_0x122b48,null))['then'](respondWithResult(_0x122b48,null))[_0x8cea('0x41')](handleError(_0x122b48,null));};exports[_0x8cea('0x46')]=function(_0x407372,_0x472b41){return db[_0x8cea('0x3e')][_0x8cea('0x46')](_0x407372['body'],{})[_0x8cea('0x21')](function(_0x13affd){var _0x586f91=_0x407372['user']['get']({'plain':!![]});if(!_0x586f91)throw new Error(_0x8cea('0x47'));if(_0x586f91[_0x8cea('0x48')]===_0x8cea('0x49')){var _0x427b45=_0x13affd[_0x8cea('0x22')]({'plain':!![]});var _0xcb9d8b=_0x8cea('0x23');return db[_0x8cea('0x4a')]['find']({'where':{'name':_0xcb9d8b,'userProfileId':_0x586f91[_0x8cea('0x4b')]},'raw':!![]})[_0x8cea('0x21')](function(_0x5ece93){if(_0x5ece93&&_0x5ece93[_0x8cea('0x4c')]===0x0){return db[_0x8cea('0x24')][_0x8cea('0x46')]({'name':_0x427b45[_0x8cea('0x26')],'resourceId':_0x427b45['id'],'type':_0x5ece93[_0x8cea('0x26')],'sectionId':_0x5ece93['id']},{})['then'](function(){return _0x13affd;});}else{return _0x13affd;}})[_0x8cea('0x41')](function(_0x503f8e){logger[_0x8cea('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x503f8e);throw _0x503f8e;});}return _0x13affd;})[_0x8cea('0x21')](respondWithResult(_0x472b41,0xc9))[_0x8cea('0x41')](handleError(_0x472b41,null));};exports[_0x8cea('0x1f')]=function(_0x1f4c0e,_0x36fe4a){if(_0x1f4c0e[_0x8cea('0x4d')]['id']){delete _0x1f4c0e['body']['id'];}return db[_0x8cea('0x3e')][_0x8cea('0x45')]({'where':{'id':_0x1f4c0e[_0x8cea('0x4e')]['id']}})[_0x8cea('0x21')](handleEntityNotFound(_0x36fe4a,null))[_0x8cea('0x21')](saveUpdates(_0x1f4c0e[_0x8cea('0x4d')],null))[_0x8cea('0x21')](respondWithResult(_0x36fe4a,null))['catch'](handleError(_0x36fe4a,null));};exports[_0x8cea('0x20')]=function(_0x3e82e9,_0x4a63ad){return db[_0x8cea('0x3e')][_0x8cea('0x45')]({'where':{'id':_0x3e82e9[_0x8cea('0x4e')]['id']}})[_0x8cea('0x21')](handleEntityNotFound(_0x4a63ad,null))[_0x8cea('0x21')](removeEntity(_0x4a63ad,null))[_0x8cea('0x41')](handleError(_0x4a63ad,null));};exports['run']=function(_0x5751a9,_0xe926a1,_0x4bb5c6){var _0x1dd13a=require(_0x8cea('0x4f'));return db[_0x8cea('0x3e')]['find']({'where':{'id':_0x5751a9[_0x8cea('0x4e')]['id']},'raw':!![]})[_0x8cea('0x21')](handleEntityNotFound(_0xe926a1,null))[_0x8cea('0x21')](function(){_0x1dd13a['run'](_0x5751a9[_0x8cea('0x4e')]['id']);})[_0x8cea('0x21')](respondWithStatusCode(_0xe926a1,null))[_0x8cea('0x41')](handleError(_0xe926a1,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 994b098..f220ce6 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 _0xf15a=['Schedule','tools_schedules','lodash','util','../../config/logger','api','bluebird','path','rimraf','./schedule.attributes','exports'];(function(_0x962e9f,_0x2f30e5){var _0x1ea0d6=function(_0x577040){while(--_0x577040){_0x962e9f['push'](_0x962e9f['shift']());}};_0x1ea0d6(++_0x2f30e5);}(_0xf15a,0x16d));var _0xaf15=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf15a[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xaf15('0x0'));var util=require(_0xaf15('0x1'));var logger=require(_0xaf15('0x2'))(_0xaf15('0x3'));var moment=require('moment');var BPromise=require(_0xaf15('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf15('0x5'));var rimraf=require(_0xaf15('0x6'));var config=require('../../config/environment');var attributes=require(_0xaf15('0x7'));module[_0xaf15('0x8')]=function(_0x3429aa,_0x398c10){return _0x3429aa['define'](_0xaf15('0x9'),attributes,{'tableName':_0xaf15('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x615c=['../../config/logger','api','bluebird','request-promise','path','rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util'];(function(_0x1e2e34,_0x43c48b){var _0x5f549c=function(_0x2a5054){while(--_0x2a5054){_0x1e2e34['push'](_0x1e2e34['shift']());}};_0x5f549c(++_0x43c48b);}(_0x615c,0xc1));var _0xc615=function(_0x4aa9ed,_0x93e3a2){_0x4aa9ed=_0x4aa9ed-0x0;var _0x14c0a5=_0x615c[_0x4aa9ed];return _0x14c0a5;};'use strict';var _=require(_0xc615('0x0'));var util=require(_0xc615('0x1'));var logger=require(_0xc615('0x2'))(_0xc615('0x3'));var moment=require('moment');var BPromise=require(_0xc615('0x4'));var rp=require(_0xc615('0x5'));var fs=require('fs');var path=require(_0xc615('0x6'));var rimraf=require(_0xc615('0x7'));var config=require('../../config/environment');var attributes=require(_0xc615('0x8'));module[_0xc615('0x9')]=function(_0x6aaf9a,_0xb789a7){return _0x6aaf9a[_0xc615('0xa')](_0xc615('0xb'),attributes,{'tableName':_0xc615('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 6d2aa54..a284874 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 _0x32dd=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message'];(function(_0x1b48d1,_0x360842){var _0x233d5f=function(_0x35a665){while(--_0x35a665){_0x1b48d1['push'](_0x1b48d1['shift']());}};_0x233d5f(++_0x360842);}(_0x32dd,0xa2));var _0xd32d=function(_0xa16cc0,_0x217e43){_0xa16cc0=_0xa16cc0-0x0;var _0x5b7c04=_0x32dd[_0xa16cc0];return _0x5b7c04;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd32d('0x0'));var BPromise=require(_0xd32d('0x1'));var rs=require(_0xd32d('0x2'));var fs=require('fs');var Redis=require(_0xd32d('0x3'));var db=require(_0xd32d('0x4'))['db'];var utils=require(_0xd32d('0x5'));var logger=require(_0xd32d('0x6'))(_0xd32d('0x7'));var config=require(_0xd32d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd32d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34b7a6,_0x50eb04,_0x3e7dba){return new BPromise(function(_0x19d813,_0x2138d4){return client[_0xd32d('0xa')](_0x34b7a6,_0x3e7dba)[_0xd32d('0xb')](function(_0x5e86ec){logger['info']('Schedule,\x20%s,\x20%s',_0x50eb04,'request\x20sent');logger['debug'](_0xd32d('0xc'),_0x50eb04,'request\x20sent',JSON[_0xd32d('0xd')](_0x5e86ec));if(_0x5e86ec['error']){if(_0x5e86ec[_0xd32d('0xe')][_0xd32d('0xf')]===0x1f4){logger[_0xd32d('0xe')](_0xd32d('0x10'),_0x50eb04,_0x5e86ec['error']['message']);return _0x2138d4(_0x5e86ec[_0xd32d('0xe')][_0xd32d('0x11')]);}logger[_0xd32d('0xe')](_0xd32d('0x10'),_0x50eb04,_0x5e86ec['error'][_0xd32d('0x11')]);return _0x19d813(_0x5e86ec[_0xd32d('0xe')][_0xd32d('0x11')]);}else{logger['info'](_0xd32d('0x10'),_0x50eb04,'request\x20sent');_0x19d813(_0x5e86ec['result']['message']);}})['catch'](function(_0x1713ec){logger[_0xd32d('0xe')](_0xd32d('0x10'),_0x50eb04,_0x1713ec);_0x2138d4(_0x1713ec);});});} \ No newline at end of file +var _0x0b1b=['then','request\x20sent','debug','error','code','message','Schedule,\x20%s,\x20%s','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x334d1e,_0x28a488){var _0x3b33ba=function(_0x25afca){while(--_0x25afca){_0x334d1e['push'](_0x334d1e['shift']());}};_0x3b33ba(++_0x28a488);}(_0x0b1b,0x7f));var _0xb0b1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0b1b[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xb0b1('0x0'));var moment=require(_0xb0b1('0x1'));var BPromise=require(_0xb0b1('0x2'));var rs=require(_0xb0b1('0x3'));var fs=require('fs');var Redis=require(_0xb0b1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb0b1('0x5'));var logger=require(_0xb0b1('0x6'))(_0xb0b1('0x7'));var config=require('../../config/environment');var jayson=require(_0xb0b1('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x88b644,_0x1f7a03,_0x486123){return new BPromise(function(_0xf89454,_0x369051){return client['request'](_0x88b644,_0x486123)[_0xb0b1('0x9')](function(_0x1407db){logger['info']('Schedule,\x20%s,\x20%s',_0x1f7a03,_0xb0b1('0xa'));logger[_0xb0b1('0xb')]('Schedule,\x20%s,\x20%s,\x20%s',_0x1f7a03,_0xb0b1('0xa'),JSON['stringify'](_0x1407db));if(_0x1407db[_0xb0b1('0xc')]){if(_0x1407db['error'][_0xb0b1('0xd')]===0x1f4){logger[_0xb0b1('0xc')]('Schedule,\x20%s,\x20%s',_0x1f7a03,_0x1407db[_0xb0b1('0xc')][_0xb0b1('0xe')]);return _0x369051(_0x1407db[_0xb0b1('0xc')][_0xb0b1('0xe')]);}logger[_0xb0b1('0xc')](_0xb0b1('0xf'),_0x1f7a03,_0x1407db[_0xb0b1('0xc')][_0xb0b1('0xe')]);return _0xf89454(_0x1407db[_0xb0b1('0xc')]['message']);}else{logger['info'](_0xb0b1('0xf'),_0x1f7a03,'request\x20sent');_0xf89454(_0x1407db['result'][_0xb0b1('0xe')]);}})[_0xb0b1('0x10')](function(_0x53016e){logger[_0xb0b1('0xc')](_0xb0b1('0xf'),_0x1f7a03,_0x53016e);_0x369051(_0x53016e);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 315c190..d96917a 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 _0xe32e=['./screenRecording.controller','get','isAuthenticated','/describe','describe','/:id/download','download','post','create','put','/:id','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1dc80b,_0x44d1ec){var _0x46fdb9=function(_0x25074d){while(--_0x25074d){_0x1dc80b['push'](_0x1dc80b['shift']());}};_0x46fdb9(++_0x44d1ec);}(_0xe32e,0x14f));var _0xee32=function(_0x35cd5f,_0x331466){_0x35cd5f=_0x35cd5f-0x0;var _0x41657f=_0xe32e[_0x35cd5f];return _0x41657f;};'use strict';var multer=require(_0xee32('0x0'));var util=require(_0xee32('0x1'));var path=require('path');var timeout=require(_0xee32('0x2'));var express=require(_0xee32('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xee32('0x4'));var interaction=require(_0xee32('0x5'));var config=require(_0xee32('0x6'));var controller=require(_0xee32('0x7'));router[_0xee32('0x8')]('/',auth[_0xee32('0x9')](),controller['index']);router[_0xee32('0x8')](_0xee32('0xa'),auth[_0xee32('0x9')](),controller[_0xee32('0xb')]);router[_0xee32('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xee32('0x8')](_0xee32('0xc'),auth[_0xee32('0x9')](),controller[_0xee32('0xd')]);router[_0xee32('0xe')]('/',auth[_0xee32('0x9')](),controller[_0xee32('0xf')]);router[_0xee32('0x10')](_0xee32('0x11'),auth[_0xee32('0x9')](),controller['update']);router['delete'](_0xee32('0x11'),auth[_0xee32('0x9')](),controller[_0xee32('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3cfa=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','index','get','isAuthenticated','describe','/:id','/:id/download','download','post','create','put','update','delete','multer','util','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cfa,0x103));var _0xa3cf=function(_0x284e85,_0x52e5d7){_0x284e85=_0x284e85-0x0;var _0x5c7c0f=_0x3cfa[_0x284e85];return _0x5c7c0f;};'use strict';var multer=require(_0xa3cf('0x0'));var util=require(_0xa3cf('0x1'));var path=require(_0xa3cf('0x2'));var timeout=require('connect-timeout');var express=require(_0xa3cf('0x3'));var router=express[_0xa3cf('0x4')]();var fs_extra=require(_0xa3cf('0x5'));var auth=require(_0xa3cf('0x6'));var interaction=require(_0xa3cf('0x7'));var config=require(_0xa3cf('0x8'));var controller=require(_0xa3cf('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa3cf('0xa')]);router[_0xa3cf('0xb')]('/describe',auth[_0xa3cf('0xc')](),controller[_0xa3cf('0xd')]);router[_0xa3cf('0xb')](_0xa3cf('0xe'),auth[_0xa3cf('0xc')](),controller['show']);router['get'](_0xa3cf('0xf'),auth[_0xa3cf('0xc')](),controller[_0xa3cf('0x10')]);router[_0xa3cf('0x11')]('/',auth[_0xa3cf('0xc')](),controller[_0xa3cf('0x12')]);router[_0xa3cf('0x13')](_0xa3cf('0xe'),auth['isAuthenticated'](),controller[_0xa3cf('0x14')]);router[_0xa3cf('0x15')]('/:id',auth[_0xa3cf('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 0d5f06c..97b1148 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 _0x9e69=['getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm','updatedAt','moment','path','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e69,0x150));var _0x99e6=function(_0x52cc32,_0x31c7c3){_0x52cc32=_0x52cc32-0x0;var _0x1cdde1=_0x9e69[_0x52cc32];return _0x1cdde1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x99e6('0x0'));var path=require(_0x99e6('0x1'));var config=require(_0x99e6('0x2'));module[_0x99e6('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x99e6('0x4')](_0x99e6('0x5'))?path['extname'](this[_0x99e6('0x4')](_0x99e6('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x99e6('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x99e6('0x6')],'set':function(_0x3cf241){var _0x41635b=_0x3cf241['replace'](/\\/g,'/');this[_0x99e6('0x7')](_0x99e6('0x5'),_0x41635b);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x99e6('0x8')],'set':function(_0x133169){this['setDataValue'](_0x99e6('0x9'),moment()[_0x99e6('0xa')](_0x133169,'ms'));this['setDataValue']('closedAt',moment());this[_0x99e6('0x7')](_0x99e6('0xb'),_0x133169);}},'startedAt':{'type':Sequelize[_0x99e6('0xc')],'get':function(){return moment(this[_0x99e6('0x4')](_0x99e6('0x9')))[_0x99e6('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x99e6('0xe')]();}},'closedAt':{'type':Sequelize[_0x99e6('0xc')],'get':function(){return moment(this[_0x99e6('0x4')]('closedAt'))[_0x99e6('0xd')](_0x99e6('0xf'))[_0x99e6('0xe')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x99e6('0xd')](_0x99e6('0xf'))[_0x99e6('0xe')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x99e6('0x4')](_0x99e6('0x10')))[_0x99e6('0xd')](_0x99e6('0xf'))[_0x99e6('0xe')]();}}}; \ No newline at end of file +var _0x6629=['subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','DATE','toString','createdAt','updatedAt','sequelize','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','INTEGER','setDataValue','startedAt'];(function(_0x73ad54,_0x232d2e){var _0xd51acf=function(_0xb36cfe){while(--_0xb36cfe){_0x73ad54['push'](_0x73ad54['shift']());}};_0xd51acf(++_0x232d2e);}(_0x6629,0x1c2));var _0x9662=function(_0x2d0b22,_0x2b2227){_0x2d0b22=_0x2d0b22-0x0;var _0x3b5e90=_0x6629[_0x2d0b22];return _0x3b5e90;};'use strict';var Sequelize=require(_0x9662('0x0'));var moment=require('moment');var path=require('path');var config=require(_0x9662('0x1'));module[_0x9662('0x2')]={'format':{'type':Sequelize[_0x9662('0x3')],'get':function(){return this[_0x9662('0x4')]('value')?path[_0x9662('0x5')](this[_0x9662('0x4')](_0x9662('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9662('0x7')]},'value':{'type':Sequelize[_0x9662('0x7')],'set':function(_0x457681){var _0x5ec533=_0x457681[_0x9662('0x8')](/\\/g,'/');this['setDataValue'](_0x9662('0x6'),_0x5ec533);}},'rating':{'type':Sequelize[_0x9662('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9662('0x9')],'set':function(_0x11ae91){this[_0x9662('0xa')](_0x9662('0xb'),moment()[_0x9662('0xc')](_0x11ae91,'ms'));this[_0x9662('0xa')](_0x9662('0xd'),moment());this[_0x9662('0xa')](_0x9662('0xe'),_0x11ae91);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x9662('0x4')]('startedAt'))[_0x9662('0xf')](_0x9662('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x9662('0x11')],'get':function(){return moment(this[_0x9662('0x4')](_0x9662('0xd')))['format']('MM-DD-YYYY\x20HH:mm')[_0x9662('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x9662('0x4')](_0x9662('0x13')))[_0x9662('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x9662('0x4')](_0x9662('0x14')))['format'](_0x9662('0x10'))[_0x9662('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index c17bea5..53ac852 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 _0xabce=['sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','include','rows','includeAll','find','catch','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','recording','join','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then'];(function(_0x29f9af,_0x4f3d10){var _0x56e4a8=function(_0x2e2554){while(--_0x2e2554){_0x29f9af['push'](_0x29f9af['shift']());}};_0x56e4a8(++_0x4f3d10);}(_0xabce,0x103));var _0xeabc=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xabce[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}exports[_0xeabc('0x2a')]=function(_0x48fb52,_0x2163e6){var _0x38572d={},_0x2b568f={},_0x2f8633={'count':0x0,'rows':[]};var _0x149170=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')],function(_0x2915c1){return{'name':_0x2915c1['fieldName'],'type':_0x2915c1[_0xeabc('0x2e')]['key']};});_0x2b568f[_0xeabc('0x2f')]=_[_0xeabc('0x30')](_[_0xeabc('0x2b')](_0x149170,_0xeabc('0x28')),[_0xeabc('0x31')]);_0x2b568f[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x48fb52['query']);_0x2b568f[_0xeabc('0x34')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],_0x2b568f['query']);_0x38572d[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],qs['fields'](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x37')]));_0x38572d[_0xeabc('0x36')]=_0x38572d['attributes'][_0xeabc('0x38')]?_0x38572d[_0xeabc('0x36')]:_0x2b568f['model'];if(!_0x48fb52['query'][_0xeabc('0x39')](_0xeabc('0x3a'))){_0x38572d['limit']=qs[_0xeabc('0x1d')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x1d')]);_0x38572d[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x48fb52['query'][_0xeabc('0x1f')]);}_0x38572d['order']=qs[_0xeabc('0x3b')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x3b')]);_0x38572d['where']=qs['filters'](_[_0xeabc('0x3c')](_0x48fb52['query'],_0x2b568f[_0xeabc('0x34')]),_0x149170);if(_0x48fb52['query']['filter']){_0x38572d['where']=_['merge'](_0x38572d[_0xeabc('0x3d')],{'$or':_['map'](_0x149170,function(_0x257fe8){if(_0x257fe8[_0xeabc('0x2e')]!=='VIRTUAL'){var _0xe8fa6e={};_0xe8fa6e[_0x257fe8['name']]={'$like':'%'+_0x48fb52[_0xeabc('0x32')]['filter']+'%'};return _0xe8fa6e;}})});}_0x38572d=_[_0xeabc('0x3e')]({},_0x38572d,_0x48fb52[_0xeabc('0x3f')]);var _0xeeef02={'where':_0x38572d['where']};return db['ScreenRecording']['count'](_0xeeef02)[_0xeabc('0x25')](function(_0x23fb33){_0x2f8633[_0xeabc('0x1e')]=_0x23fb33;if(_0x48fb52['query']['includeAll']){_0x38572d[_0xeabc('0x40')]=[{'all':!![]}];}return db[_0xeabc('0x2c')]['findAll'](_0x38572d);})[_0xeabc('0x25')](function(_0x5e0b78){_0x2f8633[_0xeabc('0x41')]=_0x5e0b78;return _0x2f8633;})['then'](respondWithFilteredResult(_0x2163e6,_0x38572d))['catch'](handleError(_0x2163e6,null));};exports['show']=function(_0x25958b,_0x37c926){var _0xd03226={'raw':![],'where':{'id':_0x25958b['params']['id']}},_0x3eeeb5={};_0x3eeeb5[_0xeabc('0x2f')]=_['keys'](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x3eeeb5[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x25958b[_0xeabc('0x32')]);_0x3eeeb5['filters']=_['intersection'](_0x3eeeb5[_0xeabc('0x2f')],_0x3eeeb5['query']);_0xd03226[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x3eeeb5['model'],qs[_0xeabc('0x37')](_0x25958b[_0xeabc('0x32')][_0xeabc('0x37')]));_0xd03226[_0xeabc('0x36')]=_0xd03226[_0xeabc('0x36')][_0xeabc('0x38')]?_0xd03226[_0xeabc('0x36')]:_0x3eeeb5['model'];if(_0x25958b[_0xeabc('0x32')][_0xeabc('0x42')]){_0xd03226[_0xeabc('0x40')]=[{'all':!![]}];}_0xd03226=_[_0xeabc('0x3e')]({},_0xd03226,_0x25958b[_0xeabc('0x3f')]);return db[_0xeabc('0x2c')][_0xeabc('0x43')](_0xd03226)[_0xeabc('0x25')](handleEntityNotFound(_0x37c926,null))[_0xeabc('0x25')](respondWithResult(_0x37c926,null))[_0xeabc('0x44')](handleError(_0x37c926,null));};exports['create']=function(_0x38356c,_0x2e6efb){return db[_0xeabc('0x2c')][_0xeabc('0x45')](_0x38356c[_0xeabc('0x46')],{})[_0xeabc('0x25')](respondWithResult(_0x2e6efb,0xc9))[_0xeabc('0x44')](handleError(_0x2e6efb,null));};exports['update']=function(_0x766743,_0x32e09b){if(_0x766743[_0xeabc('0x46')]['id']){delete _0x766743[_0xeabc('0x46')]['id'];}delete _0x766743[_0xeabc('0x46')]['duration'];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x47')];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x48')];delete _0x766743['body'][_0xeabc('0x49')];return db[_0xeabc('0x2c')]['find']({'where':{'id':_0x766743[_0xeabc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32e09b,null))[_0xeabc('0x25')](saveUpdates(_0x766743['body'],null))[_0xeabc('0x25')](respondWithResult(_0x32e09b,null))[_0xeabc('0x44')](handleError(_0x32e09b,null));};exports[_0xeabc('0x4b')]=function(_0x1524c3,_0x1ee837){return db[_0xeabc('0x2c')][_0xeabc('0x4b')]()[_0xeabc('0x25')](respondWithResult(_0x1ee837,null))[_0xeabc('0x44')](handleError(_0x1ee837,null));};exports[_0xeabc('0x4c')]=function(_0x48a13f,_0x180a14,_0x2537ab){var _0x4072cb=require(_0xeabc('0x4d'));var _0x555d6b=![];var _0x1cef45={};if(_0x48a13f[_0xeabc('0x32')][_0xeabc('0x2e')]&&_0x48a13f[_0xeabc('0x32')]['type']===_0xeabc('0x4e')){_0x1cef45[_0xeabc('0x4e')]=_0x48a13f[_0xeabc('0x4a')]['id'];}else{_0x1cef45['id']=_0x48a13f[_0xeabc('0x4a')]['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':_0x1cef45,'attributes':['id',_0xeabc('0x49')],'raw':!![]})[_0xeabc('0x25')](handleEntityNotFound(_0x180a14,null))[_0xeabc('0x25')](function(_0x58ab08){if(_0x58ab08){var _0x4546c4=path['join'](config['root'],'server/files/screen_recordings',_0x58ab08[_0xeabc('0x49')]);var _0x8d4cca=util[_0xeabc('0x31')](_0xeabc('0x4f'),_0x4546c4);if(fs[_0xeabc('0x50')](_0x8d4cca)){_0x555d6b=!![];return _0x4072cb[_0xeabc('0x51')](_0x8d4cca,_0x4546c4,config['secrets'][_0xeabc('0x52')])[_0xeabc('0x25')](function(){return _0x58ab08;});}return _0x58ab08;}})[_0xeabc('0x25')](function(_0x104c1e){if(_0x104c1e){var _0x2ddc53=path[_0xeabc('0x53')](config[_0xeabc('0x54')],_0xeabc('0x55'),_0x104c1e['value']);if(!fs['existsSync'](_0x2ddc53)){throw new db[(_0xeabc('0x56'))][(_0xeabc('0x57'))](_0xeabc('0x58'));}if(_0x104c1e['filename']){return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,_0x104c1e['filename']+path['extname'](_0x2ddc53),function(){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}else{return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,function(_0x13f04f){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}}})[_0xeabc('0x44')](function(_0xc2ef0c){if(_0xc2ef0c['message']===_0xeabc('0x58')){_0x180a14[_0xeabc('0x1a')](0x194)[_0xeabc('0x29')](_0xeabc('0x5a'));}else{return handleError(_0x180a14,null);}});};exports[_0xeabc('0x5b')]=function(_0x514787,_0x5c61b4){return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':{'id':_0x514787[_0xeabc('0x4a')]['id']}})[_0xeabc('0x25')](function(_0x1b61a8){if(_[_0xeabc('0x5c')](_0x1b61a8)){throw new ReferenceError(_0xeabc('0x5d'));}return _0x1b61a8;})[_0xeabc('0x25')](function(_0x3f829b){var _0x54d2b3=path[_0xeabc('0x53')](config['root'],_0xeabc('0x55'),_0x3f829b[_0xeabc('0x49')]);logger[_0xeabc('0x5e')](_0xeabc('0x5f'),_0x54d2b3);if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger[_0xeabc('0x5e')](_0xeabc('0x60')+_0x54d2b3+_0xeabc('0x61'));fs['unlinkSync'](_0x54d2b3);}_0x54d2b3=_0x54d2b3+_0xeabc('0x62');if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger['info'](_0xeabc('0x60')+_0x54d2b3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x54d2b3);}return _0x3f829b;})[_0xeabc('0x25')](function(_0x11bc62){if(!_0x11bc62)throw new InternalError();return _0x11bc62[_0xeabc('0x5b')]();})[_0xeabc('0x25')](function(){_0x5c61b4['status'](0xcc)['end']();})[_0xeabc('0x44')](handleError(_0x5c61b4,null));}; \ No newline at end of file +var _0x55ca=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','moment','bluebird','util','path'];(function(_0x345784,_0x1e5bd8){var _0x40b8f2=function(_0x576b63){while(--_0x576b63){_0x345784['push'](_0x345784['shift']());}};_0x40b8f2(++_0x1e5bd8);}(_0x55ca,0x126));var _0xa55c=function(_0x3e1054,_0x345ece){_0x3e1054=_0x3e1054-0x0;var _0xa74ef6=_0x55ca[_0x3e1054];return _0xa74ef6;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_['map'](_0x201941,_0xa55c('0x25')),[_0xa55c('0x2e')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x906caa[_0xa55c('0x2f')]);_0x22f6b6[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2f')]);_0x1377b0[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x22f6b6['model'],qs['fields'](_0x906caa[_0xa55c('0x2f')][_0xa55c('0x34')]));_0x1377b0['attributes']=_0x1377b0[_0xa55c('0x33')][_0xa55c('0x35')]?_0x1377b0[_0xa55c('0x33')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2f')][_0xa55c('0x36')](_0xa55c('0x37'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa['query']['limit']);_0x1377b0['offset']=qs[_0xa55c('0x1a')](_0x906caa[_0xa55c('0x2f')][_0xa55c('0x1a')]);}_0x1377b0['order']=qs[_0xa55c('0x38')](_0x906caa['query'][_0xa55c('0x38')]);_0x1377b0['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x39')](_0x906caa[_0xa55c('0x2f')],_0x22f6b6['filters']),_0x201941);if(_0x906caa[_0xa55c('0x2f')][_0xa55c('0x3a')]){_0x1377b0['where']=_[_0xa55c('0x3b')](_0x1377b0[_0xa55c('0x3c')],{'$or':_['map'](_0x201941,function(_0x529ff8){if(_0x529ff8[_0xa55c('0x2a')]!=='VIRTUAL'){var _0x1e75dc={};_0x1e75dc[_0x529ff8[_0xa55c('0x25')]]={'$like':'%'+_0x906caa['query']['filter']+'%'};return _0x1e75dc;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x3b3308={'where':_0x1377b0[_0xa55c('0x3c')]};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x3b3308)[_0xa55c('0x20')](function(_0x56d17c){_0x1b8388[_0xa55c('0x1d')]=_0x56d17c;if(_0x906caa[_0xa55c('0x2f')][_0xa55c('0x3d')]){_0x1377b0[_0xa55c('0x3e')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0x1377b0);})['then'](function(_0x386e34){_0x1b8388['rows']=_0x386e34;return _0x1b8388;})['then'](respondWithFilteredResult(_0x5d940d,_0x1377b0))[_0xa55c('0x40')](handleError(_0x5d940d,null));};exports[_0xa55c('0x41')]=function(_0x496920,_0x2bd98b){var _0x508bd3={'raw':![],'where':{'id':_0x496920[_0xa55c('0x42')]['id']}},_0x5f25f7={};_0x5f25f7[_0xa55c('0x2c')]=_[_0xa55c('0x30')](db['ScreenRecording'][_0xa55c('0x43')]);_0x5f25f7[_0xa55c('0x2f')]=_['keys'](_0x496920[_0xa55c('0x2f')]);_0x5f25f7['filters']=_[_0xa55c('0x32')](_0x5f25f7[_0xa55c('0x2c')],_0x5f25f7['query']);_0x508bd3[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x5f25f7['model'],qs[_0xa55c('0x34')](_0x496920[_0xa55c('0x2f')][_0xa55c('0x34')]));_0x508bd3['attributes']=_0x508bd3[_0xa55c('0x33')]['length']?_0x508bd3[_0xa55c('0x33')]:_0x5f25f7[_0xa55c('0x2c')];if(_0x496920[_0xa55c('0x2f')]['includeAll']){_0x508bd3[_0xa55c('0x3e')]=[{'all':!![]}];}_0x508bd3=_[_0xa55c('0x3b')]({},_0x508bd3,_0x496920['options']);return db[_0xa55c('0x29')][_0xa55c('0x44')](_0x508bd3)['then'](handleEntityNotFound(_0x2bd98b,null))[_0xa55c('0x20')](respondWithResult(_0x2bd98b,null))[_0xa55c('0x40')](handleError(_0x2bd98b,null));};exports['create']=function(_0x46f839,_0x81cee8){return db[_0xa55c('0x29')][_0xa55c('0x45')](_0x46f839['body'],{})[_0xa55c('0x20')](respondWithResult(_0x81cee8,0xc9))['catch'](handleError(_0x81cee8,null));};exports[_0xa55c('0x1f')]=function(_0x213100,_0x194a79){if(_0x213100['body']['id']){delete _0x213100[_0xa55c('0x46')]['id'];}delete _0x213100[_0xa55c('0x46')]['duration'];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x47')];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x48')];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x49')];return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':{'id':_0x213100[_0xa55c('0x42')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x194a79,null))['then'](saveUpdates(_0x213100[_0xa55c('0x46')],null))[_0xa55c('0x20')](respondWithResult(_0x194a79,null))[_0xa55c('0x40')](handleError(_0x194a79,null));};exports['describe']=function(_0x4c3095,_0x35bf0a){return db['ScreenRecording'][_0xa55c('0x4a')]()['then'](respondWithResult(_0x35bf0a,null))[_0xa55c('0x40')](handleError(_0x35bf0a,null));};exports[_0xa55c('0x4b')]=function(_0x181802,_0x3f9313,_0x2ecf79){var _0x5b1cf3=require(_0xa55c('0x4c'));var _0x4607ca=![];var _0x4b85cc={};if(_0x181802[_0xa55c('0x2f')][_0xa55c('0x2a')]&&_0x181802[_0xa55c('0x2f')][_0xa55c('0x2a')]==='uniqueid'){_0x4b85cc['uniqueid']=_0x181802[_0xa55c('0x42')]['id'];}else{_0x4b85cc['id']=_0x181802[_0xa55c('0x42')]['id'];}return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':_0x4b85cc,'attributes':['id','value'],'raw':!![]})[_0xa55c('0x20')](handleEntityNotFound(_0x3f9313,null))['then'](function(_0x2742e4){if(_0x2742e4){var _0x437ced=path[_0xa55c('0x4d')](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x2742e4['value']);var _0x1cb73b=util['format'](_0xa55c('0x50'),_0x437ced);if(fs[_0xa55c('0x51')](_0x1cb73b)){_0x4607ca=!![];return _0x5b1cf3[_0xa55c('0x52')](_0x1cb73b,_0x437ced,config[_0xa55c('0x53')][_0xa55c('0x54')])[_0xa55c('0x20')](function(){return _0x2742e4;});}return _0x2742e4;}})[_0xa55c('0x20')](function(_0x53e2be){if(_0x53e2be){var _0x450567=path[_0xa55c('0x4d')](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x53e2be[_0xa55c('0x49')]);if(!fs['existsSync'](_0x450567)){throw new db[(_0xa55c('0x55'))][(_0xa55c('0x56'))](_0xa55c('0x57'));}if(_0x53e2be[_0xa55c('0x58')]){return _0x3f9313[_0xa55c('0x4b')](_0x450567,_0x53e2be['filename']+path[_0xa55c('0x59')](_0x450567),function(){if(_0x4607ca){fs[_0xa55c('0x5a')](_0x450567);}});}else{return _0x3f9313[_0xa55c('0x4b')](_0x450567,function(_0x16d9b2){if(_0x4607ca){fs[_0xa55c('0x5a')](_0x450567);}});}}})['catch'](function(_0x419fc3){if(_0x419fc3['message']===_0xa55c('0x57')){_0x3f9313['status'](0x194)[_0xa55c('0x26')]('Not\x20found');}else{return handleError(_0x3f9313,null);}});};exports[_0xa55c('0x5b')]=function(_0x1333da,_0x21d6b4){return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':{'id':_0x1333da[_0xa55c('0x42')]['id']}})[_0xa55c('0x20')](function(_0x2f2226){if(_[_0xa55c('0x5c')](_0x2f2226)){throw new ReferenceError(_0xa55c('0x5d'));}return _0x2f2226;})['then'](function(_0x150a07){var _0x311bb9=path['join'](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x150a07[_0xa55c('0x49')]);logger[_0xa55c('0x5e')](_0xa55c('0x5f'),_0x311bb9);if(!_[_0xa55c('0x5c')](_0x150a07[_0xa55c('0x49')])&&fs[_0xa55c('0x51')](_0x311bb9)){logger['info'](_0xa55c('0x60')+_0x311bb9+_0xa55c('0x61'));fs[_0xa55c('0x62')](_0x311bb9);}_0x311bb9=_0x311bb9+_0xa55c('0x63');if(!_[_0xa55c('0x5c')](_0x150a07[_0xa55c('0x49')])&&fs[_0xa55c('0x51')](_0x311bb9)){logger[_0xa55c('0x5e')](_0xa55c('0x60')+_0x311bb9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa55c('0x62')](_0x311bb9);}return _0x150a07;})[_0xa55c('0x20')](function(_0x40c56a){if(!_0x40c56a)throw new InternalError();return _0x40c56a[_0xa55c('0x5b')]();})[_0xa55c('0x20')](function(){_0x21d6b4[_0xa55c('0x18')](0xcc)[_0xa55c('0x21')]();})[_0xa55c('0x40')](handleError(_0x21d6b4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index b0c60ea..09813b2 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 _0x0be7=['moment','bluebird','../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','api'];(function(_0x3e4f74,_0x26ce71){var _0xd07d99=function(_0x2b09b0){while(--_0x2b09b0){_0x3e4f74['push'](_0x3e4f74['shift']());}};_0xd07d99(++_0x26ce71);}(_0x0be7,0x7d));var _0x70be=function(_0x41310d,_0x49f0d8){_0x41310d=_0x41310d-0x0;var _0x24d474=_0x0be7[_0x41310d];return _0x24d474;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x70be('0x0'));var moment=require(_0x70be('0x1'));var BPromise=require(_0x70be('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x70be('0x3'));var attributes=require('./screenRecording.attributes');module[_0x70be('0x4')]=function(_0x268871,_0xf82551){return _0x268871[_0x70be('0x5')](_0x70be('0x6'),attributes,{'tableName':_0x70be('0x7'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x70be('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4e7=['util','../../config/logger','api','request-promise','rimraf','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc4e7,0x1c7));var _0x7c4e=function(_0x43d8fd,_0x383960){_0x43d8fd=_0x43d8fd-0x0;var _0x12f797=_0xc4e7[_0x43d8fd];return _0x12f797;};'use strict';var _=require(_0x7c4e('0x0'));var util=require(_0x7c4e('0x1'));var logger=require(_0x7c4e('0x2'))(_0x7c4e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7c4e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c4e('0x5'));var config=require('../../config/environment');var attributes=require(_0x7c4e('0x6'));module[_0x7c4e('0x7')]=function(_0x38d1cb,_0x3ae348){return _0x38d1cb[_0x7c4e('0x8')](_0x7c4e('0x9'),attributes,{'tableName':_0x7c4e('0xa'),'paranoid':![],'indexes':[{'name':_0x7c4e('0xb'),'fields':[_0x7c4e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index afe872d..1d75f1a 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 _0x6e3c=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1d2626,_0x25802a){var _0x34bd56=function(_0x18dc8e){while(--_0x18dc8e){_0x1d2626['push'](_0x1d2626['shift']());}};_0x34bd56(++_0x25802a);}(_0x6e3c,0xd6));var _0xc6e3=function(_0x5b36bd,_0x4dfb36){_0x5b36bd=_0x5b36bd-0x0;var _0x1614fe=_0x6e3c[_0x5b36bd];return _0x1614fe;};'use strict';var _=require('lodash');var util=require(_0xc6e3('0x0'));var moment=require(_0xc6e3('0x1'));var BPromise=require(_0xc6e3('0x2'));var rs=require(_0xc6e3('0x3'));var fs=require('fs');var Redis=require(_0xc6e3('0x4'));var db=require(_0xc6e3('0x5'))['db'];var utils=require(_0xc6e3('0x6'));var logger=require(_0xc6e3('0x7'))('rpc');var config=require(_0xc6e3('0x8'));var jayson=require(_0xc6e3('0x9'));var client=jayson[_0xc6e3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x118ae2,_0x1649ed,_0x147d1e){return new BPromise(function(_0x2eb757,_0x5bb292){return client[_0xc6e3('0xb')](_0x118ae2,_0x147d1e)[_0xc6e3('0xc')](function(_0x3c4ef5){logger['info'](_0xc6e3('0xd'),_0x1649ed,'request\x20sent');logger[_0xc6e3('0xe')](_0xc6e3('0xf'),_0x1649ed,'request\x20sent',JSON[_0xc6e3('0x10')](_0x3c4ef5));if(_0x3c4ef5[_0xc6e3('0x11')]){if(_0x3c4ef5[_0xc6e3('0x11')][_0xc6e3('0x12')]===0x1f4){logger[_0xc6e3('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x1649ed,_0x3c4ef5[_0xc6e3('0x11')][_0xc6e3('0x13')]);return _0x5bb292(_0x3c4ef5['error'][_0xc6e3('0x13')]);}logger[_0xc6e3('0x11')](_0xc6e3('0xd'),_0x1649ed,_0x3c4ef5[_0xc6e3('0x11')][_0xc6e3('0x13')]);return _0x2eb757(_0x3c4ef5[_0xc6e3('0x11')][_0xc6e3('0x13')]);}else{logger['info'](_0xc6e3('0xd'),_0x1649ed,_0xc6e3('0x14'));_0x2eb757(_0x3c4ef5['result'][_0xc6e3('0x13')]);}})[_0xc6e3('0x15')](function(_0x3e38ac){logger[_0xc6e3('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x1649ed,_0x3e38ac);_0x5bb292(_0x3e38ac);});});} \ No newline at end of file +var _0x2311=['rpc','../../config/environment','jayson/promise','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3ec017,_0x4f33ee){var _0x47414d=function(_0x3e8be5){while(--_0x3e8be5){_0x3ec017['push'](_0x3ec017['shift']());}};_0x47414d(++_0x4f33ee);}(_0x2311,0x14f));var _0x1231=function(_0x2013ab,_0x10acee){_0x2013ab=_0x2013ab-0x0;var _0x54eb78=_0x2311[_0x2013ab];return _0x54eb78;};'use strict';var _=require(_0x1231('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1231('0x1'));var fs=require('fs');var Redis=require(_0x1231('0x2'));var db=require(_0x1231('0x3'))['db'];var utils=require(_0x1231('0x4'));var logger=require('../../config/logger')(_0x1231('0x5'));var config=require(_0x1231('0x6'));var jayson=require(_0x1231('0x7'));var client=jayson['client'][_0x1231('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38790a,_0x174ae4,_0x25829c){return new BPromise(function(_0x1fa3a4,_0x321177){return client[_0x1231('0x9')](_0x38790a,_0x25829c)[_0x1231('0xa')](function(_0x536953){logger[_0x1231('0xb')](_0x1231('0xc'),_0x174ae4,_0x1231('0xd'));logger[_0x1231('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x174ae4,_0x1231('0xd'),JSON[_0x1231('0xf')](_0x536953));if(_0x536953[_0x1231('0x10')]){if(_0x536953['error'][_0x1231('0x11')]===0x1f4){logger[_0x1231('0x10')](_0x1231('0xc'),_0x174ae4,_0x536953[_0x1231('0x10')][_0x1231('0x12')]);return _0x321177(_0x536953[_0x1231('0x10')][_0x1231('0x12')]);}logger[_0x1231('0x10')](_0x1231('0xc'),_0x174ae4,_0x536953[_0x1231('0x10')][_0x1231('0x12')]);return _0x1fa3a4(_0x536953['error'][_0x1231('0x12')]);}else{logger[_0x1231('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x174ae4,'request\x20sent');_0x1fa3a4(_0x536953[_0x1231('0x13')][_0x1231('0x12')]);}})['catch'](function(_0x3f8041){logger[_0x1231('0x10')](_0x1231('0xc'),_0x174ae4,_0x3f8041);_0x321177(_0x3f8041);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index a821940..c0f12d1 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 _0x129c=['./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','root','server/files/images/logos/','format','%s%s','logo','originalname','addLogo','join','logologin','extname','post','single','file','addLogoLogin','diskStorage','favicon','addFavicon','put','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x46293a,_0x4e06d8){var _0x4d4be9=function(_0x4ea21c){while(--_0x4ea21c){_0x46293a['push'](_0x46293a['shift']());}};_0x4d4be9(++_0x4e06d8);}(_0x129c,0x18d));var _0xc129=function(_0x5f5ada,_0x17adf4){_0x5f5ada=_0x5f5ada-0x0;var _0x3f45ba=_0x129c[_0x5f5ada];return _0x3f45ba;};'use strict';var multer=require(_0xc129('0x0'));var util=require(_0xc129('0x1'));var path=require('path');var timeout=require(_0xc129('0x2'));var express=require(_0xc129('0x3'));var router=express[_0xc129('0x4')]();var fs_extra=require(_0xc129('0x5'));var auth=require(_0xc129('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc129('0x7'));var controller=require(_0xc129('0x8'));router['get']('/',auth[_0xc129('0x9')](),controller[_0xc129('0xa')]);router[_0xc129('0xb')](_0xc129('0xc'),controller[_0xc129('0xd')]);router[_0xc129('0xb')](_0xc129('0xe'),controller[_0xc129('0xf')]);router[_0xc129('0xb')](_0xc129('0x10'),controller[_0xc129('0x11')]);router['get'](_0xc129('0x12'),controller[_0xc129('0x13')]);router[_0xc129('0xb')](_0xc129('0x14'),controller[_0xc129('0x15')]);router[_0xc129('0xb')](_0xc129('0x16'),controller[_0xc129('0x17')]);router['get'](_0xc129('0x18'),controller[_0xc129('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x20658a,_0x41d1b7,_0x191430){_0x191430(null,path['join'](config[_0xc129('0x1a')],_0xc129('0x1b')));},'filename':function(_0x2eb6c4,_0x1c16a9,_0x5120bb){_0x5120bb(null,util[_0xc129('0x1c')](_0xc129('0x1d'),_0xc129('0x1e'),path['extname'](_0x1c16a9[_0xc129('0x1f')])));}})});router['post'](_0xc129('0x10'),upload['single']('file'),controller[_0xc129('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54cedc,_0x2aa17f,_0x4ff816){_0x4ff816(null,path[_0xc129('0x21')](config[_0xc129('0x1a')],_0xc129('0x1b')));},'filename':function(_0x9727e7,_0x428320,_0x2e1989){_0x2e1989(null,util['format'](_0xc129('0x1d'),_0xc129('0x22'),path[_0xc129('0x23')](_0x428320[_0xc129('0x1f')])));}})});router[_0xc129('0x24')](_0xc129('0x12'),upload[_0xc129('0x25')](_0xc129('0x26')),controller[_0xc129('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b71b0,_0x5b7b30,_0x11a36f){_0x11a36f(null,path[_0xc129('0x21')](config[_0xc129('0x1a')],'server/files/images/logos/'));},'filename':function(_0x1ddddf,_0x28c424,_0x512a30){_0x512a30(null,util[_0xc129('0x1c')](_0xc129('0x1d'),'preferred',path[_0xc129('0x23')](_0x28c424[_0xc129('0x1f')])));}})});router[_0xc129('0x24')](_0xc129('0x16'),upload[_0xc129('0x25')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0xc129('0x28')]({'destination':function(_0x4e7613,_0xad26bb,_0x50f65a){_0x50f65a(null,path[_0xc129('0x21')](config[_0xc129('0x1a')],_0xc129('0x1b')));},'filename':function(_0x4fda41,_0x4c8f22,_0x5e721c){_0x5e721c(null,util[_0xc129('0x1c')](_0xc129('0x1d'),_0xc129('0x29'),path[_0xc129('0x23')](_0x4c8f22[_0xc129('0x1f')])));}})});router[_0xc129('0x24')](_0xc129('0x18'),upload['single'](_0xc129('0x26')),controller[_0xc129('0x2a')]);router[_0xc129('0x2b')](_0xc129('0xe'),auth[_0xc129('0x9')](),controller['update']);module[_0xc129('0x2c')]=router; \ No newline at end of file +var _0xf9e1=['post','single','file','addLogo','logologin','addLogoLogin','addPreferred','addFavicon','put','isAuthenticated','update','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname'];(function(_0x5ee244,_0x3cfee0){var _0x30f5c8=function(_0x55088d){while(--_0x55088d){_0x5ee244['push'](_0x5ee244['shift']());}};_0x30f5c8(++_0x3cfee0);}(_0xf9e1,0x123));var _0x1f9e=function(_0x3523c5,_0x13fb48){_0x3523c5=_0x3523c5-0x0;var _0x4c62c2=_0xf9e1[_0x3523c5];return _0x4c62c2;};'use strict';var multer=require(_0x1f9e('0x0'));var util=require(_0x1f9e('0x1'));var path=require('path');var timeout=require(_0x1f9e('0x2'));var express=require(_0x1f9e('0x3'));var router=express[_0x1f9e('0x4')]();var fs_extra=require(_0x1f9e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1f9e('0x6'));var config=require(_0x1f9e('0x7'));var controller=require('./setting.controller');router[_0x1f9e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1f9e('0x8')](_0x1f9e('0x9'),controller[_0x1f9e('0xa')]);router[_0x1f9e('0x8')](_0x1f9e('0xb'),controller[_0x1f9e('0xc')]);router['get'](_0x1f9e('0xd'),controller[_0x1f9e('0xe')]);router[_0x1f9e('0x8')](_0x1f9e('0xf'),controller['getLogoLogin']);router[_0x1f9e('0x8')](_0x1f9e('0x10'),controller[_0x1f9e('0x11')]);router['get'](_0x1f9e('0x12'),controller[_0x1f9e('0x13')]);router[_0x1f9e('0x8')]('/:id/favicon',controller[_0x1f9e('0x14')]);var upload=multer({'storage':multer[_0x1f9e('0x15')]({'destination':function(_0x464ca8,_0x112a87,_0x5e2ecc){_0x5e2ecc(null,path[_0x1f9e('0x16')](config[_0x1f9e('0x17')],_0x1f9e('0x18')));},'filename':function(_0xb79a2c,_0x60f8b8,_0x5b5188){_0x5b5188(null,util[_0x1f9e('0x19')](_0x1f9e('0x1a'),'logo',path[_0x1f9e('0x1b')](_0x60f8b8[_0x1f9e('0x1c')])));}})});router[_0x1f9e('0x1d')]('/:id/logo',upload[_0x1f9e('0x1e')](_0x1f9e('0x1f')),controller[_0x1f9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29fea2,_0xf363cb,_0x2334f4){_0x2334f4(null,path[_0x1f9e('0x16')](config[_0x1f9e('0x17')],_0x1f9e('0x18')));},'filename':function(_0x2e159c,_0x5e08b2,_0x2e08ab){_0x2e08ab(null,util[_0x1f9e('0x19')](_0x1f9e('0x1a'),_0x1f9e('0x21'),path['extname'](_0x5e08b2['originalname'])));}})});router[_0x1f9e('0x1d')](_0x1f9e('0xf'),upload[_0x1f9e('0x1e')](_0x1f9e('0x1f')),controller[_0x1f9e('0x22')]);var upload=multer({'storage':multer[_0x1f9e('0x15')]({'destination':function(_0x3418a2,_0x339135,_0x1c0b0d){_0x1c0b0d(null,path[_0x1f9e('0x16')](config[_0x1f9e('0x17')],'server/files/images/logos/'));},'filename':function(_0x546679,_0x3abe9d,_0x1d52fa){_0x1d52fa(null,util[_0x1f9e('0x19')](_0x1f9e('0x1a'),'preferred',path['extname'](_0x3abe9d[_0x1f9e('0x1c')])));}})});router[_0x1f9e('0x1d')](_0x1f9e('0x12'),upload[_0x1f9e('0x1e')](_0x1f9e('0x1f')),controller[_0x1f9e('0x23')]);var upload=multer({'storage':multer[_0x1f9e('0x15')]({'destination':function(_0x791ee9,_0x2b6ddc,_0x34af5c){_0x34af5c(null,path['join'](config[_0x1f9e('0x17')],_0x1f9e('0x18')));},'filename':function(_0x26df37,_0x281b0e,_0x2bc702){_0x2bc702(null,util[_0x1f9e('0x19')](_0x1f9e('0x1a'),'favicon',path[_0x1f9e('0x1b')](_0x281b0e[_0x1f9e('0x1c')])));}})});router[_0x1f9e('0x1d')]('/:id/favicon',upload['single'](_0x1f9e('0x1f')),controller[_0x1f9e('0x24')]);router[_0x1f9e('0x25')](_0x1f9e('0xb'),auth[_0x1f9e('0x26')](),controller[_0x1f9e('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index bd3fb5b..08b8e73 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(_0x136f6d,_0x426a62){var _0x1c2412=function(_0x678a2c){while(--_0x678a2c){_0x136f6d['push'](_0x136f6d['shift']());}};_0x1c2412(++_0x426a62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x261408,_0x213155){var _0x41cd82=function(_0x2135d8){while(--_0x2135d8){_0x261408['push'](_0x261408['shift']());}};_0x41cd82(++_0x213155);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index dd7d661..2f5e5f7 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 _0x8d3f=['../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Setting','includeAll','include','findAll','rows','show','params','find','body','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultPreferred','defaultFavicon','join','root','toLower','default','upperFirst','custom','default_logo.svg','existsSync','Sequelize','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','ValidationError','securePassword','addPreferred','preferred','getPreferred','defaultLogo','default_preferred.png','addFavicon','getFavicon','defaultLoginLogo','default_favicon.ico','getDate','now','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x481802,_0x19843e){var _0x36bdcf=function(_0x24f34e){while(--_0x24f34e){_0x481802['push'](_0x481802['shift']());}};_0x36bdcf(++_0x19843e);}(_0x8d3f,0x1e4));var _0xf8d3=function(_0x2fc38f,_0x4bd14f){_0x2fc38f=_0x2fc38f-0x0;var _0x405222=_0x8d3f[_0x2fc38f];return _0x405222;};'use strict';var emlformat=require(_0xf8d3('0x0'));var rimraf=require(_0xf8d3('0x1'));var zipdir=require(_0xf8d3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8d3('0x3'));var moment=require(_0xf8d3('0x4'));var BPromise=require(_0xf8d3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf8d3('0x6'));var sox=require(_0xf8d3('0x7'));var csv=require(_0xf8d3('0x8'));var ejs=require(_0xf8d3('0x9'));var fs=require('fs');var fs_extra=require(_0xf8d3('0xa'));var _=require(_0xf8d3('0xb'));var squel=require(_0xf8d3('0xc'));var crypto=require(_0xf8d3('0xd'));var jsforce=require(_0xf8d3('0xe'));var deskjs=require(_0xf8d3('0xf'));var toCsv=require(_0xf8d3('0x8'));var querystring=require(_0xf8d3('0x10'));var Papa=require(_0xf8d3('0x11'));var Redis=require(_0xf8d3('0x12'));var authService=require(_0xf8d3('0x13'));var qs=require(_0xf8d3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8d3('0x15'))(_0xf8d3('0x16'));var utils=require(_0xf8d3('0x17'));var config=require(_0xf8d3('0x18'));var licenseUtil=require(_0xf8d3('0x19'));var db=require(_0xf8d3('0x1a'))['db'];var jayson=require(_0xf8d3('0x1b'));var client=jayson[_0xf8d3('0x1c')][_0xf8d3('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4a7fb4,_0x373a60,_0x3bcfe8,_0x116979){return new BPromise(function(_0xccae3d,_0x1dfb13){var _0x25b9af=_0x116979||client;return _0x25b9af[_0xf8d3('0x1e')](_0x4a7fb4,_0x3bcfe8)['then'](function(_0xc52b4d){logger[_0xf8d3('0x1f')](_0xf8d3('0x20'),_0x373a60,'request\x20sent');logger[_0xf8d3('0x21')]('Setting,\x20%s,\x20%s,\x20%s',_0x373a60,_0xf8d3('0x22'),JSON[_0xf8d3('0x23')](_0xc52b4d));if(_0xc52b4d[_0xf8d3('0x24')]){if(_0xc52b4d[_0xf8d3('0x24')][_0xf8d3('0x25')]===0x1f4){logger['error'](_0xf8d3('0x20'),_0x373a60,_0xc52b4d['error'][_0xf8d3('0x26')]);return _0x1dfb13(_0xc52b4d[_0xf8d3('0x24')][_0xf8d3('0x26')]);}logger[_0xf8d3('0x24')](_0xf8d3('0x20'),_0x373a60,_0xc52b4d['error'][_0xf8d3('0x26')]);return _0xccae3d(_0xc52b4d['error']['message']);}else{logger[_0xf8d3('0x1f')](_0xf8d3('0x20'),_0x373a60,_0xf8d3('0x22'));_0xccae3d(_0xc52b4d[_0xf8d3('0x27')]['message']);}})[_0xf8d3('0x28')](function(_0x1abb38){logger['error']('Setting,\x20%s,\x20%s',_0x373a60,_0x1abb38);_0x1dfb13(_0x1abb38);});});}function respondWithStatusCode(_0x597a1e,_0x25c338){_0x25c338=_0x25c338||0xcc;return function(_0x25eebc){if(_0x25eebc){return _0x597a1e[_0xf8d3('0x29')](_0x25c338);}return _0x597a1e['status'](_0x25c338)[_0xf8d3('0x2a')]();};}function respondWithResult(_0x434656,_0x4d7736){_0x4d7736=_0x4d7736||0xc8;return function(_0x586730){if(_0x586730){return _0x434656[_0xf8d3('0x2b')](_0x4d7736)[_0xf8d3('0x2c')](_0x586730);}};}function respondWithFilteredResult(_0x5dda99,_0x489e36){return function(_0x1e298d){if(_0x1e298d){var _0x346465=typeof _0x489e36[_0xf8d3('0x2d')]==='undefined'&&typeof _0x489e36['limit']===_0xf8d3('0x2e');var _0x6bb6f8=_0x1e298d[_0xf8d3('0x2f')];var _0x73aa94=_0x346465?0x0:_0x489e36[_0xf8d3('0x2d')];var _0x16c5ae=_0x346465?_0x1e298d['count']:_0x489e36[_0xf8d3('0x2d')]+_0x489e36[_0xf8d3('0x30')];var _0x3672a7;if(_0x16c5ae>=_0x6bb6f8){_0x16c5ae=_0x6bb6f8;_0x3672a7=0xc8;}else{_0x3672a7=0xce;}_0x5dda99['status'](_0x3672a7);return _0x5dda99[_0xf8d3('0x31')]('Content-Range',_0x73aa94+'-'+_0x16c5ae+'/'+_0x6bb6f8)[_0xf8d3('0x2c')](_0x1e298d);}return null;};}function patchUpdates(_0xf67a56){return function(_0x5423ce){try{jsonpatch[_0xf8d3('0x32')](_0x5423ce,_0xf67a56,!![]);}catch(_0xa967f6){return BPromise[_0xf8d3('0x33')](_0xa967f6);}return _0x5423ce[_0xf8d3('0x34')]();};}function saveUpdates(_0x2de2ca,_0x4f8644){return function(_0x47c2e2){if(_0x47c2e2){return _0x47c2e2[_0xf8d3('0x35')](_0x2de2ca)[_0xf8d3('0x36')](function(_0x26f463){return _0x26f463;});}return null;};}function removeEntity(_0x478909,_0x19f5cf){return function(_0x21ccc0){if(_0x21ccc0){return _0x21ccc0['destroy']()[_0xf8d3('0x36')](function(){_0x478909['status'](0xcc)[_0xf8d3('0x2a')]();});}};}function handleEntityNotFound(_0x1f7c34,_0x579f10){return function(_0x3fd4fd){if(!_0x3fd4fd){_0x1f7c34[_0xf8d3('0x29')](0x194);}return _0x3fd4fd;};}function handleError(_0x10b078,_0x56132a){_0x56132a=_0x56132a||0x1f4;return function(_0x5f2281){logger['error'](_0x5f2281['stack']);if(_0x5f2281[_0xf8d3('0x37')]){delete _0x5f2281[_0xf8d3('0x37')];}_0x10b078[_0xf8d3('0x2b')](_0x56132a)[_0xf8d3('0x38')](_0x5f2281);};}exports['index']=function(_0x5bd3d7,_0x3e07b1){var _0x2cd205={},_0x35100c={},_0x14deba={'count':0x0,'rows':[]};var _0x1e7a2e=_[_0xf8d3('0x39')](db['Setting'][_0xf8d3('0x3a')],function(_0x33afdd){return{'name':_0x33afdd[_0xf8d3('0x3b')],'type':_0x33afdd[_0xf8d3('0x3c')]['key']};});_0x35100c[_0xf8d3('0x3d')]=_[_0xf8d3('0x39')](_0x1e7a2e,'name');_0x35100c[_0xf8d3('0x3e')]=_[_0xf8d3('0x3f')](_0x5bd3d7[_0xf8d3('0x3e')]);_0x35100c[_0xf8d3('0x40')]=_[_0xf8d3('0x41')](_0x35100c[_0xf8d3('0x3d')],_0x35100c[_0xf8d3('0x3e')]);_0x2cd205[_0xf8d3('0x42')]=_[_0xf8d3('0x41')](_0x35100c[_0xf8d3('0x3d')],qs[_0xf8d3('0x43')](_0x5bd3d7['query'][_0xf8d3('0x43')]));_0x2cd205['attributes']=_0x2cd205[_0xf8d3('0x42')][_0xf8d3('0x44')]?_0x2cd205[_0xf8d3('0x42')]:_0x35100c['model'];if(!_0x5bd3d7[_0xf8d3('0x3e')][_0xf8d3('0x45')](_0xf8d3('0x46'))){_0x2cd205[_0xf8d3('0x30')]=qs[_0xf8d3('0x30')](_0x5bd3d7[_0xf8d3('0x3e')][_0xf8d3('0x30')]);_0x2cd205['offset']=qs[_0xf8d3('0x2d')](_0x5bd3d7['query'][_0xf8d3('0x2d')]);}_0x2cd205[_0xf8d3('0x47')]=qs[_0xf8d3('0x48')](_0x5bd3d7['query'][_0xf8d3('0x48')]);_0x2cd205[_0xf8d3('0x49')]=qs[_0xf8d3('0x40')](_[_0xf8d3('0x4a')](_0x5bd3d7['query'],_0x35100c[_0xf8d3('0x40')]),_0x1e7a2e);if(_0x5bd3d7[_0xf8d3('0x3e')]['filter']){_0x2cd205[_0xf8d3('0x49')]=_[_0xf8d3('0x4b')](_0x2cd205[_0xf8d3('0x49')],{'$or':_[_0xf8d3('0x39')](_0x1e7a2e,function(_0x47189a){if(_0x47189a[_0xf8d3('0x3c')]!==_0xf8d3('0x4c')){var _0x488519={};_0x488519[_0x47189a[_0xf8d3('0x37')]]={'$like':'%'+_0x5bd3d7[_0xf8d3('0x3e')][_0xf8d3('0x4d')]+'%'};return _0x488519;}})});}_0x2cd205=_[_0xf8d3('0x4b')]({},_0x2cd205,_0x5bd3d7[_0xf8d3('0x4e')]);var _0x5ded52={'where':_0x2cd205['where']};return db[_0xf8d3('0x4f')][_0xf8d3('0x2f')](_0x5ded52)[_0xf8d3('0x36')](function(_0x3249aa){_0x14deba['count']=_0x3249aa;if(_0x5bd3d7[_0xf8d3('0x3e')][_0xf8d3('0x50')]){_0x2cd205[_0xf8d3('0x51')]=[{'all':!![]}];}return db['Setting'][_0xf8d3('0x52')](_0x2cd205);})[_0xf8d3('0x36')](function(_0x317b67){_0x14deba[_0xf8d3('0x53')]=_0x317b67;return _0x14deba;})[_0xf8d3('0x36')](respondWithFilteredResult(_0x3e07b1,_0x2cd205))[_0xf8d3('0x28')](handleError(_0x3e07b1,null));};exports[_0xf8d3('0x54')]=function(_0x819c7b,_0x4a0840){var _0x116f5e={'raw':![],'where':{'id':_0x819c7b[_0xf8d3('0x55')]['id']}},_0x3aefc9={};_0x3aefc9['model']=_[_0xf8d3('0x3f')](db[_0xf8d3('0x4f')]['rawAttributes']);_0x3aefc9[_0xf8d3('0x3e')]=_[_0xf8d3('0x3f')](_0x819c7b['query']);_0x3aefc9[_0xf8d3('0x40')]=_[_0xf8d3('0x41')](_0x3aefc9[_0xf8d3('0x3d')],_0x3aefc9[_0xf8d3('0x3e')]);_0x116f5e[_0xf8d3('0x42')]=_['intersection'](_0x3aefc9[_0xf8d3('0x3d')],qs[_0xf8d3('0x43')](_0x819c7b[_0xf8d3('0x3e')][_0xf8d3('0x43')]));_0x116f5e[_0xf8d3('0x42')]=_0x116f5e['attributes']['length']?_0x116f5e[_0xf8d3('0x42')]:_0x3aefc9['model'];if(_0x819c7b['query'][_0xf8d3('0x50')]){_0x116f5e[_0xf8d3('0x51')]=[{'all':!![]}];}_0x116f5e=_[_0xf8d3('0x4b')]({},_0x116f5e,_0x819c7b[_0xf8d3('0x4e')]);return db[_0xf8d3('0x4f')][_0xf8d3('0x56')](_0x116f5e)['then'](handleEntityNotFound(_0x4a0840,null))[_0xf8d3('0x36')](respondWithResult(_0x4a0840,null))[_0xf8d3('0x28')](handleError(_0x4a0840,null));};exports[_0xf8d3('0x35')]=function(_0x360e0c,_0x540256){if(_0x360e0c['body']['id']){delete _0x360e0c[_0xf8d3('0x57')]['id'];}return db[_0xf8d3('0x4f')][_0xf8d3('0x56')]({'where':{'id':_0x360e0c[_0xf8d3('0x55')]['id']}})[_0xf8d3('0x36')](handleEntityNotFound(_0x540256,null))['then'](saveUpdates(_0x360e0c[_0xf8d3('0x57')],null))['then'](respondWithResult(_0x540256,null))['catch'](handleError(_0x540256,null));};exports['addLogo']=function(_0x5a362d,_0x58a2da,_0x382486){if(_0x5a362d['file']&&_0x5a362d[_0xf8d3('0x58')][_0xf8d3('0x59')]){_0x5a362d[_0xf8d3('0x57')][_0xf8d3('0x5a')]=_0x5a362d[_0xf8d3('0x58')][_0xf8d3('0x59')];}return db[_0xf8d3('0x4f')][_0xf8d3('0x56')]({'where':{'id':_0x5a362d[_0xf8d3('0x55')]['id']}})[_0xf8d3('0x36')](handleEntityNotFound(_0x58a2da,null))['then'](saveUpdates(_0x5a362d[_0xf8d3('0x57')],null))['then'](respondWithResult(_0x58a2da,null))['catch'](handleError(_0x58a2da,null));};exports[_0xf8d3('0x5b')]=function(_0x63780,_0xfa0a8,_0x50faf7){if(_0x63780[_0xf8d3('0x58')]&&_0x63780[_0xf8d3('0x58')][_0xf8d3('0x59')]){_0x63780['body'][_0xf8d3('0x5c')]=_0x63780['file'][_0xf8d3('0x59')];}return db[_0xf8d3('0x4f')][_0xf8d3('0x56')]({'where':{'id':_0x63780[_0xf8d3('0x55')]['id']}})[_0xf8d3('0x36')](handleEntityNotFound(_0xfa0a8,null))['then'](saveUpdates(_0x63780[_0xf8d3('0x57')],null))[_0xf8d3('0x36')](respondWithResult(_0xfa0a8,null))[_0xf8d3('0x28')](handleError(_0xfa0a8,null));};var utilLicense=require(_0xf8d3('0x19'));exports[_0xf8d3('0x5d')]=function(_0x45faa4,_0x43b976,_0x4c0679){var _0x4073d6=_0xf8d3('0x5e');var _0x29f1a2={'custom':![]};return utilLicense[_0xf8d3('0x5f')]()[_0xf8d3('0x36')](function(_0x32f404){if(_0x32f404){_0x29f1a2=_0x32f404;}return db['Setting'][_0xf8d3('0x56')]({'where':{'id':_0x45faa4['params']['id']},'attributes':[_0xf8d3('0x5a'),_0xf8d3('0x5c'),'preferred',_0xf8d3('0x60'),'defaultLogo','defaultLoginLogo',_0xf8d3('0x61'),_0xf8d3('0x62')],'raw':!![]});})[_0xf8d3('0x36')](handleEntityNotFound(_0x43b976,null))['then'](function(_0x3373db){if(_0x3373db){var _0x4e1229=_0x3373db['logo']&&fs['existsSync'](path[_0xf8d3('0x63')](config[_0xf8d3('0x64')],_0x4073d6,_[_0xf8d3('0x65')](_0x3373db[_0xf8d3('0x5a')])))?path[_0xf8d3('0x63')](config[_0xf8d3('0x64')],_0x4073d6,_[_0xf8d3('0x65')](_0x3373db['logo'])):path[_0xf8d3('0x63')](config[_0xf8d3('0x64')],_0x4073d6,_[_0xf8d3('0x65')]('default_logo.svg'));var _0xe718e0=_0xf8d3('0x66')+_[_0xf8d3('0x67')]('logo');if(_0x3373db[_0xe718e0]||!_0x29f1a2[_0xf8d3('0x68')]){_0x4e1229=path[_0xf8d3('0x63')](config[_0xf8d3('0x64')],_0x4073d6,_[_0xf8d3('0x65')](_0xf8d3('0x69')));}if(!fs[_0xf8d3('0x6a')](_0x4e1229)){throw new db[(_0xf8d3('0x6b'))]['ValidationError'](_[_0xf8d3('0x67')](_0xf8d3('0x5a'))+_0xf8d3('0x6c'));}return _0x43b976[_0xf8d3('0x6d')](_0x4e1229);}})[_0xf8d3('0x28')](handleError(_0x43b976,null));};var utilLicense=require('../../config/license/util');exports[_0xf8d3('0x6e')]=function(_0x2e18ea,_0x503ddf,_0x43af5f){var _0x2f3fa0=_0xf8d3('0x5e');var _0x9a6e62={'custom':![]};return utilLicense[_0xf8d3('0x5f')]()[_0xf8d3('0x36')](function(_0x2cebba){if(_0x2cebba){_0x9a6e62=_0x2cebba;}return db[_0xf8d3('0x4f')][_0xf8d3('0x56')]({'where':{'id':_0x2e18ea['params']['id']},'attributes':[_0xf8d3('0x5a'),'loginLogo','preferred',_0xf8d3('0x60'),'defaultLogo','defaultLoginLogo',_0xf8d3('0x61'),_0xf8d3('0x62')],'raw':!![]});})[_0xf8d3('0x36')](handleEntityNotFound(_0x503ddf,null))['then'](function(_0x52bafc){if(_0x52bafc){var _0x3ad57c=_0x52bafc[_0xf8d3('0x5c')]&&fs[_0xf8d3('0x6a')](path['join'](config[_0xf8d3('0x64')],_0x2f3fa0,_['toLower'](_0x52bafc['loginLogo'])))?path[_0xf8d3('0x63')](config[_0xf8d3('0x64')],_0x2f3fa0,_[_0xf8d3('0x65')](_0x52bafc[_0xf8d3('0x5c')])):path[_0xf8d3('0x63')](config['root'],_0x2f3fa0,_[_0xf8d3('0x65')](_0xf8d3('0x6f')));var _0x146f0f=_0xf8d3('0x66')+_[_0xf8d3('0x67')](_0xf8d3('0x5c'));if(_0x52bafc[_0x146f0f]||!_0x9a6e62[_0xf8d3('0x68')]){_0x3ad57c=path[_0xf8d3('0x63')](config[_0xf8d3('0x64')],_0x2f3fa0,_['toLower'](_0xf8d3('0x6f')));}if(!fs[_0xf8d3('0x6a')](_0x3ad57c)){throw new db[(_0xf8d3('0x6b'))][(_0xf8d3('0x70'))](_['upperFirst'](_0xf8d3('0x5c'))+_0xf8d3('0x6c'));}return _0x503ddf[_0xf8d3('0x6d')](_0x3ad57c);}})['catch'](handleError(_0x503ddf,null));};exports['gdpr']=function(_0x264440,_0x289d6a){return db[_0xf8d3('0x4f')][_0xf8d3('0x56')]({'where':{'id':_0x264440['params']['id']},'attributes':[_0xf8d3('0x71')]})[_0xf8d3('0x36')](respondWithResult(_0x289d6a,null))[_0xf8d3('0x28')](handleError(_0x289d6a,null));};exports[_0xf8d3('0x72')]=function(_0x443e2b,_0xe55db1,_0x432f61){if(_0x443e2b[_0xf8d3('0x58')]&&_0x443e2b[_0xf8d3('0x58')][_0xf8d3('0x59')]){_0x443e2b[_0xf8d3('0x57')][_0xf8d3('0x73')]=_0x443e2b[_0xf8d3('0x58')]['filename'];}return db[_0xf8d3('0x4f')]['find']({'where':{'id':_0x443e2b[_0xf8d3('0x55')]['id']}})[_0xf8d3('0x36')](handleEntityNotFound(_0xe55db1,null))['then'](saveUpdates(_0x443e2b[_0xf8d3('0x57')],null))['then'](respondWithResult(_0xe55db1,null))[_0xf8d3('0x28')](handleError(_0xe55db1,null));};var utilLicense=require(_0xf8d3('0x19'));exports[_0xf8d3('0x74')]=function(_0x5f17a3,_0x13b9d5,_0xa225b5){var _0x7cfe68=_0xf8d3('0x5e');var _0x2f8b7f={'custom':![]};return utilLicense[_0xf8d3('0x5f')]()[_0xf8d3('0x36')](function(_0x4c0adc){if(_0x4c0adc){_0x2f8b7f=_0x4c0adc;}return db['Setting'][_0xf8d3('0x56')]({'where':{'id':_0x5f17a3[_0xf8d3('0x55')]['id']},'attributes':['logo',_0xf8d3('0x5c'),_0xf8d3('0x73'),'favicon',_0xf8d3('0x75'),'defaultLoginLogo','defaultPreferred',_0xf8d3('0x62')],'raw':!![]});})['then'](handleEntityNotFound(_0x13b9d5,null))[_0xf8d3('0x36')](function(_0x2555cd){if(_0x2555cd){var _0x3fcce9=_0x2555cd['preferred']&&fs[_0xf8d3('0x6a')](path['join'](config[_0xf8d3('0x64')],_0x7cfe68,_[_0xf8d3('0x65')](_0x2555cd[_0xf8d3('0x73')])))?path[_0xf8d3('0x63')](config['root'],_0x7cfe68,_[_0xf8d3('0x65')](_0x2555cd[_0xf8d3('0x73')])):path[_0xf8d3('0x63')](config[_0xf8d3('0x64')],_0x7cfe68,_['toLower'](_0xf8d3('0x76')));var _0x10f905=_0xf8d3('0x66')+_[_0xf8d3('0x67')](_0xf8d3('0x73'));if(_0x2555cd[_0x10f905]||!_0x2f8b7f[_0xf8d3('0x68')]||!_0x2f8b7f[_0xf8d3('0x73')]){_0x3fcce9=path[_0xf8d3('0x63')](config[_0xf8d3('0x64')],_0x7cfe68,_[_0xf8d3('0x65')](_0xf8d3('0x76')));}if(!fs[_0xf8d3('0x6a')](_0x3fcce9)){throw new db[(_0xf8d3('0x6b'))]['ValidationError'](_[_0xf8d3('0x67')](_0xf8d3('0x73'))+'\x20not\x20found');}return _0x13b9d5[_0xf8d3('0x6d')](_0x3fcce9);}})[_0xf8d3('0x28')](handleError(_0x13b9d5,null));};exports[_0xf8d3('0x77')]=function(_0x3397e1,_0x13cc18,_0x301d91){if(_0x3397e1[_0xf8d3('0x58')]&&_0x3397e1[_0xf8d3('0x58')]['filename']){_0x3397e1['body'][_0xf8d3('0x60')]=_0x3397e1[_0xf8d3('0x58')][_0xf8d3('0x59')];}return db[_0xf8d3('0x4f')][_0xf8d3('0x56')]({'where':{'id':_0x3397e1[_0xf8d3('0x55')]['id']}})[_0xf8d3('0x36')](handleEntityNotFound(_0x13cc18,null))[_0xf8d3('0x36')](saveUpdates(_0x3397e1['body'],null))[_0xf8d3('0x36')](respondWithResult(_0x13cc18,null))['catch'](handleError(_0x13cc18,null));};var utilLicense=require(_0xf8d3('0x19'));exports[_0xf8d3('0x78')]=function(_0x26bfc7,_0x2fd28a,_0x4cfb3d){var _0x4a5b62=_0xf8d3('0x5e');var _0x2841d7={'custom':![]};return utilLicense['getLicense']()[_0xf8d3('0x36')](function(_0x102dab){if(_0x102dab){_0x2841d7=_0x102dab;}return db[_0xf8d3('0x4f')][_0xf8d3('0x56')]({'where':{'id':_0x26bfc7['params']['id']},'attributes':['logo',_0xf8d3('0x5c'),_0xf8d3('0x73'),_0xf8d3('0x60'),_0xf8d3('0x75'),_0xf8d3('0x79'),_0xf8d3('0x61'),_0xf8d3('0x62')],'raw':!![]});})[_0xf8d3('0x36')](handleEntityNotFound(_0x2fd28a,null))[_0xf8d3('0x36')](function(_0x688e61){if(_0x688e61){var _0xfc672a=_0x688e61[_0xf8d3('0x60')]&&fs[_0xf8d3('0x6a')](path[_0xf8d3('0x63')](config[_0xf8d3('0x64')],_0x4a5b62,_['toLower'](_0x688e61[_0xf8d3('0x60')])))?path[_0xf8d3('0x63')](config[_0xf8d3('0x64')],_0x4a5b62,_[_0xf8d3('0x65')](_0x688e61[_0xf8d3('0x60')])):path[_0xf8d3('0x63')](config[_0xf8d3('0x64')],_0x4a5b62,_['toLower'](_0xf8d3('0x7a')));var _0x39c0bf=_0xf8d3('0x66')+_[_0xf8d3('0x67')](_0xf8d3('0x60'));if(_0x688e61[_0x39c0bf]||!_0x2841d7[_0xf8d3('0x68')]){_0xfc672a=path[_0xf8d3('0x63')](config['root'],_0x4a5b62,_[_0xf8d3('0x65')](_0xf8d3('0x7a')));}if(!fs[_0xf8d3('0x6a')](_0xfc672a)){throw new db['Sequelize'][(_0xf8d3('0x70'))](_[_0xf8d3('0x67')](_0xf8d3('0x60'))+_0xf8d3('0x6c'));}return _0x2fd28a[_0xf8d3('0x6d')](_0xfc672a);}})['catch'](handleError(_0x2fd28a,null));};exports[_0xf8d3('0x7b')]=function(_0x26b840,_0x4310b2){var _0x4157c3={'offset':moment()['utcOffset']()};_0x4157c3[_0xf8d3('0x7c')]=moment()[_0xf8d3('0x7d')](_0x4157c3['offset'])['format'](_0xf8d3('0x7e'));return _0x4310b2[_0xf8d3('0x2b')](0xc8)[_0xf8d3('0x38')](_0x4157c3);}; \ No newline at end of file +var _0xc805=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','Setting','includeAll','include','findAll','rows','params','length','find','update','body','addLogo','file','filename','logo','addLogoLogin','getLogo','getLicense','preferred','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','ValidationError','download','getLogoLogin','server/files/images/logos','defaultLogo','loginLogo','default_loginLogo.svg','default','Sequelize','gdpr','addPreferred','default_preferred.png','\x20not\x20found','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send'];(function(_0x38eb22,_0x458a8c){var _0x49553e=function(_0x2879fd){while(--_0x2879fd){_0x38eb22['push'](_0x38eb22['shift']());}};_0x49553e(++_0x458a8c);}(_0xc805,0x171));var _0x5c80=function(_0x347399,_0x42bbda){_0x347399=_0x347399-0x0;var _0x24e7be=_0xc805[_0x347399];return _0x24e7be;};'use strict';var emlformat=require(_0x5c80('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c80('0x1'));var jsonpatch=require(_0x5c80('0x2'));var rp=require(_0x5c80('0x3'));var moment=require(_0x5c80('0x4'));var BPromise=require(_0x5c80('0x5'));var Mustache=require('mustache');var util=require(_0x5c80('0x6'));var path=require(_0x5c80('0x7'));var sox=require('sox');var csv=require(_0x5c80('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c80('0x9'));var _=require(_0x5c80('0xa'));var squel=require(_0x5c80('0xb'));var crypto=require('crypto');var jsforce=require(_0x5c80('0xc'));var deskjs=require(_0x5c80('0xd'));var toCsv=require(_0x5c80('0x8'));var querystring=require(_0x5c80('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5c80('0xf'));var qs=require(_0x5c80('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c80('0x11'));var logger=require(_0x5c80('0x12'))(_0x5c80('0x13'));var utils=require(_0x5c80('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5c80('0x15'));var db=require(_0x5c80('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x5c80('0x17')][_0x5c80('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x36fe36,_0xc08a5d,_0x3766a6,_0x332669){return new BPromise(function(_0x331954,_0x5281aa){var _0x4978d7=_0x332669||client;return _0x4978d7[_0x5c80('0x19')](_0x36fe36,_0x3766a6)[_0x5c80('0x1a')](function(_0x3e9a79){logger[_0x5c80('0x1b')](_0x5c80('0x1c'),_0xc08a5d,'request\x20sent');logger[_0x5c80('0x1d')](_0x5c80('0x1e'),_0xc08a5d,_0x5c80('0x1f'),JSON[_0x5c80('0x20')](_0x3e9a79));if(_0x3e9a79[_0x5c80('0x21')]){if(_0x3e9a79[_0x5c80('0x21')][_0x5c80('0x22')]===0x1f4){logger[_0x5c80('0x21')](_0x5c80('0x1c'),_0xc08a5d,_0x3e9a79[_0x5c80('0x21')][_0x5c80('0x23')]);return _0x5281aa(_0x3e9a79[_0x5c80('0x21')][_0x5c80('0x23')]);}logger['error'](_0x5c80('0x1c'),_0xc08a5d,_0x3e9a79[_0x5c80('0x21')][_0x5c80('0x23')]);return _0x331954(_0x3e9a79[_0x5c80('0x21')][_0x5c80('0x23')]);}else{logger[_0x5c80('0x1b')]('Setting,\x20%s,\x20%s',_0xc08a5d,_0x5c80('0x1f'));_0x331954(_0x3e9a79['result'][_0x5c80('0x23')]);}})[_0x5c80('0x24')](function(_0x1a9fdb){logger['error']('Setting,\x20%s,\x20%s',_0xc08a5d,_0x1a9fdb);_0x5281aa(_0x1a9fdb);});});}function respondWithStatusCode(_0x197c4f,_0x2b5530){_0x2b5530=_0x2b5530||0xcc;return function(_0x4474a7){if(_0x4474a7){return _0x197c4f[_0x5c80('0x25')](_0x2b5530);}return _0x197c4f[_0x5c80('0x26')](_0x2b5530)[_0x5c80('0x27')]();};}function respondWithResult(_0x489dd6,_0x5ae145){_0x5ae145=_0x5ae145||0xc8;return function(_0x2355c6){if(_0x2355c6){return _0x489dd6[_0x5c80('0x26')](_0x5ae145)[_0x5c80('0x28')](_0x2355c6);}};}function respondWithFilteredResult(_0x460e3a,_0x14505c){return function(_0x5aa162){if(_0x5aa162){var _0x4e0fb3=typeof _0x14505c[_0x5c80('0x29')]===_0x5c80('0x2a')&&typeof _0x14505c['limit']===_0x5c80('0x2a');var _0x1b9b3b=_0x5aa162[_0x5c80('0x2b')];var _0x1bf8a6=_0x4e0fb3?0x0:_0x14505c[_0x5c80('0x29')];var _0x44be73=_0x4e0fb3?_0x5aa162[_0x5c80('0x2b')]:_0x14505c[_0x5c80('0x29')]+_0x14505c[_0x5c80('0x2c')];var _0x446527;if(_0x44be73>=_0x1b9b3b){_0x44be73=_0x1b9b3b;_0x446527=0xc8;}else{_0x446527=0xce;}_0x460e3a[_0x5c80('0x26')](_0x446527);return _0x460e3a[_0x5c80('0x2d')](_0x5c80('0x2e'),_0x1bf8a6+'-'+_0x44be73+'/'+_0x1b9b3b)['json'](_0x5aa162);}return null;};}function patchUpdates(_0x5cd5a5){return function(_0x35f51b){try{jsonpatch[_0x5c80('0x2f')](_0x35f51b,_0x5cd5a5,!![]);}catch(_0x536a20){return BPromise[_0x5c80('0x30')](_0x536a20);}return _0x35f51b[_0x5c80('0x31')]();};}function saveUpdates(_0x410772,_0xb051b5){return function(_0x4b3747){if(_0x4b3747){return _0x4b3747['update'](_0x410772)[_0x5c80('0x1a')](function(_0x3e1ece){return _0x3e1ece;});}return null;};}function removeEntity(_0x47c5d4,_0x40de1d){return function(_0xef11bb){if(_0xef11bb){return _0xef11bb[_0x5c80('0x32')]()[_0x5c80('0x1a')](function(){_0x47c5d4[_0x5c80('0x26')](0xcc)[_0x5c80('0x27')]();});}};}function handleEntityNotFound(_0x595c2b,_0x447fa7){return function(_0x175c8d){if(!_0x175c8d){_0x595c2b['sendStatus'](0x194);}return _0x175c8d;};}function handleError(_0x2b91fb,_0x41e061){_0x41e061=_0x41e061||0x1f4;return function(_0x3f6462){logger[_0x5c80('0x21')](_0x3f6462[_0x5c80('0x33')]);if(_0x3f6462[_0x5c80('0x34')]){delete _0x3f6462[_0x5c80('0x34')];}_0x2b91fb['status'](_0x41e061)['send'](_0x3f6462);};}exports[_0x5c80('0x35')]=function(_0x53b30a,_0x2a4f76){var _0xe33555={},_0x3641a9={},_0x20f3b9={'count':0x0,'rows':[]};var _0x5b6e33=_[_0x5c80('0x36')](db['Setting'][_0x5c80('0x37')],function(_0x3415b7){return{'name':_0x3415b7[_0x5c80('0x38')],'type':_0x3415b7['type'][_0x5c80('0x39')]};});_0x3641a9[_0x5c80('0x3a')]=_[_0x5c80('0x36')](_0x5b6e33,_0x5c80('0x34'));_0x3641a9[_0x5c80('0x3b')]=_[_0x5c80('0x3c')](_0x53b30a['query']);_0x3641a9[_0x5c80('0x3d')]=_[_0x5c80('0x3e')](_0x3641a9[_0x5c80('0x3a')],_0x3641a9['query']);_0xe33555[_0x5c80('0x3f')]=_['intersection'](_0x3641a9[_0x5c80('0x3a')],qs[_0x5c80('0x40')](_0x53b30a[_0x5c80('0x3b')]['fields']));_0xe33555['attributes']=_0xe33555[_0x5c80('0x3f')]['length']?_0xe33555[_0x5c80('0x3f')]:_0x3641a9[_0x5c80('0x3a')];if(!_0x53b30a[_0x5c80('0x3b')][_0x5c80('0x41')](_0x5c80('0x42'))){_0xe33555['limit']=qs[_0x5c80('0x2c')](_0x53b30a[_0x5c80('0x3b')]['limit']);_0xe33555[_0x5c80('0x29')]=qs[_0x5c80('0x29')](_0x53b30a['query'][_0x5c80('0x29')]);}_0xe33555[_0x5c80('0x43')]=qs[_0x5c80('0x44')](_0x53b30a[_0x5c80('0x3b')][_0x5c80('0x44')]);_0xe33555[_0x5c80('0x45')]=qs['filters'](_[_0x5c80('0x46')](_0x53b30a[_0x5c80('0x3b')],_0x3641a9['filters']),_0x5b6e33);if(_0x53b30a['query'][_0x5c80('0x47')]){_0xe33555[_0x5c80('0x45')]=_['merge'](_0xe33555['where'],{'$or':_[_0x5c80('0x36')](_0x5b6e33,function(_0x3d6e1f){if(_0x3d6e1f[_0x5c80('0x48')]!=='VIRTUAL'){var _0x7a0696={};_0x7a0696[_0x3d6e1f[_0x5c80('0x34')]]={'$like':'%'+_0x53b30a[_0x5c80('0x3b')][_0x5c80('0x47')]+'%'};return _0x7a0696;}})});}_0xe33555=_[_0x5c80('0x49')]({},_0xe33555,_0x53b30a['options']);var _0x2c54b8={'where':_0xe33555['where']};return db[_0x5c80('0x4a')][_0x5c80('0x2b')](_0x2c54b8)['then'](function(_0x3cb02f){_0x20f3b9[_0x5c80('0x2b')]=_0x3cb02f;if(_0x53b30a['query'][_0x5c80('0x4b')]){_0xe33555[_0x5c80('0x4c')]=[{'all':!![]}];}return db[_0x5c80('0x4a')][_0x5c80('0x4d')](_0xe33555);})[_0x5c80('0x1a')](function(_0x4fe493){_0x20f3b9[_0x5c80('0x4e')]=_0x4fe493;return _0x20f3b9;})[_0x5c80('0x1a')](respondWithFilteredResult(_0x2a4f76,_0xe33555))['catch'](handleError(_0x2a4f76,null));};exports['show']=function(_0x1c47bd,_0x31968b){var _0x37953a={'raw':![],'where':{'id':_0x1c47bd[_0x5c80('0x4f')]['id']}},_0x4a28ec={};_0x4a28ec[_0x5c80('0x3a')]=_['keys'](db[_0x5c80('0x4a')][_0x5c80('0x37')]);_0x4a28ec[_0x5c80('0x3b')]=_['keys'](_0x1c47bd[_0x5c80('0x3b')]);_0x4a28ec[_0x5c80('0x3d')]=_['intersection'](_0x4a28ec['model'],_0x4a28ec[_0x5c80('0x3b')]);_0x37953a[_0x5c80('0x3f')]=_['intersection'](_0x4a28ec[_0x5c80('0x3a')],qs['fields'](_0x1c47bd[_0x5c80('0x3b')][_0x5c80('0x40')]));_0x37953a[_0x5c80('0x3f')]=_0x37953a['attributes'][_0x5c80('0x50')]?_0x37953a[_0x5c80('0x3f')]:_0x4a28ec[_0x5c80('0x3a')];if(_0x1c47bd[_0x5c80('0x3b')]['includeAll']){_0x37953a[_0x5c80('0x4c')]=[{'all':!![]}];}_0x37953a=_[_0x5c80('0x49')]({},_0x37953a,_0x1c47bd['options']);return db[_0x5c80('0x4a')][_0x5c80('0x51')](_0x37953a)[_0x5c80('0x1a')](handleEntityNotFound(_0x31968b,null))[_0x5c80('0x1a')](respondWithResult(_0x31968b,null))[_0x5c80('0x24')](handleError(_0x31968b,null));};exports[_0x5c80('0x52')]=function(_0x1dd446,_0x17b733){if(_0x1dd446[_0x5c80('0x53')]['id']){delete _0x1dd446[_0x5c80('0x53')]['id'];}return db[_0x5c80('0x4a')][_0x5c80('0x51')]({'where':{'id':_0x1dd446[_0x5c80('0x4f')]['id']}})[_0x5c80('0x1a')](handleEntityNotFound(_0x17b733,null))[_0x5c80('0x1a')](saveUpdates(_0x1dd446[_0x5c80('0x53')],null))[_0x5c80('0x1a')](respondWithResult(_0x17b733,null))['catch'](handleError(_0x17b733,null));};exports[_0x5c80('0x54')]=function(_0x40bec3,_0x521fcc,_0x2325fb){if(_0x40bec3[_0x5c80('0x55')]&&_0x40bec3[_0x5c80('0x55')][_0x5c80('0x56')]){_0x40bec3['body'][_0x5c80('0x57')]=_0x40bec3[_0x5c80('0x55')][_0x5c80('0x56')];}return db[_0x5c80('0x4a')][_0x5c80('0x51')]({'where':{'id':_0x40bec3[_0x5c80('0x4f')]['id']}})[_0x5c80('0x1a')](handleEntityNotFound(_0x521fcc,null))[_0x5c80('0x1a')](saveUpdates(_0x40bec3[_0x5c80('0x53')],null))[_0x5c80('0x1a')](respondWithResult(_0x521fcc,null))[_0x5c80('0x24')](handleError(_0x521fcc,null));};exports[_0x5c80('0x58')]=function(_0x3e5050,_0x58e729,_0x4e8d90){if(_0x3e5050[_0x5c80('0x55')]&&_0x3e5050[_0x5c80('0x55')]['filename']){_0x3e5050['body']['loginLogo']=_0x3e5050['file'][_0x5c80('0x56')];}return db['Setting'][_0x5c80('0x51')]({'where':{'id':_0x3e5050[_0x5c80('0x4f')]['id']}})['then'](handleEntityNotFound(_0x58e729,null))[_0x5c80('0x1a')](saveUpdates(_0x3e5050[_0x5c80('0x53')],null))[_0x5c80('0x1a')](respondWithResult(_0x58e729,null))[_0x5c80('0x24')](handleError(_0x58e729,null));};var utilLicense=require(_0x5c80('0x15'));exports[_0x5c80('0x59')]=function(_0x1395f8,_0x365ebf,_0x116d68){var _0x92d4b9='server/files/images/logos';var _0x3c987e={'custom':![]};return utilLicense[_0x5c80('0x5a')]()['then'](function(_0x9ae258){if(_0x9ae258){_0x3c987e=_0x9ae258;}return db[_0x5c80('0x4a')][_0x5c80('0x51')]({'where':{'id':_0x1395f8['params']['id']},'attributes':[_0x5c80('0x57'),'loginLogo',_0x5c80('0x5b'),_0x5c80('0x5c'),'defaultLogo',_0x5c80('0x5d'),'defaultPreferred',_0x5c80('0x5e')],'raw':!![]});})[_0x5c80('0x1a')](handleEntityNotFound(_0x365ebf,null))[_0x5c80('0x1a')](function(_0x323f06){if(_0x323f06){var _0x392ab3=_0x323f06[_0x5c80('0x57')]&&fs[_0x5c80('0x5f')](path[_0x5c80('0x60')](config[_0x5c80('0x61')],_0x92d4b9,_[_0x5c80('0x62')](_0x323f06['logo'])))?path['join'](config[_0x5c80('0x61')],_0x92d4b9,_[_0x5c80('0x62')](_0x323f06[_0x5c80('0x57')])):path[_0x5c80('0x60')](config['root'],_0x92d4b9,_['toLower'](_0x5c80('0x63')));var _0x45fffc='default'+_[_0x5c80('0x64')](_0x5c80('0x57'));if(_0x323f06[_0x45fffc]||!_0x3c987e[_0x5c80('0x65')]){_0x392ab3=path[_0x5c80('0x60')](config[_0x5c80('0x61')],_0x92d4b9,_[_0x5c80('0x62')](_0x5c80('0x63')));}if(!fs[_0x5c80('0x5f')](_0x392ab3)){throw new db['Sequelize'][(_0x5c80('0x66'))](_['upperFirst']('logo')+'\x20not\x20found');}return _0x365ebf[_0x5c80('0x67')](_0x392ab3);}})[_0x5c80('0x24')](handleError(_0x365ebf,null));};var utilLicense=require(_0x5c80('0x15'));exports[_0x5c80('0x68')]=function(_0x58fc79,_0x2310ea,_0x3dd098){var _0x3853ca=_0x5c80('0x69');var _0x276169={'custom':![]};return utilLicense[_0x5c80('0x5a')]()[_0x5c80('0x1a')](function(_0x1ea015){if(_0x1ea015){_0x276169=_0x1ea015;}return db[_0x5c80('0x4a')][_0x5c80('0x51')]({'where':{'id':_0x58fc79[_0x5c80('0x4f')]['id']},'attributes':[_0x5c80('0x57'),'loginLogo',_0x5c80('0x5b'),'favicon',_0x5c80('0x6a'),_0x5c80('0x5d'),'defaultPreferred',_0x5c80('0x5e')],'raw':!![]});})[_0x5c80('0x1a')](handleEntityNotFound(_0x2310ea,null))[_0x5c80('0x1a')](function(_0x5e4ca9){if(_0x5e4ca9){var _0x464ed3=_0x5e4ca9[_0x5c80('0x6b')]&&fs['existsSync'](path[_0x5c80('0x60')](config['root'],_0x3853ca,_['toLower'](_0x5e4ca9['loginLogo'])))?path[_0x5c80('0x60')](config[_0x5c80('0x61')],_0x3853ca,_[_0x5c80('0x62')](_0x5e4ca9[_0x5c80('0x6b')])):path[_0x5c80('0x60')](config[_0x5c80('0x61')],_0x3853ca,_['toLower'](_0x5c80('0x6c')));var _0x15cf50=_0x5c80('0x6d')+_['upperFirst'](_0x5c80('0x6b'));if(_0x5e4ca9[_0x15cf50]||!_0x276169[_0x5c80('0x65')]){_0x464ed3=path[_0x5c80('0x60')](config['root'],_0x3853ca,_[_0x5c80('0x62')](_0x5c80('0x6c')));}if(!fs[_0x5c80('0x5f')](_0x464ed3)){throw new db[(_0x5c80('0x6e'))][(_0x5c80('0x66'))](_[_0x5c80('0x64')](_0x5c80('0x6b'))+'\x20not\x20found');}return _0x2310ea[_0x5c80('0x67')](_0x464ed3);}})[_0x5c80('0x24')](handleError(_0x2310ea,null));};exports[_0x5c80('0x6f')]=function(_0x7e9c26,_0x54c107){return db[_0x5c80('0x4a')]['find']({'where':{'id':_0x7e9c26[_0x5c80('0x4f')]['id']},'attributes':['securePassword']})[_0x5c80('0x1a')](respondWithResult(_0x54c107,null))[_0x5c80('0x24')](handleError(_0x54c107,null));};exports[_0x5c80('0x70')]=function(_0x572b8e,_0x2b46d4,_0x16bc8e){if(_0x572b8e[_0x5c80('0x55')]&&_0x572b8e[_0x5c80('0x55')]['filename']){_0x572b8e[_0x5c80('0x53')][_0x5c80('0x5b')]=_0x572b8e[_0x5c80('0x55')][_0x5c80('0x56')];}return db[_0x5c80('0x4a')][_0x5c80('0x51')]({'where':{'id':_0x572b8e['params']['id']}})['then'](handleEntityNotFound(_0x2b46d4,null))['then'](saveUpdates(_0x572b8e[_0x5c80('0x53')],null))[_0x5c80('0x1a')](respondWithResult(_0x2b46d4,null))[_0x5c80('0x24')](handleError(_0x2b46d4,null));};var utilLicense=require(_0x5c80('0x15'));exports['getPreferred']=function(_0x26fe44,_0x33ad99,_0x54da0a){var _0x3f78a2=_0x5c80('0x69');var _0x28a47a={'custom':![]};return utilLicense[_0x5c80('0x5a')]()[_0x5c80('0x1a')](function(_0x254ad2){if(_0x254ad2){_0x28a47a=_0x254ad2;}return db[_0x5c80('0x4a')][_0x5c80('0x51')]({'where':{'id':_0x26fe44['params']['id']},'attributes':[_0x5c80('0x57'),_0x5c80('0x6b'),_0x5c80('0x5b'),_0x5c80('0x5c'),'defaultLogo',_0x5c80('0x5d'),'defaultPreferred',_0x5c80('0x5e')],'raw':!![]});})[_0x5c80('0x1a')](handleEntityNotFound(_0x33ad99,null))['then'](function(_0x2fe9a1){if(_0x2fe9a1){var _0x42dfe3=_0x2fe9a1[_0x5c80('0x5b')]&&fs[_0x5c80('0x5f')](path[_0x5c80('0x60')](config[_0x5c80('0x61')],_0x3f78a2,_[_0x5c80('0x62')](_0x2fe9a1[_0x5c80('0x5b')])))?path[_0x5c80('0x60')](config['root'],_0x3f78a2,_[_0x5c80('0x62')](_0x2fe9a1[_0x5c80('0x5b')])):path['join'](config[_0x5c80('0x61')],_0x3f78a2,_['toLower'](_0x5c80('0x71')));var _0x197a01=_0x5c80('0x6d')+_[_0x5c80('0x64')](_0x5c80('0x5b'));if(_0x2fe9a1[_0x197a01]||!_0x28a47a[_0x5c80('0x65')]||!_0x28a47a[_0x5c80('0x5b')]){_0x42dfe3=path[_0x5c80('0x60')](config['root'],_0x3f78a2,_[_0x5c80('0x62')](_0x5c80('0x71')));}if(!fs[_0x5c80('0x5f')](_0x42dfe3)){throw new db['Sequelize'][(_0x5c80('0x66'))](_[_0x5c80('0x64')](_0x5c80('0x5b'))+_0x5c80('0x72'));}return _0x33ad99[_0x5c80('0x67')](_0x42dfe3);}})['catch'](handleError(_0x33ad99,null));};exports['addFavicon']=function(_0xfbff0d,_0x549df3,_0xd200ce){if(_0xfbff0d[_0x5c80('0x55')]&&_0xfbff0d[_0x5c80('0x55')]['filename']){_0xfbff0d[_0x5c80('0x53')]['favicon']=_0xfbff0d['file'][_0x5c80('0x56')];}return db[_0x5c80('0x4a')]['find']({'where':{'id':_0xfbff0d[_0x5c80('0x4f')]['id']}})[_0x5c80('0x1a')](handleEntityNotFound(_0x549df3,null))[_0x5c80('0x1a')](saveUpdates(_0xfbff0d['body'],null))[_0x5c80('0x1a')](respondWithResult(_0x549df3,null))[_0x5c80('0x24')](handleError(_0x549df3,null));};var utilLicense=require(_0x5c80('0x15'));exports[_0x5c80('0x73')]=function(_0x55233e,_0x297d47,_0x3e1f7c){var _0x5da557=_0x5c80('0x69');var _0x3f1cd0={'custom':![]};return utilLicense[_0x5c80('0x5a')]()[_0x5c80('0x1a')](function(_0x2cbe43){if(_0x2cbe43){_0x3f1cd0=_0x2cbe43;}return db[_0x5c80('0x4a')]['find']({'where':{'id':_0x55233e[_0x5c80('0x4f')]['id']},'attributes':['logo',_0x5c80('0x6b'),_0x5c80('0x5b'),'favicon',_0x5c80('0x6a'),'defaultLoginLogo','defaultPreferred',_0x5c80('0x5e')],'raw':!![]});})[_0x5c80('0x1a')](handleEntityNotFound(_0x297d47,null))['then'](function(_0x4dd4a8){if(_0x4dd4a8){var _0x2e52ce=_0x4dd4a8[_0x5c80('0x5c')]&&fs[_0x5c80('0x5f')](path[_0x5c80('0x60')](config[_0x5c80('0x61')],_0x5da557,_[_0x5c80('0x62')](_0x4dd4a8[_0x5c80('0x5c')])))?path[_0x5c80('0x60')](config[_0x5c80('0x61')],_0x5da557,_[_0x5c80('0x62')](_0x4dd4a8['favicon'])):path[_0x5c80('0x60')](config[_0x5c80('0x61')],_0x5da557,_[_0x5c80('0x62')](_0x5c80('0x74')));var _0x918540=_0x5c80('0x6d')+_[_0x5c80('0x64')]('favicon');if(_0x4dd4a8[_0x918540]||!_0x3f1cd0[_0x5c80('0x65')]){_0x2e52ce=path[_0x5c80('0x60')](config[_0x5c80('0x61')],_0x5da557,_[_0x5c80('0x62')]('default_favicon.ico'));}if(!fs[_0x5c80('0x5f')](_0x2e52ce)){throw new db[(_0x5c80('0x6e'))][(_0x5c80('0x66'))](_[_0x5c80('0x64')]('favicon')+_0x5c80('0x72'));}return _0x297d47[_0x5c80('0x67')](_0x2e52ce);}})[_0x5c80('0x24')](handleError(_0x297d47,null));};exports[_0x5c80('0x75')]=function(_0x5c4394,_0x5dc21b){var _0xb665f4={'offset':moment()[_0x5c80('0x76')]()};_0xb665f4[_0x5c80('0x77')]=moment()[_0x5c80('0x76')](_0xb665f4[_0x5c80('0x29')])[_0x5c80('0x78')](_0x5c80('0x79'));return _0x5dc21b[_0x5c80('0x26')](0xc8)[_0x5c80('0x7a')](_0xb665f4);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index f0661a9..6d6ce3e 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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x5d8b37,_0x2a619a){var _0x1abcf7=function(_0x53454a){while(--_0x53454a){_0x5d8b37['push'](_0x5d8b37['shift']());}};_0x1abcf7(++_0x2a619a);}(_0xe14b,0x93));var _0xbe14=function(_0x443bb9,_0x25c1e1){_0x443bb9=_0x443bb9-0x0;var _0x36cc8b=_0xe14b[_0x443bb9];return _0x36cc8b;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_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':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index c791358..8a6cacc 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 _0xeecf=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','catch','ShowSetting','Setting','find','options','raw','attributes','include','model','map','util','ioredis'];(function(_0x1b2127,_0x1a1e0c){var _0x41005b=function(_0x541adc){while(--_0x541adc){_0x1b2127['push'](_0x1b2127['shift']());}};_0x41005b(++_0x1a1e0c);}(_0xeecf,0xd7));var _0xfeec=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xeecf[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0xfeec('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfeec('0x1'));var db=require(_0xfeec('0x2'))['db'];var utils=require(_0xfeec('0x3'));var logger=require(_0xfeec('0x4'))(_0xfeec('0x5'));var config=require(_0xfeec('0x6'));var jayson=require(_0xfeec('0x7'));var client=jayson[_0xfeec('0x8')][_0xfeec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3dca58,_0x2b080f,_0x1209f3){return new BPromise(function(_0xb5aa4c,_0x4cc1b6){return client[_0xfeec('0xa')](_0x3dca58,_0x1209f3)[_0xfeec('0xb')](function(_0x512bbb){logger[_0xfeec('0xc')]('Setting,\x20%s,\x20%s',_0x2b080f,_0xfeec('0xd'));logger[_0xfeec('0xe')](_0xfeec('0xf'),_0x2b080f,'request\x20sent',JSON[_0xfeec('0x10')](_0x512bbb));if(_0x512bbb[_0xfeec('0x11')]){if(_0x512bbb[_0xfeec('0x11')][_0xfeec('0x12')]===0x1f4){logger[_0xfeec('0x11')](_0xfeec('0x13'),_0x2b080f,_0x512bbb[_0xfeec('0x11')][_0xfeec('0x14')]);return _0x4cc1b6(_0x512bbb['error'][_0xfeec('0x14')]);}logger['error'](_0xfeec('0x13'),_0x2b080f,_0x512bbb[_0xfeec('0x11')]['message']);return _0xb5aa4c(_0x512bbb[_0xfeec('0x11')][_0xfeec('0x14')]);}else{logger[_0xfeec('0xc')](_0xfeec('0x13'),_0x2b080f,_0xfeec('0xd'));_0xb5aa4c(_0x512bbb['result'][_0xfeec('0x14')]);}})[_0xfeec('0x15')](function(_0x240e1f){logger[_0xfeec('0x11')](_0xfeec('0x13'),_0x2b080f,_0x240e1f);_0x4cc1b6(_0x240e1f);});});}exports[_0xfeec('0x16')]=function(_0x320253){var _0xb4a41c=this;return new Promise(function(_0x565f0f,_0x1efff6){return db[_0xfeec('0x17')][_0xfeec('0x18')]({'raw':_0x320253['options']?_0x320253[_0xfeec('0x19')][_0xfeec('0x1a')]===undefined?!![]:![]:!![],'where':_0x320253['options']?_0x320253[_0xfeec('0x19')]['where']||null:null,'attributes':_0x320253[_0xfeec('0x19')]?_0x320253[_0xfeec('0x19')][_0xfeec('0x1b')]||null:null,'include':_0x320253[_0xfeec('0x19')]?_0x320253[_0xfeec('0x19')][_0xfeec('0x1c')]?_['map'](_0x320253[_0xfeec('0x19')][_0xfeec('0x1c')],function(_0x478e72){return{'model':db[_0x478e72[_0xfeec('0x1d')]],'as':_0x478e72['as'],'attributes':_0x478e72['attributes'],'include':_0x478e72[_0xfeec('0x1c')]?_['map'](_0x478e72[_0xfeec('0x1c')],function(_0x54b109){return{'model':db[_0x54b109['model']],'as':_0x54b109['as'],'attributes':_0x54b109[_0xfeec('0x1b')],'include':_0x54b109[_0xfeec('0x1c')]?_[_0xfeec('0x1e')](_0x54b109['include'],function(_0x222dbd){return{'model':db[_0x222dbd['model']],'as':_0x222dbd['as'],'attributes':_0x222dbd['attributes']};}):[]};}):[]};}):[]:[]})[_0xfeec('0xb')](function(_0x391399){logger[_0xfeec('0xc')](_0xfeec('0x16'),_0x320253);logger[_0xfeec('0xe')](_0xfeec('0x16'),_0x320253,JSON[_0xfeec('0x10')](_0x391399));_0x565f0f(_0x391399);})[_0xfeec('0x15')](function(_0x302bfe){logger[_0xfeec('0x11')](_0xfeec('0x16'),_0x302bfe['message'],_0x320253);_0x1efff6(_0xb4a41c[_0xfeec('0x11')](0x1f4,_0x302bfe[_0xfeec('0x14')]));});});}; \ No newline at end of file +var _0xce4f=['options','raw','where','attributes','include','map','model','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','find'];(function(_0x580be5,_0x1a6e1d){var _0x2c42a7=function(_0x34e08c){while(--_0x34e08c){_0x580be5['push'](_0x580be5['shift']());}};_0x2c42a7(++_0x1a6e1d);}(_0xce4f,0x1c8));var _0xfce4=function(_0x3b4bfe,_0x5defed){_0x3b4bfe=_0x3b4bfe-0x0;var _0x2063cb=_0xce4f[_0x3b4bfe];return _0x2063cb;};'use strict';var _=require('lodash');var util=require(_0xfce4('0x0'));var moment=require(_0xfce4('0x1'));var BPromise=require(_0xfce4('0x2'));var rs=require(_0xfce4('0x3'));var fs=require('fs');var Redis=require(_0xfce4('0x4'));var db=require(_0xfce4('0x5'))['db'];var utils=require(_0xfce4('0x6'));var logger=require('../../config/logger')(_0xfce4('0x7'));var config=require(_0xfce4('0x8'));var jayson=require(_0xfce4('0x9'));var client=jayson[_0xfce4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x270463,_0x36ce7b,_0x4173c7){return new BPromise(function(_0x8864fa,_0x5b73f1){return client['request'](_0x270463,_0x4173c7)[_0xfce4('0xb')](function(_0x5d2f4d){logger[_0xfce4('0xc')](_0xfce4('0xd'),_0x36ce7b,_0xfce4('0xe'));logger['debug'](_0xfce4('0xf'),_0x36ce7b,'request\x20sent',JSON[_0xfce4('0x10')](_0x5d2f4d));if(_0x5d2f4d[_0xfce4('0x11')]){if(_0x5d2f4d['error'][_0xfce4('0x12')]===0x1f4){logger[_0xfce4('0x11')](_0xfce4('0xd'),_0x36ce7b,_0x5d2f4d[_0xfce4('0x11')]['message']);return _0x5b73f1(_0x5d2f4d['error']['message']);}logger[_0xfce4('0x11')]('Setting,\x20%s,\x20%s',_0x36ce7b,_0x5d2f4d[_0xfce4('0x11')][_0xfce4('0x13')]);return _0x8864fa(_0x5d2f4d[_0xfce4('0x11')][_0xfce4('0x13')]);}else{logger[_0xfce4('0xc')](_0xfce4('0xd'),_0x36ce7b,_0xfce4('0xe'));_0x8864fa(_0x5d2f4d[_0xfce4('0x14')]['message']);}})[_0xfce4('0x15')](function(_0x1cae53){logger[_0xfce4('0x11')]('Setting,\x20%s,\x20%s',_0x36ce7b,_0x1cae53);_0x5b73f1(_0x1cae53);});});}exports[_0xfce4('0x16')]=function(_0x41e788){var _0x46d4ff=this;return new Promise(function(_0x515ad1,_0x195fad){return db['Setting'][_0xfce4('0x17')]({'raw':_0x41e788['options']?_0x41e788[_0xfce4('0x18')][_0xfce4('0x19')]===undefined?!![]:![]:!![],'where':_0x41e788[_0xfce4('0x18')]?_0x41e788['options'][_0xfce4('0x1a')]||null:null,'attributes':_0x41e788[_0xfce4('0x18')]?_0x41e788[_0xfce4('0x18')][_0xfce4('0x1b')]||null:null,'include':_0x41e788[_0xfce4('0x18')]?_0x41e788[_0xfce4('0x18')][_0xfce4('0x1c')]?_[_0xfce4('0x1d')](_0x41e788['options']['include'],function(_0x4c6d66){return{'model':db[_0x4c6d66['model']],'as':_0x4c6d66['as'],'attributes':_0x4c6d66['attributes'],'include':_0x4c6d66['include']?_[_0xfce4('0x1d')](_0x4c6d66['include'],function(_0x176b30){return{'model':db[_0x176b30[_0xfce4('0x1e')]],'as':_0x176b30['as'],'attributes':_0x176b30[_0xfce4('0x1b')],'include':_0x176b30[_0xfce4('0x1c')]?_[_0xfce4('0x1d')](_0x176b30[_0xfce4('0x1c')],function(_0x38983d){return{'model':db[_0x38983d[_0xfce4('0x1e')]],'as':_0x38983d['as'],'attributes':_0x38983d[_0xfce4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfce4('0xb')](function(_0x30629a){logger[_0xfce4('0xc')](_0xfce4('0x16'),_0x41e788);logger[_0xfce4('0x1f')](_0xfce4('0x16'),_0x41e788,JSON[_0xfce4('0x10')](_0x30629a));_0x515ad1(_0x30629a);})[_0xfce4('0x15')](function(_0x243f65){logger['error'](_0xfce4('0x16'),_0x243f65['message'],_0x41e788);_0x195fad(_0x46d4ff[_0xfce4('0x11')](0x1f4,_0x243f65[_0xfce4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 20efa2a..0084c31 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 _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x186b73,_0x407a16){var _0x503729=function(_0x48da22){while(--_0x48da22){_0x186b73['push'](_0x186b73['shift']());}};_0x503729(++_0x407a16);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x37a9d7,_0x2b6fde){_0x37a9d7=_0x37a9d7-0x0;var _0x1343d3=_0x7fbe[_0x37a9d7];return _0x1343d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xabce=['/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0xac4dcd,_0x42f470){var _0x1e5211=function(_0x146238){while(--_0x146238){_0xac4dcd['push'](_0xac4dcd['shift']());}};_0x1e5211(++_0x42f470);}(_0xabce,0x103));var _0xeabc=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xabce[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0x9')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0x9')](_0xeabc('0x10'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x11')]);router[_0xeabc('0x9')](_0xeabc('0x12'),auth['isAuthenticated'](),controller[_0xeabc('0x13')]);router[_0xeabc('0x9')](_0xeabc('0x14'),controller['statusGet']);router['get'](_0xeabc('0x15'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x16')]);router['post']('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0x17')]);router['post']('/:id/dispositions',auth[_0xeabc('0x8')](),controller['addDisposition']);router[_0xeabc('0x18')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x19')]);router[_0xeabc('0x18')](_0xeabc('0x1a'),controller[_0xeabc('0x1b')]);router[_0xeabc('0x18')]('/:id/applications',auth[_0xeabc('0x8')](),controller['addApplications']);router[_0xeabc('0x18')](_0xeabc('0x1c'),auth['isAuthenticated'](),controller[_0xeabc('0x1d')]);router[_0xeabc('0x18')](_0xeabc('0x14'),controller[_0xeabc('0x1e')]);router[_0xeabc('0x18')]('/:id/users',auth[_0xeabc('0x8')](),controller[_0xeabc('0x1f')]);router[_0xeabc('0x20')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0x21')]);router[_0xeabc('0x22')](_0xeabc('0x23'),auth['isAuthenticated'](),controller[_0xeabc('0x24')]);router['delete'](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0x25')]);router[_0xeabc('0x22')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x26')]);router[_0xeabc('0x22')](_0xeabc('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xeabc('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 2d45d34..f9e0bfc 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 _0xce21=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','generate','ENUM','skebby','connectel','clicksend','plivo','clickatell','csc','intelepeer','BOOLEAN'];(function(_0x58d1fa,_0x1bbeb0){var _0x3b6dfe=function(_0x4189c3){while(--_0x4189c3){_0x58d1fa['push'](_0x58d1fa['shift']());}};_0x3b6dfe(++_0x1bbeb0);}(_0xce21,0x104));var _0x1ce2=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0xce21[_0x4e1a49];return _0x136aae;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x1ce2('0x0')]={'name':{'type':Sequelize[_0x1ce2('0x1')],'unique':_0x1ce2('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x1ce2('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x1ce2('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x1ce2('0x1')],'defaultValue':function(){return rs[_0x1ce2('0x3')]();}},'phone':{'type':Sequelize[_0x1ce2('0x1')]},'type':{'type':Sequelize[_0x1ce2('0x4')]('twilio',_0x1ce2('0x5'),_0x1ce2('0x6'),_0x1ce2('0x7'),_0x1ce2('0x8'),_0x1ce2('0x9'),'bandwidth',_0x1ce2('0xa'),'infobip',_0x1ce2('0xb'))},'accountSid':{'type':Sequelize[_0x1ce2('0x1')]},'authId':{'type':Sequelize[_0x1ce2('0x1')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x1ce2('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x1ce2('0x1')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x1ce2('0x1')]},'applicationId':{'type':Sequelize[_0x1ce2('0x1')]},'accountId':{'type':Sequelize[_0x1ce2('0x1')]},'senderString':{'type':Sequelize[_0x1ce2('0x1')]},'deliveryReport':{'type':Sequelize[_0x1ce2('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x1ce2('0xd')],'defaultValue':function(){return _0x1ce2('0xe');}},'notificationSound':{'type':Sequelize[_0x1ce2('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1ce2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1ce2('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1ce2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1ce2('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1ce2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x1ce2('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x1ce2('0xc')],'defaultValue':![],'comment':_0x1ce2('0x11'),'set':function(_0xc81838){if(!_0xc81838)this[_0x1ce2('0x12')](_0x1ce2('0x13'),null);this[_0x1ce2('0x12')](_0x1ce2('0x14'),_0xc81838);}}}; \ No newline at end of file +var _0xa010=['ENUM','skebby','clickatell','bandwidth','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','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate'];(function(_0x548ebc,_0x387603){var _0x4e1168=function(_0xba8567){while(--_0xba8567){_0x548ebc['push'](_0x548ebc['shift']());}};_0x4e1168(++_0x387603);}(_0xa010,0xfe));var _0x0a01=function(_0x28f43b,_0x3de923){_0x28f43b=_0x28f43b-0x0;var _0x5026d7=_0xa010[_0x28f43b];return _0x5026d7;};'use strict';var Sequelize=require(_0x0a01('0x0'));var rs=require(_0x0a01('0x1'));module[_0x0a01('0x2')]={'name':{'type':Sequelize[_0x0a01('0x3')],'unique':_0x0a01('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x0a01('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x0a01('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x0a01('0x3')],'defaultValue':function(){return rs[_0x0a01('0x5')]();}},'phone':{'type':Sequelize[_0x0a01('0x3')]},'type':{'type':Sequelize[_0x0a01('0x6')]('twilio',_0x0a01('0x7'),'connectel','clicksend','plivo',_0x0a01('0x8'),_0x0a01('0x9'),'csc',_0x0a01('0xa'),_0x0a01('0xb'))},'accountSid':{'type':Sequelize[_0x0a01('0x3')]},'authId':{'type':Sequelize[_0x0a01('0x3')]},'authToken':{'type':Sequelize[_0x0a01('0x3')]},'smsMethod':{'type':Sequelize[_0x0a01('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x0a01('0x3')]},'password':{'type':Sequelize[_0x0a01('0x3')]},'apiKey':{'type':Sequelize[_0x0a01('0x3')]},'applicationId':{'type':Sequelize[_0x0a01('0x3')]},'accountId':{'type':Sequelize[_0x0a01('0x3')]},'senderString':{'type':Sequelize[_0x0a01('0x3')]},'deliveryReport':{'type':Sequelize[_0x0a01('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x0a01('0xd')],'defaultValue':function(){return _0x0a01('0xe');}},'notificationSound':{'type':Sequelize[_0x0a01('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0a01('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0a01('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0a01('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0a01('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0a01('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a01('0xf')],'comment':_0x0a01('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x0a01('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1921ae){if(!_0x1921ae)this[_0x0a01('0x11')](_0x0a01('0x12'),null);this[_0x0a01('0x11')](_0x0a01('0x13'),_0x1921ae);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index e2a603f..2a69d7f 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 _0x7a0c=['request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','get','SmsAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsAccount','includeAll','include','findAll','rows','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','addDisposition','SmsAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','account','applications','orderBy','asc','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','skebby','sender','text','connectel','clicksend','message_id','plivo','From','Text','infobip','results','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','omit','Contacts','contact','spread','interaction','created','autoclose','push','close','ContactId','AttachmentId','User','unshift','agent','*,*,*,*','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','set','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','SmsInteraction','Contact','Owner','Tag','Tags','color','tag','to\x20is\x20mandatory','List','DESC','defaults','out','Messages','SmsMessage','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','redif','error_code','groupName','DELIVERED_TO_GATEWAY','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http'];(function(_0x40719d,_0x8ed731){var _0x546738=function(_0x47a639){while(--_0x47a639){_0x40719d['push'](_0x40719d['shift']());}};_0x546738(++_0x8ed731);}(_0x7a0c,0xc8));var _0xc7a0=function(_0x3c75ca,_0x419bf8){_0x3c75ca=_0x3c75ca-0x0;var _0x43732f=_0x7a0c[_0x3c75ca];return _0x43732f;};'use strict';var emlformat=require(_0xc7a0('0x0'));var rimraf=require(_0xc7a0('0x1'));var zipdir=require(_0xc7a0('0x2'));var jsonpatch=require(_0xc7a0('0x3'));var rp=require(_0xc7a0('0x4'));var moment=require('moment');var BPromise=require(_0xc7a0('0x5'));var Mustache=require(_0xc7a0('0x6'));var util=require(_0xc7a0('0x7'));var path=require(_0xc7a0('0x8'));var sox=require(_0xc7a0('0x9'));var csv=require(_0xc7a0('0xa'));var ejs=require(_0xc7a0('0xb'));var fs=require('fs');var fs_extra=require(_0xc7a0('0xc'));var _=require(_0xc7a0('0xd'));var squel=require('squel');var crypto=require(_0xc7a0('0xe'));var jsforce=require(_0xc7a0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc7a0('0xa'));var querystring=require(_0xc7a0('0x10'));var Papa=require(_0xc7a0('0x11'));var Redis=require(_0xc7a0('0x12'));var authService=require(_0xc7a0('0x13'));var qs=require(_0xc7a0('0x14'));var as=require(_0xc7a0('0x15'));var hardwareService=require(_0xc7a0('0x16'));var logger=require(_0xc7a0('0x17'))(_0xc7a0('0x18'));var utils=require(_0xc7a0('0x19'));var config=require(_0xc7a0('0x1a'));var licenseUtil=require(_0xc7a0('0x1b'));var db=require(_0xc7a0('0x1c'))['db'];config['redis']=_['defaults'](config[_0xc7a0('0x1d')],{'host':_0xc7a0('0x1e'),'port':0x18eb});var socket=require(_0xc7a0('0x1f'))(new Redis(config['redis']));require(_0xc7a0('0x20'))[_0xc7a0('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc7a0('0x22')][_0xc7a0('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x36e5e4,_0x5558d8,_0x30555c,_0xfbebad){return new BPromise(function(_0x3b295c,_0x378017){var _0xcadb40=_0xfbebad||client;return _0xcadb40[_0xc7a0('0x24')](_0x36e5e4,_0x30555c)[_0xc7a0('0x25')](function(_0xec8478){logger[_0xc7a0('0x26')](_0xc7a0('0x27'),_0x5558d8,_0xc7a0('0x28'));logger[_0xc7a0('0x29')](_0xc7a0('0x2a'),_0x5558d8,_0xc7a0('0x28'),JSON[_0xc7a0('0x2b')](_0xec8478));if(_0xec8478[_0xc7a0('0x2c')]){if(_0xec8478[_0xc7a0('0x2c')][_0xc7a0('0x2d')]===0x1f4){logger['error'](_0xc7a0('0x27'),_0x5558d8,_0xec8478[_0xc7a0('0x2c')][_0xc7a0('0x2e')]);return _0x378017(_0xec8478[_0xc7a0('0x2c')][_0xc7a0('0x2e')]);}logger[_0xc7a0('0x2c')](_0xc7a0('0x27'),_0x5558d8,_0xec8478[_0xc7a0('0x2c')]['message']);return _0x3b295c(_0xec8478[_0xc7a0('0x2c')][_0xc7a0('0x2e')]);}else{logger[_0xc7a0('0x26')](_0xc7a0('0x27'),_0x5558d8,_0xc7a0('0x28'));_0x3b295c(_0xec8478['result'][_0xc7a0('0x2e')]);}})[_0xc7a0('0x2f')](function(_0x27c2ed){logger['error'](_0xc7a0('0x27'),_0x5558d8,_0x27c2ed);_0x378017(_0x27c2ed);});});}function respondWithStatusCode(_0xa2f443,_0x429591){_0x429591=_0x429591||0xcc;return function(_0x3fb9cc){if(_0x3fb9cc){return _0xa2f443[_0xc7a0('0x30')](_0x429591);}return _0xa2f443['status'](_0x429591)[_0xc7a0('0x31')]();};}function respondWithResult(_0xc412f1,_0x2eba4e){_0x2eba4e=_0x2eba4e||0xc8;return function(_0x4433f9){if(_0x4433f9){return _0xc412f1[_0xc7a0('0x32')](_0x2eba4e)[_0xc7a0('0x33')](_0x4433f9);}};}function respondWithFilteredResult(_0x290b71,_0x372df2){return function(_0x5b4664){if(_0x5b4664){var _0x28de65=typeof _0x372df2[_0xc7a0('0x34')]==='undefined'&&typeof _0x372df2['limit']===_0xc7a0('0x35');var _0x1c53a1=_0x5b4664['count'];var _0x4f80c7=_0x28de65?0x0:_0x372df2['offset'];var _0x11d022=_0x28de65?_0x5b4664[_0xc7a0('0x36')]:_0x372df2[_0xc7a0('0x34')]+_0x372df2[_0xc7a0('0x37')];var _0x2a9af7;if(_0x11d022>=_0x1c53a1){_0x11d022=_0x1c53a1;_0x2a9af7=0xc8;}else{_0x2a9af7=0xce;}_0x290b71['status'](_0x2a9af7);return _0x290b71['set'](_0xc7a0('0x38'),_0x4f80c7+'-'+_0x11d022+'/'+_0x1c53a1)[_0xc7a0('0x33')](_0x5b4664);}return null;};}function patchUpdates(_0x571a02){return function(_0x29731d){try{jsonpatch[_0xc7a0('0x39')](_0x29731d,_0x571a02,!![]);}catch(_0x55da7f){return BPromise[_0xc7a0('0x3a')](_0x55da7f);}return _0x29731d[_0xc7a0('0x3b')]();};}function saveUpdates(_0x2acdd9,_0x318e64){return function(_0x1d2bf3){if(_0x1d2bf3){return _0x1d2bf3[_0xc7a0('0x3c')](_0x2acdd9)['then'](function(_0x5ad626){return _0x5ad626;});}return null;};}function removeEntity(_0xc290d7,_0xe6d468){return function(_0x22cf83){if(_0x22cf83){return _0x22cf83['destroy']()[_0xc7a0('0x25')](function(){var _0x5b3ec4=_0x22cf83[_0xc7a0('0x3d')]({'plain':!![]});var _0x1b8685=_0xc7a0('0x3e');return db[_0xc7a0('0x3f')]['destroy']({'where':{'type':_0x1b8685,'resourceId':_0x5b3ec4['id']}})[_0xc7a0('0x25')](function(){return _0x22cf83;});})[_0xc7a0('0x25')](function(){_0xc290d7[_0xc7a0('0x32')](0xcc)[_0xc7a0('0x31')]();});}};}function handleEntityNotFound(_0x96a7f2,_0x133cb5){return function(_0x4749fc){if(!_0x4749fc){_0x96a7f2[_0xc7a0('0x30')](0x194);}return _0x4749fc;};}function handleError(_0x5f1ce8,_0x2eb229){_0x2eb229=_0x2eb229||0x1f4;return function(_0x214d7d){logger['error'](_0x214d7d[_0xc7a0('0x40')]);if(_0x214d7d[_0xc7a0('0x41')]){delete _0x214d7d['name'];}_0x5f1ce8['status'](_0x2eb229)[_0xc7a0('0x42')](_0x214d7d);};}exports['index']=function(_0x11e9a4,_0x53ce1d){var _0x294bd7={'include':[{'model':db[_0xc7a0('0x43')],'as':_0xc7a0('0x44')}]},_0x1e96ac={},_0x7a8a4f={'count':0x0,'rows':[]};var _0x1135be=_[_0xc7a0('0x45')](db['SmsAccount'][_0xc7a0('0x46')],function(_0x44aa16){return{'name':_0x44aa16[_0xc7a0('0x47')],'type':_0x44aa16[_0xc7a0('0x48')]['key']};});_0x1e96ac[_0xc7a0('0x49')]=_[_0xc7a0('0x45')](_0x1135be,_0xc7a0('0x41'));_0x1e96ac[_0xc7a0('0x4a')]=_[_0xc7a0('0x4b')](_0x11e9a4[_0xc7a0('0x4a')]);_0x1e96ac[_0xc7a0('0x4c')]=_[_0xc7a0('0x4d')](_0x1e96ac[_0xc7a0('0x49')],_0x1e96ac['query']);_0x294bd7['attributes']=_[_0xc7a0('0x4d')](_0x1e96ac[_0xc7a0('0x49')],qs[_0xc7a0('0x4e')](_0x11e9a4[_0xc7a0('0x4a')]['fields']));_0x294bd7[_0xc7a0('0x4f')]=_0x294bd7[_0xc7a0('0x4f')][_0xc7a0('0x50')]?_0x294bd7[_0xc7a0('0x4f')]:_0x1e96ac[_0xc7a0('0x49')];if(!_0x11e9a4[_0xc7a0('0x4a')][_0xc7a0('0x51')](_0xc7a0('0x52'))){_0x294bd7['limit']=qs[_0xc7a0('0x37')](_0x11e9a4[_0xc7a0('0x4a')]['limit']);_0x294bd7[_0xc7a0('0x34')]=qs[_0xc7a0('0x34')](_0x11e9a4[_0xc7a0('0x4a')][_0xc7a0('0x34')]);}_0x294bd7[_0xc7a0('0x53')]=qs[_0xc7a0('0x54')](_0x11e9a4['query'][_0xc7a0('0x54')]);_0x294bd7[_0xc7a0('0x55')]=qs[_0xc7a0('0x4c')](_[_0xc7a0('0x56')](_0x11e9a4['query'],_0x1e96ac[_0xc7a0('0x4c')]),_0x1135be);if(_0x11e9a4['query'][_0xc7a0('0x57')]){_0x294bd7[_0xc7a0('0x55')]=_[_0xc7a0('0x58')](_0x294bd7['where'],{'$or':_[_0xc7a0('0x45')](_0x1135be,function(_0xff8847){if(_0xff8847[_0xc7a0('0x48')]!==_0xc7a0('0x59')){var _0x4c1004={};_0x4c1004[_0xff8847[_0xc7a0('0x41')]]={'$like':'%'+_0x11e9a4[_0xc7a0('0x4a')][_0xc7a0('0x57')]+'%'};return _0x4c1004;}})});}_0x294bd7=_[_0xc7a0('0x58')]({},_0x294bd7,_0x11e9a4[_0xc7a0('0x5a')]);var _0x330f76={'where':_0x294bd7[_0xc7a0('0x55')]};return db[_0xc7a0('0x5b')][_0xc7a0('0x36')](_0x330f76)['then'](function(_0x42dc86){_0x7a8a4f[_0xc7a0('0x36')]=_0x42dc86;if(_0x11e9a4[_0xc7a0('0x4a')][_0xc7a0('0x5c')]){_0x294bd7[_0xc7a0('0x5d')]=[{'all':!![]}];}return db[_0xc7a0('0x5b')][_0xc7a0('0x5e')](_0x294bd7);})[_0xc7a0('0x25')](function(_0x1c34d0){_0x7a8a4f[_0xc7a0('0x5f')]=_0x1c34d0;return _0x7a8a4f;})[_0xc7a0('0x25')](respondWithFilteredResult(_0x53ce1d,_0x294bd7))[_0xc7a0('0x2f')](handleError(_0x53ce1d,null));};exports[_0xc7a0('0x60')]=function(_0x2b32d3,_0x3e7a3d){var _0x16fc8b={'raw':![],'where':{'id':_0x2b32d3[_0xc7a0('0x61')]['id']},'include':[{'model':db[_0xc7a0('0x43')],'as':'mandatoryDispositionPause'}]},_0x28203e={};_0x28203e[_0xc7a0('0x49')]=_[_0xc7a0('0x4b')](db['SmsAccount'][_0xc7a0('0x46')]);_0x28203e[_0xc7a0('0x4a')]=_[_0xc7a0('0x4b')](_0x2b32d3[_0xc7a0('0x4a')]);_0x28203e[_0xc7a0('0x4c')]=_[_0xc7a0('0x4d')](_0x28203e[_0xc7a0('0x49')],_0x28203e[_0xc7a0('0x4a')]);_0x16fc8b[_0xc7a0('0x4f')]=_[_0xc7a0('0x4d')](_0x28203e[_0xc7a0('0x49')],qs[_0xc7a0('0x4e')](_0x2b32d3[_0xc7a0('0x4a')][_0xc7a0('0x4e')]));_0x16fc8b['attributes']=_0x16fc8b['attributes']['length']?_0x16fc8b[_0xc7a0('0x4f')]:_0x28203e[_0xc7a0('0x49')];if(_0x2b32d3[_0xc7a0('0x4a')][_0xc7a0('0x5c')]){_0x16fc8b[_0xc7a0('0x5d')]=[{'all':!![]}];}_0x16fc8b=_[_0xc7a0('0x58')]({},_0x16fc8b,_0x2b32d3[_0xc7a0('0x5a')]);return db[_0xc7a0('0x5b')]['find'](_0x16fc8b)[_0xc7a0('0x25')](handleEntityNotFound(_0x3e7a3d,null))[_0xc7a0('0x25')](respondWithResult(_0x3e7a3d,null))[_0xc7a0('0x2f')](handleError(_0x3e7a3d,null));};exports[_0xc7a0('0x62')]=function(_0x361676,_0x5d417e){return db[_0xc7a0('0x5b')][_0xc7a0('0x62')](_0x361676['body'],{})[_0xc7a0('0x25')](function(_0x4aefbc){var _0x5196a3=_0x361676[_0xc7a0('0x63')][_0xc7a0('0x3d')]({'plain':!![]});if(!_0x5196a3)throw new Error(_0xc7a0('0x64'));if(_0x5196a3[_0xc7a0('0x65')]==='user'){var _0x3a928a=_0x4aefbc['get']({'plain':!![]});var _0x25c36f='SmsAccounts';return db['UserProfileSection'][_0xc7a0('0x66')]({'where':{'name':_0x25c36f,'userProfileId':_0x5196a3['userProfileId']},'raw':!![]})['then'](function(_0x43de8c){if(_0x43de8c&&_0x43de8c['autoAssociation']===0x0){return db[_0xc7a0('0x3f')][_0xc7a0('0x62')]({'name':_0x3a928a['name'],'resourceId':_0x3a928a['id'],'type':_0x43de8c[_0xc7a0('0x41')],'sectionId':_0x43de8c['id']},{})[_0xc7a0('0x25')](function(){return _0x4aefbc;});}else{return _0x4aefbc;}})[_0xc7a0('0x2f')](function(_0x11e6f9){logger[_0xc7a0('0x2c')](_0xc7a0('0x67'),_0x11e6f9);throw _0x11e6f9;});}return _0x4aefbc;})[_0xc7a0('0x25')](respondWithResult(_0x5d417e,0xc9))[_0xc7a0('0x2f')](handleError(_0x5d417e,null));};exports[_0xc7a0('0x3c')]=function(_0x3db203,_0x485efe){if(_0x3db203['body']['id']){delete _0x3db203[_0xc7a0('0x68')]['id'];}return db['SmsAccount'][_0xc7a0('0x66')]({'where':{'id':_0x3db203[_0xc7a0('0x61')]['id']},'include':[{'model':db[_0xc7a0('0x43')],'as':_0xc7a0('0x44')}]})[_0xc7a0('0x25')](handleEntityNotFound(_0x485efe,null))[_0xc7a0('0x25')](saveUpdates(_0x3db203[_0xc7a0('0x68')],null))[_0xc7a0('0x25')](respondWithResult(_0x485efe,null))[_0xc7a0('0x2f')](handleError(_0x485efe,null));};exports[_0xc7a0('0x69')]=function(_0x4ca269,_0x1671dd){return db[_0xc7a0('0x5b')][_0xc7a0('0x66')]({'where':{'id':_0x4ca269[_0xc7a0('0x61')]['id']}})[_0xc7a0('0x25')](handleEntityNotFound(_0x1671dd,null))[_0xc7a0('0x25')](removeEntity(_0x1671dd,null))[_0xc7a0('0x2f')](handleError(_0x1671dd,null));};exports[_0xc7a0('0x6a')]=function(_0x3196c8,_0x11bcbe){return db[_0xc7a0('0x5b')][_0xc7a0('0x6a')]()['then'](respondWithResult(_0x11bcbe,null))['catch'](handleError(_0x11bcbe,null));};exports[_0xc7a0('0x6b')]=function(_0x19f4f7,_0x2ceaf4,_0x63ecfb){if(_0x19f4f7[_0xc7a0('0x68')]['id']){delete _0x19f4f7[_0xc7a0('0x68')]['id'];}return db[_0xc7a0('0x5b')]['find']({'where':{'id':_0x19f4f7[_0xc7a0('0x61')]['id']}})[_0xc7a0('0x25')](handleEntityNotFound(_0x2ceaf4,null))[_0xc7a0('0x25')](function(_0x2e840b){if(_0x2e840b){_0x19f4f7[_0xc7a0('0x68')][_0xc7a0('0x6c')]=_0x2e840b['id'];return db[_0xc7a0('0x6d')][_0xc7a0('0x62')](_0x19f4f7['body']);}})[_0xc7a0('0x25')](respondWithResult(_0x2ceaf4,null))[_0xc7a0('0x2f')](handleError(_0x2ceaf4,null));};exports['getDispositions']=function(_0x132c6d,_0x569451,_0x49e069){var _0x534fb3={'raw':![],'where':{}};var _0xc6ec47={};var _0x56aef4={'count':0x0,'rows':[]};return db['SmsAccount'][_0xc7a0('0x6e')]({'where':{'id':_0x132c6d[_0xc7a0('0x61')]['id']}})[_0xc7a0('0x25')](handleEntityNotFound(_0x569451,null))['then'](function(_0x164588){if(_0x164588){_0xc6ec47['model']=_[_0xc7a0('0x4b')](db[_0xc7a0('0x6d')][_0xc7a0('0x46')]);_0xc6ec47['query']=_['keys'](_0x132c6d[_0xc7a0('0x4a')]);_0xc6ec47[_0xc7a0('0x4c')]=_[_0xc7a0('0x4d')](_0xc6ec47[_0xc7a0('0x49')],_0xc6ec47[_0xc7a0('0x4a')]);_0x534fb3[_0xc7a0('0x4f')]=_['intersection'](_0xc6ec47['model'],qs[_0xc7a0('0x4e')](_0x132c6d['query']['fields']));_0x534fb3[_0xc7a0('0x4f')]=_0x534fb3['attributes'][_0xc7a0('0x50')]?_0x534fb3['attributes']:_0xc6ec47[_0xc7a0('0x49')];if(!_0x132c6d[_0xc7a0('0x4a')][_0xc7a0('0x51')](_0xc7a0('0x52'))){_0x534fb3[_0xc7a0('0x37')]=qs['limit'](_0x132c6d[_0xc7a0('0x4a')][_0xc7a0('0x37')]);_0x534fb3['offset']=qs['offset'](_0x132c6d[_0xc7a0('0x4a')][_0xc7a0('0x34')]);}_0x534fb3['order']=qs[_0xc7a0('0x54')](_0x132c6d[_0xc7a0('0x4a')][_0xc7a0('0x54')]);_0x534fb3[_0xc7a0('0x55')]=qs[_0xc7a0('0x4c')](_[_0xc7a0('0x56')](_0x132c6d['query'],_0xc6ec47[_0xc7a0('0x4c')]));_0x534fb3[_0xc7a0('0x55')][_0xc7a0('0x6c')]=_0x164588['id'];if(_0x132c6d[_0xc7a0('0x4a')]['filter']){_0x534fb3['where']=_[_0xc7a0('0x58')](_0x534fb3[_0xc7a0('0x55')],{'$or':_[_0xc7a0('0x45')](_0x534fb3['attributes'],function(_0xe4444){var _0x149ac2={};_0x149ac2[_0xe4444]={'$like':'%'+_0x132c6d[_0xc7a0('0x4a')]['filter']+'%'};return _0x149ac2;})});}_0x534fb3=_[_0xc7a0('0x58')]({},_0x534fb3,_0x132c6d['options']);return db['Disposition'][_0xc7a0('0x36')]({'where':_0x534fb3[_0xc7a0('0x55')]})[_0xc7a0('0x25')](function(_0x36b6f9){_0x56aef4[_0xc7a0('0x36')]=_0x36b6f9;if(_0x132c6d[_0xc7a0('0x4a')][_0xc7a0('0x5c')]){_0x534fb3['include']=[{'all':!![]}];}return db[_0xc7a0('0x6d')]['findAll'](_0x534fb3);})['then'](function(_0x2d4d34){_0x56aef4[_0xc7a0('0x5f')]=_0x2d4d34;return _0x56aef4;});}})[_0xc7a0('0x25')](respondWithFilteredResult(_0x569451,_0x534fb3))['catch'](handleError(_0x569451,null));};exports['removeDispositions']=function(_0xa73553,_0x2c1808,_0x547f51){return db[_0xc7a0('0x5b')][_0xc7a0('0x66')]({'where':{'id':_0xa73553[_0xc7a0('0x61')]['id']}})['then'](handleEntityNotFound(_0x2c1808,null))[_0xc7a0('0x25')](function(_0x25fb50){if(_0x25fb50){return _0x25fb50[_0xc7a0('0x6f')](_0xa73553['query'][_0xc7a0('0x70')]);}})[_0xc7a0('0x25')](respondWithStatusCode(_0x2c1808,null))[_0xc7a0('0x2f')](handleError(_0x2c1808,null));};exports[_0xc7a0('0x71')]=function(_0x3f517d,_0x7abceb,_0x4ef603){if(_0x3f517d[_0xc7a0('0x68')]['id']){delete _0x3f517d[_0xc7a0('0x68')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x3f517d[_0xc7a0('0x61')]['id']}})[_0xc7a0('0x25')](handleEntityNotFound(_0x7abceb,null))['then'](function(_0x4734ed){if(_0x4734ed){_0x3f517d[_0xc7a0('0x68')][_0xc7a0('0x6c')]=_0x4734ed['id'];return db[_0xc7a0('0x72')][_0xc7a0('0x62')](_0x3f517d[_0xc7a0('0x68')]);}})['then'](respondWithResult(_0x7abceb,null))[_0xc7a0('0x2f')](handleError(_0x7abceb,null));};exports[_0xc7a0('0x73')]=function(_0xe10ef7,_0x144a93,_0x5b6783){var _0x1ba6f0={'raw':![],'where':{}};var _0x1fa575={};var _0x335a29={'count':0x0,'rows':[]};return db[_0xc7a0('0x5b')][_0xc7a0('0x6e')]({'where':{'id':_0xe10ef7['params']['id']}})['then'](handleEntityNotFound(_0x144a93,null))[_0xc7a0('0x25')](function(_0x44982b){if(_0x44982b){_0x1fa575[_0xc7a0('0x49')]=_[_0xc7a0('0x4b')](db[_0xc7a0('0x72')]['rawAttributes']);_0x1fa575[_0xc7a0('0x4a')]=_[_0xc7a0('0x4b')](_0xe10ef7[_0xc7a0('0x4a')]);_0x1fa575[_0xc7a0('0x4c')]=_[_0xc7a0('0x4d')](_0x1fa575[_0xc7a0('0x49')],_0x1fa575[_0xc7a0('0x4a')]);_0x1ba6f0[_0xc7a0('0x4f')]=_[_0xc7a0('0x4d')](_0x1fa575['model'],qs[_0xc7a0('0x4e')](_0xe10ef7[_0xc7a0('0x4a')]['fields']));_0x1ba6f0[_0xc7a0('0x4f')]=_0x1ba6f0[_0xc7a0('0x4f')]['length']?_0x1ba6f0['attributes']:_0x1fa575[_0xc7a0('0x49')];if(!_0xe10ef7[_0xc7a0('0x4a')]['hasOwnProperty'](_0xc7a0('0x52'))){_0x1ba6f0['limit']=qs[_0xc7a0('0x37')](_0xe10ef7[_0xc7a0('0x4a')][_0xc7a0('0x37')]);_0x1ba6f0[_0xc7a0('0x34')]=qs[_0xc7a0('0x34')](_0xe10ef7['query'][_0xc7a0('0x34')]);}_0x1ba6f0[_0xc7a0('0x53')]=qs[_0xc7a0('0x54')](_0xe10ef7[_0xc7a0('0x4a')][_0xc7a0('0x54')]);_0x1ba6f0['where']=qs['filters'](_[_0xc7a0('0x56')](_0xe10ef7[_0xc7a0('0x4a')],_0x1fa575[_0xc7a0('0x4c')]));_0x1ba6f0['where']['SmsAccountId']=_0x44982b['id'];if(_0xe10ef7['query'][_0xc7a0('0x57')]){_0x1ba6f0['where']=_[_0xc7a0('0x58')](_0x1ba6f0[_0xc7a0('0x55')],{'$or':_[_0xc7a0('0x45')](_0x1ba6f0['attributes'],function(_0x5b4c5b){var _0x486b62={};_0x486b62[_0x5b4c5b]={'$like':'%'+_0xe10ef7['query'][_0xc7a0('0x57')]+'%'};return _0x486b62;})});}_0x1ba6f0=_[_0xc7a0('0x58')]({},_0x1ba6f0,_0xe10ef7[_0xc7a0('0x5a')]);return db[_0xc7a0('0x72')][_0xc7a0('0x36')]({'where':_0x1ba6f0[_0xc7a0('0x55')]})['then'](function(_0x51a2d3){_0x335a29[_0xc7a0('0x36')]=_0x51a2d3;if(_0xe10ef7['query'][_0xc7a0('0x5c')]){_0x1ba6f0['include']=[{'all':!![]}];}return db[_0xc7a0('0x72')][_0xc7a0('0x5e')](_0x1ba6f0);})['then'](function(_0x1eb017){_0x335a29[_0xc7a0('0x5f')]=_0x1eb017;return _0x335a29;});}})[_0xc7a0('0x25')](respondWithFilteredResult(_0x144a93,_0x1ba6f0))[_0xc7a0('0x2f')](handleError(_0x144a93,null));};exports['removeAnswers']=function(_0x2abb7f,_0x5bee8c,_0xd1418a){return db[_0xc7a0('0x5b')]['find']({'where':{'id':_0x2abb7f[_0xc7a0('0x61')]['id']}})[_0xc7a0('0x25')](handleEntityNotFound(_0x5bee8c,null))[_0xc7a0('0x25')](function(_0x2b0e5f){if(_0x2b0e5f){return _0x2b0e5f[_0xc7a0('0x74')](_0x2abb7f['query']['ids']);}})[_0xc7a0('0x25')](respondWithStatusCode(_0x5bee8c,null))[_0xc7a0('0x2f')](handleError(_0x5bee8c,null));};exports[_0xc7a0('0x75')]=function(_0x42e9e9,_0x4a2804,_0x50f033){var _0x71e43f={'channel':_0xc7a0('0x76')};var _0x5cb55d=[];var _0x4e140a=[];var _0x11c6a1={};return db[_0xc7a0('0x5b')]['find']({'where':{'id':_0x42e9e9[_0xc7a0('0x61')]['id']},'include':[{'model':db[_0xc7a0('0x77')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x4a2804,null))[_0xc7a0('0x25')](function(_0x1112d1){_0x71e43f[_0xc7a0('0x78')]=_0x1112d1;_0x71e43f[_0xc7a0('0x79')]=_[_0xc7a0('0x7a')](_0x1112d1['Applications'],['priority'],[_0xc7a0('0x7b')]);if(_0x71e43f['account']['Applications']){delete _0x71e43f[_0xc7a0('0x78')][_0xc7a0('0x7c')];}return db[_0xc7a0('0x7d')][_0xc7a0('0x6a')]();})[_0xc7a0('0x25')](function(_0xf34828){if(!_0xf34828){throw new db[(_0xc7a0('0x7e'))][(_0xc7a0('0x7f'))](_0xc7a0('0x80'));}_0x5cb55d=_[_0xc7a0('0x81')](_[_0xc7a0('0x4b')](_0xf34828),[_0xc7a0('0x82'),'updatedAt']);_0x4e140a=_['difference'](_['keys'](_0xf34828),[_0xc7a0('0x82'),_0xc7a0('0x83'),_0xc7a0('0x84'),_0xc7a0('0x85')]);_0x71e43f[_0xc7a0('0x68')]={'mapKey':_0xc7a0('0x86')};if(_0x71e43f[_0xc7a0('0x78')][_0xc7a0('0x48')]){switch(_0x71e43f[_0xc7a0('0x78')][_0xc7a0('0x48')]){case _0xc7a0('0x87'):_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x88')]=_0x42e9e9[_0xc7a0('0x68')]['From'];_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x68')]=_0x42e9e9['body'][_0xc7a0('0x89')];_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x8a')]=_0x42e9e9[_0xc7a0('0x68')]['MessageSid'];break;case _0xc7a0('0x8b'):_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x88')]='+'+_0x42e9e9['body'][_0xc7a0('0x8c')];_0x71e43f[_0xc7a0('0x68')]['body']=_0x42e9e9[_0xc7a0('0x68')][_0xc7a0('0x8d')];break;case _0xc7a0('0x8e'):_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x88')]=_0x42e9e9['body']['from'];_0x71e43f['body'][_0xc7a0('0x68')]=_0x42e9e9[_0xc7a0('0x68')][_0xc7a0('0x2e')];break;case _0xc7a0('0x8f'):_0x71e43f['body'][_0xc7a0('0x88')]=_0x42e9e9['body'][_0xc7a0('0x88')];_0x71e43f[_0xc7a0('0x68')]['body']=_0x42e9e9[_0xc7a0('0x68')][_0xc7a0('0x68')];_0x71e43f['body'][_0xc7a0('0x8a')]=_0x42e9e9[_0xc7a0('0x68')][_0xc7a0('0x90')];break;case _0xc7a0('0x91'):_0x71e43f['body'][_0xc7a0('0x88')]=_0x42e9e9[_0xc7a0('0x68')][_0xc7a0('0x92')];_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x68')]=_0x42e9e9[_0xc7a0('0x68')][_0xc7a0('0x93')];_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x8a')]=_0x42e9e9[_0xc7a0('0x68')]['MessageUUID'];break;case _0xc7a0('0x94'):_0x71e43f[_0xc7a0('0x68')]['from']='+'+_0x42e9e9[_0xc7a0('0x68')][_0xc7a0('0x95')][0x0][_0xc7a0('0x88')];_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x68')]=_0x42e9e9[_0xc7a0('0x68')]['results'][0x0]['text'];_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x8a')]=_0x42e9e9[_0xc7a0('0x68')]['results'][0x0][_0xc7a0('0x8a')];break;case'csc':_0x71e43f['body'][_0xc7a0('0x88')]=_0x42e9e9[_0xc7a0('0x68')][_0xc7a0('0x96')];_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x68')]=_0x42e9e9[_0xc7a0('0x68')]['segmentedMessage'][_0xc7a0('0x2e')];break;case _0xc7a0('0x97'):_0x71e43f[_0xc7a0('0x68')]['from']=_0x42e9e9[_0xc7a0('0x68')][_0xc7a0('0x98')];_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x68')]=_0x42e9e9['body'][_0xc7a0('0x8d')];_0x71e43f[_0xc7a0('0x68')]['messageId']=_0x42e9e9[_0xc7a0('0x68')][_0xc7a0('0x99')];break;case _0xc7a0('0x9a'):_0x71e43f[_0xc7a0('0x68')]['messageId']=_0x42e9e9[_0xc7a0('0x68')][0x0][_0xc7a0('0x2e')]['id'];_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x88')]=_0x42e9e9[_0xc7a0('0x68')][0x0]['message'][_0xc7a0('0x88')];_0x71e43f['body']['body']=_0x42e9e9['body'][0x0]['message'][_0xc7a0('0x8d')];break;case _0xc7a0('0x9b'):_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x88')]=_0x42e9e9[_0xc7a0('0x68')][_0xc7a0('0x88')];_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x68')]=_0x42e9e9['body'][_0xc7a0('0x2e')];_0x71e43f[_0xc7a0('0x68')]['messageId']=_0x42e9e9[_0xc7a0('0x68')][_0xc7a0('0x9c')];break;}}if(_0x71e43f[_0xc7a0('0x68')]['id']){delete _0x71e43f['body']['id'];}if(_[_0xc7a0('0x9d')](_0x71e43f[_0xc7a0('0x68')]['from'])){throw new db[(_0xc7a0('0x7e'))][(_0xc7a0('0x7f'))](_0xc7a0('0x9e'));}if(_['isNil'](_0x71e43f[_0xc7a0('0x68')]['body'])||_0x71e43f[_0xc7a0('0x68')]['body']===''){throw new db[(_0xc7a0('0x7e'))]['ValidationError'](_0xc7a0('0x9f'));}if(_[_0xc7a0('0x9d')](_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0xa0')])){throw new db[(_0xc7a0('0x7e'))][(_0xc7a0('0x7f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e140a);}if(!_['includes'](_0x4e140a,_0x71e43f[_0xc7a0('0x68')]['mapKey'])){throw new db[(_0xc7a0('0x7e'))][(_0xc7a0('0x7f'))](_0xc7a0('0xa1')+_0x4e140a);}_0x11c6a1[_0x71e43f['body']['mapKey']]=_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x88')];return db[_0xc7a0('0xa2')][_0xc7a0('0x66')]({'where':{'id':_0x71e43f['account']['ListId']},'include':[{'model':db[_0xc7a0('0x7d')],'as':'Contacts','where':_0x11c6a1,'limit':0x1,'order':[[_0xc7a0('0x83'),'DESC']]}]});})[_0xc7a0('0x25')](handleEntityNotFound(_0x4a2804,null))[_0xc7a0('0x25')](function(_0x37c409){if(_0x37c409){_0x71e43f[_0xc7a0('0xa3')]=_[_0xc7a0('0xa4')](_0x37c409,[_0xc7a0('0xa5')]);if(_0x37c409[_0xc7a0('0xa5')]['length']){return _0x37c409[_0xc7a0('0xa5')][0x0];}var _0x278afa=_['defaults'](_0x71e43f[_0xc7a0('0x68')],{'firstName':_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x88')],'ListId':_0x37c409['id']});_0x278afa[_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0xa0')]]=_0x71e43f['body'][_0xc7a0('0x88')];return db['CmContact'][_0xc7a0('0x62')](_0x278afa,{'fields':_0x5cb55d,'raw':!![]});}})[_0xc7a0('0x25')](handleEntityNotFound(_0x4a2804,null))['then'](function(_0x2dd242){if(_0x2dd242){_0x71e43f[_0xc7a0('0xa6')]=_0x2dd242;var _0x45ecb6={'ContactId':_0x2dd242['id'],'phone':_0x71e43f['body'][_0xc7a0('0x88')],'SmsAccountId':_0x42e9e9['params']['id']};var _0x2c5bf4={'ContactId':_0x2dd242['id'],'SmsAccountId':_0x42e9e9[_0xc7a0('0x61')]['id'],'closed':![]};return db['SmsInteraction'][_0xc7a0('0x66')]({'where':_0x2c5bf4})[_0xc7a0('0x25')](function(_0x3bb4f7){if(_0x3bb4f7){return[_0x3bb4f7,![]];}return db['SmsInteraction'][_0xc7a0('0x62')](_0x45ecb6)[_0xc7a0('0x25')](function(_0x33e676){return[_0x33e676,!![]];});});}})[_0xc7a0('0xa7')](function(_0x1b232d,_0x94de16){_0x71e43f[_0xc7a0('0xa8')]=_0x1b232d[_0xc7a0('0x3d')]({'plain':!![]});_0x71e43f['interaction'][_0xc7a0('0xa9')]=![];if(_0x94de16){if(_0x71e43f[_0xc7a0('0x78')][_0xc7a0('0xaa')]){_0x71e43f[_0xc7a0('0x79')][_0xc7a0('0xab')]({'id':0x0,'priority':_0x71e43f[_0xc7a0('0x79')][_0xc7a0('0x50')]+0x1,'app':_0xc7a0('0xac'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x71e43f['interaction'][_0xc7a0('0xa9')]=!![];}return db['SmsMessage'][_0xc7a0('0x62')]({'phone':_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x88')],'messageId':_0x71e43f['body'][_0xc7a0('0x8a')],'body':_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0x68')],'SmsAccountId':_0x42e9e9[_0xc7a0('0x61')]['id'],'SmsInteractionId':_0x1b232d['id'],'direction':'in','ContactId':_0x1b232d[_0xc7a0('0xad')],'AttachmentId':_0x71e43f[_0xc7a0('0x68')][_0xc7a0('0xae')]});})[_0xc7a0('0x25')](function(_0x1f4ce1){_0x71e43f[_0xc7a0('0x2e')]=_0x1f4ce1;if(_0x71e43f[_0xc7a0('0xa8')]['UserId']){return db[_0xc7a0('0xaf')][_0xc7a0('0x66')]({'attributes':['id',_0xc7a0('0x41')],'where':{'id':_0x71e43f[_0xc7a0('0xa8')]['UserId']}})[_0xc7a0('0x25')](function(_0x18e244){if(_0x18e244){_0x71e43f[_0xc7a0('0x79')][_0xc7a0('0xb0')]({'id':0x0,'priority':0x0,'app':_0xc7a0('0xb1'),'appdata':_0x18e244['name']+','+(_0x71e43f[_0xc7a0('0x78')]['waitForTheAssignedAgent']||0xa),'interval':_0xc7a0('0xb2')});}return respondWithRpcPromise(_0xc7a0('0xb3'),_0xc7a0('0xb4'),_0x71e43f);});}return respondWithRpcPromise(_0xc7a0('0xb3'),_0xc7a0('0xb4'),_0x71e43f);})[_0xc7a0('0x25')](function(_0x47512b){if(_0x47512b){var _0x613c0=0xc8;var _0x27d9d3='receiveMessage';logger[_0xc7a0('0x26')](_0xc7a0('0x2a'),_0x27d9d3,_0x613c0,'entity\x20found');logger[_0xc7a0('0x29')](_0xc7a0('0xb5'),_0x27d9d3,_0x613c0,_0xc7a0('0xb6'),JSON[_0xc7a0('0x2b')](_0x47512b));if(_0x71e43f[_0xc7a0('0x78')][_0xc7a0('0x48')]===_0xc7a0('0x87')){return _0x4a2804[_0xc7a0('0x32')](_0x613c0)[_0xc7a0('0xb7')](_0xc7a0('0xb8'),_0xc7a0('0xb9'))[_0xc7a0('0x42')](_0xc7a0('0xba'));}else{return _0x4a2804['status'](_0x613c0)[_0xc7a0('0x33')](_0x47512b);}}})['catch'](handleError(_0x4a2804,null));};exports[_0xc7a0('0xbb')]=function(_0x319d79,_0x47310c){var _0x17d9a3=_0x319d79[_0xc7a0('0x61')]['id'];var _0x3f4a69=_0x319d79[_0xc7a0('0x68')];var _0x40b1c9=0xc8;var _0x454175=null;return db[_0xc7a0('0xbc')][_0xc7a0('0xbd')]({'isolationLevel':db[_0xc7a0('0xbc')]['Transaction']['ISOLATION_LEVELS'][_0xc7a0('0xbe')]},function(_0xcceccf){return db[_0xc7a0('0x5b')][_0xc7a0('0x6e')]({'where':{'id':_0x17d9a3},'transaction':_0xcceccf})[_0xc7a0('0x25')](function(_0x1dcbbb){if(_0x1dcbbb){return db[_0xc7a0('0x77')][_0xc7a0('0x69')]({'where':{'SmsAccountId':_0x17d9a3},'transaction':_0xcceccf})['then'](function(){var _0x4a838a=_['map'](_0x3f4a69,function(_0x47a5d0){_0x47a5d0[_0xc7a0('0x6c')]=_0x17d9a3;return _0x47a5d0;});return db[_0xc7a0('0x77')][_0xc7a0('0xbf')](_0x4a838a,{'transaction':_0xcceccf});});}else{_0x40b1c9=0x194;_0x454175=[];}});})[_0xc7a0('0x25')](function(){if(_0x40b1c9!==0x194){return db[_0xc7a0('0x77')][_0xc7a0('0xc0')]({'where':{'SmsAccountId':_0x17d9a3},'order':_0xc7a0('0xc1')})[_0xc7a0('0x25')](function(_0x252367){_0x454175=_0x252367;});}})[_0xc7a0('0x2f')](function(_0x2b3b9f){_0x40b1c9=0x1f4;logger['error'](_0x2b3b9f[_0xc7a0('0x40')]);if(_0x2b3b9f[_0xc7a0('0x41')]){delete _0x2b3b9f['name'];}_0x454175=_0x2b3b9f;})[_0xc7a0('0xc2')](function(){if(_0x454175===null){_0x47310c['sendStatus'](_0x40b1c9);}else{if(_0x40b1c9===0x1f4){_0x47310c[_0xc7a0('0x32')](_0x40b1c9)['send'](_0x454175);}else{_0x47310c[_0xc7a0('0x32')](_0x40b1c9)[_0xc7a0('0x33')](_0x454175);}}});};exports[_0xc7a0('0xc3')]=function(_0x306b4a,_0x331d6e,_0x2918c8){var _0x3c2e29={};var _0x10d61f={};var _0x176a94;var _0x2dba73;return db[_0xc7a0('0x5b')][_0xc7a0('0x6e')]({'where':{'id':_0x306b4a[_0xc7a0('0x61')]['id']}})['then'](handleEntityNotFound(_0x331d6e,null))[_0xc7a0('0x25')](function(_0xe870ca){if(_0xe870ca){_0x176a94=_0xe870ca;_0x10d61f['model']=_['keys'](db[_0xc7a0('0x77')][_0xc7a0('0x46')]);_0x10d61f[_0xc7a0('0x4a')]=_[_0xc7a0('0x4b')](_0x306b4a[_0xc7a0('0x4a')]);_0x10d61f[_0xc7a0('0x4c')]=_[_0xc7a0('0x4d')](_0x10d61f[_0xc7a0('0x49')],_0x10d61f[_0xc7a0('0x4a')]);_0x3c2e29[_0xc7a0('0x4f')]=_[_0xc7a0('0x4d')](_0x10d61f[_0xc7a0('0x49')],qs[_0xc7a0('0x4e')](_0x306b4a['query'][_0xc7a0('0x4e')]));_0x3c2e29[_0xc7a0('0x4f')]=_0x3c2e29[_0xc7a0('0x4f')][_0xc7a0('0x50')]?_0x3c2e29[_0xc7a0('0x4f')]:_0x10d61f[_0xc7a0('0x49')];_0x3c2e29[_0xc7a0('0x53')]=qs[_0xc7a0('0x54')](_0x306b4a[_0xc7a0('0x4a')][_0xc7a0('0x54')]);_0x3c2e29[_0xc7a0('0x55')]=qs[_0xc7a0('0x4c')](_['pick'](_0x306b4a['query'],_0x10d61f[_0xc7a0('0x4c')]));if(_0x306b4a['query'][_0xc7a0('0x57')]){_0x3c2e29[_0xc7a0('0x55')]=_['merge'](_0x3c2e29[_0xc7a0('0x55')],{'$or':_[_0xc7a0('0x45')](_0x3c2e29[_0xc7a0('0x4f')],function(_0x33dcf1){var _0x1a7586={};_0x1a7586[_0x33dcf1]={'$like':'%'+_0x306b4a[_0xc7a0('0x4a')][_0xc7a0('0x57')]+'%'};return _0x1a7586;})});}_0x3c2e29=_['merge']({},_0x3c2e29,_0x306b4a[_0xc7a0('0x5a')]);return _0x176a94[_0xc7a0('0xc3')](_0x3c2e29);}})[_0xc7a0('0x25')](function(_0x309106){if(_0x309106){_0x2dba73=_0x309106[_0xc7a0('0x50')];if(!_0x306b4a[_0xc7a0('0x4a')]['hasOwnProperty']('nolimit')){_0x3c2e29[_0xc7a0('0x37')]=qs[_0xc7a0('0x37')](_0x306b4a[_0xc7a0('0x4a')][_0xc7a0('0x37')]);_0x3c2e29[_0xc7a0('0x34')]=qs['offset'](_0x306b4a[_0xc7a0('0x4a')][_0xc7a0('0x34')]);}return _0x176a94[_0xc7a0('0xc3')](_0x3c2e29);}})[_0xc7a0('0x25')](function(_0x3552b8){if(_0x3552b8){return _0x3552b8?{'count':_0x2dba73,'rows':_0x3552b8}:null;}})['then'](respondWithResult(_0x331d6e,null))[_0xc7a0('0x2f')](handleError(_0x331d6e,null));};exports[_0xc7a0('0xc4')]=function(_0x277fed,_0x1dedaa,_0x2b785d){var _0x1dd556={'raw':![],'where':{}};var _0x510e6c={};var _0x339c3e={'count':0x0,'rows':[]};return db[_0xc7a0('0x5b')]['findOne']({'where':{'id':_0x277fed[_0xc7a0('0x61')]['id']}})[_0xc7a0('0x25')](handleEntityNotFound(_0x1dedaa,null))[_0xc7a0('0x25')](function(_0x5dbf86){if(_0x5dbf86){_0x510e6c['model']=_[_0xc7a0('0x4b')](db[_0xc7a0('0xc5')][_0xc7a0('0x46')]);_0x510e6c[_0xc7a0('0x4a')]=_['keys'](_0x277fed[_0xc7a0('0x4a')]);_0x510e6c[_0xc7a0('0x4c')]=_[_0xc7a0('0x4d')](_0x510e6c[_0xc7a0('0x49')],_0x510e6c['query']);_0x1dd556[_0xc7a0('0x4f')]=_[_0xc7a0('0x4d')](_0x510e6c[_0xc7a0('0x49')],qs[_0xc7a0('0x4e')](_0x277fed['query']['fields']));_0x1dd556[_0xc7a0('0x4f')]=_0x1dd556[_0xc7a0('0x4f')][_0xc7a0('0x50')]?_0x1dd556[_0xc7a0('0x4f')]:_0x510e6c[_0xc7a0('0x49')];if(!_0x277fed[_0xc7a0('0x4a')]['hasOwnProperty'](_0xc7a0('0x52'))){_0x1dd556[_0xc7a0('0x37')]=qs['limit'](_0x277fed['query']['limit']);_0x1dd556[_0xc7a0('0x34')]=qs['offset'](_0x277fed[_0xc7a0('0x4a')]['offset']);}_0x1dd556['order']=qs['sort'](_0x277fed[_0xc7a0('0x4a')][_0xc7a0('0x54')]);_0x1dd556['where']=qs[_0xc7a0('0x4c')](_[_0xc7a0('0x56')](_0x277fed[_0xc7a0('0x4a')],_0x510e6c[_0xc7a0('0x4c')]));_0x1dd556[_0xc7a0('0x55')][_0xc7a0('0x6c')]=_0x5dbf86['id'];if(_0x277fed[_0xc7a0('0x4a')][_0xc7a0('0x57')]){_0x1dd556['where']=_[_0xc7a0('0x58')](_0x1dd556['where'],{'$or':_[_0xc7a0('0x45')](_0x1dd556['attributes'],function(_0x442ed7){var _0x206b9d={};_0x206b9d[_0x442ed7]={'$like':'%'+_0x277fed['query'][_0xc7a0('0x57')]+'%'};return _0x206b9d;})});}_0x1dd556=_[_0xc7a0('0x58')]({},_0x1dd556,_0x277fed[_0xc7a0('0x5a')]);return db[_0xc7a0('0xc5')]['count']({'where':_0x1dd556[_0xc7a0('0x55')]})[_0xc7a0('0x25')](function(_0x39adc8){_0x339c3e[_0xc7a0('0x36')]=_0x39adc8;if(_0x277fed['query'][_0xc7a0('0x5c')]){_0x1dd556[_0xc7a0('0x5d')]=[{'model':db[_0xc7a0('0x7d')],'as':_0xc7a0('0xc6'),'required':![]},{'model':db[_0xc7a0('0xaf')],'as':_0xc7a0('0xc7'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xc7a0('0xc8')],'as':_0xc7a0('0xc9'),'attributes':['id','name',_0xc7a0('0xca')],'where':_0x277fed['query']['tag']?{'id':_0x277fed[_0xc7a0('0x4a')]['tag']}:undefined,'required':_0x277fed[_0xc7a0('0x4a')][_0xc7a0('0xcb')]?!![]:![]}];}return db[_0xc7a0('0xc5')][_0xc7a0('0x5e')](_0x1dd556);})[_0xc7a0('0x25')](function(_0x34eee3){_0x339c3e[_0xc7a0('0x5f')]=_0x34eee3;return _0x339c3e;});}})[_0xc7a0('0x25')](respondWithFilteredResult(_0x1dedaa,_0x1dd556))[_0xc7a0('0x2f')](handleError(_0x1dedaa,null));};exports[_0xc7a0('0x42')]=function(_0x42e0bc,_0xa4e642,_0x4b8a19){var _0x1ab8cc,_0x9696c3,_0x3c4637;if(_[_0xc7a0('0x9d')](_0x42e0bc[_0xc7a0('0x68')][_0xc7a0('0x68')])||_0x42e0bc['body'][_0xc7a0('0x68')]===''){throw new db[(_0xc7a0('0x7e'))][(_0xc7a0('0x7f'))](_0xc7a0('0x9f'));}if(_[_0xc7a0('0x9d')](_0x42e0bc[_0xc7a0('0x68')]['to'])){throw new db[(_0xc7a0('0x7e'))][(_0xc7a0('0x7f'))](_0xc7a0('0xcc'));}_0x1ab8cc=_0x42e0bc['body']['to'];return db[_0xc7a0('0x5b')][_0xc7a0('0x66')]({'where':{'id':_0x42e0bc['params']['id']},'include':[{'model':db['CmList'],'as':_0xc7a0('0xcd'),'include':[{'model':db[_0xc7a0('0x7d')],'as':_0xc7a0('0xa5'),'where':{'mobile':_0x1ab8cc},'limit':0x1,'order':[[_0xc7a0('0x83'),_0xc7a0('0xce')]]}]}]})[_0xc7a0('0x25')](handleEntityNotFound(_0xa4e642,null))['then'](function(_0x4ae31e){if(_0x4ae31e&&_0x4ae31e[_0xc7a0('0xcd')]){_0x9696c3=_0x4ae31e[_0xc7a0('0x3d')]({'plain':!![]});if(_0x9696c3[_0xc7a0('0xcd')]&&_0x9696c3['List']['Contacts'][_0xc7a0('0x50')]){return _0x9696c3[_0xc7a0('0xcd')][_0xc7a0('0xa5')][0x0];}return db['CmContact']['create'](_[_0xc7a0('0xcf')](_0x42e0bc[_0xc7a0('0x68')],{'firstName':_0x1ab8cc,'mobile':_0x1ab8cc,'phone':_0x1ab8cc,'ListId':_0x9696c3[_0xc7a0('0x85')]}));}})[_0xc7a0('0x25')](handleEntityNotFound(_0xa4e642,null))['then'](function(_0x5e31c4){if(_0x5e31c4){_0x3c4637=_0x5e31c4;return db['SmsInteraction'][_0xc7a0('0x66')]({'where':{'ContactId':_0x3c4637['id'],'closed':![],'SmsAccountId':_0x9696c3['id']}})['then'](function(_0x125d42){if(_0x125d42){return[_0x125d42,![]];}return db[_0xc7a0('0xc5')][_0xc7a0('0x62')]({'UserId':_0x42e0bc[_0xc7a0('0x63')]['id'],'ContactId':_0x3c4637['id'],'SmsAccountId':_0x9696c3['id'],'phone':_0x1ab8cc,'firstMsgDirection':_0xc7a0('0xd0'),'Messages':[_[_0xc7a0('0x58')](_0x42e0bc[_0xc7a0('0x68')],{'read':![],'body':_0x42e0bc[_0xc7a0('0x68')][_0xc7a0('0x68')],'phone':_0x1ab8cc,'SmsAccountId':_0x9696c3['id'],'UserId':_0x42e0bc[_0xc7a0('0x63')]['id'],'ContactId':_0x3c4637['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xc7a0('0xd1')}]})[_0xc7a0('0x25')](function(_0x46296e){return[_0x46296e,!![]];});});}})[_0xc7a0('0xa7')](function(_0x3a8839,_0x18eaa6){if(_0x18eaa6){return _0x3a8839;}return db[_0xc7a0('0xd2')][_0xc7a0('0x62')](_[_0xc7a0('0x58')](_0x42e0bc['body'],{'read':![],'body':_0x42e0bc[_0xc7a0('0x68')][_0xc7a0('0x68')],'phone':_0x1ab8cc,'SmsAccountId':_0x9696c3['id'],'SmsInteractionId':_0x3a8839['id'],'UserId':_0x42e0bc[_0xc7a0('0x63')]['id'],'ContactId':_0x3c4637['id']}))[_0xc7a0('0x25')](function(_0x326946){_0x3a8839[_0xc7a0('0xd3')][_0xc7a0('0xd1')]=[];_0x3a8839[_0xc7a0('0xd3')]['Messages']['push'](_0x326946[_0xc7a0('0xd3')]);return _0x3a8839;});})[_0xc7a0('0x25')](respondWithResult(_0xa4e642,null))['catch'](handleError(_0xa4e642,null));};exports[_0xc7a0('0x32')]=function(_0x10b170,_0x4453f2,_0x16deba){if(_0x10b170[_0xc7a0('0x68')]['id']){delete _0x10b170[_0xc7a0('0x68')]['id'];}var _0x202703,_0x2419a2,_0x41f00b;return db['SmsAccount']['find']({'where':{'id':_0x10b170[_0xc7a0('0x61')]['id']}})[_0xc7a0('0x25')](handleEntityNotFound(_0x4453f2,null))[_0xc7a0('0x25')](function(_0x23742d){if(_0x23742d){_0x41f00b=_0x23742d;logger[_0xc7a0('0x29')](_0xc7a0('0x2a'),_0xc7a0('0x32'),_0xc7a0('0xd4'),_0x23742d[_0xc7a0('0x48')],util[_0xc7a0('0xd5')](_0x10b170[_0xc7a0('0x68')],{'showHidden':![],'depth':null}));switch(_0x23742d[_0xc7a0('0x48')]){case _0xc7a0('0x8b'):if(_0x10b170[_0xc7a0('0x68')][_0xc7a0('0xd6')]&&_0x10b170[_0xc7a0('0x68')][_0xc7a0('0x32')]){_0x2419a2=_0x10b170[_0xc7a0('0x68')][_0xc7a0('0x32')];return db[_0xc7a0('0xd2')][_0xc7a0('0x66')]({'where':{'messageId':_0x10b170[_0xc7a0('0x68')][_0xc7a0('0xd6')]}});}break;case _0xc7a0('0x8e'):if(_0x10b170[_0xc7a0('0x68')][_0xc7a0('0xd7')]&&_0x10b170[_0xc7a0('0x68')][_0xc7a0('0xd8')]){_0x2419a2=_0x10b170[_0xc7a0('0x68')][_0xc7a0('0xd8')];return db['SmsMessage'][_0xc7a0('0x66')]({'where':{'messageId':_0x10b170[_0xc7a0('0x68')][_0xc7a0('0xd7')]}});}break;case _0xc7a0('0x8f'):if(_0x10b170[_0xc7a0('0x68')]['message_id']&&_0x10b170[_0xc7a0('0x68')][_0xc7a0('0xd9')]){_0x2419a2=_0x10b170[_0xc7a0('0x68')][_0xc7a0('0xd9')];return db[_0xc7a0('0xd2')][_0xc7a0('0x66')]({'where':{'messageId':_0x10b170[_0xc7a0('0x68')][_0xc7a0('0x90')]}});}break;case'infobip':var _0x1ef4e4=_0x10b170['body'][_0xc7a0('0x95')][0x0];if(_0x1ef4e4[_0xc7a0('0x8a')]&&_0x1ef4e4[_0xc7a0('0x32')]['groupName']===_0xc7a0('0xda')){_0x2419a2=_0x1ef4e4[_0xc7a0('0x32')]['groupName'];return db[_0xc7a0('0xd2')]['find']({'where':{'messageId':_0x1ef4e4[_0xc7a0('0x8a')]}});}break;case _0xc7a0('0x97'):if(_0x10b170[_0xc7a0('0x68')][_0xc7a0('0x8a')]&&_0x10b170[_0xc7a0('0x68')][_0xc7a0('0x32')]){_0x2419a2=_0x10b170[_0xc7a0('0x68')][_0xc7a0('0x32')];return db[_0xc7a0('0xd2')][_0xc7a0('0x66')]({'where':{'messageId':_0x10b170['body'][_0xc7a0('0x8a')]}});}break;case _0xc7a0('0x9a'):if(_0x10b170['body'][0x0]['message']['id']){_0x2419a2=_0x10b170[_0xc7a0('0x68')][0x0][_0xc7a0('0x48')];return db[_0xc7a0('0xd2')][_0xc7a0('0x66')]({'where':{'messageId':_0x10b170[_0xc7a0('0x68')][0x0][_0xc7a0('0x2e')]['id']}});}break;case'intelepeer':if(_0x10b170[_0xc7a0('0x68')][_0xc7a0('0xdb')]&&_0x10b170[_0xc7a0('0x68')][_0xc7a0('0x32')]){_0x2419a2=_0x10b170[_0xc7a0('0x68')][_0xc7a0('0x32')];return db[_0xc7a0('0xd2')]['find']({'where':{'messageId':_0x10b170[_0xc7a0('0x68')][_0xc7a0('0xdb')]}});}break;}}})[_0xc7a0('0x25')](handleEntityNotFound(_0x4453f2,null))[_0xc7a0('0x25')](function(_0x4a9b37){if(_0x4a9b37){_0x202703=_0x4a9b37;switch(_0x41f00b[_0xc7a0('0x48')]){case _0xc7a0('0x8b'):if(_0x2419a2==='DELIVERED'){return _0x202703[_0xc7a0('0x3c')]({'read':!![]});}else{logger[_0xc7a0('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc7a0('0x32'),'skebby',util['inspect'](_0x10b170['body'],{'showHidden':![],'depth':null}));}break;case _0xc7a0('0x8e'):if(_0x2419a2==='1'){return _0x202703[_0xc7a0('0x3c')]({'read':!![]});}else{logger[_0xc7a0('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc7a0('0x32'),_0xc7a0('0x8b'),util[_0xc7a0('0xd5')](_0x10b170[_0xc7a0('0x68')],{'showHidden':![],'depth':null}));}break;case _0xc7a0('0x8f'):if(!_0x10b170[_0xc7a0('0x68')][_0xc7a0('0xdc')]&&_0x2419a2>=0xc8&&_0x2419a2<=0xce){return _0x202703[_0xc7a0('0x3c')]({'read':!![]});}else{logger[_0xc7a0('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xc7a0('0x8f'),util[_0xc7a0('0xd5')](_0x10b170[_0xc7a0('0x68')],{'showHidden':![],'depth':null}));}break;case _0xc7a0('0x94'):var _0x99a4f2=_0x10b170['body'][_0xc7a0('0x95')][0x0];if(_0x99a4f2[_0xc7a0('0x32')][_0xc7a0('0xdd')]===_0xc7a0('0xda')){return _0x202703[_0xc7a0('0x3c')]({'read':!![]});}else{logger[_0xc7a0('0x2c')](_0xc7a0('0x2a'),_0xc7a0('0x32'),_0xc7a0('0x94'),util[_0xc7a0('0xd5')](_0x10b170[_0xc7a0('0x68')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x2419a2==_0xc7a0('0xde')||_0x2419a2=='RECEIVED_BY_RECIPIENT'){return _0x202703[_0xc7a0('0x3c')]({'read':!![]});}else{logger[_0xc7a0('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc7a0('0x32'),_0xc7a0('0x97'),util[_0xc7a0('0xd5')](_0x10b170[_0xc7a0('0x68')],{'showHidden':![],'depth':null}));}break;case _0xc7a0('0x9a'):if(_0x2419a2=='message-delivered'){return _0x202703['update']({'read':!![]});}else{logger[_0xc7a0('0x2c')](_0xc7a0('0x2a'),_0xc7a0('0x32'),_0xc7a0('0x9a'),util[_0xc7a0('0xd5')](_0x10b170['body'],{'showHidden':![],'depth':null}));}break;case _0xc7a0('0x9b'):if(_0x2419a2===_0xc7a0('0xdf')||_0x2419a2===_0xc7a0('0xe0')){return _0x202703[_0xc7a0('0x3c')]({'read':!![]});}else{logger[_0xc7a0('0x2c')](_0xc7a0('0x2a'),_0xc7a0('0x32'),_0xc7a0('0x9b'),util[_0xc7a0('0xd5')](_0x10b170['body'],{'showHidden':![],'depth':null}));}break;}return _0x202703;}})[_0xc7a0('0x25')](respondWithResult(_0x4453f2,null))[_0xc7a0('0x2f')](handleError(_0x4453f2,null));};exports[_0xc7a0('0xe1')]=function(_0x11230d,_0x49f827,_0x36b7d4){var _0x229fc1,_0x3678f0,_0x1b7ed1;return db[_0xc7a0('0x5b')]['find']({'where':{'id':_0x11230d[_0xc7a0('0x61')]['id']}})[_0xc7a0('0x25')](handleEntityNotFound(_0x49f827,null))[_0xc7a0('0x25')](function(_0x1969cd){if(_0x1969cd){_0x1b7ed1=_0x1969cd;logger[_0xc7a0('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc7a0('0x32'),_0xc7a0('0xd4'),_0x1969cd[_0xc7a0('0x48')],util[_0xc7a0('0xd5')](_0x11230d[_0xc7a0('0x4a')],{'showHidden':![],'depth':null}));switch(_0x1969cd[_0xc7a0('0x48')]){case _0xc7a0('0xe2'):if(_0x11230d[_0xc7a0('0x4a')][_0xc7a0('0xe3')]&&_0x11230d[_0xc7a0('0x4a')][_0xc7a0('0xe4')]){_0x3678f0=_0x11230d[_0xc7a0('0x4a')][_0xc7a0('0xe4')];return db[_0xc7a0('0xd2')][_0xc7a0('0x66')]({'where':{'messageId':_0x11230d[_0xc7a0('0x4a')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x49f827,null))[_0xc7a0('0x25')](function(_0xa4dca9){if(_0xa4dca9){_0x229fc1=_0xa4dca9;switch(_0x1b7ed1[_0xc7a0('0x48')]){case _0xc7a0('0xe2'):if(_0x3678f0==='2'||_0x3678f0==='6'){return _0x229fc1[_0xc7a0('0x3c')]({'read':!![]});}else{logger[_0xc7a0('0x2c')](_0xc7a0('0x2a'),_0xc7a0('0x32'),'csc',util[_0xc7a0('0xd5')](_0x11230d[_0xc7a0('0x4a')],{'showHidden':![],'depth':null}));};break;}return _0x229fc1;}})[_0xc7a0('0x25')](respondWithResult(_0x49f827,null))[_0xc7a0('0x2f')](handleError(_0x49f827,null));};exports[_0xc7a0('0xe5')]=function(_0x9354b1,_0x3ce797,_0x36f1ff){return db[_0xc7a0('0x5b')][_0xc7a0('0x66')]({'where':{'id':_0x9354b1[_0xc7a0('0x61')]['id']}})[_0xc7a0('0x25')](handleEntityNotFound(_0x3ce797,null))[_0xc7a0('0x25')](function(_0x5d2714){if(_0x5d2714){return _0x5d2714[_0xc7a0('0xe5')](_0x9354b1[_0xc7a0('0x68')][_0xc7a0('0x70')],_[_0xc7a0('0xa4')](_0x9354b1[_0xc7a0('0x68')],[_0xc7a0('0x70'),'id'])||{})[_0xc7a0('0xa7')](function(_0xc5476e){for(var _0x1731f2=0x0;_0x1731f2<_0x9354b1['body']['ids'][_0xc7a0('0x50')];_0x1731f2+=0x1){socket[_0xc7a0('0xe6')](_0xc7a0('0xe7'),{'UserId':Number(_0x9354b1[_0xc7a0('0x68')][_0xc7a0('0x70')][_0x1731f2]),'SmsAccountId':Number(_0x9354b1[_0xc7a0('0x61')]['id'])});}return _0xc5476e;});}})['then'](respondWithResult(_0x3ce797,null))[_0xc7a0('0x2f')](handleError(_0x3ce797,null));};exports[_0xc7a0('0xe8')]=function(_0x1a0a7f,_0x21960e,_0x244f4e){return db[_0xc7a0('0x5b')]['find']({'where':{'id':_0x1a0a7f[_0xc7a0('0x61')]['id']}})[_0xc7a0('0x25')](handleEntityNotFound(_0x21960e,null))['then'](function(_0x3a7159){if(_0x3a7159){return _0x3a7159[_0xc7a0('0xe8')](_0x1a0a7f[_0xc7a0('0x4a')][_0xc7a0('0x70')])[_0xc7a0('0x25')](function(){if(_[_0xc7a0('0xe9')](_0x1a0a7f[_0xc7a0('0x4a')][_0xc7a0('0x70')])){for(var _0x1eec68=0x0;_0x1eec68<_0x1a0a7f['query']['ids']['length'];_0x1eec68+=0x1){socket[_0xc7a0('0xe6')](_0xc7a0('0xea'),{'UserId':Number(_0x1a0a7f[_0xc7a0('0x4a')][_0xc7a0('0x70')][_0x1eec68]),'SmsAccountId':Number(_0x1a0a7f['params']['id'])});}}else{socket[_0xc7a0('0xe6')](_0xc7a0('0xea'),{'UserId':Number(_0x1a0a7f[_0xc7a0('0x4a')][_0xc7a0('0x70')]),'SmsAccountId':Number(_0x1a0a7f['params']['id'])});}});}})[_0xc7a0('0x25')](respondWithStatusCode(_0x21960e,null))[_0xc7a0('0x2f')](handleError(_0x21960e,null));};exports['getAgents']=function(_0x1e8444,_0x33d0b2,_0x410f6c){var _0x4612bb={};var _0x4e1aaf={};var _0x92e8a3;var _0x3b6ce6;return db[_0xc7a0('0x5b')][_0xc7a0('0x6e')]({'where':{'id':_0x1e8444[_0xc7a0('0x61')]['id']}})[_0xc7a0('0x25')](handleEntityNotFound(_0x33d0b2,null))[_0xc7a0('0x25')](function(_0x1e39db){if(_0x1e39db){_0x92e8a3=_0x1e39db;_0x4e1aaf[_0xc7a0('0x49')]=_[_0xc7a0('0x4b')](db[_0xc7a0('0xaf')][_0xc7a0('0x46')]);_0x4e1aaf[_0xc7a0('0x4a')]=_[_0xc7a0('0x4b')](_0x1e8444[_0xc7a0('0x4a')]);_0x4e1aaf['filters']=_[_0xc7a0('0x4d')](_0x4e1aaf['model'],_0x4e1aaf[_0xc7a0('0x4a')]);_0x4612bb[_0xc7a0('0x4f')]=_[_0xc7a0('0x4d')](_0x4e1aaf[_0xc7a0('0x49')],qs[_0xc7a0('0x4e')](_0x1e8444[_0xc7a0('0x4a')][_0xc7a0('0x4e')]));_0x4612bb[_0xc7a0('0x4f')]=_0x4612bb[_0xc7a0('0x4f')][_0xc7a0('0x50')]?_0x4612bb[_0xc7a0('0x4f')]:_0x4e1aaf[_0xc7a0('0x49')];_0x4612bb['order']=qs[_0xc7a0('0x54')](_0x1e8444[_0xc7a0('0x4a')][_0xc7a0('0x54')]);_0x4612bb[_0xc7a0('0x55')]=qs[_0xc7a0('0x4c')](_[_0xc7a0('0x56')](_0x1e8444[_0xc7a0('0x4a')],_0x4e1aaf['filters']));if(_0x1e8444[_0xc7a0('0x4a')][_0xc7a0('0x57')]){_0x4612bb[_0xc7a0('0x55')]=_[_0xc7a0('0x58')](_0x4612bb[_0xc7a0('0x55')],{'$or':_[_0xc7a0('0x45')](_0x4612bb[_0xc7a0('0x4f')],function(_0x252559){var _0x3e2894={};_0x3e2894[_0x252559]={'$like':'%'+_0x1e8444['query'][_0xc7a0('0x57')]+'%'};return _0x3e2894;})});}_0x4612bb=_[_0xc7a0('0x58')]({},_0x4612bb,_0x1e8444[_0xc7a0('0x5a')]);return _0x92e8a3['getAgents'](_0x4612bb);}})[_0xc7a0('0x25')](function(_0x3cdb05){if(_0x3cdb05){_0x3b6ce6=_0x3cdb05[_0xc7a0('0x50')];if(!_0x1e8444[_0xc7a0('0x4a')][_0xc7a0('0x51')](_0xc7a0('0x52'))){_0x4612bb[_0xc7a0('0x37')]=qs[_0xc7a0('0x37')](_0x1e8444[_0xc7a0('0x4a')]['limit']);_0x4612bb[_0xc7a0('0x34')]=qs['offset'](_0x1e8444[_0xc7a0('0x4a')]['offset']);}return _0x92e8a3[_0xc7a0('0xeb')](_0x4612bb);}})[_0xc7a0('0x25')](function(_0x3c23c6){if(_0x3c23c6){return _0x3c23c6?{'count':_0x3b6ce6,'rows':_0x3c23c6}:null;}})[_0xc7a0('0x25')](respondWithResult(_0x33d0b2,null))[_0xc7a0('0x2f')](handleError(_0x33d0b2,null));}; \ No newline at end of file +var _0xaee4=['DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./smsAccount.socket','register','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','destroy','get','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','SmsAccount','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','role','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','update','body','Pause','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','addAnswer','CannedAnswer','nolimit','removeAnswers','ids','notify','Applications','account','applications','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','CompanyId','ListId','mobile','type','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','defaults','SmsInteraction','spread','interaction','created','push','close','unmanaged','ContactId','AttachmentId','User','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio','\x0a','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','finally','send','getApplications','getInteractions','Contact','internal','Tag','color','tag','List','updatedAt','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','clickatell','redif','DELIVERED','error_code'];(function(_0x5a4832,_0x4e3d2b){var _0x5b316f=function(_0x5adf76){while(--_0x5adf76){_0x5a4832['push'](_0x5a4832['shift']());}};_0x5b316f(++_0x4e3d2b);}(_0xaee4,0x1d1));var _0x4aee=function(_0x396f31,_0x3f465a){_0x396f31=_0x396f31-0x0;var _0x33a8e1=_0xaee4[_0x396f31];return _0x33a8e1;};'use strict';var emlformat=require(_0x4aee('0x0'));var rimraf=require(_0x4aee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4aee('0x2'));var moment=require(_0x4aee('0x3'));var BPromise=require(_0x4aee('0x4'));var Mustache=require('mustache');var util=require(_0x4aee('0x5'));var path=require(_0x4aee('0x6'));var sox=require('sox');var csv=require(_0x4aee('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4aee('0x8'));var _=require('lodash');var squel=require(_0x4aee('0x9'));var crypto=require(_0x4aee('0xa'));var jsforce=require(_0x4aee('0xb'));var deskjs=require(_0x4aee('0xc'));var toCsv=require(_0x4aee('0x7'));var querystring=require(_0x4aee('0xd'));var Papa=require(_0x4aee('0xe'));var Redis=require(_0x4aee('0xf'));var authService=require(_0x4aee('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4aee('0x11'));var logger=require(_0x4aee('0x12'))('api');var utils=require(_0x4aee('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4aee('0x14'));var db=require(_0x4aee('0x15'))['db'];config[_0x4aee('0x16')]=_['defaults'](config[_0x4aee('0x16')],{'host':_0x4aee('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4aee('0x16')]));require(_0x4aee('0x18'))[_0x4aee('0x19')](socket);var jayson=require(_0x4aee('0x1a'));var client=jayson[_0x4aee('0x1b')]['http']({'port':0x232c});function respondWithRpcPromise(_0x27f739,_0x311f43,_0x49b868,_0xa5570c){return new BPromise(function(_0x46665b,_0x1467f1){var _0x1faf98=_0xa5570c||client;return _0x1faf98[_0x4aee('0x1c')](_0x27f739,_0x49b868)[_0x4aee('0x1d')](function(_0x1fc955){logger[_0x4aee('0x1e')](_0x4aee('0x1f'),_0x311f43,_0x4aee('0x20'));logger[_0x4aee('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x311f43,'request\x20sent',JSON['stringify'](_0x1fc955));if(_0x1fc955[_0x4aee('0x22')]){if(_0x1fc955['error']['code']===0x1f4){logger[_0x4aee('0x22')](_0x4aee('0x1f'),_0x311f43,_0x1fc955['error'][_0x4aee('0x23')]);return _0x1467f1(_0x1fc955[_0x4aee('0x22')]['message']);}logger[_0x4aee('0x22')](_0x4aee('0x1f'),_0x311f43,_0x1fc955[_0x4aee('0x22')]['message']);return _0x46665b(_0x1fc955[_0x4aee('0x22')]['message']);}else{logger[_0x4aee('0x1e')](_0x4aee('0x1f'),_0x311f43,_0x4aee('0x20'));_0x46665b(_0x1fc955[_0x4aee('0x24')]['message']);}})['catch'](function(_0x2179bc){logger[_0x4aee('0x22')](_0x4aee('0x1f'),_0x311f43,_0x2179bc);_0x1467f1(_0x2179bc);});});}function respondWithStatusCode(_0xe34a2b,_0x5580b8){_0x5580b8=_0x5580b8||0xcc;return function(_0x2b9351){if(_0x2b9351){return _0xe34a2b[_0x4aee('0x25')](_0x5580b8);}return _0xe34a2b[_0x4aee('0x26')](_0x5580b8)[_0x4aee('0x27')]();};}function respondWithResult(_0x5a5319,_0x43b10a){_0x43b10a=_0x43b10a||0xc8;return function(_0x25f51f){if(_0x25f51f){return _0x5a5319[_0x4aee('0x26')](_0x43b10a)[_0x4aee('0x28')](_0x25f51f);}};}function respondWithFilteredResult(_0x58d22e,_0x2e8b23){return function(_0x15af00){if(_0x15af00){var _0x5510e6=typeof _0x2e8b23['offset']===_0x4aee('0x29')&&typeof _0x2e8b23[_0x4aee('0x2a')]===_0x4aee('0x29');var _0x1db06c=_0x15af00[_0x4aee('0x2b')];var _0x2f1ba5=_0x5510e6?0x0:_0x2e8b23[_0x4aee('0x2c')];var _0x339147=_0x5510e6?_0x15af00['count']:_0x2e8b23[_0x4aee('0x2c')]+_0x2e8b23[_0x4aee('0x2a')];var _0x5c2fb2;if(_0x339147>=_0x1db06c){_0x339147=_0x1db06c;_0x5c2fb2=0xc8;}else{_0x5c2fb2=0xce;}_0x58d22e[_0x4aee('0x26')](_0x5c2fb2);return _0x58d22e[_0x4aee('0x2d')]('Content-Range',_0x2f1ba5+'-'+_0x339147+'/'+_0x1db06c)[_0x4aee('0x28')](_0x15af00);}return null;};}function patchUpdates(_0x5b2c8b){return function(_0x1f613a){try{jsonpatch[_0x4aee('0x2e')](_0x1f613a,_0x5b2c8b,!![]);}catch(_0x506d85){return BPromise[_0x4aee('0x2f')](_0x506d85);}return _0x1f613a[_0x4aee('0x30')]();};}function saveUpdates(_0x35ddb8,_0x5266e7){return function(_0x419339){if(_0x419339){return _0x419339['update'](_0x35ddb8)[_0x4aee('0x1d')](function(_0x145006){return _0x145006;});}return null;};}function removeEntity(_0x509d33,_0xca41de){return function(_0x3c8214){if(_0x3c8214){return _0x3c8214[_0x4aee('0x31')]()['then'](function(){var _0x6a2090=_0x3c8214[_0x4aee('0x32')]({'plain':!![]});var _0x25b63c='SmsAccounts';return db[_0x4aee('0x33')][_0x4aee('0x31')]({'where':{'type':_0x25b63c,'resourceId':_0x6a2090['id']}})['then'](function(){return _0x3c8214;});})[_0x4aee('0x1d')](function(){_0x509d33[_0x4aee('0x26')](0xcc)[_0x4aee('0x27')]();});}};}function handleEntityNotFound(_0x152f23,_0x366f8f){return function(_0x510d4a){if(!_0x510d4a){_0x152f23['sendStatus'](0x194);}return _0x510d4a;};}function handleError(_0x21a5b4,_0x194879){_0x194879=_0x194879||0x1f4;return function(_0x2bab72){logger[_0x4aee('0x22')](_0x2bab72[_0x4aee('0x34')]);if(_0x2bab72[_0x4aee('0x35')]){delete _0x2bab72[_0x4aee('0x35')];}_0x21a5b4[_0x4aee('0x26')](_0x194879)['send'](_0x2bab72);};}exports[_0x4aee('0x36')]=function(_0x2a63dc,_0x4c2e61){var _0x391a11={'include':[{'model':db['Pause'],'as':_0x4aee('0x37')}]},_0x53e245={},_0x51adba={'count':0x0,'rows':[]};var _0x11dfee=_[_0x4aee('0x38')](db['SmsAccount']['rawAttributes'],function(_0x2e296f){return{'name':_0x2e296f[_0x4aee('0x39')],'type':_0x2e296f['type'][_0x4aee('0x3a')]};});_0x53e245[_0x4aee('0x3b')]=_[_0x4aee('0x38')](_0x11dfee,_0x4aee('0x35'));_0x53e245[_0x4aee('0x3c')]=_[_0x4aee('0x3d')](_0x2a63dc[_0x4aee('0x3c')]);_0x53e245[_0x4aee('0x3e')]=_[_0x4aee('0x3f')](_0x53e245['model'],_0x53e245[_0x4aee('0x3c')]);_0x391a11[_0x4aee('0x40')]=_[_0x4aee('0x3f')](_0x53e245[_0x4aee('0x3b')],qs[_0x4aee('0x41')](_0x2a63dc[_0x4aee('0x3c')][_0x4aee('0x41')]));_0x391a11[_0x4aee('0x40')]=_0x391a11[_0x4aee('0x40')][_0x4aee('0x42')]?_0x391a11[_0x4aee('0x40')]:_0x53e245[_0x4aee('0x3b')];if(!_0x2a63dc[_0x4aee('0x3c')]['hasOwnProperty']('nolimit')){_0x391a11[_0x4aee('0x2a')]=qs[_0x4aee('0x2a')](_0x2a63dc['query']['limit']);_0x391a11[_0x4aee('0x2c')]=qs['offset'](_0x2a63dc[_0x4aee('0x3c')]['offset']);}_0x391a11[_0x4aee('0x43')]=qs[_0x4aee('0x44')](_0x2a63dc[_0x4aee('0x3c')][_0x4aee('0x44')]);_0x391a11[_0x4aee('0x45')]=qs[_0x4aee('0x3e')](_[_0x4aee('0x46')](_0x2a63dc[_0x4aee('0x3c')],_0x53e245[_0x4aee('0x3e')]),_0x11dfee);if(_0x2a63dc[_0x4aee('0x3c')][_0x4aee('0x47')]){_0x391a11[_0x4aee('0x45')]=_['merge'](_0x391a11[_0x4aee('0x45')],{'$or':_['map'](_0x11dfee,function(_0x2be644){if(_0x2be644['type']!==_0x4aee('0x48')){var _0x146e35={};_0x146e35[_0x2be644[_0x4aee('0x35')]]={'$like':'%'+_0x2a63dc[_0x4aee('0x3c')][_0x4aee('0x47')]+'%'};return _0x146e35;}})});}_0x391a11=_[_0x4aee('0x49')]({},_0x391a11,_0x2a63dc[_0x4aee('0x4a')]);var _0x5bd6d8={'where':_0x391a11[_0x4aee('0x45')]};return db[_0x4aee('0x4b')][_0x4aee('0x2b')](_0x5bd6d8)[_0x4aee('0x1d')](function(_0x2bda0d){_0x51adba[_0x4aee('0x2b')]=_0x2bda0d;if(_0x2a63dc[_0x4aee('0x3c')][_0x4aee('0x4c')]){_0x391a11[_0x4aee('0x4d')]=[{'all':!![]}];}return db['SmsAccount'][_0x4aee('0x4e')](_0x391a11);})[_0x4aee('0x1d')](function(_0x54ec34){_0x51adba[_0x4aee('0x4f')]=_0x54ec34;return _0x51adba;})[_0x4aee('0x1d')](respondWithFilteredResult(_0x4c2e61,_0x391a11))[_0x4aee('0x50')](handleError(_0x4c2e61,null));};exports[_0x4aee('0x51')]=function(_0x3598f5,_0xfd1445){var _0x29858e={'raw':![],'where':{'id':_0x3598f5[_0x4aee('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0x4aee('0x37')}]},_0x5ec4a7={};_0x5ec4a7[_0x4aee('0x3b')]=_[_0x4aee('0x3d')](db[_0x4aee('0x4b')][_0x4aee('0x53')]);_0x5ec4a7[_0x4aee('0x3c')]=_[_0x4aee('0x3d')](_0x3598f5[_0x4aee('0x3c')]);_0x5ec4a7[_0x4aee('0x3e')]=_[_0x4aee('0x3f')](_0x5ec4a7[_0x4aee('0x3b')],_0x5ec4a7['query']);_0x29858e[_0x4aee('0x40')]=_['intersection'](_0x5ec4a7[_0x4aee('0x3b')],qs[_0x4aee('0x41')](_0x3598f5['query'][_0x4aee('0x41')]));_0x29858e[_0x4aee('0x40')]=_0x29858e[_0x4aee('0x40')][_0x4aee('0x42')]?_0x29858e['attributes']:_0x5ec4a7[_0x4aee('0x3b')];if(_0x3598f5[_0x4aee('0x3c')][_0x4aee('0x4c')]){_0x29858e[_0x4aee('0x4d')]=[{'all':!![]}];}_0x29858e=_[_0x4aee('0x49')]({},_0x29858e,_0x3598f5[_0x4aee('0x4a')]);return db[_0x4aee('0x4b')][_0x4aee('0x54')](_0x29858e)[_0x4aee('0x1d')](handleEntityNotFound(_0xfd1445,null))[_0x4aee('0x1d')](respondWithResult(_0xfd1445,null))[_0x4aee('0x50')](handleError(_0xfd1445,null));};exports['create']=function(_0x319614,_0x5ee7e5){return db[_0x4aee('0x4b')][_0x4aee('0x55')](_0x319614['body'],{})[_0x4aee('0x1d')](function(_0x2036e8){var _0x235dcf=_0x319614[_0x4aee('0x56')]['get']({'plain':!![]});if(!_0x235dcf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x235dcf[_0x4aee('0x57')]==='user'){var _0x11cc58=_0x2036e8[_0x4aee('0x32')]({'plain':!![]});var _0x2c1cd4=_0x4aee('0x58');return db[_0x4aee('0x59')][_0x4aee('0x54')]({'where':{'name':_0x2c1cd4,'userProfileId':_0x235dcf[_0x4aee('0x5a')]},'raw':!![]})[_0x4aee('0x1d')](function(_0x4a5d9d){if(_0x4a5d9d&&_0x4a5d9d[_0x4aee('0x5b')]===0x0){return db[_0x4aee('0x33')][_0x4aee('0x55')]({'name':_0x11cc58[_0x4aee('0x35')],'resourceId':_0x11cc58['id'],'type':_0x4a5d9d[_0x4aee('0x35')],'sectionId':_0x4a5d9d['id']},{})['then'](function(){return _0x2036e8;});}else{return _0x2036e8;}})[_0x4aee('0x50')](function(_0x57fb38){logger[_0x4aee('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57fb38);throw _0x57fb38;});}return _0x2036e8;})[_0x4aee('0x1d')](respondWithResult(_0x5ee7e5,0xc9))['catch'](handleError(_0x5ee7e5,null));};exports[_0x4aee('0x5c')]=function(_0x253599,_0x21c4a0){if(_0x253599[_0x4aee('0x5d')]['id']){delete _0x253599['body']['id'];}return db[_0x4aee('0x4b')][_0x4aee('0x54')]({'where':{'id':_0x253599[_0x4aee('0x52')]['id']},'include':[{'model':db[_0x4aee('0x5e')],'as':_0x4aee('0x37')}]})[_0x4aee('0x1d')](handleEntityNotFound(_0x21c4a0,null))[_0x4aee('0x1d')](saveUpdates(_0x253599[_0x4aee('0x5d')],null))[_0x4aee('0x1d')](respondWithResult(_0x21c4a0,null))[_0x4aee('0x50')](handleError(_0x21c4a0,null));};exports[_0x4aee('0x31')]=function(_0x287b56,_0x322266){return db[_0x4aee('0x4b')][_0x4aee('0x54')]({'where':{'id':_0x287b56[_0x4aee('0x52')]['id']}})[_0x4aee('0x1d')](handleEntityNotFound(_0x322266,null))[_0x4aee('0x1d')](removeEntity(_0x322266,null))[_0x4aee('0x50')](handleError(_0x322266,null));};exports[_0x4aee('0x5f')]=function(_0x3e7f69,_0x2ef358){return db[_0x4aee('0x4b')][_0x4aee('0x5f')]()[_0x4aee('0x1d')](respondWithResult(_0x2ef358,null))[_0x4aee('0x50')](handleError(_0x2ef358,null));};exports[_0x4aee('0x60')]=function(_0x5286d6,_0x40ce49,_0x3ff5b8){if(_0x5286d6[_0x4aee('0x5d')]['id']){delete _0x5286d6[_0x4aee('0x5d')]['id'];}return db[_0x4aee('0x4b')][_0x4aee('0x54')]({'where':{'id':_0x5286d6['params']['id']}})[_0x4aee('0x1d')](handleEntityNotFound(_0x40ce49,null))[_0x4aee('0x1d')](function(_0x3753ac){if(_0x3753ac){_0x5286d6[_0x4aee('0x5d')][_0x4aee('0x61')]=_0x3753ac['id'];return db[_0x4aee('0x62')]['create'](_0x5286d6[_0x4aee('0x5d')]);}})[_0x4aee('0x1d')](respondWithResult(_0x40ce49,null))[_0x4aee('0x50')](handleError(_0x40ce49,null));};exports[_0x4aee('0x63')]=function(_0x43655f,_0x460def,_0x1af9d8){var _0x509cb4={'raw':![],'where':{}};var _0x80d05a={};var _0x3f17c9={'count':0x0,'rows':[]};return db[_0x4aee('0x4b')][_0x4aee('0x64')]({'where':{'id':_0x43655f[_0x4aee('0x52')]['id']}})['then'](handleEntityNotFound(_0x460def,null))[_0x4aee('0x1d')](function(_0x266f77){if(_0x266f77){_0x80d05a[_0x4aee('0x3b')]=_['keys'](db[_0x4aee('0x62')][_0x4aee('0x53')]);_0x80d05a[_0x4aee('0x3c')]=_['keys'](_0x43655f[_0x4aee('0x3c')]);_0x80d05a[_0x4aee('0x3e')]=_[_0x4aee('0x3f')](_0x80d05a['model'],_0x80d05a['query']);_0x509cb4['attributes']=_[_0x4aee('0x3f')](_0x80d05a[_0x4aee('0x3b')],qs[_0x4aee('0x41')](_0x43655f[_0x4aee('0x3c')][_0x4aee('0x41')]));_0x509cb4[_0x4aee('0x40')]=_0x509cb4[_0x4aee('0x40')]['length']?_0x509cb4[_0x4aee('0x40')]:_0x80d05a['model'];if(!_0x43655f['query'][_0x4aee('0x65')]('nolimit')){_0x509cb4[_0x4aee('0x2a')]=qs[_0x4aee('0x2a')](_0x43655f['query'][_0x4aee('0x2a')]);_0x509cb4[_0x4aee('0x2c')]=qs['offset'](_0x43655f[_0x4aee('0x3c')][_0x4aee('0x2c')]);}_0x509cb4[_0x4aee('0x43')]=qs[_0x4aee('0x44')](_0x43655f['query'][_0x4aee('0x44')]);_0x509cb4[_0x4aee('0x45')]=qs[_0x4aee('0x3e')](_[_0x4aee('0x46')](_0x43655f[_0x4aee('0x3c')],_0x80d05a[_0x4aee('0x3e')]));_0x509cb4[_0x4aee('0x45')]['SmsAccountId']=_0x266f77['id'];if(_0x43655f[_0x4aee('0x3c')][_0x4aee('0x47')]){_0x509cb4['where']=_[_0x4aee('0x49')](_0x509cb4[_0x4aee('0x45')],{'$or':_['map'](_0x509cb4[_0x4aee('0x40')],function(_0x3c8bef){var _0x5f1f38={};_0x5f1f38[_0x3c8bef]={'$like':'%'+_0x43655f[_0x4aee('0x3c')]['filter']+'%'};return _0x5f1f38;})});}_0x509cb4=_['merge']({},_0x509cb4,_0x43655f[_0x4aee('0x4a')]);return db['Disposition'][_0x4aee('0x2b')]({'where':_0x509cb4[_0x4aee('0x45')]})[_0x4aee('0x1d')](function(_0x46e77a){_0x3f17c9['count']=_0x46e77a;if(_0x43655f[_0x4aee('0x3c')]['includeAll']){_0x509cb4[_0x4aee('0x4d')]=[{'all':!![]}];}return db[_0x4aee('0x62')]['findAll'](_0x509cb4);})['then'](function(_0x4953aa){_0x3f17c9['rows']=_0x4953aa;return _0x3f17c9;});}})[_0x4aee('0x1d')](respondWithFilteredResult(_0x460def,_0x509cb4))['catch'](handleError(_0x460def,null));};exports[_0x4aee('0x66')]=function(_0x332bec,_0x34bee6,_0x4c7e60){return db[_0x4aee('0x4b')][_0x4aee('0x54')]({'where':{'id':_0x332bec[_0x4aee('0x52')]['id']}})[_0x4aee('0x1d')](handleEntityNotFound(_0x34bee6,null))[_0x4aee('0x1d')](function(_0x2122d1){if(_0x2122d1){return _0x2122d1[_0x4aee('0x66')](_0x332bec[_0x4aee('0x3c')]['ids']);}})[_0x4aee('0x1d')](respondWithStatusCode(_0x34bee6,null))['catch'](handleError(_0x34bee6,null));};exports[_0x4aee('0x67')]=function(_0x431926,_0x27f498,_0x44b89b){if(_0x431926[_0x4aee('0x5d')]['id']){delete _0x431926[_0x4aee('0x5d')]['id'];}return db[_0x4aee('0x4b')][_0x4aee('0x54')]({'where':{'id':_0x431926[_0x4aee('0x52')]['id']}})[_0x4aee('0x1d')](handleEntityNotFound(_0x27f498,null))[_0x4aee('0x1d')](function(_0x1428fb){if(_0x1428fb){_0x431926['body'][_0x4aee('0x61')]=_0x1428fb['id'];return db[_0x4aee('0x68')]['create'](_0x431926[_0x4aee('0x5d')]);}})[_0x4aee('0x1d')](respondWithResult(_0x27f498,null))[_0x4aee('0x50')](handleError(_0x27f498,null));};exports['getAnswers']=function(_0x103404,_0x1ef786,_0x259766){var _0x6fe59f={'raw':![],'where':{}};var _0x5850ca={};var _0x290128={'count':0x0,'rows':[]};return db[_0x4aee('0x4b')][_0x4aee('0x64')]({'where':{'id':_0x103404[_0x4aee('0x52')]['id']}})[_0x4aee('0x1d')](handleEntityNotFound(_0x1ef786,null))[_0x4aee('0x1d')](function(_0x1bf11b){if(_0x1bf11b){_0x5850ca[_0x4aee('0x3b')]=_[_0x4aee('0x3d')](db['CannedAnswer'][_0x4aee('0x53')]);_0x5850ca[_0x4aee('0x3c')]=_[_0x4aee('0x3d')](_0x103404[_0x4aee('0x3c')]);_0x5850ca[_0x4aee('0x3e')]=_[_0x4aee('0x3f')](_0x5850ca[_0x4aee('0x3b')],_0x5850ca['query']);_0x6fe59f[_0x4aee('0x40')]=_[_0x4aee('0x3f')](_0x5850ca['model'],qs['fields'](_0x103404[_0x4aee('0x3c')][_0x4aee('0x41')]));_0x6fe59f['attributes']=_0x6fe59f[_0x4aee('0x40')][_0x4aee('0x42')]?_0x6fe59f[_0x4aee('0x40')]:_0x5850ca[_0x4aee('0x3b')];if(!_0x103404[_0x4aee('0x3c')][_0x4aee('0x65')](_0x4aee('0x69'))){_0x6fe59f[_0x4aee('0x2a')]=qs[_0x4aee('0x2a')](_0x103404[_0x4aee('0x3c')]['limit']);_0x6fe59f[_0x4aee('0x2c')]=qs[_0x4aee('0x2c')](_0x103404[_0x4aee('0x3c')][_0x4aee('0x2c')]);}_0x6fe59f[_0x4aee('0x43')]=qs[_0x4aee('0x44')](_0x103404[_0x4aee('0x3c')][_0x4aee('0x44')]);_0x6fe59f['where']=qs[_0x4aee('0x3e')](_['pick'](_0x103404[_0x4aee('0x3c')],_0x5850ca[_0x4aee('0x3e')]));_0x6fe59f[_0x4aee('0x45')][_0x4aee('0x61')]=_0x1bf11b['id'];if(_0x103404[_0x4aee('0x3c')][_0x4aee('0x47')]){_0x6fe59f[_0x4aee('0x45')]=_['merge'](_0x6fe59f['where'],{'$or':_[_0x4aee('0x38')](_0x6fe59f[_0x4aee('0x40')],function(_0x1068ca){var _0x2f1262={};_0x2f1262[_0x1068ca]={'$like':'%'+_0x103404[_0x4aee('0x3c')]['filter']+'%'};return _0x2f1262;})});}_0x6fe59f=_['merge']({},_0x6fe59f,_0x103404[_0x4aee('0x4a')]);return db[_0x4aee('0x68')]['count']({'where':_0x6fe59f[_0x4aee('0x45')]})[_0x4aee('0x1d')](function(_0x103f56){_0x290128[_0x4aee('0x2b')]=_0x103f56;if(_0x103404[_0x4aee('0x3c')][_0x4aee('0x4c')]){_0x6fe59f['include']=[{'all':!![]}];}return db[_0x4aee('0x68')]['findAll'](_0x6fe59f);})['then'](function(_0x108b2a){_0x290128[_0x4aee('0x4f')]=_0x108b2a;return _0x290128;});}})[_0x4aee('0x1d')](respondWithFilteredResult(_0x1ef786,_0x6fe59f))[_0x4aee('0x50')](handleError(_0x1ef786,null));};exports[_0x4aee('0x6a')]=function(_0x483793,_0x4f6c2c,_0x1b443f){return db[_0x4aee('0x4b')][_0x4aee('0x54')]({'where':{'id':_0x483793[_0x4aee('0x52')]['id']}})[_0x4aee('0x1d')](handleEntityNotFound(_0x4f6c2c,null))[_0x4aee('0x1d')](function(_0x2e94ac){if(_0x2e94ac){return _0x2e94ac['removeAnswers'](_0x483793[_0x4aee('0x3c')][_0x4aee('0x6b')]);}})[_0x4aee('0x1d')](respondWithStatusCode(_0x4f6c2c,null))[_0x4aee('0x50')](handleError(_0x4f6c2c,null));};exports[_0x4aee('0x6c')]=function(_0x4c345a,_0x51cf42,_0x42d72){var _0x51510c={'channel':'sms'};var _0x474b15=[];var _0x3c6938=[];var _0x1bed0e={};return db[_0x4aee('0x4b')][_0x4aee('0x54')]({'where':{'id':_0x4c345a[_0x4aee('0x52')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x4aee('0x6d')}]})['then'](handleEntityNotFound(_0x51cf42,null))['then'](function(_0x371cb8){_0x51510c[_0x4aee('0x6e')]=_0x371cb8;_0x51510c[_0x4aee('0x6f')]=_['orderBy'](_0x371cb8[_0x4aee('0x6d')],[_0x4aee('0x70')],[_0x4aee('0x71')]);if(_0x51510c[_0x4aee('0x6e')][_0x4aee('0x6d')]){delete _0x51510c[_0x4aee('0x6e')][_0x4aee('0x6d')];}return db[_0x4aee('0x72')][_0x4aee('0x5f')]();})[_0x4aee('0x1d')](function(_0x1998dc){if(!_0x1998dc){throw new db[(_0x4aee('0x73'))][(_0x4aee('0x74'))]('no\x20available\x20attributes');}_0x474b15=_[_0x4aee('0x75')](_[_0x4aee('0x3d')](_0x1998dc),[_0x4aee('0x76'),'updatedAt']);_0x3c6938=_[_0x4aee('0x75')](_['keys'](_0x1998dc),[_0x4aee('0x76'),'updatedAt',_0x4aee('0x77'),_0x4aee('0x78')]);_0x51510c[_0x4aee('0x5d')]={'mapKey':_0x4aee('0x79')};if(_0x51510c[_0x4aee('0x6e')][_0x4aee('0x7a')]){switch(_0x51510c[_0x4aee('0x6e')][_0x4aee('0x7a')]){case'twilio':_0x51510c[_0x4aee('0x5d')][_0x4aee('0x7b')]=_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x7c')];_0x51510c[_0x4aee('0x5d')]['body']=_0x4c345a['body'][_0x4aee('0x7d')];_0x51510c[_0x4aee('0x5d')][_0x4aee('0x7e')]=_0x4c345a['body'][_0x4aee('0x7f')];break;case _0x4aee('0x80'):_0x51510c[_0x4aee('0x5d')]['from']='+'+_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x81')];_0x51510c[_0x4aee('0x5d')][_0x4aee('0x5d')]=_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x82')];break;case _0x4aee('0x83'):_0x51510c[_0x4aee('0x5d')][_0x4aee('0x7b')]=_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x7b')];_0x51510c[_0x4aee('0x5d')][_0x4aee('0x5d')]=_0x4c345a[_0x4aee('0x5d')]['message'];break;case _0x4aee('0x84'):_0x51510c[_0x4aee('0x5d')][_0x4aee('0x7b')]=_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x7b')];_0x51510c['body'][_0x4aee('0x5d')]=_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x5d')];_0x51510c['body'][_0x4aee('0x7e')]=_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x85')];break;case _0x4aee('0x86'):_0x51510c['body']['from']=_0x4c345a['body']['From'];_0x51510c[_0x4aee('0x5d')][_0x4aee('0x5d')]=_0x4c345a[_0x4aee('0x5d')]['Text'];_0x51510c[_0x4aee('0x5d')][_0x4aee('0x7e')]=_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x87')];break;case _0x4aee('0x88'):_0x51510c[_0x4aee('0x5d')]['from']='+'+_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x89')][0x0][_0x4aee('0x7b')];_0x51510c['body'][_0x4aee('0x5d')]=_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x89')][0x0][_0x4aee('0x82')];_0x51510c[_0x4aee('0x5d')]['messageId']=_0x4c345a['body'][_0x4aee('0x89')][0x0][_0x4aee('0x7e')];break;case _0x4aee('0x8a'):_0x51510c['body'][_0x4aee('0x7b')]=_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x8b')];_0x51510c[_0x4aee('0x5d')][_0x4aee('0x5d')]=_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x8c')][_0x4aee('0x23')];break;case'clickatell':_0x51510c[_0x4aee('0x5d')][_0x4aee('0x7b')]=_0x4c345a[_0x4aee('0x5d')]['fromNumber'];_0x51510c[_0x4aee('0x5d')]['body']=_0x4c345a[_0x4aee('0x5d')]['text'];_0x51510c[_0x4aee('0x5d')][_0x4aee('0x7e')]=_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x8d')];break;case _0x4aee('0x8e'):_0x51510c[_0x4aee('0x5d')]['messageId']=_0x4c345a['body'][0x0]['message']['id'];_0x51510c['body'][_0x4aee('0x7b')]=_0x4c345a[_0x4aee('0x5d')][0x0][_0x4aee('0x23')][_0x4aee('0x7b')];_0x51510c[_0x4aee('0x5d')][_0x4aee('0x5d')]=_0x4c345a[_0x4aee('0x5d')][0x0][_0x4aee('0x23')]['text'];break;case _0x4aee('0x8f'):_0x51510c['body']['from']=_0x4c345a[_0x4aee('0x5d')]['from'];_0x51510c[_0x4aee('0x5d')][_0x4aee('0x5d')]=_0x4c345a['body']['message'];_0x51510c[_0x4aee('0x5d')][_0x4aee('0x7e')]=_0x4c345a[_0x4aee('0x5d')][_0x4aee('0x90')];break;}}if(_0x51510c[_0x4aee('0x5d')]['id']){delete _0x51510c['body']['id'];}if(_['isNil'](_0x51510c['body'][_0x4aee('0x7b')])){throw new db[(_0x4aee('0x73'))][(_0x4aee('0x74'))](_0x4aee('0x91'));}if(_[_0x4aee('0x92')](_0x51510c[_0x4aee('0x5d')][_0x4aee('0x5d')])||_0x51510c[_0x4aee('0x5d')]['body']===''){throw new db['Sequelize'][(_0x4aee('0x74'))](_0x4aee('0x93'));}if(_[_0x4aee('0x92')](_0x51510c['body'][_0x4aee('0x94')])){throw new db[(_0x4aee('0x73'))][(_0x4aee('0x74'))](_0x4aee('0x95')+_0x3c6938);}if(!_[_0x4aee('0x96')](_0x3c6938,_0x51510c[_0x4aee('0x5d')][_0x4aee('0x94')])){throw new db[(_0x4aee('0x73'))][(_0x4aee('0x74'))](_0x4aee('0x97')+_0x3c6938);}_0x1bed0e[_0x51510c['body'][_0x4aee('0x94')]]=_0x51510c[_0x4aee('0x5d')][_0x4aee('0x7b')];return db[_0x4aee('0x98')][_0x4aee('0x54')]({'where':{'id':_0x51510c[_0x4aee('0x6e')]['ListId']},'include':[{'model':db[_0x4aee('0x72')],'as':_0x4aee('0x99'),'where':_0x1bed0e,'limit':0x1,'order':[['updatedAt',_0x4aee('0x9a')]]}]});})['then'](handleEntityNotFound(_0x51cf42,null))['then'](function(_0x298cc1){if(_0x298cc1){_0x51510c['list']=_[_0x4aee('0x9b')](_0x298cc1,[_0x4aee('0x99')]);if(_0x298cc1[_0x4aee('0x99')][_0x4aee('0x42')]){return _0x298cc1[_0x4aee('0x99')][0x0];}var _0xc3e57e=_[_0x4aee('0x9c')](_0x51510c['body'],{'firstName':_0x51510c['body'][_0x4aee('0x7b')],'ListId':_0x298cc1['id']});_0xc3e57e[_0x51510c['body']['mapKey']]=_0x51510c['body'][_0x4aee('0x7b')];return db[_0x4aee('0x72')][_0x4aee('0x55')](_0xc3e57e,{'fields':_0x474b15,'raw':!![]});}})[_0x4aee('0x1d')](handleEntityNotFound(_0x51cf42,null))['then'](function(_0xd402f6){if(_0xd402f6){_0x51510c['contact']=_0xd402f6;var _0xc04dd0={'ContactId':_0xd402f6['id'],'phone':_0x51510c['body'][_0x4aee('0x7b')],'SmsAccountId':_0x4c345a['params']['id']};var _0x3ef175={'ContactId':_0xd402f6['id'],'SmsAccountId':_0x4c345a[_0x4aee('0x52')]['id'],'closed':![]};return db[_0x4aee('0x9d')]['find']({'where':_0x3ef175})[_0x4aee('0x1d')](function(_0xade12e){if(_0xade12e){return[_0xade12e,![]];}return db['SmsInteraction'][_0x4aee('0x55')](_0xc04dd0)[_0x4aee('0x1d')](function(_0x845536){return[_0x845536,!![]];});});}})[_0x4aee('0x9e')](function(_0x496985,_0x1bda15){_0x51510c[_0x4aee('0x9f')]=_0x496985[_0x4aee('0x32')]({'plain':!![]});_0x51510c[_0x4aee('0x9f')][_0x4aee('0xa0')]=![];if(_0x1bda15){if(_0x51510c[_0x4aee('0x6e')]['autoclose']){_0x51510c[_0x4aee('0x6f')][_0x4aee('0xa1')]({'id':0x0,'priority':_0x51510c[_0x4aee('0x6f')][_0x4aee('0x42')]+0x1,'app':_0x4aee('0xa2'),'appdata':_0x4aee('0xa3'),'interval':'*,*,*,*'});}_0x51510c[_0x4aee('0x9f')][_0x4aee('0xa0')]=!![];}return db['SmsMessage'][_0x4aee('0x55')]({'phone':_0x51510c[_0x4aee('0x5d')][_0x4aee('0x7b')],'messageId':_0x51510c[_0x4aee('0x5d')][_0x4aee('0x7e')],'body':_0x51510c[_0x4aee('0x5d')]['body'],'SmsAccountId':_0x4c345a[_0x4aee('0x52')]['id'],'SmsInteractionId':_0x496985['id'],'direction':'in','ContactId':_0x496985[_0x4aee('0xa4')],'AttachmentId':_0x51510c[_0x4aee('0x5d')][_0x4aee('0xa5')]});})[_0x4aee('0x1d')](function(_0x2d2d08){_0x51510c[_0x4aee('0x23')]=_0x2d2d08;if(_0x51510c[_0x4aee('0x9f')]['UserId']){return db[_0x4aee('0xa6')]['find']({'attributes':['id',_0x4aee('0x35')],'where':{'id':_0x51510c[_0x4aee('0x9f')]['UserId']}})[_0x4aee('0x1d')](function(_0x3769a2){if(_0x3769a2){_0x51510c[_0x4aee('0x6f')][_0x4aee('0xa7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3769a2[_0x4aee('0x35')]+','+(_0x51510c[_0x4aee('0x6e')][_0x4aee('0xa8')]||0xa),'interval':_0x4aee('0xa9')});}return respondWithRpcPromise(_0x4aee('0xaa'),_0x4aee('0xab'),_0x51510c);});}return respondWithRpcPromise(_0x4aee('0xaa'),_0x4aee('0xab'),_0x51510c);})[_0x4aee('0x1d')](function(_0x13d302){if(_0x13d302){var _0x24d188=0xc8;var _0x214416=_0x4aee('0xac');logger[_0x4aee('0x1e')](_0x4aee('0xad'),_0x214416,_0x24d188,_0x4aee('0xae'));logger[_0x4aee('0x21')](_0x4aee('0xaf'),_0x214416,_0x24d188,_0x4aee('0xae'),JSON[_0x4aee('0xb0')](_0x13d302));if(_0x51510c[_0x4aee('0x6e')][_0x4aee('0x7a')]===_0x4aee('0xb1')){return _0x51cf42[_0x4aee('0x26')](_0x24d188)['set']('Content-Type','text/xml')['send'](_0x4aee('0xb2'));}else{return _0x51cf42[_0x4aee('0x26')](_0x24d188)[_0x4aee('0x28')](_0x13d302);}}})[_0x4aee('0x50')](handleError(_0x51cf42,null));};exports[_0x4aee('0xb3')]=function(_0x43196e,_0x670897){var _0x46bf83=_0x43196e[_0x4aee('0x52')]['id'];var _0xec93a=_0x43196e[_0x4aee('0x5d')];var _0x4e0d40=0xc8;var _0x5f2180=null;return db['sequelize'][_0x4aee('0xb4')]({'isolationLevel':db[_0x4aee('0xb5')][_0x4aee('0xb6')]['ISOLATION_LEVELS'][_0x4aee('0xb7')]},function(_0x24675e){return db['SmsAccount']['findOne']({'where':{'id':_0x46bf83},'transaction':_0x24675e})[_0x4aee('0x1d')](function(_0x5c33d2){if(_0x5c33d2){return db[_0x4aee('0xb8')][_0x4aee('0x31')]({'where':{'SmsAccountId':_0x46bf83},'transaction':_0x24675e})[_0x4aee('0x1d')](function(){var _0xc73fbc=_[_0x4aee('0x38')](_0xec93a,function(_0x362b43){_0x362b43[_0x4aee('0x61')]=_0x46bf83;return _0x362b43;});return db[_0x4aee('0xb8')][_0x4aee('0xb9')](_0xc73fbc,{'transaction':_0x24675e});});}else{_0x4e0d40=0x194;_0x5f2180=[];}});})[_0x4aee('0x1d')](function(){if(_0x4e0d40!==0x194){return db[_0x4aee('0xb8')][_0x4aee('0xba')]({'where':{'SmsAccountId':_0x46bf83},'order':_0x4aee('0x70')})[_0x4aee('0x1d')](function(_0x94f7d2){_0x5f2180=_0x94f7d2;});}})[_0x4aee('0x50')](function(_0x14dce1){_0x4e0d40=0x1f4;logger[_0x4aee('0x22')](_0x14dce1['stack']);if(_0x14dce1[_0x4aee('0x35')]){delete _0x14dce1[_0x4aee('0x35')];}_0x5f2180=_0x14dce1;})[_0x4aee('0xbb')](function(){if(_0x5f2180===null){_0x670897['sendStatus'](_0x4e0d40);}else{if(_0x4e0d40===0x1f4){_0x670897[_0x4aee('0x26')](_0x4e0d40)[_0x4aee('0xbc')](_0x5f2180);}else{_0x670897[_0x4aee('0x26')](_0x4e0d40)[_0x4aee('0x28')](_0x5f2180);}}});};exports['getApplications']=function(_0x49cc88,_0x340bfd,_0x5402b9){var _0x172247={};var _0x35b7b4={};var _0x4881d1;var _0x3974a8;return db[_0x4aee('0x4b')][_0x4aee('0x64')]({'where':{'id':_0x49cc88[_0x4aee('0x52')]['id']}})[_0x4aee('0x1d')](handleEntityNotFound(_0x340bfd,null))['then'](function(_0x2e14df){if(_0x2e14df){_0x4881d1=_0x2e14df;_0x35b7b4[_0x4aee('0x3b')]=_['keys'](db[_0x4aee('0xb8')][_0x4aee('0x53')]);_0x35b7b4[_0x4aee('0x3c')]=_[_0x4aee('0x3d')](_0x49cc88[_0x4aee('0x3c')]);_0x35b7b4[_0x4aee('0x3e')]=_['intersection'](_0x35b7b4['model'],_0x35b7b4[_0x4aee('0x3c')]);_0x172247[_0x4aee('0x40')]=_[_0x4aee('0x3f')](_0x35b7b4[_0x4aee('0x3b')],qs['fields'](_0x49cc88['query']['fields']));_0x172247[_0x4aee('0x40')]=_0x172247['attributes'][_0x4aee('0x42')]?_0x172247['attributes']:_0x35b7b4['model'];_0x172247[_0x4aee('0x43')]=qs[_0x4aee('0x44')](_0x49cc88[_0x4aee('0x3c')]['sort']);_0x172247[_0x4aee('0x45')]=qs['filters'](_['pick'](_0x49cc88['query'],_0x35b7b4['filters']));if(_0x49cc88[_0x4aee('0x3c')]['filter']){_0x172247['where']=_[_0x4aee('0x49')](_0x172247[_0x4aee('0x45')],{'$or':_[_0x4aee('0x38')](_0x172247[_0x4aee('0x40')],function(_0x486207){var _0x46f694={};_0x46f694[_0x486207]={'$like':'%'+_0x49cc88[_0x4aee('0x3c')][_0x4aee('0x47')]+'%'};return _0x46f694;})});}_0x172247=_[_0x4aee('0x49')]({},_0x172247,_0x49cc88[_0x4aee('0x4a')]);return _0x4881d1[_0x4aee('0xbd')](_0x172247);}})[_0x4aee('0x1d')](function(_0x45603e){if(_0x45603e){_0x3974a8=_0x45603e['length'];if(!_0x49cc88[_0x4aee('0x3c')][_0x4aee('0x65')](_0x4aee('0x69'))){_0x172247['limit']=qs[_0x4aee('0x2a')](_0x49cc88[_0x4aee('0x3c')][_0x4aee('0x2a')]);_0x172247[_0x4aee('0x2c')]=qs[_0x4aee('0x2c')](_0x49cc88[_0x4aee('0x3c')][_0x4aee('0x2c')]);}return _0x4881d1[_0x4aee('0xbd')](_0x172247);}})[_0x4aee('0x1d')](function(_0x6cf599){if(_0x6cf599){return _0x6cf599?{'count':_0x3974a8,'rows':_0x6cf599}:null;}})[_0x4aee('0x1d')](respondWithResult(_0x340bfd,null))[_0x4aee('0x50')](handleError(_0x340bfd,null));};exports[_0x4aee('0xbe')]=function(_0xfe9c36,_0x26378a,_0x26cc6b){var _0x4b4894={'raw':![],'where':{}};var _0x2bef37={};var _0x2b09da={'count':0x0,'rows':[]};return db[_0x4aee('0x4b')][_0x4aee('0x64')]({'where':{'id':_0xfe9c36['params']['id']}})[_0x4aee('0x1d')](handleEntityNotFound(_0x26378a,null))[_0x4aee('0x1d')](function(_0x95da9){if(_0x95da9){_0x2bef37[_0x4aee('0x3b')]=_[_0x4aee('0x3d')](db[_0x4aee('0x9d')]['rawAttributes']);_0x2bef37['query']=_[_0x4aee('0x3d')](_0xfe9c36[_0x4aee('0x3c')]);_0x2bef37[_0x4aee('0x3e')]=_[_0x4aee('0x3f')](_0x2bef37[_0x4aee('0x3b')],_0x2bef37['query']);_0x4b4894['attributes']=_['intersection'](_0x2bef37['model'],qs[_0x4aee('0x41')](_0xfe9c36[_0x4aee('0x3c')]['fields']));_0x4b4894[_0x4aee('0x40')]=_0x4b4894[_0x4aee('0x40')][_0x4aee('0x42')]?_0x4b4894[_0x4aee('0x40')]:_0x2bef37[_0x4aee('0x3b')];if(!_0xfe9c36[_0x4aee('0x3c')][_0x4aee('0x65')](_0x4aee('0x69'))){_0x4b4894[_0x4aee('0x2a')]=qs[_0x4aee('0x2a')](_0xfe9c36[_0x4aee('0x3c')][_0x4aee('0x2a')]);_0x4b4894['offset']=qs[_0x4aee('0x2c')](_0xfe9c36['query']['offset']);}_0x4b4894[_0x4aee('0x43')]=qs['sort'](_0xfe9c36[_0x4aee('0x3c')][_0x4aee('0x44')]);_0x4b4894['where']=qs[_0x4aee('0x3e')](_['pick'](_0xfe9c36[_0x4aee('0x3c')],_0x2bef37[_0x4aee('0x3e')]));_0x4b4894[_0x4aee('0x45')][_0x4aee('0x61')]=_0x95da9['id'];if(_0xfe9c36[_0x4aee('0x3c')]['filter']){_0x4b4894[_0x4aee('0x45')]=_[_0x4aee('0x49')](_0x4b4894[_0x4aee('0x45')],{'$or':_[_0x4aee('0x38')](_0x4b4894[_0x4aee('0x40')],function(_0x5090d3){var _0x2d1d09={};_0x2d1d09[_0x5090d3]={'$like':'%'+_0xfe9c36['query'][_0x4aee('0x47')]+'%'};return _0x2d1d09;})});}_0x4b4894=_[_0x4aee('0x49')]({},_0x4b4894,_0xfe9c36[_0x4aee('0x4a')]);return db[_0x4aee('0x9d')][_0x4aee('0x2b')]({'where':_0x4b4894[_0x4aee('0x45')]})[_0x4aee('0x1d')](function(_0x85613a){_0x2b09da[_0x4aee('0x2b')]=_0x85613a;if(_0xfe9c36[_0x4aee('0x3c')][_0x4aee('0x4c')]){_0x4b4894['include']=[{'model':db['CmContact'],'as':_0x4aee('0xbf'),'required':![]},{'model':db[_0x4aee('0xa6')],'as':'Owner','attributes':[_0x4aee('0x35'),'fullname',_0x4aee('0xc0')],'required':![]},{'model':db[_0x4aee('0xc1')],'as':'Tags','attributes':['id',_0x4aee('0x35'),_0x4aee('0xc2')],'where':_0xfe9c36[_0x4aee('0x3c')][_0x4aee('0xc3')]?{'id':_0xfe9c36[_0x4aee('0x3c')]['tag']}:undefined,'required':_0xfe9c36[_0x4aee('0x3c')][_0x4aee('0xc3')]?!![]:![]}];}return db['SmsInteraction'][_0x4aee('0x4e')](_0x4b4894);})['then'](function(_0x41730e){_0x2b09da[_0x4aee('0x4f')]=_0x41730e;return _0x2b09da;});}})['then'](respondWithFilteredResult(_0x26378a,_0x4b4894))[_0x4aee('0x50')](handleError(_0x26378a,null));};exports[_0x4aee('0xbc')]=function(_0x547c74,_0x2ff412,_0x452813){var _0x3f7ecb,_0x131044,_0x5bb528;if(_[_0x4aee('0x92')](_0x547c74['body'][_0x4aee('0x5d')])||_0x547c74['body']['body']===''){throw new db[(_0x4aee('0x73'))][(_0x4aee('0x74'))](_0x4aee('0x93'));}if(_[_0x4aee('0x92')](_0x547c74['body']['to'])){throw new db['Sequelize'][(_0x4aee('0x74'))]('to\x20is\x20mandatory');}_0x3f7ecb=_0x547c74['body']['to'];return db['SmsAccount'][_0x4aee('0x54')]({'where':{'id':_0x547c74[_0x4aee('0x52')]['id']},'include':[{'model':db[_0x4aee('0x98')],'as':_0x4aee('0xc4'),'include':[{'model':db['CmContact'],'as':_0x4aee('0x99'),'where':{'mobile':_0x3f7ecb},'limit':0x1,'order':[[_0x4aee('0xc5'),_0x4aee('0x9a')]]}]}]})['then'](handleEntityNotFound(_0x2ff412,null))['then'](function(_0x12766c){if(_0x12766c&&_0x12766c[_0x4aee('0xc4')]){_0x131044=_0x12766c['get']({'plain':!![]});if(_0x131044['List']&&_0x131044[_0x4aee('0xc4')]['Contacts'][_0x4aee('0x42')]){return _0x131044['List'][_0x4aee('0x99')][0x0];}return db[_0x4aee('0x72')]['create'](_[_0x4aee('0x9c')](_0x547c74['body'],{'firstName':_0x3f7ecb,'mobile':_0x3f7ecb,'phone':_0x3f7ecb,'ListId':_0x131044[_0x4aee('0x78')]}));}})['then'](handleEntityNotFound(_0x2ff412,null))[_0x4aee('0x1d')](function(_0x1ee4ef){if(_0x1ee4ef){_0x5bb528=_0x1ee4ef;return db[_0x4aee('0x9d')][_0x4aee('0x54')]({'where':{'ContactId':_0x5bb528['id'],'closed':![],'SmsAccountId':_0x131044['id']}})[_0x4aee('0x1d')](function(_0x35b628){if(_0x35b628){return[_0x35b628,![]];}return db[_0x4aee('0x9d')][_0x4aee('0x55')]({'UserId':_0x547c74[_0x4aee('0x56')]['id'],'ContactId':_0x5bb528['id'],'SmsAccountId':_0x131044['id'],'phone':_0x3f7ecb,'firstMsgDirection':_0x4aee('0xc6'),'Messages':[_[_0x4aee('0x49')](_0x547c74[_0x4aee('0x5d')],{'read':![],'body':_0x547c74['body'][_0x4aee('0x5d')],'phone':_0x3f7ecb,'SmsAccountId':_0x131044['id'],'UserId':_0x547c74[_0x4aee('0x56')]['id'],'ContactId':_0x5bb528['id']})]},{'include':[{'model':db[_0x4aee('0xc7')],'as':_0x4aee('0xc8')}]})[_0x4aee('0x1d')](function(_0x1cd6cf){return[_0x1cd6cf,!![]];});});}})[_0x4aee('0x9e')](function(_0x469483,_0x14620d){if(_0x14620d){return _0x469483;}return db[_0x4aee('0xc7')][_0x4aee('0x55')](_[_0x4aee('0x49')](_0x547c74['body'],{'read':![],'body':_0x547c74['body']['body'],'phone':_0x3f7ecb,'SmsAccountId':_0x131044['id'],'SmsInteractionId':_0x469483['id'],'UserId':_0x547c74[_0x4aee('0x56')]['id'],'ContactId':_0x5bb528['id']}))['then'](function(_0xc74c8d){_0x469483[_0x4aee('0xc9')]['Messages']=[];_0x469483['dataValues'][_0x4aee('0xc8')][_0x4aee('0xa1')](_0xc74c8d[_0x4aee('0xc9')]);return _0x469483;});})[_0x4aee('0x1d')](respondWithResult(_0x2ff412,null))[_0x4aee('0x50')](handleError(_0x2ff412,null));};exports[_0x4aee('0x26')]=function(_0x132026,_0x14105e,_0x48fc34){if(_0x132026['body']['id']){delete _0x132026[_0x4aee('0x5d')]['id'];}var _0x4289e4,_0x34aa66,_0x47b924;return db[_0x4aee('0x4b')][_0x4aee('0x54')]({'where':{'id':_0x132026['params']['id']}})[_0x4aee('0x1d')](handleEntityNotFound(_0x14105e,null))[_0x4aee('0x1d')](function(_0x35a273){if(_0x35a273){_0x47b924=_0x35a273;logger[_0x4aee('0x21')](_0x4aee('0xad'),'status',_0x4aee('0xca'),_0x35a273[_0x4aee('0x7a')],util[_0x4aee('0xcb')](_0x132026[_0x4aee('0x5d')],{'showHidden':![],'depth':null}));switch(_0x35a273[_0x4aee('0x7a')]){case _0x4aee('0x80'):if(_0x132026['body']['skebby_dispatch_id']&&_0x132026[_0x4aee('0x5d')][_0x4aee('0x26')]){_0x34aa66=_0x132026['body'][_0x4aee('0x26')];return db[_0x4aee('0xc7')]['find']({'where':{'messageId':_0x132026[_0x4aee('0x5d')][_0x4aee('0xcc')]}});}break;case'connectel':if(_0x132026[_0x4aee('0x5d')][_0x4aee('0xcd')]&&_0x132026['body'][_0x4aee('0xce')]){_0x34aa66=_0x132026[_0x4aee('0x5d')][_0x4aee('0xce')];return db['SmsMessage']['find']({'where':{'messageId':_0x132026[_0x4aee('0x5d')][_0x4aee('0xcd')]}});}break;case'clicksend':if(_0x132026['body'][_0x4aee('0x85')]&&_0x132026['body'][_0x4aee('0xcf')]){_0x34aa66=_0x132026['body'][_0x4aee('0xcf')];return db[_0x4aee('0xc7')][_0x4aee('0x54')]({'where':{'messageId':_0x132026['body']['message_id']}});}break;case _0x4aee('0x88'):var _0x1db333=_0x132026[_0x4aee('0x5d')]['results'][0x0];if(_0x1db333['messageId']&&_0x1db333[_0x4aee('0x26')][_0x4aee('0xd0')]==='DELIVERED'){_0x34aa66=_0x1db333[_0x4aee('0x26')][_0x4aee('0xd0')];return db['SmsMessage'][_0x4aee('0x54')]({'where':{'messageId':_0x1db333[_0x4aee('0x7e')]}});}break;case _0x4aee('0xd1'):if(_0x132026['body'][_0x4aee('0x7e')]&&_0x132026[_0x4aee('0x5d')][_0x4aee('0x26')]){_0x34aa66=_0x132026[_0x4aee('0x5d')][_0x4aee('0x26')];return db['SmsMessage']['find']({'where':{'messageId':_0x132026['body'][_0x4aee('0x7e')]}});}break;case _0x4aee('0x8e'):if(_0x132026['body'][0x0][_0x4aee('0x23')]['id']){_0x34aa66=_0x132026[_0x4aee('0x5d')][0x0][_0x4aee('0x7a')];return db[_0x4aee('0xc7')]['find']({'where':{'messageId':_0x132026[_0x4aee('0x5d')][0x0][_0x4aee('0x23')]['id']}});}break;case _0x4aee('0x8f'):if(_0x132026['body']['redif']&&_0x132026['body'][_0x4aee('0x26')]){_0x34aa66=_0x132026[_0x4aee('0x5d')][_0x4aee('0x26')];return db['SmsMessage'][_0x4aee('0x54')]({'where':{'messageId':_0x132026[_0x4aee('0x5d')][_0x4aee('0xd2')]}});}break;}}})[_0x4aee('0x1d')](handleEntityNotFound(_0x14105e,null))['then'](function(_0x298961){if(_0x298961){_0x4289e4=_0x298961;switch(_0x47b924['type']){case _0x4aee('0x80'):if(_0x34aa66===_0x4aee('0xd3')){return _0x4289e4['update']({'read':!![]});}else{logger[_0x4aee('0x22')](_0x4aee('0xad'),_0x4aee('0x26'),_0x4aee('0x80'),util['inspect'](_0x132026[_0x4aee('0x5d')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x34aa66==='1'){return _0x4289e4['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4aee('0x26'),_0x4aee('0x80'),util[_0x4aee('0xcb')](_0x132026[_0x4aee('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x4aee('0x84'):if(!_0x132026[_0x4aee('0x5d')][_0x4aee('0xd4')]&&_0x34aa66>=0xc8&&_0x34aa66<=0xce){return _0x4289e4['update']({'read':!![]});}else{logger[_0x4aee('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4aee('0x26'),_0x4aee('0x84'),util['inspect'](_0x132026[_0x4aee('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x4aee('0x88'):var _0x26ac20=_0x132026[_0x4aee('0x5d')]['results'][0x0];if(_0x26ac20['status'][_0x4aee('0xd0')]===_0x4aee('0xd3')){return _0x4289e4[_0x4aee('0x5c')]({'read':!![]});}else{logger[_0x4aee('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4aee('0x88'),util[_0x4aee('0xcb')](_0x132026['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x34aa66==_0x4aee('0xd5')||_0x34aa66==_0x4aee('0xd6')){return _0x4289e4[_0x4aee('0x5c')]({'read':!![]});}else{logger[_0x4aee('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4aee('0x26'),_0x4aee('0xd1'),util['inspect'](_0x132026[_0x4aee('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x4aee('0x8e'):if(_0x34aa66=='message-delivered'){return _0x4289e4[_0x4aee('0x5c')]({'read':!![]});}else{logger[_0x4aee('0x22')](_0x4aee('0xad'),'status',_0x4aee('0x8e'),util[_0x4aee('0xcb')](_0x132026['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x34aa66===_0x4aee('0xd7')||_0x34aa66===_0x4aee('0xd8')){return _0x4289e4[_0x4aee('0x5c')]({'read':!![]});}else{logger[_0x4aee('0x22')](_0x4aee('0xad'),_0x4aee('0x26'),_0x4aee('0x8f'),util[_0x4aee('0xcb')](_0x132026['body'],{'showHidden':![],'depth':null}));}break;}return _0x4289e4;}})[_0x4aee('0x1d')](respondWithResult(_0x14105e,null))[_0x4aee('0x50')](handleError(_0x14105e,null));};exports[_0x4aee('0xd9')]=function(_0x481ef7,_0xd773be,_0xec2a35){var _0x5b0662,_0x5c4327,_0x6239dc;return db[_0x4aee('0x4b')][_0x4aee('0x54')]({'where':{'id':_0x481ef7[_0x4aee('0x52')]['id']}})[_0x4aee('0x1d')](handleEntityNotFound(_0xd773be,null))['then'](function(_0x581cb2){if(_0x581cb2){_0x6239dc=_0x581cb2;logger[_0x4aee('0x21')](_0x4aee('0xad'),_0x4aee('0x26'),_0x4aee('0xca'),_0x581cb2[_0x4aee('0x7a')],util[_0x4aee('0xcb')](_0x481ef7[_0x4aee('0x3c')],{'showHidden':![],'depth':null}));switch(_0x581cb2['type']){case _0x4aee('0x8a'):if(_0x481ef7[_0x4aee('0x3c')][_0x4aee('0xda')]&&_0x481ef7['query']['state']){_0x5c4327=_0x481ef7[_0x4aee('0x3c')][_0x4aee('0xdb')];return db['SmsMessage']['find']({'where':{'messageId':_0x481ef7[_0x4aee('0x3c')][_0x4aee('0xda')]}});}break;}}})['then'](handleEntityNotFound(_0xd773be,null))['then'](function(_0x16040){if(_0x16040){_0x5b0662=_0x16040;switch(_0x6239dc[_0x4aee('0x7a')]){case _0x4aee('0x8a'):if(_0x5c4327==='2'||_0x5c4327==='6'){return _0x5b0662[_0x4aee('0x5c')]({'read':!![]});}else{logger[_0x4aee('0x22')](_0x4aee('0xad'),_0x4aee('0x26'),_0x4aee('0x8a'),util['inspect'](_0x481ef7[_0x4aee('0x3c')],{'showHidden':![],'depth':null}));};break;}return _0x5b0662;}})[_0x4aee('0x1d')](respondWithResult(_0xd773be,null))[_0x4aee('0x50')](handleError(_0xd773be,null));};exports['addAgents']=function(_0x320a6e,_0x4ef4a4,_0x2ff70f){return db[_0x4aee('0x4b')]['find']({'where':{'id':_0x320a6e[_0x4aee('0x52')]['id']}})[_0x4aee('0x1d')](handleEntityNotFound(_0x4ef4a4,null))[_0x4aee('0x1d')](function(_0x4a8ed8){if(_0x4a8ed8){return _0x4a8ed8[_0x4aee('0xdc')](_0x320a6e[_0x4aee('0x5d')][_0x4aee('0x6b')],_[_0x4aee('0x9b')](_0x320a6e[_0x4aee('0x5d')],[_0x4aee('0x6b'),'id'])||{})[_0x4aee('0x9e')](function(_0x2cd44c){for(var _0x78cf63=0x0;_0x78cf63<_0x320a6e[_0x4aee('0x5d')]['ids'][_0x4aee('0x42')];_0x78cf63+=0x1){socket[_0x4aee('0xdd')]('userSmsAccount:save',{'UserId':Number(_0x320a6e[_0x4aee('0x5d')][_0x4aee('0x6b')][_0x78cf63]),'SmsAccountId':Number(_0x320a6e[_0x4aee('0x52')]['id'])});}return _0x2cd44c;});}})[_0x4aee('0x1d')](respondWithResult(_0x4ef4a4,null))[_0x4aee('0x50')](handleError(_0x4ef4a4,null));};exports[_0x4aee('0xde')]=function(_0x3852ec,_0x403e17,_0x593ac9){return db[_0x4aee('0x4b')][_0x4aee('0x54')]({'where':{'id':_0x3852ec[_0x4aee('0x52')]['id']}})['then'](handleEntityNotFound(_0x403e17,null))[_0x4aee('0x1d')](function(_0x145195){if(_0x145195){return _0x145195['removeAgents'](_0x3852ec[_0x4aee('0x3c')][_0x4aee('0x6b')])['then'](function(){if(_[_0x4aee('0xdf')](_0x3852ec[_0x4aee('0x3c')]['ids'])){for(var _0x2296de=0x0;_0x2296de<_0x3852ec[_0x4aee('0x3c')][_0x4aee('0x6b')][_0x4aee('0x42')];_0x2296de+=0x1){socket[_0x4aee('0xdd')]('userSmsAccount:remove',{'UserId':Number(_0x3852ec['query'][_0x4aee('0x6b')][_0x2296de]),'SmsAccountId':Number(_0x3852ec[_0x4aee('0x52')]['id'])});}}else{socket[_0x4aee('0xdd')](_0x4aee('0xe0'),{'UserId':Number(_0x3852ec['query']['ids']),'SmsAccountId':Number(_0x3852ec[_0x4aee('0x52')]['id'])});}});}})[_0x4aee('0x1d')](respondWithStatusCode(_0x403e17,null))[_0x4aee('0x50')](handleError(_0x403e17,null));};exports[_0x4aee('0xe1')]=function(_0x3ade68,_0x1ca263,_0x2d912b){var _0x528733={};var _0x391059={};var _0x59326a;var _0x5f0c50;return db[_0x4aee('0x4b')]['findOne']({'where':{'id':_0x3ade68[_0x4aee('0x52')]['id']}})[_0x4aee('0x1d')](handleEntityNotFound(_0x1ca263,null))['then'](function(_0x174934){if(_0x174934){_0x59326a=_0x174934;_0x391059[_0x4aee('0x3b')]=_['keys'](db[_0x4aee('0xa6')][_0x4aee('0x53')]);_0x391059[_0x4aee('0x3c')]=_[_0x4aee('0x3d')](_0x3ade68[_0x4aee('0x3c')]);_0x391059['filters']=_['intersection'](_0x391059['model'],_0x391059[_0x4aee('0x3c')]);_0x528733[_0x4aee('0x40')]=_[_0x4aee('0x3f')](_0x391059[_0x4aee('0x3b')],qs[_0x4aee('0x41')](_0x3ade68['query'][_0x4aee('0x41')]));_0x528733['attributes']=_0x528733[_0x4aee('0x40')][_0x4aee('0x42')]?_0x528733[_0x4aee('0x40')]:_0x391059['model'];_0x528733[_0x4aee('0x43')]=qs[_0x4aee('0x44')](_0x3ade68[_0x4aee('0x3c')][_0x4aee('0x44')]);_0x528733[_0x4aee('0x45')]=qs[_0x4aee('0x3e')](_[_0x4aee('0x46')](_0x3ade68[_0x4aee('0x3c')],_0x391059[_0x4aee('0x3e')]));if(_0x3ade68['query'][_0x4aee('0x47')]){_0x528733[_0x4aee('0x45')]=_[_0x4aee('0x49')](_0x528733['where'],{'$or':_[_0x4aee('0x38')](_0x528733['attributes'],function(_0x1a2668){var _0x1cf0e7={};_0x1cf0e7[_0x1a2668]={'$like':'%'+_0x3ade68[_0x4aee('0x3c')][_0x4aee('0x47')]+'%'};return _0x1cf0e7;})});}_0x528733=_[_0x4aee('0x49')]({},_0x528733,_0x3ade68[_0x4aee('0x4a')]);return _0x59326a[_0x4aee('0xe1')](_0x528733);}})['then'](function(_0x524e7f){if(_0x524e7f){_0x5f0c50=_0x524e7f[_0x4aee('0x42')];if(!_0x3ade68[_0x4aee('0x3c')]['hasOwnProperty']('nolimit')){_0x528733['limit']=qs[_0x4aee('0x2a')](_0x3ade68['query']['limit']);_0x528733[_0x4aee('0x2c')]=qs['offset'](_0x3ade68[_0x4aee('0x3c')][_0x4aee('0x2c')]);}return _0x59326a[_0x4aee('0xe1')](_0x528733);}})['then'](function(_0x445354){if(_0x445354){return _0x445354?{'count':_0x5f0c50,'rows':_0x445354}:null;}})['then'](respondWithResult(_0x1ca263,null))[_0x4aee('0x50')](handleError(_0x1ca263,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 7a0d2dc..9ec3edc 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 _0xd254=['save','emit','hasOwnProperty','exports','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xd254,0x66));var _0x4d25=function(_0x742133,_0x2584f9){_0x742133=_0x742133-0x0;var _0xca254a=_0xd254[_0x742133];return _0xca254a;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x4d25('0x0'))['db'][_0x4d25('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x4d25('0x2')](0x0);var events={'afterCreate':_0x4d25('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3865ba){return function(_0x2c75c1,_0x9f984a,_0x22f20c){SmsAccountEvents[_0x4d25('0x4')](_0x3865ba+':'+_0x2c75c1['id'],_0x2c75c1);SmsAccountEvents[_0x4d25('0x4')](_0x3865ba,_0x2c75c1);_0x22f20c(null);};}for(var e in events){if(events[_0x4d25('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x4d25('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0x5402=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','save'];(function(_0xfaa9c8,_0x10edb8){var _0x5db1f5=function(_0x46897a){while(--_0x46897a){_0xfaa9c8['push'](_0xfaa9c8['shift']());}};_0x5db1f5(++_0x10edb8);}(_0x5402,0x8d));var _0x2540=function(_0x1f59fd,_0x2aaef4){_0x1f59fd=_0x1f59fd-0x0;var _0xede698=_0x5402[_0x1f59fd];return _0xede698;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x2540('0x0'))['db'][_0x2540('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2540('0x2'),'afterUpdate':_0x2540('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4b68bf){return function(_0x58a90b,_0x447875,_0x4d7b7d){SmsAccountEvents[_0x2540('0x4')](_0x4b68bf+':'+_0x58a90b['id'],_0x58a90b);SmsAccountEvents[_0x2540('0x4')](_0x4b68bf,_0x58a90b);_0x4d7b7d(null);};}for(var e in events){if(events[_0x2540('0x5')](e)){var event=events[e];SmsAccount[_0x2540('0x6')](e,emitEvent(event));}}module[_0x2540('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 5a94fda..19b736d 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 _0xdba4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger'];(function(_0xe591a7,_0x25c84d){var _0x3f0a72=function(_0x53010a){while(--_0x53010a){_0xe591a7['push'](_0xe591a7['shift']());}};_0x3f0a72(++_0x25c84d);}(_0xdba4,0x97));var _0x4dba=function(_0x29b698,_0x16e572){_0x29b698=_0x29b698-0x0;var _0x3d8ce1=_0xdba4[_0x29b698];return _0x3d8ce1;};'use strict';var _=require(_0x4dba('0x0'));var util=require(_0x4dba('0x1'));var logger=require(_0x4dba('0x2'))(_0x4dba('0x3'));var moment=require(_0x4dba('0x4'));var BPromise=require(_0x4dba('0x5'));var rp=require(_0x4dba('0x6'));var fs=require('fs');var path=require(_0x4dba('0x7'));var rimraf=require(_0x4dba('0x8'));var config=require(_0x4dba('0x9'));var attributes=require(_0x4dba('0xa'));module[_0x4dba('0xb')]=function(_0x19a913,_0x21ab8c){return _0x19a913[_0x4dba('0xc')](_0x4dba('0xd'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacdd=['define','SmsAccount','sms_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./smsAccount.attributes','exports'];(function(_0x3ebb01,_0x3d9841){var _0x19fb86=function(_0x336e9b){while(--_0x336e9b){_0x3ebb01['push'](_0x3ebb01['shift']());}};_0x19fb86(++_0x3d9841);}(_0xacdd,0x12f));var _0xdacd=function(_0x100e28,_0x14a38e){_0x100e28=_0x100e28-0x0;var _0x11213e=_0xacdd[_0x100e28];return _0x11213e;};'use strict';var _=require(_0xdacd('0x0'));var util=require(_0xdacd('0x1'));var logger=require(_0xdacd('0x2'))('api');var moment=require(_0xdacd('0x3'));var BPromise=require(_0xdacd('0x4'));var rp=require(_0xdacd('0x5'));var fs=require('fs');var path=require(_0xdacd('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdacd('0x7'));module[_0xdacd('0x8')]=function(_0xeb4ba2,_0x4a9e7c){return _0xeb4ba2[_0xdacd('0x9')](_0xdacd('0xa'),attributes,{'tableName':_0xdacd('0xb'),'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 00af537..fee172f 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 _0x6e82=['lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','info','catch','SmsAccount','find','options','where','attributes','include','map','model','ShowSmsAccount'];(function(_0x342d4d,_0x525841){var _0x2098ea=function(_0x1c3d19){while(--_0x1c3d19){_0x342d4d['push'](_0x342d4d['shift']());}};_0x2098ea(++_0x525841);}(_0x6e82,0x132));var _0x26e8=function(_0x4715fe,_0x590fd2){_0x4715fe=_0x4715fe-0x0;var _0x59255c=_0x6e82[_0x4715fe];return _0x59255c;};'use strict';var _=require(_0x26e8('0x0'));var util=require(_0x26e8('0x1'));var moment=require(_0x26e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26e8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x26e8('0x4'))(_0x26e8('0x5'));var config=require(_0x26e8('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x26e8('0x7')]({'port':0x232a});config['redis']=_[_0x26e8('0x8')](config[_0x26e8('0x9')],{'host':_0x26e8('0xa'),'port':0x18eb});var socket=require(_0x26e8('0xb'))(new Redis(config['redis']));require(_0x26e8('0xc'))[_0x26e8('0xd')](socket);function respondWithRpcPromise(_0x5df35c,_0x32619b,_0x5bf880){return new BPromise(function(_0x609f1f,_0x1a9f0c){return client['request'](_0x5df35c,_0x5bf880)[_0x26e8('0xe')](function(_0x597980){logger['info']('SmsAccount,\x20%s,\x20%s',_0x32619b,_0x26e8('0xf'));logger[_0x26e8('0x10')](_0x26e8('0x11'),_0x32619b,_0x26e8('0xf'),JSON[_0x26e8('0x12')](_0x597980));if(_0x597980[_0x26e8('0x13')]){if(_0x597980['error'][_0x26e8('0x14')]===0x1f4){logger[_0x26e8('0x13')]('SmsAccount,\x20%s,\x20%s',_0x32619b,_0x597980[_0x26e8('0x13')][_0x26e8('0x15')]);return _0x1a9f0c(_0x597980[_0x26e8('0x13')][_0x26e8('0x15')]);}logger['error'](_0x26e8('0x16'),_0x32619b,_0x597980['error'][_0x26e8('0x15')]);return _0x609f1f(_0x597980[_0x26e8('0x13')][_0x26e8('0x15')]);}else{logger[_0x26e8('0x17')](_0x26e8('0x16'),_0x32619b,_0x26e8('0xf'));_0x609f1f(_0x597980['result'][_0x26e8('0x15')]);}})[_0x26e8('0x18')](function(_0x2039ee){logger[_0x26e8('0x13')](_0x26e8('0x16'),_0x32619b,_0x2039ee);_0x1a9f0c(_0x2039ee);});});}exports['ShowSmsAccount']=function(_0x48af19){var _0x5ed818=this;return new Promise(function(_0x451170,_0x399cd7){return db[_0x26e8('0x19')][_0x26e8('0x1a')]({'raw':_0x48af19[_0x26e8('0x1b')]?_0x48af19['options']['raw']===undefined?!![]:![]:!![],'where':_0x48af19[_0x26e8('0x1b')]?_0x48af19['options'][_0x26e8('0x1c')]||null:null,'attributes':_0x48af19[_0x26e8('0x1b')]?_0x48af19['options'][_0x26e8('0x1d')]||null:null,'include':_0x48af19[_0x26e8('0x1b')]?_0x48af19['options'][_0x26e8('0x1e')]?_[_0x26e8('0x1f')](_0x48af19['options'][_0x26e8('0x1e')],function(_0x44da17){return{'model':db[_0x44da17[_0x26e8('0x20')]],'as':_0x44da17['as'],'attributes':_0x44da17[_0x26e8('0x1d')],'include':_0x44da17['include']?_[_0x26e8('0x1f')](_0x44da17[_0x26e8('0x1e')],function(_0x34cfcc){return{'model':db[_0x34cfcc[_0x26e8('0x20')]],'as':_0x34cfcc['as'],'attributes':_0x34cfcc[_0x26e8('0x1d')],'include':_0x34cfcc['include']?_[_0x26e8('0x1f')](_0x34cfcc[_0x26e8('0x1e')],function(_0x12d09c){return{'model':db[_0x12d09c[_0x26e8('0x20')]],'as':_0x12d09c['as'],'attributes':_0x12d09c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x118fc2){logger[_0x26e8('0x17')](_0x26e8('0x21'),_0x48af19);logger[_0x26e8('0x10')](_0x26e8('0x21'),_0x48af19,JSON[_0x26e8('0x12')](_0x118fc2));_0x451170(_0x118fc2);})['catch'](function(_0x134bd5){logger[_0x26e8('0x13')]('ShowSmsAccount',_0x134bd5[_0x26e8('0x15')],_0x48af19);_0x399cd7(_0x5ed818[_0x26e8('0x13')](0x1f4,_0x134bd5[_0x26e8('0x15')]));});});}; \ No newline at end of file +var _0xa561=['stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa561,0xd8));var _0x1a56=function(_0xd29b13,_0x3da412){_0xd29b13=_0xd29b13-0x0;var _0x3483a1=_0xa561[_0xd29b13];return _0x3483a1;};'use strict';var _=require(_0x1a56('0x0'));var util=require(_0x1a56('0x1'));var moment=require(_0x1a56('0x2'));var BPromise=require(_0x1a56('0x3'));var rs=require(_0x1a56('0x4'));var fs=require('fs');var Redis=require(_0x1a56('0x5'));var db=require(_0x1a56('0x6'))['db'];var utils=require(_0x1a56('0x7'));var logger=require('../../config/logger')(_0x1a56('0x8'));var config=require(_0x1a56('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1a56('0xa')][_0x1a56('0xb')]({'port':0x232a});config[_0x1a56('0xc')]=_[_0x1a56('0xd')](config[_0x1a56('0xc')],{'host':_0x1a56('0xe'),'port':0x18eb});var socket=require(_0x1a56('0xf'))(new Redis(config[_0x1a56('0xc')]));require(_0x1a56('0x10'))[_0x1a56('0x11')](socket);function respondWithRpcPromise(_0x8b7598,_0x3bf1d7,_0x6e2104){return new BPromise(function(_0x442d12,_0x29a935){return client[_0x1a56('0x12')](_0x8b7598,_0x6e2104)[_0x1a56('0x13')](function(_0x2757e1){logger[_0x1a56('0x14')]('SmsAccount,\x20%s,\x20%s',_0x3bf1d7,_0x1a56('0x15'));logger[_0x1a56('0x16')](_0x1a56('0x17'),_0x3bf1d7,_0x1a56('0x15'),JSON[_0x1a56('0x18')](_0x2757e1));if(_0x2757e1[_0x1a56('0x19')]){if(_0x2757e1[_0x1a56('0x19')][_0x1a56('0x1a')]===0x1f4){logger[_0x1a56('0x19')]('SmsAccount,\x20%s,\x20%s',_0x3bf1d7,_0x2757e1['error'][_0x1a56('0x1b')]);return _0x29a935(_0x2757e1[_0x1a56('0x19')][_0x1a56('0x1b')]);}logger[_0x1a56('0x19')](_0x1a56('0x1c'),_0x3bf1d7,_0x2757e1[_0x1a56('0x19')][_0x1a56('0x1b')]);return _0x442d12(_0x2757e1[_0x1a56('0x19')][_0x1a56('0x1b')]);}else{logger[_0x1a56('0x14')](_0x1a56('0x1c'),_0x3bf1d7,_0x1a56('0x15'));_0x442d12(_0x2757e1[_0x1a56('0x1d')][_0x1a56('0x1b')]);}})[_0x1a56('0x1e')](function(_0x4a9a58){logger[_0x1a56('0x19')](_0x1a56('0x1c'),_0x3bf1d7,_0x4a9a58);_0x29a935(_0x4a9a58);});});}exports[_0x1a56('0x1f')]=function(_0x2173e4){var _0x40d429=this;return new Promise(function(_0xe6b438,_0x255daf){return db[_0x1a56('0x20')][_0x1a56('0x21')]({'raw':_0x2173e4[_0x1a56('0x22')]?_0x2173e4[_0x1a56('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x2173e4[_0x1a56('0x22')]?_0x2173e4[_0x1a56('0x22')][_0x1a56('0x23')]||null:null,'attributes':_0x2173e4[_0x1a56('0x22')]?_0x2173e4[_0x1a56('0x22')][_0x1a56('0x24')]||null:null,'include':_0x2173e4[_0x1a56('0x22')]?_0x2173e4[_0x1a56('0x22')]['include']?_['map'](_0x2173e4[_0x1a56('0x22')][_0x1a56('0x25')],function(_0x173281){return{'model':db[_0x173281['model']],'as':_0x173281['as'],'attributes':_0x173281['attributes'],'include':_0x173281[_0x1a56('0x25')]?_[_0x1a56('0x26')](_0x173281[_0x1a56('0x25')],function(_0x10f228){return{'model':db[_0x10f228[_0x1a56('0x27')]],'as':_0x10f228['as'],'attributes':_0x10f228[_0x1a56('0x24')],'include':_0x10f228[_0x1a56('0x25')]?_[_0x1a56('0x26')](_0x10f228['include'],function(_0x2f4269){return{'model':db[_0x2f4269[_0x1a56('0x27')]],'as':_0x2f4269['as'],'attributes':_0x2f4269[_0x1a56('0x24')]};}):[]};}):[]};}):[]:[]})[_0x1a56('0x13')](function(_0x15033e){logger[_0x1a56('0x14')]('ShowSmsAccount',_0x2173e4);logger[_0x1a56('0x16')](_0x1a56('0x1f'),_0x2173e4,JSON['stringify'](_0x15033e));_0xe6b438(_0x15033e);})[_0x1a56('0x1e')](function(_0x5ed32f){logger[_0x1a56('0x19')](_0x1a56('0x1f'),_0x5ed32f[_0x1a56('0x1b')],_0x2173e4);_0x255daf(_0x40d429['error'](0x1f4,_0x5ed32f[_0x1a56('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index bfcff78..10bea4c 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 559036d..a8d6d60 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 _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x16f77a,_0x38d3c0){var _0x5871dc=function(_0x3c414e){while(--_0x3c414e){_0x16f77a['push'](_0x16f77a['shift']());}};_0x5871dc(++_0x38d3c0);}(_0x7217,0x19e));var _0x7721=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7217[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file +var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0xaad817,_0x2e0397){var _0x451b31=function(_0x5e359b){while(--_0x5e359b){_0xaad817['push'](_0xaad817['shift']());}};_0x451b31(++_0x2e0397);}(_0x008c,0x188));var _0xc008=function(_0x1aa981,_0x45eb1a){_0x1aa981=_0x1aa981-0x0;var _0x332fd6=_0x008c[_0x1aa981];return _0x332fd6;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index adba5da..be35336 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 _0x2a7b=['INTEGER','STRING','TEXT','*,*,*,*','exports'];(function(_0x42b7a5,_0x50f1a7){var _0x30c438=function(_0x14a06d){while(--_0x14a06d){_0x42b7a5['push'](_0x42b7a5['shift']());}};_0x30c438(++_0x50f1a7);}(_0x2a7b,0x10d));var _0xb2a7=function(_0x54fb39,_0x52a196){_0x54fb39=_0x54fb39-0x0;var _0x2da963=_0x2a7b[_0x54fb39];return _0x2da963;};'use strict';var Sequelize=require('sequelize');module[_0xb2a7('0x0')]={'priority':{'type':Sequelize[_0xb2a7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb2a7('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb2a7('0x3')]()},'description':{'type':Sequelize[_0xb2a7('0x2')]},'interval':{'type':Sequelize[_0xb2a7('0x2')],'defaultValue':_0xb2a7('0x4')}}; \ No newline at end of file +var _0x2f7e=['noop','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0x2f7e,0x10b));var _0xe2f7=function(_0x316f9b,_0x5c55fa){_0x316f9b=_0x316f9b-0x0;var _0x518d6f=_0x2f7e[_0x316f9b];return _0x518d6f;};'use strict';var Sequelize=require(_0xe2f7('0x0'));module[_0xe2f7('0x1')]={'priority':{'type':Sequelize[_0xe2f7('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe2f7('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe2f7('0x4')]},'interval':{'type':Sequelize[_0xe2f7('0x4')],'defaultValue':_0xe2f7('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 224f87c..bcec35e 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 _0x024c=['rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','SmsApplication','findAll','rows','catch','show','keys','length','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','map'];(function(_0x19358d,_0x4a2c1c){var _0x385078=function(_0x239c70){while(--_0x239c70){_0x19358d['push'](_0x19358d['shift']());}};_0x385078(++_0x4a2c1c);}(_0x024c,0x1c1));var _0xc024=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x024c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc024('0x0'));var rimraf=require(_0xc024('0x1'));var zipdir=require(_0xc024('0x2'));var jsonpatch=require(_0xc024('0x3'));var rp=require(_0xc024('0x4'));var moment=require('moment');var BPromise=require(_0xc024('0x5'));var Mustache=require(_0xc024('0x6'));var util=require(_0xc024('0x7'));var path=require(_0xc024('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc024('0x9'));var fs=require('fs');var fs_extra=require(_0xc024('0xa'));var _=require(_0xc024('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc024('0xc'));var deskjs=require(_0xc024('0xd'));var toCsv=require(_0xc024('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc024('0xf'));var logger=require(_0xc024('0x10'))(_0xc024('0x11'));var utils=require(_0xc024('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc024('0x13'));var db=require(_0xc024('0x14'))['db'];function respondWithStatusCode(_0x39fa95,_0x52ac96){_0x52ac96=_0x52ac96||0xcc;return function(_0x5a2d07){if(_0x5a2d07){return _0x39fa95[_0xc024('0x15')](_0x52ac96);}return _0x39fa95['status'](_0x52ac96)[_0xc024('0x16')]();};}function respondWithResult(_0x1d97ff,_0x658ff2){_0x658ff2=_0x658ff2||0xc8;return function(_0x5b18b9){if(_0x5b18b9){return _0x1d97ff[_0xc024('0x17')](_0x658ff2)[_0xc024('0x18')](_0x5b18b9);}};}function respondWithFilteredResult(_0x2920fc,_0x26f637){return function(_0x263549){if(_0x263549){var _0x2ba900=typeof _0x26f637[_0xc024('0x19')]===_0xc024('0x1a')&&typeof _0x26f637[_0xc024('0x1b')]===_0xc024('0x1a');var _0x57b372=_0x263549[_0xc024('0x1c')];var _0x58fb32=_0x2ba900?0x0:_0x26f637['offset'];var _0x4cff8d=_0x2ba900?_0x263549[_0xc024('0x1c')]:_0x26f637[_0xc024('0x19')]+_0x26f637[_0xc024('0x1b')];var _0x59aac7;if(_0x4cff8d>=_0x57b372){_0x4cff8d=_0x57b372;_0x59aac7=0xc8;}else{_0x59aac7=0xce;}_0x2920fc[_0xc024('0x17')](_0x59aac7);return _0x2920fc[_0xc024('0x1d')](_0xc024('0x1e'),_0x58fb32+'-'+_0x4cff8d+'/'+_0x57b372)['json'](_0x263549);}return null;};}function patchUpdates(_0x169571){return function(_0x545811){try{jsonpatch[_0xc024('0x1f')](_0x545811,_0x169571,!![]);}catch(_0x51afb4){return BPromise[_0xc024('0x20')](_0x51afb4);}return _0x545811[_0xc024('0x21')]();};}function saveUpdates(_0xbf1a92,_0x5609c3){return function(_0x32223c){if(_0x32223c){return _0x32223c[_0xc024('0x22')](_0xbf1a92)[_0xc024('0x23')](function(_0x3989e0){return _0x3989e0;});}return null;};}function removeEntity(_0x2b31c7,_0xccf40b){return function(_0x4d124d){if(_0x4d124d){return _0x4d124d[_0xc024('0x24')]()[_0xc024('0x23')](function(){_0x2b31c7[_0xc024('0x17')](0xcc)[_0xc024('0x16')]();});}};}function handleEntityNotFound(_0x4acc54,_0xc72c6c){return function(_0x4db697){if(!_0x4db697){_0x4acc54['sendStatus'](0x194);}return _0x4db697;};}function handleError(_0x43969c,_0x4c8bf3){_0x4c8bf3=_0x4c8bf3||0x1f4;return function(_0x2e1243){logger[_0xc024('0x25')](_0x2e1243[_0xc024('0x26')]);if(_0x2e1243['name']){delete _0x2e1243['name'];}_0x43969c['status'](_0x4c8bf3)['send'](_0x2e1243);};}exports[_0xc024('0x27')]=function(_0x13e6ab,_0x30b512){var _0x62aba0={},_0x3871b6={},_0x2bbbe2={'count':0x0,'rows':[]};var _0x3c3bf6=_[_0xc024('0x28')](db['SmsApplication'][_0xc024('0x29')],function(_0xe59b6f){return{'name':_0xe59b6f['fieldName'],'type':_0xe59b6f[_0xc024('0x2a')][_0xc024('0x2b')]};});_0x3871b6[_0xc024('0x2c')]=_[_0xc024('0x28')](_0x3c3bf6,'name');_0x3871b6[_0xc024('0x2d')]=_['keys'](_0x13e6ab[_0xc024('0x2d')]);_0x3871b6[_0xc024('0x2e')]=_[_0xc024('0x2f')](_0x3871b6[_0xc024('0x2c')],_0x3871b6[_0xc024('0x2d')]);_0x62aba0[_0xc024('0x30')]=_['intersection'](_0x3871b6[_0xc024('0x2c')],qs[_0xc024('0x31')](_0x13e6ab[_0xc024('0x2d')][_0xc024('0x31')]));_0x62aba0[_0xc024('0x30')]=_0x62aba0[_0xc024('0x30')]['length']?_0x62aba0['attributes']:_0x3871b6['model'];if(!_0x13e6ab[_0xc024('0x2d')][_0xc024('0x32')]('nolimit')){_0x62aba0['limit']=qs[_0xc024('0x1b')](_0x13e6ab[_0xc024('0x2d')][_0xc024('0x1b')]);_0x62aba0[_0xc024('0x19')]=qs[_0xc024('0x19')](_0x13e6ab[_0xc024('0x2d')][_0xc024('0x19')]);}_0x62aba0[_0xc024('0x33')]=qs[_0xc024('0x34')](_0x13e6ab['query'][_0xc024('0x34')]);_0x62aba0[_0xc024('0x35')]=qs[_0xc024('0x2e')](_['pick'](_0x13e6ab[_0xc024('0x2d')],_0x3871b6[_0xc024('0x2e')]),_0x3c3bf6);if(_0x13e6ab[_0xc024('0x2d')][_0xc024('0x36')]){_0x62aba0['where']=_['merge'](_0x62aba0[_0xc024('0x35')],{'$or':_['map'](_0x3c3bf6,function(_0x3570a7){if(_0x3570a7[_0xc024('0x2a')]!==_0xc024('0x37')){var _0x2e945e={};_0x2e945e[_0x3570a7['name']]={'$like':'%'+_0x13e6ab[_0xc024('0x2d')][_0xc024('0x36')]+'%'};return _0x2e945e;}})});}_0x62aba0=_[_0xc024('0x38')]({},_0x62aba0,_0x13e6ab[_0xc024('0x39')]);var _0x48ae7e={'where':_0x62aba0[_0xc024('0x35')]};return db[_0xc024('0x3a')][_0xc024('0x1c')](_0x48ae7e)['then'](function(_0x38b736){_0x2bbbe2['count']=_0x38b736;if(_0x13e6ab[_0xc024('0x2d')]['includeAll']){_0x62aba0['include']=[{'all':!![]}];}return db[_0xc024('0x3a')][_0xc024('0x3b')](_0x62aba0);})['then'](function(_0x15839a){_0x2bbbe2[_0xc024('0x3c')]=_0x15839a;return _0x2bbbe2;})[_0xc024('0x23')](respondWithFilteredResult(_0x30b512,_0x62aba0))[_0xc024('0x3d')](handleError(_0x30b512,null));};exports[_0xc024('0x3e')]=function(_0x54db5d,_0x381c05){var _0x560a29={'raw':!![],'where':{'id':_0x54db5d['params']['id']}},_0xd37a26={};_0xd37a26[_0xc024('0x2c')]=_[_0xc024('0x3f')](db[_0xc024('0x3a')][_0xc024('0x29')]);_0xd37a26[_0xc024('0x2d')]=_[_0xc024('0x3f')](_0x54db5d[_0xc024('0x2d')]);_0xd37a26[_0xc024('0x2e')]=_[_0xc024('0x2f')](_0xd37a26[_0xc024('0x2c')],_0xd37a26['query']);_0x560a29[_0xc024('0x30')]=_[_0xc024('0x2f')](_0xd37a26[_0xc024('0x2c')],qs['fields'](_0x54db5d[_0xc024('0x2d')][_0xc024('0x31')]));_0x560a29[_0xc024('0x30')]=_0x560a29[_0xc024('0x30')][_0xc024('0x40')]?_0x560a29[_0xc024('0x30')]:_0xd37a26['model'];if(_0x54db5d['query'][_0xc024('0x41')]){_0x560a29[_0xc024('0x42')]=[{'all':!![]}];}_0x560a29=_[_0xc024('0x38')]({},_0x560a29,_0x54db5d[_0xc024('0x39')]);return db[_0xc024('0x3a')][_0xc024('0x43')](_0x560a29)['then'](handleEntityNotFound(_0x381c05,null))[_0xc024('0x23')](respondWithResult(_0x381c05,null))[_0xc024('0x3d')](handleError(_0x381c05,null));};exports[_0xc024('0x44')]=function(_0x671a73,_0x48d2ac){return db['SmsApplication'][_0xc024('0x44')](_0x671a73[_0xc024('0x45')],{})['then'](respondWithResult(_0x48d2ac,0xc9))[_0xc024('0x3d')](handleError(_0x48d2ac,null));};exports[_0xc024('0x22')]=function(_0x466d21,_0x24a677){if(_0x466d21['body']['id']){delete _0x466d21[_0xc024('0x45')]['id'];}return db['SmsApplication'][_0xc024('0x43')]({'where':{'id':_0x466d21['params']['id']}})[_0xc024('0x23')](handleEntityNotFound(_0x24a677,null))[_0xc024('0x23')](saveUpdates(_0x466d21[_0xc024('0x45')],null))['then'](respondWithResult(_0x24a677,null))[_0xc024('0x3d')](handleError(_0x24a677,null));};exports['destroy']=function(_0x54774e,_0x554db8){return db[_0xc024('0x3a')]['find']({'where':{'id':_0x54774e['params']['id']}})[_0xc024('0x23')](handleEntityNotFound(_0x554db8,null))[_0xc024('0x23')](removeEntity(_0x554db8,null))[_0xc024('0x3d')](handleError(_0x554db8,null));}; \ No newline at end of file +var _0x6c55=['Content-Range','reject','save','update','then','error','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filter','options','includeAll','include','rows','catch','show','params','length','merge','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','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','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0x6c55,0x10a));var _0x56c5=function(_0x3e6a06,_0x5ddcd6){_0x3e6a06=_0x3e6a06-0x0;var _0xcdc571=_0x6c55[_0x3e6a06];return _0xcdc571;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56c5('0x0'));var zipdir=require(_0x56c5('0x1'));var jsonpatch=require(_0x56c5('0x2'));var rp=require(_0x56c5('0x3'));var moment=require(_0x56c5('0x4'));var BPromise=require(_0x56c5('0x5'));var Mustache=require(_0x56c5('0x6'));var util=require(_0x56c5('0x7'));var path=require('path');var sox=require(_0x56c5('0x8'));var csv=require('to-csv');var ejs=require(_0x56c5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x56c5('0xa'));var squel=require(_0x56c5('0xb'));var crypto=require(_0x56c5('0xc'));var jsforce=require(_0x56c5('0xd'));var deskjs=require(_0x56c5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x56c5('0xf'));var Redis=require(_0x56c5('0x10'));var authService=require(_0x56c5('0x11'));var qs=require(_0x56c5('0x12'));var as=require(_0x56c5('0x13'));var hardwareService=require(_0x56c5('0x14'));var logger=require(_0x56c5('0x15'))('api');var utils=require(_0x56c5('0x16'));var config=require(_0x56c5('0x17'));var licenseUtil=require(_0x56c5('0x18'));var db=require(_0x56c5('0x19'))['db'];function respondWithStatusCode(_0x4b5b40,_0x57b684){_0x57b684=_0x57b684||0xcc;return function(_0x5c9adb){if(_0x5c9adb){return _0x4b5b40[_0x56c5('0x1a')](_0x57b684);}return _0x4b5b40['status'](_0x57b684)[_0x56c5('0x1b')]();};}function respondWithResult(_0x52d0f7,_0x221647){_0x221647=_0x221647||0xc8;return function(_0x1d60fa){if(_0x1d60fa){return _0x52d0f7['status'](_0x221647)[_0x56c5('0x1c')](_0x1d60fa);}};}function respondWithFilteredResult(_0xdfb68d,_0x504529){return function(_0x472da3){if(_0x472da3){var _0x308e08=typeof _0x504529[_0x56c5('0x1d')]==='undefined'&&typeof _0x504529[_0x56c5('0x1e')]==='undefined';var _0x4a4d32=_0x472da3[_0x56c5('0x1f')];var _0x28158f=_0x308e08?0x0:_0x504529['offset'];var _0x5189f1=_0x308e08?_0x472da3[_0x56c5('0x1f')]:_0x504529['offset']+_0x504529[_0x56c5('0x1e')];var _0x15cdd5;if(_0x5189f1>=_0x4a4d32){_0x5189f1=_0x4a4d32;_0x15cdd5=0xc8;}else{_0x15cdd5=0xce;}_0xdfb68d[_0x56c5('0x20')](_0x15cdd5);return _0xdfb68d[_0x56c5('0x21')](_0x56c5('0x22'),_0x28158f+'-'+_0x5189f1+'/'+_0x4a4d32)['json'](_0x472da3);}return null;};}function patchUpdates(_0x13b9a5){return function(_0xdd7695){try{jsonpatch['apply'](_0xdd7695,_0x13b9a5,!![]);}catch(_0x39e9f3){return BPromise[_0x56c5('0x23')](_0x39e9f3);}return _0xdd7695[_0x56c5('0x24')]();};}function saveUpdates(_0x377d2d,_0x4c4b39){return function(_0x268137){if(_0x268137){return _0x268137[_0x56c5('0x25')](_0x377d2d)[_0x56c5('0x26')](function(_0x303eb9){return _0x303eb9;});}return null;};}function removeEntity(_0x12c0da,_0x573809){return function(_0x58de69){if(_0x58de69){return _0x58de69['destroy']()[_0x56c5('0x26')](function(){_0x12c0da['status'](0xcc)[_0x56c5('0x1b')]();});}};}function handleEntityNotFound(_0x411ec8,_0x3d1953){return function(_0x6740bd){if(!_0x6740bd){_0x411ec8[_0x56c5('0x1a')](0x194);}return _0x6740bd;};}function handleError(_0x480b7b,_0x5370b2){_0x5370b2=_0x5370b2||0x1f4;return function(_0x2d0f8c){logger[_0x56c5('0x27')](_0x2d0f8c['stack']);if(_0x2d0f8c[_0x56c5('0x28')]){delete _0x2d0f8c[_0x56c5('0x28')];}_0x480b7b[_0x56c5('0x20')](_0x5370b2)[_0x56c5('0x29')](_0x2d0f8c);};}exports[_0x56c5('0x2a')]=function(_0x4e692b,_0x46ae62){var _0x29182c={},_0x4ac296={},_0x516a90={'count':0x0,'rows':[]};var _0x1df8b0=_[_0x56c5('0x2b')](db[_0x56c5('0x2c')][_0x56c5('0x2d')],function(_0x4f6647){return{'name':_0x4f6647[_0x56c5('0x2e')],'type':_0x4f6647[_0x56c5('0x2f')][_0x56c5('0x30')]};});_0x4ac296['model']=_[_0x56c5('0x2b')](_0x1df8b0,_0x56c5('0x28'));_0x4ac296[_0x56c5('0x31')]=_[_0x56c5('0x32')](_0x4e692b[_0x56c5('0x31')]);_0x4ac296[_0x56c5('0x33')]=_[_0x56c5('0x34')](_0x4ac296['model'],_0x4ac296[_0x56c5('0x31')]);_0x29182c[_0x56c5('0x35')]=_['intersection'](_0x4ac296[_0x56c5('0x36')],qs[_0x56c5('0x37')](_0x4e692b[_0x56c5('0x31')][_0x56c5('0x37')]));_0x29182c[_0x56c5('0x35')]=_0x29182c['attributes']['length']?_0x29182c[_0x56c5('0x35')]:_0x4ac296['model'];if(!_0x4e692b[_0x56c5('0x31')]['hasOwnProperty'](_0x56c5('0x38'))){_0x29182c[_0x56c5('0x1e')]=qs[_0x56c5('0x1e')](_0x4e692b[_0x56c5('0x31')][_0x56c5('0x1e')]);_0x29182c[_0x56c5('0x1d')]=qs[_0x56c5('0x1d')](_0x4e692b['query'][_0x56c5('0x1d')]);}_0x29182c[_0x56c5('0x39')]=qs['sort'](_0x4e692b[_0x56c5('0x31')][_0x56c5('0x3a')]);_0x29182c[_0x56c5('0x3b')]=qs[_0x56c5('0x33')](_[_0x56c5('0x3c')](_0x4e692b[_0x56c5('0x31')],_0x4ac296[_0x56c5('0x33')]),_0x1df8b0);if(_0x4e692b[_0x56c5('0x31')][_0x56c5('0x3d')]){_0x29182c['where']=_['merge'](_0x29182c[_0x56c5('0x3b')],{'$or':_['map'](_0x1df8b0,function(_0x4484f4){if(_0x4484f4[_0x56c5('0x2f')]!=='VIRTUAL'){var _0x3c60ed={};_0x3c60ed[_0x4484f4[_0x56c5('0x28')]]={'$like':'%'+_0x4e692b['query']['filter']+'%'};return _0x3c60ed;}})});}_0x29182c=_['merge']({},_0x29182c,_0x4e692b[_0x56c5('0x3e')]);var _0x551ee0={'where':_0x29182c[_0x56c5('0x3b')]};return db[_0x56c5('0x2c')][_0x56c5('0x1f')](_0x551ee0)[_0x56c5('0x26')](function(_0x5a5ac5){_0x516a90['count']=_0x5a5ac5;if(_0x4e692b[_0x56c5('0x31')][_0x56c5('0x3f')]){_0x29182c[_0x56c5('0x40')]=[{'all':!![]}];}return db[_0x56c5('0x2c')]['findAll'](_0x29182c);})['then'](function(_0x2bfca0){_0x516a90[_0x56c5('0x41')]=_0x2bfca0;return _0x516a90;})['then'](respondWithFilteredResult(_0x46ae62,_0x29182c))[_0x56c5('0x42')](handleError(_0x46ae62,null));};exports[_0x56c5('0x43')]=function(_0x1676e,_0x298977){var _0x4ac2dd={'raw':!![],'where':{'id':_0x1676e[_0x56c5('0x44')]['id']}},_0x4460d9={};_0x4460d9[_0x56c5('0x36')]=_[_0x56c5('0x32')](db['SmsApplication'][_0x56c5('0x2d')]);_0x4460d9[_0x56c5('0x31')]=_[_0x56c5('0x32')](_0x1676e[_0x56c5('0x31')]);_0x4460d9['filters']=_['intersection'](_0x4460d9['model'],_0x4460d9[_0x56c5('0x31')]);_0x4ac2dd[_0x56c5('0x35')]=_[_0x56c5('0x34')](_0x4460d9[_0x56c5('0x36')],qs[_0x56c5('0x37')](_0x1676e[_0x56c5('0x31')][_0x56c5('0x37')]));_0x4ac2dd[_0x56c5('0x35')]=_0x4ac2dd[_0x56c5('0x35')][_0x56c5('0x45')]?_0x4ac2dd[_0x56c5('0x35')]:_0x4460d9['model'];if(_0x1676e[_0x56c5('0x31')][_0x56c5('0x3f')]){_0x4ac2dd[_0x56c5('0x40')]=[{'all':!![]}];}_0x4ac2dd=_[_0x56c5('0x46')]({},_0x4ac2dd,_0x1676e['options']);return db['SmsApplication'][_0x56c5('0x47')](_0x4ac2dd)['then'](handleEntityNotFound(_0x298977,null))['then'](respondWithResult(_0x298977,null))[_0x56c5('0x42')](handleError(_0x298977,null));};exports[_0x56c5('0x48')]=function(_0x303ab1,_0x20e5d1){return db['SmsApplication']['create'](_0x303ab1[_0x56c5('0x49')],{})[_0x56c5('0x26')](respondWithResult(_0x20e5d1,0xc9))[_0x56c5('0x42')](handleError(_0x20e5d1,null));};exports['update']=function(_0x4f35f0,_0x3cf477){if(_0x4f35f0[_0x56c5('0x49')]['id']){delete _0x4f35f0[_0x56c5('0x49')]['id'];}return db[_0x56c5('0x2c')][_0x56c5('0x47')]({'where':{'id':_0x4f35f0[_0x56c5('0x44')]['id']}})[_0x56c5('0x26')](handleEntityNotFound(_0x3cf477,null))[_0x56c5('0x26')](saveUpdates(_0x4f35f0[_0x56c5('0x49')],null))[_0x56c5('0x26')](respondWithResult(_0x3cf477,null))[_0x56c5('0x42')](handleError(_0x3cf477,null));};exports[_0x56c5('0x4a')]=function(_0x208a11,_0x238b8d){return db[_0x56c5('0x2c')][_0x56c5('0x47')]({'where':{'id':_0x208a11[_0x56c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x238b8d,null))[_0x56c5('0x26')](removeEntity(_0x238b8d,null))[_0x56c5('0x42')](handleError(_0x238b8d,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 6b46be4..3db744b 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 _0x98a8=['exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','./smsApplication.attributes'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x98a8,0x1f0));var _0x898a=function(_0x2e8394,_0xe9cb31){_0x2e8394=_0x2e8394-0x0;var _0x21d5b6=_0x98a8[_0x2e8394];return _0x21d5b6;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var logger=require('../../config/logger')(_0x898a('0x2'));var moment=require(_0x898a('0x3'));var BPromise=require('bluebird');var rp=require(_0x898a('0x4'));var fs=require('fs');var path=require(_0x898a('0x5'));var rimraf=require(_0x898a('0x6'));var config=require('../../config/environment');var attributes=require(_0x898a('0x7'));module[_0x898a('0x8')]=function(_0x35914e,_0x3cac8e){return _0x35914e[_0x898a('0x9')](_0x898a('0xa'),attributes,{'tableName':_0x898a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x898a('0xc'),'collate':_0x898a('0xd')});}; \ No newline at end of file +var _0x4243=['define','SmsApplication','sms_applications','utf8mb4','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x4cc5e7,_0x42f53f){var _0x437069=function(_0x55b596){while(--_0x55b596){_0x4cc5e7['push'](_0x4cc5e7['shift']());}};_0x437069(++_0x42f53f);}(_0x4243,0x170));var _0x3424=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4243[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3424('0x0'));var util=require(_0x3424('0x1'));var logger=require('../../config/logger')(_0x3424('0x2'));var moment=require(_0x3424('0x3'));var BPromise=require('bluebird');var rp=require(_0x3424('0x4'));var fs=require('fs');var path=require(_0x3424('0x5'));var rimraf=require(_0x3424('0x6'));var config=require(_0x3424('0x7'));var attributes=require(_0x3424('0x8'));module[_0x3424('0x9')]=function(_0x2bb65b,_0x2993e6){return _0x2bb65b[_0x3424('0xa')](_0x3424('0xb'),attributes,{'tableName':_0x3424('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3424('0xd'),'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 c2a3874..119e546 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 _0xf894=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','error','message','result'];(function(_0x4d02f9,_0x46bf85){var _0x82e438=function(_0x46c3c5){while(--_0x46c3c5){_0x4d02f9['push'](_0x4d02f9['shift']());}};_0x82e438(++_0x46bf85);}(_0xf894,0xfd));var _0x4f89=function(_0x16b372,_0x52103a){_0x16b372=_0x16b372-0x0;var _0x5a79c4=_0xf894[_0x16b372];return _0x5a79c4;};'use strict';var _=require(_0x4f89('0x0'));var util=require(_0x4f89('0x1'));var moment=require(_0x4f89('0x2'));var BPromise=require(_0x4f89('0x3'));var rs=require(_0x4f89('0x4'));var fs=require('fs');var Redis=require(_0x4f89('0x5'));var db=require(_0x4f89('0x6'))['db'];var utils=require(_0x4f89('0x7'));var logger=require(_0x4f89('0x8'))(_0x4f89('0x9'));var config=require(_0x4f89('0xa'));var jayson=require(_0x4f89('0xb'));var client=jayson[_0x4f89('0xc')][_0x4f89('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x324870,_0x33920a,_0x39b492){return new BPromise(function(_0x188d3f,_0x5cb3a5){return client[_0x4f89('0xe')](_0x324870,_0x39b492)[_0x4f89('0xf')](function(_0x2eb8fe){logger[_0x4f89('0x10')](_0x4f89('0x11'),_0x33920a,_0x4f89('0x12'));logger[_0x4f89('0x13')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x33920a,'request\x20sent',JSON['stringify'](_0x2eb8fe));if(_0x2eb8fe[_0x4f89('0x14')]){if(_0x2eb8fe[_0x4f89('0x14')]['code']===0x1f4){logger[_0x4f89('0x14')](_0x4f89('0x11'),_0x33920a,_0x2eb8fe[_0x4f89('0x14')][_0x4f89('0x15')]);return _0x5cb3a5(_0x2eb8fe[_0x4f89('0x14')][_0x4f89('0x15')]);}logger[_0x4f89('0x14')](_0x4f89('0x11'),_0x33920a,_0x2eb8fe[_0x4f89('0x14')]['message']);return _0x188d3f(_0x2eb8fe[_0x4f89('0x14')][_0x4f89('0x15')]);}else{logger[_0x4f89('0x10')](_0x4f89('0x11'),_0x33920a,_0x4f89('0x12'));_0x188d3f(_0x2eb8fe[_0x4f89('0x16')][_0x4f89('0x15')]);}})['catch'](function(_0x9c194){logger['error']('SmsApplication,\x20%s,\x20%s',_0x33920a,_0x9c194);_0x5cb3a5(_0x9c194);});});} \ No newline at end of file +var _0xd05a=['info','result','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd05a,0x143));var _0xad05=function(_0x265626,_0x2fe476){_0x265626=_0x265626-0x0;var _0x57c0d2=_0xd05a[_0x265626];return _0x57c0d2;};'use strict';var _=require('lodash');var util=require(_0xad05('0x0'));var moment=require(_0xad05('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad05('0x2'));var logger=require(_0xad05('0x3'))(_0xad05('0x4'));var config=require(_0xad05('0x5'));var jayson=require(_0xad05('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39ddaf,_0x45303c,_0xd12d76){return new BPromise(function(_0x565f85,_0x17ec26){return client[_0xad05('0x7')](_0x39ddaf,_0xd12d76)[_0xad05('0x8')](function(_0x573acb){logger['info'](_0xad05('0x9'),_0x45303c,'request\x20sent');logger[_0xad05('0xa')](_0xad05('0xb'),_0x45303c,_0xad05('0xc'),JSON[_0xad05('0xd')](_0x573acb));if(_0x573acb[_0xad05('0xe')]){if(_0x573acb[_0xad05('0xe')][_0xad05('0xf')]===0x1f4){logger[_0xad05('0xe')](_0xad05('0x9'),_0x45303c,_0x573acb[_0xad05('0xe')]['message']);return _0x17ec26(_0x573acb[_0xad05('0xe')]['message']);}logger[_0xad05('0xe')]('SmsApplication,\x20%s,\x20%s',_0x45303c,_0x573acb[_0xad05('0xe')][_0xad05('0x10')]);return _0x565f85(_0x573acb[_0xad05('0xe')]['message']);}else{logger[_0xad05('0x11')]('SmsApplication,\x20%s,\x20%s',_0x45303c,_0xad05('0xc'));_0x565f85(_0x573acb[_0xad05('0x12')][_0xad05('0x10')]);}})[_0xad05('0x13')](function(_0x43ab03){logger[_0xad05('0xe')]('SmsApplication,\x20%s,\x20%s',_0x45303c,_0x43ab03);_0x17ec26(_0x43ab03);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 7f0296b..5a0e8be 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 _0x6324=['isAuthenticated','index','describe','show','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','/:id','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x5898cd,_0x30bf84){var _0x3ae503=function(_0x7d0f60){while(--_0x7d0f60){_0x5898cd['push'](_0x5898cd['shift']());}};_0x3ae503(++_0x30bf84);}(_0x6324,0x142));var _0x4632=function(_0x55e839,_0x3b5345){_0x55e839=_0x55e839-0x0;var _0x39c61a=_0x6324[_0x55e839];return _0x39c61a;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./smsInteraction.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['get']('/:id/messages',auth[_0x4632('0x8')](),controller[_0x4632('0xc')]);router[_0x4632('0x7')](_0x4632('0xd'),auth[_0x4632('0x8')](),controller[_0x4632('0xe')]);router[_0x4632('0xf')]('/',auth[_0x4632('0x8')](),controller['create']);router[_0x4632('0xf')]('/:id/messages',auth[_0x4632('0x8')](),controller[_0x4632('0x10')]);router[_0x4632('0xf')](_0x4632('0x11'),auth['isAuthenticated'](),interaction[_0x4632('0x12')](_0x4632('0x13'),_0x4632('0x14')),controller[_0x4632('0x15')]);router[_0x4632('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0x4632('0x12')](_0x4632('0x13'),_0x4632('0x17')),controller[_0x4632('0x18')]);router['delete'](_0x4632('0x19'),auth[_0x4632('0x8')](),interaction[_0x4632('0x12')]('sms',_0x4632('0x1a')),controller[_0x4632('0x1b')]);router['delete']('/:id/tags',auth[_0x4632('0x8')](),controller[_0x4632('0x1c')]);module[_0x4632('0x1d')]=router; \ No newline at end of file +var _0x087b=['sms','smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked'];(function(_0x114400,_0x59103d){var _0x586c5b=function(_0x5715d7){while(--_0x5715d7){_0x114400['push'](_0x114400['shift']());}};_0x586c5b(++_0x59103d);}(_0x087b,0x11a));var _0xb087=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x087b[_0xfa634c];return _0x73e478;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0x8')]('/:id/messages',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x8')](_0xb087('0x10'),auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x12')]('/',auth['isAuthenticated'](),controller[_0xb087('0x13')]);router[_0xb087('0x12')](_0xb087('0x14'),auth['isAuthenticated'](),controller[_0xb087('0x15')]);router[_0xb087('0x12')](_0xb087('0x16'),auth[_0xb087('0x9')](),interaction[_0xb087('0x17')](_0xb087('0x18'),_0xb087('0x19')),controller[_0xb087('0x1a')]);router[_0xb087('0x1b')](_0xb087('0xd'),auth['isAuthenticated'](),interaction[_0xb087('0x17')](_0xb087('0x18'),'smsinteraction:update'),controller[_0xb087('0x1c')]);router[_0xb087('0x1d')](_0xb087('0xd'),auth['isAuthenticated'](),interaction[_0xb087('0x17')](_0xb087('0x18'),_0xb087('0x1e')),controller[_0xb087('0x1f')]);router['delete'](_0xb087('0x16'),auth[_0xb087('0x9')](),controller[_0xb087('0x20')]);module[_0xb087('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index e6b15a4..cf96a02 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 _0xb39f=['exports','BOOLEAN','STRING','DATE','out','ENUM','sequelize','moment'];(function(_0x30f3a2,_0x124a2f){var _0x2a47a5=function(_0x37d9f7){while(--_0x37d9f7){_0x30f3a2['push'](_0x30f3a2['shift']());}};_0x2a47a5(++_0x124a2f);}(_0xb39f,0x1e6));var _0xfb39=function(_0x29519f,_0x2c57d8){_0x29519f=_0x29519f-0x0;var _0x3e1a79=_0xb39f[_0x29519f];return _0x3e1a79;};'use strict';var Sequelize=require(_0xfb39('0x0'));var moment=require(_0xfb39('0x1'));module[_0xfb39('0x2')]={'closed':{'type':Sequelize[_0xfb39('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xfb39('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xfb39('0x4')]},'read1stAt':{'type':Sequelize[_0xfb39('0x5')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xfb39('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfb39('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xfb39('0x7')]('in',_0xfb39('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb66c=['out','BOOLEAN','sequelize','exports','DATE','STRING','ENUM'];(function(_0xb3978d,_0x2cf242){var _0xde872a=function(_0x5c0ddb){while(--_0x5c0ddb){_0xb3978d['push'](_0xb3978d['shift']());}};_0xde872a(++_0x2cf242);}(_0xb66c,0x175));var _0xcb66=function(_0x59d7b4,_0x124b4d){_0x59d7b4=_0x59d7b4-0x0;var _0x5d3581=_0xb66c[_0x59d7b4];return _0x5d3581;};'use strict';var Sequelize=require(_0xcb66('0x0'));var moment=require('moment');module[_0xcb66('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcb66('0x2')]},'disposition':{'type':Sequelize[_0xcb66('0x3')]},'secondDisposition':{'type':Sequelize[_0xcb66('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xcb66('0x3')]},'phone':{'type':Sequelize[_0xcb66('0x3')]},'read1stAt':{'type':Sequelize[_0xcb66('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xcb66('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcb66('0x4')]('in',_0xcb66('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xcb66('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index b1df3f1..a0ea724 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 _0xe267=['i.*','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','params','includeAll','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','spread','smsInteractionTags:save','removeTags','join','server','files','tmp','attachments','format','transcript-%d-%s.zip','CmContact','lastName','SmsMessage','Messages','direction','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','closedAt','out','System','firstName','secret','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','bluebird','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','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','answered','unmanaged','total','closed','waiting','UserId','talking','index','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','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','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','SmsAccountId','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.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName'];(function(_0x2da8c4,_0x27adda){var _0x3ee006=function(_0x4b9d7c){while(--_0x4b9d7c){_0x2da8c4['push'](_0x2da8c4['shift']());}};_0x3ee006(++_0x27adda);}(_0xe267,0x13c));var _0x7e26=function(_0x43b1fb,_0x22e01e){_0x43b1fb=_0x43b1fb-0x0;var _0x2eb5bc=_0xe267[_0x43b1fb];return _0x2eb5bc;};'use strict';var emlformat=require(_0x7e26('0x0'));var rimraf=require(_0x7e26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e26('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7e26('0x3'));var Mustache=require('mustache');var util=require(_0x7e26('0x4'));var path=require(_0x7e26('0x5'));var sox=require(_0x7e26('0x6'));var csv=require(_0x7e26('0x7'));var ejs=require(_0x7e26('0x8'));var fs=require('fs');var fs_extra=require(_0x7e26('0x9'));var _=require(_0x7e26('0xa'));var squel=require(_0x7e26('0xb'));var crypto=require(_0x7e26('0xc'));var jsforce=require(_0x7e26('0xd'));var deskjs=require(_0x7e26('0xe'));var toCsv=require(_0x7e26('0x7'));var querystring=require(_0x7e26('0xf'));var Papa=require(_0x7e26('0x10'));var Redis=require(_0x7e26('0x11'));var authService=require(_0x7e26('0x12'));var qs=require(_0x7e26('0x13'));var as=require(_0x7e26('0x14'));var pdf=require(_0x7e26('0x15'));var hardwareService=require(_0x7e26('0x16'));var logger=require(_0x7e26('0x17'))(_0x7e26('0x18'));var utils=require(_0x7e26('0x19'));var config=require(_0x7e26('0x1a'));var licenseUtil=require(_0x7e26('0x1b'));var db=require(_0x7e26('0x1c'))['db'];config[_0x7e26('0x1d')]=_[_0x7e26('0x1e')](config[_0x7e26('0x1d')],{'host':_0x7e26('0x1f'),'port':0x18eb});var socket=require(_0x7e26('0x20'))(new Redis(config[_0x7e26('0x1d')]));require(_0x7e26('0x21'))[_0x7e26('0x22')](socket);function respondWithStatusCode(_0x110c6a,_0x15143c){_0x15143c=_0x15143c||0xcc;return function(_0x90354f){if(_0x90354f){return _0x110c6a[_0x7e26('0x23')](_0x15143c);}return _0x110c6a['status'](_0x15143c)[_0x7e26('0x24')]();};}function respondWithResult(_0x296519,_0x93d9a5){_0x93d9a5=_0x93d9a5||0xc8;return function(_0x4b0ecf){if(_0x4b0ecf){return _0x296519[_0x7e26('0x25')](_0x93d9a5)['json'](_0x4b0ecf);}};}function respondWithFilteredResult(_0x1c0536,_0x5ceb0d){return function(_0x55c449){if(_0x55c449){var _0x343ca3=typeof _0x5ceb0d[_0x7e26('0x26')]==='undefined'&&typeof _0x5ceb0d[_0x7e26('0x27')]===_0x7e26('0x28');var _0x2c547f=_0x55c449['count'];var _0x7f19ae=_0x343ca3?0x0:_0x5ceb0d[_0x7e26('0x26')];var _0x72bf56=_0x343ca3?_0x55c449[_0x7e26('0x29')]:_0x5ceb0d[_0x7e26('0x26')]+_0x5ceb0d['limit'];var _0x1582f8;if(_0x72bf56>=_0x2c547f){_0x72bf56=_0x2c547f;_0x1582f8=0xc8;}else{_0x1582f8=0xce;}_0x1c0536['status'](_0x1582f8);return _0x1c0536[_0x7e26('0x2a')](_0x7e26('0x2b'),_0x7f19ae+'-'+_0x72bf56+'/'+_0x2c547f)['json'](_0x55c449);}return null;};}function patchUpdates(_0x5b6d72){return function(_0x2e3d15){try{jsonpatch[_0x7e26('0x2c')](_0x2e3d15,_0x5b6d72,!![]);}catch(_0x3aad00){return BPromise['reject'](_0x3aad00);}return _0x2e3d15[_0x7e26('0x2d')]();};}function saveUpdates(_0x24c333,_0x549cab){return function(_0x4ad76c){if(_0x4ad76c){return _0x4ad76c[_0x7e26('0x2e')](_0x24c333)['then'](function(_0x36a0c2){return _0x36a0c2;});}return null;};}function removeEntity(_0x2121b7,_0x4b9a82){return function(_0x483648){if(_0x483648){return _0x483648[_0x7e26('0x2f')]()[_0x7e26('0x30')](function(){_0x2121b7[_0x7e26('0x25')](0xcc)[_0x7e26('0x24')]();});}};}function handleEntityNotFound(_0x4eed31,_0x191390){return function(_0x19ac90){if(!_0x19ac90){_0x4eed31[_0x7e26('0x23')](0x194);}return _0x19ac90;};}function handleError(_0x1ecac0,_0x352bf0){_0x352bf0=_0x352bf0||0x1f4;return function(_0x11fbc9){logger['error'](_0x11fbc9['stack']);if(_0x11fbc9['name']){delete _0x11fbc9[_0x7e26('0x31')];}_0x1ecac0[_0x7e26('0x25')](_0x352bf0)[_0x7e26('0x32')](_0x11fbc9);};}function getInteractionUsers(_0x342a53,_0x327565){return new BPromise(function(_0xf4b8e,_0x48d5cc){try{if(_0x327565[_0x342a53['id']]){_0x342a53[_0x7e26('0x33')]=_[_0x7e26('0x34')](_0x327565[_0x342a53['id']],function(_0x3074cb){return{'id':_0x3074cb['id'],'fullname':_0x3074cb[_0x7e26('0x35')]};});}}catch(_0x747795){_0x48d5cc(_0x747795);}_0xf4b8e(_0x342a53);});}function getInteractionTags(_0x2473e2,_0xafd0f7){return new BPromise(function(_0x1de9cf,_0x340bfa){try{if(_0x2473e2[_0x7e26('0x36')]){_0x2473e2[_0x7e26('0x37')]=[];_0x2473e2['TagIds'][_0x7e26('0x38')](',')[_0x7e26('0x39')](function(_0x568d9e){_0x2473e2[_0x7e26('0x37')][_0x7e26('0x3a')](_0xafd0f7[_0x568d9e]);});}delete _0x2473e2[_0x7e26('0x36')];}catch(_0x23a7cd){_0x340bfa(_0x23a7cd);}_0x1de9cf(_0x2473e2);});}function updateSmsInteraction(_0x303e82,_0x13816b,_0x37163a){return new BPromise(function(_0x425027,_0x41c547){return getInteractionUsers(_0x303e82,_0x37163a)[_0x7e26('0x30')](function(_0x55d61f){return getInteractionTags(_0x55d61f,_0x13816b);})[_0x7e26('0x30')](function(_0xc89d19){return getStateInteraction(_0xc89d19);})[_0x7e26('0x30')](function(_0x598369){_0x425027(_0x598369);})[_0x7e26('0x3b')](function(_0x378e6f){_0x41c547(_0x378e6f);});});}function getStateInteraction(_0x4df397){return new BPromise(function(_0x520910){_0x4df397['waiting']=0x0;_0x4df397['talking']=0x0;_0x4df397[_0x7e26('0x3c')]=0x0;_0x4df397[_0x7e26('0x3d')]=0x0;_0x4df397[_0x7e26('0x3e')]=0x0;if(!_0x4df397[_0x7e26('0x3f')]&&!_0x4df397['UserId']){_0x4df397[_0x7e26('0x40')]+=0x1;}if(!_0x4df397[_0x7e26('0x3f')]&&_0x4df397[_0x7e26('0x41')]){_0x4df397[_0x7e26('0x42')]+=0x1;if(_0x4df397[_0x7e26('0x40')]){_0x4df397[_0x7e26('0x40')]-=0x1;}}if(_0x4df397[_0x7e26('0x3f')]&&_0x4df397[_0x7e26('0x41')]){_0x4df397[_0x7e26('0x3c')]+=0x1;if(_0x4df397[_0x7e26('0x42')]){_0x4df397[_0x7e26('0x42')]-=0x1;}}if(_0x4df397[_0x7e26('0x3f')]&&!_0x4df397[_0x7e26('0x41')]){_0x4df397['unmanaged']+=0x1;if(_0x4df397[_0x7e26('0x40')]){_0x4df397['waiting']-=0x1;}}_0x4df397[_0x7e26('0x3e')]+=0x1;_0x520910(_0x4df397);});}exports[_0x7e26('0x43')]=function(_0x167c34,_0x228729){var _0x7415a7={},_0x2c4b3c={},_0x2d55d0={'count':0x0,'rows':[]};var _0x2810a0=_['map'](db[_0x7e26('0x44')][_0x7e26('0x45')],function(_0x11433){return{'name':_0x11433[_0x7e26('0x46')],'type':_0x11433[_0x7e26('0x47')][_0x7e26('0x48')]};});_0x2c4b3c[_0x7e26('0x49')]=_[_0x7e26('0x34')](_0x2810a0,_0x7e26('0x31'));_0x2c4b3c[_0x7e26('0x4a')]=_[_0x7e26('0x4b')](_0x167c34[_0x7e26('0x4a')]);_0x2c4b3c[_0x7e26('0x4c')]=_[_0x7e26('0x4d')](_0x2c4b3c[_0x7e26('0x49')],_0x2c4b3c[_0x7e26('0x4a')]);_0x7415a7[_0x7e26('0x4e')]=_['intersection'](_0x2c4b3c[_0x7e26('0x49')],qs[_0x7e26('0x4f')](_0x167c34['query'][_0x7e26('0x4f')]));_0x7415a7[_0x7e26('0x4e')]=_0x7415a7[_0x7e26('0x4e')]['length']?_0x7415a7[_0x7e26('0x4e')]:_0x2c4b3c[_0x7e26('0x49')];if(!_0x167c34[_0x7e26('0x4a')]['hasOwnProperty'](_0x7e26('0x50'))){_0x7415a7[_0x7e26('0x27')]=qs[_0x7e26('0x27')](_0x167c34[_0x7e26('0x4a')][_0x7e26('0x27')]);_0x7415a7['offset']=qs[_0x7e26('0x26')](_0x167c34['query'][_0x7e26('0x26')]);}_0x7415a7[_0x7e26('0x51')]=qs['sort'](_0x167c34[_0x7e26('0x4a')][_0x7e26('0x52')]);_0x7415a7[_0x7e26('0x53')]=qs[_0x7e26('0x4c')](_[_0x7e26('0x54')](_0x167c34['query'],_0x2c4b3c[_0x7e26('0x4c')]),_0x2810a0);var _0xf2271b=[];var _0x183ea1=squel['select']()[_0x7e26('0x55')]('id')[_0x7e26('0x55')](_0x7e26('0x31'))[_0x7e26('0x55')](_0x7e26('0x56'))[_0x7e26('0x57')](_0x7e26('0x58'));var _0x56ec60=squel[_0x7e26('0x59')]()['field'](_0x7e26('0x5a'))[_0x7e26('0x55')](_0x7e26('0x5b'))[_0x7e26('0x55')](_0x7e26('0x5c'))['from'](_0x7e26('0x5d'),'ui')['left_join'](_0x7e26('0x5e'),'u',_0x7e26('0x5f'));var _0x34a661=squel['select']()[_0x7e26('0x57')](_0x7e26('0x60'),'i')[_0x7e26('0x61')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x7e26('0x61')](_0x7e26('0x5e'),'o',_0x7e26('0x62'))[_0x7e26('0x61')](_0x7e26('0x63'),'a',_0x7e26('0x64'))[_0x7e26('0x61')](_0x7e26('0x65'),'me',_0x7e26('0x66'))[_0x7e26('0x61')](_0x7e26('0x67'),'it',_0x7e26('0x68'))[_0x7e26('0x61')](_0x7e26('0x58'),'t',_0x7e26('0x69'));var _0x1a5ddb=squel[_0x7e26('0x6a')]();var _0x2016f2=[];var _0x376d6a=squel['expr']();var _0x33f4dd;if(_0x167c34[_0x7e26('0x4a')][_0x7e26('0x6b')]){_0x33f4dd=as[_0x7e26('0x6c')](_0x167c34[_0x7e26('0x4a')][_0x7e26('0x6b')]);var _0x923d3e=_0x33f4dd[_0x7e26('0x6d')];for(var _0x8140aa=0x0;_0x8140aa<_0x33f4dd[_0x7e26('0x6e')][_0x7e26('0x6f')];_0x8140aa++){var _0x18d6fa=_0x33f4dd[_0x7e26('0x6e')][_0x8140aa];var _0x5b8720='i';var _0x5637e4=_[_0x7e26('0x70')](_0x2810a0,['name',_0x18d6fa['field']]);if(!_0x5637e4){switch(_0x18d6fa[_0x7e26('0x55')]){case _0x7e26('0x71'):if(_0x18d6fa[_0x7e26('0x72')]==0x1){_0x34a661[_0x7e26('0x73')]('`'+_0x18d6fa[_0x7e26('0x55')]+_0x7e26('0x74'));}else{_0x34a661[_0x7e26('0x73')]('`'+_0x18d6fa[_0x7e26('0x55')]+_0x7e26('0x75'));}break;case _0x7e26('0x76'):if(_0x18d6fa[_0x7e26('0x77')]===_0x7e26('0x78')){if(_0x18d6fa['value'][_0x7e26('0x38')]('\x20')['length']>0x1){_0x1a5ddb[_0x923d3e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7e26('0x79')](_0x18d6fa[_0x7e26('0x72')]),null);}else{var _0x3d9b4d='%'+_0x18d6fa[_0x7e26('0x72')]+'%';_0x1a5ddb[_0x923d3e](_0x7e26('0x7a'),_0x3d9b4d,_0x3d9b4d,_0x3d9b4d);}}else{_0x5637e4=_['find'](_0x2810a0,[_0x7e26('0x31'),_0x7e26('0x7b')]);_0x18d6fa[_0x7e26('0x55')]=_0x7e26('0x7b');_0x2b8b81=as[_0x7e26('0x7c')](_0x5b8720,_0x5637e4['type'],_0x18d6fa);_0x1a5ddb[_0x923d3e](_0x2b8b81[_0x7e26('0x7d')],_0x2b8b81[_0x7e26('0x72')][_0x7e26('0x7e')],_0x2b8b81[_0x7e26('0x72')]['end']);}break;case _0x7e26('0x7f'):var _0x191dc7=_0x18d6fa[_0x7e26('0x72')][_0x7e26('0x38')](',')['map'](function(_0x40573a){return Number(_0x40573a);});_0x191dc7['forEach'](function(_0x496df4){_0x376d6a['or'](_0x7e26('0x80'),'%,'+_0x496df4+',%');});_0x2016f2=_[_0x7e26('0x81')](_0x2016f2,_0x191dc7);break;case _0x7e26('0x82'):if(_0x18d6fa[_0x7e26('0x77')]===_0x7e26('0x78')){_0x1a5ddb[_0x923d3e](_0x7e26('0x83'),'%'+_0x18d6fa[_0x7e26('0x72')]+'%',null);}else{_0x5637e4=_['find'](_0x2810a0,[_0x7e26('0x31'),'UserId']);_0x18d6fa['field']=_0x7e26('0x41');_0x2b8b81=as[_0x7e26('0x7c')](_0x5b8720,_0x5637e4['type'],_0x18d6fa);_0x1a5ddb[_0x923d3e](_0x2b8b81[_0x7e26('0x7d')],_0x2b8b81[_0x7e26('0x72')][_0x7e26('0x7e')],_0x2b8b81[_0x7e26('0x72')][_0x7e26('0x24')]);}break;case'body':_0x2b8b81=as[_0x7e26('0x7c')]('me',null,_0x18d6fa);_0x1a5ddb[_0x923d3e](_0x2b8b81['text'],_0x2b8b81[_0x7e26('0x72')][_0x7e26('0x7e')],_0x2b8b81[_0x7e26('0x72')][_0x7e26('0x24')]);break;}}else{var _0x2b8b81=as['buildExpression'](_0x5b8720,_0x5637e4[_0x7e26('0x47')],_0x18d6fa);_0x1a5ddb[_0x923d3e](_0x2b8b81[_0x7e26('0x7d')],_0x2b8b81[_0x7e26('0x72')]['start'],_0x2b8b81[_0x7e26('0x72')]['end']);}}}else{var _0xc1596b=_(_0x167c34[_0x7e26('0x4a')])[_0x7e26('0x4b')]()[_0x7e26('0x34')](function(_0x26df62){return _[_0x7e26('0x84')](_0x2810a0,[_0x7e26('0x31'),_0x26df62])?_0x26df62:undefined;})[_0x7e26('0x85')]()[_0x7e26('0x72')]();if(!_[_0x7e26('0x86')](_0xc1596b)){_0xc1596b['forEach'](function(_0x4e8aaa){if(_0x4e8aaa===_0x7e26('0x87')){_0x34a661[_0x7e26('0x53')]('i.SmsAccountId\x20IN\x20?',[][_0x7e26('0x88')](_0x167c34[_0x7e26('0x4a')][_0x4e8aaa]));}else if(_0x4e8aaa===_0x7e26('0x89')){var _0x240f8b=JSON[_0x7e26('0x8a')](_0x167c34['query'][_0x4e8aaa])[_0x7e26('0x8b')];var _0x918341=JSON[_0x7e26('0x8a')](_0x167c34[_0x7e26('0x4a')][_0x4e8aaa])[_0x7e26('0x8c')];_0x34a661[_0x7e26('0x53')](_0x7e26('0x8d'),_0x240f8b,_0x918341);}else{if(_0x167c34[_0x7e26('0x4a')][_0x4e8aaa]===_0x7e26('0x8e')){_0x34a661[_0x7e26('0x53')]('i.'+_0x4e8aaa+_0x7e26('0x8f'));}else{_0x34a661['where']('i.'+_0x4e8aaa+_0x7e26('0x90'),_0x167c34[_0x7e26('0x4a')][_0x4e8aaa]);}}});}if(_0x167c34[_0x7e26('0x4a')][_0x7e26('0x91')]){if(_0x167c34[_0x7e26('0x4a')][_0x7e26('0x91')]==0x1){_0x34a661[_0x7e26('0x73')](_0x7e26('0x92'));}else{_0x34a661['having'](_0x7e26('0x93'));}}if(_0x167c34[_0x7e26('0x4a')][_0x7e26('0x94')]){_0x2016f2=_[_0x7e26('0x95')](_0x167c34[_0x7e26('0x4a')]['tag'])?_0x167c34[_0x7e26('0x4a')][_0x7e26('0x94')]:new Array(_0x167c34[_0x7e26('0x4a')][_0x7e26('0x94')]);_0x2016f2['forEach'](function(_0x28223c){_0x376d6a['or'](_0x7e26('0x80'),'%,'+_0x28223c+',%');});}if(_0x167c34[_0x7e26('0x4a')]['filter']){var _0x525d5d=_0x167c34[_0x7e26('0x4a')][_0x7e26('0x96')][_0x7e26('0x97')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x7e26('0x98')](_0x525d5d)){_0x1a5ddb['or']('i.id\x20LIKE\x20?',_0x525d5d+'%')['or'](_0x7e26('0x99'),_0x525d5d+'%');}else{_0x1a5ddb['or'](_0x7e26('0x9a'),qs[_0x7e26('0x79')](_0x525d5d))['or'](_0x7e26('0x9b'),_0x525d5d+'%');}}}_0x34a661[_0x7e26('0x53')](_0x1a5ddb);_0x34a661[_0x7e26('0x9c')](_0x7e26('0x9d'));var _0x125d90={'type':db[_0x7e26('0x9e')]['QueryTypes'][_0x7e26('0x9f')],'raw':!![]};var _0x135c1f=_0x34a661[_0x7e26('0xa0')]();_0x135c1f[_0x7e26('0x55')](_0x7e26('0x9d'));_0x135c1f[_0x7e26('0x55')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7e26('0x71'));if(_0x7415a7['order']){_0x7415a7[_0x7e26('0x51')][_0x7e26('0x39')](function(_0x18fa9a){var _0x45e62f=_0x18fa9a[0x0]==='contactName'?_0x18fa9a[0x0]:'i.'+_0x18fa9a[0x0];_0x34a661[_0x7e26('0x51')](_0x45e62f,_0x18fa9a[0x1]===_0x7e26('0xa1')?![]:!![]);});}if(!_[_0x7e26('0x86')](_0x2016f2)){_0x34a661[_0x7e26('0x73')](_0x376d6a);_0x135c1f['where'](_0x7e26('0xa2'),_0x2016f2);}BPromise['resolve']()[_0x7e26('0x30')](function(){if(!_0x33f4dd){if(_0x167c34['query'][_0x7e26('0x87')])return;_0x135c1f['where'](_0x7e26('0xa3'));_0x34a661[_0x7e26('0x53')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x167c34[_0x7e26('0xa4')][_0x7e26('0xa5')]!==_0x7e26('0xa6'))return;return _0x167c34[_0x7e26('0xa4')][_0x7e26('0xa7')]({'attributes':['id'],'raw':!![]})[_0x7e26('0x30')](function(_0x41fc9d){if(_[_0x7e26('0x86')](_0x41fc9d)){_0x135c1f['where'](_0x7e26('0xa8'));_0x34a661['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x135c1f['where'](_0x7e26('0xa9'),_[_0x7e26('0x34')](_0x41fc9d,'id'));_0x34a661['where']('i.SmsAccountId\x20IN\x20?',_[_0x7e26('0x34')](_0x41fc9d,'id'));}});})['then'](function(){if(_0x167c34[_0x7e26('0xa4')][_0x7e26('0xa5')]==='agent'&&!_0x33f4dd&&!_0x167c34[_0x7e26('0x4a')]['SmsAccountId'])return[];return db[_0x7e26('0xaa')][_0x7e26('0x4a')](_0x135c1f[_0x7e26('0xab')](),_0x125d90);})['then'](function(_0x44e7d9){_0x2d55d0[_0x7e26('0x29')]=_0x44e7d9['length'];if(_0x2d55d0[_0x7e26('0x29')]===0x0)return[];return db[_0x7e26('0xaa')][_0x7e26('0x4a')](_0x183ea1[_0x7e26('0xab')](),_0x125d90)[_0x7e26('0x30')](function(_0x49b388){_0xf2271b=_[_0x7e26('0xac')](_0x49b388,'id');_0x125d90=_[_0x7e26('0xad')](_0x125d90,{'model':db[_0x7e26('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x167c34[_0x7e26('0x4a')]['fields']){_0x7415a7[_0x7e26('0x4e')][_0x7e26('0x39')](function(_0x4e3324){_0x34a661[_0x7e26('0x55')]('i.'+_0x4e3324);});}else{_0x34a661[_0x7e26('0x55')](_0x7e26('0xae'),_0x7e26('0x71'));_0x34a661[_0x7e26('0x55')]('a.key',_0x7e26('0xaf'));_0x34a661['field'](_0x7e26('0xb0'),_0x7e26('0xb1'));_0x34a661[_0x7e26('0x55')](_0x7e26('0xb2'),_0x7e26('0xb3'));_0x34a661[_0x7e26('0x55')](_0x7e26('0xb4'));_0x34a661['field']('c.firstName','Contact.firstName');_0x34a661[_0x7e26('0x55')](_0x7e26('0xb5'),_0x7e26('0xb6'));_0x34a661[_0x7e26('0x55')]('c.email',_0x7e26('0xb7'));_0x34a661[_0x7e26('0x55')](_0x7e26('0xb8'),_0x7e26('0xb9'));_0x34a661[_0x7e26('0x55')](_0x7e26('0xba'),_0x7e26('0xbb'));_0x34a661[_0x7e26('0x55')]('c.fax',_0x7e26('0xbc'));_0x34a661[_0x7e26('0x55')]('o.fullname',_0x7e26('0xbd'));_0x34a661['field']('o.internal',_0x7e26('0xbe'));_0x34a661['field'](_0x7e26('0xbf'),_0x7e26('0x36'));}if(_0x7415a7[_0x7e26('0x27')])_0x34a661[_0x7e26('0x27')](_0x7415a7[_0x7e26('0x27')]);if(_0x7415a7[_0x7e26('0x26')])_0x34a661[_0x7e26('0x26')](_0x7415a7[_0x7e26('0x26')]);return db['sequelize'][_0x7e26('0x4a')](_0x34a661[_0x7e26('0xab')](),_0x125d90);})[_0x7e26('0x30')](function(_0x6cecc0){if(_0x6cecc0[_0x7e26('0x6f')]>0x0)_0x56ec60[_0x7e26('0x53')]('ui.SmsInteractionId\x20IN\x20?',_[_0x7e26('0x34')](_0x6cecc0,'id'));return db['sequelize'][_0x7e26('0x4a')](_0x56ec60[_0x7e26('0xab')](),_0x125d90)[_0x7e26('0x30')](function(_0xc2a207){var _0x3e73c5=_[_0x7e26('0xc0')](_0xc2a207,_0x7e26('0xc1'));var _0x4df73c=[];_0x6cecc0['forEach'](function(_0x232889){_0x4df73c[_0x7e26('0x3a')](updateSmsInteraction(_0x232889,_0xf2271b,_0x3e73c5));});return BPromise[_0x7e26('0xc2')](_0x4df73c);});});})[_0x7e26('0x30')](function(_0x3da84c){_0x2d55d0[_0x7e26('0xc3')]=_0x3da84c;return _0x2d55d0;})[_0x7e26('0x30')](respondWithFilteredResult(_0x228729,_0x7415a7))[_0x7e26('0x3b')](handleError(_0x228729,null));};exports['show']=function(_0x9743b4,_0x107078){var _0x59bfe9={'raw':![],'where':{'id':_0x9743b4[_0x7e26('0xc4')]['id']}},_0x55188b={};_0x55188b[_0x7e26('0x49')]=_['keys'](db[_0x7e26('0x44')][_0x7e26('0x45')]);_0x55188b[_0x7e26('0x4a')]=_[_0x7e26('0x4b')](_0x9743b4[_0x7e26('0x4a')]);_0x55188b[_0x7e26('0x4c')]=_[_0x7e26('0x4d')](_0x55188b['model'],_0x55188b[_0x7e26('0x4a')]);_0x59bfe9[_0x7e26('0x4e')]=_[_0x7e26('0x4d')](_0x55188b[_0x7e26('0x49')],qs[_0x7e26('0x4f')](_0x9743b4[_0x7e26('0x4a')][_0x7e26('0x4f')]));_0x59bfe9['attributes']=_0x59bfe9[_0x7e26('0x4e')][_0x7e26('0x6f')]?_0x59bfe9[_0x7e26('0x4e')]:_0x55188b['model'];if(_0x9743b4['query'][_0x7e26('0xc5')]){_0x59bfe9['include']=[{'all':!![]}];}_0x59bfe9=_[_0x7e26('0xad')]({},_0x59bfe9,_0x9743b4[_0x7e26('0xc6')]);return db[_0x7e26('0x44')][_0x7e26('0x70')](_0x59bfe9)['then'](handleEntityNotFound(_0x107078,null))[_0x7e26('0x30')](respondWithResult(_0x107078,null))[_0x7e26('0x3b')](handleError(_0x107078,null));};exports['create']=function(_0x2407d2,_0x204554){return db[_0x7e26('0x44')][_0x7e26('0xc7')](_0x2407d2[_0x7e26('0xc8')],{})[_0x7e26('0x30')](respondWithResult(_0x204554,0xc9))[_0x7e26('0x3b')](handleError(_0x204554,null));};exports[_0x7e26('0x2e')]=function(_0x511689,_0xe16aac){if(_0x511689[_0x7e26('0xc8')]['id']){delete _0x511689[_0x7e26('0xc8')]['id'];}return db[_0x7e26('0x44')][_0x7e26('0x70')]({'where':{'id':_0x511689[_0x7e26('0xc4')]['id']}})[_0x7e26('0x30')](handleEntityNotFound(_0xe16aac,null))[_0x7e26('0x30')](saveUpdates(_0x511689[_0x7e26('0xc8')],null))[_0x7e26('0x30')](respondWithResult(_0xe16aac,null))['catch'](handleError(_0xe16aac,null));};exports[_0x7e26('0x2f')]=function(_0x43b0e2,_0x134d76){return db[_0x7e26('0x44')][_0x7e26('0x70')]({'where':{'id':_0x43b0e2[_0x7e26('0xc4')]['id']}})[_0x7e26('0x30')](handleEntityNotFound(_0x134d76,null))[_0x7e26('0x30')](removeEntity(_0x134d76,null))[_0x7e26('0x3b')](handleError(_0x134d76,null));};exports['describe']=function(_0x572f43,_0x2b0301){return db[_0x7e26('0x44')][_0x7e26('0xc9')]()[_0x7e26('0x30')](respondWithResult(_0x2b0301,null))[_0x7e26('0x3b')](handleError(_0x2b0301,null));};exports[_0x7e26('0xca')]=function(_0x4aea29,_0x3d814c,_0x1b6384){return db['SmsMessage'][_0x7e26('0x70')]({'where':{'id':_0x4aea29[_0x7e26('0xc4')]['id']}})['then'](handleEntityNotFound(_0x3d814c,null))[_0x7e26('0x30')](function(_0x4315a0){if(_0x4315a0){return _0x4315a0[_0x7e26('0xca')](_0x4aea29[_0x7e26('0xc8')][_0x7e26('0xcb')],_[_0x7e26('0xcc')](_0x4aea29[_0x7e26('0xc8')],[_0x7e26('0xcb'),'id'])||{});}})['then'](respondWithResult(_0x3d814c,null))[_0x7e26('0x3b')](handleError(_0x3d814c,null));};exports[_0x7e26('0xcd')]=function(_0x37679d,_0x363548,_0xb7a44e){var _0x117505={'raw':![],'where':{}};var _0x43b010={};var _0xaa37c5={'count':0x0,'rows':[]};return db[_0x7e26('0x44')][_0x7e26('0xce')]({'where':{'id':_0x37679d[_0x7e26('0xc4')]['id']}})[_0x7e26('0x30')](handleEntityNotFound(_0x363548,null))['then'](function(_0x527a9c){if(_0x527a9c){_0x43b010[_0x7e26('0x49')]=_[_0x7e26('0x4b')](db['SmsMessage']['rawAttributes']);_0x43b010[_0x7e26('0x4a')]=_[_0x7e26('0x4b')](_0x37679d[_0x7e26('0x4a')]);_0x43b010[_0x7e26('0x4c')]=_[_0x7e26('0x4d')](_0x43b010[_0x7e26('0x49')],_0x43b010[_0x7e26('0x4a')]);_0x117505[_0x7e26('0x4e')]=_[_0x7e26('0x4d')](_0x43b010[_0x7e26('0x49')],qs['fields'](_0x37679d[_0x7e26('0x4a')]['fields']));_0x117505[_0x7e26('0x4e')]=_0x117505[_0x7e26('0x4e')]['length']?_0x117505[_0x7e26('0x4e')]:_0x43b010[_0x7e26('0x49')];if(!_0x37679d[_0x7e26('0x4a')][_0x7e26('0xcf')]('nolimit')){_0x117505[_0x7e26('0x27')]=qs['limit'](_0x37679d[_0x7e26('0x4a')][_0x7e26('0x27')]);_0x117505[_0x7e26('0x26')]=qs[_0x7e26('0x26')](_0x37679d[_0x7e26('0x4a')][_0x7e26('0x26')]);}_0x117505[_0x7e26('0x51')]=qs['sort'](_0x37679d[_0x7e26('0x4a')][_0x7e26('0x52')]);_0x117505[_0x7e26('0x53')]=qs[_0x7e26('0x4c')](_[_0x7e26('0x54')](_0x37679d['query'],_0x43b010[_0x7e26('0x4c')]));_0x117505[_0x7e26('0x53')][_0x7e26('0xc1')]=_0x527a9c['id'];if(_0x37679d['query'][_0x7e26('0x96')]){_0x117505[_0x7e26('0x53')]=_[_0x7e26('0xad')](_0x117505['where'],{'$or':_[_0x7e26('0x34')](_0x117505['attributes'],function(_0xb83a38){var _0x48c958={};_0x48c958[_0xb83a38]={'$like':'%'+_0x37679d[_0x7e26('0x4a')][_0x7e26('0x96')]+'%'};return _0x48c958;})});}if(_0x37679d[_0x7e26('0x4a')][_0x7e26('0x8b')]){var _0x300d94=_0x37679d[_0x7e26('0x4a')]['$gte'][_0x7e26('0x38')](',');var _0x3c41d1={};_0x3c41d1[_0x300d94[0x0]]={'$gte':moment(_0x300d94[0x1])['format'](_0x7e26('0xd0'))};_0x117505[_0x7e26('0x53')]=_[_0x7e26('0xad')](_0x117505[_0x7e26('0x53')],_0x3c41d1);}_0x117505=_[_0x7e26('0xad')]({},_0x117505,_0x37679d[_0x7e26('0xc6')]);return db['SmsMessage'][_0x7e26('0x29')]({'where':_0x117505[_0x7e26('0x53')]})[_0x7e26('0x30')](function(_0x1df184){_0xaa37c5[_0x7e26('0x29')]=_0x1df184;if(_0x37679d[_0x7e26('0x4a')][_0x7e26('0xc5')]){_0x117505[_0x7e26('0xd1')]=[{'all':!![]}];}return db['SmsMessage'][_0x7e26('0xd2')](_0x117505);})[_0x7e26('0x30')](function(_0x303ba8){_0xaa37c5['rows']=_0x303ba8;return _0xaa37c5;});}})[_0x7e26('0x30')](respondWithFilteredResult(_0x363548,_0x117505))[_0x7e26('0x3b')](handleError(_0x363548,null));};exports[_0x7e26('0xd3')]=function(_0x2210fe,_0x596ab7,_0x54b2d5){return db[_0x7e26('0x44')]['find']({'where':{'id':_0x2210fe[_0x7e26('0xc4')]['id']}})['then'](handleEntityNotFound(_0x596ab7,null))[_0x7e26('0x30')](function(_0x2c8f90){if(_0x2c8f90){return _0x2c8f90['setTags'](_0x2210fe[_0x7e26('0xc8')][_0x7e26('0xcb')],_['omit'](_0x2210fe[_0x7e26('0xc8')],[_0x7e26('0xcb'),'id'])||{})[_0x7e26('0xd4')](function(){return db[_0x7e26('0x7f')][_0x7e26('0xd2')]({'attributes':['id',_0x7e26('0x31'),_0x7e26('0x56')],'where':{'id':_0x2210fe['body'][_0x7e26('0xcb')]}});})['then'](function(_0x1519a5){socket['emit'](_0x7e26('0xd5'),{'id':Number(_0x2210fe['params']['id']),'tags':_0x1519a5||[]});return{'id':Number(_0x2210fe[_0x7e26('0xc4')]['id']),'tags':_0x1519a5||[]};});}})[_0x7e26('0x30')](respondWithResult(_0x596ab7,null))[_0x7e26('0x3b')](handleError(_0x596ab7,null));};exports[_0x7e26('0xd6')]=function(_0x4b1dba,_0x18ac2d,_0x4b586a){return db['SmsInteraction'][_0x7e26('0x70')]({'where':{'id':_0x4b1dba[_0x7e26('0xc4')]['id']}})['then'](handleEntityNotFound(_0x18ac2d,null))[_0x7e26('0x30')](function(_0x1c342a){if(_0x1c342a){return _0x1c342a[_0x7e26('0xd6')](_0x4b1dba[_0x7e26('0x4a')][_0x7e26('0xcb')]);}})['then'](respondWithStatusCode(_0x18ac2d,null))[_0x7e26('0x3b')](handleError(_0x18ac2d,null));};exports['download']=function(_0x574a5c,_0x33d8a3){var _0x473a37=moment()['unix']()['toString']();var _0x573f4c=path[_0x7e26('0xd7')](config['root'],_0x7e26('0xd8'),_0x7e26('0xd9'),_0x7e26('0xda'));var _0x4c128d=path[_0x7e26('0xd7')](config['root'],'server',_0x7e26('0xd9'),_0x7e26('0xdb'));var _0x357dd2=path[_0x7e26('0xd7')](_0x573f4c,_0x473a37);var _0x4a5d3c=util[_0x7e26('0xdc')](_0x7e26('0xdd'),_0x574a5c[_0x7e26('0xc4')]['id'],_0x473a37);var _0x5476b7=path[_0x7e26('0xd7')](_0x573f4c,_0x4a5d3c);var _0x4e4abd=[];_0x4e4abd[_0x7e26('0x3a')]({'model':db[_0x7e26('0x82')],'as':'User','attributes':['id',_0x7e26('0x35')],'raw':!![]});_0x4e4abd['push']({'model':db[_0x7e26('0xde')],'as':_0x7e26('0x76'),'attributes':['id','firstName',_0x7e26('0xdf')],'raw':!![]});var _0x455fff=[{'model':db[_0x7e26('0xe0')],'as':_0x7e26('0xe1'),'attributes':['id','body','createdAt',_0x7e26('0xe2'),'secret',_0x7e26('0x91')],'include':_0x4e4abd}];_0x455fff['push']({'model':db[_0x7e26('0xe3')],'as':_0x7e26('0xe4'),'attributes':['id',_0x7e26('0x31')]});_0x455fff[_0x7e26('0x3a')]({'model':db[_0x7e26('0x82')],'as':_0x7e26('0xe5'),'attributes':['id',_0x7e26('0x35')]});return db[_0x7e26('0x44')][_0x7e26('0x70')]({'where':{'id':_0x574a5c[_0x7e26('0xc4')]['id']},'include':_0x455fff})['then'](handleEntityNotFound(_0x33d8a3,null))[_0x7e26('0x30')](function(_0x3cb72f){if(_0x3cb72f){var _0x10c98c=_0x3cb72f[_0x7e26('0xe6')]({'plain':!![]});fs[_0x7e26('0xe7')](_0x357dd2);var _0x108608={'channel':_0x7e26('0xe8'),'account':_0x10c98c[_0x7e26('0xe4')][_0x7e26('0x31')],'agent':_0x10c98c['Owner']?_0x10c98c[_0x7e26('0xe5')]['fullname']:_0x7e26('0xe9'),'createdAt':moment(_0x10c98c['createdAt'])[_0x7e26('0xdc')](_0x7e26('0xd0'))[_0x7e26('0xab')](),'closedAt':_0x10c98c[_0x7e26('0x3f')]?moment(_0x10c98c[_0x7e26('0xea')])[_0x7e26('0xdc')](_0x7e26('0xd0'))[_0x7e26('0xab')]():'','disposition':_0x10c98c['disposition'],'messages':_(_0x10c98c['Messages'])[_0x7e26('0x96')]({'secret':![]})[_0x7e26('0x34')](function(_0x2cbd2f){return{'date':moment(_0x2cbd2f['createdAt'])[_0x7e26('0xdc')](_0x7e26('0xd0'))[_0x7e26('0xab')](),'sender':_0x2cbd2f[_0x7e26('0xe2')]===_0x7e26('0xeb')?_0x2cbd2f[_0x7e26('0x82')]?_0x2cbd2f[_0x7e26('0x82')][_0x7e26('0x35')]:_0x7e26('0xec'):_0x2cbd2f['Contact'][_0x7e26('0xed')]+(_0x2cbd2f[_0x7e26('0x76')][_0x7e26('0xdf')]?'\x20'+_0x2cbd2f[_0x7e26('0x76')][_0x7e26('0xdf')]:''),'body':_0x2cbd2f[_0x7e26('0xc8')],'direction':_0x2cbd2f[_0x7e26('0xe2')]===_0x7e26('0xeb')?'A':'C','secret':_0x2cbd2f[_0x7e26('0xee')],'read':_0x2cbd2f[_0x7e26('0x91')]};})['value']()};return ejs['renderFile'](path['join'](config['root'],_0x7e26('0xd8'),_0x7e26('0xef'),_0x7e26('0xf0')),{'interaction':_0x108608})['then'](function(_0x3a1f55){var _0x414854=path[_0x7e26('0xd7')](_0x357dd2,_0x7e26('0xf1')+_0x10c98c['id']+'-'+_0x473a37+_0x7e26('0xf2'));var _0x58c9c2={'path':_0x414854,'channel':'Sms','interactionId':_0x10c98c['id']};return pdf[_0x7e26('0xf3')](_0x3a1f55,_0x58c9c2);})[_0x7e26('0x30')](function(){return new BPromise(function(_0x4e8b03,_0x4b8647){zipdir(_0x357dd2,{'saveTo':_0x5476b7},function(_0x586697,_0x716b25){if(_0x586697)return _0x4b8647(_0x586697);return _0x4e8b03(_0x716b25);});})['then'](function(){return new BPromise(function(_0x49d5dd,_0x47db88){rimraf(_0x357dd2,function(_0x4869b9){if(_0x4869b9)_0x47db88(_0x4869b9);return _0x49d5dd();});});})[_0x7e26('0x30')](function(){return _0x33d8a3[_0x7e26('0xf4')](_0x5476b7,_0x4a5d3c,function(_0x151864){if(_0x151864){console[_0x7e26('0xf5')](_0x7e26('0xf6'),_0x151864);}else{fs[_0x7e26('0xf7')](_0x5476b7);}});});});}else{return _0x33d8a3[_0x7e26('0x23')](0xc8);}})['catch'](handleError(_0x33d8a3,null));}; \ No newline at end of file +var _0x6c38=['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','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','compact','SmsAccountId','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','contactName','isEmpty','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','show','params','intersection','includeAll','include','merge','options','create','update','body','describe','SmsMessage','ids','findOne','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','root','files','tmp','join','server','attachments','transcript-%d-%s.zip','User','CmContact','Contact','firstName','lastName','Messages','secret','Account','Owner','get','mkdirSync','closedAt','disposition','createdAt','out','System','direction','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','squel','crypto','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./smsInteraction.socket','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','then','destroy','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','UserId','closed','SmsInteraction','rawAttributes','fieldName','type','keys','query','filters','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x6c38,0x8f));var _0x86c3=function(_0x79a141,_0x404aab){_0x79a141=_0x79a141-0x0;var _0x238e40=_0x6c38[_0x79a141];return _0x238e40;};'use strict';var emlformat=require(_0x86c3('0x0'));var rimraf=require(_0x86c3('0x1'));var zipdir=require(_0x86c3('0x2'));var jsonpatch=require(_0x86c3('0x3'));var rp=require(_0x86c3('0x4'));var moment=require('moment');var BPromise=require(_0x86c3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x86c3('0x6'));var csv=require('to-csv');var ejs=require(_0x86c3('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x86c3('0x8'));var crypto=require(_0x86c3('0x9'));var jsforce=require(_0x86c3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x86c3('0xb'));var querystring=require(_0x86c3('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x86c3('0xd'));var as=require(_0x86c3('0xe'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x86c3('0xf'));var logger=require('../../config/logger')(_0x86c3('0x10'));var utils=require(_0x86c3('0x11'));var config=require(_0x86c3('0x12'));var licenseUtil=require(_0x86c3('0x13'));var db=require(_0x86c3('0x14'))['db'];config[_0x86c3('0x15')]=_['defaults'](config[_0x86c3('0x15')],{'host':_0x86c3('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x86c3('0x15')]));require(_0x86c3('0x17'))['register'](socket);function respondWithStatusCode(_0x2222b5,_0x510007){_0x510007=_0x510007||0xcc;return function(_0x18c3d7){if(_0x18c3d7){return _0x2222b5[_0x86c3('0x18')](_0x510007);}return _0x2222b5[_0x86c3('0x19')](_0x510007)[_0x86c3('0x1a')]();};}function respondWithResult(_0x340386,_0xa36c57){_0xa36c57=_0xa36c57||0xc8;return function(_0x2153dc){if(_0x2153dc){return _0x340386['status'](_0xa36c57)[_0x86c3('0x1b')](_0x2153dc);}};}function respondWithFilteredResult(_0x3a4cfd,_0x277c0e){return function(_0x1da025){if(_0x1da025){var _0x505453=typeof _0x277c0e[_0x86c3('0x1c')]==='undefined'&&typeof _0x277c0e['limit']===_0x86c3('0x1d');var _0x12329e=_0x1da025['count'];var _0x1ab2a3=_0x505453?0x0:_0x277c0e[_0x86c3('0x1c')];var _0x430b07=_0x505453?_0x1da025[_0x86c3('0x1e')]:_0x277c0e[_0x86c3('0x1c')]+_0x277c0e['limit'];var _0x206a24;if(_0x430b07>=_0x12329e){_0x430b07=_0x12329e;_0x206a24=0xc8;}else{_0x206a24=0xce;}_0x3a4cfd[_0x86c3('0x19')](_0x206a24);return _0x3a4cfd['set'](_0x86c3('0x1f'),_0x1ab2a3+'-'+_0x430b07+'/'+_0x12329e)[_0x86c3('0x1b')](_0x1da025);}return null;};}function patchUpdates(_0x56f06d){return function(_0x35f174){try{jsonpatch['apply'](_0x35f174,_0x56f06d,!![]);}catch(_0x4a1040){return BPromise[_0x86c3('0x20')](_0x4a1040);}return _0x35f174[_0x86c3('0x21')]();};}function saveUpdates(_0x3d55b0,_0x5fa481){return function(_0x109e94){if(_0x109e94){return _0x109e94['update'](_0x3d55b0)[_0x86c3('0x22')](function(_0x2b6ba0){return _0x2b6ba0;});}return null;};}function removeEntity(_0x55daf1,_0x369de0){return function(_0x2291d2){if(_0x2291d2){return _0x2291d2[_0x86c3('0x23')]()[_0x86c3('0x22')](function(){_0x55daf1[_0x86c3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2716b2,_0x2c5802){return function(_0x1dcc42){if(!_0x1dcc42){_0x2716b2[_0x86c3('0x18')](0x194);}return _0x1dcc42;};}function handleError(_0x2a8809,_0x243301){_0x243301=_0x243301||0x1f4;return function(_0x39f510){logger['error'](_0x39f510[_0x86c3('0x24')]);if(_0x39f510[_0x86c3('0x25')]){delete _0x39f510[_0x86c3('0x25')];}_0x2a8809[_0x86c3('0x19')](_0x243301)[_0x86c3('0x26')](_0x39f510);};}function getInteractionUsers(_0x30e572,_0x28f6f2){return new BPromise(function(_0x474a0f,_0x1ad2d6){try{if(_0x28f6f2[_0x30e572['id']]){_0x30e572[_0x86c3('0x27')]=_[_0x86c3('0x28')](_0x28f6f2[_0x30e572['id']],function(_0x358505){return{'id':_0x358505['id'],'fullname':_0x358505[_0x86c3('0x29')]};});}}catch(_0x1e2f77){_0x1ad2d6(_0x1e2f77);}_0x474a0f(_0x30e572);});}function getInteractionTags(_0x11b11c,_0x34823a){return new BPromise(function(_0x4a5962,_0x185945){try{if(_0x11b11c[_0x86c3('0x2a')]){_0x11b11c[_0x86c3('0x2b')]=[];_0x11b11c[_0x86c3('0x2a')][_0x86c3('0x2c')](',')[_0x86c3('0x2d')](function(_0x37642b){_0x11b11c[_0x86c3('0x2b')][_0x86c3('0x2e')](_0x34823a[_0x37642b]);});}delete _0x11b11c[_0x86c3('0x2a')];}catch(_0xf447c2){_0x185945(_0xf447c2);}_0x4a5962(_0x11b11c);});}function updateSmsInteraction(_0x5bc6e3,_0x29e697,_0xea6ce8){return new BPromise(function(_0x55e7f2,_0x825b26){return getInteractionUsers(_0x5bc6e3,_0xea6ce8)[_0x86c3('0x22')](function(_0x2a8d9e){return getInteractionTags(_0x2a8d9e,_0x29e697);})[_0x86c3('0x22')](function(_0x474639){return getStateInteraction(_0x474639);})[_0x86c3('0x22')](function(_0x4823dd){_0x55e7f2(_0x4823dd);})[_0x86c3('0x2f')](function(_0x2fa0dc){_0x825b26(_0x2fa0dc);});});}function getStateInteraction(_0x548502){return new BPromise(function(_0x56e06e){_0x548502[_0x86c3('0x30')]=0x0;_0x548502[_0x86c3('0x31')]=0x0;_0x548502[_0x86c3('0x32')]=0x0;_0x548502[_0x86c3('0x33')]=0x0;_0x548502[_0x86c3('0x34')]=0x0;if(!_0x548502['closed']&&!_0x548502[_0x86c3('0x35')]){_0x548502[_0x86c3('0x30')]+=0x1;}if(!_0x548502['closed']&&_0x548502['UserId']){_0x548502['talking']+=0x1;if(_0x548502[_0x86c3('0x30')]){_0x548502[_0x86c3('0x30')]-=0x1;}}if(_0x548502[_0x86c3('0x36')]&&_0x548502[_0x86c3('0x35')]){_0x548502[_0x86c3('0x32')]+=0x1;if(_0x548502[_0x86c3('0x31')]){_0x548502[_0x86c3('0x31')]-=0x1;}}if(_0x548502[_0x86c3('0x36')]&&!_0x548502['UserId']){_0x548502[_0x86c3('0x33')]+=0x1;if(_0x548502[_0x86c3('0x30')]){_0x548502['waiting']-=0x1;}}_0x548502[_0x86c3('0x34')]+=0x1;_0x56e06e(_0x548502);});}exports['index']=function(_0x4d6655,_0x493006){var _0x3fbe22={},_0x346c08={},_0x19ae93={'count':0x0,'rows':[]};var _0xe7e04e=_['map'](db[_0x86c3('0x37')][_0x86c3('0x38')],function(_0x304f68){return{'name':_0x304f68[_0x86c3('0x39')],'type':_0x304f68[_0x86c3('0x3a')]['key']};});_0x346c08['model']=_['map'](_0xe7e04e,_0x86c3('0x25'));_0x346c08['query']=_[_0x86c3('0x3b')](_0x4d6655[_0x86c3('0x3c')]);_0x346c08[_0x86c3('0x3d')]=_['intersection'](_0x346c08[_0x86c3('0x3e')],_0x346c08[_0x86c3('0x3c')]);_0x3fbe22[_0x86c3('0x3f')]=_['intersection'](_0x346c08[_0x86c3('0x3e')],qs[_0x86c3('0x40')](_0x4d6655['query'][_0x86c3('0x40')]));_0x3fbe22[_0x86c3('0x3f')]=_0x3fbe22[_0x86c3('0x3f')][_0x86c3('0x41')]?_0x3fbe22[_0x86c3('0x3f')]:_0x346c08[_0x86c3('0x3e')];if(!_0x4d6655[_0x86c3('0x3c')][_0x86c3('0x42')]('nolimit')){_0x3fbe22[_0x86c3('0x43')]=qs[_0x86c3('0x43')](_0x4d6655['query'][_0x86c3('0x43')]);_0x3fbe22[_0x86c3('0x1c')]=qs[_0x86c3('0x1c')](_0x4d6655[_0x86c3('0x3c')][_0x86c3('0x1c')]);}_0x3fbe22[_0x86c3('0x44')]=qs[_0x86c3('0x45')](_0x4d6655[_0x86c3('0x3c')][_0x86c3('0x45')]);_0x3fbe22[_0x86c3('0x46')]=qs['filters'](_[_0x86c3('0x47')](_0x4d6655['query'],_0x346c08[_0x86c3('0x3d')]),_0xe7e04e);var _0x225d94=[];var _0x190a15=squel[_0x86c3('0x48')]()[_0x86c3('0x49')]('id')[_0x86c3('0x49')](_0x86c3('0x25'))[_0x86c3('0x49')](_0x86c3('0x4a'))[_0x86c3('0x4b')](_0x86c3('0x4c'));var _0x3eb62d=squel['select']()['field'](_0x86c3('0x4d'))[_0x86c3('0x49')](_0x86c3('0x4e'))[_0x86c3('0x49')](_0x86c3('0x4f'))[_0x86c3('0x4b')](_0x86c3('0x50'),'ui')[_0x86c3('0x51')](_0x86c3('0x52'),'u',_0x86c3('0x53'));var _0x3ef6bb=squel[_0x86c3('0x48')]()[_0x86c3('0x4b')](_0x86c3('0x54'),'i')[_0x86c3('0x51')]('cm_contacts','c',_0x86c3('0x55'))[_0x86c3('0x51')]('users','o',_0x86c3('0x56'))['left_join'](_0x86c3('0x57'),'a',_0x86c3('0x58'))[_0x86c3('0x51')](_0x86c3('0x59'),'me',_0x86c3('0x5a'))[_0x86c3('0x51')](_0x86c3('0x5b'),'it',_0x86c3('0x5c'))[_0x86c3('0x51')](_0x86c3('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x2b9aff=squel['expr']();var _0x90f1a2=[];var _0xc1eb4d=squel[_0x86c3('0x5d')]();var _0x294615;if(_0x4d6655[_0x86c3('0x3c')]['search']){_0x294615=as['parseSearch'](_0x4d6655['query'][_0x86c3('0x5e')]);var _0x32c0f5=_0x294615['sqlOperator'];for(var _0x1d3105=0x0;_0x1d3105<_0x294615['conditions'][_0x86c3('0x41')];_0x1d3105++){var _0x406100=_0x294615[_0x86c3('0x5f')][_0x1d3105];var _0x37edda='i';var _0x212a11=_['find'](_0xe7e04e,['name',_0x406100['field']]);if(!_0x212a11){switch(_0x406100[_0x86c3('0x49')]){case _0x86c3('0x60'):if(_0x406100['value']==0x1){_0x3ef6bb[_0x86c3('0x61')]('`'+_0x406100[_0x86c3('0x49')]+_0x86c3('0x62'));}else{_0x3ef6bb[_0x86c3('0x61')]('`'+_0x406100[_0x86c3('0x49')]+_0x86c3('0x63'));}break;case'Contact':if(_0x406100[_0x86c3('0x64')]==='$substring'){if(_0x406100[_0x86c3('0x65')][_0x86c3('0x2c')]('\x20')[_0x86c3('0x41')]>0x1){_0x2b9aff[_0x32c0f5](_0x86c3('0x66'),qs[_0x86c3('0x67')](_0x406100[_0x86c3('0x65')]),null);}else{var _0x276b45='%'+_0x406100[_0x86c3('0x65')]+'%';_0x2b9aff[_0x32c0f5](_0x86c3('0x68'),_0x276b45,_0x276b45,_0x276b45);}}else{_0x212a11=_[_0x86c3('0x69')](_0xe7e04e,['name',_0x86c3('0x6a')]);_0x406100['field']=_0x86c3('0x6a');_0x43f507=as[_0x86c3('0x6b')](_0x37edda,_0x212a11[_0x86c3('0x3a')],_0x406100);_0x2b9aff[_0x32c0f5](_0x43f507[_0x86c3('0x6c')],_0x43f507[_0x86c3('0x65')]['start'],_0x43f507[_0x86c3('0x65')][_0x86c3('0x1a')]);}break;case _0x86c3('0x6d'):var _0x10937d=_0x406100[_0x86c3('0x65')][_0x86c3('0x2c')](',')['map'](function(_0x24ad1a){return Number(_0x24ad1a);});_0x10937d['forEach'](function(_0x1270c2){_0xc1eb4d['or'](_0x86c3('0x6e'),'%,'+_0x1270c2+',%');});_0x90f1a2=_[_0x86c3('0x6f')](_0x90f1a2,_0x10937d);break;case'User':if(_0x406100[_0x86c3('0x64')]==='$substring'){_0x2b9aff[_0x32c0f5](_0x86c3('0x70'),'%'+_0x406100[_0x86c3('0x65')]+'%',null);}else{_0x212a11=_[_0x86c3('0x69')](_0xe7e04e,[_0x86c3('0x25'),_0x86c3('0x35')]);_0x406100[_0x86c3('0x49')]=_0x86c3('0x35');_0x43f507=as[_0x86c3('0x6b')](_0x37edda,_0x212a11[_0x86c3('0x3a')],_0x406100);_0x2b9aff[_0x32c0f5](_0x43f507[_0x86c3('0x6c')],_0x43f507[_0x86c3('0x65')]['start'],_0x43f507[_0x86c3('0x65')][_0x86c3('0x1a')]);}break;case'body':_0x43f507=as[_0x86c3('0x6b')]('me',null,_0x406100);_0x2b9aff[_0x32c0f5](_0x43f507[_0x86c3('0x6c')],_0x43f507[_0x86c3('0x65')][_0x86c3('0x71')],_0x43f507[_0x86c3('0x65')][_0x86c3('0x1a')]);break;}}else{var _0x43f507=as[_0x86c3('0x6b')](_0x37edda,_0x212a11[_0x86c3('0x3a')],_0x406100);_0x2b9aff[_0x32c0f5](_0x43f507['text'],_0x43f507[_0x86c3('0x65')]['start'],_0x43f507[_0x86c3('0x65')]['end']);}}}else{var _0x2b96b6=_(_0x4d6655[_0x86c3('0x3c')])[_0x86c3('0x3b')]()['map'](function(_0x112962){return _[_0x86c3('0x72')](_0xe7e04e,[_0x86c3('0x25'),_0x112962])?_0x112962:undefined;})[_0x86c3('0x73')]()['value']();if(!_['isEmpty'](_0x2b96b6)){_0x2b96b6['forEach'](function(_0x1a4d65){if(_0x1a4d65===_0x86c3('0x74')){_0x3ef6bb[_0x86c3('0x46')]('i.SmsAccountId\x20IN\x20?',[][_0x86c3('0x75')](_0x4d6655[_0x86c3('0x3c')][_0x1a4d65]));}else if(_0x1a4d65==='createdAt'){var _0x41a392=JSON[_0x86c3('0x76')](_0x4d6655[_0x86c3('0x3c')][_0x1a4d65])['$gte'];var _0x45ee66=JSON['parse'](_0x4d6655[_0x86c3('0x3c')][_0x1a4d65])[_0x86c3('0x77')];_0x3ef6bb['where'](_0x86c3('0x78'),_0x41a392,_0x45ee66);}else{if(_0x4d6655[_0x86c3('0x3c')][_0x1a4d65]===_0x86c3('0x79')){_0x3ef6bb[_0x86c3('0x46')]('i.'+_0x1a4d65+_0x86c3('0x7a'));}else{_0x3ef6bb[_0x86c3('0x46')]('i.'+_0x1a4d65+_0x86c3('0x7b'),_0x4d6655[_0x86c3('0x3c')][_0x1a4d65]);}}});}if(_0x4d6655['query'][_0x86c3('0x7c')]){if(_0x4d6655[_0x86c3('0x3c')][_0x86c3('0x7c')]==0x1){_0x3ef6bb[_0x86c3('0x61')](_0x86c3('0x7d'));}else{_0x3ef6bb[_0x86c3('0x61')]('`unreadMessages`\x20>\x200');}}if(_0x4d6655[_0x86c3('0x3c')][_0x86c3('0x7e')]){_0x90f1a2=_[_0x86c3('0x7f')](_0x4d6655['query'][_0x86c3('0x7e')])?_0x4d6655[_0x86c3('0x3c')]['tag']:new Array(_0x4d6655[_0x86c3('0x3c')][_0x86c3('0x7e')]);_0x90f1a2[_0x86c3('0x2d')](function(_0x5759f3){_0xc1eb4d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5759f3+',%');});}if(_0x4d6655[_0x86c3('0x3c')][_0x86c3('0x80')]){var _0x1cc593=_0x4d6655[_0x86c3('0x3c')][_0x86c3('0x80')][_0x86c3('0x81')]('\x5c','\x5c\x5c')[_0x86c3('0x81')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1cc593)){_0x2b9aff['or'](_0x86c3('0x82'),_0x1cc593+'%')['or']('i.phone\x20LIKE\x20?',_0x1cc593+'%');}else{_0x2b9aff['or'](_0x86c3('0x83'),qs[_0x86c3('0x67')](_0x1cc593))['or'](_0x86c3('0x84'),_0x1cc593+'%');}}}_0x3ef6bb[_0x86c3('0x46')](_0x2b9aff);_0x3ef6bb[_0x86c3('0x85')](_0x86c3('0x86'));var _0x2181c1={'type':db[_0x86c3('0x87')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4d02d8=_0x3ef6bb[_0x86c3('0x88')]();_0x4d02d8['field'](_0x86c3('0x86'));_0x4d02d8[_0x86c3('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3fbe22[_0x86c3('0x44')]){_0x3fbe22[_0x86c3('0x44')][_0x86c3('0x2d')](function(_0xe38121){var _0x29d198=_0xe38121[0x0]===_0x86c3('0x89')?_0xe38121[0x0]:'i.'+_0xe38121[0x0];_0x3ef6bb['order'](_0x29d198,_0xe38121[0x1]==='DESC'?![]:!![]);});}if(!_[_0x86c3('0x8a')](_0x90f1a2)){_0x3ef6bb[_0x86c3('0x61')](_0xc1eb4d);_0x4d02d8[_0x86c3('0x46')]('t.id\x20IN\x20?',_0x90f1a2);}BPromise[_0x86c3('0x8b')]()['then'](function(){if(!_0x294615){if(_0x4d6655[_0x86c3('0x3c')][_0x86c3('0x74')])return;_0x4d02d8[_0x86c3('0x46')](_0x86c3('0x8c'));_0x3ef6bb[_0x86c3('0x46')](_0x86c3('0x8c'));return;}if(_0x4d6655[_0x86c3('0x8d')][_0x86c3('0x8e')]!==_0x86c3('0x8f'))return;return _0x4d6655[_0x86c3('0x8d')][_0x86c3('0x90')]({'attributes':['id'],'raw':!![]})[_0x86c3('0x22')](function(_0x2283da){if(_[_0x86c3('0x8a')](_0x2283da)){_0x4d02d8['where'](_0x86c3('0x91'));_0x3ef6bb[_0x86c3('0x46')](_0x86c3('0x91'));}else{_0x4d02d8[_0x86c3('0x46')]('i.SmsAccountId\x20IN\x20?',_[_0x86c3('0x28')](_0x2283da,'id'));_0x3ef6bb[_0x86c3('0x46')](_0x86c3('0x92'),_[_0x86c3('0x28')](_0x2283da,'id'));}});})[_0x86c3('0x22')](function(){if(_0x4d6655[_0x86c3('0x8d')][_0x86c3('0x8e')]===_0x86c3('0x8f')&&!_0x294615&&!_0x4d6655[_0x86c3('0x3c')][_0x86c3('0x74')])return[];return db[_0x86c3('0x93')][_0x86c3('0x3c')](_0x4d02d8[_0x86c3('0x94')](),_0x2181c1);})['then'](function(_0x12392f){_0x19ae93[_0x86c3('0x1e')]=_0x12392f[_0x86c3('0x41')];if(_0x19ae93[_0x86c3('0x1e')]===0x0)return[];return db[_0x86c3('0x93')][_0x86c3('0x3c')](_0x190a15['toString'](),_0x2181c1)['then'](function(_0x15b78a){_0x225d94=_['keyBy'](_0x15b78a,'id');_0x2181c1=_['merge'](_0x2181c1,{'model':db[_0x86c3('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4d6655['query']['fields']){_0x3fbe22[_0x86c3('0x3f')][_0x86c3('0x2d')](function(_0x48efd9){_0x3ef6bb['field']('i.'+_0x48efd9);});}else{_0x3ef6bb[_0x86c3('0x49')](_0x86c3('0x95'),'unreadMessages');_0x3ef6bb[_0x86c3('0x49')](_0x86c3('0x96'),_0x86c3('0x97'));_0x3ef6bb[_0x86c3('0x49')]('a.mandatoryDisposition',_0x86c3('0x98'));_0x3ef6bb[_0x86c3('0x49')](_0x86c3('0x99'),_0x86c3('0x89'));_0x3ef6bb[_0x86c3('0x49')]('i.*');_0x3ef6bb[_0x86c3('0x49')](_0x86c3('0x9a'),'Contact.firstName');_0x3ef6bb[_0x86c3('0x49')](_0x86c3('0x9b'),_0x86c3('0x9c'));_0x3ef6bb['field'](_0x86c3('0x9d'),'Contact.email');_0x3ef6bb[_0x86c3('0x49')](_0x86c3('0x9e'),_0x86c3('0x9f'));_0x3ef6bb[_0x86c3('0x49')](_0x86c3('0xa0'),_0x86c3('0xa1'));_0x3ef6bb['field']('c.fax',_0x86c3('0xa2'));_0x3ef6bb['field'](_0x86c3('0xa3'),_0x86c3('0xa4'));_0x3ef6bb['field'](_0x86c3('0xa5'),'Owner.internal');_0x3ef6bb[_0x86c3('0x49')](_0x86c3('0xa6'),_0x86c3('0x2a'));}if(_0x3fbe22['limit'])_0x3ef6bb['limit'](_0x3fbe22[_0x86c3('0x43')]);if(_0x3fbe22[_0x86c3('0x1c')])_0x3ef6bb[_0x86c3('0x1c')](_0x3fbe22['offset']);return db[_0x86c3('0x93')]['query'](_0x3ef6bb[_0x86c3('0x94')](),_0x2181c1);})[_0x86c3('0x22')](function(_0x5c1963){if(_0x5c1963[_0x86c3('0x41')]>0x0)_0x3eb62d[_0x86c3('0x46')](_0x86c3('0xa7'),_['map'](_0x5c1963,'id'));return db[_0x86c3('0x93')]['query'](_0x3eb62d[_0x86c3('0x94')](),_0x2181c1)['then'](function(_0x5d55fa){var _0x1301b7=_[_0x86c3('0xa8')](_0x5d55fa,'SmsInteractionId');var _0x40cb06=[];_0x5c1963[_0x86c3('0x2d')](function(_0x182852){_0x40cb06['push'](updateSmsInteraction(_0x182852,_0x225d94,_0x1301b7));});return BPromise[_0x86c3('0xa9')](_0x40cb06);});});})[_0x86c3('0x22')](function(_0x49f33c){_0x19ae93[_0x86c3('0xaa')]=_0x49f33c;return _0x19ae93;})[_0x86c3('0x22')](respondWithFilteredResult(_0x493006,_0x3fbe22))['catch'](handleError(_0x493006,null));};exports[_0x86c3('0xab')]=function(_0x3ce038,_0x1b7d6c){var _0x4d6c36={'raw':![],'where':{'id':_0x3ce038[_0x86c3('0xac')]['id']}},_0x31bc77={};_0x31bc77['model']=_['keys'](db['SmsInteraction'][_0x86c3('0x38')]);_0x31bc77['query']=_['keys'](_0x3ce038[_0x86c3('0x3c')]);_0x31bc77[_0x86c3('0x3d')]=_[_0x86c3('0xad')](_0x31bc77[_0x86c3('0x3e')],_0x31bc77['query']);_0x4d6c36[_0x86c3('0x3f')]=_['intersection'](_0x31bc77[_0x86c3('0x3e')],qs[_0x86c3('0x40')](_0x3ce038[_0x86c3('0x3c')][_0x86c3('0x40')]));_0x4d6c36['attributes']=_0x4d6c36['attributes']['length']?_0x4d6c36[_0x86c3('0x3f')]:_0x31bc77['model'];if(_0x3ce038['query'][_0x86c3('0xae')]){_0x4d6c36[_0x86c3('0xaf')]=[{'all':!![]}];}_0x4d6c36=_[_0x86c3('0xb0')]({},_0x4d6c36,_0x3ce038[_0x86c3('0xb1')]);return db[_0x86c3('0x37')]['find'](_0x4d6c36)['then'](handleEntityNotFound(_0x1b7d6c,null))[_0x86c3('0x22')](respondWithResult(_0x1b7d6c,null))[_0x86c3('0x2f')](handleError(_0x1b7d6c,null));};exports[_0x86c3('0xb2')]=function(_0x167b01,_0x34108a){return db[_0x86c3('0x37')]['create'](_0x167b01['body'],{})[_0x86c3('0x22')](respondWithResult(_0x34108a,0xc9))[_0x86c3('0x2f')](handleError(_0x34108a,null));};exports[_0x86c3('0xb3')]=function(_0x118c6c,_0x63366c){if(_0x118c6c[_0x86c3('0xb4')]['id']){delete _0x118c6c['body']['id'];}return db['SmsInteraction'][_0x86c3('0x69')]({'where':{'id':_0x118c6c[_0x86c3('0xac')]['id']}})[_0x86c3('0x22')](handleEntityNotFound(_0x63366c,null))[_0x86c3('0x22')](saveUpdates(_0x118c6c[_0x86c3('0xb4')],null))[_0x86c3('0x22')](respondWithResult(_0x63366c,null))['catch'](handleError(_0x63366c,null));};exports[_0x86c3('0x23')]=function(_0xa2b82f,_0x2a1a9b){return db[_0x86c3('0x37')]['find']({'where':{'id':_0xa2b82f[_0x86c3('0xac')]['id']}})['then'](handleEntityNotFound(_0x2a1a9b,null))[_0x86c3('0x22')](removeEntity(_0x2a1a9b,null))[_0x86c3('0x2f')](handleError(_0x2a1a9b,null));};exports['describe']=function(_0x134be5,_0x29a0be){return db[_0x86c3('0x37')][_0x86c3('0xb5')]()['then'](respondWithResult(_0x29a0be,null))['catch'](handleError(_0x29a0be,null));};exports['addMessage']=function(_0x1e1ee9,_0x3f73a3,_0x2ded4f){return db[_0x86c3('0xb6')][_0x86c3('0x69')]({'where':{'id':_0x1e1ee9['params']['id']}})['then'](handleEntityNotFound(_0x3f73a3,null))['then'](function(_0x32790b){if(_0x32790b){return _0x32790b['addMessage'](_0x1e1ee9[_0x86c3('0xb4')][_0x86c3('0xb7')],_['omit'](_0x1e1ee9[_0x86c3('0xb4')],[_0x86c3('0xb7'),'id'])||{});}})['then'](respondWithResult(_0x3f73a3,null))['catch'](handleError(_0x3f73a3,null));};exports['getMessages']=function(_0x5c074a,_0x53aac2,_0x10f414){var _0x228011={'raw':![],'where':{}};var _0x3cf18c={};var _0x5ba821={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x86c3('0xb8')]({'where':{'id':_0x5c074a['params']['id']}})['then'](handleEntityNotFound(_0x53aac2,null))[_0x86c3('0x22')](function(_0x4eaef2){if(_0x4eaef2){_0x3cf18c[_0x86c3('0x3e')]=_[_0x86c3('0x3b')](db[_0x86c3('0xb6')][_0x86c3('0x38')]);_0x3cf18c[_0x86c3('0x3c')]=_['keys'](_0x5c074a[_0x86c3('0x3c')]);_0x3cf18c[_0x86c3('0x3d')]=_[_0x86c3('0xad')](_0x3cf18c['model'],_0x3cf18c[_0x86c3('0x3c')]);_0x228011[_0x86c3('0x3f')]=_[_0x86c3('0xad')](_0x3cf18c['model'],qs[_0x86c3('0x40')](_0x5c074a['query'][_0x86c3('0x40')]));_0x228011[_0x86c3('0x3f')]=_0x228011[_0x86c3('0x3f')][_0x86c3('0x41')]?_0x228011['attributes']:_0x3cf18c[_0x86c3('0x3e')];if(!_0x5c074a['query'][_0x86c3('0x42')](_0x86c3('0xb9'))){_0x228011['limit']=qs[_0x86c3('0x43')](_0x5c074a[_0x86c3('0x3c')]['limit']);_0x228011[_0x86c3('0x1c')]=qs[_0x86c3('0x1c')](_0x5c074a[_0x86c3('0x3c')][_0x86c3('0x1c')]);}_0x228011[_0x86c3('0x44')]=qs['sort'](_0x5c074a[_0x86c3('0x3c')]['sort']);_0x228011[_0x86c3('0x46')]=qs[_0x86c3('0x3d')](_['pick'](_0x5c074a[_0x86c3('0x3c')],_0x3cf18c[_0x86c3('0x3d')]));_0x228011[_0x86c3('0x46')]['SmsInteractionId']=_0x4eaef2['id'];if(_0x5c074a[_0x86c3('0x3c')][_0x86c3('0x80')]){_0x228011[_0x86c3('0x46')]=_[_0x86c3('0xb0')](_0x228011['where'],{'$or':_[_0x86c3('0x28')](_0x228011[_0x86c3('0x3f')],function(_0xb997ed){var _0x36484c={};_0x36484c[_0xb997ed]={'$like':'%'+_0x5c074a[_0x86c3('0x3c')][_0x86c3('0x80')]+'%'};return _0x36484c;})});}if(_0x5c074a[_0x86c3('0x3c')][_0x86c3('0xba')]){var _0x14c6af=_0x5c074a[_0x86c3('0x3c')][_0x86c3('0xba')]['split'](',');var _0x36367c={};_0x36367c[_0x14c6af[0x0]]={'$gte':moment(_0x14c6af[0x1])[_0x86c3('0xbb')](_0x86c3('0xbc'))};_0x228011[_0x86c3('0x46')]=_[_0x86c3('0xb0')](_0x228011['where'],_0x36367c);}_0x228011=_['merge']({},_0x228011,_0x5c074a[_0x86c3('0xb1')]);return db[_0x86c3('0xb6')]['count']({'where':_0x228011[_0x86c3('0x46')]})[_0x86c3('0x22')](function(_0x5e3a38){_0x5ba821[_0x86c3('0x1e')]=_0x5e3a38;if(_0x5c074a[_0x86c3('0x3c')][_0x86c3('0xae')]){_0x228011[_0x86c3('0xaf')]=[{'all':!![]}];}return db[_0x86c3('0xb6')][_0x86c3('0xbd')](_0x228011);})[_0x86c3('0x22')](function(_0x13302b){_0x5ba821['rows']=_0x13302b;return _0x5ba821;});}})[_0x86c3('0x22')](respondWithFilteredResult(_0x53aac2,_0x228011))[_0x86c3('0x2f')](handleError(_0x53aac2,null));};exports[_0x86c3('0xbe')]=function(_0x4cd76c,_0x11326f,_0x5f2c96){return db['SmsInteraction'][_0x86c3('0x69')]({'where':{'id':_0x4cd76c[_0x86c3('0xac')]['id']}})[_0x86c3('0x22')](handleEntityNotFound(_0x11326f,null))[_0x86c3('0x22')](function(_0x220d9b){if(_0x220d9b){return _0x220d9b['setTags'](_0x4cd76c[_0x86c3('0xb4')]['ids'],_['omit'](_0x4cd76c[_0x86c3('0xb4')],['ids','id'])||{})[_0x86c3('0xbf')](function(){return db[_0x86c3('0x6d')][_0x86c3('0xbd')]({'attributes':['id',_0x86c3('0x25'),'color'],'where':{'id':_0x4cd76c[_0x86c3('0xb4')]['ids']}});})['then'](function(_0x5892ef){socket[_0x86c3('0xc0')](_0x86c3('0xc1'),{'id':Number(_0x4cd76c[_0x86c3('0xac')]['id']),'tags':_0x5892ef||[]});return{'id':Number(_0x4cd76c[_0x86c3('0xac')]['id']),'tags':_0x5892ef||[]};});}})[_0x86c3('0x22')](respondWithResult(_0x11326f,null))[_0x86c3('0x2f')](handleError(_0x11326f,null));};exports[_0x86c3('0xc2')]=function(_0x59f3d4,_0x5c9efd,_0x495402){return db[_0x86c3('0x37')]['find']({'where':{'id':_0x59f3d4[_0x86c3('0xac')]['id']}})['then'](handleEntityNotFound(_0x5c9efd,null))[_0x86c3('0x22')](function(_0x366e88){if(_0x366e88){return _0x366e88[_0x86c3('0xc2')](_0x59f3d4[_0x86c3('0x3c')][_0x86c3('0xb7')]);}})['then'](respondWithStatusCode(_0x5c9efd,null))['catch'](handleError(_0x5c9efd,null));};exports[_0x86c3('0xc3')]=function(_0x3477af,_0x56cde6){var _0x106b7d=moment()[_0x86c3('0xc4')]()[_0x86c3('0x94')]();var _0x4ae726=path['join'](config[_0x86c3('0xc5')],'server',_0x86c3('0xc6'),_0x86c3('0xc7'));var _0x61d337=path[_0x86c3('0xc8')](config[_0x86c3('0xc5')],_0x86c3('0xc9'),_0x86c3('0xc6'),_0x86c3('0xca'));var _0x39ffd2=path[_0x86c3('0xc8')](_0x4ae726,_0x106b7d);var _0x4814f3=util[_0x86c3('0xbb')](_0x86c3('0xcb'),_0x3477af[_0x86c3('0xac')]['id'],_0x106b7d);var _0x4797e0=path['join'](_0x4ae726,_0x4814f3);var _0x2d23dc=[];_0x2d23dc['push']({'model':db['User'],'as':_0x86c3('0xcc'),'attributes':['id',_0x86c3('0x29')],'raw':!![]});_0x2d23dc['push']({'model':db[_0x86c3('0xcd')],'as':_0x86c3('0xce'),'attributes':['id',_0x86c3('0xcf'),_0x86c3('0xd0')],'raw':!![]});var _0x211668=[{'model':db[_0x86c3('0xb6')],'as':_0x86c3('0xd1'),'attributes':['id','body','createdAt','direction',_0x86c3('0xd2'),'read'],'include':_0x2d23dc}];_0x211668['push']({'model':db['SmsAccount'],'as':_0x86c3('0xd3'),'attributes':['id',_0x86c3('0x25')]});_0x211668[_0x86c3('0x2e')]({'model':db['User'],'as':_0x86c3('0xd4'),'attributes':['id',_0x86c3('0x29')]});return db['SmsInteraction']['find']({'where':{'id':_0x3477af[_0x86c3('0xac')]['id']},'include':_0x211668})[_0x86c3('0x22')](handleEntityNotFound(_0x56cde6,null))[_0x86c3('0x22')](function(_0x4902b7){if(_0x4902b7){var _0x3aad46=_0x4902b7[_0x86c3('0xd5')]({'plain':!![]});fs[_0x86c3('0xd6')](_0x39ffd2);var _0x5e989a={'channel':'Sms','account':_0x3aad46['Account'][_0x86c3('0x25')],'agent':_0x3aad46[_0x86c3('0xd4')]?_0x3aad46['Owner'][_0x86c3('0x29')]:'N.A.','createdAt':moment(_0x3aad46['createdAt'])[_0x86c3('0xbb')](_0x86c3('0xbc'))[_0x86c3('0x94')](),'closedAt':_0x3aad46['closed']?moment(_0x3aad46[_0x86c3('0xd7')])['format'](_0x86c3('0xbc'))[_0x86c3('0x94')]():'','disposition':_0x3aad46[_0x86c3('0xd8')],'messages':_(_0x3aad46['Messages'])['filter']({'secret':![]})[_0x86c3('0x28')](function(_0x1deee6){return{'date':moment(_0x1deee6[_0x86c3('0xd9')])[_0x86c3('0xbb')](_0x86c3('0xbc'))[_0x86c3('0x94')](),'sender':_0x1deee6['direction']===_0x86c3('0xda')?_0x1deee6[_0x86c3('0xcc')]?_0x1deee6[_0x86c3('0xcc')][_0x86c3('0x29')]:_0x86c3('0xdb'):_0x1deee6[_0x86c3('0xce')]['firstName']+(_0x1deee6['Contact']['lastName']?'\x20'+_0x1deee6[_0x86c3('0xce')][_0x86c3('0xd0')]:''),'body':_0x1deee6[_0x86c3('0xb4')],'direction':_0x1deee6[_0x86c3('0xdc')]===_0x86c3('0xda')?'A':'C','secret':_0x1deee6[_0x86c3('0xd2')],'read':_0x1deee6['read']};})['value']()};return ejs[_0x86c3('0xdd')](path[_0x86c3('0xc8')](config[_0x86c3('0xc5')],_0x86c3('0xc9'),_0x86c3('0xde'),_0x86c3('0xdf')),{'interaction':_0x5e989a})[_0x86c3('0x22')](function(_0x5d94ad){var _0x38682b=path[_0x86c3('0xc8')](_0x39ffd2,'transcript-'+_0x3aad46['id']+'-'+_0x106b7d+_0x86c3('0xe0'));var _0x5d23cb={'path':_0x38682b,'channel':'Sms','interactionId':_0x3aad46['id']};return pdf[_0x86c3('0xe1')](_0x5d94ad,_0x5d23cb);})[_0x86c3('0x22')](function(){return new BPromise(function(_0x24a2b5,_0x3c9a4d){zipdir(_0x39ffd2,{'saveTo':_0x4797e0},function(_0x434a25,_0x30508b){if(_0x434a25)return _0x3c9a4d(_0x434a25);return _0x24a2b5(_0x30508b);});})[_0x86c3('0x22')](function(){return new BPromise(function(_0x532027,_0x5e6668){rimraf(_0x39ffd2,function(_0x307e3e){if(_0x307e3e)_0x5e6668(_0x307e3e);return _0x532027();});});})['then'](function(){return _0x56cde6[_0x86c3('0xc3')](_0x4797e0,_0x4814f3,function(_0x250fd4){if(_0x250fd4){console[_0x86c3('0xe2')](_0x86c3('0xe3'),_0x250fd4);}else{fs[_0x86c3('0xe4')](_0x4797e0);}});});});}else{return _0x56cde6[_0x86c3('0x18')](0xc8);}})['catch'](handleError(_0x56cde6,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index e0b5924..dfbb191 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 _0xa30a=['update','remove','then','setDataValue','map','findAll','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save'];(function(_0x480a91,_0xcad0e8){var _0x521935=function(_0x1cb5c6){while(--_0x1cb5c6){_0x480a91['push'](_0x480a91['shift']());}};_0x521935(++_0xcad0e8);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xaa30('0x0'));var SmsInteraction=require(_0xaa30('0x1'))['db'][_0xaa30('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0xaa30('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xaa30('0x4')](0x0);var events={'afterCreate':_0xaa30('0x5'),'afterUpdate':_0xaa30('0x6'),'afterDestroy':_0xaa30('0x7')};function emitEvent(_0x271425){return function(_0x102ad7,_0x555947,_0x347cd5){_0x102ad7['getUsers']({'attributes':['id'],'raw':!![]})[_0xaa30('0x8')](function(_0x14fe09){_0x102ad7[_0xaa30('0x9')]('Users',_0x14fe09[_0xaa30('0xa')](function(_0x40dbda){return{'id':_0x40dbda['id']};}));return SmsMessage[_0xaa30('0xb')]({'where':{'SmsInteractionId':_0x102ad7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaa30('0x8')](function(_0x14a6a6){_0x102ad7[_0xaa30('0x9')]('unreadMessages',_0x14a6a6['length']);SmsInteractionEvents[_0xaa30('0xc')](_0x271425+':'+_0x102ad7['id'],_0x102ad7);SmsInteractionEvents['emit'](_0x271425,_0x102ad7);_0x347cd5(null);})[_0xaa30('0xd')](_0x347cd5(null));};}for(var e in events){if(events[_0xaa30('0xe')](e)){var event=events[e];SmsInteraction[_0xaa30('0xf')](e,emitEvent(event));}}module[_0xaa30('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x8e3f=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0xf8e3('0x0'));var SmsInteraction=require(_0xf8e3('0x1'))['db'][_0xf8e3('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0xf8e3('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xf8e3('0x4')](0x0);var events={'afterCreate':_0xf8e3('0x5'),'afterUpdate':'update','afterDestroy':_0xf8e3('0x6')};function emitEvent(_0x41bc05){return function(_0x4dab56,_0x35e88f,_0xb21f8d){_0x4dab56[_0xf8e3('0x7')]({'attributes':['id'],'raw':!![]})[_0xf8e3('0x8')](function(_0x4e9e57){_0x4dab56[_0xf8e3('0x9')](_0xf8e3('0xa'),_0x4e9e57[_0xf8e3('0xb')](function(_0x95ad03){return{'id':_0x95ad03['id']};}));return SmsMessage[_0xf8e3('0xc')]({'where':{'SmsInteractionId':_0x4dab56['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf8e3('0x8')](function(_0x299a7e){_0x4dab56[_0xf8e3('0x9')](_0xf8e3('0xd'),_0x299a7e[_0xf8e3('0xe')]);SmsInteractionEvents[_0xf8e3('0xf')](_0x41bc05+':'+_0x4dab56['id'],_0x4dab56);SmsInteractionEvents[_0xf8e3('0xf')](_0x41bc05,_0x4dab56);_0xb21f8d(null);})['catch'](_0xb21f8d(null));};}for(var e in events){if(events[_0xf8e3('0x10')](e)){var event=events[e];SmsInteraction[_0xf8e3('0x11')](e,emitEvent(event));}}module[_0xf8e3('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index fb87828..7b128c2 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 _0xb68a=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x288a94,_0x187465){var _0x14030a=function(_0x12601a){while(--_0x12601a){_0x288a94['push'](_0x288a94['shift']());}};_0x14030a(++_0x187465);}(_0xb68a,0xfd));var _0xab68=function(_0x503381,_0x1f0a62){_0x503381=_0x503381-0x0;var _0x5ebe5a=_0xb68a[_0x503381];return _0x5ebe5a;};'use strict';var _=require(_0xab68('0x0'));var util=require(_0xab68('0x1'));var logger=require(_0xab68('0x2'))(_0xab68('0x3'));var moment=require(_0xab68('0x4'));var BPromise=require(_0xab68('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab68('0x6'));var rimraf=require(_0xab68('0x7'));var config=require(_0xab68('0x8'));var attributes=require(_0xab68('0x9'));module[_0xab68('0xa')]=function(_0x1b06b3,_0x56078d){return _0x1b06b3['define'](_0xab68('0xb'),attributes,{'tableName':_0xab68('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x364cdf,_0x2a5621,_0x1f2883){if(_0x364cdf[_0xab68('0xd')]('closed')){_0x364cdf[_0xab68('0xe')]=moment()[_0xab68('0xf')](_0xab68('0x10'));}_0x1f2883(null,_0x364cdf);}}});}; \ No newline at end of file +var _0x6bb7=['moment','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','api'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x6bb7,0x1df));var _0x76bb=function(_0x47ad67,_0x22f7b6){_0x47ad67=_0x47ad67-0x0;var _0x1fb591=_0x6bb7[_0x47ad67];return _0x1fb591;};'use strict';var _=require('lodash');var util=require(_0x76bb('0x0'));var logger=require('../../config/logger')(_0x76bb('0x1'));var moment=require(_0x76bb('0x2'));var BPromise=require('bluebird');var rp=require(_0x76bb('0x3'));var fs=require('fs');var path=require(_0x76bb('0x4'));var rimraf=require(_0x76bb('0x5'));var config=require('../../config/environment');var attributes=require(_0x76bb('0x6'));module[_0x76bb('0x7')]=function(_0xb38a03,_0x3682b3){return _0xb38a03[_0x76bb('0x8')](_0x76bb('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xcea4de,_0x464c41,_0x194e80){if(_0xcea4de['changed'](_0x76bb('0xa'))){_0xcea4de[_0x76bb('0xb')]=moment()['format'](_0x76bb('0xc'));}_0x194e80(null,_0xcea4de);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 82ebeac..8dd5ae7 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 _0x7471=['SmsInteraction,\x20%s,\x20%s','message','result','UpdateSmsInteraction','SmsInteraction','body','options','raw','attributes','limit','catch','AddTagsToSmsInteraction','addTags','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b96bd,_0xe341d){var _0x515ad8=function(_0x166deb){while(--_0x166deb){_0x4b96bd['push'](_0x4b96bd['shift']());}};_0x515ad8(++_0xe341d);}(_0x7471,0x1b4));var _0x1747=function(_0x1b86d9,_0x189be7){_0x1b86d9=_0x1b86d9-0x0;var _0x48ac4c=_0x7471[_0x1b86d9];return _0x48ac4c;};'use strict';var _=require(_0x1747('0x0'));var util=require(_0x1747('0x1'));var moment=require('moment');var BPromise=require(_0x1747('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1747('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1747('0x4'));var logger=require(_0x1747('0x5'))(_0x1747('0x6'));var config=require(_0x1747('0x7'));var jayson=require(_0x1747('0x8'));var client=jayson[_0x1747('0x9')][_0x1747('0xa')]({'port':0x232a});config[_0x1747('0xb')]=_[_0x1747('0xc')](config[_0x1747('0xb')],{'host':_0x1747('0xd'),'port':0x18eb});var socket=require(_0x1747('0xe'))(new Redis(config[_0x1747('0xb')]));require(_0x1747('0xf'))[_0x1747('0x10')](socket);function respondWithRpcPromise(_0x282071,_0x254fe7,_0x1995ae){return new BPromise(function(_0x52828c,_0x3284ac){return client[_0x1747('0x11')](_0x282071,_0x1995ae)[_0x1747('0x12')](function(_0xbe568e){logger[_0x1747('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x254fe7,_0x1747('0x14'));logger[_0x1747('0x15')](_0x1747('0x16'),_0x254fe7,_0x1747('0x14'),JSON[_0x1747('0x17')](_0xbe568e));if(_0xbe568e[_0x1747('0x18')]){if(_0xbe568e[_0x1747('0x18')][_0x1747('0x19')]===0x1f4){logger[_0x1747('0x18')](_0x1747('0x1a'),_0x254fe7,_0xbe568e[_0x1747('0x18')]['message']);return _0x3284ac(_0xbe568e['error'][_0x1747('0x1b')]);}logger[_0x1747('0x18')](_0x1747('0x1a'),_0x254fe7,_0xbe568e[_0x1747('0x18')][_0x1747('0x1b')]);return _0x52828c(_0xbe568e[_0x1747('0x18')][_0x1747('0x1b')]);}else{logger[_0x1747('0x13')](_0x1747('0x1a'),_0x254fe7,_0x1747('0x14'));_0x52828c(_0xbe568e[_0x1747('0x1c')][_0x1747('0x1b')]);}})['catch'](function(_0x4e095a){logger[_0x1747('0x18')](_0x1747('0x1a'),_0x254fe7,_0x4e095a);_0x3284ac(_0x4e095a);});});}exports[_0x1747('0x1d')]=function(_0x574b2a){var _0x97dbcc=this;return new Promise(function(_0x1259cf,_0x405d48){return db[_0x1747('0x1e')]['update'](_0x574b2a[_0x1747('0x1f')],{'raw':_0x574b2a[_0x1747('0x20')]?_0x574b2a[_0x1747('0x20')][_0x1747('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x574b2a['options']?_0x574b2a[_0x1747('0x20')]['where']||null:null,'attributes':_0x574b2a[_0x1747('0x20')]?_0x574b2a[_0x1747('0x20')][_0x1747('0x22')]||null:null,'limit':_0x574b2a[_0x1747('0x20')]?_0x574b2a[_0x1747('0x20')][_0x1747('0x23')]||null:null})[_0x1747('0x12')](function(_0x1f0c84){logger[_0x1747('0x13')](_0x1747('0x1d'),_0x574b2a);logger['debug'](_0x1747('0x1d'),_0x574b2a,JSON[_0x1747('0x17')](_0x1f0c84));_0x1259cf(_0x1f0c84);})[_0x1747('0x24')](function(_0x235c04){logger[_0x1747('0x18')](_0x1747('0x1d'),_0x235c04['message'],_0x574b2a);_0x405d48(_0x97dbcc[_0x1747('0x18')](0x1f4,_0x235c04[_0x1747('0x1b')]));});});};exports[_0x1747('0x25')]=function(_0xad722a){return new Promise(function(_0x50ceb1,_0x4331d0){return db[_0x1747('0x1e')]['find']({'where':_0xad722a[_0x1747('0x20')]?_0xad722a['options']['where']||null:null})['then'](function(_0x4961e8){if(_0x4961e8){return _0x4961e8[_0x1747('0x26')](_0xad722a['body']['ids'],_[_0x1747('0x27')](_0xad722a['body'],['ids','id'])||{});}})[_0x1747('0x28')](function(_0x1c6e1f){logger[_0x1747('0x13')](_0x1747('0x29'),_0xad722a);logger[_0x1747('0x15')](_0x1747('0x29'),_0xad722a,JSON[_0x1747('0x17')](_0x1c6e1f));_0x50ceb1(_0x1c6e1f);})['catch'](function(_0x354cd3){logger[_0x1747('0x18')](_0x1747('0x29'),_0x354cd3[_0x1747('0x1b')],_0xad722a);_0x4331d0(_this['error'](0x1f4,_0x354cd3['message']));});});}; \ No newline at end of file +var _0xad0a=['debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','SmsInteraction,\x20%s,\x20%s','catch','SmsInteraction','update','body','options','raw','where','limit','then','UpdateSmsInteraction','addTags','omit','ids','spread','AddTags','stringify','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','info'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xad0a,0x15a));var _0xaad0=function(_0x38a6b7,_0x3decfe){_0x38a6b7=_0x38a6b7-0x0;var _0x3ac999=_0xad0a[_0x38a6b7];return _0x3ac999;};'use strict';var _=require('lodash');var util=require(_0xaad0('0x0'));var moment=require(_0xaad0('0x1'));var BPromise=require(_0xaad0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaad0('0x3'));var logger=require('../../config/logger')(_0xaad0('0x4'));var config=require(_0xaad0('0x5'));var jayson=require(_0xaad0('0x6'));var client=jayson[_0xaad0('0x7')][_0xaad0('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xaad0('0x9')],{'host':_0xaad0('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaad0('0x9')]));require('./smsInteraction.socket')[_0xaad0('0xb')](socket);function respondWithRpcPromise(_0x47499d,_0x347502,_0x1fc30e){return new BPromise(function(_0x219e22,_0x5a15c1){return client[_0xaad0('0xc')](_0x47499d,_0x1fc30e)['then'](function(_0x3f3bab){logger[_0xaad0('0xd')]('SmsInteraction,\x20%s,\x20%s',_0x347502,'request\x20sent');logger[_0xaad0('0xe')](_0xaad0('0xf'),_0x347502,_0xaad0('0x10'),JSON['stringify'](_0x3f3bab));if(_0x3f3bab[_0xaad0('0x11')]){if(_0x3f3bab[_0xaad0('0x11')]['code']===0x1f4){logger[_0xaad0('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x347502,_0x3f3bab[_0xaad0('0x11')][_0xaad0('0x12')]);return _0x5a15c1(_0x3f3bab[_0xaad0('0x11')][_0xaad0('0x12')]);}logger[_0xaad0('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x347502,_0x3f3bab[_0xaad0('0x11')][_0xaad0('0x12')]);return _0x219e22(_0x3f3bab[_0xaad0('0x11')]['message']);}else{logger[_0xaad0('0xd')](_0xaad0('0x13'),_0x347502,_0xaad0('0x10'));_0x219e22(_0x3f3bab['result'][_0xaad0('0x12')]);}})[_0xaad0('0x14')](function(_0x497d4e){logger['error'](_0xaad0('0x13'),_0x347502,_0x497d4e);_0x5a15c1(_0x497d4e);});});}exports['UpdateSmsInteraction']=function(_0x305d32){var _0x2ca3ac=this;return new Promise(function(_0x15604c,_0x4e44c5){return db[_0xaad0('0x15')][_0xaad0('0x16')](_0x305d32[_0xaad0('0x17')],{'raw':_0x305d32['options']?_0x305d32[_0xaad0('0x18')][_0xaad0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x305d32['options']?_0x305d32[_0xaad0('0x18')][_0xaad0('0x1a')]||null:null,'attributes':_0x305d32[_0xaad0('0x18')]?_0x305d32[_0xaad0('0x18')]['attributes']||null:null,'limit':_0x305d32[_0xaad0('0x18')]?_0x305d32[_0xaad0('0x18')][_0xaad0('0x1b')]||null:null})[_0xaad0('0x1c')](function(_0x48c24b){logger[_0xaad0('0xd')](_0xaad0('0x1d'),_0x305d32);logger[_0xaad0('0xe')](_0xaad0('0x1d'),_0x305d32,JSON['stringify'](_0x48c24b));_0x15604c(_0x48c24b);})[_0xaad0('0x14')](function(_0x3ee4d2){logger['error'](_0xaad0('0x1d'),_0x3ee4d2[_0xaad0('0x12')],_0x305d32);_0x4e44c5(_0x2ca3ac[_0xaad0('0x11')](0x1f4,_0x3ee4d2['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x4718b1){return new Promise(function(_0x443d54,_0x2ac898){return db[_0xaad0('0x15')]['find']({'where':_0x4718b1[_0xaad0('0x18')]?_0x4718b1['options'][_0xaad0('0x1a')]||null:null})[_0xaad0('0x1c')](function(_0x4be0ef){if(_0x4be0ef){return _0x4be0ef[_0xaad0('0x1e')](_0x4718b1[_0xaad0('0x17')]['ids'],_[_0xaad0('0x1f')](_0x4718b1[_0xaad0('0x17')],[_0xaad0('0x20'),'id'])||{});}})[_0xaad0('0x21')](function(_0x1d23e3){logger['info']('AddTags',_0x4718b1);logger[_0xaad0('0xe')](_0xaad0('0x22'),_0x4718b1,JSON[_0xaad0('0x23')](_0x1d23e3));_0x443d54(_0x1d23e3);})[_0xaad0('0x14')](function(_0x4660f6){logger[_0xaad0('0x11')](_0xaad0('0x22'),_0x4660f6[_0xaad0('0x12')],_0x4718b1);_0x2ac898(_this[_0xaad0('0x11')](0x1f4,_0x4660f6[_0xaad0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 80bf361..890221f 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 _0x79d3=['update','removeListener','length','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x1f4354,_0x18576c){var _0x2880a1=function(_0xe0a4bd){while(--_0xe0a4bd){_0x1f4354['push'](_0x1f4354['shift']());}};_0x2880a1(++_0x18576c);}(_0x79d3,0x1a1));var _0x379d=function(_0x165d3c,_0x3ba20d){_0x165d3c=_0x165d3c-0x0;var _0xc27339=_0x79d3[_0x165d3c];return _0xc27339;};'use strict';var SmsInteractionEvents=require(_0x379d('0x0'));var events=[_0x379d('0x1'),_0x379d('0x2'),_0x379d('0x3')];function createListener(_0x111c1f,_0x4c067b){return function(_0x426e6c){_0x4c067b['emit'](_0x111c1f,_0x426e6c);};}function removeListener(_0x50a46a,_0x4fb43d){return function(){SmsInteractionEvents[_0x379d('0x4')](_0x50a46a,_0x4fb43d);};}exports['register']=function(_0x3da16f){for(var _0x3a7426=0x0,_0x5f1ae0=events[_0x379d('0x5')];_0x3a7426<_0x5f1ae0;_0x3a7426++){var _0x1335b1=events[_0x3a7426];var _0x2d5684=createListener(_0x379d('0x6')+_0x1335b1,_0x3da16f);SmsInteractionEvents['on'](_0x1335b1,_0x2d5684);}}; \ No newline at end of file +var _0x5503=['emit','removeListener','length','./smsInteraction.events','remove'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x5503,0x10c));var _0x3550=function(_0x2d58a8,_0x1af799){_0x2d58a8=_0x2d58a8-0x0;var _0x2dc331=_0x5503[_0x2d58a8];return _0x2dc331;};'use strict';var SmsInteractionEvents=require(_0x3550('0x0'));var events=['save',_0x3550('0x1'),'update'];function createListener(_0x182769,_0x1feaa2){return function(_0x2b7d53){_0x1feaa2[_0x3550('0x2')](_0x182769,_0x2b7d53);};}function removeListener(_0x2ad76e,_0x308f22){return function(){SmsInteractionEvents[_0x3550('0x3')](_0x2ad76e,_0x308f22);};}exports['register']=function(_0x77c878){for(var _0x43c894=0x0,_0x488897=events[_0x3550('0x4')];_0x43c894<_0x488897;_0x43c894++){var _0x4d4199=events[_0x43c894];var _0x38ad5f=createListener('smsInteraction:'+_0x4d4199,_0x77c878);SmsInteractionEvents['on'](_0x4d4199,_0x38ad5f);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 6ef106f..63dbcfa 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 _0x6f83=['/:id','show','post','tracked','smsmessage:create','create','/:id/status','status','put','accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','isAuthenticated','index','get','describe'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0x6f83,0x154));var _0x36f8=function(_0x50be47,_0x497c8f){_0x50be47=_0x50be47-0x0;var _0x31f1ae=_0x6f83[_0x50be47];return _0x31f1ae;};'use strict';var multer=require('multer');var util=require(_0x36f8('0x0'));var path=require('path');var timeout=require(_0x36f8('0x1'));var express=require(_0x36f8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x36f8('0x3'));var interaction=require(_0x36f8('0x4'));var config=require('../../config/environment');var controller=require(_0x36f8('0x5'));router['get']('/',auth[_0x36f8('0x6')](),controller[_0x36f8('0x7')]);router[_0x36f8('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x36f8('0x9')]);router[_0x36f8('0x8')](_0x36f8('0xa'),auth[_0x36f8('0x6')](),controller[_0x36f8('0xb')]);router[_0x36f8('0xc')]('/',auth[_0x36f8('0x6')](),interaction[_0x36f8('0xd')]('sms',_0x36f8('0xe')),controller[_0x36f8('0xf')]);router['post'](_0x36f8('0x10'),controller[_0x36f8('0x11')]);router[_0x36f8('0x12')]('/:id',auth[_0x36f8('0x6')](),controller['update']);router[_0x36f8('0x12')]('/:id/accept',auth[_0x36f8('0x6')](),controller[_0x36f8('0x13')]);router[_0x36f8('0x12')](_0x36f8('0x14'),auth[_0x36f8('0x6')](),controller[_0x36f8('0x15')]);router[_0x36f8('0x16')](_0x36f8('0xa'),auth[_0x36f8('0x6')](),controller[_0x36f8('0x17')]);module[_0x36f8('0x18')]=router; \ No newline at end of file +var _0x6a19=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','/:id','show','sms','create','/:id/status','status','update','put','/:id/accept','accept','reject','destroy','exports','path'];(function(_0x371317,_0x3bfe5a){var _0x3605a3=function(_0x497fb4){while(--_0x497fb4){_0x371317['push'](_0x371317['shift']());}};_0x3605a3(++_0x3bfe5a);}(_0x6a19,0x144));var _0x96a1=function(_0x11026e,_0x164422){_0x11026e=_0x11026e-0x0;var _0x334d99=_0x6a19[_0x11026e];return _0x334d99;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x96a1('0x0'));var timeout=require(_0x96a1('0x1'));var express=require(_0x96a1('0x2'));var router=express[_0x96a1('0x3')]();var fs_extra=require(_0x96a1('0x4'));var auth=require(_0x96a1('0x5'));var interaction=require(_0x96a1('0x6'));var config=require(_0x96a1('0x7'));var controller=require(_0x96a1('0x8'));router[_0x96a1('0x9')]('/',auth[_0x96a1('0xa')](),controller['index']);router['get'](_0x96a1('0xb'),auth[_0x96a1('0xa')](),controller['describe']);router[_0x96a1('0x9')](_0x96a1('0xc'),auth[_0x96a1('0xa')](),controller[_0x96a1('0xd')]);router['post']('/',auth[_0x96a1('0xa')](),interaction['tracked'](_0x96a1('0xe'),'smsmessage:create'),controller[_0x96a1('0xf')]);router['post'](_0x96a1('0x10'),controller[_0x96a1('0x11')]);router['put'](_0x96a1('0xc'),auth[_0x96a1('0xa')](),controller[_0x96a1('0x12')]);router[_0x96a1('0x13')](_0x96a1('0x14'),auth[_0x96a1('0xa')](),controller[_0x96a1('0x15')]);router[_0x96a1('0x13')]('/:id/reject',auth[_0x96a1('0xa')](),controller[_0x96a1('0x16')]);router['delete']('/:id',auth[_0x96a1('0xa')](),controller[_0x96a1('0x17')]);module[_0x96a1('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 7190902..20e021b 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 _0x4070=['DATE','BOOLEAN','sequelize','exports','TEXT','medium','ENUM','out','STRING'];(function(_0x50d6d6,_0x189c68){var _0x5d9bb4=function(_0x12ba37){while(--_0x12ba37){_0x50d6d6['push'](_0x50d6d6['shift']());}};_0x5d9bb4(++_0x189c68);}(_0x4070,0x18e));var _0x0407=function(_0x57d416,_0x5923e7){_0x57d416=_0x57d416-0x0;var _0x2e64d0=_0x4070[_0x57d416];return _0x2e64d0;};'use strict';var Sequelize=require(_0x0407('0x0'));module[_0x0407('0x1')]={'body':{'type':Sequelize[_0x0407('0x2')](_0x0407('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0407('0x4')]('in',_0x0407('0x5')),'defaultValue':_0x0407('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0407('0x6')](0xbe)},'phone':{'type':Sequelize[_0x0407('0x6')]},'readAt':{'type':Sequelize[_0x0407('0x7')]},'secret':{'type':Sequelize[_0x0407('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0407('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xdb4a=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xdb4a,0x1ba));var _0xadb4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xdb4a[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xadb4('0x0'));module[_0xadb4('0x1')]={'body':{'type':Sequelize[_0xadb4('0x2')](_0xadb4('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xadb4('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xadb4('0x5')),'defaultValue':_0xadb4('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xadb4('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xadb4('0x7')]},'secret':{'type':Sequelize[_0xadb4('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xadb4('0x6')]},'providerResponse':{'type':Sequelize[_0xadb4('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 20109eb..4a3c0e1 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 _0x3a15=['filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','create','body','update','describe','sms-interactions','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','interface','SIP/%s','channel','motionChannel','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','User','email','event','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','type','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','sent','delivered','Status','plivio','infobip','results','groupName','eml-format','zip-dir','request-promise','moment','bluebird','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','key','model','query'];(function(_0xb3b452,_0x582e8e){var _0x238983=function(_0x3bc866){while(--_0x3bc866){_0xb3b452['push'](_0xb3b452['shift']());}};_0x238983(++_0x582e8e);}(_0x3a15,0xde));var _0x53a1=function(_0x4456c9,_0x29aff0){_0x4456c9=_0x4456c9-0x0;var _0x3a9e5d=_0x3a15[_0x4456c9];return _0x3a9e5d;};'use strict';var emlformat=require(_0x53a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x53a1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x53a1('0x2'));var moment=require(_0x53a1('0x3'));var BPromise=require(_0x53a1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x53a1('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x53a1('0x6'));var _=require('lodash');var squel=require(_0x53a1('0x7'));var crypto=require(_0x53a1('0x8'));var jsforce=require(_0x53a1('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x53a1('0xa'));var querystring=require(_0x53a1('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x53a1('0xc'));var as=require(_0x53a1('0xd'));var hardwareService=require(_0x53a1('0xe'));var logger=require(_0x53a1('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x53a1('0x10'));var db=require(_0x53a1('0x11'))['db'];config['redis']=_[_0x53a1('0x12')](config[_0x53a1('0x13')],{'host':_0x53a1('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x53a1('0x13')]));require(_0x53a1('0x15'))[_0x53a1('0x16')](socket);var jayson=require(_0x53a1('0x17'));var client=jayson[_0x53a1('0x18')][_0x53a1('0x19')]({'port':0x232c});var client9002=jayson[_0x53a1('0x18')][_0x53a1('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x474d58,_0x552306,_0x367f3e,_0xd7a6a4){return new BPromise(function(_0x1793e0,_0x3dd7b3){var _0x153ce9=_0xd7a6a4||client;return _0x153ce9[_0x53a1('0x1a')](_0x474d58,_0x367f3e)[_0x53a1('0x1b')](function(_0x4c1b23){logger[_0x53a1('0x1c')]('SmsMessage,\x20%s,\x20%s',_0x552306,_0x53a1('0x1d'));logger[_0x53a1('0x1e')](_0x53a1('0x1f'),_0x552306,_0x53a1('0x1d'),JSON[_0x53a1('0x20')](_0x4c1b23));if(_0x4c1b23[_0x53a1('0x21')]){if(_0x4c1b23['error'][_0x53a1('0x22')]===0x1f4){logger[_0x53a1('0x21')]('SmsMessage,\x20%s,\x20%s',_0x552306,_0x4c1b23[_0x53a1('0x21')][_0x53a1('0x23')]);return _0x3dd7b3(_0x4c1b23['error'][_0x53a1('0x23')]);}logger[_0x53a1('0x21')]('SmsMessage,\x20%s,\x20%s',_0x552306,_0x4c1b23[_0x53a1('0x21')][_0x53a1('0x23')]);return _0x1793e0(_0x4c1b23['error'][_0x53a1('0x23')]);}else{logger[_0x53a1('0x1c')](_0x53a1('0x24'),_0x552306,_0x53a1('0x1d'));_0x1793e0(_0x4c1b23['result'][_0x53a1('0x23')]);}})[_0x53a1('0x25')](function(_0x2a71f1){logger[_0x53a1('0x21')](_0x53a1('0x24'),_0x552306,_0x2a71f1);_0x3dd7b3(_0x2a71f1);});});}function respondWithStatusCode(_0x30a0cc,_0x507a9e){_0x507a9e=_0x507a9e||0xcc;return function(_0xc8a720){if(_0xc8a720){return _0x30a0cc[_0x53a1('0x26')](_0x507a9e);}return _0x30a0cc[_0x53a1('0x27')](_0x507a9e)[_0x53a1('0x28')]();};}function respondWithResult(_0x348d5f,_0x13f870){_0x13f870=_0x13f870||0xc8;return function(_0x13f5f7){if(_0x13f5f7){return _0x348d5f[_0x53a1('0x27')](_0x13f870)[_0x53a1('0x29')](_0x13f5f7);}};}function respondWithFilteredResult(_0x162bd1,_0x255768){return function(_0x15a530){if(_0x15a530){var _0x5cb95e=typeof _0x255768[_0x53a1('0x2a')]===_0x53a1('0x2b')&&typeof _0x255768[_0x53a1('0x2c')]===_0x53a1('0x2b');var _0x442165=_0x15a530[_0x53a1('0x2d')];var _0x2271d7=_0x5cb95e?0x0:_0x255768['offset'];var _0x5aba04=_0x5cb95e?_0x15a530[_0x53a1('0x2d')]:_0x255768[_0x53a1('0x2a')]+_0x255768[_0x53a1('0x2c')];var _0x4764fa;if(_0x5aba04>=_0x442165){_0x5aba04=_0x442165;_0x4764fa=0xc8;}else{_0x4764fa=0xce;}_0x162bd1[_0x53a1('0x27')](_0x4764fa);return _0x162bd1[_0x53a1('0x2e')]('Content-Range',_0x2271d7+'-'+_0x5aba04+'/'+_0x442165)['json'](_0x15a530);}return null;};}function patchUpdates(_0x13a2b1){return function(_0x37f834){try{jsonpatch[_0x53a1('0x2f')](_0x37f834,_0x13a2b1,!![]);}catch(_0x272952){return BPromise[_0x53a1('0x30')](_0x272952);}return _0x37f834[_0x53a1('0x31')]();};}function saveUpdates(_0x4348a6,_0x3ae0b7){return function(_0x1c1211){if(_0x1c1211){return _0x1c1211['update'](_0x4348a6)['then'](function(_0x215d9b){return _0x215d9b;});}return null;};}function removeEntity(_0x26b1b2,_0x3f512f){return function(_0x5a0950){if(_0x5a0950){return _0x5a0950[_0x53a1('0x32')]()[_0x53a1('0x1b')](function(){_0x26b1b2[_0x53a1('0x27')](0xcc)[_0x53a1('0x28')]();});}};}function handleEntityNotFound(_0x1d9496,_0x33cbec){return function(_0x4c3bb8){if(!_0x4c3bb8){_0x1d9496[_0x53a1('0x26')](0x194);}return _0x4c3bb8;};}function handleError(_0x23ea7f,_0x3ac4b4){_0x3ac4b4=_0x3ac4b4||0x1f4;return function(_0x9c0b18){logger['error'](_0x9c0b18[_0x53a1('0x33')]);if(_0x9c0b18['name']){delete _0x9c0b18[_0x53a1('0x34')];}_0x23ea7f[_0x53a1('0x27')](_0x3ac4b4)[_0x53a1('0x35')](_0x9c0b18);};}exports[_0x53a1('0x36')]=function(_0x2c319b,_0x18fcff){var _0x3639bd={},_0xa16a0c={},_0x4173b8={'count':0x0,'rows':[]};var _0x4b71a0=_[_0x53a1('0x37')](db[_0x53a1('0x38')][_0x53a1('0x39')],function(_0x2d8216){return{'name':_0x2d8216[_0x53a1('0x3a')],'type':_0x2d8216['type'][_0x53a1('0x3b')]};});_0xa16a0c[_0x53a1('0x3c')]=_[_0x53a1('0x37')](_0x4b71a0,_0x53a1('0x34'));_0xa16a0c[_0x53a1('0x3d')]=_['keys'](_0x2c319b['query']);_0xa16a0c[_0x53a1('0x3e')]=_[_0x53a1('0x3f')](_0xa16a0c[_0x53a1('0x3c')],_0xa16a0c[_0x53a1('0x3d')]);_0x3639bd['attributes']=_['intersection'](_0xa16a0c['model'],qs[_0x53a1('0x40')](_0x2c319b[_0x53a1('0x3d')][_0x53a1('0x40')]));_0x3639bd[_0x53a1('0x41')]=_0x3639bd['attributes'][_0x53a1('0x42')]?_0x3639bd['attributes']:_0xa16a0c['model'];if(!_0x2c319b[_0x53a1('0x3d')]['hasOwnProperty'](_0x53a1('0x43'))){_0x3639bd[_0x53a1('0x2c')]=qs['limit'](_0x2c319b[_0x53a1('0x3d')]['limit']);_0x3639bd[_0x53a1('0x2a')]=qs['offset'](_0x2c319b[_0x53a1('0x3d')]['offset']);}_0x3639bd['order']=qs[_0x53a1('0x44')](_0x2c319b['query']['sort']);_0x3639bd[_0x53a1('0x45')]=qs[_0x53a1('0x3e')](_[_0x53a1('0x46')](_0x2c319b['query'],_0xa16a0c[_0x53a1('0x3e')]),_0x4b71a0);if(_0x2c319b[_0x53a1('0x3d')][_0x53a1('0x47')]){_0x3639bd[_0x53a1('0x45')]=_[_0x53a1('0x48')](_0x3639bd['where'],{'$or':_[_0x53a1('0x37')](_0x4b71a0,function(_0x2f0baf){if(_0x2f0baf['type']!==_0x53a1('0x49')){var _0x2b4740={};_0x2b4740[_0x2f0baf[_0x53a1('0x34')]]={'$like':'%'+_0x2c319b[_0x53a1('0x3d')][_0x53a1('0x47')]+'%'};return _0x2b4740;}})});}_0x3639bd=_['merge']({},_0x3639bd,_0x2c319b[_0x53a1('0x4a')]);var _0x2ba624={'where':_0x3639bd['where']};return db['SmsMessage'][_0x53a1('0x2d')](_0x2ba624)[_0x53a1('0x1b')](function(_0x2b277d){_0x4173b8[_0x53a1('0x2d')]=_0x2b277d;if(_0x2c319b[_0x53a1('0x3d')][_0x53a1('0x4b')]){_0x3639bd[_0x53a1('0x4c')]=[{'all':!![]}];}return db[_0x53a1('0x38')][_0x53a1('0x4d')](_0x3639bd);})[_0x53a1('0x1b')](function(_0x57de5b){_0x4173b8['rows']=_0x57de5b;return _0x4173b8;})[_0x53a1('0x1b')](respondWithFilteredResult(_0x18fcff,_0x3639bd))['catch'](handleError(_0x18fcff,null));};exports[_0x53a1('0x4e')]=function(_0x444db1,_0x412027){var _0x4ad073={'raw':!![],'where':{'id':_0x444db1[_0x53a1('0x4f')]['id']}},_0x232009={};_0x232009[_0x53a1('0x3c')]=_[_0x53a1('0x50')](db[_0x53a1('0x38')]['rawAttributes']);_0x232009[_0x53a1('0x3d')]=_[_0x53a1('0x50')](_0x444db1[_0x53a1('0x3d')]);_0x232009[_0x53a1('0x3e')]=_[_0x53a1('0x3f')](_0x232009[_0x53a1('0x3c')],_0x232009[_0x53a1('0x3d')]);_0x4ad073[_0x53a1('0x41')]=_['intersection'](_0x232009['model'],qs['fields'](_0x444db1[_0x53a1('0x3d')][_0x53a1('0x40')]));_0x4ad073[_0x53a1('0x41')]=_0x4ad073[_0x53a1('0x41')]['length']?_0x4ad073[_0x53a1('0x41')]:_0x232009['model'];if(_0x444db1[_0x53a1('0x3d')][_0x53a1('0x4b')]){_0x4ad073[_0x53a1('0x4c')]=[{'all':!![]}];}_0x4ad073=_[_0x53a1('0x48')]({},_0x4ad073,_0x444db1['options']);return db['SmsMessage'][_0x53a1('0x51')](_0x4ad073)[_0x53a1('0x1b')](handleEntityNotFound(_0x412027,null))[_0x53a1('0x1b')](respondWithResult(_0x412027,null))[_0x53a1('0x25')](handleError(_0x412027,null));};exports['create']=function(_0x327000,_0x3a2ef5){return db['SmsMessage'][_0x53a1('0x52')](_0x327000[_0x53a1('0x53')],{})[_0x53a1('0x1b')](respondWithResult(_0x3a2ef5,0xc9))[_0x53a1('0x25')](handleError(_0x3a2ef5,null));};exports[_0x53a1('0x54')]=function(_0x5504b5,_0x35af82){if(_0x5504b5[_0x53a1('0x53')]['id']){delete _0x5504b5[_0x53a1('0x53')]['id'];}return db[_0x53a1('0x38')][_0x53a1('0x51')]({'where':{'id':_0x5504b5['params']['id']}})[_0x53a1('0x1b')](handleEntityNotFound(_0x35af82,null))[_0x53a1('0x1b')](saveUpdates(_0x5504b5[_0x53a1('0x53')],null))[_0x53a1('0x1b')](respondWithResult(_0x35af82,null))[_0x53a1('0x25')](handleError(_0x35af82,null));};exports['destroy']=function(_0x5100b7,_0x1a23ce){return db[_0x53a1('0x38')][_0x53a1('0x51')]({'where':{'id':_0x5100b7['params']['id']}})[_0x53a1('0x1b')](handleEntityNotFound(_0x1a23ce,null))[_0x53a1('0x1b')](removeEntity(_0x1a23ce,null))[_0x53a1('0x25')](handleError(_0x1a23ce,null));};exports['describe']=function(_0x361dd7,_0x8168d7){return db[_0x53a1('0x38')][_0x53a1('0x55')]()[_0x53a1('0x1b')](respondWithResult(_0x8168d7,null))[_0x53a1('0x25')](handleError(_0x8168d7,null));};var interaction_log=require(_0x53a1('0xf'))(_0x53a1('0x56'));exports['accept']=function(_0x4b6612,_0x12cee7,_0x215f65){var _0x1f263a={'agent':{},'channel':_0x53a1('0x57')};if(_0x4b6612[_0x53a1('0x53')]['id']){delete _0x4b6612['body']['id'];}_0x4b6612[_0x53a1('0x53')]['read']=!![];_0x4b6612[_0x53a1('0x53')][_0x53a1('0x58')]=moment()[_0x53a1('0x59')](_0x53a1('0x5a'));_0x4b6612[_0x53a1('0x53')][_0x53a1('0x5b')]=_0x4b6612['body'][_0x53a1('0x5b')]||_0x4b6612[_0x53a1('0x5c')]['id'];_0x1f263a[_0x53a1('0x5d')]['id']=_0x4b6612[_0x53a1('0x53')]['UserId'];return db[_0x53a1('0x38')][_0x53a1('0x51')]({'where':{'id':_0x4b6612['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x12cee7,null))['then'](saveUpdates(_0x4b6612[_0x53a1('0x53')],null))[_0x53a1('0x1b')](function(_0x4a72da){if(_0x4a72da){_0x1f263a[_0x53a1('0x23')]=_0x4a72da[_0x53a1('0x5e')]({'plain':!![]});return db[_0x53a1('0x5f')][_0x53a1('0x51')]({'where':{'id':_0x4a72da[_0x53a1('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x12cee7,null))[_0x53a1('0x1b')](function(_0x14ac99){if(_0x14ac99){return _0x14ac99[_0x53a1('0x54')]({'UserId':_0x4b6612[_0x53a1('0x53')]['UserId'],'read1stAt':_[_0x53a1('0x61')](_0x14ac99['read1stAt'])?moment()[_0x53a1('0x59')](_0x53a1('0x5a')):undefined});}return null;})[_0x53a1('0x1b')](function(_0x45ebb4){if(_0x45ebb4){_0x1f263a[_0x53a1('0x62')]=_0x45ebb4[_0x53a1('0x5e')]({'plain':!![]});interaction_log[_0x53a1('0x1c')](_0x53a1('0x63'),_0x4b6612['user']['id'],_0x4b6612[_0x53a1('0x5c')][_0x53a1('0x34')],_0x4b6612[_0x53a1('0x5c')][_0x53a1('0x64')],_0x1f263a[_0x53a1('0x62')]['id'],_0x4b6612[_0x53a1('0x53')]?JSON[_0x53a1('0x20')](_0x4b6612['body']):'null');return respondWithRpcPromise(_0x53a1('0x65'),_0x53a1('0x66'),_0x1f263a);}return null;})['then'](function(_0x143524){var _0x32201b=_0x53a1('0x67')+_0x143524[_0x53a1('0x23')][_0x53a1('0x68')];return db[_0x53a1('0x69')][_0x53a1('0x3d')](_0x32201b,{'type':db[_0x53a1('0x6a')][_0x53a1('0x6b')][_0x53a1('0x6c')],'raw':!![]})[_0x53a1('0x1b')](function(_0x350234){return _0x350234;});})['then'](function(_0x29c917){if(_0x29c917){_0x1f263a[_0x53a1('0x23')][_0x53a1('0x6d')]=_0x29c917[0x0];if(!_0x4b6612[_0x53a1('0x53')][_0x53a1('0x5b')])return;return db['User'][_0x53a1('0x51')]({'where':{'id':_0x4b6612[_0x53a1('0x53')][_0x53a1('0x5b')],'role':_0x53a1('0x5d')},'attributes':['id',_0x53a1('0x34'),_0x53a1('0x6e'),'email',_0x53a1('0x6f')],'raw':!![]});}return null;})[_0x53a1('0x1b')](function(_0x32518b){if(!_0x32518b)return null;_0x1f263a['message'][_0x53a1('0x5d')]=_0x32518b;return _0x1f263a;})[_0x53a1('0x1b')](function(_0x4b99a2){if(_0x4b99a2){if(_0x4b6612[_0x53a1('0x53')]['manual']){_0x1f263a[_0x53a1('0x23')][_0x53a1('0x70')]=util[_0x53a1('0x59')](_0x53a1('0x71'),_0x4b6612['user']['name']);_0x1f263a[_0x53a1('0x23')][_0x53a1('0x72')]=_0x1f263a[_0x53a1('0x72')];_0x1f263a[_0x53a1('0x23')][_0x53a1('0x73')]=_0x1f263a[_0x53a1('0x72')];_0x1f263a['message']['event']='accept';return respondWithRpcPromise(_0x53a1('0x74'),'EventManager',{'event':'acceptmessage','message':_0x1f263a[_0x53a1('0x23')]},client9002)[_0x53a1('0x1b')](function(){return _0x1f263a;});}return _0x1f263a;}return null;})[_0x53a1('0x1b')](respondWithResult(_0x12cee7,null))[_0x53a1('0x25')](handleError(_0x12cee7,null));};var interaction_log=require(_0x53a1('0xf'))(_0x53a1('0x56'));exports[_0x53a1('0x30')]=function(_0xddc9bf,_0x2eb319,_0x132004){var _0x43c8b8={'agent':{},'channel':'sms'};if(_0xddc9bf['body']['id']){delete _0xddc9bf[_0x53a1('0x53')]['id'];}_0xddc9bf['body'][_0x53a1('0x5b')]=_0xddc9bf['body'][_0x53a1('0x5b')]||_0xddc9bf[_0x53a1('0x5c')]['id'];_0x43c8b8[_0x53a1('0x5d')]['id']=_0xddc9bf[_0x53a1('0x53')][_0x53a1('0x5b')];return db['SmsMessage']['find']({'where':{'id':_0xddc9bf[_0x53a1('0x4f')]['id'],'UserId':null}})[_0x53a1('0x1b')](handleEntityNotFound(_0x2eb319,null))['then'](function(_0x58219f){if(_0x58219f){_0x43c8b8[_0x53a1('0x23')]=_0x58219f[_0x53a1('0x5e')]({'plain':!![]});return db['SmsInteraction'][_0x53a1('0x51')]({'where':{'id':_0x58219f[_0x53a1('0x60')]}});}return null;})[_0x53a1('0x1b')](handleEntityNotFound(_0x2eb319,null))['then'](function(_0x1b07fe){if(_0x1b07fe){_0x43c8b8['interaction']=_0x1b07fe[_0x53a1('0x5e')]({'plain':!![]});interaction_log[_0x53a1('0x1c')](_0x53a1('0x75'),_0xddc9bf[_0x53a1('0x5c')]['id'],_0xddc9bf['user'][_0x53a1('0x34')],_0xddc9bf['user'][_0x53a1('0x64')],_0x43c8b8['interaction']['id'],_0xddc9bf[_0x53a1('0x53')]?JSON[_0x53a1('0x20')](_0xddc9bf['body']):_0x53a1('0x76'));return respondWithRpcPromise(_0x53a1('0x77'),_0x53a1('0x78'),_0x43c8b8);}return null;})['then'](function(_0x243e09){var _0x499f17=_0x53a1('0x67')+_0x243e09[_0x53a1('0x23')][_0x53a1('0x68')];return db[_0x53a1('0x69')][_0x53a1('0x3d')](_0x499f17,{'type':db[_0x53a1('0x6a')][_0x53a1('0x6b')][_0x53a1('0x6c')],'raw':!![]})[_0x53a1('0x1b')](function(_0x2a65eb){return _0x2a65eb;});})['then'](function(_0xccf4e1){if(_0xccf4e1){_0x43c8b8[_0x53a1('0x23')]['contact']=_0xccf4e1[0x0];if(!_0xddc9bf['body'][_0x53a1('0x5b')])return;return db[_0x53a1('0x79')][_0x53a1('0x51')]({'where':{'id':_0xddc9bf[_0x53a1('0x53')]['UserId'],'role':_0x53a1('0x5d')},'attributes':['id',_0x53a1('0x34'),_0x53a1('0x6e'),_0x53a1('0x7a'),_0x53a1('0x6f')],'raw':!![]});}return null;})[_0x53a1('0x1b')](function(_0x5d9cc9){if(!_0x5d9cc9)return null;_0x43c8b8[_0x53a1('0x23')]['agent']=_0x5d9cc9;return _0x43c8b8;})[_0x53a1('0x1b')](function(_0x52d81d){if(_0x52d81d){_0x52d81d[_0x53a1('0x23')]['interface']=util['format'](_0x53a1('0x71'),_0xddc9bf['user'][_0x53a1('0x34')]);_0x52d81d[_0x53a1('0x23')]['channel']=_0x43c8b8[_0x53a1('0x72')];_0x52d81d[_0x53a1('0x23')][_0x53a1('0x73')]=_0x43c8b8[_0x53a1('0x72')];_0x52d81d[_0x53a1('0x23')][_0x53a1('0x7b')]=_0x53a1('0x30');respondWithRpcPromise(_0x53a1('0x74'),_0x53a1('0x74'),{'event':_0x53a1('0x7c'),'message':_0x52d81d[_0x53a1('0x23')]},client9002);return _0x43c8b8;}return null;})[_0x53a1('0x1b')](respondWithResult(_0x2eb319,null))[_0x53a1('0x25')](handleError(_0x2eb319,null));};exports[_0x53a1('0x27')]=function(_0x4291df,_0x5a779e,_0x36eaa5){if(_0x4291df[_0x53a1('0x53')]['id']){delete _0x4291df[_0x53a1('0x53')]['id'];}var _0x502023;return db[_0x53a1('0x38')]['find']({'where':{'id':_0x4291df['params']['id']}})[_0x53a1('0x1b')](handleEntityNotFound(_0x5a779e,null))[_0x53a1('0x1b')](function(_0x5496f7){if(_0x5496f7){_0x502023=_0x5496f7;return db[_0x53a1('0x7d')][_0x53a1('0x51')]({'where':{'id':_0x5496f7[_0x53a1('0x7e')]}});}})[_0x53a1('0x1b')](handleEntityNotFound(_0x5a779e,null))[_0x53a1('0x1b')](function(_0x22e646){if(_0x22e646){logger[_0x53a1('0x1e')](_0x53a1('0x1f'),_0x53a1('0x27'),_0x53a1('0x7f'),_0x22e646['type'],util[_0x53a1('0x80')](_0x4291df[_0x53a1('0x53')],{'showHidden':![],'depth':null}));switch(_0x22e646[_0x53a1('0x81')]){case _0x53a1('0x82'):if(_0x4291df[_0x53a1('0x53')]['MessageSid']&&_0x4291df[_0x53a1('0x53')][_0x53a1('0x83')]===_0x502023[_0x53a1('0x84')]){return _0x502023['update']({'read':!![]});}else{logger['error'](_0x53a1('0x85'),_0x53a1('0x27'),_0x53a1('0x82'),util[_0x53a1('0x80')](_0x4291df['body'],{'showHidden':![],'depth':null}));}break;case _0x53a1('0x86'):if(_0x4291df[_0x53a1('0x53')]['MessageUUID']&&_0x4291df[_0x53a1('0x53')]['MessageUUID']===_0x502023[_0x53a1('0x84')]&&_['indexOf']([_0x53a1('0x87'),_0x53a1('0x88')],_0x4291df['body'][_0x53a1('0x89')])>=0x0){return _0x502023[_0x53a1('0x54')]({'read':!![]});}else{logger[_0x53a1('0x21')](_0x53a1('0x85'),_0x53a1('0x27'),_0x53a1('0x8a'),util[_0x53a1('0x80')](_0x4291df[_0x53a1('0x53')],{'showHidden':![],'depth':null}));}break;case _0x53a1('0x8b'):var _0x57c23b=_0x4291df[_0x53a1('0x53')][_0x53a1('0x8c')][0x0];if(_0x57c23b[_0x53a1('0x27')][_0x53a1('0x8d')]==='DELIVERED'){return _0x502023[_0x53a1('0x54')]({'read':!![]});}else{logger[_0x53a1('0x21')](_0x53a1('0x85'),_0x53a1('0x27'),_0x53a1('0x8b'),util[_0x53a1('0x80')](_0x4291df['body'],{'showHidden':![],'depth':null}));}break;}return _0x502023;}})[_0x53a1('0x1b')](respondWithResult(_0x5a779e,null))[_0x53a1('0x25')](handleError(_0x5a779e,null));}; \ No newline at end of file +var _0x4ccb=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','sendStatus','stack','name','send','map','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','SmsMessage','findAll','rows','show','params','find','create','body','update','destroy','describe','../../config/logger','sms-interactions','accept','sms','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','SIP/%s','channel','EventManager','acceptmessage','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','interface','event','rejectmessage','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','Status','infobip','results','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x911aa,_0x5cb8b5){var _0x327202=function(_0x52308e){while(--_0x52308e){_0x911aa['push'](_0x911aa['shift']());}};_0x327202(++_0x5cb8b5);}(_0x4ccb,0x196));var _0xb4cc=function(_0x4713c8,_0x146d68){_0x4713c8=_0x4713c8-0x0;var _0xfee2d7=_0x4ccb[_0x4713c8];return _0xfee2d7;};'use strict';var emlformat=require(_0xb4cc('0x0'));var rimraf=require(_0xb4cc('0x1'));var zipdir=require(_0xb4cc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb4cc('0x3'));var moment=require(_0xb4cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb4cc('0x5'));var util=require(_0xb4cc('0x6'));var path=require(_0xb4cc('0x7'));var sox=require('sox');var csv=require(_0xb4cc('0x8'));var ejs=require(_0xb4cc('0x9'));var fs=require('fs');var fs_extra=require(_0xb4cc('0xa'));var _=require('lodash');var squel=require(_0xb4cc('0xb'));var crypto=require(_0xb4cc('0xc'));var jsforce=require(_0xb4cc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb4cc('0x8'));var querystring=require(_0xb4cc('0xe'));var Papa=require(_0xb4cc('0xf'));var Redis=require(_0xb4cc('0x10'));var authService=require(_0xb4cc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb4cc('0x12'));var hardwareService=require(_0xb4cc('0x13'));var logger=require('../../config/logger')(_0xb4cc('0x14'));var utils=require('../../config/utils');var config=require(_0xb4cc('0x15'));var licenseUtil=require(_0xb4cc('0x16'));var db=require(_0xb4cc('0x17'))['db'];config['redis']=_['defaults'](config[_0xb4cc('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb4cc('0x18')]));require('./smsMessage.socket')['register'](socket);var jayson=require(_0xb4cc('0x19'));var client=jayson[_0xb4cc('0x1a')][_0xb4cc('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xb4cc('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1a5edc,_0x3aca2b,_0x926f2c,_0x3cf8a4){return new BPromise(function(_0x506ef9,_0x4d4546){var _0x2ba050=_0x3cf8a4||client;return _0x2ba050[_0xb4cc('0x1c')](_0x1a5edc,_0x926f2c)['then'](function(_0x490b1a){logger[_0xb4cc('0x1d')](_0xb4cc('0x1e'),_0x3aca2b,_0xb4cc('0x1f'));logger[_0xb4cc('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3aca2b,_0xb4cc('0x1f'),JSON[_0xb4cc('0x21')](_0x490b1a));if(_0x490b1a[_0xb4cc('0x22')]){if(_0x490b1a[_0xb4cc('0x22')][_0xb4cc('0x23')]===0x1f4){logger['error'](_0xb4cc('0x1e'),_0x3aca2b,_0x490b1a[_0xb4cc('0x22')][_0xb4cc('0x24')]);return _0x4d4546(_0x490b1a[_0xb4cc('0x22')][_0xb4cc('0x24')]);}logger['error'](_0xb4cc('0x1e'),_0x3aca2b,_0x490b1a[_0xb4cc('0x22')][_0xb4cc('0x24')]);return _0x506ef9(_0x490b1a[_0xb4cc('0x22')]['message']);}else{logger['info'](_0xb4cc('0x1e'),_0x3aca2b,_0xb4cc('0x1f'));_0x506ef9(_0x490b1a['result']['message']);}})[_0xb4cc('0x25')](function(_0xeb25e1){logger[_0xb4cc('0x22')](_0xb4cc('0x1e'),_0x3aca2b,_0xeb25e1);_0x4d4546(_0xeb25e1);});});}function respondWithStatusCode(_0x5af854,_0x4efac8){_0x4efac8=_0x4efac8||0xcc;return function(_0x3a1236){if(_0x3a1236){return _0x5af854['sendStatus'](_0x4efac8);}return _0x5af854[_0xb4cc('0x26')](_0x4efac8)[_0xb4cc('0x27')]();};}function respondWithResult(_0x1e7327,_0x2ed6d4){_0x2ed6d4=_0x2ed6d4||0xc8;return function(_0x6fb0fb){if(_0x6fb0fb){return _0x1e7327[_0xb4cc('0x26')](_0x2ed6d4)[_0xb4cc('0x28')](_0x6fb0fb);}};}function respondWithFilteredResult(_0x1de4b6,_0x27b804){return function(_0x5baab6){if(_0x5baab6){var _0x755b4a=typeof _0x27b804[_0xb4cc('0x29')]===_0xb4cc('0x2a')&&typeof _0x27b804[_0xb4cc('0x2b')]===_0xb4cc('0x2a');var _0x541a4a=_0x5baab6[_0xb4cc('0x2c')];var _0x2957ee=_0x755b4a?0x0:_0x27b804[_0xb4cc('0x29')];var _0x373b4e=_0x755b4a?_0x5baab6['count']:_0x27b804[_0xb4cc('0x29')]+_0x27b804[_0xb4cc('0x2b')];var _0x4e8e5f;if(_0x373b4e>=_0x541a4a){_0x373b4e=_0x541a4a;_0x4e8e5f=0xc8;}else{_0x4e8e5f=0xce;}_0x1de4b6[_0xb4cc('0x26')](_0x4e8e5f);return _0x1de4b6[_0xb4cc('0x2d')]('Content-Range',_0x2957ee+'-'+_0x373b4e+'/'+_0x541a4a)[_0xb4cc('0x28')](_0x5baab6);}return null;};}function patchUpdates(_0x151427){return function(_0x26b9c1){try{jsonpatch[_0xb4cc('0x2e')](_0x26b9c1,_0x151427,!![]);}catch(_0x2962fe){return BPromise[_0xb4cc('0x2f')](_0x2962fe);}return _0x26b9c1[_0xb4cc('0x30')]();};}function saveUpdates(_0x3a48ca,_0x332e34){return function(_0x4f5172){if(_0x4f5172){return _0x4f5172['update'](_0x3a48ca)[_0xb4cc('0x31')](function(_0x8dafaf){return _0x8dafaf;});}return null;};}function removeEntity(_0x3fe057,_0x11b874){return function(_0x373f36){if(_0x373f36){return _0x373f36['destroy']()[_0xb4cc('0x31')](function(){_0x3fe057[_0xb4cc('0x26')](0xcc)[_0xb4cc('0x27')]();});}};}function handleEntityNotFound(_0x5154f9,_0x418182){return function(_0x121dfb){if(!_0x121dfb){_0x5154f9[_0xb4cc('0x32')](0x194);}return _0x121dfb;};}function handleError(_0x519b22,_0x27e4fb){_0x27e4fb=_0x27e4fb||0x1f4;return function(_0x51155e){logger[_0xb4cc('0x22')](_0x51155e[_0xb4cc('0x33')]);if(_0x51155e[_0xb4cc('0x34')]){delete _0x51155e[_0xb4cc('0x34')];}_0x519b22['status'](_0x27e4fb)[_0xb4cc('0x35')](_0x51155e);};}exports['index']=function(_0x8d6f09,_0x44b56d){var _0x4490ea={},_0x4245cd={},_0x1ce892={'count':0x0,'rows':[]};var _0x3f9b37=_[_0xb4cc('0x36')](db['SmsMessage'][_0xb4cc('0x37')],function(_0x379ab3){return{'name':_0x379ab3[_0xb4cc('0x38')],'type':_0x379ab3['type']['key']};});_0x4245cd[_0xb4cc('0x39')]=_[_0xb4cc('0x36')](_0x3f9b37,_0xb4cc('0x34'));_0x4245cd[_0xb4cc('0x3a')]=_[_0xb4cc('0x3b')](_0x8d6f09['query']);_0x4245cd[_0xb4cc('0x3c')]=_['intersection'](_0x4245cd['model'],_0x4245cd[_0xb4cc('0x3a')]);_0x4490ea[_0xb4cc('0x3d')]=_[_0xb4cc('0x3e')](_0x4245cd[_0xb4cc('0x39')],qs[_0xb4cc('0x3f')](_0x8d6f09['query'][_0xb4cc('0x3f')]));_0x4490ea['attributes']=_0x4490ea[_0xb4cc('0x3d')][_0xb4cc('0x40')]?_0x4490ea[_0xb4cc('0x3d')]:_0x4245cd[_0xb4cc('0x39')];if(!_0x8d6f09[_0xb4cc('0x3a')][_0xb4cc('0x41')](_0xb4cc('0x42'))){_0x4490ea[_0xb4cc('0x2b')]=qs[_0xb4cc('0x2b')](_0x8d6f09[_0xb4cc('0x3a')][_0xb4cc('0x2b')]);_0x4490ea['offset']=qs[_0xb4cc('0x29')](_0x8d6f09[_0xb4cc('0x3a')][_0xb4cc('0x29')]);}_0x4490ea[_0xb4cc('0x43')]=qs['sort'](_0x8d6f09['query'][_0xb4cc('0x44')]);_0x4490ea[_0xb4cc('0x45')]=qs['filters'](_[_0xb4cc('0x46')](_0x8d6f09[_0xb4cc('0x3a')],_0x4245cd[_0xb4cc('0x3c')]),_0x3f9b37);if(_0x8d6f09[_0xb4cc('0x3a')]['filter']){_0x4490ea[_0xb4cc('0x45')]=_[_0xb4cc('0x47')](_0x4490ea[_0xb4cc('0x45')],{'$or':_['map'](_0x3f9b37,function(_0x41a604){if(_0x41a604[_0xb4cc('0x48')]!==_0xb4cc('0x49')){var _0x1490b6={};_0x1490b6[_0x41a604[_0xb4cc('0x34')]]={'$like':'%'+_0x8d6f09[_0xb4cc('0x3a')][_0xb4cc('0x4a')]+'%'};return _0x1490b6;}})});}_0x4490ea=_[_0xb4cc('0x47')]({},_0x4490ea,_0x8d6f09[_0xb4cc('0x4b')]);var _0x497dee={'where':_0x4490ea[_0xb4cc('0x45')]};return db['SmsMessage'][_0xb4cc('0x2c')](_0x497dee)[_0xb4cc('0x31')](function(_0x10f142){_0x1ce892['count']=_0x10f142;if(_0x8d6f09[_0xb4cc('0x3a')][_0xb4cc('0x4c')]){_0x4490ea[_0xb4cc('0x4d')]=[{'all':!![]}];}return db[_0xb4cc('0x4e')][_0xb4cc('0x4f')](_0x4490ea);})[_0xb4cc('0x31')](function(_0x22fc9a){_0x1ce892[_0xb4cc('0x50')]=_0x22fc9a;return _0x1ce892;})['then'](respondWithFilteredResult(_0x44b56d,_0x4490ea))[_0xb4cc('0x25')](handleError(_0x44b56d,null));};exports[_0xb4cc('0x51')]=function(_0x162f14,_0x1b4e81){var _0x1896dc={'raw':!![],'where':{'id':_0x162f14[_0xb4cc('0x52')]['id']}},_0xbd8de8={};_0xbd8de8['model']=_[_0xb4cc('0x3b')](db[_0xb4cc('0x4e')]['rawAttributes']);_0xbd8de8[_0xb4cc('0x3a')]=_[_0xb4cc('0x3b')](_0x162f14[_0xb4cc('0x3a')]);_0xbd8de8[_0xb4cc('0x3c')]=_['intersection'](_0xbd8de8[_0xb4cc('0x39')],_0xbd8de8['query']);_0x1896dc[_0xb4cc('0x3d')]=_['intersection'](_0xbd8de8['model'],qs[_0xb4cc('0x3f')](_0x162f14[_0xb4cc('0x3a')][_0xb4cc('0x3f')]));_0x1896dc['attributes']=_0x1896dc[_0xb4cc('0x3d')][_0xb4cc('0x40')]?_0x1896dc[_0xb4cc('0x3d')]:_0xbd8de8[_0xb4cc('0x39')];if(_0x162f14[_0xb4cc('0x3a')]['includeAll']){_0x1896dc[_0xb4cc('0x4d')]=[{'all':!![]}];}_0x1896dc=_[_0xb4cc('0x47')]({},_0x1896dc,_0x162f14['options']);return db[_0xb4cc('0x4e')][_0xb4cc('0x53')](_0x1896dc)[_0xb4cc('0x31')](handleEntityNotFound(_0x1b4e81,null))['then'](respondWithResult(_0x1b4e81,null))[_0xb4cc('0x25')](handleError(_0x1b4e81,null));};exports[_0xb4cc('0x54')]=function(_0x4ccbd7,_0x5c5a3e){return db[_0xb4cc('0x4e')]['create'](_0x4ccbd7[_0xb4cc('0x55')],{})[_0xb4cc('0x31')](respondWithResult(_0x5c5a3e,0xc9))['catch'](handleError(_0x5c5a3e,null));};exports[_0xb4cc('0x56')]=function(_0x2a0c11,_0x350842){if(_0x2a0c11[_0xb4cc('0x55')]['id']){delete _0x2a0c11[_0xb4cc('0x55')]['id'];}return db['SmsMessage'][_0xb4cc('0x53')]({'where':{'id':_0x2a0c11['params']['id']}})[_0xb4cc('0x31')](handleEntityNotFound(_0x350842,null))[_0xb4cc('0x31')](saveUpdates(_0x2a0c11[_0xb4cc('0x55')],null))['then'](respondWithResult(_0x350842,null))[_0xb4cc('0x25')](handleError(_0x350842,null));};exports[_0xb4cc('0x57')]=function(_0x3b4f28,_0x5d26f2){return db[_0xb4cc('0x4e')][_0xb4cc('0x53')]({'where':{'id':_0x3b4f28[_0xb4cc('0x52')]['id']}})['then'](handleEntityNotFound(_0x5d26f2,null))[_0xb4cc('0x31')](removeEntity(_0x5d26f2,null))[_0xb4cc('0x25')](handleError(_0x5d26f2,null));};exports[_0xb4cc('0x58')]=function(_0xd65693,_0x39d2ac){return db['SmsMessage'][_0xb4cc('0x58')]()[_0xb4cc('0x31')](respondWithResult(_0x39d2ac,null))[_0xb4cc('0x25')](handleError(_0x39d2ac,null));};var interaction_log=require(_0xb4cc('0x59'))(_0xb4cc('0x5a'));exports[_0xb4cc('0x5b')]=function(_0xc2a99c,_0x31d28c,_0x36537a){var _0x491aaa={'agent':{},'channel':_0xb4cc('0x5c')};if(_0xc2a99c['body']['id']){delete _0xc2a99c[_0xb4cc('0x55')]['id'];}_0xc2a99c[_0xb4cc('0x55')]['read']=!![];_0xc2a99c[_0xb4cc('0x55')]['readAt']=moment()[_0xb4cc('0x5d')](_0xb4cc('0x5e'));_0xc2a99c['body'][_0xb4cc('0x5f')]=_0xc2a99c[_0xb4cc('0x55')][_0xb4cc('0x5f')]||_0xc2a99c[_0xb4cc('0x60')]['id'];_0x491aaa[_0xb4cc('0x61')]['id']=_0xc2a99c['body'][_0xb4cc('0x5f')];return db['SmsMessage'][_0xb4cc('0x53')]({'where':{'id':_0xc2a99c[_0xb4cc('0x52')]['id'],'UserId':null}})[_0xb4cc('0x31')](handleEntityNotFound(_0x31d28c,null))[_0xb4cc('0x31')](saveUpdates(_0xc2a99c[_0xb4cc('0x55')],null))[_0xb4cc('0x31')](function(_0x20215d){if(_0x20215d){_0x491aaa[_0xb4cc('0x24')]=_0x20215d[_0xb4cc('0x62')]({'plain':!![]});return db[_0xb4cc('0x63')]['find']({'where':{'id':_0x20215d['SmsInteractionId']}});}return null;})[_0xb4cc('0x31')](handleEntityNotFound(_0x31d28c,null))[_0xb4cc('0x31')](function(_0x3e36c1){if(_0x3e36c1){return _0x3e36c1['update']({'UserId':_0xc2a99c[_0xb4cc('0x55')][_0xb4cc('0x5f')],'read1stAt':_[_0xb4cc('0x64')](_0x3e36c1[_0xb4cc('0x65')])?moment()[_0xb4cc('0x5d')](_0xb4cc('0x5e')):undefined});}return null;})[_0xb4cc('0x31')](function(_0x33ea50){if(_0x33ea50){_0x491aaa[_0xb4cc('0x66')]=_0x33ea50['get']({'plain':!![]});interaction_log[_0xb4cc('0x1d')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xc2a99c[_0xb4cc('0x60')]['id'],_0xc2a99c[_0xb4cc('0x60')]['name'],_0xc2a99c[_0xb4cc('0x60')][_0xb4cc('0x67')],_0x491aaa['interaction']['id'],_0xc2a99c[_0xb4cc('0x55')]?JSON[_0xb4cc('0x21')](_0xc2a99c['body']):_0xb4cc('0x68'));return respondWithRpcPromise(_0xb4cc('0x69'),_0xb4cc('0x6a'),_0x491aaa);}return null;})[_0xb4cc('0x31')](function(_0xc7874){var _0x36339f=_0xb4cc('0x6b')+_0xc7874[_0xb4cc('0x24')][_0xb4cc('0x6c')];return db[_0xb4cc('0x6d')][_0xb4cc('0x3a')](_0x36339f,{'type':db[_0xb4cc('0x6e')][_0xb4cc('0x6f')][_0xb4cc('0x70')],'raw':!![]})[_0xb4cc('0x31')](function(_0x5300cd){return _0x5300cd;});})[_0xb4cc('0x31')](function(_0x15fb52){if(_0x15fb52){_0x491aaa[_0xb4cc('0x24')][_0xb4cc('0x71')]=_0x15fb52[0x0];if(!_0xc2a99c[_0xb4cc('0x55')][_0xb4cc('0x5f')])return;return db['User'][_0xb4cc('0x53')]({'where':{'id':_0xc2a99c[_0xb4cc('0x55')]['UserId'],'role':_0xb4cc('0x61')},'attributes':['id',_0xb4cc('0x34'),_0xb4cc('0x72'),_0xb4cc('0x73'),_0xb4cc('0x74')],'raw':!![]});}return null;})[_0xb4cc('0x31')](function(_0x405dd2){if(!_0x405dd2)return null;_0x491aaa[_0xb4cc('0x24')]['agent']=_0x405dd2;return _0x491aaa;})[_0xb4cc('0x31')](function(_0x228440){if(_0x228440){if(_0xc2a99c[_0xb4cc('0x55')][_0xb4cc('0x75')]){_0x491aaa[_0xb4cc('0x24')]['interface']=util[_0xb4cc('0x5d')](_0xb4cc('0x76'),_0xc2a99c[_0xb4cc('0x60')][_0xb4cc('0x34')]);_0x491aaa[_0xb4cc('0x24')][_0xb4cc('0x77')]=_0x491aaa[_0xb4cc('0x77')];_0x491aaa[_0xb4cc('0x24')]['motionChannel']=_0x491aaa['channel'];_0x491aaa[_0xb4cc('0x24')]['event']=_0xb4cc('0x5b');return respondWithRpcPromise(_0xb4cc('0x78'),'EventManager',{'event':_0xb4cc('0x79'),'message':_0x491aaa['message']},client9002)[_0xb4cc('0x31')](function(){return _0x491aaa;});}return _0x491aaa;}return null;})['then'](respondWithResult(_0x31d28c,null))[_0xb4cc('0x25')](handleError(_0x31d28c,null));};var interaction_log=require('../../config/logger')(_0xb4cc('0x5a'));exports[_0xb4cc('0x2f')]=function(_0x1ce985,_0x87ff1e,_0x5ce13e){var _0xc3b8b1={'agent':{},'channel':_0xb4cc('0x5c')};if(_0x1ce985['body']['id']){delete _0x1ce985[_0xb4cc('0x55')]['id'];}_0x1ce985[_0xb4cc('0x55')]['UserId']=_0x1ce985['body']['UserId']||_0x1ce985['user']['id'];_0xc3b8b1[_0xb4cc('0x61')]['id']=_0x1ce985[_0xb4cc('0x55')]['UserId'];return db[_0xb4cc('0x4e')][_0xb4cc('0x53')]({'where':{'id':_0x1ce985[_0xb4cc('0x52')]['id'],'UserId':null}})[_0xb4cc('0x31')](handleEntityNotFound(_0x87ff1e,null))['then'](function(_0x377e57){if(_0x377e57){_0xc3b8b1[_0xb4cc('0x24')]=_0x377e57['get']({'plain':!![]});return db[_0xb4cc('0x63')][_0xb4cc('0x53')]({'where':{'id':_0x377e57[_0xb4cc('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x87ff1e,null))[_0xb4cc('0x31')](function(_0x138709){if(_0x138709){_0xc3b8b1[_0xb4cc('0x66')]=_0x138709[_0xb4cc('0x62')]({'plain':!![]});interaction_log['info'](_0xb4cc('0x7b'),_0x1ce985['user']['id'],_0x1ce985[_0xb4cc('0x60')][_0xb4cc('0x34')],_0x1ce985[_0xb4cc('0x60')][_0xb4cc('0x67')],_0xc3b8b1[_0xb4cc('0x66')]['id'],_0x1ce985[_0xb4cc('0x55')]?JSON[_0xb4cc('0x21')](_0x1ce985['body']):_0xb4cc('0x68'));return respondWithRpcPromise('RejectMessage',_0xb4cc('0x7c'),_0xc3b8b1);}return null;})[_0xb4cc('0x31')](function(_0x402743){var _0x41d110=_0xb4cc('0x6b')+_0x402743[_0xb4cc('0x24')][_0xb4cc('0x6c')];return db[_0xb4cc('0x6d')][_0xb4cc('0x3a')](_0x41d110,{'type':db[_0xb4cc('0x6e')]['QueryTypes'][_0xb4cc('0x70')],'raw':!![]})[_0xb4cc('0x31')](function(_0x4f8074){return _0x4f8074;});})['then'](function(_0x26765f){if(_0x26765f){_0xc3b8b1[_0xb4cc('0x24')][_0xb4cc('0x71')]=_0x26765f[0x0];if(!_0x1ce985[_0xb4cc('0x55')][_0xb4cc('0x5f')])return;return db[_0xb4cc('0x7d')][_0xb4cc('0x53')]({'where':{'id':_0x1ce985[_0xb4cc('0x55')][_0xb4cc('0x5f')],'role':_0xb4cc('0x61')},'attributes':['id',_0xb4cc('0x34'),_0xb4cc('0x72'),'email','internal'],'raw':!![]});}return null;})[_0xb4cc('0x31')](function(_0x31eda6){if(!_0x31eda6)return null;_0xc3b8b1['message'][_0xb4cc('0x61')]=_0x31eda6;return _0xc3b8b1;})['then'](function(_0xd6f8df){if(_0xd6f8df){_0xd6f8df[_0xb4cc('0x24')][_0xb4cc('0x7e')]=util[_0xb4cc('0x5d')](_0xb4cc('0x76'),_0x1ce985[_0xb4cc('0x60')][_0xb4cc('0x34')]);_0xd6f8df[_0xb4cc('0x24')][_0xb4cc('0x77')]=_0xc3b8b1[_0xb4cc('0x77')];_0xd6f8df[_0xb4cc('0x24')]['motionChannel']=_0xc3b8b1[_0xb4cc('0x77')];_0xd6f8df[_0xb4cc('0x24')][_0xb4cc('0x7f')]=_0xb4cc('0x2f');respondWithRpcPromise(_0xb4cc('0x78'),_0xb4cc('0x78'),{'event':_0xb4cc('0x80'),'message':_0xd6f8df[_0xb4cc('0x24')]},client9002);return _0xc3b8b1;}return null;})[_0xb4cc('0x31')](respondWithResult(_0x87ff1e,null))[_0xb4cc('0x25')](handleError(_0x87ff1e,null));};exports[_0xb4cc('0x26')]=function(_0x5a0a19,_0x18377f,_0x3dc004){if(_0x5a0a19[_0xb4cc('0x55')]['id']){delete _0x5a0a19[_0xb4cc('0x55')]['id'];}var _0x2bf848;return db[_0xb4cc('0x4e')]['find']({'where':{'id':_0x5a0a19[_0xb4cc('0x52')]['id']}})['then'](handleEntityNotFound(_0x18377f,null))['then'](function(_0x28549b){if(_0x28549b){_0x2bf848=_0x28549b;return db['SmsAccount']['find']({'where':{'id':_0x28549b['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x18377f,null))[_0xb4cc('0x31')](function(_0x3ab3d1){if(_0x3ab3d1){logger[_0xb4cc('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4cc('0x26'),'received\x20delivery\x20report\x20from',_0x3ab3d1['type'],util[_0xb4cc('0x81')](_0x5a0a19['body'],{'showHidden':![],'depth':null}));switch(_0x3ab3d1[_0xb4cc('0x48')]){case _0xb4cc('0x82'):if(_0x5a0a19['body'][_0xb4cc('0x83')]&&_0x5a0a19[_0xb4cc('0x55')][_0xb4cc('0x83')]===_0x2bf848[_0xb4cc('0x84')]){return _0x2bf848[_0xb4cc('0x56')]({'read':!![]});}else{logger[_0xb4cc('0x22')](_0xb4cc('0x85'),_0xb4cc('0x26'),_0xb4cc('0x82'),util['inspect'](_0x5a0a19[_0xb4cc('0x55')],{'showHidden':![],'depth':null}));}break;case _0xb4cc('0x86'):if(_0x5a0a19[_0xb4cc('0x55')][_0xb4cc('0x87')]&&_0x5a0a19['body']['MessageUUID']===_0x2bf848[_0xb4cc('0x84')]&&_[_0xb4cc('0x88')](['sent','delivered'],_0x5a0a19[_0xb4cc('0x55')][_0xb4cc('0x89')])>=0x0){return _0x2bf848[_0xb4cc('0x56')]({'read':!![]});}else{logger[_0xb4cc('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb4cc('0x26'),'plivio',util[_0xb4cc('0x81')](_0x5a0a19[_0xb4cc('0x55')],{'showHidden':![],'depth':null}));}break;case _0xb4cc('0x8a'):var _0x21140f=_0x5a0a19['body'][_0xb4cc('0x8b')][0x0];if(_0x21140f[_0xb4cc('0x26')]['groupName']==='DELIVERED'){return _0x2bf848[_0xb4cc('0x56')]({'read':!![]});}else{logger[_0xb4cc('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb4cc('0x26'),_0xb4cc('0x8a'),util[_0xb4cc('0x81')](_0x5a0a19[_0xb4cc('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x2bf848;}})[_0xb4cc('0x31')](respondWithResult(_0x18377f,null))[_0xb4cc('0x25')](handleError(_0x18377f,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 618301f..37baec0 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 _0x8f66=['SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x583d9f,_0x4a9ab8){var _0x5c44fc=function(_0x1e7262){while(--_0x1e7262){_0x583d9f['push'](_0x583d9f['shift']());}};_0x5c44fc(++_0x4a9ab8);}(_0x8f66,0xc4));var _0x68f6=function(_0x248f6b,_0x401324){_0x248f6b=_0x248f6b-0x0;var _0x54b829=_0x8f66[_0x248f6b];return _0x54b829;};'use strict';var EventEmitter=require(_0x68f6('0x0'));var SmsMessage=require(_0x68f6('0x1'))['db'][_0x68f6('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x68f6('0x3')](0x0);var events={'afterCreate':_0x68f6('0x4'),'afterUpdate':_0x68f6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x153dc5){return function(_0x3b6344,_0x2b66c8,_0x2653e1){SmsMessageEvents[_0x68f6('0x6')](_0x153dc5+':'+_0x3b6344['id'],_0x3b6344);SmsMessageEvents[_0x68f6('0x6')](_0x153dc5,_0x3b6344);_0x2653e1(null);};}for(var e in events){if(events[_0x68f6('0x7')](e)){var event=events[e];SmsMessage[_0x68f6('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xfc79=['save','update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x152ec6,_0x47ab28){var _0x2fc55b=function(_0x1b0d76){while(--_0x1b0d76){_0x152ec6['push'](_0x152ec6['shift']());}};_0x2fc55b(++_0x47ab28);}(_0xfc79,0x1d2));var _0x9fc7=function(_0x11659e,_0x3b9a03){_0x11659e=_0x11659e-0x0;var _0x3359c9=_0xfc79[_0x11659e];return _0x3359c9;};'use strict';var EventEmitter=require(_0x9fc7('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x9fc7('0x1')](0x0);var events={'afterCreate':_0x9fc7('0x2'),'afterUpdate':_0x9fc7('0x3'),'afterDestroy':_0x9fc7('0x4')};function emitEvent(_0x1b860){return function(_0x13ce9a,_0x59deb5,_0x43c906){SmsMessageEvents[_0x9fc7('0x5')](_0x1b860+':'+_0x13ce9a['id'],_0x13ce9a);SmsMessageEvents['emit'](_0x1b860,_0x13ce9a);_0x43c906(null);};}for(var e in events){if(events[_0x9fc7('0x6')](e)){var event=events[e];SmsMessage[_0x9fc7('0x7')](e,emitEvent(event));}}module[_0x9fc7('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 c040f6e..ab3c1bc 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 _0x4933=['clickatell','https://platform.clickatell.com/messages','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','../../config/environment','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','SmsInteraction','then','update','out','SmsAccount','find','SmsAccountId','type','twilio','authToken','phone','accountSid','create','sid','catch','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','https://api.skebby.it/API/v1.0/REST/','username','sender','login?username=','&password=','password','GET','split','sms','POST','user_key','session_key','total_sent','smsMethod','deliveryReport','read','inspect','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','xCALLY\x20Motion','format','Basic\x20%s','toString','base64','http_code','data','messages','message_id','clickSend','plivo','authId','remote','/api/sms/messages/','/status?token=','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','token','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4933,0xfd));var _0x3493=function(_0x20aae1,_0x51efd4){_0x20aae1=_0x20aae1-0x0;var _0x510601=_0x4933[_0x20aae1];return _0x510601;};'use strict';var _=require(_0x3493('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3493('0x1'));var moment=require('moment');var BPromise=require(_0x3493('0x2'));var rp=require(_0x3493('0x3'));var fs=require('fs');var path=require(_0x3493('0x4'));var rimraf=require('rimraf');var config=require(_0x3493('0x5'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x473cae,_0x5e9e3a){return _0x473cae[_0x3493('0x6')]('SmsMessage',attributes,{'tableName':_0x3493('0x7'),'paranoid':![],'indexes':[{'name':_0x3493('0x8'),'fields':[_0x3493('0x8')]},{'name':_0x3493('0x9'),'fields':[_0x3493('0xa')],'type':_0x3493('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32611e,_0xd575aa,_0x2dd184){var _0xa487be=_0x473cae[_0x3493('0xc')];var _0x405ad9=_0x32611e['get']({'plain':!![]});if(_0x405ad9[_0x3493('0xd')]['toLowerCase']()==='in'||_0x405ad9['direction'][_0x3493('0xe')]()==='out'&&!_0x405ad9[_0x3493('0xf')]&&!_[_0x3493('0x10')](_0x405ad9[_0x3493('0x11')])&&!_['isNil'](_0x405ad9[_0x3493('0x12')])){_0xa487be[_0x3493('0x13')]['findOne']({'where':{'id':_0x405ad9[_0x3493('0x12')]}})[_0x3493('0x14')](function(_0x53fdae){if(_0x53fdae){_0x53fdae[_0x3493('0x15')]({'lastMsgAt':_0x405ad9['createdAt'],'lastMsgDirection':_0x405ad9['direction']['toLowerCase']()});}})['catch'](function(_0x2ac974){console['error'](_0x2ac974);});}if(_0x405ad9['direction']===_0x3493('0x16')&&!_0x405ad9[_0x3493('0xf')]){var _0x454f37;_0xa487be[_0x3493('0x17')][_0x3493('0x18')]({'where':{'id':_0x405ad9[_0x3493('0x19')]},'raw':!![]})[_0x3493('0x14')](function(_0x1f7857){_0x454f37=_0x1f7857;if(_0x454f37&&_0x454f37[_0x3493('0x1a')]){switch(_0x454f37['type']){case _0x3493('0x1b'):var _0x3b8350=require('twilio');if(_0x454f37['accountSid']&&_0x454f37[_0x3493('0x1c')]&&_0x454f37[_0x3493('0x1d')]){var _0x5b2406=new _0x3b8350(_0x454f37[_0x3493('0x1e')],_0x454f37[_0x3493('0x1c')]);_0x5b2406['messages'][_0x3493('0x1f')]({'body':_0x405ad9[_0x3493('0xa')],'to':_0x405ad9[_0x3493('0x1d')],'from':_0x454f37[_0x3493('0x1d')],'statusCallback':_0x454f37['remote']+'/api/sms/messages/'+_0x405ad9['id']+'/status?token='+_0x454f37['token']})[_0x3493('0x14')](function(_0x809e6c){if(_0x809e6c[_0x3493('0x20')]){return _0x32611e[_0x3493('0x15')]({'messageId':_0x809e6c['sid']});}})[_0x3493('0x21')](function(_0x2867fc){logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),_0x3493('0x1b'),util['inspect'](_0x2867fc,{'showHidden':![],'depth':null}));});}else{logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),_0x3493('0x1b'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x1d1ad2=_0x3493('0x25');if(_0x454f37[_0x3493('0x26')]&&_0x454f37['password']){var _0x14da2f={'recipient':[_0x405ad9[_0x3493('0x1d')]],'message':_0x405ad9[_0x3493('0xa')],'message_type':_0x454f37['smsMethod']};if(_0x454f37['smsMethod']&&_0x454f37['smsMethod']!=='SI'){_0x14da2f[_0x3493('0x27')]=_0x454f37[_0x3493('0x1d')];}var _0x448451={'url':_0x1d1ad2+_0x3493('0x28')+_0x454f37[_0x3493('0x26')]+_0x3493('0x29')+_0x454f37[_0x3493('0x2a')],'method':_0x3493('0x2b')};rp(_0x448451)[_0x3493('0x14')](function(_0x1b7c1b){var _0x3828c2=_0x1b7c1b[_0x3493('0x2c')](';');var _0x130038={'user_key':_0x3828c2[0x0],'session_key':_0x3828c2[0x1]};_0x448451={'url':_0x1d1ad2+_0x3493('0x2d'),'method':_0x3493('0x2e'),'headers':{'user_key':_0x130038[_0x3493('0x2f')],'Session_key':_0x130038[_0x3493('0x30')]},'json':!![],'body':_0x14da2f};return rp(_0x448451);})[_0x3493('0x14')](function(_0x3eee99){if(_0x3eee99[_0x3493('0x31')]>=0x1){var _0x2e7507={'messageId':_0x3eee99['internal_order_id']};if(_0x454f37[_0x3493('0x32')]!=='GP'||!_0x454f37[_0x3493('0x33')]){_0x2e7507[_0x3493('0x34')]=!![];}return _0x32611e[_0x3493('0x15')](_0x2e7507);}else{return logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),'skebby',util[_0x3493('0x35')](_0x3eee99,{'showHidden':![],'depth':null}));}})['catch'](function(_0x142060){return logger[_0x3493('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3493('0x24'),_0x3493('0x36'),util[_0x3493('0x35')](_0x142060,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3493('0x23'),'afterCreate',_0x3493('0x36'),_0x3493('0x37'));}break;case _0x3493('0x38'):if(_0x454f37[_0x3493('0x1c')]){var _0x18c99e={'recipient':_0x405ad9['phone'],'message':_0x405ad9[_0x3493('0xa')],'sender':_0x454f37[_0x3493('0x39')]||_0x454f37[_0x3493('0x1d')],'authorization':_0x454f37['authToken']};var _0xd575aa={'method':'POST','uri':_0x3493('0x3a'),'body':_0x18c99e,'json':!![]};rp(_0xd575aa)[_0x3493('0x14')](function(_0x11a74a){var _0x527b42={'messageId':_0x11a74a[_0x3493('0x3b')]};if(!_0x454f37[_0x3493('0x33')]){_0x527b42['read']=!![];}return _0x32611e[_0x3493('0x15')](_0x527b42);})[_0x3493('0x21')](function(_0x244846){logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),_0x3493('0x38'),util[_0x3493('0x35')](_0x244846,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3493('0x23'),_0x3493('0x24'),_0x3493('0x38'),'Missing\x20parameters:\x20authToken');}break;case _0x3493('0x3c'):if(_0x454f37['username']&&_0x454f37[_0x3493('0x2a')]){var _0x18c99e={'messages':[{'source':_0x3493('0x3d'),'to':_0x405ad9['phone'],'body':_0x405ad9['body'],'from':_0x454f37[_0x3493('0x39')]||_0x454f37['phone']}]};var _0x48ea03=util[_0x3493('0x3e')]('%s:%s',_0x454f37['username'],_0x454f37['password']);var _0xd575aa={'method':_0x3493('0x2e'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x18c99e,'headers':{'Authorization':util[_0x3493('0x3e')](_0x3493('0x3f'),new Buffer(_0x48ea03)[_0x3493('0x40')](_0x3493('0x41')))},'json':!![]};rp(_0xd575aa)[_0x3493('0x14')](function(_0x171209){if(_0x171209[_0x3493('0x42')]>=0xc8&&_0x171209['http_code']<=0xce){if(_0x171209[_0x3493('0x43')]&&_0x171209['data']['queued_count']>0x0){var _0xf5e01e=_['head'](_0x171209[_0x3493('0x43')][_0x3493('0x44')]);var _0xbfc64f={'messageId':_0xf5e01e[_0x3493('0x45')]};if(!_0x454f37[_0x3493('0x33')]){_0xbfc64f[_0x3493('0x34')]=!![];}return _0x32611e['update'](_0xbfc64f);}else{logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),_0x3493('0x46'),util[_0x3493('0x35')](_0x171209,{'showHidden':![],'depth':null}));}}else{logger[_0x3493('0x22')](_0x3493('0x23'),'afterCreate','clickSend',util[_0x3493('0x35')](_0x171209,{'showHidden':![],'depth':null}));}})[_0x3493('0x21')](function(_0x3de6e3){logger[_0x3493('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3493('0x24'),_0x3493('0x46'),util[_0x3493('0x35')](_0x3de6e3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3493('0x23'),_0x3493('0x24'),'clickSend',_0x3493('0x37'));}break;case _0x3493('0x47'):if(_0x454f37[_0x3493('0x48')]&&_0x454f37[_0x3493('0x1c')]){var _0x18c99e={'dst':_0x405ad9[_0x3493('0x1d')],'text':_0x405ad9[_0x3493('0xa')],'src':_0x454f37[_0x3493('0x39')]||_0x454f37['phone'],'url':_0x454f37[_0x3493('0x49')]+_0x3493('0x4a')+_0x405ad9['id']+_0x3493('0x4b')+_0x454f37['token']};var _0x48ea03=util['format'](_0x3493('0x4c'),_0x454f37['authId'],_0x454f37[_0x3493('0x1c')]);var _0xd575aa={'method':_0x3493('0x2e'),'uri':util[_0x3493('0x3e')](_0x3493('0x4d'),_0x454f37[_0x3493('0x48')]),'body':_0x18c99e,'headers':{'Authorization':util[_0x3493('0x3e')](_0x3493('0x3f'),new Buffer(_0x48ea03)[_0x3493('0x40')](_0x3493('0x41')))},'json':!![]};rp(_0xd575aa)[_0x3493('0x14')](function(_0x332f56){var _0x447475={'messageId':_0x332f56[_0x3493('0x4e')][0x0]};return _0x32611e['update'](_0x447475);})[_0x3493('0x21')](function(_0xe656b9){logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),_0x3493('0x47'),util[_0x3493('0x35')](_0xe656b9,{'showHidden':![],'depth':null}));});}else{logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),_0x3493('0x47'),_0x3493('0x4f'));}break;case _0x3493('0x50'):if(_0x454f37[_0x3493('0x26')]&&_0x454f37[_0x3493('0x2a')]){if(_0x454f37[_0x3493('0x51')]){var _0x4db193={'method':_0x3493('0x2e'),'uri':_0x454f37[_0x3493('0x51')]+_0x3493('0x52'),'body':{'username':_0x454f37[_0x3493('0x26')],'password':_0x454f37[_0x3493('0x2a')]},'json':!![]};return rp(_0x4db193)[_0x3493('0x14')](function(_0x16388e){var _0x1649aa={'method':_0x3493('0x2e'),'uri':_0x454f37[_0x3493('0x51')]+_0x3493('0x53'),'body':{'messages':[{'from':_0x454f37[_0x3493('0x1d')],'destinations':[{'to':_0x405ad9[_0x3493('0x1d')]}],'text':_0x405ad9[_0x3493('0xa')],'notifyUrl':_0x454f37[_0x3493('0x49')]+'/api/sms/messages/'+_0x405ad9['id']+_0x3493('0x4b')+_0x454f37[_0x3493('0x54')],'notifyContentType':_0x3493('0x55'),'callbackData':_0x454f37['phone']+';'+_0x405ad9[_0x3493('0xa')]}]},'headers':{'Authorization':_0x3493('0x56')+_0x16388e['token']},'json':!![]};return rp(_0x1649aa)['then'](function(_0x483a5d){if(_0x483a5d[_0x3493('0x44')]){var _0x3fe5b4={'messageId':_0x483a5d[_0x3493('0x44')][0x0][_0x3493('0x8')]};if(!_0x454f37[_0x3493('0x33')]){_0x3fe5b4[_0x3493('0x34')]=!![];}return _0x32611e[_0x3493('0x15')](_0x3fe5b4);}else{return logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),'infobip',util[_0x3493('0x35')](_0x483a5d,{'showHidden':![],'depth':null}));}});})[_0x3493('0x21')](function(_0x6bed60){return logger['error'](_0x3493('0x23'),_0x3493('0x24'),_0x3493('0x50'),util[_0x3493('0x35')](_0x6bed60,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3493('0x24'),_0x3493('0x50'),_0x3493('0x57'));}}else{logger['error'](_0x3493('0x23'),_0x3493('0x24'),_0x3493('0x50'),_0x3493('0x37'));}break;case _0x3493('0x58'):var _0x401191=require(_0x3493('0x59'));if(_0x454f37[_0x3493('0x5a')]){var _0x1c8654={};_0x1c8654[_0x3493('0x5b')]=_0x454f37[_0x3493('0x26')];_0x1c8654[_0x3493('0x1d')]=_0x405ad9[_0x3493('0x1d')];_0x1c8654[_0x3493('0x27')]=_0x454f37[_0x3493('0x1d')];_0x1c8654[_0x3493('0x5c')]=_0x405ad9[_0x3493('0xa')];_0x1c8654[_0x3493('0x5d')]=+new Date();var _0x579df6='';var _0x2d8031='';var _0x3a1a2e=Object[_0x3493('0x5e')](_0x1c8654);_0x3a1a2e[_0x3493('0x5f')]();for(var _0x15c185=0x0;_0x15c185<_0x3a1a2e[_0x3493('0x60')];_0x15c185++){if(_0x579df6!=''){_0x579df6+='&';}_0x579df6+=_0x3a1a2e[_0x15c185]+'='+encodeURIComponent(_0x1c8654[_0x3a1a2e[_0x15c185]]);_0x2d8031+=_0x1c8654[_0x3a1a2e[_0x15c185]];}_0x2d8031+=_0x454f37[_0x3493('0x5a')];_0x2d8031=_0x401191[_0x3493('0x61')]('md5')[_0x3493('0x15')](_0x2d8031)['digest']('hex');if(_0x579df6!==''){_0x579df6+='&';}_0x579df6+='signature='+_0x2d8031;var _0x448451={'method':_0x3493('0x2b'),'uri':_0x454f37[_0x3493('0x51')]+_0x3493('0x62')+_0x579df6,'json':!![]};return rp(_0x448451)['then'](function(_0x2213b0){var _0x39ec4a=Object[_0x3493('0x5e')](_0x2213b0);if(_0x2213b0[_0x39ec4a[0x0]]['error']&&parseInt(_0x2213b0[_0x39ec4a[0x0]][_0x3493('0x22')])===0x0){var _0xf5b959={'messageId':_0x2213b0[_0x39ec4a[0x0]][_0x3493('0x63')]};if(!_0x454f37[_0x3493('0x33')]){_0xf5b959[_0x3493('0x34')]=!![];}return _0x32611e['update'](_0xf5b959);}else{return logger[_0x3493('0x22')](_0x3493('0x23'),'afterCreate',_0x3493('0x58'),util['inspect'](_0x2213b0[_0x3493('0x22')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x607b46){return logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),_0x3493('0x58'),util[_0x3493('0x35')](_0x607b46,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3493('0x24'),_0x3493('0x58'),_0x3493('0x64'));}break;case _0x3493('0x65'):if(_0x454f37['apiKey']){var _0x151072={'method':_0x3493('0x2e'),'uri':_0x3493('0x66'),'headers':{'Authorization':_0x454f37[_0x3493('0x5a')]},'body':{'content':_0x405ad9[_0x3493('0xa')],'to':[_0x405ad9['phone']],'from':_0x454f37[_0x3493('0x1d')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x151072)['then'](function(_0x2d4bac){if(!_0x2d4bac['error']){var _0x22d580={'messageId':_0x2d4bac[_0x3493('0x44')][0x0]['apiMessageId']};if(!_0x454f37[_0x3493('0x33')]){_0x22d580[_0x3493('0x34')]=!![];}return _0x32611e[_0x3493('0x15')](_0x22d580);}else{return logger['error'](_0x3493('0x23'),_0x3493('0x24'),'clickatell',util[_0x3493('0x35')](_0x2d4bac['error'],{'showHidden':![],'depth':null}));}})[_0x3493('0x21')](function(_0x2b6d30){return logger['error'](_0x3493('0x23'),'afterCreate',_0x3493('0x65'),util[_0x3493('0x35')](_0x2b6d30,{'showHidden':![],'depth':null}));});}else{logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),_0x3493('0x65'),_0x3493('0x64'));}break;case _0x3493('0x67'):if(_0x454f37['username']&&_0x454f37['password']){var _0x48ea03=util['format'](_0x3493('0x4c'),_0x454f37['username'],_0x454f37[_0x3493('0x2a')]);var _0xd575aa={'method':_0x3493('0x2e'),'uri':_0x3493('0x68')+_0x454f37[_0x3493('0x69')]+_0x3493('0x6a'),'body':{'to':[_0x405ad9[_0x3493('0x1d')]],'text':_0x405ad9[_0x3493('0xa')],'from':_0x454f37['phone'],'applicationId':_0x454f37[_0x3493('0x6b')]},'headers':{'Authorization':util[_0x3493('0x3e')](_0x3493('0x3f'),new Buffer(_0x48ea03)[_0x3493('0x40')]('base64'))},'json':!![]};rp(_0xd575aa)[_0x3493('0x14')](function(_0xd189be){if(_0xd189be['id']){var _0x48c49e={'messageId':_0xd189be['id']};return _0x32611e[_0x3493('0x15')](_0x48c49e);}else{logger[_0x3493('0x22')](_0x3493('0x23'),'afterCreate',_0x3493('0x67'),util[_0x3493('0x35')](_0xd189be,{'showHidden':![],'depth':null}));}})[_0x3493('0x21')](function(_0x1bb06b){logger[_0x3493('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth',util['inspect'](_0x1bb06b,{'showHidden':![],'depth':null}));});}else{logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),'bandwidth',_0x3493('0x37'));}break;case'intelepeer':if(_0x454f37[_0x3493('0x5a')]){var _0x5690d1={};var _0x448451={'method':_0x3493('0x2e'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x3493('0x6c')+_0x454f37[_0x3493('0x5a')],'Content-Type':'application/json'},'body':{'from':_0x454f37['phone'],'to':_0x405ad9[_0x3493('0x1d')],'text':_0x405ad9[_0x3493('0xa')]},'json':!![]};return rp(_0x448451)[_0x3493('0x14')](function(_0x1a9856){if(_0x1a9856[_0x3493('0x6d')]==0xca){_0x5690d1[_0x3493('0x6e')]=_0x1a9856;var _0xf670e1={'method':_0x3493('0x2e'),'uri':_0x3493('0x6f'),'headers':{'Authorization':_0x3493('0x6c')+_0x454f37[_0x3493('0x5a')],'Content-Type':_0x3493('0x55')},'body':{'refid':_0x5690d1[_0x3493('0x6e')]['refid']},'json':!![]};return rp(_0xf670e1)[_0x3493('0x14')](function(_0x5e5eea){_0x5690d1['status']=_0x5e5eea;var _0x2f6140={'messageId':_0x5690d1[_0x3493('0x6e')][_0x3493('0x70')],'read':!![]};return _0x32611e[_0x3493('0x15')](_0x2f6140);});}else{return logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),_0x3493('0x71'),util['inspect'](_0x1a9856,{'showHidden':![],'depth':null}));}})['catch'](function(_0x371497){return logger[_0x3493('0x22')](_0x3493('0x23'),_0x3493('0x24'),'intelepeer',util[_0x3493('0x35')](_0x371497,{'showHidden':![],'depth':null}));});}else{return logger[_0x3493('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3493('0x24'),_0x3493('0x71'),_0x3493('0x72'));}break;}}})[_0x3493('0x73')](function(){_0x2dd184();});}else{_0x2dd184();}}},'charset':_0x3493('0x74'),'collate':_0x3493('0x75')});}; \ No newline at end of file +var _0x7d71=['inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','POST','user_key','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','message_id','clickSend','plivo','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/status?token=','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','timestamp','keys','sort','length','apiKey','createHash','digest','hex','signature=','GET','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','utf8mb4','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','body','models','get','direction','toLowerCase','out','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate'];(function(_0x5dc89d,_0x53dd2c){var _0x3a18c2=function(_0x1989f7){while(--_0x1989f7){_0x5dc89d['push'](_0x5dc89d['shift']());}};_0x3a18c2(++_0x53dd2c);}(_0x7d71,0x137));var _0x17d7=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7d71[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x17d7('0x0'));var util=require(_0x17d7('0x1'));var logger=require('../../config/logger')(_0x17d7('0x2'));var moment=require('moment');var BPromise=require(_0x17d7('0x3'));var rp=require(_0x17d7('0x4'));var fs=require('fs');var path=require(_0x17d7('0x5'));var rimraf=require(_0x17d7('0x6'));var config=require(_0x17d7('0x7'));var attributes=require('./smsMessage.attributes');module[_0x17d7('0x8')]=function(_0x24b8c3,_0xa436c6){return _0x24b8c3[_0x17d7('0x9')](_0x17d7('0xa'),attributes,{'tableName':_0x17d7('0xb'),'paranoid':![],'indexes':[{'name':_0x17d7('0xc'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0x17d7('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x55229e,_0x36b36b,_0x38167f){var _0x8a5731=_0x24b8c3[_0x17d7('0xe')];var _0x855ea3=_0x55229e[_0x17d7('0xf')]({'plain':!![]});if(_0x855ea3[_0x17d7('0x10')][_0x17d7('0x11')]()==='in'||_0x855ea3[_0x17d7('0x10')][_0x17d7('0x11')]()===_0x17d7('0x12')&&!_0x855ea3['secret']&&!_[_0x17d7('0x13')](_0x855ea3['UserId'])&&!_['isNil'](_0x855ea3[_0x17d7('0x14')])){_0x8a5731[_0x17d7('0x15')][_0x17d7('0x16')]({'where':{'id':_0x855ea3[_0x17d7('0x14')]}})[_0x17d7('0x17')](function(_0x1dbe14){if(_0x1dbe14){_0x1dbe14[_0x17d7('0x18')]({'lastMsgAt':_0x855ea3[_0x17d7('0x19')],'lastMsgDirection':_0x855ea3[_0x17d7('0x10')]['toLowerCase']()});}})[_0x17d7('0x1a')](function(_0x37a44e){console[_0x17d7('0x1b')](_0x37a44e);});}if(_0x855ea3['direction']===_0x17d7('0x12')&&!_0x855ea3['secret']){var _0x104b77;_0x8a5731[_0x17d7('0x1c')][_0x17d7('0x1d')]({'where':{'id':_0x855ea3[_0x17d7('0x1e')]},'raw':!![]})[_0x17d7('0x17')](function(_0x496db2){_0x104b77=_0x496db2;if(_0x104b77&&_0x104b77[_0x17d7('0x1f')]){switch(_0x104b77[_0x17d7('0x1f')]){case _0x17d7('0x20'):var _0x440756=require(_0x17d7('0x20'));if(_0x104b77[_0x17d7('0x21')]&&_0x104b77[_0x17d7('0x22')]&&_0x104b77['phone']){var _0x2ff46a=new _0x440756(_0x104b77[_0x17d7('0x21')],_0x104b77[_0x17d7('0x22')]);_0x2ff46a[_0x17d7('0x23')][_0x17d7('0x24')]({'body':_0x855ea3[_0x17d7('0xd')],'to':_0x855ea3['phone'],'from':_0x104b77[_0x17d7('0x25')],'statusCallback':_0x104b77[_0x17d7('0x26')]+'/api/sms/messages/'+_0x855ea3['id']+'/status?token='+_0x104b77[_0x17d7('0x27')]})[_0x17d7('0x17')](function(_0x3c1d8f){if(_0x3c1d8f['sid']){return _0x55229e[_0x17d7('0x18')]({'messageId':_0x3c1d8f[_0x17d7('0x28')]});}})['catch'](function(_0x12f3a5){logger[_0x17d7('0x1b')](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x20'),util[_0x17d7('0x2b')](_0x12f3a5,{'showHidden':![],'depth':null}));});}else{logger[_0x17d7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17d7('0x2a'),'twilio',_0x17d7('0x2c'));}break;case _0x17d7('0x2d'):var _0x2b48d0=_0x17d7('0x2e');if(_0x104b77[_0x17d7('0x2f')]&&_0x104b77[_0x17d7('0x30')]){var _0x5e035e={'recipient':[_0x855ea3[_0x17d7('0x25')]],'message':_0x855ea3['body'],'message_type':_0x104b77[_0x17d7('0x31')]};if(_0x104b77['smsMethod']&&_0x104b77[_0x17d7('0x31')]!=='SI'){_0x5e035e[_0x17d7('0x32')]=_0x104b77[_0x17d7('0x25')];}var _0x1013fc={'url':_0x2b48d0+_0x17d7('0x33')+_0x104b77['username']+_0x17d7('0x34')+_0x104b77[_0x17d7('0x30')],'method':'GET'};rp(_0x1013fc)[_0x17d7('0x17')](function(_0x21d62f){var _0x569cba=_0x21d62f[_0x17d7('0x35')](';');var _0x37b931={'user_key':_0x569cba[0x0],'session_key':_0x569cba[0x1]};_0x1013fc={'url':_0x2b48d0+'sms','method':_0x17d7('0x36'),'headers':{'user_key':_0x37b931[_0x17d7('0x37')],'Session_key':_0x37b931['session_key']},'json':!![],'body':_0x5e035e};return rp(_0x1013fc);})[_0x17d7('0x17')](function(_0x4c4ca7){if(_0x4c4ca7['total_sent']>=0x1){var _0xb0c7e3={'messageId':_0x4c4ca7[_0x17d7('0x38')]};if(_0x104b77[_0x17d7('0x31')]!=='GP'||!_0x104b77['deliveryReport']){_0xb0c7e3[_0x17d7('0x39')]=!![];}return _0x55229e[_0x17d7('0x18')](_0xb0c7e3);}else{return logger[_0x17d7('0x1b')](_0x17d7('0x29'),'afterCreate','skebby',util[_0x17d7('0x2b')](_0x4c4ca7,{'showHidden':![],'depth':null}));}})['catch'](function(_0x544db3){return logger[_0x17d7('0x1b')](_0x17d7('0x29'),_0x17d7('0x2a'),'skebby',util[_0x17d7('0x2b')](_0x544db3,{'showHidden':![],'depth':null}));});}else{logger[_0x17d7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17d7('0x2a'),_0x17d7('0x2d'),_0x17d7('0x3a'));}break;case _0x17d7('0x3b'):if(_0x104b77[_0x17d7('0x22')]){var _0x433128={'recipient':_0x855ea3['phone'],'message':_0x855ea3['body'],'sender':_0x104b77[_0x17d7('0x3c')]||_0x104b77['phone'],'authorization':_0x104b77[_0x17d7('0x22')]};var _0x36b36b={'method':_0x17d7('0x36'),'uri':_0x17d7('0x3d'),'body':_0x433128,'json':!![]};rp(_0x36b36b)[_0x17d7('0x17')](function(_0x2a530b){var _0x454886={'messageId':_0x2a530b[_0x17d7('0x3e')]};if(!_0x104b77[_0x17d7('0x3f')]){_0x454886['read']=!![];}return _0x55229e[_0x17d7('0x18')](_0x454886);})[_0x17d7('0x1a')](function(_0x593887){logger[_0x17d7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17d7('0x2a'),_0x17d7('0x3b'),util[_0x17d7('0x2b')](_0x593887,{'showHidden':![],'depth':null}));});}else{logger[_0x17d7('0x1b')](_0x17d7('0x29'),_0x17d7('0x2a'),'connectel',_0x17d7('0x40'));}break;case _0x17d7('0x41'):if(_0x104b77['username']&&_0x104b77[_0x17d7('0x30')]){var _0x433128={'messages':[{'source':'xCALLY\x20Motion','to':_0x855ea3[_0x17d7('0x25')],'body':_0x855ea3[_0x17d7('0xd')],'from':_0x104b77[_0x17d7('0x3c')]||_0x104b77[_0x17d7('0x25')]}]};var _0x319c5d=util[_0x17d7('0x42')](_0x17d7('0x43'),_0x104b77[_0x17d7('0x2f')],_0x104b77[_0x17d7('0x30')]);var _0x36b36b={'method':_0x17d7('0x36'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x433128,'headers':{'Authorization':util['format'](_0x17d7('0x44'),new Buffer(_0x319c5d)[_0x17d7('0x45')](_0x17d7('0x46')))},'json':!![]};rp(_0x36b36b)['then'](function(_0x222486){if(_0x222486[_0x17d7('0x47')]>=0xc8&&_0x222486[_0x17d7('0x47')]<=0xce){if(_0x222486['data']&&_0x222486[_0x17d7('0x48')]['queued_count']>0x0){var _0x5c6d15=_['head'](_0x222486['data']['messages']);var _0x34b422={'messageId':_0x5c6d15[_0x17d7('0x49')]};if(!_0x104b77['deliveryReport']){_0x34b422[_0x17d7('0x39')]=!![];}return _0x55229e[_0x17d7('0x18')](_0x34b422);}else{logger[_0x17d7('0x1b')](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x4a'),util[_0x17d7('0x2b')](_0x222486,{'showHidden':![],'depth':null}));}}else{logger[_0x17d7('0x1b')](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x4a'),util['inspect'](_0x222486,{'showHidden':![],'depth':null}));}})[_0x17d7('0x1a')](function(_0x583cc4){logger['error'](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x4a'),util[_0x17d7('0x2b')](_0x583cc4,{'showHidden':![],'depth':null}));});}else{logger[_0x17d7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x17d7('0x4a'),_0x17d7('0x3a'));}break;case _0x17d7('0x4b'):if(_0x104b77[_0x17d7('0x4c')]&&_0x104b77['authToken']){var _0x433128={'dst':_0x855ea3[_0x17d7('0x25')],'text':_0x855ea3['body'],'src':_0x104b77['senderString']||_0x104b77['phone'],'url':_0x104b77[_0x17d7('0x26')]+_0x17d7('0x4d')+_0x855ea3['id']+'/status?token='+_0x104b77[_0x17d7('0x27')]};var _0x319c5d=util[_0x17d7('0x42')](_0x17d7('0x43'),_0x104b77[_0x17d7('0x4c')],_0x104b77[_0x17d7('0x22')]);var _0x36b36b={'method':_0x17d7('0x36'),'uri':util['format'](_0x17d7('0x4e'),_0x104b77[_0x17d7('0x4c')]),'body':_0x433128,'headers':{'Authorization':util[_0x17d7('0x42')](_0x17d7('0x44'),new Buffer(_0x319c5d)[_0x17d7('0x45')](_0x17d7('0x46')))},'json':!![]};rp(_0x36b36b)[_0x17d7('0x17')](function(_0x3b8bf2){var _0x2093df={'messageId':_0x3b8bf2[_0x17d7('0x4f')][0x0]};return _0x55229e[_0x17d7('0x18')](_0x2093df);})[_0x17d7('0x1a')](function(_0x532ab1){logger[_0x17d7('0x1b')](_0x17d7('0x29'),'afterCreate','plivo',util[_0x17d7('0x2b')](_0x532ab1,{'showHidden':![],'depth':null}));});}else{logger[_0x17d7('0x1b')](_0x17d7('0x29'),_0x17d7('0x2a'),'plivo',_0x17d7('0x50'));}break;case _0x17d7('0x51'):if(_0x104b77[_0x17d7('0x2f')]&&_0x104b77['password']){if(_0x104b77[_0x17d7('0x52')]){var _0x522ec4={'method':'POST','uri':_0x104b77[_0x17d7('0x52')]+_0x17d7('0x53'),'body':{'username':_0x104b77[_0x17d7('0x2f')],'password':_0x104b77[_0x17d7('0x30')]},'json':!![]};return rp(_0x522ec4)[_0x17d7('0x17')](function(_0x999c66){var _0x1539f4={'method':_0x17d7('0x36'),'uri':_0x104b77['baseUrl']+_0x17d7('0x54'),'body':{'messages':[{'from':_0x104b77['phone'],'destinations':[{'to':_0x855ea3['phone']}],'text':_0x855ea3[_0x17d7('0xd')],'notifyUrl':_0x104b77['remote']+'/api/sms/messages/'+_0x855ea3['id']+_0x17d7('0x55')+_0x104b77[_0x17d7('0x27')],'notifyContentType':_0x17d7('0x56'),'callbackData':_0x104b77['phone']+';'+_0x855ea3['body']}]},'headers':{'Authorization':_0x17d7('0x57')+_0x999c66[_0x17d7('0x27')]},'json':!![]};return rp(_0x1539f4)[_0x17d7('0x17')](function(_0x4cf4b5){if(_0x4cf4b5[_0x17d7('0x23')]){var _0x4d0e42={'messageId':_0x4cf4b5[_0x17d7('0x23')][0x0][_0x17d7('0xc')]};if(!_0x104b77[_0x17d7('0x3f')]){_0x4d0e42['read']=!![];}return _0x55229e[_0x17d7('0x18')](_0x4d0e42);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17d7('0x2a'),_0x17d7('0x51'),util['inspect'](_0x4cf4b5,{'showHidden':![],'depth':null}));}});})[_0x17d7('0x1a')](function(_0x5eec0d){return logger[_0x17d7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x17d7('0x51'),util[_0x17d7('0x2b')](_0x5eec0d,{'showHidden':![],'depth':null}));});}else{logger[_0x17d7('0x1b')](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x51'),_0x17d7('0x58'));}}else{logger[_0x17d7('0x1b')](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x51'),_0x17d7('0x3a'));}break;case _0x17d7('0x59'):var _0x532408=require(_0x17d7('0x5a'));if(_0x104b77['apiKey']){var _0x283b2f={};_0x283b2f[_0x17d7('0x5b')]=_0x104b77[_0x17d7('0x2f')];_0x283b2f[_0x17d7('0x25')]=_0x855ea3[_0x17d7('0x25')];_0x283b2f[_0x17d7('0x32')]=_0x104b77[_0x17d7('0x25')];_0x283b2f['text']=_0x855ea3[_0x17d7('0xd')];_0x283b2f[_0x17d7('0x5c')]=+new Date();var _0x5d89d4='';var _0x2e984a='';var _0x25bf23=Object[_0x17d7('0x5d')](_0x283b2f);_0x25bf23[_0x17d7('0x5e')]();for(var _0x56f14c=0x0;_0x56f14c<_0x25bf23[_0x17d7('0x5f')];_0x56f14c++){if(_0x5d89d4!=''){_0x5d89d4+='&';}_0x5d89d4+=_0x25bf23[_0x56f14c]+'='+encodeURIComponent(_0x283b2f[_0x25bf23[_0x56f14c]]);_0x2e984a+=_0x283b2f[_0x25bf23[_0x56f14c]];}_0x2e984a+=_0x104b77[_0x17d7('0x60')];_0x2e984a=_0x532408[_0x17d7('0x61')]('md5')[_0x17d7('0x18')](_0x2e984a)[_0x17d7('0x62')](_0x17d7('0x63'));if(_0x5d89d4!==''){_0x5d89d4+='&';}_0x5d89d4+=_0x17d7('0x64')+_0x2e984a;var _0x1013fc={'method':_0x17d7('0x65'),'uri':_0x104b77[_0x17d7('0x52')]+'/external/get/send.php?'+_0x5d89d4,'json':!![]};return rp(_0x1013fc)[_0x17d7('0x17')](function(_0x55fb9c){var _0x19ee3f=Object[_0x17d7('0x5d')](_0x55fb9c);if(_0x55fb9c[_0x19ee3f[0x0]][_0x17d7('0x1b')]&&parseInt(_0x55fb9c[_0x19ee3f[0x0]][_0x17d7('0x1b')])===0x0){var _0x23bbb0={'messageId':_0x55fb9c[_0x19ee3f[0x0]][_0x17d7('0x66')]};if(!_0x104b77[_0x17d7('0x3f')]){_0x23bbb0[_0x17d7('0x39')]=!![];}return _0x55229e[_0x17d7('0x18')](_0x23bbb0);}else{return logger['error'](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x59'),util[_0x17d7('0x2b')](_0x55fb9c[_0x17d7('0x1b')],{'showHidden':![],'depth':null}));}})[_0x17d7('0x1a')](function(_0x4c06fd){return logger[_0x17d7('0x1b')](_0x17d7('0x29'),'afterCreate',_0x17d7('0x59'),util[_0x17d7('0x2b')](_0x4c06fd,{'showHidden':![],'depth':null}));});}else{logger[_0x17d7('0x1b')](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x59'),_0x17d7('0x67'));}break;case _0x17d7('0x68'):if(_0x104b77[_0x17d7('0x60')]){var _0x7dbbb3={'method':'POST','uri':_0x17d7('0x69'),'headers':{'Authorization':_0x104b77[_0x17d7('0x60')]},'body':{'content':_0x855ea3[_0x17d7('0xd')],'to':[_0x855ea3['phone']],'from':_0x104b77[_0x17d7('0x25')],'binary':![],'clientMessageId':'uuid','charset':_0x17d7('0x6a')},'json':!![]};rp(_0x7dbbb3)[_0x17d7('0x17')](function(_0x379ea7){if(!_0x379ea7[_0x17d7('0x1b')]){var _0x3b82e3={'messageId':_0x379ea7[_0x17d7('0x23')][0x0][_0x17d7('0x6b')]};if(!_0x104b77[_0x17d7('0x3f')]){_0x3b82e3['read']=!![];}return _0x55229e['update'](_0x3b82e3);}else{return logger[_0x17d7('0x1b')](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x68'),util[_0x17d7('0x2b')](_0x379ea7[_0x17d7('0x1b')],{'showHidden':![],'depth':null}));}})[_0x17d7('0x1a')](function(_0x2016e2){return logger['error'](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x68'),util[_0x17d7('0x2b')](_0x2016e2,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell','Missing\x20parameters:\x20apiKey');}break;case _0x17d7('0x6c'):if(_0x104b77[_0x17d7('0x2f')]&&_0x104b77[_0x17d7('0x30')]){var _0x319c5d=util[_0x17d7('0x42')](_0x17d7('0x43'),_0x104b77[_0x17d7('0x2f')],_0x104b77[_0x17d7('0x30')]);var _0x36b36b={'method':_0x17d7('0x36'),'uri':_0x17d7('0x6d')+_0x104b77[_0x17d7('0x6e')]+'/messages','body':{'to':[_0x855ea3[_0x17d7('0x25')]],'text':_0x855ea3[_0x17d7('0xd')],'from':_0x104b77['phone'],'applicationId':_0x104b77['applicationId']},'headers':{'Authorization':util[_0x17d7('0x42')]('Basic\x20%s',new Buffer(_0x319c5d)[_0x17d7('0x45')](_0x17d7('0x46')))},'json':!![]};rp(_0x36b36b)['then'](function(_0x40633f){if(_0x40633f['id']){var _0x5f3583={'messageId':_0x40633f['id']};return _0x55229e[_0x17d7('0x18')](_0x5f3583);}else{logger[_0x17d7('0x1b')](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x6c'),util[_0x17d7('0x2b')](_0x40633f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x16b821){logger['error'](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x6c'),util[_0x17d7('0x2b')](_0x16b821,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x17d7('0x29'),_0x17d7('0x2a'),'bandwidth',_0x17d7('0x3a'));}break;case _0x17d7('0x6f'):if(_0x104b77[_0x17d7('0x60')]){var _0xfc9e1e={};var _0x1013fc={'method':_0x17d7('0x36'),'uri':_0x17d7('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x104b77['apiKey'],'Content-Type':_0x17d7('0x56')},'body':{'from':_0x104b77[_0x17d7('0x25')],'to':_0x855ea3[_0x17d7('0x25')],'text':_0x855ea3[_0x17d7('0xd')]},'json':!![]};return rp(_0x1013fc)[_0x17d7('0x17')](function(_0x22bca0){if(_0x22bca0['code']==0xca){_0xfc9e1e[_0x17d7('0x71')]=_0x22bca0;var _0x5aa3dd={'method':_0x17d7('0x36'),'uri':_0x17d7('0x72'),'headers':{'Authorization':_0x17d7('0x73')+_0x104b77['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0xfc9e1e[_0x17d7('0x71')]['refid']},'json':!![]};return rp(_0x5aa3dd)[_0x17d7('0x17')](function(_0x458124){_0xfc9e1e['status']=_0x458124;var _0x3378ae={'messageId':_0xfc9e1e[_0x17d7('0x71')][_0x17d7('0x74')],'read':!![]};return _0x55229e['update'](_0x3378ae);});}else{return logger[_0x17d7('0x1b')](_0x17d7('0x29'),'afterCreate','intelepeer',util[_0x17d7('0x2b')](_0x22bca0,{'showHidden':![],'depth':null}));}})[_0x17d7('0x1a')](function(_0x2de177){return logger['error'](_0x17d7('0x29'),_0x17d7('0x2a'),_0x17d7('0x6f'),util[_0x17d7('0x2b')](_0x2de177,{'showHidden':![],'depth':null}));});}else{return logger[_0x17d7('0x1b')](_0x17d7('0x29'),'afterCreate',_0x17d7('0x6f'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x38167f();});}else{_0x38167f();}}},'charset':_0x17d7('0x75'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 48629cd..94694d6 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 _0xded1=['options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSmsMessage','SmsMessage','body'];(function(_0x4da201,_0x3a2511){var _0xa60d=function(_0x5452b1){while(--_0x5452b1){_0x4da201['push'](_0x4da201['shift']());}};_0xa60d(++_0x3a2511);}(_0xded1,0x1f2));var _0x1ded=function(_0x40f98f,_0x3bcd3a){_0x40f98f=_0x40f98f-0x0;var _0x524783=_0xded1[_0x40f98f];return _0x524783;};'use strict';var _=require(_0x1ded('0x0'));var util=require(_0x1ded('0x1'));var moment=require(_0x1ded('0x2'));var BPromise=require('bluebird');var rs=require(_0x1ded('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ded('0x4'))['db'];var utils=require(_0x1ded('0x5'));var logger=require(_0x1ded('0x6'))('rpc');var config=require(_0x1ded('0x7'));var jayson=require(_0x1ded('0x8'));var client=jayson['client'][_0x1ded('0x9')]({'port':0x232a});config[_0x1ded('0xa')]=_[_0x1ded('0xb')](config[_0x1ded('0xa')],{'host':_0x1ded('0xc'),'port':0x18eb});var socket=require(_0x1ded('0xd'))(new Redis(config['redis']));require(_0x1ded('0xe'))['register'](socket);function respondWithRpcPromise(_0x45e022,_0x2ce2d9,_0x29cd06){return new BPromise(function(_0x175816,_0x5944d7){return client[_0x1ded('0xf')](_0x45e022,_0x29cd06)[_0x1ded('0x10')](function(_0x32ac0a){logger[_0x1ded('0x11')](_0x1ded('0x12'),_0x2ce2d9,_0x1ded('0x13'));logger[_0x1ded('0x14')](_0x1ded('0x15'),_0x2ce2d9,_0x1ded('0x13'),JSON[_0x1ded('0x16')](_0x32ac0a));if(_0x32ac0a[_0x1ded('0x17')]){if(_0x32ac0a[_0x1ded('0x17')]['code']===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x2ce2d9,_0x32ac0a[_0x1ded('0x17')][_0x1ded('0x18')]);return _0x5944d7(_0x32ac0a[_0x1ded('0x17')][_0x1ded('0x18')]);}logger[_0x1ded('0x17')](_0x1ded('0x12'),_0x2ce2d9,_0x32ac0a[_0x1ded('0x17')][_0x1ded('0x18')]);return _0x175816(_0x32ac0a[_0x1ded('0x17')]['message']);}else{logger[_0x1ded('0x11')](_0x1ded('0x12'),_0x2ce2d9,_0x1ded('0x13'));_0x175816(_0x32ac0a[_0x1ded('0x19')][_0x1ded('0x18')]);}})['catch'](function(_0x5e818f){logger[_0x1ded('0x17')]('SmsMessage,\x20%s,\x20%s',_0x2ce2d9,_0x5e818f);_0x5944d7(_0x5e818f);});});}exports[_0x1ded('0x1a')]=function(_0x1f3153){var _0x5d8532=this;return new Promise(function(_0x5c8805,_0x5b23d7){return db[_0x1ded('0x1b')]['create'](_0x1f3153[_0x1ded('0x1c')],{'raw':_0x1f3153[_0x1ded('0x1d')]?_0x1f3153[_0x1ded('0x1d')][_0x1ded('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x48a3b3){logger['info']('CreateSmsMessage',_0x1f3153);logger[_0x1ded('0x14')]('CreateSmsMessage',_0x1f3153,JSON[_0x1ded('0x16')](_0x48a3b3));_0x5c8805(_0x48a3b3);})['catch'](function(_0x2ca0a2){logger['error']('CreateSmsMessage',_0x2ca0a2[_0x1ded('0x18')],_0x1f3153);_0x5b23d7(_0x5d8532[_0x1ded('0x17')](0x1f4,_0x2ca0a2['message']));});});}; \ No newline at end of file +var _0xf293=['raw','debug','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateSmsMessage','body','options'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0xf293,0x7e));var _0x3f29=function(_0x530586,_0x3d6b83){_0x530586=_0x530586-0x0;var _0x4b8c52=_0xf293[_0x530586];return _0x4b8c52;};'use strict';var _=require(_0x3f29('0x0'));var util=require(_0x3f29('0x1'));var moment=require(_0x3f29('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f29('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3f29('0x4'))(_0x3f29('0x5'));var config=require(_0x3f29('0x6'));var jayson=require(_0x3f29('0x7'));var client=jayson[_0x3f29('0x8')][_0x3f29('0x9')]({'port':0x232a});config[_0x3f29('0xa')]=_[_0x3f29('0xb')](config[_0x3f29('0xa')],{'host':_0x3f29('0xc'),'port':0x18eb});var socket=require(_0x3f29('0xd'))(new Redis(config[_0x3f29('0xa')]));require(_0x3f29('0xe'))[_0x3f29('0xf')](socket);function respondWithRpcPromise(_0x9ff1b,_0x2ef770,_0xb6e5a9){return new BPromise(function(_0x5f41fb,_0x202a62){return client[_0x3f29('0x10')](_0x9ff1b,_0xb6e5a9)[_0x3f29('0x11')](function(_0x422600){logger[_0x3f29('0x12')](_0x3f29('0x13'),_0x2ef770,_0x3f29('0x14'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2ef770,_0x3f29('0x14'),JSON[_0x3f29('0x15')](_0x422600));if(_0x422600[_0x3f29('0x16')]){if(_0x422600[_0x3f29('0x16')][_0x3f29('0x17')]===0x1f4){logger[_0x3f29('0x16')](_0x3f29('0x13'),_0x2ef770,_0x422600[_0x3f29('0x16')][_0x3f29('0x18')]);return _0x202a62(_0x422600[_0x3f29('0x16')][_0x3f29('0x18')]);}logger[_0x3f29('0x16')](_0x3f29('0x13'),_0x2ef770,_0x422600[_0x3f29('0x16')][_0x3f29('0x18')]);return _0x5f41fb(_0x422600[_0x3f29('0x16')][_0x3f29('0x18')]);}else{logger[_0x3f29('0x12')](_0x3f29('0x13'),_0x2ef770,_0x3f29('0x14'));_0x5f41fb(_0x422600['result']['message']);}})[_0x3f29('0x19')](function(_0x323989){logger[_0x3f29('0x16')]('SmsMessage,\x20%s,\x20%s',_0x2ef770,_0x323989);_0x202a62(_0x323989);});});}exports[_0x3f29('0x1a')]=function(_0x335cb5){var _0x10e696=this;return new Promise(function(_0x2da5d9,_0x3c368b){return db['SmsMessage']['create'](_0x335cb5[_0x3f29('0x1b')],{'raw':_0x335cb5[_0x3f29('0x1c')]?_0x335cb5[_0x3f29('0x1c')][_0x3f29('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0xd72a01){logger['info']('CreateSmsMessage',_0x335cb5);logger[_0x3f29('0x1e')]('CreateSmsMessage',_0x335cb5,JSON['stringify'](_0xd72a01));_0x2da5d9(_0xd72a01);})[_0x3f29('0x19')](function(_0xa1bbce){logger[_0x3f29('0x16')](_0x3f29('0x1a'),_0xa1bbce[_0x3f29('0x18')],_0x335cb5);_0x3c368b(_0x10e696[_0x3f29('0x16')](0x1f4,_0xa1bbce[_0x3f29('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 8bdfb35..8de87dc 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 _0x5a4d=['register','save','update','emit','removeListener'];(function(_0x5c4196,_0x59a506){var _0x2001c7=function(_0x13af0a){while(--_0x13af0a){_0x5c4196['push'](_0x5c4196['shift']());}};_0x2001c7(++_0x59a506);}(_0x5a4d,0x196));var _0xd5a4=function(_0x6448ed,_0x2794a7){_0x6448ed=_0x6448ed-0x0;var _0x2dc0c1=_0x5a4d[_0x6448ed];return _0x2dc0c1;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xd5a4('0x0'),'remove',_0xd5a4('0x1')];function createListener(_0x4d6f2d,_0x12b0c9){return function(_0x4f8b24){_0x12b0c9[_0xd5a4('0x2')](_0x4d6f2d,_0x4f8b24);};}function removeListener(_0x52b3aa,_0x1c0c4a){return function(){SmsMessageEvents[_0xd5a4('0x3')](_0x52b3aa,_0x1c0c4a);};}exports[_0xd5a4('0x4')]=function(_0x863f48){for(var _0x44ac96=0x0,_0x2564bb=events['length'];_0x44ac96<_0x2564bb;_0x44ac96++){var _0xb743bf=events[_0x44ac96];var _0x2caf4d=createListener('smsMessage:'+_0xb743bf,_0x863f48);SmsMessageEvents['on'](_0xb743bf,_0x2caf4d);}}; \ No newline at end of file +var _0xf464=['save','remove','update','emit','register','smsMessage:','./smsMessage.events'];(function(_0x18a286,_0x1bf99f){var _0x57dfbb=function(_0x4e8bcb){while(--_0x4e8bcb){_0x18a286['push'](_0x18a286['shift']());}};_0x57dfbb(++_0x1bf99f);}(_0xf464,0x76));var _0x4f46=function(_0x5045d0,_0x3d682){_0x5045d0=_0x5045d0-0x0;var _0x5140f4=_0xf464[_0x5045d0];return _0x5140f4;};'use strict';var SmsMessageEvents=require(_0x4f46('0x0'));var events=[_0x4f46('0x1'),_0x4f46('0x2'),_0x4f46('0x3')];function createListener(_0x591813,_0x4020c7){return function(_0x9b7d55){_0x4020c7[_0x4f46('0x4')](_0x591813,_0x9b7d55);};}function removeListener(_0x281b4a,_0x14632d){return function(){SmsMessageEvents['removeListener'](_0x281b4a,_0x14632d);};}exports[_0x4f46('0x5')]=function(_0x2516a5){for(var _0x5960c5=0x0,_0x2ae104=events['length'];_0x5960c5<_0x2ae104;_0x5960c5++){var _0x4d6543=events[_0x5960c5];var _0x5e8982=createListener(_0x4f46('0x6')+_0x4d6543,_0x2516a5);SmsMessageEvents['on'](_0x4d6543,_0x5e8982);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 5a54487..6cd9c83 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 _0x5111=['Router','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','/:id/members','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0x5111,0x10e));var _0x1511=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5111[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x1511('0x0'));var util=require(_0x1511('0x1'));var path=require(_0x1511('0x2'));var timeout=require(_0x1511('0x3'));var express=require(_0x1511('0x4'));var router=express[_0x1511('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1511('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x1511('0x7')]('/',auth[_0x1511('0x8')](),controller[_0x1511('0x9')]);router['get'](_0x1511('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x1511('0x7')](_0x1511('0xb'),auth[_0x1511('0x8')](),controller['show']);router[_0x1511('0x7')](_0x1511('0xc'),auth[_0x1511('0x8')](),controller['getMembers']);router['get'](_0x1511('0xd'),auth['isAuthenticated'](),controller['getTeams']);router[_0x1511('0x7')](_0x1511('0xe'),auth[_0x1511('0x8')](),controller[_0x1511('0xf')]);router['post']('/',auth[_0x1511('0x8')](),controller[_0x1511('0x10')]);router[_0x1511('0x11')](_0x1511('0xd'),auth['isAuthenticated'](),controller[_0x1511('0x12')]);router[_0x1511('0x11')]('/:id/users',auth[_0x1511('0x8')](),controller[_0x1511('0x13')]);router['put'](_0x1511('0xb'),auth[_0x1511('0x8')](),controller[_0x1511('0x14')]);router[_0x1511('0x15')](_0x1511('0xb'),auth['isAuthenticated'](),controller[_0x1511('0x16')]);router[_0x1511('0x15')]('/:id/teams',auth[_0x1511('0x8')](),controller[_0x1511('0x17')]);router[_0x1511('0x15')](_0x1511('0xe'),auth['isAuthenticated'](),controller[_0x1511('0x18')]);module['exports']=router; \ No newline at end of file +var _0x76b7=['../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3f5ea8,_0x4f6200){var _0x4c9b16=function(_0x164571){while(--_0x164571){_0x3f5ea8['push'](_0x3f5ea8['shift']());}};_0x4c9b16(++_0x4f6200);}(_0x76b7,0x142));var _0x776b=function(_0x35cbed,_0x1f98ef){_0x35cbed=_0x35cbed-0x0;var _0x5560dd=_0x76b7[_0x35cbed];return _0x5560dd;};'use strict';var multer=require(_0x776b('0x0'));var util=require(_0x776b('0x1'));var path=require(_0x776b('0x2'));var timeout=require('connect-timeout');var express=require(_0x776b('0x3'));var router=express[_0x776b('0x4')]();var fs_extra=require(_0x776b('0x5'));var auth=require(_0x776b('0x6'));var interaction=require(_0x776b('0x7'));var config=require(_0x776b('0x8'));var controller=require(_0x776b('0x9'));router[_0x776b('0xa')]('/',auth[_0x776b('0xb')](),controller[_0x776b('0xc')]);router[_0x776b('0xa')](_0x776b('0xd'),auth[_0x776b('0xb')](),controller[_0x776b('0xe')]);router['get']('/:id',auth[_0x776b('0xb')](),controller[_0x776b('0xf')]);router[_0x776b('0xa')]('/:id/members',auth[_0x776b('0xb')](),controller['getMembers']);router['get'](_0x776b('0x10'),auth['isAuthenticated'](),controller[_0x776b('0x11')]);router[_0x776b('0xa')](_0x776b('0x12'),auth[_0x776b('0xb')](),controller[_0x776b('0x13')]);router['post']('/',auth[_0x776b('0xb')](),controller['create']);router[_0x776b('0x14')](_0x776b('0x10'),auth[_0x776b('0xb')](),controller[_0x776b('0x15')]);router[_0x776b('0x14')](_0x776b('0x12'),auth[_0x776b('0xb')](),controller['addAgents']);router[_0x776b('0x16')](_0x776b('0x17'),auth[_0x776b('0xb')](),controller[_0x776b('0x18')]);router[_0x776b('0x19')](_0x776b('0x17'),auth[_0x776b('0xb')](),controller[_0x776b('0x1a')]);router[_0x776b('0x19')](_0x776b('0x10'),auth[_0x776b('0xb')](),controller[_0x776b('0x1b')]);router[_0x776b('0x19')](_0x776b('0x12'),auth[_0x776b('0xb')](),controller[_0x776b('0x1c')]);module[_0x776b('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 8512f95..b35ae6d 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 _0x86db=['exports','STRING','name','INTEGER','rrmemory','beepall','sequelize'];(function(_0x5dadfc,_0x43bb9d){var _0x2a9227=function(_0x5a8677){while(--_0x5a8677){_0x5dadfc['push'](_0x5dadfc['shift']());}};_0x2a9227(++_0x43bb9d);}(_0x86db,0xdf));var _0xb86d=function(_0x457c96,_0x13785c){_0x457c96=_0x457c96-0x0;var _0x4e5ebc=_0x86db[_0x457c96];return _0x4e5ebc;};'use strict';var Sequelize=require(_0xb86d('0x0'));module[_0xb86d('0x1')]={'name':{'type':Sequelize[_0xb86d('0x2')],'unique':_0xb86d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb86d('0x2')]},'timeout':{'type':Sequelize[_0xb86d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb86d('0x5'),_0xb86d('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xcaad=['beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x959be2,_0x143cc5){var _0x49d28d=function(_0x1a079a){while(--_0x1a079a){_0x959be2['push'](_0x959be2['shift']());}};_0x49d28d(++_0x143cc5);}(_0xcaad,0x192));var _0xdcaa=function(_0x31fa0e,_0x24ccc2){_0x31fa0e=_0x31fa0e-0x0;var _0x999293=_0xcaad[_0x31fa0e];return _0x999293;};'use strict';var Sequelize=require(_0xdcaa('0x0'));module[_0xdcaa('0x1')]={'name':{'type':Sequelize[_0xdcaa('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xdcaa('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdcaa('0x4')](_0xdcaa('0x5'),_0xdcaa('0x6'),_0xdcaa('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b660516..fc788df 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 _0xb199=['filter','where','merge','type','includeAll','include','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','options','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','order','nolimit','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userSmsQueue:save','removeTeams','ids','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','omit','spread','removeAgents','isArray','userSmsQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./smsQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','get','SmsQueues','UserProfileResource','sendStatus','error','stack','name','index','map','SmsQueue','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','sort','pick'];(function(_0x190053,_0x3d05d3){var _0x3f4e8e=function(_0x27d508){while(--_0x27d508){_0x190053['push'](_0x190053['shift']());}};_0x3f4e8e(++_0x3d05d3);}(_0xb199,0xdc));var _0x9b19=function(_0x14ee03,_0x584a48){_0x14ee03=_0x14ee03-0x0;var _0x20f92b=_0xb199[_0x14ee03];return _0x20f92b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b19('0x0'));var zipdir=require(_0x9b19('0x1'));var jsonpatch=require(_0x9b19('0x2'));var rp=require(_0x9b19('0x3'));var moment=require('moment');var BPromise=require(_0x9b19('0x4'));var Mustache=require(_0x9b19('0x5'));var util=require(_0x9b19('0x6'));var path=require(_0x9b19('0x7'));var sox=require(_0x9b19('0x8'));var csv=require(_0x9b19('0x9'));var ejs=require(_0x9b19('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b19('0xb'));var squel=require(_0x9b19('0xc'));var crypto=require(_0x9b19('0xd'));var jsforce=require(_0x9b19('0xe'));var deskjs=require(_0x9b19('0xf'));var toCsv=require(_0x9b19('0x9'));var querystring=require(_0x9b19('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9b19('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b19('0x12'))(_0x9b19('0x13'));var utils=require(_0x9b19('0x14'));var config=require(_0x9b19('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b19('0x16'))['db'];config[_0x9b19('0x17')]=_['defaults'](config['redis'],{'host':_0x9b19('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b19('0x17')]));require(_0x9b19('0x19'))[_0x9b19('0x1a')](socket);function respondWithStatusCode(_0x1e1e47,_0x1c23e2){_0x1c23e2=_0x1c23e2||0xcc;return function(_0x56d5d1){if(_0x56d5d1){return _0x1e1e47['sendStatus'](_0x1c23e2);}return _0x1e1e47[_0x9b19('0x1b')](_0x1c23e2)[_0x9b19('0x1c')]();};}function respondWithResult(_0x4e127a,_0x580484){_0x580484=_0x580484||0xc8;return function(_0x3fb1d5){if(_0x3fb1d5){return _0x4e127a['status'](_0x580484)[_0x9b19('0x1d')](_0x3fb1d5);}};}function respondWithFilteredResult(_0x4c3332,_0x2e1867){return function(_0x2ec630){if(_0x2ec630){var _0x89c883=typeof _0x2e1867[_0x9b19('0x1e')]===_0x9b19('0x1f')&&typeof _0x2e1867[_0x9b19('0x20')]===_0x9b19('0x1f');var _0x46c210=_0x2ec630[_0x9b19('0x21')];var _0x217a26=_0x89c883?0x0:_0x2e1867[_0x9b19('0x1e')];var _0xa973aa=_0x89c883?_0x2ec630[_0x9b19('0x21')]:_0x2e1867[_0x9b19('0x1e')]+_0x2e1867[_0x9b19('0x20')];var _0x38e571;if(_0xa973aa>=_0x46c210){_0xa973aa=_0x46c210;_0x38e571=0xc8;}else{_0x38e571=0xce;}_0x4c3332[_0x9b19('0x1b')](_0x38e571);return _0x4c3332[_0x9b19('0x22')](_0x9b19('0x23'),_0x217a26+'-'+_0xa973aa+'/'+_0x46c210)[_0x9b19('0x1d')](_0x2ec630);}return null;};}function patchUpdates(_0x2d263f){return function(_0x306f74){try{jsonpatch['apply'](_0x306f74,_0x2d263f,!![]);}catch(_0x489867){return BPromise['reject'](_0x489867);}return _0x306f74[_0x9b19('0x24')]();};}function saveUpdates(_0x58ce8d,_0x4eab6a){return function(_0x5c7270){if(_0x5c7270){return _0x5c7270[_0x9b19('0x25')](_0x58ce8d)['then'](function(_0x43ce9a){return _0x43ce9a;});}return null;};}function removeEntity(_0x1539c4,_0x524a92){return function(_0x669d40){if(_0x669d40){return _0x669d40[_0x9b19('0x26')]()[_0x9b19('0x27')](function(){var _0x1d0d2a=_0x669d40[_0x9b19('0x28')]({'plain':!![]});var _0x12aece=_0x9b19('0x29');return db[_0x9b19('0x2a')]['destroy']({'where':{'type':_0x12aece,'resourceId':_0x1d0d2a['id']}})[_0x9b19('0x27')](function(){return _0x669d40;});})['then'](function(){_0x1539c4[_0x9b19('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dca03,_0x346375){return function(_0x385bd6){if(!_0x385bd6){_0x1dca03[_0x9b19('0x2b')](0x194);}return _0x385bd6;};}function handleError(_0x1ccab2,_0x155c26){_0x155c26=_0x155c26||0x1f4;return function(_0x30bcae){logger[_0x9b19('0x2c')](_0x30bcae[_0x9b19('0x2d')]);if(_0x30bcae[_0x9b19('0x2e')]){delete _0x30bcae['name'];}_0x1ccab2['status'](_0x155c26)['send'](_0x30bcae);};}exports[_0x9b19('0x2f')]=function(_0x4329de,_0x4ac07c){var _0x5829fa={},_0x4f019e={},_0x27d285={'count':0x0,'rows':[]};var _0x25236b=_[_0x9b19('0x30')](db[_0x9b19('0x31')][_0x9b19('0x32')],function(_0x2e220d){return{'name':_0x2e220d[_0x9b19('0x33')],'type':_0x2e220d['type'][_0x9b19('0x34')]};});_0x4f019e['model']=_[_0x9b19('0x30')](_0x25236b,'name');_0x4f019e[_0x9b19('0x35')]=_['keys'](_0x4329de[_0x9b19('0x35')]);_0x4f019e[_0x9b19('0x36')]=_['intersection'](_0x4f019e[_0x9b19('0x37')],_0x4f019e[_0x9b19('0x35')]);_0x5829fa[_0x9b19('0x38')]=_[_0x9b19('0x39')](_0x4f019e['model'],qs[_0x9b19('0x3a')](_0x4329de[_0x9b19('0x35')][_0x9b19('0x3a')]));_0x5829fa['attributes']=_0x5829fa[_0x9b19('0x38')][_0x9b19('0x3b')]?_0x5829fa[_0x9b19('0x38')]:_0x4f019e[_0x9b19('0x37')];if(!_0x4329de[_0x9b19('0x35')]['hasOwnProperty']('nolimit')){_0x5829fa[_0x9b19('0x20')]=qs['limit'](_0x4329de[_0x9b19('0x35')][_0x9b19('0x20')]);_0x5829fa[_0x9b19('0x1e')]=qs[_0x9b19('0x1e')](_0x4329de[_0x9b19('0x35')][_0x9b19('0x1e')]);}_0x5829fa['order']=qs[_0x9b19('0x3c')](_0x4329de['query'][_0x9b19('0x3c')]);_0x5829fa['where']=qs[_0x9b19('0x36')](_[_0x9b19('0x3d')](_0x4329de[_0x9b19('0x35')],_0x4f019e[_0x9b19('0x36')]),_0x25236b);if(_0x4329de[_0x9b19('0x35')][_0x9b19('0x3e')]){_0x5829fa[_0x9b19('0x3f')]=_[_0x9b19('0x40')](_0x5829fa['where'],{'$or':_[_0x9b19('0x30')](_0x25236b,function(_0x5a6458){if(_0x5a6458[_0x9b19('0x41')]!=='VIRTUAL'){var _0x4b84d1={};_0x4b84d1[_0x5a6458[_0x9b19('0x2e')]]={'$like':'%'+_0x4329de[_0x9b19('0x35')][_0x9b19('0x3e')]+'%'};return _0x4b84d1;}})});}_0x5829fa=_[_0x9b19('0x40')]({},_0x5829fa,_0x4329de['options']);var _0x968b04={'where':_0x5829fa[_0x9b19('0x3f')]};return db[_0x9b19('0x31')][_0x9b19('0x21')](_0x968b04)[_0x9b19('0x27')](function(_0x235132){_0x27d285[_0x9b19('0x21')]=_0x235132;if(_0x4329de[_0x9b19('0x35')][_0x9b19('0x42')]){_0x5829fa[_0x9b19('0x43')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x5829fa);})[_0x9b19('0x27')](function(_0x32aa30){_0x27d285['rows']=_0x32aa30;return _0x27d285;})[_0x9b19('0x27')](respondWithFilteredResult(_0x4ac07c,_0x5829fa))[_0x9b19('0x44')](handleError(_0x4ac07c,null));};exports[_0x9b19('0x45')]=function(_0x1f5258,_0x127ab0){var _0x14fd25={'raw':!![],'where':{'id':_0x1f5258['params']['id']}},_0x83f975={};_0x83f975[_0x9b19('0x37')]=_[_0x9b19('0x46')](db[_0x9b19('0x31')][_0x9b19('0x32')]);_0x83f975[_0x9b19('0x35')]=_['keys'](_0x1f5258['query']);_0x83f975['filters']=_[_0x9b19('0x39')](_0x83f975['model'],_0x83f975[_0x9b19('0x35')]);_0x14fd25['attributes']=_[_0x9b19('0x39')](_0x83f975['model'],qs[_0x9b19('0x3a')](_0x1f5258[_0x9b19('0x35')][_0x9b19('0x3a')]));_0x14fd25['attributes']=_0x14fd25[_0x9b19('0x38')][_0x9b19('0x3b')]?_0x14fd25['attributes']:_0x83f975[_0x9b19('0x37')];if(_0x1f5258[_0x9b19('0x35')][_0x9b19('0x42')]){_0x14fd25[_0x9b19('0x43')]=[{'all':!![]}];}_0x14fd25=_[_0x9b19('0x40')]({},_0x14fd25,_0x1f5258['options']);return db['SmsQueue'][_0x9b19('0x47')](_0x14fd25)['then'](handleEntityNotFound(_0x127ab0,null))[_0x9b19('0x27')](respondWithResult(_0x127ab0,null))['catch'](handleError(_0x127ab0,null));};exports['create']=function(_0x1f81cf,_0x2ddb4b){return db['SmsQueue'][_0x9b19('0x48')](_0x1f81cf[_0x9b19('0x49')],{})['then'](function(_0x6a2a04){var _0x5ae163=_0x1f81cf[_0x9b19('0x4a')][_0x9b19('0x28')]({'plain':!![]});if(!_0x5ae163)throw new Error(_0x9b19('0x4b'));if(_0x5ae163['role']===_0x9b19('0x4a')){var _0x6fe833=_0x6a2a04['get']({'plain':!![]});var _0x1c5b1e=_0x9b19('0x29');return db['UserProfileSection'][_0x9b19('0x47')]({'where':{'name':_0x1c5b1e,'userProfileId':_0x5ae163[_0x9b19('0x4c')]},'raw':!![]})['then'](function(_0x4a8617){if(_0x4a8617&&_0x4a8617[_0x9b19('0x4d')]===0x0){return db['UserProfileResource'][_0x9b19('0x48')]({'name':_0x6fe833[_0x9b19('0x2e')],'resourceId':_0x6fe833['id'],'type':_0x4a8617['name'],'sectionId':_0x4a8617['id']},{})[_0x9b19('0x27')](function(){return _0x6a2a04;});}else{return _0x6a2a04;}})[_0x9b19('0x44')](function(_0x51fa41){logger[_0x9b19('0x2c')](_0x9b19('0x4e'),_0x51fa41);throw _0x51fa41;});}return _0x6a2a04;})['then'](respondWithResult(_0x2ddb4b,0xc9))[_0x9b19('0x44')](handleError(_0x2ddb4b,null));};exports[_0x9b19('0x25')]=function(_0xa78fea,_0x15f71c){if(_0xa78fea[_0x9b19('0x49')]['id']){delete _0xa78fea[_0x9b19('0x49')]['id'];}return db[_0x9b19('0x31')][_0x9b19('0x47')]({'where':{'id':_0xa78fea[_0x9b19('0x4f')]['id']}})[_0x9b19('0x27')](handleEntityNotFound(_0x15f71c,null))['then'](saveUpdates(_0xa78fea['body'],null))[_0x9b19('0x27')](respondWithResult(_0x15f71c,null))[_0x9b19('0x44')](handleError(_0x15f71c,null));};exports[_0x9b19('0x26')]=function(_0x4cb4bf,_0x423067){return db[_0x9b19('0x31')][_0x9b19('0x47')]({'where':{'id':_0x4cb4bf[_0x9b19('0x4f')]['id']}})[_0x9b19('0x27')](handleEntityNotFound(_0x423067,null))['then'](removeEntity(_0x423067,null))[_0x9b19('0x44')](handleError(_0x423067,null));};exports[_0x9b19('0x50')]=function(_0x426f6f,_0x52cced){return db[_0x9b19('0x31')][_0x9b19('0x50')]()['then'](respondWithResult(_0x52cced,null))['catch'](handleError(_0x52cced,null));};exports[_0x9b19('0x51')]=function(_0x1564fb,_0x33bffa,_0x53dd4c){var _0x3454d1={'raw':!![],'where':{}},_0x32e01b={},_0x267e84;return db[_0x9b19('0x31')][_0x9b19('0x52')]({'where':{'id':_0x1564fb['params']['id']}})[_0x9b19('0x27')](handleEntityNotFound(_0x33bffa,null))[_0x9b19('0x27')](function(_0x491366){if(_0x491366){_0x267e84=_0x491366[_0x9b19('0x28')]({'plain':!![]});_0x32e01b['model']=_[_0x9b19('0x46')](db[_0x9b19('0x53')][_0x9b19('0x32')]);_0x32e01b[_0x9b19('0x35')]=_[_0x9b19('0x46')](_0x1564fb['query']);_0x32e01b[_0x9b19('0x36')]=_['intersection'](_0x32e01b['model'],_0x32e01b[_0x9b19('0x35')]);_0x3454d1['attributes']=_[_0x9b19('0x39')](_0x32e01b[_0x9b19('0x37')],qs[_0x9b19('0x3a')](_0x1564fb[_0x9b19('0x35')][_0x9b19('0x3a')]));_0x3454d1['attributes']=_0x3454d1[_0x9b19('0x38')][_0x9b19('0x3b')]?_0x3454d1[_0x9b19('0x38')]:_0x32e01b[_0x9b19('0x37')];if(!_0x1564fb[_0x9b19('0x35')][_0x9b19('0x54')]('nolimit')){_0x3454d1[_0x9b19('0x20')]=qs[_0x9b19('0x20')](_0x1564fb['query'][_0x9b19('0x20')]);_0x3454d1[_0x9b19('0x1e')]=qs[_0x9b19('0x1e')](_0x1564fb[_0x9b19('0x35')]['offset']);}_0x3454d1['order']=qs[_0x9b19('0x3c')](_0x1564fb['query'][_0x9b19('0x3c')]);_0x3454d1['where']=qs[_0x9b19('0x36')](_['pick'](_0x1564fb[_0x9b19('0x35')],_0x32e01b[_0x9b19('0x36')]));_0x3454d1['where'][_0x9b19('0x55')]=_0x491366['id'];if(_0x1564fb[_0x9b19('0x35')]['filter']){_0x3454d1['where']=_['merge'](_0x3454d1['where'],{'$or':_[_0x9b19('0x30')](_0x3454d1[_0x9b19('0x38')],function(_0x54aa38){var _0x4e6929={};_0x4e6929[_0x54aa38]={'$like':'%'+_0x1564fb[_0x9b19('0x35')]['filter']+'%'};return _0x4e6929;})});}_0x3454d1=_[_0x9b19('0x40')]({},_0x3454d1,_0x1564fb[_0x9b19('0x56')]);return db[_0x9b19('0x53')][_0x9b19('0x57')](_0x3454d1);}})['then'](function(_0x43c165){if(_0x43c165){return db[_0x9b19('0x58')][_0x9b19('0x59')]({'where':{'id':_[_0x9b19('0x30')](_0x43c165,_0x9b19('0x5a')),'role':_0x9b19('0x5b')},'attributes':['id','name',_0x9b19('0x5c'),_0x9b19('0x5d'),_0x9b19('0x5e')]});}})[_0x9b19('0x27')](function(_0x33a4e5){if(_0x33a4e5){return{'count':_0x33a4e5['count'],'rows':_['map'](_0x33a4e5[_0x9b19('0x5f')],function(_0x44bff4){return{'membername':_0x44bff4['name'],'UserId':_0x44bff4['id'],'queue_name':_0x267e84[_0x9b19('0x2e')],'SmsQueueId':_0x267e84['id'],'interface':util[_0x9b19('0x60')](_0x9b19('0x61'),_0x9b19('0x62'),_0x44bff4[_0x9b19('0x2e')]),'penalty':0x0,'paused':_0x44bff4['smsPause'],'createdAt':_0x44bff4[_0x9b19('0x5e')],'updatedAt':_0x44bff4[_0x9b19('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x33bffa,_0x3454d1))[_0x9b19('0x44')](handleError(_0x33bffa,null));};exports[_0x9b19('0x63')]=function(_0x51e4b3,_0x1f8c30,_0x2ce818){var _0x3045c7={};var _0x1853a4={};var _0x544c20;var _0x3b1b65;return db['SmsQueue']['findOne']({'where':{'id':_0x51e4b3[_0x9b19('0x4f')]['id']}})[_0x9b19('0x27')](handleEntityNotFound(_0x1f8c30,null))[_0x9b19('0x27')](function(_0x728e1b){if(_0x728e1b){_0x544c20=_0x728e1b;_0x1853a4[_0x9b19('0x37')]=_[_0x9b19('0x46')](db[_0x9b19('0x64')][_0x9b19('0x32')]);_0x1853a4['query']=_[_0x9b19('0x46')](_0x51e4b3[_0x9b19('0x35')]);_0x1853a4[_0x9b19('0x36')]=_[_0x9b19('0x39')](_0x1853a4[_0x9b19('0x37')],_0x1853a4[_0x9b19('0x35')]);_0x3045c7['attributes']=_[_0x9b19('0x39')](_0x1853a4[_0x9b19('0x37')],qs['fields'](_0x51e4b3['query'][_0x9b19('0x3a')]));_0x3045c7[_0x9b19('0x38')]=_0x3045c7[_0x9b19('0x38')][_0x9b19('0x3b')]?_0x3045c7[_0x9b19('0x38')]:_0x1853a4[_0x9b19('0x37')];_0x3045c7[_0x9b19('0x65')]=qs[_0x9b19('0x3c')](_0x51e4b3[_0x9b19('0x35')][_0x9b19('0x3c')]);_0x3045c7[_0x9b19('0x3f')]=qs[_0x9b19('0x36')](_[_0x9b19('0x3d')](_0x51e4b3[_0x9b19('0x35')],_0x1853a4['filters']));if(_0x51e4b3[_0x9b19('0x35')][_0x9b19('0x3e')]){_0x3045c7[_0x9b19('0x3f')]=_['merge'](_0x3045c7[_0x9b19('0x3f')],{'$or':_[_0x9b19('0x30')](_0x3045c7[_0x9b19('0x38')],function(_0x52ffe8){var _0x505425={};_0x505425[_0x52ffe8]={'$like':'%'+_0x51e4b3['query'][_0x9b19('0x3e')]+'%'};return _0x505425;})});}_0x3045c7=_[_0x9b19('0x40')]({},_0x3045c7,_0x51e4b3[_0x9b19('0x56')]);return _0x544c20['getTeams'](_0x3045c7);}})['then'](function(_0x32c0a8){if(_0x32c0a8){_0x3b1b65=_0x32c0a8[_0x9b19('0x3b')];if(!_0x51e4b3[_0x9b19('0x35')]['hasOwnProperty'](_0x9b19('0x66'))){_0x3045c7[_0x9b19('0x20')]=qs[_0x9b19('0x20')](_0x51e4b3[_0x9b19('0x35')][_0x9b19('0x20')]);_0x3045c7[_0x9b19('0x1e')]=qs[_0x9b19('0x1e')](_0x51e4b3[_0x9b19('0x35')][_0x9b19('0x1e')]);}return _0x544c20['getTeams'](_0x3045c7);}})[_0x9b19('0x27')](function(_0x5947b2){if(_0x5947b2){return _0x5947b2?{'count':_0x3b1b65,'rows':_0x5947b2}:null;}})['then'](respondWithResult(_0x1f8c30,null))[_0x9b19('0x44')](handleError(_0x1f8c30,null));};exports[_0x9b19('0x67')]=function(_0x298a63,_0x59b626,_0x524e63){var _0x828a31=_0x298a63[_0x9b19('0x49')]['ids'];return db['Team']['findAll']({'where':{'id':_0x828a31},'attributes':['id'],'include':[{'model':db[_0x9b19('0x58')],'as':_0x9b19('0x68'),'attributes':['id',_0x9b19('0x2e'),_0x9b19('0x69'),_0x9b19('0x6a'),_0x9b19('0x6b')],'raw':!![]}]})[_0x9b19('0x27')](function(_0x107f43){if(_0x107f43){var _0x2969a1=_[_0x9b19('0x6c')](_0x107f43,function(_0x36d1fc){var _0x316295=_0x36d1fc[_0x9b19('0x28')]({'plain':!![]});return _0x316295[_0x9b19('0x68')];});return db[_0x9b19('0x31')][_0x9b19('0x47')]({'where':{'id':_0x298a63[_0x9b19('0x4f')]['id']}})[_0x9b19('0x27')](function(_0x5dabc2){return db[_0x9b19('0x6d')][_0x9b19('0x6e')](function(_0x413cbe){return _0x5dabc2[_0x9b19('0x67')](_0x828a31,{'transaction':_0x413cbe})[_0x9b19('0x27')](function(){return BPromise[_0x9b19('0x6f')](_0x2969a1,function(_0xab0d4e){return db[_0x9b19('0x53')]['findOrCreate']({'where':{'UserId':_0xab0d4e['id'],'SmsQueueId':_0x298a63[_0x9b19('0x4f')]['id']},'transaction':_0x413cbe});});})['then'](function(){_0x2969a1[_0x9b19('0x70')](function(_0x2898ed){socket[_0x9b19('0x71')](_0x9b19('0x72'),{'UserId':_0x2898ed['id'],'SmsQueueId':_0x5dabc2['id']});});});});});}})[_0x9b19('0x27')](respondWithStatusCode(_0x59b626,null))[_0x9b19('0x44')](handleError(_0x59b626,null));};exports[_0x9b19('0x73')]=function(_0x3841ab,_0x2481e0,_0x456cde){return db[_0x9b19('0x64')][_0x9b19('0x57')]({'where':{'id':_0x3841ab['query'][_0x9b19('0x74')]},'attributes':['id'],'include':[{'model':db[_0x9b19('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9b19('0x27')](handleEntityNotFound(_0x2481e0,null))[_0x9b19('0x27')](function(_0x12e285){var _0xc1e436=_[_0x9b19('0x30')](_0x12e285,'id');var _0x42003e=[];var _0x5325b1=[];var _0x68838a=squel[_0x9b19('0x75')]();_0x68838a[_0x9b19('0x76')]('tq.TeamId')[_0x9b19('0x77')](_0x9b19('0x78'),'tq')[_0x9b19('0x79')](_0x9b19('0x7a'),'ut',_0x9b19('0x7b'))[_0x9b19('0x3f')](_0x9b19('0x7c'),_0x3841ab[_0x9b19('0x4f')]['id']);for(var _0x3d6d49=0x0;_0x3d6d49<_0x12e285[_0x9b19('0x3b')];_0x3d6d49+=0x1){let _0x3d4305=_0x12e285[_0x3d6d49];for(var _0x395fb4=0x0;_0x395fb4<_0x3d4305['Agents'][_0x9b19('0x3b')];_0x395fb4+=0x1){let _0xc38c53=_0x3d4305[_0x9b19('0x68')][_0x395fb4];var _0xb87466=_0x68838a['clone']();_0xb87466[_0x9b19('0x3f')]('ut.UserId\x20=\x20?',_0xc38c53['id']);_0x5325b1['push'](db['sequelize'][_0x9b19('0x35')](_0xb87466[_0x9b19('0x7d')](),{'type':db[_0x9b19('0x6d')][_0x9b19('0x7e')][_0x9b19('0x7f')]})[_0x9b19('0x27')](function(_0x45ff2e){if(_0x45ff2e[_0x9b19('0x3b')]===0x1){return _0xc38c53['id'];}else{var _0x4f8769=_[_0x9b19('0x80')](_[_0x9b19('0x30')](_0x45ff2e,_0x9b19('0x81')),function(_0x1a3f05){return _[_0x9b19('0x82')](_0xc1e436,_0x1a3f05);});if(_0x4f8769){return _0xc38c53['id'];}}}));}}return BPromise[_0x9b19('0x83')](_0x5325b1)[_0x9b19('0x27')](function(_0x26b6a5){_0x42003e=_(_0x42003e)[_0x9b19('0x84')](_0x26b6a5)[_0x9b19('0x85')]()['value']();return db[_0x9b19('0x31')][_0x9b19('0x47')]({'where':{'id':_0x3841ab[_0x9b19('0x4f')]['id']}})[_0x9b19('0x27')](function(_0xc1dc1b){return db[_0x9b19('0x6d')]['transaction'](function(_0x17c528){return _0xc1dc1b[_0x9b19('0x73')](_0x3841ab[_0x9b19('0x35')][_0x9b19('0x74')],{'transaction':_0x17c528})[_0x9b19('0x27')](function(){if(!_[_0x9b19('0x86')](_0x42003e)){return _0xc1dc1b['removeAgents'](_0x42003e,{'transaction':_0x17c528});}})['then'](function(){_0x42003e[_0x9b19('0x70')](function(_0x1ffbb7){socket['emit']('userSmsQueue:remove',{'UserId':_0x1ffbb7,'SmsQueueId':_0xc1dc1b['id']});});});});});});})[_0x9b19('0x27')](respondWithStatusCode(_0x2481e0,null))['catch'](handleError(_0x2481e0,null));};exports['addAgents']=function(_0x366b8e,_0x168494,_0x37a793){return db[_0x9b19('0x31')]['find']({'where':{'id':_0x366b8e[_0x9b19('0x4f')]['id']}})[_0x9b19('0x27')](handleEntityNotFound(_0x168494,null))[_0x9b19('0x27')](function(_0xc4cfd8){if(_0xc4cfd8){return _0xc4cfd8['addAgents'](_0x366b8e[_0x9b19('0x49')][_0x9b19('0x74')],_[_0x9b19('0x87')](_0x366b8e['body'],['ids','id'])||{})[_0x9b19('0x88')](function(_0x59d128){for(var _0x374ba0=0x0;_0x374ba0<_0x366b8e[_0x9b19('0x49')][_0x9b19('0x74')][_0x9b19('0x3b')];_0x374ba0+=0x1){socket[_0x9b19('0x71')]('userSmsQueue:save',{'UserId':Number(_0x366b8e[_0x9b19('0x49')][_0x9b19('0x74')][_0x374ba0]),'SmsQueueId':Number(_0x366b8e['params']['id'])});}return _0x59d128;});}})['then'](respondWithResult(_0x168494,null))[_0x9b19('0x44')](handleError(_0x168494,null));};exports[_0x9b19('0x89')]=function(_0x9a69df,_0x3ddcc5,_0x360277){return db[_0x9b19('0x31')][_0x9b19('0x47')]({'where':{'id':_0x9a69df[_0x9b19('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3ddcc5,null))['then'](function(_0x5d7bcc){if(_0x5d7bcc){return _0x5d7bcc[_0x9b19('0x89')](_0x9a69df['query'][_0x9b19('0x74')])[_0x9b19('0x27')](function(){if(_[_0x9b19('0x8a')](_0x9a69df[_0x9b19('0x35')][_0x9b19('0x74')])){for(var _0x43c22d=0x0;_0x43c22d<_0x9a69df[_0x9b19('0x35')][_0x9b19('0x74')][_0x9b19('0x3b')];_0x43c22d+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x9a69df[_0x9b19('0x35')][_0x9b19('0x74')][_0x43c22d]),'SmsQueueId':Number(_0x9a69df[_0x9b19('0x4f')]['id'])});}}else{socket['emit'](_0x9b19('0x8b'),{'UserId':Number(_0x9a69df[_0x9b19('0x35')][_0x9b19('0x74')]),'SmsQueueId':Number(_0x9a69df[_0x9b19('0x4f')]['id'])});}});}})[_0x9b19('0x27')](respondWithStatusCode(_0x3ddcc5,null))[_0x9b19('0x44')](handleError(_0x3ddcc5,null));};exports['getAgents']=function(_0x2f0f74,_0x370e00,_0x21b38){var _0x45f2a7={};var _0xb97b34={};var _0x2d78ef;var _0x20d3c5;return db[_0x9b19('0x31')][_0x9b19('0x52')]({'where':{'id':_0x2f0f74[_0x9b19('0x4f')]['id']}})['then'](handleEntityNotFound(_0x370e00,null))[_0x9b19('0x27')](function(_0x14ba81){if(_0x14ba81){_0x2d78ef=_0x14ba81;_0xb97b34[_0x9b19('0x37')]=_['keys'](db['User'][_0x9b19('0x32')]);_0xb97b34[_0x9b19('0x35')]=_['keys'](_0x2f0f74[_0x9b19('0x35')]);_0xb97b34[_0x9b19('0x36')]=_[_0x9b19('0x39')](_0xb97b34[_0x9b19('0x37')],_0xb97b34['query']);_0x45f2a7[_0x9b19('0x38')]=_[_0x9b19('0x39')](_0xb97b34['model'],qs['fields'](_0x2f0f74[_0x9b19('0x35')]['fields']));_0x45f2a7[_0x9b19('0x38')]=_0x45f2a7[_0x9b19('0x38')][_0x9b19('0x3b')]?_0x45f2a7[_0x9b19('0x38')]:_0xb97b34[_0x9b19('0x37')];_0x45f2a7[_0x9b19('0x65')]=qs['sort'](_0x2f0f74[_0x9b19('0x35')][_0x9b19('0x3c')]);_0x45f2a7[_0x9b19('0x3f')]=qs[_0x9b19('0x36')](_[_0x9b19('0x3d')](_0x2f0f74['query'],_0xb97b34[_0x9b19('0x36')]));if(_0x2f0f74[_0x9b19('0x35')][_0x9b19('0x3e')]){_0x45f2a7[_0x9b19('0x3f')]=_[_0x9b19('0x40')](_0x45f2a7[_0x9b19('0x3f')],{'$or':_[_0x9b19('0x30')](_0x45f2a7[_0x9b19('0x38')],function(_0x298af2){var _0x4bc491={};_0x4bc491[_0x298af2]={'$like':'%'+_0x2f0f74[_0x9b19('0x35')][_0x9b19('0x3e')]+'%'};return _0x4bc491;})});}_0x45f2a7=_[_0x9b19('0x40')]({},_0x45f2a7,_0x2f0f74[_0x9b19('0x56')]);return _0x2d78ef[_0x9b19('0x8c')](_0x45f2a7);}})[_0x9b19('0x27')](function(_0x59fa08){if(_0x59fa08){_0x20d3c5=_0x59fa08[_0x9b19('0x3b')];if(!_0x2f0f74['query']['hasOwnProperty']('nolimit')){_0x45f2a7[_0x9b19('0x20')]=qs['limit'](_0x2f0f74['query']['limit']);_0x45f2a7[_0x9b19('0x1e')]=qs[_0x9b19('0x1e')](_0x2f0f74[_0x9b19('0x35')][_0x9b19('0x1e')]);}return _0x2d78ef[_0x9b19('0x8c')](_0x45f2a7);}})[_0x9b19('0x27')](function(_0x44f95a){if(_0x44f95a){return _0x44f95a?{'count':_0x20d3c5,'rows':_0x44f95a}:null;}})[_0x9b19('0x27')](respondWithResult(_0x370e00,null))[_0x9b19('0x44')](handleError(_0x370e00,null));}; \ No newline at end of file +var _0xd4d0=['end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','get','SmsQueues','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SmsQueue','includeAll','findAll','catch','show','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','SmsQueueId','User','agent','smsPause','createdAt','rows','format','SIP','updatedAt','getTeams','Team','ids','online','interface','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register'];(function(_0x2910f9,_0x4c747a){var _0x3c5507=function(_0x1c981e){while(--_0x1c981e){_0x2910f9['push'](_0x2910f9['shift']());}};_0x3c5507(++_0x4c747a);}(_0xd4d0,0x6d));var _0x0d4d=function(_0x2fa363,_0x3e4904){_0x2fa363=_0x2fa363-0x0;var _0x5b5dea=_0xd4d0[_0x2fa363];return _0x5b5dea;};'use strict';var emlformat=require(_0x0d4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d4d('0x1'));var jsonpatch=require(_0x0d4d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0d4d('0x3'));var Mustache=require(_0x0d4d('0x4'));var util=require(_0x0d4d('0x5'));var path=require('path');var sox=require(_0x0d4d('0x6'));var csv=require(_0x0d4d('0x7'));var ejs=require(_0x0d4d('0x8'));var fs=require('fs');var fs_extra=require(_0x0d4d('0x9'));var _=require(_0x0d4d('0xa'));var squel=require(_0x0d4d('0xb'));var crypto=require(_0x0d4d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0d4d('0xd'));var toCsv=require(_0x0d4d('0x7'));var querystring=require(_0x0d4d('0xe'));var Papa=require(_0x0d4d('0xf'));var Redis=require('ioredis');var authService=require(_0x0d4d('0x10'));var qs=require(_0x0d4d('0x11'));var as=require(_0x0d4d('0x12'));var hardwareService=require(_0x0d4d('0x13'));var logger=require(_0x0d4d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0d4d('0x15'));var licenseUtil=require(_0x0d4d('0x16'));var db=require(_0x0d4d('0x17'))['db'];config[_0x0d4d('0x18')]=_[_0x0d4d('0x19')](config[_0x0d4d('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d4d('0x18')]));require('./smsQueue.socket')[_0x0d4d('0x1a')](socket);function respondWithStatusCode(_0x519d46,_0x691728){_0x691728=_0x691728||0xcc;return function(_0x3952bc){if(_0x3952bc){return _0x519d46['sendStatus'](_0x691728);}return _0x519d46['status'](_0x691728)[_0x0d4d('0x1b')]();};}function respondWithResult(_0x588827,_0x3e5494){_0x3e5494=_0x3e5494||0xc8;return function(_0x3269b1){if(_0x3269b1){return _0x588827[_0x0d4d('0x1c')](_0x3e5494)['json'](_0x3269b1);}};}function respondWithFilteredResult(_0x52411d,_0x543a65){return function(_0x54d50a){if(_0x54d50a){var _0x2257b3=typeof _0x543a65[_0x0d4d('0x1d')]===_0x0d4d('0x1e')&&typeof _0x543a65[_0x0d4d('0x1f')]===_0x0d4d('0x1e');var _0x2cdf4c=_0x54d50a[_0x0d4d('0x20')];var _0x1e121a=_0x2257b3?0x0:_0x543a65[_0x0d4d('0x1d')];var _0xeef7a3=_0x2257b3?_0x54d50a['count']:_0x543a65[_0x0d4d('0x1d')]+_0x543a65[_0x0d4d('0x1f')];var _0x40e64f;if(_0xeef7a3>=_0x2cdf4c){_0xeef7a3=_0x2cdf4c;_0x40e64f=0xc8;}else{_0x40e64f=0xce;}_0x52411d[_0x0d4d('0x1c')](_0x40e64f);return _0x52411d[_0x0d4d('0x21')](_0x0d4d('0x22'),_0x1e121a+'-'+_0xeef7a3+'/'+_0x2cdf4c)[_0x0d4d('0x23')](_0x54d50a);}return null;};}function patchUpdates(_0x5c0b1a){return function(_0x55c99b){try{jsonpatch['apply'](_0x55c99b,_0x5c0b1a,!![]);}catch(_0x2447b7){return BPromise[_0x0d4d('0x24')](_0x2447b7);}return _0x55c99b[_0x0d4d('0x25')]();};}function saveUpdates(_0x5ca142,_0x26a3fa){return function(_0x4d201b){if(_0x4d201b){return _0x4d201b[_0x0d4d('0x26')](_0x5ca142)[_0x0d4d('0x27')](function(_0x268e11){return _0x268e11;});}return null;};}function removeEntity(_0x3bd72c,_0x4fb6be){return function(_0x2cc40b){if(_0x2cc40b){return _0x2cc40b['destroy']()[_0x0d4d('0x27')](function(){var _0x35fa07=_0x2cc40b[_0x0d4d('0x28')]({'plain':!![]});var _0xa05c38=_0x0d4d('0x29');return db[_0x0d4d('0x2a')][_0x0d4d('0x2b')]({'where':{'type':_0xa05c38,'resourceId':_0x35fa07['id']}})[_0x0d4d('0x27')](function(){return _0x2cc40b;});})['then'](function(){_0x3bd72c[_0x0d4d('0x1c')](0xcc)[_0x0d4d('0x1b')]();});}};}function handleEntityNotFound(_0x53a4fb,_0x10cbaa){return function(_0x26a827){if(!_0x26a827){_0x53a4fb[_0x0d4d('0x2c')](0x194);}return _0x26a827;};}function handleError(_0xa819c2,_0x3952a7){_0x3952a7=_0x3952a7||0x1f4;return function(_0x49cb47){logger['error'](_0x49cb47[_0x0d4d('0x2d')]);if(_0x49cb47['name']){delete _0x49cb47[_0x0d4d('0x2e')];}_0xa819c2[_0x0d4d('0x1c')](_0x3952a7)[_0x0d4d('0x2f')](_0x49cb47);};}exports[_0x0d4d('0x30')]=function(_0x2b45aa,_0x2b69bb){var _0x328dc7={},_0x4e7ed1={},_0x4dab54={'count':0x0,'rows':[]};var _0x2e38dc=_[_0x0d4d('0x31')](db['SmsQueue'][_0x0d4d('0x32')],function(_0x5d898e){return{'name':_0x5d898e['fieldName'],'type':_0x5d898e[_0x0d4d('0x33')][_0x0d4d('0x34')]};});_0x4e7ed1[_0x0d4d('0x35')]=_[_0x0d4d('0x31')](_0x2e38dc,_0x0d4d('0x2e'));_0x4e7ed1[_0x0d4d('0x36')]=_[_0x0d4d('0x37')](_0x2b45aa[_0x0d4d('0x36')]);_0x4e7ed1['filters']=_[_0x0d4d('0x38')](_0x4e7ed1['model'],_0x4e7ed1['query']);_0x328dc7[_0x0d4d('0x39')]=_[_0x0d4d('0x38')](_0x4e7ed1[_0x0d4d('0x35')],qs[_0x0d4d('0x3a')](_0x2b45aa[_0x0d4d('0x36')]['fields']));_0x328dc7[_0x0d4d('0x39')]=_0x328dc7[_0x0d4d('0x39')]['length']?_0x328dc7[_0x0d4d('0x39')]:_0x4e7ed1[_0x0d4d('0x35')];if(!_0x2b45aa[_0x0d4d('0x36')]['hasOwnProperty'](_0x0d4d('0x3b'))){_0x328dc7['limit']=qs[_0x0d4d('0x1f')](_0x2b45aa[_0x0d4d('0x36')][_0x0d4d('0x1f')]);_0x328dc7[_0x0d4d('0x1d')]=qs['offset'](_0x2b45aa[_0x0d4d('0x36')][_0x0d4d('0x1d')]);}_0x328dc7[_0x0d4d('0x3c')]=qs['sort'](_0x2b45aa['query'][_0x0d4d('0x3d')]);_0x328dc7[_0x0d4d('0x3e')]=qs[_0x0d4d('0x3f')](_[_0x0d4d('0x40')](_0x2b45aa[_0x0d4d('0x36')],_0x4e7ed1[_0x0d4d('0x3f')]),_0x2e38dc);if(_0x2b45aa['query'][_0x0d4d('0x41')]){_0x328dc7['where']=_[_0x0d4d('0x42')](_0x328dc7[_0x0d4d('0x3e')],{'$or':_[_0x0d4d('0x31')](_0x2e38dc,function(_0x330c2e){if(_0x330c2e[_0x0d4d('0x33')]!==_0x0d4d('0x43')){var _0xdb9bcd={};_0xdb9bcd[_0x330c2e[_0x0d4d('0x2e')]]={'$like':'%'+_0x2b45aa[_0x0d4d('0x36')][_0x0d4d('0x41')]+'%'};return _0xdb9bcd;}})});}_0x328dc7=_[_0x0d4d('0x42')]({},_0x328dc7,_0x2b45aa[_0x0d4d('0x44')]);var _0x540bb7={'where':_0x328dc7['where']};return db[_0x0d4d('0x45')][_0x0d4d('0x20')](_0x540bb7)[_0x0d4d('0x27')](function(_0x373bff){_0x4dab54[_0x0d4d('0x20')]=_0x373bff;if(_0x2b45aa[_0x0d4d('0x36')][_0x0d4d('0x46')]){_0x328dc7['include']=[{'all':!![]}];}return db[_0x0d4d('0x45')][_0x0d4d('0x47')](_0x328dc7);})[_0x0d4d('0x27')](function(_0x53067c){_0x4dab54['rows']=_0x53067c;return _0x4dab54;})[_0x0d4d('0x27')](respondWithFilteredResult(_0x2b69bb,_0x328dc7))[_0x0d4d('0x48')](handleError(_0x2b69bb,null));};exports[_0x0d4d('0x49')]=function(_0x2547f4,_0x771e83){var _0x5ab5c2={'raw':!![],'where':{'id':_0x2547f4[_0x0d4d('0x4a')]['id']}},_0x57f327={};_0x57f327[_0x0d4d('0x35')]=_[_0x0d4d('0x37')](db['SmsQueue']['rawAttributes']);_0x57f327[_0x0d4d('0x36')]=_[_0x0d4d('0x37')](_0x2547f4['query']);_0x57f327[_0x0d4d('0x3f')]=_[_0x0d4d('0x38')](_0x57f327[_0x0d4d('0x35')],_0x57f327[_0x0d4d('0x36')]);_0x5ab5c2[_0x0d4d('0x39')]=_[_0x0d4d('0x38')](_0x57f327[_0x0d4d('0x35')],qs[_0x0d4d('0x3a')](_0x2547f4[_0x0d4d('0x36')]['fields']));_0x5ab5c2[_0x0d4d('0x39')]=_0x5ab5c2['attributes'][_0x0d4d('0x4b')]?_0x5ab5c2[_0x0d4d('0x39')]:_0x57f327['model'];if(_0x2547f4['query']['includeAll']){_0x5ab5c2[_0x0d4d('0x4c')]=[{'all':!![]}];}_0x5ab5c2=_[_0x0d4d('0x42')]({},_0x5ab5c2,_0x2547f4[_0x0d4d('0x44')]);return db[_0x0d4d('0x45')][_0x0d4d('0x4d')](_0x5ab5c2)[_0x0d4d('0x27')](handleEntityNotFound(_0x771e83,null))[_0x0d4d('0x27')](respondWithResult(_0x771e83,null))['catch'](handleError(_0x771e83,null));};exports[_0x0d4d('0x4e')]=function(_0x7107f1,_0x35c855){return db[_0x0d4d('0x45')][_0x0d4d('0x4e')](_0x7107f1[_0x0d4d('0x4f')],{})[_0x0d4d('0x27')](function(_0x460f04){var _0xe255a3=_0x7107f1['user']['get']({'plain':!![]});if(!_0xe255a3)throw new Error(_0x0d4d('0x50'));if(_0xe255a3[_0x0d4d('0x51')]==='user'){var _0x57fa18=_0x460f04[_0x0d4d('0x28')]({'plain':!![]});var _0x3f6d35='SmsQueues';return db['UserProfileSection'][_0x0d4d('0x4d')]({'where':{'name':_0x3f6d35,'userProfileId':_0xe255a3[_0x0d4d('0x52')]},'raw':!![]})[_0x0d4d('0x27')](function(_0x11c96d){if(_0x11c96d&&_0x11c96d[_0x0d4d('0x53')]===0x0){return db[_0x0d4d('0x2a')]['create']({'name':_0x57fa18[_0x0d4d('0x2e')],'resourceId':_0x57fa18['id'],'type':_0x11c96d[_0x0d4d('0x2e')],'sectionId':_0x11c96d['id']},{})['then'](function(){return _0x460f04;});}else{return _0x460f04;}})[_0x0d4d('0x48')](function(_0x1e3fff){logger[_0x0d4d('0x54')](_0x0d4d('0x55'),_0x1e3fff);throw _0x1e3fff;});}return _0x460f04;})[_0x0d4d('0x27')](respondWithResult(_0x35c855,0xc9))['catch'](handleError(_0x35c855,null));};exports[_0x0d4d('0x26')]=function(_0x5acc6a,_0x3d7b37){if(_0x5acc6a['body']['id']){delete _0x5acc6a['body']['id'];}return db[_0x0d4d('0x45')][_0x0d4d('0x4d')]({'where':{'id':_0x5acc6a[_0x0d4d('0x4a')]['id']}})[_0x0d4d('0x27')](handleEntityNotFound(_0x3d7b37,null))[_0x0d4d('0x27')](saveUpdates(_0x5acc6a[_0x0d4d('0x4f')],null))[_0x0d4d('0x27')](respondWithResult(_0x3d7b37,null))[_0x0d4d('0x48')](handleError(_0x3d7b37,null));};exports[_0x0d4d('0x2b')]=function(_0x122a30,_0x4ea9bd){return db[_0x0d4d('0x45')][_0x0d4d('0x4d')]({'where':{'id':_0x122a30[_0x0d4d('0x4a')]['id']}})[_0x0d4d('0x27')](handleEntityNotFound(_0x4ea9bd,null))[_0x0d4d('0x27')](removeEntity(_0x4ea9bd,null))[_0x0d4d('0x48')](handleError(_0x4ea9bd,null));};exports[_0x0d4d('0x56')]=function(_0x5bb9a6,_0x3b3aec){return db[_0x0d4d('0x45')][_0x0d4d('0x56')]()[_0x0d4d('0x27')](respondWithResult(_0x3b3aec,null))[_0x0d4d('0x48')](handleError(_0x3b3aec,null));};exports[_0x0d4d('0x57')]=function(_0x4dec47,_0x45bd6e,_0x660f2b){var _0x1cb9d2={'raw':!![],'where':{}},_0x432594={},_0x333eea;return db[_0x0d4d('0x45')][_0x0d4d('0x58')]({'where':{'id':_0x4dec47['params']['id']}})['then'](handleEntityNotFound(_0x45bd6e,null))[_0x0d4d('0x27')](function(_0x3ac035){if(_0x3ac035){_0x333eea=_0x3ac035[_0x0d4d('0x28')]({'plain':!![]});_0x432594[_0x0d4d('0x35')]=_[_0x0d4d('0x37')](db['UserSmsQueue'][_0x0d4d('0x32')]);_0x432594[_0x0d4d('0x36')]=_[_0x0d4d('0x37')](_0x4dec47[_0x0d4d('0x36')]);_0x432594['filters']=_[_0x0d4d('0x38')](_0x432594['model'],_0x432594[_0x0d4d('0x36')]);_0x1cb9d2[_0x0d4d('0x39')]=_[_0x0d4d('0x38')](_0x432594['model'],qs[_0x0d4d('0x3a')](_0x4dec47[_0x0d4d('0x36')][_0x0d4d('0x3a')]));_0x1cb9d2[_0x0d4d('0x39')]=_0x1cb9d2['attributes'][_0x0d4d('0x4b')]?_0x1cb9d2[_0x0d4d('0x39')]:_0x432594[_0x0d4d('0x35')];if(!_0x4dec47[_0x0d4d('0x36')][_0x0d4d('0x59')]('nolimit')){_0x1cb9d2['limit']=qs[_0x0d4d('0x1f')](_0x4dec47[_0x0d4d('0x36')][_0x0d4d('0x1f')]);_0x1cb9d2[_0x0d4d('0x1d')]=qs[_0x0d4d('0x1d')](_0x4dec47[_0x0d4d('0x36')][_0x0d4d('0x1d')]);}_0x1cb9d2['order']=qs['sort'](_0x4dec47[_0x0d4d('0x36')][_0x0d4d('0x3d')]);_0x1cb9d2[_0x0d4d('0x3e')]=qs['filters'](_[_0x0d4d('0x40')](_0x4dec47[_0x0d4d('0x36')],_0x432594[_0x0d4d('0x3f')]));_0x1cb9d2['where'][_0x0d4d('0x5a')]=_0x3ac035['id'];if(_0x4dec47[_0x0d4d('0x36')]['filter']){_0x1cb9d2['where']=_['merge'](_0x1cb9d2[_0x0d4d('0x3e')],{'$or':_['map'](_0x1cb9d2['attributes'],function(_0x3226c0){var _0x23a051={};_0x23a051[_0x3226c0]={'$like':'%'+_0x4dec47[_0x0d4d('0x36')][_0x0d4d('0x41')]+'%'};return _0x23a051;})});}_0x1cb9d2=_[_0x0d4d('0x42')]({},_0x1cb9d2,_0x4dec47['options']);return db['UserSmsQueue'][_0x0d4d('0x47')](_0x1cb9d2);}})[_0x0d4d('0x27')](function(_0x1b9464){if(_0x1b9464){return db[_0x0d4d('0x5b')]['findAndCountAll']({'where':{'id':_[_0x0d4d('0x31')](_0x1b9464,'UserId'),'role':_0x0d4d('0x5c')},'attributes':['id',_0x0d4d('0x2e'),_0x0d4d('0x5d'),'updatedAt',_0x0d4d('0x5e')]});}})[_0x0d4d('0x27')](function(_0x5799a6){if(_0x5799a6){return{'count':_0x5799a6[_0x0d4d('0x20')],'rows':_[_0x0d4d('0x31')](_0x5799a6[_0x0d4d('0x5f')],function(_0x65f913){return{'membername':_0x65f913[_0x0d4d('0x2e')],'UserId':_0x65f913['id'],'queue_name':_0x333eea[_0x0d4d('0x2e')],'SmsQueueId':_0x333eea['id'],'interface':util[_0x0d4d('0x60')]('%s/%s',_0x0d4d('0x61'),_0x65f913['name']),'penalty':0x0,'paused':_0x65f913['smsPause'],'createdAt':_0x65f913[_0x0d4d('0x5e')],'updatedAt':_0x65f913[_0x0d4d('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0d4d('0x27')](respondWithFilteredResult(_0x45bd6e,_0x1cb9d2))[_0x0d4d('0x48')](handleError(_0x45bd6e,null));};exports[_0x0d4d('0x63')]=function(_0x50ae15,_0x5f265e,_0x144c7d){var _0x2a08ce={};var _0x3f4841={};var _0x43b02b;var _0x1248b0;return db[_0x0d4d('0x45')][_0x0d4d('0x58')]({'where':{'id':_0x50ae15[_0x0d4d('0x4a')]['id']}})[_0x0d4d('0x27')](handleEntityNotFound(_0x5f265e,null))[_0x0d4d('0x27')](function(_0x3e06b1){if(_0x3e06b1){_0x43b02b=_0x3e06b1;_0x3f4841[_0x0d4d('0x35')]=_['keys'](db[_0x0d4d('0x64')][_0x0d4d('0x32')]);_0x3f4841[_0x0d4d('0x36')]=_[_0x0d4d('0x37')](_0x50ae15[_0x0d4d('0x36')]);_0x3f4841[_0x0d4d('0x3f')]=_[_0x0d4d('0x38')](_0x3f4841[_0x0d4d('0x35')],_0x3f4841['query']);_0x2a08ce['attributes']=_[_0x0d4d('0x38')](_0x3f4841[_0x0d4d('0x35')],qs['fields'](_0x50ae15[_0x0d4d('0x36')][_0x0d4d('0x3a')]));_0x2a08ce[_0x0d4d('0x39')]=_0x2a08ce[_0x0d4d('0x39')][_0x0d4d('0x4b')]?_0x2a08ce[_0x0d4d('0x39')]:_0x3f4841['model'];_0x2a08ce[_0x0d4d('0x3c')]=qs[_0x0d4d('0x3d')](_0x50ae15[_0x0d4d('0x36')]['sort']);_0x2a08ce[_0x0d4d('0x3e')]=qs[_0x0d4d('0x3f')](_['pick'](_0x50ae15[_0x0d4d('0x36')],_0x3f4841[_0x0d4d('0x3f')]));if(_0x50ae15['query']['filter']){_0x2a08ce[_0x0d4d('0x3e')]=_[_0x0d4d('0x42')](_0x2a08ce[_0x0d4d('0x3e')],{'$or':_['map'](_0x2a08ce[_0x0d4d('0x39')],function(_0x3a9191){var _0x320dac={};_0x320dac[_0x3a9191]={'$like':'%'+_0x50ae15[_0x0d4d('0x36')][_0x0d4d('0x41')]+'%'};return _0x320dac;})});}_0x2a08ce=_[_0x0d4d('0x42')]({},_0x2a08ce,_0x50ae15[_0x0d4d('0x44')]);return _0x43b02b['getTeams'](_0x2a08ce);}})[_0x0d4d('0x27')](function(_0x4cbeee){if(_0x4cbeee){_0x1248b0=_0x4cbeee[_0x0d4d('0x4b')];if(!_0x50ae15[_0x0d4d('0x36')][_0x0d4d('0x59')](_0x0d4d('0x3b'))){_0x2a08ce[_0x0d4d('0x1f')]=qs[_0x0d4d('0x1f')](_0x50ae15[_0x0d4d('0x36')][_0x0d4d('0x1f')]);_0x2a08ce[_0x0d4d('0x1d')]=qs['offset'](_0x50ae15['query']['offset']);}return _0x43b02b[_0x0d4d('0x63')](_0x2a08ce);}})[_0x0d4d('0x27')](function(_0x47c58e){if(_0x47c58e){return _0x47c58e?{'count':_0x1248b0,'rows':_0x47c58e}:null;}})[_0x0d4d('0x27')](respondWithResult(_0x5f265e,null))[_0x0d4d('0x48')](handleError(_0x5f265e,null));};exports['addTeams']=function(_0x5e72e3,_0x3cbaa0,_0x54fbb5){var _0x27179e=_0x5e72e3[_0x0d4d('0x4f')][_0x0d4d('0x65')];return db[_0x0d4d('0x64')][_0x0d4d('0x47')]({'where':{'id':_0x27179e},'attributes':['id'],'include':[{'model':db[_0x0d4d('0x5b')],'as':'Agents','attributes':['id',_0x0d4d('0x2e'),_0x0d4d('0x66'),'voicePause',_0x0d4d('0x67')],'raw':!![]}]})['then'](function(_0x461aa3){if(_0x461aa3){var _0x518cc4=_['flatMap'](_0x461aa3,function(_0x1f27fb){var _0x41f65d=_0x1f27fb[_0x0d4d('0x28')]({'plain':!![]});return _0x41f65d[_0x0d4d('0x68')];});return db[_0x0d4d('0x45')][_0x0d4d('0x4d')]({'where':{'id':_0x5e72e3['params']['id']}})[_0x0d4d('0x27')](function(_0x1f61b2){return db[_0x0d4d('0x69')][_0x0d4d('0x6a')](function(_0x279fe3){return _0x1f61b2[_0x0d4d('0x6b')](_0x27179e,{'transaction':_0x279fe3})['then'](function(){return BPromise[_0x0d4d('0x6c')](_0x518cc4,function(_0x478d98){return db['UserSmsQueue'][_0x0d4d('0x6d')]({'where':{'UserId':_0x478d98['id'],'SmsQueueId':_0x5e72e3['params']['id']},'transaction':_0x279fe3});});})[_0x0d4d('0x27')](function(){_0x518cc4[_0x0d4d('0x6e')](function(_0xe3eac0){socket[_0x0d4d('0x6f')]('userSmsQueue:save',{'UserId':_0xe3eac0['id'],'SmsQueueId':_0x1f61b2['id']});});});});});}})['then'](respondWithStatusCode(_0x3cbaa0,null))[_0x0d4d('0x48')](handleError(_0x3cbaa0,null));};exports[_0x0d4d('0x70')]=function(_0x58875a,_0x1746fd,_0x2df868){return db['Team'][_0x0d4d('0x47')]({'where':{'id':_0x58875a[_0x0d4d('0x36')][_0x0d4d('0x65')]},'attributes':['id'],'include':[{'model':db[_0x0d4d('0x5b')],'as':_0x0d4d('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1746fd,null))['then'](function(_0x478d4e){var _0x1d2037=_[_0x0d4d('0x31')](_0x478d4e,'id');var _0x8d8db7=[];var _0x5640fb=[];var _0x542658=squel[_0x0d4d('0x71')]();_0x542658[_0x0d4d('0x72')](_0x0d4d('0x73'))[_0x0d4d('0x74')](_0x0d4d('0x75'),'tq')[_0x0d4d('0x76')]('user_has_teams','ut',_0x0d4d('0x77'))[_0x0d4d('0x3e')](_0x0d4d('0x78'),_0x58875a['params']['id']);for(var _0x3f6c46=0x0;_0x3f6c46<_0x478d4e[_0x0d4d('0x4b')];_0x3f6c46+=0x1){let _0x2bf74d=_0x478d4e[_0x3f6c46];for(var _0x595545=0x0;_0x595545<_0x2bf74d[_0x0d4d('0x68')][_0x0d4d('0x4b')];_0x595545+=0x1){let _0x1379fc=_0x2bf74d[_0x0d4d('0x68')][_0x595545];var _0x7bb1fb=_0x542658['clone']();_0x7bb1fb[_0x0d4d('0x3e')](_0x0d4d('0x79'),_0x1379fc['id']);_0x5640fb['push'](db[_0x0d4d('0x69')]['query'](_0x7bb1fb['toString'](),{'type':db[_0x0d4d('0x69')][_0x0d4d('0x7a')][_0x0d4d('0x7b')]})[_0x0d4d('0x27')](function(_0xe81d3d){if(_0xe81d3d[_0x0d4d('0x4b')]===0x1){return _0x1379fc['id'];}else{var _0x4daee=_[_0x0d4d('0x7c')](_[_0x0d4d('0x31')](_0xe81d3d,_0x0d4d('0x7d')),function(_0x248776){return _[_0x0d4d('0x7e')](_0x1d2037,_0x248776);});if(_0x4daee){return _0x1379fc['id'];}}}));}}return BPromise['all'](_0x5640fb)[_0x0d4d('0x27')](function(_0x17815e){_0x8d8db7=_(_0x8d8db7)[_0x0d4d('0x7f')](_0x17815e)[_0x0d4d('0x80')]()[_0x0d4d('0x81')]();return db[_0x0d4d('0x45')][_0x0d4d('0x4d')]({'where':{'id':_0x58875a[_0x0d4d('0x4a')]['id']}})[_0x0d4d('0x27')](function(_0x3da95e){return db[_0x0d4d('0x69')][_0x0d4d('0x6a')](function(_0x3ff028){return _0x3da95e['removeTeams'](_0x58875a[_0x0d4d('0x36')][_0x0d4d('0x65')],{'transaction':_0x3ff028})[_0x0d4d('0x27')](function(){if(!_[_0x0d4d('0x82')](_0x8d8db7)){return _0x3da95e[_0x0d4d('0x83')](_0x8d8db7,{'transaction':_0x3ff028});}})['then'](function(){_0x8d8db7[_0x0d4d('0x6e')](function(_0x3a4ae0){socket[_0x0d4d('0x6f')](_0x0d4d('0x84'),{'UserId':_0x3a4ae0,'SmsQueueId':_0x3da95e['id']});});});});});});})['then'](respondWithStatusCode(_0x1746fd,null))[_0x0d4d('0x48')](handleError(_0x1746fd,null));};exports[_0x0d4d('0x85')]=function(_0x373095,_0x190a83,_0x39e363){return db['SmsQueue'][_0x0d4d('0x4d')]({'where':{'id':_0x373095[_0x0d4d('0x4a')]['id']}})[_0x0d4d('0x27')](handleEntityNotFound(_0x190a83,null))[_0x0d4d('0x27')](function(_0x178b37){if(_0x178b37){return _0x178b37[_0x0d4d('0x85')](_0x373095[_0x0d4d('0x4f')][_0x0d4d('0x65')],_['omit'](_0x373095[_0x0d4d('0x4f')],['ids','id'])||{})['spread'](function(_0xf22d7b){for(var _0x4cbf44=0x0;_0x4cbf44<_0x373095[_0x0d4d('0x4f')][_0x0d4d('0x65')][_0x0d4d('0x4b')];_0x4cbf44+=0x1){socket[_0x0d4d('0x6f')]('userSmsQueue:save',{'UserId':Number(_0x373095[_0x0d4d('0x4f')]['ids'][_0x4cbf44]),'SmsQueueId':Number(_0x373095[_0x0d4d('0x4a')]['id'])});}return _0xf22d7b;});}})[_0x0d4d('0x27')](respondWithResult(_0x190a83,null))[_0x0d4d('0x48')](handleError(_0x190a83,null));};exports[_0x0d4d('0x83')]=function(_0x40d0a5,_0x10db8e,_0x28c1ed){return db[_0x0d4d('0x45')][_0x0d4d('0x4d')]({'where':{'id':_0x40d0a5[_0x0d4d('0x4a')]['id']}})[_0x0d4d('0x27')](handleEntityNotFound(_0x10db8e,null))[_0x0d4d('0x27')](function(_0x2f26ce){if(_0x2f26ce){return _0x2f26ce['removeAgents'](_0x40d0a5[_0x0d4d('0x36')][_0x0d4d('0x65')])[_0x0d4d('0x27')](function(){if(_[_0x0d4d('0x86')](_0x40d0a5[_0x0d4d('0x36')][_0x0d4d('0x65')])){for(var _0x3e852d=0x0;_0x3e852d<_0x40d0a5[_0x0d4d('0x36')][_0x0d4d('0x65')][_0x0d4d('0x4b')];_0x3e852d+=0x1){socket[_0x0d4d('0x6f')](_0x0d4d('0x84'),{'UserId':Number(_0x40d0a5[_0x0d4d('0x36')][_0x0d4d('0x65')][_0x3e852d]),'SmsQueueId':Number(_0x40d0a5[_0x0d4d('0x4a')]['id'])});}}else{socket[_0x0d4d('0x6f')](_0x0d4d('0x84'),{'UserId':Number(_0x40d0a5[_0x0d4d('0x36')][_0x0d4d('0x65')]),'SmsQueueId':Number(_0x40d0a5['params']['id'])});}});}})[_0x0d4d('0x27')](respondWithStatusCode(_0x10db8e,null))[_0x0d4d('0x48')](handleError(_0x10db8e,null));};exports['getAgents']=function(_0xcbe8f0,_0x3d36b7,_0x6a72e0){var _0x28215d={};var _0x31f682={};var _0x10f130;var _0x15ef71;return db[_0x0d4d('0x45')]['findOne']({'where':{'id':_0xcbe8f0['params']['id']}})['then'](handleEntityNotFound(_0x3d36b7,null))['then'](function(_0x2b0bce){if(_0x2b0bce){_0x10f130=_0x2b0bce;_0x31f682['model']=_[_0x0d4d('0x37')](db[_0x0d4d('0x5b')][_0x0d4d('0x32')]);_0x31f682[_0x0d4d('0x36')]=_[_0x0d4d('0x37')](_0xcbe8f0['query']);_0x31f682[_0x0d4d('0x3f')]=_['intersection'](_0x31f682['model'],_0x31f682[_0x0d4d('0x36')]);_0x28215d['attributes']=_[_0x0d4d('0x38')](_0x31f682[_0x0d4d('0x35')],qs[_0x0d4d('0x3a')](_0xcbe8f0[_0x0d4d('0x36')][_0x0d4d('0x3a')]));_0x28215d['attributes']=_0x28215d['attributes']['length']?_0x28215d['attributes']:_0x31f682[_0x0d4d('0x35')];_0x28215d[_0x0d4d('0x3c')]=qs['sort'](_0xcbe8f0[_0x0d4d('0x36')]['sort']);_0x28215d[_0x0d4d('0x3e')]=qs['filters'](_[_0x0d4d('0x40')](_0xcbe8f0[_0x0d4d('0x36')],_0x31f682['filters']));if(_0xcbe8f0[_0x0d4d('0x36')]['filter']){_0x28215d['where']=_[_0x0d4d('0x42')](_0x28215d[_0x0d4d('0x3e')],{'$or':_[_0x0d4d('0x31')](_0x28215d[_0x0d4d('0x39')],function(_0x2992d5){var _0x1b608b={};_0x1b608b[_0x2992d5]={'$like':'%'+_0xcbe8f0['query']['filter']+'%'};return _0x1b608b;})});}_0x28215d=_[_0x0d4d('0x42')]({},_0x28215d,_0xcbe8f0[_0x0d4d('0x44')]);return _0x10f130['getAgents'](_0x28215d);}})['then'](function(_0x470b3c){if(_0x470b3c){_0x15ef71=_0x470b3c[_0x0d4d('0x4b')];if(!_0xcbe8f0['query'][_0x0d4d('0x59')](_0x0d4d('0x3b'))){_0x28215d[_0x0d4d('0x1f')]=qs[_0x0d4d('0x1f')](_0xcbe8f0[_0x0d4d('0x36')]['limit']);_0x28215d['offset']=qs[_0x0d4d('0x1d')](_0xcbe8f0[_0x0d4d('0x36')]['offset']);}return _0x10f130[_0x0d4d('0x87')](_0x28215d);}})[_0x0d4d('0x27')](function(_0x2af11e){if(_0x2af11e){return _0x2af11e?{'count':_0x15ef71,'rows':_0x2af11e}:null;}})[_0x0d4d('0x27')](respondWithResult(_0x3d36b7,null))['catch'](handleError(_0x3d36b7,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index e5be4bc..16cdcbb 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 _0xfcfd=['emit','events','SmsQueue','setMaxListeners','save','remove'];(function(_0x590e63,_0x31b3da){var _0x46a3bf=function(_0xe50508){while(--_0xe50508){_0x590e63['push'](_0x590e63['shift']());}};_0x46a3bf(++_0x31b3da);}(_0xfcfd,0xcd));var _0xdfcf=function(_0x3dfabb,_0x58a0db){_0x3dfabb=_0x3dfabb-0x0;var _0x54103d=_0xfcfd[_0x3dfabb];return _0x54103d;};'use strict';var EventEmitter=require(_0xdfcf('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xdfcf('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xdfcf('0x2')](0x0);var events={'afterCreate':_0xdfcf('0x3'),'afterUpdate':'update','afterDestroy':_0xdfcf('0x4')};function emitEvent(_0x1821a1){return function(_0x2c17fb,_0x3edca7,_0x564049){SmsQueueEvents['emit'](_0x1821a1+':'+_0x2c17fb['id'],_0x2c17fb);SmsQueueEvents[_0xdfcf('0x5')](_0x1821a1,_0x2c17fb);_0x564049(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xe977=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe977,0xe9));var _0x7e97=function(_0x4ef955,_0x151f6f){_0x4ef955=_0x4ef955-0x0;var _0x3ee353=_0xe977[_0x4ef955];return _0x3ee353;};'use strict';var EventEmitter=require(_0x7e97('0x0'));var SmsQueue=require(_0x7e97('0x1'))['db'][_0x7e97('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7e97('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7e97('0x4'),'afterDestroy':_0x7e97('0x5')};function emitEvent(_0x2b2c5d){return function(_0x32ecf5,_0x571149,_0x34860a){SmsQueueEvents['emit'](_0x2b2c5d+':'+_0x32ecf5['id'],_0x32ecf5);SmsQueueEvents[_0x7e97('0x6')](_0x2b2c5d,_0x32ecf5);_0x34860a(null);};}for(var e in events){if(events[_0x7e97('0x7')](e)){var event=events[e];SmsQueue[_0x7e97('0x8')](e,emitEvent(event));}}module[_0x7e97('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index e97b905..e112b8a 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 _0xc040=['./smsQueue.attributes','exports','define','sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d2003,_0x1d21e0){var _0x52db60=function(_0x4706f2){while(--_0x4706f2){_0x3d2003['push'](_0x3d2003['shift']());}};_0x52db60(++_0x1d21e0);}(_0xc040,0x1e5));var _0x0c04=function(_0x57597a,_0x10b11c){_0x57597a=_0x57597a-0x0;var _0x5c3f24=_0xc040[_0x57597a];return _0x5c3f24;};'use strict';var _=require(_0x0c04('0x0'));var util=require(_0x0c04('0x1'));var logger=require(_0x0c04('0x2'))(_0x0c04('0x3'));var moment=require('moment');var BPromise=require(_0x0c04('0x4'));var rp=require(_0x0c04('0x5'));var fs=require('fs');var path=require(_0x0c04('0x6'));var rimraf=require(_0x0c04('0x7'));var config=require(_0x0c04('0x8'));var attributes=require(_0x0c04('0x9'));module[_0x0c04('0xa')]=function(_0x2e49f3,_0xfdd843){return _0x2e49f3[_0x0c04('0xb')]('SmsQueue',attributes,{'tableName':_0x0c04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8065=['util','api','request-promise','path','rimraf','./smsQueue.attributes','exports','define','sms_queues','lodash'];(function(_0x485731,_0x3edd32){var _0x198efc=function(_0x53dca2){while(--_0x53dca2){_0x485731['push'](_0x485731['shift']());}};_0x198efc(++_0x3edd32);}(_0x8065,0xa9));var _0x5806=function(_0x25ea21,_0x266c3a){_0x25ea21=_0x25ea21-0x0;var _0x431523=_0x8065[_0x25ea21];return _0x431523;};'use strict';var _=require(_0x5806('0x0'));var util=require(_0x5806('0x1'));var logger=require('../../config/logger')(_0x5806('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5806('0x3'));var fs=require('fs');var path=require(_0x5806('0x4'));var rimraf=require(_0x5806('0x5'));var config=require('../../config/environment');var attributes=require(_0x5806('0x6'));module[_0x5806('0x7')]=function(_0x561c75,_0x3d4083){return _0x561c75[_0x5806('0x8')]('SmsQueue',attributes,{'tableName':_0x5806('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index e8f9758..fcc455d 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 _0x4d76=['findAll','options','where','attributes','limit','map','model','include','GetSmsQueue','ShowSmsQueue','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','register','then','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch'];(function(_0x532bee,_0xe3ec4c){var _0x3793b3=function(_0x26a32e){while(--_0x26a32e){_0x532bee['push'](_0x532bee['shift']());}};_0x3793b3(++_0xe3ec4c);}(_0x4d76,0x11b));var _0x64d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d76[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x64d7('0x0'));var util=require(_0x64d7('0x1'));var moment=require(_0x64d7('0x2'));var BPromise=require(_0x64d7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x64d7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x64d7('0x5'));var logger=require('../../config/logger')(_0x64d7('0x6'));var config=require(_0x64d7('0x7'));var jayson=require(_0x64d7('0x8'));var client=jayson['client'][_0x64d7('0x9')]({'port':0x232a});config['redis']=_[_0x64d7('0xa')](config[_0x64d7('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x64d7('0xc'))(new Redis(config[_0x64d7('0xb')]));require('./smsQueue.socket')[_0x64d7('0xd')](socket);function respondWithRpcPromise(_0x2c3527,_0x312248,_0x2db92b){return new BPromise(function(_0x5cbd12,_0x314604){return client['request'](_0x2c3527,_0x2db92b)[_0x64d7('0xe')](function(_0x35b0ec){logger['info'](_0x64d7('0xf'),_0x312248,'request\x20sent');logger[_0x64d7('0x10')](_0x64d7('0x11'),_0x312248,_0x64d7('0x12'),JSON['stringify'](_0x35b0ec));if(_0x35b0ec['error']){if(_0x35b0ec['error']['code']===0x1f4){logger[_0x64d7('0x13')](_0x64d7('0xf'),_0x312248,_0x35b0ec[_0x64d7('0x13')][_0x64d7('0x14')]);return _0x314604(_0x35b0ec['error'][_0x64d7('0x14')]);}logger[_0x64d7('0x13')]('SmsQueue,\x20%s,\x20%s',_0x312248,_0x35b0ec[_0x64d7('0x13')][_0x64d7('0x14')]);return _0x5cbd12(_0x35b0ec[_0x64d7('0x13')][_0x64d7('0x14')]);}else{logger[_0x64d7('0x15')]('SmsQueue,\x20%s,\x20%s',_0x312248,'request\x20sent');_0x5cbd12(_0x35b0ec['result'][_0x64d7('0x14')]);}})[_0x64d7('0x16')](function(_0x3f73fe){logger[_0x64d7('0x13')](_0x64d7('0xf'),_0x312248,_0x3f73fe);_0x314604(_0x3f73fe);});});}exports['GetSmsQueue']=function(_0x22e1ab){var _0x4dc696=this;return new Promise(function(_0x35af3c,_0x3ecf33){return db['SmsQueue'][_0x64d7('0x17')]({'raw':_0x22e1ab[_0x64d7('0x18')]?_0x22e1ab[_0x64d7('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x22e1ab[_0x64d7('0x18')]?_0x22e1ab[_0x64d7('0x18')][_0x64d7('0x19')]||null:null,'attributes':_0x22e1ab[_0x64d7('0x18')]?_0x22e1ab['options'][_0x64d7('0x1a')]||null:null,'limit':_0x22e1ab[_0x64d7('0x18')]?_0x22e1ab[_0x64d7('0x18')][_0x64d7('0x1b')]||null:null,'include':_0x22e1ab[_0x64d7('0x18')]?_0x22e1ab[_0x64d7('0x18')]['include']?_[_0x64d7('0x1c')](_0x22e1ab['options']['include'],function(_0x49b5f3){return{'model':db[_0x49b5f3[_0x64d7('0x1d')]],'as':_0x49b5f3['as'],'attributes':_0x49b5f3[_0x64d7('0x1a')],'include':_0x49b5f3[_0x64d7('0x1e')]?_[_0x64d7('0x1c')](_0x49b5f3[_0x64d7('0x1e')],function(_0x2afd37){return{'model':db[_0x2afd37[_0x64d7('0x1d')]],'as':_0x2afd37['as'],'attributes':_0x2afd37['attributes'],'include':_0x2afd37[_0x64d7('0x1e')]?_[_0x64d7('0x1c')](_0x2afd37['include'],function(_0x2565cb){return{'model':db[_0x2565cb['model']],'as':_0x2565cb['as'],'attributes':_0x2565cb[_0x64d7('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53e810){logger[_0x64d7('0x15')](_0x64d7('0x1f'),_0x22e1ab);logger['debug']('GetSmsQueue',_0x22e1ab,JSON['stringify'](_0x53e810));_0x35af3c(_0x53e810);})[_0x64d7('0x16')](function(_0x599ac4){logger[_0x64d7('0x13')](_0x64d7('0x1f'),_0x599ac4[_0x64d7('0x14')],_0x22e1ab);_0x3ecf33(_0x4dc696[_0x64d7('0x13')](0x1f4,_0x599ac4[_0x64d7('0x14')]));});});};exports[_0x64d7('0x20')]=function(_0x31a8f2){var _0x414629=this;return new Promise(function(_0x3de1e8,_0x55aba9){return db['SmsQueue']['find']({'raw':_0x31a8f2[_0x64d7('0x18')]?_0x31a8f2[_0x64d7('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x31a8f2[_0x64d7('0x18')]?_0x31a8f2['options']['where']||null:null,'attributes':_0x31a8f2[_0x64d7('0x18')]?_0x31a8f2[_0x64d7('0x18')][_0x64d7('0x1a')]||null:null,'include':_0x31a8f2['options']?_0x31a8f2[_0x64d7('0x18')][_0x64d7('0x1e')]?_['map'](_0x31a8f2[_0x64d7('0x18')][_0x64d7('0x1e')],function(_0x36a5f4){return{'model':db[_0x36a5f4[_0x64d7('0x1d')]],'as':_0x36a5f4['as'],'attributes':_0x36a5f4[_0x64d7('0x1a')],'include':_0x36a5f4['include']?_[_0x64d7('0x1c')](_0x36a5f4[_0x64d7('0x1e')],function(_0x49b99c){return{'model':db[_0x49b99c[_0x64d7('0x1d')]],'as':_0x49b99c['as'],'attributes':_0x49b99c[_0x64d7('0x1a')],'include':_0x49b99c['include']?_[_0x64d7('0x1c')](_0x49b99c['include'],function(_0x3cca31){return{'model':db[_0x3cca31[_0x64d7('0x1d')]],'as':_0x3cca31['as'],'attributes':_0x3cca31[_0x64d7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x64d7('0xe')](function(_0x42d397){logger[_0x64d7('0x15')]('ShowSmsQueue',_0x31a8f2);logger[_0x64d7('0x10')](_0x64d7('0x20'),_0x31a8f2,JSON[_0x64d7('0x21')](_0x42d397));_0x3de1e8(_0x42d397);})[_0x64d7('0x16')](function(_0x158214){logger[_0x64d7('0x13')](_0x64d7('0x20'),_0x158214[_0x64d7('0x14')],_0x31a8f2);_0x55aba9(_0x414629['error'](0x1f4,_0x158214['message']));});});}; \ No newline at end of file +var _0xa587=['map','model','GetSmsQueue','ShowSmsQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./smsQueue.socket','register','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch','findAll','options','where','attributes','limit','include'];(function(_0x3a37ec,_0x3328af){var _0x4ec330=function(_0x10b425){while(--_0x10b425){_0x3a37ec['push'](_0x3a37ec['shift']());}};_0x4ec330(++_0x3328af);}(_0xa587,0x81));var _0x7a58=function(_0x420a87,_0x280554){_0x420a87=_0x420a87-0x0;var _0x2f0898=_0xa587[_0x420a87];return _0x2f0898;};'use strict';var _=require(_0x7a58('0x0'));var util=require(_0x7a58('0x1'));var moment=require(_0x7a58('0x2'));var BPromise=require(_0x7a58('0x3'));var rs=require(_0x7a58('0x4'));var fs=require('fs');var Redis=require(_0x7a58('0x5'));var db=require(_0x7a58('0x6'))['db'];var utils=require(_0x7a58('0x7'));var logger=require(_0x7a58('0x8'))(_0x7a58('0x9'));var config=require(_0x7a58('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x7a58('0xb')]=_[_0x7a58('0xc')](config[_0x7a58('0xb')],{'host':_0x7a58('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7a58('0xb')]));require(_0x7a58('0xe'))[_0x7a58('0xf')](socket);function respondWithRpcPromise(_0x383f94,_0x114b49,_0xd37f59){return new BPromise(function(_0x30f443,_0x36c095){return client[_0x7a58('0x10')](_0x383f94,_0xd37f59)[_0x7a58('0x11')](function(_0x3dd446){logger[_0x7a58('0x12')]('SmsQueue,\x20%s,\x20%s',_0x114b49,_0x7a58('0x13'));logger[_0x7a58('0x14')](_0x7a58('0x15'),_0x114b49,_0x7a58('0x13'),JSON[_0x7a58('0x16')](_0x3dd446));if(_0x3dd446['error']){if(_0x3dd446[_0x7a58('0x17')][_0x7a58('0x18')]===0x1f4){logger[_0x7a58('0x17')](_0x7a58('0x19'),_0x114b49,_0x3dd446[_0x7a58('0x17')]['message']);return _0x36c095(_0x3dd446[_0x7a58('0x17')][_0x7a58('0x1a')]);}logger[_0x7a58('0x17')]('SmsQueue,\x20%s,\x20%s',_0x114b49,_0x3dd446[_0x7a58('0x17')][_0x7a58('0x1a')]);return _0x30f443(_0x3dd446['error'][_0x7a58('0x1a')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x114b49,'request\x20sent');_0x30f443(_0x3dd446[_0x7a58('0x1b')][_0x7a58('0x1a')]);}})[_0x7a58('0x1c')](function(_0x36eb46){logger[_0x7a58('0x17')](_0x7a58('0x19'),_0x114b49,_0x36eb46);_0x36c095(_0x36eb46);});});}exports['GetSmsQueue']=function(_0x171357){var _0x511b11=this;return new Promise(function(_0x1376fe,_0x2aee67){return db['SmsQueue'][_0x7a58('0x1d')]({'raw':_0x171357[_0x7a58('0x1e')]?_0x171357[_0x7a58('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x171357['options']?_0x171357['options'][_0x7a58('0x1f')]||null:null,'attributes':_0x171357[_0x7a58('0x1e')]?_0x171357['options'][_0x7a58('0x20')]||null:null,'limit':_0x171357[_0x7a58('0x1e')]?_0x171357[_0x7a58('0x1e')][_0x7a58('0x21')]||null:null,'include':_0x171357['options']?_0x171357['options'][_0x7a58('0x22')]?_[_0x7a58('0x23')](_0x171357[_0x7a58('0x1e')]['include'],function(_0x1d4f0b){return{'model':db[_0x1d4f0b['model']],'as':_0x1d4f0b['as'],'attributes':_0x1d4f0b['attributes'],'include':_0x1d4f0b[_0x7a58('0x22')]?_[_0x7a58('0x23')](_0x1d4f0b[_0x7a58('0x22')],function(_0x5dfe9e){return{'model':db[_0x5dfe9e[_0x7a58('0x24')]],'as':_0x5dfe9e['as'],'attributes':_0x5dfe9e[_0x7a58('0x20')],'include':_0x5dfe9e['include']?_['map'](_0x5dfe9e['include'],function(_0x2994ef){return{'model':db[_0x2994ef[_0x7a58('0x24')]],'as':_0x2994ef['as'],'attributes':_0x2994ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a58('0x11')](function(_0x48dce9){logger[_0x7a58('0x12')](_0x7a58('0x25'),_0x171357);logger[_0x7a58('0x14')](_0x7a58('0x25'),_0x171357,JSON[_0x7a58('0x16')](_0x48dce9));_0x1376fe(_0x48dce9);})['catch'](function(_0xf50f39){logger[_0x7a58('0x17')](_0x7a58('0x25'),_0xf50f39[_0x7a58('0x1a')],_0x171357);_0x2aee67(_0x511b11['error'](0x1f4,_0xf50f39['message']));});});};exports[_0x7a58('0x26')]=function(_0x14f0c9){var _0x25a06a=this;return new Promise(function(_0x1b10cb,_0x5e9202){return db['SmsQueue'][_0x7a58('0x27')]({'raw':_0x14f0c9[_0x7a58('0x1e')]?_0x14f0c9['options'][_0x7a58('0x28')]===undefined?!![]:![]:!![],'where':_0x14f0c9[_0x7a58('0x1e')]?_0x14f0c9['options'][_0x7a58('0x1f')]||null:null,'attributes':_0x14f0c9['options']?_0x14f0c9['options']['attributes']||null:null,'include':_0x14f0c9[_0x7a58('0x1e')]?_0x14f0c9[_0x7a58('0x1e')][_0x7a58('0x22')]?_['map'](_0x14f0c9[_0x7a58('0x1e')][_0x7a58('0x22')],function(_0x4c5cb3){return{'model':db[_0x4c5cb3['model']],'as':_0x4c5cb3['as'],'attributes':_0x4c5cb3['attributes'],'include':_0x4c5cb3['include']?_[_0x7a58('0x23')](_0x4c5cb3['include'],function(_0x3b256f){return{'model':db[_0x3b256f[_0x7a58('0x24')]],'as':_0x3b256f['as'],'attributes':_0x3b256f[_0x7a58('0x20')],'include':_0x3b256f[_0x7a58('0x22')]?_['map'](_0x3b256f[_0x7a58('0x22')],function(_0x22a019){return{'model':db[_0x22a019[_0x7a58('0x24')]],'as':_0x22a019['as'],'attributes':_0x22a019[_0x7a58('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7a58('0x11')](function(_0x405852){logger['info']('ShowSmsQueue',_0x14f0c9);logger[_0x7a58('0x14')](_0x7a58('0x26'),_0x14f0c9,JSON[_0x7a58('0x16')](_0x405852));_0x1b10cb(_0x405852);})[_0x7a58('0x1c')](function(_0xe58905){logger[_0x7a58('0x17')](_0x7a58('0x26'),_0xe58905['message'],_0x14f0c9);_0x5e9202(_0x25a06a[_0x7a58('0x17')](0x1f4,_0xe58905[_0x7a58('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 14e9af9..123b1c1 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 _0xc87a=['save','update','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0x2faf95,_0x26399b){var _0x58569d=function(_0x1a0a1e){while(--_0x1a0a1e){_0x2faf95['push'](_0x2faf95['shift']());}};_0x58569d(++_0x26399b);}(_0xc87a,0xdf));var _0xac87=function(_0x365926,_0x4d70f2){_0x365926=_0x365926-0x0;var _0x987114=_0xc87a[_0x365926];return _0x987114;};'use strict';var SmsQueueEvents=require(_0xac87('0x0'));var events=[_0xac87('0x1'),'remove',_0xac87('0x2')];function createListener(_0xeabbee,_0x136d6e){return function(_0x52f5b5){_0x136d6e['emit'](_0xeabbee,_0x52f5b5);};}function removeListener(_0x2a6818,_0x948692){return function(){SmsQueueEvents[_0xac87('0x3')](_0x2a6818,_0x948692);};}exports[_0xac87('0x4')]=function(_0x41f22a){for(var _0x1491fe=0x0,_0x3753b5=events[_0xac87('0x5')];_0x1491fe<_0x3753b5;_0x1491fe++){var _0x3a2920=events[_0x1491fe];var _0x4fb8c7=createListener(_0xac87('0x6')+_0x3a2920,_0x41f22a);SmsQueueEvents['on'](_0x3a2920,_0x4fb8c7);}}; \ No newline at end of file +var _0x66fc=['smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x66fc,0xf1));var _0xc66f=function(_0x1ef1e7,_0x39e36e){_0x1ef1e7=_0x1ef1e7-0x0;var _0x15f674=_0x66fc[_0x1ef1e7];return _0x15f674;};'use strict';var SmsQueueEvents=require(_0xc66f('0x0'));var events=[_0xc66f('0x1'),_0xc66f('0x2'),_0xc66f('0x3')];function createListener(_0x37e0aa,_0x3ae6cc){return function(_0x3a4ddf){_0x3ae6cc[_0xc66f('0x4')](_0x37e0aa,_0x3a4ddf);};}function removeListener(_0x590767,_0x728ef7){return function(){SmsQueueEvents[_0xc66f('0x5')](_0x590767,_0x728ef7);};}exports[_0xc66f('0x6')]=function(_0x3695c2){for(var _0x13e22a=0x0,_0x33a2a5=events['length'];_0x13e22a<_0x33a2a5;_0x13e22a++){var _0x77d7ee=events[_0x13e22a];var _0x33ff81=createListener(_0xc66f('0x7')+_0x77d7ee,_0x3695c2);SmsQueueEvents['on'](_0x77d7ee,_0x33ff81);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index cc6db5b..9ebb52c 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 _0xc949=['show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4b3e6c,_0x5a09b2){var _0x3e510b=function(_0x18afc5){while(--_0x18afc5){_0x4b3e6c['push'](_0x4b3e6c['shift']());}};_0x3e510b(++_0x5a09b2);}(_0xc949,0x181));var _0x9c94=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xc949[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x9c94('0x0'));var util=require('util');var path=require(_0x9c94('0x1'));var timeout=require(_0x9c94('0x2'));var express=require(_0x9c94('0x3'));var router=express[_0x9c94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c94('0x5'));var interaction=require(_0x9c94('0x6'));var config=require('../../config/environment');var controller=require(_0x9c94('0x7'));router[_0x9c94('0x8')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0xa')]);router['get'](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xc')]);router[_0x9c94('0x8')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xe')]);router[_0x9c94('0xf')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0x10')]);router['put'](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x11')]);router[_0x9c94('0x12')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x13')]);module[_0x9c94('0x14')]=router; \ No newline at end of file +var _0x09b1=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','show','put','/:id','update','delete','exports','multer'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x09b1,0xa7));var _0x109b=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x09b1[_0xfa634c];return _0x73e478;};'use strict';var multer=require(_0x109b('0x0'));var util=require(_0x109b('0x1'));var path=require(_0x109b('0x2'));var timeout=require(_0x109b('0x3'));var express=require(_0x109b('0x4'));var router=express['Router']();var fs_extra=require(_0x109b('0x5'));var auth=require(_0x109b('0x6'));var interaction=require(_0x109b('0x7'));var config=require(_0x109b('0x8'));var controller=require(_0x109b('0x9'));router[_0x109b('0xa')]('/',auth['isAuthenticated'](),controller[_0x109b('0xb')]);router[_0x109b('0xa')](_0x109b('0xc'),auth[_0x109b('0xd')](),controller[_0x109b('0xe')]);router['get']('/:id',auth[_0x109b('0xd')](),controller[_0x109b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x109b('0x10')](_0x109b('0x11'),auth['isAuthenticated'](),controller[_0x109b('0x12')]);router[_0x109b('0x13')](_0x109b('0x11'),auth[_0x109b('0xd')](),controller['destroy']);module[_0x109b('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 7c4135b..757ad5b 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 _0x9f84=['STRING','DATE','sequelize','exports'];(function(_0x4314cf,_0x35268d){var _0x2ddafe=function(_0x2e42ad){while(--_0x2e42ad){_0x4314cf['push'](_0x4314cf['shift']());}};_0x2ddafe(++_0x35268d);}(_0x9f84,0x10a));var _0x49f8=function(_0x416d60,_0x56dde9){_0x416d60=_0x416d60-0x0;var _0x286bd7=_0x9f84[_0x416d60];return _0x286bd7;};'use strict';var moment=require('moment');var Sequelize=require(_0x49f8('0x0'));module[_0x49f8('0x1')]={'uniqueid':{'type':Sequelize[_0x49f8('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x49f8('0x2')]},'joinAt':{'type':Sequelize[_0x49f8('0x3')]},'leaveAt':{'type':Sequelize[_0x49f8('0x3')]},'acceptAt':{'type':Sequelize[_0x49f8('0x3')]},'exitAt':{'type':Sequelize[_0x49f8('0x3')]},'reason':{'type':Sequelize[_0x49f8('0x2')]}}; \ No newline at end of file +var _0x428a=['sequelize','exports','DATE','STRING','moment'];(function(_0x568c94,_0x35ca7a){var _0x2f138a=function(_0x1fc1fd){while(--_0x1fc1fd){_0x568c94['push'](_0x568c94['shift']());}};_0x2f138a(++_0x35ca7a);}(_0x428a,0x1da));var _0xa428=function(_0x8a985e,_0x4d2522){_0x8a985e=_0x8a985e-0x0;var _0x4f9d52=_0x428a[_0x8a985e];return _0x4f9d52;};'use strict';var moment=require(_0xa428('0x0'));var Sequelize=require(_0xa428('0x1'));module[_0xa428('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa428('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa428('0x4')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 6bc6a8c..dd2da5a 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 _0x9988=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js'];(function(_0x2853ee,_0x4bbfc5){var _0x360368=function(_0x2ffe6f){while(--_0x2ffe6f){_0x2853ee['push'](_0x2853ee['shift']());}};_0x360368(++_0x4bbfc5);}(_0x9988,0x160));var _0x8998=function(_0x356a22,_0x241023){_0x356a22=_0x356a22-0x0;var _0x3b9add=_0x9988[_0x356a22];return _0x3b9add;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8998('0x0'));var zipdir=require(_0x8998('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8998('0x2'));var BPromise=require(_0x8998('0x3'));var Mustache=require('mustache');var util=require(_0x8998('0x4'));var path=require(_0x8998('0x5'));var sox=require(_0x8998('0x6'));var csv=require(_0x8998('0x7'));var ejs=require(_0x8998('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8998('0x9'));var squel=require(_0x8998('0xa'));var crypto=require('crypto');var jsforce=require(_0x8998('0xb'));var deskjs=require(_0x8998('0xc'));var toCsv=require(_0x8998('0x7'));var querystring=require(_0x8998('0xd'));var Papa=require(_0x8998('0xe'));var Redis=require(_0x8998('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8998('0x10'));var as=require(_0x8998('0x11'));var hardwareService=require(_0x8998('0x12'));var logger=require(_0x8998('0x13'))('api');var utils=require(_0x8998('0x14'));var config=require(_0x8998('0x15'));var licenseUtil=require(_0x8998('0x16'));var db=require(_0x8998('0x17'))['db'];function respondWithStatusCode(_0x5dce16,_0x4b3b03){_0x4b3b03=_0x4b3b03||0xcc;return function(_0x44ef69){if(_0x44ef69){return _0x5dce16[_0x8998('0x18')](_0x4b3b03);}return _0x5dce16[_0x8998('0x19')](_0x4b3b03)[_0x8998('0x1a')]();};}function respondWithResult(_0x4d4ce4,_0x1ac445){_0x1ac445=_0x1ac445||0xc8;return function(_0x4aeac0){if(_0x4aeac0){return _0x4d4ce4[_0x8998('0x19')](_0x1ac445)['json'](_0x4aeac0);}};}function respondWithFilteredResult(_0x82d1f,_0x176e45){return function(_0x554953){if(_0x554953){var _0x14887e=typeof _0x176e45[_0x8998('0x1b')]===_0x8998('0x1c')&&typeof _0x176e45[_0x8998('0x1d')]===_0x8998('0x1c');var _0x3bfa94=_0x554953[_0x8998('0x1e')];var _0x3adc32=_0x14887e?0x0:_0x176e45[_0x8998('0x1b')];var _0x1bd6ab=_0x14887e?_0x554953[_0x8998('0x1e')]:_0x176e45['offset']+_0x176e45[_0x8998('0x1d')];var _0x1d869f;if(_0x1bd6ab>=_0x3bfa94){_0x1bd6ab=_0x3bfa94;_0x1d869f=0xc8;}else{_0x1d869f=0xce;}_0x82d1f[_0x8998('0x19')](_0x1d869f);return _0x82d1f[_0x8998('0x1f')]('Content-Range',_0x3adc32+'-'+_0x1bd6ab+'/'+_0x3bfa94)[_0x8998('0x20')](_0x554953);}return null;};}function patchUpdates(_0x775148){return function(_0x504f85){try{jsonpatch[_0x8998('0x21')](_0x504f85,_0x775148,!![]);}catch(_0x5b8e4c){return BPromise['reject'](_0x5b8e4c);}return _0x504f85[_0x8998('0x22')]();};}function saveUpdates(_0x59ba71,_0x26495f){return function(_0x36af6d){if(_0x36af6d){return _0x36af6d[_0x8998('0x23')](_0x59ba71)[_0x8998('0x24')](function(_0x29151e){return _0x29151e;});}return null;};}function removeEntity(_0x143494,_0x126576){return function(_0x59cc43){if(_0x59cc43){return _0x59cc43[_0x8998('0x25')]()[_0x8998('0x24')](function(){_0x143494[_0x8998('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x299d28,_0x2918a4){return function(_0x206e92){if(!_0x206e92){_0x299d28[_0x8998('0x18')](0x194);}return _0x206e92;};}function handleError(_0x10607e,_0x2211c0){_0x2211c0=_0x2211c0||0x1f4;return function(_0x7a4340){logger[_0x8998('0x26')](_0x7a4340[_0x8998('0x27')]);if(_0x7a4340[_0x8998('0x28')]){delete _0x7a4340[_0x8998('0x28')];}_0x10607e['status'](_0x2211c0)[_0x8998('0x29')](_0x7a4340);};}exports[_0x8998('0x2a')]=function(_0x3172a8,_0x210599){var _0xbf2ada={},_0x56a9d5={},_0x3ef3d4={'count':0x0,'rows':[]};var _0x1a85a0=_[_0x8998('0x2b')](db[_0x8998('0x2c')][_0x8998('0x2d')],function(_0x10e755){return{'name':_0x10e755[_0x8998('0x2e')],'type':_0x10e755[_0x8998('0x2f')][_0x8998('0x30')]};});_0x56a9d5[_0x8998('0x31')]=_[_0x8998('0x2b')](_0x1a85a0,_0x8998('0x28'));_0x56a9d5[_0x8998('0x32')]=_[_0x8998('0x33')](_0x3172a8['query']);_0x56a9d5['filters']=_[_0x8998('0x34')](_0x56a9d5[_0x8998('0x31')],_0x56a9d5[_0x8998('0x32')]);_0xbf2ada[_0x8998('0x35')]=_[_0x8998('0x34')](_0x56a9d5['model'],qs[_0x8998('0x36')](_0x3172a8['query'][_0x8998('0x36')]));_0xbf2ada[_0x8998('0x35')]=_0xbf2ada[_0x8998('0x35')][_0x8998('0x37')]?_0xbf2ada['attributes']:_0x56a9d5[_0x8998('0x31')];if(!_0x3172a8[_0x8998('0x32')][_0x8998('0x38')]('nolimit')){_0xbf2ada[_0x8998('0x1d')]=qs[_0x8998('0x1d')](_0x3172a8['query']['limit']);_0xbf2ada['offset']=qs[_0x8998('0x1b')](_0x3172a8[_0x8998('0x32')][_0x8998('0x1b')]);}_0xbf2ada['order']=qs['sort'](_0x3172a8[_0x8998('0x32')][_0x8998('0x39')]);_0xbf2ada['where']=qs[_0x8998('0x3a')](_['pick'](_0x3172a8['query'],_0x56a9d5[_0x8998('0x3a')]),_0x1a85a0);if(_0x3172a8[_0x8998('0x32')][_0x8998('0x3b')]){_0xbf2ada[_0x8998('0x3c')]=_[_0x8998('0x3d')](_0xbf2ada[_0x8998('0x3c')],{'$or':_[_0x8998('0x2b')](_0x1a85a0,function(_0x180d46){if(_0x180d46[_0x8998('0x2f')]!=='VIRTUAL'){var _0x47211c={};_0x47211c[_0x180d46[_0x8998('0x28')]]={'$like':'%'+_0x3172a8[_0x8998('0x32')][_0x8998('0x3b')]+'%'};return _0x47211c;}})});}_0xbf2ada=_[_0x8998('0x3d')]({},_0xbf2ada,_0x3172a8[_0x8998('0x3e')]);var _0x2d6e83={'where':_0xbf2ada[_0x8998('0x3c')]};return db[_0x8998('0x2c')][_0x8998('0x1e')](_0x2d6e83)[_0x8998('0x24')](function(_0x35755f){_0x3ef3d4['count']=_0x35755f;if(_0x3172a8['query'][_0x8998('0x3f')]){_0xbf2ada[_0x8998('0x40')]=[{'all':!![]}];}return db[_0x8998('0x2c')][_0x8998('0x41')](_0xbf2ada);})[_0x8998('0x24')](function(_0x49e2b2){_0x3ef3d4[_0x8998('0x42')]=_0x49e2b2;return _0x3ef3d4;})[_0x8998('0x24')](respondWithFilteredResult(_0x210599,_0xbf2ada))[_0x8998('0x43')](handleError(_0x210599,null));};exports['show']=function(_0x197bac,_0x544989){var _0x4c0d2d={'raw':!![],'where':{'id':_0x197bac[_0x8998('0x44')]['id']}},_0x46d631={};_0x46d631['model']=_[_0x8998('0x33')](db[_0x8998('0x2c')][_0x8998('0x2d')]);_0x46d631[_0x8998('0x32')]=_[_0x8998('0x33')](_0x197bac[_0x8998('0x32')]);_0x46d631[_0x8998('0x3a')]=_['intersection'](_0x46d631['model'],_0x46d631[_0x8998('0x32')]);_0x4c0d2d[_0x8998('0x35')]=_[_0x8998('0x34')](_0x46d631['model'],qs[_0x8998('0x36')](_0x197bac[_0x8998('0x32')]['fields']));_0x4c0d2d[_0x8998('0x35')]=_0x4c0d2d[_0x8998('0x35')]['length']?_0x4c0d2d['attributes']:_0x46d631['model'];if(_0x197bac[_0x8998('0x32')][_0x8998('0x3f')]){_0x4c0d2d[_0x8998('0x40')]=[{'all':!![]}];}_0x4c0d2d=_[_0x8998('0x3d')]({},_0x4c0d2d,_0x197bac['options']);return db[_0x8998('0x2c')][_0x8998('0x45')](_0x4c0d2d)['then'](handleEntityNotFound(_0x544989,null))[_0x8998('0x24')](respondWithResult(_0x544989,null))['catch'](handleError(_0x544989,null));};exports['create']=function(_0x4a1d84,_0x56a94b){return db[_0x8998('0x2c')][_0x8998('0x46')](_0x4a1d84[_0x8998('0x47')],{})[_0x8998('0x24')](respondWithResult(_0x56a94b,0xc9))[_0x8998('0x43')](handleError(_0x56a94b,null));};exports['update']=function(_0x5853c8,_0x5d2974){if(_0x5853c8['body']['id']){delete _0x5853c8[_0x8998('0x47')]['id'];}return db['SmsQueueReport'][_0x8998('0x45')]({'where':{'id':_0x5853c8[_0x8998('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d2974,null))[_0x8998('0x24')](saveUpdates(_0x5853c8[_0x8998('0x47')],null))['then'](respondWithResult(_0x5d2974,null))[_0x8998('0x43')](handleError(_0x5d2974,null));};exports[_0x8998('0x25')]=function(_0x3ca5ba,_0x378fba){return db[_0x8998('0x2c')][_0x8998('0x45')]({'where':{'id':_0x3ca5ba['params']['id']}})['then'](handleEntityNotFound(_0x378fba,null))[_0x8998('0x24')](removeEntity(_0x378fba,null))[_0x8998('0x43')](handleError(_0x378fba,null));};exports['describe']=function(_0x3817bc,_0x3422fa){return db[_0x8998('0x2c')][_0x8998('0x48')]()[_0x8998('0x24')](respondWithResult(_0x3422fa,null))[_0x8998('0x43')](handleError(_0x3422fa,null));}; \ No newline at end of file +var _0xc0c4=['end','offset','limit','json','apply','save','update','then','destroy','error','name','send','index','map','SmsQueueReport','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','count','includeAll','include','rows','catch','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0xe97099,_0x27ea70){var _0x5d89db=function(_0x4e4ccb){while(--_0x4e4ccb){_0xe97099['push'](_0xe97099['shift']());}};_0x5d89db(++_0x27ea70);}(_0xc0c4,0x105));var _0x4c0c=function(_0xea2e3d,_0xf731d8){_0xea2e3d=_0xea2e3d-0x0;var _0x1d556e=_0xc0c4[_0xea2e3d];return _0x1d556e;};'use strict';var emlformat=require(_0x4c0c('0x0'));var rimraf=require(_0x4c0c('0x1'));var zipdir=require(_0x4c0c('0x2'));var jsonpatch=require(_0x4c0c('0x3'));var rp=require(_0x4c0c('0x4'));var moment=require(_0x4c0c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4c0c('0x6'));var util=require(_0x4c0c('0x7'));var path=require(_0x4c0c('0x8'));var sox=require(_0x4c0c('0x9'));var csv=require(_0x4c0c('0xa'));var ejs=require(_0x4c0c('0xb'));var fs=require('fs');var fs_extra=require(_0x4c0c('0xc'));var _=require('lodash');var squel=require(_0x4c0c('0xd'));var crypto=require('crypto');var jsforce=require(_0x4c0c('0xe'));var deskjs=require(_0x4c0c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4c0c('0x10'));var Papa=require(_0x4c0c('0x11'));var Redis=require(_0x4c0c('0x12'));var authService=require(_0x4c0c('0x13'));var qs=require(_0x4c0c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c0c('0x15'));var logger=require(_0x4c0c('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x4c0c('0x17'));var licenseUtil=require(_0x4c0c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fca98,_0x478529){_0x478529=_0x478529||0xcc;return function(_0x13551c){if(_0x13551c){return _0x3fca98[_0x4c0c('0x19')](_0x478529);}return _0x3fca98[_0x4c0c('0x1a')](_0x478529)[_0x4c0c('0x1b')]();};}function respondWithResult(_0x4469f5,_0x1cc074){_0x1cc074=_0x1cc074||0xc8;return function(_0x293f5f){if(_0x293f5f){return _0x4469f5[_0x4c0c('0x1a')](_0x1cc074)['json'](_0x293f5f);}};}function respondWithFilteredResult(_0x235f0f,_0x3d5f56){return function(_0x235afd){if(_0x235afd){var _0x1035b5=typeof _0x3d5f56[_0x4c0c('0x1c')]==='undefined'&&typeof _0x3d5f56[_0x4c0c('0x1d')]==='undefined';var _0x2f411d=_0x235afd['count'];var _0x4e0a89=_0x1035b5?0x0:_0x3d5f56[_0x4c0c('0x1c')];var _0x1911da=_0x1035b5?_0x235afd['count']:_0x3d5f56[_0x4c0c('0x1c')]+_0x3d5f56['limit'];var _0x129e7c;if(_0x1911da>=_0x2f411d){_0x1911da=_0x2f411d;_0x129e7c=0xc8;}else{_0x129e7c=0xce;}_0x235f0f['status'](_0x129e7c);return _0x235f0f['set']('Content-Range',_0x4e0a89+'-'+_0x1911da+'/'+_0x2f411d)[_0x4c0c('0x1e')](_0x235afd);}return null;};}function patchUpdates(_0x2f40ea){return function(_0x37d193){try{jsonpatch[_0x4c0c('0x1f')](_0x37d193,_0x2f40ea,!![]);}catch(_0x20d834){return BPromise['reject'](_0x20d834);}return _0x37d193[_0x4c0c('0x20')]();};}function saveUpdates(_0x3f088d,_0x1f8604){return function(_0xfa0dc6){if(_0xfa0dc6){return _0xfa0dc6[_0x4c0c('0x21')](_0x3f088d)[_0x4c0c('0x22')](function(_0x398ce3){return _0x398ce3;});}return null;};}function removeEntity(_0x116366,_0x2dd4e3){return function(_0x2bc524){if(_0x2bc524){return _0x2bc524[_0x4c0c('0x23')]()['then'](function(){_0x116366[_0x4c0c('0x1a')](0xcc)[_0x4c0c('0x1b')]();});}};}function handleEntityNotFound(_0x3b1d5b,_0x61c160){return function(_0x283a93){if(!_0x283a93){_0x3b1d5b[_0x4c0c('0x19')](0x194);}return _0x283a93;};}function handleError(_0xfc0110,_0x50c081){_0x50c081=_0x50c081||0x1f4;return function(_0xfec2fb){logger[_0x4c0c('0x24')](_0xfec2fb['stack']);if(_0xfec2fb[_0x4c0c('0x25')]){delete _0xfec2fb[_0x4c0c('0x25')];}_0xfc0110[_0x4c0c('0x1a')](_0x50c081)[_0x4c0c('0x26')](_0xfec2fb);};}exports[_0x4c0c('0x27')]=function(_0x3b4da6,_0x5d201d){var _0x305020={},_0x33c118={},_0x3e8ee4={'count':0x0,'rows':[]};var _0x4835e6=_[_0x4c0c('0x28')](db[_0x4c0c('0x29')][_0x4c0c('0x2a')],function(_0x50e88b){return{'name':_0x50e88b['fieldName'],'type':_0x50e88b['type'][_0x4c0c('0x2b')]};});_0x33c118[_0x4c0c('0x2c')]=_[_0x4c0c('0x28')](_0x4835e6,'name');_0x33c118[_0x4c0c('0x2d')]=_[_0x4c0c('0x2e')](_0x3b4da6[_0x4c0c('0x2d')]);_0x33c118['filters']=_[_0x4c0c('0x2f')](_0x33c118[_0x4c0c('0x2c')],_0x33c118[_0x4c0c('0x2d')]);_0x305020[_0x4c0c('0x30')]=_[_0x4c0c('0x2f')](_0x33c118[_0x4c0c('0x2c')],qs[_0x4c0c('0x31')](_0x3b4da6[_0x4c0c('0x2d')][_0x4c0c('0x31')]));_0x305020[_0x4c0c('0x30')]=_0x305020[_0x4c0c('0x30')][_0x4c0c('0x32')]?_0x305020[_0x4c0c('0x30')]:_0x33c118[_0x4c0c('0x2c')];if(!_0x3b4da6[_0x4c0c('0x2d')]['hasOwnProperty'](_0x4c0c('0x33'))){_0x305020['limit']=qs['limit'](_0x3b4da6[_0x4c0c('0x2d')]['limit']);_0x305020[_0x4c0c('0x1c')]=qs[_0x4c0c('0x1c')](_0x3b4da6[_0x4c0c('0x2d')]['offset']);}_0x305020[_0x4c0c('0x34')]=qs[_0x4c0c('0x35')](_0x3b4da6[_0x4c0c('0x2d')]['sort']);_0x305020[_0x4c0c('0x36')]=qs[_0x4c0c('0x37')](_[_0x4c0c('0x38')](_0x3b4da6[_0x4c0c('0x2d')],_0x33c118[_0x4c0c('0x37')]),_0x4835e6);if(_0x3b4da6[_0x4c0c('0x2d')][_0x4c0c('0x39')]){_0x305020[_0x4c0c('0x36')]=_['merge'](_0x305020[_0x4c0c('0x36')],{'$or':_['map'](_0x4835e6,function(_0x3159c2){if(_0x3159c2[_0x4c0c('0x3a')]!==_0x4c0c('0x3b')){var _0x2403df={};_0x2403df[_0x3159c2['name']]={'$like':'%'+_0x3b4da6[_0x4c0c('0x2d')]['filter']+'%'};return _0x2403df;}})});}_0x305020=_[_0x4c0c('0x3c')]({},_0x305020,_0x3b4da6['options']);var _0x211a89={'where':_0x305020[_0x4c0c('0x36')]};return db['SmsQueueReport'][_0x4c0c('0x3d')](_0x211a89)[_0x4c0c('0x22')](function(_0x342e91){_0x3e8ee4[_0x4c0c('0x3d')]=_0x342e91;if(_0x3b4da6[_0x4c0c('0x2d')][_0x4c0c('0x3e')]){_0x305020[_0x4c0c('0x3f')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x305020);})['then'](function(_0x33bb80){_0x3e8ee4[_0x4c0c('0x40')]=_0x33bb80;return _0x3e8ee4;})[_0x4c0c('0x22')](respondWithFilteredResult(_0x5d201d,_0x305020))[_0x4c0c('0x41')](handleError(_0x5d201d,null));};exports['show']=function(_0x3b0a29,_0x5d81c8){var _0x582951={'raw':!![],'where':{'id':_0x3b0a29[_0x4c0c('0x42')]['id']}},_0x77a461={};_0x77a461[_0x4c0c('0x2c')]=_['keys'](db[_0x4c0c('0x29')][_0x4c0c('0x2a')]);_0x77a461[_0x4c0c('0x2d')]=_['keys'](_0x3b0a29['query']);_0x77a461[_0x4c0c('0x37')]=_[_0x4c0c('0x2f')](_0x77a461['model'],_0x77a461['query']);_0x582951['attributes']=_['intersection'](_0x77a461[_0x4c0c('0x2c')],qs[_0x4c0c('0x31')](_0x3b0a29[_0x4c0c('0x2d')][_0x4c0c('0x31')]));_0x582951[_0x4c0c('0x30')]=_0x582951['attributes'][_0x4c0c('0x32')]?_0x582951['attributes']:_0x77a461['model'];if(_0x3b0a29['query'][_0x4c0c('0x3e')]){_0x582951['include']=[{'all':!![]}];}_0x582951=_['merge']({},_0x582951,_0x3b0a29[_0x4c0c('0x43')]);return db[_0x4c0c('0x29')]['find'](_0x582951)[_0x4c0c('0x22')](handleEntityNotFound(_0x5d81c8,null))[_0x4c0c('0x22')](respondWithResult(_0x5d81c8,null))[_0x4c0c('0x41')](handleError(_0x5d81c8,null));};exports['create']=function(_0x826644,_0x319554){return db[_0x4c0c('0x29')][_0x4c0c('0x44')](_0x826644[_0x4c0c('0x45')],{})[_0x4c0c('0x22')](respondWithResult(_0x319554,0xc9))['catch'](handleError(_0x319554,null));};exports['update']=function(_0x690933,_0x3dc149){if(_0x690933['body']['id']){delete _0x690933[_0x4c0c('0x45')]['id'];}return db[_0x4c0c('0x29')][_0x4c0c('0x46')]({'where':{'id':_0x690933[_0x4c0c('0x42')]['id']}})[_0x4c0c('0x22')](handleEntityNotFound(_0x3dc149,null))[_0x4c0c('0x22')](saveUpdates(_0x690933['body'],null))[_0x4c0c('0x22')](respondWithResult(_0x3dc149,null))[_0x4c0c('0x41')](handleError(_0x3dc149,null));};exports[_0x4c0c('0x23')]=function(_0x73a98c,_0x5aeb11){return db['SmsQueueReport']['find']({'where':{'id':_0x73a98c[_0x4c0c('0x42')]['id']}})['then'](handleEntityNotFound(_0x5aeb11,null))[_0x4c0c('0x22')](removeEntity(_0x5aeb11,null))['catch'](handleError(_0x5aeb11,null));};exports[_0x4c0c('0x47')]=function(_0x21d1ea,_0x80b344){return db[_0x4c0c('0x29')][_0x4c0c('0x47')]()['then'](respondWithResult(_0x80b344,null))[_0x4c0c('0x41')](handleError(_0x80b344,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 92b0fd7..f762d0a 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x479557,_0x403107){var _0x4c56f8=function(_0x172eb6){while(--_0x172eb6){_0x479557['push'](_0x479557['shift']());}};_0x4c56f8(++_0x403107);}(_0xb7e7,0x121));var _0x7b7e=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xb7e7[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x37056c,_0xf6a263){var _0x37a00b=function(_0x2d32db){while(--_0x2d32db){_0x37056c['push'](_0x37056c['shift']());}};_0x37a00b(++_0xf6a263);}(_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':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index c47b08a..96dca69 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 _0x6270=['jayson/promise','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsQueueReport','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','where','limit','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x6270,0x78));var _0x0627=function(_0x25ddfa,_0xbc4e37){_0x25ddfa=_0x25ddfa-0x0;var _0x10ce7b=_0x6270[_0x25ddfa];return _0x10ce7b;};'use strict';var _=require(_0x0627('0x0'));var util=require(_0x0627('0x1'));var moment=require(_0x0627('0x2'));var BPromise=require(_0x0627('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0627('0x4'));var logger=require(_0x0627('0x5'))(_0x0627('0x6'));var config=require(_0x0627('0x7'));var jayson=require(_0x0627('0x8'));var client=jayson[_0x0627('0x9')][_0x0627('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x320464,_0x24e9fe,_0x5f475c){return new BPromise(function(_0x497f0a,_0x5d0bb9){return client[_0x0627('0xb')](_0x320464,_0x5f475c)[_0x0627('0xc')](function(_0x2dcd81){logger['info'](_0x0627('0xd'),_0x24e9fe,_0x0627('0xe'));logger[_0x0627('0xf')](_0x0627('0x10'),_0x24e9fe,_0x0627('0xe'),JSON[_0x0627('0x11')](_0x2dcd81));if(_0x2dcd81[_0x0627('0x12')]){if(_0x2dcd81['error'][_0x0627('0x13')]===0x1f4){logger[_0x0627('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x24e9fe,_0x2dcd81[_0x0627('0x12')][_0x0627('0x14')]);return _0x5d0bb9(_0x2dcd81[_0x0627('0x12')][_0x0627('0x14')]);}logger[_0x0627('0x12')](_0x0627('0xd'),_0x24e9fe,_0x2dcd81[_0x0627('0x12')][_0x0627('0x14')]);return _0x497f0a(_0x2dcd81['error'][_0x0627('0x14')]);}else{logger[_0x0627('0x15')]('SmsQueueReport,\x20%s,\x20%s',_0x24e9fe,_0x0627('0xe'));_0x497f0a(_0x2dcd81[_0x0627('0x16')][_0x0627('0x14')]);}})[_0x0627('0x17')](function(_0x440a75){logger[_0x0627('0x12')](_0x0627('0xd'),_0x24e9fe,_0x440a75);_0x5d0bb9(_0x440a75);});});}exports['CreateSmsQueueReport']=function(_0x9ffe28){var _0x11013c=this;return new Promise(function(_0x5055cc,_0x5f098c){return db[_0x0627('0x18')]['create'](_0x9ffe28[_0x0627('0x19')],{'raw':_0x9ffe28[_0x0627('0x1a')]?_0x9ffe28['options'][_0x0627('0x1b')]===undefined?!![]:![]:!![]})[_0x0627('0xc')](function(_0x548840){logger['info']('CreateSmsQueueReport',_0x9ffe28);logger[_0x0627('0xf')](_0x0627('0x1c'),_0x9ffe28,JSON['stringify'](_0x548840));_0x5055cc(_0x548840);})[_0x0627('0x17')](function(_0x38a934){logger['error'](_0x0627('0x1c'),_0x38a934['message'],_0x9ffe28);_0x5f098c(_0x11013c[_0x0627('0x12')](0x1f4,_0x38a934[_0x0627('0x14')]));});});};exports[_0x0627('0x1d')]=function(_0x5932a8){var _0x21cb2f=this;return new Promise(function(_0x455376,_0x223e36){return db['SmsQueueReport']['update'](_0x5932a8[_0x0627('0x19')],{'raw':_0x5932a8[_0x0627('0x1a')]?_0x5932a8[_0x0627('0x1a')][_0x0627('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5932a8['options']?_0x5932a8[_0x0627('0x1a')][_0x0627('0x1e')]||null:null,'attributes':_0x5932a8[_0x0627('0x1a')]?_0x5932a8[_0x0627('0x1a')]['attributes']||null:null,'limit':_0x5932a8['options']?_0x5932a8[_0x0627('0x1a')][_0x0627('0x1f')]||null:null})[_0x0627('0xc')](function(_0x3104dd){logger[_0x0627('0x15')]('UpdateSmsQueueReport',_0x5932a8);logger['debug'](_0x0627('0x1d'),_0x5932a8,JSON[_0x0627('0x11')](_0x3104dd));_0x455376(_0x3104dd);})[_0x0627('0x17')](function(_0x17f80c){logger['error'](_0x0627('0x1d'),_0x17f80c['message'],_0x5932a8);_0x223e36(_0x21cb2f[_0x0627('0x12')](0x1f4,_0x17f80c[_0x0627('0x14')]));});});}; \ No newline at end of file +var _0x67de=['debug','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','UpdateSmsQueueReport','update','raw','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent'];(function(_0x5b08cd,_0x292013){var _0x56dda6=function(_0x273742){while(--_0x273742){_0x5b08cd['push'](_0x5b08cd['shift']());}};_0x56dda6(++_0x292013);}(_0x67de,0x13c));var _0xe67d=function(_0x4ba558,_0x178f27){_0x4ba558=_0x4ba558-0x0;var _0x389dd9=_0x67de[_0x4ba558];return _0x389dd9;};'use strict';var _=require(_0xe67d('0x0'));var util=require(_0xe67d('0x1'));var moment=require(_0xe67d('0x2'));var BPromise=require(_0xe67d('0x3'));var rs=require(_0xe67d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe67d('0x5'))['db'];var utils=require(_0xe67d('0x6'));var logger=require(_0xe67d('0x7'))(_0xe67d('0x8'));var config=require('../../config/environment');var jayson=require(_0xe67d('0x9'));var client=jayson['client'][_0xe67d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fe5ab,_0x5b3c68,_0x56019e){return new BPromise(function(_0x13696a,_0x20ecb3){return client[_0xe67d('0xb')](_0x4fe5ab,_0x56019e)[_0xe67d('0xc')](function(_0x5b9acd){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x5b3c68,_0xe67d('0xd'));logger[_0xe67d('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x5b3c68,_0xe67d('0xd'),JSON[_0xe67d('0xf')](_0x5b9acd));if(_0x5b9acd['error']){if(_0x5b9acd[_0xe67d('0x10')][_0xe67d('0x11')]===0x1f4){logger[_0xe67d('0x10')](_0xe67d('0x12'),_0x5b3c68,_0x5b9acd[_0xe67d('0x10')][_0xe67d('0x13')]);return _0x20ecb3(_0x5b9acd[_0xe67d('0x10')]['message']);}logger[_0xe67d('0x10')](_0xe67d('0x12'),_0x5b3c68,_0x5b9acd[_0xe67d('0x10')][_0xe67d('0x13')]);return _0x13696a(_0x5b9acd[_0xe67d('0x10')]['message']);}else{logger[_0xe67d('0x14')](_0xe67d('0x12'),_0x5b3c68,_0xe67d('0xd'));_0x13696a(_0x5b9acd[_0xe67d('0x15')][_0xe67d('0x13')]);}})[_0xe67d('0x16')](function(_0x4e2213){logger[_0xe67d('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x5b3c68,_0x4e2213);_0x20ecb3(_0x4e2213);});});}exports[_0xe67d('0x17')]=function(_0x329681){var _0x4971be=this;return new Promise(function(_0x418e56,_0x275c50){return db[_0xe67d('0x18')][_0xe67d('0x19')](_0x329681[_0xe67d('0x1a')],{'raw':_0x329681[_0xe67d('0x1b')]?_0x329681['options']['raw']===undefined?!![]:![]:!![]})[_0xe67d('0xc')](function(_0x26efd8){logger[_0xe67d('0x14')](_0xe67d('0x17'),_0x329681);logger['debug'](_0xe67d('0x17'),_0x329681,JSON[_0xe67d('0xf')](_0x26efd8));_0x418e56(_0x26efd8);})[_0xe67d('0x16')](function(_0x525630){logger['error'](_0xe67d('0x17'),_0x525630[_0xe67d('0x13')],_0x329681);_0x275c50(_0x4971be[_0xe67d('0x10')](0x1f4,_0x525630['message']));});});};exports[_0xe67d('0x1c')]=function(_0x276549){var _0x1c3152=this;return new Promise(function(_0x4b419a,_0x72f3c9){return db[_0xe67d('0x18')][_0xe67d('0x1d')](_0x276549[_0xe67d('0x1a')],{'raw':_0x276549['options']?_0x276549['options'][_0xe67d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x276549['options']?_0x276549['options']['where']||null:null,'attributes':_0x276549[_0xe67d('0x1b')]?_0x276549[_0xe67d('0x1b')][_0xe67d('0x1f')]||null:null,'limit':_0x276549[_0xe67d('0x1b')]?_0x276549['options'][_0xe67d('0x20')]||null:null})[_0xe67d('0xc')](function(_0x3ef886){logger[_0xe67d('0x14')](_0xe67d('0x1c'),_0x276549);logger[_0xe67d('0xe')](_0xe67d('0x1c'),_0x276549,JSON[_0xe67d('0xf')](_0x3ef886));_0x4b419a(_0x3ef886);})[_0xe67d('0x16')](function(_0x402408){logger['error'](_0xe67d('0x1c'),_0x402408['message'],_0x276549);_0x72f3c9(_0x1c3152[_0xe67d('0x10')](0x1f4,_0x402408[_0xe67d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 0b991ea..b8c17ca 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 _0x5178=['/describe','isAuthenticated','describe','/:id','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index'];(function(_0x45cb0f,_0x1ac712){var _0x26be9a=function(_0x14f1f1){while(--_0x14f1f1){_0x45cb0f['push'](_0x45cb0f['shift']());}};_0x26be9a(++_0x1ac712);}(_0x5178,0x171));var _0x8517=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5178[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require('multer');var util=require(_0x8517('0x0'));var path=require(_0x8517('0x1'));var timeout=require(_0x8517('0x2'));var express=require(_0x8517('0x3'));var router=express[_0x8517('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var controller=require('./smsTransferReport.controller');router[_0x8517('0x7')]('/',auth['isAuthenticated'](),controller[_0x8517('0x8')]);router[_0x8517('0x7')](_0x8517('0x9'),auth[_0x8517('0xa')](),controller[_0x8517('0xb')]);router['get'](_0x8517('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8517('0xd')]('/',auth[_0x8517('0xa')](),controller['create']);router[_0x8517('0xe')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0xf')]);router[_0x8517('0x10')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3937=['get','isAuthenticated','index','/describe','describe','show','post','create','delete','/:id','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3937,0xbf));var _0x7393=function(_0x1505fa,_0xa6b84){_0x1505fa=_0x1505fa-0x0;var _0x8f1dcf=_0x3937[_0x1505fa];return _0x8f1dcf;};'use strict';var multer=require(_0x7393('0x0'));var util=require('util');var path=require(_0x7393('0x1'));var timeout=require(_0x7393('0x2'));var express=require('express');var router=express[_0x7393('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7393('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7393('0x5'));var controller=require(_0x7393('0x6'));router[_0x7393('0x7')]('/',auth[_0x7393('0x8')](),controller[_0x7393('0x9')]);router[_0x7393('0x7')](_0x7393('0xa'),auth[_0x7393('0x8')](),controller[_0x7393('0xb')]);router['get']('/:id',auth[_0x7393('0x8')](),controller[_0x7393('0xc')]);router[_0x7393('0xd')]('/',auth['isAuthenticated'](),controller[_0x7393('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7393('0xf')](_0x7393('0x10'),auth[_0x7393('0x8')](),controller['destroy']);module[_0x7393('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 4c66936..de00f8a 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(_0x2b5714,_0x4d0ed2){var _0x4e9bdb=function(_0x5afd9a){while(--_0x5afd9a){_0x2b5714['push'](_0x2b5714['shift']());}};_0x4e9bdb(++_0x4d0ed2);}(_0xaa88,0x137));var _0x8aa8=function(_0x594ece,_0x2a1f27){_0x594ece=_0x594ece-0x0;var _0x471bc4=_0xaa88[_0x594ece];return _0x471bc4;};'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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x302ab3,_0x21ab7b){var _0x12c0ca=function(_0x91ebf6){while(--_0x91ebf6){_0x302ab3['push'](_0x302ab3['shift']());}};_0x12c0ca(++_0x21ab7b);}(_0x008c,0x188));var _0xc008=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x008c[_0x5cab28];return _0xa3554d;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index ed8767e..30d195e 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 _0x0639=['query','attributes','fields','length','nolimit','order','sort','filter','where','merge','SmsTransferReport','includeAll','findAll','rows','show','params','include','catch','create','body','find','describe','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','filters','intersection'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0639,0x1ae));var _0x9063=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x0639[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9063('0x0'));var zipdir=require(_0x9063('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9063('0x2'));var moment=require(_0x9063('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9063('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x9063('0x5'));var ejs=require(_0x9063('0x6'));var fs=require('fs');var fs_extra=require(_0x9063('0x7'));var _=require(_0x9063('0x8'));var squel=require(_0x9063('0x9'));var crypto=require('crypto');var jsforce=require(_0x9063('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9063('0x5'));var querystring=require(_0x9063('0xb'));var Papa=require('papaparse');var Redis=require(_0x9063('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9063('0xd'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9063('0xe'));var licenseUtil=require(_0x9063('0xf'));var db=require(_0x9063('0x10'))['db'];function respondWithStatusCode(_0x1b9bea,_0x59f760){_0x59f760=_0x59f760||0xcc;return function(_0x18390a){if(_0x18390a){return _0x1b9bea[_0x9063('0x11')](_0x59f760);}return _0x1b9bea[_0x9063('0x12')](_0x59f760)[_0x9063('0x13')]();};}function respondWithResult(_0x1ab8e1,_0x5e9ccd){_0x5e9ccd=_0x5e9ccd||0xc8;return function(_0x37ac78){if(_0x37ac78){return _0x1ab8e1['status'](_0x5e9ccd)[_0x9063('0x14')](_0x37ac78);}};}function respondWithFilteredResult(_0x497a56,_0x29caf6){return function(_0x4a95d6){if(_0x4a95d6){var _0x95c163=typeof _0x29caf6[_0x9063('0x15')]===_0x9063('0x16')&&typeof _0x29caf6[_0x9063('0x17')]===_0x9063('0x16');var _0x47ea27=_0x4a95d6[_0x9063('0x18')];var _0x20e347=_0x95c163?0x0:_0x29caf6[_0x9063('0x15')];var _0x5f2054=_0x95c163?_0x4a95d6[_0x9063('0x18')]:_0x29caf6[_0x9063('0x15')]+_0x29caf6[_0x9063('0x17')];var _0x599199;if(_0x5f2054>=_0x47ea27){_0x5f2054=_0x47ea27;_0x599199=0xc8;}else{_0x599199=0xce;}_0x497a56[_0x9063('0x12')](_0x599199);return _0x497a56[_0x9063('0x19')](_0x9063('0x1a'),_0x20e347+'-'+_0x5f2054+'/'+_0x47ea27)[_0x9063('0x14')](_0x4a95d6);}return null;};}function patchUpdates(_0x13bc45){return function(_0x19b986){try{jsonpatch[_0x9063('0x1b')](_0x19b986,_0x13bc45,!![]);}catch(_0xe58959){return BPromise[_0x9063('0x1c')](_0xe58959);}return _0x19b986[_0x9063('0x1d')]();};}function saveUpdates(_0x32ce31,_0x80d309){return function(_0x5d610e){if(_0x5d610e){return _0x5d610e[_0x9063('0x1e')](_0x32ce31)['then'](function(_0x32fc9a){return _0x32fc9a;});}return null;};}function removeEntity(_0x3e6048,_0x43fd10){return function(_0x30a727){if(_0x30a727){return _0x30a727[_0x9063('0x1f')]()[_0x9063('0x20')](function(){_0x3e6048[_0x9063('0x12')](0xcc)[_0x9063('0x13')]();});}};}function handleEntityNotFound(_0xe4e443,_0xc200c8){return function(_0x79f3e3){if(!_0x79f3e3){_0xe4e443[_0x9063('0x11')](0x194);}return _0x79f3e3;};}function handleError(_0x545a0d,_0x3d0a8f){_0x3d0a8f=_0x3d0a8f||0x1f4;return function(_0x2801a4){logger[_0x9063('0x21')](_0x2801a4[_0x9063('0x22')]);if(_0x2801a4[_0x9063('0x23')]){delete _0x2801a4[_0x9063('0x23')];}_0x545a0d[_0x9063('0x12')](_0x3d0a8f)[_0x9063('0x24')](_0x2801a4);};}exports[_0x9063('0x25')]=function(_0x325713,_0xef4fc9){var _0x370711={},_0x794bb6={},_0x2bc830={'count':0x0,'rows':[]};var _0x38ad3d=_[_0x9063('0x26')](db['SmsTransferReport'][_0x9063('0x27')],function(_0x586a90){return{'name':_0x586a90[_0x9063('0x28')],'type':_0x586a90['type'][_0x9063('0x29')]};});_0x794bb6[_0x9063('0x2a')]=_[_0x9063('0x26')](_0x38ad3d,_0x9063('0x23'));_0x794bb6['query']=_[_0x9063('0x2b')](_0x325713['query']);_0x794bb6[_0x9063('0x2c')]=_[_0x9063('0x2d')](_0x794bb6[_0x9063('0x2a')],_0x794bb6[_0x9063('0x2e')]);_0x370711[_0x9063('0x2f')]=_['intersection'](_0x794bb6[_0x9063('0x2a')],qs[_0x9063('0x30')](_0x325713[_0x9063('0x2e')]['fields']));_0x370711[_0x9063('0x2f')]=_0x370711['attributes'][_0x9063('0x31')]?_0x370711['attributes']:_0x794bb6[_0x9063('0x2a')];if(!_0x325713[_0x9063('0x2e')]['hasOwnProperty'](_0x9063('0x32'))){_0x370711['limit']=qs[_0x9063('0x17')](_0x325713[_0x9063('0x2e')][_0x9063('0x17')]);_0x370711[_0x9063('0x15')]=qs[_0x9063('0x15')](_0x325713[_0x9063('0x2e')][_0x9063('0x15')]);}_0x370711[_0x9063('0x33')]=qs[_0x9063('0x34')](_0x325713[_0x9063('0x2e')][_0x9063('0x34')]);_0x370711['where']=qs[_0x9063('0x2c')](_['pick'](_0x325713[_0x9063('0x2e')],_0x794bb6[_0x9063('0x2c')]),_0x38ad3d);if(_0x325713[_0x9063('0x2e')][_0x9063('0x35')]){_0x370711[_0x9063('0x36')]=_['merge'](_0x370711[_0x9063('0x36')],{'$or':_[_0x9063('0x26')](_0x38ad3d,function(_0x3c31fd){if(_0x3c31fd['type']!=='VIRTUAL'){var _0x339bcd={};_0x339bcd[_0x3c31fd[_0x9063('0x23')]]={'$like':'%'+_0x325713[_0x9063('0x2e')][_0x9063('0x35')]+'%'};return _0x339bcd;}})});}_0x370711=_[_0x9063('0x37')]({},_0x370711,_0x325713['options']);var _0x13b45a={'where':_0x370711[_0x9063('0x36')]};return db[_0x9063('0x38')][_0x9063('0x18')](_0x13b45a)['then'](function(_0x23dc79){_0x2bc830[_0x9063('0x18')]=_0x23dc79;if(_0x325713[_0x9063('0x2e')][_0x9063('0x39')]){_0x370711['include']=[{'all':!![]}];}return db[_0x9063('0x38')][_0x9063('0x3a')](_0x370711);})[_0x9063('0x20')](function(_0x5c3fd3){_0x2bc830[_0x9063('0x3b')]=_0x5c3fd3;return _0x2bc830;})['then'](respondWithFilteredResult(_0xef4fc9,_0x370711))['catch'](handleError(_0xef4fc9,null));};exports[_0x9063('0x3c')]=function(_0x3360a5,_0x28eb71){var _0x17aa2b={'raw':!![],'where':{'id':_0x3360a5[_0x9063('0x3d')]['id']}},_0x91621a={};_0x91621a['model']=_[_0x9063('0x2b')](db[_0x9063('0x38')][_0x9063('0x27')]);_0x91621a['query']=_['keys'](_0x3360a5[_0x9063('0x2e')]);_0x91621a['filters']=_[_0x9063('0x2d')](_0x91621a['model'],_0x91621a[_0x9063('0x2e')]);_0x17aa2b[_0x9063('0x2f')]=_[_0x9063('0x2d')](_0x91621a['model'],qs['fields'](_0x3360a5['query'][_0x9063('0x30')]));_0x17aa2b['attributes']=_0x17aa2b[_0x9063('0x2f')]['length']?_0x17aa2b[_0x9063('0x2f')]:_0x91621a['model'];if(_0x3360a5[_0x9063('0x2e')][_0x9063('0x39')]){_0x17aa2b[_0x9063('0x3e')]=[{'all':!![]}];}_0x17aa2b=_[_0x9063('0x37')]({},_0x17aa2b,_0x3360a5['options']);return db[_0x9063('0x38')]['find'](_0x17aa2b)[_0x9063('0x20')](handleEntityNotFound(_0x28eb71,null))[_0x9063('0x20')](respondWithResult(_0x28eb71,null))[_0x9063('0x3f')](handleError(_0x28eb71,null));};exports[_0x9063('0x40')]=function(_0x9be4fb,_0x494778){return db[_0x9063('0x38')][_0x9063('0x40')](_0x9be4fb[_0x9063('0x41')],{})[_0x9063('0x20')](respondWithResult(_0x494778,0xc9))[_0x9063('0x3f')](handleError(_0x494778,null));};exports['update']=function(_0x538327,_0x16511d){if(_0x538327[_0x9063('0x41')]['id']){delete _0x538327[_0x9063('0x41')]['id'];}return db[_0x9063('0x38')]['find']({'where':{'id':_0x538327['params']['id']}})[_0x9063('0x20')](handleEntityNotFound(_0x16511d,null))[_0x9063('0x20')](saveUpdates(_0x538327[_0x9063('0x41')],null))[_0x9063('0x20')](respondWithResult(_0x16511d,null))[_0x9063('0x3f')](handleError(_0x16511d,null));};exports[_0x9063('0x1f')]=function(_0x50c8cf,_0x11b471){return db[_0x9063('0x38')][_0x9063('0x42')]({'where':{'id':_0x50c8cf['params']['id']}})[_0x9063('0x20')](handleEntityNotFound(_0x11b471,null))[_0x9063('0x20')](removeEntity(_0x11b471,null))[_0x9063('0x3f')](handleError(_0x11b471,null));};exports[_0x9063('0x43')]=function(_0x274edf,_0xf4f928){return db['SmsTransferReport'][_0x9063('0x43')]()[_0x9063('0x20')](respondWithResult(_0xf4f928,null))[_0x9063('0x3f')](handleError(_0xf4f928,null));}; \ No newline at end of file +var _0xbf8f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','SmsTransferReport','length','find','create','body','describe','eml-format','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xbf8f,0x7e));var _0xfbf8=function(_0x544cdd,_0x3c216c){_0x544cdd=_0x544cdd-0x0;var _0x16c39d=_0xbf8f[_0x544cdd];return _0x16c39d;};'use strict';var emlformat=require(_0xfbf8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfbf8('0x1'));var BPromise=require(_0xfbf8('0x2'));var Mustache=require(_0xfbf8('0x3'));var util=require(_0xfbf8('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xfbf8('0x5'));var ejs=require(_0xfbf8('0x6'));var fs=require('fs');var fs_extra=require(_0xfbf8('0x7'));var _=require(_0xfbf8('0x8'));var squel=require('squel');var crypto=require(_0xfbf8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfbf8('0xa'));var toCsv=require(_0xfbf8('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfbf8('0xb'));var qs=require(_0xfbf8('0xc'));var as=require(_0xfbf8('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfbf8('0xe'))(_0xfbf8('0xf'));var utils=require(_0xfbf8('0x10'));var config=require(_0xfbf8('0x11'));var licenseUtil=require(_0xfbf8('0x12'));var db=require(_0xfbf8('0x13'))['db'];function respondWithStatusCode(_0x5ab019,_0x4e5023){_0x4e5023=_0x4e5023||0xcc;return function(_0x2e3fa9){if(_0x2e3fa9){return _0x5ab019[_0xfbf8('0x14')](_0x4e5023);}return _0x5ab019[_0xfbf8('0x15')](_0x4e5023)[_0xfbf8('0x16')]();};}function respondWithResult(_0x5af092,_0x2a2d3c){_0x2a2d3c=_0x2a2d3c||0xc8;return function(_0x5791b2){if(_0x5791b2){return _0x5af092['status'](_0x2a2d3c)[_0xfbf8('0x17')](_0x5791b2);}};}function respondWithFilteredResult(_0x146cdf,_0x415a8f){return function(_0x597f0c){if(_0x597f0c){var _0x51910a=typeof _0x415a8f['offset']==='undefined'&&typeof _0x415a8f[_0xfbf8('0x18')]===_0xfbf8('0x19');var _0x124e73=_0x597f0c['count'];var _0x111896=_0x51910a?0x0:_0x415a8f[_0xfbf8('0x1a')];var _0x4429c3=_0x51910a?_0x597f0c['count']:_0x415a8f[_0xfbf8('0x1a')]+_0x415a8f[_0xfbf8('0x18')];var _0x19d3b6;if(_0x4429c3>=_0x124e73){_0x4429c3=_0x124e73;_0x19d3b6=0xc8;}else{_0x19d3b6=0xce;}_0x146cdf[_0xfbf8('0x15')](_0x19d3b6);return _0x146cdf[_0xfbf8('0x1b')](_0xfbf8('0x1c'),_0x111896+'-'+_0x4429c3+'/'+_0x124e73)[_0xfbf8('0x17')](_0x597f0c);}return null;};}function patchUpdates(_0x4db43d){return function(_0xdc7dea){try{jsonpatch[_0xfbf8('0x1d')](_0xdc7dea,_0x4db43d,!![]);}catch(_0x574aa8){return BPromise[_0xfbf8('0x1e')](_0x574aa8);}return _0xdc7dea['save']();};}function saveUpdates(_0x44b7fb,_0x512b6a){return function(_0x4b38b1){if(_0x4b38b1){return _0x4b38b1['update'](_0x44b7fb)[_0xfbf8('0x1f')](function(_0x45f06c){return _0x45f06c;});}return null;};}function removeEntity(_0x3ccdeb,_0x4fba07){return function(_0x5303dd){if(_0x5303dd){return _0x5303dd[_0xfbf8('0x20')]()[_0xfbf8('0x1f')](function(){_0x3ccdeb['status'](0xcc)[_0xfbf8('0x16')]();});}};}function handleEntityNotFound(_0x563e21,_0x59b092){return function(_0x14c06a){if(!_0x14c06a){_0x563e21[_0xfbf8('0x14')](0x194);}return _0x14c06a;};}function handleError(_0x476dd3,_0x175549){_0x175549=_0x175549||0x1f4;return function(_0x3772d2){logger[_0xfbf8('0x21')](_0x3772d2[_0xfbf8('0x22')]);if(_0x3772d2[_0xfbf8('0x23')]){delete _0x3772d2[_0xfbf8('0x23')];}_0x476dd3['status'](_0x175549)[_0xfbf8('0x24')](_0x3772d2);};}exports[_0xfbf8('0x25')]=function(_0x22c89e,_0x560f34){var _0x46e64b={},_0x55036c={},_0x241eba={'count':0x0,'rows':[]};var _0x381f21=_[_0xfbf8('0x26')](db['SmsTransferReport'][_0xfbf8('0x27')],function(_0x4337ba){return{'name':_0x4337ba[_0xfbf8('0x28')],'type':_0x4337ba['type'][_0xfbf8('0x29')]};});_0x55036c[_0xfbf8('0x2a')]=_[_0xfbf8('0x26')](_0x381f21,_0xfbf8('0x23'));_0x55036c[_0xfbf8('0x2b')]=_[_0xfbf8('0x2c')](_0x22c89e[_0xfbf8('0x2b')]);_0x55036c[_0xfbf8('0x2d')]=_[_0xfbf8('0x2e')](_0x55036c['model'],_0x55036c[_0xfbf8('0x2b')]);_0x46e64b[_0xfbf8('0x2f')]=_['intersection'](_0x55036c[_0xfbf8('0x2a')],qs[_0xfbf8('0x30')](_0x22c89e[_0xfbf8('0x2b')][_0xfbf8('0x30')]));_0x46e64b[_0xfbf8('0x2f')]=_0x46e64b[_0xfbf8('0x2f')]['length']?_0x46e64b[_0xfbf8('0x2f')]:_0x55036c[_0xfbf8('0x2a')];if(!_0x22c89e[_0xfbf8('0x2b')][_0xfbf8('0x31')](_0xfbf8('0x32'))){_0x46e64b['limit']=qs[_0xfbf8('0x18')](_0x22c89e[_0xfbf8('0x2b')][_0xfbf8('0x18')]);_0x46e64b[_0xfbf8('0x1a')]=qs[_0xfbf8('0x1a')](_0x22c89e[_0xfbf8('0x2b')][_0xfbf8('0x1a')]);}_0x46e64b['order']=qs['sort'](_0x22c89e['query']['sort']);_0x46e64b[_0xfbf8('0x33')]=qs[_0xfbf8('0x2d')](_['pick'](_0x22c89e[_0xfbf8('0x2b')],_0x55036c[_0xfbf8('0x2d')]),_0x381f21);if(_0x22c89e[_0xfbf8('0x2b')][_0xfbf8('0x34')]){_0x46e64b[_0xfbf8('0x33')]=_[_0xfbf8('0x35')](_0x46e64b['where'],{'$or':_[_0xfbf8('0x26')](_0x381f21,function(_0x4c491b){if(_0x4c491b[_0xfbf8('0x36')]!==_0xfbf8('0x37')){var _0x480eb4={};_0x480eb4[_0x4c491b['name']]={'$like':'%'+_0x22c89e[_0xfbf8('0x2b')]['filter']+'%'};return _0x480eb4;}})});}_0x46e64b=_[_0xfbf8('0x35')]({},_0x46e64b,_0x22c89e[_0xfbf8('0x38')]);var _0xd5fe26={'where':_0x46e64b[_0xfbf8('0x33')]};return db['SmsTransferReport'][_0xfbf8('0x39')](_0xd5fe26)[_0xfbf8('0x1f')](function(_0x49fb4c){_0x241eba[_0xfbf8('0x39')]=_0x49fb4c;if(_0x22c89e[_0xfbf8('0x2b')][_0xfbf8('0x3a')]){_0x46e64b[_0xfbf8('0x3b')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xfbf8('0x3c')](_0x46e64b);})[_0xfbf8('0x1f')](function(_0x2eef1b){_0x241eba[_0xfbf8('0x3d')]=_0x2eef1b;return _0x241eba;})[_0xfbf8('0x1f')](respondWithFilteredResult(_0x560f34,_0x46e64b))[_0xfbf8('0x3e')](handleError(_0x560f34,null));};exports[_0xfbf8('0x3f')]=function(_0x562ade,_0x3ed9c7){var _0x1cb98e={'raw':!![],'where':{'id':_0x562ade[_0xfbf8('0x40')]['id']}},_0x155656={};_0x155656[_0xfbf8('0x2a')]=_[_0xfbf8('0x2c')](db[_0xfbf8('0x41')][_0xfbf8('0x27')]);_0x155656[_0xfbf8('0x2b')]=_[_0xfbf8('0x2c')](_0x562ade[_0xfbf8('0x2b')]);_0x155656[_0xfbf8('0x2d')]=_['intersection'](_0x155656[_0xfbf8('0x2a')],_0x155656[_0xfbf8('0x2b')]);_0x1cb98e[_0xfbf8('0x2f')]=_['intersection'](_0x155656[_0xfbf8('0x2a')],qs[_0xfbf8('0x30')](_0x562ade[_0xfbf8('0x2b')]['fields']));_0x1cb98e[_0xfbf8('0x2f')]=_0x1cb98e[_0xfbf8('0x2f')][_0xfbf8('0x42')]?_0x1cb98e[_0xfbf8('0x2f')]:_0x155656[_0xfbf8('0x2a')];if(_0x562ade[_0xfbf8('0x2b')][_0xfbf8('0x3a')]){_0x1cb98e['include']=[{'all':!![]}];}_0x1cb98e=_['merge']({},_0x1cb98e,_0x562ade[_0xfbf8('0x38')]);return db['SmsTransferReport'][_0xfbf8('0x43')](_0x1cb98e)[_0xfbf8('0x1f')](handleEntityNotFound(_0x3ed9c7,null))[_0xfbf8('0x1f')](respondWithResult(_0x3ed9c7,null))[_0xfbf8('0x3e')](handleError(_0x3ed9c7,null));};exports[_0xfbf8('0x44')]=function(_0x23f8ea,_0x30b792){return db[_0xfbf8('0x41')][_0xfbf8('0x44')](_0x23f8ea[_0xfbf8('0x45')],{})['then'](respondWithResult(_0x30b792,0xc9))[_0xfbf8('0x3e')](handleError(_0x30b792,null));};exports['update']=function(_0x317b35,_0x27343e){if(_0x317b35[_0xfbf8('0x45')]['id']){delete _0x317b35[_0xfbf8('0x45')]['id'];}return db[_0xfbf8('0x41')][_0xfbf8('0x43')]({'where':{'id':_0x317b35[_0xfbf8('0x40')]['id']}})['then'](handleEntityNotFound(_0x27343e,null))[_0xfbf8('0x1f')](saveUpdates(_0x317b35['body'],null))[_0xfbf8('0x1f')](respondWithResult(_0x27343e,null))['catch'](handleError(_0x27343e,null));};exports[_0xfbf8('0x20')]=function(_0x46d8f2,_0xf0e36d){return db[_0xfbf8('0x41')]['find']({'where':{'id':_0x46d8f2[_0xfbf8('0x40')]['id']}})['then'](handleEntityNotFound(_0xf0e36d,null))[_0xfbf8('0x1f')](removeEntity(_0xf0e36d,null))[_0xfbf8('0x3e')](handleError(_0xf0e36d,null));};exports[_0xfbf8('0x46')]=function(_0x50ce9e,_0x46e47d){return db[_0xfbf8('0x41')][_0xfbf8('0x46')]()['then'](respondWithResult(_0x46e47d,null))[_0xfbf8('0x3e')](handleError(_0x46e47d,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 2da8e43..f7a898a 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 _0xff25=['moment','bluebird','request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x32c265,_0x50f1b6){var _0x5568f2=function(_0x401671){while(--_0x401671){_0x32c265['push'](_0x32c265['shift']());}};_0x5568f2(++_0x50f1b6);}(_0xff25,0x190));var _0x5ff2=function(_0x55b797,_0x5be89d){_0x55b797=_0x55b797-0x0;var _0x282145=_0xff25[_0x55b797];return _0x282145;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5ff2('0x0'));var BPromise=require(_0x5ff2('0x1'));var rp=require(_0x5ff2('0x2'));var fs=require('fs');var path=require(_0x5ff2('0x3'));var rimraf=require('rimraf');var config=require(_0x5ff2('0x4'));var attributes=require(_0x5ff2('0x5'));module[_0x5ff2('0x6')]=function(_0x9ba150,_0x5b1bba){return _0x9ba150['define'](_0x5ff2('0x7'),attributes,{'tableName':_0x5ff2('0x8'),'paranoid':![],'indexes':[{'name':_0x5ff2('0x9'),'fields':[_0x5ff2('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6fc4=['../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','lodash','util','moment','rimraf'];(function(_0x13549a,_0x1ae1aa){var _0x49b032=function(_0x2a6390){while(--_0x2a6390){_0x13549a['push'](_0x13549a['shift']());}};_0x49b032(++_0x1ae1aa);}(_0x6fc4,0x1a0));var _0x46fc=function(_0x2caf3a,_0x1d65d6){_0x2caf3a=_0x2caf3a-0x0;var _0x34f044=_0x6fc4[_0x2caf3a];return _0x34f044;};'use strict';var _=require(_0x46fc('0x0'));var util=require(_0x46fc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x46fc('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x46fc('0x3'));var config=require(_0x46fc('0x4'));var attributes=require(_0x46fc('0x5'));module[_0x46fc('0x6')]=function(_0x3f4e43,_0x7656d9){return _0x3f4e43[_0x46fc('0x7')](_0x46fc('0x8'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x46fc('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 f9ec7a6..1cc6e4e 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 _0x4677=['http','then','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x357639,_0x19667d){var _0x4c34c7=function(_0x354b79){while(--_0x354b79){_0x357639['push'](_0x357639['shift']());}};_0x4c34c7(++_0x19667d);}(_0x4677,0x155));var _0x7467=function(_0x53eaef,_0x246378){_0x53eaef=_0x53eaef-0x0;var _0x10fdc4=_0x4677[_0x53eaef];return _0x10fdc4;};'use strict';var _=require(_0x7467('0x0'));var util=require('util');var moment=require(_0x7467('0x1'));var BPromise=require(_0x7467('0x2'));var rs=require(_0x7467('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7467('0x4'))['db'];var utils=require(_0x7467('0x5'));var logger=require(_0x7467('0x6'))(_0x7467('0x7'));var config=require(_0x7467('0x8'));var jayson=require(_0x7467('0x9'));var client=jayson[_0x7467('0xa')][_0x7467('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x198e6a,_0x4b26a7,_0x588489){return new BPromise(function(_0x418ff9,_0x1cc835){return client['request'](_0x198e6a,_0x588489)[_0x7467('0xc')](function(_0x4365e6){logger['info'](_0x7467('0xd'),_0x4b26a7,'request\x20sent');logger[_0x7467('0xe')](_0x7467('0xf'),_0x4b26a7,_0x7467('0x10'),JSON['stringify'](_0x4365e6));if(_0x4365e6[_0x7467('0x11')]){if(_0x4365e6[_0x7467('0x11')][_0x7467('0x12')]===0x1f4){logger[_0x7467('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4b26a7,_0x4365e6[_0x7467('0x11')]['message']);return _0x1cc835(_0x4365e6[_0x7467('0x11')][_0x7467('0x13')]);}logger[_0x7467('0x11')](_0x7467('0xd'),_0x4b26a7,_0x4365e6['error'][_0x7467('0x13')]);return _0x418ff9(_0x4365e6[_0x7467('0x11')][_0x7467('0x13')]);}else{logger['info'](_0x7467('0xd'),_0x4b26a7,_0x7467('0x10'));_0x418ff9(_0x4365e6[_0x7467('0x14')]['message']);}})[_0x7467('0x15')](function(_0x1df628){logger[_0x7467('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4b26a7,_0x1df628);_0x1cc835(_0x1df628);});});} \ No newline at end of file +var _0xaba6=['../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaba6,0xe2));var _0x6aba=function(_0x46d811,_0x2bde59){_0x46d811=_0x46d811-0x0;var _0x144840=_0xaba6[_0x46d811];return _0x144840;};'use strict';var _=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6aba('0x2'))['db'];var utils=require(_0x6aba('0x3'));var logger=require('../../config/logger')(_0x6aba('0x4'));var config=require(_0x6aba('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39c32a,_0x54416a,_0x3766d4){return new BPromise(function(_0x1a4fbc,_0x508dff){return client[_0x6aba('0x6')](_0x39c32a,_0x3766d4)[_0x6aba('0x7')](function(_0x4ea8eb){logger[_0x6aba('0x8')](_0x6aba('0x9'),_0x54416a,_0x6aba('0xa'));logger[_0x6aba('0xb')](_0x6aba('0xc'),_0x54416a,_0x6aba('0xa'),JSON[_0x6aba('0xd')](_0x4ea8eb));if(_0x4ea8eb['error']){if(_0x4ea8eb[_0x6aba('0xe')][_0x6aba('0xf')]===0x1f4){logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x4ea8eb['error'][_0x6aba('0x10')]);return _0x508dff(_0x4ea8eb[_0x6aba('0xe')]['message']);}logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x4ea8eb[_0x6aba('0xe')]['message']);return _0x1a4fbc(_0x4ea8eb[_0x6aba('0xe')][_0x6aba('0x10')]);}else{logger[_0x6aba('0x8')]('SmsTransferReport,\x20%s,\x20%s',_0x54416a,_0x6aba('0xa'));_0x1a4fbc(_0x4ea8eb[_0x6aba('0x11')][_0x6aba('0x10')]);}})[_0x6aba('0x12')](function(_0x379b17){logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x379b17);_0x508dff(_0x379b17);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 65b7c79..c8c3d9a 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 _0xb028=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','get','/:id','/:id/download','download','diskStorage','join','originalname','format','%s-%s%s','basename','extname','post','single','put','delete','multer','util'];(function(_0x4c8699,_0x505388){var _0x51a334=function(_0x3e16dc){while(--_0x3e16dc){_0x4c8699['push'](_0x4c8699['shift']());}};_0x51a334(++_0x505388);}(_0xb028,0xce));var _0x8b02=function(_0x770f7,_0x3af003){_0x770f7=_0x770f7-0x0;var _0xe797c6=_0xb028[_0x770f7];return _0xe797c6;};'use strict';var multer=require(_0x8b02('0x0'));var util=require(_0x8b02('0x1'));var path=require(_0x8b02('0x2'));var timeout=require(_0x8b02('0x3'));var express=require('express');var router=express[_0x8b02('0x4')]();var fs_extra=require(_0x8b02('0x5'));var auth=require(_0x8b02('0x6'));var interaction=require(_0x8b02('0x7'));var config=require(_0x8b02('0x8'));var controller=require(_0x8b02('0x9'));router['get']('/',auth[_0x8b02('0xa')](),controller['index']);router[_0x8b02('0xb')](_0x8b02('0xc'),auth[_0x8b02('0xa')](),controller['show']);router[_0x8b02('0xb')](_0x8b02('0xd'),auth[_0x8b02('0xa')](),controller[_0x8b02('0xe')]);var upload=multer({'storage':multer[_0x8b02('0xf')]({'destination':function(_0x48a71f,_0x44f575,_0x59772b){_0x59772b(null,path[_0x8b02('0x10')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x40d063,_0x27362a,_0x19fcd8){_0x27362a[_0x8b02('0x11')]=_0x27362a['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x19fcd8(null,util[_0x8b02('0x12')](_0x8b02('0x13'),path[_0x8b02('0x14')](_0x27362a['originalname'],path[_0x8b02('0x15')](_0x27362a[_0x8b02('0x11')])),Date['now'](),path[_0x8b02('0x15')](_0x27362a[_0x8b02('0x11')])));}})});router[_0x8b02('0x16')]('/',upload[_0x8b02('0x17')]('file'),controller['create']);router[_0x8b02('0x18')](_0x8b02('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8b02('0x19')]('/:id',auth[_0x8b02('0xa')](),controller[_0x8b02('0x19')]);module['exports']=router; \ No newline at end of file +var _0xed36=['join','root','originalname','replace','format','%s-%s%s','extname','now','post','file','put','update','delete','/:id','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','/:id/download','download','diskStorage'];(function(_0x384cc1,_0x2c01d4){var _0x94c39b=function(_0x714d14){while(--_0x714d14){_0x384cc1['push'](_0x384cc1['shift']());}};_0x94c39b(++_0x2c01d4);}(_0xed36,0xaa));var _0x6ed3=function(_0x5873e2,_0x4fce78){_0x5873e2=_0x5873e2-0x0;var _0x716611=_0xed36[_0x5873e2];return _0x716611;};'use strict';var multer=require(_0x6ed3('0x0'));var util=require(_0x6ed3('0x1'));var path=require(_0x6ed3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ed3('0x3')]();var fs_extra=require(_0x6ed3('0x4'));var auth=require(_0x6ed3('0x5'));var interaction=require(_0x6ed3('0x6'));var config=require(_0x6ed3('0x7'));var controller=require(_0x6ed3('0x8'));router[_0x6ed3('0x9')]('/',auth[_0x6ed3('0xa')](),controller[_0x6ed3('0xb')]);router[_0x6ed3('0x9')]('/:id',auth[_0x6ed3('0xa')](),controller[_0x6ed3('0xc')]);router[_0x6ed3('0x9')](_0x6ed3('0xd'),auth[_0x6ed3('0xa')](),controller[_0x6ed3('0xe')]);var upload=multer({'storage':multer[_0x6ed3('0xf')]({'destination':function(_0x3bc9ea,_0x50f22c,_0x2310ab){_0x2310ab(null,path[_0x6ed3('0x10')](config[_0x6ed3('0x11')],'server/files/sounds/original/'));},'filename':function(_0x5885c6,_0x4023a7,_0x101903){_0x4023a7[_0x6ed3('0x12')]=_0x4023a7[_0x6ed3('0x12')][_0x6ed3('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x101903(null,util[_0x6ed3('0x14')](_0x6ed3('0x15'),path['basename'](_0x4023a7['originalname'],path[_0x6ed3('0x16')](_0x4023a7[_0x6ed3('0x12')])),Date[_0x6ed3('0x17')](),path[_0x6ed3('0x16')](_0x4023a7[_0x6ed3('0x12')])));}})});router[_0x6ed3('0x18')]('/',upload['single'](_0x6ed3('0x19')),controller['create']);router[_0x6ed3('0x1a')]('/:id',auth[_0x6ed3('0xa')](),controller[_0x6ed3('0x1b')]);router[_0x6ed3('0x1c')](_0x6ed3('0x1d'),auth[_0x6ed3('0xa')](),controller[_0x6ed3('0x1c')]);module[_0x6ed3('0x1e')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 10b34b1..38a9488 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 _0x5395=['FLOAT','sequelize','STRING','BIGINT','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5395,0x150));var _0x5539=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5395[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x5539('0x0'));module['exports']={'name':{'type':Sequelize[_0x5539('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x5539('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x5539('0x1')]},'original_format':{'type':Sequelize[_0x5539('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x5539('0x2')]},'original_channelCount':{'type':Sequelize[_0x5539('0x3')]},'original_bitRate':{'type':Sequelize[_0x5539('0x2')]},'original_sampleRate':{'type':Sequelize[_0x5539('0x3')]},'converted_format':{'type':Sequelize[_0x5539('0x1')]},'converted_duration':{'type':Sequelize[_0x5539('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x5539('0x2')]},'converted_channelCount':{'type':Sequelize[_0x5539('0x3')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x5539('0x3')]}}; \ No newline at end of file +var _0xe764=['sequelize','exports','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x1cd16f,_0x578d10){var _0x59358e=function(_0x19ae13){while(--_0x19ae13){_0x1cd16f['push'](_0x1cd16f['shift']());}};_0x59358e(++_0x578d10);}(_0xe764,0x11f));var _0x4e76=function(_0x1d38fc,_0x27cd20){_0x1d38fc=_0x1d38fc-0x0;var _0x1a260c=_0xe764[_0x1d38fc];return _0x1a260c;};'use strict';var Sequelize=require(_0x4e76('0x0'));module[_0x4e76('0x1')]={'name':{'type':Sequelize[_0x4e76('0x2')],'unique':_0x4e76('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x4e76('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x4e76('0x2')]},'original_format':{'type':Sequelize[_0x4e76('0x2')]},'original_duration':{'type':Sequelize[_0x4e76('0x4')]},'original_sampleCount':{'type':Sequelize[_0x4e76('0x5')]},'original_channelCount':{'type':Sequelize[_0x4e76('0x6')]},'original_bitRate':{'type':Sequelize[_0x4e76('0x5')]},'original_sampleRate':{'type':Sequelize[_0x4e76('0x6')]},'converted_format':{'type':Sequelize[_0x4e76('0x2')]},'converted_duration':{'type':Sequelize[_0x4e76('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x4e76('0x5')]},'converted_channelCount':{'type':Sequelize[_0x4e76('0x6')]},'converted_bitRate':{'type':Sequelize[_0x4e76('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x4e76('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index eec691b..c685ea7 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 _0x2969=['converted_sampleCount','converted_bitRate','body','role','userProfileId','user','get','UserProfileSection','autoAssociation','create','update','pick','description','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','Sounds','UserProfileResource','sendStatus','error','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','filter','where','VIRTUAL','merge','options','includeAll','rows','catch','show','params','find','converted_format','root','server/files/sounds/converted','Sound\x20not\x20found','download','join','format','%s.%s','save_name','file','originalname','extname','basename','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest'];(function(_0x50f42c,_0x184ebc){var _0x1eb7ff=function(_0xd560da){while(--_0xd560da){_0x50f42c['push'](_0x50f42c['shift']());}};_0x1eb7ff(++_0x184ebc);}(_0x2969,0x1e2));var _0x9296=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2969[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9296('0x0'));var rimraf=require(_0x9296('0x1'));var zipdir=require(_0x9296('0x2'));var jsonpatch=require(_0x9296('0x3'));var rp=require(_0x9296('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9296('0x5'));var util=require('util');var path=require(_0x9296('0x6'));var sox=require(_0x9296('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9296('0x8'));var squel=require(_0x9296('0x9'));var crypto=require(_0x9296('0xa'));var jsforce=require(_0x9296('0xb'));var deskjs=require(_0x9296('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9296('0xd'));var as=require(_0x9296('0xe'));var hardwareService=require(_0x9296('0xf'));var logger=require(_0x9296('0x10'))(_0x9296('0x11'));var utils=require(_0x9296('0x12'));var config=require(_0x9296('0x13'));var licenseUtil=require(_0x9296('0x14'));var db=require(_0x9296('0x15'))['db'];function respondWithStatusCode(_0x4d7197,_0x43af59){_0x43af59=_0x43af59||0xcc;return function(_0x307f95){if(_0x307f95){return _0x4d7197['sendStatus'](_0x43af59);}return _0x4d7197[_0x9296('0x16')](_0x43af59)[_0x9296('0x17')]();};}function respondWithResult(_0x2f089e,_0x349803){_0x349803=_0x349803||0xc8;return function(_0x50940a){if(_0x50940a){return _0x2f089e[_0x9296('0x16')](_0x349803)[_0x9296('0x18')](_0x50940a);}};}function respondWithFilteredResult(_0x21a738,_0x5e5d19){return function(_0x138717){if(_0x138717){var _0x655ea1=typeof _0x5e5d19[_0x9296('0x19')]===_0x9296('0x1a')&&typeof _0x5e5d19[_0x9296('0x1b')]===_0x9296('0x1a');var _0x3c53aa=_0x138717[_0x9296('0x1c')];var _0x603b3c=_0x655ea1?0x0:_0x5e5d19[_0x9296('0x19')];var _0x554c47=_0x655ea1?_0x138717[_0x9296('0x1c')]:_0x5e5d19['offset']+_0x5e5d19[_0x9296('0x1b')];var _0x29549d;if(_0x554c47>=_0x3c53aa){_0x554c47=_0x3c53aa;_0x29549d=0xc8;}else{_0x29549d=0xce;}_0x21a738['status'](_0x29549d);return _0x21a738[_0x9296('0x1d')](_0x9296('0x1e'),_0x603b3c+'-'+_0x554c47+'/'+_0x3c53aa)[_0x9296('0x18')](_0x138717);}return null;};}function patchUpdates(_0x3e3064){return function(_0x367f4c){try{jsonpatch['apply'](_0x367f4c,_0x3e3064,!![]);}catch(_0x429554){return BPromise[_0x9296('0x1f')](_0x429554);}return _0x367f4c['save']();};}function saveUpdates(_0x141027,_0x157284){return function(_0x243d4f){if(_0x243d4f){return _0x243d4f['update'](_0x141027)[_0x9296('0x20')](function(_0x31f7d7){return _0x31f7d7;});}return null;};}function removeEntity(_0x31025b,_0x5ed4ec){return function(_0x1d93ca){if(_0x1d93ca){return _0x1d93ca[_0x9296('0x21')]()[_0x9296('0x20')](function(){var _0x34fc9a=_0x1d93ca['get']({'plain':!![]});var _0x3d0598=_0x9296('0x22');return db[_0x9296('0x23')][_0x9296('0x21')]({'where':{'type':_0x3d0598,'resourceId':_0x34fc9a['id']}})['then'](function(){return _0x1d93ca;});})[_0x9296('0x20')](function(){_0x31025b[_0x9296('0x16')](0xcc)[_0x9296('0x17')]();});}};}function handleEntityNotFound(_0x6ece8a,_0xf19075){return function(_0x57152a){if(!_0x57152a){_0x6ece8a[_0x9296('0x24')](0x194);}return _0x57152a;};}function handleError(_0x2d998e,_0x5573e1){_0x5573e1=_0x5573e1||0x1f4;return function(_0x3c0a6c){logger[_0x9296('0x25')](_0x3c0a6c['stack']);if(_0x3c0a6c[_0x9296('0x26')]){delete _0x3c0a6c[_0x9296('0x26')];}_0x2d998e[_0x9296('0x16')](_0x5573e1)[_0x9296('0x27')](_0x3c0a6c);};}exports[_0x9296('0x28')]=function(_0x2e69b2,_0x381a36){var _0x5cf4db={},_0x53f848={},_0x5903e6={'count':0x0,'rows':[]};var _0x59d1d7=_[_0x9296('0x29')](db[_0x9296('0x2a')][_0x9296('0x2b')],function(_0x5d057a){return{'name':_0x5d057a[_0x9296('0x2c')],'type':_0x5d057a[_0x9296('0x2d')][_0x9296('0x2e')]};});_0x53f848[_0x9296('0x2f')]=_[_0x9296('0x29')](_0x59d1d7,_0x9296('0x26'));_0x53f848[_0x9296('0x30')]=_[_0x9296('0x31')](_0x2e69b2[_0x9296('0x30')]);_0x53f848[_0x9296('0x32')]=_[_0x9296('0x33')](_0x53f848['model'],_0x53f848[_0x9296('0x30')]);_0x5cf4db['attributes']=_[_0x9296('0x33')](_0x53f848[_0x9296('0x2f')],qs[_0x9296('0x34')](_0x2e69b2[_0x9296('0x30')][_0x9296('0x34')]));_0x5cf4db[_0x9296('0x35')]=_0x5cf4db['attributes'][_0x9296('0x36')]?_0x5cf4db['attributes']:_0x53f848[_0x9296('0x2f')];if(!_0x2e69b2[_0x9296('0x30')][_0x9296('0x37')](_0x9296('0x38'))){_0x5cf4db[_0x9296('0x1b')]=qs[_0x9296('0x1b')](_0x2e69b2[_0x9296('0x30')][_0x9296('0x1b')]);_0x5cf4db[_0x9296('0x19')]=qs[_0x9296('0x19')](_0x2e69b2['query'][_0x9296('0x19')]);}_0x5cf4db[_0x9296('0x39')]=qs['sort'](_0x2e69b2['query']['sort']);_0x5cf4db['where']=qs[_0x9296('0x32')](_['pick'](_0x2e69b2['query'],_0x53f848['filters']),_0x59d1d7);if(_0x2e69b2[_0x9296('0x30')][_0x9296('0x3a')]){_0x5cf4db['where']=_['merge'](_0x5cf4db[_0x9296('0x3b')],{'$or':_[_0x9296('0x29')](_0x59d1d7,function(_0x3369c9){if(_0x3369c9[_0x9296('0x2d')]!==_0x9296('0x3c')){var _0xb3513f={};_0xb3513f[_0x3369c9[_0x9296('0x26')]]={'$like':'%'+_0x2e69b2['query'][_0x9296('0x3a')]+'%'};return _0xb3513f;}})});}_0x5cf4db=_[_0x9296('0x3d')]({},_0x5cf4db,_0x2e69b2[_0x9296('0x3e')]);var _0x286399={'where':_0x5cf4db[_0x9296('0x3b')]};return db['Sound']['count'](_0x286399)[_0x9296('0x20')](function(_0x3b803f){_0x5903e6[_0x9296('0x1c')]=_0x3b803f;if(_0x2e69b2[_0x9296('0x30')][_0x9296('0x3f')]){_0x5cf4db['include']=[{'all':!![]}];}return db[_0x9296('0x2a')]['findAll'](_0x5cf4db);})[_0x9296('0x20')](function(_0x3e4b41){_0x5903e6[_0x9296('0x40')]=_0x3e4b41;return _0x5903e6;})[_0x9296('0x20')](respondWithFilteredResult(_0x381a36,_0x5cf4db))[_0x9296('0x41')](handleError(_0x381a36,null));};exports[_0x9296('0x42')]=function(_0x2d2050,_0xc1e217){var _0x53458b={'raw':!![],'where':{'id':_0x2d2050[_0x9296('0x43')]['id']}},_0x472837={};_0x472837[_0x9296('0x2f')]=_[_0x9296('0x31')](db[_0x9296('0x2a')][_0x9296('0x2b')]);_0x472837[_0x9296('0x30')]=_[_0x9296('0x31')](_0x2d2050[_0x9296('0x30')]);_0x472837[_0x9296('0x32')]=_[_0x9296('0x33')](_0x472837[_0x9296('0x2f')],_0x472837[_0x9296('0x30')]);_0x53458b['attributes']=_[_0x9296('0x33')](_0x472837[_0x9296('0x2f')],qs[_0x9296('0x34')](_0x2d2050[_0x9296('0x30')][_0x9296('0x34')]));_0x53458b[_0x9296('0x35')]=_0x53458b[_0x9296('0x35')][_0x9296('0x36')]?_0x53458b['attributes']:_0x472837[_0x9296('0x2f')];if(_0x2d2050[_0x9296('0x30')][_0x9296('0x3f')]){_0x53458b['include']=[{'all':!![]}];}_0x53458b=_[_0x9296('0x3d')]({},_0x53458b,_0x2d2050['options']);return db[_0x9296('0x2a')]['find'](_0x53458b)[_0x9296('0x20')](handleEntityNotFound(_0xc1e217,null))[_0x9296('0x20')](respondWithResult(_0xc1e217,null))[_0x9296('0x41')](handleError(_0xc1e217,null));};exports['download']=function(_0x212845,_0x577489,_0x55f4a6){return db[_0x9296('0x2a')][_0x9296('0x44')]({'where':{'id':_0x212845[_0x9296('0x43')]['id']},'attributes':[_0x9296('0x26'),'save_name',_0x9296('0x45')],'raw':!![]})[_0x9296('0x20')](handleEntityNotFound(_0x577489,null))[_0x9296('0x20')](function(_0x369221){if(_0x369221){if(!fs['existsSync'](path['join'](config[_0x9296('0x46')],_0x9296('0x47'),_0x369221['save_name']+'.'+_0x369221['converted_format']))){throw new db['Sequelize']['ValidationError'](_0x9296('0x48'));}return _0x577489[_0x9296('0x49')](path[_0x9296('0x4a')](config[_0x9296('0x46')],_0x9296('0x47'),util[_0x9296('0x4b')](_0x9296('0x4c'),_0x369221[_0x9296('0x4d')],_0x369221[_0x9296('0x45')])),util['format'](_0x9296('0x4c'),_0x369221[_0x9296('0x26')],_0x369221['converted_format']));}return null;})[_0x9296('0x41')](handleError(_0x577489,null));};exports['create']=function(_0x178425,_0x5d7e87,_0xdfcc0c){var _0x2b2aec={'name':path['basename'](_0x178425[_0x9296('0x4e')][_0x9296('0x4f')],path[_0x9296('0x50')](_0x178425[_0x9296('0x4e')]['originalname'])),'save_name':path[_0x9296('0x51')](_0x178425[_0x9296('0x4e')][_0x9296('0x52')],path['extname'](_0x178425[_0x9296('0x4e')][_0x9296('0x52')])),'original_format':path[_0x9296('0x50')](_0x178425[_0x9296('0x4e')]['originalname'])[_0x9296('0x53')](0x1),'converted_format':_0x9296('0x54')};var _0x23839e=path[_0x9296('0x4a')](config[_0x9296('0x46')],_0x9296('0x55'),_0x178425[_0x9296('0x4e')][_0x9296('0x52')]);var _0x2d308a=path[_0x9296('0x4a')](config[_0x9296('0x46')],'server/files/sounds/converted',util[_0x9296('0x4b')](_0x9296('0x4c'),path[_0x9296('0x51')](_0x178425[_0x9296('0x4e')][_0x9296('0x52')],path[_0x9296('0x50')](_0x178425[_0x9296('0x4e')]['filename'])),_0x2b2aec[_0x9296('0x45')]));logger[_0x9296('0x56')](_0x9296('0x57'),_0x23839e);logger['info'](_0x9296('0x58'),_0x2d308a);try{fs[_0x9296('0x59')](_0x23839e,parseInt('0777',0x8));var _0x17628b=sox[_0x9296('0x5a')](_0x23839e,_0x2d308a,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x17628b['on'](_0x9296('0x25'),function(_0x58f9ad){fs[_0x9296('0x5b')](_0x23839e);_0x5d7e87['status'](0x1f4)['send'](_0x58f9ad);});_0x17628b['on'](_0x9296('0x5c'),function(_0x5ada34){_0x2b2aec[_0x9296('0x5d')]=isNaN(_0x5ada34[_0x9296('0x5e')])?null:_0x5ada34[_0x9296('0x5e')]*0x3e8;_0x2b2aec[_0x9296('0x5f')]=isNaN(_0x5ada34['sampleCount'])?null:_0x5ada34[_0x9296('0x60')];_0x2b2aec[_0x9296('0x61')]=isNaN(_0x5ada34['channelCount'])?null:_0x5ada34[_0x9296('0x62')];_0x2b2aec['original_bitRate']=isNaN(_0x5ada34[_0x9296('0x63')])?null:_0x5ada34[_0x9296('0x63')];_0x2b2aec[_0x9296('0x64')]=isNaN(_0x5ada34[_0x9296('0x65')])?null:_0x5ada34[_0x9296('0x65')];});_0x17628b['on'](_0x9296('0x66'),function(_0xce6ee6){_0x2b2aec['converted_duration']=isNaN(_0xce6ee6[_0x9296('0x5e')])?null:_0xce6ee6['duration']*0x3e8;_0x2b2aec[_0x9296('0x67')]=isNaN(_0xce6ee6[_0x9296('0x60')])?null:_0xce6ee6[_0x9296('0x60')];_0x2b2aec['converted_channelCount']=isNaN(_0xce6ee6[_0x9296('0x62')])?null:_0xce6ee6[_0x9296('0x62')];_0x2b2aec[_0x9296('0x68')]=isNaN(_0xce6ee6['bitRate'])?null:_0xce6ee6['bitRate'];_0x2b2aec['converted_sampleRate']=isNaN(_0xce6ee6[_0x9296('0x65')])?null:_0xce6ee6[_0x9296('0x65')];});_0x17628b['on'](_0x9296('0x17'),function(){fs[_0x9296('0x59')](_0x2d308a,parseInt('0777',0x8));return db[_0x9296('0x2a')]['create'](_0x2b2aec)[_0x9296('0x20')](function(_0xcf86b6){var _0x10d896={'role':_0x178425[_0x9296('0x69')][_0x9296('0x6a')],'userProfileId':_0x178425['body'][_0x9296('0x6b')]};if(!_0x10d896)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10d896[_0x9296('0x6a')]===_0x9296('0x6c')){var _0x510f72=_0xcf86b6[_0x9296('0x6d')]({'plain':!![]});return db[_0x9296('0x6e')][_0x9296('0x44')]({'where':{'name':'Sounds','userProfileId':_0x10d896[_0x9296('0x6b')]},'raw':!![]})[_0x9296('0x20')](function(_0x2a8af2){if(_0x2a8af2&&_0x2a8af2[_0x9296('0x6f')]===0x0){return db[_0x9296('0x23')][_0x9296('0x70')]({'name':_0x510f72['name'],'resourceId':_0x510f72['id'],'type':_0x2a8af2[_0x9296('0x26')],'sectionId':_0x2a8af2['id']},{})['then'](function(){return _0xcf86b6;});}else{return _0xcf86b6;}})[_0x9296('0x41')](function(_0x294666){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x294666);throw _0x294666;});}return _0xcf86b6;})[_0x9296('0x20')](respondWithResult(_0x5d7e87,null))[_0x9296('0x41')](handleError(_0x5d7e87,null));});_0x17628b['start']();}catch(_0x22b31a){_0x5d7e87[_0x9296('0x16')](0x1f4)[_0x9296('0x27')](_0x22b31a);}};exports[_0x9296('0x71')]=function(_0x1ab107,_0x1a9c4f,_0x6db943){return db[_0x9296('0x2a')]['find']({'where':{'id':_0x1ab107[_0x9296('0x43')]['id']}})[_0x9296('0x20')](handleEntityNotFound(_0x1a9c4f,null))[_0x9296('0x20')](saveUpdates(_[_0x9296('0x72')](_0x1ab107[_0x9296('0x69')],['name',_0x9296('0x73')]),null))[_0x9296('0x20')](respondWithResult(_0x1a9c4f,null))[_0x9296('0x41')](handleError(_0x1a9c4f,null));};exports['delete']=function(_0x281755,_0x397344,_0x556061){return db[_0x9296('0x2a')][_0x9296('0x44')]({'where':{'id':_0x281755[_0x9296('0x43')]['id']}})['then'](function(_0x524fe0){if(_0x524fe0){return _0x524fe0[_0x9296('0x21')]();}})[_0x9296('0x20')](function(_0x5106db){var _0x27619c=path[_0x9296('0x4a')](config[_0x9296('0x46')],_0x9296('0x55'),util[_0x9296('0x4b')]('%s.%s',_0x5106db[_0x9296('0x4d')],_0x5106db[_0x9296('0x74')]));var _0x59ade1=path[_0x9296('0x4a')](config[_0x9296('0x46')],_0x9296('0x47'),util['format'](_0x9296('0x4c'),_0x5106db[_0x9296('0x4d')],_0x5106db['converted_format']));fs[_0x9296('0x5b')](_0x27619c);fs[_0x9296('0x5b')](_0x59ade1);return _0x5106db;})[_0x9296('0x20')](function(_0x4b941b){if(_0x4b941b){return _0x397344[_0x9296('0x16')](0xcc)[_0x9296('0x17')]();}})[_0x9296('0x20')](handleEntityNotFound(_0x397344,null))[_0x9296('0x41')](handleError(_0x397344,null));}; \ No newline at end of file +var _0x10ae=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','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','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','get','Sounds','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','fields','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','format','%s.%s','create','file','extname','originalname','filename','substring','wav','basename','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_bitRate','converted_sampleRate','0777','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileResource','pick','description','delete','server/files/sounds/original','original_format'];(function(_0x2db422,_0x2caab3){var _0x193c18=function(_0x52efa6){while(--_0x52efa6){_0x2db422['push'](_0x2db422['shift']());}};_0x193c18(++_0x2caab3);}(_0x10ae,0x1e0));var _0xe10a=function(_0x33dd5a,_0x19f9a6){_0x33dd5a=_0x33dd5a-0x0;var _0x30b940=_0x10ae[_0x33dd5a];return _0x30b940;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe10a('0x0'));var zipdir=require(_0xe10a('0x1'));var jsonpatch=require(_0xe10a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe10a('0x3'));var Mustache=require(_0xe10a('0x4'));var util=require(_0xe10a('0x5'));var path=require('path');var sox=require(_0xe10a('0x6'));var csv=require(_0xe10a('0x7'));var ejs=require(_0xe10a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe10a('0x9'));var squel=require(_0xe10a('0xa'));var crypto=require(_0xe10a('0xb'));var jsforce=require(_0xe10a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe10a('0x7'));var querystring=require(_0xe10a('0xd'));var Papa=require(_0xe10a('0xe'));var Redis=require('ioredis');var authService=require(_0xe10a('0xf'));var qs=require(_0xe10a('0x10'));var as=require(_0xe10a('0x11'));var hardwareService=require(_0xe10a('0x12'));var logger=require(_0xe10a('0x13'))(_0xe10a('0x14'));var utils=require(_0xe10a('0x15'));var config=require(_0xe10a('0x16'));var licenseUtil=require(_0xe10a('0x17'));var db=require(_0xe10a('0x18'))['db'];function respondWithStatusCode(_0xc6672f,_0x2ddce2){_0x2ddce2=_0x2ddce2||0xcc;return function(_0x85b267){if(_0x85b267){return _0xc6672f[_0xe10a('0x19')](_0x2ddce2);}return _0xc6672f['status'](_0x2ddce2)[_0xe10a('0x1a')]();};}function respondWithResult(_0x3cb8b4,_0x5c0b0f){_0x5c0b0f=_0x5c0b0f||0xc8;return function(_0x91de08){if(_0x91de08){return _0x3cb8b4[_0xe10a('0x1b')](_0x5c0b0f)['json'](_0x91de08);}};}function respondWithFilteredResult(_0x4573de,_0x37eddb){return function(_0x4c878a){if(_0x4c878a){var _0x3b62d9=typeof _0x37eddb[_0xe10a('0x1c')]==='undefined'&&typeof _0x37eddb[_0xe10a('0x1d')]===_0xe10a('0x1e');var _0x4c2eec=_0x4c878a[_0xe10a('0x1f')];var _0x235304=_0x3b62d9?0x0:_0x37eddb[_0xe10a('0x1c')];var _0x75d248=_0x3b62d9?_0x4c878a[_0xe10a('0x1f')]:_0x37eddb[_0xe10a('0x1c')]+_0x37eddb[_0xe10a('0x1d')];var _0x3aa39a;if(_0x75d248>=_0x4c2eec){_0x75d248=_0x4c2eec;_0x3aa39a=0xc8;}else{_0x3aa39a=0xce;}_0x4573de[_0xe10a('0x1b')](_0x3aa39a);return _0x4573de[_0xe10a('0x20')](_0xe10a('0x21'),_0x235304+'-'+_0x75d248+'/'+_0x4c2eec)[_0xe10a('0x22')](_0x4c878a);}return null;};}function patchUpdates(_0x299307){return function(_0x13f642){try{jsonpatch[_0xe10a('0x23')](_0x13f642,_0x299307,!![]);}catch(_0x5571e8){return BPromise['reject'](_0x5571e8);}return _0x13f642[_0xe10a('0x24')]();};}function saveUpdates(_0x3be6aa,_0x3c3ed2){return function(_0x1c1fef){if(_0x1c1fef){return _0x1c1fef[_0xe10a('0x25')](_0x3be6aa)[_0xe10a('0x26')](function(_0x37cd28){return _0x37cd28;});}return null;};}function removeEntity(_0x42d8d,_0x138d2f){return function(_0x1a964f){if(_0x1a964f){return _0x1a964f[_0xe10a('0x27')]()[_0xe10a('0x26')](function(){var _0x146236=_0x1a964f[_0xe10a('0x28')]({'plain':!![]});var _0x4c8612=_0xe10a('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x4c8612,'resourceId':_0x146236['id']}})[_0xe10a('0x26')](function(){return _0x1a964f;});})['then'](function(){_0x42d8d[_0xe10a('0x1b')](0xcc)[_0xe10a('0x1a')]();});}};}function handleEntityNotFound(_0x16f7b5,_0x479dbb){return function(_0xd3270f){if(!_0xd3270f){_0x16f7b5[_0xe10a('0x19')](0x194);}return _0xd3270f;};}function handleError(_0x5676dd,_0x186c7f){_0x186c7f=_0x186c7f||0x1f4;return function(_0x3743bf){logger[_0xe10a('0x2a')](_0x3743bf[_0xe10a('0x2b')]);if(_0x3743bf[_0xe10a('0x2c')]){delete _0x3743bf[_0xe10a('0x2c')];}_0x5676dd[_0xe10a('0x1b')](_0x186c7f)[_0xe10a('0x2d')](_0x3743bf);};}exports[_0xe10a('0x2e')]=function(_0xc0a561,_0x252963){var _0x5bb31c={},_0xbd1c73={},_0x48f8f5={'count':0x0,'rows':[]};var _0x4124b3=_[_0xe10a('0x2f')](db[_0xe10a('0x30')][_0xe10a('0x31')],function(_0x29412a){return{'name':_0x29412a[_0xe10a('0x32')],'type':_0x29412a[_0xe10a('0x33')][_0xe10a('0x34')]};});_0xbd1c73[_0xe10a('0x35')]=_['map'](_0x4124b3,_0xe10a('0x2c'));_0xbd1c73[_0xe10a('0x36')]=_[_0xe10a('0x37')](_0xc0a561[_0xe10a('0x36')]);_0xbd1c73[_0xe10a('0x38')]=_['intersection'](_0xbd1c73[_0xe10a('0x35')],_0xbd1c73[_0xe10a('0x36')]);_0x5bb31c[_0xe10a('0x39')]=_[_0xe10a('0x3a')](_0xbd1c73[_0xe10a('0x35')],qs['fields'](_0xc0a561[_0xe10a('0x36')]['fields']));_0x5bb31c[_0xe10a('0x39')]=_0x5bb31c[_0xe10a('0x39')]['length']?_0x5bb31c['attributes']:_0xbd1c73[_0xe10a('0x35')];if(!_0xc0a561['query']['hasOwnProperty'](_0xe10a('0x3b'))){_0x5bb31c[_0xe10a('0x1d')]=qs['limit'](_0xc0a561[_0xe10a('0x36')][_0xe10a('0x1d')]);_0x5bb31c[_0xe10a('0x1c')]=qs[_0xe10a('0x1c')](_0xc0a561['query']['offset']);}_0x5bb31c[_0xe10a('0x3c')]=qs[_0xe10a('0x3d')](_0xc0a561['query'][_0xe10a('0x3d')]);_0x5bb31c[_0xe10a('0x3e')]=qs[_0xe10a('0x38')](_['pick'](_0xc0a561[_0xe10a('0x36')],_0xbd1c73[_0xe10a('0x38')]),_0x4124b3);if(_0xc0a561[_0xe10a('0x36')][_0xe10a('0x3f')]){_0x5bb31c[_0xe10a('0x3e')]=_['merge'](_0x5bb31c[_0xe10a('0x3e')],{'$or':_[_0xe10a('0x2f')](_0x4124b3,function(_0x421b7f){if(_0x421b7f[_0xe10a('0x33')]!==_0xe10a('0x40')){var _0x517d29={};_0x517d29[_0x421b7f['name']]={'$like':'%'+_0xc0a561[_0xe10a('0x36')][_0xe10a('0x3f')]+'%'};return _0x517d29;}})});}_0x5bb31c=_[_0xe10a('0x41')]({},_0x5bb31c,_0xc0a561[_0xe10a('0x42')]);var _0x2534c2={'where':_0x5bb31c[_0xe10a('0x3e')]};return db[_0xe10a('0x30')][_0xe10a('0x1f')](_0x2534c2)['then'](function(_0x5c58e6){_0x48f8f5[_0xe10a('0x1f')]=_0x5c58e6;if(_0xc0a561[_0xe10a('0x36')][_0xe10a('0x43')]){_0x5bb31c[_0xe10a('0x44')]=[{'all':!![]}];}return db[_0xe10a('0x30')]['findAll'](_0x5bb31c);})['then'](function(_0x80e44c){_0x48f8f5[_0xe10a('0x45')]=_0x80e44c;return _0x48f8f5;})[_0xe10a('0x26')](respondWithFilteredResult(_0x252963,_0x5bb31c))[_0xe10a('0x46')](handleError(_0x252963,null));};exports[_0xe10a('0x47')]=function(_0x33bb30,_0x5c97c6){var _0x28f356={'raw':!![],'where':{'id':_0x33bb30[_0xe10a('0x48')]['id']}},_0x447e86={};_0x447e86[_0xe10a('0x35')]=_['keys'](db[_0xe10a('0x30')][_0xe10a('0x31')]);_0x447e86[_0xe10a('0x36')]=_['keys'](_0x33bb30['query']);_0x447e86[_0xe10a('0x38')]=_['intersection'](_0x447e86[_0xe10a('0x35')],_0x447e86[_0xe10a('0x36')]);_0x28f356['attributes']=_[_0xe10a('0x3a')](_0x447e86[_0xe10a('0x35')],qs[_0xe10a('0x49')](_0x33bb30[_0xe10a('0x36')][_0xe10a('0x49')]));_0x28f356[_0xe10a('0x39')]=_0x28f356[_0xe10a('0x39')]['length']?_0x28f356['attributes']:_0x447e86['model'];if(_0x33bb30[_0xe10a('0x36')]['includeAll']){_0x28f356[_0xe10a('0x44')]=[{'all':!![]}];}_0x28f356=_['merge']({},_0x28f356,_0x33bb30['options']);return db['Sound'][_0xe10a('0x4a')](_0x28f356)[_0xe10a('0x26')](handleEntityNotFound(_0x5c97c6,null))[_0xe10a('0x26')](respondWithResult(_0x5c97c6,null))['catch'](handleError(_0x5c97c6,null));};exports[_0xe10a('0x4b')]=function(_0x2e0088,_0x2a7bd9,_0x3fd3d7){return db[_0xe10a('0x30')][_0xe10a('0x4a')]({'where':{'id':_0x2e0088[_0xe10a('0x48')]['id']},'attributes':[_0xe10a('0x2c'),_0xe10a('0x4c'),_0xe10a('0x4d')],'raw':!![]})[_0xe10a('0x26')](handleEntityNotFound(_0x2a7bd9,null))['then'](function(_0x3df1d7){if(_0x3df1d7){if(!fs[_0xe10a('0x4e')](path[_0xe10a('0x4f')](config[_0xe10a('0x50')],_0xe10a('0x51'),_0x3df1d7[_0xe10a('0x4c')]+'.'+_0x3df1d7[_0xe10a('0x4d')]))){throw new db['Sequelize']['ValidationError']('Sound\x20not\x20found');}return _0x2a7bd9[_0xe10a('0x4b')](path[_0xe10a('0x4f')](config['root'],_0xe10a('0x51'),util[_0xe10a('0x52')](_0xe10a('0x53'),_0x3df1d7[_0xe10a('0x4c')],_0x3df1d7[_0xe10a('0x4d')])),util[_0xe10a('0x52')](_0xe10a('0x53'),_0x3df1d7['name'],_0x3df1d7['converted_format']));}return null;})[_0xe10a('0x46')](handleError(_0x2a7bd9,null));};exports[_0xe10a('0x54')]=function(_0x4d9ec7,_0x3ae0f7,_0x43b3a9){var _0x149a33={'name':path['basename'](_0x4d9ec7[_0xe10a('0x55')]['originalname'],path[_0xe10a('0x56')](_0x4d9ec7[_0xe10a('0x55')][_0xe10a('0x57')])),'save_name':path['basename'](_0x4d9ec7[_0xe10a('0x55')]['filename'],path[_0xe10a('0x56')](_0x4d9ec7[_0xe10a('0x55')][_0xe10a('0x58')])),'original_format':path[_0xe10a('0x56')](_0x4d9ec7[_0xe10a('0x55')][_0xe10a('0x57')])[_0xe10a('0x59')](0x1),'converted_format':_0xe10a('0x5a')};var _0x521f9e=path[_0xe10a('0x4f')](config[_0xe10a('0x50')],'server/files/sounds/original',_0x4d9ec7[_0xe10a('0x55')][_0xe10a('0x58')]);var _0x3192bb=path['join'](config[_0xe10a('0x50')],_0xe10a('0x51'),util[_0xe10a('0x52')]('%s.%s',path[_0xe10a('0x5b')](_0x4d9ec7['file']['filename'],path[_0xe10a('0x56')](_0x4d9ec7['file'][_0xe10a('0x58')])),_0x149a33['converted_format']));logger['info'](_0xe10a('0x5c'),_0x521f9e);logger[_0xe10a('0x5d')](_0xe10a('0x5e'),_0x3192bb);try{fs[_0xe10a('0x5f')](_0x521f9e,parseInt('0777',0x8));var _0x250c6b=sox[_0xe10a('0x60')](_0x521f9e,_0x3192bb,{'sampleRate':0x1f40,'format':_0xe10a('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x250c6b['on'](_0xe10a('0x2a'),function(_0x31d81d){fs[_0xe10a('0x61')](_0x521f9e);_0x3ae0f7['status'](0x1f4)[_0xe10a('0x2d')](_0x31d81d);});_0x250c6b['on']('src',function(_0x4fc019){_0x149a33['original_duration']=isNaN(_0x4fc019[_0xe10a('0x62')])?null:_0x4fc019[_0xe10a('0x62')]*0x3e8;_0x149a33[_0xe10a('0x63')]=isNaN(_0x4fc019[_0xe10a('0x64')])?null:_0x4fc019['sampleCount'];_0x149a33[_0xe10a('0x65')]=isNaN(_0x4fc019['channelCount'])?null:_0x4fc019[_0xe10a('0x66')];_0x149a33[_0xe10a('0x67')]=isNaN(_0x4fc019[_0xe10a('0x68')])?null:_0x4fc019[_0xe10a('0x68')];_0x149a33['original_sampleRate']=isNaN(_0x4fc019[_0xe10a('0x69')])?null:_0x4fc019[_0xe10a('0x69')];});_0x250c6b['on'](_0xe10a('0x6a'),function(_0xf2f17f){_0x149a33['converted_duration']=isNaN(_0xf2f17f[_0xe10a('0x62')])?null:_0xf2f17f['duration']*0x3e8;_0x149a33['converted_sampleCount']=isNaN(_0xf2f17f[_0xe10a('0x64')])?null:_0xf2f17f[_0xe10a('0x64')];_0x149a33['converted_channelCount']=isNaN(_0xf2f17f['channelCount'])?null:_0xf2f17f[_0xe10a('0x66')];_0x149a33[_0xe10a('0x6b')]=isNaN(_0xf2f17f[_0xe10a('0x68')])?null:_0xf2f17f[_0xe10a('0x68')];_0x149a33[_0xe10a('0x6c')]=isNaN(_0xf2f17f[_0xe10a('0x69')])?null:_0xf2f17f[_0xe10a('0x69')];});_0x250c6b['on'](_0xe10a('0x1a'),function(){fs[_0xe10a('0x5f')](_0x3192bb,parseInt(_0xe10a('0x6d'),0x8));return db[_0xe10a('0x30')]['create'](_0x149a33)[_0xe10a('0x26')](function(_0x5ba482){var _0x386d48={'role':_0x4d9ec7[_0xe10a('0x6e')]['role'],'userProfileId':_0x4d9ec7[_0xe10a('0x6e')][_0xe10a('0x6f')]};if(!_0x386d48)throw new Error(_0xe10a('0x70'));if(_0x386d48['role']===_0xe10a('0x71')){var _0x5ddb8c=_0x5ba482[_0xe10a('0x28')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe10a('0x29'),'userProfileId':_0x386d48[_0xe10a('0x6f')]},'raw':!![]})['then'](function(_0x4f1d4a){if(_0x4f1d4a&&_0x4f1d4a['autoAssociation']===0x0){return db[_0xe10a('0x72')][_0xe10a('0x54')]({'name':_0x5ddb8c['name'],'resourceId':_0x5ddb8c['id'],'type':_0x4f1d4a[_0xe10a('0x2c')],'sectionId':_0x4f1d4a['id']},{})['then'](function(){return _0x5ba482;});}else{return _0x5ba482;}})[_0xe10a('0x46')](function(_0xea3485){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xea3485);throw _0xea3485;});}return _0x5ba482;})['then'](respondWithResult(_0x3ae0f7,null))[_0xe10a('0x46')](handleError(_0x3ae0f7,null));});_0x250c6b['start']();}catch(_0x573f15){_0x3ae0f7[_0xe10a('0x1b')](0x1f4)[_0xe10a('0x2d')](_0x573f15);}};exports[_0xe10a('0x25')]=function(_0x2c3876,_0x5ad21f,_0x4c44c3){return db['Sound'][_0xe10a('0x4a')]({'where':{'id':_0x2c3876[_0xe10a('0x48')]['id']}})[_0xe10a('0x26')](handleEntityNotFound(_0x5ad21f,null))[_0xe10a('0x26')](saveUpdates(_[_0xe10a('0x73')](_0x2c3876[_0xe10a('0x6e')],[_0xe10a('0x2c'),_0xe10a('0x74')]),null))[_0xe10a('0x26')](respondWithResult(_0x5ad21f,null))['catch'](handleError(_0x5ad21f,null));};exports[_0xe10a('0x75')]=function(_0x14a5ad,_0x20cce0,_0xfd3fce){return db['Sound']['find']({'where':{'id':_0x14a5ad['params']['id']}})['then'](function(_0x24b297){if(_0x24b297){return _0x24b297[_0xe10a('0x27')]();}})[_0xe10a('0x26')](function(_0x5c166c){var _0x4e0b3c=path[_0xe10a('0x4f')](config[_0xe10a('0x50')],_0xe10a('0x76'),util[_0xe10a('0x52')](_0xe10a('0x53'),_0x5c166c[_0xe10a('0x4c')],_0x5c166c[_0xe10a('0x77')]));var _0x309387=path[_0xe10a('0x4f')](config['root'],_0xe10a('0x51'),util[_0xe10a('0x52')](_0xe10a('0x53'),_0x5c166c[_0xe10a('0x4c')],_0x5c166c[_0xe10a('0x4d')]));fs['unlinkSync'](_0x4e0b3c);fs['unlinkSync'](_0x309387);return _0x5c166c;})[_0xe10a('0x26')](function(_0x15f6da){if(_0x15f6da){return _0x20cce0['status'](0xcc)[_0xe10a('0x1a')]();}})['then'](handleEntityNotFound(_0x20cce0,null))[_0xe10a('0x46')](handleError(_0x20cce0,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 95fa004..f674438 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 _0xa77f=['exports','define','Sound','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes'];(function(_0x4265f4,_0x44b225){var _0x4048a4=function(_0x33a761){while(--_0x33a761){_0x4265f4['push'](_0x4265f4['shift']());}};_0x4048a4(++_0x44b225);}(_0xa77f,0xcf));var _0xfa77=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa77f[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xfa77('0x0'));var logger=require(_0xfa77('0x1'))(_0xfa77('0x2'));var moment=require(_0xfa77('0x3'));var BPromise=require(_0xfa77('0x4'));var rp=require(_0xfa77('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa77('0x6'));var config=require(_0xfa77('0x7'));var attributes=require(_0xfa77('0x8'));module[_0xfa77('0x9')]=function(_0x51d9fe,_0x1d31e6){return _0x51d9fe[_0xfa77('0xa')](_0xfa77('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6737=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x6737,0xd0));var _0x7673=function(_0x3d4595,_0x3841fe){_0x3d4595=_0x3d4595-0x0;var _0x590cde=_0x6737[_0x3d4595];return _0x590cde;};'use strict';var _=require(_0x7673('0x0'));var util=require(_0x7673('0x1'));var logger=require(_0x7673('0x2'))(_0x7673('0x3'));var moment=require(_0x7673('0x4'));var BPromise=require('bluebird');var rp=require(_0x7673('0x5'));var fs=require('fs');var path=require(_0x7673('0x6'));var rimraf=require(_0x7673('0x7'));var config=require(_0x7673('0x8'));var attributes=require(_0x7673('0x9'));module['exports']=function(_0x205775,_0x4a36d4){return _0x205775[_0x7673('0xa')](_0x7673('0xb'),attributes,{'tableName':_0x7673('0xc'),'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 c4b2ae6..8e1a197 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 _0xf3b0=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','attributes','include','map','model','debug'];(function(_0xa0d372,_0x5aeed5){var _0x16a57f=function(_0x422dbf){while(--_0x422dbf){_0xa0d372['push'](_0xa0d372['shift']());}};_0x16a57f(++_0x5aeed5);}(_0xf3b0,0x90));var _0x0f3b=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0xf3b0[_0x3ef2d5];return _0x2fefb2;};'use strict';var _=require(_0x0f3b('0x0'));var util=require(_0x0f3b('0x1'));var moment=require(_0x0f3b('0x2'));var BPromise=require(_0x0f3b('0x3'));var rs=require(_0x0f3b('0x4'));var fs=require('fs');var Redis=require(_0x0f3b('0x5'));var db=require(_0x0f3b('0x6'))['db'];var utils=require(_0x0f3b('0x7'));var logger=require(_0x0f3b('0x8'))(_0x0f3b('0x9'));var config=require(_0x0f3b('0xa'));var jayson=require(_0x0f3b('0xb'));var client=jayson[_0x0f3b('0xc')][_0x0f3b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xe5a5e8,_0x246daf,_0x3e7e4c){return new BPromise(function(_0x3fdcaf,_0x41fa92){return client[_0x0f3b('0xe')](_0xe5a5e8,_0x3e7e4c)[_0x0f3b('0xf')](function(_0x2653a0){logger[_0x0f3b('0x10')](_0x0f3b('0x11'),_0x246daf,'request\x20sent');logger['debug'](_0x0f3b('0x12'),_0x246daf,_0x0f3b('0x13'),JSON[_0x0f3b('0x14')](_0x2653a0));if(_0x2653a0[_0x0f3b('0x15')]){if(_0x2653a0[_0x0f3b('0x15')][_0x0f3b('0x16')]===0x1f4){logger[_0x0f3b('0x15')]('Sound,\x20%s,\x20%s',_0x246daf,_0x2653a0[_0x0f3b('0x15')][_0x0f3b('0x17')]);return _0x41fa92(_0x2653a0['error'][_0x0f3b('0x17')]);}logger['error'](_0x0f3b('0x11'),_0x246daf,_0x2653a0[_0x0f3b('0x15')][_0x0f3b('0x17')]);return _0x3fdcaf(_0x2653a0[_0x0f3b('0x15')]['message']);}else{logger[_0x0f3b('0x10')](_0x0f3b('0x11'),_0x246daf,_0x0f3b('0x13'));_0x3fdcaf(_0x2653a0[_0x0f3b('0x18')][_0x0f3b('0x17')]);}})[_0x0f3b('0x19')](function(_0x4d2469){logger['error'](_0x0f3b('0x11'),_0x246daf,_0x4d2469);_0x41fa92(_0x4d2469);});});}exports[_0x0f3b('0x1a')]=function(_0x1408c1){var _0x255532=this;return new Promise(function(_0x24a73c,_0x50294a){return db[_0x0f3b('0x1b')]['find']({'raw':_0x1408c1[_0x0f3b('0x1c')]?_0x1408c1[_0x0f3b('0x1c')][_0x0f3b('0x1d')]===undefined?!![]:![]:!![],'where':_0x1408c1[_0x0f3b('0x1c')]?_0x1408c1[_0x0f3b('0x1c')][_0x0f3b('0x1e')]||null:null,'attributes':_0x1408c1['options']?_0x1408c1[_0x0f3b('0x1c')][_0x0f3b('0x1f')]||null:null,'include':_0x1408c1[_0x0f3b('0x1c')]?_0x1408c1['options'][_0x0f3b('0x20')]?_[_0x0f3b('0x21')](_0x1408c1[_0x0f3b('0x1c')][_0x0f3b('0x20')],function(_0x25a873){return{'model':db[_0x25a873['model']],'as':_0x25a873['as'],'attributes':_0x25a873[_0x0f3b('0x1f')],'include':_0x25a873[_0x0f3b('0x20')]?_[_0x0f3b('0x21')](_0x25a873['include'],function(_0x293388){return{'model':db[_0x293388[_0x0f3b('0x22')]],'as':_0x293388['as'],'attributes':_0x293388[_0x0f3b('0x1f')],'include':_0x293388[_0x0f3b('0x20')]?_[_0x0f3b('0x21')](_0x293388[_0x0f3b('0x20')],function(_0x2a45fa){return{'model':db[_0x2a45fa[_0x0f3b('0x22')]],'as':_0x2a45fa['as'],'attributes':_0x2a45fa[_0x0f3b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ffa66){logger[_0x0f3b('0x10')](_0x0f3b('0x1a'),_0x1408c1);logger[_0x0f3b('0x23')](_0x0f3b('0x1a'),_0x1408c1,JSON[_0x0f3b('0x14')](_0x2ffa66));_0x24a73c(_0x2ffa66);})[_0x0f3b('0x19')](function(_0x5cae55){logger[_0x0f3b('0x15')](_0x0f3b('0x1a'),_0x5cae55[_0x0f3b('0x17')],_0x1408c1);_0x50294a(_0x255532[_0x0f3b('0x15')](0x1f4,_0x5cae55[_0x0f3b('0x17')]));});});}; \ No newline at end of file +var _0x54a9=['debug','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','error','message','result','catch','ShowSound','Sound','find','options','where','attributes','include','map','model'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x54a9,0xdb));var _0x954a=function(_0x45f921,_0x4b8dd5){_0x45f921=_0x45f921-0x0;var _0x1602a0=_0x54a9[_0x45f921];return _0x1602a0;};'use strict';var _=require(_0x954a('0x0'));var util=require(_0x954a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x954a('0x2'));var fs=require('fs');var Redis=require(_0x954a('0x3'));var db=require(_0x954a('0x4'))['db'];var utils=require(_0x954a('0x5'));var logger=require(_0x954a('0x6'))(_0x954a('0x7'));var config=require('../../config/environment');var jayson=require(_0x954a('0x8'));var client=jayson[_0x954a('0x9')][_0x954a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4200ff,_0x556f2e,_0x5d1b23){return new BPromise(function(_0x8baeeb,_0x27bdca){return client[_0x954a('0xb')](_0x4200ff,_0x5d1b23)[_0x954a('0xc')](function(_0x4dcfa4){logger[_0x954a('0xd')](_0x954a('0xe'),_0x556f2e,_0x954a('0xf'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x556f2e,'request\x20sent',JSON['stringify'](_0x4dcfa4));if(_0x4dcfa4[_0x954a('0x10')]){if(_0x4dcfa4[_0x954a('0x10')]['code']===0x1f4){logger[_0x954a('0x10')](_0x954a('0xe'),_0x556f2e,_0x4dcfa4['error'][_0x954a('0x11')]);return _0x27bdca(_0x4dcfa4['error'][_0x954a('0x11')]);}logger['error'](_0x954a('0xe'),_0x556f2e,_0x4dcfa4[_0x954a('0x10')][_0x954a('0x11')]);return _0x8baeeb(_0x4dcfa4['error']['message']);}else{logger[_0x954a('0xd')](_0x954a('0xe'),_0x556f2e,'request\x20sent');_0x8baeeb(_0x4dcfa4[_0x954a('0x12')][_0x954a('0x11')]);}})[_0x954a('0x13')](function(_0x45b338){logger['error'](_0x954a('0xe'),_0x556f2e,_0x45b338);_0x27bdca(_0x45b338);});});}exports[_0x954a('0x14')]=function(_0x20df40){var _0x3cde73=this;return new Promise(function(_0x4f90a6,_0x5abc28){return db[_0x954a('0x15')][_0x954a('0x16')]({'raw':_0x20df40[_0x954a('0x17')]?_0x20df40[_0x954a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x20df40[_0x954a('0x17')]?_0x20df40[_0x954a('0x17')][_0x954a('0x18')]||null:null,'attributes':_0x20df40[_0x954a('0x17')]?_0x20df40[_0x954a('0x17')][_0x954a('0x19')]||null:null,'include':_0x20df40['options']?_0x20df40['options'][_0x954a('0x1a')]?_[_0x954a('0x1b')](_0x20df40[_0x954a('0x17')][_0x954a('0x1a')],function(_0x4a55ad){return{'model':db[_0x4a55ad[_0x954a('0x1c')]],'as':_0x4a55ad['as'],'attributes':_0x4a55ad[_0x954a('0x19')],'include':_0x4a55ad[_0x954a('0x1a')]?_['map'](_0x4a55ad[_0x954a('0x1a')],function(_0x3e7b96){return{'model':db[_0x3e7b96[_0x954a('0x1c')]],'as':_0x3e7b96['as'],'attributes':_0x3e7b96[_0x954a('0x19')],'include':_0x3e7b96[_0x954a('0x1a')]?_[_0x954a('0x1b')](_0x3e7b96[_0x954a('0x1a')],function(_0x37d001){return{'model':db[_0x37d001[_0x954a('0x1c')]],'as':_0x37d001['as'],'attributes':_0x37d001[_0x954a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x954a('0xc')](function(_0x1e097c){logger[_0x954a('0xd')](_0x954a('0x14'),_0x20df40);logger[_0x954a('0x1d')](_0x954a('0x14'),_0x20df40,JSON[_0x954a('0x1e')](_0x1e097c));_0x4f90a6(_0x1e097c);})[_0x954a('0x13')](function(_0x7b036f){logger[_0x954a('0x10')](_0x954a('0x14'),_0x7b036f[_0x954a('0x11')],_0x20df40);_0x5abc28(_0x3cde73[_0x954a('0x10')](0x1f4,_0x7b036f[_0x954a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 783fb30..a5ffb0d 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x55f549,_0x4f90ac){var _0x589a78=function(_0x4b2cc3){while(--_0x4b2cc3){_0x55f549['push'](_0x55f549['shift']());}};_0x589a78(++_0x4f90ac);}(_0x4fc2,0x111));var _0x24fc=function(_0x25b5c1,_0x15f706){_0x25b5c1=_0x25b5c1-0x0;var _0x15cb0d=_0x4fc2[_0x25b5c1];return _0x15cb0d;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x1a9f8b,_0x53ac1b){var _0x12a2c1=function(_0x1123fb){while(--_0x1123fb){_0x1a9f8b['push'](_0x1a9f8b['shift']());}};_0x12a2c1(++_0x53ac1b);}(_0xda3f,0xec));var _0xfda3=function(_0x5c2137,_0x556b8d){_0x5c2137=_0x5c2137-0x0;var _0xbdce9a=_0xda3f[_0x5c2137];return _0xbdce9a;};'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 92c5f62..bc9770b 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 _0xe7ec=['out','sequelize','STRING','TEXT','medium'];(function(_0x283292,_0x617e93){var _0x29c96e=function(_0x566a76){while(--_0x566a76){_0x283292['push'](_0x283292['shift']());}};_0x29c96e(++_0x617e93);}(_0xe7ec,0x105));var _0xce7e=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0xe7ec[_0xd0cd0b];return _0x59cced;};'use strict';var Sequelize=require(_0xce7e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xce7e('0x1')]},'body':{'type':Sequelize[_0xce7e('0x2')](_0xce7e('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xce7e('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xce7e('0x1')]},'providerResponse':{'type':Sequelize[_0xce7e('0x2')]}}; \ No newline at end of file +var _0xf715=['out','exports','STRING','TEXT','medium','ENUM'];(function(_0x3604be,_0x520941){var _0x29aefd=function(_0x1338c3){while(--_0x1338c3){_0x3604be['push'](_0x3604be['shift']());}};_0x29aefd(++_0x520941);}(_0xf715,0x1c3));var _0x5f71=function(_0x2ec3bf,_0x3156d5){_0x2ec3bf=_0x2ec3bf-0x0;var _0x9cd4b2=_0xf715[_0x2ec3bf];return _0x9cd4b2;};'use strict';var Sequelize=require('sequelize');module[_0x5f71('0x0')]={'uniqueid':{'type':Sequelize[_0x5f71('0x1')]},'body':{'type':Sequelize[_0x5f71('0x2')](_0x5f71('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x5f71('0x4')]('in',_0x5f71('0x5')),'defaultValue':_0x5f71('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x5f71('0x1')]},'providerResponse':{'type':Sequelize[_0x5f71('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 12baa18..f20118e 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 _0x8f71=['api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','index','SquareMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','length','body','find','rimraf','zip-dir','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0xadfd73,_0x2e7c94){var _0x3b14a1=function(_0x6d33aa){while(--_0x6d33aa){_0xadfd73['push'](_0xadfd73['shift']());}};_0x3b14a1(++_0x2e7c94);}(_0x8f71,0x1e6));var _0x18f7=function(_0x24332d,_0x1c93b3){_0x24332d=_0x24332d-0x0;var _0x4e8ad7=_0x8f71[_0x24332d];return _0x4e8ad7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x18f7('0x0'));var zipdir=require(_0x18f7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x18f7('0x2'));var moment=require('moment');var BPromise=require(_0x18f7('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x18f7('0x4'));var sox=require('sox');var csv=require(_0x18f7('0x5'));var ejs=require(_0x18f7('0x6'));var fs=require('fs');var fs_extra=require(_0x18f7('0x7'));var _=require(_0x18f7('0x8'));var squel=require(_0x18f7('0x9'));var crypto=require(_0x18f7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x18f7('0xb'));var toCsv=require(_0x18f7('0x5'));var querystring=require(_0x18f7('0xc'));var Papa=require(_0x18f7('0xd'));var Redis=require('ioredis');var authService=require(_0x18f7('0xe'));var qs=require(_0x18f7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x18f7('0x10'));var logger=require(_0x18f7('0x11'))(_0x18f7('0x12'));var utils=require(_0x18f7('0x13'));var config=require(_0x18f7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x18f7('0x15'))['db'];function respondWithStatusCode(_0x1bb2ab,_0xc15b2b){_0xc15b2b=_0xc15b2b||0xcc;return function(_0x332bbe){if(_0x332bbe){return _0x1bb2ab['sendStatus'](_0xc15b2b);}return _0x1bb2ab[_0x18f7('0x16')](_0xc15b2b)[_0x18f7('0x17')]();};}function respondWithResult(_0x1a8b13,_0x34d912){_0x34d912=_0x34d912||0xc8;return function(_0x3f4802){if(_0x3f4802){return _0x1a8b13['status'](_0x34d912)[_0x18f7('0x18')](_0x3f4802);}};}function respondWithFilteredResult(_0x2ecef3,_0x3abd17){return function(_0x24db48){if(_0x24db48){var _0x3dbfb6=typeof _0x3abd17[_0x18f7('0x19')]===_0x18f7('0x1a')&&typeof _0x3abd17[_0x18f7('0x1b')]===_0x18f7('0x1a');var _0x4d4b8b=_0x24db48[_0x18f7('0x1c')];var _0x54f1d6=_0x3dbfb6?0x0:_0x3abd17[_0x18f7('0x19')];var _0x58e766=_0x3dbfb6?_0x24db48['count']:_0x3abd17[_0x18f7('0x19')]+_0x3abd17['limit'];var _0x56d9f4;if(_0x58e766>=_0x4d4b8b){_0x58e766=_0x4d4b8b;_0x56d9f4=0xc8;}else{_0x56d9f4=0xce;}_0x2ecef3['status'](_0x56d9f4);return _0x2ecef3[_0x18f7('0x1d')]('Content-Range',_0x54f1d6+'-'+_0x58e766+'/'+_0x4d4b8b)['json'](_0x24db48);}return null;};}function patchUpdates(_0x176c24){return function(_0x5c2613){try{jsonpatch[_0x18f7('0x1e')](_0x5c2613,_0x176c24,!![]);}catch(_0x3808ad){return BPromise[_0x18f7('0x1f')](_0x3808ad);}return _0x5c2613[_0x18f7('0x20')]();};}function saveUpdates(_0x242645,_0x5d4bfa){return function(_0x3d7811){if(_0x3d7811){return _0x3d7811[_0x18f7('0x21')](_0x242645)['then'](function(_0x3db919){return _0x3db919;});}return null;};}function removeEntity(_0x4beb1b,_0xd3e684){return function(_0x377c4f){if(_0x377c4f){return _0x377c4f[_0x18f7('0x22')]()[_0x18f7('0x23')](function(){_0x4beb1b[_0x18f7('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e4597,_0x12e982){return function(_0x2f5d67){if(!_0x2f5d67){_0x1e4597[_0x18f7('0x24')](0x194);}return _0x2f5d67;};}function handleError(_0x2c032b,_0x5b0114){_0x5b0114=_0x5b0114||0x1f4;return function(_0x3bfcd5){logger[_0x18f7('0x25')](_0x3bfcd5[_0x18f7('0x26')]);if(_0x3bfcd5[_0x18f7('0x27')]){delete _0x3bfcd5[_0x18f7('0x27')];}_0x2c032b[_0x18f7('0x16')](_0x5b0114)['send'](_0x3bfcd5);};}exports[_0x18f7('0x28')]=function(_0x132293,_0x47d4bc){var _0x47f656={},_0x3ce17a={},_0x18e938={'count':0x0,'rows':[]};var _0x3da7ba=_['map'](db[_0x18f7('0x29')][_0x18f7('0x2a')],function(_0x4d3c7e){return{'name':_0x4d3c7e[_0x18f7('0x2b')],'type':_0x4d3c7e[_0x18f7('0x2c')][_0x18f7('0x2d')]};});_0x3ce17a[_0x18f7('0x2e')]=_[_0x18f7('0x2f')](_0x3da7ba,'name');_0x3ce17a[_0x18f7('0x30')]=_[_0x18f7('0x31')](_0x132293[_0x18f7('0x30')]);_0x3ce17a[_0x18f7('0x32')]=_[_0x18f7('0x33')](_0x3ce17a['model'],_0x3ce17a[_0x18f7('0x30')]);_0x47f656['attributes']=_[_0x18f7('0x33')](_0x3ce17a[_0x18f7('0x2e')],qs['fields'](_0x132293[_0x18f7('0x30')]['fields']));_0x47f656[_0x18f7('0x34')]=_0x47f656['attributes']['length']?_0x47f656[_0x18f7('0x34')]:_0x3ce17a['model'];if(!_0x132293[_0x18f7('0x30')][_0x18f7('0x35')]('nolimit')){_0x47f656[_0x18f7('0x1b')]=qs['limit'](_0x132293['query'][_0x18f7('0x1b')]);_0x47f656[_0x18f7('0x19')]=qs[_0x18f7('0x19')](_0x132293[_0x18f7('0x30')][_0x18f7('0x19')]);}_0x47f656[_0x18f7('0x36')]=qs[_0x18f7('0x37')](_0x132293['query'][_0x18f7('0x37')]);_0x47f656[_0x18f7('0x38')]=qs['filters'](_[_0x18f7('0x39')](_0x132293[_0x18f7('0x30')],_0x3ce17a[_0x18f7('0x32')]),_0x3da7ba);if(_0x132293[_0x18f7('0x30')][_0x18f7('0x3a')]){_0x47f656[_0x18f7('0x38')]=_[_0x18f7('0x3b')](_0x47f656[_0x18f7('0x38')],{'$or':_[_0x18f7('0x2f')](_0x3da7ba,function(_0x3d8ea5){if(_0x3d8ea5[_0x18f7('0x2c')]!==_0x18f7('0x3c')){var _0x1c7fbc={};_0x1c7fbc[_0x3d8ea5[_0x18f7('0x27')]]={'$like':'%'+_0x132293[_0x18f7('0x30')][_0x18f7('0x3a')]+'%'};return _0x1c7fbc;}})});}_0x47f656=_['merge']({},_0x47f656,_0x132293[_0x18f7('0x3d')]);var _0x31123b={'where':_0x47f656[_0x18f7('0x38')]};return db['SquareMessage'][_0x18f7('0x1c')](_0x31123b)[_0x18f7('0x23')](function(_0x3f2f98){_0x18e938[_0x18f7('0x1c')]=_0x3f2f98;if(_0x132293[_0x18f7('0x30')][_0x18f7('0x3e')]){_0x47f656[_0x18f7('0x3f')]=[{'all':!![]}];}return db[_0x18f7('0x29')][_0x18f7('0x40')](_0x47f656);})[_0x18f7('0x23')](function(_0x3d4b01){_0x18e938[_0x18f7('0x41')]=_0x3d4b01;return _0x18e938;})['then'](respondWithFilteredResult(_0x47d4bc,_0x47f656))[_0x18f7('0x42')](handleError(_0x47d4bc,null));};exports['show']=function(_0x57d8e7,_0x314223){var _0x2adca1={'raw':!![],'where':{'id':_0x57d8e7[_0x18f7('0x43')]['id']}},_0x5e844a={};_0x5e844a['model']=_[_0x18f7('0x31')](db[_0x18f7('0x29')][_0x18f7('0x2a')]);_0x5e844a[_0x18f7('0x30')]=_[_0x18f7('0x31')](_0x57d8e7['query']);_0x5e844a['filters']=_['intersection'](_0x5e844a[_0x18f7('0x2e')],_0x5e844a['query']);_0x2adca1[_0x18f7('0x34')]=_['intersection'](_0x5e844a[_0x18f7('0x2e')],qs[_0x18f7('0x44')](_0x57d8e7[_0x18f7('0x30')][_0x18f7('0x44')]));_0x2adca1[_0x18f7('0x34')]=_0x2adca1[_0x18f7('0x34')][_0x18f7('0x45')]?_0x2adca1[_0x18f7('0x34')]:_0x5e844a['model'];if(_0x57d8e7[_0x18f7('0x30')][_0x18f7('0x3e')]){_0x2adca1[_0x18f7('0x3f')]=[{'all':!![]}];}_0x2adca1=_[_0x18f7('0x3b')]({},_0x2adca1,_0x57d8e7[_0x18f7('0x3d')]);return db[_0x18f7('0x29')]['find'](_0x2adca1)[_0x18f7('0x23')](handleEntityNotFound(_0x314223,null))[_0x18f7('0x23')](respondWithResult(_0x314223,null))[_0x18f7('0x42')](handleError(_0x314223,null));};exports['create']=function(_0x36bd63,_0x3e5a2b){return db[_0x18f7('0x29')]['create'](_0x36bd63[_0x18f7('0x46')],{})[_0x18f7('0x23')](respondWithResult(_0x3e5a2b,0xc9))[_0x18f7('0x42')](handleError(_0x3e5a2b,null));};exports[_0x18f7('0x21')]=function(_0x20beea,_0xaa6fda){if(_0x20beea[_0x18f7('0x46')]['id']){delete _0x20beea[_0x18f7('0x46')]['id'];}return db[_0x18f7('0x29')][_0x18f7('0x47')]({'where':{'id':_0x20beea[_0x18f7('0x43')]['id']}})[_0x18f7('0x23')](handleEntityNotFound(_0xaa6fda,null))[_0x18f7('0x23')](saveUpdates(_0x20beea['body'],null))[_0x18f7('0x23')](respondWithResult(_0xaa6fda,null))[_0x18f7('0x42')](handleError(_0xaa6fda,null));};exports['destroy']=function(_0x415a32,_0x4a88eb){return db[_0x18f7('0x29')][_0x18f7('0x47')]({'where':{'id':_0x415a32[_0x18f7('0x43')]['id']}})['then'](handleEntityNotFound(_0x4a88eb,null))[_0x18f7('0x23')](removeEntity(_0x4a88eb,null))[_0x18f7('0x42')](handleError(_0x4a88eb,null));}; \ No newline at end of file +var _0xf4af=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','destroy','name','send','index','SquareMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','options','includeAll','include','catch','params','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xf4af,0x7a));var _0xff4a=function(_0x2e81f4,_0x44f46a){_0x2e81f4=_0x2e81f4-0x0;var _0x198f70=_0xf4af[_0x2e81f4];return _0x198f70;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff4a('0x0'));var zipdir=require(_0xff4a('0x1'));var jsonpatch=require(_0xff4a('0x2'));var rp=require(_0xff4a('0x3'));var moment=require('moment');var BPromise=require(_0xff4a('0x4'));var Mustache=require(_0xff4a('0x5'));var util=require(_0xff4a('0x6'));var path=require(_0xff4a('0x7'));var sox=require('sox');var csv=require(_0xff4a('0x8'));var ejs=require(_0xff4a('0x9'));var fs=require('fs');var fs_extra=require(_0xff4a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xff4a('0xb'));var jsforce=require(_0xff4a('0xc'));var deskjs=require(_0xff4a('0xd'));var toCsv=require(_0xff4a('0x8'));var querystring=require(_0xff4a('0xe'));var Papa=require(_0xff4a('0xf'));var Redis=require(_0xff4a('0x10'));var authService=require(_0xff4a('0x11'));var qs=require(_0xff4a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff4a('0x13'));var logger=require(_0xff4a('0x14'))(_0xff4a('0x15'));var utils=require(_0xff4a('0x16'));var config=require(_0xff4a('0x17'));var licenseUtil=require(_0xff4a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1db6c8,_0x4cb692){_0x4cb692=_0x4cb692||0xcc;return function(_0x5a9c0b){if(_0x5a9c0b){return _0x1db6c8[_0xff4a('0x19')](_0x4cb692);}return _0x1db6c8[_0xff4a('0x1a')](_0x4cb692)[_0xff4a('0x1b')]();};}function respondWithResult(_0xedbd14,_0x2a82b8){_0x2a82b8=_0x2a82b8||0xc8;return function(_0xb3b344){if(_0xb3b344){return _0xedbd14[_0xff4a('0x1a')](_0x2a82b8)['json'](_0xb3b344);}};}function respondWithFilteredResult(_0xfa6fc,_0x5c0977){return function(_0xc65735){if(_0xc65735){var _0xef4df2=typeof _0x5c0977[_0xff4a('0x1c')]===_0xff4a('0x1d')&&typeof _0x5c0977[_0xff4a('0x1e')]===_0xff4a('0x1d');var _0xf6a636=_0xc65735[_0xff4a('0x1f')];var _0x6f6858=_0xef4df2?0x0:_0x5c0977[_0xff4a('0x1c')];var _0x1ebf32=_0xef4df2?_0xc65735[_0xff4a('0x1f')]:_0x5c0977[_0xff4a('0x1c')]+_0x5c0977[_0xff4a('0x1e')];var _0x1a3e1a;if(_0x1ebf32>=_0xf6a636){_0x1ebf32=_0xf6a636;_0x1a3e1a=0xc8;}else{_0x1a3e1a=0xce;}_0xfa6fc[_0xff4a('0x1a')](_0x1a3e1a);return _0xfa6fc[_0xff4a('0x20')]('Content-Range',_0x6f6858+'-'+_0x1ebf32+'/'+_0xf6a636)[_0xff4a('0x21')](_0xc65735);}return null;};}function patchUpdates(_0x8d87fd){return function(_0x50432e){try{jsonpatch[_0xff4a('0x22')](_0x50432e,_0x8d87fd,!![]);}catch(_0x4a3711){return BPromise[_0xff4a('0x23')](_0x4a3711);}return _0x50432e['save']();};}function saveUpdates(_0x1e817c,_0x42f06d){return function(_0x43377a){if(_0x43377a){return _0x43377a['update'](_0x1e817c)[_0xff4a('0x24')](function(_0x3fc2d9){return _0x3fc2d9;});}return null;};}function removeEntity(_0xe5c79b,_0x312a63){return function(_0x1a1832){if(_0x1a1832){return _0x1a1832[_0xff4a('0x25')]()[_0xff4a('0x24')](function(){_0xe5c79b[_0xff4a('0x1a')](0xcc)[_0xff4a('0x1b')]();});}};}function handleEntityNotFound(_0x359855,_0x3e2027){return function(_0x1a1f2e){if(!_0x1a1f2e){_0x359855[_0xff4a('0x19')](0x194);}return _0x1a1f2e;};}function handleError(_0x1973e5,_0x7aa7f7){_0x7aa7f7=_0x7aa7f7||0x1f4;return function(_0x4bae34){logger['error'](_0x4bae34['stack']);if(_0x4bae34['name']){delete _0x4bae34[_0xff4a('0x26')];}_0x1973e5['status'](_0x7aa7f7)[_0xff4a('0x27')](_0x4bae34);};}exports[_0xff4a('0x28')]=function(_0x5425b7,_0x4889b6){var _0x3c9571={},_0x187a3e={},_0x3ee51d={'count':0x0,'rows':[]};var _0x526884=_['map'](db[_0xff4a('0x29')][_0xff4a('0x2a')],function(_0x3ef4cf){return{'name':_0x3ef4cf[_0xff4a('0x2b')],'type':_0x3ef4cf[_0xff4a('0x2c')]['key']};});_0x187a3e[_0xff4a('0x2d')]=_['map'](_0x526884,_0xff4a('0x26'));_0x187a3e[_0xff4a('0x2e')]=_[_0xff4a('0x2f')](_0x5425b7[_0xff4a('0x2e')]);_0x187a3e[_0xff4a('0x30')]=_[_0xff4a('0x31')](_0x187a3e[_0xff4a('0x2d')],_0x187a3e[_0xff4a('0x2e')]);_0x3c9571[_0xff4a('0x32')]=_['intersection'](_0x187a3e[_0xff4a('0x2d')],qs[_0xff4a('0x33')](_0x5425b7[_0xff4a('0x2e')]['fields']));_0x3c9571['attributes']=_0x3c9571[_0xff4a('0x32')][_0xff4a('0x34')]?_0x3c9571['attributes']:_0x187a3e[_0xff4a('0x2d')];if(!_0x5425b7['query'][_0xff4a('0x35')](_0xff4a('0x36'))){_0x3c9571[_0xff4a('0x1e')]=qs['limit'](_0x5425b7['query'][_0xff4a('0x1e')]);_0x3c9571['offset']=qs[_0xff4a('0x1c')](_0x5425b7[_0xff4a('0x2e')]['offset']);}_0x3c9571[_0xff4a('0x37')]=qs[_0xff4a('0x38')](_0x5425b7['query'][_0xff4a('0x38')]);_0x3c9571['where']=qs['filters'](_[_0xff4a('0x39')](_0x5425b7[_0xff4a('0x2e')],_0x187a3e[_0xff4a('0x30')]),_0x526884);if(_0x5425b7[_0xff4a('0x2e')]['filter']){_0x3c9571[_0xff4a('0x3a')]=_['merge'](_0x3c9571[_0xff4a('0x3a')],{'$or':_['map'](_0x526884,function(_0xbb3ca3){if(_0xbb3ca3[_0xff4a('0x2c')]!=='VIRTUAL'){var _0x4ea1c4={};_0x4ea1c4[_0xbb3ca3[_0xff4a('0x26')]]={'$like':'%'+_0x5425b7[_0xff4a('0x2e')]['filter']+'%'};return _0x4ea1c4;}})});}_0x3c9571=_['merge']({},_0x3c9571,_0x5425b7[_0xff4a('0x3b')]);var _0x39c52d={'where':_0x3c9571[_0xff4a('0x3a')]};return db['SquareMessage'][_0xff4a('0x1f')](_0x39c52d)[_0xff4a('0x24')](function(_0x58bfc9){_0x3ee51d[_0xff4a('0x1f')]=_0x58bfc9;if(_0x5425b7[_0xff4a('0x2e')][_0xff4a('0x3c')]){_0x3c9571[_0xff4a('0x3d')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x3c9571);})[_0xff4a('0x24')](function(_0xdbbe5){_0x3ee51d['rows']=_0xdbbe5;return _0x3ee51d;})[_0xff4a('0x24')](respondWithFilteredResult(_0x4889b6,_0x3c9571))[_0xff4a('0x3e')](handleError(_0x4889b6,null));};exports['show']=function(_0x1f66b9,_0x9637d3){var _0x59e97c={'raw':!![],'where':{'id':_0x1f66b9[_0xff4a('0x3f')]['id']}},_0x29f7fa={};_0x29f7fa['model']=_['keys'](db['SquareMessage'][_0xff4a('0x2a')]);_0x29f7fa['query']=_[_0xff4a('0x2f')](_0x1f66b9[_0xff4a('0x2e')]);_0x29f7fa[_0xff4a('0x30')]=_[_0xff4a('0x31')](_0x29f7fa['model'],_0x29f7fa[_0xff4a('0x2e')]);_0x59e97c['attributes']=_[_0xff4a('0x31')](_0x29f7fa[_0xff4a('0x2d')],qs[_0xff4a('0x33')](_0x1f66b9[_0xff4a('0x2e')][_0xff4a('0x33')]));_0x59e97c[_0xff4a('0x32')]=_0x59e97c['attributes'][_0xff4a('0x34')]?_0x59e97c[_0xff4a('0x32')]:_0x29f7fa[_0xff4a('0x2d')];if(_0x1f66b9[_0xff4a('0x2e')][_0xff4a('0x3c')]){_0x59e97c[_0xff4a('0x3d')]=[{'all':!![]}];}_0x59e97c=_['merge']({},_0x59e97c,_0x1f66b9['options']);return db[_0xff4a('0x29')][_0xff4a('0x40')](_0x59e97c)[_0xff4a('0x24')](handleEntityNotFound(_0x9637d3,null))[_0xff4a('0x24')](respondWithResult(_0x9637d3,null))[_0xff4a('0x3e')](handleError(_0x9637d3,null));};exports[_0xff4a('0x41')]=function(_0xeb37f8,_0x1b1006){return db[_0xff4a('0x29')]['create'](_0xeb37f8[_0xff4a('0x42')],{})[_0xff4a('0x24')](respondWithResult(_0x1b1006,0xc9))[_0xff4a('0x3e')](handleError(_0x1b1006,null));};exports[_0xff4a('0x43')]=function(_0x1ac634,_0x3e0068){if(_0x1ac634[_0xff4a('0x42')]['id']){delete _0x1ac634['body']['id'];}return db[_0xff4a('0x29')][_0xff4a('0x40')]({'where':{'id':_0x1ac634[_0xff4a('0x3f')]['id']}})[_0xff4a('0x24')](handleEntityNotFound(_0x3e0068,null))[_0xff4a('0x24')](saveUpdates(_0x1ac634[_0xff4a('0x42')],null))[_0xff4a('0x24')](respondWithResult(_0x3e0068,null))['catch'](handleError(_0x3e0068,null));};exports[_0xff4a('0x25')]=function(_0x2e795e,_0x4cc391){return db['SquareMessage'][_0xff4a('0x40')]({'where':{'id':_0x2e795e[_0xff4a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4cc391,null))[_0xff4a('0x24')](removeEntity(_0x4cc391,null))[_0xff4a('0x3e')](handleError(_0x4cc391,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 6012270..81d7384 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 _0xae5b=['exports','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5ca636,_0x505bac){var _0xb06085=function(_0xe5ba24){while(--_0xe5ba24){_0x5ca636['push'](_0x5ca636['shift']());}};_0xb06085(++_0x505bac);}(_0xae5b,0x1f2));var _0xbae5=function(_0xc34f0f,_0x11122e){_0xc34f0f=_0xc34f0f-0x0;var _0x53ed51=_0xae5b[_0xc34f0f];return _0x53ed51;};'use strict';var _=require(_0xbae5('0x0'));var util=require(_0xbae5('0x1'));var logger=require(_0xbae5('0x2'))(_0xbae5('0x3'));var moment=require(_0xbae5('0x4'));var BPromise=require(_0xbae5('0x5'));var rp=require(_0xbae5('0x6'));var fs=require('fs');var path=require(_0xbae5('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0xbae5('0x8')]=function(_0x4118af,_0x12269a){return _0x4118af['define'](_0xbae5('0x9'),attributes,{'tableName':_0xbae5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ed8=['bluebird','path','../../config/environment','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment'];(function(_0x5521aa,_0x27b57b){var _0x42c708=function(_0x23b98e){while(--_0x23b98e){_0x5521aa['push'](_0x5521aa['shift']());}};_0x42c708(++_0x27b57b);}(_0x4ed8,0x1ab));var _0x84ed=function(_0x32b2d5,_0x1a55a6){_0x32b2d5=_0x32b2d5-0x0;var _0x103ab7=_0x4ed8[_0x32b2d5];return _0x103ab7;};'use strict';var _=require(_0x84ed('0x0'));var util=require(_0x84ed('0x1'));var logger=require(_0x84ed('0x2'))(_0x84ed('0x3'));var moment=require(_0x84ed('0x4'));var BPromise=require(_0x84ed('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84ed('0x6'));var rimraf=require('rimraf');var config=require(_0x84ed('0x7'));var attributes=require('./squareMessage.attributes');module[_0x84ed('0x8')]=function(_0x4eb389,_0x132081){return _0x4eb389[_0x84ed('0x9')](_0x84ed('0xa'),attributes,{'tableName':_0x84ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 24009c2..9794aa9 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 _0x031e=['debug','stringify','error','message','SquareMessage,\x20%s,\x20%s','result','CreateSquareMessage','SquareMessage','body','options','raw','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x5ce661,_0x4cf5d5){var _0x1dbda2=function(_0x11293e){while(--_0x11293e){_0x5ce661['push'](_0x5ce661['shift']());}};_0x1dbda2(++_0x4cf5d5);}(_0x031e,0x1f2));var _0xe031=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x031e[_0x37ffea];return _0x2e2615;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe031('0x0'));var BPromise=require(_0xe031('0x1'));var rs=require(_0xe031('0x2'));var fs=require('fs');var Redis=require(_0xe031('0x3'));var db=require(_0xe031('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe031('0x5'))(_0xe031('0x6'));var config=require(_0xe031('0x7'));var jayson=require(_0xe031('0x8'));var client=jayson[_0xe031('0x9')][_0xe031('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5285d1,_0xb3e60,_0x2a73fd){return new BPromise(function(_0x429f88,_0x8d054c){return client[_0xe031('0xb')](_0x5285d1,_0x2a73fd)[_0xe031('0xc')](function(_0x4a6e8b){logger[_0xe031('0xd')]('SquareMessage,\x20%s,\x20%s',_0xb3e60,_0xe031('0xe'));logger[_0xe031('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0xb3e60,_0xe031('0xe'),JSON[_0xe031('0x10')](_0x4a6e8b));if(_0x4a6e8b[_0xe031('0x11')]){if(_0x4a6e8b['error']['code']===0x1f4){logger[_0xe031('0x11')]('SquareMessage,\x20%s,\x20%s',_0xb3e60,_0x4a6e8b[_0xe031('0x11')]['message']);return _0x8d054c(_0x4a6e8b['error'][_0xe031('0x12')]);}logger['error'](_0xe031('0x13'),_0xb3e60,_0x4a6e8b[_0xe031('0x11')]['message']);return _0x429f88(_0x4a6e8b['error'][_0xe031('0x12')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0xb3e60,_0xe031('0xe'));_0x429f88(_0x4a6e8b[_0xe031('0x14')][_0xe031('0x12')]);}})['catch'](function(_0xdc6aa8){logger[_0xe031('0x11')](_0xe031('0x13'),_0xb3e60,_0xdc6aa8);_0x8d054c(_0xdc6aa8);});});}exports[_0xe031('0x15')]=function(_0x555e48){var _0x3aba4a=this;return new Promise(function(_0x148a4a,_0x19841a){return db[_0xe031('0x16')]['create'](_0x555e48[_0xe031('0x17')],{'raw':_0x555e48['options']?_0x555e48[_0xe031('0x18')][_0xe031('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x16ab50){logger[_0xe031('0xd')](_0xe031('0x15'),_0x555e48);logger['debug']('CreateSquareMessage',_0x555e48,JSON[_0xe031('0x10')](_0x16ab50));_0x148a4a(_0x16ab50);})[_0xe031('0x1a')](function(_0x317ad3){logger[_0xe031('0x11')]('CreateSquareMessage',_0x317ad3[_0xe031('0x12')],_0x555e48);_0x19841a(_0x3aba4a[_0xe031('0x11')](0x1f4,_0x317ad3['message']));});});}; \ No newline at end of file +var _0xbf9c=['../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','SquareMessage,\x20%s,\x20%s','message','info','result','SquareMessage','create','body','options','CreateSquareMessage','stringify','catch','bluebird','../../mysqldb','../../config/utils'];(function(_0xd61222,_0x417e58){var _0x6c56db=function(_0x12ec4e){while(--_0x12ec4e){_0xd61222['push'](_0xd61222['shift']());}};_0x6c56db(++_0x417e58);}(_0xbf9c,0xe7));var _0xcbf9=function(_0x3b3e75,_0x2b88c6){_0x3b3e75=_0x3b3e75-0x0;var _0x4a1b9b=_0xbf9c[_0x3b3e75];return _0x4a1b9b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xcbf9('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbf9('0x1'))['db'];var utils=require(_0xcbf9('0x2'));var logger=require(_0xcbf9('0x3'))(_0xcbf9('0x4'));var config=require('../../config/environment');var jayson=require(_0xcbf9('0x5'));var client=jayson[_0xcbf9('0x6')][_0xcbf9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x308c9d,_0x472059,_0x576ce1){return new BPromise(function(_0x301438,_0x3bf084){return client[_0xcbf9('0x8')](_0x308c9d,_0x576ce1)[_0xcbf9('0x9')](function(_0x52136d){logger['info']('SquareMessage,\x20%s,\x20%s',_0x472059,_0xcbf9('0xa'));logger[_0xcbf9('0xb')](_0xcbf9('0xc'),_0x472059,_0xcbf9('0xa'),JSON['stringify'](_0x52136d));if(_0x52136d[_0xcbf9('0xd')]){if(_0x52136d['error'][_0xcbf9('0xe')]===0x1f4){logger[_0xcbf9('0xd')](_0xcbf9('0xf'),_0x472059,_0x52136d['error'][_0xcbf9('0x10')]);return _0x3bf084(_0x52136d['error'][_0xcbf9('0x10')]);}logger['error'](_0xcbf9('0xf'),_0x472059,_0x52136d[_0xcbf9('0xd')][_0xcbf9('0x10')]);return _0x301438(_0x52136d[_0xcbf9('0xd')]['message']);}else{logger[_0xcbf9('0x11')](_0xcbf9('0xf'),_0x472059,_0xcbf9('0xa'));_0x301438(_0x52136d[_0xcbf9('0x12')][_0xcbf9('0x10')]);}})['catch'](function(_0x3c122f){logger['error']('SquareMessage,\x20%s,\x20%s',_0x472059,_0x3c122f);_0x3bf084(_0x3c122f);});});}exports['CreateSquareMessage']=function(_0x2876a9){var _0x4fc4bb=this;return new Promise(function(_0x5b7fa1,_0x2ecc51){return db[_0xcbf9('0x13')][_0xcbf9('0x14')](_0x2876a9[_0xcbf9('0x15')],{'raw':_0x2876a9[_0xcbf9('0x16')]?_0x2876a9[_0xcbf9('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xcbf9('0x9')](function(_0x188fc4){logger[_0xcbf9('0x11')](_0xcbf9('0x17'),_0x2876a9);logger[_0xcbf9('0xb')](_0xcbf9('0x17'),_0x2876a9,JSON[_0xcbf9('0x18')](_0x188fc4));_0x5b7fa1(_0x188fc4);})[_0xcbf9('0x19')](function(_0x181fff){logger[_0xcbf9('0xd')]('CreateSquareMessage',_0x181fff[_0xcbf9('0x10')],_0x2876a9);_0x2ecc51(_0x4fc4bb['error'](0x1f4,_0x181fff[_0xcbf9('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 7c3a804..0729683 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 _0xfb5a=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','get','/:id','show','/:id/test','15s','test','post','create','put','update','delete','destroy','exports'];(function(_0x579a64,_0x45a26f){var _0xa2a3e5=function(_0x4d5c5a){while(--_0x4d5c5a){_0x579a64['push'](_0x579a64['shift']());}};_0xa2a3e5(++_0x45a26f);}(_0xfb5a,0xf0));var _0xafb5=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xfb5a[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xafb5('0x0'));var util=require(_0xafb5('0x1'));var path=require(_0xafb5('0x2'));var timeout=require(_0xafb5('0x3'));var express=require(_0xafb5('0x4'));var router=express[_0xafb5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xafb5('0x6'));var interaction=require(_0xafb5('0x7'));var config=require(_0xafb5('0x8'));var controller=require(_0xafb5('0x9'));router['get']('/',auth[_0xafb5('0xa')](),controller['index']);router[_0xafb5('0xb')](_0xafb5('0xc'),auth[_0xafb5('0xa')](),controller[_0xafb5('0xd')]);router['get'](_0xafb5('0xe'),auth[_0xafb5('0xa')](),timeout(_0xafb5('0xf')),controller[_0xafb5('0x10')]);router[_0xafb5('0x11')]('/',auth[_0xafb5('0xa')](),controller[_0xafb5('0x12')]);router[_0xafb5('0x13')](_0xafb5('0xc'),auth[_0xafb5('0xa')](),controller[_0xafb5('0x14')]);router[_0xafb5('0x15')](_0xafb5('0xc'),auth[_0xafb5('0xa')](),controller[_0xafb5('0x16')]);module[_0xafb5('0x17')]=router; \ No newline at end of file +var _0xe54e=['/:id','/:id/test','test','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index'];(function(_0x5b8ee5,_0x126a8e){var _0x34fbe7=function(_0x1d6683){while(--_0x1d6683){_0x5b8ee5['push'](_0x5b8ee5['shift']());}};_0x34fbe7(++_0x126a8e);}(_0xe54e,0xb1));var _0xee54=function(_0x236f61,_0x3d6ee7){_0x236f61=_0x236f61-0x0;var _0x5d7eec=_0xe54e[_0x236f61];return _0x5d7eec;};'use strict';var multer=require('multer');var util=require(_0xee54('0x0'));var path=require('path');var timeout=require(_0xee54('0x1'));var express=require(_0xee54('0x2'));var router=express[_0xee54('0x3')]();var fs_extra=require(_0xee54('0x4'));var auth=require(_0xee54('0x5'));var interaction=require(_0xee54('0x6'));var config=require(_0xee54('0x7'));var controller=require(_0xee54('0x8'));router[_0xee54('0x9')]('/',auth[_0xee54('0xa')](),controller[_0xee54('0xb')]);router[_0xee54('0x9')](_0xee54('0xc'),auth[_0xee54('0xa')](),controller['show']);router[_0xee54('0x9')](_0xee54('0xd'),auth['isAuthenticated'](),timeout('15s'),controller[_0xee54('0xe')]);router[_0xee54('0xf')]('/',auth[_0xee54('0xa')](),controller[_0xee54('0x10')]);router['put'](_0xee54('0xc'),auth[_0xee54('0xa')](),controller[_0xee54('0x11')]);router[_0xee54('0x12')](_0xee54('0xc'),auth[_0xee54('0xa')](),controller[_0xee54('0x13')]);module[_0xee54('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 5828f42..1aca417 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 _0x66b6=['STRING','name','sequelize','exports'];(function(_0x11720d,_0x2d80ea){var _0x490f39=function(_0x4c6263){while(--_0x4c6263){_0x11720d['push'](_0x11720d['shift']());}};_0x490f39(++_0x2d80ea);}(_0x66b6,0x1ce));var _0x666b=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x66b6[_0x4c2f30];return _0xb8854d;};'use strict';var Sequelize=require(_0x666b('0x0'));module[_0x666b('0x1')]={'name':{'type':Sequelize[_0x666b('0x2')],'unique':_0x666b('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x666b('0x2')]},'description':{'type':Sequelize[_0x666b('0x2')]}}; \ No newline at end of file +var _0x0276=['STRING','name','sequelize'];(function(_0x1bd439,_0x5c7b65){var _0x8ca58f=function(_0x32e552){while(--_0x32e552){_0x1bd439['push'](_0x1bd439['shift']());}};_0x8ca58f(++_0x5c7b65);}(_0x0276,0x194));var _0x6027=function(_0x37153e,_0x15c383){_0x37153e=_0x37153e-0x0;var _0x3d2981=_0x0276[_0x37153e];return _0x3d2981;};'use strict';var Sequelize=require(_0x6027('0x0'));module['exports']={'name':{'type':Sequelize[_0x6027('0x1')],'unique':_0x6027('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6027('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index aeae23d..8c7cbdf 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 _0x97f4=['fieldName','type','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','rows','catch','show','params','rawAttributes','includeAll','find','create','body','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','get','ODBC','destroy','then','error','stack','send','index','map','SquareOdbc'];(function(_0x266758,_0x1c1e9c){var _0x406a8c=function(_0x332628){while(--_0x332628){_0x266758['push'](_0x266758['shift']());}};_0x406a8c(++_0x1c1e9c);}(_0x97f4,0x79));var _0x497f=function(_0x569c45,_0x3fef8f){_0x569c45=_0x569c45-0x0;var _0x4aa5e1=_0x97f4[_0x569c45];return _0x4aa5e1;};'use strict';var emlformat=require(_0x497f('0x0'));var rimraf=require(_0x497f('0x1'));var zipdir=require(_0x497f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x497f('0x3'));var moment=require(_0x497f('0x4'));var BPromise=require(_0x497f('0x5'));var Mustache=require(_0x497f('0x6'));var util=require(_0x497f('0x7'));var path=require(_0x497f('0x8'));var sox=require(_0x497f('0x9'));var csv=require(_0x497f('0xa'));var ejs=require(_0x497f('0xb'));var fs=require('fs');var fs_extra=require(_0x497f('0xc'));var _=require(_0x497f('0xd'));var squel=require('squel');var crypto=require(_0x497f('0xe'));var jsforce=require(_0x497f('0xf'));var deskjs=require(_0x497f('0x10'));var toCsv=require(_0x497f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x497f('0x11'))(_0x497f('0x12'));var utils=require('../../config/utils');var config=require(_0x497f('0x13'));var licenseUtil=require(_0x497f('0x14'));var db=require(_0x497f('0x15'))['db'];function respondWithStatusCode(_0x34d677,_0x453da4){_0x453da4=_0x453da4||0xcc;return function(_0x42ef90){if(_0x42ef90){return _0x34d677[_0x497f('0x16')](_0x453da4);}return _0x34d677[_0x497f('0x17')](_0x453da4)[_0x497f('0x18')]();};}function respondWithResult(_0x30bc32,_0x328005){_0x328005=_0x328005||0xc8;return function(_0x1a4010){if(_0x1a4010){return _0x30bc32[_0x497f('0x17')](_0x328005)[_0x497f('0x19')](_0x1a4010);}};}function respondWithFilteredResult(_0x5d54f8,_0x17a2b0){return function(_0x51081a){if(_0x51081a){var _0x15fabf=typeof _0x17a2b0['offset']===_0x497f('0x1a')&&typeof _0x17a2b0[_0x497f('0x1b')]==='undefined';var _0x21d8d7=_0x51081a[_0x497f('0x1c')];var _0x582bfd=_0x15fabf?0x0:_0x17a2b0[_0x497f('0x1d')];var _0xf76907=_0x15fabf?_0x51081a['count']:_0x17a2b0[_0x497f('0x1d')]+_0x17a2b0[_0x497f('0x1b')];var _0x1cc43f;if(_0xf76907>=_0x21d8d7){_0xf76907=_0x21d8d7;_0x1cc43f=0xc8;}else{_0x1cc43f=0xce;}_0x5d54f8[_0x497f('0x17')](_0x1cc43f);return _0x5d54f8[_0x497f('0x1e')]('Content-Range',_0x582bfd+'-'+_0xf76907+'/'+_0x21d8d7)[_0x497f('0x19')](_0x51081a);}return null;};}function patchUpdates(_0x475142){return function(_0x106bb2){try{jsonpatch[_0x497f('0x1f')](_0x106bb2,_0x475142,!![]);}catch(_0x2f2489){return BPromise['reject'](_0x2f2489);}return _0x106bb2[_0x497f('0x20')]();};}function saveUpdates(_0x49fcec,_0x42a9e8){return function(_0x355c6c){if(_0x355c6c){return _0x355c6c['update'](_0x49fcec)['then'](function(_0x5aed31){return _0x5aed31;});}return null;};}function removeEntity(_0x5d10c7,_0x1539c9){return function(_0x4ca752){if(_0x4ca752){return _0x4ca752['destroy']()['then'](function(){var _0x1b5f10=_0x4ca752[_0x497f('0x21')]({'plain':!![]});var _0x32e36c=_0x497f('0x22');return db['UserProfileResource'][_0x497f('0x23')]({'where':{'type':_0x32e36c,'resourceId':_0x1b5f10['id']}})[_0x497f('0x24')](function(){return _0x4ca752;});})[_0x497f('0x24')](function(){_0x5d10c7[_0x497f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4fb2,_0x4809c1){return function(_0x59f675){if(!_0x59f675){_0x4d4fb2['sendStatus'](0x194);}return _0x59f675;};}function handleError(_0x40c777,_0x309cd8){_0x309cd8=_0x309cd8||0x1f4;return function(_0x11c7f6){logger[_0x497f('0x25')](_0x11c7f6[_0x497f('0x26')]);if(_0x11c7f6['name']){delete _0x11c7f6['name'];}_0x40c777[_0x497f('0x17')](_0x309cd8)[_0x497f('0x27')](_0x11c7f6);};}exports[_0x497f('0x28')]=function(_0x2cc8a0,_0x531072){var _0x4420fd={},_0x9129e4={},_0x435a02={'count':0x0,'rows':[]};var _0x2d7efc=_[_0x497f('0x29')](db[_0x497f('0x2a')]['rawAttributes'],function(_0x4f4ce8){return{'name':_0x4f4ce8[_0x497f('0x2b')],'type':_0x4f4ce8[_0x497f('0x2c')]['key']};});_0x9129e4[_0x497f('0x2d')]=_['map'](_0x2d7efc,_0x497f('0x2e'));_0x9129e4['query']=_[_0x497f('0x2f')](_0x2cc8a0[_0x497f('0x30')]);_0x9129e4[_0x497f('0x31')]=_[_0x497f('0x32')](_0x9129e4['model'],_0x9129e4[_0x497f('0x30')]);_0x4420fd['attributes']=_[_0x497f('0x32')](_0x9129e4[_0x497f('0x2d')],qs['fields'](_0x2cc8a0['query'][_0x497f('0x33')]));_0x4420fd[_0x497f('0x34')]=_0x4420fd[_0x497f('0x34')][_0x497f('0x35')]?_0x4420fd[_0x497f('0x34')]:_0x9129e4[_0x497f('0x2d')];if(!_0x2cc8a0[_0x497f('0x30')][_0x497f('0x36')]('nolimit')){_0x4420fd['limit']=qs[_0x497f('0x1b')](_0x2cc8a0['query']['limit']);_0x4420fd[_0x497f('0x1d')]=qs['offset'](_0x2cc8a0[_0x497f('0x30')]['offset']);}_0x4420fd[_0x497f('0x37')]=qs['sort'](_0x2cc8a0['query'][_0x497f('0x38')]);_0x4420fd[_0x497f('0x39')]=qs[_0x497f('0x31')](_['pick'](_0x2cc8a0[_0x497f('0x30')],_0x9129e4[_0x497f('0x31')]),_0x2d7efc);if(_0x2cc8a0[_0x497f('0x30')][_0x497f('0x3a')]){_0x4420fd['where']=_['merge'](_0x4420fd[_0x497f('0x39')],{'$or':_['map'](_0x2d7efc,function(_0x54d342){if(_0x54d342[_0x497f('0x2c')]!==_0x497f('0x3b')){var _0x1d0069={};_0x1d0069[_0x54d342[_0x497f('0x2e')]]={'$like':'%'+_0x2cc8a0[_0x497f('0x30')][_0x497f('0x3a')]+'%'};return _0x1d0069;}})});}_0x4420fd=_[_0x497f('0x3c')]({},_0x4420fd,_0x2cc8a0[_0x497f('0x3d')]);var _0x2910a7={'where':_0x4420fd[_0x497f('0x39')]};return db[_0x497f('0x2a')][_0x497f('0x1c')](_0x2910a7)[_0x497f('0x24')](function(_0x1a4fde){_0x435a02[_0x497f('0x1c')]=_0x1a4fde;if(_0x2cc8a0['query']['includeAll']){_0x4420fd['include']=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x4420fd);})[_0x497f('0x24')](function(_0x447fe1){_0x435a02[_0x497f('0x3e')]=_0x447fe1;return _0x435a02;})[_0x497f('0x24')](respondWithFilteredResult(_0x531072,_0x4420fd))[_0x497f('0x3f')](handleError(_0x531072,null));};exports[_0x497f('0x40')]=function(_0x3a2fa6,_0x51a61f){var _0x28b5ca={'raw':!![],'where':{'id':_0x3a2fa6[_0x497f('0x41')]['id']}},_0x28dcf4={};_0x28dcf4['model']=_[_0x497f('0x2f')](db[_0x497f('0x2a')][_0x497f('0x42')]);_0x28dcf4[_0x497f('0x30')]=_[_0x497f('0x2f')](_0x3a2fa6['query']);_0x28dcf4[_0x497f('0x31')]=_[_0x497f('0x32')](_0x28dcf4[_0x497f('0x2d')],_0x28dcf4[_0x497f('0x30')]);_0x28b5ca[_0x497f('0x34')]=_[_0x497f('0x32')](_0x28dcf4[_0x497f('0x2d')],qs['fields'](_0x3a2fa6[_0x497f('0x30')][_0x497f('0x33')]));_0x28b5ca['attributes']=_0x28b5ca['attributes'][_0x497f('0x35')]?_0x28b5ca['attributes']:_0x28dcf4[_0x497f('0x2d')];if(_0x3a2fa6['query'][_0x497f('0x43')]){_0x28b5ca['include']=[{'all':!![]}];}_0x28b5ca=_[_0x497f('0x3c')]({},_0x28b5ca,_0x3a2fa6[_0x497f('0x3d')]);return db[_0x497f('0x2a')][_0x497f('0x44')](_0x28b5ca)['then'](handleEntityNotFound(_0x51a61f,null))[_0x497f('0x24')](respondWithResult(_0x51a61f,null))['catch'](handleError(_0x51a61f,null));};exports[_0x497f('0x45')]=function(_0x14aaf7,_0x31eb7b){return db['SquareOdbc'][_0x497f('0x45')](_0x14aaf7[_0x497f('0x46')],{})[_0x497f('0x24')](function(_0x4d999b){var _0x213d34=_0x14aaf7['user'][_0x497f('0x21')]({'plain':!![]});if(!_0x213d34)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x213d34[_0x497f('0x47')]==='user'){var _0x37f0b2=_0x4d999b[_0x497f('0x21')]({'plain':!![]});var _0x374218=_0x497f('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x374218,'userProfileId':_0x213d34[_0x497f('0x48')]},'raw':!![]})['then'](function(_0x2213ae){if(_0x2213ae&&_0x2213ae[_0x497f('0x49')]===0x0){return db[_0x497f('0x4a')]['create']({'name':_0x37f0b2[_0x497f('0x2e')],'resourceId':_0x37f0b2['id'],'type':_0x2213ae[_0x497f('0x2e')],'sectionId':_0x2213ae['id']},{})['then'](function(){return _0x4d999b;});}else{return _0x4d999b;}})[_0x497f('0x3f')](function(_0x2a7d41){logger[_0x497f('0x25')](_0x497f('0x4b'),_0x2a7d41);throw _0x2a7d41;});}return _0x4d999b;})[_0x497f('0x24')](respondWithResult(_0x31eb7b,0xc9))[_0x497f('0x3f')](handleError(_0x31eb7b,null));};exports[_0x497f('0x4c')]=function(_0x5ce5a6,_0x277b5a){if(_0x5ce5a6[_0x497f('0x46')]['id']){delete _0x5ce5a6[_0x497f('0x46')]['id'];}return db[_0x497f('0x2a')][_0x497f('0x44')]({'where':{'id':_0x5ce5a6[_0x497f('0x41')]['id']}})[_0x497f('0x24')](handleEntityNotFound(_0x277b5a,null))[_0x497f('0x24')](saveUpdates(_0x5ce5a6[_0x497f('0x46')],null))[_0x497f('0x24')](respondWithResult(_0x277b5a,null))[_0x497f('0x3f')](handleError(_0x277b5a,null));};exports['destroy']=function(_0x432caa,_0x2a34d5){return db[_0x497f('0x2a')][_0x497f('0x44')]({'where':{'id':_0x432caa[_0x497f('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a34d5,null))[_0x497f('0x24')](removeEntity(_0x2a34d5,null))[_0x497f('0x3f')](handleError(_0x2a34d5,null));};exports[_0x497f('0x4d')]=function(_0x515c8c,_0x4575fd,_0x269035){var _0xb41ba1;return db[_0x497f('0x2a')][_0x497f('0x44')]({'where':{'id':_0x515c8c[_0x497f('0x41')]['id']},'attributes':['id',_0x497f('0x4e')]})['then'](handleEntityNotFound(_0x4575fd,null))[_0x497f('0x24')](function(_0x36ae21){if(_0x36ae21){var _0x110f59=require(_0x497f('0x4f'))();_0x110f59[_0x497f('0x50')](_0x36ae21['dsn']);_0x110f59[_0x497f('0x51')]();return _0x36ae21;}})[_0x497f('0x24')](respondWithResult(_0x4575fd,null))['catch'](handleError(_0x4575fd,null));}; \ No newline at end of file +var _0xf639=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','ODBC','UserProfileResource','end','error','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','fields','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','odbc','dsn','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1d836e,_0x4f10a2){var _0x216076=function(_0x5dd4de){while(--_0x5dd4de){_0x1d836e['push'](_0x1d836e['shift']());}};_0x216076(++_0x4f10a2);}(_0xf639,0x1ab));var _0x9f63=function(_0x3fd203,_0x2f78ab){_0x3fd203=_0x3fd203-0x0;var _0x5e6d58=_0xf639[_0x3fd203];return _0x5e6d58;};'use strict';var emlformat=require(_0x9f63('0x0'));var rimraf=require(_0x9f63('0x1'));var zipdir=require(_0x9f63('0x2'));var jsonpatch=require(_0x9f63('0x3'));var rp=require('request-promise');var moment=require(_0x9f63('0x4'));var BPromise=require(_0x9f63('0x5'));var Mustache=require(_0x9f63('0x6'));var util=require(_0x9f63('0x7'));var path=require('path');var sox=require(_0x9f63('0x8'));var csv=require(_0x9f63('0x9'));var ejs=require(_0x9f63('0xa'));var fs=require('fs');var fs_extra=require(_0x9f63('0xb'));var _=require(_0x9f63('0xc'));var squel=require(_0x9f63('0xd'));var crypto=require(_0x9f63('0xe'));var jsforce=require(_0x9f63('0xf'));var deskjs=require(_0x9f63('0x10'));var toCsv=require(_0x9f63('0x9'));var querystring=require(_0x9f63('0x11'));var Papa=require(_0x9f63('0x12'));var Redis=require(_0x9f63('0x13'));var authService=require(_0x9f63('0x14'));var qs=require(_0x9f63('0x15'));var as=require(_0x9f63('0x16'));var hardwareService=require(_0x9f63('0x17'));var logger=require('../../config/logger')(_0x9f63('0x18'));var utils=require('../../config/utils');var config=require(_0x9f63('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f63('0x1a'))['db'];function respondWithStatusCode(_0x2eef10,_0x535a38){_0x535a38=_0x535a38||0xcc;return function(_0x42c062){if(_0x42c062){return _0x2eef10[_0x9f63('0x1b')](_0x535a38);}return _0x2eef10[_0x9f63('0x1c')](_0x535a38)['end']();};}function respondWithResult(_0xc17571,_0x39067a){_0x39067a=_0x39067a||0xc8;return function(_0x389986){if(_0x389986){return _0xc17571[_0x9f63('0x1c')](_0x39067a)['json'](_0x389986);}};}function respondWithFilteredResult(_0x4b8381,_0x5f07fd){return function(_0x1571d2){if(_0x1571d2){var _0x5dbcc4=typeof _0x5f07fd[_0x9f63('0x1d')]===_0x9f63('0x1e')&&typeof _0x5f07fd[_0x9f63('0x1f')]==='undefined';var _0x2b9fca=_0x1571d2[_0x9f63('0x20')];var _0x2b6380=_0x5dbcc4?0x0:_0x5f07fd[_0x9f63('0x1d')];var _0x5df685=_0x5dbcc4?_0x1571d2['count']:_0x5f07fd[_0x9f63('0x1d')]+_0x5f07fd[_0x9f63('0x1f')];var _0x3eb8a0;if(_0x5df685>=_0x2b9fca){_0x5df685=_0x2b9fca;_0x3eb8a0=0xc8;}else{_0x3eb8a0=0xce;}_0x4b8381[_0x9f63('0x1c')](_0x3eb8a0);return _0x4b8381[_0x9f63('0x21')](_0x9f63('0x22'),_0x2b6380+'-'+_0x5df685+'/'+_0x2b9fca)['json'](_0x1571d2);}return null;};}function patchUpdates(_0x5b4aa4){return function(_0x4f6377){try{jsonpatch[_0x9f63('0x23')](_0x4f6377,_0x5b4aa4,!![]);}catch(_0x3d1416){return BPromise['reject'](_0x3d1416);}return _0x4f6377[_0x9f63('0x24')]();};}function saveUpdates(_0x5e0710,_0x3d2803){return function(_0x234534){if(_0x234534){return _0x234534[_0x9f63('0x25')](_0x5e0710)['then'](function(_0x35a224){return _0x35a224;});}return null;};}function removeEntity(_0x573ad0,_0x81e91f){return function(_0x5a25f7){if(_0x5a25f7){return _0x5a25f7[_0x9f63('0x26')]()[_0x9f63('0x27')](function(){var _0x5e13c6=_0x5a25f7[_0x9f63('0x28')]({'plain':!![]});var _0xd36766=_0x9f63('0x29');return db[_0x9f63('0x2a')][_0x9f63('0x26')]({'where':{'type':_0xd36766,'resourceId':_0x5e13c6['id']}})[_0x9f63('0x27')](function(){return _0x5a25f7;});})[_0x9f63('0x27')](function(){_0x573ad0[_0x9f63('0x1c')](0xcc)[_0x9f63('0x2b')]();});}};}function handleEntityNotFound(_0x562fd3,_0x1908cf){return function(_0x492c1f){if(!_0x492c1f){_0x562fd3[_0x9f63('0x1b')](0x194);}return _0x492c1f;};}function handleError(_0x2c0006,_0x1229f9){_0x1229f9=_0x1229f9||0x1f4;return function(_0x590e30){logger[_0x9f63('0x2c')](_0x590e30[_0x9f63('0x2d')]);if(_0x590e30[_0x9f63('0x2e')]){delete _0x590e30[_0x9f63('0x2e')];}_0x2c0006[_0x9f63('0x1c')](_0x1229f9)[_0x9f63('0x2f')](_0x590e30);};}exports[_0x9f63('0x30')]=function(_0x25c523,_0x430da3){var _0x580c69={},_0xee22ea={},_0x4e9131={'count':0x0,'rows':[]};var _0x41d804=_['map'](db[_0x9f63('0x31')][_0x9f63('0x32')],function(_0x44d512){return{'name':_0x44d512[_0x9f63('0x33')],'type':_0x44d512[_0x9f63('0x34')][_0x9f63('0x35')]};});_0xee22ea[_0x9f63('0x36')]=_[_0x9f63('0x37')](_0x41d804,_0x9f63('0x2e'));_0xee22ea[_0x9f63('0x38')]=_[_0x9f63('0x39')](_0x25c523[_0x9f63('0x38')]);_0xee22ea[_0x9f63('0x3a')]=_['intersection'](_0xee22ea[_0x9f63('0x36')],_0xee22ea[_0x9f63('0x38')]);_0x580c69[_0x9f63('0x3b')]=_[_0x9f63('0x3c')](_0xee22ea[_0x9f63('0x36')],qs['fields'](_0x25c523[_0x9f63('0x38')]['fields']));_0x580c69[_0x9f63('0x3b')]=_0x580c69[_0x9f63('0x3b')][_0x9f63('0x3d')]?_0x580c69[_0x9f63('0x3b')]:_0xee22ea[_0x9f63('0x36')];if(!_0x25c523['query'][_0x9f63('0x3e')](_0x9f63('0x3f'))){_0x580c69[_0x9f63('0x1f')]=qs[_0x9f63('0x1f')](_0x25c523[_0x9f63('0x38')][_0x9f63('0x1f')]);_0x580c69[_0x9f63('0x1d')]=qs['offset'](_0x25c523[_0x9f63('0x38')][_0x9f63('0x1d')]);}_0x580c69['order']=qs['sort'](_0x25c523['query'][_0x9f63('0x40')]);_0x580c69[_0x9f63('0x41')]=qs['filters'](_[_0x9f63('0x42')](_0x25c523[_0x9f63('0x38')],_0xee22ea[_0x9f63('0x3a')]),_0x41d804);if(_0x25c523[_0x9f63('0x38')][_0x9f63('0x43')]){_0x580c69['where']=_[_0x9f63('0x44')](_0x580c69[_0x9f63('0x41')],{'$or':_[_0x9f63('0x37')](_0x41d804,function(_0x10b74e){if(_0x10b74e[_0x9f63('0x34')]!==_0x9f63('0x45')){var _0x283b5b={};_0x283b5b[_0x10b74e[_0x9f63('0x2e')]]={'$like':'%'+_0x25c523['query']['filter']+'%'};return _0x283b5b;}})});}_0x580c69=_['merge']({},_0x580c69,_0x25c523[_0x9f63('0x46')]);var _0x42f0b0={'where':_0x580c69[_0x9f63('0x41')]};return db[_0x9f63('0x31')][_0x9f63('0x20')](_0x42f0b0)[_0x9f63('0x27')](function(_0x3113ec){_0x4e9131['count']=_0x3113ec;if(_0x25c523['query'][_0x9f63('0x47')]){_0x580c69['include']=[{'all':!![]}];}return db[_0x9f63('0x31')][_0x9f63('0x48')](_0x580c69);})[_0x9f63('0x27')](function(_0x5046c3){_0x4e9131['rows']=_0x5046c3;return _0x4e9131;})[_0x9f63('0x27')](respondWithFilteredResult(_0x430da3,_0x580c69))[_0x9f63('0x49')](handleError(_0x430da3,null));};exports[_0x9f63('0x4a')]=function(_0x340980,_0x711bce){var _0x2a1e14={'raw':!![],'where':{'id':_0x340980[_0x9f63('0x4b')]['id']}},_0xa0870e={};_0xa0870e[_0x9f63('0x36')]=_[_0x9f63('0x39')](db[_0x9f63('0x31')][_0x9f63('0x32')]);_0xa0870e[_0x9f63('0x38')]=_['keys'](_0x340980[_0x9f63('0x38')]);_0xa0870e[_0x9f63('0x3a')]=_[_0x9f63('0x3c')](_0xa0870e[_0x9f63('0x36')],_0xa0870e[_0x9f63('0x38')]);_0x2a1e14[_0x9f63('0x3b')]=_['intersection'](_0xa0870e[_0x9f63('0x36')],qs[_0x9f63('0x4c')](_0x340980[_0x9f63('0x38')][_0x9f63('0x4c')]));_0x2a1e14[_0x9f63('0x3b')]=_0x2a1e14[_0x9f63('0x3b')][_0x9f63('0x3d')]?_0x2a1e14[_0x9f63('0x3b')]:_0xa0870e[_0x9f63('0x36')];if(_0x340980[_0x9f63('0x38')][_0x9f63('0x47')]){_0x2a1e14['include']=[{'all':!![]}];}_0x2a1e14=_['merge']({},_0x2a1e14,_0x340980['options']);return db[_0x9f63('0x31')][_0x9f63('0x4d')](_0x2a1e14)['then'](handleEntityNotFound(_0x711bce,null))['then'](respondWithResult(_0x711bce,null))[_0x9f63('0x49')](handleError(_0x711bce,null));};exports[_0x9f63('0x4e')]=function(_0x548899,_0x1ec712){return db['SquareOdbc'][_0x9f63('0x4e')](_0x548899['body'],{})['then'](function(_0x180d93){var _0x40dfb8=_0x548899[_0x9f63('0x4f')][_0x9f63('0x28')]({'plain':!![]});if(!_0x40dfb8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40dfb8['role']===_0x9f63('0x4f')){var _0x16a40a=_0x180d93['get']({'plain':!![]});var _0x4a448f=_0x9f63('0x29');return db[_0x9f63('0x50')][_0x9f63('0x4d')]({'where':{'name':_0x4a448f,'userProfileId':_0x40dfb8[_0x9f63('0x51')]},'raw':!![]})[_0x9f63('0x27')](function(_0x462599){if(_0x462599&&_0x462599[_0x9f63('0x52')]===0x0){return db[_0x9f63('0x2a')][_0x9f63('0x4e')]({'name':_0x16a40a['name'],'resourceId':_0x16a40a['id'],'type':_0x462599[_0x9f63('0x2e')],'sectionId':_0x462599['id']},{})[_0x9f63('0x27')](function(){return _0x180d93;});}else{return _0x180d93;}})[_0x9f63('0x49')](function(_0x2f2e8e){logger[_0x9f63('0x2c')](_0x9f63('0x53'),_0x2f2e8e);throw _0x2f2e8e;});}return _0x180d93;})['then'](respondWithResult(_0x1ec712,0xc9))[_0x9f63('0x49')](handleError(_0x1ec712,null));};exports[_0x9f63('0x25')]=function(_0x279f88,_0x594d52){if(_0x279f88['body']['id']){delete _0x279f88['body']['id'];}return db[_0x9f63('0x31')][_0x9f63('0x4d')]({'where':{'id':_0x279f88[_0x9f63('0x4b')]['id']}})[_0x9f63('0x27')](handleEntityNotFound(_0x594d52,null))[_0x9f63('0x27')](saveUpdates(_0x279f88[_0x9f63('0x54')],null))[_0x9f63('0x27')](respondWithResult(_0x594d52,null))['catch'](handleError(_0x594d52,null));};exports[_0x9f63('0x26')]=function(_0x5208e7,_0x221845){return db[_0x9f63('0x31')][_0x9f63('0x4d')]({'where':{'id':_0x5208e7[_0x9f63('0x4b')]['id']}})[_0x9f63('0x27')](handleEntityNotFound(_0x221845,null))[_0x9f63('0x27')](removeEntity(_0x221845,null))[_0x9f63('0x49')](handleError(_0x221845,null));};exports[_0x9f63('0x55')]=function(_0x33cb01,_0x4ea7ca,_0x32c5e2){var _0x2789ef;return db[_0x9f63('0x31')][_0x9f63('0x4d')]({'where':{'id':_0x33cb01[_0x9f63('0x4b')]['id']},'attributes':['id','dsn']})[_0x9f63('0x27')](handleEntityNotFound(_0x4ea7ca,null))['then'](function(_0x5e47b5){if(_0x5e47b5){var _0x51a008=require(_0x9f63('0x56'))();_0x51a008['openSync'](_0x5e47b5[_0x9f63('0x57')]);_0x51a008['closeSync']();return _0x5e47b5;}})['then'](respondWithResult(_0x4ea7ca,null))[_0x9f63('0x49')](handleError(_0x4ea7ca,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 8c7298a..7785f40 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 _0x167a=['rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x2401e6,_0x2248d7){var _0xf06a43=function(_0x477bd8){while(--_0x477bd8){_0x2401e6['push'](_0x2401e6['shift']());}};_0xf06a43(++_0x2248d7);}(_0x167a,0x118));var _0xa167=function(_0x44a639,_0x5ef769){_0x44a639=_0x44a639-0x0;var _0x2a2532=_0x167a[_0x44a639];return _0x2a2532;};'use strict';var _=require(_0xa167('0x0'));var util=require(_0xa167('0x1'));var logger=require(_0xa167('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa167('0x3'));var rp=require(_0xa167('0x4'));var fs=require('fs');var path=require(_0xa167('0x5'));var rimraf=require(_0xa167('0x6'));var config=require(_0xa167('0x7'));var attributes=require(_0xa167('0x8'));module['exports']=function(_0x51a29d,_0x4ce4bb){return _0x51a29d['define'](_0xa167('0x9'),attributes,{'tableName':_0xa167('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xede6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc'];(function(_0x1f1fc2,_0x28dc54){var _0x336843=function(_0x3e109c){while(--_0x3e109c){_0x1f1fc2['push'](_0x1f1fc2['shift']());}};_0x336843(++_0x28dc54);}(_0xede6,0x10a));var _0x6ede=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xede6[_0x3c4737];return _0x2bb926;};'use strict';var _=require('lodash');var util=require(_0x6ede('0x0'));var logger=require(_0x6ede('0x1'))(_0x6ede('0x2'));var moment=require(_0x6ede('0x3'));var BPromise=require(_0x6ede('0x4'));var rp=require(_0x6ede('0x5'));var fs=require('fs');var path=require(_0x6ede('0x6'));var rimraf=require(_0x6ede('0x7'));var config=require(_0x6ede('0x8'));var attributes=require(_0x6ede('0x9'));module[_0x6ede('0xa')]=function(_0x2fc458,_0x5c93d4){return _0x2fc458[_0x6ede('0xb')](_0x6ede('0xc'),attributes,{'tableName':_0x6ede('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index e80839b..e1f57e0 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 _0x709e=['raw','where','attributes','include','map','model','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','ShowSquareOdbc','SquareOdbc','options'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x709e,0x18d));var _0xe709=function(_0x8de84,_0x5f4711){_0x8de84=_0x8de84-0x0;var _0x57c0ad=_0x709e[_0x8de84];return _0x57c0ad;};'use strict';var _=require(_0xe709('0x0'));var util=require(_0xe709('0x1'));var moment=require('moment');var BPromise=require(_0xe709('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe709('0x3'))['db'];var utils=require(_0xe709('0x4'));var logger=require(_0xe709('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe709('0x6'));var client=jayson['client'][_0xe709('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1af719,_0x4a6e6c,_0x115048){return new BPromise(function(_0x34d8cd,_0x54b8a5){return client[_0xe709('0x8')](_0x1af719,_0x115048)[_0xe709('0x9')](function(_0x187791){logger[_0xe709('0xa')]('SquareOdbc,\x20%s,\x20%s',_0x4a6e6c,_0xe709('0xb'));logger[_0xe709('0xc')](_0xe709('0xd'),_0x4a6e6c,_0xe709('0xb'),JSON[_0xe709('0xe')](_0x187791));if(_0x187791[_0xe709('0xf')]){if(_0x187791['error'][_0xe709('0x10')]===0x1f4){logger[_0xe709('0xf')](_0xe709('0x11'),_0x4a6e6c,_0x187791[_0xe709('0xf')][_0xe709('0x12')]);return _0x54b8a5(_0x187791[_0xe709('0xf')][_0xe709('0x12')]);}logger[_0xe709('0xf')](_0xe709('0x11'),_0x4a6e6c,_0x187791[_0xe709('0xf')][_0xe709('0x12')]);return _0x34d8cd(_0x187791['error'][_0xe709('0x12')]);}else{logger[_0xe709('0xa')](_0xe709('0x11'),_0x4a6e6c,_0xe709('0xb'));_0x34d8cd(_0x187791[_0xe709('0x13')][_0xe709('0x12')]);}})['catch'](function(_0x40945b){logger[_0xe709('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x4a6e6c,_0x40945b);_0x54b8a5(_0x40945b);});});}exports[_0xe709('0x14')]=function(_0x4df0e9){var _0x3e8816=this;return new Promise(function(_0xd4aaa4,_0xfae5ee){return db[_0xe709('0x15')]['find']({'raw':_0x4df0e9[_0xe709('0x16')]?_0x4df0e9['options'][_0xe709('0x17')]===undefined?!![]:![]:!![],'where':_0x4df0e9[_0xe709('0x16')]?_0x4df0e9[_0xe709('0x16')][_0xe709('0x18')]||null:null,'attributes':_0x4df0e9['options']?_0x4df0e9[_0xe709('0x16')][_0xe709('0x19')]||null:null,'include':_0x4df0e9[_0xe709('0x16')]?_0x4df0e9[_0xe709('0x16')][_0xe709('0x1a')]?_[_0xe709('0x1b')](_0x4df0e9[_0xe709('0x16')][_0xe709('0x1a')],function(_0x23a423){return{'model':db[_0x23a423[_0xe709('0x1c')]],'as':_0x23a423['as'],'attributes':_0x23a423[_0xe709('0x19')],'include':_0x23a423[_0xe709('0x1a')]?_['map'](_0x23a423['include'],function(_0x38b92d){return{'model':db[_0x38b92d[_0xe709('0x1c')]],'as':_0x38b92d['as'],'attributes':_0x38b92d['attributes'],'include':_0x38b92d[_0xe709('0x1a')]?_[_0xe709('0x1b')](_0x38b92d[_0xe709('0x1a')],function(_0x38d69e){return{'model':db[_0x38d69e[_0xe709('0x1c')]],'as':_0x38d69e['as'],'attributes':_0x38d69e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe709('0x9')](function(_0xba98b){logger[_0xe709('0xa')](_0xe709('0x14'),_0x4df0e9);logger['debug']('ShowSquareOdbc',_0x4df0e9,JSON[_0xe709('0xe')](_0xba98b));_0xd4aaa4(_0xba98b);})[_0xe709('0x1d')](function(_0x182259){logger[_0xe709('0xf')]('ShowSquareOdbc',_0x182259[_0xe709('0x12')],_0x4df0e9);_0xfae5ee(_0x3e8816[_0xe709('0xf')](0x1f4,_0x182259[_0xe709('0x12')]));});});}; \ No newline at end of file +var _0xa984=['error','code','message','result','catch','SquareOdbc','options','where','map','include','model','attributes','ShowSquareOdbc','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x308867,_0x11016b){var _0x2e7305=function(_0x45b09a){while(--_0x45b09a){_0x308867['push'](_0x308867['shift']());}};_0x2e7305(++_0x11016b);}(_0xa984,0x18e));var _0x4a98=function(_0x18793f,_0x5d8dd7){_0x18793f=_0x18793f-0x0;var _0x516125=_0xa984[_0x18793f];return _0x516125;};'use strict';var _=require(_0x4a98('0x0'));var util=require(_0x4a98('0x1'));var moment=require(_0x4a98('0x2'));var BPromise=require('bluebird');var rs=require(_0x4a98('0x3'));var fs=require('fs');var Redis=require(_0x4a98('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4a98('0x5'))(_0x4a98('0x6'));var config=require(_0x4a98('0x7'));var jayson=require(_0x4a98('0x8'));var client=jayson[_0x4a98('0x9')][_0x4a98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d529d,_0x5aac0a,_0x5de7ed){return new BPromise(function(_0xd27fd3,_0x5d9b47){return client[_0x4a98('0xb')](_0x4d529d,_0x5de7ed)[_0x4a98('0xc')](function(_0x3a40cf){logger[_0x4a98('0xd')](_0x4a98('0xe'),_0x5aac0a,_0x4a98('0xf'));logger['debug'](_0x4a98('0x10'),_0x5aac0a,_0x4a98('0xf'),JSON[_0x4a98('0x11')](_0x3a40cf));if(_0x3a40cf[_0x4a98('0x12')]){if(_0x3a40cf['error'][_0x4a98('0x13')]===0x1f4){logger[_0x4a98('0x12')](_0x4a98('0xe'),_0x5aac0a,_0x3a40cf[_0x4a98('0x12')]['message']);return _0x5d9b47(_0x3a40cf['error']['message']);}logger[_0x4a98('0x12')](_0x4a98('0xe'),_0x5aac0a,_0x3a40cf[_0x4a98('0x12')][_0x4a98('0x14')]);return _0xd27fd3(_0x3a40cf[_0x4a98('0x12')][_0x4a98('0x14')]);}else{logger[_0x4a98('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x5aac0a,_0x4a98('0xf'));_0xd27fd3(_0x3a40cf[_0x4a98('0x15')][_0x4a98('0x14')]);}})[_0x4a98('0x16')](function(_0x106bb7){logger['error'](_0x4a98('0xe'),_0x5aac0a,_0x106bb7);_0x5d9b47(_0x106bb7);});});}exports['ShowSquareOdbc']=function(_0x8b3a8e){var _0x258042=this;return new Promise(function(_0x4172b7,_0x1addc6){return db[_0x4a98('0x17')]['find']({'raw':_0x8b3a8e[_0x4a98('0x18')]?_0x8b3a8e['options']['raw']===undefined?!![]:![]:!![],'where':_0x8b3a8e[_0x4a98('0x18')]?_0x8b3a8e[_0x4a98('0x18')][_0x4a98('0x19')]||null:null,'attributes':_0x8b3a8e['options']?_0x8b3a8e[_0x4a98('0x18')]['attributes']||null:null,'include':_0x8b3a8e[_0x4a98('0x18')]?_0x8b3a8e['options']['include']?_[_0x4a98('0x1a')](_0x8b3a8e[_0x4a98('0x18')][_0x4a98('0x1b')],function(_0x48feeb){return{'model':db[_0x48feeb[_0x4a98('0x1c')]],'as':_0x48feeb['as'],'attributes':_0x48feeb[_0x4a98('0x1d')],'include':_0x48feeb[_0x4a98('0x1b')]?_['map'](_0x48feeb[_0x4a98('0x1b')],function(_0x332ae3){return{'model':db[_0x332ae3[_0x4a98('0x1c')]],'as':_0x332ae3['as'],'attributes':_0x332ae3[_0x4a98('0x1d')],'include':_0x332ae3['include']?_[_0x4a98('0x1a')](_0x332ae3[_0x4a98('0x1b')],function(_0x1eba3c){return{'model':db[_0x1eba3c[_0x4a98('0x1c')]],'as':_0x1eba3c['as'],'attributes':_0x1eba3c[_0x4a98('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4a98('0xc')](function(_0xcea7f6){logger[_0x4a98('0xd')](_0x4a98('0x1e'),_0x8b3a8e);logger[_0x4a98('0x1f')](_0x4a98('0x1e'),_0x8b3a8e,JSON[_0x4a98('0x11')](_0xcea7f6));_0x4172b7(_0xcea7f6);})[_0x4a98('0x16')](function(_0x465dd5){logger[_0x4a98('0x12')](_0x4a98('0x1e'),_0x465dd5[_0x4a98('0x14')],_0x8b3a8e);_0x1addc6(_0x258042[_0x4a98('0x12')](0x1f4,_0x465dd5[_0x4a98('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 007fc00..ba2c40b 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 _0xbac2=['create','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','/:id','show','/:id/users','getUsers','post'];(function(_0x397a30,_0x157c3a){var _0x13f8b3=function(_0x59ec84){while(--_0x59ec84){_0x397a30['push'](_0x397a30['shift']());}};_0x13f8b3(++_0x157c3a);}(_0xbac2,0xc6));var _0x2bac=function(_0x4ea955,_0x1eda76){_0x4ea955=_0x4ea955-0x0;var _0x558561=_0xbac2[_0x4ea955];return _0x558561;};'use strict';var multer=require(_0x2bac('0x0'));var util=require(_0x2bac('0x1'));var path=require(_0x2bac('0x2'));var timeout=require(_0x2bac('0x3'));var express=require(_0x2bac('0x4'));var router=express[_0x2bac('0x5')]();var fs_extra=require(_0x2bac('0x6'));var auth=require(_0x2bac('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2bac('0x8'));var controller=require(_0x2bac('0x9'));router['get']('/',auth[_0x2bac('0xa')](),controller[_0x2bac('0xb')]);router[_0x2bac('0xc')](_0x2bac('0xd'),auth[_0x2bac('0xa')](),controller[_0x2bac('0xe')]);router[_0x2bac('0xc')](_0x2bac('0xf'),auth[_0x2bac('0xa')](),controller[_0x2bac('0x10')]);router[_0x2bac('0x11')]('/',auth[_0x2bac('0xa')](),controller[_0x2bac('0x12')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addUsers']);router['put'](_0x2bac('0xd'),auth[_0x2bac('0xa')](),controller[_0x2bac('0x13')]);router[_0x2bac('0x14')](_0x2bac('0xd'),auth[_0x2bac('0xa')](),controller[_0x2bac('0x15')]);router['delete'](_0x2bac('0xf'),auth['isAuthenticated'](),controller[_0x2bac('0x16')]);module[_0x2bac('0x17')]=router; \ No newline at end of file +var _0x60a5=['/:id','update','delete','destroy','removeUsers','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','show','/:id/users','post','addUsers','put'];(function(_0xd6ddab,_0x3f700e){var _0x81549e=function(_0x405c71){while(--_0x405c71){_0xd6ddab['push'](_0xd6ddab['shift']());}};_0x81549e(++_0x3f700e);}(_0x60a5,0x83));var _0x560a=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x60a5[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x560a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x560a('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x560a('0x2'));var auth=require(_0x560a('0x3'));var interaction=require(_0x560a('0x4'));var config=require('../../config/environment');var controller=require(_0x560a('0x5'));router[_0x560a('0x6')]('/',auth[_0x560a('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x560a('0x8')]);router[_0x560a('0x6')](_0x560a('0x9'),auth[_0x560a('0x7')](),controller['getUsers']);router['post']('/',auth[_0x560a('0x7')](),controller['create']);router[_0x560a('0xa')](_0x560a('0x9'),auth['isAuthenticated'](),controller[_0x560a('0xb')]);router[_0x560a('0xc')](_0x560a('0xd'),auth[_0x560a('0x7')](),controller[_0x560a('0xe')]);router[_0x560a('0xf')](_0x560a('0xd'),auth[_0x560a('0x7')](),controller[_0x560a('0x10')]);router['delete'](_0x560a('0x9'),auth[_0x560a('0x7')](),controller[_0x560a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 280401a..cc16a8a 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 _0xbd22=['sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x46de7a,_0xe83b23){var _0x292884=function(_0x1e2009){while(--_0x1e2009){_0x46de7a['push'](_0x46de7a['shift']());}};_0x292884(++_0xe83b23);}(_0xbd22,0xf7));var _0x2bd2=function(_0x2b7e6c,_0xa345f5){_0x2b7e6c=_0x2b7e6c-0x0;var _0x496613=_0xbd22[_0x2b7e6c];return _0x496613;};'use strict';var Sequelize=require(_0x2bd2('0x0'));module[_0x2bd2('0x1')]={'name':{'type':Sequelize[_0x2bd2('0x2')],'unique':_0x2bd2('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2bd2('0x2')]},'notes':{'type':Sequelize[_0x2bd2('0x4')]},'preproduction':{'type':Sequelize[_0x2bd2('0x5')](_0x2bd2('0x6')),'get':function(){if(this[_0x2bd2('0x7')](_0x2bd2('0x8'))){return this['getDataValue'](_0x2bd2('0x8'))[_0x2bd2('0x9')](_0x2bd2('0xa'));}}},'production':{'type':Sequelize['BLOB'](_0x2bd2('0x6')),'get':function(){if(this['getDataValue']('production')){return this[_0x2bd2('0x7')](_0x2bd2('0xb'))['toString'](_0x2bd2('0xa'));}}},'savedAt':{'type':Sequelize[_0x2bd2('0xc')]},'publishedAt':{'type':Sequelize[_0x2bd2('0xc')]}}; \ No newline at end of file +var _0x8ba5=['DATE','sequelize','exports','STRING','name','BLOB','long','getDataValue','preproduction','production','toString'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x8ba5,0x1da));var _0x58ba=function(_0x3b3f90,_0x388364){_0x3b3f90=_0x3b3f90-0x0;var _0x52522e=_0x8ba5[_0x3b3f90];return _0x52522e;};'use strict';var Sequelize=require(_0x58ba('0x0'));module[_0x58ba('0x1')]={'name':{'type':Sequelize[_0x58ba('0x2')],'unique':_0x58ba('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x58ba('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x58ba('0x4')](_0x58ba('0x5')),'get':function(){if(this[_0x58ba('0x6')]('preproduction')){return this['getDataValue'](_0x58ba('0x7'))['toString']('utf8');}}},'production':{'type':Sequelize['BLOB'](_0x58ba('0x5')),'get':function(){if(this[_0x58ba('0x6')](_0x58ba('0x8'))){return this[_0x58ba('0x6')]('production')[_0x58ba('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0x58ba('0xa')]},'publishedAt':{'type':Sequelize[_0x58ba('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 581b250..47a47d7 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 _0x9e8f=['nolimit','order','sort','pick','filters','where','merge','type','filter','options','findAll','rows','catch','show','params','keys','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','apply','reject','then','destroy','get','SquareProjects','UserProfileResource','error','name','send','index','map','SquareProject','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x14819f,_0x555f63){var _0x3ae65b=function(_0x3c7923){while(--_0x3c7923){_0x14819f['push'](_0x14819f['shift']());}};_0x3ae65b(++_0x555f63);}(_0x9e8f,0x14f));var _0xf9e8=function(_0x4a5f8b,_0x3266e5){_0x4a5f8b=_0x4a5f8b-0x0;var _0x31ed38=_0x9e8f[_0x4a5f8b];return _0x31ed38;};'use strict';var emlformat=require(_0xf9e8('0x0'));var rimraf=require(_0xf9e8('0x1'));var zipdir=require(_0xf9e8('0x2'));var jsonpatch=require(_0xf9e8('0x3'));var rp=require(_0xf9e8('0x4'));var moment=require(_0xf9e8('0x5'));var BPromise=require(_0xf9e8('0x6'));var Mustache=require(_0xf9e8('0x7'));var util=require(_0xf9e8('0x8'));var path=require(_0xf9e8('0x9'));var sox=require('sox');var csv=require(_0xf9e8('0xa'));var ejs=require(_0xf9e8('0xb'));var fs=require('fs');var fs_extra=require(_0xf9e8('0xc'));var _=require(_0xf9e8('0xd'));var squel=require('squel');var crypto=require(_0xf9e8('0xe'));var jsforce=require(_0xf9e8('0xf'));var deskjs=require(_0xf9e8('0x10'));var toCsv=require(_0xf9e8('0xa'));var querystring=require('querystring');var Papa=require(_0xf9e8('0x11'));var Redis=require(_0xf9e8('0x12'));var authService=require(_0xf9e8('0x13'));var qs=require(_0xf9e8('0x14'));var as=require(_0xf9e8('0x15'));var hardwareService=require(_0xf9e8('0x16'));var logger=require(_0xf9e8('0x17'))(_0xf9e8('0x18'));var utils=require(_0xf9e8('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf9e8('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf9e8('0x1b'))(new Redis(config[_0xf9e8('0x1a')]));require(_0xf9e8('0x1c'))[_0xf9e8('0x1d')](socket);function respondWithStatusCode(_0x106990,_0x9a3c62){_0x9a3c62=_0x9a3c62||0xcc;return function(_0x410fcc){if(_0x410fcc){return _0x106990[_0xf9e8('0x1e')](_0x9a3c62);}return _0x106990[_0xf9e8('0x1f')](_0x9a3c62)[_0xf9e8('0x20')]();};}function respondWithResult(_0xdbd975,_0x2dbd0f){_0x2dbd0f=_0x2dbd0f||0xc8;return function(_0x478f04){if(_0x478f04){return _0xdbd975[_0xf9e8('0x1f')](_0x2dbd0f)['json'](_0x478f04);}};}function respondWithFilteredResult(_0x4194fe,_0x249196){return function(_0x3b94ac){if(_0x3b94ac){var _0x1a7b11=typeof _0x249196[_0xf9e8('0x21')]==='undefined'&&typeof _0x249196[_0xf9e8('0x22')]===_0xf9e8('0x23');var _0x320a9c=_0x3b94ac[_0xf9e8('0x24')];var _0x2684f0=_0x1a7b11?0x0:_0x249196[_0xf9e8('0x21')];var _0x11a548=_0x1a7b11?_0x3b94ac[_0xf9e8('0x24')]:_0x249196['offset']+_0x249196[_0xf9e8('0x22')];var _0x20d49b;if(_0x11a548>=_0x320a9c){_0x11a548=_0x320a9c;_0x20d49b=0xc8;}else{_0x20d49b=0xce;}_0x4194fe['status'](_0x20d49b);return _0x4194fe['set'](_0xf9e8('0x25'),_0x2684f0+'-'+_0x11a548+'/'+_0x320a9c)['json'](_0x3b94ac);}return null;};}function patchUpdates(_0x4d9278){return function(_0x1cc149){try{jsonpatch[_0xf9e8('0x26')](_0x1cc149,_0x4d9278,!![]);}catch(_0x18fac3){return BPromise[_0xf9e8('0x27')](_0x18fac3);}return _0x1cc149['save']();};}function saveUpdates(_0x2211b2,_0x29fd85){return function(_0x599c42){if(_0x599c42){return _0x599c42['update'](_0x2211b2)[_0xf9e8('0x28')](function(_0x1b1ae5){return _0x1b1ae5;});}return null;};}function removeEntity(_0x2333b8,_0x4d6044){return function(_0x154819){if(_0x154819){return _0x154819[_0xf9e8('0x29')]()[_0xf9e8('0x28')](function(){var _0x144c18=_0x154819[_0xf9e8('0x2a')]({'plain':!![]});var _0x497e04=_0xf9e8('0x2b');return db[_0xf9e8('0x2c')][_0xf9e8('0x29')]({'where':{'type':_0x497e04,'resourceId':_0x144c18['id']}})['then'](function(){return _0x154819;});})[_0xf9e8('0x28')](function(){_0x2333b8[_0xf9e8('0x1f')](0xcc)[_0xf9e8('0x20')]();});}};}function handleEntityNotFound(_0x3c294c,_0x291fad){return function(_0x420205){if(!_0x420205){_0x3c294c[_0xf9e8('0x1e')](0x194);}return _0x420205;};}function handleError(_0x26239e,_0x8e63ad){_0x8e63ad=_0x8e63ad||0x1f4;return function(_0x2c0367){logger[_0xf9e8('0x2d')](_0x2c0367['stack']);if(_0x2c0367[_0xf9e8('0x2e')]){delete _0x2c0367['name'];}_0x26239e[_0xf9e8('0x1f')](_0x8e63ad)[_0xf9e8('0x2f')](_0x2c0367);};}exports[_0xf9e8('0x30')]=function(_0x19b894,_0x273110){var _0x3e5032={},_0x2b80f1={},_0x1ff444={'count':0x0,'rows':[]};var _0xe3f347=_[_0xf9e8('0x31')](db[_0xf9e8('0x32')][_0xf9e8('0x33')],function(_0x380cae){return{'name':_0x380cae[_0xf9e8('0x34')],'type':_0x380cae['type'][_0xf9e8('0x35')]};});_0x2b80f1[_0xf9e8('0x36')]=_[_0xf9e8('0x31')](_0xe3f347,'name');_0x2b80f1['query']=_['keys'](_0x19b894['query']);_0x2b80f1['filters']=_['intersection'](_0x2b80f1['model'],_0x2b80f1[_0xf9e8('0x37')]);_0x3e5032[_0xf9e8('0x38')]=_[_0xf9e8('0x39')](_0x2b80f1['model'],qs[_0xf9e8('0x3a')](_0x19b894['query']['fields']));_0x3e5032[_0xf9e8('0x38')]=_0x3e5032[_0xf9e8('0x38')][_0xf9e8('0x3b')]?_0x3e5032[_0xf9e8('0x38')]:_0x2b80f1[_0xf9e8('0x36')];if(!_0x19b894[_0xf9e8('0x37')][_0xf9e8('0x3c')](_0xf9e8('0x3d'))){_0x3e5032[_0xf9e8('0x22')]=qs[_0xf9e8('0x22')](_0x19b894[_0xf9e8('0x37')][_0xf9e8('0x22')]);_0x3e5032[_0xf9e8('0x21')]=qs['offset'](_0x19b894['query'][_0xf9e8('0x21')]);}_0x3e5032[_0xf9e8('0x3e')]=qs[_0xf9e8('0x3f')](_0x19b894[_0xf9e8('0x37')][_0xf9e8('0x3f')]);_0x3e5032['where']=qs['filters'](_[_0xf9e8('0x40')](_0x19b894[_0xf9e8('0x37')],_0x2b80f1[_0xf9e8('0x41')]),_0xe3f347);if(_0x19b894[_0xf9e8('0x37')]['filter']){_0x3e5032[_0xf9e8('0x42')]=_[_0xf9e8('0x43')](_0x3e5032[_0xf9e8('0x42')],{'$or':_[_0xf9e8('0x31')](_0xe3f347,function(_0x38149e){if(_0x38149e[_0xf9e8('0x44')]!=='VIRTUAL'){var _0x4588da={};_0x4588da[_0x38149e['name']]={'$like':'%'+_0x19b894[_0xf9e8('0x37')][_0xf9e8('0x45')]+'%'};return _0x4588da;}})});}_0x3e5032=_['merge']({},_0x3e5032,_0x19b894[_0xf9e8('0x46')]);var _0x29483f={'where':_0x3e5032['where']};return db[_0xf9e8('0x32')][_0xf9e8('0x24')](_0x29483f)['then'](function(_0x9a6e0a){_0x1ff444[_0xf9e8('0x24')]=_0x9a6e0a;if(_0x19b894[_0xf9e8('0x37')]['includeAll']){_0x3e5032['include']=[{'all':!![]}];}return db[_0xf9e8('0x32')][_0xf9e8('0x47')](_0x3e5032);})[_0xf9e8('0x28')](function(_0x1d7f25){_0x1ff444[_0xf9e8('0x48')]=_0x1d7f25;return _0x1ff444;})['then'](respondWithFilteredResult(_0x273110,_0x3e5032))[_0xf9e8('0x49')](handleError(_0x273110,null));};exports[_0xf9e8('0x4a')]=function(_0x5c5127,_0x9333ff){var _0x3a1b3d={'raw':![],'where':{'id':_0x5c5127[_0xf9e8('0x4b')]['id']}},_0x35067e={};_0x35067e[_0xf9e8('0x36')]=_['keys'](db[_0xf9e8('0x32')][_0xf9e8('0x33')]);_0x35067e[_0xf9e8('0x37')]=_[_0xf9e8('0x4c')](_0x5c5127[_0xf9e8('0x37')]);_0x35067e['filters']=_[_0xf9e8('0x39')](_0x35067e[_0xf9e8('0x36')],_0x35067e[_0xf9e8('0x37')]);_0x3a1b3d[_0xf9e8('0x38')]=_[_0xf9e8('0x39')](_0x35067e[_0xf9e8('0x36')],qs[_0xf9e8('0x3a')](_0x5c5127[_0xf9e8('0x37')][_0xf9e8('0x3a')]));_0x3a1b3d['attributes']=_0x3a1b3d[_0xf9e8('0x38')][_0xf9e8('0x3b')]?_0x3a1b3d[_0xf9e8('0x38')]:_0x35067e[_0xf9e8('0x36')];if(_0x5c5127[_0xf9e8('0x37')][_0xf9e8('0x4d')]){_0x3a1b3d[_0xf9e8('0x4e')]=[{'all':!![]}];}_0x3a1b3d=_[_0xf9e8('0x43')]({},_0x3a1b3d,_0x5c5127[_0xf9e8('0x46')]);return db['SquareProject'][_0xf9e8('0x4f')](_0x3a1b3d)[_0xf9e8('0x28')](handleEntityNotFound(_0x9333ff,null))[_0xf9e8('0x28')](respondWithResult(_0x9333ff,null))[_0xf9e8('0x49')](handleError(_0x9333ff,null));};exports[_0xf9e8('0x50')]=function(_0x3235e1,_0x144a37){return db[_0xf9e8('0x32')][_0xf9e8('0x50')](_0x3235e1['body'],{})['then'](function(_0x1677a6){var _0x322221=_0x3235e1[_0xf9e8('0x51')]['get']({'plain':!![]});if(!_0x322221)throw new Error(_0xf9e8('0x52'));if(_0x322221[_0xf9e8('0x53')]==='user'){var _0x37cc46=_0x1677a6['get']({'plain':!![]});var _0x4c1a49=_0xf9e8('0x2b');return db[_0xf9e8('0x54')]['find']({'where':{'name':_0x4c1a49,'userProfileId':_0x322221[_0xf9e8('0x55')]},'raw':!![]})[_0xf9e8('0x28')](function(_0x8f97f0){if(_0x8f97f0&&_0x8f97f0[_0xf9e8('0x56')]===0x0){return db[_0xf9e8('0x2c')][_0xf9e8('0x50')]({'name':_0x37cc46[_0xf9e8('0x2e')],'resourceId':_0x37cc46['id'],'type':_0x8f97f0[_0xf9e8('0x2e')],'sectionId':_0x8f97f0['id']},{})[_0xf9e8('0x28')](function(){return _0x1677a6;});}else{return _0x1677a6;}})[_0xf9e8('0x49')](function(_0x125bdf){logger[_0xf9e8('0x2d')](_0xf9e8('0x57'),_0x125bdf);throw _0x125bdf;});}return _0x1677a6;})['then'](respondWithResult(_0x144a37,0xc9))[_0xf9e8('0x49')](handleError(_0x144a37,null));};exports[_0xf9e8('0x58')]=function(_0x57a331,_0x2bd55c){if(_0x57a331['body']['id']){delete _0x57a331[_0xf9e8('0x59')]['id'];}return db[_0xf9e8('0x32')][_0xf9e8('0x4f')]({'where':{'id':_0x57a331[_0xf9e8('0x4b')]['id']}})[_0xf9e8('0x28')](handleEntityNotFound(_0x2bd55c,null))['then'](saveUpdates(_0x57a331['body'],null))[_0xf9e8('0x28')](respondWithResult(_0x2bd55c,null))['catch'](handleError(_0x2bd55c,null));};exports[_0xf9e8('0x29')]=function(_0x101886,_0x4d73a9){return db[_0xf9e8('0x32')][_0xf9e8('0x4f')]({'where':{'id':_0x101886['params']['id']}})[_0xf9e8('0x28')](handleEntityNotFound(_0x4d73a9,null))['then'](removeEntity(_0x4d73a9,null))['catch'](handleError(_0x4d73a9,null));};exports[_0xf9e8('0x5a')]=function(_0x1ec2b4,_0x2a6d79,_0x19facd){return db[_0xf9e8('0x32')][_0xf9e8('0x4f')]({'where':{'id':_0x1ec2b4['params']['id']}})[_0xf9e8('0x28')](handleEntityNotFound(_0x2a6d79,null))[_0xf9e8('0x28')](function(_0x9af8ec){if(_0x9af8ec){return _0x9af8ec[_0xf9e8('0x5a')](_0x1ec2b4[_0xf9e8('0x59')][_0xf9e8('0x5b')],_['omit'](_0x1ec2b4['body'],['ids','id'])||{});}})[_0xf9e8('0x28')](respondWithResult(_0x2a6d79,null))[_0xf9e8('0x49')](handleError(_0x2a6d79,null));};exports[_0xf9e8('0x5c')]=function(_0xc352db,_0x438bc1,_0x4d6e51){return db[_0xf9e8('0x32')][_0xf9e8('0x4f')]({'where':{'id':_0xc352db[_0xf9e8('0x4b')]['id']}})[_0xf9e8('0x28')](handleEntityNotFound(_0x438bc1,null))[_0xf9e8('0x28')](function(_0x13740b){if(_0x13740b){return _0x13740b[_0xf9e8('0x5c')](_0xc352db[_0xf9e8('0x37')][_0xf9e8('0x5b')])[_0xf9e8('0x28')](function(){if(_[_0xf9e8('0x5d')](_0xc352db[_0xf9e8('0x37')][_0xf9e8('0x5b')])){for(var _0x53f946=0x0;_0x53f946<_0xc352db[_0xf9e8('0x37')][_0xf9e8('0x5b')][_0xf9e8('0x3b')];_0x53f946+=0x1){socket[_0xf9e8('0x5e')](_0xf9e8('0x5f'),{'UserId':Number(_0xc352db[_0xf9e8('0x37')][_0xf9e8('0x5b')][_0x53f946]),'SquareProjectId':Number(_0xc352db[_0xf9e8('0x4b')]['id'])});}}else{socket[_0xf9e8('0x5e')]('userSquareProject:remove',{'UserId':Number(_0xc352db['query']['ids']),'SquareProjectId':Number(_0xc352db[_0xf9e8('0x4b')]['id'])});}});}})[_0xf9e8('0x28')](respondWithStatusCode(_0x438bc1,null))[_0xf9e8('0x49')](handleError(_0x438bc1,null));};exports[_0xf9e8('0x60')]=function(_0x491d8e,_0x4e44f5,_0x2eb503){var _0x837d52={};var _0x330891={};var _0x3e6900;var _0x127a3e;return db['SquareProject'][_0xf9e8('0x61')]({'where':{'id':_0x491d8e['params']['id']}})[_0xf9e8('0x28')](handleEntityNotFound(_0x4e44f5,null))[_0xf9e8('0x28')](function(_0x429910){if(_0x429910){_0x3e6900=_0x429910;_0x330891[_0xf9e8('0x36')]=_[_0xf9e8('0x4c')](db[_0xf9e8('0x62')][_0xf9e8('0x33')]);_0x330891[_0xf9e8('0x37')]=_['keys'](_0x491d8e[_0xf9e8('0x37')]);_0x330891[_0xf9e8('0x41')]=_['intersection'](_0x330891[_0xf9e8('0x36')],_0x330891[_0xf9e8('0x37')]);_0x837d52[_0xf9e8('0x38')]=_[_0xf9e8('0x39')](_0x330891['model'],qs['fields'](_0x491d8e[_0xf9e8('0x37')]['fields']));_0x837d52[_0xf9e8('0x38')]=_0x837d52[_0xf9e8('0x38')][_0xf9e8('0x3b')]?_0x837d52[_0xf9e8('0x38')]:_0x330891[_0xf9e8('0x36')];_0x837d52[_0xf9e8('0x3e')]=qs[_0xf9e8('0x3f')](_0x491d8e['query']['sort']);_0x837d52[_0xf9e8('0x42')]=qs[_0xf9e8('0x41')](_[_0xf9e8('0x40')](_0x491d8e['query'],_0x330891[_0xf9e8('0x41')]));if(_0x491d8e[_0xf9e8('0x37')][_0xf9e8('0x45')]){_0x837d52[_0xf9e8('0x42')]=_[_0xf9e8('0x43')](_0x837d52[_0xf9e8('0x42')],{'$or':_[_0xf9e8('0x31')](_0x837d52[_0xf9e8('0x38')],function(_0x8de083){var _0x57da04={};_0x57da04[_0x8de083]={'$like':'%'+_0x491d8e['query'][_0xf9e8('0x45')]+'%'};return _0x57da04;})});}_0x837d52=_[_0xf9e8('0x43')]({},_0x837d52,_0x491d8e[_0xf9e8('0x46')]);return _0x3e6900[_0xf9e8('0x60')](_0x837d52);}})[_0xf9e8('0x28')](function(_0x212ad6){if(_0x212ad6){_0x127a3e=_0x212ad6[_0xf9e8('0x3b')];if(!_0x491d8e['query'][_0xf9e8('0x3c')]('nolimit')){_0x837d52[_0xf9e8('0x22')]=qs[_0xf9e8('0x22')](_0x491d8e['query'][_0xf9e8('0x22')]);_0x837d52['offset']=qs['offset'](_0x491d8e[_0xf9e8('0x37')][_0xf9e8('0x21')]);}return _0x3e6900['getUsers'](_0x837d52);}})[_0xf9e8('0x28')](function(_0x3fb856){if(_0x3fb856){return _0x3fb856?{'count':_0x127a3e,'rows':_0x3fb856}:null;}})[_0xf9e8('0x28')](respondWithResult(_0x4e44f5,null))[_0xf9e8('0x49')](handleError(_0x4e44f5,null));}; \ No newline at end of file +var _0x14ed=['show','params','rawAttributes','fields','find','create','role','user','SquareProjects','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','order','pick','nolimit','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','SquareProject','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','limit','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x14ed,0x14e));var _0xd14e=function(_0x4b7578,_0x4efe8c){_0x4b7578=_0x4b7578-0x0;var _0x2d8b45=_0x14ed[_0x4b7578];return _0x2d8b45;};'use strict';var emlformat=require(_0xd14e('0x0'));var rimraf=require(_0xd14e('0x1'));var zipdir=require(_0xd14e('0x2'));var jsonpatch=require(_0xd14e('0x3'));var rp=require(_0xd14e('0x4'));var moment=require(_0xd14e('0x5'));var BPromise=require(_0xd14e('0x6'));var Mustache=require(_0xd14e('0x7'));var util=require(_0xd14e('0x8'));var path=require(_0xd14e('0x9'));var sox=require('sox');var csv=require(_0xd14e('0xa'));var ejs=require(_0xd14e('0xb'));var fs=require('fs');var fs_extra=require(_0xd14e('0xc'));var _=require('lodash');var squel=require(_0xd14e('0xd'));var crypto=require(_0xd14e('0xe'));var jsforce=require(_0xd14e('0xf'));var deskjs=require(_0xd14e('0x10'));var toCsv=require(_0xd14e('0xa'));var querystring=require(_0xd14e('0x11'));var Papa=require(_0xd14e('0x12'));var Redis=require(_0xd14e('0x13'));var authService=require(_0xd14e('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd14e('0x15'));var hardwareService=require(_0xd14e('0x16'));var logger=require(_0xd14e('0x17'))(_0xd14e('0x18'));var utils=require(_0xd14e('0x19'));var config=require(_0xd14e('0x1a'));var licenseUtil=require(_0xd14e('0x1b'));var db=require(_0xd14e('0x1c'))['db'];config[_0xd14e('0x1d')]=_[_0xd14e('0x1e')](config[_0xd14e('0x1d')],{'host':_0xd14e('0x1f'),'port':0x18eb});var socket=require(_0xd14e('0x20'))(new Redis(config[_0xd14e('0x1d')]));require(_0xd14e('0x21'))['register'](socket);function respondWithStatusCode(_0x29d92,_0x2942ca){_0x2942ca=_0x2942ca||0xcc;return function(_0x1696e5){if(_0x1696e5){return _0x29d92[_0xd14e('0x22')](_0x2942ca);}return _0x29d92[_0xd14e('0x23')](_0x2942ca)['end']();};}function respondWithResult(_0x585cf0,_0x34e581){_0x34e581=_0x34e581||0xc8;return function(_0x43b179){if(_0x43b179){return _0x585cf0[_0xd14e('0x23')](_0x34e581)[_0xd14e('0x24')](_0x43b179);}};}function respondWithFilteredResult(_0x1e531c,_0x589443){return function(_0x40fa0f){if(_0x40fa0f){var _0x235368=typeof _0x589443['offset']===_0xd14e('0x25')&&typeof _0x589443['limit']===_0xd14e('0x25');var _0x1476c6=_0x40fa0f[_0xd14e('0x26')];var _0x2b7de7=_0x235368?0x0:_0x589443[_0xd14e('0x27')];var _0x3adf85=_0x235368?_0x40fa0f['count']:_0x589443[_0xd14e('0x27')]+_0x589443['limit'];var _0x2ecd0b;if(_0x3adf85>=_0x1476c6){_0x3adf85=_0x1476c6;_0x2ecd0b=0xc8;}else{_0x2ecd0b=0xce;}_0x1e531c['status'](_0x2ecd0b);return _0x1e531c[_0xd14e('0x28')](_0xd14e('0x29'),_0x2b7de7+'-'+_0x3adf85+'/'+_0x1476c6)[_0xd14e('0x24')](_0x40fa0f);}return null;};}function patchUpdates(_0x25fb74){return function(_0x2cea50){try{jsonpatch[_0xd14e('0x2a')](_0x2cea50,_0x25fb74,!![]);}catch(_0x25f3ac){return BPromise[_0xd14e('0x2b')](_0x25f3ac);}return _0x2cea50[_0xd14e('0x2c')]();};}function saveUpdates(_0x1842d5,_0x3ebd6f){return function(_0x1d168f){if(_0x1d168f){return _0x1d168f['update'](_0x1842d5)[_0xd14e('0x2d')](function(_0x26644a){return _0x26644a;});}return null;};}function removeEntity(_0x2c619e,_0x2b7fa3){return function(_0x4101a5){if(_0x4101a5){return _0x4101a5[_0xd14e('0x2e')]()[_0xd14e('0x2d')](function(){var _0x37f400=_0x4101a5[_0xd14e('0x2f')]({'plain':!![]});var _0x51c419='SquareProjects';return db[_0xd14e('0x30')][_0xd14e('0x2e')]({'where':{'type':_0x51c419,'resourceId':_0x37f400['id']}})[_0xd14e('0x2d')](function(){return _0x4101a5;});})[_0xd14e('0x2d')](function(){_0x2c619e[_0xd14e('0x23')](0xcc)[_0xd14e('0x31')]();});}};}function handleEntityNotFound(_0x41bf4d,_0x283985){return function(_0x5b93cc){if(!_0x5b93cc){_0x41bf4d[_0xd14e('0x22')](0x194);}return _0x5b93cc;};}function handleError(_0x243ad7,_0x52b466){_0x52b466=_0x52b466||0x1f4;return function(_0x1a8e50){logger[_0xd14e('0x32')](_0x1a8e50[_0xd14e('0x33')]);if(_0x1a8e50[_0xd14e('0x34')]){delete _0x1a8e50[_0xd14e('0x34')];}_0x243ad7['status'](_0x52b466)[_0xd14e('0x35')](_0x1a8e50);};}exports[_0xd14e('0x36')]=function(_0x5e879f,_0x1ce138){var _0x162f09={},_0x572c60={},_0x357454={'count':0x0,'rows':[]};var _0xbf564d=_[_0xd14e('0x37')](db[_0xd14e('0x38')]['rawAttributes'],function(_0x131afb){return{'name':_0x131afb['fieldName'],'type':_0x131afb[_0xd14e('0x39')][_0xd14e('0x3a')]};});_0x572c60[_0xd14e('0x3b')]=_[_0xd14e('0x37')](_0xbf564d,_0xd14e('0x34'));_0x572c60[_0xd14e('0x3c')]=_[_0xd14e('0x3d')](_0x5e879f[_0xd14e('0x3c')]);_0x572c60[_0xd14e('0x3e')]=_[_0xd14e('0x3f')](_0x572c60[_0xd14e('0x3b')],_0x572c60['query']);_0x162f09[_0xd14e('0x40')]=_[_0xd14e('0x3f')](_0x572c60[_0xd14e('0x3b')],qs['fields'](_0x5e879f[_0xd14e('0x3c')]['fields']));_0x162f09[_0xd14e('0x40')]=_0x162f09[_0xd14e('0x40')][_0xd14e('0x41')]?_0x162f09[_0xd14e('0x40')]:_0x572c60[_0xd14e('0x3b')];if(!_0x5e879f[_0xd14e('0x3c')][_0xd14e('0x42')]('nolimit')){_0x162f09['limit']=qs[_0xd14e('0x43')](_0x5e879f[_0xd14e('0x3c')]['limit']);_0x162f09['offset']=qs[_0xd14e('0x27')](_0x5e879f[_0xd14e('0x3c')][_0xd14e('0x27')]);}_0x162f09['order']=qs[_0xd14e('0x44')](_0x5e879f['query']['sort']);_0x162f09[_0xd14e('0x45')]=qs['filters'](_['pick'](_0x5e879f[_0xd14e('0x3c')],_0x572c60[_0xd14e('0x3e')]),_0xbf564d);if(_0x5e879f[_0xd14e('0x3c')]['filter']){_0x162f09[_0xd14e('0x45')]=_[_0xd14e('0x46')](_0x162f09[_0xd14e('0x45')],{'$or':_[_0xd14e('0x37')](_0xbf564d,function(_0x5e672d){if(_0x5e672d[_0xd14e('0x39')]!=='VIRTUAL'){var _0x4ec5ba={};_0x4ec5ba[_0x5e672d[_0xd14e('0x34')]]={'$like':'%'+_0x5e879f[_0xd14e('0x3c')][_0xd14e('0x47')]+'%'};return _0x4ec5ba;}})});}_0x162f09=_[_0xd14e('0x46')]({},_0x162f09,_0x5e879f[_0xd14e('0x48')]);var _0x24a04e={'where':_0x162f09[_0xd14e('0x45')]};return db[_0xd14e('0x38')]['count'](_0x24a04e)[_0xd14e('0x2d')](function(_0x45f11a){_0x357454[_0xd14e('0x26')]=_0x45f11a;if(_0x5e879f[_0xd14e('0x3c')][_0xd14e('0x49')]){_0x162f09[_0xd14e('0x4a')]=[{'all':!![]}];}return db['SquareProject'][_0xd14e('0x4b')](_0x162f09);})[_0xd14e('0x2d')](function(_0x3cd2e6){_0x357454[_0xd14e('0x4c')]=_0x3cd2e6;return _0x357454;})[_0xd14e('0x2d')](respondWithFilteredResult(_0x1ce138,_0x162f09))[_0xd14e('0x4d')](handleError(_0x1ce138,null));};exports[_0xd14e('0x4e')]=function(_0x448059,_0x838770){var _0x38c49d={'raw':![],'where':{'id':_0x448059[_0xd14e('0x4f')]['id']}},_0x11d4fb={};_0x11d4fb['model']=_['keys'](db[_0xd14e('0x38')][_0xd14e('0x50')]);_0x11d4fb[_0xd14e('0x3c')]=_['keys'](_0x448059['query']);_0x11d4fb[_0xd14e('0x3e')]=_[_0xd14e('0x3f')](_0x11d4fb[_0xd14e('0x3b')],_0x11d4fb[_0xd14e('0x3c')]);_0x38c49d[_0xd14e('0x40')]=_[_0xd14e('0x3f')](_0x11d4fb[_0xd14e('0x3b')],qs[_0xd14e('0x51')](_0x448059[_0xd14e('0x3c')][_0xd14e('0x51')]));_0x38c49d[_0xd14e('0x40')]=_0x38c49d[_0xd14e('0x40')][_0xd14e('0x41')]?_0x38c49d[_0xd14e('0x40')]:_0x11d4fb['model'];if(_0x448059['query'][_0xd14e('0x49')]){_0x38c49d[_0xd14e('0x4a')]=[{'all':!![]}];}_0x38c49d=_[_0xd14e('0x46')]({},_0x38c49d,_0x448059[_0xd14e('0x48')]);return db['SquareProject'][_0xd14e('0x52')](_0x38c49d)[_0xd14e('0x2d')](handleEntityNotFound(_0x838770,null))[_0xd14e('0x2d')](respondWithResult(_0x838770,null))['catch'](handleError(_0x838770,null));};exports[_0xd14e('0x53')]=function(_0x45c280,_0x3803c6){return db[_0xd14e('0x38')]['create'](_0x45c280['body'],{})[_0xd14e('0x2d')](function(_0x18622b){var _0x22ee5c=_0x45c280['user'][_0xd14e('0x2f')]({'plain':!![]});if(!_0x22ee5c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22ee5c[_0xd14e('0x54')]===_0xd14e('0x55')){var _0x52fcdc=_0x18622b[_0xd14e('0x2f')]({'plain':!![]});var _0x2342e9=_0xd14e('0x56');return db[_0xd14e('0x57')][_0xd14e('0x52')]({'where':{'name':_0x2342e9,'userProfileId':_0x22ee5c['userProfileId']},'raw':!![]})['then'](function(_0x3375ad){if(_0x3375ad&&_0x3375ad[_0xd14e('0x58')]===0x0){return db[_0xd14e('0x30')][_0xd14e('0x53')]({'name':_0x52fcdc[_0xd14e('0x34')],'resourceId':_0x52fcdc['id'],'type':_0x3375ad[_0xd14e('0x34')],'sectionId':_0x3375ad['id']},{})[_0xd14e('0x2d')](function(){return _0x18622b;});}else{return _0x18622b;}})['catch'](function(_0x4ecc0f){logger['error'](_0xd14e('0x59'),_0x4ecc0f);throw _0x4ecc0f;});}return _0x18622b;})[_0xd14e('0x2d')](respondWithResult(_0x3803c6,0xc9))[_0xd14e('0x4d')](handleError(_0x3803c6,null));};exports[_0xd14e('0x5a')]=function(_0x1177d3,_0x47af97){if(_0x1177d3[_0xd14e('0x5b')]['id']){delete _0x1177d3['body']['id'];}return db[_0xd14e('0x38')]['find']({'where':{'id':_0x1177d3['params']['id']}})[_0xd14e('0x2d')](handleEntityNotFound(_0x47af97,null))[_0xd14e('0x2d')](saveUpdates(_0x1177d3['body'],null))[_0xd14e('0x2d')](respondWithResult(_0x47af97,null))[_0xd14e('0x4d')](handleError(_0x47af97,null));};exports[_0xd14e('0x2e')]=function(_0x344daf,_0x1adf5c){return db['SquareProject']['find']({'where':{'id':_0x344daf['params']['id']}})[_0xd14e('0x2d')](handleEntityNotFound(_0x1adf5c,null))[_0xd14e('0x2d')](removeEntity(_0x1adf5c,null))['catch'](handleError(_0x1adf5c,null));};exports[_0xd14e('0x5c')]=function(_0x4c8d2d,_0x4e066f,_0x4b7728){return db[_0xd14e('0x38')][_0xd14e('0x52')]({'where':{'id':_0x4c8d2d['params']['id']}})[_0xd14e('0x2d')](handleEntityNotFound(_0x4e066f,null))[_0xd14e('0x2d')](function(_0x478ebd){if(_0x478ebd){return _0x478ebd['addUsers'](_0x4c8d2d['body'][_0xd14e('0x5d')],_[_0xd14e('0x5e')](_0x4c8d2d[_0xd14e('0x5b')],[_0xd14e('0x5d'),'id'])||{});}})[_0xd14e('0x2d')](respondWithResult(_0x4e066f,null))[_0xd14e('0x4d')](handleError(_0x4e066f,null));};exports[_0xd14e('0x5f')]=function(_0x2c676f,_0x5b1906,_0x546c2a){return db[_0xd14e('0x38')][_0xd14e('0x52')]({'where':{'id':_0x2c676f[_0xd14e('0x4f')]['id']}})[_0xd14e('0x2d')](handleEntityNotFound(_0x5b1906,null))[_0xd14e('0x2d')](function(_0x1db301){if(_0x1db301){return _0x1db301[_0xd14e('0x5f')](_0x2c676f[_0xd14e('0x3c')][_0xd14e('0x5d')])[_0xd14e('0x2d')](function(){if(_[_0xd14e('0x60')](_0x2c676f[_0xd14e('0x3c')]['ids'])){for(var _0x21736e=0x0;_0x21736e<_0x2c676f['query'][_0xd14e('0x5d')][_0xd14e('0x41')];_0x21736e+=0x1){socket[_0xd14e('0x61')]('userSquareProject:remove',{'UserId':Number(_0x2c676f['query'][_0xd14e('0x5d')][_0x21736e]),'SquareProjectId':Number(_0x2c676f[_0xd14e('0x4f')]['id'])});}}else{socket['emit'](_0xd14e('0x62'),{'UserId':Number(_0x2c676f[_0xd14e('0x3c')][_0xd14e('0x5d')]),'SquareProjectId':Number(_0x2c676f[_0xd14e('0x4f')]['id'])});}});}})[_0xd14e('0x2d')](respondWithStatusCode(_0x5b1906,null))[_0xd14e('0x4d')](handleError(_0x5b1906,null));};exports[_0xd14e('0x63')]=function(_0x519ce1,_0x2bdfb0,_0x3c2e7f){var _0x2ecf4e={};var _0x851f5f={};var _0x2b1bba;var _0x297011;return db['SquareProject']['findOne']({'where':{'id':_0x519ce1[_0xd14e('0x4f')]['id']}})[_0xd14e('0x2d')](handleEntityNotFound(_0x2bdfb0,null))[_0xd14e('0x2d')](function(_0xc0b49a){if(_0xc0b49a){_0x2b1bba=_0xc0b49a;_0x851f5f[_0xd14e('0x3b')]=_[_0xd14e('0x3d')](db['User']['rawAttributes']);_0x851f5f[_0xd14e('0x3c')]=_[_0xd14e('0x3d')](_0x519ce1[_0xd14e('0x3c')]);_0x851f5f[_0xd14e('0x3e')]=_[_0xd14e('0x3f')](_0x851f5f[_0xd14e('0x3b')],_0x851f5f['query']);_0x2ecf4e[_0xd14e('0x40')]=_[_0xd14e('0x3f')](_0x851f5f[_0xd14e('0x3b')],qs[_0xd14e('0x51')](_0x519ce1['query'][_0xd14e('0x51')]));_0x2ecf4e['attributes']=_0x2ecf4e[_0xd14e('0x40')][_0xd14e('0x41')]?_0x2ecf4e[_0xd14e('0x40')]:_0x851f5f[_0xd14e('0x3b')];_0x2ecf4e[_0xd14e('0x64')]=qs['sort'](_0x519ce1[_0xd14e('0x3c')]['sort']);_0x2ecf4e[_0xd14e('0x45')]=qs[_0xd14e('0x3e')](_[_0xd14e('0x65')](_0x519ce1[_0xd14e('0x3c')],_0x851f5f[_0xd14e('0x3e')]));if(_0x519ce1[_0xd14e('0x3c')][_0xd14e('0x47')]){_0x2ecf4e[_0xd14e('0x45')]=_[_0xd14e('0x46')](_0x2ecf4e[_0xd14e('0x45')],{'$or':_[_0xd14e('0x37')](_0x2ecf4e[_0xd14e('0x40')],function(_0x1c39a4){var _0x1ac2d0={};_0x1ac2d0[_0x1c39a4]={'$like':'%'+_0x519ce1['query'][_0xd14e('0x47')]+'%'};return _0x1ac2d0;})});}_0x2ecf4e=_[_0xd14e('0x46')]({},_0x2ecf4e,_0x519ce1[_0xd14e('0x48')]);return _0x2b1bba[_0xd14e('0x63')](_0x2ecf4e);}})[_0xd14e('0x2d')](function(_0x2e795e){if(_0x2e795e){_0x297011=_0x2e795e[_0xd14e('0x41')];if(!_0x519ce1[_0xd14e('0x3c')][_0xd14e('0x42')](_0xd14e('0x66'))){_0x2ecf4e[_0xd14e('0x43')]=qs['limit'](_0x519ce1['query']['limit']);_0x2ecf4e[_0xd14e('0x27')]=qs[_0xd14e('0x27')](_0x519ce1[_0xd14e('0x3c')][_0xd14e('0x27')]);}return _0x2b1bba[_0xd14e('0x63')](_0x2ecf4e);}})['then'](function(_0x358235){if(_0x358235){return _0x358235?{'count':_0x297011,'rows':_0x358235}:null;}})[_0xd14e('0x2d')](respondWithResult(_0x2bdfb0,null))[_0xd14e('0x4d')](handleError(_0x2bdfb0,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 659bf40..ac50007 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 _0x4931=['update','emit','../../mysqldb','setMaxListeners','save'];(function(_0x4aec3f,_0x2de89f){var _0x4f10cc=function(_0x325664){while(--_0x325664){_0x4aec3f['push'](_0x4aec3f['shift']());}};_0x4f10cc(++_0x2de89f);}(_0x4931,0x156));var _0x1493=function(_0x46a0e6,_0x2de79d){_0x46a0e6=_0x46a0e6-0x0;var _0x5bca17=_0x4931[_0x46a0e6];return _0x5bca17;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x1493('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1493('0x1')](0x0);var events={'afterCreate':_0x1493('0x2'),'afterUpdate':_0x1493('0x3'),'afterDestroy':'remove'};function emitEvent(_0x53d6be){return function(_0x1b069a,_0x97ccf0,_0x2b0b04){SquareProjectEvents[_0x1493('0x4')](_0x53d6be+':'+_0x1b069a['id'],_0x1b069a);SquareProjectEvents[_0x1493('0x4')](_0x53d6be,_0x1b069a);_0x2b0b04(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xa261=['remove','emit','exports','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x58a8fc,_0x3e2e2a){var _0x38b3f8=function(_0x2a48c1){while(--_0x2a48c1){_0x58a8fc['push'](_0x58a8fc['shift']());}};_0x38b3f8(++_0x3e2e2a);}(_0xa261,0x1f3));var _0x1a26=function(_0x4dfe41,_0x13061e){_0x4dfe41=_0x4dfe41-0x0;var _0x52680e=_0xa261[_0x4dfe41];return _0x52680e;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x1a26('0x0'))['db'][_0x1a26('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1a26('0x2')](0x0);var events={'afterCreate':_0x1a26('0x3'),'afterUpdate':_0x1a26('0x4'),'afterDestroy':_0x1a26('0x5')};function emitEvent(_0x5d7674){return function(_0x162769,_0x2fd03d,_0x4be39e){SquareProjectEvents[_0x1a26('0x6')](_0x5d7674+':'+_0x162769['id'],_0x162769);SquareProjectEvents[_0x1a26('0x6')](_0x5d7674,_0x162769);_0x4be39e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x1a26('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 91a2382..314a835 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 _0x736a=['changed','production','lodash','util','api','moment','request-promise','path','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4934d5,_0x35fada){var _0x378f91=function(_0x5bba6a){while(--_0x5bba6a){_0x4934d5['push'](_0x4934d5['shift']());}};_0x378f91(++_0x35fada);}(_0x736a,0x123));var _0xa736=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x736a[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0xa736('0x0'));var util=require(_0xa736('0x1'));var logger=require('../../config/logger')(_0xa736('0x2'));var moment=require(_0xa736('0x3'));var BPromise=require('bluebird');var rp=require(_0xa736('0x4'));var fs=require('fs');var path=require(_0xa736('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa736('0x6'));module[_0xa736('0x7')]=function(_0x2e6adb,_0x2e68a7){return _0x2e6adb[_0xa736('0x8')](_0xa736('0x9'),attributes,{'tableName':_0xa736('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x166088,_0x135c8d,_0x1b37f1){if(_0x166088['changed'](_0xa736('0xb'))){_0x166088[_0xa736('0xc')]=moment()[_0xa736('0xd')](_0xa736('0xe'));}if(_0x166088[_0xa736('0xf')](_0xa736('0x10'))){_0x166088['publishedAt']=moment()[_0xa736('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1b37f1(null,_0x166088);}}});}; \ No newline at end of file +var _0xcf4e=['square_projects','changed','format','YYYY-MM-DD\x20HH:mm:ss','production','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareProject'];(function(_0x4e8703,_0x5ec25e){var _0x4b3e5f=function(_0x36a159){while(--_0x36a159){_0x4e8703['push'](_0x4e8703['shift']());}};_0x4b3e5f(++_0x5ec25e);}(_0xcf4e,0x1ae));var _0xecf4=function(_0x16cb5b,_0x29bcec){_0x16cb5b=_0x16cb5b-0x0;var _0x28177e=_0xcf4e[_0x16cb5b];return _0x28177e;};'use strict';var _=require(_0xecf4('0x0'));var util=require(_0xecf4('0x1'));var logger=require(_0xecf4('0x2'))('api');var moment=require(_0xecf4('0x3'));var BPromise=require(_0xecf4('0x4'));var rp=require(_0xecf4('0x5'));var fs=require('fs');var path=require(_0xecf4('0x6'));var rimraf=require(_0xecf4('0x7'));var config=require(_0xecf4('0x8'));var attributes=require('./squareProject.attributes');module[_0xecf4('0x9')]=function(_0x4c6cfc,_0x52486f){return _0x4c6cfc[_0xecf4('0xa')](_0xecf4('0xb'),attributes,{'tableName':_0xecf4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x27dcd7,_0x387f66,_0x5a7d17){if(_0x27dcd7[_0xecf4('0xd')]('preproduction')){_0x27dcd7['savedAt']=moment()[_0xecf4('0xe')](_0xecf4('0xf'));}if(_0x27dcd7[_0xecf4('0xd')](_0xecf4('0x10'))){_0x27dcd7['publishedAt']=moment()[_0xecf4('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5a7d17(null,_0x27dcd7);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index d3e79cf..9ec0655 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 _0x859b=['SquareProject,\x20%s,\x20%s','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowSquareProject','find','options','where','attributes','include','map','model','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','then','info'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x859b,0x1ec));var _0xb859=function(_0x2139a0,_0x52b021){_0x2139a0=_0x2139a0-0x0;var _0x226dfa=_0x859b[_0x2139a0];return _0x226dfa;};'use strict';var _=require(_0xb859('0x0'));var util=require('util');var moment=require(_0xb859('0x1'));var BPromise=require('bluebird');var rs=require(_0xb859('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb859('0x3'))['db'];var utils=require(_0xb859('0x4'));var logger=require(_0xb859('0x5'))(_0xb859('0x6'));var config=require(_0xb859('0x7'));var jayson=require(_0xb859('0x8'));var client=jayson[_0xb859('0x9')][_0xb859('0xa')]({'port':0x232a});config[_0xb859('0xb')]=_[_0xb859('0xc')](config[_0xb859('0xb')],{'host':_0xb859('0xd'),'port':0x18eb});var socket=require(_0xb859('0xe'))(new Redis(config['redis']));require(_0xb859('0xf'))['register'](socket);function respondWithRpcPromise(_0x2e31ef,_0x9bf7fe,_0x4a3da3){return new BPromise(function(_0x111287,_0x5cd34c){return client['request'](_0x2e31ef,_0x4a3da3)[_0xb859('0x10')](function(_0x123e68){logger[_0xb859('0x11')](_0xb859('0x12'),_0x9bf7fe,'request\x20sent');logger['debug'](_0xb859('0x13'),_0x9bf7fe,_0xb859('0x14'),JSON[_0xb859('0x15')](_0x123e68));if(_0x123e68['error']){if(_0x123e68[_0xb859('0x16')][_0xb859('0x17')]===0x1f4){logger[_0xb859('0x16')](_0xb859('0x12'),_0x9bf7fe,_0x123e68['error']['message']);return _0x5cd34c(_0x123e68[_0xb859('0x16')]['message']);}logger[_0xb859('0x16')](_0xb859('0x12'),_0x9bf7fe,_0x123e68['error'][_0xb859('0x18')]);return _0x111287(_0x123e68[_0xb859('0x16')]['message']);}else{logger[_0xb859('0x11')](_0xb859('0x12'),_0x9bf7fe,'request\x20sent');_0x111287(_0x123e68['result'][_0xb859('0x18')]);}})[_0xb859('0x19')](function(_0x41bf3c){logger[_0xb859('0x16')](_0xb859('0x12'),_0x9bf7fe,_0x41bf3c);_0x5cd34c(_0x41bf3c);});});}exports[_0xb859('0x1a')]=function(_0x10c024){var _0x235b77=this;return new Promise(function(_0xbd4f92,_0x35d032){return db['SquareProject'][_0xb859('0x1b')]({'raw':_0x10c024['options']?_0x10c024[_0xb859('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x10c024['options']?_0x10c024['options'][_0xb859('0x1d')]||null:null,'attributes':_0x10c024[_0xb859('0x1c')]?_0x10c024['options'][_0xb859('0x1e')]||null:null,'include':_0x10c024[_0xb859('0x1c')]?_0x10c024['options'][_0xb859('0x1f')]?_[_0xb859('0x20')](_0x10c024['options'][_0xb859('0x1f')],function(_0x16478b){return{'model':db[_0x16478b['model']],'as':_0x16478b['as'],'attributes':_0x16478b[_0xb859('0x1e')],'include':_0x16478b['include']?_[_0xb859('0x20')](_0x16478b[_0xb859('0x1f')],function(_0x5e8a0a){return{'model':db[_0x5e8a0a[_0xb859('0x21')]],'as':_0x5e8a0a['as'],'attributes':_0x5e8a0a['attributes'],'include':_0x5e8a0a['include']?_[_0xb859('0x20')](_0x5e8a0a[_0xb859('0x1f')],function(_0x41afbb){return{'model':db[_0x41afbb[_0xb859('0x21')]],'as':_0x41afbb['as'],'attributes':_0x41afbb[_0xb859('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb859('0x10')](function(_0x3f2bd8){logger[_0xb859('0x11')]('ShowSquareProject',_0x10c024);logger['debug'](_0xb859('0x1a'),_0x10c024,JSON[_0xb859('0x15')](_0x3f2bd8));_0xbd4f92(_0x3f2bd8);})[_0xb859('0x19')](function(_0xb7f799){logger[_0xb859('0x16')](_0xb859('0x1a'),_0xb7f799['message'],_0x10c024);_0x35d032(_0x235b77[_0xb859('0x16')](0x1f4,_0xb7f799[_0xb859('0x18')]));});});}; \ No newline at end of file +var _0x25c5=['info','request\x20sent','debug','code','error','SquareProject,\x20%s,\x20%s','message','result','catch','SquareProject','find','options','raw','map','include','attributes','model','ShowSquareProject','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then'];(function(_0x2a74a6,_0x10592f){var _0xc2e34a=function(_0x8497c9){while(--_0x8497c9){_0x2a74a6['push'](_0x2a74a6['shift']());}};_0xc2e34a(++_0x10592f);}(_0x25c5,0x116));var _0x525c=function(_0x405385,_0x56f573){_0x405385=_0x405385-0x0;var _0x43837b=_0x25c5[_0x405385];return _0x43837b;};'use strict';var _=require(_0x525c('0x0'));var util=require(_0x525c('0x1'));var moment=require(_0x525c('0x2'));var BPromise=require(_0x525c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x525c('0x4'))['db'];var utils=require(_0x525c('0x5'));var logger=require(_0x525c('0x6'))('rpc');var config=require(_0x525c('0x7'));var jayson=require(_0x525c('0x8'));var client=jayson[_0x525c('0x9')]['http']({'port':0x232a});config[_0x525c('0xa')]=_[_0x525c('0xb')](config[_0x525c('0xa')],{'host':_0x525c('0xc'),'port':0x18eb});var socket=require(_0x525c('0xd'))(new Redis(config[_0x525c('0xa')]));require(_0x525c('0xe'))[_0x525c('0xf')](socket);function respondWithRpcPromise(_0x54cf11,_0x11a687,_0x1300f3){return new BPromise(function(_0x119817,_0x362fd6){return client[_0x525c('0x10')](_0x54cf11,_0x1300f3)[_0x525c('0x11')](function(_0x56caea){logger[_0x525c('0x12')]('SquareProject,\x20%s,\x20%s',_0x11a687,_0x525c('0x13'));logger[_0x525c('0x14')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x11a687,_0x525c('0x13'),JSON['stringify'](_0x56caea));if(_0x56caea['error']){if(_0x56caea['error'][_0x525c('0x15')]===0x1f4){logger[_0x525c('0x16')](_0x525c('0x17'),_0x11a687,_0x56caea[_0x525c('0x16')][_0x525c('0x18')]);return _0x362fd6(_0x56caea['error'][_0x525c('0x18')]);}logger[_0x525c('0x16')](_0x525c('0x17'),_0x11a687,_0x56caea['error'][_0x525c('0x18')]);return _0x119817(_0x56caea[_0x525c('0x16')][_0x525c('0x18')]);}else{logger[_0x525c('0x12')](_0x525c('0x17'),_0x11a687,_0x525c('0x13'));_0x119817(_0x56caea[_0x525c('0x19')][_0x525c('0x18')]);}})[_0x525c('0x1a')](function(_0x4aad75){logger[_0x525c('0x16')]('SquareProject,\x20%s,\x20%s',_0x11a687,_0x4aad75);_0x362fd6(_0x4aad75);});});}exports['ShowSquareProject']=function(_0x1b98e6){var _0x47aac0=this;return new Promise(function(_0x3b37b3,_0x9a5dfd){return db[_0x525c('0x1b')][_0x525c('0x1c')]({'raw':_0x1b98e6[_0x525c('0x1d')]?_0x1b98e6[_0x525c('0x1d')][_0x525c('0x1e')]===undefined?!![]:![]:!![],'where':_0x1b98e6[_0x525c('0x1d')]?_0x1b98e6['options']['where']||null:null,'attributes':_0x1b98e6[_0x525c('0x1d')]?_0x1b98e6[_0x525c('0x1d')]['attributes']||null:null,'include':_0x1b98e6[_0x525c('0x1d')]?_0x1b98e6['options']['include']?_[_0x525c('0x1f')](_0x1b98e6[_0x525c('0x1d')][_0x525c('0x20')],function(_0x31af21){return{'model':db[_0x31af21['model']],'as':_0x31af21['as'],'attributes':_0x31af21[_0x525c('0x21')],'include':_0x31af21[_0x525c('0x20')]?_[_0x525c('0x1f')](_0x31af21[_0x525c('0x20')],function(_0x312713){return{'model':db[_0x312713['model']],'as':_0x312713['as'],'attributes':_0x312713[_0x525c('0x21')],'include':_0x312713[_0x525c('0x20')]?_[_0x525c('0x1f')](_0x312713[_0x525c('0x20')],function(_0x5d3f3d){return{'model':db[_0x5d3f3d[_0x525c('0x22')]],'as':_0x5d3f3d['as'],'attributes':_0x5d3f3d[_0x525c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x525c('0x11')](function(_0x2e9362){logger[_0x525c('0x12')]('ShowSquareProject',_0x1b98e6);logger['debug'](_0x525c('0x23'),_0x1b98e6,JSON[_0x525c('0x24')](_0x2e9362));_0x3b37b3(_0x2e9362);})[_0x525c('0x1a')](function(_0x440865){logger['error'](_0x525c('0x23'),_0x440865[_0x525c('0x18')],_0x1b98e6);_0x9a5dfd(_0x47aac0[_0x525c('0x16')](0x1f4,_0x440865[_0x525c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 9fdedd0..0de3df2 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 _0x7cde=['emit','removeListener','register','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x4b9dc7,_0x32c91a){var _0x385d6e=function(_0x8f8666){while(--_0x8f8666){_0x4b9dc7['push'](_0x4b9dc7['shift']());}};_0x385d6e(++_0x32c91a);}(_0x7cde,0xdd));var _0xe7cd=function(_0x393f96,_0x47e716){_0x393f96=_0x393f96-0x0;var _0x4ecb2d=_0x7cde[_0x393f96];return _0x4ecb2d;};'use strict';var SquareProjectEvents=require(_0xe7cd('0x0'));var events=[_0xe7cd('0x1'),_0xe7cd('0x2'),_0xe7cd('0x3')];function createListener(_0x5a5af8,_0x29cd55){return function(_0x575849){_0x29cd55[_0xe7cd('0x4')](_0x5a5af8,_0x575849);};}function removeListener(_0x649645,_0x4c4ebc){return function(){SquareProjectEvents[_0xe7cd('0x5')](_0x649645,_0x4c4ebc);};}exports[_0xe7cd('0x6')]=function(_0x32cbfa){for(var _0x1b5c0a=0x0,_0x1b6645=events[_0xe7cd('0x7')];_0x1b5c0a<_0x1b6645;_0x1b5c0a++){var _0x4b409b=events[_0x1b5c0a];var _0x678937=createListener(_0xe7cd('0x8')+_0x4b409b,_0x32cbfa);SquareProjectEvents['on'](_0x4b409b,_0x678937);}}; \ No newline at end of file +var _0xe3a1=['removeListener','register','length','squareProject:','./squareProject.events','remove','update','emit'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0xe3a1,0x16c));var _0x1e3a=function(_0x2f7afe,_0x3fa29b){_0x2f7afe=_0x2f7afe-0x0;var _0x1a3e7e=_0xe3a1[_0x2f7afe];return _0x1a3e7e;};'use strict';var SquareProjectEvents=require(_0x1e3a('0x0'));var events=['save',_0x1e3a('0x1'),_0x1e3a('0x2')];function createListener(_0x134c5e,_0x308cd2){return function(_0x142494){_0x308cd2[_0x1e3a('0x3')](_0x134c5e,_0x142494);};}function removeListener(_0x235e12,_0x566957){return function(){SquareProjectEvents[_0x1e3a('0x4')](_0x235e12,_0x566957);};}exports[_0x1e3a('0x5')]=function(_0x1bcdab){for(var _0x1ba7b7=0x0,_0x175fed=events[_0x1e3a('0x6')];_0x1ba7b7<_0x175fed;_0x1ba7b7++){var _0x579c8d=events[_0x1ba7b7];var _0x2235ec=createListener(_0x1e3a('0x7')+_0x579c8d,_0x1bcdab);SquareProjectEvents['on'](_0x579c8d,_0x2235ec);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 0550969..070c123 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x42a3d4,_0x1ab285){var _0x4c59e9=function(_0x53770f){while(--_0x53770f){_0x42a3d4['push'](_0x42a3d4['shift']());}};_0x4c59e9(++_0x1ab285);}(_0x4975,0x86));var _0x5497=function(_0x450e86,_0x4076b8){_0x450e86=_0x450e86-0x0;var _0x12f5ed=_0x4975[_0x450e86];return _0x12f5ed;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x323264,_0x45c6b2){var _0x1732bd=function(_0x4c48fc){while(--_0x4c48fc){_0x323264['push'](_0x323264['shift']());}};_0x1732bd(++_0x45c6b2);}(_0x814b,0x1a2));var _0xb814=function(_0x4d593e,_0x131776){_0x4d593e=_0x4d593e-0x0;var _0x31e2df=_0x814b[_0x4d593e];return _0x31e2df;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index e61d6b8..0b30590 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 _0x6aa7=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x1e830c,_0x31776b){var _0x3196e9=function(_0xfe5078){while(--_0xfe5078){_0x1e830c['push'](_0x1e830c['shift']());}};_0x3196e9(++_0x31776b);}(_0x6aa7,0x178));var _0x76aa=function(_0x11ceab,_0x1fc260){_0x11ceab=_0x11ceab-0x0;var _0x1298ad=_0x6aa7[_0x11ceab];return _0x1298ad;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'callerid':{'type':Sequelize[_0x76aa('0x1')]},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'context':{'type':Sequelize[_0x76aa('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x1')]},'accountcode':{'type':Sequelize[_0x76aa('0x1')]},'dnid':{'type':Sequelize[_0x76aa('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x76aa('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x76aa('0x2')],'get':function(){var _0x36d12b='';var _0xa9b695=this['getDataValue'](_0x76aa('0x3'));if(_0xa9b695){_0x36d12b=_0xa9b695[_0x76aa('0x4')](_0xa9b695[_0x76aa('0x5')]('.'));}return _0x36d12b;}}}; \ No newline at end of file +var _0xd6d6=['substring','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x32ccdf,_0x39f9d2){var _0x17a47d=function(_0x3fac00){while(--_0x3fac00){_0x32ccdf['push'](_0x32ccdf['shift']());}};_0x17a47d(++_0x39f9d2);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x45b6b8,_0x14e0ac){_0x45b6b8=_0x45b6b8-0x0;var _0x4d12dd=_0xd6d6[_0x45b6b8];return _0x4d12dd;};'use strict';var Sequelize=require(_0x6d6d('0x0'));module[_0x6d6d('0x1')]={'uniqueid':{'type':Sequelize[_0x6d6d('0x2')]},'callerid':{'type':Sequelize[_0x6d6d('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6d6d('0x2')]},'extension':{'type':Sequelize[_0x6d6d('0x2')]},'priority':{'type':Sequelize[_0x6d6d('0x2')]},'accountcode':{'type':Sequelize[_0x6d6d('0x2')]},'dnid':{'type':Sequelize[_0x6d6d('0x2')]},'projectName':{'type':Sequelize[_0x6d6d('0x2')]},'saveName':{'type':Sequelize[_0x6d6d('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x6d6d('0x2')]},'format':{'type':Sequelize[_0x6d6d('0x3')],'get':function(){var _0x44f83d='';var _0x18f824=this[_0x6d6d('0x4')](_0x6d6d('0x5'));if(_0x18f824){_0x44f83d=_0x18f824[_0x6d6d('0x6')](_0x18f824['lastIndexOf']('.'));}return _0x44f83d;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 29f2bda..533a373 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 _0x1688=['unlinkSync','.cypher','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SquareRecording','findAll','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x1688,0x128));var _0x8168=function(_0x3f27e9,_0x25c132){_0x3f27e9=_0x3f27e9-0x0;var _0x4df220=_0x1688[_0x3f27e9];return _0x4df220;};'use strict';var emlformat=require(_0x8168('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8168('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8168('0x2'));var moment=require(_0x8168('0x3'));var BPromise=require(_0x8168('0x4'));var Mustache=require(_0x8168('0x5'));var util=require(_0x8168('0x6'));var path=require(_0x8168('0x7'));var sox=require(_0x8168('0x8'));var csv=require(_0x8168('0x9'));var ejs=require(_0x8168('0xa'));var fs=require('fs');var fs_extra=require(_0x8168('0xb'));var _=require('lodash');var squel=require(_0x8168('0xc'));var crypto=require('crypto');var jsforce=require(_0x8168('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8168('0x9'));var querystring=require(_0x8168('0xe'));var Papa=require(_0x8168('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8168('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8168('0x11'));var logger=require(_0x8168('0x12'))(_0x8168('0x13'));var utils=require(_0x8168('0x14'));var config=require(_0x8168('0x15'));var licenseUtil=require(_0x8168('0x16'));var db=require(_0x8168('0x17'))['db'];function respondWithStatusCode(_0xd222e8,_0x4eda31){_0x4eda31=_0x4eda31||0xcc;return function(_0x492f22){if(_0x492f22){return _0xd222e8[_0x8168('0x18')](_0x4eda31);}return _0xd222e8[_0x8168('0x19')](_0x4eda31)['end']();};}function respondWithResult(_0x303b68,_0xd0826d){_0xd0826d=_0xd0826d||0xc8;return function(_0x44217d){if(_0x44217d){return _0x303b68['status'](_0xd0826d)[_0x8168('0x1a')](_0x44217d);}};}function respondWithFilteredResult(_0x19ed4c,_0x531710){return function(_0x443c85){if(_0x443c85){var _0x42a1db=typeof _0x531710[_0x8168('0x1b')]===_0x8168('0x1c')&&typeof _0x531710[_0x8168('0x1d')]===_0x8168('0x1c');var _0x5b4165=_0x443c85['count'];var _0x1ee87d=_0x42a1db?0x0:_0x531710['offset'];var _0x3ce61d=_0x42a1db?_0x443c85[_0x8168('0x1e')]:_0x531710[_0x8168('0x1b')]+_0x531710[_0x8168('0x1d')];var _0x57fe83;if(_0x3ce61d>=_0x5b4165){_0x3ce61d=_0x5b4165;_0x57fe83=0xc8;}else{_0x57fe83=0xce;}_0x19ed4c[_0x8168('0x19')](_0x57fe83);return _0x19ed4c[_0x8168('0x1f')](_0x8168('0x20'),_0x1ee87d+'-'+_0x3ce61d+'/'+_0x5b4165)['json'](_0x443c85);}return null;};}function patchUpdates(_0x950f6f){return function(_0x28815a){try{jsonpatch[_0x8168('0x21')](_0x28815a,_0x950f6f,!![]);}catch(_0x26d85e){return BPromise[_0x8168('0x22')](_0x26d85e);}return _0x28815a[_0x8168('0x23')]();};}function saveUpdates(_0x3edf6b,_0x238ad7){return function(_0x3a3d37){if(_0x3a3d37){return _0x3a3d37[_0x8168('0x24')](_0x3edf6b)[_0x8168('0x25')](function(_0xe9c612){return _0xe9c612;});}return null;};}function removeEntity(_0x7e4fea,_0x1175e1){return function(_0x4787b7){if(_0x4787b7){return _0x4787b7[_0x8168('0x26')]()[_0x8168('0x25')](function(){_0x7e4fea['status'](0xcc)[_0x8168('0x27')]();});}};}function handleEntityNotFound(_0x41f7dc,_0x10d8f9){return function(_0x420162){if(!_0x420162){_0x41f7dc['sendStatus'](0x194);}return _0x420162;};}function handleError(_0x6cd415,_0x2d2909){_0x2d2909=_0x2d2909||0x1f4;return function(_0x3953a4){logger[_0x8168('0x28')](_0x3953a4['stack']);if(_0x3953a4[_0x8168('0x29')]){delete _0x3953a4[_0x8168('0x29')];}_0x6cd415[_0x8168('0x19')](_0x2d2909)[_0x8168('0x2a')](_0x3953a4);};}exports['index']=function(_0x52f5b2,_0x5fca86){var _0x4107e1={},_0x51f7f1={},_0x41c6d9={'count':0x0,'rows':[]};var _0x389ca9=_[_0x8168('0x2b')](db['SquareRecording'][_0x8168('0x2c')],function(_0x516403){return{'name':_0x516403[_0x8168('0x2d')],'type':_0x516403[_0x8168('0x2e')][_0x8168('0x2f')]};});_0x51f7f1[_0x8168('0x30')]=_['map'](_0x389ca9,_0x8168('0x29'));_0x51f7f1['query']=_[_0x8168('0x31')](_0x52f5b2[_0x8168('0x32')]);_0x51f7f1[_0x8168('0x33')]=_[_0x8168('0x34')](_0x51f7f1[_0x8168('0x30')],_0x51f7f1[_0x8168('0x32')]);_0x4107e1[_0x8168('0x35')]=_['intersection'](_0x51f7f1[_0x8168('0x30')],qs[_0x8168('0x36')](_0x52f5b2[_0x8168('0x32')][_0x8168('0x36')]));_0x4107e1['attributes']=_0x4107e1[_0x8168('0x35')][_0x8168('0x37')]?_0x4107e1[_0x8168('0x35')]:_0x51f7f1[_0x8168('0x30')];if(!_0x52f5b2['query'][_0x8168('0x38')](_0x8168('0x39'))){_0x4107e1[_0x8168('0x1d')]=qs[_0x8168('0x1d')](_0x52f5b2[_0x8168('0x32')][_0x8168('0x1d')]);_0x4107e1[_0x8168('0x1b')]=qs[_0x8168('0x1b')](_0x52f5b2[_0x8168('0x32')]['offset']);}_0x4107e1[_0x8168('0x3a')]=qs[_0x8168('0x3b')](_0x52f5b2['query']['sort']);_0x4107e1[_0x8168('0x3c')]=qs[_0x8168('0x33')](_[_0x8168('0x3d')](_0x52f5b2[_0x8168('0x32')],_0x51f7f1[_0x8168('0x33')]),_0x389ca9);if(_0x52f5b2[_0x8168('0x32')][_0x8168('0x3e')]){_0x4107e1[_0x8168('0x3c')]=_[_0x8168('0x3f')](_0x4107e1['where'],{'$or':_['map'](_0x389ca9,function(_0x1ed50e){if(_0x1ed50e[_0x8168('0x2e')]!==_0x8168('0x40')){var _0x24d0d2={};_0x24d0d2[_0x1ed50e[_0x8168('0x29')]]={'$like':'%'+_0x52f5b2[_0x8168('0x32')]['filter']+'%'};return _0x24d0d2;}})});}_0x4107e1=_[_0x8168('0x3f')]({},_0x4107e1,_0x52f5b2[_0x8168('0x41')]);var _0x4fa135={'where':_0x4107e1[_0x8168('0x3c')]};return db['SquareRecording'][_0x8168('0x1e')](_0x4fa135)[_0x8168('0x25')](function(_0x2ed220){_0x41c6d9[_0x8168('0x1e')]=_0x2ed220;if(_0x52f5b2['query'][_0x8168('0x42')]){_0x4107e1[_0x8168('0x43')]=[{'all':!![]}];}return db[_0x8168('0x44')][_0x8168('0x45')](_0x4107e1);})[_0x8168('0x25')](function(_0x5b2415){_0x41c6d9['rows']=_0x5b2415;return _0x41c6d9;})[_0x8168('0x25')](respondWithFilteredResult(_0x5fca86,_0x4107e1))[_0x8168('0x46')](handleError(_0x5fca86,null));};exports[_0x8168('0x47')]=function(_0xb25092,_0x3039cf){var _0x515921={'raw':!![],'where':{'id':_0xb25092[_0x8168('0x48')]['id']}},_0x1d827b={};_0x1d827b[_0x8168('0x30')]=_['keys'](db[_0x8168('0x44')][_0x8168('0x2c')]);_0x1d827b['query']=_[_0x8168('0x31')](_0xb25092[_0x8168('0x32')]);_0x1d827b[_0x8168('0x33')]=_[_0x8168('0x34')](_0x1d827b[_0x8168('0x30')],_0x1d827b[_0x8168('0x32')]);_0x515921[_0x8168('0x35')]=_[_0x8168('0x34')](_0x1d827b[_0x8168('0x30')],qs['fields'](_0xb25092[_0x8168('0x32')][_0x8168('0x36')]));_0x515921[_0x8168('0x35')]=_0x515921[_0x8168('0x35')][_0x8168('0x37')]?_0x515921[_0x8168('0x35')]:_0x1d827b[_0x8168('0x30')];if(_0xb25092[_0x8168('0x32')][_0x8168('0x42')]){_0x515921[_0x8168('0x43')]=[{'all':!![]}];}_0x515921=_[_0x8168('0x3f')]({},_0x515921,_0xb25092[_0x8168('0x41')]);return db['SquareRecording'][_0x8168('0x49')](_0x515921)[_0x8168('0x25')](handleEntityNotFound(_0x3039cf,null))[_0x8168('0x25')](respondWithResult(_0x3039cf,null))[_0x8168('0x46')](handleError(_0x3039cf,null));};exports[_0x8168('0x4a')]=function(_0x51e538,_0x440acb){return db[_0x8168('0x44')][_0x8168('0x4a')](_0x51e538[_0x8168('0x4b')],{})[_0x8168('0x25')](respondWithResult(_0x440acb,0xc9))[_0x8168('0x46')](handleError(_0x440acb,null));};exports[_0x8168('0x24')]=function(_0x260811,_0x15d8c7){if(_0x260811[_0x8168('0x4b')]['id']){delete _0x260811[_0x8168('0x4b')]['id'];}return db[_0x8168('0x44')][_0x8168('0x49')]({'where':{'id':_0x260811['params']['id']}})[_0x8168('0x25')](handleEntityNotFound(_0x15d8c7,null))['then'](saveUpdates(_0x260811[_0x8168('0x4b')],null))[_0x8168('0x25')](respondWithResult(_0x15d8c7,null))[_0x8168('0x46')](handleError(_0x15d8c7,null));};exports[_0x8168('0x4c')]=function(_0xa7577,_0x393e74,_0x1894b5){var _0xccfbd3=require(_0x8168('0x4d'));var _0x4b3b58=![];var _0x5b06d4={};if(_0xa7577['query'][_0x8168('0x2e')]&&_0xa7577[_0x8168('0x32')]['type']==='uniqueid'){_0x5b06d4[_0x8168('0x4e')]=_0xa7577[_0x8168('0x48')]['id'];}else{_0x5b06d4['id']=_0xa7577[_0x8168('0x48')]['id'];}return db[_0x8168('0x44')]['find']({'where':_0x5b06d4,'attributes':['id',_0x8168('0x4f'),_0x8168('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x393e74,null))[_0x8168('0x25')](function(_0x22f5d8){if(_0x22f5d8){var _0x561304=_0x22f5d8[_0x8168('0x4f')];var _0xd4edf2=util[_0x8168('0x51')]('%s.cypher',_0x561304);if(fs[_0x8168('0x52')](_0xd4edf2)){_0x4b3b58=!![];return _0xccfbd3[_0x8168('0x53')](_0xd4edf2,_0x561304,config[_0x8168('0x54')]['recording'])[_0x8168('0x25')](function(){return _0x22f5d8;});}return _0x22f5d8;}})[_0x8168('0x25')](function(_0x5f3e1d){if(_0x5f3e1d){var _0x3a73b3=_0x5f3e1d['savePath'];if(!fs[_0x8168('0x52')](_0x3a73b3)){throw new db['Sequelize'][(_0x8168('0x55'))](_0x8168('0x56'));}if(_0x5f3e1d[_0x8168('0x50')]){return _0x393e74[_0x8168('0x4c')](_0x3a73b3,_0x5f3e1d['filename']+path[_0x8168('0x57')](_0x3a73b3),function(){if(_0x4b3b58){fs['unlink'](_0x3a73b3);}});}else{return _0x393e74[_0x8168('0x4c')](_0x3a73b3,function(_0x23a053){if(_0x4b3b58){fs[_0x8168('0x58')](_0x3a73b3);}});}}})[_0x8168('0x46')](function(_0x17844a){if(_0x17844a[_0x8168('0x59')]===_0x8168('0x56')){_0x393e74['status'](0x194)[_0x8168('0x2a')]('Not\x20found');}else{return handleError(_0x393e74,null);}});};exports[_0x8168('0x26')]=function(_0x5b7aa4,_0x298eff){return db[_0x8168('0x44')]['find']({'where':{'id':_0x5b7aa4[_0x8168('0x48')]['id']}})[_0x8168('0x25')](function(_0x11cdad){if(_['isNil'](_0x11cdad)){throw new ReferenceError(_0x8168('0x5a'));}return _0x11cdad;})['then'](function(_0x409566){var _0x49e900=_0x409566[_0x8168('0x4f')];logger[_0x8168('0x5b')](_0x8168('0x5c'),_0x49e900);if(!_[_0x8168('0x5d')](_0x409566['savePath'])&&fs['existsSync'](_0x49e900)){logger[_0x8168('0x5b')](_0x8168('0x5e')+_0x49e900+_0x8168('0x5f'));fs[_0x8168('0x60')](_0x49e900);}_0x49e900=_0x49e900+_0x8168('0x61');if(!_['isNil'](_0x409566[_0x8168('0x4f')])&&fs[_0x8168('0x52')](_0x49e900)){logger[_0x8168('0x5b')]('File:\x20\x22'+_0x49e900+_0x8168('0x5f'));fs[_0x8168('0x60')](_0x49e900);}return _0x409566;})[_0x8168('0x25')](function(_0x1631df){if(!_0x1631df)throw new InternalError();return _0x1631df[_0x8168('0x26')]();})[_0x8168('0x25')](function(){_0x298eff[_0x8168('0x19')](0xcc)['end']();})[_0x8168('0x46')](handleError(_0x298eff,null));}; \ No newline at end of file +var _0x68a3=['find','create','params','body','../../components/encryptor','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','ValidationError','SquareRecording\x20not\x20found','download','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','SquareRecording','includeAll','include','rows','catch','show','length'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x68a3,0x81));var _0x368a=function(_0x51674a,_0x2ca337){_0x51674a=_0x51674a-0x0;var _0x4a1f4e=_0x68a3[_0x51674a];return _0x4a1f4e;};'use strict';var emlformat=require(_0x368a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x368a('0x1'));var jsonpatch=require(_0x368a('0x2'));var rp=require('request-promise');var moment=require(_0x368a('0x3'));var BPromise=require(_0x368a('0x4'));var Mustache=require(_0x368a('0x5'));var util=require(_0x368a('0x6'));var path=require(_0x368a('0x7'));var sox=require(_0x368a('0x8'));var csv=require(_0x368a('0x9'));var ejs=require(_0x368a('0xa'));var fs=require('fs');var fs_extra=require(_0x368a('0xb'));var _=require(_0x368a('0xc'));var squel=require(_0x368a('0xd'));var crypto=require(_0x368a('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x368a('0x9'));var querystring=require(_0x368a('0xf'));var Papa=require(_0x368a('0x10'));var Redis=require(_0x368a('0x11'));var authService=require(_0x368a('0x12'));var qs=require(_0x368a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x368a('0x14'));var logger=require(_0x368a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x368a('0x16'));var licenseUtil=require(_0x368a('0x17'));var db=require(_0x368a('0x18'))['db'];function respondWithStatusCode(_0x245bc0,_0x201b22){_0x201b22=_0x201b22||0xcc;return function(_0x177443){if(_0x177443){return _0x245bc0['sendStatus'](_0x201b22);}return _0x245bc0[_0x368a('0x19')](_0x201b22)[_0x368a('0x1a')]();};}function respondWithResult(_0x4e4bf5,_0x43926d){_0x43926d=_0x43926d||0xc8;return function(_0x43e4e8){if(_0x43e4e8){return _0x4e4bf5[_0x368a('0x19')](_0x43926d)['json'](_0x43e4e8);}};}function respondWithFilteredResult(_0x25ffae,_0x323b51){return function(_0x2a652d){if(_0x2a652d){var _0x3ebfb6=typeof _0x323b51[_0x368a('0x1b')]==='undefined'&&typeof _0x323b51[_0x368a('0x1c')]===_0x368a('0x1d');var _0x4d25a4=_0x2a652d[_0x368a('0x1e')];var _0x21b5d3=_0x3ebfb6?0x0:_0x323b51[_0x368a('0x1b')];var _0x153eef=_0x3ebfb6?_0x2a652d['count']:_0x323b51[_0x368a('0x1b')]+_0x323b51[_0x368a('0x1c')];var _0x4cbfbe;if(_0x153eef>=_0x4d25a4){_0x153eef=_0x4d25a4;_0x4cbfbe=0xc8;}else{_0x4cbfbe=0xce;}_0x25ffae['status'](_0x4cbfbe);return _0x25ffae[_0x368a('0x1f')](_0x368a('0x20'),_0x21b5d3+'-'+_0x153eef+'/'+_0x4d25a4)[_0x368a('0x21')](_0x2a652d);}return null;};}function patchUpdates(_0x37253c){return function(_0x15f762){try{jsonpatch[_0x368a('0x22')](_0x15f762,_0x37253c,!![]);}catch(_0x303c94){return BPromise[_0x368a('0x23')](_0x303c94);}return _0x15f762[_0x368a('0x24')]();};}function saveUpdates(_0x1a75b9,_0x10722f){return function(_0x21f76d){if(_0x21f76d){return _0x21f76d[_0x368a('0x25')](_0x1a75b9)[_0x368a('0x26')](function(_0x592cce){return _0x592cce;});}return null;};}function removeEntity(_0x15a294,_0xa97e45){return function(_0x28ad8d){if(_0x28ad8d){return _0x28ad8d['destroy']()[_0x368a('0x26')](function(){_0x15a294[_0x368a('0x19')](0xcc)[_0x368a('0x1a')]();});}};}function handleEntityNotFound(_0x226fc9,_0x749083){return function(_0x25ed56){if(!_0x25ed56){_0x226fc9[_0x368a('0x27')](0x194);}return _0x25ed56;};}function handleError(_0x6dc891,_0x1f33b5){_0x1f33b5=_0x1f33b5||0x1f4;return function(_0x3324ed){logger[_0x368a('0x28')](_0x3324ed[_0x368a('0x29')]);if(_0x3324ed[_0x368a('0x2a')]){delete _0x3324ed[_0x368a('0x2a')];}_0x6dc891['status'](_0x1f33b5)[_0x368a('0x2b')](_0x3324ed);};}exports[_0x368a('0x2c')]=function(_0x459460,_0x52a697){var _0x3cf99d={},_0x3669f4={},_0x8c1c82={'count':0x0,'rows':[]};var _0x2eb938=_[_0x368a('0x2d')](db['SquareRecording'][_0x368a('0x2e')],function(_0x121a8c){return{'name':_0x121a8c[_0x368a('0x2f')],'type':_0x121a8c[_0x368a('0x30')][_0x368a('0x31')]};});_0x3669f4[_0x368a('0x32')]=_[_0x368a('0x2d')](_0x2eb938,_0x368a('0x2a'));_0x3669f4[_0x368a('0x33')]=_[_0x368a('0x34')](_0x459460[_0x368a('0x33')]);_0x3669f4[_0x368a('0x35')]=_[_0x368a('0x36')](_0x3669f4['model'],_0x3669f4[_0x368a('0x33')]);_0x3cf99d[_0x368a('0x37')]=_[_0x368a('0x36')](_0x3669f4['model'],qs[_0x368a('0x38')](_0x459460['query'][_0x368a('0x38')]));_0x3cf99d[_0x368a('0x37')]=_0x3cf99d[_0x368a('0x37')]['length']?_0x3cf99d[_0x368a('0x37')]:_0x3669f4[_0x368a('0x32')];if(!_0x459460[_0x368a('0x33')][_0x368a('0x39')](_0x368a('0x3a'))){_0x3cf99d['limit']=qs[_0x368a('0x1c')](_0x459460[_0x368a('0x33')][_0x368a('0x1c')]);_0x3cf99d[_0x368a('0x1b')]=qs[_0x368a('0x1b')](_0x459460[_0x368a('0x33')][_0x368a('0x1b')]);}_0x3cf99d['order']=qs[_0x368a('0x3b')](_0x459460[_0x368a('0x33')][_0x368a('0x3b')]);_0x3cf99d[_0x368a('0x3c')]=qs['filters'](_[_0x368a('0x3d')](_0x459460[_0x368a('0x33')],_0x3669f4[_0x368a('0x35')]),_0x2eb938);if(_0x459460[_0x368a('0x33')]['filter']){_0x3cf99d['where']=_[_0x368a('0x3e')](_0x3cf99d[_0x368a('0x3c')],{'$or':_[_0x368a('0x2d')](_0x2eb938,function(_0x2b03fb){if(_0x2b03fb['type']!==_0x368a('0x3f')){var _0x1e9e4e={};_0x1e9e4e[_0x2b03fb[_0x368a('0x2a')]]={'$like':'%'+_0x459460[_0x368a('0x33')][_0x368a('0x40')]+'%'};return _0x1e9e4e;}})});}_0x3cf99d=_[_0x368a('0x3e')]({},_0x3cf99d,_0x459460[_0x368a('0x41')]);var _0x4a09be={'where':_0x3cf99d[_0x368a('0x3c')]};return db[_0x368a('0x42')][_0x368a('0x1e')](_0x4a09be)['then'](function(_0x3fcd70){_0x8c1c82[_0x368a('0x1e')]=_0x3fcd70;if(_0x459460[_0x368a('0x33')][_0x368a('0x43')]){_0x3cf99d[_0x368a('0x44')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x3cf99d);})[_0x368a('0x26')](function(_0xfd8f3f){_0x8c1c82[_0x368a('0x45')]=_0xfd8f3f;return _0x8c1c82;})[_0x368a('0x26')](respondWithFilteredResult(_0x52a697,_0x3cf99d))[_0x368a('0x46')](handleError(_0x52a697,null));};exports[_0x368a('0x47')]=function(_0x59a5bb,_0x4076eb){var _0x59e4bf={'raw':!![],'where':{'id':_0x59a5bb['params']['id']}},_0x459081={};_0x459081[_0x368a('0x32')]=_['keys'](db[_0x368a('0x42')]['rawAttributes']);_0x459081[_0x368a('0x33')]=_[_0x368a('0x34')](_0x59a5bb[_0x368a('0x33')]);_0x459081['filters']=_['intersection'](_0x459081[_0x368a('0x32')],_0x459081[_0x368a('0x33')]);_0x59e4bf[_0x368a('0x37')]=_[_0x368a('0x36')](_0x459081[_0x368a('0x32')],qs['fields'](_0x59a5bb[_0x368a('0x33')][_0x368a('0x38')]));_0x59e4bf[_0x368a('0x37')]=_0x59e4bf[_0x368a('0x37')][_0x368a('0x48')]?_0x59e4bf['attributes']:_0x459081[_0x368a('0x32')];if(_0x59a5bb[_0x368a('0x33')]['includeAll']){_0x59e4bf['include']=[{'all':!![]}];}_0x59e4bf=_[_0x368a('0x3e')]({},_0x59e4bf,_0x59a5bb[_0x368a('0x41')]);return db[_0x368a('0x42')][_0x368a('0x49')](_0x59e4bf)[_0x368a('0x26')](handleEntityNotFound(_0x4076eb,null))[_0x368a('0x26')](respondWithResult(_0x4076eb,null))[_0x368a('0x46')](handleError(_0x4076eb,null));};exports[_0x368a('0x4a')]=function(_0x4310b4,_0x48ec56){return db[_0x368a('0x42')][_0x368a('0x4a')](_0x4310b4['body'],{})[_0x368a('0x26')](respondWithResult(_0x48ec56,0xc9))[_0x368a('0x46')](handleError(_0x48ec56,null));};exports[_0x368a('0x25')]=function(_0x318d7b,_0x5425b0){if(_0x318d7b['body']['id']){delete _0x318d7b['body']['id'];}return db[_0x368a('0x42')][_0x368a('0x49')]({'where':{'id':_0x318d7b[_0x368a('0x4b')]['id']}})[_0x368a('0x26')](handleEntityNotFound(_0x5425b0,null))[_0x368a('0x26')](saveUpdates(_0x318d7b[_0x368a('0x4c')],null))[_0x368a('0x26')](respondWithResult(_0x5425b0,null))[_0x368a('0x46')](handleError(_0x5425b0,null));};exports['download']=function(_0x5c87f3,_0xb25d60,_0x2f1c35){var _0x163a42=require(_0x368a('0x4d'));var _0xcec408=![];var _0xe9c271={};if(_0x5c87f3[_0x368a('0x33')]['type']&&_0x5c87f3[_0x368a('0x33')]['type']==='uniqueid'){_0xe9c271['uniqueid']=_0x5c87f3[_0x368a('0x4b')]['id'];}else{_0xe9c271['id']=_0x5c87f3['params']['id'];}return db[_0x368a('0x42')][_0x368a('0x49')]({'where':_0xe9c271,'attributes':['id',_0x368a('0x4e'),_0x368a('0x4f')],'raw':!![]})[_0x368a('0x26')](handleEntityNotFound(_0xb25d60,null))[_0x368a('0x26')](function(_0x5b397d){if(_0x5b397d){var _0xf25dc4=_0x5b397d[_0x368a('0x4e')];var _0xa649ef=util[_0x368a('0x50')](_0x368a('0x51'),_0xf25dc4);if(fs['existsSync'](_0xa649ef)){_0xcec408=!![];return _0x163a42[_0x368a('0x52')](_0xa649ef,_0xf25dc4,config[_0x368a('0x53')][_0x368a('0x54')])['then'](function(){return _0x5b397d;});}return _0x5b397d;}})[_0x368a('0x26')](function(_0x57d780){if(_0x57d780){var _0xf94160=_0x57d780['savePath'];if(!fs[_0x368a('0x55')](_0xf94160)){throw new db['Sequelize'][(_0x368a('0x56'))](_0x368a('0x57'));}if(_0x57d780[_0x368a('0x4f')]){return _0xb25d60[_0x368a('0x58')](_0xf94160,_0x57d780[_0x368a('0x4f')]+path['extname'](_0xf94160),function(){if(_0xcec408){fs[_0x368a('0x59')](_0xf94160);}});}else{return _0xb25d60['download'](_0xf94160,function(_0x5f4eb4){if(_0xcec408){fs[_0x368a('0x59')](_0xf94160);}});}}})[_0x368a('0x46')](function(_0x440e00){if(_0x440e00[_0x368a('0x5a')]==='SquareRecording\x20not\x20found'){_0xb25d60[_0x368a('0x19')](0x194)[_0x368a('0x2b')](_0x368a('0x5b'));}else{return handleError(_0xb25d60,null);}});};exports[_0x368a('0x5c')]=function(_0x2dbce8,_0x18e8d9){return db[_0x368a('0x42')][_0x368a('0x49')]({'where':{'id':_0x2dbce8[_0x368a('0x4b')]['id']}})[_0x368a('0x26')](function(_0x2bbc15){if(_[_0x368a('0x5d')](_0x2bbc15)){throw new ReferenceError(_0x368a('0x5e'));}return _0x2bbc15;})[_0x368a('0x26')](function(_0x27af3e){var _0x9377bb=_0x27af3e[_0x368a('0x4e')];logger[_0x368a('0x5f')](_0x368a('0x60'),_0x9377bb);if(!_[_0x368a('0x5d')](_0x27af3e[_0x368a('0x4e')])&&fs['existsSync'](_0x9377bb)){logger['info'](_0x368a('0x61')+_0x9377bb+_0x368a('0x62'));fs['unlinkSync'](_0x9377bb);}_0x9377bb=_0x9377bb+_0x368a('0x63');if(!_['isNil'](_0x27af3e[_0x368a('0x4e')])&&fs[_0x368a('0x55')](_0x9377bb)){logger[_0x368a('0x5f')](_0x368a('0x61')+_0x9377bb+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x368a('0x64')](_0x9377bb);}return _0x27af3e;})['then'](function(_0x1ec178){if(!_0x1ec178)throw new InternalError();return _0x1ec178[_0x368a('0x5c')]();})[_0x368a('0x26')](function(){_0x18e8d9[_0x368a('0x19')](0xcc)[_0x368a('0x1a')]();})[_0x368a('0x46')](handleError(_0x18e8d9,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 2299cb2..50dfd38 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 _0x4c4a=['path','../../config/environment','exports','SquareRecording','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x431ae0,_0x76a2b9){_0x431ae0=_0x431ae0-0x0;var _0x59f832=_0x4c4a[_0x431ae0];return _0x59f832;};'use strict';var _=require(_0xa4c4('0x0'));var util=require(_0xa4c4('0x1'));var logger=require(_0xa4c4('0x2'))('api');var moment=require(_0xa4c4('0x3'));var BPromise=require(_0xa4c4('0x4'));var rp=require(_0xa4c4('0x5'));var fs=require('fs');var path=require(_0xa4c4('0x6'));var rimraf=require('rimraf');var config=require(_0xa4c4('0x7'));var attributes=require('./squareRecording.attributes');module[_0xa4c4('0x8')]=function(_0x11aded,_0x5ca539){return _0x11aded['define'](_0xa4c4('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1921=['request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','../../config/logger','api','moment','bluebird'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1921,0xf2));var _0x1192=function(_0x1ad41d,_0x1e8af9){_0x1ad41d=_0x1ad41d-0x0;var _0x2899f7=_0x1921[_0x1ad41d];return _0x2899f7;};'use strict';var _=require(_0x1192('0x0'));var util=require('util');var logger=require(_0x1192('0x1'))(_0x1192('0x2'));var moment=require(_0x1192('0x3'));var BPromise=require(_0x1192('0x4'));var rp=require(_0x1192('0x5'));var fs=require('fs');var path=require(_0x1192('0x6'));var rimraf=require(_0x1192('0x7'));var config=require(_0x1192('0x8'));var attributes=require(_0x1192('0x9'));module[_0x1192('0xa')]=function(_0x56cb6f,_0x5be2d2){return _0x56cb6f['define'](_0x1192('0xb'),attributes,{'tableName':_0x1192('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 82c63be..1016200 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 _0xb617=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','request\x20sent','debug','stringify','error','code','message','SquareRecording,\x20%s,\x20%s','result','CreateSquareRecording','SquareRecording','body','options','then','catch'];(function(_0x394f5b,_0x27cde4){var _0x4a92ca=function(_0x20bf92){while(--_0x20bf92){_0x394f5b['push'](_0x394f5b['shift']());}};_0x4a92ca(++_0x27cde4);}(_0xb617,0xe1));var _0x7b61=function(_0x37e871,_0x469af8){_0x37e871=_0x37e871-0x0;var _0x4e2787=_0xb617[_0x37e871];return _0x4e2787;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7b61('0x0'));var BPromise=require(_0x7b61('0x1'));var rs=require(_0x7b61('0x2'));var fs=require('fs');var Redis=require(_0x7b61('0x3'));var db=require(_0x7b61('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b61('0x5'))('rpc');var config=require(_0x7b61('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7b61('0x7')][_0x7b61('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x230fec,_0x309317,_0x3881d3){return new BPromise(function(_0x3100c9,_0x1d1069){return client[_0x7b61('0x9')](_0x230fec,_0x3881d3)['then'](function(_0x5831ed){logger[_0x7b61('0xa')]('SquareRecording,\x20%s,\x20%s',_0x309317,_0x7b61('0xb'));logger[_0x7b61('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x309317,'request\x20sent',JSON[_0x7b61('0xd')](_0x5831ed));if(_0x5831ed[_0x7b61('0xe')]){if(_0x5831ed[_0x7b61('0xe')][_0x7b61('0xf')]===0x1f4){logger[_0x7b61('0xe')]('SquareRecording,\x20%s,\x20%s',_0x309317,_0x5831ed[_0x7b61('0xe')]['message']);return _0x1d1069(_0x5831ed['error'][_0x7b61('0x10')]);}logger[_0x7b61('0xe')](_0x7b61('0x11'),_0x309317,_0x5831ed[_0x7b61('0xe')]['message']);return _0x3100c9(_0x5831ed[_0x7b61('0xe')][_0x7b61('0x10')]);}else{logger[_0x7b61('0xa')]('SquareRecording,\x20%s,\x20%s',_0x309317,_0x7b61('0xb'));_0x3100c9(_0x5831ed[_0x7b61('0x12')][_0x7b61('0x10')]);}})['catch'](function(_0x2a38fe){logger[_0x7b61('0xe')](_0x7b61('0x11'),_0x309317,_0x2a38fe);_0x1d1069(_0x2a38fe);});});}exports[_0x7b61('0x13')]=function(_0xf65299){var _0x4ce22f=this;return new Promise(function(_0x41edd5,_0x37172d){return db[_0x7b61('0x14')]['create'](_0xf65299[_0x7b61('0x15')],{'raw':_0xf65299['options']?_0xf65299[_0x7b61('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x7b61('0x17')](function(_0x3676b9){logger[_0x7b61('0xa')]('CreateSquareRecording',_0xf65299);logger['debug'](_0x7b61('0x13'),_0xf65299,JSON[_0x7b61('0xd')](_0x3676b9));_0x41edd5(_0x3676b9);})[_0x7b61('0x18')](function(_0x1dde48){logger[_0x7b61('0xe')](_0x7b61('0x13'),_0x1dde48[_0x7b61('0x10')],_0xf65299);_0x37172d(_0x4ce22f[_0x7b61('0xe')](0x1f4,_0x1dde48['message']));});});}; \ No newline at end of file +var _0x05ef=['debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateSquareRecording','create','body','options','raw','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','SquareRecording,\x20%s,\x20%s'];(function(_0x14ef3e,_0x508efb){var _0x3b4b08=function(_0x392e6b){while(--_0x392e6b){_0x14ef3e['push'](_0x14ef3e['shift']());}};_0x3b4b08(++_0x508efb);}(_0x05ef,0x1d0));var _0xf05e=function(_0x300768,_0x515b0c){_0x300768=_0x300768-0x0;var _0x27bb75=_0x05ef[_0x300768];return _0x27bb75;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf05e('0x0'));var fs=require('fs');var Redis=require(_0xf05e('0x1'));var db=require(_0xf05e('0x2'))['db'];var utils=require(_0xf05e('0x3'));var logger=require(_0xf05e('0x4'))(_0xf05e('0x5'));var config=require(_0xf05e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf05e('0x7')][_0xf05e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4202e4,_0x2e3c41,_0x572717){return new BPromise(function(_0x3f8677,_0x28e2f6){return client['request'](_0x4202e4,_0x572717)[_0xf05e('0x9')](function(_0x52e28b){logger['info'](_0xf05e('0xa'),_0x2e3c41,'request\x20sent');logger[_0xf05e('0xb')](_0xf05e('0xc'),_0x2e3c41,_0xf05e('0xd'),JSON[_0xf05e('0xe')](_0x52e28b));if(_0x52e28b[_0xf05e('0xf')]){if(_0x52e28b['error']['code']===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x2e3c41,_0x52e28b['error'][_0xf05e('0x10')]);return _0x28e2f6(_0x52e28b[_0xf05e('0xf')]['message']);}logger[_0xf05e('0xf')]('SquareRecording,\x20%s,\x20%s',_0x2e3c41,_0x52e28b['error']['message']);return _0x3f8677(_0x52e28b[_0xf05e('0xf')]['message']);}else{logger[_0xf05e('0x11')](_0xf05e('0xa'),_0x2e3c41,_0xf05e('0xd'));_0x3f8677(_0x52e28b[_0xf05e('0x12')][_0xf05e('0x10')]);}})[_0xf05e('0x13')](function(_0x69c58b){logger[_0xf05e('0xf')](_0xf05e('0xa'),_0x2e3c41,_0x69c58b);_0x28e2f6(_0x69c58b);});});}exports[_0xf05e('0x14')]=function(_0x207bd7){var _0x556049=this;return new Promise(function(_0x2b2a95,_0x184bdb){return db['SquareRecording'][_0xf05e('0x15')](_0x207bd7[_0xf05e('0x16')],{'raw':_0x207bd7[_0xf05e('0x17')]?_0x207bd7[_0xf05e('0x17')][_0xf05e('0x18')]===undefined?!![]:![]:!![]})[_0xf05e('0x9')](function(_0x1dcfcd){logger[_0xf05e('0x11')]('CreateSquareRecording',_0x207bd7);logger[_0xf05e('0xb')](_0xf05e('0x14'),_0x207bd7,JSON['stringify'](_0x1dcfcd));_0x2b2a95(_0x1dcfcd);})[_0xf05e('0x13')](function(_0x5577c1){logger[_0xf05e('0xf')](_0xf05e('0x14'),_0x5577c1[_0xf05e('0x10')],_0x207bd7);_0x184bdb(_0x556049[_0xf05e('0xf')](0x1f4,_0x5577c1[_0xf05e('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index c1e44fe..dc0f2a0 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(_0x4212d8,_0x4d6025){var _0x1d5f6d=function(_0xba020b){while(--_0xba020b){_0x4212d8['push'](_0x4212d8['shift']());}};_0x1d5f6d(++_0x4d6025);}(_0xe706,0xa3));var _0x6e70=function(_0xe50e1,_0x30bf72){_0xe50e1=_0xe50e1-0x0;var _0x441f9a=_0xe706[_0xe50e1];return _0x441f9a;};'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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index b8e7de8..d46ae27 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 _0xbb27=['STRING','DATE','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbb27,0xf6));var _0x7bb2=function(_0x351b4c,_0x5d78f5){_0x351b4c=_0x351b4c-0x0;var _0x4de136=_0xbb27[_0x351b4c];return _0x4de136;};'use strict';var Sequelize=require(_0x7bb2('0x0'));module[_0x7bb2('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x7bb2('0x2')]},'request':{'type':Sequelize[_0x7bb2('0x2')]},'channel':{'type':Sequelize[_0x7bb2('0x2')]},'language':{'type':Sequelize[_0x7bb2('0x2')]},'type':{'type':Sequelize[_0x7bb2('0x2')]},'uniqueid':{'type':Sequelize[_0x7bb2('0x2')]},'version':{'type':Sequelize[_0x7bb2('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7bb2('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x7bb2('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x7bb2('0x2')]},'dnid':{'type':Sequelize[_0x7bb2('0x2')]},'rdnis':{'type':Sequelize[_0x7bb2('0x2')]},'context':{'type':Sequelize[_0x7bb2('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x7bb2('0x2')]},'enhanced':{'type':Sequelize[_0x7bb2('0x2')]},'accountcode':{'type':Sequelize[_0x7bb2('0x2')]},'threadid':{'type':Sequelize[_0x7bb2('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7bb2('0x3')]},'leaveAt':{'type':Sequelize[_0x7bb2('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4f33=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x43ade9,_0xa17587){var _0x3e9bfd=function(_0xe1275e){while(--_0xe1275e){_0x43ade9['push'](_0x43ade9['shift']());}};_0x3e9bfd(++_0xa17587);}(_0x4f33,0x189));var _0x34f3=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0x4f33[_0x138d06];return _0x1a01eb;};'use strict';var Sequelize=require(_0x34f3('0x0'));module[_0x34f3('0x1')]={'network':{'type':Sequelize[_0x34f3('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x34f3('0x2')]},'channel':{'type':Sequelize[_0x34f3('0x2')]},'language':{'type':Sequelize[_0x34f3('0x2')]},'type':{'type':Sequelize[_0x34f3('0x2')]},'uniqueid':{'type':Sequelize[_0x34f3('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x34f3('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x34f3('0x2')]},'callingani2':{'type':Sequelize[_0x34f3('0x2')]},'callington':{'type':Sequelize[_0x34f3('0x2')]},'callingtns':{'type':Sequelize[_0x34f3('0x2')]},'dnid':{'type':Sequelize[_0x34f3('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x34f3('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x34f3('0x2')]},'enhanced':{'type':Sequelize[_0x34f3('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x34f3('0x3')]},'leaveAt':{'type':Sequelize[_0x34f3('0x3')]},'bot':{'type':Sequelize[_0x34f3('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d1b54fc..b453977 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 _0xe92b=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','end','error','name','send','index','SquareReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4d9c06,_0x582dbc){var _0xc50318=function(_0x2d39ca){while(--_0x2d39ca){_0x4d9c06['push'](_0x4d9c06['shift']());}};_0xc50318(++_0x582dbc);}(_0xe92b,0xd4));var _0xbe92=function(_0x3b87f4,_0x112243){_0x3b87f4=_0x3b87f4-0x0;var _0x63d16e=_0xe92b[_0x3b87f4];return _0x63d16e;};'use strict';var emlformat=require(_0xbe92('0x0'));var rimraf=require(_0xbe92('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe92('0x2'));var rp=require(_0xbe92('0x3'));var moment=require(_0xbe92('0x4'));var BPromise=require(_0xbe92('0x5'));var Mustache=require(_0xbe92('0x6'));var util=require(_0xbe92('0x7'));var path=require(_0xbe92('0x8'));var sox=require(_0xbe92('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe92('0xa'));var _=require(_0xbe92('0xb'));var squel=require(_0xbe92('0xc'));var crypto=require(_0xbe92('0xd'));var jsforce=require(_0xbe92('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe92('0xf'));var Papa=require(_0xbe92('0x10'));var Redis=require(_0xbe92('0x11'));var authService=require(_0xbe92('0x12'));var qs=require(_0xbe92('0x13'));var as=require(_0xbe92('0x14'));var hardwareService=require(_0xbe92('0x15'));var logger=require(_0xbe92('0x16'))(_0xbe92('0x17'));var utils=require(_0xbe92('0x18'));var config=require(_0xbe92('0x19'));var licenseUtil=require(_0xbe92('0x1a'));var db=require(_0xbe92('0x1b'))['db'];function respondWithStatusCode(_0x42c559,_0x5d1039){_0x5d1039=_0x5d1039||0xcc;return function(_0x21b294){if(_0x21b294){return _0x42c559[_0xbe92('0x1c')](_0x5d1039);}return _0x42c559['status'](_0x5d1039)['end']();};}function respondWithResult(_0x5ebcb8,_0x51572c){_0x51572c=_0x51572c||0xc8;return function(_0x27ce60){if(_0x27ce60){return _0x5ebcb8[_0xbe92('0x1d')](_0x51572c)[_0xbe92('0x1e')](_0x27ce60);}};}function respondWithFilteredResult(_0x3b0930,_0x25ea9b){return function(_0x4426d3){if(_0x4426d3){var _0x165108=typeof _0x25ea9b[_0xbe92('0x1f')]===_0xbe92('0x20')&&typeof _0x25ea9b[_0xbe92('0x21')]===_0xbe92('0x20');var _0xb0eae2=_0x4426d3[_0xbe92('0x22')];var _0x4984c0=_0x165108?0x0:_0x25ea9b[_0xbe92('0x1f')];var _0x2b343f=_0x165108?_0x4426d3[_0xbe92('0x22')]:_0x25ea9b[_0xbe92('0x1f')]+_0x25ea9b[_0xbe92('0x21')];var _0x1fbd87;if(_0x2b343f>=_0xb0eae2){_0x2b343f=_0xb0eae2;_0x1fbd87=0xc8;}else{_0x1fbd87=0xce;}_0x3b0930[_0xbe92('0x1d')](_0x1fbd87);return _0x3b0930['set'](_0xbe92('0x23'),_0x4984c0+'-'+_0x2b343f+'/'+_0xb0eae2)[_0xbe92('0x1e')](_0x4426d3);}return null;};}function patchUpdates(_0xbcd01b){return function(_0x11f195){try{jsonpatch[_0xbe92('0x24')](_0x11f195,_0xbcd01b,!![]);}catch(_0x560213){return BPromise[_0xbe92('0x25')](_0x560213);}return _0x11f195[_0xbe92('0x26')]();};}function saveUpdates(_0x3488bb,_0x4bf250){return function(_0x2bf3f0){if(_0x2bf3f0){return _0x2bf3f0['update'](_0x3488bb)['then'](function(_0x3711a8){return _0x3711a8;});}return null;};}function removeEntity(_0x140741,_0x5848e7){return function(_0x3abef2){if(_0x3abef2){return _0x3abef2[_0xbe92('0x27')]()[_0xbe92('0x28')](function(){_0x140741[_0xbe92('0x1d')](0xcc)[_0xbe92('0x29')]();});}};}function handleEntityNotFound(_0x223e8c,_0x18b6ee){return function(_0x319cdb){if(!_0x319cdb){_0x223e8c['sendStatus'](0x194);}return _0x319cdb;};}function handleError(_0x51da09,_0x1faa9b){_0x1faa9b=_0x1faa9b||0x1f4;return function(_0x4a86aa){logger[_0xbe92('0x2a')](_0x4a86aa['stack']);if(_0x4a86aa['name']){delete _0x4a86aa[_0xbe92('0x2b')];}_0x51da09[_0xbe92('0x1d')](_0x1faa9b)[_0xbe92('0x2c')](_0x4a86aa);};}exports[_0xbe92('0x2d')]=function(_0x704c5a,_0x78bd59){var _0x31220e={},_0x40ea41={},_0x191ab9={'count':0x0,'rows':[]};var _0xf824c5=_['map'](db[_0xbe92('0x2e')][_0xbe92('0x2f')],function(_0x24ff54){return{'name':_0x24ff54[_0xbe92('0x30')],'type':_0x24ff54[_0xbe92('0x31')][_0xbe92('0x32')]};});_0x40ea41[_0xbe92('0x33')]=_[_0xbe92('0x34')](_0xf824c5,_0xbe92('0x2b'));_0x40ea41[_0xbe92('0x35')]=_[_0xbe92('0x36')](_0x704c5a[_0xbe92('0x35')]);_0x40ea41[_0xbe92('0x37')]=_[_0xbe92('0x38')](_0x40ea41[_0xbe92('0x33')],_0x40ea41[_0xbe92('0x35')]);_0x31220e[_0xbe92('0x39')]=_[_0xbe92('0x38')](_0x40ea41[_0xbe92('0x33')],qs[_0xbe92('0x3a')](_0x704c5a['query']['fields']));_0x31220e['attributes']=_0x31220e[_0xbe92('0x39')][_0xbe92('0x3b')]?_0x31220e[_0xbe92('0x39')]:_0x40ea41[_0xbe92('0x33')];if(!_0x704c5a[_0xbe92('0x35')][_0xbe92('0x3c')]('nolimit')){_0x31220e[_0xbe92('0x21')]=qs[_0xbe92('0x21')](_0x704c5a[_0xbe92('0x35')][_0xbe92('0x21')]);_0x31220e[_0xbe92('0x1f')]=qs['offset'](_0x704c5a[_0xbe92('0x35')][_0xbe92('0x1f')]);}_0x31220e[_0xbe92('0x3d')]=qs[_0xbe92('0x3e')](_0x704c5a[_0xbe92('0x35')][_0xbe92('0x3e')]);_0x31220e[_0xbe92('0x3f')]=qs[_0xbe92('0x37')](_[_0xbe92('0x40')](_0x704c5a[_0xbe92('0x35')],_0x40ea41[_0xbe92('0x37')]),_0xf824c5);if(_0x704c5a[_0xbe92('0x35')][_0xbe92('0x41')]){_0x31220e[_0xbe92('0x3f')]=_['merge'](_0x31220e[_0xbe92('0x3f')],{'$or':_[_0xbe92('0x34')](_0xf824c5,function(_0xb20a8d){if(_0xb20a8d[_0xbe92('0x31')]!==_0xbe92('0x42')){var _0x5b9678={};_0x5b9678[_0xb20a8d[_0xbe92('0x2b')]]={'$like':'%'+_0x704c5a[_0xbe92('0x35')]['filter']+'%'};return _0x5b9678;}})});}_0x31220e=_[_0xbe92('0x43')]({},_0x31220e,_0x704c5a[_0xbe92('0x44')]);var _0x36ef50={'where':_0x31220e[_0xbe92('0x3f')]};return db[_0xbe92('0x2e')][_0xbe92('0x22')](_0x36ef50)[_0xbe92('0x28')](function(_0x296b52){_0x191ab9['count']=_0x296b52;if(_0x704c5a[_0xbe92('0x35')][_0xbe92('0x45')]){_0x31220e[_0xbe92('0x46')]=[{'all':!![]}];}return db[_0xbe92('0x2e')][_0xbe92('0x47')](_0x31220e);})['then'](function(_0x16a64b){_0x191ab9[_0xbe92('0x48')]=_0x16a64b;return _0x191ab9;})['then'](respondWithFilteredResult(_0x78bd59,_0x31220e))[_0xbe92('0x49')](handleError(_0x78bd59,null));};exports['show']=function(_0x4496ec,_0x460914){var _0xef5cc2={'raw':!![],'where':{'id':_0x4496ec[_0xbe92('0x4a')]['id']}},_0x46a407={};_0x46a407[_0xbe92('0x33')]=_['keys'](db['SquareReport'][_0xbe92('0x2f')]);_0x46a407['query']=_[_0xbe92('0x36')](_0x4496ec[_0xbe92('0x35')]);_0x46a407[_0xbe92('0x37')]=_[_0xbe92('0x38')](_0x46a407[_0xbe92('0x33')],_0x46a407['query']);_0xef5cc2[_0xbe92('0x39')]=_['intersection'](_0x46a407[_0xbe92('0x33')],qs[_0xbe92('0x3a')](_0x4496ec[_0xbe92('0x35')]['fields']));_0xef5cc2['attributes']=_0xef5cc2['attributes'][_0xbe92('0x3b')]?_0xef5cc2[_0xbe92('0x39')]:_0x46a407[_0xbe92('0x33')];if(_0x4496ec[_0xbe92('0x35')][_0xbe92('0x45')]){_0xef5cc2[_0xbe92('0x46')]=[{'all':!![]}];}_0xef5cc2=_[_0xbe92('0x43')]({},_0xef5cc2,_0x4496ec[_0xbe92('0x44')]);return db[_0xbe92('0x2e')][_0xbe92('0x4b')](_0xef5cc2)[_0xbe92('0x28')](handleEntityNotFound(_0x460914,null))['then'](respondWithResult(_0x460914,null))[_0xbe92('0x49')](handleError(_0x460914,null));};exports['create']=function(_0x58deb2,_0x213c26){return db[_0xbe92('0x2e')]['create'](_0x58deb2[_0xbe92('0x4c')],{})['then'](respondWithResult(_0x213c26,0xc9))[_0xbe92('0x49')](handleError(_0x213c26,null));};exports[_0xbe92('0x4d')]=function(_0x213cf6,_0x2ae176){if(_0x213cf6[_0xbe92('0x4c')]['id']){delete _0x213cf6[_0xbe92('0x4c')]['id'];}return db[_0xbe92('0x2e')][_0xbe92('0x4b')]({'where':{'id':_0x213cf6[_0xbe92('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2ae176,null))[_0xbe92('0x28')](saveUpdates(_0x213cf6[_0xbe92('0x4c')],null))[_0xbe92('0x28')](respondWithResult(_0x2ae176,null))[_0xbe92('0x49')](handleError(_0x2ae176,null));};exports[_0xbe92('0x27')]=function(_0x1a9d75,_0x283b61){return db[_0xbe92('0x2e')][_0xbe92('0x4b')]({'where':{'id':_0x1a9d75[_0xbe92('0x4a')]['id']}})[_0xbe92('0x28')](handleEntityNotFound(_0x283b61,null))[_0xbe92('0x28')](removeEntity(_0x283b61,null))[_0xbe92('0x49')](handleError(_0x283b61,null));};exports[_0xbe92('0x4e')]=function(_0x28b320,_0x57f99e){return db[_0xbe92('0x2e')][_0xbe92('0x4e')]()[_0xbe92('0x28')](respondWithResult(_0x57f99e,null))[_0xbe92('0x49')](handleError(_0x57f99e,null));}; \ No newline at end of file +var _0xd926=['query','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','map','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','SquareReport','fieldName','type','key','keys'];(function(_0x59f3f2,_0x302dad){var _0x3f1b72=function(_0x450181){while(--_0x450181){_0x59f3f2['push'](_0x59f3f2['shift']());}};_0x3f1b72(++_0x302dad);}(_0xd926,0x107));var _0x6d92=function(_0x4a7e9c,_0x520ce6){_0x4a7e9c=_0x4a7e9c-0x0;var _0xe67a15=_0xd926[_0x4a7e9c];return _0xe67a15;};'use strict';var emlformat=require(_0x6d92('0x0'));var rimraf=require(_0x6d92('0x1'));var zipdir=require(_0x6d92('0x2'));var jsonpatch=require(_0x6d92('0x3'));var rp=require(_0x6d92('0x4'));var moment=require(_0x6d92('0x5'));var BPromise=require(_0x6d92('0x6'));var Mustache=require('mustache');var util=require(_0x6d92('0x7'));var path=require(_0x6d92('0x8'));var sox=require(_0x6d92('0x9'));var csv=require(_0x6d92('0xa'));var ejs=require(_0x6d92('0xb'));var fs=require('fs');var fs_extra=require(_0x6d92('0xc'));var _=require(_0x6d92('0xd'));var squel=require(_0x6d92('0xe'));var crypto=require(_0x6d92('0xf'));var jsforce=require(_0x6d92('0x10'));var deskjs=require(_0x6d92('0x11'));var toCsv=require('to-csv');var querystring=require(_0x6d92('0x12'));var Papa=require(_0x6d92('0x13'));var Redis=require(_0x6d92('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x6d92('0x15'));var as=require(_0x6d92('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6d92('0x17'));var utils=require(_0x6d92('0x18'));var config=require(_0x6d92('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d92('0x1a'))['db'];function respondWithStatusCode(_0x566beb,_0x53ff4a){_0x53ff4a=_0x53ff4a||0xcc;return function(_0x152948){if(_0x152948){return _0x566beb[_0x6d92('0x1b')](_0x53ff4a);}return _0x566beb['status'](_0x53ff4a)['end']();};}function respondWithResult(_0x122877,_0x456906){_0x456906=_0x456906||0xc8;return function(_0x12ce25){if(_0x12ce25){return _0x122877[_0x6d92('0x1c')](_0x456906)['json'](_0x12ce25);}};}function respondWithFilteredResult(_0x5ea6f6,_0x379c60){return function(_0x2038e0){if(_0x2038e0){var _0x25ddb8=typeof _0x379c60['offset']===_0x6d92('0x1d')&&typeof _0x379c60['limit']===_0x6d92('0x1d');var _0x3cb5f8=_0x2038e0[_0x6d92('0x1e')];var _0x23be6c=_0x25ddb8?0x0:_0x379c60['offset'];var _0x370648=_0x25ddb8?_0x2038e0[_0x6d92('0x1e')]:_0x379c60[_0x6d92('0x1f')]+_0x379c60[_0x6d92('0x20')];var _0x250a80;if(_0x370648>=_0x3cb5f8){_0x370648=_0x3cb5f8;_0x250a80=0xc8;}else{_0x250a80=0xce;}_0x5ea6f6['status'](_0x250a80);return _0x5ea6f6[_0x6d92('0x21')](_0x6d92('0x22'),_0x23be6c+'-'+_0x370648+'/'+_0x3cb5f8)['json'](_0x2038e0);}return null;};}function patchUpdates(_0x25c5b0){return function(_0x2aa7ed){try{jsonpatch[_0x6d92('0x23')](_0x2aa7ed,_0x25c5b0,!![]);}catch(_0x5738a4){return BPromise[_0x6d92('0x24')](_0x5738a4);}return _0x2aa7ed[_0x6d92('0x25')]();};}function saveUpdates(_0x396cbe,_0x3e1249){return function(_0x5ead65){if(_0x5ead65){return _0x5ead65[_0x6d92('0x26')](_0x396cbe)[_0x6d92('0x27')](function(_0x4461f4){return _0x4461f4;});}return null;};}function removeEntity(_0x58012c,_0x22eec5){return function(_0x4dd910){if(_0x4dd910){return _0x4dd910[_0x6d92('0x28')]()[_0x6d92('0x27')](function(){_0x58012c[_0x6d92('0x1c')](0xcc)[_0x6d92('0x29')]();});}};}function handleEntityNotFound(_0x127ebf,_0x3db124){return function(_0xd39d52){if(!_0xd39d52){_0x127ebf['sendStatus'](0x194);}return _0xd39d52;};}function handleError(_0x44668c,_0x17b2a1){_0x17b2a1=_0x17b2a1||0x1f4;return function(_0x592afb){logger['error'](_0x592afb[_0x6d92('0x2a')]);if(_0x592afb[_0x6d92('0x2b')]){delete _0x592afb[_0x6d92('0x2b')];}_0x44668c[_0x6d92('0x1c')](_0x17b2a1)['send'](_0x592afb);};}exports['index']=function(_0x579b5d,_0x1387d1){var _0x3cb450={},_0xab5281={},_0x2dc8ff={'count':0x0,'rows':[]};var _0x3fba11=_['map'](db[_0x6d92('0x2c')]['rawAttributes'],function(_0x20d8fc){return{'name':_0x20d8fc[_0x6d92('0x2d')],'type':_0x20d8fc[_0x6d92('0x2e')][_0x6d92('0x2f')]};});_0xab5281['model']=_['map'](_0x3fba11,_0x6d92('0x2b'));_0xab5281['query']=_[_0x6d92('0x30')](_0x579b5d[_0x6d92('0x31')]);_0xab5281['filters']=_['intersection'](_0xab5281['model'],_0xab5281[_0x6d92('0x31')]);_0x3cb450[_0x6d92('0x32')]=_['intersection'](_0xab5281['model'],qs[_0x6d92('0x33')](_0x579b5d['query'][_0x6d92('0x33')]));_0x3cb450[_0x6d92('0x32')]=_0x3cb450[_0x6d92('0x32')]['length']?_0x3cb450[_0x6d92('0x32')]:_0xab5281[_0x6d92('0x34')];if(!_0x579b5d[_0x6d92('0x31')][_0x6d92('0x35')](_0x6d92('0x36'))){_0x3cb450[_0x6d92('0x20')]=qs['limit'](_0x579b5d['query'][_0x6d92('0x20')]);_0x3cb450[_0x6d92('0x1f')]=qs[_0x6d92('0x1f')](_0x579b5d[_0x6d92('0x31')][_0x6d92('0x1f')]);}_0x3cb450[_0x6d92('0x37')]=qs[_0x6d92('0x38')](_0x579b5d[_0x6d92('0x31')][_0x6d92('0x38')]);_0x3cb450[_0x6d92('0x39')]=qs[_0x6d92('0x3a')](_[_0x6d92('0x3b')](_0x579b5d[_0x6d92('0x31')],_0xab5281[_0x6d92('0x3a')]),_0x3fba11);if(_0x579b5d[_0x6d92('0x31')]['filter']){_0x3cb450[_0x6d92('0x39')]=_['merge'](_0x3cb450[_0x6d92('0x39')],{'$or':_[_0x6d92('0x3c')](_0x3fba11,function(_0x46a0eb){if(_0x46a0eb[_0x6d92('0x2e')]!==_0x6d92('0x3d')){var _0x49dcfe={};_0x49dcfe[_0x46a0eb[_0x6d92('0x2b')]]={'$like':'%'+_0x579b5d['query'][_0x6d92('0x3e')]+'%'};return _0x49dcfe;}})});}_0x3cb450=_[_0x6d92('0x3f')]({},_0x3cb450,_0x579b5d[_0x6d92('0x40')]);var _0x6cbfc5={'where':_0x3cb450['where']};return db[_0x6d92('0x2c')]['count'](_0x6cbfc5)['then'](function(_0x50db1c){_0x2dc8ff[_0x6d92('0x1e')]=_0x50db1c;if(_0x579b5d[_0x6d92('0x31')][_0x6d92('0x41')]){_0x3cb450[_0x6d92('0x42')]=[{'all':!![]}];}return db[_0x6d92('0x2c')][_0x6d92('0x43')](_0x3cb450);})[_0x6d92('0x27')](function(_0x3f87b6){_0x2dc8ff[_0x6d92('0x44')]=_0x3f87b6;return _0x2dc8ff;})[_0x6d92('0x27')](respondWithFilteredResult(_0x1387d1,_0x3cb450))[_0x6d92('0x45')](handleError(_0x1387d1,null));};exports[_0x6d92('0x46')]=function(_0x2625cc,_0x46f0bc){var _0x316e4d={'raw':!![],'where':{'id':_0x2625cc['params']['id']}},_0x15574e={};_0x15574e['model']=_[_0x6d92('0x30')](db[_0x6d92('0x2c')][_0x6d92('0x47')]);_0x15574e[_0x6d92('0x31')]=_[_0x6d92('0x30')](_0x2625cc[_0x6d92('0x31')]);_0x15574e['filters']=_[_0x6d92('0x48')](_0x15574e[_0x6d92('0x34')],_0x15574e['query']);_0x316e4d[_0x6d92('0x32')]=_[_0x6d92('0x48')](_0x15574e['model'],qs[_0x6d92('0x33')](_0x2625cc['query'][_0x6d92('0x33')]));_0x316e4d[_0x6d92('0x32')]=_0x316e4d[_0x6d92('0x32')]['length']?_0x316e4d[_0x6d92('0x32')]:_0x15574e[_0x6d92('0x34')];if(_0x2625cc[_0x6d92('0x31')][_0x6d92('0x41')]){_0x316e4d[_0x6d92('0x42')]=[{'all':!![]}];}_0x316e4d=_[_0x6d92('0x3f')]({},_0x316e4d,_0x2625cc[_0x6d92('0x40')]);return db[_0x6d92('0x2c')][_0x6d92('0x49')](_0x316e4d)[_0x6d92('0x27')](handleEntityNotFound(_0x46f0bc,null))[_0x6d92('0x27')](respondWithResult(_0x46f0bc,null))[_0x6d92('0x45')](handleError(_0x46f0bc,null));};exports[_0x6d92('0x4a')]=function(_0xa4e25c,_0x263eb8){return db[_0x6d92('0x2c')][_0x6d92('0x4a')](_0xa4e25c['body'],{})[_0x6d92('0x27')](respondWithResult(_0x263eb8,0xc9))['catch'](handleError(_0x263eb8,null));};exports[_0x6d92('0x26')]=function(_0x5d564e,_0x2bcbc3){if(_0x5d564e[_0x6d92('0x4b')]['id']){delete _0x5d564e[_0x6d92('0x4b')]['id'];}return db['SquareReport'][_0x6d92('0x49')]({'where':{'id':_0x5d564e['params']['id']}})[_0x6d92('0x27')](handleEntityNotFound(_0x2bcbc3,null))['then'](saveUpdates(_0x5d564e[_0x6d92('0x4b')],null))['then'](respondWithResult(_0x2bcbc3,null))[_0x6d92('0x45')](handleError(_0x2bcbc3,null));};exports[_0x6d92('0x28')]=function(_0x53d4af,_0x1d7eae){return db[_0x6d92('0x2c')]['find']({'where':{'id':_0x53d4af[_0x6d92('0x4c')]['id']}})[_0x6d92('0x27')](handleEntityNotFound(_0x1d7eae,null))[_0x6d92('0x27')](removeEntity(_0x1d7eae,null))[_0x6d92('0x45')](handleError(_0x1d7eae,null));};exports['describe']=function(_0x471efb,_0x386b9d){return db[_0x6d92('0x2c')][_0x6d92('0x4d')]()[_0x6d92('0x27')](respondWithResult(_0x386b9d,null))[_0x6d92('0x45')](handleError(_0x386b9d,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index fe8e8b7..d974200 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 _0x1123=['SquareReport','report_square','uid_pname','project_name','leaveAt','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define'];(function(_0x172b28,_0x4c0a66){var _0x4936b2=function(_0x5a0acc){while(--_0x5a0acc){_0x172b28['push'](_0x172b28['shift']());}};_0x4936b2(++_0x4c0a66);}(_0x1123,0x85));var _0x3112=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x1123[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x3112('0x0'));var logger=require(_0x3112('0x1'))(_0x3112('0x2'));var moment=require(_0x3112('0x3'));var BPromise=require('bluebird');var rp=require(_0x3112('0x4'));var fs=require('fs');var path=require(_0x3112('0x5'));var rimraf=require(_0x3112('0x6'));var config=require(_0x3112('0x7'));var attributes=require(_0x3112('0x8'));module[_0x3112('0x9')]=function(_0x2bc778,_0x31b749){return _0x2bc778[_0x3112('0xa')](_0x3112('0xb'),attributes,{'tableName':_0x3112('0xc'),'paranoid':![],'indexes':[{'name':_0x3112('0xd'),'fields':['uniqueid',_0x3112('0xe')]},{'name':_0x3112('0xf'),'fields':[_0x3112('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac4b=['request-promise','path','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','util','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac4b,0x10a));var _0xbac4=function(_0x614c88,_0x184f02){_0x614c88=_0x614c88-0x0;var _0x1a768e=_0xac4b[_0x614c88];return _0x1a768e;};'use strict';var _=require('lodash');var util=require(_0xbac4('0x0'));var logger=require(_0xbac4('0x1'))(_0xbac4('0x2'));var moment=require('moment');var BPromise=require(_0xbac4('0x3'));var rp=require(_0xbac4('0x4'));var fs=require('fs');var path=require(_0xbac4('0x5'));var rimraf=require('rimraf');var config=require(_0xbac4('0x6'));var attributes=require(_0xbac4('0x7'));module[_0xbac4('0x8')]=function(_0x4cd766,_0x3edbf5){return _0x4cd766[_0xbac4('0x9')](_0xbac4('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xbac4('0xb'),'fields':[_0xbac4('0xc'),_0xbac4('0xd')]},{'name':'leaveAt','fields':[_0xbac4('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 230b0f4..80fb924 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 _0xd6b3=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareReport','SquareReport','create','options','stringify','UpdateSquareReport','body','where','attributes','limit','lodash','util','moment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd6b3,0x1ec));var _0x3d6b=function(_0x48c742,_0x4725df){_0x48c742=_0x48c742-0x0;var _0x484c7a=_0xd6b3[_0x48c742];return _0x484c7a;};'use strict';var _=require(_0x3d6b('0x0'));var util=require(_0x3d6b('0x1'));var moment=require(_0x3d6b('0x2'));var BPromise=require(_0x3d6b('0x3'));var rs=require(_0x3d6b('0x4'));var fs=require('fs');var Redis=require(_0x3d6b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3d6b('0x6'))(_0x3d6b('0x7'));var config=require(_0x3d6b('0x8'));var jayson=require(_0x3d6b('0x9'));var client=jayson[_0x3d6b('0xa')][_0x3d6b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1180be,_0x2fd11b,_0x4e53bb){return new BPromise(function(_0x163c3a,_0x215bd2){return client[_0x3d6b('0xc')](_0x1180be,_0x4e53bb)[_0x3d6b('0xd')](function(_0x267ad2){logger[_0x3d6b('0xe')](_0x3d6b('0xf'),_0x2fd11b,_0x3d6b('0x10'));logger[_0x3d6b('0x11')](_0x3d6b('0x12'),_0x2fd11b,_0x3d6b('0x10'),JSON['stringify'](_0x267ad2));if(_0x267ad2[_0x3d6b('0x13')]){if(_0x267ad2['error']['code']===0x1f4){logger[_0x3d6b('0x13')](_0x3d6b('0xf'),_0x2fd11b,_0x267ad2[_0x3d6b('0x13')]['message']);return _0x215bd2(_0x267ad2[_0x3d6b('0x13')][_0x3d6b('0x14')]);}logger['error'](_0x3d6b('0xf'),_0x2fd11b,_0x267ad2[_0x3d6b('0x13')][_0x3d6b('0x14')]);return _0x163c3a(_0x267ad2[_0x3d6b('0x13')][_0x3d6b('0x14')]);}else{logger[_0x3d6b('0xe')]('SquareReport,\x20%s,\x20%s',_0x2fd11b,_0x3d6b('0x10'));_0x163c3a(_0x267ad2[_0x3d6b('0x15')]['message']);}})[_0x3d6b('0x16')](function(_0x446758){logger[_0x3d6b('0x13')](_0x3d6b('0xf'),_0x2fd11b,_0x446758);_0x215bd2(_0x446758);});});}exports[_0x3d6b('0x17')]=function(_0x429d6e){var _0x4dff94=this;return new Promise(function(_0x19fff1,_0x3ec757){return db[_0x3d6b('0x18')][_0x3d6b('0x19')](_0x429d6e['body'],{'raw':_0x429d6e[_0x3d6b('0x1a')]?_0x429d6e[_0x3d6b('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x359110){logger[_0x3d6b('0xe')]('CreateSquareReport',_0x429d6e);logger[_0x3d6b('0x11')]('CreateSquareReport',_0x429d6e,JSON[_0x3d6b('0x1b')](_0x359110));_0x19fff1(_0x359110);})[_0x3d6b('0x16')](function(_0xca50d4){logger['error'](_0x3d6b('0x17'),_0xca50d4[_0x3d6b('0x14')],_0x429d6e);_0x3ec757(_0x4dff94['error'](0x1f4,_0xca50d4[_0x3d6b('0x14')]));});});};exports[_0x3d6b('0x1c')]=function(_0x431e82){var _0x345f0f=this;return new Promise(function(_0x4b2613,_0x685677){return db[_0x3d6b('0x18')]['update'](_0x431e82[_0x3d6b('0x1d')],{'raw':_0x431e82[_0x3d6b('0x1a')]?_0x431e82[_0x3d6b('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x431e82[_0x3d6b('0x1a')]?_0x431e82[_0x3d6b('0x1a')][_0x3d6b('0x1e')]||null:null,'attributes':_0x431e82['options']?_0x431e82[_0x3d6b('0x1a')][_0x3d6b('0x1f')]||null:null,'limit':_0x431e82[_0x3d6b('0x1a')]?_0x431e82['options'][_0x3d6b('0x20')]||null:null})[_0x3d6b('0xd')](function(_0x17d8c1){logger[_0x3d6b('0xe')](_0x3d6b('0x1c'),_0x431e82);logger[_0x3d6b('0x11')](_0x3d6b('0x1c'),_0x431e82,JSON[_0x3d6b('0x1b')](_0x17d8c1));_0x4b2613(_0x17d8c1);})['catch'](function(_0x97a9f7){logger['error'](_0x3d6b('0x1c'),_0x97a9f7[_0x3d6b('0x14')],_0x431e82);_0x685677(_0x345f0f[_0x3d6b('0x13')](0x1f4,_0x97a9f7[_0x3d6b('0x14')]));});});}; \ No newline at end of file +var _0x2bc2=['http','request','then','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','catch','CreateSquareReport','create','body','options','raw','debug','SquareReport','attributes','limit','UpdateSquareReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2bc2,0x181));var _0x22bc=function(_0x16d22f,_0x26c599){_0x16d22f=_0x16d22f-0x0;var _0x49272f=_0x2bc2[_0x16d22f];return _0x49272f;};'use strict';var _=require(_0x22bc('0x0'));var util=require('util');var moment=require(_0x22bc('0x1'));var BPromise=require(_0x22bc('0x2'));var rs=require(_0x22bc('0x3'));var fs=require('fs');var Redis=require(_0x22bc('0x4'));var db=require(_0x22bc('0x5'))['db'];var utils=require(_0x22bc('0x6'));var logger=require(_0x22bc('0x7'))(_0x22bc('0x8'));var config=require(_0x22bc('0x9'));var jayson=require(_0x22bc('0xa'));var client=jayson['client'][_0x22bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x552ef7,_0x4859c9,_0x55b3f4){return new BPromise(function(_0x4b1798,_0x1f49fd){return client[_0x22bc('0xc')](_0x552ef7,_0x55b3f4)[_0x22bc('0xd')](function(_0x48ed73){logger[_0x22bc('0xe')]('SquareReport,\x20%s,\x20%s',_0x4859c9,_0x22bc('0xf'));logger['debug'](_0x22bc('0x10'),_0x4859c9,_0x22bc('0xf'),JSON[_0x22bc('0x11')](_0x48ed73));if(_0x48ed73[_0x22bc('0x12')]){if(_0x48ed73['error'][_0x22bc('0x13')]===0x1f4){logger[_0x22bc('0x12')](_0x22bc('0x14'),_0x4859c9,_0x48ed73[_0x22bc('0x12')]['message']);return _0x1f49fd(_0x48ed73[_0x22bc('0x12')]['message']);}logger[_0x22bc('0x12')](_0x22bc('0x14'),_0x4859c9,_0x48ed73[_0x22bc('0x12')][_0x22bc('0x15')]);return _0x4b1798(_0x48ed73['error']['message']);}else{logger[_0x22bc('0xe')](_0x22bc('0x14'),_0x4859c9,_0x22bc('0xf'));_0x4b1798(_0x48ed73['result'][_0x22bc('0x15')]);}})[_0x22bc('0x16')](function(_0x4894cf){logger[_0x22bc('0x12')](_0x22bc('0x14'),_0x4859c9,_0x4894cf);_0x1f49fd(_0x4894cf);});});}exports[_0x22bc('0x17')]=function(_0x2fd63c){var _0x425969=this;return new Promise(function(_0x23ccd6,_0x36e7a0){return db['SquareReport'][_0x22bc('0x18')](_0x2fd63c[_0x22bc('0x19')],{'raw':_0x2fd63c['options']?_0x2fd63c[_0x22bc('0x1a')][_0x22bc('0x1b')]===undefined?!![]:![]:!![]})[_0x22bc('0xd')](function(_0x369114){logger[_0x22bc('0xe')](_0x22bc('0x17'),_0x2fd63c);logger[_0x22bc('0x1c')](_0x22bc('0x17'),_0x2fd63c,JSON[_0x22bc('0x11')](_0x369114));_0x23ccd6(_0x369114);})[_0x22bc('0x16')](function(_0x5cc56f){logger['error'](_0x22bc('0x17'),_0x5cc56f[_0x22bc('0x15')],_0x2fd63c);_0x36e7a0(_0x425969[_0x22bc('0x12')](0x1f4,_0x5cc56f[_0x22bc('0x15')]));});});};exports['UpdateSquareReport']=function(_0x45720b){var _0x239bad=this;return new Promise(function(_0x4b2e14,_0x22c0ba){return db[_0x22bc('0x1d')]['update'](_0x45720b[_0x22bc('0x19')],{'raw':_0x45720b[_0x22bc('0x1a')]?_0x45720b[_0x22bc('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45720b['options']?_0x45720b[_0x22bc('0x1a')]['where']||null:null,'attributes':_0x45720b[_0x22bc('0x1a')]?_0x45720b[_0x22bc('0x1a')][_0x22bc('0x1e')]||null:null,'limit':_0x45720b[_0x22bc('0x1a')]?_0x45720b[_0x22bc('0x1a')][_0x22bc('0x1f')]||null:null})[_0x22bc('0xd')](function(_0x1d44c4){logger['info'](_0x22bc('0x20'),_0x45720b);logger[_0x22bc('0x1c')](_0x22bc('0x20'),_0x45720b,JSON[_0x22bc('0x11')](_0x1d44c4));_0x4b2e14(_0x1d44c4);})[_0x22bc('0x16')](function(_0x22333e){logger[_0x22bc('0x12')](_0x22bc('0x20'),_0x22333e[_0x22bc('0x15')],_0x45720b);_0x22c0ba(_0x239bad[_0x22bc('0x12')](0x1f4,_0x22333e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index c0952aa..3b85623 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 _0x1d93=['put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x4f1a41,_0x369c98){var _0x5569d6=function(_0x3fe7fb){while(--_0x3fe7fb){_0x4f1a41['push'](_0x4f1a41['shift']());}};_0x5569d6(++_0x369c98);}(_0x1d93,0x1e7));var _0x31d9=function(_0x31efd1,_0x227b20){_0x31efd1=_0x31efd1-0x0;var _0x55200d=_0x1d93[_0x31efd1];return _0x55200d;};'use strict';var multer=require('multer');var util=require(_0x31d9('0x0'));var path=require(_0x31d9('0x1'));var timeout=require('connect-timeout');var express=require(_0x31d9('0x2'));var router=express[_0x31d9('0x3')]();var fs_extra=require(_0x31d9('0x4'));var auth=require(_0x31d9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x31d9('0x6'));var controller=require(_0x31d9('0x7'));router[_0x31d9('0x8')]('/',auth[_0x31d9('0x9')](),controller[_0x31d9('0xa')]);router[_0x31d9('0x8')](_0x31d9('0xb'),auth[_0x31d9('0x9')](),controller[_0x31d9('0xc')]);router[_0x31d9('0x8')](_0x31d9('0xd'),auth[_0x31d9('0x9')](),controller[_0x31d9('0xe')]);router[_0x31d9('0xf')]('/',auth[_0x31d9('0x9')](),controller[_0x31d9('0x10')]);router[_0x31d9('0x11')]('/:id',auth[_0x31d9('0x9')](),controller[_0x31d9('0x12')]);router['delete'](_0x31d9('0xd'),auth[_0x31d9('0x9')](),controller[_0x31d9('0x13')]);module[_0x31d9('0x14')]=router; \ No newline at end of file +var _0xac7e=['multer','util','connect-timeout','express','fs-extra','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','describe','post','put','/:id','delete','destroy','exports'];(function(_0x4750aa,_0x14f0af){var _0x5971c6=function(_0x1c0c30){while(--_0x1c0c30){_0x4750aa['push'](_0x4750aa['shift']());}};_0x5971c6(++_0x14f0af);}(_0xac7e,0x70));var _0xeac7=function(_0x46c469,_0x50b088){_0x46c469=_0x46c469-0x0;var _0x50bc16=_0xac7e[_0x46c469];return _0x50bc16;};'use strict';var multer=require(_0xeac7('0x0'));var util=require(_0xeac7('0x1'));var path=require('path');var timeout=require(_0xeac7('0x2'));var express=require(_0xeac7('0x3'));var router=express['Router']();var fs_extra=require(_0xeac7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeac7('0x5'));var controller=require(_0xeac7('0x6'));router[_0xeac7('0x7')]('/',auth[_0xeac7('0x8')](),controller['index']);router['get']('/describe',auth[_0xeac7('0x8')](),controller[_0xeac7('0x9')]);router[_0xeac7('0x7')]('/:id',auth[_0xeac7('0x8')](),controller['show']);router[_0xeac7('0xa')]('/',auth[_0xeac7('0x8')](),controller['create']);router[_0xeac7('0xb')](_0xeac7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xeac7('0xd')](_0xeac7('0xc'),auth['isAuthenticated'](),controller[_0xeac7('0xe')]);module[_0xeac7('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index afb7673..10bc0c4 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 _0xbe78=['STRING','sequelize'];(function(_0x3cc6c1,_0x6dbd58){var _0x52522b=function(_0x5cc44a){while(--_0x5cc44a){_0x3cc6c1['push'](_0x3cc6c1['shift']());}};_0x52522b(++_0x6dbd58);}(_0xbe78,0x191));var _0x8be7=function(_0x4f1717,_0x4920b6){_0x4f1717=_0x4f1717-0x0;var _0x504f18=_0xbe78[_0x4f1717];return _0x504f18;};'use strict';var Sequelize=require(_0x8be7('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x8be7('0x1')]},'node':{'type':Sequelize[_0x8be7('0x1')]},'application':{'type':Sequelize[_0x8be7('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x8be7('0x1')]},'callerid':{'type':Sequelize[_0x8be7('0x1')]}}; \ No newline at end of file +var _0x492a=['exports','STRING','sequelize'];(function(_0x52ed6f,_0x31ec9a){var _0x19e934=function(_0x5b60a0){while(--_0x5b60a0){_0x52ed6f['push'](_0x52ed6f['shift']());}};_0x19e934(++_0x31ec9a);}(_0x492a,0x71));var _0xa492=function(_0x11ad65,_0x352d3c){_0x11ad65=_0x11ad65-0x0;var _0x35590c=_0x492a[_0x11ad65];return _0x35590c;};'use strict';var Sequelize=require(_0xa492('0x0'));module[_0xa492('0x1')]={'uniqueid':{'type':Sequelize[_0xa492('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa492('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index dce6716..9df3f5e 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 _0x8453=['merge','VIRTUAL','name','includeAll','findAll','rows','catch','params','fields','length','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','send','map','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','filter'];(function(_0x1a293f,_0x9d1cb6){var _0x2a3efb=function(_0x3f83be){while(--_0x3f83be){_0x1a293f['push'](_0x1a293f['shift']());}};_0x2a3efb(++_0x9d1cb6);}(_0x8453,0xa4));var _0x3845=function(_0xf0a16b,_0x2c0e87){_0xf0a16b=_0xf0a16b-0x0;var _0x283780=_0x8453[_0xf0a16b];return _0x283780;};'use strict';var emlformat=require(_0x3845('0x0'));var rimraf=require(_0x3845('0x1'));var zipdir=require(_0x3845('0x2'));var jsonpatch=require(_0x3845('0x3'));var rp=require(_0x3845('0x4'));var moment=require('moment');var BPromise=require(_0x3845('0x5'));var Mustache=require(_0x3845('0x6'));var util=require('util');var path=require(_0x3845('0x7'));var sox=require(_0x3845('0x8'));var csv=require('to-csv');var ejs=require(_0x3845('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3845('0xa'));var squel=require('squel');var crypto=require(_0x3845('0xb'));var jsforce=require(_0x3845('0xc'));var deskjs=require(_0x3845('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3845('0xe'));var Papa=require(_0x3845('0xf'));var Redis=require(_0x3845('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3845('0x11'));var as=require(_0x3845('0x12'));var hardwareService=require(_0x3845('0x13'));var logger=require(_0x3845('0x14'))('api');var utils=require(_0x3845('0x15'));var config=require(_0x3845('0x16'));var licenseUtil=require(_0x3845('0x17'));var db=require(_0x3845('0x18'))['db'];function respondWithStatusCode(_0x3d2937,_0x529813){_0x529813=_0x529813||0xcc;return function(_0x5e5d34){if(_0x5e5d34){return _0x3d2937[_0x3845('0x19')](_0x529813);}return _0x3d2937[_0x3845('0x1a')](_0x529813)[_0x3845('0x1b')]();};}function respondWithResult(_0x8c5ce1,_0x148a6e){_0x148a6e=_0x148a6e||0xc8;return function(_0x477f87){if(_0x477f87){return _0x8c5ce1['status'](_0x148a6e)[_0x3845('0x1c')](_0x477f87);}};}function respondWithFilteredResult(_0x116510,_0xd5c768){return function(_0xa93ae9){if(_0xa93ae9){var _0x6e2767=typeof _0xd5c768[_0x3845('0x1d')]==='undefined'&&typeof _0xd5c768[_0x3845('0x1e')]==='undefined';var _0x3f5a3b=_0xa93ae9[_0x3845('0x1f')];var _0x19892b=_0x6e2767?0x0:_0xd5c768[_0x3845('0x1d')];var _0x13bb48=_0x6e2767?_0xa93ae9['count']:_0xd5c768[_0x3845('0x1d')]+_0xd5c768['limit'];var _0x2cda91;if(_0x13bb48>=_0x3f5a3b){_0x13bb48=_0x3f5a3b;_0x2cda91=0xc8;}else{_0x2cda91=0xce;}_0x116510[_0x3845('0x1a')](_0x2cda91);return _0x116510[_0x3845('0x20')](_0x3845('0x21'),_0x19892b+'-'+_0x13bb48+'/'+_0x3f5a3b)[_0x3845('0x1c')](_0xa93ae9);}return null;};}function patchUpdates(_0x1a093f){return function(_0x3f82ab){try{jsonpatch[_0x3845('0x22')](_0x3f82ab,_0x1a093f,!![]);}catch(_0x5e549c){return BPromise[_0x3845('0x23')](_0x5e549c);}return _0x3f82ab[_0x3845('0x24')]();};}function saveUpdates(_0x579ead,_0x3745f5){return function(_0x208d7d){if(_0x208d7d){return _0x208d7d[_0x3845('0x25')](_0x579ead)[_0x3845('0x26')](function(_0x3eede8){return _0x3eede8;});}return null;};}function removeEntity(_0x163ee3,_0x2baf81){return function(_0x3714fb){if(_0x3714fb){return _0x3714fb[_0x3845('0x27')]()[_0x3845('0x26')](function(){_0x163ee3[_0x3845('0x1a')](0xcc)[_0x3845('0x1b')]();});}};}function handleEntityNotFound(_0x53c23b,_0x3a07f1){return function(_0x3b736c){if(!_0x3b736c){_0x53c23b[_0x3845('0x19')](0x194);}return _0x3b736c;};}function handleError(_0xbbedb6,_0x15df74){_0x15df74=_0x15df74||0x1f4;return function(_0xb0dfa2){logger[_0x3845('0x28')](_0xb0dfa2['stack']);if(_0xb0dfa2['name']){delete _0xb0dfa2['name'];}_0xbbedb6[_0x3845('0x1a')](_0x15df74)[_0x3845('0x29')](_0xb0dfa2);};}exports['index']=function(_0x1e954c,_0x1e56d6){var _0x5d5b56={},_0x4b2002={},_0x1b5e2c={'count':0x0,'rows':[]};var _0x23c3f9=_[_0x3845('0x2a')](db[_0x3845('0x2b')][_0x3845('0x2c')],function(_0xdf202f){return{'name':_0xdf202f[_0x3845('0x2d')],'type':_0xdf202f[_0x3845('0x2e')]['key']};});_0x4b2002[_0x3845('0x2f')]=_['map'](_0x23c3f9,'name');_0x4b2002[_0x3845('0x30')]=_[_0x3845('0x31')](_0x1e954c[_0x3845('0x30')]);_0x4b2002[_0x3845('0x32')]=_[_0x3845('0x33')](_0x4b2002[_0x3845('0x2f')],_0x4b2002[_0x3845('0x30')]);_0x5d5b56[_0x3845('0x34')]=_[_0x3845('0x33')](_0x4b2002[_0x3845('0x2f')],qs['fields'](_0x1e954c[_0x3845('0x30')]['fields']));_0x5d5b56[_0x3845('0x34')]=_0x5d5b56[_0x3845('0x34')]['length']?_0x5d5b56[_0x3845('0x34')]:_0x4b2002[_0x3845('0x2f')];if(!_0x1e954c[_0x3845('0x30')]['hasOwnProperty'](_0x3845('0x35'))){_0x5d5b56[_0x3845('0x1e')]=qs[_0x3845('0x1e')](_0x1e954c['query'][_0x3845('0x1e')]);_0x5d5b56['offset']=qs[_0x3845('0x1d')](_0x1e954c[_0x3845('0x30')][_0x3845('0x1d')]);}_0x5d5b56[_0x3845('0x36')]=qs['sort'](_0x1e954c[_0x3845('0x30')][_0x3845('0x37')]);_0x5d5b56[_0x3845('0x38')]=qs[_0x3845('0x32')](_['pick'](_0x1e954c[_0x3845('0x30')],_0x4b2002[_0x3845('0x32')]),_0x23c3f9);if(_0x1e954c[_0x3845('0x30')][_0x3845('0x39')]){_0x5d5b56['where']=_[_0x3845('0x3a')](_0x5d5b56[_0x3845('0x38')],{'$or':_[_0x3845('0x2a')](_0x23c3f9,function(_0x419cf8){if(_0x419cf8['type']!==_0x3845('0x3b')){var _0x4c34a4={};_0x4c34a4[_0x419cf8[_0x3845('0x3c')]]={'$like':'%'+_0x1e954c[_0x3845('0x30')]['filter']+'%'};return _0x4c34a4;}})});}_0x5d5b56=_[_0x3845('0x3a')]({},_0x5d5b56,_0x1e954c['options']);var _0x2d901b={'where':_0x5d5b56[_0x3845('0x38')]};return db['SquareDetailsReport'][_0x3845('0x1f')](_0x2d901b)['then'](function(_0x4f660c){_0x1b5e2c[_0x3845('0x1f')]=_0x4f660c;if(_0x1e954c[_0x3845('0x30')][_0x3845('0x3d')]){_0x5d5b56['include']=[{'all':!![]}];}return db[_0x3845('0x2b')][_0x3845('0x3e')](_0x5d5b56);})[_0x3845('0x26')](function(_0xadfb13){_0x1b5e2c[_0x3845('0x3f')]=_0xadfb13;return _0x1b5e2c;})[_0x3845('0x26')](respondWithFilteredResult(_0x1e56d6,_0x5d5b56))[_0x3845('0x40')](handleError(_0x1e56d6,null));};exports['show']=function(_0x5dd682,_0xeb9d6c){var _0x51e040={'raw':!![],'where':{'id':_0x5dd682[_0x3845('0x41')]['id']}},_0x140589={};_0x140589['model']=_[_0x3845('0x31')](db[_0x3845('0x2b')]['rawAttributes']);_0x140589[_0x3845('0x30')]=_[_0x3845('0x31')](_0x5dd682[_0x3845('0x30')]);_0x140589[_0x3845('0x32')]=_[_0x3845('0x33')](_0x140589['model'],_0x140589[_0x3845('0x30')]);_0x51e040[_0x3845('0x34')]=_[_0x3845('0x33')](_0x140589[_0x3845('0x2f')],qs[_0x3845('0x42')](_0x5dd682[_0x3845('0x30')]['fields']));_0x51e040[_0x3845('0x34')]=_0x51e040[_0x3845('0x34')][_0x3845('0x43')]?_0x51e040['attributes']:_0x140589['model'];if(_0x5dd682[_0x3845('0x30')][_0x3845('0x3d')]){_0x51e040[_0x3845('0x44')]=[{'all':!![]}];}_0x51e040=_[_0x3845('0x3a')]({},_0x51e040,_0x5dd682[_0x3845('0x45')]);return db[_0x3845('0x2b')][_0x3845('0x46')](_0x51e040)[_0x3845('0x26')](handleEntityNotFound(_0xeb9d6c,null))[_0x3845('0x26')](respondWithResult(_0xeb9d6c,null))[_0x3845('0x40')](handleError(_0xeb9d6c,null));};exports[_0x3845('0x47')]=function(_0x34bdfe,_0x92e127){return db[_0x3845('0x2b')][_0x3845('0x47')](_0x34bdfe['body'],{})['then'](respondWithResult(_0x92e127,0xc9))[_0x3845('0x40')](handleError(_0x92e127,null));};exports[_0x3845('0x25')]=function(_0x136b35,_0x2ec016){if(_0x136b35['body']['id']){delete _0x136b35[_0x3845('0x48')]['id'];}return db[_0x3845('0x2b')][_0x3845('0x46')]({'where':{'id':_0x136b35[_0x3845('0x41')]['id']}})[_0x3845('0x26')](handleEntityNotFound(_0x2ec016,null))[_0x3845('0x26')](saveUpdates(_0x136b35['body'],null))[_0x3845('0x26')](respondWithResult(_0x2ec016,null))[_0x3845('0x40')](handleError(_0x2ec016,null));};exports[_0x3845('0x27')]=function(_0x33a03d,_0x255469){return db[_0x3845('0x2b')][_0x3845('0x46')]({'where':{'id':_0x33a03d[_0x3845('0x41')]['id']}})[_0x3845('0x26')](handleEntityNotFound(_0x255469,null))[_0x3845('0x26')](removeEntity(_0x255469,null))[_0x3845('0x40')](handleError(_0x255469,null));};exports[_0x3845('0x49')]=function(_0x3017d2,_0x526139){return db[_0x3845('0x2b')][_0x3845('0x49')]()[_0x3845('0x26')](respondWithResult(_0x526139,null))[_0x3845('0x40')](handleError(_0x526139,null));}; \ No newline at end of file +var _0xccfd=['index','map','rawAttributes','fieldName','key','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','name','options','SquareDetailsReport','findAll','rows','catch','show','includeAll','include','create','update','body','find','params','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus'];(function(_0x576439,_0x2ccb32){var _0x6f596c=function(_0x2891d5){while(--_0x2891d5){_0x576439['push'](_0x576439['shift']());}};_0x6f596c(++_0x2ccb32);}(_0xccfd,0xbd));var _0xdccf=function(_0x4fdfd4,_0x43f7f5){_0x4fdfd4=_0x4fdfd4-0x0;var _0x358b64=_0xccfd[_0x4fdfd4];return _0x358b64;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdccf('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdccf('0x1'));var moment=require(_0xdccf('0x2'));var BPromise=require(_0xdccf('0x3'));var Mustache=require(_0xdccf('0x4'));var util=require(_0xdccf('0x5'));var path=require(_0xdccf('0x6'));var sox=require('sox');var csv=require(_0xdccf('0x7'));var ejs=require(_0xdccf('0x8'));var fs=require('fs');var fs_extra=require(_0xdccf('0x9'));var _=require(_0xdccf('0xa'));var squel=require('squel');var crypto=require(_0xdccf('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdccf('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdccf('0xd'));var Redis=require(_0xdccf('0xe'));var authService=require(_0xdccf('0xf'));var qs=require(_0xdccf('0x10'));var as=require(_0xdccf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdccf('0x12'))(_0xdccf('0x13'));var utils=require(_0xdccf('0x14'));var config=require(_0xdccf('0x15'));var licenseUtil=require(_0xdccf('0x16'));var db=require(_0xdccf('0x17'))['db'];function respondWithStatusCode(_0x4c67ab,_0x1986e9){_0x1986e9=_0x1986e9||0xcc;return function(_0x491228){if(_0x491228){return _0x4c67ab['sendStatus'](_0x1986e9);}return _0x4c67ab[_0xdccf('0x18')](_0x1986e9)[_0xdccf('0x19')]();};}function respondWithResult(_0x5541d4,_0xa28acc){_0xa28acc=_0xa28acc||0xc8;return function(_0x5359a3){if(_0x5359a3){return _0x5541d4[_0xdccf('0x18')](_0xa28acc)['json'](_0x5359a3);}};}function respondWithFilteredResult(_0x44b791,_0x772511){return function(_0x20b6c3){if(_0x20b6c3){var _0x356fcb=typeof _0x772511[_0xdccf('0x1a')]===_0xdccf('0x1b')&&typeof _0x772511[_0xdccf('0x1c')]==='undefined';var _0x308544=_0x20b6c3[_0xdccf('0x1d')];var _0x3dbbd4=_0x356fcb?0x0:_0x772511[_0xdccf('0x1a')];var _0x584cdd=_0x356fcb?_0x20b6c3[_0xdccf('0x1d')]:_0x772511['offset']+_0x772511['limit'];var _0x5375e3;if(_0x584cdd>=_0x308544){_0x584cdd=_0x308544;_0x5375e3=0xc8;}else{_0x5375e3=0xce;}_0x44b791[_0xdccf('0x18')](_0x5375e3);return _0x44b791[_0xdccf('0x1e')](_0xdccf('0x1f'),_0x3dbbd4+'-'+_0x584cdd+'/'+_0x308544)[_0xdccf('0x20')](_0x20b6c3);}return null;};}function patchUpdates(_0x30ccec){return function(_0x16c347){try{jsonpatch[_0xdccf('0x21')](_0x16c347,_0x30ccec,!![]);}catch(_0x29bbc2){return BPromise[_0xdccf('0x22')](_0x29bbc2);}return _0x16c347[_0xdccf('0x23')]();};}function saveUpdates(_0x25d3aa,_0x7a729d){return function(_0x349b74){if(_0x349b74){return _0x349b74['update'](_0x25d3aa)[_0xdccf('0x24')](function(_0x2be2b3){return _0x2be2b3;});}return null;};}function removeEntity(_0x195a4e,_0x3c37ce){return function(_0x10914b){if(_0x10914b){return _0x10914b[_0xdccf('0x25')]()[_0xdccf('0x24')](function(){_0x195a4e[_0xdccf('0x18')](0xcc)[_0xdccf('0x19')]();});}};}function handleEntityNotFound(_0x34e02,_0x43bfaa){return function(_0x986390){if(!_0x986390){_0x34e02[_0xdccf('0x26')](0x194);}return _0x986390;};}function handleError(_0x1b3a86,_0x116565){_0x116565=_0x116565||0x1f4;return function(_0x118086){logger['error'](_0x118086['stack']);if(_0x118086['name']){delete _0x118086['name'];}_0x1b3a86['status'](_0x116565)['send'](_0x118086);};}exports[_0xdccf('0x27')]=function(_0x287fc3,_0x20345e){var _0x4791fa={},_0x4f50fa={},_0x44e7e7={'count':0x0,'rows':[]};var _0xd7900a=_[_0xdccf('0x28')](db['SquareDetailsReport'][_0xdccf('0x29')],function(_0x3ace6c){return{'name':_0x3ace6c[_0xdccf('0x2a')],'type':_0x3ace6c['type'][_0xdccf('0x2b')]};});_0x4f50fa['model']=_[_0xdccf('0x28')](_0xd7900a,'name');_0x4f50fa['query']=_[_0xdccf('0x2c')](_0x287fc3['query']);_0x4f50fa[_0xdccf('0x2d')]=_[_0xdccf('0x2e')](_0x4f50fa['model'],_0x4f50fa[_0xdccf('0x2f')]);_0x4791fa[_0xdccf('0x30')]=_[_0xdccf('0x2e')](_0x4f50fa[_0xdccf('0x31')],qs[_0xdccf('0x32')](_0x287fc3['query'][_0xdccf('0x32')]));_0x4791fa[_0xdccf('0x30')]=_0x4791fa['attributes'][_0xdccf('0x33')]?_0x4791fa[_0xdccf('0x30')]:_0x4f50fa[_0xdccf('0x31')];if(!_0x287fc3[_0xdccf('0x2f')][_0xdccf('0x34')]('nolimit')){_0x4791fa[_0xdccf('0x1c')]=qs[_0xdccf('0x1c')](_0x287fc3[_0xdccf('0x2f')][_0xdccf('0x1c')]);_0x4791fa[_0xdccf('0x1a')]=qs[_0xdccf('0x1a')](_0x287fc3['query'][_0xdccf('0x1a')]);}_0x4791fa[_0xdccf('0x35')]=qs[_0xdccf('0x36')](_0x287fc3[_0xdccf('0x2f')][_0xdccf('0x36')]);_0x4791fa[_0xdccf('0x37')]=qs[_0xdccf('0x2d')](_[_0xdccf('0x38')](_0x287fc3['query'],_0x4f50fa[_0xdccf('0x2d')]),_0xd7900a);if(_0x287fc3[_0xdccf('0x2f')][_0xdccf('0x39')]){_0x4791fa[_0xdccf('0x37')]=_[_0xdccf('0x3a')](_0x4791fa[_0xdccf('0x37')],{'$or':_[_0xdccf('0x28')](_0xd7900a,function(_0x5f3fa0){if(_0x5f3fa0[_0xdccf('0x3b')]!==_0xdccf('0x3c')){var _0x56cf7d={};_0x56cf7d[_0x5f3fa0[_0xdccf('0x3d')]]={'$like':'%'+_0x287fc3[_0xdccf('0x2f')][_0xdccf('0x39')]+'%'};return _0x56cf7d;}})});}_0x4791fa=_[_0xdccf('0x3a')]({},_0x4791fa,_0x287fc3[_0xdccf('0x3e')]);var _0x1c1759={'where':_0x4791fa['where']};return db['SquareDetailsReport'][_0xdccf('0x1d')](_0x1c1759)['then'](function(_0x4124dc){_0x44e7e7[_0xdccf('0x1d')]=_0x4124dc;if(_0x287fc3['query']['includeAll']){_0x4791fa['include']=[{'all':!![]}];}return db[_0xdccf('0x3f')][_0xdccf('0x40')](_0x4791fa);})[_0xdccf('0x24')](function(_0x557821){_0x44e7e7[_0xdccf('0x41')]=_0x557821;return _0x44e7e7;})[_0xdccf('0x24')](respondWithFilteredResult(_0x20345e,_0x4791fa))[_0xdccf('0x42')](handleError(_0x20345e,null));};exports[_0xdccf('0x43')]=function(_0x2fd3d6,_0xe760e8){var _0x97088b={'raw':!![],'where':{'id':_0x2fd3d6['params']['id']}},_0x15ebdd={};_0x15ebdd['model']=_[_0xdccf('0x2c')](db[_0xdccf('0x3f')][_0xdccf('0x29')]);_0x15ebdd['query']=_['keys'](_0x2fd3d6['query']);_0x15ebdd['filters']=_[_0xdccf('0x2e')](_0x15ebdd['model'],_0x15ebdd[_0xdccf('0x2f')]);_0x97088b[_0xdccf('0x30')]=_[_0xdccf('0x2e')](_0x15ebdd[_0xdccf('0x31')],qs[_0xdccf('0x32')](_0x2fd3d6['query'][_0xdccf('0x32')]));_0x97088b['attributes']=_0x97088b[_0xdccf('0x30')][_0xdccf('0x33')]?_0x97088b[_0xdccf('0x30')]:_0x15ebdd[_0xdccf('0x31')];if(_0x2fd3d6[_0xdccf('0x2f')][_0xdccf('0x44')]){_0x97088b[_0xdccf('0x45')]=[{'all':!![]}];}_0x97088b=_[_0xdccf('0x3a')]({},_0x97088b,_0x2fd3d6[_0xdccf('0x3e')]);return db[_0xdccf('0x3f')]['find'](_0x97088b)[_0xdccf('0x24')](handleEntityNotFound(_0xe760e8,null))['then'](respondWithResult(_0xe760e8,null))[_0xdccf('0x42')](handleError(_0xe760e8,null));};exports['create']=function(_0x5cc1c7,_0x2b0a31){return db['SquareDetailsReport'][_0xdccf('0x46')](_0x5cc1c7['body'],{})[_0xdccf('0x24')](respondWithResult(_0x2b0a31,0xc9))['catch'](handleError(_0x2b0a31,null));};exports[_0xdccf('0x47')]=function(_0x162407,_0xed6cc5){if(_0x162407[_0xdccf('0x48')]['id']){delete _0x162407[_0xdccf('0x48')]['id'];}return db['SquareDetailsReport'][_0xdccf('0x49')]({'where':{'id':_0x162407['params']['id']}})[_0xdccf('0x24')](handleEntityNotFound(_0xed6cc5,null))[_0xdccf('0x24')](saveUpdates(_0x162407[_0xdccf('0x48')],null))[_0xdccf('0x24')](respondWithResult(_0xed6cc5,null))[_0xdccf('0x42')](handleError(_0xed6cc5,null));};exports[_0xdccf('0x25')]=function(_0x51f6d3,_0x5224d6){return db[_0xdccf('0x3f')][_0xdccf('0x49')]({'where':{'id':_0x51f6d3[_0xdccf('0x4a')]['id']}})[_0xdccf('0x24')](handleEntityNotFound(_0x5224d6,null))[_0xdccf('0x24')](removeEntity(_0x5224d6,null))[_0xdccf('0x42')](handleError(_0x5224d6,null));};exports[_0xdccf('0x4b')]=function(_0xf25d82,_0x19c5f5){return db[_0xdccf('0x3f')][_0xdccf('0x4b')]()[_0xdccf('0x24')](respondWithResult(_0x19c5f5,null))[_0xdccf('0x42')](handleError(_0x19c5f5,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 87e3725..c2b6d53 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 _0xacc2=['bluebird','request-promise','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','api','moment'];(function(_0x3bac2c,_0x2d5bc1){var _0x3ffd6e=function(_0xef991a){while(--_0xef991a){_0x3bac2c['push'](_0x3bac2c['shift']());}};_0x3ffd6e(++_0x2d5bc1);}(_0xacc2,0x15b));var _0x2acc=function(_0x542413,_0xd9f7a0){_0x542413=_0x542413-0x0;var _0x336c7c=_0xacc2[_0x542413];return _0x336c7c;};'use strict';var _=require(_0x2acc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2acc('0x1'));var moment=require(_0x2acc('0x2'));var BPromise=require(_0x2acc('0x3'));var rp=require(_0x2acc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2acc('0x5'));var config=require('../../config/environment');var attributes=require(_0x2acc('0x6'));module[_0x2acc('0x7')]=function(_0x3f1eaf,_0x45b3fe){return _0x3f1eaf[_0x2acc('0x8')](_0x2acc('0x9'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5634=['exports','SquareDetailsReport','report_square_details','util','api','moment','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x4e24ec,_0x589ea7){var _0x2d3810=function(_0x5e893e){while(--_0x5e893e){_0x4e24ec['push'](_0x4e24ec['shift']());}};_0x2d3810(++_0x589ea7);}(_0x5634,0x1dc));var _0x4563=function(_0x139210,_0x7f7852){_0x139210=_0x139210-0x0;var _0x590200=_0x5634[_0x139210];return _0x590200;};'use strict';var _=require('lodash');var util=require(_0x4563('0x0'));var logger=require('../../config/logger')(_0x4563('0x1'));var moment=require(_0x4563('0x2'));var BPromise=require('bluebird');var rp=require(_0x4563('0x3'));var fs=require('fs');var path=require(_0x4563('0x4'));var rimraf=require(_0x4563('0x5'));var config=require(_0x4563('0x6'));var attributes=require(_0x4563('0x7'));module[_0x4563('0x8')]=function(_0x5998ad,_0x26b369){return _0x5998ad['define'](_0x4563('0x9'),attributes,{'tableName':_0x4563('0xa'),'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 1f7ff1a..673efbb 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 _0xa5fa=['../../config/environment','jayson/promise','client','http','request','info','debug','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x2def74,_0x5ec6fb){_0x2def74=_0x2def74-0x0;var _0x14f89f=_0xa5fa[_0x2def74];return _0x14f89f;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var moment=require(_0xaa5f('0x1'));var BPromise=require(_0xaa5f('0x2'));var rs=require(_0xaa5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5f('0x4'))['db'];var utils=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var jayson=require(_0xaa5f('0x8'));var client=jayson[_0xaa5f('0x9')][_0xaa5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13b606,_0x302138,_0xc326df){return new BPromise(function(_0x74f64f,_0x3f550e){return client[_0xaa5f('0xb')](_0x13b606,_0xc326df)['then'](function(_0x1674c2){logger[_0xaa5f('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x302138,'request\x20sent');logger[_0xaa5f('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x302138,'request\x20sent',JSON[_0xaa5f('0xe')](_0x1674c2));if(_0x1674c2['error']){if(_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x10')]===0x1f4){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')]['message']);return _0x3f550e(_0x1674c2[_0xaa5f('0xf')]['message']);}logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x12')]);return _0x74f64f(_0x1674c2[_0xaa5f('0xf')]['message']);}else{logger['info'](_0xaa5f('0x11'),_0x302138,_0xaa5f('0x13'));_0x74f64f(_0x1674c2[_0xaa5f('0x14')][_0xaa5f('0x12')]);}})[_0xaa5f('0x15')](function(_0x1fa36a){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1fa36a);_0x3f550e(_0x1fa36a);});});}exports[_0xaa5f('0x16')]=function(_0x3d874f){var _0x22175f=this;return new Promise(function(_0x1019e8,_0x4f4cd5){return db[_0xaa5f('0x17')][_0xaa5f('0x18')](_0x3d874f[_0xaa5f('0x19')],{'raw':_0x3d874f[_0xaa5f('0x1a')]?_0x3d874f[_0xaa5f('0x1a')][_0xaa5f('0x1b')]===undefined?!![]:![]:!![]})[_0xaa5f('0x1c')](function(_0x194691){logger[_0xaa5f('0xc')](_0xaa5f('0x16'),_0x3d874f);logger[_0xaa5f('0xd')](_0xaa5f('0x16'),_0x3d874f,JSON[_0xaa5f('0xe')](_0x194691));_0x1019e8(_0x194691);})['catch'](function(_0x1e917d){logger['error'](_0xaa5f('0x16'),_0x1e917d[_0xaa5f('0x12')],_0x3d874f);_0x4f4cd5(_0x22175f['error'](0x1f4,_0x1e917d[_0xaa5f('0x12')]));});});}; \ No newline at end of file +var _0x6a95=['message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x315f7c,_0x2d4e0c){var _0x3ecd33=function(_0x1cb883){while(--_0x1cb883){_0x315f7c['push'](_0x315f7c['shift']());}};_0x3ecd33(++_0x2d4e0c);}(_0x6a95,0x1db));var _0x56a9=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x6a95[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var moment=require(_0x56a9('0x2'));var BPromise=require(_0x56a9('0x3'));var rs=require(_0x56a9('0x4'));var fs=require('fs');var Redis=require(_0x56a9('0x5'));var db=require(_0x56a9('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x56a9('0x7'));var config=require(_0x56a9('0x8'));var jayson=require(_0x56a9('0x9'));var client=jayson[_0x56a9('0xa')][_0x56a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x365093,_0xd8aa7c,_0x5d3e80){return new BPromise(function(_0x5f0dcb,_0x3ac626){return client[_0x56a9('0xc')](_0x365093,_0x5d3e80)['then'](function(_0xe4b98c){logger[_0x56a9('0xd')](_0x56a9('0xe'),_0xd8aa7c,_0x56a9('0xf'));logger[_0x56a9('0x10')](_0x56a9('0x11'),_0xd8aa7c,_0x56a9('0xf'),JSON[_0x56a9('0x12')](_0xe4b98c));if(_0xe4b98c[_0x56a9('0x13')]){if(_0xe4b98c['error'][_0x56a9('0x14')]===0x1f4){logger['error'](_0x56a9('0xe'),_0xd8aa7c,_0xe4b98c[_0x56a9('0x13')][_0x56a9('0x15')]);return _0x3ac626(_0xe4b98c[_0x56a9('0x13')][_0x56a9('0x15')]);}logger[_0x56a9('0x13')](_0x56a9('0xe'),_0xd8aa7c,_0xe4b98c[_0x56a9('0x13')][_0x56a9('0x15')]);return _0x5f0dcb(_0xe4b98c['error']['message']);}else{logger[_0x56a9('0xd')](_0x56a9('0xe'),_0xd8aa7c,_0x56a9('0xf'));_0x5f0dcb(_0xe4b98c[_0x56a9('0x16')]['message']);}})[_0x56a9('0x17')](function(_0x4853a3){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0xd8aa7c,_0x4853a3);_0x3ac626(_0x4853a3);});});}exports[_0x56a9('0x18')]=function(_0x576bdf){var _0x59c0ec=this;return new Promise(function(_0x105fe5,_0x459a87){return db[_0x56a9('0x19')][_0x56a9('0x1a')](_0x576bdf[_0x56a9('0x1b')],{'raw':_0x576bdf[_0x56a9('0x1c')]?_0x576bdf[_0x56a9('0x1c')][_0x56a9('0x1d')]===undefined?!![]:![]:!![]})[_0x56a9('0x1e')](function(_0x5f145f){logger['info'](_0x56a9('0x18'),_0x576bdf);logger[_0x56a9('0x10')](_0x56a9('0x18'),_0x576bdf,JSON[_0x56a9('0x12')](_0x5f145f));_0x105fe5(_0x5f145f);})['catch'](function(_0x6100fe){logger[_0x56a9('0x13')](_0x56a9('0x18'),_0x6100fe[_0x56a9('0x15')],_0x576bdf);_0x459a87(_0x59c0ec['error'](0x1f4,_0x6100fe[_0x56a9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 4924036..20f770f 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 _0xcd5f=['./system.controller','isAuthenticated','index','get','/process/:pid/kill','killProcess','exports','express'];(function(_0x1e9df4,_0x4e3182){var _0x262009=function(_0x4e9b4f){while(--_0x4e9b4f){_0x1e9df4['push'](_0x1e9df4['shift']());}};_0x262009(++_0x4e3182);}(_0xcd5f,0x107));var _0xfcd5=function(_0x34c6e9,_0x462eda){_0x34c6e9=_0x34c6e9-0x0;var _0x873bbe=_0xcd5f[_0x34c6e9];return _0x873bbe;};'use strict';var express=require(_0xfcd5('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xfcd5('0x1'));router['get']('/',auth[_0xfcd5('0x2')](),controller[_0xfcd5('0x3')]);router[_0xfcd5('0x4')](_0xfcd5('0x5'),auth[_0xfcd5('0x2')](),controller[_0xfcd5('0x6')]);module[_0xfcd5('0x7')]=router; \ No newline at end of file +var _0x999f=['get','isAuthenticated','/process/:pid/kill','killProcess','express','Router'];(function(_0x3aec0e,_0x18561d){var _0x524a25=function(_0xc5bce2){while(--_0xc5bce2){_0x3aec0e['push'](_0x3aec0e['shift']());}};_0x524a25(++_0x18561d);}(_0x999f,0x82));var _0xf999=function(_0x4dcecc,_0x3865b9){_0x4dcecc=_0x4dcecc-0x0;var _0x2aa658=_0x999f[_0x4dcecc];return _0x2aa658;};'use strict';var express=require(_0xf999('0x0'));var router=express[_0xf999('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0xf999('0x2')]('/',auth[_0xf999('0x3')](),controller['index']);router[_0xf999('0x2')](_0xf999('0x4'),auth[_0xf999('0x3')](),controller[_0xf999('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 23e72e4..01c60e2 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 _0x2e07=['send','index','getAllData','then','status','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','util','lodash','error','name'];(function(_0x6ca7f4,_0x51a5df){var _0x494fa6=function(_0x359532){while(--_0x359532){_0x6ca7f4['push'](_0x6ca7f4['shift']());}};_0x494fa6(++_0x51a5df);}(_0x2e07,0x1a1));var _0x72e0=function(_0x4ab2f5,_0x453204){_0x4ab2f5=_0x4ab2f5-0x0;var _0x562c7c=_0x2e07[_0x4ab2f5];return _0x562c7c;};'use strict';var info=require(_0x72e0('0x0'));var exec=require(_0x72e0('0x1'))[_0x72e0('0x2')];var logger=require(_0x72e0('0x3'))('api');var util=require(_0x72e0('0x4'));var BPromise=require('bluebird');var _=require(_0x72e0('0x5'));function handleError(_0x3db0b5,_0x53fb2c,_0x4bf350){_0x53fb2c=_0x53fb2c||0x1f4;return function(_0x3194ca){logger[_0x72e0('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x4bf350,_0x53fb2c,util['inspect'](_0x3194ca,{'showHidden':![],'depth':null}));delete _0x3194ca[_0x72e0('0x7')];_0x3db0b5['status'](_0x53fb2c)[_0x72e0('0x8')](_0x3194ca);};}exports[_0x72e0('0x9')]=function(_0x4f182b,_0x1690f8){return info[_0x72e0('0xa')]()[_0x72e0('0xb')](function(_0x1aa4d9){return _0x1690f8[_0x72e0('0xc')](0xc8)[_0x72e0('0xd')](_0x1aa4d9);})[_0x72e0('0xe')](function(_0x308ad6){return _0x1690f8[_0x72e0('0xc')](0x1f4)[_0x72e0('0xd')](_0x308ad6);});};exports[_0x72e0('0xf')]=function(_0x55c6e6,_0xea4111){var _0x49c643=['components/import/cm'];return new BPromise(function(_0x3acbd4,_0x582590){return exec(util[_0x72e0('0x10')](_0x72e0('0x11'),_0x55c6e6[_0x72e0('0x12')]['pid']),function(_0x41e8d3,_0x304c20,_0x1bca6d){if(_0x41e8d3){return _0x582590(_0x41e8d3);}return _0x3acbd4(_0x304c20);});})[_0x72e0('0xb')](function(_0x7a9ba2){var _0x302fb1=![];var _0x4657fa=_0x7a9ba2['split'](/\n/);for(var _0x292864=0x0,_0x2a6c6a=_0x49c643[_0x72e0('0x13')];_0x292864<_0x2a6c6a,_0x302fb1===![];_0x292864+=0x1){if(_0x7a9ba2['indexOf'](_0x49c643[_0x292864])>=0x0){_0x302fb1=!![];}}if(!_0x302fb1){throw new Error(util[_0x72e0('0x10')](_0x72e0('0x14'),_0x55c6e6[_0x72e0('0x12')][_0x72e0('0x15')]));}process[_0x72e0('0x16')](_0x55c6e6['params']['pid'],_0x72e0('0x17'));return _0xea4111[_0x72e0('0xc')](0xc8)[_0x72e0('0xd')]({'message':util[_0x72e0('0x10')](_0x72e0('0x18'),_0x55c6e6['params'][_0x72e0('0x15')])});})[_0x72e0('0xe')](handleError(_0xea4111,null,_0x72e0('0xf')));}; \ No newline at end of file +var _0x39c7=['bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','then','catch','status','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','util'];(function(_0x226d14,_0x104424){var _0xba99f8=function(_0x5a8460){while(--_0x5a8460){_0x226d14['push'](_0x226d14['shift']());}};_0xba99f8(++_0x104424);}(_0x39c7,0xa4));var _0x739c=function(_0x1a82ef,_0x4b3d2a){_0x1a82ef=_0x1a82ef-0x0;var _0x42b015=_0x39c7[_0x1a82ef];return _0x42b015;};'use strict';var info=require(_0x739c('0x0'));var exec=require(_0x739c('0x1'))['exec'];var logger=require(_0x739c('0x2'))('api');var util=require(_0x739c('0x3'));var BPromise=require(_0x739c('0x4'));var _=require(_0x739c('0x5'));function handleError(_0x5abb26,_0x549974,_0x8ef087){_0x549974=_0x549974||0x1f4;return function(_0x3a4382){logger[_0x739c('0x6')](_0x739c('0x7'),_0x8ef087,_0x549974,util[_0x739c('0x8')](_0x3a4382,{'showHidden':![],'depth':null}));delete _0x3a4382[_0x739c('0x9')];_0x5abb26['status'](_0x549974)[_0x739c('0xa')](_0x3a4382);};}exports[_0x739c('0xb')]=function(_0x1a1161,_0x2f86d2){return info['getAllData']()[_0x739c('0xc')](function(_0x4e97b0){return _0x2f86d2['status'](0xc8)['json'](_0x4e97b0);})[_0x739c('0xd')](function(_0x468bc7){return _0x2f86d2[_0x739c('0xe')](0x1f4)[_0x739c('0xf')](_0x468bc7);});};exports[_0x739c('0x10')]=function(_0x2fda8f,_0xfc498a){var _0x5dcd20=[_0x739c('0x11')];return new BPromise(function(_0x42c60f,_0x194327){return exec(util[_0x739c('0x12')](_0x739c('0x13'),_0x2fda8f[_0x739c('0x14')][_0x739c('0x15')]),function(_0x2a570d,_0x51c1aa,_0x89b6ee){if(_0x2a570d){return _0x194327(_0x2a570d);}return _0x42c60f(_0x51c1aa);});})['then'](function(_0x52c17b){var _0x221662=![];var _0x182ca1=_0x52c17b[_0x739c('0x16')](/\n/);for(var _0x4a8d50=0x0,_0x285c07=_0x5dcd20[_0x739c('0x17')];_0x4a8d50<_0x285c07,_0x221662===![];_0x4a8d50+=0x1){if(_0x52c17b[_0x739c('0x18')](_0x5dcd20[_0x4a8d50])>=0x0){_0x221662=!![];}}if(!_0x221662){throw new Error(util[_0x739c('0x12')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x2fda8f[_0x739c('0x14')][_0x739c('0x15')]));}process[_0x739c('0x19')](_0x2fda8f[_0x739c('0x14')][_0x739c('0x15')],_0x739c('0x1a'));return _0xfc498a[_0x739c('0xe')](0xc8)[_0x739c('0xf')]({'message':util['format'](_0x739c('0x1b'),_0x2fda8f[_0x739c('0x14')][_0x739c('0x15')])});})[_0x739c('0xd')](handleError(_0xfc498a,null,_0x739c('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 27c4254..861efe2 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 _0x54bc=['get','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x6c772,_0x590e17){var _0x3f660c=function(_0x510ae6){while(--_0x510ae6){_0x6c772['push'](_0x6c772['shift']());}};_0x3f660c(++_0x590e17);}(_0x54bc,0x10e));var _0xc54b=function(_0x1e111b,_0x2ce0a8){_0x1e111b=_0x1e111b-0x0;var _0x559ccd=_0x54bc[_0x1e111b];return _0x559ccd;};'use strict';var multer=require(_0xc54b('0x0'));var util=require('util');var path=require(_0xc54b('0x1'));var timeout=require('connect-timeout');var express=require(_0xc54b('0x2'));var router=express[_0xc54b('0x3')]();var fs_extra=require(_0xc54b('0x4'));var auth=require(_0xc54b('0x5'));var interaction=require(_0xc54b('0x6'));var config=require(_0xc54b('0x7'));var controller=require('./tag.controller');router['get']('/',auth[_0xc54b('0x8')](),controller[_0xc54b('0x9')]);router[_0xc54b('0xa')]('/:id',auth[_0xc54b('0x8')](),controller[_0xc54b('0xb')]);router[_0xc54b('0xc')]('/',auth['isAuthenticated'](),controller[_0xc54b('0xd')]);router[_0xc54b('0xe')](_0xc54b('0xf'),auth['isAuthenticated'](),controller[_0xc54b('0x10')]);router[_0xc54b('0x11')](_0xc54b('0xf'),auth[_0xc54b('0x8')](),controller[_0xc54b('0x12')]);module[_0xc54b('0x13')]=router; \ No newline at end of file +var _0x332c=['../../components/interaction/service','get','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x49c6cc,_0x308bdb){var _0x22e239=function(_0x48507d){while(--_0x48507d){_0x49c6cc['push'](_0x49c6cc['shift']());}};_0x22e239(++_0x308bdb);}(_0x332c,0x11b));var _0xc332=function(_0x24fa33,_0x2c12d5){_0x24fa33=_0x24fa33-0x0;var _0x393732=_0x332c[_0x24fa33];return _0x393732;};'use strict';var multer=require(_0xc332('0x0'));var util=require(_0xc332('0x1'));var path=require(_0xc332('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc332('0x3')]();var fs_extra=require(_0xc332('0x4'));var auth=require(_0xc332('0x5'));var interaction=require(_0xc332('0x6'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0xc332('0x7')]('/',auth[_0xc332('0x8')](),controller['index']);router[_0xc332('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc332('0x9')]);router[_0xc332('0xa')]('/',auth[_0xc332('0x8')](),controller['create']);router[_0xc332('0xb')](_0xc332('0xc'),auth[_0xc332('0x8')](),controller[_0xc332('0xd')]);router[_0xc332('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xc332('0xf')]);module[_0xc332('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 1edd2b2..b89b0b9 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 _0xbc87=['#0091EA','sequelize','exports','name','STRING'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xbc87,0x1cd));var _0x7bc8=function(_0x3ce865,_0xb4581d){_0x3ce865=_0x3ce865-0x0;var _0x50de2d=_0xbc87[_0x3ce865];return _0x50de2d;};'use strict';var Sequelize=require(_0x7bc8('0x0'));module[_0x7bc8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7bc8('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x7bc8('0x3')],'defaultValue':_0x7bc8('0x4')},'description':{'type':Sequelize[_0x7bc8('0x3')]}}; \ No newline at end of file +var _0x1beb=['STRING','#0091EA','sequelize','exports','name'];(function(_0x2bd38c,_0x3a6607){var _0x34fc3b=function(_0x3fb732){while(--_0x3fb732){_0x2bd38c['push'](_0x2bd38c['shift']());}};_0x34fc3b(++_0x3a6607);}(_0x1beb,0x165));var _0xb1be=function(_0x5d231b,_0x3365e8){_0x5d231b=_0x5d231b-0x0;var _0xcb4467=_0x1beb[_0x5d231b];return _0xcb4467;};'use strict';var Sequelize=require(_0xb1be('0x0'));module[_0xb1be('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb1be('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xb1be('0x3')],'defaultValue':_0xb1be('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 1b43944..67853a1 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 _0x9567=['save','update','then','get','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x59cd66,_0x5a663a){var _0x159efb=function(_0x418329){while(--_0x418329){_0x59cd66['push'](_0x59cd66['shift']());}};_0x159efb(++_0x5a663a);}(_0x9567,0xdc));var _0x7956=function(_0x1eb5c3,_0x52975e){_0x1eb5c3=_0x1eb5c3-0x0;var _0x563f9d=_0x9567[_0x1eb5c3];return _0x563f9d;};'use strict';var emlformat=require(_0x7956('0x0'));var rimraf=require(_0x7956('0x1'));var zipdir=require(_0x7956('0x2'));var jsonpatch=require(_0x7956('0x3'));var rp=require(_0x7956('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7956('0x5'));var util=require(_0x7956('0x6'));var path=require('path');var sox=require(_0x7956('0x7'));var csv=require('to-csv');var ejs=require(_0x7956('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7956('0x9'));var squel=require(_0x7956('0xa'));var crypto=require('crypto');var jsforce=require(_0x7956('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7956('0xc'));var querystring=require(_0x7956('0xd'));var Papa=require('papaparse');var Redis=require(_0x7956('0xe'));var authService=require(_0x7956('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7956('0x10'));var hardwareService=require(_0x7956('0x11'));var logger=require(_0x7956('0x12'))('api');var utils=require(_0x7956('0x13'));var config=require(_0x7956('0x14'));var licenseUtil=require(_0x7956('0x15'));var db=require(_0x7956('0x16'))['db'];function respondWithStatusCode(_0x5b3531,_0x1d2e5d){_0x1d2e5d=_0x1d2e5d||0xcc;return function(_0x9d985e){if(_0x9d985e){return _0x5b3531[_0x7956('0x17')](_0x1d2e5d);}return _0x5b3531['status'](_0x1d2e5d)[_0x7956('0x18')]();};}function respondWithResult(_0x43c7f6,_0x248b79){_0x248b79=_0x248b79||0xc8;return function(_0x3a408a){if(_0x3a408a){return _0x43c7f6[_0x7956('0x19')](_0x248b79)[_0x7956('0x1a')](_0x3a408a);}};}function respondWithFilteredResult(_0x197360,_0x436573){return function(_0x24ea8d){if(_0x24ea8d){var _0x6a6d78=typeof _0x436573[_0x7956('0x1b')]===_0x7956('0x1c')&&typeof _0x436573[_0x7956('0x1d')]===_0x7956('0x1c');var _0x1e8040=_0x24ea8d[_0x7956('0x1e')];var _0x5e6b90=_0x6a6d78?0x0:_0x436573['offset'];var _0x10b29c=_0x6a6d78?_0x24ea8d[_0x7956('0x1e')]:_0x436573['offset']+_0x436573[_0x7956('0x1d')];var _0x584922;if(_0x10b29c>=_0x1e8040){_0x10b29c=_0x1e8040;_0x584922=0xc8;}else{_0x584922=0xce;}_0x197360[_0x7956('0x19')](_0x584922);return _0x197360[_0x7956('0x1f')]('Content-Range',_0x5e6b90+'-'+_0x10b29c+'/'+_0x1e8040)[_0x7956('0x1a')](_0x24ea8d);}return null;};}function patchUpdates(_0x2e31cd){return function(_0xc500bd){try{jsonpatch['apply'](_0xc500bd,_0x2e31cd,!![]);}catch(_0x8a58ea){return BPromise['reject'](_0x8a58ea);}return _0xc500bd[_0x7956('0x20')]();};}function saveUpdates(_0x5100d8,_0x427500){return function(_0x8a7165){if(_0x8a7165){return _0x8a7165[_0x7956('0x21')](_0x5100d8)[_0x7956('0x22')](function(_0x4d4d95){return _0x4d4d95;});}return null;};}function removeEntity(_0x19c033,_0x3f13b7){return function(_0x432a2d){if(_0x432a2d){return _0x432a2d['destroy']()['then'](function(){var _0x45f866=_0x432a2d[_0x7956('0x23')]({'plain':!![]});var _0x40d2d6=_0x7956('0x24');return db[_0x7956('0x25')]['destroy']({'where':{'type':_0x40d2d6,'resourceId':_0x45f866['id']}})[_0x7956('0x22')](function(){return _0x432a2d;});})[_0x7956('0x22')](function(){_0x19c033[_0x7956('0x19')](0xcc)[_0x7956('0x18')]();});}};}function handleEntityNotFound(_0x16d978,_0x30392c){return function(_0x4821d7){if(!_0x4821d7){_0x16d978[_0x7956('0x17')](0x194);}return _0x4821d7;};}function handleError(_0x33401e,_0x377261){_0x377261=_0x377261||0x1f4;return function(_0x3de345){logger[_0x7956('0x26')](_0x3de345[_0x7956('0x27')]);if(_0x3de345[_0x7956('0x28')]){delete _0x3de345[_0x7956('0x28')];}_0x33401e[_0x7956('0x19')](_0x377261)[_0x7956('0x29')](_0x3de345);};}exports[_0x7956('0x2a')]=function(_0xe64c4f,_0x21fb1b){var _0x2a00c1={},_0x3de2b5={},_0x378e31={'count':0x0,'rows':[]};var _0x305e30=_[_0x7956('0x2b')](db[_0x7956('0x2c')][_0x7956('0x2d')],function(_0x5bb0f1){return{'name':_0x5bb0f1[_0x7956('0x2e')],'type':_0x5bb0f1[_0x7956('0x2f')][_0x7956('0x30')]};});_0x3de2b5[_0x7956('0x31')]=_[_0x7956('0x2b')](_0x305e30,_0x7956('0x28'));_0x3de2b5['query']=_[_0x7956('0x32')](_0xe64c4f[_0x7956('0x33')]);_0x3de2b5['filters']=_[_0x7956('0x34')](_0x3de2b5[_0x7956('0x31')],_0x3de2b5[_0x7956('0x33')]);_0x2a00c1[_0x7956('0x35')]=_[_0x7956('0x34')](_0x3de2b5[_0x7956('0x31')],qs[_0x7956('0x36')](_0xe64c4f[_0x7956('0x33')][_0x7956('0x36')]));_0x2a00c1[_0x7956('0x35')]=_0x2a00c1[_0x7956('0x35')][_0x7956('0x37')]?_0x2a00c1[_0x7956('0x35')]:_0x3de2b5[_0x7956('0x31')];if(!_0xe64c4f[_0x7956('0x33')][_0x7956('0x38')]('nolimit')){_0x2a00c1[_0x7956('0x1d')]=qs[_0x7956('0x1d')](_0xe64c4f['query'][_0x7956('0x1d')]);_0x2a00c1['offset']=qs[_0x7956('0x1b')](_0xe64c4f['query']['offset']);}_0x2a00c1[_0x7956('0x39')]=qs['sort'](_0xe64c4f[_0x7956('0x33')][_0x7956('0x3a')]);_0x2a00c1[_0x7956('0x3b')]=qs[_0x7956('0x3c')](_[_0x7956('0x3d')](_0xe64c4f[_0x7956('0x33')],_0x3de2b5[_0x7956('0x3c')]),_0x305e30);if(_0xe64c4f[_0x7956('0x33')][_0x7956('0x3e')]){_0x2a00c1['where']=_[_0x7956('0x3f')](_0x2a00c1['where'],{'$or':_[_0x7956('0x2b')](_0x305e30,function(_0x14b2b2){if(_0x14b2b2[_0x7956('0x2f')]!==_0x7956('0x40')){var _0x4fd0fc={};_0x4fd0fc[_0x14b2b2[_0x7956('0x28')]]={'$like':'%'+_0xe64c4f[_0x7956('0x33')]['filter']+'%'};return _0x4fd0fc;}})});}_0x2a00c1=_['merge']({},_0x2a00c1,_0xe64c4f[_0x7956('0x41')]);var _0x4e9279={'where':_0x2a00c1[_0x7956('0x3b')]};return db[_0x7956('0x2c')][_0x7956('0x1e')](_0x4e9279)['then'](function(_0x387237){_0x378e31[_0x7956('0x1e')]=_0x387237;if(_0xe64c4f['query'][_0x7956('0x42')]){_0x2a00c1['include']=[{'all':!![]}];}return db[_0x7956('0x2c')][_0x7956('0x43')](_0x2a00c1);})[_0x7956('0x22')](function(_0x31cea9){_0x378e31[_0x7956('0x44')]=_0x31cea9;return _0x378e31;})['then'](respondWithFilteredResult(_0x21fb1b,_0x2a00c1))['catch'](handleError(_0x21fb1b,null));};exports[_0x7956('0x45')]=function(_0x475c42,_0x20d5fa){var _0x21fd73={'raw':!![],'where':{'id':_0x475c42[_0x7956('0x46')]['id']}},_0x23472d={};_0x23472d['model']=_[_0x7956('0x32')](db[_0x7956('0x2c')][_0x7956('0x2d')]);_0x23472d[_0x7956('0x33')]=_[_0x7956('0x32')](_0x475c42[_0x7956('0x33')]);_0x23472d[_0x7956('0x3c')]=_[_0x7956('0x34')](_0x23472d[_0x7956('0x31')],_0x23472d[_0x7956('0x33')]);_0x21fd73[_0x7956('0x35')]=_[_0x7956('0x34')](_0x23472d[_0x7956('0x31')],qs[_0x7956('0x36')](_0x475c42[_0x7956('0x33')]['fields']));_0x21fd73[_0x7956('0x35')]=_0x21fd73['attributes']['length']?_0x21fd73[_0x7956('0x35')]:_0x23472d[_0x7956('0x31')];if(_0x475c42[_0x7956('0x33')][_0x7956('0x42')]){_0x21fd73[_0x7956('0x47')]=[{'all':!![]}];}_0x21fd73=_[_0x7956('0x3f')]({},_0x21fd73,_0x475c42[_0x7956('0x41')]);return db[_0x7956('0x2c')][_0x7956('0x48')](_0x21fd73)[_0x7956('0x22')](handleEntityNotFound(_0x20d5fa,null))[_0x7956('0x22')](respondWithResult(_0x20d5fa,null))[_0x7956('0x49')](handleError(_0x20d5fa,null));};exports[_0x7956('0x4a')]=function(_0x2ba635,_0x3158aa){return db[_0x7956('0x2c')][_0x7956('0x4a')](_0x2ba635[_0x7956('0x4b')],{})[_0x7956('0x22')](function(_0x2c8b8f){var _0x3b0c2e=_0x2ba635[_0x7956('0x4c')]['get']({'plain':!![]});if(!_0x3b0c2e)throw new Error(_0x7956('0x4d'));if(_0x3b0c2e[_0x7956('0x4e')]===_0x7956('0x4c')){var _0x493092=_0x2c8b8f[_0x7956('0x23')]({'plain':!![]});var _0x583766=_0x7956('0x24');return db[_0x7956('0x4f')]['find']({'where':{'name':_0x583766,'userProfileId':_0x3b0c2e[_0x7956('0x50')]},'raw':!![]})[_0x7956('0x22')](function(_0x5cc4d3){if(_0x5cc4d3&&_0x5cc4d3[_0x7956('0x51')]===0x0){return db[_0x7956('0x25')]['create']({'name':_0x493092[_0x7956('0x28')],'resourceId':_0x493092['id'],'type':_0x5cc4d3[_0x7956('0x28')],'sectionId':_0x5cc4d3['id']},{})[_0x7956('0x22')](function(){return _0x2c8b8f;});}else{return _0x2c8b8f;}})[_0x7956('0x49')](function(_0x3c592a){logger[_0x7956('0x26')](_0x7956('0x52'),_0x3c592a);throw _0x3c592a;});}return _0x2c8b8f;})['then'](respondWithResult(_0x3158aa,0xc9))[_0x7956('0x49')](handleError(_0x3158aa,null));};exports[_0x7956('0x21')]=function(_0x1b69d1,_0x43e920){if(_0x1b69d1['body']['id']){delete _0x1b69d1[_0x7956('0x4b')]['id'];}return db[_0x7956('0x2c')][_0x7956('0x48')]({'where':{'id':_0x1b69d1[_0x7956('0x46')]['id']}})[_0x7956('0x22')](handleEntityNotFound(_0x43e920,null))[_0x7956('0x22')](saveUpdates(_0x1b69d1[_0x7956('0x4b')],null))[_0x7956('0x22')](respondWithResult(_0x43e920,null))[_0x7956('0x49')](handleError(_0x43e920,null));};exports[_0x7956('0x53')]=function(_0x29a005,_0x1d2af8){return db[_0x7956('0x2c')][_0x7956('0x48')]({'where':{'id':_0x29a005['params']['id']}})[_0x7956('0x22')](handleEntityNotFound(_0x1d2af8,null))[_0x7956('0x22')](removeEntity(_0x1d2af8,null))[_0x7956('0x49')](handleError(_0x1d2af8,null));}; \ No newline at end of file +var _0xb07f=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','include','Tag','findAll','rows','catch','show','params','keys','length','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xb07f,0x109));var _0xfb07=function(_0x27876a,_0xded9f2){_0x27876a=_0x27876a-0x0;var _0x538bea=_0xb07f[_0x27876a];return _0x538bea;};'use strict';var emlformat=require(_0xfb07('0x0'));var rimraf=require(_0xfb07('0x1'));var zipdir=require(_0xfb07('0x2'));var jsonpatch=require(_0xfb07('0x3'));var rp=require(_0xfb07('0x4'));var moment=require(_0xfb07('0x5'));var BPromise=require(_0xfb07('0x6'));var Mustache=require(_0xfb07('0x7'));var util=require(_0xfb07('0x8'));var path=require(_0xfb07('0x9'));var sox=require(_0xfb07('0xa'));var csv=require('to-csv');var ejs=require(_0xfb07('0xb'));var fs=require('fs');var fs_extra=require(_0xfb07('0xc'));var _=require(_0xfb07('0xd'));var squel=require(_0xfb07('0xe'));var crypto=require(_0xfb07('0xf'));var jsforce=require(_0xfb07('0x10'));var deskjs=require(_0xfb07('0x11'));var toCsv=require(_0xfb07('0x12'));var querystring=require(_0xfb07('0x13'));var Papa=require(_0xfb07('0x14'));var Redis=require(_0xfb07('0x15'));var authService=require(_0xfb07('0x16'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb07('0x17'))(_0xfb07('0x18'));var utils=require('../../config/utils');var config=require(_0xfb07('0x19'));var licenseUtil=require(_0xfb07('0x1a'));var db=require(_0xfb07('0x1b'))['db'];function respondWithStatusCode(_0x13275d,_0x2ad2cf){_0x2ad2cf=_0x2ad2cf||0xcc;return function(_0x35fd11){if(_0x35fd11){return _0x13275d[_0xfb07('0x1c')](_0x2ad2cf);}return _0x13275d['status'](_0x2ad2cf)[_0xfb07('0x1d')]();};}function respondWithResult(_0x40bf71,_0x3c69db){_0x3c69db=_0x3c69db||0xc8;return function(_0x2c35e4){if(_0x2c35e4){return _0x40bf71[_0xfb07('0x1e')](_0x3c69db)[_0xfb07('0x1f')](_0x2c35e4);}};}function respondWithFilteredResult(_0x29cbae,_0x228e2a){return function(_0x2363d6){if(_0x2363d6){var _0x6a14e0=typeof _0x228e2a[_0xfb07('0x20')]===_0xfb07('0x21')&&typeof _0x228e2a[_0xfb07('0x22')]===_0xfb07('0x21');var _0x4ebcc3=_0x2363d6['count'];var _0x3e747e=_0x6a14e0?0x0:_0x228e2a[_0xfb07('0x20')];var _0x197f12=_0x6a14e0?_0x2363d6['count']:_0x228e2a[_0xfb07('0x20')]+_0x228e2a[_0xfb07('0x22')];var _0x527c4e;if(_0x197f12>=_0x4ebcc3){_0x197f12=_0x4ebcc3;_0x527c4e=0xc8;}else{_0x527c4e=0xce;}_0x29cbae['status'](_0x527c4e);return _0x29cbae[_0xfb07('0x23')](_0xfb07('0x24'),_0x3e747e+'-'+_0x197f12+'/'+_0x4ebcc3)[_0xfb07('0x1f')](_0x2363d6);}return null;};}function patchUpdates(_0x2c6c44){return function(_0x388995){try{jsonpatch[_0xfb07('0x25')](_0x388995,_0x2c6c44,!![]);}catch(_0x15e153){return BPromise[_0xfb07('0x26')](_0x15e153);}return _0x388995[_0xfb07('0x27')]();};}function saveUpdates(_0x578bb2,_0x45806a){return function(_0x56d0c4){if(_0x56d0c4){return _0x56d0c4[_0xfb07('0x28')](_0x578bb2)[_0xfb07('0x29')](function(_0x428c85){return _0x428c85;});}return null;};}function removeEntity(_0x301c1a,_0xb2063a){return function(_0x508d3b){if(_0x508d3b){return _0x508d3b[_0xfb07('0x2a')]()[_0xfb07('0x29')](function(){var _0x10835a=_0x508d3b[_0xfb07('0x2b')]({'plain':!![]});var _0x3b14fa=_0xfb07('0x2c');return db['UserProfileResource'][_0xfb07('0x2a')]({'where':{'type':_0x3b14fa,'resourceId':_0x10835a['id']}})[_0xfb07('0x29')](function(){return _0x508d3b;});})['then'](function(){_0x301c1a[_0xfb07('0x1e')](0xcc)[_0xfb07('0x1d')]();});}};}function handleEntityNotFound(_0xe813a7,_0x149ac0){return function(_0x46927a){if(!_0x46927a){_0xe813a7[_0xfb07('0x1c')](0x194);}return _0x46927a;};}function handleError(_0x20f01a,_0x24ff99){_0x24ff99=_0x24ff99||0x1f4;return function(_0x95f1d){logger[_0xfb07('0x2d')](_0x95f1d[_0xfb07('0x2e')]);if(_0x95f1d['name']){delete _0x95f1d[_0xfb07('0x2f')];}_0x20f01a[_0xfb07('0x1e')](_0x24ff99)[_0xfb07('0x30')](_0x95f1d);};}exports[_0xfb07('0x31')]=function(_0x5dd4c9,_0x46d57e){var _0xd5290c={},_0x4ce9a4={},_0x36da2a={'count':0x0,'rows':[]};var _0x5dc353=_[_0xfb07('0x32')](db['Tag'][_0xfb07('0x33')],function(_0x4a8d4c){return{'name':_0x4a8d4c[_0xfb07('0x34')],'type':_0x4a8d4c[_0xfb07('0x35')][_0xfb07('0x36')]};});_0x4ce9a4[_0xfb07('0x37')]=_[_0xfb07('0x32')](_0x5dc353,_0xfb07('0x2f'));_0x4ce9a4['query']=_['keys'](_0x5dd4c9[_0xfb07('0x38')]);_0x4ce9a4[_0xfb07('0x39')]=_[_0xfb07('0x3a')](_0x4ce9a4[_0xfb07('0x37')],_0x4ce9a4['query']);_0xd5290c['attributes']=_[_0xfb07('0x3a')](_0x4ce9a4[_0xfb07('0x37')],qs[_0xfb07('0x3b')](_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x3b')]));_0xd5290c[_0xfb07('0x3c')]=_0xd5290c['attributes']['length']?_0xd5290c['attributes']:_0x4ce9a4[_0xfb07('0x37')];if(!_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x3d')](_0xfb07('0x3e'))){_0xd5290c['limit']=qs['limit'](_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x22')]);_0xd5290c['offset']=qs['offset'](_0x5dd4c9['query'][_0xfb07('0x20')]);}_0xd5290c[_0xfb07('0x3f')]=qs['sort'](_0x5dd4c9['query'][_0xfb07('0x40')]);_0xd5290c[_0xfb07('0x41')]=qs[_0xfb07('0x39')](_[_0xfb07('0x42')](_0x5dd4c9[_0xfb07('0x38')],_0x4ce9a4['filters']),_0x5dc353);if(_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x43')]){_0xd5290c[_0xfb07('0x41')]=_[_0xfb07('0x44')](_0xd5290c['where'],{'$or':_['map'](_0x5dc353,function(_0x2d40cb){if(_0x2d40cb[_0xfb07('0x35')]!==_0xfb07('0x45')){var _0xc5df59={};_0xc5df59[_0x2d40cb[_0xfb07('0x2f')]]={'$like':'%'+_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x43')]+'%'};return _0xc5df59;}})});}_0xd5290c=_['merge']({},_0xd5290c,_0x5dd4c9['options']);var _0x44dafb={'where':_0xd5290c[_0xfb07('0x41')]};return db['Tag']['count'](_0x44dafb)[_0xfb07('0x29')](function(_0x20d682){_0x36da2a[_0xfb07('0x46')]=_0x20d682;if(_0x5dd4c9['query']['includeAll']){_0xd5290c[_0xfb07('0x47')]=[{'all':!![]}];}return db[_0xfb07('0x48')][_0xfb07('0x49')](_0xd5290c);})[_0xfb07('0x29')](function(_0xb87b68){_0x36da2a[_0xfb07('0x4a')]=_0xb87b68;return _0x36da2a;})[_0xfb07('0x29')](respondWithFilteredResult(_0x46d57e,_0xd5290c))[_0xfb07('0x4b')](handleError(_0x46d57e,null));};exports[_0xfb07('0x4c')]=function(_0x492f1b,_0x41df3f){var _0x12c588={'raw':!![],'where':{'id':_0x492f1b[_0xfb07('0x4d')]['id']}},_0x3d6372={};_0x3d6372[_0xfb07('0x37')]=_[_0xfb07('0x4e')](db[_0xfb07('0x48')][_0xfb07('0x33')]);_0x3d6372[_0xfb07('0x38')]=_[_0xfb07('0x4e')](_0x492f1b['query']);_0x3d6372['filters']=_[_0xfb07('0x3a')](_0x3d6372[_0xfb07('0x37')],_0x3d6372['query']);_0x12c588[_0xfb07('0x3c')]=_[_0xfb07('0x3a')](_0x3d6372[_0xfb07('0x37')],qs[_0xfb07('0x3b')](_0x492f1b[_0xfb07('0x38')]['fields']));_0x12c588['attributes']=_0x12c588[_0xfb07('0x3c')][_0xfb07('0x4f')]?_0x12c588[_0xfb07('0x3c')]:_0x3d6372[_0xfb07('0x37')];if(_0x492f1b[_0xfb07('0x38')][_0xfb07('0x50')]){_0x12c588[_0xfb07('0x47')]=[{'all':!![]}];}_0x12c588=_[_0xfb07('0x44')]({},_0x12c588,_0x492f1b[_0xfb07('0x51')]);return db[_0xfb07('0x48')]['find'](_0x12c588)['then'](handleEntityNotFound(_0x41df3f,null))['then'](respondWithResult(_0x41df3f,null))[_0xfb07('0x4b')](handleError(_0x41df3f,null));};exports['create']=function(_0x2397f8,_0x31cca8){return db[_0xfb07('0x48')][_0xfb07('0x52')](_0x2397f8[_0xfb07('0x53')],{})[_0xfb07('0x29')](function(_0x4d464e){var _0x3b2cce=_0x2397f8[_0xfb07('0x54')][_0xfb07('0x2b')]({'plain':!![]});if(!_0x3b2cce)throw new Error(_0xfb07('0x55'));if(_0x3b2cce[_0xfb07('0x56')]==='user'){var _0x3cfb89=_0x4d464e[_0xfb07('0x2b')]({'plain':!![]});var _0x40fa4a=_0xfb07('0x2c');return db[_0xfb07('0x57')]['find']({'where':{'name':_0x40fa4a,'userProfileId':_0x3b2cce[_0xfb07('0x58')]},'raw':!![]})[_0xfb07('0x29')](function(_0x38b30e){if(_0x38b30e&&_0x38b30e[_0xfb07('0x59')]===0x0){return db[_0xfb07('0x5a')]['create']({'name':_0x3cfb89[_0xfb07('0x2f')],'resourceId':_0x3cfb89['id'],'type':_0x38b30e[_0xfb07('0x2f')],'sectionId':_0x38b30e['id']},{})[_0xfb07('0x29')](function(){return _0x4d464e;});}else{return _0x4d464e;}})[_0xfb07('0x4b')](function(_0x4e597d){logger[_0xfb07('0x2d')](_0xfb07('0x5b'),_0x4e597d);throw _0x4e597d;});}return _0x4d464e;})[_0xfb07('0x29')](respondWithResult(_0x31cca8,0xc9))[_0xfb07('0x4b')](handleError(_0x31cca8,null));};exports[_0xfb07('0x28')]=function(_0x165628,_0x353b33){if(_0x165628[_0xfb07('0x53')]['id']){delete _0x165628[_0xfb07('0x53')]['id'];}return db[_0xfb07('0x48')]['find']({'where':{'id':_0x165628[_0xfb07('0x4d')]['id']}})['then'](handleEntityNotFound(_0x353b33,null))[_0xfb07('0x29')](saveUpdates(_0x165628[_0xfb07('0x53')],null))[_0xfb07('0x29')](respondWithResult(_0x353b33,null))[_0xfb07('0x4b')](handleError(_0x353b33,null));};exports[_0xfb07('0x2a')]=function(_0x7746bb,_0x1c76af){return db['Tag']['find']({'where':{'id':_0x7746bb['params']['id']}})[_0xfb07('0x29')](handleEntityNotFound(_0x1c76af,null))[_0xfb07('0x29')](removeEntity(_0x1c76af,null))[_0xfb07('0x4b')](handleError(_0x1c76af,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index ef29a6c..904ba9e 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 _0xac3d=['define','tools_tags','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xac3d,0x92));var _0xdac3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdac3('0x0'));var util=require(_0xdac3('0x1'));var logger=require('../../config/logger')(_0xdac3('0x2'));var moment=require(_0xdac3('0x3'));var BPromise=require(_0xdac3('0x4'));var rp=require(_0xdac3('0x5'));var fs=require('fs');var path=require(_0xdac3('0x6'));var rimraf=require(_0xdac3('0x7'));var config=require(_0xdac3('0x8'));var attributes=require(_0xdac3('0x9'));module['exports']=function(_0x29b537,_0x56cda3){return _0x29b537[_0xdac3('0xa')]('Tag',attributes,{'tableName':_0xdac3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09a9=['request-promise','path','rimraf','./tag.attributes','exports','define','tools_tags','lodash','util','../../config/logger','api'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x09a9,0x1ca));var _0x909a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x09a9[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0x909a('0x0'));var util=require(_0x909a('0x1'));var logger=require(_0x909a('0x2'))(_0x909a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x909a('0x4'));var fs=require('fs');var path=require(_0x909a('0x5'));var rimraf=require(_0x909a('0x6'));var config=require('../../config/environment');var attributes=require(_0x909a('0x7'));module[_0x909a('0x8')]=function(_0x4286c8,_0x3e315c){return _0x4286c8[_0x909a('0x9')]('Tag',attributes,{'tableName':_0x909a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index a71f891..1c5c690 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 _0xf72b=['../../config/environment','jayson/promise','client','request','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x59c6dc,_0x2f43d2){var _0x3ae1b6=function(_0x155bd3){while(--_0x155bd3){_0x59c6dc['push'](_0x59c6dc['shift']());}};_0x3ae1b6(++_0x2f43d2);}(_0xf72b,0x1d9));var _0xbf72=function(_0x24a4ea,_0x2ac37e){_0x24a4ea=_0x24a4ea-0x0;var _0x1f79ab=_0xf72b[_0x24a4ea];return _0x1f79ab;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var moment=require(_0xbf72('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf72('0x2'));var fs=require('fs');var Redis=require(_0xbf72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf72('0x4'));var logger=require(_0xbf72('0x5'))(_0xbf72('0x6'));var config=require(_0xbf72('0x7'));var jayson=require(_0xbf72('0x8'));var client=jayson[_0xbf72('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41c11d,_0xc0842b,_0x119807){return new BPromise(function(_0xd0402c,_0xdd6177){return client[_0xbf72('0xa')](_0x41c11d,_0x119807)['then'](function(_0x455891){logger['info'](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));logger['debug'](_0xbf72('0xd'),_0xc0842b,_0xbf72('0xc'),JSON[_0xbf72('0xe')](_0x455891));if(_0x455891[_0xbf72('0xf')]){if(_0x455891[_0xbf72('0xf')][_0xbf72('0x10')]===0x1f4){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x455891['error'][_0xbf72('0x11')]);return _0xdd6177(_0x455891[_0xbf72('0xf')][_0xbf72('0x11')]);}logger['error'](_0xbf72('0xb'),_0xc0842b,_0x455891['error']['message']);return _0xd0402c(_0x455891['error'][_0xbf72('0x11')]);}else{logger[_0xbf72('0x12')](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));_0xd0402c(_0x455891[_0xbf72('0x13')][_0xbf72('0x11')]);}})['catch'](function(_0x266ce2){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x266ce2);_0xdd6177(_0x266ce2);});});} \ No newline at end of file +var _0x9221=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x57c653,_0x40bcfd){var _0x54616c=function(_0x5a8754){while(--_0x5a8754){_0x57c653['push'](_0x57c653['shift']());}};_0x54616c(++_0x40bcfd);}(_0x9221,0x64));var _0x1922=function(_0x291728,_0x5f4842){_0x291728=_0x291728-0x0;var _0x10444c=_0x9221[_0x291728];return _0x10444c;};'use strict';var _=require('lodash');var util=require(_0x1922('0x0'));var moment=require(_0x1922('0x1'));var BPromise=require('bluebird');var rs=require(_0x1922('0x2'));var fs=require('fs');var Redis=require(_0x1922('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1922('0x4'));var logger=require(_0x1922('0x5'))(_0x1922('0x6'));var config=require(_0x1922('0x7'));var jayson=require(_0x1922('0x8'));var client=jayson[_0x1922('0x9')][_0x1922('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aa05c,_0x116227,_0x3cfd98){return new BPromise(function(_0x195fa4,_0x47c225){return client[_0x1922('0xb')](_0x5aa05c,_0x3cfd98)['then'](function(_0x2b6c51){logger[_0x1922('0xc')](_0x1922('0xd'),_0x116227,'request\x20sent');logger[_0x1922('0xe')](_0x1922('0xf'),_0x116227,'request\x20sent',JSON[_0x1922('0x10')](_0x2b6c51));if(_0x2b6c51['error']){if(_0x2b6c51[_0x1922('0x11')]['code']===0x1f4){logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x2b6c51[_0x1922('0x11')]['message']);return _0x47c225(_0x2b6c51['error'][_0x1922('0x12')]);}logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x2b6c51[_0x1922('0x11')][_0x1922('0x12')]);return _0x195fa4(_0x2b6c51['error'][_0x1922('0x12')]);}else{logger['info'](_0x1922('0xd'),_0x116227,_0x1922('0x13'));_0x195fa4(_0x2b6c51[_0x1922('0x14')][_0x1922('0x12')]);}})['catch'](function(_0x459511){logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x459511);_0x47c225(_0x459511);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 62d3677..7a0073e 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(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 006d6e6..73afffa 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 _0x0713=['STRING','name'];(function(_0x312255,_0x2d6b65){var _0x173106=function(_0x4dfd9b){while(--_0x4dfd9b){_0x312255['push'](_0x312255['shift']());}};_0x173106(++_0x2d6b65);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x1daa48,_0x69cd5c){var _0x5d1be2=function(_0x8fce8c){while(--_0x8fce8c){_0x1daa48['push'](_0x1daa48['shift']());}};_0x5d1be2(++_0x69cd5c);}(_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')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 39b8758..0495a07 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 _0x5ef0=['UserProfileResource','catch','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','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','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','getQueues','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','addQueues','findOne','ValidationError','add','Queues','ids','remove','isArray','Voice','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','UserVoiceQueueRt','isNil','interface','format','SIP/%s','TeamVoiceQueue','all','TeamVoicePrefix','upsert','VoicePrefixId','addAgents','spread','Chat','removeAgents','Queue:remove','UserVoicePrefix','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./team.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ef0,0xea));var _0x05ef=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5ef0[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x05ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x05ef('0x1'));var jsonpatch=require(_0x05ef('0x2'));var rp=require(_0x05ef('0x3'));var moment=require(_0x05ef('0x4'));var BPromise=require(_0x05ef('0x5'));var Mustache=require(_0x05ef('0x6'));var util=require(_0x05ef('0x7'));var path=require(_0x05ef('0x8'));var sox=require('sox');var csv=require(_0x05ef('0x9'));var ejs=require(_0x05ef('0xa'));var fs=require('fs');var fs_extra=require(_0x05ef('0xb'));var _=require('lodash');var squel=require(_0x05ef('0xc'));var crypto=require(_0x05ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x05ef('0xe'));var toCsv=require(_0x05ef('0x9'));var querystring=require(_0x05ef('0xf'));var Papa=require('papaparse');var Redis=require(_0x05ef('0x10'));var authService=require(_0x05ef('0x11'));var qs=require(_0x05ef('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05ef('0x13'));var logger=require(_0x05ef('0x14'))(_0x05ef('0x15'));var utils=require('../../config/utils');var config=require(_0x05ef('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x05ef('0x17'))['db'];config[_0x05ef('0x18')]=_[_0x05ef('0x19')](config[_0x05ef('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05ef('0x18')]));require(_0x05ef('0x1a'))[_0x05ef('0x1b')](socket);function respondWithStatusCode(_0xf01acc,_0x27d998){_0x27d998=_0x27d998||0xcc;return function(_0x5835ce){if(_0x5835ce){return _0xf01acc[_0x05ef('0x1c')](_0x27d998);}return _0xf01acc[_0x05ef('0x1d')](_0x27d998)[_0x05ef('0x1e')]();};}function respondWithResult(_0x3ce44c,_0x284eeb){_0x284eeb=_0x284eeb||0xc8;return function(_0x55ac1c){if(_0x55ac1c){return _0x3ce44c[_0x05ef('0x1d')](_0x284eeb)[_0x05ef('0x1f')](_0x55ac1c);}};}function respondWithFilteredResult(_0xf273b,_0x3bcaf2){return function(_0x3124e9){if(_0x3124e9){var _0x1aa28f=typeof _0x3bcaf2[_0x05ef('0x20')]===_0x05ef('0x21')&&typeof _0x3bcaf2['limit']==='undefined';var _0x375f82=_0x3124e9[_0x05ef('0x22')];var _0x28f1d9=_0x1aa28f?0x0:_0x3bcaf2['offset'];var _0xf229b=_0x1aa28f?_0x3124e9['count']:_0x3bcaf2['offset']+_0x3bcaf2[_0x05ef('0x23')];var _0x172a2a;if(_0xf229b>=_0x375f82){_0xf229b=_0x375f82;_0x172a2a=0xc8;}else{_0x172a2a=0xce;}_0xf273b[_0x05ef('0x1d')](_0x172a2a);return _0xf273b[_0x05ef('0x24')](_0x05ef('0x25'),_0x28f1d9+'-'+_0xf229b+'/'+_0x375f82)[_0x05ef('0x1f')](_0x3124e9);}return null;};}function patchUpdates(_0x12a028){return function(_0xc4b64b){try{jsonpatch[_0x05ef('0x26')](_0xc4b64b,_0x12a028,!![]);}catch(_0x4a88ef){return BPromise[_0x05ef('0x27')](_0x4a88ef);}return _0xc4b64b[_0x05ef('0x28')]();};}function saveUpdates(_0x3bbd2a,_0x4d1da0){return function(_0x3e83f6){if(_0x3e83f6){return _0x3e83f6[_0x05ef('0x29')](_0x3bbd2a)[_0x05ef('0x2a')](function(_0x45ae8d){return _0x45ae8d;});}return null;};}function handleEntityNotFound(_0x2f6b97,_0x585f3a){return function(_0x1f24eb){if(!_0x1f24eb){_0x2f6b97[_0x05ef('0x1c')](0x194);}return _0x1f24eb;};}function handleError(_0x21e2a4,_0x194e41){_0x194e41=_0x194e41||0x1f4;return function(_0x4c3bb1){logger[_0x05ef('0x2b')](_0x4c3bb1[_0x05ef('0x2c')]);if(_0x4c3bb1[_0x05ef('0x2d')]){delete _0x4c3bb1[_0x05ef('0x2d')];}_0x21e2a4[_0x05ef('0x1d')](_0x194e41)[_0x05ef('0x2e')](_0x4c3bb1);};}exports[_0x05ef('0x2f')]=function(_0x4bb444,_0x4ec630){var _0x335706={},_0x5a0915={},_0x2a42f1={'count':0x0,'rows':[]};var _0x241ba9=_[_0x05ef('0x30')](db[_0x05ef('0x31')][_0x05ef('0x32')],function(_0x2bc64e){return{'name':_0x2bc64e[_0x05ef('0x33')],'type':_0x2bc64e[_0x05ef('0x34')][_0x05ef('0x35')]};});_0x5a0915[_0x05ef('0x36')]=_[_0x05ef('0x30')](_0x241ba9,'name');_0x5a0915[_0x05ef('0x37')]=_['keys'](_0x4bb444[_0x05ef('0x37')]);_0x5a0915[_0x05ef('0x38')]=_[_0x05ef('0x39')](_0x5a0915['model'],_0x5a0915[_0x05ef('0x37')]);_0x335706[_0x05ef('0x3a')]=_[_0x05ef('0x39')](_0x5a0915[_0x05ef('0x36')],qs[_0x05ef('0x3b')](_0x4bb444[_0x05ef('0x37')][_0x05ef('0x3b')]));_0x335706['attributes']=_0x335706[_0x05ef('0x3a')][_0x05ef('0x3c')]?_0x335706[_0x05ef('0x3a')]:_0x5a0915[_0x05ef('0x36')];if(!_0x4bb444[_0x05ef('0x37')][_0x05ef('0x3d')]('nolimit')){_0x335706[_0x05ef('0x23')]=qs[_0x05ef('0x23')](_0x4bb444['query'][_0x05ef('0x23')]);_0x335706[_0x05ef('0x20')]=qs[_0x05ef('0x20')](_0x4bb444[_0x05ef('0x37')][_0x05ef('0x20')]);}_0x335706[_0x05ef('0x3e')]=qs[_0x05ef('0x3f')](_0x4bb444['query'][_0x05ef('0x3f')]);_0x335706[_0x05ef('0x40')]=qs[_0x05ef('0x38')](_[_0x05ef('0x41')](_0x4bb444[_0x05ef('0x37')],_0x5a0915[_0x05ef('0x38')]),_0x241ba9);if(_0x4bb444['query'][_0x05ef('0x42')]){_0x335706[_0x05ef('0x40')]=_[_0x05ef('0x43')](_0x335706[_0x05ef('0x40')],{'$or':_[_0x05ef('0x30')](_0x241ba9,function(_0x4235d9){if(_0x4235d9['type']!==_0x05ef('0x44')){var _0x21ed08={};_0x21ed08[_0x4235d9['name']]={'$like':'%'+_0x4bb444[_0x05ef('0x37')][_0x05ef('0x42')]+'%'};return _0x21ed08;}})});}_0x335706=_[_0x05ef('0x43')]({},_0x335706,_0x4bb444[_0x05ef('0x45')]);var _0x18a7a9={'where':_0x335706['where']};return db['Team'][_0x05ef('0x22')](_0x18a7a9)[_0x05ef('0x2a')](function(_0x5c5f77){_0x2a42f1[_0x05ef('0x22')]=_0x5c5f77;if(_0x4bb444[_0x05ef('0x37')][_0x05ef('0x46')]){_0x335706['include']=[{'all':!![]}];}return db['Team']['findAll'](_0x335706);})[_0x05ef('0x2a')](function(_0x5e4238){_0x2a42f1[_0x05ef('0x47')]=_0x5e4238;return _0x2a42f1;})[_0x05ef('0x2a')](respondWithFilteredResult(_0x4ec630,_0x335706))['catch'](handleError(_0x4ec630,null));};exports[_0x05ef('0x48')]=function(_0x4f5ae4,_0x2f06a1){var _0x4893c9={'raw':![],'where':{'id':_0x4f5ae4[_0x05ef('0x49')]['id']}},_0x46fc8d={};_0x46fc8d[_0x05ef('0x36')]=_[_0x05ef('0x4a')](db[_0x05ef('0x31')][_0x05ef('0x32')]);_0x46fc8d[_0x05ef('0x37')]=_[_0x05ef('0x4a')](_0x4f5ae4['query']);_0x46fc8d['filters']=_['intersection'](_0x46fc8d['model'],_0x46fc8d[_0x05ef('0x37')]);_0x4893c9[_0x05ef('0x3a')]=_[_0x05ef('0x39')](_0x46fc8d[_0x05ef('0x36')],qs[_0x05ef('0x3b')](_0x4f5ae4[_0x05ef('0x37')][_0x05ef('0x3b')]));_0x4893c9[_0x05ef('0x3a')]=_0x4893c9['attributes'][_0x05ef('0x3c')]?_0x4893c9[_0x05ef('0x3a')]:_0x46fc8d[_0x05ef('0x36')];if(_0x4f5ae4[_0x05ef('0x37')]['includeAll']){_0x4893c9['include']=[{'all':!![]}];}_0x4893c9=_['merge']({},_0x4893c9,_0x4f5ae4['options']);return db['Team'][_0x05ef('0x4b')](_0x4893c9)[_0x05ef('0x2a')](handleEntityNotFound(_0x2f06a1,null))[_0x05ef('0x2a')](respondWithResult(_0x2f06a1,null))['catch'](handleError(_0x2f06a1,null));};exports['create']=function(_0x3c2b7e,_0x2621e5){return db[_0x05ef('0x31')][_0x05ef('0x4c')](_0x3c2b7e[_0x05ef('0x4d')],{})['then'](function(_0x13c8ca){var _0x3cf823=_0x3c2b7e[_0x05ef('0x4e')][_0x05ef('0x4f')]({'plain':!![]});if(!_0x3cf823)throw new Error(_0x05ef('0x50'));if(_0x3cf823[_0x05ef('0x51')]===_0x05ef('0x4e')){var _0x44ab8b=_0x13c8ca[_0x05ef('0x4f')]({'plain':!![]});var _0x1f8894=_0x05ef('0x52');return db[_0x05ef('0x53')]['find']({'where':{'name':_0x1f8894,'userProfileId':_0x3cf823[_0x05ef('0x54')]},'raw':!![]})[_0x05ef('0x2a')](function(_0x203ca1){if(_0x203ca1&&_0x203ca1[_0x05ef('0x55')]===0x0){return db[_0x05ef('0x56')][_0x05ef('0x4c')]({'name':_0x44ab8b[_0x05ef('0x2d')],'resourceId':_0x44ab8b['id'],'type':_0x203ca1[_0x05ef('0x2d')],'sectionId':_0x203ca1['id']},{})['then'](function(){return _0x13c8ca;});}else{return _0x13c8ca;}})['catch'](function(_0x3eddfa){logger[_0x05ef('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3eddfa);throw _0x3eddfa;});}return _0x13c8ca;})[_0x05ef('0x2a')](respondWithResult(_0x2621e5,0xc9))[_0x05ef('0x57')](handleError(_0x2621e5,null));};exports[_0x05ef('0x29')]=function(_0x28aa03,_0x16238a){if(_0x28aa03[_0x05ef('0x4d')]['id']){delete _0x28aa03[_0x05ef('0x4d')]['id'];}return db['Team'][_0x05ef('0x4b')]({'where':{'id':_0x28aa03[_0x05ef('0x49')]['id']}})[_0x05ef('0x2a')](handleEntityNotFound(_0x16238a,null))['then'](saveUpdates(_0x28aa03[_0x05ef('0x4d')],null))[_0x05ef('0x2a')](respondWithResult(_0x16238a,null))[_0x05ef('0x57')](handleError(_0x16238a,null));};exports[_0x05ef('0x58')]=function(_0x35022b,_0x358835){var _0x5e0bf7=_0x35022b[_0x05ef('0x49')]['id'];var _0x413205=[];return db[_0x05ef('0x59')][_0x05ef('0x5a')](function(_0x4d123d){var _0xe838d3=_0x05ef('0x5b')+_0x5e0bf7;return db['sequelize'][_0x05ef('0x37')](_0xe838d3,{'type':db[_0x05ef('0x5c')]['QueryTypes'][_0x05ef('0x5d')],'raw':!![],'transaction':_0x4d123d})[_0x05ef('0x2a')](function(_0x4b4d25){_0x413205=_[_0x05ef('0x30')](_0x4b4d25,function(_0x590ce2){return Number(_0x590ce2['UserId']);});})[_0x05ef('0x2a')](function(){var _0xf230dc=_0x05ef('0x5e')+_0x5e0bf7;return db[_0x05ef('0x59')][_0x05ef('0x37')](_0xf230dc,{'type':db[_0x05ef('0x5c')][_0x05ef('0x5f')]['SELECT'],'raw':!![],'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(_0x3bf0fb){var _0x279e9c=_[_0x05ef('0x30')](_0x3bf0fb,function(_0x3a9152){return Number(_0x3a9152[_0x05ef('0x60')]);});return db[_0x05ef('0x61')][_0x05ef('0x58')]({'where':{'UserId':{'$in':_0x413205},'VoiceQueueId':{'$in':_0x279e9c}},'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(){var _0x3ff973=_0x05ef('0x62')+_0x5e0bf7;return db['sequelize']['query'](_0x3ff973,{'type':db['Sequelize'][_0x05ef('0x5f')][_0x05ef('0x5d')],'raw':!![],'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(_0x1c2a4b){var _0x6df26a=_[_0x05ef('0x30')](_0x1c2a4b,function(_0x445c46){return Number(_0x445c46[_0x05ef('0x63')]);});return db[_0x05ef('0x64')][_0x05ef('0x58')]({'where':{'UserId':{'$in':_0x413205},'MailQueueId':{'$in':_0x6df26a}},'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(){var _0x13df03=_0x05ef('0x65')+_0x5e0bf7;return db[_0x05ef('0x59')][_0x05ef('0x37')](_0x13df03,{'type':db[_0x05ef('0x5c')][_0x05ef('0x5f')][_0x05ef('0x5d')],'raw':!![],'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(_0x19a5a2){var _0x10c664=_['map'](_0x19a5a2,function(_0x83c29f){return Number(_0x83c29f['SmsQueueId']);});return db[_0x05ef('0x66')]['destroy']({'where':{'UserId':{'$in':_0x413205},'SmsQueueId':{'$in':_0x10c664}},'transaction':_0x4d123d});})['then'](function(){var _0x17ee46=_0x05ef('0x67')+_0x5e0bf7;return db[_0x05ef('0x59')]['query'](_0x17ee46,{'type':db[_0x05ef('0x5c')]['QueryTypes'][_0x05ef('0x5d')],'raw':!![],'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(_0x51e77b){var _0x3a2b9f=_[_0x05ef('0x30')](_0x51e77b,function(_0x158108){return Number(_0x158108['ChatQueueId']);});return db[_0x05ef('0x68')][_0x05ef('0x58')]({'where':{'UserId':{'$in':_0x413205},'ChatQueueId':{'$in':_0x3a2b9f}},'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(){var _0x5d0150=_0x05ef('0x69')+_0x5e0bf7;return db[_0x05ef('0x59')]['query'](_0x5d0150,{'type':db[_0x05ef('0x5c')]['QueryTypes'][_0x05ef('0x5d')],'raw':!![],'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(_0x141e05){var _0x3566f6=_['map'](_0x141e05,function(_0x5b1a9e){return Number(_0x5b1a9e[_0x05ef('0x6a')]);});return db[_0x05ef('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x413205},'FaxQueueId':{'$in':_0x3566f6}},'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(){var _0x10c2f9=_0x05ef('0x6c')+_0x5e0bf7;return db['sequelize'][_0x05ef('0x37')](_0x10c2f9,{'type':db[_0x05ef('0x5c')][_0x05ef('0x5f')][_0x05ef('0x5d')],'raw':!![],'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(_0x273b86){var _0x1e1d72=_[_0x05ef('0x30')](_0x273b86,function(_0xf64004){return Number(_0xf64004[_0x05ef('0x6d')]);});return db[_0x05ef('0x6e')][_0x05ef('0x58')]({'where':{'UserId':{'$in':_0x413205},'OpenchannelQueueId':{'$in':_0x1e1d72}},'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(){var _0x36a990=_0x05ef('0x6f')+_0x5e0bf7;return db[_0x05ef('0x59')][_0x05ef('0x37')](_0x36a990,{'type':db['Sequelize'][_0x05ef('0x5f')][_0x05ef('0x5d')],'raw':!![],'transaction':_0x4d123d});})['then'](function(_0x361ecd){var _0x220f93=_[_0x05ef('0x30')](_0x361ecd,function(_0x393080){return Number(_0x393080[_0x05ef('0x70')]);});return db['UserWhatsappQueue'][_0x05ef('0x58')]({'where':{'UserId':{'$in':_0x413205},'WhatsappQueueId':{'$in':_0x220f93}},'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x5e0bf7}});})['then'](function(_0x1ad74d){if(_0x1ad74d===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x413205},'VoicePrefixId':_0x1ad74d['VoicePrefixId']},'transaction':_0x4d123d});})[_0x05ef('0x2a')](function(){return db[_0x05ef('0x31')]['destroy']({'where':{'id':_0x5e0bf7},'cascade':!![],'transaction':_0x4d123d});})['then'](function(_0x40a64a){if(_0x40a64a===0x0){_0x358835[_0x05ef('0x1c')](0x194);}else{return db[_0x05ef('0x56')][_0x05ef('0x58')]({'where':{'type':_0x05ef('0x52'),'resourceId':_0x5e0bf7},'cascade':!![],'transaction':_0x4d123d})['then'](function(){_0x358835['status'](0xcc)[_0x05ef('0x1e')]();});}})[_0x05ef('0x57')](function(_0x5600b4){_0x358835[_0x05ef('0x1d')](0x1f4)[_0x05ef('0x2e')](_0x5600b4);});});};exports[_0x05ef('0x71')]=function(_0x207206,_0x354557,_0x2e2694){return db['Team']['findOne']({'where':{'id':_0x207206[_0x05ef('0x49')]['id']}})[_0x05ef('0x2a')](handleEntityNotFound(_0x354557,null))[_0x05ef('0x2a')](function(_0x437cc8){if(!_0x207206['query'][_0x05ef('0x72')]||!utils[_0x05ef('0x73')](_0x207206['query'][_0x05ef('0x72')])){throw new db[(_0x05ef('0x5c'))]['ValidationError'](_0x05ef('0x74'));}var _0x4bca76={};var _0x6c4d8a={};_0x6c4d8a[_0x05ef('0x36')]=_[_0x05ef('0x4a')](db[_[_0x05ef('0x75')](_0x207206[_0x05ef('0x37')]['channel'][_0x05ef('0x76')]())+_0x05ef('0x77')][_0x05ef('0x32')]);_0x6c4d8a[_0x05ef('0x37')]=_[_0x05ef('0x4a')](_0x207206['query']);_0x6c4d8a[_0x05ef('0x38')]=_['intersection'](_0x6c4d8a[_0x05ef('0x36')],_0x6c4d8a[_0x05ef('0x37')]);_0x4bca76[_0x05ef('0x3a')]=_[_0x05ef('0x39')](_0x6c4d8a[_0x05ef('0x36')],qs[_0x05ef('0x3b')](_0x207206['query']['fields']));_0x4bca76[_0x05ef('0x3a')]=_0x4bca76[_0x05ef('0x3a')][_0x05ef('0x3c')]?_0x4bca76[_0x05ef('0x3a')]:_0x6c4d8a[_0x05ef('0x36')];_0x4bca76[_0x05ef('0x23')]=qs['limit'](_0x207206[_0x05ef('0x37')][_0x05ef('0x23')]);_0x4bca76[_0x05ef('0x20')]=qs['offset'](_0x207206['query'][_0x05ef('0x20')]);_0x4bca76[_0x05ef('0x3e')]=qs[_0x05ef('0x3f')](_0x207206[_0x05ef('0x37')][_0x05ef('0x3f')]);_0x4bca76['where']=qs[_0x05ef('0x38')](_[_0x05ef('0x41')](_0x207206['query'],_0x6c4d8a['filters']));_0x4bca76=_['merge']({},_0x4bca76,_0x207206[_0x05ef('0x45')]);return _0x437cc8['get'+_['capitalize'](_0x207206['query']['channel']['toLowerCase']())+'Queues'](_0x4bca76);})[_0x05ef('0x2a')](respondWithResult(_0x354557,null))[_0x05ef('0x57')](handleError(_0x354557,null));};exports[_0x05ef('0x78')]=function(_0x4bd270,_0x10acae,_0x190ac6){return db[_0x05ef('0x31')][_0x05ef('0x79')]({'where':{'id':_0x4bd270[_0x05ef('0x49')]['id']}})[_0x05ef('0x2a')](function(_0x14bb5c){if(_0x14bb5c){if(!_0x4bd270[_0x05ef('0x4d')]['channel']||!utils[_0x05ef('0x73')](_0x4bd270[_0x05ef('0x4d')][_0x05ef('0x72')])){throw new db[(_0x05ef('0x5c'))][(_0x05ef('0x7a'))](_0x05ef('0x74'));}return _0x14bb5c[_0x05ef('0x7b')+_[_0x05ef('0x75')](_0x4bd270[_0x05ef('0x4d')][_0x05ef('0x72')][_0x05ef('0x76')]())+_0x05ef('0x7c')](_0x4bd270[_0x05ef('0x4d')][_0x05ef('0x7d')]);}return null;})[_0x05ef('0x2a')](handleEntityNotFound(_0x10acae,null))[_0x05ef('0x2a')](respondWithStatusCode(_0x10acae,null))[_0x05ef('0x57')](handleError(_0x10acae,null));};exports['removeQueues']=function(_0x25bb44,_0x35604c,_0x417a2e){return db[_0x05ef('0x31')]['findOne']({'where':{'id':_0x25bb44[_0x05ef('0x49')]['id']}})[_0x05ef('0x2a')](function(_0x55863e){if(_0x55863e){if(!_0x25bb44[_0x05ef('0x37')][_0x05ef('0x72')]||!utils[_0x05ef('0x73')](_0x25bb44['query'][_0x05ef('0x72')])){throw new db['Sequelize'][(_0x05ef('0x7a'))](_0x05ef('0x74'));}return _0x55863e[_0x05ef('0x7e')+_[_0x05ef('0x75')](_0x25bb44[_0x05ef('0x37')][_0x05ef('0x72')][_0x05ef('0x76')]())+'Queues'](_0x25bb44['query'][_0x05ef('0x7d')]);}return null;})['then'](handleEntityNotFound(_0x35604c,null))['then'](respondWithStatusCode(_0x35604c,null))[_0x05ef('0x57')](handleError(_0x35604c,null));};exports['addAgents']=function(_0x43c327,_0x382c18){var _0x497a6b=_[_0x05ef('0x7f')](_0x43c327['body'][_0x05ef('0x7d')])?_0x43c327['body'][_0x05ef('0x7d')]:[_0x43c327[_0x05ef('0x4d')]['ids']];var _0x533bb1=_0x43c327[_0x05ef('0x49')]['id'];return db[_0x05ef('0x31')]['find']({'where':{'id':_0x533bb1}})[_0x05ef('0x2a')](handleEntityNotFound(_0x382c18,null))['then'](function(_0x112e3c){if(_0x112e3c){var _0x1848ed=[_0x05ef('0x80'),'Chat','Mail',_0x05ef('0x81'),_0x05ef('0x82'),_0x05ef('0x83'),_0x05ef('0x84')];return db[_0x05ef('0x59')][_0x05ef('0x5a')](function(_0x199d10){var _0x475bb4=_[_0x05ef('0x30')](_0x1848ed,function(_0x3cf92a){var _0x32c362={'attributes':['id',_0x05ef('0x2d')]};if(_0x3cf92a===_0x05ef('0x80')){_0x32c362[_0x05ef('0x85')]={'attributes':[_0x05ef('0x86')]};}return _0x112e3c['get'+_0x3cf92a+_0x05ef('0x7c')](_0x32c362)['then'](function(_0x5ebb34){var _0x575af8=_[_0x05ef('0x30')](_0x5ebb34,function(_0x1b4153){var _0x205cdc=_[_0x05ef('0x30')](_0x497a6b,function(_0x366e01){var _0x4892a7={'where':{'UserId':_0x366e01,[_0x3cf92a+_0x05ef('0x87')]:_0x1b4153['id']},'transaction':_0x199d10};if(_0x3cf92a===_0x05ef('0x80')){_0x4892a7['defaults']={'penalty':_0x1b4153['TeamVoiceQueue'][_0x05ef('0x86')]};}return db[_0x05ef('0x88')+_0x3cf92a+_0x05ef('0x77')][_0x05ef('0x89')](_0x4892a7)[_0x05ef('0x2a')](function(){socket[_0x05ef('0x8a')](_0x05ef('0x4e')+_0x3cf92a+_0x05ef('0x8b'),{'UserId':_0x366e01,[_0x3cf92a+_0x05ef('0x87')]:_0x1b4153['id']});if(_0x3cf92a!=='Voice'){return;}return db[_0x05ef('0x88')][_0x05ef('0x8c')]({'where':{'id':_0x497a6b,'online':0x1},'attributes':['id',_0x05ef('0x2d'),_0x05ef('0x8d'),_0x05ef('0x8e'),'interface'],'raw':!![]})['then'](function(_0x26ca39){var _0x572676=_[_0x05ef('0x30')](_0x26ca39,function(_0x1dfa02){return db[_0x05ef('0x8f')]['upsert']({'membername':_0x1dfa02['name'],'UserId':_0x1dfa02['id'],'queue_name':_0x1b4153[_0x05ef('0x2d')],'VoiceQueueId':_0x1b4153['id'],'interface':_[_0x05ef('0x90')](_0x1dfa02[_0x05ef('0x91')])?util[_0x05ef('0x92')](_0x05ef('0x93'),_0x1dfa02[_0x05ef('0x2d')]):_0x1dfa02[_0x05ef('0x91')],'paused':_0x1dfa02[_0x05ef('0x8e')]||![],'penalty':_0x1b4153[_0x05ef('0x94')][_0x05ef('0x86')]},{'transaction':_0x199d10});});return Promise['all'](_0x572676);});});});return Promise[_0x05ef('0x95')](_0x205cdc);});return Promise[_0x05ef('0x95')](_0x575af8);})[_0x05ef('0x2a')](function(){return db[_0x05ef('0x96')][_0x05ef('0x79')]({'where':{'teamId':_0x533bb1}})[_0x05ef('0x2a')](function(_0x2f172a){if(_0x2f172a){var _0x2cbe16=_['map'](_0x497a6b,function(_0x10060c){db['UserVoicePrefix'][_0x05ef('0x97')]({'UserId':_0x10060c,'VoicePrefixId':_0x2f172a[_0x05ef('0x98')]});});return Promise['all'](_0x2cbe16);}});});});return Promise[_0x05ef('0x95')](_0x475bb4)[_0x05ef('0x2a')](function(){return _0x112e3c[_0x05ef('0x99')](_0x497a6b,{'transaction':_0x199d10})[_0x05ef('0x9a')](function(_0x47fc6a){return _0x47fc6a;});});});}})[_0x05ef('0x2a')](respondWithResult(_0x382c18,null))['catch'](handleError(_0x382c18,null));};exports['removeAgents']=function(_0x4f0fb9,_0x4321d3){var _0x2faec1=_[_0x05ef('0x7f')](_0x4f0fb9['query']['ids'])?_0x4f0fb9[_0x05ef('0x37')][_0x05ef('0x7d')]:[_0x4f0fb9[_0x05ef('0x37')][_0x05ef('0x7d')]];var _0x1e6805=_0x4f0fb9[_0x05ef('0x49')]['id'];return db[_0x05ef('0x31')][_0x05ef('0x4b')]({'where':{'id':_0x1e6805}})[_0x05ef('0x2a')](handleEntityNotFound(_0x4321d3,null))['then'](function(_0x3e30cf){if(_0x3e30cf){var _0x3f801d=[_0x05ef('0x80'),_0x05ef('0x9b'),'Mail',_0x05ef('0x81'),_0x05ef('0x82'),_0x05ef('0x83'),_0x05ef('0x84')];return db[_0x05ef('0x59')][_0x05ef('0x5a')](function(_0x558888){var _0x5d1d4b=_[_0x05ef('0x30')](_0x3f801d,function(_0x1c88a4){var _0x3a37f3={'attributes':['id',_0x05ef('0x2d')]};return _0x3e30cf[_0x05ef('0x4f')+_0x1c88a4+'Queues'](_0x3a37f3)['then'](function(_0x10aed9){var _0x4d8b7a=_[_0x05ef('0x30')](_0x10aed9,function(_0x1ac6ac){return _0x1ac6ac[_0x05ef('0x9c')](_0x2faec1,{'transaction':_0x558888})[_0x05ef('0x2a')](function(){var _0x4a9c5b=_['map'](_0x2faec1,function(_0x2b7bc8){socket[_0x05ef('0x8a')](_0x05ef('0x4e')+_0x1c88a4+_0x05ef('0x9d'),{'UserId':Number(_0x2b7bc8),[_0x1c88a4+_0x05ef('0x87')]:_0x1ac6ac['id']});if(_0x1c88a4!==_0x05ef('0x80')){return;}return db['UserVoiceQueueRt'][_0x05ef('0x58')]({'where':{'VoiceQueueId':_0x1ac6ac['id'],'UserId':_0x2b7bc8},'transaction':_0x558888});});return Promise[_0x05ef('0x95')](_0x4a9c5b);});});return Promise['all'](_0x4d8b7a);});});return Promise[_0x05ef('0x95')](_0x5d1d4b)[_0x05ef('0x2a')](function(){return _0x3e30cf[_0x05ef('0x9c')](_0x2faec1,{'transaction':_0x558888});})['then'](function(){return db[_0x05ef('0x96')][_0x05ef('0x79')]({'where':{'teamId':_0x1e6805}})['then'](function(_0x4df19a){if(_0x4df19a){var _0x908d36=_[_0x05ef('0x30')](_0x2faec1,function(_0x375b43){db[_0x05ef('0x9e')][_0x05ef('0x58')]({'where':{'UserId':_0x375b43,'VoicePrefixId':_0x4df19a['VoicePrefixId']}});});return Promise[_0x05ef('0x95')](_0x908d36);}});});});}})[_0x05ef('0x2a')](respondWithStatusCode(_0x4321d3,null))[_0x05ef('0x57')](handleError(_0x4321d3,null));};exports['getAgents']=function(_0x16a322,_0x3ce0c2,_0x3590ed){var _0x1e85c9={};var _0x294b9c={};var _0x4a2628;var _0x46b013;return db[_0x05ef('0x31')]['findOne']({'where':{'id':_0x16a322[_0x05ef('0x49')]['id']}})[_0x05ef('0x2a')](handleEntityNotFound(_0x3ce0c2,null))[_0x05ef('0x2a')](function(_0x5040e7){if(_0x5040e7){_0x4a2628=_0x5040e7;_0x294b9c[_0x05ef('0x36')]=_[_0x05ef('0x4a')](db[_0x05ef('0x88')][_0x05ef('0x32')]);_0x294b9c[_0x05ef('0x37')]=_[_0x05ef('0x4a')](_0x16a322[_0x05ef('0x37')]);_0x294b9c[_0x05ef('0x38')]=_['intersection'](_0x294b9c[_0x05ef('0x36')],_0x294b9c[_0x05ef('0x37')]);_0x1e85c9['attributes']=_[_0x05ef('0x39')](_0x294b9c[_0x05ef('0x36')],qs[_0x05ef('0x3b')](_0x16a322[_0x05ef('0x37')][_0x05ef('0x3b')]));_0x1e85c9['attributes']=_0x1e85c9[_0x05ef('0x3a')][_0x05ef('0x3c')]?_0x1e85c9['attributes']:_0x294b9c[_0x05ef('0x36')];_0x1e85c9[_0x05ef('0x3e')]=qs[_0x05ef('0x3f')](_0x16a322[_0x05ef('0x37')][_0x05ef('0x3f')]);_0x1e85c9['where']=qs[_0x05ef('0x38')](_[_0x05ef('0x41')](_0x16a322[_0x05ef('0x37')],_0x294b9c[_0x05ef('0x38')]));if(_0x16a322[_0x05ef('0x37')]['filter']){_0x1e85c9[_0x05ef('0x40')]=_[_0x05ef('0x43')](_0x1e85c9[_0x05ef('0x40')],{'$or':_[_0x05ef('0x30')](_0x1e85c9[_0x05ef('0x3a')],function(_0x3c0688){var _0x3eff66={};_0x3eff66[_0x3c0688]={'$like':'%'+_0x16a322[_0x05ef('0x37')][_0x05ef('0x42')]+'%'};return _0x3eff66;})});}_0x1e85c9=_[_0x05ef('0x43')]({},_0x1e85c9,_0x16a322[_0x05ef('0x45')]);return _0x4a2628[_0x05ef('0x9f')](_0x1e85c9);}})[_0x05ef('0x2a')](function(_0x14dac7){if(_0x14dac7){_0x46b013=_0x14dac7[_0x05ef('0x3c')];if(!_0x16a322[_0x05ef('0x37')]['hasOwnProperty']('nolimit')){_0x1e85c9[_0x05ef('0x23')]=qs[_0x05ef('0x23')](_0x16a322[_0x05ef('0x37')][_0x05ef('0x23')]);_0x1e85c9[_0x05ef('0x20')]=qs['offset'](_0x16a322[_0x05ef('0x37')][_0x05ef('0x20')]);}return _0x4a2628[_0x05ef('0x9f')](_0x1e85c9);}})[_0x05ef('0x2a')](function(_0x29654e){if(_0x29654e){return _0x29654e?{'count':_0x46b013,'rows':_0x29654e}:null;}})['then'](respondWithResult(_0x3ce0c2,null))[_0x05ef('0x57')](handleError(_0x3ce0c2,null));}; \ No newline at end of file +var _0x59af=['fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','keys','filters','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','end','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','rawAttributes','pick','options','Queues','addQueues','ids','removeQueues','addAgents','isArray','Chat','Mail','Sms','Openchannel','penalty','QueueId','Voice','defaults','User','findOrCreate','Queue:save','online','voicePause','upsert','isNil','interface','format','all','spread','removeAgents','Fax','emit','Queue:remove','UserVoiceQueueRt','getAgents','order','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./team.socket','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','map','Team'];(function(_0x2b2b8e,_0x29f88e){var _0x425e4d=function(_0xee1953){while(--_0xee1953){_0x2b2b8e['push'](_0x2b2b8e['shift']());}};_0x425e4d(++_0x29f88e);}(_0x59af,0x18f));var _0xf59a=function(_0x34d651,_0x1d0b09){_0x34d651=_0x34d651-0x0;var _0x4eaa39=_0x59af[_0x34d651];return _0x4eaa39;};'use strict';var emlformat=require(_0xf59a('0x0'));var rimraf=require(_0xf59a('0x1'));var zipdir=require(_0xf59a('0x2'));var jsonpatch=require(_0xf59a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf59a('0x4'));var Mustache=require('mustache');var util=require(_0xf59a('0x5'));var path=require(_0xf59a('0x6'));var sox=require(_0xf59a('0x7'));var csv=require(_0xf59a('0x8'));var ejs=require(_0xf59a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf59a('0xa'));var crypto=require(_0xf59a('0xb'));var jsforce=require(_0xf59a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf59a('0x8'));var querystring=require(_0xf59a('0xd'));var Papa=require('papaparse');var Redis=require(_0xf59a('0xe'));var authService=require(_0xf59a('0xf'));var qs=require(_0xf59a('0x10'));var as=require(_0xf59a('0x11'));var hardwareService=require(_0xf59a('0x12'));var logger=require(_0xf59a('0x13'))('api');var utils=require(_0xf59a('0x14'));var config=require(_0xf59a('0x15'));var licenseUtil=require(_0xf59a('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xf59a('0x17')],{'host':_0xf59a('0x18'),'port':0x18eb});var socket=require(_0xf59a('0x19'))(new Redis(config[_0xf59a('0x17')]));require(_0xf59a('0x1a'))['register'](socket);function respondWithStatusCode(_0x7b2d65,_0x323f58){_0x323f58=_0x323f58||0xcc;return function(_0x10ba17){if(_0x10ba17){return _0x7b2d65['sendStatus'](_0x323f58);}return _0x7b2d65[_0xf59a('0x1b')](_0x323f58)['end']();};}function respondWithResult(_0xb5b6e,_0xe8a1c0){_0xe8a1c0=_0xe8a1c0||0xc8;return function(_0x536da7){if(_0x536da7){return _0xb5b6e[_0xf59a('0x1b')](_0xe8a1c0)[_0xf59a('0x1c')](_0x536da7);}};}function respondWithFilteredResult(_0x4eb521,_0x216ce6){return function(_0x2aa705){if(_0x2aa705){var _0x16fcfc=typeof _0x216ce6[_0xf59a('0x1d')]==='undefined'&&typeof _0x216ce6[_0xf59a('0x1e')]===_0xf59a('0x1f');var _0x8354c2=_0x2aa705[_0xf59a('0x20')];var _0x24dc4d=_0x16fcfc?0x0:_0x216ce6['offset'];var _0x59ea03=_0x16fcfc?_0x2aa705['count']:_0x216ce6[_0xf59a('0x1d')]+_0x216ce6[_0xf59a('0x1e')];var _0x4cfeea;if(_0x59ea03>=_0x8354c2){_0x59ea03=_0x8354c2;_0x4cfeea=0xc8;}else{_0x4cfeea=0xce;}_0x4eb521[_0xf59a('0x1b')](_0x4cfeea);return _0x4eb521[_0xf59a('0x21')]('Content-Range',_0x24dc4d+'-'+_0x59ea03+'/'+_0x8354c2)[_0xf59a('0x1c')](_0x2aa705);}return null;};}function patchUpdates(_0x56508c){return function(_0x53795e){try{jsonpatch[_0xf59a('0x22')](_0x53795e,_0x56508c,!![]);}catch(_0x2af3a7){return BPromise[_0xf59a('0x23')](_0x2af3a7);}return _0x53795e[_0xf59a('0x24')]();};}function saveUpdates(_0x87eb03,_0x4986b2){return function(_0x318f93){if(_0x318f93){return _0x318f93[_0xf59a('0x25')](_0x87eb03)[_0xf59a('0x26')](function(_0x3e9186){return _0x3e9186;});}return null;};}function handleEntityNotFound(_0x435d75,_0x2d4b52){return function(_0x477c65){if(!_0x477c65){_0x435d75['sendStatus'](0x194);}return _0x477c65;};}function handleError(_0x559203,_0x3e8eb8){_0x3e8eb8=_0x3e8eb8||0x1f4;return function(_0x339239){logger[_0xf59a('0x27')](_0x339239[_0xf59a('0x28')]);if(_0x339239[_0xf59a('0x29')]){delete _0x339239[_0xf59a('0x29')];}_0x559203[_0xf59a('0x1b')](_0x3e8eb8)[_0xf59a('0x2a')](_0x339239);};}exports['index']=function(_0x42944d,_0x3faf8d){var _0x3505d0={},_0x2c8449={},_0x31e1f1={'count':0x0,'rows':[]};var _0x5a2e7e=_[_0xf59a('0x2b')](db[_0xf59a('0x2c')]['rawAttributes'],function(_0xfd8cf8){return{'name':_0xfd8cf8[_0xf59a('0x2d')],'type':_0xfd8cf8[_0xf59a('0x2e')]['key']};});_0x2c8449[_0xf59a('0x2f')]=_['map'](_0x5a2e7e,'name');_0x2c8449['query']=_['keys'](_0x42944d[_0xf59a('0x30')]);_0x2c8449['filters']=_[_0xf59a('0x31')](_0x2c8449[_0xf59a('0x2f')],_0x2c8449['query']);_0x3505d0[_0xf59a('0x32')]=_[_0xf59a('0x31')](_0x2c8449['model'],qs[_0xf59a('0x33')](_0x42944d[_0xf59a('0x30')][_0xf59a('0x33')]));_0x3505d0['attributes']=_0x3505d0['attributes'][_0xf59a('0x34')]?_0x3505d0['attributes']:_0x2c8449[_0xf59a('0x2f')];if(!_0x42944d['query'][_0xf59a('0x35')](_0xf59a('0x36'))){_0x3505d0[_0xf59a('0x1e')]=qs[_0xf59a('0x1e')](_0x42944d[_0xf59a('0x30')]['limit']);_0x3505d0[_0xf59a('0x1d')]=qs[_0xf59a('0x1d')](_0x42944d[_0xf59a('0x30')][_0xf59a('0x1d')]);}_0x3505d0['order']=qs[_0xf59a('0x37')](_0x42944d[_0xf59a('0x30')][_0xf59a('0x37')]);_0x3505d0[_0xf59a('0x38')]=qs['filters'](_['pick'](_0x42944d[_0xf59a('0x30')],_0x2c8449['filters']),_0x5a2e7e);if(_0x42944d[_0xf59a('0x30')][_0xf59a('0x39')]){_0x3505d0['where']=_['merge'](_0x3505d0[_0xf59a('0x38')],{'$or':_[_0xf59a('0x2b')](_0x5a2e7e,function(_0x466804){if(_0x466804[_0xf59a('0x2e')]!==_0xf59a('0x3a')){var _0x23332b={};_0x23332b[_0x466804['name']]={'$like':'%'+_0x42944d['query']['filter']+'%'};return _0x23332b;}})});}_0x3505d0=_[_0xf59a('0x3b')]({},_0x3505d0,_0x42944d['options']);var _0x525197={'where':_0x3505d0[_0xf59a('0x38')]};return db[_0xf59a('0x2c')][_0xf59a('0x20')](_0x525197)['then'](function(_0x3c53fe){_0x31e1f1[_0xf59a('0x20')]=_0x3c53fe;if(_0x42944d['query'][_0xf59a('0x3c')]){_0x3505d0['include']=[{'all':!![]}];}return db['Team'][_0xf59a('0x3d')](_0x3505d0);})[_0xf59a('0x26')](function(_0x5d172e){_0x31e1f1[_0xf59a('0x3e')]=_0x5d172e;return _0x31e1f1;})['then'](respondWithFilteredResult(_0x3faf8d,_0x3505d0))[_0xf59a('0x3f')](handleError(_0x3faf8d,null));};exports[_0xf59a('0x40')]=function(_0x1cd3e4,_0x5f34d3){var _0x35a87e={'raw':![],'where':{'id':_0x1cd3e4[_0xf59a('0x41')]['id']}},_0x1f1460={};_0x1f1460['model']=_[_0xf59a('0x42')](db['Team']['rawAttributes']);_0x1f1460[_0xf59a('0x30')]=_[_0xf59a('0x42')](_0x1cd3e4[_0xf59a('0x30')]);_0x1f1460[_0xf59a('0x43')]=_['intersection'](_0x1f1460[_0xf59a('0x2f')],_0x1f1460[_0xf59a('0x30')]);_0x35a87e[_0xf59a('0x32')]=_[_0xf59a('0x31')](_0x1f1460[_0xf59a('0x2f')],qs[_0xf59a('0x33')](_0x1cd3e4['query'][_0xf59a('0x33')]));_0x35a87e[_0xf59a('0x32')]=_0x35a87e[_0xf59a('0x32')][_0xf59a('0x34')]?_0x35a87e[_0xf59a('0x32')]:_0x1f1460[_0xf59a('0x2f')];if(_0x1cd3e4['query'][_0xf59a('0x3c')]){_0x35a87e[_0xf59a('0x44')]=[{'all':!![]}];}_0x35a87e=_[_0xf59a('0x3b')]({},_0x35a87e,_0x1cd3e4['options']);return db[_0xf59a('0x2c')][_0xf59a('0x45')](_0x35a87e)['then'](handleEntityNotFound(_0x5f34d3,null))[_0xf59a('0x26')](respondWithResult(_0x5f34d3,null))['catch'](handleError(_0x5f34d3,null));};exports[_0xf59a('0x46')]=function(_0x2c8369,_0x40d995){return db[_0xf59a('0x2c')][_0xf59a('0x46')](_0x2c8369[_0xf59a('0x47')],{})[_0xf59a('0x26')](function(_0x752a89){var _0x1e8058=_0x2c8369[_0xf59a('0x48')][_0xf59a('0x49')]({'plain':!![]});if(!_0x1e8058)throw new Error(_0xf59a('0x4a'));if(_0x1e8058['role']===_0xf59a('0x48')){var _0x362962=_0x752a89[_0xf59a('0x49')]({'plain':!![]});var _0x362f82=_0xf59a('0x4b');return db[_0xf59a('0x4c')][_0xf59a('0x45')]({'where':{'name':_0x362f82,'userProfileId':_0x1e8058[_0xf59a('0x4d')]},'raw':!![]})[_0xf59a('0x26')](function(_0x29e665){if(_0x29e665&&_0x29e665[_0xf59a('0x4e')]===0x0){return db[_0xf59a('0x4f')][_0xf59a('0x46')]({'name':_0x362962[_0xf59a('0x29')],'resourceId':_0x362962['id'],'type':_0x29e665['name'],'sectionId':_0x29e665['id']},{})[_0xf59a('0x26')](function(){return _0x752a89;});}else{return _0x752a89;}})[_0xf59a('0x3f')](function(_0xa54f40){logger[_0xf59a('0x27')](_0xf59a('0x50'),_0xa54f40);throw _0xa54f40;});}return _0x752a89;})[_0xf59a('0x26')](respondWithResult(_0x40d995,0xc9))[_0xf59a('0x3f')](handleError(_0x40d995,null));};exports[_0xf59a('0x25')]=function(_0x3bddd2,_0x3520af){if(_0x3bddd2[_0xf59a('0x47')]['id']){delete _0x3bddd2[_0xf59a('0x47')]['id'];}return db['Team'][_0xf59a('0x45')]({'where':{'id':_0x3bddd2[_0xf59a('0x41')]['id']}})[_0xf59a('0x26')](handleEntityNotFound(_0x3520af,null))['then'](saveUpdates(_0x3bddd2['body'],null))[_0xf59a('0x26')](respondWithResult(_0x3520af,null))[_0xf59a('0x3f')](handleError(_0x3520af,null));};exports[_0xf59a('0x51')]=function(_0x36ffe2,_0x3abddc){var _0x3839a4=_0x36ffe2[_0xf59a('0x41')]['id'];var _0x183d3f=[];return db[_0xf59a('0x52')][_0xf59a('0x53')](function(_0x47e16e){var _0x50015b=_0xf59a('0x54')+_0x3839a4;return db[_0xf59a('0x52')][_0xf59a('0x30')](_0x50015b,{'type':db[_0xf59a('0x55')][_0xf59a('0x56')][_0xf59a('0x57')],'raw':!![],'transaction':_0x47e16e})[_0xf59a('0x26')](function(_0x551cb5){_0x183d3f=_['map'](_0x551cb5,function(_0x505298){return Number(_0x505298['UserId']);});})[_0xf59a('0x26')](function(){var _0x81363='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3839a4;return db[_0xf59a('0x52')][_0xf59a('0x30')](_0x81363,{'type':db[_0xf59a('0x55')][_0xf59a('0x56')][_0xf59a('0x57')],'raw':!![],'transaction':_0x47e16e});})[_0xf59a('0x26')](function(_0x48e4c6){var _0xf2509=_[_0xf59a('0x2b')](_0x48e4c6,function(_0x2ddb88){return Number(_0x2ddb88['VoiceQueueId']);});return db[_0xf59a('0x58')][_0xf59a('0x51')]({'where':{'UserId':{'$in':_0x183d3f},'VoiceQueueId':{'$in':_0xf2509}},'transaction':_0x47e16e});})['then'](function(){var _0x4e2320=_0xf59a('0x59')+_0x3839a4;return db[_0xf59a('0x52')][_0xf59a('0x30')](_0x4e2320,{'type':db[_0xf59a('0x55')][_0xf59a('0x56')][_0xf59a('0x57')],'raw':!![],'transaction':_0x47e16e});})['then'](function(_0x5f1e18){var _0x2ff008=_['map'](_0x5f1e18,function(_0x47ad87){return Number(_0x47ad87[_0xf59a('0x5a')]);});return db[_0xf59a('0x5b')][_0xf59a('0x51')]({'where':{'UserId':{'$in':_0x183d3f},'MailQueueId':{'$in':_0x2ff008}},'transaction':_0x47e16e});})[_0xf59a('0x26')](function(){var _0x7729f5='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3839a4;return db[_0xf59a('0x52')]['query'](_0x7729f5,{'type':db[_0xf59a('0x55')][_0xf59a('0x56')][_0xf59a('0x57')],'raw':!![],'transaction':_0x47e16e});})[_0xf59a('0x26')](function(_0x48ef13){var _0x424b95=_['map'](_0x48ef13,function(_0x2c3464){return Number(_0x2c3464['SmsQueueId']);});return db['UserSmsQueue'][_0xf59a('0x51')]({'where':{'UserId':{'$in':_0x183d3f},'SmsQueueId':{'$in':_0x424b95}},'transaction':_0x47e16e});})[_0xf59a('0x26')](function(){var _0x314846=_0xf59a('0x5c')+_0x3839a4;return db['sequelize'][_0xf59a('0x30')](_0x314846,{'type':db['Sequelize'][_0xf59a('0x56')][_0xf59a('0x57')],'raw':!![],'transaction':_0x47e16e});})[_0xf59a('0x26')](function(_0x37ef3a){var _0x489891=_[_0xf59a('0x2b')](_0x37ef3a,function(_0x3de911){return Number(_0x3de911[_0xf59a('0x5d')]);});return db[_0xf59a('0x5e')]['destroy']({'where':{'UserId':{'$in':_0x183d3f},'ChatQueueId':{'$in':_0x489891}},'transaction':_0x47e16e});})[_0xf59a('0x26')](function(){var _0x83b86d='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3839a4;return db[_0xf59a('0x52')][_0xf59a('0x30')](_0x83b86d,{'type':db[_0xf59a('0x55')][_0xf59a('0x56')][_0xf59a('0x57')],'raw':!![],'transaction':_0x47e16e});})[_0xf59a('0x26')](function(_0x32c1e6){var _0x38cc39=_[_0xf59a('0x2b')](_0x32c1e6,function(_0x95e835){return Number(_0x95e835[_0xf59a('0x5f')]);});return db[_0xf59a('0x60')][_0xf59a('0x51')]({'where':{'UserId':{'$in':_0x183d3f},'FaxQueueId':{'$in':_0x38cc39}},'transaction':_0x47e16e});})[_0xf59a('0x26')](function(){var _0x31fdd0=_0xf59a('0x61')+_0x3839a4;return db[_0xf59a('0x52')][_0xf59a('0x30')](_0x31fdd0,{'type':db[_0xf59a('0x55')]['QueryTypes'][_0xf59a('0x57')],'raw':!![],'transaction':_0x47e16e});})[_0xf59a('0x26')](function(_0x3940f2){var _0x1f1a23=_[_0xf59a('0x2b')](_0x3940f2,function(_0x28a05a){return Number(_0x28a05a[_0xf59a('0x62')]);});return db[_0xf59a('0x63')]['destroy']({'where':{'UserId':{'$in':_0x183d3f},'OpenchannelQueueId':{'$in':_0x1f1a23}},'transaction':_0x47e16e});})[_0xf59a('0x26')](function(){var _0x455ed6=_0xf59a('0x64')+_0x3839a4;return db[_0xf59a('0x52')][_0xf59a('0x30')](_0x455ed6,{'type':db['Sequelize'][_0xf59a('0x56')][_0xf59a('0x57')],'raw':!![],'transaction':_0x47e16e});})['then'](function(_0x226efe){var _0x29497a=_[_0xf59a('0x2b')](_0x226efe,function(_0x4f8cc5){return Number(_0x4f8cc5['WhatsappQueueId']);});return db['UserWhatsappQueue'][_0xf59a('0x51')]({'where':{'UserId':{'$in':_0x183d3f},'WhatsappQueueId':{'$in':_0x29497a}},'transaction':_0x47e16e});})[_0xf59a('0x26')](function(){return db[_0xf59a('0x65')][_0xf59a('0x45')]({'where':{'TeamId':_0x3839a4}});})['then'](function(_0x36f2eb){if(_0x36f2eb===null){return;}return db[_0xf59a('0x66')]['destroy']({'where':{'UserId':{'$in':_0x183d3f},'VoicePrefixId':_0x36f2eb[_0xf59a('0x67')]},'transaction':_0x47e16e});})['then'](function(){return db[_0xf59a('0x2c')][_0xf59a('0x51')]({'where':{'id':_0x3839a4},'cascade':!![],'transaction':_0x47e16e});})[_0xf59a('0x26')](function(_0x18a668){if(_0x18a668===0x0){_0x3abddc['sendStatus'](0x194);}else{return db[_0xf59a('0x4f')][_0xf59a('0x51')]({'where':{'type':_0xf59a('0x4b'),'resourceId':_0x3839a4},'cascade':!![],'transaction':_0x47e16e})[_0xf59a('0x26')](function(){_0x3abddc[_0xf59a('0x1b')](0xcc)[_0xf59a('0x68')]();});}})[_0xf59a('0x3f')](function(_0x489fb5){_0x3abddc[_0xf59a('0x1b')](0x1f4)[_0xf59a('0x2a')](_0x489fb5);});});};exports['getQueues']=function(_0x5578e9,_0x58fbaf,_0x357a06){return db['Team'][_0xf59a('0x69')]({'where':{'id':_0x5578e9[_0xf59a('0x41')]['id']}})['then'](handleEntityNotFound(_0x58fbaf,null))['then'](function(_0xb5a665){if(!_0x5578e9['query']['channel']||!utils[_0xf59a('0x6a')](_0x5578e9[_0xf59a('0x30')][_0xf59a('0x6b')])){throw new db['Sequelize'][(_0xf59a('0x6c'))](_0xf59a('0x6d'));}var _0x13c2d9={};var _0x4c8214={};_0x4c8214[_0xf59a('0x2f')]=_[_0xf59a('0x42')](db[_[_0xf59a('0x6e')](_0x5578e9['query'][_0xf59a('0x6b')][_0xf59a('0x6f')]())+_0xf59a('0x70')][_0xf59a('0x71')]);_0x4c8214['query']=_[_0xf59a('0x42')](_0x5578e9[_0xf59a('0x30')]);_0x4c8214[_0xf59a('0x43')]=_[_0xf59a('0x31')](_0x4c8214['model'],_0x4c8214[_0xf59a('0x30')]);_0x13c2d9['attributes']=_[_0xf59a('0x31')](_0x4c8214['model'],qs[_0xf59a('0x33')](_0x5578e9[_0xf59a('0x30')][_0xf59a('0x33')]));_0x13c2d9[_0xf59a('0x32')]=_0x13c2d9['attributes'][_0xf59a('0x34')]?_0x13c2d9[_0xf59a('0x32')]:_0x4c8214[_0xf59a('0x2f')];_0x13c2d9['limit']=qs[_0xf59a('0x1e')](_0x5578e9[_0xf59a('0x30')]['limit']);_0x13c2d9[_0xf59a('0x1d')]=qs[_0xf59a('0x1d')](_0x5578e9['query'][_0xf59a('0x1d')]);_0x13c2d9['order']=qs[_0xf59a('0x37')](_0x5578e9[_0xf59a('0x30')]['sort']);_0x13c2d9[_0xf59a('0x38')]=qs['filters'](_[_0xf59a('0x72')](_0x5578e9[_0xf59a('0x30')],_0x4c8214[_0xf59a('0x43')]));_0x13c2d9=_[_0xf59a('0x3b')]({},_0x13c2d9,_0x5578e9[_0xf59a('0x73')]);return _0xb5a665[_0xf59a('0x49')+_['capitalize'](_0x5578e9['query'][_0xf59a('0x6b')][_0xf59a('0x6f')]())+_0xf59a('0x74')](_0x13c2d9);})[_0xf59a('0x26')](respondWithResult(_0x58fbaf,null))[_0xf59a('0x3f')](handleError(_0x58fbaf,null));};exports[_0xf59a('0x75')]=function(_0x3ea4ab,_0x67e653,_0x1d79c1){return db[_0xf59a('0x2c')][_0xf59a('0x69')]({'where':{'id':_0x3ea4ab[_0xf59a('0x41')]['id']}})[_0xf59a('0x26')](function(_0x67ede4){if(_0x67ede4){if(!_0x3ea4ab[_0xf59a('0x47')][_0xf59a('0x6b')]||!utils[_0xf59a('0x6a')](_0x3ea4ab[_0xf59a('0x47')][_0xf59a('0x6b')])){throw new db[(_0xf59a('0x55'))]['ValidationError']('Unknown\x20channel');}return _0x67ede4['add'+_['capitalize'](_0x3ea4ab[_0xf59a('0x47')][_0xf59a('0x6b')]['toLowerCase']())+_0xf59a('0x74')](_0x3ea4ab[_0xf59a('0x47')][_0xf59a('0x76')]);}return null;})[_0xf59a('0x26')](handleEntityNotFound(_0x67e653,null))[_0xf59a('0x26')](respondWithStatusCode(_0x67e653,null))[_0xf59a('0x3f')](handleError(_0x67e653,null));};exports[_0xf59a('0x77')]=function(_0x33a4e9,_0x221713,_0x310339){return db['Team'][_0xf59a('0x69')]({'where':{'id':_0x33a4e9[_0xf59a('0x41')]['id']}})[_0xf59a('0x26')](function(_0x144978){if(_0x144978){if(!_0x33a4e9[_0xf59a('0x30')][_0xf59a('0x6b')]||!utils[_0xf59a('0x6a')](_0x33a4e9[_0xf59a('0x30')][_0xf59a('0x6b')])){throw new db['Sequelize'][(_0xf59a('0x6c'))]('Unknown\x20channel');}return _0x144978['remove'+_[_0xf59a('0x6e')](_0x33a4e9[_0xf59a('0x30')][_0xf59a('0x6b')][_0xf59a('0x6f')]())+_0xf59a('0x74')](_0x33a4e9[_0xf59a('0x30')]['ids']);}return null;})[_0xf59a('0x26')](handleEntityNotFound(_0x221713,null))[_0xf59a('0x26')](respondWithStatusCode(_0x221713,null))[_0xf59a('0x3f')](handleError(_0x221713,null));};exports[_0xf59a('0x78')]=function(_0xaee442,_0x472fc7){var _0x5980e9=_[_0xf59a('0x79')](_0xaee442['body'][_0xf59a('0x76')])?_0xaee442[_0xf59a('0x47')][_0xf59a('0x76')]:[_0xaee442[_0xf59a('0x47')][_0xf59a('0x76')]];var _0x4238c3=_0xaee442[_0xf59a('0x41')]['id'];return db[_0xf59a('0x2c')]['find']({'where':{'id':_0x4238c3}})['then'](handleEntityNotFound(_0x472fc7,null))[_0xf59a('0x26')](function(_0x53ca12){if(_0x53ca12){var _0x2c160f=['Voice',_0xf59a('0x7a'),_0xf59a('0x7b'),_0xf59a('0x7c'),'Fax',_0xf59a('0x7d'),'Whatsapp'];return db['sequelize'][_0xf59a('0x53')](function(_0x5b5649){var _0x141eb3=_[_0xf59a('0x2b')](_0x2c160f,function(_0x10262d){var _0x53d2ae={'attributes':['id',_0xf59a('0x29')]};if(_0x10262d==='Voice'){_0x53d2ae['through']={'attributes':[_0xf59a('0x7e')]};}return _0x53ca12['get'+_0x10262d+_0xf59a('0x74')](_0x53d2ae)['then'](function(_0x361d3c){var _0x3c1e31=_[_0xf59a('0x2b')](_0x361d3c,function(_0x294600){var _0x25160e=_[_0xf59a('0x2b')](_0x5980e9,function(_0x1d7fe4){var _0x55685a={'where':{'UserId':_0x1d7fe4,[_0x10262d+_0xf59a('0x7f')]:_0x294600['id']},'transaction':_0x5b5649};if(_0x10262d===_0xf59a('0x80')){_0x55685a[_0xf59a('0x81')]={'penalty':_0x294600['TeamVoiceQueue'][_0xf59a('0x7e')]};}return db[_0xf59a('0x82')+_0x10262d+'Queue'][_0xf59a('0x83')](_0x55685a)[_0xf59a('0x26')](function(){socket['emit'](_0xf59a('0x48')+_0x10262d+_0xf59a('0x84'),{'UserId':_0x1d7fe4,[_0x10262d+_0xf59a('0x7f')]:_0x294600['id']});if(_0x10262d!=='Voice'){return;}return db[_0xf59a('0x82')][_0xf59a('0x3d')]({'where':{'id':_0x5980e9,'online':0x1},'attributes':['id','name',_0xf59a('0x85'),_0xf59a('0x86'),'interface'],'raw':!![]})[_0xf59a('0x26')](function(_0x14635b){var _0x548af0=_['map'](_0x14635b,function(_0x540fbb){return db['UserVoiceQueueRt'][_0xf59a('0x87')]({'membername':_0x540fbb[_0xf59a('0x29')],'UserId':_0x540fbb['id'],'queue_name':_0x294600['name'],'VoiceQueueId':_0x294600['id'],'interface':_[_0xf59a('0x88')](_0x540fbb[_0xf59a('0x89')])?util[_0xf59a('0x8a')]('SIP/%s',_0x540fbb[_0xf59a('0x29')]):_0x540fbb[_0xf59a('0x89')],'paused':_0x540fbb[_0xf59a('0x86')]||![],'penalty':_0x294600['TeamVoiceQueue'][_0xf59a('0x7e')]},{'transaction':_0x5b5649});});return Promise['all'](_0x548af0);});});});return Promise['all'](_0x25160e);});return Promise[_0xf59a('0x8b')](_0x3c1e31);})[_0xf59a('0x26')](function(){return db[_0xf59a('0x65')][_0xf59a('0x69')]({'where':{'teamId':_0x4238c3}})[_0xf59a('0x26')](function(_0x388319){if(_0x388319){var _0x1dc12a=_['map'](_0x5980e9,function(_0x36b90f){db['UserVoicePrefix'][_0xf59a('0x87')]({'UserId':_0x36b90f,'VoicePrefixId':_0x388319[_0xf59a('0x67')]});});return Promise[_0xf59a('0x8b')](_0x1dc12a);}});});});return Promise[_0xf59a('0x8b')](_0x141eb3)['then'](function(){return _0x53ca12[_0xf59a('0x78')](_0x5980e9,{'transaction':_0x5b5649})[_0xf59a('0x8c')](function(_0x2bcdb3){return _0x2bcdb3;});});});}})['then'](respondWithResult(_0x472fc7,null))['catch'](handleError(_0x472fc7,null));};exports[_0xf59a('0x8d')]=function(_0x43e4d7,_0x58a08e){var _0x2c6868=_[_0xf59a('0x79')](_0x43e4d7['query'][_0xf59a('0x76')])?_0x43e4d7[_0xf59a('0x30')][_0xf59a('0x76')]:[_0x43e4d7[_0xf59a('0x30')][_0xf59a('0x76')]];var _0x18f340=_0x43e4d7[_0xf59a('0x41')]['id'];return db['Team'][_0xf59a('0x45')]({'where':{'id':_0x18f340}})[_0xf59a('0x26')](handleEntityNotFound(_0x58a08e,null))[_0xf59a('0x26')](function(_0x287a25){if(_0x287a25){var _0x12c0ea=[_0xf59a('0x80'),_0xf59a('0x7a'),'Mail',_0xf59a('0x7c'),_0xf59a('0x8e'),'Openchannel','Whatsapp'];return db[_0xf59a('0x52')]['transaction'](function(_0x4ac9e7){var _0xdde54a=_['map'](_0x12c0ea,function(_0x157716){var _0x2c1753={'attributes':['id',_0xf59a('0x29')]};return _0x287a25[_0xf59a('0x49')+_0x157716+_0xf59a('0x74')](_0x2c1753)[_0xf59a('0x26')](function(_0x425efa){var _0x55de33=_[_0xf59a('0x2b')](_0x425efa,function(_0x393659){return _0x393659[_0xf59a('0x8d')](_0x2c6868,{'transaction':_0x4ac9e7})['then'](function(){var _0x4781e1=_[_0xf59a('0x2b')](_0x2c6868,function(_0x16ef05){socket[_0xf59a('0x8f')](_0xf59a('0x48')+_0x157716+_0xf59a('0x90'),{'UserId':Number(_0x16ef05),[_0x157716+_0xf59a('0x7f')]:_0x393659['id']});if(_0x157716!==_0xf59a('0x80')){return;}return db[_0xf59a('0x91')]['destroy']({'where':{'VoiceQueueId':_0x393659['id'],'UserId':_0x16ef05},'transaction':_0x4ac9e7});});return Promise[_0xf59a('0x8b')](_0x4781e1);});});return Promise[_0xf59a('0x8b')](_0x55de33);});});return Promise[_0xf59a('0x8b')](_0xdde54a)[_0xf59a('0x26')](function(){return _0x287a25[_0xf59a('0x8d')](_0x2c6868,{'transaction':_0x4ac9e7});})[_0xf59a('0x26')](function(){return db[_0xf59a('0x65')][_0xf59a('0x69')]({'where':{'teamId':_0x18f340}})[_0xf59a('0x26')](function(_0x520a82){if(_0x520a82){var _0xc210cd=_[_0xf59a('0x2b')](_0x2c6868,function(_0x235820){db[_0xf59a('0x66')][_0xf59a('0x51')]({'where':{'UserId':_0x235820,'VoicePrefixId':_0x520a82[_0xf59a('0x67')]}});});return Promise[_0xf59a('0x8b')](_0xc210cd);}});});});}})[_0xf59a('0x26')](respondWithStatusCode(_0x58a08e,null))[_0xf59a('0x3f')](handleError(_0x58a08e,null));};exports[_0xf59a('0x92')]=function(_0x307805,_0x323f84,_0x40ee78){var _0xd60a49={};var _0x4b017c={};var _0x377c9c;var _0x4b8c52;return db[_0xf59a('0x2c')][_0xf59a('0x69')]({'where':{'id':_0x307805[_0xf59a('0x41')]['id']}})[_0xf59a('0x26')](handleEntityNotFound(_0x323f84,null))[_0xf59a('0x26')](function(_0x5efd1b){if(_0x5efd1b){_0x377c9c=_0x5efd1b;_0x4b017c['model']=_['keys'](db['User'][_0xf59a('0x71')]);_0x4b017c[_0xf59a('0x30')]=_[_0xf59a('0x42')](_0x307805[_0xf59a('0x30')]);_0x4b017c[_0xf59a('0x43')]=_[_0xf59a('0x31')](_0x4b017c[_0xf59a('0x2f')],_0x4b017c[_0xf59a('0x30')]);_0xd60a49[_0xf59a('0x32')]=_[_0xf59a('0x31')](_0x4b017c[_0xf59a('0x2f')],qs[_0xf59a('0x33')](_0x307805[_0xf59a('0x30')]['fields']));_0xd60a49['attributes']=_0xd60a49[_0xf59a('0x32')][_0xf59a('0x34')]?_0xd60a49[_0xf59a('0x32')]:_0x4b017c[_0xf59a('0x2f')];_0xd60a49[_0xf59a('0x93')]=qs[_0xf59a('0x37')](_0x307805['query'][_0xf59a('0x37')]);_0xd60a49[_0xf59a('0x38')]=qs[_0xf59a('0x43')](_[_0xf59a('0x72')](_0x307805[_0xf59a('0x30')],_0x4b017c[_0xf59a('0x43')]));if(_0x307805[_0xf59a('0x30')][_0xf59a('0x39')]){_0xd60a49[_0xf59a('0x38')]=_[_0xf59a('0x3b')](_0xd60a49[_0xf59a('0x38')],{'$or':_['map'](_0xd60a49[_0xf59a('0x32')],function(_0x2a01c9){var _0x380003={};_0x380003[_0x2a01c9]={'$like':'%'+_0x307805[_0xf59a('0x30')][_0xf59a('0x39')]+'%'};return _0x380003;})});}_0xd60a49=_['merge']({},_0xd60a49,_0x307805['options']);return _0x377c9c[_0xf59a('0x92')](_0xd60a49);}})['then'](function(_0x4621fb){if(_0x4621fb){_0x4b8c52=_0x4621fb[_0xf59a('0x34')];if(!_0x307805[_0xf59a('0x30')]['hasOwnProperty']('nolimit')){_0xd60a49[_0xf59a('0x1e')]=qs[_0xf59a('0x1e')](_0x307805['query'][_0xf59a('0x1e')]);_0xd60a49[_0xf59a('0x1d')]=qs['offset'](_0x307805[_0xf59a('0x30')][_0xf59a('0x1d')]);}return _0x377c9c['getAgents'](_0xd60a49);}})[_0xf59a('0x26')](function(_0x17fc1d){if(_0x17fc1d){return _0x17fc1d?{'count':_0x4b8c52,'rows':_0x17fc1d}:null;}})[_0xf59a('0x26')](respondWithResult(_0x323f84,null))[_0xf59a('0x3f')](handleError(_0x323f84,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index b253919..a8e6b48 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 _0xe3a3=['Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x198d1f,_0x25c30d){var _0x5e0a92=function(_0x2fd22a){while(--_0x2fd22a){_0x198d1f['push'](_0x198d1f['shift']());}};_0x5e0a92(++_0x25c30d);}(_0xe3a3,0x18f));var _0x3e3a=function(_0x457a29,_0x556703){_0x457a29=_0x457a29-0x0;var _0x1c34c5=_0xe3a3[_0x457a29];return _0x1c34c5;};'use strict';var EventEmitter=require(_0x3e3a('0x0'));var Team=require('../../mysqldb')['db'][_0x3e3a('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x3e3a('0x2')](0x0);var events={'afterCreate':_0x3e3a('0x3'),'afterUpdate':_0x3e3a('0x4'),'afterDestroy':_0x3e3a('0x5')};function emitEvent(_0x2be967){return function(_0x24717d,_0x92f71d,_0x29680b){TeamEvents[_0x3e3a('0x6')](_0x2be967+':'+_0x24717d['id'],_0x24717d);TeamEvents[_0x3e3a('0x6')](_0x2be967,_0x24717d);_0x29680b(null);};}for(var e in events){if(events[_0x3e3a('0x7')](e)){var event=events[e];Team[_0x3e3a('0x8')](e,emitEvent(event));}}module[_0x3e3a('0x9')]=TeamEvents; \ No newline at end of file +var _0x45c8=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Team'];(function(_0x2bbc07,_0x1e2168){var _0x6879e4=function(_0x290fa1){while(--_0x290fa1){_0x2bbc07['push'](_0x2bbc07['shift']());}};_0x6879e4(++_0x1e2168);}(_0x45c8,0x66));var _0x845c=function(_0x4f67d1,_0x3a2242){_0x4f67d1=_0x4f67d1-0x0;var _0xa8222c=_0x45c8[_0x4f67d1];return _0xa8222c;};'use strict';var EventEmitter=require('events');var Team=require(_0x845c('0x0'))['db'][_0x845c('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x845c('0x2'),'afterUpdate':'update','afterDestroy':_0x845c('0x3')};function emitEvent(_0x1c0838){return function(_0x1faef4,_0xc2d801,_0x9a7c36){TeamEvents['emit'](_0x1c0838+':'+_0x1faef4['id'],_0x1faef4);TeamEvents[_0x845c('0x4')](_0x1c0838,_0x1faef4);_0x9a7c36(null);};}for(var e in events){if(events[_0x845c('0x5')](e)){var event=events[e];Team[_0x845c('0x6')](e,emitEvent(event));}}module[_0x845c('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 45cd6ef..bd97903 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 _0x2f92=['lodash','util','api','moment','path','rimraf','./team.attributes','exports','define','Team','teams'];(function(_0x154784,_0x526d63){var _0xf3eaed=function(_0x53d100){while(--_0x53d100){_0x154784['push'](_0x154784['shift']());}};_0xf3eaed(++_0x526d63);}(_0x2f92,0xc6));var _0x22f9=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x2f92[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x22f9('0x0'));var util=require(_0x22f9('0x1'));var logger=require('../../config/logger')(_0x22f9('0x2'));var moment=require(_0x22f9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x22f9('0x4'));var rimraf=require(_0x22f9('0x5'));var config=require('../../config/environment');var attributes=require(_0x22f9('0x6'));module[_0x22f9('0x7')]=function(_0x191751,_0x500c34){return _0x191751[_0x22f9('0x8')](_0x22f9('0x9'),attributes,{'tableName':_0x22f9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47ce=['../../config/logger','api','moment','bluebird','path','../../config/environment','./team.attributes','exports','define','Team','teams','lodash'];(function(_0x5f5817,_0x55174a){var _0x2fd75d=function(_0x3aa7eb){while(--_0x3aa7eb){_0x5f5817['push'](_0x5f5817['shift']());}};_0x2fd75d(++_0x55174a);}(_0x47ce,0x77));var _0xe47c=function(_0x4b9c94,_0x1edb56){_0x4b9c94=_0x4b9c94-0x0;var _0x9bd2d2=_0x47ce[_0x4b9c94];return _0x9bd2d2;};'use strict';var _=require(_0xe47c('0x0'));var util=require('util');var logger=require(_0xe47c('0x1'))(_0xe47c('0x2'));var moment=require(_0xe47c('0x3'));var BPromise=require(_0xe47c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe47c('0x5'));var rimraf=require('rimraf');var config=require(_0xe47c('0x6'));var attributes=require(_0xe47c('0x7'));module[_0xe47c('0x8')]=function(_0x5d1101,_0x405949){return _0x5d1101[_0xe47c('0x9')](_0xe47c('0xa'),attributes,{'tableName':_0xe47c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 25970dd..453abe4 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 _0x0d57=['client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5c56bd,_0x5c8369){var _0x56d6c6=function(_0x42d105){while(--_0x42d105){_0x5c56bd['push'](_0x5c56bd['shift']());}};_0x56d6c6(++_0x5c8369);}(_0x0d57,0x12b));var _0x70d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d57[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x70d5('0x0'));var moment=require(_0x70d5('0x1'));var BPromise=require(_0x70d5('0x2'));var rs=require(_0x70d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x70d5('0x4'))['db'];var utils=require(_0x70d5('0x5'));var logger=require(_0x70d5('0x6'))(_0x70d5('0x7'));var config=require(_0x70d5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x70d5('0x9')][_0x70d5('0xa')]({'port':0x232a});config[_0x70d5('0xb')]=_[_0x70d5('0xc')](config[_0x70d5('0xb')],{'host':_0x70d5('0xd'),'port':0x18eb});var socket=require(_0x70d5('0xe'))(new Redis(config['redis']));require(_0x70d5('0xf'))['register'](socket);function respondWithRpcPromise(_0x4c5834,_0x58c12f,_0x1ebaf7){return new BPromise(function(_0x27460a,_0x144190){return client[_0x70d5('0x10')](_0x4c5834,_0x1ebaf7)[_0x70d5('0x11')](function(_0x162cd0){logger[_0x70d5('0x12')](_0x70d5('0x13'),_0x58c12f,'request\x20sent');logger[_0x70d5('0x14')](_0x70d5('0x15'),_0x58c12f,_0x70d5('0x16'),JSON[_0x70d5('0x17')](_0x162cd0));if(_0x162cd0[_0x70d5('0x18')]){if(_0x162cd0['error'][_0x70d5('0x19')]===0x1f4){logger['error'](_0x70d5('0x13'),_0x58c12f,_0x162cd0[_0x70d5('0x18')]['message']);return _0x144190(_0x162cd0[_0x70d5('0x18')]['message']);}logger[_0x70d5('0x18')](_0x70d5('0x13'),_0x58c12f,_0x162cd0[_0x70d5('0x18')]['message']);return _0x27460a(_0x162cd0['error'][_0x70d5('0x1a')]);}else{logger[_0x70d5('0x12')]('Team,\x20%s,\x20%s',_0x58c12f,_0x70d5('0x16'));_0x27460a(_0x162cd0[_0x70d5('0x1b')][_0x70d5('0x1a')]);}})['catch'](function(_0x299408){logger['error'](_0x70d5('0x13'),_0x58c12f,_0x299408);_0x144190(_0x299408);});});} \ No newline at end of file +var _0xfbf5=['request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfbf5,0x10d));var _0x5fbf=function(_0x5e6ad5,_0x1b4266){_0x5e6ad5=_0x5e6ad5-0x0;var _0x2219ae=_0xfbf5[_0x5e6ad5];return _0x2219ae;};'use strict';var _=require(_0x5fbf('0x0'));var util=require(_0x5fbf('0x1'));var moment=require(_0x5fbf('0x2'));var BPromise=require('bluebird');var rs=require(_0x5fbf('0x3'));var fs=require('fs');var Redis=require(_0x5fbf('0x4'));var db=require(_0x5fbf('0x5'))['db'];var utils=require(_0x5fbf('0x6'));var logger=require(_0x5fbf('0x7'))('rpc');var config=require(_0x5fbf('0x8'));var jayson=require(_0x5fbf('0x9'));var client=jayson[_0x5fbf('0xa')][_0x5fbf('0xb')]({'port':0x232a});config[_0x5fbf('0xc')]=_['defaults'](config['redis'],{'host':_0x5fbf('0xd'),'port':0x18eb});var socket=require(_0x5fbf('0xe'))(new Redis(config[_0x5fbf('0xc')]));require(_0x5fbf('0xf'))[_0x5fbf('0x10')](socket);function respondWithRpcPromise(_0x531d2b,_0x1c3a16,_0x5e55b9){return new BPromise(function(_0x2a3d04,_0x34afb1){return client[_0x5fbf('0x11')](_0x531d2b,_0x5e55b9)['then'](function(_0x24f4c7){logger[_0x5fbf('0x12')](_0x5fbf('0x13'),_0x1c3a16,_0x5fbf('0x14'));logger[_0x5fbf('0x15')](_0x5fbf('0x16'),_0x1c3a16,'request\x20sent',JSON['stringify'](_0x24f4c7));if(_0x24f4c7[_0x5fbf('0x17')]){if(_0x24f4c7[_0x5fbf('0x17')]['code']===0x1f4){logger[_0x5fbf('0x17')](_0x5fbf('0x13'),_0x1c3a16,_0x24f4c7[_0x5fbf('0x17')]['message']);return _0x34afb1(_0x24f4c7[_0x5fbf('0x17')][_0x5fbf('0x18')]);}logger['error'](_0x5fbf('0x13'),_0x1c3a16,_0x24f4c7[_0x5fbf('0x17')][_0x5fbf('0x18')]);return _0x2a3d04(_0x24f4c7[_0x5fbf('0x17')][_0x5fbf('0x18')]);}else{logger[_0x5fbf('0x12')](_0x5fbf('0x13'),_0x1c3a16,'request\x20sent');_0x2a3d04(_0x24f4c7['result'][_0x5fbf('0x18')]);}})[_0x5fbf('0x19')](function(_0x957766){logger[_0x5fbf('0x17')](_0x5fbf('0x13'),_0x1c3a16,_0x957766);_0x34afb1(_0x957766);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index a578acc..4fff749 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 _0x46aa=['emit','removeListener','length','team:','./team.events','save','remove'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x46aa,0x90));var _0xa46a=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x46aa[_0x35885a];return _0xe86249;};'use strict';var TeamEvents=require(_0xa46a('0x0'));var events=[_0xa46a('0x1'),_0xa46a('0x2'),'update'];function createListener(_0x591cb7,_0x191682){return function(_0x23a473){_0x191682[_0xa46a('0x3')](_0x591cb7,_0x23a473);};}function removeListener(_0x421d30,_0x42c9b3){return function(){TeamEvents[_0xa46a('0x4')](_0x421d30,_0x42c9b3);};}exports['register']=function(_0x17a0fc){for(var _0x598b49=0x0,_0x2fb972=events[_0xa46a('0x5')];_0x598b49<_0x2fb972;_0x598b49++){var _0x23ab8f=events[_0x598b49];var _0x34c66e=createListener(_0xa46a('0x6')+_0x23ab8f,_0x17a0fc);TeamEvents['on'](_0x23ab8f,_0x34c66e);}}; \ No newline at end of file +var _0x8c2d=['update','removeListener','length','team:','./team.events','save','remove'];(function(_0x4d46f5,_0x281c3f){var _0x5bf6f0=function(_0x545e85){while(--_0x545e85){_0x4d46f5['push'](_0x4d46f5['shift']());}};_0x5bf6f0(++_0x281c3f);}(_0x8c2d,0x1cb));var _0xd8c2=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0x8c2d[_0x4c98b9];return _0x3a257a;};'use strict';var TeamEvents=require(_0xd8c2('0x0'));var events=[_0xd8c2('0x1'),_0xd8c2('0x2'),_0xd8c2('0x3')];function createListener(_0x257fd1,_0x44621c){return function(_0xf65053){_0x44621c['emit'](_0x257fd1,_0xf65053);};}function removeListener(_0xafd9ec,_0x4c8cc8){return function(){TeamEvents[_0xd8c2('0x4')](_0xafd9ec,_0x4c8cc8);};}exports['register']=function(_0xa26ebd){for(var _0x3fcd6b=0x0,_0x4d5756=events[_0xd8c2('0x5')];_0x3fcd6b<_0x4d5756;_0x3fcd6b++){var _0x4effc5=events[_0x3fcd6b];var _0x22efeb=createListener(_0xd8c2('0x6')+_0x4effc5,_0xa26ebd);TeamEvents['on'](_0x4effc5,_0x22efeb);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 1d283ad..f1acc7b 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 _0x8ff3=['INTEGER','exports'];(function(_0x4191bc,_0x3096c5){var _0x1ffd4e=function(_0x36faed){while(--_0x36faed){_0x4191bc['push'](_0x4191bc['shift']());}};_0x1ffd4e(++_0x3096c5);}(_0x8ff3,0x1bb));var _0x38ff=function(_0x3935d7,_0x39958f){_0x3935d7=_0x3935d7-0x0;var _0x2ca73e=_0x8ff3[_0x3935d7];return _0x2ca73e;};'use strict';var Sequelize=require('sequelize');module[_0x38ff('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x38ff('0x1')]}}; \ No newline at end of file +var _0x466f=['sequelize','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x466f,0x76));var _0xf466=function(_0x20d33b,_0x2631b1){_0x20d33b=_0x20d33b-0x0;var _0x21c0a0=_0x466f[_0x20d33b];return _0x21c0a0;};'use strict';var Sequelize=require(_0xf466('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0xf466('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xf466('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index cdf62d4..8b15a12 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 _0x5523=['./teamVoicePrefix.attributes','exports','team_has_voice_prefixes','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5523,0x137));var _0x3552=function(_0x7c766c,_0x50b4ab){_0x7c766c=_0x7c766c-0x0;var _0x1021d4=_0x5523[_0x7c766c];return _0x1021d4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3552('0x0'))(_0x3552('0x1'));var moment=require(_0x3552('0x2'));var BPromise=require(_0x3552('0x3'));var rp=require(_0x3552('0x4'));var fs=require('fs');var path=require(_0x3552('0x5'));var rimraf=require(_0x3552('0x6'));var config=require(_0x3552('0x7'));var attributes=require(_0x3552('0x8'));module[_0x3552('0x9')]=function(_0x3225aa,_0x58385b){return _0x3225aa['define']('TeamVoicePrefix',attributes,{'tableName':_0x3552('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3db=['./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x5d0cc6,_0x47011d){var _0x43ca59=function(_0x51e849){while(--_0x51e849){_0x5d0cc6['push'](_0x5d0cc6['shift']());}};_0x43ca59(++_0x47011d);}(_0xa3db,0x10c));var _0xba3d=function(_0x2e6c19,_0x131233){_0x2e6c19=_0x2e6c19-0x0;var _0x52885d=_0xa3db[_0x2e6c19];return _0x52885d;};'use strict';var _=require(_0xba3d('0x0'));var util=require(_0xba3d('0x1'));var logger=require(_0xba3d('0x2'))(_0xba3d('0x3'));var moment=require(_0xba3d('0x4'));var BPromise=require(_0xba3d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xba3d('0x6'));var config=require('../../config/environment');var attributes=require(_0xba3d('0x7'));module['exports']=function(_0x3f8f46,_0x12481b){return _0x3f8f46[_0xba3d('0x8')](_0xba3d('0x9'),attributes,{'tableName':_0xba3d('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 ca154b3..717fdd4 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x44b4ac,_0x391b4e){var _0x84bf1b=function(_0x42d8ed){while(--_0x42d8ed){_0x44b4ac['push'](_0x44b4ac['shift']());}};_0x84bf1b(++_0x391b4e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xc69f39,_0x2ce0cf){_0xc69f39=_0xc69f39-0x0;var _0x93be41=_0xcb91[_0xc69f39];return _0x93be41;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5b8d63,_0x23c15a){var _0x51e092=function(_0x236293){while(--_0x236293){_0x5b8d63['push'](_0x5b8d63['shift']());}};_0x51e092(++_0x23c15a);}(_0xe706,0xa3));var _0x6e70=function(_0xe59404,_0xc31864){_0xe59404=_0xe59404-0x0;var _0x23a1e1=_0xe706[_0xe59404];return _0x23a1e1;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 342148a..7691ace 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 _0x3f0d=['INTEGER','sequelize','exports'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x3f0d,0x1d5));var _0xd3f0=function(_0x19e39d,_0xb46a1){_0x19e39d=_0x19e39d-0x0;var _0x1889fc=_0x3f0d[_0x19e39d];return _0x1889fc;};'use strict';var Sequelize=require(_0xd3f0('0x0'));module[_0xd3f0('0x1')]={'penalty':{'type':Sequelize[_0xd3f0('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x07bd=['sequelize','exports','INTEGER'];(function(_0x1b6563,_0x3bf0f1){var _0xdea7b8=function(_0x49e6c6){while(--_0x49e6c6){_0x1b6563['push'](_0x1b6563['shift']());}};_0xdea7b8(++_0x3bf0f1);}(_0x07bd,0xea));var _0xd07b=function(_0x5f1e65,_0x3ec0dd){_0x5f1e65=_0x5f1e65-0x0;var _0x7a95f4=_0x07bd[_0x5f1e65];return _0x7a95f4;};'use strict';var Sequelize=require(_0xd07b('0x0'));module[_0xd07b('0x1')]={'penalty':{'type':Sequelize[_0xd07b('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 24afbf2..afb2b7e 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 _0x9bde=['request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','util','api','bluebird'];(function(_0x427ccd,_0x2778dc){var _0xa96850=function(_0x34c7fd){while(--_0x34c7fd){_0x427ccd['push'](_0x427ccd['shift']());}};_0xa96850(++_0x2778dc);}(_0x9bde,0xe1));var _0xe9bd=function(_0x11b042,_0x213ab0){_0x11b042=_0x11b042-0x0;var _0x24b2ba=_0x9bde[_0x11b042];return _0x24b2ba;};'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 +var _0x3248=['exports','define','TeamVoiceQueue','team_has_voice_queues','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x21abb9,_0x4218aa){var _0x46a24e=function(_0x35ff5d){while(--_0x35ff5d){_0x21abb9['push'](_0x21abb9['shift']());}};_0x46a24e(++_0x4218aa);}(_0x3248,0x1bc));var _0x8324=function(_0x5bebe4,_0x45fb54){_0x5bebe4=_0x5bebe4-0x0;var _0x4a04de=_0x3248[_0x5bebe4];return _0x4a04de;};'use strict';var _=require('lodash');var util=require(_0x8324('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8324('0x1'));var BPromise=require(_0x8324('0x2'));var rp=require(_0x8324('0x3'));var fs=require('fs');var path=require(_0x8324('0x4'));var rimraf=require(_0x8324('0x5'));var config=require(_0x8324('0x6'));var attributes=require('./teamVoiceQueue.attributes');module[_0x8324('0x7')]=function(_0x1c5c2a,_0x5157f4){return _0x1c5c2a[_0x8324('0x8')](_0x8324('0x9'),attributes,{'tableName':_0x8324('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 2faa4d2..c308697 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 _0xc856=['request','then','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','TeamVoiceQueue,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xc856,0x1a9));var _0x6c85=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xc856[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0x6c85('0x0'));var util=require(_0x6c85('0x1'));var moment=require(_0x6c85('0x2'));var BPromise=require(_0x6c85('0x3'));var rs=require(_0x6c85('0x4'));var fs=require('fs');var Redis=require(_0x6c85('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c85('0x6'));var logger=require(_0x6c85('0x7'))(_0x6c85('0x8'));var config=require('../../config/environment');var jayson=require(_0x6c85('0x9'));var client=jayson[_0x6c85('0xa')][_0x6c85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ed134,_0xbcfe9a,_0x11f0bf){return new BPromise(function(_0x4df2d2,_0x5d3800){return client[_0x6c85('0xc')](_0x5ed134,_0x11f0bf)[_0x6c85('0xd')](function(_0x4ba0c7){logger[_0x6c85('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0xbcfe9a,'request\x20sent');logger[_0x6c85('0xf')](_0x6c85('0x10'),_0xbcfe9a,_0x6c85('0x11'),JSON[_0x6c85('0x12')](_0x4ba0c7));if(_0x4ba0c7['error']){if(_0x4ba0c7['error']['code']===0x1f4){logger[_0x6c85('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0xbcfe9a,_0x4ba0c7[_0x6c85('0x13')]['message']);return _0x5d3800(_0x4ba0c7[_0x6c85('0x13')][_0x6c85('0x14')]);}logger['error'](_0x6c85('0x15'),_0xbcfe9a,_0x4ba0c7[_0x6c85('0x13')]['message']);return _0x4df2d2(_0x4ba0c7[_0x6c85('0x13')]['message']);}else{logger[_0x6c85('0xe')](_0x6c85('0x15'),_0xbcfe9a,_0x6c85('0x11'));_0x4df2d2(_0x4ba0c7['result']['message']);}})[_0x6c85('0x16')](function(_0x56aeb0){logger[_0x6c85('0x13')](_0x6c85('0x15'),_0xbcfe9a,_0x56aeb0);_0x5d3800(_0x56aeb0);});});} \ No newline at end of file +var _0xc1fa=['request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0xc1fa,0xe5));var _0xac1f=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xc1fa[_0x1573ea];return _0x51c0e2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xac1f('0x0'));var BPromise=require(_0xac1f('0x1'));var rs=require(_0xac1f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac1f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xac1f('0x4'))(_0xac1f('0x5'));var config=require('../../config/environment');var jayson=require(_0xac1f('0x6'));var client=jayson['client'][_0xac1f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x353131,_0x53891b,_0x20c802){return new BPromise(function(_0x522bea,_0xed527c){return client[_0xac1f('0x8')](_0x353131,_0x20c802)[_0xac1f('0x9')](function(_0x2eae37){logger['info'](_0xac1f('0xa'),_0x53891b,_0xac1f('0xb'));logger[_0xac1f('0xc')](_0xac1f('0xd'),_0x53891b,'request\x20sent',JSON[_0xac1f('0xe')](_0x2eae37));if(_0x2eae37['error']){if(_0x2eae37[_0xac1f('0xf')][_0xac1f('0x10')]===0x1f4){logger['error'](_0xac1f('0xa'),_0x53891b,_0x2eae37[_0xac1f('0xf')]['message']);return _0xed527c(_0x2eae37[_0xac1f('0xf')][_0xac1f('0x11')]);}logger[_0xac1f('0xf')](_0xac1f('0xa'),_0x53891b,_0x2eae37[_0xac1f('0xf')][_0xac1f('0x11')]);return _0x522bea(_0x2eae37[_0xac1f('0xf')][_0xac1f('0x11')]);}else{logger[_0xac1f('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x53891b,_0xac1f('0xb'));_0x522bea(_0x2eae37['result'][_0xac1f('0x11')]);}})[_0xac1f('0x13')](function(_0x3146b8){logger[_0xac1f('0xf')](_0xac1f('0xa'),_0x53891b,_0x3146b8);_0xed527c(_0x3146b8);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 241de99..d22ac65 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 _0x110f=['isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x110f,0x1e6));var _0xf110=function(_0x95ab1b,_0x55d6b7){_0x95ab1b=_0x95ab1b-0x0;var _0x4aef6f=_0x110f[_0x95ab1b];return _0x4aef6f;};'use strict';var multer=require(_0xf110('0x0'));var util=require(_0xf110('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf110('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf110('0x3'));var interaction=require(_0xf110('0x4'));var config=require(_0xf110('0x5'));var controller=require('./template.controller');router[_0xf110('0x6')]('/',auth[_0xf110('0x7')](),controller[_0xf110('0x8')]);router['get'](_0xf110('0x9'),auth[_0xf110('0x7')](),controller[_0xf110('0xa')]);router['post']('/',auth[_0xf110('0x7')](),controller[_0xf110('0xb')]);router[_0xf110('0xc')]('/:id',auth[_0xf110('0x7')](),controller[_0xf110('0xd')]);router[_0xf110('0xe')](_0xf110('0x9'),auth['isAuthenticated'](),controller[_0xf110('0xf')]);module[_0xf110('0x10')]=router; \ No newline at end of file +var _0xd0da=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','create','put','update','delete','destroy'];(function(_0x38c47e,_0x54d9c3){var _0x1d3d8e=function(_0x261baa){while(--_0x261baa){_0x38c47e['push'](_0x38c47e['shift']());}};_0x1d3d8e(++_0x54d9c3);}(_0xd0da,0x1b1));var _0xad0d=function(_0x2eee25,_0x53460d){_0x2eee25=_0x2eee25-0x0;var _0x1cb8c4=_0xd0da[_0x2eee25];return _0x1cb8c4;};'use strict';var multer=require(_0xad0d('0x0'));var util=require(_0xad0d('0x1'));var path=require(_0xad0d('0x2'));var timeout=require(_0xad0d('0x3'));var express=require(_0xad0d('0x4'));var router=express['Router']();var fs_extra=require(_0xad0d('0x5'));var auth=require(_0xad0d('0x6'));var interaction=require(_0xad0d('0x7'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0xad0d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xad0d('0x8')](_0xad0d('0x9'),auth[_0xad0d('0xa')](),controller[_0xad0d('0xb')]);router['post']('/',auth[_0xad0d('0xa')](),controller[_0xad0d('0xc')]);router[_0xad0d('0xd')](_0xad0d('0x9'),auth[_0xad0d('0xa')](),controller[_0xad0d('0xe')]);router[_0xad0d('0xf')](_0xad0d('0x9'),auth[_0xad0d('0xa')](),controller[_0xad0d('0x10')]);module[_0xad0d('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 24cbb31..ad3bf84 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 _0x25c0=['sequelize','STRING'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x25c0,0x144));var _0x025c=function(_0x35d5ef,_0xf5d87d){_0x35d5ef=_0x35d5ef-0x0;var _0x40356f=_0x25c0[_0x35d5ef];return _0x40356f;};'use strict';var Sequelize=require(_0x025c('0x0'));module['exports']={'name':{'type':Sequelize[_0x025c('0x1')]},'description':{'type':Sequelize[_0x025c('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xd8f1=['STRING','TEXT','sequelize','exports'];(function(_0xe6df97,_0x544f0a){var _0x511d51=function(_0x3f370f){while(--_0x3f370f){_0xe6df97['push'](_0xe6df97['shift']());}};_0x511d51(++_0x544f0a);}(_0xd8f1,0x1f2));var _0x1d8f=function(_0x7e5876,_0x10b7c3){_0x7e5876=_0x7e5876-0x0;var _0xab61a4=_0xd8f1[_0x7e5876];return _0xab61a4;};'use strict';var Sequelize=require(_0x1d8f('0x0'));module[_0x1d8f('0x1')]={'name':{'type':Sequelize[_0x1d8f('0x2')]},'description':{'type':Sequelize[_0x1d8f('0x2')]},'html':{'type':Sequelize[_0x1d8f('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 1921ca1..0ac82ae 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 _0xe661=['then','destroy','get','Templates','UserProfileResource','end','error','stack','name','map','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','filters','pick','filter','merge','where','VIRTUAL','options','Template','count','includeAll','findAll','rows','catch','show','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','offset','undefined','limit','Content-Range','apply','reject','save'];(function(_0x24629e,_0x43d384){var _0x58e6d1=function(_0x27ee74){while(--_0x27ee74){_0x24629e['push'](_0x24629e['shift']());}};_0x58e6d1(++_0x43d384);}(_0xe661,0xc4));var _0x1e66=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe661[_0x501510];return _0x1e6ee5;};'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(_0x1e66('0x0'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1e66('0x1'));var util=require(_0x1e66('0x2'));var path=require(_0x1e66('0x3'));var sox=require(_0x1e66('0x4'));var csv=require(_0x1e66('0x5'));var ejs=require(_0x1e66('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e66('0x7'));var squel=require('squel');var crypto=require(_0x1e66('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x1e66('0x9'));var toCsv=require(_0x1e66('0x5'));var querystring=require(_0x1e66('0xa'));var Papa=require(_0x1e66('0xb'));var Redis=require(_0x1e66('0xc'));var authService=require(_0x1e66('0xd'));var qs=require(_0x1e66('0xe'));var as=require(_0x1e66('0xf'));var hardwareService=require(_0x1e66('0x10'));var logger=require(_0x1e66('0x11'))(_0x1e66('0x12'));var utils=require('../../config/utils');var config=require(_0x1e66('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a3f7b,_0x19d4c3){_0x19d4c3=_0x19d4c3||0xcc;return function(_0x25ad8e){if(_0x25ad8e){return _0x1a3f7b[_0x1e66('0x14')](_0x19d4c3);}return _0x1a3f7b[_0x1e66('0x15')](_0x19d4c3)['end']();};}function respondWithResult(_0x3eba34,_0x40fbf9){_0x40fbf9=_0x40fbf9||0xc8;return function(_0x365529){if(_0x365529){return _0x3eba34[_0x1e66('0x15')](_0x40fbf9)['json'](_0x365529);}};}function respondWithFilteredResult(_0x199731,_0x39848b){return function(_0x1ce1c7){if(_0x1ce1c7){var _0x2e8987=typeof _0x39848b[_0x1e66('0x16')]===_0x1e66('0x17')&&typeof _0x39848b[_0x1e66('0x18')]===_0x1e66('0x17');var _0x2aa3dd=_0x1ce1c7['count'];var _0x5b5987=_0x2e8987?0x0:_0x39848b['offset'];var _0x40188a=_0x2e8987?_0x1ce1c7['count']:_0x39848b[_0x1e66('0x16')]+_0x39848b[_0x1e66('0x18')];var _0x219633;if(_0x40188a>=_0x2aa3dd){_0x40188a=_0x2aa3dd;_0x219633=0xc8;}else{_0x219633=0xce;}_0x199731['status'](_0x219633);return _0x199731['set'](_0x1e66('0x19'),_0x5b5987+'-'+_0x40188a+'/'+_0x2aa3dd)['json'](_0x1ce1c7);}return null;};}function patchUpdates(_0x515042){return function(_0x589376){try{jsonpatch[_0x1e66('0x1a')](_0x589376,_0x515042,!![]);}catch(_0x355e26){return BPromise[_0x1e66('0x1b')](_0x355e26);}return _0x589376[_0x1e66('0x1c')]();};}function saveUpdates(_0x32b919,_0x10956e){return function(_0x444d92){if(_0x444d92){return _0x444d92['update'](_0x32b919)[_0x1e66('0x1d')](function(_0x37e0db){return _0x37e0db;});}return null;};}function removeEntity(_0x3b6b32,_0x5a2c56){return function(_0xce69c5){if(_0xce69c5){return _0xce69c5[_0x1e66('0x1e')]()[_0x1e66('0x1d')](function(){var _0x4b84c8=_0xce69c5[_0x1e66('0x1f')]({'plain':!![]});var _0x47d863=_0x1e66('0x20');return db[_0x1e66('0x21')][_0x1e66('0x1e')]({'where':{'type':_0x47d863,'resourceId':_0x4b84c8['id']}})[_0x1e66('0x1d')](function(){return _0xce69c5;});})[_0x1e66('0x1d')](function(){_0x3b6b32[_0x1e66('0x15')](0xcc)[_0x1e66('0x22')]();});}};}function handleEntityNotFound(_0x18d62e,_0x2f4029){return function(_0x368075){if(!_0x368075){_0x18d62e[_0x1e66('0x14')](0x194);}return _0x368075;};}function handleError(_0x39d5c7,_0x5e21ee){_0x5e21ee=_0x5e21ee||0x1f4;return function(_0x6409a4){logger[_0x1e66('0x23')](_0x6409a4[_0x1e66('0x24')]);if(_0x6409a4['name']){delete _0x6409a4[_0x1e66('0x25')];}_0x39d5c7['status'](_0x5e21ee)['send'](_0x6409a4);};}exports['index']=function(_0x114bea,_0x458c54){var _0x3f7782={},_0x525320={},_0x26b1ed={'count':0x0,'rows':[]};var _0x49d918=_[_0x1e66('0x26')](db['Template'][_0x1e66('0x27')],function(_0x44d68b){return{'name':_0x44d68b[_0x1e66('0x28')],'type':_0x44d68b[_0x1e66('0x29')][_0x1e66('0x2a')]};});_0x525320[_0x1e66('0x2b')]=_[_0x1e66('0x26')](_0x49d918,_0x1e66('0x25'));_0x525320['query']=_[_0x1e66('0x2c')](_0x114bea['query']);_0x525320['filters']=_[_0x1e66('0x2d')](_0x525320[_0x1e66('0x2b')],_0x525320[_0x1e66('0x2e')]);_0x3f7782[_0x1e66('0x2f')]=_[_0x1e66('0x2d')](_0x525320['model'],qs['fields'](_0x114bea['query'][_0x1e66('0x30')]));_0x3f7782[_0x1e66('0x2f')]=_0x3f7782[_0x1e66('0x2f')]['length']?_0x3f7782[_0x1e66('0x2f')]:_0x525320[_0x1e66('0x2b')];if(!_0x114bea['query'][_0x1e66('0x31')]('nolimit')){_0x3f7782[_0x1e66('0x18')]=qs[_0x1e66('0x18')](_0x114bea[_0x1e66('0x2e')]['limit']);_0x3f7782['offset']=qs[_0x1e66('0x16')](_0x114bea[_0x1e66('0x2e')]['offset']);}_0x3f7782['order']=qs['sort'](_0x114bea[_0x1e66('0x2e')]['sort']);_0x3f7782['where']=qs[_0x1e66('0x32')](_[_0x1e66('0x33')](_0x114bea[_0x1e66('0x2e')],_0x525320['filters']),_0x49d918);if(_0x114bea[_0x1e66('0x2e')][_0x1e66('0x34')]){_0x3f7782['where']=_[_0x1e66('0x35')](_0x3f7782[_0x1e66('0x36')],{'$or':_[_0x1e66('0x26')](_0x49d918,function(_0x4c0a8d){if(_0x4c0a8d['type']!==_0x1e66('0x37')){var _0x211124={};_0x211124[_0x4c0a8d[_0x1e66('0x25')]]={'$like':'%'+_0x114bea[_0x1e66('0x2e')][_0x1e66('0x34')]+'%'};return _0x211124;}})});}_0x3f7782=_['merge']({},_0x3f7782,_0x114bea[_0x1e66('0x38')]);var _0x5f15b7={'where':_0x3f7782[_0x1e66('0x36')]};return db[_0x1e66('0x39')]['count'](_0x5f15b7)[_0x1e66('0x1d')](function(_0xe399f4){_0x26b1ed[_0x1e66('0x3a')]=_0xe399f4;if(_0x114bea['query'][_0x1e66('0x3b')]){_0x3f7782['include']=[{'all':!![]}];}return db[_0x1e66('0x39')][_0x1e66('0x3c')](_0x3f7782);})[_0x1e66('0x1d')](function(_0x16ed5e){_0x26b1ed[_0x1e66('0x3d')]=_0x16ed5e;return _0x26b1ed;})[_0x1e66('0x1d')](respondWithFilteredResult(_0x458c54,_0x3f7782))[_0x1e66('0x3e')](handleError(_0x458c54,null));};exports[_0x1e66('0x3f')]=function(_0x26ce0f,_0x8ebb61){var _0x58f33d={'raw':!![],'where':{'id':_0x26ce0f[_0x1e66('0x40')]['id']}},_0xaba20e={};_0xaba20e[_0x1e66('0x2b')]=_[_0x1e66('0x2c')](db[_0x1e66('0x39')]['rawAttributes']);_0xaba20e[_0x1e66('0x2e')]=_[_0x1e66('0x2c')](_0x26ce0f['query']);_0xaba20e[_0x1e66('0x32')]=_[_0x1e66('0x2d')](_0xaba20e[_0x1e66('0x2b')],_0xaba20e[_0x1e66('0x2e')]);_0x58f33d[_0x1e66('0x2f')]=_[_0x1e66('0x2d')](_0xaba20e[_0x1e66('0x2b')],qs['fields'](_0x26ce0f['query'][_0x1e66('0x30')]));_0x58f33d[_0x1e66('0x2f')]=_0x58f33d[_0x1e66('0x2f')][_0x1e66('0x41')]?_0x58f33d[_0x1e66('0x2f')]:_0xaba20e[_0x1e66('0x2b')];if(_0x26ce0f[_0x1e66('0x2e')]['includeAll']){_0x58f33d['include']=[{'all':!![]}];}_0x58f33d=_['merge']({},_0x58f33d,_0x26ce0f[_0x1e66('0x38')]);return db[_0x1e66('0x39')][_0x1e66('0x42')](_0x58f33d)[_0x1e66('0x1d')](handleEntityNotFound(_0x8ebb61,null))[_0x1e66('0x1d')](respondWithResult(_0x8ebb61,null))[_0x1e66('0x3e')](handleError(_0x8ebb61,null));};exports['create']=function(_0x3f4be9,_0x25c01b){return db[_0x1e66('0x39')][_0x1e66('0x43')](_0x3f4be9['body'],{})[_0x1e66('0x1d')](function(_0x480e81){var _0x1661c1=_0x3f4be9['user'][_0x1e66('0x1f')]({'plain':!![]});if(!_0x1661c1)throw new Error(_0x1e66('0x44'));if(_0x1661c1[_0x1e66('0x45')]===_0x1e66('0x46')){var _0x506b58=_0x480e81['get']({'plain':!![]});var _0x1bd432=_0x1e66('0x20');return db[_0x1e66('0x47')][_0x1e66('0x42')]({'where':{'name':_0x1bd432,'userProfileId':_0x1661c1[_0x1e66('0x48')]},'raw':!![]})[_0x1e66('0x1d')](function(_0x6b8ed2){if(_0x6b8ed2&&_0x6b8ed2[_0x1e66('0x49')]===0x0){return db['UserProfileResource'][_0x1e66('0x43')]({'name':_0x506b58['name'],'resourceId':_0x506b58['id'],'type':_0x6b8ed2[_0x1e66('0x25')],'sectionId':_0x6b8ed2['id']},{})[_0x1e66('0x1d')](function(){return _0x480e81;});}else{return _0x480e81;}})[_0x1e66('0x3e')](function(_0x6aec72){logger[_0x1e66('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6aec72);throw _0x6aec72;});}return _0x480e81;})[_0x1e66('0x1d')](respondWithResult(_0x25c01b,0xc9))[_0x1e66('0x3e')](handleError(_0x25c01b,null));};exports['update']=function(_0x4f9e80,_0x40012b){if(_0x4f9e80[_0x1e66('0x4a')]['id']){delete _0x4f9e80[_0x1e66('0x4a')]['id'];}return db[_0x1e66('0x39')][_0x1e66('0x42')]({'where':{'id':_0x4f9e80[_0x1e66('0x40')]['id']}})['then'](handleEntityNotFound(_0x40012b,null))[_0x1e66('0x1d')](saveUpdates(_0x4f9e80['body'],null))[_0x1e66('0x1d')](respondWithResult(_0x40012b,null))[_0x1e66('0x3e')](handleError(_0x40012b,null));};exports[_0x1e66('0x1e')]=function(_0x53b326,_0x25e327){return db['Template'][_0x1e66('0x42')]({'where':{'id':_0x53b326[_0x1e66('0x40')]['id']}})[_0x1e66('0x1d')](handleEntityNotFound(_0x25e327,null))[_0x1e66('0x1d')](removeEntity(_0x25e327,null))[_0x1e66('0x3e')](handleError(_0x25e327,null));}; \ No newline at end of file +var _0xb288=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','length','create','body','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','Templates','stack','name','send','index','map','Template','fieldName','key','model','keys','query','intersection'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0xb288,0x121));var _0x8b28=function(_0x52d50f,_0x4978a3){_0x52d50f=_0x52d50f-0x0;var _0x49d062=_0xb288[_0x52d50f];return _0x49d062;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b28('0x0'));var zipdir=require(_0x8b28('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b28('0x2'));var BPromise=require(_0x8b28('0x3'));var Mustache=require(_0x8b28('0x4'));var util=require(_0x8b28('0x5'));var path=require(_0x8b28('0x6'));var sox=require('sox');var csv=require(_0x8b28('0x7'));var ejs=require(_0x8b28('0x8'));var fs=require('fs');var fs_extra=require(_0x8b28('0x9'));var _=require(_0x8b28('0xa'));var squel=require(_0x8b28('0xb'));var crypto=require(_0x8b28('0xc'));var jsforce=require(_0x8b28('0xd'));var deskjs=require(_0x8b28('0xe'));var toCsv=require(_0x8b28('0x7'));var querystring=require(_0x8b28('0xf'));var Papa=require(_0x8b28('0x10'));var Redis=require(_0x8b28('0x11'));var authService=require(_0x8b28('0x12'));var qs=require(_0x8b28('0x13'));var as=require(_0x8b28('0x14'));var hardwareService=require(_0x8b28('0x15'));var logger=require('../../config/logger')(_0x8b28('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f5319,_0x2432b9){_0x2432b9=_0x2432b9||0xcc;return function(_0x3c5d3b){if(_0x3c5d3b){return _0x3f5319[_0x8b28('0x17')](_0x2432b9);}return _0x3f5319[_0x8b28('0x18')](_0x2432b9)[_0x8b28('0x19')]();};}function respondWithResult(_0x286521,_0x50c0b1){_0x50c0b1=_0x50c0b1||0xc8;return function(_0x120e00){if(_0x120e00){return _0x286521[_0x8b28('0x18')](_0x50c0b1)[_0x8b28('0x1a')](_0x120e00);}};}function respondWithFilteredResult(_0x2e173f,_0x42f4a3){return function(_0x2d0bc4){if(_0x2d0bc4){var _0x57aa6f=typeof _0x42f4a3[_0x8b28('0x1b')]===_0x8b28('0x1c')&&typeof _0x42f4a3[_0x8b28('0x1d')]===_0x8b28('0x1c');var _0x7c232c=_0x2d0bc4[_0x8b28('0x1e')];var _0x531998=_0x57aa6f?0x0:_0x42f4a3['offset'];var _0x2634e0=_0x57aa6f?_0x2d0bc4[_0x8b28('0x1e')]:_0x42f4a3[_0x8b28('0x1b')]+_0x42f4a3['limit'];var _0x3ac50b;if(_0x2634e0>=_0x7c232c){_0x2634e0=_0x7c232c;_0x3ac50b=0xc8;}else{_0x3ac50b=0xce;}_0x2e173f[_0x8b28('0x18')](_0x3ac50b);return _0x2e173f[_0x8b28('0x1f')](_0x8b28('0x20'),_0x531998+'-'+_0x2634e0+'/'+_0x7c232c)['json'](_0x2d0bc4);}return null;};}function patchUpdates(_0x5a008b){return function(_0x2c51bd){try{jsonpatch['apply'](_0x2c51bd,_0x5a008b,!![]);}catch(_0x2f430a){return BPromise[_0x8b28('0x21')](_0x2f430a);}return _0x2c51bd[_0x8b28('0x22')]();};}function saveUpdates(_0x533970,_0x4ae4c2){return function(_0x1fe95b){if(_0x1fe95b){return _0x1fe95b[_0x8b28('0x23')](_0x533970)[_0x8b28('0x24')](function(_0x135ca1){return _0x135ca1;});}return null;};}function removeEntity(_0x4a857d,_0x52c25f){return function(_0x124b48){if(_0x124b48){return _0x124b48[_0x8b28('0x25')]()[_0x8b28('0x24')](function(){var _0x1c34cf=_0x124b48['get']({'plain':!![]});var _0x27843a=_0x8b28('0x26');return db['UserProfileResource'][_0x8b28('0x25')]({'where':{'type':_0x27843a,'resourceId':_0x1c34cf['id']}})[_0x8b28('0x24')](function(){return _0x124b48;});})[_0x8b28('0x24')](function(){_0x4a857d[_0x8b28('0x18')](0xcc)[_0x8b28('0x19')]();});}};}function handleEntityNotFound(_0x529a1e,_0x47dfa6){return function(_0x4824ea){if(!_0x4824ea){_0x529a1e['sendStatus'](0x194);}return _0x4824ea;};}function handleError(_0x3960da,_0x253d5d){_0x253d5d=_0x253d5d||0x1f4;return function(_0x3763af){logger['error'](_0x3763af[_0x8b28('0x27')]);if(_0x3763af[_0x8b28('0x28')]){delete _0x3763af[_0x8b28('0x28')];}_0x3960da[_0x8b28('0x18')](_0x253d5d)[_0x8b28('0x29')](_0x3763af);};}exports[_0x8b28('0x2a')]=function(_0x2983da,_0x16ed7c){var _0x43d97d={},_0x483876={},_0x36010c={'count':0x0,'rows':[]};var _0x1d0510=_[_0x8b28('0x2b')](db[_0x8b28('0x2c')]['rawAttributes'],function(_0x51d053){return{'name':_0x51d053[_0x8b28('0x2d')],'type':_0x51d053['type'][_0x8b28('0x2e')]};});_0x483876[_0x8b28('0x2f')]=_[_0x8b28('0x2b')](_0x1d0510,'name');_0x483876['query']=_[_0x8b28('0x30')](_0x2983da[_0x8b28('0x31')]);_0x483876['filters']=_[_0x8b28('0x32')](_0x483876['model'],_0x483876[_0x8b28('0x31')]);_0x43d97d[_0x8b28('0x33')]=_['intersection'](_0x483876[_0x8b28('0x2f')],qs[_0x8b28('0x34')](_0x2983da['query'][_0x8b28('0x34')]));_0x43d97d['attributes']=_0x43d97d[_0x8b28('0x33')]['length']?_0x43d97d['attributes']:_0x483876[_0x8b28('0x2f')];if(!_0x2983da[_0x8b28('0x31')][_0x8b28('0x35')](_0x8b28('0x36'))){_0x43d97d['limit']=qs[_0x8b28('0x1d')](_0x2983da[_0x8b28('0x31')][_0x8b28('0x1d')]);_0x43d97d[_0x8b28('0x1b')]=qs['offset'](_0x2983da['query'][_0x8b28('0x1b')]);}_0x43d97d[_0x8b28('0x37')]=qs[_0x8b28('0x38')](_0x2983da[_0x8b28('0x31')][_0x8b28('0x38')]);_0x43d97d[_0x8b28('0x39')]=qs['filters'](_[_0x8b28('0x3a')](_0x2983da[_0x8b28('0x31')],_0x483876[_0x8b28('0x3b')]),_0x1d0510);if(_0x2983da[_0x8b28('0x31')][_0x8b28('0x3c')]){_0x43d97d['where']=_[_0x8b28('0x3d')](_0x43d97d[_0x8b28('0x39')],{'$or':_[_0x8b28('0x2b')](_0x1d0510,function(_0x55c0af){if(_0x55c0af[_0x8b28('0x3e')]!==_0x8b28('0x3f')){var _0x5bfd03={};_0x5bfd03[_0x55c0af[_0x8b28('0x28')]]={'$like':'%'+_0x2983da[_0x8b28('0x31')][_0x8b28('0x3c')]+'%'};return _0x5bfd03;}})});}_0x43d97d=_['merge']({},_0x43d97d,_0x2983da[_0x8b28('0x40')]);var _0x708d50={'where':_0x43d97d[_0x8b28('0x39')]};return db[_0x8b28('0x2c')][_0x8b28('0x1e')](_0x708d50)[_0x8b28('0x24')](function(_0x181572){_0x36010c[_0x8b28('0x1e')]=_0x181572;if(_0x2983da[_0x8b28('0x31')][_0x8b28('0x41')]){_0x43d97d[_0x8b28('0x42')]=[{'all':!![]}];}return db[_0x8b28('0x2c')][_0x8b28('0x43')](_0x43d97d);})[_0x8b28('0x24')](function(_0x52b43c){_0x36010c[_0x8b28('0x44')]=_0x52b43c;return _0x36010c;})['then'](respondWithFilteredResult(_0x16ed7c,_0x43d97d))[_0x8b28('0x45')](handleError(_0x16ed7c,null));};exports['show']=function(_0x38feb1,_0x2e1dde){var _0x5cf78e={'raw':!![],'where':{'id':_0x38feb1['params']['id']}},_0x5d2ceb={};_0x5d2ceb[_0x8b28('0x2f')]=_[_0x8b28('0x30')](db[_0x8b28('0x2c')][_0x8b28('0x46')]);_0x5d2ceb[_0x8b28('0x31')]=_[_0x8b28('0x30')](_0x38feb1[_0x8b28('0x31')]);_0x5d2ceb[_0x8b28('0x3b')]=_[_0x8b28('0x32')](_0x5d2ceb[_0x8b28('0x2f')],_0x5d2ceb[_0x8b28('0x31')]);_0x5cf78e[_0x8b28('0x33')]=_[_0x8b28('0x32')](_0x5d2ceb['model'],qs['fields'](_0x38feb1[_0x8b28('0x31')][_0x8b28('0x34')]));_0x5cf78e[_0x8b28('0x33')]=_0x5cf78e[_0x8b28('0x33')][_0x8b28('0x47')]?_0x5cf78e['attributes']:_0x5d2ceb[_0x8b28('0x2f')];if(_0x38feb1['query'][_0x8b28('0x41')]){_0x5cf78e[_0x8b28('0x42')]=[{'all':!![]}];}_0x5cf78e=_[_0x8b28('0x3d')]({},_0x5cf78e,_0x38feb1[_0x8b28('0x40')]);return db[_0x8b28('0x2c')]['find'](_0x5cf78e)[_0x8b28('0x24')](handleEntityNotFound(_0x2e1dde,null))[_0x8b28('0x24')](respondWithResult(_0x2e1dde,null))[_0x8b28('0x45')](handleError(_0x2e1dde,null));};exports[_0x8b28('0x48')]=function(_0x2a9ec8,_0x1e22b8){return db[_0x8b28('0x2c')]['create'](_0x2a9ec8[_0x8b28('0x49')],{})[_0x8b28('0x24')](function(_0x459ab2){var _0x14e094=_0x2a9ec8[_0x8b28('0x4a')][_0x8b28('0x4b')]({'plain':!![]});if(!_0x14e094)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14e094[_0x8b28('0x4c')]===_0x8b28('0x4a')){var _0x3741c5=_0x459ab2['get']({'plain':!![]});var _0x14c3e1=_0x8b28('0x26');return db[_0x8b28('0x4d')][_0x8b28('0x4e')]({'where':{'name':_0x14c3e1,'userProfileId':_0x14e094[_0x8b28('0x4f')]},'raw':!![]})[_0x8b28('0x24')](function(_0x3d7136){if(_0x3d7136&&_0x3d7136[_0x8b28('0x50')]===0x0){return db[_0x8b28('0x51')][_0x8b28('0x48')]({'name':_0x3741c5[_0x8b28('0x28')],'resourceId':_0x3741c5['id'],'type':_0x3d7136[_0x8b28('0x28')],'sectionId':_0x3d7136['id']},{})['then'](function(){return _0x459ab2;});}else{return _0x459ab2;}})['catch'](function(_0x439341){logger[_0x8b28('0x52')](_0x8b28('0x53'),_0x439341);throw _0x439341;});}return _0x459ab2;})[_0x8b28('0x24')](respondWithResult(_0x1e22b8,0xc9))[_0x8b28('0x45')](handleError(_0x1e22b8,null));};exports[_0x8b28('0x23')]=function(_0x1897d2,_0x502039){if(_0x1897d2['body']['id']){delete _0x1897d2[_0x8b28('0x49')]['id'];}return db[_0x8b28('0x2c')]['find']({'where':{'id':_0x1897d2[_0x8b28('0x54')]['id']}})[_0x8b28('0x24')](handleEntityNotFound(_0x502039,null))[_0x8b28('0x24')](saveUpdates(_0x1897d2[_0x8b28('0x49')],null))[_0x8b28('0x24')](respondWithResult(_0x502039,null))['catch'](handleError(_0x502039,null));};exports[_0x8b28('0x25')]=function(_0x4b547d,_0x3cd14f){return db['Template']['find']({'where':{'id':_0x4b547d[_0x8b28('0x54')]['id']}})[_0x8b28('0x24')](handleEntityNotFound(_0x3cd14f,null))[_0x8b28('0x24')](removeEntity(_0x3cd14f,null))[_0x8b28('0x45')](handleError(_0x3cd14f,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 747650c..11633f7 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 _0xff74=['path','rimraf','./template.attributes','define','tools_templates','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff74,0x1db));var _0x4ff7=function(_0x26474a,_0x3cfcfd){_0x26474a=_0x26474a-0x0;var _0x32e0e0=_0xff74[_0x26474a];return _0x32e0e0;};'use strict';var _=require(_0x4ff7('0x0'));var util=require(_0x4ff7('0x1'));var logger=require(_0x4ff7('0x2'))('api');var moment=require(_0x4ff7('0x3'));var BPromise=require(_0x4ff7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ff7('0x5'));var rimraf=require(_0x4ff7('0x6'));var config=require('../../config/environment');var attributes=require(_0x4ff7('0x7'));module['exports']=function(_0x22e047,_0x282c07){return _0x22e047[_0x4ff7('0x8')]('Template',attributes,{'tableName':_0x4ff7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe09c=['path','rimraf','../../config/environment','define','Template','tools_templates','lodash','../../config/logger','api','moment','bluebird'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xe09c,0x171));var _0xce09=function(_0x6e902f,_0x37f427){_0x6e902f=_0x6e902f-0x0;var _0x41bb35=_0xe09c[_0x6e902f];return _0x41bb35;};'use strict';var _=require(_0xce09('0x0'));var util=require('util');var logger=require(_0xce09('0x1'))(_0xce09('0x2'));var moment=require(_0xce09('0x3'));var BPromise=require(_0xce09('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce09('0x5'));var rimraf=require(_0xce09('0x6'));var config=require(_0xce09('0x7'));var attributes=require('./template.attributes');module['exports']=function(_0x16058d,_0x2b7cda){return _0x16058d[_0xce09('0x8')](_0xce09('0x9'),attributes,{'tableName':_0xce09('0xa'),'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 0eb753f..e979175 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 _0xeb9a=['request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','findAll','options','raw','attributes','limit','include','map','model','GetTemplate','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Template,\x20%s,\x20%s'];(function(_0x338141,_0x499c24){var _0x4ae3e0=function(_0x5a05c3){while(--_0x5a05c3){_0x338141['push'](_0x338141['shift']());}};_0x4ae3e0(++_0x499c24);}(_0xeb9a,0xcb));var _0xaeb9=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xeb9a[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xaeb9('0x0'));var util=require(_0xaeb9('0x1'));var moment=require(_0xaeb9('0x2'));var BPromise=require(_0xaeb9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaeb9('0x4'));var db=require(_0xaeb9('0x5'))['db'];var utils=require(_0xaeb9('0x6'));var logger=require('../../config/logger')(_0xaeb9('0x7'));var config=require(_0xaeb9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaeb9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b8375,_0x2c0838,_0xaef7ec){return new BPromise(function(_0x3a861a,_0x3a465b){return client[_0xaeb9('0xa')](_0x4b8375,_0xaef7ec)[_0xaeb9('0xb')](function(_0xd47aef){logger[_0xaeb9('0xc')](_0xaeb9('0xd'),_0x2c0838,_0xaeb9('0xe'));logger[_0xaeb9('0xf')](_0xaeb9('0x10'),_0x2c0838,'request\x20sent',JSON[_0xaeb9('0x11')](_0xd47aef));if(_0xd47aef[_0xaeb9('0x12')]){if(_0xd47aef[_0xaeb9('0x12')][_0xaeb9('0x13')]===0x1f4){logger['error'](_0xaeb9('0xd'),_0x2c0838,_0xd47aef[_0xaeb9('0x12')][_0xaeb9('0x14')]);return _0x3a465b(_0xd47aef[_0xaeb9('0x12')][_0xaeb9('0x14')]);}logger['error'](_0xaeb9('0xd'),_0x2c0838,_0xd47aef[_0xaeb9('0x12')]['message']);return _0x3a861a(_0xd47aef[_0xaeb9('0x12')][_0xaeb9('0x14')]);}else{logger[_0xaeb9('0xc')]('Template,\x20%s,\x20%s',_0x2c0838,_0xaeb9('0xe'));_0x3a861a(_0xd47aef['result'][_0xaeb9('0x14')]);}})['catch'](function(_0x55807e){logger[_0xaeb9('0x12')]('Template,\x20%s,\x20%s',_0x2c0838,_0x55807e);_0x3a465b(_0x55807e);});});}exports['GetTemplate']=function(_0x462d9d){var _0x2b13d5=this;return new Promise(function(_0x44ee20,_0x2414fb){return db['Template'][_0xaeb9('0x15')]({'raw':_0x462d9d[_0xaeb9('0x16')]?_0x462d9d['options'][_0xaeb9('0x17')]===undefined?!![]:![]:!![],'where':_0x462d9d['options']?_0x462d9d[_0xaeb9('0x16')]['where']||null:null,'attributes':_0x462d9d[_0xaeb9('0x16')]?_0x462d9d[_0xaeb9('0x16')][_0xaeb9('0x18')]||null:null,'limit':_0x462d9d[_0xaeb9('0x16')]?_0x462d9d['options'][_0xaeb9('0x19')]||null:null,'include':_0x462d9d['options']?_0x462d9d[_0xaeb9('0x16')][_0xaeb9('0x1a')]?_[_0xaeb9('0x1b')](_0x462d9d[_0xaeb9('0x16')][_0xaeb9('0x1a')],function(_0x1e6e76){return{'model':db[_0x1e6e76[_0xaeb9('0x1c')]],'as':_0x1e6e76['as'],'attributes':_0x1e6e76[_0xaeb9('0x18')],'include':_0x1e6e76[_0xaeb9('0x1a')]?_[_0xaeb9('0x1b')](_0x1e6e76[_0xaeb9('0x1a')],function(_0x2e062f){return{'model':db[_0x2e062f[_0xaeb9('0x1c')]],'as':_0x2e062f['as'],'attributes':_0x2e062f[_0xaeb9('0x18')],'include':_0x2e062f[_0xaeb9('0x1a')]?_[_0xaeb9('0x1b')](_0x2e062f[_0xaeb9('0x1a')],function(_0xad056f){return{'model':db[_0xad056f[_0xaeb9('0x1c')]],'as':_0xad056f['as'],'attributes':_0xad056f[_0xaeb9('0x18')]};}):[]};}):[]};}):[]:[]})[_0xaeb9('0xb')](function(_0xf771a9){logger[_0xaeb9('0xc')]('GetTemplate',_0x462d9d);logger['debug'](_0xaeb9('0x1d'),_0x462d9d,JSON['stringify'](_0xf771a9));_0x44ee20(_0xf771a9);})[_0xaeb9('0x1e')](function(_0x5243d0){logger[_0xaeb9('0x12')](_0xaeb9('0x1d'),_0x5243d0[_0xaeb9('0x14')],_0x462d9d);_0x2414fb(_0x2b13d5['error'](0x1f4,_0x5243d0[_0xaeb9('0x14')]));});});}; \ No newline at end of file +var _0x45ba=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetTemplate','findAll','options','raw','attributes','map','include','model','lodash','util'];(function(_0x16aefb,_0x5a875b){var _0x1434be=function(_0x545997){while(--_0x545997){_0x16aefb['push'](_0x16aefb['shift']());}};_0x1434be(++_0x5a875b);}(_0x45ba,0x1c0));var _0xa45b=function(_0x19113a,_0x36734d){_0x19113a=_0x19113a-0x0;var _0x430b61=_0x45ba[_0x19113a];return _0x430b61;};'use strict';var _=require(_0xa45b('0x0'));var util=require(_0xa45b('0x1'));var moment=require(_0xa45b('0x2'));var BPromise=require(_0xa45b('0x3'));var rs=require(_0xa45b('0x4'));var fs=require('fs');var Redis=require(_0xa45b('0x5'));var db=require(_0xa45b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa45b('0x7'))(_0xa45b('0x8'));var config=require(_0xa45b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa45b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58a328,_0x1d96e3,_0x3d68b2){return new BPromise(function(_0x56d380,_0x5939b0){return client[_0xa45b('0xb')](_0x58a328,_0x3d68b2)['then'](function(_0x4f5c08){logger['info'](_0xa45b('0xc'),_0x1d96e3,_0xa45b('0xd'));logger[_0xa45b('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x1d96e3,_0xa45b('0xd'),JSON[_0xa45b('0xf')](_0x4f5c08));if(_0x4f5c08[_0xa45b('0x10')]){if(_0x4f5c08[_0xa45b('0x10')][_0xa45b('0x11')]===0x1f4){logger[_0xa45b('0x10')](_0xa45b('0xc'),_0x1d96e3,_0x4f5c08[_0xa45b('0x10')][_0xa45b('0x12')]);return _0x5939b0(_0x4f5c08['error'][_0xa45b('0x12')]);}logger['error'](_0xa45b('0xc'),_0x1d96e3,_0x4f5c08[_0xa45b('0x10')][_0xa45b('0x12')]);return _0x56d380(_0x4f5c08[_0xa45b('0x10')][_0xa45b('0x12')]);}else{logger[_0xa45b('0x13')](_0xa45b('0xc'),_0x1d96e3,_0xa45b('0xd'));_0x56d380(_0x4f5c08[_0xa45b('0x14')][_0xa45b('0x12')]);}})[_0xa45b('0x15')](function(_0xcd86e4){logger[_0xa45b('0x10')](_0xa45b('0xc'),_0x1d96e3,_0xcd86e4);_0x5939b0(_0xcd86e4);});});}exports[_0xa45b('0x16')]=function(_0x2a51a9){var _0x1a94f7=this;return new Promise(function(_0x3c8963,_0x147bb9){return db['Template'][_0xa45b('0x17')]({'raw':_0x2a51a9[_0xa45b('0x18')]?_0x2a51a9[_0xa45b('0x18')][_0xa45b('0x19')]===undefined?!![]:![]:!![],'where':_0x2a51a9[_0xa45b('0x18')]?_0x2a51a9[_0xa45b('0x18')]['where']||null:null,'attributes':_0x2a51a9[_0xa45b('0x18')]?_0x2a51a9[_0xa45b('0x18')][_0xa45b('0x1a')]||null:null,'limit':_0x2a51a9[_0xa45b('0x18')]?_0x2a51a9['options']['limit']||null:null,'include':_0x2a51a9[_0xa45b('0x18')]?_0x2a51a9['options']['include']?_[_0xa45b('0x1b')](_0x2a51a9[_0xa45b('0x18')][_0xa45b('0x1c')],function(_0x43020f){return{'model':db[_0x43020f[_0xa45b('0x1d')]],'as':_0x43020f['as'],'attributes':_0x43020f[_0xa45b('0x1a')],'include':_0x43020f[_0xa45b('0x1c')]?_[_0xa45b('0x1b')](_0x43020f[_0xa45b('0x1c')],function(_0x3c0363){return{'model':db[_0x3c0363[_0xa45b('0x1d')]],'as':_0x3c0363['as'],'attributes':_0x3c0363[_0xa45b('0x1a')],'include':_0x3c0363['include']?_[_0xa45b('0x1b')](_0x3c0363[_0xa45b('0x1c')],function(_0x43a072){return{'model':db[_0x43a072[_0xa45b('0x1d')]],'as':_0x43a072['as'],'attributes':_0x43a072['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a990a){logger[_0xa45b('0x13')]('GetTemplate',_0x2a51a9);logger[_0xa45b('0xe')](_0xa45b('0x16'),_0x2a51a9,JSON[_0xa45b('0xf')](_0x1a990a));_0x3c8963(_0x1a990a);})[_0xa45b('0x15')](function(_0x278799){logger[_0xa45b('0x10')](_0xa45b('0x16'),_0x278799[_0xa45b('0x12')],_0x2a51a9);_0x147bb9(_0x1a94f7[_0xa45b('0x10')](0x1f4,_0x278799[_0xa45b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 41efd87..5903e70 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 _0x8ad9=['/:id/any_conditions','/:id/actions','post','create','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions'];(function(_0x538812,_0x312101){var _0x5759ad=function(_0x3295ac){while(--_0x3295ac){_0x538812['push'](_0x538812['shift']());}};_0x5759ad(++_0x312101);}(_0x8ad9,0xad));var _0x98ad=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x8ad9[_0x3e44fa];return _0x2a0aba;};'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['getAnyConditions']);router[_0x98ad('0x9')](_0x98ad('0x11'),auth[_0x98ad('0xc')](),controller['getActions']);router[_0x98ad('0x12')]('/',auth[_0x98ad('0xc')](),controller[_0x98ad('0x13')]);router[_0x98ad('0x12')](_0x98ad('0xe'),auth['isAuthenticated'](),controller['addAllCondition']);router[_0x98ad('0x12')](_0x98ad('0x10'),auth[_0x98ad('0xc')](),controller[_0x98ad('0x14')]);router[_0x98ad('0x12')](_0x98ad('0x11'),auth[_0x98ad('0xc')](),controller[_0x98ad('0x15')]);router[_0x98ad('0x16')]('/:id',auth[_0x98ad('0xc')](),controller[_0x98ad('0x17')]);router[_0x98ad('0x18')](_0x98ad('0xb'),auth[_0x98ad('0xc')](),controller[_0x98ad('0x19')]);module[_0x98ad('0x1a')]=router; \ No newline at end of file +var _0x8104=['/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAction','put','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x50b05f,_0x29cbea){var _0x25d44f=function(_0x104341){while(--_0x104341){_0x50b05f['push'](_0x50b05f['shift']());}};_0x25d44f(++_0x29cbea);}(_0x8104,0x84));var _0x4810=function(_0x1d54a1,_0x166d9a){_0x1d54a1=_0x1d54a1-0x0;var _0x41aa8c=_0x8104[_0x1d54a1];return _0x41aa8c;};'use strict';var multer=require('multer');var util=require(_0x4810('0x0'));var path=require(_0x4810('0x1'));var timeout=require(_0x4810('0x2'));var express=require(_0x4810('0x3'));var router=express['Router']();var fs_extra=require(_0x4810('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4810('0x5'));var config=require(_0x4810('0x6'));var controller=require('./trigger.controller');router['get']('/',auth[_0x4810('0x7')](),controller[_0x4810('0x8')]);router[_0x4810('0x9')](_0x4810('0xa'),auth['isAuthenticated'](),controller[_0x4810('0xb')]);router[_0x4810('0x9')](_0x4810('0xc'),auth[_0x4810('0x7')](),controller['getAllConditions']);router[_0x4810('0x9')](_0x4810('0xd'),auth['isAuthenticated'](),controller[_0x4810('0xe')]);router[_0x4810('0x9')](_0x4810('0xf'),auth[_0x4810('0x7')](),controller[_0x4810('0x10')]);router[_0x4810('0x11')]('/',auth[_0x4810('0x7')](),controller[_0x4810('0x12')]);router[_0x4810('0x11')]('/:id/all_conditions',auth[_0x4810('0x7')](),controller[_0x4810('0x13')]);router[_0x4810('0x11')](_0x4810('0xd'),auth[_0x4810('0x7')](),controller['addAnyCondition']);router['post'](_0x4810('0xf'),auth[_0x4810('0x7')](),controller[_0x4810('0x14')]);router[_0x4810('0x15')]('/:id',auth[_0x4810('0x7')](),controller['update']);router[_0x4810('0x16')](_0x4810('0xa'),auth[_0x4810('0x7')](),controller['destroy']);module[_0x4810('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index e2584f6..ffcc4a6 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 _0xf674=['exports','STRING','sequelize'];(function(_0x535ac5,_0x2035fa){var _0x426181=function(_0x23dfc1){while(--_0x23dfc1){_0x535ac5['push'](_0x535ac5['shift']());}};_0x426181(++_0x2035fa);}(_0xf674,0x86));var _0x4f67=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0xf674[_0x104e21];return _0x605b37;};'use strict';var Sequelize=require(_0x4f67('0x0'));module[_0x4f67('0x1')]={'name':{'type':Sequelize[_0x4f67('0x2')]},'channel':{'type':Sequelize[_0x4f67('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6536=['BOOLEAN','exports','STRING'];(function(_0x561f25,_0x2d95c1){var _0x150e4c=function(_0x266e99){while(--_0x266e99){_0x561f25['push'](_0x561f25['shift']());}};_0x150e4c(++_0x2d95c1);}(_0x6536,0x1ae));var _0x6653=function(_0x5bab6a,_0x406dbc){_0x5bab6a=_0x5bab6a-0x0;var _0xa9d8aa=_0x6536[_0x5bab6a];return _0xa9d8aa;};'use strict';var Sequelize=require('sequelize');module[_0x6653('0x0')]={'name':{'type':Sequelize[_0x6653('0x1')]},'channel':{'type':Sequelize[_0x6653('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x6653('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 0915c6a..351f4ed 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 _0xa583=['name','send','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','where','filters','pick','filter','merge','options','include','rows','show','params','includeAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','length','getAnyConditions','sort','hasOwnProperty','addAction','Action','getActions','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','Triggers','UserProfileResource','sendStatus','stack'];(function(_0x212413,_0x75218c){var _0xed4049=function(_0x207a92){while(--_0x207a92){_0x212413['push'](_0x212413['shift']());}};_0xed4049(++_0x75218c);}(_0xa583,0xf0));var _0x3a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa583[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a58('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3a58('0x1'));var BPromise=require(_0x3a58('0x2'));var Mustache=require(_0x3a58('0x3'));var util=require(_0x3a58('0x4'));var path=require(_0x3a58('0x5'));var sox=require(_0x3a58('0x6'));var csv=require(_0x3a58('0x7'));var ejs=require(_0x3a58('0x8'));var fs=require('fs');var fs_extra=require(_0x3a58('0x9'));var _=require('lodash');var squel=require(_0x3a58('0xa'));var crypto=require(_0x3a58('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3a58('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3a58('0xd'));var Papa=require(_0x3a58('0xe'));var Redis=require('ioredis');var authService=require(_0x3a58('0xf'));var qs=require(_0x3a58('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a58('0x11'));var logger=require(_0x3a58('0x12'))(_0x3a58('0x13'));var utils=require(_0x3a58('0x14'));var config=require(_0x3a58('0x15'));var licenseUtil=require(_0x3a58('0x16'));var db=require(_0x3a58('0x17'))['db'];function respondWithStatusCode(_0x42af52,_0x41101c){_0x41101c=_0x41101c||0xcc;return function(_0x401475){if(_0x401475){return _0x42af52['sendStatus'](_0x41101c);}return _0x42af52[_0x3a58('0x18')](_0x41101c)[_0x3a58('0x19')]();};}function respondWithResult(_0x43206e,_0x1fa288){_0x1fa288=_0x1fa288||0xc8;return function(_0x59bd6){if(_0x59bd6){return _0x43206e['status'](_0x1fa288)['json'](_0x59bd6);}};}function respondWithFilteredResult(_0x108847,_0x1869fe){return function(_0x572b81){if(_0x572b81){var _0x300738=typeof _0x1869fe[_0x3a58('0x1a')]===_0x3a58('0x1b')&&typeof _0x1869fe['limit']===_0x3a58('0x1b');var _0x3ae7a7=_0x572b81[_0x3a58('0x1c')];var _0x4a7f68=_0x300738?0x0:_0x1869fe['offset'];var _0x5d253c=_0x300738?_0x572b81[_0x3a58('0x1c')]:_0x1869fe[_0x3a58('0x1a')]+_0x1869fe[_0x3a58('0x1d')];var _0x360ccc;if(_0x5d253c>=_0x3ae7a7){_0x5d253c=_0x3ae7a7;_0x360ccc=0xc8;}else{_0x360ccc=0xce;}_0x108847[_0x3a58('0x18')](_0x360ccc);return _0x108847[_0x3a58('0x1e')]('Content-Range',_0x4a7f68+'-'+_0x5d253c+'/'+_0x3ae7a7)[_0x3a58('0x1f')](_0x572b81);}return null;};}function patchUpdates(_0x149286){return function(_0x2fcff9){try{jsonpatch[_0x3a58('0x20')](_0x2fcff9,_0x149286,!![]);}catch(_0x356a52){return BPromise[_0x3a58('0x21')](_0x356a52);}return _0x2fcff9[_0x3a58('0x22')]();};}function saveUpdates(_0x5ee679,_0x20348f){return function(_0x5680e6){if(_0x5680e6){return _0x5680e6[_0x3a58('0x23')](_0x5ee679)[_0x3a58('0x24')](function(_0xbd113){return _0xbd113;});}return null;};}function removeEntity(_0x989e50,_0x1f9aa9){return function(_0x45541f){if(_0x45541f){return _0x45541f[_0x3a58('0x25')]()['then'](function(){var _0x326a0e=_0x45541f['get']({'plain':!![]});var _0x4f1423=_0x3a58('0x26');return db[_0x3a58('0x27')]['destroy']({'where':{'type':_0x4f1423,'resourceId':_0x326a0e['id']}})['then'](function(){return _0x45541f;});})['then'](function(){_0x989e50['status'](0xcc)[_0x3a58('0x19')]();});}};}function handleEntityNotFound(_0x3457c9,_0x34c7bc){return function(_0x5c3e2b){if(!_0x5c3e2b){_0x3457c9[_0x3a58('0x28')](0x194);}return _0x5c3e2b;};}function handleError(_0x463094,_0x512d65){_0x512d65=_0x512d65||0x1f4;return function(_0x40c12c){logger['error'](_0x40c12c[_0x3a58('0x29')]);if(_0x40c12c[_0x3a58('0x2a')]){delete _0x40c12c[_0x3a58('0x2a')];}_0x463094['status'](_0x512d65)[_0x3a58('0x2b')](_0x40c12c);};}exports['index']=function(_0x5f4ed5,_0x2688b1){var _0x13f057={},_0x1124f3={},_0x19844d={'count':0x0,'rows':[]};var _0x27cbe5=_[_0x3a58('0x2c')](db[_0x3a58('0x2d')][_0x3a58('0x2e')],function(_0x176226){return{'name':_0x176226[_0x3a58('0x2f')],'type':_0x176226[_0x3a58('0x30')][_0x3a58('0x31')]};});_0x1124f3[_0x3a58('0x32')]=_['map'](_0x27cbe5,'name');_0x1124f3[_0x3a58('0x33')]=_[_0x3a58('0x34')](_0x5f4ed5['query']);_0x1124f3['filters']=_[_0x3a58('0x35')](_0x1124f3[_0x3a58('0x32')],_0x1124f3[_0x3a58('0x33')]);_0x13f057[_0x3a58('0x36')]=_[_0x3a58('0x35')](_0x1124f3[_0x3a58('0x32')],qs[_0x3a58('0x37')](_0x5f4ed5['query'][_0x3a58('0x37')]));_0x13f057[_0x3a58('0x36')]=_0x13f057['attributes']['length']?_0x13f057[_0x3a58('0x36')]:_0x1124f3[_0x3a58('0x32')];if(!_0x5f4ed5[_0x3a58('0x33')]['hasOwnProperty'](_0x3a58('0x38'))){_0x13f057[_0x3a58('0x1d')]=qs[_0x3a58('0x1d')](_0x5f4ed5['query'][_0x3a58('0x1d')]);_0x13f057[_0x3a58('0x1a')]=qs[_0x3a58('0x1a')](_0x5f4ed5[_0x3a58('0x33')][_0x3a58('0x1a')]);}_0x13f057[_0x3a58('0x39')]=qs['sort'](_0x5f4ed5[_0x3a58('0x33')]['sort']);_0x13f057[_0x3a58('0x3a')]=qs[_0x3a58('0x3b')](_[_0x3a58('0x3c')](_0x5f4ed5[_0x3a58('0x33')],_0x1124f3[_0x3a58('0x3b')]),_0x27cbe5);if(_0x5f4ed5['query']['filter']){_0x13f057[_0x3a58('0x3a')]=_['merge'](_0x13f057[_0x3a58('0x3a')],{'$or':_[_0x3a58('0x2c')](_0x27cbe5,function(_0xb65045){if(_0xb65045[_0x3a58('0x30')]!=='VIRTUAL'){var _0x41e9ac={};_0x41e9ac[_0xb65045['name']]={'$like':'%'+_0x5f4ed5[_0x3a58('0x33')][_0x3a58('0x3d')]+'%'};return _0x41e9ac;}})});}_0x13f057=_[_0x3a58('0x3e')]({},_0x13f057,_0x5f4ed5[_0x3a58('0x3f')]);var _0x564d3d={'where':_0x13f057[_0x3a58('0x3a')]};return db[_0x3a58('0x2d')][_0x3a58('0x1c')](_0x564d3d)[_0x3a58('0x24')](function(_0x273f97){_0x19844d[_0x3a58('0x1c')]=_0x273f97;if(_0x5f4ed5[_0x3a58('0x33')]['includeAll']){_0x13f057[_0x3a58('0x40')]=[{'all':!![]}];}return db[_0x3a58('0x2d')]['findAll'](_0x13f057);})['then'](function(_0x9ef3e7){_0x19844d[_0x3a58('0x41')]=_0x9ef3e7;return _0x19844d;})[_0x3a58('0x24')](respondWithFilteredResult(_0x2688b1,_0x13f057))['catch'](handleError(_0x2688b1,null));};exports[_0x3a58('0x42')]=function(_0x1d6385,_0x419dab){var _0x258756={'raw':![],'where':{'id':_0x1d6385[_0x3a58('0x43')]['id']}},_0x3629cf={};_0x3629cf[_0x3a58('0x32')]=_[_0x3a58('0x34')](db[_0x3a58('0x2d')][_0x3a58('0x2e')]);_0x3629cf['query']=_['keys'](_0x1d6385[_0x3a58('0x33')]);_0x3629cf[_0x3a58('0x3b')]=_['intersection'](_0x3629cf[_0x3a58('0x32')],_0x3629cf[_0x3a58('0x33')]);_0x258756[_0x3a58('0x36')]=_['intersection'](_0x3629cf[_0x3a58('0x32')],qs[_0x3a58('0x37')](_0x1d6385[_0x3a58('0x33')][_0x3a58('0x37')]));_0x258756[_0x3a58('0x36')]=_0x258756[_0x3a58('0x36')]['length']?_0x258756[_0x3a58('0x36')]:_0x3629cf[_0x3a58('0x32')];if(_0x1d6385['query'][_0x3a58('0x44')]){_0x258756['include']=[{'all':!![]}];}_0x258756=_['merge']({},_0x258756,_0x1d6385[_0x3a58('0x3f')]);return db[_0x3a58('0x2d')][_0x3a58('0x45')](_0x258756)[_0x3a58('0x24')](handleEntityNotFound(_0x419dab,null))['then'](respondWithResult(_0x419dab,null))[_0x3a58('0x46')](handleError(_0x419dab,null));};exports['create']=function(_0x27c7e9,_0x3ca6b4){return db[_0x3a58('0x2d')][_0x3a58('0x47')](_0x27c7e9[_0x3a58('0x48')],{})['then'](function(_0x497e6d){var _0x3f05fc=_0x27c7e9[_0x3a58('0x49')][_0x3a58('0x4a')]({'plain':!![]});if(!_0x3f05fc)throw new Error(_0x3a58('0x4b'));if(_0x3f05fc[_0x3a58('0x4c')]===_0x3a58('0x49')){var _0x44bb01=_0x497e6d[_0x3a58('0x4a')]({'plain':!![]});var _0x1e0bf=_0x3a58('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x1e0bf,'userProfileId':_0x3f05fc[_0x3a58('0x4d')]},'raw':!![]})[_0x3a58('0x24')](function(_0x29aed0){if(_0x29aed0&&_0x29aed0[_0x3a58('0x4e')]===0x0){return db[_0x3a58('0x27')][_0x3a58('0x47')]({'name':_0x44bb01['name'],'resourceId':_0x44bb01['id'],'type':_0x29aed0[_0x3a58('0x2a')],'sectionId':_0x29aed0['id']},{})['then'](function(){return _0x497e6d;});}else{return _0x497e6d;}})[_0x3a58('0x46')](function(_0x3a599e){logger['error'](_0x3a58('0x4f'),_0x3a599e);throw _0x3a599e;});}return _0x497e6d;})['then'](respondWithResult(_0x3ca6b4,0xc9))[_0x3a58('0x46')](handleError(_0x3ca6b4,null));};exports[_0x3a58('0x23')]=function(_0xffa5c5,_0x994b5e){if(_0xffa5c5[_0x3a58('0x48')]['id']){delete _0xffa5c5[_0x3a58('0x48')]['id'];}return db['Trigger']['find']({'where':{'id':_0xffa5c5[_0x3a58('0x43')]['id']}})['then'](handleEntityNotFound(_0x994b5e,null))['then'](saveUpdates(_0xffa5c5[_0x3a58('0x48')],null))['then'](respondWithResult(_0x994b5e,null))['catch'](handleError(_0x994b5e,null));};exports[_0x3a58('0x25')]=function(_0x4250bc,_0x48eb5d){return db[_0x3a58('0x2d')][_0x3a58('0x45')]({'where':{'id':_0x4250bc[_0x3a58('0x43')]['id']}})['then'](handleEntityNotFound(_0x48eb5d,null))[_0x3a58('0x24')](removeEntity(_0x48eb5d,null))[_0x3a58('0x46')](handleError(_0x48eb5d,null));};exports[_0x3a58('0x50')]=function(_0xbd21f8,_0x19d5f0,_0x2307f7){if(_0xbd21f8[_0x3a58('0x48')]['id']){delete _0xbd21f8[_0x3a58('0x48')]['id'];}return db['Trigger'][_0x3a58('0x45')]({'where':{'id':_0xbd21f8[_0x3a58('0x43')]['id']}})[_0x3a58('0x24')](handleEntityNotFound(_0x19d5f0,null))[_0x3a58('0x24')](function(_0x578c42){if(_0x578c42){_0xbd21f8[_0x3a58('0x48')][_0x3a58('0x51')]=_0x578c42['id'];return db['Condition'][_0x3a58('0x47')](_0xbd21f8['body']);}})[_0x3a58('0x24')](respondWithResult(_0x19d5f0,null))[_0x3a58('0x46')](handleError(_0x19d5f0,null));};exports[_0x3a58('0x52')]=function(_0x4df7dc,_0x2a1aad,_0x4f35f6){if(_0x4df7dc[_0x3a58('0x48')]['id']){delete _0x4df7dc[_0x3a58('0x48')]['id'];}return db['Trigger'][_0x3a58('0x45')]({'where':{'id':_0x4df7dc[_0x3a58('0x43')]['id']}})['then'](handleEntityNotFound(_0x2a1aad,null))['then'](function(_0x3e9eef){if(_0x3e9eef){_0x4df7dc[_0x3a58('0x48')][_0x3a58('0x53')]=_0x3e9eef['id'];return db[_0x3a58('0x54')][_0x3a58('0x47')](_0x4df7dc['body']);}})[_0x3a58('0x24')](respondWithResult(_0x2a1aad,null))[_0x3a58('0x46')](handleError(_0x2a1aad,null));};exports[_0x3a58('0x55')]=function(_0x40f100,_0xb70e7,_0x4a6159){var _0x385af0={};var _0x30db7e={};var _0x2d2fbf;var _0x2b7f5d;return db[_0x3a58('0x2d')][_0x3a58('0x56')]({'where':{'id':_0x40f100[_0x3a58('0x43')]['id']}})[_0x3a58('0x24')](handleEntityNotFound(_0xb70e7,null))[_0x3a58('0x24')](function(_0x122f9e){if(_0x122f9e){_0x2d2fbf=_0x122f9e;_0x30db7e['model']=_['keys'](db[_0x3a58('0x54')][_0x3a58('0x2e')]);_0x30db7e[_0x3a58('0x33')]=_[_0x3a58('0x34')](_0x40f100['query']);_0x30db7e[_0x3a58('0x3b')]=_[_0x3a58('0x35')](_0x30db7e['model'],_0x30db7e[_0x3a58('0x33')]);_0x385af0[_0x3a58('0x36')]=_[_0x3a58('0x35')](_0x30db7e[_0x3a58('0x32')],qs[_0x3a58('0x37')](_0x40f100[_0x3a58('0x33')][_0x3a58('0x37')]));_0x385af0[_0x3a58('0x36')]=_0x385af0[_0x3a58('0x36')][_0x3a58('0x57')]?_0x385af0[_0x3a58('0x36')]:_0x30db7e[_0x3a58('0x32')];_0x385af0[_0x3a58('0x39')]=qs['sort'](_0x40f100[_0x3a58('0x33')]['sort']);_0x385af0[_0x3a58('0x3a')]=qs[_0x3a58('0x3b')](_['pick'](_0x40f100[_0x3a58('0x33')],_0x30db7e['filters']));if(_0x40f100[_0x3a58('0x33')]['filter']){_0x385af0[_0x3a58('0x3a')]=_['merge'](_0x385af0[_0x3a58('0x3a')],{'$or':_[_0x3a58('0x2c')](_0x385af0[_0x3a58('0x36')],function(_0x567152){var _0x67446e={};_0x67446e[_0x567152]={'$like':'%'+_0x40f100[_0x3a58('0x33')][_0x3a58('0x3d')]+'%'};return _0x67446e;})});}_0x385af0=_['merge']({},_0x385af0,_0x40f100[_0x3a58('0x3f')]);return _0x2d2fbf[_0x3a58('0x55')](_0x385af0);}})['then'](function(_0x5500bf){if(_0x5500bf){_0x2b7f5d=_0x5500bf[_0x3a58('0x57')];if(!_0x40f100['query']['hasOwnProperty'](_0x3a58('0x38'))){_0x385af0[_0x3a58('0x1d')]=qs['limit'](_0x40f100[_0x3a58('0x33')][_0x3a58('0x1d')]);_0x385af0[_0x3a58('0x1a')]=qs[_0x3a58('0x1a')](_0x40f100[_0x3a58('0x33')][_0x3a58('0x1a')]);}return _0x2d2fbf[_0x3a58('0x55')](_0x385af0);}})['then'](function(_0x56b79e){if(_0x56b79e){return _0x56b79e?{'count':_0x2b7f5d,'rows':_0x56b79e}:null;}})['then'](respondWithResult(_0xb70e7,null))['catch'](handleError(_0xb70e7,null));};exports[_0x3a58('0x58')]=function(_0x31011d,_0x179a16,_0x34ca81){var _0x2f4c00={};var _0x2f98ca={};var _0x129314;var _0x3c3490;return db[_0x3a58('0x2d')][_0x3a58('0x56')]({'where':{'id':_0x31011d['params']['id']}})[_0x3a58('0x24')](handleEntityNotFound(_0x179a16,null))['then'](function(_0x13179c){if(_0x13179c){_0x129314=_0x13179c;_0x2f98ca[_0x3a58('0x32')]=_[_0x3a58('0x34')](db['Condition']['rawAttributes']);_0x2f98ca[_0x3a58('0x33')]=_[_0x3a58('0x34')](_0x31011d['query']);_0x2f98ca[_0x3a58('0x3b')]=_['intersection'](_0x2f98ca['model'],_0x2f98ca[_0x3a58('0x33')]);_0x2f4c00[_0x3a58('0x36')]=_['intersection'](_0x2f98ca[_0x3a58('0x32')],qs[_0x3a58('0x37')](_0x31011d[_0x3a58('0x33')][_0x3a58('0x37')]));_0x2f4c00['attributes']=_0x2f4c00[_0x3a58('0x36')][_0x3a58('0x57')]?_0x2f4c00[_0x3a58('0x36')]:_0x2f98ca[_0x3a58('0x32')];_0x2f4c00['order']=qs[_0x3a58('0x59')](_0x31011d[_0x3a58('0x33')][_0x3a58('0x59')]);_0x2f4c00[_0x3a58('0x3a')]=qs[_0x3a58('0x3b')](_[_0x3a58('0x3c')](_0x31011d['query'],_0x2f98ca[_0x3a58('0x3b')]));if(_0x31011d[_0x3a58('0x33')][_0x3a58('0x3d')]){_0x2f4c00['where']=_[_0x3a58('0x3e')](_0x2f4c00[_0x3a58('0x3a')],{'$or':_[_0x3a58('0x2c')](_0x2f4c00[_0x3a58('0x36')],function(_0x1ceb82){var _0x2ece79={};_0x2ece79[_0x1ceb82]={'$like':'%'+_0x31011d[_0x3a58('0x33')][_0x3a58('0x3d')]+'%'};return _0x2ece79;})});}_0x2f4c00=_[_0x3a58('0x3e')]({},_0x2f4c00,_0x31011d['options']);return _0x129314[_0x3a58('0x58')](_0x2f4c00);}})[_0x3a58('0x24')](function(_0x14f610){if(_0x14f610){_0x3c3490=_0x14f610[_0x3a58('0x57')];if(!_0x31011d['query'][_0x3a58('0x5a')]('nolimit')){_0x2f4c00[_0x3a58('0x1d')]=qs[_0x3a58('0x1d')](_0x31011d['query']['limit']);_0x2f4c00[_0x3a58('0x1a')]=qs[_0x3a58('0x1a')](_0x31011d[_0x3a58('0x33')][_0x3a58('0x1a')]);}return _0x129314[_0x3a58('0x58')](_0x2f4c00);}})[_0x3a58('0x24')](function(_0x34ad4b){if(_0x34ad4b){return _0x34ad4b?{'count':_0x3c3490,'rows':_0x34ad4b}:null;}})[_0x3a58('0x24')](respondWithResult(_0x179a16,null))[_0x3a58('0x46')](handleError(_0x179a16,null));};exports[_0x3a58('0x5b')]=function(_0x4788bf,_0x132a48,_0x4fd770){if(_0x4788bf[_0x3a58('0x48')]['id']){delete _0x4788bf['body']['id'];}return db[_0x3a58('0x2d')]['find']({'where':{'id':_0x4788bf[_0x3a58('0x43')]['id']}})[_0x3a58('0x24')](handleEntityNotFound(_0x132a48,null))['then'](function(_0x26dc40){if(_0x26dc40){_0x4788bf[_0x3a58('0x48')]['TriggerId']=_0x26dc40['id'];return db[_0x3a58('0x5c')][_0x3a58('0x47')](_0x4788bf[_0x3a58('0x48')]);}})[_0x3a58('0x24')](respondWithResult(_0x132a48,null))[_0x3a58('0x46')](handleError(_0x132a48,null));};exports['getActions']=function(_0x3c5417,_0x265e2b,_0x57ea40){var _0xa34e1d={};var _0x27a3ca={};var _0x310ce1;var _0xf48de0;return db['Trigger']['findOne']({'where':{'id':_0x3c5417['params']['id']}})[_0x3a58('0x24')](handleEntityNotFound(_0x265e2b,null))['then'](function(_0x384ed4){if(_0x384ed4){_0x310ce1=_0x384ed4;_0x27a3ca[_0x3a58('0x32')]=_[_0x3a58('0x34')](db[_0x3a58('0x5c')][_0x3a58('0x2e')]);_0x27a3ca['query']=_['keys'](_0x3c5417[_0x3a58('0x33')]);_0x27a3ca[_0x3a58('0x3b')]=_[_0x3a58('0x35')](_0x27a3ca['model'],_0x27a3ca[_0x3a58('0x33')]);_0xa34e1d[_0x3a58('0x36')]=_[_0x3a58('0x35')](_0x27a3ca[_0x3a58('0x32')],qs[_0x3a58('0x37')](_0x3c5417['query'][_0x3a58('0x37')]));_0xa34e1d['attributes']=_0xa34e1d[_0x3a58('0x36')]['length']?_0xa34e1d['attributes']:_0x27a3ca['model'];_0xa34e1d[_0x3a58('0x39')]=qs[_0x3a58('0x59')](_0x3c5417['query'][_0x3a58('0x59')]);_0xa34e1d['where']=qs['filters'](_[_0x3a58('0x3c')](_0x3c5417[_0x3a58('0x33')],_0x27a3ca[_0x3a58('0x3b')]));if(_0x3c5417['query'][_0x3a58('0x3d')]){_0xa34e1d['where']=_['merge'](_0xa34e1d[_0x3a58('0x3a')],{'$or':_[_0x3a58('0x2c')](_0xa34e1d[_0x3a58('0x36')],function(_0x27aa84){var _0x54e695={};_0x54e695[_0x27aa84]={'$like':'%'+_0x3c5417['query'][_0x3a58('0x3d')]+'%'};return _0x54e695;})});}_0xa34e1d=_['merge']({},_0xa34e1d,_0x3c5417[_0x3a58('0x3f')]);return _0x310ce1[_0x3a58('0x5d')](_0xa34e1d);}})['then'](function(_0x4ccc2b){if(_0x4ccc2b){_0xf48de0=_0x4ccc2b[_0x3a58('0x57')];if(!_0x3c5417[_0x3a58('0x33')]['hasOwnProperty'](_0x3a58('0x38'))){_0xa34e1d['limit']=qs[_0x3a58('0x1d')](_0x3c5417['query']['limit']);_0xa34e1d[_0x3a58('0x1a')]=qs['offset'](_0x3c5417[_0x3a58('0x33')][_0x3a58('0x1a')]);}return _0x310ce1[_0x3a58('0x5d')](_0xa34e1d);}})[_0x3a58('0x24')](function(_0x3bcac6){if(_0x3bcac6){return _0x3bcac6?{'count':_0xf48de0,'rows':_0x3bcac6}:null;}})[_0x3a58('0x24')](respondWithResult(_0x265e2b,null))['catch'](handleError(_0x265e2b,null));}; \ No newline at end of file +var _0xcb59=['squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','status','name','send','map','Trigger','rawAttributes','type','key','model','query','keys','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','show','params','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','options','hasOwnProperty','getAnyConditions','pick','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash'];(function(_0x4e64a4,_0x5f180e){var _0x5bab1f=function(_0x4f6bf1){while(--_0x4f6bf1){_0x4e64a4['push'](_0x4e64a4['shift']());}};_0x5bab1f(++_0x5f180e);}(_0xcb59,0x16f));var _0x9cb5=function(_0x5e1a9d,_0x5b6c20){_0x5e1a9d=_0x5e1a9d-0x0;var _0x4eb0d7=_0xcb59[_0x5e1a9d];return _0x4eb0d7;};'use strict';var emlformat=require(_0x9cb5('0x0'));var rimraf=require(_0x9cb5('0x1'));var zipdir=require(_0x9cb5('0x2'));var jsonpatch=require(_0x9cb5('0x3'));var rp=require(_0x9cb5('0x4'));var moment=require('moment');var BPromise=require(_0x9cb5('0x5'));var Mustache=require(_0x9cb5('0x6'));var util=require(_0x9cb5('0x7'));var path=require(_0x9cb5('0x8'));var sox=require(_0x9cb5('0x9'));var csv=require('to-csv');var ejs=require(_0x9cb5('0xa'));var fs=require('fs');var fs_extra=require(_0x9cb5('0xb'));var _=require(_0x9cb5('0xc'));var squel=require(_0x9cb5('0xd'));var crypto=require('crypto');var jsforce=require(_0x9cb5('0xe'));var deskjs=require(_0x9cb5('0xf'));var toCsv=require(_0x9cb5('0x10'));var querystring=require(_0x9cb5('0x11'));var Papa=require('papaparse');var Redis=require(_0x9cb5('0x12'));var authService=require(_0x9cb5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9cb5('0x14'));var hardwareService=require(_0x9cb5('0x15'));var logger=require(_0x9cb5('0x16'))('api');var utils=require(_0x9cb5('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42ffba,_0x4bd2b0){_0x4bd2b0=_0x4bd2b0||0xcc;return function(_0x5ac30a){if(_0x5ac30a){return _0x42ffba[_0x9cb5('0x18')](_0x4bd2b0);}return _0x42ffba['status'](_0x4bd2b0)[_0x9cb5('0x19')]();};}function respondWithResult(_0x4977b5,_0x19cdec){_0x19cdec=_0x19cdec||0xc8;return function(_0x2676ed){if(_0x2676ed){return _0x4977b5['status'](_0x19cdec)[_0x9cb5('0x1a')](_0x2676ed);}};}function respondWithFilteredResult(_0x573bed,_0x1bac8c){return function(_0x32f627){if(_0x32f627){var _0x3fed5f=typeof _0x1bac8c[_0x9cb5('0x1b')]===_0x9cb5('0x1c')&&typeof _0x1bac8c[_0x9cb5('0x1d')]==='undefined';var _0xc0d525=_0x32f627['count'];var _0x54a0fd=_0x3fed5f?0x0:_0x1bac8c[_0x9cb5('0x1b')];var _0x54891a=_0x3fed5f?_0x32f627[_0x9cb5('0x1e')]:_0x1bac8c[_0x9cb5('0x1b')]+_0x1bac8c[_0x9cb5('0x1d')];var _0x6c0ebd;if(_0x54891a>=_0xc0d525){_0x54891a=_0xc0d525;_0x6c0ebd=0xc8;}else{_0x6c0ebd=0xce;}_0x573bed['status'](_0x6c0ebd);return _0x573bed['set'](_0x9cb5('0x1f'),_0x54a0fd+'-'+_0x54891a+'/'+_0xc0d525)[_0x9cb5('0x1a')](_0x32f627);}return null;};}function patchUpdates(_0x36d870){return function(_0x295408){try{jsonpatch[_0x9cb5('0x20')](_0x295408,_0x36d870,!![]);}catch(_0x186ee3){return BPromise[_0x9cb5('0x21')](_0x186ee3);}return _0x295408[_0x9cb5('0x22')]();};}function saveUpdates(_0x248606,_0x1a11cb){return function(_0x4196b5){if(_0x4196b5){return _0x4196b5[_0x9cb5('0x23')](_0x248606)[_0x9cb5('0x24')](function(_0x1674dd){return _0x1674dd;});}return null;};}function removeEntity(_0xe27ae7,_0x2f2c45){return function(_0x27b277){if(_0x27b277){return _0x27b277[_0x9cb5('0x25')]()[_0x9cb5('0x24')](function(){var _0x52f09a=_0x27b277[_0x9cb5('0x26')]({'plain':!![]});var _0x1f8e26=_0x9cb5('0x27');return db['UserProfileResource'][_0x9cb5('0x25')]({'where':{'type':_0x1f8e26,'resourceId':_0x52f09a['id']}})[_0x9cb5('0x24')](function(){return _0x27b277;});})[_0x9cb5('0x24')](function(){_0xe27ae7[_0x9cb5('0x28')](0xcc)[_0x9cb5('0x19')]();});}};}function handleEntityNotFound(_0x4cfaab,_0x28f679){return function(_0x43edd6){if(!_0x43edd6){_0x4cfaab[_0x9cb5('0x18')](0x194);}return _0x43edd6;};}function handleError(_0x55eb30,_0x32d552){_0x32d552=_0x32d552||0x1f4;return function(_0x1408b7){logger['error'](_0x1408b7['stack']);if(_0x1408b7[_0x9cb5('0x29')]){delete _0x1408b7['name'];}_0x55eb30[_0x9cb5('0x28')](_0x32d552)[_0x9cb5('0x2a')](_0x1408b7);};}exports['index']=function(_0x59fc68,_0xef45c1){var _0x591316={},_0x59d38e={},_0x534f2a={'count':0x0,'rows':[]};var _0x33d8b6=_[_0x9cb5('0x2b')](db[_0x9cb5('0x2c')][_0x9cb5('0x2d')],function(_0x42f0ca){return{'name':_0x42f0ca['fieldName'],'type':_0x42f0ca[_0x9cb5('0x2e')][_0x9cb5('0x2f')]};});_0x59d38e[_0x9cb5('0x30')]=_[_0x9cb5('0x2b')](_0x33d8b6,_0x9cb5('0x29'));_0x59d38e[_0x9cb5('0x31')]=_[_0x9cb5('0x32')](_0x59fc68[_0x9cb5('0x31')]);_0x59d38e['filters']=_['intersection'](_0x59d38e[_0x9cb5('0x30')],_0x59d38e['query']);_0x591316['attributes']=_['intersection'](_0x59d38e[_0x9cb5('0x30')],qs[_0x9cb5('0x33')](_0x59fc68['query']['fields']));_0x591316[_0x9cb5('0x34')]=_0x591316[_0x9cb5('0x34')][_0x9cb5('0x35')]?_0x591316['attributes']:_0x59d38e[_0x9cb5('0x30')];if(!_0x59fc68[_0x9cb5('0x31')]['hasOwnProperty'](_0x9cb5('0x36'))){_0x591316[_0x9cb5('0x1d')]=qs[_0x9cb5('0x1d')](_0x59fc68[_0x9cb5('0x31')][_0x9cb5('0x1d')]);_0x591316[_0x9cb5('0x1b')]=qs[_0x9cb5('0x1b')](_0x59fc68[_0x9cb5('0x31')]['offset']);}_0x591316[_0x9cb5('0x37')]=qs[_0x9cb5('0x38')](_0x59fc68[_0x9cb5('0x31')][_0x9cb5('0x38')]);_0x591316[_0x9cb5('0x39')]=qs[_0x9cb5('0x3a')](_['pick'](_0x59fc68[_0x9cb5('0x31')],_0x59d38e['filters']),_0x33d8b6);if(_0x59fc68[_0x9cb5('0x31')][_0x9cb5('0x3b')]){_0x591316['where']=_[_0x9cb5('0x3c')](_0x591316['where'],{'$or':_[_0x9cb5('0x2b')](_0x33d8b6,function(_0x289fa9){if(_0x289fa9['type']!=='VIRTUAL'){var _0x13c96d={};_0x13c96d[_0x289fa9['name']]={'$like':'%'+_0x59fc68[_0x9cb5('0x31')]['filter']+'%'};return _0x13c96d;}})});}_0x591316=_['merge']({},_0x591316,_0x59fc68['options']);var _0x104263={'where':_0x591316[_0x9cb5('0x39')]};return db[_0x9cb5('0x2c')]['count'](_0x104263)[_0x9cb5('0x24')](function(_0x37b28c){_0x534f2a[_0x9cb5('0x1e')]=_0x37b28c;if(_0x59fc68[_0x9cb5('0x31')][_0x9cb5('0x3d')]){_0x591316[_0x9cb5('0x3e')]=[{'all':!![]}];}return db['Trigger'][_0x9cb5('0x3f')](_0x591316);})[_0x9cb5('0x24')](function(_0x130ee5){_0x534f2a[_0x9cb5('0x40')]=_0x130ee5;return _0x534f2a;})['then'](respondWithFilteredResult(_0xef45c1,_0x591316))[_0x9cb5('0x41')](handleError(_0xef45c1,null));};exports[_0x9cb5('0x42')]=function(_0x31eeee,_0x1f224f){var _0x58ac6a={'raw':![],'where':{'id':_0x31eeee[_0x9cb5('0x43')]['id']}},_0x2c237f={};_0x2c237f[_0x9cb5('0x30')]=_['keys'](db[_0x9cb5('0x2c')][_0x9cb5('0x2d')]);_0x2c237f['query']=_[_0x9cb5('0x32')](_0x31eeee[_0x9cb5('0x31')]);_0x2c237f['filters']=_[_0x9cb5('0x44')](_0x2c237f[_0x9cb5('0x30')],_0x2c237f[_0x9cb5('0x31')]);_0x58ac6a[_0x9cb5('0x34')]=_['intersection'](_0x2c237f[_0x9cb5('0x30')],qs[_0x9cb5('0x33')](_0x31eeee['query'][_0x9cb5('0x33')]));_0x58ac6a[_0x9cb5('0x34')]=_0x58ac6a['attributes'][_0x9cb5('0x35')]?_0x58ac6a['attributes']:_0x2c237f[_0x9cb5('0x30')];if(_0x31eeee[_0x9cb5('0x31')][_0x9cb5('0x3d')]){_0x58ac6a['include']=[{'all':!![]}];}_0x58ac6a=_[_0x9cb5('0x3c')]({},_0x58ac6a,_0x31eeee['options']);return db['Trigger']['find'](_0x58ac6a)[_0x9cb5('0x24')](handleEntityNotFound(_0x1f224f,null))[_0x9cb5('0x24')](respondWithResult(_0x1f224f,null))['catch'](handleError(_0x1f224f,null));};exports[_0x9cb5('0x45')]=function(_0x11de8d,_0x44a7b9){return db[_0x9cb5('0x2c')][_0x9cb5('0x45')](_0x11de8d[_0x9cb5('0x46')],{})[_0x9cb5('0x24')](function(_0x2f7ebf){var _0x5cb2e2=_0x11de8d[_0x9cb5('0x47')][_0x9cb5('0x26')]({'plain':!![]});if(!_0x5cb2e2)throw new Error(_0x9cb5('0x48'));if(_0x5cb2e2[_0x9cb5('0x49')]===_0x9cb5('0x47')){var _0x324d06=_0x2f7ebf['get']({'plain':!![]});var _0x1fad63=_0x9cb5('0x27');return db[_0x9cb5('0x4a')][_0x9cb5('0x4b')]({'where':{'name':_0x1fad63,'userProfileId':_0x5cb2e2[_0x9cb5('0x4c')]},'raw':!![]})[_0x9cb5('0x24')](function(_0x4f8988){if(_0x4f8988&&_0x4f8988[_0x9cb5('0x4d')]===0x0){return db[_0x9cb5('0x4e')][_0x9cb5('0x45')]({'name':_0x324d06[_0x9cb5('0x29')],'resourceId':_0x324d06['id'],'type':_0x4f8988[_0x9cb5('0x29')],'sectionId':_0x4f8988['id']},{})['then'](function(){return _0x2f7ebf;});}else{return _0x2f7ebf;}})[_0x9cb5('0x41')](function(_0xa41ad3){logger[_0x9cb5('0x4f')](_0x9cb5('0x50'),_0xa41ad3);throw _0xa41ad3;});}return _0x2f7ebf;})['then'](respondWithResult(_0x44a7b9,0xc9))['catch'](handleError(_0x44a7b9,null));};exports['update']=function(_0xe634cd,_0x475a70){if(_0xe634cd[_0x9cb5('0x46')]['id']){delete _0xe634cd['body']['id'];}return db['Trigger'][_0x9cb5('0x4b')]({'where':{'id':_0xe634cd[_0x9cb5('0x43')]['id']}})[_0x9cb5('0x24')](handleEntityNotFound(_0x475a70,null))['then'](saveUpdates(_0xe634cd[_0x9cb5('0x46')],null))[_0x9cb5('0x24')](respondWithResult(_0x475a70,null))[_0x9cb5('0x41')](handleError(_0x475a70,null));};exports[_0x9cb5('0x25')]=function(_0x15eba4,_0x44df60){return db[_0x9cb5('0x2c')][_0x9cb5('0x4b')]({'where':{'id':_0x15eba4[_0x9cb5('0x43')]['id']}})[_0x9cb5('0x24')](handleEntityNotFound(_0x44df60,null))[_0x9cb5('0x24')](removeEntity(_0x44df60,null))[_0x9cb5('0x41')](handleError(_0x44df60,null));};exports[_0x9cb5('0x51')]=function(_0x4c6710,_0xbd2d75,_0x30d21a){if(_0x4c6710[_0x9cb5('0x46')]['id']){delete _0x4c6710['body']['id'];}return db[_0x9cb5('0x2c')][_0x9cb5('0x4b')]({'where':{'id':_0x4c6710[_0x9cb5('0x43')]['id']}})['then'](handleEntityNotFound(_0xbd2d75,null))[_0x9cb5('0x24')](function(_0x259102){if(_0x259102){_0x4c6710[_0x9cb5('0x46')][_0x9cb5('0x52')]=_0x259102['id'];return db[_0x9cb5('0x53')][_0x9cb5('0x45')](_0x4c6710[_0x9cb5('0x46')]);}})[_0x9cb5('0x24')](respondWithResult(_0xbd2d75,null))[_0x9cb5('0x41')](handleError(_0xbd2d75,null));};exports[_0x9cb5('0x54')]=function(_0x5462f6,_0x3a85d4,_0x3dc2b1){if(_0x5462f6['body']['id']){delete _0x5462f6[_0x9cb5('0x46')]['id'];}return db['Trigger'][_0x9cb5('0x4b')]({'where':{'id':_0x5462f6[_0x9cb5('0x43')]['id']}})[_0x9cb5('0x24')](handleEntityNotFound(_0x3a85d4,null))[_0x9cb5('0x24')](function(_0x47a2a3){if(_0x47a2a3){_0x5462f6[_0x9cb5('0x46')]['TriggerAnyId']=_0x47a2a3['id'];return db['Condition'][_0x9cb5('0x45')](_0x5462f6[_0x9cb5('0x46')]);}})[_0x9cb5('0x24')](respondWithResult(_0x3a85d4,null))['catch'](handleError(_0x3a85d4,null));};exports[_0x9cb5('0x55')]=function(_0x596f11,_0x46162d,_0x3ca4f5){var _0x1e8699={};var _0x18cddf={};var _0x118cc2;var _0x5627d3;return db[_0x9cb5('0x2c')][_0x9cb5('0x56')]({'where':{'id':_0x596f11[_0x9cb5('0x43')]['id']}})[_0x9cb5('0x24')](handleEntityNotFound(_0x46162d,null))[_0x9cb5('0x24')](function(_0x3e8eaf){if(_0x3e8eaf){_0x118cc2=_0x3e8eaf;_0x18cddf['model']=_[_0x9cb5('0x32')](db['Condition'][_0x9cb5('0x2d')]);_0x18cddf[_0x9cb5('0x31')]=_['keys'](_0x596f11[_0x9cb5('0x31')]);_0x18cddf[_0x9cb5('0x3a')]=_[_0x9cb5('0x44')](_0x18cddf[_0x9cb5('0x30')],_0x18cddf[_0x9cb5('0x31')]);_0x1e8699[_0x9cb5('0x34')]=_['intersection'](_0x18cddf[_0x9cb5('0x30')],qs[_0x9cb5('0x33')](_0x596f11[_0x9cb5('0x31')]['fields']));_0x1e8699[_0x9cb5('0x34')]=_0x1e8699['attributes'][_0x9cb5('0x35')]?_0x1e8699[_0x9cb5('0x34')]:_0x18cddf[_0x9cb5('0x30')];_0x1e8699[_0x9cb5('0x37')]=qs[_0x9cb5('0x38')](_0x596f11[_0x9cb5('0x31')][_0x9cb5('0x38')]);_0x1e8699['where']=qs[_0x9cb5('0x3a')](_['pick'](_0x596f11[_0x9cb5('0x31')],_0x18cddf['filters']));if(_0x596f11['query'][_0x9cb5('0x3b')]){_0x1e8699[_0x9cb5('0x39')]=_[_0x9cb5('0x3c')](_0x1e8699[_0x9cb5('0x39')],{'$or':_[_0x9cb5('0x2b')](_0x1e8699[_0x9cb5('0x34')],function(_0x538743){var _0x160575={};_0x160575[_0x538743]={'$like':'%'+_0x596f11['query'][_0x9cb5('0x3b')]+'%'};return _0x160575;})});}_0x1e8699=_[_0x9cb5('0x3c')]({},_0x1e8699,_0x596f11[_0x9cb5('0x57')]);return _0x118cc2[_0x9cb5('0x55')](_0x1e8699);}})[_0x9cb5('0x24')](function(_0x4f43d3){if(_0x4f43d3){_0x5627d3=_0x4f43d3[_0x9cb5('0x35')];if(!_0x596f11['query'][_0x9cb5('0x58')](_0x9cb5('0x36'))){_0x1e8699[_0x9cb5('0x1d')]=qs['limit'](_0x596f11[_0x9cb5('0x31')][_0x9cb5('0x1d')]);_0x1e8699[_0x9cb5('0x1b')]=qs['offset'](_0x596f11[_0x9cb5('0x31')][_0x9cb5('0x1b')]);}return _0x118cc2['getAllConditions'](_0x1e8699);}})[_0x9cb5('0x24')](function(_0x128b98){if(_0x128b98){return _0x128b98?{'count':_0x5627d3,'rows':_0x128b98}:null;}})[_0x9cb5('0x24')](respondWithResult(_0x46162d,null))[_0x9cb5('0x41')](handleError(_0x46162d,null));};exports[_0x9cb5('0x59')]=function(_0x93640d,_0x5b0dfc,_0x8248d3){var _0x140910={};var _0x424775={};var _0xf58d24;var _0x2fe7e3;return db[_0x9cb5('0x2c')]['findOne']({'where':{'id':_0x93640d[_0x9cb5('0x43')]['id']}})[_0x9cb5('0x24')](handleEntityNotFound(_0x5b0dfc,null))['then'](function(_0x5cf595){if(_0x5cf595){_0xf58d24=_0x5cf595;_0x424775[_0x9cb5('0x30')]=_[_0x9cb5('0x32')](db[_0x9cb5('0x53')][_0x9cb5('0x2d')]);_0x424775[_0x9cb5('0x31')]=_[_0x9cb5('0x32')](_0x93640d[_0x9cb5('0x31')]);_0x424775['filters']=_[_0x9cb5('0x44')](_0x424775['model'],_0x424775[_0x9cb5('0x31')]);_0x140910[_0x9cb5('0x34')]=_[_0x9cb5('0x44')](_0x424775[_0x9cb5('0x30')],qs[_0x9cb5('0x33')](_0x93640d[_0x9cb5('0x31')][_0x9cb5('0x33')]));_0x140910['attributes']=_0x140910['attributes'][_0x9cb5('0x35')]?_0x140910[_0x9cb5('0x34')]:_0x424775[_0x9cb5('0x30')];_0x140910[_0x9cb5('0x37')]=qs[_0x9cb5('0x38')](_0x93640d[_0x9cb5('0x31')][_0x9cb5('0x38')]);_0x140910[_0x9cb5('0x39')]=qs[_0x9cb5('0x3a')](_[_0x9cb5('0x5a')](_0x93640d['query'],_0x424775[_0x9cb5('0x3a')]));if(_0x93640d[_0x9cb5('0x31')][_0x9cb5('0x3b')]){_0x140910[_0x9cb5('0x39')]=_[_0x9cb5('0x3c')](_0x140910[_0x9cb5('0x39')],{'$or':_[_0x9cb5('0x2b')](_0x140910['attributes'],function(_0x5cda75){var _0x28cf03={};_0x28cf03[_0x5cda75]={'$like':'%'+_0x93640d[_0x9cb5('0x31')]['filter']+'%'};return _0x28cf03;})});}_0x140910=_[_0x9cb5('0x3c')]({},_0x140910,_0x93640d[_0x9cb5('0x57')]);return _0xf58d24[_0x9cb5('0x59')](_0x140910);}})['then'](function(_0xcc8339){if(_0xcc8339){_0x2fe7e3=_0xcc8339[_0x9cb5('0x35')];if(!_0x93640d[_0x9cb5('0x31')][_0x9cb5('0x58')](_0x9cb5('0x36'))){_0x140910[_0x9cb5('0x1d')]=qs['limit'](_0x93640d[_0x9cb5('0x31')][_0x9cb5('0x1d')]);_0x140910['offset']=qs[_0x9cb5('0x1b')](_0x93640d[_0x9cb5('0x31')][_0x9cb5('0x1b')]);}return _0xf58d24[_0x9cb5('0x59')](_0x140910);}})[_0x9cb5('0x24')](function(_0x30425f){if(_0x30425f){return _0x30425f?{'count':_0x2fe7e3,'rows':_0x30425f}:null;}})[_0x9cb5('0x24')](respondWithResult(_0x5b0dfc,null))[_0x9cb5('0x41')](handleError(_0x5b0dfc,null));};exports[_0x9cb5('0x5b')]=function(_0x363692,_0x39f7ab,_0x139707){if(_0x363692[_0x9cb5('0x46')]['id']){delete _0x363692[_0x9cb5('0x46')]['id'];}return db[_0x9cb5('0x2c')][_0x9cb5('0x4b')]({'where':{'id':_0x363692[_0x9cb5('0x43')]['id']}})['then'](handleEntityNotFound(_0x39f7ab,null))[_0x9cb5('0x24')](function(_0x57d1f0){if(_0x57d1f0){_0x363692['body'][_0x9cb5('0x5c')]=_0x57d1f0['id'];return db[_0x9cb5('0x5d')][_0x9cb5('0x45')](_0x363692['body']);}})[_0x9cb5('0x24')](respondWithResult(_0x39f7ab,null))['catch'](handleError(_0x39f7ab,null));};exports[_0x9cb5('0x5e')]=function(_0x622526,_0x5cc830,_0x411464){var _0x3cd4c8={};var _0x29e263={};var _0xfe8da7;var _0x4bcdc2;return db[_0x9cb5('0x2c')][_0x9cb5('0x56')]({'where':{'id':_0x622526[_0x9cb5('0x43')]['id']}})['then'](handleEntityNotFound(_0x5cc830,null))['then'](function(_0x42ed8e){if(_0x42ed8e){_0xfe8da7=_0x42ed8e;_0x29e263[_0x9cb5('0x30')]=_[_0x9cb5('0x32')](db['Action'][_0x9cb5('0x2d')]);_0x29e263[_0x9cb5('0x31')]=_[_0x9cb5('0x32')](_0x622526[_0x9cb5('0x31')]);_0x29e263[_0x9cb5('0x3a')]=_['intersection'](_0x29e263[_0x9cb5('0x30')],_0x29e263[_0x9cb5('0x31')]);_0x3cd4c8[_0x9cb5('0x34')]=_[_0x9cb5('0x44')](_0x29e263[_0x9cb5('0x30')],qs['fields'](_0x622526[_0x9cb5('0x31')][_0x9cb5('0x33')]));_0x3cd4c8[_0x9cb5('0x34')]=_0x3cd4c8['attributes']['length']?_0x3cd4c8['attributes']:_0x29e263[_0x9cb5('0x30')];_0x3cd4c8['order']=qs[_0x9cb5('0x38')](_0x622526[_0x9cb5('0x31')][_0x9cb5('0x38')]);_0x3cd4c8[_0x9cb5('0x39')]=qs[_0x9cb5('0x3a')](_[_0x9cb5('0x5a')](_0x622526[_0x9cb5('0x31')],_0x29e263[_0x9cb5('0x3a')]));if(_0x622526[_0x9cb5('0x31')]['filter']){_0x3cd4c8[_0x9cb5('0x39')]=_['merge'](_0x3cd4c8[_0x9cb5('0x39')],{'$or':_['map'](_0x3cd4c8[_0x9cb5('0x34')],function(_0x56eb00){var _0x335d81={};_0x335d81[_0x56eb00]={'$like':'%'+_0x622526[_0x9cb5('0x31')]['filter']+'%'};return _0x335d81;})});}_0x3cd4c8=_[_0x9cb5('0x3c')]({},_0x3cd4c8,_0x622526['options']);return _0xfe8da7[_0x9cb5('0x5e')](_0x3cd4c8);}})[_0x9cb5('0x24')](function(_0x3fe49c){if(_0x3fe49c){_0x4bcdc2=_0x3fe49c[_0x9cb5('0x35')];if(!_0x622526['query']['hasOwnProperty'](_0x9cb5('0x36'))){_0x3cd4c8[_0x9cb5('0x1d')]=qs[_0x9cb5('0x1d')](_0x622526[_0x9cb5('0x31')][_0x9cb5('0x1d')]);_0x3cd4c8['offset']=qs['offset'](_0x622526[_0x9cb5('0x31')][_0x9cb5('0x1b')]);}return _0xfe8da7['getActions'](_0x3cd4c8);}})[_0x9cb5('0x24')](function(_0x58a821){if(_0x58a821){return _0x58a821?{'count':_0x4bcdc2,'rows':_0x58a821}:null;}})[_0x9cb5('0x24')](respondWithResult(_0x5cc830,null))['catch'](handleError(_0x5cc830,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 82d57e0..882b62e 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 _0x6597=['../../config/logger','moment','request-promise','./trigger.attributes','exports','define','lodash','util'];(function(_0x27f116,_0x14373c){var _0x364b62=function(_0x41019b){while(--_0x41019b){_0x27f116['push'](_0x27f116['shift']());}};_0x364b62(++_0x14373c);}(_0x6597,0x16e));var _0x7659=function(_0x2cdf7a,_0x409301){_0x2cdf7a=_0x2cdf7a-0x0;var _0x589d82=_0x6597[_0x2cdf7a];return _0x589d82;};'use strict';var _=require(_0x7659('0x0'));var util=require(_0x7659('0x1'));var logger=require(_0x7659('0x2'))('api');var moment=require(_0x7659('0x3'));var BPromise=require('bluebird');var rp=require(_0x7659('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7659('0x5'));module[_0x7659('0x6')]=function(_0x4e09cc,_0xb90fa2){return _0x4e09cc[_0x7659('0x7')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b7f=['./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b55ef,_0x1fd0d8){var _0x4821da=function(_0x4bf0ba){while(--_0x4bf0ba){_0x2b55ef['push'](_0x2b55ef['shift']());}};_0x4821da(++_0x1fd0d8);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x13e676,_0x28ee15){_0x13e676=_0x13e676-0x0;var _0x4dcc4d=_0x5b7f[_0x13e676];return _0x4dcc4d;};'use strict';var _=require(_0xf5b7('0x0'));var util=require(_0xf5b7('0x1'));var logger=require(_0xf5b7('0x2'))(_0xf5b7('0x3'));var moment=require(_0xf5b7('0x4'));var BPromise=require(_0xf5b7('0x5'));var rp=require(_0xf5b7('0x6'));var fs=require('fs');var path=require(_0xf5b7('0x7'));var rimraf=require(_0xf5b7('0x8'));var config=require(_0xf5b7('0x9'));var attributes=require(_0xf5b7('0xa'));module[_0xf5b7('0xb')]=function(_0x1e67ac,_0x984337){return _0x1e67ac[_0xf5b7('0xc')](_0xf5b7('0xd'),attributes,{'tableName':_0xf5b7('0xe'),'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 3dfcee3..e6743ff 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 _0x07ce=['error','code','message','GetTrigger','Trigger','findAll','options','where','attributes','include','model','map','then','stringify','ShowTrigger','find','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x07ce,0x1ce));var _0xe07c=function(_0x38d222,_0xd54083){_0x38d222=_0x38d222-0x0;var _0x50ff23=_0x07ce[_0x38d222];return _0x50ff23;};'use strict';var _=require('lodash');var util=require(_0xe07c('0x0'));var moment=require(_0xe07c('0x1'));var BPromise=require(_0xe07c('0x2'));var rs=require(_0xe07c('0x3'));var fs=require('fs');var Redis=require(_0xe07c('0x4'));var db=require(_0xe07c('0x5'))['db'];var utils=require(_0xe07c('0x6'));var logger=require(_0xe07c('0x7'))(_0xe07c('0x8'));var config=require(_0xe07c('0x9'));var jayson=require(_0xe07c('0xa'));var client=jayson[_0xe07c('0xb')][_0xe07c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40d606,_0x5773f0,_0x62f7b4){return new BPromise(function(_0x45f446,_0xb6dd0e){return client[_0xe07c('0xd')](_0x40d606,_0x62f7b4)['then'](function(_0x374b9e){logger[_0xe07c('0xe')](_0xe07c('0xf'),_0x5773f0,_0xe07c('0x10'));logger[_0xe07c('0x11')](_0xe07c('0x12'),_0x5773f0,_0xe07c('0x10'),JSON['stringify'](_0x374b9e));if(_0x374b9e[_0xe07c('0x13')]){if(_0x374b9e[_0xe07c('0x13')][_0xe07c('0x14')]===0x1f4){logger[_0xe07c('0x13')](_0xe07c('0xf'),_0x5773f0,_0x374b9e[_0xe07c('0x13')][_0xe07c('0x15')]);return _0xb6dd0e(_0x374b9e[_0xe07c('0x13')]['message']);}logger[_0xe07c('0x13')](_0xe07c('0xf'),_0x5773f0,_0x374b9e[_0xe07c('0x13')]['message']);return _0x45f446(_0x374b9e[_0xe07c('0x13')][_0xe07c('0x15')]);}else{logger[_0xe07c('0xe')](_0xe07c('0xf'),_0x5773f0,_0xe07c('0x10'));_0x45f446(_0x374b9e['result'][_0xe07c('0x15')]);}})['catch'](function(_0x586e4e){logger[_0xe07c('0x13')](_0xe07c('0xf'),_0x5773f0,_0x586e4e);_0xb6dd0e(_0x586e4e);});});}exports[_0xe07c('0x16')]=function(_0x43428d){var _0x276941=this;return new Promise(function(_0x2f67f8,_0x9a547b){return db[_0xe07c('0x17')][_0xe07c('0x18')]({'raw':_0x43428d[_0xe07c('0x19')]?_0x43428d[_0xe07c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x43428d[_0xe07c('0x19')]?_0x43428d['options'][_0xe07c('0x1a')]||null:null,'attributes':_0x43428d[_0xe07c('0x19')]?_0x43428d['options'][_0xe07c('0x1b')]||null:null,'limit':_0x43428d[_0xe07c('0x19')]?_0x43428d['options']['limit']||null:null,'include':_0x43428d[_0xe07c('0x19')]?_0x43428d[_0xe07c('0x19')][_0xe07c('0x1c')]?_['map'](_0x43428d[_0xe07c('0x19')][_0xe07c('0x1c')],function(_0x3f7422){return{'model':db[_0x3f7422[_0xe07c('0x1d')]],'as':_0x3f7422['as'],'attributes':_0x3f7422[_0xe07c('0x1b')],'include':_0x3f7422[_0xe07c('0x1c')]?_['map'](_0x3f7422[_0xe07c('0x1c')],function(_0x22baa1){return{'model':db[_0x22baa1[_0xe07c('0x1d')]],'as':_0x22baa1['as'],'attributes':_0x22baa1[_0xe07c('0x1b')],'include':_0x22baa1['include']?_[_0xe07c('0x1e')](_0x22baa1[_0xe07c('0x1c')],function(_0x4881d5){return{'model':db[_0x4881d5[_0xe07c('0x1d')]],'as':_0x4881d5['as'],'attributes':_0x4881d5[_0xe07c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe07c('0x1f')](function(_0x5ebad6){logger['info'](_0xe07c('0x16'),_0x43428d);logger[_0xe07c('0x11')](_0xe07c('0x16'),_0x43428d,JSON[_0xe07c('0x20')](_0x5ebad6));_0x2f67f8(_0x5ebad6);})['catch'](function(_0x48eb54){logger[_0xe07c('0x13')](_0xe07c('0x16'),_0x48eb54[_0xe07c('0x15')],_0x43428d);_0x9a547b(_0x276941[_0xe07c('0x13')](0x1f4,_0x48eb54['message']));});});};exports[_0xe07c('0x21')]=function(_0x18206b){var _0x40d9b0=this;return new Promise(function(_0x4ec0ef,_0x18425a){return db[_0xe07c('0x17')][_0xe07c('0x22')]({'raw':_0x18206b[_0xe07c('0x19')]?_0x18206b[_0xe07c('0x19')][_0xe07c('0x23')]===undefined?!![]:![]:!![],'where':_0x18206b['options']?_0x18206b[_0xe07c('0x19')][_0xe07c('0x1a')]||null:null,'attributes':_0x18206b[_0xe07c('0x19')]?_0x18206b[_0xe07c('0x19')]['attributes']||null:null,'include':_0x18206b[_0xe07c('0x19')]?_0x18206b[_0xe07c('0x19')][_0xe07c('0x1c')]?_['map'](_0x18206b[_0xe07c('0x19')][_0xe07c('0x1c')],function(_0x319aa3){return{'model':db[_0x319aa3['model']],'as':_0x319aa3['as'],'attributes':_0x319aa3[_0xe07c('0x1b')],'include':_0x319aa3['include']?_[_0xe07c('0x1e')](_0x319aa3[_0xe07c('0x1c')],function(_0x50168e){return{'model':db[_0x50168e[_0xe07c('0x1d')]],'as':_0x50168e['as'],'attributes':_0x50168e[_0xe07c('0x1b')],'include':_0x50168e[_0xe07c('0x1c')]?_[_0xe07c('0x1e')](_0x50168e['include'],function(_0x5b8b8d){return{'model':db[_0x5b8b8d[_0xe07c('0x1d')]],'as':_0x5b8b8d['as'],'attributes':_0x5b8b8d[_0xe07c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe07c('0x1f')](function(_0x4cd5ad){logger[_0xe07c('0xe')](_0xe07c('0x21'),_0x18206b);logger['debug'](_0xe07c('0x21'),_0x18206b,JSON[_0xe07c('0x20')](_0x4cd5ad));_0x4ec0ef(_0x4cd5ad);})[_0xe07c('0x24')](function(_0xd0582c){logger[_0xe07c('0x13')]('ShowTrigger',_0xd0582c[_0xe07c('0x15')],_0x18206b);_0x18425a(_0x40d9b0[_0xe07c('0x13')](0x1f4,_0xd0582c[_0xe07c('0x15')]));});});}; \ No newline at end of file +var _0x3565=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Trigger,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','Trigger','findAll','options','attributes','limit','include','map','model','then','GetTrigger','catch','ShowTrigger','find','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5f484b,_0xce88d3){var _0x2e6864=function(_0x37aecd){while(--_0x37aecd){_0x5f484b['push'](_0x5f484b['shift']());}};_0x2e6864(++_0xce88d3);}(_0x3565,0x17b));var _0x5356=function(_0x442187,_0x5bcb33){_0x442187=_0x442187-0x0;var _0x2874a3=_0x3565[_0x442187];return _0x2874a3;};'use strict';var _=require('lodash');var util=require(_0x5356('0x0'));var moment=require(_0x5356('0x1'));var BPromise=require(_0x5356('0x2'));var rs=require(_0x5356('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5356('0x4'))['db'];var utils=require(_0x5356('0x5'));var logger=require(_0x5356('0x6'))(_0x5356('0x7'));var config=require(_0x5356('0x8'));var jayson=require(_0x5356('0x9'));var client=jayson[_0x5356('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e5996,_0x36051b,_0x5d1e30){return new BPromise(function(_0x5e0016,_0x6928f9){return client[_0x5356('0xb')](_0x5e5996,_0x5d1e30)['then'](function(_0x109207){logger[_0x5356('0xc')](_0x5356('0xd'),_0x36051b,'request\x20sent');logger[_0x5356('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x36051b,'request\x20sent',JSON[_0x5356('0xf')](_0x109207));if(_0x109207[_0x5356('0x10')]){if(_0x109207[_0x5356('0x10')][_0x5356('0x11')]===0x1f4){logger[_0x5356('0x10')](_0x5356('0xd'),_0x36051b,_0x109207[_0x5356('0x10')][_0x5356('0x12')]);return _0x6928f9(_0x109207[_0x5356('0x10')][_0x5356('0x12')]);}logger[_0x5356('0x10')](_0x5356('0xd'),_0x36051b,_0x109207[_0x5356('0x10')][_0x5356('0x12')]);return _0x5e0016(_0x109207[_0x5356('0x10')][_0x5356('0x12')]);}else{logger[_0x5356('0xc')](_0x5356('0xd'),_0x36051b,_0x5356('0x13'));_0x5e0016(_0x109207[_0x5356('0x14')]['message']);}})['catch'](function(_0x3620a0){logger[_0x5356('0x10')](_0x5356('0xd'),_0x36051b,_0x3620a0);_0x6928f9(_0x3620a0);});});}exports['GetTrigger']=function(_0x5e102e){var _0x37189b=this;return new Promise(function(_0x4fb341,_0xf9621b){return db[_0x5356('0x15')][_0x5356('0x16')]({'raw':_0x5e102e['options']?_0x5e102e[_0x5356('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5e102e['options']?_0x5e102e['options']['where']||null:null,'attributes':_0x5e102e[_0x5356('0x17')]?_0x5e102e[_0x5356('0x17')][_0x5356('0x18')]||null:null,'limit':_0x5e102e[_0x5356('0x17')]?_0x5e102e[_0x5356('0x17')][_0x5356('0x19')]||null:null,'include':_0x5e102e[_0x5356('0x17')]?_0x5e102e[_0x5356('0x17')][_0x5356('0x1a')]?_['map'](_0x5e102e[_0x5356('0x17')][_0x5356('0x1a')],function(_0x3112ac){return{'model':db[_0x3112ac['model']],'as':_0x3112ac['as'],'attributes':_0x3112ac[_0x5356('0x18')],'include':_0x3112ac[_0x5356('0x1a')]?_[_0x5356('0x1b')](_0x3112ac[_0x5356('0x1a')],function(_0x5346cd){return{'model':db[_0x5346cd['model']],'as':_0x5346cd['as'],'attributes':_0x5346cd[_0x5356('0x18')],'include':_0x5346cd[_0x5356('0x1a')]?_[_0x5356('0x1b')](_0x5346cd[_0x5356('0x1a')],function(_0x38dc8a){return{'model':db[_0x38dc8a[_0x5356('0x1c')]],'as':_0x38dc8a['as'],'attributes':_0x38dc8a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5356('0x1d')](function(_0x44dadd){logger['info']('GetTrigger',_0x5e102e);logger['debug'](_0x5356('0x1e'),_0x5e102e,JSON[_0x5356('0xf')](_0x44dadd));_0x4fb341(_0x44dadd);})[_0x5356('0x1f')](function(_0x400c8f){logger[_0x5356('0x10')](_0x5356('0x1e'),_0x400c8f[_0x5356('0x12')],_0x5e102e);_0xf9621b(_0x37189b[_0x5356('0x10')](0x1f4,_0x400c8f[_0x5356('0x12')]));});});};exports[_0x5356('0x20')]=function(_0x1ab1a3){var _0x25231d=this;return new Promise(function(_0x5c946c,_0xc07a50){return db['Trigger'][_0x5356('0x21')]({'raw':_0x1ab1a3[_0x5356('0x17')]?_0x1ab1a3['options'][_0x5356('0x22')]===undefined?!![]:![]:!![],'where':_0x1ab1a3[_0x5356('0x17')]?_0x1ab1a3[_0x5356('0x17')]['where']||null:null,'attributes':_0x1ab1a3[_0x5356('0x17')]?_0x1ab1a3[_0x5356('0x17')][_0x5356('0x18')]||null:null,'include':_0x1ab1a3[_0x5356('0x17')]?_0x1ab1a3[_0x5356('0x17')][_0x5356('0x1a')]?_[_0x5356('0x1b')](_0x1ab1a3['options'][_0x5356('0x1a')],function(_0x4fff14){return{'model':db[_0x4fff14[_0x5356('0x1c')]],'as':_0x4fff14['as'],'attributes':_0x4fff14[_0x5356('0x18')],'include':_0x4fff14[_0x5356('0x1a')]?_[_0x5356('0x1b')](_0x4fff14['include'],function(_0x1929a5){return{'model':db[_0x1929a5[_0x5356('0x1c')]],'as':_0x1929a5['as'],'attributes':_0x1929a5[_0x5356('0x18')],'include':_0x1929a5['include']?_[_0x5356('0x1b')](_0x1929a5[_0x5356('0x1a')],function(_0x1cb960){return{'model':db[_0x1cb960['model']],'as':_0x1cb960['as'],'attributes':_0x1cb960['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x45c730){logger['info'](_0x5356('0x20'),_0x1ab1a3);logger['debug'](_0x5356('0x20'),_0x1ab1a3,JSON[_0x5356('0xf')](_0x45c730));_0x5c946c(_0x45c730);})[_0x5356('0x1f')](function(_0x5973f3){logger[_0x5356('0x10')]('ShowTrigger',_0x5973f3[_0x5356('0x12')],_0x1ab1a3);_0xc07a50(_0x25231d['error'](0x1f4,_0x5973f3[_0x5356('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 33d0c77..6f5c5c8 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 _0x2aed=['update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','post','/:id/clone','clone','put'];(function(_0x4d093a,_0x15d59c){var _0x5d7227=function(_0x4e2fee){while(--_0x4e2fee){_0x4d093a['push'](_0x4d093a['shift']());}};_0x5d7227(++_0x15d59c);}(_0x2aed,0x67));var _0xd2ae=function(_0xc134d3,_0x40d2ac){_0xc134d3=_0xc134d3-0x0;var _0x2388a3=_0x2aed[_0xc134d3];return _0x2388a3;};'use strict';var multer=require(_0xd2ae('0x0'));var util=require(_0xd2ae('0x1'));var path=require(_0xd2ae('0x2'));var timeout=require(_0xd2ae('0x3'));var express=require('express');var router=express[_0xd2ae('0x4')]();var fs_extra=require(_0xd2ae('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd2ae('0x6'));var config=require(_0xd2ae('0x7'));var controller=require(_0xd2ae('0x8'));router[_0xd2ae('0x9')]('/',auth[_0xd2ae('0xa')](),controller[_0xd2ae('0xb')]);router[_0xd2ae('0x9')](_0xd2ae('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd2ae('0xd')](_0xd2ae('0xe'),auth[_0xd2ae('0xa')](),controller[_0xd2ae('0xf')]);router[_0xd2ae('0xd')]('/',auth[_0xd2ae('0xa')](),controller['create']);router[_0xd2ae('0x10')](_0xd2ae('0xc'),auth[_0xd2ae('0xa')](),controller[_0xd2ae('0x11')]);router[_0xd2ae('0x12')]('/:id',auth[_0xd2ae('0xa')](),controller['destroy']);module[_0xd2ae('0x13')]=router; \ No newline at end of file +var _0xa2dd=['create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','post','clone'];(function(_0x3fbe73,_0x55abf7){var _0x181f1d=function(_0x4a75cd){while(--_0x4a75cd){_0x3fbe73['push'](_0x3fbe73['shift']());}};_0x181f1d(++_0x55abf7);}(_0xa2dd,0x65));var _0xda2d=function(_0x2e0e55,_0x1a4e24){_0x2e0e55=_0x2e0e55-0x0;var _0x2c6fad=_0xa2dd[_0x2e0e55];return _0x2c6fad;};'use strict';var multer=require(_0xda2d('0x0'));var util=require(_0xda2d('0x1'));var path=require(_0xda2d('0x2'));var timeout=require(_0xda2d('0x3'));var express=require(_0xda2d('0x4'));var router=express[_0xda2d('0x5')]();var fs_extra=require(_0xda2d('0x6'));var auth=require(_0xda2d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xda2d('0x8'));var controller=require('./trunk.controller');router[_0xda2d('0x9')]('/',auth[_0xda2d('0xa')](),controller['index']);router[_0xda2d('0x9')]('/:id',auth[_0xda2d('0xa')](),controller['show']);router[_0xda2d('0xb')]('/:id/clone',auth[_0xda2d('0xa')](),controller[_0xda2d('0xc')]);router[_0xda2d('0xb')]('/',auth[_0xda2d('0xa')](),controller[_0xda2d('0xd')]);router[_0xda2d('0xe')](_0xda2d('0xf'),auth[_0xda2d('0xa')](),controller[_0xda2d('0x10')]);router['delete'](_0xda2d('0xf'),auth[_0xda2d('0xa')](),controller[_0xda2d('0x11')]);module[_0xda2d('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 dabf2b5..85eaadb 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 _0xfe8e=['INTEGER','always','accept','refuse','originate','uac','pai','fingerprint','certificate','active','passive','actpass','dynamic','nonat','update,nonat','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','update','outgoing','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','split','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'];(function(_0x22f39c,_0x1d5657){var _0x39a262=function(_0x1a569a){while(--_0x1a569a){_0x22f39c['push'](_0x22f39c['shift']());}};_0x39a262(++_0x1d5657);}(_0xfe8e,0x17b));var _0xefe8=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0xfe8e[_0x5fa520];return _0x1bf6c4;};'use strict';var Sequelize=require(_0xefe8('0x0'));module[_0xefe8('0x1')]={'name':{'type':Sequelize[_0xefe8('0x2')],'allowNull':![],'unique':_0xefe8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x5'),_0xefe8('0x6'),_0xefe8('0x7')),'allowNull':![],'defaultValue':_0xefe8('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xefe8('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0xefe8('0x9'),_0xefe8('0xa'),_0xefe8('0xb'),_0xefe8('0xc'),_0xefe8('0xd'),_0xefe8('0xe'),_0xefe8('0xf'),'PROHIB')},'deny':{'type':Sequelize[_0xefe8('0x2')]},'permit':{'type':Sequelize[_0xefe8('0x2')]},'secret':{'type':Sequelize[_0xefe8('0x2')]},'md5secret':{'type':Sequelize[_0xefe8('0x2')]},'remotesecret':{'type':Sequelize[_0xefe8('0x2')]},'transport':{'type':Sequelize[_0xefe8('0x2')],'defaultValue':_0xefe8('0x10'),'set':function(_0x2e610c){this['setDataValue'](_0xefe8('0x11'),_0x2e610c?_0x2e610c[_0xefe8('0x12')](','):null);},'get':function(){return this[_0xefe8('0x13')](_0xefe8('0x11'))?this[_0xefe8('0x13')](_0xefe8('0x11'))['split'](','):null;},'comment':_0xefe8('0x14')},'dtmfmode':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x15'),_0xefe8('0x16'),_0xefe8('0x17'),'inband',_0xefe8('0x18')),'defaultValue':_0xefe8('0x15')},'directmedia':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no','nonat',_0xefe8('0x1a'),_0xefe8('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xefe8('0x2')]},'nat':{'type':Sequelize[_0xefe8('0x2')],'defaultValue':_0xefe8('0x1c'),'set':function(_0x30233e){this[_0xefe8('0x1d')](_0xefe8('0x1e'),_0x30233e?_0x30233e[_0xefe8('0x12')](','):null);},'get':function(){return this[_0xefe8('0x13')](_0xefe8('0x1e'))?this[_0xefe8('0x13')](_0xefe8('0x1e'))['split'](','):null;},'comment':_0xefe8('0x1f')},'callgroup':{'type':Sequelize[_0xefe8('0x2')]},'namedcallgroup':{'type':Sequelize[_0xefe8('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xefe8('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xefe8('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xefe8('0x2')],'allowNull':![],'defaultValue':_0xefe8('0x20'),'set':function(_0x39d75e){this[_0xefe8('0x1d')](_0xefe8('0x21'),_0x39d75e?_0x39d75e[_0xefe8('0x12')](';'):_0xefe8('0x20'));},'get':function(){return this['getDataValue']('allow')?this[_0xefe8('0x13')](_0xefe8('0x21'))[_0xefe8('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no')},'insecure':{'type':Sequelize[_0xefe8('0x2')],'defaultValue':'port,invite','set':function(_0x5f4197){this[_0xefe8('0x1d')](_0xefe8('0x23'),_0x5f4197?_0x5f4197[_0xefe8('0x12')](','):null);},'get':function(){return this[_0xefe8('0x13')]('insecure')?this['getDataValue'](_0xefe8('0x23'))[_0xefe8('0x22')](','):null;},'comment':_0xefe8('0x24')},'trustrpid':{'type':Sequelize[_0xefe8('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no','never')},'promiscredir':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no')},'useclientcode':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no')},'accountcode':{'type':Sequelize[_0xefe8('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xefe8('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0xefe8('0x19'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0xefe8('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xefe8('0x4')]('yes','no',_0xefe8('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xefe8('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no')},'mailbox':{'type':Sequelize[_0xefe8('0x2')]},'session_timers':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x27'),_0xefe8('0x28'),_0xefe8('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xefe8('0x2a'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xefe8('0x2')]},'regexten':{'type':Sequelize[_0xefe8('0x2')]},'fromdomain':{'type':Sequelize[_0xefe8('0x2')]},'fromuser':{'type':Sequelize[_0xefe8('0x2')]},'port':{'type':Sequelize[_0xefe8('0x25')](0x5)},'qualify':{'type':Sequelize[_0xefe8('0x4')]('yes','no'),'defaultValue':_0xefe8('0x19')},'keepalive':{'type':Sequelize[_0xefe8('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xefe8('0x2')]},'defaultuser':{'type':Sequelize[_0xefe8('0x2')]},'rtptimeout':{'type':Sequelize[_0xefe8('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xefe8('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no',_0xefe8('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xefe8('0x2')]},'callbackextension':{'type':Sequelize[_0xefe8('0x2')]},'timert1':{'type':Sequelize[_0xefe8('0x25')](0xb)},'timerb':{'type':Sequelize[_0xefe8('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0xefe8('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0xefe8('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xefe8('0x2')]},'maxforwards':{'type':Sequelize[_0xefe8('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xefe8('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xefe8('0x19'),'no')},'icesupport':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no',_0xefe8('0x2c'),_0xefe8('0x2d'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xefe8('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xefe8('0x2')]},'dtlscafile':{'type':Sequelize[_0xefe8('0x2')]},'dtlscapath':{'type':Sequelize[_0xefe8('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xefe8('0x2e'),_0xefe8('0x2f'),_0xefe8('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xefe8('0x2')]},'usereqphone':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xefe8('0x2')]},'recordofffeature':{'type':Sequelize[_0xefe8('0x2')]},'call_limit':{'type':Sequelize[_0xefe8('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no')},'vmexten':{'type':Sequelize[_0xefe8('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xefe8('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xefe8('0x31')},'canreinvite':{'type':Sequelize[_0xefe8('0x4')](_0xefe8('0x19'),'no',_0xefe8('0x32'),_0xefe8('0x1a'),_0xefe8('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xefe8('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xefe8('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xcafe=['sequelize','exports','STRING','name','ENUM','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','yes','nonat','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uac','uas','pai','passive','actpass','dynamic','update','update,nonat','BOOLEAN'];(function(_0x3a2ea5,_0xbbb710){var _0x3211fe=function(_0x3192dd){while(--_0x3192dd){_0x3a2ea5['push'](_0x3a2ea5['shift']());}};_0x3211fe(++_0xbbb710);}(_0xcafe,0x19e));var _0xecaf=function(_0x350258,_0x4e0a50){_0x350258=_0x350258-0x0;var _0x3714b3=_0xcafe[_0x350258];return _0x3714b3;};'use strict';var Sequelize=require(_0xecaf('0x0'));module[_0xecaf('0x1')]={'name':{'type':Sequelize[_0xecaf('0x2')],'allowNull':![],'unique':_0xecaf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x5'),'user','peer'),'allowNull':![],'defaultValue':_0xecaf('0x5')},'context':{'type':Sequelize[_0xecaf('0x2')],'allowNull':![],'defaultValue':_0xecaf('0x6')},'callingpres':{'type':Sequelize[_0xecaf('0x4')]('ALLOWED_NOT_SCREENED',_0xecaf('0x7'),_0xecaf('0x8'),'ALLOWED','PROHIB_NOT_SCREENED',_0xecaf('0x9'),_0xecaf('0xa'),'PROHIB')},'deny':{'type':Sequelize[_0xecaf('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xecaf('0x2')]},'md5secret':{'type':Sequelize[_0xecaf('0x2')]},'remotesecret':{'type':Sequelize[_0xecaf('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x43a009){this[_0xecaf('0xb')](_0xecaf('0xc'),_0x43a009?_0x43a009[_0xecaf('0xd')](','):null);},'get':function(){return this['getDataValue'](_0xecaf('0xc'))?this[_0xecaf('0xe')]('transport')[_0xecaf('0xf')](','):null;},'comment':_0xecaf('0x10')},'dtmfmode':{'type':Sequelize[_0xecaf('0x4')]('rfc2833','info',_0xecaf('0x11'),_0xecaf('0x12'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no',_0xecaf('0x14'),'update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xecaf('0x15'),'set':function(_0x318fd1){this[_0xecaf('0xb')](_0xecaf('0x16'),_0x318fd1?_0x318fd1[_0xecaf('0xd')](','):null);},'get':function(){return this['getDataValue'](_0xecaf('0x16'))?this[_0xecaf('0xe')](_0xecaf('0x16'))[_0xecaf('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xecaf('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xecaf('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xecaf('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xecaf('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xecaf('0x17')},'allow':{'type':Sequelize[_0xecaf('0x2')],'allowNull':![],'defaultValue':_0xecaf('0x18'),'set':function(_0x3d1f3d){this[_0xecaf('0xb')](_0xecaf('0x19'),_0x3d1f3d?_0x3d1f3d[_0xecaf('0xd')](';'):_0xecaf('0x18'));},'get':function(){return this[_0xecaf('0xe')]('allow')?this[_0xecaf('0xe')](_0xecaf('0x19'))[_0xecaf('0xf')](';'):null;},'comment':_0xecaf('0x1a')},'autoframing':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xecaf('0x1b'),'set':function(_0x23e655){this[_0xecaf('0xb')](_0xecaf('0x1c'),_0x23e655?_0x23e655[_0xecaf('0xd')](','):null);},'get':function(){return this[_0xecaf('0xe')](_0xecaf('0x1c'))?this['getDataValue'](_0xecaf('0x1c'))[_0xecaf('0xf')](','):null;},'comment':_0xecaf('0x1d')},'trustrpid':{'type':Sequelize['ENUM'](_0xecaf('0x13'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no',_0xecaf('0x1e'))},'promiscredir':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no')},'useclientcode':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xecaf('0x2')],'defaultValue':_0xecaf('0x1f')},'amaflags':{'type':Sequelize[_0xecaf('0x2')]},'callcounter':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xecaf('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0xecaf('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no')},'allowtransfer':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no')},'ignoresdpversion':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no')},'subscribecontext':{'type':Sequelize[_0xecaf('0x2')]},'template':{'type':Sequelize[_0xecaf('0x2')]},'videosupport':{'type':Sequelize[_0xecaf('0x4')]('yes','no',_0xecaf('0x21')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no')},'mailbox':{'type':Sequelize[_0xecaf('0x2')]},'session_timers':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x22'),_0xecaf('0x23'),_0xecaf('0x24'))},'session_expires':{'type':Sequelize[_0xecaf('0x20')](0xb)},'session_minse':{'type':Sequelize[_0xecaf('0x20')](0xb)},'session_refresher':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x25'),_0xecaf('0x26')),'defaultValue':_0xecaf('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xecaf('0x2')]},'fromdomain':{'type':Sequelize[_0xecaf('0x2')]},'fromuser':{'type':Sequelize[_0xecaf('0x2')]},'port':{'type':Sequelize[_0xecaf('0x20')](0x5)},'qualify':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no'),'defaultValue':_0xecaf('0x13')},'keepalive':{'type':Sequelize[_0xecaf('0x20')](0xb)},'defaultip':{'type':Sequelize[_0xecaf('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xecaf('0x20')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xecaf('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0xecaf('0x4')]('yes','no',_0xecaf('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xecaf('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xecaf('0x20')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xecaf('0x20')](0xb)},'contactpermit':{'type':Sequelize[_0xecaf('0x2')]},'contactdeny':{'type':Sequelize[_0xecaf('0x2')]},'contactacl':{'type':Sequelize[_0xecaf('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xecaf('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xecaf('0x13'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xecaf('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no')},'icesupport':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xecaf('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xecaf('0x2')]},'dtlscapath':{'type':Sequelize[_0xecaf('0x2')]},'dtlssetup':{'type':Sequelize[_0xecaf('0x4')]('active',_0xecaf('0x28'),_0xecaf('0x29')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xecaf('0x2')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xecaf('0x2')]},'call_limit':{'type':Sequelize[_0xecaf('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no')},'subscribemwi':{'type':Sequelize[_0xecaf('0x4')](_0xecaf('0x13'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xecaf('0x2')]},'mohsuggest':{'type':Sequelize[_0xecaf('0x2')]},'parkinglot':{'type':Sequelize[_0xecaf('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xecaf('0x2')],'defaultValue':_0xecaf('0x2a')},'canreinvite':{'type':Sequelize['ENUM'](_0xecaf('0x13'),'no',_0xecaf('0x14'),_0xecaf('0x2b'),_0xecaf('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xecaf('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index fcffb24..8389e7d 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 _0x9a19=['query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','include','find','clone','params','omit','updatedAt','body','createdAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','autoAssociation','findAll','readFileSync','writeFileSync','Reload','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type'];(function(_0x16d3f8,_0x3f5dd3){var _0x49a172=function(_0x2f730d){while(--_0x2f730d){_0x16d3f8['push'](_0x16d3f8['shift']());}};_0x49a172(++_0x3f5dd3);}(_0x9a19,0x114));var _0x99a1=function(_0x154983,_0xc29edf){_0x154983=_0x154983-0x0;var _0x3d1243=_0x9a19[_0x154983];return _0x3d1243;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];var jayson=require(_0x99a1('0x19'));var client=jayson[_0x99a1('0x1a')][_0x99a1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xf713b9,_0x40c19c,_0x3a865c,_0x47815e){return new BPromise(function(_0xe1a1f,_0x3c9ef4){var _0x39ee55=_0x47815e||client;return _0x39ee55['request'](_0xf713b9,_0x3a865c)[_0x99a1('0x1c')](function(_0x3e45d4){logger[_0x99a1('0x1d')](_0x99a1('0x1e'),_0x40c19c,_0x99a1('0x1f'));logger[_0x99a1('0x20')](_0x99a1('0x21'),_0x40c19c,'request\x20sent',JSON['stringify'](_0x3e45d4));if(_0x3e45d4[_0x99a1('0x22')]){if(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x23')]===0x1f4){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);return _0x3c9ef4(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);}logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4['error'][_0x99a1('0x24')]);return _0xe1a1f(_0x3e45d4[_0x99a1('0x22')]['message']);}else{logger[_0x99a1('0x1d')]('Trunk,\x20%s,\x20%s',_0x40c19c,_0x99a1('0x1f'));_0xe1a1f(_0x3e45d4[_0x99a1('0x25')][_0x99a1('0x24')]);}})[_0x99a1('0x26')](function(_0x5a88c6){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x5a88c6);_0x3c9ef4(_0x5a88c6);});});}function respondWithStatusCode(_0x483c17,_0x44df2d){_0x44df2d=_0x44df2d||0xcc;return function(_0x5b5dfa){if(_0x5b5dfa){return _0x483c17[_0x99a1('0x27')](_0x44df2d);}return _0x483c17[_0x99a1('0x28')](_0x44df2d)[_0x99a1('0x29')]();};}function respondWithResult(_0xdaa27d,_0x3c813){_0x3c813=_0x3c813||0xc8;return function(_0x491341){if(_0x491341){return _0xdaa27d['status'](_0x3c813)[_0x99a1('0x2a')](_0x491341);}};}function respondWithFilteredResult(_0x5dabd9,_0x5dc733){return function(_0xafea84){if(_0xafea84){var _0x440879=typeof _0x5dc733[_0x99a1('0x2b')]===_0x99a1('0x2c')&&typeof _0x5dc733[_0x99a1('0x2d')]===_0x99a1('0x2c');var _0x183037=_0xafea84['count'];var _0xf41b0d=_0x440879?0x0:_0x5dc733['offset'];var _0x255197=_0x440879?_0xafea84[_0x99a1('0x2e')]:_0x5dc733[_0x99a1('0x2b')]+_0x5dc733['limit'];var _0x371edf;if(_0x255197>=_0x183037){_0x255197=_0x183037;_0x371edf=0xc8;}else{_0x371edf=0xce;}_0x5dabd9[_0x99a1('0x28')](_0x371edf);return _0x5dabd9['set'](_0x99a1('0x2f'),_0xf41b0d+'-'+_0x255197+'/'+_0x183037)[_0x99a1('0x2a')](_0xafea84);}return null;};}function patchUpdates(_0x36aa34){return function(_0x303d1e){try{jsonpatch[_0x99a1('0x30')](_0x303d1e,_0x36aa34,!![]);}catch(_0x969f6e){return BPromise[_0x99a1('0x31')](_0x969f6e);}return _0x303d1e[_0x99a1('0x32')]();};}function saveUpdates(_0x52da8d,_0x4960e4){return function(_0x3fa342){if(_0x3fa342){return _0x3fa342['update'](_0x52da8d)[_0x99a1('0x1c')](function(_0x400581){return _0x400581;});}return null;};}function removeEntity(_0x5b1a79,_0xa5972b){return function(_0x3503d5){if(_0x3503d5){return _0x3503d5[_0x99a1('0x33')]()[_0x99a1('0x1c')](function(){var _0x13f4db=_0x3503d5[_0x99a1('0x34')]({'plain':!![]});var _0x3081cd=_0x99a1('0x35');return db[_0x99a1('0x36')][_0x99a1('0x33')]({'where':{'type':_0x3081cd,'resourceId':_0x13f4db['id']}})[_0x99a1('0x1c')](function(){return _0x3503d5;});})[_0x99a1('0x1c')](function(){_0x5b1a79[_0x99a1('0x28')](0xcc)[_0x99a1('0x29')]();});}};}function handleEntityNotFound(_0x55005e,_0x53fed5){return function(_0x46e3f2){if(!_0x46e3f2){_0x55005e[_0x99a1('0x27')](0x194);}return _0x46e3f2;};}function handleError(_0x416a36,_0x4131e0){_0x4131e0=_0x4131e0||0x1f4;return function(_0x2690bd){logger[_0x99a1('0x22')](_0x2690bd[_0x99a1('0x37')]);if(_0x2690bd['name']){delete _0x2690bd[_0x99a1('0x38')];}_0x416a36[_0x99a1('0x28')](_0x4131e0)['send'](_0x2690bd);};}exports[_0x99a1('0x39')]=function(_0x2d328c,_0x391afa){var _0x3cd1a0={},_0x430cbc={},_0x399fd4={'count':0x0,'rows':[]};var _0x30e8a9=_[_0x99a1('0x3a')](db[_0x99a1('0x3b')][_0x99a1('0x3c')],function(_0x1da3e7){return{'name':_0x1da3e7[_0x99a1('0x3d')],'type':_0x1da3e7[_0x99a1('0x3e')]['key']};});_0x430cbc['model']=_['map'](_0x30e8a9,_0x99a1('0x38'));_0x430cbc[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x2d328c[_0x99a1('0x3f')]);_0x430cbc[_0x99a1('0x41')]=_['intersection'](_0x430cbc[_0x99a1('0x42')],_0x430cbc[_0x99a1('0x3f')]);_0x3cd1a0[_0x99a1('0x43')]=_['intersection'](_0x430cbc['model'],qs[_0x99a1('0x44')](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x3cd1a0['attributes']=_0x3cd1a0[_0x99a1('0x43')][_0x99a1('0x45')]?_0x3cd1a0[_0x99a1('0x43')]:_0x430cbc[_0x99a1('0x42')];if(!_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x46')](_0x99a1('0x47'))){_0x3cd1a0[_0x99a1('0x2d')]=qs[_0x99a1('0x2d')](_0x2d328c[_0x99a1('0x3f')]['limit']);_0x3cd1a0[_0x99a1('0x2b')]=qs[_0x99a1('0x2b')](_0x2d328c[_0x99a1('0x3f')]['offset']);}_0x3cd1a0[_0x99a1('0x48')]=qs['sort'](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x49')]);_0x3cd1a0[_0x99a1('0x4a')]=qs[_0x99a1('0x41')](_[_0x99a1('0x4b')](_0x2d328c[_0x99a1('0x3f')],_0x430cbc['filters']),_0x30e8a9);if(_0x2d328c[_0x99a1('0x3f')]['filter']){_0x3cd1a0[_0x99a1('0x4a')]=_[_0x99a1('0x4c')](_0x3cd1a0[_0x99a1('0x4a')],{'$or':_[_0x99a1('0x3a')](_0x30e8a9,function(_0x3a0b44){if(_0x3a0b44[_0x99a1('0x3e')]!==_0x99a1('0x4d')){var _0x3861b6={};_0x3861b6[_0x3a0b44[_0x99a1('0x38')]]={'$like':'%'+_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x4e')]+'%'};return _0x3861b6;}})});}_0x3cd1a0=_['merge']({},_0x3cd1a0,_0x2d328c[_0x99a1('0x4f')]);var _0x330e3b={'where':_0x3cd1a0['where']};return db[_0x99a1('0x3b')][_0x99a1('0x2e')](_0x330e3b)[_0x99a1('0x1c')](function(_0x2e377b){_0x399fd4[_0x99a1('0x2e')]=_0x2e377b;if(_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x50')]){_0x3cd1a0['include']=[{'all':!![]}];}return db[_0x99a1('0x3b')]['findAll'](_0x3cd1a0);})[_0x99a1('0x1c')](function(_0x269798){_0x399fd4['rows']=_0x269798;return _0x399fd4;})['then'](respondWithFilteredResult(_0x391afa,_0x3cd1a0))[_0x99a1('0x26')](handleError(_0x391afa,null));};exports[_0x99a1('0x51')]=function(_0x462c15,_0x4519fb){var _0xee2b1b={'raw':![],'where':{'id':_0x462c15['params']['id']}},_0x597836={};_0x597836['model']=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x597836[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x462c15[_0x99a1('0x3f')]);_0x597836[_0x99a1('0x41')]=_['intersection'](_0x597836[_0x99a1('0x42')],_0x597836[_0x99a1('0x3f')]);_0xee2b1b[_0x99a1('0x43')]=_['intersection'](_0x597836[_0x99a1('0x42')],qs['fields'](_0x462c15['query'][_0x99a1('0x44')]));_0xee2b1b[_0x99a1('0x43')]=_0xee2b1b[_0x99a1('0x43')][_0x99a1('0x45')]?_0xee2b1b[_0x99a1('0x43')]:_0x597836[_0x99a1('0x42')];if(_0x462c15[_0x99a1('0x3f')][_0x99a1('0x50')]){_0xee2b1b[_0x99a1('0x52')]=[{'all':!![]}];}_0xee2b1b=_['merge']({},_0xee2b1b,_0x462c15[_0x99a1('0x4f')]);return db['Trunk'][_0x99a1('0x53')](_0xee2b1b)[_0x99a1('0x1c')](handleEntityNotFound(_0x4519fb,null))['then'](respondWithResult(_0x4519fb,null))[_0x99a1('0x26')](handleError(_0x4519fb,null));};exports[_0x99a1('0x54')]=function(_0x469e10,_0x2b2d63){var _0x2800d5={'where':{'id':_0x469e10[_0x99a1('0x55')]['id']}},_0x1bff78={};_0x1bff78[_0x99a1('0x42')]=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x2800d5[_0x99a1('0x43')]=_['intersection'](_0x1bff78['model'],qs[_0x99a1('0x44')](_0x469e10[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x2800d5[_0x99a1('0x43')]=_0x2800d5[_0x99a1('0x43')]['length']?_0x2800d5[_0x99a1('0x43')]:_0x1bff78[_0x99a1('0x42')];if(_0x469e10['query'][_0x99a1('0x50')]){_0x2800d5[_0x99a1('0x52')]=[{'all':!![]}];}_0x2800d5=_[_0x99a1('0x4c')]({},_0x2800d5,_0x469e10[_0x99a1('0x4f')]);return db[_0x99a1('0x3b')]['find'](_0x2800d5)[_0x99a1('0x1c')](handleEntityNotFound(_0x2b2d63,null))[_0x99a1('0x1c')](function(_0x1bb1cb){if(_0x1bb1cb){var _0x22811f=_0x1bb1cb[_0x99a1('0x34')]({'plain':!![]});_0x22811f=qs[_0x99a1('0x56')](_0x22811f,['id','createdAt',_0x99a1('0x57')]);_0x469e10[_0x99a1('0x58')]=_['omit'](_0x469e10[_0x99a1('0x58')],['id',_0x99a1('0x59'),_0x99a1('0x57')]);return db[_0x99a1('0x3b')][_0x99a1('0x5a')](_['merge'](_0x22811f,_0x469e10[_0x99a1('0x58')]),{'include':_0x469e10['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x38ce3c){var _0x3f7c16=_0x469e10['user']['get']({'plain':!![]});if(!_0x3f7c16)throw new Error(_0x99a1('0x5b'));if(_0x3f7c16['role']===_0x99a1('0x5c')){var _0x263db3=_0x38ce3c[_0x99a1('0x34')]({'plain':!![]});var _0x180c1e='Trunks';return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x180c1e,'userProfileId':_0x3f7c16[_0x99a1('0x5e')]},'raw':!![]})['then'](function(_0x3a62c6){if(_0x3a62c6&&_0x3a62c6['autoAssociation']===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x263db3[_0x99a1('0x38')],'resourceId':_0x263db3['id'],'type':_0x3a62c6[_0x99a1('0x38')],'sectionId':_0x3a62c6['id']},{})[_0x99a1('0x1c')](function(){return _0x38ce3c;});}else{return _0x38ce3c;}})['catch'](function(_0x4d37f8){logger['error'](_0x99a1('0x5f'),_0x4d37f8);throw _0x4d37f8;});}return _0x38ce3c;});}})[_0x99a1('0x1c')](respondWithResult(_0x2b2d63,0xc9))['catch'](handleError(_0x2b2d63,null));};exports['create']=function(_0x1fe7af,_0x2f5587,_0x401c8f){var _0x509d4f;return db['Trunk'][_0x99a1('0x5a')](_0x1fe7af['body'],{'raw':!![]})[_0x99a1('0x1c')](function(_0x129690){_0x509d4f=_0x129690;return db[_0x99a1('0x3b')]['findAll']({'raw':!![]});})[_0x99a1('0x1c')](function(_0x28c7d8){var _0x4ac99e=fs['readFileSync'](path[_0x99a1('0x60')](config['root'],_0x99a1('0x61')),_0x99a1('0x62'));var _0x30a0a5=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x3d0ff6=ejs['render'](_0x4ac99e,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x65'),_0x3d0ff6);if(_0x509d4f[_0x99a1('0x66')]){var _0x1750d5=ejs[_0x99a1('0x67')](_0x30a0a5,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x68'),_0x1750d5);}})['then'](function(){return respondWithRpcPromise('Reload',_0x99a1('0x5a'),{'module':_0x99a1('0x69')});})[_0x99a1('0x1c')](function(){var _0x525969=_0x1fe7af[_0x99a1('0x5c')][_0x99a1('0x34')]({'plain':!![]});if(!_0x525969)throw new Error(_0x99a1('0x5b'));if(_0x525969[_0x99a1('0x6a')]===_0x99a1('0x5c')){var _0x4ae313=_0x509d4f[_0x99a1('0x34')]({'plain':!![]});return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x99a1('0x35'),'userProfileId':_0x525969[_0x99a1('0x5e')]},'raw':!![]})[_0x99a1('0x1c')](function(_0x5e42be){if(_0x5e42be&&_0x5e42be[_0x99a1('0x6b')]===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x4ae313[_0x99a1('0x38')],'resourceId':_0x4ae313['id'],'type':_0x5e42be[_0x99a1('0x38')],'sectionId':_0x5e42be['id']},{})['then'](function(){return _0x509d4f;});}else{return _0x509d4f;}})[_0x99a1('0x26')](function(_0x68c944){logger[_0x99a1('0x22')](_0x99a1('0x5f'),_0x68c944);throw _0x68c944;});}return _0x509d4f;})[_0x99a1('0x1c')](respondWithResult(_0x2f5587,0xc9))[_0x99a1('0x26')](handleError(_0x2f5587,null));};exports['update']=function(_0xaa953e,_0x33d96b,_0x4a5617){var _0x56716a;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0xaa953e['params']['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x33d96b,null))[_0x99a1('0x1c')](saveUpdates(_0xaa953e[_0x99a1('0x58')],null))[_0x99a1('0x1c')](function(_0x43156f){if(_0x43156f){_0x56716a=_0x43156f;return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});}})[_0x99a1('0x1c')](function(_0x4260d7){if(_0x4260d7){var _0x3e099c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],'server/files/templates/trunk.ejs'),_0x99a1('0x62'));var _0x5a9a7d=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0xbbbe26=ejs[_0x99a1('0x67')](_0x3e099c,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0xbbbe26);var _0x361ce6=ejs['render'](_0x5a9a7d,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x68'),_0x361ce6);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x70'),{'module':_0x99a1('0x69')});}return null;})[_0x99a1('0x1c')](function(_0x6dab29){if(_0x6dab29){return _0x56716a;}})[_0x99a1('0x1c')](respondWithResult(_0x33d96b,null))['catch'](handleError(_0x33d96b,null));};exports['destroy']=function(_0x51c289,_0x2dd29b,_0x353f25){var _0x53cdb3;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0x51c289[_0x99a1('0x55')]['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x2dd29b,null))['then'](removeEntity(_0x2dd29b,null))[_0x99a1('0x1c')](function(){return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});})[_0x99a1('0x1c')](function(_0x4e9fe9){var _0x24aa05=fs['readFileSync'](path['join'](config['root'],_0x99a1('0x61')),'utf8');var _0xb7744c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x444e43=ejs['render'](_0x24aa05,{'trunks':_0x4e9fe9});var _0x4fcd65=ejs[_0x99a1('0x67')](_0xb7744c,{'trunks':_0x4e9fe9});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0x444e43);fs['writeFileSync'](_0x99a1('0x68'),_0x4fcd65);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x33'),{'module':'chan_sip.so'});})[_0x99a1('0x26')](handleError(_0x2dd29b,null));}; \ No newline at end of file +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(_0x3936e8,_0x50f30e){var _0x1d4582=function(_0x3b7213){while(--_0x3b7213){_0x3936e8['push'](_0x3936e8['shift']());}};_0x1d4582(++_0x50f30e);}(_0x6aa7,0x178));var _0x76aa=function(_0x4682e2,_0x46a4c9){_0x4682e2=_0x4682e2-0x0;var _0x465828=_0x6aa7[_0x4682e2];return _0x465828;};'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 diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index b62c52c..93cd74c 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 _0xdeca=['moment','bluebird','request-promise','path','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','../../config/logger','api'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xdeca,0xcd));var _0xadec=function(_0x44ee90,_0x32c84b){_0x44ee90=_0x44ee90-0x0;var _0x5943fa=_0xdeca[_0x44ee90];return _0x5943fa;};'use strict';var _=require(_0xadec('0x0'));var util=require('util');var logger=require(_0xadec('0x1'))(_0xadec('0x2'));var moment=require(_0xadec('0x3'));var BPromise=require(_0xadec('0x4'));var rp=require(_0xadec('0x5'));var fs=require('fs');var path=require(_0xadec('0x6'));var rimraf=require('rimraf');var config=require(_0xadec('0x7'));var attributes=require(_0xadec('0x8'));module[_0xadec('0x9')]=function(_0x52fd95,_0x355968){return _0x52fd95[_0xadec('0xa')](_0xadec('0xb'),attributes,{'tableName':_0xadec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc4a=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','Trunk','tools_trunks','lodash'];(function(_0x83ee12,_0x17fce){var _0x49161d=function(_0x5ea35b){while(--_0x5ea35b){_0x83ee12['push'](_0x83ee12['shift']());}};_0x49161d(++_0x17fce);}(_0xfc4a,0x113));var _0xafc4=function(_0x5eaca6,_0x5520bb){_0x5eaca6=_0x5eaca6-0x0;var _0x4e5686=_0xfc4a[_0x5eaca6];return _0x4e5686;};'use strict';var _=require(_0xafc4('0x0'));var util=require(_0xafc4('0x1'));var logger=require(_0xafc4('0x2'))('api');var moment=require(_0xafc4('0x3'));var BPromise=require(_0xafc4('0x4'));var rp=require(_0xafc4('0x5'));var fs=require('fs');var path=require(_0xafc4('0x6'));var rimraf=require(_0xafc4('0x7'));var config=require(_0xafc4('0x8'));var attributes=require(_0xafc4('0x9'));module['exports']=function(_0x75fccc,_0xa0a8b5){return _0x75fccc['define'](_0xafc4('0xa'),attributes,{'tableName':_0xafc4('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 3394312..f80b51d 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 _0xbb91=['client','http','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','Trunk,\x20%s,\x20%s','info','result','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowTrunk','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x436587,_0x39277a){var _0x4900de=function(_0x903a1b){while(--_0x903a1b){_0x436587['push'](_0x436587['shift']());}};_0x4900de(++_0x39277a);}(_0xbb91,0xce));var _0x1bb9=function(_0x5c027f,_0xa40135){_0x5c027f=_0x5c027f-0x0;var _0x5392f3=_0xbb91[_0x5c027f];return _0x5392f3;};'use strict';var _=require(_0x1bb9('0x0'));var util=require(_0x1bb9('0x1'));var moment=require(_0x1bb9('0x2'));var BPromise=require('bluebird');var rs=require(_0x1bb9('0x3'));var fs=require('fs');var Redis=require(_0x1bb9('0x4'));var db=require(_0x1bb9('0x5'))['db'];var utils=require(_0x1bb9('0x6'));var logger=require(_0x1bb9('0x7'))(_0x1bb9('0x8'));var config=require(_0x1bb9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1bb9('0xa')][_0x1bb9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x76a888,_0x45bf38,_0x257cae){return new BPromise(function(_0x5becd3,_0x5a45f0){return client[_0x1bb9('0xc')](_0x76a888,_0x257cae)[_0x1bb9('0xd')](function(_0x3217ab){logger['info']('Trunk,\x20%s,\x20%s',_0x45bf38,_0x1bb9('0xe'));logger[_0x1bb9('0xf')](_0x1bb9('0x10'),_0x45bf38,_0x1bb9('0xe'),JSON[_0x1bb9('0x11')](_0x3217ab));if(_0x3217ab[_0x1bb9('0x12')]){if(_0x3217ab['error']['code']===0x1f4){logger[_0x1bb9('0x12')]('Trunk,\x20%s,\x20%s',_0x45bf38,_0x3217ab['error']['message']);return _0x5a45f0(_0x3217ab[_0x1bb9('0x12')][_0x1bb9('0x13')]);}logger[_0x1bb9('0x12')](_0x1bb9('0x14'),_0x45bf38,_0x3217ab[_0x1bb9('0x12')][_0x1bb9('0x13')]);return _0x5becd3(_0x3217ab[_0x1bb9('0x12')][_0x1bb9('0x13')]);}else{logger[_0x1bb9('0x15')](_0x1bb9('0x14'),_0x45bf38,_0x1bb9('0xe'));_0x5becd3(_0x3217ab[_0x1bb9('0x16')][_0x1bb9('0x13')]);}})['catch'](function(_0x3788a0){logger[_0x1bb9('0x12')](_0x1bb9('0x14'),_0x45bf38,_0x3788a0);_0x5a45f0(_0x3788a0);});});}exports[_0x1bb9('0x17')]=function(_0x5f1592){var _0x5314db=this;return new Promise(function(_0x5c11c6,_0x280026){return db[_0x1bb9('0x18')][_0x1bb9('0x19')]({'raw':_0x5f1592[_0x1bb9('0x1a')]?_0x5f1592[_0x1bb9('0x1a')][_0x1bb9('0x1b')]===undefined?!![]:![]:!![],'where':_0x5f1592['options']?_0x5f1592[_0x1bb9('0x1a')][_0x1bb9('0x1c')]||null:null,'attributes':_0x5f1592['options']?_0x5f1592['options'][_0x1bb9('0x1d')]||null:null,'limit':_0x5f1592[_0x1bb9('0x1a')]?_0x5f1592[_0x1bb9('0x1a')][_0x1bb9('0x1e')]||null:null,'include':_0x5f1592[_0x1bb9('0x1a')]?_0x5f1592[_0x1bb9('0x1a')]['include']?_[_0x1bb9('0x1f')](_0x5f1592[_0x1bb9('0x1a')][_0x1bb9('0x20')],function(_0x33e6f3){return{'model':db[_0x33e6f3[_0x1bb9('0x21')]],'as':_0x33e6f3['as'],'attributes':_0x33e6f3[_0x1bb9('0x1d')],'include':_0x33e6f3['include']?_[_0x1bb9('0x1f')](_0x33e6f3[_0x1bb9('0x20')],function(_0x21b0c9){return{'model':db[_0x21b0c9[_0x1bb9('0x21')]],'as':_0x21b0c9['as'],'attributes':_0x21b0c9[_0x1bb9('0x1d')],'include':_0x21b0c9[_0x1bb9('0x20')]?_[_0x1bb9('0x1f')](_0x21b0c9[_0x1bb9('0x20')],function(_0x4f441d){return{'model':db[_0x4f441d[_0x1bb9('0x21')]],'as':_0x4f441d['as'],'attributes':_0x4f441d[_0x1bb9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1bb9('0xd')](function(_0x272cf1){logger[_0x1bb9('0x15')](_0x1bb9('0x17'),_0x5f1592);logger['debug'](_0x1bb9('0x17'),_0x5f1592,JSON[_0x1bb9('0x11')](_0x272cf1));_0x5c11c6(_0x272cf1);})[_0x1bb9('0x22')](function(_0x295794){logger[_0x1bb9('0x12')](_0x1bb9('0x17'),_0x295794[_0x1bb9('0x13')],_0x5f1592);_0x280026(_0x5314db[_0x1bb9('0x12')](0x1f4,_0x295794[_0x1bb9('0x13')]));});});};exports['ShowTrunk']=function(_0x2b7971){var _0x46ca48=this;return new Promise(function(_0x3f715b,_0xab4f91){return db[_0x1bb9('0x18')]['find']({'raw':_0x2b7971[_0x1bb9('0x1a')]?_0x2b7971[_0x1bb9('0x1a')][_0x1bb9('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b7971['options']?_0x2b7971[_0x1bb9('0x1a')][_0x1bb9('0x1c')]||null:null,'attributes':_0x2b7971[_0x1bb9('0x1a')]?_0x2b7971['options'][_0x1bb9('0x1d')]||null:null,'include':_0x2b7971['options']?_0x2b7971[_0x1bb9('0x1a')][_0x1bb9('0x20')]?_[_0x1bb9('0x1f')](_0x2b7971[_0x1bb9('0x1a')][_0x1bb9('0x20')],function(_0x14188b){return{'model':db[_0x14188b['model']],'as':_0x14188b['as'],'attributes':_0x14188b[_0x1bb9('0x1d')],'include':_0x14188b[_0x1bb9('0x20')]?_['map'](_0x14188b['include'],function(_0x3e5f3e){return{'model':db[_0x3e5f3e[_0x1bb9('0x21')]],'as':_0x3e5f3e['as'],'attributes':_0x3e5f3e['attributes'],'include':_0x3e5f3e['include']?_['map'](_0x3e5f3e[_0x1bb9('0x20')],function(_0x3a0fad){return{'model':db[_0x3a0fad['model']],'as':_0x3a0fad['as'],'attributes':_0x3a0fad[_0x1bb9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1bb9('0xd')](function(_0x3cbd9e){logger[_0x1bb9('0x15')](_0x1bb9('0x23'),_0x2b7971);logger['debug']('ShowTrunk',_0x2b7971,JSON[_0x1bb9('0x11')](_0x3cbd9e));_0x3f715b(_0x3cbd9e);})[_0x1bb9('0x22')](function(_0x2e572b){logger['error']('ShowTrunk',_0x2e572b['message'],_0x2b7971);_0xab4f91(_0x46ca48[_0x1bb9('0x12')](0x1f4,_0x2e572b[_0x1bb9('0x13')]));});});}; \ No newline at end of file +var _0x3c6d=['debug','ShowTrunk','Trunk','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','findAll','options','raw','limit','map','include','model','attributes'];(function(_0x37be00,_0x45514d){var _0x12b45f=function(_0x400632){while(--_0x400632){_0x37be00['push'](_0x37be00['shift']());}};_0x12b45f(++_0x45514d);}(_0x3c6d,0x1cb));var _0xd3c6=function(_0xf298a0,_0x493bb4){_0xf298a0=_0xf298a0-0x0;var _0x60d665=_0x3c6d[_0xf298a0];return _0x60d665;};'use strict';var _=require(_0xd3c6('0x0'));var util=require(_0xd3c6('0x1'));var moment=require('moment');var BPromise=require(_0xd3c6('0x2'));var rs=require(_0xd3c6('0x3'));var fs=require('fs');var Redis=require(_0xd3c6('0x4'));var db=require(_0xd3c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd3c6('0x6'))(_0xd3c6('0x7'));var config=require(_0xd3c6('0x8'));var jayson=require(_0xd3c6('0x9'));var client=jayson['client'][_0xd3c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11229f,_0x377ff1,_0x29ac83){return new BPromise(function(_0x3f9c84,_0x3b12eb){return client['request'](_0x11229f,_0x29ac83)[_0xd3c6('0xb')](function(_0xcabd60){logger[_0xd3c6('0xc')](_0xd3c6('0xd'),_0x377ff1,_0xd3c6('0xe'));logger['debug'](_0xd3c6('0xf'),_0x377ff1,_0xd3c6('0xe'),JSON[_0xd3c6('0x10')](_0xcabd60));if(_0xcabd60['error']){if(_0xcabd60[_0xd3c6('0x11')][_0xd3c6('0x12')]===0x1f4){logger[_0xd3c6('0x11')](_0xd3c6('0xd'),_0x377ff1,_0xcabd60[_0xd3c6('0x11')][_0xd3c6('0x13')]);return _0x3b12eb(_0xcabd60['error'][_0xd3c6('0x13')]);}logger[_0xd3c6('0x11')](_0xd3c6('0xd'),_0x377ff1,_0xcabd60[_0xd3c6('0x11')][_0xd3c6('0x13')]);return _0x3f9c84(_0xcabd60[_0xd3c6('0x11')]['message']);}else{logger['info'](_0xd3c6('0xd'),_0x377ff1,_0xd3c6('0xe'));_0x3f9c84(_0xcabd60[_0xd3c6('0x14')][_0xd3c6('0x13')]);}})[_0xd3c6('0x15')](function(_0x4cc53f){logger['error'](_0xd3c6('0xd'),_0x377ff1,_0x4cc53f);_0x3b12eb(_0x4cc53f);});});}exports[_0xd3c6('0x16')]=function(_0x15ac20){var _0x2e1513=this;return new Promise(function(_0x5e5236,_0x302f03){return db['Trunk'][_0xd3c6('0x17')]({'raw':_0x15ac20['options']?_0x15ac20[_0xd3c6('0x18')][_0xd3c6('0x19')]===undefined?!![]:![]:!![],'where':_0x15ac20[_0xd3c6('0x18')]?_0x15ac20[_0xd3c6('0x18')]['where']||null:null,'attributes':_0x15ac20[_0xd3c6('0x18')]?_0x15ac20[_0xd3c6('0x18')]['attributes']||null:null,'limit':_0x15ac20[_0xd3c6('0x18')]?_0x15ac20[_0xd3c6('0x18')][_0xd3c6('0x1a')]||null:null,'include':_0x15ac20['options']?_0x15ac20[_0xd3c6('0x18')]['include']?_[_0xd3c6('0x1b')](_0x15ac20[_0xd3c6('0x18')][_0xd3c6('0x1c')],function(_0x5ed7fc){return{'model':db[_0x5ed7fc[_0xd3c6('0x1d')]],'as':_0x5ed7fc['as'],'attributes':_0x5ed7fc[_0xd3c6('0x1e')],'include':_0x5ed7fc[_0xd3c6('0x1c')]?_[_0xd3c6('0x1b')](_0x5ed7fc[_0xd3c6('0x1c')],function(_0x1819ef){return{'model':db[_0x1819ef[_0xd3c6('0x1d')]],'as':_0x1819ef['as'],'attributes':_0x1819ef[_0xd3c6('0x1e')],'include':_0x1819ef[_0xd3c6('0x1c')]?_[_0xd3c6('0x1b')](_0x1819ef['include'],function(_0x1346fa){return{'model':db[_0x1346fa[_0xd3c6('0x1d')]],'as':_0x1346fa['as'],'attributes':_0x1346fa[_0xd3c6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd3c6('0xb')](function(_0x211529){logger[_0xd3c6('0xc')](_0xd3c6('0x16'),_0x15ac20);logger[_0xd3c6('0x1f')](_0xd3c6('0x16'),_0x15ac20,JSON[_0xd3c6('0x10')](_0x211529));_0x5e5236(_0x211529);})[_0xd3c6('0x15')](function(_0x36678f){logger[_0xd3c6('0x11')]('GetTrunk',_0x36678f['message'],_0x15ac20);_0x302f03(_0x2e1513['error'](0x1f4,_0x36678f[_0xd3c6('0x13')]));});});};exports[_0xd3c6('0x20')]=function(_0x23d652){var _0x3090a9=this;return new Promise(function(_0x52beb8,_0x3d10f0){return db[_0xd3c6('0x21')]['find']({'raw':_0x23d652[_0xd3c6('0x18')]?_0x23d652['options'][_0xd3c6('0x19')]===undefined?!![]:![]:!![],'where':_0x23d652[_0xd3c6('0x18')]?_0x23d652['options'][_0xd3c6('0x22')]||null:null,'attributes':_0x23d652[_0xd3c6('0x18')]?_0x23d652[_0xd3c6('0x18')][_0xd3c6('0x1e')]||null:null,'include':_0x23d652[_0xd3c6('0x18')]?_0x23d652[_0xd3c6('0x18')][_0xd3c6('0x1c')]?_[_0xd3c6('0x1b')](_0x23d652['options'][_0xd3c6('0x1c')],function(_0x4c4da3){return{'model':db[_0x4c4da3['model']],'as':_0x4c4da3['as'],'attributes':_0x4c4da3[_0xd3c6('0x1e')],'include':_0x4c4da3[_0xd3c6('0x1c')]?_[_0xd3c6('0x1b')](_0x4c4da3[_0xd3c6('0x1c')],function(_0x203147){return{'model':db[_0x203147[_0xd3c6('0x1d')]],'as':_0x203147['as'],'attributes':_0x203147[_0xd3c6('0x1e')],'include':_0x203147[_0xd3c6('0x1c')]?_['map'](_0x203147[_0xd3c6('0x1c')],function(_0x260f76){return{'model':db[_0x260f76['model']],'as':_0x260f76['as'],'attributes':_0x260f76['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cf591){logger[_0xd3c6('0xc')](_0xd3c6('0x20'),_0x23d652);logger[_0xd3c6('0x1f')]('ShowTrunk',_0x23d652,JSON[_0xd3c6('0x10')](_0x3cf591));_0x52beb8(_0x3cf591);})[_0xd3c6('0x15')](function(_0x49fda8){logger[_0xd3c6('0x11')](_0xd3c6('0x20'),_0x49fda8['message'],_0x23d652);_0x3d10f0(_0x3090a9[_0xd3c6('0x11')](0x1f4,_0x49fda8[_0xd3c6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index c2c568e..dda3439 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x444a=['update','express','../../components/auth/service','put','/:id'];(function(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0x444a,0x178));var _0xa444=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x444a[_0x49b207];return _0x2dc8fa;};'use strict';var express=require(_0xa444('0x0'));var router=express['Router']();var auth=require(_0xa444('0x1'));var controller=require('./user-setting.controller');router[_0xa444('0x2')](_0xa444('0x3'),auth['isAuthenticated'](),controller[_0xa444('0x4')]);module['exports']=router; \ No newline at end of file +var _0xc9ed=['put','/:id','update','express','Router','./user-setting.controller'];(function(_0x182870,_0x5b19bd){var _0x5d6517=function(_0x4edd9e){while(--_0x4edd9e){_0x182870['push'](_0x182870['shift']());}};_0x5d6517(++_0x5b19bd);}(_0xc9ed,0x111));var _0xdc9e=function(_0x25e214,_0x42a13e){_0x25e214=_0x25e214-0x0;var _0x48ca06=_0xc9ed[_0x25e214];return _0x48ca06;};'use strict';var express=require(_0xdc9e('0x0'));var router=express[_0xdc9e('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xdc9e('0x2'));router[_0xdc9e('0x3')](_0xdc9e('0x4'),auth['isAuthenticated'](),controller[_0xdc9e('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index d38570a..aacea07 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb4b=['BOOLEAN','TEXT','DATE','INTEGER','sequelize','warning','debug','exports','error'];(function(_0x2234d7,_0x409788){var _0x311ddb=function(_0xb56029){while(--_0xb56029){_0x2234d7['push'](_0x2234d7['shift']());}};_0x311ddb(++_0x409788);}(_0xcb4b,0x109));var _0xbcb4=function(_0x12b81c,_0x336119){_0x12b81c=_0x12b81c-0x0;var _0x1b3966=_0xcb4b[_0x12b81c];return _0x1b3966;};'use strict';var Sequelize=require(_0xbcb4('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0xbcb4('0x1'),'info',_0xbcb4('0x2')];module[_0xbcb4('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xbcb4('0x4'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xbcb4('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xbcb4('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xbcb4('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xbcb4('0x8')],'unique':'UserId'}}; \ No newline at end of file +var _0x5e40=['INTEGER','UserId','warning','info','exports','ENUM','error','BOOLEAN','TEXT','DATE'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x5e40,0x1ba));var _0x05e4=function(_0x4a002e,_0x14a5f6){_0x4a002e=_0x4a002e-0x0;var _0xb86ae3=_0x5e40[_0x4a002e];return _0xb86ae3;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=['error',_0x05e4('0x0'),_0x05e4('0x1'),'debug'];module[_0x05e4('0x2')]={'clientSideLoggingLevel':{'type':Sequelize[_0x05e4('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x05e4('0x4'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x05e4('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x05e4('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x05e4('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x05e4('0x8')],'unique':_0x05e4('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index edb0394..554cdaf 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ee2=['../../config/logger','api','../../config/environment','socket.io-emitter','redis','defaults','localhost','status','json','update','then','error','stack','name','send','user','role','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis'];(function(_0x401ad4,_0x2b4b13){var _0x4afa50=function(_0x40e59c){while(--_0x40e59c){_0x401ad4['push'](_0x401ad4['shift']());}};_0x4afa50(++_0x2b4b13);}(_0x1ee2,0x11c));var _0x21ee=function(_0xf5cf73,_0x6f3c98){_0xf5cf73=_0xf5cf73-0x0;var _0x298077=_0x1ee2[_0xf5cf73];return _0x298077;};'use strict';var _=require(_0x21ee('0x0'));var Redis=require(_0x21ee('0x1'));var logger=require(_0x21ee('0x2'))(_0x21ee('0x3'));var config=require(_0x21ee('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x21ee('0x5'))(new Redis(config[_0x21ee('0x6')]));require('./user-setting.socket')['register'](socket);config[_0x21ee('0x6')]=_[_0x21ee('0x7')](config[_0x21ee('0x6')],{'host':_0x21ee('0x8'),'port':0x18eb});function respondWithResult(_0x479a60,_0x361e58){_0x361e58=_0x361e58||0xc8;return function(_0x207f5b){if(_0x207f5b){return _0x479a60[_0x21ee('0x9')](_0x361e58)[_0x21ee('0xa')](_0x207f5b);}};}function saveUpdates(_0x2d53cf){return function(_0x271ff9){if(_0x271ff9){return _0x271ff9[_0x21ee('0xb')](_0x2d53cf)[_0x21ee('0xc')](function(_0x26df7a){return _0x26df7a;});}return null;};}function handleEntityNotFound(_0x2dbb98){return function(_0x3cb4a8){if(!_0x3cb4a8){_0x2dbb98['sendStatus'](0x194);}return _0x3cb4a8;};}function handleError(_0x55df71,_0x4f087c){_0x4f087c=_0x4f087c||0x1f4;return function(_0x2994e0){logger[_0x21ee('0xd')](_0x2994e0[_0x21ee('0xe')]);if(_0x2994e0[_0x21ee('0xf')]){delete _0x2994e0['name'];}_0x55df71[_0x21ee('0x9')](_0x4f087c)[_0x21ee('0x10')](_0x2994e0);};}exports[_0x21ee('0xb')]=function(_0x3fd466,_0x200ecd){if(_0x3fd466[_0x21ee('0x11')][_0x21ee('0x12')]!=='admin')throw new Error(_0x21ee('0x13'));if(isNaN(Number(_0x3fd466[_0x21ee('0x14')]['id'])))throw new Error(_0x21ee('0x15'));return db[_0x21ee('0x16')][_0x21ee('0x17')]({'where':{'id':_0x3fd466[_0x21ee('0x14')]['id']}})['then'](handleEntityNotFound(_0x200ecd,null))[_0x21ee('0xc')](saveUpdates(_0x3fd466[_0x21ee('0x18')],null))[_0x21ee('0xc')](respondWithResult(_0x200ecd,null))[_0x21ee('0x19')](handleError(_0x200ecd,null));}; \ No newline at end of file +var _0xff96=['then','sendStatus','error','stack','name','send','user','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','json','update'];(function(_0x48e342,_0x17da10){var _0x732570=function(_0x145679){while(--_0x145679){_0x48e342['push'](_0x48e342['shift']());}};_0x732570(++_0x17da10);}(_0xff96,0x179));var _0x6ff9=function(_0xeb80e,_0x337608){_0xeb80e=_0xeb80e-0x0;var _0x68e9d7=_0xff96[_0xeb80e];return _0x68e9d7;};'use strict';var _=require(_0x6ff9('0x0'));var Redis=require(_0x6ff9('0x1'));var logger=require(_0x6ff9('0x2'))(_0x6ff9('0x3'));var config=require(_0x6ff9('0x4'));var db=require(_0x6ff9('0x5'))['db'];var socket=require(_0x6ff9('0x6'))(new Redis(config[_0x6ff9('0x7')]));require(_0x6ff9('0x8'))[_0x6ff9('0x9')](socket);config[_0x6ff9('0x7')]=_[_0x6ff9('0xa')](config['redis'],{'host':_0x6ff9('0xb'),'port':0x18eb});function respondWithResult(_0x5509ee,_0x502cf2){_0x502cf2=_0x502cf2||0xc8;return function(_0x4f982b){if(_0x4f982b){return _0x5509ee[_0x6ff9('0xc')](_0x502cf2)[_0x6ff9('0xd')](_0x4f982b);}};}function saveUpdates(_0x31747a){return function(_0x35ed8c){if(_0x35ed8c){return _0x35ed8c[_0x6ff9('0xe')](_0x31747a)[_0x6ff9('0xf')](function(_0x5e81cd){return _0x5e81cd;});}return null;};}function handleEntityNotFound(_0x27aab4){return function(_0x1e8a6d){if(!_0x1e8a6d){_0x27aab4[_0x6ff9('0x10')](0x194);}return _0x1e8a6d;};}function handleError(_0xdadc3c,_0x3763ea){_0x3763ea=_0x3763ea||0x1f4;return function(_0x153757){logger[_0x6ff9('0x11')](_0x153757[_0x6ff9('0x12')]);if(_0x153757[_0x6ff9('0x13')]){delete _0x153757['name'];}_0xdadc3c['status'](_0x3763ea)[_0x6ff9('0x14')](_0x153757);};}exports['update']=function(_0x42f056,_0x38cf3b){if(_0x42f056[_0x6ff9('0x15')]['role']!=='admin')throw new Error(_0x6ff9('0x16'));if(isNaN(Number(_0x42f056[_0x6ff9('0x17')]['id'])))throw new Error(_0x6ff9('0x18'));return db[_0x6ff9('0x19')]['find']({'where':{'id':_0x42f056['params']['id']}})[_0x6ff9('0xf')](handleEntityNotFound(_0x38cf3b,null))[_0x6ff9('0xf')](saveUpdates(_0x42f056[_0x6ff9('0x1a')],null))[_0x6ff9('0xf')](respondWithResult(_0x38cf3b,null))[_0x6ff9('0x1b')](handleError(_0x38cf3b,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 7d2fee0..035ec83 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x893a=['../../mysqldb','UserSetting','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x27da52,_0x3cd884){var _0x40be7d=function(_0x176bea){while(--_0x176bea){_0x27da52['push'](_0x27da52['shift']());}};_0x40be7d(++_0x3cd884);}(_0x893a,0x183));var _0xa893=function(_0x1d9994,_0x18ad3d){_0x1d9994=_0x1d9994-0x0;var _0x15f7ac=_0x893a[_0x1d9994];return _0x15f7ac;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xa893('0x0'))['db'][_0xa893('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xa893('0x2')](0x0);var events={'afterCreate':_0xa893('0x3'),'afterUpdate':'update','afterDestroy':_0xa893('0x4')};function emitEvent(_0x5236cf){return function(_0x9d0994,_0x36793a,_0x3ffebf){UserSettingEvents['emit'](_0x5236cf+':'+_0x9d0994['id'],_0x9d0994);UserSettingEvents[_0xa893('0x5')](_0x5236cf,_0x9d0994);_0x3ffebf(null);};}for(var e in events){if(events[_0xa893('0x6')](e)){var event=events[e];UserSetting[_0xa893('0x7')](e,emitEvent(event));}}module[_0xa893('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x3b6c=['exports','events','UserSetting','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x53ee6f,_0x1a1ed9){var _0x406f1d=function(_0x4d824f){while(--_0x4d824f){_0x53ee6f['push'](_0x53ee6f['shift']());}};_0x406f1d(++_0x1a1ed9);}(_0x3b6c,0xb5));var _0xc3b6=function(_0x4b261f,_0x55678c){_0x4b261f=_0x4b261f-0x0;var _0x20b378=_0x3b6c[_0x4b261f];return _0x20b378;};'use strict';var EventEmitter=require(_0xc3b6('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xc3b6('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xc3b6('0x2')](0x0);var events={'afterCreate':_0xc3b6('0x3'),'afterUpdate':_0xc3b6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x29efb9){return function(_0xeb80ec,_0x94030a,_0x28342f){UserSettingEvents[_0xc3b6('0x5')](_0x29efb9+':'+_0xeb80ec['id'],_0xeb80ec);UserSettingEvents['emit'](_0x29efb9,_0xeb80ec);_0x28342f(null);};}for(var e in events){if(events[_0xc3b6('0x6')](e)){var event=events[e];UserSetting[_0xc3b6('0x7')](e,emitEvent(event));}}module[_0xc3b6('0x8')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 6fdcc54..7146655 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d5b=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','exports','define','UserSetting'];(function(_0x57a4b7,_0x4e6149){var _0x5164a2=function(_0x156c5e){while(--_0x156c5e){_0x57a4b7['push'](_0x57a4b7['shift']());}};_0x5164a2(++_0x4e6149);}(_0x9d5b,0x14d));var _0xb9d5=function(_0xd18d20,_0x48e0f5){_0xd18d20=_0xd18d20-0x0;var _0x3dca74=_0x9d5b[_0xd18d20];return _0x3dca74;};'use strict';var attributes=require('./user-setting.attributes');module[_0xb9d5('0x0')]=function(_0x4388a4){return _0x4388a4[_0xb9d5('0x1')](_0xb9d5('0x2'),attributes,{'tableName':_0xb9d5('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x53b719){if(!_0x53b719[_0xb9d5('0x4')])_0x53b719['clientSideLoggingEnabledSince']=null;else if(_0x53b719[_0xb9d5('0x5')]===null)_0x53b719[_0xb9d5('0x5')]=new Date();}}});}; \ No newline at end of file +var _0x2c54=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x2378d7,_0xd46258){var _0x58dc15=function(_0x1bf0ba){while(--_0x1bf0ba){_0x2378d7['push'](_0x2378d7['shift']());}};_0x58dc15(++_0xd46258);}(_0x2c54,0x136));var _0x42c5=function(_0x145cb4,_0x8a98e){_0x145cb4=_0x145cb4-0x0;var _0x106742=_0x2c54[_0x145cb4];return _0x106742;};'use strict';var attributes=require(_0x42c5('0x0'));module[_0x42c5('0x1')]=function(_0x2dcfde){return _0x2dcfde['define'](_0x42c5('0x2'),attributes,{'tableName':_0x42c5('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d5e1d){if(!_0x3d5e1d[_0x42c5('0x4')])_0x3d5e1d[_0x42c5('0x5')]=null;else if(_0x3d5e1d[_0x42c5('0x5')]===null)_0x3d5e1d['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 5a5b884..0c2bd53 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x693b=['register','length','user-setting:','remove','update','emit','user-setting:update:user-','UserId'];(function(_0x1a873e,_0x1468c9){var _0x449e06=function(_0x18dc15){while(--_0x18dc15){_0x1a873e['push'](_0x1a873e['shift']());}};_0x449e06(++_0x1468c9);}(_0x693b,0x13b));var _0xb693=function(_0x2e0ce0,_0x1f23eb){_0x2e0ce0=_0x2e0ce0-0x0;var _0x2f3dd7=_0x693b[_0x2e0ce0];return _0x2f3dd7;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=['save',_0xb693('0x0'),_0xb693('0x1')];function createListener(_0x280d3c,_0x4713cd){return function(_0x136feb){_0x4713cd[_0xb693('0x2')](_0x280d3c,_0x136feb);if(_0x280d3c==='user-setting:update'){_0x4713cd[_0xb693('0x2')](_0xb693('0x3')+_0x136feb[_0xb693('0x4')],_0x136feb);}};}exports[_0xb693('0x5')]=function(_0x2e21f8){for(var _0x4a4680=0x0,_0x4d1ea5=events[_0xb693('0x6')];_0x4a4680<_0x4d1ea5;_0x4a4680++){var _0x57378d=events[_0x4a4680];var _0x44ca77=createListener(_0xb693('0x7')+_0x57378d,_0x2e21f8);UserSettingEvents['on'](_0x57378d,_0x44ca77);}}; \ No newline at end of file +var _0xc260=['emit','user-setting:update:user-','UserId','length','./user-setting.events','remove'];(function(_0x26fa83,_0x254e3d){var _0x13a975=function(_0x1f811d){while(--_0x1f811d){_0x26fa83['push'](_0x26fa83['shift']());}};_0x13a975(++_0x254e3d);}(_0xc260,0xb8));var _0x0c26=function(_0x4eef0a,_0x3b57d7){_0x4eef0a=_0x4eef0a-0x0;var _0x191d47=_0xc260[_0x4eef0a];return _0x191d47;};'use strict';var UserSettingEvents=require(_0x0c26('0x0'));var events=['save',_0x0c26('0x1'),'update'];function createListener(_0x301627,_0x5eac05){return function(_0x4c98be){_0x5eac05[_0x0c26('0x2')](_0x301627,_0x4c98be);if(_0x301627==='user-setting:update'){_0x5eac05['emit'](_0x0c26('0x3')+_0x4c98be[_0x0c26('0x4')],_0x4c98be);}};}exports['register']=function(_0x38a37f){for(var _0x37e0d2=0x0,_0x4b392d=events[_0x0c26('0x5')];_0x37e0d2<_0x4b392d;_0x37e0d2++){var _0x5936b2=events[_0x37e0d2];var _0x4aa533=createListener('user-setting:'+_0x5936b2,_0x38a37f);UserSettingEvents['on'](_0x5936b2,_0x4aa533);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 14a033d..ca64a62 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 _0xd58e=['removeWhatsappAccounts','removeApiKey','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','bulkCreate','/:id/queues','diskStorage','join','root','server/files/images/','format','now','originalname','single','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','update','put','/:id/password','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','/:id/sms_interactions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites'];(function(_0x188ecb,_0x2cbb01){var _0x4cb227=function(_0x5908c9){while(--_0x5908c9){_0x188ecb['push'](_0x188ecb['shift']());}};_0x4cb227(++_0x2cbb01);}(_0xd58e,0xeb));var _0xed58=function(_0x4cf574,_0x2568f7){_0x4cf574=_0x4cf574-0x0;var _0x385126=_0xd58e[_0x4cf574];return _0x385126;};'use strict';var multer=require(_0xed58('0x0'));var util=require(_0xed58('0x1'));var path=require(_0xed58('0x2'));var timeout=require('connect-timeout');var express=require(_0xed58('0x3'));var router=express[_0xed58('0x4')]();var fs_extra=require(_0xed58('0x5'));var auth=require(_0xed58('0x6'));var interaction=require(_0xed58('0x7'));var config=require(_0xed58('0x8'));var controller=require(_0xed58('0x9'));router[_0xed58('0xa')]('/',auth[_0xed58('0xb')](),controller[_0xed58('0xc')]);router['get'](_0xed58('0xd'),auth[_0xed58('0xb')](),controller[_0xed58('0xe')]);router[_0xed58('0xa')]('/whoami',auth[_0xed58('0xb')](),controller[_0xed58('0xf')]);router[_0xed58('0xa')](_0xed58('0x10'),auth[_0xed58('0xb')](),controller['getPresence']);router[_0xed58('0xa')](_0xed58('0x11'),auth[_0xed58('0xb')](),controller[_0xed58('0x12')]);router[_0xed58('0xa')]('/:id/avatar',controller[_0xed58('0x13')]);router[_0xed58('0xa')]('/:id/open_tabs',auth[_0xed58('0xb')](),controller['getOpenTabs']);router[_0xed58('0xa')](_0xed58('0x14'),auth[_0xed58('0xb')](),controller[_0xed58('0x15')]);router[_0xed58('0xa')]('/:id/queues',auth['isAuthenticated'](),controller['getQueues']);router[_0xed58('0xa')]('/:id/queues_rt',auth[_0xed58('0xb')](),controller['getVoiceQueuesRt']);router['get'](_0xed58('0x16'),auth[_0xed58('0xb')](),controller[_0xed58('0x17')]);router[_0xed58('0xa')](_0xed58('0x18'),auth[_0xed58('0xb')](),controller[_0xed58('0x19')]);router['get']('/:id/screen_recordings',auth[_0xed58('0xb')](),controller[_0xed58('0x1a')]);router[_0xed58('0xa')](_0xed58('0x1b'),auth[_0xed58('0xb')](),controller[_0xed58('0x1c')]);router[_0xed58('0xa')](_0xed58('0x1d'),auth[_0xed58('0xb')](),controller['getOpenchannelInteractions']);router[_0xed58('0xa')](_0xed58('0x1e'),auth[_0xed58('0xb')](),controller[_0xed58('0x1f')]);router[_0xed58('0xa')]('/:id/sms/interactions',auth[_0xed58('0xb')](),controller[_0xed58('0x20')]);router['get'](_0xed58('0x21'),auth[_0xed58('0xb')](),controller[_0xed58('0x22')]);router[_0xed58('0xa')](_0xed58('0x23'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router[_0xed58('0xa')](_0xed58('0x24'),auth[_0xed58('0xb')](),controller['getTeams']);router[_0xed58('0xa')](_0xed58('0x25'),auth[_0xed58('0xb')](),controller[_0xed58('0x26')]);router[_0xed58('0xa')]('/:id/agents',auth[_0xed58('0xb')](),controller[_0xed58('0x27')]);router['get']('/:id/prefixes',auth[_0xed58('0xb')](),controller[_0xed58('0x28')]);router[_0xed58('0xa')](_0xed58('0x29'),auth[_0xed58('0xb')](),controller[_0xed58('0x2a')]);router['get'](_0xed58('0x2b'),auth[_0xed58('0xb')](),controller[_0xed58('0x2c')]);router[_0xed58('0xa')](_0xed58('0x2d'),auth[_0xed58('0xb')](),controller[_0xed58('0x2e')]);router[_0xed58('0xa')]('/:id/sms_accounts',auth[_0xed58('0xb')](),controller[_0xed58('0x2f')]);router[_0xed58('0xa')]('/:id/chat_websites',auth[_0xed58('0xb')](),controller[_0xed58('0x30')]);router[_0xed58('0xa')](_0xed58('0x31'),auth[_0xed58('0xb')](),controller['getWhatsappAccounts']);router[_0xed58('0xa')](_0xed58('0x32'),auth[_0xed58('0xb')](),controller[_0xed58('0x33')]);router[_0xed58('0xa')](_0xed58('0x34'),auth['isAuthenticated'](),controller[_0xed58('0x35')]);router['get'](_0xed58('0x36'),auth[_0xed58('0xb')](),controller[_0xed58('0x37')]);router[_0xed58('0x38')](_0xed58('0x14'),auth[_0xed58('0xb')](),controller['addContacts']);router[_0xed58('0x38')]('/',auth['isAuthenticated'](),controller[_0xed58('0x39')]);router[_0xed58('0x38')]('/create_many',auth[_0xed58('0xb')](),controller[_0xed58('0x3a')]);router[_0xed58('0x38')](_0xed58('0x3b'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0xed58('0x3c')]({'destination':function(_0x4d05ea,_0x3374fc,_0x45f0c9){_0x45f0c9(null,path[_0xed58('0x3d')](config[_0xed58('0x3e')],_0xed58('0x3f')));},'filename':function(_0x128fb3,_0x153a83,_0x4b1dea){_0x4b1dea(null,util[_0xed58('0x40')]('%s-%s',Date[_0xed58('0x41')](),_0x153a83[_0xed58('0x42')]));}})});router[_0xed58('0x38')]('/:id/avatar',upload[_0xed58('0x43')]('file'),controller[_0xed58('0x44')]);router[_0xed58('0x38')](_0xed58('0x45'),auth['isAuthenticated'](),controller[_0xed58('0x46')]);router['post'](_0xed58('0x47'),auth[_0xed58('0xb')](),controller[_0xed58('0x48')]);router[_0xed58('0x38')](_0xed58('0x49'),auth[_0xed58('0xb')](),controller[_0xed58('0x4a')]);router[_0xed58('0x38')](_0xed58('0x4b'),auth[_0xed58('0xb')](),controller['unpause']);router[_0xed58('0x38')](_0xed58('0x24'),auth[_0xed58('0xb')](),controller[_0xed58('0x4c')]);router[_0xed58('0x38')](_0xed58('0x4d'),auth[_0xed58('0xb')](),controller['addChatInteractions']);router[_0xed58('0x38')](_0xed58('0x4e'),auth[_0xed58('0xb')](),controller[_0xed58('0x4f')]);router['post']('/:id/fax_interactions',auth[_0xed58('0xb')](),controller[_0xed58('0x50')]);router[_0xed58('0x38')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xed58('0x51')]);router[_0xed58('0x38')]('/:id/openchannel_interactions',auth[_0xed58('0xb')](),controller[_0xed58('0x52')]);router['post'](_0xed58('0x53'),auth[_0xed58('0xb')](),controller[_0xed58('0x54')]);router[_0xed58('0x38')](_0xed58('0x29'),auth[_0xed58('0xb')](),controller[_0xed58('0x55')]);router[_0xed58('0x38')](_0xed58('0x2b'),auth[_0xed58('0xb')](),controller[_0xed58('0x56')]);router[_0xed58('0x38')](_0xed58('0x2d'),auth[_0xed58('0xb')](),controller[_0xed58('0x57')]);router[_0xed58('0x38')](_0xed58('0x58'),auth[_0xed58('0xb')](),controller[_0xed58('0x59')]);router['post']('/:id/chat_websites',auth[_0xed58('0xb')](),controller[_0xed58('0x5a')]);router[_0xed58('0x38')](_0xed58('0x31'),auth[_0xed58('0xb')](),controller[_0xed58('0x5b')]);router[_0xed58('0x38')](_0xed58('0x32'),auth['isAuthenticated'](),controller[_0xed58('0x5c')]);router[_0xed58('0x38')]('/:id/api_key',auth[_0xed58('0xb')](),controller[_0xed58('0x5d')]);router['put'](_0xed58('0x11'),auth[_0xed58('0xb')](),controller[_0xed58('0x5e')]);router[_0xed58('0x5f')](_0xed58('0x60'),auth[_0xed58('0xb')](),controller[_0xed58('0x61')]);router[_0xed58('0x62')](_0xed58('0x3b'),auth[_0xed58('0xb')](),controller[_0xed58('0x63')]);router['delete'](_0xed58('0x24'),auth['isAuthenticated'](),controller[_0xed58('0x64')]);router[_0xed58('0x62')](_0xed58('0x11'),auth['isAuthenticated'](),controller['destroy']);router[_0xed58('0x62')](_0xed58('0x4d'),auth[_0xed58('0xb')](),controller[_0xed58('0x65')]);router[_0xed58('0x62')](_0xed58('0x4e'),auth[_0xed58('0xb')](),controller[_0xed58('0x66')]);router['delete'](_0xed58('0x67'),auth[_0xed58('0xb')](),controller['removeFaxInteractions']);router[_0xed58('0x62')](_0xed58('0x68'),auth[_0xed58('0xb')](),controller[_0xed58('0x69')]);router[_0xed58('0x62')](_0xed58('0x6a'),auth['isAuthenticated'](),controller[_0xed58('0x6b')]);router['delete'](_0xed58('0x53'),auth[_0xed58('0xb')](),controller[_0xed58('0x6c')]);router[_0xed58('0x62')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0xed58('0x62')]('/:id/mail_accounts',auth[_0xed58('0xb')](),controller['removeMailAccounts']);router[_0xed58('0x62')](_0xed58('0x2d'),auth[_0xed58('0xb')](),controller[_0xed58('0x6d')]);router['delete'](_0xed58('0x58'),auth[_0xed58('0xb')](),controller[_0xed58('0x6e')]);router[_0xed58('0x62')](_0xed58('0x6f'),auth[_0xed58('0xb')](),controller[_0xed58('0x70')]);router[_0xed58('0x62')](_0xed58('0x31'),auth[_0xed58('0xb')](),controller[_0xed58('0x71')]);router[_0xed58('0x62')]('/:id/square_projects',auth[_0xed58('0xb')](),controller['removeSquareProjects']);router['delete'](_0xed58('0x36'),auth[_0xed58('0xb')](),controller[_0xed58('0x72')]);module[_0xed58('0x73')]=router; \ No newline at end of file +var _0x0ee2=['join','server/files/images/','format','%s-%s','now','file','/:id/login','/:id/logout','logout','unpause','/:id/teams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addSquareProjects','createApiKey','update','put','/:id/password','delete','removeQueues','removeTeams','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeWhatsappAccounts','removeSquareProjects','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','/describe','isAuthenticated','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/api_key','getApiKey','post','addContacts','create','bulkCreate','addQueues'];(function(_0x4f613c,_0x425015){var _0x50cffd=function(_0x5b86f1){while(--_0x5b86f1){_0x4f613c['push'](_0x4f613c['shift']());}};_0x50cffd(++_0x425015);}(_0x0ee2,0x1df));var _0x20ee=function(_0x218b27,_0xc547a4){_0x218b27=_0x218b27-0x0;var _0xe52e0b=_0x0ee2[_0x218b27];return _0xe52e0b;};'use strict';var multer=require(_0x20ee('0x0'));var util=require(_0x20ee('0x1'));var path=require(_0x20ee('0x2'));var timeout=require(_0x20ee('0x3'));var express=require(_0x20ee('0x4'));var router=express[_0x20ee('0x5')]();var fs_extra=require(_0x20ee('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x20ee('0x7'));var config=require(_0x20ee('0x8'));var controller=require(_0x20ee('0x9'));router[_0x20ee('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x20ee('0xa')](_0x20ee('0xb'),auth[_0x20ee('0xc')](),controller[_0x20ee('0xd')]);router['get'](_0x20ee('0xe'),auth['isAuthenticated'](),controller[_0x20ee('0xf')]);router[_0x20ee('0xa')](_0x20ee('0x10'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x11')]);router[_0x20ee('0xa')](_0x20ee('0x12'),auth['isAuthenticated'](),controller[_0x20ee('0x13')]);router[_0x20ee('0xa')](_0x20ee('0x14'),controller['getAvatar']);router['get'](_0x20ee('0x15'),auth['isAuthenticated'](),controller[_0x20ee('0x16')]);router[_0x20ee('0xa')](_0x20ee('0x17'),auth[_0x20ee('0xc')](),controller['getContacts']);router[_0x20ee('0xa')](_0x20ee('0x18'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x19')]);router[_0x20ee('0xa')](_0x20ee('0x1a'),auth['isAuthenticated'](),controller[_0x20ee('0x1b')]);router[_0x20ee('0xa')](_0x20ee('0x1c'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x1d')]);router[_0x20ee('0xa')]('/:id/recordings',auth[_0x20ee('0xc')](),controller[_0x20ee('0x1e')]);router[_0x20ee('0xa')](_0x20ee('0x1f'),auth[_0x20ee('0xc')](),controller['getScreenRecordings']);router[_0x20ee('0xa')](_0x20ee('0x20'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x21')]);router[_0x20ee('0xa')](_0x20ee('0x22'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x23')]);router['get']('/:id/mail/interactions',auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x20ee('0xa')](_0x20ee('0x24'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x25')]);router[_0x20ee('0xa')](_0x20ee('0x26'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x27')]);router[_0x20ee('0xa')](_0x20ee('0x28'),auth['isAuthenticated'](),controller[_0x20ee('0x29')]);router['get']('/:id/teams',auth[_0x20ee('0xc')](),controller[_0x20ee('0x2a')]);router[_0x20ee('0xa')]('/:id/lists',auth[_0x20ee('0xc')](),controller['getLists']);router[_0x20ee('0xa')](_0x20ee('0x2b'),auth['isAuthenticated'](),controller[_0x20ee('0x2c')]);router[_0x20ee('0xa')]('/:id/prefixes',auth[_0x20ee('0xc')](),controller[_0x20ee('0x2d')]);router['get'](_0x20ee('0x2e'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x2f')]);router['get'](_0x20ee('0x30'),auth['isAuthenticated'](),controller[_0x20ee('0x31')]);router['get'](_0x20ee('0x32'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x33')]);router[_0x20ee('0xa')](_0x20ee('0x34'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x35')]);router[_0x20ee('0xa')](_0x20ee('0x36'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x37')]);router[_0x20ee('0xa')](_0x20ee('0x38'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x39')]);router['get'](_0x20ee('0x3a'),auth[_0x20ee('0xc')](),controller['getSquareProjects']);router[_0x20ee('0xa')]('/:id/scheduled_calls',auth[_0x20ee('0xc')](),controller['getScheduledCalls']);router[_0x20ee('0xa')](_0x20ee('0x3b'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x3c')]);router[_0x20ee('0x3d')]('/:id/contacts',auth[_0x20ee('0xc')](),controller[_0x20ee('0x3e')]);router['post']('/',auth[_0x20ee('0xc')](),controller[_0x20ee('0x3f')]);router['post']('/create_many',auth[_0x20ee('0xc')](),controller[_0x20ee('0x40')]);router['post'](_0x20ee('0x18'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x41')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a3a1a,_0x252f09,_0x40bf46){_0x40bf46(null,path[_0x20ee('0x42')](config['root'],_0x20ee('0x43')));},'filename':function(_0x1c94b9,_0x500642,_0x3f01b1){_0x3f01b1(null,util[_0x20ee('0x44')](_0x20ee('0x45'),Date[_0x20ee('0x46')](),_0x500642['originalname']));}})});router[_0x20ee('0x3d')](_0x20ee('0x14'),upload['single'](_0x20ee('0x47')),controller['addAvatar']);router[_0x20ee('0x3d')](_0x20ee('0x48'),auth['isAuthenticated'](),controller['login']);router['post'](_0x20ee('0x49'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x4a')]);router[_0x20ee('0x3d')]('/:id/pause',auth[_0x20ee('0xc')](),controller['pause']);router[_0x20ee('0x3d')]('/:id/unpause',auth[_0x20ee('0xc')](),controller[_0x20ee('0x4b')]);router[_0x20ee('0x3d')](_0x20ee('0x4c'),auth[_0x20ee('0xc')](),controller['addTeams']);router[_0x20ee('0x3d')]('/:id/chat_interactions',auth[_0x20ee('0xc')](),controller[_0x20ee('0x4d')]);router[_0x20ee('0x3d')](_0x20ee('0x4e'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x4f')]);router[_0x20ee('0x3d')](_0x20ee('0x50'),auth['isAuthenticated'](),controller['addFaxInteractions']);router['post'](_0x20ee('0x51'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x52')]);router[_0x20ee('0x3d')](_0x20ee('0x53'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x54')]);router[_0x20ee('0x3d')](_0x20ee('0x55'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x56')]);router['post'](_0x20ee('0x2e'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x57')]);router[_0x20ee('0x3d')]('/:id/mail_accounts',auth[_0x20ee('0xc')](),controller[_0x20ee('0x58')]);router[_0x20ee('0x3d')](_0x20ee('0x32'),auth['isAuthenticated'](),controller[_0x20ee('0x59')]);router['post'](_0x20ee('0x34'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x5a')]);router[_0x20ee('0x3d')](_0x20ee('0x36'),auth[_0x20ee('0xc')](),controller['addChatWebsites']);router[_0x20ee('0x3d')](_0x20ee('0x38'),auth[_0x20ee('0xc')](),controller['addWhatsappAccounts']);router['post'](_0x20ee('0x3a'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x5b')]);router['post'](_0x20ee('0x3b'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x5c')]);router['put'](_0x20ee('0x12'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x5d')]);router[_0x20ee('0x5e')](_0x20ee('0x5f'),auth[_0x20ee('0xc')](),controller['changePassword']);router[_0x20ee('0x60')](_0x20ee('0x18'),auth['isAuthenticated'](),controller[_0x20ee('0x61')]);router[_0x20ee('0x60')](_0x20ee('0x4c'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x62')]);router[_0x20ee('0x60')](_0x20ee('0x12'),auth['isAuthenticated'](),controller['destroy']);router[_0x20ee('0x60')](_0x20ee('0x63'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x64')]);router[_0x20ee('0x60')](_0x20ee('0x4e'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x65')]);router[_0x20ee('0x60')](_0x20ee('0x50'),auth[_0x20ee('0xc')](),controller['removeFaxInteractions']);router[_0x20ee('0x60')](_0x20ee('0x51'),auth['isAuthenticated'](),controller[_0x20ee('0x66')]);router[_0x20ee('0x60')](_0x20ee('0x53'),auth[_0x20ee('0xc')](),controller['removeOpenchannelInteractions']);router['delete']('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x20ee('0x67')]);router[_0x20ee('0x60')]('/:id/fax_accounts',auth[_0x20ee('0xc')](),controller[_0x20ee('0x68')]);router['delete'](_0x20ee('0x30'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x69')]);router['delete'](_0x20ee('0x32'),auth['isAuthenticated'](),controller[_0x20ee('0x6a')]);router['delete'](_0x20ee('0x34'),auth[_0x20ee('0xc')](),controller['removeSmsAccounts']);router[_0x20ee('0x60')](_0x20ee('0x36'),auth[_0x20ee('0xc')](),controller['removeChatWebsites']);router['delete'](_0x20ee('0x38'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x6b')]);router[_0x20ee('0x60')](_0x20ee('0x3a'),auth[_0x20ee('0xc')](),controller[_0x20ee('0x6c')]);router[_0x20ee('0x60')](_0x20ee('0x3b'),auth['isAuthenticated'](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 847aa68..e7a322c 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 _0x91ba=['force_avp','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','user','peer','from-sip','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','nonat','update,nonat','showWebBar','isArray','wss','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','encryption'];(function(_0x12d836,_0x3588e8){var _0x45a500=function(_0x1f65e7){while(--_0x1f65e7){_0x12d836['push'](_0x12d836['shift']());}};_0x45a500(++_0x3588e8);}(_0x91ba,0x12c));var _0xa91b=function(_0x1ac039,_0x46ab41){_0x1ac039=_0x1ac039-0x0;var _0x5c93d3=_0x91ba[_0x1ac039];return _0x5c93d3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa91b('0x0'));var util=require(_0xa91b('0x1'));var _=require(_0xa91b('0x2'));module[_0xa91b('0x3')]={'name':{'type':Sequelize[_0xa91b('0x4')],'allowNull':![],'unique':_0xa91b('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4bac08){this[_0xa91b('0x6')](_0xa91b('0x5'),_0x4bac08);this[_0xa91b('0x6')](_0xa91b('0x7'),_0x4bac08);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xa91b('0x4')],'allowNull':![],'set':function(_0x4a213f){this['setDataValue'](_0xa91b('0x8'),_0x4a213f);this[_0xa91b('0x6')](_0xa91b('0x9'),util[_0xa91b('0xa')](_0xa91b('0xb'),_0x4a213f,this[_0xa91b('0xc')](_0xa91b('0xd'))));}},'alias':{'type':Sequelize[_0xa91b('0x4')]},'email':{'type':Sequelize[_0xa91b('0x4')],'allowNull':![],'unique':_0xa91b('0xe'),'validate':{'isEmail':!![]},'set':function(_0x183ded){if(_0x183ded){this[_0xa91b('0x6')]('email',_0x183ded[_0xa91b('0xf')]());}}},'role':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x11'),'user',_0xa91b('0x12'),_0xa91b('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xa91b('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xa91b('0x14')},'internal':{'type':Sequelize[_0xa91b('0x15')](0xb),'allowNull':![],'unique':'internal','set':function(_0x239683){this['setDataValue'](_0xa91b('0xd'),_0x239683);this[_0xa91b('0x6')]('accountcode',_0x239683);this[_0xa91b('0x6')](_0xa91b('0x9'),util[_0xa91b('0xa')](_0xa91b('0xb'),this[_0xa91b('0xc')](_0xa91b('0x8')),_0x239683));}},'salt':{'type':Sequelize[_0xa91b('0x4')]},'phone':{'type':Sequelize[_0xa91b('0x4')]},'mobile':{'type':Sequelize[_0xa91b('0x4')]},'address':{'type':Sequelize[_0xa91b('0x4')]},'zipcode':{'type':Sequelize[_0xa91b('0x4')]},'userpic':{'type':Sequelize[_0xa91b('0x4')]},'city':{'type':Sequelize[_0xa91b('0x4')]},'country':{'type':Sequelize[_0xa91b('0x4')]},'online':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xa91b('0x17')]},'voicePause':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xa91b('0x4')],'defaultValue':_0xa91b('0x18')},'lastPauseAt':{'type':Sequelize[_0xa91b('0x17')]},'chatCapacity':{'type':Sequelize[_0xa91b('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xa91b('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xa91b('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xa91b('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xa91b('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xa91b('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xa91b('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xa91b('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![],'defaultValue':_0xa91b('0x19')},'ipaddr':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xa91b('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xa91b('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xa91b('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x1a'),_0xa91b('0x1b'),_0xa91b('0x1c')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![],'defaultValue':_0xa91b('0x1d')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0xa91b('0x1e'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0xa91b('0x1f'),_0xa91b('0x20'),_0xa91b('0x21'),_0xa91b('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa91b('0x23'),'set':function(_0x545a54){this[_0xa91b('0x6')](_0xa91b('0x24'),_0x545a54?_0x545a54[_0xa91b('0x25')](','):null);},'get':function(){return this[_0xa91b('0xc')](_0xa91b('0x24'))?this[_0xa91b('0xc')](_0xa91b('0x24'))[_0xa91b('0x26')](','):null;},'comment':_0xa91b('0x27')},'dtmfmode':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x28'),_0xa91b('0x29'),_0xa91b('0x2a'),_0xa91b('0x2b'),_0xa91b('0x2c')),'allowNull':!![],'defaultValue':_0xa91b('0x28')},'directmedia':{'type':Sequelize['ENUM'](_0xa91b('0x2d'),'no','nonat','update',_0xa91b('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa91b('0x2f'),'set':function(_0x53ae15){this[_0xa91b('0x6')](_0xa91b('0x30'),_0x53ae15?_0x53ae15['join'](','):null);},'get':function(){return this[_0xa91b('0xc')]('nat')?this['getDataValue'](_0xa91b('0x30'))[_0xa91b('0x26')](','):null;},'comment':_0xa91b('0x31')},'callgroup':{'type':Sequelize[_0xa91b('0x4')]},'namedcallgroup':{'type':Sequelize[_0xa91b('0x4')]},'pickupgroup':{'type':Sequelize[_0xa91b('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xa91b('0x4')]},'language':{'type':Sequelize[_0xa91b('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa91b('0x4')]},'disallow':{'type':Sequelize[_0xa91b('0x4')],'allowNull':![],'defaultValue':_0xa91b('0x32')},'allow':{'type':Sequelize[_0xa91b('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x2598a9){this[_0xa91b('0x6')](_0xa91b('0x33'),_0x2598a9?_0x2598a9[_0xa91b('0x25')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0xa91b('0x33'))?this['getDataValue'](_0xa91b('0x33'))[_0xa91b('0x26')](';'):null;},'comment':_0xa91b('0x34')},'autoframing':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x25c98f){this['setDataValue'](_0xa91b('0x35'),_0x25c98f?_0x25c98f[_0xa91b('0x25')](','):null);},'get':function(){return this[_0xa91b('0xc')](_0xa91b('0x35'))?this[_0xa91b('0xc')](_0xa91b('0x35'))[_0xa91b('0x26')](','):null;},'comment':_0xa91b('0x36')},'trustrpid':{'type':Sequelize['ENUM'](_0xa91b('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xa91b('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa91b('0x10')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![],'defaultValue':_0xa91b('0x37')},'amaflags':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![],'defaultValue':_0xa91b('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xa91b('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no',_0xa91b('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa91b('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xa91b('0x39'),_0xa91b('0x3a'),_0xa91b('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xa91b('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xa91b('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x3c'),_0xa91b('0x3d')),'allowNull':!![],'defaultValue':_0xa91b('0x3d')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xa91b('0x2d'),'no'),'allowNull':!![],'defaultValue':_0xa91b('0x2d')},'keepalive':{'type':Sequelize[_0xa91b('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xa91b('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xa91b('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xa91b('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xa91b('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no',_0xa91b('0x3e'),_0xa91b('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xa91b('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x40'),_0xa91b('0x41'),_0xa91b('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xa91b('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xa91b('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xa91b('0x10')](_0xa91b('0x2d'),'no',_0xa91b('0x43'),'update',_0xa91b('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xa91b('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xa91b('0x17')]},'passwordResetAt':{'type':Sequelize[_0xa91b('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xa91b('0x15')],'defaultValue':0x0,'set':function(_0x4e7fd1){this['setDataValue'](_0xa91b('0x45'),_0x4e7fd1);var _0x4b74bb=this['get']({'plain':!![]});switch(_0x4e7fd1){case 0x0:case 0x1:var _0x58e004=_0x4b74bb[_0xa91b('0x24')]?_[_0xa91b('0x46')](_0x4b74bb['transport'])?_0x4b74bb[_0xa91b('0x24')][_0xa91b('0x25')]():_0x4b74bb[_0xa91b('0x24')]:_0xa91b('0x23');if(_0x58e004===_0xa91b('0x47')){_0x58e004='udp';}this[_0xa91b('0x6')](_0xa91b('0x24'),_0x58e004);this['setDataValue']('encryption','no');this[_0xa91b('0x6')](_0xa91b('0x48'),null);this[_0xa91b('0x6')]('force_avp',null);this[_0xa91b('0x6')](_0xa91b('0x49'),null);this[_0xa91b('0x6')](_0xa91b('0x4a'),null);this['setDataValue'](_0xa91b('0x4b'),null);this[_0xa91b('0x6')](_0xa91b('0x4c'),null);this[_0xa91b('0x6')](_0xa91b('0x4d'),null);this[_0xa91b('0x6')]('dtlsprivatekey',null);this[_0xa91b('0x6')](_0xa91b('0x4e'),'no');break;case 0x2:this[_0xa91b('0x6')](_0xa91b('0x24'),_0xa91b('0x47'));this[_0xa91b('0x6')](_0xa91b('0x4f'),'yes');this[_0xa91b('0x6')](_0xa91b('0x48'),'yes');this[_0xa91b('0x6')](_0xa91b('0x50'),_0xa91b('0x2d'));this['setDataValue'](_0xa91b('0x49'),_0xa91b('0x2d'));this['setDataValue'](_0xa91b('0x4a'),_0xa91b('0x2d'));this['setDataValue'](_0xa91b('0x4b'),'no');this[_0xa91b('0x6')]('dtlssetup',_0xa91b('0x42'));this[_0xa91b('0x6')](_0xa91b('0x4d'),_0x4b74bb[_0xa91b('0x4d')]||_0xa91b('0x51'));this['setDataValue'](_0xa91b('0x52'),_0x4b74bb[_0xa91b('0x52')]||_0xa91b('0x53'));this[_0xa91b('0x6')](_0xa91b('0x4e'),_0xa91b('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0xa91b('0x54')],'set':function(_0x3e9a28){this[_0xa91b('0x6')](_0xa91b('0x55'),_0x3e9a28?_0x3e9a28[_0xa91b('0x25')](','):[]);},'get':function(){return this[_0xa91b('0xc')]('permissions')?_[_0xa91b('0x56')](this[_0xa91b('0xc')]('permissions')[_0xa91b('0x26')](','),function(_0x140cf){return parseInt(_0x140cf,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xa91b('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xa91b('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xa91b('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xa91b('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xa91b('0x10')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xa91b('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xa91b('0x57')],'get':function(){return this[_0xa91b('0xc')]('phoneBarEnableScreenRecordingByAgent')?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xa91b('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xa91b('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![],'set':function(_0x2408af){if(typeof _0x2408af==='string'){var _0x946298=_0x2408af==='1'?!![]:_0x2408af==='0'?![]:_0x2408af===_0xa91b('0x58')?!![]:_0x2408af===_0xa91b('0x59')?![]:![];this[_0xa91b('0x6')]('screenrecording',_0x946298);}else{this['setDataValue'](_0xa91b('0x5a'),_0x2408af);}}},'blocked':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![],'set':function(_0x5746b3){this[_0xa91b('0x6')](_0xa91b('0x5b'),_0x5746b3);if(_0x5746b3===!![]){this[_0xa91b('0x6')](_0xa91b('0x5c'),moment());this['setDataValue'](_0xa91b('0x5d'),0x0);}else{this['setDataValue'](_0xa91b('0x5c'),null);}}},'blockedAt':{'type':Sequelize[_0xa91b('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xa91b('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xa91b('0x15')](0x5)[_0xa91b('0x5e')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xa91b('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0xa665=['force_avp','dtlsverify','dtlscertfile','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','UNSIGNED','util','lodash','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','STRING','email','toLowerCase','ENUM','admin','user','agent','local','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','split','rfc2833','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','accept','refuse','uas','fingerprint','certificate','active','passive','actpass','nonat','update,nonat','showWebBar','get','isArray','wss','avpf','icesupport','dtlssetup','dtlsprivatekey','rtcp_mux'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa665,0x1bb));var _0x5a66=function(_0x4e98fb,_0x5709f5){_0x4e98fb=_0x4e98fb-0x0;var _0x132c42=_0xa665[_0x4e98fb];return _0x132c42;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x5a66('0x0'));var _=require(_0x5a66('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5a66('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x346bb8){this[_0x5a66('0x3')](_0x5a66('0x2'),_0x346bb8);this[_0x5a66('0x3')](_0x5a66('0x4'),_0x346bb8);},'comment':_0x5a66('0x5')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x41ade8){this[_0x5a66('0x3')](_0x5a66('0x6'),_0x41ade8);this[_0x5a66('0x3')](_0x5a66('0x7'),util[_0x5a66('0x8')](_0x5a66('0x9'),_0x41ade8,this[_0x5a66('0xa')](_0x5a66('0xb'))));}},'alias':{'type':Sequelize[_0x5a66('0xc')]},'email':{'type':Sequelize[_0x5a66('0xc')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x4fdffe){if(_0x4fdffe){this[_0x5a66('0x3')](_0x5a66('0xd'),_0x4fdffe[_0x5a66('0xe')]());}}},'role':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x10'),_0x5a66('0x11'),_0x5a66('0x12'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x5a66('0xc')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x5a66('0xc')],'defaultValue':_0x5a66('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x5a66('0xb'),'set':function(_0x43d24b){this[_0x5a66('0x3')](_0x5a66('0xb'),_0x43d24b);this[_0x5a66('0x3')](_0x5a66('0x14'),_0x43d24b);this['setDataValue'](_0x5a66('0x7'),util[_0x5a66('0x8')](_0x5a66('0x9'),this[_0x5a66('0xa')]('fullname'),_0x43d24b));}},'salt':{'type':Sequelize[_0x5a66('0xc')]},'phone':{'type':Sequelize[_0x5a66('0xc')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x5a66('0xc')]},'userpic':{'type':Sequelize[_0x5a66('0xc')]},'city':{'type':Sequelize[_0x5a66('0xc')]},'country':{'type':Sequelize[_0x5a66('0xc')]},'online':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x5a66('0x16')]},'voicePause':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x5a66('0xc')],'defaultValue':_0x5a66('0x17')},'lastPauseAt':{'type':Sequelize[_0x5a66('0x16')]},'chatCapacity':{'type':Sequelize[_0x5a66('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x5a66('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x5a66('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x5a66('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x5a66('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x5a66('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'host':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![],'defaultValue':_0x5a66('0x19')},'ipaddr':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'port':{'type':Sequelize[_0x5a66('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x1a'),'user',_0x5a66('0x1b')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![],'defaultValue':_0x5a66('0x1c')},'callingpres':{'type':Sequelize[_0x5a66('0xf')]('ALLOWED_NOT_SCREENED',_0x5a66('0x1d'),_0x5a66('0x1e'),'ALLOWED',_0x5a66('0x1f'),_0x5a66('0x20'),_0x5a66('0x21'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'permit':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'transport':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![],'defaultValue':_0x5a66('0x22'),'set':function(_0x3e35c3){this['setDataValue'](_0x5a66('0x23'),_0x3e35c3?_0x3e35c3[_0x5a66('0x24')](','):null);},'get':function(){return this[_0x5a66('0xa')](_0x5a66('0x23'))?this[_0x5a66('0xa')](_0x5a66('0x23'))[_0x5a66('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x26'),'info',_0x5a66('0x27'),_0x5a66('0x28'),_0x5a66('0x29')),'allowNull':!![],'defaultValue':_0x5a66('0x26')},'directmedia':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no','nonat',_0x5a66('0x2b'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x5a66('0x2c'),'set':function(_0x55e7fa){this[_0x5a66('0x3')](_0x5a66('0x2d'),_0x55e7fa?_0x55e7fa['join'](','):null);},'get':function(){return this[_0x5a66('0xa')](_0x5a66('0x2d'))?this[_0x5a66('0xa')]('nat')[_0x5a66('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x5a66('0xc')]},'namedcallgroup':{'type':Sequelize[_0x5a66('0xc')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x5a66('0xc')]},'language':{'type':Sequelize[_0x5a66('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x5a66('0xc')],'allowNull':![],'defaultValue':_0x5a66('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5a66('0x2f'),'set':function(_0x419ed4){this['setDataValue']('allow',_0x419ed4?_0x419ed4[_0x5a66('0x24')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x5a66('0x30'))?this['getDataValue'](_0x5a66('0x30'))[_0x5a66('0x25')](';'):null;},'comment':_0x5a66('0x31')},'autoframing':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![],'set':function(_0x424ffd){this[_0x5a66('0x3')]('insecure',_0x424ffd?_0x424ffd[_0x5a66('0x24')](','):null);},'get':function(){return this[_0x5a66('0xa')](_0x5a66('0x32'))?this['getDataValue']('insecure')[_0x5a66('0x25')](','):null;},'comment':_0x5a66('0x33')},'trustrpid':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x5a66('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no',_0x5a66('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x5a66('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x5a66('0x35')},'amaflags':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x5a66('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x5a66('0x2a')},'busylevel':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x5a66('0xf')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'template':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x5a66('0xf')]('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x36'),_0x5a66('0x37'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x5a66('0x38')),'allowNull':!![],'defaultValue':_0x5a66('0x38')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x5a66('0x2a')},'keepalive':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x5a66('0xf')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x5a66('0x2a'),'no',_0x5a66('0x39'),_0x5a66('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x5a66('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x3b'),_0x5a66('0x3c'),_0x5a66('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no',_0x5a66('0x3e'),_0x5a66('0x2b'),_0x5a66('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x5a66('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x5a66('0x18')],'defaultValue':0x0,'set':function(_0x3a3657){this[_0x5a66('0x3')](_0x5a66('0x40'),_0x3a3657);var _0x2158f3=this[_0x5a66('0x41')]({'plain':!![]});switch(_0x3a3657){case 0x0:case 0x1:var _0x510614=_0x2158f3[_0x5a66('0x23')]?_[_0x5a66('0x42')](_0x2158f3['transport'])?_0x2158f3['transport'][_0x5a66('0x24')]():_0x2158f3['transport']:_0x5a66('0x22');if(_0x510614===_0x5a66('0x43')){_0x510614=_0x5a66('0x22');}this['setDataValue'](_0x5a66('0x23'),_0x510614);this['setDataValue']('encryption','no');this['setDataValue'](_0x5a66('0x44'),null);this[_0x5a66('0x3')]('force_avp',null);this['setDataValue'](_0x5a66('0x45'),null);this[_0x5a66('0x3')]('dtlsenable',null);this[_0x5a66('0x3')]('dtlsverify',null);this[_0x5a66('0x3')](_0x5a66('0x46'),null);this[_0x5a66('0x3')]('dtlscertfile',null);this['setDataValue'](_0x5a66('0x47'),null);this[_0x5a66('0x3')](_0x5a66('0x48'),'no');break;case 0x2:this['setDataValue'](_0x5a66('0x23'),_0x5a66('0x43'));this[_0x5a66('0x3')]('encryption',_0x5a66('0x2a'));this[_0x5a66('0x3')](_0x5a66('0x44'),'yes');this[_0x5a66('0x3')](_0x5a66('0x49'),_0x5a66('0x2a'));this[_0x5a66('0x3')](_0x5a66('0x45'),_0x5a66('0x2a'));this[_0x5a66('0x3')]('dtlsenable','yes');this['setDataValue'](_0x5a66('0x4a'),'no');this[_0x5a66('0x3')](_0x5a66('0x46'),_0x5a66('0x3d'));this[_0x5a66('0x3')](_0x5a66('0x4b'),_0x2158f3[_0x5a66('0x4b')]||'/etc/pki/tls/certs/motion.crt');this[_0x5a66('0x3')](_0x5a66('0x47'),_0x2158f3[_0x5a66('0x47')]||_0x5a66('0x4c'));this[_0x5a66('0x3')](_0x5a66('0x48'),_0x5a66('0x2a'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x23be0c){this[_0x5a66('0x3')]('permissions',_0x23be0c?_0x23be0c[_0x5a66('0x24')](','):[]);},'get':function(){return this[_0x5a66('0xa')](_0x5a66('0x4d'))?_['map'](this['getDataValue'](_0x5a66('0x4d'))[_0x5a66('0x25')](','),function(_0x277c5f){return parseInt(_0x277c5f,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x5a66('0xc')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x5a66('0xc')]},'phoneBarBusyNumber':{'type':Sequelize[_0x5a66('0xc')]},'phoneBarUnconditional':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x5a66('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x5a66('0xc')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x5a66('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x5a66('0xf')](_0x5a66('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x5a66('0xc')]},'phoneBarEnableJaws':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x5a66('0x4e')],'get':function(){return this['getDataValue'](_0x5a66('0x4f'))?this[_0x5a66('0xa')](_0x5a66('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x5a66('0xc')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x5a66('0xc')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![],'set':function(_0x23c15f){if(typeof _0x23c15f===_0x5a66('0x50')){var _0x5b2a30=_0x23c15f==='1'?!![]:_0x23c15f==='0'?![]:_0x23c15f===_0x5a66('0x51')?!![]:_0x23c15f===_0x5a66('0x52')?![]:![];this[_0x5a66('0x3')](_0x5a66('0x53'),_0x5b2a30);}else{this[_0x5a66('0x3')](_0x5a66('0x53'),_0x23c15f);}}},'blocked':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![],'set':function(_0x2c6996){this[_0x5a66('0x3')]('blocked',_0x2c6996);if(_0x2c6996===!![]){this[_0x5a66('0x3')]('blockedAt',moment());this[_0x5a66('0x3')]('loginAttempts',0x0);}else{this[_0x5a66('0x3')](_0x5a66('0x54'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x5a66('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x5a66('0x18')](0x5)[_0x5a66('0x55')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x5a66('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 04c3f80..f2bd947 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 _0x7d86=['filename','getAvatar','join','root','userpic','download','getOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','order','sort','pick','merge','CmList','List','Tag','color','tag','hasOwnProperty','nolimit','limit','getQueues','Queue','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','LOCAL/%s@from-sip/n','intrf','user:%s','headers','x-forwarded-for','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','LOGININPAUSE','MemberReport','resolve','logout','pause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','voicePause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','QueuePause','manual','Pause','getTeams','Team','addTeams','setDataValue','getMailQueues','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','Openchannel','flatten','transaction','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getChatQueues','Chat','Mail','getOpenchannelQueues','removeAgent','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','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:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','CmHopper','lastName','phone','Contact','dialActive','VoiceQueue','getApiKey','token','No\x20API\x20access\x20key\x20found!','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getUserSetting','queues','teams','inbound','lower','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','field','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','moment','bluebird','util','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','socket.io-emitter','redis','./user.socket','register','defaults','localhost','request','then','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','undefined','count','offset','set','Content-Range','update','admin','Users','user','Agents','agent','Telephones','telephone','filter','ignore','value','includes','name','destroy','sendStatus','stack','index','User','rawAttributes','map','fieldName','key','salt','where','query','include','userSetting','true','UserSetting','attributes','push','rows','length','dataValues','sms','fax','mail','openchannel','whatsapp','show','params','model','differenceBy','keys','password','filters','intersection','fields','includeAll','options','find','openTabs','chat','all','body','role','describe','addContacts','ids','omit','internal','Setting','securePassword','validatePasswordPattern','isNil','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','sequelize','QueryTypes','from','mailbox','VoiceMail','fullname','email','permissions','101','102','103','110','104','105','107','108','109','100','114','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','create','UserProfileSection','autoAssociation','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','findAll','isEmpty','compact','UserProfileResource','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','addQueues','channel','loginInPause','interface','isValidChannel','add','Queues','penalty','spread','QueueId','emit','capitalize','toLowerCase','Queue:save','voice','get','online','format','SIP/%s','UserVoiceQueueRt','Unknown\x20channel','Queue:remove','file'];(function(_0x4efbf7,_0x4d2e49){var _0x418428=function(_0xf39b07){while(--_0xf39b07){_0x4efbf7['push'](_0x4efbf7['shift']());}};_0x418428(++_0x4d2e49);}(_0x7d86,0xe7));var _0x67d8=function(_0x111e43,_0x562299){_0x111e43=_0x111e43-0x0;var _0x445ed7=_0x7d86[_0x111e43];return _0x445ed7;};'use strict';var moment=require(_0x67d8('0x0'));var BPromise=require(_0x67d8('0x1'));var util=require(_0x67d8('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x67d8('0x3'));var jayson=require(_0x67d8('0x4'));var Redis=require('ioredis');var authService=require(_0x67d8('0x5'));var qs=require(_0x67d8('0x6'));var logger=require('../../config/logger')(_0x67d8('0x7'));var utils=require('../../config/utils');var config=require(_0x67d8('0x8'));var licenseUtil=require(_0x67d8('0x9'));var db=require('../../mysqldb')['db'];var socket=require(_0x67d8('0xa'))(new Redis(config[_0x67d8('0xb')]));require(_0x67d8('0xc'))[_0x67d8('0xd')](socket);config[_0x67d8('0xb')]=_[_0x67d8('0xe')](config['redis'],{'host':_0x67d8('0xf'),'port':0x18eb});var client=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x387927,_0x119cb6,_0x2ef5c4,_0x4c1414){return new BPromise(function(_0x4fe68f,_0x5ebc99){var _0x3766c9=_0x4c1414||client;return _0x3766c9[_0x67d8('0x10')](_0x387927,_0x2ef5c4)[_0x67d8('0x11')](function(_0x49b854){logger['info'](_0x67d8('0x12'),_0x119cb6,_0x67d8('0x13'));logger[_0x67d8('0x14')](_0x67d8('0x15'),_0x119cb6,'request\x20sent',JSON[_0x67d8('0x16')](_0x49b854));if(_0x49b854[_0x67d8('0x17')]){if(_0x49b854[_0x67d8('0x17')]['code']===0x1f4){logger[_0x67d8('0x17')](_0x67d8('0x12'),_0x119cb6,_0x49b854['error'][_0x67d8('0x18')]);return _0x5ebc99(_0x49b854['error']['message']);}logger[_0x67d8('0x17')](_0x67d8('0x12'),_0x119cb6,_0x49b854[_0x67d8('0x17')][_0x67d8('0x18')]);return _0x4fe68f(_0x49b854[_0x67d8('0x17')][_0x67d8('0x18')]);}else{logger['info']('User,\x20%s,\x20%s',_0x119cb6,_0x67d8('0x13'));_0x4fe68f(_0x49b854[_0x67d8('0x19')][_0x67d8('0x18')]);}})[_0x67d8('0x1a')](function(_0x583656){logger['error'](_0x67d8('0x12'),_0x119cb6,_0x583656);_0x5ebc99(_0x583656);});});}function respondWithStatusCode(_0x596c0c,_0x3f01dc){_0x3f01dc=_0x3f01dc||0xcc;return function(_0x56502d){if(_0x56502d){return _0x596c0c['sendStatus'](_0x3f01dc);}return _0x596c0c[_0x67d8('0x1b')](_0x3f01dc)[_0x67d8('0x1c')]();};}function respondWithResult(_0x21f0b9,_0x2eebd1){_0x2eebd1=_0x2eebd1||0xc8;return function(_0x2f06ed){if(_0x2f06ed){return _0x21f0b9['status'](_0x2eebd1)[_0x67d8('0x1d')](_0x2f06ed);}};}function respondWithFilteredResult(_0x371da9,_0x5a97c1){return function(_0x4c8c7e){if(_0x4c8c7e){var _0x4f2155=typeof _0x5a97c1['offset']===_0x67d8('0x1e')&&typeof _0x5a97c1['limit']===_0x67d8('0x1e');var _0x4bbbd1=_0x4c8c7e[_0x67d8('0x1f')];var _0x37ccb2=_0x4f2155?0x0:_0x5a97c1['offset'];var _0x3cb08d=_0x4f2155?_0x4c8c7e[_0x67d8('0x1f')]:_0x5a97c1[_0x67d8('0x20')]+_0x5a97c1['limit'];var _0x5e119e;if(_0x3cb08d>=_0x4bbbd1){_0x3cb08d=_0x4bbbd1;_0x5e119e=0xc8;}else{_0x5e119e=0xce;}_0x371da9['status'](_0x5e119e);return _0x371da9[_0x67d8('0x21')](_0x67d8('0x22'),_0x37ccb2+'-'+_0x3cb08d+'/'+_0x4bbbd1)[_0x67d8('0x1d')](_0x4c8c7e);}return null;};}function saveUpdates(_0x537057){return function(_0x2bb9a2){if(_0x2bb9a2){return _0x2bb9a2[_0x67d8('0x23')](_0x537057)[_0x67d8('0x11')](function(_0x369906){return _0x369906;});}return null;};}function removeEntity(_0x2e8ec0){return function(_0xbc3cbd){if(_0xbc3cbd){return _0xbc3cbd['destroy']()['then'](function(){var _0x3d5811=_0xbc3cbd['get']({'plain':!![]});if(_0x3d5811['role']===_0x67d8('0x24'))return;var _0x34a935=[{'name':_0x67d8('0x25'),'value':_0x67d8('0x26'),'ignore':!![]},{'name':_0x67d8('0x27'),'value':_0x67d8('0x28'),'ignore':![]},{'name':_0x67d8('0x29'),'value':_0x67d8('0x2a'),'ignore':![]}];var _0x4bea15=_(_0x34a935)[_0x67d8('0x2b')](_0x67d8('0x2c'))['map'](_0x67d8('0x2d'))['value']();if(_[_0x67d8('0x2e')](_0x4bea15,_0x3d5811['role'])){return;}var _0x444898=_['find'](_0x34a935,['value',_0x3d5811['role']])[_0x67d8('0x2f')];return db['UserProfileResource'][_0x67d8('0x30')]({'where':{'type':_0x444898,'resourceId':_0x3d5811['id']}})['then'](function(){return _0xbc3cbd;});})[_0x67d8('0x11')](function(){_0x2e8ec0[_0x67d8('0x1b')](0xcc)[_0x67d8('0x1c')]();});}};}function handleEntityNotFound(_0xe027dc){return function(_0x44e05b){if(!_0x44e05b){_0xe027dc[_0x67d8('0x31')](0x194);}return _0x44e05b;};}function handleError(_0x3d26f3,_0x3ef5b7){_0x3ef5b7=_0x3ef5b7||0x1f4;return function(_0x427640){logger[_0x67d8('0x17')](_0x427640[_0x67d8('0x32')]);if(_0x427640[_0x67d8('0x2f')]){delete _0x427640[_0x67d8('0x2f')];}_0x3d26f3[_0x67d8('0x1b')](_0x3ef5b7)['send'](_0x427640);};}exports[_0x67d8('0x33')]=function(_0x180206,_0x18475f){var _0x4de5be={},_0x1307c5={'count':0x0,'rows':[]};var _0x51a7a0=_(db[_0x67d8('0x34')][_0x67d8('0x35')])[_0x67d8('0x36')](function(_0x518572){return{'name':_0x518572[_0x67d8('0x37')],'type':_0x518572['type'][_0x67d8('0x38')]};})[_0x67d8('0x2b')](function(_0x4395c0){return!_[_0x67d8('0x2e')](['password',_0x67d8('0x39')],_0x4395c0[_0x67d8('0x2f')]);})[_0x67d8('0x2d')]();_0x4de5be=qs['getOptions'](_0x51a7a0,_0x180206);var _0x4a1d8c={'where':_0x4de5be[_0x67d8('0x3a')]};return db['User'][_0x67d8('0x1f')](_0x4a1d8c)[_0x67d8('0x11')](function(_0x42e293){_0x1307c5['count']=_0x42e293;if(_0x180206[_0x67d8('0x3b')]['includeAll']){_0x4de5be[_0x67d8('0x3c')]=[{'all':!![]}];}if(_0x180206[_0x67d8('0x3b')][_0x67d8('0x3d')]===_0x67d8('0x3e')){_0x4de5be[_0x67d8('0x3c')]=[{'model':db[_0x67d8('0x3f')],'as':_0x67d8('0x3d')}];}if(!_['includes'](_0x4de5be[_0x67d8('0x40')],'id')){_0x4de5be[_0x67d8('0x40')][_0x67d8('0x41')]('id');}return db[_0x67d8('0x34')]['findAll'](_0x4de5be);})['then'](function(_0x57b946){_0x1307c5[_0x67d8('0x42')]=_0x57b946;if(_0x180206['query']['openTabs']===_0x67d8('0x3e')){var _0x2bb6da=[];for(var _0x4080f2=0x0;_0x4080f2<_0x1307c5['rows'][_0x67d8('0x43')];_0x4080f2++){_0x2bb6da[_0x67d8('0x41')](get_open_tabs('chat',_0x1307c5[_0x67d8('0x42')][_0x4080f2][_0x67d8('0x44')]));_0x2bb6da[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x45'),_0x1307c5[_0x67d8('0x42')][_0x4080f2][_0x67d8('0x44')]));_0x2bb6da[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x46'),_0x1307c5[_0x67d8('0x42')][_0x4080f2][_0x67d8('0x44')]));_0x2bb6da[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x47'),_0x1307c5[_0x67d8('0x42')][_0x4080f2][_0x67d8('0x44')]));_0x2bb6da[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x48'),_0x1307c5[_0x67d8('0x42')][_0x4080f2][_0x67d8('0x44')]));_0x2bb6da[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x49'),_0x1307c5[_0x67d8('0x42')][_0x4080f2]['dataValues']));}return BPromise['all'](_0x2bb6da)[_0x67d8('0x11')](function(){return _0x1307c5;});}else{return _0x1307c5;}})['then'](respondWithFilteredResult(_0x18475f,_0x4de5be))[_0x67d8('0x1a')](handleError(_0x18475f,null));};exports[_0x67d8('0x4a')]=function(_0x4f484b,_0x5c68e7){var _0x40e4da={'raw':![],'where':{'id':_0x4f484b[_0x67d8('0x4b')]['id']}},_0x29e27c={};_0x29e27c[_0x67d8('0x4c')]=_[_0x67d8('0x4d')](_[_0x67d8('0x4e')](db[_0x67d8('0x34')][_0x67d8('0x35')]),[_0x67d8('0x4f'),_0x67d8('0x39')]);_0x29e27c[_0x67d8('0x3b')]=_[_0x67d8('0x4e')](_0x4f484b[_0x67d8('0x3b')]);_0x29e27c[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0x29e27c[_0x67d8('0x4c')],_0x29e27c['query']);_0x40e4da['attributes']=_['intersection'](_0x29e27c['model'],qs[_0x67d8('0x52')](_0x4f484b[_0x67d8('0x3b')][_0x67d8('0x52')]));_0x40e4da['attributes']=_0x40e4da[_0x67d8('0x40')][_0x67d8('0x43')]?_0x40e4da[_0x67d8('0x40')]:_0x29e27c[_0x67d8('0x4c')];if(_0x4f484b[_0x67d8('0x3b')][_0x67d8('0x53')]){_0x40e4da[_0x67d8('0x3c')]=[{'all':!![]}];}if(_0x4f484b[_0x67d8('0x3b')][_0x67d8('0x3d')]===_0x67d8('0x3e')){_0x40e4da[_0x67d8('0x3c')]=[{'model':db[_0x67d8('0x3f')],'as':_0x67d8('0x3d')}];}_0x40e4da=_['merge']({},_0x40e4da,_0x4f484b[_0x67d8('0x54')]);if(!_[_0x67d8('0x2e')](_0x40e4da[_0x67d8('0x40')],'id')){_0x40e4da[_0x67d8('0x40')][_0x67d8('0x41')]('id');}return db[_0x67d8('0x34')][_0x67d8('0x55')](_0x40e4da)[_0x67d8('0x11')](handleEntityNotFound(_0x5c68e7,null))['then'](function(_0x11ff31){var _0x1bab68=[];values=_0x11ff31;if(_0x4f484b[_0x67d8('0x3b')][_0x67d8('0x56')]===_0x67d8('0x3e')){_0x1bab68[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x57'),_0x11ff31[_0x67d8('0x44')]));_0x1bab68[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x45'),_0x11ff31[_0x67d8('0x44')]));_0x1bab68['push'](get_open_tabs('openchannel',_0x11ff31[_0x67d8('0x44')]));_0x1bab68['push'](get_open_tabs(_0x67d8('0x49'),_0x11ff31['dataValues']));_0x1bab68[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x46'),_0x11ff31[_0x67d8('0x44')]));_0x1bab68[_0x67d8('0x41')](get_open_tabs('mail',_0x11ff31[_0x67d8('0x44')]));return BPromise[_0x67d8('0x58')](_0x1bab68);}else{return values;}})['then'](function(){return values;})['then'](respondWithResult(_0x5c68e7,null))[_0x67d8('0x1a')](handleError(_0x5c68e7,null));};exports[_0x67d8('0x23')]=function(_0x316e2d,_0x4f47f9){if(_0x316e2d[_0x67d8('0x59')]['id']){delete _0x316e2d['body']['id'];}delete _0x316e2d[_0x67d8('0x59')][_0x67d8('0x5a')];return db[_0x67d8('0x34')]['find']({'where':{'id':_0x316e2d[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x4f47f9,null))['then'](saveUpdates(_0x316e2d[_0x67d8('0x59')],null))[_0x67d8('0x11')](respondWithResult(_0x4f47f9,null))[_0x67d8('0x1a')](handleError(_0x4f47f9,null));};exports[_0x67d8('0x5b')]=function(_0x325697,_0x191acc){return db[_0x67d8('0x34')][_0x67d8('0x5b')]()['then'](respondWithResult(_0x191acc,null))[_0x67d8('0x1a')](handleError(_0x191acc,null));};exports[_0x67d8('0x5c')]=function(_0x302e58,_0x490d01){return db[_0x67d8('0x34')][_0x67d8('0x55')]({'where':{'id':_0x302e58[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x490d01,null))[_0x67d8('0x11')](function(_0x4b3adb){if(_0x4b3adb){return _0x4b3adb['addContacts'](_0x302e58['body'][_0x67d8('0x5d')],_[_0x67d8('0x5e')](_0x302e58[_0x67d8('0x59')],[_0x67d8('0x5d'),'id'])||{});}})[_0x67d8('0x11')](respondWithResult(_0x490d01,null))[_0x67d8('0x1a')](handleError(_0x490d01,null));};function validateUser(_0x3e0232){return new BPromise(function(_0x4a120e,_0x320b84){if(_0x3e0232[_0x67d8('0x5f')])return _0x4a120e(_0x3e0232);return db[_0x67d8('0x60')]['findById'](0x1)[_0x67d8('0x11')](function(_0xe5e31e){if(_0xe5e31e[_0x67d8('0x61')])authService[_0x67d8('0x62')](_0x3e0232[_0x67d8('0x4f')]);db['User']['max'](_0x67d8('0x5f'))[_0x67d8('0x11')](function(_0x3bd4df){if(_[_0x67d8('0x63')](_0x3bd4df)){_0x3e0232[_0x67d8('0x5f')]=_0xe5e31e['min_internal']||0x1;return;}if(_[_0x67d8('0x63')](_0xe5e31e[_0x67d8('0x64')])||_0xe5e31e[_0x67d8('0x64')]===_0x3bd4df){_0x3e0232[_0x67d8('0x5f')]=_0x3bd4df+0x1;return;}if(_0xe5e31e['min_internal']>_0x3bd4df){_0x3e0232[_0x67d8('0x5f')]=_0xe5e31e[_0x67d8('0x64')];return;}return db['sequelize']['query'](_0x67d8('0x65'),{'type':db[_0x67d8('0x66')][_0x67d8('0x67')]['SELECT']})[_0x67d8('0x11')](function(_0x3b09fd){if(_0x3b09fd&&_0x3b09fd[_0x67d8('0x43')]){for(var _0x24f846=0x0,_0x955a57=_0x3b09fd[_0x67d8('0x43')];_0x24f846<_0x955a57&&_[_0x67d8('0x63')](_0x3e0232[_0x67d8('0x5f')]);_0x24f846++){if(_0xe5e31e['min_internal']<=_0x3b09fd[_0x24f846][_0x67d8('0x68')]){_0x3e0232['internal']=_0x3b09fd[_0x24f846]['from'];}else if(_0xe5e31e[_0x67d8('0x64')]>_0x3b09fd[_0x24f846][_0x67d8('0x68')]&&_0xe5e31e[_0x67d8('0x64')]<=_0x3b09fd[_0x24f846]['to']){_0x3e0232[_0x67d8('0x5f')]=_0xe5e31e[_0x67d8('0x64')];}}}if(_['isNil'](_0x3e0232['internal'])){_0x3e0232[_0x67d8('0x5f')]=_0x3bd4df+0x1;}return _0x4a120e(_0x3e0232);});});})[_0x67d8('0x1a')](function(_0x1f5f2f){_0x320b84(_0x1f5f2f);});});}function updateUser(_0x47c3cd){return new BPromise(function(_0x559189,_0x2b3670){try{if(_0x47c3cd['voicemail']){_0x47c3cd[_0x67d8('0x69')]=_0x47c3cd[_0x67d8('0x5f')];_0x47c3cd[_0x67d8('0x6a')]={'mailbox':_0x47c3cd[_0x67d8('0x5f')],'password':_0x47c3cd[_0x67d8('0x4f')],'fullname':_0x47c3cd[_0x67d8('0x6b')],'email':_0x47c3cd[_0x67d8('0x6c')]};}if(_0x47c3cd[_0x67d8('0x5a')]===_0x67d8('0x28')){if(!_0x47c3cd[_0x67d8('0x6d')])_0x47c3cd['permissions']=[_0x67d8('0x6e'),_0x67d8('0x6f'),_0x67d8('0x70'),'113',_0x67d8('0x71'),_0x67d8('0x72'),_0x67d8('0x73'),'106',_0x67d8('0x74'),_0x67d8('0x75'),_0x67d8('0x76'),_0x67d8('0x77'),'111',_0x67d8('0x78'),'115'];}_0x559189(_0x47c3cd);}catch(_0x1a7cda){_0x2b3670(_0x1a7cda);}});}exports['create']=function(_0x2ddae8,_0x19f20b){if(_0x2ddae8[_0x67d8('0x26')]['role']===_0x67d8('0x28'))throw new Error(_0x67d8('0x79'));if(_0x2ddae8[_0x67d8('0x59')][_0x67d8('0x5a')]===_0x67d8('0x26')&&_0x2ddae8[_0x67d8('0x26')][_0x67d8('0x5a')]!=='admin'){throw new Error(_0x67d8('0x7a'));}if(_0x2ddae8[_0x67d8('0x59')][_0x67d8('0x5a')]===_0x67d8('0x24')&&_0x2ddae8[_0x67d8('0x26')]['role']!==_0x67d8('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x67d8('0x7b')]([_0x2ddae8['body']])['then'](function(){return validateUser(_0x2ddae8[_0x67d8('0x59')]);})['then'](function(_0x335f9d){return updateUser(_0x335f9d)[_0x67d8('0x11')](function(_0x42ee14){if(_0x42ee14['role']==='admin'){_0x42ee14[_0x67d8('0x7c')]=_0x2ddae8['user'][_0x67d8('0x7c')];delete _0x42ee14[_0x67d8('0x7d')];}return _0x42ee14;});})[_0x67d8('0x11')](function(_0x586d22){return db[_0x67d8('0x34')][_0x67d8('0x7e')](_0x586d22,{'include':[{'model':db[_0x67d8('0x6a')],'as':_0x67d8('0x6a')}]});})[_0x67d8('0x11')](function(_0x5346df){if(_0x2ddae8['body']['role']===_0x67d8('0x26'))return _0x5346df;if(_0x2ddae8['user'][_0x67d8('0x5a')]!==_0x67d8('0x26'))return _0x5346df;return db[_0x67d8('0x7f')][_0x67d8('0x55')]({'where':{'name':_0x5346df[_0x67d8('0x5a')]===_0x67d8('0x28')?'Agents':_0x67d8('0x29'),'userProfileId':_0x2ddae8[_0x67d8('0x26')][_0x67d8('0x7d')]},'raw':!![]})[_0x67d8('0x11')](function(_0x2b0b17){if(!_0x2b0b17||_0x2b0b17[_0x67d8('0x80')]!=0x0)return _0x5346df;return db['UserProfileResource'][_0x67d8('0x7e')]({'name':_0x5346df[_0x67d8('0x2f')],'resourceId':_0x5346df['id'],'type':_0x2b0b17[_0x67d8('0x2f')],'sectionId':_0x2b0b17['id']},{})[_0x67d8('0x11')](function(){return _0x5346df;});})[_0x67d8('0x1a')](function(_0x1f12dc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f12dc);throw _0x1f12dc;});})[_0x67d8('0x11')](respondWithResult(_0x19f20b,0xc9))[_0x67d8('0x1a')](handleError(_0x19f20b,null));};exports[_0x67d8('0x81')]=function(_0x5614fa,_0xed38b7){var _0x4e0d15=_0x5614fa[_0x67d8('0x59')];var _0x4d0ae0=[];if(_0x5614fa['user'][_0x67d8('0x5a')]===_0x67d8('0x28'))throw new Error('Unauthorized');if(_[_0x67d8('0x82')](_0x4e0d15,['role','user'])&&_0x5614fa[_0x67d8('0x26')][_0x67d8('0x5a')]!==_0x67d8('0x24')){throw new Error(_0x67d8('0x7a'));}if(_['some'](_0x4e0d15,['role','admin'])&&_0x5614fa['user']['role']!==_0x67d8('0x24')){throw new Error(_0x67d8('0x83'));}return licenseUtil['checkUserLimits'](_0x4e0d15)[_0x67d8('0x11')](function(){return validateUser(_0x4e0d15[0x0]);})[_0x67d8('0x11')](function(){for(var _0x9d7a70=0x1;_0x9d7a70<_0x4e0d15[_0x67d8('0x43')];_0x9d7a70++){var _0x44ec90=_0x4e0d15[_0x9d7a70-0x1][_0x67d8('0x5f')];if(!_0x4e0d15[_0x9d7a70][_0x67d8('0x5f')])_0x4e0d15[_0x9d7a70][_0x67d8('0x5f')]=_0x44ec90+0x1;_0x4d0ae0['push'](validateUser(_0x4e0d15[_0x9d7a70]));}return BPromise[_0x67d8('0x58')](_0x4d0ae0);})[_0x67d8('0x11')](function(){_0x4d0ae0=[];for(var _0x4be0ba=0x0;_0x4be0ba<_0x4e0d15['length'];_0x4be0ba++){_0x4d0ae0['push'](updateUser(_0x4e0d15[_0x4be0ba]));}return BPromise[_0x67d8('0x58')](_0x4d0ae0);})['then'](function(){return BPromise[_0x67d8('0x84')](_0x4e0d15,function(_0x2da955){return db['User']['create'](_0x2da955,{'include':[{'model':db[_0x67d8('0x6a')],'as':_0x67d8('0x6a')}]})['then'](function(_0x2528d8){_0x2da955['id']=_0x2528d8['id'];return _0x2da955;});});})['then'](function(_0x19bac3){if(_0x5614fa[_0x67d8('0x59')][_0x67d8('0x5a')]===_0x67d8('0x26'))return _0x19bac3;if(_0x5614fa[_0x67d8('0x26')][_0x67d8('0x5a')]!==_0x67d8('0x26'))return _0x19bac3;var _0x46ea5f=_[_0x67d8('0x82')](_0x19bac3,function(_0xd8f6e1){return _0xd8f6e1[_0x67d8('0x5a')]===_0x67d8('0x28')||_0xd8f6e1['role']===_0x67d8('0x2a');});if(!_0x46ea5f)return _0x19bac3;return db[_0x67d8('0x7f')][_0x67d8('0x85')]({'where':{'name':{'$or':[_0x67d8('0x27'),_0x67d8('0x29')]},'userProfileId':_0x5614fa['user'][_0x67d8('0x7d')]},'raw':!![]})[_0x67d8('0x11')](function(_0xbcb16f){if(_[_0x67d8('0x86')](_0xbcb16f)||!_['some'](_0xbcb16f,['autoAssociation',0x0]))return _0x19bac3;_0x4d0ae0=[];var _0x548df4=_(_0xbcb16f)['map'](function(_0x5ee5af){if(_0x5ee5af[_0x67d8('0x80')]===0x1)return;return _0x5ee5af[_0x67d8('0x2f')]===_0x67d8('0x27')?_0x67d8('0x28'):_0x67d8('0x2a');})[_0x67d8('0x87')]()[_0x67d8('0x2d')]();for(var _0x47f991=0x0;_0x47f991<_0x19bac3[_0x67d8('0x43')];_0x47f991++){if(!_[_0x67d8('0x2e')](_0x548df4,_0x19bac3[_0x47f991][_0x67d8('0x5a')]))return;var _0x5b02db=_0x19bac3[_0x47f991][_0x67d8('0x5a')]===_0x67d8('0x28')?_0x67d8('0x27'):'Telephones';_0x4d0ae0['push'](db[_0x67d8('0x88')][_0x67d8('0x7e')]({'name':_0x19bac3[_0x47f991][_0x67d8('0x2f')],'resourceId':_0x19bac3[_0x47f991]['id'],'type':_0x5b02db,'sectionId':_[_0x67d8('0x55')](_0xbcb16f,[_0x67d8('0x2f'),_0x5b02db])['id']},{}));}return BPromise[_0x67d8('0x58')](_0x4d0ae0);});})[_0x67d8('0x11')](respondWithResult(_0xed38b7,0xc9))[_0x67d8('0x1a')](handleError(_0xed38b7,null));};exports[_0x67d8('0x89')]=function(_0x1e8bfb,_0x165ee){if(_0x1e8bfb[_0x67d8('0x59')]['id']){delete _0x1e8bfb[_0x67d8('0x59')]['id'];}return db[_0x67d8('0x34')][_0x67d8('0x55')]({'where':{'id':_0x1e8bfb[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](function(_0x1093c9){if(!_0x1093c9)return null;if(_0x1093c9['id']===_0x1e8bfb['user']['id']){if(!_0x1e8bfb[_0x67d8('0x59')][_0x67d8('0x8a')]||!_0x1e8bfb[_0x67d8('0x59')]['newPassword']){throw new db[(_0x67d8('0x8b'))][(_0x67d8('0x8c'))](_0x67d8('0x8d'));}if(!_0x1093c9[_0x67d8('0x8e')](_0x1e8bfb[_0x67d8('0x59')][_0x67d8('0x8a')])){throw new db[(_0x67d8('0x8b'))][(_0x67d8('0x8c'))](_0x67d8('0x8f'));}if(_0x1e8bfb[_0x67d8('0x59')][_0x67d8('0x8a')]===_0x1e8bfb[_0x67d8('0x59')][_0x67d8('0x90')]){throw new db['Sequelize'][(_0x67d8('0x8c'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x1e8bfb[_0x67d8('0x26')][_0x67d8('0x5a')]===_0x67d8('0x24')){if(!_0x1e8bfb[_0x67d8('0x59')][_0x67d8('0x90')]){throw new db['Sequelize'][(_0x67d8('0x8c'))](_0x67d8('0x91'));}}else if(_0x1e8bfb[_0x67d8('0x26')][_0x67d8('0x5a')]===_0x67d8('0x26')){if(!_0x1e8bfb[_0x67d8('0x59')][_0x67d8('0x90')]){throw new db[(_0x67d8('0x8b'))][(_0x67d8('0x8c'))](_0x67d8('0x91'));}if(_0x1093c9['role']!==_0x67d8('0x28')){throw new db['Sequelize'][(_0x67d8('0x8c'))](_0x67d8('0x79'));}}else{throw new db[(_0x67d8('0x8b'))]['ValidationError']('Unauthorized');}return _0x1093c9;})[_0x67d8('0x11')](handleEntityNotFound(_0x165ee,null))[_0x67d8('0x11')](function(_0x140ed7){return db['Setting'][_0x67d8('0x92')]({'attributes':['id',_0x67d8('0x61'),_0x67d8('0x93'),_0x67d8('0x94')]})[_0x67d8('0x11')](function(_0x51573e){if(_0x51573e[_0x67d8('0x61')])authService[_0x67d8('0x62')](_0x1e8bfb[_0x67d8('0x59')]['newPassword']);if(!_0x51573e[_0x67d8('0x93')]||!_0x140ed7['previousPasswords'])return _0x140ed7;authService['validatePasswordHistory'](_0x1e8bfb[_0x67d8('0x59')]['newPassword'],_0x140ed7[_0x67d8('0x95')],_0x51573e['passwordHistoryLimit']);return _0x140ed7;})['then'](saveUpdates({'password':_0x1e8bfb[_0x67d8('0x59')]['newPassword'],'passwordResetAt':_0x1e8bfb[_0x67d8('0x26')]['id']==_0x1e8bfb[_0x67d8('0x4b')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x1e8bfb[_0x67d8('0x59')][_0x67d8('0x90')],_0x140ed7[_0x67d8('0x95')])},null));})[_0x67d8('0x11')](respondWithResult(_0x165ee,null))[_0x67d8('0x1a')](handleError(_0x165ee,null));};exports[_0x67d8('0x96')]=function(_0x1c9183,_0x557206){var _0x3aacea=_0x1c9183[_0x67d8('0x59')][_0x67d8('0x97')];return db[_0x67d8('0x34')][_0x67d8('0x55')]({'where':{'id':_0x1c9183[_0x67d8('0x4b')]['id']},'attributes':['id','name',_0x67d8('0x5a'),'online',_0x67d8('0x98'),'voicePause',_0x67d8('0x99')]})['then'](handleEntityNotFound(_0x557206,null))[_0x67d8('0x11')](function(_0x5ae8d8){if(_0x5ae8d8){if(!utils[_0x67d8('0x9a')](_0x3aacea)){throw new db[(_0x67d8('0x8b'))][(_0x67d8('0x8c'))]('Unknown\x20channel');}return _0x5ae8d8[_0x67d8('0x9b')+_['capitalize'](_0x3aacea['toLowerCase']())+_0x67d8('0x9c')](_0x1c9183[_0x67d8('0x59')][_0x67d8('0x5d')],{'penalty':_0x1c9183[_0x67d8('0x59')][_0x67d8('0x9d')]||0x0})[_0x67d8('0x9e')](function(_0x51285f){for(var _0x52d5d2=0x0;_0x52d5d2<_0x1c9183[_0x67d8('0x59')]['ids']['length'];_0x52d5d2+=0x1){var _0x37ab58={'UserId':Number(_0x1c9183[_0x67d8('0x4b')]['id'])};_0x37ab58[_['capitalize'](_0x3aacea['toLowerCase']())+_0x67d8('0x9f')]=Number(_0x1c9183[_0x67d8('0x59')]['ids'][_0x52d5d2]);socket[_0x67d8('0xa0')]('user'+_[_0x67d8('0xa1')](_0x3aacea[_0x67d8('0xa2')]())+_0x67d8('0xa3'),_0x37ab58);}return _0x51285f;})[_0x67d8('0x11')](function(){if(_0x3aacea===_0x67d8('0xa4')){return db['VoiceQueue']['findAll']({'where':{'id':_0x1c9183[_0x67d8('0x59')][_0x67d8('0x5d')]||[]},'raw':!![],'attributes':['id',_0x67d8('0x2f')]});}})['then'](function(_0x2d88e4){var _0x5dd390=_0x5ae8d8[_0x67d8('0xa5')]({'plain':!![]});var _0x2c9bd4=[];if(_0x3aacea===_0x67d8('0xa4')&&_0x5dd390[_0x67d8('0x5a')]===_0x67d8('0x28')&&_0x5dd390[_0x67d8('0xa6')]){for(var _0xb126a3=0x0;_0xb126a3<_0x2d88e4[_0x67d8('0x43')];_0xb126a3+=0x1){_0x2c9bd4['push']({'membername':_0x5dd390['name'],'UserId':_0x5dd390['id'],'queue_name':_0x2d88e4[_0xb126a3][_0x67d8('0x2f')],'VoiceQueueId':_0x2d88e4[_0xb126a3]['id'],'interface':_[_0x67d8('0x63')](_0x5dd390[_0x67d8('0x99')])?util[_0x67d8('0xa7')](_0x67d8('0xa8'),_0x5dd390['name']):_0x5dd390['interface'],'paused':_0x5dd390['voicePause']||![],'penalty':_0x1c9183[_0x67d8('0x59')]['penalty']||0x0});}return BPromise[_0x67d8('0x84')](_0x2c9bd4,function(_0x282538){return db[_0x67d8('0xa9')]['upsert'](_0x282538);});}return _0x5ae8d8;});}})['then'](respondWithStatusCode(_0x557206,null))[_0x67d8('0x1a')](handleError(_0x557206,null));};exports['removeQueues']=function(_0x2e1bdc,_0x4ad29e){var _0x1a2852,_0x2233f5;return db['User'][_0x67d8('0x55')]({'where':{'id':_0x2e1bdc['params']['id']},'attributes':['id',_0x67d8('0x2f'),_0x67d8('0x5a')]})[_0x67d8('0x11')](handleEntityNotFound(_0x4ad29e,null))[_0x67d8('0x11')](function(_0x26ecd0){if(_0x26ecd0){_0x1a2852=_0x26ecd0;if(!_0x2e1bdc[_0x67d8('0x3b')][_0x67d8('0x97')]||!utils['isValidChannel'](_0x2e1bdc['query'][_0x67d8('0x97')])){throw new db[(_0x67d8('0x8b'))][(_0x67d8('0x8c'))](_0x67d8('0xaa'));}return _0x26ecd0['remove'+_[_0x67d8('0xa1')](_0x2e1bdc['query'][_0x67d8('0x97')][_0x67d8('0xa2')]())+_0x67d8('0x9c')](_0x2e1bdc[_0x67d8('0x3b')][_0x67d8('0x5d')]);}})[_0x67d8('0x11')](function(_0x45d1c5){if(_['isArray'](_0x2e1bdc[_0x67d8('0x3b')]['ids'])){for(var _0x61aedb=0x0;_0x61aedb<_0x2e1bdc[_0x67d8('0x3b')][_0x67d8('0x5d')][_0x67d8('0x43')];_0x61aedb+=0x1){_0x2233f5={'UserId':Number(_0x2e1bdc['params']['id'])};_0x2233f5[_[_0x67d8('0xa1')](_0x2e1bdc[_0x67d8('0x3b')][_0x67d8('0x97')][_0x67d8('0xa2')]())+_0x67d8('0x9f')]=Number(_0x2e1bdc['query']['ids'][_0x61aedb]);socket[_0x67d8('0xa0')](_0x67d8('0x26')+_[_0x67d8('0xa1')](_0x2e1bdc[_0x67d8('0x3b')][_0x67d8('0x97')][_0x67d8('0xa2')]())+_0x67d8('0xab'),_0x2233f5);}}else{_0x2233f5={'UserId':Number(_0x2e1bdc[_0x67d8('0x4b')]['id'])};_0x2233f5[_[_0x67d8('0xa1')](_0x2e1bdc[_0x67d8('0x3b')][_0x67d8('0x97')][_0x67d8('0xa2')]())+_0x67d8('0x9f')]=Number(_0x2e1bdc[_0x67d8('0x3b')][_0x67d8('0x5d')]);socket[_0x67d8('0xa0')]('user'+_[_0x67d8('0xa1')](_0x2e1bdc[_0x67d8('0x3b')][_0x67d8('0x97')][_0x67d8('0xa2')]())+_0x67d8('0xab'),_0x2233f5);}return _0x45d1c5;})[_0x67d8('0x11')](function(){if(_0x2e1bdc[_0x67d8('0x3b')]['channel']==='voice'){return db[_0x67d8('0xa9')][_0x67d8('0x30')]({'where':{'UserId':_0x2e1bdc[_0x67d8('0x4b')]['id'],'VoiceQueueId':_0x2e1bdc[_0x67d8('0x3b')]['ids']},'individualHooks':!![]})[_0x67d8('0x11')](function(){return _0x1a2852;});}return _0x1a2852;})[_0x67d8('0x11')](respondWithStatusCode(_0x4ad29e,null))[_0x67d8('0x1a')](handleError(_0x4ad29e,null));};exports['addAvatar']=function(_0x2edcf9,_0x519124){_0x2edcf9[_0x67d8('0x59')]['userpic']=_0x2edcf9[_0x67d8('0xac')][_0x67d8('0xad')];return db[_0x67d8('0x34')][_0x67d8('0x55')]({'where':{'id':_0x2edcf9[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x519124,null))[_0x67d8('0x11')](saveUpdates(_0x2edcf9[_0x67d8('0x59')],null))[_0x67d8('0x11')](respondWithResult(_0x519124,null))[_0x67d8('0x1a')](handleError(_0x519124,null));};exports[_0x67d8('0xae')]=function(_0x24dcf0,_0x3612f3){var _0x28d74c=path[_0x67d8('0xaf')](config[_0x67d8('0xb0')],'server/files/images/logos/default_profile.png');return db[_0x67d8('0x34')][_0x67d8('0x55')]({'where':{'id':_0x24dcf0[_0x67d8('0x4b')]['id']},'attributes':['id',_0x67d8('0xb1')],'raw':!![]})[_0x67d8('0x11')](handleEntityNotFound(_0x3612f3,null))[_0x67d8('0x11')](function(_0x43f893){if(_0x43f893){if(_[_0x67d8('0x63')](_0x43f893[_0x67d8('0xb1')])){return _0x3612f3[_0x67d8('0xb2')](_0x28d74c);}else{if(!fs['existsSync'](path['join'](config[_0x67d8('0xb0')],'server/files/images/',_0x43f893['userpic']))){return _0x3612f3[_0x67d8('0xb2')](_0x28d74c);}return _0x3612f3[_0x67d8('0xb2')](path[_0x67d8('0xaf')](config[_0x67d8('0xb0')],'server/files/images/',_0x43f893[_0x67d8('0xb1')]));}}})[_0x67d8('0x1a')](handleError(_0x3612f3,null));};exports[_0x67d8('0xb3')]=function(_0x1c720f,_0x573791){return db['User'][_0x67d8('0x55')]({'where':{'id':_0x1c720f['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x573791,null))[_0x67d8('0x11')](function(_0x58b9c9){var _0x109b18=[];values=_0x58b9c9[_0x67d8('0x44')];_0x109b18[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x57'),_0x58b9c9[_0x67d8('0x44')]));_0x109b18[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x45'),_0x58b9c9[_0x67d8('0x44')]));_0x109b18[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x48'),_0x58b9c9[_0x67d8('0x44')]));_0x109b18[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x49'),_0x58b9c9['dataValues']));_0x109b18[_0x67d8('0x41')](get_open_tabs(_0x67d8('0x46'),_0x58b9c9['dataValues']));_0x109b18['push'](get_open_tabs(_0x67d8('0x47'),_0x58b9c9['dataValues']));return BPromise[_0x67d8('0x58')](_0x109b18);})[_0x67d8('0x11')](function(_0xac4c74){if(_0xac4c74){var _0x43743e=_[_0x67d8('0x36')](values['ChatOpenTabs'],function(_0x389fec){return{'channel':_0x67d8('0xb4'),'id':_0x389fec['id'],'createdAt':_0x389fec['createdAt']};});var _0x372236=_[_0x67d8('0x36')](values[_0x67d8('0xb5')],function(_0x569ec3){return{'channel':_0x67d8('0xb6'),'id':_0x569ec3['id'],'createdAt':_0x569ec3[_0x67d8('0xb7')]};});var _0x373679=_['map'](values['OpenchannelOpenTabs'],function(_0x24cf53){return{'channel':'OPENCHANNEL','id':_0x24cf53['id'],'createdAt':_0x24cf53[_0x67d8('0xb7')]};});var _0x5cf667=_[_0x67d8('0x36')](values['MailOpenTabs'],function(_0x14a93c){return{'channel':'MAIL','id':_0x14a93c['id'],'createdAt':_0x14a93c[_0x67d8('0xb7')]};});var _0x2cf957=_['map'](values[_0x67d8('0xb8')],function(_0x3b02fb){return{'channel':_0x67d8('0xb9'),'id':_0x3b02fb['id'],'createdAt':_0x3b02fb[_0x67d8('0xb7')]};});var _0x13809d=_[_0x67d8('0x36')](values[_0x67d8('0xba')],function(_0x4c7073){return{'channel':_0x67d8('0xbb'),'id':_0x4c7073['id'],'createdAt':_0x4c7073['createdAt']};});var _0x28974a=_[_0x67d8('0xbc')](_0x43743e,_0x372236,_0x373679,_0x5cf667,_0x2cf957,_0x13809d);var _0x11013b={'count':_0x28974a[_0x67d8('0x43')],'rows':_0x28974a};return _0x11013b;}else return null;})['then'](respondWithResult(_0x573791,null))[_0x67d8('0x1a')](handleError(_0x573791,null));};exports[_0x67d8('0xbd')]=function(_0x174885,_0x151eea){var _0x1d87f3={};var _0x2ac1dc={};var _0xc1aa21;var _0x2806fd;return db[_0x67d8('0x34')][_0x67d8('0x92')]({'where':{'id':_0x174885[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x151eea,null))[_0x67d8('0x11')](function(_0x75a5c8){if(_0x75a5c8){_0xc1aa21=_0x75a5c8;_0x2ac1dc['model']=_[_0x67d8('0x4e')](db[_0x67d8('0xbe')][_0x67d8('0x35')]);_0x2ac1dc['query']=_[_0x67d8('0x4e')](_0x174885[_0x67d8('0x3b')]);_0x2ac1dc[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0x2ac1dc[_0x67d8('0x4c')],_0x2ac1dc[_0x67d8('0x3b')]);_0x1d87f3[_0x67d8('0x40')]=_['intersection'](_0x2ac1dc[_0x67d8('0x4c')],qs[_0x67d8('0x52')](_0x174885['query'][_0x67d8('0x52')]));_0x1d87f3[_0x67d8('0x40')]=_0x1d87f3[_0x67d8('0x40')][_0x67d8('0x43')]?_0x1d87f3[_0x67d8('0x40')]:_0x2ac1dc[_0x67d8('0x4c')];_0x1d87f3[_0x67d8('0xbf')]=qs[_0x67d8('0xc0')](_0x174885['query'][_0x67d8('0xc0')]);_0x1d87f3[_0x67d8('0x3a')]=qs[_0x67d8('0x50')](_[_0x67d8('0xc1')](_0x174885['query'],_0x2ac1dc['filters']));if(_0x174885[_0x67d8('0x3b')][_0x67d8('0x2b')]){_0x1d87f3['where']=_[_0x67d8('0xc2')](_0x1d87f3[_0x67d8('0x3a')],{'$or':_[_0x67d8('0x36')](_0x1d87f3[_0x67d8('0x40')],function(_0x4fa888){var _0x4f2b4e={};_0x4f2b4e[_0x4fa888]={'$like':'%'+_0x174885[_0x67d8('0x3b')]['filter']+'%'};return _0x4f2b4e;})});}_0x1d87f3=_[_0x67d8('0xc2')]({},_0x1d87f3,_0x174885[_0x67d8('0x54')]);return _0xc1aa21['getContacts'](_0x1d87f3);}})['then'](function(_0x1bf609){if(_0x1bf609){_0x2806fd=_0x1bf609[_0x67d8('0x43')];if(_0x174885['query']['hasOwnProperty'](_0x67d8('0x53'))){_0x1d87f3[_0x67d8('0x3c')]=[{'model':db[_0x67d8('0xc3')],'as':_0x67d8('0xc4'),'required':![]},{'model':db[_0x67d8('0xc5')],'as':'Tags','attributes':['id',_0x67d8('0x2f'),_0x67d8('0xc6')],'where':_0x174885[_0x67d8('0x3b')][_0x67d8('0xc7')]?{'id':_0x174885[_0x67d8('0x3b')]['tag']}:undefined,'required':_0x174885['query']['tag']?!![]:![]}];}if(!_0x174885[_0x67d8('0x3b')][_0x67d8('0xc8')](_0x67d8('0xc9'))){_0x1d87f3['limit']=qs[_0x67d8('0xca')](_0x174885[_0x67d8('0x3b')]['limit']);_0x1d87f3[_0x67d8('0x20')]=qs['offset'](_0x174885[_0x67d8('0x3b')][_0x67d8('0x20')]);}return _0xc1aa21[_0x67d8('0xbd')](_0x1d87f3);}})[_0x67d8('0x11')](function(_0x5a6f2e){if(_0x5a6f2e){return _0x5a6f2e?{'count':_0x2806fd,'rows':_0x5a6f2e}:null;}})[_0x67d8('0x11')](respondWithResult(_0x151eea,null))['catch'](handleError(_0x151eea,null));};exports[_0x67d8('0xcb')]=function(_0x30f5b6,_0x4e9e07){var _0x4ed6bc;var _0x32aa3e={};var _0x50b282;return db[_0x67d8('0x34')]['findOne']({'where':{'id':_0x30f5b6['params']['id']},'attributes':['id',_0x67d8('0x2f'),_0x67d8('0x5a')]})[_0x67d8('0x11')](handleEntityNotFound(_0x4e9e07,null))[_0x67d8('0x11')](function(_0x571088){if(!utils[_0x67d8('0x9a')](_0x30f5b6[_0x67d8('0x3b')][_0x67d8('0x97')])){throw new db[(_0x67d8('0x8b'))][(_0x67d8('0x8c'))](_0x67d8('0xaa'));}_0x4ed6bc=_0x571088;var _0x5e62e4={};_0x5e62e4[_0x67d8('0x4c')]=_['keys'](db[_[_0x67d8('0xa1')](_0x30f5b6[_0x67d8('0x3b')][_0x67d8('0x97')])+_0x67d8('0xcc')][_0x67d8('0x35')]);_0x5e62e4['query']=_[_0x67d8('0x4e')](_0x30f5b6[_0x67d8('0x3b')]);_0x5e62e4[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0x5e62e4['model'],_0x5e62e4[_0x67d8('0x3b')]);_0x32aa3e[_0x67d8('0x40')]=_['intersection'](_0x5e62e4[_0x67d8('0x4c')],qs[_0x67d8('0x52')](_0x30f5b6[_0x67d8('0x3b')]['fields']));_0x32aa3e['attributes']=_0x32aa3e[_0x67d8('0x40')][_0x67d8('0x43')]?_0x32aa3e[_0x67d8('0x40')]:_0x5e62e4[_0x67d8('0x4c')];_0x32aa3e['order']=qs[_0x67d8('0xc0')](_0x30f5b6[_0x67d8('0x3b')][_0x67d8('0xc0')]);_0x32aa3e[_0x67d8('0x3a')]=qs['filters'](_['pick'](_0x30f5b6['query'],_0x5e62e4[_0x67d8('0x50')]));if(_0x30f5b6['query'][_0x67d8('0x2b')]){_0x32aa3e[_0x67d8('0x3a')]=_[_0x67d8('0xc2')](_0x32aa3e[_0x67d8('0x3a')],{'$or':_[_0x67d8('0x36')](_0x32aa3e['attributes'],function(_0x1c54af){var _0x1e166b={};_0x1e166b[_0x1c54af]={'$like':'%'+_0x30f5b6['query'][_0x67d8('0x2b')]+'%'};return _0x1e166b;})});}_0x32aa3e=_[_0x67d8('0xc2')]({},_0x32aa3e,_0x30f5b6['options']);switch(_0x4ed6bc[_0x67d8('0x5a')]){case _0x67d8('0x24'):return db[_['capitalize'](_0x30f5b6[_0x67d8('0x3b')][_0x67d8('0x97')])+_0x67d8('0xcc')][_0x67d8('0x85')](_0x32aa3e);case _0x67d8('0x26'):case _0x67d8('0x28'):return _0x4ed6bc['get'+_['capitalize'](_0x30f5b6['query'][_0x67d8('0x97')])+_0x67d8('0x9c')](_0x32aa3e);default:throw new db[(_0x67d8('0x8b'))][(_0x67d8('0x8c'))]('Unknown\x20role');}})[_0x67d8('0x11')](function(_0x317fce){_0x50b282=_0x317fce['length'];if(!_0x30f5b6[_0x67d8('0x3b')][_0x67d8('0xc8')](_0x67d8('0xc9'))){_0x32aa3e['limit']=qs['limit'](_0x30f5b6[_0x67d8('0x3b')][_0x67d8('0xca')]);_0x32aa3e['offset']=qs['offset'](_0x30f5b6[_0x67d8('0x3b')]['offset']);}switch(_0x4ed6bc[_0x67d8('0x5a')]){case _0x67d8('0x24'):return db[_[_0x67d8('0xa1')](_0x30f5b6[_0x67d8('0x3b')]['channel'])+'Queue'][_0x67d8('0x85')](_0x32aa3e);case _0x67d8('0x26'):case _0x67d8('0x28'):return _0x4ed6bc[_0x67d8('0xa5')+_[_0x67d8('0xa1')](_0x30f5b6[_0x67d8('0x3b')][_0x67d8('0x97')])+_0x67d8('0x9c')](_0x32aa3e);}})[_0x67d8('0x11')](function(_0x4b55f9){return{'count':_0x50b282,'rows':_0x4b55f9};})[_0x67d8('0x11')](respondWithResult(_0x4e9e07,null))['catch'](handleError(_0x4e9e07,null));};exports[_0x67d8('0xcd')]=function(_0x1ae4d7,_0x33c34e){var _0x5ad646={};var _0x4d7315={};var _0x366628;var _0x3ee75b;return db[_0x67d8('0x34')][_0x67d8('0x92')]({'where':{'id':_0x1ae4d7[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x33c34e,null))[_0x67d8('0x11')](function(_0x5261d4){if(_0x5261d4){_0x366628=_0x5261d4;_0x4d7315['model']=_[_0x67d8('0x4e')](db[_0x67d8('0xa9')][_0x67d8('0x35')]);_0x4d7315[_0x67d8('0x3b')]=_[_0x67d8('0x4e')](_0x1ae4d7[_0x67d8('0x3b')]);_0x4d7315[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0x4d7315[_0x67d8('0x4c')],_0x4d7315[_0x67d8('0x3b')]);_0x5ad646[_0x67d8('0x40')]=_['intersection'](_0x4d7315['model'],qs[_0x67d8('0x52')](_0x1ae4d7[_0x67d8('0x3b')][_0x67d8('0x52')]));_0x5ad646['attributes']=_0x5ad646[_0x67d8('0x40')]['length']?_0x5ad646[_0x67d8('0x40')]:_0x4d7315[_0x67d8('0x4c')];_0x5ad646[_0x67d8('0xbf')]=qs['sort'](_0x1ae4d7[_0x67d8('0x3b')][_0x67d8('0xc0')]);_0x5ad646[_0x67d8('0x3a')]=qs[_0x67d8('0x50')](_[_0x67d8('0xc1')](_0x1ae4d7[_0x67d8('0x3b')],_0x4d7315[_0x67d8('0x50')]));if(_0x1ae4d7['query'][_0x67d8('0x2b')]){_0x5ad646[_0x67d8('0x3a')]=_[_0x67d8('0xc2')](_0x5ad646['where'],{'$or':_['map'](_0x5ad646[_0x67d8('0x40')],function(_0x470960){var _0x1f93d2={};_0x1f93d2[_0x470960]={'$like':'%'+_0x1ae4d7[_0x67d8('0x3b')][_0x67d8('0x2b')]+'%'};return _0x1f93d2;})});}_0x5ad646=_[_0x67d8('0xc2')]({},_0x5ad646,_0x1ae4d7['options']);return _0x366628[_0x67d8('0xcd')](_0x5ad646);}})[_0x67d8('0x11')](function(_0x1c1bc5){if(_0x1c1bc5){_0x3ee75b=_0x1c1bc5[_0x67d8('0x43')];if(!_0x1ae4d7[_0x67d8('0x3b')]['hasOwnProperty']('nolimit')){_0x5ad646[_0x67d8('0xca')]=qs[_0x67d8('0xca')](_0x1ae4d7[_0x67d8('0x3b')][_0x67d8('0xca')]);_0x5ad646[_0x67d8('0x20')]=qs[_0x67d8('0x20')](_0x1ae4d7[_0x67d8('0x3b')]['offset']);}return _0x366628[_0x67d8('0xcd')](_0x5ad646);}})[_0x67d8('0x11')](function(_0x41e44b){if(_0x41e44b){return _0x41e44b?{'count':_0x3ee75b,'rows':_0x41e44b}:null;}})[_0x67d8('0x11')](respondWithResult(_0x33c34e,null))[_0x67d8('0x1a')](handleError(_0x33c34e,null));};exports['getGroups']=function(_0x23b3f8,_0x1aea33){var _0x5bbaed={};var _0x2643f8={};var _0x4e8f5c;var _0x3672ca;return db[_0x67d8('0x34')]['findOne']({'where':{'id':_0x23b3f8[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x1aea33,null))[_0x67d8('0x11')](function(_0x5709b8){if(_0x5709b8){_0x4e8f5c=_0x5709b8;_0x2643f8['model']=_[_0x67d8('0x4e')](db['ChatGroup']['rawAttributes']);_0x2643f8[_0x67d8('0x3b')]=_['keys'](_0x23b3f8['query']);_0x2643f8[_0x67d8('0x50')]=_['intersection'](_0x2643f8[_0x67d8('0x4c')],_0x2643f8[_0x67d8('0x3b')]);_0x5bbaed['attributes']=_[_0x67d8('0x51')](_0x2643f8['model'],qs['fields'](_0x23b3f8[_0x67d8('0x3b')][_0x67d8('0x52')]));_0x5bbaed['attributes']=_0x5bbaed[_0x67d8('0x40')][_0x67d8('0x43')]?_0x5bbaed[_0x67d8('0x40')]:_0x2643f8['model'];_0x5bbaed[_0x67d8('0xbf')]=qs[_0x67d8('0xc0')](_0x23b3f8[_0x67d8('0x3b')]['sort']);_0x5bbaed[_0x67d8('0x3a')]=qs[_0x67d8('0x50')](_[_0x67d8('0xc1')](_0x23b3f8[_0x67d8('0x3b')],_0x2643f8[_0x67d8('0x50')]));if(_0x23b3f8[_0x67d8('0x3b')]['filter']){_0x5bbaed[_0x67d8('0x3a')]=_[_0x67d8('0xc2')](_0x5bbaed[_0x67d8('0x3a')],{'$or':_[_0x67d8('0x36')](_0x5bbaed[_0x67d8('0x40')],function(_0x4ce3e4){var _0x3ee9af={};_0x3ee9af[_0x4ce3e4]={'$like':'%'+_0x23b3f8[_0x67d8('0x3b')][_0x67d8('0x2b')]+'%'};return _0x3ee9af;})});}_0x5bbaed=_[_0x67d8('0xc2')]({},_0x5bbaed,_0x23b3f8[_0x67d8('0x54')]);return _0x4e8f5c[_0x67d8('0xce')](_0x5bbaed);}})[_0x67d8('0x11')](function(_0x5c20e5){if(_0x5c20e5){_0x3672ca=_0x5c20e5[_0x67d8('0x43')];if(!_0x23b3f8[_0x67d8('0x3b')][_0x67d8('0xc8')](_0x67d8('0xc9'))){_0x5bbaed['limit']=qs[_0x67d8('0xca')](_0x23b3f8[_0x67d8('0x3b')][_0x67d8('0xca')]);_0x5bbaed[_0x67d8('0x20')]=qs[_0x67d8('0x20')](_0x23b3f8['query'][_0x67d8('0x20')]);}return _0x4e8f5c[_0x67d8('0xce')](_0x5bbaed);}})[_0x67d8('0x11')](function(_0x46d1e8){if(_0x46d1e8){return _0x46d1e8?{'count':_0x3672ca,'rows':_0x46d1e8}:null;}})['then'](respondWithResult(_0x1aea33,null))['catch'](handleError(_0x1aea33,null));};exports[_0x67d8('0xcf')]=function(_0x487569,_0x2f9be0){var _0x1a6307={'raw':!![],'where':{}};var _0x1bfcae={};var _0x16d8b5={'count':0x0,'rows':[]};return db['User'][_0x67d8('0x92')]({'where':{'id':_0x487569[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x2f9be0,null))['then'](function(_0x1bf530){if(_0x1bf530){_0x1bfcae[_0x67d8('0x4c')]=_[_0x67d8('0x4e')](db[_0x67d8('0xd0')][_0x67d8('0x35')]);_0x1bfcae[_0x67d8('0x3b')]=_[_0x67d8('0x4e')](_0x487569[_0x67d8('0x3b')]);_0x1bfcae[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0x1bfcae[_0x67d8('0x4c')],_0x1bfcae['query']);_0x1a6307[_0x67d8('0x40')]=_['intersection'](_0x1bfcae[_0x67d8('0x4c')],qs[_0x67d8('0x52')](_0x487569['query'][_0x67d8('0x52')]));_0x1a6307['attributes']=_0x1a6307[_0x67d8('0x40')][_0x67d8('0x43')]?_0x1a6307[_0x67d8('0x40')]:_0x1bfcae['model'];if(!_0x487569[_0x67d8('0x3b')]['hasOwnProperty'](_0x67d8('0xc9'))){_0x1a6307['limit']=qs['limit'](_0x487569[_0x67d8('0x3b')]['limit']);_0x1a6307[_0x67d8('0x20')]=qs[_0x67d8('0x20')](_0x487569[_0x67d8('0x3b')]['offset']);}_0x1a6307[_0x67d8('0xbf')]=qs[_0x67d8('0xc0')](_0x487569['query']['sort']);_0x1a6307[_0x67d8('0x3a')]=qs[_0x67d8('0x50')](_[_0x67d8('0xc1')](_0x487569[_0x67d8('0x3b')],_0x1bfcae['filters']));_0x1a6307[_0x67d8('0x3a')]['UserId']=_0x1bf530['id'];if(_0x487569[_0x67d8('0x3b')][_0x67d8('0x2b')]){_0x1a6307[_0x67d8('0x3a')]=_[_0x67d8('0xc2')](_0x1a6307[_0x67d8('0x3a')],{'$or':_[_0x67d8('0x36')](_0x1a6307[_0x67d8('0x40')],function(_0x4a6528){var _0x937151={};_0x937151[_0x4a6528]={'$like':'%'+_0x487569[_0x67d8('0x3b')][_0x67d8('0x2b')]+'%'};return _0x937151;})});}_0x1a6307=_[_0x67d8('0xc2')]({},_0x1a6307,_0x487569[_0x67d8('0x54')]);return db['VoiceRecording'][_0x67d8('0x1f')]({'where':_0x1a6307[_0x67d8('0x3a')]})[_0x67d8('0x11')](function(_0x4282bd){_0x16d8b5[_0x67d8('0x1f')]=_0x4282bd;if(_0x487569['query'][_0x67d8('0x53')]){_0x1a6307['include']=[{'all':!![]}];}return db[_0x67d8('0xd0')][_0x67d8('0x85')](_0x1a6307);})[_0x67d8('0x11')](function(_0x5e462a){_0x16d8b5[_0x67d8('0x42')]=_0x5e462a;return _0x16d8b5;});}})[_0x67d8('0x11')](respondWithFilteredResult(_0x2f9be0,_0x1a6307))[_0x67d8('0x1a')](handleError(_0x2f9be0,null));};exports[_0x67d8('0xd1')]=function(_0x544b40,_0x391615){var _0x481d56={'raw':!![],'where':{}};var _0x59ca76={};var _0x49a249={'count':0x0,'rows':[]};return db[_0x67d8('0x34')][_0x67d8('0x92')]({'where':{'id':_0x544b40[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x391615,null))['then'](function(_0x3f9802){if(_0x3f9802){_0x59ca76[_0x67d8('0x4c')]=_[_0x67d8('0x4e')](db[_0x67d8('0xd2')][_0x67d8('0x35')]);_0x59ca76[_0x67d8('0x3b')]=_['keys'](_0x544b40[_0x67d8('0x3b')]);_0x59ca76[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0x59ca76[_0x67d8('0x4c')],_0x59ca76[_0x67d8('0x3b')]);_0x481d56[_0x67d8('0x40')]=_[_0x67d8('0x51')](_0x59ca76['model'],qs[_0x67d8('0x52')](_0x544b40[_0x67d8('0x3b')][_0x67d8('0x52')]));_0x481d56[_0x67d8('0x40')]=_0x481d56['attributes']['length']?_0x481d56[_0x67d8('0x40')]:_0x59ca76['model'];if(!_0x544b40['query']['hasOwnProperty'](_0x67d8('0xc9'))){_0x481d56[_0x67d8('0xca')]=qs[_0x67d8('0xca')](_0x544b40[_0x67d8('0x3b')]['limit']);_0x481d56[_0x67d8('0x20')]=qs[_0x67d8('0x20')](_0x544b40[_0x67d8('0x3b')]['offset']);}_0x481d56['order']=qs[_0x67d8('0xc0')](_0x544b40['query'][_0x67d8('0xc0')]);_0x481d56[_0x67d8('0x3a')]=qs[_0x67d8('0x50')](_[_0x67d8('0xc1')](_0x544b40[_0x67d8('0x3b')],_0x59ca76['filters']));_0x481d56[_0x67d8('0x3a')][_0x67d8('0xd3')]=_0x3f9802['id'];if(_0x544b40['query']['filter']){_0x481d56['where']=_[_0x67d8('0xc2')](_0x481d56[_0x67d8('0x3a')],{'$or':_[_0x67d8('0x36')](_0x481d56[_0x67d8('0x40')],function(_0x16c21b){var _0x349ed0={};_0x349ed0[_0x16c21b]={'$like':'%'+_0x544b40[_0x67d8('0x3b')][_0x67d8('0x2b')]+'%'};return _0x349ed0;})});}_0x481d56=_[_0x67d8('0xc2')]({},_0x481d56,_0x544b40[_0x67d8('0x54')]);return db[_0x67d8('0xd2')][_0x67d8('0x1f')]({'where':_0x481d56['where']})[_0x67d8('0x11')](function(_0x1cb459){_0x49a249[_0x67d8('0x1f')]=_0x1cb459;if(_0x544b40['query'][_0x67d8('0x53')]){_0x481d56['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x67d8('0x85')](_0x481d56);})[_0x67d8('0x11')](function(_0x59f646){_0x49a249[_0x67d8('0x42')]=_0x59f646;return _0x49a249;});}})[_0x67d8('0x11')](respondWithFilteredResult(_0x391615,_0x481d56))[_0x67d8('0x1a')](handleError(_0x391615,null));};exports['getChatInteractions']=function(_0x1bb447,_0x5739e8){var _0x5f5b56={};var _0x26d17a={};var _0x14b983;var _0x2ce40c;return db[_0x67d8('0x34')]['findOne']({'where':{'id':_0x1bb447[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x5739e8,null))[_0x67d8('0x11')](function(_0x42f8f4){if(_0x42f8f4){_0x14b983=_0x42f8f4;_0x26d17a[_0x67d8('0x4c')]=_[_0x67d8('0x4e')](db[_0x67d8('0xd4')]['rawAttributes']);_0x26d17a[_0x67d8('0x3b')]=_['keys'](_0x1bb447[_0x67d8('0x3b')]);_0x26d17a[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0x26d17a['model'],_0x26d17a[_0x67d8('0x3b')]);_0x5f5b56[_0x67d8('0x40')]=_[_0x67d8('0x51')](_0x26d17a[_0x67d8('0x4c')],qs[_0x67d8('0x52')](_0x1bb447[_0x67d8('0x3b')][_0x67d8('0x52')]));_0x5f5b56[_0x67d8('0x40')]=_0x5f5b56[_0x67d8('0x40')][_0x67d8('0x43')]?_0x5f5b56[_0x67d8('0x40')]:_0x26d17a['model'];_0x5f5b56[_0x67d8('0xbf')]=qs[_0x67d8('0xc0')](_0x1bb447[_0x67d8('0x3b')]['sort']);_0x5f5b56['where']=qs[_0x67d8('0x50')](_['pick'](_0x1bb447[_0x67d8('0x3b')],_0x26d17a[_0x67d8('0x50')]));if(_0x1bb447[_0x67d8('0x3b')][_0x67d8('0x2b')]){_0x5f5b56[_0x67d8('0x3a')]=_[_0x67d8('0xc2')](_0x5f5b56['where'],{'$or':_[_0x67d8('0x36')](_0x5f5b56[_0x67d8('0x40')],function(_0x204e4d){var _0x3a3903={};_0x3a3903[_0x204e4d]={'$like':'%'+_0x1bb447[_0x67d8('0x3b')][_0x67d8('0x2b')]+'%'};return _0x3a3903;})});}_0x5f5b56=_[_0x67d8('0xc2')]({},_0x5f5b56,_0x1bb447[_0x67d8('0x54')]);return _0x14b983[_0x67d8('0xd5')](_0x5f5b56);}})[_0x67d8('0x11')](function(_0x1e823e){if(_0x1e823e){_0x2ce40c=_0x1e823e[_0x67d8('0x43')];if(!_0x1bb447[_0x67d8('0x3b')]['hasOwnProperty'](_0x67d8('0xc9'))){_0x5f5b56['limit']=qs[_0x67d8('0xca')](_0x1bb447['query']['limit']);_0x5f5b56['offset']=qs[_0x67d8('0x20')](_0x1bb447[_0x67d8('0x3b')][_0x67d8('0x20')]);}return _0x14b983[_0x67d8('0xd5')](_0x5f5b56);}})[_0x67d8('0x11')](function(_0x263c44){if(_0x263c44){return _0x263c44?{'count':_0x2ce40c,'rows':_0x263c44}:null;}})[_0x67d8('0x11')](respondWithResult(_0x5739e8,null))[_0x67d8('0x1a')](handleError(_0x5739e8,null));};exports[_0x67d8('0xd6')]=function(_0x1441c2,_0x50a4a8){var _0x4a6915={};var _0xf96470={};var _0x2d2d0b;var _0x1e7a91;return db['User']['findOne']({'where':{'id':_0x1441c2[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x50a4a8,null))[_0x67d8('0x11')](function(_0x726045){if(_0x726045){_0x2d2d0b=_0x726045;_0xf96470['model']=_['keys'](db[_0x67d8('0xd7')][_0x67d8('0x35')]);_0xf96470[_0x67d8('0x3b')]=_[_0x67d8('0x4e')](_0x1441c2[_0x67d8('0x3b')]);_0xf96470[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0xf96470[_0x67d8('0x4c')],_0xf96470[_0x67d8('0x3b')]);_0x4a6915[_0x67d8('0x40')]=_[_0x67d8('0x51')](_0xf96470[_0x67d8('0x4c')],qs[_0x67d8('0x52')](_0x1441c2[_0x67d8('0x3b')][_0x67d8('0x52')]));_0x4a6915[_0x67d8('0x40')]=_0x4a6915[_0x67d8('0x40')][_0x67d8('0x43')]?_0x4a6915[_0x67d8('0x40')]:_0xf96470[_0x67d8('0x4c')];_0x4a6915['order']=qs['sort'](_0x1441c2[_0x67d8('0x3b')]['sort']);_0x4a6915[_0x67d8('0x3a')]=qs['filters'](_[_0x67d8('0xc1')](_0x1441c2[_0x67d8('0x3b')],_0xf96470[_0x67d8('0x50')]));if(_0x1441c2['query'][_0x67d8('0x2b')]){_0x4a6915[_0x67d8('0x3a')]=_[_0x67d8('0xc2')](_0x4a6915[_0x67d8('0x3a')],{'$or':_[_0x67d8('0x36')](_0x4a6915[_0x67d8('0x40')],function(_0x55dd3f){var _0x25011b={};_0x25011b[_0x55dd3f]={'$like':'%'+_0x1441c2[_0x67d8('0x3b')][_0x67d8('0x2b')]+'%'};return _0x25011b;})});}_0x4a6915=_['merge']({},_0x4a6915,_0x1441c2[_0x67d8('0x54')]);return _0x2d2d0b[_0x67d8('0xd6')](_0x4a6915);}})['then'](function(_0x1f9874){if(_0x1f9874){_0x1e7a91=_0x1f9874['length'];if(!_0x1441c2[_0x67d8('0x3b')]['hasOwnProperty'](_0x67d8('0xc9'))){_0x4a6915[_0x67d8('0xca')]=qs[_0x67d8('0xca')](_0x1441c2[_0x67d8('0x3b')][_0x67d8('0xca')]);_0x4a6915[_0x67d8('0x20')]=qs[_0x67d8('0x20')](_0x1441c2[_0x67d8('0x3b')][_0x67d8('0x20')]);}return _0x2d2d0b[_0x67d8('0xd6')](_0x4a6915);}})[_0x67d8('0x11')](function(_0x4141d1){if(_0x4141d1){return _0x4141d1?{'count':_0x1e7a91,'rows':_0x4141d1}:null;}})[_0x67d8('0x11')](respondWithResult(_0x50a4a8,null))[_0x67d8('0x1a')](handleError(_0x50a4a8,null));};exports[_0x67d8('0xd8')]=function(_0x3d154a,_0x1cbedd){var _0xcf34e4={'raw':!![],'where':{}};var _0x1be27c={};var _0x571d47={'count':0x0,'rows':[]};return db[_0x67d8('0x34')][_0x67d8('0x92')]({'where':{'id':_0x3d154a['params']['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x1cbedd,null))[_0x67d8('0x11')](function(_0x275226){if(_0x275226){_0x1be27c[_0x67d8('0x4c')]=_[_0x67d8('0x4e')](db[_0x67d8('0xd9')][_0x67d8('0x35')]);_0x1be27c['query']=_[_0x67d8('0x4e')](_0x3d154a[_0x67d8('0x3b')]);_0x1be27c[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0x1be27c[_0x67d8('0x4c')],_0x1be27c[_0x67d8('0x3b')]);_0xcf34e4[_0x67d8('0x40')]=_['intersection'](_0x1be27c[_0x67d8('0x4c')],qs[_0x67d8('0x52')](_0x3d154a[_0x67d8('0x3b')][_0x67d8('0x52')]));_0xcf34e4[_0x67d8('0x40')]=_0xcf34e4[_0x67d8('0x40')][_0x67d8('0x43')]?_0xcf34e4[_0x67d8('0x40')]:_0x1be27c[_0x67d8('0x4c')];if(!_0x3d154a[_0x67d8('0x3b')]['hasOwnProperty'](_0x67d8('0xc9'))){_0xcf34e4[_0x67d8('0xca')]=qs[_0x67d8('0xca')](_0x3d154a[_0x67d8('0x3b')][_0x67d8('0xca')]);_0xcf34e4[_0x67d8('0x20')]=qs[_0x67d8('0x20')](_0x3d154a['query'][_0x67d8('0x20')]);}_0xcf34e4[_0x67d8('0xbf')]=qs[_0x67d8('0xc0')](_0x3d154a[_0x67d8('0x3b')]['sort']);_0xcf34e4[_0x67d8('0x3a')]=qs['filters'](_[_0x67d8('0xc1')](_0x3d154a[_0x67d8('0x3b')],_0x1be27c[_0x67d8('0x50')]));_0xcf34e4[_0x67d8('0x3a')][_0x67d8('0xd3')]=_0x275226['id'];if(_0x3d154a[_0x67d8('0x3b')][_0x67d8('0x2b')]){_0xcf34e4[_0x67d8('0x3a')]=_['merge'](_0xcf34e4[_0x67d8('0x3a')],{'$or':_[_0x67d8('0x36')](_0xcf34e4[_0x67d8('0x40')],function(_0x3dd6ea){var _0x549193={};_0x549193[_0x3dd6ea]={'$like':'%'+_0x3d154a['query']['filter']+'%'};return _0x549193;})});}_0xcf34e4=_['merge']({},_0xcf34e4,_0x3d154a[_0x67d8('0x54')]);return db[_0x67d8('0xd9')][_0x67d8('0x1f')]({'where':_0xcf34e4[_0x67d8('0x3a')]})[_0x67d8('0x11')](function(_0x20502f){_0x571d47[_0x67d8('0x1f')]=_0x20502f;if(_0x3d154a['query']['includeAll']){_0xcf34e4[_0x67d8('0x3c')]=[{'all':!![]}];}return db[_0x67d8('0xd9')][_0x67d8('0x85')](_0xcf34e4);})[_0x67d8('0x11')](function(_0x271f4b){_0x571d47[_0x67d8('0x42')]=_0x271f4b;return _0x571d47;});}})[_0x67d8('0x11')](respondWithFilteredResult(_0x1cbedd,_0xcf34e4))[_0x67d8('0x1a')](handleError(_0x1cbedd,null));};exports[_0x67d8('0xda')]=function(_0x256943,_0x1cd3c9){var _0x4eea8d={};var _0x127378={};var _0x4844e6;var _0xec19f7;return db[_0x67d8('0x34')][_0x67d8('0x92')]({'where':{'id':_0x256943[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x1cd3c9,null))[_0x67d8('0x11')](function(_0x5b911f){if(_0x5b911f){_0x4844e6=_0x5b911f;_0x127378[_0x67d8('0x4c')]=_[_0x67d8('0x4e')](db[_0x67d8('0xdb')][_0x67d8('0x35')]);_0x127378[_0x67d8('0x3b')]=_[_0x67d8('0x4e')](_0x256943[_0x67d8('0x3b')]);_0x127378['filters']=_[_0x67d8('0x51')](_0x127378[_0x67d8('0x4c')],_0x127378[_0x67d8('0x3b')]);_0x4eea8d[_0x67d8('0x40')]=_['intersection'](_0x127378['model'],qs[_0x67d8('0x52')](_0x256943[_0x67d8('0x3b')][_0x67d8('0x52')]));_0x4eea8d[_0x67d8('0x40')]=_0x4eea8d[_0x67d8('0x40')][_0x67d8('0x43')]?_0x4eea8d['attributes']:_0x127378[_0x67d8('0x4c')];_0x4eea8d[_0x67d8('0xbf')]=qs[_0x67d8('0xc0')](_0x256943['query'][_0x67d8('0xc0')]);_0x4eea8d['where']=qs[_0x67d8('0x50')](_[_0x67d8('0xc1')](_0x256943[_0x67d8('0x3b')],_0x127378[_0x67d8('0x50')]));if(_0x256943['query'][_0x67d8('0x2b')]){_0x4eea8d[_0x67d8('0x3a')]=_[_0x67d8('0xc2')](_0x4eea8d[_0x67d8('0x3a')],{'$or':_[_0x67d8('0x36')](_0x4eea8d[_0x67d8('0x40')],function(_0x4c5187){var _0x29c682={};_0x29c682[_0x4c5187]={'$like':'%'+_0x256943[_0x67d8('0x3b')][_0x67d8('0x2b')]+'%'};return _0x29c682;})});}_0x4eea8d=_[_0x67d8('0xc2')]({},_0x4eea8d,_0x256943[_0x67d8('0x54')]);return _0x4844e6[_0x67d8('0xda')](_0x4eea8d);}})[_0x67d8('0x11')](function(_0x17d67c){if(_0x17d67c){_0xec19f7=_0x17d67c[_0x67d8('0x43')];if(!_0x256943[_0x67d8('0x3b')][_0x67d8('0xc8')](_0x67d8('0xc9'))){_0x4eea8d['limit']=qs[_0x67d8('0xca')](_0x256943[_0x67d8('0x3b')][_0x67d8('0xca')]);_0x4eea8d[_0x67d8('0x20')]=qs[_0x67d8('0x20')](_0x256943[_0x67d8('0x3b')]['offset']);}return _0x4844e6[_0x67d8('0xda')](_0x4eea8d);}})[_0x67d8('0x11')](function(_0x6672e){if(_0x6672e){return _0x6672e?{'count':_0xec19f7,'rows':_0x6672e}:null;}})[_0x67d8('0x11')](respondWithResult(_0x1cd3c9,null))[_0x67d8('0x1a')](handleError(_0x1cd3c9,null));};exports[_0x67d8('0xdc')]=function(_0x19c968,_0x394a82){var _0x2ed516={};var _0x3594f9={};var _0x5e296b;var _0x4b9312;return db['User'][_0x67d8('0x92')]({'where':{'id':_0x19c968['params']['id']}})['then'](handleEntityNotFound(_0x394a82,null))[_0x67d8('0x11')](function(_0x52f5a1){if(_0x52f5a1){_0x5e296b=_0x52f5a1;_0x3594f9[_0x67d8('0x4c')]=_[_0x67d8('0x4e')](db[_0x67d8('0xdd')][_0x67d8('0x35')]);_0x3594f9[_0x67d8('0x3b')]=_[_0x67d8('0x4e')](_0x19c968[_0x67d8('0x3b')]);_0x3594f9[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0x3594f9['model'],_0x3594f9[_0x67d8('0x3b')]);_0x2ed516[_0x67d8('0x40')]=_[_0x67d8('0x51')](_0x3594f9[_0x67d8('0x4c')],qs[_0x67d8('0x52')](_0x19c968['query'][_0x67d8('0x52')]));_0x2ed516[_0x67d8('0x40')]=_0x2ed516['attributes'][_0x67d8('0x43')]?_0x2ed516[_0x67d8('0x40')]:_0x3594f9[_0x67d8('0x4c')];_0x2ed516[_0x67d8('0xbf')]=qs[_0x67d8('0xc0')](_0x19c968[_0x67d8('0x3b')]['sort']);_0x2ed516[_0x67d8('0x3a')]=qs[_0x67d8('0x50')](_[_0x67d8('0xc1')](_0x19c968[_0x67d8('0x3b')],_0x3594f9['filters']));if(_0x19c968['query'][_0x67d8('0x2b')]){_0x2ed516[_0x67d8('0x3a')]=_['merge'](_0x2ed516[_0x67d8('0x3a')],{'$or':_[_0x67d8('0x36')](_0x2ed516[_0x67d8('0x40')],function(_0x3e5129){var _0x1fd15d={};_0x1fd15d[_0x3e5129]={'$like':'%'+_0x19c968[_0x67d8('0x3b')][_0x67d8('0x2b')]+'%'};return _0x1fd15d;})});}_0x2ed516=_[_0x67d8('0xc2')]({},_0x2ed516,_0x19c968[_0x67d8('0x54')]);return _0x5e296b[_0x67d8('0xdc')](_0x2ed516);}})[_0x67d8('0x11')](function(_0x43b296){if(_0x43b296){_0x4b9312=_0x43b296[_0x67d8('0x43')];if(!_0x19c968[_0x67d8('0x3b')][_0x67d8('0xc8')](_0x67d8('0xc9'))){_0x2ed516[_0x67d8('0xca')]=qs['limit'](_0x19c968[_0x67d8('0x3b')]['limit']);_0x2ed516['offset']=qs[_0x67d8('0x20')](_0x19c968[_0x67d8('0x3b')][_0x67d8('0x20')]);}return _0x5e296b[_0x67d8('0xdc')](_0x2ed516);}})[_0x67d8('0x11')](function(_0x2afbbd){if(_0x2afbbd){return _0x2afbbd?{'count':_0x4b9312,'rows':_0x2afbbd}:null;}})[_0x67d8('0x11')](respondWithResult(_0x394a82,null))[_0x67d8('0x1a')](handleError(_0x394a82,null));};exports[_0x67d8('0xde')]=function(_0x2bd850,_0x3633af){var _0x1168d1={};var _0x36ee43={};var _0x38ac7f;var _0x14a324;return db[_0x67d8('0x34')][_0x67d8('0x92')]({'where':{'id':_0x2bd850[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x3633af,null))[_0x67d8('0x11')](function(_0x252093){if(_0x252093){_0x38ac7f=_0x252093;_0x36ee43[_0x67d8('0x4c')]=_[_0x67d8('0x4e')](db[_0x67d8('0xdf')][_0x67d8('0x35')]);_0x36ee43[_0x67d8('0x3b')]=_[_0x67d8('0x4e')](_0x2bd850[_0x67d8('0x3b')]);_0x36ee43[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0x36ee43['model'],_0x36ee43[_0x67d8('0x3b')]);_0x1168d1[_0x67d8('0x40')]=_['intersection'](_0x36ee43[_0x67d8('0x4c')],qs[_0x67d8('0x52')](_0x2bd850[_0x67d8('0x3b')][_0x67d8('0x52')]));_0x1168d1[_0x67d8('0x40')]=_0x1168d1['attributes']['length']?_0x1168d1[_0x67d8('0x40')]:_0x36ee43[_0x67d8('0x4c')];_0x1168d1['order']=qs[_0x67d8('0xc0')](_0x2bd850[_0x67d8('0x3b')]['sort']);_0x1168d1['where']=qs[_0x67d8('0x50')](_[_0x67d8('0xc1')](_0x2bd850[_0x67d8('0x3b')],_0x36ee43['filters']));if(_0x2bd850['query'][_0x67d8('0x2b')]){_0x1168d1[_0x67d8('0x3a')]=_[_0x67d8('0xc2')](_0x1168d1[_0x67d8('0x3a')],{'$or':_['map'](_0x1168d1[_0x67d8('0x40')],function(_0x370bea){var _0x27287a={};_0x27287a[_0x370bea]={'$like':'%'+_0x2bd850[_0x67d8('0x3b')][_0x67d8('0x2b')]+'%'};return _0x27287a;})});}_0x1168d1=_[_0x67d8('0xc2')]({},_0x1168d1,_0x2bd850['options']);return _0x38ac7f['getWhatsappInteractions'](_0x1168d1);}})[_0x67d8('0x11')](function(_0x2add4c){if(_0x2add4c){_0x14a324=_0x2add4c[_0x67d8('0x43')];if(!_0x2bd850[_0x67d8('0x3b')][_0x67d8('0xc8')]('nolimit')){_0x1168d1[_0x67d8('0xca')]=qs[_0x67d8('0xca')](_0x2bd850[_0x67d8('0x3b')]['limit']);_0x1168d1[_0x67d8('0x20')]=qs[_0x67d8('0x20')](_0x2bd850[_0x67d8('0x3b')][_0x67d8('0x20')]);}return _0x38ac7f[_0x67d8('0xde')](_0x1168d1);}})['then'](function(_0x1d87cb){if(_0x1d87cb){return _0x1d87cb?{'count':_0x14a324,'rows':_0x1d87cb}:null;}})[_0x67d8('0x11')](respondWithResult(_0x3633af,null))[_0x67d8('0x1a')](handleError(_0x3633af,null));};exports['login']=function(_0x43037e,_0x11a5c2,_0x4c0a78){var _0x1e2e5a;var _0x2aa96f;var _0x4149c0;var _0x32a216=!_[_0x67d8('0x63')](_0x43037e['params']['id'])?_0x43037e[_0x67d8('0x4b')]['id']:!_[_0x67d8('0x63')](_0x43037e[_0x67d8('0x26')]['id'])?_0x43037e['user']['id']:null;return db[_0x67d8('0x34')][_0x67d8('0x55')]({'where':{'id':_0x32a216,'role':{'$or':['admin','user',_0x67d8('0x28')]}},'attributes':['id',_0x67d8('0x2f'),'phone','mobile',_0x67d8('0x5a'),'internal',_0x67d8('0x98')]})[_0x67d8('0x11')](function(_0x10e00e){if(_0x10e00e){if(_0x10e00e['role']==='agent'){_0x1e2e5a=_0x10e00e;if(_0x43037e[_0x67d8('0x59')][_0x67d8('0x99')]){_0x4149c0=util[_0x67d8('0xa7')](_0x67d8('0xe0'),_0x1e2e5a[_0x43037e[_0x67d8('0x59')]['interface']]);}else if(_0x43037e[_0x67d8('0x59')]['intrf']){_0x4149c0=util[_0x67d8('0xa7')](_0x67d8('0xa8'),_0x43037e['body'][_0x67d8('0xe1')]);}else{_0x4149c0=util[_0x67d8('0xa7')](_0x67d8('0xa8'),_0x1e2e5a[_0x67d8('0x2f')]);}socket['to'](util['format'](_0x67d8('0xe2'),_0x1e2e5a[_0x67d8('0x2f')]))['emit']('user:forcelogout',{'user':{'id':_0x1e2e5a['id'],'name':_0x1e2e5a[_0x67d8('0x2f')]},'ip':_0x43037e[_0x67d8('0xe3')][_0x67d8('0xe4')]||_0x43037e[_0x67d8('0xe5')]['remoteAddress']||_0x43037e[_0x67d8('0xe6')]['remoteAddress']||_0x43037e[_0x67d8('0xe5')][_0x67d8('0xe6')][_0x67d8('0xe7')]});return db[_0x67d8('0xa9')][_0x67d8('0x30')]({'where':{'membername':_0x1e2e5a[_0x67d8('0x2f')]},'individualHooks':!![]});}}else{throw new db[(_0x67d8('0x8b'))]['ValidationError'](_0x67d8('0xe8'));}})[_0x67d8('0x11')](function(){if(_0x1e2e5a){return _0x1e2e5a[_0x67d8('0xe9')]({'raw':!![]});}})[_0x67d8('0x11')](function(_0x1e33ac){if(_0x1e2e5a){var _0xf86bb6=[];if(_0x1e33ac){_0x2aa96f=_0x1e33ac;if(_0x2aa96f['length']){for(var _0x550467=0x0;_0x550467<_0x2aa96f[_0x67d8('0x43')];_0x550467++){_0xf86bb6[_0x67d8('0x41')]({'membername':_0x1e2e5a['name'],'UserId':_0x1e2e5a['id'],'queue_name':_0x2aa96f[_0x550467]['name'],'VoiceQueueId':_0x2aa96f[_0x550467]['id'],'interface':_0x4149c0,'paused':_0x1e2e5a[_0x67d8('0x98')]||![],'penalty':_0x2aa96f[_0x550467][_0x67d8('0xea')]||0x0});}return BPromise[_0x67d8('0x84')](_0xf86bb6,function(_0x39bbf7){return db[_0x67d8('0xa9')][_0x67d8('0xeb')](_0x39bbf7);});}}}})[_0x67d8('0x11')](function(){if(_0x1e2e5a){return db['MemberReport'][_0x67d8('0x85')]({'where':{'membername':_0x1e2e5a[_0x67d8('0x2f')],'exitAt':null}});}})['then'](function(_0x131688){if(_0x1e2e5a){var _0x4b6bb3=[];_0x131688[_0x67d8('0xec')](function(_0x18f8ef){_0x4b6bb3[_0x67d8('0x41')](_0x18f8ef['update']({'exitAt':moment()['format'](_0x67d8('0xed'))}));});return BPromise['all'](_0x4b6bb3);}})[_0x67d8('0x11')](function(){if(_0x1e2e5a){var _0x59549c=[];var _0x555f20=[];var _0x437958=utils['getChannels']();var _0x34a8b2={'membername':_0x1e2e5a[_0x67d8('0x2f')],'interface':_0x4149c0,'enterAt':moment()[_0x67d8('0xa7')](_0x67d8('0xed')),'role':_0x1e2e5a[_0x67d8('0x5a')],'internal':_0x1e2e5a[_0x67d8('0x5f')]};_0x437958['forEach'](function(_0x33f978){_0x59549c[_0x67d8('0x41')](_[_0x67d8('0xc2')]({'channel':_0x33f978,'type':_0x67d8('0xee'),'data1':_0x43037e[_0x67d8('0x59')]['device'],'data2':_0x4149c0},_0x34a8b2));if(_0x1e2e5a[_0x67d8('0x98')]){_0x555f20[_0x67d8('0x41')](_[_0x67d8('0xc2')]({'channel':_0x33f978,'type':_0x67d8('0xef'),'data1':_0x67d8('0xf0')},_0x34a8b2));}});return db[_0x67d8('0xf1')][_0x67d8('0x81')](_0x59549c[_0x67d8('0xbc')](_0x555f20),{'individualHooks':!![]});}})[_0x67d8('0x11')](function(){if(_0x1e2e5a){return _0x1e2e5a[_0x67d8('0x23')]({'online':!![],'lastLoginAt':moment()['format'](_0x67d8('0xed')),'voicePause':_0x1e2e5a[_0x67d8('0x98')]||![],'mailPause':_0x1e2e5a[_0x67d8('0x98')]||![],'chatPause':_0x1e2e5a[_0x67d8('0x98')]||![],'faxPause':_0x1e2e5a[_0x67d8('0x98')]||![],'smsPause':_0x1e2e5a['loginInPause']||![],'openchannelPause':_0x1e2e5a['loginInPause']||![],'whatsappPause':_0x1e2e5a[_0x67d8('0x98')]||![],'pauseType':_0x1e2e5a[_0x67d8('0x98')]?_0x67d8('0xf0'):null,'interface':_0x4149c0,'lastPauseAt':moment()[_0x67d8('0xa7')](_0x67d8('0xed'))});}})[_0x67d8('0x11')](function(_0x10c2be){if(_0x43037e['isMiddleware']){return _0x4c0a78();}else{return BPromise[_0x67d8('0xf2')](_0x10c2be)[_0x67d8('0x11')](respondWithResult(_0x11a5c2,null));}})[_0x67d8('0x1a')](handleError(_0x11a5c2,null));};exports[_0x67d8('0xf3')]=function(_0x33f125,_0x3d1829){var _0x3c3446;return db[_0x67d8('0x34')][_0x67d8('0x55')]({'where':{'id':_0x33f125['params']['id'],'role':_0x67d8('0x28')},'attributes':['id',_0x67d8('0x2f'),'role']})[_0x67d8('0x11')](handleEntityNotFound(_0x3d1829,null))[_0x67d8('0x11')](function(_0x36127f){if(_0x36127f){_0x3c3446=_0x36127f;return db[_0x67d8('0xa9')][_0x67d8('0x30')]({'where':{'membername':_0x3c3446[_0x67d8('0x2f')]},'individualHooks':!![]});}})[_0x67d8('0x11')](function(){return db[_0x67d8('0xf1')]['findAll']({'where':{'membername':_0x3c3446[_0x67d8('0x2f')],'exitAt':null}});})[_0x67d8('0x11')](function(_0x5b21cb){var _0x22cfc3=[];_0x5b21cb[_0x67d8('0xec')](function(_0x10abe7){_0x22cfc3[_0x67d8('0x41')](_0x10abe7['update']({'exitAt':moment()['format'](_0x67d8('0xed'))}));});return BPromise[_0x67d8('0x58')](_0x22cfc3);})[_0x67d8('0x11')](function(){return _0x3c3446[_0x67d8('0x23')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x3d1829,null))[_0x67d8('0x1a')](handleError(_0x3d1829,null));};exports['pause']=function(_0x5973e0,_0x5aa69f){var _0x10a427;return db[_0x67d8('0xa9')][_0x67d8('0x23')]({'paused':0x1},{'where':{'UserId':_0x5973e0[_0x67d8('0x4b')]['id']},'individualHooks':!![]})[_0x67d8('0x11')](function(){return db[_0x67d8('0x34')][_0x67d8('0x55')]({'where':{'id':_0x5973e0[_0x67d8('0x4b')]['id'],'role':'agent'},'attributes':['id',_0x67d8('0x2f'),_0x67d8('0x5a'),'internal',_0x67d8('0x99')]});})[_0x67d8('0x11')](handleEntityNotFound(_0x5aa69f,null))['then'](function(_0x5b3b31){if(_0x5b3b31){_0x10a427=_0x5b3b31;return respondWithRpcPromise('QueuePause',_0x67d8('0xf4'),{'id':_0x10a427['id'],'name':_0x10a427['name'],'pause':!![]});}})[_0x67d8('0x11')](function(){if(_0x10a427){return db['MemberReport'][_0x67d8('0x85')]({'where':{'membername':_0x10a427[_0x67d8('0x2f')],'type':_0x67d8('0xef'),'exitAt':null}});}})[_0x67d8('0x11')](function(_0x17dc3e){if(_0x17dc3e['length']){var _0x57279b=moment()[_0x67d8('0xa7')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4c0e14=0x0,_0x949287=_0x17dc3e['length'];_0x4c0e14<_0x949287;_0x4c0e14++){_0x17dc3e[_0x4c0e14][_0x67d8('0xf5')]({'exitAt':_0x57279b});}}})[_0x67d8('0x11')](function(){var _0x5096b2=[];var _0x2a02d6=utils[_0x67d8('0xf6')]();_0x2a02d6[_0x67d8('0xec')](function(_0x1a4fdb){_0x5096b2[_0x67d8('0x41')]({'channel':_0x1a4fdb,'membername':_0x10a427[_0x67d8('0x2f')],'interface':_[_0x67d8('0x63')](_0x10a427[_0x67d8('0x99')])?util[_0x67d8('0xa7')](_0x67d8('0xa8'),_0x10a427[_0x67d8('0x2f')]):_0x10a427[_0x67d8('0x99')],'type':_0x67d8('0xef'),'enterAt':moment()['format'](_0x67d8('0xed')),'data1':_0x5973e0[_0x67d8('0x59')]['type']||_0x67d8('0xf7'),'role':_0x10a427['role'],'internal':_0x10a427[_0x67d8('0x5f')]});});return db[_0x67d8('0xf1')][_0x67d8('0x81')](_0x5096b2,{'individualHooks':!![]});})[_0x67d8('0x11')](function(){return _0x10a427[_0x67d8('0x23')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5973e0[_0x67d8('0x59')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x67d8('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x67d8('0x11')](respondWithResult(_0x5aa69f,null))['catch'](handleError(_0x5aa69f,null));};exports[_0x67d8('0xf8')]=function(_0x484c2b,_0x4bf4cb){var _0x4de591;return db[_0x67d8('0x34')][_0x67d8('0x55')]({'where':{'id':_0x484c2b[_0x67d8('0x4b')]['id']},'attributes':['id',_0x67d8('0x2f'),_0x67d8('0x5a'),_0x67d8('0xf9'),'mailPause',_0x67d8('0xfa'),_0x67d8('0xfb'),_0x67d8('0xfc'),_0x67d8('0xfd'),_0x67d8('0xfe'),_0x67d8('0xff'),_0x67d8('0x100')]})['then'](handleEntityNotFound(_0x4bf4cb,null))[_0x67d8('0x11')](function(_0x2829e2){if(_0x2829e2){_0x4de591=_0x2829e2;if(_0x484c2b['body']['channel']&&!utils[_0x67d8('0x9a')](_0x484c2b[_0x67d8('0x59')]['channel'])){throw new db[(_0x67d8('0x8b'))][(_0x67d8('0x8c'))]('Unknown\x20channel');}switch(_0x484c2b[_0x67d8('0x59')][_0x67d8('0x97')]){case _0x67d8('0xa4'):return respondWithRpcPromise(_0x67d8('0x101'),'unpause',{'id':_0x4de591['id'],'name':_0x4de591['name'],'pause':![]})[_0x67d8('0x11')](function(){return db[_0x67d8('0xa9')][_0x67d8('0x23')]({'paused':0x0},{'where':{'UserId':_0x4de591['id']},'individualHooks':!![]});})[_0x67d8('0x11')](function(){return db['MemberReport'][_0x67d8('0x55')]({'where':{'channel':_0x484c2b[_0x67d8('0x59')][_0x67d8('0x97')],'membername':_0x4de591['name'],'type':_0x67d8('0xef'),'exitAt':null}});})[_0x67d8('0x11')](function(_0x32e019){if(_0x32e019){return _0x32e019[_0x67d8('0x23')]({'exitAt':moment()[_0x67d8('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x67d8('0x102')},{'individualHooks':!![]});}return null;})[_0x67d8('0x11')](function(){return _0x4de591[_0x67d8('0x23')]({'voicePause':![]});});case'mail':case _0x67d8('0x57'):case _0x67d8('0x46'):case _0x67d8('0x45'):case'whatsapp':case'openchannel':return db[_0x67d8('0xf1')][_0x67d8('0x55')]({'where':{'channel':_0x484c2b[_0x67d8('0x59')]['channel'],'membername':_0x4de591[_0x67d8('0x2f')],'type':_0x67d8('0xef'),'exitAt':null}})[_0x67d8('0x11')](function(_0x24acf2){if(_0x24acf2){return _0x24acf2[_0x67d8('0x23')]({'exitAt':moment()[_0x67d8('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x67d8('0x102')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x278690={};_[_0x67d8('0x21')](_0x278690,util[_0x67d8('0xa7')]('%s%s',_0x484c2b['body'][_0x67d8('0x97')],_0x67d8('0x103')),![]);return _0x4de591['update'](_0x278690);});default:return respondWithRpcPromise(_0x67d8('0x101'),'unpause',{'id':_0x4de591['id'],'name':_0x4de591['name'],'pause':![]})['then'](function(){return db[_0x67d8('0xa9')]['update']({'paused':0x0},{'where':{'UserId':_0x4de591['id']}});})[_0x67d8('0x11')](function(){return db[_0x67d8('0xf1')][_0x67d8('0x85')]({'where':{'membername':_0x4de591[_0x67d8('0x2f')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x9562){var _0x692ecc=[];_0x9562['forEach'](function(_0x312993){_0x692ecc[_0x67d8('0x41')](_0x312993[_0x67d8('0x23')]({'exitAt':moment()[_0x67d8('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'}));});return BPromise[_0x67d8('0x58')](_0x692ecc);})['then'](function(){return _0x4de591[_0x67d8('0x23')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x67d8('0x11')](respondWithResult(_0x4bf4cb,null))[_0x67d8('0x1a')](handleError(_0x4bf4cb,null));};exports[_0x67d8('0x104')]=function(_0x3b3c06,_0x157627){var _0x4d7b17={};var _0x55d16d={};var _0x21eea9;var _0x2cdd25;return db['User'][_0x67d8('0x92')]({'where':{'id':_0x3b3c06[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x157627,null))[_0x67d8('0x11')](function(_0x2b69bd){if(_0x2b69bd){_0x21eea9=_0x2b69bd;_0x55d16d[_0x67d8('0x4c')]=_['keys'](db[_0x67d8('0x105')]['rawAttributes']);_0x55d16d[_0x67d8('0x3b')]=_[_0x67d8('0x4e')](_0x3b3c06[_0x67d8('0x3b')]);_0x55d16d[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0x55d16d['model'],_0x55d16d['query']);_0x4d7b17[_0x67d8('0x40')]=_[_0x67d8('0x51')](_0x55d16d['model'],qs['fields'](_0x3b3c06[_0x67d8('0x3b')][_0x67d8('0x52')]));_0x4d7b17[_0x67d8('0x40')]=_0x4d7b17[_0x67d8('0x40')][_0x67d8('0x43')]?_0x4d7b17['attributes']:_0x55d16d[_0x67d8('0x4c')];_0x4d7b17[_0x67d8('0xbf')]=qs[_0x67d8('0xc0')](_0x3b3c06[_0x67d8('0x3b')][_0x67d8('0xc0')]);_0x4d7b17[_0x67d8('0x3a')]=qs['filters'](_[_0x67d8('0xc1')](_0x3b3c06[_0x67d8('0x3b')],_0x55d16d[_0x67d8('0x50')]));if(_0x3b3c06[_0x67d8('0x3b')]['filter']){_0x4d7b17['where']=_[_0x67d8('0xc2')](_0x4d7b17['where'],{'$or':_[_0x67d8('0x36')](_0x4d7b17[_0x67d8('0x40')],function(_0x525cc0){var _0x31f814={};_0x31f814[_0x525cc0]={'$like':'%'+_0x3b3c06[_0x67d8('0x3b')][_0x67d8('0x2b')]+'%'};return _0x31f814;})});}_0x4d7b17=_[_0x67d8('0xc2')]({},_0x4d7b17,_0x3b3c06['options']);return _0x21eea9['getTeams'](_0x4d7b17);}})[_0x67d8('0x11')](function(_0x49a1d1){if(_0x49a1d1){_0x2cdd25=_0x49a1d1[_0x67d8('0x43')];if(!_0x3b3c06[_0x67d8('0x3b')][_0x67d8('0xc8')](_0x67d8('0xc9'))){_0x4d7b17['limit']=qs[_0x67d8('0xca')](_0x3b3c06[_0x67d8('0x3b')]['limit']);_0x4d7b17[_0x67d8('0x20')]=qs['offset'](_0x3b3c06[_0x67d8('0x3b')][_0x67d8('0x20')]);}return _0x21eea9['getTeams'](_0x4d7b17);}})[_0x67d8('0x11')](function(_0xb5301a){if(_0xb5301a){return _0xb5301a?{'count':_0x2cdd25,'rows':_0xb5301a}:null;}})[_0x67d8('0x11')](respondWithResult(_0x157627,null))['catch'](handleError(_0x157627,null));};exports[_0x67d8('0x106')]=function(_0x1b5840,_0x59803){return db[_0x67d8('0x34')]['find']({'where':{'id':_0x1b5840['params']['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x59803,null))['then'](function(_0x1becd3){if(_0x1becd3){var _0x136b50=_0x1becd3['get']({'plain':!![]});return _0x1becd3['addTeams'](_0x1b5840[_0x67d8('0x59')][_0x67d8('0x5d')],_[_0x67d8('0x5e')](_0x1b5840['body'],[_0x67d8('0x5d'),'id'])||{})[_0x67d8('0x11')](function(){for(var _0x1c0478=0x0;_0x1c0478<_0x1b5840[_0x67d8('0x59')][_0x67d8('0x5d')][_0x67d8('0x43')];_0x1c0478++){var _0x168c2e=[];var _0x13e939={};db['Team'][_0x67d8('0x92')]({'where':{'id':_0x1b5840[_0x67d8('0x59')][_0x67d8('0x5d')][_0x1c0478]}})['then'](function(_0x3e04b7){_0x13e939=_0x3e04b7[_0x67d8('0x44')];_0x168c2e[_0x67d8('0x41')](_0x3e04b7['getVoiceQueues']()['then'](function(_0x5b6e58){for(var _0x1dafba=0x0;_0x1dafba<_0x5b6e58[_0x67d8('0x43')];_0x1dafba++){_0x5b6e58[_0x1dafba][_0x67d8('0x107')](_0x67d8('0x97'),'Voice');}return _0x5b6e58;}));_0x168c2e['push'](_0x3e04b7['getChatQueues']()[_0x67d8('0x11')](function(_0x4aff65){for(var _0x27149b=0x0;_0x27149b<_0x4aff65['length'];_0x27149b++){_0x4aff65[_0x27149b]['setDataValue'](_0x67d8('0x97'),'Chat');}return _0x4aff65;}));_0x168c2e[_0x67d8('0x41')](_0x3e04b7[_0x67d8('0x108')]()['then'](function(_0x5d349f){for(var _0x20638d=0x0;_0x20638d<_0x5d349f[_0x67d8('0x43')];_0x20638d++){_0x5d349f[_0x20638d]['setDataValue'](_0x67d8('0x97'),'Mail');}return _0x5d349f;}));_0x168c2e[_0x67d8('0x41')](_0x3e04b7[_0x67d8('0x109')]()[_0x67d8('0x11')](function(_0x3e5f47){for(var _0x12904e=0x0;_0x12904e<_0x3e5f47['length'];_0x12904e++){_0x3e5f47[_0x12904e]['setDataValue'](_0x67d8('0x97'),_0x67d8('0x10a'));}return _0x3e5f47;}));_0x168c2e[_0x67d8('0x41')](_0x3e04b7[_0x67d8('0x10b')]()[_0x67d8('0x11')](function(_0x1c7b0a){for(var _0x543cea=0x0;_0x543cea<_0x1c7b0a['length'];_0x543cea++){_0x1c7b0a[_0x543cea]['setDataValue'](_0x67d8('0x97'),_0x67d8('0x10c'));}return _0x1c7b0a;}));_0x168c2e[_0x67d8('0x41')](_0x3e04b7[_0x67d8('0x10d')]()[_0x67d8('0x11')](function(_0x5eb717){for(var _0x88b593=0x0;_0x88b593<_0x5eb717['length'];_0x88b593++){_0x5eb717[_0x88b593][_0x67d8('0x107')](_0x67d8('0x97'),_0x67d8('0x10e'));}return _0x5eb717;}));_0x168c2e[_0x67d8('0x41')](_0x3e04b7['getOpenchannelQueues']()[_0x67d8('0x11')](function(_0x50c269){for(var _0x5d3280=0x0;_0x5d3280<_0x50c269[_0x67d8('0x43')];_0x5d3280++){_0x50c269[_0x5d3280][_0x67d8('0x107')](_0x67d8('0x97'),_0x67d8('0x10f'));}return _0x50c269;}));return BPromise[_0x67d8('0x58')](_0x168c2e);})['then'](function(_0x29af69){var _0x2b8630=_[_0x67d8('0x110')](_0x29af69);_0x168c2e=[];return db[_0x67d8('0x66')][_0x67d8('0x111')](function(_0x588b8b){for(var _0x5352f3=0x0;_0x5352f3<_0x2b8630[_0x67d8('0x43')];_0x5352f3++){_0x168c2e['push'](_0x2b8630[_0x5352f3][_0x67d8('0x112')](_0x136b50['id']),{'transaction':_0x588b8b});}return BPromise[_0x67d8('0x58')](_0x168c2e)['then'](function(){if(_0x136b50[_0x67d8('0xa6')]){return BPromise['each'](_[_0x67d8('0x2b')](_0x2b8630,function(_0x3a83fc){return _0x3a83fc[_0x67d8('0x113')](_0x67d8('0x97'))===_0x67d8('0x114');}),function(_0x361364){return db[_0x67d8('0xa9')]['upsert']({'membername':_0x136b50[_0x67d8('0x2f')],'UserId':_0x136b50['id'],'queue_name':_0x361364['name'],'VoiceQueueId':_0x361364['id'],'interface':_[_0x67d8('0x63')](_0x136b50[_0x67d8('0x99')])?util[_0x67d8('0xa7')](_0x67d8('0xa8'),_0x136b50['name']):_0x136b50[_0x67d8('0x99')],'paused':_0x136b50[_0x67d8('0xf9')]||![],'penalty':_0x136b50['penalty']},{'transaction':_0x588b8b});});}else{return;}})[_0x67d8('0x11')](function(){for(var _0x49b448=0x0;_0x49b448<_0x2b8630[_0x67d8('0x43')];_0x49b448++){var _0xd58ca=_0x2b8630[_0x49b448][_0x67d8('0x113')](_0x67d8('0x97'));var _0x552761=_0xd58ca+'QueueId';socket[_0x67d8('0xa0')](_0x67d8('0x26')+_0xd58ca+_0x67d8('0xa3'),{'UserId':_0x136b50['id'],['queueField']:_0x2b8630[_0x49b448]['id']});}});});})[_0x67d8('0x11')](function(){db[_0x67d8('0x115')]['findOne']({'where':{'teamId':_0x13e939['id']}})['then'](function(_0xf2d128){if(_0xf2d128){db[_0x67d8('0x116')][_0x67d8('0x7e')]({'UserId':_0x1b5840['params']['id'],'VoicePrefixId':_0xf2d128[_0x67d8('0x117')]});}});});}});}})[_0x67d8('0x11')](respondWithStatusCode(_0x59803,null))[_0x67d8('0x1a')](handleError(_0x59803,null));};exports[_0x67d8('0x118')]=function(_0x5373d9,_0x37532d){return db[_0x67d8('0x34')][_0x67d8('0x92')]({'where':{'id':_0x5373d9[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x37532d,null))[_0x67d8('0x11')](function(_0x205a0d){if(_0x205a0d){var _0xadc957=_0x205a0d[_0x67d8('0xa5')]({'plain':!![]});var _0x53f8c1=_0x5373d9[_0x67d8('0x3b')]['ids'];return _0x205a0d[_0x67d8('0x118')](_0x53f8c1)[_0x67d8('0x11')](function(){for(var _0x230c5f=0x0;_0x230c5f<_0x53f8c1['length'];_0x230c5f++){var _0x4a9755=[];var _0x4c493f={};db[_0x67d8('0x105')]['findOne']({'where':{'id':_0x53f8c1[_0x230c5f]}})[_0x67d8('0x11')](function(_0x215239){_0x4c493f=_0x215239[_0x67d8('0x44')];_0x4a9755[_0x67d8('0x41')](_0x215239[_0x67d8('0xe9')]()[_0x67d8('0x11')](function(_0x1b1801){for(var _0x1167a9=0x0;_0x1167a9<_0x1b1801[_0x67d8('0x43')];_0x1167a9++){_0x1b1801[_0x1167a9][_0x67d8('0x107')](_0x67d8('0x97'),'Voice');}return _0x1b1801;}));_0x4a9755[_0x67d8('0x41')](_0x215239[_0x67d8('0x119')]()[_0x67d8('0x11')](function(_0x1e3fab){for(var _0x45844f=0x0;_0x45844f<_0x1e3fab[_0x67d8('0x43')];_0x45844f++){_0x1e3fab[_0x45844f][_0x67d8('0x107')](_0x67d8('0x97'),_0x67d8('0x11a'));}return _0x1e3fab;}));_0x4a9755[_0x67d8('0x41')](_0x215239[_0x67d8('0x108')]()[_0x67d8('0x11')](function(_0x497a36){for(var _0x47cbd4=0x0;_0x47cbd4<_0x497a36['length'];_0x47cbd4++){_0x497a36[_0x47cbd4][_0x67d8('0x107')](_0x67d8('0x97'),_0x67d8('0x11b'));}return _0x497a36;}));_0x4a9755[_0x67d8('0x41')](_0x215239[_0x67d8('0x109')]()[_0x67d8('0x11')](function(_0x225128){for(var _0x227084=0x0;_0x227084<_0x225128[_0x67d8('0x43')];_0x227084++){_0x225128[_0x227084][_0x67d8('0x107')](_0x67d8('0x97'),_0x67d8('0x10a'));}return _0x225128;}));_0x4a9755[_0x67d8('0x41')](_0x215239[_0x67d8('0x10b')]()[_0x67d8('0x11')](function(_0x337d84){for(var _0x2e04d0=0x0;_0x2e04d0<_0x337d84['length'];_0x2e04d0++){_0x337d84[_0x2e04d0]['setDataValue']('channel',_0x67d8('0x10c'));}return _0x337d84;}));_0x4a9755[_0x67d8('0x41')](_0x215239[_0x67d8('0x10d')]()[_0x67d8('0x11')](function(_0x7b83a9){for(var _0xf99519=0x0;_0xf99519<_0x7b83a9[_0x67d8('0x43')];_0xf99519++){_0x7b83a9[_0xf99519][_0x67d8('0x107')](_0x67d8('0x97'),_0x67d8('0x10e'));}return _0x7b83a9;}));_0x4a9755[_0x67d8('0x41')](_0x215239[_0x67d8('0x11c')]()[_0x67d8('0x11')](function(_0x24de4f){for(var _0x227683=0x0;_0x227683<_0x24de4f[_0x67d8('0x43')];_0x227683++){_0x24de4f[_0x227683][_0x67d8('0x107')](_0x67d8('0x97'),_0x67d8('0x10f'));}return _0x24de4f;}));return BPromise['all'](_0x4a9755);})[_0x67d8('0x11')](function(_0x5f0937){var _0x4ea0f7=_[_0x67d8('0x110')](_0x5f0937);_0x4a9755=[];return db['sequelize'][_0x67d8('0x111')](function(_0x39cf51){for(var _0x16666d=0x0;_0x16666d<_0x4ea0f7[_0x67d8('0x43')];_0x16666d++){_0x4a9755['push'](_0x4ea0f7[_0x16666d][_0x67d8('0x11d')](_0xadc957['id']),{'transaction':_0x39cf51});}return BPromise['all'](_0x4a9755)[_0x67d8('0x11')](function(){if(_0xadc957['online']){return BPromise[_0x67d8('0x84')](_[_0x67d8('0x2b')](_0x4ea0f7,function(_0x242165){return _0x242165[_0x67d8('0x113')](_0x67d8('0x97'))===_0x67d8('0x114');}),function(_0x454ad8){return db[_0x67d8('0xa9')][_0x67d8('0x30')]({'where':{'VoiceQueueId':_0x454ad8['id'],'UserId':_0xadc957['id']},'transaction':_0x39cf51});});}else{return;}})[_0x67d8('0x11')](function(){db[_0x67d8('0x115')][_0x67d8('0x92')]({'where':{'teamId':_0x4c493f['id']}})[_0x67d8('0x11')](function(_0x50348a){if(_0x50348a){return db[_0x67d8('0x116')][_0x67d8('0x30')]({'where':{'UserId':_0xadc957['id'],'VoicePrefixId':_0x50348a[_0x67d8('0x44')][_0x67d8('0x117')]}});}});})[_0x67d8('0x11')](function(){for(var _0x22f881=0x0;_0x22f881<_0x4ea0f7[_0x67d8('0x43')];_0x22f881++){var _0x1cee9e=_0x4ea0f7[_0x22f881][_0x67d8('0x113')](_0x67d8('0x97'));var _0x1e5956=_0x1cee9e+_0x67d8('0x9f');socket[_0x67d8('0xa0')](_0x67d8('0x26')+_0x1cee9e+_0x67d8('0xab'),{'UserId':_0xadc957['id'],['queueField']:_0x4ea0f7[_0x22f881]['id']});}});});});}});}})[_0x67d8('0x11')](respondWithStatusCode(_0x37532d,null))[_0x67d8('0x1a')](handleError(_0x37532d,null));};exports['getLists']=function(_0x2c20d2,_0x3d589f){var _0x4c6afa={};var _0xe5be45={};var _0x194c29;var _0x5eef30;return db[_0x67d8('0x34')][_0x67d8('0x92')]({'where':{'id':_0x2c20d2[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x3d589f,null))['then'](function(_0x2d7b82){if(_0x2d7b82){_0x194c29=_0x2d7b82;_0xe5be45[_0x67d8('0x4c')]=_[_0x67d8('0x4e')](db[_0x67d8('0xc3')][_0x67d8('0x35')]);_0xe5be45['query']=_['keys'](_0x2c20d2['query']);_0xe5be45[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0xe5be45[_0x67d8('0x4c')],_0xe5be45['query']);_0x4c6afa[_0x67d8('0x40')]=_['intersection'](_0xe5be45[_0x67d8('0x4c')],qs[_0x67d8('0x52')](_0x2c20d2[_0x67d8('0x3b')][_0x67d8('0x52')]));_0x4c6afa[_0x67d8('0x40')]=_0x4c6afa['attributes'][_0x67d8('0x43')]?_0x4c6afa[_0x67d8('0x40')]:_0xe5be45[_0x67d8('0x4c')];_0x4c6afa['order']=qs[_0x67d8('0xc0')](_0x2c20d2[_0x67d8('0x3b')][_0x67d8('0xc0')]);_0x4c6afa[_0x67d8('0x3a')]=qs['filters'](_[_0x67d8('0xc1')](_0x2c20d2[_0x67d8('0x3b')],_0xe5be45['filters']));if(_0x2c20d2[_0x67d8('0x3b')][_0x67d8('0x2b')]){_0x4c6afa[_0x67d8('0x3a')]=_[_0x67d8('0xc2')](_0x4c6afa[_0x67d8('0x3a')],{'$or':_['map'](_0x4c6afa[_0x67d8('0x40')],function(_0x269da3){var _0x24a269={};_0x24a269[_0x269da3]={'$like':'%'+_0x2c20d2[_0x67d8('0x3b')]['filter']+'%'};return _0x24a269;})});}_0x4c6afa=_[_0x67d8('0xc2')]({},_0x4c6afa,_0x2c20d2[_0x67d8('0x54')]);return _0x194c29[_0x67d8('0x11e')](_0x4c6afa);}})[_0x67d8('0x11')](function(_0x43ea02){if(_0x43ea02){_0x5eef30=_0x43ea02[_0x67d8('0x43')];if(!_0x2c20d2[_0x67d8('0x3b')][_0x67d8('0xc8')](_0x67d8('0xc9'))){_0x4c6afa[_0x67d8('0xca')]=qs[_0x67d8('0xca')](_0x2c20d2[_0x67d8('0x3b')][_0x67d8('0xca')]);_0x4c6afa[_0x67d8('0x20')]=qs[_0x67d8('0x20')](_0x2c20d2['query'][_0x67d8('0x20')]);}return _0x194c29['getLists'](_0x4c6afa);}})[_0x67d8('0x11')](function(_0x301cee){if(_0x301cee){return _0x301cee?{'count':_0x5eef30,'rows':_0x301cee}:null;}})[_0x67d8('0x11')](respondWithResult(_0x3d589f,null))['catch'](handleError(_0x3d589f,null));};exports[_0x67d8('0x11f')]=function(_0x3932a2,_0x570336){var _0x53eeb5={};var _0x47ba9c={};var _0x47beb2;return db[_0x67d8('0x34')][_0x67d8('0x92')]({'where':{'id':_0x3932a2[_0x67d8('0x4b')]['id']}})[_0x67d8('0x11')](handleEntityNotFound(_0x570336,null))['then'](function(_0x5ac381){if(_0x5ac381){_0x47beb2=_0x5ac381;_0x47ba9c['model']=_[_0x67d8('0x4e')](db['User']['rawAttributes']);_0x47ba9c['query']=_[_0x67d8('0x4e')](_0x3932a2[_0x67d8('0x3b')]);_0x47ba9c[_0x67d8('0x50')]=_[_0x67d8('0x51')](_0x47ba9c[_0x67d8('0x4c')],_0x47ba9c[_0x67d8('0x3b')]);_0x53eeb5[_0x67d8('0x40')]=_[_0x67d8('0x51')](_0x47ba9c['model'],qs['fields'](_0x3932a2[_0x67d8('0x3b')][_0x67d8('0x52')]));_0x53eeb5['attributes']=_0x53eeb5[_0x67d8('0x40')][_0x67d8('0x43')]?_0x53eeb5[_0x67d8('0x40')]:_0x47ba9c[_0x67d8('0x4c')];_0x53eeb5[_0x67d8('0xbf')]=qs[_0x67d8('0xc0')](_0x3932a2[_0x67d8('0x3b')]['sort']);_0x53eeb5[_0x67d8('0x3a')]=qs[_0x67d8('0x50')](_[_0x67d8('0xc1')](_0x3932a2[_0x67d8('0x3b')],_0x47ba9c[_0x67d8('0x50')]));if(_0x3932a2[_0x67d8('0x3b')][_0x67d8('0x2b')]){_0x53eeb5[_0x67d8('0x3a')]=_[_0x67d8('0xc2')](_0x53eeb5['where'],{'$or':_[_0x67d8('0x36')](_0x53eeb5[_0x67d8('0x40')],function(_0x3419ac){var _0x3416e1={};_0x3416e1[_0x3419ac]={'$like':'%'+_0x3932a2[_0x67d8('0x3b')][_0x67d8('0x2b')]+'%'};return _0x3416e1;})});}_0x53eeb5['model']=db[_0x67d8('0x34')];_0x53eeb5['as']='Agents';_0x53eeb5=_[_0x67d8('0xc2')]({},_0x53eeb5,_0x3932a2[_0x67d8('0x54')]);return _0x47beb2['getVoiceQueues']({'include':[_0x53eeb5]});}})['then'](function(_0x5d2105){if(_0x5d2105){var _0x369d33={},_0x42448a=[];for(var _0x31e56d=0x0;_0x31e56d<_0x5d2105[_0x67d8('0x43')];_0x31e56d+=0x1){for(var _0x144cef=0x0,_0x595e4b;_0x144cef<_0x5d2105[_0x31e56d]['Agents'][_0x67d8('0x43')];_0x144cef+=0x1){_0x595e4b=_0x5d2105[_0x31e56d][_0x67d8('0x27')][_0x144cef]['get']({'plain':!![]});_0x369d33[_0x595e4b['id']]=_0x595e4b;}}_0x369d33=_[_0x67d8('0x120')](_0x369d33);for(var _0x4f3da0=qs[_0x67d8('0x20')](_0x3932a2[_0x67d8('0x3b')][_0x67d8('0x20')]);_0x4f3da0<_0x369d33[_0x67d8('0x43')]&&_0x42448a[_0x67d8('0x43')]=_0x445640){_0x5196c4=_0x445640;_0x474224=0xc8;}else{_0x474224=0xce;}_0x1ec0a1[_0x7be8('0x21')](_0x474224);return _0x1ec0a1[_0x7be8('0x27')](_0x7be8('0x28'),_0x108331+'-'+_0x5196c4+'/'+_0x445640)[_0x7be8('0x22')](_0x52a5a1);}return null;};}function saveUpdates(_0x59d203){return function(_0x2e9768){if(_0x2e9768){return _0x2e9768[_0x7be8('0x29')](_0x59d203)[_0x7be8('0x15')](function(_0x197de7){return _0x197de7;});}return null;};}function removeEntity(_0x29b267){return function(_0x1cbbd8){if(_0x1cbbd8){return _0x1cbbd8[_0x7be8('0x2a')]()[_0x7be8('0x15')](function(){var _0x53a350=_0x1cbbd8[_0x7be8('0x2b')]({'plain':!![]});if(_0x53a350[_0x7be8('0x2c')]===_0x7be8('0x2d'))return;var _0x23593e=[{'name':_0x7be8('0x2e'),'value':_0x7be8('0x2f'),'ignore':!![]},{'name':_0x7be8('0x30'),'value':_0x7be8('0x31'),'ignore':![]},{'name':_0x7be8('0x32'),'value':'telephone','ignore':![]}];var _0x4a7484=_(_0x23593e)['filter']('ignore')[_0x7be8('0x33')]('value')[_0x7be8('0x34')]();if(_[_0x7be8('0x35')](_0x4a7484,_0x53a350[_0x7be8('0x2c')])){return;}var _0x3d3671=_[_0x7be8('0x36')](_0x23593e,[_0x7be8('0x34'),_0x53a350['role']])[_0x7be8('0x37')];return db[_0x7be8('0x38')][_0x7be8('0x2a')]({'where':{'type':_0x3d3671,'resourceId':_0x53a350['id']}})[_0x7be8('0x15')](function(){return _0x1cbbd8;});})[_0x7be8('0x15')](function(){_0x29b267[_0x7be8('0x21')](0xcc)[_0x7be8('0x20')]();});}};}function handleEntityNotFound(_0x3c358d){return function(_0x113f1f){if(!_0x113f1f){_0x3c358d[_0x7be8('0x39')](0x194);}return _0x113f1f;};}function handleError(_0x2ff18f,_0x1ed226){_0x1ed226=_0x1ed226||0x1f4;return function(_0x36c111){logger[_0x7be8('0x1c')](_0x36c111[_0x7be8('0x3a')]);if(_0x36c111['name']){delete _0x36c111[_0x7be8('0x37')];}_0x2ff18f['status'](_0x1ed226)[_0x7be8('0x3b')](_0x36c111);};}exports[_0x7be8('0x3c')]=function(_0x1d84a2,_0x16599e){var _0x1aa137={},_0x3c2d95={'count':0x0,'rows':[]};var _0x327305=_(db[_0x7be8('0x3d')][_0x7be8('0x3e')])[_0x7be8('0x33')](function(_0x43268c){return{'name':_0x43268c[_0x7be8('0x3f')],'type':_0x43268c[_0x7be8('0x40')][_0x7be8('0x41')]};})[_0x7be8('0x42')](function(_0x501d6a){return!_[_0x7be8('0x35')]([_0x7be8('0x43'),'salt'],_0x501d6a['name']);})[_0x7be8('0x34')]();_0x1aa137=qs[_0x7be8('0x44')](_0x327305,_0x1d84a2);var _0x4e3317={'where':_0x1aa137[_0x7be8('0x45')]};return db['User'][_0x7be8('0x25')](_0x4e3317)[_0x7be8('0x15')](function(_0x2ab805){_0x3c2d95[_0x7be8('0x25')]=_0x2ab805;if(_0x1d84a2[_0x7be8('0x46')][_0x7be8('0x47')]){_0x1aa137[_0x7be8('0x48')]=[{'all':!![]}];}if(_0x1d84a2[_0x7be8('0x46')][_0x7be8('0x49')]===_0x7be8('0x4a')){_0x1aa137[_0x7be8('0x48')]=[{'model':db[_0x7be8('0x4b')],'as':_0x7be8('0x49')}];}if(!_[_0x7be8('0x35')](_0x1aa137[_0x7be8('0x4c')],'id')){_0x1aa137[_0x7be8('0x4c')]['push']('id');}return db[_0x7be8('0x3d')][_0x7be8('0x4d')](_0x1aa137);})[_0x7be8('0x15')](function(_0xe89fca){_0x3c2d95['rows']=_0xe89fca;if(_0x1d84a2[_0x7be8('0x46')][_0x7be8('0x4e')]===_0x7be8('0x4a')){var _0x524bb7=[];for(var _0x15b233=0x0;_0x15b233<_0x3c2d95[_0x7be8('0x4f')][_0x7be8('0x50')];_0x15b233++){_0x524bb7['push'](get_open_tabs(_0x7be8('0x51'),_0x3c2d95['rows'][_0x15b233][_0x7be8('0x52')]));_0x524bb7[_0x7be8('0x53')](get_open_tabs('sms',_0x3c2d95[_0x7be8('0x4f')][_0x15b233]['dataValues']));_0x524bb7[_0x7be8('0x53')](get_open_tabs(_0x7be8('0x54'),_0x3c2d95[_0x7be8('0x4f')][_0x15b233][_0x7be8('0x52')]));_0x524bb7[_0x7be8('0x53')](get_open_tabs(_0x7be8('0x55'),_0x3c2d95[_0x7be8('0x4f')][_0x15b233][_0x7be8('0x52')]));_0x524bb7[_0x7be8('0x53')](get_open_tabs(_0x7be8('0x56'),_0x3c2d95['rows'][_0x15b233][_0x7be8('0x52')]));_0x524bb7[_0x7be8('0x53')](get_open_tabs(_0x7be8('0x57'),_0x3c2d95[_0x7be8('0x4f')][_0x15b233]['dataValues']));}return BPromise[_0x7be8('0x58')](_0x524bb7)[_0x7be8('0x15')](function(){return _0x3c2d95;});}else{return _0x3c2d95;}})['then'](respondWithFilteredResult(_0x16599e,_0x1aa137))[_0x7be8('0x1f')](handleError(_0x16599e,null));};exports[_0x7be8('0x59')]=function(_0xab2e3a,_0x246dd3){var _0x2fa2e7={'raw':![],'where':{'id':_0xab2e3a[_0x7be8('0x5a')]['id']}},_0x470d49={};_0x470d49['model']=_['differenceBy'](_[_0x7be8('0x5b')](db[_0x7be8('0x3d')][_0x7be8('0x3e')]),['password',_0x7be8('0x5c')]);_0x470d49[_0x7be8('0x46')]=_['keys'](_0xab2e3a[_0x7be8('0x46')]);_0x470d49[_0x7be8('0x5d')]=_[_0x7be8('0x5e')](_0x470d49['model'],_0x470d49[_0x7be8('0x46')]);_0x2fa2e7[_0x7be8('0x4c')]=_['intersection'](_0x470d49[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0xab2e3a['query']['fields']));_0x2fa2e7[_0x7be8('0x4c')]=_0x2fa2e7['attributes'][_0x7be8('0x50')]?_0x2fa2e7[_0x7be8('0x4c')]:_0x470d49[_0x7be8('0x5f')];if(_0xab2e3a['query'][_0x7be8('0x47')]){_0x2fa2e7[_0x7be8('0x48')]=[{'all':!![]}];}if(_0xab2e3a[_0x7be8('0x46')]['userSetting']===_0x7be8('0x4a')){_0x2fa2e7[_0x7be8('0x48')]=[{'model':db[_0x7be8('0x4b')],'as':_0x7be8('0x49')}];}_0x2fa2e7=_[_0x7be8('0x61')]({},_0x2fa2e7,_0xab2e3a[_0x7be8('0x62')]);if(!_[_0x7be8('0x35')](_0x2fa2e7[_0x7be8('0x4c')],'id')){_0x2fa2e7[_0x7be8('0x4c')][_0x7be8('0x53')]('id');}return db[_0x7be8('0x3d')][_0x7be8('0x36')](_0x2fa2e7)['then'](handleEntityNotFound(_0x246dd3,null))['then'](function(_0x534f50){var _0x2b2ebb=[];values=_0x534f50;if(_0xab2e3a[_0x7be8('0x46')][_0x7be8('0x4e')]==='true'){_0x2b2ebb[_0x7be8('0x53')](get_open_tabs('chat',_0x534f50['dataValues']));_0x2b2ebb[_0x7be8('0x53')](get_open_tabs(_0x7be8('0x63'),_0x534f50[_0x7be8('0x52')]));_0x2b2ebb[_0x7be8('0x53')](get_open_tabs('openchannel',_0x534f50[_0x7be8('0x52')]));_0x2b2ebb['push'](get_open_tabs(_0x7be8('0x57'),_0x534f50[_0x7be8('0x52')]));_0x2b2ebb[_0x7be8('0x53')](get_open_tabs('fax',_0x534f50[_0x7be8('0x52')]));_0x2b2ebb[_0x7be8('0x53')](get_open_tabs(_0x7be8('0x55'),_0x534f50[_0x7be8('0x52')]));return BPromise[_0x7be8('0x58')](_0x2b2ebb);}else{return values;}})[_0x7be8('0x15')](function(){return values;})[_0x7be8('0x15')](respondWithResult(_0x246dd3,null))[_0x7be8('0x1f')](handleError(_0x246dd3,null));};exports['update']=function(_0x53c447,_0x490b7b){if(_0x53c447[_0x7be8('0x64')]['id']){delete _0x53c447[_0x7be8('0x64')]['id'];}delete _0x53c447[_0x7be8('0x64')][_0x7be8('0x2c')];return db['User'][_0x7be8('0x36')]({'where':{'id':_0x53c447[_0x7be8('0x5a')]['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x490b7b,null))[_0x7be8('0x15')](saveUpdates(_0x53c447[_0x7be8('0x64')],null))[_0x7be8('0x15')](respondWithResult(_0x490b7b,null))['catch'](handleError(_0x490b7b,null));};exports['describe']=function(_0x5052dd,_0x72e578){return db[_0x7be8('0x3d')][_0x7be8('0x65')]()['then'](respondWithResult(_0x72e578,null))[_0x7be8('0x1f')](handleError(_0x72e578,null));};exports[_0x7be8('0x66')]=function(_0x2cebb5,_0x1a30db){return db[_0x7be8('0x3d')][_0x7be8('0x36')]({'where':{'id':_0x2cebb5['params']['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x1a30db,null))[_0x7be8('0x15')](function(_0x3d62ff){if(_0x3d62ff){return _0x3d62ff[_0x7be8('0x66')](_0x2cebb5[_0x7be8('0x64')]['ids'],_[_0x7be8('0x67')](_0x2cebb5[_0x7be8('0x64')],[_0x7be8('0x68'),'id'])||{});}})['then'](respondWithResult(_0x1a30db,null))[_0x7be8('0x1f')](handleError(_0x1a30db,null));};function validateUser(_0x440a87){return new BPromise(function(_0x4e84a6,_0x409f4c){if(_0x440a87['internal'])return _0x4e84a6(_0x440a87);return db['Setting'][_0x7be8('0x69')](0x1)[_0x7be8('0x15')](function(_0x6c4e2b){if(_0x6c4e2b['securePassword'])authService[_0x7be8('0x6a')](_0x440a87[_0x7be8('0x43')]);db[_0x7be8('0x3d')]['max'](_0x7be8('0x6b'))['then'](function(_0x139ad5){if(_[_0x7be8('0x6c')](_0x139ad5)){_0x440a87['internal']=_0x6c4e2b[_0x7be8('0x6d')]||0x1;return;}if(_[_0x7be8('0x6c')](_0x6c4e2b[_0x7be8('0x6d')])||_0x6c4e2b[_0x7be8('0x6d')]===_0x139ad5){_0x440a87[_0x7be8('0x6b')]=_0x139ad5+0x1;return;}if(_0x6c4e2b['min_internal']>_0x139ad5){_0x440a87[_0x7be8('0x6b')]=_0x6c4e2b['min_internal'];return;}return db[_0x7be8('0x6e')][_0x7be8('0x46')]('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[_0x7be8('0x6e')][_0x7be8('0x6f')]['SELECT']})[_0x7be8('0x15')](function(_0x2d20b7){if(_0x2d20b7&&_0x2d20b7[_0x7be8('0x50')]){for(var _0xcfbcb0=0x0,_0x24b7d6=_0x2d20b7['length'];_0xcfbcb0<_0x24b7d6&&_[_0x7be8('0x6c')](_0x440a87[_0x7be8('0x6b')]);_0xcfbcb0++){if(_0x6c4e2b[_0x7be8('0x6d')]<=_0x2d20b7[_0xcfbcb0]['from']){_0x440a87['internal']=_0x2d20b7[_0xcfbcb0][_0x7be8('0x70')];}else if(_0x6c4e2b['min_internal']>_0x2d20b7[_0xcfbcb0][_0x7be8('0x70')]&&_0x6c4e2b[_0x7be8('0x6d')]<=_0x2d20b7[_0xcfbcb0]['to']){_0x440a87['internal']=_0x6c4e2b[_0x7be8('0x6d')];}}}if(_[_0x7be8('0x6c')](_0x440a87[_0x7be8('0x6b')])){_0x440a87[_0x7be8('0x6b')]=_0x139ad5+0x1;}return _0x4e84a6(_0x440a87);});});})[_0x7be8('0x1f')](function(_0x2a5daa){_0x409f4c(_0x2a5daa);});});}function updateUser(_0x283858){return new BPromise(function(_0x1a8172,_0x563c2d){try{if(_0x283858[_0x7be8('0x71')]){_0x283858[_0x7be8('0x72')]=_0x283858[_0x7be8('0x6b')];_0x283858[_0x7be8('0x73')]={'mailbox':_0x283858[_0x7be8('0x6b')],'password':_0x283858[_0x7be8('0x43')],'fullname':_0x283858[_0x7be8('0x74')],'email':_0x283858[_0x7be8('0x75')]};}if(_0x283858[_0x7be8('0x2c')]==='agent'){if(!_0x283858[_0x7be8('0x76')])_0x283858['permissions']=[_0x7be8('0x77'),_0x7be8('0x78'),_0x7be8('0x79'),_0x7be8('0x7a'),_0x7be8('0x7b'),'104',_0x7be8('0x7c'),_0x7be8('0x7d'),_0x7be8('0x7e'),_0x7be8('0x7f'),_0x7be8('0x80'),_0x7be8('0x81'),_0x7be8('0x82'),'114',_0x7be8('0x83')];}_0x1a8172(_0x283858);}catch(_0x29c30c){_0x563c2d(_0x29c30c);}});}exports[_0x7be8('0x84')]=function(_0x4bd10f,_0x377a03){if(_0x4bd10f['user']['role']==='agent')throw new Error(_0x7be8('0x85'));if(_0x4bd10f[_0x7be8('0x64')][_0x7be8('0x2c')]===_0x7be8('0x2f')&&_0x4bd10f[_0x7be8('0x2f')][_0x7be8('0x2c')]!==_0x7be8('0x2d')){throw new Error(_0x7be8('0x86'));}if(_0x4bd10f[_0x7be8('0x64')][_0x7be8('0x2c')]===_0x7be8('0x2d')&&_0x4bd10f['user'][_0x7be8('0x2c')]!==_0x7be8('0x2d')){throw new Error(_0x7be8('0x87'));}return licenseUtil[_0x7be8('0x88')]([_0x4bd10f[_0x7be8('0x64')]])[_0x7be8('0x15')](function(){return validateUser(_0x4bd10f[_0x7be8('0x64')]);})[_0x7be8('0x15')](function(_0x377132){return updateUser(_0x377132)[_0x7be8('0x15')](function(_0x363f9e){if(_0x363f9e[_0x7be8('0x2c')]===_0x7be8('0x2d')){_0x363f9e[_0x7be8('0x89')]=_0x4bd10f[_0x7be8('0x2f')][_0x7be8('0x89')];delete _0x363f9e['userProfileId'];}return _0x363f9e;});})['then'](function(_0x2f31a3){return db[_0x7be8('0x3d')][_0x7be8('0x84')](_0x2f31a3,{'include':[{'model':db['VoiceMail'],'as':_0x7be8('0x73')}]});})[_0x7be8('0x15')](function(_0x4462a4){if(_0x4bd10f[_0x7be8('0x64')][_0x7be8('0x2c')]===_0x7be8('0x2f'))return _0x4462a4;if(_0x4bd10f[_0x7be8('0x2f')][_0x7be8('0x2c')]!==_0x7be8('0x2f'))return _0x4462a4;return db['UserProfileSection']['find']({'where':{'name':_0x4462a4['role']===_0x7be8('0x31')?_0x7be8('0x30'):_0x7be8('0x32'),'userProfileId':_0x4bd10f[_0x7be8('0x2f')]['userProfileId']},'raw':!![]})[_0x7be8('0x15')](function(_0x58abdf){if(!_0x58abdf||_0x58abdf[_0x7be8('0x8a')]!=0x0)return _0x4462a4;return db[_0x7be8('0x38')]['create']({'name':_0x4462a4[_0x7be8('0x37')],'resourceId':_0x4462a4['id'],'type':_0x58abdf[_0x7be8('0x37')],'sectionId':_0x58abdf['id']},{})[_0x7be8('0x15')](function(){return _0x4462a4;});})[_0x7be8('0x1f')](function(_0x4af98b){logger[_0x7be8('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4af98b);throw _0x4af98b;});})[_0x7be8('0x15')](respondWithResult(_0x377a03,0xc9))[_0x7be8('0x1f')](handleError(_0x377a03,null));};exports[_0x7be8('0x8b')]=function(_0x3f86e4,_0x24a693){var _0x5398d5=_0x3f86e4[_0x7be8('0x64')];var _0x5afe43=[];if(_0x3f86e4[_0x7be8('0x2f')][_0x7be8('0x2c')]===_0x7be8('0x31'))throw new Error(_0x7be8('0x85'));if(_[_0x7be8('0x8c')](_0x5398d5,[_0x7be8('0x2c'),_0x7be8('0x2f')])&&_0x3f86e4[_0x7be8('0x2f')][_0x7be8('0x2c')]!==_0x7be8('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x5398d5,[_0x7be8('0x2c'),_0x7be8('0x2d')])&&_0x3f86e4['user'][_0x7be8('0x2c')]!==_0x7be8('0x2d')){throw new Error(_0x7be8('0x8d'));}return licenseUtil[_0x7be8('0x88')](_0x5398d5)[_0x7be8('0x15')](function(){return validateUser(_0x5398d5[0x0]);})[_0x7be8('0x15')](function(){for(var _0x55205a=0x1;_0x55205a<_0x5398d5['length'];_0x55205a++){var _0x1c24fd=_0x5398d5[_0x55205a-0x1][_0x7be8('0x6b')];if(!_0x5398d5[_0x55205a][_0x7be8('0x6b')])_0x5398d5[_0x55205a][_0x7be8('0x6b')]=_0x1c24fd+0x1;_0x5afe43[_0x7be8('0x53')](validateUser(_0x5398d5[_0x55205a]));}return BPromise['all'](_0x5afe43);})['then'](function(){_0x5afe43=[];for(var _0x2d9f64=0x0;_0x2d9f64<_0x5398d5[_0x7be8('0x50')];_0x2d9f64++){_0x5afe43['push'](updateUser(_0x5398d5[_0x2d9f64]));}return BPromise['all'](_0x5afe43);})[_0x7be8('0x15')](function(){return BPromise[_0x7be8('0x8e')](_0x5398d5,function(_0x139331){return db[_0x7be8('0x3d')]['create'](_0x139331,{'include':[{'model':db[_0x7be8('0x73')],'as':'VoiceMail'}]})[_0x7be8('0x15')](function(_0x423619){_0x139331['id']=_0x423619['id'];return _0x139331;});});})[_0x7be8('0x15')](function(_0x5549e8){if(_0x3f86e4[_0x7be8('0x64')]['role']==='user')return _0x5549e8;if(_0x3f86e4[_0x7be8('0x2f')][_0x7be8('0x2c')]!=='user')return _0x5549e8;var _0x1d1ca0=_['some'](_0x5549e8,function(_0xd40a1b){return _0xd40a1b[_0x7be8('0x2c')]===_0x7be8('0x31')||_0xd40a1b[_0x7be8('0x2c')]===_0x7be8('0x8f');});if(!_0x1d1ca0)return _0x5549e8;return db['UserProfileSection'][_0x7be8('0x4d')]({'where':{'name':{'$or':[_0x7be8('0x30'),_0x7be8('0x32')]},'userProfileId':_0x3f86e4['user'][_0x7be8('0x90')]},'raw':!![]})[_0x7be8('0x15')](function(_0x4bfa7f){if(_['isEmpty'](_0x4bfa7f)||!_[_0x7be8('0x8c')](_0x4bfa7f,[_0x7be8('0x8a'),0x0]))return _0x5549e8;_0x5afe43=[];var _0x153aa3=_(_0x4bfa7f)[_0x7be8('0x33')](function(_0x15facf){if(_0x15facf['autoAssociation']===0x1)return;return _0x15facf[_0x7be8('0x37')]===_0x7be8('0x30')?'agent':_0x7be8('0x8f');})[_0x7be8('0x91')]()[_0x7be8('0x34')]();for(var _0x2a34a3=0x0;_0x2a34a3<_0x5549e8['length'];_0x2a34a3++){if(!_[_0x7be8('0x35')](_0x153aa3,_0x5549e8[_0x2a34a3][_0x7be8('0x2c')]))return;var _0xdb2c9a=_0x5549e8[_0x2a34a3][_0x7be8('0x2c')]===_0x7be8('0x31')?'Agents':_0x7be8('0x32');_0x5afe43['push'](db[_0x7be8('0x38')]['create']({'name':_0x5549e8[_0x2a34a3][_0x7be8('0x37')],'resourceId':_0x5549e8[_0x2a34a3]['id'],'type':_0xdb2c9a,'sectionId':_[_0x7be8('0x36')](_0x4bfa7f,[_0x7be8('0x37'),_0xdb2c9a])['id']},{}));}return BPromise[_0x7be8('0x58')](_0x5afe43);});})['then'](respondWithResult(_0x24a693,0xc9))[_0x7be8('0x1f')](handleError(_0x24a693,null));};exports[_0x7be8('0x92')]=function(_0x50c2d5,_0xe3b7a4){if(_0x50c2d5['body']['id']){delete _0x50c2d5[_0x7be8('0x64')]['id'];}return db[_0x7be8('0x3d')]['find']({'where':{'id':_0x50c2d5['params']['id']}})[_0x7be8('0x15')](function(_0x37bba2){if(!_0x37bba2)return null;if(_0x37bba2['id']===_0x50c2d5[_0x7be8('0x2f')]['id']){if(!_0x50c2d5[_0x7be8('0x64')][_0x7be8('0x93')]||!_0x50c2d5[_0x7be8('0x64')]['newPassword']){throw new db[(_0x7be8('0x94'))][(_0x7be8('0x95'))](_0x7be8('0x96'));}if(!_0x37bba2[_0x7be8('0x97')](_0x50c2d5[_0x7be8('0x64')][_0x7be8('0x93')])){throw new db['Sequelize']['ValidationError'](_0x7be8('0x98'));}if(_0x50c2d5[_0x7be8('0x64')][_0x7be8('0x93')]===_0x50c2d5[_0x7be8('0x64')]['newPassword']){throw new db['Sequelize'][(_0x7be8('0x95'))](_0x7be8('0x99'));}}else if(_0x50c2d5[_0x7be8('0x2f')]['role']===_0x7be8('0x2d')){if(!_0x50c2d5[_0x7be8('0x64')][_0x7be8('0x9a')]){throw new db[(_0x7be8('0x94'))][(_0x7be8('0x95'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x50c2d5[_0x7be8('0x2f')][_0x7be8('0x2c')]==='user'){if(!_0x50c2d5[_0x7be8('0x64')]['newPassword']){throw new db['Sequelize'][(_0x7be8('0x95'))](_0x7be8('0x9b'));}if(_0x37bba2[_0x7be8('0x2c')]!==_0x7be8('0x31')){throw new db[(_0x7be8('0x94'))][(_0x7be8('0x95'))](_0x7be8('0x85'));}}else{throw new db[(_0x7be8('0x94'))]['ValidationError']('Unauthorized');}return _0x37bba2;})['then'](handleEntityNotFound(_0xe3b7a4,null))[_0x7be8('0x15')](function(_0xd14f46){return db[_0x7be8('0x9c')][_0x7be8('0x9d')]({'attributes':['id',_0x7be8('0x9e'),_0x7be8('0x9f'),_0x7be8('0xa0')]})[_0x7be8('0x15')](function(_0x5d0ac1){if(_0x5d0ac1[_0x7be8('0x9e')])authService[_0x7be8('0x6a')](_0x50c2d5[_0x7be8('0x64')][_0x7be8('0x9a')]);if(!_0x5d0ac1[_0x7be8('0x9f')]||!_0xd14f46['previousPasswords'])return _0xd14f46;authService[_0x7be8('0xa1')](_0x50c2d5[_0x7be8('0x64')][_0x7be8('0x9a')],_0xd14f46[_0x7be8('0xa2')],_0x5d0ac1['passwordHistoryLimit']);return _0xd14f46;})['then'](saveUpdates({'password':_0x50c2d5['body']['newPassword'],'passwordResetAt':_0x50c2d5[_0x7be8('0x2f')]['id']==_0x50c2d5['params']['id']?moment():null,'previousPasswords':authService[_0x7be8('0xa3')](_0x50c2d5[_0x7be8('0x64')]['newPassword'],_0xd14f46[_0x7be8('0xa2')])},null));})[_0x7be8('0x15')](respondWithResult(_0xe3b7a4,null))[_0x7be8('0x1f')](handleError(_0xe3b7a4,null));};exports[_0x7be8('0xa4')]=function(_0x77f261,_0x5e902a){var _0x80c16=_0x77f261[_0x7be8('0x64')]['channel'];return db[_0x7be8('0x3d')]['find']({'where':{'id':_0x77f261[_0x7be8('0x5a')]['id']},'attributes':['id','name',_0x7be8('0x2c'),_0x7be8('0xa5'),_0x7be8('0xa6'),'voicePause',_0x7be8('0xa7')]})[_0x7be8('0x15')](handleEntityNotFound(_0x5e902a,null))['then'](function(_0x374a53){if(_0x374a53){if(!utils['isValidChannel'](_0x80c16)){throw new db['Sequelize'][(_0x7be8('0x95'))](_0x7be8('0xa8'));}return _0x374a53[_0x7be8('0xa9')+_['capitalize'](_0x80c16[_0x7be8('0xaa')]())+_0x7be8('0xab')](_0x77f261[_0x7be8('0x64')][_0x7be8('0x68')],{'penalty':_0x77f261[_0x7be8('0x64')][_0x7be8('0xac')]||0x0})[_0x7be8('0xad')](function(_0xcc7e1){for(var _0x274f96=0x0;_0x274f96<_0x77f261['body'][_0x7be8('0x68')]['length'];_0x274f96+=0x1){var _0x5f4488={'UserId':Number(_0x77f261[_0x7be8('0x5a')]['id'])};_0x5f4488[_['capitalize'](_0x80c16[_0x7be8('0xaa')]())+_0x7be8('0xae')]=Number(_0x77f261[_0x7be8('0x64')]['ids'][_0x274f96]);socket[_0x7be8('0xaf')]('user'+_[_0x7be8('0xb0')](_0x80c16[_0x7be8('0xaa')]())+_0x7be8('0xb1'),_0x5f4488);}return _0xcc7e1;})[_0x7be8('0x15')](function(){if(_0x80c16===_0x7be8('0xb2')){return db[_0x7be8('0xb3')]['findAll']({'where':{'id':_0x77f261[_0x7be8('0x64')][_0x7be8('0x68')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x7be8('0x15')](function(_0x5b6c3f){var _0xecc6de=_0x374a53[_0x7be8('0x2b')]({'plain':!![]});var _0x445d0f=[];if(_0x80c16===_0x7be8('0xb2')&&_0xecc6de['role']===_0x7be8('0x31')&&_0xecc6de[_0x7be8('0xa5')]){for(var _0x4dc45=0x0;_0x4dc45<_0x5b6c3f[_0x7be8('0x50')];_0x4dc45+=0x1){_0x445d0f[_0x7be8('0x53')]({'membername':_0xecc6de['name'],'UserId':_0xecc6de['id'],'queue_name':_0x5b6c3f[_0x4dc45][_0x7be8('0x37')],'VoiceQueueId':_0x5b6c3f[_0x4dc45]['id'],'interface':_[_0x7be8('0x6c')](_0xecc6de[_0x7be8('0xa7')])?util['format'](_0x7be8('0xb4'),_0xecc6de[_0x7be8('0x37')]):_0xecc6de['interface'],'paused':_0xecc6de[_0x7be8('0xb5')]||![],'penalty':_0x77f261[_0x7be8('0x64')][_0x7be8('0xac')]||0x0});}return BPromise['each'](_0x445d0f,function(_0x4f1bed){return db['UserVoiceQueueRt'][_0x7be8('0xb6')](_0x4f1bed);});}return _0x374a53;});}})[_0x7be8('0x15')](respondWithStatusCode(_0x5e902a,null))[_0x7be8('0x1f')](handleError(_0x5e902a,null));};exports[_0x7be8('0xb7')]=function(_0x4bc100,_0x31fd2d){var _0x2188e3,_0x4d3a82;return db[_0x7be8('0x3d')][_0x7be8('0x36')]({'where':{'id':_0x4bc100[_0x7be8('0x5a')]['id']},'attributes':['id',_0x7be8('0x37'),_0x7be8('0x2c')]})['then'](handleEntityNotFound(_0x31fd2d,null))[_0x7be8('0x15')](function(_0x302b03){if(_0x302b03){_0x2188e3=_0x302b03;if(!_0x4bc100[_0x7be8('0x46')][_0x7be8('0xb8')]||!utils['isValidChannel'](_0x4bc100[_0x7be8('0x46')]['channel'])){throw new db['Sequelize'][(_0x7be8('0x95'))](_0x7be8('0xa8'));}return _0x302b03[_0x7be8('0xb9')+_[_0x7be8('0xb0')](_0x4bc100['query'][_0x7be8('0xb8')][_0x7be8('0xaa')]())+_0x7be8('0xab')](_0x4bc100[_0x7be8('0x46')][_0x7be8('0x68')]);}})[_0x7be8('0x15')](function(_0x3353ff){if(_[_0x7be8('0xba')](_0x4bc100[_0x7be8('0x46')][_0x7be8('0x68')])){for(var _0xf762ec=0x0;_0xf762ec<_0x4bc100['query'][_0x7be8('0x68')][_0x7be8('0x50')];_0xf762ec+=0x1){_0x4d3a82={'UserId':Number(_0x4bc100[_0x7be8('0x5a')]['id'])};_0x4d3a82[_[_0x7be8('0xb0')](_0x4bc100[_0x7be8('0x46')][_0x7be8('0xb8')][_0x7be8('0xaa')]())+_0x7be8('0xae')]=Number(_0x4bc100[_0x7be8('0x46')][_0x7be8('0x68')][_0xf762ec]);socket[_0x7be8('0xaf')](_0x7be8('0x2f')+_[_0x7be8('0xb0')](_0x4bc100[_0x7be8('0x46')][_0x7be8('0xb8')][_0x7be8('0xaa')]())+_0x7be8('0xbb'),_0x4d3a82);}}else{_0x4d3a82={'UserId':Number(_0x4bc100[_0x7be8('0x5a')]['id'])};_0x4d3a82[_['capitalize'](_0x4bc100['query'][_0x7be8('0xb8')]['toLowerCase']())+_0x7be8('0xae')]=Number(_0x4bc100[_0x7be8('0x46')]['ids']);socket[_0x7be8('0xaf')]('user'+_[_0x7be8('0xb0')](_0x4bc100[_0x7be8('0x46')][_0x7be8('0xb8')][_0x7be8('0xaa')]())+_0x7be8('0xbb'),_0x4d3a82);}return _0x3353ff;})['then'](function(){if(_0x4bc100[_0x7be8('0x46')][_0x7be8('0xb8')]===_0x7be8('0xb2')){return db['UserVoiceQueueRt'][_0x7be8('0x2a')]({'where':{'UserId':_0x4bc100['params']['id'],'VoiceQueueId':_0x4bc100['query'][_0x7be8('0x68')]},'individualHooks':!![]})['then'](function(){return _0x2188e3;});}return _0x2188e3;})[_0x7be8('0x15')](respondWithStatusCode(_0x31fd2d,null))['catch'](handleError(_0x31fd2d,null));};exports['addAvatar']=function(_0x5c1200,_0x26d1a7){_0x5c1200[_0x7be8('0x64')]['userpic']=_0x5c1200[_0x7be8('0xbc')]['filename'];return db[_0x7be8('0x3d')][_0x7be8('0x36')]({'where':{'id':_0x5c1200[_0x7be8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x26d1a7,null))[_0x7be8('0x15')](saveUpdates(_0x5c1200[_0x7be8('0x64')],null))[_0x7be8('0x15')](respondWithResult(_0x26d1a7,null))[_0x7be8('0x1f')](handleError(_0x26d1a7,null));};exports[_0x7be8('0xbd')]=function(_0x49c564,_0x11aeb6){var _0x1964e7=path[_0x7be8('0xbe')](config[_0x7be8('0xbf')],_0x7be8('0xc0'));return db[_0x7be8('0x3d')]['find']({'where':{'id':_0x49c564[_0x7be8('0x5a')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x7be8('0x15')](handleEntityNotFound(_0x11aeb6,null))[_0x7be8('0x15')](function(_0x478d0f){if(_0x478d0f){if(_[_0x7be8('0x6c')](_0x478d0f['userpic'])){return _0x11aeb6['download'](_0x1964e7);}else{if(!fs['existsSync'](path['join'](config[_0x7be8('0xbf')],'server/files/images/',_0x478d0f['userpic']))){return _0x11aeb6[_0x7be8('0xc1')](_0x1964e7);}return _0x11aeb6[_0x7be8('0xc1')](path[_0x7be8('0xbe')](config[_0x7be8('0xbf')],_0x7be8('0xc2'),_0x478d0f[_0x7be8('0xc3')]));}}})['catch'](handleError(_0x11aeb6,null));};exports[_0x7be8('0xc4')]=function(_0x334a91,_0x3413e4){return db['User'][_0x7be8('0x36')]({'where':{'id':_0x334a91['params']['id']},'attributes':['id']})[_0x7be8('0x15')](handleEntityNotFound(_0x3413e4,null))[_0x7be8('0x15')](function(_0x2d150e){var _0x4fb118=[];values=_0x2d150e[_0x7be8('0x52')];_0x4fb118[_0x7be8('0x53')](get_open_tabs('chat',_0x2d150e['dataValues']));_0x4fb118[_0x7be8('0x53')](get_open_tabs('sms',_0x2d150e[_0x7be8('0x52')]));_0x4fb118['push'](get_open_tabs(_0x7be8('0x56'),_0x2d150e[_0x7be8('0x52')]));_0x4fb118['push'](get_open_tabs(_0x7be8('0x57'),_0x2d150e[_0x7be8('0x52')]));_0x4fb118[_0x7be8('0x53')](get_open_tabs(_0x7be8('0x54'),_0x2d150e[_0x7be8('0x52')]));_0x4fb118['push'](get_open_tabs('mail',_0x2d150e[_0x7be8('0x52')]));return BPromise[_0x7be8('0x58')](_0x4fb118);})[_0x7be8('0x15')](function(_0x4d68aa){if(_0x4d68aa){var _0x4d61ce=_[_0x7be8('0x33')](values[_0x7be8('0xc5')],function(_0x209f7b){return{'channel':'CHAT','id':_0x209f7b['id'],'createdAt':_0x209f7b[_0x7be8('0xc6')]};});var _0x150a12=_['map'](values[_0x7be8('0xc7')],function(_0x29c252){return{'channel':_0x7be8('0xc8'),'id':_0x29c252['id'],'createdAt':_0x29c252['createdAt']};});var _0x18c129=_['map'](values[_0x7be8('0xc9')],function(_0x4ebb30){return{'channel':_0x7be8('0xca'),'id':_0x4ebb30['id'],'createdAt':_0x4ebb30[_0x7be8('0xc6')]};});var _0x48c4ff=_[_0x7be8('0x33')](values['MailOpenTabs'],function(_0x4e5df3){return{'channel':_0x7be8('0xcb'),'id':_0x4e5df3['id'],'createdAt':_0x4e5df3[_0x7be8('0xc6')]};});var _0x143297=_[_0x7be8('0x33')](values[_0x7be8('0xcc')],function(_0x5531b6){return{'channel':_0x7be8('0xcd'),'id':_0x5531b6['id'],'createdAt':_0x5531b6[_0x7be8('0xc6')]};});var _0x36ce03=_[_0x7be8('0x33')](values['WhatsappOpenTabs'],function(_0x115ee0){return{'channel':_0x7be8('0xce'),'id':_0x115ee0['id'],'createdAt':_0x115ee0[_0x7be8('0xc6')]};});var _0x2149f3=_[_0x7be8('0xcf')](_0x4d61ce,_0x150a12,_0x18c129,_0x48c4ff,_0x143297,_0x36ce03);var _0x3764dd={'count':_0x2149f3[_0x7be8('0x50')],'rows':_0x2149f3};return _0x3764dd;}else return null;})['then'](respondWithResult(_0x3413e4,null))[_0x7be8('0x1f')](handleError(_0x3413e4,null));};exports[_0x7be8('0xd0')]=function(_0x1de19a,_0x948226){var _0x1f8210={};var _0x31d2f2={};var _0x111a5c;var _0x5acd25;return db[_0x7be8('0x3d')][_0x7be8('0x9d')]({'where':{'id':_0x1de19a[_0x7be8('0x5a')]['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x948226,null))[_0x7be8('0x15')](function(_0x25a9a6){if(_0x25a9a6){_0x111a5c=_0x25a9a6;_0x31d2f2[_0x7be8('0x5f')]=_[_0x7be8('0x5b')](db[_0x7be8('0xd1')][_0x7be8('0x3e')]);_0x31d2f2['query']=_[_0x7be8('0x5b')](_0x1de19a['query']);_0x31d2f2['filters']=_[_0x7be8('0x5e')](_0x31d2f2[_0x7be8('0x5f')],_0x31d2f2[_0x7be8('0x46')]);_0x1f8210[_0x7be8('0x4c')]=_['intersection'](_0x31d2f2[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0x1de19a[_0x7be8('0x46')]['fields']));_0x1f8210[_0x7be8('0x4c')]=_0x1f8210[_0x7be8('0x4c')]['length']?_0x1f8210[_0x7be8('0x4c')]:_0x31d2f2['model'];_0x1f8210['order']=qs['sort'](_0x1de19a[_0x7be8('0x46')][_0x7be8('0xd2')]);_0x1f8210[_0x7be8('0x45')]=qs['filters'](_[_0x7be8('0xd3')](_0x1de19a[_0x7be8('0x46')],_0x31d2f2['filters']));if(_0x1de19a[_0x7be8('0x46')][_0x7be8('0x42')]){_0x1f8210[_0x7be8('0x45')]=_['merge'](_0x1f8210['where'],{'$or':_[_0x7be8('0x33')](_0x1f8210[_0x7be8('0x4c')],function(_0x16f496){var _0x37e513={};_0x37e513[_0x16f496]={'$like':'%'+_0x1de19a[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x37e513;})});}_0x1f8210=_[_0x7be8('0x61')]({},_0x1f8210,_0x1de19a[_0x7be8('0x62')]);return _0x111a5c[_0x7be8('0xd0')](_0x1f8210);}})[_0x7be8('0x15')](function(_0x164b39){if(_0x164b39){_0x5acd25=_0x164b39[_0x7be8('0x50')];if(_0x1de19a[_0x7be8('0x46')][_0x7be8('0xd4')]('includeAll')){_0x1f8210[_0x7be8('0x48')]=[{'model':db[_0x7be8('0xd5')],'as':'List','required':![]},{'model':db['Tag'],'as':_0x7be8('0xd6'),'attributes':['id',_0x7be8('0x37'),_0x7be8('0xd7')],'where':_0x1de19a[_0x7be8('0x46')][_0x7be8('0xd8')]?{'id':_0x1de19a[_0x7be8('0x46')]['tag']}:undefined,'required':_0x1de19a['query'][_0x7be8('0xd8')]?!![]:![]}];}if(!_0x1de19a[_0x7be8('0x46')][_0x7be8('0xd4')]('nolimit')){_0x1f8210[_0x7be8('0x24')]=qs[_0x7be8('0x24')](_0x1de19a[_0x7be8('0x46')][_0x7be8('0x24')]);_0x1f8210[_0x7be8('0x26')]=qs[_0x7be8('0x26')](_0x1de19a['query'][_0x7be8('0x26')]);}return _0x111a5c[_0x7be8('0xd0')](_0x1f8210);}})[_0x7be8('0x15')](function(_0x575cdd){if(_0x575cdd){return _0x575cdd?{'count':_0x5acd25,'rows':_0x575cdd}:null;}})[_0x7be8('0x15')](respondWithResult(_0x948226,null))[_0x7be8('0x1f')](handleError(_0x948226,null));};exports['getQueues']=function(_0x31ad86,_0x2f4624){var _0xcc07cf;var _0x220933={};var _0x33d388;return db[_0x7be8('0x3d')][_0x7be8('0x9d')]({'where':{'id':_0x31ad86[_0x7be8('0x5a')]['id']},'attributes':['id',_0x7be8('0x37'),'role']})['then'](handleEntityNotFound(_0x2f4624,null))[_0x7be8('0x15')](function(_0x5640fe){if(!utils[_0x7be8('0xd9')](_0x31ad86[_0x7be8('0x46')][_0x7be8('0xb8')])){throw new db[(_0x7be8('0x94'))]['ValidationError'](_0x7be8('0xa8'));}_0xcc07cf=_0x5640fe;var _0x167ac7={};_0x167ac7['model']=_[_0x7be8('0x5b')](db[_['capitalize'](_0x31ad86[_0x7be8('0x46')][_0x7be8('0xb8')])+_0x7be8('0xda')]['rawAttributes']);_0x167ac7[_0x7be8('0x46')]=_['keys'](_0x31ad86['query']);_0x167ac7['filters']=_['intersection'](_0x167ac7[_0x7be8('0x5f')],_0x167ac7[_0x7be8('0x46')]);_0x220933[_0x7be8('0x4c')]=_['intersection'](_0x167ac7[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0x31ad86[_0x7be8('0x46')]['fields']));_0x220933[_0x7be8('0x4c')]=_0x220933[_0x7be8('0x4c')][_0x7be8('0x50')]?_0x220933[_0x7be8('0x4c')]:_0x167ac7['model'];_0x220933[_0x7be8('0xdb')]=qs[_0x7be8('0xd2')](_0x31ad86['query'][_0x7be8('0xd2')]);_0x220933['where']=qs[_0x7be8('0x5d')](_[_0x7be8('0xd3')](_0x31ad86[_0x7be8('0x46')],_0x167ac7['filters']));if(_0x31ad86[_0x7be8('0x46')][_0x7be8('0x42')]){_0x220933[_0x7be8('0x45')]=_[_0x7be8('0x61')](_0x220933[_0x7be8('0x45')],{'$or':_['map'](_0x220933[_0x7be8('0x4c')],function(_0x571c93){var _0x1ae8f5={};_0x1ae8f5[_0x571c93]={'$like':'%'+_0x31ad86['query']['filter']+'%'};return _0x1ae8f5;})});}_0x220933=_[_0x7be8('0x61')]({},_0x220933,_0x31ad86[_0x7be8('0x62')]);switch(_0xcc07cf[_0x7be8('0x2c')]){case _0x7be8('0x2d'):return db[_[_0x7be8('0xb0')](_0x31ad86[_0x7be8('0x46')][_0x7be8('0xb8')])+_0x7be8('0xda')][_0x7be8('0x4d')](_0x220933);case _0x7be8('0x2f'):case'agent':return _0xcc07cf[_0x7be8('0x2b')+_[_0x7be8('0xb0')](_0x31ad86[_0x7be8('0x46')][_0x7be8('0xb8')])+'Queues'](_0x220933);default:throw new db[(_0x7be8('0x94'))][(_0x7be8('0x95'))](_0x7be8('0xdc'));}})['then'](function(_0x142540){_0x33d388=_0x142540[_0x7be8('0x50')];if(!_0x31ad86[_0x7be8('0x46')][_0x7be8('0xd4')]('nolimit')){_0x220933['limit']=qs[_0x7be8('0x24')](_0x31ad86[_0x7be8('0x46')][_0x7be8('0x24')]);_0x220933[_0x7be8('0x26')]=qs['offset'](_0x31ad86[_0x7be8('0x46')][_0x7be8('0x26')]);}switch(_0xcc07cf['role']){case'admin':return db[_['capitalize'](_0x31ad86[_0x7be8('0x46')][_0x7be8('0xb8')])+_0x7be8('0xda')][_0x7be8('0x4d')](_0x220933);case _0x7be8('0x2f'):case'agent':return _0xcc07cf[_0x7be8('0x2b')+_[_0x7be8('0xb0')](_0x31ad86['query']['channel'])+'Queues'](_0x220933);}})[_0x7be8('0x15')](function(_0x3bda4b){return{'count':_0x33d388,'rows':_0x3bda4b};})[_0x7be8('0x15')](respondWithResult(_0x2f4624,null))[_0x7be8('0x1f')](handleError(_0x2f4624,null));};exports[_0x7be8('0xdd')]=function(_0x3eeabf,_0x3e1d14){var _0x171746={};var _0x1538d2={};var _0xbd7bf8;var _0x595ff3;return db[_0x7be8('0x3d')][_0x7be8('0x9d')]({'where':{'id':_0x3eeabf[_0x7be8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3e1d14,null))[_0x7be8('0x15')](function(_0x3262e5){if(_0x3262e5){_0xbd7bf8=_0x3262e5;_0x1538d2[_0x7be8('0x5f')]=_['keys'](db[_0x7be8('0xde')][_0x7be8('0x3e')]);_0x1538d2[_0x7be8('0x46')]=_[_0x7be8('0x5b')](_0x3eeabf[_0x7be8('0x46')]);_0x1538d2['filters']=_[_0x7be8('0x5e')](_0x1538d2['model'],_0x1538d2[_0x7be8('0x46')]);_0x171746[_0x7be8('0x4c')]=_[_0x7be8('0x5e')](_0x1538d2[_0x7be8('0x5f')],qs['fields'](_0x3eeabf[_0x7be8('0x46')][_0x7be8('0x60')]));_0x171746['attributes']=_0x171746[_0x7be8('0x4c')][_0x7be8('0x50')]?_0x171746['attributes']:_0x1538d2[_0x7be8('0x5f')];_0x171746[_0x7be8('0xdb')]=qs[_0x7be8('0xd2')](_0x3eeabf[_0x7be8('0x46')][_0x7be8('0xd2')]);_0x171746[_0x7be8('0x45')]=qs[_0x7be8('0x5d')](_[_0x7be8('0xd3')](_0x3eeabf[_0x7be8('0x46')],_0x1538d2[_0x7be8('0x5d')]));if(_0x3eeabf[_0x7be8('0x46')][_0x7be8('0x42')]){_0x171746['where']=_[_0x7be8('0x61')](_0x171746[_0x7be8('0x45')],{'$or':_[_0x7be8('0x33')](_0x171746[_0x7be8('0x4c')],function(_0x5a8287){var _0x1aa99b={};_0x1aa99b[_0x5a8287]={'$like':'%'+_0x3eeabf[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x1aa99b;})});}_0x171746=_['merge']({},_0x171746,_0x3eeabf[_0x7be8('0x62')]);return _0xbd7bf8['getVoiceQueuesRt'](_0x171746);}})['then'](function(_0x291405){if(_0x291405){_0x595ff3=_0x291405[_0x7be8('0x50')];if(!_0x3eeabf['query'][_0x7be8('0xd4')](_0x7be8('0xdf'))){_0x171746[_0x7be8('0x24')]=qs['limit'](_0x3eeabf['query'][_0x7be8('0x24')]);_0x171746[_0x7be8('0x26')]=qs[_0x7be8('0x26')](_0x3eeabf[_0x7be8('0x46')][_0x7be8('0x26')]);}return _0xbd7bf8['getVoiceQueuesRt'](_0x171746);}})[_0x7be8('0x15')](function(_0x277529){if(_0x277529){return _0x277529?{'count':_0x595ff3,'rows':_0x277529}:null;}})[_0x7be8('0x15')](respondWithResult(_0x3e1d14,null))[_0x7be8('0x1f')](handleError(_0x3e1d14,null));};exports[_0x7be8('0xe0')]=function(_0x6a4256,_0x3d21d7){var _0x4342c2={};var _0x16a6f4={};var _0xbbbc0f;var _0x66edd1;return db['User'][_0x7be8('0x9d')]({'where':{'id':_0x6a4256[_0x7be8('0x5a')]['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x3d21d7,null))['then'](function(_0x5a6069){if(_0x5a6069){_0xbbbc0f=_0x5a6069;_0x16a6f4[_0x7be8('0x5f')]=_[_0x7be8('0x5b')](db[_0x7be8('0xe1')][_0x7be8('0x3e')]);_0x16a6f4[_0x7be8('0x46')]=_[_0x7be8('0x5b')](_0x6a4256[_0x7be8('0x46')]);_0x16a6f4[_0x7be8('0x5d')]=_[_0x7be8('0x5e')](_0x16a6f4[_0x7be8('0x5f')],_0x16a6f4[_0x7be8('0x46')]);_0x4342c2[_0x7be8('0x4c')]=_[_0x7be8('0x5e')](_0x16a6f4[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0x6a4256[_0x7be8('0x46')][_0x7be8('0x60')]));_0x4342c2[_0x7be8('0x4c')]=_0x4342c2[_0x7be8('0x4c')]['length']?_0x4342c2[_0x7be8('0x4c')]:_0x16a6f4[_0x7be8('0x5f')];_0x4342c2[_0x7be8('0xdb')]=qs[_0x7be8('0xd2')](_0x6a4256['query'][_0x7be8('0xd2')]);_0x4342c2['where']=qs[_0x7be8('0x5d')](_[_0x7be8('0xd3')](_0x6a4256[_0x7be8('0x46')],_0x16a6f4[_0x7be8('0x5d')]));if(_0x6a4256[_0x7be8('0x46')]['filter']){_0x4342c2[_0x7be8('0x45')]=_['merge'](_0x4342c2[_0x7be8('0x45')],{'$or':_[_0x7be8('0x33')](_0x4342c2[_0x7be8('0x4c')],function(_0x239052){var _0x19c49c={};_0x19c49c[_0x239052]={'$like':'%'+_0x6a4256[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x19c49c;})});}_0x4342c2=_[_0x7be8('0x61')]({},_0x4342c2,_0x6a4256['options']);return _0xbbbc0f['getGroups'](_0x4342c2);}})[_0x7be8('0x15')](function(_0x46babf){if(_0x46babf){_0x66edd1=_0x46babf[_0x7be8('0x50')];if(!_0x6a4256['query'][_0x7be8('0xd4')]('nolimit')){_0x4342c2[_0x7be8('0x24')]=qs[_0x7be8('0x24')](_0x6a4256[_0x7be8('0x46')]['limit']);_0x4342c2[_0x7be8('0x26')]=qs[_0x7be8('0x26')](_0x6a4256['query'][_0x7be8('0x26')]);}return _0xbbbc0f[_0x7be8('0xe0')](_0x4342c2);}})[_0x7be8('0x15')](function(_0x13b077){if(_0x13b077){return _0x13b077?{'count':_0x66edd1,'rows':_0x13b077}:null;}})[_0x7be8('0x15')](respondWithResult(_0x3d21d7,null))[_0x7be8('0x1f')](handleError(_0x3d21d7,null));};exports[_0x7be8('0xe2')]=function(_0x4d67af,_0x17b9bf){var _0x53f6b4={'raw':!![],'where':{}};var _0x1656f6={};var _0x2dd11e={'count':0x0,'rows':[]};return db[_0x7be8('0x3d')]['findOne']({'where':{'id':_0x4d67af[_0x7be8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x17b9bf,null))['then'](function(_0x4fe684){if(_0x4fe684){_0x1656f6['model']=_['keys'](db[_0x7be8('0xe3')][_0x7be8('0x3e')]);_0x1656f6[_0x7be8('0x46')]=_[_0x7be8('0x5b')](_0x4d67af[_0x7be8('0x46')]);_0x1656f6[_0x7be8('0x5d')]=_[_0x7be8('0x5e')](_0x1656f6['model'],_0x1656f6[_0x7be8('0x46')]);_0x53f6b4['attributes']=_['intersection'](_0x1656f6[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0x4d67af['query']['fields']));_0x53f6b4[_0x7be8('0x4c')]=_0x53f6b4[_0x7be8('0x4c')]['length']?_0x53f6b4[_0x7be8('0x4c')]:_0x1656f6['model'];if(!_0x4d67af[_0x7be8('0x46')][_0x7be8('0xd4')](_0x7be8('0xdf'))){_0x53f6b4[_0x7be8('0x24')]=qs['limit'](_0x4d67af['query'][_0x7be8('0x24')]);_0x53f6b4[_0x7be8('0x26')]=qs[_0x7be8('0x26')](_0x4d67af[_0x7be8('0x46')][_0x7be8('0x26')]);}_0x53f6b4[_0x7be8('0xdb')]=qs[_0x7be8('0xd2')](_0x4d67af[_0x7be8('0x46')]['sort']);_0x53f6b4['where']=qs[_0x7be8('0x5d')](_[_0x7be8('0xd3')](_0x4d67af['query'],_0x1656f6[_0x7be8('0x5d')]));_0x53f6b4[_0x7be8('0x45')][_0x7be8('0xe4')]=_0x4fe684['id'];if(_0x4d67af[_0x7be8('0x46')][_0x7be8('0x42')]){_0x53f6b4['where']=_[_0x7be8('0x61')](_0x53f6b4['where'],{'$or':_[_0x7be8('0x33')](_0x53f6b4[_0x7be8('0x4c')],function(_0x27c1b5){var _0x834366={};_0x834366[_0x27c1b5]={'$like':'%'+_0x4d67af[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x834366;})});}_0x53f6b4=_[_0x7be8('0x61')]({},_0x53f6b4,_0x4d67af[_0x7be8('0x62')]);return db['VoiceRecording'][_0x7be8('0x25')]({'where':_0x53f6b4['where']})[_0x7be8('0x15')](function(_0x2e747e){_0x2dd11e['count']=_0x2e747e;if(_0x4d67af['query'][_0x7be8('0x47')]){_0x53f6b4[_0x7be8('0x48')]=[{'all':!![]}];}return db[_0x7be8('0xe3')][_0x7be8('0x4d')](_0x53f6b4);})[_0x7be8('0x15')](function(_0x1849ad){_0x2dd11e[_0x7be8('0x4f')]=_0x1849ad;return _0x2dd11e;});}})[_0x7be8('0x15')](respondWithFilteredResult(_0x17b9bf,_0x53f6b4))[_0x7be8('0x1f')](handleError(_0x17b9bf,null));};exports[_0x7be8('0xe5')]=function(_0x487ace,_0x11d6f8){var _0x20b23e={'raw':!![],'where':{}};var _0x2faeea={};var _0x5ec2d2={'count':0x0,'rows':[]};return db['User'][_0x7be8('0x9d')]({'where':{'id':_0x487ace[_0x7be8('0x5a')]['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x11d6f8,null))['then'](function(_0x591751){if(_0x591751){_0x2faeea[_0x7be8('0x5f')]=_['keys'](db[_0x7be8('0xe6')][_0x7be8('0x3e')]);_0x2faeea[_0x7be8('0x46')]=_[_0x7be8('0x5b')](_0x487ace['query']);_0x2faeea[_0x7be8('0x5d')]=_['intersection'](_0x2faeea['model'],_0x2faeea[_0x7be8('0x46')]);_0x20b23e['attributes']=_['intersection'](_0x2faeea[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0x487ace[_0x7be8('0x46')][_0x7be8('0x60')]));_0x20b23e[_0x7be8('0x4c')]=_0x20b23e[_0x7be8('0x4c')][_0x7be8('0x50')]?_0x20b23e['attributes']:_0x2faeea[_0x7be8('0x5f')];if(!_0x487ace[_0x7be8('0x46')]['hasOwnProperty'](_0x7be8('0xdf'))){_0x20b23e[_0x7be8('0x24')]=qs[_0x7be8('0x24')](_0x487ace[_0x7be8('0x46')][_0x7be8('0x24')]);_0x20b23e[_0x7be8('0x26')]=qs[_0x7be8('0x26')](_0x487ace['query'][_0x7be8('0x26')]);}_0x20b23e['order']=qs['sort'](_0x487ace[_0x7be8('0x46')]['sort']);_0x20b23e['where']=qs[_0x7be8('0x5d')](_[_0x7be8('0xd3')](_0x487ace['query'],_0x2faeea[_0x7be8('0x5d')]));_0x20b23e[_0x7be8('0x45')]['UserId']=_0x591751['id'];if(_0x487ace[_0x7be8('0x46')][_0x7be8('0x42')]){_0x20b23e['where']=_[_0x7be8('0x61')](_0x20b23e[_0x7be8('0x45')],{'$or':_[_0x7be8('0x33')](_0x20b23e[_0x7be8('0x4c')],function(_0x5009bb){var _0x4b4cc3={};_0x4b4cc3[_0x5009bb]={'$like':'%'+_0x487ace[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x4b4cc3;})});}_0x20b23e=_['merge']({},_0x20b23e,_0x487ace['options']);return db['ScreenRecording'][_0x7be8('0x25')]({'where':_0x20b23e[_0x7be8('0x45')]})[_0x7be8('0x15')](function(_0xc29886){_0x5ec2d2[_0x7be8('0x25')]=_0xc29886;if(_0x487ace[_0x7be8('0x46')][_0x7be8('0x47')]){_0x20b23e['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x7be8('0x4d')](_0x20b23e);})['then'](function(_0x2c2b15){_0x5ec2d2[_0x7be8('0x4f')]=_0x2c2b15;return _0x5ec2d2;});}})[_0x7be8('0x15')](respondWithFilteredResult(_0x11d6f8,_0x20b23e))[_0x7be8('0x1f')](handleError(_0x11d6f8,null));};exports['getChatInteractions']=function(_0x3a751a,_0x43d857){var _0x58fe41={};var _0x1ee575={};var _0x2ff392;var _0xb3b4cc;return db[_0x7be8('0x3d')][_0x7be8('0x9d')]({'where':{'id':_0x3a751a[_0x7be8('0x5a')]['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x43d857,null))[_0x7be8('0x15')](function(_0x2c082a){if(_0x2c082a){_0x2ff392=_0x2c082a;_0x1ee575[_0x7be8('0x5f')]=_[_0x7be8('0x5b')](db[_0x7be8('0xe7')]['rawAttributes']);_0x1ee575['query']=_[_0x7be8('0x5b')](_0x3a751a['query']);_0x1ee575[_0x7be8('0x5d')]=_[_0x7be8('0x5e')](_0x1ee575[_0x7be8('0x5f')],_0x1ee575[_0x7be8('0x46')]);_0x58fe41[_0x7be8('0x4c')]=_[_0x7be8('0x5e')](_0x1ee575[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0x3a751a[_0x7be8('0x46')]['fields']));_0x58fe41[_0x7be8('0x4c')]=_0x58fe41['attributes'][_0x7be8('0x50')]?_0x58fe41[_0x7be8('0x4c')]:_0x1ee575[_0x7be8('0x5f')];_0x58fe41[_0x7be8('0xdb')]=qs['sort'](_0x3a751a[_0x7be8('0x46')]['sort']);_0x58fe41[_0x7be8('0x45')]=qs['filters'](_[_0x7be8('0xd3')](_0x3a751a[_0x7be8('0x46')],_0x1ee575['filters']));if(_0x3a751a[_0x7be8('0x46')][_0x7be8('0x42')]){_0x58fe41[_0x7be8('0x45')]=_['merge'](_0x58fe41[_0x7be8('0x45')],{'$or':_[_0x7be8('0x33')](_0x58fe41[_0x7be8('0x4c')],function(_0x3c3574){var _0x41bf0c={};_0x41bf0c[_0x3c3574]={'$like':'%'+_0x3a751a[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x41bf0c;})});}_0x58fe41=_[_0x7be8('0x61')]({},_0x58fe41,_0x3a751a[_0x7be8('0x62')]);return _0x2ff392[_0x7be8('0xe8')](_0x58fe41);}})[_0x7be8('0x15')](function(_0x2f70ba){if(_0x2f70ba){_0xb3b4cc=_0x2f70ba[_0x7be8('0x50')];if(!_0x3a751a[_0x7be8('0x46')][_0x7be8('0xd4')](_0x7be8('0xdf'))){_0x58fe41[_0x7be8('0x24')]=qs[_0x7be8('0x24')](_0x3a751a['query'][_0x7be8('0x24')]);_0x58fe41[_0x7be8('0x26')]=qs[_0x7be8('0x26')](_0x3a751a[_0x7be8('0x46')][_0x7be8('0x26')]);}return _0x2ff392[_0x7be8('0xe8')](_0x58fe41);}})['then'](function(_0x383398){if(_0x383398){return _0x383398?{'count':_0xb3b4cc,'rows':_0x383398}:null;}})[_0x7be8('0x15')](respondWithResult(_0x43d857,null))[_0x7be8('0x1f')](handleError(_0x43d857,null));};exports['getOpenchannelInteractions']=function(_0x35a1fb,_0x33959a){var _0x50840a={};var _0x5eaccc={};var _0x286160;var _0xf69aa;return db[_0x7be8('0x3d')][_0x7be8('0x9d')]({'where':{'id':_0x35a1fb['params']['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x33959a,null))['then'](function(_0x3794d2){if(_0x3794d2){_0x286160=_0x3794d2;_0x5eaccc[_0x7be8('0x5f')]=_[_0x7be8('0x5b')](db[_0x7be8('0xe9')][_0x7be8('0x3e')]);_0x5eaccc[_0x7be8('0x46')]=_[_0x7be8('0x5b')](_0x35a1fb[_0x7be8('0x46')]);_0x5eaccc['filters']=_[_0x7be8('0x5e')](_0x5eaccc['model'],_0x5eaccc[_0x7be8('0x46')]);_0x50840a['attributes']=_[_0x7be8('0x5e')](_0x5eaccc[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0x35a1fb['query'][_0x7be8('0x60')]));_0x50840a[_0x7be8('0x4c')]=_0x50840a[_0x7be8('0x4c')][_0x7be8('0x50')]?_0x50840a[_0x7be8('0x4c')]:_0x5eaccc['model'];_0x50840a[_0x7be8('0xdb')]=qs[_0x7be8('0xd2')](_0x35a1fb[_0x7be8('0x46')][_0x7be8('0xd2')]);_0x50840a['where']=qs[_0x7be8('0x5d')](_[_0x7be8('0xd3')](_0x35a1fb[_0x7be8('0x46')],_0x5eaccc[_0x7be8('0x5d')]));if(_0x35a1fb['query'][_0x7be8('0x42')]){_0x50840a[_0x7be8('0x45')]=_['merge'](_0x50840a[_0x7be8('0x45')],{'$or':_[_0x7be8('0x33')](_0x50840a['attributes'],function(_0x20a32d){var _0x300529={};_0x300529[_0x20a32d]={'$like':'%'+_0x35a1fb[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x300529;})});}_0x50840a=_[_0x7be8('0x61')]({},_0x50840a,_0x35a1fb[_0x7be8('0x62')]);return _0x286160[_0x7be8('0xea')](_0x50840a);}})[_0x7be8('0x15')](function(_0x5b2aef){if(_0x5b2aef){_0xf69aa=_0x5b2aef[_0x7be8('0x50')];if(!_0x35a1fb[_0x7be8('0x46')][_0x7be8('0xd4')](_0x7be8('0xdf'))){_0x50840a['limit']=qs[_0x7be8('0x24')](_0x35a1fb[_0x7be8('0x46')]['limit']);_0x50840a[_0x7be8('0x26')]=qs[_0x7be8('0x26')](_0x35a1fb['query']['offset']);}return _0x286160['getOpenchannelInteractions'](_0x50840a);}})[_0x7be8('0x15')](function(_0x50e5e2){if(_0x50e5e2){return _0x50e5e2?{'count':_0xf69aa,'rows':_0x50e5e2}:null;}})[_0x7be8('0x15')](respondWithResult(_0x33959a,null))[_0x7be8('0x1f')](handleError(_0x33959a,null));};exports[_0x7be8('0xeb')]=function(_0x5c0a10,_0x2031f7){var _0x41954a={'raw':!![],'where':{}};var _0x31c982={};var _0x4c2a58={'count':0x0,'rows':[]};return db[_0x7be8('0x3d')][_0x7be8('0x9d')]({'where':{'id':_0x5c0a10[_0x7be8('0x5a')]['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x2031f7,null))[_0x7be8('0x15')](function(_0x1896ab){if(_0x1896ab){_0x31c982[_0x7be8('0x5f')]=_[_0x7be8('0x5b')](db['MailInteraction'][_0x7be8('0x3e')]);_0x31c982['query']=_[_0x7be8('0x5b')](_0x5c0a10['query']);_0x31c982[_0x7be8('0x5d')]=_['intersection'](_0x31c982[_0x7be8('0x5f')],_0x31c982[_0x7be8('0x46')]);_0x41954a[_0x7be8('0x4c')]=_[_0x7be8('0x5e')](_0x31c982[_0x7be8('0x5f')],qs['fields'](_0x5c0a10[_0x7be8('0x46')]['fields']));_0x41954a[_0x7be8('0x4c')]=_0x41954a[_0x7be8('0x4c')]['length']?_0x41954a[_0x7be8('0x4c')]:_0x31c982[_0x7be8('0x5f')];if(!_0x5c0a10[_0x7be8('0x46')][_0x7be8('0xd4')](_0x7be8('0xdf'))){_0x41954a['limit']=qs[_0x7be8('0x24')](_0x5c0a10[_0x7be8('0x46')][_0x7be8('0x24')]);_0x41954a['offset']=qs['offset'](_0x5c0a10['query'][_0x7be8('0x26')]);}_0x41954a[_0x7be8('0xdb')]=qs[_0x7be8('0xd2')](_0x5c0a10[_0x7be8('0x46')][_0x7be8('0xd2')]);_0x41954a[_0x7be8('0x45')]=qs[_0x7be8('0x5d')](_[_0x7be8('0xd3')](_0x5c0a10['query'],_0x31c982[_0x7be8('0x5d')]));_0x41954a[_0x7be8('0x45')]['UserId']=_0x1896ab['id'];if(_0x5c0a10[_0x7be8('0x46')][_0x7be8('0x42')]){_0x41954a['where']=_[_0x7be8('0x61')](_0x41954a['where'],{'$or':_[_0x7be8('0x33')](_0x41954a[_0x7be8('0x4c')],function(_0x3c27e4){var _0x139bc3={};_0x139bc3[_0x3c27e4]={'$like':'%'+_0x5c0a10[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x139bc3;})});}_0x41954a=_['merge']({},_0x41954a,_0x5c0a10[_0x7be8('0x62')]);return db[_0x7be8('0xec')][_0x7be8('0x25')]({'where':_0x41954a[_0x7be8('0x45')]})[_0x7be8('0x15')](function(_0x3b332c){_0x4c2a58[_0x7be8('0x25')]=_0x3b332c;if(_0x5c0a10[_0x7be8('0x46')]['includeAll']){_0x41954a[_0x7be8('0x48')]=[{'all':!![]}];}return db[_0x7be8('0xec')]['findAll'](_0x41954a);})[_0x7be8('0x15')](function(_0x130b7e){_0x4c2a58[_0x7be8('0x4f')]=_0x130b7e;return _0x4c2a58;});}})['then'](respondWithFilteredResult(_0x2031f7,_0x41954a))[_0x7be8('0x1f')](handleError(_0x2031f7,null));};exports[_0x7be8('0xed')]=function(_0x4b5502,_0x4d1f80){var _0x36dcc7={};var _0x26c5e7={};var _0x17b3a4;var _0xa72e08;return db['User']['findOne']({'where':{'id':_0x4b5502[_0x7be8('0x5a')]['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x4d1f80,null))[_0x7be8('0x15')](function(_0x4115fe){if(_0x4115fe){_0x17b3a4=_0x4115fe;_0x26c5e7[_0x7be8('0x5f')]=_[_0x7be8('0x5b')](db[_0x7be8('0xee')][_0x7be8('0x3e')]);_0x26c5e7['query']=_[_0x7be8('0x5b')](_0x4b5502[_0x7be8('0x46')]);_0x26c5e7[_0x7be8('0x5d')]=_[_0x7be8('0x5e')](_0x26c5e7[_0x7be8('0x5f')],_0x26c5e7[_0x7be8('0x46')]);_0x36dcc7[_0x7be8('0x4c')]=_[_0x7be8('0x5e')](_0x26c5e7[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0x4b5502['query'][_0x7be8('0x60')]));_0x36dcc7[_0x7be8('0x4c')]=_0x36dcc7['attributes'][_0x7be8('0x50')]?_0x36dcc7[_0x7be8('0x4c')]:_0x26c5e7[_0x7be8('0x5f')];_0x36dcc7['order']=qs[_0x7be8('0xd2')](_0x4b5502[_0x7be8('0x46')]['sort']);_0x36dcc7['where']=qs[_0x7be8('0x5d')](_[_0x7be8('0xd3')](_0x4b5502[_0x7be8('0x46')],_0x26c5e7[_0x7be8('0x5d')]));if(_0x4b5502[_0x7be8('0x46')][_0x7be8('0x42')]){_0x36dcc7[_0x7be8('0x45')]=_[_0x7be8('0x61')](_0x36dcc7[_0x7be8('0x45')],{'$or':_[_0x7be8('0x33')](_0x36dcc7['attributes'],function(_0x1ea216){var _0x161909={};_0x161909[_0x1ea216]={'$like':'%'+_0x4b5502['query'][_0x7be8('0x42')]+'%'};return _0x161909;})});}_0x36dcc7=_['merge']({},_0x36dcc7,_0x4b5502[_0x7be8('0x62')]);return _0x17b3a4[_0x7be8('0xed')](_0x36dcc7);}})['then'](function(_0xa32ddb){if(_0xa32ddb){_0xa72e08=_0xa32ddb[_0x7be8('0x50')];if(!_0x4b5502[_0x7be8('0x46')][_0x7be8('0xd4')](_0x7be8('0xdf'))){_0x36dcc7['limit']=qs[_0x7be8('0x24')](_0x4b5502[_0x7be8('0x46')][_0x7be8('0x24')]);_0x36dcc7[_0x7be8('0x26')]=qs[_0x7be8('0x26')](_0x4b5502['query'][_0x7be8('0x26')]);}return _0x17b3a4[_0x7be8('0xed')](_0x36dcc7);}})['then'](function(_0xe96a1a){if(_0xe96a1a){return _0xe96a1a?{'count':_0xa72e08,'rows':_0xe96a1a}:null;}})[_0x7be8('0x15')](respondWithResult(_0x4d1f80,null))['catch'](handleError(_0x4d1f80,null));};exports[_0x7be8('0xef')]=function(_0x48c3a3,_0x2dc278){var _0x5bf516={};var _0x28f033={};var _0x4d2e25;var _0x3d4d97;return db[_0x7be8('0x3d')][_0x7be8('0x9d')]({'where':{'id':_0x48c3a3[_0x7be8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2dc278,null))['then'](function(_0x9e5c09){if(_0x9e5c09){_0x4d2e25=_0x9e5c09;_0x28f033[_0x7be8('0x5f')]=_['keys'](db[_0x7be8('0xf0')][_0x7be8('0x3e')]);_0x28f033[_0x7be8('0x46')]=_[_0x7be8('0x5b')](_0x48c3a3[_0x7be8('0x46')]);_0x28f033[_0x7be8('0x5d')]=_[_0x7be8('0x5e')](_0x28f033['model'],_0x28f033[_0x7be8('0x46')]);_0x5bf516[_0x7be8('0x4c')]=_[_0x7be8('0x5e')](_0x28f033[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0x48c3a3[_0x7be8('0x46')]['fields']));_0x5bf516[_0x7be8('0x4c')]=_0x5bf516['attributes'][_0x7be8('0x50')]?_0x5bf516['attributes']:_0x28f033[_0x7be8('0x5f')];_0x5bf516['order']=qs[_0x7be8('0xd2')](_0x48c3a3[_0x7be8('0x46')][_0x7be8('0xd2')]);_0x5bf516['where']=qs[_0x7be8('0x5d')](_['pick'](_0x48c3a3[_0x7be8('0x46')],_0x28f033[_0x7be8('0x5d')]));if(_0x48c3a3['query']['filter']){_0x5bf516[_0x7be8('0x45')]=_[_0x7be8('0x61')](_0x5bf516[_0x7be8('0x45')],{'$or':_[_0x7be8('0x33')](_0x5bf516[_0x7be8('0x4c')],function(_0x5e6062){var _0x50fa92={};_0x50fa92[_0x5e6062]={'$like':'%'+_0x48c3a3[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x50fa92;})});}_0x5bf516=_[_0x7be8('0x61')]({},_0x5bf516,_0x48c3a3[_0x7be8('0x62')]);return _0x4d2e25['getFaxInteractions'](_0x5bf516);}})[_0x7be8('0x15')](function(_0xb1092f){if(_0xb1092f){_0x3d4d97=_0xb1092f['length'];if(!_0x48c3a3[_0x7be8('0x46')][_0x7be8('0xd4')](_0x7be8('0xdf'))){_0x5bf516['limit']=qs[_0x7be8('0x24')](_0x48c3a3[_0x7be8('0x46')][_0x7be8('0x24')]);_0x5bf516['offset']=qs[_0x7be8('0x26')](_0x48c3a3[_0x7be8('0x46')]['offset']);}return _0x4d2e25[_0x7be8('0xef')](_0x5bf516);}})['then'](function(_0x28867e){if(_0x28867e){return _0x28867e?{'count':_0x3d4d97,'rows':_0x28867e}:null;}})[_0x7be8('0x15')](respondWithResult(_0x2dc278,null))[_0x7be8('0x1f')](handleError(_0x2dc278,null));};exports[_0x7be8('0xf1')]=function(_0x5d3aee,_0x11ff2a){var _0x19baeb={};var _0xd27a46={};var _0x40d84b;var _0x552667;return db[_0x7be8('0x3d')]['findOne']({'where':{'id':_0x5d3aee[_0x7be8('0x5a')]['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x11ff2a,null))[_0x7be8('0x15')](function(_0x12e9d0){if(_0x12e9d0){_0x40d84b=_0x12e9d0;_0xd27a46[_0x7be8('0x5f')]=_[_0x7be8('0x5b')](db['WhatsappInteraction']['rawAttributes']);_0xd27a46[_0x7be8('0x46')]=_[_0x7be8('0x5b')](_0x5d3aee[_0x7be8('0x46')]);_0xd27a46['filters']=_[_0x7be8('0x5e')](_0xd27a46[_0x7be8('0x5f')],_0xd27a46[_0x7be8('0x46')]);_0x19baeb[_0x7be8('0x4c')]=_['intersection'](_0xd27a46[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0x5d3aee[_0x7be8('0x46')][_0x7be8('0x60')]));_0x19baeb[_0x7be8('0x4c')]=_0x19baeb[_0x7be8('0x4c')][_0x7be8('0x50')]?_0x19baeb[_0x7be8('0x4c')]:_0xd27a46[_0x7be8('0x5f')];_0x19baeb[_0x7be8('0xdb')]=qs[_0x7be8('0xd2')](_0x5d3aee[_0x7be8('0x46')][_0x7be8('0xd2')]);_0x19baeb['where']=qs[_0x7be8('0x5d')](_[_0x7be8('0xd3')](_0x5d3aee[_0x7be8('0x46')],_0xd27a46[_0x7be8('0x5d')]));if(_0x5d3aee[_0x7be8('0x46')][_0x7be8('0x42')]){_0x19baeb[_0x7be8('0x45')]=_[_0x7be8('0x61')](_0x19baeb[_0x7be8('0x45')],{'$or':_[_0x7be8('0x33')](_0x19baeb['attributes'],function(_0x5af5b1){var _0x54d5b4={};_0x54d5b4[_0x5af5b1]={'$like':'%'+_0x5d3aee[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x54d5b4;})});}_0x19baeb=_[_0x7be8('0x61')]({},_0x19baeb,_0x5d3aee[_0x7be8('0x62')]);return _0x40d84b[_0x7be8('0xf1')](_0x19baeb);}})['then'](function(_0x4de5a0){if(_0x4de5a0){_0x552667=_0x4de5a0[_0x7be8('0x50')];if(!_0x5d3aee[_0x7be8('0x46')][_0x7be8('0xd4')](_0x7be8('0xdf'))){_0x19baeb[_0x7be8('0x24')]=qs[_0x7be8('0x24')](_0x5d3aee['query'][_0x7be8('0x24')]);_0x19baeb['offset']=qs[_0x7be8('0x26')](_0x5d3aee[_0x7be8('0x46')][_0x7be8('0x26')]);}return _0x40d84b[_0x7be8('0xf1')](_0x19baeb);}})[_0x7be8('0x15')](function(_0x2f8701){if(_0x2f8701){return _0x2f8701?{'count':_0x552667,'rows':_0x2f8701}:null;}})['then'](respondWithResult(_0x11ff2a,null))['catch'](handleError(_0x11ff2a,null));};exports[_0x7be8('0xf2')]=function(_0xfdf3f5,_0x475259,_0x287479){var _0xb10eac;var _0x56de5c;var _0x1b9493;var _0x3f2a76=!_['isNil'](_0xfdf3f5[_0x7be8('0x5a')]['id'])?_0xfdf3f5[_0x7be8('0x5a')]['id']:!_[_0x7be8('0x6c')](_0xfdf3f5[_0x7be8('0x2f')]['id'])?_0xfdf3f5['user']['id']:null;return db['User'][_0x7be8('0x36')]({'where':{'id':_0x3f2a76,'role':{'$or':[_0x7be8('0x2d'),'user',_0x7be8('0x31')]}},'attributes':['id','name',_0x7be8('0xf3'),_0x7be8('0xf4'),_0x7be8('0x2c'),'internal',_0x7be8('0xa6')]})['then'](function(_0x4a362c){if(_0x4a362c){if(_0x4a362c[_0x7be8('0x2c')]==='agent'){_0xb10eac=_0x4a362c;if(_0xfdf3f5[_0x7be8('0x64')][_0x7be8('0xa7')]){_0x1b9493=util[_0x7be8('0xf5')](_0x7be8('0xf6'),_0xb10eac[_0xfdf3f5[_0x7be8('0x64')]['interface']]);}else if(_0xfdf3f5[_0x7be8('0x64')][_0x7be8('0xf7')]){_0x1b9493=util[_0x7be8('0xf5')](_0x7be8('0xb4'),_0xfdf3f5[_0x7be8('0x64')][_0x7be8('0xf7')]);}else{_0x1b9493=util[_0x7be8('0xf5')](_0x7be8('0xb4'),_0xb10eac['name']);}socket['to'](util[_0x7be8('0xf5')](_0x7be8('0xf8'),_0xb10eac[_0x7be8('0x37')]))['emit'](_0x7be8('0xf9'),{'user':{'id':_0xb10eac['id'],'name':_0xb10eac[_0x7be8('0x37')]},'ip':_0xfdf3f5[_0x7be8('0xfa')]['x-forwarded-for']||_0xfdf3f5[_0x7be8('0xfb')][_0x7be8('0xfc')]||_0xfdf3f5['socket'][_0x7be8('0xfc')]||_0xfdf3f5['connection'][_0x7be8('0xfd')][_0x7be8('0xfc')]});return db[_0x7be8('0xde')]['destroy']({'where':{'membername':_0xb10eac['name']},'individualHooks':!![]});}}else{throw new db[(_0x7be8('0x94'))]['ValidationError'](_0x7be8('0xfe'));}})[_0x7be8('0x15')](function(){if(_0xb10eac){return _0xb10eac['getVoiceQueues']({'raw':!![]});}})[_0x7be8('0x15')](function(_0x13a5dc){if(_0xb10eac){var _0xc29dbe=[];if(_0x13a5dc){_0x56de5c=_0x13a5dc;if(_0x56de5c[_0x7be8('0x50')]){for(var _0x2f8e88=0x0;_0x2f8e88<_0x56de5c[_0x7be8('0x50')];_0x2f8e88++){_0xc29dbe['push']({'membername':_0xb10eac[_0x7be8('0x37')],'UserId':_0xb10eac['id'],'queue_name':_0x56de5c[_0x2f8e88][_0x7be8('0x37')],'VoiceQueueId':_0x56de5c[_0x2f8e88]['id'],'interface':_0x1b9493,'paused':_0xb10eac[_0x7be8('0xa6')]||![],'penalty':_0x56de5c[_0x2f8e88][_0x7be8('0xff')]||0x0});}return BPromise[_0x7be8('0x8e')](_0xc29dbe,function(_0x4df42f){return db[_0x7be8('0xde')][_0x7be8('0xb6')](_0x4df42f);});}}}})['then'](function(){if(_0xb10eac){return db[_0x7be8('0x100')]['findAll']({'where':{'membername':_0xb10eac[_0x7be8('0x37')],'exitAt':null}});}})[_0x7be8('0x15')](function(_0x5698d0){if(_0xb10eac){var _0x12cc5d=[];_0x5698d0['forEach'](function(_0x2490dd){_0x12cc5d[_0x7be8('0x53')](_0x2490dd['update']({'exitAt':moment()[_0x7be8('0xf5')](_0x7be8('0x101'))}));});return BPromise[_0x7be8('0x58')](_0x12cc5d);}})['then'](function(){if(_0xb10eac){var _0x2e23c8=[];var _0x21f131=[];var _0xa36d6e=utils[_0x7be8('0x102')]();var _0x338d29={'membername':_0xb10eac['name'],'interface':_0x1b9493,'enterAt':moment()[_0x7be8('0xf5')](_0x7be8('0x101')),'role':_0xb10eac[_0x7be8('0x2c')],'internal':_0xb10eac[_0x7be8('0x6b')]};_0xa36d6e[_0x7be8('0x103')](function(_0x2b3f3b){_0x2e23c8['push'](_[_0x7be8('0x61')]({'channel':_0x2b3f3b,'type':_0x7be8('0x104'),'data1':_0xfdf3f5['body']['device'],'data2':_0x1b9493},_0x338d29));if(_0xb10eac[_0x7be8('0xa6')]){_0x21f131[_0x7be8('0x53')](_[_0x7be8('0x61')]({'channel':_0x2b3f3b,'type':_0x7be8('0x105'),'data1':_0x7be8('0x106')},_0x338d29));}});return db[_0x7be8('0x100')]['bulkCreate'](_0x2e23c8[_0x7be8('0xcf')](_0x21f131),{'individualHooks':!![]});}})['then'](function(){if(_0xb10eac){return _0xb10eac[_0x7be8('0x29')]({'online':!![],'lastLoginAt':moment()[_0x7be8('0xf5')](_0x7be8('0x101')),'voicePause':_0xb10eac['loginInPause']||![],'mailPause':_0xb10eac[_0x7be8('0xa6')]||![],'chatPause':_0xb10eac[_0x7be8('0xa6')]||![],'faxPause':_0xb10eac[_0x7be8('0xa6')]||![],'smsPause':_0xb10eac[_0x7be8('0xa6')]||![],'openchannelPause':_0xb10eac['loginInPause']||![],'whatsappPause':_0xb10eac[_0x7be8('0xa6')]||![],'pauseType':_0xb10eac['loginInPause']?_0x7be8('0x106'):null,'interface':_0x1b9493,'lastPauseAt':moment()[_0x7be8('0xf5')](_0x7be8('0x101'))});}})['then'](function(_0x1cf656){if(_0xfdf3f5[_0x7be8('0x107')]){return _0x287479();}else{return BPromise[_0x7be8('0x108')](_0x1cf656)[_0x7be8('0x15')](respondWithResult(_0x475259,null));}})['catch'](handleError(_0x475259,null));};exports[_0x7be8('0x109')]=function(_0x554b79,_0x6dfe4d){var _0x2eb17b;return db[_0x7be8('0x3d')][_0x7be8('0x36')]({'where':{'id':_0x554b79[_0x7be8('0x5a')]['id'],'role':_0x7be8('0x31')},'attributes':['id',_0x7be8('0x37'),'role']})['then'](handleEntityNotFound(_0x6dfe4d,null))['then'](function(_0x404888){if(_0x404888){_0x2eb17b=_0x404888;return db[_0x7be8('0xde')][_0x7be8('0x2a')]({'where':{'membername':_0x2eb17b[_0x7be8('0x37')]},'individualHooks':!![]});}})['then'](function(){return db[_0x7be8('0x100')]['findAll']({'where':{'membername':_0x2eb17b[_0x7be8('0x37')],'exitAt':null}});})[_0x7be8('0x15')](function(_0x1a5464){var _0x119a2d=[];_0x1a5464[_0x7be8('0x103')](function(_0x5c1ca2){_0x119a2d['push'](_0x5c1ca2[_0x7be8('0x29')]({'exitAt':moment()[_0x7be8('0xf5')](_0x7be8('0x101'))}));});return BPromise[_0x7be8('0x58')](_0x119a2d);})[_0x7be8('0x15')](function(){return _0x2eb17b[_0x7be8('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x6dfe4d,null))[_0x7be8('0x1f')](handleError(_0x6dfe4d,null));};exports[_0x7be8('0x10a')]=function(_0x35bf2d,_0x375dbd){var _0x1ca468;return db['UserVoiceQueueRt'][_0x7be8('0x29')]({'paused':0x1},{'where':{'UserId':_0x35bf2d[_0x7be8('0x5a')]['id']},'individualHooks':!![]})[_0x7be8('0x15')](function(){return db[_0x7be8('0x3d')]['find']({'where':{'id':_0x35bf2d[_0x7be8('0x5a')]['id'],'role':_0x7be8('0x31')},'attributes':['id','name','role',_0x7be8('0x6b'),_0x7be8('0xa7')]});})['then'](handleEntityNotFound(_0x375dbd,null))[_0x7be8('0x15')](function(_0x4aca70){if(_0x4aca70){_0x1ca468=_0x4aca70;return respondWithRpcPromise('QueuePause','pause',{'id':_0x1ca468['id'],'name':_0x1ca468[_0x7be8('0x37')],'pause':!![]});}})['then'](function(){if(_0x1ca468){return db[_0x7be8('0x100')][_0x7be8('0x4d')]({'where':{'membername':_0x1ca468[_0x7be8('0x37')],'type':_0x7be8('0x105'),'exitAt':null}});}})['then'](function(_0x5a7d7a){if(_0x5a7d7a[_0x7be8('0x50')]){var _0x35dc5e=moment()[_0x7be8('0xf5')](_0x7be8('0x101'));for(var _0x5aa97e=0x0,_0x528075=_0x5a7d7a[_0x7be8('0x50')];_0x5aa97e<_0x528075;_0x5aa97e++){_0x5a7d7a[_0x5aa97e][_0x7be8('0x10b')]({'exitAt':_0x35dc5e});}}})[_0x7be8('0x15')](function(){var _0x2f84a5=[];var _0x101918=utils[_0x7be8('0x102')]();_0x101918[_0x7be8('0x103')](function(_0x2bfb32){_0x2f84a5[_0x7be8('0x53')]({'channel':_0x2bfb32,'membername':_0x1ca468['name'],'interface':_[_0x7be8('0x6c')](_0x1ca468[_0x7be8('0xa7')])?util[_0x7be8('0xf5')]('SIP/%s',_0x1ca468['name']):_0x1ca468[_0x7be8('0xa7')],'type':'PAUSE','enterAt':moment()[_0x7be8('0xf5')](_0x7be8('0x101')),'data1':_0x35bf2d[_0x7be8('0x64')]['type']||_0x7be8('0x10c'),'role':_0x1ca468[_0x7be8('0x2c')],'internal':_0x1ca468[_0x7be8('0x6b')]});});return db[_0x7be8('0x100')][_0x7be8('0x8b')](_0x2f84a5,{'individualHooks':!![]});})[_0x7be8('0x15')](function(){return _0x1ca468[_0x7be8('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x35bf2d[_0x7be8('0x64')][_0x7be8('0x40')]||_0x7be8('0x10c'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x7be8('0x15')](respondWithResult(_0x375dbd,null))[_0x7be8('0x1f')](handleError(_0x375dbd,null));};exports['unpause']=function(_0x477d0e,_0xac7ac){var _0x3c15cd;return db['User'][_0x7be8('0x36')]({'where':{'id':_0x477d0e[_0x7be8('0x5a')]['id']},'attributes':['id','name',_0x7be8('0x2c'),_0x7be8('0xb5'),_0x7be8('0x10d'),_0x7be8('0x10e'),_0x7be8('0x10f'),_0x7be8('0x110'),_0x7be8('0x111'),_0x7be8('0x112'),_0x7be8('0x113'),_0x7be8('0x114')]})[_0x7be8('0x15')](handleEntityNotFound(_0xac7ac,null))[_0x7be8('0x15')](function(_0x525361){if(_0x525361){_0x3c15cd=_0x525361;if(_0x477d0e['body']['channel']&&!utils[_0x7be8('0xd9')](_0x477d0e[_0x7be8('0x64')][_0x7be8('0xb8')])){throw new db[(_0x7be8('0x94'))][(_0x7be8('0x95'))](_0x7be8('0xa8'));}switch(_0x477d0e[_0x7be8('0x64')]['channel']){case _0x7be8('0xb2'):return respondWithRpcPromise(_0x7be8('0x115'),_0x7be8('0x116'),{'id':_0x3c15cd['id'],'name':_0x3c15cd[_0x7be8('0x37')],'pause':![]})[_0x7be8('0x15')](function(){return db[_0x7be8('0xde')][_0x7be8('0x29')]({'paused':0x0},{'where':{'UserId':_0x3c15cd['id']},'individualHooks':!![]});})[_0x7be8('0x15')](function(){return db['MemberReport']['find']({'where':{'channel':_0x477d0e[_0x7be8('0x64')][_0x7be8('0xb8')],'membername':_0x3c15cd[_0x7be8('0x37')],'type':_0x7be8('0x105'),'exitAt':null}});})[_0x7be8('0x15')](function(_0x459ec1){if(_0x459ec1){return _0x459ec1[_0x7be8('0x29')]({'exitAt':moment()['format'](_0x7be8('0x101')),'data2':_0x7be8('0x117')},{'individualHooks':!![]});}return null;})[_0x7be8('0x15')](function(){return _0x3c15cd[_0x7be8('0x29')]({'voicePause':![]});});case'mail':case _0x7be8('0x51'):case _0x7be8('0x54'):case _0x7be8('0x63'):case _0x7be8('0x57'):case _0x7be8('0x56'):return db[_0x7be8('0x100')][_0x7be8('0x36')]({'where':{'channel':_0x477d0e[_0x7be8('0x64')][_0x7be8('0xb8')],'membername':_0x3c15cd[_0x7be8('0x37')],'type':_0x7be8('0x105'),'exitAt':null}})[_0x7be8('0x15')](function(_0x2a3a36){if(_0x2a3a36){return _0x2a3a36[_0x7be8('0x29')]({'exitAt':moment()[_0x7be8('0xf5')](_0x7be8('0x101')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x7be8('0x15')](function(){var _0x439db0={};_['set'](_0x439db0,util[_0x7be8('0xf5')]('%s%s',_0x477d0e[_0x7be8('0x64')][_0x7be8('0xb8')],'Pause'),![]);return _0x3c15cd[_0x7be8('0x29')](_0x439db0);});default:return respondWithRpcPromise('QueuePause',_0x7be8('0x116'),{'id':_0x3c15cd['id'],'name':_0x3c15cd[_0x7be8('0x37')],'pause':![]})[_0x7be8('0x15')](function(){return db[_0x7be8('0xde')][_0x7be8('0x29')]({'paused':0x0},{'where':{'UserId':_0x3c15cd['id']}});})[_0x7be8('0x15')](function(){return db[_0x7be8('0x100')][_0x7be8('0x4d')]({'where':{'membername':_0x3c15cd['name'],'type':'PAUSE','exitAt':null}});})[_0x7be8('0x15')](function(_0x49b3bb){var _0x465a1e=[];_0x49b3bb['forEach'](function(_0x390627){_0x465a1e[_0x7be8('0x53')](_0x390627['update']({'exitAt':moment()[_0x7be8('0xf5')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x7be8('0x117')}));});return BPromise['all'](_0x465a1e);})[_0x7be8('0x15')](function(){return _0x3c15cd[_0x7be8('0x29')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x7be8('0x15')](respondWithResult(_0xac7ac,null))[_0x7be8('0x1f')](handleError(_0xac7ac,null));};exports[_0x7be8('0x118')]=function(_0x2d63bd,_0x173809){var _0x3abd93={};var _0x35153e={};var _0x5b83eb;var _0x191754;return db[_0x7be8('0x3d')][_0x7be8('0x9d')]({'where':{'id':_0x2d63bd[_0x7be8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x173809,null))[_0x7be8('0x15')](function(_0x860216){if(_0x860216){_0x5b83eb=_0x860216;_0x35153e[_0x7be8('0x5f')]=_[_0x7be8('0x5b')](db[_0x7be8('0x119')][_0x7be8('0x3e')]);_0x35153e['query']=_[_0x7be8('0x5b')](_0x2d63bd[_0x7be8('0x46')]);_0x35153e['filters']=_[_0x7be8('0x5e')](_0x35153e[_0x7be8('0x5f')],_0x35153e['query']);_0x3abd93['attributes']=_[_0x7be8('0x5e')](_0x35153e['model'],qs[_0x7be8('0x60')](_0x2d63bd[_0x7be8('0x46')]['fields']));_0x3abd93[_0x7be8('0x4c')]=_0x3abd93[_0x7be8('0x4c')][_0x7be8('0x50')]?_0x3abd93[_0x7be8('0x4c')]:_0x35153e[_0x7be8('0x5f')];_0x3abd93['order']=qs['sort'](_0x2d63bd[_0x7be8('0x46')]['sort']);_0x3abd93[_0x7be8('0x45')]=qs['filters'](_[_0x7be8('0xd3')](_0x2d63bd[_0x7be8('0x46')],_0x35153e['filters']));if(_0x2d63bd['query'][_0x7be8('0x42')]){_0x3abd93['where']=_['merge'](_0x3abd93[_0x7be8('0x45')],{'$or':_[_0x7be8('0x33')](_0x3abd93[_0x7be8('0x4c')],function(_0x147221){var _0x739668={};_0x739668[_0x147221]={'$like':'%'+_0x2d63bd[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x739668;})});}_0x3abd93=_['merge']({},_0x3abd93,_0x2d63bd[_0x7be8('0x62')]);return _0x5b83eb[_0x7be8('0x118')](_0x3abd93);}})[_0x7be8('0x15')](function(_0x36c1f0){if(_0x36c1f0){_0x191754=_0x36c1f0['length'];if(!_0x2d63bd[_0x7be8('0x46')][_0x7be8('0xd4')]('nolimit')){_0x3abd93[_0x7be8('0x24')]=qs['limit'](_0x2d63bd[_0x7be8('0x46')][_0x7be8('0x24')]);_0x3abd93['offset']=qs[_0x7be8('0x26')](_0x2d63bd[_0x7be8('0x46')][_0x7be8('0x26')]);}return _0x5b83eb[_0x7be8('0x118')](_0x3abd93);}})[_0x7be8('0x15')](function(_0x1d8f3c){if(_0x1d8f3c){return _0x1d8f3c?{'count':_0x191754,'rows':_0x1d8f3c}:null;}})[_0x7be8('0x15')](respondWithResult(_0x173809,null))[_0x7be8('0x1f')](handleError(_0x173809,null));};exports[_0x7be8('0x11a')]=function(_0x22425e,_0x3175d4){return db[_0x7be8('0x3d')][_0x7be8('0x36')]({'where':{'id':_0x22425e[_0x7be8('0x5a')]['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x3175d4,null))[_0x7be8('0x15')](function(_0x2c4d68){if(_0x2c4d68){var _0x2d988a=_0x2c4d68[_0x7be8('0x2b')]({'plain':!![]});return _0x2c4d68[_0x7be8('0x11a')](_0x22425e[_0x7be8('0x64')][_0x7be8('0x68')],_[_0x7be8('0x67')](_0x22425e[_0x7be8('0x64')],[_0x7be8('0x68'),'id'])||{})['then'](function(){for(var _0x14db1b=0x0;_0x14db1b<_0x22425e[_0x7be8('0x64')][_0x7be8('0x68')][_0x7be8('0x50')];_0x14db1b++){var _0x145001=[];var _0x458202={};db[_0x7be8('0x119')][_0x7be8('0x9d')]({'where':{'id':_0x22425e[_0x7be8('0x64')][_0x7be8('0x68')][_0x14db1b]}})['then'](function(_0x5f2d6c){_0x458202=_0x5f2d6c['dataValues'];_0x145001[_0x7be8('0x53')](_0x5f2d6c[_0x7be8('0x11b')]()[_0x7be8('0x15')](function(_0x51d097){for(var _0x2d1dfd=0x0;_0x2d1dfd<_0x51d097['length'];_0x2d1dfd++){_0x51d097[_0x2d1dfd][_0x7be8('0x11c')](_0x7be8('0xb8'),_0x7be8('0x11d'));}return _0x51d097;}));_0x145001[_0x7be8('0x53')](_0x5f2d6c[_0x7be8('0x11e')]()[_0x7be8('0x15')](function(_0x55c187){for(var _0x556f02=0x0;_0x556f02<_0x55c187[_0x7be8('0x50')];_0x556f02++){_0x55c187[_0x556f02][_0x7be8('0x11c')](_0x7be8('0xb8'),_0x7be8('0x11f'));}return _0x55c187;}));_0x145001[_0x7be8('0x53')](_0x5f2d6c[_0x7be8('0x120')]()['then'](function(_0x54c8da){for(var _0x22210a=0x0;_0x22210a<_0x54c8da[_0x7be8('0x50')];_0x22210a++){_0x54c8da[_0x22210a][_0x7be8('0x11c')]('channel',_0x7be8('0x121'));}return _0x54c8da;}));_0x145001[_0x7be8('0x53')](_0x5f2d6c[_0x7be8('0x122')]()[_0x7be8('0x15')](function(_0x3a772b){for(var _0xd94fd9=0x0;_0xd94fd9<_0x3a772b[_0x7be8('0x50')];_0xd94fd9++){_0x3a772b[_0xd94fd9][_0x7be8('0x11c')](_0x7be8('0xb8'),_0x7be8('0x123'));}return _0x3a772b;}));_0x145001[_0x7be8('0x53')](_0x5f2d6c[_0x7be8('0x124')]()[_0x7be8('0x15')](function(_0x54136c){for(var _0x17ad16=0x0;_0x17ad16<_0x54136c[_0x7be8('0x50')];_0x17ad16++){_0x54136c[_0x17ad16][_0x7be8('0x11c')](_0x7be8('0xb8'),_0x7be8('0x125'));}return _0x54136c;}));_0x145001[_0x7be8('0x53')](_0x5f2d6c[_0x7be8('0x126')]()[_0x7be8('0x15')](function(_0x4e2b65){for(var _0x46d772=0x0;_0x46d772<_0x4e2b65[_0x7be8('0x50')];_0x46d772++){_0x4e2b65[_0x46d772][_0x7be8('0x11c')](_0x7be8('0xb8'),_0x7be8('0x127'));}return _0x4e2b65;}));_0x145001[_0x7be8('0x53')](_0x5f2d6c[_0x7be8('0x128')]()['then'](function(_0xde3bcd){for(var _0x144e7e=0x0;_0x144e7e<_0xde3bcd[_0x7be8('0x50')];_0x144e7e++){_0xde3bcd[_0x144e7e][_0x7be8('0x11c')](_0x7be8('0xb8'),'Openchannel');}return _0xde3bcd;}));return BPromise[_0x7be8('0x58')](_0x145001);})[_0x7be8('0x15')](function(_0x10dbe8){var _0x32ac6b=_['flatten'](_0x10dbe8);_0x145001=[];return db[_0x7be8('0x6e')][_0x7be8('0x129')](function(_0x19dfc9){for(var _0x19c9d9=0x0;_0x19c9d9<_0x32ac6b[_0x7be8('0x50')];_0x19c9d9++){_0x145001[_0x7be8('0x53')](_0x32ac6b[_0x19c9d9]['addAgent'](_0x2d988a['id']),{'transaction':_0x19dfc9});}return BPromise[_0x7be8('0x58')](_0x145001)['then'](function(){if(_0x2d988a[_0x7be8('0xa5')]){return BPromise[_0x7be8('0x8e')](_[_0x7be8('0x42')](_0x32ac6b,function(_0x3a53f2){return _0x3a53f2[_0x7be8('0x12a')](_0x7be8('0xb8'))===_0x7be8('0x11d');}),function(_0x405223){return db[_0x7be8('0xde')][_0x7be8('0xb6')]({'membername':_0x2d988a['name'],'UserId':_0x2d988a['id'],'queue_name':_0x405223[_0x7be8('0x37')],'VoiceQueueId':_0x405223['id'],'interface':_[_0x7be8('0x6c')](_0x2d988a[_0x7be8('0xa7')])?util[_0x7be8('0xf5')](_0x7be8('0xb4'),_0x2d988a[_0x7be8('0x37')]):_0x2d988a[_0x7be8('0xa7')],'paused':_0x2d988a[_0x7be8('0xb5')]||![],'penalty':_0x2d988a[_0x7be8('0xac')]},{'transaction':_0x19dfc9});});}else{return;}})['then'](function(){for(var _0x3e8f98=0x0;_0x3e8f98<_0x32ac6b[_0x7be8('0x50')];_0x3e8f98++){var _0x573a58=_0x32ac6b[_0x3e8f98][_0x7be8('0x12a')](_0x7be8('0xb8'));var _0x4d214d=_0x573a58+'QueueId';socket[_0x7be8('0xaf')](_0x7be8('0x2f')+_0x573a58+_0x7be8('0xb1'),{'UserId':_0x2d988a['id'],['queueField']:_0x32ac6b[_0x3e8f98]['id']});}});});})['then'](function(){db[_0x7be8('0x12b')]['findOne']({'where':{'teamId':_0x458202['id']}})[_0x7be8('0x15')](function(_0x46b7fe){if(_0x46b7fe){db[_0x7be8('0x12c')]['create']({'UserId':_0x22425e[_0x7be8('0x5a')]['id'],'VoicePrefixId':_0x46b7fe['VoicePrefixId']});}});});}});}})[_0x7be8('0x15')](respondWithStatusCode(_0x3175d4,null))[_0x7be8('0x1f')](handleError(_0x3175d4,null));};exports[_0x7be8('0x12d')]=function(_0x539b12,_0x1aef9c){return db[_0x7be8('0x3d')][_0x7be8('0x9d')]({'where':{'id':_0x539b12[_0x7be8('0x5a')]['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x1aef9c,null))[_0x7be8('0x15')](function(_0x518adf){if(_0x518adf){var _0x3a0b45=_0x518adf[_0x7be8('0x2b')]({'plain':!![]});var _0x216963=_0x539b12[_0x7be8('0x46')][_0x7be8('0x68')];return _0x518adf[_0x7be8('0x12d')](_0x216963)[_0x7be8('0x15')](function(){for(var _0x51a1f7=0x0;_0x51a1f7<_0x216963['length'];_0x51a1f7++){var _0xd424b4=[];var _0x4d8b0f={};db['Team'][_0x7be8('0x9d')]({'where':{'id':_0x216963[_0x51a1f7]}})['then'](function(_0x1cd940){_0x4d8b0f=_0x1cd940[_0x7be8('0x52')];_0xd424b4[_0x7be8('0x53')](_0x1cd940[_0x7be8('0x11b')]()[_0x7be8('0x15')](function(_0x335113){for(var _0x3f8256=0x0;_0x3f8256<_0x335113['length'];_0x3f8256++){_0x335113[_0x3f8256]['setDataValue'](_0x7be8('0xb8'),'Voice');}return _0x335113;}));_0xd424b4['push'](_0x1cd940[_0x7be8('0x11e')]()[_0x7be8('0x15')](function(_0x26ffcf){for(var _0x3b12f7=0x0;_0x3b12f7<_0x26ffcf[_0x7be8('0x50')];_0x3b12f7++){_0x26ffcf[_0x3b12f7][_0x7be8('0x11c')](_0x7be8('0xb8'),_0x7be8('0x11f'));}return _0x26ffcf;}));_0xd424b4['push'](_0x1cd940[_0x7be8('0x120')]()[_0x7be8('0x15')](function(_0x2b6a4d){for(var _0x50044d=0x0;_0x50044d<_0x2b6a4d[_0x7be8('0x50')];_0x50044d++){_0x2b6a4d[_0x50044d][_0x7be8('0x11c')](_0x7be8('0xb8'),_0x7be8('0x121'));}return _0x2b6a4d;}));_0xd424b4['push'](_0x1cd940['getSmsQueues']()[_0x7be8('0x15')](function(_0x5b3f66){for(var _0x336a78=0x0;_0x336a78<_0x5b3f66[_0x7be8('0x50')];_0x336a78++){_0x5b3f66[_0x336a78][_0x7be8('0x11c')]('channel','Sms');}return _0x5b3f66;}));_0xd424b4['push'](_0x1cd940[_0x7be8('0x124')]()[_0x7be8('0x15')](function(_0x24847d){for(var _0x567a8f=0x0;_0x567a8f<_0x24847d[_0x7be8('0x50')];_0x567a8f++){_0x24847d[_0x567a8f][_0x7be8('0x11c')](_0x7be8('0xb8'),_0x7be8('0x125'));}return _0x24847d;}));_0xd424b4[_0x7be8('0x53')](_0x1cd940['getFaxQueues']()['then'](function(_0xe2652d){for(var _0x24e0ac=0x0;_0x24e0ac<_0xe2652d[_0x7be8('0x50')];_0x24e0ac++){_0xe2652d[_0x24e0ac][_0x7be8('0x11c')](_0x7be8('0xb8'),_0x7be8('0x127'));}return _0xe2652d;}));_0xd424b4[_0x7be8('0x53')](_0x1cd940[_0x7be8('0x128')]()[_0x7be8('0x15')](function(_0x9bf385){for(var _0x51b1af=0x0;_0x51b1af<_0x9bf385['length'];_0x51b1af++){_0x9bf385[_0x51b1af][_0x7be8('0x11c')](_0x7be8('0xb8'),_0x7be8('0x12e'));}return _0x9bf385;}));return BPromise[_0x7be8('0x58')](_0xd424b4);})[_0x7be8('0x15')](function(_0x7f665){var _0x3b6b92=_['flatten'](_0x7f665);_0xd424b4=[];return db['sequelize'][_0x7be8('0x129')](function(_0x455428){for(var _0x55ea01=0x0;_0x55ea01<_0x3b6b92[_0x7be8('0x50')];_0x55ea01++){_0xd424b4[_0x7be8('0x53')](_0x3b6b92[_0x55ea01][_0x7be8('0x12f')](_0x3a0b45['id']),{'transaction':_0x455428});}return BPromise[_0x7be8('0x58')](_0xd424b4)['then'](function(){if(_0x3a0b45[_0x7be8('0xa5')]){return BPromise[_0x7be8('0x8e')](_['filter'](_0x3b6b92,function(_0x3b30e4){return _0x3b30e4['getDataValue']('channel')===_0x7be8('0x11d');}),function(_0x4e0409){return db[_0x7be8('0xde')][_0x7be8('0x2a')]({'where':{'VoiceQueueId':_0x4e0409['id'],'UserId':_0x3a0b45['id']},'transaction':_0x455428});});}else{return;}})[_0x7be8('0x15')](function(){db['TeamVoicePrefix'][_0x7be8('0x9d')]({'where':{'teamId':_0x4d8b0f['id']}})[_0x7be8('0x15')](function(_0x189f2d){if(_0x189f2d){return db[_0x7be8('0x12c')]['destroy']({'where':{'UserId':_0x3a0b45['id'],'VoicePrefixId':_0x189f2d[_0x7be8('0x52')][_0x7be8('0x130')]}});}});})[_0x7be8('0x15')](function(){for(var _0x1c3851=0x0;_0x1c3851<_0x3b6b92[_0x7be8('0x50')];_0x1c3851++){var _0x55645d=_0x3b6b92[_0x1c3851][_0x7be8('0x12a')]('channel');var _0x2c3303=_0x55645d+_0x7be8('0xae');socket[_0x7be8('0xaf')](_0x7be8('0x2f')+_0x55645d+_0x7be8('0xbb'),{'UserId':_0x3a0b45['id'],['queueField']:_0x3b6b92[_0x1c3851]['id']});}});});});}});}})[_0x7be8('0x15')](respondWithStatusCode(_0x1aef9c,null))['catch'](handleError(_0x1aef9c,null));};exports[_0x7be8('0x131')]=function(_0x5a6da8,_0x51b116){var _0x5dab14={};var _0x2fb70a={};var _0x3d77ab;var _0x581452;return db[_0x7be8('0x3d')][_0x7be8('0x9d')]({'where':{'id':_0x5a6da8[_0x7be8('0x5a')]['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x51b116,null))[_0x7be8('0x15')](function(_0x2576ec){if(_0x2576ec){_0x3d77ab=_0x2576ec;_0x2fb70a['model']=_['keys'](db[_0x7be8('0xd5')][_0x7be8('0x3e')]);_0x2fb70a['query']=_[_0x7be8('0x5b')](_0x5a6da8[_0x7be8('0x46')]);_0x2fb70a['filters']=_[_0x7be8('0x5e')](_0x2fb70a[_0x7be8('0x5f')],_0x2fb70a['query']);_0x5dab14[_0x7be8('0x4c')]=_[_0x7be8('0x5e')](_0x2fb70a[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0x5a6da8[_0x7be8('0x46')][_0x7be8('0x60')]));_0x5dab14[_0x7be8('0x4c')]=_0x5dab14[_0x7be8('0x4c')][_0x7be8('0x50')]?_0x5dab14[_0x7be8('0x4c')]:_0x2fb70a['model'];_0x5dab14[_0x7be8('0xdb')]=qs[_0x7be8('0xd2')](_0x5a6da8[_0x7be8('0x46')][_0x7be8('0xd2')]);_0x5dab14['where']=qs['filters'](_[_0x7be8('0xd3')](_0x5a6da8['query'],_0x2fb70a[_0x7be8('0x5d')]));if(_0x5a6da8[_0x7be8('0x46')][_0x7be8('0x42')]){_0x5dab14['where']=_['merge'](_0x5dab14[_0x7be8('0x45')],{'$or':_[_0x7be8('0x33')](_0x5dab14[_0x7be8('0x4c')],function(_0xce79fb){var _0x2d17ab={};_0x2d17ab[_0xce79fb]={'$like':'%'+_0x5a6da8[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x2d17ab;})});}_0x5dab14=_['merge']({},_0x5dab14,_0x5a6da8['options']);return _0x3d77ab[_0x7be8('0x131')](_0x5dab14);}})[_0x7be8('0x15')](function(_0x17b6f7){if(_0x17b6f7){_0x581452=_0x17b6f7[_0x7be8('0x50')];if(!_0x5a6da8['query'][_0x7be8('0xd4')]('nolimit')){_0x5dab14[_0x7be8('0x24')]=qs['limit'](_0x5a6da8[_0x7be8('0x46')][_0x7be8('0x24')]);_0x5dab14[_0x7be8('0x26')]=qs[_0x7be8('0x26')](_0x5a6da8[_0x7be8('0x46')][_0x7be8('0x26')]);}return _0x3d77ab[_0x7be8('0x131')](_0x5dab14);}})[_0x7be8('0x15')](function(_0x15c21d){if(_0x15c21d){return _0x15c21d?{'count':_0x581452,'rows':_0x15c21d}:null;}})['then'](respondWithResult(_0x51b116,null))['catch'](handleError(_0x51b116,null));};exports[_0x7be8('0x132')]=function(_0x2318fe,_0x500980){var _0x599c88={};var _0x532427={};var _0x1fdae5;return db[_0x7be8('0x3d')]['findOne']({'where':{'id':_0x2318fe['params']['id']}})[_0x7be8('0x15')](handleEntityNotFound(_0x500980,null))[_0x7be8('0x15')](function(_0x311920){if(_0x311920){_0x1fdae5=_0x311920;_0x532427[_0x7be8('0x5f')]=_[_0x7be8('0x5b')](db[_0x7be8('0x3d')][_0x7be8('0x3e')]);_0x532427[_0x7be8('0x46')]=_[_0x7be8('0x5b')](_0x2318fe[_0x7be8('0x46')]);_0x532427[_0x7be8('0x5d')]=_[_0x7be8('0x5e')](_0x532427[_0x7be8('0x5f')],_0x532427[_0x7be8('0x46')]);_0x599c88[_0x7be8('0x4c')]=_[_0x7be8('0x5e')](_0x532427[_0x7be8('0x5f')],qs[_0x7be8('0x60')](_0x2318fe['query'][_0x7be8('0x60')]));_0x599c88[_0x7be8('0x4c')]=_0x599c88[_0x7be8('0x4c')][_0x7be8('0x50')]?_0x599c88[_0x7be8('0x4c')]:_0x532427['model'];_0x599c88[_0x7be8('0xdb')]=qs[_0x7be8('0xd2')](_0x2318fe[_0x7be8('0x46')][_0x7be8('0xd2')]);_0x599c88[_0x7be8('0x45')]=qs[_0x7be8('0x5d')](_['pick'](_0x2318fe[_0x7be8('0x46')],_0x532427[_0x7be8('0x5d')]));if(_0x2318fe[_0x7be8('0x46')][_0x7be8('0x42')]){_0x599c88['where']=_['merge'](_0x599c88[_0x7be8('0x45')],{'$or':_[_0x7be8('0x33')](_0x599c88[_0x7be8('0x4c')],function(_0x1b4a39){var _0x1b3062={};_0x1b3062[_0x1b4a39]={'$like':'%'+_0x2318fe[_0x7be8('0x46')][_0x7be8('0x42')]+'%'};return _0x1b3062;})});}_0x599c88[_0x7be8('0x5f')]=db[_0x7be8('0x3d')];_0x599c88['as']=_0x7be8('0x30');_0x599c88=_['merge']({},_0x599c88,_0x2318fe['options']);return _0x1fdae5[_0x7be8('0x11b')]({'include':[_0x599c88]});}})[_0x7be8('0x15')](function(_0x5f208a){if(_0x5f208a){var _0x1bfee7={},_0x530bed=[];for(var _0x2dd812=0x0;_0x2dd812<_0x5f208a['length'];_0x2dd812+=0x1){for(var _0x4d10b9=0x0,_0x5114c1;_0x4d10b9<_0x5f208a[_0x2dd812]['Agents'][_0x7be8('0x50')];_0x4d10b9+=0x1){_0x5114c1=_0x5f208a[_0x2dd812]['Agents'][_0x4d10b9][_0x7be8('0x2b')]({'plain':!![]});_0x1bfee7[_0x5114c1['id']]=_0x5114c1;}}_0x1bfee7=_[_0x7be8('0x133')](_0x1bfee7);for(var _0x232cd6=qs[_0x7be8('0x26')](_0x2318fe[_0x7be8('0x46')][_0x7be8('0x26')]);_0x232cd6<_0x1bfee7[_0x7be8('0x50')]&&_0x530bed[_0x7be8('0x50')]=_0x4af31c[_0xbb3e('0x4f')]){throw new Error(_0xbb3e('0x50'));}})[_0xbb3e('0xd')](function(){if(_0x1a94f3){return db['UserVoiceQueueRt'][_0xbb3e('0x47')]({'where':{'membername':_0x1a94f3[_0xbb3e('0x2a')]},'individualHooks':!![]});}})[_0xbb3e('0xd')](function(){if(_0x1a94f3){return _0x1a94f3[_0xbb3e('0x51')]({'raw':!![]});}})[_0xbb3e('0xd')](function(_0x54dd02){if(_0x1a94f3){if(_0x54dd02){var _0x203a5e=[];_0x2dedc8=_0x54dd02;if(_0x2dedc8[_0xbb3e('0x2e')]){for(var _0x28d71f=0x0;_0x28d71f<_0x2dedc8[_0xbb3e('0x2e')];_0x28d71f++){_0x203a5e[_0xbb3e('0x32')](db[_0xbb3e('0x27')][_0xbb3e('0x52')]({'membername':_0x1a94f3['name'],'UserId':_0x1a94f3['id'],'queue_name':_0x2dedc8[_0x28d71f][_0xbb3e('0x2a')],'VoiceQueueId':_0x2dedc8[_0x28d71f]['id'],'interface':_0x47621a,'paused':_0x1a94f3[_0xbb3e('0x53')]||![],'penalty':_0x2dedc8[_0x28d71f][_0xbb3e('0x54')]||0x0}));}return BPromise['all'](_0x203a5e);}}}})[_0xbb3e('0xd')](function(){if(_0x1a94f3){return db[_0xbb3e('0x29')][_0xbb3e('0x18')]({'where':{'membername':_0x1a94f3[_0xbb3e('0x2a')],'exitAt':null}});}})[_0xbb3e('0xd')](function(_0x4c9aa2){if(_0x1a94f3){if(_0x4c9aa2&&_0x4c9aa2[_0xbb3e('0x2e')]){var _0xf56f74=[];_0x4c9aa2[_0xbb3e('0x31')](function(_0x1cd832){_0xf56f74['push'](_0x1cd832['update']({'exitAt':moment()[_0xbb3e('0x2c')](_0xbb3e('0x2d'))}));});return BPromise[_0xbb3e('0x46')](_0xf56f74);}}})[_0xbb3e('0xd')](function(_0x1813ca){if(_0x1a94f3){var _0x176145=[];var _0x3b46e5=[];var _0x3ff0af=utils['getChannels']();var _0x435f16={'membername':_0x1a94f3[_0xbb3e('0x2a')],'interface':_0x47621a,'enterAt':moment()[_0xbb3e('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1a94f3[_0xbb3e('0x24')],'internal':_0x1a94f3[_0xbb3e('0x25')]};_0x3ff0af[_0xbb3e('0x31')](function(_0x5ab3e3){_0x176145[_0xbb3e('0x32')](_[_0xbb3e('0x55')]({'channel':_0x5ab3e3,'type':_0xbb3e('0x56'),'data1':_0xbb3e('0x57'),'data2':_0x47621a},_0x435f16));if(_0x1a94f3[_0xbb3e('0x53')]){_0x3b46e5['push'](_[_0xbb3e('0x55')]({'channel':_0x5ab3e3,'type':_0xbb3e('0x2b'),'data1':_0xbb3e('0x58')},_0x435f16));}});return db[_0xbb3e('0x29')][_0xbb3e('0x59')](_0x176145[_0xbb3e('0x5a')](_0x3b46e5),{'individualHooks':!![]});}})[_0xbb3e('0xd')](function(){if(_0x1a94f3){return _0x1a94f3[_0xbb3e('0x28')]({'online':!![],'lastLoginAt':moment()['format'](_0xbb3e('0x2d')),'voicePause':_0x1a94f3[_0xbb3e('0x53')]||![],'mailPause':_0x1a94f3[_0xbb3e('0x53')]||![],'chatPause':_0x1a94f3[_0xbb3e('0x53')]||![],'faxPause':_0x1a94f3[_0xbb3e('0x53')]||![],'smsPause':_0x1a94f3[_0xbb3e('0x53')]||![],'openchannelPause':_0x1a94f3[_0xbb3e('0x53')]||![],'pauseType':_0x1a94f3[_0xbb3e('0x53')]?_0xbb3e('0x58'):null,'lastPauseAt':moment()['format'](_0xbb3e('0x2d')),'interface':_0x47621a});}})[_0xbb3e('0xd')](function(_0x1b2622){_0x3a5b56(_0x1b2622);})[_0xbb3e('0x15')](function(_0x1b1feb){_0x421d43(_0x4f2271[_0xbb3e('0x12')](0x1f4,_0x1b1feb[_0xbb3e('0x13')]));});});}; \ No newline at end of file +var _0xc3c3=['agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','UserVoiceQueue.penalty','loginInPause','LOGININPAUSE','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetUser','options','raw','where','attributes','limit','include','map','model','ShowUser','User','find','stringify','role','internal','interface','UserVoiceQueueRt','update','MemberReport','name','PAUSE','length','updateAttributes','getChannels','push','isNil','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','UnpauseUser','channel','Unknown\x20channel','voice','system','mail','sms','%s%s','findAll','all','LogoutUser','findOne','forEach','phone','agent','../../config/license/util','getLicense'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0xc3c3,0x100));var _0x3c3c=function(_0x4e43fd,_0x39ffc5){_0x4e43fd=_0x4e43fd-0x0;var _0x33754f=_0xc3c3[_0x4e43fd];return _0x33754f;};'use strict';var _=require(_0x3c3c('0x0'));var util=require(_0x3c3c('0x1'));var moment=require(_0x3c3c('0x2'));var BPromise=require(_0x3c3c('0x3'));var rs=require(_0x3c3c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c3c('0x5'))['db'];var utils=require(_0x3c3c('0x6'));var logger=require(_0x3c3c('0x7'))('rpc');var config=require(_0x3c3c('0x8'));var jayson=require(_0x3c3c('0x9'));var client=jayson[_0x3c3c('0xa')]['http']({'port':0x232a});config[_0x3c3c('0xb')]=_[_0x3c3c('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3c3c('0xd'))(new Redis(config[_0x3c3c('0xb')]));require(_0x3c3c('0xe'))[_0x3c3c('0xf')](socket);function respondWithRpcPromise(_0x1dbcee,_0x3e1ccd,_0x77b612){return new BPromise(function(_0x46f466,_0x4d0100){return client[_0x3c3c('0x10')](_0x1dbcee,_0x77b612)[_0x3c3c('0x11')](function(_0x267027){logger[_0x3c3c('0x12')](_0x3c3c('0x13'),_0x3e1ccd,_0x3c3c('0x14'));logger[_0x3c3c('0x15')](_0x3c3c('0x16'),_0x3e1ccd,_0x3c3c('0x14'),JSON['stringify'](_0x267027));if(_0x267027[_0x3c3c('0x17')]){if(_0x267027[_0x3c3c('0x17')]['code']===0x1f4){logger[_0x3c3c('0x17')](_0x3c3c('0x13'),_0x3e1ccd,_0x267027[_0x3c3c('0x17')]['message']);return _0x4d0100(_0x267027['error'][_0x3c3c('0x18')]);}logger[_0x3c3c('0x17')](_0x3c3c('0x13'),_0x3e1ccd,_0x267027[_0x3c3c('0x17')][_0x3c3c('0x18')]);return _0x46f466(_0x267027['error'][_0x3c3c('0x18')]);}else{logger[_0x3c3c('0x12')](_0x3c3c('0x13'),_0x3e1ccd,'request\x20sent');_0x46f466(_0x267027[_0x3c3c('0x19')][_0x3c3c('0x18')]);}})[_0x3c3c('0x1a')](function(_0x1d94b8){logger[_0x3c3c('0x17')](_0x3c3c('0x13'),_0x3e1ccd,_0x1d94b8);_0x4d0100(_0x1d94b8);});});}exports[_0x3c3c('0x1b')]=function(_0x314c10){var _0x3575c5=this;return new Promise(function(_0x50fe2b,_0x294f0c){return db['User']['findAll']({'raw':_0x314c10[_0x3c3c('0x1c')]?_0x314c10[_0x3c3c('0x1c')][_0x3c3c('0x1d')]===undefined?!![]:![]:!![],'where':_0x314c10[_0x3c3c('0x1c')]?_0x314c10[_0x3c3c('0x1c')][_0x3c3c('0x1e')]||null:null,'attributes':_0x314c10['options']?_0x314c10[_0x3c3c('0x1c')][_0x3c3c('0x1f')]||null:null,'limit':_0x314c10[_0x3c3c('0x1c')]?_0x314c10[_0x3c3c('0x1c')][_0x3c3c('0x20')]||null:null,'include':_0x314c10['options']?_0x314c10['options'][_0x3c3c('0x21')]?_[_0x3c3c('0x22')](_0x314c10[_0x3c3c('0x1c')][_0x3c3c('0x21')],function(_0x58907d){return{'model':db[_0x58907d['model']],'as':_0x58907d['as'],'attributes':_0x58907d['attributes'],'include':_0x58907d[_0x3c3c('0x21')]?_[_0x3c3c('0x22')](_0x58907d[_0x3c3c('0x21')],function(_0x5488fa){return{'model':db[_0x5488fa[_0x3c3c('0x23')]],'as':_0x5488fa['as'],'attributes':_0x5488fa[_0x3c3c('0x1f')],'include':_0x5488fa['include']?_[_0x3c3c('0x22')](_0x5488fa[_0x3c3c('0x21')],function(_0x474d9b){return{'model':db[_0x474d9b[_0x3c3c('0x23')]],'as':_0x474d9b['as'],'attributes':_0x474d9b['attributes']};}):[]};}):[]};}):[]:[]})[_0x3c3c('0x11')](function(_0x100e98){logger['info']('GetUser',_0x314c10);logger[_0x3c3c('0x15')](_0x3c3c('0x1b'),_0x314c10,JSON['stringify'](_0x100e98));_0x50fe2b(_0x100e98);})[_0x3c3c('0x1a')](function(_0x4d32b8){logger[_0x3c3c('0x17')]('GetUser',_0x4d32b8[_0x3c3c('0x18')],_0x314c10);_0x294f0c(_0x3575c5['error'](0x1f4,_0x4d32b8[_0x3c3c('0x18')]));});});};exports[_0x3c3c('0x24')]=function(_0x5c0d60){var _0x4342b3=this;return new Promise(function(_0x16d7a7,_0x5ea704){return db[_0x3c3c('0x25')][_0x3c3c('0x26')]({'raw':_0x5c0d60[_0x3c3c('0x1c')]?_0x5c0d60[_0x3c3c('0x1c')][_0x3c3c('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c0d60[_0x3c3c('0x1c')]?_0x5c0d60[_0x3c3c('0x1c')][_0x3c3c('0x1e')]||null:null,'attributes':_0x5c0d60['options']?_0x5c0d60['options']['attributes']||null:null,'include':_0x5c0d60[_0x3c3c('0x1c')]?_0x5c0d60['options']['include']?_[_0x3c3c('0x22')](_0x5c0d60[_0x3c3c('0x1c')]['include'],function(_0x54274b){return{'model':db[_0x54274b[_0x3c3c('0x23')]],'as':_0x54274b['as'],'attributes':_0x54274b[_0x3c3c('0x1f')],'include':_0x54274b['include']?_[_0x3c3c('0x22')](_0x54274b[_0x3c3c('0x21')],function(_0x3f5094){return{'model':db[_0x3f5094[_0x3c3c('0x23')]],'as':_0x3f5094['as'],'attributes':_0x3f5094[_0x3c3c('0x1f')],'include':_0x3f5094[_0x3c3c('0x21')]?_[_0x3c3c('0x22')](_0x3f5094[_0x3c3c('0x21')],function(_0x531f14){return{'model':db[_0x531f14['model']],'as':_0x531f14['as'],'attributes':_0x531f14[_0x3c3c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3c3c('0x11')](function(_0xf6c918){logger[_0x3c3c('0x12')]('ShowUser',_0x5c0d60);logger[_0x3c3c('0x15')]('ShowUser',_0x5c0d60,JSON[_0x3c3c('0x27')](_0xf6c918));_0x16d7a7(_0xf6c918);})[_0x3c3c('0x1a')](function(_0x3a7684){logger[_0x3c3c('0x17')](_0x3c3c('0x24'),_0x3a7684[_0x3c3c('0x18')],_0x5c0d60);_0x5ea704(_0x4342b3[_0x3c3c('0x17')](0x1f4,_0x3a7684['message']));});});};exports['PauseUser']=function(_0x3b84e7){var _0x17239a=this;return new Promise(function(_0x25b53c,_0x155e3c){var _0xde025b;return db[_0x3c3c('0x25')][_0x3c3c('0x26')]({'where':_0x3b84e7['options'][_0x3c3c('0x1e')]||{},'attributes':['id','name',_0x3c3c('0x28'),_0x3c3c('0x29'),_0x3c3c('0x2a')]})['then'](function(_0x390af7){if(_0x390af7){_0xde025b=_0x390af7;return db[_0x3c3c('0x2b')][_0x3c3c('0x2c')]({'paused':0x1},{'where':{'UserId':_0xde025b['id']},'individualHooks':!![]});}})['then'](function(){if(_0xde025b){return db[_0x3c3c('0x2d')]['findAll']({'where':{'membername':_0xde025b[_0x3c3c('0x2e')],'type':_0x3c3c('0x2f'),'exitAt':null}});}})['then'](function(_0x5db884){if(_0xde025b){if(_0x5db884&&_0x5db884[_0x3c3c('0x30')]){var _0xb5d5c1=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x266157=0x0,_0x290c32=_0x5db884[_0x3c3c('0x30')];_0x266157<_0x290c32;_0x266157++){_0x5db884[_0x266157][_0x3c3c('0x31')]({'exitAt':_0xb5d5c1});}}}})[_0x3c3c('0x11')](function(){if(_0xde025b){var _0x2206da=[];var _0x5ba624=utils[_0x3c3c('0x32')]();_0x5ba624['forEach'](function(_0x106110){_0x2206da[_0x3c3c('0x33')]({'channel':_0x106110,'membername':_0xde025b['name'],'interface':_[_0x3c3c('0x34')](_0xde025b[_0x3c3c('0x2a')])?util['format'](_0x3c3c('0x35'),_0xde025b[_0x3c3c('0x2e')]):_0xde025b[_0x3c3c('0x2a')],'type':_0x3c3c('0x2f'),'enterAt':moment()[_0x3c3c('0x36')](_0x3c3c('0x37')),'data1':_0x3b84e7[_0x3c3c('0x38')][_0x3c3c('0x39')]||_0x3c3c('0x3a'),'role':_0xde025b[_0x3c3c('0x28')],'internal':_0xde025b[_0x3c3c('0x29')],'uniqueid':_0x3b84e7[_0x3c3c('0x38')]['uniqueid']||null});});return db['MemberReport']['bulkCreate'](_0x2206da,{'individualHooks':!![]});}})[_0x3c3c('0x11')](function(){if(_0xde025b){return _0xde025b[_0x3c3c('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3b84e7[_0x3c3c('0x38')][_0x3c3c('0x39')]||_0x3c3c('0x3a'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x3c3c('0x11')](function(_0x458354){_0x25b53c(_0x458354);})[_0x3c3c('0x1a')](function(_0x366238){_0x155e3c(_0x17239a[_0x3c3c('0x17')](0x1f4,_0x366238[_0x3c3c('0x18')]));});});};exports[_0x3c3c('0x3b')]=function(_0x5c4052){var _0x29fd83=this;return new Promise(function(_0x2ce645,_0x4b70b3){var _0x354465;return db[_0x3c3c('0x25')]['findOne']({'where':_0x5c4052[_0x3c3c('0x1c')][_0x3c3c('0x1e')]||{},'attributes':['id',_0x3c3c('0x2e')]})[_0x3c3c('0x11')](function(_0x48b2cd){if(_0x48b2cd){_0x354465=_0x48b2cd;if(_0x5c4052[_0x3c3c('0x38')][_0x3c3c('0x3c')]&&!utils['isValidChannel'](_0x5c4052['body']['channel'])){throw new Error(_0x3c3c('0x3d'));}switch(_0x5c4052[_0x3c3c('0x38')][_0x3c3c('0x3c')]){case _0x3c3c('0x3e'):return db[_0x3c3c('0x2b')][_0x3c3c('0x2c')]({'paused':0x0},{'where':{'UserId':_0x354465['id']}})[_0x3c3c('0x11')](function(){return db[_0x3c3c('0x2d')][_0x3c3c('0x26')]({'where':{'channel':_0x5c4052['body']['channel'],'membername':_0x354465[_0x3c3c('0x2e')],'type':_0x3c3c('0x2f'),'exitAt':null}});})[_0x3c3c('0x11')](function(_0x4bbf86){if(_0x4bbf86){return _0x4bbf86[_0x3c3c('0x2c')]({'exitAt':moment()[_0x3c3c('0x36')](_0x3c3c('0x37')),'data2':_0x3c3c('0x3f')},{'individualHooks':!![]});}return null;})[_0x3c3c('0x11')](function(){return _0x354465['update']({'voicePause':![]});});case _0x3c3c('0x40'):case'chat':case'fax':case _0x3c3c('0x41'):case'openchannel':case'whatsapp':return db[_0x3c3c('0x2d')]['find']({'where':{'channel':_0x5c4052['body'][_0x3c3c('0x3c')],'membername':_0x354465[_0x3c3c('0x2e')],'type':'PAUSE','exitAt':null}})[_0x3c3c('0x11')](function(_0x98b2f9){return _0x98b2f9[_0x3c3c('0x2c')]({'exitAt':moment()[_0x3c3c('0x36')](_0x3c3c('0x37')),'data2':'system'},{'individualHooks':!![]});})[_0x3c3c('0x11')](function(){var _0x5a4d66={};_['set'](_0x5a4d66,util[_0x3c3c('0x36')](_0x3c3c('0x42'),_0x5c4052['body'][_0x3c3c('0x3c')],'Pause'),![]);return _0x354465[_0x3c3c('0x2c')](_0x5a4d66);});default:return db[_0x3c3c('0x2b')][_0x3c3c('0x2c')]({'paused':0x0},{'where':{'UserId':_0x354465['id']}})[_0x3c3c('0x11')](function(){return db['MemberReport'][_0x3c3c('0x43')]({'where':{'membername':_0x354465[_0x3c3c('0x2e')],'type':_0x3c3c('0x2f'),'exitAt':null}});})[_0x3c3c('0x11')](function(_0x21f813){var _0x473195=[];_0x21f813['forEach'](function(_0x2fb279){_0x473195['push'](_0x2fb279[_0x3c3c('0x2c')]({'exitAt':moment()['format'](_0x3c3c('0x37')),'data2':_0x3c3c('0x3f')}));});return BPromise[_0x3c3c('0x44')](_0x473195);})[_0x3c3c('0x11')](function(){return _0x354465[_0x3c3c('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x3c3c('0x11')](function(_0x10716b){_0x2ce645(_0x10716b);})[_0x3c3c('0x1a')](function(_0x43472c){_0x4b70b3(_0x29fd83[_0x3c3c('0x17')](0x1f4,_0x43472c['message']));});});};exports[_0x3c3c('0x45')]=function(_0x4380ff){var _0x8b4cd1=this;return new Promise(function(_0x80e527,_0xd5ea72){var _0x3bae61;return db[_0x3c3c('0x25')][_0x3c3c('0x46')]({'where':_0x4380ff[_0x3c3c('0x1c')][_0x3c3c('0x1e')]||{},'attributes':['id',_0x3c3c('0x2e')]})[_0x3c3c('0x11')](function(_0x56bb3a){if(_0x56bb3a){_0x3bae61=_0x56bb3a;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x3bae61[_0x3c3c('0x2e')]},'individualHooks':!![]});}})['then'](function(){if(_0x3bae61){return db[_0x3c3c('0x2d')][_0x3c3c('0x43')]({'where':{'membername':_0x3bae61[_0x3c3c('0x2e')],'exitAt':null}});}})['then'](function(_0x2b1993){if(_0x3bae61){if(_0x2b1993&&_0x2b1993[_0x3c3c('0x30')]){var _0x3e0b3f=[];_0x2b1993[_0x3c3c('0x47')](function(_0x43ec57){_0x3e0b3f[_0x3c3c('0x33')](_0x43ec57['update']({'exitAt':moment()[_0x3c3c('0x36')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x3e0b3f);}}})[_0x3c3c('0x11')](function(){if(_0x3bae61){return _0x3bae61[_0x3c3c('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x3c3c('0x11')](function(_0x37c4c5){_0x80e527(_0x37c4c5);})[_0x3c3c('0x1a')](function(_0x3aeccf){_0xd5ea72(_0x8b4cd1[_0x3c3c('0x17')](0x1f4,_0x3aeccf[_0x3c3c('0x18')]));});});};exports['LoginUser']=function(_0x3f8866){var _0x35e125=this;return new Promise(function(_0x5394c9,_0x61a76c){var _0x329fdf;var _0x2535c4;var _0x3459f7;var _0x251ed1;return db[_0x3c3c('0x25')]['findOne']({'where':_0x3f8866[_0x3c3c('0x1c')][_0x3c3c('0x1e')]||{},'attributes':['id',_0x3c3c('0x2e'),_0x3c3c('0x28'),'mobile',_0x3c3c('0x48'),_0x3c3c('0x29'),'loginInPause','interface']})[_0x3c3c('0x11')](function(_0x54f747){if(_0x54f747){_0x329fdf=_0x54f747;_0x251ed1=_0x3f8866[_0x3c3c('0x38')][_0x3c3c('0x2a')]?_0x3f8866['body'][_0x3c3c('0x2a')]:util['format']('SIP/%s',_0x329fdf['name']);return db['User']['count']({'where':{'role':_0x3c3c('0x49'),'online':!![],'id':{'$ne':_0x329fdf['id']}}});}})[_0x3c3c('0x11')](function(_0x55e5ea){if(_0x55e5ea){_0x3459f7=_0x55e5ea;return require(_0x3c3c('0x4a'))[_0x3c3c('0x4b')]();}})[_0x3c3c('0x11')](function(_0x141c32){if(_0x141c32&&_0x141c32[_0x3c3c('0x4c')]&&_0x3459f7>=_0x141c32['agents']){throw new Error(_0x3c3c('0x4d'));}})['then'](function(){if(_0x329fdf){return db['UserVoiceQueueRt'][_0x3c3c('0x4e')]({'where':{'membername':_0x329fdf['name']},'individualHooks':!![]});}})[_0x3c3c('0x11')](function(){if(_0x329fdf){return _0x329fdf[_0x3c3c('0x4f')]({'raw':!![]});}})[_0x3c3c('0x11')](function(_0x25e42c){if(_0x329fdf){if(_0x25e42c){var _0x353541=[];_0x2535c4=_0x25e42c;if(_0x2535c4[_0x3c3c('0x30')]){for(var _0x47f5da=0x0;_0x47f5da<_0x2535c4[_0x3c3c('0x30')];_0x47f5da++){_0x353541[_0x3c3c('0x33')](db['UserVoiceQueueRt']['upsert']({'membername':_0x329fdf[_0x3c3c('0x2e')],'UserId':_0x329fdf['id'],'queue_name':_0x2535c4[_0x47f5da]['name'],'VoiceQueueId':_0x2535c4[_0x47f5da]['id'],'interface':_0x251ed1,'paused':_0x329fdf['loginInPause']||![],'penalty':_0x2535c4[_0x47f5da][_0x3c3c('0x50')]||0x0}));}return BPromise[_0x3c3c('0x44')](_0x353541);}}}})[_0x3c3c('0x11')](function(){if(_0x329fdf){return db['MemberReport'][_0x3c3c('0x43')]({'where':{'membername':_0x329fdf[_0x3c3c('0x2e')],'exitAt':null}});}})[_0x3c3c('0x11')](function(_0x172c89){if(_0x329fdf){if(_0x172c89&&_0x172c89[_0x3c3c('0x30')]){var _0x3cab8d=[];_0x172c89['forEach'](function(_0x3fdc97){_0x3cab8d[_0x3c3c('0x33')](_0x3fdc97[_0x3c3c('0x2c')]({'exitAt':moment()[_0x3c3c('0x36')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x3c3c('0x44')](_0x3cab8d);}}})[_0x3c3c('0x11')](function(_0xbc8cbc){if(_0x329fdf){var _0x407e57=[];var _0x2be706=[];var _0x20d10f=utils[_0x3c3c('0x32')]();var _0x4bb907={'membername':_0x329fdf[_0x3c3c('0x2e')],'interface':_0x251ed1,'enterAt':moment()['format'](_0x3c3c('0x37')),'role':_0x329fdf[_0x3c3c('0x28')],'internal':_0x329fdf['internal']};_0x20d10f['forEach'](function(_0x309a82){_0x407e57[_0x3c3c('0x33')](_['merge']({'channel':_0x309a82,'type':'LOGIN','data1':'callysquare','data2':_0x251ed1},_0x4bb907));if(_0x329fdf[_0x3c3c('0x51')]){_0x2be706[_0x3c3c('0x33')](_['merge']({'channel':_0x309a82,'type':_0x3c3c('0x2f'),'data1':_0x3c3c('0x52')},_0x4bb907));}});return db[_0x3c3c('0x2d')]['bulkCreate'](_0x407e57['concat'](_0x2be706),{'individualHooks':!![]});}})[_0x3c3c('0x11')](function(){if(_0x329fdf){return _0x329fdf[_0x3c3c('0x2c')]({'online':!![],'lastLoginAt':moment()['format'](_0x3c3c('0x37')),'voicePause':_0x329fdf['loginInPause']||![],'mailPause':_0x329fdf[_0x3c3c('0x51')]||![],'chatPause':_0x329fdf[_0x3c3c('0x51')]||![],'faxPause':_0x329fdf[_0x3c3c('0x51')]||![],'smsPause':_0x329fdf['loginInPause']||![],'openchannelPause':_0x329fdf['loginInPause']||![],'pauseType':_0x329fdf[_0x3c3c('0x51')]?_0x3c3c('0x52'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x251ed1});}})['then'](function(_0xa817d5){_0x5394c9(_0xa817d5);})[_0x3c3c('0x1a')](function(_0x3c1c5b){_0x61a76c(_0x35e125[_0x3c3c('0x17')](0x1f4,_0x3c1c5b[_0x3c3c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 38e1060..8b913b6 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 _0x2e3d=['removeListener','register','length','./user.events','save','remove','emit'];(function(_0x71727c,_0x1f189d){var _0x4ebfe3=function(_0x5d1fd1){while(--_0x5d1fd1){_0x71727c['push'](_0x71727c['shift']());}};_0x4ebfe3(++_0x1f189d);}(_0x2e3d,0x184));var _0xd2e3=function(_0x4d8a1d,_0x5b21d6){_0x4d8a1d=_0x4d8a1d-0x0;var _0x5b9b01=_0x2e3d[_0x4d8a1d];return _0x5b9b01;};'use strict';var UserEvents=require(_0xd2e3('0x0'));var events=[_0xd2e3('0x1'),_0xd2e3('0x2'),'update'];function createListener(_0x268204,_0x57a38d){return function(_0x1c8d59){_0x57a38d[_0xd2e3('0x3')](_0x268204,_0x1c8d59);};}function removeListener(_0x165fc2,_0x9fc588){return function(){UserEvents[_0xd2e3('0x4')](_0x165fc2,_0x9fc588);};}exports[_0xd2e3('0x5')]=function(_0x4afff0){for(var _0x5732e3=0x0,_0x48d5d0=events[_0xd2e3('0x6')];_0x5732e3<_0x48d5d0;_0x5732e3++){var _0x2e4361=events[_0x5732e3];var _0x1f26f5=createListener('user:'+_0x2e4361,_0x4afff0);UserEvents['on'](_0x2e4361,_0x1f26f5);}}; \ No newline at end of file +var _0xfae5=['removeListener','register','length','user:','update','emit'];(function(_0x4cb83e,_0x231fc){var _0x470243=function(_0x5ae373){while(--_0x5ae373){_0x4cb83e['push'](_0x4cb83e['shift']());}};_0x470243(++_0x231fc);}(_0xfae5,0xdc));var _0x5fae=function(_0x35012a,_0x52522c){_0x35012a=_0x35012a-0x0;var _0x141bdb=_0xfae5[_0x35012a];return _0x141bdb;};'use strict';var UserEvents=require('./user.events');var events=['save','remove',_0x5fae('0x0')];function createListener(_0x3eae5b,_0x53f358){return function(_0x18d5c8){_0x53f358[_0x5fae('0x1')](_0x3eae5b,_0x18d5c8);};}function removeListener(_0x259075,_0x4035ef){return function(){UserEvents[_0x5fae('0x2')](_0x259075,_0x4035ef);};}exports[_0x5fae('0x3')]=function(_0x50c522){for(var _0x355e53=0x0,_0x16014f=events[_0x5fae('0x4')];_0x355e53<_0x16014f;_0x355e53++){var _0x55e275=events[_0x355e53];var _0xfeb123=createListener(_0x5fae('0x5')+_0x55e275,_0x50c522);UserEvents['on'](_0x55e275,_0xfeb123);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 716b8f2..5a90b65 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x51735e,_0x4bc761){var _0x6e85d5=function(_0x3d6467){while(--_0x3d6467){_0x51735e['push'](_0x51735e['shift']());}};_0x6e85d5(++_0x4bc761);}(_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(_0xc0f1e9,_0x1f2672){var _0x2d202f=function(_0x211775){while(--_0x211775){_0xc0f1e9['push'](_0xc0f1e9['shift']());}};_0x2d202f(++_0x1f2672);}(_0x70e0,0x17b));var _0x070e=function(_0x1116ef,_0x954fad){_0x1116ef=_0x1116ef-0x0;var _0x35c45d=_0x70e0[_0x1116ef];return _0x35c45d;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index a8e3faf..eeae1df 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 _0xae24=['sequelize','INTEGER'];(function(_0x876ecf,_0x2be287){var _0x2e2e54=function(_0x58bd98){while(--_0x58bd98){_0x876ecf['push'](_0x876ecf['shift']());}};_0x2e2e54(++_0x2be287);}(_0xae24,0x182));var _0x4ae2=function(_0x45d6bb,_0x449ba3){_0x45d6bb=_0x45d6bb-0x0;var _0x2f4427=_0xae24[_0x45d6bb];return _0x2f4427;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4ae2('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xff47=['sequelize','exports'];(function(_0x5bcc1c,_0x55e799){var _0x1848b8=function(_0x1dd17e){while(--_0x1dd17e){_0x5bcc1c['push'](_0x5bcc1c['shift']());}};_0x1848b8(++_0x55e799);}(_0xff47,0x1f4));var _0x7ff4=function(_0x970068,_0x3e4142){_0x970068=_0x970068-0x0;var _0x51063d=_0xff47[_0x970068];return _0x51063d;};'use strict';var Sequelize=require(_0x7ff4('0x0'));module[_0x7ff4('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 6da9ca7..46f5410 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 _0xe28e=['bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x5cd2b7,_0x2f5c78){var _0x4056da=function(_0x49b5bc){while(--_0x49b5bc){_0x5cd2b7['push'](_0x5cd2b7['shift']());}};_0x4056da(++_0x2f5c78);}(_0xe28e,0x97));var _0xee28=function(_0x1147f8,_0x38eb0e){_0x1147f8=_0x1147f8-0x0;var _0x230592=_0xe28e[_0x1147f8];return _0x230592;};'use strict';var _=require(_0xee28('0x0'));var util=require(_0xee28('0x1'));var logger=require(_0xee28('0x2'))(_0xee28('0x3'));var moment=require(_0xee28('0x4'));var BPromise=require(_0xee28('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee28('0x6'));var rimraf=require(_0xee28('0x7'));var config=require(_0xee28('0x8'));var attributes=require(_0xee28('0x9'));module['exports']=function(_0xc800ae,_0x4e66e0){return _0xc800ae[_0xee28('0xa')](_0xee28('0xb'),attributes,{'tableName':_0xee28('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc417=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x2c5e35,_0x537c16){var _0x25eab6=function(_0x2da276){while(--_0x2da276){_0x2c5e35['push'](_0x2c5e35['shift']());}};_0x25eab6(++_0x537c16);}(_0xc417,0x1d9));var _0x7c41=function(_0x5c173a,_0x3317e7){_0x5c173a=_0x5c173a-0x0;var _0x22505c=_0xc417[_0x5c173a];return _0x22505c;};'use strict';var _=require('lodash');var util=require(_0x7c41('0x0'));var logger=require('../../config/logger')(_0x7c41('0x1'));var moment=require(_0x7c41('0x2'));var BPromise=require(_0x7c41('0x3'));var rp=require(_0x7c41('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c41('0x5'));var config=require(_0x7c41('0x6'));var attributes=require(_0x7c41('0x7'));module[_0x7c41('0x8')]=function(_0x182e4c,_0x552f0f){return _0x182e4c[_0x7c41('0x9')](_0x7c41('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 42af7c3..166a8a2 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 _0x7feb=['client','http','request','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','rpc','jayson/promise'];(function(_0x3f715e,_0x3847af){var _0xbca52c=function(_0x328a4e){while(--_0x328a4e){_0x3f715e['push'](_0x3f715e['shift']());}};_0xbca52c(++_0x3847af);}(_0x7feb,0xa1));var _0xb7fe=function(_0x3d7200,_0x5e41b3){_0x3d7200=_0x3d7200-0x0;var _0x21eacf=_0x7feb[_0x3d7200];return _0x21eacf;};'use strict';var _=require(_0xb7fe('0x0'));var util=require(_0xb7fe('0x1'));var moment=require(_0xb7fe('0x2'));var BPromise=require(_0xb7fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7fe('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb7fe('0x5'));var config=require('../../config/environment');var jayson=require(_0xb7fe('0x6'));var client=jayson[_0xb7fe('0x7')][_0xb7fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x318494,_0x2a18f1,_0x267202){return new BPromise(function(_0x26e4b9,_0x1d3d62){return client[_0xb7fe('0x9')](_0x318494,_0x267202)['then'](function(_0xb93df9){logger[_0xb7fe('0xa')](_0xb7fe('0xb'),_0x2a18f1,'request\x20sent');logger[_0xb7fe('0xc')](_0xb7fe('0xd'),_0x2a18f1,_0xb7fe('0xe'),JSON[_0xb7fe('0xf')](_0xb93df9));if(_0xb93df9[_0xb7fe('0x10')]){if(_0xb93df9[_0xb7fe('0x10')][_0xb7fe('0x11')]===0x1f4){logger[_0xb7fe('0x10')](_0xb7fe('0xb'),_0x2a18f1,_0xb93df9[_0xb7fe('0x10')][_0xb7fe('0x12')]);return _0x1d3d62(_0xb93df9[_0xb7fe('0x10')][_0xb7fe('0x12')]);}logger[_0xb7fe('0x10')](_0xb7fe('0xb'),_0x2a18f1,_0xb93df9[_0xb7fe('0x10')][_0xb7fe('0x12')]);return _0x26e4b9(_0xb93df9['error'][_0xb7fe('0x12')]);}else{logger[_0xb7fe('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x2a18f1,'request\x20sent');_0x26e4b9(_0xb93df9[_0xb7fe('0x13')][_0xb7fe('0x12')]);}})[_0xb7fe('0x14')](function(_0xad3b17){logger[_0xb7fe('0x10')](_0xb7fe('0xb'),_0x2a18f1,_0xad3b17);_0x1d3d62(_0xad3b17);});});} \ No newline at end of file +var _0x20ee=['then','info','UserChatQueue,\x20%s,\x20%s','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','../../mysqldb','../../config/logger','jayson/promise','client','http','request'];(function(_0x1946bd,_0x4a8202){var _0xf46377=function(_0x593d69){while(--_0x593d69){_0x1946bd['push'](_0x1946bd['shift']());}};_0xf46377(++_0x4a8202);}(_0x20ee,0x1b9));var _0xe20e=function(_0x45a486,_0x2affdc){_0x45a486=_0x45a486-0x0;var _0x58b5aa=_0x20ee[_0x45a486];return _0x58b5aa;};'use strict';var _=require(_0xe20e('0x0'));var util=require(_0xe20e('0x1'));var moment=require(_0xe20e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe20e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe20e('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe20e('0x5'));var client=jayson[_0xe20e('0x6')][_0xe20e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x215a8,_0x3ea383,_0x38bef8){return new BPromise(function(_0x903523,_0x2bf1f0){return client[_0xe20e('0x8')](_0x215a8,_0x38bef8)[_0xe20e('0x9')](function(_0xc8fa9d){logger[_0xe20e('0xa')](_0xe20e('0xb'),_0x3ea383,'request\x20sent');logger['debug'](_0xe20e('0xc'),_0x3ea383,'request\x20sent',JSON[_0xe20e('0xd')](_0xc8fa9d));if(_0xc8fa9d[_0xe20e('0xe')]){if(_0xc8fa9d[_0xe20e('0xe')][_0xe20e('0xf')]===0x1f4){logger['error'](_0xe20e('0xb'),_0x3ea383,_0xc8fa9d['error'][_0xe20e('0x10')]);return _0x2bf1f0(_0xc8fa9d[_0xe20e('0xe')][_0xe20e('0x10')]);}logger[_0xe20e('0xe')](_0xe20e('0xb'),_0x3ea383,_0xc8fa9d[_0xe20e('0xe')]['message']);return _0x903523(_0xc8fa9d['error']['message']);}else{logger[_0xe20e('0xa')](_0xe20e('0xb'),_0x3ea383,'request\x20sent');_0x903523(_0xc8fa9d['result'][_0xe20e('0x10')]);}})[_0xe20e('0x11')](function(_0x20289e){logger[_0xe20e('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x3ea383,_0x20289e);_0x2bf1f0(_0x20289e);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index bb76f19..1f538e2 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x15ac3f,_0x38b2a9){var _0x1f549a=function(_0x11aaa5){while(--_0x11aaa5){_0x15ac3f['push'](_0x15ac3f['shift']());}};_0x1f549a(++_0x38b2a9);}(_0xe706,0xa3));var _0x6e70=function(_0x209581,_0x11f596){_0x209581=_0x209581-0x0;var _0x2fed45=_0xe706[_0x209581];return _0x2fed45;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5581ef,_0x899833){var _0x2de7b8=function(_0x6a7277){while(--_0x6a7277){_0x5581ef['push'](_0x5581ef['shift']());}};_0x2de7b8(++_0x899833);}(_0x70e0,0x17b));var _0x070e=function(_0x22d77b,_0x301613){_0x22d77b=_0x22d77b-0x0;var _0x590b00=_0x70e0[_0x22d77b];return _0x590b00;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 1d48e64..335c230 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 _0xbc72=['INTEGER','STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbc72,0x7e));var _0x2bc7=function(_0x5c270c,_0x26152c){_0x5c270c=_0x5c270c-0x0;var _0x28e8bc=_0xbc72[_0x5c270c];return _0x28e8bc;};'use strict';var Sequelize=require(_0x2bc7('0x0'));module[_0x2bc7('0x1')]={'penalty':{'type':Sequelize[_0x2bc7('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x2bc7('0x3')]}}; \ No newline at end of file +var _0xa381=['INTEGER','STRING','sequelize','exports'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xa381,0x1ce));var _0x1a38=function(_0x5ea60d,_0xf1b6f3){_0x5ea60d=_0x5ea60d-0x0;var _0x1d14eb=_0xa381[_0x5ea60d];return _0x1d14eb;};'use strict';var Sequelize=require(_0x1a38('0x0'));module[_0x1a38('0x1')]={'penalty':{'type':Sequelize[_0x1a38('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1a38('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1a38('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 34d2713..8a8f33a 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 _0x4aa6=['path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','util','../../config/logger','api','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4aa6,0x193));var _0x64aa=function(_0x3f7372,_0x3f410){_0x3f7372=_0x3f7372-0x0;var _0x469320=_0x4aa6[_0x3f7372];return _0x469320;};'use strict';var _=require(_0x64aa('0x0'));var util=require(_0x64aa('0x1'));var logger=require(_0x64aa('0x2'))(_0x64aa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x64aa('0x4'));var fs=require('fs');var path=require(_0x64aa('0x5'));var rimraf=require(_0x64aa('0x6'));var config=require(_0x64aa('0x7'));var attributes=require(_0x64aa('0x8'));module[_0x64aa('0x9')]=function(_0xe103e0,_0x478eba){return _0xe103e0[_0x64aa('0xa')](_0x64aa('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ab7=['exports','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x25c8aa,_0x25ee75){var _0x47b440=function(_0x40b0f0){while(--_0x40b0f0){_0x25c8aa['push'](_0x25c8aa['shift']());}};_0x47b440(++_0x25ee75);}(_0x0ab7,0x13c));var _0x70ab=function(_0x25510b,_0x46fc92){_0x25510b=_0x25510b-0x0;var _0x5a07e9=_0x0ab7[_0x25510b];return _0x5a07e9;};'use strict';var _=require(_0x70ab('0x0'));var util=require(_0x70ab('0x1'));var logger=require(_0x70ab('0x2'))(_0x70ab('0x3'));var moment=require(_0x70ab('0x4'));var BPromise=require('bluebird');var rp=require(_0x70ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0x70ab('0x6')]=function(_0x3469ce,_0x2e6a45){return _0x3469ce['define']('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 35cf754..e7c95ec 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 _0xba33=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x48fff1,_0x50c537){var _0x127a1d=function(_0x2abe66){while(--_0x2abe66){_0x48fff1['push'](_0x48fff1['shift']());}};_0x127a1d(++_0x50c537);}(_0xba33,0x95));var _0x3ba3=function(_0x144954,_0x3cf1b4){_0x144954=_0x144954-0x0;var _0x42d21a=_0xba33[_0x144954];return _0x42d21a;};'use strict';var _=require(_0x3ba3('0x0'));var util=require(_0x3ba3('0x1'));var moment=require('moment');var BPromise=require(_0x3ba3('0x2'));var rs=require(_0x3ba3('0x3'));var fs=require('fs');var Redis=require(_0x3ba3('0x4'));var db=require(_0x3ba3('0x5'))['db'];var utils=require(_0x3ba3('0x6'));var logger=require(_0x3ba3('0x7'))(_0x3ba3('0x8'));var config=require(_0x3ba3('0x9'));var jayson=require(_0x3ba3('0xa'));var client=jayson[_0x3ba3('0xb')][_0x3ba3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf93249,_0x27893b,_0x39cb8c){return new BPromise(function(_0x41aee0,_0x382c63){return client['request'](_0xf93249,_0x39cb8c)[_0x3ba3('0xd')](function(_0x1354f2){logger[_0x3ba3('0xe')](_0x3ba3('0xf'),_0x27893b,_0x3ba3('0x10'));logger[_0x3ba3('0x11')](_0x3ba3('0x12'),_0x27893b,_0x3ba3('0x10'),JSON['stringify'](_0x1354f2));if(_0x1354f2['error']){if(_0x1354f2[_0x3ba3('0x13')][_0x3ba3('0x14')]===0x1f4){logger[_0x3ba3('0x13')](_0x3ba3('0xf'),_0x27893b,_0x1354f2['error']['message']);return _0x382c63(_0x1354f2['error']['message']);}logger['error'](_0x3ba3('0xf'),_0x27893b,_0x1354f2[_0x3ba3('0x13')][_0x3ba3('0x15')]);return _0x41aee0(_0x1354f2['error'][_0x3ba3('0x15')]);}else{logger[_0x3ba3('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x27893b,_0x3ba3('0x10'));_0x41aee0(_0x1354f2[_0x3ba3('0x16')]['message']);}})[_0x3ba3('0x17')](function(_0x4ff927){logger['error'](_0x3ba3('0xf'),_0x27893b,_0x4ff927);_0x382c63(_0x4ff927);});});} \ No newline at end of file +var _0x791b=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x791b,0x176));var _0xb791=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x791b[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xb791('0x0'));var util=require(_0xb791('0x1'));var moment=require(_0xb791('0x2'));var BPromise=require('bluebird');var rs=require(_0xb791('0x3'));var fs=require('fs');var Redis=require(_0xb791('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb791('0x5'));var logger=require(_0xb791('0x6'))(_0xb791('0x7'));var config=require(_0xb791('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb791('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x515624,_0x3a80ee,_0x7ae2e){return new BPromise(function(_0x2904f1,_0x35a2c8){return client[_0xb791('0xa')](_0x515624,_0x7ae2e)[_0xb791('0xb')](function(_0xe8d86e){logger[_0xb791('0xc')](_0xb791('0xd'),_0x3a80ee,_0xb791('0xe'));logger[_0xb791('0xf')](_0xb791('0x10'),_0x3a80ee,_0xb791('0xe'),JSON[_0xb791('0x11')](_0xe8d86e));if(_0xe8d86e[_0xb791('0x12')]){if(_0xe8d86e[_0xb791('0x12')][_0xb791('0x13')]===0x1f4){logger['error'](_0xb791('0xd'),_0x3a80ee,_0xe8d86e['error']['message']);return _0x35a2c8(_0xe8d86e[_0xb791('0x12')][_0xb791('0x14')]);}logger[_0xb791('0x12')](_0xb791('0xd'),_0x3a80ee,_0xe8d86e['error'][_0xb791('0x14')]);return _0x2904f1(_0xe8d86e[_0xb791('0x12')][_0xb791('0x14')]);}else{logger[_0xb791('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x3a80ee,_0xb791('0xe'));_0x2904f1(_0xe8d86e['result'][_0xb791('0x14')]);}})[_0xb791('0x15')](function(_0x341298){logger[_0xb791('0x12')](_0xb791('0xd'),_0x3a80ee,_0x341298);_0x35a2c8(_0x341298);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 6d4d6be..11a74eb 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x12baed,_0x45a719){var _0x630772=function(_0x449242){while(--_0x449242){_0x12baed['push'](_0x12baed['shift']());}};_0x630772(++_0x45a719);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3cb43a,_0x2855f8){var _0x8e69a5=function(_0x5360b5){while(--_0x5360b5){_0x3cb43a['push'](_0x3cb43a['shift']());}};_0x8e69a5(++_0x2855f8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xcb91[_0x1dbaf7];return _0x593f05;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 798ac29..9006424 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 _0xdad9=['INTEGER','exports'];(function(_0x48ec5b,_0x50bbbf){var _0x3cdee8=function(_0x4d361e){while(--_0x4d361e){_0x48ec5b['push'](_0x48ec5b['shift']());}};_0x3cdee8(++_0x50bbbf);}(_0xdad9,0xad));var _0x9dad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdad9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x9dad('0x0')]={'penalty':{'type':Sequelize[_0x9dad('0x1')],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 513e76e..a98bbe2 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 _0x7f21=['exports','define','user_has_mail_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes'];(function(_0x29c6fc,_0x462633){var _0x1406ab=function(_0x2ab3d8){while(--_0x2ab3d8){_0x29c6fc['push'](_0x29c6fc['shift']());}};_0x1406ab(++_0x462633);}(_0x7f21,0x10b));var _0x17f2=function(_0x475dff,_0x11a709){_0x475dff=_0x475dff-0x0;var _0x3c4c02=_0x7f21[_0x475dff];return _0x3c4c02;};'use strict';var _=require('lodash');var util=require(_0x17f2('0x0'));var logger=require(_0x17f2('0x1'))(_0x17f2('0x2'));var moment=require(_0x17f2('0x3'));var BPromise=require(_0x17f2('0x4'));var rp=require(_0x17f2('0x5'));var fs=require('fs');var path=require(_0x17f2('0x6'));var rimraf=require('rimraf');var config=require(_0x17f2('0x7'));var attributes=require(_0x17f2('0x8'));module[_0x17f2('0x9')]=function(_0x5803f8,_0xdacf44){return _0x5803f8[_0x17f2('0xa')]('UserMailQueue',attributes,{'tableName':_0x17f2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c16=['request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','api','moment','bluebird'];(function(_0x2cb885,_0x588f87){var _0x3cbcc3=function(_0x375ae7){while(--_0x375ae7){_0x2cb885['push'](_0x2cb885['shift']());}};_0x3cbcc3(++_0x588f87);}(_0x3c16,0xb1));var _0x63c1=function(_0x2bdc7a,_0x465d7f){_0x2bdc7a=_0x2bdc7a-0x0;var _0x53f956=_0x3c16[_0x2bdc7a];return _0x53f956;};'use strict';var _=require(_0x63c1('0x0'));var util=require(_0x63c1('0x1'));var logger=require('../../config/logger')(_0x63c1('0x2'));var moment=require(_0x63c1('0x3'));var BPromise=require(_0x63c1('0x4'));var rp=require(_0x63c1('0x5'));var fs=require('fs');var path=require(_0x63c1('0x6'));var rimraf=require(_0x63c1('0x7'));var config=require(_0x63c1('0x8'));var attributes=require(_0x63c1('0x9'));module[_0x63c1('0xa')]=function(_0x2b114c,_0x72487e){return _0x2b114c[_0x63c1('0xb')](_0x63c1('0xc'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 01a3c72..69823ce 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2d0abd,_0x44c90c){_0x2d0abd=_0x2d0abd-0x0;var _0x556dc1=_0x1cb9[_0x2d0abd];return _0x556dc1;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x13828f,_0xa5c6a6){var _0x32bd42=function(_0xb33b29){while(--_0xb33b29){_0x13828f['push'](_0x13828f['shift']());}};_0x32bd42(++_0xa5c6a6);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5287ff,_0x5b4afc){_0x5287ff=_0x5287ff-0x0;var _0x109155=_0x8ef6[_0x5287ff];return _0x109155;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index a78b6b5..1f8956e 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 _0xd628=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','util'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0xd628,0x1ae));var _0x8d62=function(_0x3baab8,_0x1d5cd4){_0x3baab8=_0x3baab8-0x0;var _0x5598ea=_0xd628[_0x3baab8];return _0x5598ea;};'use strict';var multer=require(_0x8d62('0x0'));var util=require(_0x8d62('0x1'));var path=require(_0x8d62('0x2'));var timeout=require(_0x8d62('0x3'));var express=require(_0x8d62('0x4'));var router=express[_0x8d62('0x5')]();var fs_extra=require(_0x8d62('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8d62('0x7'));var config=require('../../config/environment');var controller=require(_0x8d62('0x8'));router['post']('/',auth[_0x8d62('0x9')](),controller[_0x8d62('0xa')]);module[_0x8d62('0xb')]=router; \ No newline at end of file +var _0x13b2=['./userNotification.controller','post','sendUserNotification','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x23fe51,_0x30714e){var _0x22b68f=function(_0x1a4a62){while(--_0x1a4a62){_0x23fe51['push'](_0x23fe51['shift']());}};_0x22b68f(++_0x30714e);}(_0x13b2,0x158));var _0x213b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x13b2[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x213b('0x0'));var util=require('util');var path=require(_0x213b('0x1'));var timeout=require(_0x213b('0x2'));var express=require('express');var router=express[_0x213b('0x3')]();var fs_extra=require(_0x213b('0x4'));var auth=require(_0x213b('0x5'));var interaction=require(_0x213b('0x6'));var config=require(_0x213b('0x7'));var controller=require(_0x213b('0x8'));router[_0x213b('0x9')]('/',auth['isAuthenticated'](),controller[_0x213b('0xa')]);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 016589e..5b38f36 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 _0x94df=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x5b9acf,_0x364bc3){var _0x3e36ee=function(_0x4fbcf1){while(--_0x4fbcf1){_0x5b9acf['push'](_0x5b9acf['shift']());}};_0x3e36ee(++_0x364bc3);}(_0x94df,0x15b));var _0xf94d=function(_0x125441,_0x122e17){_0x125441=_0x125441-0x0;var _0x140762=_0x94df[_0x125441];return _0x140762;};'use strict';var Sequelize=require(_0xf94d('0x0'));module[_0xf94d('0x1')]={'body':{'type':Sequelize[_0xf94d('0x2')]},'senderName':{'type':Sequelize[_0xf94d('0x3')]},'recipientsId':{'type':Sequelize[_0xf94d('0x2')]},'recipientsDescription':{'type':Sequelize[_0xf94d('0x3')]},'beep':{'type':Sequelize[_0xf94d('0x4')]}}; \ No newline at end of file +var _0x59c3=['STRING','sequelize','TEXT'];(function(_0x133919,_0xbafc8d){var _0xf6c84b=function(_0x5213f1){while(--_0x5213f1){_0x133919['push'](_0x133919['shift']());}};_0xf6c84b(++_0xbafc8d);}(_0x59c3,0xf7));var _0x359c=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x59c3[_0x2cf2e9];return _0xd3670d;};'use strict';var Sequelize=require(_0x359c('0x0'));module['exports']={'body':{'type':Sequelize[_0x359c('0x1')]},'senderName':{'type':Sequelize[_0x359c('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x359c('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 1545cd7..b95dce5 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 _0x456b=['transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','ids','queue','replace','Queue','push','all','union','getAgents','map','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','body','hasOwnProperty','text','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','user','includes','model','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','sequelize'];(function(_0x6d068,_0x1a1d7f){var _0x5867f9=function(_0x73015e){while(--_0x73015e){_0x6d068['push'](_0x6d068['shift']());}};_0x5867f9(++_0x1a1d7f);}(_0x456b,0xd2));var _0xb456=function(_0x5ab39a,_0x3038f2){_0x5ab39a=_0x5ab39a-0x0;var _0x1473bd=_0x456b[_0x5ab39a];return _0x1473bd;};'use strict';var emlformat=require(_0xb456('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb456('0x1'));var rp=require(_0xb456('0x2'));var moment=require('moment');var BPromise=require(_0xb456('0x3'));var Mustache=require('mustache');var util=require(_0xb456('0x4'));var path=require(_0xb456('0x5'));var sox=require(_0xb456('0x6'));var csv=require(_0xb456('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb456('0x8'));var squel=require(_0xb456('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb456('0xa'));var toCsv=require(_0xb456('0x7'));var querystring=require(_0xb456('0xb'));var Papa=require(_0xb456('0xc'));var Redis=require(_0xb456('0xd'));var authService=require(_0xb456('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb456('0xf'));var logger=require(_0xb456('0x10'))('api');var utils=require(_0xb456('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xb456('0x12')](config[_0xb456('0x13')],{'host':_0xb456('0x14'),'port':0x18eb});var socket=require(_0xb456('0x15'))(new Redis(config[_0xb456('0x13')]));require(_0xb456('0x16'))[_0xb456('0x17')](socket);function respondWithStatusCode(_0x611959,_0x170e29){_0x170e29=_0x170e29||0xcc;return function(_0x4f6532){if(_0x4f6532){return _0x611959[_0xb456('0x18')](_0x170e29);}return _0x611959[_0xb456('0x19')](_0x170e29)['end']();};}function respondWithResult(_0xacb0e9,_0x288413){_0x288413=_0x288413||0xc8;return function(_0x4910d9){if(_0x4910d9){return _0xacb0e9[_0xb456('0x19')](_0x288413)[_0xb456('0x1a')](_0x4910d9);}};}function respondWithFilteredResult(_0x3df107,_0x38caf3){return function(_0x3479b6){if(_0x3479b6){var _0x325454=typeof _0x38caf3[_0xb456('0x1b')]===_0xb456('0x1c')&&typeof _0x38caf3[_0xb456('0x1d')]===_0xb456('0x1c');var _0x14ce7e=_0x3479b6[_0xb456('0x1e')];var _0x56d296=_0x325454?0x0:_0x38caf3[_0xb456('0x1b')];var _0x1835af=_0x325454?_0x3479b6[_0xb456('0x1e')]:_0x38caf3[_0xb456('0x1b')]+_0x38caf3[_0xb456('0x1d')];var _0xb55ec5;if(_0x1835af>=_0x14ce7e){_0x1835af=_0x14ce7e;_0xb55ec5=0xc8;}else{_0xb55ec5=0xce;}_0x3df107[_0xb456('0x19')](_0xb55ec5);return _0x3df107[_0xb456('0x1f')]('Content-Range',_0x56d296+'-'+_0x1835af+'/'+_0x14ce7e)['json'](_0x3479b6);}return null;};}function patchUpdates(_0x394f9c){return function(_0xdfd0c4){try{jsonpatch[_0xb456('0x20')](_0xdfd0c4,_0x394f9c,!![]);}catch(_0x6eba3a){return BPromise['reject'](_0x6eba3a);}return _0xdfd0c4[_0xb456('0x21')]();};}function saveUpdates(_0x1928ba,_0x4a6cc3){return function(_0x20c4c4){if(_0x20c4c4){return _0x20c4c4[_0xb456('0x22')](_0x1928ba)[_0xb456('0x23')](function(_0x4ffdde){return _0x4ffdde;});}return null;};}function removeEntity(_0x2f79f0,_0x452921){return function(_0x4d1574){if(_0x4d1574){return _0x4d1574[_0xb456('0x24')]()['then'](function(){_0x2f79f0[_0xb456('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x386eac,_0x31fc81){return function(_0x5c7a24){if(!_0x5c7a24){_0x386eac[_0xb456('0x18')](0x194);}return _0x5c7a24;};}function handleError(_0x2a66d9,_0x4a496b){_0x4a496b=_0x4a496b||0x1f4;return function(_0x46b4e7){logger[_0xb456('0x25')](_0x46b4e7[_0xb456('0x26')]);if(_0x46b4e7[_0xb456('0x27')]){delete _0x46b4e7[_0xb456('0x27')];}_0x2a66d9['status'](_0x4a496b)[_0xb456('0x28')](_0x46b4e7);};}exports['sendUserNotification']=function(_0x4ad3de,_0x2ccd39,_0x363472){if(!_0x4ad3de[_0xb456('0x29')][_0xb456('0x2a')](_0xb456('0x2b'))&&!_0x4ad3de[_0xb456('0x29')][_0xb456('0x2a')]('TemplateId')){throw new db['Sequelize'][(_0xb456('0x2c'))](_0xb456('0x2d'));}else{if(_0x4ad3de[_0xb456('0x29')][_0xb456('0x2a')](_0xb456('0x2e'))&&!_0x4ad3de[_0xb456('0x29')]['hasOwnProperty'](_0xb456('0x2f'))){throw new db[(_0xb456('0x30'))][(_0xb456('0x2c'))](_0xb456('0x31'));}if(!_0x4ad3de[_0xb456('0x29')][_0xb456('0x2a')](_0xb456('0x32'))){throw new db['Sequelize'][(_0xb456('0x2c'))](_0xb456('0x33'));}else{try{var _0x4eb067=JSON[_0xb456('0x34')](_0x4ad3de[_0xb456('0x29')]['recipients']);}catch(_0x14fe14){logger[_0xb456('0x25')](_0x14fe14);throw new db[(_0xb456('0x30'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x2b971b=[_0xb456('0x35'),_0xb456('0x36'),_0xb456('0x37'),_0xb456('0x38'),_0xb456('0x39'),_0xb456('0x3a'),'whatsappqueue',_0xb456('0x3b'),_0xb456('0x3c')];if(_['some'](_0x4eb067,function(_0x346c40){return!_[_0xb456('0x3d')](_0x2b971b,_0x346c40[_0xb456('0x3e')]['toLowerCase']());})){throw new db[(_0xb456('0x30'))][(_0xb456('0x2c'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x26f071={};_0x26f071[_0xb456('0x3f')]=_0x4ad3de[_0xb456('0x29')][_0xb456('0x2a')](_0xb456('0x3f'))?_0x4ad3de[_0xb456('0x29')][_0xb456('0x3f')]:_0x4ad3de[_0xb456('0x3c')][_0xb456('0x40')];_0x26f071[_0xb456('0x41')]=_[_0xb456('0x42')](_0x4ad3de[_0xb456('0x29')][_0xb456('0x41')])?null:_0x4ad3de[_0xb456('0x29')]['recipientsDescription'];_0x26f071[_0xb456('0x43')]=_0x4ad3de[_0xb456('0x29')][_0xb456('0x43')]||![];_0x26f071['SenderId']=_0x4ad3de['user']['id'];return getContent(_0x4ad3de[_0xb456('0x29')])['then'](function(_0xc18e41){_0x26f071['body']=_0xc18e41;return getRecipients(_0x4eb067);})['then'](function(_0x2629c6){_0x26f071[_0xb456('0x44')]=_[_0xb456('0x45')](_0x2629c6)[_0xb456('0x46')](',');return db[_0xb456('0x47')][_0xb456('0x48')](function(_0x447c5c){return db[_0xb456('0x49')][_0xb456('0x4a')](_0x26f071,{'raw':!![],'transaction':_0x447c5c})[_0xb456('0x23')](function(_0x49ed28){var _0x55f791={'sender':_0x26f071[_0xb456('0x3f')],'description':_0x26f071[_0xb456('0x41')],'content':_0x26f071[_0xb456('0x29')],'beep':_0x26f071[_0xb456('0x43')]};_0x2629c6[_0xb456('0x4b')](function(_0x7b67a3){_0x55f791[_0xb456('0x4c')]=_0x7b67a3;socket[_0xb456('0x4d')](_0xb456('0x4e'),_0x55f791);});return _0x49ed28;});});})[_0xb456('0x23')](respondWithResult(_0x2ccd39,0xc9))['catch'](handleError(_0x2ccd39,null));};function getContent(_0x42d8d4){return new BPromise(function(_0x3a4783,_0x56f7ce){if(_0x42d8d4[_0xb456('0x2b')]){_0x3a4783(_0x42d8d4[_0xb456('0x2b')]);return;}return db[_0xb456('0x4f')][_0xb456('0x50')]({'attributes':[_0xb456('0x51')],'where':{'id':_0x42d8d4[_0xb456('0x2e')]},'raw':!![]})[_0xb456('0x23')](function(_0x4e6b07){if(!_0x4e6b07)throw new db[(_0xb456('0x30'))]['ValidationError'](_0xb456('0x52'));var _0x46053b=Mustache[_0xb456('0x53')](_0x4e6b07[_0xb456('0x51')],_0x42d8d4[_0xb456('0x2f')]);_0x3a4783(_0x46053b);})[_0xb456('0x54')](function(_0x312871){_0x56f7ce(_0x312871);});});}function getRecipients(_0xa60066){return new BPromise(function(_0x3c23b3,_0x557c8f){var _0x59375b=[];var _0x337cc6=[];_0xa60066[_0xb456('0x4b')](function(_0x3a9df2){var _0x196885=_['startCase'](_0x3a9df2[_0xb456('0x3e')]['toLowerCase']());if(_0x196885==='User'){_0x59375b=_['union'](_0x59375b,_0x3a9df2[_0xb456('0x55')]);}else{if(_[_0xb456('0x3d')](_0x196885,_0xb456('0x56')))_0x196885=_0x196885[_0xb456('0x57')](_0xb456('0x56'),_0xb456('0x58'));_0x3a9df2[_0xb456('0x55')][_0xb456('0x4b')](function(_0x55853c){_0x337cc6[_0xb456('0x59')](getAgents(_0x196885,_0x55853c));});}});return BPromise[_0xb456('0x5a')](_0x337cc6)[_0xb456('0x23')](function(_0x31ffc4){_0x59375b=_[_0xb456('0x5b')](_0x59375b,_['flatten'](_0x31ffc4));_0x3c23b3(_0x59375b);})[_0xb456('0x54')](function(_0x5df197){_0x557c8f(_0x5df197);});});}function getAgents(_0x3bc0e1,_0x34bf8c){return new BPromise(function(_0x359def,_0x5b128a){return db[_0x3bc0e1][_0xb456('0x50')]({'where':{'id':_0x34bf8c}})[_0xb456('0x23')](function(_0x2d48b6){return _0x2d48b6[_0xb456('0x5c')]({'attributes':['id'],'raw':!![]})[_0xb456('0x23')](function(_0x3b7756){var _0x35a3f7=_[_0xb456('0x5d')](_0x3b7756,'id');_0x359def(_0x35a3f7);});})[_0xb456('0x54')](function(_0x519447){_0x5b128a(_0x519447);});});} \ No newline at end of file +var _0xa6e4=['sox','to-csv','ejs','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','sendUserNotification','body','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','hasOwnProperty','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','whatsappqueue','team','user','some','senderName','fullname','recipientsDescription','beep','then','recipientsId','sortBy','sequelize','transaction','UserNotification','create','recipient','userNotification:send','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','startCase','model','toLowerCase','User','union','ids','queue','replace','Queue','push','all','flatten','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1cb8c5,_0x59f1b8){var _0x24e12d=function(_0x237be2){while(--_0x237be2){_0x1cb8c5['push'](_0x1cb8c5['shift']());}};_0x24e12d(++_0x59f1b8);}(_0xa6e4,0x180));var _0x4a6e=function(_0x39fec1,_0x127a28){_0x39fec1=_0x39fec1-0x0;var _0x2715cd=_0xa6e4[_0x39fec1];return _0x2715cd;};'use strict';var emlformat=require(_0x4a6e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a6e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a6e('0x2'));var moment=require(_0x4a6e('0x3'));var BPromise=require(_0x4a6e('0x4'));var Mustache=require(_0x4a6e('0x5'));var util=require(_0x4a6e('0x6'));var path=require(_0x4a6e('0x7'));var sox=require(_0x4a6e('0x8'));var csv=require(_0x4a6e('0x9'));var ejs=require(_0x4a6e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4a6e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4a6e('0xc'));var Papa=require(_0x4a6e('0xd'));var Redis=require(_0x4a6e('0xe'));var authService=require(_0x4a6e('0xf'));var qs=require(_0x4a6e('0x10'));var as=require(_0x4a6e('0x11'));var hardwareService=require(_0x4a6e('0x12'));var logger=require('../../config/logger')(_0x4a6e('0x13'));var utils=require('../../config/utils');var config=require(_0x4a6e('0x14'));var licenseUtil=require(_0x4a6e('0x15'));var db=require(_0x4a6e('0x16'))['db'];config[_0x4a6e('0x17')]=_[_0x4a6e('0x18')](config[_0x4a6e('0x17')],{'host':_0x4a6e('0x19'),'port':0x18eb});var socket=require(_0x4a6e('0x1a'))(new Redis(config[_0x4a6e('0x17')]));require(_0x4a6e('0x1b'))['register'](socket);function respondWithStatusCode(_0x5553a5,_0x12a894){_0x12a894=_0x12a894||0xcc;return function(_0x4de001){if(_0x4de001){return _0x5553a5[_0x4a6e('0x1c')](_0x12a894);}return _0x5553a5['status'](_0x12a894)['end']();};}function respondWithResult(_0x38861d,_0x51c3af){_0x51c3af=_0x51c3af||0xc8;return function(_0x3afeb7){if(_0x3afeb7){return _0x38861d[_0x4a6e('0x1d')](_0x51c3af)[_0x4a6e('0x1e')](_0x3afeb7);}};}function respondWithFilteredResult(_0x5de982,_0x20293f){return function(_0x2a366f){if(_0x2a366f){var _0x337a68=typeof _0x20293f['offset']===_0x4a6e('0x1f')&&typeof _0x20293f[_0x4a6e('0x20')]===_0x4a6e('0x1f');var _0x401fda=_0x2a366f['count'];var _0x18392d=_0x337a68?0x0:_0x20293f[_0x4a6e('0x21')];var _0x5260aa=_0x337a68?_0x2a366f[_0x4a6e('0x22')]:_0x20293f['offset']+_0x20293f[_0x4a6e('0x20')];var _0x16d3f2;if(_0x5260aa>=_0x401fda){_0x5260aa=_0x401fda;_0x16d3f2=0xc8;}else{_0x16d3f2=0xce;}_0x5de982[_0x4a6e('0x1d')](_0x16d3f2);return _0x5de982['set'](_0x4a6e('0x23'),_0x18392d+'-'+_0x5260aa+'/'+_0x401fda)['json'](_0x2a366f);}return null;};}function patchUpdates(_0x5a3d4d){return function(_0x5d3299){try{jsonpatch[_0x4a6e('0x24')](_0x5d3299,_0x5a3d4d,!![]);}catch(_0x47f627){return BPromise[_0x4a6e('0x25')](_0x47f627);}return _0x5d3299[_0x4a6e('0x26')]();};}function saveUpdates(_0x46b855,_0x132ead){return function(_0x1a3f35){if(_0x1a3f35){return _0x1a3f35[_0x4a6e('0x27')](_0x46b855)['then'](function(_0x2e1f8d){return _0x2e1f8d;});}return null;};}function removeEntity(_0x54b3c0,_0xf3a98e){return function(_0x4ce99a){if(_0x4ce99a){return _0x4ce99a[_0x4a6e('0x28')]()['then'](function(){_0x54b3c0[_0x4a6e('0x1d')](0xcc)[_0x4a6e('0x29')]();});}};}function handleEntityNotFound(_0x57dbad,_0x57ec0f){return function(_0x41fbda){if(!_0x41fbda){_0x57dbad['sendStatus'](0x194);}return _0x41fbda;};}function handleError(_0x8e3a42,_0x58911a){_0x58911a=_0x58911a||0x1f4;return function(_0x22db15){logger[_0x4a6e('0x2a')](_0x22db15[_0x4a6e('0x2b')]);if(_0x22db15['name']){delete _0x22db15[_0x4a6e('0x2c')];}_0x8e3a42[_0x4a6e('0x1d')](_0x58911a)[_0x4a6e('0x2d')](_0x22db15);};}exports[_0x4a6e('0x2e')]=function(_0x492986,_0x1d1c5b,_0x14329e){if(!_0x492986[_0x4a6e('0x2f')]['hasOwnProperty'](_0x4a6e('0x30'))&&!_0x492986[_0x4a6e('0x2f')]['hasOwnProperty'](_0x4a6e('0x31'))){throw new db[(_0x4a6e('0x32'))][(_0x4a6e('0x33'))](_0x4a6e('0x34'));}else{if(_0x492986[_0x4a6e('0x2f')][_0x4a6e('0x35')]('TemplateId')&&!_0x492986[_0x4a6e('0x2f')][_0x4a6e('0x35')](_0x4a6e('0x36'))){throw new db[(_0x4a6e('0x32'))]['ValidationError'](_0x4a6e('0x37'));}if(!_0x492986['body'][_0x4a6e('0x35')](_0x4a6e('0x38'))){throw new db[(_0x4a6e('0x32'))][(_0x4a6e('0x33'))](_0x4a6e('0x39'));}else{try{var _0x2837ff=JSON[_0x4a6e('0x3a')](_0x492986[_0x4a6e('0x2f')][_0x4a6e('0x38')]);}catch(_0x2bbafb){logger[_0x4a6e('0x2a')](_0x2bbafb);throw new db[(_0x4a6e('0x32'))][(_0x4a6e('0x33'))](_0x4a6e('0x3b'));}var _0x10a6fa=[_0x4a6e('0x3c'),_0x4a6e('0x3d'),_0x4a6e('0x3e'),'openchannelqueue','smsqueue','voicequeue',_0x4a6e('0x3f'),_0x4a6e('0x40'),_0x4a6e('0x41')];if(_[_0x4a6e('0x42')](_0x2837ff,function(_0x2196dd){return!_['includes'](_0x10a6fa,_0x2196dd['model']['toLowerCase']());})){throw new db[(_0x4a6e('0x32'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x38674a={};_0x38674a[_0x4a6e('0x43')]=_0x492986['body'][_0x4a6e('0x35')](_0x4a6e('0x43'))?_0x492986[_0x4a6e('0x2f')][_0x4a6e('0x43')]:_0x492986[_0x4a6e('0x41')][_0x4a6e('0x44')];_0x38674a['recipientsDescription']=_['isEmpty'](_0x492986[_0x4a6e('0x2f')]['recipientsDescription'])?null:_0x492986[_0x4a6e('0x2f')][_0x4a6e('0x45')];_0x38674a[_0x4a6e('0x46')]=_0x492986[_0x4a6e('0x2f')][_0x4a6e('0x46')]||![];_0x38674a['SenderId']=_0x492986[_0x4a6e('0x41')]['id'];return getContent(_0x492986[_0x4a6e('0x2f')])['then'](function(_0x2af3c5){_0x38674a[_0x4a6e('0x2f')]=_0x2af3c5;return getRecipients(_0x2837ff);})[_0x4a6e('0x47')](function(_0x342429){_0x38674a[_0x4a6e('0x48')]=_[_0x4a6e('0x49')](_0x342429)['join'](',');return db[_0x4a6e('0x4a')][_0x4a6e('0x4b')](function(_0x2c6319){return db[_0x4a6e('0x4c')][_0x4a6e('0x4d')](_0x38674a,{'raw':!![],'transaction':_0x2c6319})[_0x4a6e('0x47')](function(_0x349367){var _0x2c3c10={'sender':_0x38674a[_0x4a6e('0x43')],'description':_0x38674a[_0x4a6e('0x45')],'content':_0x38674a[_0x4a6e('0x2f')],'beep':_0x38674a[_0x4a6e('0x46')]};_0x342429['forEach'](function(_0x45df58){_0x2c3c10[_0x4a6e('0x4e')]=_0x45df58;socket['emit'](_0x4a6e('0x4f'),_0x2c3c10);});return _0x349367;});});})['then'](respondWithResult(_0x1d1c5b,0xc9))['catch'](handleError(_0x1d1c5b,null));};function getContent(_0x2faceb){return new BPromise(function(_0x376396,_0x3b86d3){if(_0x2faceb[_0x4a6e('0x30')]){_0x376396(_0x2faceb[_0x4a6e('0x30')]);return;}return db[_0x4a6e('0x50')]['findOne']({'attributes':[_0x4a6e('0x51')],'where':{'id':_0x2faceb[_0x4a6e('0x31')]},'raw':!![]})[_0x4a6e('0x47')](function(_0x4a088a){if(!_0x4a088a)throw new db[(_0x4a6e('0x32'))][(_0x4a6e('0x33'))](_0x4a6e('0x52'));var _0x51d883=Mustache[_0x4a6e('0x53')](_0x4a088a[_0x4a6e('0x51')],_0x2faceb['view']);_0x376396(_0x51d883);})['catch'](function(_0x4d9f27){_0x3b86d3(_0x4d9f27);});});}function getRecipients(_0x54499e){return new BPromise(function(_0x454143,_0x281542){var _0x9b3010=[];var _0x11c6f8=[];_0x54499e[_0x4a6e('0x54')](function(_0x478a7a){var _0x557ce3=_[_0x4a6e('0x55')](_0x478a7a[_0x4a6e('0x56')][_0x4a6e('0x57')]());if(_0x557ce3===_0x4a6e('0x58')){_0x9b3010=_[_0x4a6e('0x59')](_0x9b3010,_0x478a7a[_0x4a6e('0x5a')]);}else{if(_['includes'](_0x557ce3,_0x4a6e('0x5b')))_0x557ce3=_0x557ce3[_0x4a6e('0x5c')](_0x4a6e('0x5b'),_0x4a6e('0x5d'));_0x478a7a[_0x4a6e('0x5a')][_0x4a6e('0x54')](function(_0xdb798){_0x11c6f8[_0x4a6e('0x5e')](getAgents(_0x557ce3,_0xdb798));});}});return BPromise[_0x4a6e('0x5f')](_0x11c6f8)[_0x4a6e('0x47')](function(_0x3c4c8f){_0x9b3010=_[_0x4a6e('0x59')](_0x9b3010,_[_0x4a6e('0x60')](_0x3c4c8f));_0x454143(_0x9b3010);})[_0x4a6e('0x61')](function(_0x1d5a47){_0x281542(_0x1d5a47);});});}function getAgents(_0x2fb3f9,_0x5d2cc4){return new BPromise(function(_0x22a48a,_0x201be8){return db[_0x2fb3f9]['findOne']({'where':{'id':_0x5d2cc4}})['then'](function(_0x2caba0){return _0x2caba0['getAgents']({'attributes':['id'],'raw':!![]})[_0x4a6e('0x47')](function(_0x1de3e5){var _0x3da088=_['map'](_0x1de3e5,'id');_0x22a48a(_0x3da088);});})[_0x4a6e('0x61')](function(_0xd5cd92){_0x201be8(_0xd5cd92);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 56aa061..91daa51 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 _0x6ba4=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x6ba4,0xb4));var _0x46ba=function(_0x581447,_0xb54501){_0x581447=_0x581447-0x0;var _0x1ba0cc=_0x6ba4[_0x581447];return _0x1ba0cc;};'use strict';var EventEmitter=require(_0x46ba('0x0'));var UserNotification=require(_0x46ba('0x1'))['db'][_0x46ba('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x46ba('0x3')](0x0);var events={'afterCreate':_0x46ba('0x4'),'afterUpdate':_0x46ba('0x5'),'afterDestroy':'remove'};function emitEvent(_0x53e86d){return function(_0x2eba44,_0xfac375,_0x18deb3){UserNotificationEvents[_0x46ba('0x6')](_0x53e86d+':'+_0x2eba44['id'],_0x2eba44);UserNotificationEvents[_0x46ba('0x6')](_0x53e86d,_0x2eba44);_0x18deb3(null);};}for(var e in events){if(events[_0x46ba('0x7')](e)){var event=events[e];UserNotification[_0x46ba('0x8')](e,emitEvent(event));}}module[_0x46ba('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0xf5a8=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x369534,_0x5557c4){var _0x524bf9=function(_0x24c6fb){while(--_0x24c6fb){_0x369534['push'](_0x369534['shift']());}};_0x524bf9(++_0x5557c4);}(_0xf5a8,0xfd));var _0x8f5a=function(_0x475eac,_0x2fa495){_0x475eac=_0x475eac-0x0;var _0x4ad158=_0xf5a8[_0x475eac];return _0x4ad158;};'use strict';var EventEmitter=require(_0x8f5a('0x0'));var UserNotification=require(_0x8f5a('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x8f5a('0x2')](0x0);var events={'afterCreate':_0x8f5a('0x3'),'afterUpdate':_0x8f5a('0x4'),'afterDestroy':_0x8f5a('0x5')};function emitEvent(_0x208bec){return function(_0xa4ec46,_0x49629e,_0x5e6d8a){UserNotificationEvents[_0x8f5a('0x6')](_0x208bec+':'+_0xa4ec46['id'],_0xa4ec46);UserNotificationEvents[_0x8f5a('0x6')](_0x208bec,_0xa4ec46);_0x5e6d8a(null);};}for(var e in events){if(events[_0x8f5a('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x8f5a('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 7eaf48d..c65f145 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 _0x2ce6=['api','bluebird','request-promise','path','./userNotification.attributes','exports','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x166a1d,_0x261d12){var _0x1b0fa8=function(_0xa4dc51){while(--_0xa4dc51){_0x166a1d['push'](_0x166a1d['shift']());}};_0x1b0fa8(++_0x261d12);}(_0x2ce6,0x1c4));var _0x62ce=function(_0x5bff0,_0x20716d){_0x5bff0=_0x5bff0-0x0;var _0x3ead2e=_0x2ce6[_0x5bff0];return _0x3ead2e;};'use strict';var _=require(_0x62ce('0x0'));var util=require(_0x62ce('0x1'));var logger=require(_0x62ce('0x2'))(_0x62ce('0x3'));var moment=require('moment');var BPromise=require(_0x62ce('0x4'));var rp=require(_0x62ce('0x5'));var fs=require('fs');var path=require(_0x62ce('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62ce('0x7'));module[_0x62ce('0x8')]=function(_0x44ad2d,_0x46d4bd){return _0x44ad2d[_0x62ce('0x9')](_0x62ce('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x62ce('0xb'),'collate':_0x62ce('0xc')});}; \ No newline at end of file +var _0x6e06=['./userNotification.attributes','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6e06,0x1f1));var _0x66e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e06[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x66e0('0x0'))(_0x66e0('0x1'));var moment=require(_0x66e0('0x2'));var BPromise=require(_0x66e0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x66e0('0x4'));var rimraf=require(_0x66e0('0x5'));var config=require(_0x66e0('0x6'));var attributes=require(_0x66e0('0x7'));module['exports']=function(_0x342554,_0x4826d7){return _0x342554[_0x66e0('0x8')]('UserNotification',attributes,{'tableName':_0x66e0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x66e0('0xa'),'collate':_0x66e0('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 03f56bd..bc07c02 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 _0xbc0d=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','register','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','moment'];(function(_0x883d7,_0x28edb8){var _0x1559d6=function(_0x2a245b){while(--_0x2a245b){_0x883d7['push'](_0x883d7['shift']());}};_0x1559d6(++_0x28edb8);}(_0xbc0d,0xcf));var _0xdbc0=function(_0x1d5ba8,_0x412a52){_0x1d5ba8=_0x1d5ba8-0x0;var _0x1022a2=_0xbc0d[_0x1d5ba8];return _0x1022a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdbc0('0x0'));var BPromise=require(_0xdbc0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdbc0('0x2'));var db=require(_0xdbc0('0x3'))['db'];var utils=require(_0xdbc0('0x4'));var logger=require('../../config/logger')(_0xdbc0('0x5'));var config=require(_0xdbc0('0x6'));var jayson=require(_0xdbc0('0x7'));var client=jayson[_0xdbc0('0x8')][_0xdbc0('0x9')]({'port':0x232a});config[_0xdbc0('0xa')]=_[_0xdbc0('0xb')](config['redis'],{'host':_0xdbc0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdbc0('0xa')]));require(_0xdbc0('0xd'))[_0xdbc0('0xe')](socket);function respondWithRpcPromise(_0x59ba00,_0x5243f5,_0x4e6d9c){return new BPromise(function(_0x249dd3,_0x3efa53){return client['request'](_0x59ba00,_0x4e6d9c)[_0xdbc0('0xf')](function(_0x626f84){logger['info'](_0xdbc0('0x10'),_0x5243f5,_0xdbc0('0x11'));logger[_0xdbc0('0x12')](_0xdbc0('0x13'),_0x5243f5,_0xdbc0('0x11'),JSON['stringify'](_0x626f84));if(_0x626f84['error']){if(_0x626f84[_0xdbc0('0x14')][_0xdbc0('0x15')]===0x1f4){logger[_0xdbc0('0x14')](_0xdbc0('0x10'),_0x5243f5,_0x626f84[_0xdbc0('0x14')][_0xdbc0('0x16')]);return _0x3efa53(_0x626f84[_0xdbc0('0x14')]['message']);}logger[_0xdbc0('0x14')]('UserNotification,\x20%s,\x20%s',_0x5243f5,_0x626f84[_0xdbc0('0x14')][_0xdbc0('0x16')]);return _0x249dd3(_0x626f84[_0xdbc0('0x14')]['message']);}else{logger[_0xdbc0('0x17')](_0xdbc0('0x10'),_0x5243f5,_0xdbc0('0x11'));_0x249dd3(_0x626f84[_0xdbc0('0x18')]['message']);}})[_0xdbc0('0x19')](function(_0x5e13bf){logger[_0xdbc0('0x14')]('UserNotification,\x20%s,\x20%s',_0x5243f5,_0x5e13bf);_0x3efa53(_0x5e13bf);});});} \ No newline at end of file +var _0x253b=['moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util'];(function(_0x4e20e7,_0x3e2afe){var _0x2cbe08=function(_0x1ebf7f){while(--_0x1ebf7f){_0x4e20e7['push'](_0x4e20e7['shift']());}};_0x2cbe08(++_0x3e2afe);}(_0x253b,0x1e3));var _0xb253=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x253b[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xb253('0x0'));var moment=require(_0xb253('0x1'));var BPromise=require('bluebird');var rs=require(_0xb253('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb253('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb253('0x4'))(_0xb253('0x5'));var config=require('../../config/environment');var jayson=require(_0xb253('0x6'));var client=jayson[_0xb253('0x7')]['http']({'port':0x232a});config['redis']=_[_0xb253('0x8')](config[_0xb253('0x9')],{'host':_0xb253('0xa'),'port':0x18eb});var socket=require(_0xb253('0xb'))(new Redis(config[_0xb253('0x9')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x303ad5,_0x2d0264,_0x1d9e97){return new BPromise(function(_0x562d80,_0x38dede){return client[_0xb253('0xc')](_0x303ad5,_0x1d9e97)['then'](function(_0x493910){logger[_0xb253('0xd')](_0xb253('0xe'),_0x2d0264,_0xb253('0xf'));logger[_0xb253('0x10')](_0xb253('0x11'),_0x2d0264,'request\x20sent',JSON[_0xb253('0x12')](_0x493910));if(_0x493910[_0xb253('0x13')]){if(_0x493910[_0xb253('0x13')]['code']===0x1f4){logger[_0xb253('0x13')](_0xb253('0xe'),_0x2d0264,_0x493910[_0xb253('0x13')]['message']);return _0x38dede(_0x493910[_0xb253('0x13')]['message']);}logger[_0xb253('0x13')](_0xb253('0xe'),_0x2d0264,_0x493910['error'][_0xb253('0x14')]);return _0x562d80(_0x493910[_0xb253('0x13')][_0xb253('0x14')]);}else{logger[_0xb253('0xd')](_0xb253('0xe'),_0x2d0264,'request\x20sent');_0x562d80(_0x493910['result'][_0xb253('0x14')]);}})[_0xb253('0x15')](function(_0x3be768){logger[_0xb253('0x13')]('UserNotification,\x20%s,\x20%s',_0x2d0264,_0x3be768);_0x38dede(_0x3be768);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 4e247f1..449d648 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 _0xcbb2=['update','register','userNotification:','./userNotification.events','save'];(function(_0x357906,_0x25c4a8){var _0x361e6f=function(_0x1811ef){while(--_0x1811ef){_0x357906['push'](_0x357906['shift']());}};_0x361e6f(++_0x25c4a8);}(_0xcbb2,0xc6));var _0x2cbb=function(_0x269d92,_0x6ceeac){_0x269d92=_0x269d92-0x0;var _0x2d551f=_0xcbb2[_0x269d92];return _0x2d551f;};'use strict';var UserNotificationEvents=require(_0x2cbb('0x0'));var events=[_0x2cbb('0x1'),'remove',_0x2cbb('0x2')];function createListener(_0x8e460,_0x5ea27c){return function(_0x41d916){_0x5ea27c['emit'](_0x8e460,_0x41d916);};}function removeListener(_0x146837,_0x42f68d){return function(){UserNotificationEvents['removeListener'](_0x146837,_0x42f68d);};}exports[_0x2cbb('0x3')]=function(_0xf9a72c){for(var _0x4c5549=0x0,_0x316afc=events['length'];_0x4c5549<_0x316afc;_0x4c5549++){var _0x1bc352=events[_0x4c5549];var _0x5538c3=createListener(_0x2cbb('0x4')+_0x1bc352,_0xf9a72c);UserNotificationEvents['on'](_0x1bc352,_0x5538c3);}}; \ No newline at end of file +var _0x578e=['./userNotification.events','save','remove','update','emit','register','length'];(function(_0x23f1ee,_0x2005a4){var _0x52388b=function(_0x1317f6){while(--_0x1317f6){_0x23f1ee['push'](_0x23f1ee['shift']());}};_0x52388b(++_0x2005a4);}(_0x578e,0x103));var _0xe578=function(_0x5317da,_0x39975f){_0x5317da=_0x5317da-0x0;var _0x50aed6=_0x578e[_0x5317da];return _0x50aed6;};'use strict';var UserNotificationEvents=require(_0xe578('0x0'));var events=[_0xe578('0x1'),_0xe578('0x2'),_0xe578('0x3')];function createListener(_0x4c28e8,_0xcc705d){return function(_0x4fb57f){_0xcc705d[_0xe578('0x4')](_0x4c28e8,_0x4fb57f);};}function removeListener(_0x2b8c05,_0x249c54){return function(){UserNotificationEvents['removeListener'](_0x2b8c05,_0x249c54);};}exports[_0xe578('0x5')]=function(_0x2d14dc){for(var _0x28c1d2=0x0,_0x5476e1=events[_0xe578('0x6')];_0x28c1d2<_0x5476e1;_0x28c1d2++){var _0x666db=events[_0x28c1d2];var _0x548e52=createListener('userNotification:'+_0x666db,_0x2d14dc);UserNotificationEvents['on'](_0x666db,_0x548e52);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index bec32f4..d772eca 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1a97cb,_0x3e174c){var _0x4ab190=function(_0x824a75){while(--_0x824a75){_0x1a97cb['push'](_0x1a97cb['shift']());}};_0x4ab190(++_0x3e174c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x17aec9,_0x2724ad){var _0x5e5792=function(_0x117bc8){while(--_0x117bc8){_0x17aec9['push'](_0x17aec9['shift']());}};_0x5e5792(++_0x2724ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 9c22ad0..480a5e0 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 _0xe419=['INTEGER','sequelize','exports'];(function(_0x22cd08,_0x32958f){var _0x374d68=function(_0x1bfaa8){while(--_0x1bfaa8){_0x22cd08['push'](_0x22cd08['shift']());}};_0x374d68(++_0x32958f);}(_0xe419,0xe5));var _0x9e41=function(_0x47745b,_0x276b1b){_0x47745b=_0x47745b-0x0;var _0x359a2b=_0xe419[_0x47745b];return _0x359a2b;};'use strict';var Sequelize=require(_0x9e41('0x0'));module[_0x9e41('0x1')]={'penalty':{'type':Sequelize[_0x9e41('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbd1e=['exports'];(function(_0x58c409,_0x19b95b){var _0x139d9c=function(_0x457664){while(--_0x457664){_0x58c409['push'](_0x58c409['shift']());}};_0x139d9c(++_0x19b95b);}(_0xbd1e,0x1bc));var _0xebd1=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xbd1e[_0x1b5aea];return _0x15cfc6;};'use strict';var Sequelize=require('sequelize');module[_0xebd1('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'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 dc6dd91..ad905f7 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 _0x91de=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0x239e48,_0x32f01b){var _0x3dd847=function(_0x14bc3f){while(--_0x14bc3f){_0x239e48['push'](_0x239e48['shift']());}};_0x3dd847(++_0x32f01b);}(_0x91de,0x1a4));var _0xe91d=function(_0x4cc8c4,_0x9a7a3f){_0x4cc8c4=_0x4cc8c4-0x0;var _0x3d70f9=_0x91de[_0x4cc8c4];return _0x3d70f9;};'use strict';var _=require(_0xe91d('0x0'));var util=require('util');var logger=require(_0xe91d('0x1'))(_0xe91d('0x2'));var moment=require(_0xe91d('0x3'));var BPromise=require(_0xe91d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe91d('0x5'));var config=require(_0xe91d('0x6'));var attributes=require(_0xe91d('0x7'));module[_0xe91d('0x8')]=function(_0x5be9cb,_0xa492e7){return _0x5be9cb['define'](_0xe91d('0x9'),attributes,{'tableName':_0xe91d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c15=['../../config/logger','moment','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','exports','user_has_openchannel_queues','lodash'];(function(_0x5045ae,_0xa8f881){var _0x5b8aae=function(_0x3245f1){while(--_0x3245f1){_0x5045ae['push'](_0x5045ae['shift']());}};_0x5b8aae(++_0xa8f881);}(_0x9c15,0x143));var _0x59c1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x9c15[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x59c1('0x0'));var util=require('util');var logger=require(_0x59c1('0x1'))('api');var moment=require(_0x59c1('0x2'));var BPromise=require('bluebird');var rp=require(_0x59c1('0x3'));var fs=require('fs');var path=require(_0x59c1('0x4'));var rimraf=require('rimraf');var config=require(_0x59c1('0x5'));var attributes=require(_0x59c1('0x6'));module[_0x59c1('0x7')]=function(_0x177de9,_0x3116e1){return _0x177de9['define']('UserOpenchannelQueue',attributes,{'tableName':_0x59c1('0x8'),'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 b0e5c0e..d1ed448 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 _0xacb6=['info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x503cd5,_0x57774a){var _0x1fdf1e=function(_0x5222cc){while(--_0x5222cc){_0x503cd5['push'](_0x503cd5['shift']());}};_0x1fdf1e(++_0x57774a);}(_0xacb6,0xc6));var _0x6acb=function(_0x28736d,_0x55c30b){_0x28736d=_0x28736d-0x0;var _0x13e2a3=_0xacb6[_0x28736d];return _0x13e2a3;};'use strict';var _=require('lodash');var util=require(_0x6acb('0x0'));var moment=require(_0x6acb('0x1'));var BPromise=require(_0x6acb('0x2'));var rs=require(_0x6acb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6acb('0x4'))['db'];var utils=require(_0x6acb('0x5'));var logger=require(_0x6acb('0x6'))(_0x6acb('0x7'));var config=require(_0x6acb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6acb('0x9')][_0x6acb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x527381,_0x30188c,_0x368b1b){return new BPromise(function(_0x4be0e5,_0x1ddeaf){return client['request'](_0x527381,_0x368b1b)[_0x6acb('0xb')](function(_0x2b0444){logger[_0x6acb('0xc')](_0x6acb('0xd'),_0x30188c,_0x6acb('0xe'));logger['debug'](_0x6acb('0xf'),_0x30188c,_0x6acb('0xe'),JSON[_0x6acb('0x10')](_0x2b0444));if(_0x2b0444['error']){if(_0x2b0444[_0x6acb('0x11')][_0x6acb('0x12')]===0x1f4){logger[_0x6acb('0x11')](_0x6acb('0xd'),_0x30188c,_0x2b0444[_0x6acb('0x11')][_0x6acb('0x13')]);return _0x1ddeaf(_0x2b0444[_0x6acb('0x11')][_0x6acb('0x13')]);}logger[_0x6acb('0x11')](_0x6acb('0xd'),_0x30188c,_0x2b0444[_0x6acb('0x11')][_0x6acb('0x13')]);return _0x4be0e5(_0x2b0444[_0x6acb('0x11')][_0x6acb('0x13')]);}else{logger['info'](_0x6acb('0xd'),_0x30188c,_0x6acb('0xe'));_0x4be0e5(_0x2b0444['result']['message']);}})[_0x6acb('0x14')](function(_0xf6f741){logger[_0x6acb('0x11')](_0x6acb('0xd'),_0x30188c,_0xf6f741);_0x1ddeaf(_0xf6f741);});});} \ No newline at end of file +var _0x3c3f=['info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','debug','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x34e030,_0x57c46d){var _0x1a6406=function(_0x74f5ca){while(--_0x74f5ca){_0x34e030['push'](_0x34e030['shift']());}};_0x1a6406(++_0x57c46d);}(_0x3c3f,0xe0));var _0xf3c3=function(_0x11d95f,_0x34f442){_0x11d95f=_0x11d95f-0x0;var _0x2b1a14=_0x3c3f[_0x11d95f];return _0x2b1a14;};'use strict';var _=require('lodash');var util=require(_0xf3c3('0x0'));var moment=require(_0xf3c3('0x1'));var BPromise=require(_0xf3c3('0x2'));var rs=require(_0xf3c3('0x3'));var fs=require('fs');var Redis=require(_0xf3c3('0x4'));var db=require(_0xf3c3('0x5'))['db'];var utils=require(_0xf3c3('0x6'));var logger=require('../../config/logger')(_0xf3c3('0x7'));var config=require(_0xf3c3('0x8'));var jayson=require(_0xf3c3('0x9'));var client=jayson['client'][_0xf3c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x354ade,_0x348403,_0x5d5e87){return new BPromise(function(_0x592e77,_0x4a0cdd){return client[_0xf3c3('0xb')](_0x354ade,_0x5d5e87)[_0xf3c3('0xc')](function(_0xc9840){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x348403,'request\x20sent');logger[_0xf3c3('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x348403,'request\x20sent',JSON[_0xf3c3('0xe')](_0xc9840));if(_0xc9840[_0xf3c3('0xf')]){if(_0xc9840[_0xf3c3('0xf')]['code']===0x1f4){logger['error'](_0xf3c3('0x10'),_0x348403,_0xc9840[_0xf3c3('0xf')][_0xf3c3('0x11')]);return _0x4a0cdd(_0xc9840[_0xf3c3('0xf')][_0xf3c3('0x11')]);}logger[_0xf3c3('0xf')](_0xf3c3('0x10'),_0x348403,_0xc9840[_0xf3c3('0xf')]['message']);return _0x592e77(_0xc9840[_0xf3c3('0xf')][_0xf3c3('0x11')]);}else{logger[_0xf3c3('0x12')](_0xf3c3('0x10'),_0x348403,_0xf3c3('0x13'));_0x592e77(_0xc9840[_0xf3c3('0x14')][_0xf3c3('0x11')]);}})[_0xf3c3('0x15')](function(_0x2d7a0b){logger[_0xf3c3('0xf')](_0xf3c3('0x10'),_0x348403,_0x2d7a0b);_0x4a0cdd(_0x2d7a0b);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 286e837..1722a51 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 _0x49c1=['express','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','describe','/:id','show','/:id/sections','getSections','/:id/resources','post','create','/:id/clone','clone','addSections','put','update','delete','removeSections','exports','multer','util','path','connect-timeout'];(function(_0x2552ce,_0x37e399){var _0x1dfcde=function(_0x21d05d){while(--_0x21d05d){_0x2552ce['push'](_0x2552ce['shift']());}};_0x1dfcde(++_0x37e399);}(_0x49c1,0x184));var _0x149c=function(_0x472503,_0x2a9134){_0x472503=_0x472503-0x0;var _0x14f65e=_0x49c1[_0x472503];return _0x14f65e;};'use strict';var multer=require(_0x149c('0x0'));var util=require(_0x149c('0x1'));var path=require(_0x149c('0x2'));var timeout=require(_0x149c('0x3'));var express=require(_0x149c('0x4'));var router=express['Router']();var fs_extra=require(_0x149c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x149c('0x6'));var config=require(_0x149c('0x7'));var controller=require(_0x149c('0x8'));router[_0x149c('0x9')]('/',auth[_0x149c('0xa')](),controller[_0x149c('0xb')]);router[_0x149c('0x9')]('/describe',auth[_0x149c('0xa')](),controller[_0x149c('0xc')]);router['get'](_0x149c('0xd'),auth[_0x149c('0xa')](),controller[_0x149c('0xe')]);router['get'](_0x149c('0xf'),auth['isAuthenticated'](),controller[_0x149c('0x10')]);router[_0x149c('0x9')](_0x149c('0x11'),auth[_0x149c('0xa')](),controller['getResources']);router[_0x149c('0x12')]('/',auth[_0x149c('0xa')](),controller[_0x149c('0x13')]);router[_0x149c('0x12')](_0x149c('0x14'),auth['isAuthenticated'](),controller[_0x149c('0x15')]);router[_0x149c('0x12')](_0x149c('0xf'),auth[_0x149c('0xa')](),controller[_0x149c('0x16')]);router[_0x149c('0x12')]('/:id/resources',auth[_0x149c('0xa')](),controller['addResources']);router[_0x149c('0x17')](_0x149c('0xd'),auth[_0x149c('0xa')](),controller[_0x149c('0x18')]);router['delete'](_0x149c('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x149c('0x19')](_0x149c('0xf'),auth[_0x149c('0xa')](),controller[_0x149c('0x1a')]);router[_0x149c('0x19')]('/:id/resources',auth['isAuthenticated'](),controller['removeResources']);module[_0x149c('0x1b')]=router; \ No newline at end of file +var _0xcd31=['describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','clone','addSections','addResources','put','delete','removeSections','removeResources','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','/describe'];(function(_0x1d25ed,_0x4bc048){var _0x502513=function(_0x5b9d99){while(--_0x5b9d99){_0x1d25ed['push'](_0x1d25ed['shift']());}};_0x502513(++_0x4bc048);}(_0xcd31,0x93));var _0x1cd3=function(_0x1616b0,_0xa83df5){_0x1616b0=_0x1616b0-0x0;var _0xb47161=_0xcd31[_0x1616b0];return _0xb47161;};'use strict';var multer=require(_0x1cd3('0x0'));var util=require('util');var path=require(_0x1cd3('0x1'));var timeout=require(_0x1cd3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1cd3('0x3'));var interaction=require(_0x1cd3('0x4'));var config=require('../../config/environment');var controller=require(_0x1cd3('0x5'));router[_0x1cd3('0x6')]('/',auth[_0x1cd3('0x7')](),controller['index']);router[_0x1cd3('0x6')](_0x1cd3('0x8'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0x9')]);router['get'](_0x1cd3('0xa'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0xb')]);router[_0x1cd3('0x6')](_0x1cd3('0xc'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0xd')]);router[_0x1cd3('0x6')](_0x1cd3('0xe'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0xf')]);router[_0x1cd3('0x10')]('/',auth[_0x1cd3('0x7')](),controller[_0x1cd3('0x11')]);router[_0x1cd3('0x10')]('/:id/clone',auth[_0x1cd3('0x7')](),controller[_0x1cd3('0x12')]);router[_0x1cd3('0x10')](_0x1cd3('0xc'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0x13')]);router['post'](_0x1cd3('0xe'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0x14')]);router[_0x1cd3('0x15')](_0x1cd3('0xa'),auth[_0x1cd3('0x7')](),controller['update']);router[_0x1cd3('0x16')]('/:id',auth[_0x1cd3('0x7')](),controller['destroy']);router['delete'](_0x1cd3('0xc'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0x17')]);router[_0x1cd3('0x16')](_0x1cd3('0xe'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0x18')]);module[_0x1cd3('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 42faf02..141217e 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 _0xa593=['sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x38616d,_0x22fbe5){var _0x505626=function(_0x5b3a5a){while(--_0x5b3a5a){_0x38616d['push'](_0x38616d['shift']());}};_0x505626(++_0x22fbe5);}(_0xa593,0x1c2));var _0x3a59=function(_0x30c6c4,_0x247347){_0x30c6c4=_0x30c6c4-0x0;var _0x7f064a=_0xa593[_0x30c6c4];return _0x7f064a;};'use strict';var Sequelize=require(_0x3a59('0x0'));module[_0x3a59('0x1')]={'name':{'type':Sequelize[_0x3a59('0x2')],'allowNull':![],'unique':_0x3a59('0x3')},'crudPermissions':{'type':Sequelize[_0x3a59('0x2')],'set':function(_0x38b893){this[_0x3a59('0x4')](_0x3a59('0x5'),_0x38b893?_0x38b893[_0x3a59('0x6')](''):[]);},'get':function(){return this[_0x3a59('0x7')]('crudPermissions')?this['getDataValue'](_0x3a59('0x5'))[_0x3a59('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x3a59('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x3a59('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x3a59('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x3a59('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x3a59('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x3a59('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x3a59('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf38a=['crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','STRING','setDataValue'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0xf38a,0x8d));var _0xaf38=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xf38a[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require(_0xaf38('0x0'));module['exports']={'name':{'type':Sequelize[_0xaf38('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2c085b){this[_0xaf38('0x2')](_0xaf38('0x3'),_0x2c085b?_0x2c085b[_0xaf38('0x4')](''):[]);},'get':function(){return this[_0xaf38('0x5')](_0xaf38('0x3'))?this[_0xaf38('0x5')](_0xaf38('0x3'))[_0xaf38('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xaf38('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xaf38('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xaf38('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xaf38('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xaf38('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 9e00e60..b6b159d 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 _0xd878=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','filter','where','VIRTUAL','merge','options','UserProfile','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','clone','get','updatedAt','crudPermissions','createdAt','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','omit','userProfileId','Resources','describe','addSections','sectionId','each','push','removeSections','ids','includes','subsections','enabled','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','map','fieldName','type'];(function(_0x1c1b8c,_0x4c253d){var _0x1ee4c4=function(_0xb9bff5){while(--_0xb9bff5){_0x1c1b8c['push'](_0x1c1b8c['shift']());}};_0x1ee4c4(++_0x4c253d);}(_0xd878,0x118));var _0x8d87=function(_0x3351f9,_0x56a55b){_0x3351f9=_0x3351f9-0x0;var _0x4ef69c=_0xd878[_0x3351f9];return _0x4ef69c;};'use strict';var emlformat=require(_0x8d87('0x0'));var rimraf=require(_0x8d87('0x1'));var zipdir=require(_0x8d87('0x2'));var jsonpatch=require(_0x8d87('0x3'));var rp=require(_0x8d87('0x4'));var moment=require(_0x8d87('0x5'));var BPromise=require(_0x8d87('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8d87('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d87('0x8'));var _=require(_0x8d87('0x9'));var squel=require(_0x8d87('0xa'));var crypto=require(_0x8d87('0xb'));var jsforce=require(_0x8d87('0xc'));var deskjs=require(_0x8d87('0xd'));var toCsv=require(_0x8d87('0xe'));var querystring=require(_0x8d87('0xf'));var Papa=require(_0x8d87('0x10'));var Redis=require('ioredis');var authService=require(_0x8d87('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d87('0x12'));var logger=require(_0x8d87('0x13'))(_0x8d87('0x14'));var utils=require(_0x8d87('0x15'));var config=require(_0x8d87('0x16'));var licenseUtil=require(_0x8d87('0x17'));var db=require('../../mysqldb')['db'];config[_0x8d87('0x18')]=_['defaults'](config[_0x8d87('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d87('0x19'))(new Redis(config[_0x8d87('0x18')]));require(_0x8d87('0x1a'))['register'](socket);function respondWithStatusCode(_0x3107dd,_0x53b15e){_0x53b15e=_0x53b15e||0xcc;return function(_0x54ac96){if(_0x54ac96){return _0x3107dd[_0x8d87('0x1b')](_0x53b15e);}return _0x3107dd[_0x8d87('0x1c')](_0x53b15e)[_0x8d87('0x1d')]();};}function respondWithResult(_0x28c54e,_0x262833){_0x262833=_0x262833||0xc8;return function(_0x21d1dc){if(_0x21d1dc){return _0x28c54e['status'](_0x262833)[_0x8d87('0x1e')](_0x21d1dc);}};}function respondWithFilteredResult(_0x3326d5,_0x5b627f){return function(_0x53fe79){if(_0x53fe79){var _0x3e04c8=typeof _0x5b627f[_0x8d87('0x1f')]===_0x8d87('0x20')&&typeof _0x5b627f['limit']===_0x8d87('0x20');var _0x3a3678=_0x53fe79[_0x8d87('0x21')];var _0xde0183=_0x3e04c8?0x0:_0x5b627f[_0x8d87('0x1f')];var _0x2358f1=_0x3e04c8?_0x53fe79[_0x8d87('0x21')]:_0x5b627f[_0x8d87('0x1f')]+_0x5b627f[_0x8d87('0x22')];var _0xfe5cc1;if(_0x2358f1>=_0x3a3678){_0x2358f1=_0x3a3678;_0xfe5cc1=0xc8;}else{_0xfe5cc1=0xce;}_0x3326d5[_0x8d87('0x1c')](_0xfe5cc1);return _0x3326d5[_0x8d87('0x23')](_0x8d87('0x24'),_0xde0183+'-'+_0x2358f1+'/'+_0x3a3678)[_0x8d87('0x1e')](_0x53fe79);}return null;};}function patchUpdates(_0x1d6e42){return function(_0x358998){try{jsonpatch[_0x8d87('0x25')](_0x358998,_0x1d6e42,!![]);}catch(_0x1128f9){return BPromise[_0x8d87('0x26')](_0x1128f9);}return _0x358998['save']();};}function saveUpdates(_0x1ce316,_0x2cd362){return function(_0x5f7030){if(_0x5f7030){return _0x5f7030['update'](_0x1ce316)[_0x8d87('0x27')](function(_0x218ed7){return _0x218ed7;});}return null;};}function removeEntity(_0x46e302,_0x2383b4){return function(_0x35e2f5){if(_0x35e2f5){return _0x35e2f5[_0x8d87('0x28')]()[_0x8d87('0x27')](function(){_0x46e302[_0x8d87('0x1c')](0xcc)[_0x8d87('0x1d')]();});}};}function handleEntityNotFound(_0xa41b40,_0x36f078){return function(_0x2b6aa1){if(!_0x2b6aa1){_0xa41b40[_0x8d87('0x1b')](0x194);}return _0x2b6aa1;};}function handleError(_0x20988d,_0xd70aae){_0xd70aae=_0xd70aae||0x1f4;return function(_0x40f54d){logger[_0x8d87('0x29')](_0x40f54d[_0x8d87('0x2a')]);if(_0x40f54d[_0x8d87('0x2b')]){delete _0x40f54d[_0x8d87('0x2b')];}_0x20988d[_0x8d87('0x1c')](_0xd70aae)['send'](_0x40f54d);};}exports['index']=function(_0x52d932,_0x22aaef){var _0x1b3a71={},_0x3fc8f0={},_0x4638cc={'count':0x0,'rows':[]};var _0x53c29d=_[_0x8d87('0x2c')](db['UserProfile']['rawAttributes'],function(_0x1aad96){return{'name':_0x1aad96[_0x8d87('0x2d')],'type':_0x1aad96[_0x8d87('0x2e')][_0x8d87('0x2f')]};});_0x3fc8f0[_0x8d87('0x30')]=_[_0x8d87('0x2c')](_0x53c29d,_0x8d87('0x2b'));_0x3fc8f0[_0x8d87('0x31')]=_['keys'](_0x52d932[_0x8d87('0x31')]);_0x3fc8f0[_0x8d87('0x32')]=_[_0x8d87('0x33')](_0x3fc8f0[_0x8d87('0x30')],_0x3fc8f0['query']);_0x1b3a71[_0x8d87('0x34')]=_[_0x8d87('0x33')](_0x3fc8f0['model'],qs['fields'](_0x52d932[_0x8d87('0x31')][_0x8d87('0x35')]));_0x1b3a71['attributes']=_0x1b3a71[_0x8d87('0x34')][_0x8d87('0x36')]?_0x1b3a71['attributes']:_0x3fc8f0[_0x8d87('0x30')];if(!_0x52d932[_0x8d87('0x31')][_0x8d87('0x37')]('nolimit')){_0x1b3a71[_0x8d87('0x22')]=qs['limit'](_0x52d932[_0x8d87('0x31')][_0x8d87('0x22')]);_0x1b3a71[_0x8d87('0x1f')]=qs[_0x8d87('0x1f')](_0x52d932['query'][_0x8d87('0x1f')]);}_0x1b3a71[_0x8d87('0x38')]=qs['sort'](_0x52d932['query']['sort']);_0x1b3a71['where']=qs[_0x8d87('0x32')](_[_0x8d87('0x39')](_0x52d932[_0x8d87('0x31')],_0x3fc8f0['filters']),_0x53c29d);if(_0x52d932[_0x8d87('0x31')][_0x8d87('0x3a')]){_0x1b3a71['where']=_['merge'](_0x1b3a71[_0x8d87('0x3b')],{'$or':_[_0x8d87('0x2c')](_0x53c29d,function(_0x554745){if(_0x554745[_0x8d87('0x2e')]!==_0x8d87('0x3c')){var _0x816268={};_0x816268[_0x554745['name']]={'$like':'%'+_0x52d932[_0x8d87('0x31')][_0x8d87('0x3a')]+'%'};return _0x816268;}})});}_0x1b3a71=_[_0x8d87('0x3d')]({},_0x1b3a71,_0x52d932[_0x8d87('0x3e')]);var _0x18ba54={'where':_0x1b3a71[_0x8d87('0x3b')]};return db[_0x8d87('0x3f')][_0x8d87('0x21')](_0x18ba54)['then'](function(_0x1d6a80){_0x4638cc[_0x8d87('0x21')]=_0x1d6a80;if(_0x52d932[_0x8d87('0x31')][_0x8d87('0x40')]){_0x1b3a71[_0x8d87('0x41')]=[{'all':!![]}];}return db[_0x8d87('0x3f')][_0x8d87('0x42')](_0x1b3a71);})[_0x8d87('0x27')](function(_0x2a9893){_0x4638cc[_0x8d87('0x43')]=_0x2a9893;return _0x4638cc;})['then'](respondWithFilteredResult(_0x22aaef,_0x1b3a71))[_0x8d87('0x44')](handleError(_0x22aaef,null));};exports[_0x8d87('0x45')]=function(_0x3146ff,_0x227192){var _0x6452da={'raw':![],'where':{'id':_0x3146ff[_0x8d87('0x46')]['id']}},_0x4591f4={};_0x4591f4[_0x8d87('0x30')]=_[_0x8d87('0x47')](db[_0x8d87('0x3f')][_0x8d87('0x48')]);_0x4591f4['query']=_[_0x8d87('0x47')](_0x3146ff['query']);_0x4591f4[_0x8d87('0x32')]=_[_0x8d87('0x33')](_0x4591f4[_0x8d87('0x30')],_0x4591f4['query']);_0x6452da[_0x8d87('0x34')]=_[_0x8d87('0x33')](_0x4591f4['model'],qs[_0x8d87('0x35')](_0x3146ff[_0x8d87('0x31')]['fields']));_0x6452da[_0x8d87('0x34')]=_0x6452da[_0x8d87('0x34')][_0x8d87('0x36')]?_0x6452da[_0x8d87('0x34')]:_0x4591f4[_0x8d87('0x30')];if(_0x3146ff[_0x8d87('0x31')][_0x8d87('0x40')]){_0x6452da[_0x8d87('0x41')]=[{'all':!![]}];}_0x6452da=_[_0x8d87('0x3d')]({},_0x6452da,_0x3146ff['options']);return db[_0x8d87('0x3f')][_0x8d87('0x49')](_0x6452da)['then'](handleEntityNotFound(_0x227192,null))[_0x8d87('0x27')](respondWithResult(_0x227192,null))[_0x8d87('0x44')](handleError(_0x227192,null));};exports[_0x8d87('0x4a')]=function(_0x2e9526,_0xffbfcb){return db['UserProfile'][_0x8d87('0x4a')](_0x2e9526[_0x8d87('0x4b')],{})[_0x8d87('0x27')](respondWithResult(_0xffbfcb,0xc9))['catch'](handleError(_0xffbfcb,null));};exports[_0x8d87('0x4c')]=function(_0xd08253,_0x591269){var _0x1316fc={'where':{'id':_0xd08253['params']['id']}},_0x205ccc={};_0x205ccc['model']=_[_0x8d87('0x47')](db[_0x8d87('0x3f')][_0x8d87('0x48')]);_0x1316fc[_0x8d87('0x34')]=_[_0x8d87('0x33')](_0x205ccc[_0x8d87('0x30')],qs[_0x8d87('0x35')](_0xd08253['query']['fields']));_0x1316fc[_0x8d87('0x34')]=_0x1316fc['attributes'][_0x8d87('0x36')]?_0x1316fc[_0x8d87('0x34')]:_0x205ccc[_0x8d87('0x30')];if(_0xd08253[_0x8d87('0x31')][_0x8d87('0x40')]){_0x1316fc[_0x8d87('0x41')]=[{'all':!![]}];}_0x1316fc=_[_0x8d87('0x3d')]({},_0x1316fc,_0xd08253['options']);return db['UserProfile'][_0x8d87('0x49')](_0x1316fc)['then'](handleEntityNotFound(_0x591269,null))['then'](function(_0x4a5daa){if(_0x4a5daa){var _0x2ba2ab=_0x4a5daa[_0x8d87('0x4d')]({'plain':!![]});_0x2ba2ab=qs['omit'](_0x2ba2ab,['id','createdAt',_0x8d87('0x4e'),_0x8d87('0x4f')]);_0xd08253['body']=_['omit'](_0xd08253[_0x8d87('0x4b')],['id',_0x8d87('0x50'),'updatedAt']);return db[_0x8d87('0x51')][_0x8d87('0x52')](function(_0x18f80e){return db[_0x8d87('0x3f')][_0x8d87('0x4a')](_[_0x8d87('0x3d')](_0x2ba2ab,_0xd08253[_0x8d87('0x4b')]),{'include':_0xd08253[_0x8d87('0x31')][_0x8d87('0x40')]?[{'all':!![]}]:undefined,'transaction':_0x18f80e})['then'](function(_0x2d8f83){var _0x6b6975=_0x2d8f83['get']({'plain':!![]});return db[_0x8d87('0x53')][_0x8d87('0x42')]({'where':{'userProfileId':_0xd08253[_0x8d87('0x46')]['id']},'raw':!![]})['then'](function(_0x5e17d0){if(_0x5e17d0){return BPromise['each'](_0x5e17d0,function(_0x16ed3f){return new BPromise(function(_0x1987e6,_0x256a4f){if(_0x16ed3f[_0x8d87('0x54')]===null||_0x16ed3f[_0x8d87('0x54')]===0x1)_0x1987e6(null);return db[_0x8d87('0x55')][_0x8d87('0x42')]({'where':{'sectionId':_0x16ed3f['id']},'raw':!![]})[_0x8d87('0x27')](function(_0x481f92){var _0x5a8e8e=_['map'](_0x481f92,function(_0x59eebe){return qs[_0x8d87('0x56')](_0x59eebe,['id',_0x8d87('0x50'),_0x8d87('0x4e'),'sectionId']);});_0x1987e6(_0x5a8e8e);})[_0x8d87('0x44')](function(_0x252654){_0x256a4f(_0x252654);});})[_0x8d87('0x27')](function(_0x3af54a){var _0x2f2875=qs[_0x8d87('0x56')](_0x16ed3f,['id','createdAt','updatedAt']);_0x2f2875[_0x8d87('0x57')]=_0x6b6975['id'];if(_0x3af54a)_0x2f2875[_0x8d87('0x58')]=_0x3af54a;return _0x2f2875;})['then'](function(_0x5da096){return db[_0x8d87('0x53')][_0x8d87('0x4a')](_0x5da096,{'include':[{'model':db[_0x8d87('0x55')],'as':'Resources'}],'raw':!![],'transaction':_0x18f80e});});})[_0x8d87('0x27')](function(){return _0x6b6975;});}});});});}})[_0x8d87('0x27')](respondWithResult(_0x591269,0xc9))[_0x8d87('0x44')](handleError(_0x591269,null));};exports['update']=function(_0x2e09ca,_0x452540){if(_0x2e09ca[_0x8d87('0x4b')]['id']){delete _0x2e09ca['body']['id'];}return db[_0x8d87('0x3f')]['find']({'where':{'id':_0x2e09ca[_0x8d87('0x46')]['id']}})['then'](handleEntityNotFound(_0x452540,null))[_0x8d87('0x27')](saveUpdates(_0x2e09ca[_0x8d87('0x4b')],null))[_0x8d87('0x27')](respondWithResult(_0x452540,null))['catch'](handleError(_0x452540,null));};exports[_0x8d87('0x28')]=function(_0x8e043d,_0xc8186){return db['UserProfile'][_0x8d87('0x49')]({'where':{'id':_0x8e043d['params']['id']}})['then'](handleEntityNotFound(_0xc8186,null))[_0x8d87('0x27')](removeEntity(_0xc8186,null))['catch'](handleError(_0xc8186,null));};exports[_0x8d87('0x59')]=function(_0x5b0fb6,_0x174433){return db[_0x8d87('0x3f')][_0x8d87('0x59')]()['then'](respondWithResult(_0x174433,null))[_0x8d87('0x44')](handleError(_0x174433,null));};exports[_0x8d87('0x5a')]=function(_0x3f462f,_0x3f460f){var _0x3931fa=_0x3f462f[_0x8d87('0x4b')];return db[_0x8d87('0x3f')][_0x8d87('0x49')]({'where':{'id':_0x3f462f[_0x8d87('0x46')]['id']}})[_0x8d87('0x27')](handleEntityNotFound(_0x3f460f,null))['then'](function(_0x3faffd){if(_0x3faffd){return db['sequelize'][_0x8d87('0x52')](function(_0x4ef9af){return db[_0x8d87('0x53')]['destroy']({'where':{'userProfileId':_0x3f462f[_0x8d87('0x46')]['id'],'sectionId':_[_0x8d87('0x2c')](_0x3931fa,function(_0x50a125){return _0x50a125[_0x8d87('0x5b')];})},'transaction':_0x4ef9af})['then'](function(){var _0x1bcf54=_[_0x8d87('0x2c')](_0x3931fa,function(_0x36cb01){_0x36cb01['userProfileId']=_0x3f462f[_0x8d87('0x46')]['id'];return _0x36cb01;});var _0x3ba937=[];return BPromise[_0x8d87('0x5c')](_0x1bcf54,function(_0x402ad0){return db[_0x8d87('0x53')][_0x8d87('0x4a')](_0x402ad0,{'include':[{'model':db['UserProfileResource'],'as':_0x8d87('0x58')}],'raw':!![],'transaction':_0x4ef9af})[_0x8d87('0x27')](function(_0x3f746d){_0x3ba937[_0x8d87('0x5d')](_0x3f746d['get']({'plain':!![]}));});})[_0x8d87('0x27')](function(){return _0x3ba937;});});});}})[_0x8d87('0x27')](function(_0x526126){return _0x526126;})[_0x8d87('0x27')](respondWithResult(_0x3f460f,null))[_0x8d87('0x44')](handleError(_0x3f460f,null));};exports[_0x8d87('0x5e')]=function(_0x45dc53,_0x5573f6){var _0x2bbc06;return db[_0x8d87('0x3f')]['find']({'where':{'id':_0x45dc53[_0x8d87('0x46')]['id']},'attributes':['id',_0x8d87('0x2b')]})['then'](handleEntityNotFound(_0x5573f6,null))[_0x8d87('0x27')](function(_0x20c42c){if(_0x20c42c){_0x2bbc06=_0x20c42c;return db[_0x8d87('0x53')][_0x8d87('0x28')]({'where':{'userProfileId':_0x45dc53[_0x8d87('0x46')]['id'],'sectionId':_0x45dc53[_0x8d87('0x31')][_0x8d87('0x5f')]}});}})['then'](function(){return _0x2bbc06;})['then'](respondWithStatusCode(_0x5573f6,null))['catch'](handleError(_0x5573f6,null));};exports['getSections']=function(_0x5802fa,_0x12e2a7){var _0x4700d0=[];var _0x4be86d=[];return db[_0x8d87('0x53')][_0x8d87('0x42')]({'where':{'userProfileId':_0x5802fa[_0x8d87('0x46')]['id']},'raw':!![]})[_0x8d87('0x27')](function(_0xa2903e){_0x4700d0=_[_0x8d87('0x3a')](_0xa2903e,function(_0x571a22){return _0x571a22['enabled']===0x1||_[_0x8d87('0x60')]([0x3eb,0x709],_0x571a22[_0x8d87('0x5b')]);});if(!_['isEmpty'](_0x4700d0)){return _['map'](_0x4700d0,function(_0x2f5e5b){return _0x2f5e5b['sectionId'];});}else{return;}})[_0x8d87('0x27')](function(_0x4daa2d){if(_0x4daa2d)_0x4be86d=_0x4daa2d;if(_[_0x8d87('0x60')](_0x4be86d,0x64)){var _0x3c0b02=_[_0x8d87('0x49')](_0x4700d0,{'sectionId':0x64});return hasDefaultDashboard(_0x3c0b02)[_0x8d87('0x27')](function(_0x9748c4){return _[_0x8d87('0x2c')](_0x4700d0,function(_0x4e670b){if(_0x4e670b['sectionId']===0x64){_0x4e670b[_0x8d87('0x61')]=_0x9748c4;}return _0x4e670b;});});}else{return;}})[_0x8d87('0x27')](function(_0x3eb3a3){if(_0x3eb3a3)_0x4700d0=_0x3eb3a3;if(_['includes'](_0x4be86d,0x3eb)){var _0x8b2319=_['find'](_0x4700d0,{'sectionId':0x3eb});return getCustomDashboards(_0x8b2319)[_0x8d87('0x27')](function(_0x3274a3){return _[_0x8d87('0x2c')](_0x4700d0,function(_0x23e3fc){if(_0x8b2319[_0x8d87('0x62')]){if(_0x23e3fc['sectionId']===0x3eb){_0x23e3fc[_0x8d87('0x61')]=_0x3274a3;}}else{if(_0x23e3fc[_0x8d87('0x5b')]===0x64){_0x23e3fc[_0x8d87('0x61')]=_0x3274a3;}}return _0x23e3fc;});});}else{return;}})[_0x8d87('0x27')](function(_0x20f611){if(_0x20f611)_0x4700d0=_0x20f611;if(_[_0x8d87('0x60')](_0x4be86d,0x709)){var _0x5d3f91=_[_0x8d87('0x49')](_0x4700d0,{'sectionId':0x709});return getPlugins(_0x5d3f91)[_0x8d87('0x27')](function(_0x55faa4){if(_0x5d3f91['enabled']){return _[_0x8d87('0x2c')](_0x4700d0,function(_0x3b7ec2){if(_0x3b7ec2[_0x8d87('0x5b')]===0x709){_0x3b7ec2[_0x8d87('0x61')]=_0x55faa4;}return _0x3b7ec2;});}else{var _0x492643={'sectionId':0x76c,'enabled':0x1,'subsections':_0x55faa4};var _0x1ca6a2=_[_0x8d87('0x2c')](_0x4700d0);_0x1ca6a2[_0x8d87('0x5d')](_0x492643);return _0x1ca6a2;}});}else{return;}})[_0x8d87('0x27')](function(_0x5b170c){if(_0x5b170c)_0x4700d0=_0x5b170c;return _['filter'](_0x4700d0,[_0x8d87('0x62'),0x1]);})[_0x8d87('0x27')](respondWithResult(_0x12e2a7,null))[_0x8d87('0x44')](handleError(_0x12e2a7,null));};function hasDefaultDashboard(_0x55cf73){var _0x44abb0=[0x65];return new BPromise(function(_0x3395b9,_0x2ff357){try{if(_0x55cf73[_0x8d87('0x54')]){_0x3395b9(_0x44abb0);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x55cf73['id']},'raw':!![]})[_0x8d87('0x27')](function(_0x3cbe76){_0x3cbe76?_0x3395b9(_0x44abb0):_0x3395b9();});}}catch(_0x58aa26){_0x2ff357(_0x58aa26);}});}function getCustomDashboards(_0x527c43){var _0x28f48f=[];return new BPromise(function(_0x472666,_0x6e7a18){try{if(_0x527c43[_0x8d87('0x54')]){return db['Dashboard']['findAll']({'raw':!![]})[_0x8d87('0x27')](function(_0x399190){_0x399190['forEach'](function(_0x107acb){_0x28f48f[_0x8d87('0x5d')](_0x107acb['id']+0x1869f);});_0x472666(_0x28f48f);});}else{return db[_0x8d87('0x55')][_0x8d87('0x42')]({'where':{'sectionId':_0x527c43['id']},'raw':!![]})[_0x8d87('0x27')](function(_0x30464a){_0x30464a[_0x8d87('0x63')](function(_0x281220){_0x28f48f[_0x8d87('0x5d')](_0x281220[_0x8d87('0x64')]+0x1869f);});_0x472666(_0x28f48f);});}}catch(_0x1a3321){_0x6e7a18(_0x1a3321);}});}function getPlugins(_0x545c8d){var _0x2d04f6=[];return new BPromise(function(_0x1ce591,_0x41754e){try{if(_0x545c8d[_0x8d87('0x54')]){return db['Plugin'][_0x8d87('0x42')]({'raw':!![]})['then'](function(_0xb7cb31){_0xb7cb31[_0x8d87('0x63')](function(_0x27e72f){_0x2d04f6[_0x8d87('0x5d')](_0x27e72f['id']+0x15b38);});_0x1ce591(_0x2d04f6);});}else{return db[_0x8d87('0x55')][_0x8d87('0x42')]({'where':{'sectionId':_0x545c8d['id']},'raw':!![]})[_0x8d87('0x27')](function(_0x5b1faa){_0x5b1faa[_0x8d87('0x63')](function(_0xce1f09){_0x2d04f6['push'](_0xce1f09[_0x8d87('0x64')]+0x15b38);});_0x1ce591(_0x2d04f6);});}}catch(_0x336572){_0x41754e(_0x336572);}});}exports[_0x8d87('0x65')]=function(_0xf3a391,_0x21f3c9){return db[_0x8d87('0x3f')][_0x8d87('0x49')]({'where':{'id':_0xf3a391[_0x8d87('0x46')]['id']}})[_0x8d87('0x27')](handleEntityNotFound(_0x21f3c9,null))[_0x8d87('0x27')](function(_0x2498c0){if(_0x2498c0){return db[_0x8d87('0x51')][_0x8d87('0x52')](function(_0x3dd619){return db[_0x8d87('0x53')][_0x8d87('0x42')]({'where':{'userProfileId':_0xf3a391[_0x8d87('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x8d87('0x27')](function(_0x1cb525){if(_0x1cb525){return db['UserProfileSection'][_0x8d87('0x28')]({'where':{'userProfileId':_0xf3a391['params']['id'],'id':_[_0x8d87('0x2c')](_0x1cb525,function(_0x6af51d){return _0x6af51d['id'];})},'transaction':_0x3dd619});}})['then'](function(_0x1b09fc){var _0x27e561=_[_0x8d87('0x2c')](_0xf3a391[_0x8d87('0x4b')],function(_0x4b7a2b){_0x4b7a2b[_0x8d87('0x57')]=_0xf3a391[_0x8d87('0x46')]['id'];return _0x4b7a2b;});return db[_0x8d87('0x53')][_0x8d87('0x66')](_0x27e561,{'raw':!![],'transaction':_0x3dd619});})[_0x8d87('0x27')](function(_0x3ba247){var _0x1f958b=_['filter'](_[_0x8d87('0x2c')](_0x3ba247,function(_0x120be5){return _0x120be5[_0x8d87('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x1f958b){return db[_0x8d87('0x53')][_0x8d87('0x42')]({'where':{'userProfileId':_0xf3a391[_0x8d87('0x46')]['id'],'sectionId':_[_0x8d87('0x2c')](_0x1f958b,function(_0x27ac8f){return _0x27ac8f[_0x8d87('0x5b')];})},'attributes':['id',_0x8d87('0x5b')],'raw':!![]})[_0x8d87('0x27')](function(_0x112bdd){var _0x154de7=_[_0x8d87('0x2c')](_0xf3a391[_0x8d87('0x4b')],function(_0x4e132e){_0x4e132e[_0x8d87('0x57')]=_0xf3a391[_0x8d87('0x46')]['id'];return _0x4e132e;});return db[_0x8d87('0x55')]['bulkCreate'](_0x154de7,{'raw':!![],'transaction':_0x3dd619});});}})['catch'](handleError(_0x21f3c9,null));});}})[_0x8d87('0x27')](function(_0x317010){var _0x3a101e=_['map'](_0x317010,function(_0x4375b1){return _0x4375b1[_0x8d87('0x4d')]({'plain':!![]});});})[_0x8d87('0x27')](respondWithResult(_0x21f3c9,null))[_0x8d87('0x44')](handleError(_0x21f3c9,null));};exports[_0x8d87('0x67')]=function(_0x9a784e,_0x11388e,_0x3f1dde){return db[_0x8d87('0x3f')]['find']({'where':{'id':_0x9a784e[_0x8d87('0x46')]['id']}})['then'](handleEntityNotFound(_0x11388e,null))['then'](function(_0x409eed){if(_0x409eed){return _0x409eed[_0x8d87('0x67')](_0x9a784e[_0x8d87('0x31')][_0x8d87('0x5f')]);}})[_0x8d87('0x27')](respondWithStatusCode(_0x11388e,null))[_0x8d87('0x44')](handleError(_0x11388e,null));};exports[_0x8d87('0x68')]=function(_0x3332b7,_0x2d426b){var _0x17da06={};if(!_0x3332b7['query'][_0x8d87('0x69')])throw new Error(_0x8d87('0x6a'));if(!_0x3332b7[_0x8d87('0x31')]['hasOwnProperty'](_0x8d87('0x6b'))){_0x17da06[_0x8d87('0x22')]=qs['limit'](_0x3332b7['query'][_0x8d87('0x22')]);_0x17da06[_0x8d87('0x1f')]=qs['offset'](_0x3332b7[_0x8d87('0x31')][_0x8d87('0x1f')]);}return db[_0x8d87('0x3f')][_0x8d87('0x49')]({'where':{'id':_0x3332b7[_0x8d87('0x46')]['id']}})[_0x8d87('0x27')](function(_0x541011){if(!_0x541011)throw new Error(_0x8d87('0x6c')+_0x3332b7[_0x8d87('0x46')]['id']);return db[_0x8d87('0x3f')]['getResources'](_0x3332b7);})[_0x8d87('0x27')](respondWithFilteredResult(_0x2d426b,_0x17da06))[_0x8d87('0x44')](handleError(_0x2d426b,null));}; \ No newline at end of file +var _0xeba2=['mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','type','VIRTUAL','options','UserProfile','includeAll','include','rows','catch','show','params','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','each','autoAssociation','UserProfileResource','userProfileId','Resources','UserProfileSection','destroy','describe','addSections','sectionId','removeSections','ids','getSections','findAll','enabled','includes','isEmpty','subsections','push','findOne','resourceId','Plugin','forEach','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x79b53e,_0x108f8d){var _0x2d4d6c=function(_0x256d7f){while(--_0x256d7f){_0x79b53e['push'](_0x79b53e['shift']());}};_0x2d4d6c(++_0x108f8d);}(_0xeba2,0x70));var _0x2eba=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0xeba2[_0x171fdc];return _0x3782ea;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2eba('0x0'));var jsonpatch=require(_0x2eba('0x1'));var rp=require(_0x2eba('0x2'));var moment=require(_0x2eba('0x3'));var BPromise=require(_0x2eba('0x4'));var Mustache=require(_0x2eba('0x5'));var util=require(_0x2eba('0x6'));var path=require(_0x2eba('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2eba('0x8'));var _=require(_0x2eba('0x9'));var squel=require(_0x2eba('0xa'));var crypto=require('crypto');var jsforce=require(_0x2eba('0xb'));var deskjs=require(_0x2eba('0xc'));var toCsv=require(_0x2eba('0xd'));var querystring=require(_0x2eba('0xe'));var Papa=require(_0x2eba('0xf'));var Redis=require(_0x2eba('0x10'));var authService=require(_0x2eba('0x11'));var qs=require(_0x2eba('0x12'));var as=require(_0x2eba('0x13'));var hardwareService=require(_0x2eba('0x14'));var logger=require('../../config/logger')(_0x2eba('0x15'));var utils=require(_0x2eba('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2eba('0x17'));var db=require(_0x2eba('0x18'))['db'];config[_0x2eba('0x19')]=_[_0x2eba('0x1a')](config[_0x2eba('0x19')],{'host':_0x2eba('0x1b'),'port':0x18eb});var socket=require(_0x2eba('0x1c'))(new Redis(config['redis']));require('./userProfile.socket')[_0x2eba('0x1d')](socket);function respondWithStatusCode(_0x12f03c,_0x2ff357){_0x2ff357=_0x2ff357||0xcc;return function(_0x427957){if(_0x427957){return _0x12f03c[_0x2eba('0x1e')](_0x2ff357);}return _0x12f03c['status'](_0x2ff357)[_0x2eba('0x1f')]();};}function respondWithResult(_0x475f6f,_0x43f417){_0x43f417=_0x43f417||0xc8;return function(_0x3e5664){if(_0x3e5664){return _0x475f6f[_0x2eba('0x20')](_0x43f417)['json'](_0x3e5664);}};}function respondWithFilteredResult(_0x333a70,_0x52b189){return function(_0x48bccc){if(_0x48bccc){var _0x33246d=typeof _0x52b189[_0x2eba('0x21')]===_0x2eba('0x22')&&typeof _0x52b189[_0x2eba('0x23')]===_0x2eba('0x22');var _0x2683ed=_0x48bccc[_0x2eba('0x24')];var _0x56574e=_0x33246d?0x0:_0x52b189[_0x2eba('0x21')];var _0x3fc6c9=_0x33246d?_0x48bccc[_0x2eba('0x24')]:_0x52b189[_0x2eba('0x21')]+_0x52b189[_0x2eba('0x23')];var _0x51124e;if(_0x3fc6c9>=_0x2683ed){_0x3fc6c9=_0x2683ed;_0x51124e=0xc8;}else{_0x51124e=0xce;}_0x333a70[_0x2eba('0x20')](_0x51124e);return _0x333a70['set']('Content-Range',_0x56574e+'-'+_0x3fc6c9+'/'+_0x2683ed)['json'](_0x48bccc);}return null;};}function patchUpdates(_0x10d89){return function(_0x2fef0d){try{jsonpatch[_0x2eba('0x25')](_0x2fef0d,_0x10d89,!![]);}catch(_0x2067e4){return BPromise[_0x2eba('0x26')](_0x2067e4);}return _0x2fef0d['save']();};}function saveUpdates(_0x163cd9,_0x2405cd){return function(_0x4788be){if(_0x4788be){return _0x4788be[_0x2eba('0x27')](_0x163cd9)['then'](function(_0x2e5bc6){return _0x2e5bc6;});}return null;};}function removeEntity(_0x448583,_0x38e43c){return function(_0x2f692e){if(_0x2f692e){return _0x2f692e['destroy']()[_0x2eba('0x28')](function(){_0x448583[_0x2eba('0x20')](0xcc)[_0x2eba('0x1f')]();});}};}function handleEntityNotFound(_0x1cf897,_0x3d8d31){return function(_0xe6cf1e){if(!_0xe6cf1e){_0x1cf897[_0x2eba('0x1e')](0x194);}return _0xe6cf1e;};}function handleError(_0x4f3bca,_0x24dd4a){_0x24dd4a=_0x24dd4a||0x1f4;return function(_0x423c6f){logger[_0x2eba('0x29')](_0x423c6f[_0x2eba('0x2a')]);if(_0x423c6f[_0x2eba('0x2b')]){delete _0x423c6f[_0x2eba('0x2b')];}_0x4f3bca[_0x2eba('0x20')](_0x24dd4a)[_0x2eba('0x2c')](_0x423c6f);};}exports[_0x2eba('0x2d')]=function(_0x3ae9e6,_0x49f47a){var _0xa75582={},_0x1c63e9={},_0xfa85f9={'count':0x0,'rows':[]};var _0x199de6=_[_0x2eba('0x2e')](db['UserProfile'][_0x2eba('0x2f')],function(_0x130587){return{'name':_0x130587[_0x2eba('0x30')],'type':_0x130587['type'][_0x2eba('0x31')]};});_0x1c63e9[_0x2eba('0x32')]=_['map'](_0x199de6,'name');_0x1c63e9[_0x2eba('0x33')]=_[_0x2eba('0x34')](_0x3ae9e6[_0x2eba('0x33')]);_0x1c63e9[_0x2eba('0x35')]=_[_0x2eba('0x36')](_0x1c63e9[_0x2eba('0x32')],_0x1c63e9[_0x2eba('0x33')]);_0xa75582[_0x2eba('0x37')]=_['intersection'](_0x1c63e9[_0x2eba('0x32')],qs[_0x2eba('0x38')](_0x3ae9e6[_0x2eba('0x33')][_0x2eba('0x38')]));_0xa75582['attributes']=_0xa75582[_0x2eba('0x37')][_0x2eba('0x39')]?_0xa75582[_0x2eba('0x37')]:_0x1c63e9[_0x2eba('0x32')];if(!_0x3ae9e6[_0x2eba('0x33')][_0x2eba('0x3a')]('nolimit')){_0xa75582[_0x2eba('0x23')]=qs[_0x2eba('0x23')](_0x3ae9e6['query'][_0x2eba('0x23')]);_0xa75582[_0x2eba('0x21')]=qs[_0x2eba('0x21')](_0x3ae9e6[_0x2eba('0x33')][_0x2eba('0x21')]);}_0xa75582[_0x2eba('0x3b')]=qs[_0x2eba('0x3c')](_0x3ae9e6[_0x2eba('0x33')][_0x2eba('0x3c')]);_0xa75582['where']=qs[_0x2eba('0x35')](_[_0x2eba('0x3d')](_0x3ae9e6['query'],_0x1c63e9[_0x2eba('0x35')]),_0x199de6);if(_0x3ae9e6['query'][_0x2eba('0x3e')]){_0xa75582['where']=_[_0x2eba('0x3f')](_0xa75582[_0x2eba('0x40')],{'$or':_[_0x2eba('0x2e')](_0x199de6,function(_0x31295d){if(_0x31295d[_0x2eba('0x41')]!==_0x2eba('0x42')){var _0x1df7ff={};_0x1df7ff[_0x31295d['name']]={'$like':'%'+_0x3ae9e6['query'][_0x2eba('0x3e')]+'%'};return _0x1df7ff;}})});}_0xa75582=_[_0x2eba('0x3f')]({},_0xa75582,_0x3ae9e6[_0x2eba('0x43')]);var _0x40597c={'where':_0xa75582[_0x2eba('0x40')]};return db[_0x2eba('0x44')]['count'](_0x40597c)[_0x2eba('0x28')](function(_0x1c59b0){_0xfa85f9[_0x2eba('0x24')]=_0x1c59b0;if(_0x3ae9e6[_0x2eba('0x33')][_0x2eba('0x45')]){_0xa75582[_0x2eba('0x46')]=[{'all':!![]}];}return db[_0x2eba('0x44')]['findAll'](_0xa75582);})[_0x2eba('0x28')](function(_0x48152d){_0xfa85f9[_0x2eba('0x47')]=_0x48152d;return _0xfa85f9;})['then'](respondWithFilteredResult(_0x49f47a,_0xa75582))[_0x2eba('0x48')](handleError(_0x49f47a,null));};exports[_0x2eba('0x49')]=function(_0x13eca7,_0x1d91b3){var _0x427cd4={'raw':![],'where':{'id':_0x13eca7[_0x2eba('0x4a')]['id']}},_0x578f83={};_0x578f83['model']=_[_0x2eba('0x34')](db['UserProfile'][_0x2eba('0x2f')]);_0x578f83[_0x2eba('0x33')]=_[_0x2eba('0x34')](_0x13eca7[_0x2eba('0x33')]);_0x578f83[_0x2eba('0x35')]=_['intersection'](_0x578f83[_0x2eba('0x32')],_0x578f83[_0x2eba('0x33')]);_0x427cd4[_0x2eba('0x37')]=_[_0x2eba('0x36')](_0x578f83[_0x2eba('0x32')],qs['fields'](_0x13eca7[_0x2eba('0x33')][_0x2eba('0x38')]));_0x427cd4[_0x2eba('0x37')]=_0x427cd4['attributes'][_0x2eba('0x39')]?_0x427cd4['attributes']:_0x578f83[_0x2eba('0x32')];if(_0x13eca7[_0x2eba('0x33')]['includeAll']){_0x427cd4[_0x2eba('0x46')]=[{'all':!![]}];}_0x427cd4=_['merge']({},_0x427cd4,_0x13eca7[_0x2eba('0x43')]);return db[_0x2eba('0x44')][_0x2eba('0x4b')](_0x427cd4)[_0x2eba('0x28')](handleEntityNotFound(_0x1d91b3,null))['then'](respondWithResult(_0x1d91b3,null))[_0x2eba('0x48')](handleError(_0x1d91b3,null));};exports[_0x2eba('0x4c')]=function(_0x173d7a,_0x1ca193){return db[_0x2eba('0x44')][_0x2eba('0x4c')](_0x173d7a[_0x2eba('0x4d')],{})['then'](respondWithResult(_0x1ca193,0xc9))['catch'](handleError(_0x1ca193,null));};exports[_0x2eba('0x4e')]=function(_0x39b67e,_0x28df2a){var _0x1743a5={'where':{'id':_0x39b67e[_0x2eba('0x4a')]['id']}},_0x390d24={};_0x390d24[_0x2eba('0x32')]=_['keys'](db[_0x2eba('0x44')][_0x2eba('0x2f')]);_0x1743a5[_0x2eba('0x37')]=_[_0x2eba('0x36')](_0x390d24[_0x2eba('0x32')],qs[_0x2eba('0x38')](_0x39b67e['query']['fields']));_0x1743a5[_0x2eba('0x37')]=_0x1743a5[_0x2eba('0x37')]['length']?_0x1743a5[_0x2eba('0x37')]:_0x390d24['model'];if(_0x39b67e[_0x2eba('0x33')][_0x2eba('0x45')]){_0x1743a5[_0x2eba('0x46')]=[{'all':!![]}];}_0x1743a5=_[_0x2eba('0x3f')]({},_0x1743a5,_0x39b67e[_0x2eba('0x43')]);return db[_0x2eba('0x44')]['find'](_0x1743a5)[_0x2eba('0x28')](handleEntityNotFound(_0x28df2a,null))[_0x2eba('0x28')](function(_0x5c099f){if(_0x5c099f){var _0x3701fb=_0x5c099f[_0x2eba('0x4f')]({'plain':!![]});_0x3701fb=qs[_0x2eba('0x50')](_0x3701fb,['id',_0x2eba('0x51'),_0x2eba('0x52'),_0x2eba('0x53')]);_0x39b67e['body']=_[_0x2eba('0x50')](_0x39b67e[_0x2eba('0x4d')],['id',_0x2eba('0x51'),_0x2eba('0x52')]);return db[_0x2eba('0x54')][_0x2eba('0x55')](function(_0x165c83){return db[_0x2eba('0x44')][_0x2eba('0x4c')](_['merge'](_0x3701fb,_0x39b67e['body']),{'include':_0x39b67e[_0x2eba('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x165c83})[_0x2eba('0x28')](function(_0x43f107){var _0x3ed15f=_0x43f107[_0x2eba('0x4f')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x39b67e[_0x2eba('0x4a')]['id']},'raw':!![]})['then'](function(_0x5aa9ec){if(_0x5aa9ec){return BPromise[_0x2eba('0x56')](_0x5aa9ec,function(_0x20eea3){return new BPromise(function(_0x52710c,_0x3c8159){if(_0x20eea3[_0x2eba('0x57')]===null||_0x20eea3[_0x2eba('0x57')]===0x1)_0x52710c(null);return db[_0x2eba('0x58')]['findAll']({'where':{'sectionId':_0x20eea3['id']},'raw':!![]})[_0x2eba('0x28')](function(_0x1cd701){var _0x2c0a66=_[_0x2eba('0x2e')](_0x1cd701,function(_0x5375c8){return qs[_0x2eba('0x50')](_0x5375c8,['id','createdAt',_0x2eba('0x52'),'sectionId']);});_0x52710c(_0x2c0a66);})['catch'](function(_0x553978){_0x3c8159(_0x553978);});})['then'](function(_0x343c34){var _0x1f6ba9=qs[_0x2eba('0x50')](_0x20eea3,['id',_0x2eba('0x51'),_0x2eba('0x52')]);_0x1f6ba9[_0x2eba('0x59')]=_0x3ed15f['id'];if(_0x343c34)_0x1f6ba9[_0x2eba('0x5a')]=_0x343c34;return _0x1f6ba9;})[_0x2eba('0x28')](function(_0x2061cc){return db[_0x2eba('0x5b')][_0x2eba('0x4c')](_0x2061cc,{'include':[{'model':db[_0x2eba('0x58')],'as':_0x2eba('0x5a')}],'raw':!![],'transaction':_0x165c83});});})[_0x2eba('0x28')](function(){return _0x3ed15f;});}});});});}})[_0x2eba('0x28')](respondWithResult(_0x28df2a,0xc9))[_0x2eba('0x48')](handleError(_0x28df2a,null));};exports['update']=function(_0x5ee2a3,_0x25465a){if(_0x5ee2a3['body']['id']){delete _0x5ee2a3[_0x2eba('0x4d')]['id'];}return db[_0x2eba('0x44')][_0x2eba('0x4b')]({'where':{'id':_0x5ee2a3[_0x2eba('0x4a')]['id']}})[_0x2eba('0x28')](handleEntityNotFound(_0x25465a,null))[_0x2eba('0x28')](saveUpdates(_0x5ee2a3[_0x2eba('0x4d')],null))[_0x2eba('0x28')](respondWithResult(_0x25465a,null))[_0x2eba('0x48')](handleError(_0x25465a,null));};exports[_0x2eba('0x5c')]=function(_0x4795fe,_0x99c331){return db[_0x2eba('0x44')][_0x2eba('0x4b')]({'where':{'id':_0x4795fe[_0x2eba('0x4a')]['id']}})[_0x2eba('0x28')](handleEntityNotFound(_0x99c331,null))[_0x2eba('0x28')](removeEntity(_0x99c331,null))[_0x2eba('0x48')](handleError(_0x99c331,null));};exports[_0x2eba('0x5d')]=function(_0x46527a,_0x12b464){return db[_0x2eba('0x44')]['describe']()['then'](respondWithResult(_0x12b464,null))['catch'](handleError(_0x12b464,null));};exports[_0x2eba('0x5e')]=function(_0x2e340e,_0x49e8c0){var _0x13c919=_0x2e340e['body'];return db[_0x2eba('0x44')][_0x2eba('0x4b')]({'where':{'id':_0x2e340e[_0x2eba('0x4a')]['id']}})[_0x2eba('0x28')](handleEntityNotFound(_0x49e8c0,null))[_0x2eba('0x28')](function(_0x686900){if(_0x686900){return db[_0x2eba('0x54')][_0x2eba('0x55')](function(_0x184090){return db['UserProfileSection'][_0x2eba('0x5c')]({'where':{'userProfileId':_0x2e340e[_0x2eba('0x4a')]['id'],'sectionId':_[_0x2eba('0x2e')](_0x13c919,function(_0x3cfecd){return _0x3cfecd[_0x2eba('0x5f')];})},'transaction':_0x184090})[_0x2eba('0x28')](function(){var _0x5a4ac5=_['map'](_0x13c919,function(_0x255353){_0x255353[_0x2eba('0x59')]=_0x2e340e[_0x2eba('0x4a')]['id'];return _0x255353;});var _0x25ae06=[];return BPromise[_0x2eba('0x56')](_0x5a4ac5,function(_0x51df3c){return db[_0x2eba('0x5b')][_0x2eba('0x4c')](_0x51df3c,{'include':[{'model':db[_0x2eba('0x58')],'as':_0x2eba('0x5a')}],'raw':!![],'transaction':_0x184090})[_0x2eba('0x28')](function(_0x18b39a){_0x25ae06['push'](_0x18b39a[_0x2eba('0x4f')]({'plain':!![]}));});})[_0x2eba('0x28')](function(){return _0x25ae06;});});});}})[_0x2eba('0x28')](function(_0x40d65c){return _0x40d65c;})[_0x2eba('0x28')](respondWithResult(_0x49e8c0,null))[_0x2eba('0x48')](handleError(_0x49e8c0,null));};exports[_0x2eba('0x60')]=function(_0x11ef22,_0xc2d925){var _0x2d04e2;return db[_0x2eba('0x44')]['find']({'where':{'id':_0x11ef22[_0x2eba('0x4a')]['id']},'attributes':['id','name']})[_0x2eba('0x28')](handleEntityNotFound(_0xc2d925,null))[_0x2eba('0x28')](function(_0x11f0a9){if(_0x11f0a9){_0x2d04e2=_0x11f0a9;return db['UserProfileSection'][_0x2eba('0x5c')]({'where':{'userProfileId':_0x11ef22['params']['id'],'sectionId':_0x11ef22[_0x2eba('0x33')][_0x2eba('0x61')]}});}})[_0x2eba('0x28')](function(){return _0x2d04e2;})['then'](respondWithStatusCode(_0xc2d925,null))[_0x2eba('0x48')](handleError(_0xc2d925,null));};exports[_0x2eba('0x62')]=function(_0x4a0dd4,_0x45aed9){var _0x10e814=[];var _0x1d4957=[];return db[_0x2eba('0x5b')][_0x2eba('0x63')]({'where':{'userProfileId':_0x4a0dd4['params']['id']},'raw':!![]})[_0x2eba('0x28')](function(_0x310aa3){_0x10e814=_['filter'](_0x310aa3,function(_0x168aab){return _0x168aab[_0x2eba('0x64')]===0x1||_[_0x2eba('0x65')]([0x3eb,0x709],_0x168aab[_0x2eba('0x5f')]);});if(!_[_0x2eba('0x66')](_0x10e814)){return _[_0x2eba('0x2e')](_0x10e814,function(_0x14e91f){return _0x14e91f[_0x2eba('0x5f')];});}else{return;}})['then'](function(_0x5cbc3f){if(_0x5cbc3f)_0x1d4957=_0x5cbc3f;if(_[_0x2eba('0x65')](_0x1d4957,0x64)){var _0x577fb7=_[_0x2eba('0x4b')](_0x10e814,{'sectionId':0x64});return hasDefaultDashboard(_0x577fb7)[_0x2eba('0x28')](function(_0x4af56e){return _[_0x2eba('0x2e')](_0x10e814,function(_0x792cdf){if(_0x792cdf[_0x2eba('0x5f')]===0x64){_0x792cdf[_0x2eba('0x67')]=_0x4af56e;}return _0x792cdf;});});}else{return;}})['then'](function(_0x30cdd2){if(_0x30cdd2)_0x10e814=_0x30cdd2;if(_[_0x2eba('0x65')](_0x1d4957,0x3eb)){var _0x58c61d=_[_0x2eba('0x4b')](_0x10e814,{'sectionId':0x3eb});return getCustomDashboards(_0x58c61d)[_0x2eba('0x28')](function(_0x4667b2){return _[_0x2eba('0x2e')](_0x10e814,function(_0x1ade75){if(_0x58c61d['enabled']){if(_0x1ade75[_0x2eba('0x5f')]===0x3eb){_0x1ade75['subsections']=_0x4667b2;}}else{if(_0x1ade75['sectionId']===0x64){_0x1ade75[_0x2eba('0x67')]=_0x4667b2;}}return _0x1ade75;});});}else{return;}})[_0x2eba('0x28')](function(_0x12ef1e){if(_0x12ef1e)_0x10e814=_0x12ef1e;if(_[_0x2eba('0x65')](_0x1d4957,0x709)){var _0x5f511c=_[_0x2eba('0x4b')](_0x10e814,{'sectionId':0x709});return getPlugins(_0x5f511c)[_0x2eba('0x28')](function(_0x58e1a2){if(_0x5f511c[_0x2eba('0x64')]){return _['map'](_0x10e814,function(_0x1aa20b){if(_0x1aa20b[_0x2eba('0x5f')]===0x709){_0x1aa20b[_0x2eba('0x67')]=_0x58e1a2;}return _0x1aa20b;});}else{var _0x51c78b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x58e1a2};var _0x46fa3e=_[_0x2eba('0x2e')](_0x10e814);_0x46fa3e[_0x2eba('0x68')](_0x51c78b);return _0x46fa3e;}});}else{return;}})[_0x2eba('0x28')](function(_0x3f14e7){if(_0x3f14e7)_0x10e814=_0x3f14e7;return _[_0x2eba('0x3e')](_0x10e814,[_0x2eba('0x64'),0x1]);})[_0x2eba('0x28')](respondWithResult(_0x45aed9,null))[_0x2eba('0x48')](handleError(_0x45aed9,null));};function hasDefaultDashboard(_0x3b04f5){var _0x525dce=[0x65];return new BPromise(function(_0xd90f38,_0x43717f){try{if(_0x3b04f5[_0x2eba('0x57')]){_0xd90f38(_0x525dce);}else{return db[_0x2eba('0x58')][_0x2eba('0x69')]({'where':{'sectionId':_0x3b04f5['id']},'raw':!![]})['then'](function(_0x5c2175){_0x5c2175?_0xd90f38(_0x525dce):_0xd90f38();});}}catch(_0x3fe674){_0x43717f(_0x3fe674);}});}function getCustomDashboards(_0xa6070d){var _0x21bf10=[];return new BPromise(function(_0x366fb1,_0x28e395){try{if(_0xa6070d['autoAssociation']){return db['Dashboard'][_0x2eba('0x63')]({'raw':!![]})['then'](function(_0x3e4fea){_0x3e4fea['forEach'](function(_0x4ed626){_0x21bf10[_0x2eba('0x68')](_0x4ed626['id']+0x1869f);});_0x366fb1(_0x21bf10);});}else{return db[_0x2eba('0x58')][_0x2eba('0x63')]({'where':{'sectionId':_0xa6070d['id']},'raw':!![]})['then'](function(_0x55219b){_0x55219b['forEach'](function(_0x400842){_0x21bf10[_0x2eba('0x68')](_0x400842[_0x2eba('0x6a')]+0x1869f);});_0x366fb1(_0x21bf10);});}}catch(_0x121a5a){_0x28e395(_0x121a5a);}});}function getPlugins(_0x346fab){var _0x1e2cd1=[];return new BPromise(function(_0x28fa55,_0x1d75e0){try{if(_0x346fab[_0x2eba('0x57')]){return db[_0x2eba('0x6b')][_0x2eba('0x63')]({'raw':!![]})['then'](function(_0x58c0b8){_0x58c0b8[_0x2eba('0x6c')](function(_0x1184d4){_0x1e2cd1[_0x2eba('0x68')](_0x1184d4['id']+0x15b38);});_0x28fa55(_0x1e2cd1);});}else{return db[_0x2eba('0x58')][_0x2eba('0x63')]({'where':{'sectionId':_0x346fab['id']},'raw':!![]})[_0x2eba('0x28')](function(_0xe8eab){_0xe8eab['forEach'](function(_0x35b6d5){_0x1e2cd1[_0x2eba('0x68')](_0x35b6d5['resourceId']+0x15b38);});_0x28fa55(_0x1e2cd1);});}}catch(_0x35bbfe){_0x1d75e0(_0x35bbfe);}});}exports[_0x2eba('0x6d')]=function(_0x3aec5a,_0xc818ff){return db[_0x2eba('0x44')][_0x2eba('0x4b')]({'where':{'id':_0x3aec5a[_0x2eba('0x4a')]['id']}})[_0x2eba('0x28')](handleEntityNotFound(_0xc818ff,null))[_0x2eba('0x28')](function(_0x4454d8){if(_0x4454d8){return db[_0x2eba('0x54')][_0x2eba('0x55')](function(_0x22060f){return db[_0x2eba('0x5b')]['findAll']({'where':{'userProfileId':_0x3aec5a['params']['id']},'attributes':['id'],'raw':!![]})[_0x2eba('0x28')](function(_0x315d2c){if(_0x315d2c){return db[_0x2eba('0x5b')][_0x2eba('0x5c')]({'where':{'userProfileId':_0x3aec5a['params']['id'],'id':_[_0x2eba('0x2e')](_0x315d2c,function(_0x57d432){return _0x57d432['id'];})},'transaction':_0x22060f});}})['then'](function(_0x527e1e){var _0x2bf9a5=_[_0x2eba('0x2e')](_0x3aec5a[_0x2eba('0x4d')],function(_0xdb2f38){_0xdb2f38['userProfileId']=_0x3aec5a[_0x2eba('0x4a')]['id'];return _0xdb2f38;});return db[_0x2eba('0x5b')][_0x2eba('0x6e')](_0x2bf9a5,{'raw':!![],'transaction':_0x22060f});})[_0x2eba('0x28')](function(_0x741d7b){var _0x2ed537=_[_0x2eba('0x3e')](_[_0x2eba('0x2e')](_0x741d7b,function(_0xddb79a){return _0xddb79a['get']({'plain':!![]});}),{'includeAll':![]});if(_0x2ed537){return db[_0x2eba('0x5b')][_0x2eba('0x63')]({'where':{'userProfileId':_0x3aec5a[_0x2eba('0x4a')]['id'],'sectionId':_['map'](_0x2ed537,function(_0x144856){return _0x144856[_0x2eba('0x5f')];})},'attributes':['id',_0x2eba('0x5f')],'raw':!![]})[_0x2eba('0x28')](function(_0x48dc2d){var _0x21f528=_[_0x2eba('0x2e')](_0x3aec5a[_0x2eba('0x4d')],function(_0xa99248){_0xa99248[_0x2eba('0x59')]=_0x3aec5a[_0x2eba('0x4a')]['id'];return _0xa99248;});return db[_0x2eba('0x58')][_0x2eba('0x6e')](_0x21f528,{'raw':!![],'transaction':_0x22060f});});}})['catch'](handleError(_0xc818ff,null));});}})[_0x2eba('0x28')](function(_0x27c4ee){var _0x49e63c=_[_0x2eba('0x2e')](_0x27c4ee,function(_0x2a4231){return _0x2a4231[_0x2eba('0x4f')]({'plain':!![]});});})[_0x2eba('0x28')](respondWithResult(_0xc818ff,null))[_0x2eba('0x48')](handleError(_0xc818ff,null));};exports[_0x2eba('0x6f')]=function(_0x19a4a1,_0x16b15f,_0x73d254){return db[_0x2eba('0x44')][_0x2eba('0x4b')]({'where':{'id':_0x19a4a1[_0x2eba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x16b15f,null))[_0x2eba('0x28')](function(_0x4ea5fa){if(_0x4ea5fa){return _0x4ea5fa['removeResources'](_0x19a4a1[_0x2eba('0x33')][_0x2eba('0x61')]);}})[_0x2eba('0x28')](respondWithStatusCode(_0x16b15f,null))[_0x2eba('0x48')](handleError(_0x16b15f,null));};exports[_0x2eba('0x70')]=function(_0x172a1f,_0x42f35b){var _0x3c9056={};if(!_0x172a1f[_0x2eba('0x33')][_0x2eba('0x71')])throw new Error(_0x2eba('0x72'));if(!_0x172a1f[_0x2eba('0x33')]['hasOwnProperty'](_0x2eba('0x73'))){_0x3c9056['limit']=qs['limit'](_0x172a1f[_0x2eba('0x33')]['limit']);_0x3c9056[_0x2eba('0x21')]=qs[_0x2eba('0x21')](_0x172a1f[_0x2eba('0x33')]['offset']);}return db[_0x2eba('0x44')][_0x2eba('0x4b')]({'where':{'id':_0x172a1f['params']['id']}})[_0x2eba('0x28')](function(_0x55b82d){if(!_0x55b82d)throw new Error(_0x2eba('0x74')+_0x172a1f['params']['id']);return db['UserProfile'][_0x2eba('0x70')](_0x172a1f);})['then'](respondWithFilteredResult(_0x42f35b,_0x3c9056))[_0x2eba('0x48')](handleError(_0x42f35b,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index cdc51fc..dfe35cd 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 _0xdb28=['UserProfile','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x5acb81,_0xf0c6e){var _0x444398=function(_0x203009){while(--_0x203009){_0x5acb81['push'](_0x5acb81['shift']());}};_0x444398(++_0xf0c6e);}(_0xdb28,0x106));var _0x8db2=function(_0x5b763b,_0x133357){_0x5b763b=_0x5b763b-0x0;var _0x533a1d=_0xdb28[_0x5b763b];return _0x533a1d;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var UserProfile=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){UserProfileEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);UserProfileEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x539d=['hasOwnProperty','hook','exports','events','UserProfile','setMaxListeners','remove','emit'];(function(_0x4ed37f,_0x220aa6){var _0x429dee=function(_0x26441a){while(--_0x26441a){_0x4ed37f['push'](_0x4ed37f['shift']());}};_0x429dee(++_0x220aa6);}(_0x539d,0x17b));var _0xd539=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x539d[_0x5d6456];return _0x4d66c1;};'use strict';var EventEmitter=require(_0xd539('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xd539('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd539('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd539('0x3')};function emitEvent(_0x2a38d5){return function(_0xe8e6e4,_0x19ae25,_0x2f9d1f){UserProfileEvents['emit'](_0x2a38d5+':'+_0xe8e6e4['id'],_0xe8e6e4);UserProfileEvents[_0xd539('0x4')](_0x2a38d5,_0xe8e6e4);_0x2f9d1f(null);};}for(var e in events){if(events[_0xd539('0x5')](e)){var event=events[e];UserProfile[_0xd539('0x6')](e,emitEvent(event));}}module[_0xd539('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index ef947ae..5d9ad71 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 _0x015a=['MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','voicequeues','queuecampaigns','QueueCampaigns','users','agents','telephones','Users','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','Sound','Tag','templates','triggers','Trigger','Trunk','Variable','plugins','Plugin','extractedreports','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','VIRTUAL','foreignKey','forEach','options','include','reportType','default','reportId','DefaultReports','count','rows','includeAll','Tags','color','tag','openTabs','true','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','catch','model','associatedResources','map','resolve','UserProfileResource','then','AnalyticExtractedReport','resourceId','toLowerCase','SquareProject','childModel','SquareRecording','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','VoiceQueues','VoiceQueue','type','queue','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses'];(function(_0x246cd0,_0x36e3e8){var _0x1fd2de=function(_0x3472af){while(--_0x3472af){_0x246cd0['push'](_0x246cd0['shift']());}};_0x1fd2de(++_0x36e3e8);}(_0x015a,0x130));var _0xa015=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x015a[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xa015('0x0'));var attributes=require(_0xa015('0x1'));var qs=require(_0xa015('0x2'));var squel=require(_0xa015('0x3'));module[_0xa015('0x4')]=function(_0xf98964){var _0x2451d9=_0xf98964[_0xa015('0x5')];function _0x5c2f91(_0xdf7c54,_0x3a8958){return new Promise(function(_0x5d8732,_0xc7c790){if(!_0x3a8958)return _0x5d8732(null);var _0xb778ed=_0x3a8958[_0xa015('0x6')]?{[_0x3a8958[_0xa015('0x6')][_0xa015('0x7')]]:_0x3a8958[_0xa015('0x6')][_0xa015('0x8')]}:undefined;return _0x2451d9[_0xdf7c54][_0xa015('0x9')]({'where':_0xb778ed,'raw':!![]})['then'](function(_0x4ff786){_0x3a8958['associatedResources']=_['map'](_0x4ff786,'id');_0x5d8732(_0x3a8958);})[_0xa015('0xa')](function(_0x24cfde){_0xc7c790(_0x24cfde);});});}function _0x590846(_0x4227f1,_0x4b5dbc){return new Promise(function(_0x44b2fd,_0x169a80){var _0x168cc9=_0x4227f1[_0xa015('0x6')]?{[_0x4227f1[_0xa015('0x6')][_0xa015('0x7')]]:_0x4227f1[_0xa015('0x6')][_0xa015('0x8')]}:undefined;return _0x2451d9[_0x4227f1[_0xa015('0xb')]][_0xa015('0x9')]({'where':_0x168cc9,'raw':!![]})['then'](function(_0xc300a7){_0x4b5dbc[_0xa015('0xc')]=_[_0xa015('0xd')](_0xc300a7,function(_0xfb7ae0){return _0xfb7ae0['name'];});_0x44b2fd(_0x4b5dbc);})[_0xa015('0xa')](function(_0x2a9186){_0x169a80(_0x2a9186);});});}function _0xae03dd(_0x306b7a,_0x409d66,_0x2b3e83){if(!_0x409d66)return Promise[_0xa015('0xe')](null);return new Promise(function(_0x65a4ca,_0x363e1c){return _0x2451d9[_0xa015('0xf')][_0xa015('0x9')]({'where':{'sectionId':_0x409d66['id']},'raw':!![]})[_0xa015('0x10')](function(_0x392b00){if(_0x306b7a[_0xa015('0x7')]&&_0x306b7a['field']!=='id'){_0x409d66[_0xa015('0xc')]=_[_0xa015('0xd')](_0x392b00,function(_0xc9fb81){return _0xc9fb81[_0x306b7a[_0xa015('0x7')]];});}else{if(_0x2b3e83===_0xa015('0x11')){_0x409d66[_0xa015('0xc')]=_[_0xa015('0xd')](_0x392b00,function(_0x4d9a47){return{'id':_0x4d9a47[_0xa015('0x12')],'type':_0x4d9a47['type']};});}else{_0x409d66[_0xa015('0xc')]=_['map'](_0x392b00,function(_0x948cf6){return _0x948cf6[_0xa015('0x12')];});}}_0x65a4ca(_0x409d66);})[_0xa015('0xa')](function(_0xa4889){_0x363e1c(_0xa4889);});});}function _0x241b13(_0x3629dd,_0xdb464c){var _0x4e8c88={'parentSections':[]};switch(_0x3629dd[_0xa015('0x13')]()){case'squareprojects':_0x4e8c88['childModel']=_0xa015('0x14');break;case'odbc':_0x4e8c88[_0xa015('0x15')]='SquareOdbc';break;case'squarerecordings':_0x4e8c88[_0xa015('0x15')]=_0xa015('0x16');_0x4e8c88[_0xa015('0x17')]=[{'name':_0xa015('0x18'),'field':_0xa015('0x19'),'foreignKey':_0xa015('0x1a')}];break;case _0xa015('0x1b'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x1c');break;case _0xa015('0x1d'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x1e');_0x4e8c88[_0xa015('0x17')]=[{'name':_0xa015('0x1f'),'field':'id','foreignKey':_0xa015('0x20')}];break;case _0xa015('0x21'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x22');break;case _0xa015('0x23'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x24');break;case _0xa015('0x25'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x26');break;case _0xa015('0x27'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x28');break;case _0xa015('0x29'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x2a');break;case'faxqueues':_0x4e8c88[_0xa015('0x15')]=_0xa015('0x2b');break;case _0xa015('0x2c'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x2d');break;case _0xa015('0x2e'):case _0xa015('0x2f'):case _0xa015('0x30'):_0x4e8c88['childModel']=_0xa015('0x31');break;case _0xa015('0x32'):_0x4e8c88[_0xa015('0x15')]='VoiceContext';break;case _0xa015('0x33'):_0x4e8c88[_0xa015('0x15')]='VoiceMail';break;case _0xa015('0x34'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x35');_0x4e8c88[_0xa015('0x17')]=[{'name':_0xa015('0x36'),'field':_0xa015('0x19'),'foreignKey':_0xa015('0x37'),'model':_0xa015('0x38'),'filter':{'field':'role','value':[_0xa015('0x39')]}},{'name':_0xa015('0x3a'),'field':_0xa015('0x19'),'foreignKey':'membername','model':_0xa015('0x38'),'filter':{'field':_0xa015('0x3b'),'value':['telephone']}},{'name':_0xa015('0x3c'),'field':'name','foreignKey':'queue','model':_0xa015('0x3d'),'filter':{'field':_0xa015('0x3e'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0xa015('0x19'),'foreignKey':_0xa015('0x3f'),'model':_0xa015('0x3d'),'filter':{'field':_0xa015('0x3e'),'value':[_0xa015('0x40')]}}];break;case _0xa015('0x41'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x42');break;case'chanspies':_0x4e8c88[_0xa015('0x15')]='VoiceChanSpy';break;case _0xa015('0x43'):_0x4e8c88[_0xa015('0x15')]='VoicePrefix';break;case _0xa015('0x44'):_0x4e8c88['childModel']=_0xa015('0x45');break;case _0xa015('0x46'):_0x4e8c88['childModel']='MailQueue';break;case _0xa015('0x47'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x48');break;case _0xa015('0x49'):_0x4e8c88['childModel']=_0xa015('0x4a');break;case _0xa015('0x4b'):_0x4e8c88[_0xa015('0x15')]='OpenchannelQueue';break;case _0xa015('0x4c'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x4d');break;case _0xa015('0x4e'):_0x4e8c88['childModel']=_0xa015('0x4f');break;case _0xa015('0x50'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x51');break;case _0xa015('0x52'):_0x4e8c88['childModel']=_0xa015('0x53');break;case _0xa015('0x54'):_0x4e8c88[_0xa015('0x15')]='WhatsappAccount';break;case _0xa015('0x55'):_0x4e8c88[_0xa015('0x15')]='Team';break;case _0xa015('0x56'):case _0xa015('0x57'):_0x4e8c88['childModel']=_0xa015('0x3d');if(_0xdb464c){_0x4e8c88['parentSections']=[{'name':_0xa015('0x3c')},{'name':_0xa015('0x58')}];}break;case _0xa015('0x59'):case _0xa015('0x5a'):case _0xa015('0x5b'):_0x4e8c88[_0xa015('0x15')]='User';if(_0xdb464c){_0x4e8c88['parentSections']=[{'name':_0xa015('0x5c'),'filter':{'field':_0xa015('0x3b'),'value':['admin','user']},'ignore':!![]},{'name':_0xa015('0x36')},{'name':_0xa015('0x3a')}];}break;case _0xa015('0x5d'):_0x4e8c88['childModel']=_0xa015('0x5e');break;case _0xa015('0x5f'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x60');break;case _0xa015('0x61'):_0x4e8c88['childModel']='FreshdeskAccount';break;case _0xa015('0x62'):_0x4e8c88[_0xa015('0x15')]='SugarcrmAccount';break;case'deskaccounts':_0x4e8c88['childModel']=_0xa015('0x63');break;case'zohoaccounts':_0x4e8c88[_0xa015('0x15')]=_0xa015('0x64');break;case _0xa015('0x65'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x38');break;case _0xa015('0x66'):_0x4e8c88[_0xa015('0x15')]='CannedAnswer';break;case _0xa015('0x67'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x68');break;case _0xa015('0x69'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x6a');break;case _0xa015('0x6b'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x6c');break;case _0xa015('0x6d'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x6e');break;case _0xa015('0x6f'):_0x4e8c88['childModel']=_0xa015('0x70');break;case'sounds':_0x4e8c88[_0xa015('0x15')]=_0xa015('0x71');break;case'tags':_0x4e8c88[_0xa015('0x15')]=_0xa015('0x72');break;case _0xa015('0x73'):_0x4e8c88[_0xa015('0x15')]='Template';break;case _0xa015('0x74'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x75');break;case'trunks':_0x4e8c88[_0xa015('0x15')]=_0xa015('0x76');break;case'variables':_0x4e8c88[_0xa015('0x15')]=_0xa015('0x77');break;case _0xa015('0x78'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x79');break;case _0xa015('0x7a'):_0x4e8c88[_0xa015('0x15')]=_0xa015('0x11');_0x4e8c88[_0xa015('0x17')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case'metrics':_0x4e8c88['childModel']=_0xa015('0x7b');break;}return _0x4e8c88;}function _0x5b99ca(_0x3ffef7,_0x54db47){var _0x1b0e60=_0x3ffef7[_0xa015('0x7c')](0x0)[_0xa015('0x7d')]()+_0x3ffef7[_0xa015('0x7e')](0x1);var _0xadbc59={'type':_0x2451d9['Sequelize'][_0xa015('0x7f')]['SELECT'],'raw':!![]};return new Promise(function(_0x47338b,_0x349170){var _0x2ebd8c=squel['select']()[_0xa015('0x7')](_0xa015('0x80')+_0x1b0e60+_0xa015('0x81'),'id')[_0xa015('0x7')](_0xa015('0x82'))['from'](_0xa015('0x83')+_0x3ffef7+_0xa015('0x84'),'ui')['where'](_0xa015('0x85'),_0x54db47['id']);return _0x2451d9[_0xa015('0x86')][_0xa015('0x87')](_0x2ebd8c[_0xa015('0x88')](),_0xadbc59)[_0xa015('0x10')](function(_0x3b472f){_0x54db47[_0x1b0e60+_0xa015('0x89')]=_0x3b472f;_0x47338b(_0x3b472f);})[_0xa015('0xa')](function(_0x4328d8){_0x349170(_0x4328d8);});});}return _0xf98964['define']('UserProfile',attributes,{'tableName':_0xa015('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2eca66){var _0x29440b={'raw':_0x2eca66['query'][_0xa015('0x8b')],'where':{}};var _0x29d6e9={};var _0x13d983={'count':0x0,'rows':[]};var _0x2f902a=_0x2eca66[_0xa015('0x87')][_0xa015('0x8c')];var _0x3b9901=_0x2eca66[_0xa015('0x87')][_0xa015('0x8d')]||![];var _0x2f9877=_0x241b13(_0x2f902a,_0x3b9901);if(!_0x2f9877[_0xa015('0x15')])throw new Error(_0xa015('0x8e')+_0x2f902a+'\x27');var _0x1c075e=[{'name':_0x2f902a}];if(!_[_0xa015('0x8f')](_0x2f9877['parentSections']))_0x1c075e=_0x2f9877[_0xa015('0x17')];var _0x5aeffa=[];for(var _0x569cec=0x0;_0x569cec<_0x1c075e[_0xa015('0x90')];_0x569cec++){_0x5aeffa[_0xa015('0x91')](_0x2451d9[_0xa015('0x92')][_0xa015('0x93')]({'where':{'userProfileId':_0x2eca66[_0xa015('0x94')]['id'],'name':_0x1c075e[_0x569cec][_0xa015('0x19')]},'raw':!![]}));}return Promise[_0xa015('0x95')](_0x5aeffa)[_0xa015('0x10')](function(_0x4bb6a0){var _0x51c038=_[_0xa015('0x6')](_0x4bb6a0,function(_0x3ce7c9){return _0x3ce7c9?_0x3ce7c9:undefined;});var _0x30d98c=_['filter'](_0x1c075e,[_0xa015('0x96'),!![]]);var _0x47cba2=_['isEmpty'](_0x51c038)&&_[_0xa015('0x8f')](_0x30d98c)?null:_[_0xa015('0x97')](_0x30d98c,_0x51c038);if(!_0x47cba2)return null;var _0x5cc01a=[];for(var _0x317550=0x0;_0x317550<_0x47cba2[_0xa015('0x90')];_0x317550++){var _0x533a3d=_[_0xa015('0x93')](_0x1c075e,function(_0x4b453e){return _0x47cba2[_0x317550]?_0x4b453e[_0xa015('0x19')]===_0x47cba2[_0x317550][_0xa015('0x19')]:null;});if(_0x533a3d){if(_0x47cba2[_0x317550][_0xa015('0x96')]){_0x5cc01a['push'](_0x5c2f91(_0x2f9877[_0xa015('0x15')],_0x47cba2[_0x317550]));}else{if(!_0x47cba2[_0x317550]['autoAssociation']){_0x5cc01a[_0xa015('0x91')](_0xae03dd(_0x533a3d,_0x47cba2[_0x317550],_0x2f9877[_0xa015('0x15')]));}else{if(_0x533a3d['model']){_0x5cc01a[_0xa015('0x91')](_0x590846(_0x533a3d,_0x47cba2[_0x317550]));}}}}}return Promise[_0xa015('0x95')](_0x5cc01a);})[_0xa015('0x10')](function(_0x49e142){var _0x136424=_0x49e142;var _0x417ade=null;if(_0x136424){_0x417ade=_0x136424[_0xa015('0x90')]===0x1?_0x136424[0x0]:null;}if(!_0x417ade&&!_0x136424)return _0x13d983;var _0xa7c45b=_0x2451d9[_0x2f9877[_0xa015('0x15')]]['rawAttributes'];_0x29d6e9[_0xa015('0xb')]=_['keys'](_0xa7c45b);_0x29d6e9[_0xa015('0x87')]=_[_0xa015('0x98')](_0x2eca66[_0xa015('0x87')]);_0x29d6e9[_0xa015('0x99')]=_[_0xa015('0x9a')](_0x29d6e9[_0xa015('0xb')],_0x29d6e9[_0xa015('0x87')]);_0x29440b[_0xa015('0x9b')]=_[_0xa015('0x9a')](_0x29d6e9['model'],qs[_0xa015('0x9c')](_0x2eca66['query'][_0xa015('0x9c')]));_0x29440b[_0xa015('0x9b')]=_0x29440b['attributes'][_0xa015('0x90')]?_0x29440b['attributes']:_0x29d6e9[_0xa015('0xb')];if(!_0x2eca66['query'][_0xa015('0x9d')](_0xa015('0x9e'))){_0x29440b[_0xa015('0x9f')]=qs[_0xa015('0x9f')](_0x2eca66[_0xa015('0x87')][_0xa015('0x9f')]);_0x29440b['offset']=qs[_0xa015('0xa0')](_0x2eca66['query']['offset']);}_0x29440b[_0xa015('0xa1')]=qs['sort'](_0x2eca66[_0xa015('0x87')][_0xa015('0xa2')]);_0x29440b[_0xa015('0xa3')]=qs['filters'](_[_0xa015('0xa4')](_0x2eca66[_0xa015('0x87')],_0x29d6e9[_0xa015('0x99')]));if(_0x2eca66[_0xa015('0x87')]['filter']){_0x29440b[_0xa015('0xa3')]=_[_0xa015('0xa5')](_0x29440b[_0xa015('0xa3')],{'$or':_[_0xa015('0xd')](_0xa7c45b,function(_0x53f562){if(_0x53f562[_0xa015('0x3e')]['key']!==_0xa015('0xa6')){var _0x6271a4={};_0x6271a4[_0x53f562[_0xa015('0x7')]]={'$like':'%'+_0x2eca66[_0xa015('0x87')][_0xa015('0x6')]+'%'};return _0x6271a4;}})});}var _0x1570af=[];var _0x1394b2=null;var _0x32b942={};if(_0x417ade){_0x1394b2=_[_0xa015('0x93')](_0x1c075e,['name',_0x417ade[_0xa015('0x19')]]);if(_0x1394b2['field']){_0x32b942={};if(_0x2f9877[_0xa015('0x15')]===_0xa015('0x11')){_0x32b942[_0x1394b2[_0xa015('0xa7')]]=_['map'](_0x417ade[_0xa015('0xc')],'id');}else{_0x32b942[_0x1394b2[_0xa015('0xa7')]]=_0x417ade[_0xa015('0xc')];}_0x1570af[_0xa015('0x91')](_0x32b942);}else{_0x29440b['where']['id']=_0x417ade[_0xa015('0xc')];}}else{for(var _0x13904e=0x0;_0x13904e<_0x136424[_0xa015('0x90')];_0x13904e++){_0x1394b2=_[_0xa015('0x93')](_0x1c075e,['name',_0x136424[_0x13904e][_0xa015('0x19')]]);if(_0x1394b2[_0xa015('0x7')]){_0x32b942={};_0x32b942[_0x1394b2[_0xa015('0xa7')]]=_0x136424[_0x13904e][_0xa015('0xc')];_0x1570af[_0xa015('0x91')](_0x32b942);}else{if(!_0x29440b['where']['id'])_0x29440b[_0xa015('0xa3')]['id']=[];_0x136424[_0x13904e]['associatedResources'][_0xa015('0xa8')](function(_0x1f7dad){_0x29440b['where']['id']['push'](_0x1f7dad);});}}}if(!_[_0xa015('0x8f')](_0x1570af)){_0x29440b['where']=_[_0xa015('0xa5')](_0x29440b[_0xa015('0xa3')],{'$and':{'$or':_0x1570af}});}_0x29440b=_[_0xa015('0xa5')]({},_0x29440b,_0x2eca66[_0xa015('0xa9')]);if(_0x417ade&&!_0x417ade['autoAssociation']&&_0x2f9877[_0xa015('0x15')]===_0xa015('0x11')){if(_0x2eca66['query']['includeAll']){_0x29440b[_0xa015('0xaa')]=[{'all':!![]}];}return _0x2451d9[_0x2f9877[_0xa015('0x15')]][_0xa015('0x9')](_0x29440b)[_0xa015('0x10')](function(_0x3da266){var _0x2de7f3=[];_0x3da266['forEach'](function(_0x3d1ecc){var _0x57bd2f;switch(_0x3d1ecc[_0xa015('0xab')]){case _0xa015('0xac'):_0x57bd2f=_[_0xa015('0x93')](_0x417ade[_0xa015('0xc')],function(_0x11a015){return _0x11a015['id']===_0x3d1ecc[_0xa015('0xad')]&&_0x11a015[_0xa015('0x3e')]===_0xa015('0xae');});break;case'custom':_0x57bd2f=_[_0xa015('0x93')](_0x417ade['associatedResources'],function(_0x3e6589){return _0x3e6589['id']===_0x3d1ecc['reportId']&&_0x3e6589[_0xa015('0x3e')]==='CustomReports';});break;}if(_0x57bd2f)_0x2de7f3['push'](_0x3d1ecc);});_0x13d983[_0xa015('0xaf')]=_0x2de7f3[_0xa015('0x90')];_0x13d983[_0xa015('0xb0')]=_0x2de7f3;return _0x13d983;});}else{return _0x2451d9[_0x2f9877[_0xa015('0x15')]]['count']({'where':_0x29440b[_0xa015('0xa3')]})[_0xa015('0x10')](function(_0x52dc36){_0x13d983[_0xa015('0xaf')]=_0x52dc36;if(_0x2eca66[_0xa015('0x87')][_0xa015('0xb1')]){if(_0x2f9877[_0xa015('0x15')]===_0xa015('0x1e')){_0x29440b[_0xa015('0xaa')]=[{'model':_0x2451d9[_0xa015('0x72')],'as':_0xa015('0xb2'),'attributes':['id',_0xa015('0x19'),_0xa015('0xb3')],'required':_0x2eca66['query']['tag']?!![]:![]},{'model':_0x2451d9[_0xa015('0x72')],'as':'ThroughTags','attributes':['id',_0xa015('0x19'),_0xa015('0xb3')],'through':_0x2eca66[_0xa015('0x87')]['tag']?{'attributes':[],'where':{'TagId':_0x2eca66[_0xa015('0x87')][_0xa015('0xb4')]||undefined}}:{},'required':_0x2eca66[_0xa015('0x87')][_0xa015('0xb4')]?!![]:![]}];}else{_0x29440b[_0xa015('0xaa')]=[{'all':!![]}];}}return _0x2451d9[_0x2f9877[_0xa015('0x15')]][_0xa015('0x9')](_0x29440b);})[_0xa015('0x10')](function(_0x4f34d4){_0x13d983['rows']=_0x4f34d4;if(_0x2f902a==='Agents'&&_0x2eca66[_0xa015('0x87')][_0xa015('0xb5')]===_0xa015('0xb6')){var _0x22e4c6=[];for(var _0x5431e9=0x0;_0x5431e9<_0x13d983[_0xa015('0xb0')][_0xa015('0x90')];_0x5431e9++){_0x22e4c6['push'](_0x5b99ca('chat',_0x13d983[_0xa015('0xb0')][_0x5431e9][_0xa015('0xb7')]));_0x22e4c6[_0xa015('0x91')](_0x5b99ca(_0xa015('0xb8'),_0x13d983['rows'][_0x5431e9][_0xa015('0xb7')]));_0x22e4c6[_0xa015('0x91')](_0x5b99ca(_0xa015('0xb9'),_0x13d983[_0xa015('0xb0')][_0x5431e9][_0xa015('0xb7')]));_0x22e4c6[_0xa015('0x91')](_0x5b99ca(_0xa015('0xba'),_0x13d983[_0xa015('0xb0')][_0x5431e9][_0xa015('0xb7')]));_0x22e4c6[_0xa015('0x91')](_0x5b99ca(_0xa015('0xbb'),_0x13d983['rows'][_0x5431e9][_0xa015('0xb7')]));_0x22e4c6[_0xa015('0x91')](_0x5b99ca(_0xa015('0xbc'),_0x13d983['rows'][_0x5431e9][_0xa015('0xb7')]));}return Promise['all'](_0x22e4c6)[_0xa015('0x10')](function(){return _0x13d983;});}return _0x13d983;});}});}}});}; \ No newline at end of file +var _0xd3cf=['length','find','params','all','ignore','union','autoAssociation','push','rawAttributes','keys','attributes','intersection','fields','hasOwnProperty','nolimit','offset','sort','filters','pick','key','foreignKey','forEach','merge','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','Tags','color','ThroughTags','tag','openTabs','chat','dataValues','sms','fax','mail','openchannel','whatsapp','./userProfile.attributes','models','filter','field','value','findAll','then','map','model','associatedResources','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName','JscriptyProject','contacts','CmContact','Lists','lists','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','User','role','agent','Telephones','membername','telephone','VoiceQueue','inbound','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','ivrcampaigns','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','VoiceQueues','QueueCampaigns','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','trunks','Trunk','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','OpenTabs','define','UserProfile','user_profiles','query','section','mergeResources','Invalid\x20section\x20\x27','isEmpty'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xd3cf,0x1b3));var _0xfd3c=function(_0x22adeb,_0xbd5d7f){_0x22adeb=_0x22adeb-0x0;var _0x26bf97=_0xd3cf[_0x22adeb];return _0x26bf97;};'use strict';var _=require('lodash');var attributes=require(_0xfd3c('0x0'));var qs=require('../../components/parsers/qs');var squel=require('squel');module['exports']=function(_0x1f974a){var _0x4d05c2=_0x1f974a[_0xfd3c('0x1')];function _0x37c8e9(_0x168370,_0x483f50){return new Promise(function(_0x3aa966,_0xee34d3){if(!_0x483f50)return _0x3aa966(null);var _0x340841=_0x483f50[_0xfd3c('0x2')]?{[_0x483f50[_0xfd3c('0x2')][_0xfd3c('0x3')]]:_0x483f50[_0xfd3c('0x2')][_0xfd3c('0x4')]}:undefined;return _0x4d05c2[_0x168370][_0xfd3c('0x5')]({'where':_0x340841,'raw':!![]})[_0xfd3c('0x6')](function(_0x417a3a){_0x483f50['associatedResources']=_[_0xfd3c('0x7')](_0x417a3a,'id');_0x3aa966(_0x483f50);})['catch'](function(_0x214eb2){_0xee34d3(_0x214eb2);});});}function _0x1781a6(_0x2b7c0f,_0x43e3bc){return new Promise(function(_0x250aba,_0x119733){var _0x28814a=_0x2b7c0f[_0xfd3c('0x2')]?{[_0x2b7c0f[_0xfd3c('0x2')]['field']]:_0x2b7c0f[_0xfd3c('0x2')][_0xfd3c('0x4')]}:undefined;return _0x4d05c2[_0x2b7c0f[_0xfd3c('0x8')]][_0xfd3c('0x5')]({'where':_0x28814a,'raw':!![]})[_0xfd3c('0x6')](function(_0x4d83f5){_0x43e3bc[_0xfd3c('0x9')]=_['map'](_0x4d83f5,function(_0x351ead){return _0x351ead['name'];});_0x250aba(_0x43e3bc);})[_0xfd3c('0xa')](function(_0xcabd6c){_0x119733(_0xcabd6c);});});}function _0x3a8d7c(_0x3fc6ed,_0x51bd5b,_0x54b67a){if(!_0x51bd5b)return Promise[_0xfd3c('0xb')](null);return new Promise(function(_0x184730,_0x2c2c1d){return _0x4d05c2[_0xfd3c('0xc')][_0xfd3c('0x5')]({'where':{'sectionId':_0x51bd5b['id']},'raw':!![]})['then'](function(_0x7bcb2c){if(_0x3fc6ed['field']&&_0x3fc6ed[_0xfd3c('0x3')]!=='id'){_0x51bd5b[_0xfd3c('0x9')]=_[_0xfd3c('0x7')](_0x7bcb2c,function(_0x31f0ae){return _0x31f0ae[_0x3fc6ed[_0xfd3c('0x3')]];});}else{if(_0x54b67a===_0xfd3c('0xd')){_0x51bd5b['associatedResources']=_['map'](_0x7bcb2c,function(_0xe125f){return{'id':_0xe125f[_0xfd3c('0xe')],'type':_0xe125f[_0xfd3c('0xf')]};});}else{_0x51bd5b[_0xfd3c('0x9')]=_[_0xfd3c('0x7')](_0x7bcb2c,function(_0x36ff98){return _0x36ff98[_0xfd3c('0xe')];});}}_0x184730(_0x51bd5b);})['catch'](function(_0x132299){_0x2c2c1d(_0x132299);});});}function _0x28fc66(_0x2bf39e,_0x3985c2){var _0x1896ee={'parentSections':[]};switch(_0x2bf39e[_0xfd3c('0x10')]()){case _0xfd3c('0x11'):_0x1896ee[_0xfd3c('0x12')]='SquareProject';break;case'odbc':_0x1896ee[_0xfd3c('0x12')]='SquareOdbc';break;case _0xfd3c('0x13'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x14');_0x1896ee[_0xfd3c('0x15')]=[{'name':_0xfd3c('0x16'),'field':_0xfd3c('0x17'),'foreignKey':_0xfd3c('0x18')}];break;case'projects':_0x1896ee['childModel']=_0xfd3c('0x19');break;case _0xfd3c('0x1a'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x1b');_0x1896ee[_0xfd3c('0x15')]=[{'name':_0xfd3c('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0xfd3c('0x1d'):_0x1896ee['childModel']='CmList';break;case _0xfd3c('0x1e'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x1f');break;case _0xfd3c('0x20'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x21');break;case _0xfd3c('0x22'):_0x1896ee['childModel']=_0xfd3c('0x23');break;case'chatwebsites':_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x24');break;case _0xfd3c('0x25'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x26');break;case _0xfd3c('0x27'):_0x1896ee['childModel']=_0xfd3c('0x28');break;case _0xfd3c('0x29'):case _0xfd3c('0x2a'):case _0xfd3c('0x2b'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x2c');break;case _0xfd3c('0x2d'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x2e');break;case _0xfd3c('0x2f'):_0x1896ee[_0xfd3c('0x12')]='VoiceMail';break;case _0xfd3c('0x30'):_0x1896ee[_0xfd3c('0x12')]='VoiceRecording';_0x1896ee[_0xfd3c('0x15')]=[{'name':'Agents','field':_0xfd3c('0x17'),'foreignKey':'membername','model':_0xfd3c('0x31'),'filter':{'field':_0xfd3c('0x32'),'value':[_0xfd3c('0x33')]}},{'name':_0xfd3c('0x34'),'field':_0xfd3c('0x17'),'foreignKey':_0xfd3c('0x35'),'model':_0xfd3c('0x31'),'filter':{'field':_0xfd3c('0x32'),'value':[_0xfd3c('0x36')]}},{'name':'VoiceQueues','field':_0xfd3c('0x17'),'foreignKey':'queue','model':_0xfd3c('0x37'),'filter':{'field':_0xfd3c('0xf'),'value':[_0xfd3c('0x38')]}},{'name':'QueueCampaigns','field':_0xfd3c('0x17'),'foreignKey':_0xfd3c('0x39'),'model':_0xfd3c('0x37'),'filter':{'field':'type','value':[_0xfd3c('0x3a')]}}];break;case _0xfd3c('0x3b'):_0x1896ee['childModel']=_0xfd3c('0x3c');break;case _0xfd3c('0x3d'):_0x1896ee[_0xfd3c('0x12')]='VoiceChanSpy';break;case _0xfd3c('0x3e'):_0x1896ee[_0xfd3c('0x12')]='VoicePrefix';break;case _0xfd3c('0x3f'):_0x1896ee[_0xfd3c('0x12')]='Campaign';break;case'mailqueues':_0x1896ee['childModel']='MailQueue';break;case _0xfd3c('0x40'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x41');break;case _0xfd3c('0x42'):_0x1896ee[_0xfd3c('0x12')]='MailSubstatus';break;case _0xfd3c('0x43'):_0x1896ee['childModel']=_0xfd3c('0x44');break;case _0xfd3c('0x45'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x46');break;case _0xfd3c('0x47'):_0x1896ee[_0xfd3c('0x12')]='SmsQueue';break;case _0xfd3c('0x48'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x49');break;case _0xfd3c('0x4a'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x4b');break;case'whatsappaccounts':_0x1896ee['childModel']=_0xfd3c('0x4c');break;case _0xfd3c('0x4d'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x4e');break;case _0xfd3c('0x4f'):case _0xfd3c('0x50'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x37');if(_0x3985c2){_0x1896ee[_0xfd3c('0x15')]=[{'name':_0xfd3c('0x51')},{'name':_0xfd3c('0x52')}];}break;case _0xfd3c('0x53'):case _0xfd3c('0x54'):case _0xfd3c('0x55'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x31');if(_0x3985c2){_0x1896ee['parentSections']=[{'name':_0xfd3c('0x56'),'filter':{'field':_0xfd3c('0x32'),'value':[_0xfd3c('0x57'),_0xfd3c('0x58')]},'ignore':!![]},{'name':_0xfd3c('0x59')},{'name':_0xfd3c('0x34')}];}break;case _0xfd3c('0x5a'):_0x1896ee[_0xfd3c('0x12')]='ZendeskAccount';break;case _0xfd3c('0x5b'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x5c');break;case'freshdeskaccounts':_0x1896ee['childModel']=_0xfd3c('0x5d');break;case _0xfd3c('0x5e'):_0x1896ee[_0xfd3c('0x12')]='SugarcrmAccount';break;case _0xfd3c('0x5f'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x60');break;case _0xfd3c('0x61'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x62');break;case _0xfd3c('0x63'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x31');break;case _0xfd3c('0x64'):_0x1896ee['childModel']='CannedAnswer';break;case _0xfd3c('0x65'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x66');break;case _0xfd3c('0x67'):_0x1896ee['childModel']=_0xfd3c('0x68');break;case'intervals':_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x69');break;case _0xfd3c('0x6a'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x6b');break;case _0xfd3c('0x6c'):_0x1896ee['childModel']=_0xfd3c('0x6d');break;case _0xfd3c('0x6e'):_0x1896ee['childModel']=_0xfd3c('0x6f');break;case _0xfd3c('0x70'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x71');break;case _0xfd3c('0x72'):_0x1896ee['childModel']=_0xfd3c('0x73');break;case _0xfd3c('0x74'):_0x1896ee['childModel']='Trigger';break;case _0xfd3c('0x75'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x76');break;case'variables':_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x77');break;case _0xfd3c('0x78'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x79');break;case _0xfd3c('0x7a'):_0x1896ee[_0xfd3c('0x12')]='AnalyticExtractedReport';_0x1896ee[_0xfd3c('0x15')]=[{'name':_0xfd3c('0x7b'),'field':'id','foreignKey':_0xfd3c('0x7c')}];break;case _0xfd3c('0x7d'):_0x1896ee[_0xfd3c('0x12')]=_0xfd3c('0x7e');break;}return _0x1896ee;}function _0x5b75be(_0x3073b1,_0x128b84){var _0x5b99f8=_0x3073b1[_0xfd3c('0x7f')](0x0)[_0xfd3c('0x80')]()+_0x3073b1[_0xfd3c('0x81')](0x1);var _0x323f99={'type':_0x4d05c2[_0xfd3c('0x82')][_0xfd3c('0x83')][_0xfd3c('0x84')],'raw':!![]};return new Promise(function(_0x5aea98,_0x379383){var _0x25acb7=squel['select']()['field'](_0xfd3c('0x85')+_0x5b99f8+_0xfd3c('0x86'),'id')[_0xfd3c('0x3')](_0xfd3c('0x87'))[_0xfd3c('0x88')]('user_has_'+_0x3073b1+_0xfd3c('0x89'),'ui')[_0xfd3c('0x8a')](_0xfd3c('0x8b'),_0x128b84['id']);return _0x4d05c2[_0xfd3c('0x8c')]['query'](_0x25acb7['toString'](),_0x323f99)[_0xfd3c('0x6')](function(_0x36508c){_0x128b84[_0x5b99f8+_0xfd3c('0x8d')]=_0x36508c;_0x5aea98(_0x36508c);})[_0xfd3c('0xa')](function(_0x5ef662){_0x379383(_0x5ef662);});});}return _0x1f974a[_0xfd3c('0x8e')](_0xfd3c('0x8f'),attributes,{'tableName':_0xfd3c('0x90'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x549fff){var _0x3b52bb={'raw':_0x549fff[_0xfd3c('0x91')]['raw'],'where':{}};var _0x5999cf={};var _0xf340cc={'count':0x0,'rows':[]};var _0x13331e=_0x549fff[_0xfd3c('0x91')][_0xfd3c('0x92')];var _0x6f6a16=_0x549fff[_0xfd3c('0x91')][_0xfd3c('0x93')]||![];var _0x12c96f=_0x28fc66(_0x13331e,_0x6f6a16);if(!_0x12c96f[_0xfd3c('0x12')])throw new Error(_0xfd3c('0x94')+_0x13331e+'\x27');var _0x43d7a5=[{'name':_0x13331e}];if(!_[_0xfd3c('0x95')](_0x12c96f[_0xfd3c('0x15')]))_0x43d7a5=_0x12c96f['parentSections'];var _0x51af73=[];for(var _0x37d089=0x0;_0x37d089<_0x43d7a5[_0xfd3c('0x96')];_0x37d089++){_0x51af73['push'](_0x4d05c2['UserProfileSection'][_0xfd3c('0x97')]({'where':{'userProfileId':_0x549fff[_0xfd3c('0x98')]['id'],'name':_0x43d7a5[_0x37d089][_0xfd3c('0x17')]},'raw':!![]}));}return Promise[_0xfd3c('0x99')](_0x51af73)[_0xfd3c('0x6')](function(_0x38d173){var _0x27c818=_[_0xfd3c('0x2')](_0x38d173,function(_0xf47bbe){return _0xf47bbe?_0xf47bbe:undefined;});var _0x557e5c=_[_0xfd3c('0x2')](_0x43d7a5,[_0xfd3c('0x9a'),!![]]);var _0x49e270=_['isEmpty'](_0x27c818)&&_['isEmpty'](_0x557e5c)?null:_[_0xfd3c('0x9b')](_0x557e5c,_0x27c818);if(!_0x49e270)return null;var _0x233d09=[];for(var _0x23bca4=0x0;_0x23bca4<_0x49e270['length'];_0x23bca4++){var _0x19ee5f=_[_0xfd3c('0x97')](_0x43d7a5,function(_0x4d7e0d){return _0x49e270[_0x23bca4]?_0x4d7e0d['name']===_0x49e270[_0x23bca4][_0xfd3c('0x17')]:null;});if(_0x19ee5f){if(_0x49e270[_0x23bca4][_0xfd3c('0x9a')]){_0x233d09['push'](_0x37c8e9(_0x12c96f[_0xfd3c('0x12')],_0x49e270[_0x23bca4]));}else{if(!_0x49e270[_0x23bca4][_0xfd3c('0x9c')]){_0x233d09[_0xfd3c('0x9d')](_0x3a8d7c(_0x19ee5f,_0x49e270[_0x23bca4],_0x12c96f[_0xfd3c('0x12')]));}else{if(_0x19ee5f[_0xfd3c('0x8')]){_0x233d09[_0xfd3c('0x9d')](_0x1781a6(_0x19ee5f,_0x49e270[_0x23bca4]));}}}}}return Promise['all'](_0x233d09);})[_0xfd3c('0x6')](function(_0x4ce626){var _0x2ffa04=_0x4ce626;var _0xb09585=null;if(_0x2ffa04){_0xb09585=_0x2ffa04[_0xfd3c('0x96')]===0x1?_0x2ffa04[0x0]:null;}if(!_0xb09585&&!_0x2ffa04)return _0xf340cc;var _0x9cd144=_0x4d05c2[_0x12c96f[_0xfd3c('0x12')]][_0xfd3c('0x9e')];_0x5999cf[_0xfd3c('0x8')]=_[_0xfd3c('0x9f')](_0x9cd144);_0x5999cf[_0xfd3c('0x91')]=_[_0xfd3c('0x9f')](_0x549fff[_0xfd3c('0x91')]);_0x5999cf['filters']=_['intersection'](_0x5999cf[_0xfd3c('0x8')],_0x5999cf['query']);_0x3b52bb[_0xfd3c('0xa0')]=_[_0xfd3c('0xa1')](_0x5999cf['model'],qs[_0xfd3c('0xa2')](_0x549fff[_0xfd3c('0x91')][_0xfd3c('0xa2')]));_0x3b52bb[_0xfd3c('0xa0')]=_0x3b52bb[_0xfd3c('0xa0')][_0xfd3c('0x96')]?_0x3b52bb[_0xfd3c('0xa0')]:_0x5999cf['model'];if(!_0x549fff['query'][_0xfd3c('0xa3')](_0xfd3c('0xa4'))){_0x3b52bb['limit']=qs['limit'](_0x549fff[_0xfd3c('0x91')]['limit']);_0x3b52bb[_0xfd3c('0xa5')]=qs['offset'](_0x549fff['query']['offset']);}_0x3b52bb['order']=qs['sort'](_0x549fff[_0xfd3c('0x91')][_0xfd3c('0xa6')]);_0x3b52bb[_0xfd3c('0x8a')]=qs[_0xfd3c('0xa7')](_[_0xfd3c('0xa8')](_0x549fff[_0xfd3c('0x91')],_0x5999cf[_0xfd3c('0xa7')]));if(_0x549fff[_0xfd3c('0x91')][_0xfd3c('0x2')]){_0x3b52bb[_0xfd3c('0x8a')]=_['merge'](_0x3b52bb[_0xfd3c('0x8a')],{'$or':_['map'](_0x9cd144,function(_0x3538df){if(_0x3538df[_0xfd3c('0xf')][_0xfd3c('0xa9')]!=='VIRTUAL'){var _0xa9d4ae={};_0xa9d4ae[_0x3538df[_0xfd3c('0x3')]]={'$like':'%'+_0x549fff[_0xfd3c('0x91')][_0xfd3c('0x2')]+'%'};return _0xa9d4ae;}})});}var _0x1f1057=[];var _0x3c34c3=null;var _0x4e9765={};if(_0xb09585){_0x3c34c3=_[_0xfd3c('0x97')](_0x43d7a5,[_0xfd3c('0x17'),_0xb09585['name']]);if(_0x3c34c3['field']){_0x4e9765={};if(_0x12c96f[_0xfd3c('0x12')]==='AnalyticExtractedReport'){_0x4e9765[_0x3c34c3[_0xfd3c('0xaa')]]=_['map'](_0xb09585[_0xfd3c('0x9')],'id');}else{_0x4e9765[_0x3c34c3[_0xfd3c('0xaa')]]=_0xb09585[_0xfd3c('0x9')];}_0x1f1057[_0xfd3c('0x9d')](_0x4e9765);}else{_0x3b52bb[_0xfd3c('0x8a')]['id']=_0xb09585[_0xfd3c('0x9')];}}else{for(var _0x45d937=0x0;_0x45d937<_0x2ffa04['length'];_0x45d937++){_0x3c34c3=_[_0xfd3c('0x97')](_0x43d7a5,[_0xfd3c('0x17'),_0x2ffa04[_0x45d937][_0xfd3c('0x17')]]);if(_0x3c34c3[_0xfd3c('0x3')]){_0x4e9765={};_0x4e9765[_0x3c34c3[_0xfd3c('0xaa')]]=_0x2ffa04[_0x45d937][_0xfd3c('0x9')];_0x1f1057[_0xfd3c('0x9d')](_0x4e9765);}else{if(!_0x3b52bb[_0xfd3c('0x8a')]['id'])_0x3b52bb[_0xfd3c('0x8a')]['id']=[];_0x2ffa04[_0x45d937][_0xfd3c('0x9')][_0xfd3c('0xab')](function(_0x1d2f8a){_0x3b52bb['where']['id']['push'](_0x1d2f8a);});}}}if(!_[_0xfd3c('0x95')](_0x1f1057)){_0x3b52bb[_0xfd3c('0x8a')]=_[_0xfd3c('0xac')](_0x3b52bb[_0xfd3c('0x8a')],{'$and':{'$or':_0x1f1057}});}_0x3b52bb=_[_0xfd3c('0xac')]({},_0x3b52bb,_0x549fff[_0xfd3c('0xad')]);if(_0xb09585&&!_0xb09585[_0xfd3c('0x9c')]&&_0x12c96f['childModel']===_0xfd3c('0xd')){if(_0x549fff[_0xfd3c('0x91')][_0xfd3c('0xae')]){_0x3b52bb[_0xfd3c('0xaf')]=[{'all':!![]}];}return _0x4d05c2[_0x12c96f[_0xfd3c('0x12')]][_0xfd3c('0x5')](_0x3b52bb)[_0xfd3c('0x6')](function(_0x5df3e0){var _0xa9ef6=[];_0x5df3e0['forEach'](function(_0xef826b){var _0x3a4b6e;switch(_0xef826b[_0xfd3c('0xb0')]){case _0xfd3c('0xb1'):_0x3a4b6e=_[_0xfd3c('0x97')](_0xb09585[_0xfd3c('0x9')],function(_0x17252c){return _0x17252c['id']===_0xef826b[_0xfd3c('0x7c')]&&_0x17252c[_0xfd3c('0xf')]===_0xfd3c('0xb2');});break;case _0xfd3c('0xb3'):_0x3a4b6e=_[_0xfd3c('0x97')](_0xb09585[_0xfd3c('0x9')],function(_0x2c1682){return _0x2c1682['id']===_0xef826b['reportId']&&_0x2c1682['type']===_0xfd3c('0xb4');});break;}if(_0x3a4b6e)_0xa9ef6[_0xfd3c('0x9d')](_0xef826b);});_0xf340cc[_0xfd3c('0xb5')]=_0xa9ef6[_0xfd3c('0x96')];_0xf340cc[_0xfd3c('0xb6')]=_0xa9ef6;return _0xf340cc;});}else{return _0x4d05c2[_0x12c96f[_0xfd3c('0x12')]][_0xfd3c('0xb5')]({'where':_0x3b52bb['where']})[_0xfd3c('0x6')](function(_0x490711){_0xf340cc[_0xfd3c('0xb5')]=_0x490711;if(_0x549fff[_0xfd3c('0x91')][_0xfd3c('0xae')]){if(_0x12c96f[_0xfd3c('0x12')]===_0xfd3c('0x1b')){_0x3b52bb[_0xfd3c('0xaf')]=[{'model':_0x4d05c2['Tag'],'as':_0xfd3c('0xb7'),'attributes':['id',_0xfd3c('0x17'),_0xfd3c('0xb8')],'required':_0x549fff[_0xfd3c('0x91')]['tag']?!![]:![]},{'model':_0x4d05c2[_0xfd3c('0x71')],'as':_0xfd3c('0xb9'),'attributes':['id','name',_0xfd3c('0xb8')],'through':_0x549fff[_0xfd3c('0x91')][_0xfd3c('0xba')]?{'attributes':[],'where':{'TagId':_0x549fff[_0xfd3c('0x91')][_0xfd3c('0xba')]||undefined}}:{},'required':_0x549fff[_0xfd3c('0x91')]['tag']?!![]:![]}];}else{_0x3b52bb['include']=[{'all':!![]}];}}return _0x4d05c2[_0x12c96f[_0xfd3c('0x12')]]['findAll'](_0x3b52bb);})[_0xfd3c('0x6')](function(_0x32662f){_0xf340cc[_0xfd3c('0xb6')]=_0x32662f;if(_0x13331e===_0xfd3c('0x59')&&_0x549fff[_0xfd3c('0x91')][_0xfd3c('0xbb')]==='true'){var _0x8b462=[];for(var _0x147473=0x0;_0x147473<_0xf340cc[_0xfd3c('0xb6')][_0xfd3c('0x96')];_0x147473++){_0x8b462[_0xfd3c('0x9d')](_0x5b75be(_0xfd3c('0xbc'),_0xf340cc[_0xfd3c('0xb6')][_0x147473][_0xfd3c('0xbd')]));_0x8b462[_0xfd3c('0x9d')](_0x5b75be(_0xfd3c('0xbe'),_0xf340cc[_0xfd3c('0xb6')][_0x147473]['dataValues']));_0x8b462[_0xfd3c('0x9d')](_0x5b75be(_0xfd3c('0xbf'),_0xf340cc[_0xfd3c('0xb6')][_0x147473][_0xfd3c('0xbd')]));_0x8b462[_0xfd3c('0x9d')](_0x5b75be(_0xfd3c('0xc0'),_0xf340cc[_0xfd3c('0xb6')][_0x147473]['dataValues']));_0x8b462[_0xfd3c('0x9d')](_0x5b75be(_0xfd3c('0xc1'),_0xf340cc[_0xfd3c('0xb6')][_0x147473][_0xfd3c('0xbd')]));_0x8b462[_0xfd3c('0x9d')](_0x5b75be(_0xfd3c('0xc2'),_0xf340cc[_0xfd3c('0xb6')][_0x147473][_0xfd3c('0xbd')]));}return Promise['all'](_0x8b462)[_0xfd3c('0x6')](function(){return _0xf340cc;});}return _0xf340cc;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 8709ea0..9c75459 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 _0x44c2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','socket.io-emitter','redis','register','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x139e6a,_0x443ab7){var _0x19c2ba=function(_0x5be05b){while(--_0x5be05b){_0x139e6a['push'](_0x139e6a['shift']());}};_0x19c2ba(++_0x443ab7);}(_0x44c2,0x100));var _0x244c=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0x44c2[_0x408e38];return _0x426b0e;};'use strict';var _=require(_0x244c('0x0'));var util=require(_0x244c('0x1'));var moment=require(_0x244c('0x2'));var BPromise=require(_0x244c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x244c('0x4'));var db=require(_0x244c('0x5'))['db'];var utils=require(_0x244c('0x6'));var logger=require(_0x244c('0x7'))(_0x244c('0x8'));var config=require(_0x244c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x244c('0xa')]({'port':0x232a});config['redis']=_[_0x244c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x244c('0xc'))(new Redis(config[_0x244c('0xd')]));require('./userProfile.socket')[_0x244c('0xe')](socket);function respondWithRpcPromise(_0x5b873e,_0x519feb,_0x10a810){return new BPromise(function(_0x4d7289,_0x16c6f9){return client['request'](_0x5b873e,_0x10a810)[_0x244c('0xf')](function(_0x53c038){logger['info'](_0x244c('0x10'),_0x519feb,_0x244c('0x11'));logger[_0x244c('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x519feb,_0x244c('0x11'),JSON[_0x244c('0x13')](_0x53c038));if(_0x53c038[_0x244c('0x14')]){if(_0x53c038[_0x244c('0x14')][_0x244c('0x15')]===0x1f4){logger[_0x244c('0x14')](_0x244c('0x10'),_0x519feb,_0x53c038['error'][_0x244c('0x16')]);return _0x16c6f9(_0x53c038['error']['message']);}logger[_0x244c('0x14')](_0x244c('0x10'),_0x519feb,_0x53c038[_0x244c('0x14')][_0x244c('0x16')]);return _0x4d7289(_0x53c038['error'][_0x244c('0x16')]);}else{logger[_0x244c('0x17')](_0x244c('0x10'),_0x519feb,_0x244c('0x11'));_0x4d7289(_0x53c038[_0x244c('0x18')]['message']);}})[_0x244c('0x19')](function(_0x2af7eb){logger[_0x244c('0x14')]('UserProfile,\x20%s,\x20%s',_0x519feb,_0x2af7eb);_0x16c6f9(_0x2af7eb);});});} \ No newline at end of file +var _0x6d11=['info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./userProfile.socket','register','request','then'];(function(_0xd6abff,_0x917a99){var _0x4148e8=function(_0x446c15){while(--_0x446c15){_0xd6abff['push'](_0xd6abff['shift']());}};_0x4148e8(++_0x917a99);}(_0x6d11,0xbf));var _0x16d1=function(_0x18a57b,_0x25907a){_0x18a57b=_0x18a57b-0x0;var _0x462f0f=_0x6d11[_0x18a57b];return _0x462f0f;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});config[_0x16d1('0xa')]=_[_0x16d1('0xb')](config[_0x16d1('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x16d1('0xc'))[_0x16d1('0xd')](socket);function respondWithRpcPromise(_0xe67758,_0x5a6abb,_0x4b7d4f){return new BPromise(function(_0x265a84,_0x2c360f){return client[_0x16d1('0xe')](_0xe67758,_0x4b7d4f)[_0x16d1('0xf')](function(_0x28188f){logger[_0x16d1('0x10')](_0x16d1('0x11'),_0x5a6abb,_0x16d1('0x12'));logger['debug'](_0x16d1('0x13'),_0x5a6abb,_0x16d1('0x12'),JSON[_0x16d1('0x14')](_0x28188f));if(_0x28188f[_0x16d1('0x15')]){if(_0x28188f[_0x16d1('0x15')]['code']===0x1f4){logger[_0x16d1('0x15')](_0x16d1('0x11'),_0x5a6abb,_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);return _0x2c360f(_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);}logger[_0x16d1('0x15')]('UserProfile,\x20%s,\x20%s',_0x5a6abb,_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);return _0x265a84(_0x28188f['error']['message']);}else{logger[_0x16d1('0x10')]('UserProfile,\x20%s,\x20%s',_0x5a6abb,_0x16d1('0x12'));_0x265a84(_0x28188f['result'][_0x16d1('0x16')]);}})['catch'](function(_0x30f694){logger[_0x16d1('0x15')]('UserProfile,\x20%s,\x20%s',_0x5a6abb,_0x30f694);_0x2c360f(_0x30f694);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 415e097..fb042bb 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 _0x6cf9=['emit','removeListener','register','length','userProfile:','./userProfile.events','save','remove'];(function(_0x2466a0,_0x153137){var _0x4aef30=function(_0x353a3f){while(--_0x353a3f){_0x2466a0['push'](_0x2466a0['shift']());}};_0x4aef30(++_0x153137);}(_0x6cf9,0x7d));var _0x96cf=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0x6cf9[_0x15af0f];return _0x2bd1cb;};'use strict';var UserProfileEvents=require(_0x96cf('0x0'));var events=[_0x96cf('0x1'),_0x96cf('0x2'),'update'];function createListener(_0x4a9475,_0x28ac94){return function(_0x180397){_0x28ac94[_0x96cf('0x3')](_0x4a9475,_0x180397);};}function removeListener(_0x167481,_0x1b677b){return function(){UserProfileEvents[_0x96cf('0x4')](_0x167481,_0x1b677b);};}exports[_0x96cf('0x5')]=function(_0x5147a2){for(var _0x1362b8=0x0,_0x1a06ee=events[_0x96cf('0x6')];_0x1362b8<_0x1a06ee;_0x1362b8++){var _0x563eb5=events[_0x1362b8];var _0x455b90=createListener(_0x96cf('0x7')+_0x563eb5,_0x5147a2);UserProfileEvents['on'](_0x563eb5,_0x455b90);}}; \ No newline at end of file +var _0x7324=['emit','removeListener','register','length','userProfile:','update'];(function(_0x8fd72a,_0x3dc489){var _0x4a5d4b=function(_0x479775){while(--_0x479775){_0x8fd72a['push'](_0x8fd72a['shift']());}};_0x4a5d4b(++_0x3dc489);}(_0x7324,0x10d));var _0x4732=function(_0x5ddc2a,_0x389c44){_0x5ddc2a=_0x5ddc2a-0x0;var _0x2543e4=_0x7324[_0x5ddc2a];return _0x2543e4;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save','remove',_0x4732('0x0')];function createListener(_0x3fcd1b,_0x2a97c1){return function(_0x2e1658){_0x2a97c1[_0x4732('0x1')](_0x3fcd1b,_0x2e1658);};}function removeListener(_0x19a596,_0x4fa5d8){return function(){UserProfileEvents[_0x4732('0x2')](_0x19a596,_0x4fa5d8);};}exports[_0x4732('0x3')]=function(_0x4b0406){for(var _0x7626ce=0x0,_0x293d86=events[_0x4732('0x4')];_0x7626ce<_0x293d86;_0x7626ce++){var _0x2f0758=events[_0x7626ce];var _0x605566=createListener(_0x4732('0x5')+_0x2f0758,_0x4b0406);UserProfileEvents['on'](_0x2f0758,_0x605566);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 2747b19..028e5c1 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 _0x20d2=['update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x340572,_0x53a173){var _0xe0057c=function(_0x94a519){while(--_0x94a519){_0x340572['push'](_0x340572['shift']());}};_0xe0057c(++_0x53a173);}(_0x20d2,0x1d0));var _0x220d=function(_0x275256,_0x299ac3){_0x275256=_0x275256-0x0;var _0x1a4481=_0x20d2[_0x275256];return _0x1a4481;};'use strict';var multer=require(_0x220d('0x0'));var util=require('util');var path=require(_0x220d('0x1'));var timeout=require(_0x220d('0x2'));var express=require(_0x220d('0x3'));var router=express[_0x220d('0x4')]();var fs_extra=require(_0x220d('0x5'));var auth=require(_0x220d('0x6'));var interaction=require(_0x220d('0x7'));var config=require('../../config/environment');var controller=require(_0x220d('0x8'));router[_0x220d('0x9')]('/',auth[_0x220d('0xa')](),controller[_0x220d('0xb')]);router[_0x220d('0x9')](_0x220d('0xc'),auth[_0x220d('0xa')](),controller[_0x220d('0xd')]);router[_0x220d('0x9')](_0x220d('0xe'),auth['isAuthenticated'](),controller[_0x220d('0xf')]);router[_0x220d('0x10')]('/',auth['isAuthenticated'](),controller[_0x220d('0x11')]);router[_0x220d('0x12')](_0x220d('0xe'),auth[_0x220d('0xa')](),controller[_0x220d('0x13')]);router['delete'](_0x220d('0xe'),auth['isAuthenticated'](),controller[_0x220d('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7152=['./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x445df7,_0x5d785d){var _0x35239b=function(_0x148caa){while(--_0x148caa){_0x445df7['push'](_0x445df7['shift']());}};_0x35239b(++_0x5d785d);}(_0x7152,0x1f1));var _0x2715=function(_0x1394a2,_0x533264){_0x1394a2=_0x1394a2-0x0;var _0x31dcd1=_0x7152[_0x1394a2];return _0x31dcd1;};'use strict';var multer=require(_0x2715('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2715('0x1'));var router=express[_0x2715('0x2')]();var fs_extra=require(_0x2715('0x3'));var auth=require(_0x2715('0x4'));var interaction=require(_0x2715('0x5'));var config=require(_0x2715('0x6'));var controller=require(_0x2715('0x7'));router[_0x2715('0x8')]('/',auth['isAuthenticated'](),controller[_0x2715('0x9')]);router[_0x2715('0x8')](_0x2715('0xa'),auth[_0x2715('0xb')](),controller[_0x2715('0xc')]);router['get'](_0x2715('0xd'),auth[_0x2715('0xb')](),controller[_0x2715('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2715('0xf')]);router[_0x2715('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2715('0x11')]);router[_0x2715('0x12')](_0x2715('0xd'),auth['isAuthenticated'](),controller[_0x2715('0x13')]);module[_0x2715('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index f88dbd6..e9257f1 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 _0xc3dd=['exports','STRING','INTEGER','sequelize'];(function(_0x5a26ab,_0x474e64){var _0x43d23a=function(_0x26737e){while(--_0x26737e){_0x5a26ab['push'](_0x5a26ab['shift']());}};_0x43d23a(++_0x474e64);}(_0xc3dd,0x133));var _0xdc3d=function(_0x2dc343,_0xf015a2){_0x2dc343=_0x2dc343-0x0;var _0x51eac5=_0xc3dd[_0x2dc343];return _0x51eac5;};'use strict';var Sequelize=require(_0xdc3d('0x0'));module[_0xdc3d('0x1')]={'name':{'type':Sequelize[_0xdc3d('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xdc3d('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x0df6=['sequelize','exports','STRING','INTEGER'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0x0df6,0x174));var _0x60df=function(_0x23f64c,_0x517e89){_0x23f64c=_0x23f64c-0x0;var _0x39e558=_0x0df6[_0x23f64c];return _0x39e558;};'use strict';var Sequelize=require(_0x60df('0x0'));module[_0x60df('0x1')]={'name':{'type':Sequelize[_0x60df('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x60df('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x60df('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 35f28e4..7130ecd 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 _0x1623=['filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','UserProfileResource','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1623,0xab));var _0x3162=function(_0xca998e,_0x500c24){_0xca998e=_0xca998e-0x0;var _0x203d02=_0x1623[_0xca998e];return _0x203d02;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['UserProfileResource'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')](_0x3d2958[_0x3162('0x48')],{})['then'](respondWithResult(_0x28865c,0xc9))[_0x3162('0x42')](handleError(_0x28865c,null));};exports['update']=function(_0x4f1dde,_0x12d791){if(_0x4f1dde[_0x3162('0x48')]['id']){delete _0x4f1dde[_0x3162('0x48')]['id'];}return db[_0x3162('0x3f')]['find']({'where':{'id':_0x4f1dde[_0x3162('0x44')]['id']}})['then'](handleEntityNotFound(_0x12d791,null))[_0x3162('0x24')](saveUpdates(_0x4f1dde[_0x3162('0x48')],null))['then'](respondWithResult(_0x12d791,null))[_0x3162('0x42')](handleError(_0x12d791,null));};exports['destroy']=function(_0x516599,_0x13e7c4){return db[_0x3162('0x3f')][_0x3162('0x46')]({'where':{'id':_0x516599[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x13e7c4,null))[_0x3162('0x24')](removeEntity(_0x13e7c4,null))[_0x3162('0x42')](handleError(_0x13e7c4,null));};exports[_0x3162('0x49')]=function(_0x554a03,_0x48b81d){return db['UserProfileResource'][_0x3162('0x49')]()[_0x3162('0x24')](respondWithResult(_0x48b81d,null))[_0x3162('0x42')](handleError(_0x48b81d,null));}; \ No newline at end of file +var _0x5fab=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x5fab,0x177));var _0xb5fa=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x5fab[_0x59befa];return _0x1dd63d;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['UserProfileResource'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')](_0x33eb2c[_0xb5fa('0x4d')],{})[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,0xc9))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x3a39f2,_0x52f5d8){if(_0x3a39f2['body']['id']){delete _0x3a39f2[_0xb5fa('0x4d')]['id'];}return db['UserProfileResource'][_0xb5fa('0x4a')]({'where':{'id':_0x3a39f2[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x43')](saveUpdates(_0x3a39f2[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x4b')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x26')]=function(_0x3ffee0,_0x51d5f7){return db[_0xb5fa('0x2d')]['find']({'where':{'id':_0x3ffee0[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x51d5f7,null))[_0xb5fa('0x43')](removeEntity(_0x51d5f7,null))['catch'](handleError(_0x51d5f7,null));};exports[_0xb5fa('0x4e')]=function(_0x130a0d,_0x4dea87){return db['UserProfileResource'][_0xb5fa('0x4e')]()[_0xb5fa('0x43')](respondWithResult(_0x4dea87,null))[_0xb5fa('0x4b')](handleError(_0x4dea87,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index e6f7973..46b043a 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 _0x25a0=['request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4c1155,_0x1513c0){var _0x57ddcd=function(_0x47b692){while(--_0x47b692){_0x4c1155['push'](_0x4c1155['shift']());}};_0x57ddcd(++_0x1513c0);}(_0x25a0,0x8a));var _0x025a=function(_0x46cfcb,_0xdd24a2){_0x46cfcb=_0x46cfcb-0x0;var _0x470242=_0x25a0[_0x46cfcb];return _0x470242;};'use strict';var _=require(_0x025a('0x0'));var util=require(_0x025a('0x1'));var logger=require(_0x025a('0x2'))(_0x025a('0x3'));var moment=require(_0x025a('0x4'));var BPromise=require(_0x025a('0x5'));var rp=require(_0x025a('0x6'));var fs=require('fs');var path=require(_0x025a('0x7'));var rimraf=require(_0x025a('0x8'));var config=require(_0x025a('0x9'));var attributes=require(_0x025a('0xa'));module[_0x025a('0xb')]=function(_0xd048a4,_0xae4712){return _0xd048a4[_0x025a('0xc')](_0x025a('0xd'),attributes,{'tableName':_0x025a('0xe'),'paranoid':![],'indexes':[{'name':_0x025a('0xf'),'fields':[_0x025a('0x10'),_0x025a('0x11')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6359=['resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources'];(function(_0x286425,_0x5dd72f){var _0x33d3dc=function(_0x422115){while(--_0x422115){_0x286425['push'](_0x286425['shift']());}};_0x33d3dc(++_0x5dd72f);}(_0x6359,0x101));var _0x9635=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6359[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x9635('0x0'));var util=require(_0x9635('0x1'));var logger=require(_0x9635('0x2'))(_0x9635('0x3'));var moment=require(_0x9635('0x4'));var BPromise=require(_0x9635('0x5'));var rp=require(_0x9635('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9635('0x7'));var config=require(_0x9635('0x8'));var attributes=require(_0x9635('0x9'));module[_0x9635('0xa')]=function(_0x33c6ba,_0x55debf){return _0x33c6ba['define'](_0x9635('0xb'),attributes,{'tableName':_0x9635('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x9635('0xd'),_0x9635('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index a1b3c4f..377f739 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 _0xbff3=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','then','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','info','result','catch'];(function(_0x5a71af,_0x5b17d9){var _0x4cf643=function(_0x4dc079){while(--_0x4dc079){_0x5a71af['push'](_0x5a71af['shift']());}};_0x4cf643(++_0x5b17d9);}(_0xbff3,0xdc));var _0x3bff=function(_0x995899,_0x5ed9d8){_0x995899=_0x995899-0x0;var _0x2e7d11=_0xbff3[_0x995899];return _0x2e7d11;};'use strict';var _=require(_0x3bff('0x0'));var util=require('util');var moment=require(_0x3bff('0x1'));var BPromise=require(_0x3bff('0x2'));var rs=require(_0x3bff('0x3'));var fs=require('fs');var Redis=require(_0x3bff('0x4'));var db=require(_0x3bff('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3bff('0x6'))('rpc');var config=require(_0x3bff('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3bff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x182783,_0xdc29b6,_0x56f7c3){return new BPromise(function(_0xff436c,_0x37ca09){return client[_0x3bff('0x9')](_0x182783,_0x56f7c3)[_0x3bff('0xa')](function(_0x44b12f){logger['info']('UserProfileResource,\x20%s,\x20%s',_0xdc29b6,_0x3bff('0xb'));logger[_0x3bff('0xc')](_0x3bff('0xd'),_0xdc29b6,_0x3bff('0xb'),JSON[_0x3bff('0xe')](_0x44b12f));if(_0x44b12f[_0x3bff('0xf')]){if(_0x44b12f[_0x3bff('0xf')][_0x3bff('0x10')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0xdc29b6,_0x44b12f[_0x3bff('0xf')][_0x3bff('0x11')]);return _0x37ca09(_0x44b12f[_0x3bff('0xf')]['message']);}logger['error'](_0x3bff('0x12'),_0xdc29b6,_0x44b12f[_0x3bff('0xf')][_0x3bff('0x11')]);return _0xff436c(_0x44b12f['error']['message']);}else{logger[_0x3bff('0x13')]('UserProfileResource,\x20%s,\x20%s',_0xdc29b6,_0x3bff('0xb'));_0xff436c(_0x44b12f[_0x3bff('0x14')][_0x3bff('0x11')]);}})[_0x3bff('0x15')](function(_0x59f2db){logger[_0x3bff('0xf')](_0x3bff('0x12'),_0xdc29b6,_0x59f2db);_0x37ca09(_0x59f2db);});});} \ No newline at end of file +var _0x230b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0x230b,0x1c7));var _0xb230=function(_0x1305c2,_0x183bb3){_0x1305c2=_0x1305c2-0x0;var _0x397d8e=_0x230b[_0x1305c2];return _0x397d8e;};'use strict';var _=require('lodash');var util=require(_0xb230('0x0'));var moment=require(_0xb230('0x1'));var BPromise=require(_0xb230('0x2'));var rs=require(_0xb230('0x3'));var fs=require('fs');var Redis=require(_0xb230('0x4'));var db=require(_0xb230('0x5'))['db'];var utils=require(_0xb230('0x6'));var logger=require('../../config/logger')(_0xb230('0x7'));var config=require(_0xb230('0x8'));var jayson=require(_0xb230('0x9'));var client=jayson[_0xb230('0xa')][_0xb230('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b06a1,_0x11e0ab,_0x590ca7){return new BPromise(function(_0x27b3d9,_0x33a45c){return client[_0xb230('0xc')](_0x2b06a1,_0x590ca7)[_0xb230('0xd')](function(_0x2342d8){logger[_0xb230('0xe')](_0xb230('0xf'),_0x11e0ab,_0xb230('0x10'));logger[_0xb230('0x11')](_0xb230('0x12'),_0x11e0ab,_0xb230('0x10'),JSON[_0xb230('0x13')](_0x2342d8));if(_0x2342d8[_0xb230('0x14')]){if(_0x2342d8['error'][_0xb230('0x15')]===0x1f4){logger[_0xb230('0x14')](_0xb230('0xf'),_0x11e0ab,_0x2342d8[_0xb230('0x14')][_0xb230('0x16')]);return _0x33a45c(_0x2342d8[_0xb230('0x14')][_0xb230('0x16')]);}logger[_0xb230('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x11e0ab,_0x2342d8['error'][_0xb230('0x16')]);return _0x27b3d9(_0x2342d8[_0xb230('0x14')][_0xb230('0x16')]);}else{logger['info'](_0xb230('0xf'),_0x11e0ab,_0xb230('0x10'));_0x27b3d9(_0x2342d8['result'][_0xb230('0x16')]);}})[_0xb230('0x17')](function(_0x266829){logger['error'](_0xb230('0xf'),_0x11e0ab,_0x266829);_0x33a45c(_0x266829);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9ff076f..ccda33e 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 _0x4523=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','show','create','put','/:id','update','delete'];(function(_0x84c086,_0x24418a){var _0x57c398=function(_0x54fd6f){while(--_0x54fd6f){_0x84c086['push'](_0x84c086['shift']());}};_0x57c398(++_0x24418a);}(_0x4523,0x7a));var _0x3452=function(_0x256f7e,_0x5dcd6b){_0x256f7e=_0x256f7e-0x0;var _0x2a2a47=_0x4523[_0x256f7e];return _0x2a2a47;};'use strict';var multer=require(_0x3452('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3452('0x1'));var express=require(_0x3452('0x2'));var router=express[_0x3452('0x3')]();var fs_extra=require(_0x3452('0x4'));var auth=require(_0x3452('0x5'));var interaction=require(_0x3452('0x6'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x3452('0x7')](),controller[_0x3452('0x8')]);router[_0x3452('0x9')](_0x3452('0xa'),auth[_0x3452('0x7')](),controller[_0x3452('0xb')]);router[_0x3452('0x9')]('/:id',auth[_0x3452('0x7')](),controller[_0x3452('0xc')]);router['post']('/',auth[_0x3452('0x7')](),controller[_0x3452('0xd')]);router[_0x3452('0xe')](_0x3452('0xf'),auth[_0x3452('0x7')](),controller[_0x3452('0x10')]);router[_0x3452('0x11')](_0x3452('0xf'),auth[_0x3452('0x7')](),controller[_0x3452('0x12')]);module[_0x3452('0x13')]=router; \ No newline at end of file +var _0x9ffa=['delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','create','update'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0x9ffa,0x147));var _0xa9ff=function(_0x49fbd1,_0x1ee93c){_0x49fbd1=_0x49fbd1-0x0;var _0x281af8=_0x9ffa[_0x49fbd1];return _0x281af8;};'use strict';var multer=require('multer');var util=require(_0xa9ff('0x0'));var path=require(_0xa9ff('0x1'));var timeout=require(_0xa9ff('0x2'));var express=require('express');var router=express[_0xa9ff('0x3')]();var fs_extra=require(_0xa9ff('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa9ff('0x5'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0xa9ff('0x6')]('/',auth['isAuthenticated'](),controller[_0xa9ff('0x7')]);router[_0xa9ff('0x6')](_0xa9ff('0x8'),auth[_0xa9ff('0x9')](),controller[_0xa9ff('0xa')]);router[_0xa9ff('0x6')](_0xa9ff('0xb'),auth[_0xa9ff('0x9')](),controller[_0xa9ff('0xc')]);router['post']('/',auth[_0xa9ff('0x9')](),controller[_0xa9ff('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa9ff('0xe')]);router[_0xa9ff('0xf')](_0xa9ff('0xb'),auth['isAuthenticated'](),controller[_0xa9ff('0x10')]);module[_0xa9ff('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 9c424f9..9759c66 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 _0x0102=['exports','STRING','INTEGER','crudPermissions','join','getDataValue'];(function(_0x2095ed,_0x156cfb){var _0x22dbb0=function(_0x385055){while(--_0x385055){_0x2095ed['push'](_0x2095ed['shift']());}};_0x22dbb0(++_0x156cfb);}(_0x0102,0x186));var _0x2010=function(_0x9ebd5e,_0x5aa27a){_0x9ebd5e=_0x9ebd5e-0x0;var _0x569606=_0x0102[_0x9ebd5e];return _0x569606;};'use strict';var Sequelize=require('sequelize');module[_0x2010('0x0')]={'name':{'type':Sequelize[_0x2010('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x2010('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x2010('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4e30b3){this['setDataValue'](_0x2010('0x3'),_0x4e30b3?_0x4e30b3[_0x2010('0x4')](''):[]);},'get':function(){return this[_0x2010('0x5')](_0x2010('0x3'))?this['getDataValue'](_0x2010('0x3'))['split'](''):[];}}}; \ No newline at end of file +var _0x97c1=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x4b22b4,_0x350995){var _0x211b4b=function(_0x1c18a4){while(--_0x1c18a4){_0x4b22b4['push'](_0x4b22b4['shift']());}};_0x211b4b(++_0x350995);}(_0x97c1,0xdf));var _0x197c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x97c1[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x197c('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x197c('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x197c('0x2')],'set':function(_0x26833e){this[_0x197c('0x4')](_0x197c('0x5'),_0x26833e?_0x26833e['join'](''):[]);},'get':function(){return this['getDataValue'](_0x197c('0x5'))?this[_0x197c('0x6')](_0x197c('0x5'))[_0x197c('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 3d98611..4787960 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 _0x4b31=['limit','undefined','count','Content-Range','apply','save','then','destroy','error','stack','send','index','UserProfileSection','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','VIRTUAL','includeAll','catch','show','params','include','options','find','create','body','describe','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4b31,0x194));var _0x14b3=function(_0x102b48,_0x1ffa36){_0x102b48=_0x102b48-0x0;var _0x1819c4=_0x4b31[_0x102b48];return _0x1819c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x14b3('0x0'));var rp=require(_0x14b3('0x1'));var moment=require(_0x14b3('0x2'));var BPromise=require(_0x14b3('0x3'));var Mustache=require('mustache');var util=require(_0x14b3('0x4'));var path=require(_0x14b3('0x5'));var sox=require(_0x14b3('0x6'));var csv=require(_0x14b3('0x7'));var ejs=require(_0x14b3('0x8'));var fs=require('fs');var fs_extra=require(_0x14b3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x14b3('0xa'));var jsforce=require(_0x14b3('0xb'));var deskjs=require(_0x14b3('0xc'));var toCsv=require(_0x14b3('0x7'));var querystring=require(_0x14b3('0xd'));var Papa=require(_0x14b3('0xe'));var Redis=require(_0x14b3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x14b3('0x10'));var as=require(_0x14b3('0x11'));var hardwareService=require(_0x14b3('0x12'));var logger=require(_0x14b3('0x13'))('api');var utils=require(_0x14b3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x14b3('0x15'));var db=require(_0x14b3('0x16'))['db'];function respondWithStatusCode(_0x282620,_0x26dd6f){_0x26dd6f=_0x26dd6f||0xcc;return function(_0x9fdb77){if(_0x9fdb77){return _0x282620[_0x14b3('0x17')](_0x26dd6f);}return _0x282620[_0x14b3('0x18')](_0x26dd6f)[_0x14b3('0x19')]();};}function respondWithResult(_0x3dfaef,_0x8843df){_0x8843df=_0x8843df||0xc8;return function(_0x50ffae){if(_0x50ffae){return _0x3dfaef['status'](_0x8843df)[_0x14b3('0x1a')](_0x50ffae);}};}function respondWithFilteredResult(_0x58faed,_0x15ab53){return function(_0x34d381){if(_0x34d381){var _0x19dc24=typeof _0x15ab53[_0x14b3('0x1b')]==='undefined'&&typeof _0x15ab53[_0x14b3('0x1c')]===_0x14b3('0x1d');var _0x37a724=_0x34d381['count'];var _0x49c441=_0x19dc24?0x0:_0x15ab53[_0x14b3('0x1b')];var _0x30a7bc=_0x19dc24?_0x34d381[_0x14b3('0x1e')]:_0x15ab53[_0x14b3('0x1b')]+_0x15ab53[_0x14b3('0x1c')];var _0xd806ac;if(_0x30a7bc>=_0x37a724){_0x30a7bc=_0x37a724;_0xd806ac=0xc8;}else{_0xd806ac=0xce;}_0x58faed[_0x14b3('0x18')](_0xd806ac);return _0x58faed['set'](_0x14b3('0x1f'),_0x49c441+'-'+_0x30a7bc+'/'+_0x37a724)['json'](_0x34d381);}return null;};}function patchUpdates(_0x2b4a9f){return function(_0x28c480){try{jsonpatch[_0x14b3('0x20')](_0x28c480,_0x2b4a9f,!![]);}catch(_0x1ad653){return BPromise['reject'](_0x1ad653);}return _0x28c480[_0x14b3('0x21')]();};}function saveUpdates(_0xfdea45,_0x37c7a7){return function(_0x1917c9){if(_0x1917c9){return _0x1917c9['update'](_0xfdea45)[_0x14b3('0x22')](function(_0x21090f){return _0x21090f;});}return null;};}function removeEntity(_0xba329b,_0x440b2e){return function(_0x2d93e3){if(_0x2d93e3){return _0x2d93e3[_0x14b3('0x23')]()[_0x14b3('0x22')](function(){_0xba329b[_0x14b3('0x18')](0xcc)[_0x14b3('0x19')]();});}};}function handleEntityNotFound(_0x3dbff9,_0x2c0e04){return function(_0x125404){if(!_0x125404){_0x3dbff9[_0x14b3('0x17')](0x194);}return _0x125404;};}function handleError(_0x51ff10,_0x210b03){_0x210b03=_0x210b03||0x1f4;return function(_0x4c2270){logger[_0x14b3('0x24')](_0x4c2270[_0x14b3('0x25')]);if(_0x4c2270['name']){delete _0x4c2270['name'];}_0x51ff10[_0x14b3('0x18')](_0x210b03)[_0x14b3('0x26')](_0x4c2270);};}exports[_0x14b3('0x27')]=function(_0x3d112d,_0x3a5f77){var _0x5b5189={},_0xcb0e07={},_0x5b6527={'count':0x0,'rows':[]};var _0x112614=_['map'](db[_0x14b3('0x28')][_0x14b3('0x29')],function(_0x2b8aae){return{'name':_0x2b8aae[_0x14b3('0x2a')],'type':_0x2b8aae[_0x14b3('0x2b')][_0x14b3('0x2c')]};});_0xcb0e07[_0x14b3('0x2d')]=_['map'](_0x112614,_0x14b3('0x2e'));_0xcb0e07[_0x14b3('0x2f')]=_[_0x14b3('0x30')](_0x3d112d['query']);_0xcb0e07['filters']=_[_0x14b3('0x31')](_0xcb0e07['model'],_0xcb0e07['query']);_0x5b5189[_0x14b3('0x32')]=_['intersection'](_0xcb0e07['model'],qs[_0x14b3('0x33')](_0x3d112d[_0x14b3('0x2f')][_0x14b3('0x33')]));_0x5b5189[_0x14b3('0x32')]=_0x5b5189['attributes'][_0x14b3('0x34')]?_0x5b5189[_0x14b3('0x32')]:_0xcb0e07[_0x14b3('0x2d')];if(!_0x3d112d[_0x14b3('0x2f')][_0x14b3('0x35')](_0x14b3('0x36'))){_0x5b5189[_0x14b3('0x1c')]=qs['limit'](_0x3d112d['query'][_0x14b3('0x1c')]);_0x5b5189[_0x14b3('0x1b')]=qs[_0x14b3('0x1b')](_0x3d112d[_0x14b3('0x2f')][_0x14b3('0x1b')]);}_0x5b5189[_0x14b3('0x37')]=qs['sort'](_0x3d112d['query'][_0x14b3('0x38')]);_0x5b5189[_0x14b3('0x39')]=qs[_0x14b3('0x3a')](_['pick'](_0x3d112d['query'],_0xcb0e07[_0x14b3('0x3a')]),_0x112614);if(_0x3d112d[_0x14b3('0x2f')]['filter']){_0x5b5189['where']=_[_0x14b3('0x3b')](_0x5b5189[_0x14b3('0x39')],{'$or':_[_0x14b3('0x3c')](_0x112614,function(_0x3395c9){if(_0x3395c9[_0x14b3('0x2b')]!==_0x14b3('0x3d')){var _0x45a691={};_0x45a691[_0x3395c9[_0x14b3('0x2e')]]={'$like':'%'+_0x3d112d[_0x14b3('0x2f')]['filter']+'%'};return _0x45a691;}})});}_0x5b5189=_[_0x14b3('0x3b')]({},_0x5b5189,_0x3d112d['options']);var _0x20c143={'where':_0x5b5189[_0x14b3('0x39')]};return db[_0x14b3('0x28')]['count'](_0x20c143)['then'](function(_0x25c9f5){_0x5b6527['count']=_0x25c9f5;if(_0x3d112d[_0x14b3('0x2f')][_0x14b3('0x3e')]){_0x5b5189['include']=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x5b5189);})[_0x14b3('0x22')](function(_0x4bdcd7){_0x5b6527['rows']=_0x4bdcd7;return _0x5b6527;})['then'](respondWithFilteredResult(_0x3a5f77,_0x5b5189))[_0x14b3('0x3f')](handleError(_0x3a5f77,null));};exports[_0x14b3('0x40')]=function(_0xb2445b,_0x2a49ec){var _0x5d1a16={'raw':![],'where':{'id':_0xb2445b[_0x14b3('0x41')]['id']}},_0x500177={};_0x500177[_0x14b3('0x2d')]=_[_0x14b3('0x30')](db[_0x14b3('0x28')][_0x14b3('0x29')]);_0x500177[_0x14b3('0x2f')]=_['keys'](_0xb2445b[_0x14b3('0x2f')]);_0x500177['filters']=_[_0x14b3('0x31')](_0x500177[_0x14b3('0x2d')],_0x500177[_0x14b3('0x2f')]);_0x5d1a16[_0x14b3('0x32')]=_['intersection'](_0x500177[_0x14b3('0x2d')],qs[_0x14b3('0x33')](_0xb2445b['query']['fields']));_0x5d1a16[_0x14b3('0x32')]=_0x5d1a16[_0x14b3('0x32')]['length']?_0x5d1a16[_0x14b3('0x32')]:_0x500177[_0x14b3('0x2d')];if(_0xb2445b[_0x14b3('0x2f')][_0x14b3('0x3e')]){_0x5d1a16[_0x14b3('0x42')]=[{'all':!![]}];}_0x5d1a16=_['merge']({},_0x5d1a16,_0xb2445b[_0x14b3('0x43')]);return db[_0x14b3('0x28')][_0x14b3('0x44')](_0x5d1a16)[_0x14b3('0x22')](handleEntityNotFound(_0x2a49ec,null))[_0x14b3('0x22')](respondWithResult(_0x2a49ec,null))['catch'](handleError(_0x2a49ec,null));};exports[_0x14b3('0x45')]=function(_0x2d5d00,_0x5a944b){return db[_0x14b3('0x28')][_0x14b3('0x45')](_0x2d5d00['body'],{})[_0x14b3('0x22')](respondWithResult(_0x5a944b,0xc9))['catch'](handleError(_0x5a944b,null));};exports['update']=function(_0x1309d7,_0x230907){if(_0x1309d7['body']['id']){delete _0x1309d7[_0x14b3('0x46')]['id'];}return db[_0x14b3('0x28')][_0x14b3('0x44')]({'where':{'id':_0x1309d7[_0x14b3('0x41')]['id']}})[_0x14b3('0x22')](handleEntityNotFound(_0x230907,null))[_0x14b3('0x22')](saveUpdates(_0x1309d7[_0x14b3('0x46')],null))[_0x14b3('0x22')](respondWithResult(_0x230907,null))[_0x14b3('0x3f')](handleError(_0x230907,null));};exports['destroy']=function(_0x1d3005,_0x1205c0){return db[_0x14b3('0x28')]['find']({'where':{'id':_0x1d3005[_0x14b3('0x41')]['id']}})['then'](handleEntityNotFound(_0x1205c0,null))[_0x14b3('0x22')](removeEntity(_0x1205c0,null))['catch'](handleError(_0x1205c0,null));};exports[_0x14b3('0x47')]=function(_0x54a1db,_0x25c085){return db['UserProfileSection'][_0x14b3('0x47')]()[_0x14b3('0x22')](respondWithResult(_0x25c085,null))[_0x14b3('0x3f')](handleError(_0x25c085,null));}; \ No newline at end of file +var _0x11c9=['error','stack','name','index','map','UserProfileSection','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','VIRTUAL','options','count','then','includeAll','findAll','show','params','rawAttributes','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','Content-Range','apply','save','update','destroy','sendStatus'];(function(_0x10975b,_0xeab274){var _0xf85f98=function(_0x45e374){while(--_0x45e374){_0x10975b['push'](_0x10975b['shift']());}};_0xf85f98(++_0xeab274);}(_0x11c9,0x70));var _0x911c=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0x11c9[_0x5ef905];return _0x367808;};'use strict';var emlformat=require(_0x911c('0x0'));var rimraf=require(_0x911c('0x1'));var zipdir=require(_0x911c('0x2'));var jsonpatch=require(_0x911c('0x3'));var rp=require(_0x911c('0x4'));var moment=require(_0x911c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x911c('0x6'));var util=require(_0x911c('0x7'));var path=require('path');var sox=require(_0x911c('0x8'));var csv=require(_0x911c('0x9'));var ejs=require(_0x911c('0xa'));var fs=require('fs');var fs_extra=require(_0x911c('0xb'));var _=require(_0x911c('0xc'));var squel=require('squel');var crypto=require(_0x911c('0xd'));var jsforce=require(_0x911c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x911c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x911c('0xf'));var authService=require(_0x911c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x911c('0x11'));var logger=require(_0x911c('0x12'))(_0x911c('0x13'));var utils=require(_0x911c('0x14'));var config=require(_0x911c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x911c('0x16'))['db'];function respondWithStatusCode(_0x459be7,_0x2d58e1){_0x2d58e1=_0x2d58e1||0xcc;return function(_0x1e70c2){if(_0x1e70c2){return _0x459be7['sendStatus'](_0x2d58e1);}return _0x459be7[_0x911c('0x17')](_0x2d58e1)[_0x911c('0x18')]();};}function respondWithResult(_0x5a924a,_0x262ebe){_0x262ebe=_0x262ebe||0xc8;return function(_0x169c47){if(_0x169c47){return _0x5a924a['status'](_0x262ebe)[_0x911c('0x19')](_0x169c47);}};}function respondWithFilteredResult(_0x317081,_0x20d3f5){return function(_0xaeffb8){if(_0xaeffb8){var _0x24e363=typeof _0x20d3f5[_0x911c('0x1a')]===_0x911c('0x1b')&&typeof _0x20d3f5['limit']===_0x911c('0x1b');var _0x45a379=_0xaeffb8['count'];var _0x2f094a=_0x24e363?0x0:_0x20d3f5[_0x911c('0x1a')];var _0x52ebf1=_0x24e363?_0xaeffb8['count']:_0x20d3f5[_0x911c('0x1a')]+_0x20d3f5['limit'];var _0x25999b;if(_0x52ebf1>=_0x45a379){_0x52ebf1=_0x45a379;_0x25999b=0xc8;}else{_0x25999b=0xce;}_0x317081['status'](_0x25999b);return _0x317081['set'](_0x911c('0x1c'),_0x2f094a+'-'+_0x52ebf1+'/'+_0x45a379)['json'](_0xaeffb8);}return null;};}function patchUpdates(_0x520219){return function(_0x143e32){try{jsonpatch[_0x911c('0x1d')](_0x143e32,_0x520219,!![]);}catch(_0xf2b0d2){return BPromise['reject'](_0xf2b0d2);}return _0x143e32[_0x911c('0x1e')]();};}function saveUpdates(_0x236edf,_0x3e074d){return function(_0x5752aa){if(_0x5752aa){return _0x5752aa[_0x911c('0x1f')](_0x236edf)['then'](function(_0x53d21a){return _0x53d21a;});}return null;};}function removeEntity(_0x2e0a68,_0x50bc7d){return function(_0x477081){if(_0x477081){return _0x477081[_0x911c('0x20')]()['then'](function(){_0x2e0a68['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e86ca,_0x599404){return function(_0xb13451){if(!_0xb13451){_0x4e86ca[_0x911c('0x21')](0x194);}return _0xb13451;};}function handleError(_0x8f91ef,_0x549769){_0x549769=_0x549769||0x1f4;return function(_0x110a09){logger[_0x911c('0x22')](_0x110a09[_0x911c('0x23')]);if(_0x110a09[_0x911c('0x24')]){delete _0x110a09[_0x911c('0x24')];}_0x8f91ef[_0x911c('0x17')](_0x549769)['send'](_0x110a09);};}exports[_0x911c('0x25')]=function(_0xc21d69,_0x14d8b8){var _0x3a698e={},_0x2167a8={},_0xfccac5={'count':0x0,'rows':[]};var _0xfc3d5=_[_0x911c('0x26')](db[_0x911c('0x27')]['rawAttributes'],function(_0x21341d){return{'name':_0x21341d[_0x911c('0x28')],'type':_0x21341d[_0x911c('0x29')]['key']};});_0x2167a8[_0x911c('0x2a')]=_[_0x911c('0x26')](_0xfc3d5,_0x911c('0x24'));_0x2167a8['query']=_[_0x911c('0x2b')](_0xc21d69['query']);_0x2167a8[_0x911c('0x2c')]=_[_0x911c('0x2d')](_0x2167a8[_0x911c('0x2a')],_0x2167a8[_0x911c('0x2e')]);_0x3a698e[_0x911c('0x2f')]=_[_0x911c('0x2d')](_0x2167a8['model'],qs[_0x911c('0x30')](_0xc21d69['query'][_0x911c('0x30')]));_0x3a698e[_0x911c('0x2f')]=_0x3a698e['attributes'][_0x911c('0x31')]?_0x3a698e['attributes']:_0x2167a8[_0x911c('0x2a')];if(!_0xc21d69[_0x911c('0x2e')][_0x911c('0x32')](_0x911c('0x33'))){_0x3a698e[_0x911c('0x34')]=qs[_0x911c('0x34')](_0xc21d69[_0x911c('0x2e')][_0x911c('0x34')]);_0x3a698e[_0x911c('0x1a')]=qs[_0x911c('0x1a')](_0xc21d69[_0x911c('0x2e')][_0x911c('0x1a')]);}_0x3a698e[_0x911c('0x35')]=qs[_0x911c('0x36')](_0xc21d69[_0x911c('0x2e')][_0x911c('0x36')]);_0x3a698e['where']=qs[_0x911c('0x2c')](_[_0x911c('0x37')](_0xc21d69[_0x911c('0x2e')],_0x2167a8[_0x911c('0x2c')]),_0xfc3d5);if(_0xc21d69[_0x911c('0x2e')][_0x911c('0x38')]){_0x3a698e['where']=_[_0x911c('0x39')](_0x3a698e['where'],{'$or':_['map'](_0xfc3d5,function(_0x4c0a39){if(_0x4c0a39['type']!==_0x911c('0x3a')){var _0x703119={};_0x703119[_0x4c0a39[_0x911c('0x24')]]={'$like':'%'+_0xc21d69[_0x911c('0x2e')][_0x911c('0x38')]+'%'};return _0x703119;}})});}_0x3a698e=_['merge']({},_0x3a698e,_0xc21d69[_0x911c('0x3b')]);var _0x3fa5b7={'where':_0x3a698e['where']};return db['UserProfileSection'][_0x911c('0x3c')](_0x3fa5b7)[_0x911c('0x3d')](function(_0x3ab7f0){_0xfccac5[_0x911c('0x3c')]=_0x3ab7f0;if(_0xc21d69[_0x911c('0x2e')][_0x911c('0x3e')]){_0x3a698e['include']=[{'all':!![]}];}return db[_0x911c('0x27')][_0x911c('0x3f')](_0x3a698e);})[_0x911c('0x3d')](function(_0x1b7e1e){_0xfccac5['rows']=_0x1b7e1e;return _0xfccac5;})[_0x911c('0x3d')](respondWithFilteredResult(_0x14d8b8,_0x3a698e))['catch'](handleError(_0x14d8b8,null));};exports[_0x911c('0x40')]=function(_0x1295f1,_0x296c01){var _0x342e9d={'raw':![],'where':{'id':_0x1295f1[_0x911c('0x41')]['id']}},_0x307fa9={};_0x307fa9['model']=_[_0x911c('0x2b')](db[_0x911c('0x27')][_0x911c('0x42')]);_0x307fa9[_0x911c('0x2e')]=_[_0x911c('0x2b')](_0x1295f1['query']);_0x307fa9['filters']=_[_0x911c('0x2d')](_0x307fa9[_0x911c('0x2a')],_0x307fa9['query']);_0x342e9d['attributes']=_[_0x911c('0x2d')](_0x307fa9[_0x911c('0x2a')],qs[_0x911c('0x30')](_0x1295f1[_0x911c('0x2e')][_0x911c('0x30')]));_0x342e9d[_0x911c('0x2f')]=_0x342e9d[_0x911c('0x2f')][_0x911c('0x31')]?_0x342e9d[_0x911c('0x2f')]:_0x307fa9[_0x911c('0x2a')];if(_0x1295f1[_0x911c('0x2e')][_0x911c('0x3e')]){_0x342e9d[_0x911c('0x43')]=[{'all':!![]}];}_0x342e9d=_[_0x911c('0x39')]({},_0x342e9d,_0x1295f1[_0x911c('0x3b')]);return db[_0x911c('0x27')][_0x911c('0x44')](_0x342e9d)[_0x911c('0x3d')](handleEntityNotFound(_0x296c01,null))[_0x911c('0x3d')](respondWithResult(_0x296c01,null))[_0x911c('0x45')](handleError(_0x296c01,null));};exports[_0x911c('0x46')]=function(_0x3adcc0,_0x412a9c){return db[_0x911c('0x27')][_0x911c('0x46')](_0x3adcc0[_0x911c('0x47')],{})[_0x911c('0x3d')](respondWithResult(_0x412a9c,0xc9))[_0x911c('0x45')](handleError(_0x412a9c,null));};exports[_0x911c('0x1f')]=function(_0x15e2f8,_0x169725){if(_0x15e2f8['body']['id']){delete _0x15e2f8['body']['id'];}return db[_0x911c('0x27')][_0x911c('0x44')]({'where':{'id':_0x15e2f8[_0x911c('0x41')]['id']}})[_0x911c('0x3d')](handleEntityNotFound(_0x169725,null))[_0x911c('0x3d')](saveUpdates(_0x15e2f8[_0x911c('0x47')],null))['then'](respondWithResult(_0x169725,null))[_0x911c('0x45')](handleError(_0x169725,null));};exports[_0x911c('0x20')]=function(_0x341335,_0x4538b4){return db['UserProfileSection'][_0x911c('0x44')]({'where':{'id':_0x341335[_0x911c('0x41')]['id']}})[_0x911c('0x3d')](handleEntityNotFound(_0x4538b4,null))['then'](removeEntity(_0x4538b4,null))[_0x911c('0x45')](handleError(_0x4538b4,null));};exports[_0x911c('0x48')]=function(_0x5e6818,_0x2f5aed){return db[_0x911c('0x27')][_0x911c('0x48')]()['then'](respondWithResult(_0x2f5aed,null))[_0x911c('0x45')](handleError(_0x2f5aed,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index fb28852..b4706c6 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 _0x701b=['sectionId','userProfileId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection'];(function(_0x5c7055,_0x550d42){var _0x20d196=function(_0x47e15e){while(--_0x47e15e){_0x5c7055['push'](_0x5c7055['shift']());}};_0x20d196(++_0x550d42);}(_0x701b,0x9c));var _0xb701=function(_0x396dd7,_0x4534eb){_0x396dd7=_0x396dd7-0x0;var _0x3bedbb=_0x701b[_0x396dd7];return _0x3bedbb;};'use strict';var _=require(_0xb701('0x0'));var util=require(_0xb701('0x1'));var logger=require(_0xb701('0x2'))(_0xb701('0x3'));var moment=require(_0xb701('0x4'));var BPromise=require('bluebird');var rp=require(_0xb701('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb701('0x6'));var config=require(_0xb701('0x7'));var attributes=require(_0xb701('0x8'));module[_0xb701('0x9')]=function(_0x27e190,_0x4f8cdf){return _0x27e190[_0xb701('0xa')](_0xb701('0xb'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xb701('0xc'),_0xb701('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd72=['compositeIndex','sectionId','userProfileId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','user_profile_has_sections'];(function(_0x153136,_0x2be1b6){var _0x35abfd=function(_0xc9e71f){while(--_0xc9e71f){_0x153136['push'](_0x153136['shift']());}};_0x35abfd(++_0x2be1b6);}(_0xdd72,0xd5));var _0x2dd7=function(_0x58fbb0,_0xe497b5){_0x58fbb0=_0x58fbb0-0x0;var _0x1783d2=_0xdd72[_0x58fbb0];return _0x1783d2;};'use strict';var _=require('lodash');var util=require(_0x2dd7('0x0'));var logger=require(_0x2dd7('0x1'))(_0x2dd7('0x2'));var moment=require('moment');var BPromise=require(_0x2dd7('0x3'));var rp=require(_0x2dd7('0x4'));var fs=require('fs');var path=require(_0x2dd7('0x5'));var rimraf=require(_0x2dd7('0x6'));var config=require(_0x2dd7('0x7'));var attributes=require(_0x2dd7('0x8'));module[_0x2dd7('0x9')]=function(_0x1ce178,_0x24e034){return _0x1ce178['define']('UserProfileSection',attributes,{'tableName':_0x2dd7('0xa'),'paranoid':![],'indexes':[{'name':_0x2dd7('0xb'),'fields':[_0x2dd7('0xc'),_0x2dd7('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 5dd73e3..d54c730 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 _0x58fc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3332c2,_0x59efee){var _0x85588=function(_0x1c9909){while(--_0x1c9909){_0x3332c2['push'](_0x3332c2['shift']());}};_0x85588(++_0x59efee);}(_0x58fc,0x1ef));var _0xc58f=function(_0x1e8461,_0x5e1500){_0x1e8461=_0x1e8461-0x0;var _0x528f4d=_0x58fc[_0x1e8461];return _0x528f4d;};'use strict';var _=require('lodash');var util=require(_0xc58f('0x0'));var moment=require(_0xc58f('0x1'));var BPromise=require(_0xc58f('0x2'));var rs=require(_0xc58f('0x3'));var fs=require('fs');var Redis=require(_0xc58f('0x4'));var db=require(_0xc58f('0x5'))['db'];var utils=require(_0xc58f('0x6'));var logger=require(_0xc58f('0x7'))(_0xc58f('0x8'));var config=require(_0xc58f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc58f('0xa')][_0xc58f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc78db8,_0x515d3e,_0x5e45f9){return new BPromise(function(_0x302d7d,_0x42c389){return client[_0xc58f('0xc')](_0xc78db8,_0x5e45f9)[_0xc58f('0xd')](function(_0x44c10d){logger[_0xc58f('0xe')](_0xc58f('0xf'),_0x515d3e,_0xc58f('0x10'));logger[_0xc58f('0x11')](_0xc58f('0x12'),_0x515d3e,_0xc58f('0x10'),JSON[_0xc58f('0x13')](_0x44c10d));if(_0x44c10d[_0xc58f('0x14')]){if(_0x44c10d[_0xc58f('0x14')][_0xc58f('0x15')]===0x1f4){logger[_0xc58f('0x14')](_0xc58f('0xf'),_0x515d3e,_0x44c10d[_0xc58f('0x14')][_0xc58f('0x16')]);return _0x42c389(_0x44c10d[_0xc58f('0x14')]['message']);}logger['error'](_0xc58f('0xf'),_0x515d3e,_0x44c10d[_0xc58f('0x14')]['message']);return _0x302d7d(_0x44c10d[_0xc58f('0x14')]['message']);}else{logger['info'](_0xc58f('0xf'),_0x515d3e,_0xc58f('0x10'));_0x302d7d(_0x44c10d[_0xc58f('0x17')][_0xc58f('0x16')]);}})[_0xc58f('0x18')](function(_0xabd036){logger['error'](_0xc58f('0xf'),_0x515d3e,_0xabd036);_0x42c389(_0xabd036);});});} \ No newline at end of file +var _0xc1e6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','lodash','randomstring'];(function(_0x485905,_0x32c6e2){var _0x4479fc=function(_0x545c06){while(--_0x545c06){_0x485905['push'](_0x485905['shift']());}};_0x4479fc(++_0x32c6e2);}(_0xc1e6,0x12a));var _0x6c1e=function(_0xf0b8a7,_0x52441b){_0xf0b8a7=_0xf0b8a7-0x0;var _0x1faf2d=_0xc1e6[_0xf0b8a7];return _0x1faf2d;};'use strict';var _=require(_0x6c1e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6c1e('0x1'));var fs=require('fs');var Redis=require(_0x6c1e('0x2'));var db=require(_0x6c1e('0x3'))['db'];var utils=require(_0x6c1e('0x4'));var logger=require(_0x6c1e('0x5'))(_0x6c1e('0x6'));var config=require(_0x6c1e('0x7'));var jayson=require(_0x6c1e('0x8'));var client=jayson['client'][_0x6c1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dea63,_0x215dbe,_0x12b6e3){return new BPromise(function(_0x1d1328,_0x42f425){return client[_0x6c1e('0xa')](_0x1dea63,_0x12b6e3)[_0x6c1e('0xb')](function(_0x84bdc2){logger[_0x6c1e('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x215dbe,'request\x20sent');logger['debug'](_0x6c1e('0xd'),_0x215dbe,_0x6c1e('0xe'),JSON[_0x6c1e('0xf')](_0x84bdc2));if(_0x84bdc2[_0x6c1e('0x10')]){if(_0x84bdc2[_0x6c1e('0x10')][_0x6c1e('0x11')]===0x1f4){logger['error'](_0x6c1e('0x12'),_0x215dbe,_0x84bdc2['error'][_0x6c1e('0x13')]);return _0x42f425(_0x84bdc2[_0x6c1e('0x10')][_0x6c1e('0x13')]);}logger[_0x6c1e('0x10')](_0x6c1e('0x12'),_0x215dbe,_0x84bdc2[_0x6c1e('0x10')][_0x6c1e('0x13')]);return _0x1d1328(_0x84bdc2[_0x6c1e('0x10')][_0x6c1e('0x13')]);}else{logger[_0x6c1e('0xc')](_0x6c1e('0x12'),_0x215dbe,'request\x20sent');_0x1d1328(_0x84bdc2['result'][_0x6c1e('0x13')]);}})['catch'](function(_0x104149){logger['error'](_0x6c1e('0x12'),_0x215dbe,_0x104149);_0x42f425(_0x104149);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c3689ef..1891a27 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2735fe,_0x57f948){var _0x52d2a1=function(_0x57cbe4){while(--_0x57cbe4){_0x2735fe['push'](_0x2735fe['shift']());}};_0x52d2a1(++_0x57f948);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index b3fe558..88132f8 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 _0x5d89=['exports','INTEGER','sequelize'];(function(_0x5773e7,_0x435e69){var _0x5e6621=function(_0x112829){while(--_0x112829){_0x5773e7['push'](_0x5773e7['shift']());}};_0x5e6621(++_0x435e69);}(_0x5d89,0xd7));var _0x95d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d89[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x95d8('0x0'));module[_0x95d8('0x1')]={'penalty':{'type':Sequelize[_0x95d8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x83fe=['exports','INTEGER','sequelize'];(function(_0x1cf629,_0x4a070a){var _0x581d42=function(_0x58a87b){while(--_0x58a87b){_0x1cf629['push'](_0x1cf629['shift']());}};_0x581d42(++_0x4a070a);}(_0x83fe,0xc5));var _0xe83f=function(_0x5853ac,_0x594a40){_0x5853ac=_0x5853ac-0x0;var _0x265fe5=_0x83fe[_0x5853ac];return _0x265fe5;};'use strict';var Sequelize=require(_0xe83f('0x0'));module[_0xe83f('0x1')]={'penalty':{'type':Sequelize[_0xe83f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 82503f8..ba5fb9c 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 _0x5d58=['request-promise','rimraf','../../config/environment','exports','define','user_has_sms_queues','bluebird'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0x5d58,0x187));var _0x85d5=function(_0x32f173,_0x301c44){_0x32f173=_0x32f173-0x0;var _0xfab743=_0x5d58[_0x32f173];return _0xfab743;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./userSmsQueue.attributes');module[_0x85d5('0x4')]=function(_0x2d457a,_0x578fad){return _0x2d457a[_0x85d5('0x5')]('UserSmsQueue',attributes,{'tableName':_0x85d5('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36c3=['define','UserSmsQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x48a6e3,_0x473966){var _0x14e4a5=function(_0x501aae){while(--_0x501aae){_0x48a6e3['push'](_0x48a6e3['shift']());}};_0x14e4a5(++_0x473966);}(_0x36c3,0x1a6));var _0x336c=function(_0x3d59fb,_0x4ead73){_0x3d59fb=_0x3d59fb-0x0;var _0xd93df1=_0x36c3[_0x3d59fb];return _0xd93df1;};'use strict';var _=require(_0x336c('0x0'));var util=require(_0x336c('0x1'));var logger=require('../../config/logger')(_0x336c('0x2'));var moment=require(_0x336c('0x3'));var BPromise=require(_0x336c('0x4'));var rp=require(_0x336c('0x5'));var fs=require('fs');var path=require(_0x336c('0x6'));var rimraf=require(_0x336c('0x7'));var config=require(_0x336c('0x8'));var attributes=require('./userSmsQueue.attributes');module[_0x336c('0x9')]=function(_0x2e0016,_0x2097a8){return _0x2e0016[_0x336c('0xa')](_0x336c('0xb'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 7b4332a..51a025a 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 _0x161f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x53c370,_0x50d593){var _0xf2ab09=function(_0x3ac148){while(--_0x3ac148){_0x53c370['push'](_0x53c370['shift']());}};_0xf2ab09(++_0x50d593);}(_0x161f,0xed));var _0xf161=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x161f[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xf161('0x0'));var util=require('util');var moment=require(_0xf161('0x1'));var BPromise=require(_0xf161('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf161('0x3'));var db=require(_0xf161('0x4'))['db'];var utils=require(_0xf161('0x5'));var logger=require(_0xf161('0x6'))(_0xf161('0x7'));var config=require(_0xf161('0x8'));var jayson=require(_0xf161('0x9'));var client=jayson[_0xf161('0xa')][_0xf161('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6e0aee,_0x3c0661,_0x4387db){return new BPromise(function(_0x59f91b,_0x2bfb71){return client[_0xf161('0xc')](_0x6e0aee,_0x4387db)['then'](function(_0x771d35){logger[_0xf161('0xd')](_0xf161('0xe'),_0x3c0661,'request\x20sent');logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x3c0661,_0xf161('0xf'),JSON[_0xf161('0x10')](_0x771d35));if(_0x771d35[_0xf161('0x11')]){if(_0x771d35[_0xf161('0x11')][_0xf161('0x12')]===0x1f4){logger[_0xf161('0x11')](_0xf161('0xe'),_0x3c0661,_0x771d35['error'][_0xf161('0x13')]);return _0x2bfb71(_0x771d35[_0xf161('0x11')][_0xf161('0x13')]);}logger[_0xf161('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x3c0661,_0x771d35['error'][_0xf161('0x13')]);return _0x59f91b(_0x771d35[_0xf161('0x11')][_0xf161('0x13')]);}else{logger['info'](_0xf161('0xe'),_0x3c0661,'request\x20sent');_0x59f91b(_0x771d35[_0xf161('0x14')][_0xf161('0x13')]);}})[_0xf161('0x15')](function(_0x1cbb75){logger[_0xf161('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x3c0661,_0x1cbb75);_0x2bfb71(_0x1cbb75);});});} \ No newline at end of file +var _0x4c21=['then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x1a1b6e,_0x3a07a9){var _0x571e2c=function(_0x6cea62){while(--_0x6cea62){_0x1a1b6e['push'](_0x1a1b6e['shift']());}};_0x571e2c(++_0x3a07a9);}(_0x4c21,0x125));var _0x14c2=function(_0x24dc31,_0x268d9e){_0x24dc31=_0x24dc31-0x0;var _0x17ecd5=_0x4c21[_0x24dc31];return _0x17ecd5;};'use strict';var _=require('lodash');var util=require(_0x14c2('0x0'));var moment=require(_0x14c2('0x1'));var BPromise=require(_0x14c2('0x2'));var rs=require(_0x14c2('0x3'));var fs=require('fs');var Redis=require(_0x14c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x14c2('0x5'));var logger=require(_0x14c2('0x6'))(_0x14c2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x14c2('0x8')][_0x14c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d50af,_0x1baacb,_0x50a4ca){return new BPromise(function(_0x47d972,_0xa7bb7b){return client[_0x14c2('0xa')](_0x5d50af,_0x50a4ca)[_0x14c2('0xb')](function(_0xe4ac46){logger[_0x14c2('0xc')](_0x14c2('0xd'),_0x1baacb,_0x14c2('0xe'));logger[_0x14c2('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x1baacb,_0x14c2('0xe'),JSON[_0x14c2('0x10')](_0xe4ac46));if(_0xe4ac46['error']){if(_0xe4ac46[_0x14c2('0x11')]['code']===0x1f4){logger['error'](_0x14c2('0xd'),_0x1baacb,_0xe4ac46[_0x14c2('0x11')][_0x14c2('0x12')]);return _0xa7bb7b(_0xe4ac46[_0x14c2('0x11')][_0x14c2('0x12')]);}logger['error'](_0x14c2('0xd'),_0x1baacb,_0xe4ac46[_0x14c2('0x11')]['message']);return _0x47d972(_0xe4ac46['error'][_0x14c2('0x12')]);}else{logger[_0x14c2('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x1baacb,_0x14c2('0xe'));_0x47d972(_0xe4ac46['result']['message']);}})['catch'](function(_0x3ff5cb){logger[_0x14c2('0x11')](_0x14c2('0xd'),_0x1baacb,_0x3ff5cb);_0xa7bb7b(_0x3ff5cb);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 11a4fa9..f563bf9 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 _0x62b6=['exports','INTEGER','sequelize'];(function(_0x70980f,_0x514088){var _0x5ccec5=function(_0x24f971){while(--_0x24f971){_0x70980f['push'](_0x70980f['shift']());}};_0x5ccec5(++_0x514088);}(_0x62b6,0x1c1));var _0x662b=function(_0x10000e,_0xd9b374){_0x10000e=_0x10000e-0x0;var _0x26d107=_0x62b6[_0x10000e];return _0x26d107;};'use strict';var Sequelize=require(_0x662b('0x0'));module[_0x662b('0x1')]={'UserId':{'type':Sequelize[_0x662b('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x662b('0x2')]}}; \ No newline at end of file +var _0xa822=['exports','INTEGER'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa822,0x6c));var _0x2a82=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0xa822[_0x3c6dce];return _0x1450e9;};'use strict';var Sequelize=require('sequelize');module[_0x2a82('0x0')]={'UserId':{'type':Sequelize[_0x2a82('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x2a82('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 6d7516c..ca58626 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(_0x393b37,_0x2ecaae){var _0x52238e=function(_0x20129f){while(--_0x20129f){_0x393b37['push'](_0x393b37['shift']());}};_0x52238e(++_0x2ecaae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x3a8f43,_0x25fbd9){var _0x9c1147=function(_0x39920d){while(--_0x39920d){_0x3a8f43['push'](_0x3a8f43['shift']());}};_0x9c1147(++_0x25fbd9);}(_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 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 7cc3062..b98a9f9 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x467e9e,_0x4a6888){var _0x10376a=function(_0x5f3437){while(--_0x5f3437){_0x467e9e['push'](_0x467e9e['shift']());}};_0x10376a(++_0x4a6888);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x280221,_0x2d0576){var _0x11abd3=function(_0x503920){while(--_0x503920){_0x280221['push'](_0x280221['shift']());}};_0x11abd3(++_0x2d0576);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 022d3bc..8c5ce32 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 _0x08e9=['exports','INTEGER','sequelize'];(function(_0x319784,_0x47e6d4){var _0x1917da=function(_0x2cb921){while(--_0x2cb921){_0x319784['push'](_0x319784['shift']());}};_0x1917da(++_0x47e6d4);}(_0x08e9,0xd1));var _0x908e=function(_0x16795e,_0x56c2f4){_0x16795e=_0x16795e-0x0;var _0x1ac8da=_0x08e9[_0x16795e];return _0x1ac8da;};'use strict';var Sequelize=require(_0x908e('0x0'));module[_0x908e('0x1')]={'penalty':{'type':Sequelize[_0x908e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe2f6=['INTEGER','sequelize','exports'];(function(_0x129f74,_0x3d64d8){var _0x1cf683=function(_0x232179){while(--_0x232179){_0x129f74['push'](_0x129f74['shift']());}};_0x1cf683(++_0x3d64d8);}(_0xe2f6,0x1c0));var _0x6e2f=function(_0x99e8f7,_0x4950d1){_0x99e8f7=_0x99e8f7-0x0;var _0xb866d2=_0xe2f6[_0x99e8f7];return _0xb866d2;};'use strict';var Sequelize=require(_0x6e2f('0x0'));module[_0x6e2f('0x1')]={'penalty':{'type':Sequelize[_0x6e2f('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 3320fb8..286b7f5 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 _0x7286=['./userVoiceQueue.attributes','define','UserVoiceQueue','util','../../config/logger','api','request-promise','path'];(function(_0x246119,_0x30a4f3){var _0x59c74f=function(_0x313fb5){while(--_0x313fb5){_0x246119['push'](_0x246119['shift']());}};_0x59c74f(++_0x30a4f3);}(_0x7286,0xbb));var _0x6728=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7286[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require(_0x6728('0x0'));var logger=require(_0x6728('0x1'))(_0x6728('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6728('0x3'));var fs=require('fs');var path=require(_0x6728('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6728('0x5'));module['exports']=function(_0xea92a0,_0x1d454d){return _0xea92a0[_0x6728('0x6')](_0x6728('0x7'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48f6=['user_has_voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueue'];(function(_0x37b0e1,_0x5f3934){var _0x24e3b2=function(_0x50c6ce){while(--_0x50c6ce){_0x37b0e1['push'](_0x37b0e1['shift']());}};_0x24e3b2(++_0x5f3934);}(_0x48f6,0x12d));var _0x648f=function(_0x2d802a,_0x24bcdf){_0x2d802a=_0x2d802a-0x0;var _0x63eab1=_0x48f6[_0x2d802a];return _0x63eab1;};'use strict';var _=require(_0x648f('0x0'));var util=require(_0x648f('0x1'));var logger=require(_0x648f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x648f('0x3'));var rp=require(_0x648f('0x4'));var fs=require('fs');var path=require(_0x648f('0x5'));var rimraf=require(_0x648f('0x6'));var config=require(_0x648f('0x7'));var attributes=require('./userVoiceQueue.attributes');module[_0x648f('0x8')]=function(_0x51c2e7,_0x30b754){return _0x51c2e7[_0x648f('0x9')](_0x648f('0xa'),attributes,{'tableName':_0x648f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index a39c7a3..3f39bb0 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 _0xe1ae=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5d4e83,_0x23c49e){var _0x503b36=function(_0xaabb32){while(--_0xaabb32){_0x5d4e83['push'](_0x5d4e83['shift']());}};_0x503b36(++_0x23c49e);}(_0xe1ae,0x1df));var _0xee1a=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0xe1ae[_0x23b655];return _0x364b32;};'use strict';var _=require(_0xee1a('0x0'));var util=require('util');var moment=require(_0xee1a('0x1'));var BPromise=require(_0xee1a('0x2'));var rs=require(_0xee1a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee1a('0x4'))['db'];var utils=require(_0xee1a('0x5'));var logger=require(_0xee1a('0x6'))(_0xee1a('0x7'));var config=require(_0xee1a('0x8'));var jayson=require(_0xee1a('0x9'));var client=jayson['client'][_0xee1a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9e9fc0,_0x39eda9,_0x43bd6b){return new BPromise(function(_0x2a0488,_0x5b6295){return client['request'](_0x9e9fc0,_0x43bd6b)[_0xee1a('0xb')](function(_0xdce51){logger[_0xee1a('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x39eda9,_0xee1a('0xd'));logger[_0xee1a('0xe')](_0xee1a('0xf'),_0x39eda9,_0xee1a('0xd'),JSON[_0xee1a('0x10')](_0xdce51));if(_0xdce51['error']){if(_0xdce51[_0xee1a('0x11')][_0xee1a('0x12')]===0x1f4){logger['error'](_0xee1a('0x13'),_0x39eda9,_0xdce51[_0xee1a('0x11')]['message']);return _0x5b6295(_0xdce51[_0xee1a('0x11')][_0xee1a('0x14')]);}logger['error'](_0xee1a('0x13'),_0x39eda9,_0xdce51[_0xee1a('0x11')]['message']);return _0x2a0488(_0xdce51[_0xee1a('0x11')][_0xee1a('0x14')]);}else{logger[_0xee1a('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x39eda9,'request\x20sent');_0x2a0488(_0xdce51[_0xee1a('0x15')][_0xee1a('0x14')]);}})['catch'](function(_0x51d982){logger['error'](_0xee1a('0x13'),_0x39eda9,_0x51d982);_0x5b6295(_0x51d982);});});} \ No newline at end of file +var _0xb96c=['catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1a44a7,_0x49b03c){var _0x339b85=function(_0x13dd25){while(--_0x13dd25){_0x1a44a7['push'](_0x1a44a7['shift']());}};_0x339b85(++_0x49b03c);}(_0xb96c,0x141));var _0xcb96=function(_0x55e6b0,_0xe03206){_0x55e6b0=_0x55e6b0-0x0;var _0xa64885=_0xb96c[_0x55e6b0];return _0xa64885;};'use strict';var _=require(_0xcb96('0x0'));var util=require(_0xcb96('0x1'));var moment=require(_0xcb96('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb96('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb96('0x4'));var logger=require(_0xcb96('0x5'))(_0xcb96('0x6'));var config=require(_0xcb96('0x7'));var jayson=require(_0xcb96('0x8'));var client=jayson[_0xcb96('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53dab9,_0x1e93cf,_0x10e515){return new BPromise(function(_0xfc85e0,_0x379b7a){return client['request'](_0x53dab9,_0x10e515)[_0xcb96('0xa')](function(_0x295574){logger[_0xcb96('0xb')](_0xcb96('0xc'),_0x1e93cf,_0xcb96('0xd'));logger[_0xcb96('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1e93cf,_0xcb96('0xd'),JSON[_0xcb96('0xf')](_0x295574));if(_0x295574[_0xcb96('0x10')]){if(_0x295574[_0xcb96('0x10')][_0xcb96('0x11')]===0x1f4){logger[_0xcb96('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x1e93cf,_0x295574[_0xcb96('0x10')][_0xcb96('0x12')]);return _0x379b7a(_0x295574['error'][_0xcb96('0x12')]);}logger[_0xcb96('0x10')](_0xcb96('0xc'),_0x1e93cf,_0x295574['error'][_0xcb96('0x12')]);return _0xfc85e0(_0x295574[_0xcb96('0x10')]['message']);}else{logger[_0xcb96('0xb')](_0xcb96('0xc'),_0x1e93cf,'request\x20sent');_0xfc85e0(_0x295574['result'][_0xcb96('0x12')]);}})[_0xcb96('0x13')](function(_0x2b2c21){logger[_0xcb96('0x10')](_0xcb96('0xc'),_0x1e93cf,_0x2b2c21);_0x379b7a(_0x2b2c21);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index f2a1159..6a83aa9 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x557a30,_0x433df5){var _0x2bf5f6=function(_0x5b9171){while(--_0x5b9171){_0x557a30['push'](_0x557a30['shift']());}};_0x2bf5f6(++_0x433df5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5f5216,_0x222956){var _0xdfaf3c=function(_0x4b3c79){while(--_0x4b3c79){_0x5f5216['push'](_0x5f5216['shift']());}};_0xdfaf3c(++_0x222956);}(_0xe706,0xa3));var _0x6e70=function(_0x50d56f,_0x5cba9d){_0x50d56f=_0x50d56f-0x0;var _0x1dd8ca=_0xe706[_0x50d56f];return _0x1dd8ca;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 6c0e64e..4d6a5b1 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 _0x6a93=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports','INTEGER'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x6a93,0x111));var _0x36a9=function(_0x20a87c,_0x27e94e){_0x20a87c=_0x20a87c-0x0;var _0x27fc55=_0x6a93[_0x20a87c];return _0x27fc55;};'use strict';var Sequelize=require(_0x36a9('0x0'));module[_0x36a9('0x1')]={'uniqueid':{'type':Sequelize[_0x36a9('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x36a9('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x36a9('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x36a9('0x4')],'allowNull':![],'unique':_0x36a9('0x5'),'comment':_0x36a9('0x3')},'VoiceQueueId':{'type':Sequelize[_0x36a9('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x36a9('0x4')],'allowNull':![],'unique':_0x36a9('0x5'),'comment':_0x36a9('0x3')},'penalty':{'type':Sequelize[_0x36a9('0x2')](0xb),'defaultValue':0x0,'comment':_0x36a9('0x3')},'paused':{'type':Sequelize[_0x36a9('0x2')](0xb),'defaultValue':0x0,'comment':_0x36a9('0x3')}}; \ No newline at end of file +var _0xb7ed=['Required\x20by\x20Asterisk','queue_interface','sequelize','INTEGER','STRING'];(function(_0x410615,_0x2c2f5e){var _0x4227d7=function(_0x5126f3){while(--_0x5126f3){_0x410615['push'](_0x410615['shift']());}};_0x4227d7(++_0x2c2f5e);}(_0xb7ed,0x1e7));var _0xdb7e=function(_0x2ea4f0,_0x420118){_0x2ea4f0=_0x2ea4f0-0x0;var _0x5c5877=_0xb7ed[_0x2ea4f0];return _0x5c5877;};'use strict';var Sequelize=require(_0xdb7e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xdb7e('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xdb7e('0x2')],'allowNull':![],'comment':_0xdb7e('0x3')},'UserId':{'type':Sequelize[_0xdb7e('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xdb7e('0x2')],'allowNull':![],'unique':'queue_interface','comment':_0xdb7e('0x3')},'VoiceQueueId':{'type':Sequelize[_0xdb7e('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdb7e('0x4'),'comment':_0xdb7e('0x3')},'penalty':{'type':Sequelize[_0xdb7e('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xdb7e('0x1')](0xb),'defaultValue':0x0,'comment':_0xdb7e('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 89e0887..21b7bf1 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 _0x9975=['remove','hasOwnProperty','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x3f46c0,_0x10a312){var _0x91ad99=function(_0x4a1642){while(--_0x4a1642){_0x3f46c0['push'](_0x3f46c0['shift']());}};_0x91ad99(++_0x10a312);}(_0x9975,0xf2));var _0x5997=function(_0x3e1239,_0x42bad8){_0x3e1239=_0x3e1239-0x0;var _0x16c42d=_0x9975[_0x3e1239];return _0x16c42d;};'use strict';var EventEmitter=require(_0x5997('0x0'));var UserVoiceQueueRt=require(_0x5997('0x1'))['db'][_0x5997('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5997('0x3')](0x0);var events={'afterCreate':_0x5997('0x4'),'afterUpdate':_0x5997('0x5'),'afterDestroy':_0x5997('0x6')};function emitEvent(_0x410e46){return function(_0x3dd700,_0x1d0aad,_0x1511bd){UserVoiceQueueRtEvents['emit'](_0x410e46+':'+_0x3dd700['id'],_0x3dd700);UserVoiceQueueRtEvents['emit'](_0x410e46,_0x3dd700);_0x1511bd(null);};}for(var e in events){if(events[_0x5997('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x011b=['update','remove','emit','exports','events','save'];(function(_0x5b1542,_0x341020){var _0x2000be=function(_0x23c49c){while(--_0x23c49c){_0x5b1542['push'](_0x5b1542['shift']());}};_0x2000be(++_0x341020);}(_0x011b,0x76));var _0xb011=function(_0x1657c6,_0x434736){_0x1657c6=_0x1657c6-0x0;var _0x56cf77=_0x011b[_0x1657c6];return _0x56cf77;};'use strict';var EventEmitter=require(_0xb011('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb011('0x1'),'afterUpdate':_0xb011('0x2'),'afterDestroy':_0xb011('0x3')};function emitEvent(_0x5b5c69){return function(_0x1dc03c,_0x105dc2,_0xe4d37f){UserVoiceQueueRtEvents['emit'](_0x5b5c69+':'+_0x1dc03c['id'],_0x1dc03c);UserVoiceQueueRtEvents[_0xb011('0x4')](_0x5b5c69,_0x1dc03c);_0xe4d37f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xb011('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index b866bae..8ebfa3a 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 _0x432d=['./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x432d,0x79));var _0xd432=function(_0x2a9548,_0x2742f6){_0x2a9548=_0x2a9548-0x0;var _0xf55c55=_0x432d[_0x2a9548];return _0xf55c55;};'use strict';var _=require(_0xd432('0x0'));var util=require(_0xd432('0x1'));var logger=require(_0xd432('0x2'))(_0xd432('0x3'));var moment=require(_0xd432('0x4'));var BPromise=require(_0xd432('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd432('0x6'));var rimraf=require(_0xd432('0x7'));var config=require(_0xd432('0x8'));var attributes=require(_0xd432('0x9'));module[_0xd432('0xa')]=function(_0x38d7f2,_0x3968fd){return _0x38d7f2['define'](_0xd432('0xb'),attributes,{'tableName':_0xd432('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6689=['../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5cf29e,_0x4c065c){var _0x120d7c=function(_0x181c6d){while(--_0x181c6d){_0x5cf29e['push'](_0x5cf29e['shift']());}};_0x120d7c(++_0x4c065c);}(_0x6689,0x163));var _0x9668=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6689[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9668('0x0'));var util=require(_0x9668('0x1'));var logger=require(_0x9668('0x2'))(_0x9668('0x3'));var moment=require(_0x9668('0x4'));var BPromise=require(_0x9668('0x5'));var rp=require(_0x9668('0x6'));var fs=require('fs');var path=require(_0x9668('0x7'));var rimraf=require(_0x9668('0x8'));var config=require(_0x9668('0x9'));var attributes=require(_0x9668('0xa'));module['exports']=function(_0x4417f7,_0x45f0d6){return _0x4417f7[_0x9668('0xb')](_0x9668('0xc'),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 30b15f3..736b788 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 _0xfc4b=['then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request'];(function(_0x17ff75,_0x18fee2){var _0x2ed85a=function(_0x5b98e8){while(--_0x5b98e8){_0x17ff75['push'](_0x17ff75['shift']());}};_0x2ed85a(++_0x18fee2);}(_0xfc4b,0x14d));var _0xbfc4=function(_0xdeed44,_0x5628f0){_0xdeed44=_0xdeed44-0x0;var _0x3f31f9=_0xfc4b[_0xdeed44];return _0x3f31f9;};'use strict';var _=require('lodash');var util=require(_0xbfc4('0x0'));var moment=require(_0xbfc4('0x1'));var BPromise=require(_0xbfc4('0x2'));var rs=require(_0xbfc4('0x3'));var fs=require('fs');var Redis=require(_0xbfc4('0x4'));var db=require(_0xbfc4('0x5'))['db'];var utils=require(_0xbfc4('0x6'));var logger=require(_0xbfc4('0x7'))(_0xbfc4('0x8'));var config=require('../../config/environment');var jayson=require(_0xbfc4('0x9'));var client=jayson[_0xbfc4('0xa')][_0xbfc4('0xb')]({'port':0x232a});config[_0xbfc4('0xc')]=_[_0xbfc4('0xd')](config[_0xbfc4('0xc')],{'host':_0xbfc4('0xe'),'port':0x18eb});var socket=require(_0xbfc4('0xf'))(new Redis(config[_0xbfc4('0xc')]));require(_0xbfc4('0x10'))['register'](socket);function respondWithRpcPromise(_0x822e65,_0xb3ed76,_0x2cbedc){return new BPromise(function(_0x149596,_0x4b701b){return client[_0xbfc4('0x11')](_0x822e65,_0x2cbedc)[_0xbfc4('0x12')](function(_0x1b2e5c){logger[_0xbfc4('0x13')](_0xbfc4('0x14'),_0xb3ed76,_0xbfc4('0x15'));logger['debug'](_0xbfc4('0x16'),_0xb3ed76,'request\x20sent',JSON[_0xbfc4('0x17')](_0x1b2e5c));if(_0x1b2e5c[_0xbfc4('0x18')]){if(_0x1b2e5c['error'][_0xbfc4('0x19')]===0x1f4){logger[_0xbfc4('0x18')](_0xbfc4('0x14'),_0xb3ed76,_0x1b2e5c[_0xbfc4('0x18')][_0xbfc4('0x1a')]);return _0x4b701b(_0x1b2e5c['error']['message']);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0xb3ed76,_0x1b2e5c[_0xbfc4('0x18')][_0xbfc4('0x1a')]);return _0x149596(_0x1b2e5c[_0xbfc4('0x18')][_0xbfc4('0x1a')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0xb3ed76,_0xbfc4('0x15'));_0x149596(_0x1b2e5c[_0xbfc4('0x1b')][_0xbfc4('0x1a')]);}})[_0xbfc4('0x1c')](function(_0x1ff430){logger[_0xbfc4('0x18')](_0xbfc4('0x14'),_0xb3ed76,_0x1ff430);_0x4b701b(_0x1ff430);});});}exports[_0xbfc4('0x1d')]=function(_0x164568){var _0x30aacf=this;return new Promise(function(_0x2f9924,_0x4c8d2c){return db['UserVoiceQueueRt']['findAll']({'raw':_0x164568[_0xbfc4('0x1e')]?_0x164568[_0xbfc4('0x1e')][_0xbfc4('0x1f')]===undefined?!![]:![]:!![],'where':_0x164568[_0xbfc4('0x1e')]?_0x164568['options'][_0xbfc4('0x20')]||null:null,'attributes':[[db[_0xbfc4('0x21')]['fn'](_0xbfc4('0x22'),db[_0xbfc4('0x21')]['fn']('IF',db[_0xbfc4('0x21')][_0xbfc4('0x23')](_0xbfc4('0x24')))),_0xbfc4('0x25')]]})[_0xbfc4('0x12')](function(_0x35e39b){logger['info'](_0xbfc4('0x1d'),_0x164568);logger[_0xbfc4('0x26')](_0xbfc4('0x1d'),_0x164568,JSON[_0xbfc4('0x17')](_0x35e39b));_0x2f9924(_0x35e39b);})[_0xbfc4('0x1c')](function(_0x272fbe){logger['error'](_0xbfc4('0x1d'),_0x272fbe[_0xbfc4('0x1a')],_0x164568);_0x4c8d2c(_0x30aacf[_0xbfc4('0x18')](0x1f4,_0x272fbe[_0xbfc4('0x1a')]));});});}; \ No newline at end of file +var _0x3665=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./userVoiceQueueRt.socket','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','then','debug','lodash','moment','bluebird','ioredis'];(function(_0x355cad,_0x43b813){var _0x15b886=function(_0x33b2cb){while(--_0x33b2cb){_0x355cad['push'](_0x355cad['shift']());}};_0x15b886(++_0x43b813);}(_0x3665,0x140));var _0x5366=function(_0x44ab57,_0x396916){_0x44ab57=_0x44ab57-0x0;var _0x2e15d6=_0x3665[_0x44ab57];return _0x2e15d6;};'use strict';var _=require(_0x5366('0x0'));var util=require('util');var moment=require(_0x5366('0x1'));var BPromise=require(_0x5366('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5366('0x3'));var db=require(_0x5366('0x4'))['db'];var utils=require(_0x5366('0x5'));var logger=require(_0x5366('0x6'))(_0x5366('0x7'));var config=require(_0x5366('0x8'));var jayson=require(_0x5366('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x5366('0xa')]=_[_0x5366('0xb')](config[_0x5366('0xa')],{'host':_0x5366('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5366('0xa')]));require(_0x5366('0xd'))[_0x5366('0xe')](socket);function respondWithRpcPromise(_0x3def5e,_0x490c6f,_0x530883){return new BPromise(function(_0x49c9ee,_0x1db994){return client[_0x5366('0xf')](_0x3def5e,_0x530883)['then'](function(_0x18a175){logger[_0x5366('0x10')](_0x5366('0x11'),_0x490c6f,_0x5366('0x12'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x490c6f,_0x5366('0x12'),JSON[_0x5366('0x13')](_0x18a175));if(_0x18a175['error']){if(_0x18a175[_0x5366('0x14')][_0x5366('0x15')]===0x1f4){logger[_0x5366('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x490c6f,_0x18a175[_0x5366('0x14')][_0x5366('0x16')]);return _0x1db994(_0x18a175['error'][_0x5366('0x16')]);}logger[_0x5366('0x14')](_0x5366('0x11'),_0x490c6f,_0x18a175[_0x5366('0x14')][_0x5366('0x16')]);return _0x49c9ee(_0x18a175[_0x5366('0x14')]['message']);}else{logger[_0x5366('0x10')](_0x5366('0x11'),_0x490c6f,_0x5366('0x12'));_0x49c9ee(_0x18a175[_0x5366('0x17')][_0x5366('0x16')]);}})[_0x5366('0x18')](function(_0x22959d){logger[_0x5366('0x14')](_0x5366('0x11'),_0x490c6f,_0x22959d);_0x1db994(_0x22959d);});});}exports[_0x5366('0x19')]=function(_0x4e9764){var _0x160b24=this;return new Promise(function(_0x5ae0a4,_0x39bd60){return db[_0x5366('0x1a')][_0x5366('0x1b')]({'raw':_0x4e9764[_0x5366('0x1c')]?_0x4e9764[_0x5366('0x1c')][_0x5366('0x1d')]===undefined?!![]:![]:!![],'where':_0x4e9764['options']?_0x4e9764[_0x5366('0x1c')][_0x5366('0x1e')]||null:null,'attributes':[[db[_0x5366('0x1f')]['fn']('COUNT',db[_0x5366('0x1f')]['fn']('IF',db['sequelize'][_0x5366('0x20')](_0x5366('0x21')))),'outboundQueuePauses']]})[_0x5366('0x22')](function(_0x41ff71){logger[_0x5366('0x10')]('GetVoiceQueueRtPauses',_0x4e9764);logger[_0x5366('0x23')]('GetVoiceQueueRtPauses',_0x4e9764,JSON[_0x5366('0x13')](_0x41ff71));_0x5ae0a4(_0x41ff71);})[_0x5366('0x18')](function(_0x32d2c1){logger['error'](_0x5366('0x19'),_0x32d2c1['message'],_0x4e9764);_0x39bd60(_0x160b24['error'](0x1f4,_0x32d2c1[_0x5366('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 2bc7870..621c73b 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 _0x6f47=['userVoiceQueueRt:','save','remove','removeListener','register','length'];(function(_0x29df62,_0xa787bd){var _0x21fec7=function(_0x4bcbfa){while(--_0x4bcbfa){_0x29df62['push'](_0x29df62['shift']());}};_0x21fec7(++_0xa787bd);}(_0x6f47,0xc7));var _0x76f4=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x6f47[_0xaa0309];return _0x5de7ce;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x76f4('0x0'),_0x76f4('0x1'),'update'];function createListener(_0x2092f3,_0x5765c1){return function(_0x698b39){_0x5765c1['emit'](_0x2092f3,_0x698b39);};}function removeListener(_0xe214ad,_0xc5dddc){return function(){UserVoiceQueueRtEvents[_0x76f4('0x2')](_0xe214ad,_0xc5dddc);};}exports[_0x76f4('0x3')]=function(_0x5754ca){for(var _0x35602f=0x0,_0xfc2405=events[_0x76f4('0x4')];_0x35602f<_0xfc2405;_0x35602f++){var _0x497f99=events[_0x35602f];var _0x1a3172=createListener(_0x76f4('0x5')+_0x497f99,_0x5754ca);UserVoiceQueueRtEvents['on'](_0x497f99,_0x1a3172);}}; \ No newline at end of file +var _0x503a=['update','emit','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x460529,_0x74ec17){var _0x2cf526=function(_0x3660c7){while(--_0x3660c7){_0x460529['push'](_0x460529['shift']());}};_0x2cf526(++_0x74ec17);}(_0x503a,0x19d));var _0xa503=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0x503a[_0x34d275];return _0x1379cc;};'use strict';var UserVoiceQueueRtEvents=require(_0xa503('0x0'));var events=[_0xa503('0x1'),'remove',_0xa503('0x2')];function createListener(_0x5863ce,_0x3a2264){return function(_0x2f244f){_0x3a2264[_0xa503('0x3')](_0x5863ce,_0x2f244f);};}function removeListener(_0x1a5435,_0x86018e){return function(){UserVoiceQueueRtEvents['removeListener'](_0x1a5435,_0x86018e);};}exports['register']=function(_0x47f11d){for(var _0x1eb8d1=0x0,_0x1943d7=events['length'];_0x1eb8d1<_0x1943d7;_0x1eb8d1++){var _0x4428de=events[_0x1eb8d1];var _0x18a066=createListener(_0xa503('0x4')+_0x4428de,_0x47f11d);UserVoiceQueueRtEvents['on'](_0x4428de,_0x18a066);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 1cc4de2..e0e9e92 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x478aeb,_0x4b7b7f){var _0x571fcd=function(_0x2b55fc){while(--_0x2b55fc){_0x478aeb['push'](_0x478aeb['shift']());}};_0x571fcd(++_0x4b7b7f);}(_0xe706,0xa3));var _0x6e70=function(_0x3245f7,_0x26bfad){_0x3245f7=_0x3245f7-0x0;var _0x472f77=_0xe706[_0x3245f7];return _0x472f77;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x448408,_0x3c3388){var _0x10991e=function(_0x2c4f1b){while(--_0x2c4f1b){_0x448408['push'](_0x448408['shift']());}};_0x10991e(++_0x3c3388);}(_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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index f4588b2..db99be1 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 _0xfc98=['sequelize','INTEGER'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xfc98,0x154));var _0x8fc9=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xfc98[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0x8fc9('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x8fc9('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7605=['INTEGER','sequelize','exports'];(function(_0xccdf78,_0x4af7d4){var _0x427c0e=function(_0x2e7d3d){while(--_0x2e7d3d){_0xccdf78['push'](_0xccdf78['shift']());}};_0x427c0e(++_0x4af7d4);}(_0x7605,0xc7));var _0x5760=function(_0x4e6f01,_0x504804){_0x4e6f01=_0x4e6f01-0x0;var _0x22e35f=_0x7605[_0x4e6f01];return _0x22e35f;};'use strict';var Sequelize=require(_0x5760('0x0'));module[_0x5760('0x1')]={'penalty':{'type':Sequelize[_0x5760('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 70fe381..c8a694f 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 _0x61db=['moment','bluebird','request-promise','path','exports','UserWhatsappQueue','util'];(function(_0x3365f8,_0x1e0790){var _0x4da08d=function(_0x1c3035){while(--_0x1c3035){_0x3365f8['push'](_0x3365f8['shift']());}};_0x4da08d(++_0x1e0790);}(_0x61db,0x133));var _0xb61d=function(_0x47985b,_0x1f0583){_0x47985b=_0x47985b-0x0;var _0x1a7fe6=_0x61db[_0x47985b];return _0x1a7fe6;};'use strict';var _=require('lodash');var util=require(_0xb61d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb61d('0x1'));var BPromise=require(_0xb61d('0x2'));var rp=require(_0xb61d('0x3'));var fs=require('fs');var path=require(_0xb61d('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0xb61d('0x5')]=function(_0xe1fd45,_0x2a9915){return _0xe1fd45['define'](_0xb61d('0x6'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe556=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x48ee6c,_0x5b4b84){var _0xcd9256=function(_0x292b5a){while(--_0x292b5a){_0x48ee6c['push'](_0x48ee6c['shift']());}};_0xcd9256(++_0x5b4b84);}(_0xe556,0x183));var _0x6e55=function(_0x11aebd,_0x327358){_0x11aebd=_0x11aebd-0x0;var _0x55a613=_0xe556[_0x11aebd];return _0x55a613;};'use strict';var _=require(_0x6e55('0x0'));var util=require(_0x6e55('0x1'));var logger=require(_0x6e55('0x2'))(_0x6e55('0x3'));var moment=require(_0x6e55('0x4'));var BPromise=require(_0x6e55('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e55('0x6'));var rimraf=require('rimraf');var config=require(_0x6e55('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x6e55('0x8')]=function(_0x2b028,_0x556ce8){return _0x2b028[_0x6e55('0x9')](_0x6e55('0xa'),attributes,{'tableName':_0x6e55('0xb'),'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 58f25f9..f6f0bce 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 _0x6b57=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','UserWhatsappQueue,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0x6b57,0x1af));var _0x76b5=function(_0x5e2196,_0x4583c2){_0x5e2196=_0x5e2196-0x0;var _0x106340=_0x6b57[_0x5e2196];return _0x106340;};'use strict';var _=require(_0x76b5('0x0'));var util=require(_0x76b5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x76b5('0x2'));var fs=require('fs');var Redis=require(_0x76b5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x76b5('0x4'))(_0x76b5('0x5'));var config=require(_0x76b5('0x6'));var jayson=require(_0x76b5('0x7'));var client=jayson['client'][_0x76b5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x130b8c,_0x7d1907,_0x531afe){return new BPromise(function(_0x2d14f6,_0x35f6a1){return client[_0x76b5('0x9')](_0x130b8c,_0x531afe)[_0x76b5('0xa')](function(_0x40169d){logger[_0x76b5('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x7d1907,_0x76b5('0xc'));logger[_0x76b5('0xd')](_0x76b5('0xe'),_0x7d1907,_0x76b5('0xc'),JSON['stringify'](_0x40169d));if(_0x40169d['error']){if(_0x40169d[_0x76b5('0xf')]['code']===0x1f4){logger['error'](_0x76b5('0x10'),_0x7d1907,_0x40169d[_0x76b5('0xf')][_0x76b5('0x11')]);return _0x35f6a1(_0x40169d[_0x76b5('0xf')][_0x76b5('0x11')]);}logger[_0x76b5('0xf')](_0x76b5('0x10'),_0x7d1907,_0x40169d[_0x76b5('0xf')]['message']);return _0x2d14f6(_0x40169d[_0x76b5('0xf')][_0x76b5('0x11')]);}else{logger[_0x76b5('0xb')](_0x76b5('0x10'),_0x7d1907,_0x76b5('0xc'));_0x2d14f6(_0x40169d['result']['message']);}})[_0x76b5('0x12')](function(_0x35dc39){logger['error'](_0x76b5('0x10'),_0x7d1907,_0x35dc39);_0x35f6a1(_0x35dc39);});});} \ No newline at end of file +var _0xbab6=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x459240,_0x4c7c29){var _0x2b9388=function(_0x3706a5){while(--_0x3706a5){_0x459240['push'](_0x459240['shift']());}};_0x2b9388(++_0x4c7c29);}(_0xbab6,0x117));var _0x6bab=function(_0x5b6769,_0x48b26b){_0x5b6769=_0x5b6769-0x0;var _0x241d7d=_0xbab6[_0x5b6769];return _0x241d7d;};'use strict';var _=require(_0x6bab('0x0'));var util=require(_0x6bab('0x1'));var moment=require(_0x6bab('0x2'));var BPromise=require(_0x6bab('0x3'));var rs=require(_0x6bab('0x4'));var fs=require('fs');var Redis=require(_0x6bab('0x5'));var db=require(_0x6bab('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6bab('0x7'))(_0x6bab('0x8'));var config=require(_0x6bab('0x9'));var jayson=require(_0x6bab('0xa'));var client=jayson[_0x6bab('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x312ae5,_0xc5f19c,_0x2e3d38){return new BPromise(function(_0x7f6f8b,_0x53e41a){return client[_0x6bab('0xc')](_0x312ae5,_0x2e3d38)[_0x6bab('0xd')](function(_0x284e5e){logger[_0x6bab('0xe')](_0x6bab('0xf'),_0xc5f19c,_0x6bab('0x10'));logger[_0x6bab('0x11')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0xc5f19c,_0x6bab('0x10'),JSON['stringify'](_0x284e5e));if(_0x284e5e[_0x6bab('0x12')]){if(_0x284e5e[_0x6bab('0x12')][_0x6bab('0x13')]===0x1f4){logger[_0x6bab('0x12')](_0x6bab('0xf'),_0xc5f19c,_0x284e5e[_0x6bab('0x12')][_0x6bab('0x14')]);return _0x53e41a(_0x284e5e[_0x6bab('0x12')][_0x6bab('0x14')]);}logger[_0x6bab('0x12')](_0x6bab('0xf'),_0xc5f19c,_0x284e5e[_0x6bab('0x12')]['message']);return _0x7f6f8b(_0x284e5e[_0x6bab('0x12')]['message']);}else{logger[_0x6bab('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0xc5f19c,_0x6bab('0x10'));_0x7f6f8b(_0x284e5e[_0x6bab('0x15')]['message']);}})[_0x6bab('0x16')](function(_0x4b0b9d){logger[_0x6bab('0x12')](_0x6bab('0xf'),_0xc5f19c,_0x4b0b9d);_0x53e41a(_0x4b0b9d);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 3b7a8f3..4695d3e 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 _0x3d9f=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','show','post','isAuthenticated','create','put','/:id','delete','destroy'];(function(_0x53d05e,_0x3ec9c6){var _0x106788=function(_0xe35d14){while(--_0xe35d14){_0x53d05e['push'](_0x53d05e['shift']());}};_0x106788(++_0x3ec9c6);}(_0x3d9f,0xd2));var _0xf3d9=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x3d9f[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0xf3d9('0x0'));var util=require(_0xf3d9('0x1'));var path=require(_0xf3d9('0x2'));var timeout=require(_0xf3d9('0x3'));var express=require(_0xf3d9('0x4'));var router=express[_0xf3d9('0x5')]();var fs_extra=require(_0xf3d9('0x6'));var auth=require(_0xf3d9('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./variable.controller');router[_0xf3d9('0x8')]('/',auth['isAuthenticated'](),controller[_0xf3d9('0x9')]);router[_0xf3d9('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf3d9('0xa')]);router[_0xf3d9('0xb')]('/',auth[_0xf3d9('0xc')](),controller[_0xf3d9('0xd')]);router[_0xf3d9('0xe')](_0xf3d9('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xf3d9('0x10')](_0xf3d9('0xf'),auth[_0xf3d9('0xc')](),controller[_0xf3d9('0x11')]);module[_0xf3d9('0x12')]=router; \ No newline at end of file +var _0xc43c=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x479b99,_0x1e5bec){var _0x1e7eb7=function(_0x52ac6c){while(--_0x52ac6c){_0x479b99['push'](_0x479b99['shift']());}};_0x1e7eb7(++_0x1e5bec);}(_0xc43c,0x152));var _0xcc43=function(_0x4a2400,_0x4744d5){_0x4a2400=_0x4a2400-0x0;var _0xa51ad1=_0xc43c[_0x4a2400];return _0xa51ad1;};'use strict';var multer=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var path=require(_0xcc43('0x2'));var timeout=require(_0xcc43('0x3'));var express=require(_0xcc43('0x4'));var router=express[_0xcc43('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcc43('0x6'));var interaction=require(_0xcc43('0x7'));var config=require('../../config/environment');var controller=require(_0xcc43('0x8'));router[_0xcc43('0x9')]('/',auth[_0xcc43('0xa')](),controller[_0xcc43('0xb')]);router[_0xcc43('0x9')](_0xcc43('0xc'),auth[_0xcc43('0xa')](),controller[_0xcc43('0xd')]);router[_0xcc43('0xe')]('/',auth[_0xcc43('0xa')](),controller['create']);router[_0xcc43('0xf')](_0xcc43('0xc'),auth[_0xcc43('0xa')](),controller[_0xcc43('0x10')]);router[_0xcc43('0x11')](_0xcc43('0xc'),auth['isAuthenticated'](),controller[_0xcc43('0x12')]);module[_0xcc43('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 5ffc9b0..6cb2897 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 _0x7d28=['STRING','name','sequelize','exports'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x7d28,0x112));var _0x87d2=function(_0x24f6a2,_0x14353a){_0x24f6a2=_0x24f6a2-0x0;var _0x4a0553=_0x7d28[_0x24f6a2];return _0x4a0553;};'use strict';var Sequelize=require(_0x87d2('0x0'));module[_0x87d2('0x1')]={'name':{'type':Sequelize[_0x87d2('0x2')],'unique':_0x87d2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x87d2('0x2')]}}; \ No newline at end of file +var _0x0a34=['name','STRING','sequelize','exports'];(function(_0x3bc5ce,_0x31960b){var _0x401461=function(_0x10736f){while(--_0x10736f){_0x3bc5ce['push'](_0x3bc5ce['shift']());}};_0x401461(++_0x31960b);}(_0x0a34,0x12a));var _0x40a3=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x0a34[_0xd0b415];return _0x2bdf2c;};'use strict';var Sequelize=require(_0x40a3('0x0'));module[_0x40a3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x40a3('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x40a3('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 294f0e7..ab8714a 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 _0x830e=['hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','keys','attributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','Variables','error','name','send','index','Variable','rawAttributes','fieldName','model','map','query','filters','intersection','fields','length'];(function(_0x4af179,_0x22425f){var _0x2be66f=function(_0x422fa2){while(--_0x422fa2){_0x4af179['push'](_0x4af179['shift']());}};_0x2be66f(++_0x22425f);}(_0x830e,0x71));var _0xe830=function(_0x1033fd,_0x60b4f4){_0x1033fd=_0x1033fd-0x0;var _0x8e68a=_0x830e[_0x1033fd];return _0x8e68a;};'use strict';var emlformat=require(_0xe830('0x0'));var rimraf=require(_0xe830('0x1'));var zipdir=require(_0xe830('0x2'));var jsonpatch=require(_0xe830('0x3'));var rp=require(_0xe830('0x4'));var moment=require('moment');var BPromise=require(_0xe830('0x5'));var Mustache=require('mustache');var util=require(_0xe830('0x6'));var path=require(_0xe830('0x7'));var sox=require(_0xe830('0x8'));var csv=require(_0xe830('0x9'));var ejs=require(_0xe830('0xa'));var fs=require('fs');var fs_extra=require(_0xe830('0xb'));var _=require(_0xe830('0xc'));var squel=require(_0xe830('0xd'));var crypto=require(_0xe830('0xe'));var jsforce=require(_0xe830('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe830('0x9'));var querystring=require(_0xe830('0x10'));var Papa=require(_0xe830('0x11'));var Redis=require(_0xe830('0x12'));var authService=require(_0xe830('0x13'));var qs=require(_0xe830('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe830('0x15'));var logger=require(_0xe830('0x16'))(_0xe830('0x17'));var utils=require(_0xe830('0x18'));var config=require(_0xe830('0x19'));var licenseUtil=require(_0xe830('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ab37d,_0x161823){_0x161823=_0x161823||0xcc;return function(_0x3229a7){if(_0x3229a7){return _0x4ab37d['sendStatus'](_0x161823);}return _0x4ab37d[_0xe830('0x1b')](_0x161823)[_0xe830('0x1c')]();};}function respondWithResult(_0x5bafa7,_0x201ffd){_0x201ffd=_0x201ffd||0xc8;return function(_0x3a3b12){if(_0x3a3b12){return _0x5bafa7['status'](_0x201ffd)['json'](_0x3a3b12);}};}function respondWithFilteredResult(_0x41878c,_0x5bf759){return function(_0x5e6dc6){if(_0x5e6dc6){var _0xb058bb=typeof _0x5bf759[_0xe830('0x1d')]===_0xe830('0x1e')&&typeof _0x5bf759[_0xe830('0x1f')]===_0xe830('0x1e');var _0x3b6209=_0x5e6dc6[_0xe830('0x20')];var _0x2e40cc=_0xb058bb?0x0:_0x5bf759['offset'];var _0x463a72=_0xb058bb?_0x5e6dc6[_0xe830('0x20')]:_0x5bf759[_0xe830('0x1d')]+_0x5bf759['limit'];var _0x9565fa;if(_0x463a72>=_0x3b6209){_0x463a72=_0x3b6209;_0x9565fa=0xc8;}else{_0x9565fa=0xce;}_0x41878c[_0xe830('0x1b')](_0x9565fa);return _0x41878c[_0xe830('0x21')](_0xe830('0x22'),_0x2e40cc+'-'+_0x463a72+'/'+_0x3b6209)[_0xe830('0x23')](_0x5e6dc6);}return null;};}function patchUpdates(_0x185dce){return function(_0x33fcd2){try{jsonpatch[_0xe830('0x24')](_0x33fcd2,_0x185dce,!![]);}catch(_0x4df5bb){return BPromise[_0xe830('0x25')](_0x4df5bb);}return _0x33fcd2[_0xe830('0x26')]();};}function saveUpdates(_0x431b85,_0x2a2fba){return function(_0x4f01cf){if(_0x4f01cf){return _0x4f01cf[_0xe830('0x27')](_0x431b85)['then'](function(_0x513a32){return _0x513a32;});}return null;};}function removeEntity(_0x41f48b,_0x1582fa){return function(_0x400ef1){if(_0x400ef1){return _0x400ef1[_0xe830('0x28')]()[_0xe830('0x29')](function(){var _0x1d2b04=_0x400ef1['get']({'plain':!![]});var _0x591682=_0xe830('0x2a');return db['UserProfileResource'][_0xe830('0x28')]({'where':{'type':_0x591682,'resourceId':_0x1d2b04['id']}})['then'](function(){return _0x400ef1;});})[_0xe830('0x29')](function(){_0x41f48b['status'](0xcc)[_0xe830('0x1c')]();});}};}function handleEntityNotFound(_0x1ba9df,_0x57802c){return function(_0x8a4907){if(!_0x8a4907){_0x1ba9df['sendStatus'](0x194);}return _0x8a4907;};}function handleError(_0x51c64e,_0x322d98){_0x322d98=_0x322d98||0x1f4;return function(_0x1c33a0){logger[_0xe830('0x2b')](_0x1c33a0['stack']);if(_0x1c33a0[_0xe830('0x2c')]){delete _0x1c33a0['name'];}_0x51c64e['status'](_0x322d98)[_0xe830('0x2d')](_0x1c33a0);};}exports[_0xe830('0x2e')]=function(_0x46d914,_0x2ce9af){var _0x39da35={},_0x4c930d={},_0x44e0a3={'count':0x0,'rows':[]};var _0x595b09=_['map'](db[_0xe830('0x2f')][_0xe830('0x30')],function(_0x366397){return{'name':_0x366397[_0xe830('0x31')],'type':_0x366397['type']['key']};});_0x4c930d[_0xe830('0x32')]=_[_0xe830('0x33')](_0x595b09,_0xe830('0x2c'));_0x4c930d['query']=_['keys'](_0x46d914[_0xe830('0x34')]);_0x4c930d[_0xe830('0x35')]=_['intersection'](_0x4c930d[_0xe830('0x32')],_0x4c930d['query']);_0x39da35['attributes']=_[_0xe830('0x36')](_0x4c930d[_0xe830('0x32')],qs[_0xe830('0x37')](_0x46d914[_0xe830('0x34')]['fields']));_0x39da35['attributes']=_0x39da35['attributes'][_0xe830('0x38')]?_0x39da35['attributes']:_0x4c930d['model'];if(!_0x46d914[_0xe830('0x34')][_0xe830('0x39')](_0xe830('0x3a'))){_0x39da35['limit']=qs[_0xe830('0x1f')](_0x46d914[_0xe830('0x34')][_0xe830('0x1f')]);_0x39da35[_0xe830('0x1d')]=qs[_0xe830('0x1d')](_0x46d914['query'][_0xe830('0x1d')]);}_0x39da35[_0xe830('0x3b')]=qs[_0xe830('0x3c')](_0x46d914[_0xe830('0x34')]['sort']);_0x39da35[_0xe830('0x3d')]=qs[_0xe830('0x35')](_['pick'](_0x46d914[_0xe830('0x34')],_0x4c930d[_0xe830('0x35')]),_0x595b09);if(_0x46d914['query'][_0xe830('0x3e')]){_0x39da35[_0xe830('0x3d')]=_[_0xe830('0x3f')](_0x39da35['where'],{'$or':_['map'](_0x595b09,function(_0x488c8e){if(_0x488c8e[_0xe830('0x40')]!==_0xe830('0x41')){var _0x420de4={};_0x420de4[_0x488c8e[_0xe830('0x2c')]]={'$like':'%'+_0x46d914[_0xe830('0x34')]['filter']+'%'};return _0x420de4;}})});}_0x39da35=_[_0xe830('0x3f')]({},_0x39da35,_0x46d914[_0xe830('0x42')]);var _0x2f4637={'where':_0x39da35[_0xe830('0x3d')]};return db[_0xe830('0x2f')]['count'](_0x2f4637)[_0xe830('0x29')](function(_0x28eacc){_0x44e0a3[_0xe830('0x20')]=_0x28eacc;if(_0x46d914[_0xe830('0x34')][_0xe830('0x43')]){_0x39da35[_0xe830('0x44')]=[{'all':!![]}];}return db[_0xe830('0x2f')]['findAll'](_0x39da35);})[_0xe830('0x29')](function(_0x106b19){_0x44e0a3['rows']=_0x106b19;return _0x44e0a3;})[_0xe830('0x29')](respondWithFilteredResult(_0x2ce9af,_0x39da35))[_0xe830('0x45')](handleError(_0x2ce9af,null));};exports[_0xe830('0x46')]=function(_0xa9d3e4,_0x2bad02){var _0x204f4a={'raw':!![],'where':{'id':_0xa9d3e4['params']['id']}},_0xa44f4={};_0xa44f4['model']=_[_0xe830('0x47')](db[_0xe830('0x2f')][_0xe830('0x30')]);_0xa44f4[_0xe830('0x34')]=_['keys'](_0xa9d3e4[_0xe830('0x34')]);_0xa44f4['filters']=_['intersection'](_0xa44f4[_0xe830('0x32')],_0xa44f4[_0xe830('0x34')]);_0x204f4a['attributes']=_[_0xe830('0x36')](_0xa44f4['model'],qs[_0xe830('0x37')](_0xa9d3e4[_0xe830('0x34')][_0xe830('0x37')]));_0x204f4a[_0xe830('0x48')]=_0x204f4a[_0xe830('0x48')][_0xe830('0x38')]?_0x204f4a['attributes']:_0xa44f4[_0xe830('0x32')];if(_0xa9d3e4[_0xe830('0x34')][_0xe830('0x43')]){_0x204f4a[_0xe830('0x44')]=[{'all':!![]}];}_0x204f4a=_[_0xe830('0x3f')]({},_0x204f4a,_0xa9d3e4['options']);return db[_0xe830('0x2f')][_0xe830('0x49')](_0x204f4a)['then'](handleEntityNotFound(_0x2bad02,null))['then'](respondWithResult(_0x2bad02,null))['catch'](handleError(_0x2bad02,null));};exports[_0xe830('0x4a')]=function(_0xf4a37b,_0x4e4ba8){return db[_0xe830('0x2f')][_0xe830('0x4a')](_0xf4a37b[_0xe830('0x4b')],{})[_0xe830('0x29')](function(_0x395a67){var _0x191fdf=_0xf4a37b['user'][_0xe830('0x4c')]({'plain':!![]});if(!_0x191fdf)throw new Error(_0xe830('0x4d'));if(_0x191fdf[_0xe830('0x4e')]==='user'){var _0x122586=_0x395a67['get']({'plain':!![]});var _0x25800a=_0xe830('0x2a');return db[_0xe830('0x4f')]['find']({'where':{'name':_0x25800a,'userProfileId':_0x191fdf[_0xe830('0x50')]},'raw':!![]})['then'](function(_0x5ec347){if(_0x5ec347&&_0x5ec347[_0xe830('0x51')]===0x0){return db[_0xe830('0x52')][_0xe830('0x4a')]({'name':_0x122586[_0xe830('0x2c')],'resourceId':_0x122586['id'],'type':_0x5ec347[_0xe830('0x2c')],'sectionId':_0x5ec347['id']},{})[_0xe830('0x29')](function(){return _0x395a67;});}else{return _0x395a67;}})['catch'](function(_0x4ebb17){logger[_0xe830('0x2b')](_0xe830('0x53'),_0x4ebb17);throw _0x4ebb17;});}return _0x395a67;})['then'](respondWithResult(_0x4e4ba8,0xc9))[_0xe830('0x45')](handleError(_0x4e4ba8,null));};exports[_0xe830('0x27')]=function(_0x44dd78,_0x357d02){if(_0x44dd78['body']['id']){delete _0x44dd78[_0xe830('0x4b')]['id'];}return db[_0xe830('0x2f')][_0xe830('0x49')]({'where':{'id':_0x44dd78[_0xe830('0x54')]['id']}})[_0xe830('0x29')](handleEntityNotFound(_0x357d02,null))[_0xe830('0x29')](saveUpdates(_0x44dd78['body'],null))['then'](respondWithResult(_0x357d02,null))[_0xe830('0x45')](handleError(_0x357d02,null));};exports['destroy']=function(_0x582aaa,_0x113534){return db[_0xe830('0x2f')][_0xe830('0x49')]({'where':{'id':_0x582aaa[_0xe830('0x54')]['id']}})[_0xe830('0x29')](handleEntityNotFound(_0x113534,null))['then'](removeEntity(_0x113534,null))['catch'](handleError(_0x113534,null));}; \ No newline at end of file +var _0x71e3=['find','userProfileId','autoAssociation','error','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','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','Variable','includeAll','include','findAll','rows','catch','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables'];(function(_0x28397f,_0x2b473f){var _0x373410=function(_0x1dd46){while(--_0x1dd46){_0x28397f['push'](_0x28397f['shift']());}};_0x373410(++_0x2b473f);}(_0x71e3,0xff));var _0x371e=function(_0x4f3144,_0x42b5d8){_0x4f3144=_0x4f3144-0x0;var _0x29bc7e=_0x71e3[_0x4f3144];return _0x29bc7e;};'use strict';var emlformat=require(_0x371e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x371e('0x1'));var jsonpatch=require(_0x371e('0x2'));var rp=require(_0x371e('0x3'));var moment=require(_0x371e('0x4'));var BPromise=require(_0x371e('0x5'));var Mustache=require(_0x371e('0x6'));var util=require(_0x371e('0x7'));var path=require(_0x371e('0x8'));var sox=require(_0x371e('0x9'));var csv=require(_0x371e('0xa'));var ejs=require(_0x371e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x371e('0xc'));var crypto=require(_0x371e('0xd'));var jsforce=require(_0x371e('0xe'));var deskjs=require(_0x371e('0xf'));var toCsv=require(_0x371e('0xa'));var querystring=require(_0x371e('0x10'));var Papa=require(_0x371e('0x11'));var Redis=require(_0x371e('0x12'));var authService=require(_0x371e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x371e('0x14'));var hardwareService=require(_0x371e('0x15'));var logger=require(_0x371e('0x16'))('api');var utils=require(_0x371e('0x17'));var config=require(_0x371e('0x18'));var licenseUtil=require(_0x371e('0x19'));var db=require(_0x371e('0x1a'))['db'];function respondWithStatusCode(_0x466788,_0x5a94c5){_0x5a94c5=_0x5a94c5||0xcc;return function(_0x28b76a){if(_0x28b76a){return _0x466788['sendStatus'](_0x5a94c5);}return _0x466788[_0x371e('0x1b')](_0x5a94c5)[_0x371e('0x1c')]();};}function respondWithResult(_0x10da97,_0x170ebb){_0x170ebb=_0x170ebb||0xc8;return function(_0x5ae6d1){if(_0x5ae6d1){return _0x10da97[_0x371e('0x1b')](_0x170ebb)['json'](_0x5ae6d1);}};}function respondWithFilteredResult(_0x32e3d4,_0x1ab090){return function(_0x5ed0eb){if(_0x5ed0eb){var _0x55ed55=typeof _0x1ab090[_0x371e('0x1d')]===_0x371e('0x1e')&&typeof _0x1ab090['limit']==='undefined';var _0x31ba3f=_0x5ed0eb[_0x371e('0x1f')];var _0x4b119c=_0x55ed55?0x0:_0x1ab090[_0x371e('0x1d')];var _0x21f6c7=_0x55ed55?_0x5ed0eb['count']:_0x1ab090['offset']+_0x1ab090['limit'];var _0x2178b2;if(_0x21f6c7>=_0x31ba3f){_0x21f6c7=_0x31ba3f;_0x2178b2=0xc8;}else{_0x2178b2=0xce;}_0x32e3d4[_0x371e('0x1b')](_0x2178b2);return _0x32e3d4[_0x371e('0x20')](_0x371e('0x21'),_0x4b119c+'-'+_0x21f6c7+'/'+_0x31ba3f)['json'](_0x5ed0eb);}return null;};}function patchUpdates(_0x2a3d5e){return function(_0x1a794e){try{jsonpatch['apply'](_0x1a794e,_0x2a3d5e,!![]);}catch(_0x14b52a){return BPromise['reject'](_0x14b52a);}return _0x1a794e[_0x371e('0x22')]();};}function saveUpdates(_0x4ef3f0,_0x1705fc){return function(_0x4e4419){if(_0x4e4419){return _0x4e4419[_0x371e('0x23')](_0x4ef3f0)[_0x371e('0x24')](function(_0x528f58){return _0x528f58;});}return null;};}function removeEntity(_0x512632,_0x49737c){return function(_0x4c5243){if(_0x4c5243){return _0x4c5243[_0x371e('0x25')]()[_0x371e('0x24')](function(){var _0xa844b7=_0x4c5243[_0x371e('0x26')]({'plain':!![]});var _0x51f366='Variables';return db[_0x371e('0x27')][_0x371e('0x25')]({'where':{'type':_0x51f366,'resourceId':_0xa844b7['id']}})[_0x371e('0x24')](function(){return _0x4c5243;});})[_0x371e('0x24')](function(){_0x512632[_0x371e('0x1b')](0xcc)[_0x371e('0x1c')]();});}};}function handleEntityNotFound(_0x4e1d90,_0x3cabb3){return function(_0x1ab7c5){if(!_0x1ab7c5){_0x4e1d90['sendStatus'](0x194);}return _0x1ab7c5;};}function handleError(_0x10afd8,_0x1965b3){_0x1965b3=_0x1965b3||0x1f4;return function(_0x17f75e){logger['error'](_0x17f75e[_0x371e('0x28')]);if(_0x17f75e['name']){delete _0x17f75e[_0x371e('0x29')];}_0x10afd8['status'](_0x1965b3)[_0x371e('0x2a')](_0x17f75e);};}exports['index']=function(_0x29ae65,_0x3ef085){var _0x1fdcd0={},_0x566411={},_0x3976eb={'count':0x0,'rows':[]};var _0x4c1d5f=_[_0x371e('0x2b')](db['Variable'][_0x371e('0x2c')],function(_0x36869e){return{'name':_0x36869e[_0x371e('0x2d')],'type':_0x36869e[_0x371e('0x2e')][_0x371e('0x2f')]};});_0x566411[_0x371e('0x30')]=_[_0x371e('0x2b')](_0x4c1d5f,_0x371e('0x29'));_0x566411[_0x371e('0x31')]=_[_0x371e('0x32')](_0x29ae65[_0x371e('0x31')]);_0x566411[_0x371e('0x33')]=_[_0x371e('0x34')](_0x566411[_0x371e('0x30')],_0x566411[_0x371e('0x31')]);_0x1fdcd0[_0x371e('0x35')]=_[_0x371e('0x34')](_0x566411['model'],qs[_0x371e('0x36')](_0x29ae65[_0x371e('0x31')]['fields']));_0x1fdcd0[_0x371e('0x35')]=_0x1fdcd0[_0x371e('0x35')][_0x371e('0x37')]?_0x1fdcd0[_0x371e('0x35')]:_0x566411['model'];if(!_0x29ae65[_0x371e('0x31')][_0x371e('0x38')](_0x371e('0x39'))){_0x1fdcd0[_0x371e('0x3a')]=qs['limit'](_0x29ae65['query'][_0x371e('0x3a')]);_0x1fdcd0[_0x371e('0x1d')]=qs[_0x371e('0x1d')](_0x29ae65['query']['offset']);}_0x1fdcd0['order']=qs['sort'](_0x29ae65[_0x371e('0x31')][_0x371e('0x3b')]);_0x1fdcd0[_0x371e('0x3c')]=qs[_0x371e('0x33')](_['pick'](_0x29ae65['query'],_0x566411[_0x371e('0x33')]),_0x4c1d5f);if(_0x29ae65['query'][_0x371e('0x3d')]){_0x1fdcd0[_0x371e('0x3c')]=_[_0x371e('0x3e')](_0x1fdcd0[_0x371e('0x3c')],{'$or':_[_0x371e('0x2b')](_0x4c1d5f,function(_0x4dbb78){if(_0x4dbb78['type']!==_0x371e('0x3f')){var _0x389697={};_0x389697[_0x4dbb78[_0x371e('0x29')]]={'$like':'%'+_0x29ae65[_0x371e('0x31')]['filter']+'%'};return _0x389697;}})});}_0x1fdcd0=_[_0x371e('0x3e')]({},_0x1fdcd0,_0x29ae65[_0x371e('0x40')]);var _0x128c1c={'where':_0x1fdcd0[_0x371e('0x3c')]};return db[_0x371e('0x41')][_0x371e('0x1f')](_0x128c1c)[_0x371e('0x24')](function(_0x54dd17){_0x3976eb[_0x371e('0x1f')]=_0x54dd17;if(_0x29ae65[_0x371e('0x31')][_0x371e('0x42')]){_0x1fdcd0[_0x371e('0x43')]=[{'all':!![]}];}return db[_0x371e('0x41')][_0x371e('0x44')](_0x1fdcd0);})[_0x371e('0x24')](function(_0x35c434){_0x3976eb[_0x371e('0x45')]=_0x35c434;return _0x3976eb;})[_0x371e('0x24')](respondWithFilteredResult(_0x3ef085,_0x1fdcd0))[_0x371e('0x46')](handleError(_0x3ef085,null));};exports[_0x371e('0x47')]=function(_0xbb6730,_0x308393){var _0x5aa723={'raw':!![],'where':{'id':_0xbb6730[_0x371e('0x48')]['id']}},_0x526928={};_0x526928[_0x371e('0x30')]=_['keys'](db[_0x371e('0x41')]['rawAttributes']);_0x526928[_0x371e('0x31')]=_[_0x371e('0x32')](_0xbb6730[_0x371e('0x31')]);_0x526928[_0x371e('0x33')]=_[_0x371e('0x34')](_0x526928[_0x371e('0x30')],_0x526928[_0x371e('0x31')]);_0x5aa723[_0x371e('0x35')]=_['intersection'](_0x526928[_0x371e('0x30')],qs[_0x371e('0x36')](_0xbb6730['query'][_0x371e('0x36')]));_0x5aa723[_0x371e('0x35')]=_0x5aa723['attributes'][_0x371e('0x37')]?_0x5aa723[_0x371e('0x35')]:_0x526928['model'];if(_0xbb6730[_0x371e('0x31')]['includeAll']){_0x5aa723[_0x371e('0x43')]=[{'all':!![]}];}_0x5aa723=_[_0x371e('0x3e')]({},_0x5aa723,_0xbb6730[_0x371e('0x40')]);return db[_0x371e('0x41')]['find'](_0x5aa723)[_0x371e('0x24')](handleEntityNotFound(_0x308393,null))[_0x371e('0x24')](respondWithResult(_0x308393,null))['catch'](handleError(_0x308393,null));};exports[_0x371e('0x49')]=function(_0x64e6e1,_0x5e1da6){return db['Variable'][_0x371e('0x49')](_0x64e6e1['body'],{})[_0x371e('0x24')](function(_0x5df59d){var _0x4acc76=_0x64e6e1['user'][_0x371e('0x26')]({'plain':!![]});if(!_0x4acc76)throw new Error(_0x371e('0x4a'));if(_0x4acc76[_0x371e('0x4b')]==='user'){var _0x27cb65=_0x5df59d[_0x371e('0x26')]({'plain':!![]});var _0x2f25d9=_0x371e('0x4c');return db['UserProfileSection'][_0x371e('0x4d')]({'where':{'name':_0x2f25d9,'userProfileId':_0x4acc76[_0x371e('0x4e')]},'raw':!![]})[_0x371e('0x24')](function(_0xdc2408){if(_0xdc2408&&_0xdc2408[_0x371e('0x4f')]===0x0){return db[_0x371e('0x27')]['create']({'name':_0x27cb65[_0x371e('0x29')],'resourceId':_0x27cb65['id'],'type':_0xdc2408[_0x371e('0x29')],'sectionId':_0xdc2408['id']},{})['then'](function(){return _0x5df59d;});}else{return _0x5df59d;}})[_0x371e('0x46')](function(_0xe8df12){logger[_0x371e('0x50')](_0x371e('0x51'),_0xe8df12);throw _0xe8df12;});}return _0x5df59d;})[_0x371e('0x24')](respondWithResult(_0x5e1da6,0xc9))[_0x371e('0x46')](handleError(_0x5e1da6,null));};exports['update']=function(_0x3a7c3d,_0x3d8999){if(_0x3a7c3d[_0x371e('0x52')]['id']){delete _0x3a7c3d[_0x371e('0x52')]['id'];}return db[_0x371e('0x41')][_0x371e('0x4d')]({'where':{'id':_0x3a7c3d[_0x371e('0x48')]['id']}})[_0x371e('0x24')](handleEntityNotFound(_0x3d8999,null))['then'](saveUpdates(_0x3a7c3d[_0x371e('0x52')],null))[_0x371e('0x24')](respondWithResult(_0x3d8999,null))['catch'](handleError(_0x3d8999,null));};exports['destroy']=function(_0xe33aaf,_0x2a6dc8){return db[_0x371e('0x41')]['find']({'where':{'id':_0xe33aaf[_0x371e('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a6dc8,null))[_0x371e('0x24')](removeEntity(_0x2a6dc8,null))[_0x371e('0x46')](handleError(_0x2a6dc8,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 759d4ed..49e812d 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 _0x3d5d=['bluebird','path','rimraf','./variable.attributes','exports','define','Variable','tools_variables','util','../../config/logger','api'];(function(_0x4de3e3,_0x42055a){var _0x50d5d9=function(_0x2e2215){while(--_0x2e2215){_0x4de3e3['push'](_0x4de3e3['shift']());}};_0x50d5d9(++_0x42055a);}(_0x3d5d,0x8c));var _0xd3d5=function(_0xf4666e,_0x571140){_0xf4666e=_0xf4666e-0x0;var _0x1853f1=_0x3d5d[_0xf4666e];return _0x1853f1;};'use strict';var _=require('lodash');var util=require(_0xd3d5('0x0'));var logger=require(_0xd3d5('0x1'))(_0xd3d5('0x2'));var moment=require('moment');var BPromise=require(_0xd3d5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3d5('0x4'));var rimraf=require(_0xd3d5('0x5'));var config=require('../../config/environment');var attributes=require(_0xd3d5('0x6'));module[_0xd3d5('0x7')]=function(_0x4fb5de,_0xe966c9){return _0x4fb5de[_0xd3d5('0x8')](_0xd3d5('0x9'),attributes,{'tableName':_0xd3d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3e5=['lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','Variable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa3e5,0x198));var _0x5a3e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa3e5[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x5a3e('0x0'));var util=require('util');var logger=require(_0x5a3e('0x1'))('api');var moment=require(_0x5a3e('0x2'));var BPromise=require(_0x5a3e('0x3'));var rp=require(_0x5a3e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5a3e('0x5'));var attributes=require('./variable.attributes');module[_0x5a3e('0x6')]=function(_0x467dbe,_0x3382e6){return _0x467dbe['define'](_0x5a3e('0x7'),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 9575c51..0dd83c7 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 _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0x3e74,0x175));var _0x43e7=function(_0x1c1b37,_0xcfbef0){_0x1c1b37=_0x1c1b37-0x0;var _0x13bc38=_0x3e74[_0x1c1b37];return _0x13bc38;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file +var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x30e622,_0x402421){var _0x2e5fec=function(_0x392800){while(--_0x392800){_0x30e622['push'](_0x30e622['shift']());}};_0x2e5fec(++_0x402421);}(_0x814b,0x1a2));var _0xb814=function(_0x16e9b5,_0x192142){_0x16e9b5=_0x16e9b5-0x0;var _0x206df0=_0x814b[_0x16e9b5];return _0x206df0;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index cb00c59..e4e58f9 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 _0x0bef=['index','/fetch','isAuthenticated','canUpdate','fetch','/pull','pull','/restart','restart','/migrations','migrations','Router','../../components/auth/service','./version.controller','get'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x0bef,0x65));var _0xf0be=function(_0x836c91,_0x2dcc07){_0x836c91=_0x836c91-0x0;var _0x238fda=_0x0bef[_0x836c91];return _0x238fda;};'use strict';var express=require('express');var router=express[_0xf0be('0x0')]();var auth=require(_0xf0be('0x1'));var controller=require(_0xf0be('0x2'));router[_0xf0be('0x3')]('/',controller[_0xf0be('0x4')]);router['get'](_0xf0be('0x5'),auth[_0xf0be('0x6')](),auth[_0xf0be('0x7')](),controller[_0xf0be('0x8')]);router['get']('/reset',auth[_0xf0be('0x6')](),auth[_0xf0be('0x7')](),controller['reset']);router[_0xf0be('0x3')](_0xf0be('0x9'),auth[_0xf0be('0x6')](),auth[_0xf0be('0x7')](),controller[_0xf0be('0xa')]);router[_0xf0be('0x3')](_0xf0be('0xb'),auth[_0xf0be('0x6')](),controller[_0xf0be('0xc')]);router[_0xf0be('0x3')](_0xf0be('0xd'),controller[_0xf0be('0xe')]);module['exports']=router; \ No newline at end of file +var _0xebc5=['reset','/migrations','Router','./version.controller','get','index','/fetch','canUpdate','fetch','/reset','isAuthenticated'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xebc5,0x86));var _0x5ebc=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xebc5[_0x33032e];return _0x13316b;};'use strict';var express=require('express');var router=express[_0x5ebc('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5ebc('0x1'));router[_0x5ebc('0x2')]('/',controller[_0x5ebc('0x3')]);router[_0x5ebc('0x2')](_0x5ebc('0x4'),auth['isAuthenticated'](),auth[_0x5ebc('0x5')](),controller[_0x5ebc('0x6')]);router[_0x5ebc('0x2')](_0x5ebc('0x7'),auth[_0x5ebc('0x8')](),auth[_0x5ebc('0x5')](),controller[_0x5ebc('0x9')]);router[_0x5ebc('0x2')]('/pull',auth['isAuthenticated'](),auth[_0x5ebc('0x5')](),controller['pull']);router['get']('/restart',auth[_0x5ebc('0x8')](),controller['restart']);router[_0x5ebc('0x2')](_0x5ebc('0xa'),controller['migrations']);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 adaf8f9..262c7f5 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 _0xd790=['tags','latest','2.0.0','status','json','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','root','length','push','sort','sequelize','Migration','getQueryInterface','constructor','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','catch','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/logger','update','simple-git','index','exports','version','query','fetch'];(function(_0x487b68,_0x1c6956){var _0x117cdd=function(_0x4a1d13){while(--_0x4a1d13){_0x487b68['push'](_0x487b68['shift']());}};_0x117cdd(++_0x1c6956);}(_0xd790,0x128));var _0x0d79=function(_0x230bb8,_0xa1718){_0x230bb8=_0x230bb8-0x0;var _0x16cb9a=_0xd790[_0x230bb8];return _0x16cb9a;};'use strict';var Umzug=require(_0x0d79('0x0'));var path=require(_0x0d79('0x1'));var fs=require('fs');var _=require(_0x0d79('0x2'));var pkginfo=require(_0x0d79('0x3'))(module,'version');var compareVersions=require(_0x0d79('0x4'));var exec=require(_0x0d79('0x5'))[_0x0d79('0x6')];var db=require(_0x0d79('0x7'))['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0x0d79('0x8'))(_0x0d79('0x9'));var git=require(_0x0d79('0xa'))(config['root']);exports[_0x0d79('0xb')]=function(_0x3330a7,_0x47c7e1){var _0x5192bd={'current':module[_0x0d79('0xc')][_0x0d79('0xd')],'phonebar':0x2};if(_0x3330a7[_0x0d79('0xe')]&&_0x3330a7[_0x0d79('0xe')]['latest']){return git[_0x0d79('0xf')]()[_0x0d79('0x10')](function(_0x7d36f2,_0x275926){_0x5192bd['latest']=(_0x7d36f2?module[_0x0d79('0xc')][_0x0d79('0xd')]:_0x275926[_0x0d79('0x11')])||_0x0d79('0x12');return _0x47c7e1[_0x0d79('0x13')](0xc8)[_0x0d79('0x14')](_0x5192bd);});}else{return _0x47c7e1[_0x0d79('0x13')](0xc8)[_0x0d79('0x14')](_0x5192bd);}};exports[_0x0d79('0xf')]=function(_0x3fb6d5,_0x1450cb){return git[_0x0d79('0xf')]([_0x0d79('0x15'),_0x0d79('0x16')],function(_0x265a26){if(_0x265a26){logger[_0x0d79('0x17')](_0x265a26);return _0x1450cb[_0x0d79('0x13')](0x1f4)[_0x0d79('0x14')](_0x265a26);}logger['info'](_0x0d79('0x18'));return _0x1450cb['status'](0xc8)[_0x0d79('0x14')]({'output':_0x0d79('0x19')});});};exports['reset']=function(_0x57ddd0,_0x1d39d3){return git[_0x0d79('0x1a')](['--hard',_0x0d79('0x1b')],function(_0x2afc29){if(_0x2afc29){logger[_0x0d79('0x17')](_0x2afc29);return _0x1d39d3[_0x0d79('0x13')](0x1f4)[_0x0d79('0x14')](_0x2afc29);}logger[_0x0d79('0x1c')](_0x0d79('0x1d'));return _0x1d39d3[_0x0d79('0x13')](0xc8)[_0x0d79('0x14')]({'output':_0x0d79('0x1e')});});};exports[_0x0d79('0x1f')]=function(_0x5d29c4,_0x322365){exec(_0x0d79('0x20'),function(_0x2226b8,_0x1954f1,_0x4a7e1f){logger[_0x0d79('0x1c')](_0x1954f1);logger[_0x0d79('0x1c')](_0x4a7e1f);if(_0x2226b8){logger['error'](_0x2226b8);return _0x322365['status'](0x1f4)[_0x0d79('0x14')](_0x2226b8);}return _0x322365[_0x0d79('0x13')](0xc8)[_0x0d79('0x14')]({'output':_0x1954f1});});};exports[_0x0d79('0x21')]=function(_0x3d8a5f,_0x1d2297){return pm2['restart']('motion2')[_0x0d79('0x22')](function(_0x234053){logger[_0x0d79('0x1c')](_0x0d79('0x23'),_0x234053);return _0x1d2297[_0x0d79('0x13')](0xc8)[_0x0d79('0x14')]({'output':_0x0d79('0x24')});})['catch'](function(_0x3e9351){logger[_0x0d79('0x17')](_0x3e9351);return _0x1d2297[_0x0d79('0x13')](0x1f4)[_0x0d79('0x14')](_0x3e9351);});};exports[_0x0d79('0x25')]=function(_0x1ff7a4,_0xe02019){var _0x503d76=fs[_0x0d79('0x26')](path[_0x0d79('0x27')](config[_0x0d79('0x28')],'server',_0x0d79('0x25')));var _0x35ec53=[];for(var _0x2a0c3f=0x0;_0x2a0c3f<_0x503d76[_0x0d79('0x29')];_0x2a0c3f++){var _0x33e18f=_0x503d76[_0x2a0c3f]['replace']('.js','');if(compareVersions(module['exports'][_0x0d79('0xd')],_0x33e18f)===-0x1){_0x35ec53[_0x0d79('0x2a')](_0x33e18f);}}if(_0x35ec53['length']){var _0x42ac8a=_0x35ec53[_0x0d79('0x2b')](compareVersions);var _0x50fa44=new Umzug({'storage':_0x0d79('0x2c'),'storageOptions':{'model':db['Migration'],'modelName':_0x0d79('0x2d'),'columnName':_0x0d79('0xd')},'migrations':{'params':[db[_0x0d79('0x2c')][_0x0d79('0x2e')](),db['sequelize'][_0x0d79('0x2f')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x0d79('0x27')](config[_0x0d79('0x28')],'server',_0x0d79('0x25')),'pattern':/\.js$/}});_0x50fa44['up']({'migrations':_['map'](_0x42ac8a,function(_0x18e226){return _0x18e226+_0x0d79('0x30');})})['then'](function(){return _0xe02019[_0x0d79('0x13')](0xc8)[_0x0d79('0x14')]({'output':_0x0d79('0x31')+module[_0x0d79('0xc')][_0x0d79('0xd')]+'\x20to\x20'+_['last'](_0x42ac8a),'migrations':_[_0x0d79('0x27')](_0x42ac8a)});})[_0x0d79('0x32')](function(_0x4fc0f9){if(_0x4fc0f9 instanceof db[_0x0d79('0x2c')]['UniqueConstraintError']){return _0xe02019[_0x0d79('0x13')](0xc8)[_0x0d79('0x14')]({'output':_0x0d79('0x33')});}else{return _0xe02019[_0x0d79('0x13')](0x1f4)['json'](_0x4fc0f9);}});}else{return _0xe02019[_0x0d79('0x13')](0xc8)[_0x0d79('0x14')]({'output':_0x0d79('0x33')});}}; \ No newline at end of file +var _0xf34c=['reset','--hard','FETCH_HEAD','info','pull','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','length','replace','.js','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','root','query','latest','fetch','2.0.0','status','origin','master','error','git\x20fetch','json','git\x20fetch\x20origin\x20master'];(function(_0xb29bef,_0x45aff1){var _0x878163=function(_0xa270a1){while(--_0xa270a1){_0xb29bef['push'](_0xb29bef['shift']());}};_0x878163(++_0x45aff1);}(_0xf34c,0x7d));var _0xcf34=function(_0x2cc443,_0x12e38e){_0x2cc443=_0x2cc443-0x0;var _0x6b7d74=_0xf34c[_0x2cc443];return _0x6b7d74;};'use strict';var Umzug=require(_0xcf34('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xcf34('0x1'))(module,_0xcf34('0x2'));var compareVersions=require(_0xcf34('0x3'));var exec=require(_0xcf34('0x4'))['exec'];var db=require(_0xcf34('0x5'))['db'];var config=require(_0xcf34('0x6'));var pm2=require(_0xcf34('0x7'));var logger=require(_0xcf34('0x8'))(_0xcf34('0x9'));var git=require('simple-git')(config[_0xcf34('0xa')]);exports['index']=function(_0x4ca159,_0x3e6b0d){var _0x1040ff={'current':module['exports']['version'],'phonebar':0x2};if(_0x4ca159[_0xcf34('0xb')]&&_0x4ca159[_0xcf34('0xb')][_0xcf34('0xc')]){return git[_0xcf34('0xd')]()['tags'](function(_0x4a76ec,_0x44f7e8){_0x1040ff['latest']=(_0x4a76ec?module['exports'][_0xcf34('0x2')]:_0x44f7e8['latest'])||_0xcf34('0xe');return _0x3e6b0d[_0xcf34('0xf')](0xc8)['json'](_0x1040ff);});}else{return _0x3e6b0d[_0xcf34('0xf')](0xc8)['json'](_0x1040ff);}};exports[_0xcf34('0xd')]=function(_0x5b2d77,_0x100222){return git['fetch']([_0xcf34('0x10'),_0xcf34('0x11')],function(_0x92b594){if(_0x92b594){logger[_0xcf34('0x12')](_0x92b594);return _0x100222[_0xcf34('0xf')](0x1f4)['json'](_0x92b594);}logger['info'](_0xcf34('0x13'));return _0x100222['status'](0xc8)[_0xcf34('0x14')]({'output':_0xcf34('0x15')});});};exports[_0xcf34('0x16')]=function(_0x2c2ad7,_0x4c99d6){return git['reset']([_0xcf34('0x17'),_0xcf34('0x18')],function(_0x8d37ce){if(_0x8d37ce){logger[_0xcf34('0x12')](_0x8d37ce);return _0x4c99d6[_0xcf34('0xf')](0x1f4)[_0xcf34('0x14')](_0x8d37ce);}logger[_0xcf34('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x4c99d6[_0xcf34('0xf')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0xcf34('0x1a')]=function(_0x4cf412,_0xf7bb0b){exec('npm\x20install\x20--production',function(_0x24eae0,_0x470bbe,_0x96b6a9){logger['info'](_0x470bbe);logger[_0xcf34('0x19')](_0x96b6a9);if(_0x24eae0){logger[_0xcf34('0x12')](_0x24eae0);return _0xf7bb0b[_0xcf34('0xf')](0x1f4)[_0xcf34('0x14')](_0x24eae0);}return _0xf7bb0b[_0xcf34('0xf')](0xc8)[_0xcf34('0x14')]({'output':_0x470bbe});});};exports['restart']=function(_0x580449,_0x50cb35){return pm2[_0xcf34('0x1b')](_0xcf34('0x1c'))['then'](function(_0x49739c){logger[_0xcf34('0x19')]('pm2\x20restart\x20motion\x20%s',_0x49739c);return _0x50cb35['status'](0xc8)[_0xcf34('0x14')]({'output':_0xcf34('0x1d')});})[_0xcf34('0x1e')](function(_0x292706){logger[_0xcf34('0x12')](_0x292706);return _0x50cb35[_0xcf34('0xf')](0x1f4)[_0xcf34('0x14')](_0x292706);});};exports[_0xcf34('0x1f')]=function(_0x1995be,_0x2e4354){var _0x488a71=fs[_0xcf34('0x20')](path['join'](config[_0xcf34('0xa')],'server',_0xcf34('0x1f')));var _0x5c5c86=[];for(var _0x4fec46=0x0;_0x4fec46<_0x488a71[_0xcf34('0x21')];_0x4fec46++){var _0x366381=_0x488a71[_0x4fec46][_0xcf34('0x22')](_0xcf34('0x23'),'');if(compareVersions(module['exports'][_0xcf34('0x2')],_0x366381)===-0x1){_0x5c5c86['push'](_0x366381);}}if(_0x5c5c86[_0xcf34('0x21')]){var _0x5e180c=_0x5c5c86[_0xcf34('0x24')](compareVersions);var _0x470561=new Umzug({'storage':_0xcf34('0x25'),'storageOptions':{'model':db['Migration'],'modelName':_0xcf34('0x26'),'columnName':_0xcf34('0x2')},'migrations':{'params':[db[_0xcf34('0x25')][_0xcf34('0x27')](),db[_0xcf34('0x25')]['constructor'],function(){throw new Error(_0xcf34('0x28'));}],'path':path[_0xcf34('0x29')](config[_0xcf34('0xa')],_0xcf34('0x2a'),_0xcf34('0x1f')),'pattern':/\.js$/}});_0x470561['up']({'migrations':_[_0xcf34('0x2b')](_0x5e180c,function(_0x426dc3){return _0x426dc3+_0xcf34('0x23');})})[_0xcf34('0x2c')](function(){return _0x2e4354[_0xcf34('0xf')](0xc8)[_0xcf34('0x14')]({'output':_0xcf34('0x2d')+module['exports'][_0xcf34('0x2')]+_0xcf34('0x2e')+_[_0xcf34('0x2f')](_0x5e180c),'migrations':_['join'](_0x5e180c)});})[_0xcf34('0x1e')](function(_0x5979c4){if(_0x5979c4 instanceof db['sequelize']['UniqueConstraintError']){return _0x2e4354[_0xcf34('0xf')](0xc8)['json']({'output':_0xcf34('0x30')});}else{return _0x2e4354['status'](0x1f4)['json'](_0x5979c4);}});}else{return _0x2e4354[_0xcf34('0xf')](0xc8)[_0xcf34('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 1816956..f1f3be1 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 _0x7a34=['Router','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','post','put','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4f3949,_0x1b28b5){var _0x2bbb60=function(_0x137b51){while(--_0x137b51){_0x4f3949['push'](_0x4f3949['shift']());}};_0x2bbb60(++_0x1b28b5);}(_0x7a34,0x161));var _0x47a3=function(_0x2734be,_0x2f84da){_0x2734be=_0x2734be-0x0;var _0x4a0813=_0x7a34[_0x2734be];return _0x4a0813;};'use strict';var multer=require(_0x47a3('0x0'));var util=require(_0x47a3('0x1'));var path=require(_0x47a3('0x2'));var timeout=require(_0x47a3('0x3'));var express=require('express');var router=express[_0x47a3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x47a3('0x5'));var config=require(_0x47a3('0x6'));var controller=require(_0x47a3('0x7'));router[_0x47a3('0x8')]('/',auth[_0x47a3('0x9')](),controller[_0x47a3('0xa')]);router[_0x47a3('0x8')](_0x47a3('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x47a3('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a3('0xc')]('/',auth[_0x47a3('0x9')](),controller['create']);router[_0x47a3('0xd')](_0x47a3('0xe'),auth[_0x47a3('0x9')](),controller['update']);router['delete'](_0x47a3('0xe'),auth[_0x47a3('0x9')](),controller[_0x47a3('0xf')]);module[_0x47a3('0x10')]=router; \ No newline at end of file +var _0x5f2d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','/describe','isAuthenticated','describe','/:id','create','update','destroy','exports','connect-timeout','express'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x5f2d,0x16e));var _0xd5f2=function(_0x28cc19,_0x576e42){_0x28cc19=_0x28cc19-0x0;var _0x5f0bc9=_0x5f2d[_0x28cc19];return _0x5f0bc9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd5f2('0x0'));var express=require(_0xd5f2('0x1'));var router=express['Router']();var fs_extra=require(_0xd5f2('0x2'));var auth=require(_0xd5f2('0x3'));var interaction=require(_0xd5f2('0x4'));var config=require(_0xd5f2('0x5'));var controller=require(_0xd5f2('0x6'));router[_0xd5f2('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd5f2('0x8'),auth[_0xd5f2('0x9')](),controller[_0xd5f2('0xa')]);router[_0xd5f2('0x7')](_0xd5f2('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd5f2('0x9')](),controller[_0xd5f2('0xc')]);router['put'](_0xd5f2('0xb'),auth[_0xd5f2('0x9')](),controller[_0xd5f2('0xd')]);router['delete'](_0xd5f2('0xb'),auth[_0xd5f2('0x9')](),controller[_0xd5f2('0xe')]);module[_0xd5f2('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index bdae98f..a8dcee0 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 _0xc692=['DATE','BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xc692,0x15f));var _0x2c69=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xc692[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x2c69('0x0'));module[_0x2c69('0x1')]={'type':{'type':Sequelize[_0x2c69('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2c69('0x2')]},'queue':{'type':Sequelize[_0x2c69('0x2')]},'interface':{'type':Sequelize[_0x2c69('0x2')]},'membername':{'type':Sequelize[_0x2c69('0x2')]},'agentcalledAt':{'type':Sequelize[_0x2c69('0x3')]},'agentconnectAt':{'type':Sequelize[_0x2c69('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x2c69('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x2c69('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x2c69('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x2c69('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x2c69('0x5')]},'agentacw':{'type':Sequelize[_0x2c69('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2c69('0x5')]},'reason':{'type':Sequelize[_0x2c69('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2c69('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x2c69('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2c69('0x2')]},'language':{'type':Sequelize[_0x2c69('0x2')]},'accountcode':{'type':Sequelize[_0x2c69('0x2')]},'context':{'type':Sequelize[_0x2c69('0x2')]},'exten':{'type':Sequelize[_0x2c69('0x2')]},'priority':{'type':Sequelize[_0x2c69('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x2c69('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x2c69('0x2')]},'destcalleridname':{'type':Sequelize[_0x2c69('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x2c69('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x2c69('0x2')]},'destlanguage':{'type':Sequelize[_0x2c69('0x2')]},'destaccountcode':{'type':Sequelize[_0x2c69('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x2c69('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x2c69('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x2c69('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2c69('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x2c69('0x2')]},'agententerreason':{'type':Sequelize[_0x2c69('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd1f8=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xd1f8,0x18e));var _0x8d1f=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0xd1f8[_0x519756];return _0x37047e;};'use strict';var Sequelize=require(_0x8d1f('0x0'));module[_0x8d1f('0x1')]={'type':{'type':Sequelize[_0x8d1f('0x2')]},'uniqueid':{'type':Sequelize[_0x8d1f('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8d1f('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x8d1f('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x8d1f('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x8d1f('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x8d1f('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x8d1f('0x4')]},'agentcomplete':{'type':Sequelize[_0x8d1f('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8d1f('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8d1f('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8d1f('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8d1f('0x4')]},'reason':{'type':Sequelize[_0x8d1f('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8d1f('0x2')]},'channelstate':{'type':Sequelize[_0x8d1f('0x4')]},'channelstatedesc':{'type':Sequelize[_0x8d1f('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8d1f('0x2')]},'connectedlinename':{'type':Sequelize[_0x8d1f('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8d1f('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8d1f('0x2')]},'destchannel':{'type':Sequelize[_0x8d1f('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8d1f('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8d1f('0x2')]},'destcalleridname':{'type':Sequelize[_0x8d1f('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x8d1f('0x2')]},'destlanguage':{'type':Sequelize[_0x8d1f('0x2')]},'destaccountcode':{'type':Sequelize[_0x8d1f('0x2')]},'destcontext':{'type':Sequelize[_0x8d1f('0x2')]},'destexten':{'type':Sequelize[_0x8d1f('0x2')]},'destpriority':{'type':Sequelize[_0x8d1f('0x2')]},'destuniqueid':{'type':Sequelize[_0x8d1f('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8d1f('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x8d1f('0x2')]},'transfer':{'type':Sequelize[_0x8d1f('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8d1f('0x2')],'comment':_0x8d1f('0x6')},'transferexten':{'type':Sequelize[_0x8d1f('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8d1f('0x2')]},'agententerreason':{'type':Sequelize[_0x8d1f('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 74149c3..26ad025 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 34002d9..6cafb26 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 _0xaa19=['uniqueid','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport'];(function(_0x3af770,_0x1a957a){var _0x42c9a9=function(_0x2afac3){while(--_0x2afac3){_0x3af770['push'](_0x3af770['shift']());}};_0x42c9a9(++_0x1a957a);}(_0xaa19,0x79));var _0x9aa1=function(_0x3d4811,_0x39c709){_0x3d4811=_0x3d4811-0x0;var _0x480b07=_0xaa19[_0x3d4811];return _0x480b07;};'use strict';var _=require(_0x9aa1('0x0'));var util=require(_0x9aa1('0x1'));var logger=require(_0x9aa1('0x2'))(_0x9aa1('0x3'));var moment=require('moment');var BPromise=require(_0x9aa1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9aa1('0x5'));var rimraf=require('rimraf');var config=require(_0x9aa1('0x6'));var attributes=require(_0x9aa1('0x7'));module[_0x9aa1('0x8')]=function(_0x52124b,_0x1e59f8){return _0x52124b[_0x9aa1('0x9')](_0x9aa1('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x9aa1('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x79a8=['request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x3c9d1d,_0x3b7813){var _0x2e471a=function(_0x14b34c){while(--_0x14b34c){_0x3c9d1d['push'](_0x3c9d1d['shift']());}};_0x2e471a(++_0x3b7813);}(_0x79a8,0x1d0));var _0x879a=function(_0x1b0c08,_0xd7531f){_0x1b0c08=_0x1b0c08-0x0;var _0x123dbf=_0x79a8[_0x1b0c08];return _0x123dbf;};'use strict';var _=require(_0x879a('0x0'));var util=require('util');var logger=require(_0x879a('0x1'))(_0x879a('0x2'));var moment=require(_0x879a('0x3'));var BPromise=require('bluebird');var rp=require(_0x879a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x879a('0x5'));var config=require(_0x879a('0x6'));var attributes=require(_0x879a('0x7'));module[_0x879a('0x8')]=function(_0x1808f1,_0x3cb89c){return _0x1808f1[_0x879a('0x9')](_0x879a('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x879a('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 05741f0..f1eaceb 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 _0x3ff1=['rpc','jayson/promise','client','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','info','VoiceAgentReport','create','body','options','CreateVoiceAgentReport','stringify','catch','raw','where','attributes','limit','UpdateVoiceAgentReport','moment','bluebird','../../config/utils','../../config/logger'];(function(_0x39e15b,_0x555185){var _0x4e5766=function(_0x45ef45){while(--_0x45ef45){_0x39e15b['push'](_0x39e15b['shift']());}};_0x4e5766(++_0x555185);}(_0x3ff1,0x130));var _0x13ff=function(_0x128b5c,_0x2b9de9){_0x128b5c=_0x128b5c-0x0;var _0x560aff=_0x3ff1[_0x128b5c];return _0x560aff;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x13ff('0x0'));var BPromise=require(_0x13ff('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x13ff('0x2'));var logger=require(_0x13ff('0x3'))(_0x13ff('0x4'));var config=require('../../config/environment');var jayson=require(_0x13ff('0x5'));var client=jayson[_0x13ff('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x326e7f,_0x548fae,_0x37e8c4){return new BPromise(function(_0x10956d,_0x3ec3d1){return client['request'](_0x326e7f,_0x37e8c4)[_0x13ff('0x7')](function(_0x324197){logger['info'](_0x13ff('0x8'),_0x548fae,_0x13ff('0x9'));logger[_0x13ff('0xa')](_0x13ff('0xb'),_0x548fae,'request\x20sent',JSON['stringify'](_0x324197));if(_0x324197[_0x13ff('0xc')]){if(_0x324197[_0x13ff('0xc')][_0x13ff('0xd')]===0x1f4){logger[_0x13ff('0xc')](_0x13ff('0x8'),_0x548fae,_0x324197[_0x13ff('0xc')][_0x13ff('0xe')]);return _0x3ec3d1(_0x324197[_0x13ff('0xc')][_0x13ff('0xe')]);}logger[_0x13ff('0xc')](_0x13ff('0x8'),_0x548fae,_0x324197[_0x13ff('0xc')][_0x13ff('0xe')]);return _0x10956d(_0x324197['error']['message']);}else{logger[_0x13ff('0xf')](_0x13ff('0x8'),_0x548fae,_0x13ff('0x9'));_0x10956d(_0x324197['result'][_0x13ff('0xe')]);}})['catch'](function(_0x210438){logger[_0x13ff('0xc')](_0x13ff('0x8'),_0x548fae,_0x210438);_0x3ec3d1(_0x210438);});});}exports['CreateVoiceAgentReport']=function(_0x30d955){var _0x3b7bda=this;return new Promise(function(_0x364b61,_0x385355){return db[_0x13ff('0x10')][_0x13ff('0x11')](_0x30d955[_0x13ff('0x12')],{'raw':_0x30d955['options']?_0x30d955[_0x13ff('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x13ff('0x7')](function(_0x5b1521){logger[_0x13ff('0xf')](_0x13ff('0x14'),_0x30d955);logger[_0x13ff('0xa')](_0x13ff('0x14'),_0x30d955,JSON[_0x13ff('0x15')](_0x5b1521));_0x364b61(_0x5b1521);})[_0x13ff('0x16')](function(_0x14700b){logger[_0x13ff('0xc')](_0x13ff('0x14'),_0x14700b[_0x13ff('0xe')],_0x30d955);_0x385355(_0x3b7bda[_0x13ff('0xc')](0x1f4,_0x14700b[_0x13ff('0xe')]));});});};exports['UpdateVoiceAgentReport']=function(_0x4549ac){var _0x4bb7b9=this;return new Promise(function(_0x177d2d,_0x4f7098){return db['VoiceAgentReport']['update'](_0x4549ac[_0x13ff('0x12')],{'raw':_0x4549ac['options']?_0x4549ac[_0x13ff('0x13')][_0x13ff('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4549ac[_0x13ff('0x13')]?_0x4549ac[_0x13ff('0x13')][_0x13ff('0x18')]||null:null,'attributes':_0x4549ac[_0x13ff('0x13')]?_0x4549ac[_0x13ff('0x13')][_0x13ff('0x19')]||null:null,'limit':_0x4549ac['options']?_0x4549ac[_0x13ff('0x13')][_0x13ff('0x1a')]||null:null})[_0x13ff('0x7')](function(_0x488148){logger[_0x13ff('0xf')](_0x13ff('0x1b'),_0x4549ac);logger[_0x13ff('0xa')]('UpdateVoiceAgentReport',_0x4549ac,JSON[_0x13ff('0x15')](_0x488148));_0x177d2d(_0x488148);})[_0x13ff('0x16')](function(_0xf76156){logger[_0x13ff('0xc')]('UpdateVoiceAgentReport',_0xf76156[_0x13ff('0xe')],_0x4549ac);_0x4f7098(_0x4bb7b9[_0x13ff('0xc')](0x1f4,_0xf76156['message']));});});}; \ No newline at end of file +var _0xc0f3=['body','options','raw','catch','UpdateVoiceAgentReport','VoiceAgentReport','update','where','attributes','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateVoiceAgentReport','create'];(function(_0x160182,_0x4cf21a){var _0x1c1e78=function(_0x248245){while(--_0x248245){_0x160182['push'](_0x160182['shift']());}};_0x1c1e78(++_0x4cf21a);}(_0xc0f3,0x154));var _0x3c0f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc0f3[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x3c0f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3c0f('0x1'));var rs=require(_0x3c0f('0x2'));var fs=require('fs');var Redis=require(_0x3c0f('0x3'));var db=require(_0x3c0f('0x4'))['db'];var utils=require(_0x3c0f('0x5'));var logger=require(_0x3c0f('0x6'))(_0x3c0f('0x7'));var config=require('../../config/environment');var jayson=require(_0x3c0f('0x8'));var client=jayson[_0x3c0f('0x9')][_0x3c0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12f1b0,_0x5833f5,_0x53d8b7){return new BPromise(function(_0x187fd7,_0x640c77){return client[_0x3c0f('0xb')](_0x12f1b0,_0x53d8b7)['then'](function(_0xccf8f3){logger[_0x3c0f('0xc')](_0x3c0f('0xd'),_0x5833f5,_0x3c0f('0xe'));logger[_0x3c0f('0xf')](_0x3c0f('0x10'),_0x5833f5,_0x3c0f('0xe'),JSON[_0x3c0f('0x11')](_0xccf8f3));if(_0xccf8f3['error']){if(_0xccf8f3[_0x3c0f('0x12')][_0x3c0f('0x13')]===0x1f4){logger[_0x3c0f('0x12')](_0x3c0f('0xd'),_0x5833f5,_0xccf8f3['error']['message']);return _0x640c77(_0xccf8f3[_0x3c0f('0x12')][_0x3c0f('0x14')]);}logger[_0x3c0f('0x12')](_0x3c0f('0xd'),_0x5833f5,_0xccf8f3['error']['message']);return _0x187fd7(_0xccf8f3[_0x3c0f('0x12')][_0x3c0f('0x14')]);}else{logger[_0x3c0f('0xc')](_0x3c0f('0xd'),_0x5833f5,_0x3c0f('0xe'));_0x187fd7(_0xccf8f3['result'][_0x3c0f('0x14')]);}})['catch'](function(_0x370bb3){logger[_0x3c0f('0x12')](_0x3c0f('0xd'),_0x5833f5,_0x370bb3);_0x640c77(_0x370bb3);});});}exports[_0x3c0f('0x15')]=function(_0x168ba1){var _0x393d0e=this;return new Promise(function(_0x43df05,_0x37d76e){return db['VoiceAgentReport'][_0x3c0f('0x16')](_0x168ba1[_0x3c0f('0x17')],{'raw':_0x168ba1[_0x3c0f('0x18')]?_0x168ba1[_0x3c0f('0x18')][_0x3c0f('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x162635){logger['info'](_0x3c0f('0x15'),_0x168ba1);logger['debug'](_0x3c0f('0x15'),_0x168ba1,JSON[_0x3c0f('0x11')](_0x162635));_0x43df05(_0x162635);})[_0x3c0f('0x1a')](function(_0x17df19){logger[_0x3c0f('0x12')](_0x3c0f('0x15'),_0x17df19[_0x3c0f('0x14')],_0x168ba1);_0x37d76e(_0x393d0e[_0x3c0f('0x12')](0x1f4,_0x17df19[_0x3c0f('0x14')]));});});};exports[_0x3c0f('0x1b')]=function(_0x57aec5){var _0x2e9077=this;return new Promise(function(_0x134d80,_0x42ed42){return db[_0x3c0f('0x1c')][_0x3c0f('0x1d')](_0x57aec5[_0x3c0f('0x17')],{'raw':_0x57aec5['options']?_0x57aec5['options'][_0x3c0f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57aec5['options']?_0x57aec5[_0x3c0f('0x18')][_0x3c0f('0x1e')]||null:null,'attributes':_0x57aec5[_0x3c0f('0x18')]?_0x57aec5[_0x3c0f('0x18')][_0x3c0f('0x1f')]||null:null,'limit':_0x57aec5[_0x3c0f('0x18')]?_0x57aec5[_0x3c0f('0x18')]['limit']||null:null})[_0x3c0f('0x20')](function(_0x2c3069){logger[_0x3c0f('0xc')](_0x3c0f('0x1b'),_0x57aec5);logger[_0x3c0f('0xf')](_0x3c0f('0x1b'),_0x57aec5,JSON[_0x3c0f('0x11')](_0x2c3069));_0x134d80(_0x2c3069);})[_0x3c0f('0x1a')](function(_0x5bb1b4){logger['error']('UpdateVoiceAgentReport',_0x5bb1b4['message'],_0x57aec5);_0x42ed42(_0x2e9077[_0x3c0f('0x12')](0x1f4,_0x5bb1b4[_0x3c0f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index a3b30c4..f6ec069 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 _0x5636=['isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get'];(function(_0x357aee,_0x4b5b69){var _0x43be8e=function(_0x205447){while(--_0x205447){_0x357aee['push'](_0x357aee['shift']());}};_0x43be8e(++_0x4b5b69);}(_0x5636,0x102));var _0x6563=function(_0x2d92ec,_0x530d3d){_0x2d92ec=_0x2d92ec-0x0;var _0x1608fc=_0x5636[_0x2d92ec];return _0x1608fc;};'use strict';var multer=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6563('0x2')]();var fs_extra=require(_0x6563('0x3'));var auth=require(_0x6563('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6563('0x5'));var controller=require(_0x6563('0x6'));router[_0x6563('0x7')]('/',auth[_0x6563('0x8')](),controller[_0x6563('0x9')]);router[_0x6563('0x7')](_0x6563('0xa'),auth[_0x6563('0x8')](),controller[_0x6563('0xb')]);router[_0x6563('0x7')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6563('0xe')]);router[_0x6563('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6563('0x10')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0x11')]);module[_0x6563('0x12')]=router; \ No newline at end of file +var _0x00bb=['express','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x532f7a,_0xd45f75){var _0x1c0939=function(_0x21a277){while(--_0x21a277){_0x532f7a['push'](_0x532f7a['shift']());}};_0x1c0939(++_0xd45f75);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x00bb[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var fs_extra=require(_0xb00b('0x4'));var auth=require(_0xb00b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb00b('0x6'));var controller=require(_0xb00b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb00b('0x8')](_0xb00b('0x9'),auth[_0xb00b('0xa')](),controller[_0xb00b('0xb')]);router[_0xb00b('0x8')](_0xb00b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb00b('0xd')]('/',auth[_0xb00b('0xa')](),controller[_0xb00b('0xe')]);router[_0xb00b('0xf')](_0xb00b('0xc'),auth['isAuthenticated'](),controller[_0xb00b('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb00b('0x11')]);module[_0xb00b('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index acc14d5..94fc1b0 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 _0xa8b1=['INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','dialer','TEXT','DATE'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa8b1,0x182));var _0x1a8b=function(_0x5b112f,_0x157f0a){_0x5b112f=_0x5b112f-0x0;var _0x1c31cc=_0xa8b1[_0x5b112f];return _0x1c31cc;};'use strict';var Sequelize=require(_0x1a8b('0x0'));module[_0x1a8b('0x1')]={'uniqueid':{'type':Sequelize[_0x1a8b('0x2')]},'type':{'type':Sequelize[_0x1a8b('0x3')](_0x1a8b('0x4'),_0x1a8b('0x5'),_0x1a8b('0x6'),'inbound-fax','outbound-fax',_0x1a8b('0x7'))},'tag':{'type':Sequelize[_0x1a8b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x1a8b('0x2')]},'destination':{'type':Sequelize[_0x1a8b('0x2')]},'destinationcontext':{'type':Sequelize[_0x1a8b('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1a8b('0x2')]},'destinationchannel':{'type':Sequelize[_0x1a8b('0x2')]},'lastapplication':{'type':Sequelize[_0x1a8b('0x2')]},'lastdata':{'type':Sequelize[_0x1a8b('0x8')]},'starttime':{'type':Sequelize[_0x1a8b('0x9')]},'systemanswertime':{'type':Sequelize[_0x1a8b('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x1a8b('0x9')]},'duration':{'type':Sequelize[_0x1a8b('0xa')]},'billableseconds':{'type':Sequelize[_0x1a8b('0xa')]},'mohtime':{'type':Sequelize[_0x1a8b('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x1a8b('0x2')]},'userfield':{'type':Sequelize[_0x1a8b('0x2')]},'userDisposition':{'type':Sequelize[_0x1a8b('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1a8b('0x2')]},'prefix':{'type':Sequelize[_0x1a8b('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x1a8b('0x2')]}}; \ No newline at end of file +var _0x2724=['internal','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','exports','ENUM'];(function(_0x1e8ae0,_0x1a8706){var _0x3139a3=function(_0x2c3c62){while(--_0x2c3c62){_0x1e8ae0['push'](_0x1e8ae0['shift']());}};_0x3139a3(++_0x1a8706);}(_0x2724,0xa8));var _0x4272=function(_0x703fc7,_0x21ad86){_0x703fc7=_0x703fc7-0x0;var _0x3f53a7=_0x2724[_0x703fc7];return _0x3f53a7;};'use strict';var Sequelize=require('sequelize');module[_0x4272('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4272('0x1')]('inbound',_0x4272('0x2'),'outbound',_0x4272('0x3'),_0x4272('0x4'),_0x4272('0x5'))},'tag':{'type':Sequelize[_0x4272('0x6')]},'accountcode':{'type':Sequelize[_0x4272('0x6')]},'source':{'type':Sequelize[_0x4272('0x6')]},'destination':{'type':Sequelize[_0x4272('0x6')]},'destinationcontext':{'type':Sequelize[_0x4272('0x6')]},'callerid':{'type':Sequelize[_0x4272('0x6')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x4272('0x6')]},'lastdata':{'type':Sequelize[_0x4272('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x4272('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x4272('0x9')]},'billableseconds':{'type':Sequelize[_0x4272('0x9')]},'mohtime':{'type':Sequelize[_0x4272('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4272('0x6')]},'amaflags':{'type':Sequelize[_0x4272('0x6')]},'userfield':{'type':Sequelize[_0x4272('0x6')]},'userDisposition':{'type':Sequelize[_0x4272('0x6')]},'userSecondDisposition':{'type':Sequelize[_0x4272('0x6')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4272('0x6')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x4272('0x9')]},'sipcallid':{'type':Sequelize[_0x4272('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index fbba508..e7a5681 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(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x2ef3,0xba));var _0x32ef=function(_0x44b955,_0xadd91a){_0x44b955=_0x44b955-0x0;var _0x522576=_0x2ef3[_0x44b955];return _0x522576;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index bce3a00..e5ec426 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 _0x53d1=['request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x5f0501,_0x19196e){var _0x3c2c45=function(_0x107fe6){while(--_0x107fe6){_0x5f0501['push'](_0x5f0501['shift']());}};_0x3c2c45(++_0x19196e);}(_0x53d1,0x174));var _0x153d=function(_0x1d1634,_0x24ad27){_0x1d1634=_0x1d1634-0x0;var _0x2db856=_0x53d1[_0x1d1634];return _0x2db856;};'use strict';var _=require(_0x153d('0x0'));var util=require(_0x153d('0x1'));var logger=require('../../config/logger')(_0x153d('0x2'));var moment=require(_0x153d('0x3'));var BPromise=require(_0x153d('0x4'));var rp=require(_0x153d('0x5'));var fs=require('fs');var path=require(_0x153d('0x6'));var rimraf=require('rimraf');var config=require(_0x153d('0x7'));var attributes=require(_0x153d('0x8'));module[_0x153d('0x9')]=function(_0x557bed,_0x417850){return _0x557bed[_0x153d('0xa')](_0x153d('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x153d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3281=['bluebird','path','./voiceCallReport.attributes','exports','define','lodash','../../config/logger','api','moment'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0x3281,0x15b));var _0x1328=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x3281[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x1328('0x0'));var util=require('util');var logger=require(_0x1328('0x1'))(_0x1328('0x2'));var moment=require(_0x1328('0x3'));var BPromise=require(_0x1328('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1328('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1328('0x6'));module[_0x1328('0x7')]=function(_0x44db8c,_0x35cf2c){return _0x44db8c[_0x1328('0x8')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 8eabd2f..dfd16e8 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 _0xf2b6=['VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','catch','CreateVoiceCallReport','create','info','UpdateVoiceCallReport','update','body','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','GetVoiceCallReport'];(function(_0x17e315,_0x361db6){var _0x3e7afb=function(_0x830a5f){while(--_0x830a5f){_0x17e315['push'](_0x17e315['shift']());}};_0x3e7afb(++_0x361db6);}(_0xf2b6,0x164));var _0x6f2b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf2b6[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x6f2b('0x0'));var moment=require('moment');var BPromise=require(_0x6f2b('0x1'));var rs=require(_0x6f2b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f2b('0x3'))['db'];var utils=require(_0x6f2b('0x4'));var logger=require(_0x6f2b('0x5'))('rpc');var config=require(_0x6f2b('0x6'));var jayson=require(_0x6f2b('0x7'));var client=jayson[_0x6f2b('0x8')][_0x6f2b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xabcd6a,_0x241885,_0x3aeceb){return new BPromise(function(_0x3e3677,_0x4175ca){return client['request'](_0xabcd6a,_0x3aeceb)[_0x6f2b('0xa')](function(_0x5bab9e){logger['info'](_0x6f2b('0xb'),_0x241885,_0x6f2b('0xc'));logger[_0x6f2b('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x241885,'request\x20sent',JSON[_0x6f2b('0xe')](_0x5bab9e));if(_0x5bab9e['error']){if(_0x5bab9e[_0x6f2b('0xf')]['code']===0x1f4){logger[_0x6f2b('0xf')](_0x6f2b('0xb'),_0x241885,_0x5bab9e[_0x6f2b('0xf')][_0x6f2b('0x10')]);return _0x4175ca(_0x5bab9e['error'][_0x6f2b('0x10')]);}logger[_0x6f2b('0xf')](_0x6f2b('0xb'),_0x241885,_0x5bab9e[_0x6f2b('0xf')][_0x6f2b('0x10')]);return _0x3e3677(_0x5bab9e[_0x6f2b('0xf')][_0x6f2b('0x10')]);}else{logger['info'](_0x6f2b('0xb'),_0x241885,_0x6f2b('0xc'));_0x3e3677(_0x5bab9e['result'][_0x6f2b('0x10')]);}})['catch'](function(_0x1c76b4){logger[_0x6f2b('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x241885,_0x1c76b4);_0x4175ca(_0x1c76b4);});});}exports[_0x6f2b('0x11')]=function(_0x536a32){var _0x52e3e6=this;return new Promise(function(_0x470003,_0x416a15){return db[_0x6f2b('0x12')][_0x6f2b('0x13')]({'raw':_0x536a32[_0x6f2b('0x14')]?_0x536a32['options'][_0x6f2b('0x15')]===undefined?!![]:![]:!![],'where':_0x536a32['options']?_0x536a32[_0x6f2b('0x14')]['where']||null:null,'attributes':_0x536a32['options']?_0x536a32[_0x6f2b('0x14')][_0x6f2b('0x16')]||null:null,'limit':_0x536a32[_0x6f2b('0x14')]?_0x536a32[_0x6f2b('0x14')][_0x6f2b('0x17')]||null:null,'include':_0x536a32[_0x6f2b('0x14')]?_0x536a32[_0x6f2b('0x14')][_0x6f2b('0x18')]?_[_0x6f2b('0x19')](_0x536a32[_0x6f2b('0x14')][_0x6f2b('0x18')],function(_0x24101d){return{'model':db[_0x24101d['model']],'as':_0x24101d['as'],'attributes':_0x24101d[_0x6f2b('0x16')],'include':_0x24101d[_0x6f2b('0x18')]?_[_0x6f2b('0x19')](_0x24101d[_0x6f2b('0x18')],function(_0x3fdc6d){return{'model':db[_0x3fdc6d['model']],'as':_0x3fdc6d['as'],'attributes':_0x3fdc6d['attributes'],'include':_0x3fdc6d[_0x6f2b('0x18')]?_[_0x6f2b('0x19')](_0x3fdc6d[_0x6f2b('0x18')],function(_0x210f82){return{'model':db[_0x210f82[_0x6f2b('0x1a')]],'as':_0x210f82['as'],'attributes':_0x210f82['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f2b('0xa')](function(_0x78f77c){logger['info'](_0x6f2b('0x11'),_0x536a32);logger[_0x6f2b('0xd')](_0x6f2b('0x11'),_0x536a32,JSON[_0x6f2b('0xe')](_0x78f77c));_0x470003(_0x78f77c);})[_0x6f2b('0x1b')](function(_0x352a4a){logger[_0x6f2b('0xf')]('GetVoiceCallReport',_0x352a4a[_0x6f2b('0x10')],_0x536a32);_0x416a15(_0x52e3e6[_0x6f2b('0xf')](0x1f4,_0x352a4a['message']));});});};exports[_0x6f2b('0x1c')]=function(_0x593031){var _0x3469a1=this;return new Promise(function(_0x1df324,_0x1a7a8c){return db[_0x6f2b('0x12')][_0x6f2b('0x1d')](_0x593031['body'],{'raw':_0x593031[_0x6f2b('0x14')]?_0x593031[_0x6f2b('0x14')][_0x6f2b('0x15')]===undefined?!![]:![]:!![]})[_0x6f2b('0xa')](function(_0x375187){logger[_0x6f2b('0x1e')](_0x6f2b('0x1c'),_0x593031);logger['debug'](_0x6f2b('0x1c'),_0x593031,JSON['stringify'](_0x375187));_0x1df324(_0x375187);})[_0x6f2b('0x1b')](function(_0x4c59b4){logger[_0x6f2b('0xf')](_0x6f2b('0x1c'),_0x4c59b4[_0x6f2b('0x10')],_0x593031);_0x1a7a8c(_0x3469a1['error'](0x1f4,_0x4c59b4['message']));});});};exports[_0x6f2b('0x1f')]=function(_0x105d63){var _0x428dfd=this;return new Promise(function(_0x59ef8c,_0x93e284){return db[_0x6f2b('0x12')][_0x6f2b('0x20')](_0x105d63[_0x6f2b('0x21')],{'raw':_0x105d63['options']?_0x105d63[_0x6f2b('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x105d63[_0x6f2b('0x14')]?_0x105d63[_0x6f2b('0x14')]['where']||null:null,'attributes':_0x105d63[_0x6f2b('0x14')]?_0x105d63[_0x6f2b('0x14')]['attributes']||null:null,'limit':_0x105d63[_0x6f2b('0x14')]?_0x105d63[_0x6f2b('0x14')][_0x6f2b('0x17')]||null:null})[_0x6f2b('0xa')](function(_0x534ee5){logger['info'](_0x6f2b('0x1f'),_0x105d63);logger[_0x6f2b('0xd')](_0x6f2b('0x1f'),_0x105d63,JSON[_0x6f2b('0xe')](_0x534ee5));_0x59ef8c(_0x534ee5);})[_0x6f2b('0x1b')](function(_0x51c0a2){logger[_0x6f2b('0xf')](_0x6f2b('0x1f'),_0x51c0a2[_0x6f2b('0x10')],_0x105d63);_0x93e284(_0x428dfd[_0x6f2b('0xf')](0x1f4,_0x51c0a2[_0x6f2b('0x10')]));});});}; \ No newline at end of file +var _0x9df8=['lodash','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','map','include','model','attributes','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','limit'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x9df8,0x8c));var _0x89df=function(_0x31699c,_0x32223a){_0x31699c=_0x31699c-0x0;var _0x2433db=_0x9df8[_0x31699c];return _0x2433db;};'use strict';var _=require(_0x89df('0x0'));var util=require(_0x89df('0x1'));var moment=require(_0x89df('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89df('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x89df('0x4'))(_0x89df('0x5'));var config=require('../../config/environment');var jayson=require(_0x89df('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a6472,_0x26d76b,_0x459821){return new BPromise(function(_0x5f5a00,_0x14b26d){return client['request'](_0x4a6472,_0x459821)[_0x89df('0x7')](function(_0x48c71d){logger[_0x89df('0x8')]('VoiceCallReport,\x20%s,\x20%s',_0x26d76b,_0x89df('0x9'));logger[_0x89df('0xa')](_0x89df('0xb'),_0x26d76b,_0x89df('0x9'),JSON[_0x89df('0xc')](_0x48c71d));if(_0x48c71d[_0x89df('0xd')]){if(_0x48c71d[_0x89df('0xd')][_0x89df('0xe')]===0x1f4){logger[_0x89df('0xd')](_0x89df('0xf'),_0x26d76b,_0x48c71d[_0x89df('0xd')][_0x89df('0x10')]);return _0x14b26d(_0x48c71d[_0x89df('0xd')]['message']);}logger['error'](_0x89df('0xf'),_0x26d76b,_0x48c71d[_0x89df('0xd')][_0x89df('0x10')]);return _0x5f5a00(_0x48c71d[_0x89df('0xd')][_0x89df('0x10')]);}else{logger[_0x89df('0x8')](_0x89df('0xf'),_0x26d76b,_0x89df('0x9'));_0x5f5a00(_0x48c71d[_0x89df('0x11')][_0x89df('0x10')]);}})[_0x89df('0x12')](function(_0x2573c1){logger['error'](_0x89df('0xf'),_0x26d76b,_0x2573c1);_0x14b26d(_0x2573c1);});});}exports[_0x89df('0x13')]=function(_0x5c1b16){var _0x718ac5=this;return new Promise(function(_0xfa53e2,_0x838d49){return db[_0x89df('0x14')][_0x89df('0x15')]({'raw':_0x5c1b16[_0x89df('0x16')]?_0x5c1b16[_0x89df('0x16')][_0x89df('0x17')]===undefined?!![]:![]:!![],'where':_0x5c1b16['options']?_0x5c1b16[_0x89df('0x16')]['where']||null:null,'attributes':_0x5c1b16[_0x89df('0x16')]?_0x5c1b16['options']['attributes']||null:null,'limit':_0x5c1b16['options']?_0x5c1b16[_0x89df('0x16')]['limit']||null:null,'include':_0x5c1b16['options']?_0x5c1b16[_0x89df('0x16')]['include']?_[_0x89df('0x18')](_0x5c1b16[_0x89df('0x16')][_0x89df('0x19')],function(_0x55a1){return{'model':db[_0x55a1[_0x89df('0x1a')]],'as':_0x55a1['as'],'attributes':_0x55a1[_0x89df('0x1b')],'include':_0x55a1[_0x89df('0x19')]?_['map'](_0x55a1[_0x89df('0x19')],function(_0x4062f5){return{'model':db[_0x4062f5[_0x89df('0x1a')]],'as':_0x4062f5['as'],'attributes':_0x4062f5['attributes'],'include':_0x4062f5[_0x89df('0x19')]?_[_0x89df('0x18')](_0x4062f5[_0x89df('0x19')],function(_0x256b1b){return{'model':db[_0x256b1b['model']],'as':_0x256b1b['as'],'attributes':_0x256b1b[_0x89df('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x89df('0x7')](function(_0x3f0958){logger[_0x89df('0x8')](_0x89df('0x13'),_0x5c1b16);logger[_0x89df('0xa')](_0x89df('0x13'),_0x5c1b16,JSON[_0x89df('0xc')](_0x3f0958));_0xfa53e2(_0x3f0958);})[_0x89df('0x12')](function(_0x4efafb){logger[_0x89df('0xd')](_0x89df('0x13'),_0x4efafb[_0x89df('0x10')],_0x5c1b16);_0x838d49(_0x718ac5[_0x89df('0xd')](0x1f4,_0x4efafb[_0x89df('0x10')]));});});};exports[_0x89df('0x1c')]=function(_0x2fe651){var _0x5b5453=this;return new Promise(function(_0x4f8d9b,_0x378bfe){return db[_0x89df('0x14')][_0x89df('0x1d')](_0x2fe651[_0x89df('0x1e')],{'raw':_0x2fe651[_0x89df('0x16')]?_0x2fe651[_0x89df('0x16')][_0x89df('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5e3c5b){logger[_0x89df('0x8')]('CreateVoiceCallReport',_0x2fe651);logger[_0x89df('0xa')](_0x89df('0x1c'),_0x2fe651,JSON['stringify'](_0x5e3c5b));_0x4f8d9b(_0x5e3c5b);})[_0x89df('0x12')](function(_0x4777ff){logger['error']('CreateVoiceCallReport',_0x4777ff[_0x89df('0x10')],_0x2fe651);_0x378bfe(_0x5b5453[_0x89df('0xd')](0x1f4,_0x4777ff[_0x89df('0x10')]));});});};exports[_0x89df('0x1f')]=function(_0x2ba71b){var _0x193aa9=this;return new Promise(function(_0x31ac19,_0x2dbcc7){return db[_0x89df('0x14')][_0x89df('0x20')](_0x2ba71b[_0x89df('0x1e')],{'raw':_0x2ba71b[_0x89df('0x16')]?_0x2ba71b['options'][_0x89df('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ba71b['options']?_0x2ba71b[_0x89df('0x16')][_0x89df('0x21')]||null:null,'attributes':_0x2ba71b['options']?_0x2ba71b[_0x89df('0x16')][_0x89df('0x1b')]||null:null,'limit':_0x2ba71b['options']?_0x2ba71b[_0x89df('0x16')][_0x89df('0x22')]||null:null})['then'](function(_0x1627f7){logger[_0x89df('0x8')](_0x89df('0x1f'),_0x2ba71b);logger[_0x89df('0xa')](_0x89df('0x1f'),_0x2ba71b,JSON[_0x89df('0xc')](_0x1627f7));_0x31ac19(_0x1627f7);})[_0x89df('0x12')](function(_0x26a1a3){logger['error']('UpdateVoiceCallReport',_0x26a1a3['message'],_0x2ba71b);_0x2dbcc7(_0x193aa9['error'](0x1f4,_0x26a1a3[_0x89df('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 0c55bb8..63f8604 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 _0xba1e=['create','put','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','post'];(function(_0x5f259d,_0x188619){var _0x398d66=function(_0x1401ad){while(--_0x1401ad){_0x5f259d['push'](_0x5f259d['shift']());}};_0x398d66(++_0x188619);}(_0xba1e,0x1c5));var _0xeba1=function(_0x44dd97,_0x5c129f){_0x44dd97=_0x44dd97-0x0;var _0x49c6bd=_0xba1e[_0x44dd97];return _0x49c6bd;};'use strict';var multer=require(_0xeba1('0x0'));var util=require('util');var path=require(_0xeba1('0x1'));var timeout=require(_0xeba1('0x2'));var express=require(_0xeba1('0x3'));var router=express[_0xeba1('0x4')]();var fs_extra=require(_0xeba1('0x5'));var auth=require(_0xeba1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0xeba1('0x7')]('/',auth[_0xeba1('0x8')](),controller[_0xeba1('0x9')]);router[_0xeba1('0x7')](_0xeba1('0xa'),auth[_0xeba1('0x8')](),controller['show']);router[_0xeba1('0xb')]('/',auth[_0xeba1('0x8')](),controller[_0xeba1('0xc')]);router[_0xeba1('0xd')](_0xeba1('0xa'),auth[_0xeba1('0x8')](),controller['update']);router['delete'](_0xeba1('0xa'),auth[_0xeba1('0x8')](),controller[_0xeba1('0xe')]);module['exports']=router; \ No newline at end of file +var _0xe4a0=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show','create','/:id','update'];(function(_0x12917c,_0x41b371){var _0x59b248=function(_0x2b552a){while(--_0x2b552a){_0x12917c['push'](_0x12917c['shift']());}};_0x59b248(++_0x41b371);}(_0xe4a0,0x10d));var _0x0e4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe4a0[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x0e4a('0x0'));var util=require(_0x0e4a('0x1'));var path=require(_0x0e4a('0x2'));var timeout=require(_0x0e4a('0x3'));var express=require(_0x0e4a('0x4'));var router=express[_0x0e4a('0x5')]();var fs_extra=require(_0x0e4a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e4a('0x7'));var controller=require(_0x0e4a('0x8'));router[_0x0e4a('0x9')]('/',auth[_0x0e4a('0xa')](),controller[_0x0e4a('0xb')]);router['get']('/:id',auth[_0x0e4a('0xa')](),controller[_0x0e4a('0xc')]);router['post']('/',auth[_0x0e4a('0xa')](),controller[_0x0e4a('0xd')]);router['put'](_0x0e4a('0xe'),auth['isAuthenticated'](),controller[_0x0e4a('0xf')]);router[_0x0e4a('0x10')](_0x0e4a('0xe'),auth[_0x0e4a('0xa')](),controller[_0x0e4a('0x11')]);module[_0x0e4a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 1961941..35e67ff 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 _0x9802=['options','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','getDataValue'];(function(_0x326e79,_0x33dc91){var _0x37eb89=function(_0xbaef25){while(--_0xbaef25){_0x326e79['push'](_0x326e79['shift']());}};_0x37eb89(++_0x33dc91);}(_0x9802,0x135));var _0x2980=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9802[_0x3d42d8];return _0x27fc41;};'use strict';var Sequelize=require(_0x2980('0x0'));module[_0x2980('0x1')]={'name':{'type':Sequelize[_0x2980('0x2')]},'prefix':{'type':Sequelize[_0x2980('0x2')],'unique':_0x2980('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x2980('0x2')],'set':function(_0x27a9b5){this[_0x2980('0x4')]('options',_0x27a9b5?_0x27a9b5['join'](''):[]);},'get':function(){return this[_0x2980('0x5')](_0x2980('0x6'))?this[_0x2980('0x5')](_0x2980('0x6'))[_0x2980('0x7')](''):[];}},'auth':{'type':Sequelize[_0x2980('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x2980('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2980('0x2')]},'description':{'type':Sequelize[_0x2980('0x2')]}}; \ No newline at end of file +var _0xbd9b=['setDataValue','options','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xbd9b,0xe6));var _0xbbd9=function(_0xa22aeb,_0x5864d0){_0xa22aeb=_0xa22aeb-0x0;var _0x361646=_0xbd9b[_0xa22aeb];return _0x361646;};'use strict';var Sequelize=require(_0xbbd9('0x0'));module[_0xbbd9('0x1')]={'name':{'type':Sequelize[_0xbbd9('0x2')]},'prefix':{'type':Sequelize[_0xbbd9('0x2')],'unique':_0xbbd9('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xbbd9('0x2')],'set':function(_0x3bbbf6){this[_0xbbd9('0x4')]('options',_0x3bbbf6?_0x3bbbf6['join'](''):[]);},'get':function(){return this['getDataValue'](_0xbbd9('0x5'))?this[_0xbbd9('0x6')](_0xbbd9('0x5'))[_0xbbd9('0x7')](''):[];}},'auth':{'type':Sequelize[_0xbbd9('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xbbd9('0x2')]},'record':{'type':Sequelize[_0xbbd9('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xbbd9('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 3478a32..0d19645 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 _0x54ef=['pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','map','VoiceChanSpy','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x2a97f7,_0x465e0c){var _0x13c258=function(_0x1b043d){while(--_0x1b043d){_0x2a97f7['push'](_0x2a97f7['shift']());}};_0x13c258(++_0x465e0c);}(_0x54ef,0x112));var _0xf54e=function(_0x2ba60d,_0x19dd33){_0x2ba60d=_0x2ba60d-0x0;var _0x5e3123=_0x54ef[_0x2ba60d];return _0x5e3123;};'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(){var _0x474b61=_0x264a8f[_0xf54e('0x28')]({'plain':!![]});var _0x160160=_0xf54e('0x29');return db[_0xf54e('0x2a')][_0xf54e('0x27')]({'where':{'type':_0x160160,'resourceId':_0x474b61['id']}})[_0xf54e('0x26')](function(){return _0x264a8f;});})[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x5390b8,_0xb3706e){return function(_0x4cbf7c){if(!_0x4cbf7c){_0x5390b8[_0xf54e('0x19')](0x194);}return _0x4cbf7c;};}function handleError(_0x5e63f4,_0x15b888){_0x15b888=_0x15b888||0x1f4;return function(_0x269f47){logger[_0xf54e('0x2b')](_0x269f47[_0xf54e('0x2c')]);if(_0x269f47[_0xf54e('0x2d')]){delete _0x269f47[_0xf54e('0x2d')];}_0x5e63f4[_0xf54e('0x1a')](_0x15b888)['send'](_0x269f47);};}exports['index']=function(_0x2f96b1,_0x258d29){var _0x2ec92e={},_0x16d00f={},_0xb2d4c4={'count':0x0,'rows':[]};var _0x133cd7=_[_0xf54e('0x2e')](db[_0xf54e('0x2f')][_0xf54e('0x30')],function(_0x12edc3){return{'name':_0x12edc3['fieldName'],'type':_0x12edc3['type'][_0xf54e('0x31')]};});_0x16d00f[_0xf54e('0x32')]=_['map'](_0x133cd7,_0xf54e('0x2d'));_0x16d00f[_0xf54e('0x33')]=_[_0xf54e('0x34')](_0x2f96b1[_0xf54e('0x33')]);_0x16d00f['filters']=_['intersection'](_0x16d00f['model'],_0x16d00f[_0xf54e('0x33')]);_0x2ec92e[_0xf54e('0x35')]=_[_0xf54e('0x36')](_0x16d00f[_0xf54e('0x32')],qs[_0xf54e('0x37')](_0x2f96b1[_0xf54e('0x33')]['fields']));_0x2ec92e['attributes']=_0x2ec92e['attributes'][_0xf54e('0x38')]?_0x2ec92e[_0xf54e('0x35')]:_0x16d00f['model'];if(!_0x2f96b1['query'][_0xf54e('0x39')](_0xf54e('0x3a'))){_0x2ec92e[_0xf54e('0x1d')]=qs['limit'](_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x1d')]);_0x2ec92e['offset']=qs[_0xf54e('0x20')](_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x20')]);}_0x2ec92e[_0xf54e('0x3b')]=qs[_0xf54e('0x3c')](_0x2f96b1[_0xf54e('0x33')]['sort']);_0x2ec92e['where']=qs[_0xf54e('0x3d')](_[_0xf54e('0x3e')](_0x2f96b1[_0xf54e('0x33')],_0x16d00f['filters']),_0x133cd7);if(_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x3f')]){_0x2ec92e[_0xf54e('0x40')]=_[_0xf54e('0x41')](_0x2ec92e[_0xf54e('0x40')],{'$or':_[_0xf54e('0x2e')](_0x133cd7,function(_0x17c7ec){if(_0x17c7ec[_0xf54e('0x42')]!==_0xf54e('0x43')){var _0x2087b3={};_0x2087b3[_0x17c7ec[_0xf54e('0x2d')]]={'$like':'%'+_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x3f')]+'%'};return _0x2087b3;}})});}_0x2ec92e=_[_0xf54e('0x41')]({},_0x2ec92e,_0x2f96b1[_0xf54e('0x44')]);var _0x5085c1={'where':_0x2ec92e['where']};return db['VoiceChanSpy'][_0xf54e('0x1f')](_0x5085c1)[_0xf54e('0x26')](function(_0x5398b2){_0xb2d4c4[_0xf54e('0x1f')]=_0x5398b2;if(_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x45')]){_0x2ec92e['include']=[{'all':!![]}];}return db[_0xf54e('0x2f')][_0xf54e('0x46')](_0x2ec92e);})[_0xf54e('0x26')](function(_0x794be7){_0xb2d4c4[_0xf54e('0x47')]=_0x794be7;return _0xb2d4c4;})[_0xf54e('0x26')](respondWithFilteredResult(_0x258d29,_0x2ec92e))[_0xf54e('0x48')](handleError(_0x258d29,null));};exports[_0xf54e('0x49')]=function(_0x5b4ea1,_0x47bedd){var _0x11c736={'raw':![],'where':{'id':_0x5b4ea1[_0xf54e('0x4a')]['id']}},_0x3447fd={};_0x3447fd[_0xf54e('0x32')]=_[_0xf54e('0x34')](db[_0xf54e('0x2f')]['rawAttributes']);_0x3447fd[_0xf54e('0x33')]=_['keys'](_0x5b4ea1[_0xf54e('0x33')]);_0x3447fd['filters']=_[_0xf54e('0x36')](_0x3447fd[_0xf54e('0x32')],_0x3447fd[_0xf54e('0x33')]);_0x11c736['attributes']=_[_0xf54e('0x36')](_0x3447fd[_0xf54e('0x32')],qs[_0xf54e('0x37')](_0x5b4ea1[_0xf54e('0x33')][_0xf54e('0x37')]));_0x11c736['attributes']=_0x11c736[_0xf54e('0x35')][_0xf54e('0x38')]?_0x11c736[_0xf54e('0x35')]:_0x3447fd[_0xf54e('0x32')];if(_0x5b4ea1['query'][_0xf54e('0x45')]){_0x11c736[_0xf54e('0x4b')]=[{'all':!![]}];}_0x11c736=_['merge']({},_0x11c736,_0x5b4ea1[_0xf54e('0x44')]);return db[_0xf54e('0x2f')][_0xf54e('0x4c')](_0x11c736)[_0xf54e('0x26')](handleEntityNotFound(_0x47bedd,null))['then'](respondWithResult(_0x47bedd,null))[_0xf54e('0x48')](handleError(_0x47bedd,null));};exports[_0xf54e('0x4d')]=function(_0x2527f6,_0xb4654f){return db[_0xf54e('0x2f')][_0xf54e('0x4d')](_0x2527f6[_0xf54e('0x4e')],{})[_0xf54e('0x26')](function(_0x15bfef){var _0x21f2f8=_0x2527f6[_0xf54e('0x4f')][_0xf54e('0x28')]({'plain':!![]});if(!_0x21f2f8)throw new Error(_0xf54e('0x50'));if(_0x21f2f8[_0xf54e('0x51')]===_0xf54e('0x4f')){var _0xa6c305=_0x15bfef[_0xf54e('0x28')]({'plain':!![]});var _0xe9338b=_0xf54e('0x29');return db[_0xf54e('0x52')]['find']({'where':{'name':_0xe9338b,'userProfileId':_0x21f2f8['userProfileId']},'raw':!![]})[_0xf54e('0x26')](function(_0x1106bb){if(_0x1106bb&&_0x1106bb[_0xf54e('0x53')]===0x0){return db[_0xf54e('0x2a')][_0xf54e('0x4d')]({'name':_0xa6c305[_0xf54e('0x2d')],'resourceId':_0xa6c305['id'],'type':_0x1106bb[_0xf54e('0x2d')],'sectionId':_0x1106bb['id']},{})[_0xf54e('0x26')](function(){return _0x15bfef;});}else{return _0x15bfef;}})[_0xf54e('0x48')](function(_0xdf63c4){logger[_0xf54e('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdf63c4);throw _0xdf63c4;});}return _0x15bfef;})[_0xf54e('0x26')](respondWithResult(_0xb4654f,0xc9))[_0xf54e('0x48')](handleError(_0xb4654f,null));};exports[_0xf54e('0x25')]=function(_0x37e4f8,_0x1b8f16){if(_0x37e4f8[_0xf54e('0x4e')]['id']){delete _0x37e4f8[_0xf54e('0x4e')]['id'];}return db['VoiceChanSpy'][_0xf54e('0x4c')]({'where':{'id':_0x37e4f8[_0xf54e('0x4a')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0x1b8f16,null))['then'](saveUpdates(_0x37e4f8[_0xf54e('0x4e')],null))['then'](respondWithResult(_0x1b8f16,null))[_0xf54e('0x48')](handleError(_0x1b8f16,null));};exports[_0xf54e('0x27')]=function(_0x3e2fd1,_0x5b882f){return db[_0xf54e('0x2f')][_0xf54e('0x4c')]({'where':{'id':_0x3e2fd1[_0xf54e('0x4a')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0x5b882f,null))[_0xf54e('0x26')](removeEntity(_0x5b882f,null))[_0xf54e('0x48')](handleError(_0x5b882f,null));}; \ No newline at end of file +var _0xeea4=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','UserProfileResource','then','error','stack','send','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','findAll','rows','catch','show','params','VoiceChanSpy','intersection','find','create','body','get','role','user','ChanSpies','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv'];(function(_0x51a21d,_0x589104){var _0x29c6f3=function(_0x4f85ed){while(--_0x4f85ed){_0x51a21d['push'](_0x51a21d['shift']());}};_0x29c6f3(++_0x589104);}(_0xeea4,0x19e));var _0x4eea=function(_0x4eed02,_0x4f77a5){_0x4eed02=_0x4eed02-0x0;var _0x13d992=_0xeea4[_0x4eed02];return _0x13d992;};'use strict';var emlformat=require(_0x4eea('0x0'));var rimraf=require(_0x4eea('0x1'));var zipdir=require(_0x4eea('0x2'));var jsonpatch=require(_0x4eea('0x3'));var rp=require(_0x4eea('0x4'));var moment=require(_0x4eea('0x5'));var BPromise=require(_0x4eea('0x6'));var Mustache=require(_0x4eea('0x7'));var util=require(_0x4eea('0x8'));var path=require('path');var sox=require(_0x4eea('0x9'));var csv=require('to-csv');var ejs=require(_0x4eea('0xa'));var fs=require('fs');var fs_extra=require(_0x4eea('0xb'));var _=require(_0x4eea('0xc'));var squel=require('squel');var crypto=require(_0x4eea('0xd'));var jsforce=require(_0x4eea('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4eea('0xf'));var querystring=require(_0x4eea('0x10'));var Papa=require(_0x4eea('0x11'));var Redis=require(_0x4eea('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4eea('0x13'));var as=require(_0x4eea('0x14'));var hardwareService=require(_0x4eea('0x15'));var logger=require(_0x4eea('0x16'))(_0x4eea('0x17'));var utils=require(_0x4eea('0x18'));var config=require(_0x4eea('0x19'));var licenseUtil=require(_0x4eea('0x1a'));var db=require(_0x4eea('0x1b'))['db'];function respondWithStatusCode(_0x130507,_0x47b971){_0x47b971=_0x47b971||0xcc;return function(_0x54fa8c){if(_0x54fa8c){return _0x130507[_0x4eea('0x1c')](_0x47b971);}return _0x130507[_0x4eea('0x1d')](_0x47b971)[_0x4eea('0x1e')]();};}function respondWithResult(_0x238405,_0x3327e0){_0x3327e0=_0x3327e0||0xc8;return function(_0x328275){if(_0x328275){return _0x238405[_0x4eea('0x1d')](_0x3327e0)[_0x4eea('0x1f')](_0x328275);}};}function respondWithFilteredResult(_0x5828e0,_0x1654c0){return function(_0x34ce09){if(_0x34ce09){var _0x150d60=typeof _0x1654c0[_0x4eea('0x20')]==='undefined'&&typeof _0x1654c0[_0x4eea('0x21')]===_0x4eea('0x22');var _0x3fbe8b=_0x34ce09[_0x4eea('0x23')];var _0x27a227=_0x150d60?0x0:_0x1654c0['offset'];var _0x1571f3=_0x150d60?_0x34ce09[_0x4eea('0x23')]:_0x1654c0['offset']+_0x1654c0[_0x4eea('0x21')];var _0x325185;if(_0x1571f3>=_0x3fbe8b){_0x1571f3=_0x3fbe8b;_0x325185=0xc8;}else{_0x325185=0xce;}_0x5828e0[_0x4eea('0x1d')](_0x325185);return _0x5828e0[_0x4eea('0x24')](_0x4eea('0x25'),_0x27a227+'-'+_0x1571f3+'/'+_0x3fbe8b)[_0x4eea('0x1f')](_0x34ce09);}return null;};}function patchUpdates(_0x56fefc){return function(_0xf054a7){try{jsonpatch[_0x4eea('0x26')](_0xf054a7,_0x56fefc,!![]);}catch(_0x24f371){return BPromise[_0x4eea('0x27')](_0x24f371);}return _0xf054a7[_0x4eea('0x28')]();};}function saveUpdates(_0x496ab6,_0x4898e8){return function(_0x3b7513){if(_0x3b7513){return _0x3b7513['update'](_0x496ab6)['then'](function(_0x5a2722){return _0x5a2722;});}return null;};}function removeEntity(_0x37f024,_0x3be3f3){return function(_0x505e50){if(_0x505e50){return _0x505e50[_0x4eea('0x29')]()['then'](function(){var _0x3f0a2c=_0x505e50['get']({'plain':!![]});var _0x111e65='ChanSpies';return db[_0x4eea('0x2a')][_0x4eea('0x29')]({'where':{'type':_0x111e65,'resourceId':_0x3f0a2c['id']}})[_0x4eea('0x2b')](function(){return _0x505e50;});})[_0x4eea('0x2b')](function(){_0x37f024[_0x4eea('0x1d')](0xcc)[_0x4eea('0x1e')]();});}};}function handleEntityNotFound(_0x16f6ac,_0x22939b){return function(_0x368688){if(!_0x368688){_0x16f6ac[_0x4eea('0x1c')](0x194);}return _0x368688;};}function handleError(_0x117079,_0x5ecb81){_0x5ecb81=_0x5ecb81||0x1f4;return function(_0x58c0df){logger[_0x4eea('0x2c')](_0x58c0df[_0x4eea('0x2d')]);if(_0x58c0df['name']){delete _0x58c0df['name'];}_0x117079['status'](_0x5ecb81)[_0x4eea('0x2e')](_0x58c0df);};}exports['index']=function(_0x31d9be,_0x299cf7){var _0x247d4b={},_0x4dd13b={},_0x34277b={'count':0x0,'rows':[]};var _0x14721f=_[_0x4eea('0x2f')](db['VoiceChanSpy'][_0x4eea('0x30')],function(_0x27c2ee){return{'name':_0x27c2ee[_0x4eea('0x31')],'type':_0x27c2ee['type']['key']};});_0x4dd13b[_0x4eea('0x32')]=_[_0x4eea('0x2f')](_0x14721f,'name');_0x4dd13b[_0x4eea('0x33')]=_[_0x4eea('0x34')](_0x31d9be[_0x4eea('0x33')]);_0x4dd13b[_0x4eea('0x35')]=_['intersection'](_0x4dd13b[_0x4eea('0x32')],_0x4dd13b['query']);_0x247d4b[_0x4eea('0x36')]=_['intersection'](_0x4dd13b[_0x4eea('0x32')],qs[_0x4eea('0x37')](_0x31d9be['query'][_0x4eea('0x37')]));_0x247d4b['attributes']=_0x247d4b[_0x4eea('0x36')][_0x4eea('0x38')]?_0x247d4b['attributes']:_0x4dd13b[_0x4eea('0x32')];if(!_0x31d9be[_0x4eea('0x33')][_0x4eea('0x39')]('nolimit')){_0x247d4b[_0x4eea('0x21')]=qs['limit'](_0x31d9be['query'][_0x4eea('0x21')]);_0x247d4b[_0x4eea('0x20')]=qs[_0x4eea('0x20')](_0x31d9be['query']['offset']);}_0x247d4b[_0x4eea('0x3a')]=qs[_0x4eea('0x3b')](_0x31d9be[_0x4eea('0x33')][_0x4eea('0x3b')]);_0x247d4b[_0x4eea('0x3c')]=qs['filters'](_[_0x4eea('0x3d')](_0x31d9be[_0x4eea('0x33')],_0x4dd13b[_0x4eea('0x35')]),_0x14721f);if(_0x31d9be[_0x4eea('0x33')][_0x4eea('0x3e')]){_0x247d4b[_0x4eea('0x3c')]=_[_0x4eea('0x3f')](_0x247d4b[_0x4eea('0x3c')],{'$or':_[_0x4eea('0x2f')](_0x14721f,function(_0x1acecf){if(_0x1acecf['type']!==_0x4eea('0x40')){var _0x368796={};_0x368796[_0x1acecf[_0x4eea('0x41')]]={'$like':'%'+_0x31d9be[_0x4eea('0x33')]['filter']+'%'};return _0x368796;}})});}_0x247d4b=_['merge']({},_0x247d4b,_0x31d9be[_0x4eea('0x42')]);var _0x560101={'where':_0x247d4b[_0x4eea('0x3c')]};return db['VoiceChanSpy'][_0x4eea('0x23')](_0x560101)[_0x4eea('0x2b')](function(_0x2eb27e){_0x34277b[_0x4eea('0x23')]=_0x2eb27e;if(_0x31d9be[_0x4eea('0x33')][_0x4eea('0x43')]){_0x247d4b['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x4eea('0x44')](_0x247d4b);})[_0x4eea('0x2b')](function(_0x835ff3){_0x34277b[_0x4eea('0x45')]=_0x835ff3;return _0x34277b;})[_0x4eea('0x2b')](respondWithFilteredResult(_0x299cf7,_0x247d4b))[_0x4eea('0x46')](handleError(_0x299cf7,null));};exports[_0x4eea('0x47')]=function(_0x36299f,_0xcf7466){var _0xf50514={'raw':![],'where':{'id':_0x36299f[_0x4eea('0x48')]['id']}},_0x99e57={};_0x99e57[_0x4eea('0x32')]=_['keys'](db[_0x4eea('0x49')][_0x4eea('0x30')]);_0x99e57[_0x4eea('0x33')]=_[_0x4eea('0x34')](_0x36299f[_0x4eea('0x33')]);_0x99e57[_0x4eea('0x35')]=_[_0x4eea('0x4a')](_0x99e57[_0x4eea('0x32')],_0x99e57[_0x4eea('0x33')]);_0xf50514[_0x4eea('0x36')]=_['intersection'](_0x99e57['model'],qs[_0x4eea('0x37')](_0x36299f[_0x4eea('0x33')]['fields']));_0xf50514[_0x4eea('0x36')]=_0xf50514[_0x4eea('0x36')][_0x4eea('0x38')]?_0xf50514[_0x4eea('0x36')]:_0x99e57['model'];if(_0x36299f[_0x4eea('0x33')][_0x4eea('0x43')]){_0xf50514['include']=[{'all':!![]}];}_0xf50514=_['merge']({},_0xf50514,_0x36299f[_0x4eea('0x42')]);return db[_0x4eea('0x49')][_0x4eea('0x4b')](_0xf50514)['then'](handleEntityNotFound(_0xcf7466,null))['then'](respondWithResult(_0xcf7466,null))[_0x4eea('0x46')](handleError(_0xcf7466,null));};exports[_0x4eea('0x4c')]=function(_0xf9473c,_0x49b789){return db[_0x4eea('0x49')][_0x4eea('0x4c')](_0xf9473c[_0x4eea('0x4d')],{})['then'](function(_0x173863){var _0x3cef45=_0xf9473c['user'][_0x4eea('0x4e')]({'plain':!![]});if(!_0x3cef45)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3cef45[_0x4eea('0x4f')]===_0x4eea('0x50')){var _0x771590=_0x173863[_0x4eea('0x4e')]({'plain':!![]});var _0x4f2a6f=_0x4eea('0x51');return db[_0x4eea('0x52')][_0x4eea('0x4b')]({'where':{'name':_0x4f2a6f,'userProfileId':_0x3cef45[_0x4eea('0x53')]},'raw':!![]})[_0x4eea('0x2b')](function(_0x2a4030){if(_0x2a4030&&_0x2a4030['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x771590[_0x4eea('0x41')],'resourceId':_0x771590['id'],'type':_0x2a4030[_0x4eea('0x41')],'sectionId':_0x2a4030['id']},{})[_0x4eea('0x2b')](function(){return _0x173863;});}else{return _0x173863;}})[_0x4eea('0x46')](function(_0x47ab65){logger['error'](_0x4eea('0x54'),_0x47ab65);throw _0x47ab65;});}return _0x173863;})[_0x4eea('0x2b')](respondWithResult(_0x49b789,0xc9))[_0x4eea('0x46')](handleError(_0x49b789,null));};exports[_0x4eea('0x55')]=function(_0x1efaad,_0x2c014f){if(_0x1efaad[_0x4eea('0x4d')]['id']){delete _0x1efaad[_0x4eea('0x4d')]['id'];}return db[_0x4eea('0x49')][_0x4eea('0x4b')]({'where':{'id':_0x1efaad[_0x4eea('0x48')]['id']}})[_0x4eea('0x2b')](handleEntityNotFound(_0x2c014f,null))[_0x4eea('0x2b')](saveUpdates(_0x1efaad[_0x4eea('0x4d')],null))[_0x4eea('0x2b')](respondWithResult(_0x2c014f,null))[_0x4eea('0x46')](handleError(_0x2c014f,null));};exports[_0x4eea('0x29')]=function(_0x1fac45,_0x4d0f21){return db[_0x4eea('0x49')][_0x4eea('0x4b')]({'where':{'id':_0x1fac45['params']['id']}})[_0x4eea('0x2b')](handleEntityNotFound(_0x4d0f21,null))[_0x4eea('0x2b')](removeEntity(_0x4d0f21,null))[_0x4eea('0x46')](handleError(_0x4d0f21,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 67c9fd8..c5901ad 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 _0x7cdf=['internal','then','exports','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','catch','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','system','push','Set','chanspy','record','merge','MixMonitor','auth','Authenticate','password','ChanSpy','name','options','join','length','concat','findAll'];(function(_0x1a732b,_0x4c52ce){var _0xcfdf0d=function(_0x42d329){while(--_0x42d329){_0x1a732b['push'](_0x1a732b['shift']());}};_0xcfdf0d(++_0x4c52ce);}(_0x7cdf,0x123));var _0xf7cd=function(_0x290863,_0x5369bf){_0x290863=_0x290863-0x0;var _0x134241=_0x7cdf[_0x290863];return _0x134241;};'use strict';var _=require(_0xf7cd('0x0'));var util=require(_0xf7cd('0x1'));var BPromise=require(_0xf7cd('0x2'));var attributes=require(_0xf7cd('0x3'));var getUserApplications=function(_0x5e70be,_0x11521b,_0x1fc60b){var _0x1ea6b2=0x1;var _0x1fe61a=[];var _0x1da554={'context':_0x11521b[_0xf7cd('0x4')]||'from-sip','exten':util[_0xf7cd('0x5')](_0xf7cd('0x6'),_0x5e70be['prefix'],_0x1fc60b),'type':_0xf7cd('0x7'),'isApp':![],'ChanSpyId':_0x5e70be['id'],'UserId':_0x11521b['id']};_0x1fe61a[_0xf7cd('0x8')](_['merge']({'app':_0xf7cd('0x9'),'appdata':util['format']('CDR(type)=%s',_0xf7cd('0xa')),'priority':_0x1ea6b2++},_0x1da554));if(_0x5e70be[_0xf7cd('0xb')]){_0x1fe61a[_0xf7cd('0x8')](_[_0xf7cd('0xc')]({'app':_0xf7cd('0xd'),'appdata':util[_0xf7cd('0x5')]('${UNIQUEID}.%s,a',_0x5e70be['recordingFormat']),'priority':_0x1ea6b2++},_0x1da554));}if(_0x5e70be[_0xf7cd('0xe')]){_0x1fe61a['push'](_[_0xf7cd('0xc')]({'app':_0xf7cd('0xf'),'appdata':_0x5e70be[_0xf7cd('0x10')],'priority':_0x1ea6b2++},_0x1da554));}_0x1fe61a[_0xf7cd('0x8')](_[_0xf7cd('0xc')]({'app':_0xf7cd('0x11'),'appdata':util['format']('SIP/%s,%s',_0x11521b[_0xf7cd('0x12')],_0x5e70be['options']?_0x5e70be[_0xf7cd('0x13')][_0xf7cd('0x14')](''):''),'priority':_0x1ea6b2++},_0x1da554));if(_0x5e70be[_0xf7cd('0xb')]){_0x1fe61a[_0xf7cd('0x8')](_['merge']({'app':'StopMixMonitor','priority':_0x1ea6b2++},_0x1da554));}return _0x1fe61a;};var getChanSpyApplications=function(_0x3a7ada,_0x425494){var _0x2e277c=[];for(var _0x591922=0x0,_0x556790=0x1;_0x591922<_0x425494[_0xf7cd('0x15')];_0x591922++,_0x556790=0x1){_0x2e277c=_0x2e277c[_0xf7cd('0x16')](getUserApplications(_0x3a7ada,_0x425494[_0x591922],_0x425494[_0x591922]['internal']));if(_0x425494[_0x591922]['internal']!=_0x425494[_0x591922][_0xf7cd('0x12')]){_0x2e277c=_0x2e277c[_0xf7cd('0x16')](getUserApplications(_0x3a7ada,_0x425494[_0x591922],_0x425494[_0x591922][_0xf7cd('0x12')]));}}return _0x2e277c;};var getChanSpyPromise=function(_0x178e13,_0x41057a){return new BPromise(function(_0x509e1e,_0x219d5b){return _0x178e13['User'][_0xf7cd('0x17')]({'attributes':['id',_0xf7cd('0x12'),_0xf7cd('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xf7cd('0x19')](function(_0x1384a0){if(_0x1384a0){return _0x509e1e(getChanSpyApplications(_0x41057a,_0x1384a0));}return _0x509e1e([]);})['catch'](function(_0x1f3ccc){_0x219d5b(_0x1f3ccc);});});};module[_0xf7cd('0x1a')]=function(_0x43cf62,_0x273037){var _0x5c5da3=_0x43cf62[_0xf7cd('0x1b')];return _0x43cf62[_0xf7cd('0x1c')](_0xf7cd('0x1d'),attributes,{'tableName':_0xf7cd('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x597192,_0x2a0b70,_0x5e3915){return getChanSpyPromise(_0x5c5da3,_0x597192)['then'](function(_0x5e43de){if(_0x5e43de&&_0x5e43de[_0xf7cd('0x15')]){return _0x5c5da3['VoiceExtension'][_0xf7cd('0x1f')](_0x5e43de);}})[_0xf7cd('0x19')](function(){_0x5e3915();})[_0xf7cd('0x20')](function(_0x45e471){_0x5e3915(_0x45e471);});},'afterUpdate':function(_0x4ba0dd,_0x5d1788,_0x132899){return _0x5c5da3[_0xf7cd('0x21')][_0xf7cd('0x22')]({'where':{'ChanSpyId':_0x4ba0dd['id']}})[_0xf7cd('0x19')](function(){return getChanSpyPromise(_0x5c5da3,_0x4ba0dd);})[_0xf7cd('0x19')](function(_0x49b646){if(_0x49b646&&_0x49b646[_0xf7cd('0x15')]){return _0x5c5da3[_0xf7cd('0x21')]['bulkCreate'](_0x49b646);}})[_0xf7cd('0x19')](function(){_0x132899();})[_0xf7cd('0x20')](function(_0x29f925){_0x132899(_0x29f925);});},'afterDestroy':function(_0x387a88,_0x30e0bf,_0x3eaf75){return _0x5c5da3[_0xf7cd('0x21')]['destroy']({'where':{'ChanSpyId':_0x387a88['id']}})[_0xf7cd('0x19')](function(){_0x3eaf75();})[_0xf7cd('0x20')](function(_0x23c83b){_0x3eaf75(_0x23c83b);});}}});}; \ No newline at end of file +var _0x53d5=['User','findAll','agent','then','catch','exports','define','voice_chanspy','bulkCreate','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','prefix','push','merge','Set','format','CDR(type)=%s','record','${UNIQUEID}.%s,a','auth','Authenticate','password','name','options','StopMixMonitor','length','concat','internal'];(function(_0x125120,_0x14c4a1){var _0x1795b5=function(_0x2dfc35){while(--_0x2dfc35){_0x125120['push'](_0x125120['shift']());}};_0x1795b5(++_0x14c4a1);}(_0x53d5,0xf9));var _0x553d=function(_0x786e9,_0x1a029){_0x786e9=_0x786e9-0x0;var _0x1f891b=_0x53d5[_0x786e9];return _0x1f891b;};'use strict';var _=require(_0x553d('0x0'));var util=require(_0x553d('0x1'));var BPromise=require(_0x553d('0x2'));var attributes=require(_0x553d('0x3'));var getUserApplications=function(_0x14fd53,_0x91f6,_0x4d601d){var _0x15f1d4=0x1;var _0x2ec1c6=[];var _0x5eabf3={'context':_0x91f6[_0x553d('0x4')]||_0x553d('0x5'),'exten':util['format']('%s%s',_0x14fd53[_0x553d('0x6')],_0x4d601d),'type':'system','isApp':![],'ChanSpyId':_0x14fd53['id'],'UserId':_0x91f6['id']};_0x2ec1c6[_0x553d('0x7')](_[_0x553d('0x8')]({'app':_0x553d('0x9'),'appdata':util[_0x553d('0xa')](_0x553d('0xb'),'chanspy'),'priority':_0x15f1d4++},_0x5eabf3));if(_0x14fd53[_0x553d('0xc')]){_0x2ec1c6['push'](_[_0x553d('0x8')]({'app':'MixMonitor','appdata':util[_0x553d('0xa')](_0x553d('0xd'),_0x14fd53['recordingFormat']),'priority':_0x15f1d4++},_0x5eabf3));}if(_0x14fd53[_0x553d('0xe')]){_0x2ec1c6[_0x553d('0x7')](_[_0x553d('0x8')]({'app':_0x553d('0xf'),'appdata':_0x14fd53[_0x553d('0x10')],'priority':_0x15f1d4++},_0x5eabf3));}_0x2ec1c6[_0x553d('0x7')](_[_0x553d('0x8')]({'app':'ChanSpy','appdata':util[_0x553d('0xa')]('SIP/%s,%s',_0x91f6[_0x553d('0x11')],_0x14fd53[_0x553d('0x12')]?_0x14fd53[_0x553d('0x12')]['join'](''):''),'priority':_0x15f1d4++},_0x5eabf3));if(_0x14fd53['record']){_0x2ec1c6[_0x553d('0x7')](_['merge']({'app':_0x553d('0x13'),'priority':_0x15f1d4++},_0x5eabf3));}return _0x2ec1c6;};var getChanSpyApplications=function(_0x57d8e8,_0x4b3f53){var _0x4e76a4=[];for(var _0x23fe66=0x0,_0x541c6b=0x1;_0x23fe66<_0x4b3f53[_0x553d('0x14')];_0x23fe66++,_0x541c6b=0x1){_0x4e76a4=_0x4e76a4[_0x553d('0x15')](getUserApplications(_0x57d8e8,_0x4b3f53[_0x23fe66],_0x4b3f53[_0x23fe66]['internal']));if(_0x4b3f53[_0x23fe66][_0x553d('0x16')]!=_0x4b3f53[_0x23fe66][_0x553d('0x11')]){_0x4e76a4=_0x4e76a4[_0x553d('0x15')](getUserApplications(_0x57d8e8,_0x4b3f53[_0x23fe66],_0x4b3f53[_0x23fe66]['name']));}}return _0x4e76a4;};var getChanSpyPromise=function(_0x290a14,_0x1eebe6){return new BPromise(function(_0x301c6a,_0x45a586){return _0x290a14[_0x553d('0x17')][_0x553d('0x18')]({'attributes':['id',_0x553d('0x11'),_0x553d('0x16')],'where':{'role':_0x553d('0x19'),'chanspy':!![]},'raw':!![]})[_0x553d('0x1a')](function(_0x52c016){if(_0x52c016){return _0x301c6a(getChanSpyApplications(_0x1eebe6,_0x52c016));}return _0x301c6a([]);})[_0x553d('0x1b')](function(_0x4f27af){_0x45a586(_0x4f27af);});});};module[_0x553d('0x1c')]=function(_0x23280b,_0x176b2d){var _0x20be33=_0x23280b['models'];return _0x23280b[_0x553d('0x1d')]('VoiceChanSpy',attributes,{'tableName':_0x553d('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x15597e,_0x1e3d88,_0x15bdd8){return getChanSpyPromise(_0x20be33,_0x15597e)[_0x553d('0x1a')](function(_0x255f6f){if(_0x255f6f&&_0x255f6f[_0x553d('0x14')]){return _0x20be33['VoiceExtension'][_0x553d('0x1f')](_0x255f6f);}})[_0x553d('0x1a')](function(){_0x15bdd8();})[_0x553d('0x1b')](function(_0x3639cc){_0x15bdd8(_0x3639cc);});},'afterUpdate':function(_0x5e68dd,_0xcaa380,_0x2016c8){return _0x20be33[_0x553d('0x20')][_0x553d('0x21')]({'where':{'ChanSpyId':_0x5e68dd['id']}})[_0x553d('0x1a')](function(){return getChanSpyPromise(_0x20be33,_0x5e68dd);})[_0x553d('0x1a')](function(_0x42163c){if(_0x42163c&&_0x42163c[_0x553d('0x14')]){return _0x20be33[_0x553d('0x20')]['bulkCreate'](_0x42163c);}})['then'](function(){_0x2016c8();})[_0x553d('0x1b')](function(_0x15d3ed){_0x2016c8(_0x15d3ed);});},'afterDestroy':function(_0x63164b,_0x49e98d,_0x242ea1){return _0x20be33['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x63164b['id']}})[_0x553d('0x1a')](function(){_0x242ea1();})[_0x553d('0x1b')](function(_0x2285db){_0x242ea1(_0x2285db);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 669decb..2104971 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 _0xde2c=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x17948d,_0x10b71b){var _0x199090=function(_0x538fa9){while(--_0x538fa9){_0x17948d['push'](_0x17948d['shift']());}};_0x199090(++_0x10b71b);}(_0xde2c,0x7f));var _0xcde2=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0xde2c[_0x5eaa0b];return _0x28b295;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});} \ No newline at end of file +var _0xa902=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xa902,0x8d));var _0x2a90=function(_0x41c960,_0x1c317c){_0x41c960=_0x41c960-0x0;var _0x594a59=_0xa902[_0x41c960];return _0x594a59;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 0959e60..9196bd9 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 _0xd01d=['../../config/environment','./voiceContext.controller','isAuthenticated','index','get','show','post','create','put','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x59467a,_0x449ec4){var _0x1908cc=function(_0x40a090){while(--_0x40a090){_0x59467a['push'](_0x59467a['shift']());}};_0x1908cc(++_0x449ec4);}(_0xd01d,0x77));var _0xdd01=function(_0x83b839,_0x35db6f){_0x83b839=_0x83b839-0x0;var _0x4bff3b=_0xd01d[_0x83b839];return _0x4bff3b;};'use strict';var multer=require(_0xdd01('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdd01('0x1'));var express=require(_0xdd01('0x2'));var router=express[_0xdd01('0x3')]();var fs_extra=require(_0xdd01('0x4'));var auth=require(_0xdd01('0x5'));var interaction=require(_0xdd01('0x6'));var config=require(_0xdd01('0x7'));var controller=require(_0xdd01('0x8'));router['get']('/',auth[_0xdd01('0x9')](),controller[_0xdd01('0xa')]);router[_0xdd01('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xdd01('0xc')]);router[_0xdd01('0xd')]('/',auth[_0xdd01('0x9')](),controller[_0xdd01('0xe')]);router[_0xdd01('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xdd01('0x10')]('/:id',auth[_0xdd01('0x9')](),controller[_0xdd01('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa98e=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','create','put','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0xe6654c,_0x224e7f){var _0x5a7a6d=function(_0x5a8884){while(--_0x5a8884){_0xe6654c['push'](_0xe6654c['shift']());}};_0x5a7a6d(++_0x224e7f);}(_0xa98e,0x90));var _0xea98=function(_0x502560,_0x3cebec){_0x502560=_0x502560-0x0;var _0x14fceb=_0xa98e[_0x502560];return _0x14fceb;};'use strict';var multer=require(_0xea98('0x0'));var util=require(_0xea98('0x1'));var path=require(_0xea98('0x2'));var timeout=require(_0xea98('0x3'));var express=require(_0xea98('0x4'));var router=express[_0xea98('0x5')]();var fs_extra=require(_0xea98('0x6'));var auth=require(_0xea98('0x7'));var interaction=require(_0xea98('0x8'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0xea98('0x9')]('/',auth[_0xea98('0xa')](),controller['index']);router[_0xea98('0x9')](_0xea98('0xb'),auth[_0xea98('0xa')](),controller['show']);router['post']('/',auth[_0xea98('0xa')](),controller[_0xea98('0xc')]);router[_0xea98('0xd')](_0xea98('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xea98('0xb'),auth[_0xea98('0xa')](),controller[_0xea98('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 8a16806..207fedb 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 _0x1809=['STRING','BOOLEAN'];(function(_0x8dfb4a,_0x3367f6){var _0x170d74=function(_0x5f08fd){while(--_0x5f08fd){_0x8dfb4a['push'](_0x8dfb4a['shift']());}};_0x170d74(++_0x3367f6);}(_0x1809,0x132));var _0x9180=function(_0x9ec60e,_0x2fc20f){_0x9ec60e=_0x9ec60e-0x0;var _0x501a7f=_0x1809[_0x9ec60e];return _0x501a7f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9180('0x0')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x9180('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4e6d=['STRING','BOOLEAN','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e6d,0x10a));var _0xd4e6=function(_0x1ad279,_0x42d157){_0x1ad279=_0x1ad279-0x0;var _0x272861=_0x4e6d[_0x1ad279];return _0x272861;};'use strict';var Sequelize=require(_0xd4e6('0x0'));module[_0xd4e6('0x1')]={'name':{'type':Sequelize[_0xd4e6('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xd4e6('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd4e6('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 5857507..b8f0b27 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 _0x004d=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','Contexts','UserProfileResource','stack','send','index','map','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','VoiceContext','include','findAll','params','includeAll','create','body','readFileSync','root','server/files/templates/context.ejs','utf8','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent'];(function(_0x5710f5,_0x26943a){var _0x1975e2=function(_0xab504){while(--_0xab504){_0x5710f5['push'](_0x5710f5['shift']());}};_0x1975e2(++_0x26943a);}(_0x004d,0xb0));var _0xd004=function(_0x2e65a6,_0x256565){_0x2e65a6=_0x2e65a6-0x0;var _0x25a12b=_0x004d[_0x2e65a6];return _0x25a12b;};'use strict';var emlformat=require(_0xd004('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd004('0x1'));var jsonpatch=require(_0xd004('0x2'));var rp=require('request-promise');var moment=require(_0xd004('0x3'));var BPromise=require(_0xd004('0x4'));var Mustache=require(_0xd004('0x5'));var util=require(_0xd004('0x6'));var path=require(_0xd004('0x7'));var sox=require(_0xd004('0x8'));var csv=require(_0xd004('0x9'));var ejs=require(_0xd004('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd004('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd004('0xc'));var deskjs=require(_0xd004('0xd'));var toCsv=require(_0xd004('0x9'));var querystring=require(_0xd004('0xe'));var Papa=require(_0xd004('0xf'));var Redis=require(_0xd004('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd004('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd004('0x12'));var logger=require(_0xd004('0x13'))(_0xd004('0x14'));var utils=require(_0xd004('0x15'));var config=require(_0xd004('0x16'));var licenseUtil=require(_0xd004('0x17'));var db=require(_0xd004('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xd004('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x82c71c,_0x4a3058,_0xfc935c,_0x585042){return new BPromise(function(_0x5909fe,_0x5b273c){var _0x73c8d5=_0x585042||client;return _0x73c8d5['request'](_0x82c71c,_0xfc935c)[_0xd004('0x1a')](function(_0xe61da8){logger[_0xd004('0x1b')](_0xd004('0x1c'),_0x4a3058,_0xd004('0x1d'));logger[_0xd004('0x1e')](_0xd004('0x1f'),_0x4a3058,_0xd004('0x1d'),JSON[_0xd004('0x20')](_0xe61da8));if(_0xe61da8[_0xd004('0x21')]){if(_0xe61da8[_0xd004('0x21')][_0xd004('0x22')]===0x1f4){logger[_0xd004('0x21')](_0xd004('0x1c'),_0x4a3058,_0xe61da8['error'][_0xd004('0x23')]);return _0x5b273c(_0xe61da8['error'][_0xd004('0x23')]);}logger['error'](_0xd004('0x1c'),_0x4a3058,_0xe61da8[_0xd004('0x21')][_0xd004('0x23')]);return _0x5909fe(_0xe61da8[_0xd004('0x21')]['message']);}else{logger['info'](_0xd004('0x1c'),_0x4a3058,_0xd004('0x1d'));_0x5909fe(_0xe61da8[_0xd004('0x24')]['message']);}})[_0xd004('0x25')](function(_0x428371){logger['error']('VoiceContext,\x20%s,\x20%s',_0x4a3058,_0x428371);_0x5b273c(_0x428371);});});}function respondWithStatusCode(_0x2949dd,_0x328e87){_0x328e87=_0x328e87||0xcc;return function(_0x3cb4ec){if(_0x3cb4ec){return _0x2949dd[_0xd004('0x26')](_0x328e87);}return _0x2949dd['status'](_0x328e87)[_0xd004('0x27')]();};}function respondWithResult(_0x2debcf,_0x462026){_0x462026=_0x462026||0xc8;return function(_0x1cab10){if(_0x1cab10){return _0x2debcf[_0xd004('0x28')](_0x462026)[_0xd004('0x29')](_0x1cab10);}};}function respondWithFilteredResult(_0x407c93,_0x236862){return function(_0x1fd934){if(_0x1fd934){var _0x45c4fb=typeof _0x236862[_0xd004('0x2a')]===_0xd004('0x2b')&&typeof _0x236862[_0xd004('0x2c')]===_0xd004('0x2b');var _0x1d85c4=_0x1fd934[_0xd004('0x2d')];var _0x2277d4=_0x45c4fb?0x0:_0x236862['offset'];var _0x485ff6=_0x45c4fb?_0x1fd934[_0xd004('0x2d')]:_0x236862[_0xd004('0x2a')]+_0x236862[_0xd004('0x2c')];var _0x1db3db;if(_0x485ff6>=_0x1d85c4){_0x485ff6=_0x1d85c4;_0x1db3db=0xc8;}else{_0x1db3db=0xce;}_0x407c93[_0xd004('0x28')](_0x1db3db);return _0x407c93[_0xd004('0x2e')](_0xd004('0x2f'),_0x2277d4+'-'+_0x485ff6+'/'+_0x1d85c4)[_0xd004('0x29')](_0x1fd934);}return null;};}function patchUpdates(_0x3fe870){return function(_0x5ad392){try{jsonpatch[_0xd004('0x30')](_0x5ad392,_0x3fe870,!![]);}catch(_0x59390f){return BPromise['reject'](_0x59390f);}return _0x5ad392[_0xd004('0x31')]();};}function saveUpdates(_0x1bf90e,_0x3ca18f){return function(_0x4e75f2){if(_0x4e75f2){return _0x4e75f2[_0xd004('0x32')](_0x1bf90e)['then'](function(_0x4d988e){return _0x4d988e;});}return null;};}function removeEntity(_0x7a41d1,_0x54cd2e){return function(_0x317ea7){if(_0x317ea7){return _0x317ea7[_0xd004('0x33')]()[_0xd004('0x1a')](function(){var _0x1d6196=_0x317ea7[_0xd004('0x34')]({'plain':!![]});var _0x58613d=_0xd004('0x35');return db[_0xd004('0x36')][_0xd004('0x33')]({'where':{'type':_0x58613d,'resourceId':_0x1d6196['id']}})['then'](function(){return _0x317ea7;});})[_0xd004('0x1a')](function(){_0x7a41d1[_0xd004('0x28')](0xcc)[_0xd004('0x27')]();});}};}function handleEntityNotFound(_0x4956f5,_0x306d9f){return function(_0x20f6ac){if(!_0x20f6ac){_0x4956f5[_0xd004('0x26')](0x194);}return _0x20f6ac;};}function handleError(_0x543807,_0x2d1a17){_0x2d1a17=_0x2d1a17||0x1f4;return function(_0x101324){logger[_0xd004('0x21')](_0x101324[_0xd004('0x37')]);if(_0x101324['name']){delete _0x101324['name'];}_0x543807[_0xd004('0x28')](_0x2d1a17)[_0xd004('0x38')](_0x101324);};}exports[_0xd004('0x39')]=function(_0x2ff2db,_0x3d4a14){var _0x59a7f1={},_0x2bd960={},_0x2cdff5={'count':0x0,'rows':[]};var _0xe98420=_[_0xd004('0x3a')](db['VoiceContext'][_0xd004('0x3b')],function(_0x9ae312){return{'name':_0x9ae312[_0xd004('0x3c')],'type':_0x9ae312[_0xd004('0x3d')][_0xd004('0x3e')]};});_0x2bd960['model']=_[_0xd004('0x3a')](_0xe98420,_0xd004('0x3f'));_0x2bd960[_0xd004('0x40')]=_[_0xd004('0x41')](_0x2ff2db[_0xd004('0x40')]);_0x2bd960['filters']=_[_0xd004('0x42')](_0x2bd960[_0xd004('0x43')],_0x2bd960[_0xd004('0x40')]);_0x59a7f1[_0xd004('0x44')]=_[_0xd004('0x42')](_0x2bd960[_0xd004('0x43')],qs[_0xd004('0x45')](_0x2ff2db['query'][_0xd004('0x45')]));_0x59a7f1['attributes']=_0x59a7f1['attributes'][_0xd004('0x46')]?_0x59a7f1['attributes']:_0x2bd960['model'];if(!_0x2ff2db['query'][_0xd004('0x47')](_0xd004('0x48'))){_0x59a7f1['limit']=qs['limit'](_0x2ff2db[_0xd004('0x40')][_0xd004('0x2c')]);_0x59a7f1[_0xd004('0x2a')]=qs[_0xd004('0x2a')](_0x2ff2db['query'][_0xd004('0x2a')]);}_0x59a7f1[_0xd004('0x49')]=qs[_0xd004('0x4a')](_0x2ff2db[_0xd004('0x40')][_0xd004('0x4a')]);_0x59a7f1['where']=qs[_0xd004('0x4b')](_[_0xd004('0x4c')](_0x2ff2db[_0xd004('0x40')],_0x2bd960[_0xd004('0x4b')]),_0xe98420);if(_0x2ff2db[_0xd004('0x40')][_0xd004('0x4d')]){_0x59a7f1['where']=_['merge'](_0x59a7f1['where'],{'$or':_['map'](_0xe98420,function(_0x1a8465){if(_0x1a8465[_0xd004('0x3d')]!=='VIRTUAL'){var _0x137772={};_0x137772[_0x1a8465[_0xd004('0x3f')]]={'$like':'%'+_0x2ff2db['query'][_0xd004('0x4d')]+'%'};return _0x137772;}})});}_0x59a7f1=_[_0xd004('0x4e')]({},_0x59a7f1,_0x2ff2db['options']);var _0x17cd58={'where':_0x59a7f1['where']};return db[_0xd004('0x4f')]['count'](_0x17cd58)[_0xd004('0x1a')](function(_0x52f361){_0x2cdff5[_0xd004('0x2d')]=_0x52f361;if(_0x2ff2db[_0xd004('0x40')]['includeAll']){_0x59a7f1[_0xd004('0x50')]=[{'all':!![]}];}return db[_0xd004('0x4f')][_0xd004('0x51')](_0x59a7f1);})['then'](function(_0x29504d){_0x2cdff5['rows']=_0x29504d;return _0x2cdff5;})[_0xd004('0x1a')](respondWithFilteredResult(_0x3d4a14,_0x59a7f1))[_0xd004('0x25')](handleError(_0x3d4a14,null));};exports['show']=function(_0x20beeb,_0x162300){var _0x50a651={'raw':![],'where':{'id':_0x20beeb[_0xd004('0x52')]['id']}},_0xfd841d={};_0xfd841d['model']=_[_0xd004('0x41')](db['VoiceContext'][_0xd004('0x3b')]);_0xfd841d[_0xd004('0x40')]=_[_0xd004('0x41')](_0x20beeb[_0xd004('0x40')]);_0xfd841d[_0xd004('0x4b')]=_[_0xd004('0x42')](_0xfd841d[_0xd004('0x43')],_0xfd841d[_0xd004('0x40')]);_0x50a651['attributes']=_[_0xd004('0x42')](_0xfd841d[_0xd004('0x43')],qs[_0xd004('0x45')](_0x20beeb[_0xd004('0x40')]['fields']));_0x50a651[_0xd004('0x44')]=_0x50a651[_0xd004('0x44')]['length']?_0x50a651[_0xd004('0x44')]:_0xfd841d[_0xd004('0x43')];if(_0x20beeb[_0xd004('0x40')][_0xd004('0x53')]){_0x50a651['include']=[{'all':!![]}];}_0x50a651=_[_0xd004('0x4e')]({},_0x50a651,_0x20beeb['options']);return db[_0xd004('0x4f')]['find'](_0x50a651)[_0xd004('0x1a')](handleEntityNotFound(_0x162300,null))[_0xd004('0x1a')](respondWithResult(_0x162300,null))[_0xd004('0x25')](handleError(_0x162300,null));};exports[_0xd004('0x54')]=function(_0x367612,_0x475c5b,_0x322ce8){var _0x5a9949;return db['VoiceContext'][_0xd004('0x54')](_0x367612[_0xd004('0x55')],{'raw':!![]})[_0xd004('0x1a')](function(_0x3dfd30){_0x5a9949=_0x3dfd30;return db[_0xd004('0x4f')][_0xd004('0x51')]({'raw':!![]});})[_0xd004('0x1a')](function(_0x206528){var _0x3f58df=fs[_0xd004('0x56')](path['join'](config[_0xd004('0x57')],_0xd004('0x58')),_0xd004('0x59'));var _0x827c63=ejs['render'](_0x3f58df,{'contexts':_0x206528||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x827c63);})['then'](function(){return respondWithRpcPromise(_0xd004('0x5a'),_0xd004('0x54'),{'module':'chan_sip.so'});})[_0xd004('0x1a')](function(){var _0x1b3a29=_0x367612[_0xd004('0x5b')][_0xd004('0x34')]({'plain':!![]});if(!_0x1b3a29)throw new Error(_0xd004('0x5c'));if(_0x1b3a29['role']==='user'){var _0x15dce7=_0x5a9949['get']({'plain':!![]});return db[_0xd004('0x5d')][_0xd004('0x5e')]({'where':{'name':_0xd004('0x35'),'userProfileId':_0x1b3a29[_0xd004('0x5f')]},'raw':!![]})['then'](function(_0x2c1525){if(_0x2c1525&&_0x2c1525[_0xd004('0x60')]===0x0){return db['UserProfileResource'][_0xd004('0x54')]({'name':_0x15dce7[_0xd004('0x3f')],'resourceId':_0x15dce7['id'],'type':_0x2c1525['name'],'sectionId':_0x2c1525['id']},{})[_0xd004('0x1a')](function(){return _0x5a9949;});}else{return _0x5a9949;}})['catch'](function(_0x5c9a72){logger[_0xd004('0x21')](_0xd004('0x61'),_0x5c9a72);throw _0x5c9a72;});}return _0x5a9949;})[_0xd004('0x1a')](respondWithResult(_0x475c5b,0xc9))[_0xd004('0x25')](handleError(_0x475c5b,null));};exports[_0xd004('0x32')]=function(_0x8fa8d0,_0x26f3fc,_0x4ed4b5){var _0x546db5;return db[_0xd004('0x4f')][_0xd004('0x5e')]({'where':{'id':_0x8fa8d0[_0xd004('0x52')]['id']}})[_0xd004('0x1a')](handleEntityNotFound(_0x26f3fc,null))['then'](saveUpdates(_0x8fa8d0['body'],null))[_0xd004('0x1a')](function(_0x12f082){if(_0x12f082){_0x546db5=_0x12f082;return db[_0xd004('0x4f')][_0xd004('0x51')]({'raw':!![]});}})[_0xd004('0x1a')](function(_0x3de12e){var _0x4e08e6=fs[_0xd004('0x56')](path[_0xd004('0x62')](config[_0xd004('0x57')],_0xd004('0x58')),_0xd004('0x59'));var _0x52ccaa=ejs[_0xd004('0x63')](_0x4e08e6,{'contexts':_0x3de12e||[]});fs[_0xd004('0x64')](_0xd004('0x65'),_0x52ccaa);})[_0xd004('0x1a')](function(){return respondWithRpcPromise('Reload',_0xd004('0x32'),{'module':_0xd004('0x66')});})['then'](function(){return _0x546db5;})[_0xd004('0x1a')](respondWithResult(_0x26f3fc,null))['catch'](handleError(_0x26f3fc,null));};exports['destroy']=function(_0x410e3a,_0x4e231c,_0x21c7cb){var _0x5479d9;return db[_0xd004('0x4f')][_0xd004('0x5e')]({'where':{'id':_0x410e3a[_0xd004('0x52')]['id']}})[_0xd004('0x1a')](handleEntityNotFound(_0x4e231c,null))[_0xd004('0x1a')](removeEntity(_0x4e231c,null))[_0xd004('0x1a')](function(){return db[_0xd004('0x4f')][_0xd004('0x51')]({'raw':!![]});})[_0xd004('0x1a')](function(_0xabddcf){var _0xfc8d48=fs[_0xd004('0x56')](path[_0xd004('0x62')](config[_0xd004('0x57')],'server/files/templates/context.ejs'),_0xd004('0x59'));var _0xb4763d=ejs[_0xd004('0x63')](_0xfc8d48,{'contexts':_0xabddcf});fs[_0xd004('0x64')](_0xd004('0x65'),_0xb4763d);return respondWithRpcPromise(_0xd004('0x5a'),_0xd004('0x33'),{'module':_0xd004('0x66')});})[_0xd004('0x25')](handleError(_0x4e231c,null));}; \ No newline at end of file +var _0x4fec=['apply','reject','update','destroy','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x4fec,0xa0));var _0xc4fe=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x4fec[_0x1ca890];return _0x3f8e01;};'use strict';var emlformat=require(_0xc4fe('0x0'));var rimraf=require(_0xc4fe('0x1'));var zipdir=require(_0xc4fe('0x2'));var jsonpatch=require(_0xc4fe('0x3'));var rp=require(_0xc4fe('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc4fe('0x5'));var sox=require(_0xc4fe('0x6'));var csv=require(_0xc4fe('0x7'));var ejs=require(_0xc4fe('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc4fe('0x9'));var squel=require(_0xc4fe('0xa'));var crypto=require(_0xc4fe('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc4fe('0xc'));var toCsv=require(_0xc4fe('0x7'));var querystring=require(_0xc4fe('0xd'));var Papa=require(_0xc4fe('0xe'));var Redis=require(_0xc4fe('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc4fe('0x10'));var as=require(_0xc4fe('0x11'));var hardwareService=require(_0xc4fe('0x12'));var logger=require(_0xc4fe('0x13'))(_0xc4fe('0x14'));var utils=require('../../config/utils');var config=require(_0xc4fe('0x15'));var licenseUtil=require(_0xc4fe('0x16'));var db=require(_0xc4fe('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xc4fe('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x344349,_0x2ce072,_0x1a1f81,_0x3e9d73){return new BPromise(function(_0x509426,_0x4c5d1b){var _0x18da23=_0x3e9d73||client;return _0x18da23[_0xc4fe('0x19')](_0x344349,_0x1a1f81)[_0xc4fe('0x1a')](function(_0xd5a5fd){logger[_0xc4fe('0x1b')](_0xc4fe('0x1c'),_0x2ce072,_0xc4fe('0x1d'));logger[_0xc4fe('0x1e')](_0xc4fe('0x1f'),_0x2ce072,_0xc4fe('0x1d'),JSON[_0xc4fe('0x20')](_0xd5a5fd));if(_0xd5a5fd[_0xc4fe('0x21')]){if(_0xd5a5fd[_0xc4fe('0x21')]['code']===0x1f4){logger[_0xc4fe('0x21')](_0xc4fe('0x1c'),_0x2ce072,_0xd5a5fd[_0xc4fe('0x21')][_0xc4fe('0x22')]);return _0x4c5d1b(_0xd5a5fd['error'][_0xc4fe('0x22')]);}logger[_0xc4fe('0x21')](_0xc4fe('0x1c'),_0x2ce072,_0xd5a5fd[_0xc4fe('0x21')]['message']);return _0x509426(_0xd5a5fd[_0xc4fe('0x21')][_0xc4fe('0x22')]);}else{logger[_0xc4fe('0x1b')](_0xc4fe('0x1c'),_0x2ce072,_0xc4fe('0x1d'));_0x509426(_0xd5a5fd[_0xc4fe('0x23')][_0xc4fe('0x22')]);}})[_0xc4fe('0x24')](function(_0x326327){logger[_0xc4fe('0x21')](_0xc4fe('0x1c'),_0x2ce072,_0x326327);_0x4c5d1b(_0x326327);});});}function respondWithStatusCode(_0x34178f,_0x19c3ca){_0x19c3ca=_0x19c3ca||0xcc;return function(_0x14c41f){if(_0x14c41f){return _0x34178f[_0xc4fe('0x25')](_0x19c3ca);}return _0x34178f[_0xc4fe('0x26')](_0x19c3ca)[_0xc4fe('0x27')]();};}function respondWithResult(_0x12bdd7,_0x13da68){_0x13da68=_0x13da68||0xc8;return function(_0x2c6443){if(_0x2c6443){return _0x12bdd7['status'](_0x13da68)[_0xc4fe('0x28')](_0x2c6443);}};}function respondWithFilteredResult(_0x5c903c,_0x40f220){return function(_0x64f48c){if(_0x64f48c){var _0x3bf4ba=typeof _0x40f220[_0xc4fe('0x29')]===_0xc4fe('0x2a')&&typeof _0x40f220[_0xc4fe('0x2b')]==='undefined';var _0x25a8a3=_0x64f48c[_0xc4fe('0x2c')];var _0x52ee8e=_0x3bf4ba?0x0:_0x40f220[_0xc4fe('0x29')];var _0xdb9f55=_0x3bf4ba?_0x64f48c[_0xc4fe('0x2c')]:_0x40f220['offset']+_0x40f220['limit'];var _0x5ebd41;if(_0xdb9f55>=_0x25a8a3){_0xdb9f55=_0x25a8a3;_0x5ebd41=0xc8;}else{_0x5ebd41=0xce;}_0x5c903c[_0xc4fe('0x26')](_0x5ebd41);return _0x5c903c[_0xc4fe('0x2d')]('Content-Range',_0x52ee8e+'-'+_0xdb9f55+'/'+_0x25a8a3)[_0xc4fe('0x28')](_0x64f48c);}return null;};}function patchUpdates(_0x5251bc){return function(_0x19d869){try{jsonpatch[_0xc4fe('0x2e')](_0x19d869,_0x5251bc,!![]);}catch(_0x4efea0){return BPromise[_0xc4fe('0x2f')](_0x4efea0);}return _0x19d869['save']();};}function saveUpdates(_0xd521cf,_0x9fa685){return function(_0x2a456f){if(_0x2a456f){return _0x2a456f[_0xc4fe('0x30')](_0xd521cf)[_0xc4fe('0x1a')](function(_0x534d9a){return _0x534d9a;});}return null;};}function removeEntity(_0x20bd5b,_0x10ca07){return function(_0xda9198){if(_0xda9198){return _0xda9198[_0xc4fe('0x31')]()[_0xc4fe('0x1a')](function(){var _0x567e76=_0xda9198['get']({'plain':!![]});var _0x513a81=_0xc4fe('0x32');return db[_0xc4fe('0x33')][_0xc4fe('0x31')]({'where':{'type':_0x513a81,'resourceId':_0x567e76['id']}})['then'](function(){return _0xda9198;});})['then'](function(){_0x20bd5b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x112e18,_0x1f7df4){return function(_0x277e78){if(!_0x277e78){_0x112e18['sendStatus'](0x194);}return _0x277e78;};}function handleError(_0x3119ce,_0x15d854){_0x15d854=_0x15d854||0x1f4;return function(_0x35793b){logger[_0xc4fe('0x21')](_0x35793b[_0xc4fe('0x34')]);if(_0x35793b[_0xc4fe('0x35')]){delete _0x35793b[_0xc4fe('0x35')];}_0x3119ce[_0xc4fe('0x26')](_0x15d854)[_0xc4fe('0x36')](_0x35793b);};}exports[_0xc4fe('0x37')]=function(_0x144a08,_0x4bbc24){var _0x481eea={},_0x48ffbe={},_0x3e974c={'count':0x0,'rows':[]};var _0xc1bdc=_[_0xc4fe('0x38')](db[_0xc4fe('0x39')][_0xc4fe('0x3a')],function(_0x7315e8){return{'name':_0x7315e8['fieldName'],'type':_0x7315e8[_0xc4fe('0x3b')]['key']};});_0x48ffbe[_0xc4fe('0x3c')]=_[_0xc4fe('0x38')](_0xc1bdc,_0xc4fe('0x35'));_0x48ffbe['query']=_[_0xc4fe('0x3d')](_0x144a08[_0xc4fe('0x3e')]);_0x48ffbe[_0xc4fe('0x3f')]=_[_0xc4fe('0x40')](_0x48ffbe[_0xc4fe('0x3c')],_0x48ffbe['query']);_0x481eea[_0xc4fe('0x41')]=_['intersection'](_0x48ffbe['model'],qs[_0xc4fe('0x42')](_0x144a08[_0xc4fe('0x3e')][_0xc4fe('0x42')]));_0x481eea[_0xc4fe('0x41')]=_0x481eea[_0xc4fe('0x41')][_0xc4fe('0x43')]?_0x481eea[_0xc4fe('0x41')]:_0x48ffbe[_0xc4fe('0x3c')];if(!_0x144a08[_0xc4fe('0x3e')][_0xc4fe('0x44')]('nolimit')){_0x481eea['limit']=qs[_0xc4fe('0x2b')](_0x144a08[_0xc4fe('0x3e')]['limit']);_0x481eea[_0xc4fe('0x29')]=qs[_0xc4fe('0x29')](_0x144a08[_0xc4fe('0x3e')]['offset']);}_0x481eea[_0xc4fe('0x45')]=qs[_0xc4fe('0x46')](_0x144a08[_0xc4fe('0x3e')][_0xc4fe('0x46')]);_0x481eea[_0xc4fe('0x47')]=qs['filters'](_['pick'](_0x144a08['query'],_0x48ffbe[_0xc4fe('0x3f')]),_0xc1bdc);if(_0x144a08[_0xc4fe('0x3e')][_0xc4fe('0x48')]){_0x481eea[_0xc4fe('0x47')]=_[_0xc4fe('0x49')](_0x481eea['where'],{'$or':_[_0xc4fe('0x38')](_0xc1bdc,function(_0x2a4731){if(_0x2a4731[_0xc4fe('0x3b')]!==_0xc4fe('0x4a')){var _0x362029={};_0x362029[_0x2a4731['name']]={'$like':'%'+_0x144a08[_0xc4fe('0x3e')][_0xc4fe('0x48')]+'%'};return _0x362029;}})});}_0x481eea=_['merge']({},_0x481eea,_0x144a08[_0xc4fe('0x4b')]);var _0x475b8f={'where':_0x481eea['where']};return db[_0xc4fe('0x39')][_0xc4fe('0x2c')](_0x475b8f)[_0xc4fe('0x1a')](function(_0x11c0f2){_0x3e974c[_0xc4fe('0x2c')]=_0x11c0f2;if(_0x144a08[_0xc4fe('0x3e')]['includeAll']){_0x481eea[_0xc4fe('0x4c')]=[{'all':!![]}];}return db[_0xc4fe('0x39')][_0xc4fe('0x4d')](_0x481eea);})['then'](function(_0x58cbab){_0x3e974c[_0xc4fe('0x4e')]=_0x58cbab;return _0x3e974c;})[_0xc4fe('0x1a')](respondWithFilteredResult(_0x4bbc24,_0x481eea))[_0xc4fe('0x24')](handleError(_0x4bbc24,null));};exports[_0xc4fe('0x4f')]=function(_0x3157bc,_0x492b51){var _0x1b2986={'raw':![],'where':{'id':_0x3157bc[_0xc4fe('0x50')]['id']}},_0x33a905={};_0x33a905[_0xc4fe('0x3c')]=_['keys'](db[_0xc4fe('0x39')][_0xc4fe('0x3a')]);_0x33a905['query']=_['keys'](_0x3157bc[_0xc4fe('0x3e')]);_0x33a905['filters']=_[_0xc4fe('0x40')](_0x33a905['model'],_0x33a905[_0xc4fe('0x3e')]);_0x1b2986[_0xc4fe('0x41')]=_[_0xc4fe('0x40')](_0x33a905[_0xc4fe('0x3c')],qs[_0xc4fe('0x42')](_0x3157bc['query'][_0xc4fe('0x42')]));_0x1b2986[_0xc4fe('0x41')]=_0x1b2986['attributes'][_0xc4fe('0x43')]?_0x1b2986['attributes']:_0x33a905[_0xc4fe('0x3c')];if(_0x3157bc['query'][_0xc4fe('0x51')]){_0x1b2986['include']=[{'all':!![]}];}_0x1b2986=_['merge']({},_0x1b2986,_0x3157bc[_0xc4fe('0x4b')]);return db['VoiceContext'][_0xc4fe('0x52')](_0x1b2986)['then'](handleEntityNotFound(_0x492b51,null))['then'](respondWithResult(_0x492b51,null))[_0xc4fe('0x24')](handleError(_0x492b51,null));};exports[_0xc4fe('0x53')]=function(_0x440232,_0x1a0888,_0xeca2f1){var _0x22b047;return db['VoiceContext'][_0xc4fe('0x53')](_0x440232[_0xc4fe('0x54')],{'raw':!![]})[_0xc4fe('0x1a')](function(_0x18103e){_0x22b047=_0x18103e;return db[_0xc4fe('0x39')][_0xc4fe('0x4d')]({'raw':!![]});})[_0xc4fe('0x1a')](function(_0x2afca6){var _0x11aa28=fs[_0xc4fe('0x55')](path[_0xc4fe('0x56')](config[_0xc4fe('0x57')],'server/files/templates/context.ejs'),_0xc4fe('0x58'));var _0x26aa8f=ejs[_0xc4fe('0x59')](_0x11aa28,{'contexts':_0x2afca6||[]});fs[_0xc4fe('0x5a')](_0xc4fe('0x5b'),_0x26aa8f);})[_0xc4fe('0x1a')](function(){return respondWithRpcPromise(_0xc4fe('0x5c'),'create',{'module':_0xc4fe('0x5d')});})[_0xc4fe('0x1a')](function(){var _0x40eb76=_0x440232['user'][_0xc4fe('0x5e')]({'plain':!![]});if(!_0x40eb76)throw new Error(_0xc4fe('0x5f'));if(_0x40eb76[_0xc4fe('0x60')]===_0xc4fe('0x61')){var _0x4ecd90=_0x22b047[_0xc4fe('0x5e')]({'plain':!![]});return db[_0xc4fe('0x62')][_0xc4fe('0x52')]({'where':{'name':_0xc4fe('0x32'),'userProfileId':_0x40eb76[_0xc4fe('0x63')]},'raw':!![]})[_0xc4fe('0x1a')](function(_0x306795){if(_0x306795&&_0x306795[_0xc4fe('0x64')]===0x0){return db[_0xc4fe('0x33')]['create']({'name':_0x4ecd90[_0xc4fe('0x35')],'resourceId':_0x4ecd90['id'],'type':_0x306795[_0xc4fe('0x35')],'sectionId':_0x306795['id']},{})[_0xc4fe('0x1a')](function(){return _0x22b047;});}else{return _0x22b047;}})['catch'](function(_0x1f6fdd){logger['error'](_0xc4fe('0x65'),_0x1f6fdd);throw _0x1f6fdd;});}return _0x22b047;})[_0xc4fe('0x1a')](respondWithResult(_0x1a0888,0xc9))[_0xc4fe('0x24')](handleError(_0x1a0888,null));};exports['update']=function(_0x8d0c5d,_0x220ce0,_0x49f296){var _0x3e2ff8;return db['VoiceContext']['find']({'where':{'id':_0x8d0c5d['params']['id']}})[_0xc4fe('0x1a')](handleEntityNotFound(_0x220ce0,null))[_0xc4fe('0x1a')](saveUpdates(_0x8d0c5d[_0xc4fe('0x54')],null))[_0xc4fe('0x1a')](function(_0x5c0bac){if(_0x5c0bac){_0x3e2ff8=_0x5c0bac;return db['VoiceContext'][_0xc4fe('0x4d')]({'raw':!![]});}})[_0xc4fe('0x1a')](function(_0x3d712){var _0x164bcb=fs[_0xc4fe('0x55')](path[_0xc4fe('0x56')](config[_0xc4fe('0x57')],_0xc4fe('0x66')),_0xc4fe('0x58'));var _0x1c2ec8=ejs[_0xc4fe('0x59')](_0x164bcb,{'contexts':_0x3d712||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x1c2ec8);})[_0xc4fe('0x1a')](function(){return respondWithRpcPromise(_0xc4fe('0x5c'),_0xc4fe('0x30'),{'module':'chan_sip.so'});})[_0xc4fe('0x1a')](function(){return _0x3e2ff8;})['then'](respondWithResult(_0x220ce0,null))['catch'](handleError(_0x220ce0,null));};exports[_0xc4fe('0x31')]=function(_0x33fdc2,_0x2dea85,_0x5503fc){var _0x55fa93;return db[_0xc4fe('0x39')][_0xc4fe('0x52')]({'where':{'id':_0x33fdc2['params']['id']}})['then'](handleEntityNotFound(_0x2dea85,null))[_0xc4fe('0x1a')](removeEntity(_0x2dea85,null))[_0xc4fe('0x1a')](function(){return db[_0xc4fe('0x39')][_0xc4fe('0x4d')]({'raw':!![]});})[_0xc4fe('0x1a')](function(_0x175a69){var _0xd0905c=fs[_0xc4fe('0x55')](path['join'](config[_0xc4fe('0x57')],_0xc4fe('0x66')),_0xc4fe('0x58'));var _0x792920=ejs['render'](_0xd0905c,{'contexts':_0x175a69});fs['writeFileSync'](_0xc4fe('0x5b'),_0x792920);return respondWithRpcPromise(_0xc4fe('0x5c'),_0xc4fe('0x31'),{'module':'chan_sip.so'});})[_0xc4fe('0x24')](handleError(_0x2dea85,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index fc78a16..d33faa5 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 _0x75e3=['request-promise','./voiceContext.attributes','VoiceContext','voice_contexts','util','../../config/logger','moment','bluebird'];(function(_0xbab5c8,_0x25a964){var _0x34d078=function(_0x30570e){while(--_0x30570e){_0xbab5c8['push'](_0xbab5c8['shift']());}};_0x34d078(++_0x25a964);}(_0x75e3,0x104));var _0x375e=function(_0x20ef59,_0x514ff8){_0x20ef59=_0x20ef59-0x0;var _0x3c97ab=_0x75e3[_0x20ef59];return _0x3c97ab;};'use strict';var _=require('lodash');var util=require(_0x375e('0x0'));var logger=require(_0x375e('0x1'))('api');var moment=require(_0x375e('0x2'));var BPromise=require(_0x375e('0x3'));var rp=require(_0x375e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x375e('0x5'));module['exports']=function(_0x17e32c,_0x52f876){return _0x17e32c['define'](_0x375e('0x6'),attributes,{'tableName':_0x375e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4f6=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','VoiceContext','voice_contexts'];(function(_0x738f6f,_0x54744){var _0x54aef1=function(_0x34af13){while(--_0x34af13){_0x738f6f['push'](_0x738f6f['shift']());}};_0x54aef1(++_0x54744);}(_0xe4f6,0x19a));var _0x6e4f=function(_0x25fe78,_0x59aa7c){_0x25fe78=_0x25fe78-0x0;var _0x234518=_0xe4f6[_0x25fe78];return _0x234518;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6e4f('0x0'))(_0x6e4f('0x1'));var moment=require(_0x6e4f('0x2'));var BPromise=require(_0x6e4f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e4f('0x4'));var rimraf=require(_0x6e4f('0x5'));var config=require(_0x6e4f('0x6'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x547e1e,_0x49dd80){return _0x547e1e[_0x6e4f('0x7')](_0x6e4f('0x8'),attributes,{'tableName':_0x6e4f('0x9'),'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 1eff2d8..770d83d 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 _0xd193=['rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xcac13,_0x49cd79){var _0x183864=function(_0x1768a5){while(--_0x1768a5){_0xcac13['push'](_0xcac13['shift']());}};_0x183864(++_0x49cd79);}(_0xd193,0x119));var _0x3d19=function(_0xe11a4b,_0x4410bb){_0xe11a4b=_0xe11a4b-0x0;var _0x5ab4ad=_0xd193[_0xe11a4b];return _0x5ab4ad;};'use strict';var _=require(_0x3d19('0x0'));var util=require(_0x3d19('0x1'));var moment=require(_0x3d19('0x2'));var BPromise=require(_0x3d19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d19('0x4'))['db'];var utils=require(_0x3d19('0x5'));var logger=require(_0x3d19('0x6'))(_0x3d19('0x7'));var config=require('../../config/environment');var jayson=require(_0x3d19('0x8'));var client=jayson[_0x3d19('0x9')][_0x3d19('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ebfaa,_0x29d860,_0x304c91){return new BPromise(function(_0x29d989,_0x1b72f5){return client[_0x3d19('0xb')](_0x3ebfaa,_0x304c91)[_0x3d19('0xc')](function(_0x4d392e){logger[_0x3d19('0xd')]('VoiceContext,\x20%s,\x20%s',_0x29d860,_0x3d19('0xe'));logger[_0x3d19('0xf')](_0x3d19('0x10'),_0x29d860,_0x3d19('0xe'),JSON[_0x3d19('0x11')](_0x4d392e));if(_0x4d392e['error']){if(_0x4d392e[_0x3d19('0x12')][_0x3d19('0x13')]===0x1f4){logger['error'](_0x3d19('0x14'),_0x29d860,_0x4d392e[_0x3d19('0x12')][_0x3d19('0x15')]);return _0x1b72f5(_0x4d392e[_0x3d19('0x12')][_0x3d19('0x15')]);}logger[_0x3d19('0x12')](_0x3d19('0x14'),_0x29d860,_0x4d392e[_0x3d19('0x12')][_0x3d19('0x15')]);return _0x29d989(_0x4d392e[_0x3d19('0x12')]['message']);}else{logger[_0x3d19('0xd')](_0x3d19('0x14'),_0x29d860,_0x3d19('0xe'));_0x29d989(_0x4d392e[_0x3d19('0x16')][_0x3d19('0x15')]);}})[_0x3d19('0x17')](function(_0x344cee){logger['error'](_0x3d19('0x14'),_0x29d860,_0x344cee);_0x1b72f5(_0x344cee);});});} \ No newline at end of file +var _0xd398=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5e699f,_0x189cdf){var _0x122fe3=function(_0x346650){while(--_0x346650){_0x5e699f['push'](_0x5e699f['shift']());}};_0x122fe3(++_0x189cdf);}(_0xd398,0x1dd));var _0x8d39=function(_0x3e4d9a,_0x449a9f){_0x3e4d9a=_0x3e4d9a-0x0;var _0x4124d3=_0xd398[_0x3e4d9a];return _0x4124d3;};'use strict';var _=require(_0x8d39('0x0'));var util=require(_0x8d39('0x1'));var moment=require(_0x8d39('0x2'));var BPromise=require(_0x8d39('0x3'));var rs=require(_0x8d39('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d39('0x5'))['db'];var utils=require(_0x8d39('0x6'));var logger=require(_0x8d39('0x7'))(_0x8d39('0x8'));var config=require(_0x8d39('0x9'));var jayson=require(_0x8d39('0xa'));var client=jayson[_0x8d39('0xb')][_0x8d39('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38dd94,_0x1d8081,_0x41fe53){return new BPromise(function(_0x3405f3,_0x4711c7){return client['request'](_0x38dd94,_0x41fe53)[_0x8d39('0xd')](function(_0x3392e3){logger[_0x8d39('0xe')](_0x8d39('0xf'),_0x1d8081,'request\x20sent');logger[_0x8d39('0x10')](_0x8d39('0x11'),_0x1d8081,_0x8d39('0x12'),JSON['stringify'](_0x3392e3));if(_0x3392e3[_0x8d39('0x13')]){if(_0x3392e3[_0x8d39('0x13')]['code']===0x1f4){logger['error'](_0x8d39('0xf'),_0x1d8081,_0x3392e3[_0x8d39('0x13')][_0x8d39('0x14')]);return _0x4711c7(_0x3392e3[_0x8d39('0x13')]['message']);}logger['error'](_0x8d39('0xf'),_0x1d8081,_0x3392e3[_0x8d39('0x13')][_0x8d39('0x14')]);return _0x3405f3(_0x3392e3[_0x8d39('0x13')]['message']);}else{logger[_0x8d39('0xe')](_0x8d39('0xf'),_0x1d8081,'request\x20sent');_0x3405f3(_0x3392e3['result'][_0x8d39('0x14')]);}})[_0x8d39('0x15')](function(_0x182980){logger[_0x8d39('0x13')](_0x8d39('0xf'),_0x1d8081,_0x182980);_0x4711c7(_0x182980);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index fa09ab3..d649361 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 _0xf318=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','multer'];(function(_0x222a5d,_0x5c668a){var _0x3c35dd=function(_0xbbc7c9){while(--_0xbbc7c9){_0x222a5d['push'](_0x222a5d['shift']());}};_0x3c35dd(++_0x5c668a);}(_0xf318,0x9f));var _0x8f31=function(_0x40c29e,_0x5439ec){_0x40c29e=_0x40c29e-0x0;var _0x2fe2f9=_0xf318[_0x40c29e];return _0x2fe2f9;};'use strict';var multer=require(_0x8f31('0x0'));var util=require(_0x8f31('0x1'));var path=require(_0x8f31('0x2'));var timeout=require(_0x8f31('0x3'));var express=require(_0x8f31('0x4'));var router=express[_0x8f31('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8f31('0x6'));var interaction=require(_0x8f31('0x7'));var config=require(_0x8f31('0x8'));var controller=require(_0x8f31('0x9'));router[_0x8f31('0xa')]('/',auth[_0x8f31('0xb')](),controller[_0x8f31('0xc')]);router[_0x8f31('0xa')](_0x8f31('0xd'),auth[_0x8f31('0xb')](),controller[_0x8f31('0xe')]);router[_0x8f31('0xa')](_0x8f31('0xf'),auth['isAuthenticated'](),controller[_0x8f31('0x10')]);router[_0x8f31('0x11')]('/',auth[_0x8f31('0xb')](),controller[_0x8f31('0x12')]);router[_0x8f31('0x13')](_0x8f31('0xf'),auth[_0x8f31('0xb')](),controller['update']);router['delete'](_0x8f31('0xf'),auth[_0x8f31('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdedd=['isAuthenticated','index','/describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xdedd,0x155));var _0xdded=function(_0x3983f9,_0x226223){_0x3983f9=_0x3983f9-0x0;var _0x5cee47=_0xdedd[_0x3983f9];return _0x5cee47;};'use strict';var multer=require(_0xdded('0x0'));var util=require(_0xdded('0x1'));var path=require(_0xdded('0x2'));var timeout=require(_0xdded('0x3'));var express=require(_0xdded('0x4'));var router=express[_0xdded('0x5')]();var fs_extra=require(_0xdded('0x6'));var auth=require(_0xdded('0x7'));var interaction=require(_0xdded('0x8'));var config=require(_0xdded('0x9'));var controller=require('./voiceDialReport.controller');router[_0xdded('0xa')]('/',auth[_0xdded('0xb')](),controller[_0xdded('0xc')]);router[_0xdded('0xa')](_0xdded('0xd'),auth[_0xdded('0xb')](),controller['describe']);router[_0xdded('0xa')]('/:id',auth[_0xdded('0xb')](),controller[_0xdded('0xe')]);router['post']('/',auth[_0xdded('0xb')](),controller[_0xdded('0xf')]);router[_0xdded('0x10')](_0xdded('0x11'),auth[_0xdded('0xb')](),controller[_0xdded('0x12')]);router[_0xdded('0x13')]('/:id',auth[_0xdded('0xb')](),controller[_0xdded('0x14')]);module[_0xdded('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 08ed2dd..bdb7764 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 _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x3e74,0x175));var _0x43e7=function(_0x89d407,_0x2c24ec){_0x89d407=_0x89d407-0x0;var _0x27483b=_0x3e74[_0x89d407];return _0x27483b;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8ef6=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x132d9e,_0x4a0839){var _0x40b733=function(_0x30c113){while(--_0x30c113){_0x132d9e['push'](_0x132d9e['shift']());}};_0x40b733(++_0x4a0839);}(_0x8ef6,0xf2));var _0x68ef=function(_0x70d40f,_0x29d750){_0x70d40f=_0x70d40f-0x0;var _0x103ed2=_0x8ef6[_0x70d40f];return _0x103ed2;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'privilege':{'type':Sequelize[_0x68ef('0x2')]},'channel':{'type':Sequelize[_0x68ef('0x2')]},'channelstate':{'type':Sequelize[_0x68ef('0x3')]},'channelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'calleridnum':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'connectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'language':{'type':Sequelize[_0x68ef('0x2')]},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x68ef('0x3')]},'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'linkedid':{'type':Sequelize[_0x68ef('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x68ef('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridnum':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridname':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'destlanguage':{'type':Sequelize[_0x68ef('0x2')]},'destaccountcode':{'type':Sequelize[_0x68ef('0x2')]},'destcontext':{'type':Sequelize[_0x68ef('0x2')]},'destexten':{'type':Sequelize[_0x68ef('0x2')]},'destpriority':{'type':Sequelize[_0x68ef('0x3')]},'destuniqueid':{'type':Sequelize[_0x68ef('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x68ef('0x2')]},'dialstatus':{'type':Sequelize[_0x68ef('0x2')]},'starttime':{'type':Sequelize[_0x68ef('0x4')]},'answertime':{'type':Sequelize[_0x68ef('0x4')]},'endtime':{'type':Sequelize[_0x68ef('0x4')]},'lastevent':{'type':Sequelize[_0x68ef('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x68ef('0x3')]},'duration':{'type':Sequelize[_0x68ef('0x3')]},'holdtime':{'type':Sequelize[_0x68ef('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 40adb8e..68aca82 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 _0x400e=['eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','then','error','stack','name','send','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','VoiceDialReport','includeAll','include','findAll','catch','show','keys','rawAttributes','merge','find','create','body','params','destroy','describe'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x400e,0x96));var _0xe400=function(_0x34c553,_0x3e7dfc){_0x34c553=_0x34c553-0x0;var _0x1357d2=_0x400e[_0x34c553];return _0x1357d2;};'use strict';var emlformat=require(_0xe400('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe400('0x1'));var jsonpatch=require(_0xe400('0x2'));var rp=require('request-promise');var moment=require(_0xe400('0x3'));var BPromise=require(_0xe400('0x4'));var Mustache=require('mustache');var util=require(_0xe400('0x5'));var path=require(_0xe400('0x6'));var sox=require(_0xe400('0x7'));var csv=require(_0xe400('0x8'));var ejs=require(_0xe400('0x9'));var fs=require('fs');var fs_extra=require(_0xe400('0xa'));var _=require(_0xe400('0xb'));var squel=require('squel');var crypto=require(_0xe400('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe400('0xd'));var toCsv=require(_0xe400('0x8'));var querystring=require(_0xe400('0xe'));var Papa=require(_0xe400('0xf'));var Redis=require('ioredis');var authService=require(_0xe400('0x10'));var qs=require(_0xe400('0x11'));var as=require(_0xe400('0x12'));var hardwareService=require(_0xe400('0x13'));var logger=require(_0xe400('0x14'))(_0xe400('0x15'));var utils=require(_0xe400('0x16'));var config=require(_0xe400('0x17'));var licenseUtil=require(_0xe400('0x18'));var db=require(_0xe400('0x19'))['db'];function respondWithStatusCode(_0x2d11e4,_0xf5d7a2){_0xf5d7a2=_0xf5d7a2||0xcc;return function(_0x20983a){if(_0x20983a){return _0x2d11e4['sendStatus'](_0xf5d7a2);}return _0x2d11e4[_0xe400('0x1a')](_0xf5d7a2)[_0xe400('0x1b')]();};}function respondWithResult(_0x4e3674,_0x5e8418){_0x5e8418=_0x5e8418||0xc8;return function(_0x209148){if(_0x209148){return _0x4e3674['status'](_0x5e8418)[_0xe400('0x1c')](_0x209148);}};}function respondWithFilteredResult(_0xee428d,_0x16a1fb){return function(_0x207d6a){if(_0x207d6a){var _0x4eb38a=typeof _0x16a1fb[_0xe400('0x1d')]==='undefined'&&typeof _0x16a1fb[_0xe400('0x1e')]===_0xe400('0x1f');var _0x42bf65=_0x207d6a[_0xe400('0x20')];var _0x151a16=_0x4eb38a?0x0:_0x16a1fb[_0xe400('0x1d')];var _0x59b7d5=_0x4eb38a?_0x207d6a[_0xe400('0x20')]:_0x16a1fb[_0xe400('0x1d')]+_0x16a1fb['limit'];var _0x4648e1;if(_0x59b7d5>=_0x42bf65){_0x59b7d5=_0x42bf65;_0x4648e1=0xc8;}else{_0x4648e1=0xce;}_0xee428d[_0xe400('0x1a')](_0x4648e1);return _0xee428d['set'](_0xe400('0x21'),_0x151a16+'-'+_0x59b7d5+'/'+_0x42bf65)[_0xe400('0x1c')](_0x207d6a);}return null;};}function patchUpdates(_0x4d2998){return function(_0x1ccdd5){try{jsonpatch['apply'](_0x1ccdd5,_0x4d2998,!![]);}catch(_0x52418a){return BPromise[_0xe400('0x22')](_0x52418a);}return _0x1ccdd5['save']();};}function saveUpdates(_0x3ddda5,_0x211804){return function(_0x4ac3e8){if(_0x4ac3e8){return _0x4ac3e8[_0xe400('0x23')](_0x3ddda5)[_0xe400('0x24')](function(_0x13b289){return _0x13b289;});}return null;};}function removeEntity(_0x573e2a,_0x5de434){return function(_0x52e59f){if(_0x52e59f){return _0x52e59f['destroy']()[_0xe400('0x24')](function(){_0x573e2a[_0xe400('0x1a')](0xcc)[_0xe400('0x1b')]();});}};}function handleEntityNotFound(_0xd95e38,_0x105184){return function(_0x121009){if(!_0x121009){_0xd95e38['sendStatus'](0x194);}return _0x121009;};}function handleError(_0x1cefd7,_0x196b5d){_0x196b5d=_0x196b5d||0x1f4;return function(_0x3cbbc1){logger[_0xe400('0x25')](_0x3cbbc1[_0xe400('0x26')]);if(_0x3cbbc1[_0xe400('0x27')]){delete _0x3cbbc1[_0xe400('0x27')];}_0x1cefd7[_0xe400('0x1a')](_0x196b5d)[_0xe400('0x28')](_0x3cbbc1);};}exports['index']=function(_0x163783,_0x68d476){var _0x5d92f7={},_0x53da2b={},_0x312ab8={'count':0x0,'rows':[]};var _0x2645d8=_['map'](db['VoiceDialReport']['rawAttributes'],function(_0x539618){return{'name':_0x539618[_0xe400('0x29')],'type':_0x539618[_0xe400('0x2a')][_0xe400('0x2b')]};});_0x53da2b[_0xe400('0x2c')]=_[_0xe400('0x2d')](_0x2645d8,_0xe400('0x27'));_0x53da2b[_0xe400('0x2e')]=_['keys'](_0x163783[_0xe400('0x2e')]);_0x53da2b[_0xe400('0x2f')]=_[_0xe400('0x30')](_0x53da2b['model'],_0x53da2b['query']);_0x5d92f7[_0xe400('0x31')]=_[_0xe400('0x30')](_0x53da2b[_0xe400('0x2c')],qs[_0xe400('0x32')](_0x163783[_0xe400('0x2e')][_0xe400('0x32')]));_0x5d92f7[_0xe400('0x31')]=_0x5d92f7[_0xe400('0x31')][_0xe400('0x33')]?_0x5d92f7[_0xe400('0x31')]:_0x53da2b[_0xe400('0x2c')];if(!_0x163783[_0xe400('0x2e')][_0xe400('0x34')]('nolimit')){_0x5d92f7[_0xe400('0x1e')]=qs[_0xe400('0x1e')](_0x163783[_0xe400('0x2e')][_0xe400('0x1e')]);_0x5d92f7[_0xe400('0x1d')]=qs[_0xe400('0x1d')](_0x163783[_0xe400('0x2e')][_0xe400('0x1d')]);}_0x5d92f7[_0xe400('0x35')]=qs[_0xe400('0x36')](_0x163783['query'][_0xe400('0x36')]);_0x5d92f7[_0xe400('0x37')]=qs[_0xe400('0x2f')](_[_0xe400('0x38')](_0x163783['query'],_0x53da2b[_0xe400('0x2f')]),_0x2645d8);if(_0x163783[_0xe400('0x2e')][_0xe400('0x39')]){_0x5d92f7[_0xe400('0x37')]=_['merge'](_0x5d92f7[_0xe400('0x37')],{'$or':_[_0xe400('0x2d')](_0x2645d8,function(_0x25c160){if(_0x25c160[_0xe400('0x2a')]!==_0xe400('0x3a')){var _0x12c0cf={};_0x12c0cf[_0x25c160[_0xe400('0x27')]]={'$like':'%'+_0x163783[_0xe400('0x2e')][_0xe400('0x39')]+'%'};return _0x12c0cf;}})});}_0x5d92f7=_['merge']({},_0x5d92f7,_0x163783[_0xe400('0x3b')]);var _0x30235c={'where':_0x5d92f7[_0xe400('0x37')]};return db[_0xe400('0x3c')][_0xe400('0x20')](_0x30235c)['then'](function(_0x369df9){_0x312ab8[_0xe400('0x20')]=_0x369df9;if(_0x163783[_0xe400('0x2e')][_0xe400('0x3d')]){_0x5d92f7[_0xe400('0x3e')]=[{'all':!![]}];}return db[_0xe400('0x3c')][_0xe400('0x3f')](_0x5d92f7);})['then'](function(_0x2e1f61){_0x312ab8['rows']=_0x2e1f61;return _0x312ab8;})[_0xe400('0x24')](respondWithFilteredResult(_0x68d476,_0x5d92f7))[_0xe400('0x40')](handleError(_0x68d476,null));};exports[_0xe400('0x41')]=function(_0x226fc5,_0x3cda6f){var _0x1d7f81={'raw':!![],'where':{'id':_0x226fc5['params']['id']}},_0x4fc69a={};_0x4fc69a[_0xe400('0x2c')]=_[_0xe400('0x42')](db['VoiceDialReport'][_0xe400('0x43')]);_0x4fc69a[_0xe400('0x2e')]=_['keys'](_0x226fc5[_0xe400('0x2e')]);_0x4fc69a[_0xe400('0x2f')]=_[_0xe400('0x30')](_0x4fc69a[_0xe400('0x2c')],_0x4fc69a[_0xe400('0x2e')]);_0x1d7f81[_0xe400('0x31')]=_[_0xe400('0x30')](_0x4fc69a[_0xe400('0x2c')],qs[_0xe400('0x32')](_0x226fc5['query'][_0xe400('0x32')]));_0x1d7f81[_0xe400('0x31')]=_0x1d7f81[_0xe400('0x31')][_0xe400('0x33')]?_0x1d7f81[_0xe400('0x31')]:_0x4fc69a[_0xe400('0x2c')];if(_0x226fc5[_0xe400('0x2e')][_0xe400('0x3d')]){_0x1d7f81[_0xe400('0x3e')]=[{'all':!![]}];}_0x1d7f81=_[_0xe400('0x44')]({},_0x1d7f81,_0x226fc5[_0xe400('0x3b')]);return db[_0xe400('0x3c')][_0xe400('0x45')](_0x1d7f81)[_0xe400('0x24')](handleEntityNotFound(_0x3cda6f,null))['then'](respondWithResult(_0x3cda6f,null))['catch'](handleError(_0x3cda6f,null));};exports['create']=function(_0x189d0e,_0x17cd46){return db[_0xe400('0x3c')][_0xe400('0x46')](_0x189d0e[_0xe400('0x47')],{})[_0xe400('0x24')](respondWithResult(_0x17cd46,0xc9))[_0xe400('0x40')](handleError(_0x17cd46,null));};exports[_0xe400('0x23')]=function(_0x33c776,_0x2d486c){if(_0x33c776[_0xe400('0x47')]['id']){delete _0x33c776[_0xe400('0x47')]['id'];}return db[_0xe400('0x3c')]['find']({'where':{'id':_0x33c776[_0xe400('0x48')]['id']}})[_0xe400('0x24')](handleEntityNotFound(_0x2d486c,null))[_0xe400('0x24')](saveUpdates(_0x33c776[_0xe400('0x47')],null))['then'](respondWithResult(_0x2d486c,null))[_0xe400('0x40')](handleError(_0x2d486c,null));};exports[_0xe400('0x49')]=function(_0x2326f9,_0x20a04c){return db[_0xe400('0x3c')]['find']({'where':{'id':_0x2326f9[_0xe400('0x48')]['id']}})['then'](handleEntityNotFound(_0x20a04c,null))[_0xe400('0x24')](removeEntity(_0x20a04c,null))[_0xe400('0x40')](handleError(_0x20a04c,null));};exports['describe']=function(_0x802a2d,_0x25d7a9){return db['VoiceDialReport'][_0xe400('0x4a')]()['then'](respondWithResult(_0x25d7a9,null))[_0xe400('0x40')](handleError(_0x25d7a9,null));}; \ No newline at end of file +var _0x3f01=['map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','VoiceDialReport','rawAttributes','fieldName','type','key','model'];(function(_0x31a5d8,_0xa79590){var _0x570eeb=function(_0x5ca3e9){while(--_0x5ca3e9){_0x31a5d8['push'](_0x31a5d8['shift']());}};_0x570eeb(++_0xa79590);}(_0x3f01,0x6b));var _0x13f0=function(_0x481bcf,_0x164043){_0x481bcf=_0x481bcf-0x0;var _0x13d9b6=_0x3f01[_0x481bcf];return _0x13d9b6;};'use strict';var emlformat=require(_0x13f0('0x0'));var rimraf=require(_0x13f0('0x1'));var zipdir=require(_0x13f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x13f0('0x3'));var moment=require(_0x13f0('0x4'));var BPromise=require(_0x13f0('0x5'));var Mustache=require(_0x13f0('0x6'));var util=require('util');var path=require(_0x13f0('0x7'));var sox=require(_0x13f0('0x8'));var csv=require('to-csv');var ejs=require(_0x13f0('0x9'));var fs=require('fs');var fs_extra=require(_0x13f0('0xa'));var _=require(_0x13f0('0xb'));var squel=require(_0x13f0('0xc'));var crypto=require(_0x13f0('0xd'));var jsforce=require(_0x13f0('0xe'));var deskjs=require(_0x13f0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x13f0('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x13f0('0x11'));var qs=require(_0x13f0('0x12'));var as=require(_0x13f0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x13f0('0x14'));var utils=require(_0x13f0('0x15'));var config=require(_0x13f0('0x16'));var licenseUtil=require(_0x13f0('0x17'));var db=require(_0x13f0('0x18'))['db'];function respondWithStatusCode(_0x181249,_0x1e4466){_0x1e4466=_0x1e4466||0xcc;return function(_0x422457){if(_0x422457){return _0x181249['sendStatus'](_0x1e4466);}return _0x181249[_0x13f0('0x19')](_0x1e4466)[_0x13f0('0x1a')]();};}function respondWithResult(_0x533ca4,_0x4301c4){_0x4301c4=_0x4301c4||0xc8;return function(_0x216175){if(_0x216175){return _0x533ca4[_0x13f0('0x19')](_0x4301c4)[_0x13f0('0x1b')](_0x216175);}};}function respondWithFilteredResult(_0x5e6ad0,_0x50bddd){return function(_0x3d9e05){if(_0x3d9e05){var _0x289e62=typeof _0x50bddd['offset']===_0x13f0('0x1c')&&typeof _0x50bddd['limit']===_0x13f0('0x1c');var _0x404b47=_0x3d9e05[_0x13f0('0x1d')];var _0x5a5589=_0x289e62?0x0:_0x50bddd[_0x13f0('0x1e')];var _0x1b8221=_0x289e62?_0x3d9e05['count']:_0x50bddd[_0x13f0('0x1e')]+_0x50bddd[_0x13f0('0x1f')];var _0x279ed4;if(_0x1b8221>=_0x404b47){_0x1b8221=_0x404b47;_0x279ed4=0xc8;}else{_0x279ed4=0xce;}_0x5e6ad0[_0x13f0('0x19')](_0x279ed4);return _0x5e6ad0[_0x13f0('0x20')](_0x13f0('0x21'),_0x5a5589+'-'+_0x1b8221+'/'+_0x404b47)[_0x13f0('0x1b')](_0x3d9e05);}return null;};}function patchUpdates(_0x128c43){return function(_0x99389b){try{jsonpatch[_0x13f0('0x22')](_0x99389b,_0x128c43,!![]);}catch(_0x450bec){return BPromise[_0x13f0('0x23')](_0x450bec);}return _0x99389b[_0x13f0('0x24')]();};}function saveUpdates(_0x4933e5,_0x485af4){return function(_0x2fc08d){if(_0x2fc08d){return _0x2fc08d['update'](_0x4933e5)['then'](function(_0xe95ccd){return _0xe95ccd;});}return null;};}function removeEntity(_0x15347e,_0x26bb27){return function(_0x5ae15c){if(_0x5ae15c){return _0x5ae15c[_0x13f0('0x25')]()[_0x13f0('0x26')](function(){_0x15347e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x723a4e,_0x3a0119){return function(_0x21896e){if(!_0x21896e){_0x723a4e[_0x13f0('0x27')](0x194);}return _0x21896e;};}function handleError(_0x3ce418,_0xb8a56a){_0xb8a56a=_0xb8a56a||0x1f4;return function(_0xd6b465){logger[_0x13f0('0x28')](_0xd6b465[_0x13f0('0x29')]);if(_0xd6b465[_0x13f0('0x2a')]){delete _0xd6b465[_0x13f0('0x2a')];}_0x3ce418[_0x13f0('0x19')](_0xb8a56a)[_0x13f0('0x2b')](_0xd6b465);};}exports[_0x13f0('0x2c')]=function(_0x32e09f,_0x385cc9){var _0x36727b={},_0xa856a2={},_0x274a06={'count':0x0,'rows':[]};var _0x5d1bd3=_['map'](db[_0x13f0('0x2d')][_0x13f0('0x2e')],function(_0x13d9f6){return{'name':_0x13d9f6[_0x13f0('0x2f')],'type':_0x13d9f6[_0x13f0('0x30')][_0x13f0('0x31')]};});_0xa856a2[_0x13f0('0x32')]=_[_0x13f0('0x33')](_0x5d1bd3,_0x13f0('0x2a'));_0xa856a2['query']=_[_0x13f0('0x34')](_0x32e09f[_0x13f0('0x35')]);_0xa856a2[_0x13f0('0x36')]=_[_0x13f0('0x37')](_0xa856a2['model'],_0xa856a2[_0x13f0('0x35')]);_0x36727b[_0x13f0('0x38')]=_[_0x13f0('0x37')](_0xa856a2[_0x13f0('0x32')],qs[_0x13f0('0x39')](_0x32e09f['query'][_0x13f0('0x39')]));_0x36727b[_0x13f0('0x38')]=_0x36727b[_0x13f0('0x38')][_0x13f0('0x3a')]?_0x36727b['attributes']:_0xa856a2['model'];if(!_0x32e09f[_0x13f0('0x35')][_0x13f0('0x3b')]('nolimit')){_0x36727b[_0x13f0('0x1f')]=qs[_0x13f0('0x1f')](_0x32e09f[_0x13f0('0x35')][_0x13f0('0x1f')]);_0x36727b['offset']=qs['offset'](_0x32e09f[_0x13f0('0x35')][_0x13f0('0x1e')]);}_0x36727b[_0x13f0('0x3c')]=qs[_0x13f0('0x3d')](_0x32e09f[_0x13f0('0x35')][_0x13f0('0x3d')]);_0x36727b[_0x13f0('0x3e')]=qs[_0x13f0('0x36')](_[_0x13f0('0x3f')](_0x32e09f[_0x13f0('0x35')],_0xa856a2[_0x13f0('0x36')]),_0x5d1bd3);if(_0x32e09f[_0x13f0('0x35')][_0x13f0('0x40')]){_0x36727b[_0x13f0('0x3e')]=_[_0x13f0('0x41')](_0x36727b[_0x13f0('0x3e')],{'$or':_['map'](_0x5d1bd3,function(_0x5d22b9){if(_0x5d22b9[_0x13f0('0x30')]!==_0x13f0('0x42')){var _0x336577={};_0x336577[_0x5d22b9[_0x13f0('0x2a')]]={'$like':'%'+_0x32e09f[_0x13f0('0x35')][_0x13f0('0x40')]+'%'};return _0x336577;}})});}_0x36727b=_[_0x13f0('0x41')]({},_0x36727b,_0x32e09f[_0x13f0('0x43')]);var _0x4a7e5f={'where':_0x36727b['where']};return db[_0x13f0('0x2d')][_0x13f0('0x1d')](_0x4a7e5f)[_0x13f0('0x26')](function(_0x5042c4){_0x274a06[_0x13f0('0x1d')]=_0x5042c4;if(_0x32e09f[_0x13f0('0x35')][_0x13f0('0x44')]){_0x36727b[_0x13f0('0x45')]=[{'all':!![]}];}return db[_0x13f0('0x2d')][_0x13f0('0x46')](_0x36727b);})['then'](function(_0x2437ba){_0x274a06[_0x13f0('0x47')]=_0x2437ba;return _0x274a06;})[_0x13f0('0x26')](respondWithFilteredResult(_0x385cc9,_0x36727b))['catch'](handleError(_0x385cc9,null));};exports[_0x13f0('0x48')]=function(_0x254cf7,_0x269dce){var _0x4f95c8={'raw':!![],'where':{'id':_0x254cf7[_0x13f0('0x49')]['id']}},_0x176d69={};_0x176d69[_0x13f0('0x32')]=_[_0x13f0('0x34')](db[_0x13f0('0x2d')][_0x13f0('0x2e')]);_0x176d69['query']=_[_0x13f0('0x34')](_0x254cf7[_0x13f0('0x35')]);_0x176d69[_0x13f0('0x36')]=_['intersection'](_0x176d69[_0x13f0('0x32')],_0x176d69['query']);_0x4f95c8[_0x13f0('0x38')]=_[_0x13f0('0x37')](_0x176d69[_0x13f0('0x32')],qs['fields'](_0x254cf7[_0x13f0('0x35')]['fields']));_0x4f95c8[_0x13f0('0x38')]=_0x4f95c8[_0x13f0('0x38')]['length']?_0x4f95c8[_0x13f0('0x38')]:_0x176d69[_0x13f0('0x32')];if(_0x254cf7['query'][_0x13f0('0x44')]){_0x4f95c8[_0x13f0('0x45')]=[{'all':!![]}];}_0x4f95c8=_[_0x13f0('0x41')]({},_0x4f95c8,_0x254cf7[_0x13f0('0x43')]);return db[_0x13f0('0x2d')]['find'](_0x4f95c8)[_0x13f0('0x26')](handleEntityNotFound(_0x269dce,null))[_0x13f0('0x26')](respondWithResult(_0x269dce,null))[_0x13f0('0x4a')](handleError(_0x269dce,null));};exports[_0x13f0('0x4b')]=function(_0x4d4602,_0x25f168){return db[_0x13f0('0x2d')][_0x13f0('0x4b')](_0x4d4602[_0x13f0('0x4c')],{})[_0x13f0('0x26')](respondWithResult(_0x25f168,0xc9))['catch'](handleError(_0x25f168,null));};exports['update']=function(_0x5f3810,_0x49d6e){if(_0x5f3810[_0x13f0('0x4c')]['id']){delete _0x5f3810[_0x13f0('0x4c')]['id'];}return db[_0x13f0('0x2d')][_0x13f0('0x4d')]({'where':{'id':_0x5f3810[_0x13f0('0x49')]['id']}})[_0x13f0('0x26')](handleEntityNotFound(_0x49d6e,null))['then'](saveUpdates(_0x5f3810[_0x13f0('0x4c')],null))[_0x13f0('0x26')](respondWithResult(_0x49d6e,null))['catch'](handleError(_0x49d6e,null));};exports['destroy']=function(_0x529595,_0x5ebeb9){return db[_0x13f0('0x2d')][_0x13f0('0x4d')]({'where':{'id':_0x529595[_0x13f0('0x49')]['id']}})[_0x13f0('0x26')](handleEntityNotFound(_0x5ebeb9,null))[_0x13f0('0x26')](removeEntity(_0x5ebeb9,null))[_0x13f0('0x4a')](handleError(_0x5ebeb9,null));};exports['describe']=function(_0x220498,_0x117a31){return db[_0x13f0('0x2d')][_0x13f0('0x4e')]()['then'](respondWithResult(_0x117a31,null))[_0x13f0('0x4a')](handleError(_0x117a31,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 6226900..5554259 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 _0x1a8f=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','api','bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes'];(function(_0x4509e9,_0x574854){var _0x1bb933=function(_0xee064e){while(--_0xee064e){_0x4509e9['push'](_0x4509e9['shift']());}};_0x1bb933(++_0x574854);}(_0x1a8f,0x88));var _0xf1a8=function(_0x31ddea,_0x40de6d){_0x31ddea=_0x31ddea-0x0;var _0x12539b=_0x1a8f[_0x31ddea];return _0x12539b;};'use strict';var _=require(_0xf1a8('0x0'));var util=require(_0xf1a8('0x1'));var logger=require('../../config/logger')(_0xf1a8('0x2'));var moment=require('moment');var BPromise=require(_0xf1a8('0x3'));var rp=require(_0xf1a8('0x4'));var fs=require('fs');var path=require(_0xf1a8('0x5'));var rimraf=require('rimraf');var config=require(_0xf1a8('0x6'));var attributes=require(_0xf1a8('0x7'));module['exports']=function(_0x47b8c3,_0x1057da){return _0x47b8c3[_0xf1a8('0x8')](_0xf1a8('0x9'),attributes,{'tableName':_0xf1a8('0xa'),'paranoid':![],'indexes':[{'fields':[_0xf1a8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe364=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','util','../../config/logger','moment','request-promise','path'];(function(_0x2302f0,_0x3626c2){var _0x9340f0=function(_0x213192){while(--_0x213192){_0x2302f0['push'](_0x2302f0['shift']());}};_0x9340f0(++_0x3626c2);}(_0xe364,0x1c3));var _0x4e36=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0xe364[_0x585d81];return _0x1aca0d;};'use strict';var _=require('lodash');var util=require(_0x4e36('0x0'));var logger=require(_0x4e36('0x1'))('api');var moment=require(_0x4e36('0x2'));var BPromise=require('bluebird');var rp=require(_0x4e36('0x3'));var fs=require('fs');var path=require(_0x4e36('0x4'));var rimraf=require(_0x4e36('0x5'));var config=require(_0x4e36('0x6'));var attributes=require(_0x4e36('0x7'));module[_0x4e36('0x8')]=function(_0x3c5e6b,_0x10019a){return _0x3c5e6b[_0x4e36('0x9')](_0x4e36('0xa'),attributes,{'tableName':_0x4e36('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index c8f71dc..1adfbb3 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 _0x982e=['then','CreateVoiceDialReport','debug','UpdateVoiceDialReport','raw','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','info','result','catch','VoiceDialReport','body','options'];(function(_0x3c6553,_0x9490df){var _0x206aa6=function(_0x2bad0d){while(--_0x2bad0d){_0x3c6553['push'](_0x3c6553['shift']());}};_0x206aa6(++_0x9490df);}(_0x982e,0x1b6));var _0xe982=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x982e[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe982('0x0'));var BPromise=require(_0xe982('0x1'));var rs=require(_0xe982('0x2'));var fs=require('fs');var Redis=require(_0xe982('0x3'));var db=require(_0xe982('0x4'))['db'];var utils=require(_0xe982('0x5'));var logger=require('../../config/logger')(_0xe982('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe982('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb8ea6a,_0x5ede82,_0x1bed18){return new BPromise(function(_0x2f6f54,_0x49450a){return client['request'](_0xb8ea6a,_0x1bed18)['then'](function(_0x12d032){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x5ede82,_0xe982('0x8'));logger['debug'](_0xe982('0x9'),_0x5ede82,'request\x20sent',JSON[_0xe982('0xa')](_0x12d032));if(_0x12d032[_0xe982('0xb')]){if(_0x12d032[_0xe982('0xb')][_0xe982('0xc')]===0x1f4){logger[_0xe982('0xb')](_0xe982('0xd'),_0x5ede82,_0x12d032[_0xe982('0xb')]['message']);return _0x49450a(_0x12d032['error'][_0xe982('0xe')]);}logger[_0xe982('0xb')](_0xe982('0xd'),_0x5ede82,_0x12d032['error'][_0xe982('0xe')]);return _0x2f6f54(_0x12d032[_0xe982('0xb')]['message']);}else{logger[_0xe982('0xf')](_0xe982('0xd'),_0x5ede82,'request\x20sent');_0x2f6f54(_0x12d032[_0xe982('0x10')]['message']);}})[_0xe982('0x11')](function(_0x2fad4c){logger[_0xe982('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x5ede82,_0x2fad4c);_0x49450a(_0x2fad4c);});});}exports['CreateVoiceDialReport']=function(_0x1c7904){var _0x194bfc=this;return new Promise(function(_0x2496ed,_0x15b846){return db[_0xe982('0x12')]['create'](_0x1c7904[_0xe982('0x13')],{'raw':_0x1c7904[_0xe982('0x14')]?_0x1c7904[_0xe982('0x14')]['raw']===undefined?!![]:![]:!![]})[_0xe982('0x15')](function(_0x4f0354){logger['info'](_0xe982('0x16'),_0x1c7904);logger[_0xe982('0x17')](_0xe982('0x16'),_0x1c7904,JSON['stringify'](_0x4f0354));_0x2496ed(_0x4f0354);})['catch'](function(_0x33216a){logger[_0xe982('0xb')](_0xe982('0x16'),_0x33216a[_0xe982('0xe')],_0x1c7904);_0x15b846(_0x194bfc[_0xe982('0xb')](0x1f4,_0x33216a[_0xe982('0xe')]));});});};exports[_0xe982('0x18')]=function(_0x2f1f8e){var _0x65d12c=this;return new Promise(function(_0x313e99,_0x22a53d){return db['VoiceDialReport']['update'](_0x2f1f8e[_0xe982('0x13')],{'raw':_0x2f1f8e[_0xe982('0x14')]?_0x2f1f8e['options'][_0xe982('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f1f8e['options']?_0x2f1f8e[_0xe982('0x14')]['where']||null:null,'attributes':_0x2f1f8e[_0xe982('0x14')]?_0x2f1f8e[_0xe982('0x14')]['attributes']||null:null,'limit':_0x2f1f8e[_0xe982('0x14')]?_0x2f1f8e[_0xe982('0x14')][_0xe982('0x1a')]||null:null})[_0xe982('0x15')](function(_0x364cac){logger[_0xe982('0xf')]('UpdateVoiceDialReport',_0x2f1f8e);logger[_0xe982('0x17')](_0xe982('0x18'),_0x2f1f8e,JSON[_0xe982('0xa')](_0x364cac));_0x313e99(_0x364cac);})[_0xe982('0x11')](function(_0x569a12){logger['error'](_0xe982('0x18'),_0x569a12[_0xe982('0xe')],_0x2f1f8e);_0x22a53d(_0x65d12c[_0xe982('0xb')](0x1f4,_0x569a12[_0xe982('0xe')]));});});}; \ No newline at end of file +var _0x3dad=['VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateVoiceDialReport','create','body','options','raw','stringify','UpdateVoiceDialReport','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2ecba8,_0x5f35d4){var _0x102719=function(_0x150974){while(--_0x150974){_0x2ecba8['push'](_0x2ecba8['shift']());}};_0x102719(++_0x5f35d4);}(_0x3dad,0x1b1));var _0xd3da=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x3dad[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xd3da('0x0'));var util=require(_0xd3da('0x1'));var moment=require(_0xd3da('0x2'));var BPromise=require(_0xd3da('0x3'));var rs=require(_0xd3da('0x4'));var fs=require('fs');var Redis=require(_0xd3da('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd3da('0x6'));var logger=require('../../config/logger')(_0xd3da('0x7'));var config=require(_0xd3da('0x8'));var jayson=require(_0xd3da('0x9'));var client=jayson[_0xd3da('0xa')][_0xd3da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a7f53,_0x4558c7,_0x4fb451){return new BPromise(function(_0x470bb7,_0x4d6e7f){return client[_0xd3da('0xc')](_0x3a7f53,_0x4fb451)[_0xd3da('0xd')](function(_0x3829a0){logger[_0xd3da('0xe')](_0xd3da('0xf'),_0x4558c7,_0xd3da('0x10'));logger[_0xd3da('0x11')](_0xd3da('0x12'),_0x4558c7,_0xd3da('0x10'),JSON['stringify'](_0x3829a0));if(_0x3829a0[_0xd3da('0x13')]){if(_0x3829a0[_0xd3da('0x13')]['code']===0x1f4){logger[_0xd3da('0x13')](_0xd3da('0xf'),_0x4558c7,_0x3829a0[_0xd3da('0x13')]['message']);return _0x4d6e7f(_0x3829a0['error'][_0xd3da('0x14')]);}logger[_0xd3da('0x13')](_0xd3da('0xf'),_0x4558c7,_0x3829a0[_0xd3da('0x13')][_0xd3da('0x14')]);return _0x470bb7(_0x3829a0[_0xd3da('0x13')][_0xd3da('0x14')]);}else{logger['info'](_0xd3da('0xf'),_0x4558c7,_0xd3da('0x10'));_0x470bb7(_0x3829a0[_0xd3da('0x15')][_0xd3da('0x14')]);}})[_0xd3da('0x16')](function(_0x12c22b){logger['error'](_0xd3da('0xf'),_0x4558c7,_0x12c22b);_0x4d6e7f(_0x12c22b);});});}exports[_0xd3da('0x17')]=function(_0x23bcdb){var _0x584cfb=this;return new Promise(function(_0x59b8a3,_0x59ac57){return db['VoiceDialReport'][_0xd3da('0x18')](_0x23bcdb[_0xd3da('0x19')],{'raw':_0x23bcdb[_0xd3da('0x1a')]?_0x23bcdb[_0xd3da('0x1a')][_0xd3da('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x5198b1){logger[_0xd3da('0xe')]('CreateVoiceDialReport',_0x23bcdb);logger[_0xd3da('0x11')]('CreateVoiceDialReport',_0x23bcdb,JSON[_0xd3da('0x1c')](_0x5198b1));_0x59b8a3(_0x5198b1);})[_0xd3da('0x16')](function(_0x10414b){logger[_0xd3da('0x13')]('CreateVoiceDialReport',_0x10414b[_0xd3da('0x14')],_0x23bcdb);_0x59ac57(_0x584cfb[_0xd3da('0x13')](0x1f4,_0x10414b[_0xd3da('0x14')]));});});};exports[_0xd3da('0x1d')]=function(_0x12d0f7){var _0x55c3a9=this;return new Promise(function(_0x4caa1e,_0x1370ed){return db['VoiceDialReport']['update'](_0x12d0f7[_0xd3da('0x19')],{'raw':_0x12d0f7[_0xd3da('0x1a')]?_0x12d0f7['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12d0f7[_0xd3da('0x1a')]?_0x12d0f7[_0xd3da('0x1a')][_0xd3da('0x1e')]||null:null,'attributes':_0x12d0f7[_0xd3da('0x1a')]?_0x12d0f7['options'][_0xd3da('0x1f')]||null:null,'limit':_0x12d0f7[_0xd3da('0x1a')]?_0x12d0f7[_0xd3da('0x1a')]['limit']||null:null})[_0xd3da('0xd')](function(_0x3ef33f){logger['info']('UpdateVoiceDialReport',_0x12d0f7);logger[_0xd3da('0x11')](_0xd3da('0x1d'),_0x12d0f7,JSON['stringify'](_0x3ef33f));_0x4caa1e(_0x3ef33f);})[_0xd3da('0x16')](function(_0x43def5){logger[_0xd3da('0x13')](_0xd3da('0x1d'),_0x43def5[_0xd3da('0x14')],_0x12d0f7);_0x1370ed(_0x55c3a9[_0xd3da('0x13')](0x1f4,_0x43def5[_0xd3da('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 0c81faf..1ce33fa 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 _0xc658=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy'];(function(_0x4081a5,_0x27e9e2){var _0x59f5d9=function(_0x5b7420){while(--_0x5b7420){_0x4081a5['push'](_0x4081a5['shift']());}};_0x59f5d9(++_0x27e9e2);}(_0xc658,0x1ee));var _0x8c65=function(_0x587e41,_0x2c5dc1){_0x587e41=_0x587e41-0x0;var _0x227b7b=_0xc658[_0x587e41];return _0x227b7b;};'use strict';var multer=require(_0x8c65('0x0'));var util=require(_0x8c65('0x1'));var path=require(_0x8c65('0x2'));var timeout=require(_0x8c65('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8c65('0x4'));var auth=require(_0x8c65('0x5'));var interaction=require(_0x8c65('0x6'));var config=require(_0x8c65('0x7'));var controller=require(_0x8c65('0x8'));router[_0x8c65('0x9')]('/',auth[_0x8c65('0xa')](),controller[_0x8c65('0xb')]);router[_0x8c65('0x9')](_0x8c65('0xc'),auth[_0x8c65('0xa')](),controller[_0x8c65('0xd')]);router[_0x8c65('0xe')]('/',auth[_0x8c65('0xa')](),controller['create']);router[_0x8c65('0xe')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x8c65('0xf')](_0x8c65('0xc'),auth[_0x8c65('0xa')](),controller[_0x8c65('0x10')]);router[_0x8c65('0x11')](_0x8c65('0xc'),auth['isAuthenticated'](),controller[_0x8c65('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb713=['update','delete','destroy','exports','multer','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','show','post','create','addApplications','put','/:id'];(function(_0x2cc459,_0x366f6b){var _0x173f60=function(_0x55ebca){while(--_0x55ebca){_0x2cc459['push'](_0x2cc459['shift']());}};_0x173f60(++_0x366f6b);}(_0xb713,0x94));var _0x3b71=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0xb713[_0x100e36];return _0x1df0c9;};'use strict';var multer=require(_0x3b71('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3b71('0x1')]();var fs_extra=require(_0x3b71('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x3b71('0x3'));var config=require(_0x3b71('0x4'));var controller=require(_0x3b71('0x5'));router['get']('/',auth[_0x3b71('0x6')](),controller[_0x3b71('0x7')]);router['get']('/:id',auth[_0x3b71('0x6')](),controller[_0x3b71('0x8')]);router[_0x3b71('0x9')]('/',auth[_0x3b71('0x6')](),controller[_0x3b71('0xa')]);router[_0x3b71('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x3b71('0xb')]);router[_0x3b71('0xc')](_0x3b71('0xd'),auth['isAuthenticated'](),controller[_0x3b71('0xe')]);router[_0x3b71('0xf')](_0x3b71('0xd'),auth[_0x3b71('0x6')](),controller[_0x3b71('0x10')]);module[_0x3b71('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 a4f79fb..1a0bb63 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 _0x3c7e=['ENUM','inbound','outbound','inbound-fax','outbound-fax','any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','exports','STRING','compositeIndex'];(function(_0x1b56cb,_0x5071bb){var _0x5a5e28=function(_0xf9aebe){while(--_0xf9aebe){_0x1b56cb['push'](_0x1b56cb['shift']());}};_0x5a5e28(++_0x5071bb);}(_0x3c7e,0x84));var _0xe3c7=function(_0xe80e5c,_0x38e90a){_0xe80e5c=_0xe80e5c-0x0;var _0x2bff61=_0x3c7e[_0xe80e5c];return _0x2bff61;};'use strict';var Sequelize=require('sequelize');module[_0xe3c7('0x0')]={'context':{'type':Sequelize[_0xe3c7('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xe3c7('0x1')],'allowNull':![],'unique':_0xe3c7('0x2')},'priority':{'type':Sequelize[_0xe3c7('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xe3c7('0x2')},'tag':{'type':Sequelize[_0xe3c7('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xe3c7('0x1')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xe3c7('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe3c7('0x3')](_0xe3c7('0x4'),_0xe3c7('0x5'),'internal',_0xe3c7('0x6'),_0xe3c7('0x7'),'system',_0xe3c7('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0xe3c7('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xe3c7('0x9')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xe3c7('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xe3c7('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xe3c7('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xe3c7('0x9')]},'recordingFormat':{'type':Sequelize[_0xe3c7('0x1')],'defaultValue':_0xe3c7('0xb')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xe3c7('0xc')],'get':function(_0x3a0b96){return this[_0xe3c7('0xd')](_0xe3c7('0xe'));}},'alias':{'type':Sequelize[_0xe3c7('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x31be=['wav','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','outbound','internal','inbound-fax','system','*,*,*,*','INTEGER','BOOLEAN'];(function(_0x162511,_0x2beb61){var _0xfa31ed=function(_0x42dec5){while(--_0x42dec5){_0x162511['push'](_0x162511['shift']());}};_0xfa31ed(++_0x2beb61);}(_0x31be,0x121));var _0xe31b=function(_0x34c888,_0x16112e){_0x34c888=_0x34c888-0x0;var _0x129999=_0x31be[_0x34c888];return _0x129999;};'use strict';var Sequelize=require(_0xe31b('0x0'));module['exports']={'context':{'type':Sequelize[_0xe31b('0x1')],'allowNull':![],'unique':_0xe31b('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xe31b('0x1')],'allowNull':![],'unique':_0xe31b('0x2')},'priority':{'type':Sequelize[_0xe31b('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xe31b('0x2')},'tag':{'type':Sequelize[_0xe31b('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xe31b('0x1')],'allowNull':![],'defaultValue':_0xe31b('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xe31b('0x4'),_0xe31b('0x5'),_0xe31b('0x6'),'outbound-fax',_0xe31b('0x7'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xe31b('0x1')]},'interval':{'type':Sequelize[_0xe31b('0x1')],'allowNull':![],'defaultValue':_0xe31b('0x8')},'IntervalId':{'type':Sequelize[_0xe31b('0x9')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xe31b('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xe31b('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xe31b('0x9')]},'recordingFormat':{'type':Sequelize[_0xe31b('0x1')],'defaultValue':_0xe31b('0xb')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xe31b('0xc')],'get':function(_0x2338b6){return this[_0xe31b('0xd')](_0xe31b('0xe'));}},'alias':{'type':Sequelize[_0xe31b('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 61d1579..0fe6965 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 _0xdfa0=['isApp','createRouting','cast(priority\x20as\x20unsigned)','finally','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','destroy','then','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','sendStatus','error','stack','send','index','VoiceExtension','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','length','create','body','startsWith','concat','exten','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','cutdigits','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findOne','VoiceExtensionId'];(function(_0x504ad6,_0x21b431){var _0x2f7e36=function(_0x3ab1db){while(--_0x3ab1db){_0x504ad6['push'](_0x504ad6['shift']());}};_0x2f7e36(++_0x21b431);}(_0xdfa0,0x170));var _0x0dfa=function(_0x2b5539,_0xde0bd0){_0x2b5539=_0x2b5539-0x0;var _0x560474=_0xdfa0[_0x2b5539];return _0x560474;};'use strict';var _=require(_0x0dfa('0x0'));var Redis=require('ioredis');var qs=require(_0x0dfa('0x1'));var logger=require(_0x0dfa('0x2'))('api');var config=require(_0x0dfa('0x3'));var db=require(_0x0dfa('0x4'))['db'];config[_0x0dfa('0x5')]=_[_0x0dfa('0x6')](config[_0x0dfa('0x5')],{'host':_0x0dfa('0x7'),'port':0x18eb});var socket=require(_0x0dfa('0x8'))(new Redis(config[_0x0dfa('0x5')]));require(_0x0dfa('0x9'))[_0x0dfa('0xa')](socket);function respondWithStatusCode(_0x50bd72,_0x20249d){_0x20249d=_0x20249d||0xcc;return function(_0x5414a1){if(_0x5414a1){return _0x50bd72['sendStatus'](_0x20249d);}return _0x50bd72[_0x0dfa('0xb')](_0x20249d)[_0x0dfa('0xc')]();};}function respondWithResult(_0x5c2279,_0x26d6bf){_0x26d6bf=_0x26d6bf||0xc8;return function(_0x41c78d){if(_0x41c78d){return _0x5c2279[_0x0dfa('0xb')](_0x26d6bf)[_0x0dfa('0xd')](_0x41c78d);}};}function respondWithFilteredResult(_0x41e266,_0x577b57){return function(_0x3beea2){if(_0x3beea2){var _0x2adaff=typeof _0x577b57[_0x0dfa('0xe')]===_0x0dfa('0xf')&&typeof _0x577b57[_0x0dfa('0x10')]==='undefined';var _0x19088b=_0x3beea2[_0x0dfa('0x11')];var _0x5cbadf=_0x2adaff?0x0:_0x577b57['offset'];var _0x3595dc=_0x2adaff?_0x3beea2[_0x0dfa('0x11')]:_0x577b57[_0x0dfa('0xe')]+_0x577b57['limit'];var _0x4cbe68;if(_0x3595dc>=_0x19088b){_0x3595dc=_0x19088b;_0x4cbe68=0xc8;}else{_0x4cbe68=0xce;}_0x41e266[_0x0dfa('0xb')](_0x4cbe68);return _0x41e266['set'](_0x0dfa('0x12'),_0x5cbadf+'-'+_0x3595dc+'/'+_0x19088b)['json'](_0x3beea2);}return null;};}function removeEntity(_0x377ad3){return function(_0x23a72d){if(_0x23a72d){return _0x23a72d[_0x0dfa('0x13')]()[_0x0dfa('0x14')](function(){var _0x12ea52=_0x23a72d[_0x0dfa('0x15')]({'plain':!![]});var _0x546458=[{'name':'InboundRoutes','value':_0x0dfa('0x16'),'ignore':![]},{'name':_0x0dfa('0x17'),'value':_0x0dfa('0x18'),'ignore':![]},{'name':_0x0dfa('0x19'),'value':_0x0dfa('0x1a'),'ignore':![]}];var _0x1ae63b=_(_0x546458)[_0x0dfa('0x1b')](_0x0dfa('0x1c'))[_0x0dfa('0x1d')](_0x0dfa('0x1e'))[_0x0dfa('0x1e')]();if(_[_0x0dfa('0x1f')](_0x1ae63b,_0x12ea52[_0x0dfa('0x20')])){return;}var _0x4c8d74=_[_0x0dfa('0x21')](_0x546458,['value',_0x12ea52['type']])[_0x0dfa('0x22')];return db[_0x0dfa('0x23')][_0x0dfa('0x13')]({'where':{'type':_0x4c8d74,'resourceId':_0x12ea52['id']}})[_0x0dfa('0x14')](function(){return _0x23a72d;});})[_0x0dfa('0x14')](function(){_0x377ad3[_0x0dfa('0xb')](0xcc)[_0x0dfa('0xc')]();});}};}function handleEntityNotFound(_0x4147fd){return function(_0x405c1a){if(!_0x405c1a){_0x4147fd[_0x0dfa('0x24')](0x194);}return _0x405c1a;};}function handleError(_0x5aae18,_0x3478c3){_0x3478c3=_0x3478c3||0x1f4;return function(_0x513e89){logger[_0x0dfa('0x25')](_0x513e89[_0x0dfa('0x26')]);if(_0x513e89[_0x0dfa('0x22')]){delete _0x513e89[_0x0dfa('0x22')];}_0x5aae18[_0x0dfa('0xb')](_0x3478c3)[_0x0dfa('0x27')](_0x513e89);};}exports[_0x0dfa('0x28')]=function(_0x1818b6,_0x12d72c){var _0x19c1ac={},_0x47bc07={},_0x49ba65={'count':0x0,'rows':[]};var _0x249802=_[_0x0dfa('0x1d')](db[_0x0dfa('0x29')]['rawAttributes'],function(_0x4ceb59){return{'name':_0x4ceb59['fieldName'],'type':_0x4ceb59['type']['key']};});_0x47bc07['model']=_[_0x0dfa('0x1d')](_0x249802,_0x0dfa('0x22'));_0x47bc07['query']=_[_0x0dfa('0x2a')](_0x1818b6[_0x0dfa('0x2b')]);_0x47bc07[_0x0dfa('0x2c')]=_[_0x0dfa('0x2d')](_0x47bc07['model'],_0x47bc07['query']);_0x19c1ac[_0x0dfa('0x2e')]=_['intersection'](_0x47bc07[_0x0dfa('0x2f')],qs[_0x0dfa('0x30')](_0x1818b6[_0x0dfa('0x2b')][_0x0dfa('0x30')]));_0x19c1ac[_0x0dfa('0x2e')]=_0x19c1ac[_0x0dfa('0x2e')]['length']?_0x19c1ac[_0x0dfa('0x2e')]:_0x47bc07[_0x0dfa('0x2f')];if(!_0x1818b6['query'][_0x0dfa('0x31')]('nolimit')){_0x19c1ac[_0x0dfa('0x10')]=qs['limit'](_0x1818b6[_0x0dfa('0x2b')][_0x0dfa('0x10')]);_0x19c1ac[_0x0dfa('0xe')]=qs[_0x0dfa('0xe')](_0x1818b6[_0x0dfa('0x2b')][_0x0dfa('0xe')]);}_0x19c1ac[_0x0dfa('0x32')]=qs['sort'](_0x1818b6[_0x0dfa('0x2b')][_0x0dfa('0x33')]);_0x19c1ac[_0x0dfa('0x34')]=qs[_0x0dfa('0x2c')](_[_0x0dfa('0x35')](_0x1818b6[_0x0dfa('0x2b')],_0x47bc07[_0x0dfa('0x2c')]),_0x249802);if(_0x1818b6[_0x0dfa('0x2b')]['filter']){_0x19c1ac[_0x0dfa('0x34')]=_[_0x0dfa('0x36')](_0x19c1ac[_0x0dfa('0x34')],{'$or':_[_0x0dfa('0x1d')](_0x249802,function(_0x12f9b0){if(_0x12f9b0[_0x0dfa('0x20')]!==_0x0dfa('0x37')){var _0x1a7b93={};_0x1a7b93[_0x12f9b0['name']]={'$like':'%'+_0x1818b6[_0x0dfa('0x2b')][_0x0dfa('0x1b')]+'%'};return _0x1a7b93;}})});}_0x19c1ac=_[_0x0dfa('0x36')]({},_0x19c1ac,_0x1818b6[_0x0dfa('0x38')]);var _0x2428b7={'where':_0x19c1ac['where']};return db['VoiceExtension']['count'](_0x2428b7)[_0x0dfa('0x14')](function(_0x198172){_0x49ba65['count']=_0x198172;if(_0x1818b6[_0x0dfa('0x2b')][_0x0dfa('0x39')]){_0x19c1ac['include']=[{'all':!![]}];}return db[_0x0dfa('0x29')][_0x0dfa('0x3a')](_0x19c1ac);})[_0x0dfa('0x14')](function(_0xadaba1){_0x49ba65[_0x0dfa('0x3b')]=_0xadaba1;return _0x49ba65;})[_0x0dfa('0x14')](respondWithFilteredResult(_0x12d72c,_0x19c1ac))[_0x0dfa('0x3c')](handleError(_0x12d72c,null));};exports['show']=function(_0x477842,_0x441f02){var _0xd6b39c={'raw':![],'where':{'id':_0x477842[_0x0dfa('0x3d')]['id']}},_0x28467f={};_0x28467f['model']=_['keys'](db[_0x0dfa('0x29')][_0x0dfa('0x3e')]);_0x28467f[_0x0dfa('0x2b')]=_[_0x0dfa('0x2a')](_0x477842[_0x0dfa('0x2b')]);_0x28467f[_0x0dfa('0x2c')]=_[_0x0dfa('0x2d')](_0x28467f[_0x0dfa('0x2f')],_0x28467f['query']);_0xd6b39c[_0x0dfa('0x2e')]=_[_0x0dfa('0x2d')](_0x28467f['model'],qs[_0x0dfa('0x30')](_0x477842[_0x0dfa('0x2b')][_0x0dfa('0x30')]));_0xd6b39c['attributes']=_0xd6b39c[_0x0dfa('0x2e')][_0x0dfa('0x3f')]?_0xd6b39c[_0x0dfa('0x2e')]:_0x28467f[_0x0dfa('0x2f')];if(_0x477842[_0x0dfa('0x2b')][_0x0dfa('0x39')]){_0xd6b39c['include']=[{'all':!![]}];}_0xd6b39c=_[_0x0dfa('0x36')]({},_0xd6b39c,_0x477842[_0x0dfa('0x38')]);return db[_0x0dfa('0x29')][_0x0dfa('0x21')](_0xd6b39c)['then'](handleEntityNotFound(_0x441f02,null))[_0x0dfa('0x14')](respondWithResult(_0x441f02,null))['catch'](handleError(_0x441f02,null));};exports[_0x0dfa('0x13')]=function(_0x3d8913,_0x42ab9d){return db[_0x0dfa('0x29')][_0x0dfa('0x21')]({'where':{'id':_0x3d8913[_0x0dfa('0x3d')]['id']}})['then'](handleEntityNotFound(_0x42ab9d,null))['then'](removeEntity(_0x42ab9d,null))[_0x0dfa('0x3c')](handleError(_0x42ab9d,null));};exports[_0x0dfa('0x40')]=function(_0x2925f6,_0x53868f){if(_0x2925f6[_0x0dfa('0x41')]['type']===_0x0dfa('0x18')&&!_[_0x0dfa('0x42')](_0x2925f6[_0x0dfa('0x41')]['exten'],'_')){_0x2925f6['body']['exten']='_'[_0x0dfa('0x43')](_0x2925f6[_0x0dfa('0x41')][_0x0dfa('0x44')]);}return db['VoiceExtension'][_0x0dfa('0x40')](_0x2925f6[_0x0dfa('0x41')],{'raw':![]})['then'](function(_0x55959c){var _0x1aa27d=_0x2925f6['user'][_0x0dfa('0x15')]({'plain':!![]});if(!_0x1aa27d)throw new Error(_0x0dfa('0x45'));if(_0x1aa27d[_0x0dfa('0x46')]===_0x0dfa('0x47')){var _0x4bb406=_0x55959c['get']({'plain':!![]});var _0x489391=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x0dfa('0x17'),'value':'outbound'},{'name':'InternalRoutes','value':_0x0dfa('0x1a')}];var _0x2645de=_[_0x0dfa('0x21')](_0x489391,[_0x0dfa('0x1e'),_0x4bb406[_0x0dfa('0x20')]])[_0x0dfa('0x22')];return db[_0x0dfa('0x48')]['find']({'where':{'name':_0x2645de,'userProfileId':_0x1aa27d[_0x0dfa('0x49')]},'raw':!![]})['then'](function(_0x4ef116){if(_0x4ef116&&_0x4ef116[_0x0dfa('0x4a')]===0x0){return db[_0x0dfa('0x23')][_0x0dfa('0x40')]({'name':_0x4bb406[_0x0dfa('0x22')],'resourceId':_0x4bb406['id'],'type':_0x4ef116[_0x0dfa('0x22')],'sectionId':_0x4ef116['id']},{})['then'](function(){return _0x55959c;});}else{return _0x55959c;}})[_0x0dfa('0x3c')](function(_0x247764){logger[_0x0dfa('0x25')](_0x0dfa('0x4b'),_0x247764);throw _0x247764;});}return _0x55959c;})[_0x0dfa('0x14')](respondWithResult(_0x53868f,0xc9))['catch'](handleError(_0x53868f,null));};exports[_0x0dfa('0x4c')]=function(_0x46817d,_0x515046){if(_0x46817d[_0x0dfa('0x41')]['id']){delete _0x46817d[_0x0dfa('0x41')]['id'];}return db[_0x0dfa('0x29')][_0x0dfa('0x21')]({'where':{'id':_0x46817d[_0x0dfa('0x3d')]['id']}})[_0x0dfa('0x14')](handleEntityNotFound(_0x515046,null))[_0x0dfa('0x14')](function(_0x1e237f){if(_0x1e237f){return db['VoiceExtension']['update'](_[_0x0dfa('0x35')](_0x46817d['body'],[_0x0dfa('0x44'),_0x0dfa('0x4d'),_0x0dfa('0x4e'),'recordingFormat',_0x0dfa('0x4f'),'mandatoryDisposition','alias']),{'where':{'context':_0x1e237f[_0x0dfa('0x4d')],'exten':_0x1e237f['exten']},'individualHooks':!![]})[_0x0dfa('0x14')](function(_0x13d917){return _0x13d917;});}return null;})['then'](respondWithStatusCode(_0x515046,null))['catch'](handleError(_0x515046,null));};exports[_0x0dfa('0x50')]=function(_0x2fc2d6,_0x650753){var _0x36e8a0=_0x2fc2d6['params']['id'];var _0x58a348=_0x2fc2d6[_0x0dfa('0x41')];var _0x23538f=0xc8;var _0x4860d8=null;return db[_0x0dfa('0x51')][_0x0dfa('0x52')]({'isolationLevel':db[_0x0dfa('0x51')][_0x0dfa('0x53')]['ISOLATION_LEVELS'][_0x0dfa('0x54')]},function(_0x40b077){return db[_0x0dfa('0x29')][_0x0dfa('0x55')]({'where':{'id':_0x36e8a0},'transaction':_0x40b077})[_0x0dfa('0x14')](function(_0x11e375){if(_0x11e375){return db[_0x0dfa('0x29')][_0x0dfa('0x13')]({'where':{'VoiceExtensionId':_0x36e8a0},'transaction':_0x40b077})[_0x0dfa('0x14')](function(){var _0x482711=_[_0x0dfa('0x1d')](_0x58a348,function(_0x23e822){_0x23e822[_0x0dfa('0x56')]=_0x36e8a0;_0x23e822[_0x0dfa('0x57')]=!![];return _0x23e822;});return _0x11e375[_0x0dfa('0x58')](_0x482711);})['then'](function(_0x1fffcf){return db['VoiceExtension']['bulkCreate'](_0x1fffcf,{'transaction':_0x40b077});});}else{_0x23538f=0x194;_0x4860d8=[];}});})[_0x0dfa('0x14')](function(){if(_0x23538f!==0x194){return db[_0x0dfa('0x29')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x36e8a0},'order':_0x0dfa('0x59')})[_0x0dfa('0x14')](function(_0x51e79c){_0x4860d8=_0x51e79c;});}})[_0x0dfa('0x3c')](function(_0x299d7f){_0x23538f=0x1f4;logger['error'](_0x299d7f[_0x0dfa('0x26')]);if(_0x299d7f[_0x0dfa('0x22')]){delete _0x299d7f[_0x0dfa('0x22')];}_0x4860d8=_0x299d7f;})[_0x0dfa('0x5a')](function(){if(_0x4860d8===null){_0x650753[_0x0dfa('0x24')](_0x23538f);}else{if(_0x23538f===0x1f4){_0x650753[_0x0dfa('0xb')](_0x23538f)['send'](_0x4860d8);}else{_0x650753['status'](_0x23538f)['json'](_0x4860d8);}}});}; \ No newline at end of file +var _0xcfd7=['rows','catch','show','params','rawAttributes','includeAll','create','body','startsWith','exten','concat','user','get','role','userProfileId','autoAssociation','update','context','description','recordingFormat','cutdigits','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','then','error','stack','send','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','VoiceExtension','include','findAll'];(function(_0x32b30c,_0x2d5ec8){var _0xcfc212=function(_0x42e668){while(--_0x42e668){_0x32b30c['push'](_0x32b30c['shift']());}};_0xcfc212(++_0x2d5ec8);}(_0xcfd7,0x1a0));var _0x7cfd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7cfd('0x0'));var Redis=require(_0x7cfd('0x1'));var qs=require(_0x7cfd('0x2'));var logger=require(_0x7cfd('0x3'))(_0x7cfd('0x4'));var config=require(_0x7cfd('0x5'));var db=require(_0x7cfd('0x6'))['db'];config[_0x7cfd('0x7')]=_[_0x7cfd('0x8')](config[_0x7cfd('0x7')],{'host':_0x7cfd('0x9'),'port':0x18eb});var socket=require(_0x7cfd('0xa'))(new Redis(config[_0x7cfd('0x7')]));require(_0x7cfd('0xb'))[_0x7cfd('0xc')](socket);function respondWithStatusCode(_0x1c93c5,_0x484b52){_0x484b52=_0x484b52||0xcc;return function(_0x59bc91){if(_0x59bc91){return _0x1c93c5[_0x7cfd('0xd')](_0x484b52);}return _0x1c93c5[_0x7cfd('0xe')](_0x484b52)[_0x7cfd('0xf')]();};}function respondWithResult(_0x2bf944,_0x3b6598){_0x3b6598=_0x3b6598||0xc8;return function(_0x164794){if(_0x164794){return _0x2bf944[_0x7cfd('0xe')](_0x3b6598)[_0x7cfd('0x10')](_0x164794);}};}function respondWithFilteredResult(_0x4e094b,_0x581ed0){return function(_0x2e594b){if(_0x2e594b){var _0x57b9d8=typeof _0x581ed0[_0x7cfd('0x11')]===_0x7cfd('0x12')&&typeof _0x581ed0[_0x7cfd('0x13')]===_0x7cfd('0x12');var _0x52788f=_0x2e594b[_0x7cfd('0x14')];var _0x5cd1d4=_0x57b9d8?0x0:_0x581ed0['offset'];var _0x474ff2=_0x57b9d8?_0x2e594b[_0x7cfd('0x14')]:_0x581ed0['offset']+_0x581ed0[_0x7cfd('0x13')];var _0x49894e;if(_0x474ff2>=_0x52788f){_0x474ff2=_0x52788f;_0x49894e=0xc8;}else{_0x49894e=0xce;}_0x4e094b['status'](_0x49894e);return _0x4e094b[_0x7cfd('0x15')](_0x7cfd('0x16'),_0x5cd1d4+'-'+_0x474ff2+'/'+_0x52788f)[_0x7cfd('0x10')](_0x2e594b);}return null;};}function removeEntity(_0x51230a){return function(_0x3ed6ab){if(_0x3ed6ab){return _0x3ed6ab[_0x7cfd('0x17')]()['then'](function(){var _0x6ea5b0=_0x3ed6ab['get']({'plain':!![]});var _0x158b16=[{'name':_0x7cfd('0x18'),'value':_0x7cfd('0x19'),'ignore':![]},{'name':_0x7cfd('0x1a'),'value':_0x7cfd('0x1b'),'ignore':![]},{'name':_0x7cfd('0x1c'),'value':_0x7cfd('0x1d'),'ignore':![]}];var _0x4f3853=_(_0x158b16)[_0x7cfd('0x1e')](_0x7cfd('0x1f'))[_0x7cfd('0x20')]('value')[_0x7cfd('0x21')]();if(_[_0x7cfd('0x22')](_0x4f3853,_0x6ea5b0[_0x7cfd('0x23')])){return;}var _0x4e9e42=_[_0x7cfd('0x24')](_0x158b16,[_0x7cfd('0x21'),_0x6ea5b0[_0x7cfd('0x23')]])[_0x7cfd('0x25')];return db[_0x7cfd('0x26')][_0x7cfd('0x17')]({'where':{'type':_0x4e9e42,'resourceId':_0x6ea5b0['id']}})['then'](function(){return _0x3ed6ab;});})[_0x7cfd('0x27')](function(){_0x51230a[_0x7cfd('0xe')](0xcc)[_0x7cfd('0xf')]();});}};}function handleEntityNotFound(_0x3746c8){return function(_0xd327f4){if(!_0xd327f4){_0x3746c8[_0x7cfd('0xd')](0x194);}return _0xd327f4;};}function handleError(_0x4fdeec,_0x25727e){_0x25727e=_0x25727e||0x1f4;return function(_0x4951f9){logger[_0x7cfd('0x28')](_0x4951f9[_0x7cfd('0x29')]);if(_0x4951f9[_0x7cfd('0x25')]){delete _0x4951f9[_0x7cfd('0x25')];}_0x4fdeec[_0x7cfd('0xe')](_0x25727e)[_0x7cfd('0x2a')](_0x4951f9);};}exports['index']=function(_0x5284d3,_0x55ea08){var _0x154c84={},_0x2ac60e={},_0x1f49ba={'count':0x0,'rows':[]};var _0x419a0a=_['map'](db['VoiceExtension']['rawAttributes'],function(_0x375ce7){return{'name':_0x375ce7[_0x7cfd('0x2b')],'type':_0x375ce7[_0x7cfd('0x23')][_0x7cfd('0x2c')]};});_0x2ac60e[_0x7cfd('0x2d')]=_[_0x7cfd('0x20')](_0x419a0a,'name');_0x2ac60e[_0x7cfd('0x2e')]=_[_0x7cfd('0x2f')](_0x5284d3['query']);_0x2ac60e[_0x7cfd('0x30')]=_[_0x7cfd('0x31')](_0x2ac60e[_0x7cfd('0x2d')],_0x2ac60e['query']);_0x154c84['attributes']=_[_0x7cfd('0x31')](_0x2ac60e[_0x7cfd('0x2d')],qs['fields'](_0x5284d3['query'][_0x7cfd('0x32')]));_0x154c84[_0x7cfd('0x33')]=_0x154c84[_0x7cfd('0x33')][_0x7cfd('0x34')]?_0x154c84[_0x7cfd('0x33')]:_0x2ac60e[_0x7cfd('0x2d')];if(!_0x5284d3[_0x7cfd('0x2e')][_0x7cfd('0x35')](_0x7cfd('0x36'))){_0x154c84[_0x7cfd('0x13')]=qs[_0x7cfd('0x13')](_0x5284d3[_0x7cfd('0x2e')]['limit']);_0x154c84[_0x7cfd('0x11')]=qs['offset'](_0x5284d3[_0x7cfd('0x2e')][_0x7cfd('0x11')]);}_0x154c84[_0x7cfd('0x37')]=qs[_0x7cfd('0x38')](_0x5284d3['query']['sort']);_0x154c84[_0x7cfd('0x39')]=qs[_0x7cfd('0x30')](_[_0x7cfd('0x3a')](_0x5284d3[_0x7cfd('0x2e')],_0x2ac60e['filters']),_0x419a0a);if(_0x5284d3[_0x7cfd('0x2e')]['filter']){_0x154c84[_0x7cfd('0x39')]=_[_0x7cfd('0x3b')](_0x154c84[_0x7cfd('0x39')],{'$or':_[_0x7cfd('0x20')](_0x419a0a,function(_0x3c72e3){if(_0x3c72e3['type']!=='VIRTUAL'){var _0x15c239={};_0x15c239[_0x3c72e3['name']]={'$like':'%'+_0x5284d3[_0x7cfd('0x2e')][_0x7cfd('0x1e')]+'%'};return _0x15c239;}})});}_0x154c84=_[_0x7cfd('0x3b')]({},_0x154c84,_0x5284d3[_0x7cfd('0x3c')]);var _0x59e5b6={'where':_0x154c84[_0x7cfd('0x39')]};return db[_0x7cfd('0x3d')]['count'](_0x59e5b6)[_0x7cfd('0x27')](function(_0x58ec87){_0x1f49ba[_0x7cfd('0x14')]=_0x58ec87;if(_0x5284d3[_0x7cfd('0x2e')]['includeAll']){_0x154c84[_0x7cfd('0x3e')]=[{'all':!![]}];}return db[_0x7cfd('0x3d')][_0x7cfd('0x3f')](_0x154c84);})['then'](function(_0x3a5d76){_0x1f49ba[_0x7cfd('0x40')]=_0x3a5d76;return _0x1f49ba;})[_0x7cfd('0x27')](respondWithFilteredResult(_0x55ea08,_0x154c84))[_0x7cfd('0x41')](handleError(_0x55ea08,null));};exports[_0x7cfd('0x42')]=function(_0x291ed1,_0x579842){var _0x79eb37={'raw':![],'where':{'id':_0x291ed1[_0x7cfd('0x43')]['id']}},_0x1a3397={};_0x1a3397['model']=_[_0x7cfd('0x2f')](db[_0x7cfd('0x3d')][_0x7cfd('0x44')]);_0x1a3397[_0x7cfd('0x2e')]=_[_0x7cfd('0x2f')](_0x291ed1['query']);_0x1a3397[_0x7cfd('0x30')]=_['intersection'](_0x1a3397[_0x7cfd('0x2d')],_0x1a3397[_0x7cfd('0x2e')]);_0x79eb37['attributes']=_[_0x7cfd('0x31')](_0x1a3397[_0x7cfd('0x2d')],qs[_0x7cfd('0x32')](_0x291ed1[_0x7cfd('0x2e')][_0x7cfd('0x32')]));_0x79eb37[_0x7cfd('0x33')]=_0x79eb37[_0x7cfd('0x33')]['length']?_0x79eb37[_0x7cfd('0x33')]:_0x1a3397[_0x7cfd('0x2d')];if(_0x291ed1[_0x7cfd('0x2e')][_0x7cfd('0x45')]){_0x79eb37[_0x7cfd('0x3e')]=[{'all':!![]}];}_0x79eb37=_[_0x7cfd('0x3b')]({},_0x79eb37,_0x291ed1[_0x7cfd('0x3c')]);return db['VoiceExtension'][_0x7cfd('0x24')](_0x79eb37)[_0x7cfd('0x27')](handleEntityNotFound(_0x579842,null))[_0x7cfd('0x27')](respondWithResult(_0x579842,null))['catch'](handleError(_0x579842,null));};exports[_0x7cfd('0x17')]=function(_0x217bfb,_0x2a4fe7){return db[_0x7cfd('0x3d')][_0x7cfd('0x24')]({'where':{'id':_0x217bfb[_0x7cfd('0x43')]['id']}})[_0x7cfd('0x27')](handleEntityNotFound(_0x2a4fe7,null))['then'](removeEntity(_0x2a4fe7,null))[_0x7cfd('0x41')](handleError(_0x2a4fe7,null));};exports[_0x7cfd('0x46')]=function(_0x153b23,_0x561c6e){if(_0x153b23[_0x7cfd('0x47')][_0x7cfd('0x23')]==='outbound'&&!_[_0x7cfd('0x48')](_0x153b23['body'][_0x7cfd('0x49')],'_')){_0x153b23[_0x7cfd('0x47')][_0x7cfd('0x49')]='_'[_0x7cfd('0x4a')](_0x153b23[_0x7cfd('0x47')][_0x7cfd('0x49')]);}return db[_0x7cfd('0x3d')][_0x7cfd('0x46')](_0x153b23['body'],{'raw':![]})[_0x7cfd('0x27')](function(_0x39f8d1){var _0x49b506=_0x153b23[_0x7cfd('0x4b')][_0x7cfd('0x4c')]({'plain':!![]});if(!_0x49b506)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49b506[_0x7cfd('0x4d')]===_0x7cfd('0x4b')){var _0xd34472=_0x39f8d1['get']({'plain':!![]});var _0x4e29f9=[{'name':_0x7cfd('0x18'),'value':_0x7cfd('0x19')},{'name':'OutboundRoutes','value':_0x7cfd('0x1b')},{'name':'InternalRoutes','value':_0x7cfd('0x1d')}];var _0x36e943=_[_0x7cfd('0x24')](_0x4e29f9,['value',_0xd34472['type']])[_0x7cfd('0x25')];return db['UserProfileSection'][_0x7cfd('0x24')]({'where':{'name':_0x36e943,'userProfileId':_0x49b506[_0x7cfd('0x4e')]},'raw':!![]})[_0x7cfd('0x27')](function(_0x4dfb3a){if(_0x4dfb3a&&_0x4dfb3a[_0x7cfd('0x4f')]===0x0){return db[_0x7cfd('0x26')][_0x7cfd('0x46')]({'name':_0xd34472[_0x7cfd('0x25')],'resourceId':_0xd34472['id'],'type':_0x4dfb3a[_0x7cfd('0x25')],'sectionId':_0x4dfb3a['id']},{})[_0x7cfd('0x27')](function(){return _0x39f8d1;});}else{return _0x39f8d1;}})[_0x7cfd('0x41')](function(_0x152fff){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x152fff);throw _0x152fff;});}return _0x39f8d1;})[_0x7cfd('0x27')](respondWithResult(_0x561c6e,0xc9))[_0x7cfd('0x41')](handleError(_0x561c6e,null));};exports[_0x7cfd('0x50')]=function(_0x3048a9,_0x1e06fe){if(_0x3048a9[_0x7cfd('0x47')]['id']){delete _0x3048a9['body']['id'];}return db[_0x7cfd('0x3d')]['find']({'where':{'id':_0x3048a9[_0x7cfd('0x43')]['id']}})['then'](handleEntityNotFound(_0x1e06fe,null))['then'](function(_0x4641fa){if(_0x4641fa){return db[_0x7cfd('0x3d')][_0x7cfd('0x50')](_[_0x7cfd('0x3a')](_0x3048a9[_0x7cfd('0x47')],[_0x7cfd('0x49'),_0x7cfd('0x51'),_0x7cfd('0x52'),_0x7cfd('0x53'),_0x7cfd('0x54'),'mandatoryDisposition',_0x7cfd('0x55')]),{'where':{'context':_0x4641fa[_0x7cfd('0x51')],'exten':_0x4641fa['exten']},'individualHooks':!![]})[_0x7cfd('0x27')](function(_0x9d418b){return _0x9d418b;});}return null;})[_0x7cfd('0x27')](respondWithStatusCode(_0x1e06fe,null))[_0x7cfd('0x41')](handleError(_0x1e06fe,null));};exports[_0x7cfd('0x56')]=function(_0x324e5f,_0x2c121b){var _0x1e3994=_0x324e5f[_0x7cfd('0x43')]['id'];var _0x35a407=_0x324e5f[_0x7cfd('0x47')];var _0x1025bf=0xc8;var _0x277fc3=null;return db[_0x7cfd('0x57')]['transaction']({'isolationLevel':db[_0x7cfd('0x57')][_0x7cfd('0x58')][_0x7cfd('0x59')]['READ_COMMITTED']},function(_0x181e4a){return db[_0x7cfd('0x3d')]['findOne']({'where':{'id':_0x1e3994},'transaction':_0x181e4a})['then'](function(_0x5d1aba){if(_0x5d1aba){return db[_0x7cfd('0x3d')][_0x7cfd('0x17')]({'where':{'VoiceExtensionId':_0x1e3994},'transaction':_0x181e4a})[_0x7cfd('0x27')](function(){var _0x367900=_['map'](_0x35a407,function(_0x383763){_0x383763['VoiceExtensionId']=_0x1e3994;_0x383763[_0x7cfd('0x5a')]=!![];return _0x383763;});return _0x5d1aba[_0x7cfd('0x5b')](_0x367900);})[_0x7cfd('0x27')](function(_0x418915){return db[_0x7cfd('0x3d')][_0x7cfd('0x5c')](_0x418915,{'transaction':_0x181e4a});});}else{_0x1025bf=0x194;_0x277fc3=[];}});})[_0x7cfd('0x27')](function(){if(_0x1025bf!==0x194){return db['VoiceExtension'][_0x7cfd('0x5d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1e3994},'order':_0x7cfd('0x5e')})[_0x7cfd('0x27')](function(_0xb20ec3){_0x277fc3=_0xb20ec3;});}})['catch'](function(_0x3b9956){_0x1025bf=0x1f4;logger[_0x7cfd('0x28')](_0x3b9956[_0x7cfd('0x29')]);if(_0x3b9956['name']){delete _0x3b9956[_0x7cfd('0x25')];}_0x277fc3=_0x3b9956;})[_0x7cfd('0x5f')](function(){if(_0x277fc3===null){_0x2c121b[_0x7cfd('0xd')](_0x1025bf);}else{if(_0x1025bf===0x1f4){_0x2c121b[_0x7cfd('0xe')](_0x1025bf)[_0x7cfd('0x2a')](_0x277fc3);}else{_0x2c121b[_0x7cfd('0xe')](_0x1025bf)['json'](_0x277fc3);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index f39c635..354c50e 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 _0x12fb=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1dccfd,_0x259542){var _0x5b3b8c=function(_0x214403){while(--_0x214403){_0x1dccfd['push'](_0x1dccfd['shift']());}};_0x5b3b8c(++_0x259542);}(_0x12fb,0x11e));var _0xb12f=function(_0x310273,_0x2c56f2){_0x310273=_0x310273-0x0;var _0x1542fa=_0x12fb[_0x310273];return _0x1542fa;};'use strict';var EventEmitter=require(_0xb12f('0x0'));var VoiceExtension=require(_0xb12f('0x1'))['db'][_0xb12f('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb12f('0x3')](0x0);var events={'afterCreate':_0xb12f('0x4'),'afterUpdate':_0xb12f('0x5'),'afterDestroy':_0xb12f('0x6')};function emitEvent(_0xac5fc4){return function(_0x125a61,_0x4e2d33,_0x10360c){VoiceExtensionEvents[_0xb12f('0x7')](_0xac5fc4+':'+_0x125a61['id'],_0x125a61);VoiceExtensionEvents[_0xb12f('0x7')](_0xac5fc4,_0x125a61);_0x10360c(null);};}for(var e in events){if(events[_0xb12f('0x8')](e)){var event=events[e];VoiceExtension[_0xb12f('0x9')](e,emitEvent(event));}}module[_0xb12f('0xa')]=VoiceExtensionEvents; \ No newline at end of file +var _0xe64f=['hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0xbd68f3,_0x1a79f8){var _0x2df7bf=function(_0x5e0d87){while(--_0x5e0d87){_0xbd68f3['push'](_0xbd68f3['shift']());}};_0x2df7bf(++_0x1a79f8);}(_0xe64f,0x13d));var _0xfe64=function(_0x48ef01,_0x1890ec){_0x48ef01=_0x48ef01-0x0;var _0x5c1bc4=_0xe64f[_0x48ef01];return _0x5c1bc4;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xfe64('0x0'))['db'][_0xfe64('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xfe64('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfe64('0x3'),'afterDestroy':_0xfe64('0x4')};function emitEvent(_0x3b8c65){return function(_0x53706d,_0x58e5ba,_0x3657b6){VoiceExtensionEvents[_0xfe64('0x5')](_0x3b8c65+':'+_0x53706d['id'],_0x53706d);VoiceExtensionEvents[_0xfe64('0x5')](_0x3b8c65,_0x53706d);_0x3657b6(null);};}for(var e in events){if(events[_0xfe64('0x6')](e)){var event=events[e];VoiceExtension[_0xfe64('0x7')](e,emitEvent(event));}}module[_0xfe64('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 0c2ea6d..0c0f785 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 _0xb6f1=['playback','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','priority','concat','last','define','VoiceExtension','voice_extensions','get','Hangup','lodash','exports','models','type','Set','CDR(type)=','exten','alias','NoOp','No\x20alias\x20set','context','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','split','length','name','phone','prefix','${EXTEN}','param','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','then','*,*,*,*','intervals','map','filter','IntervalId','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','queue'];(function(_0x4853a6,_0x33f9e7){var _0x22425d=function(_0x5b73fd){while(--_0x5b73fd){_0x4853a6['push'](_0x4853a6['shift']());}};_0x22425d(++_0x33f9e7);}(_0xb6f1,0x118));var _0x1b6f=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xb6f1[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x1b6f('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x1b6f('0x1')]=function(_0x569d4d){var _0x2474ac=_0x569d4d[_0x1b6f('0x2')];function _0x31957b(_0x4cd86b){var _0x2cd276=0x2;var _0x58afbb=[{'type':_0x4cd86b[_0x1b6f('0x3')],'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0x5')+_0x4cd86b['type'],'context':_0x4cd86b['context'],'exten':_0x4cd86b[_0x1b6f('0x6')],'priority':_0x2cd276++,'VoiceExtensionId':_0x4cd86b['id']},{'type':_0x4cd86b[_0x1b6f('0x3')],'app':_0x4cd86b[_0x1b6f('0x7')]?'Set':_0x1b6f('0x8'),'appdata':_0x4cd86b[_0x1b6f('0x7')]?'CDR(routeAlias)='+_0x4cd86b[_0x1b6f('0x7')]:_0x1b6f('0x9'),'context':_0x4cd86b[_0x1b6f('0xa')],'exten':_0x4cd86b[_0x1b6f('0x6')],'priority':_0x2cd276++,'VoiceExtensionId':_0x4cd86b['id']}];if(_0x4cd86b[_0x1b6f('0x3')]===_0x1b6f('0xb')){_0x58afbb['push']({'type':'inbound','app':_0x1b6f('0x4'),'appdata':_0x1b6f('0xc')+_0x4cd86b['id'],'context':_0x4cd86b[_0x1b6f('0xa')],'exten':_0x4cd86b[_0x1b6f('0x6')],'priority':_0x2cd276++,'VoiceExtensionId':_0x4cd86b['id']});}_0x58afbb[_0x1b6f('0xd')]({'type':_0x4cd86b[_0x1b6f('0x3')],'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0xe'),'context':_0x4cd86b[_0x1b6f('0xa')],'exten':_0x4cd86b[_0x1b6f('0x6')],'priority':_0x2cd276++,'VoiceExtensionId':_0x4cd86b['id']},{'type':_0x4cd86b[_0x1b6f('0x3')],'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0xf'),'context':_0x4cd86b[_0x1b6f('0xa')],'exten':_0x4cd86b[_0x1b6f('0x6')],'priority':_0x2cd276++,'VoiceExtensionId':_0x4cd86b['id']},{'type':_0x4cd86b[_0x1b6f('0x3')],'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0x10'),'context':_0x4cd86b[_0x1b6f('0xa')],'exten':_0x4cd86b[_0x1b6f('0x6')],'priority':_0x2cd276++,'VoiceExtensionId':_0x4cd86b['id']});return _0x58afbb;}function _0x54eec7(_0x57c825){var _0x214184=0x2;var _0x3da268=[{'type':_0x1b6f('0x11'),'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0x12'),'context':_0x57c825[_0x1b6f('0xa')],'exten':_0x57c825[_0x1b6f('0x6')],'priority':_0x214184++,'VoiceExtensionId':_0x57c825['id']},{'type':'outbound','app':_0x57c825[_0x1b6f('0x7')]?_0x1b6f('0x4'):_0x1b6f('0x8'),'appdata':_0x57c825['alias']?_0x1b6f('0x13')+_0x57c825[_0x1b6f('0x7')]:_0x1b6f('0x9'),'context':_0x57c825['context'],'exten':_0x57c825[_0x1b6f('0x6')],'priority':_0x214184++,'VoiceExtensionId':_0x57c825['id']},{'type':_0x1b6f('0x11'),'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0x14')+(_0x57c825[_0x1b6f('0x15')]?_0x1b6f('0x16')+_0x57c825[_0x1b6f('0x15')]+'}':'${EXTEN}'),'context':_0x57c825[_0x1b6f('0xa')],'exten':_0x57c825['exten'],'priority':_0x214184++,'VoiceExtensionId':_0x57c825['id']},{'type':_0x1b6f('0x11'),'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0xc')+_0x57c825['id'],'context':_0x57c825[_0x1b6f('0xa')],'exten':_0x57c825[_0x1b6f('0x6')],'priority':_0x214184++,'VoiceExtensionId':_0x57c825['id']},{'type':_0x1b6f('0x11'),'app':_0x1b6f('0x17'),'appdata':_0x1b6f('0x18')+(_0x214184+0x2)+_0x1b6f('0x19')+(_0x214184+0x1)+')','context':_0x57c825['context'],'exten':_0x57c825[_0x1b6f('0x6')],'priority':_0x214184++,'VoiceExtensionId':_0x57c825['id']},{'type':'outbound','app':_0x1b6f('0x4'),'appdata':_0x57c825['cutdigits']?_0x1b6f('0x1a')+_0x57c825['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x57c825[_0x1b6f('0xa')],'exten':_0x57c825[_0x1b6f('0x6')],'priority':_0x214184++,'VoiceExtensionId':_0x57c825['id']},{'type':_0x1b6f('0x11'),'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0xe'),'context':_0x57c825[_0x1b6f('0xa')],'exten':_0x57c825[_0x1b6f('0x6')],'priority':_0x214184++,'VoiceExtensionId':_0x57c825['id']},{'type':_0x1b6f('0x11'),'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0xf'),'context':_0x57c825['context'],'exten':_0x57c825[_0x1b6f('0x6')],'priority':_0x214184++,'VoiceExtensionId':_0x57c825['id']},{'type':'outbound','app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x57c825[_0x1b6f('0xa')],'exten':_0x57c825[_0x1b6f('0x6')],'priority':_0x214184++,'VoiceExtensionId':_0x57c825['id']},{'type':_0x1b6f('0x11'),'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0x1b')+_0x57c825['id'],'context':_0x57c825['context'],'exten':_0x57c825['exten'],'priority':_0x214184++,'VoiceExtensionId':_0x57c825['id']}];if(_0x57c825[_0x1b6f('0x1c')](_0x1b6f('0x1d'))&&_0x57c825[_0x1b6f('0x1d')]!==_0x1b6f('0x1e')){_0x3da268[_0x1b6f('0xd')]({'type':_0x1b6f('0x11'),'app':'Set','appdata':_0x1b6f('0x1f'),'context':_0x57c825[_0x1b6f('0xa')],'exten':_0x57c825['exten'],'priority':_0x214184++,'VoiceExtensionId':_0x57c825['id']},{'type':_0x1b6f('0x11'),'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0x20')+_0x57c825[_0x1b6f('0x1d')]||'wav','context':_0x57c825[_0x1b6f('0xa')],'exten':_0x57c825[_0x1b6f('0x6')],'priority':_0x214184++,'VoiceExtensionId':_0x57c825['id']});}return _0x3da268;}function _0x34491d(_0x1c7358,_0x2ed7a2){var _0x4c135f=[{'name':_0x1b6f('0x21'),'param':0x0},{'name':_0x1b6f('0x22'),'param':0x1},{'name':_0x1b6f('0x23'),'param':0x2},{'name':_0x1b6f('0x24'),'param':0x3}];var _0x5f0961={};var _0x1d2d12=_0x2ed7a2[_0x1b6f('0x25')](',');var _0x4f1459=[];for(var _0x17ce92=0x0;_0x17ce92<_0x4c135f[_0x1b6f('0x26')];_0x17ce92++){switch(_0x4c135f[_0x17ce92][_0x1b6f('0x27')]){case _0x1b6f('0x21'):_0x5f0961['trunk']=_0x1d2d12[_0x4c135f[_0x17ce92]['param']]['split']('/')[0x1];_0x5f0961[_0x1b6f('0x28')]=_0x1d2d12[_0x4c135f[_0x17ce92]['param']][_0x1b6f('0x25')]('/')[0x2];_0x5f0961[_0x1b6f('0x29')]=_0x5f0961['phone']?_0x5f0961['phone']['split']('$')[0x0]:undefined;_0x5f0961['phone']=_0x1c7358[_0x1b6f('0x15')]?(_0x5f0961['prefix']||'')+_0x1b6f('0x16')+_0x1c7358[_0x1b6f('0x15')]+'}':(_0x5f0961['prefix']||'')+_0x1b6f('0x2a');_0x4f1459[_0x4c135f[_0x17ce92][_0x1b6f('0x2b')]]=[_0x1b6f('0x2c'),_0x5f0961[_0x1b6f('0x21')],_0x5f0961[_0x1b6f('0x28')]][_0x1b6f('0x2d')]('/');break;case _0x1b6f('0x23'):_0x5f0961['options']=_0x1d2d12[_0x4c135f[_0x17ce92]['param']];if(_0x1c7358[_0x1b6f('0x1d')]!=='none'){if(_0x5f0961['options'][_0x1b6f('0x2e')](_0x1b6f('0x2f'))<0x0){_0x5f0961['options']+=_0x1b6f('0x2f');}}else{_0x5f0961[_0x1b6f('0x23')]=_0x5f0961[_0x1b6f('0x23')]['replace'](_0x1b6f('0x2f'),'');}_0x4f1459[_0x4c135f[_0x17ce92][_0x1b6f('0x2b')]]=_0x5f0961[_0x1b6f('0x23')];break;default:_0x4f1459[_0x4c135f[_0x17ce92]['param']]=_0x1d2d12[_0x4c135f[_0x17ce92][_0x1b6f('0x2b')]];}}return _0x4f1459[_0x1b6f('0x2d')](',');}function _0x269e39(_0x16e323,_0x42a713,_0x4edc33){return new Promise(function(_0x5240e0,_0x344623){var _0x389df8=[];if(_[_0x1b6f('0x30')](_0x42a713))return _0x5240e0(_0x389df8);_0x2474ac[_0x1b6f('0x31')][_0x1b6f('0x32')]({'attributes':['id',_0x1b6f('0x33'),'IntervalId'],'raw':!![]})[_0x1b6f('0x34')](function(_0x49aff2){for(var _0x2891e1=0x0,_0x566d2a=0x0;_0x2891e1<_0x42a713[_0x1b6f('0x26')];_0x2891e1++,_0x566d2a=0x0){var _0x582f66=_0x42a713[_0x2891e1];var _0x5db615=[];var _0x2d8d46=[];delete _0x582f66['id'];if(_0x582f66[_0x1b6f('0x33')]!==_0x1b6f('0x35')){_0x582f66[_0x1b6f('0x36')]=[_0x582f66[_0x1b6f('0x33')]];}else{_0x582f66[_0x1b6f('0x36')]=_0x582f66['IntervalId']?_[_0x1b6f('0x37')](_[_0x1b6f('0x38')](_0x49aff2,{'IntervalId':_0x582f66[_0x1b6f('0x39')]}),'interval'):[];}_0x582f66[_0x1b6f('0xa')]=_0x16e323[_0x1b6f('0xa')];_0x582f66[_0x1b6f('0x6')]=_0x16e323[_0x1b6f('0x6')];if(_0x582f66[_0x1b6f('0x3')])_0x582f66[_0x1b6f('0x3')]=_0x582f66[_0x1b6f('0x3')]['toLowerCase']();if(_0x16e323['type']==='outbound'){if(_0x582f66[_0x1b6f('0x1c')](_0x1b6f('0x3a'))&&_0x582f66['tag']&&_0x582f66[_0x1b6f('0x3a')]!=='--'){_0x5db615[_0x1b6f('0xd')]({'type':_0x582f66['type'][_0x1b6f('0x3b')](),'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0x3c')+_0x582f66[_0x1b6f('0x3a')],'context':_0x16e323[_0x1b6f('0xa')],'exten':_0x16e323['exten'],'priority':_0x582f66[_0x1b6f('0x36')][_0x1b6f('0x26')]+_0x4edc33+_0x566d2a++,'VoiceExtensionId':_0x16e323['id']});}_0x5db615['push']({'type':_0x582f66['type'][_0x1b6f('0x3b')](),'app':'ExecIf','appdata':_0x1b6f('0x3d')+(_0x582f66[_0x1b6f('0x3e')]?'Set(CALLERID(all)='+_0x582f66['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x16e323[_0x1b6f('0xa')],'exten':_0x16e323[_0x1b6f('0x6')],'priority':_0x582f66[_0x1b6f('0x36')][_0x1b6f('0x26')]+_0x4edc33+_0x566d2a++,'VoiceExtensionId':_0x16e323['id']});}else{if(_0x582f66[_0x1b6f('0x1c')]('answer')){if([_0x1b6f('0x3f'),_0x1b6f('0x40')][_0x1b6f('0x41')](_0x582f66[_0x1b6f('0x42')][_0x1b6f('0x3b')]())&&_0x582f66[_0x1b6f('0x43')]!==_0x1b6f('0x44')){if(_0x582f66[_0x1b6f('0x45')]){_0x5db615[_0x1b6f('0xd')]({'type':_0x582f66[_0x1b6f('0x3')]['toLowerCase'](),'app':'ExecIf','appdata':_0x1b6f('0x46'),'context':_0x16e323[_0x1b6f('0xa')],'exten':_0x16e323[_0x1b6f('0x6')],'priority':_0x582f66[_0x1b6f('0x36')][_0x1b6f('0x26')]+_0x4edc33+_0x566d2a++,'VoiceExtensionId':_0x16e323['id']});_0x5db615['push']({'type':_0x582f66['type']['toLowerCase'](),'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0x47'),'context':_0x16e323['context'],'exten':_0x16e323['exten'],'priority':_0x582f66[_0x1b6f('0x36')][_0x1b6f('0x26')]+_0x4edc33+_0x566d2a++,'VoiceExtensionId':_0x16e323['id']});}else{_0x5db615[_0x1b6f('0xd')]({'type':_0x582f66['type'][_0x1b6f('0x3b')](),'app':_0x1b6f('0x17'),'appdata':_0x1b6f('0x48'),'context':_0x16e323[_0x1b6f('0xa')],'exten':_0x16e323[_0x1b6f('0x6')],'priority':_0x582f66[_0x1b6f('0x36')][_0x1b6f('0x26')]+_0x4edc33+_0x566d2a++,'VoiceExtensionId':_0x16e323['id']});_0x5db615['push']({'type':_0x582f66[_0x1b6f('0x3')][_0x1b6f('0x3b')](),'app':_0x1b6f('0x4'),'appdata':_0x1b6f('0x49'),'context':_0x16e323['context'],'exten':_0x16e323[_0x1b6f('0x6')],'priority':_0x582f66['intervals']['length']+_0x4edc33+_0x566d2a++,'VoiceExtensionId':_0x16e323['id']});}}}}for(var _0x3d7f71=0x0;_0x3d7f71<_0x582f66['intervals'][_0x1b6f('0x26')];_0x3d7f71++){var _0x977d8b=_0x4edc33+_0x582f66[_0x1b6f('0x36')][_0x1b6f('0x26')];var _0x41de05=_0x3d7f71===_0x582f66[_0x1b6f('0x36')]['length']-0x1?_0x4edc33+_0x5db615['length']+_0x2d8d46[_0x1b6f('0x26')]+0x2:_0x4edc33+_0x3d7f71+0x1;_0x5db615[_0x1b6f('0x4a')](_0x3d7f71,0x0,{'type':_0x16e323['type'],'app':'GotoIfTime','appdata':_0x582f66[_0x1b6f('0x36')][_0x3d7f71]+'?'+_0x16e323[_0x1b6f('0xa')]+_0x1b6f('0x4b')+_0x977d8b+':'+_0x16e323[_0x1b6f('0xa')]+_0x1b6f('0x4b')+_0x41de05,'exten':_0x16e323['exten'],'context':_0x16e323[_0x1b6f('0xa')],'priority':_0x4edc33+_0x3d7f71,'VoiceExtensionId':_0x16e323['id']});}if(_0x582f66[_0x1b6f('0x43')]===_0x1b6f('0x4c'))_0x582f66[_0x1b6f('0x4d')]=_0x34491d(_0x16e323,_0x582f66[_0x1b6f('0x4d')]);_0x582f66[_0x1b6f('0x4e')]=_0x5db615['length']?_['last'](_0x5db615)[_0x1b6f('0x4e')]+0x1:_0x4edc33;_0x389df8=_[_0x1b6f('0x4f')](_0x389df8,_0x5db615,[_0x582f66],_0x2d8d46);_0x4edc33=_[_0x1b6f('0x50')](_0x389df8)[_0x1b6f('0x4e')]+0x1;}return _0x5240e0(_0x389df8);})['catch'](function(_0x2b7ba5){_0x344623(_0x2b7ba5);});});}return _0x569d4d[_0x1b6f('0x51')](_0x1b6f('0x52'),attributes,{'tableName':_0x1b6f('0x53'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x13d97d){var _0x579a9b=this[_0x1b6f('0x54')]({'plain':!![]});var _0x2650bb=_0x579a9b[_0x1b6f('0x3')]===_0x1b6f('0x11')?_0x54eec7(_0x579a9b):_0x31957b(_0x579a9b);return _0x269e39(_0x579a9b,_0x13d97d,_[_0x1b6f('0x50')](_0x2650bb)['priority']+0x1)['then'](function(_0x2a17b3){var _0x3bb878=_[_0x1b6f('0x4f')](_0x2650bb,_0x2a17b3);_0x3bb878[_0x1b6f('0xd')]({'type':_0x579a9b[_0x1b6f('0x3')],'app':_0x1b6f('0x55'),'exten':_0x579a9b[_0x1b6f('0x6')],'context':_0x579a9b[_0x1b6f('0xa')],'priority':_[_0x1b6f('0x50')](_0x3bb878)[_0x1b6f('0x4e')]+0x1,'VoiceExtensionId':_0x579a9b['id']});return _0x3bb878;});}}});}; \ No newline at end of file +var _0xa261=['exports','models','type','Set','CDR(type)=','context','NoOp','alias','No\x20alias\x20set','exten','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','split','length','name','trunk','param','phone','prefix','${EXTEN}','SIP','join','none','indexOf','U(xcally-mixmonitor-context)','replace','Interval','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','priority','concat','catch','define','VoiceExtension','Hangup','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa261,0x1a3));var _0x1a26=function(_0x28a225,_0x48c5b0){_0x28a225=_0x28a225-0x0;var _0x11f504=_0xa261[_0x28a225];return _0x11f504;};'use strict';var _=require(_0x1a26('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x1a26('0x1')]=function(_0x149e9b){var _0x4010fc=_0x149e9b[_0x1a26('0x2')];function _0x698831(_0x54f768){var _0x52360d=0x2;var _0x52a165=[{'type':_0x54f768[_0x1a26('0x3')],'app':_0x1a26('0x4'),'appdata':_0x1a26('0x5')+_0x54f768[_0x1a26('0x3')],'context':_0x54f768[_0x1a26('0x6')],'exten':_0x54f768['exten'],'priority':_0x52360d++,'VoiceExtensionId':_0x54f768['id']},{'type':_0x54f768[_0x1a26('0x3')],'app':_0x54f768['alias']?_0x1a26('0x4'):_0x1a26('0x7'),'appdata':_0x54f768[_0x1a26('0x8')]?'CDR(routeAlias)='+_0x54f768[_0x1a26('0x8')]:_0x1a26('0x9'),'context':_0x54f768[_0x1a26('0x6')],'exten':_0x54f768[_0x1a26('0xa')],'priority':_0x52360d++,'VoiceExtensionId':_0x54f768['id']}];if(_0x54f768[_0x1a26('0x3')]==='inbound'){_0x52a165[_0x1a26('0xb')]({'type':_0x1a26('0xc'),'app':_0x1a26('0x4'),'appdata':_0x1a26('0xd')+_0x54f768['id'],'context':_0x54f768[_0x1a26('0x6')],'exten':_0x54f768[_0x1a26('0xa')],'priority':_0x52360d++,'VoiceExtensionId':_0x54f768['id']});}_0x52a165['push']({'type':_0x54f768[_0x1a26('0x3')],'app':'Set','appdata':_0x1a26('0xe'),'context':_0x54f768[_0x1a26('0x6')],'exten':_0x54f768[_0x1a26('0xa')],'priority':_0x52360d++,'VoiceExtensionId':_0x54f768['id']},{'type':_0x54f768['type'],'app':_0x1a26('0x4'),'appdata':_0x1a26('0xf'),'context':_0x54f768[_0x1a26('0x6')],'exten':_0x54f768[_0x1a26('0xa')],'priority':_0x52360d++,'VoiceExtensionId':_0x54f768['id']},{'type':_0x54f768[_0x1a26('0x3')],'app':'Set','appdata':_0x1a26('0x10'),'context':_0x54f768[_0x1a26('0x6')],'exten':_0x54f768[_0x1a26('0xa')],'priority':_0x52360d++,'VoiceExtensionId':_0x54f768['id']});return _0x52a165;}function _0x43495c(_0xae2069){var _0x344c79=0x2;var _0x54b29c=[{'type':_0x1a26('0x11'),'app':'Set','appdata':'CDR(type)=outbound','context':_0xae2069['context'],'exten':_0xae2069[_0x1a26('0xa')],'priority':_0x344c79++,'VoiceExtensionId':_0xae2069['id']},{'type':_0x1a26('0x11'),'app':_0xae2069[_0x1a26('0x8')]?_0x1a26('0x4'):'NoOp','appdata':_0xae2069[_0x1a26('0x8')]?'CDR(routeAlias)='+_0xae2069[_0x1a26('0x8')]:_0x1a26('0x9'),'context':_0xae2069[_0x1a26('0x6')],'exten':_0xae2069[_0x1a26('0xa')],'priority':_0x344c79++,'VoiceExtensionId':_0xae2069['id']},{'type':'outbound','app':_0x1a26('0x4'),'appdata':_0x1a26('0x12')+(_0xae2069[_0x1a26('0x13')]?_0x1a26('0x14')+_0xae2069['cutdigits']+'}':'${EXTEN}'),'context':_0xae2069['context'],'exten':_0xae2069[_0x1a26('0xa')],'priority':_0x344c79++,'VoiceExtensionId':_0xae2069['id']},{'type':_0x1a26('0x11'),'app':_0x1a26('0x4'),'appdata':'CDR(routeid)='+_0xae2069['id'],'context':_0xae2069[_0x1a26('0x6')],'exten':_0xae2069[_0x1a26('0xa')],'priority':_0x344c79++,'VoiceExtensionId':_0xae2069['id']},{'type':_0x1a26('0x11'),'app':_0x1a26('0x15'),'appdata':_0x1a26('0x16')+(_0x344c79+0x2)+_0x1a26('0x17')+(_0x344c79+0x1)+')','context':_0xae2069['context'],'exten':_0xae2069[_0x1a26('0xa')],'priority':_0x344c79++,'VoiceExtensionId':_0xae2069['id']},{'type':_0x1a26('0x11'),'app':_0x1a26('0x4'),'appdata':_0xae2069[_0x1a26('0x13')]?_0x1a26('0x18')+_0xae2069[_0x1a26('0x13')]+'}':_0x1a26('0x19'),'context':_0xae2069[_0x1a26('0x6')],'exten':_0xae2069[_0x1a26('0xa')],'priority':_0x344c79++,'VoiceExtensionId':_0xae2069['id']},{'type':_0x1a26('0x11'),'app':_0x1a26('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xae2069[_0x1a26('0x6')],'exten':_0xae2069[_0x1a26('0xa')],'priority':_0x344c79++,'VoiceExtensionId':_0xae2069['id']},{'type':_0x1a26('0x11'),'app':_0x1a26('0x4'),'appdata':_0x1a26('0xf'),'context':_0xae2069[_0x1a26('0x6')],'exten':_0xae2069['exten'],'priority':_0x344c79++,'VoiceExtensionId':_0xae2069['id']},{'type':'outbound','app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0xae2069[_0x1a26('0x6')],'exten':_0xae2069[_0x1a26('0xa')],'priority':_0x344c79++,'VoiceExtensionId':_0xae2069['id']},{'type':'outbound','app':_0x1a26('0x4'),'appdata':_0x1a26('0x1a')+_0xae2069['id'],'context':_0xae2069[_0x1a26('0x6')],'exten':_0xae2069[_0x1a26('0xa')],'priority':_0x344c79++,'VoiceExtensionId':_0xae2069['id']}];if(_0xae2069[_0x1a26('0x1b')](_0x1a26('0x1c'))&&_0xae2069[_0x1a26('0x1c')]!=='none'){_0x54b29c['push']({'type':_0x1a26('0x11'),'app':_0x1a26('0x4'),'appdata':_0x1a26('0x1d'),'context':_0xae2069[_0x1a26('0x6')],'exten':_0xae2069[_0x1a26('0xa')],'priority':_0x344c79++,'VoiceExtensionId':_0xae2069['id']},{'type':'outbound','app':'Set','appdata':_0x1a26('0x1e')+_0xae2069['recordingFormat']||_0x1a26('0x1f'),'context':_0xae2069[_0x1a26('0x6')],'exten':_0xae2069[_0x1a26('0xa')],'priority':_0x344c79++,'VoiceExtensionId':_0xae2069['id']});}return _0x54b29c;}function _0x5ad1b3(_0x2eda1d,_0x40a9f9){var _0x1134d9=[{'name':'trunk','param':0x0},{'name':_0x1a26('0x20'),'param':0x1},{'name':_0x1a26('0x21'),'param':0x2},{'name':_0x1a26('0x22'),'param':0x3}];var _0x51e1f9={};var _0x2d1f63=_0x40a9f9[_0x1a26('0x23')](',');var _0x374d17=[];for(var _0x5e0b8a=0x0;_0x5e0b8a<_0x1134d9[_0x1a26('0x24')];_0x5e0b8a++){switch(_0x1134d9[_0x5e0b8a][_0x1a26('0x25')]){case _0x1a26('0x26'):_0x51e1f9[_0x1a26('0x26')]=_0x2d1f63[_0x1134d9[_0x5e0b8a][_0x1a26('0x27')]][_0x1a26('0x23')]('/')[0x1];_0x51e1f9[_0x1a26('0x28')]=_0x2d1f63[_0x1134d9[_0x5e0b8a]['param']][_0x1a26('0x23')]('/')[0x2];_0x51e1f9['prefix']=_0x51e1f9[_0x1a26('0x28')]?_0x51e1f9[_0x1a26('0x28')]['split']('$')[0x0]:undefined;_0x51e1f9[_0x1a26('0x28')]=_0x2eda1d['cutdigits']?(_0x51e1f9['prefix']||'')+_0x1a26('0x14')+_0x2eda1d[_0x1a26('0x13')]+'}':(_0x51e1f9[_0x1a26('0x29')]||'')+_0x1a26('0x2a');_0x374d17[_0x1134d9[_0x5e0b8a]['param']]=[_0x1a26('0x2b'),_0x51e1f9[_0x1a26('0x26')],_0x51e1f9[_0x1a26('0x28')]][_0x1a26('0x2c')]('/');break;case'options':_0x51e1f9[_0x1a26('0x21')]=_0x2d1f63[_0x1134d9[_0x5e0b8a][_0x1a26('0x27')]];if(_0x2eda1d['recordingFormat']!==_0x1a26('0x2d')){if(_0x51e1f9[_0x1a26('0x21')][_0x1a26('0x2e')](_0x1a26('0x2f'))<0x0){_0x51e1f9[_0x1a26('0x21')]+=_0x1a26('0x2f');}}else{_0x51e1f9[_0x1a26('0x21')]=_0x51e1f9[_0x1a26('0x21')][_0x1a26('0x30')](_0x1a26('0x2f'),'');}_0x374d17[_0x1134d9[_0x5e0b8a][_0x1a26('0x27')]]=_0x51e1f9[_0x1a26('0x21')];break;default:_0x374d17[_0x1134d9[_0x5e0b8a][_0x1a26('0x27')]]=_0x2d1f63[_0x1134d9[_0x5e0b8a]['param']];}}return _0x374d17[_0x1a26('0x2c')](',');}function _0x4d2e1d(_0x486fef,_0x888eff,_0x54c58f){return new Promise(function(_0x14cdca,_0x2536cb){var _0x5afc37=[];if(_['isEmpty'](_0x888eff))return _0x14cdca(_0x5afc37);_0x4010fc[_0x1a26('0x31')]['findAll']({'attributes':['id',_0x1a26('0x32'),_0x1a26('0x33')],'raw':!![]})[_0x1a26('0x34')](function(_0x4ea3cc){for(var _0x38c4c6=0x0,_0x13477e=0x0;_0x38c4c6<_0x888eff['length'];_0x38c4c6++,_0x13477e=0x0){var _0x499391=_0x888eff[_0x38c4c6];var _0x515b26=[];var _0x24da16=[];delete _0x499391['id'];if(_0x499391[_0x1a26('0x32')]!==_0x1a26('0x35')){_0x499391['intervals']=[_0x499391[_0x1a26('0x32')]];}else{_0x499391[_0x1a26('0x36')]=_0x499391[_0x1a26('0x33')]?_[_0x1a26('0x37')](_[_0x1a26('0x38')](_0x4ea3cc,{'IntervalId':_0x499391[_0x1a26('0x33')]}),_0x1a26('0x32')):[];}_0x499391[_0x1a26('0x6')]=_0x486fef['context'];_0x499391[_0x1a26('0xa')]=_0x486fef[_0x1a26('0xa')];if(_0x499391[_0x1a26('0x3')])_0x499391[_0x1a26('0x3')]=_0x499391[_0x1a26('0x3')][_0x1a26('0x39')]();if(_0x486fef[_0x1a26('0x3')]==='outbound'){if(_0x499391[_0x1a26('0x1b')](_0x1a26('0x3a'))&&_0x499391[_0x1a26('0x3a')]&&_0x499391[_0x1a26('0x3a')]!=='--'){_0x515b26[_0x1a26('0xb')]({'type':_0x499391[_0x1a26('0x3')][_0x1a26('0x39')](),'app':_0x1a26('0x4'),'appdata':'CDR(tag)='+_0x499391[_0x1a26('0x3a')],'context':_0x486fef[_0x1a26('0x6')],'exten':_0x486fef[_0x1a26('0xa')],'priority':_0x499391[_0x1a26('0x36')][_0x1a26('0x24')]+_0x54c58f+_0x13477e++,'VoiceExtensionId':_0x486fef['id']});}_0x515b26['push']({'type':_0x499391['type'][_0x1a26('0x39')](),'app':_0x1a26('0x15'),'appdata':_0x1a26('0x3b')+(_0x499391['callerID']?_0x1a26('0x3c')+_0x499391[_0x1a26('0x3d')]+')':_0x1a26('0x3e')),'context':_0x486fef[_0x1a26('0x6')],'exten':_0x486fef['exten'],'priority':_0x499391['intervals'][_0x1a26('0x24')]+_0x54c58f+_0x13477e++,'VoiceExtensionId':_0x486fef['id']});}else{if(_0x499391[_0x1a26('0x1b')](_0x1a26('0x3f'))){if([_0x1a26('0x40'),_0x1a26('0x41')]['includes'](_0x499391[_0x1a26('0x42')]['toLowerCase']())&&_0x499391[_0x1a26('0x43')]!==_0x1a26('0x44')){if(_0x499391[_0x1a26('0x3f')]){_0x515b26['push']({'type':_0x499391[_0x1a26('0x3')][_0x1a26('0x39')](),'app':'ExecIf','appdata':_0x1a26('0x45'),'context':_0x486fef[_0x1a26('0x6')],'exten':_0x486fef[_0x1a26('0xa')],'priority':_0x499391['intervals'][_0x1a26('0x24')]+_0x54c58f+_0x13477e++,'VoiceExtensionId':_0x486fef['id']});_0x515b26[_0x1a26('0xb')]({'type':_0x499391[_0x1a26('0x3')]['toLowerCase'](),'app':_0x1a26('0x4'),'appdata':_0x1a26('0x46'),'context':_0x486fef[_0x1a26('0x6')],'exten':_0x486fef['exten'],'priority':_0x499391[_0x1a26('0x36')][_0x1a26('0x24')]+_0x54c58f+_0x13477e++,'VoiceExtensionId':_0x486fef['id']});}else{_0x515b26[_0x1a26('0xb')]({'type':_0x499391[_0x1a26('0x3')]['toLowerCase'](),'app':_0x1a26('0x15'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x486fef[_0x1a26('0x6')],'exten':_0x486fef['exten'],'priority':_0x499391[_0x1a26('0x36')][_0x1a26('0x24')]+_0x54c58f+_0x13477e++,'VoiceExtensionId':_0x486fef['id']});_0x515b26[_0x1a26('0xb')]({'type':_0x499391[_0x1a26('0x3')][_0x1a26('0x39')](),'app':_0x1a26('0x4'),'appdata':_0x1a26('0x47'),'context':_0x486fef[_0x1a26('0x6')],'exten':_0x486fef[_0x1a26('0xa')],'priority':_0x499391['intervals'][_0x1a26('0x24')]+_0x54c58f+_0x13477e++,'VoiceExtensionId':_0x486fef['id']});}}}}for(var _0x3c8dd0=0x0;_0x3c8dd0<_0x499391[_0x1a26('0x36')][_0x1a26('0x24')];_0x3c8dd0++){var _0x3ea6ad=_0x54c58f+_0x499391[_0x1a26('0x36')][_0x1a26('0x24')];var _0x3ba9a8=_0x3c8dd0===_0x499391[_0x1a26('0x36')]['length']-0x1?_0x54c58f+_0x515b26[_0x1a26('0x24')]+_0x24da16[_0x1a26('0x24')]+0x2:_0x54c58f+_0x3c8dd0+0x1;_0x515b26[_0x1a26('0x48')](_0x3c8dd0,0x0,{'type':_0x486fef[_0x1a26('0x3')],'app':_0x1a26('0x49'),'appdata':_0x499391[_0x1a26('0x36')][_0x3c8dd0]+'?'+_0x486fef[_0x1a26('0x6')]+',${EXTEN},'+_0x3ea6ad+':'+_0x486fef[_0x1a26('0x6')]+_0x1a26('0x4a')+_0x3ba9a8,'exten':_0x486fef['exten'],'context':_0x486fef['context'],'priority':_0x54c58f+_0x3c8dd0,'VoiceExtensionId':_0x486fef['id']});}if(_0x499391[_0x1a26('0x43')]===_0x1a26('0x4b'))_0x499391[_0x1a26('0x4c')]=_0x5ad1b3(_0x486fef,_0x499391[_0x1a26('0x4c')]);_0x499391['priority']=_0x515b26[_0x1a26('0x24')]?_[_0x1a26('0x4d')](_0x515b26)[_0x1a26('0x4e')]+0x1:_0x54c58f;_0x5afc37=_[_0x1a26('0x4f')](_0x5afc37,_0x515b26,[_0x499391],_0x24da16);_0x54c58f=_[_0x1a26('0x4d')](_0x5afc37)[_0x1a26('0x4e')]+0x1;}return _0x14cdca(_0x5afc37);})[_0x1a26('0x50')](function(_0x376101){_0x2536cb(_0x376101);});});}return _0x149e9b[_0x1a26('0x51')](_0x1a26('0x52'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1ca6ab){var _0x4dd249=this['get']({'plain':!![]});var _0x381577=_0x4dd249[_0x1a26('0x3')]===_0x1a26('0x11')?_0x43495c(_0x4dd249):_0x698831(_0x4dd249);return _0x4d2e1d(_0x4dd249,_0x1ca6ab,_[_0x1a26('0x4d')](_0x381577)[_0x1a26('0x4e')]+0x1)[_0x1a26('0x34')](function(_0x6378a5){var _0x108f3c=_[_0x1a26('0x4f')](_0x381577,_0x6378a5);_0x108f3c[_0x1a26('0xb')]({'type':_0x4dd249[_0x1a26('0x3')],'app':_0x1a26('0x53'),'exten':_0x4dd249['exten'],'context':_0x4dd249[_0x1a26('0x6')],'priority':_['last'](_0x108f3c)['priority']+0x1,'VoiceExtensionId':_0x4dd249['id']});return _0x108f3c;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 80599ff..a42d2f3 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 _0x1696=['map','model','GetVoiceExtension','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','VoiceExtension','findAll','options','raw','attributes','limit','include'];(function(_0x1728b0,_0x1551c2){var _0x300b34=function(_0x3dd689){while(--_0x3dd689){_0x1728b0['push'](_0x1728b0['shift']());}};_0x300b34(++_0x1551c2);}(_0x1696,0x79));var _0x6169=function(_0x5b6c13,_0x3aa293){_0x5b6c13=_0x5b6c13-0x0;var _0x37c274=_0x1696[_0x5b6c13];return _0x37c274;};'use strict';var _=require(_0x6169('0x0'));var util=require('util');var moment=require(_0x6169('0x1'));var BPromise=require(_0x6169('0x2'));var rs=require(_0x6169('0x3'));var fs=require('fs');var Redis=require(_0x6169('0x4'));var db=require(_0x6169('0x5'))['db'];var utils=require(_0x6169('0x6'));var logger=require(_0x6169('0x7'))(_0x6169('0x8'));var config=require(_0x6169('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6169('0xa')][_0x6169('0xb')]({'port':0x232a});config[_0x6169('0xc')]=_[_0x6169('0xd')](config[_0x6169('0xc')],{'host':_0x6169('0xe'),'port':0x18eb});var socket=require(_0x6169('0xf'))(new Redis(config['redis']));require(_0x6169('0x10'))['register'](socket);function respondWithRpcPromise(_0x1cdeb4,_0x5d46d7,_0x5b5f33){return new BPromise(function(_0x46c85b,_0x2f714f){return client[_0x6169('0x11')](_0x1cdeb4,_0x5b5f33)[_0x6169('0x12')](function(_0x58df8b){logger['info'](_0x6169('0x13'),_0x5d46d7,_0x6169('0x14'));logger['debug'](_0x6169('0x15'),_0x5d46d7,_0x6169('0x14'),JSON[_0x6169('0x16')](_0x58df8b));if(_0x58df8b['error']){if(_0x58df8b['error']['code']===0x1f4){logger[_0x6169('0x17')](_0x6169('0x13'),_0x5d46d7,_0x58df8b[_0x6169('0x17')][_0x6169('0x18')]);return _0x2f714f(_0x58df8b[_0x6169('0x17')]['message']);}logger[_0x6169('0x17')](_0x6169('0x13'),_0x5d46d7,_0x58df8b['error'][_0x6169('0x18')]);return _0x46c85b(_0x58df8b['error'][_0x6169('0x18')]);}else{logger[_0x6169('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x5d46d7,_0x6169('0x14'));_0x46c85b(_0x58df8b[_0x6169('0x1a')][_0x6169('0x18')]);}})[_0x6169('0x1b')](function(_0xff7981){logger[_0x6169('0x17')](_0x6169('0x13'),_0x5d46d7,_0xff7981);_0x2f714f(_0xff7981);});});}exports['GetVoiceExtension']=function(_0x57a6b2){var _0x74a11d=this;return new Promise(function(_0x29b77a,_0x486186){return db[_0x6169('0x1c')][_0x6169('0x1d')]({'raw':_0x57a6b2[_0x6169('0x1e')]?_0x57a6b2[_0x6169('0x1e')][_0x6169('0x1f')]===undefined?!![]:![]:!![],'where':_0x57a6b2['options']?_0x57a6b2[_0x6169('0x1e')]['where']||null:null,'attributes':_0x57a6b2[_0x6169('0x1e')]?_0x57a6b2[_0x6169('0x1e')][_0x6169('0x20')]||null:null,'limit':_0x57a6b2['options']?_0x57a6b2[_0x6169('0x1e')][_0x6169('0x21')]||null:null,'include':_0x57a6b2['options']?_0x57a6b2['options'][_0x6169('0x22')]?_[_0x6169('0x23')](_0x57a6b2[_0x6169('0x1e')][_0x6169('0x22')],function(_0x1b207e){return{'model':db[_0x1b207e[_0x6169('0x24')]],'as':_0x1b207e['as'],'attributes':_0x1b207e[_0x6169('0x20')],'include':_0x1b207e[_0x6169('0x22')]?_['map'](_0x1b207e[_0x6169('0x22')],function(_0x5ba226){return{'model':db[_0x5ba226['model']],'as':_0x5ba226['as'],'attributes':_0x5ba226['attributes'],'include':_0x5ba226['include']?_[_0x6169('0x23')](_0x5ba226['include'],function(_0x4466f3){return{'model':db[_0x4466f3[_0x6169('0x24')]],'as':_0x4466f3['as'],'attributes':_0x4466f3[_0x6169('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51e2ea){logger['info'](_0x6169('0x25'),_0x57a6b2);logger[_0x6169('0x26')]('GetVoiceExtension',_0x57a6b2,JSON['stringify'](_0x51e2ea));_0x29b77a(_0x51e2ea);})[_0x6169('0x1b')](function(_0x182502){logger['error'](_0x6169('0x25'),_0x182502[_0x6169('0x18')],_0x57a6b2);_0x486186(_0x74a11d['error'](0x1f4,_0x182502['message']));});});}; \ No newline at end of file +var _0xae1c=['defaults','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','attributes','model','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4e5d42,_0xccc2f6){var _0x16a777=function(_0x28c4b0){while(--_0x28c4b0){_0x4e5d42['push'](_0x4e5d42['shift']());}};_0x16a777(++_0xccc2f6);}(_0xae1c,0xff));var _0xcae1=function(_0xb484da,_0x489c6c){_0xb484da=_0xb484da-0x0;var _0x4afd12=_0xae1c[_0xb484da];return _0x4afd12;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcae1('0x0'));var fs=require('fs');var Redis=require(_0xcae1('0x1'));var db=require(_0xcae1('0x2'))['db'];var utils=require(_0xcae1('0x3'));var logger=require(_0xcae1('0x4'))(_0xcae1('0x5'));var config=require(_0xcae1('0x6'));var jayson=require(_0xcae1('0x7'));var client=jayson[_0xcae1('0x8')][_0xcae1('0x9')]({'port':0x232a});config[_0xcae1('0xa')]=_[_0xcae1('0xb')](config[_0xcae1('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcae1('0xa')]));require(_0xcae1('0xc'))[_0xcae1('0xd')](socket);function respondWithRpcPromise(_0x4ecc7a,_0x13f721,_0xf8b5e7){return new BPromise(function(_0x6849f6,_0x4db664){return client[_0xcae1('0xe')](_0x4ecc7a,_0xf8b5e7)[_0xcae1('0xf')](function(_0x513c5f){logger['info'](_0xcae1('0x10'),_0x13f721,_0xcae1('0x11'));logger[_0xcae1('0x12')](_0xcae1('0x13'),_0x13f721,_0xcae1('0x11'),JSON[_0xcae1('0x14')](_0x513c5f));if(_0x513c5f[_0xcae1('0x15')]){if(_0x513c5f[_0xcae1('0x15')][_0xcae1('0x16')]===0x1f4){logger[_0xcae1('0x15')](_0xcae1('0x10'),_0x13f721,_0x513c5f[_0xcae1('0x15')][_0xcae1('0x17')]);return _0x4db664(_0x513c5f[_0xcae1('0x15')][_0xcae1('0x17')]);}logger['error'](_0xcae1('0x10'),_0x13f721,_0x513c5f[_0xcae1('0x15')]['message']);return _0x6849f6(_0x513c5f['error'][_0xcae1('0x17')]);}else{logger[_0xcae1('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x13f721,'request\x20sent');_0x6849f6(_0x513c5f[_0xcae1('0x19')]['message']);}})[_0xcae1('0x1a')](function(_0xde5ce5){logger[_0xcae1('0x15')](_0xcae1('0x10'),_0x13f721,_0xde5ce5);_0x4db664(_0xde5ce5);});});}exports[_0xcae1('0x1b')]=function(_0x418724){var _0x1e882a=this;return new Promise(function(_0x3dedf7,_0x11fda8){return db[_0xcae1('0x1c')][_0xcae1('0x1d')]({'raw':_0x418724[_0xcae1('0x1e')]?_0x418724[_0xcae1('0x1e')][_0xcae1('0x1f')]===undefined?!![]:![]:!![],'where':_0x418724['options']?_0x418724[_0xcae1('0x1e')][_0xcae1('0x20')]||null:null,'attributes':_0x418724[_0xcae1('0x1e')]?_0x418724[_0xcae1('0x1e')]['attributes']||null:null,'limit':_0x418724[_0xcae1('0x1e')]?_0x418724[_0xcae1('0x1e')][_0xcae1('0x21')]||null:null,'include':_0x418724[_0xcae1('0x1e')]?_0x418724[_0xcae1('0x1e')][_0xcae1('0x22')]?_[_0xcae1('0x23')](_0x418724[_0xcae1('0x1e')]['include'],function(_0x285b9a){return{'model':db[_0x285b9a['model']],'as':_0x285b9a['as'],'attributes':_0x285b9a[_0xcae1('0x24')],'include':_0x285b9a[_0xcae1('0x22')]?_['map'](_0x285b9a[_0xcae1('0x22')],function(_0x286717){return{'model':db[_0x286717[_0xcae1('0x25')]],'as':_0x286717['as'],'attributes':_0x286717['attributes'],'include':_0x286717['include']?_[_0xcae1('0x23')](_0x286717[_0xcae1('0x22')],function(_0xbba4eb){return{'model':db[_0xbba4eb[_0xcae1('0x25')]],'as':_0xbba4eb['as'],'attributes':_0xbba4eb[_0xcae1('0x24')]};}):[]};}):[]};}):[]:[]})[_0xcae1('0xf')](function(_0x3e7b1d){logger['info'](_0xcae1('0x1b'),_0x418724);logger[_0xcae1('0x12')](_0xcae1('0x1b'),_0x418724,JSON['stringify'](_0x3e7b1d));_0x3dedf7(_0x3e7b1d);})['catch'](function(_0x1889c5){logger['error'](_0xcae1('0x1b'),_0x1889c5[_0xcae1('0x17')],_0x418724);_0x11fda8(_0x1e882a[_0xcae1('0x15')](0x1f4,_0x1889c5[_0xcae1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 796cbed..1f3df35 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 _0x0295=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','update'];(function(_0x5e1e1e,_0x486214){var _0x37d744=function(_0x29ba88){while(--_0x29ba88){_0x5e1e1e['push'](_0x5e1e1e['shift']());}};_0x37d744(++_0x486214);}(_0x0295,0x1f0));var _0x5029=function(_0x97db75,_0x3abdb8){_0x97db75=_0x97db75-0x0;var _0x259a53=_0x0295[_0x97db75];return _0x259a53;};'use strict';var VoiceExtensionEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){VoiceExtensionEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);VoiceExtensionEvents['on'](_0x54978f,_0x4ee867);}}; \ No newline at end of file +var _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x579651,_0x3cd4b7){var _0x5e718a=function(_0x1654dc){while(--_0x1654dc){_0x579651['push'](_0x579651['shift']());}};_0x5e718a(++_0x3cd4b7);}(_0x53ec,0x192));var _0xc53e=function(_0x534b49,_0x464ea8){_0x534b49=_0x534b49-0x0;var _0x107e16=_0x53ec[_0x534b49];return _0x107e16;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 39288f4..2cb0338 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 _0x9536=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','create','put','update','delete','exports','multer'];(function(_0x2b3e77,_0x44c4e3){var _0x55c6c4=function(_0x50c525){while(--_0x50c525){_0x2b3e77['push'](_0x2b3e77['shift']());}};_0x55c6c4(++_0x44c4e3);}(_0x9536,0x179));var _0x6953=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0x9536[_0x2aefb6];return _0x202772;};'use strict';var multer=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var path=require(_0x6953('0x2'));var timeout=require(_0x6953('0x3'));var express=require('express');var router=express[_0x6953('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6953('0x5'));var interaction=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var controller=require(_0x6953('0x8'));router[_0x6953('0x9')]('/',auth['isAuthenticated'](),controller[_0x6953('0xa')]);router[_0x6953('0x9')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0xd')]);router['get'](_0x6953('0xe'),auth[_0x6953('0xc')](),controller[_0x6953('0xf')]);router['post']('/',auth[_0x6953('0xc')](),controller[_0x6953('0x10')]);router[_0x6953('0x11')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0x12')]);router[_0x6953('0x13')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller['destroy']);module[_0x6953('0x14')]=router; \ No newline at end of file +var _0xa46e=['delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','/:id/messages','create','put','update'];(function(_0x5a6c16,_0x4077fc){var _0x476a1e=function(_0x571db3){while(--_0x571db3){_0x5a6c16['push'](_0x5a6c16['shift']());}};_0x476a1e(++_0x4077fc);}(_0xa46e,0x8a));var _0xea46=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0xa46e[_0x836465];return _0x2150ea;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea46('0x6'));var controller=require('./voiceMail.controller');router[_0xea46('0x7')]('/',auth['isAuthenticated'](),controller[_0xea46('0x8')]);router[_0xea46('0x7')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0xa')]);router[_0xea46('0x7')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0xea46('0xc')]);router[_0xea46('0xd')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0xe')]);router[_0xea46('0xf')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 6658d00..588f981 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 _0x3461=['trim','central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','from-voicemail','contest_mailbox','STRING','email','string'];(function(_0x231b99,_0x3e2396){var _0x43abb0=function(_0x293599){while(--_0x293599){_0x231b99['push'](_0x231b99['shift']());}};_0x43abb0(++_0x3e2396);}(_0x3461,0x192));var _0x1346=function(_0x5c7ff5,_0x50506a){_0x5c7ff5=_0x5c7ff5-0x0;var _0x29824c=_0x3461[_0x5c7ff5];return _0x29824c;};'use strict';var Sequelize=require(_0x1346('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x1346('0x1'),'unique':_0x1346('0x2')},'mailbox':{'type':Sequelize[_0x1346('0x3')],'defaultValue':'','allowNull':![],'unique':_0x1346('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x1346('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x2bb04c){this['setDataValue'](_0x1346('0x4'),typeof _0x2bb04c===_0x1346('0x5')&&_0x2bb04c[_0x1346('0x6')]()?_0x2bb04c[_0x1346('0x6')]():null);}},'pager':{'type':Sequelize[_0x1346('0x3')]},'tz':{'type':Sequelize[_0x1346('0x3')],'defaultValue':_0x1346('0x7')},'attach':{'type':Sequelize[_0x1346('0x8')](_0x1346('0x9'),'no'),'defaultValue':_0x1346('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1346('0x8')](_0x1346('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x1346('0x3')]},'callback':{'type':Sequelize[_0x1346('0x3')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1346('0x8')](_0x1346('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1346('0x8')](_0x1346('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1346('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1346('0x8')](_0x1346('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1346('0x8')](_0x1346('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1346('0x8')](_0x1346('0x9'),'no'),'defaultValue':_0x1346('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1346('0x8')](_0x1346('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1346('0x8')](_0x1346('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x1346('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x1346('0x3')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1346('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1346('0xc')],'get':function(){return this[_0x1346('0xd')](_0x1346('0xe'))+_0x1346('0xf')+this[_0x1346('0xd')](_0x1346('0x10'));}}}; \ No newline at end of file +var _0x5b1f=['string','trim','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','email'];(function(_0x413078,_0x413b75){var _0xeb6d6c=function(_0x53aad5){while(--_0x53aad5){_0x413078['push'](_0x413078['shift']());}};_0xeb6d6c(++_0x413b75);}(_0x5b1f,0x64));var _0xf5b1=function(_0x5af341,_0x2765a9){_0x5af341=_0x5af341-0x0;var _0x2c6383=_0x5b1f[_0x5af341];return _0x2c6383;};'use strict';var Sequelize=require(_0xf5b1('0x0'));module[_0xf5b1('0x1')]={'customer_id':{'type':Sequelize[_0xf5b1('0x2')]},'context':{'type':Sequelize[_0xf5b1('0x2')],'defaultValue':'from-voicemail','unique':_0xf5b1('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xf5b1('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x18e92e){this['setDataValue'](_0xf5b1('0x4'),typeof _0x18e92e===_0xf5b1('0x5')&&_0x18e92e['trim']()?_0x18e92e[_0xf5b1('0x6')]():null);}},'pager':{'type':Sequelize[_0xf5b1('0x2')]},'tz':{'type':Sequelize[_0xf5b1('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xf5b1('0x7')](_0xf5b1('0x8'),'no'),'defaultValue':_0xf5b1('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xf5b1('0x7')]('yes','no'),'defaultValue':_0xf5b1('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xf5b1('0x2')]},'callback':{'type':Sequelize[_0xf5b1('0x2')]},'review':{'type':Sequelize[_0xf5b1('0x7')](_0xf5b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xf5b1('0x7')](_0xf5b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xf5b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xf5b1('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf5b1('0x7')](_0xf5b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf5b1('0x7')](_0xf5b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xf5b1('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf5b1('0x7')](_0xf5b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf5b1('0x7')](_0xf5b1('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xf5b1('0x9')},'emailsubject':{'type':Sequelize[_0xf5b1('0x2')]},'emailbody':{'type':Sequelize[_0xf5b1('0x2')]},'maxsecs':{'type':Sequelize[_0xf5b1('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xf5b1('0xb')],'get':function(){return this['getDataValue'](_0xf5b1('0xc'))+_0xf5b1('0xd')+this['getDataValue'](_0xf5b1('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 79f6d37..d4a8cd6 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 _0x757a=['../../config/license/hardware','../../config/logger','api','status','json','offset','undefined','count','limit','Content-Range','apply','update','then','get','Voicemails','UserProfileResource','destroy','end','error','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','hasOwnProperty','findAndCountAll','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x197b18,_0x585112){var _0xe23ec1=function(_0x2c37f8){while(--_0x2c37f8){_0x197b18['push'](_0x197b18['shift']());}};_0xe23ec1(++_0x585112);}(_0x757a,0xde));var _0xa757=function(_0x212520,_0x1399a4){_0x212520=_0x212520-0x0;var _0x591017=_0x757a[_0x212520];return _0x591017;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db68e,_0x421040){_0x421040=_0x421040||0xcc;return function(_0x544b45){if(_0x544b45){return _0x4db68e['sendStatus'](_0x421040);}return _0x4db68e[_0xa757('0x15')](_0x421040)['end']();};}function respondWithResult(_0x481508,_0x32112b){_0x32112b=_0x32112b||0xc8;return function(_0x1b670e){if(_0x1b670e){return _0x481508[_0xa757('0x15')](_0x32112b)[_0xa757('0x16')](_0x1b670e);}};}function respondWithFilteredResult(_0x86abd,_0x31cfd2){return function(_0xf12b68){if(_0xf12b68){var _0x2f7947=typeof _0x31cfd2[_0xa757('0x17')]===_0xa757('0x18')&&typeof _0x31cfd2['limit']===_0xa757('0x18');var _0x44eab8=_0xf12b68[_0xa757('0x19')];var _0x4d9f58=_0x2f7947?0x0:_0x31cfd2['offset'];var _0x151c04=_0x2f7947?_0xf12b68[_0xa757('0x19')]:_0x31cfd2[_0xa757('0x17')]+_0x31cfd2[_0xa757('0x1a')];var _0x27f4ba;if(_0x151c04>=_0x44eab8){_0x151c04=_0x44eab8;_0x27f4ba=0xc8;}else{_0x27f4ba=0xce;}_0x86abd[_0xa757('0x15')](_0x27f4ba);return _0x86abd['set'](_0xa757('0x1b'),_0x4d9f58+'-'+_0x151c04+'/'+_0x44eab8)['json'](_0xf12b68);}return null;};}function patchUpdates(_0x32c2a1){return function(_0x167640){try{jsonpatch[_0xa757('0x1c')](_0x167640,_0x32c2a1,!![]);}catch(_0x2c9ec6){return BPromise['reject'](_0x2c9ec6);}return _0x167640['save']();};}function saveUpdates(_0x40ec48,_0x2159cf){return function(_0x2ba923){if(_0x2ba923){return _0x2ba923[_0xa757('0x1d')](_0x40ec48)[_0xa757('0x1e')](function(_0x40562f){return _0x40562f;});}return null;};}function removeEntity(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(_0x2bf276){return _0x2bf276['destroy']()[_0xa757('0x1e')](function(){var _0x59e9d4=_0x2bf276[_0xa757('0x1f')]({'plain':!![]});var _0x47903b=_0xa757('0x20');return db[_0xa757('0x21')][_0xa757('0x22')]({'where':{'type':_0x47903b,'resourceId':_0x59e9d4['id']}})['then'](function(){return _0x2bf276;});})[_0xa757('0x1e')](function(){_0x2ca10d[_0xa757('0x15')](0xcc)[_0xa757('0x23')]();});}};}function handleEntityNotFound(_0x3bf7f3,_0x5b4779){return function(_0x449a7d){if(!_0x449a7d){_0x3bf7f3['sendStatus'](0x194);}return _0x449a7d;};}function handleError(_0x5a5664,_0x54b75e){_0x54b75e=_0x54b75e||0x1f4;return function(_0x4f8de2){logger[_0xa757('0x24')](_0x4f8de2['stack']);if(_0x4f8de2[_0xa757('0x25')]){delete _0x4f8de2[_0xa757('0x25')];}_0x5a5664['status'](_0x54b75e)[_0xa757('0x26')](_0x4f8de2);};}exports['index']=function(_0x2c4823,_0xa6d0f6){var _0x5307c3={},_0x235e54={},_0x5ade7b={'count':0x0,'rows':[]};var _0x3a4a66=_[_0xa757('0x27')](db[_0xa757('0x28')][_0xa757('0x29')],function(_0xcc87c0){return{'name':_0xcc87c0[_0xa757('0x2a')],'type':_0xcc87c0[_0xa757('0x2b')][_0xa757('0x2c')]};});_0x235e54[_0xa757('0x2d')]=_[_0xa757('0x27')](_0x3a4a66,_0xa757('0x25'));_0x235e54[_0xa757('0x2e')]=_[_0xa757('0x2f')](_0x2c4823[_0xa757('0x2e')]);_0x235e54[_0xa757('0x30')]=_[_0xa757('0x31')](_0x235e54[_0xa757('0x2d')],_0x235e54[_0xa757('0x2e')]);_0x5307c3[_0xa757('0x32')]=_[_0xa757('0x31')](_0x235e54[_0xa757('0x2d')],qs[_0xa757('0x33')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x33')]));_0x5307c3['attributes']=_0x5307c3[_0xa757('0x32')][_0xa757('0x34')]?_0x5307c3[_0xa757('0x32')]:_0x235e54[_0xa757('0x2d')];if(!_0x2c4823[_0xa757('0x2e')]['hasOwnProperty'](_0xa757('0x35'))){_0x5307c3[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x1a')]);_0x5307c3[_0xa757('0x17')]=qs['offset'](_0x2c4823[_0xa757('0x2e')][_0xa757('0x17')]);}_0x5307c3[_0xa757('0x36')]=qs[_0xa757('0x37')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x37')]);_0x5307c3[_0xa757('0x38')]=qs[_0xa757('0x30')](_[_0xa757('0x39')](_0x2c4823['query'],_0x235e54[_0xa757('0x30')]),_0x3a4a66);if(_0x2c4823[_0xa757('0x2e')][_0xa757('0x3a')]){_0x5307c3[_0xa757('0x38')]=_[_0xa757('0x3b')](_0x5307c3[_0xa757('0x38')],{'$or':_['map'](_0x3a4a66,function(_0x10d3fd){if(_0x10d3fd[_0xa757('0x2b')]!=='VIRTUAL'){var _0x5eae0b={};_0x5eae0b[_0x10d3fd[_0xa757('0x25')]]={'$like':'%'+_0x2c4823[_0xa757('0x2e')]['filter']+'%'};return _0x5eae0b;}})});}_0x5307c3=_['merge']({},_0x5307c3,_0x2c4823[_0xa757('0x3c')]);var _0x1725a2={'where':_0x5307c3[_0xa757('0x38')]};return db['VoiceMail'][_0xa757('0x19')](_0x1725a2)[_0xa757('0x1e')](function(_0x26802c){_0x5ade7b[_0xa757('0x19')]=_0x26802c;if(_0x2c4823[_0xa757('0x2e')]['includeAll']){_0x5307c3[_0xa757('0x3d')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x5307c3);})[_0xa757('0x1e')](function(_0x57298b){_0x5ade7b[_0xa757('0x3e')]=_0x57298b;return _0x5ade7b;})[_0xa757('0x1e')](respondWithFilteredResult(_0xa6d0f6,_0x5307c3))[_0xa757('0x3f')](handleError(_0xa6d0f6,null));};exports['show']=function(_0x5d25bb,_0x11e141){var _0x129d77={'raw':!![],'where':{'id':_0x5d25bb[_0xa757('0x40')]['id']}},_0x2b171c={};_0x2b171c[_0xa757('0x2d')]=_[_0xa757('0x2f')](db['VoiceMail'][_0xa757('0x29')]);_0x2b171c[_0xa757('0x2e')]=_['keys'](_0x5d25bb[_0xa757('0x2e')]);_0x2b171c['filters']=_[_0xa757('0x31')](_0x2b171c[_0xa757('0x2d')],_0x2b171c['query']);_0x129d77[_0xa757('0x32')]=_[_0xa757('0x31')](_0x2b171c['model'],qs[_0xa757('0x33')](_0x5d25bb[_0xa757('0x2e')][_0xa757('0x33')]));_0x129d77[_0xa757('0x32')]=_0x129d77['attributes'][_0xa757('0x34')]?_0x129d77[_0xa757('0x32')]:_0x2b171c[_0xa757('0x2d')];if(_0x5d25bb[_0xa757('0x2e')]['includeAll']){_0x129d77[_0xa757('0x3d')]=[{'all':!![]}];}_0x129d77=_['merge']({},_0x129d77,_0x5d25bb['options']);return db[_0xa757('0x28')][_0xa757('0x41')](_0x129d77)[_0xa757('0x1e')](handleEntityNotFound(_0x11e141,null))['then'](respondWithResult(_0x11e141,null))[_0xa757('0x3f')](handleError(_0x11e141,null));};exports['create']=function(_0x2ed63f,_0x151cc3){return db[_0xa757('0x28')][_0xa757('0x42')](_0x2ed63f[_0xa757('0x43')],{})[_0xa757('0x1e')](function(_0x57bf73){var _0x505cd=_0x2ed63f['user'][_0xa757('0x1f')]({'plain':!![]});if(!_0x505cd)throw new Error(_0xa757('0x44'));if(_0x505cd[_0xa757('0x45')]===_0xa757('0x46')){var _0x319988=_0x57bf73[_0xa757('0x1f')]({'plain':!![]});var _0x15bad7=_0xa757('0x20');return db[_0xa757('0x47')][_0xa757('0x41')]({'where':{'name':_0x15bad7,'userProfileId':_0x505cd[_0xa757('0x48')]},'raw':!![]})[_0xa757('0x1e')](function(_0x2367c7){if(_0x2367c7&&_0x2367c7[_0xa757('0x49')]===0x0){return db[_0xa757('0x21')][_0xa757('0x42')]({'name':_0x319988['name'],'resourceId':_0x319988['id'],'type':_0x2367c7[_0xa757('0x25')],'sectionId':_0x2367c7['id']},{})['then'](function(){return _0x57bf73;});}else{return _0x57bf73;}})[_0xa757('0x3f')](function(_0x311c25){logger[_0xa757('0x24')](_0xa757('0x4a'),_0x311c25);throw _0x311c25;});}return _0x57bf73;})['then'](respondWithResult(_0x151cc3,0xc9))[_0xa757('0x3f')](handleError(_0x151cc3,null));};exports[_0xa757('0x1d')]=function(_0x8614f9,_0x980e1){if(_0x8614f9['body']['id']){delete _0x8614f9[_0xa757('0x43')]['id'];}return db[_0xa757('0x28')][_0xa757('0x41')]({'where':{'id':_0x8614f9[_0xa757('0x40')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x980e1,null))[_0xa757('0x1e')](saveUpdates(_0x8614f9['body'],null))['then'](respondWithResult(_0x980e1,null))['catch'](handleError(_0x980e1,null));};exports['destroy']=function(_0x1d8742,_0x9b3779){return db[_0xa757('0x28')][_0xa757('0x41')]({'where':{'id':_0x1d8742[_0xa757('0x40')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x9b3779,null))['then'](removeEntity(_0x9b3779,null))[_0xa757('0x3f')](handleError(_0x9b3779,null));};exports[_0xa757('0x4b')]=function(_0x34e03f,_0x29b2f5,_0x48b578){return db[_0xa757('0x28')][_0xa757('0x4c')]({'where':{'id':_0x34e03f['params']['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x29b2f5,null))['then'](function(_0x211980){var _0x5d375c;var _0x51be6e={},_0x58633a={};_0x58633a['model']=_[_0xa757('0x2f')](db[_0xa757('0x4d')][_0xa757('0x29')]);_0x58633a[_0xa757('0x2e')]=_[_0xa757('0x2f')](_0x34e03f[_0xa757('0x2e')]);_0x58633a['filters']=_['intersection'](_0x58633a[_0xa757('0x2d')],_0x58633a[_0xa757('0x2e')]);_0x51be6e[_0xa757('0x32')]=_['intersection'](_0x58633a['model'],qs[_0xa757('0x33')](_0x34e03f[_0xa757('0x2e')][_0xa757('0x33')]));_0x51be6e[_0xa757('0x32')]=_0x51be6e[_0xa757('0x32')][_0xa757('0x34')]?_0x51be6e['attributes']:_0x58633a[_0xa757('0x2d')];if(!_0x34e03f[_0xa757('0x2e')][_0xa757('0x4e')](_0xa757('0x35'))){_0x51be6e[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x34e03f[_0xa757('0x2e')][_0xa757('0x1a')]);_0x51be6e[_0xa757('0x17')]=qs[_0xa757('0x17')](_0x34e03f['query'][_0xa757('0x17')]);}_0x51be6e['order']=qs['sort'](_0x34e03f[_0xa757('0x2e')][_0xa757('0x37')]);_0x51be6e[_0xa757('0x38')]=qs[_0xa757('0x30')](_[_0xa757('0x39')](_0x34e03f[_0xa757('0x2e')],_0x58633a[_0xa757('0x30')]));if(_0x34e03f[_0xa757('0x2e')][_0xa757('0x3a')]){_0x51be6e[_0xa757('0x38')]=_[_0xa757('0x3b')](_0x51be6e['where'],{'$or':_[_0xa757('0x27')](_0x51be6e[_0xa757('0x32')],function(_0x5f0b71){var _0x11ebb3={};_0x11ebb3[_0x5f0b71]={'$like':'%'+_0x34e03f[_0xa757('0x2e')][_0xa757('0x3a')]+'%'};return _0x11ebb3;})});}_0x51be6e[_0xa757('0x38')]=_[_0xa757('0x3b')](_0x51be6e[_0xa757('0x38')],{'mailboxuser':_0x211980['mailbox']});_0x51be6e=_[_0xa757('0x3b')]({},_0x51be6e,_0x34e03f['options']);return db[_0xa757('0x4d')][_0xa757('0x4f')](_0x51be6e)[_0xa757('0x1e')](respondWithFilteredResult(_0x29b2f5,_0x51be6e));})[_0xa757('0x3f')](handleError(_0x29b2f5,null));}; \ No newline at end of file +var _0xa571=['includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','params','VoiceMailMessage','filter','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','save','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','options','include','findAll','rows','catch'];(function(_0x4a1831,_0x299eaf){var _0x3f4dbc=function(_0xb8d51a){while(--_0xb8d51a){_0x4a1831['push'](_0x4a1831['shift']());}};_0x3f4dbc(++_0x299eaf);}(_0xa571,0x107));var _0x1a57=function(_0x541565,_0xbacd48){_0x541565=_0x541565-0x0;var _0x1464ef=_0xa571[_0x541565];return _0x1464ef;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];function respondWithStatusCode(_0x1911b2,_0x202d9a){_0x202d9a=_0x202d9a||0xcc;return function(_0x5ae643){if(_0x5ae643){return _0x1911b2[_0x1a57('0x18')](_0x202d9a);}return _0x1911b2[_0x1a57('0x19')](_0x202d9a)['end']();};}function respondWithResult(_0x503278,_0x587422){_0x587422=_0x587422||0xc8;return function(_0xd08107){if(_0xd08107){return _0x503278[_0x1a57('0x19')](_0x587422)[_0x1a57('0x1a')](_0xd08107);}};}function respondWithFilteredResult(_0x153d01,_0x5802d6){return function(_0x20f7ad){if(_0x20f7ad){var _0x53c61f=typeof _0x5802d6['offset']===_0x1a57('0x1b')&&typeof _0x5802d6[_0x1a57('0x1c')]===_0x1a57('0x1b');var _0x51b4c2=_0x20f7ad[_0x1a57('0x1d')];var _0x1662a3=_0x53c61f?0x0:_0x5802d6[_0x1a57('0x1e')];var _0x53bb20=_0x53c61f?_0x20f7ad[_0x1a57('0x1d')]:_0x5802d6[_0x1a57('0x1e')]+_0x5802d6[_0x1a57('0x1c')];var _0xcba6b7;if(_0x53bb20>=_0x51b4c2){_0x53bb20=_0x51b4c2;_0xcba6b7=0xc8;}else{_0xcba6b7=0xce;}_0x153d01[_0x1a57('0x19')](_0xcba6b7);return _0x153d01['set']('Content-Range',_0x1662a3+'-'+_0x53bb20+'/'+_0x51b4c2)[_0x1a57('0x1a')](_0x20f7ad);}return null;};}function patchUpdates(_0x21e811){return function(_0x211c63){try{jsonpatch['apply'](_0x211c63,_0x21e811,!![]);}catch(_0x5c200e){return BPromise['reject'](_0x5c200e);}return _0x211c63[_0x1a57('0x1f')]();};}function saveUpdates(_0x113ad4,_0x3f52b9){return function(_0xee133b){if(_0xee133b){return _0xee133b[_0x1a57('0x20')](_0x113ad4)[_0x1a57('0x21')](function(_0x2efa49){return _0x2efa49;});}return null;};}function removeEntity(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(_0x35d5dc){return _0x35d5dc[_0x1a57('0x22')]()[_0x1a57('0x21')](function(){var _0x26cdd3=_0x35d5dc[_0x1a57('0x23')]({'plain':!![]});var _0x2f9454=_0x1a57('0x24');return db[_0x1a57('0x25')][_0x1a57('0x22')]({'where':{'type':_0x2f9454,'resourceId':_0x26cdd3['id']}})[_0x1a57('0x21')](function(){return _0x35d5dc;});})[_0x1a57('0x21')](function(){_0x2f8b00[_0x1a57('0x19')](0xcc)[_0x1a57('0x26')]();});}};}function handleEntityNotFound(_0x5a53c8,_0x530401){return function(_0x139d8c){if(!_0x139d8c){_0x5a53c8[_0x1a57('0x18')](0x194);}return _0x139d8c;};}function handleError(_0x545041,_0x46dac6){_0x46dac6=_0x46dac6||0x1f4;return function(_0x54f6a5){logger[_0x1a57('0x27')](_0x54f6a5[_0x1a57('0x28')]);if(_0x54f6a5['name']){delete _0x54f6a5[_0x1a57('0x29')];}_0x545041[_0x1a57('0x19')](_0x46dac6)[_0x1a57('0x2a')](_0x54f6a5);};}exports[_0x1a57('0x2b')]=function(_0x492b90,_0x366d5f){var _0x396832={},_0x4374f0={},_0x160536={'count':0x0,'rows':[]};var _0x5763ba=_[_0x1a57('0x2c')](db[_0x1a57('0x2d')][_0x1a57('0x2e')],function(_0x32f79f){return{'name':_0x32f79f[_0x1a57('0x2f')],'type':_0x32f79f[_0x1a57('0x30')][_0x1a57('0x31')]};});_0x4374f0[_0x1a57('0x32')]=_[_0x1a57('0x2c')](_0x5763ba,'name');_0x4374f0[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x492b90['query']);_0x4374f0['filters']=_[_0x1a57('0x35')](_0x4374f0[_0x1a57('0x32')],_0x4374f0[_0x1a57('0x33')]);_0x396832[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x4374f0[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x492b90[_0x1a57('0x33')][_0x1a57('0x37')]));_0x396832[_0x1a57('0x36')]=_0x396832[_0x1a57('0x36')][_0x1a57('0x38')]?_0x396832[_0x1a57('0x36')]:_0x4374f0[_0x1a57('0x32')];if(!_0x492b90[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x396832[_0x1a57('0x1c')]=qs['limit'](_0x492b90[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x396832[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x492b90[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x396832[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x492b90[_0x1a57('0x33')]['sort']);_0x396832['where']=qs['filters'](_['pick'](_0x492b90[_0x1a57('0x33')],_0x4374f0[_0x1a57('0x3d')]),_0x5763ba);if(_0x492b90[_0x1a57('0x33')]['filter']){_0x396832[_0x1a57('0x3e')]=_[_0x1a57('0x3f')](_0x396832[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x5763ba,function(_0x5bf186){if(_0x5bf186[_0x1a57('0x30')]!=='VIRTUAL'){var _0xd39e5a={};_0xd39e5a[_0x5bf186[_0x1a57('0x29')]]={'$like':'%'+_0x492b90[_0x1a57('0x33')]['filter']+'%'};return _0xd39e5a;}})});}_0x396832=_[_0x1a57('0x3f')]({},_0x396832,_0x492b90[_0x1a57('0x40')]);var _0x61e9f6={'where':_0x396832[_0x1a57('0x3e')]};return db[_0x1a57('0x2d')]['count'](_0x61e9f6)[_0x1a57('0x21')](function(_0x47e998){_0x160536['count']=_0x47e998;if(_0x492b90[_0x1a57('0x33')]['includeAll']){_0x396832[_0x1a57('0x41')]=[{'all':!![]}];}return db[_0x1a57('0x2d')][_0x1a57('0x42')](_0x396832);})['then'](function(_0x188a50){_0x160536[_0x1a57('0x43')]=_0x188a50;return _0x160536;})[_0x1a57('0x21')](respondWithFilteredResult(_0x366d5f,_0x396832))[_0x1a57('0x44')](handleError(_0x366d5f,null));};exports['show']=function(_0xc7bab4,_0x150fb6){var _0x4fdd29={'raw':!![],'where':{'id':_0xc7bab4['params']['id']}},_0x32d05b={};_0x32d05b['model']=_[_0x1a57('0x34')](db[_0x1a57('0x2d')][_0x1a57('0x2e')]);_0x32d05b[_0x1a57('0x33')]=_['keys'](_0xc7bab4[_0x1a57('0x33')]);_0x32d05b[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x32d05b[_0x1a57('0x32')],_0x32d05b[_0x1a57('0x33')]);_0x4fdd29['attributes']=_[_0x1a57('0x35')](_0x32d05b[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0xc7bab4[_0x1a57('0x33')]['fields']));_0x4fdd29[_0x1a57('0x36')]=_0x4fdd29['attributes'][_0x1a57('0x38')]?_0x4fdd29[_0x1a57('0x36')]:_0x32d05b[_0x1a57('0x32')];if(_0xc7bab4[_0x1a57('0x33')][_0x1a57('0x45')]){_0x4fdd29[_0x1a57('0x41')]=[{'all':!![]}];}_0x4fdd29=_[_0x1a57('0x3f')]({},_0x4fdd29,_0xc7bab4[_0x1a57('0x40')]);return db[_0x1a57('0x2d')][_0x1a57('0x46')](_0x4fdd29)[_0x1a57('0x21')](handleEntityNotFound(_0x150fb6,null))[_0x1a57('0x21')](respondWithResult(_0x150fb6,null))[_0x1a57('0x44')](handleError(_0x150fb6,null));};exports['create']=function(_0xf4d056,_0x480aff){return db[_0x1a57('0x2d')][_0x1a57('0x47')](_0xf4d056[_0x1a57('0x48')],{})[_0x1a57('0x21')](function(_0x323af1){var _0x3cbb9e=_0xf4d056[_0x1a57('0x49')][_0x1a57('0x23')]({'plain':!![]});if(!_0x3cbb9e)throw new Error(_0x1a57('0x4a'));if(_0x3cbb9e['role']===_0x1a57('0x49')){var _0x439a42=_0x323af1['get']({'plain':!![]});var _0x15f1f5=_0x1a57('0x24');return db['UserProfileSection'][_0x1a57('0x46')]({'where':{'name':_0x15f1f5,'userProfileId':_0x3cbb9e[_0x1a57('0x4b')]},'raw':!![]})['then'](function(_0x4d3177){if(_0x4d3177&&_0x4d3177['autoAssociation']===0x0){return db[_0x1a57('0x25')][_0x1a57('0x47')]({'name':_0x439a42['name'],'resourceId':_0x439a42['id'],'type':_0x4d3177[_0x1a57('0x29')],'sectionId':_0x4d3177['id']},{})[_0x1a57('0x21')](function(){return _0x323af1;});}else{return _0x323af1;}})['catch'](function(_0x5e510e){logger['error'](_0x1a57('0x4c'),_0x5e510e);throw _0x5e510e;});}return _0x323af1;})[_0x1a57('0x21')](respondWithResult(_0x480aff,0xc9))[_0x1a57('0x44')](handleError(_0x480aff,null));};exports[_0x1a57('0x20')]=function(_0x28738e,_0x33379c){if(_0x28738e[_0x1a57('0x48')]['id']){delete _0x28738e[_0x1a57('0x48')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x28738e['params']['id']}})['then'](handleEntityNotFound(_0x33379c,null))['then'](saveUpdates(_0x28738e[_0x1a57('0x48')],null))[_0x1a57('0x21')](respondWithResult(_0x33379c,null))[_0x1a57('0x44')](handleError(_0x33379c,null));};exports[_0x1a57('0x22')]=function(_0x26cf80,_0x2f09e7){return db[_0x1a57('0x2d')][_0x1a57('0x46')]({'where':{'id':_0x26cf80['params']['id']}})['then'](handleEntityNotFound(_0x2f09e7,null))['then'](removeEntity(_0x2f09e7,null))[_0x1a57('0x44')](handleError(_0x2f09e7,null));};exports['getMessages']=function(_0x301db9,_0x10c058,_0x408e67){return db[_0x1a57('0x2d')][_0x1a57('0x4d')]({'where':{'id':_0x301db9[_0x1a57('0x4e')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x10c058,null))['then'](function(_0x4e56b5){var _0x4d5b1d;var _0xc936a7={},_0x562775={};_0x562775[_0x1a57('0x32')]=_[_0x1a57('0x34')](db[_0x1a57('0x4f')][_0x1a57('0x2e')]);_0x562775[_0x1a57('0x33')]=_['keys'](_0x301db9['query']);_0x562775[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x562775[_0x1a57('0x32')],_0x562775[_0x1a57('0x33')]);_0xc936a7[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x562775['model'],qs['fields'](_0x301db9[_0x1a57('0x33')][_0x1a57('0x37')]));_0xc936a7['attributes']=_0xc936a7['attributes'][_0x1a57('0x38')]?_0xc936a7[_0x1a57('0x36')]:_0x562775[_0x1a57('0x32')];if(!_0x301db9[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0xc936a7[_0x1a57('0x1c')]=qs['limit'](_0x301db9['query'][_0x1a57('0x1c')]);_0xc936a7[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x301db9[_0x1a57('0x33')]['offset']);}_0xc936a7[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x301db9[_0x1a57('0x33')][_0x1a57('0x3c')]);_0xc936a7[_0x1a57('0x3e')]=qs['filters'](_['pick'](_0x301db9['query'],_0x562775[_0x1a57('0x3d')]));if(_0x301db9[_0x1a57('0x33')][_0x1a57('0x50')]){_0xc936a7[_0x1a57('0x3e')]=_[_0x1a57('0x3f')](_0xc936a7[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0xc936a7[_0x1a57('0x36')],function(_0x482508){var _0xe8ef76={};_0xe8ef76[_0x482508]={'$like':'%'+_0x301db9[_0x1a57('0x33')]['filter']+'%'};return _0xe8ef76;})});}_0xc936a7['where']=_[_0x1a57('0x3f')](_0xc936a7['where'],{'mailboxuser':_0x4e56b5[_0x1a57('0x51')]});_0xc936a7=_[_0x1a57('0x3f')]({},_0xc936a7,_0x301db9[_0x1a57('0x40')]);return db[_0x1a57('0x4f')][_0x1a57('0x52')](_0xc936a7)[_0x1a57('0x21')](respondWithFilteredResult(_0x10c058,_0xc936a7));})[_0x1a57('0x44')](handleError(_0x10c058,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 643162e..fb99dc3 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 _0x83d9=['request-promise','path','rimraf','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','api','bluebird'];(function(_0x795aca,_0x55444f){var _0x2334f5=function(_0x448440){while(--_0x448440){_0x795aca['push'](_0x795aca['shift']());}};_0x2334f5(++_0x55444f);}(_0x83d9,0x109));var _0x983d=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x83d9[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x983d('0x0'));var util=require(_0x983d('0x1'));var logger=require(_0x983d('0x2'))(_0x983d('0x3'));var moment=require('moment');var BPromise=require(_0x983d('0x4'));var rp=require(_0x983d('0x5'));var fs=require('fs');var path=require(_0x983d('0x6'));var rimraf=require(_0x983d('0x7'));var config=require(_0x983d('0x8'));var attributes=require('./voiceMail.attributes');module[_0x983d('0x9')]=function(_0x34892f,_0x5d487e){return _0x34892f[_0x983d('0xa')](_0x983d('0xb'),attributes,{'tableName':_0x983d('0xc'),'paranoid':![],'indexes':[{'name':_0x983d('0xd'),'fields':[_0x983d('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3fcb=['context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','define','mailbox_context','mailbox'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x3fcb,0x1c3));var _0xb3fc=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x3fcb[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xb3fc('0x0'));var util=require(_0xb3fc('0x1'));var logger=require(_0xb3fc('0x2'))(_0xb3fc('0x3'));var moment=require(_0xb3fc('0x4'));var BPromise=require(_0xb3fc('0x5'));var rp=require(_0xb3fc('0x6'));var fs=require('fs');var path=require(_0xb3fc('0x7'));var rimraf=require(_0xb3fc('0x8'));var config=require(_0xb3fc('0x9'));var attributes=require(_0xb3fc('0xa'));module['exports']=function(_0x53d2f8,_0xf3a754){return _0x53d2f8[_0xb3fc('0xb')]('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xb3fc('0xc'),'fields':[_0xb3fc('0xd'),_0xb3fc('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 fde2b73..2ab6bb8 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 _0xda02=['VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xda02,0x1a1));var _0x2da0=function(_0x41b0a8,_0x1b05cc){_0x41b0a8=_0x41b0a8-0x0;var _0x3a83d4=_0xda02[_0x41b0a8];return _0x3a83d4;};'use strict';var _=require(_0x2da0('0x0'));var util=require(_0x2da0('0x1'));var moment=require('moment');var BPromise=require(_0x2da0('0x2'));var rs=require(_0x2da0('0x3'));var fs=require('fs');var Redis=require(_0x2da0('0x4'));var db=require(_0x2da0('0x5'))['db'];var utils=require(_0x2da0('0x6'));var logger=require(_0x2da0('0x7'))(_0x2da0('0x8'));var config=require(_0x2da0('0x9'));var jayson=require(_0x2da0('0xa'));var client=jayson[_0x2da0('0xb')][_0x2da0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ada95,_0x2be7e0,_0x5b9ad0){return new BPromise(function(_0x35cd99,_0x5394f5){return client['request'](_0x1ada95,_0x5b9ad0)[_0x2da0('0xd')](function(_0x44aa34){logger[_0x2da0('0xe')](_0x2da0('0xf'),_0x2be7e0,_0x2da0('0x10'));logger[_0x2da0('0x11')](_0x2da0('0x12'),_0x2be7e0,_0x2da0('0x10'),JSON[_0x2da0('0x13')](_0x44aa34));if(_0x44aa34[_0x2da0('0x14')]){if(_0x44aa34['error'][_0x2da0('0x15')]===0x1f4){logger[_0x2da0('0x14')]('VoiceMail,\x20%s,\x20%s',_0x2be7e0,_0x44aa34['error'][_0x2da0('0x16')]);return _0x5394f5(_0x44aa34[_0x2da0('0x14')]['message']);}logger[_0x2da0('0x14')](_0x2da0('0xf'),_0x2be7e0,_0x44aa34[_0x2da0('0x14')]['message']);return _0x35cd99(_0x44aa34[_0x2da0('0x14')][_0x2da0('0x16')]);}else{logger[_0x2da0('0xe')](_0x2da0('0xf'),_0x2be7e0,_0x2da0('0x10'));_0x35cd99(_0x44aa34['result'][_0x2da0('0x16')]);}})[_0x2da0('0x17')](function(_0x3014c8){logger[_0x2da0('0x14')](_0x2da0('0xf'),_0x2be7e0,_0x3014c8);_0x5394f5(_0x3014c8);});});} \ No newline at end of file +var _0xd4a9=['VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceMail,\x20%s,\x20%s','debug'];(function(_0x385f56,_0x5d89c9){var _0x4bbef2=function(_0x235e61){while(--_0x235e61){_0x385f56['push'](_0x385f56['shift']());}};_0x4bbef2(++_0x5d89c9);}(_0xd4a9,0x110));var _0x9d4a=function(_0x55e6d5,_0x4b7d9b){_0x55e6d5=_0x55e6d5-0x0;var _0x33afc4=_0xd4a9[_0x55e6d5];return _0x33afc4;};'use strict';var _=require(_0x9d4a('0x0'));var util=require(_0x9d4a('0x1'));var moment=require(_0x9d4a('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d4a('0x3'));var fs=require('fs');var Redis=require(_0x9d4a('0x4'));var db=require(_0x9d4a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d4a('0x6'))(_0x9d4a('0x7'));var config=require(_0x9d4a('0x8'));var jayson=require(_0x9d4a('0x9'));var client=jayson[_0x9d4a('0xa')][_0x9d4a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50fa47,_0x48d23a,_0x5f32bf){return new BPromise(function(_0x396d41,_0x48e753){return client['request'](_0x50fa47,_0x5f32bf)[_0x9d4a('0xc')](function(_0x2db4d0){logger[_0x9d4a('0xd')](_0x9d4a('0xe'),_0x48d23a,'request\x20sent');logger[_0x9d4a('0xf')](_0x9d4a('0x10'),_0x48d23a,_0x9d4a('0x11'),JSON[_0x9d4a('0x12')](_0x2db4d0));if(_0x2db4d0[_0x9d4a('0x13')]){if(_0x2db4d0[_0x9d4a('0x13')][_0x9d4a('0x14')]===0x1f4){logger[_0x9d4a('0x13')]('VoiceMail,\x20%s,\x20%s',_0x48d23a,_0x2db4d0['error'][_0x9d4a('0x15')]);return _0x48e753(_0x2db4d0['error']['message']);}logger['error'](_0x9d4a('0xe'),_0x48d23a,_0x2db4d0[_0x9d4a('0x13')][_0x9d4a('0x15')]);return _0x396d41(_0x2db4d0['error'][_0x9d4a('0x15')]);}else{logger[_0x9d4a('0xd')]('VoiceMail,\x20%s,\x20%s',_0x48d23a,_0x9d4a('0x11'));_0x396d41(_0x2db4d0[_0x9d4a('0x16')][_0x9d4a('0x15')]);}})[_0x9d4a('0x17')](function(_0xea3cc9){logger[_0x9d4a('0x13')]('VoiceMail,\x20%s,\x20%s',_0x48d23a,_0xea3cc9);_0x48e753(_0xea3cc9);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 08086a2..6d0641f 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 _0x5a72=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','create','update','delete','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x8d2ae0,_0x509408){var _0x3aa3e3=function(_0x2c7610){while(--_0x2c7610){_0x8d2ae0['push'](_0x8d2ae0['shift']());}};_0x3aa3e3(++_0x509408);}(_0x5a72,0x150));var _0x25a7=function(_0x1dd567,_0x2f21f2){_0x1dd567=_0x1dd567-0x0;var _0x40e9ae=_0x5a72[_0x1dd567];return _0x40e9ae;};'use strict';var multer=require('multer');var util=require(_0x25a7('0x0'));var path=require(_0x25a7('0x1'));var timeout=require(_0x25a7('0x2'));var express=require(_0x25a7('0x3'));var router=express[_0x25a7('0x4')]();var fs_extra=require(_0x25a7('0x5'));var auth=require(_0x25a7('0x6'));var interaction=require(_0x25a7('0x7'));var config=require(_0x25a7('0x8'));var controller=require('./voiceMailMessage.controller');router[_0x25a7('0x9')]('/',auth[_0x25a7('0xa')](),controller[_0x25a7('0xb')]);router[_0x25a7('0x9')]('/:id',auth[_0x25a7('0xa')](),controller[_0x25a7('0xc')]);router[_0x25a7('0x9')](_0x25a7('0xd'),auth[_0x25a7('0xa')](),controller['download']);router['post']('/',auth[_0x25a7('0xa')](),controller[_0x25a7('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x25a7('0xf')]);router[_0x25a7('0x10')](_0x25a7('0x11'),auth[_0x25a7('0xa')](),controller[_0x25a7('0x12')]);module['exports']=router; \ No newline at end of file +var _0xcb88=['isAuthenticated','/:id/download','post','create','put','update','delete','destroy','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id'];(function(_0x2908e4,_0x3be6e8){var _0x4fa8d7=function(_0x340ec7){while(--_0x340ec7){_0x2908e4['push'](_0x2908e4['shift']());}};_0x4fa8d7(++_0x3be6e8);}(_0xcb88,0xb2));var _0x8cb8=function(_0x519899,_0x5eb3dc){_0x519899=_0x519899-0x0;var _0x2d0006=_0xcb88[_0x519899];return _0x2d0006;};'use strict';var multer=require('multer');var util=require(_0x8cb8('0x0'));var path=require(_0x8cb8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8cb8('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8cb8('0x3'));var interaction=require(_0x8cb8('0x4'));var config=require(_0x8cb8('0x5'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8cb8('0x6')]);router[_0x8cb8('0x7')](_0x8cb8('0x8'),auth[_0x8cb8('0x9')](),controller['show']);router[_0x8cb8('0x7')](_0x8cb8('0xa'),auth[_0x8cb8('0x9')](),controller['download']);router[_0x8cb8('0xb')]('/',auth['isAuthenticated'](),controller[_0x8cb8('0xc')]);router[_0x8cb8('0xd')](_0x8cb8('0x8'),auth['isAuthenticated'](),controller[_0x8cb8('0xe')]);router[_0x8cb8('0xf')](_0x8cb8('0x8'),auth[_0x8cb8('0x9')](),controller[_0x8cb8('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 58c27cc..de08024 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 _0x87ba=['VIRTUAL','getDataValue','STRING','long','literal','sequelize','exports'];(function(_0x18a0d2,_0x1a3f7b){var _0x3aa2eb=function(_0x323bcf){while(--_0x323bcf){_0x18a0d2['push'](_0x18a0d2['shift']());}};_0x3aa2eb(++_0x1a3f7b);}(_0x87ba,0x15c));var _0xa87b=function(_0xe37f58,_0x1a167b){_0xe37f58=_0xe37f58-0x0;var _0x4dfcef=_0x87ba[_0xe37f58];return _0x4dfcef;};'use strict';var Sequelize=require(_0xa87b('0x0'));module[_0xa87b('0x1')]={'name':{'type':Sequelize[_0xa87b('0x2')],'get':function(_0x41f84d){return this[_0xa87b('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xa87b('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xa87b('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xa87b('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xa87b('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xa87b('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xa87b('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xa87b('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xa87b('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xa87b('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xa87b('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x4ed0=['sequelize','exports','VIRTUAL','getDataValue','STRING','long','literal'];(function(_0x6430d8,_0x55d84c){var _0x4a5746=function(_0x118f50){while(--_0x118f50){_0x6430d8['push'](_0x6430d8['shift']());}};_0x4a5746(++_0x55d84c);}(_0x4ed0,0x111));var _0x04ed=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x4ed0[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x04ed('0x0'));module[_0x04ed('0x1')]={'name':{'type':Sequelize[_0x04ed('0x2')],'get':function(_0x48f863){return this[_0x04ed('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x04ed('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x04ed('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x04ed('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x04ed('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x04ed('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x04ed('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x04ed('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x04ed('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 9abca63..d1ee062 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 _0xf88c=['filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','merge','find','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceMailMessage','fieldName','key','model','differenceBy'];(function(_0x3b480c,_0x5496bd){var _0x1eea09=function(_0x386924){while(--_0x386924){_0x3b480c['push'](_0x3b480c['shift']());}};_0x1eea09(++_0x5496bd);}(_0xf88c,0x129));var _0xcf88=function(_0x30d82f,_0x39c792){_0x30d82f=_0x30d82f-0x0;var _0x2cf66e=_0xf88c[_0x30d82f];return _0x2cf66e;};'use strict';var emlformat=require(_0xcf88('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf88('0x1'));var jsonpatch=require(_0xcf88('0x2'));var rp=require(_0xcf88('0x3'));var moment=require('moment');var BPromise=require(_0xcf88('0x4'));var Mustache=require(_0xcf88('0x5'));var util=require(_0xcf88('0x6'));var path=require(_0xcf88('0x7'));var sox=require('sox');var csv=require(_0xcf88('0x8'));var ejs=require(_0xcf88('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf88('0xa'));var squel=require('squel');var crypto=require(_0xcf88('0xb'));var jsforce=require(_0xcf88('0xc'));var deskjs=require(_0xcf88('0xd'));var toCsv=require(_0xcf88('0x8'));var querystring=require('querystring');var Papa=require(_0xcf88('0xe'));var Redis=require(_0xcf88('0xf'));var authService=require(_0xcf88('0x10'));var qs=require(_0xcf88('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf88('0x12'));var logger=require('../../config/logger')(_0xcf88('0x13'));var utils=require(_0xcf88('0x14'));var config=require(_0xcf88('0x15'));var licenseUtil=require(_0xcf88('0x16'));var db=require(_0xcf88('0x17'))['db'];function respondWithStatusCode(_0x5663c0,_0xd8c592){_0xd8c592=_0xd8c592||0xcc;return function(_0x57a612){if(_0x57a612){return _0x5663c0['sendStatus'](_0xd8c592);}return _0x5663c0[_0xcf88('0x18')](_0xd8c592)[_0xcf88('0x19')]();};}function respondWithResult(_0x3a94f6,_0x28e7cc){_0x28e7cc=_0x28e7cc||0xc8;return function(_0x448e3e){if(_0x448e3e){return _0x3a94f6[_0xcf88('0x18')](_0x28e7cc)[_0xcf88('0x1a')](_0x448e3e);}};}function respondWithFilteredResult(_0x5c95ac,_0x35dbe2){return function(_0x26d539){if(_0x26d539){var _0x6ee708=typeof _0x35dbe2[_0xcf88('0x1b')]===_0xcf88('0x1c')&&typeof _0x35dbe2[_0xcf88('0x1d')]===_0xcf88('0x1c');var _0x2e03e5=_0x26d539[_0xcf88('0x1e')];var _0x2f2050=_0x6ee708?0x0:_0x35dbe2['offset'];var _0x1e7ae2=_0x6ee708?_0x26d539[_0xcf88('0x1e')]:_0x35dbe2['offset']+_0x35dbe2['limit'];var _0x3935b9;if(_0x1e7ae2>=_0x2e03e5){_0x1e7ae2=_0x2e03e5;_0x3935b9=0xc8;}else{_0x3935b9=0xce;}_0x5c95ac[_0xcf88('0x18')](_0x3935b9);return _0x5c95ac[_0xcf88('0x1f')](_0xcf88('0x20'),_0x2f2050+'-'+_0x1e7ae2+'/'+_0x2e03e5)[_0xcf88('0x1a')](_0x26d539);}return null;};}function patchUpdates(_0x427bf6){return function(_0x324a36){try{jsonpatch[_0xcf88('0x21')](_0x324a36,_0x427bf6,!![]);}catch(_0x19b078){return BPromise[_0xcf88('0x22')](_0x19b078);}return _0x324a36[_0xcf88('0x23')]();};}function saveUpdates(_0xdb0049,_0x4d283a){return function(_0x41d063){if(_0x41d063){return _0x41d063[_0xcf88('0x24')](_0xdb0049)[_0xcf88('0x25')](function(_0x42eded){return _0x42eded;});}return null;};}function removeEntity(_0x2f4bd4,_0x3f2e0a){return function(_0x492c6d){if(_0x492c6d){return _0x492c6d[_0xcf88('0x26')]()[_0xcf88('0x25')](function(){_0x2f4bd4[_0xcf88('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20ba84,_0x424a28){return function(_0x1c18e2){if(!_0x1c18e2){_0x20ba84[_0xcf88('0x27')](0x194);}return _0x1c18e2;};}function handleError(_0x4ba037,_0x5a2b4b){_0x5a2b4b=_0x5a2b4b||0x1f4;return function(_0x66837c){logger[_0xcf88('0x28')](_0x66837c[_0xcf88('0x29')]);if(_0x66837c[_0xcf88('0x2a')]){delete _0x66837c[_0xcf88('0x2a')];}_0x4ba037[_0xcf88('0x18')](_0x5a2b4b)[_0xcf88('0x2b')](_0x66837c);};}exports[_0xcf88('0x2c')]=function(_0x546fa3,_0x197fe2){var _0x360c67={},_0x63e3a9={},_0x32d3cd={'count':0x0,'rows':[]};var _0x2a0293=_[_0xcf88('0x2d')](db[_0xcf88('0x2e')]['rawAttributes'],function(_0x1e69b9){return{'name':_0x1e69b9[_0xcf88('0x2f')],'type':_0x1e69b9['type'][_0xcf88('0x30')]};});_0x63e3a9[_0xcf88('0x31')]=_[_0xcf88('0x32')](_[_0xcf88('0x2d')](_0x2a0293,_0xcf88('0x2a')),[_0xcf88('0x2a')]);_0x63e3a9['query']=_['keys'](_0x546fa3['query']);_0x63e3a9[_0xcf88('0x33')]=_[_0xcf88('0x34')](_0x63e3a9[_0xcf88('0x31')],_0x63e3a9[_0xcf88('0x35')]);_0x360c67[_0xcf88('0x36')]=_[_0xcf88('0x34')](_0x63e3a9[_0xcf88('0x31')],qs[_0xcf88('0x37')](_0x546fa3[_0xcf88('0x35')][_0xcf88('0x37')]));_0x360c67[_0xcf88('0x36')]=_0x360c67[_0xcf88('0x36')][_0xcf88('0x38')]?_0x360c67[_0xcf88('0x36')]:_0x63e3a9[_0xcf88('0x31')];if(!_0x546fa3[_0xcf88('0x35')][_0xcf88('0x39')]('nolimit')){_0x360c67[_0xcf88('0x1d')]=qs[_0xcf88('0x1d')](_0x546fa3['query'][_0xcf88('0x1d')]);_0x360c67['offset']=qs[_0xcf88('0x1b')](_0x546fa3[_0xcf88('0x35')][_0xcf88('0x1b')]);}_0x360c67[_0xcf88('0x3a')]=qs[_0xcf88('0x3b')](_0x546fa3[_0xcf88('0x35')]['sort']);_0x360c67[_0xcf88('0x3c')]=qs[_0xcf88('0x33')](_[_0xcf88('0x3d')](_0x546fa3[_0xcf88('0x35')],_0x63e3a9[_0xcf88('0x33')]),_0x2a0293);if(_0x546fa3[_0xcf88('0x35')][_0xcf88('0x3e')]){_0x360c67['where']=_['merge'](_0x360c67[_0xcf88('0x3c')],{'$or':_['map'](_0x2a0293,function(_0xa6ae7d){if(_0xa6ae7d['type']!==_0xcf88('0x3f')){var _0x28bc39={};_0x28bc39[_0xa6ae7d[_0xcf88('0x2a')]]={'$like':'%'+_0x546fa3[_0xcf88('0x35')][_0xcf88('0x3e')]+'%'};return _0x28bc39;}})});}_0x360c67=_['merge']({},_0x360c67,_0x546fa3[_0xcf88('0x40')]);var _0x2273e2={'where':_0x360c67[_0xcf88('0x3c')]};return db[_0xcf88('0x2e')][_0xcf88('0x1e')](_0x2273e2)[_0xcf88('0x25')](function(_0x57aa6e){_0x32d3cd[_0xcf88('0x1e')]=_0x57aa6e;if(_0x546fa3[_0xcf88('0x35')][_0xcf88('0x41')]){_0x360c67[_0xcf88('0x42')]=[{'all':!![]}];}return db[_0xcf88('0x2e')][_0xcf88('0x43')](_0x360c67);})[_0xcf88('0x25')](function(_0x501efd){_0x32d3cd['rows']=_0x501efd;return _0x32d3cd;})[_0xcf88('0x25')](respondWithFilteredResult(_0x197fe2,_0x360c67))[_0xcf88('0x44')](handleError(_0x197fe2,null));};exports[_0xcf88('0x45')]=function(_0x157d92,_0x488cf8){var _0x51a85c={'raw':!![],'where':{'id':_0x157d92[_0xcf88('0x46')]['id']}},_0x203144={};_0x203144[_0xcf88('0x31')]=_[_0xcf88('0x47')](db[_0xcf88('0x2e')][_0xcf88('0x48')]);_0x203144['query']=_[_0xcf88('0x47')](_0x157d92[_0xcf88('0x35')]);_0x203144['filters']=_[_0xcf88('0x34')](_0x203144['model'],_0x203144[_0xcf88('0x35')]);_0x51a85c[_0xcf88('0x36')]=_[_0xcf88('0x34')](_0x203144[_0xcf88('0x31')],qs[_0xcf88('0x37')](_0x157d92[_0xcf88('0x35')][_0xcf88('0x37')]));_0x51a85c[_0xcf88('0x36')]=_0x51a85c[_0xcf88('0x36')][_0xcf88('0x38')]?_0x51a85c[_0xcf88('0x36')]:_0x203144[_0xcf88('0x31')];if(_0x157d92[_0xcf88('0x35')][_0xcf88('0x41')]){_0x51a85c[_0xcf88('0x42')]=[{'all':!![]}];}_0x51a85c=_[_0xcf88('0x49')]({},_0x51a85c,_0x157d92[_0xcf88('0x40')]);return db[_0xcf88('0x2e')][_0xcf88('0x4a')](_0x51a85c)['then'](handleEntityNotFound(_0x488cf8,null))[_0xcf88('0x25')](respondWithResult(_0x488cf8,null))[_0xcf88('0x44')](handleError(_0x488cf8,null));};exports[_0xcf88('0x4b')]=function(_0x543163,_0x4fe513){return db[_0xcf88('0x2e')][_0xcf88('0x4b')](_0x543163[_0xcf88('0x4c')],{})[_0xcf88('0x25')](respondWithResult(_0x4fe513,0xc9))['catch'](handleError(_0x4fe513,null));};exports[_0xcf88('0x24')]=function(_0x520971,_0x449079){if(_0x520971['body']['id']){delete _0x520971[_0xcf88('0x4c')]['id'];}return db[_0xcf88('0x2e')]['find']({'where':{'id':_0x520971[_0xcf88('0x46')]['id']}})[_0xcf88('0x25')](handleEntityNotFound(_0x449079,null))[_0xcf88('0x25')](saveUpdates(_0x520971[_0xcf88('0x4c')],null))[_0xcf88('0x25')](respondWithResult(_0x449079,null))[_0xcf88('0x44')](handleError(_0x449079,null));};exports[_0xcf88('0x26')]=function(_0x2d105c,_0x53c263){return db['VoiceMailMessage'][_0xcf88('0x4a')]({'where':{'id':_0x2d105c['params']['id']}})['then'](handleEntityNotFound(_0x53c263,null))[_0xcf88('0x25')](removeEntity(_0x53c263,null))[_0xcf88('0x44')](handleError(_0x53c263,null));};exports[_0xcf88('0x4d')]=function(_0xaf3d23,_0x2ec7e7,_0x5454c5){return db[_0xcf88('0x2e')]['find']({'where':{'id':_0xaf3d23[_0xcf88('0x46')]['id']},'attributes':['id',_0xcf88('0x4e'),_0xcf88('0x4f')]})[_0xcf88('0x25')](handleEntityNotFound(_0x2ec7e7,null))[_0xcf88('0x25')](function(_0xc9ebb5){if(_0xc9ebb5){if(!_0xc9ebb5[_0xcf88('0x4e')]){throw new db['Sequelize'][(_0xcf88('0x50'))](_0xcf88('0x51'));}var _0x326077={'Content-Type':_0xcf88('0x52'),'Content-Disposition':_0xcf88('0x53')};if(_0xc9ebb5[_0xcf88('0x4f')]){_0x326077[_0xcf88('0x54')]=_0xcf88('0x55')+_0xc9ebb5['msg_id']+_0xcf88('0x56');}_0x2ec7e7['set'](_0x326077);return _0x2ec7e7[_0xcf88('0x2b')](new Buffer(_0xc9ebb5[_0xcf88('0x4e')]));}})[_0xcf88('0x44')](handleError(_0x2ec7e7,null));}; \ No newline at end of file +var _0x9100=['bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','model','differenceBy','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','VoiceMailMessage','include','findAll','rows','show','params','options','find','catch','create','body','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9100,0x148));var _0x0910=function(_0x30e364,_0x4fe3e3){_0x30e364=_0x30e364-0x0;var _0x36f649=_0x9100[_0x30e364];return _0x36f649;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0910('0x0'));var jsonpatch=require(_0x0910('0x1'));var rp=require(_0x0910('0x2'));var moment=require(_0x0910('0x3'));var BPromise=require(_0x0910('0x4'));var Mustache=require('mustache');var util=require(_0x0910('0x5'));var path=require(_0x0910('0x6'));var sox=require(_0x0910('0x7'));var csv=require(_0x0910('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0910('0x9'));var _=require(_0x0910('0xa'));var squel=require('squel');var crypto=require(_0x0910('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0910('0x8'));var querystring=require(_0x0910('0xc'));var Papa=require(_0x0910('0xd'));var Redis=require('ioredis');var authService=require(_0x0910('0xe'));var qs=require(_0x0910('0xf'));var as=require(_0x0910('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0910('0x11'))(_0x0910('0x12'));var utils=require(_0x0910('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0910('0x14'));var db=require(_0x0910('0x15'))['db'];function respondWithStatusCode(_0x274771,_0x145ea0){_0x145ea0=_0x145ea0||0xcc;return function(_0x4d9049){if(_0x4d9049){return _0x274771[_0x0910('0x16')](_0x145ea0);}return _0x274771[_0x0910('0x17')](_0x145ea0)[_0x0910('0x18')]();};}function respondWithResult(_0x194cb4,_0x21c4a0){_0x21c4a0=_0x21c4a0||0xc8;return function(_0x561d3d){if(_0x561d3d){return _0x194cb4['status'](_0x21c4a0)['json'](_0x561d3d);}};}function respondWithFilteredResult(_0x3fb8cc,_0x318826){return function(_0x5258b4){if(_0x5258b4){var _0x299f93=typeof _0x318826[_0x0910('0x19')]===_0x0910('0x1a')&&typeof _0x318826[_0x0910('0x1b')]===_0x0910('0x1a');var _0x472c93=_0x5258b4[_0x0910('0x1c')];var _0x3973c6=_0x299f93?0x0:_0x318826[_0x0910('0x19')];var _0x28e8b1=_0x299f93?_0x5258b4[_0x0910('0x1c')]:_0x318826[_0x0910('0x19')]+_0x318826['limit'];var _0x4fff4d;if(_0x28e8b1>=_0x472c93){_0x28e8b1=_0x472c93;_0x4fff4d=0xc8;}else{_0x4fff4d=0xce;}_0x3fb8cc['status'](_0x4fff4d);return _0x3fb8cc['set'](_0x0910('0x1d'),_0x3973c6+'-'+_0x28e8b1+'/'+_0x472c93)[_0x0910('0x1e')](_0x5258b4);}return null;};}function patchUpdates(_0x19a7e0){return function(_0x57f26b){try{jsonpatch[_0x0910('0x1f')](_0x57f26b,_0x19a7e0,!![]);}catch(_0x47cb79){return BPromise['reject'](_0x47cb79);}return _0x57f26b['save']();};}function saveUpdates(_0x2dd473,_0xc7ff22){return function(_0xe6d621){if(_0xe6d621){return _0xe6d621[_0x0910('0x20')](_0x2dd473)['then'](function(_0x230340){return _0x230340;});}return null;};}function removeEntity(_0x274290,_0x261ea6){return function(_0x27e220){if(_0x27e220){return _0x27e220[_0x0910('0x21')]()[_0x0910('0x22')](function(){_0x274290[_0x0910('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3916e9,_0x53cd3d){return function(_0x53cd80){if(!_0x53cd80){_0x3916e9[_0x0910('0x16')](0x194);}return _0x53cd80;};}function handleError(_0x5991d0,_0x220b28){_0x220b28=_0x220b28||0x1f4;return function(_0x36c21e){logger[_0x0910('0x23')](_0x36c21e[_0x0910('0x24')]);if(_0x36c21e[_0x0910('0x25')]){delete _0x36c21e[_0x0910('0x25')];}_0x5991d0[_0x0910('0x17')](_0x220b28)[_0x0910('0x26')](_0x36c21e);};}exports[_0x0910('0x27')]=function(_0x38bb8c,_0x488600){var _0x363734={},_0x5821c5={},_0x1e4095={'count':0x0,'rows':[]};var _0x59cfe4=_[_0x0910('0x28')](db['VoiceMailMessage'][_0x0910('0x29')],function(_0x4722b4){return{'name':_0x4722b4[_0x0910('0x2a')],'type':_0x4722b4['type']['key']};});_0x5821c5[_0x0910('0x2b')]=_[_0x0910('0x2c')](_[_0x0910('0x28')](_0x59cfe4,'name'),[_0x0910('0x25')]);_0x5821c5['query']=_[_0x0910('0x2d')](_0x38bb8c['query']);_0x5821c5['filters']=_[_0x0910('0x2e')](_0x5821c5[_0x0910('0x2b')],_0x5821c5[_0x0910('0x2f')]);_0x363734[_0x0910('0x30')]=_[_0x0910('0x2e')](_0x5821c5[_0x0910('0x2b')],qs[_0x0910('0x31')](_0x38bb8c[_0x0910('0x2f')]['fields']));_0x363734[_0x0910('0x30')]=_0x363734[_0x0910('0x30')][_0x0910('0x32')]?_0x363734['attributes']:_0x5821c5['model'];if(!_0x38bb8c[_0x0910('0x2f')][_0x0910('0x33')](_0x0910('0x34'))){_0x363734[_0x0910('0x1b')]=qs[_0x0910('0x1b')](_0x38bb8c[_0x0910('0x2f')]['limit']);_0x363734['offset']=qs[_0x0910('0x19')](_0x38bb8c[_0x0910('0x2f')]['offset']);}_0x363734[_0x0910('0x35')]=qs[_0x0910('0x36')](_0x38bb8c[_0x0910('0x2f')][_0x0910('0x36')]);_0x363734[_0x0910('0x37')]=qs[_0x0910('0x38')](_[_0x0910('0x39')](_0x38bb8c[_0x0910('0x2f')],_0x5821c5[_0x0910('0x38')]),_0x59cfe4);if(_0x38bb8c[_0x0910('0x2f')][_0x0910('0x3a')]){_0x363734[_0x0910('0x37')]=_[_0x0910('0x3b')](_0x363734[_0x0910('0x37')],{'$or':_['map'](_0x59cfe4,function(_0x258164){if(_0x258164[_0x0910('0x3c')]!==_0x0910('0x3d')){var _0x4f3fa0={};_0x4f3fa0[_0x258164[_0x0910('0x25')]]={'$like':'%'+_0x38bb8c[_0x0910('0x2f')]['filter']+'%'};return _0x4f3fa0;}})});}_0x363734=_[_0x0910('0x3b')]({},_0x363734,_0x38bb8c['options']);var _0x2e4955={'where':_0x363734[_0x0910('0x37')]};return db[_0x0910('0x3e')][_0x0910('0x1c')](_0x2e4955)[_0x0910('0x22')](function(_0x402a3d){_0x1e4095['count']=_0x402a3d;if(_0x38bb8c[_0x0910('0x2f')]['includeAll']){_0x363734[_0x0910('0x3f')]=[{'all':!![]}];}return db[_0x0910('0x3e')][_0x0910('0x40')](_0x363734);})[_0x0910('0x22')](function(_0x4a62d1){_0x1e4095[_0x0910('0x41')]=_0x4a62d1;return _0x1e4095;})['then'](respondWithFilteredResult(_0x488600,_0x363734))['catch'](handleError(_0x488600,null));};exports[_0x0910('0x42')]=function(_0x4e15cc,_0x5432fa){var _0x529edf={'raw':!![],'where':{'id':_0x4e15cc[_0x0910('0x43')]['id']}},_0x4e4825={};_0x4e4825[_0x0910('0x2b')]=_[_0x0910('0x2d')](db[_0x0910('0x3e')][_0x0910('0x29')]);_0x4e4825['query']=_[_0x0910('0x2d')](_0x4e15cc['query']);_0x4e4825[_0x0910('0x38')]=_[_0x0910('0x2e')](_0x4e4825[_0x0910('0x2b')],_0x4e4825[_0x0910('0x2f')]);_0x529edf[_0x0910('0x30')]=_[_0x0910('0x2e')](_0x4e4825['model'],qs[_0x0910('0x31')](_0x4e15cc[_0x0910('0x2f')][_0x0910('0x31')]));_0x529edf[_0x0910('0x30')]=_0x529edf[_0x0910('0x30')]['length']?_0x529edf[_0x0910('0x30')]:_0x4e4825[_0x0910('0x2b')];if(_0x4e15cc[_0x0910('0x2f')]['includeAll']){_0x529edf[_0x0910('0x3f')]=[{'all':!![]}];}_0x529edf=_[_0x0910('0x3b')]({},_0x529edf,_0x4e15cc[_0x0910('0x44')]);return db[_0x0910('0x3e')][_0x0910('0x45')](_0x529edf)[_0x0910('0x22')](handleEntityNotFound(_0x5432fa,null))[_0x0910('0x22')](respondWithResult(_0x5432fa,null))[_0x0910('0x46')](handleError(_0x5432fa,null));};exports[_0x0910('0x47')]=function(_0x3ee074,_0x5931b6){return db['VoiceMailMessage'][_0x0910('0x47')](_0x3ee074[_0x0910('0x48')],{})['then'](respondWithResult(_0x5931b6,0xc9))[_0x0910('0x46')](handleError(_0x5931b6,null));};exports[_0x0910('0x20')]=function(_0x6e86aa,_0x5e532f){if(_0x6e86aa[_0x0910('0x48')]['id']){delete _0x6e86aa['body']['id'];}return db[_0x0910('0x3e')]['find']({'where':{'id':_0x6e86aa[_0x0910('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e532f,null))[_0x0910('0x22')](saveUpdates(_0x6e86aa[_0x0910('0x48')],null))[_0x0910('0x22')](respondWithResult(_0x5e532f,null))[_0x0910('0x46')](handleError(_0x5e532f,null));};exports[_0x0910('0x21')]=function(_0x1e39ed,_0xcd0573){return db[_0x0910('0x3e')]['find']({'where':{'id':_0x1e39ed[_0x0910('0x43')]['id']}})[_0x0910('0x22')](handleEntityNotFound(_0xcd0573,null))[_0x0910('0x22')](removeEntity(_0xcd0573,null))[_0x0910('0x46')](handleError(_0xcd0573,null));};exports['download']=function(_0x4dace7,_0x4ee93f,_0x237e53){return db[_0x0910('0x3e')][_0x0910('0x45')]({'where':{'id':_0x4dace7['params']['id']},'attributes':['id',_0x0910('0x49'),_0x0910('0x4a')]})[_0x0910('0x22')](handleEntityNotFound(_0x4ee93f,null))[_0x0910('0x22')](function(_0x31154d){if(_0x31154d){if(!_0x31154d[_0x0910('0x49')]){throw new db['Sequelize'][(_0x0910('0x4b'))](_0x0910('0x4c'));}var _0x4f19cd={'Content-Type':_0x0910('0x4d'),'Content-Disposition':_0x0910('0x4e')};if(_0x31154d[_0x0910('0x4a')]){_0x4f19cd[_0x0910('0x4f')]=_0x0910('0x50')+_0x31154d[_0x0910('0x4a')]+_0x0910('0x51');}_0x4ee93f[_0x0910('0x52')](_0x4f19cd);return _0x4ee93f[_0x0910('0x26')](new Buffer(_0x31154d[_0x0910('0x49')]));}})['catch'](handleError(_0x4ee93f,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 216c73a..b546264 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 _0x69b1=['dir','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages'];(function(_0x5dde98,_0x5a291f){var _0x104508=function(_0x1fc60d){while(--_0x1fc60d){_0x5dde98['push'](_0x5dde98['shift']());}};_0x104508(++_0x5a291f);}(_0x69b1,0xb7));var _0x169b=function(_0x5e11c3,_0x23470c){_0x5e11c3=_0x5e11c3-0x0;var _0x431d72=_0x69b1[_0x5e11c3];return _0x431d72;};'use strict';var _=require(_0x169b('0x0'));var util=require(_0x169b('0x1'));var logger=require(_0x169b('0x2'))(_0x169b('0x3'));var moment=require('moment');var BPromise=require(_0x169b('0x4'));var rp=require(_0x169b('0x5'));var fs=require('fs');var path=require(_0x169b('0x6'));var rimraf=require(_0x169b('0x7'));var config=require(_0x169b('0x8'));var attributes=require(_0x169b('0x9'));module[_0x169b('0xa')]=function(_0x88f619,_0x2ca760){return _0x88f619[_0x169b('0xb')]('VoiceMailMessage',attributes,{'tableName':_0x169b('0xc'),'paranoid':![],'indexes':[{'name':_0x169b('0xd'),'fields':[_0x169b('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe1c0=['./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','util','api','moment','bluebird','request-promise','path'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xe1c0,0x132));var _0x0e1c=function(_0x5b9552,_0x3aac25){_0x5b9552=_0x5b9552-0x0;var _0x1b5fd9=_0xe1c0[_0x5b9552];return _0x1b5fd9;};'use strict';var _=require('lodash');var util=require(_0x0e1c('0x0'));var logger=require('../../config/logger')(_0x0e1c('0x1'));var moment=require(_0x0e1c('0x2'));var BPromise=require(_0x0e1c('0x3'));var rp=require(_0x0e1c('0x4'));var fs=require('fs');var path=require(_0x0e1c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0e1c('0x6'));module[_0x0e1c('0x7')]=function(_0x425dd6,_0x584c31){return _0x425dd6[_0x0e1c('0x8')](_0x0e1c('0x9'),attributes,{'tableName':_0x0e1c('0xa'),'paranoid':![],'indexes':[{'name':_0x0e1c('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index e1c7ed0..02b1262 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 _0xd00a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error','VoiceMailMessage,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xd00a,0x1e1));var _0xad00=function(_0x210950,_0x12b86c){_0x210950=_0x210950-0x0;var _0x212a5d=_0xd00a[_0x210950];return _0x212a5d;};'use strict';var _=require(_0xad00('0x0'));var util=require(_0xad00('0x1'));var moment=require(_0xad00('0x2'));var BPromise=require('bluebird');var rs=require(_0xad00('0x3'));var fs=require('fs');var Redis=require(_0xad00('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xad00('0x5'))(_0xad00('0x6'));var config=require(_0xad00('0x7'));var jayson=require(_0xad00('0x8'));var client=jayson[_0xad00('0x9')][_0xad00('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22e220,_0x284fef,_0x4b4d50){return new BPromise(function(_0x587c8c,_0x2bc903){return client['request'](_0x22e220,_0x4b4d50)[_0xad00('0xb')](function(_0x5e5998){logger[_0xad00('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x284fef,_0xad00('0xd'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x284fef,_0xad00('0xd'),JSON['stringify'](_0x5e5998));if(_0x5e5998['error']){if(_0x5e5998['error']['code']===0x1f4){logger[_0xad00('0xe')](_0xad00('0xf'),_0x284fef,_0x5e5998[_0xad00('0xe')]['message']);return _0x2bc903(_0x5e5998['error'][_0xad00('0x10')]);}logger[_0xad00('0xe')](_0xad00('0xf'),_0x284fef,_0x5e5998[_0xad00('0xe')]['message']);return _0x587c8c(_0x5e5998[_0xad00('0xe')][_0xad00('0x10')]);}else{logger['info'](_0xad00('0xf'),_0x284fef,'request\x20sent');_0x587c8c(_0x5e5998['result'][_0xad00('0x10')]);}})[_0xad00('0x11')](function(_0x30d03b){logger[_0xad00('0xe')](_0xad00('0xf'),_0x284fef,_0x30d03b);_0x2bc903(_0x30d03b);});});} \ No newline at end of file +var _0xeda4=['debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x10fc59,_0x4e7fca){var _0x24355b=function(_0x550ab0){while(--_0x550ab0){_0x10fc59['push'](_0x10fc59['shift']());}};_0x24355b(++_0x4e7fca);}(_0xeda4,0x177));var _0x4eda=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0xeda4[_0xea343d];return _0x2c6e9c;};'use strict';var _=require('lodash');var util=require(_0x4eda('0x0'));var moment=require('moment');var BPromise=require(_0x4eda('0x1'));var rs=require(_0x4eda('0x2'));var fs=require('fs');var Redis=require(_0x4eda('0x3'));var db=require(_0x4eda('0x4'))['db'];var utils=require(_0x4eda('0x5'));var logger=require(_0x4eda('0x6'))(_0x4eda('0x7'));var config=require(_0x4eda('0x8'));var jayson=require(_0x4eda('0x9'));var client=jayson['client'][_0x4eda('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31c06c,_0xabb001,_0x260410){return new BPromise(function(_0x473ed1,_0x249c7d){return client[_0x4eda('0xb')](_0x31c06c,_0x260410)[_0x4eda('0xc')](function(_0x28b14f){logger[_0x4eda('0xd')](_0x4eda('0xe'),_0xabb001,_0x4eda('0xf'));logger[_0x4eda('0x10')](_0x4eda('0x11'),_0xabb001,_0x4eda('0xf'),JSON[_0x4eda('0x12')](_0x28b14f));if(_0x28b14f[_0x4eda('0x13')]){if(_0x28b14f[_0x4eda('0x13')][_0x4eda('0x14')]===0x1f4){logger[_0x4eda('0x13')](_0x4eda('0xe'),_0xabb001,_0x28b14f[_0x4eda('0x13')][_0x4eda('0x15')]);return _0x249c7d(_0x28b14f[_0x4eda('0x13')][_0x4eda('0x15')]);}logger[_0x4eda('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0xabb001,_0x28b14f[_0x4eda('0x13')]['message']);return _0x473ed1(_0x28b14f[_0x4eda('0x13')][_0x4eda('0x15')]);}else{logger[_0x4eda('0xd')](_0x4eda('0xe'),_0xabb001,_0x4eda('0xf'));_0x473ed1(_0x28b14f['result'][_0x4eda('0x15')]);}})[_0x4eda('0x16')](function(_0x2d86df){logger['error'](_0x4eda('0xe'),_0xabb001,_0x2d86df);_0x249c7d(_0x2d86df);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 52c3ed5..af32ef5 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 _0x5b4f=['destroy','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete'];(function(_0x143565,_0x54d887){var _0x4dc1d9=function(_0x5e8838){while(--_0x5e8838){_0x143565['push'](_0x143565['shift']());}};_0x4dc1d9(++_0x54d887);}(_0x5b4f,0x1be));var _0xf5b4=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x5b4f[_0xd1d19a];return _0x52a79d;};'use strict';var multer=require(_0xf5b4('0x0'));var util=require(_0xf5b4('0x1'));var path=require('path');var timeout=require(_0xf5b4('0x2'));var express=require(_0xf5b4('0x3'));var router=express[_0xf5b4('0x4')]();var fs_extra=require(_0xf5b4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf5b4('0x6'));var config=require(_0xf5b4('0x7'));var controller=require(_0xf5b4('0x8'));router[_0xf5b4('0x9')]('/',auth[_0xf5b4('0xa')](),controller[_0xf5b4('0xb')]);router[_0xf5b4('0x9')]('/:id',auth[_0xf5b4('0xa')](),controller[_0xf5b4('0xc')]);router[_0xf5b4('0x9')](_0xf5b4('0xd'),auth['isAuthenticated'](),controller[_0xf5b4('0xe')]);router[_0xf5b4('0xf')]('/',auth[_0xf5b4('0xa')](),controller[_0xf5b4('0x10')]);router[_0xf5b4('0xf')]('/:id/sounds',auth[_0xf5b4('0xa')](),controller[_0xf5b4('0x11')]);router[_0xf5b4('0x12')](_0xf5b4('0x13'),auth[_0xf5b4('0xa')](),controller[_0xf5b4('0x14')]);router[_0xf5b4('0x15')](_0xf5b4('0x13'),auth['isAuthenticated'](),controller[_0xf5b4('0x16')]);router[_0xf5b4('0x15')](_0xf5b4('0x17'),auth[_0xf5b4('0xa')](),controller[_0xf5b4('0x18')]);module[_0xf5b4('0x19')]=router; \ No newline at end of file +var _0x36ae=['/:id/sounds/:id2','removeSound','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','/:id/sounds','isAuthenticated','getSounds','post','put','update','destroy'];(function(_0x482deb,_0x3b4322){var _0xe412b=function(_0x5e9965){while(--_0x5e9965){_0x482deb['push'](_0x482deb['shift']());}};_0xe412b(++_0x3b4322);}(_0x36ae,0xf2));var _0xe36a=function(_0x2b1551,_0x1776fe){_0x2b1551=_0x2b1551-0x0;var _0x2fc2a1=_0x36ae[_0x2b1551];return _0x2fc2a1;};'use strict';var multer=require('multer');var util=require(_0xe36a('0x0'));var path=require(_0xe36a('0x1'));var timeout=require('connect-timeout');var express=require(_0xe36a('0x2'));var router=express[_0xe36a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe36a('0x4'));var interaction=require(_0xe36a('0x5'));var config=require(_0xe36a('0x6'));var controller=require(_0xe36a('0x7'));router[_0xe36a('0x8')]('/',auth['isAuthenticated'](),controller[_0xe36a('0x9')]);router[_0xe36a('0x8')](_0xe36a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xe36a('0x8')](_0xe36a('0xb'),auth[_0xe36a('0xc')](),controller[_0xe36a('0xd')]);router['post']('/',auth[_0xe36a('0xc')](),controller['create']);router[_0xe36a('0xe')](_0xe36a('0xb'),auth[_0xe36a('0xc')](),controller['addSound']);router[_0xe36a('0xf')](_0xe36a('0xa'),auth[_0xe36a('0xc')](),controller[_0xe36a('0x10')]);router['delete'](_0xe36a('0xa'),auth[_0xe36a('0xc')](),controller[_0xe36a('0x11')]);router['delete'](_0xe36a('0x12'),auth['isAuthenticated'](),controller[_0xe36a('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 743b015..34d49cc 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 _0xf5f0=['ENUM','custom','files','quietmp3nb','quietmp3','mp3','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0xf5f0,0x168));var _0x0f5f=function(_0x1f0985,_0x26c1e6){_0x1f0985=_0x1f0985-0x0;var _0x402d82=_0xf5f0[_0x1f0985];return _0x402d82;};'use strict';var Sequelize=require(_0x0f5f('0x0'));module[_0x0f5f('0x1')]={'name':{'type':Sequelize[_0x0f5f('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x0f5f('0x3')](_0x0f5f('0x4'),_0x0f5f('0x5'),'mp3nb',_0x0f5f('0x6'),_0x0f5f('0x7'),_0x0f5f('0x8')),'allowNull':!![],'defaultValue':_0x0f5f('0x5')},'directory':{'type':Sequelize[_0x0f5f('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x0f5f('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x0f5f('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x0f5f('0x2')],'allowNull':!![]},'stamp':{'type':_0x0f5f('0x9')},'defaultEntry':{'type':Sequelize[_0x0f5f('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xca97=['TIMESTAMP','sequelize','STRING','name','ENUM','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha'];(function(_0xf61586,_0x56b0c4){var _0x2b6eb3=function(_0x47e12b){while(--_0x47e12b){_0xf61586['push'](_0xf61586['shift']());}};_0x2b6eb3(++_0x56b0c4);}(_0xca97,0xbc));var _0x7ca9=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xca97[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x7ca9('0x0'));module['exports']={'name':{'type':Sequelize[_0x7ca9('0x1')],'allowNull':![],'unique':_0x7ca9('0x2')},'mode':{'type':Sequelize[_0x7ca9('0x3')]('custom',_0x7ca9('0x4'),_0x7ca9('0x5'),_0x7ca9('0x6'),_0x7ca9('0x7'),_0x7ca9('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x7ca9('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x7ca9('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x7ca9('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x7ca9('0x1')],'allowNull':!![],'defaultValue':_0x7ca9('0x9')},'format':{'type':Sequelize[_0x7ca9('0x1')],'allowNull':!![]},'stamp':{'type':_0x7ca9('0xa')},'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 c76dd2d..5ee2dbe 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 _0x944a=['apply','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','length','find','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','%s.%s','basename','symlinkSync','message','removeSound','converted_format','format','getSounds','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','undefined','count','offset','limit','status','Content-Range'];(function(_0x31d084,_0x1a67aa){var _0x598864=function(_0x168779){while(--_0x168779){_0x31d084['push'](_0x31d084['shift']());}};_0x598864(++_0x1a67aa);}(_0x944a,0x193));var _0xa944=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x944a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa944('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa944('0x1'));var jsonpatch=require(_0xa944('0x2'));var rp=require(_0xa944('0x3'));var moment=require(_0xa944('0x4'));var BPromise=require(_0xa944('0x5'));var Mustache=require('mustache');var util=require(_0xa944('0x6'));var path=require(_0xa944('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa944('0x8'));var fs=require('fs');var fs_extra=require(_0xa944('0x9'));var _=require(_0xa944('0xa'));var squel=require(_0xa944('0xb'));var crypto=require(_0xa944('0xc'));var jsforce=require(_0xa944('0xd'));var deskjs=require(_0xa944('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa944('0xf'));var Papa=require(_0xa944('0x10'));var Redis=require(_0xa944('0x11'));var authService=require(_0xa944('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa944('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa944('0x14'))(_0xa944('0x15'));var utils=require(_0xa944('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa944('0x17'));var db=require(_0xa944('0x18'))['db'];function respondWithStatusCode(_0x3bc641,_0x1de367){_0x1de367=_0x1de367||0xcc;return function(_0x3aa323){if(_0x3aa323){return _0x3bc641[_0xa944('0x19')](_0x1de367);}return _0x3bc641['status'](_0x1de367)[_0xa944('0x1a')]();};}function respondWithResult(_0x384691,_0x5be969){_0x5be969=_0x5be969||0xc8;return function(_0x358f27){if(_0x358f27){return _0x384691['status'](_0x5be969)['json'](_0x358f27);}};}function respondWithFilteredResult(_0x5a4bd5,_0x409da0){return function(_0x3dd92d){if(_0x3dd92d){var _0x4d8dee=typeof _0x409da0['offset']===_0xa944('0x1b')&&typeof _0x409da0['limit']==='undefined';var _0x21579f=_0x3dd92d[_0xa944('0x1c')];var _0xfb17df=_0x4d8dee?0x0:_0x409da0[_0xa944('0x1d')];var _0x3220e8=_0x4d8dee?_0x3dd92d[_0xa944('0x1c')]:_0x409da0[_0xa944('0x1d')]+_0x409da0[_0xa944('0x1e')];var _0x25d636;if(_0x3220e8>=_0x21579f){_0x3220e8=_0x21579f;_0x25d636=0xc8;}else{_0x25d636=0xce;}_0x5a4bd5[_0xa944('0x1f')](_0x25d636);return _0x5a4bd5['set'](_0xa944('0x20'),_0xfb17df+'-'+_0x3220e8+'/'+_0x21579f)['json'](_0x3dd92d);}return null;};}function patchUpdates(_0x16a558){return function(_0x50c98a){try{jsonpatch[_0xa944('0x21')](_0x50c98a,_0x16a558,!![]);}catch(_0x2eb268){return BPromise['reject'](_0x2eb268);}return _0x50c98a[_0xa944('0x22')]();};}function saveUpdates(_0x74bf2d,_0x317a26){return function(_0x382b02){if(_0x382b02){return _0x382b02[_0xa944('0x23')](_0x74bf2d)[_0xa944('0x24')](function(_0x7d747d){return _0x7d747d;});}return null;};}function removeEntity(_0x22016f,_0x12bc4c){return function(_0x9bdabc){if(_0x9bdabc){return _0x9bdabc['destroy']()[_0xa944('0x24')](function(){var _0x4794d5=_0x9bdabc[_0xa944('0x25')]({'plain':!![]});var _0x4879e8=_0xa944('0x26');return db[_0xa944('0x27')][_0xa944('0x28')]({'where':{'type':_0x4879e8,'resourceId':_0x4794d5['id']}})['then'](function(){return _0x9bdabc;});})[_0xa944('0x24')](function(){_0x22016f[_0xa944('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46dc76,_0x3bc977){return function(_0x42d68c){if(!_0x42d68c){_0x46dc76[_0xa944('0x19')](0x194);}return _0x42d68c;};}function handleError(_0x453024,_0x578744){_0x578744=_0x578744||0x1f4;return function(_0xf64c7f){logger[_0xa944('0x29')](_0xf64c7f[_0xa944('0x2a')]);if(_0xf64c7f[_0xa944('0x2b')]){delete _0xf64c7f['name'];}_0x453024[_0xa944('0x1f')](_0x578744)[_0xa944('0x2c')](_0xf64c7f);};}exports['index']=function(_0x4b135b,_0x5b7487){var _0x1ee639={},_0x20d968={},_0x583edd={'count':0x0,'rows':[]};var _0x31945b=_[_0xa944('0x2d')](db[_0xa944('0x2e')][_0xa944('0x2f')],function(_0x2ed044){return{'name':_0x2ed044[_0xa944('0x30')],'type':_0x2ed044[_0xa944('0x31')]['key']};});_0x20d968[_0xa944('0x32')]=_[_0xa944('0x2d')](_0x31945b,_0xa944('0x2b'));_0x20d968[_0xa944('0x33')]=_[_0xa944('0x34')](_0x4b135b['query']);_0x20d968[_0xa944('0x35')]=_[_0xa944('0x36')](_0x20d968['model'],_0x20d968[_0xa944('0x33')]);_0x1ee639[_0xa944('0x37')]=_[_0xa944('0x36')](_0x20d968[_0xa944('0x32')],qs[_0xa944('0x38')](_0x4b135b['query']['fields']));_0x1ee639[_0xa944('0x37')]=_0x1ee639['attributes']['length']?_0x1ee639[_0xa944('0x37')]:_0x20d968[_0xa944('0x32')];if(!_0x4b135b['query'][_0xa944('0x39')]('nolimit')){_0x1ee639[_0xa944('0x1e')]=qs[_0xa944('0x1e')](_0x4b135b[_0xa944('0x33')][_0xa944('0x1e')]);_0x1ee639[_0xa944('0x1d')]=qs['offset'](_0x4b135b['query'][_0xa944('0x1d')]);}_0x1ee639[_0xa944('0x3a')]=qs['sort'](_0x4b135b[_0xa944('0x33')][_0xa944('0x3b')]);delete _0x4b135b[_0xa944('0x33')][_0xa944('0x3b')];_0x1ee639[_0xa944('0x3c')]=qs[_0xa944('0x35')](_[_0xa944('0x3d')](_0x4b135b['query'],_0x20d968[_0xa944('0x35')]),_0x31945b);if(_0x4b135b['query'][_0xa944('0x3e')]){_0x1ee639[_0xa944('0x3c')]=_['merge'](_0x1ee639[_0xa944('0x3c')],{'$or':_['map'](_0x31945b,function(_0x1005cd){if(_0x1005cd[_0xa944('0x31')]!==_0xa944('0x3f')){var _0x4f4622={};_0x4f4622[_0x1005cd[_0xa944('0x2b')]]={'$like':'%'+_0x4b135b[_0xa944('0x33')][_0xa944('0x3e')]+'%'};return _0x4f4622;}})});}_0x1ee639=_[_0xa944('0x40')]({},_0x1ee639,_0x4b135b[_0xa944('0x41')]);var _0x1e0fd8={'where':_0x1ee639[_0xa944('0x3c')]};return db[_0xa944('0x2e')][_0xa944('0x1c')](_0x1e0fd8)[_0xa944('0x24')](function(_0x4c98d1){_0x583edd[_0xa944('0x1c')]=_0x4c98d1;if(_0x4b135b[_0xa944('0x33')][_0xa944('0x42')]){_0x1ee639['include']=[{'all':!![]}];}return db[_0xa944('0x2e')][_0xa944('0x43')](_0x1ee639);})['then'](function(_0x4587d6){_0x583edd[_0xa944('0x44')]=_0x4587d6;return _0x583edd;})['then'](respondWithFilteredResult(_0x5b7487,_0x1ee639))[_0xa944('0x45')](handleError(_0x5b7487,null));};exports[_0xa944('0x46')]=function(_0x23bd8b,_0xdf782f){var _0x1a0121={'raw':![],'where':{'id':_0x23bd8b[_0xa944('0x47')]['id']}},_0x3d6708={};_0x3d6708[_0xa944('0x32')]=_[_0xa944('0x34')](db[_0xa944('0x2e')][_0xa944('0x2f')]);_0x3d6708['query']=_[_0xa944('0x34')](_0x23bd8b[_0xa944('0x33')]);_0x3d6708[_0xa944('0x35')]=_[_0xa944('0x36')](_0x3d6708[_0xa944('0x32')],_0x3d6708['query']);_0x1a0121[_0xa944('0x37')]=_[_0xa944('0x36')](_0x3d6708['model'],qs[_0xa944('0x38')](_0x23bd8b[_0xa944('0x33')][_0xa944('0x38')]));_0x1a0121[_0xa944('0x37')]=_0x1a0121['attributes'][_0xa944('0x48')]?_0x1a0121[_0xa944('0x37')]:_0x3d6708[_0xa944('0x32')];if(_0x23bd8b[_0xa944('0x33')][_0xa944('0x42')]){_0x1a0121['include']=[{'all':!![]}];}_0x1a0121=_['merge']({},_0x1a0121,_0x23bd8b[_0xa944('0x41')]);return db[_0xa944('0x2e')][_0xa944('0x49')](_0x1a0121)[_0xa944('0x24')](handleEntityNotFound(_0xdf782f,null))[_0xa944('0x24')](respondWithResult(_0xdf782f,null))[_0xa944('0x45')](handleError(_0xdf782f,null));};exports[_0xa944('0x23')]=function(_0x546b38,_0x6ae305){if(_0x546b38['body']['id']){delete _0x546b38['body']['id'];}return db[_0xa944('0x2e')][_0xa944('0x49')]({'where':{'id':_0x546b38[_0xa944('0x47')]['id']}})[_0xa944('0x24')](handleEntityNotFound(_0x6ae305,null))[_0xa944('0x24')](saveUpdates(_0x546b38[_0xa944('0x4a')],null))[_0xa944('0x24')](respondWithResult(_0x6ae305,null))[_0xa944('0x45')](handleError(_0x6ae305,null));};exports[_0xa944('0x4b')]=function(_0x7ca3e0,_0x5b6154,_0x3c4497){return db[_0xa944('0x4c')][_0xa944('0x4d')](function(_0x48c79b){if(_0x7ca3e0[_0xa944('0x4a')][_0xa944('0x4e')]===_0xa944('0x4f')){_0x7ca3e0[_0xa944('0x4a')][_0xa944('0x50')]=path[_0xa944('0x51')](config[_0xa944('0x52')],_0xa944('0x53'),_0x7ca3e0['body'][_0xa944('0x2b')]);}return db[_0xa944('0x2e')][_0xa944('0x4b')](_0x7ca3e0[_0xa944('0x4a')],{'transaction':_0x48c79b})['then'](function(_0x4cb0fd){if(_0x7ca3e0[_0xa944('0x4a')][_0xa944('0x4e')]===_0xa944('0x4f')){fs['mkdirSync'](_0x4cb0fd[_0xa944('0x50')],parseInt(_0xa944('0x54'),0x8));}var _0x2444c1=_0x7ca3e0[_0xa944('0x55')][_0xa944('0x25')]({'plain':!![]});if(!_0x2444c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2444c1['role']===_0xa944('0x55')){var _0x44d72b=_0x4cb0fd['get']({'plain':!![]});return db[_0xa944('0x56')][_0xa944('0x49')]({'where':{'name':_0xa944('0x26'),'userProfileId':_0x2444c1[_0xa944('0x57')]},'raw':!![]})[_0xa944('0x24')](function(_0xd10bb9){if(_0xd10bb9&&_0xd10bb9[_0xa944('0x58')]===0x0){return db[_0xa944('0x27')][_0xa944('0x4b')]({'name':_0x44d72b[_0xa944('0x2b')],'resourceId':_0x44d72b['id'],'type':_0xd10bb9[_0xa944('0x2b')],'sectionId':_0xd10bb9['id']},{})[_0xa944('0x24')](function(){return _0x4cb0fd;});}else{return _0x4cb0fd;}})[_0xa944('0x45')](function(_0x254dd9){logger['error'](_0xa944('0x59'),_0x254dd9);});}return _0x4cb0fd;});})['then'](respondWithResult(_0x5b6154,0xc9))[_0xa944('0x45')](handleError(_0x5b6154,null));};exports[_0xa944('0x28')]=function(_0x48e624,_0x42bd73,_0x248774){var _0x459bc8;return db[_0xa944('0x2e')]['find']({'where':{'id':_0x48e624['params']['id']}})[_0xa944('0x24')](function(_0x37befa){if(_0x37befa){return db[_0xa944('0x4c')][_0xa944('0x4d')](function(_0x3775c9){return _0x37befa[_0xa944('0x28')]({'transaction':_0x3775c9,'raw':!![]})[_0xa944('0x24')](function(_0x473e79){if(_0x473e79[_0xa944('0x50')]){fs['readdirSync'](_0x473e79[_0xa944('0x50')])[_0xa944('0x5a')](function(_0xfa084f){fs[_0xa944('0x5b')](path['join'](_0x473e79[_0xa944('0x50')],_0xfa084f));});fs['rmdirSync'](_0x473e79[_0xa944('0x50')]);}return _0x473e79;});})[_0xa944('0x45')](function(_0x8d6a32){throw new db[(_0xa944('0x5c'))][(_0xa944('0x5d'))](_0x8d6a32['message']);});}})[_0xa944('0x24')](handleEntityNotFound(_0x42bd73,null))[_0xa944('0x24')](removeEntity(_0x42bd73,null))[_0xa944('0x45')](handleError(_0x42bd73,null));};exports['addSound']=function(_0x4e0e4f,_0x149669,_0x26864f){return db[_0xa944('0x4c')]['transaction'](function(_0x56fb1f){var _0x4adad8;return db[_0xa944('0x2e')][_0xa944('0x49')]({'where':{'id':_0x4e0e4f[_0xa944('0x47')]['id']}})[_0xa944('0x24')](function(_0x457b00){if(_0x457b00){_0x4adad8=_0x457b00;return _0x457b00[_0xa944('0x5e')](_0x4e0e4f[_0xa944('0x4a')]['id'],{'transaction':_0x56fb1f});}})[_0xa944('0x24')](function(_0x2bded7){if(_0x2bded7){return db[_0xa944('0x5f')][_0xa944('0x60')]({'where':{'id':_0x4e0e4f[_0xa944('0x4a')]['id']},'attributes':['id',_0xa944('0x2b'),_0xa944('0x61'),'converted_format',_0xa944('0x62')],'raw':!![]});}})[_0xa944('0x24')](function(_0x2a9319){if(_0x2a9319){var _0x553344=path[_0xa944('0x51')](config[_0xa944('0x52')],_0xa944('0x63'),util['format'](_0xa944('0x64'),path[_0xa944('0x65')](_0x2a9319['save_name'],path['extname'](_0x2a9319[_0xa944('0x61')])),_0x2a9319['converted_format']));var _0x54cbaa=path['join'](config[_0xa944('0x52')],_0xa944('0x53'),_0x4adad8['name'],util['format'](_0xa944('0x64'),_0x2a9319[_0xa944('0x2b')],_0x2a9319['converted_format']));fs[_0xa944('0x66')](_0x553344,_0x54cbaa);return _0x2a9319;}})[_0xa944('0x45')](function(_0x284794){throw new db['Sequelize'][(_0xa944('0x5d'))](_0x284794[_0xa944('0x67')]);});})[_0xa944('0x24')](handleEntityNotFound(_0x149669,null))[_0xa944('0x24')](respondWithResult(_0x149669,0xc9))[_0xa944('0x45')](handleError(_0x149669,null));};exports[_0xa944('0x68')]=function(_0x10df68,_0x167fa4,_0x2ca746){return db['sequelize'][_0xa944('0x4d')](function(_0x4b6780){var _0x150519;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x10df68['params']['id']}})['then'](handleEntityNotFound(_0x167fa4,null))['then'](function(_0xf22402){if(_0xf22402){_0x150519=_0xf22402;return _0xf22402[_0xa944('0x68')](_0x10df68[_0xa944('0x47')]['id2']);}})[_0xa944('0x24')](function(_0xe3729f){if(_0xe3729f){return db[_0xa944('0x5f')][_0xa944('0x60')]({'where':{'id':_0x10df68['params']['id2']},'attributes':['id',_0xa944('0x2b'),_0xa944('0x61'),_0xa944('0x69'),_0xa944('0x62')],'raw':!![]});}})[_0xa944('0x24')](function(_0x506064){if(_0x506064){fs[_0xa944('0x5b')](path['join'](_0x150519[_0xa944('0x50')],util[_0xa944('0x6a')](_0xa944('0x64'),_0x506064[_0xa944('0x2b')],_0x506064['converted_format'])));return _0x506064;}})[_0xa944('0x45')](function(_0x569ddf){throw new db[(_0xa944('0x5c'))][(_0xa944('0x5d'))](_0x569ddf[_0xa944('0x67')]);});})['then'](handleEntityNotFound(_0x167fa4,null))[_0xa944('0x24')](respondWithStatusCode(_0x167fa4,0xcc))['catch'](handleError(_0x167fa4,null));};exports[_0xa944('0x6b')]=function(_0x1023b4,_0x5d0224,_0x213f1a){var _0x19ff45={};var _0x2b8b8d={};var _0x4f6efc;var _0x28f63d;return db[_0xa944('0x2e')][_0xa944('0x60')]({'where':{'id':_0x1023b4[_0xa944('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d0224,null))[_0xa944('0x24')](function(_0x1b9db3){if(_0x1b9db3){_0x4f6efc=_0x1b9db3;_0x2b8b8d[_0xa944('0x32')]=_[_0xa944('0x34')](db[_0xa944('0x5f')][_0xa944('0x2f')]);_0x2b8b8d[_0xa944('0x33')]=_[_0xa944('0x34')](_0x1023b4[_0xa944('0x33')]);_0x2b8b8d['filters']=_[_0xa944('0x36')](_0x2b8b8d['model'],_0x2b8b8d['query']);_0x19ff45[_0xa944('0x37')]=_[_0xa944('0x36')](_0x2b8b8d[_0xa944('0x32')],qs[_0xa944('0x38')](_0x1023b4[_0xa944('0x33')][_0xa944('0x38')]));_0x19ff45[_0xa944('0x37')]=_0x19ff45[_0xa944('0x37')][_0xa944('0x48')]?_0x19ff45[_0xa944('0x37')]:_0x2b8b8d['model'];_0x19ff45[_0xa944('0x3a')]=qs[_0xa944('0x3b')](_0x1023b4[_0xa944('0x33')][_0xa944('0x3b')]);_0x19ff45[_0xa944('0x3c')]=qs['filters'](_[_0xa944('0x3d')](_0x1023b4[_0xa944('0x33')],_0x2b8b8d[_0xa944('0x35')]));if(_0x1023b4[_0xa944('0x33')][_0xa944('0x3e')]){_0x19ff45[_0xa944('0x3c')]=_[_0xa944('0x40')](_0x19ff45[_0xa944('0x3c')],{'$or':_[_0xa944('0x2d')](_0x19ff45['attributes'],function(_0xfc1638){var _0xd44d27={};_0xd44d27[_0xfc1638]={'$like':'%'+_0x1023b4[_0xa944('0x33')][_0xa944('0x3e')]+'%'};return _0xd44d27;})});}_0x19ff45=_[_0xa944('0x40')]({},_0x19ff45,_0x1023b4[_0xa944('0x41')]);return _0x4f6efc['getSounds'](_0x19ff45);}})[_0xa944('0x24')](function(_0x4073ef){if(_0x4073ef){_0x28f63d=_0x4073ef[_0xa944('0x48')];if(!_0x1023b4[_0xa944('0x33')]['hasOwnProperty'](_0xa944('0x6c'))){_0x19ff45[_0xa944('0x1e')]=qs[_0xa944('0x1e')](_0x1023b4['query'][_0xa944('0x1e')]);_0x19ff45[_0xa944('0x1d')]=qs[_0xa944('0x1d')](_0x1023b4['query'][_0xa944('0x1d')]);}return _0x4f6efc['getSounds'](_0x19ff45);}})['then'](function(_0x1c5b74){if(_0x1c5b74){return _0x1c5b74?{'count':_0x28f63d,'rows':_0x1c5b74}:null;}})[_0xa944('0x24')](respondWithResult(_0x5d0224,null))['catch'](handleError(_0x5d0224,null));}; \ No newline at end of file +var _0x6309=['VoiceMusicOnHold','findAll','rows','catch','show','params','find','update','body','sequelize','files','directory','root','server/files/moh','create','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','transaction','forEach','unlinkSync','Sequelize','ValidationError','addSound','findOne','converted_format','join','%s.%s','basename','save_name','extname','format','symlinkSync','message','removeSound','Sound','createdAt','getSounds','order','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','then','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','include'];(function(_0x1d7b16,_0x168739){var _0x59d484=function(_0x3701f4){while(--_0x3701f4){_0x1d7b16['push'](_0x1d7b16['shift']());}};_0x59d484(++_0x168739);}(_0x6309,0x9b));var _0x9630=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0x6309[_0x277fa3];return _0x2e4520;};'use strict';var emlformat=require(_0x9630('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9630('0x1'));var jsonpatch=require(_0x9630('0x2'));var rp=require(_0x9630('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9630('0x4'));var util=require(_0x9630('0x5'));var path=require('path');var sox=require(_0x9630('0x6'));var csv=require(_0x9630('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9630('0x8'));var _=require(_0x9630('0x9'));var squel=require(_0x9630('0xa'));var crypto=require(_0x9630('0xb'));var jsforce=require(_0x9630('0xc'));var deskjs=require(_0x9630('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9630('0xe'));var as=require(_0x9630('0xf'));var hardwareService=require(_0x9630('0x10'));var logger=require(_0x9630('0x11'))('api');var utils=require(_0x9630('0x12'));var config=require(_0x9630('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9630('0x14'))['db'];function respondWithStatusCode(_0x224169,_0x1c45a4){_0x1c45a4=_0x1c45a4||0xcc;return function(_0x3817fa){if(_0x3817fa){return _0x224169[_0x9630('0x15')](_0x1c45a4);}return _0x224169[_0x9630('0x16')](_0x1c45a4)['end']();};}function respondWithResult(_0x2da70e,_0x4b4bca){_0x4b4bca=_0x4b4bca||0xc8;return function(_0x137b0a){if(_0x137b0a){return _0x2da70e[_0x9630('0x16')](_0x4b4bca)[_0x9630('0x17')](_0x137b0a);}};}function respondWithFilteredResult(_0x2cc874,_0x2534ab){return function(_0x53a913){if(_0x53a913){var _0x1a260b=typeof _0x2534ab[_0x9630('0x18')]===_0x9630('0x19')&&typeof _0x2534ab['limit']===_0x9630('0x19');var _0x1d6189=_0x53a913[_0x9630('0x1a')];var _0x1d12ce=_0x1a260b?0x0:_0x2534ab[_0x9630('0x18')];var _0x597747=_0x1a260b?_0x53a913['count']:_0x2534ab[_0x9630('0x18')]+_0x2534ab[_0x9630('0x1b')];var _0x50c4cd;if(_0x597747>=_0x1d6189){_0x597747=_0x1d6189;_0x50c4cd=0xc8;}else{_0x50c4cd=0xce;}_0x2cc874['status'](_0x50c4cd);return _0x2cc874[_0x9630('0x1c')](_0x9630('0x1d'),_0x1d12ce+'-'+_0x597747+'/'+_0x1d6189)[_0x9630('0x17')](_0x53a913);}return null;};}function patchUpdates(_0x538ee3){return function(_0x2b68d6){try{jsonpatch['apply'](_0x2b68d6,_0x538ee3,!![]);}catch(_0x3cd49e){return BPromise['reject'](_0x3cd49e);}return _0x2b68d6[_0x9630('0x1e')]();};}function saveUpdates(_0x2f824b,_0x574b23){return function(_0x2273dd){if(_0x2273dd){return _0x2273dd['update'](_0x2f824b)[_0x9630('0x1f')](function(_0x37b29a){return _0x37b29a;});}return null;};}function removeEntity(_0x3ff88b,_0x2e0a7a){return function(_0xe54ec8){if(_0xe54ec8){return _0xe54ec8['destroy']()[_0x9630('0x1f')](function(){var _0x1046ea=_0xe54ec8[_0x9630('0x20')]({'plain':!![]});var _0x42d6fb=_0x9630('0x21');return db[_0x9630('0x22')]['destroy']({'where':{'type':_0x42d6fb,'resourceId':_0x1046ea['id']}})['then'](function(){return _0xe54ec8;});})[_0x9630('0x1f')](function(){_0x3ff88b[_0x9630('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fde93,_0xea006){return function(_0x3fce19){if(!_0x3fce19){_0x3fde93['sendStatus'](0x194);}return _0x3fce19;};}function handleError(_0x3985b9,_0x16816){_0x16816=_0x16816||0x1f4;return function(_0x2d1ce1){logger[_0x9630('0x23')](_0x2d1ce1[_0x9630('0x24')]);if(_0x2d1ce1[_0x9630('0x25')]){delete _0x2d1ce1['name'];}_0x3985b9['status'](_0x16816)[_0x9630('0x26')](_0x2d1ce1);};}exports[_0x9630('0x27')]=function(_0x5c7ce8,_0x2ebcd4){var _0x5ae5f3={},_0x5dcbc4={},_0x2b5a52={'count':0x0,'rows':[]};var _0x30d48a=_[_0x9630('0x28')](db['VoiceMusicOnHold'][_0x9630('0x29')],function(_0x21c1b1){return{'name':_0x21c1b1['fieldName'],'type':_0x21c1b1['type'][_0x9630('0x2a')]};});_0x5dcbc4[_0x9630('0x2b')]=_[_0x9630('0x28')](_0x30d48a,_0x9630('0x25'));_0x5dcbc4[_0x9630('0x2c')]=_[_0x9630('0x2d')](_0x5c7ce8[_0x9630('0x2c')]);_0x5dcbc4['filters']=_[_0x9630('0x2e')](_0x5dcbc4['model'],_0x5dcbc4[_0x9630('0x2c')]);_0x5ae5f3[_0x9630('0x2f')]=_[_0x9630('0x2e')](_0x5dcbc4[_0x9630('0x2b')],qs[_0x9630('0x30')](_0x5c7ce8['query'][_0x9630('0x30')]));_0x5ae5f3['attributes']=_0x5ae5f3[_0x9630('0x2f')][_0x9630('0x31')]?_0x5ae5f3[_0x9630('0x2f')]:_0x5dcbc4['model'];if(!_0x5c7ce8[_0x9630('0x2c')][_0x9630('0x32')]('nolimit')){_0x5ae5f3[_0x9630('0x1b')]=qs[_0x9630('0x1b')](_0x5c7ce8['query'][_0x9630('0x1b')]);_0x5ae5f3[_0x9630('0x18')]=qs[_0x9630('0x18')](_0x5c7ce8[_0x9630('0x2c')][_0x9630('0x18')]);}_0x5ae5f3['order']=qs['sort'](_0x5c7ce8[_0x9630('0x2c')]['sort']);delete _0x5c7ce8[_0x9630('0x2c')][_0x9630('0x33')];_0x5ae5f3[_0x9630('0x34')]=qs[_0x9630('0x35')](_[_0x9630('0x36')](_0x5c7ce8[_0x9630('0x2c')],_0x5dcbc4[_0x9630('0x35')]),_0x30d48a);if(_0x5c7ce8[_0x9630('0x2c')][_0x9630('0x37')]){_0x5ae5f3[_0x9630('0x34')]=_['merge'](_0x5ae5f3[_0x9630('0x34')],{'$or':_[_0x9630('0x28')](_0x30d48a,function(_0x149d61){if(_0x149d61[_0x9630('0x38')]!==_0x9630('0x39')){var _0x27fb14={};_0x27fb14[_0x149d61[_0x9630('0x25')]]={'$like':'%'+_0x5c7ce8[_0x9630('0x2c')][_0x9630('0x37')]+'%'};return _0x27fb14;}})});}_0x5ae5f3=_[_0x9630('0x3a')]({},_0x5ae5f3,_0x5c7ce8[_0x9630('0x3b')]);var _0x55d737={'where':_0x5ae5f3[_0x9630('0x34')]};return db['VoiceMusicOnHold']['count'](_0x55d737)[_0x9630('0x1f')](function(_0x932371){_0x2b5a52['count']=_0x932371;if(_0x5c7ce8['query']['includeAll']){_0x5ae5f3[_0x9630('0x3c')]=[{'all':!![]}];}return db[_0x9630('0x3d')][_0x9630('0x3e')](_0x5ae5f3);})['then'](function(_0x165100){_0x2b5a52[_0x9630('0x3f')]=_0x165100;return _0x2b5a52;})[_0x9630('0x1f')](respondWithFilteredResult(_0x2ebcd4,_0x5ae5f3))[_0x9630('0x40')](handleError(_0x2ebcd4,null));};exports[_0x9630('0x41')]=function(_0x33b570,_0x4d576f){var _0x257826={'raw':![],'where':{'id':_0x33b570[_0x9630('0x42')]['id']}},_0x57e11d={};_0x57e11d[_0x9630('0x2b')]=_[_0x9630('0x2d')](db[_0x9630('0x3d')][_0x9630('0x29')]);_0x57e11d['query']=_[_0x9630('0x2d')](_0x33b570['query']);_0x57e11d[_0x9630('0x35')]=_[_0x9630('0x2e')](_0x57e11d['model'],_0x57e11d[_0x9630('0x2c')]);_0x257826[_0x9630('0x2f')]=_[_0x9630('0x2e')](_0x57e11d[_0x9630('0x2b')],qs[_0x9630('0x30')](_0x33b570[_0x9630('0x2c')][_0x9630('0x30')]));_0x257826[_0x9630('0x2f')]=_0x257826[_0x9630('0x2f')]['length']?_0x257826[_0x9630('0x2f')]:_0x57e11d[_0x9630('0x2b')];if(_0x33b570[_0x9630('0x2c')]['includeAll']){_0x257826[_0x9630('0x3c')]=[{'all':!![]}];}_0x257826=_[_0x9630('0x3a')]({},_0x257826,_0x33b570[_0x9630('0x3b')]);return db[_0x9630('0x3d')][_0x9630('0x43')](_0x257826)[_0x9630('0x1f')](handleEntityNotFound(_0x4d576f,null))[_0x9630('0x1f')](respondWithResult(_0x4d576f,null))[_0x9630('0x40')](handleError(_0x4d576f,null));};exports[_0x9630('0x44')]=function(_0x56731c,_0x463131){if(_0x56731c[_0x9630('0x45')]['id']){delete _0x56731c[_0x9630('0x45')]['id'];}return db[_0x9630('0x3d')]['find']({'where':{'id':_0x56731c[_0x9630('0x42')]['id']}})[_0x9630('0x1f')](handleEntityNotFound(_0x463131,null))[_0x9630('0x1f')](saveUpdates(_0x56731c['body'],null))[_0x9630('0x1f')](respondWithResult(_0x463131,null))['catch'](handleError(_0x463131,null));};exports['create']=function(_0xe83295,_0x3f1b32,_0x1d8d35){return db[_0x9630('0x46')]['transaction'](function(_0x5bb0aa){if(_0xe83295['body']['mode']===_0x9630('0x47')){_0xe83295[_0x9630('0x45')][_0x9630('0x48')]=path['join'](config[_0x9630('0x49')],_0x9630('0x4a'),_0xe83295[_0x9630('0x45')][_0x9630('0x25')]);}return db[_0x9630('0x3d')][_0x9630('0x4b')](_0xe83295[_0x9630('0x45')],{'transaction':_0x5bb0aa})[_0x9630('0x1f')](function(_0x1fac33){if(_0xe83295[_0x9630('0x45')]['mode']===_0x9630('0x47')){fs[_0x9630('0x4c')](_0x1fac33['directory'],parseInt(_0x9630('0x4d'),0x8));}var _0x419022=_0xe83295[_0x9630('0x4e')][_0x9630('0x20')]({'plain':!![]});if(!_0x419022)throw new Error(_0x9630('0x4f'));if(_0x419022[_0x9630('0x50')]===_0x9630('0x4e')){var _0x58bb2d=_0x1fac33[_0x9630('0x20')]({'plain':!![]});return db[_0x9630('0x51')][_0x9630('0x43')]({'where':{'name':_0x9630('0x21'),'userProfileId':_0x419022[_0x9630('0x52')]},'raw':!![]})['then'](function(_0x32000e){if(_0x32000e&&_0x32000e[_0x9630('0x53')]===0x0){return db[_0x9630('0x22')][_0x9630('0x4b')]({'name':_0x58bb2d[_0x9630('0x25')],'resourceId':_0x58bb2d['id'],'type':_0x32000e[_0x9630('0x25')],'sectionId':_0x32000e['id']},{})[_0x9630('0x1f')](function(){return _0x1fac33;});}else{return _0x1fac33;}})[_0x9630('0x40')](function(_0x2bed00){logger[_0x9630('0x23')](_0x9630('0x54'),_0x2bed00);});}return _0x1fac33;});})[_0x9630('0x1f')](respondWithResult(_0x3f1b32,0xc9))['catch'](handleError(_0x3f1b32,null));};exports[_0x9630('0x55')]=function(_0xd0009,_0x4b7ae9,_0x3a1c99){var _0x3e467c;return db[_0x9630('0x3d')]['find']({'where':{'id':_0xd0009['params']['id']}})[_0x9630('0x1f')](function(_0x3cd03a){if(_0x3cd03a){return db[_0x9630('0x46')][_0x9630('0x56')](function(_0xae2b59){return _0x3cd03a['destroy']({'transaction':_0xae2b59,'raw':!![]})[_0x9630('0x1f')](function(_0x58a3b9){if(_0x58a3b9[_0x9630('0x48')]){fs['readdirSync'](_0x58a3b9[_0x9630('0x48')])[_0x9630('0x57')](function(_0x2ea1d8){fs[_0x9630('0x58')](path['join'](_0x58a3b9[_0x9630('0x48')],_0x2ea1d8));});fs['rmdirSync'](_0x58a3b9[_0x9630('0x48')]);}return _0x58a3b9;});})[_0x9630('0x40')](function(_0x546b39){throw new db[(_0x9630('0x59'))][(_0x9630('0x5a'))](_0x546b39['message']);});}})['then'](handleEntityNotFound(_0x4b7ae9,null))[_0x9630('0x1f')](removeEntity(_0x4b7ae9,null))[_0x9630('0x40')](handleError(_0x4b7ae9,null));};exports[_0x9630('0x5b')]=function(_0x47a264,_0x21a581,_0x204de2){return db[_0x9630('0x46')][_0x9630('0x56')](function(_0x52e149){var _0x4ba0aa;return db[_0x9630('0x3d')][_0x9630('0x43')]({'where':{'id':_0x47a264[_0x9630('0x42')]['id']}})[_0x9630('0x1f')](function(_0x28ae3c){if(_0x28ae3c){_0x4ba0aa=_0x28ae3c;return _0x28ae3c['addSound'](_0x47a264[_0x9630('0x45')]['id'],{'transaction':_0x52e149});}})[_0x9630('0x1f')](function(_0x5d6ad6){if(_0x5d6ad6){return db['Sound'][_0x9630('0x5c')]({'where':{'id':_0x47a264[_0x9630('0x45')]['id']},'attributes':['id',_0x9630('0x25'),'save_name',_0x9630('0x5d'),'createdAt'],'raw':!![]});}})[_0x9630('0x1f')](function(_0x29a985){if(_0x29a985){var _0x46da72=path[_0x9630('0x5e')](config[_0x9630('0x49')],'server/files/sounds/converted',util['format'](_0x9630('0x5f'),path[_0x9630('0x60')](_0x29a985[_0x9630('0x61')],path[_0x9630('0x62')](_0x29a985['save_name'])),_0x29a985['converted_format']));var _0x5c584a=path[_0x9630('0x5e')](config['root'],_0x9630('0x4a'),_0x4ba0aa[_0x9630('0x25')],util[_0x9630('0x63')](_0x9630('0x5f'),_0x29a985[_0x9630('0x25')],_0x29a985[_0x9630('0x5d')]));fs[_0x9630('0x64')](_0x46da72,_0x5c584a);return _0x29a985;}})[_0x9630('0x40')](function(_0x5ab90a){throw new db['Sequelize'][(_0x9630('0x5a'))](_0x5ab90a[_0x9630('0x65')]);});})['then'](handleEntityNotFound(_0x21a581,null))[_0x9630('0x1f')](respondWithResult(_0x21a581,0xc9))[_0x9630('0x40')](handleError(_0x21a581,null));};exports['removeSound']=function(_0xf17ab0,_0x43b10a,_0xc17633){return db[_0x9630('0x46')][_0x9630('0x56')](function(_0x333b37){var _0x59ce42;return db[_0x9630('0x3d')]['findOne']({'where':{'id':_0xf17ab0['params']['id']}})['then'](handleEntityNotFound(_0x43b10a,null))['then'](function(_0x221bd7){if(_0x221bd7){_0x59ce42=_0x221bd7;return _0x221bd7[_0x9630('0x66')](_0xf17ab0[_0x9630('0x42')]['id2']);}})[_0x9630('0x1f')](function(_0x277ad7){if(_0x277ad7){return db[_0x9630('0x67')]['findOne']({'where':{'id':_0xf17ab0[_0x9630('0x42')]['id2']},'attributes':['id',_0x9630('0x25'),_0x9630('0x61'),'converted_format',_0x9630('0x68')],'raw':!![]});}})['then'](function(_0x472212){if(_0x472212){fs[_0x9630('0x58')](path['join'](_0x59ce42['directory'],util['format']('%s.%s',_0x472212[_0x9630('0x25')],_0x472212[_0x9630('0x5d')])));return _0x472212;}})[_0x9630('0x40')](function(_0x2f460c){throw new db['Sequelize'][(_0x9630('0x5a'))](_0x2f460c[_0x9630('0x65')]);});})[_0x9630('0x1f')](handleEntityNotFound(_0x43b10a,null))[_0x9630('0x1f')](respondWithStatusCode(_0x43b10a,0xcc))[_0x9630('0x40')](handleError(_0x43b10a,null));};exports[_0x9630('0x69')]=function(_0x372cb3,_0x5657e0,_0x5d6c5c){var _0x2688fb={};var _0xdb2585={};var _0x15e40d;var _0x219c7d;return db[_0x9630('0x3d')][_0x9630('0x5c')]({'where':{'id':_0x372cb3[_0x9630('0x42')]['id']}})['then'](handleEntityNotFound(_0x5657e0,null))[_0x9630('0x1f')](function(_0x5eeac4){if(_0x5eeac4){_0x15e40d=_0x5eeac4;_0xdb2585['model']=_[_0x9630('0x2d')](db[_0x9630('0x67')][_0x9630('0x29')]);_0xdb2585[_0x9630('0x2c')]=_[_0x9630('0x2d')](_0x372cb3[_0x9630('0x2c')]);_0xdb2585[_0x9630('0x35')]=_[_0x9630('0x2e')](_0xdb2585[_0x9630('0x2b')],_0xdb2585[_0x9630('0x2c')]);_0x2688fb[_0x9630('0x2f')]=_[_0x9630('0x2e')](_0xdb2585['model'],qs['fields'](_0x372cb3[_0x9630('0x2c')][_0x9630('0x30')]));_0x2688fb[_0x9630('0x2f')]=_0x2688fb[_0x9630('0x2f')]['length']?_0x2688fb['attributes']:_0xdb2585[_0x9630('0x2b')];_0x2688fb[_0x9630('0x6a')]=qs[_0x9630('0x33')](_0x372cb3[_0x9630('0x2c')][_0x9630('0x33')]);_0x2688fb[_0x9630('0x34')]=qs[_0x9630('0x35')](_['pick'](_0x372cb3[_0x9630('0x2c')],_0xdb2585[_0x9630('0x35')]));if(_0x372cb3[_0x9630('0x2c')]['filter']){_0x2688fb[_0x9630('0x34')]=_[_0x9630('0x3a')](_0x2688fb[_0x9630('0x34')],{'$or':_['map'](_0x2688fb[_0x9630('0x2f')],function(_0x48ab9f){var _0x437a72={};_0x437a72[_0x48ab9f]={'$like':'%'+_0x372cb3[_0x9630('0x2c')][_0x9630('0x37')]+'%'};return _0x437a72;})});}_0x2688fb=_[_0x9630('0x3a')]({},_0x2688fb,_0x372cb3[_0x9630('0x3b')]);return _0x15e40d[_0x9630('0x69')](_0x2688fb);}})[_0x9630('0x1f')](function(_0x175a81){if(_0x175a81){_0x219c7d=_0x175a81[_0x9630('0x31')];if(!_0x372cb3['query']['hasOwnProperty'](_0x9630('0x6b'))){_0x2688fb[_0x9630('0x1b')]=qs[_0x9630('0x1b')](_0x372cb3[_0x9630('0x2c')]['limit']);_0x2688fb[_0x9630('0x18')]=qs[_0x9630('0x18')](_0x372cb3[_0x9630('0x2c')][_0x9630('0x18')]);}return _0x15e40d['getSounds'](_0x2688fb);}})[_0x9630('0x1f')](function(_0x370bda){if(_0x370bda){return _0x370bda?{'count':_0x219c7d,'rows':_0x370bda}:null;}})[_0x9630('0x1f')](respondWithResult(_0x5657e0,null))[_0x9630('0x40')](handleError(_0x5657e0,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 2b776d6..b3e9e46 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 _0xd139=['lodash','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','voice_musiconhold'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd139,0x1ef));var _0x9d13=function(_0x105f6f,_0x310038){_0x105f6f=_0x105f6f-0x0;var _0x432916=_0xd139[_0x105f6f];return _0x432916;};'use strict';var _=require(_0x9d13('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9d13('0x1'));var BPromise=require(_0x9d13('0x2'));var rp=require(_0x9d13('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d13('0x4'));var config=require(_0x9d13('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x9d13('0x6')]=function(_0x292fe4,_0x249fec){return _0x292fe4[_0x9d13('0x7')]('VoiceMusicOnHold',attributes,{'tableName':_0x9d13('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9362=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0x44df8d,_0x208563){var _0x2cb43=function(_0x2120ab){while(--_0x2120ab){_0x44df8d['push'](_0x44df8d['shift']());}};_0x2cb43(++_0x208563);}(_0x9362,0x111));var _0x2936=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9362[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2936('0x0'));var util=require(_0x2936('0x1'));var logger=require(_0x2936('0x2'))('api');var moment=require(_0x2936('0x3'));var BPromise=require(_0x2936('0x4'));var rp=require(_0x2936('0x5'));var fs=require('fs');var path=require(_0x2936('0x6'));var rimraf=require(_0x2936('0x7'));var config=require('../../config/environment');var attributes=require(_0x2936('0x8'));module['exports']=function(_0x2db419,_0x3beca5){return _0x2db419['define'](_0x2936('0x9'),attributes,{'tableName':_0x2936('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index d2a6f66..218455b 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x15738b,_0x2d8603){var _0x5411fe=function(_0x56a3f6){while(--_0x56a3f6){_0x15738b['push'](_0x15738b['shift']());}};_0x5411fe(++_0x2d8603);}(_0xedd9,0xfc));var _0x9edd=function(_0x464df5,_0x406a2a){_0x464df5=_0x464df5-0x0;var _0x472640=_0xedd9[_0x464df5];return _0x472640;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x29e812,_0x23666f){var _0x3976af=function(_0x4a16c9){while(--_0x4a16c9){_0x29e812['push'](_0x29e812['shift']());}};_0x3976af(++_0x23666f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x258919,_0x1754e6){_0x258919=_0x258919-0x0;var _0xfbd68b=_0xcb91[_0x258919];return _0xfbd68b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 91b7dab..e6a6d41 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 _0x2f91=['isAuthenticated','/describe','/:id','show','/:id/users','getAgents','getTeams','post','create','addAgents','/:id/teams','addTeams','put','delete','destroy','removeAgents','removeTeams','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get'];(function(_0x4d821c,_0x22bd0e){var _0x15dd5b=function(_0x20e8f2){while(--_0x20e8f2){_0x4d821c['push'](_0x4d821c['shift']());}};_0x15dd5b(++_0x22bd0e);}(_0x2f91,0x98));var _0x12f9=function(_0x275c2b,_0x3e3d78){_0x275c2b=_0x275c2b-0x0;var _0x41286e=_0x2f91[_0x275c2b];return _0x41286e;};'use strict';var multer=require(_0x12f9('0x0'));var util=require(_0x12f9('0x1'));var path=require(_0x12f9('0x2'));var timeout=require('connect-timeout');var express=require(_0x12f9('0x3'));var router=express[_0x12f9('0x4')]();var fs_extra=require(_0x12f9('0x5'));var auth=require(_0x12f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x12f9('0x7'));var controller=require(_0x12f9('0x8'));router[_0x12f9('0x9')]('/',auth[_0x12f9('0xa')](),controller['index']);router[_0x12f9('0x9')](_0x12f9('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x12f9('0xc'),auth[_0x12f9('0xa')](),controller[_0x12f9('0xd')]);router[_0x12f9('0x9')](_0x12f9('0xe'),auth[_0x12f9('0xa')](),controller[_0x12f9('0xf')]);router['get']('/:id/teams',auth[_0x12f9('0xa')](),controller[_0x12f9('0x10')]);router[_0x12f9('0x11')]('/',auth[_0x12f9('0xa')](),controller[_0x12f9('0x12')]);router[_0x12f9('0x11')](_0x12f9('0xe'),auth['isAuthenticated'](),controller[_0x12f9('0x13')]);router[_0x12f9('0x11')](_0x12f9('0x14'),auth[_0x12f9('0xa')](),controller[_0x12f9('0x15')]);router[_0x12f9('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x12f9('0x17')](_0x12f9('0xc'),auth[_0x12f9('0xa')](),controller[_0x12f9('0x18')]);router[_0x12f9('0x17')](_0x12f9('0xe'),auth[_0x12f9('0xa')](),controller[_0x12f9('0x19')]);router[_0x12f9('0x17')](_0x12f9('0x14'),auth[_0x12f9('0xa')](),controller[_0x12f9('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xb6ac=['index','/describe','/:id','getAgents','/:id/teams','getTeams','post','/:id/users','addAgents','addTeams','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated'];(function(_0x10dfdf,_0x36b623){var _0x4d857d=function(_0x4683ee){while(--_0x4683ee){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x4d857d(++_0x36b623);}(_0xb6ac,0x86));var _0xcb6a=function(_0x58e7fd,_0x118ed5){_0x58e7fd=_0x58e7fd-0x0;var _0x3d5075=_0xb6ac[_0x58e7fd];return _0x3d5075;};'use strict';var multer=require('multer');var util=require(_0xcb6a('0x0'));var path=require(_0xcb6a('0x1'));var timeout=require('connect-timeout');var express=require(_0xcb6a('0x2'));var router=express[_0xcb6a('0x3')]();var fs_extra=require(_0xcb6a('0x4'));var auth=require(_0xcb6a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcb6a('0x6'));var controller=require(_0xcb6a('0x7'));router[_0xcb6a('0x8')]('/',auth[_0xcb6a('0x9')](),controller[_0xcb6a('0xa')]);router[_0xcb6a('0x8')](_0xcb6a('0xb'),auth[_0xcb6a('0x9')](),controller['describe']);router[_0xcb6a('0x8')](_0xcb6a('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xcb6a('0x8')]('/:id/users',auth[_0xcb6a('0x9')](),controller[_0xcb6a('0xd')]);router['get'](_0xcb6a('0xe'),auth[_0xcb6a('0x9')](),controller[_0xcb6a('0xf')]);router[_0xcb6a('0x10')]('/',auth[_0xcb6a('0x9')](),controller['create']);router[_0xcb6a('0x10')](_0xcb6a('0x11'),auth[_0xcb6a('0x9')](),controller[_0xcb6a('0x12')]);router[_0xcb6a('0x10')](_0xcb6a('0xe'),auth[_0xcb6a('0x9')](),controller[_0xcb6a('0x13')]);router[_0xcb6a('0x14')](_0xcb6a('0xc'),auth[_0xcb6a('0x9')](),controller[_0xcb6a('0x15')]);router[_0xcb6a('0x16')](_0xcb6a('0xc'),auth[_0xcb6a('0x9')](),controller['destroy']);router[_0xcb6a('0x16')](_0xcb6a('0x11'),auth[_0xcb6a('0x9')](),controller['removeAgents']);router[_0xcb6a('0x16')](_0xcb6a('0xe'),auth[_0xcb6a('0x9')](),controller['removeTeams']);module[_0xcb6a('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 827a94a..98f08ad 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 _0x44ab=['STRING','name','getDataValue','INTEGER','sequelize','exports'];(function(_0x3a8db5,_0x31cff7){var _0x2c03cd=function(_0x47dba0){while(--_0x47dba0){_0x3a8db5['push'](_0x3a8db5['shift']());}};_0x2c03cd(++_0x31cff7);}(_0x44ab,0x12a));var _0xb44a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x44ab[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xb44a('0x0'));module[_0xb44a('0x1')]={'name':{'type':Sequelize[_0xb44a('0x2')],'allowNull':![],'unique':_0xb44a('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x3ed441){return'system-'+this[_0xb44a('0x4')](_0xb44a('0x3'))+'-';}},'description':{'type':Sequelize[_0xb44a('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xb44a('0x5')]}}; \ No newline at end of file +var _0xbc7a=['exports','VIRTUAL','system-','getDataValue','name','STRING','INTEGER'];(function(_0x24eb3f,_0x453898){var _0x1b7d8e=function(_0x219d55){while(--_0x219d55){_0x24eb3f['push'](_0x24eb3f['shift']());}};_0x1b7d8e(++_0x453898);}(_0xbc7a,0x149));var _0xabc7=function(_0x2d7e2a,_0x3378fc){_0x2d7e2a=_0x2d7e2a-0x0;var _0x438ab9=_0xbc7a[_0x2d7e2a];return _0x438ab9;};'use strict';var Sequelize=require('sequelize');module[_0xabc7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xabc7('0x1')],'get':function(_0x23ab2b){return _0xabc7('0x2')+this[_0xabc7('0x3')](_0xabc7('0x4'))+'-';}},'description':{'type':Sequelize[_0xabc7('0x5')]},'callerIdAll':{'type':Sequelize[_0xabc7('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0xabc7('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 4efa3be..4f6a7cf 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 _0xef0f=['sequelize','transaction','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','order','where','filter','getTeams','findOne','Team','online','interface','Agents','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','SELECT','every','TeamId','includes','all','compact','isEmpty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','end','status','json','offset','undefined','limit','count','set','reject','save','destroy','then','get','UserProfileResource','sendStatus','error','name','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','VIRTUAL','options','VoicePrefix','includeAll','include','findAll','catch','show','params','rawAttributes','find','describe','create','body','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','map','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','context','${EXTEN:','charAt','update','system-'];(function(_0xd9a9d0,_0xd63276){var _0x4b3e13=function(_0x2ee665){while(--_0x2ee665){_0xd9a9d0['push'](_0xd9a9d0['shift']());}};_0x4b3e13(++_0xd63276);}(_0xef0f,0x168));var _0xfef0=function(_0x2b2495,_0x39f341){_0x2b2495=_0x2b2495-0x0;var _0x220a1b=_0xef0f[_0x2b2495];return _0x220a1b;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];config['redis']=_[_0xfef0('0x1b')](config[_0xfef0('0x1c')],{'host':_0xfef0('0x1d'),'port':0x18eb});var socket=require(_0xfef0('0x1e'))(new Redis(config[_0xfef0('0x1c')]));require(_0xfef0('0x1f'))[_0xfef0('0x20')](socket);function respondWithStatusCode(_0x573ae7,_0x3d1f02){_0x3d1f02=_0x3d1f02||0xcc;return function(_0x554aaa){if(_0x554aaa){return _0x573ae7['sendStatus'](_0x3d1f02);}return _0x573ae7['status'](_0x3d1f02)[_0xfef0('0x21')]();};}function respondWithResult(_0x284b6d,_0x3510a7){_0x3510a7=_0x3510a7||0xc8;return function(_0x1bce2f){if(_0x1bce2f){return _0x284b6d[_0xfef0('0x22')](_0x3510a7)[_0xfef0('0x23')](_0x1bce2f);}};}function respondWithFilteredResult(_0x155833,_0x2887e6){return function(_0x581459){if(_0x581459){var _0xd60678=typeof _0x2887e6[_0xfef0('0x24')]===_0xfef0('0x25')&&typeof _0x2887e6[_0xfef0('0x26')]===_0xfef0('0x25');var _0x55912f=_0x581459[_0xfef0('0x27')];var _0x4e24de=_0xd60678?0x0:_0x2887e6[_0xfef0('0x24')];var _0x1a0aa0=_0xd60678?_0x581459[_0xfef0('0x27')]:_0x2887e6['offset']+_0x2887e6[_0xfef0('0x26')];var _0x4c304d;if(_0x1a0aa0>=_0x55912f){_0x1a0aa0=_0x55912f;_0x4c304d=0xc8;}else{_0x4c304d=0xce;}_0x155833[_0xfef0('0x22')](_0x4c304d);return _0x155833[_0xfef0('0x28')]('Content-Range',_0x4e24de+'-'+_0x1a0aa0+'/'+_0x55912f)['json'](_0x581459);}return null;};}function patchUpdates(_0x4b8b22){return function(_0x19fde8){try{jsonpatch['apply'](_0x19fde8,_0x4b8b22,!![]);}catch(_0x1f9970){return BPromise[_0xfef0('0x29')](_0x1f9970);}return _0x19fde8[_0xfef0('0x2a')]();};}function saveUpdates(_0x4483f2,_0x249fe4){return function(_0xd687ed){if(_0xd687ed){return _0xd687ed['update'](_0x4483f2)['then'](function(_0x316e20){return _0x316e20;});}return null;};}function removeEntity(_0x1ffaa4,_0x924f6e){return function(_0x34ca65){if(_0x34ca65){return _0x34ca65[_0xfef0('0x2b')]()[_0xfef0('0x2c')](function(){var _0x5df04f=_0x34ca65[_0xfef0('0x2d')]({'plain':!![]});var _0x391279='VoicePrefixes';return db[_0xfef0('0x2e')][_0xfef0('0x2b')]({'where':{'type':_0x391279,'resourceId':_0x5df04f['id']}})[_0xfef0('0x2c')](function(){return _0x34ca65;});})[_0xfef0('0x2c')](function(){_0x1ffaa4[_0xfef0('0x22')](0xcc)[_0xfef0('0x21')]();});}};}function handleEntityNotFound(_0x3e3c4c,_0x3e026a){return function(_0x26cb9a){if(!_0x26cb9a){_0x3e3c4c[_0xfef0('0x2f')](0x194);}return _0x26cb9a;};}function handleError(_0x3ee42f,_0x3ffea0){_0x3ffea0=_0x3ffea0||0x1f4;return function(_0x51af0f){logger[_0xfef0('0x30')](_0x51af0f['stack']);if(_0x51af0f['name']){delete _0x51af0f[_0xfef0('0x31')];}_0x3ee42f[_0xfef0('0x22')](_0x3ffea0)['send'](_0x51af0f);};}exports['index']=function(_0x5cf518,_0x4f65cd){var _0x4cce8a={},_0x417535={},_0x172d94={'count':0x0,'rows':[]};var _0x2fffae=_['map'](db['VoicePrefix']['rawAttributes'],function(_0x1f8110){return{'name':_0x1f8110['fieldName'],'type':_0x1f8110[_0xfef0('0x32')][_0xfef0('0x33')]};});_0x417535[_0xfef0('0x34')]=_['map'](_0x2fffae,_0xfef0('0x31'));_0x417535['query']=_[_0xfef0('0x35')](_0x5cf518[_0xfef0('0x36')]);_0x417535[_0xfef0('0x37')]=_[_0xfef0('0x38')](_0x417535[_0xfef0('0x34')],_0x417535[_0xfef0('0x36')]);_0x4cce8a[_0xfef0('0x39')]=_[_0xfef0('0x38')](_0x417535['model'],qs[_0xfef0('0x3a')](_0x5cf518[_0xfef0('0x36')][_0xfef0('0x3a')]));_0x4cce8a[_0xfef0('0x39')]=_0x4cce8a[_0xfef0('0x39')][_0xfef0('0x3b')]?_0x4cce8a[_0xfef0('0x39')]:_0x417535[_0xfef0('0x34')];if(!_0x5cf518[_0xfef0('0x36')][_0xfef0('0x3c')](_0xfef0('0x3d'))){_0x4cce8a[_0xfef0('0x26')]=qs[_0xfef0('0x26')](_0x5cf518['query'][_0xfef0('0x26')]);_0x4cce8a['offset']=qs[_0xfef0('0x24')](_0x5cf518[_0xfef0('0x36')][_0xfef0('0x24')]);}_0x4cce8a['order']=qs[_0xfef0('0x3e')](_0x5cf518[_0xfef0('0x36')][_0xfef0('0x3e')]);_0x4cce8a['where']=qs[_0xfef0('0x37')](_[_0xfef0('0x3f')](_0x5cf518[_0xfef0('0x36')],_0x417535['filters']),_0x2fffae);if(_0x5cf518[_0xfef0('0x36')]['filter']){_0x4cce8a['where']=_[_0xfef0('0x40')](_0x4cce8a['where'],{'$or':_['map'](_0x2fffae,function(_0xbf6ddd){if(_0xbf6ddd[_0xfef0('0x32')]!==_0xfef0('0x41')){var _0x1a6593={};_0x1a6593[_0xbf6ddd[_0xfef0('0x31')]]={'$like':'%'+_0x5cf518[_0xfef0('0x36')]['filter']+'%'};return _0x1a6593;}})});}_0x4cce8a=_[_0xfef0('0x40')]({},_0x4cce8a,_0x5cf518[_0xfef0('0x42')]);var _0x5a9ed3={'where':_0x4cce8a['where']};return db[_0xfef0('0x43')]['count'](_0x5a9ed3)[_0xfef0('0x2c')](function(_0x22c940){_0x172d94[_0xfef0('0x27')]=_0x22c940;if(_0x5cf518[_0xfef0('0x36')][_0xfef0('0x44')]){_0x4cce8a[_0xfef0('0x45')]=[{'all':!![]}];}return db[_0xfef0('0x43')][_0xfef0('0x46')](_0x4cce8a);})['then'](function(_0x1813dc){_0x172d94['rows']=_0x1813dc;return _0x172d94;})['then'](respondWithFilteredResult(_0x4f65cd,_0x4cce8a))[_0xfef0('0x47')](handleError(_0x4f65cd,null));};exports[_0xfef0('0x48')]=function(_0x5bf416,_0x2af79f){var _0x5587a9={'raw':![],'where':{'id':_0x5bf416[_0xfef0('0x49')]['id']}},_0x39df7c={};_0x39df7c[_0xfef0('0x34')]=_[_0xfef0('0x35')](db['VoicePrefix'][_0xfef0('0x4a')]);_0x39df7c[_0xfef0('0x36')]=_['keys'](_0x5bf416['query']);_0x39df7c[_0xfef0('0x37')]=_['intersection'](_0x39df7c[_0xfef0('0x34')],_0x39df7c[_0xfef0('0x36')]);_0x5587a9[_0xfef0('0x39')]=_[_0xfef0('0x38')](_0x39df7c[_0xfef0('0x34')],qs[_0xfef0('0x3a')](_0x5bf416['query'][_0xfef0('0x3a')]));_0x5587a9['attributes']=_0x5587a9['attributes'][_0xfef0('0x3b')]?_0x5587a9[_0xfef0('0x39')]:_0x39df7c[_0xfef0('0x34')];if(_0x5bf416['query'][_0xfef0('0x44')]){_0x5587a9['include']=[{'all':!![]}];}_0x5587a9=_['merge']({},_0x5587a9,_0x5bf416['options']);return db[_0xfef0('0x43')][_0xfef0('0x4b')](_0x5587a9)[_0xfef0('0x2c')](handleEntityNotFound(_0x2af79f,null))[_0xfef0('0x2c')](respondWithResult(_0x2af79f,null))[_0xfef0('0x47')](handleError(_0x2af79f,null));};exports[_0xfef0('0x2b')]=function(_0x1b78af,_0x3853bb){return db[_0xfef0('0x43')]['find']({'where':{'id':_0x1b78af['params']['id']}})[_0xfef0('0x2c')](handleEntityNotFound(_0x3853bb,null))[_0xfef0('0x2c')](removeEntity(_0x3853bb,null))[_0xfef0('0x47')](handleError(_0x3853bb,null));};exports[_0xfef0('0x4c')]=function(_0x393fee,_0x1e1458){return db[_0xfef0('0x43')][_0xfef0('0x4c')]()['then'](respondWithResult(_0x1e1458,null))[_0xfef0('0x47')](handleError(_0x1e1458,null));};exports[_0xfef0('0x4d')]=function(_0x247caf,_0x10378e){var _0x6591d4;return db['sequelize']['transaction'](function(_0x523763){return db[_0xfef0('0x43')][_0xfef0('0x4d')](_0x247caf[_0xfef0('0x4e')],{'transaction':_0x523763})[_0xfef0('0x2c')](function(_0x4e959e){_0x6591d4=_0x4e959e[_0xfef0('0x2d')]({'plain':!![]});return db[_0xfef0('0x4f')][_0xfef0('0x4b')]({'where':{'id':_0x6591d4[_0xfef0('0x50')]},'raw':!![]})[_0xfef0('0x2c')](function(_0x2f94c4){return createVoicePrefixExtensions(_0x6591d4,_0x2f94c4,_0x523763);});});})[_0xfef0('0x2c')](function(){var _0x4cd0fd=_0x247caf[_0xfef0('0x51')][_0xfef0('0x2d')]({'plain':!![]});if(!_0x4cd0fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4cd0fd[_0xfef0('0x52')]==='user'){var _0x175e97=_0x6591d4;return db[_0xfef0('0x53')]['find']({'where':{'name':_0xfef0('0x54'),'userProfileId':_0x4cd0fd['userProfileId']},'raw':!![]})['then'](function(_0x4812c7){if(_0x4812c7&&_0x4812c7[_0xfef0('0x55')]===0x0){return db[_0xfef0('0x2e')][_0xfef0('0x4d')]({'name':_0x175e97[_0xfef0('0x31')],'resourceId':_0x175e97['id'],'type':_0x4812c7[_0xfef0('0x31')],'sectionId':_0x4812c7['id']},{})[_0xfef0('0x2c')](function(){return _0x6591d4;});}else{return _0x6591d4;}})['catch'](function(_0xa365e5){logger[_0xfef0('0x30')](_0xfef0('0x56'),_0xa365e5);throw _0xa365e5;});}return _0x6591d4;})[_0xfef0('0x2c')](respondWithResult(_0x10378e,null))[_0xfef0('0x47')](handleError(_0x10378e,null));};function Extension(_0x58d95e,_0x59d1b6,_0x4aef94,_0x135653){this['context']=_0xfef0('0x57');this[_0xfef0('0x58')]=_0x58d95e;this[_0xfef0('0x59')]=_0x4aef94;this[_0xfef0('0x32')]=_0xfef0('0x5a');this['description']=_0xfef0('0x5b');this['priority']=_0x59d1b6;this[_0xfef0('0x5c')]=_0x135653;}function createVoicePrefixExtensions(_0x4a1316,_0x4a4d36,_0x3a12c5){return new BPromise(function(_0x3c5640,_0xd6de4d){var _0x35a486=new Extension(formatPrefixName(_0x4a1316[_0xfef0('0x5d')]),0x1,_0xfef0('0x5e'),_0xfef0('0x5f'));_0x35a486[_0xfef0('0x60')]=_0x4a1316['id'];return db[_0xfef0('0x4f')][_0xfef0('0x4d')](_0x35a486,{'transaction':_0x3a12c5})[_0xfef0('0x2c')](function(_0x46d0bb){var _0x5df358=_0x46d0bb[_0xfef0('0x2d')]({'plain':!![]});var _0x3b660c=_[_0xfef0('0x61')](addVoicePrefixExtensions(_0x4a1316,_0x4a4d36),function(_0x312dcf){_0x312dcf[_0xfef0('0x50')]=_0x5df358['id'];_0x312dcf['VoicePrefixId']=_0x4a1316['id'];return _0x312dcf;});return db[_0xfef0('0x4f')][_0xfef0('0x62')](_0x3b660c,{'transaction':_0x3a12c5})[_0xfef0('0x2c')](function(_0x3c6bb8){if(!_0x3c6bb8){return _0xd6de4d(_0xfef0('0x63'));}else{return _0x3c5640(_0x3c6bb8);}})[_0xfef0('0x47')](function(_0xb9693b){return _0xd6de4d(_0xb9693b);});});;});};function addVoicePrefixExtensions(_0x103ca3,_0x14d53d){var _0x3f26d9=[];var _0x4f7ad3=formatPrefixName(_0x103ca3[_0xfef0('0x5d')]);_0x3f26d9['push'](new Extension(_0x4f7ad3,0x2,_0xfef0('0x64'),_0xfef0('0x65')+_0x103ca3['name']));if(_0x103ca3[_0xfef0('0x66')]){_0x3f26d9[_0xfef0('0x67')](new Extension(_0x4f7ad3,0x3,_0xfef0('0x64'),_0xfef0('0x68')+_0x103ca3[_0xfef0('0x66')]));}else{_0x3f26d9['push'](new Extension(_0x4f7ad3,0x3,_0xfef0('0x5e'),_0xfef0('0x69')));}_0x3f26d9[_0xfef0('0x67')](new Extension(_0x4f7ad3,0x4,'goto',_0x14d53d[_0xfef0('0x6a')]+','+_0xfef0('0x6b')+(0x8+_0x103ca3[_0xfef0('0x31')][_0xfef0('0x3b')])+'}'+','+0x1));return _0x3f26d9;}function formatPrefixName(_0x7186c8){var _0x3cfe32='_';for(var _0x45ba65=0x0;_0x45ba65<_0x7186c8['length'];_0x45ba65++){if(_0x7186c8[_0xfef0('0x6c')](_0x45ba65)=='-'){_0x3cfe32+=_0x7186c8[_0xfef0('0x6c')](_0x45ba65);}else{_0x3cfe32+='['+_0x7186c8[_0xfef0('0x6c')](_0x45ba65)+']';}}_0x3cfe32+='.';return _0x3cfe32;}exports[_0xfef0('0x6d')]=function(_0x317eda,_0x2dde67,_0x488db4){var _0x340517=_0x317eda[_0xfef0('0x4e')];_0x340517[_0xfef0('0x5d')]=_0xfef0('0x6e')+_0x340517['name']+'-';return db[_0xfef0('0x6f')][_0xfef0('0x70')](function(_0x5a33a1){return db[_0xfef0('0x43')][_0xfef0('0x6d')](_0x340517,{'where':{'id':_0x340517['id']},'transaction':_0x5a33a1})[_0xfef0('0x2c')](function(){return db[_0xfef0('0x4f')][_0xfef0('0x2b')]({'where':{'VoicePrefixId':_0x340517['id']},'transaction':_0x5a33a1})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x340517[_0xfef0('0x50')]},'raw':!![]})[_0xfef0('0x2c')](function(_0x2474b2){return createVoicePrefixExtensions(_0x340517,_0x2474b2,_0x5a33a1);});});});})['then'](function(){return db[_0xfef0('0x43')]['findById'](_0x340517['id']);})['then'](respondWithResult(_0x2dde67,null))['catch'](handleError(_0x2dde67,null));};exports[_0xfef0('0x71')]=function(_0x1cf182,_0x50cd7a,_0x166aab){return db[_0xfef0('0x43')][_0xfef0('0x4b')]({'where':{'id':_0x1cf182['params']['id']}})[_0xfef0('0x2c')](handleEntityNotFound(_0x50cd7a,null))['then'](function(_0x5ee0c0){if(_0x5ee0c0){return _0x5ee0c0[_0xfef0('0x71')](_0x1cf182[_0xfef0('0x4e')][_0xfef0('0x72')],_[_0xfef0('0x73')](_0x1cf182['body'],['ids','id'])||{})['spread'](function(_0xd973d3){for(var _0x546455=0x0;_0x546455<_0x1cf182[_0xfef0('0x4e')][_0xfef0('0x72')][_0xfef0('0x3b')];_0x546455+=0x1){socket[_0xfef0('0x74')](_0xfef0('0x75'),{'UserId':Number(_0x1cf182['body'][_0xfef0('0x72')][_0x546455]),'VoicePrefixId':Number(_0x1cf182['params']['id'])});}return _0xd973d3;});}})['then'](respondWithResult(_0x50cd7a,null))[_0xfef0('0x47')](handleError(_0x50cd7a,null));};exports[_0xfef0('0x76')]=function(_0xc30175,_0x3bfe3f,_0x5a17a9){return db['VoicePrefix'][_0xfef0('0x4b')]({'where':{'id':_0xc30175[_0xfef0('0x49')]['id']}})['then'](handleEntityNotFound(_0x3bfe3f,null))[_0xfef0('0x2c')](function(_0x3bbb7e){if(_0x3bbb7e){return _0x3bbb7e[_0xfef0('0x76')](_0xc30175[_0xfef0('0x36')][_0xfef0('0x72')])[_0xfef0('0x2c')](function(){if(_[_0xfef0('0x77')](_0xc30175[_0xfef0('0x36')][_0xfef0('0x72')])){for(var _0x52fe45=0x0;_0x52fe45<_0xc30175[_0xfef0('0x36')][_0xfef0('0x72')][_0xfef0('0x3b')];_0x52fe45+=0x1){socket[_0xfef0('0x74')](_0xfef0('0x78'),{'UserId':Number(_0xc30175[_0xfef0('0x36')][_0xfef0('0x72')][_0x52fe45]),'VoicePrefixId':Number(_0xc30175['params']['id'])});}}else{socket[_0xfef0('0x74')](_0xfef0('0x78'),{'UserId':Number(_0xc30175[_0xfef0('0x36')][_0xfef0('0x72')]),'VoicePrefixId':Number(_0xc30175[_0xfef0('0x49')]['id'])});}});}})[_0xfef0('0x2c')](respondWithStatusCode(_0x3bfe3f,null))[_0xfef0('0x47')](handleError(_0x3bfe3f,null));};exports[_0xfef0('0x79')]=function(_0x32944e,_0x39c591,_0x1f2413){var _0x17c350={};var _0x283d5a={};var _0x5630a6;var _0x32aab6;return db['VoicePrefix']['findOne']({'where':{'id':_0x32944e[_0xfef0('0x49')]['id']}})[_0xfef0('0x2c')](handleEntityNotFound(_0x39c591,null))['then'](function(_0x299116){if(_0x299116){_0x5630a6=_0x299116;_0x283d5a['model']=_['keys'](db[_0xfef0('0x7a')][_0xfef0('0x4a')]);_0x283d5a[_0xfef0('0x36')]=_[_0xfef0('0x35')](_0x32944e['query']);_0x283d5a[_0xfef0('0x37')]=_[_0xfef0('0x38')](_0x283d5a['model'],_0x283d5a[_0xfef0('0x36')]);_0x17c350[_0xfef0('0x39')]=_[_0xfef0('0x38')](_0x283d5a['model'],qs['fields'](_0x32944e[_0xfef0('0x36')]['fields']));_0x17c350['attributes']=_0x17c350[_0xfef0('0x39')]['length']?_0x17c350[_0xfef0('0x39')]:_0x283d5a[_0xfef0('0x34')];_0x17c350[_0xfef0('0x7b')]=qs[_0xfef0('0x3e')](_0x32944e[_0xfef0('0x36')][_0xfef0('0x3e')]);_0x17c350[_0xfef0('0x7c')]=qs[_0xfef0('0x37')](_[_0xfef0('0x3f')](_0x32944e[_0xfef0('0x36')],_0x283d5a['filters']));if(_0x32944e[_0xfef0('0x36')]['filter']){_0x17c350['where']=_[_0xfef0('0x40')](_0x17c350['where'],{'$or':_[_0xfef0('0x61')](_0x17c350[_0xfef0('0x39')],function(_0x2e7268){var _0x34b802={};_0x34b802[_0x2e7268]={'$like':'%'+_0x32944e[_0xfef0('0x36')][_0xfef0('0x7d')]+'%'};return _0x34b802;})});}_0x17c350=_['merge']({},_0x17c350,_0x32944e[_0xfef0('0x42')]);return _0x5630a6[_0xfef0('0x79')](_0x17c350);}})[_0xfef0('0x2c')](function(_0x17a514){if(_0x17a514){_0x32aab6=_0x17a514[_0xfef0('0x3b')];if(!_0x32944e[_0xfef0('0x36')][_0xfef0('0x3c')](_0xfef0('0x3d'))){_0x17c350['limit']=qs[_0xfef0('0x26')](_0x32944e[_0xfef0('0x36')]['limit']);_0x17c350[_0xfef0('0x24')]=qs[_0xfef0('0x24')](_0x32944e[_0xfef0('0x36')]['offset']);}return _0x5630a6[_0xfef0('0x79')](_0x17c350);}})['then'](function(_0x1cb952){if(_0x1cb952){return _0x1cb952?{'count':_0x32aab6,'rows':_0x1cb952}:null;}})[_0xfef0('0x2c')](respondWithResult(_0x39c591,null))['catch'](handleError(_0x39c591,null));};exports[_0xfef0('0x7e')]=function(_0x51f79b,_0x1fa881,_0x8c4979){var _0x1b8ee7={};var _0x3eff14={};var _0x14d871;var _0x306319;return db[_0xfef0('0x43')][_0xfef0('0x7f')]({'where':{'id':_0x51f79b[_0xfef0('0x49')]['id']}})[_0xfef0('0x2c')](handleEntityNotFound(_0x1fa881,null))[_0xfef0('0x2c')](function(_0x5b7ffa){if(_0x5b7ffa){_0x14d871=_0x5b7ffa;_0x3eff14[_0xfef0('0x34')]=_['keys'](db['Team'][_0xfef0('0x4a')]);_0x3eff14['query']=_[_0xfef0('0x35')](_0x51f79b['query']);_0x3eff14['filters']=_[_0xfef0('0x38')](_0x3eff14['model'],_0x3eff14['query']);_0x1b8ee7['attributes']=_[_0xfef0('0x38')](_0x3eff14[_0xfef0('0x34')],qs[_0xfef0('0x3a')](_0x51f79b[_0xfef0('0x36')]['fields']));_0x1b8ee7[_0xfef0('0x39')]=_0x1b8ee7[_0xfef0('0x39')][_0xfef0('0x3b')]?_0x1b8ee7[_0xfef0('0x39')]:_0x3eff14[_0xfef0('0x34')];_0x1b8ee7['order']=qs['sort'](_0x51f79b[_0xfef0('0x36')][_0xfef0('0x3e')]);_0x1b8ee7['where']=qs[_0xfef0('0x37')](_[_0xfef0('0x3f')](_0x51f79b[_0xfef0('0x36')],_0x3eff14[_0xfef0('0x37')]));if(_0x51f79b[_0xfef0('0x36')][_0xfef0('0x7d')]){_0x1b8ee7[_0xfef0('0x7c')]=_[_0xfef0('0x40')](_0x1b8ee7['where'],{'$or':_['map'](_0x1b8ee7[_0xfef0('0x39')],function(_0x4135b0){var _0x14fc20={};_0x14fc20[_0x4135b0]={'$like':'%'+_0x51f79b[_0xfef0('0x36')][_0xfef0('0x7d')]+'%'};return _0x14fc20;})});}_0x1b8ee7=_[_0xfef0('0x40')]({},_0x1b8ee7,_0x51f79b[_0xfef0('0x42')]);return _0x14d871[_0xfef0('0x7e')](_0x1b8ee7);}})['then'](function(_0x5d7df9){if(_0x5d7df9){_0x306319=_0x5d7df9[_0xfef0('0x3b')];if(!_0x51f79b[_0xfef0('0x36')][_0xfef0('0x3c')](_0xfef0('0x3d'))){_0x1b8ee7[_0xfef0('0x26')]=qs[_0xfef0('0x26')](_0x51f79b['query'][_0xfef0('0x26')]);_0x1b8ee7[_0xfef0('0x24')]=qs['offset'](_0x51f79b[_0xfef0('0x36')][_0xfef0('0x24')]);}return _0x14d871[_0xfef0('0x7e')](_0x1b8ee7);}})[_0xfef0('0x2c')](function(_0x3b8b10){if(_0x3b8b10){return _0x3b8b10?{'count':_0x306319,'rows':_0x3b8b10}:null;}})[_0xfef0('0x2c')](respondWithResult(_0x1fa881,null))['catch'](handleError(_0x1fa881,null));};exports['addTeams']=function(_0x1084b9,_0xd7c5b,_0xd2c0be){var _0x15eefc=_0x1084b9[_0xfef0('0x4e')][_0xfef0('0x72')];var _0x4df302;return db[_0xfef0('0x80')]['findAll']({'where':{'id':_0x15eefc},'attributes':['id'],'include':[{'model':db[_0xfef0('0x7a')],'as':'Agents','attributes':['id',_0xfef0('0x31'),_0xfef0('0x81'),'voicePause',_0xfef0('0x82')],'raw':!![]}]})[_0xfef0('0x2c')](function(_0xc91fea){if(_0xc91fea){_0x4df302=_0xc91fea;var _0x4d56e5=_['flatMap'](_0xc91fea,function(_0x57083a){var _0x3a28b2=_0x57083a['get']({'plain':!![]});return _0x3a28b2[_0xfef0('0x83')];});return db[_0xfef0('0x43')]['find']({'where':{'id':_0x1084b9[_0xfef0('0x49')]['id']}})['then'](function(_0x43ee5f){return db[_0xfef0('0x6f')][_0xfef0('0x70')](function(_0x1a9ed3){return _0x43ee5f[_0xfef0('0x84')](_0x15eefc,{'transaction':_0x1a9ed3})[_0xfef0('0x2c')](function(){return BPromise[_0xfef0('0x85')](_0x4df302,function(_0x53ecba){return db[_0xfef0('0x86')][_0xfef0('0x87')]({'TeamId':_0x53ecba['id'],'VoicePrefixId':_0x1084b9[_0xfef0('0x49')]['id']},{'transaction':_0x1a9ed3});});})[_0xfef0('0x2c')](function(){return BPromise[_0xfef0('0x85')](_0x4d56e5,function(_0x110ef9){return db[_0xfef0('0x88')][_0xfef0('0x89')]({'where':{'UserId':_0x110ef9['id'],'VoicePrefixId':_0x1084b9[_0xfef0('0x49')]['id']},'transaction':_0x1a9ed3});});})[_0xfef0('0x2c')](function(){_0x4d56e5[_0xfef0('0x8a')](function(_0x34f1db){socket[_0xfef0('0x74')](_0xfef0('0x75'),{'UserId':_0x34f1db['id'],'VoicePrefixId':_0x43ee5f['id']});});});});});}})['then'](respondWithStatusCode(_0xd7c5b,null))[_0xfef0('0x47')](handleError(_0xd7c5b,null));};exports[_0xfef0('0x8b')]=function(_0x29ad24,_0x1ee5ad,_0xeea2ff){return db[_0xfef0('0x80')][_0xfef0('0x46')]({'where':{'id':_0x29ad24[_0xfef0('0x36')][_0xfef0('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfef0('0x2c')](handleEntityNotFound(_0x1ee5ad,null))['then'](function(_0x63704){var _0x3d85ec=_[_0xfef0('0x61')](_0x63704,'id');var _0x17ab00=[];var _0xd9c290=[];var _0x365938=squel[_0xfef0('0x8c')]();_0x365938[_0xfef0('0x8d')](_0xfef0('0x8e'))[_0xfef0('0x8f')](_0xfef0('0x90'),'tq')['join'](_0xfef0('0x91'),'ut',_0xfef0('0x92'))['where'](_0xfef0('0x93'),_0x29ad24[_0xfef0('0x49')]['id']);for(var _0x524db7=0x0;_0x524db7<_0x63704[_0xfef0('0x3b')];_0x524db7+=0x1){let _0x591f01=_0x63704[_0x524db7];for(var _0x6ccbf8=0x0;_0x6ccbf8<_0x591f01[_0xfef0('0x83')][_0xfef0('0x3b')];_0x6ccbf8+=0x1){let _0xdf3db9=_0x591f01[_0xfef0('0x83')][_0x6ccbf8];var _0x520ff3=_0x365938[_0xfef0('0x94')]();_0x520ff3[_0xfef0('0x7c')]('ut.UserId\x20=\x20?',_0xdf3db9['id']);_0xd9c290[_0xfef0('0x67')](db['sequelize'][_0xfef0('0x36')](_0x520ff3[_0xfef0('0x95')](),{'type':db[_0xfef0('0x6f')]['QueryTypes'][_0xfef0('0x96')]})['then'](function(_0x5dde37){if(_0x5dde37[_0xfef0('0x3b')]===0x1){return _0xdf3db9['id'];}else{var _0x57b2b4=_[_0xfef0('0x97')](_[_0xfef0('0x61')](_0x5dde37,_0xfef0('0x98')),function(_0x11c5f0){return _[_0xfef0('0x99')](_0x3d85ec,_0x11c5f0);});if(_0x57b2b4){return _0xdf3db9['id'];}}}));}}return BPromise[_0xfef0('0x9a')](_0xd9c290)[_0xfef0('0x2c')](function(_0x547b4d){_0x17ab00=_(_0x17ab00)['union'](_0x547b4d)[_0xfef0('0x9b')]()['value']();return db[_0xfef0('0x43')][_0xfef0('0x4b')]({'where':{'id':_0x29ad24[_0xfef0('0x49')]['id']}})[_0xfef0('0x2c')](function(_0x3f9588){return db[_0xfef0('0x6f')][_0xfef0('0x70')](function(_0x326c85){return _0x3f9588['removeTeams'](_0x29ad24['query'][_0xfef0('0x72')],{'transaction':_0x326c85})[_0xfef0('0x2c')](function(){if(!_[_0xfef0('0x9c')](_0x17ab00)){return _0x3f9588[_0xfef0('0x76')](_0x17ab00,{'transaction':_0x326c85});}})[_0xfef0('0x2c')](function(){_0x17ab00['forEach'](function(_0x54d98e){socket['emit'](_0xfef0('0x78'),{'UserId':_0x54d98e,'VoicePrefixId':_0x3f9588['id']});});});});});});})[_0xfef0('0x2c')](respondWithStatusCode(_0x1ee5ad,null))['catch'](handleError(_0x1ee5ad,null));}; \ No newline at end of file +var _0x63a5=['merge','VIRTUAL','options','includeAll','include','VoicePrefix','findAll','rows','catch','show','params','rawAttributes','keys','find','describe','create','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','context','from-sip','exten','app','appdata','prefix','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','charAt','system-','transaction','findById','addAgents','ids','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','pick','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','select','field','tq.TeamId','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','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','redis','defaults','localhost','socket.io-emitter','register','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','sendStatus','error','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter'];(function(_0x4f84e2,_0x46e547){var _0xd9601b=function(_0x4b7060){while(--_0x4b7060){_0x4f84e2['push'](_0x4f84e2['shift']());}};_0xd9601b(++_0x46e547);}(_0x63a5,0x18e));var _0x563a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x63a5[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];config[_0x563a('0x19')]=_[_0x563a('0x1a')](config[_0x563a('0x19')],{'host':_0x563a('0x1b'),'port':0x18eb});var socket=require(_0x563a('0x1c'))(new Redis(config[_0x563a('0x19')]));require('./voicePrefix.socket')[_0x563a('0x1d')](socket);function respondWithStatusCode(_0x3045ac,_0x8c3727){_0x8c3727=_0x8c3727||0xcc;return function(_0x26987f){if(_0x26987f){return _0x3045ac['sendStatus'](_0x8c3727);}return _0x3045ac['status'](_0x8c3727)[_0x563a('0x1e')]();};}function respondWithResult(_0x2ad667,_0x5b291f){_0x5b291f=_0x5b291f||0xc8;return function(_0x2ade24){if(_0x2ade24){return _0x2ad667[_0x563a('0x1f')](_0x5b291f)[_0x563a('0x20')](_0x2ade24);}};}function respondWithFilteredResult(_0x9c2f77,_0x4f947d){return function(_0x598693){if(_0x598693){var _0xe3d2bd=typeof _0x4f947d[_0x563a('0x21')]===_0x563a('0x22')&&typeof _0x4f947d['limit']==='undefined';var _0x52b99a=_0x598693['count'];var _0x40916a=_0xe3d2bd?0x0:_0x4f947d[_0x563a('0x21')];var _0x26061f=_0xe3d2bd?_0x598693[_0x563a('0x23')]:_0x4f947d['offset']+_0x4f947d['limit'];var _0x3930f0;if(_0x26061f>=_0x52b99a){_0x26061f=_0x52b99a;_0x3930f0=0xc8;}else{_0x3930f0=0xce;}_0x9c2f77[_0x563a('0x1f')](_0x3930f0);return _0x9c2f77[_0x563a('0x24')](_0x563a('0x25'),_0x40916a+'-'+_0x26061f+'/'+_0x52b99a)[_0x563a('0x20')](_0x598693);}return null;};}function patchUpdates(_0x2dc7e2){return function(_0x44b460){try{jsonpatch[_0x563a('0x26')](_0x44b460,_0x2dc7e2,!![]);}catch(_0x506491){return BPromise[_0x563a('0x27')](_0x506491);}return _0x44b460['save']();};}function saveUpdates(_0x44e2c1,_0xd3e0ae){return function(_0x3a36a4){if(_0x3a36a4){return _0x3a36a4[_0x563a('0x28')](_0x44e2c1)[_0x563a('0x29')](function(_0x1682ee){return _0x1682ee;});}return null;};}function removeEntity(_0x3642b3,_0x173990){return function(_0x4de4c3){if(_0x4de4c3){return _0x4de4c3[_0x563a('0x2a')]()[_0x563a('0x29')](function(){var _0x2311f2=_0x4de4c3[_0x563a('0x2b')]({'plain':!![]});var _0xce8165=_0x563a('0x2c');return db[_0x563a('0x2d')][_0x563a('0x2a')]({'where':{'type':_0xce8165,'resourceId':_0x2311f2['id']}})[_0x563a('0x29')](function(){return _0x4de4c3;});})[_0x563a('0x29')](function(){_0x3642b3[_0x563a('0x1f')](0xcc)[_0x563a('0x1e')]();});}};}function handleEntityNotFound(_0x1bdfb0,_0x7696c2){return function(_0x579cb5){if(!_0x579cb5){_0x1bdfb0[_0x563a('0x2e')](0x194);}return _0x579cb5;};}function handleError(_0x3c16d0,_0x2257e1){_0x2257e1=_0x2257e1||0x1f4;return function(_0x4aaa3d){logger[_0x563a('0x2f')](_0x4aaa3d[_0x563a('0x30')]);if(_0x4aaa3d[_0x563a('0x31')]){delete _0x4aaa3d[_0x563a('0x31')];}_0x3c16d0[_0x563a('0x1f')](_0x2257e1)[_0x563a('0x32')](_0x4aaa3d);};}exports[_0x563a('0x33')]=function(_0x4a2d28,_0x2418ae){var _0x24ec9d={},_0x4259f6={},_0x2ea6c2={'count':0x0,'rows':[]};var _0x1a77b8=_['map'](db['VoicePrefix']['rawAttributes'],function(_0x4e5c46){return{'name':_0x4e5c46[_0x563a('0x34')],'type':_0x4e5c46[_0x563a('0x35')][_0x563a('0x36')]};});_0x4259f6[_0x563a('0x37')]=_[_0x563a('0x38')](_0x1a77b8,_0x563a('0x31'));_0x4259f6['query']=_['keys'](_0x4a2d28[_0x563a('0x39')]);_0x4259f6[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x4259f6[_0x563a('0x37')],_0x4259f6[_0x563a('0x39')]);_0x24ec9d[_0x563a('0x3c')]=_[_0x563a('0x3b')](_0x4259f6[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x4a2d28[_0x563a('0x39')][_0x563a('0x3d')]));_0x24ec9d[_0x563a('0x3c')]=_0x24ec9d[_0x563a('0x3c')][_0x563a('0x3e')]?_0x24ec9d[_0x563a('0x3c')]:_0x4259f6[_0x563a('0x37')];if(!_0x4a2d28['query'][_0x563a('0x3f')](_0x563a('0x40'))){_0x24ec9d[_0x563a('0x41')]=qs['limit'](_0x4a2d28[_0x563a('0x39')]['limit']);_0x24ec9d[_0x563a('0x21')]=qs[_0x563a('0x21')](_0x4a2d28['query']['offset']);}_0x24ec9d[_0x563a('0x42')]=qs['sort'](_0x4a2d28[_0x563a('0x39')][_0x563a('0x43')]);_0x24ec9d[_0x563a('0x44')]=qs[_0x563a('0x3a')](_['pick'](_0x4a2d28['query'],_0x4259f6[_0x563a('0x3a')]),_0x1a77b8);if(_0x4a2d28['query'][_0x563a('0x45')]){_0x24ec9d[_0x563a('0x44')]=_[_0x563a('0x46')](_0x24ec9d[_0x563a('0x44')],{'$or':_[_0x563a('0x38')](_0x1a77b8,function(_0x38fab5){if(_0x38fab5[_0x563a('0x35')]!==_0x563a('0x47')){var _0x4c71df={};_0x4c71df[_0x38fab5[_0x563a('0x31')]]={'$like':'%'+_0x4a2d28['query'][_0x563a('0x45')]+'%'};return _0x4c71df;}})});}_0x24ec9d=_[_0x563a('0x46')]({},_0x24ec9d,_0x4a2d28[_0x563a('0x48')]);var _0x2d3800={'where':_0x24ec9d['where']};return db['VoicePrefix']['count'](_0x2d3800)[_0x563a('0x29')](function(_0x1255da){_0x2ea6c2[_0x563a('0x23')]=_0x1255da;if(_0x4a2d28[_0x563a('0x39')][_0x563a('0x49')]){_0x24ec9d[_0x563a('0x4a')]=[{'all':!![]}];}return db[_0x563a('0x4b')][_0x563a('0x4c')](_0x24ec9d);})[_0x563a('0x29')](function(_0x433353){_0x2ea6c2[_0x563a('0x4d')]=_0x433353;return _0x2ea6c2;})[_0x563a('0x29')](respondWithFilteredResult(_0x2418ae,_0x24ec9d))[_0x563a('0x4e')](handleError(_0x2418ae,null));};exports[_0x563a('0x4f')]=function(_0x144e15,_0x456d27){var _0x4643c4={'raw':![],'where':{'id':_0x144e15[_0x563a('0x50')]['id']}},_0x21bafb={};_0x21bafb['model']=_['keys'](db[_0x563a('0x4b')][_0x563a('0x51')]);_0x21bafb[_0x563a('0x39')]=_[_0x563a('0x52')](_0x144e15[_0x563a('0x39')]);_0x21bafb[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x21bafb[_0x563a('0x37')],_0x21bafb['query']);_0x4643c4['attributes']=_[_0x563a('0x3b')](_0x21bafb[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x144e15[_0x563a('0x39')][_0x563a('0x3d')]));_0x4643c4[_0x563a('0x3c')]=_0x4643c4[_0x563a('0x3c')][_0x563a('0x3e')]?_0x4643c4['attributes']:_0x21bafb[_0x563a('0x37')];if(_0x144e15[_0x563a('0x39')]['includeAll']){_0x4643c4[_0x563a('0x4a')]=[{'all':!![]}];}_0x4643c4=_['merge']({},_0x4643c4,_0x144e15[_0x563a('0x48')]);return db[_0x563a('0x4b')][_0x563a('0x53')](_0x4643c4)['then'](handleEntityNotFound(_0x456d27,null))[_0x563a('0x29')](respondWithResult(_0x456d27,null))[_0x563a('0x4e')](handleError(_0x456d27,null));};exports[_0x563a('0x2a')]=function(_0x39c104,_0x6fe8a9){return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x39c104[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x6fe8a9,null))[_0x563a('0x29')](removeEntity(_0x6fe8a9,null))[_0x563a('0x4e')](handleError(_0x6fe8a9,null));};exports[_0x563a('0x54')]=function(_0x406d4a,_0x497469){return db['VoicePrefix'][_0x563a('0x54')]()[_0x563a('0x29')](respondWithResult(_0x497469,null))[_0x563a('0x4e')](handleError(_0x497469,null));};exports['create']=function(_0x5ae08f,_0x13530f){var _0x1fc4d2;return db['sequelize']['transaction'](function(_0x51e142){return db[_0x563a('0x4b')][_0x563a('0x55')](_0x5ae08f[_0x563a('0x56')],{'transaction':_0x51e142})[_0x563a('0x29')](function(_0x8d3997){_0x1fc4d2=_0x8d3997[_0x563a('0x2b')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x1fc4d2[_0x563a('0x57')]},'raw':!![]})['then'](function(_0x4453b2){return createVoicePrefixExtensions(_0x1fc4d2,_0x4453b2,_0x51e142);});});})[_0x563a('0x29')](function(){var _0x3e993e=_0x5ae08f[_0x563a('0x58')][_0x563a('0x2b')]({'plain':!![]});if(!_0x3e993e)throw new Error(_0x563a('0x59'));if(_0x3e993e[_0x563a('0x5a')]==='user'){var _0x22cc91=_0x1fc4d2;return db[_0x563a('0x5b')]['find']({'where':{'name':_0x563a('0x2c'),'userProfileId':_0x3e993e[_0x563a('0x5c')]},'raw':!![]})[_0x563a('0x29')](function(_0x2afa8c){if(_0x2afa8c&&_0x2afa8c[_0x563a('0x5d')]===0x0){return db[_0x563a('0x2d')][_0x563a('0x55')]({'name':_0x22cc91[_0x563a('0x31')],'resourceId':_0x22cc91['id'],'type':_0x2afa8c[_0x563a('0x31')],'sectionId':_0x2afa8c['id']},{})[_0x563a('0x29')](function(){return _0x1fc4d2;});}else{return _0x1fc4d2;}})['catch'](function(_0x1926f1){logger[_0x563a('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1926f1);throw _0x1926f1;});}return _0x1fc4d2;})['then'](respondWithResult(_0x13530f,null))[_0x563a('0x4e')](handleError(_0x13530f,null));};function Extension(_0x709bfd,_0x579d61,_0x19edc3,_0x59e371){this[_0x563a('0x5e')]=_0x563a('0x5f');this[_0x563a('0x60')]=_0x709bfd;this[_0x563a('0x61')]=_0x19edc3;this[_0x563a('0x35')]='system';this['description']='Voice\x20Prefix\x20Extension';this['priority']=_0x579d61;this[_0x563a('0x62')]=_0x59e371;}function createVoicePrefixExtensions(_0x5141d5,_0x111444,_0x496b6a){return new BPromise(function(_0x2a82cf,_0x3f2750){var _0xbe3343=new Extension(formatPrefixName(_0x5141d5[_0x563a('0x63')]),0x1,_0x563a('0x64'),'Voice\x20Prefix');_0xbe3343[_0x563a('0x65')]=_0x5141d5['id'];return db['VoiceExtension']['create'](_0xbe3343,{'transaction':_0x496b6a})[_0x563a('0x29')](function(_0x3b7993){var _0x409f3c=_0x3b7993[_0x563a('0x2b')]({'plain':!![]});var _0x1c8ad7=_['map'](addVoicePrefixExtensions(_0x5141d5,_0x111444),function(_0x10eb03){_0x10eb03[_0x563a('0x57')]=_0x409f3c['id'];_0x10eb03[_0x563a('0x65')]=_0x5141d5['id'];return _0x10eb03;});return db[_0x563a('0x66')][_0x563a('0x67')](_0x1c8ad7,{'transaction':_0x496b6a})['then'](function(_0xac578c){if(!_0xac578c){return _0x3f2750('Extensions\x20creation\x20failed');}else{return _0x2a82cf(_0xac578c);}})[_0x563a('0x4e')](function(_0x201c9d){return _0x3f2750(_0x201c9d);});});;});};function addVoicePrefixExtensions(_0x47d6cd,_0x34dd59){var _0x30bf2b=[];var _0x18a26b=formatPrefixName(_0x47d6cd[_0x563a('0x63')]);_0x30bf2b[_0x563a('0x68')](new Extension(_0x18a26b,0x2,_0x563a('0x69'),_0x563a('0x6a')+_0x47d6cd[_0x563a('0x31')]));if(_0x47d6cd['callerIdAll']){_0x30bf2b[_0x563a('0x68')](new Extension(_0x18a26b,0x3,_0x563a('0x69'),_0x563a('0x6b')+_0x47d6cd[_0x563a('0x6c')]));}else{_0x30bf2b[_0x563a('0x68')](new Extension(_0x18a26b,0x3,_0x563a('0x64'),_0x563a('0x6d')));}_0x30bf2b['push'](new Extension(_0x18a26b,0x4,_0x563a('0x6e'),_0x34dd59['context']+','+'${EXTEN:'+(0x8+_0x47d6cd['name'][_0x563a('0x3e')])+'}'+','+0x1));return _0x30bf2b;}function formatPrefixName(_0x4e4e60){var _0x529587='_';for(var _0x30d775=0x0;_0x30d775<_0x4e4e60[_0x563a('0x3e')];_0x30d775++){if(_0x4e4e60[_0x563a('0x6f')](_0x30d775)=='-'){_0x529587+=_0x4e4e60[_0x563a('0x6f')](_0x30d775);}else{_0x529587+='['+_0x4e4e60[_0x563a('0x6f')](_0x30d775)+']';}}_0x529587+='.';return _0x529587;}exports['update']=function(_0x4814b3,_0x4c9ad7,_0x39b8f8){var _0x8b2e10=_0x4814b3[_0x563a('0x56')];_0x8b2e10[_0x563a('0x63')]=_0x563a('0x70')+_0x8b2e10[_0x563a('0x31')]+'-';return db['sequelize'][_0x563a('0x71')](function(_0x43b2f1){return db['VoicePrefix'][_0x563a('0x28')](_0x8b2e10,{'where':{'id':_0x8b2e10['id']},'transaction':_0x43b2f1})[_0x563a('0x29')](function(){return db[_0x563a('0x66')]['destroy']({'where':{'VoicePrefixId':_0x8b2e10['id']},'transaction':_0x43b2f1})[_0x563a('0x29')](function(){return db[_0x563a('0x66')][_0x563a('0x53')]({'where':{'id':_0x8b2e10[_0x563a('0x57')]},'raw':!![]})['then'](function(_0x229690){return createVoicePrefixExtensions(_0x8b2e10,_0x229690,_0x43b2f1);});});});})[_0x563a('0x29')](function(){return db[_0x563a('0x4b')][_0x563a('0x72')](_0x8b2e10['id']);})[_0x563a('0x29')](respondWithResult(_0x4c9ad7,null))['catch'](handleError(_0x4c9ad7,null));};exports['addAgents']=function(_0x4346fe,_0x598a91,_0x46beba){return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x4346fe[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x598a91,null))[_0x563a('0x29')](function(_0x3f66be){if(_0x3f66be){return _0x3f66be[_0x563a('0x73')](_0x4346fe[_0x563a('0x56')][_0x563a('0x74')],_['omit'](_0x4346fe[_0x563a('0x56')],['ids','id'])||{})[_0x563a('0x75')](function(_0x441933){for(var _0x54c512=0x0;_0x54c512<_0x4346fe[_0x563a('0x56')]['ids'][_0x563a('0x3e')];_0x54c512+=0x1){socket[_0x563a('0x76')]('userVoicePrefix:save',{'UserId':Number(_0x4346fe[_0x563a('0x56')][_0x563a('0x74')][_0x54c512]),'VoicePrefixId':Number(_0x4346fe[_0x563a('0x50')]['id'])});}return _0x441933;});}})[_0x563a('0x29')](respondWithResult(_0x598a91,null))['catch'](handleError(_0x598a91,null));};exports[_0x563a('0x77')]=function(_0x31faef,_0x17000b,_0x3cdfc1){return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x31faef[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x17000b,null))[_0x563a('0x29')](function(_0x238ae4){if(_0x238ae4){return _0x238ae4['removeAgents'](_0x31faef[_0x563a('0x39')][_0x563a('0x74')])[_0x563a('0x29')](function(){if(_['isArray'](_0x31faef[_0x563a('0x39')][_0x563a('0x74')])){for(var _0x3dc800=0x0;_0x3dc800<_0x31faef[_0x563a('0x39')][_0x563a('0x74')][_0x563a('0x3e')];_0x3dc800+=0x1){socket[_0x563a('0x76')](_0x563a('0x78'),{'UserId':Number(_0x31faef[_0x563a('0x39')][_0x563a('0x74')][_0x3dc800]),'VoicePrefixId':Number(_0x31faef[_0x563a('0x50')]['id'])});}}else{socket[_0x563a('0x76')](_0x563a('0x78'),{'UserId':Number(_0x31faef['query'][_0x563a('0x74')]),'VoicePrefixId':Number(_0x31faef[_0x563a('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x17000b,null))[_0x563a('0x4e')](handleError(_0x17000b,null));};exports[_0x563a('0x79')]=function(_0x1ecca5,_0x162ab6,_0xf3ed04){var _0x44cbb4={};var _0x3a00b8={};var _0x9b753b;var _0x41898f;return db['VoicePrefix'][_0x563a('0x7a')]({'where':{'id':_0x1ecca5[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x162ab6,null))[_0x563a('0x29')](function(_0x4c5547){if(_0x4c5547){_0x9b753b=_0x4c5547;_0x3a00b8['model']=_['keys'](db[_0x563a('0x7b')][_0x563a('0x51')]);_0x3a00b8[_0x563a('0x39')]=_[_0x563a('0x52')](_0x1ecca5[_0x563a('0x39')]);_0x3a00b8[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x3a00b8[_0x563a('0x37')],_0x3a00b8[_0x563a('0x39')]);_0x44cbb4[_0x563a('0x3c')]=_['intersection'](_0x3a00b8[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x1ecca5[_0x563a('0x39')][_0x563a('0x3d')]));_0x44cbb4[_0x563a('0x3c')]=_0x44cbb4[_0x563a('0x3c')][_0x563a('0x3e')]?_0x44cbb4[_0x563a('0x3c')]:_0x3a00b8[_0x563a('0x37')];_0x44cbb4[_0x563a('0x42')]=qs[_0x563a('0x43')](_0x1ecca5[_0x563a('0x39')][_0x563a('0x43')]);_0x44cbb4['where']=qs[_0x563a('0x3a')](_[_0x563a('0x7c')](_0x1ecca5[_0x563a('0x39')],_0x3a00b8[_0x563a('0x3a')]));if(_0x1ecca5[_0x563a('0x39')][_0x563a('0x45')]){_0x44cbb4[_0x563a('0x44')]=_['merge'](_0x44cbb4[_0x563a('0x44')],{'$or':_[_0x563a('0x38')](_0x44cbb4[_0x563a('0x3c')],function(_0x562120){var _0x1e3b8c={};_0x1e3b8c[_0x562120]={'$like':'%'+_0x1ecca5[_0x563a('0x39')][_0x563a('0x45')]+'%'};return _0x1e3b8c;})});}_0x44cbb4=_[_0x563a('0x46')]({},_0x44cbb4,_0x1ecca5[_0x563a('0x48')]);return _0x9b753b[_0x563a('0x79')](_0x44cbb4);}})['then'](function(_0x2d46f5){if(_0x2d46f5){_0x41898f=_0x2d46f5[_0x563a('0x3e')];if(!_0x1ecca5[_0x563a('0x39')][_0x563a('0x3f')](_0x563a('0x40'))){_0x44cbb4['limit']=qs[_0x563a('0x41')](_0x1ecca5[_0x563a('0x39')][_0x563a('0x41')]);_0x44cbb4[_0x563a('0x21')]=qs['offset'](_0x1ecca5[_0x563a('0x39')][_0x563a('0x21')]);}return _0x9b753b['getAgents'](_0x44cbb4);}})['then'](function(_0x458a21){if(_0x458a21){return _0x458a21?{'count':_0x41898f,'rows':_0x458a21}:null;}})[_0x563a('0x29')](respondWithResult(_0x162ab6,null))[_0x563a('0x4e')](handleError(_0x162ab6,null));};exports[_0x563a('0x7d')]=function(_0x241361,_0x31a58e,_0x1e324a){var _0x38857b={};var _0x43b6a2={};var _0x2385eb;var _0x36fe22;return db['VoicePrefix'][_0x563a('0x7a')]({'where':{'id':_0x241361[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x31a58e,null))['then'](function(_0x1dc77d){if(_0x1dc77d){_0x2385eb=_0x1dc77d;_0x43b6a2[_0x563a('0x37')]=_['keys'](db[_0x563a('0x7e')][_0x563a('0x51')]);_0x43b6a2[_0x563a('0x39')]=_[_0x563a('0x52')](_0x241361[_0x563a('0x39')]);_0x43b6a2[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x43b6a2[_0x563a('0x37')],_0x43b6a2['query']);_0x38857b[_0x563a('0x3c')]=_[_0x563a('0x3b')](_0x43b6a2[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x241361[_0x563a('0x39')]['fields']));_0x38857b[_0x563a('0x3c')]=_0x38857b['attributes']['length']?_0x38857b[_0x563a('0x3c')]:_0x43b6a2[_0x563a('0x37')];_0x38857b[_0x563a('0x42')]=qs[_0x563a('0x43')](_0x241361['query'][_0x563a('0x43')]);_0x38857b[_0x563a('0x44')]=qs['filters'](_[_0x563a('0x7c')](_0x241361['query'],_0x43b6a2[_0x563a('0x3a')]));if(_0x241361[_0x563a('0x39')][_0x563a('0x45')]){_0x38857b[_0x563a('0x44')]=_[_0x563a('0x46')](_0x38857b[_0x563a('0x44')],{'$or':_[_0x563a('0x38')](_0x38857b[_0x563a('0x3c')],function(_0x372e43){var _0x484953={};_0x484953[_0x372e43]={'$like':'%'+_0x241361[_0x563a('0x39')]['filter']+'%'};return _0x484953;})});}_0x38857b=_['merge']({},_0x38857b,_0x241361[_0x563a('0x48')]);return _0x2385eb[_0x563a('0x7d')](_0x38857b);}})['then'](function(_0x44859c){if(_0x44859c){_0x36fe22=_0x44859c[_0x563a('0x3e')];if(!_0x241361[_0x563a('0x39')][_0x563a('0x3f')](_0x563a('0x40'))){_0x38857b[_0x563a('0x41')]=qs[_0x563a('0x41')](_0x241361[_0x563a('0x39')]['limit']);_0x38857b[_0x563a('0x21')]=qs[_0x563a('0x21')](_0x241361['query'][_0x563a('0x21')]);}return _0x2385eb[_0x563a('0x7d')](_0x38857b);}})['then'](function(_0x38601a){if(_0x38601a){return _0x38601a?{'count':_0x36fe22,'rows':_0x38601a}:null;}})[_0x563a('0x29')](respondWithResult(_0x31a58e,null))[_0x563a('0x4e')](handleError(_0x31a58e,null));};exports['addTeams']=function(_0x10c81e,_0x4928de,_0x95bb77){var _0x33d74b=_0x10c81e[_0x563a('0x56')]['ids'];var _0x2d9810;return db['Team'][_0x563a('0x4c')]({'where':{'id':_0x33d74b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x563a('0x7f'),'attributes':['id',_0x563a('0x31'),_0x563a('0x80'),_0x563a('0x81'),_0x563a('0x82')],'raw':!![]}]})[_0x563a('0x29')](function(_0x2d2cb9){if(_0x2d2cb9){_0x2d9810=_0x2d2cb9;var _0x2c4b52=_[_0x563a('0x83')](_0x2d2cb9,function(_0x5c8df5){var _0x579601=_0x5c8df5[_0x563a('0x2b')]({'plain':!![]});return _0x579601[_0x563a('0x7f')];});return db['VoicePrefix'][_0x563a('0x53')]({'where':{'id':_0x10c81e[_0x563a('0x50')]['id']}})[_0x563a('0x29')](function(_0x1ebdd0){return db[_0x563a('0x84')][_0x563a('0x71')](function(_0x2a3bdd){return _0x1ebdd0['addTeams'](_0x33d74b,{'transaction':_0x2a3bdd})[_0x563a('0x29')](function(){return BPromise[_0x563a('0x85')](_0x2d9810,function(_0x28bbe5){return db[_0x563a('0x86')]['upsert']({'TeamId':_0x28bbe5['id'],'VoicePrefixId':_0x10c81e[_0x563a('0x50')]['id']},{'transaction':_0x2a3bdd});});})[_0x563a('0x29')](function(){return BPromise[_0x563a('0x85')](_0x2c4b52,function(_0x150fd6){return db[_0x563a('0x87')][_0x563a('0x88')]({'where':{'UserId':_0x150fd6['id'],'VoicePrefixId':_0x10c81e[_0x563a('0x50')]['id']},'transaction':_0x2a3bdd});});})[_0x563a('0x29')](function(){_0x2c4b52[_0x563a('0x89')](function(_0x3f78b7){socket[_0x563a('0x76')](_0x563a('0x8a'),{'UserId':_0x3f78b7['id'],'VoicePrefixId':_0x1ebdd0['id']});});});});});}})[_0x563a('0x29')](respondWithStatusCode(_0x4928de,null))[_0x563a('0x4e')](handleError(_0x4928de,null));};exports[_0x563a('0x8b')]=function(_0x115188,_0x713637,_0x12bb1b){return db[_0x563a('0x7e')][_0x563a('0x4c')]({'where':{'id':_0x115188[_0x563a('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x563a('0x7b')],'as':_0x563a('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x563a('0x29')](handleEntityNotFound(_0x713637,null))[_0x563a('0x29')](function(_0xb9cbc9){var _0x42831f=_[_0x563a('0x38')](_0xb9cbc9,'id');var _0x5385e0=[];var _0x1d0ed4=[];var _0x14bc9e=squel[_0x563a('0x8c')]();_0x14bc9e[_0x563a('0x8d')](_0x563a('0x8e'))['from'](_0x563a('0x8f'),'tq')['join'](_0x563a('0x90'),'ut',_0x563a('0x91'))[_0x563a('0x44')]('VoicePrefixId\x20=\x20?',_0x115188[_0x563a('0x50')]['id']);for(var _0x25e5d1=0x0;_0x25e5d1<_0xb9cbc9[_0x563a('0x3e')];_0x25e5d1+=0x1){let _0x5ba698=_0xb9cbc9[_0x25e5d1];for(var _0x2dadc1=0x0;_0x2dadc1<_0x5ba698[_0x563a('0x7f')]['length'];_0x2dadc1+=0x1){let _0x55f64e=_0x5ba698[_0x563a('0x7f')][_0x2dadc1];var _0x41d0df=_0x14bc9e['clone']();_0x41d0df['where'](_0x563a('0x92'),_0x55f64e['id']);_0x1d0ed4['push'](db[_0x563a('0x84')][_0x563a('0x39')](_0x41d0df[_0x563a('0x93')](),{'type':db[_0x563a('0x84')][_0x563a('0x94')][_0x563a('0x95')]})[_0x563a('0x29')](function(_0xc24817){if(_0xc24817[_0x563a('0x3e')]===0x1){return _0x55f64e['id'];}else{var _0xd04cd=_[_0x563a('0x96')](_['map'](_0xc24817,'TeamId'),function(_0x571a84){return _[_0x563a('0x97')](_0x42831f,_0x571a84);});if(_0xd04cd){return _0x55f64e['id'];}}}));}}return BPromise[_0x563a('0x98')](_0x1d0ed4)[_0x563a('0x29')](function(_0x5244e5){_0x5385e0=_(_0x5385e0)['union'](_0x5244e5)[_0x563a('0x99')]()[_0x563a('0x9a')]();return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x115188[_0x563a('0x50')]['id']}})[_0x563a('0x29')](function(_0x23e33f){return db['sequelize'][_0x563a('0x71')](function(_0x25049d){return _0x23e33f[_0x563a('0x8b')](_0x115188[_0x563a('0x39')][_0x563a('0x74')],{'transaction':_0x25049d})[_0x563a('0x29')](function(){if(!_[_0x563a('0x9b')](_0x5385e0)){return _0x23e33f[_0x563a('0x77')](_0x5385e0,{'transaction':_0x25049d});}})[_0x563a('0x29')](function(){_0x5385e0[_0x563a('0x89')](function(_0x482d21){socket[_0x563a('0x76')]('userVoicePrefix:remove',{'UserId':_0x482d21,'VoicePrefixId':_0x23e33f['id']});});});});});});})[_0x563a('0x29')](respondWithStatusCode(_0x713637,null))[_0x563a('0x4e')](handleError(_0x713637,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 2f7b3f6..31d5251 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 _0x9297=['update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x57f8b4,_0x59d3f7){var _0x4952a9=function(_0x1895d1){while(--_0x1895d1){_0x57f8b4['push'](_0x57f8b4['shift']());}};_0x4952a9(++_0x59d3f7);}(_0x9297,0x188));var _0x7929=function(_0xbf53b9,_0x2f4af3){_0xbf53b9=_0xbf53b9-0x0;var _0x28eb0a=_0x9297[_0xbf53b9];return _0x28eb0a;};'use strict';var EventEmitter=require(_0x7929('0x0'));var VoicePrefix=require(_0x7929('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7929('0x2')](0x0);var events={'afterCreate':_0x7929('0x3'),'afterUpdate':_0x7929('0x4'),'afterDestroy':_0x7929('0x5')};function emitEvent(_0xd7982e){return function(_0x968e1d,_0x5740e8,_0x21b419){VoicePrefixEvents[_0x7929('0x6')](_0xd7982e+':'+_0x968e1d['id'],_0x968e1d);VoicePrefixEvents[_0x7929('0x6')](_0xd7982e,_0x968e1d);_0x21b419(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x7929('0x7')](e,emitEvent(event));}}module[_0x7929('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x6d81=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoicePrefix'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6d81,0xee));var _0x16d8=function(_0x3777a4,_0x130d7d){_0x3777a4=_0x3777a4-0x0;var _0x4a4fd7=_0x6d81[_0x3777a4];return _0x4a4fd7;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x16d8('0x0'))['db'][_0x16d8('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x16d8('0x2')](0x0);var events={'afterCreate':_0x16d8('0x3'),'afterUpdate':_0x16d8('0x4'),'afterDestroy':_0x16d8('0x5')};function emitEvent(_0xc21105){return function(_0x55b372,_0x2931eb,_0x11bac3){VoicePrefixEvents[_0x16d8('0x6')](_0xc21105+':'+_0x55b372['id'],_0x55b372);VoicePrefixEvents['emit'](_0xc21105,_0x55b372);_0x11bac3(null);};}for(var e in events){if(events[_0x16d8('0x7')](e)){var event=events[e];VoicePrefix[_0x16d8('0x8')](e,emitEvent(event));}}module[_0x16d8('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 1a378b1..3c3c72a 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 _0x74ad=['path','rimraf','../../config/environment','./voicePrefix.attributes','voice_prefixes','util','../../config/logger','api','moment','request-promise'];(function(_0x257e8f,_0xdc7fc9){var _0x2d8b1e=function(_0x24739a){while(--_0x24739a){_0x257e8f['push'](_0x257e8f['shift']());}};_0x2d8b1e(++_0xdc7fc9);}(_0x74ad,0xeb));var _0xd74a=function(_0x45a7a6,_0x380289){_0x45a7a6=_0x45a7a6-0x0;var _0x514f51=_0x74ad[_0x45a7a6];return _0x514f51;};'use strict';var _=require('lodash');var util=require(_0xd74a('0x0'));var logger=require(_0xd74a('0x1'))(_0xd74a('0x2'));var moment=require(_0xd74a('0x3'));var BPromise=require('bluebird');var rp=require(_0xd74a('0x4'));var fs=require('fs');var path=require(_0xd74a('0x5'));var rimraf=require(_0xd74a('0x6'));var config=require(_0xd74a('0x7'));var attributes=require(_0xd74a('0x8'));module['exports']=function(_0x368e2b,_0x2706b9){return _0x368e2b['define']('VoicePrefix',attributes,{'tableName':_0xd74a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1779=['bluebird','request-promise','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','lodash','util','../../config/logger','api','moment'];(function(_0x53bf43,_0x3df641){var _0x599904=function(_0x162d57){while(--_0x162d57){_0x53bf43['push'](_0x53bf43['shift']());}};_0x599904(++_0x3df641);}(_0x1779,0x8a));var _0x9177=function(_0x7e6283,_0x1bf561){_0x7e6283=_0x7e6283-0x0;var _0x1264f0=_0x1779[_0x7e6283];return _0x1264f0;};'use strict';var _=require(_0x9177('0x0'));var util=require(_0x9177('0x1'));var logger=require(_0x9177('0x2'))(_0x9177('0x3'));var moment=require(_0x9177('0x4'));var BPromise=require(_0x9177('0x5'));var rp=require(_0x9177('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9177('0x7'));var attributes=require(_0x9177('0x8'));module['exports']=function(_0x3cfa6f,_0x3a9d03){return _0x3cfa6f[_0x9177('0x9')](_0x9177('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 764b1b2..31030cd 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 _0xb1ef=['request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s'];(function(_0x2f185e,_0xf6a73){var _0x3f70be=function(_0x305516){while(--_0x305516){_0x2f185e['push'](_0x2f185e['shift']());}};_0x3f70be(++_0xf6a73);}(_0xb1ef,0x93));var _0xfb1e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb1ef[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xfb1e('0x0'));var util=require(_0xfb1e('0x1'));var moment=require('moment');var BPromise=require(_0xfb1e('0x2'));var rs=require(_0xfb1e('0x3'));var fs=require('fs');var Redis=require(_0xfb1e('0x4'));var db=require(_0xfb1e('0x5'))['db'];var utils=require(_0xfb1e('0x6'));var logger=require(_0xfb1e('0x7'))(_0xfb1e('0x8'));var config=require(_0xfb1e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfb1e('0xa')][_0xfb1e('0xb')]({'port':0x232a});config[_0xfb1e('0xc')]=_[_0xfb1e('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfb1e('0xe'))(new Redis(config[_0xfb1e('0xc')]));require(_0xfb1e('0xf'))[_0xfb1e('0x10')](socket);function respondWithRpcPromise(_0x39664b,_0x2fbf8d,_0x37d714){return new BPromise(function(_0x32ba72,_0x5a8fef){return client[_0xfb1e('0x11')](_0x39664b,_0x37d714)[_0xfb1e('0x12')](function(_0x296935){logger[_0xfb1e('0x13')](_0xfb1e('0x14'),_0x2fbf8d,_0xfb1e('0x15'));logger[_0xfb1e('0x16')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x2fbf8d,_0xfb1e('0x15'),JSON[_0xfb1e('0x17')](_0x296935));if(_0x296935['error']){if(_0x296935[_0xfb1e('0x18')][_0xfb1e('0x19')]===0x1f4){logger[_0xfb1e('0x18')](_0xfb1e('0x14'),_0x2fbf8d,_0x296935[_0xfb1e('0x18')]['message']);return _0x5a8fef(_0x296935[_0xfb1e('0x18')][_0xfb1e('0x1a')]);}logger[_0xfb1e('0x18')](_0xfb1e('0x14'),_0x2fbf8d,_0x296935[_0xfb1e('0x18')]['message']);return _0x32ba72(_0x296935[_0xfb1e('0x18')][_0xfb1e('0x1a')]);}else{logger[_0xfb1e('0x13')](_0xfb1e('0x14'),_0x2fbf8d,_0xfb1e('0x15'));_0x32ba72(_0x296935['result'][_0xfb1e('0x1a')]);}})[_0xfb1e('0x1b')](function(_0xc173ff){logger[_0xfb1e('0x18')](_0xfb1e('0x14'),_0x2fbf8d,_0xc173ff);_0x5a8fef(_0xc173ff);});});} \ No newline at end of file +var _0x16ce=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http'];(function(_0x53070f,_0x4b1b4c){var _0x262580=function(_0x2bb34b){while(--_0x2bb34b){_0x53070f['push'](_0x53070f['shift']());}};_0x262580(++_0x4b1b4c);}(_0x16ce,0xfb));var _0xe16c=function(_0x23cc8e,_0x2fa80e){_0x23cc8e=_0x23cc8e-0x0;var _0x400c15=_0x16ce[_0x23cc8e];return _0x400c15;};'use strict';var _=require('lodash');var util=require(_0xe16c('0x0'));var moment=require(_0xe16c('0x1'));var BPromise=require(_0xe16c('0x2'));var rs=require(_0xe16c('0x3'));var fs=require('fs');var Redis=require(_0xe16c('0x4'));var db=require(_0xe16c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe16c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe16c('0x7')][_0xe16c('0x8')]({'port':0x232a});config[_0xe16c('0x9')]=_[_0xe16c('0xa')](config[_0xe16c('0x9')],{'host':_0xe16c('0xb'),'port':0x18eb});var socket=require(_0xe16c('0xc'))(new Redis(config[_0xe16c('0x9')]));require('./voicePrefix.socket')[_0xe16c('0xd')](socket);function respondWithRpcPromise(_0x1dfa84,_0x3cc96b,_0x2e59ad){return new BPromise(function(_0x1b7da7,_0x280e21){return client[_0xe16c('0xe')](_0x1dfa84,_0x2e59ad)[_0xe16c('0xf')](function(_0x1b460c){logger[_0xe16c('0x10')](_0xe16c('0x11'),_0x3cc96b,'request\x20sent');logger[_0xe16c('0x12')](_0xe16c('0x13'),_0x3cc96b,_0xe16c('0x14'),JSON[_0xe16c('0x15')](_0x1b460c));if(_0x1b460c['error']){if(_0x1b460c['error'][_0xe16c('0x16')]===0x1f4){logger[_0xe16c('0x17')](_0xe16c('0x11'),_0x3cc96b,_0x1b460c[_0xe16c('0x17')]['message']);return _0x280e21(_0x1b460c[_0xe16c('0x17')]['message']);}logger[_0xe16c('0x17')](_0xe16c('0x11'),_0x3cc96b,_0x1b460c[_0xe16c('0x17')]['message']);return _0x1b7da7(_0x1b460c[_0xe16c('0x17')][_0xe16c('0x18')]);}else{logger[_0xe16c('0x10')](_0xe16c('0x11'),_0x3cc96b,_0xe16c('0x14'));_0x1b7da7(_0x1b460c['result'][_0xe16c('0x18')]);}})[_0xe16c('0x19')](function(_0x22fe04){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x3cc96b,_0x22fe04);_0x280e21(_0x22fe04);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index ccfbbe6..4b78adc 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 _0xc3b0=['remove','update','emit','removeListener','register','length','./voicePrefix.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3b0,0x166));var _0x0c3b=function(_0x324c35,_0x310189){_0x324c35=_0x324c35-0x0;var _0x2a20ba=_0xc3b0[_0x324c35];return _0x2a20ba;};'use strict';var VoicePrefixEvents=require(_0x0c3b('0x0'));var events=[_0x0c3b('0x1'),_0x0c3b('0x2'),_0x0c3b('0x3')];function createListener(_0x5348c4,_0x5af7d8){return function(_0x2f8bb7){_0x5af7d8[_0x0c3b('0x4')](_0x5348c4,_0x2f8bb7);};}function removeListener(_0x508b38,_0x2b13c6){return function(){VoicePrefixEvents[_0x0c3b('0x5')](_0x508b38,_0x2b13c6);};}exports[_0x0c3b('0x6')]=function(_0x5ba7f1){for(var _0x408fd8=0x0,_0x3e2305=events[_0x0c3b('0x7')];_0x408fd8<_0x3e2305;_0x408fd8++){var _0x4e7c4f=events[_0x408fd8];var _0x5c4e3a=createListener('voicePrefix:'+_0x4e7c4f,_0x5ba7f1);VoicePrefixEvents['on'](_0x4e7c4f,_0x5c4e3a);}}; \ No newline at end of file +var _0xd84c=['register','length','./voicePrefix.events','save','remove','update','emit','removeListener'];(function(_0x3656c8,_0x98f078){var _0x10d4ba=function(_0x23ed91){while(--_0x23ed91){_0x3656c8['push'](_0x3656c8['shift']());}};_0x10d4ba(++_0x98f078);}(_0xd84c,0x102));var _0xcd84=function(_0x15f03c,_0x4343e0){_0x15f03c=_0x15f03c-0x0;var _0x56597b=_0xd84c[_0x15f03c];return _0x56597b;};'use strict';var VoicePrefixEvents=require(_0xcd84('0x0'));var events=[_0xcd84('0x1'),_0xcd84('0x2'),_0xcd84('0x3')];function createListener(_0x2f3d51,_0x3213d7){return function(_0xbdfd34){_0x3213d7[_0xcd84('0x4')](_0x2f3d51,_0xbdfd34);};}function removeListener(_0x288020,_0x5a8c2e){return function(){VoicePrefixEvents[_0xcd84('0x5')](_0x288020,_0x5a8c2e);};}exports[_0xcd84('0x6')]=function(_0x159209){for(var _0x3df569=0x0,_0x520d49=events[_0xcd84('0x7')];_0x3df569<_0x520d49;_0x3df569++){var _0x22c811=events[_0x3df569];var _0x3f3617=createListener('voicePrefix:'+_0x22c811,_0x159209);VoicePrefixEvents['on'](_0x22c811,_0x3f3617);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 17bedb6..b28936e 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(_0x34bb68,_0x5b0079){var _0x3db9fb=function(_0x2c87bd){while(--_0x2c87bd){_0x34bb68['push'](_0x34bb68['shift']());}};_0x3db9fb(++_0x5b0079);}(_0xb10b,0x12a));var _0xbb10=function(_0xf482c1,_0x32cbca){_0xf482c1=_0xf482c1-0x0;var _0x184548=_0xb10b[_0xf482c1];return _0x184548;};'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(_0x522bc4,_0x351b2e){var _0xefadbf=function(_0x2d32c8){while(--_0x2d32c8){_0x522bc4['push'](_0x522bc4['shift']());}};_0xefadbf(++_0x351b2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 e65ab5f..8ce70c0 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 _0x5374=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','ENUM','inbound','outbound','ringall','fewestcalls','rrmemory','wrandom','rrordered','getDataValue','type','strategy','booked','predictive','power','INTEGER','yes','once','TEXT','setDataValue','periodic_announce','split','joinempty','join','leavewhenempty','acw','wrapuptime','BOOLEAN','preview','progressive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x20e545,_0x433e20){var _0x54967b=function(_0x8ba28d){while(--_0x8ba28d){_0x20e545['push'](_0x20e545['shift']());}};_0x54967b(++_0x433e20);}(_0x5374,0x9e));var _0x4537=function(_0x42d489,_0x288ae0){_0x42d489=_0x42d489-0x0;var _0x50943c=_0x5374[_0x42d489];return _0x50943c;};'use strict';var Sequelize=require(_0x4537('0x0'));module[_0x4537('0x1')]={'name':{'type':Sequelize[_0x4537('0x2')],'allowNull':![],'unique':_0x4537('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4537('0x4')](_0x4537('0x5'),_0x4537('0x6')),'allowNull':![],'defaultValue':_0x4537('0x5')},'musiconhold':{'type':Sequelize[_0x4537('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x4537('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x4537('0x7'),'leastrecent',_0x4537('0x8'),'random',_0x4537('0x9'),'linear',_0x4537('0xa'),_0x4537('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x266827){this['setDataValue']('strategy',_0x266827?_0x266827:'rrmemory');},'get':function(){var _0x1e97f3=this[_0x4537('0xc')](_0x4537('0xd'));var _0x3f99b5=this[_0x4537('0xc')]('dialMethod');var _0x517839=this[_0x4537('0xc')](_0x4537('0xe'));if(_0x1e97f3===_0x4537('0x5')){return _0x517839;}if(_0x3f99b5===_0x4537('0xf')&&_0x517839===_0x4537('0x9')||_0x3f99b5===_0x4537('0xf')&&_0x517839==='roundrobin'){return _0x517839;}if(_0x3f99b5==='progressive'||_0x3f99b5===_0x4537('0x10')||_0x3f99b5===_0x4537('0x11')){return _0x517839;}return null;}},'servicelevel':{'type':Sequelize[_0x4537('0x12')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4537('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x4537('0x12')](0xb)},'timeout':{'type':Sequelize[_0x4537('0x12')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4537('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4537('0x2')]},'weight':{'type':Sequelize[_0x4537('0x12')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x4537('0x13'),'no'),'defaultValue':_0x4537('0x13')},'autopause':{'type':Sequelize[_0x4537('0x4')](_0x4537('0x13'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x4537('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x4537('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4537('0x4')](_0x4537('0x13'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x4537('0x4')](_0x4537('0x13'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4537('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4537('0x4')](_0x4537('0x13'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4537('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x4537('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4537('0x12')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4537('0x4')](_0x4537('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4537('0x4')]('yes','no'),'defaultValue':_0x4537('0x13')},'announce_holdtime':{'type':Sequelize[_0x4537('0x4')](_0x4537('0x13'),'no',_0x4537('0x14')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4537('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4537('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x4537('0x12')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4537('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4537('0x2')]},'queue_youarenext':{'type':Sequelize[_0x4537('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4537('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x4537('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4537('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4537('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x4537('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x4537('0x2')]},'queue_quantity1':{'type':Sequelize[_0x4537('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x4537('0x2')]},'queue_less_than':{'type':Sequelize[_0x4537('0x2')]},'periodic_announce':{'type':Sequelize[_0x4537('0x15')],'set':function(_0x2e4789){this[_0x4537('0x16')](_0x4537('0x17'),_0x2e4789?_0x2e4789['join'](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x4537('0xc')](_0x4537('0x17'))[_0x4537('0x18')](','):[];}},'joinempty':{'type':Sequelize[_0x4537('0x2')],'defaultValue':_0x4537('0x13'),'set':function(_0xcb70a8){this['setDataValue'](_0x4537('0x19'),_0xcb70a8?_0xcb70a8[_0x4537('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x4537('0x19'))?this[_0x4537('0xc')](_0x4537('0x19'))[_0x4537('0x18')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x4537('0x2')],'defaultValue':'no','set':function(_0x2c28ad){this[_0x4537('0x16')](_0x4537('0x1b'),_0x2c28ad?_0x2c28ad['join'](','):undefined);},'get':function(){return this[_0x4537('0xc')](_0x4537('0x1b'))?this[_0x4537('0xc')](_0x4537('0x1b'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4537('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4537('0x4')](_0x4537('0x13'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x4537('0x13'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x4537('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x37af0b){this[_0x4537('0x16')](_0x4537('0x1c'),_0x37af0b);if(_0x37af0b){if(this['getDataValue']('wrapuptime')<0x2){this[_0x4537('0x16')](_0x4537('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4537('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x4537('0x4')](_0x4537('0x1f'),_0x4537('0x20'),'power','predictive',_0x4537('0xf')),'defaultValue':_0x4537('0x20'),'comment':_0x4537('0x21')},'dialLimitChannel':{'type':Sequelize[_0x4537('0x12')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4537('0x22')},'dialLimitQueue':{'type':Sequelize[_0x4537('0x12')](0x4)[_0x4537('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4537('0x24')},'dialPowerLevel':{'type':Sequelize[_0x4537('0x25')](0x2)[_0x4537('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x4537('0x4')](_0x4537('0x26'),_0x4537('0x27')),'defaultValue':_0x4537('0x27'),'comment':_0x4537('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x4537('0x25')](0x2)[_0x4537('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4537('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x4537('0x12')](0x3)[_0x4537('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4537('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4537('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4537('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4537('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x4537('0x2')],'defaultValue':_0x4537('0x2b'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x4537('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4537('0x2c')},'dialQueueProject':{'type':Sequelize[_0x4537('0x2')],'comment':_0x4537('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4537('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4537('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4537('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4537('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x4537('0x12')](0x3)[_0x4537('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4537('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4537('0x12')](0x5)[_0x4537('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4537('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4537('0x12')](0x3)[_0x4537('0x23')],'defaultValue':0x3,'comment':_0x4537('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4537('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4537('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4537('0x12')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4537('0x34')},'dialTimezone':{'type':Sequelize[_0x4537('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x4537('0x35')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4537('0x4')](_0x4537('0x36'),_0x4537('0x37'),'onlyIfOpen'),'defaultValue':_0x4537('0x36')},'dialAMDActive':{'type':Sequelize[_0x4537('0x1e')],'defaultValue':0x0,'comment':_0x4537('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x4537('0x12')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4537('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x4537('0x12')](0x9)[_0x4537('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4537('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4537('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4537('0x12')](0x9)[_0x4537('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4537('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x4537('0x12')](0x9)[_0x4537('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4537('0x12')](0x9)[_0x4537('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4537('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4537('0x12')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4537('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4537('0x12')](0x5)[_0x4537('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4537('0x12')](0x9)[_0x4537('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x4537('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4537('0x3e')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4537('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x4537('0x40'),_0x4537('0x41')),'defaultValue':_0x4537('0x40')},'dialQueueProject2':{'type':Sequelize[_0x4537('0x2')],'comment':_0x4537('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x4537('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4537('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x4537('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4537('0x42')},'dialCutDigit':{'type':Sequelize[_0x4537('0x12')](0x3)[_0x4537('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4537('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4537('0x12')](0x3)[_0x4537('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4537('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4537('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4537('0x45')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4537('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4537('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0x4537('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4537('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4537('0x12')](0x3)[_0x4537('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4537('0x12')](0x5)[_0x4537('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4537('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x4537('0x12')](0x3)[_0x4537('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4537('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4537('0x12')](0x5)[_0x4537('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4537('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4537('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4537('0x12')](0x5)[_0x4537('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4537('0x12')],'allowNull':!![],'comment':_0x4537('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0x4537('0x1e')],'defaultValue':![],'comment':_0x4537('0x4c'),'set':function(_0x29a3a0){if(!_0x29a3a0)this[_0x4537('0x16')](_0x4537('0x4d'),null);this[_0x4537('0x16')]('mandatoryDisposition',_0x29a3a0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x4537('0x12')](0x3)[_0x4537('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4537('0x12')](0x3)[_0x4537('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1904=['join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING','name','ENUM','outbound','inbound','ringall','leastrecent','fewestcalls','random','linear','rrordered','strategy','rrmemory','type','getDataValue','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes','setDataValue','periodic_announce'];(function(_0x52cb45,_0x5db74b){var _0x392240=function(_0x5d0a30){while(--_0x5d0a30){_0x52cb45['push'](_0x52cb45['shift']());}};_0x392240(++_0x5db74b);}(_0x1904,0xbf));var _0x4190=function(_0x2e34f2,_0x24b05f){_0x2e34f2=_0x2e34f2-0x0;var _0xd13262=_0x1904[_0x2e34f2];return _0xd13262;};'use strict';var Sequelize=require(_0x4190('0x0'));module['exports']={'name':{'type':Sequelize[_0x4190('0x1')],'allowNull':![],'unique':_0x4190('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4190('0x3')]('inbound',_0x4190('0x4')),'allowNull':![],'defaultValue':_0x4190('0x5')},'musiconhold':{'type':Sequelize[_0x4190('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x4190('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x4190('0x3')]('rr',_0x4190('0x6'),_0x4190('0x7'),_0x4190('0x8'),_0x4190('0x9'),'rrmemory',_0x4190('0xa'),'wrandom',_0x4190('0xb')),'allowNull':![],'defaultValue':_0x4190('0x6'),'set':function(_0x71c2bb){this['setDataValue'](_0x4190('0xc'),_0x71c2bb?_0x71c2bb:_0x4190('0xd'));},'get':function(){var _0x1eeb5d=this['getDataValue'](_0x4190('0xe'));var _0x32066a=this[_0x4190('0xf')](_0x4190('0x10'));var _0x19447d=this[_0x4190('0xf')](_0x4190('0xc'));if(_0x1eeb5d===_0x4190('0x5')){return _0x19447d;}if(_0x32066a==='booked'&&_0x19447d===_0x4190('0xd')||_0x32066a===_0x4190('0x11')&&_0x19447d===_0x4190('0x12')){return _0x19447d;}if(_0x32066a==='progressive'||_0x32066a===_0x4190('0x13')||_0x32066a===_0x4190('0x14')){return _0x19447d;}return null;}},'servicelevel':{'type':Sequelize[_0x4190('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4190('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x4190('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4190('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4190('0x1')]},'weight':{'type':Sequelize[_0x4190('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x4190('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x4190('0x3')](_0x4190('0x16'),'no'),'defaultValue':_0x4190('0x16')},'autopause':{'type':Sequelize[_0x4190('0x3')](_0x4190('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4190('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x4190('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x4190('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4190('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4190('0x3')](_0x4190('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x4190('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4190('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4190('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4190('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x4190('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4190('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4190('0x3')](_0x4190('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x4190('0x16'),'no'),'defaultValue':_0x4190('0x16')},'announce_holdtime':{'type':Sequelize[_0x4190('0x3')](_0x4190('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4190('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4190('0x3')](_0x4190('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x4190('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4190('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x4190('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4190('0x1')]},'queue_youarenext':{'type':Sequelize[_0x4190('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4190('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4190('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4190('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4190('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x4190('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4190('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x4190('0x1')]},'queue_quantity1':{'type':Sequelize[_0x4190('0x1')]},'queue_quantity2':{'type':Sequelize[_0x4190('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x4190('0x1')]},'queue_less_than':{'type':Sequelize[_0x4190('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x2b5ac4){this[_0x4190('0x17')](_0x4190('0x18'),_0x2b5ac4?_0x2b5ac4[_0x4190('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0x4190('0x18'))?this[_0x4190('0xf')](_0x4190('0x18'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x4190('0x1')],'defaultValue':'yes','set':function(_0x1d75aa){this[_0x4190('0x17')](_0x4190('0x1a'),_0x1d75aa?_0x1d75aa['join'](','):undefined);},'get':function(){return this[_0x4190('0xf')](_0x4190('0x1a'))?this[_0x4190('0xf')](_0x4190('0x1a'))[_0x4190('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x4190('0x1')],'defaultValue':'no','set':function(_0x509f9c){this['setDataValue'](_0x4190('0x1c'),_0x509f9c?_0x509f9c['join'](','):undefined);},'get':function(){return this[_0x4190('0xf')]('leavewhenempty')?this[_0x4190('0xf')](_0x4190('0x1c'))[_0x4190('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4190('0x3')](_0x4190('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4190('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4190('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x4190('0x3')](_0x4190('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4190('0x1')]},'acw':{'type':Sequelize[_0x4190('0x1d')],'defaultValue':0x0,'set':function(_0x525a93){this[_0x4190('0x17')](_0x4190('0x1e'),_0x525a93);if(_0x525a93){if(this[_0x4190('0xf')]('wrapuptime')<0x2){this[_0x4190('0x17')](_0x4190('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4190('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4190('0x1d')],'defaultValue':0x0,'comment':_0x4190('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0x4190('0x21'),_0x4190('0x22'),'power',_0x4190('0x13'),_0x4190('0x11')),'defaultValue':_0x4190('0x22'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x4190('0x15')](0x4)[_0x4190('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4190('0x24')},'dialLimitQueue':{'type':Sequelize[_0x4190('0x15')](0x4)[_0x4190('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x4190('0x25')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x4190('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x4190('0x3')]('agentBusyFactor',_0x4190('0x27')),'defaultValue':_0x4190('0x27'),'comment':_0x4190('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x4190('0x25')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4190('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x4190('0x15')](0x3)[_0x4190('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4190('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4190('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x4190('0x15')](0x3)[_0x4190('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4190('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x4190('0x1')],'defaultValue':_0x4190('0x2c'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x4190('0x15')](0x3)[_0x4190('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x4190('0x1')],'comment':_0x4190('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4190('0x15')](0x3)[_0x4190('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4190('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4190('0x2f')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4190('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4190('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4190('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x4190('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4190('0x15')](0x5)[_0x4190('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4190('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4190('0x32')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4190('0x1')],'defaultValue':_0x4190('0x33')},'dialPrefix':{'type':Sequelize[_0x4190('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4190('0x3')]('always','never','onlyIfOpen'),'defaultValue':_0x4190('0x34')},'dialAMDActive':{'type':Sequelize[_0x4190('0x1d')],'defaultValue':0x0,'comment':_0x4190('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0x4190('0x15')](0x9)[_0x4190('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x4190('0x15')](0x9)[_0x4190('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4190('0x36')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4190('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4190('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4190('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0x4190('0x15')](0x9)[_0x4190('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4190('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4190('0x15')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4190('0x15')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4190('0x39')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4190('0x15')](0x5)[_0x4190('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4190('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x4190('0x15')](0x5)[_0x4190('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x4190('0x1d')],'defaultValue':0x0,'comment':_0x4190('0x3a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4190('0x3')](_0x4190('0x3b'),'ASC'),'defaultValue':_0x4190('0x3b')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x4190('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x4190('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4190('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x4190('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4190('0x3c')},'dialCutDigit':{'type':Sequelize[_0x4190('0x15')](0x3)[_0x4190('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4190('0x15')](0x3)[_0x4190('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4190('0x3d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4190('0x15')](0x5)[_0x4190('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4190('0x3e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4190('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4190('0x3f')},'dialDropRetryFrequency':{'type':Sequelize[_0x4190('0x15')](0x5)[_0x4190('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4190('0x15')](0x3)[_0x4190('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4190('0x40')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4190('0x15')](0x5)[_0x4190('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4190('0x41')},'dialMachineMaxRetry':{'type':Sequelize[_0x4190('0x15')](0x3)[_0x4190('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4190('0x42')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4190('0x15')](0x5)[_0x4190('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4190('0x43')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4190('0x44')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4190('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4190('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4190('0x15')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4190('0x1d')],'defaultValue':![],'comment':_0x4190('0x46'),'set':function(_0x4db6ac){if(!_0x4db6ac)this[_0x4190('0x17')](_0x4190('0x47'),null);this[_0x4190('0x17')]('mandatoryDisposition',_0x4db6ac);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x4190('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4190('0x15')](0x3)[_0x4190('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x4190('0x1d')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x4190('0x1d')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 31a249c..42fee45 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 _0x35a7=['order','sort','pick','where','merge','VIRTUAL','includeAll','include','rows','catch','rawAttributes','intersection','attributes','create','role','user','VoiceQueues','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','options','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','error','getHoppers','CmHopper','nolimit','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','CmHopperBlack','getTeams','addTeams','teams','Team','User','Agents','interface','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','TeamId','includes','all','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','online','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cm_contacts','phone\x20IS\x20NOT\x20NULL','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','QueueCampaigns','outbound','filter','ignore','map','type','find','value','UserProfileResource','name','index','VoiceQueue','fieldName','model','keys','query','filters','fields','length','hasOwnProperty'];(function(_0x5615eb,_0x2f4f53){var _0x184f28=function(_0x5007ea){while(--_0x5007ea){_0x5615eb['push'](_0x5615eb['shift']());}};_0x184f28(++_0x2f4f53);}(_0x35a7,0x137));var _0x735a=function(_0x56752d,_0x23ec6e){_0x56752d=_0x56752d-0x0;var _0x3a9ef3=_0x35a7[_0x56752d];return _0x3a9ef3;};'use strict';var emlformat=require(_0x735a('0x0'));var rimraf=require(_0x735a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x735a('0x2'));var rp=require(_0x735a('0x3'));var moment=require(_0x735a('0x4'));var BPromise=require(_0x735a('0x5'));var Mustache=require(_0x735a('0x6'));var util=require(_0x735a('0x7'));var path=require(_0x735a('0x8'));var sox=require(_0x735a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x735a('0xa'));var _=require(_0x735a('0xb'));var squel=require(_0x735a('0xc'));var crypto=require(_0x735a('0xd'));var jsforce=require(_0x735a('0xe'));var deskjs=require(_0x735a('0xf'));var toCsv=require(_0x735a('0x10'));var querystring=require(_0x735a('0x11'));var Papa=require('papaparse');var Redis=require(_0x735a('0x12'));var authService=require(_0x735a('0x13'));var qs=require(_0x735a('0x14'));var as=require(_0x735a('0x15'));var hardwareService=require(_0x735a('0x16'));var logger=require(_0x735a('0x17'))(_0x735a('0x18'));var utils=require(_0x735a('0x19'));var config=require(_0x735a('0x1a'));var licenseUtil=require(_0x735a('0x1b'));var db=require(_0x735a('0x1c'))['db'];config[_0x735a('0x1d')]=_[_0x735a('0x1e')](config[_0x735a('0x1d')],{'host':_0x735a('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x735a('0x20'))[_0x735a('0x21')](socket);function respondWithStatusCode(_0x1f19bc,_0x296aba){_0x296aba=_0x296aba||0xcc;return function(_0x126dde){if(_0x126dde){return _0x1f19bc['sendStatus'](_0x296aba);}return _0x1f19bc[_0x735a('0x22')](_0x296aba)[_0x735a('0x23')]();};}function respondWithResult(_0x12bf1f,_0x1fd5da){_0x1fd5da=_0x1fd5da||0xc8;return function(_0x110f61){if(_0x110f61){return _0x12bf1f['status'](_0x1fd5da)[_0x735a('0x24')](_0x110f61);}};}function respondWithFilteredResult(_0x333691,_0x43cbd1){return function(_0xfa03a4){if(_0xfa03a4){var _0x2e9ac6=typeof _0x43cbd1[_0x735a('0x25')]===_0x735a('0x26')&&typeof _0x43cbd1['limit']===_0x735a('0x26');var _0x3e20e5=_0xfa03a4[_0x735a('0x27')];var _0x280d5d=_0x2e9ac6?0x0:_0x43cbd1[_0x735a('0x25')];var _0x3cf88e=_0x2e9ac6?_0xfa03a4['count']:_0x43cbd1[_0x735a('0x25')]+_0x43cbd1[_0x735a('0x28')];var _0x3ea39e;if(_0x3cf88e>=_0x3e20e5){_0x3cf88e=_0x3e20e5;_0x3ea39e=0xc8;}else{_0x3ea39e=0xce;}_0x333691[_0x735a('0x22')](_0x3ea39e);return _0x333691[_0x735a('0x29')](_0x735a('0x2a'),_0x280d5d+'-'+_0x3cf88e+'/'+_0x3e20e5)['json'](_0xfa03a4);}return null;};}function patchUpdates(_0x218abb){return function(_0x4904ea){try{jsonpatch[_0x735a('0x2b')](_0x4904ea,_0x218abb,!![]);}catch(_0x286d7e){return BPromise['reject'](_0x286d7e);}return _0x4904ea[_0x735a('0x2c')]();};}function saveUpdates(_0xf64fe5,_0x51f998){return function(_0x10cd53){if(_0x10cd53){return _0x10cd53[_0x735a('0x2d')](_0xf64fe5)[_0x735a('0x2e')](function(_0x2a7ea5){return _0x2a7ea5;});}return null;};}function removeEntity(_0x247242,_0x54d79f){return function(_0x5c5e70){if(_0x5c5e70){return _0x5c5e70[_0x735a('0x2f')]()[_0x735a('0x2e')](function(){var _0x3b56f5=_0x5c5e70[_0x735a('0x30')]({'plain':!![]});var _0x82c9cf=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x735a('0x31'),'value':_0x735a('0x32'),'ignore':![]}];var _0x22747d=_(_0x82c9cf)[_0x735a('0x33')](_0x735a('0x34'))[_0x735a('0x35')]('value')['value']();if(_['includes'](_0x22747d,_0x3b56f5[_0x735a('0x36')])){return;}var _0x4c2a68=_[_0x735a('0x37')](_0x82c9cf,[_0x735a('0x38'),_0x3b56f5['type']])['name'];return db[_0x735a('0x39')][_0x735a('0x2f')]({'where':{'type':_0x4c2a68,'resourceId':_0x3b56f5['id']}})[_0x735a('0x2e')](function(){return _0x5c5e70;});})[_0x735a('0x2e')](function(){_0x247242['status'](0xcc)[_0x735a('0x23')]();});}};}function handleEntityNotFound(_0x2624c4,_0x1b8565){return function(_0x11bedb){if(!_0x11bedb){_0x2624c4['sendStatus'](0x194);}return _0x11bedb;};}function handleError(_0x53b289,_0x2a316a){_0x2a316a=_0x2a316a||0x1f4;return function(_0x390c3e){logger['error'](_0x390c3e['stack']);if(_0x390c3e[_0x735a('0x3a')]){delete _0x390c3e[_0x735a('0x3a')];}_0x53b289[_0x735a('0x22')](_0x2a316a)['send'](_0x390c3e);};}exports[_0x735a('0x3b')]=function(_0x45a850,_0x500a3e){var _0x4c708f={},_0x4edc88={},_0x179aa0={'count':0x0,'rows':[]};var _0x255b2c=_[_0x735a('0x35')](db[_0x735a('0x3c')]['rawAttributes'],function(_0x208265){return{'name':_0x208265[_0x735a('0x3d')],'type':_0x208265[_0x735a('0x36')]['key']};});_0x4edc88[_0x735a('0x3e')]=_[_0x735a('0x35')](_0x255b2c,_0x735a('0x3a'));_0x4edc88['query']=_[_0x735a('0x3f')](_0x45a850[_0x735a('0x40')]);_0x4edc88[_0x735a('0x41')]=_['intersection'](_0x4edc88['model'],_0x4edc88[_0x735a('0x40')]);_0x4c708f['attributes']=_['intersection'](_0x4edc88[_0x735a('0x3e')],qs[_0x735a('0x42')](_0x45a850[_0x735a('0x40')][_0x735a('0x42')]));_0x4c708f['attributes']=_0x4c708f['attributes'][_0x735a('0x43')]?_0x4c708f['attributes']:_0x4edc88[_0x735a('0x3e')];if(!_0x45a850[_0x735a('0x40')][_0x735a('0x44')]('nolimit')){_0x4c708f['limit']=qs['limit'](_0x45a850[_0x735a('0x40')][_0x735a('0x28')]);_0x4c708f[_0x735a('0x25')]=qs[_0x735a('0x25')](_0x45a850['query'][_0x735a('0x25')]);}_0x4c708f[_0x735a('0x45')]=qs[_0x735a('0x46')](_0x45a850['query'][_0x735a('0x46')]);_0x4c708f['where']=qs['filters'](_[_0x735a('0x47')](_0x45a850[_0x735a('0x40')],_0x4edc88[_0x735a('0x41')]),_0x255b2c);if(_0x45a850['query']['filter']){_0x4c708f[_0x735a('0x48')]=_[_0x735a('0x49')](_0x4c708f[_0x735a('0x48')],{'$or':_[_0x735a('0x35')](_0x255b2c,function(_0x2dd90e){if(_0x2dd90e[_0x735a('0x36')]!==_0x735a('0x4a')){var _0x925279={};_0x925279[_0x2dd90e['name']]={'$like':'%'+_0x45a850[_0x735a('0x40')]['filter']+'%'};return _0x925279;}})});}_0x4c708f=_[_0x735a('0x49')]({},_0x4c708f,_0x45a850['options']);var _0x2967aa={'where':_0x4c708f[_0x735a('0x48')]};return db[_0x735a('0x3c')][_0x735a('0x27')](_0x2967aa)[_0x735a('0x2e')](function(_0x265203){_0x179aa0[_0x735a('0x27')]=_0x265203;if(_0x45a850[_0x735a('0x40')][_0x735a('0x4b')]){_0x4c708f[_0x735a('0x4c')]=[{'all':!![]}];}return db[_0x735a('0x3c')]['findAll'](_0x4c708f);})[_0x735a('0x2e')](function(_0x555afc){_0x179aa0[_0x735a('0x4d')]=_0x555afc;return _0x179aa0;})['then'](respondWithFilteredResult(_0x500a3e,_0x4c708f))[_0x735a('0x4e')](handleError(_0x500a3e,null));};exports['show']=function(_0x3774dd,_0x41152e){var _0x4c5957={'raw':![],'where':{'id':_0x3774dd['params']['id']}},_0x12d369={};_0x12d369[_0x735a('0x3e')]=_[_0x735a('0x3f')](db[_0x735a('0x3c')][_0x735a('0x4f')]);_0x12d369[_0x735a('0x40')]=_['keys'](_0x3774dd[_0x735a('0x40')]);_0x12d369[_0x735a('0x41')]=_[_0x735a('0x50')](_0x12d369[_0x735a('0x3e')],_0x12d369['query']);_0x4c5957['attributes']=_[_0x735a('0x50')](_0x12d369[_0x735a('0x3e')],qs[_0x735a('0x42')](_0x3774dd[_0x735a('0x40')][_0x735a('0x42')]));_0x4c5957['attributes']=_0x4c5957['attributes']['length']?_0x4c5957[_0x735a('0x51')]:_0x12d369[_0x735a('0x3e')];if(_0x3774dd[_0x735a('0x40')][_0x735a('0x4b')]){_0x4c5957[_0x735a('0x4c')]=[{'all':!![]}];}_0x4c5957=_[_0x735a('0x49')]({},_0x4c5957,_0x3774dd['options']);return db['VoiceQueue']['find'](_0x4c5957)['then'](handleEntityNotFound(_0x41152e,null))[_0x735a('0x2e')](respondWithResult(_0x41152e,null))[_0x735a('0x4e')](handleError(_0x41152e,null));};exports[_0x735a('0x52')]=function(_0x17f3a7,_0x2b5cfb){return db[_0x735a('0x3c')][_0x735a('0x52')](_0x17f3a7['body'],{})[_0x735a('0x2e')](function(_0x22fc9d){var _0x1fb151=_0x17f3a7['user'][_0x735a('0x30')]({'plain':!![]});if(!_0x1fb151)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fb151[_0x735a('0x53')]===_0x735a('0x54')){var _0x29f628=_0x22fc9d[_0x735a('0x30')]({'plain':!![]});var _0x554a95=[{'name':_0x735a('0x55'),'value':_0x735a('0x56')},{'name':_0x735a('0x31'),'value':_0x735a('0x32')}];var _0x575149=_[_0x735a('0x37')](_0x554a95,[_0x735a('0x38'),_0x29f628[_0x735a('0x36')]])[_0x735a('0x3a')];return db[_0x735a('0x57')]['find']({'where':{'name':_0x575149,'userProfileId':_0x1fb151[_0x735a('0x58')]},'raw':!![]})[_0x735a('0x2e')](function(_0x433cf7){if(_0x433cf7&&_0x433cf7[_0x735a('0x59')]===0x0){return db[_0x735a('0x39')][_0x735a('0x52')]({'name':_0x29f628[_0x735a('0x3a')],'resourceId':_0x29f628['id'],'type':_0x433cf7[_0x735a('0x3a')],'sectionId':_0x433cf7['id']},{})[_0x735a('0x2e')](function(){return _0x22fc9d;});}else{return _0x22fc9d;}})['catch'](function(_0x3e33bb){logger['error'](_0x735a('0x5a'),_0x3e33bb);throw _0x3e33bb;});}return _0x22fc9d;})[_0x735a('0x2e')](respondWithResult(_0x2b5cfb,0xc9))[_0x735a('0x4e')](handleError(_0x2b5cfb,null));};exports['clone']=function(_0x46db95,_0x13aebd){var _0x1339cb={'where':{'id':_0x46db95[_0x735a('0x5b')]['id']}},_0x4eeb5e={};_0x4eeb5e['model']=_[_0x735a('0x3f')](db[_0x735a('0x3c')]['rawAttributes']);_0x1339cb[_0x735a('0x51')]=_[_0x735a('0x50')](_0x4eeb5e[_0x735a('0x3e')],qs[_0x735a('0x42')](_0x46db95[_0x735a('0x40')][_0x735a('0x42')]));_0x1339cb[_0x735a('0x51')]=_0x1339cb[_0x735a('0x51')][_0x735a('0x43')]?_0x1339cb[_0x735a('0x51')]:_0x4eeb5e[_0x735a('0x3e')];if(_0x46db95[_0x735a('0x40')][_0x735a('0x4b')]){_0x1339cb[_0x735a('0x4c')]=[{'all':!![]}];}_0x1339cb=_[_0x735a('0x49')]({},_0x1339cb,_0x46db95[_0x735a('0x5c')]);return db['VoiceQueue'][_0x735a('0x37')](_0x1339cb)[_0x735a('0x2e')](handleEntityNotFound(_0x13aebd,null))['then'](function(_0x123e90){if(_0x123e90){var _0x245c7c=_0x123e90['get']({'plain':!![]});_0x245c7c=qs[_0x735a('0x5d')](_0x245c7c,['id',_0x735a('0x5e'),_0x735a('0x5f')]);_0x46db95[_0x735a('0x60')]=_[_0x735a('0x5d')](_0x46db95[_0x735a('0x60')],['id','createdAt',_0x735a('0x5f')]);return db[_0x735a('0x3c')][_0x735a('0x52')](_['merge'](_0x245c7c,_0x46db95[_0x735a('0x60')]),{'include':_0x46db95[_0x735a('0x40')][_0x735a('0x4b')]?[{'all':!![]}]:undefined})[_0x735a('0x2e')](function(_0x4ea4c2){var _0x5e3604=_0x46db95[_0x735a('0x54')][_0x735a('0x30')]({'plain':!![]});if(!_0x5e3604)throw new Error(_0x735a('0x61'));if(_0x5e3604[_0x735a('0x53')]===_0x735a('0x54')){var _0x4ec0ca=_0x4ea4c2[_0x735a('0x30')]({'plain':!![]});var _0x5a717d=[{'name':_0x735a('0x55'),'value':'inbound'},{'name':_0x735a('0x31'),'value':_0x735a('0x32')}];var _0x3c2901=_[_0x735a('0x37')](_0x5a717d,[_0x735a('0x38'),_0x4ec0ca[_0x735a('0x36')]])['name'];return db[_0x735a('0x57')][_0x735a('0x37')]({'where':{'name':_0x3c2901,'userProfileId':_0x5e3604[_0x735a('0x58')]},'raw':!![]})[_0x735a('0x2e')](function(_0x49b1f5){if(_0x49b1f5&&_0x49b1f5['autoAssociation']===0x0){return db[_0x735a('0x39')][_0x735a('0x52')]({'name':_0x4ec0ca['name'],'resourceId':_0x4ec0ca['id'],'type':_0x49b1f5[_0x735a('0x3a')],'sectionId':_0x49b1f5['id']},{})[_0x735a('0x2e')](function(){return _0x4ea4c2;});}else{return _0x4ea4c2;}})[_0x735a('0x4e')](function(_0x387f37){logger[_0x735a('0x62')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x387f37);throw _0x387f37;});}return _0x4ea4c2;});}})[_0x735a('0x2e')](respondWithResult(_0x13aebd,0xc9))[_0x735a('0x4e')](handleError(_0x13aebd,null));};exports[_0x735a('0x2d')]=function(_0x27f581,_0x20e1da){if(_0x27f581['body']['id']){delete _0x27f581[_0x735a('0x60')]['id'];}return db['VoiceQueue'][_0x735a('0x37')]({'where':{'id':_0x27f581[_0x735a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x20e1da,null))[_0x735a('0x2e')](saveUpdates(_0x27f581['body'],null))[_0x735a('0x2e')](respondWithResult(_0x20e1da,null))[_0x735a('0x4e')](handleError(_0x20e1da,null));};exports[_0x735a('0x2f')]=function(_0x5984aa,_0x87ee9){return db[_0x735a('0x3c')][_0x735a('0x37')]({'where':{'id':_0x5984aa[_0x735a('0x5b')]['id']}})[_0x735a('0x2e')](handleEntityNotFound(_0x87ee9,null))['then'](removeEntity(_0x87ee9,null))[_0x735a('0x4e')](handleError(_0x87ee9,null));};exports[_0x735a('0x63')]=function(_0x5da27b,_0xa91b40,_0x29f512){var _0x5a1555={'raw':![],'where':{}};var _0x551c58={};var _0x1558ab={'count':0x0,'rows':[]};return db[_0x735a('0x3c')]['findOne']({'where':{'id':_0x5da27b[_0x735a('0x5b')]['id']}})[_0x735a('0x2e')](handleEntityNotFound(_0xa91b40,null))[_0x735a('0x2e')](function(_0x50d0a5){if(_0x50d0a5){_0x551c58[_0x735a('0x3e')]=_[_0x735a('0x3f')](db[_0x735a('0x64')][_0x735a('0x4f')]);_0x551c58['query']=_[_0x735a('0x3f')](_0x5da27b['query']);_0x551c58['filters']=_[_0x735a('0x50')](_0x551c58[_0x735a('0x3e')],_0x551c58[_0x735a('0x40')]);_0x5a1555[_0x735a('0x51')]=_[_0x735a('0x50')](_0x551c58['model'],qs[_0x735a('0x42')](_0x5da27b['query']['fields']));_0x5a1555[_0x735a('0x51')]=_0x5a1555[_0x735a('0x51')][_0x735a('0x43')]?_0x5a1555[_0x735a('0x51')]:_0x551c58[_0x735a('0x3e')];if(!_0x5da27b['query']['hasOwnProperty'](_0x735a('0x65'))){_0x5a1555[_0x735a('0x28')]=qs[_0x735a('0x28')](_0x5da27b[_0x735a('0x40')][_0x735a('0x28')]);_0x5a1555[_0x735a('0x25')]=qs[_0x735a('0x25')](_0x5da27b[_0x735a('0x40')][_0x735a('0x25')]);}_0x5a1555[_0x735a('0x45')]=qs[_0x735a('0x46')](_0x5da27b[_0x735a('0x40')][_0x735a('0x46')]);_0x5a1555[_0x735a('0x48')]=qs['filters'](_[_0x735a('0x47')](_0x5da27b[_0x735a('0x40')],_0x551c58[_0x735a('0x41')]));_0x5a1555['where'][_0x735a('0x66')]=_0x50d0a5['id'];if(_0x5da27b[_0x735a('0x40')][_0x735a('0x33')]){_0x5a1555[_0x735a('0x48')]=_['merge'](_0x5a1555[_0x735a('0x48')],{'$or':_[_0x735a('0x35')](_0x5a1555[_0x735a('0x51')],function(_0x53d911){var _0x29f9f0={};_0x29f9f0[_0x53d911]={'$like':'%'+_0x5da27b[_0x735a('0x40')][_0x735a('0x33')]+'%'};return _0x29f9f0;})});}_0x5a1555=_['merge']({},_0x5a1555,_0x5da27b['options']);return db[_0x735a('0x64')][_0x735a('0x27')]({'where':_0x5a1555[_0x735a('0x48')]})[_0x735a('0x2e')](function(_0x28ab44){_0x1558ab[_0x735a('0x27')]=_0x28ab44;if(_0x5da27b[_0x735a('0x40')][_0x735a('0x4b')]){_0x5a1555['include']=[{'all':!![]}];}return db[_0x735a('0x64')][_0x735a('0x67')](_0x5a1555);})[_0x735a('0x2e')](function(_0x472a41){_0x1558ab[_0x735a('0x4d')]=_0x472a41;return _0x1558ab;});}})['then'](respondWithFilteredResult(_0xa91b40,_0x5a1555))[_0x735a('0x4e')](handleError(_0xa91b40,null));};exports[_0x735a('0x68')]=function(_0x3a1f44,_0x263f87,_0x4a83a4){var _0x2c5eb7={'raw':!![],'where':{}};var _0x55ce81={};var _0x54bb6d={'count':0x0,'rows':[]};return db[_0x735a('0x3c')]['findOne']({'where':{'id':_0x3a1f44[_0x735a('0x5b')]['id']}})[_0x735a('0x2e')](handleEntityNotFound(_0x263f87,null))[_0x735a('0x2e')](function(_0x284013){if(_0x284013){_0x55ce81['model']=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x55ce81[_0x735a('0x40')]=_[_0x735a('0x3f')](_0x3a1f44[_0x735a('0x40')]);_0x55ce81['filters']=_[_0x735a('0x50')](_0x55ce81[_0x735a('0x3e')],_0x55ce81[_0x735a('0x40')]);_0x2c5eb7[_0x735a('0x51')]=_[_0x735a('0x50')](_0x55ce81['model'],qs[_0x735a('0x42')](_0x3a1f44[_0x735a('0x40')][_0x735a('0x42')]));_0x2c5eb7[_0x735a('0x51')]=_0x2c5eb7[_0x735a('0x51')][_0x735a('0x43')]?_0x2c5eb7[_0x735a('0x51')]:_0x55ce81[_0x735a('0x3e')];if(!_0x3a1f44[_0x735a('0x40')][_0x735a('0x44')](_0x735a('0x65'))){_0x2c5eb7[_0x735a('0x28')]=qs['limit'](_0x3a1f44[_0x735a('0x40')][_0x735a('0x28')]);_0x2c5eb7['offset']=qs[_0x735a('0x25')](_0x3a1f44[_0x735a('0x40')][_0x735a('0x25')]);}_0x2c5eb7[_0x735a('0x45')]=qs['sort'](_0x3a1f44[_0x735a('0x40')]['sort']);_0x2c5eb7[_0x735a('0x48')]=qs[_0x735a('0x41')](_[_0x735a('0x47')](_0x3a1f44[_0x735a('0x40')],_0x55ce81['filters']));_0x2c5eb7['where'][_0x735a('0x66')]=_0x284013['id'];if(_0x3a1f44['query'][_0x735a('0x33')]){_0x2c5eb7[_0x735a('0x48')]=_[_0x735a('0x49')](_0x2c5eb7[_0x735a('0x48')],{'$or':_[_0x735a('0x35')](_0x2c5eb7[_0x735a('0x51')],function(_0x2d24b9){var _0x20327f={};_0x20327f[_0x2d24b9]={'$like':'%'+_0x3a1f44[_0x735a('0x40')]['filter']+'%'};return _0x20327f;})});}_0x2c5eb7=_[_0x735a('0x49')]({},_0x2c5eb7,_0x3a1f44[_0x735a('0x5c')]);return db[_0x735a('0x69')][_0x735a('0x27')]({'where':_0x2c5eb7[_0x735a('0x48')]})['then'](function(_0x136ab2){_0x54bb6d[_0x735a('0x27')]=_0x136ab2;if(_0x3a1f44[_0x735a('0x40')][_0x735a('0x4b')]){_0x2c5eb7['include']=[{'all':!![]}];}return db[_0x735a('0x69')][_0x735a('0x67')](_0x2c5eb7);})[_0x735a('0x2e')](function(_0x57f6db){_0x54bb6d[_0x735a('0x4d')]=_0x57f6db;return _0x54bb6d;});}})['then'](respondWithFilteredResult(_0x263f87,_0x2c5eb7))[_0x735a('0x4e')](handleError(_0x263f87,null));};exports[_0x735a('0x6a')]=function(_0x5ad825,_0x2aa535,_0x1e6fbd){var _0x23a2c0={'raw':!![],'where':{}};var _0x26151c={};var _0xedc1a7={'count':0x0,'rows':[]};return db[_0x735a('0x3c')][_0x735a('0x6b')]({'where':{'id':_0x5ad825['params']['id']}})[_0x735a('0x2e')](handleEntityNotFound(_0x2aa535,null))[_0x735a('0x2e')](function(_0x4de6a8){if(_0x4de6a8){_0x26151c[_0x735a('0x3e')]=_[_0x735a('0x3f')](db[_0x735a('0x6c')][_0x735a('0x4f')]);_0x26151c[_0x735a('0x40')]=_[_0x735a('0x3f')](_0x5ad825['query']);_0x26151c['filters']=_[_0x735a('0x50')](_0x26151c[_0x735a('0x3e')],_0x26151c[_0x735a('0x40')]);_0x23a2c0[_0x735a('0x51')]=_[_0x735a('0x50')](_0x26151c[_0x735a('0x3e')],qs[_0x735a('0x42')](_0x5ad825['query'][_0x735a('0x42')]));_0x23a2c0['attributes']=_0x23a2c0['attributes']['length']?_0x23a2c0[_0x735a('0x51')]:_0x26151c[_0x735a('0x3e')];if(!_0x5ad825['query'][_0x735a('0x44')]('nolimit')){_0x23a2c0[_0x735a('0x28')]=qs[_0x735a('0x28')](_0x5ad825['query'][_0x735a('0x28')]);_0x23a2c0[_0x735a('0x25')]=qs['offset'](_0x5ad825[_0x735a('0x40')][_0x735a('0x25')]);}_0x23a2c0[_0x735a('0x45')]=qs['sort'](_0x5ad825[_0x735a('0x40')][_0x735a('0x46')]);_0x23a2c0[_0x735a('0x48')]=qs[_0x735a('0x41')](_[_0x735a('0x47')](_0x5ad825['query'],_0x26151c[_0x735a('0x41')]));_0x23a2c0[_0x735a('0x48')]['VoiceQueueId']=_0x4de6a8['id'];if(_0x5ad825[_0x735a('0x40')]['filter']){_0x23a2c0[_0x735a('0x48')]=_[_0x735a('0x49')](_0x23a2c0[_0x735a('0x48')],{'$or':_[_0x735a('0x35')](_0x23a2c0[_0x735a('0x51')],function(_0x3e08ad){var _0x3691d7={};_0x3691d7[_0x3e08ad]={'$like':'%'+_0x5ad825[_0x735a('0x40')][_0x735a('0x33')]+'%'};return _0x3691d7;})});}_0x23a2c0=_[_0x735a('0x49')]({},_0x23a2c0,_0x5ad825[_0x735a('0x5c')]);return db[_0x735a('0x6c')][_0x735a('0x27')]({'where':_0x23a2c0['where']})[_0x735a('0x2e')](function(_0x25f58d){_0xedc1a7[_0x735a('0x27')]=_0x25f58d;if(_0x5ad825[_0x735a('0x40')]['includeAll']){_0x23a2c0['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x735a('0x67')](_0x23a2c0);})[_0x735a('0x2e')](function(_0x4ae747){_0xedc1a7[_0x735a('0x4d')]=_0x4ae747;return _0xedc1a7;});}})['then'](respondWithFilteredResult(_0x2aa535,_0x23a2c0))[_0x735a('0x4e')](handleError(_0x2aa535,null));};exports['getHopperBlacks']=function(_0x23ce9b,_0x1b6410,_0x5337fc){var _0x3491e8={'raw':!![],'where':{}};var _0x18d43a={};var _0xc1d942={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x735a('0x6b')]({'where':{'id':_0x23ce9b[_0x735a('0x5b')]['id']}})[_0x735a('0x2e')](handleEntityNotFound(_0x1b6410,null))[_0x735a('0x2e')](function(_0x20f625){if(_0x20f625){_0x18d43a['model']=_[_0x735a('0x3f')](db[_0x735a('0x6d')][_0x735a('0x4f')]);_0x18d43a[_0x735a('0x40')]=_[_0x735a('0x3f')](_0x23ce9b[_0x735a('0x40')]);_0x18d43a[_0x735a('0x41')]=_[_0x735a('0x50')](_0x18d43a[_0x735a('0x3e')],_0x18d43a['query']);_0x3491e8[_0x735a('0x51')]=_[_0x735a('0x50')](_0x18d43a[_0x735a('0x3e')],qs[_0x735a('0x42')](_0x23ce9b['query'][_0x735a('0x42')]));_0x3491e8[_0x735a('0x51')]=_0x3491e8['attributes'][_0x735a('0x43')]?_0x3491e8[_0x735a('0x51')]:_0x18d43a['model'];if(!_0x23ce9b['query'][_0x735a('0x44')](_0x735a('0x65'))){_0x3491e8[_0x735a('0x28')]=qs[_0x735a('0x28')](_0x23ce9b[_0x735a('0x40')][_0x735a('0x28')]);_0x3491e8[_0x735a('0x25')]=qs[_0x735a('0x25')](_0x23ce9b['query'][_0x735a('0x25')]);}_0x3491e8['order']=qs[_0x735a('0x46')](_0x23ce9b[_0x735a('0x40')][_0x735a('0x46')]);_0x3491e8['where']=qs[_0x735a('0x41')](_[_0x735a('0x47')](_0x23ce9b[_0x735a('0x40')],_0x18d43a['filters']));_0x3491e8[_0x735a('0x48')]['VoiceQueueId']=_0x20f625['id'];if(_0x23ce9b[_0x735a('0x40')][_0x735a('0x33')]){_0x3491e8[_0x735a('0x48')]=_[_0x735a('0x49')](_0x3491e8[_0x735a('0x48')],{'$or':_[_0x735a('0x35')](_0x3491e8[_0x735a('0x51')],function(_0xddc066){var _0x27926e={};_0x27926e[_0xddc066]={'$like':'%'+_0x23ce9b[_0x735a('0x40')][_0x735a('0x33')]+'%'};return _0x27926e;})});}_0x3491e8=_['merge']({},_0x3491e8,_0x23ce9b[_0x735a('0x5c')]);return db[_0x735a('0x6d')][_0x735a('0x27')]({'where':_0x3491e8[_0x735a('0x48')]})[_0x735a('0x2e')](function(_0x1f0e78){_0xc1d942['count']=_0x1f0e78;if(_0x23ce9b[_0x735a('0x40')][_0x735a('0x4b')]){_0x3491e8[_0x735a('0x4c')]=[{'all':!![]}];}return db[_0x735a('0x6d')]['findAll'](_0x3491e8);})[_0x735a('0x2e')](function(_0x549185){_0xc1d942[_0x735a('0x4d')]=_0x549185;return _0xc1d942;});}})[_0x735a('0x2e')](respondWithFilteredResult(_0x1b6410,_0x3491e8))[_0x735a('0x4e')](handleError(_0x1b6410,null));};exports['getTeams']=function(_0x9f097b,_0x493c99,_0x31d386){var _0x2dd3ef={};var _0x10be9c={};var _0x317b73;var _0x3c0013;return db[_0x735a('0x3c')]['findOne']({'where':{'id':_0x9f097b[_0x735a('0x5b')]['id']}})[_0x735a('0x2e')](handleEntityNotFound(_0x493c99,null))[_0x735a('0x2e')](function(_0x135bb3){if(_0x135bb3){_0x317b73=_0x135bb3;_0x10be9c['model']=_[_0x735a('0x3f')](db['Team'][_0x735a('0x4f')]);_0x10be9c[_0x735a('0x40')]=_[_0x735a('0x3f')](_0x9f097b[_0x735a('0x40')]);_0x10be9c[_0x735a('0x41')]=_[_0x735a('0x50')](_0x10be9c['model'],_0x10be9c[_0x735a('0x40')]);_0x2dd3ef[_0x735a('0x51')]=_[_0x735a('0x50')](_0x10be9c[_0x735a('0x3e')],qs[_0x735a('0x42')](_0x9f097b['query']['fields']));_0x2dd3ef[_0x735a('0x51')]=_0x2dd3ef[_0x735a('0x51')][_0x735a('0x43')]?_0x2dd3ef[_0x735a('0x51')]:_0x10be9c[_0x735a('0x3e')];_0x2dd3ef[_0x735a('0x45')]=qs['sort'](_0x9f097b['query']['sort']);_0x2dd3ef[_0x735a('0x48')]=qs[_0x735a('0x41')](_[_0x735a('0x47')](_0x9f097b[_0x735a('0x40')],_0x10be9c[_0x735a('0x41')]));if(_0x9f097b[_0x735a('0x40')]['filter']){_0x2dd3ef[_0x735a('0x48')]=_[_0x735a('0x49')](_0x2dd3ef[_0x735a('0x48')],{'$or':_[_0x735a('0x35')](_0x2dd3ef[_0x735a('0x51')],function(_0x45ee02){var _0x350e5b={};_0x350e5b[_0x45ee02]={'$like':'%'+_0x9f097b[_0x735a('0x40')][_0x735a('0x33')]+'%'};return _0x350e5b;})});}_0x2dd3ef=_[_0x735a('0x49')]({},_0x2dd3ef,_0x9f097b[_0x735a('0x5c')]);return _0x317b73[_0x735a('0x6e')](_0x2dd3ef);}})[_0x735a('0x2e')](function(_0x5782f5){if(_0x5782f5){_0x3c0013=_0x5782f5[_0x735a('0x43')];if(!_0x9f097b[_0x735a('0x40')][_0x735a('0x44')](_0x735a('0x65'))){_0x2dd3ef[_0x735a('0x28')]=qs['limit'](_0x9f097b['query'][_0x735a('0x28')]);_0x2dd3ef[_0x735a('0x25')]=qs[_0x735a('0x25')](_0x9f097b[_0x735a('0x40')][_0x735a('0x25')]);}return _0x317b73[_0x735a('0x6e')](_0x2dd3ef);}})[_0x735a('0x2e')](function(_0x2076b3){if(_0x2076b3){return _0x2076b3?{'count':_0x3c0013,'rows':_0x2076b3}:null;}})['then'](respondWithResult(_0x493c99,null))[_0x735a('0x4e')](handleError(_0x493c99,null));};exports[_0x735a('0x6f')]=function(_0x93332b,_0x13ec59,_0x488837){var _0x4036ec=_0x93332b['body'][_0x735a('0x70')];var _0x37b827=_['map'](_0x4036ec,'id');return db[_0x735a('0x71')][_0x735a('0x67')]({'where':{'id':_0x37b827},'attributes':['id'],'include':[{'model':db[_0x735a('0x72')],'as':_0x735a('0x73'),'attributes':['id',_0x735a('0x3a'),'online','voicePause',_0x735a('0x74')],'raw':!![]}]})[_0x735a('0x2e')](function(_0x50976a){if(_0x50976a){var _0x32d612=_[_0x735a('0x75')](_0x50976a,function(_0x3ad290){var _0x5a6656=_0x3ad290[_0x735a('0x30')]({'plain':!![]});_0x5a6656[_0x735a('0x73')][_0x735a('0x76')](function(_0x10898d){_0x10898d[_0x735a('0x77')]=_[_0x735a('0x37')](_0x4036ec,{'id':_0x5a6656['id']})['penalty'];});return _0x5a6656[_0x735a('0x73')];});return db[_0x735a('0x3c')][_0x735a('0x37')]({'where':{'id':_0x93332b[_0x735a('0x5b')]['id']}})['then'](function(_0x545f56){return db['sequelize'][_0x735a('0x78')](function(_0x3c1b0b){return _0x545f56[_0x735a('0x6f')](_0x37b827,{'transaction':_0x3c1b0b})[_0x735a('0x2e')](function(){return BPromise[_0x735a('0x79')](_0x4036ec,function(_0x315461){return db[_0x735a('0x7a')][_0x735a('0x7b')]({'TeamId':_0x315461['id'],'VoiceQueueId':_0x93332b[_0x735a('0x5b')]['id'],'penalty':_0x315461[_0x735a('0x77')]},{'transaction':_0x3c1b0b});});})[_0x735a('0x2e')](function(){return BPromise[_0x735a('0x79')](_0x32d612,function(_0x17e7b7){return db[_0x735a('0x7c')]['findOrCreate']({'where':{'UserId':_0x17e7b7['id'],'VoiceQueueId':_0x93332b[_0x735a('0x5b')]['id']},'defaults':{'penalty':_0x17e7b7[_0x735a('0x77')]},'transaction':_0x3c1b0b});});})[_0x735a('0x2e')](function(){return BPromise['each'](_[_0x735a('0x33')](_0x32d612,{'online':!![]}),function(_0x45e731){return db[_0x735a('0x7d')]['upsert']({'membername':_0x45e731[_0x735a('0x3a')],'UserId':_0x45e731['id'],'queue_name':_0x545f56[_0x735a('0x3a')],'VoiceQueueId':_0x545f56['id'],'interface':_[_0x735a('0x7e')](_0x45e731[_0x735a('0x74')])?util[_0x735a('0x7f')](_0x735a('0x80'),_0x45e731['name']):_0x45e731[_0x735a('0x74')],'paused':_0x45e731[_0x735a('0x81')]||![],'penalty':_0x45e731[_0x735a('0x77')]},{'transaction':_0x3c1b0b});});})[_0x735a('0x2e')](function(){_0x32d612[_0x735a('0x76')](function(_0x4454f1){socket[_0x735a('0x82')]('userVoiceQueue:save',{'UserId':_0x4454f1['id'],'VoiceQueueId':_0x545f56['id']});});});});});}})[_0x735a('0x2e')](respondWithStatusCode(_0x13ec59,null))[_0x735a('0x4e')](handleError(_0x13ec59,null));};exports['removeTeams']=function(_0xad9bef,_0x180400,_0x2de991){return db['Team'][_0x735a('0x67')]({'where':{'id':_0xad9bef[_0x735a('0x40')][_0x735a('0x83')]},'attributes':['id'],'include':[{'model':db[_0x735a('0x72')],'as':_0x735a('0x73'),'attributes':['id'],'raw':!![]}]})[_0x735a('0x2e')](handleEntityNotFound(_0x180400,null))[_0x735a('0x2e')](function(_0x242778){var _0x3eefe=_[_0x735a('0x35')](_0x242778,'id');var _0x5e5794=[];var _0x2a6512=[];var _0x523e66=squel[_0x735a('0x84')]();_0x523e66[_0x735a('0x85')](_0x735a('0x86'))[_0x735a('0x87')](_0x735a('0x88'),'tq')['join'](_0x735a('0x89'),'ut',_0x735a('0x8a'))[_0x735a('0x48')](_0x735a('0x8b'),_0xad9bef[_0x735a('0x5b')]['id']);for(var _0x5390b4=0x0;_0x5390b4<_0x242778[_0x735a('0x43')];_0x5390b4+=0x1){let _0x5c19e7=_0x242778[_0x5390b4];for(var _0x163d57=0x0;_0x163d57<_0x5c19e7[_0x735a('0x73')][_0x735a('0x43')];_0x163d57+=0x1){let _0x1ce31d=_0x5c19e7[_0x735a('0x73')][_0x163d57];var _0x2c33db=_0x523e66[_0x735a('0x8c')]();_0x2c33db['where'](_0x735a('0x8d'),_0x1ce31d['id']);_0x2a6512['push'](db[_0x735a('0x8e')][_0x735a('0x40')](_0x2c33db['toString'](),{'type':db[_0x735a('0x8e')][_0x735a('0x8f')][_0x735a('0x90')]})[_0x735a('0x2e')](function(_0x4505ba){if(_0x4505ba['length']===0x1){return _0x1ce31d['id'];}else{var _0x29b6ca=_['every'](_[_0x735a('0x35')](_0x4505ba,_0x735a('0x91')),function(_0x1e6bd2){return _[_0x735a('0x92')](_0x3eefe,_0x1e6bd2);});if(_0x29b6ca){return _0x1ce31d['id'];}}}));}}return BPromise[_0x735a('0x93')](_0x2a6512)[_0x735a('0x2e')](function(_0x3a2962){_0x5e5794=_(_0x5e5794)['union'](_0x3a2962)[_0x735a('0x94')]()[_0x735a('0x38')]();return db[_0x735a('0x3c')][_0x735a('0x37')]({'where':{'id':_0xad9bef[_0x735a('0x5b')]['id']}})['then'](function(_0x5e7d98){return db[_0x735a('0x8e')][_0x735a('0x78')](function(_0x5c9948){return _0x5e7d98[_0x735a('0x95')](_0xad9bef[_0x735a('0x40')][_0x735a('0x83')],{'transaction':_0x5c9948})[_0x735a('0x2e')](function(){if(!_[_0x735a('0x96')](_0x5e5794)){return _0x5e7d98[_0x735a('0x97')](_0x5e5794,{'transaction':_0x5c9948})['then'](function(){return db[_0x735a('0x7d')]['destroy']({'where':{'VoiceQueueId':_0xad9bef[_0x735a('0x5b')]['id'],'UserId':_0x5e5794},'transaction':_0x5c9948});});}})[_0x735a('0x2e')](function(){_0x5e5794[_0x735a('0x76')](function(_0x3f4ff8){socket[_0x735a('0x82')](_0x735a('0x98'),{'UserId':_0x3f4ff8,'VoiceQueueId':_0x5e7d98['id']});});});});});});})[_0x735a('0x2e')](respondWithStatusCode(_0x180400,null))['catch'](handleError(_0x180400,null));};exports[_0x735a('0x99')]=function(_0xe60016,_0xf2b7f8,_0x159e6c){var _0x278944,_0x326565;return db[_0x735a('0x3c')][_0x735a('0x37')]({'where':{'id':_0xe60016['params']['id']}})['then'](handleEntityNotFound(_0xf2b7f8,null))[_0x735a('0x2e')](function(_0xc56a1){if(_0xc56a1){_0x326565=_0xc56a1;return _0xc56a1['addAgents'](_0xe60016[_0x735a('0x60')][_0x735a('0x83')],_[_0x735a('0x5d')](_0xe60016[_0x735a('0x60')],[_0x735a('0x83'),'id'])||{})[_0x735a('0x9a')](function(_0x91b6b6){for(var _0x1f4e80=0x0;_0x1f4e80<_0xe60016['body'][_0x735a('0x83')][_0x735a('0x43')];_0x1f4e80+=0x1){socket[_0x735a('0x82')](_0x735a('0x9b'),{'UserId':Number(_0xe60016[_0x735a('0x60')][_0x735a('0x83')][_0x1f4e80]),'VoiceQueueId':Number(_0xe60016[_0x735a('0x5b')]['id'])});}return _0x91b6b6;});}})[_0x735a('0x2e')](function(_0xdd6208){_0x278944=_0xdd6208||[];if(_0x326565){return db['User']['findAll']({'where':{'id':_0xe60016['body'][_0x735a('0x83')]},'attributes':['id',_0x735a('0x3a'),'online','voicePause',_0x735a('0x74')],'raw':!![]});}})[_0x735a('0x2e')](function(_0x38c230){if(!_[_0x735a('0x96')](_0x38c230)){var _0x29852c=[];for(var _0x2e6abf=0x0;_0x2e6abf<_0x38c230[_0x735a('0x43')];_0x2e6abf++){if(_0x38c230[_0x2e6abf][_0x735a('0x9c')]){_0x29852c['push'](db[_0x735a('0x7d')][_0x735a('0x7b')]({'membername':_0x38c230[_0x2e6abf]['name'],'UserId':_0x38c230[_0x2e6abf]['id'],'queue_name':_0x326565[_0x735a('0x3a')],'VoiceQueueId':_0x326565['id'],'interface':_[_0x735a('0x7e')](_0x38c230[_0x2e6abf]['interface'])?util[_0x735a('0x7f')](_0x735a('0x80'),_0x38c230[_0x2e6abf][_0x735a('0x3a')]):_0x38c230[_0x2e6abf][_0x735a('0x74')],'paused':_0x38c230[_0x2e6abf][_0x735a('0x81')]||![],'penalty':_0xe60016[_0x735a('0x60')][_0x735a('0x77')]||0x0}));}}return BPromise[_0x735a('0x93')](_0x29852c);}})[_0x735a('0x2e')](function(){return _0x278944;})['then'](respondWithResult(_0xf2b7f8,null))[_0x735a('0x4e')](handleError(_0xf2b7f8,null));};exports[_0x735a('0x97')]=function(_0x995b5,_0x243b45,_0x3d1854){return db['VoiceQueue'][_0x735a('0x37')]({'where':{'id':_0x995b5['params']['id']}})[_0x735a('0x2e')](handleEntityNotFound(_0x243b45,null))[_0x735a('0x2e')](function(_0xa60ccd){if(_0xa60ccd){return _0xa60ccd[_0x735a('0x97')](_0x995b5[_0x735a('0x40')][_0x735a('0x83')])['then'](function(){if(_[_0x735a('0x9d')](_0x995b5[_0x735a('0x40')][_0x735a('0x83')])){for(var _0x1bbad8=0x0;_0x1bbad8<_0x995b5['query'][_0x735a('0x83')][_0x735a('0x43')];_0x1bbad8+=0x1){socket[_0x735a('0x82')]('userVoiceQueue:remove',{'UserId':Number(_0x995b5['query']['ids'][_0x1bbad8]),'VoiceQueueId':Number(_0x995b5[_0x735a('0x5b')]['id'])});}}else{socket[_0x735a('0x82')]('userVoiceQueue:remove',{'UserId':Number(_0x995b5[_0x735a('0x40')][_0x735a('0x83')]),'VoiceQueueId':Number(_0x995b5[_0x735a('0x5b')]['id'])});}});}})[_0x735a('0x2e')](function(_0x19f7aa){return db[_0x735a('0x7d')][_0x735a('0x2f')]({'where':{'VoiceQueueId':_0x995b5[_0x735a('0x5b')]['id'],'UserId':_0x995b5[_0x735a('0x40')]['ids']}})[_0x735a('0x2e')](function(){return _0x19f7aa;});})['then'](respondWithStatusCode(_0x243b45,null))[_0x735a('0x4e')](handleError(_0x243b45,null));};exports[_0x735a('0x9e')]=function(_0x51f0aa,_0x363c8d,_0x5b7bd9){var _0x560da4={};var _0x8ff5e4={};var _0x7d9266;var _0x60f2c7;return db[_0x735a('0x3c')][_0x735a('0x6b')]({'where':{'id':_0x51f0aa['params']['id']}})['then'](handleEntityNotFound(_0x363c8d,null))[_0x735a('0x2e')](function(_0x44d223){if(_0x44d223){_0x7d9266=_0x44d223;_0x8ff5e4[_0x735a('0x3e')]=_['keys'](db[_0x735a('0x72')][_0x735a('0x4f')]);_0x8ff5e4[_0x735a('0x40')]=_[_0x735a('0x3f')](_0x51f0aa['query']);_0x8ff5e4['filters']=_[_0x735a('0x50')](_0x8ff5e4[_0x735a('0x3e')],_0x8ff5e4[_0x735a('0x40')]);_0x560da4[_0x735a('0x51')]=_[_0x735a('0x50')](_0x8ff5e4[_0x735a('0x3e')],qs[_0x735a('0x42')](_0x51f0aa[_0x735a('0x40')]['fields']));_0x560da4[_0x735a('0x51')]=_0x560da4['attributes']['length']?_0x560da4[_0x735a('0x51')]:_0x8ff5e4['model'];_0x560da4[_0x735a('0x45')]=qs[_0x735a('0x46')](_0x51f0aa[_0x735a('0x40')]['sort']);_0x560da4[_0x735a('0x48')]=qs[_0x735a('0x41')](_[_0x735a('0x47')](_0x51f0aa[_0x735a('0x40')],_0x8ff5e4[_0x735a('0x41')]));if(_0x51f0aa[_0x735a('0x40')][_0x735a('0x33')]){_0x560da4[_0x735a('0x48')]=_['merge'](_0x560da4[_0x735a('0x48')],{'$or':_[_0x735a('0x35')](_0x560da4[_0x735a('0x51')],function(_0x57f436){var _0x293560={};_0x293560[_0x57f436]={'$like':'%'+_0x51f0aa[_0x735a('0x40')][_0x735a('0x33')]+'%'};return _0x293560;})});}_0x560da4=_[_0x735a('0x49')]({},_0x560da4,_0x51f0aa[_0x735a('0x5c')]);return _0x7d9266['getAgents'](_0x560da4);}})[_0x735a('0x2e')](function(_0x20c4f3){if(_0x20c4f3){_0x60f2c7=_0x20c4f3[_0x735a('0x43')];if(!_0x51f0aa[_0x735a('0x40')][_0x735a('0x44')](_0x735a('0x65'))){_0x560da4[_0x735a('0x28')]=qs[_0x735a('0x28')](_0x51f0aa[_0x735a('0x40')]['limit']);_0x560da4[_0x735a('0x25')]=qs['offset'](_0x51f0aa['query'][_0x735a('0x25')]);}return _0x7d9266[_0x735a('0x9e')](_0x560da4);}})[_0x735a('0x2e')](function(_0x4aaab0){if(_0x4aaab0){return _0x4aaab0?{'count':_0x60f2c7,'rows':_0x4aaab0}:null;}})[_0x735a('0x2e')](respondWithResult(_0x363c8d,null))[_0x735a('0x4e')](handleError(_0x363c8d,null));};exports[_0x735a('0x9f')]=function(_0x52a62e,_0xd4ecc6,_0x500260){var _0x472b4a={};var _0x5628ca={};var _0x58258c;var _0x5c4079;return db[_0x735a('0x3c')]['findOne']({'where':{'id':_0x52a62e[_0x735a('0x5b')]['id']}})[_0x735a('0x2e')](handleEntityNotFound(_0xd4ecc6,null))['then'](function(_0x486758){if(_0x486758){_0x58258c=_0x486758;_0x5628ca[_0x735a('0x3e')]=_['keys'](db['UserVoiceQueueRt'][_0x735a('0x4f')]);_0x5628ca['query']=_[_0x735a('0x3f')](_0x52a62e[_0x735a('0x40')]);_0x5628ca[_0x735a('0x41')]=_[_0x735a('0x50')](_0x5628ca[_0x735a('0x3e')],_0x5628ca[_0x735a('0x40')]);_0x472b4a[_0x735a('0x51')]=_[_0x735a('0x50')](_0x5628ca['model'],qs['fields'](_0x52a62e['query'][_0x735a('0x42')]));_0x472b4a[_0x735a('0x51')]=_0x472b4a[_0x735a('0x51')][_0x735a('0x43')]?_0x472b4a[_0x735a('0x51')]:_0x5628ca['model'];_0x472b4a[_0x735a('0x45')]=qs[_0x735a('0x46')](_0x52a62e['query']['sort']);_0x472b4a['where']=qs['filters'](_[_0x735a('0x47')](_0x52a62e['query'],_0x5628ca[_0x735a('0x41')]));if(_0x52a62e[_0x735a('0x40')][_0x735a('0x33')]){_0x472b4a[_0x735a('0x48')]=_['merge'](_0x472b4a[_0x735a('0x48')],{'$or':_[_0x735a('0x35')](_0x472b4a[_0x735a('0x51')],function(_0x4258c3){var _0x4431ec={};_0x4431ec[_0x4258c3]={'$like':'%'+_0x52a62e[_0x735a('0x40')][_0x735a('0x33')]+'%'};return _0x4431ec;})});}_0x472b4a=_['merge']({},_0x472b4a,_0x52a62e['options']);return _0x58258c[_0x735a('0x9f')](_0x472b4a);}})['then'](function(_0x557e02){if(_0x557e02){_0x5c4079=_0x557e02[_0x735a('0x43')];if(!_0x52a62e[_0x735a('0x40')]['hasOwnProperty'](_0x735a('0x65'))){_0x472b4a['limit']=qs['limit'](_0x52a62e['query'][_0x735a('0x28')]);_0x472b4a[_0x735a('0x25')]=qs[_0x735a('0x25')](_0x52a62e[_0x735a('0x40')]['offset']);}return _0x58258c[_0x735a('0x9f')](_0x472b4a);}})[_0x735a('0x2e')](function(_0x4caaf9){return _0x4caaf9?{'count':_0x5c4079,'rows':_0x4caaf9}:null;})[_0x735a('0x2e')](respondWithResult(_0xd4ecc6,null))['catch'](handleError(_0xd4ecc6,null));};exports[_0x735a('0xa0')]=function(_0x15ecd8,_0x13dcb8,_0x25ce64){var _0x234bfd={};var _0x4a9f8b={};var _0xa208eb;var _0x3aae55;return db[_0x735a('0x3c')][_0x735a('0x6b')]({'where':{'id':_0x15ecd8['params']['id']}})[_0x735a('0x2e')](handleEntityNotFound(_0x13dcb8,null))[_0x735a('0x2e')](function(_0x5903e2){if(_0x5903e2){_0xa208eb=_0x5903e2;_0x4a9f8b[_0x735a('0x3e')]=_[_0x735a('0x3f')](db[_0x735a('0xa1')]['rawAttributes']);_0x4a9f8b['query']=_['keys'](_0x15ecd8['query']);_0x4a9f8b[_0x735a('0x41')]=_[_0x735a('0x50')](_0x4a9f8b[_0x735a('0x3e')],_0x4a9f8b[_0x735a('0x40')]);_0x234bfd[_0x735a('0x51')]=_[_0x735a('0x50')](_0x4a9f8b['model'],qs[_0x735a('0x42')](_0x15ecd8[_0x735a('0x40')][_0x735a('0x42')]));_0x234bfd['attributes']=_0x234bfd[_0x735a('0x51')][_0x735a('0x43')]?_0x234bfd[_0x735a('0x51')]:_0x4a9f8b[_0x735a('0x3e')];_0x234bfd['order']=qs['sort'](_0x15ecd8[_0x735a('0x40')][_0x735a('0x46')]);_0x234bfd[_0x735a('0x48')]=qs['filters'](_[_0x735a('0x47')](_0x15ecd8[_0x735a('0x40')],_0x4a9f8b[_0x735a('0x41')]));if(_0x15ecd8['query']['filter']){_0x234bfd[_0x735a('0x48')]=_['merge'](_0x234bfd[_0x735a('0x48')],{'$or':_['map'](_0x234bfd['attributes'],function(_0x5c06f8){var _0x41e2be={};_0x41e2be[_0x5c06f8]={'$like':'%'+_0x15ecd8[_0x735a('0x40')]['filter']+'%'};return _0x41e2be;})});}_0x234bfd=_[_0x735a('0x49')]({},_0x234bfd,_0x15ecd8[_0x735a('0x5c')]);return _0xa208eb[_0x735a('0xa0')](_0x234bfd);}})['then'](function(_0x18dc5d){if(_0x18dc5d){_0x3aae55=_0x18dc5d[_0x735a('0x43')];if(!_0x15ecd8['query'][_0x735a('0x44')](_0x735a('0x65'))){_0x234bfd['limit']=qs[_0x735a('0x28')](_0x15ecd8[_0x735a('0x40')][_0x735a('0x28')]);_0x234bfd['offset']=qs[_0x735a('0x25')](_0x15ecd8[_0x735a('0x40')][_0x735a('0x25')]);}return _0xa208eb[_0x735a('0xa0')](_0x234bfd);}})['then'](function(_0x41fd3b){if(_0x41fd3b){return _0x41fd3b?{'count':_0x3aae55,'rows':_0x41fd3b}:null;}})['then'](respondWithResult(_0x13dcb8,null))[_0x735a('0x4e')](handleError(_0x13dcb8,null));};exports[_0x735a('0xa2')]=function(_0x3cf498,_0x4ca728,_0x2205ff){var _0x205b26,_0x21f0d6;return db[_0x735a('0x3c')][_0x735a('0x37')]({'where':{'id':_0x3cf498[_0x735a('0x5b')]['id']}})[_0x735a('0x2e')](handleEntityNotFound(_0x4ca728,null))[_0x735a('0x2e')](function(_0x1e41a3){if(_0x1e41a3){_0x21f0d6=_0x1e41a3;return _0x1e41a3[_0x735a('0xa2')](_0x3cf498[_0x735a('0x60')]['ids'],_[_0x735a('0x5d')](_0x3cf498['body'],['ids','id'])||{});}return null;})[_0x735a('0x9a')](function(_0x97a81c){var _0x10fe9c;_0x205b26=_0x97a81c||[];var _0x565a60=[];if(_0x97a81c){for(var _0x12308e=0x0;_0x12308e<_0x97a81c[_0x735a('0x43')];_0x12308e+=0x1){var _0x200675=_0x97a81c[_0x12308e]['get']({'plain':!![]});_0x21f0d6['dialCheckDuplicateType']=_0x3cf498[_0x735a('0x60')][_0x735a('0xa3')]?_0x3cf498['body'][_0x735a('0xa3')]:_0x21f0d6['dialCheckDuplicateType'];switch(_0x21f0d6[_0x735a('0xa3')]){case'always':_0x10fe9c=squel[_0x735a('0xa4')]()[_0x735a('0xa5')]('cm_hopper')[_0x735a('0xa6')]([_0x735a('0xa7'),_0x735a('0xa8'),_0x735a('0xa9'),_0x735a('0xaa'),'VoiceQueueId',_0x735a('0x5e'),_0x735a('0x5f')],squel[_0x735a('0x84')]()[_0x735a('0x85')]('phone',_0x735a('0xa7'))[_0x735a('0x85')](_0x735a('0xab'),'scheduledAt')[_0x735a('0x85')]('id','ContactId')[_0x735a('0x85')](_0x200675[_0x735a('0xac')][_0x735a('0xad')](),'ListId')[_0x735a('0x85')](_0x3cf498[_0x735a('0x5b')]['id'][_0x735a('0xad')](),_0x735a('0x66'))[_0x735a('0x85')]('NOW()','createdAt')[_0x735a('0x85')](_0x735a('0xab'),'updatedAt')[_0x735a('0x87')]('cm_contacts')[_0x735a('0x48')](_0x735a('0xae'))[_0x735a('0x48')](_0x735a('0xaf'),_0x200675[_0x735a('0xac')][_0x735a('0xad')]())[_0x735a('0x48')]('phone\x20IS\x20NOT\x20NULL')[_0x735a('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x735a('0x84')]()[_0x735a('0x85')](_0x735a('0xb0'))['from'](_0x735a('0xb1'))[_0x735a('0x48')](_0x735a('0x8b'),_0x3cf498[_0x735a('0x5b')]['id'][_0x735a('0xad')]()))['where'](_0x735a('0xb2'),squel[_0x735a('0x84')]()['field'](_0x735a('0xb3'))[_0x735a('0x87')](_0x735a('0xb4'))[_0x735a('0x48')](_0x735a('0x8b'),_0x3cf498[_0x735a('0x5b')]['id'][_0x735a('0xad')]())))[_0x735a('0xad')]();break;case _0x735a('0xb5'):_0x10fe9c=squel[_0x735a('0xa4')]()[_0x735a('0xa5')](_0x735a('0xb4'))['fromQuery']([_0x735a('0xa7'),'scheduledAt','ContactId',_0x735a('0xaa'),_0x735a('0x66'),_0x735a('0x5e'),'updatedAt'],squel[_0x735a('0x84')]()[_0x735a('0x85')](_0x735a('0xa7'),_0x735a('0xa7'))['field']('NOW()',_0x735a('0xa8'))[_0x735a('0x85')]('id',_0x735a('0xa9'))['field'](_0x200675['CmListId'][_0x735a('0xad')](),_0x735a('0xaa'))[_0x735a('0x85')](_0x3cf498[_0x735a('0x5b')]['id'][_0x735a('0xad')](),'VoiceQueueId')['field']('NOW()','createdAt')[_0x735a('0x85')](_0x735a('0xab'),_0x735a('0x5f'))[_0x735a('0x87')](_0x735a('0xb6'))[_0x735a('0x48')](_0x735a('0xae'))[_0x735a('0x48')](_0x735a('0xaf'),_0x200675['CmListId'][_0x735a('0xad')]())[_0x735a('0x48')](_0x735a('0xb7'))[_0x735a('0x48')](_0x735a('0xb2'),squel['select']()[_0x735a('0x85')](_0x735a('0xb3'))[_0x735a('0x87')](_0x735a('0xb4'))[_0x735a('0x48')](_0x735a('0x8b'),_0x3cf498[_0x735a('0x5b')]['id'][_0x735a('0xad')]())))[_0x735a('0xad')]();break;default:_0x10fe9c=squel['insert']()[_0x735a('0xa5')]('cm_hopper')['fromQuery']([_0x735a('0xa7'),_0x735a('0xa8'),_0x735a('0xa9'),_0x735a('0xaa'),'VoiceQueueId',_0x735a('0x5e'),_0x735a('0x5f')],squel['select']()[_0x735a('0x85')](_0x735a('0xa7'),_0x735a('0xa7'))[_0x735a('0x85')](_0x735a('0xab'),_0x735a('0xa8'))['field']('id',_0x735a('0xa9'))[_0x735a('0x85')](_0x200675[_0x735a('0xac')][_0x735a('0xad')](),_0x735a('0xaa'))[_0x735a('0x85')](_0x3cf498['params']['id'][_0x735a('0xad')](),_0x735a('0x66'))[_0x735a('0x85')](_0x735a('0xab'),'createdAt')[_0x735a('0x85')](_0x735a('0xab'),_0x735a('0x5f'))[_0x735a('0x87')]('cm_contacts')[_0x735a('0x48')]('deletedAt\x20IS\x20NULL')[_0x735a('0x48')](_0x735a('0xaf'),_0x200675[_0x735a('0xac')][_0x735a('0xad')]())[_0x735a('0x48')](_0x735a('0xb7')))[_0x735a('0xad')]();}_0x565a60[_0x735a('0xb8')](db['sequelize']['query'](_0x10fe9c));}return BPromise['all'](_0x565a60);}})[_0x735a('0x2e')](function(){return _0x205b26;})[_0x735a('0x2e')](respondWithResult(_0x4ca728,null))[_0x735a('0x4e')](handleError(_0x4ca728,null));};exports[_0x735a('0xb9')]=function(_0x31d5fc,_0x4cb0dc,_0x500abc){return db[_0x735a('0x3c')]['find']({'where':{'id':_0x31d5fc[_0x735a('0x5b')]['id']}})[_0x735a('0x2e')](handleEntityNotFound(_0x4cb0dc,null))[_0x735a('0x2e')](function(_0x485d57){if(_0x485d57){return _0x485d57[_0x735a('0xb9')](_0x31d5fc['query'][_0x735a('0x83')]);}})[_0x735a('0x2e')](function(_0x26054b){if(_0x26054b){return db['CmHopper'][_0x735a('0x2f')]({'where':{'ListId':_0x31d5fc['query'][_0x735a('0x83')],'VoiceQueueId':_0x31d5fc[_0x735a('0x5b')]['id']}})[_0x735a('0x2e')](function(){return _0x26054b;});}})[_0x735a('0x2e')](respondWithStatusCode(_0x4cb0dc,null))['catch'](handleError(_0x4cb0dc,null));};exports[_0x735a('0xba')]=function(_0x21a0c5,_0x5473d4,_0x5dd344){var _0x6149d8={};var _0x1485bf={};var _0x3db127;var _0x3c04ff;return db[_0x735a('0x3c')][_0x735a('0x6b')]({'where':{'id':_0x21a0c5[_0x735a('0x5b')]['id']}})[_0x735a('0x2e')](handleEntityNotFound(_0x5473d4,null))[_0x735a('0x2e')](function(_0x280feb){if(_0x280feb){_0x3db127=_0x280feb;_0x1485bf[_0x735a('0x3e')]=_['keys'](db['CmList'][_0x735a('0x4f')]);_0x1485bf[_0x735a('0x40')]=_[_0x735a('0x3f')](_0x21a0c5[_0x735a('0x40')]);_0x1485bf['filters']=_[_0x735a('0x50')](_0x1485bf['model'],_0x1485bf[_0x735a('0x40')]);_0x6149d8[_0x735a('0x51')]=_[_0x735a('0x50')](_0x1485bf[_0x735a('0x3e')],qs[_0x735a('0x42')](_0x21a0c5[_0x735a('0x40')][_0x735a('0x42')]));_0x6149d8[_0x735a('0x51')]=_0x6149d8[_0x735a('0x51')][_0x735a('0x43')]?_0x6149d8[_0x735a('0x51')]:_0x1485bf[_0x735a('0x3e')];_0x6149d8[_0x735a('0x45')]=qs['sort'](_0x21a0c5[_0x735a('0x40')][_0x735a('0x46')]);_0x6149d8['where']=qs[_0x735a('0x41')](_['pick'](_0x21a0c5[_0x735a('0x40')],_0x1485bf[_0x735a('0x41')]));if(_0x21a0c5[_0x735a('0x40')][_0x735a('0x33')]){_0x6149d8[_0x735a('0x48')]=_['merge'](_0x6149d8[_0x735a('0x48')],{'$or':_[_0x735a('0x35')](_0x6149d8[_0x735a('0x51')],function(_0x4199b9){var _0x1ecef6={};_0x1ecef6[_0x4199b9]={'$like':'%'+_0x21a0c5[_0x735a('0x40')][_0x735a('0x33')]+'%'};return _0x1ecef6;})});}_0x6149d8=_[_0x735a('0x49')]({},_0x6149d8,_0x21a0c5[_0x735a('0x5c')]);return _0x3db127[_0x735a('0xba')](_0x6149d8);}})[_0x735a('0x2e')](function(_0xa79188){if(_0xa79188){_0x3c04ff=_0xa79188['length'];if(!_0x21a0c5[_0x735a('0x40')][_0x735a('0x44')](_0x735a('0x65'))){_0x6149d8[_0x735a('0x28')]=qs['limit'](_0x21a0c5[_0x735a('0x40')][_0x735a('0x28')]);_0x6149d8['offset']=qs[_0x735a('0x25')](_0x21a0c5[_0x735a('0x40')][_0x735a('0x25')]);}return _0x3db127[_0x735a('0xba')](_0x6149d8);}})[_0x735a('0x2e')](function(_0x2b185c){if(_0x2b185c){return _0x2b185c?{'count':_0x3c04ff,'rows':_0x2b185c}:null;}})[_0x735a('0x2e')](respondWithResult(_0x5473d4,null))[_0x735a('0x4e')](handleError(_0x5473d4,null));};exports['addBlackLists']=function(_0x268b30,_0x5a411e,_0x3c92d4){var _0x45cfba,_0x182a25;return db[_0x735a('0x3c')][_0x735a('0x37')]({'where':{'id':_0x268b30[_0x735a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5a411e,null))[_0x735a('0x2e')](function(_0x3874f6){if(_0x3874f6){_0x182a25=_0x3874f6;return _0x3874f6[_0x735a('0xbb')](_0x268b30['body'][_0x735a('0x83')],_[_0x735a('0x5d')](_0x268b30[_0x735a('0x60')],[_0x735a('0x83'),'id'])||{});}return null;})[_0x735a('0x9a')](function(_0x3567fb){var _0x222ff5;_0x45cfba=_0x3567fb||[];var _0x4726bc=[];if(_0x3567fb){for(var _0x5e90c2=0x0;_0x5e90c2<_0x3567fb['length'];_0x5e90c2+=0x1){var _0x47112c=_0x3567fb[_0x5e90c2][_0x735a('0x30')]({'plain':!![]});_0x222ff5=squel[_0x735a('0xa4')]()[_0x735a('0xa5')](_0x735a('0xbc'))[_0x735a('0xa6')]([_0x735a('0xa7'),_0x735a('0xa9'),'ListId',_0x735a('0x66'),_0x735a('0x5e'),_0x735a('0x5f')],squel[_0x735a('0x84')]()['field'](_0x735a('0xa7'),_0x735a('0xa7'))['field']('id',_0x735a('0xa9'))['field'](_0x47112c[_0x735a('0xac')][_0x735a('0xad')](),_0x735a('0xaa'))['field'](_0x268b30['params']['id'][_0x735a('0xad')](),_0x735a('0x66'))[_0x735a('0x85')](_0x735a('0xab'),'createdAt')['field'](_0x735a('0xab'),'updatedAt')[_0x735a('0x87')](_0x735a('0xb6'))[_0x735a('0x48')]('deletedAt\x20IS\x20NULL')['where'](_0x735a('0xaf'),_0x47112c[_0x735a('0xac')]['toString']())['where'](_0x735a('0xb7')))[_0x735a('0xad')]();_0x4726bc[_0x735a('0xb8')](db[_0x735a('0x8e')][_0x735a('0x40')](_0x222ff5));}return BPromise[_0x735a('0x93')](_0x4726bc);}})['then'](function(){return _0x45cfba;})[_0x735a('0x2e')](respondWithResult(_0x5a411e,null))[_0x735a('0x4e')](handleError(_0x5a411e,null));};exports[_0x735a('0xbd')]=function(_0x54ca37,_0x239b7d,_0xfea2c1){return db[_0x735a('0x3c')][_0x735a('0x37')]({'where':{'id':_0x54ca37[_0x735a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x239b7d,null))[_0x735a('0x2e')](function(_0xea4e8b){if(_0xea4e8b){return _0xea4e8b[_0x735a('0xbd')](_0x54ca37[_0x735a('0x40')][_0x735a('0x83')]);}})[_0x735a('0x2e')](function(_0x56a305){if(_0x56a305){return db[_0x735a('0x6d')][_0x735a('0x2f')]({'where':{'ListId':_0x54ca37[_0x735a('0x40')]['ids'],'VoiceQueueId':_0x54ca37[_0x735a('0x5b')]['id']}})[_0x735a('0x2e')](function(){return _0x56a305;});}})['then'](respondWithStatusCode(_0x239b7d,null))[_0x735a('0x4e')](handleError(_0x239b7d,null));}; \ No newline at end of file +var _0x66e3=['inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','UserProfileResource','error','name','send','index','VoiceQueue','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','findAll','rows','catch','show','params','includeAll','include','create','user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','body','UserProfileSection','userProfileId','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','penalty','sequelize','transaction','each','TeamVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','removeAgents','forEach','userVoiceQueue:remove','addAgents','userVoiceQueue:save','isEmpty','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','fromQuery','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','undefined','count','apply','reject','save','update','then','destroy','get','VoiceQueues'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x66e3,0x14d));var _0x366e=function(_0x4625f2,_0x5a9869){_0x4625f2=_0x4625f2-0x0;var _0x422987=_0x66e3[_0x4625f2];return _0x422987;};'use strict';var emlformat=require(_0x366e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x366e('0x1'));var jsonpatch=require(_0x366e('0x2'));var rp=require(_0x366e('0x3'));var moment=require(_0x366e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x366e('0x5'));var util=require(_0x366e('0x6'));var path=require(_0x366e('0x7'));var sox=require(_0x366e('0x8'));var csv=require(_0x366e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x366e('0xa'));var _=require(_0x366e('0xb'));var squel=require(_0x366e('0xc'));var crypto=require(_0x366e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x366e('0xe'));var toCsv=require(_0x366e('0x9'));var querystring=require('querystring');var Papa=require(_0x366e('0xf'));var Redis=require(_0x366e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x366e('0x11'));var as=require(_0x366e('0x12'));var hardwareService=require(_0x366e('0x13'));var logger=require(_0x366e('0x14'))(_0x366e('0x15'));var utils=require(_0x366e('0x16'));var config=require(_0x366e('0x17'));var licenseUtil=require(_0x366e('0x18'));var db=require(_0x366e('0x19'))['db'];config['redis']=_['defaults'](config[_0x366e('0x1a')],{'host':_0x366e('0x1b'),'port':0x18eb});var socket=require(_0x366e('0x1c'))(new Redis(config[_0x366e('0x1a')]));require(_0x366e('0x1d'))[_0x366e('0x1e')](socket);function respondWithStatusCode(_0x3399a4,_0x4a1cde){_0x4a1cde=_0x4a1cde||0xcc;return function(_0x16a4e5){if(_0x16a4e5){return _0x3399a4[_0x366e('0x1f')](_0x4a1cde);}return _0x3399a4[_0x366e('0x20')](_0x4a1cde)['end']();};}function respondWithResult(_0xaf2fd5,_0x3c2358){_0x3c2358=_0x3c2358||0xc8;return function(_0x42efae){if(_0x42efae){return _0xaf2fd5[_0x366e('0x20')](_0x3c2358)[_0x366e('0x21')](_0x42efae);}};}function respondWithFilteredResult(_0x260334,_0x29c12a){return function(_0x13a205){if(_0x13a205){var _0x43704a=typeof _0x29c12a[_0x366e('0x22')]===_0x366e('0x23')&&typeof _0x29c12a['limit']===_0x366e('0x23');var _0x38e039=_0x13a205[_0x366e('0x24')];var _0x5c6ab8=_0x43704a?0x0:_0x29c12a[_0x366e('0x22')];var _0x81b7be=_0x43704a?_0x13a205[_0x366e('0x24')]:_0x29c12a['offset']+_0x29c12a['limit'];var _0xb54224;if(_0x81b7be>=_0x38e039){_0x81b7be=_0x38e039;_0xb54224=0xc8;}else{_0xb54224=0xce;}_0x260334[_0x366e('0x20')](_0xb54224);return _0x260334['set']('Content-Range',_0x5c6ab8+'-'+_0x81b7be+'/'+_0x38e039)[_0x366e('0x21')](_0x13a205);}return null;};}function patchUpdates(_0x468dc3){return function(_0x4b4336){try{jsonpatch[_0x366e('0x25')](_0x4b4336,_0x468dc3,!![]);}catch(_0x1409cf){return BPromise[_0x366e('0x26')](_0x1409cf);}return _0x4b4336[_0x366e('0x27')]();};}function saveUpdates(_0xeb6fc2,_0x2eaf5c){return function(_0x2db21a){if(_0x2db21a){return _0x2db21a[_0x366e('0x28')](_0xeb6fc2)[_0x366e('0x29')](function(_0x3ec9a6){return _0x3ec9a6;});}return null;};}function removeEntity(_0x991563,_0x2c4151){return function(_0xb06982){if(_0xb06982){return _0xb06982[_0x366e('0x2a')]()['then'](function(){var _0x3f90d0=_0xb06982[_0x366e('0x2b')]({'plain':!![]});var _0x396dca=[{'name':_0x366e('0x2c'),'value':_0x366e('0x2d'),'ignore':![]},{'name':_0x366e('0x2e'),'value':_0x366e('0x2f'),'ignore':![]}];var _0x53d78d=_(_0x396dca)['filter'](_0x366e('0x30'))[_0x366e('0x31')](_0x366e('0x32'))[_0x366e('0x32')]();if(_[_0x366e('0x33')](_0x53d78d,_0x3f90d0[_0x366e('0x34')])){return;}var _0x228244=_['find'](_0x396dca,[_0x366e('0x32'),_0x3f90d0[_0x366e('0x34')]])['name'];return db[_0x366e('0x35')][_0x366e('0x2a')]({'where':{'type':_0x228244,'resourceId':_0x3f90d0['id']}})[_0x366e('0x29')](function(){return _0xb06982;});})[_0x366e('0x29')](function(){_0x991563['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ec3d0,_0x50a21a){return function(_0x5565c2){if(!_0x5565c2){_0x2ec3d0[_0x366e('0x1f')](0x194);}return _0x5565c2;};}function handleError(_0x43683e,_0x2b443d){_0x2b443d=_0x2b443d||0x1f4;return function(_0x598e95){logger[_0x366e('0x36')](_0x598e95['stack']);if(_0x598e95[_0x366e('0x37')]){delete _0x598e95[_0x366e('0x37')];}_0x43683e[_0x366e('0x20')](_0x2b443d)[_0x366e('0x38')](_0x598e95);};}exports[_0x366e('0x39')]=function(_0x4050eb,_0x486c91){var _0x32173e={},_0x5b914f={},_0x58f594={'count':0x0,'rows':[]};var _0x4f92bc=_[_0x366e('0x31')](db[_0x366e('0x3a')][_0x366e('0x3b')],function(_0xe7dc8d){return{'name':_0xe7dc8d[_0x366e('0x3c')],'type':_0xe7dc8d[_0x366e('0x34')]['key']};});_0x5b914f[_0x366e('0x3d')]=_['map'](_0x4f92bc,_0x366e('0x37'));_0x5b914f[_0x366e('0x3e')]=_[_0x366e('0x3f')](_0x4050eb[_0x366e('0x3e')]);_0x5b914f[_0x366e('0x40')]=_['intersection'](_0x5b914f['model'],_0x5b914f[_0x366e('0x3e')]);_0x32173e[_0x366e('0x41')]=_[_0x366e('0x42')](_0x5b914f[_0x366e('0x3d')],qs[_0x366e('0x43')](_0x4050eb['query'][_0x366e('0x43')]));_0x32173e[_0x366e('0x41')]=_0x32173e[_0x366e('0x41')][_0x366e('0x44')]?_0x32173e[_0x366e('0x41')]:_0x5b914f[_0x366e('0x3d')];if(!_0x4050eb['query'][_0x366e('0x45')](_0x366e('0x46'))){_0x32173e['limit']=qs[_0x366e('0x47')](_0x4050eb[_0x366e('0x3e')][_0x366e('0x47')]);_0x32173e[_0x366e('0x22')]=qs[_0x366e('0x22')](_0x4050eb[_0x366e('0x3e')][_0x366e('0x22')]);}_0x32173e[_0x366e('0x48')]=qs[_0x366e('0x49')](_0x4050eb[_0x366e('0x3e')]['sort']);_0x32173e[_0x366e('0x4a')]=qs[_0x366e('0x40')](_[_0x366e('0x4b')](_0x4050eb[_0x366e('0x3e')],_0x5b914f[_0x366e('0x40')]),_0x4f92bc);if(_0x4050eb[_0x366e('0x3e')]['filter']){_0x32173e[_0x366e('0x4a')]=_['merge'](_0x32173e[_0x366e('0x4a')],{'$or':_[_0x366e('0x31')](_0x4f92bc,function(_0x5855eb){if(_0x5855eb[_0x366e('0x34')]!==_0x366e('0x4c')){var _0x105c2a={};_0x105c2a[_0x5855eb[_0x366e('0x37')]]={'$like':'%'+_0x4050eb[_0x366e('0x3e')][_0x366e('0x4d')]+'%'};return _0x105c2a;}})});}_0x32173e=_[_0x366e('0x4e')]({},_0x32173e,_0x4050eb[_0x366e('0x4f')]);var _0x48cd0e={'where':_0x32173e[_0x366e('0x4a')]};return db['VoiceQueue'][_0x366e('0x24')](_0x48cd0e)['then'](function(_0x3ca9a1){_0x58f594[_0x366e('0x24')]=_0x3ca9a1;if(_0x4050eb[_0x366e('0x3e')]['includeAll']){_0x32173e['include']=[{'all':!![]}];}return db[_0x366e('0x3a')][_0x366e('0x50')](_0x32173e);})[_0x366e('0x29')](function(_0x31a399){_0x58f594[_0x366e('0x51')]=_0x31a399;return _0x58f594;})[_0x366e('0x29')](respondWithFilteredResult(_0x486c91,_0x32173e))[_0x366e('0x52')](handleError(_0x486c91,null));};exports[_0x366e('0x53')]=function(_0x430309,_0x2bebfa){var _0x481d6a={'raw':![],'where':{'id':_0x430309[_0x366e('0x54')]['id']}},_0x49e64b={};_0x49e64b['model']=_[_0x366e('0x3f')](db['VoiceQueue'][_0x366e('0x3b')]);_0x49e64b[_0x366e('0x3e')]=_[_0x366e('0x3f')](_0x430309[_0x366e('0x3e')]);_0x49e64b[_0x366e('0x40')]=_[_0x366e('0x42')](_0x49e64b[_0x366e('0x3d')],_0x49e64b[_0x366e('0x3e')]);_0x481d6a[_0x366e('0x41')]=_[_0x366e('0x42')](_0x49e64b['model'],qs[_0x366e('0x43')](_0x430309[_0x366e('0x3e')][_0x366e('0x43')]));_0x481d6a[_0x366e('0x41')]=_0x481d6a[_0x366e('0x41')][_0x366e('0x44')]?_0x481d6a[_0x366e('0x41')]:_0x49e64b[_0x366e('0x3d')];if(_0x430309[_0x366e('0x3e')][_0x366e('0x55')]){_0x481d6a[_0x366e('0x56')]=[{'all':!![]}];}_0x481d6a=_[_0x366e('0x4e')]({},_0x481d6a,_0x430309[_0x366e('0x4f')]);return db['VoiceQueue']['find'](_0x481d6a)[_0x366e('0x29')](handleEntityNotFound(_0x2bebfa,null))[_0x366e('0x29')](respondWithResult(_0x2bebfa,null))[_0x366e('0x52')](handleError(_0x2bebfa,null));};exports[_0x366e('0x57')]=function(_0x541ada,_0x2f5f8c){return db[_0x366e('0x3a')][_0x366e('0x57')](_0x541ada['body'],{})[_0x366e('0x29')](function(_0x76d6f5){var _0x4368b3=_0x541ada[_0x366e('0x58')][_0x366e('0x2b')]({'plain':!![]});if(!_0x4368b3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4368b3[_0x366e('0x59')]===_0x366e('0x58')){var _0x5e2073=_0x76d6f5['get']({'plain':!![]});var _0x5c03f0=[{'name':_0x366e('0x2c'),'value':_0x366e('0x2d')},{'name':_0x366e('0x2e'),'value':_0x366e('0x2f')}];var _0x2003af=_[_0x366e('0x5a')](_0x5c03f0,[_0x366e('0x32'),_0x5e2073[_0x366e('0x34')]])['name'];return db['UserProfileSection'][_0x366e('0x5a')]({'where':{'name':_0x2003af,'userProfileId':_0x4368b3['userProfileId']},'raw':!![]})[_0x366e('0x29')](function(_0x409d73){if(_0x409d73&&_0x409d73[_0x366e('0x5b')]===0x0){return db['UserProfileResource'][_0x366e('0x57')]({'name':_0x5e2073[_0x366e('0x37')],'resourceId':_0x5e2073['id'],'type':_0x409d73[_0x366e('0x37')],'sectionId':_0x409d73['id']},{})[_0x366e('0x29')](function(){return _0x76d6f5;});}else{return _0x76d6f5;}})[_0x366e('0x52')](function(_0x5cbacb){logger[_0x366e('0x36')](_0x366e('0x5c'),_0x5cbacb);throw _0x5cbacb;});}return _0x76d6f5;})['then'](respondWithResult(_0x2f5f8c,0xc9))[_0x366e('0x52')](handleError(_0x2f5f8c,null));};exports[_0x366e('0x5d')]=function(_0x5f1871,_0xd7362){var _0x46dc87={'where':{'id':_0x5f1871[_0x366e('0x54')]['id']}},_0x35b313={};_0x35b313[_0x366e('0x3d')]=_[_0x366e('0x3f')](db[_0x366e('0x3a')][_0x366e('0x3b')]);_0x46dc87['attributes']=_['intersection'](_0x35b313[_0x366e('0x3d')],qs[_0x366e('0x43')](_0x5f1871['query'][_0x366e('0x43')]));_0x46dc87[_0x366e('0x41')]=_0x46dc87[_0x366e('0x41')][_0x366e('0x44')]?_0x46dc87[_0x366e('0x41')]:_0x35b313[_0x366e('0x3d')];if(_0x5f1871[_0x366e('0x3e')]['includeAll']){_0x46dc87[_0x366e('0x56')]=[{'all':!![]}];}_0x46dc87=_['merge']({},_0x46dc87,_0x5f1871[_0x366e('0x4f')]);return db['VoiceQueue'][_0x366e('0x5a')](_0x46dc87)[_0x366e('0x29')](handleEntityNotFound(_0xd7362,null))[_0x366e('0x29')](function(_0x8a1c5f){if(_0x8a1c5f){var _0x3f77ab=_0x8a1c5f[_0x366e('0x2b')]({'plain':!![]});_0x3f77ab=qs['omit'](_0x3f77ab,['id',_0x366e('0x5e'),_0x366e('0x5f')]);_0x5f1871['body']=_[_0x366e('0x60')](_0x5f1871[_0x366e('0x61')],['id',_0x366e('0x5e'),'updatedAt']);return db['VoiceQueue'][_0x366e('0x57')](_[_0x366e('0x4e')](_0x3f77ab,_0x5f1871[_0x366e('0x61')]),{'include':_0x5f1871[_0x366e('0x3e')][_0x366e('0x55')]?[{'all':!![]}]:undefined})['then'](function(_0x4fce35){var _0x4895fc=_0x5f1871[_0x366e('0x58')][_0x366e('0x2b')]({'plain':!![]});if(!_0x4895fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4895fc[_0x366e('0x59')]===_0x366e('0x58')){var _0x3d2a8f=_0x4fce35[_0x366e('0x2b')]({'plain':!![]});var _0x32d90a=[{'name':'VoiceQueues','value':_0x366e('0x2d')},{'name':'QueueCampaigns','value':_0x366e('0x2f')}];var _0x5d5ba4=_[_0x366e('0x5a')](_0x32d90a,[_0x366e('0x32'),_0x3d2a8f['type']])[_0x366e('0x37')];return db[_0x366e('0x62')][_0x366e('0x5a')]({'where':{'name':_0x5d5ba4,'userProfileId':_0x4895fc[_0x366e('0x63')]},'raw':!![]})[_0x366e('0x29')](function(_0x2d4040){if(_0x2d4040&&_0x2d4040[_0x366e('0x5b')]===0x0){return db['UserProfileResource'][_0x366e('0x57')]({'name':_0x3d2a8f[_0x366e('0x37')],'resourceId':_0x3d2a8f['id'],'type':_0x2d4040['name'],'sectionId':_0x2d4040['id']},{})['then'](function(){return _0x4fce35;});}else{return _0x4fce35;}})['catch'](function(_0x43e25f){logger['error'](_0x366e('0x5c'),_0x43e25f);throw _0x43e25f;});}return _0x4fce35;});}})['then'](respondWithResult(_0xd7362,0xc9))['catch'](handleError(_0xd7362,null));};exports[_0x366e('0x28')]=function(_0x4f9080,_0x8b0931){if(_0x4f9080['body']['id']){delete _0x4f9080[_0x366e('0x61')]['id'];}return db[_0x366e('0x3a')][_0x366e('0x5a')]({'where':{'id':_0x4f9080[_0x366e('0x54')]['id']}})[_0x366e('0x29')](handleEntityNotFound(_0x8b0931,null))[_0x366e('0x29')](saveUpdates(_0x4f9080[_0x366e('0x61')],null))[_0x366e('0x29')](respondWithResult(_0x8b0931,null))[_0x366e('0x52')](handleError(_0x8b0931,null));};exports[_0x366e('0x2a')]=function(_0x3f669d,_0x3ea3ad){return db[_0x366e('0x3a')][_0x366e('0x5a')]({'where':{'id':_0x3f669d[_0x366e('0x54')]['id']}})[_0x366e('0x29')](handleEntityNotFound(_0x3ea3ad,null))[_0x366e('0x29')](removeEntity(_0x3ea3ad,null))[_0x366e('0x52')](handleError(_0x3ea3ad,null));};exports[_0x366e('0x64')]=function(_0x4dc0db,_0x52bb34,_0x149ccd){var _0x30f12a={'raw':![],'where':{}};var _0xda7131={};var _0x43b840={'count':0x0,'rows':[]};return db[_0x366e('0x3a')][_0x366e('0x65')]({'where':{'id':_0x4dc0db[_0x366e('0x54')]['id']}})[_0x366e('0x29')](handleEntityNotFound(_0x52bb34,null))['then'](function(_0x220ae6){if(_0x220ae6){_0xda7131[_0x366e('0x3d')]=_[_0x366e('0x3f')](db[_0x366e('0x66')]['rawAttributes']);_0xda7131[_0x366e('0x3e')]=_[_0x366e('0x3f')](_0x4dc0db[_0x366e('0x3e')]);_0xda7131[_0x366e('0x40')]=_[_0x366e('0x42')](_0xda7131[_0x366e('0x3d')],_0xda7131['query']);_0x30f12a['attributes']=_['intersection'](_0xda7131[_0x366e('0x3d')],qs[_0x366e('0x43')](_0x4dc0db['query'][_0x366e('0x43')]));_0x30f12a[_0x366e('0x41')]=_0x30f12a[_0x366e('0x41')][_0x366e('0x44')]?_0x30f12a[_0x366e('0x41')]:_0xda7131[_0x366e('0x3d')];if(!_0x4dc0db[_0x366e('0x3e')][_0x366e('0x45')](_0x366e('0x46'))){_0x30f12a[_0x366e('0x47')]=qs[_0x366e('0x47')](_0x4dc0db[_0x366e('0x3e')][_0x366e('0x47')]);_0x30f12a[_0x366e('0x22')]=qs[_0x366e('0x22')](_0x4dc0db['query'][_0x366e('0x22')]);}_0x30f12a[_0x366e('0x48')]=qs[_0x366e('0x49')](_0x4dc0db['query'][_0x366e('0x49')]);_0x30f12a[_0x366e('0x4a')]=qs[_0x366e('0x40')](_['pick'](_0x4dc0db[_0x366e('0x3e')],_0xda7131[_0x366e('0x40')]));_0x30f12a[_0x366e('0x4a')][_0x366e('0x67')]=_0x220ae6['id'];if(_0x4dc0db[_0x366e('0x3e')][_0x366e('0x4d')]){_0x30f12a[_0x366e('0x4a')]=_[_0x366e('0x4e')](_0x30f12a[_0x366e('0x4a')],{'$or':_[_0x366e('0x31')](_0x30f12a['attributes'],function(_0x52cadb){var _0x56a514={};_0x56a514[_0x52cadb]={'$like':'%'+_0x4dc0db[_0x366e('0x3e')]['filter']+'%'};return _0x56a514;})});}_0x30f12a=_[_0x366e('0x4e')]({},_0x30f12a,_0x4dc0db[_0x366e('0x4f')]);return db['CmHopper'][_0x366e('0x24')]({'where':_0x30f12a['where']})[_0x366e('0x29')](function(_0xfb991e){_0x43b840['count']=_0xfb991e;if(_0x4dc0db['query'][_0x366e('0x55')]){_0x30f12a[_0x366e('0x56')]=[{'all':!![]}];}return db['CmHopper'][_0x366e('0x50')](_0x30f12a);})['then'](function(_0x44d766){_0x43b840['rows']=_0x44d766;return _0x43b840;});}})[_0x366e('0x29')](respondWithFilteredResult(_0x52bb34,_0x30f12a))[_0x366e('0x52')](handleError(_0x52bb34,null));};exports[_0x366e('0x68')]=function(_0x1cbd45,_0x1a2955,_0x5735d3){var _0xf8b11f={'raw':!![],'where':{}};var _0x2156cb={};var _0x16f1cc={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x366e('0x65')]({'where':{'id':_0x1cbd45['params']['id']}})[_0x366e('0x29')](handleEntityNotFound(_0x1a2955,null))['then'](function(_0x548a36){if(_0x548a36){_0x2156cb[_0x366e('0x3d')]=_[_0x366e('0x3f')](db['CmHopperHistory'][_0x366e('0x3b')]);_0x2156cb[_0x366e('0x3e')]=_['keys'](_0x1cbd45[_0x366e('0x3e')]);_0x2156cb[_0x366e('0x40')]=_['intersection'](_0x2156cb['model'],_0x2156cb[_0x366e('0x3e')]);_0xf8b11f['attributes']=_['intersection'](_0x2156cb[_0x366e('0x3d')],qs[_0x366e('0x43')](_0x1cbd45[_0x366e('0x3e')][_0x366e('0x43')]));_0xf8b11f[_0x366e('0x41')]=_0xf8b11f['attributes'][_0x366e('0x44')]?_0xf8b11f[_0x366e('0x41')]:_0x2156cb[_0x366e('0x3d')];if(!_0x1cbd45[_0x366e('0x3e')][_0x366e('0x45')](_0x366e('0x46'))){_0xf8b11f[_0x366e('0x47')]=qs[_0x366e('0x47')](_0x1cbd45['query'][_0x366e('0x47')]);_0xf8b11f[_0x366e('0x22')]=qs[_0x366e('0x22')](_0x1cbd45[_0x366e('0x3e')][_0x366e('0x22')]);}_0xf8b11f['order']=qs[_0x366e('0x49')](_0x1cbd45[_0x366e('0x3e')][_0x366e('0x49')]);_0xf8b11f[_0x366e('0x4a')]=qs[_0x366e('0x40')](_[_0x366e('0x4b')](_0x1cbd45[_0x366e('0x3e')],_0x2156cb['filters']));_0xf8b11f[_0x366e('0x4a')][_0x366e('0x67')]=_0x548a36['id'];if(_0x1cbd45['query']['filter']){_0xf8b11f[_0x366e('0x4a')]=_[_0x366e('0x4e')](_0xf8b11f['where'],{'$or':_['map'](_0xf8b11f[_0x366e('0x41')],function(_0x1bffbc){var _0x34da92={};_0x34da92[_0x1bffbc]={'$like':'%'+_0x1cbd45[_0x366e('0x3e')][_0x366e('0x4d')]+'%'};return _0x34da92;})});}_0xf8b11f=_[_0x366e('0x4e')]({},_0xf8b11f,_0x1cbd45[_0x366e('0x4f')]);return db[_0x366e('0x69')][_0x366e('0x24')]({'where':_0xf8b11f[_0x366e('0x4a')]})[_0x366e('0x29')](function(_0x484be9){_0x16f1cc[_0x366e('0x24')]=_0x484be9;if(_0x1cbd45['query']['includeAll']){_0xf8b11f[_0x366e('0x56')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xf8b11f);})['then'](function(_0x31e1aa){_0x16f1cc['rows']=_0x31e1aa;return _0x16f1cc;});}})[_0x366e('0x29')](respondWithFilteredResult(_0x1a2955,_0xf8b11f))['catch'](handleError(_0x1a2955,null));};exports['getHopperFinals']=function(_0x3aa9ac,_0x12abed,_0x3bf3e9){var _0x3eeaab={'raw':!![],'where':{}};var _0x37fbe6={};var _0x20bfb1={'count':0x0,'rows':[]};return db[_0x366e('0x3a')][_0x366e('0x65')]({'where':{'id':_0x3aa9ac[_0x366e('0x54')]['id']}})[_0x366e('0x29')](handleEntityNotFound(_0x12abed,null))['then'](function(_0x5c0ff2){if(_0x5c0ff2){_0x37fbe6[_0x366e('0x3d')]=_[_0x366e('0x3f')](db[_0x366e('0x6a')][_0x366e('0x3b')]);_0x37fbe6['query']=_['keys'](_0x3aa9ac[_0x366e('0x3e')]);_0x37fbe6[_0x366e('0x40')]=_['intersection'](_0x37fbe6[_0x366e('0x3d')],_0x37fbe6[_0x366e('0x3e')]);_0x3eeaab[_0x366e('0x41')]=_['intersection'](_0x37fbe6[_0x366e('0x3d')],qs[_0x366e('0x43')](_0x3aa9ac[_0x366e('0x3e')][_0x366e('0x43')]));_0x3eeaab[_0x366e('0x41')]=_0x3eeaab[_0x366e('0x41')][_0x366e('0x44')]?_0x3eeaab[_0x366e('0x41')]:_0x37fbe6['model'];if(!_0x3aa9ac[_0x366e('0x3e')][_0x366e('0x45')]('nolimit')){_0x3eeaab[_0x366e('0x47')]=qs[_0x366e('0x47')](_0x3aa9ac[_0x366e('0x3e')][_0x366e('0x47')]);_0x3eeaab[_0x366e('0x22')]=qs[_0x366e('0x22')](_0x3aa9ac['query']['offset']);}_0x3eeaab['order']=qs[_0x366e('0x49')](_0x3aa9ac[_0x366e('0x3e')][_0x366e('0x49')]);_0x3eeaab['where']=qs[_0x366e('0x40')](_[_0x366e('0x4b')](_0x3aa9ac[_0x366e('0x3e')],_0x37fbe6['filters']));_0x3eeaab[_0x366e('0x4a')][_0x366e('0x67')]=_0x5c0ff2['id'];if(_0x3aa9ac[_0x366e('0x3e')][_0x366e('0x4d')]){_0x3eeaab[_0x366e('0x4a')]=_[_0x366e('0x4e')](_0x3eeaab[_0x366e('0x4a')],{'$or':_[_0x366e('0x31')](_0x3eeaab['attributes'],function(_0x1e80e6){var _0x4df91a={};_0x4df91a[_0x1e80e6]={'$like':'%'+_0x3aa9ac[_0x366e('0x3e')][_0x366e('0x4d')]+'%'};return _0x4df91a;})});}_0x3eeaab=_[_0x366e('0x4e')]({},_0x3eeaab,_0x3aa9ac[_0x366e('0x4f')]);return db['CmHopperFinal'][_0x366e('0x24')]({'where':_0x3eeaab[_0x366e('0x4a')]})[_0x366e('0x29')](function(_0x38d4a5){_0x20bfb1[_0x366e('0x24')]=_0x38d4a5;if(_0x3aa9ac['query'][_0x366e('0x55')]){_0x3eeaab[_0x366e('0x56')]=[{'all':!![]}];}return db[_0x366e('0x6a')][_0x366e('0x50')](_0x3eeaab);})['then'](function(_0x3bc567){_0x20bfb1['rows']=_0x3bc567;return _0x20bfb1;});}})['then'](respondWithFilteredResult(_0x12abed,_0x3eeaab))[_0x366e('0x52')](handleError(_0x12abed,null));};exports[_0x366e('0x6b')]=function(_0x22de26,_0x16f52c,_0x366bb5){var _0x5acf30={'raw':!![],'where':{}};var _0x1670c7={};var _0xdbd669={'count':0x0,'rows':[]};return db[_0x366e('0x3a')][_0x366e('0x65')]({'where':{'id':_0x22de26[_0x366e('0x54')]['id']}})[_0x366e('0x29')](handleEntityNotFound(_0x16f52c,null))[_0x366e('0x29')](function(_0x5d0a71){if(_0x5d0a71){_0x1670c7['model']=_[_0x366e('0x3f')](db[_0x366e('0x6c')][_0x366e('0x3b')]);_0x1670c7[_0x366e('0x3e')]=_[_0x366e('0x3f')](_0x22de26[_0x366e('0x3e')]);_0x1670c7['filters']=_[_0x366e('0x42')](_0x1670c7[_0x366e('0x3d')],_0x1670c7[_0x366e('0x3e')]);_0x5acf30[_0x366e('0x41')]=_[_0x366e('0x42')](_0x1670c7[_0x366e('0x3d')],qs[_0x366e('0x43')](_0x22de26[_0x366e('0x3e')][_0x366e('0x43')]));_0x5acf30[_0x366e('0x41')]=_0x5acf30[_0x366e('0x41')]['length']?_0x5acf30[_0x366e('0x41')]:_0x1670c7['model'];if(!_0x22de26[_0x366e('0x3e')][_0x366e('0x45')](_0x366e('0x46'))){_0x5acf30[_0x366e('0x47')]=qs[_0x366e('0x47')](_0x22de26[_0x366e('0x3e')][_0x366e('0x47')]);_0x5acf30['offset']=qs[_0x366e('0x22')](_0x22de26[_0x366e('0x3e')]['offset']);}_0x5acf30['order']=qs[_0x366e('0x49')](_0x22de26[_0x366e('0x3e')][_0x366e('0x49')]);_0x5acf30[_0x366e('0x4a')]=qs['filters'](_['pick'](_0x22de26['query'],_0x1670c7['filters']));_0x5acf30[_0x366e('0x4a')][_0x366e('0x67')]=_0x5d0a71['id'];if(_0x22de26['query'][_0x366e('0x4d')]){_0x5acf30[_0x366e('0x4a')]=_[_0x366e('0x4e')](_0x5acf30['where'],{'$or':_[_0x366e('0x31')](_0x5acf30[_0x366e('0x41')],function(_0x2d6496){var _0x56e878={};_0x56e878[_0x2d6496]={'$like':'%'+_0x22de26[_0x366e('0x3e')][_0x366e('0x4d')]+'%'};return _0x56e878;})});}_0x5acf30=_['merge']({},_0x5acf30,_0x22de26[_0x366e('0x4f')]);return db['CmHopperBlack'][_0x366e('0x24')]({'where':_0x5acf30['where']})[_0x366e('0x29')](function(_0x4dea84){_0xdbd669[_0x366e('0x24')]=_0x4dea84;if(_0x22de26[_0x366e('0x3e')]['includeAll']){_0x5acf30[_0x366e('0x56')]=[{'all':!![]}];}return db[_0x366e('0x6c')][_0x366e('0x50')](_0x5acf30);})[_0x366e('0x29')](function(_0x85882d){_0xdbd669[_0x366e('0x51')]=_0x85882d;return _0xdbd669;});}})[_0x366e('0x29')](respondWithFilteredResult(_0x16f52c,_0x5acf30))[_0x366e('0x52')](handleError(_0x16f52c,null));};exports[_0x366e('0x6d')]=function(_0xa8f9cd,_0x203ee6,_0x51a6dc){var _0x2dfadb={};var _0x588951={};var _0x3a12b5;var _0x5344c1;return db[_0x366e('0x3a')][_0x366e('0x65')]({'where':{'id':_0xa8f9cd[_0x366e('0x54')]['id']}})[_0x366e('0x29')](handleEntityNotFound(_0x203ee6,null))[_0x366e('0x29')](function(_0x2fbf06){if(_0x2fbf06){_0x3a12b5=_0x2fbf06;_0x588951[_0x366e('0x3d')]=_[_0x366e('0x3f')](db[_0x366e('0x6e')][_0x366e('0x3b')]);_0x588951['query']=_[_0x366e('0x3f')](_0xa8f9cd[_0x366e('0x3e')]);_0x588951[_0x366e('0x40')]=_[_0x366e('0x42')](_0x588951[_0x366e('0x3d')],_0x588951[_0x366e('0x3e')]);_0x2dfadb['attributes']=_[_0x366e('0x42')](_0x588951[_0x366e('0x3d')],qs[_0x366e('0x43')](_0xa8f9cd[_0x366e('0x3e')]['fields']));_0x2dfadb['attributes']=_0x2dfadb[_0x366e('0x41')]['length']?_0x2dfadb['attributes']:_0x588951[_0x366e('0x3d')];_0x2dfadb['order']=qs['sort'](_0xa8f9cd['query'][_0x366e('0x49')]);_0x2dfadb[_0x366e('0x4a')]=qs[_0x366e('0x40')](_[_0x366e('0x4b')](_0xa8f9cd['query'],_0x588951[_0x366e('0x40')]));if(_0xa8f9cd[_0x366e('0x3e')][_0x366e('0x4d')]){_0x2dfadb['where']=_[_0x366e('0x4e')](_0x2dfadb['where'],{'$or':_[_0x366e('0x31')](_0x2dfadb[_0x366e('0x41')],function(_0x413309){var _0x2ac11c={};_0x2ac11c[_0x413309]={'$like':'%'+_0xa8f9cd[_0x366e('0x3e')][_0x366e('0x4d')]+'%'};return _0x2ac11c;})});}_0x2dfadb=_[_0x366e('0x4e')]({},_0x2dfadb,_0xa8f9cd[_0x366e('0x4f')]);return _0x3a12b5[_0x366e('0x6d')](_0x2dfadb);}})['then'](function(_0x265ee0){if(_0x265ee0){_0x5344c1=_0x265ee0[_0x366e('0x44')];if(!_0xa8f9cd[_0x366e('0x3e')][_0x366e('0x45')]('nolimit')){_0x2dfadb[_0x366e('0x47')]=qs[_0x366e('0x47')](_0xa8f9cd[_0x366e('0x3e')][_0x366e('0x47')]);_0x2dfadb[_0x366e('0x22')]=qs[_0x366e('0x22')](_0xa8f9cd[_0x366e('0x3e')][_0x366e('0x22')]);}return _0x3a12b5[_0x366e('0x6d')](_0x2dfadb);}})['then'](function(_0x2e07e7){if(_0x2e07e7){return _0x2e07e7?{'count':_0x5344c1,'rows':_0x2e07e7}:null;}})[_0x366e('0x29')](respondWithResult(_0x203ee6,null))[_0x366e('0x52')](handleError(_0x203ee6,null));};exports[_0x366e('0x6f')]=function(_0x565990,_0x2cdeb5,_0x49023e){var _0x46a5e8=_0x565990[_0x366e('0x61')][_0x366e('0x70')];var _0x851764=_[_0x366e('0x31')](_0x46a5e8,'id');return db[_0x366e('0x6e')][_0x366e('0x50')]({'where':{'id':_0x851764},'attributes':['id'],'include':[{'model':db[_0x366e('0x71')],'as':_0x366e('0x72'),'attributes':['id',_0x366e('0x37'),_0x366e('0x73'),_0x366e('0x74'),_0x366e('0x75')],'raw':!![]}]})[_0x366e('0x29')](function(_0x25ff54){if(_0x25ff54){var _0x366776=_[_0x366e('0x76')](_0x25ff54,function(_0x1a2274){var _0x5c0125=_0x1a2274[_0x366e('0x2b')]({'plain':!![]});_0x5c0125[_0x366e('0x72')]['forEach'](function(_0x2cc85a){_0x2cc85a[_0x366e('0x77')]=_[_0x366e('0x5a')](_0x46a5e8,{'id':_0x5c0125['id']})[_0x366e('0x77')];});return _0x5c0125['Agents'];});return db[_0x366e('0x3a')][_0x366e('0x5a')]({'where':{'id':_0x565990[_0x366e('0x54')]['id']}})[_0x366e('0x29')](function(_0x16a3d5){return db[_0x366e('0x78')][_0x366e('0x79')](function(_0x1bafe4){return _0x16a3d5['addTeams'](_0x851764,{'transaction':_0x1bafe4})[_0x366e('0x29')](function(){return BPromise[_0x366e('0x7a')](_0x46a5e8,function(_0x41c15e){return db[_0x366e('0x7b')]['upsert']({'TeamId':_0x41c15e['id'],'VoiceQueueId':_0x565990[_0x366e('0x54')]['id'],'penalty':_0x41c15e['penalty']},{'transaction':_0x1bafe4});});})[_0x366e('0x29')](function(){return BPromise['each'](_0x366776,function(_0x4880a9){return db['UserVoiceQueue'][_0x366e('0x7c')]({'where':{'UserId':_0x4880a9['id'],'VoiceQueueId':_0x565990[_0x366e('0x54')]['id']},'defaults':{'penalty':_0x4880a9[_0x366e('0x77')]},'transaction':_0x1bafe4});});})[_0x366e('0x29')](function(){return BPromise[_0x366e('0x7a')](_[_0x366e('0x4d')](_0x366776,{'online':!![]}),function(_0x328669){return db[_0x366e('0x7d')][_0x366e('0x7e')]({'membername':_0x328669[_0x366e('0x37')],'UserId':_0x328669['id'],'queue_name':_0x16a3d5[_0x366e('0x37')],'VoiceQueueId':_0x16a3d5['id'],'interface':_[_0x366e('0x7f')](_0x328669[_0x366e('0x75')])?util[_0x366e('0x80')](_0x366e('0x81'),_0x328669['name']):_0x328669['interface'],'paused':_0x328669[_0x366e('0x74')]||![],'penalty':_0x328669[_0x366e('0x77')]},{'transaction':_0x1bafe4});});})[_0x366e('0x29')](function(){_0x366776['forEach'](function(_0x282a6e){socket[_0x366e('0x82')]('userVoiceQueue:save',{'UserId':_0x282a6e['id'],'VoiceQueueId':_0x16a3d5['id']});});});});});}})['then'](respondWithStatusCode(_0x2cdeb5,null))['catch'](handleError(_0x2cdeb5,null));};exports[_0x366e('0x83')]=function(_0x340a63,_0x3d07c8,_0x10ea4e){return db['Team'][_0x366e('0x50')]({'where':{'id':_0x340a63[_0x366e('0x3e')][_0x366e('0x84')]},'attributes':['id'],'include':[{'model':db[_0x366e('0x71')],'as':_0x366e('0x72'),'attributes':['id'],'raw':!![]}]})[_0x366e('0x29')](handleEntityNotFound(_0x3d07c8,null))['then'](function(_0x11f8b8){var _0x12fcce=_['map'](_0x11f8b8,'id');var _0x1aa746=[];var _0x4c8256=[];var _0x2e8ac5=squel[_0x366e('0x85')]();_0x2e8ac5[_0x366e('0x86')](_0x366e('0x87'))[_0x366e('0x88')](_0x366e('0x89'),'tq')['join'](_0x366e('0x8a'),'ut',_0x366e('0x8b'))[_0x366e('0x4a')](_0x366e('0x8c'),_0x340a63[_0x366e('0x54')]['id']);for(var _0x5d5f0e=0x0;_0x5d5f0e<_0x11f8b8[_0x366e('0x44')];_0x5d5f0e+=0x1){let _0x100509=_0x11f8b8[_0x5d5f0e];for(var _0x19ce17=0x0;_0x19ce17<_0x100509['Agents'][_0x366e('0x44')];_0x19ce17+=0x1){let _0x49f8ee=_0x100509[_0x366e('0x72')][_0x19ce17];var _0x15205b=_0x2e8ac5['clone']();_0x15205b[_0x366e('0x4a')](_0x366e('0x8d'),_0x49f8ee['id']);_0x4c8256[_0x366e('0x8e')](db[_0x366e('0x78')][_0x366e('0x3e')](_0x15205b[_0x366e('0x8f')](),{'type':db[_0x366e('0x78')][_0x366e('0x90')][_0x366e('0x91')]})[_0x366e('0x29')](function(_0x4d6434){if(_0x4d6434['length']===0x1){return _0x49f8ee['id'];}else{var _0x24cba8=_[_0x366e('0x92')](_[_0x366e('0x31')](_0x4d6434,_0x366e('0x93')),function(_0x5d7c49){return _['includes'](_0x12fcce,_0x5d7c49);});if(_0x24cba8){return _0x49f8ee['id'];}}}));}}return BPromise[_0x366e('0x94')](_0x4c8256)[_0x366e('0x29')](function(_0x2a50f1){_0x1aa746=_(_0x1aa746)[_0x366e('0x95')](_0x2a50f1)[_0x366e('0x96')]()['value']();return db[_0x366e('0x3a')][_0x366e('0x5a')]({'where':{'id':_0x340a63[_0x366e('0x54')]['id']}})[_0x366e('0x29')](function(_0x3ca906){return db[_0x366e('0x78')][_0x366e('0x79')](function(_0x1ca60f){return _0x3ca906[_0x366e('0x83')](_0x340a63[_0x366e('0x3e')][_0x366e('0x84')],{'transaction':_0x1ca60f})[_0x366e('0x29')](function(){if(!_['isEmpty'](_0x1aa746)){return _0x3ca906[_0x366e('0x97')](_0x1aa746,{'transaction':_0x1ca60f})['then'](function(){return db[_0x366e('0x7d')][_0x366e('0x2a')]({'where':{'VoiceQueueId':_0x340a63[_0x366e('0x54')]['id'],'UserId':_0x1aa746},'transaction':_0x1ca60f});});}})[_0x366e('0x29')](function(){_0x1aa746[_0x366e('0x98')](function(_0xd3d9e4){socket['emit'](_0x366e('0x99'),{'UserId':_0xd3d9e4,'VoiceQueueId':_0x3ca906['id']});});});});});});})[_0x366e('0x29')](respondWithStatusCode(_0x3d07c8,null))[_0x366e('0x52')](handleError(_0x3d07c8,null));};exports[_0x366e('0x9a')]=function(_0xffc2c1,_0xea593e,_0x338b90){var _0x2d75a0,_0x2518b8;return db[_0x366e('0x3a')]['find']({'where':{'id':_0xffc2c1[_0x366e('0x54')]['id']}})[_0x366e('0x29')](handleEntityNotFound(_0xea593e,null))['then'](function(_0x4ff266){if(_0x4ff266){_0x2518b8=_0x4ff266;return _0x4ff266['addAgents'](_0xffc2c1[_0x366e('0x61')][_0x366e('0x84')],_[_0x366e('0x60')](_0xffc2c1['body'],[_0x366e('0x84'),'id'])||{})['spread'](function(_0x18a5d2){for(var _0x468073=0x0;_0x468073<_0xffc2c1[_0x366e('0x61')][_0x366e('0x84')][_0x366e('0x44')];_0x468073+=0x1){socket['emit'](_0x366e('0x9b'),{'UserId':Number(_0xffc2c1[_0x366e('0x61')][_0x366e('0x84')][_0x468073]),'VoiceQueueId':Number(_0xffc2c1[_0x366e('0x54')]['id'])});}return _0x18a5d2;});}})[_0x366e('0x29')](function(_0x1f37e2){_0x2d75a0=_0x1f37e2||[];if(_0x2518b8){return db[_0x366e('0x71')][_0x366e('0x50')]({'where':{'id':_0xffc2c1[_0x366e('0x61')][_0x366e('0x84')]},'attributes':['id',_0x366e('0x37'),'online',_0x366e('0x74'),_0x366e('0x75')],'raw':!![]});}})[_0x366e('0x29')](function(_0x240e57){if(!_[_0x366e('0x9c')](_0x240e57)){var _0x2159b7=[];for(var _0x15dfa8=0x0;_0x15dfa8<_0x240e57[_0x366e('0x44')];_0x15dfa8++){if(_0x240e57[_0x15dfa8][_0x366e('0x73')]){_0x2159b7[_0x366e('0x8e')](db[_0x366e('0x7d')][_0x366e('0x7e')]({'membername':_0x240e57[_0x15dfa8][_0x366e('0x37')],'UserId':_0x240e57[_0x15dfa8]['id'],'queue_name':_0x2518b8[_0x366e('0x37')],'VoiceQueueId':_0x2518b8['id'],'interface':_['isNil'](_0x240e57[_0x15dfa8][_0x366e('0x75')])?util[_0x366e('0x80')](_0x366e('0x81'),_0x240e57[_0x15dfa8][_0x366e('0x37')]):_0x240e57[_0x15dfa8][_0x366e('0x75')],'paused':_0x240e57[_0x15dfa8][_0x366e('0x74')]||![],'penalty':_0xffc2c1[_0x366e('0x61')][_0x366e('0x77')]||0x0}));}}return BPromise[_0x366e('0x94')](_0x2159b7);}})['then'](function(){return _0x2d75a0;})['then'](respondWithResult(_0xea593e,null))[_0x366e('0x52')](handleError(_0xea593e,null));};exports['removeAgents']=function(_0x1cb66e,_0x5ae1ab,_0x2ee540){return db[_0x366e('0x3a')]['find']({'where':{'id':_0x1cb66e[_0x366e('0x54')]['id']}})[_0x366e('0x29')](handleEntityNotFound(_0x5ae1ab,null))[_0x366e('0x29')](function(_0x5a910b){if(_0x5a910b){return _0x5a910b[_0x366e('0x97')](_0x1cb66e['query'][_0x366e('0x84')])[_0x366e('0x29')](function(){if(_[_0x366e('0x9d')](_0x1cb66e[_0x366e('0x3e')][_0x366e('0x84')])){for(var _0x31dc34=0x0;_0x31dc34<_0x1cb66e[_0x366e('0x3e')][_0x366e('0x84')][_0x366e('0x44')];_0x31dc34+=0x1){socket['emit'](_0x366e('0x99'),{'UserId':Number(_0x1cb66e[_0x366e('0x3e')][_0x366e('0x84')][_0x31dc34]),'VoiceQueueId':Number(_0x1cb66e[_0x366e('0x54')]['id'])});}}else{socket[_0x366e('0x82')]('userVoiceQueue:remove',{'UserId':Number(_0x1cb66e['query']['ids']),'VoiceQueueId':Number(_0x1cb66e[_0x366e('0x54')]['id'])});}});}})[_0x366e('0x29')](function(_0x18170a){return db[_0x366e('0x7d')][_0x366e('0x2a')]({'where':{'VoiceQueueId':_0x1cb66e[_0x366e('0x54')]['id'],'UserId':_0x1cb66e[_0x366e('0x3e')]['ids']}})[_0x366e('0x29')](function(){return _0x18170a;});})[_0x366e('0x29')](respondWithStatusCode(_0x5ae1ab,null))[_0x366e('0x52')](handleError(_0x5ae1ab,null));};exports[_0x366e('0x9e')]=function(_0x1a0d3a,_0x47d743,_0x771914){var _0x1568cd={};var _0xc77720={};var _0x1c4840;var _0x4d7383;return db[_0x366e('0x3a')][_0x366e('0x65')]({'where':{'id':_0x1a0d3a[_0x366e('0x54')]['id']}})['then'](handleEntityNotFound(_0x47d743,null))[_0x366e('0x29')](function(_0x24b9e6){if(_0x24b9e6){_0x1c4840=_0x24b9e6;_0xc77720[_0x366e('0x3d')]=_[_0x366e('0x3f')](db[_0x366e('0x71')][_0x366e('0x3b')]);_0xc77720[_0x366e('0x3e')]=_[_0x366e('0x3f')](_0x1a0d3a['query']);_0xc77720[_0x366e('0x40')]=_[_0x366e('0x42')](_0xc77720[_0x366e('0x3d')],_0xc77720['query']);_0x1568cd['attributes']=_[_0x366e('0x42')](_0xc77720[_0x366e('0x3d')],qs['fields'](_0x1a0d3a['query'][_0x366e('0x43')]));_0x1568cd[_0x366e('0x41')]=_0x1568cd[_0x366e('0x41')][_0x366e('0x44')]?_0x1568cd['attributes']:_0xc77720[_0x366e('0x3d')];_0x1568cd[_0x366e('0x48')]=qs[_0x366e('0x49')](_0x1a0d3a[_0x366e('0x3e')][_0x366e('0x49')]);_0x1568cd[_0x366e('0x4a')]=qs['filters'](_[_0x366e('0x4b')](_0x1a0d3a['query'],_0xc77720[_0x366e('0x40')]));if(_0x1a0d3a[_0x366e('0x3e')][_0x366e('0x4d')]){_0x1568cd[_0x366e('0x4a')]=_[_0x366e('0x4e')](_0x1568cd[_0x366e('0x4a')],{'$or':_[_0x366e('0x31')](_0x1568cd[_0x366e('0x41')],function(_0x472586){var _0x4fc11e={};_0x4fc11e[_0x472586]={'$like':'%'+_0x1a0d3a[_0x366e('0x3e')][_0x366e('0x4d')]+'%'};return _0x4fc11e;})});}_0x1568cd=_[_0x366e('0x4e')]({},_0x1568cd,_0x1a0d3a[_0x366e('0x4f')]);return _0x1c4840['getAgents'](_0x1568cd);}})[_0x366e('0x29')](function(_0x3c0ce0){if(_0x3c0ce0){_0x4d7383=_0x3c0ce0[_0x366e('0x44')];if(!_0x1a0d3a[_0x366e('0x3e')][_0x366e('0x45')](_0x366e('0x46'))){_0x1568cd['limit']=qs['limit'](_0x1a0d3a[_0x366e('0x3e')][_0x366e('0x47')]);_0x1568cd[_0x366e('0x22')]=qs['offset'](_0x1a0d3a[_0x366e('0x3e')]['offset']);}return _0x1c4840['getAgents'](_0x1568cd);}})[_0x366e('0x29')](function(_0x39d1ae){if(_0x39d1ae){return _0x39d1ae?{'count':_0x4d7383,'rows':_0x39d1ae}:null;}})[_0x366e('0x29')](respondWithResult(_0x47d743,null))[_0x366e('0x52')](handleError(_0x47d743,null));};exports[_0x366e('0x9f')]=function(_0xd1734e,_0xf35f11,_0x2cdc0a){var _0x1b141f={};var _0x218ee6={};var _0x42aaf4;var _0x2be6bc;return db[_0x366e('0x3a')][_0x366e('0x65')]({'where':{'id':_0xd1734e['params']['id']}})['then'](handleEntityNotFound(_0xf35f11,null))[_0x366e('0x29')](function(_0x2d15ca){if(_0x2d15ca){_0x42aaf4=_0x2d15ca;_0x218ee6[_0x366e('0x3d')]=_[_0x366e('0x3f')](db[_0x366e('0x7d')][_0x366e('0x3b')]);_0x218ee6['query']=_[_0x366e('0x3f')](_0xd1734e[_0x366e('0x3e')]);_0x218ee6[_0x366e('0x40')]=_['intersection'](_0x218ee6['model'],_0x218ee6[_0x366e('0x3e')]);_0x1b141f[_0x366e('0x41')]=_[_0x366e('0x42')](_0x218ee6['model'],qs[_0x366e('0x43')](_0xd1734e[_0x366e('0x3e')][_0x366e('0x43')]));_0x1b141f[_0x366e('0x41')]=_0x1b141f[_0x366e('0x41')][_0x366e('0x44')]?_0x1b141f[_0x366e('0x41')]:_0x218ee6[_0x366e('0x3d')];_0x1b141f[_0x366e('0x48')]=qs[_0x366e('0x49')](_0xd1734e[_0x366e('0x3e')]['sort']);_0x1b141f['where']=qs[_0x366e('0x40')](_[_0x366e('0x4b')](_0xd1734e['query'],_0x218ee6['filters']));if(_0xd1734e[_0x366e('0x3e')][_0x366e('0x4d')]){_0x1b141f['where']=_['merge'](_0x1b141f['where'],{'$or':_[_0x366e('0x31')](_0x1b141f[_0x366e('0x41')],function(_0x183e75){var _0x578228={};_0x578228[_0x183e75]={'$like':'%'+_0xd1734e['query'][_0x366e('0x4d')]+'%'};return _0x578228;})});}_0x1b141f=_[_0x366e('0x4e')]({},_0x1b141f,_0xd1734e[_0x366e('0x4f')]);return _0x42aaf4['getMembers'](_0x1b141f);}})[_0x366e('0x29')](function(_0x3e0ce9){if(_0x3e0ce9){_0x2be6bc=_0x3e0ce9['length'];if(!_0xd1734e[_0x366e('0x3e')][_0x366e('0x45')]('nolimit')){_0x1b141f[_0x366e('0x47')]=qs[_0x366e('0x47')](_0xd1734e[_0x366e('0x3e')][_0x366e('0x47')]);_0x1b141f[_0x366e('0x22')]=qs['offset'](_0xd1734e['query'][_0x366e('0x22')]);}return _0x42aaf4['getMembers'](_0x1b141f);}})[_0x366e('0x29')](function(_0x3d6548){return _0x3d6548?{'count':_0x2be6bc,'rows':_0x3d6548}:null;})[_0x366e('0x29')](respondWithResult(_0xf35f11,null))[_0x366e('0x52')](handleError(_0xf35f11,null));};exports['getLists']=function(_0x420132,_0x1b1a24,_0x377d5d){var _0xcbd76b={};var _0x1d14d2={};var _0x85ae84;var _0x96fd8a;return db[_0x366e('0x3a')][_0x366e('0x65')]({'where':{'id':_0x420132['params']['id']}})[_0x366e('0x29')](handleEntityNotFound(_0x1b1a24,null))[_0x366e('0x29')](function(_0x449ab9){if(_0x449ab9){_0x85ae84=_0x449ab9;_0x1d14d2[_0x366e('0x3d')]=_['keys'](db['CmList'][_0x366e('0x3b')]);_0x1d14d2[_0x366e('0x3e')]=_['keys'](_0x420132['query']);_0x1d14d2[_0x366e('0x40')]=_[_0x366e('0x42')](_0x1d14d2['model'],_0x1d14d2[_0x366e('0x3e')]);_0xcbd76b[_0x366e('0x41')]=_[_0x366e('0x42')](_0x1d14d2['model'],qs[_0x366e('0x43')](_0x420132[_0x366e('0x3e')][_0x366e('0x43')]));_0xcbd76b[_0x366e('0x41')]=_0xcbd76b[_0x366e('0x41')]['length']?_0xcbd76b[_0x366e('0x41')]:_0x1d14d2[_0x366e('0x3d')];_0xcbd76b['order']=qs[_0x366e('0x49')](_0x420132[_0x366e('0x3e')][_0x366e('0x49')]);_0xcbd76b[_0x366e('0x4a')]=qs[_0x366e('0x40')](_[_0x366e('0x4b')](_0x420132['query'],_0x1d14d2['filters']));if(_0x420132[_0x366e('0x3e')][_0x366e('0x4d')]){_0xcbd76b[_0x366e('0x4a')]=_['merge'](_0xcbd76b[_0x366e('0x4a')],{'$or':_[_0x366e('0x31')](_0xcbd76b[_0x366e('0x41')],function(_0x411cbf){var _0x16eac2={};_0x16eac2[_0x411cbf]={'$like':'%'+_0x420132[_0x366e('0x3e')][_0x366e('0x4d')]+'%'};return _0x16eac2;})});}_0xcbd76b=_[_0x366e('0x4e')]({},_0xcbd76b,_0x420132[_0x366e('0x4f')]);return _0x85ae84['getLists'](_0xcbd76b);}})[_0x366e('0x29')](function(_0x1820ac){if(_0x1820ac){_0x96fd8a=_0x1820ac[_0x366e('0x44')];if(!_0x420132[_0x366e('0x3e')]['hasOwnProperty'](_0x366e('0x46'))){_0xcbd76b[_0x366e('0x47')]=qs[_0x366e('0x47')](_0x420132['query'][_0x366e('0x47')]);_0xcbd76b[_0x366e('0x22')]=qs['offset'](_0x420132[_0x366e('0x3e')][_0x366e('0x22')]);}return _0x85ae84[_0x366e('0xa0')](_0xcbd76b);}})[_0x366e('0x29')](function(_0x5e1c17){if(_0x5e1c17){return _0x5e1c17?{'count':_0x96fd8a,'rows':_0x5e1c17}:null;}})[_0x366e('0x29')](respondWithResult(_0x1b1a24,null))['catch'](handleError(_0x1b1a24,null));};exports['addLists']=function(_0x5b31b7,_0x5175c6,_0x1945ca){var _0x1b59fe,_0x116b5b;return db['VoiceQueue'][_0x366e('0x5a')]({'where':{'id':_0x5b31b7[_0x366e('0x54')]['id']}})[_0x366e('0x29')](handleEntityNotFound(_0x5175c6,null))['then'](function(_0x5ab5ea){if(_0x5ab5ea){_0x116b5b=_0x5ab5ea;return _0x5ab5ea[_0x366e('0xa1')](_0x5b31b7[_0x366e('0x61')][_0x366e('0x84')],_[_0x366e('0x60')](_0x5b31b7['body'],[_0x366e('0x84'),'id'])||{});}return null;})[_0x366e('0xa2')](function(_0x5d23ad){var _0x168e49;_0x1b59fe=_0x5d23ad||[];var _0x5ae361=[];if(_0x5d23ad){for(var _0x459559=0x0;_0x459559<_0x5d23ad[_0x366e('0x44')];_0x459559+=0x1){var _0x341188=_0x5d23ad[_0x459559][_0x366e('0x2b')]({'plain':!![]});_0x116b5b[_0x366e('0xa3')]=_0x5b31b7['body'][_0x366e('0xa3')]?_0x5b31b7[_0x366e('0x61')][_0x366e('0xa3')]:_0x116b5b[_0x366e('0xa3')];switch(_0x116b5b[_0x366e('0xa3')]){case _0x366e('0xa4'):_0x168e49=squel[_0x366e('0xa5')]()[_0x366e('0xa6')](_0x366e('0xa7'))['fromQuery']([_0x366e('0xa8'),_0x366e('0xa9'),_0x366e('0xaa'),_0x366e('0xab'),_0x366e('0x67'),'createdAt','updatedAt'],squel['select']()[_0x366e('0x86')]('phone',_0x366e('0xa8'))[_0x366e('0x86')](_0x366e('0xac'),'scheduledAt')[_0x366e('0x86')]('id','ContactId')[_0x366e('0x86')](_0x341188[_0x366e('0xad')][_0x366e('0x8f')](),'ListId')['field'](_0x5b31b7['params']['id'][_0x366e('0x8f')](),_0x366e('0x67'))[_0x366e('0x86')](_0x366e('0xac'),'createdAt')['field']('NOW()',_0x366e('0x5f'))['from'](_0x366e('0xae'))[_0x366e('0x4a')](_0x366e('0xaf'))[_0x366e('0x4a')](_0x366e('0xb0'),_0x341188[_0x366e('0xad')][_0x366e('0x8f')]())[_0x366e('0x4a')](_0x366e('0xb1'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x366e('0x85')]()[_0x366e('0x86')](_0x366e('0xb2'))[_0x366e('0x88')](_0x366e('0xb3'))[_0x366e('0x4a')]('VoiceQueueId\x20=\x20?',_0x5b31b7[_0x366e('0x54')]['id']['toString']()))[_0x366e('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x366e('0x85')]()[_0x366e('0x86')]('COALESCE(phone,\x27\x27)')[_0x366e('0x88')]('cm_hopper')[_0x366e('0x4a')](_0x366e('0x8c'),_0x5b31b7[_0x366e('0x54')]['id'][_0x366e('0x8f')]())))[_0x366e('0x8f')]();break;case _0x366e('0xb4'):_0x168e49=squel['insert']()[_0x366e('0xa6')]('cm_hopper')[_0x366e('0xb5')]([_0x366e('0xa8'),'scheduledAt',_0x366e('0xaa'),_0x366e('0xab'),_0x366e('0x67'),_0x366e('0x5e'),_0x366e('0x5f')],squel[_0x366e('0x85')]()['field'](_0x366e('0xa8'),_0x366e('0xa8'))[_0x366e('0x86')]('NOW()',_0x366e('0xa9'))[_0x366e('0x86')]('id','ContactId')[_0x366e('0x86')](_0x341188[_0x366e('0xad')][_0x366e('0x8f')](),_0x366e('0xab'))[_0x366e('0x86')](_0x5b31b7[_0x366e('0x54')]['id']['toString'](),_0x366e('0x67'))[_0x366e('0x86')](_0x366e('0xac'),'createdAt')[_0x366e('0x86')](_0x366e('0xac'),_0x366e('0x5f'))[_0x366e('0x88')](_0x366e('0xae'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x341188[_0x366e('0xad')][_0x366e('0x8f')]())[_0x366e('0x4a')]('phone\x20IS\x20NOT\x20NULL')[_0x366e('0x4a')](_0x366e('0xb6'),squel['select']()[_0x366e('0x86')](_0x366e('0xb7'))[_0x366e('0x88')](_0x366e('0xa7'))[_0x366e('0x4a')](_0x366e('0x8c'),_0x5b31b7[_0x366e('0x54')]['id'][_0x366e('0x8f')]())))[_0x366e('0x8f')]();break;default:_0x168e49=squel[_0x366e('0xa5')]()['into'](_0x366e('0xa7'))[_0x366e('0xb5')]([_0x366e('0xa8'),_0x366e('0xa9'),_0x366e('0xaa'),_0x366e('0xab'),_0x366e('0x67'),_0x366e('0x5e'),_0x366e('0x5f')],squel[_0x366e('0x85')]()['field'](_0x366e('0xa8'),'phone')['field'](_0x366e('0xac'),'scheduledAt')[_0x366e('0x86')]('id',_0x366e('0xaa'))[_0x366e('0x86')](_0x341188['CmListId'][_0x366e('0x8f')](),_0x366e('0xab'))['field'](_0x5b31b7['params']['id'][_0x366e('0x8f')](),_0x366e('0x67'))['field']('NOW()','createdAt')['field'](_0x366e('0xac'),_0x366e('0x5f'))[_0x366e('0x88')](_0x366e('0xae'))[_0x366e('0x4a')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x341188['CmListId']['toString']())[_0x366e('0x4a')]('phone\x20IS\x20NOT\x20NULL'))[_0x366e('0x8f')]();}_0x5ae361[_0x366e('0x8e')](db['sequelize'][_0x366e('0x3e')](_0x168e49));}return BPromise[_0x366e('0x94')](_0x5ae361);}})['then'](function(){return _0x1b59fe;})[_0x366e('0x29')](respondWithResult(_0x5175c6,null))[_0x366e('0x52')](handleError(_0x5175c6,null));};exports[_0x366e('0xb8')]=function(_0x2b24fa,_0x5622f1,_0x5a9ccb){return db[_0x366e('0x3a')][_0x366e('0x5a')]({'where':{'id':_0x2b24fa[_0x366e('0x54')]['id']}})['then'](handleEntityNotFound(_0x5622f1,null))[_0x366e('0x29')](function(_0x905694){if(_0x905694){return _0x905694[_0x366e('0xb8')](_0x2b24fa[_0x366e('0x3e')][_0x366e('0x84')]);}})['then'](function(_0x5573a2){if(_0x5573a2){return db[_0x366e('0x66')]['destroy']({'where':{'ListId':_0x2b24fa[_0x366e('0x3e')][_0x366e('0x84')],'VoiceQueueId':_0x2b24fa[_0x366e('0x54')]['id']}})[_0x366e('0x29')](function(){return _0x5573a2;});}})[_0x366e('0x29')](respondWithStatusCode(_0x5622f1,null))[_0x366e('0x52')](handleError(_0x5622f1,null));};exports['getBlackLists']=function(_0x24de84,_0x313ef9,_0x3d4ebe){var _0x45c366={};var _0x15f158={};var _0x13b17c;var _0x39a369;return db[_0x366e('0x3a')][_0x366e('0x65')]({'where':{'id':_0x24de84['params']['id']}})[_0x366e('0x29')](handleEntityNotFound(_0x313ef9,null))['then'](function(_0x1f6c1f){if(_0x1f6c1f){_0x13b17c=_0x1f6c1f;_0x15f158[_0x366e('0x3d')]=_[_0x366e('0x3f')](db[_0x366e('0xb9')]['rawAttributes']);_0x15f158[_0x366e('0x3e')]=_[_0x366e('0x3f')](_0x24de84['query']);_0x15f158[_0x366e('0x40')]=_['intersection'](_0x15f158['model'],_0x15f158['query']);_0x45c366[_0x366e('0x41')]=_[_0x366e('0x42')](_0x15f158[_0x366e('0x3d')],qs['fields'](_0x24de84[_0x366e('0x3e')][_0x366e('0x43')]));_0x45c366[_0x366e('0x41')]=_0x45c366[_0x366e('0x41')]['length']?_0x45c366[_0x366e('0x41')]:_0x15f158[_0x366e('0x3d')];_0x45c366[_0x366e('0x48')]=qs[_0x366e('0x49')](_0x24de84[_0x366e('0x3e')][_0x366e('0x49')]);_0x45c366['where']=qs[_0x366e('0x40')](_[_0x366e('0x4b')](_0x24de84[_0x366e('0x3e')],_0x15f158[_0x366e('0x40')]));if(_0x24de84['query'][_0x366e('0x4d')]){_0x45c366['where']=_[_0x366e('0x4e')](_0x45c366[_0x366e('0x4a')],{'$or':_['map'](_0x45c366[_0x366e('0x41')],function(_0x51254b){var _0x529f8f={};_0x529f8f[_0x51254b]={'$like':'%'+_0x24de84[_0x366e('0x3e')][_0x366e('0x4d')]+'%'};return _0x529f8f;})});}_0x45c366=_['merge']({},_0x45c366,_0x24de84[_0x366e('0x4f')]);return _0x13b17c[_0x366e('0xba')](_0x45c366);}})[_0x366e('0x29')](function(_0x26c051){if(_0x26c051){_0x39a369=_0x26c051[_0x366e('0x44')];if(!_0x24de84[_0x366e('0x3e')][_0x366e('0x45')](_0x366e('0x46'))){_0x45c366[_0x366e('0x47')]=qs['limit'](_0x24de84['query'][_0x366e('0x47')]);_0x45c366[_0x366e('0x22')]=qs['offset'](_0x24de84[_0x366e('0x3e')][_0x366e('0x22')]);}return _0x13b17c['getBlackLists'](_0x45c366);}})[_0x366e('0x29')](function(_0x11aba2){if(_0x11aba2){return _0x11aba2?{'count':_0x39a369,'rows':_0x11aba2}:null;}})[_0x366e('0x29')](respondWithResult(_0x313ef9,null))[_0x366e('0x52')](handleError(_0x313ef9,null));};exports[_0x366e('0xbb')]=function(_0x518949,_0x2fc148,_0x36a786){var _0x48a6b8,_0x2bbf8e;return db[_0x366e('0x3a')][_0x366e('0x5a')]({'where':{'id':_0x518949[_0x366e('0x54')]['id']}})[_0x366e('0x29')](handleEntityNotFound(_0x2fc148,null))[_0x366e('0x29')](function(_0x1841df){if(_0x1841df){_0x2bbf8e=_0x1841df;return _0x1841df[_0x366e('0xbb')](_0x518949[_0x366e('0x61')][_0x366e('0x84')],_[_0x366e('0x60')](_0x518949['body'],[_0x366e('0x84'),'id'])||{});}return null;})[_0x366e('0xa2')](function(_0x295eac){var _0x466771;_0x48a6b8=_0x295eac||[];var _0x4a4b80=[];if(_0x295eac){for(var _0x425dd0=0x0;_0x425dd0<_0x295eac[_0x366e('0x44')];_0x425dd0+=0x1){var _0x14c745=_0x295eac[_0x425dd0][_0x366e('0x2b')]({'plain':!![]});_0x466771=squel['insert']()[_0x366e('0xa6')](_0x366e('0xbc'))[_0x366e('0xb5')]([_0x366e('0xa8'),'ContactId',_0x366e('0xab'),_0x366e('0x67'),_0x366e('0x5e'),_0x366e('0x5f')],squel['select']()[_0x366e('0x86')](_0x366e('0xa8'),_0x366e('0xa8'))['field']('id',_0x366e('0xaa'))[_0x366e('0x86')](_0x14c745[_0x366e('0xad')][_0x366e('0x8f')](),'ListId')[_0x366e('0x86')](_0x518949[_0x366e('0x54')]['id'][_0x366e('0x8f')](),_0x366e('0x67'))['field'](_0x366e('0xac'),_0x366e('0x5e'))[_0x366e('0x86')](_0x366e('0xac'),_0x366e('0x5f'))[_0x366e('0x88')]('cm_contacts')['where'](_0x366e('0xaf'))[_0x366e('0x4a')]('ListId\x20=\x20?',_0x14c745[_0x366e('0xad')][_0x366e('0x8f')]())[_0x366e('0x4a')](_0x366e('0xb1')))[_0x366e('0x8f')]();_0x4a4b80[_0x366e('0x8e')](db['sequelize']['query'](_0x466771));}return BPromise[_0x366e('0x94')](_0x4a4b80);}})[_0x366e('0x29')](function(){return _0x48a6b8;})['then'](respondWithResult(_0x2fc148,null))[_0x366e('0x52')](handleError(_0x2fc148,null));};exports['removeBlackLists']=function(_0x46b25d,_0x12b994,_0x181e64){return db['VoiceQueue'][_0x366e('0x5a')]({'where':{'id':_0x46b25d[_0x366e('0x54')]['id']}})['then'](handleEntityNotFound(_0x12b994,null))[_0x366e('0x29')](function(_0x45ebcd){if(_0x45ebcd){return _0x45ebcd['removeBlackLists'](_0x46b25d[_0x366e('0x3e')]['ids']);}})[_0x366e('0x29')](function(_0x3ee591){if(_0x3ee591){return db[_0x366e('0x6c')][_0x366e('0x2a')]({'where':{'ListId':_0x46b25d[_0x366e('0x3e')][_0x366e('0x84')],'VoiceQueueId':_0x46b25d[_0x366e('0x54')]['id']}})['then'](function(){return _0x3ee591;});}})[_0x366e('0x29')](respondWithStatusCode(_0x12b994,null))[_0x366e('0x52')](handleError(_0x12b994,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index b0fb802..46c0885 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 _0x5c00=['remove','emit','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x158a58,_0x28e8e7){var _0x4935d9=function(_0x1e698c){while(--_0x1e698c){_0x158a58['push'](_0x158a58['shift']());}};_0x4935d9(++_0x28e8e7);}(_0x5c00,0x8b));var _0x05c0=function(_0x16083b,_0x21dfb4){_0x16083b=_0x16083b-0x0;var _0x582fc2=_0x5c00[_0x16083b];return _0x582fc2;};'use strict';var EventEmitter=require(_0x05c0('0x0'));var VoiceQueue=require(_0x05c0('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x05c0('0x2')](0x0);var events={'afterCreate':_0x05c0('0x3'),'afterUpdate':_0x05c0('0x4'),'afterDestroy':_0x05c0('0x5')};function emitEvent(_0x3d1e75){return function(_0x581a8c,_0x56de56,_0x2c1b41){VoiceQueueEvents[_0x05c0('0x6')](_0x3d1e75+':'+_0x581a8c['id'],_0x581a8c);VoiceQueueEvents[_0x05c0('0x6')](_0x3d1e75,_0x581a8c);_0x2c1b41(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x05c0('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x16be=['emit','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','update','remove'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0x16be,0x81));var _0xe16b=function(_0x4573f2,_0x43d78f){_0x4573f2=_0x4573f2-0x0;var _0x2861ad=_0x16be[_0x4573f2];return _0x2861ad;};'use strict';var EventEmitter=require(_0xe16b('0x0'));var VoiceQueue=require(_0xe16b('0x1'))['db'][_0xe16b('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe16b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe16b('0x4'),'afterDestroy':_0xe16b('0x5')};function emitEvent(_0x5f044a){return function(_0x378b04,_0xeb97cf,_0x449df5){VoiceQueueEvents[_0xe16b('0x6')](_0x5f044a+':'+_0x378b04['id'],_0x378b04);VoiceQueueEvents[_0xe16b('0x6')](_0x5f044a,_0x378b04);_0x449df5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xe16b('0x7')](e,emitEvent(event));}}module[_0xe16b('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 87ec43a..5e970e5 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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x50d5ae,_0x22a349){var _0x1e8d74=function(_0xd256a9){while(--_0xd256a9){_0x50d5ae['push'](_0x50d5ae['shift']());}};_0x1e8d74(++_0x22a349);}(_0x70e0,0x17b));var _0x070e=function(_0x4759ba,_0x28e0df){_0x4759ba=_0x4759ba-0x0;var _0x42e23b=_0x70e0[_0x4759ba];return _0x42e23b;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x4264ee,_0x520320){var _0x46d043=function(_0x4636e8){while(--_0x4636e8){_0x4264ee['push'](_0x4264ee['shift']());}};_0x46d043(++_0x520320);}(_0x70e0,0x17b));var _0x070e=function(_0xd26d38,_0x5511e1){_0xd26d38=_0xd26d38-0x0;var _0x531cf6=_0x70e0[_0xd26d38];return _0x531cf6;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 513674e..92b6ffc 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 _0x2bb7=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','include','map','attributes','model','then','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5e4134,_0x5090e8){var _0x5f3320=function(_0x3cb3fd){while(--_0x3cb3fd){_0x5e4134['push'](_0x5e4134['shift']());}};_0x5f3320(++_0x5090e8);}(_0x2bb7,0x1ef));var _0x72bb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2bb7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x72bb('0x0'));var util=require(_0x72bb('0x1'));var moment=require(_0x72bb('0x2'));var BPromise=require(_0x72bb('0x3'));var rs=require(_0x72bb('0x4'));var fs=require('fs');var Redis=require(_0x72bb('0x5'));var db=require(_0x72bb('0x6'))['db'];var utils=require(_0x72bb('0x7'));var logger=require(_0x72bb('0x8'))(_0x72bb('0x9'));var config=require('../../config/environment');var jayson=require(_0x72bb('0xa'));var client=jayson[_0x72bb('0xb')][_0x72bb('0xc')]({'port':0x232a});config[_0x72bb('0xd')]=_[_0x72bb('0xe')](config[_0x72bb('0xd')],{'host':_0x72bb('0xf'),'port':0x18eb});var socket=require(_0x72bb('0x10'))(new Redis(config[_0x72bb('0xd')]));require(_0x72bb('0x11'))[_0x72bb('0x12')](socket);function respondWithRpcPromise(_0x192805,_0x3250ef,_0x12c4b8){return new BPromise(function(_0x241f95,_0x24a4e6){return client[_0x72bb('0x13')](_0x192805,_0x12c4b8)['then'](function(_0x392463){logger[_0x72bb('0x14')](_0x72bb('0x15'),_0x3250ef,_0x72bb('0x16'));logger[_0x72bb('0x17')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x3250ef,_0x72bb('0x16'),JSON[_0x72bb('0x18')](_0x392463));if(_0x392463[_0x72bb('0x19')]){if(_0x392463[_0x72bb('0x19')][_0x72bb('0x1a')]===0x1f4){logger['error'](_0x72bb('0x15'),_0x3250ef,_0x392463['error'][_0x72bb('0x1b')]);return _0x24a4e6(_0x392463['error'][_0x72bb('0x1b')]);}logger['error'](_0x72bb('0x15'),_0x3250ef,_0x392463['error'][_0x72bb('0x1b')]);return _0x241f95(_0x392463[_0x72bb('0x19')][_0x72bb('0x1b')]);}else{logger['info'](_0x72bb('0x15'),_0x3250ef,_0x72bb('0x16'));_0x241f95(_0x392463['result']['message']);}})[_0x72bb('0x1c')](function(_0x4084de){logger[_0x72bb('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x3250ef,_0x4084de);_0x24a4e6(_0x4084de);});});}exports[_0x72bb('0x1d')]=function(_0x308a4e){var _0x4ff76d=this;return new Promise(function(_0x5a7ad2,_0x2e6c1a){return db[_0x72bb('0x1e')][_0x72bb('0x1f')]({'raw':_0x308a4e[_0x72bb('0x20')]?_0x308a4e[_0x72bb('0x20')][_0x72bb('0x21')]===undefined?!![]:![]:!![],'where':_0x308a4e['options']?_0x308a4e['options'][_0x72bb('0x22')]||null:null,'attributes':_0x308a4e['options']?_0x308a4e['options']['attributes']||null:null,'limit':_0x308a4e['options']?_0x308a4e[_0x72bb('0x20')]['limit']||null:null,'include':_0x308a4e['options']?_0x308a4e[_0x72bb('0x20')][_0x72bb('0x23')]?_[_0x72bb('0x24')](_0x308a4e['options'][_0x72bb('0x23')],function(_0x3a99cc){return{'model':db[_0x3a99cc['model']],'as':_0x3a99cc['as'],'attributes':_0x3a99cc[_0x72bb('0x25')],'include':_0x3a99cc[_0x72bb('0x23')]?_['map'](_0x3a99cc['include'],function(_0x22f660){return{'model':db[_0x22f660[_0x72bb('0x26')]],'as':_0x22f660['as'],'attributes':_0x22f660[_0x72bb('0x25')],'include':_0x22f660['include']?_[_0x72bb('0x24')](_0x22f660[_0x72bb('0x23')],function(_0x4851e9){return{'model':db[_0x4851e9[_0x72bb('0x26')]],'as':_0x4851e9['as'],'attributes':_0x4851e9[_0x72bb('0x25')]};}):[]};}):[]};}):[]:[]})[_0x72bb('0x27')](function(_0x78299c){logger['info'](_0x72bb('0x1d'),_0x308a4e);logger[_0x72bb('0x17')]('GetVoiceQueue',_0x308a4e,JSON['stringify'](_0x78299c));_0x5a7ad2(_0x78299c);})[_0x72bb('0x1c')](function(_0x451ee8){logger[_0x72bb('0x19')](_0x72bb('0x1d'),_0x451ee8['message'],_0x308a4e);_0x2e6c1a(_0x4ff76d[_0x72bb('0x19')](0x1f4,_0x451ee8[_0x72bb('0x1b')]));});});};exports[_0x72bb('0x28')]=function(_0x4ae5ea){var _0x3b580d=this;return new Promise(function(_0x554c96,_0x292e85){return db[_0x72bb('0x1e')][_0x72bb('0x29')]({'raw':_0x4ae5ea[_0x72bb('0x20')]?_0x4ae5ea[_0x72bb('0x20')][_0x72bb('0x21')]===undefined?!![]:![]:!![],'where':_0x4ae5ea['options']?_0x4ae5ea['options'][_0x72bb('0x22')]||null:null,'attributes':_0x4ae5ea['options']?_0x4ae5ea[_0x72bb('0x20')]['attributes']||null:null,'include':_0x4ae5ea['options']?_0x4ae5ea[_0x72bb('0x20')][_0x72bb('0x23')]?_[_0x72bb('0x24')](_0x4ae5ea[_0x72bb('0x20')][_0x72bb('0x23')],function(_0x2581ed){return{'model':db[_0x2581ed[_0x72bb('0x26')]],'as':_0x2581ed['as'],'attributes':_0x2581ed['attributes'],'include':_0x2581ed[_0x72bb('0x23')]?_[_0x72bb('0x24')](_0x2581ed[_0x72bb('0x23')],function(_0x1fbc22){return{'model':db[_0x1fbc22[_0x72bb('0x26')]],'as':_0x1fbc22['as'],'attributes':_0x1fbc22[_0x72bb('0x25')],'include':_0x1fbc22[_0x72bb('0x23')]?_[_0x72bb('0x24')](_0x1fbc22[_0x72bb('0x23')],function(_0x28ec73){return{'model':db[_0x28ec73[_0x72bb('0x26')]],'as':_0x28ec73['as'],'attributes':_0x28ec73['attributes']};}):[]};}):[]};}):[]:[]})[_0x72bb('0x27')](function(_0x53843f){logger['info'](_0x72bb('0x28'),_0x4ae5ea);logger['debug']('ShowVoiceQueue',_0x4ae5ea,JSON[_0x72bb('0x18')](_0x53843f));_0x554c96(_0x53843f);})['catch'](function(_0x1ea35a){logger[_0x72bb('0x19')](_0x72bb('0x28'),_0x1ea35a[_0x72bb('0x1b')],_0x4ae5ea);_0x292e85(_0x3b580d[_0x72bb('0x19')](0x1f4,_0x1ea35a[_0x72bb('0x1b')]));});});}; \ No newline at end of file +var _0x25d0=['find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','map','model','then','stringify','ShowVoiceQueue'];(function(_0x56f41e,_0x1659b3){var _0x55ab0d=function(_0x276ea3){while(--_0x276ea3){_0x56f41e['push'](_0x56f41e['shift']());}};_0x55ab0d(++_0x1659b3);}(_0x25d0,0x17d));var _0x025d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x025d('0x0'));var util=require(_0x025d('0x1'));var moment=require(_0x025d('0x2'));var BPromise=require(_0x025d('0x3'));var rs=require(_0x025d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x025d('0x5'))['db'];var utils=require(_0x025d('0x6'));var logger=require(_0x025d('0x7'))(_0x025d('0x8'));var config=require(_0x025d('0x9'));var jayson=require(_0x025d('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x025d('0xb')],{'host':_0x025d('0xc'),'port':0x18eb});var socket=require(_0x025d('0xd'))(new Redis(config[_0x025d('0xb')]));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x24259a,_0x2c11d4,_0x1e2a80){return new BPromise(function(_0x319e3e,_0x4ba7b1){return client['request'](_0x24259a,_0x1e2a80)['then'](function(_0x5a9ead){logger['info'](_0x025d('0xe'),_0x2c11d4,'request\x20sent');logger[_0x025d('0xf')](_0x025d('0x10'),_0x2c11d4,'request\x20sent',JSON['stringify'](_0x5a9ead));if(_0x5a9ead[_0x025d('0x11')]){if(_0x5a9ead['error'][_0x025d('0x12')]===0x1f4){logger['error'](_0x025d('0xe'),_0x2c11d4,_0x5a9ead[_0x025d('0x11')][_0x025d('0x13')]);return _0x4ba7b1(_0x5a9ead[_0x025d('0x11')][_0x025d('0x13')]);}logger[_0x025d('0x11')](_0x025d('0xe'),_0x2c11d4,_0x5a9ead['error'][_0x025d('0x13')]);return _0x319e3e(_0x5a9ead[_0x025d('0x11')][_0x025d('0x13')]);}else{logger[_0x025d('0x14')](_0x025d('0xe'),_0x2c11d4,_0x025d('0x15'));_0x319e3e(_0x5a9ead[_0x025d('0x16')][_0x025d('0x13')]);}})[_0x025d('0x17')](function(_0x549b45){logger[_0x025d('0x11')](_0x025d('0xe'),_0x2c11d4,_0x549b45);_0x4ba7b1(_0x549b45);});});}exports[_0x025d('0x18')]=function(_0x1f50ee){var _0x187e2d=this;return new Promise(function(_0x27ad52,_0x5951e3){return db[_0x025d('0x19')]['findAll']({'raw':_0x1f50ee[_0x025d('0x1a')]?_0x1f50ee[_0x025d('0x1a')][_0x025d('0x1b')]===undefined?!![]:![]:!![],'where':_0x1f50ee[_0x025d('0x1a')]?_0x1f50ee[_0x025d('0x1a')][_0x025d('0x1c')]||null:null,'attributes':_0x1f50ee[_0x025d('0x1a')]?_0x1f50ee['options'][_0x025d('0x1d')]||null:null,'limit':_0x1f50ee['options']?_0x1f50ee[_0x025d('0x1a')][_0x025d('0x1e')]||null:null,'include':_0x1f50ee['options']?_0x1f50ee[_0x025d('0x1a')][_0x025d('0x1f')]?_[_0x025d('0x20')](_0x1f50ee[_0x025d('0x1a')]['include'],function(_0xa9c41b){return{'model':db[_0xa9c41b[_0x025d('0x21')]],'as':_0xa9c41b['as'],'attributes':_0xa9c41b['attributes'],'include':_0xa9c41b['include']?_[_0x025d('0x20')](_0xa9c41b[_0x025d('0x1f')],function(_0x58b115){return{'model':db[_0x58b115['model']],'as':_0x58b115['as'],'attributes':_0x58b115[_0x025d('0x1d')],'include':_0x58b115[_0x025d('0x1f')]?_[_0x025d('0x20')](_0x58b115['include'],function(_0x18cdf3){return{'model':db[_0x18cdf3['model']],'as':_0x18cdf3['as'],'attributes':_0x18cdf3[_0x025d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x025d('0x22')](function(_0x42f33a){logger[_0x025d('0x14')](_0x025d('0x18'),_0x1f50ee);logger[_0x025d('0xf')](_0x025d('0x18'),_0x1f50ee,JSON[_0x025d('0x23')](_0x42f33a));_0x27ad52(_0x42f33a);})[_0x025d('0x17')](function(_0xf0ef4c){logger[_0x025d('0x11')](_0x025d('0x18'),_0xf0ef4c[_0x025d('0x13')],_0x1f50ee);_0x5951e3(_0x187e2d['error'](0x1f4,_0xf0ef4c[_0x025d('0x13')]));});});};exports[_0x025d('0x24')]=function(_0x4be416){var _0x24a097=this;return new Promise(function(_0x44a2f2,_0x58668a){return db[_0x025d('0x19')][_0x025d('0x25')]({'raw':_0x4be416[_0x025d('0x1a')]?_0x4be416['options'][_0x025d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4be416[_0x025d('0x1a')]?_0x4be416[_0x025d('0x1a')][_0x025d('0x1c')]||null:null,'attributes':_0x4be416[_0x025d('0x1a')]?_0x4be416[_0x025d('0x1a')]['attributes']||null:null,'include':_0x4be416[_0x025d('0x1a')]?_0x4be416[_0x025d('0x1a')][_0x025d('0x1f')]?_['map'](_0x4be416['options'][_0x025d('0x1f')],function(_0x21cf79){return{'model':db[_0x21cf79[_0x025d('0x21')]],'as':_0x21cf79['as'],'attributes':_0x21cf79[_0x025d('0x1d')],'include':_0x21cf79[_0x025d('0x1f')]?_['map'](_0x21cf79['include'],function(_0x2e2e7c){return{'model':db[_0x2e2e7c[_0x025d('0x21')]],'as':_0x2e2e7c['as'],'attributes':_0x2e2e7c[_0x025d('0x1d')],'include':_0x2e2e7c[_0x025d('0x1f')]?_[_0x025d('0x20')](_0x2e2e7c['include'],function(_0x123401){return{'model':db[_0x123401['model']],'as':_0x123401['as'],'attributes':_0x123401[_0x025d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x025d('0x22')](function(_0x16405d){logger[_0x025d('0x14')](_0x025d('0x24'),_0x4be416);logger[_0x025d('0xf')]('ShowVoiceQueue',_0x4be416,JSON[_0x025d('0x23')](_0x16405d));_0x44a2f2(_0x16405d);})[_0x025d('0x17')](function(_0x3a2b2e){logger[_0x025d('0x11')](_0x025d('0x24'),_0x3a2b2e[_0x025d('0x13')],_0x4be416);_0x58668a(_0x24a097[_0x025d('0x11')](0x1f4,_0x3a2b2e[_0x025d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index b5869f5..00e9707 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 _0xd2c5=['removeListener','voiceQueue:','./voiceQueue.events','update','emit'];(function(_0x545a56,_0x4246c6){var _0xa82334=function(_0x215ad5){while(--_0x215ad5){_0x545a56['push'](_0x545a56['shift']());}};_0xa82334(++_0x4246c6);}(_0xd2c5,0xfc));var _0x5d2c=function(_0x2bad8f,_0xd2c3f5){_0x2bad8f=_0x2bad8f-0x0;var _0x32828e=_0xd2c5[_0x2bad8f];return _0x32828e;};'use strict';var VoiceQueueEvents=require(_0x5d2c('0x0'));var events=['save','remove',_0x5d2c('0x1')];function createListener(_0x3ea749,_0xbfc5ff){return function(_0x2691c2){_0xbfc5ff[_0x5d2c('0x2')](_0x3ea749,_0x2691c2);};}function removeListener(_0x4772e0,_0x4c6631){return function(){VoiceQueueEvents[_0x5d2c('0x3')](_0x4772e0,_0x4c6631);};}exports['register']=function(_0x40cbbf){for(var _0x587bd0=0x0,_0x36ddb3=events['length'];_0x587bd0<_0x36ddb3;_0x587bd0++){var _0xd394ba=events[_0x587bd0];var _0x3d2bdd=createListener(_0x5d2c('0x4')+_0xd394ba,_0x40cbbf);VoiceQueueEvents['on'](_0xd394ba,_0x3d2bdd);}}; \ No newline at end of file +var _0xaf4d=['remove','update','emit','length','voiceQueue:'];(function(_0x3910e3,_0x3e63ba){var _0xb3a96a=function(_0x14ff84){while(--_0x14ff84){_0x3910e3['push'](_0x3910e3['shift']());}};_0xb3a96a(++_0x3e63ba);}(_0xaf4d,0x8c));var _0xdaf4=function(_0x403a7d,_0x44cf2f){_0x403a7d=_0x403a7d-0x0;var _0x1ef28c=_0xaf4d[_0x403a7d];return _0x1ef28c;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0xdaf4('0x0'),_0xdaf4('0x1')];function createListener(_0x41d832,_0x101b98){return function(_0x289071){_0x101b98[_0xdaf4('0x2')](_0x41d832,_0x289071);};}function removeListener(_0x3b90e8,_0x42140d){return function(){VoiceQueueEvents['removeListener'](_0x3b90e8,_0x42140d);};}exports['register']=function(_0xe40c90){for(var _0x766936=0x0,_0x5d2a44=events[_0xdaf4('0x3')];_0x766936<_0x5d2a44;_0x766936++){var _0x42b97e=events[_0x766936];var _0x574094=createListener(_0xdaf4('0x4')+_0x42b97e,_0xe40c90);VoiceQueueEvents['on'](_0x42b97e,_0x574094);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 932feef..ee4d9a4 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 _0x2d87=['get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller'];(function(_0x18e89d,_0x4814fe){var _0x1aea52=function(_0x23e9fd){while(--_0x23e9fd){_0x18e89d['push'](_0x18e89d['shift']());}};_0x1aea52(++_0x4814fe);}(_0x2d87,0x1d6));var _0x72d8=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2d87[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x72d8('0x0'));var util=require(_0x72d8('0x1'));var path=require(_0x72d8('0x2'));var timeout=require(_0x72d8('0x3'));var express=require('express');var router=express[_0x72d8('0x4')]();var fs_extra=require(_0x72d8('0x5'));var auth=require(_0x72d8('0x6'));var interaction=require(_0x72d8('0x7'));var config=require(_0x72d8('0x8'));var controller=require(_0x72d8('0x9'));router[_0x72d8('0xa')]('/',auth[_0x72d8('0xb')](),controller[_0x72d8('0xc')]);router[_0x72d8('0xa')](_0x72d8('0xd'),auth[_0x72d8('0xb')](),controller[_0x72d8('0xe')]);router[_0x72d8('0xa')](_0x72d8('0xf'),auth[_0x72d8('0xb')](),controller[_0x72d8('0x10')]);router[_0x72d8('0xa')](_0x72d8('0x11'),auth[_0x72d8('0xb')](),controller[_0x72d8('0x12')]);router[_0x72d8('0x13')]('/',auth[_0x72d8('0xb')](),controller[_0x72d8('0x14')]);router['put'](_0x72d8('0x11'),auth[_0x72d8('0xb')](),controller[_0x72d8('0x15')]);router[_0x72d8('0x16')](_0x72d8('0x11'),auth[_0x72d8('0xb')](),controller['destroy']);module[_0x72d8('0x17')]=router; \ No newline at end of file +var _0xf453=['get','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x28ba0c,_0x8cbf9){var _0x121bab=function(_0x1d766c){while(--_0x1d766c){_0x28ba0c['push'](_0x28ba0c['shift']());}};_0x121bab(++_0x8cbf9);}(_0xf453,0x1f0));var _0x3f45=function(_0x4de7f5,_0x33fe41){_0x4de7f5=_0x4de7f5-0x0;var _0x4dc3ce=_0xf453[_0x4de7f5];return _0x4dc3ce;};'use strict';var multer=require(_0x3f45('0x0'));var util=require(_0x3f45('0x1'));var path=require(_0x3f45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3f45('0x3')]();var fs_extra=require(_0x3f45('0x4'));var auth=require(_0x3f45('0x5'));var interaction=require(_0x3f45('0x6'));var config=require(_0x3f45('0x7'));var controller=require('./voiceQueueReport.controller');router[_0x3f45('0x8')]('/',auth[_0x3f45('0x9')](),controller['index']);router['get'](_0x3f45('0xa'),auth[_0x3f45('0x9')](),controller[_0x3f45('0xb')]);router[_0x3f45('0x8')](_0x3f45('0xc'),auth[_0x3f45('0x9')](),controller[_0x3f45('0xd')]);router['get'](_0x3f45('0xe'),auth['isAuthenticated'](),controller[_0x3f45('0xf')]);router[_0x3f45('0x10')]('/',auth[_0x3f45('0x9')](),controller['create']);router[_0x3f45('0x11')](_0x3f45('0xe'),auth[_0x3f45('0x9')](),controller[_0x3f45('0x12')]);router[_0x3f45('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3f45('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index dd7829e..5e02c7e 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 _0xe97c=['STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports'];(function(_0x5cc927,_0x43b83c){var _0x87f46=function(_0x2196e9){while(--_0x2196e9){_0x5cc927['push'](_0x5cc927['shift']());}};_0x87f46(++_0x43b83c);}(_0xe97c,0x1bd));var _0xce97=function(_0xf4a62d,_0x529721){_0xf4a62d=_0xf4a62d-0x0;var _0x44b3dd=_0xe97c[_0xf4a62d];return _0x44b3dd;};'use strict';var Sequelize=require(_0xce97('0x0'));var moment=require(_0xce97('0x1'));module[_0xce97('0x2')]={'type':{'type':Sequelize[_0xce97('0x3')]},'uniqueid':{'type':Sequelize[_0xce97('0x3')]},'calleridnum':{'type':Sequelize[_0xce97('0x3')]},'calleridname':{'type':Sequelize[_0xce97('0x3')]},'queue':{'type':Sequelize[_0xce97('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xce97('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xce97('0x4')],'set':function(_0xc82097){var _0x19094e=moment(_0xc82097);var _0xb4cb0=moment(this[_0xce97('0x5')](_0xce97('0x6')))['format'](_0xce97('0x7'));var _0x27c8e1=_0x19094e[_0xce97('0x8')](_0xb4cb0,_0xce97('0x9'));this[_0xce97('0xa')](_0xce97('0xb'),_0xc82097);this[_0xce97('0xa')](_0xce97('0xc'),_0x27c8e1||null);}},'position':{'type':Sequelize[_0xce97('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xce97('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xce97('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xce97('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xce97('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xce97('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xce97('0xf')},'originalposition':{'type':Sequelize[_0xce97('0xd')]},'channel':{'type':Sequelize[_0xce97('0x3')]},'connectedlinenum':{'type':Sequelize[_0xce97('0x3')]},'connectedlinename':{'type':Sequelize[_0xce97('0x3')]},'accountcode':{'type':Sequelize[_0xce97('0x3')]},'context':{'type':Sequelize[_0xce97('0x3')]},'exten':{'type':Sequelize[_0xce97('0x3')]},'priority':{'type':Sequelize[_0xce97('0x3')]},'holdtime':{'type':Sequelize[_0xce97('0xd')]},'mohtime':{'type':Sequelize[_0xce97('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xce97('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xce97('0x3')]},'transfer':{'type':Sequelize[_0xce97('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xce97('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xce97('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xce97('0x3')]},'secondDisposition':{'type':Sequelize[_0xce97('0x3')]},'thirdDisposition':{'type':Sequelize[_0xce97('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xce97('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd86a=['queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','setDataValue'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd86a,0x14f));var _0xad86=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0xd86a[_0x41582d];return _0x59c504;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xad86('0x0'));module[_0xad86('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xad86('0x2')]},'calleridnum':{'type':Sequelize[_0xad86('0x2')]},'calleridname':{'type':Sequelize[_0xad86('0x2')]},'queue':{'type':Sequelize[_0xad86('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xad86('0x3')],'set':function(_0x3e0fcd){var _0x108a2f=moment(_0x3e0fcd);var _0x145ad8=moment(this[_0xad86('0x4')](_0xad86('0x5')))[_0xad86('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x29f9d0=_0x108a2f[_0xad86('0x7')](_0x145ad8,_0xad86('0x8'));this[_0xad86('0x9')](_0xad86('0xa'),_0x3e0fcd);this[_0xad86('0x9')]('holdtime',_0x29f9d0||null);}},'position':{'type':Sequelize[_0xad86('0xb')]},'count':{'type':Sequelize[_0xad86('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xad86('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xad86('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xad86('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xad86('0x3')]},'queuecallerexit':{'type':Sequelize[_0xad86('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xad86('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xad86('0x2')],'comment':_0xad86('0xd')},'originalposition':{'type':Sequelize[_0xad86('0xb')]},'channel':{'type':Sequelize[_0xad86('0x2')]},'connectedlinenum':{'type':Sequelize[_0xad86('0x2')]},'connectedlinename':{'type':Sequelize[_0xad86('0x2')]},'accountcode':{'type':Sequelize[_0xad86('0x2')]},'context':{'type':Sequelize[_0xad86('0x2')]},'exten':{'type':Sequelize[_0xad86('0x2')]},'priority':{'type':Sequelize[_0xad86('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xad86('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xad86('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xad86('0x2')]},'transfer':{'type':Sequelize[_0xad86('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xad86('0x2')],'comment':_0xad86('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xad86('0x2')]},'disposition':{'type':Sequelize[_0xad86('0x2')]},'secondDisposition':{'type':Sequelize[_0xad86('0x2')]},'thirdDisposition':{'type':Sequelize[_0xad86('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xad86('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index ee2d85b..4ce1afc 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 _0x1c11=['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','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','body','describe','findAll','getVoiceQueuesReport','rimraf','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0x1c11,0x9a));var _0x11c1=function(_0x4854e1,_0xb9f330){_0x4854e1=_0x4854e1-0x0;var _0xa3412b=_0x1c11[_0x4854e1];return _0xa3412b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x11c1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x11c1('0x1'));var rp=require('request-promise');var moment=require(_0x11c1('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x11c1('0x3'));var util=require(_0x11c1('0x4'));var path=require('path');var sox=require(_0x11c1('0x5'));var csv=require('to-csv');var ejs=require(_0x11c1('0x6'));var fs=require('fs');var fs_extra=require(_0x11c1('0x7'));var _=require(_0x11c1('0x8'));var squel=require(_0x11c1('0x9'));var crypto=require(_0x11c1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x11c1('0xb'));var toCsv=require(_0x11c1('0xc'));var querystring=require(_0x11c1('0xd'));var Papa=require(_0x11c1('0xe'));var Redis=require('ioredis');var authService=require(_0x11c1('0xf'));var qs=require(_0x11c1('0x10'));var as=require(_0x11c1('0x11'));var hardwareService=require(_0x11c1('0x12'));var logger=require(_0x11c1('0x13'))(_0x11c1('0x14'));var utils=require(_0x11c1('0x15'));var config=require(_0x11c1('0x16'));var licenseUtil=require(_0x11c1('0x17'));var db=require(_0x11c1('0x18'))['db'];config[_0x11c1('0x19')]=_['defaults'](config[_0x11c1('0x19')],{'host':_0x11c1('0x1a'),'port':0x18eb});var socket=require(_0x11c1('0x1b'))(new Redis(config[_0x11c1('0x19')]));require('./voiceQueueReport.socket')[_0x11c1('0x1c')](socket);function respondWithStatusCode(_0x4a907d,_0x421146){_0x421146=_0x421146||0xcc;return function(_0x5c7d25){if(_0x5c7d25){return _0x4a907d[_0x11c1('0x1d')](_0x421146);}return _0x4a907d[_0x11c1('0x1e')](_0x421146)[_0x11c1('0x1f')]();};}function respondWithResult(_0x15b638,_0x4eb9fb){_0x4eb9fb=_0x4eb9fb||0xc8;return function(_0x5ec328){if(_0x5ec328){return _0x15b638[_0x11c1('0x1e')](_0x4eb9fb)[_0x11c1('0x20')](_0x5ec328);}};}function respondWithFilteredResult(_0x1e477c,_0x748e04){return function(_0x419339){if(_0x419339){var _0x25d496=typeof _0x748e04['offset']===_0x11c1('0x21')&&typeof _0x748e04[_0x11c1('0x22')]===_0x11c1('0x21');var _0x4cf35d=_0x419339[_0x11c1('0x23')];var _0x2354b4=_0x25d496?0x0:_0x748e04[_0x11c1('0x24')];var _0x358d66=_0x25d496?_0x419339[_0x11c1('0x23')]:_0x748e04['offset']+_0x748e04[_0x11c1('0x22')];var _0x39d752;if(_0x358d66>=_0x4cf35d){_0x358d66=_0x4cf35d;_0x39d752=0xc8;}else{_0x39d752=0xce;}_0x1e477c['status'](_0x39d752);return _0x1e477c[_0x11c1('0x25')](_0x11c1('0x26'),_0x2354b4+'-'+_0x358d66+'/'+_0x4cf35d)[_0x11c1('0x20')](_0x419339);}return null;};}function patchUpdates(_0x1229d3){return function(_0x318dfd){try{jsonpatch[_0x11c1('0x27')](_0x318dfd,_0x1229d3,!![]);}catch(_0x1333f5){return BPromise['reject'](_0x1333f5);}return _0x318dfd[_0x11c1('0x28')]();};}function saveUpdates(_0x205337,_0x3a9d07){return function(_0x2f4b4a){if(_0x2f4b4a){return _0x2f4b4a[_0x11c1('0x29')](_0x205337)[_0x11c1('0x2a')](function(_0x4ae7ba){return _0x4ae7ba;});}return null;};}function removeEntity(_0xdea947,_0x4ed8e2){return function(_0x2a6b99){if(_0x2a6b99){return _0x2a6b99[_0x11c1('0x2b')]()[_0x11c1('0x2a')](function(){_0xdea947['status'](0xcc)[_0x11c1('0x1f')]();});}};}function handleEntityNotFound(_0x2c3a34,_0x1bd014){return function(_0x28a677){if(!_0x28a677){_0x2c3a34['sendStatus'](0x194);}return _0x28a677;};}function handleError(_0x50d169,_0x33801d){_0x33801d=_0x33801d||0x1f4;return function(_0x4c12e7){logger[_0x11c1('0x2c')](_0x4c12e7[_0x11c1('0x2d')]);if(_0x4c12e7[_0x11c1('0x2e')]){delete _0x4c12e7[_0x11c1('0x2e')];}_0x50d169[_0x11c1('0x1e')](_0x33801d)[_0x11c1('0x2f')](_0x4c12e7);};}exports[_0x11c1('0x30')]=function(_0x451da4,_0x374dca){var _0x267f03={},_0xb6b289={},_0x3e9626={'count':0x0,'rows':[]};var _0x5d70e2=_[_0x11c1('0x31')](db[_0x11c1('0x32')][_0x11c1('0x33')],function(_0x1b6c14){return{'name':_0x1b6c14[_0x11c1('0x34')],'type':_0x1b6c14[_0x11c1('0x35')][_0x11c1('0x36')]};});_0xb6b289[_0x11c1('0x37')]=_[_0x11c1('0x31')](_0x5d70e2,_0x11c1('0x2e'));_0xb6b289['query']=_[_0x11c1('0x38')](_0x451da4[_0x11c1('0x39')]);_0xb6b289['filters']=_['intersection'](_0xb6b289[_0x11c1('0x37')],_0xb6b289[_0x11c1('0x39')]);_0x267f03[_0x11c1('0x3a')]=_[_0x11c1('0x3b')](_0xb6b289[_0x11c1('0x37')],qs[_0x11c1('0x3c')](_0x451da4[_0x11c1('0x39')][_0x11c1('0x3c')]));_0x267f03['attributes']=_0x267f03['attributes'][_0x11c1('0x3d')]?_0x267f03[_0x11c1('0x3a')]:_0xb6b289[_0x11c1('0x37')];if(!_0x451da4[_0x11c1('0x39')][_0x11c1('0x3e')]('nolimit')){_0x267f03['limit']=qs[_0x11c1('0x22')](_0x451da4[_0x11c1('0x39')][_0x11c1('0x22')]);_0x267f03[_0x11c1('0x24')]=qs[_0x11c1('0x24')](_0x451da4['query'][_0x11c1('0x24')]);}_0x267f03[_0x11c1('0x3f')]=qs[_0x11c1('0x40')](_0x451da4[_0x11c1('0x39')]['sort']);_0x267f03[_0x11c1('0x41')]=qs[_0x11c1('0x42')](_[_0x11c1('0x43')](_0x451da4[_0x11c1('0x39')],_0xb6b289['filters']),_0x5d70e2);if(_0x451da4[_0x11c1('0x39')][_0x11c1('0x44')]){_0x267f03[_0x11c1('0x41')]=_[_0x11c1('0x45')](_0x267f03['where'],{'$or':_[_0x11c1('0x31')](_0x5d70e2,function(_0xa9a626){if(_0xa9a626[_0x11c1('0x35')]!==_0x11c1('0x46')){var _0x55bf05={};_0x55bf05[_0xa9a626[_0x11c1('0x2e')]]={'$like':'%'+_0x451da4['query'][_0x11c1('0x44')]+'%'};return _0x55bf05;}})});}_0x267f03=_[_0x11c1('0x45')]({},_0x267f03,_0x451da4[_0x11c1('0x47')]);var _0x52dd4b={'where':_0x267f03[_0x11c1('0x41')]};return db[_0x11c1('0x32')][_0x11c1('0x23')](_0x52dd4b)[_0x11c1('0x2a')](function(_0x32a663){_0x3e9626[_0x11c1('0x23')]=_0x32a663;if(_0x451da4[_0x11c1('0x39')][_0x11c1('0x48')]){_0x267f03['include']=[{'all':!![]}];}return db[_0x11c1('0x32')]['findAll'](_0x267f03);})[_0x11c1('0x2a')](function(_0x342bc3){_0x3e9626[_0x11c1('0x49')]=_0x342bc3;return _0x3e9626;})[_0x11c1('0x2a')](respondWithFilteredResult(_0x374dca,_0x267f03))['catch'](handleError(_0x374dca,null));};exports[_0x11c1('0x4a')]=function(_0xcd1e21,_0x3dcb17){var _0x555a23={'raw':![],'where':{'id':_0xcd1e21[_0x11c1('0x4b')]['id']}},_0x1bed81={};_0x1bed81['model']=_[_0x11c1('0x38')](db[_0x11c1('0x32')]['rawAttributes']);_0x1bed81[_0x11c1('0x39')]=_[_0x11c1('0x38')](_0xcd1e21[_0x11c1('0x39')]);_0x1bed81[_0x11c1('0x42')]=_[_0x11c1('0x3b')](_0x1bed81[_0x11c1('0x37')],_0x1bed81['query']);_0x555a23[_0x11c1('0x3a')]=_[_0x11c1('0x3b')](_0x1bed81[_0x11c1('0x37')],qs['fields'](_0xcd1e21['query'][_0x11c1('0x3c')]));_0x555a23[_0x11c1('0x3a')]=_0x555a23[_0x11c1('0x3a')][_0x11c1('0x3d')]?_0x555a23[_0x11c1('0x3a')]:_0x1bed81[_0x11c1('0x37')];if(_0xcd1e21[_0x11c1('0x39')][_0x11c1('0x48')]){_0x555a23[_0x11c1('0x4c')]=[{'all':!![]}];}_0x555a23=_[_0x11c1('0x45')]({},_0x555a23,_0xcd1e21['options']);return db['VoiceQueueReport'][_0x11c1('0x4d')](_0x555a23)[_0x11c1('0x2a')](handleEntityNotFound(_0x3dcb17,null))[_0x11c1('0x2a')](respondWithResult(_0x3dcb17,null))[_0x11c1('0x4e')](handleError(_0x3dcb17,null));};exports['create']=function(_0x1906e6,_0x44a07d){return db['VoiceQueueReport'][_0x11c1('0x4f')](_0x1906e6[_0x11c1('0x50')],{})[_0x11c1('0x2a')](respondWithResult(_0x44a07d,0xc9))['catch'](handleError(_0x44a07d,null));};exports[_0x11c1('0x29')]=function(_0x444b0d,_0x1f4406){if(_0x444b0d[_0x11c1('0x50')]['id']){delete _0x444b0d[_0x11c1('0x50')]['id'];}return db[_0x11c1('0x32')][_0x11c1('0x4d')]({'where':{'id':_0x444b0d[_0x11c1('0x4b')]['id']}})[_0x11c1('0x2a')](handleEntityNotFound(_0x1f4406,null))[_0x11c1('0x2a')](saveUpdates(_0x444b0d[_0x11c1('0x50')],null))[_0x11c1('0x2a')](respondWithResult(_0x1f4406,null))[_0x11c1('0x4e')](handleError(_0x1f4406,null));};exports['destroy']=function(_0x2f66b1,_0x54b947){return db['VoiceQueueReport']['find']({'where':{'id':_0x2f66b1['params']['id']}})[_0x11c1('0x2a')](handleEntityNotFound(_0x54b947,null))['then'](removeEntity(_0x54b947,null))[_0x11c1('0x4e')](handleError(_0x54b947,null));};exports[_0x11c1('0x51')]=function(_0xf42f55,_0x3e53ae){return db[_0x11c1('0x32')]['describe']()['then'](respondWithResult(_0x3e53ae,null))['catch'](handleError(_0x3e53ae,null));};exports['getVoiceQueuesReport']=function(_0x4c560a,_0x5d7be2){var _0x556fa8={},_0x597f6c={},_0x460dac={'count':0x0,'rows':[]};_0x597f6c[_0x11c1('0x37')]=_['keys'](db['VoiceQueueReport'][_0x11c1('0x33')]);_0x597f6c['query']=_[_0x11c1('0x38')](_0x4c560a[_0x11c1('0x39')]);_0x597f6c['filters']=_[_0x11c1('0x3b')](_0x597f6c[_0x11c1('0x37')],_0x597f6c[_0x11c1('0x39')]);_0x556fa8[_0x11c1('0x3a')]=_[_0x11c1('0x3b')](_0x597f6c[_0x11c1('0x37')],qs[_0x11c1('0x3c')](_0x4c560a[_0x11c1('0x39')]['fields']));_0x556fa8['attributes']=_0x556fa8[_0x11c1('0x3a')][_0x11c1('0x3d')]?_0x556fa8[_0x11c1('0x3a')]:_0x597f6c[_0x11c1('0x37')];if(!_0x4c560a['query']['hasOwnProperty']('nolimit')){_0x556fa8['limit']=qs[_0x11c1('0x22')](_0x4c560a['query'][_0x11c1('0x22')]);_0x556fa8[_0x11c1('0x24')]=qs['offset'](_0x4c560a[_0x11c1('0x39')][_0x11c1('0x24')]);}_0x556fa8['order']=qs[_0x11c1('0x40')](_0x4c560a[_0x11c1('0x39')]['sort']);_0x556fa8[_0x11c1('0x41')]=qs['filters'](_['pick'](_0x4c560a[_0x11c1('0x39')],_0x597f6c[_0x11c1('0x42')]));if(_0x4c560a[_0x11c1('0x39')][_0x11c1('0x44')]){_0x556fa8['where']=_[_0x11c1('0x45')](_0x556fa8[_0x11c1('0x41')],{'$or':_[_0x11c1('0x31')](_0x556fa8[_0x11c1('0x3a')],function(_0x14a049){var _0x2346d9={};_0x2346d9[_0x14a049]={'$like':'%'+_0x4c560a[_0x11c1('0x39')][_0x11c1('0x44')]+'%'};return _0x2346d9;})});}_0x556fa8=_[_0x11c1('0x45')]({},_0x556fa8,_0x4c560a[_0x11c1('0x47')]);var _0x4c18b8={'where':_0x556fa8[_0x11c1('0x41')]};return db[_0x11c1('0x32')][_0x11c1('0x23')](_0x4c18b8)[_0x11c1('0x2a')](function(_0x4905f2){_0x460dac[_0x11c1('0x23')]=_0x4905f2;if(_0x4c560a[_0x11c1('0x39')][_0x11c1('0x48')]){_0x556fa8[_0x11c1('0x4c')]=[{'all':!![]}];}return db[_0x11c1('0x32')][_0x11c1('0x52')](_0x556fa8);})[_0x11c1('0x2a')](function(_0x4a28b0){_0x460dac[_0x11c1('0x49')]=_0x4a28b0;return _0x460dac;})[_0x11c1('0x2a')](respondWithFilteredResult(_0x5d7be2,_0x556fa8,_0x11c1('0x53')))[_0x11c1('0x4e')](handleError(_0x5d7be2,null,_0x11c1('0x53')));}; \ No newline at end of file +var _0xd8c1=['../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','VoiceQueueReport','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','getVoiceQueuesReport','hasOwnProperty','pick','rows','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api'];(function(_0x21989f,_0x5d4d01){var _0x1a716e=function(_0xba0282){while(--_0xba0282){_0x21989f['push'](_0x21989f['shift']());}};_0x1a716e(++_0x5d4d01);}(_0xd8c1,0x95));var _0x1d8c=function(_0x28e146,_0x1ffe52){_0x28e146=_0x28e146-0x0;var _0x172c4d=_0xd8c1[_0x28e146];return _0x172c4d;};'use strict';var emlformat=require(_0x1d8c('0x0'));var rimraf=require(_0x1d8c('0x1'));var zipdir=require(_0x1d8c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d8c('0x3'));var moment=require(_0x1d8c('0x4'));var BPromise=require(_0x1d8c('0x5'));var Mustache=require(_0x1d8c('0x6'));var util=require(_0x1d8c('0x7'));var path=require(_0x1d8c('0x8'));var sox=require(_0x1d8c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d8c('0xa'));var squel=require(_0x1d8c('0xb'));var crypto=require(_0x1d8c('0xc'));var jsforce=require(_0x1d8c('0xd'));var deskjs=require(_0x1d8c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1d8c('0xf'));var Papa=require(_0x1d8c('0x10'));var Redis=require(_0x1d8c('0x11'));var authService=require(_0x1d8c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d8c('0x13'))(_0x1d8c('0x14'));var utils=require(_0x1d8c('0x15'));var config=require(_0x1d8c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1d8c('0x17')]=_[_0x1d8c('0x18')](config[_0x1d8c('0x17')],{'host':_0x1d8c('0x19'),'port':0x18eb});var socket=require(_0x1d8c('0x1a'))(new Redis(config[_0x1d8c('0x17')]));require(_0x1d8c('0x1b'))[_0x1d8c('0x1c')](socket);function respondWithStatusCode(_0x4b1273,_0x15a6d1){_0x15a6d1=_0x15a6d1||0xcc;return function(_0x476848){if(_0x476848){return _0x4b1273['sendStatus'](_0x15a6d1);}return _0x4b1273[_0x1d8c('0x1d')](_0x15a6d1)[_0x1d8c('0x1e')]();};}function respondWithResult(_0x2e4c6a,_0x26883c){_0x26883c=_0x26883c||0xc8;return function(_0x2424a9){if(_0x2424a9){return _0x2e4c6a['status'](_0x26883c)[_0x1d8c('0x1f')](_0x2424a9);}};}function respondWithFilteredResult(_0x5f0379,_0x3c4266){return function(_0x13f534){if(_0x13f534){var _0x9eb500=typeof _0x3c4266['offset']==='undefined'&&typeof _0x3c4266['limit']===_0x1d8c('0x20');var _0x426ace=_0x13f534[_0x1d8c('0x21')];var _0x993b88=_0x9eb500?0x0:_0x3c4266[_0x1d8c('0x22')];var _0x2fb2fd=_0x9eb500?_0x13f534[_0x1d8c('0x21')]:_0x3c4266[_0x1d8c('0x22')]+_0x3c4266[_0x1d8c('0x23')];var _0x549f59;if(_0x2fb2fd>=_0x426ace){_0x2fb2fd=_0x426ace;_0x549f59=0xc8;}else{_0x549f59=0xce;}_0x5f0379[_0x1d8c('0x1d')](_0x549f59);return _0x5f0379[_0x1d8c('0x24')]('Content-Range',_0x993b88+'-'+_0x2fb2fd+'/'+_0x426ace)[_0x1d8c('0x1f')](_0x13f534);}return null;};}function patchUpdates(_0x1c13ae){return function(_0x6a95d1){try{jsonpatch[_0x1d8c('0x25')](_0x6a95d1,_0x1c13ae,!![]);}catch(_0x4740e9){return BPromise[_0x1d8c('0x26')](_0x4740e9);}return _0x6a95d1[_0x1d8c('0x27')]();};}function saveUpdates(_0x3776f7,_0x3fc5a6){return function(_0x4e0404){if(_0x4e0404){return _0x4e0404[_0x1d8c('0x28')](_0x3776f7)[_0x1d8c('0x29')](function(_0x254978){return _0x254978;});}return null;};}function removeEntity(_0x27a478,_0xaa42a6){return function(_0x13352a){if(_0x13352a){return _0x13352a[_0x1d8c('0x2a')]()[_0x1d8c('0x29')](function(){_0x27a478[_0x1d8c('0x1d')](0xcc)[_0x1d8c('0x1e')]();});}};}function handleEntityNotFound(_0x3698c5,_0x2f34ef){return function(_0x152459){if(!_0x152459){_0x3698c5[_0x1d8c('0x2b')](0x194);}return _0x152459;};}function handleError(_0x4506e4,_0x443aaa){_0x443aaa=_0x443aaa||0x1f4;return function(_0x407025){logger[_0x1d8c('0x2c')](_0x407025[_0x1d8c('0x2d')]);if(_0x407025['name']){delete _0x407025[_0x1d8c('0x2e')];}_0x4506e4[_0x1d8c('0x1d')](_0x443aaa)[_0x1d8c('0x2f')](_0x407025);};}exports[_0x1d8c('0x30')]=function(_0x5021bd,_0x22bdb1){var _0x527c3c={},_0x4b47a9={},_0xc476a9={'count':0x0,'rows':[]};var _0x1fe602=_['map'](db[_0x1d8c('0x31')]['rawAttributes'],function(_0x51b394){return{'name':_0x51b394[_0x1d8c('0x32')],'type':_0x51b394[_0x1d8c('0x33')][_0x1d8c('0x34')]};});_0x4b47a9['model']=_[_0x1d8c('0x35')](_0x1fe602,'name');_0x4b47a9[_0x1d8c('0x36')]=_[_0x1d8c('0x37')](_0x5021bd[_0x1d8c('0x36')]);_0x4b47a9[_0x1d8c('0x38')]=_[_0x1d8c('0x39')](_0x4b47a9[_0x1d8c('0x3a')],_0x4b47a9['query']);_0x527c3c['attributes']=_[_0x1d8c('0x39')](_0x4b47a9[_0x1d8c('0x3a')],qs[_0x1d8c('0x3b')](_0x5021bd[_0x1d8c('0x36')][_0x1d8c('0x3b')]));_0x527c3c[_0x1d8c('0x3c')]=_0x527c3c['attributes'][_0x1d8c('0x3d')]?_0x527c3c[_0x1d8c('0x3c')]:_0x4b47a9['model'];if(!_0x5021bd[_0x1d8c('0x36')]['hasOwnProperty'](_0x1d8c('0x3e'))){_0x527c3c[_0x1d8c('0x23')]=qs['limit'](_0x5021bd[_0x1d8c('0x36')][_0x1d8c('0x23')]);_0x527c3c['offset']=qs[_0x1d8c('0x22')](_0x5021bd['query'][_0x1d8c('0x22')]);}_0x527c3c[_0x1d8c('0x3f')]=qs[_0x1d8c('0x40')](_0x5021bd['query'][_0x1d8c('0x40')]);_0x527c3c[_0x1d8c('0x41')]=qs[_0x1d8c('0x38')](_['pick'](_0x5021bd[_0x1d8c('0x36')],_0x4b47a9[_0x1d8c('0x38')]),_0x1fe602);if(_0x5021bd[_0x1d8c('0x36')][_0x1d8c('0x42')]){_0x527c3c[_0x1d8c('0x41')]=_[_0x1d8c('0x43')](_0x527c3c[_0x1d8c('0x41')],{'$or':_['map'](_0x1fe602,function(_0x3c156c){if(_0x3c156c[_0x1d8c('0x33')]!==_0x1d8c('0x44')){var _0x386b3b={};_0x386b3b[_0x3c156c[_0x1d8c('0x2e')]]={'$like':'%'+_0x5021bd['query'][_0x1d8c('0x42')]+'%'};return _0x386b3b;}})});}_0x527c3c=_[_0x1d8c('0x43')]({},_0x527c3c,_0x5021bd[_0x1d8c('0x45')]);var _0x116acc={'where':_0x527c3c[_0x1d8c('0x41')]};return db[_0x1d8c('0x31')][_0x1d8c('0x21')](_0x116acc)['then'](function(_0x35a005){_0xc476a9[_0x1d8c('0x21')]=_0x35a005;if(_0x5021bd[_0x1d8c('0x36')][_0x1d8c('0x46')]){_0x527c3c[_0x1d8c('0x47')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x1d8c('0x48')](_0x527c3c);})['then'](function(_0x57725e){_0xc476a9['rows']=_0x57725e;return _0xc476a9;})['then'](respondWithFilteredResult(_0x22bdb1,_0x527c3c))[_0x1d8c('0x49')](handleError(_0x22bdb1,null));};exports[_0x1d8c('0x4a')]=function(_0x2eacf6,_0x17a53e){var _0x31bbb1={'raw':![],'where':{'id':_0x2eacf6[_0x1d8c('0x4b')]['id']}},_0x49df85={};_0x49df85[_0x1d8c('0x3a')]=_[_0x1d8c('0x37')](db['VoiceQueueReport'][_0x1d8c('0x4c')]);_0x49df85[_0x1d8c('0x36')]=_[_0x1d8c('0x37')](_0x2eacf6['query']);_0x49df85[_0x1d8c('0x38')]=_[_0x1d8c('0x39')](_0x49df85[_0x1d8c('0x3a')],_0x49df85[_0x1d8c('0x36')]);_0x31bbb1[_0x1d8c('0x3c')]=_['intersection'](_0x49df85['model'],qs[_0x1d8c('0x3b')](_0x2eacf6[_0x1d8c('0x36')]['fields']));_0x31bbb1[_0x1d8c('0x3c')]=_0x31bbb1[_0x1d8c('0x3c')][_0x1d8c('0x3d')]?_0x31bbb1['attributes']:_0x49df85[_0x1d8c('0x3a')];if(_0x2eacf6[_0x1d8c('0x36')][_0x1d8c('0x46')]){_0x31bbb1[_0x1d8c('0x47')]=[{'all':!![]}];}_0x31bbb1=_[_0x1d8c('0x43')]({},_0x31bbb1,_0x2eacf6[_0x1d8c('0x45')]);return db[_0x1d8c('0x31')][_0x1d8c('0x4d')](_0x31bbb1)[_0x1d8c('0x29')](handleEntityNotFound(_0x17a53e,null))[_0x1d8c('0x29')](respondWithResult(_0x17a53e,null))[_0x1d8c('0x49')](handleError(_0x17a53e,null));};exports[_0x1d8c('0x4e')]=function(_0x2db5d7,_0x2245d2){return db[_0x1d8c('0x31')][_0x1d8c('0x4e')](_0x2db5d7['body'],{})[_0x1d8c('0x29')](respondWithResult(_0x2245d2,0xc9))[_0x1d8c('0x49')](handleError(_0x2245d2,null));};exports[_0x1d8c('0x28')]=function(_0x2eb727,_0x4f4ef8){if(_0x2eb727[_0x1d8c('0x4f')]['id']){delete _0x2eb727[_0x1d8c('0x4f')]['id'];}return db['VoiceQueueReport'][_0x1d8c('0x4d')]({'where':{'id':_0x2eb727['params']['id']}})[_0x1d8c('0x29')](handleEntityNotFound(_0x4f4ef8,null))[_0x1d8c('0x29')](saveUpdates(_0x2eb727[_0x1d8c('0x4f')],null))[_0x1d8c('0x29')](respondWithResult(_0x4f4ef8,null))[_0x1d8c('0x49')](handleError(_0x4f4ef8,null));};exports[_0x1d8c('0x2a')]=function(_0x2d1f8e,_0xb41043){return db[_0x1d8c('0x31')][_0x1d8c('0x4d')]({'where':{'id':_0x2d1f8e[_0x1d8c('0x4b')]['id']}})['then'](handleEntityNotFound(_0xb41043,null))[_0x1d8c('0x29')](removeEntity(_0xb41043,null))[_0x1d8c('0x49')](handleError(_0xb41043,null));};exports[_0x1d8c('0x50')]=function(_0x1f33cf,_0x3d36b2){return db[_0x1d8c('0x31')]['describe']()[_0x1d8c('0x29')](respondWithResult(_0x3d36b2,null))[_0x1d8c('0x49')](handleError(_0x3d36b2,null));};exports[_0x1d8c('0x51')]=function(_0x431e26,_0x5618e0){var _0x142c92={},_0xfdbd6a={},_0x28f1ac={'count':0x0,'rows':[]};_0xfdbd6a[_0x1d8c('0x3a')]=_[_0x1d8c('0x37')](db[_0x1d8c('0x31')][_0x1d8c('0x4c')]);_0xfdbd6a[_0x1d8c('0x36')]=_['keys'](_0x431e26[_0x1d8c('0x36')]);_0xfdbd6a[_0x1d8c('0x38')]=_[_0x1d8c('0x39')](_0xfdbd6a[_0x1d8c('0x3a')],_0xfdbd6a['query']);_0x142c92[_0x1d8c('0x3c')]=_['intersection'](_0xfdbd6a[_0x1d8c('0x3a')],qs[_0x1d8c('0x3b')](_0x431e26[_0x1d8c('0x36')][_0x1d8c('0x3b')]));_0x142c92[_0x1d8c('0x3c')]=_0x142c92[_0x1d8c('0x3c')][_0x1d8c('0x3d')]?_0x142c92[_0x1d8c('0x3c')]:_0xfdbd6a[_0x1d8c('0x3a')];if(!_0x431e26['query'][_0x1d8c('0x52')](_0x1d8c('0x3e'))){_0x142c92[_0x1d8c('0x23')]=qs[_0x1d8c('0x23')](_0x431e26['query'][_0x1d8c('0x23')]);_0x142c92[_0x1d8c('0x22')]=qs[_0x1d8c('0x22')](_0x431e26[_0x1d8c('0x36')]['offset']);}_0x142c92[_0x1d8c('0x3f')]=qs[_0x1d8c('0x40')](_0x431e26[_0x1d8c('0x36')][_0x1d8c('0x40')]);_0x142c92[_0x1d8c('0x41')]=qs[_0x1d8c('0x38')](_[_0x1d8c('0x53')](_0x431e26[_0x1d8c('0x36')],_0xfdbd6a[_0x1d8c('0x38')]));if(_0x431e26[_0x1d8c('0x36')][_0x1d8c('0x42')]){_0x142c92[_0x1d8c('0x41')]=_['merge'](_0x142c92[_0x1d8c('0x41')],{'$or':_[_0x1d8c('0x35')](_0x142c92[_0x1d8c('0x3c')],function(_0x4ebb98){var _0x152fd8={};_0x152fd8[_0x4ebb98]={'$like':'%'+_0x431e26[_0x1d8c('0x36')]['filter']+'%'};return _0x152fd8;})});}_0x142c92=_['merge']({},_0x142c92,_0x431e26['options']);var _0x35815e={'where':_0x142c92['where']};return db[_0x1d8c('0x31')][_0x1d8c('0x21')](_0x35815e)[_0x1d8c('0x29')](function(_0x3cb355){_0x28f1ac[_0x1d8c('0x21')]=_0x3cb355;if(_0x431e26[_0x1d8c('0x36')][_0x1d8c('0x46')]){_0x142c92[_0x1d8c('0x47')]=[{'all':!![]}];}return db[_0x1d8c('0x31')][_0x1d8c('0x48')](_0x142c92);})[_0x1d8c('0x29')](function(_0x73dbb5){_0x28f1ac[_0x1d8c('0x54')]=_0x73dbb5;return _0x28f1ac;})['then'](respondWithFilteredResult(_0x5618e0,_0x142c92,_0x1d8c('0x51')))['catch'](handleError(_0x5618e0,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 66e1c96..15be99b 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 _0xaabb=['hasOwnProperty','exports','events','../../mysqldb','save','emit'];(function(_0x1c48ef,_0x4da61b){var _0x4eab68=function(_0x31d40a){while(--_0x31d40a){_0x1c48ef['push'](_0x1c48ef['shift']());}};_0x4eab68(++_0x4da61b);}(_0xaabb,0x1e8));var _0xbaab=function(_0x497d8c,_0x2904c9){_0x497d8c=_0x497d8c-0x0;var _0xeafed7=_0xaabb[_0x497d8c];return _0xeafed7;};'use strict';var EventEmitter=require(_0xbaab('0x0'));var VoiceQueueReport=require(_0xbaab('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbaab('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3b71b1){return function(_0x1a4f3e,_0x24111f,_0x40f1d4){VoiceQueueReportEvents[_0xbaab('0x3')](_0x3b71b1+':'+_0x1a4f3e['id'],_0x1a4f3e);VoiceQueueReportEvents[_0xbaab('0x3')](_0x3b71b1,_0x1a4f3e);_0x40f1d4(null);};}for(var e in events){if(events[_0xbaab('0x4')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xbaab('0x5')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x61d0=['events','VoiceQueueReport','setMaxListeners','update','remove','emit','hook'];(function(_0x2c4807,_0x530003){var _0x55bb5f=function(_0x52b85a){while(--_0x52b85a){_0x2c4807['push'](_0x2c4807['shift']());}};_0x55bb5f(++_0x530003);}(_0x61d0,0x126));var _0x061d=function(_0x1633e9,_0x50a939){_0x1633e9=_0x1633e9-0x0;var _0x549ace=_0x61d0[_0x1633e9];return _0x549ace;};'use strict';var EventEmitter=require(_0x061d('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x061d('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x061d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x061d('0x3'),'afterDestroy':_0x061d('0x4')};function emitEvent(_0x46b944){return function(_0x5d5206,_0x339537,_0x3c1a28){VoiceQueueReportEvents['emit'](_0x46b944+':'+_0x5d5206['id'],_0x5d5206);VoiceQueueReportEvents[_0x061d('0x5')](_0x46b944,_0x5d5206);_0x3c1a28(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x061d('0x6')](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 ddd8e49..37b7d7d 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 _0x58f9=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceQueueReport','uniqueid','lodash'];(function(_0x404508,_0x349d8f){var _0x239f72=function(_0x4910fe){while(--_0x4910fe){_0x404508['push'](_0x404508['shift']());}};_0x239f72(++_0x349d8f);}(_0x58f9,0x1c2));var _0x958f=function(_0x58aa26,_0x5c8e2b){_0x58aa26=_0x58aa26-0x0;var _0x2769f5=_0x58f9[_0x58aa26];return _0x2769f5;};'use strict';var _=require(_0x958f('0x0'));var util=require(_0x958f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x958f('0x2'));var BPromise=require(_0x958f('0x3'));var rp=require(_0x958f('0x4'));var fs=require('fs');var path=require(_0x958f('0x5'));var rimraf=require(_0x958f('0x6'));var config=require(_0x958f('0x7'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x503428,_0x2b4bb0){return _0x503428[_0x958f('0x8')](_0x958f('0x9'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x958f('0xa')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa7c8=['../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x4cdd8b,_0x279175){var _0x589529=function(_0x837034){while(--_0x837034){_0x4cdd8b['push'](_0x4cdd8b['shift']());}};_0x589529(++_0x279175);}(_0xa7c8,0x77));var _0x8a7c=function(_0x14d70f,_0x56b0dc){_0x14d70f=_0x14d70f-0x0;var _0xd610b4=_0xa7c8[_0x14d70f];return _0xd610b4;};'use strict';var _=require(_0x8a7c('0x0'));var util=require(_0x8a7c('0x1'));var logger=require('../../config/logger')(_0x8a7c('0x2'));var moment=require(_0x8a7c('0x3'));var BPromise=require(_0x8a7c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a7c('0x5'));var rimraf=require(_0x8a7c('0x6'));var config=require(_0x8a7c('0x7'));var attributes=require(_0x8a7c('0x8'));module[_0x8a7c('0x9')]=function(_0x8ec8e5,_0x5c4999){return _0x8ec8e5['define'](_0x8a7c('0xa'),attributes,{'tableName':_0x8a7c('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8a7c('0xc')]},{'fields':[_0x8a7c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index bc586b8..9804804 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 _0x2d4b=['redis','localhost','socket.io-emitter','./voiceQueueReport.socket','request','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','include','model','map','then','stringify','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','raw','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x589878,_0x2ba51b){var _0x2cfad0=function(_0x1ca5a2){while(--_0x1ca5a2){_0x589878['push'](_0x589878['shift']());}};_0x2cfad0(++_0x2ba51b);}(_0x2d4b,0xe6));var _0xb2d4=function(_0x5ad688,_0x701b42){_0x5ad688=_0x5ad688-0x0;var _0x4eb1e6=_0x2d4b[_0x5ad688];return _0x4eb1e6;};'use strict';var _=require('lodash');var util=require(_0xb2d4('0x0'));var moment=require('moment');var BPromise=require(_0xb2d4('0x1'));var rs=require(_0xb2d4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb2d4('0x3'));var logger=require(_0xb2d4('0x4'))(_0xb2d4('0x5'));var config=require(_0xb2d4('0x6'));var jayson=require(_0xb2d4('0x7'));var client=jayson[_0xb2d4('0x8')][_0xb2d4('0x9')]({'port':0x232a});config[_0xb2d4('0xa')]=_['defaults'](config['redis'],{'host':_0xb2d4('0xb'),'port':0x18eb});var socket=require(_0xb2d4('0xc'))(new Redis(config[_0xb2d4('0xa')]));require(_0xb2d4('0xd'))['register'](socket);function respondWithRpcPromise(_0x269719,_0x183a95,_0x3c94c2){return new BPromise(function(_0x186de4,_0x8785c5){return client[_0xb2d4('0xe')](_0x269719,_0x3c94c2)['then'](function(_0x4ba4ad){logger['info'](_0xb2d4('0xf'),_0x183a95,_0xb2d4('0x10'));logger[_0xb2d4('0x11')](_0xb2d4('0x12'),_0x183a95,_0xb2d4('0x10'),JSON['stringify'](_0x4ba4ad));if(_0x4ba4ad[_0xb2d4('0x13')]){if(_0x4ba4ad['error']['code']===0x1f4){logger[_0xb2d4('0x13')](_0xb2d4('0xf'),_0x183a95,_0x4ba4ad[_0xb2d4('0x13')][_0xb2d4('0x14')]);return _0x8785c5(_0x4ba4ad['error'][_0xb2d4('0x14')]);}logger[_0xb2d4('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x183a95,_0x4ba4ad[_0xb2d4('0x13')][_0xb2d4('0x14')]);return _0x186de4(_0x4ba4ad[_0xb2d4('0x13')][_0xb2d4('0x14')]);}else{logger[_0xb2d4('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x183a95,'request\x20sent');_0x186de4(_0x4ba4ad[_0xb2d4('0x16')]['message']);}})['catch'](function(_0x6bf569){logger['error'](_0xb2d4('0xf'),_0x183a95,_0x6bf569);_0x8785c5(_0x6bf569);});});}exports[_0xb2d4('0x17')]=function(_0x6ead80){var _0x1874a1=this;return new Promise(function(_0x59571d,_0x581ef4){return db[_0xb2d4('0x18')][_0xb2d4('0x19')]({'raw':_0x6ead80[_0xb2d4('0x1a')]?_0x6ead80['options']['raw']===undefined?!![]:![]:!![],'where':_0x6ead80[_0xb2d4('0x1a')]?_0x6ead80[_0xb2d4('0x1a')][_0xb2d4('0x1b')]||null:null,'attributes':_0x6ead80[_0xb2d4('0x1a')]?_0x6ead80['options'][_0xb2d4('0x1c')]||null:null,'limit':_0x6ead80[_0xb2d4('0x1a')]?_0x6ead80[_0xb2d4('0x1a')][_0xb2d4('0x1d')]||null:null,'include':_0x6ead80[_0xb2d4('0x1a')]?_0x6ead80['options'][_0xb2d4('0x1e')]?_['map'](_0x6ead80[_0xb2d4('0x1a')][_0xb2d4('0x1e')],function(_0x110ac6){return{'model':db[_0x110ac6[_0xb2d4('0x1f')]],'as':_0x110ac6['as'],'attributes':_0x110ac6[_0xb2d4('0x1c')],'include':_0x110ac6[_0xb2d4('0x1e')]?_[_0xb2d4('0x20')](_0x110ac6['include'],function(_0x1d36ad){return{'model':db[_0x1d36ad[_0xb2d4('0x1f')]],'as':_0x1d36ad['as'],'attributes':_0x1d36ad[_0xb2d4('0x1c')],'include':_0x1d36ad['include']?_[_0xb2d4('0x20')](_0x1d36ad[_0xb2d4('0x1e')],function(_0x16809c){return{'model':db[_0x16809c[_0xb2d4('0x1f')]],'as':_0x16809c['as'],'attributes':_0x16809c[_0xb2d4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb2d4('0x21')](function(_0x5cd3a7){logger[_0xb2d4('0x15')]('GetVoiceQueueReport',_0x6ead80);logger['debug']('GetVoiceQueueReport',_0x6ead80,JSON[_0xb2d4('0x22')](_0x5cd3a7));_0x59571d(_0x5cd3a7);})['catch'](function(_0x5abdc0){logger[_0xb2d4('0x13')](_0xb2d4('0x17'),_0x5abdc0[_0xb2d4('0x14')],_0x6ead80);_0x581ef4(_0x1874a1[_0xb2d4('0x13')](0x1f4,_0x5abdc0[_0xb2d4('0x14')]));});});};exports[_0xb2d4('0x23')]=function(_0x4c1d38){var _0x10d658=this;return new Promise(function(_0x3b8d88,_0x3f6957){return db[_0xb2d4('0x18')]['create'](_0x4c1d38[_0xb2d4('0x24')],{'raw':_0x4c1d38[_0xb2d4('0x1a')]?_0x4c1d38['options']['raw']===undefined?!![]:![]:!![]})[_0xb2d4('0x21')](function(_0x19e7ac){logger[_0xb2d4('0x15')](_0xb2d4('0x23'),_0x4c1d38);logger['debug'](_0xb2d4('0x23'),_0x4c1d38,JSON[_0xb2d4('0x22')](_0x19e7ac));_0x3b8d88(_0x19e7ac);})['catch'](function(_0x54eb22){logger[_0xb2d4('0x13')](_0xb2d4('0x23'),_0x54eb22[_0xb2d4('0x14')],_0x4c1d38);_0x3f6957(_0x10d658['error'](0x1f4,_0x54eb22[_0xb2d4('0x14')]));});});};exports[_0xb2d4('0x25')]=function(_0x3edee8){var _0xdbcdde=this;return new Promise(function(_0xf7d2d6,_0x364e7b){return db[_0xb2d4('0x18')][_0xb2d4('0x26')](_0x3edee8[_0xb2d4('0x24')],{'raw':_0x3edee8[_0xb2d4('0x1a')]?_0x3edee8[_0xb2d4('0x1a')][_0xb2d4('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3edee8[_0xb2d4('0x1a')]?_0x3edee8[_0xb2d4('0x1a')]['where']||null:null,'attributes':_0x3edee8['options']?_0x3edee8[_0xb2d4('0x1a')][_0xb2d4('0x1c')]||null:null,'limit':_0x3edee8['options']?_0x3edee8[_0xb2d4('0x1a')][_0xb2d4('0x1d')]||null:null})[_0xb2d4('0x21')](function(_0x36e8c0){logger[_0xb2d4('0x15')](_0xb2d4('0x25'),_0x3edee8);logger[_0xb2d4('0x11')](_0xb2d4('0x25'),_0x3edee8,JSON[_0xb2d4('0x22')](_0x36e8c0));_0xf7d2d6(_0x36e8c0);})['catch'](function(_0x37c7cd){logger[_0xb2d4('0x13')](_0xb2d4('0x25'),_0x37c7cd[_0xb2d4('0x14')],_0x3edee8);_0x364e7b(_0xdbcdde[_0xb2d4('0x13')](0x1f4,_0x37c7cd[_0xb2d4('0x14')]));});});}; \ No newline at end of file +var _0xffd5=['register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueueReport','options','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','body','raw','debug','UpdateVoiceQueueReport','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xffd5,0x6a));var _0x5ffd=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0xffd5[_0x57975f];return _0x4793b8;};'use strict';var _=require(_0x5ffd('0x0'));var util=require('util');var moment=require(_0x5ffd('0x1'));var BPromise=require('bluebird');var rs=require(_0x5ffd('0x2'));var fs=require('fs');var Redis=require(_0x5ffd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ffd('0x4'));var logger=require('../../config/logger')(_0x5ffd('0x5'));var config=require(_0x5ffd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5ffd('0x7')][_0x5ffd('0x8')]({'port':0x232a});config[_0x5ffd('0x9')]=_[_0x5ffd('0xa')](config[_0x5ffd('0x9')],{'host':_0x5ffd('0xb'),'port':0x18eb});var socket=require(_0x5ffd('0xc'))(new Redis(config[_0x5ffd('0x9')]));require(_0x5ffd('0xd'))[_0x5ffd('0xe')](socket);function respondWithRpcPromise(_0x5ca185,_0x1e441b,_0x224ff7){return new BPromise(function(_0x1edfb1,_0x4b3c0c){return client['request'](_0x5ca185,_0x224ff7)[_0x5ffd('0xf')](function(_0x353627){logger[_0x5ffd('0x10')](_0x5ffd('0x11'),_0x1e441b,_0x5ffd('0x12'));logger['debug'](_0x5ffd('0x13'),_0x1e441b,'request\x20sent',JSON[_0x5ffd('0x14')](_0x353627));if(_0x353627[_0x5ffd('0x15')]){if(_0x353627[_0x5ffd('0x15')][_0x5ffd('0x16')]===0x1f4){logger[_0x5ffd('0x15')](_0x5ffd('0x11'),_0x1e441b,_0x353627['error'][_0x5ffd('0x17')]);return _0x4b3c0c(_0x353627[_0x5ffd('0x15')][_0x5ffd('0x17')]);}logger['error'](_0x5ffd('0x11'),_0x1e441b,_0x353627['error'][_0x5ffd('0x17')]);return _0x1edfb1(_0x353627[_0x5ffd('0x15')][_0x5ffd('0x17')]);}else{logger['info'](_0x5ffd('0x11'),_0x1e441b,_0x5ffd('0x12'));_0x1edfb1(_0x353627[_0x5ffd('0x18')][_0x5ffd('0x17')]);}})[_0x5ffd('0x19')](function(_0x1a3936){logger[_0x5ffd('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x1e441b,_0x1a3936);_0x4b3c0c(_0x1a3936);});});}exports['GetVoiceQueueReport']=function(_0x1a4823){var _0x35d34a=this;return new Promise(function(_0xc9ee49,_0x295441){return db[_0x5ffd('0x1a')]['findAll']({'raw':_0x1a4823[_0x5ffd('0x1b')]?_0x1a4823[_0x5ffd('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1a4823[_0x5ffd('0x1b')]?_0x1a4823[_0x5ffd('0x1b')][_0x5ffd('0x1c')]||null:null,'attributes':_0x1a4823[_0x5ffd('0x1b')]?_0x1a4823[_0x5ffd('0x1b')][_0x5ffd('0x1d')]||null:null,'limit':_0x1a4823['options']?_0x1a4823[_0x5ffd('0x1b')][_0x5ffd('0x1e')]||null:null,'include':_0x1a4823[_0x5ffd('0x1b')]?_0x1a4823['options'][_0x5ffd('0x1f')]?_[_0x5ffd('0x20')](_0x1a4823[_0x5ffd('0x1b')]['include'],function(_0x2d15af){return{'model':db[_0x2d15af['model']],'as':_0x2d15af['as'],'attributes':_0x2d15af[_0x5ffd('0x1d')],'include':_0x2d15af[_0x5ffd('0x1f')]?_['map'](_0x2d15af[_0x5ffd('0x1f')],function(_0x51fbe4){return{'model':db[_0x51fbe4[_0x5ffd('0x21')]],'as':_0x51fbe4['as'],'attributes':_0x51fbe4[_0x5ffd('0x1d')],'include':_0x51fbe4[_0x5ffd('0x1f')]?_['map'](_0x51fbe4[_0x5ffd('0x1f')],function(_0x229839){return{'model':db[_0x229839[_0x5ffd('0x21')]],'as':_0x229839['as'],'attributes':_0x229839[_0x5ffd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5ffd('0xf')](function(_0xb9d66f){logger[_0x5ffd('0x10')](_0x5ffd('0x22'),_0x1a4823);logger['debug'](_0x5ffd('0x22'),_0x1a4823,JSON[_0x5ffd('0x14')](_0xb9d66f));_0xc9ee49(_0xb9d66f);})[_0x5ffd('0x19')](function(_0x232f0a){logger[_0x5ffd('0x15')](_0x5ffd('0x22'),_0x232f0a[_0x5ffd('0x17')],_0x1a4823);_0x295441(_0x35d34a[_0x5ffd('0x15')](0x1f4,_0x232f0a[_0x5ffd('0x17')]));});});};exports[_0x5ffd('0x23')]=function(_0x41fdda){var _0x4ba443=this;return new Promise(function(_0x9b6125,_0x11ae26){return db['VoiceQueueReport']['create'](_0x41fdda[_0x5ffd('0x24')],{'raw':_0x41fdda[_0x5ffd('0x1b')]?_0x41fdda[_0x5ffd('0x1b')][_0x5ffd('0x25')]===undefined?!![]:![]:!![]})['then'](function(_0x86c63){logger[_0x5ffd('0x10')](_0x5ffd('0x23'),_0x41fdda);logger[_0x5ffd('0x26')](_0x5ffd('0x23'),_0x41fdda,JSON['stringify'](_0x86c63));_0x9b6125(_0x86c63);})[_0x5ffd('0x19')](function(_0x4d7f87){logger[_0x5ffd('0x15')]('CreateVoiceQueueReport',_0x4d7f87[_0x5ffd('0x17')],_0x41fdda);_0x11ae26(_0x4ba443['error'](0x1f4,_0x4d7f87[_0x5ffd('0x17')]));});});};exports['UpdateVoiceQueueReport']=function(_0x2f40ae){var _0x2ba931=this;return new Promise(function(_0x2dd9bd,_0xd51f5){return db[_0x5ffd('0x1a')]['update'](_0x2f40ae[_0x5ffd('0x24')],{'raw':_0x2f40ae[_0x5ffd('0x1b')]?_0x2f40ae['options'][_0x5ffd('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f40ae[_0x5ffd('0x1b')]?_0x2f40ae[_0x5ffd('0x1b')][_0x5ffd('0x1c')]||null:null,'attributes':_0x2f40ae[_0x5ffd('0x1b')]?_0x2f40ae[_0x5ffd('0x1b')][_0x5ffd('0x1d')]||null:null,'limit':_0x2f40ae[_0x5ffd('0x1b')]?_0x2f40ae['options'][_0x5ffd('0x1e')]||null:null})[_0x5ffd('0xf')](function(_0x490e1e){logger[_0x5ffd('0x10')](_0x5ffd('0x27'),_0x2f40ae);logger[_0x5ffd('0x26')](_0x5ffd('0x27'),_0x2f40ae,JSON[_0x5ffd('0x14')](_0x490e1e));_0x2dd9bd(_0x490e1e);})['catch'](function(_0x3ad6c1){logger[_0x5ffd('0x15')](_0x5ffd('0x27'),_0x3ad6c1[_0x5ffd('0x17')],_0x2f40ae);_0xd51f5(_0x2ba931[_0x5ffd('0x15')](0x1f4,_0x3ad6c1[_0x5ffd('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 0faf60e..6a6e6b9 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 _0x635c=['voiceQueueReport:','save','remove','update','emit','removeListener','register','length'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x635c,0xa1));var _0xc635=function(_0x574d28,_0x3b84d5){_0x574d28=_0x574d28-0x0;var _0x346763=_0x635c[_0x574d28];return _0x346763;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xc635('0x0'),_0xc635('0x1'),_0xc635('0x2')];function createListener(_0x2348d3,_0x55ecdd){return function(_0x43369a){_0x55ecdd[_0xc635('0x3')](_0x2348d3,_0x43369a);};}function removeListener(_0x326256,_0xfa846a){return function(){VoiceQueueReportEvents[_0xc635('0x4')](_0x326256,_0xfa846a);};}exports[_0xc635('0x5')]=function(_0x2c7a47){for(var _0x4dc933=0x0,_0x151c94=events[_0xc635('0x6')];_0x4dc933<_0x151c94;_0x4dc933++){var _0x4719ed=events[_0x4dc933];var _0x5a78e3=createListener(_0xc635('0x7')+_0x4719ed,_0x2c7a47);VoiceQueueReportEvents['on'](_0x4719ed,_0x5a78e3);}}; \ No newline at end of file +var _0x6dd1=['./voiceQueueReport.events','remove','update','emit','removeListener','register','voiceQueueReport:'];(function(_0x46f44e,_0x22ed75){var _0x5dd889=function(_0x437773){while(--_0x437773){_0x46f44e['push'](_0x46f44e['shift']());}};_0x5dd889(++_0x22ed75);}(_0x6dd1,0x111));var _0x16dd=function(_0x313567,_0x3a4c38){_0x313567=_0x313567-0x0;var _0x446f1a=_0x6dd1[_0x313567];return _0x446f1a;};'use strict';var VoiceQueueReportEvents=require(_0x16dd('0x0'));var events=['save',_0x16dd('0x1'),_0x16dd('0x2')];function createListener(_0x5b01ea,_0x3dbe50){return function(_0x283f1f){_0x3dbe50[_0x16dd('0x3')](_0x5b01ea,_0x283f1f);};}function removeListener(_0x3b2fd2,_0x369ea0){return function(){VoiceQueueReportEvents[_0x16dd('0x4')](_0x3b2fd2,_0x369ea0);};}exports[_0x16dd('0x5')]=function(_0x127878){for(var _0x370f0e=0x0,_0x4f532c=events['length'];_0x370f0e<_0x4f532c;_0x370f0e++){var _0x5ad29a=events[_0x370f0e];var _0x490566=createListener(_0x16dd('0x6')+_0x5ad29a,_0x127878);VoiceQueueReportEvents['on'](_0x5ad29a,_0x490566);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 705110d..6217159 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 _0x64d9=['get','index','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x453c52,_0x1f0e31){var _0x4d537b=function(_0x1a61db){while(--_0x1a61db){_0x453c52['push'](_0x453c52['shift']());}};_0x4d537b(++_0x1f0e31);}(_0x64d9,0x1d9));var _0x964d=function(_0x5d909b,_0x52a592){_0x5d909b=_0x5d909b-0x0;var _0x888e34=_0x64d9[_0x5d909b];return _0x888e34;};'use strict';var multer=require(_0x964d('0x0'));var util=require(_0x964d('0x1'));var path=require(_0x964d('0x2'));var timeout=require(_0x964d('0x3'));var express=require(_0x964d('0x4'));var router=express['Router']();var fs_extra=require(_0x964d('0x5'));var auth=require(_0x964d('0x6'));var interaction=require(_0x964d('0x7'));var config=require(_0x964d('0x8'));var controller=require(_0x964d('0x9'));router[_0x964d('0xa')]('/',auth['isAuthenticated'](),controller[_0x964d('0xb')]);router[_0x964d('0xa')]('/:id',auth[_0x964d('0xc')](),controller[_0x964d('0xd')]);router[_0x964d('0xe')]('/',auth[_0x964d('0xc')](),controller[_0x964d('0xf')]);router[_0x964d('0x10')](_0x964d('0x11'),auth[_0x964d('0xc')](),controller['update']);router[_0x964d('0x12')]('/:id',auth[_0x964d('0xc')](),controller[_0x964d('0x13')]);module[_0x964d('0x14')]=router; \ No newline at end of file +var _0x9e1d=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x93e0ee,_0x1ab118){var _0x34c50e=function(_0x3086b6){while(--_0x3086b6){_0x93e0ee['push'](_0x93e0ee['shift']());}};_0x34c50e(++_0x1ab118);}(_0x9e1d,0x12e));var _0xd9e1=function(_0x30a194,_0x3b71ea){_0x30a194=_0x30a194-0x0;var _0x4ae949=_0x9e1d[_0x30a194];return _0x4ae949;};'use strict';var multer=require(_0xd9e1('0x0'));var util=require(_0xd9e1('0x1'));var path=require(_0xd9e1('0x2'));var timeout=require(_0xd9e1('0x3'));var express=require('express');var router=express[_0xd9e1('0x4')]();var fs_extra=require(_0xd9e1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd9e1('0x6'));var config=require(_0xd9e1('0x7'));var controller=require(_0xd9e1('0x8'));router[_0xd9e1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd9e1('0x9')]('/:id',auth[_0xd9e1('0xa')](),controller[_0xd9e1('0xb')]);router[_0xd9e1('0xc')]('/',auth['isAuthenticated'](),controller[_0xd9e1('0xd')]);router[_0xd9e1('0xe')](_0xd9e1('0xf'),auth[_0xd9e1('0xa')](),controller[_0xd9e1('0x10')]);router[_0xd9e1('0x11')]('/:id',auth[_0xd9e1('0xa')](),controller[_0xd9e1('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 3a66943..7a08e5f 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 _0xaa55=['DATE','sequelize','moment','exports','STRING'];(function(_0x305bbf,_0x5647b3){var _0x4ed772=function(_0x3315ed){while(--_0x3315ed){_0x305bbf['push'](_0x305bbf['shift']());}};_0x4ed772(++_0x5647b3);}(_0xaa55,0x9c));var _0x5aa5=function(_0x2f6ed3,_0xaff355){_0x2f6ed3=_0x2f6ed3-0x0;var _0x3720f4=_0xaa55[_0x2f6ed3];return _0x3720f4;};'use strict';var Sequelize=require(_0x5aa5('0x0'));var moment=require(_0x5aa5('0x1'));module[_0x5aa5('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x5aa5('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5aa5('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5aa5('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5aa5('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x5aa5('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x5aa5('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5aa5('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5aa5('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5aa5('0x4')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x9f83=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports'];(function(_0x4fd51c,_0x212fca){var _0xde5b62=function(_0x2b865c){while(--_0x2b865c){_0x4fd51c['push'](_0x4fd51c['shift']());}};_0xde5b62(++_0x212fca);}(_0x9f83,0x1ac));var _0x39f8=function(_0x464e35,_0x5c5eb8){_0x464e35=_0x464e35-0x0;var _0x5138ee=_0x9f83[_0x464e35];return _0x5138ee;};'use strict';var Sequelize=require(_0x39f8('0x0'));var moment=require('moment');module[_0x39f8('0x1')]={'time':{'type':Sequelize[_0x39f8('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x39f8('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x39f8('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x39f8('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x39f8('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x39f8('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x39f8('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x39f8('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x39f8('0x3')](_0x39f8('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index a5e9f94..a584b3d 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 _0xe52d=['fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueuesLog','includeAll','include','rows','catch','show','params','length','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','reject','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection'];(function(_0x25b709,_0x29a164){var _0x3c4a68=function(_0x4713a5){while(--_0x4713a5){_0x25b709['push'](_0x25b709['shift']());}};_0x3c4a68(++_0x29a164);}(_0xe52d,0x17e));var _0xde52=function(_0x269a41,_0x4138e7){_0x269a41=_0x269a41-0x0;var _0x250756=_0xe52d[_0x269a41];return _0x250756;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xde52('0x0'));var zipdir=require(_0xde52('0x1'));var jsonpatch=require(_0xde52('0x2'));var rp=require(_0xde52('0x3'));var moment=require('moment');var BPromise=require(_0xde52('0x4'));var Mustache=require(_0xde52('0x5'));var util=require(_0xde52('0x6'));var path=require(_0xde52('0x7'));var sox=require(_0xde52('0x8'));var csv=require(_0xde52('0x9'));var ejs=require(_0xde52('0xa'));var fs=require('fs');var fs_extra=require(_0xde52('0xb'));var _=require(_0xde52('0xc'));var squel=require('squel');var crypto=require(_0xde52('0xd'));var jsforce=require(_0xde52('0xe'));var deskjs=require(_0xde52('0xf'));var toCsv=require('to-csv');var querystring=require(_0xde52('0x10'));var Papa=require(_0xde52('0x11'));var Redis=require('ioredis');var authService=require(_0xde52('0x12'));var qs=require(_0xde52('0x13'));var as=require(_0xde52('0x14'));var hardwareService=require(_0xde52('0x15'));var logger=require('../../config/logger')(_0xde52('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xde52('0x17'))['db'];function respondWithStatusCode(_0x5aac4d,_0x3b01dd){_0x3b01dd=_0x3b01dd||0xcc;return function(_0x10ee56){if(_0x10ee56){return _0x5aac4d[_0xde52('0x18')](_0x3b01dd);}return _0x5aac4d['status'](_0x3b01dd)[_0xde52('0x19')]();};}function respondWithResult(_0x132804,_0x2066e9){_0x2066e9=_0x2066e9||0xc8;return function(_0x6c093d){if(_0x6c093d){return _0x132804['status'](_0x2066e9)[_0xde52('0x1a')](_0x6c093d);}};}function respondWithFilteredResult(_0x16a8e3,_0x445dda){return function(_0x2f98fc){if(_0x2f98fc){var _0x390eda=typeof _0x445dda[_0xde52('0x1b')]===_0xde52('0x1c')&&typeof _0x445dda[_0xde52('0x1d')]===_0xde52('0x1c');var _0x4ed929=_0x2f98fc[_0xde52('0x1e')];var _0x566e8c=_0x390eda?0x0:_0x445dda[_0xde52('0x1b')];var _0x3c8710=_0x390eda?_0x2f98fc[_0xde52('0x1e')]:_0x445dda[_0xde52('0x1b')]+_0x445dda[_0xde52('0x1d')];var _0x38c30a;if(_0x3c8710>=_0x4ed929){_0x3c8710=_0x4ed929;_0x38c30a=0xc8;}else{_0x38c30a=0xce;}_0x16a8e3[_0xde52('0x1f')](_0x38c30a);return _0x16a8e3['set']('Content-Range',_0x566e8c+'-'+_0x3c8710+'/'+_0x4ed929)['json'](_0x2f98fc);}return null;};}function patchUpdates(_0x38ff32){return function(_0xc570fb){try{jsonpatch['apply'](_0xc570fb,_0x38ff32,!![]);}catch(_0x1c7da7){return BPromise[_0xde52('0x20')](_0x1c7da7);}return _0xc570fb['save']();};}function saveUpdates(_0x204de8,_0x1594a0){return function(_0x47b347){if(_0x47b347){return _0x47b347[_0xde52('0x21')](_0x204de8)[_0xde52('0x22')](function(_0x599eca){return _0x599eca;});}return null;};}function removeEntity(_0x4a789f,_0x1109e0){return function(_0x56fd99){if(_0x56fd99){return _0x56fd99['destroy']()[_0xde52('0x22')](function(){_0x4a789f[_0xde52('0x1f')](0xcc)[_0xde52('0x19')]();});}};}function handleEntityNotFound(_0x2a6062,_0x33f379){return function(_0xc076d5){if(!_0xc076d5){_0x2a6062[_0xde52('0x18')](0x194);}return _0xc076d5;};}function handleError(_0x52d078,_0x52dc76){_0x52dc76=_0x52dc76||0x1f4;return function(_0x2c1859){logger[_0xde52('0x23')](_0x2c1859[_0xde52('0x24')]);if(_0x2c1859[_0xde52('0x25')]){delete _0x2c1859[_0xde52('0x25')];}_0x52d078[_0xde52('0x1f')](_0x52dc76)[_0xde52('0x26')](_0x2c1859);};}exports[_0xde52('0x27')]=function(_0x4321ea,_0x23c4bd){var _0x29354e={},_0x308193={},_0x3c48fb={'count':0x0,'rows':[]};var _0x38cea8=_['map'](db['VoiceQueuesLog'][_0xde52('0x28')],function(_0x28a55b){return{'name':_0x28a55b[_0xde52('0x29')],'type':_0x28a55b[_0xde52('0x2a')][_0xde52('0x2b')]};});_0x308193[_0xde52('0x2c')]=_[_0xde52('0x2d')](_0x38cea8,_0xde52('0x25'));_0x308193[_0xde52('0x2e')]=_[_0xde52('0x2f')](_0x4321ea[_0xde52('0x2e')]);_0x308193[_0xde52('0x30')]=_[_0xde52('0x31')](_0x308193[_0xde52('0x2c')],_0x308193[_0xde52('0x2e')]);_0x29354e['attributes']=_[_0xde52('0x31')](_0x308193[_0xde52('0x2c')],qs[_0xde52('0x32')](_0x4321ea[_0xde52('0x2e')][_0xde52('0x32')]));_0x29354e[_0xde52('0x33')]=_0x29354e[_0xde52('0x33')]['length']?_0x29354e[_0xde52('0x33')]:_0x308193[_0xde52('0x2c')];if(!_0x4321ea[_0xde52('0x2e')]['hasOwnProperty'](_0xde52('0x34'))){_0x29354e[_0xde52('0x1d')]=qs[_0xde52('0x1d')](_0x4321ea[_0xde52('0x2e')]['limit']);_0x29354e[_0xde52('0x1b')]=qs[_0xde52('0x1b')](_0x4321ea[_0xde52('0x2e')]['offset']);}_0x29354e['order']=qs[_0xde52('0x35')](_0x4321ea[_0xde52('0x2e')][_0xde52('0x35')]);_0x29354e[_0xde52('0x36')]=qs['filters'](_[_0xde52('0x37')](_0x4321ea['query'],_0x308193['filters']),_0x38cea8);if(_0x4321ea[_0xde52('0x2e')][_0xde52('0x38')]){_0x29354e[_0xde52('0x36')]=_[_0xde52('0x39')](_0x29354e[_0xde52('0x36')],{'$or':_[_0xde52('0x2d')](_0x38cea8,function(_0x3b5b61){if(_0x3b5b61[_0xde52('0x2a')]!==_0xde52('0x3a')){var _0x4b43d8={};_0x4b43d8[_0x3b5b61['name']]={'$like':'%'+_0x4321ea['query']['filter']+'%'};return _0x4b43d8;}})});}_0x29354e=_[_0xde52('0x39')]({},_0x29354e,_0x4321ea[_0xde52('0x3b')]);var _0x3825ac={'where':_0x29354e[_0xde52('0x36')]};return db[_0xde52('0x3c')]['count'](_0x3825ac)[_0xde52('0x22')](function(_0x571149){_0x3c48fb[_0xde52('0x1e')]=_0x571149;if(_0x4321ea['query'][_0xde52('0x3d')]){_0x29354e[_0xde52('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x29354e);})[_0xde52('0x22')](function(_0x132c53){_0x3c48fb[_0xde52('0x3f')]=_0x132c53;return _0x3c48fb;})[_0xde52('0x22')](respondWithFilteredResult(_0x23c4bd,_0x29354e))[_0xde52('0x40')](handleError(_0x23c4bd,null));};exports[_0xde52('0x41')]=function(_0x2bdadc,_0x580e50){var _0x482124={'raw':!![],'where':{'id':_0x2bdadc[_0xde52('0x42')]['id']}},_0x1878f4={};_0x1878f4['model']=_[_0xde52('0x2f')](db[_0xde52('0x3c')][_0xde52('0x28')]);_0x1878f4['query']=_['keys'](_0x2bdadc[_0xde52('0x2e')]);_0x1878f4[_0xde52('0x30')]=_[_0xde52('0x31')](_0x1878f4['model'],_0x1878f4[_0xde52('0x2e')]);_0x482124[_0xde52('0x33')]=_['intersection'](_0x1878f4[_0xde52('0x2c')],qs[_0xde52('0x32')](_0x2bdadc[_0xde52('0x2e')][_0xde52('0x32')]));_0x482124[_0xde52('0x33')]=_0x482124['attributes'][_0xde52('0x43')]?_0x482124[_0xde52('0x33')]:_0x1878f4[_0xde52('0x2c')];if(_0x2bdadc[_0xde52('0x2e')][_0xde52('0x3d')]){_0x482124['include']=[{'all':!![]}];}_0x482124=_[_0xde52('0x39')]({},_0x482124,_0x2bdadc['options']);return db[_0xde52('0x3c')][_0xde52('0x44')](_0x482124)['then'](handleEntityNotFound(_0x580e50,null))[_0xde52('0x22')](respondWithResult(_0x580e50,null))['catch'](handleError(_0x580e50,null));};exports[_0xde52('0x45')]=function(_0x591ded,_0x487c74){return db['VoiceQueuesLog'][_0xde52('0x45')](_0x591ded['body'],{})['then'](respondWithResult(_0x487c74,0xc9))[_0xde52('0x40')](handleError(_0x487c74,null));};exports[_0xde52('0x21')]=function(_0x42e36c,_0x124ba9){if(_0x42e36c[_0xde52('0x46')]['id']){delete _0x42e36c[_0xde52('0x46')]['id'];}return db[_0xde52('0x3c')][_0xde52('0x44')]({'where':{'id':_0x42e36c[_0xde52('0x42')]['id']}})[_0xde52('0x22')](handleEntityNotFound(_0x124ba9,null))[_0xde52('0x22')](saveUpdates(_0x42e36c['body'],null))['then'](respondWithResult(_0x124ba9,null))['catch'](handleError(_0x124ba9,null));};exports[_0xde52('0x47')]=function(_0x214222,_0x156336){return db[_0xde52('0x3c')][_0xde52('0x44')]({'where':{'id':_0x214222['params']['id']}})[_0xde52('0x22')](handleEntityNotFound(_0x156336,null))[_0xde52('0x22')](removeEntity(_0x156336,null))[_0xde52('0x40')](handleError(_0x156336,null));}; \ No newline at end of file +var _0x4dcf=['includeAll','find','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','nolimit','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','length'];(function(_0x35cabc,_0xc0f89a){var _0x2af2b9=function(_0x7490fb){while(--_0x7490fb){_0x35cabc['push'](_0x35cabc['shift']());}};_0x2af2b9(++_0xc0f89a);}(_0x4dcf,0x92));var _0xf4dc=function(_0x45cdf0,_0x45cc99){_0x45cdf0=_0x45cdf0-0x0;var _0xdd4924=_0x4dcf[_0x45cdf0];return _0xdd4924;};'use strict';var emlformat=require(_0xf4dc('0x0'));var rimraf=require(_0xf4dc('0x1'));var zipdir=require(_0xf4dc('0x2'));var jsonpatch=require(_0xf4dc('0x3'));var rp=require(_0xf4dc('0x4'));var moment=require(_0xf4dc('0x5'));var BPromise=require(_0xf4dc('0x6'));var Mustache=require(_0xf4dc('0x7'));var util=require(_0xf4dc('0x8'));var path=require(_0xf4dc('0x9'));var sox=require(_0xf4dc('0xa'));var csv=require(_0xf4dc('0xb'));var ejs=require(_0xf4dc('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4dc('0xd'));var squel=require(_0xf4dc('0xe'));var crypto=require(_0xf4dc('0xf'));var jsforce=require(_0xf4dc('0x10'));var deskjs=require(_0xf4dc('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf4dc('0x12'));var Papa=require('papaparse');var Redis=require(_0xf4dc('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf4dc('0x14'));var as=require(_0xf4dc('0x15'));var hardwareService=require(_0xf4dc('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x238e03,_0x32bbef){_0x32bbef=_0x32bbef||0xcc;return function(_0x65ba20){if(_0x65ba20){return _0x238e03[_0xf4dc('0x17')](_0x32bbef);}return _0x238e03[_0xf4dc('0x18')](_0x32bbef)[_0xf4dc('0x19')]();};}function respondWithResult(_0x447648,_0x4f36ce){_0x4f36ce=_0x4f36ce||0xc8;return function(_0x38cbd3){if(_0x38cbd3){return _0x447648['status'](_0x4f36ce)[_0xf4dc('0x1a')](_0x38cbd3);}};}function respondWithFilteredResult(_0x33e811,_0x2a97d1){return function(_0x4b9363){if(_0x4b9363){var _0x3ef7a9=typeof _0x2a97d1[_0xf4dc('0x1b')]==='undefined'&&typeof _0x2a97d1[_0xf4dc('0x1c')]===_0xf4dc('0x1d');var _0x3348bd=_0x4b9363[_0xf4dc('0x1e')];var _0x7a888e=_0x3ef7a9?0x0:_0x2a97d1['offset'];var _0x3334fc=_0x3ef7a9?_0x4b9363[_0xf4dc('0x1e')]:_0x2a97d1[_0xf4dc('0x1b')]+_0x2a97d1[_0xf4dc('0x1c')];var _0x56020b;if(_0x3334fc>=_0x3348bd){_0x3334fc=_0x3348bd;_0x56020b=0xc8;}else{_0x56020b=0xce;}_0x33e811[_0xf4dc('0x18')](_0x56020b);return _0x33e811[_0xf4dc('0x1f')](_0xf4dc('0x20'),_0x7a888e+'-'+_0x3334fc+'/'+_0x3348bd)[_0xf4dc('0x1a')](_0x4b9363);}return null;};}function patchUpdates(_0x5f2bff){return function(_0x350adb){try{jsonpatch[_0xf4dc('0x21')](_0x350adb,_0x5f2bff,!![]);}catch(_0x8d897d){return BPromise['reject'](_0x8d897d);}return _0x350adb[_0xf4dc('0x22')]();};}function saveUpdates(_0x50cd3b,_0x58e89e){return function(_0x4b01ae){if(_0x4b01ae){return _0x4b01ae['update'](_0x50cd3b)['then'](function(_0x1ed608){return _0x1ed608;});}return null;};}function removeEntity(_0xbfe9b5,_0x5628a){return function(_0x217cc1){if(_0x217cc1){return _0x217cc1[_0xf4dc('0x23')]()[_0xf4dc('0x24')](function(){_0xbfe9b5[_0xf4dc('0x18')](0xcc)[_0xf4dc('0x19')]();});}};}function handleEntityNotFound(_0x3c0a9c,_0xad0c3f){return function(_0x5807ab){if(!_0x5807ab){_0x3c0a9c['sendStatus'](0x194);}return _0x5807ab;};}function handleError(_0x591766,_0xc640f5){_0xc640f5=_0xc640f5||0x1f4;return function(_0x3d38bc){logger[_0xf4dc('0x25')](_0x3d38bc[_0xf4dc('0x26')]);if(_0x3d38bc[_0xf4dc('0x27')]){delete _0x3d38bc['name'];}_0x591766[_0xf4dc('0x18')](_0xc640f5)[_0xf4dc('0x28')](_0x3d38bc);};}exports[_0xf4dc('0x29')]=function(_0x234a17,_0x531e5c){var _0xe45e={},_0x16b98e={},_0x25b764={'count':0x0,'rows':[]};var _0xa58510=_['map'](db[_0xf4dc('0x2a')][_0xf4dc('0x2b')],function(_0x387dce){return{'name':_0x387dce[_0xf4dc('0x2c')],'type':_0x387dce[_0xf4dc('0x2d')]['key']};});_0x16b98e[_0xf4dc('0x2e')]=_[_0xf4dc('0x2f')](_0xa58510,_0xf4dc('0x27'));_0x16b98e['query']=_[_0xf4dc('0x30')](_0x234a17[_0xf4dc('0x31')]);_0x16b98e[_0xf4dc('0x32')]=_[_0xf4dc('0x33')](_0x16b98e[_0xf4dc('0x2e')],_0x16b98e[_0xf4dc('0x31')]);_0xe45e[_0xf4dc('0x34')]=_[_0xf4dc('0x33')](_0x16b98e[_0xf4dc('0x2e')],qs[_0xf4dc('0x35')](_0x234a17[_0xf4dc('0x31')][_0xf4dc('0x35')]));_0xe45e[_0xf4dc('0x34')]=_0xe45e['attributes']['length']?_0xe45e[_0xf4dc('0x34')]:_0x16b98e[_0xf4dc('0x2e')];if(!_0x234a17[_0xf4dc('0x31')]['hasOwnProperty'](_0xf4dc('0x36'))){_0xe45e['limit']=qs[_0xf4dc('0x1c')](_0x234a17['query'][_0xf4dc('0x1c')]);_0xe45e['offset']=qs[_0xf4dc('0x1b')](_0x234a17[_0xf4dc('0x31')][_0xf4dc('0x1b')]);}_0xe45e['order']=qs['sort'](_0x234a17['query'][_0xf4dc('0x37')]);_0xe45e['where']=qs[_0xf4dc('0x32')](_['pick'](_0x234a17[_0xf4dc('0x31')],_0x16b98e[_0xf4dc('0x32')]),_0xa58510);if(_0x234a17[_0xf4dc('0x31')][_0xf4dc('0x38')]){_0xe45e[_0xf4dc('0x39')]=_[_0xf4dc('0x3a')](_0xe45e[_0xf4dc('0x39')],{'$or':_[_0xf4dc('0x2f')](_0xa58510,function(_0x5c49dc){if(_0x5c49dc[_0xf4dc('0x2d')]!==_0xf4dc('0x3b')){var _0x3d3d32={};_0x3d3d32[_0x5c49dc['name']]={'$like':'%'+_0x234a17[_0xf4dc('0x31')]['filter']+'%'};return _0x3d3d32;}})});}_0xe45e=_[_0xf4dc('0x3a')]({},_0xe45e,_0x234a17[_0xf4dc('0x3c')]);var _0x1b031e={'where':_0xe45e[_0xf4dc('0x39')]};return db[_0xf4dc('0x2a')]['count'](_0x1b031e)[_0xf4dc('0x24')](function(_0x1867f6){_0x25b764[_0xf4dc('0x1e')]=_0x1867f6;if(_0x234a17['query']['includeAll']){_0xe45e[_0xf4dc('0x3d')]=[{'all':!![]}];}return db[_0xf4dc('0x2a')][_0xf4dc('0x3e')](_0xe45e);})['then'](function(_0x34581e){_0x25b764[_0xf4dc('0x3f')]=_0x34581e;return _0x25b764;})[_0xf4dc('0x24')](respondWithFilteredResult(_0x531e5c,_0xe45e))[_0xf4dc('0x40')](handleError(_0x531e5c,null));};exports['show']=function(_0x4d52d0,_0x2f7708){var _0x3df952={'raw':!![],'where':{'id':_0x4d52d0[_0xf4dc('0x41')]['id']}},_0x2c973e={};_0x2c973e['model']=_[_0xf4dc('0x30')](db[_0xf4dc('0x2a')]['rawAttributes']);_0x2c973e[_0xf4dc('0x31')]=_[_0xf4dc('0x30')](_0x4d52d0[_0xf4dc('0x31')]);_0x2c973e[_0xf4dc('0x32')]=_[_0xf4dc('0x33')](_0x2c973e[_0xf4dc('0x2e')],_0x2c973e[_0xf4dc('0x31')]);_0x3df952[_0xf4dc('0x34')]=_[_0xf4dc('0x33')](_0x2c973e[_0xf4dc('0x2e')],qs['fields'](_0x4d52d0[_0xf4dc('0x31')][_0xf4dc('0x35')]));_0x3df952['attributes']=_0x3df952[_0xf4dc('0x34')][_0xf4dc('0x42')]?_0x3df952[_0xf4dc('0x34')]:_0x2c973e[_0xf4dc('0x2e')];if(_0x4d52d0['query'][_0xf4dc('0x43')]){_0x3df952['include']=[{'all':!![]}];}_0x3df952=_['merge']({},_0x3df952,_0x4d52d0[_0xf4dc('0x3c')]);return db[_0xf4dc('0x2a')][_0xf4dc('0x44')](_0x3df952)[_0xf4dc('0x24')](handleEntityNotFound(_0x2f7708,null))[_0xf4dc('0x24')](respondWithResult(_0x2f7708,null))[_0xf4dc('0x40')](handleError(_0x2f7708,null));};exports['create']=function(_0x2265c2,_0x1011e7){return db['VoiceQueuesLog']['create'](_0x2265c2[_0xf4dc('0x45')],{})[_0xf4dc('0x24')](respondWithResult(_0x1011e7,0xc9))[_0xf4dc('0x40')](handleError(_0x1011e7,null));};exports[_0xf4dc('0x46')]=function(_0x1ada4d,_0x256626){if(_0x1ada4d[_0xf4dc('0x45')]['id']){delete _0x1ada4d[_0xf4dc('0x45')]['id'];}return db[_0xf4dc('0x2a')][_0xf4dc('0x44')]({'where':{'id':_0x1ada4d[_0xf4dc('0x41')]['id']}})[_0xf4dc('0x24')](handleEntityNotFound(_0x256626,null))[_0xf4dc('0x24')](saveUpdates(_0x1ada4d[_0xf4dc('0x45')],null))['then'](respondWithResult(_0x256626,null))[_0xf4dc('0x40')](handleError(_0x256626,null));};exports['destroy']=function(_0x22c6b4,_0x39c3b1){return db[_0xf4dc('0x2a')][_0xf4dc('0x44')]({'where':{'id':_0x22c6b4['params']['id']}})['then'](handleEntityNotFound(_0x39c3b1,null))[_0xf4dc('0x24')](removeEntity(_0x39c3b1,null))['catch'](handleError(_0x39c3b1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 0ac1478..d366001 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 _0xb4fc=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','voice_queues_log','event_dtm','event','util','../../config/logger','api','moment'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0xb4fc,0xdd));var _0xcb4f=function(_0x100904,_0x321e59){_0x100904=_0x100904-0x0;var _0x508326=_0xb4fc[_0x100904];return _0x508326;};'use strict';var _=require('lodash');var util=require(_0xcb4f('0x0'));var logger=require(_0xcb4f('0x1'))(_0xcb4f('0x2'));var moment=require(_0xcb4f('0x3'));var BPromise=require(_0xcb4f('0x4'));var rp=require(_0xcb4f('0x5'));var fs=require('fs');var path=require(_0xcb4f('0x6'));var rimraf=require(_0xcb4f('0x7'));var config=require(_0xcb4f('0x8'));var attributes=require(_0xcb4f('0x9'));module[_0xcb4f('0xa')]=function(_0x1ee1ee,_0x39d77a){return _0x1ee1ee[_0xcb4f('0xb')]('VoiceQueuesLog',attributes,{'tableName':_0xcb4f('0xc'),'paranoid':![],'indexes':[{'name':_0xcb4f('0xd'),'fields':[_0xcb4f('0xe'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x4145=['VoiceQueuesLog','event','util','../../config/logger','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','define'];(function(_0x26b622,_0x237e9e){var _0x58a028=function(_0xde1652){while(--_0xde1652){_0x26b622['push'](_0x26b622['shift']());}};_0x58a028(++_0x237e9e);}(_0x4145,0x16a));var _0x5414=function(_0x1179a7,_0x17ffa2){_0x1179a7=_0x1179a7-0x0;var _0x5e181a=_0x4145[_0x1179a7];return _0x5e181a;};'use strict';var _=require('lodash');var util=require(_0x5414('0x0'));var logger=require(_0x5414('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5414('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5414('0x3'));var config=require(_0x5414('0x4'));var attributes=require(_0x5414('0x5'));module['exports']=function(_0x162af9,_0x5834b0){return _0x162af9[_0x5414('0x6')](_0x5414('0x7'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x5414('0x8'),'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 8543fe6..ff54f4f 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 _0x20a9=['info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','then'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x20a9,0x14f));var _0x920a=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x20a9[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x920a('0x0'));var util=require(_0x920a('0x1'));var moment=require(_0x920a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x920a('0x3'))['db'];var utils=require(_0x920a('0x4'));var logger=require('../../config/logger')(_0x920a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7e6ff6,_0x17b474,_0x1352d2){return new BPromise(function(_0x171859,_0x5992c1){return client['request'](_0x7e6ff6,_0x1352d2)[_0x920a('0x6')](function(_0x324b94){logger[_0x920a('0x7')](_0x920a('0x8'),_0x17b474,_0x920a('0x9'));logger[_0x920a('0xa')](_0x920a('0xb'),_0x17b474,_0x920a('0x9'),JSON[_0x920a('0xc')](_0x324b94));if(_0x324b94[_0x920a('0xd')]){if(_0x324b94['error'][_0x920a('0xe')]===0x1f4){logger[_0x920a('0xd')](_0x920a('0x8'),_0x17b474,_0x324b94['error'][_0x920a('0xf')]);return _0x5992c1(_0x324b94[_0x920a('0xd')][_0x920a('0xf')]);}logger['error'](_0x920a('0x8'),_0x17b474,_0x324b94[_0x920a('0xd')]['message']);return _0x171859(_0x324b94[_0x920a('0xd')][_0x920a('0xf')]);}else{logger[_0x920a('0x7')](_0x920a('0x8'),_0x17b474,'request\x20sent');_0x171859(_0x324b94[_0x920a('0x10')][_0x920a('0xf')]);}})[_0x920a('0x11')](function(_0x322486){logger[_0x920a('0xd')](_0x920a('0x8'),_0x17b474,_0x322486);_0x5992c1(_0x322486);});});} \ No newline at end of file +var _0xabe7=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','randomstring','ioredis'];(function(_0x1c337,_0x25ba74){var _0x1ebaf2=function(_0x1a968a){while(--_0x1a968a){_0x1c337['push'](_0x1c337['shift']());}};_0x1ebaf2(++_0x25ba74);}(_0xabe7,0x1b0));var _0x7abe=function(_0x13fec7,_0x13af65){_0x13fec7=_0x13fec7-0x0;var _0x1300c1=_0xabe7[_0x13fec7];return _0x1300c1;};'use strict';var _=require(_0x7abe('0x0'));var util=require(_0x7abe('0x1'));var moment=require(_0x7abe('0x2'));var BPromise=require('bluebird');var rs=require(_0x7abe('0x3'));var fs=require('fs');var Redis=require(_0x7abe('0x4'));var db=require(_0x7abe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7abe('0x6'))(_0x7abe('0x7'));var config=require('../../config/environment');var jayson=require(_0x7abe('0x8'));var client=jayson[_0x7abe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa1afbe,_0x1f3ebc,_0x2fb3ad){return new BPromise(function(_0x183887,_0x48ddae){return client['request'](_0xa1afbe,_0x2fb3ad)[_0x7abe('0xa')](function(_0x139d57){logger[_0x7abe('0xb')](_0x7abe('0xc'),_0x1f3ebc,_0x7abe('0xd'));logger[_0x7abe('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x1f3ebc,'request\x20sent',JSON[_0x7abe('0xf')](_0x139d57));if(_0x139d57['error']){if(_0x139d57[_0x7abe('0x10')][_0x7abe('0x11')]===0x1f4){logger['error'](_0x7abe('0xc'),_0x1f3ebc,_0x139d57[_0x7abe('0x10')]['message']);return _0x48ddae(_0x139d57['error']['message']);}logger[_0x7abe('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1f3ebc,_0x139d57[_0x7abe('0x10')][_0x7abe('0x12')]);return _0x183887(_0x139d57[_0x7abe('0x10')][_0x7abe('0x12')]);}else{logger[_0x7abe('0xb')](_0x7abe('0xc'),_0x1f3ebc,'request\x20sent');_0x183887(_0x139d57['result'][_0x7abe('0x12')]);}})['catch'](function(_0x35929f){logger[_0x7abe('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1f3ebc,_0x35929f);_0x48ddae(_0x35929f);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 914f1e3..7c46fc5 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 _0x708a=['create','post','runTranscribe','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe'];(function(_0x59b286,_0x3fb0fb){var _0x155cdd=function(_0x3ac64a){while(--_0x3ac64a){_0x59b286['push'](_0x59b286['shift']());}};_0x155cdd(++_0x3fb0fb);}(_0x708a,0x1ba));var _0xa708=function(_0x389dc4,_0xd9484){_0x389dc4=_0x389dc4-0x0;var _0x2a481e=_0x708a[_0x389dc4];return _0x2a481e;};'use strict';var multer=require(_0xa708('0x0'));var util=require(_0xa708('0x1'));var path=require(_0xa708('0x2'));var timeout=require(_0xa708('0x3'));var express=require(_0xa708('0x4'));var router=express[_0xa708('0x5')]();var fs_extra=require(_0xa708('0x6'));var auth=require(_0xa708('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa708('0x8'));var controller=require(_0xa708('0x9'));router[_0xa708('0xa')]('/',auth[_0xa708('0xb')](),controller[_0xa708('0xc')]);router[_0xa708('0xa')](_0xa708('0xd'),auth[_0xa708('0xb')](),controller[_0xa708('0xe')]);router[_0xa708('0xa')](_0xa708('0xf'),auth[_0xa708('0xb')](),controller[_0xa708('0x10')]);router[_0xa708('0xa')](_0xa708('0x11'),auth[_0xa708('0xb')](),controller['download']);router[_0xa708('0xa')](_0xa708('0x12'),controller[_0xa708('0x13')]);router[_0xa708('0xa')](_0xa708('0x14'),auth[_0xa708('0xb')](),controller[_0xa708('0x15')]);router['post']('/',auth[_0xa708('0xb')](),controller[_0xa708('0x16')]);router[_0xa708('0x17')](_0xa708('0x14'),auth[_0xa708('0xb')](),controller[_0xa708('0x18')]);router[_0xa708('0x19')](_0xa708('0xf'),auth[_0xa708('0xb')](),controller[_0xa708('0x1a')]);router[_0xa708('0x1b')](_0xa708('0xf'),auth[_0xa708('0xb')](),controller['destroy']);module[_0xa708('0x1c')]=router; \ No newline at end of file +var _0x1550=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','post','runTranscribe','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x2ed583,_0x2d4d7c){var _0x5aefbf=function(_0x5e6bda){while(--_0x5e6bda){_0x2ed583['push'](_0x2ed583['shift']());}};_0x5aefbf(++_0x2d4d7c);}(_0x1550,0x1cf));var _0x0155=function(_0x1d7423,_0x119885){_0x1d7423=_0x1d7423-0x0;var _0x4cefac=_0x1550[_0x1d7423];return _0x4cefac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0155('0x0'));var timeout=require(_0x0155('0x1'));var express=require(_0x0155('0x2'));var router=express[_0x0155('0x3')]();var fs_extra=require(_0x0155('0x4'));var auth=require(_0x0155('0x5'));var interaction=require(_0x0155('0x6'));var config=require(_0x0155('0x7'));var controller=require(_0x0155('0x8'));router[_0x0155('0x9')]('/',auth[_0x0155('0xa')](),controller['index']);router['get'](_0x0155('0xb'),auth[_0x0155('0xa')](),controller[_0x0155('0xc')]);router[_0x0155('0x9')](_0x0155('0xd'),auth[_0x0155('0xa')](),controller[_0x0155('0xe')]);router[_0x0155('0x9')](_0x0155('0xf'),auth[_0x0155('0xa')](),controller[_0x0155('0x10')]);router['get'](_0x0155('0x11'),controller[_0x0155('0x12')]);router[_0x0155('0x9')]('/:id/transcribe',auth[_0x0155('0xa')](),controller[_0x0155('0x13')]);router[_0x0155('0x14')]('/',auth[_0x0155('0xa')](),controller['create']);router[_0x0155('0x14')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0155('0x15')]);router[_0x0155('0x16')](_0x0155('0xd'),auth[_0x0155('0xa')](),controller['update']);router[_0x0155('0x17')](_0x0155('0xd'),auth[_0x0155('0xa')](),controller[_0x0155('0x18')]);module[_0x0155('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 8938b38..3f465e4 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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 426d2dd..ee1183d 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 _0xe922=['TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','sentiment','language','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','papaparse','aws-sdk','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoiceRecording','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','sequelize','MD5','token','$and','push','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','upload'];(function(_0x1b4200,_0x5c0b00){var _0x44c3fb=function(_0x258d4f){while(--_0x258d4f){_0x1b4200['push'](_0x1b4200['shift']());}};_0x44c3fb(++_0x5c0b00);}(_0xe922,0xba));var _0x2e92=function(_0x3d6785,_0x492ea3){_0x3d6785=_0x3d6785-0x0;var _0x39a624=_0xe922[_0x3d6785];return _0x39a624;};'use strict';var emlformat=require(_0x2e92('0x0'));var rimraf=require(_0x2e92('0x1'));var zipdir=require(_0x2e92('0x2'));var jsonpatch=require(_0x2e92('0x3'));var rp=require('request-promise');var moment=require(_0x2e92('0x4'));var BPromise=require(_0x2e92('0x5'));var Mustache=require(_0x2e92('0x6'));var util=require(_0x2e92('0x7'));var path=require(_0x2e92('0x8'));var sox=require(_0x2e92('0x9'));var csv=require('to-csv');var ejs=require(_0x2e92('0xa'));var fs=require('fs');var fs_extra=require(_0x2e92('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2e92('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2e92('0xd'));var toCsv=require(_0x2e92('0xe'));var querystring=require('querystring');var Papa=require(_0x2e92('0xf'));var AWS=require(_0x2e92('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0x2e92('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2e92('0x12'));var as=require(_0x2e92('0x13'));var hardwareService=require(_0x2e92('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x2e92('0x15'));var config=require(_0x2e92('0x16'));var licenseUtil=require(_0x2e92('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cc1c0,_0x1926b9){_0x1926b9=_0x1926b9||0xcc;return function(_0x49764e){if(_0x49764e){return _0x1cc1c0[_0x2e92('0x18')](_0x1926b9);}return _0x1cc1c0[_0x2e92('0x19')](_0x1926b9)[_0x2e92('0x1a')]();};}function respondWithResult(_0x4c71eb,_0x4f03a0){_0x4f03a0=_0x4f03a0||0xc8;return function(_0x48f577){if(_0x48f577){return _0x4c71eb['status'](_0x4f03a0)[_0x2e92('0x1b')](_0x48f577);}};}function respondWithFilteredResult(_0x4b197d,_0x49b0f5){return function(_0x1b6062){if(_0x1b6062){var _0x313a45=typeof _0x49b0f5[_0x2e92('0x1c')]==='undefined'&&typeof _0x49b0f5[_0x2e92('0x1d')]===_0x2e92('0x1e');var _0x356b7d=_0x1b6062[_0x2e92('0x1f')];var _0x4ea931=_0x313a45?0x0:_0x49b0f5['offset'];var _0x2384e4=_0x313a45?_0x1b6062['count']:_0x49b0f5[_0x2e92('0x1c')]+_0x49b0f5[_0x2e92('0x1d')];var _0x37e1d2;if(_0x2384e4>=_0x356b7d){_0x2384e4=_0x356b7d;_0x37e1d2=0xc8;}else{_0x37e1d2=0xce;}_0x4b197d[_0x2e92('0x19')](_0x37e1d2);return _0x4b197d[_0x2e92('0x20')](_0x2e92('0x21'),_0x4ea931+'-'+_0x2384e4+'/'+_0x356b7d)[_0x2e92('0x1b')](_0x1b6062);}return null;};}function patchUpdates(_0x4c5623){return function(_0x50f255){try{jsonpatch[_0x2e92('0x22')](_0x50f255,_0x4c5623,!![]);}catch(_0x3bb669){return BPromise['reject'](_0x3bb669);}return _0x50f255[_0x2e92('0x23')]();};}function saveUpdates(_0x35ba32,_0x4f92be){return function(_0x704b86){if(_0x704b86){return _0x704b86[_0x2e92('0x24')](_0x35ba32)['then'](function(_0x58ac4a){return _0x58ac4a;});}return null;};}function removeEntity(_0x13892f,_0x18c53a){return function(_0x40fc64){if(_0x40fc64){return _0x40fc64[_0x2e92('0x25')]()[_0x2e92('0x26')](function(){_0x13892f[_0x2e92('0x19')](0xcc)[_0x2e92('0x1a')]();});}};}function handleEntityNotFound(_0x515256,_0x4c7fc){return function(_0x239747){if(!_0x239747){_0x515256[_0x2e92('0x18')](0x194);}return _0x239747;};}function handleError(_0x5f196c,_0xd8994e){_0xd8994e=_0xd8994e||0x1f4;return function(_0x310bc3){logger[_0x2e92('0x27')](_0x310bc3[_0x2e92('0x28')]);if(_0x310bc3[_0x2e92('0x29')]){delete _0x310bc3[_0x2e92('0x29')];}_0x5f196c[_0x2e92('0x19')](_0xd8994e)[_0x2e92('0x2a')](_0x310bc3);};}exports[_0x2e92('0x2b')]=function(_0x45695b,_0x31c43a){var _0x261956={},_0x44ecc6={},_0x15ee75={'count':0x0,'rows':[]};var _0x309451=_[_0x2e92('0x2c')](db['VoiceRecording']['rawAttributes'],function(_0x54115e){return{'name':_0x54115e[_0x2e92('0x2d')],'type':_0x54115e[_0x2e92('0x2e')][_0x2e92('0x2f')]};});_0x44ecc6[_0x2e92('0x30')]=_[_0x2e92('0x31')](_[_0x2e92('0x2c')](_0x309451,_0x2e92('0x29')),[_0x2e92('0x32')]);_0x44ecc6[_0x2e92('0x33')]=_[_0x2e92('0x34')](_0x45695b[_0x2e92('0x33')]);_0x44ecc6[_0x2e92('0x35')]=_[_0x2e92('0x36')](_0x44ecc6[_0x2e92('0x30')],_0x44ecc6[_0x2e92('0x33')]);_0x261956[_0x2e92('0x37')]=_[_0x2e92('0x36')](_0x44ecc6[_0x2e92('0x30')],qs[_0x2e92('0x38')](_0x45695b[_0x2e92('0x33')][_0x2e92('0x38')]));_0x261956[_0x2e92('0x37')]=_0x261956['attributes'][_0x2e92('0x39')]?_0x261956['attributes']:_0x44ecc6[_0x2e92('0x30')];if(!_0x45695b['query'][_0x2e92('0x3a')](_0x2e92('0x3b'))){_0x261956[_0x2e92('0x1d')]=qs[_0x2e92('0x1d')](_0x45695b[_0x2e92('0x33')]['limit']);_0x261956[_0x2e92('0x1c')]=qs[_0x2e92('0x1c')](_0x45695b['query']['offset']);}_0x261956[_0x2e92('0x3c')]=qs[_0x2e92('0x3d')](_0x45695b[_0x2e92('0x33')][_0x2e92('0x3d')]);_0x261956['where']=qs[_0x2e92('0x35')](_[_0x2e92('0x3e')](_0x45695b[_0x2e92('0x33')],_0x44ecc6['filters']),_0x309451);if(_0x45695b[_0x2e92('0x33')][_0x2e92('0x3f')]){_0x261956[_0x2e92('0x40')]=_[_0x2e92('0x41')](_0x261956[_0x2e92('0x40')],{'$or':_[_0x2e92('0x2c')](_0x309451,function(_0x2eeb31){if(_0x2eeb31['type']!==_0x2e92('0x42')){var _0x5e7b71={};_0x5e7b71[_0x2eeb31[_0x2e92('0x29')]]={'$like':'%'+_0x45695b['query'][_0x2e92('0x3f')]+'%'};return _0x5e7b71;}})});}_0x261956=_[_0x2e92('0x41')]({},_0x261956,_0x45695b[_0x2e92('0x43')]);var _0x30adef={'where':_0x261956[_0x2e92('0x40')]};return db[_0x2e92('0x44')][_0x2e92('0x1f')](_0x30adef)['then'](function(_0x1c45d6){_0x15ee75[_0x2e92('0x1f')]=_0x1c45d6;if(_0x45695b['query'][_0x2e92('0x45')]){_0x261956['include']=[{'all':!![]}];}return db[_0x2e92('0x44')][_0x2e92('0x46')](_0x261956);})[_0x2e92('0x26')](function(_0x7c718c){_0x15ee75[_0x2e92('0x47')]=_0x7c718c;return _0x15ee75;})[_0x2e92('0x26')](respondWithFilteredResult(_0x31c43a,_0x261956))['catch'](handleError(_0x31c43a,null));};exports[_0x2e92('0x48')]=function(_0x58b824,_0x1a2c3d){var _0x442d7e={'raw':![],'where':{'id':_0x58b824[_0x2e92('0x49')]['id']}},_0x2bfa85={};_0x2bfa85['model']=_[_0x2e92('0x34')](db['VoiceRecording'][_0x2e92('0x4a')]);_0x2bfa85['query']=_['keys'](_0x58b824[_0x2e92('0x33')]);_0x2bfa85[_0x2e92('0x35')]=_[_0x2e92('0x36')](_0x2bfa85['model'],_0x2bfa85[_0x2e92('0x33')]);_0x442d7e[_0x2e92('0x37')]=_['intersection'](_0x2bfa85[_0x2e92('0x30')],qs['fields'](_0x58b824[_0x2e92('0x33')]['fields']));_0x442d7e['attributes']=_0x442d7e['attributes']['length']?_0x442d7e[_0x2e92('0x37')]:_0x2bfa85[_0x2e92('0x30')];if(_0x58b824[_0x2e92('0x33')][_0x2e92('0x45')]){_0x442d7e[_0x2e92('0x4b')]=[{'all':!![]}];}_0x442d7e=_[_0x2e92('0x41')]({},_0x442d7e,_0x58b824[_0x2e92('0x43')]);return db['VoiceRecording'][_0x2e92('0x4c')](_0x442d7e)[_0x2e92('0x26')](handleEntityNotFound(_0x1a2c3d,null))[_0x2e92('0x26')](respondWithResult(_0x1a2c3d,null))[_0x2e92('0x4d')](handleError(_0x1a2c3d,null));};exports['create']=function(_0x5f33b9,_0x580142){return db[_0x2e92('0x44')][_0x2e92('0x4e')](_0x5f33b9['body'],{})[_0x2e92('0x26')](respondWithResult(_0x580142,0xc9))[_0x2e92('0x4d')](handleError(_0x580142,null));};exports[_0x2e92('0x24')]=function(_0x2b811b,_0x469b93){if(_0x2b811b[_0x2e92('0x4f')]['id']){delete _0x2b811b[_0x2e92('0x4f')]['id'];}return db[_0x2e92('0x44')][_0x2e92('0x4c')]({'where':{'id':_0x2b811b[_0x2e92('0x49')]['id']}})[_0x2e92('0x26')](handleEntityNotFound(_0x469b93,null))[_0x2e92('0x26')](saveUpdates(_0x2b811b['body'],null))[_0x2e92('0x26')](respondWithResult(_0x469b93,null))['catch'](handleError(_0x469b93,null));};exports[_0x2e92('0x50')]=function(_0x125ea0,_0x14b527){return db[_0x2e92('0x44')][_0x2e92('0x50')]()[_0x2e92('0x26')](respondWithResult(_0x14b527,null))['catch'](handleError(_0x14b527,null));};exports[_0x2e92('0x51')]=function(_0x42777c,_0xc627b,_0x2393d7){var _0x2fb084=require(_0x2e92('0x52'));var _0x3db0f6=![];var _0x5ecc2a={};if(_0x42777c[_0x2e92('0x33')][_0x2e92('0x2e')]&&_0x42777c[_0x2e92('0x33')][_0x2e92('0x2e')]===_0x2e92('0x53')){_0x5ecc2a[_0x2e92('0x53')]=_0x42777c[_0x2e92('0x49')]['id'];}else{_0x5ecc2a['id']=_0x42777c[_0x2e92('0x49')]['id'];}return db['VoiceRecording']['find']({'where':_0x5ecc2a,'attributes':['id',_0x2e92('0x54')],'raw':!![]})[_0x2e92('0x26')](handleEntityNotFound(_0xc627b,null))[_0x2e92('0x26')](function(_0x1692c6){if(_0x1692c6){var _0x3f9903=_0x1692c6[_0x2e92('0x54')];var _0x1f22c9=util[_0x2e92('0x32')](_0x2e92('0x55'),_0x3f9903);if(fs[_0x2e92('0x56')](_0x1f22c9)){_0x3db0f6=!![];return _0x2fb084[_0x2e92('0x57')](_0x1f22c9,_0x3f9903,config[_0x2e92('0x58')][_0x2e92('0x59')])['then'](function(){return _0x1692c6;});}return _0x1692c6;}})[_0x2e92('0x26')](function(_0x189199){if(_0x189199){var _0xaad506=_0x189199[_0x2e92('0x54')];if(!fs[_0x2e92('0x56')](_0xaad506)){throw new db[(_0x2e92('0x5a'))][(_0x2e92('0x5b'))](_0x2e92('0x5c'));}if(_0x189199[_0x2e92('0x5d')]){return _0xc627b[_0x2e92('0x51')](_0xaad506,_0x189199[_0x2e92('0x5d')]+path[_0x2e92('0x5e')](_0xaad506),function(){if(_0x3db0f6){fs[_0x2e92('0x5f')](_0xaad506);}});}else{return _0xc627b[_0x2e92('0x51')](_0xaad506,function(_0x3c7aa2){if(_0x3db0f6){fs[_0x2e92('0x5f')](_0xaad506);}});}}})[_0x2e92('0x4d')](function(_0x99a13c){if(_0x99a13c['message']==='VoiceRecording\x20not\x20found'){_0xc627b[_0x2e92('0x19')](0x194)[_0x2e92('0x2a')](_0x2e92('0x60'));}else{return handleError(_0xc627b,null);}});};exports['downloads']=function(_0xa72367,_0x2a6276,_0x11a126){var _0x205334=require(_0x2e92('0x52'));var _0x56af37=![];var _0x5a626a={'$and':[db[_0x2e92('0x61')]['where'](db[_0x2e92('0x61')]['fn'](_0x2e92('0x62'),db[_0x2e92('0x61')]['col'](_0x2e92('0x53'))),_0xa72367[_0x2e92('0x33')][_0x2e92('0x63')])]};if(_0xa72367[_0x2e92('0x33')][_0x2e92('0x2e')]&&_0xa72367[_0x2e92('0x33')][_0x2e92('0x2e')]===_0x2e92('0x53')){_0x5a626a[_0x2e92('0x64')][_0x2e92('0x65')]({'uniqueid':_0xa72367[_0x2e92('0x49')]['id']});}else{_0x5a626a['$and'][_0x2e92('0x65')]({'id':_0xa72367[_0x2e92('0x49')]['id']});}return db[_0x2e92('0x44')][_0x2e92('0x4c')]({'where':_0x5a626a,'attributes':['id',_0x2e92('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x2a6276,null))['then'](function(_0x8e6679){if(_0x8e6679){var _0x49adf9=util[_0x2e92('0x32')](_0x2e92('0x55'),_0x8e6679[_0x2e92('0x54')]);if(fs[_0x2e92('0x56')](_0x49adf9)){_0x56af37=!![];return _0x205334[_0x2e92('0x57')](_0x49adf9,_0x8e6679[_0x2e92('0x54')],config[_0x2e92('0x58')][_0x2e92('0x59')])[_0x2e92('0x26')](function(){return _0x8e6679;});}return _0x8e6679;}})[_0x2e92('0x26')](function(_0x1b0d44){if(_0x1b0d44){if(!fs['existsSync'](_0x1b0d44[_0x2e92('0x54')])){throw new db[(_0x2e92('0x5a'))][(_0x2e92('0x5b'))](_0x2e92('0x5c'));}if(_0x1b0d44['filename']){return _0x2a6276[_0x2e92('0x51')](_0x1b0d44[_0x2e92('0x54')],_0x1b0d44[_0x2e92('0x5d')]+path['extname'](_0x1b0d44[_0x2e92('0x54')]),function(){if(_0x56af37){fs[_0x2e92('0x5f')](_0x1b0d44[_0x2e92('0x54')]);}});}else{return _0x2a6276['download'](_0x1b0d44['value'],function(_0x3adb33){if(_0x56af37){fs[_0x2e92('0x5f')](_0x1b0d44[_0x2e92('0x54')]);}});}}})[_0x2e92('0x4d')](handleError(_0x2a6276,null));};exports[_0x2e92('0x25')]=function(_0x3a2dfb,_0x270a92){return db[_0x2e92('0x44')][_0x2e92('0x4c')]({'where':{'id':_0x3a2dfb[_0x2e92('0x49')]['id']}})['then'](function(_0x50560c){if(_[_0x2e92('0x66')](_0x50560c)){throw new ReferenceError('Entity\x20not\x20found');}return _0x50560c;})[_0x2e92('0x26')](function(_0x59240e){var _0x3660d4=_0x59240e[_0x2e92('0x54')];logger[_0x2e92('0x67')](_0x2e92('0x68'),_0x3660d4);if(!_[_0x2e92('0x66')](_0x59240e[_0x2e92('0x54')])&&fs['existsSync'](_0x3660d4)){logger[_0x2e92('0x67')]('File:\x20\x22'+_0x3660d4+_0x2e92('0x69'));fs[_0x2e92('0x6a')](_0x3660d4);}_0x3660d4=_0x3660d4+_0x2e92('0x6b');if(!_[_0x2e92('0x66')](_0x59240e[_0x2e92('0x54')])&&fs['existsSync'](_0x3660d4)){logger[_0x2e92('0x67')]('File:\x20\x22'+_0x3660d4+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x2e92('0x6a')](_0x3660d4);}return _0x59240e;})['then'](function(_0x5a972e){if(!_0x5a972e)throw new InternalError();return _0x5a972e[_0x2e92('0x25')]();})['then'](function(){_0x270a92[_0x2e92('0x19')](0xcc)[_0x2e92('0x1a')]();})[_0x2e92('0x4d')](handleError(_0x270a92,null));};function getBucketslist(_0xe58249,_0x10f975,_0x4cd7aa){return new Promise(function(_0x233018,_0x2b30a5){var _0x423b1e=new AWS['S3']({'accessKeyId':_0x10f975,'secretAccessKey':_0xe58249,'region':_0x4cd7aa});_0x423b1e[_0x2e92('0x6c')]({},function(_0x3a55d4,_0xbe6e78){if(_0x3a55d4){return _0x2b30a5(_0x3a55d4);}else{return _0x233018(_0xbe6e78);}});});}function createBucket(_0x27913d,_0x2c263f,_0xac3a41,_0x145ff1){return new Promise(function(_0x1881b2,_0x44c091){var _0x41eaad=new AWS['S3']({'accessKeyId':_0x2c263f,'secretAccessKey':_0x27913d,'region':_0xac3a41});_0x41eaad['createBucket']({'Bucket':_0x145ff1},function(_0x228d7f,_0xc181e6){if(_0x228d7f){return _0x44c091(_0x228d7f);}else{return _0x1881b2(_0xc181e6);}});});}function uploadFile(_0x27c47d,_0x4265fe,_0x518436,_0x5eb740,_0x548f4f,_0x56619a){return new Promise(function(_0x3e383a,_0x572864){var _0x39f830=new AWS['S3']({'accessKeyId':_0x4265fe,'secretAccessKey':_0x27c47d,'region':_0x518436});_0x39f830[_0x2e92('0x6d')]({'Bucket':_0x5eb740,'Key':_0x548f4f,'Body':_0x56619a},function(_0x5e34ef,_0x498840){if(_0x5e34ef){return _0x572864(_0x5e34ef);}else{return _0x3e383a(_0x498840);}});});}function startTranscribe(_0x2ec75c,_0x1e00ed,_0x38cd24,_0x45bde0,_0x1216db,_0xd13916){return new Promise(function(_0xdf4b50,_0x18f980){var _0x51a10e=new AWS[(_0x2e92('0x6e'))]({'accessKeyId':_0x1e00ed,'secretAccessKey':_0x2ec75c,'region':_0x38cd24});_0x51a10e['startTranscriptionJob']({'TranscriptionJobName':_0x45bde0,'LanguageCode':_0x1216db,'Media':{'MediaFileUri':_0xd13916}},function(_0x4d4905,_0x18d13d){if(_0x4d4905){return _0x18f980(_0x4d4905);}else{return _0xdf4b50(_0x18d13d);}});});}function transcribe(_0x404588,_0x49bb0e,_0x2b3a99,_0x445e2f,_0x46ff3e,_0x14243f,_0x48f94b){return new Promise(function(_0x5af750,_0x1d8902){var _0x266b6a={};logger[_0x2e92('0x67')](util['format'](_0x2e92('0x6f'),_0x404588,_0x46ff3e));return uploadFile(_0x49bb0e,_0x2b3a99,_0x445e2f,_0x46ff3e,path[_0x2e92('0x70')](_0x14243f),fs[_0x2e92('0x71')](_0x14243f))[_0x2e92('0x26')](function(_0x15bc54){logger['info'](util[_0x2e92('0x32')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x404588,_0x46ff3e,_0x15bc54['Location']));_0x266b6a[_0x2e92('0x72')]=_0x15bc54[_0x2e92('0x73')];_0x266b6a[_0x2e92('0x74')]=_0x15bc54[_0x2e92('0x75')];logger['info'](util[_0x2e92('0x32')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x404588));return startTranscribe(_0x49bb0e,_0x2b3a99,_0x445e2f,uuidv4(),_0x48f94b,_0x15bc54[_0x2e92('0x75')]);})[_0x2e92('0x26')](function(_0x4276f9){logger['info'](util['format'](_0x2e92('0x76'),_0x404588,_0x4276f9[_0x2e92('0x77')]['TranscriptionJobName']));_0x266b6a[_0x2e92('0x78')]=_0x4276f9[_0x2e92('0x77')][_0x2e92('0x79')];_0x266b6a[_0x2e92('0x7a')]=_0x4276f9['TranscriptionJob']['TranscriptionJobStatus'];return _0x5af750(_0x266b6a);})['catch'](function(_0x2304c4){return _0x1d8902(_0x2304c4);});});}exports['runTranscribe']=function(_0x3d2763,_0x91982,_0x4a83ac){var _0x5b86d5;var _0x559e48;var _0x263d02;var _0x43ab0d=require(_0x2e92('0x52'));return db['VoiceRecording']['findOne']({'where':{'id':_0x3d2763[_0x2e92('0x49')]['id']}})[_0x2e92('0x26')](function(_0xd9e2f8){if(_0xd9e2f8){var _0x3b6388=util['format'](_0x2e92('0x55'),_0xd9e2f8[_0x2e92('0x54')]);if(fs[_0x2e92('0x56')](_0x3b6388)){cypher=!![];return _0x43ab0d[_0x2e92('0x57')](_0x3b6388,_0xd9e2f8[_0x2e92('0x54')],config[_0x2e92('0x58')][_0x2e92('0x59')])[_0x2e92('0x26')](function(){return _0xd9e2f8;});}return _0xd9e2f8;}})['then'](function(_0x51a994){if(!_0x51a994){throw new db['Sequelize'][(_0x2e92('0x5b'))](_0x2e92('0x7b'));}_0x559e48=_0x51a994;return db[_0x2e92('0x7c')][_0x2e92('0x7d')]({'where':{'id':0x1}});})[_0x2e92('0x26')](handleEntityNotFound(_0x91982,null))[_0x2e92('0x26')](function(_0x2dc98f){if(_0x2dc98f){_0x5b86d5=_0x2dc98f;if(!_0x5b86d5[_0x2e92('0x7e')]||!_0x5b86d5[_0x2e92('0x7f')]||!_0x5b86d5[_0x2e92('0x80')]||!_0x5b86d5['language']||!_0x5b86d5[_0x2e92('0x72')]){throw new db[(_0x2e92('0x5a'))][(_0x2e92('0x5b'))](_0x2e92('0x81'));}if(_0x3d2763[_0x2e92('0x4f')]['runSentiment']&&(!_0x5b86d5[_0x2e92('0x82')]||!_0x5b86d5['sentimentAccountId']||!_0x5b86d5['sentimentRegion']||!_0x5b86d5[_0x2e92('0x83')]||!_0x5b86d5[_0x2e92('0x72')])){throw new db['Sequelize'][(_0x2e92('0x5b'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x2e92('0x84')][_0x2e92('0x7d')]({'where':{'id':_0x5b86d5[_0x2e92('0x7f')]}});}})[_0x2e92('0x26')](function(_0x5aa73e){if(!_0x5aa73e){throw new db[(_0x2e92('0x5a'))][(_0x2e92('0x5b'))](_0x2e92('0x85'));}if(!_0x5aa73e[_0x2e92('0x86')]||!_0x5aa73e['data2']){throw new db['Sequelize'][(_0x2e92('0x5b'))]('Cloud\x20Provider\x20not\x20configured');}_0x263d02=_0x5aa73e;return getBucketslist(_0x263d02['data1'],_0x263d02[_0x2e92('0x87')],_0x5b86d5[_0x2e92('0x80')]);})[_0x2e92('0x26')](function(_0x4490b2){if(_0x4490b2&&_0x4490b2[_0x2e92('0x88')]){var _0x4e3f7a=_['find'](_0x4490b2['Buckets'],function(_0x15df92){return _0x15df92['Name']===_0x5b86d5[_0x2e92('0x72')];});if(!_0x4e3f7a){logger[_0x2e92('0x67')](util[_0x2e92('0x32')](_0x2e92('0x89'),_0x3d2763[_0x2e92('0x49')]['id'],_0x5b86d5[_0x2e92('0x72')]));return createBucket(_0x263d02[_0x2e92('0x86')],_0x263d02['data2'],_0x5b86d5['transcribeRegion'],_0x5b86d5[_0x2e92('0x72')]);}logger[_0x2e92('0x67')](util[_0x2e92('0x32')](_0x2e92('0x8a'),_0x3d2763[_0x2e92('0x49')]['id'],_0x5b86d5['bucket']));return;}})[_0x2e92('0x26')](function(_0x3896a9){if(_0x559e48[_0x2e92('0x7a')]==='NEW'){return transcribe(_0x3d2763[_0x2e92('0x49')]['id'],_0x263d02[_0x2e92('0x86')],_0x263d02[_0x2e92('0x87')],_0x5b86d5[_0x2e92('0x80')],_0x5b86d5[_0x2e92('0x72')],_0x559e48[_0x2e92('0x54')],_0x5b86d5['language']);}else{logger[_0x2e92('0x67')](util['format'](_0x2e92('0x8b'),_0x3d2763[_0x2e92('0x49')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x1d88a7){if(_0x1d88a7){_0x1d88a7[_0x2e92('0x8c')]=_0x3d2763[_0x2e92('0x4f')]['runSentiment'];return _0x559e48[_0x2e92('0x8d')](_0x1d88a7);}})[_0x2e92('0x26')](respondWithResult(_0x91982,null))[_0x2e92('0x4d')](handleError(_0x91982,null));};function writeFile(_0x33957a,_0x59f69f){return new Promise(function(_0x58beb1,_0x29face){fs[_0x2e92('0x8e')](_0x59f69f,_0x33957a,function(_0x1cf12b,_0x21b9a7){if(_0x1cf12b){return _0x29face(_0x1cf12b);}else{return _0x58beb1(_0x21b9a7);}});});}exports[_0x2e92('0x8f')]=function(_0x157097,_0x27ea51,_0x36d016){return db[_0x2e92('0x44')][_0x2e92('0x7d')]({'where':{'id':_0x157097[_0x2e92('0x49')]['id']}})['then'](handleEntityNotFound(_0x27ea51))[_0x2e92('0x26')](function(_0x177afc){if(_0x177afc&&_0x177afc[_0x2e92('0x90')]){var _0x114058=_0x177afc[_0x2e92('0x90')];var _0x18fb24=config[_0x2e92('0x91')]+_0x2e92('0x92')+_0x177afc['id']+_0x2e92('0x93');if(fs[_0x2e92('0x56')](_0x18fb24)){return _0x18fb24;}return writeFile(_0x114058,_0x18fb24)[_0x2e92('0x26')](function(){return _0x18fb24;});}else{throw new db[(_0x2e92('0x5a'))][(_0x2e92('0x5b'))]('Transcript\x20not\x20available');}})[_0x2e92('0x26')](function(_0x53fe19){return _0x27ea51[_0x2e92('0x51')](_0x53fe19);})[_0x2e92('0x4d')](handleError(_0x27ea51));}; \ No newline at end of file +var _0xc945=['format','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','send','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','%s.cypher','destroy','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','bucket','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','offset','limit','undefined','count','status','set','json','apply','reject','save','update','then','end','sendStatus','stack','name','index','map','VoiceRecording','type','differenceBy'];(function(_0x282401,_0x206336){var _0x2b1fed=function(_0x241c5a){while(--_0x241c5a){_0x282401['push'](_0x282401['shift']());}};_0x2b1fed(++_0x206336);}(_0xc945,0x68));var _0x5c94=function(_0x4033f0,_0x326490){_0x4033f0=_0x4033f0-0x0;var _0x2b81d2=_0xc945[_0x4033f0];return _0x2b81d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c94('0x0'));var zipdir=require(_0x5c94('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c94('0x2'));var moment=require('moment');var BPromise=require(_0x5c94('0x3'));var Mustache=require(_0x5c94('0x4'));var util=require(_0x5c94('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5c94('0x6'));var ejs=require(_0x5c94('0x7'));var fs=require('fs');var fs_extra=require(_0x5c94('0x8'));var _=require(_0x5c94('0x9'));var squel=require(_0x5c94('0xa'));var crypto=require('crypto');var jsforce=require(_0x5c94('0xb'));var deskjs=require(_0x5c94('0xc'));var toCsv=require(_0x5c94('0x6'));var querystring=require(_0x5c94('0xd'));var Papa=require(_0x5c94('0xe'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x5c94('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5c94('0x10'));var as=require(_0x5c94('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c94('0x12'))(_0x5c94('0x13'));var utils=require(_0x5c94('0x14'));var config=require(_0x5c94('0x15'));var licenseUtil=require(_0x5c94('0x16'));var db=require(_0x5c94('0x17'))['db'];function respondWithStatusCode(_0x3d3756,_0x1ca13a){_0x1ca13a=_0x1ca13a||0xcc;return function(_0x12d2ce){if(_0x12d2ce){return _0x3d3756['sendStatus'](_0x1ca13a);}return _0x3d3756['status'](_0x1ca13a)['end']();};}function respondWithResult(_0x42e3e9,_0x419c41){_0x419c41=_0x419c41||0xc8;return function(_0x1a85fb){if(_0x1a85fb){return _0x42e3e9['status'](_0x419c41)['json'](_0x1a85fb);}};}function respondWithFilteredResult(_0x3bbb8d,_0x46118e){return function(_0x50a518){if(_0x50a518){var _0x4cf694=typeof _0x46118e[_0x5c94('0x18')]==='undefined'&&typeof _0x46118e[_0x5c94('0x19')]===_0x5c94('0x1a');var _0x48ab2b=_0x50a518[_0x5c94('0x1b')];var _0x2a0236=_0x4cf694?0x0:_0x46118e['offset'];var _0x4a614c=_0x4cf694?_0x50a518[_0x5c94('0x1b')]:_0x46118e[_0x5c94('0x18')]+_0x46118e[_0x5c94('0x19')];var _0xf5f6e8;if(_0x4a614c>=_0x48ab2b){_0x4a614c=_0x48ab2b;_0xf5f6e8=0xc8;}else{_0xf5f6e8=0xce;}_0x3bbb8d[_0x5c94('0x1c')](_0xf5f6e8);return _0x3bbb8d[_0x5c94('0x1d')]('Content-Range',_0x2a0236+'-'+_0x4a614c+'/'+_0x48ab2b)[_0x5c94('0x1e')](_0x50a518);}return null;};}function patchUpdates(_0x4be332){return function(_0x2f9cb1){try{jsonpatch[_0x5c94('0x1f')](_0x2f9cb1,_0x4be332,!![]);}catch(_0x5a2a9d){return BPromise[_0x5c94('0x20')](_0x5a2a9d);}return _0x2f9cb1[_0x5c94('0x21')]();};}function saveUpdates(_0x297b67,_0x1c20cf){return function(_0x282194){if(_0x282194){return _0x282194[_0x5c94('0x22')](_0x297b67)[_0x5c94('0x23')](function(_0x23e154){return _0x23e154;});}return null;};}function removeEntity(_0x4563bd,_0x4a1c70){return function(_0xb516d2){if(_0xb516d2){return _0xb516d2['destroy']()[_0x5c94('0x23')](function(){_0x4563bd[_0x5c94('0x1c')](0xcc)[_0x5c94('0x24')]();});}};}function handleEntityNotFound(_0x321417,_0x278c23){return function(_0x3c6ce5){if(!_0x3c6ce5){_0x321417[_0x5c94('0x25')](0x194);}return _0x3c6ce5;};}function handleError(_0x46ae59,_0x2d3801){_0x2d3801=_0x2d3801||0x1f4;return function(_0x2d8597){logger['error'](_0x2d8597[_0x5c94('0x26')]);if(_0x2d8597[_0x5c94('0x27')]){delete _0x2d8597[_0x5c94('0x27')];}_0x46ae59['status'](_0x2d3801)['send'](_0x2d8597);};}exports[_0x5c94('0x28')]=function(_0x3c1699,_0x2b9319){var _0x374459={},_0x583c7a={},_0x45a957={'count':0x0,'rows':[]};var _0x1774db=_[_0x5c94('0x29')](db[_0x5c94('0x2a')]['rawAttributes'],function(_0x40369e){return{'name':_0x40369e['fieldName'],'type':_0x40369e[_0x5c94('0x2b')]['key']};});_0x583c7a['model']=_[_0x5c94('0x2c')](_[_0x5c94('0x29')](_0x1774db,_0x5c94('0x27')),[_0x5c94('0x2d')]);_0x583c7a['query']=_[_0x5c94('0x2e')](_0x3c1699[_0x5c94('0x2f')]);_0x583c7a[_0x5c94('0x30')]=_[_0x5c94('0x31')](_0x583c7a['model'],_0x583c7a['query']);_0x374459[_0x5c94('0x32')]=_['intersection'](_0x583c7a[_0x5c94('0x33')],qs[_0x5c94('0x34')](_0x3c1699[_0x5c94('0x2f')][_0x5c94('0x34')]));_0x374459[_0x5c94('0x32')]=_0x374459[_0x5c94('0x32')][_0x5c94('0x35')]?_0x374459['attributes']:_0x583c7a[_0x5c94('0x33')];if(!_0x3c1699[_0x5c94('0x2f')][_0x5c94('0x36')](_0x5c94('0x37'))){_0x374459[_0x5c94('0x19')]=qs[_0x5c94('0x19')](_0x3c1699['query'][_0x5c94('0x19')]);_0x374459[_0x5c94('0x18')]=qs['offset'](_0x3c1699['query'][_0x5c94('0x18')]);}_0x374459['order']=qs[_0x5c94('0x38')](_0x3c1699[_0x5c94('0x2f')][_0x5c94('0x38')]);_0x374459[_0x5c94('0x39')]=qs[_0x5c94('0x30')](_[_0x5c94('0x3a')](_0x3c1699['query'],_0x583c7a[_0x5c94('0x30')]),_0x1774db);if(_0x3c1699[_0x5c94('0x2f')][_0x5c94('0x3b')]){_0x374459['where']=_[_0x5c94('0x3c')](_0x374459[_0x5c94('0x39')],{'$or':_[_0x5c94('0x29')](_0x1774db,function(_0x130f4f){if(_0x130f4f[_0x5c94('0x2b')]!=='VIRTUAL'){var _0x32ab4f={};_0x32ab4f[_0x130f4f[_0x5c94('0x27')]]={'$like':'%'+_0x3c1699[_0x5c94('0x2f')]['filter']+'%'};return _0x32ab4f;}})});}_0x374459=_[_0x5c94('0x3c')]({},_0x374459,_0x3c1699[_0x5c94('0x3d')]);var _0x2a1bed={'where':_0x374459[_0x5c94('0x39')]};return db[_0x5c94('0x2a')]['count'](_0x2a1bed)['then'](function(_0xa6b7c7){_0x45a957[_0x5c94('0x1b')]=_0xa6b7c7;if(_0x3c1699[_0x5c94('0x2f')][_0x5c94('0x3e')]){_0x374459[_0x5c94('0x3f')]=[{'all':!![]}];}return db['VoiceRecording'][_0x5c94('0x40')](_0x374459);})[_0x5c94('0x23')](function(_0x3f78f5){_0x45a957['rows']=_0x3f78f5;return _0x45a957;})[_0x5c94('0x23')](respondWithFilteredResult(_0x2b9319,_0x374459))[_0x5c94('0x41')](handleError(_0x2b9319,null));};exports[_0x5c94('0x42')]=function(_0x8f4fcf,_0x40fee4){var _0x3eba5f={'raw':![],'where':{'id':_0x8f4fcf[_0x5c94('0x43')]['id']}},_0x17f220={};_0x17f220[_0x5c94('0x33')]=_[_0x5c94('0x2e')](db[_0x5c94('0x2a')][_0x5c94('0x44')]);_0x17f220[_0x5c94('0x2f')]=_[_0x5c94('0x2e')](_0x8f4fcf[_0x5c94('0x2f')]);_0x17f220['filters']=_[_0x5c94('0x31')](_0x17f220[_0x5c94('0x33')],_0x17f220['query']);_0x3eba5f[_0x5c94('0x32')]=_[_0x5c94('0x31')](_0x17f220[_0x5c94('0x33')],qs['fields'](_0x8f4fcf[_0x5c94('0x2f')][_0x5c94('0x34')]));_0x3eba5f[_0x5c94('0x32')]=_0x3eba5f[_0x5c94('0x32')]['length']?_0x3eba5f[_0x5c94('0x32')]:_0x17f220[_0x5c94('0x33')];if(_0x8f4fcf[_0x5c94('0x2f')][_0x5c94('0x3e')]){_0x3eba5f['include']=[{'all':!![]}];}_0x3eba5f=_['merge']({},_0x3eba5f,_0x8f4fcf['options']);return db[_0x5c94('0x2a')][_0x5c94('0x45')](_0x3eba5f)[_0x5c94('0x23')](handleEntityNotFound(_0x40fee4,null))['then'](respondWithResult(_0x40fee4,null))[_0x5c94('0x41')](handleError(_0x40fee4,null));};exports[_0x5c94('0x46')]=function(_0x1a1632,_0x457907){return db['VoiceRecording']['create'](_0x1a1632['body'],{})[_0x5c94('0x23')](respondWithResult(_0x457907,0xc9))[_0x5c94('0x41')](handleError(_0x457907,null));};exports[_0x5c94('0x22')]=function(_0x189598,_0x3c5ff5){if(_0x189598['body']['id']){delete _0x189598[_0x5c94('0x47')]['id'];}return db['VoiceRecording'][_0x5c94('0x45')]({'where':{'id':_0x189598[_0x5c94('0x43')]['id']}})[_0x5c94('0x23')](handleEntityNotFound(_0x3c5ff5,null))[_0x5c94('0x23')](saveUpdates(_0x189598[_0x5c94('0x47')],null))[_0x5c94('0x23')](respondWithResult(_0x3c5ff5,null))[_0x5c94('0x41')](handleError(_0x3c5ff5,null));};exports[_0x5c94('0x48')]=function(_0x2704d3,_0x11615e){return db[_0x5c94('0x2a')][_0x5c94('0x48')]()[_0x5c94('0x23')](respondWithResult(_0x11615e,null))[_0x5c94('0x41')](handleError(_0x11615e,null));};exports['download']=function(_0x1a01cd,_0x5d8ef5,_0x55a24b){var _0x4ca50d=require('../../components/encryptor');var _0x4ef8c4=![];var _0x2c8a1c={};if(_0x1a01cd['query'][_0x5c94('0x2b')]&&_0x1a01cd[_0x5c94('0x2f')][_0x5c94('0x2b')]===_0x5c94('0x49')){_0x2c8a1c[_0x5c94('0x49')]=_0x1a01cd[_0x5c94('0x43')]['id'];}else{_0x2c8a1c['id']=_0x1a01cd[_0x5c94('0x43')]['id'];}return db['VoiceRecording'][_0x5c94('0x45')]({'where':_0x2c8a1c,'attributes':['id',_0x5c94('0x4a')],'raw':!![]})[_0x5c94('0x23')](handleEntityNotFound(_0x5d8ef5,null))[_0x5c94('0x23')](function(_0x45a1b3){if(_0x45a1b3){var _0x4a220f=_0x45a1b3[_0x5c94('0x4a')];var _0x5052b2=util[_0x5c94('0x2d')]('%s.cypher',_0x4a220f);if(fs[_0x5c94('0x4b')](_0x5052b2)){_0x4ef8c4=!![];return _0x4ca50d[_0x5c94('0x4c')](_0x5052b2,_0x4a220f,config[_0x5c94('0x4d')][_0x5c94('0x4e')])[_0x5c94('0x23')](function(){return _0x45a1b3;});}return _0x45a1b3;}})[_0x5c94('0x23')](function(_0x4c63ad){if(_0x4c63ad){var _0x24bc80=_0x4c63ad[_0x5c94('0x4a')];if(!fs[_0x5c94('0x4b')](_0x24bc80)){throw new db[(_0x5c94('0x4f'))][(_0x5c94('0x50'))](_0x5c94('0x51'));}if(_0x4c63ad[_0x5c94('0x52')]){return _0x5d8ef5[_0x5c94('0x53')](_0x24bc80,_0x4c63ad[_0x5c94('0x52')]+path[_0x5c94('0x54')](_0x24bc80),function(){if(_0x4ef8c4){fs[_0x5c94('0x55')](_0x24bc80);}});}else{return _0x5d8ef5[_0x5c94('0x53')](_0x24bc80,function(_0x48d2c7){if(_0x4ef8c4){fs[_0x5c94('0x55')](_0x24bc80);}});}}})['catch'](function(_0x176682){if(_0x176682[_0x5c94('0x56')]===_0x5c94('0x51')){_0x5d8ef5[_0x5c94('0x1c')](0x194)[_0x5c94('0x57')](_0x5c94('0x58'));}else{return handleError(_0x5d8ef5,null);}});};exports[_0x5c94('0x59')]=function(_0x527663,_0x4566ef,_0x3b0d5e){var _0x309622=require(_0x5c94('0x5a'));var _0x5a024a=![];var _0x3a74cc={'$and':[db['sequelize']['where'](db[_0x5c94('0x5b')]['fn'](_0x5c94('0x5c'),db[_0x5c94('0x5b')][_0x5c94('0x5d')](_0x5c94('0x49'))),_0x527663['query'][_0x5c94('0x5e')])]};if(_0x527663[_0x5c94('0x2f')]['type']&&_0x527663[_0x5c94('0x2f')][_0x5c94('0x2b')]===_0x5c94('0x49')){_0x3a74cc[_0x5c94('0x5f')][_0x5c94('0x60')]({'uniqueid':_0x527663[_0x5c94('0x43')]['id']});}else{_0x3a74cc[_0x5c94('0x5f')][_0x5c94('0x60')]({'id':_0x527663[_0x5c94('0x43')]['id']});}return db[_0x5c94('0x2a')][_0x5c94('0x45')]({'where':_0x3a74cc,'attributes':['id',_0x5c94('0x4a')],'raw':!![]})[_0x5c94('0x23')](handleEntityNotFound(_0x4566ef,null))[_0x5c94('0x23')](function(_0x3082e9){if(_0x3082e9){var _0x2fcd0c=util[_0x5c94('0x2d')](_0x5c94('0x61'),_0x3082e9[_0x5c94('0x4a')]);if(fs[_0x5c94('0x4b')](_0x2fcd0c)){_0x5a024a=!![];return _0x309622[_0x5c94('0x4c')](_0x2fcd0c,_0x3082e9[_0x5c94('0x4a')],config[_0x5c94('0x4d')][_0x5c94('0x4e')])[_0x5c94('0x23')](function(){return _0x3082e9;});}return _0x3082e9;}})['then'](function(_0x1f3700){if(_0x1f3700){if(!fs['existsSync'](_0x1f3700[_0x5c94('0x4a')])){throw new db[(_0x5c94('0x4f'))][(_0x5c94('0x50'))](_0x5c94('0x51'));}if(_0x1f3700[_0x5c94('0x52')]){return _0x4566ef[_0x5c94('0x53')](_0x1f3700[_0x5c94('0x4a')],_0x1f3700[_0x5c94('0x52')]+path[_0x5c94('0x54')](_0x1f3700[_0x5c94('0x4a')]),function(){if(_0x5a024a){fs[_0x5c94('0x55')](_0x1f3700['value']);}});}else{return _0x4566ef['download'](_0x1f3700[_0x5c94('0x4a')],function(_0x14f256){if(_0x5a024a){fs[_0x5c94('0x55')](_0x1f3700[_0x5c94('0x4a')]);}});}}})['catch'](handleError(_0x4566ef,null));};exports[_0x5c94('0x62')]=function(_0x25dc13,_0x19e473){return db[_0x5c94('0x2a')]['find']({'where':{'id':_0x25dc13['params']['id']}})['then'](function(_0x2ca703){if(_['isNil'](_0x2ca703)){throw new ReferenceError(_0x5c94('0x63'));}return _0x2ca703;})[_0x5c94('0x23')](function(_0x2f2aea){var _0x24119c=_0x2f2aea[_0x5c94('0x4a')];logger[_0x5c94('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x24119c);if(!_[_0x5c94('0x65')](_0x2f2aea[_0x5c94('0x4a')])&&fs['existsSync'](_0x24119c)){logger[_0x5c94('0x64')](_0x5c94('0x66')+_0x24119c+_0x5c94('0x67'));fs['unlinkSync'](_0x24119c);}_0x24119c=_0x24119c+'.cypher';if(!_['isNil'](_0x2f2aea[_0x5c94('0x4a')])&&fs[_0x5c94('0x4b')](_0x24119c)){logger['info'](_0x5c94('0x66')+_0x24119c+_0x5c94('0x67'));fs[_0x5c94('0x68')](_0x24119c);}return _0x2f2aea;})[_0x5c94('0x23')](function(_0x253464){if(!_0x253464)throw new InternalError();return _0x253464[_0x5c94('0x62')]();})['then'](function(){_0x19e473['status'](0xcc)[_0x5c94('0x24')]();})[_0x5c94('0x41')](handleError(_0x19e473,null));};function getBucketslist(_0x3d8c9b,_0x190784,_0x42e423){return new Promise(function(_0x18f6cc,_0x4cc64d){var _0x23bfb7=new AWS['S3']({'accessKeyId':_0x190784,'secretAccessKey':_0x3d8c9b,'region':_0x42e423});_0x23bfb7[_0x5c94('0x69')]({},function(_0x4ac2ea,_0x1f357a){if(_0x4ac2ea){return _0x4cc64d(_0x4ac2ea);}else{return _0x18f6cc(_0x1f357a);}});});}function createBucket(_0x296c51,_0x4f07e8,_0x34d7a4,_0x19d358){return new Promise(function(_0x434a12,_0x41503f){var _0x281fdb=new AWS['S3']({'accessKeyId':_0x4f07e8,'secretAccessKey':_0x296c51,'region':_0x34d7a4});_0x281fdb[_0x5c94('0x6a')]({'Bucket':_0x19d358},function(_0x52bfd6,_0x1b3749){if(_0x52bfd6){return _0x41503f(_0x52bfd6);}else{return _0x434a12(_0x1b3749);}});});}function uploadFile(_0x260e17,_0x3a4ff0,_0x1d8009,_0x48743e,_0x1e51c3,_0x2096c4){return new Promise(function(_0x25ba90,_0x5ed311){var _0x1036c7=new AWS['S3']({'accessKeyId':_0x3a4ff0,'secretAccessKey':_0x260e17,'region':_0x1d8009});_0x1036c7[_0x5c94('0x6b')]({'Bucket':_0x48743e,'Key':_0x1e51c3,'Body':_0x2096c4},function(_0x39330c,_0x351e6b){if(_0x39330c){return _0x5ed311(_0x39330c);}else{return _0x25ba90(_0x351e6b);}});});}function startTranscribe(_0x35d1d9,_0x2187ad,_0x5bf1c8,_0x2289c0,_0x5b10ae,_0x40b03a){return new Promise(function(_0xda00f4,_0xf877d5){var _0xddf306=new AWS['TranscribeService']({'accessKeyId':_0x2187ad,'secretAccessKey':_0x35d1d9,'region':_0x5bf1c8});_0xddf306[_0x5c94('0x6c')]({'TranscriptionJobName':_0x2289c0,'LanguageCode':_0x5b10ae,'Media':{'MediaFileUri':_0x40b03a}},function(_0x7b0326,_0xc9f6fa){if(_0x7b0326){return _0xf877d5(_0x7b0326);}else{return _0xda00f4(_0xc9f6fa);}});});}function transcribe(_0x145369,_0xac061d,_0x298331,_0x13f21e,_0x3b1d66,_0x17c311,_0x750492){return new Promise(function(_0x21610a,_0x3b85c4){var _0x4f737e={};logger[_0x5c94('0x64')](util[_0x5c94('0x2d')](_0x5c94('0x6d'),_0x145369,_0x3b1d66));return uploadFile(_0xac061d,_0x298331,_0x13f21e,_0x3b1d66,path[_0x5c94('0x6e')](_0x17c311),fs['readFileSync'](_0x17c311))[_0x5c94('0x23')](function(_0x33d598){logger[_0x5c94('0x64')](util[_0x5c94('0x2d')](_0x5c94('0x6f'),_0x145369,_0x3b1d66,_0x33d598[_0x5c94('0x70')]));_0x4f737e['bucket']=_0x33d598[_0x5c94('0x71')];_0x4f737e[_0x5c94('0x72')]=_0x33d598[_0x5c94('0x70')];logger['info'](util[_0x5c94('0x2d')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x145369));return startTranscribe(_0xac061d,_0x298331,_0x13f21e,uuidv4(),_0x750492,_0x33d598['Location']);})[_0x5c94('0x23')](function(_0x43efd0){logger[_0x5c94('0x64')](util[_0x5c94('0x2d')](_0x5c94('0x73'),_0x145369,_0x43efd0[_0x5c94('0x74')]['TranscriptionJobName']));_0x4f737e['transcribeName']=_0x43efd0[_0x5c94('0x74')][_0x5c94('0x75')];_0x4f737e['transcribeStatus']=_0x43efd0['TranscriptionJob']['TranscriptionJobStatus'];return _0x21610a(_0x4f737e);})['catch'](function(_0x23b186){return _0x3b85c4(_0x23b186);});});}exports[_0x5c94('0x76')]=function(_0x319e6f,_0x1b90e2,_0x4035f7){var _0x1046f3;var _0x45b212;var _0x25a59c;var _0x417deb=require(_0x5c94('0x5a'));return db[_0x5c94('0x2a')][_0x5c94('0x77')]({'where':{'id':_0x319e6f[_0x5c94('0x43')]['id']}})[_0x5c94('0x23')](function(_0x516843){if(_0x516843){var _0x27a172=util[_0x5c94('0x2d')](_0x5c94('0x61'),_0x516843[_0x5c94('0x4a')]);if(fs[_0x5c94('0x4b')](_0x27a172)){cypher=!![];return _0x417deb['decryptFile'](_0x27a172,_0x516843['value'],config[_0x5c94('0x4d')][_0x5c94('0x4e')])[_0x5c94('0x23')](function(){return _0x516843;});}return _0x516843;}})[_0x5c94('0x23')](function(_0x50ee85){if(!_0x50ee85){throw new db[(_0x5c94('0x4f'))][(_0x5c94('0x50'))](_0x5c94('0x78'));}_0x45b212=_0x50ee85;return db[_0x5c94('0x79')][_0x5c94('0x77')]({'where':{'id':0x1}});})[_0x5c94('0x23')](handleEntityNotFound(_0x1b90e2,null))['then'](function(_0x35515a){if(_0x35515a){_0x1046f3=_0x35515a;if(!_0x1046f3['transcribe']||!_0x1046f3[_0x5c94('0x7a')]||!_0x1046f3[_0x5c94('0x7b')]||!_0x1046f3['language']||!_0x1046f3['bucket']){throw new db[(_0x5c94('0x4f'))][(_0x5c94('0x50'))](_0x5c94('0x7c'));}if(_0x319e6f[_0x5c94('0x47')][_0x5c94('0x7d')]&&(!_0x1046f3[_0x5c94('0x7e')]||!_0x1046f3[_0x5c94('0x7f')]||!_0x1046f3['sentimentRegion']||!_0x1046f3[_0x5c94('0x80')]||!_0x1046f3['bucket'])){throw new db[(_0x5c94('0x4f'))][(_0x5c94('0x50'))](_0x5c94('0x81'));}return db[_0x5c94('0x82')]['findOne']({'where':{'id':_0x1046f3['transcribeAccountId']}});}})['then'](function(_0x5c314d){if(!_0x5c314d){throw new db[(_0x5c94('0x4f'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x5c314d['data1']||!_0x5c314d[_0x5c94('0x83')]){throw new db[(_0x5c94('0x4f'))][(_0x5c94('0x50'))](_0x5c94('0x84'));}_0x25a59c=_0x5c314d;return getBucketslist(_0x25a59c[_0x5c94('0x85')],_0x25a59c[_0x5c94('0x83')],_0x1046f3[_0x5c94('0x7b')]);})[_0x5c94('0x23')](function(_0x378625){if(_0x378625&&_0x378625[_0x5c94('0x86')]){var _0xb26b4a=_[_0x5c94('0x45')](_0x378625[_0x5c94('0x86')],function(_0x4ba292){return _0x4ba292[_0x5c94('0x87')]===_0x1046f3[_0x5c94('0x88')];});if(!_0xb26b4a){logger[_0x5c94('0x64')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x319e6f[_0x5c94('0x43')]['id'],_0x1046f3['bucket']));return createBucket(_0x25a59c[_0x5c94('0x85')],_0x25a59c[_0x5c94('0x83')],_0x1046f3[_0x5c94('0x7b')],_0x1046f3[_0x5c94('0x88')]);}logger[_0x5c94('0x64')](util[_0x5c94('0x2d')](_0x5c94('0x89'),_0x319e6f[_0x5c94('0x43')]['id'],_0x1046f3[_0x5c94('0x88')]));return;}})['then'](function(_0x2b0e6c){if(_0x45b212[_0x5c94('0x8a')]==='NEW'){return transcribe(_0x319e6f[_0x5c94('0x43')]['id'],_0x25a59c['data1'],_0x25a59c[_0x5c94('0x83')],_0x1046f3[_0x5c94('0x7b')],_0x1046f3['bucket'],_0x45b212[_0x5c94('0x4a')],_0x1046f3[_0x5c94('0x80')]);}else{logger[_0x5c94('0x64')](util[_0x5c94('0x2d')](_0x5c94('0x8b'),_0x319e6f[_0x5c94('0x43')]['id']));return{'transcribeStatus':_0x5c94('0x8c')};}})['then'](function(_0x44697a){if(_0x44697a){_0x44697a[_0x5c94('0x8d')]=_0x319e6f[_0x5c94('0x47')]['runSentiment'];return _0x45b212[_0x5c94('0x8e')](_0x44697a);}})[_0x5c94('0x23')](respondWithResult(_0x1b90e2,null))['catch'](handleError(_0x1b90e2,null));};function writeFile(_0x2afc3f,_0x94167d){return new Promise(function(_0x2d041,_0x232105){fs[_0x5c94('0x8f')](_0x94167d,_0x2afc3f,function(_0x4d6fe0,_0x4f00d6){if(_0x4d6fe0){return _0x232105(_0x4d6fe0);}else{return _0x2d041(_0x4f00d6);}});});}exports[_0x5c94('0x90')]=function(_0x27aded,_0x4cc4bd,_0x3fce92){return db[_0x5c94('0x2a')]['findOne']({'where':{'id':_0x27aded[_0x5c94('0x43')]['id']}})[_0x5c94('0x23')](handleEntityNotFound(_0x4cc4bd))[_0x5c94('0x23')](function(_0x238ee1){if(_0x238ee1&&_0x238ee1[_0x5c94('0x91')]){var _0x9555b8=_0x238ee1[_0x5c94('0x91')];var _0x254acd=config['root']+_0x5c94('0x92')+_0x238ee1['id']+_0x5c94('0x93');if(fs[_0x5c94('0x4b')](_0x254acd)){return _0x254acd;}return writeFile(_0x9555b8,_0x254acd)[_0x5c94('0x23')](function(){return _0x254acd;});}else{throw new db[(_0x5c94('0x4f'))][(_0x5c94('0x50'))](_0x5c94('0x94'));}})['then'](function(_0x68d4b5){return _0x4cc4bd[_0x5c94('0x53')](_0x68d4b5);})[_0x5c94('0x41')](handleError(_0x4cc4bd));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 9bba65a..136b8e2 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 _0x7b77=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid'];(function(_0x1c6f8,_0x18af22){var _0xc47f94=function(_0x280668){while(--_0x280668){_0x1c6f8['push'](_0x1c6f8['shift']());}};_0xc47f94(++_0x18af22);}(_0x7b77,0x179));var _0x77b7=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x7b77[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x77b7('0x0'));var util=require(_0x77b7('0x1'));var logger=require(_0x77b7('0x2'))(_0x77b7('0x3'));var moment=require('moment');var BPromise=require(_0x77b7('0x4'));var rp=require(_0x77b7('0x5'));var fs=require('fs');var path=require(_0x77b7('0x6'));var rimraf=require('rimraf');var config=require(_0x77b7('0x7'));var attributes=require(_0x77b7('0x8'));module[_0x77b7('0x9')]=function(_0x3d97f0,_0x4556c1){return _0x3d97f0[_0x77b7('0xa')]('VoiceRecording',attributes,{'tableName':_0x77b7('0xb'),'paranoid':![],'indexes':[{'name':_0x77b7('0xc'),'fields':[_0x77b7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb28=['define','VoiceRecording','voice_recordings','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./voiceRecording.attributes'];(function(_0x1f53c0,_0x384059){var _0x27a26b=function(_0x5e5a24){while(--_0x5e5a24){_0x1f53c0['push'](_0x1f53c0['shift']());}};_0x27a26b(++_0x384059);}(_0xdb28,0x19b));var _0x8db2=function(_0x10bfaf,_0x5cd252){_0x10bfaf=_0x10bfaf-0x0;var _0x395e75=_0xdb28[_0x10bfaf];return _0x395e75;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require('../../config/logger')(_0x8db2('0x2'));var moment=require(_0x8db2('0x3'));var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require('../../config/environment');var attributes=require(_0x8db2('0x8'));module['exports']=function(_0x5b2724,_0x29b55a){return _0x5b2724[_0x8db2('0x9')](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index dd62660..a7d6ae2 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32b6=['jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','info','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','limit','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x32b6,0x1d1));var _0x632b=function(_0x24c48b,_0x27efdc){_0x24c48b=_0x24c48b-0x0;var _0x3d7b57=_0x32b6[_0x24c48b];return _0x3d7b57;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')](_0x3bb27f[_0x632b('0x18')],{'raw':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')]['where']||null:null,'attributes':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')]['attributes']||null:null,'limit':_0x3bb27f[_0x632b('0x19')]?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1b')]||null:null})['then'](function(_0x10fc32){logger[_0x632b('0x14')]('UpdateVoiceRecording',_0x3bb27f);logger[_0x632b('0xd')](_0x632b('0x15'),_0x3bb27f,JSON[_0x632b('0xf')](_0x10fc32));_0x51c894(_0x10fc32);})[_0x632b('0x1c')](function(_0x45d017){logger[_0x632b('0x10')]('UpdateVoiceRecording',_0x45d017['message'],_0x3bb27f);_0x2f3e88(_0x28c472[_0x632b('0x10')](0x1f4,_0x45d017['message']));});});};exports[_0x632b('0x1d')]=function(_0x954fa0){var _0x5d6855=this;return new Promise(function(_0x273e89,_0x3f4eab){var _0x29d9aa=require(_0x632b('0x1e'));var _0x4728a8;return db[_0x632b('0x1f')][_0x632b('0x20')]({'attributes':['id',_0x632b('0x21')],'where':{'id':0x1},'raw':!![]})[_0x632b('0xc')](function(_0x4f8410){_0x4728a8=_0x4f8410;return db[_0x632b('0x16')][_0x632b('0x22')](_0x954fa0[_0x632b('0x18')]);})[_0x632b('0xc')](function(_0x17a5ba){if(_0x4728a8[_0x632b('0x21')]&&fs[_0x632b('0x23')](_0x17a5ba[_0x632b('0x24')])){var _0x1ace1b=util[_0x632b('0x25')](_0x632b('0x26'),_0x17a5ba[_0x632b('0x24')]);return _0x29d9aa[_0x632b('0x27')](_0x17a5ba[_0x632b('0x24')],_0x1ace1b,config[_0x632b('0x28')][_0x632b('0x29')])[_0x632b('0xc')](function(){fs[_0x632b('0x2a')](_0x17a5ba[_0x632b('0x24')]);logger[_0x632b('0x14')]('CreateVoiceRecording\x20file\x20encrypted');return _0x17a5ba;});}return _0x17a5ba;})[_0x632b('0xc')](function(_0x4401dc){logger[_0x632b('0x14')](_0x632b('0x1d'),_0x954fa0);logger['debug'](_0x632b('0x1d'),_0x954fa0,JSON['stringify'](_0x4401dc));_0x273e89(_0x4401dc);})[_0x632b('0x1c')](function(_0x15b22d){logger['error'](_0x632b('0x1d'),_0x15b22d[_0x632b('0x13')],_0x954fa0);_0x3f4eab(_0x5d6855[_0x632b('0x10')](0x1f4,_0x15b22d[_0x632b('0x13')]));});});}; \ No newline at end of file +var _0x66fa=['CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceRecording,\x20%s,\x20%s','message','catch','VoiceRecording','update','body','options','raw','where','attributes','UpdateVoiceRecording','stringify'];(function(_0x218dc4,_0x4e6f29){var _0x2e5a57=function(_0x58002b){while(--_0x58002b){_0x218dc4['push'](_0x218dc4['shift']());}};_0x2e5a57(++_0x4e6f29);}(_0x66fa,0x117));var _0xa66f=function(_0x2edec0,_0x189f03){_0x2edec0=_0x2edec0-0x0;var _0x3c40c5=_0x66fa[_0x2edec0];return _0x3c40c5;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});}exports['UpdateVoiceRecording']=function(_0x1cbe64){var _0x55b59d=this;return new Promise(function(_0x4a28d4,_0x2f9da2){return db[_0xa66f('0x14')][_0xa66f('0x15')](_0x1cbe64[_0xa66f('0x16')],{'raw':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x19')]||null:null,'attributes':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x1a')]||null:null,'limit':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')]['limit']||null:null})[_0xa66f('0xb')](function(_0xc5c82e){logger[_0xa66f('0xc')](_0xa66f('0x1b'),_0x1cbe64);logger['debug'](_0xa66f('0x1b'),_0x1cbe64,JSON[_0xa66f('0x1c')](_0xc5c82e));_0x4a28d4(_0xc5c82e);})[_0xa66f('0x13')](function(_0x16f1fa){logger['error']('UpdateVoiceRecording',_0x16f1fa[_0xa66f('0x12')],_0x1cbe64);_0x2f9da2(_0x55b59d['error'](0x1f4,_0x16f1fa[_0xa66f('0x12')]));});});};exports[_0xa66f('0x1d')]=function(_0x384164){var _0x57da7f=this;return new Promise(function(_0x4683c7,_0x1c2903){var _0x13495f=require(_0xa66f('0x1e'));var _0x17c103;return db[_0xa66f('0x1f')][_0xa66f('0x20')]({'attributes':['id',_0xa66f('0x21')],'where':{'id':0x1},'raw':!![]})[_0xa66f('0xb')](function(_0x117d03){_0x17c103=_0x117d03;return db[_0xa66f('0x14')][_0xa66f('0x22')](_0x384164[_0xa66f('0x16')]);})[_0xa66f('0xb')](function(_0x49f615){if(_0x17c103['callRecordingEncryption']&&fs[_0xa66f('0x23')](_0x49f615[_0xa66f('0x24')])){var _0x55f309=util[_0xa66f('0x25')](_0xa66f('0x26'),_0x49f615['value']);return _0x13495f[_0xa66f('0x27')](_0x49f615[_0xa66f('0x24')],_0x55f309,config[_0xa66f('0x28')][_0xa66f('0x29')])[_0xa66f('0xb')](function(){fs['unlink'](_0x49f615[_0xa66f('0x24')]);logger['info'](_0xa66f('0x2a'));return _0x49f615;});}return _0x49f615;})[_0xa66f('0xb')](function(_0x2e4dc8){logger['info'](_0xa66f('0x1d'),_0x384164);logger[_0xa66f('0x2b')]('CreateVoiceRecording',_0x384164,JSON[_0xa66f('0x1c')](_0x2e4dc8));_0x4683c7(_0x2e4dc8);})[_0xa66f('0x13')](function(_0xba9457){logger[_0xa66f('0xf')](_0xa66f('0x1d'),_0xba9457[_0xa66f('0x12')],_0x384164);_0x1c2903(_0x57da7f[_0xa66f('0xf')](0x1f4,_0xba9457[_0xa66f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index b49fc95..b92b5ad 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 _0x3a9a=['./voiceTransferReport.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3a9a,0x1b3));var _0xa3a9=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x3a9a[_0x383356];return _0x32ee5a;};'use strict';var multer=require(_0xa3a9('0x0'));var util=require(_0xa3a9('0x1'));var path=require('path');var timeout=require(_0xa3a9('0x2'));var express=require(_0xa3a9('0x3'));var router=express['Router']();var fs_extra=require(_0xa3a9('0x4'));var auth=require(_0xa3a9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa3a9('0x6'));var controller=require(_0xa3a9('0x7'));router[_0xa3a9('0x8')]('/',auth[_0xa3a9('0x9')](),controller[_0xa3a9('0xa')]);router[_0xa3a9('0x8')]('/describe',auth[_0xa3a9('0x9')](),controller['describe']);router[_0xa3a9('0x8')](_0xa3a9('0xb'),auth[_0xa3a9('0x9')](),controller[_0xa3a9('0xc')]);router['post']('/',auth[_0xa3a9('0x9')](),controller[_0xa3a9('0xd')]);router[_0xa3a9('0xe')](_0xa3a9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa3a9('0xf')](_0xa3a9('0xb'),auth[_0xa3a9('0x9')](),controller[_0xa3a9('0x10')]);module['exports']=router; \ No newline at end of file +var _0xae88=['isAuthenticated','/:id','show','post','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','/describe'];(function(_0x32b4aa,_0x12eba6){var _0x473160=function(_0x4906b6){while(--_0x4906b6){_0x32b4aa['push'](_0x32b4aa['shift']());}};_0x473160(++_0x12eba6);}(_0xae88,0x139));var _0x8ae8=function(_0x35e2e0,_0x2e27be){_0x35e2e0=_0x35e2e0-0x0;var _0x15ed47=_0xae88[_0x35e2e0];return _0x15ed47;};'use strict';var multer=require(_0x8ae8('0x0'));var util=require(_0x8ae8('0x1'));var path=require('path');var timeout=require(_0x8ae8('0x2'));var express=require(_0x8ae8('0x3'));var router=express[_0x8ae8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8ae8('0x5'));var interaction=require(_0x8ae8('0x6'));var config=require(_0x8ae8('0x7'));var controller=require(_0x8ae8('0x8'));router[_0x8ae8('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8ae8('0x9')](_0x8ae8('0xa'),auth[_0x8ae8('0xb')](),controller['describe']);router['get'](_0x8ae8('0xc'),auth['isAuthenticated'](),controller[_0x8ae8('0xd')]);router[_0x8ae8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x8ae8('0xb')](),controller[_0x8ae8('0xf')]);router[_0x8ae8('0x10')](_0x8ae8('0xc'),auth[_0x8ae8('0xb')](),controller['destroy']);module[_0x8ae8('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 74d5993..4096c62 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 _0x272c=['STRING','moment','exports','ENUM','attended'];(function(_0x2ab7dd,_0x3e0f51){var _0x2d99da=function(_0x446636){while(--_0x446636){_0x2ab7dd['push'](_0x2ab7dd['shift']());}};_0x2d99da(++_0x3e0f51);}(_0x272c,0x137));var _0xc272=function(_0x31b7f2,_0x1ece7e){_0x31b7f2=_0x31b7f2-0x0;var _0x366b2e=_0x272c[_0x31b7f2];return _0x366b2e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc272('0x0'));module[_0xc272('0x1')]={'type':{'type':Sequelize[_0xc272('0x2')]('blind',_0xc272('0x3'))},'result':{'type':Sequelize[_0xc272('0x4')]},'transfererchannel':{'type':Sequelize[_0xc272('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xc272('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xc272('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xc272('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xc272('0x4')]},'transferercontext':{'type':Sequelize[_0xc272('0x4')]},'transfererexten':{'type':Sequelize[_0xc272('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xc272('0x4')]},'transfereechannel':{'type':Sequelize[_0xc272('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xc272('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xc272('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xc272('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xc272('0x4')]},'transfereecontext':{'type':Sequelize[_0xc272('0x4')]},'transfereeexten':{'type':Sequelize[_0xc272('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xc272('0x4')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0xc272('0x4')]},'extension':{'type':Sequelize[_0xc272('0x4')]}}; \ No newline at end of file +var _0xcfb5=['moment','exports','ENUM','blind','attended','STRING','Yes','sequelize'];(function(_0x2123b4,_0x27a520){var _0x4b2d0c=function(_0x35a887){while(--_0x35a887){_0x2123b4['push'](_0x2123b4['shift']());}};_0x4b2d0c(++_0x27a520);}(_0xcfb5,0x107));var _0x5cfb=function(_0x601e24,_0x419554){_0x601e24=_0x601e24-0x0;var _0x4f2279=_0xcfb5[_0x601e24];return _0x4f2279;};'use strict';var Sequelize=require(_0x5cfb('0x0'));var moment=require(_0x5cfb('0x1'));module[_0x5cfb('0x2')]={'type':{'type':Sequelize[_0x5cfb('0x3')](_0x5cfb('0x4'),_0x5cfb('0x5'))},'result':{'type':Sequelize[_0x5cfb('0x6')]},'transfererchannel':{'type':Sequelize[_0x5cfb('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x5cfb('0x6')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x5cfb('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x5cfb('0x6')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x5cfb('0x6')]},'transfererexten':{'type':Sequelize[_0x5cfb('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x5cfb('0x6')]},'transfereechannel':{'type':Sequelize[_0x5cfb('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x5cfb('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x5cfb('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x5cfb('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5cfb('0x6')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x5cfb('0x6')]},'transfereeexten':{'type':Sequelize[_0x5cfb('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x5cfb('0x6')]},'isexternal':{'type':Sequelize[_0x5cfb('0x3')](_0x5cfb('0x7'),'No')},'context':{'type':Sequelize[_0x5cfb('0x6')]},'extension':{'type':Sequelize[_0x5cfb('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index ab7ccac..ad626f9 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 _0x49e8=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model'];(function(_0x5ac5ea,_0x60b0f){var _0x502198=function(_0x23f002){while(--_0x23f002){_0x5ac5ea['push'](_0x5ac5ea['shift']());}};_0x502198(++_0x60b0f);}(_0x49e8,0x131));var _0x849e=function(_0x13dc4b,_0x4635e8){_0x13dc4b=_0x13dc4b-0x0;var _0x25626d=_0x49e8[_0x13dc4b];return _0x25626d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x849e('0x0'));var zipdir=require(_0x849e('0x1'));var jsonpatch=require(_0x849e('0x2'));var rp=require(_0x849e('0x3'));var moment=require(_0x849e('0x4'));var BPromise=require(_0x849e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x849e('0x6'));var sox=require(_0x849e('0x7'));var csv=require(_0x849e('0x8'));var ejs=require(_0x849e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x849e('0xa'));var squel=require('squel');var crypto=require(_0x849e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x849e('0xc'));var toCsv=require(_0x849e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x849e('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x849e('0xe'));var hardwareService=require(_0x849e('0xf'));var logger=require(_0x849e('0x10'))(_0x849e('0x11'));var utils=require(_0x849e('0x12'));var config=require(_0x849e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x849e('0x14'))['db'];function respondWithStatusCode(_0x1621b8,_0x2656cd){_0x2656cd=_0x2656cd||0xcc;return function(_0x31dbcd){if(_0x31dbcd){return _0x1621b8[_0x849e('0x15')](_0x2656cd);}return _0x1621b8[_0x849e('0x16')](_0x2656cd)[_0x849e('0x17')]();};}function respondWithResult(_0x482048,_0x1113de){_0x1113de=_0x1113de||0xc8;return function(_0x5e1951){if(_0x5e1951){return _0x482048['status'](_0x1113de)[_0x849e('0x18')](_0x5e1951);}};}function respondWithFilteredResult(_0x452604,_0x3e5313){return function(_0x4dfece){if(_0x4dfece){var _0x547ec5=typeof _0x3e5313[_0x849e('0x19')]==='undefined'&&typeof _0x3e5313[_0x849e('0x1a')]==='undefined';var _0x504850=_0x4dfece[_0x849e('0x1b')];var _0x94f329=_0x547ec5?0x0:_0x3e5313[_0x849e('0x19')];var _0x36168e=_0x547ec5?_0x4dfece[_0x849e('0x1b')]:_0x3e5313[_0x849e('0x19')]+_0x3e5313[_0x849e('0x1a')];var _0x53e263;if(_0x36168e>=_0x504850){_0x36168e=_0x504850;_0x53e263=0xc8;}else{_0x53e263=0xce;}_0x452604[_0x849e('0x16')](_0x53e263);return _0x452604['set']('Content-Range',_0x94f329+'-'+_0x36168e+'/'+_0x504850)['json'](_0x4dfece);}return null;};}function patchUpdates(_0x8189ec){return function(_0x4428a7){try{jsonpatch[_0x849e('0x1c')](_0x4428a7,_0x8189ec,!![]);}catch(_0x391ffa){return BPromise[_0x849e('0x1d')](_0x391ffa);}return _0x4428a7['save']();};}function saveUpdates(_0x3a482c,_0x57a020){return function(_0x2f1529){if(_0x2f1529){return _0x2f1529[_0x849e('0x1e')](_0x3a482c)[_0x849e('0x1f')](function(_0x14ccb9){return _0x14ccb9;});}return null;};}function removeEntity(_0x34f1b4,_0x369a2d){return function(_0x1a578d){if(_0x1a578d){return _0x1a578d[_0x849e('0x20')]()[_0x849e('0x1f')](function(){_0x34f1b4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x335a05,_0x18e7c1){return function(_0x3ee5b5){if(!_0x3ee5b5){_0x335a05[_0x849e('0x15')](0x194);}return _0x3ee5b5;};}function handleError(_0x17ea79,_0x4bb1f2){_0x4bb1f2=_0x4bb1f2||0x1f4;return function(_0x4ed039){logger[_0x849e('0x21')](_0x4ed039[_0x849e('0x22')]);if(_0x4ed039[_0x849e('0x23')]){delete _0x4ed039[_0x849e('0x23')];}_0x17ea79[_0x849e('0x16')](_0x4bb1f2)[_0x849e('0x24')](_0x4ed039);};}exports[_0x849e('0x25')]=function(_0x2455f4,_0xc17d42){var _0x104351={},_0xf2008a={},_0x13ee0c={'count':0x0,'rows':[]};var _0x33c407=_[_0x849e('0x26')](db[_0x849e('0x27')][_0x849e('0x28')],function(_0x2d576f){return{'name':_0x2d576f[_0x849e('0x29')],'type':_0x2d576f[_0x849e('0x2a')][_0x849e('0x2b')]};});_0xf2008a[_0x849e('0x2c')]=_[_0x849e('0x26')](_0x33c407,_0x849e('0x23'));_0xf2008a[_0x849e('0x2d')]=_['keys'](_0x2455f4[_0x849e('0x2d')]);_0xf2008a[_0x849e('0x2e')]=_[_0x849e('0x2f')](_0xf2008a[_0x849e('0x2c')],_0xf2008a['query']);_0x104351[_0x849e('0x30')]=_[_0x849e('0x2f')](_0xf2008a['model'],qs[_0x849e('0x31')](_0x2455f4[_0x849e('0x2d')][_0x849e('0x31')]));_0x104351[_0x849e('0x30')]=_0x104351[_0x849e('0x30')][_0x849e('0x32')]?_0x104351[_0x849e('0x30')]:_0xf2008a[_0x849e('0x2c')];if(!_0x2455f4['query'][_0x849e('0x33')](_0x849e('0x34'))){_0x104351[_0x849e('0x1a')]=qs[_0x849e('0x1a')](_0x2455f4[_0x849e('0x2d')][_0x849e('0x1a')]);_0x104351['offset']=qs['offset'](_0x2455f4[_0x849e('0x2d')][_0x849e('0x19')]);}_0x104351[_0x849e('0x35')]=qs[_0x849e('0x36')](_0x2455f4[_0x849e('0x2d')]['sort']);_0x104351[_0x849e('0x37')]=qs[_0x849e('0x2e')](_['pick'](_0x2455f4[_0x849e('0x2d')],_0xf2008a[_0x849e('0x2e')]),_0x33c407);if(_0x2455f4[_0x849e('0x2d')]['filter']){_0x104351[_0x849e('0x37')]=_[_0x849e('0x38')](_0x104351['where'],{'$or':_[_0x849e('0x26')](_0x33c407,function(_0x36811d){if(_0x36811d['type']!==_0x849e('0x39')){var _0x4f9b82={};_0x4f9b82[_0x36811d['name']]={'$like':'%'+_0x2455f4[_0x849e('0x2d')][_0x849e('0x3a')]+'%'};return _0x4f9b82;}})});}_0x104351=_['merge']({},_0x104351,_0x2455f4[_0x849e('0x3b')]);var _0x235d75={'where':_0x104351[_0x849e('0x37')]};return db[_0x849e('0x27')]['count'](_0x235d75)[_0x849e('0x1f')](function(_0x3b516c){_0x13ee0c[_0x849e('0x1b')]=_0x3b516c;if(_0x2455f4[_0x849e('0x2d')][_0x849e('0x3c')]){_0x104351[_0x849e('0x3d')]=[{'all':!![]}];}return db[_0x849e('0x27')][_0x849e('0x3e')](_0x104351);})[_0x849e('0x1f')](function(_0x526613){_0x13ee0c['rows']=_0x526613;return _0x13ee0c;})[_0x849e('0x1f')](respondWithFilteredResult(_0xc17d42,_0x104351))[_0x849e('0x3f')](handleError(_0xc17d42,null));};exports[_0x849e('0x40')]=function(_0x2e0516,_0x3afc95){var _0x166cfc={'raw':!![],'where':{'id':_0x2e0516[_0x849e('0x41')]['id']}},_0x221fde={};_0x221fde[_0x849e('0x2c')]=_[_0x849e('0x42')](db[_0x849e('0x27')][_0x849e('0x28')]);_0x221fde['query']=_['keys'](_0x2e0516[_0x849e('0x2d')]);_0x221fde['filters']=_[_0x849e('0x2f')](_0x221fde[_0x849e('0x2c')],_0x221fde[_0x849e('0x2d')]);_0x166cfc['attributes']=_['intersection'](_0x221fde[_0x849e('0x2c')],qs['fields'](_0x2e0516[_0x849e('0x2d')][_0x849e('0x31')]));_0x166cfc[_0x849e('0x30')]=_0x166cfc[_0x849e('0x30')][_0x849e('0x32')]?_0x166cfc[_0x849e('0x30')]:_0x221fde[_0x849e('0x2c')];if(_0x2e0516['query']['includeAll']){_0x166cfc[_0x849e('0x3d')]=[{'all':!![]}];}_0x166cfc=_['merge']({},_0x166cfc,_0x2e0516['options']);return db[_0x849e('0x27')][_0x849e('0x43')](_0x166cfc)[_0x849e('0x1f')](handleEntityNotFound(_0x3afc95,null))[_0x849e('0x1f')](respondWithResult(_0x3afc95,null))[_0x849e('0x3f')](handleError(_0x3afc95,null));};exports[_0x849e('0x44')]=function(_0x36d4e4,_0x5d2db8){return db[_0x849e('0x27')][_0x849e('0x44')](_0x36d4e4[_0x849e('0x45')],{})[_0x849e('0x1f')](respondWithResult(_0x5d2db8,0xc9))['catch'](handleError(_0x5d2db8,null));};exports[_0x849e('0x1e')]=function(_0x239ed5,_0x5f4181){if(_0x239ed5[_0x849e('0x45')]['id']){delete _0x239ed5[_0x849e('0x45')]['id'];}return db[_0x849e('0x27')][_0x849e('0x43')]({'where':{'id':_0x239ed5[_0x849e('0x41')]['id']}})[_0x849e('0x1f')](handleEntityNotFound(_0x5f4181,null))[_0x849e('0x1f')](saveUpdates(_0x239ed5['body'],null))[_0x849e('0x1f')](respondWithResult(_0x5f4181,null))[_0x849e('0x3f')](handleError(_0x5f4181,null));};exports[_0x849e('0x20')]=function(_0x229a38,_0x5c2380){return db[_0x849e('0x27')][_0x849e('0x43')]({'where':{'id':_0x229a38[_0x849e('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c2380,null))[_0x849e('0x1f')](removeEntity(_0x5c2380,null))[_0x849e('0x3f')](handleError(_0x5c2380,null));};exports['describe']=function(_0x6c5550,_0x4775eb){return db[_0x849e('0x27')]['describe']()['then'](respondWithResult(_0x4775eb,null))[_0x849e('0x3f')](handleError(_0x4775eb,null));}; \ No newline at end of file +var _0x4fb0=['nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','eml-format','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','apply','update','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x28db1c,_0x4e23c5){var _0x3acd1a=function(_0x240edc){while(--_0x240edc){_0x28db1c['push'](_0x28db1c['shift']());}};_0x3acd1a(++_0x4e23c5);}(_0x4fb0,0xea));var _0x04fb=function(_0x35c439,_0x4d95f5){_0x35c439=_0x35c439-0x0;var _0x4d5ced=_0x4fb0[_0x35c439];return _0x4d5ced;};'use strict';var emlformat=require(_0x04fb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x04fb('0x1'));var Mustache=require('mustache');var util=require('util');var path=require(_0x04fb('0x2'));var sox=require(_0x04fb('0x3'));var csv=require(_0x04fb('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x04fb('0x5'));var _=require('lodash');var squel=require(_0x04fb('0x6'));var crypto=require(_0x04fb('0x7'));var jsforce=require(_0x04fb('0x8'));var deskjs=require(_0x04fb('0x9'));var toCsv=require(_0x04fb('0x4'));var querystring=require('querystring');var Papa=require(_0x04fb('0xa'));var Redis=require(_0x04fb('0xb'));var authService=require(_0x04fb('0xc'));var qs=require(_0x04fb('0xd'));var as=require(_0x04fb('0xe'));var hardwareService=require(_0x04fb('0xf'));var logger=require(_0x04fb('0x10'))(_0x04fb('0x11'));var utils=require(_0x04fb('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x04fb('0x13'))['db'];function respondWithStatusCode(_0x213212,_0x4c0bbb){_0x4c0bbb=_0x4c0bbb||0xcc;return function(_0x31de30){if(_0x31de30){return _0x213212[_0x04fb('0x14')](_0x4c0bbb);}return _0x213212['status'](_0x4c0bbb)[_0x04fb('0x15')]();};}function respondWithResult(_0x3dd801,_0x1b8cdc){_0x1b8cdc=_0x1b8cdc||0xc8;return function(_0x495ce0){if(_0x495ce0){return _0x3dd801[_0x04fb('0x16')](_0x1b8cdc)[_0x04fb('0x17')](_0x495ce0);}};}function respondWithFilteredResult(_0x551592,_0xde6bf0){return function(_0x53d837){if(_0x53d837){var _0x398101=typeof _0xde6bf0['offset']==='undefined'&&typeof _0xde6bf0['limit']===_0x04fb('0x18');var _0x5a9bff=_0x53d837[_0x04fb('0x19')];var _0x847027=_0x398101?0x0:_0xde6bf0[_0x04fb('0x1a')];var _0x8fb1e9=_0x398101?_0x53d837[_0x04fb('0x19')]:_0xde6bf0['offset']+_0xde6bf0[_0x04fb('0x1b')];var _0x4acf0d;if(_0x8fb1e9>=_0x5a9bff){_0x8fb1e9=_0x5a9bff;_0x4acf0d=0xc8;}else{_0x4acf0d=0xce;}_0x551592['status'](_0x4acf0d);return _0x551592['set'](_0x04fb('0x1c'),_0x847027+'-'+_0x8fb1e9+'/'+_0x5a9bff)[_0x04fb('0x17')](_0x53d837);}return null;};}function patchUpdates(_0xff7ca8){return function(_0x5db2fa){try{jsonpatch[_0x04fb('0x1d')](_0x5db2fa,_0xff7ca8,!![]);}catch(_0x167e7a){return BPromise['reject'](_0x167e7a);}return _0x5db2fa['save']();};}function saveUpdates(_0x5df98d,_0x25e3b4){return function(_0x4507e3){if(_0x4507e3){return _0x4507e3[_0x04fb('0x1e')](_0x5df98d)['then'](function(_0x65801e){return _0x65801e;});}return null;};}function removeEntity(_0x23115b,_0x23e072){return function(_0x170e31){if(_0x170e31){return _0x170e31['destroy']()['then'](function(){_0x23115b['status'](0xcc)[_0x04fb('0x15')]();});}};}function handleEntityNotFound(_0x1e778f,_0x48166e){return function(_0x4a6c6f){if(!_0x4a6c6f){_0x1e778f[_0x04fb('0x14')](0x194);}return _0x4a6c6f;};}function handleError(_0x29970a,_0x4f9291){_0x4f9291=_0x4f9291||0x1f4;return function(_0xb0d153){logger['error'](_0xb0d153[_0x04fb('0x1f')]);if(_0xb0d153[_0x04fb('0x20')]){delete _0xb0d153[_0x04fb('0x20')];}_0x29970a[_0x04fb('0x16')](_0x4f9291)['send'](_0xb0d153);};}exports[_0x04fb('0x21')]=function(_0x4f371e,_0x187704){var _0x2f3d48={},_0x1c681d={},_0x4bbe6b={'count':0x0,'rows':[]};var _0x948190=_[_0x04fb('0x22')](db[_0x04fb('0x23')][_0x04fb('0x24')],function(_0x156fa1){return{'name':_0x156fa1[_0x04fb('0x25')],'type':_0x156fa1[_0x04fb('0x26')]['key']};});_0x1c681d['model']=_[_0x04fb('0x22')](_0x948190,_0x04fb('0x20'));_0x1c681d[_0x04fb('0x27')]=_['keys'](_0x4f371e[_0x04fb('0x27')]);_0x1c681d['filters']=_[_0x04fb('0x28')](_0x1c681d[_0x04fb('0x29')],_0x1c681d['query']);_0x2f3d48[_0x04fb('0x2a')]=_['intersection'](_0x1c681d[_0x04fb('0x29')],qs[_0x04fb('0x2b')](_0x4f371e[_0x04fb('0x27')][_0x04fb('0x2b')]));_0x2f3d48[_0x04fb('0x2a')]=_0x2f3d48[_0x04fb('0x2a')][_0x04fb('0x2c')]?_0x2f3d48['attributes']:_0x1c681d[_0x04fb('0x29')];if(!_0x4f371e[_0x04fb('0x27')][_0x04fb('0x2d')](_0x04fb('0x2e'))){_0x2f3d48[_0x04fb('0x1b')]=qs['limit'](_0x4f371e[_0x04fb('0x27')][_0x04fb('0x1b')]);_0x2f3d48[_0x04fb('0x1a')]=qs['offset'](_0x4f371e[_0x04fb('0x27')][_0x04fb('0x1a')]);}_0x2f3d48[_0x04fb('0x2f')]=qs[_0x04fb('0x30')](_0x4f371e['query'][_0x04fb('0x30')]);_0x2f3d48['where']=qs[_0x04fb('0x31')](_[_0x04fb('0x32')](_0x4f371e[_0x04fb('0x27')],_0x1c681d[_0x04fb('0x31')]),_0x948190);if(_0x4f371e['query'][_0x04fb('0x33')]){_0x2f3d48['where']=_['merge'](_0x2f3d48[_0x04fb('0x34')],{'$or':_[_0x04fb('0x22')](_0x948190,function(_0x15ed07){if(_0x15ed07[_0x04fb('0x26')]!==_0x04fb('0x35')){var _0x33db8e={};_0x33db8e[_0x15ed07[_0x04fb('0x20')]]={'$like':'%'+_0x4f371e[_0x04fb('0x27')][_0x04fb('0x33')]+'%'};return _0x33db8e;}})});}_0x2f3d48=_[_0x04fb('0x36')]({},_0x2f3d48,_0x4f371e[_0x04fb('0x37')]);var _0xba6be6={'where':_0x2f3d48[_0x04fb('0x34')]};return db[_0x04fb('0x23')][_0x04fb('0x19')](_0xba6be6)[_0x04fb('0x38')](function(_0x42f2f2){_0x4bbe6b[_0x04fb('0x19')]=_0x42f2f2;if(_0x4f371e[_0x04fb('0x27')][_0x04fb('0x39')]){_0x2f3d48[_0x04fb('0x3a')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x04fb('0x3b')](_0x2f3d48);})[_0x04fb('0x38')](function(_0x1a38e5){_0x4bbe6b[_0x04fb('0x3c')]=_0x1a38e5;return _0x4bbe6b;})[_0x04fb('0x38')](respondWithFilteredResult(_0x187704,_0x2f3d48))[_0x04fb('0x3d')](handleError(_0x187704,null));};exports[_0x04fb('0x3e')]=function(_0x5373cc,_0x12e4c6){var _0x4c4b36={'raw':!![],'where':{'id':_0x5373cc[_0x04fb('0x3f')]['id']}},_0xb03785={};_0xb03785[_0x04fb('0x29')]=_[_0x04fb('0x40')](db[_0x04fb('0x23')][_0x04fb('0x24')]);_0xb03785[_0x04fb('0x27')]=_[_0x04fb('0x40')](_0x5373cc[_0x04fb('0x27')]);_0xb03785[_0x04fb('0x31')]=_[_0x04fb('0x28')](_0xb03785[_0x04fb('0x29')],_0xb03785[_0x04fb('0x27')]);_0x4c4b36[_0x04fb('0x2a')]=_[_0x04fb('0x28')](_0xb03785['model'],qs[_0x04fb('0x2b')](_0x5373cc[_0x04fb('0x27')][_0x04fb('0x2b')]));_0x4c4b36[_0x04fb('0x2a')]=_0x4c4b36[_0x04fb('0x2a')][_0x04fb('0x2c')]?_0x4c4b36[_0x04fb('0x2a')]:_0xb03785[_0x04fb('0x29')];if(_0x5373cc[_0x04fb('0x27')][_0x04fb('0x39')]){_0x4c4b36[_0x04fb('0x3a')]=[{'all':!![]}];}_0x4c4b36=_[_0x04fb('0x36')]({},_0x4c4b36,_0x5373cc[_0x04fb('0x37')]);return db[_0x04fb('0x23')][_0x04fb('0x41')](_0x4c4b36)[_0x04fb('0x38')](handleEntityNotFound(_0x12e4c6,null))[_0x04fb('0x38')](respondWithResult(_0x12e4c6,null))[_0x04fb('0x3d')](handleError(_0x12e4c6,null));};exports[_0x04fb('0x42')]=function(_0x3ee16a,_0x4381e6){return db[_0x04fb('0x23')][_0x04fb('0x42')](_0x3ee16a[_0x04fb('0x43')],{})['then'](respondWithResult(_0x4381e6,0xc9))['catch'](handleError(_0x4381e6,null));};exports[_0x04fb('0x1e')]=function(_0x148542,_0x145107){if(_0x148542[_0x04fb('0x43')]['id']){delete _0x148542['body']['id'];}return db[_0x04fb('0x23')][_0x04fb('0x41')]({'where':{'id':_0x148542['params']['id']}})[_0x04fb('0x38')](handleEntityNotFound(_0x145107,null))[_0x04fb('0x38')](saveUpdates(_0x148542[_0x04fb('0x43')],null))[_0x04fb('0x38')](respondWithResult(_0x145107,null))[_0x04fb('0x3d')](handleError(_0x145107,null));};exports[_0x04fb('0x44')]=function(_0xcc5925,_0x4b6219){return db[_0x04fb('0x23')]['find']({'where':{'id':_0xcc5925['params']['id']}})[_0x04fb('0x38')](handleEntityNotFound(_0x4b6219,null))[_0x04fb('0x38')](removeEntity(_0x4b6219,null))['catch'](handleError(_0x4b6219,null));};exports[_0x04fb('0x45')]=function(_0x17356a,_0x1370c0){return db[_0x04fb('0x23')]['describe']()['then'](respondWithResult(_0x1370c0,null))[_0x04fb('0x3d')](handleError(_0x1370c0,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index b6f90f9..a1410cf 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 _0x3b83=['../../config/environment','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xe8722d,_0x4589c1){var _0x4423ec=function(_0x5ee1be){while(--_0x5ee1be){_0xe8722d['push'](_0xe8722d['shift']());}};_0x4423ec(++_0x4589c1);}(_0x3b83,0x1b2));var _0x33b8=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3b83[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x33b8('0x0'));var util=require(_0x33b8('0x1'));var logger=require(_0x33b8('0x2'))(_0x33b8('0x3'));var moment=require(_0x33b8('0x4'));var BPromise=require(_0x33b8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x33b8('0x6'));var rimraf=require('rimraf');var config=require(_0x33b8('0x7'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x426867,_0x3aaa84){return _0x426867['define']('VoiceTransferReport',attributes,{'tableName':_0x33b8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe231=['moment','bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','lodash','util','api'];(function(_0x217877,_0xa7fd65){var _0x185334=function(_0x4f3fd5){while(--_0x4f3fd5){_0x217877['push'](_0x217877['shift']());}};_0x185334(++_0xa7fd65);}(_0xe231,0x135));var _0x1e23=function(_0x4fab79,_0x4f76dc){_0x4fab79=_0x4fab79-0x0;var _0x31ec8e=_0xe231[_0x4fab79];return _0x31ec8e;};'use strict';var _=require(_0x1e23('0x0'));var util=require(_0x1e23('0x1'));var logger=require('../../config/logger')(_0x1e23('0x2'));var moment=require(_0x1e23('0x3'));var BPromise=require(_0x1e23('0x4'));var rp=require(_0x1e23('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e23('0x6'));var config=require(_0x1e23('0x7'));var attributes=require(_0x1e23('0x8'));module['exports']=function(_0x5375f1,_0x635845){return _0x5375f1[_0x1e23('0x9')](_0x1e23('0xa'),attributes,{'tableName':_0x1e23('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 39fb943..baa4fe2 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 _0x0a46=['then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','result','CreateVoiceTransferReport','create','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x59f7dc,_0x432e46){var _0xb68838=function(_0x4a1a8d){while(--_0x4a1a8d){_0x59f7dc['push'](_0x59f7dc['shift']());}};_0xb68838(++_0x432e46);}(_0x0a46,0xdb));var _0x60a4=function(_0x4d811e,_0x280563){_0x4d811e=_0x4d811e-0x0;var _0x13909a=_0x0a46[_0x4d811e];return _0x13909a;};'use strict';var _=require(_0x60a4('0x0'));var util=require(_0x60a4('0x1'));var moment=require(_0x60a4('0x2'));var BPromise=require(_0x60a4('0x3'));var rs=require(_0x60a4('0x4'));var fs=require('fs');var Redis=require(_0x60a4('0x5'));var db=require(_0x60a4('0x6'))['db'];var utils=require(_0x60a4('0x7'));var logger=require(_0x60a4('0x8'))(_0x60a4('0x9'));var config=require(_0x60a4('0xa'));var jayson=require(_0x60a4('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cde48,_0x26e572,_0x517e13){return new BPromise(function(_0x1c18f9,_0x38e9d6){return client[_0x60a4('0xc')](_0x5cde48,_0x517e13)[_0x60a4('0xd')](function(_0x349a54){logger[_0x60a4('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x26e572,_0x60a4('0xf'));logger[_0x60a4('0x10')](_0x60a4('0x11'),_0x26e572,_0x60a4('0xf'),JSON[_0x60a4('0x12')](_0x349a54));if(_0x349a54[_0x60a4('0x13')]){if(_0x349a54[_0x60a4('0x13')][_0x60a4('0x14')]===0x1f4){logger[_0x60a4('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x26e572,_0x349a54[_0x60a4('0x13')][_0x60a4('0x15')]);return _0x38e9d6(_0x349a54[_0x60a4('0x13')][_0x60a4('0x15')]);}logger[_0x60a4('0x13')](_0x60a4('0x16'),_0x26e572,_0x349a54[_0x60a4('0x13')][_0x60a4('0x15')]);return _0x1c18f9(_0x349a54[_0x60a4('0x13')][_0x60a4('0x15')]);}else{logger['info'](_0x60a4('0x16'),_0x26e572,_0x60a4('0xf'));_0x1c18f9(_0x349a54[_0x60a4('0x17')]['message']);}})['catch'](function(_0xcf3408){logger[_0x60a4('0x13')](_0x60a4('0x16'),_0x26e572,_0xcf3408);_0x38e9d6(_0xcf3408);});});}exports[_0x60a4('0x18')]=function(_0x348c93){var _0x2cc657=this;return new Promise(function(_0x5515eb,_0x4cc3db){return db['VoiceTransferReport'][_0x60a4('0x19')](_0x348c93['body'],{'raw':_0x348c93[_0x60a4('0x1a')]?_0x348c93[_0x60a4('0x1a')][_0x60a4('0x1b')]===undefined?!![]:![]:!![]})[_0x60a4('0xd')](function(_0x4a4b60){logger[_0x60a4('0xe')](_0x60a4('0x18'),_0x348c93);logger[_0x60a4('0x10')](_0x60a4('0x18'),_0x348c93,JSON[_0x60a4('0x12')](_0x4a4b60));_0x5515eb(_0x4a4b60);})[_0x60a4('0x1c')](function(_0x1788ee){logger[_0x60a4('0x13')](_0x60a4('0x18'),_0x1788ee['message'],_0x348c93);_0x4cc3db(_0x2cc657['error'](0x1f4,_0x1788ee[_0x60a4('0x15')]));});});}; \ No newline at end of file +var _0xd78d=['code','VoiceTransferReport,\x20%s,\x20%s','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','stringify','error'];(function(_0x15aefd,_0x38d843){var _0x9e040=function(_0x34dda8){while(--_0x34dda8){_0x15aefd['push'](_0x15aefd['shift']());}};_0x9e040(++_0x38d843);}(_0xd78d,0xfd));var _0xdd78=function(_0x10913b,_0x435cf4){_0x10913b=_0x10913b-0x0;var _0x17180d=_0xd78d[_0x10913b];return _0x17180d;};'use strict';var _=require(_0xdd78('0x0'));var util=require(_0xdd78('0x1'));var moment=require(_0xdd78('0x2'));var BPromise=require(_0xdd78('0x3'));var rs=require(_0xdd78('0x4'));var fs=require('fs');var Redis=require(_0xdd78('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd78('0x6'));var logger=require(_0xdd78('0x7'))(_0xdd78('0x8'));var config=require(_0xdd78('0x9'));var jayson=require(_0xdd78('0xa'));var client=jayson[_0xdd78('0xb')][_0xdd78('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x213c7d,_0x546bfa,_0x5341aa){return new BPromise(function(_0xde1c05,_0x4079b0){return client[_0xdd78('0xd')](_0x213c7d,_0x5341aa)['then'](function(_0x571e95){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x546bfa,'request\x20sent');logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x546bfa,_0xdd78('0xe'),JSON[_0xdd78('0xf')](_0x571e95));if(_0x571e95[_0xdd78('0x10')]){if(_0x571e95['error'][_0xdd78('0x11')]===0x1f4){logger[_0xdd78('0x10')](_0xdd78('0x12'),_0x546bfa,_0x571e95[_0xdd78('0x10')][_0xdd78('0x13')]);return _0x4079b0(_0x571e95[_0xdd78('0x10')][_0xdd78('0x13')]);}logger[_0xdd78('0x10')](_0xdd78('0x12'),_0x546bfa,_0x571e95[_0xdd78('0x10')][_0xdd78('0x13')]);return _0xde1c05(_0x571e95['error'][_0xdd78('0x13')]);}else{logger[_0xdd78('0x14')](_0xdd78('0x12'),_0x546bfa,_0xdd78('0xe'));_0xde1c05(_0x571e95[_0xdd78('0x15')][_0xdd78('0x13')]);}})[_0xdd78('0x16')](function(_0x549da9){logger[_0xdd78('0x10')](_0xdd78('0x12'),_0x546bfa,_0x549da9);_0x4079b0(_0x549da9);});});}exports[_0xdd78('0x17')]=function(_0x57c1a1){var _0x2ea687=this;return new Promise(function(_0x2d72fb,_0xbc969e){return db[_0xdd78('0x18')][_0xdd78('0x19')](_0x57c1a1['body'],{'raw':_0x57c1a1['options']?_0x57c1a1[_0xdd78('0x1a')][_0xdd78('0x1b')]===undefined?!![]:![]:!![]})[_0xdd78('0x1c')](function(_0x330399){logger[_0xdd78('0x14')](_0xdd78('0x17'),_0x57c1a1);logger[_0xdd78('0x1d')](_0xdd78('0x17'),_0x57c1a1,JSON[_0xdd78('0xf')](_0x330399));_0x2d72fb(_0x330399);})['catch'](function(_0x58d594){logger[_0xdd78('0x10')](_0xdd78('0x17'),_0x58d594[_0xdd78('0x13')],_0x57c1a1);_0xbc969e(_0x2ea687[_0xdd78('0x10')](0x1f4,_0x58d594['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 21cce22..41d8d0f 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 _0x9a19=['hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup'];(function(_0x1eb91e,_0x53e87a){var _0x4d2a03=function(_0x530e3b){while(--_0x530e3b){_0x1eb91e['push'](_0x1eb91e['shift']());}};_0x4d2a03(++_0x53e87a);}(_0x9a19,0x114));var _0x99a1=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0x9a19[_0x35485a];return _0x5148e6;};'use strict';var express=require(_0x99a1('0x0'));var router=express[_0x99a1('0x1')]();var auth=require(_0x99a1('0x2'));var controller=require('./webbar.controller');router[_0x99a1('0x3')](_0x99a1('0x4'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0x7')]);router[_0x99a1('0x3')](_0x99a1('0x8'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0x9')]);router[_0x99a1('0x3')]('/answer',auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x99a1('0xa')]);router[_0x99a1('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x99a1('0x6')](),controller[_0x99a1('0xb')]);router[_0x99a1('0x3')](_0x99a1('0xc'),auth[_0x99a1('0x5')](),auth['isWebrtcLicence'](),controller[_0x99a1('0xd')]);router[_0x99a1('0x3')](_0x99a1('0xe'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0xf')]);router[_0x99a1('0x3')](_0x99a1('0x10'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0x11')]);module[_0x99a1('0x12')]=router; \ No newline at end of file +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(_0x2712b8,_0x571149){_0x2712b8=_0x2712b8-0x0;var _0x3ee5a7=_0xb43b[_0x2712b8];return _0x3ee5a7;};'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 diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 63adf74..2a2f047 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 _0x3667=['defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack','name','send','request','then','error','code','message','catch','User','agent','VoiceChannels','filter','rows','UserId','sessionId','originate\x20fired:','body','length','json','userId','callNumber','callerId','entityFound:','format','status','hangup\x20fired:','user:%s','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis'];(function(_0x11e7e6,_0x1d3622){var _0x4c59e2=function(_0x3253cd){while(--_0x3253cd){_0x11e7e6['push'](_0x11e7e6['shift']());}};_0x4c59e2(++_0x1d3622);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x7366('0x0'));var fs=require('fs');var _=require(_0x7366('0x1'));var db=require(_0x7366('0x2'))['db'];var config=require(_0x7366('0x3'));var util=require(_0x7366('0x4'));var BPromise=require('bluebird');var jayson=require(_0x7366('0x5'));var amiClient=jayson[_0x7366('0x6')]['http']({'port':0x232a});var logger=require(_0x7366('0x7'))(_0x7366('0x8'));var Redis=require(_0x7366('0x9'));config[_0x7366('0xa')]=_[_0x7366('0xb')](config['redis'],{'host':_0x7366('0xc'),'port':0x18eb});var io=require(_0x7366('0xd'))(new Redis(config[_0x7366('0xa')]));var Schema=require(_0x7366('0xe'));var originateValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'callNumber':{'type':_0x7366('0x11'),'required':[!![],_0x7366('0x12')]},'callerId':{'type':_0x7366('0x11')},'callbackUrl':{'type':_0x7366('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':[!![],_0x7366('0x13')]},'transferNumber':{'type':_0x7366('0x11'),'required':[!![],_0x7366('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7366('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]}});function emit(_0x2c0422,_0xe2c87b,_0x431c01){logger[_0x7366('0x15')](_0x2c0422,_0xe2c87b,JSON[_0x7366('0x16')](_0x431c01));io['to'](_0x2c0422)[_0x7366('0x17')](_0xe2c87b,_0x431c01);}function handleError(_0x41113f){return function(_0x1a71f5){console['log'](_0x7366('0x18'),_0x1a71f5,_0x1a71f5 instanceof RangeError);logger['error'](_0x1a71f5[_0x7366('0x19')]);if(_0x1a71f5 instanceof RangeError){if(_0x1a71f5[_0x7366('0x1a')]){delete _0x1a71f5[_0x7366('0x1a')];}_0x41113f['status'](0x194)[_0x7366('0x1b')](_0x1a71f5);}else{if(_0x1a71f5[_0x7366('0x1a')]){delete _0x1a71f5[_0x7366('0x1a')];}_0x41113f['status'](0x1f4)[_0x7366('0x1b')](_0x1a71f5);}};}function checkError(){return function(_0x1946c6){if(!_0x1946c6){throw new RangeError('NotFound');}return _0x1946c6;};}function respondWithRpcPromise(_0x3bfbca,_0x411dfe){return new BPromise(function(_0xaab659,_0x1a12d2){var _0x3c30a2=amiClient;return _0x3c30a2[_0x7366('0x1c')](_0x3bfbca,_0x411dfe)[_0x7366('0x1d')](function(_0x22ed7e){if(_0x22ed7e[_0x7366('0x1e')]){if(_0x22ed7e[_0x7366('0x1e')][_0x7366('0x1f')]===0x1f4){return _0x1a12d2(_0x22ed7e[_0x7366('0x1e')][_0x7366('0x20')]);}return _0xaab659(_0x22ed7e['error'][_0x7366('0x20')]);}else{_0xaab659(_0x22ed7e['result']);}})[_0x7366('0x21')](function(_0x4ab987){_0x1a12d2(_0x4ab987);});});}function getAgent(_0x5e30fb){return db[_0x7366('0x22')]['findOne']({'where':{'id':_0x5e30fb,'role':_0x7366('0x23')}})['then'](checkError());}function getAgentCheckSession(_0x256633,_0x191177){return new BPromise(function(_0x5c37e2,_0x6d196a){var _0x565aa7=respondWithRpcPromise(_0x7366('0x24'));var _0x2b61af=getAgent(_0x256633);Promise['all']([_0x565aa7,_0x2b61af])[_0x7366('0x1d')](function(_0x507baf){var _0xc58ac7=_0x507baf[0x0];var _0x46f80f=_0x507baf[0x1];var _0x39d6ea=_[_0x7366('0x25')](_0xc58ac7[_0x7366('0x26')],function(_0x5e075c){return _0x5e075c[_0x7366('0x27')]==_0x46f80f['id']&&_0x5e075c[_0x7366('0x28')]==_0x191177;});if(_0x39d6ea['length']==0x1){_0x5c37e2(_0x46f80f);}else{_0x6d196a(new RangeError('sessionId\x20'+_0x191177+'\x20not\x20found!'));}});});}exports['originate']=function(_0x2a1d46,_0x43d487){logger[_0x7366('0x15')](_0x7366('0x29'),_0x2a1d46['body']);var _0x3ca5e6=originateValidation[_0x7366('0xe')](_0x2a1d46[_0x7366('0x2a')]);if(_0x3ca5e6[_0x7366('0x2b')]>0x0){return _0x43d487['status'](0x190)[_0x7366('0x2c')](_0x3ca5e6);}var _0x311dab=_0x2a1d46['body'][_0x7366('0x2d')];var _0x44c81e=_0x2a1d46[_0x7366('0x2a')][_0x7366('0x2e')];var _0x7779c7=_0x2a1d46[_0x7366('0x2a')][_0x7366('0x2f')];var _0x26858b=_0x2a1d46[_0x7366('0x2a')]['callbackUrl'];return getAgent(_0x311dab)[_0x7366('0x1d')](function(_0x83b879){logger['info'](_0x7366('0x30'),_0x83b879[_0x7366('0x1a')]);emit(util[_0x7366('0x31')]('user:%s',_0x83b879[_0x7366('0x1a')]),'webbar:originate',{'callNumber':_0x44c81e,'callerId':_0x7779c7,'callbackUrl':_0x26858b});return _0x43d487[_0x7366('0x32')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x7366('0x21')](handleError(_0x43d487));};exports['hangup']=function(_0x3228b5,_0x116081){logger['info'](_0x7366('0x33'),_0x3228b5['body']);var _0x36f861=hangupValidation[_0x7366('0xe')](_0x3228b5[_0x7366('0x2a')]);if(_0x36f861[_0x7366('0x2b')]>0x0){return _0x116081['status'](0x190)[_0x7366('0x2c')](_0x36f861);}var _0x1d8be3=_0x3228b5[_0x7366('0x2a')]['userId'];var _0x487e36=_0x3228b5[_0x7366('0x2a')][_0x7366('0x28')];return getAgent(_0x1d8be3)[_0x7366('0x1d')](function(_0x18e9b1){logger[_0x7366('0x15')](_0x7366('0x30'),_0x18e9b1['name']);emit(util['format'](_0x7366('0x34'),_0x18e9b1[_0x7366('0x1a')]),'webbar:hangup',{'sessionId':_0x487e36});return _0x116081[_0x7366('0x32')](0xc8)[_0x7366('0x2c')]({'error':![],'message':'hangup\x20executed!'});})[_0x7366('0x21')](handleError(_0x116081));};exports['answer']=function(_0xafac5,_0x1834cf){logger['info']('answer\x20fired:',_0xafac5[_0x7366('0x2a')]);var _0xedc3c7=answerValidation[_0x7366('0xe')](_0xafac5[_0x7366('0x2a')]);if(_0xedc3c7['length']>0x0){return _0x1834cf[_0x7366('0x32')](0x190)[_0x7366('0x2c')](_0xedc3c7);}var _0xb9d7e4=_0xafac5[_0x7366('0x2a')][_0x7366('0x2d')];var _0x3d8c79=_0xafac5[_0x7366('0x2a')]['sessionId'];return getAgent(_0xb9d7e4)[_0x7366('0x1d')](function(_0x320fc2){logger[_0x7366('0x15')]('entityFound:',_0x320fc2[_0x7366('0x1a')]);emit(util[_0x7366('0x31')]('user:%s',_0x320fc2[_0x7366('0x1a')]),_0x7366('0x35'),{'sessionId':_0x3d8c79});return _0x1834cf[_0x7366('0x32')](0xc8)['json']({'error':![],'message':_0x7366('0x36')});})[_0x7366('0x21')](handleError(_0x1834cf));};exports[_0x7366('0x37')]=function(_0x570459,_0x37b251){logger[_0x7366('0x15')](_0x7366('0x38'),_0x570459['body']);var _0xb32e28=holdValidation[_0x7366('0xe')](_0x570459[_0x7366('0x2a')]);if(_0xb32e28[_0x7366('0x2b')]>0x0){return _0x37b251['status'](0x190)[_0x7366('0x2c')](_0xb32e28);}var _0x2d1c52=_0x570459[_0x7366('0x2a')][_0x7366('0x2d')];var _0x3cf180=_0x570459[_0x7366('0x2a')][_0x7366('0x28')];return getAgent(_0x2d1c52)[_0x7366('0x1d')](function(_0x2ad8bf){logger['info'](_0x7366('0x30'),_0x2ad8bf[_0x7366('0x1a')]);emit(util['format'](_0x7366('0x34'),_0x2ad8bf[_0x7366('0x1a')]),'webbar:hold',{'sessionId':_0x3cf180});return _0x37b251[_0x7366('0x32')](0xc8)['json']({'error':![],'message':_0x7366('0x39')});})[_0x7366('0x21')](handleError(_0x37b251));};exports[_0x7366('0x3a')]=function(_0x22026a,_0x588b31){logger[_0x7366('0x15')](_0x7366('0x3b'),_0x22026a[_0x7366('0x2a')]);var _0x46a532=unholdValidation[_0x7366('0xe')](_0x22026a[_0x7366('0x2a')]);if(_0x46a532[_0x7366('0x2b')]>0x0){return _0x588b31[_0x7366('0x32')](0x190)[_0x7366('0x2c')](_0x46a532);}var _0x336b4d=_0x22026a[_0x7366('0x2a')][_0x7366('0x2d')];var _0x5d2a2c=_0x22026a[_0x7366('0x2a')]['sessionId'];return getAgent(_0x336b4d)['then'](function(_0x1d488b){logger[_0x7366('0x15')]('entityFound:',_0x1d488b[_0x7366('0x1a')]);emit(util[_0x7366('0x31')]('user:%s',_0x1d488b['name']),_0x7366('0x3c'),{'sessionId':_0x5d2a2c});return _0x588b31['status'](0xc8)[_0x7366('0x2c')]({'error':![],'message':_0x7366('0x3d')});})['catch'](handleError(_0x588b31));};exports[_0x7366('0x3e')]=function(_0x1b3923,_0xcce4ef){logger['info'](_0x7366('0x3f'),_0xcce4ef[_0x7366('0x2a')]);var _0x2ca931=callsValidation[_0x7366('0xe')](_0x1b3923['body']);if(_0x2ca931[_0x7366('0x2b')]>0x0){return _0xcce4ef[_0x7366('0x32')](0x190)[_0x7366('0x2c')](_0x2ca931);}var _0xa15c2b=_0x1b3923[_0x7366('0x2a')]['userId'];var _0x1249a7=respondWithRpcPromise(_0x7366('0x24'));var _0x5b3160=getAgent(_0xa15c2b);return Promise[_0x7366('0x40')]([_0x1249a7,_0x5b3160])['then'](function(_0x2335cc){var _0x5cbefc=_0x2335cc[0x0];var _0x427066=_0x2335cc[0x1];var _0x16d438=_['filter'](_0x5cbefc[_0x7366('0x26')],function(_0xec468a){return _0xec468a[_0x7366('0x27')]==_0x427066['id'];});return _0xcce4ef[_0x7366('0x32')](0xc8)['json']({'count':_0x16d438['length'],'rows':_0x16d438});})[_0x7366('0x21')](handleError(_0xcce4ef));};exports['conference']=function(_0x432755,_0x14f758){logger[_0x7366('0x15')](_0x7366('0x41'),_0x432755[_0x7366('0x2a')]);var _0x3e64b7=conferenceValidation[_0x7366('0xe')](_0x432755[_0x7366('0x2a')]);if(_0x3e64b7[_0x7366('0x2b')]>0x0){return _0x14f758['status'](0x190)[_0x7366('0x2c')](_0x3e64b7);}var _0x52d254=_0x432755['body']['userId'];return getAgent(_0x52d254)[_0x7366('0x1d')](function(_0x523016){logger[_0x7366('0x15')]('entityFound:',_0x523016[_0x7366('0x1a')]);emit(util['format'](_0x7366('0x34'),_0x523016[_0x7366('0x1a')]),'webbar:conference');return _0x14f758['status'](0xc8)[_0x7366('0x2c')]({'error':![],'message':_0x7366('0x42')});})[_0x7366('0x21')](handleError(_0x14f758));};exports[_0x7366('0x43')]=function(_0x5dc9e2,_0x349bd2){logger[_0x7366('0x15')](_0x7366('0x44'),_0x5dc9e2['body']);var _0x5a9aeb=transferValidation[_0x7366('0xe')](_0x5dc9e2[_0x7366('0x2a')]);if(_0x5a9aeb[_0x7366('0x2b')]>0x0){return _0x349bd2['status'](0x190)[_0x7366('0x2c')](_0x5a9aeb);}var _0x1e121f=_0x5dc9e2[_0x7366('0x2a')][_0x7366('0x2d')];var _0x3aa57b=_0x5dc9e2[_0x7366('0x2a')][_0x7366('0x28')];var _0x38c65b=_0x5dc9e2[_0x7366('0x2a')][_0x7366('0x45')];return getAgent(_0x1e121f)[_0x7366('0x1d')](function(_0x5d5c2e){logger[_0x7366('0x15')](_0x7366('0x30'),_0x5d5c2e['name']);emit(util[_0x7366('0x31')]('user:%s',_0x5d5c2e['name']),_0x7366('0x46'),{'sessionId':_0x3aa57b,'transferNumber':_0x38c65b});return _0x349bd2[_0x7366('0x32')](0xc8)[_0x7366('0x2c')]({'error':![],'message':_0x7366('0x47')});})[_0x7366('0x21')](handleError(_0x349bd2));}; \ No newline at end of file +var _0xbf6e=['bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','log','stack','name','status','send','NotFound','request','then','error','code','message','result','catch','User','agent','VoiceChannels','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','filter','UserId','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','../../mysqldb','../../config/environment','util'];(function(_0x14f80d,_0x3a99aa){var _0x4a25ea=function(_0x5953e2){while(--_0x5953e2){_0x14f80d['push'](_0x14f80d['shift']());}};_0x4a25ea(++_0x3a99aa);}(_0xbf6e,0x149));var _0xebf6=function(_0x42eb9d,_0xc372c4){_0x42eb9d=_0x42eb9d-0x0;var _0x2bbe80=_0xbf6e[_0x42eb9d];return _0x2bbe80;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0xebf6('0x0'))['db'];var config=require(_0xebf6('0x1'));var util=require(_0xebf6('0x2'));var BPromise=require(_0xebf6('0x3'));var jayson=require(_0xebf6('0x4'));var amiClient=jayson[_0xebf6('0x5')][_0xebf6('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0xebf6('0x7'));var Redis=require(_0xebf6('0x8'));config[_0xebf6('0x9')]=_[_0xebf6('0xa')](config[_0xebf6('0x9')],{'host':_0xebf6('0xb'),'port':0x18eb});var io=require(_0xebf6('0xc'))(new Redis(config['redis']));var Schema=require(_0xebf6('0xd'));var originateValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'callNumber':{'type':'string','required':[!![],_0xebf6('0x10')]},'callerId':{'type':_0xebf6('0x11')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xebf6('0x11'),'required':[!![],_0xebf6('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xebf6('0xf')]}});function emit(_0x2c980f,_0xb164a1,_0x642167){logger[_0xebf6('0x13')](_0x2c980f,_0xb164a1,JSON[_0xebf6('0x14')](_0x642167));io['to'](_0x2c980f)[_0xebf6('0x15')](_0xb164a1,_0x642167);}function handleError(_0x2dc96f){return function(_0x2d3984){console[_0xebf6('0x16')]('handleError:',_0x2d3984,_0x2d3984 instanceof RangeError);logger['error'](_0x2d3984[_0xebf6('0x17')]);if(_0x2d3984 instanceof RangeError){if(_0x2d3984[_0xebf6('0x18')]){delete _0x2d3984[_0xebf6('0x18')];}_0x2dc96f[_0xebf6('0x19')](0x194)[_0xebf6('0x1a')](_0x2d3984);}else{if(_0x2d3984[_0xebf6('0x18')]){delete _0x2d3984[_0xebf6('0x18')];}_0x2dc96f[_0xebf6('0x19')](0x1f4)['send'](_0x2d3984);}};}function checkError(){return function(_0xbe39dd){if(!_0xbe39dd){throw new RangeError(_0xebf6('0x1b'));}return _0xbe39dd;};}function respondWithRpcPromise(_0x377934,_0x23d487){return new BPromise(function(_0x6303ac,_0x14c8ac){var _0x2f419e=amiClient;return _0x2f419e[_0xebf6('0x1c')](_0x377934,_0x23d487)[_0xebf6('0x1d')](function(_0x2e32c6){if(_0x2e32c6[_0xebf6('0x1e')]){if(_0x2e32c6[_0xebf6('0x1e')][_0xebf6('0x1f')]===0x1f4){return _0x14c8ac(_0x2e32c6[_0xebf6('0x1e')][_0xebf6('0x20')]);}return _0x6303ac(_0x2e32c6[_0xebf6('0x1e')][_0xebf6('0x20')]);}else{_0x6303ac(_0x2e32c6[_0xebf6('0x21')]);}})[_0xebf6('0x22')](function(_0x4dadf7){_0x14c8ac(_0x4dadf7);});});}function getAgent(_0x58fb66){return db[_0xebf6('0x23')]['findOne']({'where':{'id':_0x58fb66,'role':_0xebf6('0x24')}})[_0xebf6('0x1d')](checkError());}function getAgentCheckSession(_0x5a01ea,_0x4f39eb){return new BPromise(function(_0x37950c,_0x40ae57){var _0x3c3d5c=respondWithRpcPromise(_0xebf6('0x25'));var _0xedaaeb=getAgent(_0x5a01ea);Promise[_0xebf6('0x26')]([_0x3c3d5c,_0xedaaeb])[_0xebf6('0x1d')](function(_0x7551ce){var _0x4c3495=_0x7551ce[0x0];var _0x37cd67=_0x7551ce[0x1];var _0x78cdf0=_['filter'](_0x4c3495[_0xebf6('0x27')],function(_0x28bbea){return _0x28bbea['UserId']==_0x37cd67['id']&&_0x28bbea[_0xebf6('0x28')]==_0x4f39eb;});if(_0x78cdf0[_0xebf6('0x29')]==0x1){_0x37950c(_0x37cd67);}else{_0x40ae57(new RangeError(_0xebf6('0x2a')+_0x4f39eb+_0xebf6('0x2b')));}});});}exports[_0xebf6('0x2c')]=function(_0x41da63,_0x4907d0){logger[_0xebf6('0x13')](_0xebf6('0x2d'),_0x41da63['body']);var _0x534142=originateValidation[_0xebf6('0xd')](_0x41da63[_0xebf6('0x2e')]);if(_0x534142['length']>0x0){return _0x4907d0[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x534142);}var _0x4d736c=_0x41da63[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x12bd27=_0x41da63['body'][_0xebf6('0x31')];var _0x20192c=_0x41da63[_0xebf6('0x2e')][_0xebf6('0x32')];var _0x4b6d95=_0x41da63['body'][_0xebf6('0x33')];return getAgent(_0x4d736c)[_0xebf6('0x1d')](function(_0x562f76){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x562f76['name']);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x562f76[_0xebf6('0x18')]),_0xebf6('0x37'),{'callNumber':_0x12bd27,'callerId':_0x20192c,'callbackUrl':_0x4b6d95});return _0x4907d0[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x38')});})['catch'](handleError(_0x4907d0));};exports[_0xebf6('0x39')]=function(_0x54702d,_0xafef4d){logger[_0xebf6('0x13')](_0xebf6('0x3a'),_0x54702d[_0xebf6('0x2e')]);var _0x2f1236=hangupValidation[_0xebf6('0xd')](_0x54702d['body']);if(_0x2f1236[_0xebf6('0x29')]>0x0){return _0xafef4d[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x2f1236);}var _0x144b41=_0x54702d[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x49f089=_0x54702d[_0xebf6('0x2e')][_0xebf6('0x28')];return getAgent(_0x144b41)[_0xebf6('0x1d')](function(_0x111ff7){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x111ff7['name']);emit(util['format']('user:%s',_0x111ff7[_0xebf6('0x18')]),_0xebf6('0x3b'),{'sessionId':_0x49f089});return _0xafef4d[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x3c')});})[_0xebf6('0x22')](handleError(_0xafef4d));};exports[_0xebf6('0x3d')]=function(_0x5ca582,_0x8cca55){logger[_0xebf6('0x13')]('answer\x20fired:',_0x5ca582[_0xebf6('0x2e')]);var _0x1de50e=answerValidation[_0xebf6('0xd')](_0x5ca582['body']);if(_0x1de50e[_0xebf6('0x29')]>0x0){return _0x8cca55['status'](0x190)['json'](_0x1de50e);}var _0x256552=_0x5ca582[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x2ac140=_0x5ca582['body'][_0xebf6('0x28')];return getAgent(_0x256552)['then'](function(_0x4483d2){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x4483d2[_0xebf6('0x18')]);emit(util[_0xebf6('0x35')]('user:%s',_0x4483d2['name']),_0xebf6('0x3e'),{'sessionId':_0x2ac140});return _0x8cca55[_0xebf6('0x19')](0xc8)[_0xebf6('0x2f')]({'error':![],'message':_0xebf6('0x3f')});})['catch'](handleError(_0x8cca55));};exports[_0xebf6('0x40')]=function(_0x21999e,_0x41c4ce){logger[_0xebf6('0x13')](_0xebf6('0x41'),_0x21999e[_0xebf6('0x2e')]);var _0x45e0f1=holdValidation['validate'](_0x21999e[_0xebf6('0x2e')]);if(_0x45e0f1[_0xebf6('0x29')]>0x0){return _0x41c4ce[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x45e0f1);}var _0x166664=_0x21999e[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x56b26b=_0x21999e[_0xebf6('0x2e')]['sessionId'];return getAgent(_0x166664)[_0xebf6('0x1d')](function(_0x31d8ba){logger['info'](_0xebf6('0x34'),_0x31d8ba['name']);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x31d8ba[_0xebf6('0x18')]),_0xebf6('0x42'),{'sessionId':_0x56b26b});return _0x41c4ce[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x43')});})[_0xebf6('0x22')](handleError(_0x41c4ce));};exports['unhold']=function(_0x1f98fd,_0x2765f2){logger[_0xebf6('0x13')](_0xebf6('0x44'),_0x1f98fd[_0xebf6('0x2e')]);var _0x549892=unholdValidation[_0xebf6('0xd')](_0x1f98fd[_0xebf6('0x2e')]);if(_0x549892[_0xebf6('0x29')]>0x0){return _0x2765f2[_0xebf6('0x19')](0x190)['json'](_0x549892);}var _0x3629aa=_0x1f98fd[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x303997=_0x1f98fd[_0xebf6('0x2e')][_0xebf6('0x28')];return getAgent(_0x3629aa)[_0xebf6('0x1d')](function(_0x9184ce){logger[_0xebf6('0x13')]('entityFound:',_0x9184ce[_0xebf6('0x18')]);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x9184ce['name']),_0xebf6('0x45'),{'sessionId':_0x303997});return _0x2765f2['status'](0xc8)['json']({'error':![],'message':_0xebf6('0x46')});})[_0xebf6('0x22')](handleError(_0x2765f2));};exports[_0xebf6('0x47')]=function(_0x32baee,_0x13c447){logger['info'](_0xebf6('0x48'),_0x13c447['body']);var _0x4ed306=callsValidation['validate'](_0x32baee[_0xebf6('0x2e')]);if(_0x4ed306[_0xebf6('0x29')]>0x0){return _0x13c447['status'](0x190)[_0xebf6('0x2f')](_0x4ed306);}var _0x151476=_0x32baee[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x3a4b20=respondWithRpcPromise(_0xebf6('0x25'));var _0x246f9f=getAgent(_0x151476);return Promise['all']([_0x3a4b20,_0x246f9f])[_0xebf6('0x1d')](function(_0xddf329){var _0x40d85f=_0xddf329[0x0];var _0x3101c2=_0xddf329[0x1];var _0x39637b=_[_0xebf6('0x49')](_0x40d85f['rows'],function(_0x44a46f){return _0x44a46f[_0xebf6('0x4a')]==_0x3101c2['id'];});return _0x13c447[_0xebf6('0x19')](0xc8)[_0xebf6('0x2f')]({'count':_0x39637b[_0xebf6('0x29')],'rows':_0x39637b});})[_0xebf6('0x22')](handleError(_0x13c447));};exports['conference']=function(_0x33c973,_0x193e5b){logger[_0xebf6('0x13')](_0xebf6('0x4b'),_0x33c973[_0xebf6('0x2e')]);var _0x537751=conferenceValidation[_0xebf6('0xd')](_0x33c973[_0xebf6('0x2e')]);if(_0x537751[_0xebf6('0x29')]>0x0){return _0x193e5b[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x537751);}var _0x6c43e4=_0x33c973[_0xebf6('0x2e')][_0xebf6('0x30')];return getAgent(_0x6c43e4)[_0xebf6('0x1d')](function(_0x3debd2){logger[_0xebf6('0x13')]('entityFound:',_0x3debd2[_0xebf6('0x18')]);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x3debd2[_0xebf6('0x18')]),_0xebf6('0x4c'));return _0x193e5b[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x4d')});})['catch'](handleError(_0x193e5b));};exports[_0xebf6('0x4e')]=function(_0x34fa02,_0x10272b){logger[_0xebf6('0x13')](_0xebf6('0x4f'),_0x34fa02[_0xebf6('0x2e')]);var _0x398074=transferValidation['validate'](_0x34fa02['body']);if(_0x398074[_0xebf6('0x29')]>0x0){return _0x10272b[_0xebf6('0x19')](0x190)['json'](_0x398074);}var _0x3dc02c=_0x34fa02[_0xebf6('0x2e')]['userId'];var _0x3bee09=_0x34fa02[_0xebf6('0x2e')]['sessionId'];var _0x35a5c4=_0x34fa02[_0xebf6('0x2e')][_0xebf6('0x50')];return getAgent(_0x3dc02c)[_0xebf6('0x1d')](function(_0x345763){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x345763['name']);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x345763[_0xebf6('0x18')]),_0xebf6('0x51'),{'sessionId':_0x3bee09,'transferNumber':_0x35a5c4});return _0x10272b[_0xebf6('0x19')](0xc8)[_0xebf6('0x2f')]({'error':![],'message':_0xebf6('0x52')});})[_0xebf6('0x22')](handleError(_0x10272b));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 9018fe6..90cde96 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 _0x01d9=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x459734,_0x3e0440){var _0x328917=function(_0x5a9b4a){while(--_0x5a9b4a){_0x459734['push'](_0x459734['shift']());}};_0x328917(++_0x3e0440);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var fs_extra=require(_0x901d('0x5'));var auth=require(_0x901d('0x6'));var interaction=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var controller=require(_0x901d('0x9'));router[_0x901d('0xa')]('/',auth['isAuthenticated'](),controller[_0x901d('0xb')]);router[_0x901d('0xa')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0xe')]);router[_0x901d('0xa')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x10')]);router[_0x901d('0xa')](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x12')]);router['get'](_0x901d('0x13'),auth['isAuthenticated'](),controller[_0x901d('0x14')]);router[_0x901d('0xa')](_0x901d('0x15'),auth[_0x901d('0xd')](),controller[_0x901d('0x16')]);router['get'](_0x901d('0x17'),auth[_0x901d('0xd')](),controller[_0x901d('0x18')]);router[_0x901d('0x19')]('/',auth[_0x901d('0xd')](),controller[_0x901d('0x1a')]);router['post'](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x1b')]);router[_0x901d('0x19')](_0x901d('0x13'),auth[_0x901d('0xd')](),controller[_0x901d('0x1c')]);router[_0x901d('0x19')](_0x901d('0x15'),auth[_0x901d('0xd')](),controller[_0x901d('0x1d')]);router[_0x901d('0x19')](_0x901d('0x17'),auth[_0x901d('0xd')](),controller[_0x901d('0x1e')]);router[_0x901d('0x19')](_0x901d('0x1f'),controller[_0x901d('0x20')]);router['post'](_0x901d('0x21'),auth[_0x901d('0xd')](),controller['send']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x901d('0x22')]);router[_0x901d('0x23')]('/:id',auth[_0x901d('0xd')](),controller[_0x901d('0x24')]);router['delete'](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x25')]);router[_0x901d('0x23')](_0x901d('0x13'),auth[_0x901d('0xd')](),controller[_0x901d('0x26')]);router[_0x901d('0x23')]('/:id/users',auth[_0x901d('0xd')](),controller[_0x901d('0x27')]);module[_0x901d('0x28')]=router; \ No newline at end of file +var _0x93e9=['/describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','/:id/users','addApplications','/:id/notify','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index'];(function(_0x4bfade,_0xb26c0e){var _0x272465=function(_0x3b38cb){while(--_0x3b38cb){_0x4bfade['push'](_0x4bfade['shift']());}};_0x272465(++_0xb26c0e);}(_0x93e9,0xcc));var _0x993e=function(_0x1dd8a3,_0x49a0c2){_0x1dd8a3=_0x1dd8a3-0x0;var _0x185f77=_0x93e9[_0x1dd8a3];return _0x185f77;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var fs_extra=require(_0x993e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x993e('0x7'));var controller=require(_0x993e('0x8'));router[_0x993e('0x9')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0xb')]);router[_0x993e('0x9')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller['describe']);router[_0x993e('0x9')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0xe')]);router[_0x993e('0x9')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller['getDispositions']);router[_0x993e('0x9')](_0x993e('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x993e('0x9')]('/:id/users',auth[_0x993e('0xa')](),controller['getAgents']);router['get'](_0x993e('0x11'),auth[_0x993e('0xa')](),controller[_0x993e('0x12')]);router[_0x993e('0x13')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0x14')]);router[_0x993e('0x13')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller[_0x993e('0x15')]);router[_0x993e('0x13')](_0x993e('0x10'),auth[_0x993e('0xa')](),controller[_0x993e('0x16')]);router[_0x993e('0x13')](_0x993e('0x17'),auth[_0x993e('0xa')](),controller['addAgents']);router[_0x993e('0x13')](_0x993e('0x11'),auth[_0x993e('0xa')](),controller[_0x993e('0x18')]);router[_0x993e('0x13')](_0x993e('0x19'),controller['notify']);router[_0x993e('0x13')](_0x993e('0x1a'),auth[_0x993e('0xa')](),controller[_0x993e('0x1b')]);router[_0x993e('0x1c')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0x1d')]);router['delete'](_0x993e('0xd'),auth['isAuthenticated'](),controller[_0x993e('0x1e')]);router[_0x993e('0x1f')](_0x993e('0xf'),auth['isAuthenticated'](),controller[_0x993e('0x20')]);router[_0x993e('0x1f')](_0x993e('0x10'),auth[_0x993e('0xa')](),controller[_0x993e('0x21')]);router[_0x993e('0x1f')](_0x993e('0x17'),auth[_0x993e('0xa')](),controller[_0x993e('0x22')]);module[_0x993e('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 7b7aa5b..36f9567 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 _0x4cc8=['mandatoryDispositionPauseId','randomstring','exports','STRING','generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x44c568,_0x416971){var _0x3d5021=function(_0x1fe6f1){while(--_0x1fe6f1){_0x44c568['push'](_0x44c568['shift']());}};_0x3d5021(++_0x416971);}(_0x4cc8,0xde));var _0x84cc=function(_0x47c2d0,_0x557548){_0x47c2d0=_0x47c2d0-0x0;var _0x4a614e=_0x4cc8[_0x47c2d0];return _0x4a614e;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x84cc('0x0'));module[_0x84cc('0x1')]={'name':{'type':Sequelize[_0x84cc('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x84cc('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x84cc('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x84cc('0x2')],'defaultValue':function(){return rs[_0x84cc('0x3')]();}},'phone':{'type':Sequelize[_0x84cc('0x2')]},'type':{'type':Sequelize[_0x84cc('0x4')]('twilio',_0x84cc('0x5'))},'accountSid':{'type':Sequelize[_0x84cc('0x2')]},'baseUrl':{'type':Sequelize[_0x84cc('0x2')]},'authToken':{'type':Sequelize[_0x84cc('0x2')]},'notificationTemplate':{'type':Sequelize[_0x84cc('0x6')],'defaultValue':function(){return _0x84cc('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x84cc('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x84cc('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x84cc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x84cc('0x9')],'comment':_0x84cc('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x84cc('0x8')],'defaultValue':![],'comment':_0x84cc('0xb'),'set':function(_0xa0e895){if(!_0xa0e895){this['setDataValue'](_0x84cc('0xc'),null);}this['setDataValue']('mandatoryDisposition',_0xa0e895);}},'description':{'type':Sequelize[_0x84cc('0x2')]}}; \ No newline at end of file +var _0x2fe2=['STRING','generate','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','name'];(function(_0x12a362,_0x59440a){var _0x4d5c31=function(_0x1e653d){while(--_0x1e653d){_0x12a362['push'](_0x12a362['shift']());}};_0x4d5c31(++_0x59440a);}(_0x2fe2,0x93));var _0x22fe=function(_0x3f1b6a,_0x3481a0){_0x3f1b6a=_0x3f1b6a-0x0;var _0x25ff3b=_0x2fe2[_0x3f1b6a];return _0x25ff3b;};'use strict';var Sequelize=require(_0x22fe('0x0'));var rs=require('randomstring');module[_0x22fe('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x22fe('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x22fe('0x3')],'defaultValue':function(){return rs[_0x22fe('0x4')]();}},'phone':{'type':Sequelize[_0x22fe('0x3')]},'type':{'type':Sequelize['ENUM'](_0x22fe('0x5'),_0x22fe('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x22fe('0x3')]},'authToken':{'type':Sequelize[_0x22fe('0x3')]},'notificationTemplate':{'type':Sequelize[_0x22fe('0x7')],'defaultValue':function(){return _0x22fe('0x8');}},'notificationSound':{'type':Sequelize[_0x22fe('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x22fe('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x22fe('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x22fe('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x22fe('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x22fe('0x9')],'defaultValue':![],'comment':_0x22fe('0xc'),'set':function(_0x268b3b){if(!_0x268b3b){this[_0x22fe('0xd')]('mandatoryDispositionPauseId',null);}this[_0x22fe('0xd')](_0x22fe('0xe'),_0x268b3b);}},'description':{'type':Sequelize[_0x22fe('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 5635237..f263191 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 _0x5691=['Messages','push','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','json','undefined','limit','count','offset','status','set','Content-Range','apply','save','update','destroy','get','WhatsappAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','WhatsappAccount','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','describe','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','finally','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','timestamp','message_id','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','DESC','list','Contacts','contact','WhatsappInteraction','interaction','created','applications','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','\x0a','to\x20is\x20mandatory','List','ListId','dataValues'];(function(_0x2b91c1,_0x3677de){var _0x341e69=function(_0x4fdf92){while(--_0x4fdf92){_0x2b91c1['push'](_0x2b91c1['shift']());}};_0x341e69(++_0x3677de);}(_0x5691,0xcb));var _0x1569=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5691[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1569('0x0'));var rimraf=require(_0x1569('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1569('0x2'));var rp=require(_0x1569('0x3'));var moment=require(_0x1569('0x4'));var BPromise=require(_0x1569('0x5'));var Mustache=require(_0x1569('0x6'));var util=require(_0x1569('0x7'));var path=require(_0x1569('0x8'));var sox=require(_0x1569('0x9'));var csv=require('to-csv');var ejs=require(_0x1569('0xa'));var fs=require('fs');var fs_extra=require(_0x1569('0xb'));var _=require('lodash');var squel=require(_0x1569('0xc'));var crypto=require(_0x1569('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1569('0xe'));var toCsv=require(_0x1569('0xf'));var querystring=require(_0x1569('0x10'));var Papa=require(_0x1569('0x11'));var Redis=require(_0x1569('0x12'));var authService=require(_0x1569('0x13'));var qs=require(_0x1569('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1569('0x15'));var logger=require(_0x1569('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x1569('0x17'));var licenseUtil=require(_0x1569('0x18'));var db=require(_0x1569('0x19'))['db'];config[_0x1569('0x1a')]=_[_0x1569('0x1b')](config['redis'],{'host':_0x1569('0x1c'),'port':0x18eb});var socket=require(_0x1569('0x1d'))(new Redis(config[_0x1569('0x1a')]));require(_0x1569('0x1e'))['register'](socket);var jayson=require(_0x1569('0x1f'));var client=jayson[_0x1569('0x20')][_0x1569('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x3a6edf,_0x2d778d,_0x28d484,_0x402c8f){return new BPromise(function(_0x6a1e9a,_0x2eef42){var _0x2785e6=_0x402c8f||client;return _0x2785e6[_0x1569('0x22')](_0x3a6edf,_0x28d484)[_0x1569('0x23')](function(_0x2629f6){logger[_0x1569('0x24')](_0x1569('0x25'),_0x2d778d,_0x1569('0x26'));logger[_0x1569('0x27')](_0x1569('0x28'),_0x2d778d,_0x1569('0x26'),JSON[_0x1569('0x29')](_0x2629f6));if(_0x2629f6[_0x1569('0x2a')]){if(_0x2629f6[_0x1569('0x2a')]['code']===0x1f4){logger[_0x1569('0x2a')](_0x1569('0x25'),_0x2d778d,_0x2629f6[_0x1569('0x2a')][_0x1569('0x2b')]);return _0x2eef42(_0x2629f6[_0x1569('0x2a')][_0x1569('0x2b')]);}logger[_0x1569('0x2a')]('WhatsappAccount,\x20%s,\x20%s',_0x2d778d,_0x2629f6[_0x1569('0x2a')][_0x1569('0x2b')]);return _0x6a1e9a(_0x2629f6[_0x1569('0x2a')][_0x1569('0x2b')]);}else{logger[_0x1569('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x2d778d,_0x1569('0x26'));_0x6a1e9a(_0x2629f6[_0x1569('0x2c')][_0x1569('0x2b')]);}})[_0x1569('0x2d')](function(_0x33f5df){logger[_0x1569('0x2a')](_0x1569('0x25'),_0x2d778d,_0x33f5df);_0x2eef42(_0x33f5df);});});}function respondWithStatusCode(_0x846636,_0x52ecca){_0x52ecca=_0x52ecca||0xcc;return function(_0x323e88){if(_0x323e88){return _0x846636[_0x1569('0x2e')](_0x52ecca);}return _0x846636['status'](_0x52ecca)['end']();};}function respondWithResult(_0x3cb86d,_0x1a16ca){_0x1a16ca=_0x1a16ca||0xc8;return function(_0x142aa0){if(_0x142aa0){return _0x3cb86d['status'](_0x1a16ca)[_0x1569('0x2f')](_0x142aa0);}};}function respondWithFilteredResult(_0x3fad8b,_0x14cafa){return function(_0x457ae8){if(_0x457ae8){var _0x4e45a7=typeof _0x14cafa['offset']===_0x1569('0x30')&&typeof _0x14cafa[_0x1569('0x31')]===_0x1569('0x30');var _0xa06d97=_0x457ae8[_0x1569('0x32')];var _0x4a63a5=_0x4e45a7?0x0:_0x14cafa[_0x1569('0x33')];var _0x3a3e01=_0x4e45a7?_0x457ae8['count']:_0x14cafa[_0x1569('0x33')]+_0x14cafa[_0x1569('0x31')];var _0x4dff52;if(_0x3a3e01>=_0xa06d97){_0x3a3e01=_0xa06d97;_0x4dff52=0xc8;}else{_0x4dff52=0xce;}_0x3fad8b[_0x1569('0x34')](_0x4dff52);return _0x3fad8b[_0x1569('0x35')](_0x1569('0x36'),_0x4a63a5+'-'+_0x3a3e01+'/'+_0xa06d97)[_0x1569('0x2f')](_0x457ae8);}return null;};}function patchUpdates(_0xcbd223){return function(_0x3b488b){try{jsonpatch[_0x1569('0x37')](_0x3b488b,_0xcbd223,!![]);}catch(_0x248f7d){return BPromise['reject'](_0x248f7d);}return _0x3b488b[_0x1569('0x38')]();};}function saveUpdates(_0x1e3c6e,_0x31c0bf){return function(_0x3579b5){if(_0x3579b5){return _0x3579b5[_0x1569('0x39')](_0x1e3c6e)[_0x1569('0x23')](function(_0x363bee){return _0x363bee;});}return null;};}function removeEntity(_0x346822,_0x51dcc5){return function(_0x351816){if(_0x351816){return _0x351816[_0x1569('0x3a')]()[_0x1569('0x23')](function(){var _0x9cf138=_0x351816[_0x1569('0x3b')]({'plain':!![]});var _0x457df8=_0x1569('0x3c');return db['UserProfileResource'][_0x1569('0x3a')]({'where':{'type':_0x457df8,'resourceId':_0x9cf138['id']}})[_0x1569('0x23')](function(){return _0x351816;});})[_0x1569('0x23')](function(){_0x346822[_0x1569('0x34')](0xcc)[_0x1569('0x3d')]();});}};}function handleEntityNotFound(_0x1563e9,_0x1a78c8){return function(_0x2d2003){if(!_0x2d2003){_0x1563e9[_0x1569('0x2e')](0x194);}return _0x2d2003;};}function handleError(_0x400045,_0x2201ad){_0x2201ad=_0x2201ad||0x1f4;return function(_0x499abb){logger[_0x1569('0x2a')](_0x499abb[_0x1569('0x3e')]);if(_0x499abb[_0x1569('0x3f')]){delete _0x499abb['name'];}_0x400045[_0x1569('0x34')](_0x2201ad)[_0x1569('0x40')](_0x499abb);};}exports[_0x1569('0x41')]=function(_0x42abc1,_0x4f2bfe){var _0x4fef90={'include':[{'model':db[_0x1569('0x42')],'as':_0x1569('0x43')}]},_0xd093eb={},_0x5c7cb0={'count':0x0,'rows':[]};var _0x30dd3c=_[_0x1569('0x44')](db['WhatsappAccount']['rawAttributes'],function(_0x4a95d5){return{'name':_0x4a95d5[_0x1569('0x45')],'type':_0x4a95d5[_0x1569('0x46')][_0x1569('0x47')]};});_0xd093eb[_0x1569('0x48')]=_[_0x1569('0x44')](_0x30dd3c,_0x1569('0x3f'));_0xd093eb[_0x1569('0x49')]=_[_0x1569('0x4a')](_0x42abc1[_0x1569('0x49')]);_0xd093eb[_0x1569('0x4b')]=_[_0x1569('0x4c')](_0xd093eb[_0x1569('0x48')],_0xd093eb[_0x1569('0x49')]);_0x4fef90[_0x1569('0x4d')]=_[_0x1569('0x4c')](_0xd093eb[_0x1569('0x48')],qs[_0x1569('0x4e')](_0x42abc1[_0x1569('0x49')][_0x1569('0x4e')]));_0x4fef90[_0x1569('0x4d')]=_0x4fef90['attributes'][_0x1569('0x4f')]?_0x4fef90[_0x1569('0x4d')]:_0xd093eb[_0x1569('0x48')];if(!_0x42abc1[_0x1569('0x49')]['hasOwnProperty'](_0x1569('0x50'))){_0x4fef90[_0x1569('0x31')]=qs[_0x1569('0x31')](_0x42abc1[_0x1569('0x49')][_0x1569('0x31')]);_0x4fef90[_0x1569('0x33')]=qs[_0x1569('0x33')](_0x42abc1[_0x1569('0x49')][_0x1569('0x33')]);}_0x4fef90[_0x1569('0x51')]=qs[_0x1569('0x52')](_0x42abc1['query'][_0x1569('0x52')]);_0x4fef90[_0x1569('0x53')]=qs[_0x1569('0x4b')](_[_0x1569('0x54')](_0x42abc1['query'],_0xd093eb[_0x1569('0x4b')]),_0x30dd3c);if(_0x42abc1[_0x1569('0x49')][_0x1569('0x55')]){_0x4fef90[_0x1569('0x53')]=_[_0x1569('0x56')](_0x4fef90['where'],{'$or':_[_0x1569('0x44')](_0x30dd3c,function(_0x45ea7e){if(_0x45ea7e[_0x1569('0x46')]!=='VIRTUAL'){var _0x202791={};_0x202791[_0x45ea7e['name']]={'$like':'%'+_0x42abc1['query'][_0x1569('0x55')]+'%'};return _0x202791;}})});}_0x4fef90=_[_0x1569('0x56')]({},_0x4fef90,_0x42abc1[_0x1569('0x57')]);var _0x22206d={'where':_0x4fef90['where']};return db[_0x1569('0x58')]['count'](_0x22206d)[_0x1569('0x23')](function(_0x1777da){_0x5c7cb0[_0x1569('0x32')]=_0x1777da;if(_0x42abc1['query'][_0x1569('0x59')]){_0x4fef90[_0x1569('0x5a')]=[{'all':!![]}];}return db[_0x1569('0x58')][_0x1569('0x5b')](_0x4fef90);})[_0x1569('0x23')](function(_0x5ab537){_0x5c7cb0[_0x1569('0x5c')]=_0x5ab537;return _0x5c7cb0;})[_0x1569('0x23')](respondWithFilteredResult(_0x4f2bfe,_0x4fef90))['catch'](handleError(_0x4f2bfe,null));};exports[_0x1569('0x5d')]=function(_0x5e61f5,_0x2911e9){var _0x458011={'raw':![],'where':{'id':_0x5e61f5['params']['id']},'include':[{'model':db['Pause'],'as':_0x1569('0x43')}]},_0x2e3f47={};_0x2e3f47['model']=_['keys'](db[_0x1569('0x58')][_0x1569('0x5e')]);_0x2e3f47[_0x1569('0x49')]=_[_0x1569('0x4a')](_0x5e61f5[_0x1569('0x49')]);_0x2e3f47[_0x1569('0x4b')]=_[_0x1569('0x4c')](_0x2e3f47[_0x1569('0x48')],_0x2e3f47[_0x1569('0x49')]);_0x458011[_0x1569('0x4d')]=_[_0x1569('0x4c')](_0x2e3f47[_0x1569('0x48')],qs[_0x1569('0x4e')](_0x5e61f5['query'][_0x1569('0x4e')]));_0x458011[_0x1569('0x4d')]=_0x458011[_0x1569('0x4d')][_0x1569('0x4f')]?_0x458011[_0x1569('0x4d')]:_0x2e3f47[_0x1569('0x48')];if(_0x5e61f5['query'][_0x1569('0x59')]){_0x458011['include']=[{'all':!![]}];}_0x458011=_[_0x1569('0x56')]({},_0x458011,_0x5e61f5['options']);return db[_0x1569('0x58')][_0x1569('0x5f')](_0x458011)[_0x1569('0x23')](handleEntityNotFound(_0x2911e9,null))[_0x1569('0x23')](respondWithResult(_0x2911e9,null))[_0x1569('0x2d')](handleError(_0x2911e9,null));};exports[_0x1569('0x60')]=function(_0xc61f38,_0x6a1351){return db['WhatsappAccount'][_0x1569('0x60')](_0xc61f38[_0x1569('0x61')],{})['then'](function(_0x5dee7e){var _0x5cd282=_0xc61f38[_0x1569('0x62')][_0x1569('0x3b')]({'plain':!![]});if(!_0x5cd282)throw new Error(_0x1569('0x63'));if(_0x5cd282[_0x1569('0x64')]==='user'){var _0x2f0c54=_0x5dee7e[_0x1569('0x3b')]({'plain':!![]});var _0x1c1fc1=_0x1569('0x3c');return db[_0x1569('0x65')][_0x1569('0x5f')]({'where':{'name':_0x1c1fc1,'userProfileId':_0x5cd282[_0x1569('0x66')]},'raw':!![]})[_0x1569('0x23')](function(_0x178cc9){if(_0x178cc9&&_0x178cc9[_0x1569('0x67')]===0x0){return db[_0x1569('0x68')][_0x1569('0x60')]({'name':_0x2f0c54[_0x1569('0x3f')],'resourceId':_0x2f0c54['id'],'type':_0x178cc9['name'],'sectionId':_0x178cc9['id']},{})['then'](function(){return _0x5dee7e;});}else{return _0x5dee7e;}})[_0x1569('0x2d')](function(_0x35996f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35996f);throw _0x35996f;});}return _0x5dee7e;})[_0x1569('0x23')](respondWithResult(_0x6a1351,0xc9))[_0x1569('0x2d')](handleError(_0x6a1351,null));};exports[_0x1569('0x39')]=function(_0x405594,_0x1f8cb2){if(_0x405594['body']['id']){delete _0x405594[_0x1569('0x61')]['id'];}return db[_0x1569('0x58')][_0x1569('0x5f')]({'where':{'id':_0x405594[_0x1569('0x69')]['id']},'include':[{'model':db['Pause'],'as':_0x1569('0x43')}]})[_0x1569('0x23')](handleEntityNotFound(_0x1f8cb2,null))['then'](saveUpdates(_0x405594[_0x1569('0x61')],null))[_0x1569('0x23')](respondWithResult(_0x1f8cb2,null))[_0x1569('0x2d')](handleError(_0x1f8cb2,null));};exports['destroy']=function(_0x33dd4b,_0x45aa1f){return db[_0x1569('0x58')][_0x1569('0x5f')]({'where':{'id':_0x33dd4b[_0x1569('0x69')]['id']}})[_0x1569('0x23')](handleEntityNotFound(_0x45aa1f,null))['then'](removeEntity(_0x45aa1f,null))[_0x1569('0x2d')](handleError(_0x45aa1f,null));};exports[_0x1569('0x6a')]=function(_0x42fa73,_0x154c21){return db[_0x1569('0x58')]['describe']()[_0x1569('0x23')](respondWithResult(_0x154c21,null))['catch'](handleError(_0x154c21,null));};exports['addDisposition']=function(_0x422ee7,_0x4c6208,_0x3139ec){if(_0x422ee7['body']['id']){delete _0x422ee7[_0x1569('0x61')]['id'];}return db[_0x1569('0x58')][_0x1569('0x5f')]({'where':{'id':_0x422ee7['params']['id']}})[_0x1569('0x23')](handleEntityNotFound(_0x4c6208,null))[_0x1569('0x23')](function(_0xa2ee3b){if(_0xa2ee3b){_0x422ee7['body'][_0x1569('0x6b')]=_0xa2ee3b['id'];return db[_0x1569('0x6c')][_0x1569('0x60')](_0x422ee7[_0x1569('0x61')]);}})['then'](respondWithResult(_0x4c6208,null))[_0x1569('0x2d')](handleError(_0x4c6208,null));};exports[_0x1569('0x6d')]=function(_0x201c3b,_0x16d170,_0xc8972e){var _0x8d9594={'raw':![],'where':{}};var _0x18d9cd={};var _0x112b35={'count':0x0,'rows':[]};return db[_0x1569('0x58')][_0x1569('0x6e')]({'where':{'id':_0x201c3b['params']['id']}})[_0x1569('0x23')](handleEntityNotFound(_0x16d170,null))[_0x1569('0x23')](function(_0x40417c){if(_0x40417c){_0x18d9cd['model']=_[_0x1569('0x4a')](db[_0x1569('0x6c')][_0x1569('0x5e')]);_0x18d9cd[_0x1569('0x49')]=_['keys'](_0x201c3b[_0x1569('0x49')]);_0x18d9cd[_0x1569('0x4b')]=_['intersection'](_0x18d9cd[_0x1569('0x48')],_0x18d9cd[_0x1569('0x49')]);_0x8d9594[_0x1569('0x4d')]=_[_0x1569('0x4c')](_0x18d9cd[_0x1569('0x48')],qs['fields'](_0x201c3b[_0x1569('0x49')][_0x1569('0x4e')]));_0x8d9594[_0x1569('0x4d')]=_0x8d9594['attributes'][_0x1569('0x4f')]?_0x8d9594[_0x1569('0x4d')]:_0x18d9cd[_0x1569('0x48')];if(!_0x201c3b[_0x1569('0x49')]['hasOwnProperty'](_0x1569('0x50'))){_0x8d9594[_0x1569('0x31')]=qs['limit'](_0x201c3b[_0x1569('0x49')][_0x1569('0x31')]);_0x8d9594[_0x1569('0x33')]=qs[_0x1569('0x33')](_0x201c3b[_0x1569('0x49')][_0x1569('0x33')]);}_0x8d9594[_0x1569('0x51')]=qs[_0x1569('0x52')](_0x201c3b[_0x1569('0x49')][_0x1569('0x52')]);_0x8d9594[_0x1569('0x53')]=qs[_0x1569('0x4b')](_[_0x1569('0x54')](_0x201c3b['query'],_0x18d9cd[_0x1569('0x4b')]));_0x8d9594[_0x1569('0x53')][_0x1569('0x6b')]=_0x40417c['id'];if(_0x201c3b[_0x1569('0x49')][_0x1569('0x55')]){_0x8d9594[_0x1569('0x53')]=_[_0x1569('0x56')](_0x8d9594[_0x1569('0x53')],{'$or':_['map'](_0x8d9594['attributes'],function(_0x55a8fc){var _0x4a7d77={};_0x4a7d77[_0x55a8fc]={'$like':'%'+_0x201c3b[_0x1569('0x49')][_0x1569('0x55')]+'%'};return _0x4a7d77;})});}_0x8d9594=_[_0x1569('0x56')]({},_0x8d9594,_0x201c3b[_0x1569('0x57')]);return db[_0x1569('0x6c')][_0x1569('0x32')]({'where':_0x8d9594[_0x1569('0x53')]})[_0x1569('0x23')](function(_0x734211){_0x112b35[_0x1569('0x32')]=_0x734211;if(_0x201c3b['query'][_0x1569('0x59')]){_0x8d9594['include']=[{'all':!![]}];}return db['Disposition'][_0x1569('0x5b')](_0x8d9594);})[_0x1569('0x23')](function(_0x2a8374){_0x112b35['rows']=_0x2a8374;return _0x112b35;});}})[_0x1569('0x23')](respondWithFilteredResult(_0x16d170,_0x8d9594))[_0x1569('0x2d')](handleError(_0x16d170,null));};exports[_0x1569('0x6f')]=function(_0x5171b0,_0x52cbe1,_0x23cdee){return db[_0x1569('0x58')][_0x1569('0x5f')]({'where':{'id':_0x5171b0[_0x1569('0x69')]['id']}})[_0x1569('0x23')](handleEntityNotFound(_0x52cbe1,null))[_0x1569('0x23')](function(_0x2500e2){if(_0x2500e2){return _0x2500e2['removeDispositions'](_0x5171b0[_0x1569('0x49')]['ids']);}})[_0x1569('0x23')](respondWithStatusCode(_0x52cbe1,null))[_0x1569('0x2d')](handleError(_0x52cbe1,null));};exports[_0x1569('0x70')]=function(_0x54de8f,_0x440925,_0x2dc113){if(_0x54de8f[_0x1569('0x61')]['id']){delete _0x54de8f['body']['id'];}return db[_0x1569('0x58')][_0x1569('0x5f')]({'where':{'id':_0x54de8f['params']['id']}})[_0x1569('0x23')](handleEntityNotFound(_0x440925,null))[_0x1569('0x23')](function(_0x4c09e0){if(_0x4c09e0){_0x54de8f[_0x1569('0x61')]['WhatsappAccountId']=_0x4c09e0['id'];return db[_0x1569('0x71')][_0x1569('0x60')](_0x54de8f[_0x1569('0x61')]);}})[_0x1569('0x23')](respondWithResult(_0x440925,null))[_0x1569('0x2d')](handleError(_0x440925,null));};exports[_0x1569('0x72')]=function(_0x2107e2,_0x502f7c,_0x355477){var _0x482a43={'raw':![],'where':{}};var _0x15740d={};var _0x2e7283={'count':0x0,'rows':[]};return db[_0x1569('0x58')][_0x1569('0x6e')]({'where':{'id':_0x2107e2[_0x1569('0x69')]['id']}})[_0x1569('0x23')](handleEntityNotFound(_0x502f7c,null))[_0x1569('0x23')](function(_0x5d0341){if(_0x5d0341){_0x15740d['model']=_[_0x1569('0x4a')](db[_0x1569('0x71')][_0x1569('0x5e')]);_0x15740d[_0x1569('0x49')]=_['keys'](_0x2107e2[_0x1569('0x49')]);_0x15740d[_0x1569('0x4b')]=_[_0x1569('0x4c')](_0x15740d[_0x1569('0x48')],_0x15740d[_0x1569('0x49')]);_0x482a43[_0x1569('0x4d')]=_[_0x1569('0x4c')](_0x15740d[_0x1569('0x48')],qs['fields'](_0x2107e2[_0x1569('0x49')]['fields']));_0x482a43['attributes']=_0x482a43[_0x1569('0x4d')]['length']?_0x482a43[_0x1569('0x4d')]:_0x15740d[_0x1569('0x48')];if(!_0x2107e2[_0x1569('0x49')][_0x1569('0x73')](_0x1569('0x50'))){_0x482a43[_0x1569('0x31')]=qs[_0x1569('0x31')](_0x2107e2['query'][_0x1569('0x31')]);_0x482a43[_0x1569('0x33')]=qs[_0x1569('0x33')](_0x2107e2['query']['offset']);}_0x482a43['order']=qs['sort'](_0x2107e2['query'][_0x1569('0x52')]);_0x482a43[_0x1569('0x53')]=qs[_0x1569('0x4b')](_[_0x1569('0x54')](_0x2107e2[_0x1569('0x49')],_0x15740d[_0x1569('0x4b')]));_0x482a43[_0x1569('0x53')][_0x1569('0x6b')]=_0x5d0341['id'];if(_0x2107e2['query'][_0x1569('0x55')]){_0x482a43[_0x1569('0x53')]=_['merge'](_0x482a43[_0x1569('0x53')],{'$or':_[_0x1569('0x44')](_0x482a43[_0x1569('0x4d')],function(_0x5ce0b7){var _0x2a2d2a={};_0x2a2d2a[_0x5ce0b7]={'$like':'%'+_0x2107e2[_0x1569('0x49')][_0x1569('0x55')]+'%'};return _0x2a2d2a;})});}_0x482a43=_[_0x1569('0x56')]({},_0x482a43,_0x2107e2['options']);return db[_0x1569('0x71')][_0x1569('0x32')]({'where':_0x482a43[_0x1569('0x53')]})[_0x1569('0x23')](function(_0x5ea748){_0x2e7283[_0x1569('0x32')]=_0x5ea748;if(_0x2107e2[_0x1569('0x49')][_0x1569('0x59')]){_0x482a43[_0x1569('0x5a')]=[{'all':!![]}];}return db[_0x1569('0x71')]['findAll'](_0x482a43);})[_0x1569('0x23')](function(_0x1067d8){_0x2e7283[_0x1569('0x5c')]=_0x1067d8;return _0x2e7283;});}})[_0x1569('0x23')](respondWithFilteredResult(_0x502f7c,_0x482a43))['catch'](handleError(_0x502f7c,null));};exports[_0x1569('0x74')]=function(_0xaffeed,_0x5989cd,_0x3d7c47){return db[_0x1569('0x58')][_0x1569('0x5f')]({'where':{'id':_0xaffeed[_0x1569('0x69')]['id']}})[_0x1569('0x23')](handleEntityNotFound(_0x5989cd,null))['then'](function(_0x22e9ff){if(_0x22e9ff){return _0x22e9ff[_0x1569('0x74')](_0xaffeed[_0x1569('0x49')][_0x1569('0x75')]);}})['then'](respondWithStatusCode(_0x5989cd,null))['catch'](handleError(_0x5989cd,null));};exports['addAgents']=function(_0x467946,_0x2e136a,_0x30e254){return db['WhatsappAccount'][_0x1569('0x5f')]({'where':{'id':_0x467946[_0x1569('0x69')]['id']}})[_0x1569('0x23')](handleEntityNotFound(_0x2e136a,null))[_0x1569('0x23')](function(_0x1e29cc){if(_0x1e29cc){return _0x1e29cc[_0x1569('0x76')](_0x467946[_0x1569('0x61')][_0x1569('0x75')],_[_0x1569('0x77')](_0x467946['body'],[_0x1569('0x75'),'id'])||{})[_0x1569('0x78')](function(_0x39e1c6){for(var _0x3b95c9=0x0;_0x3b95c9<_0x467946[_0x1569('0x61')]['ids'][_0x1569('0x4f')];_0x3b95c9+=0x1){socket[_0x1569('0x79')](_0x1569('0x7a'),{'UserId':Number(_0x467946['body'][_0x1569('0x75')][_0x3b95c9]),'WhatsappAccountId':Number(_0x467946[_0x1569('0x69')]['id'])});}return _0x39e1c6;});}})[_0x1569('0x23')](respondWithResult(_0x2e136a,null))[_0x1569('0x2d')](handleError(_0x2e136a,null));};exports[_0x1569('0x7b')]=function(_0x1bb434,_0x255299,_0x16baaf){return db['WhatsappAccount'][_0x1569('0x5f')]({'where':{'id':_0x1bb434[_0x1569('0x69')]['id']}})[_0x1569('0x23')](handleEntityNotFound(_0x255299,null))[_0x1569('0x23')](function(_0x3646ea){if(_0x3646ea){return _0x3646ea['removeAgents'](_0x1bb434['query'][_0x1569('0x75')])[_0x1569('0x23')](function(){if(_['isArray'](_0x1bb434[_0x1569('0x49')]['ids'])){for(var _0x156047=0x0;_0x156047<_0x1bb434[_0x1569('0x49')][_0x1569('0x75')]['length'];_0x156047+=0x1){socket[_0x1569('0x79')](_0x1569('0x7c'),{'UserId':Number(_0x1bb434['query'][_0x1569('0x75')][_0x156047]),'WhatsappAccountId':Number(_0x1bb434[_0x1569('0x69')]['id'])});}}else{socket[_0x1569('0x79')](_0x1569('0x7c'),{'UserId':Number(_0x1bb434[_0x1569('0x49')][_0x1569('0x75')]),'WhatsappAccountId':Number(_0x1bb434[_0x1569('0x69')]['id'])});}});}})[_0x1569('0x23')](respondWithStatusCode(_0x255299,null))['catch'](handleError(_0x255299,null));};exports[_0x1569('0x7d')]=function(_0x289a46,_0x1d4557,_0x5c5c7d){var _0x5abed9={};var _0x2b2cfb={};var _0x2890f2;var _0x1d7dd6;return db['WhatsappAccount'][_0x1569('0x6e')]({'where':{'id':_0x289a46['params']['id']}})[_0x1569('0x23')](handleEntityNotFound(_0x1d4557,null))[_0x1569('0x23')](function(_0x1e34b7){if(_0x1e34b7){_0x2890f2=_0x1e34b7;_0x2b2cfb[_0x1569('0x48')]=_[_0x1569('0x4a')](db['User']['rawAttributes']);_0x2b2cfb['query']=_[_0x1569('0x4a')](_0x289a46[_0x1569('0x49')]);_0x2b2cfb[_0x1569('0x4b')]=_[_0x1569('0x4c')](_0x2b2cfb[_0x1569('0x48')],_0x2b2cfb[_0x1569('0x49')]);_0x5abed9[_0x1569('0x4d')]=_['intersection'](_0x2b2cfb[_0x1569('0x48')],qs[_0x1569('0x4e')](_0x289a46['query'][_0x1569('0x4e')]));_0x5abed9[_0x1569('0x4d')]=_0x5abed9[_0x1569('0x4d')]['length']?_0x5abed9[_0x1569('0x4d')]:_0x2b2cfb[_0x1569('0x48')];_0x5abed9['order']=qs['sort'](_0x289a46[_0x1569('0x49')]['sort']);_0x5abed9[_0x1569('0x53')]=qs[_0x1569('0x4b')](_[_0x1569('0x54')](_0x289a46[_0x1569('0x49')],_0x2b2cfb[_0x1569('0x4b')]));if(_0x289a46[_0x1569('0x49')]['filter']){_0x5abed9[_0x1569('0x53')]=_['merge'](_0x5abed9[_0x1569('0x53')],{'$or':_[_0x1569('0x44')](_0x5abed9[_0x1569('0x4d')],function(_0x3dd768){var _0x4f5040={};_0x4f5040[_0x3dd768]={'$like':'%'+_0x289a46[_0x1569('0x49')]['filter']+'%'};return _0x4f5040;})});}_0x5abed9=_[_0x1569('0x56')]({},_0x5abed9,_0x289a46['options']);return _0x2890f2[_0x1569('0x7d')](_0x5abed9);}})['then'](function(_0x5f182f){if(_0x5f182f){_0x1d7dd6=_0x5f182f[_0x1569('0x4f')];if(!_0x289a46[_0x1569('0x49')][_0x1569('0x73')](_0x1569('0x50'))){_0x5abed9[_0x1569('0x31')]=qs[_0x1569('0x31')](_0x289a46[_0x1569('0x49')]['limit']);_0x5abed9[_0x1569('0x33')]=qs[_0x1569('0x33')](_0x289a46[_0x1569('0x49')][_0x1569('0x33')]);}return _0x2890f2[_0x1569('0x7d')](_0x5abed9);}})['then'](function(_0x1998c4){if(_0x1998c4){return _0x1998c4?{'count':_0x1d7dd6,'rows':_0x1998c4}:null;}})['then'](respondWithResult(_0x1d4557,null))[_0x1569('0x2d')](handleError(_0x1d4557,null));};exports['addApplications']=function(_0x15fc84,_0x51afbb){var _0x343fd6=_0x15fc84[_0x1569('0x69')]['id'];var _0xca5f24=_0x15fc84['body'];var _0x595799=0xc8;var _0x3b90fb=null;return db[_0x1569('0x7e')][_0x1569('0x7f')]({'isolationLevel':db[_0x1569('0x7e')][_0x1569('0x80')][_0x1569('0x81')][_0x1569('0x82')]},function(_0x3c8bae){return db['WhatsappAccount'][_0x1569('0x6e')]({'where':{'id':_0x343fd6},'transaction':_0x3c8bae})[_0x1569('0x23')](function(_0x341104){if(_0x341104){return db[_0x1569('0x83')]['destroy']({'where':{'WhatsappAccountId':_0x343fd6},'transaction':_0x3c8bae})[_0x1569('0x23')](function(){var _0x3c6e1a=_['map'](_0xca5f24,function(_0x10ab6e){_0x10ab6e[_0x1569('0x6b')]=_0x343fd6;return _0x10ab6e;});return db[_0x1569('0x83')]['bulkCreate'](_0x3c6e1a,{'transaction':_0x3c8bae});});}else{_0x595799=0x194;_0x3b90fb=[];}});})[_0x1569('0x23')](function(){if(_0x595799!==0x194){return db[_0x1569('0x83')][_0x1569('0x84')]({'where':{'WhatsappAccountId':_0x343fd6},'order':'priority'})[_0x1569('0x23')](function(_0x476340){_0x3b90fb=_0x476340;});}})[_0x1569('0x2d')](function(_0x1268cc){_0x595799=0x1f4;logger[_0x1569('0x2a')](_0x1268cc[_0x1569('0x3e')]);if(_0x1268cc[_0x1569('0x3f')]){delete _0x1268cc[_0x1569('0x3f')];}_0x3b90fb=_0x1268cc;})[_0x1569('0x85')](function(){if(_0x3b90fb===null){_0x51afbb[_0x1569('0x2e')](_0x595799);}else{if(_0x595799===0x1f4){_0x51afbb['status'](_0x595799)['send'](_0x3b90fb);}else{_0x51afbb[_0x1569('0x34')](_0x595799)['json'](_0x3b90fb);}}});};exports[_0x1569('0x86')]=function(_0x41248f,_0x4353e7,_0x4db692){var _0x2edab0={};var _0x1dee6f={};var _0x57323e;var _0x2a679b;return db[_0x1569('0x58')][_0x1569('0x6e')]({'where':{'id':_0x41248f['params']['id']}})[_0x1569('0x23')](handleEntityNotFound(_0x4353e7,null))[_0x1569('0x23')](function(_0x5c7f56){if(_0x5c7f56){_0x57323e=_0x5c7f56;_0x1dee6f[_0x1569('0x48')]=_[_0x1569('0x4a')](db[_0x1569('0x83')]['rawAttributes']);_0x1dee6f[_0x1569('0x49')]=_[_0x1569('0x4a')](_0x41248f[_0x1569('0x49')]);_0x1dee6f[_0x1569('0x4b')]=_[_0x1569('0x4c')](_0x1dee6f[_0x1569('0x48')],_0x1dee6f[_0x1569('0x49')]);_0x2edab0['attributes']=_['intersection'](_0x1dee6f[_0x1569('0x48')],qs['fields'](_0x41248f['query'][_0x1569('0x4e')]));_0x2edab0[_0x1569('0x4d')]=_0x2edab0[_0x1569('0x4d')]['length']?_0x2edab0[_0x1569('0x4d')]:_0x1dee6f[_0x1569('0x48')];_0x2edab0[_0x1569('0x51')]=qs[_0x1569('0x52')](_0x41248f[_0x1569('0x49')][_0x1569('0x52')]);_0x2edab0[_0x1569('0x53')]=qs[_0x1569('0x4b')](_['pick'](_0x41248f[_0x1569('0x49')],_0x1dee6f[_0x1569('0x4b')]));if(_0x41248f[_0x1569('0x49')][_0x1569('0x55')]){_0x2edab0['where']=_[_0x1569('0x56')](_0x2edab0[_0x1569('0x53')],{'$or':_['map'](_0x2edab0[_0x1569('0x4d')],function(_0x2eb902){var _0x234ad8={};_0x234ad8[_0x2eb902]={'$like':'%'+_0x41248f['query']['filter']+'%'};return _0x234ad8;})});}_0x2edab0=_[_0x1569('0x56')]({},_0x2edab0,_0x41248f[_0x1569('0x57')]);return _0x57323e['getApplications'](_0x2edab0);}})[_0x1569('0x23')](function(_0x5bdb07){if(_0x5bdb07){_0x2a679b=_0x5bdb07[_0x1569('0x4f')];if(!_0x41248f['query'][_0x1569('0x73')](_0x1569('0x50'))){_0x2edab0[_0x1569('0x31')]=qs[_0x1569('0x31')](_0x41248f[_0x1569('0x49')][_0x1569('0x31')]);_0x2edab0['offset']=qs[_0x1569('0x33')](_0x41248f[_0x1569('0x49')][_0x1569('0x33')]);}return _0x57323e[_0x1569('0x86')](_0x2edab0);}})[_0x1569('0x23')](function(_0x5a0827){if(_0x5a0827){return _0x5a0827?{'count':_0x2a679b,'rows':_0x5a0827}:null;}})[_0x1569('0x23')](respondWithResult(_0x4353e7,null))['catch'](handleError(_0x4353e7,null));};exports['notify']=function(_0x1ecaa5,_0x82419b,_0x525e29){var _0x3ceb75={'channel':_0x1569('0x87')};var _0xf97fa3=[];var _0x2e9e50=[];var _0x246b36={};return db['WhatsappAccount'][_0x1569('0x5f')]({'where':{'id':_0x1ecaa5['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x1569('0x88')}]})[_0x1569('0x23')](handleEntityNotFound(_0x82419b,null))[_0x1569('0x23')](function(_0x392829){_0x3ceb75[_0x1569('0x89')]=_0x392829;if(_0x3ceb75['account']&&_0x3ceb75[_0x1569('0x89')]['type']===_0x1569('0x8a')&&_0x1ecaa5[_0x1569('0x61')][_0x1569('0x8b')]){if(_0x1ecaa5[_0x1569('0x61')][_0x1569('0x8b')]['length']===0x0)return;if(_0x1ecaa5[_0x1569('0x61')][_0x1569('0x8b')][0x0][_0x1569('0x8c')]!==_0x1569('0x8d'))return;return db['WhatsappMessage']['update']({'read':!![],'readAt':_0x1ecaa5[_0x1569('0x61')][_0x1569('0x8b')][0x0][_0x1569('0x8e')]},{'where':{'messageId':_0x1ecaa5[_0x1569('0x61')][_0x1569('0x8b')][0x0][_0x1569('0x8f')]},'individualHooks':!![]})[_0x1569('0x23')](function(_0x27a52e){return _0x82419b['status'](0xc8)['json'](_0x27a52e);});}_0x3ceb75['applications']=_[_0x1569('0x90')](_0x392829[_0x1569('0x88')],[_0x1569('0x91')],[_0x1569('0x92')]);if(_0x3ceb75[_0x1569('0x89')][_0x1569('0x88')]){delete _0x3ceb75['account'][_0x1569('0x88')];}return db['CmContact'][_0x1569('0x6a')]()[_0x1569('0x23')](function(_0x120103){if(!_0x120103){throw new db[(_0x1569('0x93'))][(_0x1569('0x94'))](_0x1569('0x95'));}_0xf97fa3=_[_0x1569('0x96')](_[_0x1569('0x4a')](_0x120103),[_0x1569('0x97'),'updatedAt']);_0x2e9e50=_[_0x1569('0x96')](_[_0x1569('0x4a')](_0x120103),[_0x1569('0x97'),_0x1569('0x98'),_0x1569('0x99'),'ListId']);_0x3ceb75['body']={'mapKey':_0x1569('0x9a')};if(_0x3ceb75['account']&&_0x3ceb75[_0x1569('0x89')]['type']===_0x1569('0x9b')){_0x3ceb75[_0x1569('0x61')][_0x1569('0x9c')]=_0x1ecaa5[_0x1569('0x61')][_0x1569('0x9d')]['replace']('whatsapp:','');_0x3ceb75['body'][_0x1569('0x61')]=_0x1ecaa5['body'][_0x1569('0x9e')];_0x3ceb75['body'][_0x1569('0x9f')]=_0x1ecaa5[_0x1569('0x61')][_0x1569('0xa0')];}if(_0x3ceb75['account']&&_0x3ceb75[_0x1569('0x89')][_0x1569('0x46')]===_0x1569('0x8a')){_0x3ceb75[_0x1569('0x61')][_0x1569('0x9c')]=_0x1ecaa5[_0x1569('0x61')][_0x1569('0xa1')][0x0][_0x1569('0x9c')];_0x3ceb75[_0x1569('0x61')][_0x1569('0x61')]=_0x1ecaa5['body'][_0x1569('0xa1')][0x0]['message'][_0x1569('0x61')];_0x3ceb75[_0x1569('0x61')][_0x1569('0x9f')]=_0x1ecaa5['body'][_0x1569('0xa1')][0x0][_0x1569('0x8f')];}if(_0x3ceb75[_0x1569('0x61')]['id']){delete _0x3ceb75[_0x1569('0x61')]['id'];}if(_[_0x1569('0xa2')](_0x3ceb75[_0x1569('0x61')][_0x1569('0x9c')])){throw new db[(_0x1569('0x93'))]['ValidationError'](_0x1569('0xa3'));}if(_[_0x1569('0xa2')](_0x3ceb75['body']['body'])||_0x3ceb75[_0x1569('0x61')][_0x1569('0x61')]===''){throw new db['Sequelize'][(_0x1569('0x94'))](_0x1569('0xa4'));}if(_[_0x1569('0xa2')](_0x3ceb75[_0x1569('0x61')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x1569('0xa5')+_0x2e9e50);}if(!_[_0x1569('0xa6')](_0x2e9e50,_0x3ceb75[_0x1569('0x61')][_0x1569('0xa7')])){throw new db[(_0x1569('0x93'))][(_0x1569('0x94'))](_0x1569('0xa8')+_0x2e9e50);}_0x246b36[_0x3ceb75[_0x1569('0x61')][_0x1569('0xa7')]]=_0x3ceb75[_0x1569('0x61')][_0x1569('0x9c')];return db[_0x1569('0xa9')][_0x1569('0x5f')]({'where':{'id':_0x3ceb75[_0x1569('0x89')]['ListId']},'include':[{'model':db[_0x1569('0xaa')],'as':'Contacts','where':_0x246b36,'limit':0x1,'order':[[_0x1569('0x98'),_0x1569('0xab')]]}]});})[_0x1569('0x23')](handleEntityNotFound(_0x82419b,null))['then'](function(_0x1b64d4){if(_0x1b64d4){_0x3ceb75[_0x1569('0xac')]=_[_0x1569('0x77')](_0x1b64d4,['Contacts']);if(_0x1b64d4[_0x1569('0xad')][_0x1569('0x4f')]){return _0x1b64d4[_0x1569('0xad')][0x0];}var _0x4d9e1f=_[_0x1569('0x1b')](_0x3ceb75['body'],{'firstName':_0x3ceb75[_0x1569('0x61')][_0x1569('0x9c')],'ListId':_0x1b64d4['id']});_0x4d9e1f[_0x3ceb75['body'][_0x1569('0xa7')]]=_0x3ceb75[_0x1569('0x61')]['from'];return db[_0x1569('0xaa')][_0x1569('0x60')](_0x4d9e1f,{'fields':_0xf97fa3,'raw':!![]});}})[_0x1569('0x23')](handleEntityNotFound(_0x82419b,null))['then'](function(_0x51f904){if(_0x51f904){_0x3ceb75[_0x1569('0xae')]=_0x51f904;var _0x1be455={'ContactId':_0x51f904['id'],'phone':_0x3ceb75[_0x1569('0x61')]['from'],'WhatsappAccountId':_0x1ecaa5[_0x1569('0x69')]['id']};var _0x93840e={'ContactId':_0x51f904['id'],'WhatsappAccountId':_0x1ecaa5[_0x1569('0x69')]['id'],'closed':![]};return db[_0x1569('0xaf')][_0x1569('0x5f')]({'where':_0x93840e})[_0x1569('0x23')](function(_0x4a8ce5){if(_0x4a8ce5){return[_0x4a8ce5,![]];}return db[_0x1569('0xaf')][_0x1569('0x60')](_0x1be455)[_0x1569('0x23')](function(_0x37b2dc){return[_0x37b2dc,!![]];});});}})['spread'](function(_0x5d17be,_0x5bf466){_0x3ceb75[_0x1569('0xb0')]=_0x5d17be[_0x1569('0x3b')]({'plain':!![]});_0x3ceb75['interaction'][_0x1569('0xb1')]=![];if(_0x5bf466){if(_0x3ceb75[_0x1569('0x89')]['autoclose']){_0x3ceb75[_0x1569('0xb2')]['push']({'id':0x0,'priority':_0x3ceb75[_0x1569('0xb2')][_0x1569('0x4f')]+0x1,'app':_0x1569('0xb3'),'appdata':_0x1569('0xb4'),'interval':_0x1569('0xb5')});}_0x3ceb75['interaction']['created']=!![];}return db[_0x1569('0xb6')][_0x1569('0x60')]({'phone':_0x3ceb75[_0x1569('0x61')]['from'],'messageId':_0x3ceb75[_0x1569('0x61')][_0x1569('0x9f')],'body':_0x3ceb75['body'][_0x1569('0x61')],'WhatsappAccountId':_0x1ecaa5['params']['id'],'WhatsappInteractionId':_0x5d17be['id'],'direction':'in','ContactId':_0x5d17be[_0x1569('0xb7')],'AttachmentId':_0x3ceb75[_0x1569('0x61')][_0x1569('0xb8')]});})[_0x1569('0x23')](function(_0x2ab53f){_0x3ceb75[_0x1569('0x2b')]=_0x2ab53f;if(_0x3ceb75[_0x1569('0xb0')][_0x1569('0xb9')]){return db[_0x1569('0xba')][_0x1569('0x5f')]({'attributes':['id',_0x1569('0x3f')],'where':{'id':_0x3ceb75[_0x1569('0xb0')][_0x1569('0xb9')]}})[_0x1569('0x23')](function(_0x364013){if(_0x364013){_0x3ceb75['applications'][_0x1569('0xbb')]({'id':0x0,'priority':0x0,'app':_0x1569('0xbc'),'appdata':_0x364013[_0x1569('0x3f')]+','+(_0x3ceb75[_0x1569('0x89')][_0x1569('0xbd')]||0xa),'interval':_0x1569('0xb5')});}return respondWithRpcPromise(_0x1569('0xbe'),'startRouting',_0x3ceb75);});}return respondWithRpcPromise(_0x1569('0xbe'),_0x1569('0xbf'),_0x3ceb75);})[_0x1569('0x23')](function(_0x2dff71){if(_0x2dff71){var _0x509b99=0xc8;var _0x40f7d3=_0x1569('0xc0');logger[_0x1569('0x24')](_0x1569('0x28'),_0x40f7d3,_0x509b99,_0x1569('0xc1'));logger[_0x1569('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x40f7d3,_0x509b99,_0x1569('0xc1'),JSON[_0x1569('0x29')](_0x2dff71));if(_0x3ceb75[_0x1569('0x89')]['type']===_0x1569('0x9b')){return _0x82419b[_0x1569('0x34')](_0x509b99)[_0x1569('0x35')]('Content-Type','text/xml')[_0x1569('0x40')](_0x1569('0xc2'));}else{return _0x82419b['status'](_0x509b99)['json'](_0x2dff71);}}});})['catch'](handleError(_0x82419b,null));};exports[_0x1569('0x40')]=function(_0xd95577,_0x2e5185,_0x15464d){var _0x3a028d,_0x3a7f6a,_0x227c91;if(_[_0x1569('0xa2')](_0xd95577[_0x1569('0x61')][_0x1569('0x61')])||_0xd95577['body'][_0x1569('0x61')]===''){throw new db[(_0x1569('0x93'))][(_0x1569('0x94'))](_0x1569('0xa4'));}if(_[_0x1569('0xa2')](_0xd95577[_0x1569('0x61')]['to'])){throw new db[(_0x1569('0x93'))]['ValidationError'](_0x1569('0xc3'));}_0x3a028d=_0xd95577[_0x1569('0x61')]['to'];return db[_0x1569('0x58')][_0x1569('0x5f')]({'where':{'id':_0xd95577['params']['id']},'include':[{'model':db[_0x1569('0xa9')],'as':_0x1569('0xc4'),'include':[{'model':db[_0x1569('0xaa')],'as':'Contacts','where':{'mobile':_0x3a028d},'limit':0x1,'order':[[_0x1569('0x98'),_0x1569('0xab')]]}]}]})[_0x1569('0x23')](handleEntityNotFound(_0x2e5185,null))['then'](function(_0x3ae19d){if(_0x3ae19d&&_0x3ae19d[_0x1569('0xc4')]){_0x3a7f6a=_0x3ae19d['get']({'plain':!![]});if(_0x3a7f6a[_0x1569('0xc4')]&&_0x3a7f6a[_0x1569('0xc4')]['Contacts'][_0x1569('0x4f')]){return _0x3a7f6a['List']['Contacts'][0x0];}return db[_0x1569('0xaa')][_0x1569('0x60')](_[_0x1569('0x1b')](_0xd95577[_0x1569('0x61')],{'firstName':_0x3a028d,'mobile':_0x3a028d,'phone':_0x3a028d,'ListId':_0x3a7f6a[_0x1569('0xc5')]}));}})[_0x1569('0x23')](handleEntityNotFound(_0x2e5185,null))[_0x1569('0x23')](function(_0x55e03f){if(_0x55e03f){_0x227c91=_0x55e03f;return db[_0x1569('0xaf')][_0x1569('0x5f')]({'where':{'ContactId':_0x227c91['id'],'closed':![],'WhatsappAccountId':_0x3a7f6a['id']}})['then'](function(_0x43f355){if(_0x43f355){return[_0x43f355,![]];}return db[_0x1569('0xaf')]['create']({'UserId':_0xd95577[_0x1569('0x62')]['id'],'ContactId':_0x227c91['id'],'WhatsappAccountId':_0x3a7f6a['id'],'phone':_0x3a028d,'firstMsgDirection':'out','Messages':[_[_0x1569('0x56')](_0xd95577[_0x1569('0x61')],{'read':![],'body':_0xd95577[_0x1569('0x61')]['body'],'phone':_0x3a028d,'WhatsappAccountId':_0x3a7f6a['id'],'UserId':_0xd95577[_0x1569('0x62')]['id'],'ContactId':_0x227c91['id']})]},{'include':[{'model':db[_0x1569('0xb6')],'as':'Messages'}]})['then'](function(_0x4a1045){return[_0x4a1045,!![]];});});}})[_0x1569('0x78')](function(_0x3248ba,_0x3e1f63){if(_0x3e1f63){return _0x3248ba;}return db['WhatsappMessage']['create'](_['merge'](_0xd95577['body'],{'read':![],'body':_0xd95577[_0x1569('0x61')][_0x1569('0x61')],'phone':_0x3a028d,'WhatsappAccountId':_0x3a7f6a['id'],'WhatsappInteractionId':_0x3248ba['id'],'UserId':_0xd95577[_0x1569('0x62')]['id'],'ContactId':_0x227c91['id']}))[_0x1569('0x23')](function(_0x24251d){_0x3248ba[_0x1569('0xc6')][_0x1569('0xc7')]=[];_0x3248ba[_0x1569('0xc6')]['Messages'][_0x1569('0xc8')](_0x24251d[_0x1569('0xc6')]);return _0x3248ba;});})['then'](respondWithResult(_0x2e5185,null))[_0x1569('0x2d')](handleError(_0x2e5185,null));}; \ No newline at end of file +var _0xd89d=['createdAt','CompanyId','mobile','from','From','Body','messageId','MessageSid','sinch','notifications','isNil','ValidationError','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','twilio','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','ListId','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','./whatsappAccount.socket','register','jayson/promise','http','request','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','params','Pause','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','notify','whatsapp','account','statuses','read','WhatsappMessage','timestamp','applications','orderBy','Applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt'];(function(_0x16b6bc,_0x1e415f){var _0x4f3882=function(_0x372ae9){while(--_0x372ae9){_0x16b6bc['push'](_0x16b6bc['shift']());}};_0x4f3882(++_0x1e415f);}(_0xd89d,0xf5));var _0xdd89=function(_0x3d5feb,_0xd7c853){_0x3d5feb=_0x3d5feb-0x0;var _0x4f9fa8=_0xd89d[_0x3d5feb];return _0x4f9fa8;};'use strict';var emlformat=require(_0xdd89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd89('0x1'));var jsonpatch=require(_0xdd89('0x2'));var rp=require('request-promise');var moment=require(_0xdd89('0x3'));var BPromise=require(_0xdd89('0x4'));var Mustache=require('mustache');var util=require(_0xdd89('0x5'));var path=require(_0xdd89('0x6'));var sox=require(_0xdd89('0x7'));var csv=require(_0xdd89('0x8'));var ejs=require(_0xdd89('0x9'));var fs=require('fs');var fs_extra=require(_0xdd89('0xa'));var _=require(_0xdd89('0xb'));var squel=require(_0xdd89('0xc'));var crypto=require(_0xdd89('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdd89('0xe'));var toCsv=require(_0xdd89('0x8'));var querystring=require(_0xdd89('0xf'));var Papa=require(_0xdd89('0x10'));var Redis=require(_0xdd89('0x11'));var authService=require(_0xdd89('0x12'));var qs=require(_0xdd89('0x13'));var as=require(_0xdd89('0x14'));var hardwareService=require(_0xdd89('0x15'));var logger=require(_0xdd89('0x16'))(_0xdd89('0x17'));var utils=require('../../config/utils');var config=require(_0xdd89('0x18'));var licenseUtil=require(_0xdd89('0x19'));var db=require('../../mysqldb')['db'];config[_0xdd89('0x1a')]=_[_0xdd89('0x1b')](config[_0xdd89('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdd89('0x1a')]));require(_0xdd89('0x1c'))[_0xdd89('0x1d')](socket);var jayson=require(_0xdd89('0x1e'));var client=jayson['client'][_0xdd89('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xdff264,_0x2b79c8,_0x4c4091,_0x85ce33){return new BPromise(function(_0x4d5015,_0x6d3215){var _0xb59f64=_0x85ce33||client;return _0xb59f64[_0xdd89('0x20')](_0xdff264,_0x4c4091)['then'](function(_0x2f9f03){logger[_0xdd89('0x21')](_0xdd89('0x22'),_0x2b79c8,'request\x20sent');logger[_0xdd89('0x23')](_0xdd89('0x24'),_0x2b79c8,'request\x20sent',JSON[_0xdd89('0x25')](_0x2f9f03));if(_0x2f9f03['error']){if(_0x2f9f03[_0xdd89('0x26')][_0xdd89('0x27')]===0x1f4){logger[_0xdd89('0x26')](_0xdd89('0x22'),_0x2b79c8,_0x2f9f03['error']['message']);return _0x6d3215(_0x2f9f03['error'][_0xdd89('0x28')]);}logger[_0xdd89('0x26')](_0xdd89('0x22'),_0x2b79c8,_0x2f9f03['error']['message']);return _0x4d5015(_0x2f9f03[_0xdd89('0x26')][_0xdd89('0x28')]);}else{logger[_0xdd89('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x2b79c8,_0xdd89('0x29'));_0x4d5015(_0x2f9f03[_0xdd89('0x2a')][_0xdd89('0x28')]);}})['catch'](function(_0x4fd1cc){logger[_0xdd89('0x26')](_0xdd89('0x22'),_0x2b79c8,_0x4fd1cc);_0x6d3215(_0x4fd1cc);});});}function respondWithStatusCode(_0x3910a4,_0x82f524){_0x82f524=_0x82f524||0xcc;return function(_0x5c5219){if(_0x5c5219){return _0x3910a4[_0xdd89('0x2b')](_0x82f524);}return _0x3910a4['status'](_0x82f524)[_0xdd89('0x2c')]();};}function respondWithResult(_0x5700d6,_0xd60b99){_0xd60b99=_0xd60b99||0xc8;return function(_0x4263e8){if(_0x4263e8){return _0x5700d6[_0xdd89('0x2d')](_0xd60b99)['json'](_0x4263e8);}};}function respondWithFilteredResult(_0xff66a9,_0xb5aff2){return function(_0x7058f2){if(_0x7058f2){var _0x2659cd=typeof _0xb5aff2[_0xdd89('0x2e')]===_0xdd89('0x2f')&&typeof _0xb5aff2[_0xdd89('0x30')]===_0xdd89('0x2f');var _0x3b99ed=_0x7058f2[_0xdd89('0x31')];var _0x31f93d=_0x2659cd?0x0:_0xb5aff2['offset'];var _0x54473e=_0x2659cd?_0x7058f2[_0xdd89('0x31')]:_0xb5aff2[_0xdd89('0x2e')]+_0xb5aff2[_0xdd89('0x30')];var _0x274f59;if(_0x54473e>=_0x3b99ed){_0x54473e=_0x3b99ed;_0x274f59=0xc8;}else{_0x274f59=0xce;}_0xff66a9[_0xdd89('0x2d')](_0x274f59);return _0xff66a9[_0xdd89('0x32')]('Content-Range',_0x31f93d+'-'+_0x54473e+'/'+_0x3b99ed)[_0xdd89('0x33')](_0x7058f2);}return null;};}function patchUpdates(_0x24553b){return function(_0x4d384a){try{jsonpatch[_0xdd89('0x34')](_0x4d384a,_0x24553b,!![]);}catch(_0x3e66a0){return BPromise[_0xdd89('0x35')](_0x3e66a0);}return _0x4d384a[_0xdd89('0x36')]();};}function saveUpdates(_0x382168,_0x2edf5a){return function(_0xb50b6d){if(_0xb50b6d){return _0xb50b6d[_0xdd89('0x37')](_0x382168)[_0xdd89('0x38')](function(_0x1722d5){return _0x1722d5;});}return null;};}function removeEntity(_0x54681b,_0x5e0d95){return function(_0x42327e){if(_0x42327e){return _0x42327e[_0xdd89('0x39')]()[_0xdd89('0x38')](function(){var _0x4dc969=_0x42327e['get']({'plain':!![]});var _0x2fc2c8='WhatsappAccounts';return db[_0xdd89('0x3a')][_0xdd89('0x39')]({'where':{'type':_0x2fc2c8,'resourceId':_0x4dc969['id']}})[_0xdd89('0x38')](function(){return _0x42327e;});})[_0xdd89('0x38')](function(){_0x54681b[_0xdd89('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x311b47,_0x2e92ca){return function(_0x10ef1b){if(!_0x10ef1b){_0x311b47[_0xdd89('0x2b')](0x194);}return _0x10ef1b;};}function handleError(_0x1b1a10,_0x399429){_0x399429=_0x399429||0x1f4;return function(_0x477235){logger['error'](_0x477235[_0xdd89('0x3b')]);if(_0x477235[_0xdd89('0x3c')]){delete _0x477235['name'];}_0x1b1a10[_0xdd89('0x2d')](_0x399429)['send'](_0x477235);};}exports[_0xdd89('0x3d')]=function(_0x459727,_0x48b82c){var _0x4a5eb9={'include':[{'model':db['Pause'],'as':_0xdd89('0x3e')}]},_0x43ba2b={},_0x6f29fc={'count':0x0,'rows':[]};var _0x53432c=_[_0xdd89('0x3f')](db[_0xdd89('0x40')][_0xdd89('0x41')],function(_0x3effd4){return{'name':_0x3effd4['fieldName'],'type':_0x3effd4[_0xdd89('0x42')][_0xdd89('0x43')]};});_0x43ba2b[_0xdd89('0x44')]=_['map'](_0x53432c,_0xdd89('0x3c'));_0x43ba2b[_0xdd89('0x45')]=_[_0xdd89('0x46')](_0x459727['query']);_0x43ba2b[_0xdd89('0x47')]=_[_0xdd89('0x48')](_0x43ba2b['model'],_0x43ba2b['query']);_0x4a5eb9[_0xdd89('0x49')]=_['intersection'](_0x43ba2b[_0xdd89('0x44')],qs[_0xdd89('0x4a')](_0x459727[_0xdd89('0x45')][_0xdd89('0x4a')]));_0x4a5eb9[_0xdd89('0x49')]=_0x4a5eb9['attributes'][_0xdd89('0x4b')]?_0x4a5eb9[_0xdd89('0x49')]:_0x43ba2b['model'];if(!_0x459727['query'][_0xdd89('0x4c')](_0xdd89('0x4d'))){_0x4a5eb9[_0xdd89('0x30')]=qs[_0xdd89('0x30')](_0x459727[_0xdd89('0x45')][_0xdd89('0x30')]);_0x4a5eb9['offset']=qs[_0xdd89('0x2e')](_0x459727[_0xdd89('0x45')]['offset']);}_0x4a5eb9[_0xdd89('0x4e')]=qs[_0xdd89('0x4f')](_0x459727['query'][_0xdd89('0x4f')]);_0x4a5eb9[_0xdd89('0x50')]=qs['filters'](_[_0xdd89('0x51')](_0x459727[_0xdd89('0x45')],_0x43ba2b[_0xdd89('0x47')]),_0x53432c);if(_0x459727['query']['filter']){_0x4a5eb9[_0xdd89('0x50')]=_[_0xdd89('0x52')](_0x4a5eb9[_0xdd89('0x50')],{'$or':_[_0xdd89('0x3f')](_0x53432c,function(_0x3361eb){if(_0x3361eb['type']!=='VIRTUAL'){var _0x25dd2b={};_0x25dd2b[_0x3361eb['name']]={'$like':'%'+_0x459727['query'][_0xdd89('0x53')]+'%'};return _0x25dd2b;}})});}_0x4a5eb9=_[_0xdd89('0x52')]({},_0x4a5eb9,_0x459727[_0xdd89('0x54')]);var _0x2d8b2b={'where':_0x4a5eb9[_0xdd89('0x50')]};return db[_0xdd89('0x40')][_0xdd89('0x31')](_0x2d8b2b)['then'](function(_0x3e56a2){_0x6f29fc['count']=_0x3e56a2;if(_0x459727[_0xdd89('0x45')][_0xdd89('0x55')]){_0x4a5eb9[_0xdd89('0x56')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xdd89('0x57')](_0x4a5eb9);})[_0xdd89('0x38')](function(_0x4a8a0d){_0x6f29fc['rows']=_0x4a8a0d;return _0x6f29fc;})[_0xdd89('0x38')](respondWithFilteredResult(_0x48b82c,_0x4a5eb9))[_0xdd89('0x58')](handleError(_0x48b82c,null));};exports['show']=function(_0x3507a6,_0x9fd31b){var _0x5176fc={'raw':![],'where':{'id':_0x3507a6[_0xdd89('0x59')]['id']},'include':[{'model':db[_0xdd89('0x5a')],'as':'mandatoryDispositionPause'}]},_0x28ecff={};_0x28ecff[_0xdd89('0x44')]=_[_0xdd89('0x46')](db[_0xdd89('0x40')][_0xdd89('0x41')]);_0x28ecff['query']=_['keys'](_0x3507a6[_0xdd89('0x45')]);_0x28ecff[_0xdd89('0x47')]=_[_0xdd89('0x48')](_0x28ecff['model'],_0x28ecff[_0xdd89('0x45')]);_0x5176fc[_0xdd89('0x49')]=_['intersection'](_0x28ecff[_0xdd89('0x44')],qs[_0xdd89('0x4a')](_0x3507a6[_0xdd89('0x45')][_0xdd89('0x4a')]));_0x5176fc['attributes']=_0x5176fc[_0xdd89('0x49')]['length']?_0x5176fc[_0xdd89('0x49')]:_0x28ecff[_0xdd89('0x44')];if(_0x3507a6[_0xdd89('0x45')][_0xdd89('0x55')]){_0x5176fc[_0xdd89('0x56')]=[{'all':!![]}];}_0x5176fc=_['merge']({},_0x5176fc,_0x3507a6[_0xdd89('0x54')]);return db[_0xdd89('0x40')][_0xdd89('0x5b')](_0x5176fc)['then'](handleEntityNotFound(_0x9fd31b,null))[_0xdd89('0x38')](respondWithResult(_0x9fd31b,null))[_0xdd89('0x58')](handleError(_0x9fd31b,null));};exports['create']=function(_0xbee8d0,_0x105a52){return db[_0xdd89('0x40')][_0xdd89('0x5c')](_0xbee8d0[_0xdd89('0x5d')],{})[_0xdd89('0x38')](function(_0x1ea6b9){var _0x3e9c70=_0xbee8d0[_0xdd89('0x5e')][_0xdd89('0x5f')]({'plain':!![]});if(!_0x3e9c70)throw new Error(_0xdd89('0x60'));if(_0x3e9c70[_0xdd89('0x61')]==='user'){var _0x1b6c3d=_0x1ea6b9[_0xdd89('0x5f')]({'plain':!![]});var _0xa4873b='WhatsappAccounts';return db[_0xdd89('0x62')][_0xdd89('0x5b')]({'where':{'name':_0xa4873b,'userProfileId':_0x3e9c70['userProfileId']},'raw':!![]})[_0xdd89('0x38')](function(_0x675f3f){if(_0x675f3f&&_0x675f3f[_0xdd89('0x63')]===0x0){return db[_0xdd89('0x3a')][_0xdd89('0x5c')]({'name':_0x1b6c3d[_0xdd89('0x3c')],'resourceId':_0x1b6c3d['id'],'type':_0x675f3f[_0xdd89('0x3c')],'sectionId':_0x675f3f['id']},{})[_0xdd89('0x38')](function(){return _0x1ea6b9;});}else{return _0x1ea6b9;}})[_0xdd89('0x58')](function(_0x2b1005){logger['error'](_0xdd89('0x64'),_0x2b1005);throw _0x2b1005;});}return _0x1ea6b9;})[_0xdd89('0x38')](respondWithResult(_0x105a52,0xc9))[_0xdd89('0x58')](handleError(_0x105a52,null));};exports[_0xdd89('0x37')]=function(_0x174151,_0x4573e1){if(_0x174151[_0xdd89('0x5d')]['id']){delete _0x174151[_0xdd89('0x5d')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x174151[_0xdd89('0x59')]['id']},'include':[{'model':db[_0xdd89('0x5a')],'as':_0xdd89('0x3e')}]})[_0xdd89('0x38')](handleEntityNotFound(_0x4573e1,null))[_0xdd89('0x38')](saveUpdates(_0x174151['body'],null))[_0xdd89('0x38')](respondWithResult(_0x4573e1,null))[_0xdd89('0x58')](handleError(_0x4573e1,null));};exports[_0xdd89('0x39')]=function(_0x34366e,_0x369126){return db[_0xdd89('0x40')][_0xdd89('0x5b')]({'where':{'id':_0x34366e[_0xdd89('0x59')]['id']}})['then'](handleEntityNotFound(_0x369126,null))['then'](removeEntity(_0x369126,null))[_0xdd89('0x58')](handleError(_0x369126,null));};exports[_0xdd89('0x65')]=function(_0x17ed15,_0x2f6f17){return db[_0xdd89('0x40')][_0xdd89('0x65')]()[_0xdd89('0x38')](respondWithResult(_0x2f6f17,null))[_0xdd89('0x58')](handleError(_0x2f6f17,null));};exports[_0xdd89('0x66')]=function(_0x459cb6,_0x2a3a3f,_0x599194){if(_0x459cb6[_0xdd89('0x5d')]['id']){delete _0x459cb6[_0xdd89('0x5d')]['id'];}return db[_0xdd89('0x40')][_0xdd89('0x5b')]({'where':{'id':_0x459cb6[_0xdd89('0x59')]['id']}})[_0xdd89('0x38')](handleEntityNotFound(_0x2a3a3f,null))[_0xdd89('0x38')](function(_0x3fb695){if(_0x3fb695){_0x459cb6[_0xdd89('0x5d')][_0xdd89('0x67')]=_0x3fb695['id'];return db[_0xdd89('0x68')][_0xdd89('0x5c')](_0x459cb6[_0xdd89('0x5d')]);}})[_0xdd89('0x38')](respondWithResult(_0x2a3a3f,null))[_0xdd89('0x58')](handleError(_0x2a3a3f,null));};exports[_0xdd89('0x69')]=function(_0x31667a,_0x5aade4,_0x443450){var _0x45bef7={'raw':![],'where':{}};var _0x581137={};var _0x3e4669={'count':0x0,'rows':[]};return db[_0xdd89('0x40')][_0xdd89('0x6a')]({'where':{'id':_0x31667a['params']['id']}})[_0xdd89('0x38')](handleEntityNotFound(_0x5aade4,null))['then'](function(_0xa0ea75){if(_0xa0ea75){_0x581137[_0xdd89('0x44')]=_[_0xdd89('0x46')](db['Disposition'][_0xdd89('0x41')]);_0x581137[_0xdd89('0x45')]=_[_0xdd89('0x46')](_0x31667a[_0xdd89('0x45')]);_0x581137[_0xdd89('0x47')]=_[_0xdd89('0x48')](_0x581137['model'],_0x581137[_0xdd89('0x45')]);_0x45bef7['attributes']=_[_0xdd89('0x48')](_0x581137[_0xdd89('0x44')],qs[_0xdd89('0x4a')](_0x31667a[_0xdd89('0x45')][_0xdd89('0x4a')]));_0x45bef7[_0xdd89('0x49')]=_0x45bef7[_0xdd89('0x49')][_0xdd89('0x4b')]?_0x45bef7[_0xdd89('0x49')]:_0x581137[_0xdd89('0x44')];if(!_0x31667a[_0xdd89('0x45')][_0xdd89('0x4c')]('nolimit')){_0x45bef7[_0xdd89('0x30')]=qs[_0xdd89('0x30')](_0x31667a[_0xdd89('0x45')]['limit']);_0x45bef7[_0xdd89('0x2e')]=qs[_0xdd89('0x2e')](_0x31667a[_0xdd89('0x45')][_0xdd89('0x2e')]);}_0x45bef7['order']=qs[_0xdd89('0x4f')](_0x31667a[_0xdd89('0x45')]['sort']);_0x45bef7['where']=qs[_0xdd89('0x47')](_[_0xdd89('0x51')](_0x31667a[_0xdd89('0x45')],_0x581137[_0xdd89('0x47')]));_0x45bef7[_0xdd89('0x50')][_0xdd89('0x67')]=_0xa0ea75['id'];if(_0x31667a[_0xdd89('0x45')][_0xdd89('0x53')]){_0x45bef7[_0xdd89('0x50')]=_[_0xdd89('0x52')](_0x45bef7[_0xdd89('0x50')],{'$or':_[_0xdd89('0x3f')](_0x45bef7[_0xdd89('0x49')],function(_0x36c269){var _0x50db9d={};_0x50db9d[_0x36c269]={'$like':'%'+_0x31667a[_0xdd89('0x45')][_0xdd89('0x53')]+'%'};return _0x50db9d;})});}_0x45bef7=_['merge']({},_0x45bef7,_0x31667a[_0xdd89('0x54')]);return db[_0xdd89('0x68')][_0xdd89('0x31')]({'where':_0x45bef7[_0xdd89('0x50')]})[_0xdd89('0x38')](function(_0x2172ac){_0x3e4669['count']=_0x2172ac;if(_0x31667a[_0xdd89('0x45')]['includeAll']){_0x45bef7[_0xdd89('0x56')]=[{'all':!![]}];}return db[_0xdd89('0x68')]['findAll'](_0x45bef7);})[_0xdd89('0x38')](function(_0xda4dab){_0x3e4669[_0xdd89('0x6b')]=_0xda4dab;return _0x3e4669;});}})['then'](respondWithFilteredResult(_0x5aade4,_0x45bef7))['catch'](handleError(_0x5aade4,null));};exports[_0xdd89('0x6c')]=function(_0x85cf86,_0x695066,_0x29c611){return db[_0xdd89('0x40')][_0xdd89('0x5b')]({'where':{'id':_0x85cf86['params']['id']}})[_0xdd89('0x38')](handleEntityNotFound(_0x695066,null))[_0xdd89('0x38')](function(_0x1e13cc){if(_0x1e13cc){return _0x1e13cc[_0xdd89('0x6c')](_0x85cf86[_0xdd89('0x45')][_0xdd89('0x6d')]);}})[_0xdd89('0x38')](respondWithStatusCode(_0x695066,null))['catch'](handleError(_0x695066,null));};exports[_0xdd89('0x6e')]=function(_0x497153,_0x38048f,_0x514b8a){if(_0x497153['body']['id']){delete _0x497153[_0xdd89('0x5d')]['id'];}return db[_0xdd89('0x40')][_0xdd89('0x5b')]({'where':{'id':_0x497153[_0xdd89('0x59')]['id']}})[_0xdd89('0x38')](handleEntityNotFound(_0x38048f,null))[_0xdd89('0x38')](function(_0x24a914){if(_0x24a914){_0x497153['body'][_0xdd89('0x67')]=_0x24a914['id'];return db[_0xdd89('0x6f')][_0xdd89('0x5c')](_0x497153['body']);}})[_0xdd89('0x38')](respondWithResult(_0x38048f,null))[_0xdd89('0x58')](handleError(_0x38048f,null));};exports[_0xdd89('0x70')]=function(_0x113f7c,_0x45d383,_0x470f12){var _0x4a21f7={'raw':![],'where':{}};var _0x5506a8={};var _0x40cc71={'count':0x0,'rows':[]};return db[_0xdd89('0x40')][_0xdd89('0x6a')]({'where':{'id':_0x113f7c[_0xdd89('0x59')]['id']}})[_0xdd89('0x38')](handleEntityNotFound(_0x45d383,null))[_0xdd89('0x38')](function(_0x1590a4){if(_0x1590a4){_0x5506a8[_0xdd89('0x44')]=_[_0xdd89('0x46')](db['CannedAnswer'][_0xdd89('0x41')]);_0x5506a8[_0xdd89('0x45')]=_['keys'](_0x113f7c[_0xdd89('0x45')]);_0x5506a8[_0xdd89('0x47')]=_['intersection'](_0x5506a8['model'],_0x5506a8[_0xdd89('0x45')]);_0x4a21f7[_0xdd89('0x49')]=_['intersection'](_0x5506a8['model'],qs[_0xdd89('0x4a')](_0x113f7c[_0xdd89('0x45')]['fields']));_0x4a21f7[_0xdd89('0x49')]=_0x4a21f7['attributes'][_0xdd89('0x4b')]?_0x4a21f7[_0xdd89('0x49')]:_0x5506a8[_0xdd89('0x44')];if(!_0x113f7c[_0xdd89('0x45')][_0xdd89('0x4c')](_0xdd89('0x4d'))){_0x4a21f7['limit']=qs[_0xdd89('0x30')](_0x113f7c['query'][_0xdd89('0x30')]);_0x4a21f7[_0xdd89('0x2e')]=qs['offset'](_0x113f7c['query']['offset']);}_0x4a21f7[_0xdd89('0x4e')]=qs[_0xdd89('0x4f')](_0x113f7c[_0xdd89('0x45')][_0xdd89('0x4f')]);_0x4a21f7[_0xdd89('0x50')]=qs[_0xdd89('0x47')](_[_0xdd89('0x51')](_0x113f7c[_0xdd89('0x45')],_0x5506a8['filters']));_0x4a21f7[_0xdd89('0x50')][_0xdd89('0x67')]=_0x1590a4['id'];if(_0x113f7c[_0xdd89('0x45')][_0xdd89('0x53')]){_0x4a21f7[_0xdd89('0x50')]=_[_0xdd89('0x52')](_0x4a21f7[_0xdd89('0x50')],{'$or':_[_0xdd89('0x3f')](_0x4a21f7[_0xdd89('0x49')],function(_0x5c51ad){var _0x22cfd0={};_0x22cfd0[_0x5c51ad]={'$like':'%'+_0x113f7c[_0xdd89('0x45')][_0xdd89('0x53')]+'%'};return _0x22cfd0;})});}_0x4a21f7=_[_0xdd89('0x52')]({},_0x4a21f7,_0x113f7c[_0xdd89('0x54')]);return db['CannedAnswer'][_0xdd89('0x31')]({'where':_0x4a21f7[_0xdd89('0x50')]})[_0xdd89('0x38')](function(_0x2ecd2b){_0x40cc71[_0xdd89('0x31')]=_0x2ecd2b;if(_0x113f7c[_0xdd89('0x45')][_0xdd89('0x55')]){_0x4a21f7[_0xdd89('0x56')]=[{'all':!![]}];}return db[_0xdd89('0x6f')][_0xdd89('0x57')](_0x4a21f7);})[_0xdd89('0x38')](function(_0x1d7256){_0x40cc71[_0xdd89('0x6b')]=_0x1d7256;return _0x40cc71;});}})['then'](respondWithFilteredResult(_0x45d383,_0x4a21f7))[_0xdd89('0x58')](handleError(_0x45d383,null));};exports[_0xdd89('0x71')]=function(_0x265e95,_0x5ca803,_0x79c3ca){return db[_0xdd89('0x40')][_0xdd89('0x5b')]({'where':{'id':_0x265e95[_0xdd89('0x59')]['id']}})[_0xdd89('0x38')](handleEntityNotFound(_0x5ca803,null))[_0xdd89('0x38')](function(_0x37bcd7){if(_0x37bcd7){return _0x37bcd7[_0xdd89('0x71')](_0x265e95['query']['ids']);}})[_0xdd89('0x38')](respondWithStatusCode(_0x5ca803,null))[_0xdd89('0x58')](handleError(_0x5ca803,null));};exports['addAgents']=function(_0xe2144b,_0x4b31ee,_0x2cdc21){return db['WhatsappAccount']['find']({'where':{'id':_0xe2144b['params']['id']}})[_0xdd89('0x38')](handleEntityNotFound(_0x4b31ee,null))['then'](function(_0x466c3b){if(_0x466c3b){return _0x466c3b['addAgents'](_0xe2144b[_0xdd89('0x5d')][_0xdd89('0x6d')],_[_0xdd89('0x72')](_0xe2144b[_0xdd89('0x5d')],[_0xdd89('0x6d'),'id'])||{})[_0xdd89('0x73')](function(_0x5be9e6){for(var _0x171acb=0x0;_0x171acb<_0xe2144b[_0xdd89('0x5d')][_0xdd89('0x6d')][_0xdd89('0x4b')];_0x171acb+=0x1){socket[_0xdd89('0x74')](_0xdd89('0x75'),{'UserId':Number(_0xe2144b['body'][_0xdd89('0x6d')][_0x171acb]),'WhatsappAccountId':Number(_0xe2144b[_0xdd89('0x59')]['id'])});}return _0x5be9e6;});}})[_0xdd89('0x38')](respondWithResult(_0x4b31ee,null))[_0xdd89('0x58')](handleError(_0x4b31ee,null));};exports[_0xdd89('0x76')]=function(_0x9e3772,_0x4bc686,_0x36a9e8){return db[_0xdd89('0x40')][_0xdd89('0x5b')]({'where':{'id':_0x9e3772[_0xdd89('0x59')]['id']}})[_0xdd89('0x38')](handleEntityNotFound(_0x4bc686,null))['then'](function(_0x11581d){if(_0x11581d){return _0x11581d[_0xdd89('0x76')](_0x9e3772[_0xdd89('0x45')][_0xdd89('0x6d')])['then'](function(){if(_[_0xdd89('0x77')](_0x9e3772[_0xdd89('0x45')]['ids'])){for(var _0x331d95=0x0;_0x331d95<_0x9e3772[_0xdd89('0x45')]['ids'][_0xdd89('0x4b')];_0x331d95+=0x1){socket[_0xdd89('0x74')](_0xdd89('0x78'),{'UserId':Number(_0x9e3772['query'][_0xdd89('0x6d')][_0x331d95]),'WhatsappAccountId':Number(_0x9e3772['params']['id'])});}}else{socket[_0xdd89('0x74')](_0xdd89('0x78'),{'UserId':Number(_0x9e3772[_0xdd89('0x45')][_0xdd89('0x6d')]),'WhatsappAccountId':Number(_0x9e3772['params']['id'])});}});}})[_0xdd89('0x38')](respondWithStatusCode(_0x4bc686,null))['catch'](handleError(_0x4bc686,null));};exports['getAgents']=function(_0x3c12d3,_0x9ae4fb,_0x33ff7d){var _0x4c4264={};var _0x2116ad={};var _0x3e38a6;var _0x517101;return db['WhatsappAccount']['findOne']({'where':{'id':_0x3c12d3[_0xdd89('0x59')]['id']}})[_0xdd89('0x38')](handleEntityNotFound(_0x9ae4fb,null))[_0xdd89('0x38')](function(_0x2d92e1){if(_0x2d92e1){_0x3e38a6=_0x2d92e1;_0x2116ad[_0xdd89('0x44')]=_[_0xdd89('0x46')](db[_0xdd89('0x79')][_0xdd89('0x41')]);_0x2116ad[_0xdd89('0x45')]=_['keys'](_0x3c12d3[_0xdd89('0x45')]);_0x2116ad[_0xdd89('0x47')]=_[_0xdd89('0x48')](_0x2116ad[_0xdd89('0x44')],_0x2116ad[_0xdd89('0x45')]);_0x4c4264[_0xdd89('0x49')]=_[_0xdd89('0x48')](_0x2116ad[_0xdd89('0x44')],qs[_0xdd89('0x4a')](_0x3c12d3[_0xdd89('0x45')][_0xdd89('0x4a')]));_0x4c4264[_0xdd89('0x49')]=_0x4c4264['attributes'][_0xdd89('0x4b')]?_0x4c4264[_0xdd89('0x49')]:_0x2116ad[_0xdd89('0x44')];_0x4c4264[_0xdd89('0x4e')]=qs[_0xdd89('0x4f')](_0x3c12d3[_0xdd89('0x45')][_0xdd89('0x4f')]);_0x4c4264[_0xdd89('0x50')]=qs[_0xdd89('0x47')](_['pick'](_0x3c12d3[_0xdd89('0x45')],_0x2116ad[_0xdd89('0x47')]));if(_0x3c12d3[_0xdd89('0x45')][_0xdd89('0x53')]){_0x4c4264['where']=_[_0xdd89('0x52')](_0x4c4264[_0xdd89('0x50')],{'$or':_['map'](_0x4c4264[_0xdd89('0x49')],function(_0x3085fe){var _0x1c4374={};_0x1c4374[_0x3085fe]={'$like':'%'+_0x3c12d3[_0xdd89('0x45')][_0xdd89('0x53')]+'%'};return _0x1c4374;})});}_0x4c4264=_[_0xdd89('0x52')]({},_0x4c4264,_0x3c12d3['options']);return _0x3e38a6[_0xdd89('0x7a')](_0x4c4264);}})[_0xdd89('0x38')](function(_0xe2d770){if(_0xe2d770){_0x517101=_0xe2d770[_0xdd89('0x4b')];if(!_0x3c12d3[_0xdd89('0x45')]['hasOwnProperty'](_0xdd89('0x4d'))){_0x4c4264[_0xdd89('0x30')]=qs[_0xdd89('0x30')](_0x3c12d3[_0xdd89('0x45')][_0xdd89('0x30')]);_0x4c4264[_0xdd89('0x2e')]=qs[_0xdd89('0x2e')](_0x3c12d3[_0xdd89('0x45')][_0xdd89('0x2e')]);}return _0x3e38a6[_0xdd89('0x7a')](_0x4c4264);}})[_0xdd89('0x38')](function(_0x160bfa){if(_0x160bfa){return _0x160bfa?{'count':_0x517101,'rows':_0x160bfa}:null;}})[_0xdd89('0x38')](respondWithResult(_0x9ae4fb,null))['catch'](handleError(_0x9ae4fb,null));};exports[_0xdd89('0x7b')]=function(_0x56a26a,_0x7d67e9){var _0x11e9c2=_0x56a26a['params']['id'];var _0x3051a0=_0x56a26a[_0xdd89('0x5d')];var _0x382355=0xc8;var _0x1ada3d=null;return db[_0xdd89('0x7c')][_0xdd89('0x7d')]({'isolationLevel':db[_0xdd89('0x7c')]['Transaction'][_0xdd89('0x7e')][_0xdd89('0x7f')]},function(_0x172cf2){return db[_0xdd89('0x40')][_0xdd89('0x6a')]({'where':{'id':_0x11e9c2},'transaction':_0x172cf2})[_0xdd89('0x38')](function(_0x1c8436){if(_0x1c8436){return db[_0xdd89('0x80')][_0xdd89('0x39')]({'where':{'WhatsappAccountId':_0x11e9c2},'transaction':_0x172cf2})[_0xdd89('0x38')](function(){var _0x3cb0df=_['map'](_0x3051a0,function(_0x1440e7){_0x1440e7['WhatsappAccountId']=_0x11e9c2;return _0x1440e7;});return db[_0xdd89('0x80')][_0xdd89('0x81')](_0x3cb0df,{'transaction':_0x172cf2});});}else{_0x382355=0x194;_0x1ada3d=[];}});})[_0xdd89('0x38')](function(){if(_0x382355!==0x194){return db['WhatsappApplication'][_0xdd89('0x82')]({'where':{'WhatsappAccountId':_0x11e9c2},'order':_0xdd89('0x83')})[_0xdd89('0x38')](function(_0x3ce499){_0x1ada3d=_0x3ce499;});}})[_0xdd89('0x58')](function(_0x4ff9dd){_0x382355=0x1f4;logger[_0xdd89('0x26')](_0x4ff9dd[_0xdd89('0x3b')]);if(_0x4ff9dd[_0xdd89('0x3c')]){delete _0x4ff9dd[_0xdd89('0x3c')];}_0x1ada3d=_0x4ff9dd;})[_0xdd89('0x84')](function(){if(_0x1ada3d===null){_0x7d67e9['sendStatus'](_0x382355);}else{if(_0x382355===0x1f4){_0x7d67e9[_0xdd89('0x2d')](_0x382355)[_0xdd89('0x85')](_0x1ada3d);}else{_0x7d67e9[_0xdd89('0x2d')](_0x382355)[_0xdd89('0x33')](_0x1ada3d);}}});};exports[_0xdd89('0x86')]=function(_0x41144c,_0x14cfbd,_0x122c2d){var _0x2b2f63={};var _0x4c60e4={};var _0x4d4b1f;var _0x44c426;return db[_0xdd89('0x40')][_0xdd89('0x6a')]({'where':{'id':_0x41144c[_0xdd89('0x59')]['id']}})[_0xdd89('0x38')](handleEntityNotFound(_0x14cfbd,null))['then'](function(_0x50c8b8){if(_0x50c8b8){_0x4d4b1f=_0x50c8b8;_0x4c60e4[_0xdd89('0x44')]=_[_0xdd89('0x46')](db[_0xdd89('0x80')][_0xdd89('0x41')]);_0x4c60e4[_0xdd89('0x45')]=_[_0xdd89('0x46')](_0x41144c['query']);_0x4c60e4['filters']=_['intersection'](_0x4c60e4['model'],_0x4c60e4[_0xdd89('0x45')]);_0x2b2f63[_0xdd89('0x49')]=_[_0xdd89('0x48')](_0x4c60e4[_0xdd89('0x44')],qs[_0xdd89('0x4a')](_0x41144c['query']['fields']));_0x2b2f63['attributes']=_0x2b2f63[_0xdd89('0x49')]['length']?_0x2b2f63[_0xdd89('0x49')]:_0x4c60e4[_0xdd89('0x44')];_0x2b2f63[_0xdd89('0x4e')]=qs[_0xdd89('0x4f')](_0x41144c['query']['sort']);_0x2b2f63[_0xdd89('0x50')]=qs['filters'](_[_0xdd89('0x51')](_0x41144c[_0xdd89('0x45')],_0x4c60e4[_0xdd89('0x47')]));if(_0x41144c['query'][_0xdd89('0x53')]){_0x2b2f63[_0xdd89('0x50')]=_[_0xdd89('0x52')](_0x2b2f63[_0xdd89('0x50')],{'$or':_[_0xdd89('0x3f')](_0x2b2f63[_0xdd89('0x49')],function(_0x35ac05){var _0x1abefe={};_0x1abefe[_0x35ac05]={'$like':'%'+_0x41144c[_0xdd89('0x45')][_0xdd89('0x53')]+'%'};return _0x1abefe;})});}_0x2b2f63=_[_0xdd89('0x52')]({},_0x2b2f63,_0x41144c[_0xdd89('0x54')]);return _0x4d4b1f[_0xdd89('0x86')](_0x2b2f63);}})[_0xdd89('0x38')](function(_0x4a9b36){if(_0x4a9b36){_0x44c426=_0x4a9b36[_0xdd89('0x4b')];if(!_0x41144c['query'][_0xdd89('0x4c')]('nolimit')){_0x2b2f63['limit']=qs[_0xdd89('0x30')](_0x41144c[_0xdd89('0x45')][_0xdd89('0x30')]);_0x2b2f63[_0xdd89('0x2e')]=qs[_0xdd89('0x2e')](_0x41144c[_0xdd89('0x45')]['offset']);}return _0x4d4b1f[_0xdd89('0x86')](_0x2b2f63);}})[_0xdd89('0x38')](function(_0x1ac717){if(_0x1ac717){return _0x1ac717?{'count':_0x44c426,'rows':_0x1ac717}:null;}})[_0xdd89('0x38')](respondWithResult(_0x14cfbd,null))[_0xdd89('0x58')](handleError(_0x14cfbd,null));};exports[_0xdd89('0x87')]=function(_0x5c58da,_0x3c3c49,_0x1095d1){var _0x2ce4d3={'channel':_0xdd89('0x88')};var _0x1fadae=[];var _0x14d3b3=[];var _0x45754d={};return db['WhatsappAccount'][_0xdd89('0x5b')]({'where':{'id':_0x5c58da['params']['id']},'include':[{'model':db[_0xdd89('0x80')],'as':'Applications'}]})[_0xdd89('0x38')](handleEntityNotFound(_0x3c3c49,null))[_0xdd89('0x38')](function(_0x58ac5a){_0x2ce4d3['account']=_0x58ac5a;if(_0x2ce4d3[_0xdd89('0x89')]&&_0x2ce4d3[_0xdd89('0x89')][_0xdd89('0x42')]==='sinch'&&_0x5c58da['body'][_0xdd89('0x8a')]){if(_0x5c58da[_0xdd89('0x5d')]['statuses'][_0xdd89('0x4b')]===0x0)return;if(_0x5c58da[_0xdd89('0x5d')][_0xdd89('0x8a')][0x0]['state']!==_0xdd89('0x8b'))return;return db[_0xdd89('0x8c')][_0xdd89('0x37')]({'read':!![],'readAt':_0x5c58da['body'][_0xdd89('0x8a')][0x0][_0xdd89('0x8d')]},{'where':{'messageId':_0x5c58da[_0xdd89('0x5d')][_0xdd89('0x8a')][0x0]['message_id']},'individualHooks':!![]})[_0xdd89('0x38')](function(_0x90c49){return _0x3c3c49['status'](0xc8)[_0xdd89('0x33')](_0x90c49);});}_0x2ce4d3[_0xdd89('0x8e')]=_[_0xdd89('0x8f')](_0x58ac5a[_0xdd89('0x90')],[_0xdd89('0x83')],[_0xdd89('0x91')]);if(_0x2ce4d3['account']['Applications']){delete _0x2ce4d3[_0xdd89('0x89')][_0xdd89('0x90')];}return db[_0xdd89('0x92')][_0xdd89('0x65')]()[_0xdd89('0x38')](function(_0x518c16){if(!_0x518c16){throw new db[(_0xdd89('0x93'))]['ValidationError'](_0xdd89('0x94'));}_0x1fadae=_[_0xdd89('0x95')](_[_0xdd89('0x46')](_0x518c16),['createdAt',_0xdd89('0x96')]);_0x14d3b3=_[_0xdd89('0x95')](_[_0xdd89('0x46')](_0x518c16),[_0xdd89('0x97'),_0xdd89('0x96'),_0xdd89('0x98'),'ListId']);_0x2ce4d3[_0xdd89('0x5d')]={'mapKey':_0xdd89('0x99')};if(_0x2ce4d3[_0xdd89('0x89')]&&_0x2ce4d3['account'][_0xdd89('0x42')]==='twilio'){_0x2ce4d3[_0xdd89('0x5d')][_0xdd89('0x9a')]=_0x5c58da[_0xdd89('0x5d')][_0xdd89('0x9b')]['replace']('whatsapp:','');_0x2ce4d3[_0xdd89('0x5d')][_0xdd89('0x5d')]=_0x5c58da[_0xdd89('0x5d')][_0xdd89('0x9c')];_0x2ce4d3[_0xdd89('0x5d')][_0xdd89('0x9d')]=_0x5c58da[_0xdd89('0x5d')][_0xdd89('0x9e')];}if(_0x2ce4d3[_0xdd89('0x89')]&&_0x2ce4d3[_0xdd89('0x89')]['type']===_0xdd89('0x9f')){_0x2ce4d3[_0xdd89('0x5d')]['from']=_0x5c58da[_0xdd89('0x5d')][_0xdd89('0xa0')][0x0][_0xdd89('0x9a')];_0x2ce4d3[_0xdd89('0x5d')]['body']=_0x5c58da[_0xdd89('0x5d')][_0xdd89('0xa0')][0x0]['message'][_0xdd89('0x5d')];_0x2ce4d3[_0xdd89('0x5d')]['messageId']=_0x5c58da['body']['notifications'][0x0]['message_id'];}if(_0x2ce4d3[_0xdd89('0x5d')]['id']){delete _0x2ce4d3[_0xdd89('0x5d')]['id'];}if(_[_0xdd89('0xa1')](_0x2ce4d3[_0xdd89('0x5d')]['from'])){throw new db[(_0xdd89('0x93'))][(_0xdd89('0xa2'))](_0xdd89('0xa3'));}if(_[_0xdd89('0xa1')](_0x2ce4d3[_0xdd89('0x5d')][_0xdd89('0x5d')])||_0x2ce4d3['body'][_0xdd89('0x5d')]===''){throw new db[(_0xdd89('0x93'))][(_0xdd89('0xa2'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2ce4d3[_0xdd89('0x5d')][_0xdd89('0xa4')])){throw new db[(_0xdd89('0x93'))][(_0xdd89('0xa2'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x14d3b3);}if(!_[_0xdd89('0xa5')](_0x14d3b3,_0x2ce4d3[_0xdd89('0x5d')][_0xdd89('0xa4')])){throw new db[(_0xdd89('0x93'))][(_0xdd89('0xa2'))](_0xdd89('0xa6')+_0x14d3b3);}_0x45754d[_0x2ce4d3[_0xdd89('0x5d')][_0xdd89('0xa4')]]=_0x2ce4d3[_0xdd89('0x5d')]['from'];return db[_0xdd89('0xa7')][_0xdd89('0x5b')]({'where':{'id':_0x2ce4d3[_0xdd89('0x89')]['ListId']},'include':[{'model':db[_0xdd89('0x92')],'as':'Contacts','where':_0x45754d,'limit':0x1,'order':[['updatedAt',_0xdd89('0xa8')]]}]});})[_0xdd89('0x38')](handleEntityNotFound(_0x3c3c49,null))[_0xdd89('0x38')](function(_0x547619){if(_0x547619){_0x2ce4d3['list']=_[_0xdd89('0x72')](_0x547619,[_0xdd89('0xa9')]);if(_0x547619['Contacts'][_0xdd89('0x4b')]){return _0x547619[_0xdd89('0xa9')][0x0];}var _0x28b79f=_[_0xdd89('0x1b')](_0x2ce4d3['body'],{'firstName':_0x2ce4d3[_0xdd89('0x5d')]['from'],'ListId':_0x547619['id']});_0x28b79f[_0x2ce4d3['body'][_0xdd89('0xa4')]]=_0x2ce4d3[_0xdd89('0x5d')]['from'];return db[_0xdd89('0x92')][_0xdd89('0x5c')](_0x28b79f,{'fields':_0x1fadae,'raw':!![]});}})[_0xdd89('0x38')](handleEntityNotFound(_0x3c3c49,null))[_0xdd89('0x38')](function(_0x5b8922){if(_0x5b8922){_0x2ce4d3[_0xdd89('0xaa')]=_0x5b8922;var _0x4f8d36={'ContactId':_0x5b8922['id'],'phone':_0x2ce4d3[_0xdd89('0x5d')]['from'],'WhatsappAccountId':_0x5c58da[_0xdd89('0x59')]['id']};var _0x310e77={'ContactId':_0x5b8922['id'],'WhatsappAccountId':_0x5c58da[_0xdd89('0x59')]['id'],'closed':![]};return db[_0xdd89('0xab')][_0xdd89('0x5b')]({'where':_0x310e77})[_0xdd89('0x38')](function(_0x147baa){if(_0x147baa){return[_0x147baa,![]];}return db[_0xdd89('0xab')]['create'](_0x4f8d36)['then'](function(_0x529e97){return[_0x529e97,!![]];});});}})[_0xdd89('0x73')](function(_0x427cc7,_0x18cc74){_0x2ce4d3[_0xdd89('0xac')]=_0x427cc7[_0xdd89('0x5f')]({'plain':!![]});_0x2ce4d3[_0xdd89('0xac')][_0xdd89('0xad')]=![];if(_0x18cc74){if(_0x2ce4d3[_0xdd89('0x89')][_0xdd89('0xae')]){_0x2ce4d3[_0xdd89('0x8e')][_0xdd89('0xaf')]({'id':0x0,'priority':_0x2ce4d3[_0xdd89('0x8e')][_0xdd89('0x4b')]+0x1,'app':_0xdd89('0xb0'),'appdata':_0xdd89('0xb1'),'interval':_0xdd89('0xb2')});}_0x2ce4d3['interaction'][_0xdd89('0xad')]=!![];}return db[_0xdd89('0x8c')][_0xdd89('0x5c')]({'phone':_0x2ce4d3[_0xdd89('0x5d')][_0xdd89('0x9a')],'messageId':_0x2ce4d3['body'][_0xdd89('0x9d')],'body':_0x2ce4d3[_0xdd89('0x5d')][_0xdd89('0x5d')],'WhatsappAccountId':_0x5c58da['params']['id'],'WhatsappInteractionId':_0x427cc7['id'],'direction':'in','ContactId':_0x427cc7[_0xdd89('0xb3')],'AttachmentId':_0x2ce4d3[_0xdd89('0x5d')][_0xdd89('0xb4')]});})['then'](function(_0xb8e5d4){_0x2ce4d3[_0xdd89('0x28')]=_0xb8e5d4;if(_0x2ce4d3[_0xdd89('0xac')]['UserId']){return db['User'][_0xdd89('0x5b')]({'attributes':['id',_0xdd89('0x3c')],'where':{'id':_0x2ce4d3['interaction'][_0xdd89('0xb5')]}})[_0xdd89('0x38')](function(_0x4a9e47){if(_0x4a9e47){_0x2ce4d3['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xdd89('0xb6'),'appdata':_0x4a9e47[_0xdd89('0x3c')]+','+(_0x2ce4d3['account'][_0xdd89('0xb7')]||0xa),'interval':_0xdd89('0xb2')});}return respondWithRpcPromise(_0xdd89('0xb8'),_0xdd89('0xb9'),_0x2ce4d3);});}return respondWithRpcPromise(_0xdd89('0xb8'),'startRouting',_0x2ce4d3);})['then'](function(_0x1e6ee8){if(_0x1e6ee8){var _0x88912a=0xc8;var _0x3238cb=_0xdd89('0xba');logger[_0xdd89('0x21')](_0xdd89('0x24'),_0x3238cb,_0x88912a,_0xdd89('0xbb'));logger[_0xdd89('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3238cb,_0x88912a,_0xdd89('0xbb'),JSON[_0xdd89('0x25')](_0x1e6ee8));if(_0x2ce4d3[_0xdd89('0x89')]['type']===_0xdd89('0xbc')){return _0x3c3c49['status'](_0x88912a)[_0xdd89('0x32')]('Content-Type',_0xdd89('0xbd'))[_0xdd89('0x85')](_0xdd89('0xbe'));}else{return _0x3c3c49['status'](_0x88912a)[_0xdd89('0x33')](_0x1e6ee8);}}});})['catch'](handleError(_0x3c3c49,null));};exports[_0xdd89('0x85')]=function(_0x1db587,_0x4424df,_0x90ad3e){var _0x4725ce,_0x39153b,_0x334691;if(_[_0xdd89('0xa1')](_0x1db587[_0xdd89('0x5d')][_0xdd89('0x5d')])||_0x1db587[_0xdd89('0x5d')][_0xdd89('0x5d')]===''){throw new db[(_0xdd89('0x93'))][(_0xdd89('0xa2'))](_0xdd89('0xbf'));}if(_['isNil'](_0x1db587[_0xdd89('0x5d')]['to'])){throw new db[(_0xdd89('0x93'))][(_0xdd89('0xa2'))](_0xdd89('0xc0'));}_0x4725ce=_0x1db587['body']['to'];return db[_0xdd89('0x40')][_0xdd89('0x5b')]({'where':{'id':_0x1db587[_0xdd89('0x59')]['id']},'include':[{'model':db[_0xdd89('0xa7')],'as':_0xdd89('0xc1'),'include':[{'model':db[_0xdd89('0x92')],'as':'Contacts','where':{'mobile':_0x4725ce},'limit':0x1,'order':[[_0xdd89('0x96'),_0xdd89('0xa8')]]}]}]})[_0xdd89('0x38')](handleEntityNotFound(_0x4424df,null))['then'](function(_0xbad53a){if(_0xbad53a&&_0xbad53a['List']){_0x39153b=_0xbad53a['get']({'plain':!![]});if(_0x39153b[_0xdd89('0xc1')]&&_0x39153b[_0xdd89('0xc1')][_0xdd89('0xa9')][_0xdd89('0x4b')]){return _0x39153b[_0xdd89('0xc1')][_0xdd89('0xa9')][0x0];}return db[_0xdd89('0x92')][_0xdd89('0x5c')](_[_0xdd89('0x1b')](_0x1db587['body'],{'firstName':_0x4725ce,'mobile':_0x4725ce,'phone':_0x4725ce,'ListId':_0x39153b[_0xdd89('0xc2')]}));}})[_0xdd89('0x38')](handleEntityNotFound(_0x4424df,null))[_0xdd89('0x38')](function(_0x4576e8){if(_0x4576e8){_0x334691=_0x4576e8;return db[_0xdd89('0xab')][_0xdd89('0x5b')]({'where':{'ContactId':_0x334691['id'],'closed':![],'WhatsappAccountId':_0x39153b['id']}})[_0xdd89('0x38')](function(_0x3aeafe){if(_0x3aeafe){return[_0x3aeafe,![]];}return db['WhatsappInteraction'][_0xdd89('0x5c')]({'UserId':_0x1db587['user']['id'],'ContactId':_0x334691['id'],'WhatsappAccountId':_0x39153b['id'],'phone':_0x4725ce,'firstMsgDirection':_0xdd89('0xc3'),'Messages':[_[_0xdd89('0x52')](_0x1db587[_0xdd89('0x5d')],{'read':![],'body':_0x1db587[_0xdd89('0x5d')]['body'],'phone':_0x4725ce,'WhatsappAccountId':_0x39153b['id'],'UserId':_0x1db587[_0xdd89('0x5e')]['id'],'ContactId':_0x334691['id']})]},{'include':[{'model':db[_0xdd89('0x8c')],'as':_0xdd89('0xc4')}]})[_0xdd89('0x38')](function(_0x2665e1){return[_0x2665e1,!![]];});});}})['spread'](function(_0x5c3fb2,_0x254afe){if(_0x254afe){return _0x5c3fb2;}return db[_0xdd89('0x8c')][_0xdd89('0x5c')](_[_0xdd89('0x52')](_0x1db587[_0xdd89('0x5d')],{'read':![],'body':_0x1db587[_0xdd89('0x5d')][_0xdd89('0x5d')],'phone':_0x4725ce,'WhatsappAccountId':_0x39153b['id'],'WhatsappInteractionId':_0x5c3fb2['id'],'UserId':_0x1db587['user']['id'],'ContactId':_0x334691['id']}))[_0xdd89('0x38')](function(_0xf15a6b){_0x5c3fb2['dataValues'][_0xdd89('0xc4')]=[];_0x5c3fb2[_0xdd89('0xc5')][_0xdd89('0xc4')]['push'](_0xf15a6b['dataValues']);return _0x5c3fb2;});})[_0xdd89('0x38')](respondWithResult(_0x4424df,null))[_0xdd89('0x58')](handleError(_0x4424df,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 8544ad6..0c28e8d 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 _0x51b8=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','remove'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0x51b8,0xba));var _0x851b=function(_0x3b3868,_0x4de351){_0x3b3868=_0x3b3868-0x0;var _0x15b74b=_0x51b8[_0x3b3868];return _0x15b74b;};'use strict';var EventEmitter=require(_0x851b('0x0'));var WhatsappAccount=require(_0x851b('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x851b('0x2')};function emitEvent(_0x3f4178){return function(_0xf44241,_0x181d57,_0x5b4d30){WhatsappAccountEvents['emit'](_0x3f4178+':'+_0xf44241['id'],_0xf44241);WhatsappAccountEvents[_0x851b('0x3')](_0x3f4178,_0xf44241);_0x5b4d30(null);};}for(var e in events){if(events[_0x851b('0x4')](e)){var event=events[e];WhatsappAccount[_0x851b('0x5')](e,emitEvent(event));}}module[_0x851b('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x35ee=['WhatsappAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x35ee,0x1c2));var _0xe35e=function(_0x2db321,_0x145fe8){_0x2db321=_0x2db321-0x0;var _0x2f7062=_0x35ee[_0x2db321];return _0x2f7062;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0xe35e('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xe35e('0x1')](0x0);var events={'afterCreate':_0xe35e('0x2'),'afterUpdate':_0xe35e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5d2b64){return function(_0x387a20,_0x171929,_0x3b0bcc){WhatsappAccountEvents[_0xe35e('0x4')](_0x5d2b64+':'+_0x387a20['id'],_0x387a20);WhatsappAccountEvents[_0xe35e('0x4')](_0x5d2b64,_0x387a20);_0x3b0bcc(null);};}for(var e in events){if(events[_0xe35e('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 0c7cc28..b60f4da 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 _0xf86e=['../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf86e,0xc9));var _0xef86=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xf86e[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xef86('0x0'));var util=require(_0xef86('0x1'));var logger=require(_0xef86('0x2'))(_0xef86('0x3'));var moment=require(_0xef86('0x4'));var BPromise=require(_0xef86('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xef86('0x6'));var config=require(_0xef86('0x7'));var attributes=require(_0xef86('0x8'));module[_0xef86('0x9')]=function(_0x51233d,_0x136ff0){return _0x51233d[_0xef86('0xa')](_0xef86('0xb'),attributes,{'tableName':_0xef86('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7eb=['./whatsappAccount.attributes','define','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xf47605,_0x22a2f5){var _0x33bee8=function(_0x4516f0){while(--_0x4516f0){_0xf47605['push'](_0xf47605['shift']());}};_0x33bee8(++_0x22a2f5);}(_0xd7eb,0xfd));var _0xbd7e=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xd7eb[_0x411017];return _0x2adeea;};'use strict';var _=require(_0xbd7e('0x0'));var util=require(_0xbd7e('0x1'));var logger=require(_0xbd7e('0x2'))(_0xbd7e('0x3'));var moment=require(_0xbd7e('0x4'));var BPromise=require(_0xbd7e('0x5'));var rp=require(_0xbd7e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbd7e('0x7'));module['exports']=function(_0x4359db,_0x414166){return _0x4359db[_0xbd7e('0x8')]('WhatsappAccount',attributes,{'tableName':_0xbd7e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 53de8c9..4d8b90d 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 _0x12ed=['WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','include','map','model','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x12ed,0x1d9));var _0xd12e=function(_0x276765,_0x204e34){_0x276765=_0x276765-0x0;var _0x3db953=_0x12ed[_0x276765];return _0x3db953;};'use strict';var _=require(_0xd12e('0x0'));var util=require(_0xd12e('0x1'));var moment=require('moment');var BPromise=require(_0xd12e('0x2'));var rs=require(_0xd12e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd12e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd12e('0x5'))(_0xd12e('0x6'));var config=require(_0xd12e('0x7'));var jayson=require(_0xd12e('0x8'));var client=jayson[_0xd12e('0x9')][_0xd12e('0xa')]({'port':0x232a});config[_0xd12e('0xb')]=_['defaults'](config[_0xd12e('0xb')],{'host':_0xd12e('0xc'),'port':0x18eb});var socket=require(_0xd12e('0xd'))(new Redis(config[_0xd12e('0xb')]));require(_0xd12e('0xe'))[_0xd12e('0xf')](socket);function respondWithRpcPromise(_0x5dbcc2,_0x482d93,_0x185989){return new BPromise(function(_0x228bf7,_0x512dba){return client[_0xd12e('0x10')](_0x5dbcc2,_0x185989)[_0xd12e('0x11')](function(_0x4d587f){logger[_0xd12e('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x482d93,_0xd12e('0x13'));logger[_0xd12e('0x14')](_0xd12e('0x15'),_0x482d93,_0xd12e('0x13'),JSON[_0xd12e('0x16')](_0x4d587f));if(_0x4d587f[_0xd12e('0x17')]){if(_0x4d587f[_0xd12e('0x17')][_0xd12e('0x18')]===0x1f4){logger[_0xd12e('0x17')](_0xd12e('0x19'),_0x482d93,_0x4d587f[_0xd12e('0x17')]['message']);return _0x512dba(_0x4d587f['error']['message']);}logger[_0xd12e('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x482d93,_0x4d587f[_0xd12e('0x17')]['message']);return _0x228bf7(_0x4d587f['error'][_0xd12e('0x1a')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x482d93,_0xd12e('0x13'));_0x228bf7(_0x4d587f[_0xd12e('0x1b')][_0xd12e('0x1a')]);}})['catch'](function(_0x3dca88){logger[_0xd12e('0x17')](_0xd12e('0x19'),_0x482d93,_0x3dca88);_0x512dba(_0x3dca88);});});}exports[_0xd12e('0x1c')]=function(_0x3cd28a){var _0x15ea9b=this;return new Promise(function(_0x23e3b8,_0x2ded85){return db[_0xd12e('0x1d')]['find']({'raw':_0x3cd28a[_0xd12e('0x1e')]?_0x3cd28a[_0xd12e('0x1e')][_0xd12e('0x1f')]===undefined?!![]:![]:!![],'where':_0x3cd28a[_0xd12e('0x1e')]?_0x3cd28a['options'][_0xd12e('0x20')]||null:null,'attributes':_0x3cd28a[_0xd12e('0x1e')]?_0x3cd28a[_0xd12e('0x1e')][_0xd12e('0x21')]||null:null,'include':_0x3cd28a[_0xd12e('0x1e')]?_0x3cd28a['options'][_0xd12e('0x22')]?_[_0xd12e('0x23')](_0x3cd28a[_0xd12e('0x1e')][_0xd12e('0x22')],function(_0xaafad8){return{'model':db[_0xaafad8[_0xd12e('0x24')]],'as':_0xaafad8['as'],'attributes':_0xaafad8[_0xd12e('0x21')],'include':_0xaafad8['include']?_[_0xd12e('0x23')](_0xaafad8['include'],function(_0x278d75){return{'model':db[_0x278d75['model']],'as':_0x278d75['as'],'attributes':_0x278d75[_0xd12e('0x21')],'include':_0x278d75['include']?_[_0xd12e('0x23')](_0x278d75[_0xd12e('0x22')],function(_0xedd796){return{'model':db[_0xedd796['model']],'as':_0xedd796['as'],'attributes':_0xedd796[_0xd12e('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd12e('0x11')](function(_0x1df3e4){logger['info'](_0xd12e('0x1c'),_0x3cd28a);logger[_0xd12e('0x14')](_0xd12e('0x1c'),_0x3cd28a,JSON['stringify'](_0x1df3e4));_0x23e3b8(_0x1df3e4);})[_0xd12e('0x25')](function(_0x83d35){logger[_0xd12e('0x17')]('ShowWhatsappAccount',_0x83d35[_0xd12e('0x1a')],_0x3cd28a);_0x2ded85(_0x15ea9b[_0xd12e('0x17')](0x1f4,_0x83d35[_0xd12e('0x1a')]));});});}; \ No newline at end of file +var _0xdb84=['request\x20sent','debug','error','code','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','include','attributes','model','map','stringify','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0xdb84,0xa8));var _0x4db8=function(_0x5e5e31,_0x327601){_0x5e5e31=_0x5e5e31-0x0;var _0x50a4fd=_0xdb84[_0x5e5e31];return _0x50a4fd;};'use strict';var _=require('lodash');var util=require(_0x4db8('0x0'));var moment=require(_0x4db8('0x1'));var BPromise=require('bluebird');var rs=require(_0x4db8('0x2'));var fs=require('fs');var Redis=require(_0x4db8('0x3'));var db=require(_0x4db8('0x4'))['db'];var utils=require(_0x4db8('0x5'));var logger=require(_0x4db8('0x6'))(_0x4db8('0x7'));var config=require(_0x4db8('0x8'));var jayson=require(_0x4db8('0x9'));var client=jayson[_0x4db8('0xa')][_0x4db8('0xb')]({'port':0x232a});config[_0x4db8('0xc')]=_[_0x4db8('0xd')](config[_0x4db8('0xc')],{'host':_0x4db8('0xe'),'port':0x18eb});var socket=require(_0x4db8('0xf'))(new Redis(config['redis']));require(_0x4db8('0x10'))[_0x4db8('0x11')](socket);function respondWithRpcPromise(_0x304e80,_0x2ffcfe,_0x356da5){return new BPromise(function(_0x2076f1,_0x6e3e22){return client[_0x4db8('0x12')](_0x304e80,_0x356da5)[_0x4db8('0x13')](function(_0x59eaea){logger[_0x4db8('0x14')](_0x4db8('0x15'),_0x2ffcfe,_0x4db8('0x16'));logger[_0x4db8('0x17')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2ffcfe,_0x4db8('0x16'),JSON['stringify'](_0x59eaea));if(_0x59eaea[_0x4db8('0x18')]){if(_0x59eaea[_0x4db8('0x18')][_0x4db8('0x19')]===0x1f4){logger[_0x4db8('0x18')](_0x4db8('0x15'),_0x2ffcfe,_0x59eaea[_0x4db8('0x18')][_0x4db8('0x1a')]);return _0x6e3e22(_0x59eaea[_0x4db8('0x18')][_0x4db8('0x1a')]);}logger[_0x4db8('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x2ffcfe,_0x59eaea['error'][_0x4db8('0x1a')]);return _0x2076f1(_0x59eaea['error'][_0x4db8('0x1a')]);}else{logger['info'](_0x4db8('0x15'),_0x2ffcfe,'request\x20sent');_0x2076f1(_0x59eaea[_0x4db8('0x1b')][_0x4db8('0x1a')]);}})['catch'](function(_0x19501e){logger['error'](_0x4db8('0x15'),_0x2ffcfe,_0x19501e);_0x6e3e22(_0x19501e);});});}exports[_0x4db8('0x1c')]=function(_0x433e7a){var _0x275b49=this;return new Promise(function(_0x3b17c3,_0x1a3fe7){return db[_0x4db8('0x1d')][_0x4db8('0x1e')]({'raw':_0x433e7a[_0x4db8('0x1f')]?_0x433e7a[_0x4db8('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x433e7a['options']?_0x433e7a[_0x4db8('0x1f')]['where']||null:null,'attributes':_0x433e7a['options']?_0x433e7a[_0x4db8('0x1f')]['attributes']||null:null,'include':_0x433e7a[_0x4db8('0x1f')]?_0x433e7a[_0x4db8('0x1f')][_0x4db8('0x20')]?_['map'](_0x433e7a[_0x4db8('0x1f')]['include'],function(_0x4994a9){return{'model':db[_0x4994a9['model']],'as':_0x4994a9['as'],'attributes':_0x4994a9[_0x4db8('0x21')],'include':_0x4994a9[_0x4db8('0x20')]?_['map'](_0x4994a9[_0x4db8('0x20')],function(_0x3ff1b8){return{'model':db[_0x3ff1b8[_0x4db8('0x22')]],'as':_0x3ff1b8['as'],'attributes':_0x3ff1b8[_0x4db8('0x21')],'include':_0x3ff1b8[_0x4db8('0x20')]?_[_0x4db8('0x23')](_0x3ff1b8[_0x4db8('0x20')],function(_0x4e901c){return{'model':db[_0x4e901c[_0x4db8('0x22')]],'as':_0x4e901c['as'],'attributes':_0x4e901c[_0x4db8('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4db8('0x13')](function(_0xd63994){logger[_0x4db8('0x14')](_0x4db8('0x1c'),_0x433e7a);logger[_0x4db8('0x17')](_0x4db8('0x1c'),_0x433e7a,JSON[_0x4db8('0x24')](_0xd63994));_0x3b17c3(_0xd63994);})[_0x4db8('0x25')](function(_0x11da8d){logger['error'](_0x4db8('0x1c'),_0x11da8d['message'],_0x433e7a);_0x1a3fe7(_0x275b49[_0x4db8('0x18')](0x1f4,_0x11da8d[_0x4db8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index a7b8976..f0c6dfa 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 _0xa30c=['register','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener'];(function(_0x72916f,_0x1d3f3f){var _0x5142c6=function(_0x223f6b){while(--_0x223f6b){_0x72916f['push'](_0x72916f['shift']());}};_0x5142c6(++_0x1d3f3f);}(_0xa30c,0x1a2));var _0xca30=function(_0x5dc2b2,_0x42d970){_0x5dc2b2=_0x5dc2b2-0x0;var _0x2e3e35=_0xa30c[_0x5dc2b2];return _0x2e3e35;};'use strict';var WhatsappAccountEvents=require(_0xca30('0x0'));var events=[_0xca30('0x1'),_0xca30('0x2'),_0xca30('0x3')];function createListener(_0x58077a,_0xebbbbd){return function(_0x4fca21){_0xebbbbd[_0xca30('0x4')](_0x58077a,_0x4fca21);};}function removeListener(_0x2c6e40,_0x4f2d42){return function(){WhatsappAccountEvents[_0xca30('0x5')](_0x2c6e40,_0x4f2d42);};}exports[_0xca30('0x6')]=function(_0xdaba9c){for(var _0x44619e=0x0,_0x33b389=events['length'];_0x44619e<_0x33b389;_0x44619e++){var _0x16a053=events[_0x44619e];var _0x45605f=createListener(_0xca30('0x7')+_0x16a053,_0xdaba9c);WhatsappAccountEvents['on'](_0x16a053,_0x45605f);}}; \ No newline at end of file +var _0x0bb6=['removeListener','register','length','./whatsappAccount.events','emit'];(function(_0x16cb03,_0x43ea58){var _0x10944e=function(_0x27ebaa){while(--_0x27ebaa){_0x16cb03['push'](_0x16cb03['shift']());}};_0x10944e(++_0x43ea58);}(_0x0bb6,0x8f));var _0x60bb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0bb6[_0x19950b];return _0x3c6b41;};'use strict';var WhatsappAccountEvents=require(_0x60bb('0x0'));var events=['save','remove','update'];function createListener(_0x12d9be,_0x25d645){return function(_0x86a712){_0x25d645[_0x60bb('0x1')](_0x12d9be,_0x86a712);};}function removeListener(_0x3373eb,_0x312810){return function(){WhatsappAccountEvents[_0x60bb('0x2')](_0x3373eb,_0x312810);};}exports[_0x60bb('0x3')]=function(_0x1f266d){for(var _0x37c726=0x0,_0x4dba42=events[_0x60bb('0x4')];_0x37c726<_0x4dba42;_0x37c726++){var _0x2bb1a8=events[_0x37c726];var _0x16564d=createListener('whatsappAccount:'+_0x2bb1a8,_0x1f266d);WhatsappAccountEvents['on'](_0x2bb1a8,_0x16564d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 1803bbd..8d53149 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 _0x17cd=['../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x17cd,0x199));var _0xd17c=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x17cd[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0xd17c('0x0'));var util=require(_0xd17c('0x1'));var path=require(_0xd17c('0x2'));var timeout=require(_0xd17c('0x3'));var express=require(_0xd17c('0x4'));var router=express[_0xd17c('0x5')]();var fs_extra=require(_0xd17c('0x6'));var auth=require(_0xd17c('0x7'));var interaction=require(_0xd17c('0x8'));var config=require(_0xd17c('0x9'));var controller=require(_0xd17c('0xa'));router[_0xd17c('0xb')]('/',auth[_0xd17c('0xc')](),controller[_0xd17c('0xd')]);router[_0xd17c('0xb')](_0xd17c('0xe'),auth[_0xd17c('0xc')](),controller[_0xd17c('0xf')]);router[_0xd17c('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd17c('0x11')](_0xd17c('0xe'),auth[_0xd17c('0xc')](),controller[_0xd17c('0x12')]);router[_0xd17c('0x13')](_0xd17c('0xe'),auth[_0xd17c('0xc')](),controller[_0xd17c('0x14')]);module[_0xd17c('0x15')]=router; \ No newline at end of file +var _0xd438=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','fs-extra'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xd438,0x8c));var _0x8d43=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xd438[_0x166742];return _0xb7814a;};'use strict';var multer=require('multer');var util=require(_0x8d43('0x0'));var path=require(_0x8d43('0x1'));var timeout=require(_0x8d43('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8d43('0x3'));var auth=require(_0x8d43('0x4'));var interaction=require(_0x8d43('0x5'));var config=require(_0x8d43('0x6'));var controller=require(_0x8d43('0x7'));router[_0x8d43('0x8')]('/',auth[_0x8d43('0x9')](),controller[_0x8d43('0xa')]);router[_0x8d43('0x8')](_0x8d43('0xb'),auth[_0x8d43('0x9')](),controller[_0x8d43('0xc')]);router['post']('/',auth[_0x8d43('0x9')](),controller[_0x8d43('0xd')]);router[_0x8d43('0xe')]('/:id',auth[_0x8d43('0x9')](),controller['update']);router[_0x8d43('0xf')](_0x8d43('0xb'),auth['isAuthenticated'](),controller[_0x8d43('0x10')]);module[_0x8d43('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 ae5624e..37dd7f0 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 _0x3ff5=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3ff5,0x9c));var _0x53ff=function(_0x498b76,_0x440a7c){_0x498b76=_0x498b76-0x0;var _0x31077b=_0x3ff5[_0x498b76];return _0x31077b;};'use strict';var Sequelize=require(_0x53ff('0x0'));module[_0x53ff('0x1')]={'priority':{'type':Sequelize[_0x53ff('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x53ff('0x3')],'allowNull':![],'defaultValue':_0x53ff('0x4')},'appdata':{'type':Sequelize[_0x53ff('0x5')]()},'description':{'type':Sequelize[_0x53ff('0x3')]},'interval':{'type':Sequelize[_0x53ff('0x3')],'defaultValue':_0x53ff('0x6')}}; \ No newline at end of file +var _0x8a77=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x49d3d4,_0x485c2c){var _0x3c4bf6=function(_0xeb5559){while(--_0xeb5559){_0x49d3d4['push'](_0x49d3d4['shift']());}};_0x3c4bf6(++_0x485c2c);}(_0x8a77,0xa8));var _0x78a7=function(_0x1edcf7,_0x37e605){_0x1edcf7=_0x1edcf7-0x0;var _0x4b67a0=_0x8a77[_0x1edcf7];return _0x4b67a0;};'use strict';var Sequelize=require(_0x78a7('0x0'));module[_0x78a7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x78a7('0x2')],'allowNull':![],'defaultValue':_0x78a7('0x3')},'appdata':{'type':Sequelize[_0x78a7('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x78a7('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 93327a5..1389ac3 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 _0x9c1d=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','length','options','create','body','find','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x22ed50,_0x5dc62d){var _0x21a426=function(_0x54132d){while(--_0x54132d){_0x22ed50['push'](_0x22ed50['shift']());}};_0x21a426(++_0x5dc62d);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x39689d,_0x8c8506){_0x39689d=_0x39689d-0x0;var _0x263852=_0x9c1d[_0x39689d];return _0x263852;};'use strict';var emlformat=require(_0xd9c1('0x0'));var rimraf=require(_0xd9c1('0x1'));var zipdir=require(_0xd9c1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9c1('0x3'));var moment=require(_0xd9c1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd9c1('0x5'));var util=require(_0xd9c1('0x6'));var path=require('path');var sox=require(_0xd9c1('0x7'));var csv=require(_0xd9c1('0x8'));var ejs=require(_0xd9c1('0x9'));var fs=require('fs');var fs_extra=require(_0xd9c1('0xa'));var _=require(_0xd9c1('0xb'));var squel=require(_0xd9c1('0xc'));var crypto=require(_0xd9c1('0xd'));var jsforce=require(_0xd9c1('0xe'));var deskjs=require(_0xd9c1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd9c1('0x10'));var Papa=require(_0xd9c1('0x11'));var Redis=require(_0xd9c1('0x12'));var authService=require(_0xd9c1('0x13'));var qs=require(_0xd9c1('0x14'));var as=require(_0xd9c1('0x15'));var hardwareService=require(_0xd9c1('0x16'));var logger=require('../../config/logger')(_0xd9c1('0x17'));var utils=require(_0xd9c1('0x18'));var config=require(_0xd9c1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd9c1('0x1a'))['db'];function respondWithStatusCode(_0x50b02c,_0x13f92d){_0x13f92d=_0x13f92d||0xcc;return function(_0x21bb32){if(_0x21bb32){return _0x50b02c[_0xd9c1('0x1b')](_0x13f92d);}return _0x50b02c[_0xd9c1('0x1c')](_0x13f92d)[_0xd9c1('0x1d')]();};}function respondWithResult(_0x221a24,_0x1d34f9){_0x1d34f9=_0x1d34f9||0xc8;return function(_0x13b927){if(_0x13b927){return _0x221a24[_0xd9c1('0x1c')](_0x1d34f9)[_0xd9c1('0x1e')](_0x13b927);}};}function respondWithFilteredResult(_0x2813bb,_0x41e154){return function(_0x35125){if(_0x35125){var _0x174ccd=typeof _0x41e154[_0xd9c1('0x1f')]==='undefined'&&typeof _0x41e154['limit']===_0xd9c1('0x20');var _0xf6c9b2=_0x35125[_0xd9c1('0x21')];var _0x1a1542=_0x174ccd?0x0:_0x41e154[_0xd9c1('0x1f')];var _0x454559=_0x174ccd?_0x35125[_0xd9c1('0x21')]:_0x41e154[_0xd9c1('0x1f')]+_0x41e154[_0xd9c1('0x22')];var _0x55c310;if(_0x454559>=_0xf6c9b2){_0x454559=_0xf6c9b2;_0x55c310=0xc8;}else{_0x55c310=0xce;}_0x2813bb[_0xd9c1('0x1c')](_0x55c310);return _0x2813bb[_0xd9c1('0x23')](_0xd9c1('0x24'),_0x1a1542+'-'+_0x454559+'/'+_0xf6c9b2)[_0xd9c1('0x1e')](_0x35125);}return null;};}function patchUpdates(_0x4643ad){return function(_0x36728a){try{jsonpatch['apply'](_0x36728a,_0x4643ad,!![]);}catch(_0x28f523){return BPromise[_0xd9c1('0x25')](_0x28f523);}return _0x36728a[_0xd9c1('0x26')]();};}function saveUpdates(_0x5caaa1,_0x5b62ac){return function(_0x410be7){if(_0x410be7){return _0x410be7[_0xd9c1('0x27')](_0x5caaa1)[_0xd9c1('0x28')](function(_0x403d78){return _0x403d78;});}return null;};}function removeEntity(_0x18d5f3,_0x5f6a76){return function(_0x27818f){if(_0x27818f){return _0x27818f['destroy']()[_0xd9c1('0x28')](function(){_0x18d5f3[_0xd9c1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dc2ee,_0x2245ca){return function(_0x45b15d){if(!_0x45b15d){_0x5dc2ee[_0xd9c1('0x1b')](0x194);}return _0x45b15d;};}function handleError(_0x5e0e86,_0x36a367){_0x36a367=_0x36a367||0x1f4;return function(_0x282e01){logger['error'](_0x282e01['stack']);if(_0x282e01[_0xd9c1('0x29')]){delete _0x282e01[_0xd9c1('0x29')];}_0x5e0e86[_0xd9c1('0x1c')](_0x36a367)[_0xd9c1('0x2a')](_0x282e01);};}exports[_0xd9c1('0x2b')]=function(_0x7373cb,_0x146f21){var _0x5ba2fe={},_0x250527={},_0x223b88={'count':0x0,'rows':[]};var _0x3d12e7=_[_0xd9c1('0x2c')](db[_0xd9c1('0x2d')][_0xd9c1('0x2e')],function(_0x11c8b3){return{'name':_0x11c8b3[_0xd9c1('0x2f')],'type':_0x11c8b3['type']['key']};});_0x250527['model']=_[_0xd9c1('0x2c')](_0x3d12e7,'name');_0x250527[_0xd9c1('0x30')]=_[_0xd9c1('0x31')](_0x7373cb['query']);_0x250527[_0xd9c1('0x32')]=_[_0xd9c1('0x33')](_0x250527[_0xd9c1('0x34')],_0x250527[_0xd9c1('0x30')]);_0x5ba2fe[_0xd9c1('0x35')]=_[_0xd9c1('0x33')](_0x250527[_0xd9c1('0x34')],qs[_0xd9c1('0x36')](_0x7373cb[_0xd9c1('0x30')][_0xd9c1('0x36')]));_0x5ba2fe[_0xd9c1('0x35')]=_0x5ba2fe[_0xd9c1('0x35')]['length']?_0x5ba2fe['attributes']:_0x250527[_0xd9c1('0x34')];if(!_0x7373cb[_0xd9c1('0x30')][_0xd9c1('0x37')]('nolimit')){_0x5ba2fe[_0xd9c1('0x22')]=qs[_0xd9c1('0x22')](_0x7373cb['query'][_0xd9c1('0x22')]);_0x5ba2fe[_0xd9c1('0x1f')]=qs['offset'](_0x7373cb['query'][_0xd9c1('0x1f')]);}_0x5ba2fe[_0xd9c1('0x38')]=qs[_0xd9c1('0x39')](_0x7373cb[_0xd9c1('0x30')][_0xd9c1('0x39')]);_0x5ba2fe[_0xd9c1('0x3a')]=qs['filters'](_[_0xd9c1('0x3b')](_0x7373cb[_0xd9c1('0x30')],_0x250527[_0xd9c1('0x32')]),_0x3d12e7);if(_0x7373cb['query'][_0xd9c1('0x3c')]){_0x5ba2fe[_0xd9c1('0x3a')]=_[_0xd9c1('0x3d')](_0x5ba2fe[_0xd9c1('0x3a')],{'$or':_[_0xd9c1('0x2c')](_0x3d12e7,function(_0xeaaeb7){if(_0xeaaeb7[_0xd9c1('0x3e')]!==_0xd9c1('0x3f')){var _0x209f36={};_0x209f36[_0xeaaeb7[_0xd9c1('0x29')]]={'$like':'%'+_0x7373cb['query'][_0xd9c1('0x3c')]+'%'};return _0x209f36;}})});}_0x5ba2fe=_[_0xd9c1('0x3d')]({},_0x5ba2fe,_0x7373cb['options']);var _0x4e8ce6={'where':_0x5ba2fe['where']};return db[_0xd9c1('0x2d')][_0xd9c1('0x21')](_0x4e8ce6)[_0xd9c1('0x28')](function(_0x20ce58){_0x223b88['count']=_0x20ce58;if(_0x7373cb[_0xd9c1('0x30')][_0xd9c1('0x40')]){_0x5ba2fe[_0xd9c1('0x41')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x5ba2fe);})[_0xd9c1('0x28')](function(_0xbf9915){_0x223b88[_0xd9c1('0x42')]=_0xbf9915;return _0x223b88;})[_0xd9c1('0x28')](respondWithFilteredResult(_0x146f21,_0x5ba2fe))[_0xd9c1('0x43')](handleError(_0x146f21,null));};exports[_0xd9c1('0x44')]=function(_0x179fb2,_0x12992d){var _0x1f5f81={'raw':!![],'where':{'id':_0x179fb2[_0xd9c1('0x45')]['id']}},_0x4f55a3={};_0x4f55a3[_0xd9c1('0x34')]=_[_0xd9c1('0x31')](db['WhatsappApplication']['rawAttributes']);_0x4f55a3[_0xd9c1('0x30')]=_['keys'](_0x179fb2[_0xd9c1('0x30')]);_0x4f55a3['filters']=_['intersection'](_0x4f55a3[_0xd9c1('0x34')],_0x4f55a3[_0xd9c1('0x30')]);_0x1f5f81[_0xd9c1('0x35')]=_[_0xd9c1('0x33')](_0x4f55a3[_0xd9c1('0x34')],qs[_0xd9c1('0x36')](_0x179fb2[_0xd9c1('0x30')][_0xd9c1('0x36')]));_0x1f5f81[_0xd9c1('0x35')]=_0x1f5f81[_0xd9c1('0x35')][_0xd9c1('0x46')]?_0x1f5f81[_0xd9c1('0x35')]:_0x4f55a3[_0xd9c1('0x34')];if(_0x179fb2[_0xd9c1('0x30')][_0xd9c1('0x40')]){_0x1f5f81[_0xd9c1('0x41')]=[{'all':!![]}];}_0x1f5f81=_['merge']({},_0x1f5f81,_0x179fb2[_0xd9c1('0x47')]);return db['WhatsappApplication']['find'](_0x1f5f81)[_0xd9c1('0x28')](handleEntityNotFound(_0x12992d,null))[_0xd9c1('0x28')](respondWithResult(_0x12992d,null))[_0xd9c1('0x43')](handleError(_0x12992d,null));};exports[_0xd9c1('0x48')]=function(_0xa64469,_0x46cb82){return db[_0xd9c1('0x2d')][_0xd9c1('0x48')](_0xa64469[_0xd9c1('0x49')],{})[_0xd9c1('0x28')](respondWithResult(_0x46cb82,0xc9))['catch'](handleError(_0x46cb82,null));};exports[_0xd9c1('0x27')]=function(_0x5834e5,_0x4ae001){if(_0x5834e5[_0xd9c1('0x49')]['id']){delete _0x5834e5[_0xd9c1('0x49')]['id'];}return db[_0xd9c1('0x2d')][_0xd9c1('0x4a')]({'where':{'id':_0x5834e5[_0xd9c1('0x45')]['id']}})['then'](handleEntityNotFound(_0x4ae001,null))[_0xd9c1('0x28')](saveUpdates(_0x5834e5[_0xd9c1('0x49')],null))['then'](respondWithResult(_0x4ae001,null))[_0xd9c1('0x43')](handleError(_0x4ae001,null));};exports[_0xd9c1('0x4b')]=function(_0x11fd5e,_0x7d7c5f){return db[_0xd9c1('0x2d')]['find']({'where':{'id':_0x11fd5e[_0xd9c1('0x45')]['id']}})[_0xd9c1('0x28')](handleEntityNotFound(_0x7d7c5f,null))[_0xd9c1('0x28')](removeEntity(_0x7d7c5f,null))[_0xd9c1('0x43')](handleError(_0x7d7c5f,null));}; \ No newline at end of file +var _0xd052=['index','map','rawAttributes','fieldName','type','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','WhatsappApplication','includeAll','include','findAll','rows','show','params','keys','intersection','catch','create','body','find','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x1e587d,_0x7cb46e){var _0x2eb2c4=function(_0xef45c5){while(--_0xef45c5){_0x1e587d['push'](_0x1e587d['shift']());}};_0x2eb2c4(++_0x7cb46e);}(_0xd052,0x69));var _0x2d05=function(_0x6465b0,_0x45653a){_0x6465b0=_0x6465b0-0x0;var _0x4884fe=_0xd052[_0x6465b0];return _0x4884fe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2d05('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d05('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2d05('0x2'));var util=require('util');var path=require(_0x2d05('0x3'));var sox=require(_0x2d05('0x4'));var csv=require('to-csv');var ejs=require(_0x2d05('0x5'));var fs=require('fs');var fs_extra=require(_0x2d05('0x6'));var _=require(_0x2d05('0x7'));var squel=require(_0x2d05('0x8'));var crypto=require(_0x2d05('0x9'));var jsforce=require(_0x2d05('0xa'));var deskjs=require(_0x2d05('0xb'));var toCsv=require(_0x2d05('0xc'));var querystring=require(_0x2d05('0xd'));var Papa=require(_0x2d05('0xe'));var Redis=require(_0x2d05('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d05('0x10'));var logger=require(_0x2d05('0x11'))(_0x2d05('0x12'));var utils=require(_0x2d05('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2d05('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f4225,_0x16548b){_0x16548b=_0x16548b||0xcc;return function(_0x1c28b8){if(_0x1c28b8){return _0x1f4225['sendStatus'](_0x16548b);}return _0x1f4225[_0x2d05('0x15')](_0x16548b)[_0x2d05('0x16')]();};}function respondWithResult(_0x1e096a,_0x5630a6){_0x5630a6=_0x5630a6||0xc8;return function(_0x4b6568){if(_0x4b6568){return _0x1e096a['status'](_0x5630a6)[_0x2d05('0x17')](_0x4b6568);}};}function respondWithFilteredResult(_0x2f1e2a,_0x4cf64f){return function(_0x2a68bd){if(_0x2a68bd){var _0x5bf467=typeof _0x4cf64f['offset']===_0x2d05('0x18')&&typeof _0x4cf64f[_0x2d05('0x19')]==='undefined';var _0x15b13c=_0x2a68bd[_0x2d05('0x1a')];var _0xf73a87=_0x5bf467?0x0:_0x4cf64f[_0x2d05('0x1b')];var _0x33bdf7=_0x5bf467?_0x2a68bd['count']:_0x4cf64f[_0x2d05('0x1b')]+_0x4cf64f[_0x2d05('0x19')];var _0x2c456c;if(_0x33bdf7>=_0x15b13c){_0x33bdf7=_0x15b13c;_0x2c456c=0xc8;}else{_0x2c456c=0xce;}_0x2f1e2a['status'](_0x2c456c);return _0x2f1e2a[_0x2d05('0x1c')](_0x2d05('0x1d'),_0xf73a87+'-'+_0x33bdf7+'/'+_0x15b13c)[_0x2d05('0x17')](_0x2a68bd);}return null;};}function patchUpdates(_0x1a4b74){return function(_0x1cd959){try{jsonpatch[_0x2d05('0x1e')](_0x1cd959,_0x1a4b74,!![]);}catch(_0x3bc562){return BPromise[_0x2d05('0x1f')](_0x3bc562);}return _0x1cd959[_0x2d05('0x20')]();};}function saveUpdates(_0x138912,_0x4a9e7c){return function(_0x244358){if(_0x244358){return _0x244358[_0x2d05('0x21')](_0x138912)[_0x2d05('0x22')](function(_0x33bc59){return _0x33bc59;});}return null;};}function removeEntity(_0x43b55f,_0x3ff181){return function(_0x458528){if(_0x458528){return _0x458528[_0x2d05('0x23')]()[_0x2d05('0x22')](function(){_0x43b55f['status'](0xcc)[_0x2d05('0x16')]();});}};}function handleEntityNotFound(_0x13ef22,_0x37966b){return function(_0x4b61a7){if(!_0x4b61a7){_0x13ef22['sendStatus'](0x194);}return _0x4b61a7;};}function handleError(_0x48d545,_0x7ca052){_0x7ca052=_0x7ca052||0x1f4;return function(_0x3240c7){logger[_0x2d05('0x24')](_0x3240c7[_0x2d05('0x25')]);if(_0x3240c7[_0x2d05('0x26')]){delete _0x3240c7['name'];}_0x48d545[_0x2d05('0x15')](_0x7ca052)['send'](_0x3240c7);};}exports[_0x2d05('0x27')]=function(_0x12e82b,_0x2a30be){var _0xc9bd97={},_0x12869d={},_0x350a53={'count':0x0,'rows':[]};var _0x173e72=_[_0x2d05('0x28')](db['WhatsappApplication'][_0x2d05('0x29')],function(_0x434104){return{'name':_0x434104[_0x2d05('0x2a')],'type':_0x434104[_0x2d05('0x2b')]['key']};});_0x12869d['model']=_['map'](_0x173e72,'name');_0x12869d[_0x2d05('0x2c')]=_['keys'](_0x12e82b[_0x2d05('0x2c')]);_0x12869d[_0x2d05('0x2d')]=_['intersection'](_0x12869d['model'],_0x12869d[_0x2d05('0x2c')]);_0xc9bd97[_0x2d05('0x2e')]=_['intersection'](_0x12869d[_0x2d05('0x2f')],qs[_0x2d05('0x30')](_0x12e82b[_0x2d05('0x2c')][_0x2d05('0x30')]));_0xc9bd97[_0x2d05('0x2e')]=_0xc9bd97[_0x2d05('0x2e')][_0x2d05('0x31')]?_0xc9bd97[_0x2d05('0x2e')]:_0x12869d[_0x2d05('0x2f')];if(!_0x12e82b[_0x2d05('0x2c')][_0x2d05('0x32')](_0x2d05('0x33'))){_0xc9bd97[_0x2d05('0x19')]=qs[_0x2d05('0x19')](_0x12e82b[_0x2d05('0x2c')]['limit']);_0xc9bd97['offset']=qs[_0x2d05('0x1b')](_0x12e82b[_0x2d05('0x2c')][_0x2d05('0x1b')]);}_0xc9bd97['order']=qs['sort'](_0x12e82b[_0x2d05('0x2c')][_0x2d05('0x34')]);_0xc9bd97[_0x2d05('0x35')]=qs['filters'](_[_0x2d05('0x36')](_0x12e82b[_0x2d05('0x2c')],_0x12869d[_0x2d05('0x2d')]),_0x173e72);if(_0x12e82b['query']['filter']){_0xc9bd97['where']=_['merge'](_0xc9bd97[_0x2d05('0x35')],{'$or':_[_0x2d05('0x28')](_0x173e72,function(_0x258a43){if(_0x258a43['type']!==_0x2d05('0x37')){var _0x56ee18={};_0x56ee18[_0x258a43[_0x2d05('0x26')]]={'$like':'%'+_0x12e82b[_0x2d05('0x2c')][_0x2d05('0x38')]+'%'};return _0x56ee18;}})});}_0xc9bd97=_[_0x2d05('0x39')]({},_0xc9bd97,_0x12e82b[_0x2d05('0x3a')]);var _0x442cd4={'where':_0xc9bd97[_0x2d05('0x35')]};return db[_0x2d05('0x3b')][_0x2d05('0x1a')](_0x442cd4)[_0x2d05('0x22')](function(_0x81f72e){_0x350a53[_0x2d05('0x1a')]=_0x81f72e;if(_0x12e82b['query'][_0x2d05('0x3c')]){_0xc9bd97[_0x2d05('0x3d')]=[{'all':!![]}];}return db[_0x2d05('0x3b')][_0x2d05('0x3e')](_0xc9bd97);})[_0x2d05('0x22')](function(_0x27798d){_0x350a53[_0x2d05('0x3f')]=_0x27798d;return _0x350a53;})['then'](respondWithFilteredResult(_0x2a30be,_0xc9bd97))['catch'](handleError(_0x2a30be,null));};exports[_0x2d05('0x40')]=function(_0x27cd4c,_0x311adf){var _0x1a1104={'raw':!![],'where':{'id':_0x27cd4c[_0x2d05('0x41')]['id']}},_0xbafabe={};_0xbafabe[_0x2d05('0x2f')]=_[_0x2d05('0x42')](db[_0x2d05('0x3b')][_0x2d05('0x29')]);_0xbafabe[_0x2d05('0x2c')]=_[_0x2d05('0x42')](_0x27cd4c[_0x2d05('0x2c')]);_0xbafabe[_0x2d05('0x2d')]=_['intersection'](_0xbafabe[_0x2d05('0x2f')],_0xbafabe[_0x2d05('0x2c')]);_0x1a1104[_0x2d05('0x2e')]=_[_0x2d05('0x43')](_0xbafabe[_0x2d05('0x2f')],qs['fields'](_0x27cd4c[_0x2d05('0x2c')][_0x2d05('0x30')]));_0x1a1104[_0x2d05('0x2e')]=_0x1a1104[_0x2d05('0x2e')][_0x2d05('0x31')]?_0x1a1104['attributes']:_0xbafabe[_0x2d05('0x2f')];if(_0x27cd4c['query'][_0x2d05('0x3c')]){_0x1a1104[_0x2d05('0x3d')]=[{'all':!![]}];}_0x1a1104=_['merge']({},_0x1a1104,_0x27cd4c[_0x2d05('0x3a')]);return db[_0x2d05('0x3b')]['find'](_0x1a1104)[_0x2d05('0x22')](handleEntityNotFound(_0x311adf,null))[_0x2d05('0x22')](respondWithResult(_0x311adf,null))[_0x2d05('0x44')](handleError(_0x311adf,null));};exports['create']=function(_0x31f59,_0x2b728d){return db[_0x2d05('0x3b')][_0x2d05('0x45')](_0x31f59[_0x2d05('0x46')],{})[_0x2d05('0x22')](respondWithResult(_0x2b728d,0xc9))['catch'](handleError(_0x2b728d,null));};exports['update']=function(_0x448916,_0x547602){if(_0x448916['body']['id']){delete _0x448916['body']['id'];}return db[_0x2d05('0x3b')][_0x2d05('0x47')]({'where':{'id':_0x448916[_0x2d05('0x41')]['id']}})[_0x2d05('0x22')](handleEntityNotFound(_0x547602,null))['then'](saveUpdates(_0x448916[_0x2d05('0x46')],null))[_0x2d05('0x22')](respondWithResult(_0x547602,null))[_0x2d05('0x44')](handleError(_0x547602,null));};exports[_0x2d05('0x23')]=function(_0x187347,_0x16be02){return db['WhatsappApplication'][_0x2d05('0x47')]({'where':{'id':_0x187347['params']['id']}})['then'](handleEntityNotFound(_0x16be02,null))['then'](removeEntity(_0x16be02,null))['catch'](handleError(_0x16be02,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index c4a94c2..23565bf 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 _0xe2cc=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x517b1d,_0xa06b11){var _0x56776f=function(_0x23b134){while(--_0x23b134){_0x517b1d['push'](_0x517b1d['shift']());}};_0x56776f(++_0xa06b11);}(_0xe2cc,0x69));var _0xce2c=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xe2cc[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xce2c('0x0'));var util=require(_0xce2c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xce2c('0x2'));var BPromise=require(_0xce2c('0x3'));var rp=require(_0xce2c('0x4'));var fs=require('fs');var path=require(_0xce2c('0x5'));var rimraf=require(_0xce2c('0x6'));var config=require(_0xce2c('0x7'));var attributes=require(_0xce2c('0x8'));module[_0xce2c('0x9')]=function(_0x592e10,_0x51e5d0){return _0x592e10[_0xce2c('0xa')](_0xce2c('0xb'),attributes,{'tableName':_0xce2c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xce2c('0xd'),'collate':_0xce2c('0xe')});}; \ No newline at end of file +var _0xff96=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xd292f5,_0x254058){var _0x5c2bdc=function(_0x50e787){while(--_0x50e787){_0xd292f5['push'](_0xd292f5['shift']());}};_0x5c2bdc(++_0x254058);}(_0xff96,0x179));var _0x6ff9=function(_0x2b192e,_0x28ec8a){_0x2b192e=_0x2b192e-0x0;var _0x3478b5=_0xff96[_0x2b192e];return _0x3478b5;};'use strict';var _=require(_0x6ff9('0x0'));var util=require(_0x6ff9('0x1'));var logger=require(_0x6ff9('0x2'))(_0x6ff9('0x3'));var moment=require(_0x6ff9('0x4'));var BPromise=require(_0x6ff9('0x5'));var rp=require(_0x6ff9('0x6'));var fs=require('fs');var path=require(_0x6ff9('0x7'));var rimraf=require(_0x6ff9('0x8'));var config=require(_0x6ff9('0x9'));var attributes=require(_0x6ff9('0xa'));module[_0x6ff9('0xb')]=function(_0x4adb77,_0x3efaff){return _0x4adb77['define']('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6ff9('0xc'),'collate':_0x6ff9('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 1aa8c1a..f4f29c8 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 _0x0e85=['bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x33bf22,_0x23d416){var _0xa92c17=function(_0x44c7b9){while(--_0x44c7b9){_0x33bf22['push'](_0x33bf22['shift']());}};_0xa92c17(++_0x23d416);}(_0x0e85,0x7c));var _0x50e8=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x0e85[_0xac151d];return _0x111dba;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e8b01,_0x3ce904,_0x108edc){return new BPromise(function(_0x42665e,_0x988da0){return client[_0x50e8('0x9')](_0x5e8b01,_0x108edc)[_0x50e8('0xa')](function(_0x5825f5){logger[_0x50e8('0xb')](_0x50e8('0xc'),_0x3ce904,_0x50e8('0xd'));logger[_0x50e8('0xe')](_0x50e8('0xf'),_0x3ce904,_0x50e8('0xd'),JSON[_0x50e8('0x10')](_0x5825f5));if(_0x5825f5[_0x50e8('0x11')]){if(_0x5825f5['error']['code']===0x1f4){logger[_0x50e8('0x11')](_0x50e8('0xc'),_0x3ce904,_0x5825f5['error']['message']);return _0x988da0(_0x5825f5[_0x50e8('0x11')][_0x50e8('0x12')]);}logger[_0x50e8('0x11')](_0x50e8('0xc'),_0x3ce904,_0x5825f5['error'][_0x50e8('0x12')]);return _0x42665e(_0x5825f5[_0x50e8('0x11')][_0x50e8('0x12')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x3ce904,_0x50e8('0xd'));_0x42665e(_0x5825f5[_0x50e8('0x13')][_0x50e8('0x12')]);}})[_0x50e8('0x14')](function(_0x211731){logger[_0x50e8('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x3ce904,_0x211731);_0x988da0(_0x211731);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','WhatsappApplication,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x1ed4e6,_0x590804){var _0x1205ed=function(_0x43243a){while(--_0x43243a){_0x1ed4e6['push'](_0x1ed4e6['shift']());}};_0x1205ed(++_0x590804);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 47e7444..3465c5c 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 _0x6455=['Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','update','delete','whatsappinteraction:destroy','destroy','exports','multer','path','connect-timeout','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6455,0x97));var _0x5645=function(_0x4d3609,_0x4b60e9){_0x4d3609=_0x4d3609-0x0;var _0xdb5662=_0x6455[_0x4d3609];return _0xdb5662;};'use strict';var multer=require(_0x5645('0x0'));var util=require('util');var path=require(_0x5645('0x1'));var timeout=require(_0x5645('0x2'));var express=require(_0x5645('0x3'));var router=express[_0x5645('0x4')]();var fs_extra=require(_0x5645('0x5'));var auth=require(_0x5645('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5645('0x7'));var controller=require(_0x5645('0x8'));router[_0x5645('0x9')]('/',auth[_0x5645('0xa')](),controller[_0x5645('0xb')]);router[_0x5645('0x9')](_0x5645('0xc'),auth[_0x5645('0xa')](),controller['describe']);router['get'](_0x5645('0xd'),auth[_0x5645('0xa')](),controller[_0x5645('0xe')]);router[_0x5645('0x9')](_0x5645('0xf'),auth[_0x5645('0xa')](),controller['getMessages']);router[_0x5645('0x9')](_0x5645('0x10'),auth[_0x5645('0xa')](),controller[_0x5645('0x11')]);router['post']('/',auth[_0x5645('0xa')](),controller['create']);router[_0x5645('0x12')](_0x5645('0xf'),auth[_0x5645('0xa')](),controller[_0x5645('0x13')]);router[_0x5645('0x12')](_0x5645('0x14'),auth[_0x5645('0xa')](),interaction[_0x5645('0x15')]('whatsapp',_0x5645('0x16')),controller[_0x5645('0x17')]);router[_0x5645('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0x5645('0x15')](_0x5645('0x19'),'whatsappinteraction:update'),controller[_0x5645('0x1a')]);router[_0x5645('0x1b')](_0x5645('0xd'),auth['isAuthenticated'](),interaction[_0x5645('0x15')](_0x5645('0x19'),_0x5645('0x1c')),controller[_0x5645('0x1d')]);router['delete'](_0x5645('0x14'),auth['isAuthenticated'](),controller['removeTags']);module[_0x5645('0x1e')]=router; \ No newline at end of file +var _0x81c6=['removeTags','util','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','/describe','/:id','/:id/messages','getMessages','/:id/download','create','post','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','/:id/tags'];(function(_0x2e7e72,_0x5d59b6){var _0x542f6f=function(_0x4e2e22){while(--_0x4e2e22){_0x2e7e72['push'](_0x2e7e72['shift']());}};_0x542f6f(++_0x5d59b6);}(_0x81c6,0x1d5));var _0x681c=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0x81c6[_0x36d25e];return _0x4b95b8;};'use strict';var multer=require('multer');var util=require(_0x681c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x681c('0x1')]();var fs_extra=require(_0x681c('0x2'));var auth=require(_0x681c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x681c('0x4'));var controller=require(_0x681c('0x5'));router[_0x681c('0x6')]('/',auth[_0x681c('0x7')](),controller['index']);router[_0x681c('0x6')](_0x681c('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x681c('0x6')](_0x681c('0x9'),auth[_0x681c('0x7')](),controller['show']);router['get'](_0x681c('0xa'),auth['isAuthenticated'](),controller[_0x681c('0xb')]);router[_0x681c('0x6')](_0x681c('0xc'),auth[_0x681c('0x7')](),controller['download']);router['post']('/',auth[_0x681c('0x7')](),controller[_0x681c('0xd')]);router[_0x681c('0xe')]('/:id/messages',auth[_0x681c('0x7')](),controller['addMessage']);router[_0x681c('0xe')]('/:id/tags',auth[_0x681c('0x7')](),interaction[_0x681c('0xf')](_0x681c('0x10'),_0x681c('0x11')),controller[_0x681c('0x12')]);router[_0x681c('0x13')]('/:id',auth[_0x681c('0x7')](),interaction[_0x681c('0xf')](_0x681c('0x10'),_0x681c('0x14')),controller[_0x681c('0x15')]);router[_0x681c('0x16')]('/:id',auth[_0x681c('0x7')](),interaction[_0x681c('0xf')](_0x681c('0x10'),_0x681c('0x17')),controller['destroy']);router[_0x681c('0x16')](_0x681c('0x18'),auth['isAuthenticated'](),controller[_0x681c('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index c2fc7d4..7ef1139 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 _0x872a=['sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x872a,0x100));var _0xa872=function(_0x32b9bf,_0x1567b1){_0x32b9bf=_0x32b9bf-0x0;var _0x333aa6=_0x872a[_0x32b9bf];return _0x333aa6;};'use strict';var Sequelize=require(_0xa872('0x0'));var moment=require(_0xa872('0x1'));module[_0xa872('0x2')]={'closed':{'type':Sequelize[_0xa872('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xa872('0x4')]},'note':{'type':Sequelize[_0xa872('0x4')]},'phone':{'type':Sequelize[_0xa872('0x4')]},'read1stAt':{'type':Sequelize[_0xa872('0x5')]},'firstMsgDirection':{'type':Sequelize[_0xa872('0x6')]('in',_0xa872('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa872('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa872('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa872('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x22e3=['ENUM','out','BOOLEAN','sequelize','moment','exports','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22e3,0xf3));var _0x322e=function(_0x203cc3,_0x133f88){_0x203cc3=_0x203cc3-0x0;var _0x47737e=_0x22e3[_0x203cc3];return _0x47737e;};'use strict';var Sequelize=require(_0x322e('0x0'));var moment=require(_0x322e('0x1'));module[_0x322e('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x322e('0x3')]},'disposition':{'type':Sequelize[_0x322e('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x322e('0x4')]},'note':{'type':Sequelize[_0x322e('0x4')]},'phone':{'type':Sequelize[_0x322e('0x4')]},'read1stAt':{'type':Sequelize[_0x322e('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x322e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x322e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x322e('0x5')]('in',_0x322e('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x322e('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index f6f6702..fb8656a 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 _0xd142=['describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','sort','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','color','whatsappInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','CmContact','Contact','lastName','attachments','Attachment','Messages','direction','secret','WhatsappAccount','Owner','get','Whatsapp','N.A.','closedAt','createReadStream','createWriteStream','basename','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./whatsappInteraction.socket','sendStatus','status','json','offset','undefined','limit','set','apply','save','then','destroy','end','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','WhatsappInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','select','field','from','tools_tags','u.fullname','left_join','u.id\x20=\x20ui.UserId','users','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','expr','search','conditions','find','value','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','Tag','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','compact','isEmpty','i.WhatsappAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','null','read','`unreadMessages`\x20=\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','count','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','rows','show','params','includeAll','options','create'];(function(_0x4d482b,_0x5d7fb5){var _0x44ae86=function(_0x19eb1c){while(--_0x19eb1c){_0x4d482b['push'](_0x4d482b['shift']());}};_0x44ae86(++_0x5d7fb5);}(_0xd142,0x11a));var _0x2d14=function(_0xedc5db,_0x210b81){_0xedc5db=_0xedc5db-0x0;var _0x319879=_0xd142[_0xedc5db];return _0x319879;};'use strict';var emlformat=require(_0x2d14('0x0'));var rimraf=require(_0x2d14('0x1'));var zipdir=require(_0x2d14('0x2'));var jsonpatch=require(_0x2d14('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2d14('0x4'));var Mustache=require(_0x2d14('0x5'));var util=require(_0x2d14('0x6'));var path=require(_0x2d14('0x7'));var sox=require(_0x2d14('0x8'));var csv=require(_0x2d14('0x9'));var ejs=require(_0x2d14('0xa'));var fs=require('fs');var fs_extra=require(_0x2d14('0xb'));var _=require(_0x2d14('0xc'));var squel=require(_0x2d14('0xd'));var crypto=require(_0x2d14('0xe'));var jsforce=require(_0x2d14('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2d14('0x9'));var querystring=require(_0x2d14('0x10'));var Papa=require('papaparse');var Redis=require(_0x2d14('0x11'));var authService=require(_0x2d14('0x12'));var qs=require(_0x2d14('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x2d14('0x14'));var hardwareService=require(_0x2d14('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x2d14('0x16'));var config=require(_0x2d14('0x17'));var licenseUtil=require(_0x2d14('0x18'));var db=require('../../mysqldb')['db'];config[_0x2d14('0x19')]=_[_0x2d14('0x1a')](config[_0x2d14('0x19')],{'host':_0x2d14('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2d14('0x19')]));require(_0x2d14('0x1c'))['register'](socket);function respondWithStatusCode(_0x2512df,_0x2c2b4a){_0x2c2b4a=_0x2c2b4a||0xcc;return function(_0x2e3302){if(_0x2e3302){return _0x2512df[_0x2d14('0x1d')](_0x2c2b4a);}return _0x2512df[_0x2d14('0x1e')](_0x2c2b4a)['end']();};}function respondWithResult(_0x3a0e8e,_0x19fc2f){_0x19fc2f=_0x19fc2f||0xc8;return function(_0x3e12d3){if(_0x3e12d3){return _0x3a0e8e[_0x2d14('0x1e')](_0x19fc2f)[_0x2d14('0x1f')](_0x3e12d3);}};}function respondWithFilteredResult(_0x5ac4a5,_0x427c26){return function(_0x45f5c9){if(_0x45f5c9){var _0x449b73=typeof _0x427c26[_0x2d14('0x20')]==='undefined'&&typeof _0x427c26['limit']===_0x2d14('0x21');var _0x5a53fe=_0x45f5c9['count'];var _0x8dde24=_0x449b73?0x0:_0x427c26[_0x2d14('0x20')];var _0x17d686=_0x449b73?_0x45f5c9['count']:_0x427c26[_0x2d14('0x20')]+_0x427c26[_0x2d14('0x22')];var _0x59a8e5;if(_0x17d686>=_0x5a53fe){_0x17d686=_0x5a53fe;_0x59a8e5=0xc8;}else{_0x59a8e5=0xce;}_0x5ac4a5[_0x2d14('0x1e')](_0x59a8e5);return _0x5ac4a5[_0x2d14('0x23')]('Content-Range',_0x8dde24+'-'+_0x17d686+'/'+_0x5a53fe)[_0x2d14('0x1f')](_0x45f5c9);}return null;};}function patchUpdates(_0x1162d7){return function(_0x42e09b){try{jsonpatch[_0x2d14('0x24')](_0x42e09b,_0x1162d7,!![]);}catch(_0x2c2858){return BPromise['reject'](_0x2c2858);}return _0x42e09b[_0x2d14('0x25')]();};}function saveUpdates(_0x5d6ab5,_0x27548e){return function(_0x5235a7){if(_0x5235a7){return _0x5235a7['update'](_0x5d6ab5)[_0x2d14('0x26')](function(_0x1b32e2){return _0x1b32e2;});}return null;};}function removeEntity(_0x2724f3,_0x4571d5){return function(_0x51b609){if(_0x51b609){return _0x51b609[_0x2d14('0x27')]()[_0x2d14('0x26')](function(){_0x2724f3['status'](0xcc)[_0x2d14('0x28')]();});}};}function handleEntityNotFound(_0x35ace8,_0x572720){return function(_0x104e0e){if(!_0x104e0e){_0x35ace8[_0x2d14('0x1d')](0x194);}return _0x104e0e;};}function handleError(_0x5988f1,_0x2813b1){_0x2813b1=_0x2813b1||0x1f4;return function(_0x468972){logger[_0x2d14('0x29')](_0x468972[_0x2d14('0x2a')]);if(_0x468972[_0x2d14('0x2b')]){delete _0x468972[_0x2d14('0x2b')];}_0x5988f1[_0x2d14('0x1e')](_0x2813b1)[_0x2d14('0x2c')](_0x468972);};}function getInteractionUsers(_0x4eee8a,_0xd4edb0){return new BPromise(function(_0x1415dd,_0x1a086a){try{if(_0xd4edb0[_0x4eee8a['id']]){_0x4eee8a[_0x2d14('0x2d')]=_['map'](_0xd4edb0[_0x4eee8a['id']],function(_0xaf095c){return{'id':_0xaf095c['id'],'fullname':_0xaf095c[_0x2d14('0x2e')]};});}}catch(_0x2c21f3){_0x1a086a(_0x2c21f3);}_0x1415dd(_0x4eee8a);});}function getInteractionTags(_0x4e8980,_0xcee84d){return new BPromise(function(_0x174656,_0x251b90){try{if(_0x4e8980[_0x2d14('0x2f')]){_0x4e8980[_0x2d14('0x30')]=[];_0x4e8980[_0x2d14('0x2f')][_0x2d14('0x31')](',')[_0x2d14('0x32')](function(_0x53f831){_0x4e8980[_0x2d14('0x30')][_0x2d14('0x33')](_0xcee84d[_0x53f831]);});}delete _0x4e8980[_0x2d14('0x2f')];}catch(_0x4388c9){_0x251b90(_0x4388c9);}_0x174656(_0x4e8980);});}function updateWhatsappInteraction(_0x85dd6e,_0x49b2fb,_0x347dcc){return new BPromise(function(_0x111a76,_0x392ac2){return getInteractionUsers(_0x85dd6e,_0x347dcc)[_0x2d14('0x26')](function(_0x21347c){return getInteractionTags(_0x21347c,_0x49b2fb);})['then'](function(_0x68b045){return getStateInteraction(_0x68b045);})[_0x2d14('0x26')](function(_0xa4d9e7){_0x111a76(_0xa4d9e7);})[_0x2d14('0x34')](function(_0x46b8be){_0x392ac2(_0x46b8be);});});}function getStateInteraction(_0xc7fe6b){return new BPromise(function(_0x593f7b){_0xc7fe6b[_0x2d14('0x35')]=0x0;_0xc7fe6b['talking']=0x0;_0xc7fe6b[_0x2d14('0x36')]=0x0;_0xc7fe6b[_0x2d14('0x37')]=0x0;_0xc7fe6b[_0x2d14('0x38')]=0x0;if(!_0xc7fe6b[_0x2d14('0x39')]&&!_0xc7fe6b[_0x2d14('0x3a')]){_0xc7fe6b[_0x2d14('0x35')]+=0x1;}if(!_0xc7fe6b[_0x2d14('0x39')]&&_0xc7fe6b['UserId']){_0xc7fe6b[_0x2d14('0x3b')]+=0x1;if(_0xc7fe6b[_0x2d14('0x35')]){_0xc7fe6b[_0x2d14('0x35')]-=0x1;}}if(_0xc7fe6b[_0x2d14('0x39')]&&_0xc7fe6b[_0x2d14('0x3a')]){_0xc7fe6b['answered']+=0x1;if(_0xc7fe6b[_0x2d14('0x3b')]){_0xc7fe6b[_0x2d14('0x3b')]-=0x1;}}if(_0xc7fe6b[_0x2d14('0x39')]&&!_0xc7fe6b[_0x2d14('0x3a')]){_0xc7fe6b[_0x2d14('0x37')]+=0x1;if(_0xc7fe6b[_0x2d14('0x35')]){_0xc7fe6b[_0x2d14('0x35')]-=0x1;}}_0xc7fe6b[_0x2d14('0x38')]+=0x1;_0x593f7b(_0xc7fe6b);});}exports[_0x2d14('0x3c')]=function(_0xc61860,_0x575fcc){var _0x15277d={},_0x277858={},_0x424dc3={'count':0x0,'rows':[]};var _0xeb9216=_['map'](db[_0x2d14('0x3d')][_0x2d14('0x3e')],function(_0x2abcd1){return{'name':_0x2abcd1[_0x2d14('0x3f')],'type':_0x2abcd1['type'][_0x2d14('0x40')]};});_0x277858[_0x2d14('0x41')]=_['map'](_0xeb9216,_0x2d14('0x2b'));_0x277858[_0x2d14('0x42')]=_[_0x2d14('0x43')](_0xc61860[_0x2d14('0x42')]);_0x277858[_0x2d14('0x44')]=_[_0x2d14('0x45')](_0x277858['model'],_0x277858['query']);_0x15277d[_0x2d14('0x46')]=_[_0x2d14('0x45')](_0x277858[_0x2d14('0x41')],qs[_0x2d14('0x47')](_0xc61860['query'][_0x2d14('0x47')]));_0x15277d[_0x2d14('0x46')]=_0x15277d[_0x2d14('0x46')][_0x2d14('0x48')]?_0x15277d[_0x2d14('0x46')]:_0x277858[_0x2d14('0x41')];if(!_0xc61860[_0x2d14('0x42')][_0x2d14('0x49')](_0x2d14('0x4a'))){_0x15277d[_0x2d14('0x22')]=qs['limit'](_0xc61860[_0x2d14('0x42')][_0x2d14('0x22')]);_0x15277d[_0x2d14('0x20')]=qs[_0x2d14('0x20')](_0xc61860['query']['offset']);}_0x15277d[_0x2d14('0x4b')]=qs['sort'](_0xc61860['query']['sort']);_0x15277d[_0x2d14('0x4c')]=qs['filters'](_[_0x2d14('0x4d')](_0xc61860[_0x2d14('0x42')],_0x277858[_0x2d14('0x44')]),_0xeb9216);var _0x2aa2bc=[];var _0x4e87a3=squel[_0x2d14('0x4e')]()['field']('id')[_0x2d14('0x4f')](_0x2d14('0x2b'))['field']('color')[_0x2d14('0x50')](_0x2d14('0x51'));var _0xa662c8=squel[_0x2d14('0x4e')]()['field']('u.id')[_0x2d14('0x4f')](_0x2d14('0x52'))[_0x2d14('0x4f')]('ui.WhatsappInteractionId')['from']('user_has_whatsapp_interactions','ui')[_0x2d14('0x53')]('users','u',_0x2d14('0x54'));var _0xdba428=squel[_0x2d14('0x4e')]()[_0x2d14('0x50')]('whatsapp_interactions','i')[_0x2d14('0x53')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x2d14('0x55'),'o',_0x2d14('0x56'))['left_join'](_0x2d14('0x57'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x2d14('0x53')](_0x2d14('0x58'),'me',_0x2d14('0x59'))[_0x2d14('0x53')](_0x2d14('0x5a'),'it','it.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x2d14('0x51'),'t','t.id\x20=\x20it.TagId');var _0x168bb6=squel['expr']();var _0x2e05fd=[];var _0x4b4cdb=squel[_0x2d14('0x5b')]();var _0x2a0c97;if(_0xc61860['query'][_0x2d14('0x5c')]){_0x2a0c97=as['parseSearch'](_0xc61860[_0x2d14('0x42')]['search']);var _0x23299d=_0x2a0c97['sqlOperator'];for(var _0x375856=0x0;_0x375856<_0x2a0c97[_0x2d14('0x5d')]['length'];_0x375856++){var _0x55f2d4=_0x2a0c97[_0x2d14('0x5d')][_0x375856];var _0x2cad72='i';var _0x472385=_[_0x2d14('0x5e')](_0xeb9216,[_0x2d14('0x2b'),_0x55f2d4[_0x2d14('0x4f')]]);if(!_0x472385){switch(_0x55f2d4['field']){case'unreadMessages':if(_0x55f2d4[_0x2d14('0x5f')]==0x1){_0xdba428[_0x2d14('0x60')]('`'+_0x55f2d4[_0x2d14('0x4f')]+'`\x20=\x200');}else{_0xdba428['having']('`'+_0x55f2d4[_0x2d14('0x4f')]+_0x2d14('0x61'));}break;case'Contact':if(_0x55f2d4[_0x2d14('0x62')]===_0x2d14('0x63')){if(_0x55f2d4['value'][_0x2d14('0x31')]('\x20')[_0x2d14('0x48')]>0x1){_0x168bb6[_0x23299d](_0x2d14('0x64'),qs[_0x2d14('0x65')](_0x55f2d4[_0x2d14('0x5f')]),null);}else{var _0x2bbcd5='%'+_0x55f2d4['value']+'%';_0x168bb6[_0x23299d](_0x2d14('0x66'),_0x2bbcd5,_0x2bbcd5,_0x2bbcd5);}}else{_0x472385=_[_0x2d14('0x5e')](_0xeb9216,[_0x2d14('0x2b'),_0x2d14('0x67')]);_0x55f2d4[_0x2d14('0x4f')]=_0x2d14('0x67');_0x15b9ae=as[_0x2d14('0x68')](_0x2cad72,_0x472385[_0x2d14('0x69')],_0x55f2d4);_0x168bb6[_0x23299d](_0x15b9ae['text'],_0x15b9ae['value'][_0x2d14('0x6a')],_0x15b9ae[_0x2d14('0x5f')][_0x2d14('0x28')]);}break;case _0x2d14('0x6b'):var _0x861f09=_0x55f2d4['value']['split'](',')[_0x2d14('0x6c')](function(_0x114cc4){return Number(_0x114cc4);});_0x861f09[_0x2d14('0x32')](function(_0x170e9f){_0x4b4cdb['or'](_0x2d14('0x6d'),'%,'+_0x170e9f+',%');});_0x2e05fd=_['union'](_0x2e05fd,_0x861f09);break;case _0x2d14('0x6e'):if(_0x55f2d4['operator']==='$substring'){_0x168bb6[_0x23299d](_0x2d14('0x6f'),'%'+_0x55f2d4[_0x2d14('0x5f')]+'%',null);}else{_0x472385=_[_0x2d14('0x5e')](_0xeb9216,[_0x2d14('0x2b'),_0x2d14('0x3a')]);_0x55f2d4[_0x2d14('0x4f')]=_0x2d14('0x3a');_0x15b9ae=as[_0x2d14('0x68')](_0x2cad72,_0x472385[_0x2d14('0x69')],_0x55f2d4);_0x168bb6[_0x23299d](_0x15b9ae[_0x2d14('0x70')],_0x15b9ae[_0x2d14('0x5f')][_0x2d14('0x6a')],_0x15b9ae[_0x2d14('0x5f')][_0x2d14('0x28')]);}break;case _0x2d14('0x71'):_0x15b9ae=as[_0x2d14('0x68')]('me',null,_0x55f2d4);_0x168bb6[_0x23299d](_0x15b9ae[_0x2d14('0x70')],_0x15b9ae[_0x2d14('0x5f')][_0x2d14('0x6a')],_0x15b9ae['value']['end']);break;}}else{var _0x15b9ae=as[_0x2d14('0x68')](_0x2cad72,_0x472385[_0x2d14('0x69')],_0x55f2d4);_0x168bb6[_0x23299d](_0x15b9ae[_0x2d14('0x70')],_0x15b9ae['value'][_0x2d14('0x6a')],_0x15b9ae[_0x2d14('0x5f')]['end']);}}}else{var _0x5ca3b1=_(_0xc61860[_0x2d14('0x42')])[_0x2d14('0x43')]()[_0x2d14('0x6c')](function(_0x878ec2){return _[_0x2d14('0x72')](_0xeb9216,[_0x2d14('0x2b'),_0x878ec2])?_0x878ec2:undefined;})[_0x2d14('0x73')]()['value']();if(!_[_0x2d14('0x74')](_0x5ca3b1)){_0x5ca3b1[_0x2d14('0x32')](function(_0x384d38){if(_0x384d38==='WhatsappAccountId'){_0xdba428[_0x2d14('0x4c')](_0x2d14('0x75'),[]['concat'](_0xc61860[_0x2d14('0x42')][_0x384d38]));}else if(_0x384d38===_0x2d14('0x76')){var _0x5ef440=JSON['parse'](_0xc61860[_0x2d14('0x42')][_0x384d38])[_0x2d14('0x77')];var _0x5a8c55=JSON[_0x2d14('0x78')](_0xc61860[_0x2d14('0x42')][_0x384d38])[_0x2d14('0x79')];_0xdba428[_0x2d14('0x4c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5ef440,_0x5a8c55);}else{if(_0xc61860[_0x2d14('0x42')][_0x384d38]===_0x2d14('0x7a')){_0xdba428['where']('i.'+_0x384d38+'\x20IS\x20NULL');}else{_0xdba428[_0x2d14('0x4c')]('i.'+_0x384d38+'\x20=\x20?',_0xc61860[_0x2d14('0x42')][_0x384d38]);}}});}if(_0xc61860['query']['read']){if(_0xc61860[_0x2d14('0x42')][_0x2d14('0x7b')]==0x1){_0xdba428[_0x2d14('0x60')](_0x2d14('0x7c'));}else{_0xdba428[_0x2d14('0x60')]('`unreadMessages`\x20>\x200');}}if(_0xc61860[_0x2d14('0x42')][_0x2d14('0x7d')]){_0x2e05fd=_[_0x2d14('0x7e')](_0xc61860['query']['tag'])?_0xc61860['query']['tag']:new Array(_0xc61860['query']['tag']);_0x2e05fd[_0x2d14('0x32')](function(_0x4524c1){_0x4b4cdb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4524c1+',%');});}if(_0xc61860[_0x2d14('0x42')]['filter']){var _0x832cb7=_0xc61860[_0x2d14('0x42')][_0x2d14('0x7f')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x2d14('0x80')](_0x832cb7)){_0x168bb6['or'](_0x2d14('0x81'),_0x832cb7+'%')['or']('i.phone\x20LIKE\x20?',_0x832cb7+'%');}else{_0x168bb6['or'](_0x2d14('0x82'),qs['getFullTextValue'](_0x832cb7))['or'](_0x2d14('0x83'),_0x832cb7+'%');}}}_0xdba428[_0x2d14('0x4c')](_0x168bb6);_0xdba428[_0x2d14('0x84')](_0x2d14('0x85'));var _0x2e4890={'type':db[_0x2d14('0x86')]['QueryTypes'][_0x2d14('0x87')],'raw':!![]};var _0x2713c3=_0xdba428[_0x2d14('0x88')]();_0x2713c3[_0x2d14('0x4f')]('i.id');_0x2713c3[_0x2d14('0x4f')](_0x2d14('0x89'),_0x2d14('0x8a'));if(_0x15277d[_0x2d14('0x4b')]){_0x15277d['order'][_0x2d14('0x32')](function(_0x1468c5){var _0x5ebc7b=_0x1468c5[0x0]===_0x2d14('0x8b')?_0x1468c5[0x0]:'i.'+_0x1468c5[0x0];_0xdba428[_0x2d14('0x4b')](_0x5ebc7b,_0x1468c5[0x1]===_0x2d14('0x8c')?![]:!![]);});}if(!_[_0x2d14('0x74')](_0x2e05fd)){_0xdba428['having'](_0x4b4cdb);_0x2713c3[_0x2d14('0x4c')]('t.id\x20IN\x20?',_0x2e05fd);}BPromise['resolve']()['then'](function(){if(!_0x2a0c97){if(_0xc61860[_0x2d14('0x42')][_0x2d14('0x8d')])return;_0x2713c3[_0x2d14('0x4c')](_0x2d14('0x8e'));_0xdba428['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xc61860[_0x2d14('0x8f')][_0x2d14('0x90')]!==_0x2d14('0x91'))return;return _0xc61860['user'][_0x2d14('0x92')]({'attributes':['id'],'raw':!![]})[_0x2d14('0x26')](function(_0x172193){if(_[_0x2d14('0x74')](_0x172193)){_0x2713c3['where']('i.WhatsappAccountId\x20IS\x20NULL');_0xdba428[_0x2d14('0x4c')](_0x2d14('0x93'));}else{_0x2713c3['where'](_0x2d14('0x75'),_[_0x2d14('0x6c')](_0x172193,'id'));_0xdba428[_0x2d14('0x4c')](_0x2d14('0x75'),_['map'](_0x172193,'id'));}});})[_0x2d14('0x26')](function(){if(_0xc61860['user']['role']===_0x2d14('0x91')&&!_0x2a0c97&&!_0xc61860[_0x2d14('0x42')][_0x2d14('0x8d')])return[];return db[_0x2d14('0x94')][_0x2d14('0x42')](_0x2713c3[_0x2d14('0x95')](),_0x2e4890);})['then'](function(_0x5692a1){_0x424dc3[_0x2d14('0x96')]=_0x5692a1[_0x2d14('0x48')];if(_0x424dc3[_0x2d14('0x96')]===0x0)return[];return db[_0x2d14('0x94')][_0x2d14('0x42')](_0x4e87a3['toString'](),_0x2e4890)[_0x2d14('0x26')](function(_0x4315e0){_0x2aa2bc=_['keyBy'](_0x4315e0,'id');_0x2e4890=_[_0x2d14('0x97')](_0x2e4890,{'model':db[_0x2d14('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xc61860[_0x2d14('0x42')][_0x2d14('0x47')]){_0x15277d[_0x2d14('0x46')][_0x2d14('0x32')](function(_0x404273){_0xdba428[_0x2d14('0x4f')]('i.'+_0x404273);});}else{_0xdba428[_0x2d14('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0xdba428[_0x2d14('0x4f')](_0x2d14('0x98'),_0x2d14('0x99'));_0xdba428[_0x2d14('0x4f')](_0x2d14('0x9a'),'Account.mandatoryDisposition');_0xdba428[_0x2d14('0x4f')](_0x2d14('0x9b'),_0x2d14('0x8b'));_0xdba428[_0x2d14('0x4f')](_0x2d14('0x9c'));_0xdba428[_0x2d14('0x4f')](_0x2d14('0x9d'),_0x2d14('0x9e'));_0xdba428['field'](_0x2d14('0x9f'),_0x2d14('0xa0'));_0xdba428[_0x2d14('0x4f')](_0x2d14('0xa1'),_0x2d14('0xa2'));_0xdba428[_0x2d14('0x4f')]('c.phone',_0x2d14('0xa3'));_0xdba428[_0x2d14('0x4f')]('c.mobile',_0x2d14('0xa4'));_0xdba428[_0x2d14('0x4f')](_0x2d14('0xa5'),_0x2d14('0xa6'));_0xdba428[_0x2d14('0x4f')](_0x2d14('0xa7'),_0x2d14('0xa8'));_0xdba428['field'](_0x2d14('0xa9'),'Owner.internal');_0xdba428[_0x2d14('0x4f')](_0x2d14('0xaa'),_0x2d14('0x2f'));}if(_0x15277d[_0x2d14('0x22')])_0xdba428[_0x2d14('0x22')](_0x15277d['limit']);if(_0x15277d[_0x2d14('0x20')])_0xdba428[_0x2d14('0x20')](_0x15277d[_0x2d14('0x20')]);return db['sequelize']['query'](_0xdba428['toString'](),_0x2e4890);})[_0x2d14('0x26')](function(_0x1516e9){if(_0x1516e9['length']>0x0)_0xa662c8[_0x2d14('0x4c')](_0x2d14('0xab'),_[_0x2d14('0x6c')](_0x1516e9,'id'));return db[_0x2d14('0x94')][_0x2d14('0x42')](_0xa662c8[_0x2d14('0x95')](),_0x2e4890)[_0x2d14('0x26')](function(_0xf0397d){var _0x190bec=_[_0x2d14('0xac')](_0xf0397d,_0x2d14('0xad'));var _0x332e89=[];_0x1516e9[_0x2d14('0x32')](function(_0x3f4c69){_0x332e89[_0x2d14('0x33')](updateWhatsappInteraction(_0x3f4c69,_0x2aa2bc,_0x190bec));});return BPromise['all'](_0x332e89);});});})[_0x2d14('0x26')](function(_0x4c67f6){_0x424dc3[_0x2d14('0xae')]=_0x4c67f6;return _0x424dc3;})[_0x2d14('0x26')](respondWithFilteredResult(_0x575fcc,_0x15277d))['catch'](handleError(_0x575fcc,null));};exports[_0x2d14('0xaf')]=function(_0x462f40,_0x7cca76){var _0x56cd4f={'raw':![],'where':{'id':_0x462f40[_0x2d14('0xb0')]['id']}},_0x596ed6={};_0x596ed6[_0x2d14('0x41')]=_['keys'](db['WhatsappInteraction'][_0x2d14('0x3e')]);_0x596ed6['query']=_['keys'](_0x462f40['query']);_0x596ed6[_0x2d14('0x44')]=_[_0x2d14('0x45')](_0x596ed6[_0x2d14('0x41')],_0x596ed6['query']);_0x56cd4f[_0x2d14('0x46')]=_['intersection'](_0x596ed6['model'],qs[_0x2d14('0x47')](_0x462f40[_0x2d14('0x42')][_0x2d14('0x47')]));_0x56cd4f[_0x2d14('0x46')]=_0x56cd4f['attributes'][_0x2d14('0x48')]?_0x56cd4f['attributes']:_0x596ed6[_0x2d14('0x41')];if(_0x462f40[_0x2d14('0x42')][_0x2d14('0xb1')]){_0x56cd4f['include']=[{'all':!![]}];}_0x56cd4f=_[_0x2d14('0x97')]({},_0x56cd4f,_0x462f40[_0x2d14('0xb2')]);return db[_0x2d14('0x3d')][_0x2d14('0x5e')](_0x56cd4f)[_0x2d14('0x26')](handleEntityNotFound(_0x7cca76,null))[_0x2d14('0x26')](respondWithResult(_0x7cca76,null))[_0x2d14('0x34')](handleError(_0x7cca76,null));};exports[_0x2d14('0xb3')]=function(_0x46f770,_0x1b87e0){return db[_0x2d14('0x3d')]['create'](_0x46f770[_0x2d14('0x71')],{})[_0x2d14('0x26')](respondWithResult(_0x1b87e0,0xc9))[_0x2d14('0x34')](handleError(_0x1b87e0,null));};exports['update']=function(_0x5c26c5,_0x6a618){if(_0x5c26c5['body']['id']){delete _0x5c26c5[_0x2d14('0x71')]['id'];}return db[_0x2d14('0x3d')][_0x2d14('0x5e')]({'where':{'id':_0x5c26c5[_0x2d14('0xb0')]['id']}})[_0x2d14('0x26')](handleEntityNotFound(_0x6a618,null))[_0x2d14('0x26')](saveUpdates(_0x5c26c5[_0x2d14('0x71')],null))['then'](respondWithResult(_0x6a618,null))['catch'](handleError(_0x6a618,null));};exports[_0x2d14('0x27')]=function(_0x544b95,_0x42845c){return db[_0x2d14('0x3d')]['find']({'where':{'id':_0x544b95[_0x2d14('0xb0')]['id']}})[_0x2d14('0x26')](handleEntityNotFound(_0x42845c,null))[_0x2d14('0x26')](removeEntity(_0x42845c,null))['catch'](handleError(_0x42845c,null));};exports['describe']=function(_0x3a8d8b,_0x22cbf4){return db[_0x2d14('0x3d')][_0x2d14('0xb4')]()[_0x2d14('0x26')](respondWithResult(_0x22cbf4,null))[_0x2d14('0x34')](handleError(_0x22cbf4,null));};exports[_0x2d14('0xb5')]=function(_0xf089dd,_0x46ba5c,_0xc01aa4){return db[_0x2d14('0xb6')][_0x2d14('0x5e')]({'where':{'id':_0xf089dd['params']['id']}})[_0x2d14('0x26')](handleEntityNotFound(_0x46ba5c,null))[_0x2d14('0x26')](function(_0x59d545){if(_0x59d545){return _0x59d545[_0x2d14('0xb5')](_0xf089dd['body'][_0x2d14('0xb7')],_[_0x2d14('0xb8')](_0xf089dd[_0x2d14('0x71')],[_0x2d14('0xb7'),'id'])||{});}})[_0x2d14('0x26')](respondWithResult(_0x46ba5c,null))[_0x2d14('0x34')](handleError(_0x46ba5c,null));};exports[_0x2d14('0xb9')]=function(_0x46e511,_0x3231d4,_0x5357ad){var _0x5e2945={'raw':![],'where':{}};var _0x12f05f={};var _0x206127={'count':0x0,'rows':[]};return db[_0x2d14('0x3d')][_0x2d14('0xba')]({'where':{'id':_0x46e511['params']['id']}})[_0x2d14('0x26')](handleEntityNotFound(_0x3231d4,null))[_0x2d14('0x26')](function(_0x7de14e){if(_0x7de14e){_0x12f05f[_0x2d14('0x41')]=_[_0x2d14('0x43')](db[_0x2d14('0xb6')][_0x2d14('0x3e')]);_0x12f05f[_0x2d14('0x42')]=_[_0x2d14('0x43')](_0x46e511[_0x2d14('0x42')]);_0x12f05f[_0x2d14('0x44')]=_['intersection'](_0x12f05f[_0x2d14('0x41')],_0x12f05f[_0x2d14('0x42')]);_0x5e2945[_0x2d14('0x46')]=_[_0x2d14('0x45')](_0x12f05f[_0x2d14('0x41')],qs[_0x2d14('0x47')](_0x46e511[_0x2d14('0x42')][_0x2d14('0x47')]));_0x5e2945['attributes']=_0x5e2945[_0x2d14('0x46')]['length']?_0x5e2945[_0x2d14('0x46')]:_0x12f05f['model'];if(!_0x46e511['query']['hasOwnProperty']('nolimit')){_0x5e2945['limit']=qs[_0x2d14('0x22')](_0x46e511[_0x2d14('0x42')]['limit']);_0x5e2945[_0x2d14('0x20')]=qs[_0x2d14('0x20')](_0x46e511[_0x2d14('0x42')]['offset']);}_0x5e2945[_0x2d14('0x4b')]=qs[_0x2d14('0xbb')](_0x46e511[_0x2d14('0x42')][_0x2d14('0xbb')]);_0x5e2945[_0x2d14('0x4c')]=qs[_0x2d14('0x44')](_['pick'](_0x46e511[_0x2d14('0x42')],_0x12f05f[_0x2d14('0x44')]));_0x5e2945[_0x2d14('0x4c')][_0x2d14('0xad')]=_0x7de14e['id'];if(_0x46e511[_0x2d14('0x42')][_0x2d14('0x7f')]){_0x5e2945[_0x2d14('0x4c')]=_['merge'](_0x5e2945['where'],{'$or':_[_0x2d14('0x6c')](_0x5e2945[_0x2d14('0x46')],function(_0xac6ee){var _0x3093f6={};_0x3093f6[_0xac6ee]={'$like':'%'+_0x46e511['query'][_0x2d14('0x7f')]+'%'};return _0x3093f6;})});}if(_0x46e511[_0x2d14('0x42')][_0x2d14('0x77')]){var _0x36ac1d=_0x46e511[_0x2d14('0x42')][_0x2d14('0x77')][_0x2d14('0x31')](',');var _0x2a027f={};_0x2a027f[_0x36ac1d[0x0]]={'$gte':moment(_0x36ac1d[0x1])[_0x2d14('0xbc')](_0x2d14('0xbd'))};_0x5e2945[_0x2d14('0x4c')]=_[_0x2d14('0x97')](_0x5e2945[_0x2d14('0x4c')],_0x2a027f);}_0x5e2945=_[_0x2d14('0x97')]({},_0x5e2945,_0x46e511[_0x2d14('0xb2')]);return db[_0x2d14('0xb6')][_0x2d14('0x96')]({'where':_0x5e2945[_0x2d14('0x4c')]})['then'](function(_0x3caf9d){_0x206127[_0x2d14('0x96')]=_0x3caf9d;if(_0x46e511['query']['includeAll']){_0x5e2945[_0x2d14('0xbe')]=[{'all':!![]}];}return db[_0x2d14('0xb6')][_0x2d14('0xbf')](_0x5e2945);})[_0x2d14('0x26')](function(_0x1c38eb){_0x206127['rows']=_0x1c38eb;return _0x206127;});}})[_0x2d14('0x26')](respondWithFilteredResult(_0x3231d4,_0x5e2945))[_0x2d14('0x34')](handleError(_0x3231d4,null));};exports[_0x2d14('0xc0')]=function(_0x3dfc39,_0x2f09ad,_0x5c6ef0){return db['WhatsappInteraction'][_0x2d14('0x5e')]({'where':{'id':_0x3dfc39[_0x2d14('0xb0')]['id']}})[_0x2d14('0x26')](handleEntityNotFound(_0x2f09ad,null))['then'](function(_0x268058){if(_0x268058){return _0x268058[_0x2d14('0xc1')](_0x3dfc39[_0x2d14('0x71')][_0x2d14('0xb7')],_[_0x2d14('0xb8')](_0x3dfc39[_0x2d14('0x71')],[_0x2d14('0xb7'),'id'])||{})[_0x2d14('0xc2')](function(){return db['Tag']['findAll']({'attributes':['id',_0x2d14('0x2b'),_0x2d14('0xc3')],'where':{'id':_0x3dfc39[_0x2d14('0x71')][_0x2d14('0xb7')]}});})[_0x2d14('0x26')](function(_0x1d9c83){socket['emit'](_0x2d14('0xc4'),{'id':Number(_0x3dfc39['params']['id']),'tags':_0x1d9c83||[]});return{'id':Number(_0x3dfc39[_0x2d14('0xb0')]['id']),'tags':_0x1d9c83||[]};});}})['then'](respondWithResult(_0x2f09ad,null))[_0x2d14('0x34')](handleError(_0x2f09ad,null));};exports['removeTags']=function(_0x4fb01b,_0x2c354d,_0x540842){return db[_0x2d14('0x3d')][_0x2d14('0x5e')]({'where':{'id':_0x4fb01b['params']['id']}})['then'](handleEntityNotFound(_0x2c354d,null))[_0x2d14('0x26')](function(_0x479df0){if(_0x479df0){return _0x479df0[_0x2d14('0xc5')](_0x4fb01b[_0x2d14('0x42')]['ids']);}})[_0x2d14('0x26')](respondWithStatusCode(_0x2c354d,null))['catch'](handleError(_0x2c354d,null));};exports[_0x2d14('0xc6')]=function(_0x46866e,_0x25cb96){var _0x1eaaa7=moment()[_0x2d14('0xc7')]()[_0x2d14('0x95')]();var _0x289157=path[_0x2d14('0xc8')](config[_0x2d14('0xc9')],'server',_0x2d14('0xca'),_0x2d14('0xcb'));var _0x5e49c3=path[_0x2d14('0xc8')](config[_0x2d14('0xc9')],_0x2d14('0xcc'),_0x2d14('0xca'),'attachments');var _0x333c08=path['join'](_0x289157,_0x1eaaa7);var _0x336c92=util['format']('transcript-%d-%s.zip',_0x46866e['params']['id'],_0x1eaaa7);var _0x3c1c70=path[_0x2d14('0xc8')](_0x289157,_0x336c92);var _0x9370ee=[];_0x9370ee['push']({'model':db[_0x2d14('0x6e')],'as':_0x2d14('0x6e'),'attributes':['id','fullname'],'raw':!![]});_0x9370ee[_0x2d14('0x33')]({'model':db[_0x2d14('0xcd')],'as':_0x2d14('0xce'),'attributes':['id','firstName',_0x2d14('0xcf')],'raw':!![]});if(_0x46866e['query'][_0x2d14('0xd0')]){_0x9370ee[_0x2d14('0x33')]({'model':db[_0x2d14('0xd1')],'as':_0x2d14('0xd1'),'raw':!![]});}var _0x5b7735=[{'model':db['WhatsappMessage'],'as':_0x2d14('0xd2'),'attributes':['id',_0x2d14('0x71'),_0x2d14('0x76'),_0x2d14('0xd3'),_0x2d14('0xd4'),'read'],'include':_0x9370ee}];_0x5b7735[_0x2d14('0x33')]({'model':db[_0x2d14('0xd5')],'as':'Account','attributes':['id',_0x2d14('0x2b')]});_0x5b7735[_0x2d14('0x33')]({'model':db[_0x2d14('0x6e')],'as':_0x2d14('0xd6'),'attributes':['id','fullname']});return db[_0x2d14('0x3d')][_0x2d14('0x5e')]({'where':{'id':_0x46866e[_0x2d14('0xb0')]['id']},'include':_0x5b7735})[_0x2d14('0x26')](handleEntityNotFound(_0x25cb96,null))[_0x2d14('0x26')](function(_0x149fb5){if(_0x149fb5){var _0x544b11=_0x149fb5[_0x2d14('0xd7')]({'plain':!![]});fs['mkdirSync'](_0x333c08);var _0x59b932={'channel':_0x2d14('0xd8'),'account':_0x544b11['Account'][_0x2d14('0x2b')],'agent':_0x544b11[_0x2d14('0xd6')]?_0x544b11[_0x2d14('0xd6')][_0x2d14('0x2e')]:_0x2d14('0xd9'),'createdAt':moment(_0x544b11[_0x2d14('0x76')])[_0x2d14('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2d14('0x95')](),'closedAt':_0x544b11[_0x2d14('0x39')]?moment(_0x544b11[_0x2d14('0xda')])[_0x2d14('0xbc')](_0x2d14('0xbd'))[_0x2d14('0x95')]():'','disposition':_0x544b11['disposition'],'messages':_(_0x544b11[_0x2d14('0xd2')])[_0x2d14('0x7f')]({'secret':![]})[_0x2d14('0x6c')](function(_0x1c9aa5){if(_0x1c9aa5[_0x2d14('0xd1')]){var _0x1b52d2=path['join'](_0x5e49c3,_0x1c9aa5['Attachment']['basename']);if(fs['existsSync'](_0x1b52d2)){fs[_0x2d14('0xdb')](_0x1b52d2)['pipe'](fs[_0x2d14('0xdc')](path['join'](_0x333c08,_0x1c9aa5[_0x2d14('0xd1')][_0x2d14('0xdd')])));}}return{'date':moment(_0x1c9aa5[_0x2d14('0x76')])[_0x2d14('0xbc')](_0x2d14('0xbd'))['toString'](),'sender':_0x1c9aa5['direction']===_0x2d14('0xde')?_0x1c9aa5[_0x2d14('0x6e')]?_0x1c9aa5['User'][_0x2d14('0x2e')]:'System':_0x1c9aa5['Contact']['firstName']+(_0x1c9aa5[_0x2d14('0xce')][_0x2d14('0xcf')]?'\x20'+_0x1c9aa5[_0x2d14('0xce')]['lastName']:''),'body':_0x1c9aa5[_0x2d14('0xd1')]?_0x1c9aa5[_0x2d14('0xd1')][_0x2d14('0xdd')]:_0x1c9aa5['body'],'direction':_0x1c9aa5['direction']==='out'?'A':'C','secret':_0x1c9aa5[_0x2d14('0xd4')],'read':_0x1c9aa5[_0x2d14('0x7b')],'attachment':_0x1c9aa5[_0x2d14('0xd1')]};})[_0x2d14('0x5f')]()};return ejs[_0x2d14('0xdf')](path[_0x2d14('0xc8')](config['root'],'server',_0x2d14('0xe0'),_0x2d14('0xe1')),{'interaction':_0x59b932})[_0x2d14('0x26')](function(_0x2cd12f){var _0x24ef38=path[_0x2d14('0xc8')](_0x333c08,_0x2d14('0xe2')+_0x544b11['id']+'-'+_0x1eaaa7+_0x2d14('0xe3'));var _0x1d76aa={'path':_0x24ef38,'channel':_0x2d14('0xd8'),'interactionId':_0x544b11['id']};return pdf[_0x2d14('0xe4')](_0x2cd12f,_0x1d76aa);})[_0x2d14('0x26')](function(){return new BPromise(function(_0x4d006a,_0x1dc476){zipdir(_0x333c08,{'saveTo':_0x3c1c70},function(_0x3b4ce5,_0x89d94f){if(_0x3b4ce5)return _0x1dc476(_0x3b4ce5);return _0x4d006a(_0x89d94f);});})[_0x2d14('0x26')](function(){return new BPromise(function(_0x448f79,_0xa8ad48){rimraf(_0x333c08,function(_0x3b8a3e){if(_0x3b8a3e)_0xa8ad48(_0x3b8a3e);return _0x448f79();});});})[_0x2d14('0x26')](function(){return _0x25cb96[_0x2d14('0xc6')](_0x3c1c70,_0x336c92,function(_0x295739){if(_0x295739){console[_0x2d14('0xe5')]('err',_0x295739);}else{fs[_0x2d14('0xe6')](_0x3c1c70);}});});});}else{return _0x25cb96['sendStatus'](0xc8);}})[_0x2d14('0x34')](handleError(_0x25cb96,null));}; \ No newline at end of file +var _0x1267=['unmanaged','total','UserId','waiting','closed','answered','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','select','field','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','isEmpty','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','Sequelize','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','resolve','WhatsappAccountId','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','includeAll','include','merge','options','create','update','params','describe','addMessage','ids','getMessages','WhatsappMessage','hasOwnProperty','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','removeTags','download','unix','join','root','server','files','attachments','CmContact','Attachment','secret','mkdirSync','Account','Owner','closedAt','disposition','Messages','pipe','basename','direction','out','System','firstName','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappInteraction.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','end','name','send','Users','map','fullname','TagIds','split','forEach','push','catch','talking'];(function(_0x3c1755,_0x286859){var _0x1b6379=function(_0x1b8539){while(--_0x1b8539){_0x3c1755['push'](_0x3c1755['shift']());}};_0x1b6379(++_0x286859);}(_0x1267,0xb5));var _0x7126=function(_0x4aff3d,_0x59d4fa){_0x4aff3d=_0x4aff3d-0x0;var _0x4c7222=_0x1267[_0x4aff3d];return _0x4c7222;};'use strict';var emlformat=require(_0x7126('0x0'));var rimraf=require(_0x7126('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7126('0x2'));var moment=require(_0x7126('0x3'));var BPromise=require(_0x7126('0x4'));var Mustache=require(_0x7126('0x5'));var util=require(_0x7126('0x6'));var path=require(_0x7126('0x7'));var sox=require(_0x7126('0x8'));var csv=require('to-csv');var ejs=require(_0x7126('0x9'));var fs=require('fs');var fs_extra=require(_0x7126('0xa'));var _=require(_0x7126('0xb'));var squel=require(_0x7126('0xc'));var crypto=require('crypto');var jsforce=require(_0x7126('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7126('0xe'));var querystring=require('querystring');var Papa=require(_0x7126('0xf'));var Redis=require(_0x7126('0x10'));var authService=require(_0x7126('0x11'));var qs=require(_0x7126('0x12'));var as=require(_0x7126('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7126('0x14'))(_0x7126('0x15'));var utils=require(_0x7126('0x16'));var config=require(_0x7126('0x17'));var licenseUtil=require(_0x7126('0x18'));var db=require(_0x7126('0x19'))['db'];config['redis']=_['defaults'](config[_0x7126('0x1a')],{'host':_0x7126('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7126('0x1c'))[_0x7126('0x1d')](socket);function respondWithStatusCode(_0x5ca28a,_0xfb9e58){_0xfb9e58=_0xfb9e58||0xcc;return function(_0x52866f){if(_0x52866f){return _0x5ca28a[_0x7126('0x1e')](_0xfb9e58);}return _0x5ca28a[_0x7126('0x1f')](_0xfb9e58)['end']();};}function respondWithResult(_0x4fd16d,_0x296ce0){_0x296ce0=_0x296ce0||0xc8;return function(_0x4bd126){if(_0x4bd126){return _0x4fd16d[_0x7126('0x1f')](_0x296ce0)[_0x7126('0x20')](_0x4bd126);}};}function respondWithFilteredResult(_0x3de49a,_0x2795e0){return function(_0xd98d0c){if(_0xd98d0c){var _0x68dbf2=typeof _0x2795e0[_0x7126('0x21')]==='undefined'&&typeof _0x2795e0[_0x7126('0x22')]===_0x7126('0x23');var _0x56ec9a=_0xd98d0c[_0x7126('0x24')];var _0x1515ca=_0x68dbf2?0x0:_0x2795e0['offset'];var _0x3e20f3=_0x68dbf2?_0xd98d0c['count']:_0x2795e0['offset']+_0x2795e0[_0x7126('0x22')];var _0x378acd;if(_0x3e20f3>=_0x56ec9a){_0x3e20f3=_0x56ec9a;_0x378acd=0xc8;}else{_0x378acd=0xce;}_0x3de49a[_0x7126('0x1f')](_0x378acd);return _0x3de49a[_0x7126('0x25')](_0x7126('0x26'),_0x1515ca+'-'+_0x3e20f3+'/'+_0x56ec9a)['json'](_0xd98d0c);}return null;};}function patchUpdates(_0x4225bd){return function(_0x17f55e){try{jsonpatch[_0x7126('0x27')](_0x17f55e,_0x4225bd,!![]);}catch(_0x387133){return BPromise[_0x7126('0x28')](_0x387133);}return _0x17f55e[_0x7126('0x29')]();};}function saveUpdates(_0x1c0dfa,_0x6b250c){return function(_0x4c830e){if(_0x4c830e){return _0x4c830e['update'](_0x1c0dfa)['then'](function(_0x382941){return _0x382941;});}return null;};}function removeEntity(_0x4b0d9f,_0x462184){return function(_0x17c060){if(_0x17c060){return _0x17c060[_0x7126('0x2a')]()[_0x7126('0x2b')](function(){_0x4b0d9f['status'](0xcc)[_0x7126('0x2c')]();});}};}function handleEntityNotFound(_0x5acd75,_0x4426c0){return function(_0x5b01ab){if(!_0x5b01ab){_0x5acd75[_0x7126('0x1e')](0x194);}return _0x5b01ab;};}function handleError(_0x15b2bb,_0x5e954d){_0x5e954d=_0x5e954d||0x1f4;return function(_0x53624e){logger['error'](_0x53624e['stack']);if(_0x53624e[_0x7126('0x2d')]){delete _0x53624e[_0x7126('0x2d')];}_0x15b2bb['status'](_0x5e954d)[_0x7126('0x2e')](_0x53624e);};}function getInteractionUsers(_0x82621e,_0x8f0e73){return new BPromise(function(_0xef1f31,_0x70da80){try{if(_0x8f0e73[_0x82621e['id']]){_0x82621e[_0x7126('0x2f')]=_[_0x7126('0x30')](_0x8f0e73[_0x82621e['id']],function(_0x4ae537){return{'id':_0x4ae537['id'],'fullname':_0x4ae537[_0x7126('0x31')]};});}}catch(_0x4e05f7){_0x70da80(_0x4e05f7);}_0xef1f31(_0x82621e);});}function getInteractionTags(_0x5d62d4,_0x418d15){return new BPromise(function(_0x330029,_0x17850d){try{if(_0x5d62d4[_0x7126('0x32')]){_0x5d62d4['Tags']=[];_0x5d62d4[_0x7126('0x32')][_0x7126('0x33')](',')[_0x7126('0x34')](function(_0x59f325){_0x5d62d4['Tags'][_0x7126('0x35')](_0x418d15[_0x59f325]);});}delete _0x5d62d4[_0x7126('0x32')];}catch(_0xba31bc){_0x17850d(_0xba31bc);}_0x330029(_0x5d62d4);});}function updateWhatsappInteraction(_0x5031e9,_0xa169d1,_0x59abef){return new BPromise(function(_0x8c33f7,_0x3a6e3d){return getInteractionUsers(_0x5031e9,_0x59abef)[_0x7126('0x2b')](function(_0x15fe77){return getInteractionTags(_0x15fe77,_0xa169d1);})[_0x7126('0x2b')](function(_0x551deb){return getStateInteraction(_0x551deb);})['then'](function(_0x2de93b){_0x8c33f7(_0x2de93b);})[_0x7126('0x36')](function(_0x139d4a){_0x3a6e3d(_0x139d4a);});});}function getStateInteraction(_0xb46379){return new BPromise(function(_0x3b0d3e){_0xb46379['waiting']=0x0;_0xb46379[_0x7126('0x37')]=0x0;_0xb46379['answered']=0x0;_0xb46379[_0x7126('0x38')]=0x0;_0xb46379[_0x7126('0x39')]=0x0;if(!_0xb46379['closed']&&!_0xb46379[_0x7126('0x3a')]){_0xb46379[_0x7126('0x3b')]+=0x1;}if(!_0xb46379[_0x7126('0x3c')]&&_0xb46379['UserId']){_0xb46379[_0x7126('0x37')]+=0x1;if(_0xb46379[_0x7126('0x3b')]){_0xb46379['waiting']-=0x1;}}if(_0xb46379[_0x7126('0x3c')]&&_0xb46379[_0x7126('0x3a')]){_0xb46379[_0x7126('0x3d')]+=0x1;if(_0xb46379['talking']){_0xb46379[_0x7126('0x37')]-=0x1;}}if(_0xb46379['closed']&&!_0xb46379[_0x7126('0x3a')]){_0xb46379[_0x7126('0x38')]+=0x1;if(_0xb46379['waiting']){_0xb46379[_0x7126('0x3b')]-=0x1;}}_0xb46379[_0x7126('0x39')]+=0x1;_0x3b0d3e(_0xb46379);});}exports[_0x7126('0x3e')]=function(_0x355521,_0x3d46ae){var _0x38ef14={},_0x3fdbfa={},_0x59d293={'count':0x0,'rows':[]};var _0x2ddb40=_[_0x7126('0x30')](db[_0x7126('0x3f')][_0x7126('0x40')],function(_0x22d332){return{'name':_0x22d332[_0x7126('0x41')],'type':_0x22d332[_0x7126('0x42')][_0x7126('0x43')]};});_0x3fdbfa[_0x7126('0x44')]=_[_0x7126('0x30')](_0x2ddb40,_0x7126('0x2d'));_0x3fdbfa['query']=_[_0x7126('0x45')](_0x355521[_0x7126('0x46')]);_0x3fdbfa[_0x7126('0x47')]=_[_0x7126('0x48')](_0x3fdbfa[_0x7126('0x44')],_0x3fdbfa[_0x7126('0x46')]);_0x38ef14[_0x7126('0x49')]=_[_0x7126('0x48')](_0x3fdbfa['model'],qs[_0x7126('0x4a')](_0x355521['query'][_0x7126('0x4a')]));_0x38ef14[_0x7126('0x49')]=_0x38ef14[_0x7126('0x49')][_0x7126('0x4b')]?_0x38ef14[_0x7126('0x49')]:_0x3fdbfa[_0x7126('0x44')];if(!_0x355521[_0x7126('0x46')]['hasOwnProperty'](_0x7126('0x4c'))){_0x38ef14[_0x7126('0x22')]=qs[_0x7126('0x22')](_0x355521['query'][_0x7126('0x22')]);_0x38ef14[_0x7126('0x21')]=qs['offset'](_0x355521[_0x7126('0x46')][_0x7126('0x21')]);}_0x38ef14['order']=qs[_0x7126('0x4d')](_0x355521[_0x7126('0x46')][_0x7126('0x4d')]);_0x38ef14[_0x7126('0x4e')]=qs[_0x7126('0x47')](_[_0x7126('0x4f')](_0x355521[_0x7126('0x46')],_0x3fdbfa[_0x7126('0x47')]),_0x2ddb40);var _0x1ccfeb=[];var _0x3ab107=squel[_0x7126('0x50')]()[_0x7126('0x51')]('id')['field'](_0x7126('0x2d'))[_0x7126('0x51')]('color')[_0x7126('0x52')]('tools_tags');var _0x13efb6=squel[_0x7126('0x50')]()[_0x7126('0x51')](_0x7126('0x53'))[_0x7126('0x51')](_0x7126('0x54'))[_0x7126('0x51')](_0x7126('0x55'))[_0x7126('0x52')](_0x7126('0x56'),'ui')[_0x7126('0x57')](_0x7126('0x58'),'u',_0x7126('0x59'));var _0x1c43ff=squel[_0x7126('0x50')]()[_0x7126('0x52')](_0x7126('0x5a'),'i')['left_join']('cm_contacts','c',_0x7126('0x5b'))['left_join'](_0x7126('0x58'),'o',_0x7126('0x5c'))[_0x7126('0x57')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')['left_join']('whatsapp_messages','me',_0x7126('0x5d'))[_0x7126('0x57')](_0x7126('0x5e'),'it',_0x7126('0x5f'))[_0x7126('0x57')](_0x7126('0x60'),'t',_0x7126('0x61'));var _0x642999=squel[_0x7126('0x62')]();var _0x4d70b0=[];var _0x44a5a2=squel[_0x7126('0x62')]();var _0x15fab0;if(_0x355521[_0x7126('0x46')][_0x7126('0x63')]){_0x15fab0=as[_0x7126('0x64')](_0x355521[_0x7126('0x46')]['search']);var _0x1738dc=_0x15fab0['sqlOperator'];for(var _0x4c24e9=0x0;_0x4c24e9<_0x15fab0[_0x7126('0x65')][_0x7126('0x4b')];_0x4c24e9++){var _0x416311=_0x15fab0[_0x7126('0x65')][_0x4c24e9];var _0x2d59d6='i';var _0x5b741e=_[_0x7126('0x66')](_0x2ddb40,[_0x7126('0x2d'),_0x416311[_0x7126('0x51')]]);if(!_0x5b741e){switch(_0x416311[_0x7126('0x51')]){case _0x7126('0x67'):if(_0x416311[_0x7126('0x68')]==0x1){_0x1c43ff['having']('`'+_0x416311[_0x7126('0x51')]+_0x7126('0x69'));}else{_0x1c43ff['having']('`'+_0x416311[_0x7126('0x51')]+_0x7126('0x6a'));}break;case _0x7126('0x6b'):if(_0x416311[_0x7126('0x6c')]==='$substring'){if(_0x416311[_0x7126('0x68')][_0x7126('0x33')]('\x20')[_0x7126('0x4b')]>0x1){_0x642999[_0x1738dc](_0x7126('0x6d'),qs['getFullTextValue'](_0x416311[_0x7126('0x68')]),null);}else{var _0x4e855e='%'+_0x416311[_0x7126('0x68')]+'%';_0x642999[_0x1738dc](_0x7126('0x6e'),_0x4e855e,_0x4e855e,_0x4e855e);}}else{_0x5b741e=_[_0x7126('0x66')](_0x2ddb40,[_0x7126('0x2d'),_0x7126('0x6f')]);_0x416311[_0x7126('0x51')]=_0x7126('0x6f');_0x2dcb83=as[_0x7126('0x70')](_0x2d59d6,_0x5b741e[_0x7126('0x42')],_0x416311);_0x642999[_0x1738dc](_0x2dcb83[_0x7126('0x71')],_0x2dcb83[_0x7126('0x68')][_0x7126('0x72')],_0x2dcb83['value']['end']);}break;case _0x7126('0x73'):var _0x9c1e76=_0x416311['value'][_0x7126('0x33')](',')['map'](function(_0x31a0cb){return Number(_0x31a0cb);});_0x9c1e76['forEach'](function(_0x30f3d0){_0x44a5a2['or'](_0x7126('0x74'),'%,'+_0x30f3d0+',%');});_0x4d70b0=_[_0x7126('0x75')](_0x4d70b0,_0x9c1e76);break;case _0x7126('0x76'):if(_0x416311['operator']===_0x7126('0x77')){_0x642999[_0x1738dc](_0x7126('0x78'),'%'+_0x416311['value']+'%',null);}else{_0x5b741e=_[_0x7126('0x66')](_0x2ddb40,[_0x7126('0x2d'),'UserId']);_0x416311[_0x7126('0x51')]=_0x7126('0x3a');_0x2dcb83=as[_0x7126('0x70')](_0x2d59d6,_0x5b741e[_0x7126('0x42')],_0x416311);_0x642999[_0x1738dc](_0x2dcb83[_0x7126('0x71')],_0x2dcb83['value']['start'],_0x2dcb83['value']['end']);}break;case _0x7126('0x79'):_0x2dcb83=as[_0x7126('0x70')]('me',null,_0x416311);_0x642999[_0x1738dc](_0x2dcb83[_0x7126('0x71')],_0x2dcb83['value'][_0x7126('0x72')],_0x2dcb83['value'][_0x7126('0x2c')]);break;}}else{var _0x2dcb83=as[_0x7126('0x70')](_0x2d59d6,_0x5b741e[_0x7126('0x42')],_0x416311);_0x642999[_0x1738dc](_0x2dcb83['text'],_0x2dcb83[_0x7126('0x68')]['start'],_0x2dcb83[_0x7126('0x68')][_0x7126('0x2c')]);}}}else{var _0x23cd09=_(_0x355521['query'])[_0x7126('0x45')]()[_0x7126('0x30')](function(_0x177175){return _['some'](_0x2ddb40,[_0x7126('0x2d'),_0x177175])?_0x177175:undefined;})[_0x7126('0x7a')]()[_0x7126('0x68')]();if(!_[_0x7126('0x7b')](_0x23cd09)){_0x23cd09['forEach'](function(_0x5a0e31){if(_0x5a0e31==='WhatsappAccountId'){_0x1c43ff[_0x7126('0x4e')](_0x7126('0x7c'),[][_0x7126('0x7d')](_0x355521[_0x7126('0x46')][_0x5a0e31]));}else if(_0x5a0e31===_0x7126('0x7e')){var _0xa991d1=JSON[_0x7126('0x7f')](_0x355521[_0x7126('0x46')][_0x5a0e31])['$gte'];var _0x3f9f2f=JSON[_0x7126('0x7f')](_0x355521[_0x7126('0x46')][_0x5a0e31])['$lte'];_0x1c43ff[_0x7126('0x4e')](_0x7126('0x80'),_0xa991d1,_0x3f9f2f);}else{if(_0x355521[_0x7126('0x46')][_0x5a0e31]===_0x7126('0x81')){_0x1c43ff[_0x7126('0x4e')]('i.'+_0x5a0e31+_0x7126('0x82'));}else{_0x1c43ff[_0x7126('0x4e')]('i.'+_0x5a0e31+_0x7126('0x83'),_0x355521['query'][_0x5a0e31]);}}});}if(_0x355521['query'][_0x7126('0x84')]){if(_0x355521[_0x7126('0x46')][_0x7126('0x84')]==0x1){_0x1c43ff['having']('`unreadMessages`\x20=\x200');}else{_0x1c43ff[_0x7126('0x85')](_0x7126('0x86'));}}if(_0x355521['query'][_0x7126('0x87')]){_0x4d70b0=_[_0x7126('0x88')](_0x355521['query']['tag'])?_0x355521[_0x7126('0x46')]['tag']:new Array(_0x355521['query'][_0x7126('0x87')]);_0x4d70b0['forEach'](function(_0x238c30){_0x44a5a2['or'](_0x7126('0x74'),'%,'+_0x238c30+',%');});}if(_0x355521[_0x7126('0x46')]['filter']){var _0x34e222=_0x355521['query'][_0x7126('0x89')][_0x7126('0x8a')]('\x5c','\x5c\x5c')[_0x7126('0x8a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x34e222)){_0x642999['or'](_0x7126('0x8b'),_0x34e222+'%')['or']('i.phone\x20LIKE\x20?',_0x34e222+'%');}else{_0x642999['or'](_0x7126('0x8c'),qs[_0x7126('0x8d')](_0x34e222))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x34e222+'%');}}}_0x1c43ff[_0x7126('0x4e')](_0x642999);_0x1c43ff[_0x7126('0x8e')]('i.id');var _0x32e502={'type':db[_0x7126('0x8f')][_0x7126('0x90')][_0x7126('0x91')],'raw':!![]};var _0x4a21ed=_0x1c43ff[_0x7126('0x92')]();_0x4a21ed[_0x7126('0x51')](_0x7126('0x93'));_0x4a21ed[_0x7126('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7126('0x67'));if(_0x38ef14[_0x7126('0x94')]){_0x38ef14[_0x7126('0x94')][_0x7126('0x34')](function(_0x5d4e45){var _0xafcc31=_0x5d4e45[0x0]===_0x7126('0x95')?_0x5d4e45[0x0]:'i.'+_0x5d4e45[0x0];_0x1c43ff['order'](_0xafcc31,_0x5d4e45[0x1]===_0x7126('0x96')?![]:!![]);});}if(!_[_0x7126('0x7b')](_0x4d70b0)){_0x1c43ff[_0x7126('0x85')](_0x44a5a2);_0x4a21ed['where']('t.id\x20IN\x20?',_0x4d70b0);}BPromise[_0x7126('0x97')]()[_0x7126('0x2b')](function(){if(!_0x15fab0){if(_0x355521[_0x7126('0x46')][_0x7126('0x98')])return;_0x4a21ed['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x1c43ff[_0x7126('0x4e')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x355521[_0x7126('0x99')][_0x7126('0x9a')]!==_0x7126('0x9b'))return;return _0x355521[_0x7126('0x99')][_0x7126('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x33bb74){if(_['isEmpty'](_0x33bb74)){_0x4a21ed[_0x7126('0x4e')](_0x7126('0x9d'));_0x1c43ff['where'](_0x7126('0x9d'));}else{_0x4a21ed[_0x7126('0x4e')]('i.WhatsappAccountId\x20IN\x20?',_[_0x7126('0x30')](_0x33bb74,'id'));_0x1c43ff['where'](_0x7126('0x7c'),_[_0x7126('0x30')](_0x33bb74,'id'));}});})['then'](function(){if(_0x355521[_0x7126('0x99')][_0x7126('0x9a')]===_0x7126('0x9b')&&!_0x15fab0&&!_0x355521['query'][_0x7126('0x98')])return[];return db[_0x7126('0x9e')]['query'](_0x4a21ed[_0x7126('0x9f')](),_0x32e502);})['then'](function(_0x1cbac8){_0x59d293[_0x7126('0x24')]=_0x1cbac8[_0x7126('0x4b')];if(_0x59d293['count']===0x0)return[];return db[_0x7126('0x9e')][_0x7126('0x46')](_0x3ab107[_0x7126('0x9f')](),_0x32e502)[_0x7126('0x2b')](function(_0x42b192){_0x1ccfeb=_[_0x7126('0xa0')](_0x42b192,'id');_0x32e502=_['merge'](_0x32e502,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x355521[_0x7126('0x46')][_0x7126('0x4a')]){_0x38ef14[_0x7126('0x49')][_0x7126('0x34')](function(_0x1bb858){_0x1c43ff[_0x7126('0x51')]('i.'+_0x1bb858);});}else{_0x1c43ff['field'](_0x7126('0xa1'),_0x7126('0x67'));_0x1c43ff[_0x7126('0x51')](_0x7126('0xa2'),_0x7126('0xa3'));_0x1c43ff[_0x7126('0x51')](_0x7126('0xa4'),'Account.mandatoryDisposition');_0x1c43ff[_0x7126('0x51')](_0x7126('0xa5'),_0x7126('0x95'));_0x1c43ff[_0x7126('0x51')](_0x7126('0xa6'));_0x1c43ff[_0x7126('0x51')](_0x7126('0xa7'),_0x7126('0xa8'));_0x1c43ff[_0x7126('0x51')](_0x7126('0xa9'),_0x7126('0xaa'));_0x1c43ff[_0x7126('0x51')](_0x7126('0xab'),_0x7126('0xac'));_0x1c43ff['field']('c.phone','Contact.phone');_0x1c43ff[_0x7126('0x51')]('c.mobile','Contact.mobile');_0x1c43ff['field'](_0x7126('0xad'),_0x7126('0xae'));_0x1c43ff[_0x7126('0x51')](_0x7126('0xaf'),_0x7126('0xb0'));_0x1c43ff[_0x7126('0x51')](_0x7126('0xb1'),_0x7126('0xb2'));_0x1c43ff[_0x7126('0x51')](_0x7126('0xb3'),_0x7126('0x32'));}if(_0x38ef14[_0x7126('0x22')])_0x1c43ff[_0x7126('0x22')](_0x38ef14[_0x7126('0x22')]);if(_0x38ef14[_0x7126('0x21')])_0x1c43ff[_0x7126('0x21')](_0x38ef14[_0x7126('0x21')]);return db[_0x7126('0x9e')]['query'](_0x1c43ff[_0x7126('0x9f')](),_0x32e502);})[_0x7126('0x2b')](function(_0x2a80f5){if(_0x2a80f5['length']>0x0)_0x13efb6['where'](_0x7126('0xb4'),_['map'](_0x2a80f5,'id'));return db['sequelize'][_0x7126('0x46')](_0x13efb6[_0x7126('0x9f')](),_0x32e502)[_0x7126('0x2b')](function(_0x2625fd){var _0x1c6ce0=_[_0x7126('0xb5')](_0x2625fd,_0x7126('0xb6'));var _0x1073f3=[];_0x2a80f5[_0x7126('0x34')](function(_0x250c23){_0x1073f3[_0x7126('0x35')](updateWhatsappInteraction(_0x250c23,_0x1ccfeb,_0x1c6ce0));});return BPromise[_0x7126('0xb7')](_0x1073f3);});});})[_0x7126('0x2b')](function(_0x2f0dc1){_0x59d293[_0x7126('0xb8')]=_0x2f0dc1;return _0x59d293;})[_0x7126('0x2b')](respondWithFilteredResult(_0x3d46ae,_0x38ef14))[_0x7126('0x36')](handleError(_0x3d46ae,null));};exports['show']=function(_0x3a4df4,_0x3738db){var _0x591290={'raw':![],'where':{'id':_0x3a4df4['params']['id']}},_0x3e18fd={};_0x3e18fd[_0x7126('0x44')]=_[_0x7126('0x45')](db[_0x7126('0x3f')][_0x7126('0x40')]);_0x3e18fd['query']=_[_0x7126('0x45')](_0x3a4df4[_0x7126('0x46')]);_0x3e18fd[_0x7126('0x47')]=_[_0x7126('0x48')](_0x3e18fd['model'],_0x3e18fd[_0x7126('0x46')]);_0x591290['attributes']=_[_0x7126('0x48')](_0x3e18fd['model'],qs['fields'](_0x3a4df4[_0x7126('0x46')][_0x7126('0x4a')]));_0x591290[_0x7126('0x49')]=_0x591290['attributes'][_0x7126('0x4b')]?_0x591290[_0x7126('0x49')]:_0x3e18fd['model'];if(_0x3a4df4[_0x7126('0x46')][_0x7126('0xb9')]){_0x591290[_0x7126('0xba')]=[{'all':!![]}];}_0x591290=_[_0x7126('0xbb')]({},_0x591290,_0x3a4df4[_0x7126('0xbc')]);return db['WhatsappInteraction'][_0x7126('0x66')](_0x591290)[_0x7126('0x2b')](handleEntityNotFound(_0x3738db,null))[_0x7126('0x2b')](respondWithResult(_0x3738db,null))['catch'](handleError(_0x3738db,null));};exports[_0x7126('0xbd')]=function(_0x496995,_0x58c75d){return db[_0x7126('0x3f')]['create'](_0x496995['body'],{})['then'](respondWithResult(_0x58c75d,0xc9))[_0x7126('0x36')](handleError(_0x58c75d,null));};exports[_0x7126('0xbe')]=function(_0x45f473,_0x490894){if(_0x45f473['body']['id']){delete _0x45f473['body']['id'];}return db[_0x7126('0x3f')][_0x7126('0x66')]({'where':{'id':_0x45f473[_0x7126('0xbf')]['id']}})['then'](handleEntityNotFound(_0x490894,null))[_0x7126('0x2b')](saveUpdates(_0x45f473[_0x7126('0x79')],null))['then'](respondWithResult(_0x490894,null))['catch'](handleError(_0x490894,null));};exports[_0x7126('0x2a')]=function(_0x52d5f6,_0x26f3c5){return db[_0x7126('0x3f')][_0x7126('0x66')]({'where':{'id':_0x52d5f6[_0x7126('0xbf')]['id']}})[_0x7126('0x2b')](handleEntityNotFound(_0x26f3c5,null))['then'](removeEntity(_0x26f3c5,null))[_0x7126('0x36')](handleError(_0x26f3c5,null));};exports[_0x7126('0xc0')]=function(_0x3be442,_0x35ba95){return db['WhatsappInteraction'][_0x7126('0xc0')]()[_0x7126('0x2b')](respondWithResult(_0x35ba95,null))[_0x7126('0x36')](handleError(_0x35ba95,null));};exports[_0x7126('0xc1')]=function(_0x3776ba,_0xaf91e7,_0x33a006){return db['WhatsappMessage'][_0x7126('0x66')]({'where':{'id':_0x3776ba[_0x7126('0xbf')]['id']}})[_0x7126('0x2b')](handleEntityNotFound(_0xaf91e7,null))[_0x7126('0x2b')](function(_0x37c3ef){if(_0x37c3ef){return _0x37c3ef[_0x7126('0xc1')](_0x3776ba[_0x7126('0x79')][_0x7126('0xc2')],_['omit'](_0x3776ba['body'],[_0x7126('0xc2'),'id'])||{});}})[_0x7126('0x2b')](respondWithResult(_0xaf91e7,null))['catch'](handleError(_0xaf91e7,null));};exports[_0x7126('0xc3')]=function(_0x5d375a,_0xc48804,_0x370652){var _0x130b48={'raw':![],'where':{}};var _0x2f0bc6={};var _0x12c86c={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x5d375a[_0x7126('0xbf')]['id']}})[_0x7126('0x2b')](handleEntityNotFound(_0xc48804,null))[_0x7126('0x2b')](function(_0x2836ad){if(_0x2836ad){_0x2f0bc6[_0x7126('0x44')]=_['keys'](db[_0x7126('0xc4')][_0x7126('0x40')]);_0x2f0bc6[_0x7126('0x46')]=_['keys'](_0x5d375a[_0x7126('0x46')]);_0x2f0bc6['filters']=_[_0x7126('0x48')](_0x2f0bc6['model'],_0x2f0bc6[_0x7126('0x46')]);_0x130b48['attributes']=_['intersection'](_0x2f0bc6[_0x7126('0x44')],qs[_0x7126('0x4a')](_0x5d375a[_0x7126('0x46')][_0x7126('0x4a')]));_0x130b48[_0x7126('0x49')]=_0x130b48[_0x7126('0x49')]['length']?_0x130b48[_0x7126('0x49')]:_0x2f0bc6[_0x7126('0x44')];if(!_0x5d375a['query'][_0x7126('0xc5')](_0x7126('0x4c'))){_0x130b48[_0x7126('0x22')]=qs[_0x7126('0x22')](_0x5d375a['query'][_0x7126('0x22')]);_0x130b48[_0x7126('0x21')]=qs[_0x7126('0x21')](_0x5d375a[_0x7126('0x46')][_0x7126('0x21')]);}_0x130b48[_0x7126('0x94')]=qs['sort'](_0x5d375a['query'][_0x7126('0x4d')]);_0x130b48[_0x7126('0x4e')]=qs['filters'](_[_0x7126('0x4f')](_0x5d375a['query'],_0x2f0bc6[_0x7126('0x47')]));_0x130b48[_0x7126('0x4e')]['WhatsappInteractionId']=_0x2836ad['id'];if(_0x5d375a[_0x7126('0x46')]['filter']){_0x130b48[_0x7126('0x4e')]=_[_0x7126('0xbb')](_0x130b48[_0x7126('0x4e')],{'$or':_['map'](_0x130b48['attributes'],function(_0x3c8efd){var _0x2125c9={};_0x2125c9[_0x3c8efd]={'$like':'%'+_0x5d375a[_0x7126('0x46')][_0x7126('0x89')]+'%'};return _0x2125c9;})});}if(_0x5d375a[_0x7126('0x46')]['$gte']){var _0x3e47fd=_0x5d375a[_0x7126('0x46')][_0x7126('0xc6')][_0x7126('0x33')](',');var _0x224737={};_0x224737[_0x3e47fd[0x0]]={'$gte':moment(_0x3e47fd[0x1])[_0x7126('0xc7')](_0x7126('0xc8'))};_0x130b48[_0x7126('0x4e')]=_[_0x7126('0xbb')](_0x130b48['where'],_0x224737);}_0x130b48=_[_0x7126('0xbb')]({},_0x130b48,_0x5d375a[_0x7126('0xbc')]);return db['WhatsappMessage']['count']({'where':_0x130b48[_0x7126('0x4e')]})[_0x7126('0x2b')](function(_0x5a6b7b){_0x12c86c[_0x7126('0x24')]=_0x5a6b7b;if(_0x5d375a[_0x7126('0x46')]['includeAll']){_0x130b48['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x7126('0xc9')](_0x130b48);})[_0x7126('0x2b')](function(_0x4835db){_0x12c86c[_0x7126('0xb8')]=_0x4835db;return _0x12c86c;});}})['then'](respondWithFilteredResult(_0xc48804,_0x130b48))[_0x7126('0x36')](handleError(_0xc48804,null));};exports[_0x7126('0xca')]=function(_0x3fe022,_0x5925a0,_0x27f779){return db['WhatsappInteraction'][_0x7126('0x66')]({'where':{'id':_0x3fe022[_0x7126('0xbf')]['id']}})['then'](handleEntityNotFound(_0x5925a0,null))[_0x7126('0x2b')](function(_0x1f4de1){if(_0x1f4de1){return _0x1f4de1[_0x7126('0xcb')](_0x3fe022['body']['ids'],_['omit'](_0x3fe022['body'],['ids','id'])||{})[_0x7126('0xcc')](function(){return db[_0x7126('0x73')][_0x7126('0xc9')]({'attributes':['id',_0x7126('0x2d'),'color'],'where':{'id':_0x3fe022[_0x7126('0x79')][_0x7126('0xc2')]}});})['then'](function(_0x2e571d){socket[_0x7126('0xcd')]('whatsappInteractionTags:save',{'id':Number(_0x3fe022['params']['id']),'tags':_0x2e571d||[]});return{'id':Number(_0x3fe022['params']['id']),'tags':_0x2e571d||[]};});}})[_0x7126('0x2b')](respondWithResult(_0x5925a0,null))[_0x7126('0x36')](handleError(_0x5925a0,null));};exports[_0x7126('0xce')]=function(_0x66e04c,_0x20edc5,_0xe55f11){return db[_0x7126('0x3f')][_0x7126('0x66')]({'where':{'id':_0x66e04c[_0x7126('0xbf')]['id']}})[_0x7126('0x2b')](handleEntityNotFound(_0x20edc5,null))['then'](function(_0x4d57e0){if(_0x4d57e0){return _0x4d57e0[_0x7126('0xce')](_0x66e04c['query'][_0x7126('0xc2')]);}})[_0x7126('0x2b')](respondWithStatusCode(_0x20edc5,null))[_0x7126('0x36')](handleError(_0x20edc5,null));};exports[_0x7126('0xcf')]=function(_0x394a1a,_0x22c7b3){var _0x1a11bc=moment()[_0x7126('0xd0')]()[_0x7126('0x9f')]();var _0x6cd35e=path[_0x7126('0xd1')](config[_0x7126('0xd2')],_0x7126('0xd3'),_0x7126('0xd4'),'tmp');var _0x6c12b=path[_0x7126('0xd1')](config['root'],_0x7126('0xd3'),'files',_0x7126('0xd5'));var _0x10d710=path[_0x7126('0xd1')](_0x6cd35e,_0x1a11bc);var _0x42a4e8=util[_0x7126('0xc7')]('transcript-%d-%s.zip',_0x394a1a[_0x7126('0xbf')]['id'],_0x1a11bc);var _0x5254d5=path[_0x7126('0xd1')](_0x6cd35e,_0x42a4e8);var _0x46e2b4=[];_0x46e2b4[_0x7126('0x35')]({'model':db['User'],'as':_0x7126('0x76'),'attributes':['id',_0x7126('0x31')],'raw':!![]});_0x46e2b4[_0x7126('0x35')]({'model':db[_0x7126('0xd6')],'as':_0x7126('0x6b'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x394a1a[_0x7126('0x46')][_0x7126('0xd5')]){_0x46e2b4[_0x7126('0x35')]({'model':db[_0x7126('0xd7')],'as':'Attachment','raw':!![]});}var _0x2c6c3f=[{'model':db[_0x7126('0xc4')],'as':'Messages','attributes':['id',_0x7126('0x79'),_0x7126('0x7e'),'direction',_0x7126('0xd8'),_0x7126('0x84')],'include':_0x46e2b4}];_0x2c6c3f['push']({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0x7126('0x2d')]});_0x2c6c3f['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x7126('0x31')]});return db[_0x7126('0x3f')][_0x7126('0x66')]({'where':{'id':_0x394a1a[_0x7126('0xbf')]['id']},'include':_0x2c6c3f})[_0x7126('0x2b')](handleEntityNotFound(_0x22c7b3,null))[_0x7126('0x2b')](function(_0xe48ecb){if(_0xe48ecb){var _0xceef05=_0xe48ecb['get']({'plain':!![]});fs[_0x7126('0xd9')](_0x10d710);var _0x442ae9={'channel':'Whatsapp','account':_0xceef05[_0x7126('0xda')][_0x7126('0x2d')],'agent':_0xceef05[_0x7126('0xdb')]?_0xceef05['Owner']['fullname']:'N.A.','createdAt':moment(_0xceef05[_0x7126('0x7e')])['format'](_0x7126('0xc8'))[_0x7126('0x9f')](),'closedAt':_0xceef05[_0x7126('0x3c')]?moment(_0xceef05[_0x7126('0xdc')])[_0x7126('0xc7')](_0x7126('0xc8'))[_0x7126('0x9f')]():'','disposition':_0xceef05[_0x7126('0xdd')],'messages':_(_0xceef05[_0x7126('0xde')])[_0x7126('0x89')]({'secret':![]})['map'](function(_0x319825){if(_0x319825['Attachment']){var _0x15e6ea=path['join'](_0x6c12b,_0x319825['Attachment']['basename']);if(fs['existsSync'](_0x15e6ea)){fs['createReadStream'](_0x15e6ea)[_0x7126('0xdf')](fs['createWriteStream'](path[_0x7126('0xd1')](_0x10d710,_0x319825['Attachment'][_0x7126('0xe0')])));}}return{'date':moment(_0x319825['createdAt'])['format'](_0x7126('0xc8'))[_0x7126('0x9f')](),'sender':_0x319825[_0x7126('0xe1')]===_0x7126('0xe2')?_0x319825[_0x7126('0x76')]?_0x319825[_0x7126('0x76')][_0x7126('0x31')]:_0x7126('0xe3'):_0x319825['Contact'][_0x7126('0xe4')]+(_0x319825[_0x7126('0x6b')][_0x7126('0xe5')]?'\x20'+_0x319825[_0x7126('0x6b')][_0x7126('0xe5')]:''),'body':_0x319825[_0x7126('0xd7')]?_0x319825[_0x7126('0xd7')]['basename']:_0x319825[_0x7126('0x79')],'direction':_0x319825['direction']===_0x7126('0xe2')?'A':'C','secret':_0x319825[_0x7126('0xd8')],'read':_0x319825[_0x7126('0x84')],'attachment':_0x319825[_0x7126('0xd7')]};})[_0x7126('0x68')]()};return ejs[_0x7126('0xe6')](path[_0x7126('0xd1')](config[_0x7126('0xd2')],_0x7126('0xd3'),_0x7126('0xe7'),_0x7126('0xe8')),{'interaction':_0x442ae9})[_0x7126('0x2b')](function(_0x4935b8){var _0x545f7f=path['join'](_0x10d710,_0x7126('0xe9')+_0xceef05['id']+'-'+_0x1a11bc+_0x7126('0xea'));var _0x2f2046={'path':_0x545f7f,'channel':'Whatsapp','interactionId':_0xceef05['id']};return pdf[_0x7126('0xeb')](_0x4935b8,_0x2f2046);})[_0x7126('0x2b')](function(){return new BPromise(function(_0x354bf7,_0x5e07ab){zipdir(_0x10d710,{'saveTo':_0x5254d5},function(_0x546539,_0x2a0f5f){if(_0x546539)return _0x5e07ab(_0x546539);return _0x354bf7(_0x2a0f5f);});})[_0x7126('0x2b')](function(){return new BPromise(function(_0x27505f,_0x55bbdc){rimraf(_0x10d710,function(_0x54ee7f){if(_0x54ee7f)_0x55bbdc(_0x54ee7f);return _0x27505f();});});})[_0x7126('0x2b')](function(){return _0x22c7b3[_0x7126('0xcf')](_0x5254d5,_0x42a4e8,function(_0x490d7b){if(_0x490d7b){console['log']('err',_0x490d7b);}else{fs[_0x7126('0xec')](_0x5254d5);}});});});}else{return _0x22c7b3[_0x7126('0x1e')](0xc8);}})['catch'](handleError(_0x22c7b3,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 5a17a48..dd7f105 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 _0x3276=['exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x3276,0xc7));var _0x6327=function(_0x3c3f11,_0x4b8955){_0x3c3f11=_0x3c3f11-0x0;var _0x93a167=_0x3276[_0x3c3f11];return _0x93a167;};'use strict';var EventEmitter=require(_0x6327('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x6327('0x1'))['db'][_0x6327('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x6327('0x3')](0x0);var events={'afterCreate':_0x6327('0x4'),'afterUpdate':_0x6327('0x5'),'afterDestroy':_0x6327('0x6')};function emitEvent(_0x436055){return function(_0x4e3309,_0x56405e,_0x10b982){_0x4e3309[_0x6327('0x7')]({'attributes':['id'],'raw':!![]})[_0x6327('0x8')](function(_0x498821){_0x4e3309[_0x6327('0x9')](_0x6327('0xa'),_0x498821[_0x6327('0xb')](function(_0x1dc34b){return{'id':_0x1dc34b['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x4e3309['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6327('0x8')](function(_0x1687c4){_0x4e3309['setDataValue'](_0x6327('0xc'),_0x1687c4[_0x6327('0xd')]);WhatsappInteractionEvents['emit'](_0x436055+':'+_0x4e3309['id'],_0x4e3309);WhatsappInteractionEvents[_0x6327('0xe')](_0x436055,_0x4e3309);_0x10b982(null);})[_0x6327('0xf')](_0x10b982(null));};}for(var e in events){if(events[_0x6327('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x6327('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x2750=['then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2750,0x13b));var _0x0275=function(_0x438949,_0x16da7c){_0x438949=_0x438949-0x0;var _0x2f0169=_0x2750[_0x438949];return _0x2f0169;};'use strict';var EventEmitter=require(_0x0275('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x0275('0x1')];var WhatsappMessage=require(_0x0275('0x2'))['db'][_0x0275('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x0275('0x4')](0x0);var events={'afterCreate':_0x0275('0x5'),'afterUpdate':_0x0275('0x6'),'afterDestroy':_0x0275('0x7')};function emitEvent(_0x4960){return function(_0x3d0c9c,_0x1aa839,_0x5953f9){_0x3d0c9c[_0x0275('0x8')]({'attributes':['id'],'raw':!![]})[_0x0275('0x9')](function(_0x2fa0eb){_0x3d0c9c[_0x0275('0xa')]('Users',_0x2fa0eb[_0x0275('0xb')](function(_0x30632d){return{'id':_0x30632d['id']};}));return WhatsappMessage[_0x0275('0xc')]({'where':{'WhatsappInteractionId':_0x3d0c9c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5ae225){_0x3d0c9c[_0x0275('0xa')]('unreadMessages',_0x5ae225[_0x0275('0xd')]);WhatsappInteractionEvents[_0x0275('0xe')](_0x4960+':'+_0x3d0c9c['id'],_0x3d0c9c);WhatsappInteractionEvents[_0x0275('0xe')](_0x4960,_0x3d0c9c);_0x5953f9(null);})[_0x0275('0xf')](_0x5953f9(null));};}for(var e in events){if(events[_0x0275('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x0275('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index e29ed98..b436c5f 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 _0x4fd0=['closed','YYYY-MM-DD\x20HH:mm:ss','api','bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','WhatsappInteraction','whatsapp_interactions','changed'];(function(_0x2428d8,_0x52169f){var _0x4908cb=function(_0x4ac53d){while(--_0x4ac53d){_0x2428d8['push'](_0x2428d8['shift']());}};_0x4908cb(++_0x52169f);}(_0x4fd0,0x1f1));var _0x04fd=function(_0x3cf150,_0x178cb5){_0x3cf150=_0x3cf150-0x0;var _0x931f8b=_0x4fd0[_0x3cf150];return _0x931f8b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x04fd('0x0'));var moment=require('moment');var BPromise=require(_0x04fd('0x1'));var rp=require(_0x04fd('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04fd('0x3'));var config=require(_0x04fd('0x4'));var attributes=require(_0x04fd('0x5'));module['exports']=function(_0x516f33,_0x7f8f7d){return _0x516f33['define'](_0x04fd('0x6'),attributes,{'tableName':_0x04fd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3be3c2,_0x1d5cfd,_0x3b4888){if(_0x3be3c2[_0x04fd('0x8')](_0x04fd('0x9'))){_0x3be3c2['closedAt']=moment()['format'](_0x04fd('0xa'));}_0x3b4888(null,_0x3be3c2);}}});}; \ No newline at end of file +var _0xaeff=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x10c4d9,_0x595315){var _0x177edc=function(_0x51f32b){while(--_0x51f32b){_0x10c4d9['push'](_0x10c4d9['shift']());}};_0x177edc(++_0x595315);}(_0xaeff,0x71));var _0xfaef=function(_0x347c0a,_0x1c4cc4){_0x347c0a=_0x347c0a-0x0;var _0x4f2e7b=_0xaeff[_0x347c0a];return _0x4f2e7b;};'use strict';var _=require(_0xfaef('0x0'));var util=require('util');var logger=require(_0xfaef('0x1'))(_0xfaef('0x2'));var moment=require(_0xfaef('0x3'));var BPromise=require(_0xfaef('0x4'));var rp=require(_0xfaef('0x5'));var fs=require('fs');var path=require(_0xfaef('0x6'));var rimraf=require(_0xfaef('0x7'));var config=require(_0xfaef('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0xfaef('0x9')]=function(_0x13850f,_0x493beb){return _0x13850f[_0xfaef('0xa')](_0xfaef('0xb'),attributes,{'tableName':_0xfaef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x399dd5,_0x35a14a,_0x2b3809){if(_0x399dd5[_0xfaef('0xd')](_0xfaef('0xe'))){_0x399dd5[_0xfaef('0xf')]=moment()[_0xfaef('0x10')](_0xfaef('0x11'));}_0x2b3809(null,_0x399dd5);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index c46a3cb..4eec051 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 _0x1aa2=['find','then','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction'];(function(_0x40886d,_0x5c4dd7){var _0x58959a=function(_0xbbd4a6){while(--_0xbbd4a6){_0x40886d['push'](_0x40886d['shift']());}};_0x58959a(++_0x5c4dd7);}(_0x1aa2,0x88));var _0x21aa=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0x1aa2[_0x3fe6df];return _0x372a0e;};'use strict';var _=require(_0x21aa('0x0'));var util=require(_0x21aa('0x1'));var moment=require('moment');var BPromise=require(_0x21aa('0x2'));var rs=require(_0x21aa('0x3'));var fs=require('fs');var Redis=require(_0x21aa('0x4'));var db=require(_0x21aa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x21aa('0x6'))(_0x21aa('0x7'));var config=require('../../config/environment');var jayson=require(_0x21aa('0x8'));var client=jayson[_0x21aa('0x9')][_0x21aa('0xa')]({'port':0x232a});config[_0x21aa('0xb')]=_[_0x21aa('0xc')](config[_0x21aa('0xb')],{'host':_0x21aa('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x21aa('0xe'))[_0x21aa('0xf')](socket);function respondWithRpcPromise(_0x50e850,_0x506f87,_0x7b3702){return new BPromise(function(_0x2e873a,_0x250569){return client[_0x21aa('0x10')](_0x50e850,_0x7b3702)['then'](function(_0x5c9e99){logger[_0x21aa('0x11')](_0x21aa('0x12'),_0x506f87,'request\x20sent');logger[_0x21aa('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x506f87,_0x21aa('0x14'),JSON[_0x21aa('0x15')](_0x5c9e99));if(_0x5c9e99[_0x21aa('0x16')]){if(_0x5c9e99['error'][_0x21aa('0x17')]===0x1f4){logger[_0x21aa('0x16')](_0x21aa('0x12'),_0x506f87,_0x5c9e99[_0x21aa('0x16')][_0x21aa('0x18')]);return _0x250569(_0x5c9e99[_0x21aa('0x16')][_0x21aa('0x18')]);}logger[_0x21aa('0x16')](_0x21aa('0x12'),_0x506f87,_0x5c9e99[_0x21aa('0x16')][_0x21aa('0x18')]);return _0x2e873a(_0x5c9e99[_0x21aa('0x16')][_0x21aa('0x18')]);}else{logger[_0x21aa('0x11')](_0x21aa('0x12'),_0x506f87,_0x21aa('0x14'));_0x2e873a(_0x5c9e99['result']['message']);}})[_0x21aa('0x19')](function(_0x3056e2){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x506f87,_0x3056e2);_0x250569(_0x3056e2);});});}exports[_0x21aa('0x1a')]=function(_0x22c00f){var _0x1b0ec9=this;return new Promise(function(_0x3e7bdc,_0xace525){return db[_0x21aa('0x1b')][_0x21aa('0x1c')](_0x22c00f[_0x21aa('0x1d')],{'raw':_0x22c00f['options']?_0x22c00f[_0x21aa('0x1e')][_0x21aa('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22c00f['options']?_0x22c00f[_0x21aa('0x1e')][_0x21aa('0x20')]||null:null,'attributes':_0x22c00f[_0x21aa('0x1e')]?_0x22c00f['options'][_0x21aa('0x21')]||null:null,'limit':_0x22c00f[_0x21aa('0x1e')]?_0x22c00f['options'][_0x21aa('0x22')]||null:null})['then'](function(_0x374e88){logger[_0x21aa('0x11')](_0x21aa('0x1a'),_0x22c00f);logger[_0x21aa('0x13')]('UpdateWhatsappInteraction',_0x22c00f,JSON[_0x21aa('0x15')](_0x374e88));_0x3e7bdc(_0x374e88);})['catch'](function(_0x2b59c3){logger[_0x21aa('0x16')](_0x21aa('0x1a'),_0x2b59c3[_0x21aa('0x18')],_0x22c00f);_0xace525(_0x1b0ec9[_0x21aa('0x16')](0x1f4,_0x2b59c3[_0x21aa('0x18')]));});});};exports[_0x21aa('0x23')]=function(_0xca97f4){return new Promise(function(_0x2a5847,_0x57a175){return db['WhatsappInteraction'][_0x21aa('0x24')]({'where':_0xca97f4[_0x21aa('0x1e')]?_0xca97f4['options'][_0x21aa('0x20')]||null:null})[_0x21aa('0x25')](function(_0x24418c){if(_0x24418c){return _0x24418c[_0x21aa('0x26')](_0xca97f4['body'][_0x21aa('0x27')],_[_0x21aa('0x28')](_0xca97f4['body'],[_0x21aa('0x27'),'id'])||{});}})[_0x21aa('0x29')](function(_0x1b1277){logger[_0x21aa('0x11')](_0x21aa('0x2a'),_0xca97f4);logger[_0x21aa('0x13')](_0x21aa('0x2a'),_0xca97f4,JSON[_0x21aa('0x15')](_0x1b1277));_0x2a5847(_0x1b1277);})[_0x21aa('0x19')](function(_0xbadbc6){logger[_0x21aa('0x16')](_0x21aa('0x2a'),_0xbadbc6['message'],_0xca97f4);_0x57a175(_this[_0x21aa('0x16')](0x1f4,_0xbadbc6[_0x21aa('0x18')]));});});}; \ No newline at end of file +var _0x554e=['where','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','then','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappInteraction,\x20%s,\x20%s','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','attributes','limit','info','AddTagsToWhatsappInteraction','find'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x554e,0xb1));var _0xe554=function(_0x68c4d9,_0x419b3c){_0x68c4d9=_0x68c4d9-0x0;var _0x62da93=_0x554e[_0x68c4d9];return _0x62da93;};'use strict';var _=require(_0xe554('0x0'));var util=require('util');var moment=require(_0xe554('0x1'));var BPromise=require(_0xe554('0x2'));var rs=require(_0xe554('0x3'));var fs=require('fs');var Redis=require(_0xe554('0x4'));var db=require(_0xe554('0x5'))['db'];var utils=require(_0xe554('0x6'));var logger=require(_0xe554('0x7'))(_0xe554('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe554('0x9')]['http']({'port':0x232a});config[_0xe554('0xa')]=_[_0xe554('0xb')](config[_0xe554('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe554('0xc'))(new Redis(config[_0xe554('0xa')]));require(_0xe554('0xd'))[_0xe554('0xe')](socket);function respondWithRpcPromise(_0x4e1055,_0x14f27b,_0x5242c5){return new BPromise(function(_0x592798,_0x3426ed){return client[_0xe554('0xf')](_0x4e1055,_0x5242c5)[_0xe554('0x10')](function(_0x2d48b0){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x14f27b,'request\x20sent');logger[_0xe554('0x11')](_0xe554('0x12'),_0x14f27b,_0xe554('0x13'),JSON[_0xe554('0x14')](_0x2d48b0));if(_0x2d48b0['error']){if(_0x2d48b0[_0xe554('0x15')][_0xe554('0x16')]===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x14f27b,_0x2d48b0['error']['message']);return _0x3426ed(_0x2d48b0[_0xe554('0x15')][_0xe554('0x17')]);}logger[_0xe554('0x15')](_0xe554('0x18'),_0x14f27b,_0x2d48b0[_0xe554('0x15')]['message']);return _0x592798(_0x2d48b0[_0xe554('0x15')][_0xe554('0x17')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x14f27b,_0xe554('0x13'));_0x592798(_0x2d48b0[_0xe554('0x19')]['message']);}})[_0xe554('0x1a')](function(_0x142ce2){logger[_0xe554('0x15')](_0xe554('0x18'),_0x14f27b,_0x142ce2);_0x3426ed(_0x142ce2);});});}exports[_0xe554('0x1b')]=function(_0x4e56d0){var _0x1bed9c=this;return new Promise(function(_0x29c7f7,_0x5effe0){return db[_0xe554('0x1c')][_0xe554('0x1d')](_0x4e56d0[_0xe554('0x1e')],{'raw':_0x4e56d0['options']?_0x4e56d0[_0xe554('0x1f')][_0xe554('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e56d0[_0xe554('0x1f')]?_0x4e56d0['options']['where']||null:null,'attributes':_0x4e56d0[_0xe554('0x1f')]?_0x4e56d0[_0xe554('0x1f')][_0xe554('0x21')]||null:null,'limit':_0x4e56d0['options']?_0x4e56d0[_0xe554('0x1f')][_0xe554('0x22')]||null:null})['then'](function(_0x474872){logger[_0xe554('0x23')](_0xe554('0x1b'),_0x4e56d0);logger[_0xe554('0x11')](_0xe554('0x1b'),_0x4e56d0,JSON['stringify'](_0x474872));_0x29c7f7(_0x474872);})['catch'](function(_0x3cfe39){logger[_0xe554('0x15')](_0xe554('0x1b'),_0x3cfe39[_0xe554('0x17')],_0x4e56d0);_0x5effe0(_0x1bed9c[_0xe554('0x15')](0x1f4,_0x3cfe39[_0xe554('0x17')]));});});};exports[_0xe554('0x24')]=function(_0x47462e){return new Promise(function(_0x2cb01f,_0x3071da){return db[_0xe554('0x1c')][_0xe554('0x25')]({'where':_0x47462e[_0xe554('0x1f')]?_0x47462e[_0xe554('0x1f')][_0xe554('0x26')]||null:null})[_0xe554('0x10')](function(_0x22c27e){if(_0x22c27e){return _0x22c27e['addTags'](_0x47462e[_0xe554('0x1e')][_0xe554('0x27')],_[_0xe554('0x28')](_0x47462e['body'],[_0xe554('0x27'),'id'])||{});}})[_0xe554('0x29')](function(_0x517b1e){logger[_0xe554('0x23')](_0xe554('0x2a'),_0x47462e);logger[_0xe554('0x11')]('AddTags',_0x47462e,JSON[_0xe554('0x14')](_0x517b1e));_0x2cb01f(_0x517b1e);})[_0xe554('0x1a')](function(_0x14344a){logger[_0xe554('0x15')](_0xe554('0x2a'),_0x14344a['message'],_0x47462e);_0x3071da(_this[_0xe554('0x15')](0x1f4,_0x14344a['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 39f48cc..498301c 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 _0x3509=['removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save','update'];(function(_0x18a34c,_0xb7ebdd){var _0x16d9b4=function(_0x5f4e90){while(--_0x5f4e90){_0x18a34c['push'](_0x18a34c['shift']());}};_0x16d9b4(++_0xb7ebdd);}(_0x3509,0x6d));var _0x9350=function(_0x14b767,_0x577e84){_0x14b767=_0x14b767-0x0;var _0x22267a=_0x3509[_0x14b767];return _0x22267a;};'use strict';var WhatsappInteractionEvents=require(_0x9350('0x0'));var events=[_0x9350('0x1'),'remove',_0x9350('0x2')];function createListener(_0x529bbc,_0xa4b161){return function(_0x3ae55a){_0xa4b161['emit'](_0x529bbc,_0x3ae55a);};}function removeListener(_0x4582da,_0x5825ad){return function(){WhatsappInteractionEvents[_0x9350('0x3')](_0x4582da,_0x5825ad);};}exports[_0x9350('0x4')]=function(_0x4f1492){for(var _0x234ed6=0x0,_0x4dceef=events[_0x9350('0x5')];_0x234ed6<_0x4dceef;_0x234ed6++){var _0x4da593=events[_0x234ed6];var _0x4397e9=createListener(_0x9350('0x6')+_0x4da593,_0x4f1492);WhatsappInteractionEvents['on'](_0x4da593,_0x4397e9);}}; \ No newline at end of file +var _0xace4=['update','emit','register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove'];(function(_0xe936ba,_0x3b9485){var _0x17d0bb=function(_0x49f97d){while(--_0x49f97d){_0xe936ba['push'](_0xe936ba['shift']());}};_0x17d0bb(++_0x3b9485);}(_0xace4,0x1a5));var _0x4ace=function(_0x4e0026,_0x2b52b6){_0x4e0026=_0x4e0026-0x0;var _0x3f8ee7=_0xace4[_0x4e0026];return _0x3f8ee7;};'use strict';var WhatsappInteractionEvents=require(_0x4ace('0x0'));var events=[_0x4ace('0x1'),_0x4ace('0x2'),_0x4ace('0x3')];function createListener(_0x34bd98,_0x2d3fef){return function(_0x574480){_0x2d3fef[_0x4ace('0x4')](_0x34bd98,_0x574480);};}function removeListener(_0x35091c,_0x893e6c){return function(){WhatsappInteractionEvents['removeListener'](_0x35091c,_0x893e6c);};}exports[_0x4ace('0x5')]=function(_0x1ea020){for(var _0x4b04cd=0x0,_0x46b79c=events[_0x4ace('0x6')];_0x4b04cd<_0x46b79c;_0x4b04cd++){var _0x496878=events[_0x4b04cd];var _0x883f4f=createListener(_0x4ace('0x7')+_0x496878,_0x1ea020);WhatsappInteractionEvents['on'](_0x496878,_0x883f4f);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 3aae4a6..f667eff 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 _0x0ee7=['post','whatsapp','whatsappmessage:create','create','/:id/status','put','update','/:id/accept','reject','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x502760,_0x3171c1){var _0x2e06db=function(_0xba6d5d){while(--_0xba6d5d){_0x502760['push'](_0x502760['shift']());}};_0x2e06db(++_0x3171c1);}(_0x0ee7,0x112));var _0x70ee=function(_0x4d9f21,_0x38b7b1){_0x4d9f21=_0x4d9f21-0x0;var _0x548ad9=_0x0ee7[_0x4d9f21];return _0x548ad9;};'use strict';var multer=require(_0x70ee('0x0'));var util=require('util');var path=require(_0x70ee('0x1'));var timeout=require(_0x70ee('0x2'));var express=require(_0x70ee('0x3'));var router=express['Router']();var fs_extra=require(_0x70ee('0x4'));var auth=require(_0x70ee('0x5'));var interaction=require(_0x70ee('0x6'));var config=require(_0x70ee('0x7'));var controller=require(_0x70ee('0x8'));router[_0x70ee('0x9')]('/',auth[_0x70ee('0xa')](),controller[_0x70ee('0xb')]);router[_0x70ee('0x9')](_0x70ee('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x70ee('0x9')](_0x70ee('0xd'),auth[_0x70ee('0xa')](),controller['show']);router[_0x70ee('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x70ee('0xf'),_0x70ee('0x10')),controller[_0x70ee('0x11')]);router[_0x70ee('0xe')](_0x70ee('0x12'),controller['status']);router[_0x70ee('0x13')](_0x70ee('0xd'),auth[_0x70ee('0xa')](),controller[_0x70ee('0x14')]);router[_0x70ee('0x13')](_0x70ee('0x15'),auth[_0x70ee('0xa')](),controller['accept']);router[_0x70ee('0x13')]('/:id/reject',auth[_0x70ee('0xa')](),controller[_0x70ee('0x16')]);router['delete'](_0x70ee('0xd'),auth[_0x70ee('0xa')](),controller[_0x70ee('0x17')]);module['exports']=router; \ No newline at end of file +var _0x8214=['status','put','/:id/accept','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','/describe','isAuthenticated','/:id','post','tracked','whatsapp','whatsappmessage:create','/:id/status'];(function(_0x4d21ff,_0x19d202){var _0x22b554=function(_0x4473c5){while(--_0x4473c5){_0x4d21ff['push'](_0x4d21ff['shift']());}};_0x22b554(++_0x19d202);}(_0x8214,0xd6));var _0x4821=function(_0x560926,_0x40cb40){_0x560926=_0x560926-0x0;var _0x3fdaae=_0x8214[_0x560926];return _0x3fdaae;};'use strict';var multer=require(_0x4821('0x0'));var util=require(_0x4821('0x1'));var path=require(_0x4821('0x2'));var timeout=require(_0x4821('0x3'));var express=require(_0x4821('0x4'));var router=express[_0x4821('0x5')]();var fs_extra=require(_0x4821('0x6'));var auth=require(_0x4821('0x7'));var interaction=require(_0x4821('0x8'));var config=require(_0x4821('0x9'));var controller=require(_0x4821('0xa'));router[_0x4821('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4821('0xb')](_0x4821('0xc'),auth[_0x4821('0xd')](),controller['describe']);router['get'](_0x4821('0xe'),auth[_0x4821('0xd')](),controller['show']);router[_0x4821('0xf')]('/',auth[_0x4821('0xd')](),interaction[_0x4821('0x10')](_0x4821('0x11'),_0x4821('0x12')),controller['create']);router['post'](_0x4821('0x13'),controller[_0x4821('0x14')]);router['put'](_0x4821('0xe'),auth[_0x4821('0xd')](),controller['update']);router[_0x4821('0x15')](_0x4821('0x16'),auth['isAuthenticated'](),controller['accept']);router[_0x4821('0x15')]('/:id/reject',auth[_0x4821('0xd')](),controller[_0x4821('0x17')]);router[_0x4821('0x18')](_0x4821('0xe'),auth['isAuthenticated'](),controller[_0x4821('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 3dceed2..20d1bfe 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 _0x9116=['BOOLEAN','sequelize','TEXT','medium','ENUM','out','STRING','DATE'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x9116,0x111));var _0x6911=function(_0x47faad,_0x230b04){_0x47faad=_0x47faad-0x0;var _0x4c449a=_0x9116[_0x47faad];return _0x4c449a;};'use strict';var Sequelize=require(_0x6911('0x0'));module['exports']={'body':{'type':Sequelize[_0x6911('0x1')](_0x6911('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6911('0x3')]('in','out'),'defaultValue':_0x6911('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x6911('0x5')]},'readAt':{'type':Sequelize[_0x6911('0x6')]},'secret':{'type':Sequelize[_0x6911('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x6911('0x5')]},'providerResponse':{'type':Sequelize[_0x6911('0x1')]}}; \ No newline at end of file +var _0x54f1=['DATE','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x42e825,_0x32eef9){var _0xde642b=function(_0x211be2){while(--_0x211be2){_0x42e825['push'](_0x42e825['shift']());}};_0xde642b(++_0x32eef9);}(_0x54f1,0x159));var _0x154f=function(_0x322364,_0x46d8ae){_0x322364=_0x322364-0x0;var _0xc78a7a=_0x54f1[_0x322364];return _0xc78a7a;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x154f('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x154f('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x154f('0x2')]('in',_0x154f('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x154f('0x4')](0xbe)},'phone':{'type':Sequelize[_0x154f('0x4')]},'readAt':{'type':Sequelize[_0x154f('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x154f('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index c2d51e8..f15850b 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 _0xc1d5=['AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','fullname','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','jayson/promise','client','http','request','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','show','params','filters','length','options','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','agent','UserId','get','WhatsappInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','info','user','role','null'];(function(_0x4a30cf,_0x312dd4){var _0x4d975b=function(_0x170368){while(--_0x170368){_0x4a30cf['push'](_0x4a30cf['shift']());}};_0x4d975b(++_0x312dd4);}(_0xc1d5,0x1ca));var _0x5c1d=function(_0x35d291,_0x1a131b){_0x35d291=_0x35d291-0x0;var _0x370b86=_0xc1d5[_0x35d291];return _0x370b86;};'use strict';var emlformat=require(_0x5c1d('0x0'));var rimraf=require(_0x5c1d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c1d('0x2'));var rp=require(_0x5c1d('0x3'));var moment=require(_0x5c1d('0x4'));var BPromise=require(_0x5c1d('0x5'));var Mustache=require(_0x5c1d('0x6'));var util=require('util');var path=require(_0x5c1d('0x7'));var sox=require('sox');var csv=require(_0x5c1d('0x8'));var ejs=require(_0x5c1d('0x9'));var fs=require('fs');var fs_extra=require(_0x5c1d('0xa'));var _=require('lodash');var squel=require(_0x5c1d('0xb'));var crypto=require('crypto');var jsforce=require(_0x5c1d('0xc'));var deskjs=require(_0x5c1d('0xd'));var toCsv=require(_0x5c1d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5c1d('0xe'));var authService=require(_0x5c1d('0xf'));var qs=require(_0x5c1d('0x10'));var as=require(_0x5c1d('0x11'));var hardwareService=require(_0x5c1d('0x12'));var logger=require(_0x5c1d('0x13'))(_0x5c1d('0x14'));var utils=require(_0x5c1d('0x15'));var config=require(_0x5c1d('0x16'));var licenseUtil=require(_0x5c1d('0x17'));var db=require(_0x5c1d('0x18'))['db'];config['redis']=_[_0x5c1d('0x19')](config[_0x5c1d('0x1a')],{'host':_0x5c1d('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c1d('0x1a')]));require('./whatsappMessage.socket')[_0x5c1d('0x1c')](socket);var jayson=require(_0x5c1d('0x1d'));var client=jayson[_0x5c1d('0x1e')][_0x5c1d('0x1f')]({'port':0x232c});var client9002=jayson[_0x5c1d('0x1e')][_0x5c1d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x44c0a0,_0x559aa1,_0x1f0b43,_0x37ea5d){return new BPromise(function(_0xb92383,_0x36d27c){var _0x38f6fb=_0x37ea5d||client;return _0x38f6fb[_0x5c1d('0x20')](_0x44c0a0,_0x1f0b43)['then'](function(_0x1b25c7){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x559aa1,'request\x20sent');logger[_0x5c1d('0x21')](_0x5c1d('0x22'),_0x559aa1,_0x5c1d('0x23'),JSON[_0x5c1d('0x24')](_0x1b25c7));if(_0x1b25c7[_0x5c1d('0x25')]){if(_0x1b25c7['error'][_0x5c1d('0x26')]===0x1f4){logger[_0x5c1d('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x559aa1,_0x1b25c7[_0x5c1d('0x25')][_0x5c1d('0x27')]);return _0x36d27c(_0x1b25c7['error'][_0x5c1d('0x27')]);}logger[_0x5c1d('0x25')](_0x5c1d('0x28'),_0x559aa1,_0x1b25c7[_0x5c1d('0x25')]['message']);return _0xb92383(_0x1b25c7[_0x5c1d('0x25')][_0x5c1d('0x27')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x559aa1,_0x5c1d('0x23'));_0xb92383(_0x1b25c7[_0x5c1d('0x29')][_0x5c1d('0x27')]);}})[_0x5c1d('0x2a')](function(_0x20bc37){logger[_0x5c1d('0x25')](_0x5c1d('0x28'),_0x559aa1,_0x20bc37);_0x36d27c(_0x20bc37);});});}function respondWithStatusCode(_0x327498,_0x4f6195){_0x4f6195=_0x4f6195||0xcc;return function(_0x2e7e4b){if(_0x2e7e4b){return _0x327498['sendStatus'](_0x4f6195);}return _0x327498[_0x5c1d('0x2b')](_0x4f6195)['end']();};}function respondWithResult(_0x34cb9a,_0x371aa1){_0x371aa1=_0x371aa1||0xc8;return function(_0x2a771e){if(_0x2a771e){return _0x34cb9a[_0x5c1d('0x2b')](_0x371aa1)[_0x5c1d('0x2c')](_0x2a771e);}};}function respondWithFilteredResult(_0x136036,_0x510203){return function(_0x41150a){if(_0x41150a){var _0x2aa7d7=typeof _0x510203[_0x5c1d('0x2d')]===_0x5c1d('0x2e')&&typeof _0x510203[_0x5c1d('0x2f')]===_0x5c1d('0x2e');var _0x5d2706=_0x41150a[_0x5c1d('0x30')];var _0x4391d0=_0x2aa7d7?0x0:_0x510203[_0x5c1d('0x2d')];var _0x288087=_0x2aa7d7?_0x41150a[_0x5c1d('0x30')]:_0x510203[_0x5c1d('0x2d')]+_0x510203['limit'];var _0x47403d;if(_0x288087>=_0x5d2706){_0x288087=_0x5d2706;_0x47403d=0xc8;}else{_0x47403d=0xce;}_0x136036['status'](_0x47403d);return _0x136036[_0x5c1d('0x31')](_0x5c1d('0x32'),_0x4391d0+'-'+_0x288087+'/'+_0x5d2706)[_0x5c1d('0x2c')](_0x41150a);}return null;};}function patchUpdates(_0x247e4d){return function(_0x333eed){try{jsonpatch[_0x5c1d('0x33')](_0x333eed,_0x247e4d,!![]);}catch(_0x19b6bb){return BPromise[_0x5c1d('0x34')](_0x19b6bb);}return _0x333eed[_0x5c1d('0x35')]();};}function saveUpdates(_0x51c2c3,_0xabc050){return function(_0x3abba3){if(_0x3abba3){return _0x3abba3[_0x5c1d('0x36')](_0x51c2c3)[_0x5c1d('0x37')](function(_0x55f97d){return _0x55f97d;});}return null;};}function removeEntity(_0x73a0bc,_0x3b11d0){return function(_0x30ab7e){if(_0x30ab7e){return _0x30ab7e['destroy']()[_0x5c1d('0x37')](function(){_0x73a0bc[_0x5c1d('0x2b')](0xcc)[_0x5c1d('0x38')]();});}};}function handleEntityNotFound(_0x3f1c46,_0x3d0352){return function(_0x1eea0c){if(!_0x1eea0c){_0x3f1c46[_0x5c1d('0x39')](0x194);}return _0x1eea0c;};}function handleError(_0x43e20f,_0x457f74){_0x457f74=_0x457f74||0x1f4;return function(_0x13e399){logger[_0x5c1d('0x25')](_0x13e399[_0x5c1d('0x3a')]);if(_0x13e399[_0x5c1d('0x3b')]){delete _0x13e399[_0x5c1d('0x3b')];}_0x43e20f[_0x5c1d('0x2b')](_0x457f74)[_0x5c1d('0x3c')](_0x13e399);};}exports[_0x5c1d('0x3d')]=function(_0x78794f,_0x1d4da6){var _0x4208ef={},_0x56dda4={},_0x280876={'count':0x0,'rows':[]};var _0x13174b=_[_0x5c1d('0x3e')](db[_0x5c1d('0x3f')][_0x5c1d('0x40')],function(_0x4858d6){return{'name':_0x4858d6[_0x5c1d('0x41')],'type':_0x4858d6[_0x5c1d('0x42')]['key']};});_0x56dda4[_0x5c1d('0x43')]=_[_0x5c1d('0x3e')](_0x13174b,_0x5c1d('0x3b'));_0x56dda4[_0x5c1d('0x44')]=_[_0x5c1d('0x45')](_0x78794f[_0x5c1d('0x44')]);_0x56dda4['filters']=_[_0x5c1d('0x46')](_0x56dda4['model'],_0x56dda4[_0x5c1d('0x44')]);_0x4208ef[_0x5c1d('0x47')]=_['intersection'](_0x56dda4['model'],qs[_0x5c1d('0x48')](_0x78794f[_0x5c1d('0x44')][_0x5c1d('0x48')]));_0x4208ef[_0x5c1d('0x47')]=_0x4208ef[_0x5c1d('0x47')]['length']?_0x4208ef[_0x5c1d('0x47')]:_0x56dda4[_0x5c1d('0x43')];if(!_0x78794f['query'][_0x5c1d('0x49')]('nolimit')){_0x4208ef[_0x5c1d('0x2f')]=qs[_0x5c1d('0x2f')](_0x78794f[_0x5c1d('0x44')][_0x5c1d('0x2f')]);_0x4208ef[_0x5c1d('0x2d')]=qs[_0x5c1d('0x2d')](_0x78794f[_0x5c1d('0x44')]['offset']);}_0x4208ef[_0x5c1d('0x4a')]=qs[_0x5c1d('0x4b')](_0x78794f[_0x5c1d('0x44')][_0x5c1d('0x4b')]);_0x4208ef[_0x5c1d('0x4c')]=qs['filters'](_[_0x5c1d('0x4d')](_0x78794f[_0x5c1d('0x44')],_0x56dda4['filters']),_0x13174b);if(_0x78794f[_0x5c1d('0x44')][_0x5c1d('0x4e')]){_0x4208ef['where']=_['merge'](_0x4208ef['where'],{'$or':_[_0x5c1d('0x3e')](_0x13174b,function(_0x302ee6){if(_0x302ee6[_0x5c1d('0x42')]!==_0x5c1d('0x4f')){var _0x2ddddd={};_0x2ddddd[_0x302ee6[_0x5c1d('0x3b')]]={'$like':'%'+_0x78794f[_0x5c1d('0x44')][_0x5c1d('0x4e')]+'%'};return _0x2ddddd;}})});}_0x4208ef=_[_0x5c1d('0x50')]({},_0x4208ef,_0x78794f['options']);var _0x4056e2={'where':_0x4208ef[_0x5c1d('0x4c')]};return db[_0x5c1d('0x3f')][_0x5c1d('0x30')](_0x4056e2)['then'](function(_0x17842a){_0x280876[_0x5c1d('0x30')]=_0x17842a;if(_0x78794f[_0x5c1d('0x44')][_0x5c1d('0x51')]){_0x4208ef[_0x5c1d('0x52')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x4208ef);})[_0x5c1d('0x37')](function(_0x279cbf){_0x280876['rows']=_0x279cbf;return _0x280876;})['then'](respondWithFilteredResult(_0x1d4da6,_0x4208ef))[_0x5c1d('0x2a')](handleError(_0x1d4da6,null));};exports[_0x5c1d('0x53')]=function(_0x52685f,_0x47f8c4){var _0x4dfb1e={'raw':!![],'where':{'id':_0x52685f[_0x5c1d('0x54')]['id']}},_0x246d91={};_0x246d91[_0x5c1d('0x43')]=_[_0x5c1d('0x45')](db[_0x5c1d('0x3f')][_0x5c1d('0x40')]);_0x246d91[_0x5c1d('0x44')]=_[_0x5c1d('0x45')](_0x52685f['query']);_0x246d91[_0x5c1d('0x55')]=_['intersection'](_0x246d91[_0x5c1d('0x43')],_0x246d91[_0x5c1d('0x44')]);_0x4dfb1e[_0x5c1d('0x47')]=_['intersection'](_0x246d91[_0x5c1d('0x43')],qs[_0x5c1d('0x48')](_0x52685f[_0x5c1d('0x44')][_0x5c1d('0x48')]));_0x4dfb1e[_0x5c1d('0x47')]=_0x4dfb1e['attributes'][_0x5c1d('0x56')]?_0x4dfb1e[_0x5c1d('0x47')]:_0x246d91['model'];if(_0x52685f[_0x5c1d('0x44')][_0x5c1d('0x51')]){_0x4dfb1e[_0x5c1d('0x52')]=[{'all':!![]}];}_0x4dfb1e=_[_0x5c1d('0x50')]({},_0x4dfb1e,_0x52685f[_0x5c1d('0x57')]);return db[_0x5c1d('0x3f')][_0x5c1d('0x58')](_0x4dfb1e)[_0x5c1d('0x37')](handleEntityNotFound(_0x47f8c4,null))[_0x5c1d('0x37')](respondWithResult(_0x47f8c4,null))['catch'](handleError(_0x47f8c4,null));};exports['create']=function(_0x47fdd3,_0x5b7319){return db[_0x5c1d('0x3f')][_0x5c1d('0x59')](_0x47fdd3[_0x5c1d('0x5a')],{})[_0x5c1d('0x37')](respondWithResult(_0x5b7319,0xc9))[_0x5c1d('0x2a')](handleError(_0x5b7319,null));};exports[_0x5c1d('0x36')]=function(_0x5549c6,_0x2aba55){if(_0x5549c6[_0x5c1d('0x5a')]['id']){delete _0x5549c6[_0x5c1d('0x5a')]['id'];}return db[_0x5c1d('0x3f')][_0x5c1d('0x58')]({'where':{'id':_0x5549c6[_0x5c1d('0x54')]['id']}})[_0x5c1d('0x37')](handleEntityNotFound(_0x2aba55,null))['then'](saveUpdates(_0x5549c6[_0x5c1d('0x5a')],null))[_0x5c1d('0x37')](respondWithResult(_0x2aba55,null))[_0x5c1d('0x2a')](handleError(_0x2aba55,null));};exports[_0x5c1d('0x5b')]=function(_0x2ddc95,_0x5f56ce){return db[_0x5c1d('0x3f')][_0x5c1d('0x58')]({'where':{'id':_0x2ddc95[_0x5c1d('0x54')]['id']}})['then'](handleEntityNotFound(_0x5f56ce,null))[_0x5c1d('0x37')](removeEntity(_0x5f56ce,null))[_0x5c1d('0x2a')](handleError(_0x5f56ce,null));};exports[_0x5c1d('0x5c')]=function(_0x14d66a,_0x16c178){return db[_0x5c1d('0x3f')][_0x5c1d('0x5c')]()[_0x5c1d('0x37')](respondWithResult(_0x16c178,null))[_0x5c1d('0x2a')](handleError(_0x16c178,null));};var interaction_log=require('../../config/logger')(_0x5c1d('0x5d'));exports[_0x5c1d('0x5e')]=function(_0xa57522,_0x4a066d,_0x488fca){var _0x50e61a={'agent':{},'channel':_0x5c1d('0x5f')};if(_0xa57522['body']['id']){delete _0xa57522[_0x5c1d('0x5a')]['id'];}_0xa57522[_0x5c1d('0x5a')][_0x5c1d('0x60')]=!![];_0xa57522[_0x5c1d('0x5a')][_0x5c1d('0x61')]=moment()[_0x5c1d('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0xa57522[_0x5c1d('0x5a')]['UserId']=_0xa57522['body']['UserId']||_0xa57522['user']['id'];_0x50e61a[_0x5c1d('0x63')]['id']=_0xa57522[_0x5c1d('0x5a')][_0x5c1d('0x64')];return db['WhatsappMessage'][_0x5c1d('0x58')]({'where':{'id':_0xa57522[_0x5c1d('0x54')]['id'],'UserId':null}})[_0x5c1d('0x37')](handleEntityNotFound(_0x4a066d,null))[_0x5c1d('0x37')](saveUpdates(_0xa57522[_0x5c1d('0x5a')],null))[_0x5c1d('0x37')](function(_0xfea40f){if(_0xfea40f){_0x50e61a['message']=_0xfea40f[_0x5c1d('0x65')]({'plain':!![]});return db[_0x5c1d('0x66')][_0x5c1d('0x58')]({'where':{'id':_0xfea40f['WhatsappInteractionId']}});}return null;})[_0x5c1d('0x37')](handleEntityNotFound(_0x4a066d,null))[_0x5c1d('0x37')](function(_0x390c80){if(_0x390c80){return _0x390c80[_0x5c1d('0x36')]({'UserId':_0xa57522[_0x5c1d('0x5a')][_0x5c1d('0x64')],'read1stAt':_['isNil'](_0x390c80[_0x5c1d('0x67')])?moment()['format'](_0x5c1d('0x68')):undefined});}return null;})[_0x5c1d('0x37')](function(_0x3fbf9c){if(_0x3fbf9c){_0x50e61a[_0x5c1d('0x69')]=_0x3fbf9c[_0x5c1d('0x65')]({'plain':!![]});interaction_log[_0x5c1d('0x6a')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa57522[_0x5c1d('0x6b')]['id'],_0xa57522[_0x5c1d('0x6b')][_0x5c1d('0x3b')],_0xa57522[_0x5c1d('0x6b')][_0x5c1d('0x6c')],_0x50e61a['interaction']['id'],_0xa57522[_0x5c1d('0x5a')]?JSON[_0x5c1d('0x24')](_0xa57522[_0x5c1d('0x5a')]):_0x5c1d('0x6d'));return respondWithRpcPromise(_0x5c1d('0x6e'),_0x5c1d('0x6f'),_0x50e61a);}return null;})['then'](function(_0x21876e){var _0x350177=_0x5c1d('0x70')+_0x21876e[_0x5c1d('0x27')][_0x5c1d('0x71')];return db[_0x5c1d('0x72')][_0x5c1d('0x44')](_0x350177,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x5c1d('0x37')](function(_0x543f2b){return _0x543f2b;});})[_0x5c1d('0x37')](function(_0xe002e3){if(_0xe002e3){_0x50e61a[_0x5c1d('0x27')][_0x5c1d('0x73')]=_0xe002e3[0x0];if(!_0xa57522[_0x5c1d('0x5a')]['UserId'])return;return db['User'][_0x5c1d('0x58')]({'where':{'id':_0xa57522[_0x5c1d('0x5a')]['UserId'],'role':'agent'},'attributes':['id','name',_0x5c1d('0x74'),'email','internal'],'raw':!![]});}return null;})[_0x5c1d('0x37')](function(_0x9bc960){if(!_0x9bc960)return null;_0x50e61a[_0x5c1d('0x27')][_0x5c1d('0x63')]=_0x9bc960;return _0x50e61a;})[_0x5c1d('0x37')](function(_0x57f02f){if(_0x57f02f){if(_0xa57522[_0x5c1d('0x5a')][_0x5c1d('0x75')]){_0x50e61a[_0x5c1d('0x27')][_0x5c1d('0x76')]=util[_0x5c1d('0x62')](_0x5c1d('0x77'),_0xa57522[_0x5c1d('0x6b')]['name']);_0x50e61a['message'][_0x5c1d('0x78')]=_0x50e61a[_0x5c1d('0x78')];_0x50e61a[_0x5c1d('0x27')][_0x5c1d('0x79')]=_0x50e61a['channel'];_0x50e61a[_0x5c1d('0x27')][_0x5c1d('0x7a')]='accept';return respondWithRpcPromise('EventManager',_0x5c1d('0x7b'),{'event':_0x5c1d('0x7c'),'message':_0x50e61a[_0x5c1d('0x27')]},client9002)[_0x5c1d('0x37')](function(){return _0x50e61a;});}return _0x50e61a;}return null;})['then'](respondWithResult(_0x4a066d,null))[_0x5c1d('0x2a')](handleError(_0x4a066d,null));};var interaction_log=require(_0x5c1d('0x13'))(_0x5c1d('0x5d'));exports['reject']=function(_0x362741,_0x5942c3,_0x3547df){var _0x58116f={'agent':{},'channel':_0x5c1d('0x5f')};if(_0x362741[_0x5c1d('0x5a')]['id']){delete _0x362741[_0x5c1d('0x5a')]['id'];}_0x362741[_0x5c1d('0x5a')][_0x5c1d('0x64')]=_0x362741[_0x5c1d('0x5a')][_0x5c1d('0x64')]||_0x362741['user']['id'];_0x58116f[_0x5c1d('0x63')]['id']=_0x362741[_0x5c1d('0x5a')]['UserId'];return db[_0x5c1d('0x3f')]['find']({'where':{'id':_0x362741[_0x5c1d('0x54')]['id'],'UserId':null}})[_0x5c1d('0x37')](handleEntityNotFound(_0x5942c3,null))['then'](function(_0x49f7b5){if(_0x49f7b5){_0x58116f[_0x5c1d('0x27')]=_0x49f7b5[_0x5c1d('0x65')]({'plain':!![]});return db[_0x5c1d('0x66')][_0x5c1d('0x58')]({'where':{'id':_0x49f7b5['WhatsappInteractionId']}});}return null;})[_0x5c1d('0x37')](handleEntityNotFound(_0x5942c3,null))[_0x5c1d('0x37')](function(_0x26abcd){if(_0x26abcd){_0x58116f[_0x5c1d('0x69')]=_0x26abcd['get']({'plain':!![]});interaction_log[_0x5c1d('0x6a')](_0x5c1d('0x7d'),_0x362741[_0x5c1d('0x6b')]['id'],_0x362741['user'][_0x5c1d('0x3b')],_0x362741[_0x5c1d('0x6b')]['role'],_0x58116f['interaction']['id'],_0x362741[_0x5c1d('0x5a')]?JSON['stringify'](_0x362741[_0x5c1d('0x5a')]):'null');return respondWithRpcPromise(_0x5c1d('0x7e'),_0x5c1d('0x7f'),_0x58116f);}return null;})[_0x5c1d('0x37')](function(_0x55ad6a){var _0x1ad7fd=_0x5c1d('0x70')+_0x55ad6a[_0x5c1d('0x27')][_0x5c1d('0x71')];return db[_0x5c1d('0x72')]['query'](_0x1ad7fd,{'type':db[_0x5c1d('0x80')][_0x5c1d('0x81')][_0x5c1d('0x82')],'raw':!![]})[_0x5c1d('0x37')](function(_0x5376fc){return _0x5376fc;});})[_0x5c1d('0x37')](function(_0x2c1ab7){if(_0x2c1ab7){_0x58116f[_0x5c1d('0x27')][_0x5c1d('0x73')]=_0x2c1ab7[0x0];if(!_0x362741[_0x5c1d('0x5a')][_0x5c1d('0x64')])return;return db['User'][_0x5c1d('0x58')]({'where':{'id':_0x362741[_0x5c1d('0x5a')][_0x5c1d('0x64')],'role':_0x5c1d('0x63')},'attributes':['id',_0x5c1d('0x3b'),'fullname','email',_0x5c1d('0x83')],'raw':!![]});}return null;})[_0x5c1d('0x37')](function(_0x49d233){if(!_0x49d233)return null;_0x58116f[_0x5c1d('0x27')][_0x5c1d('0x63')]=_0x49d233;return _0x58116f;})[_0x5c1d('0x37')](function(_0x5eeb38){if(_0x5eeb38){_0x5eeb38[_0x5c1d('0x27')][_0x5c1d('0x76')]=util['format']('SIP/%s',_0x362741['user'][_0x5c1d('0x3b')]);_0x5eeb38[_0x5c1d('0x27')]['channel']=_0x58116f[_0x5c1d('0x78')];_0x5eeb38[_0x5c1d('0x27')]['motionChannel']=_0x58116f[_0x5c1d('0x78')];_0x5eeb38[_0x5c1d('0x27')][_0x5c1d('0x7a')]='reject';respondWithRpcPromise(_0x5c1d('0x7b'),'EventManager',{'event':_0x5c1d('0x84'),'message':_0x5eeb38[_0x5c1d('0x27')]},client9002);return _0x58116f;}return null;})['then'](respondWithResult(_0x5942c3,null))[_0x5c1d('0x2a')](handleError(_0x5942c3,null));};exports['status']=function(_0x4b87ca,_0x44a551,_0x26fe0a){if(_0x4b87ca[_0x5c1d('0x5a')]['id']){delete _0x4b87ca['body']['id'];}var _0x4cee3f;return db['WhatsappMessage']['find']({'where':{'id':_0x4b87ca[_0x5c1d('0x54')]['id']}})[_0x5c1d('0x37')](handleEntityNotFound(_0x44a551,null))[_0x5c1d('0x37')](function(_0x3b0403){if(_0x3b0403){_0x4cee3f=_0x3b0403;return db[_0x5c1d('0x85')][_0x5c1d('0x58')]({'where':{'id':_0x3b0403[_0x5c1d('0x86')]}});}})[_0x5c1d('0x37')](handleEntityNotFound(_0x44a551,null))['then'](function(_0x1e8561){if(_0x1e8561){logger[_0x5c1d('0x21')](_0x5c1d('0x87'),_0x5c1d('0x2b'),_0x5c1d('0x88'),_0x1e8561[_0x5c1d('0x42')],util['inspect'](_0x4b87ca['body'],{'showHidden':![],'depth':null}));switch(_0x1e8561[_0x5c1d('0x42')]){case _0x5c1d('0x89'):if(_0x4b87ca[_0x5c1d('0x5a')][_0x5c1d('0x8a')]&&_0x4b87ca[_0x5c1d('0x5a')][_0x5c1d('0x8a')]===_0x4cee3f[_0x5c1d('0x8b')]&&_0x4b87ca['body'][_0x5c1d('0x8c')]&&_0x4b87ca[_0x5c1d('0x5a')][_0x5c1d('0x8c')]===_0x5c1d('0x60')){return _0x4cee3f[_0x5c1d('0x36')]({'read':!![]});}else{logger[_0x5c1d('0x25')](_0x5c1d('0x8d'),_0x5c1d('0x2b'),_0x5c1d('0x89'),util['inspect'](_0x4b87ca[_0x5c1d('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x4cee3f;}})['then'](respondWithResult(_0x44a551,null))[_0x5c1d('0x2a')](handleError(_0x44a551,null));}; \ No newline at end of file +var _0x589d=['info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','WhatsappMessage','includeAll','findAll','rows','show','params','include','create','body','find','describe','whatsapp-interactions','accept','read','format','UserId','get','read1stAt','YYYY-MM-DD\x20HH:mm:ss','user','role','interaction','stringify','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','messageId','MessageStatus','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','request'];(function(_0x190b37,_0x386197){var _0x4e7eb7=function(_0x31468b){while(--_0x31468b){_0x190b37['push'](_0x190b37['shift']());}};_0x4e7eb7(++_0x386197);}(_0x589d,0x6a));var _0xd589=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x589d[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xd589('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd589('0x1'));var rp=require('request-promise');var moment=require(_0xd589('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd589('0x3'));var util=require('util');var path=require(_0xd589('0x4'));var sox=require(_0xd589('0x5'));var csv=require(_0xd589('0x6'));var ejs=require(_0xd589('0x7'));var fs=require('fs');var fs_extra=require(_0xd589('0x8'));var _=require(_0xd589('0x9'));var squel=require('squel');var crypto=require(_0xd589('0xa'));var jsforce=require(_0xd589('0xb'));var deskjs=require(_0xd589('0xc'));var toCsv=require(_0xd589('0x6'));var querystring=require(_0xd589('0xd'));var Papa=require(_0xd589('0xe'));var Redis=require(_0xd589('0xf'));var authService=require(_0xd589('0x10'));var qs=require(_0xd589('0x11'));var as=require(_0xd589('0x12'));var hardwareService=require(_0xd589('0x13'));var logger=require(_0xd589('0x14'))(_0xd589('0x15'));var utils=require(_0xd589('0x16'));var config=require(_0xd589('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd589('0x18'))['db'];config[_0xd589('0x19')]=_[_0xd589('0x1a')](config[_0xd589('0x19')],{'host':_0xd589('0x1b'),'port':0x18eb});var socket=require(_0xd589('0x1c'))(new Redis(config[_0xd589('0x19')]));require(_0xd589('0x1d'))[_0xd589('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd589('0x1f')][_0xd589('0x20')]({'port':0x232c});var client9002=jayson[_0xd589('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bf8dc,_0x2111ff,_0x1423a1,_0x21301d){return new BPromise(function(_0x1f460c,_0x4be8bb){var _0xeb1a17=_0x21301d||client;return _0xeb1a17[_0xd589('0x21')](_0x5bf8dc,_0x1423a1)['then'](function(_0x149e7e){logger[_0xd589('0x22')](_0xd589('0x23'),_0x2111ff,_0xd589('0x24'));logger[_0xd589('0x25')](_0xd589('0x26'),_0x2111ff,'request\x20sent',JSON['stringify'](_0x149e7e));if(_0x149e7e['error']){if(_0x149e7e[_0xd589('0x27')]['code']===0x1f4){logger[_0xd589('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x2111ff,_0x149e7e[_0xd589('0x27')][_0xd589('0x28')]);return _0x4be8bb(_0x149e7e['error'][_0xd589('0x28')]);}logger[_0xd589('0x27')](_0xd589('0x23'),_0x2111ff,_0x149e7e[_0xd589('0x27')][_0xd589('0x28')]);return _0x1f460c(_0x149e7e['error'][_0xd589('0x28')]);}else{logger[_0xd589('0x22')](_0xd589('0x23'),_0x2111ff,'request\x20sent');_0x1f460c(_0x149e7e[_0xd589('0x29')][_0xd589('0x28')]);}})[_0xd589('0x2a')](function(_0x4f3124){logger[_0xd589('0x27')](_0xd589('0x23'),_0x2111ff,_0x4f3124);_0x4be8bb(_0x4f3124);});});}function respondWithStatusCode(_0x4dd1a2,_0x166a56){_0x166a56=_0x166a56||0xcc;return function(_0x7d13de){if(_0x7d13de){return _0x4dd1a2['sendStatus'](_0x166a56);}return _0x4dd1a2[_0xd589('0x2b')](_0x166a56)[_0xd589('0x2c')]();};}function respondWithResult(_0x3ab620,_0x2e0cf7){_0x2e0cf7=_0x2e0cf7||0xc8;return function(_0x27de49){if(_0x27de49){return _0x3ab620[_0xd589('0x2b')](_0x2e0cf7)[_0xd589('0x2d')](_0x27de49);}};}function respondWithFilteredResult(_0x5782f3,_0x2abf7e){return function(_0x2dfd18){if(_0x2dfd18){var _0x346177=typeof _0x2abf7e['offset']==='undefined'&&typeof _0x2abf7e[_0xd589('0x2e')]==='undefined';var _0x57483a=_0x2dfd18[_0xd589('0x2f')];var _0x1f1db3=_0x346177?0x0:_0x2abf7e[_0xd589('0x30')];var _0x57e81f=_0x346177?_0x2dfd18[_0xd589('0x2f')]:_0x2abf7e[_0xd589('0x30')]+_0x2abf7e[_0xd589('0x2e')];var _0x51f2b2;if(_0x57e81f>=_0x57483a){_0x57e81f=_0x57483a;_0x51f2b2=0xc8;}else{_0x51f2b2=0xce;}_0x5782f3[_0xd589('0x2b')](_0x51f2b2);return _0x5782f3['set'](_0xd589('0x31'),_0x1f1db3+'-'+_0x57e81f+'/'+_0x57483a)['json'](_0x2dfd18);}return null;};}function patchUpdates(_0x48c8f6){return function(_0x6c49df){try{jsonpatch[_0xd589('0x32')](_0x6c49df,_0x48c8f6,!![]);}catch(_0x228493){return BPromise[_0xd589('0x33')](_0x228493);}return _0x6c49df[_0xd589('0x34')]();};}function saveUpdates(_0x130652,_0x308ba3){return function(_0x53ef77){if(_0x53ef77){return _0x53ef77[_0xd589('0x35')](_0x130652)['then'](function(_0x2b1c44){return _0x2b1c44;});}return null;};}function removeEntity(_0x980fed,_0x1d6893){return function(_0x42a001){if(_0x42a001){return _0x42a001[_0xd589('0x36')]()[_0xd589('0x37')](function(){_0x980fed[_0xd589('0x2b')](0xcc)[_0xd589('0x2c')]();});}};}function handleEntityNotFound(_0x40aac6,_0x31da4b){return function(_0x5ba502){if(!_0x5ba502){_0x40aac6[_0xd589('0x38')](0x194);}return _0x5ba502;};}function handleError(_0x457c01,_0x1c8096){_0x1c8096=_0x1c8096||0x1f4;return function(_0x4cec81){logger[_0xd589('0x27')](_0x4cec81[_0xd589('0x39')]);if(_0x4cec81[_0xd589('0x3a')]){delete _0x4cec81[_0xd589('0x3a')];}_0x457c01[_0xd589('0x2b')](_0x1c8096)[_0xd589('0x3b')](_0x4cec81);};}exports['index']=function(_0x21bcc2,_0x5a7b08){var _0x5b48ac={},_0x9a8a5a={},_0x4affe5={'count':0x0,'rows':[]};var _0x5854cd=_['map'](db['WhatsappMessage'][_0xd589('0x3c')],function(_0x24bbec){return{'name':_0x24bbec[_0xd589('0x3d')],'type':_0x24bbec[_0xd589('0x3e')][_0xd589('0x3f')]};});_0x9a8a5a[_0xd589('0x40')]=_[_0xd589('0x41')](_0x5854cd,_0xd589('0x3a'));_0x9a8a5a[_0xd589('0x42')]=_[_0xd589('0x43')](_0x21bcc2[_0xd589('0x42')]);_0x9a8a5a[_0xd589('0x44')]=_[_0xd589('0x45')](_0x9a8a5a[_0xd589('0x40')],_0x9a8a5a[_0xd589('0x42')]);_0x5b48ac[_0xd589('0x46')]=_[_0xd589('0x45')](_0x9a8a5a[_0xd589('0x40')],qs[_0xd589('0x47')](_0x21bcc2[_0xd589('0x42')][_0xd589('0x47')]));_0x5b48ac[_0xd589('0x46')]=_0x5b48ac[_0xd589('0x46')][_0xd589('0x48')]?_0x5b48ac['attributes']:_0x9a8a5a[_0xd589('0x40')];if(!_0x21bcc2[_0xd589('0x42')][_0xd589('0x49')](_0xd589('0x4a'))){_0x5b48ac[_0xd589('0x2e')]=qs[_0xd589('0x2e')](_0x21bcc2[_0xd589('0x42')][_0xd589('0x2e')]);_0x5b48ac[_0xd589('0x30')]=qs['offset'](_0x21bcc2[_0xd589('0x42')][_0xd589('0x30')]);}_0x5b48ac['order']=qs[_0xd589('0x4b')](_0x21bcc2[_0xd589('0x42')][_0xd589('0x4b')]);_0x5b48ac[_0xd589('0x4c')]=qs['filters'](_['pick'](_0x21bcc2[_0xd589('0x42')],_0x9a8a5a['filters']),_0x5854cd);if(_0x21bcc2[_0xd589('0x42')][_0xd589('0x4d')]){_0x5b48ac[_0xd589('0x4c')]=_[_0xd589('0x4e')](_0x5b48ac[_0xd589('0x4c')],{'$or':_[_0xd589('0x41')](_0x5854cd,function(_0x404655){if(_0x404655[_0xd589('0x3e')]!==_0xd589('0x4f')){var _0x3472fc={};_0x3472fc[_0x404655[_0xd589('0x3a')]]={'$like':'%'+_0x21bcc2[_0xd589('0x42')][_0xd589('0x4d')]+'%'};return _0x3472fc;}})});}_0x5b48ac=_[_0xd589('0x4e')]({},_0x5b48ac,_0x21bcc2[_0xd589('0x50')]);var _0x1e91a4={'where':_0x5b48ac[_0xd589('0x4c')]};return db[_0xd589('0x51')][_0xd589('0x2f')](_0x1e91a4)['then'](function(_0x511945){_0x4affe5[_0xd589('0x2f')]=_0x511945;if(_0x21bcc2[_0xd589('0x42')][_0xd589('0x52')]){_0x5b48ac['include']=[{'all':!![]}];}return db[_0xd589('0x51')][_0xd589('0x53')](_0x5b48ac);})['then'](function(_0x5f4e8e){_0x4affe5[_0xd589('0x54')]=_0x5f4e8e;return _0x4affe5;})['then'](respondWithFilteredResult(_0x5a7b08,_0x5b48ac))[_0xd589('0x2a')](handleError(_0x5a7b08,null));};exports[_0xd589('0x55')]=function(_0x55feec,_0x1b756d){var _0x98a752={'raw':!![],'where':{'id':_0x55feec[_0xd589('0x56')]['id']}},_0x4b808e={};_0x4b808e['model']=_[_0xd589('0x43')](db['WhatsappMessage']['rawAttributes']);_0x4b808e['query']=_['keys'](_0x55feec[_0xd589('0x42')]);_0x4b808e['filters']=_[_0xd589('0x45')](_0x4b808e[_0xd589('0x40')],_0x4b808e[_0xd589('0x42')]);_0x98a752[_0xd589('0x46')]=_[_0xd589('0x45')](_0x4b808e[_0xd589('0x40')],qs[_0xd589('0x47')](_0x55feec['query'][_0xd589('0x47')]));_0x98a752[_0xd589('0x46')]=_0x98a752[_0xd589('0x46')][_0xd589('0x48')]?_0x98a752['attributes']:_0x4b808e['model'];if(_0x55feec['query'][_0xd589('0x52')]){_0x98a752[_0xd589('0x57')]=[{'all':!![]}];}_0x98a752=_[_0xd589('0x4e')]({},_0x98a752,_0x55feec[_0xd589('0x50')]);return db[_0xd589('0x51')]['find'](_0x98a752)['then'](handleEntityNotFound(_0x1b756d,null))[_0xd589('0x37')](respondWithResult(_0x1b756d,null))[_0xd589('0x2a')](handleError(_0x1b756d,null));};exports['create']=function(_0x2b0d14,_0x321484){return db['WhatsappMessage'][_0xd589('0x58')](_0x2b0d14['body'],{})[_0xd589('0x37')](respondWithResult(_0x321484,0xc9))[_0xd589('0x2a')](handleError(_0x321484,null));};exports[_0xd589('0x35')]=function(_0x3bbd0c,_0x1cb791){if(_0x3bbd0c[_0xd589('0x59')]['id']){delete _0x3bbd0c['body']['id'];}return db[_0xd589('0x51')][_0xd589('0x5a')]({'where':{'id':_0x3bbd0c[_0xd589('0x56')]['id']}})[_0xd589('0x37')](handleEntityNotFound(_0x1cb791,null))['then'](saveUpdates(_0x3bbd0c['body'],null))[_0xd589('0x37')](respondWithResult(_0x1cb791,null))[_0xd589('0x2a')](handleError(_0x1cb791,null));};exports[_0xd589('0x36')]=function(_0x3df546,_0x381673){return db[_0xd589('0x51')][_0xd589('0x5a')]({'where':{'id':_0x3df546[_0xd589('0x56')]['id']}})['then'](handleEntityNotFound(_0x381673,null))[_0xd589('0x37')](removeEntity(_0x381673,null))[_0xd589('0x2a')](handleError(_0x381673,null));};exports[_0xd589('0x5b')]=function(_0x27b4e9,_0x1c5cdd){return db[_0xd589('0x51')][_0xd589('0x5b')]()['then'](respondWithResult(_0x1c5cdd,null))[_0xd589('0x2a')](handleError(_0x1c5cdd,null));};var interaction_log=require(_0xd589('0x14'))(_0xd589('0x5c'));exports[_0xd589('0x5d')]=function(_0x3b06d6,_0x33c157,_0x2b5cc5){var _0x5522c8={'agent':{},'channel':'whatsapp'};if(_0x3b06d6[_0xd589('0x59')]['id']){delete _0x3b06d6['body']['id'];}_0x3b06d6[_0xd589('0x59')][_0xd589('0x5e')]=!![];_0x3b06d6[_0xd589('0x59')]['readAt']=moment()[_0xd589('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3b06d6[_0xd589('0x59')][_0xd589('0x60')]=_0x3b06d6[_0xd589('0x59')][_0xd589('0x60')]||_0x3b06d6['user']['id'];_0x5522c8['agent']['id']=_0x3b06d6[_0xd589('0x59')][_0xd589('0x60')];return db[_0xd589('0x51')][_0xd589('0x5a')]({'where':{'id':_0x3b06d6[_0xd589('0x56')]['id'],'UserId':null}})[_0xd589('0x37')](handleEntityNotFound(_0x33c157,null))['then'](saveUpdates(_0x3b06d6[_0xd589('0x59')],null))[_0xd589('0x37')](function(_0x1c4549){if(_0x1c4549){_0x5522c8[_0xd589('0x28')]=_0x1c4549[_0xd589('0x61')]({'plain':!![]});return db['WhatsappInteraction'][_0xd589('0x5a')]({'where':{'id':_0x1c4549['WhatsappInteractionId']}});}return null;})[_0xd589('0x37')](handleEntityNotFound(_0x33c157,null))[_0xd589('0x37')](function(_0x207691){if(_0x207691){return _0x207691['update']({'UserId':_0x3b06d6[_0xd589('0x59')][_0xd589('0x60')],'read1stAt':_['isNil'](_0x207691[_0xd589('0x62')])?moment()[_0xd589('0x5f')](_0xd589('0x63')):undefined});}return null;})[_0xd589('0x37')](function(_0x39d9d0){if(_0x39d9d0){_0x5522c8['interaction']=_0x39d9d0['get']({'plain':!![]});interaction_log[_0xd589('0x22')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3b06d6[_0xd589('0x64')]['id'],_0x3b06d6[_0xd589('0x64')][_0xd589('0x3a')],_0x3b06d6[_0xd589('0x64')][_0xd589('0x65')],_0x5522c8[_0xd589('0x66')]['id'],_0x3b06d6[_0xd589('0x59')]?JSON[_0xd589('0x67')](_0x3b06d6[_0xd589('0x59')]):_0xd589('0x68'));return respondWithRpcPromise('AcceptMessage',_0xd589('0x69'),_0x5522c8);}return null;})['then'](function(_0x1f935b){var _0x3df887='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1f935b[_0xd589('0x28')][_0xd589('0x6a')];return db[_0xd589('0x6b')][_0xd589('0x42')](_0x3df887,{'type':db[_0xd589('0x6c')][_0xd589('0x6d')]['SELECT'],'raw':!![]})[_0xd589('0x37')](function(_0x513f02){return _0x513f02;});})['then'](function(_0x46f7af){if(_0x46f7af){_0x5522c8[_0xd589('0x28')][_0xd589('0x6e')]=_0x46f7af[0x0];if(!_0x3b06d6[_0xd589('0x59')][_0xd589('0x60')])return;return db[_0xd589('0x6f')][_0xd589('0x5a')]({'where':{'id':_0x3b06d6[_0xd589('0x59')]['UserId'],'role':_0xd589('0x70')},'attributes':['id','name',_0xd589('0x71'),_0xd589('0x72'),_0xd589('0x73')],'raw':!![]});}return null;})[_0xd589('0x37')](function(_0x22fafe){if(!_0x22fafe)return null;_0x5522c8[_0xd589('0x28')]['agent']=_0x22fafe;return _0x5522c8;})[_0xd589('0x37')](function(_0x4eb838){if(_0x4eb838){if(_0x3b06d6[_0xd589('0x59')][_0xd589('0x74')]){_0x5522c8[_0xd589('0x28')][_0xd589('0x75')]=util[_0xd589('0x5f')](_0xd589('0x76'),_0x3b06d6[_0xd589('0x64')][_0xd589('0x3a')]);_0x5522c8[_0xd589('0x28')]['channel']=_0x5522c8[_0xd589('0x77')];_0x5522c8['message'][_0xd589('0x78')]=_0x5522c8[_0xd589('0x77')];_0x5522c8['message'][_0xd589('0x79')]=_0xd589('0x5d');return respondWithRpcPromise('EventManager',_0xd589('0x7a'),{'event':_0xd589('0x7b'),'message':_0x5522c8[_0xd589('0x28')]},client9002)[_0xd589('0x37')](function(){return _0x5522c8;});}return _0x5522c8;}return null;})[_0xd589('0x37')](respondWithResult(_0x33c157,null))['catch'](handleError(_0x33c157,null));};var interaction_log=require(_0xd589('0x14'))('whatsapp-interactions');exports[_0xd589('0x33')]=function(_0x3b2b37,_0x1f2b94,_0x2483cb){var _0x5d000c={'agent':{},'channel':_0xd589('0x7c')};if(_0x3b2b37[_0xd589('0x59')]['id']){delete _0x3b2b37[_0xd589('0x59')]['id'];}_0x3b2b37['body'][_0xd589('0x60')]=_0x3b2b37['body'][_0xd589('0x60')]||_0x3b2b37[_0xd589('0x64')]['id'];_0x5d000c['agent']['id']=_0x3b2b37[_0xd589('0x59')][_0xd589('0x60')];return db['WhatsappMessage'][_0xd589('0x5a')]({'where':{'id':_0x3b2b37[_0xd589('0x56')]['id'],'UserId':null}})[_0xd589('0x37')](handleEntityNotFound(_0x1f2b94,null))[_0xd589('0x37')](function(_0x46976a){if(_0x46976a){_0x5d000c[_0xd589('0x28')]=_0x46976a[_0xd589('0x61')]({'plain':!![]});return db[_0xd589('0x7d')][_0xd589('0x5a')]({'where':{'id':_0x46976a[_0xd589('0x7e')]}});}return null;})[_0xd589('0x37')](handleEntityNotFound(_0x1f2b94,null))['then'](function(_0x117cb2){if(_0x117cb2){_0x5d000c[_0xd589('0x66')]=_0x117cb2[_0xd589('0x61')]({'plain':!![]});interaction_log[_0xd589('0x22')](_0xd589('0x7f'),_0x3b2b37['user']['id'],_0x3b2b37[_0xd589('0x64')]['name'],_0x3b2b37[_0xd589('0x64')]['role'],_0x5d000c['interaction']['id'],_0x3b2b37[_0xd589('0x59')]?JSON[_0xd589('0x67')](_0x3b2b37[_0xd589('0x59')]):'null');return respondWithRpcPromise(_0xd589('0x80'),_0xd589('0x81'),_0x5d000c);}return null;})['then'](function(_0x12f3cb){var _0xdffa07=_0xd589('0x82')+_0x12f3cb[_0xd589('0x28')][_0xd589('0x6a')];return db[_0xd589('0x6b')]['query'](_0xdffa07,{'type':db[_0xd589('0x6c')][_0xd589('0x6d')][_0xd589('0x83')],'raw':!![]})[_0xd589('0x37')](function(_0x9636a7){return _0x9636a7;});})['then'](function(_0x5e612b){if(_0x5e612b){_0x5d000c[_0xd589('0x28')][_0xd589('0x6e')]=_0x5e612b[0x0];if(!_0x3b2b37[_0xd589('0x59')][_0xd589('0x60')])return;return db[_0xd589('0x6f')]['find']({'where':{'id':_0x3b2b37['body']['UserId'],'role':_0xd589('0x70')},'attributes':['id',_0xd589('0x3a'),_0xd589('0x71'),_0xd589('0x72'),_0xd589('0x73')],'raw':!![]});}return null;})[_0xd589('0x37')](function(_0x575c84){if(!_0x575c84)return null;_0x5d000c[_0xd589('0x28')]['agent']=_0x575c84;return _0x5d000c;})['then'](function(_0x336a87){if(_0x336a87){_0x336a87[_0xd589('0x28')][_0xd589('0x75')]=util[_0xd589('0x5f')](_0xd589('0x76'),_0x3b2b37[_0xd589('0x64')][_0xd589('0x3a')]);_0x336a87[_0xd589('0x28')]['channel']=_0x5d000c[_0xd589('0x77')];_0x336a87[_0xd589('0x28')][_0xd589('0x78')]=_0x5d000c[_0xd589('0x77')];_0x336a87['message']['event']=_0xd589('0x33');respondWithRpcPromise('EventManager',_0xd589('0x7a'),{'event':_0xd589('0x84'),'message':_0x336a87[_0xd589('0x28')]},client9002);return _0x5d000c;}return null;})['then'](respondWithResult(_0x1f2b94,null))[_0xd589('0x2a')](handleError(_0x1f2b94,null));};exports['status']=function(_0x10738e,_0x3d07d3,_0x4a6b58){if(_0x10738e[_0xd589('0x59')]['id']){delete _0x10738e[_0xd589('0x59')]['id'];}var _0x346c59;return db['WhatsappMessage'][_0xd589('0x5a')]({'where':{'id':_0x10738e[_0xd589('0x56')]['id']}})[_0xd589('0x37')](handleEntityNotFound(_0x3d07d3,null))[_0xd589('0x37')](function(_0x4fde25){if(_0x4fde25){_0x346c59=_0x4fde25;return db[_0xd589('0x85')]['find']({'where':{'id':_0x4fde25['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x3d07d3,null))[_0xd589('0x37')](function(_0x155145){if(_0x155145){logger[_0xd589('0x25')](_0xd589('0x86'),_0xd589('0x2b'),_0xd589('0x87'),_0x155145[_0xd589('0x3e')],util[_0xd589('0x88')](_0x10738e['body'],{'showHidden':![],'depth':null}));switch(_0x155145[_0xd589('0x3e')]){case _0xd589('0x89'):if(_0x10738e['body']['MessageSid']&&_0x10738e['body']['MessageSid']===_0x346c59[_0xd589('0x8a')]&&_0x10738e['body'][_0xd589('0x8b')]&&_0x10738e[_0xd589('0x59')][_0xd589('0x8b')]===_0xd589('0x5e')){return _0x346c59[_0xd589('0x35')]({'read':!![]});}else{logger[_0xd589('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xd589('0x2b'),_0xd589('0x89'),util[_0xd589('0x88')](_0x10738e['body'],{'showHidden':![],'depth':null}));}break;}return _0x346c59;}})[_0xd589('0x37')](respondWithResult(_0x3d07d3,null))[_0xd589('0x2a')](handleError(_0x3d07d3,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 3aa2066..361cfe2 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 _0xaa5e=['save','update','remove','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x39f407,_0x1f5286){var _0x5f08ac=function(_0x454b41){while(--_0x454b41){_0x39f407['push'](_0x39f407['shift']());}};_0x5f08ac(++_0x1f5286);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x563ddb,_0x38319a){_0x563ddb=_0x563ddb-0x0;var _0x17177d=_0xaa5e[_0x563ddb];return _0x17177d;};'use strict';var EventEmitter=require(_0xeaa5('0x0'));var WhatsappMessage=require(_0xeaa5('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xeaa5('0x2')](0x0);var events={'afterCreate':_0xeaa5('0x3'),'afterUpdate':_0xeaa5('0x4'),'afterDestroy':_0xeaa5('0x5')};function emitEvent(_0x131fc3){return function(_0x5a1aca,_0x2c111f,_0xd64e9f){WhatsappMessageEvents[_0xeaa5('0x6')](_0x131fc3+':'+_0x5a1aca['id'],_0x5a1aca);WhatsappMessageEvents[_0xeaa5('0x6')](_0x131fc3,_0x5a1aca);_0xd64e9f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xeaa5('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x8d05=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','emit','hasOwnProperty','exports'];(function(_0x38b347,_0x29f7f6){var _0x24134e=function(_0x4d7e76){while(--_0x4d7e76){_0x38b347['push'](_0x38b347['shift']());}};_0x24134e(++_0x29f7f6);}(_0x8d05,0xe8));var _0x58d0=function(_0x506f7e,_0x431495){_0x506f7e=_0x506f7e-0x0;var _0x40abfc=_0x8d05[_0x506f7e];return _0x40abfc;};'use strict';var EventEmitter=require(_0x58d0('0x0'));var WhatsappMessage=require(_0x58d0('0x1'))['db'][_0x58d0('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x58d0('0x3')](0x0);var events={'afterCreate':_0x58d0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x276e0a){return function(_0x3de956,_0x1a2d82,_0x55f391){WhatsappMessageEvents['emit'](_0x276e0a+':'+_0x3de956['id'],_0x3de956);WhatsappMessageEvents[_0x58d0('0x5')](_0x276e0a,_0x3de956);_0x55f391(null);};}for(var e in events){if(events[_0x58d0('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x58d0('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 9d20eaf..267feb5 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 _0x7d74=['WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','text','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','lodash','moment','bluebird','node-fetch','path','rimraf','../../config/environment','define'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7d74,0x172));var _0x47d7=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x7d74[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x47d7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x47d7('0x1'));var BPromise=require(_0x47d7('0x2'));var rp=require('request-promise');var fetch=require(_0x47d7('0x3'));var fs=require('fs');var path=require(_0x47d7('0x4'));var rimraf=require(_0x47d7('0x5'));var config=require(_0x47d7('0x6'));var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x46e398,_0x532edd){return _0x46e398[_0x47d7('0x7')](_0x47d7('0x8'),attributes,{'tableName':_0x47d7('0x9'),'paranoid':![],'indexes':[{'name':_0x47d7('0xa'),'fields':[_0x47d7('0xa')]},{'name':_0x47d7('0xb'),'fields':[_0x47d7('0xc')],'type':_0x47d7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3c338b,_0x43c3b5,_0x7d6dbe){var _0x1894c4=_0x46e398[_0x47d7('0xe')];var _0x328ee6=_0x3c338b[_0x47d7('0xf')]({'plain':!![]});if(_0x328ee6[_0x47d7('0x10')][_0x47d7('0x11')]()==='in'||_0x328ee6['direction'][_0x47d7('0x11')]()===_0x47d7('0x12')&&!_0x328ee6[_0x47d7('0x13')]&&!_[_0x47d7('0x14')](_0x328ee6[_0x47d7('0x15')])){_0x1894c4[_0x47d7('0x16')]['findOne']({'where':{'id':_0x328ee6[_0x47d7('0x17')]}})[_0x47d7('0x18')](function(_0x48cce0){if(_0x48cce0){_0x48cce0[_0x47d7('0x19')]({'lastMsgAt':_0x328ee6['createdAt'],'lastMsgDirection':_0x328ee6[_0x47d7('0x10')]['toLowerCase']()});}})[_0x47d7('0x1a')](function(_0x2603ee){console[_0x47d7('0x1b')](_0x2603ee);});}if(_0x328ee6['direction']===_0x47d7('0x12')&&!_0x328ee6[_0x47d7('0x13')]){var _0x3a73f5;_0x1894c4[_0x47d7('0x1c')]['find']({'where':{'id':_0x328ee6[_0x47d7('0x1d')]},'raw':!![]})[_0x47d7('0x18')](function(_0x2878bf){_0x3a73f5=_0x2878bf;if(_0x3a73f5&&_0x3a73f5[_0x47d7('0x1e')]){switch(_0x3a73f5[_0x47d7('0x1e')]){case _0x47d7('0x1f'):var _0x6f3169=require(_0x47d7('0x1f'));if(_0x3a73f5[_0x47d7('0x20')]&&_0x3a73f5['authToken']&&_0x3a73f5[_0x47d7('0x21')]){var _0xabff7e=new _0x6f3169(_0x3a73f5[_0x47d7('0x20')],_0x3a73f5['authToken']);_0xabff7e[_0x47d7('0x22')]['create']({'body':_0x328ee6[_0x47d7('0xc')],'to':_0x47d7('0x23')+_0x328ee6[_0x47d7('0x21')],'from':_0x47d7('0x23')+_0x3a73f5[_0x47d7('0x21')],'statusCallback':_0x3a73f5[_0x47d7('0x24')]+_0x47d7('0x25')+_0x328ee6['id']+_0x47d7('0x26')+_0x3a73f5['token']})[_0x47d7('0x18')](function(_0x437afa){if(_0x437afa[_0x47d7('0x27')]){return _0x3c338b[_0x47d7('0x19')]({'messageId':_0x437afa[_0x47d7('0x27')]});}})[_0x47d7('0x1a')](function(_0x16c743){logger[_0x47d7('0x1b')](_0x47d7('0x28'),_0x47d7('0x29'),_0x47d7('0x1f'),util[_0x47d7('0x2a')](_0x16c743,{'showHidden':![],'depth':null}));});}else{logger[_0x47d7('0x1b')](_0x47d7('0x28'),'afterCreate','twilio',_0x47d7('0x2b'));}break;case'sinch':var _0x213b55=_0x3a73f5[_0x47d7('0x20')];var _0x497e16=_0x3a73f5['authToken'];var _0x12e0f5=_0x3a73f5[_0x47d7('0x2c')]+_0x47d7('0x2d')+_0x213b55+'/messages/';var _0x3fde6f={'to':[_0x328ee6['phone']],'message':{'type':_0x47d7('0x2e'),'text':_0x328ee6['body']}};var _0x376fbd={'method':_0x47d7('0x2f'),'uri':_0x12e0f5,'headers':{'Authorization':'Bearer\x20'+_0x497e16,'Content-Type':_0x47d7('0x30')},'body':_0x3fde6f,'json':!![]};rp(_0x376fbd)[_0x47d7('0x18')](function(_0x52b15a){if(_0x52b15a[_0x47d7('0x31')][0x0][_0x47d7('0x32')]){return _0x3c338b[_0x47d7('0x19')]({'messageId':_0x52b15a['statuses'][0x0][_0x47d7('0x32')]});}})['catch'](function(_0x134b7f){logger[_0x47d7('0x33')](_0x47d7('0x34'),_0x134b7f);});break;}}})['finally'](function(){_0x7d6dbe();});}else{_0x7d6dbe();}}},'charset':_0x47d7('0x35'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x94ff=['update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','then','twilio','accountSid','authToken','phone','create','whatsapp:','remote','/api/whatsapp/messages/','sid','afterCreate','inspect','sinch','/whatsapp/v1/','/messages/','text','POST','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId'];(function(_0x2561ef,_0x37fed4){var _0x2ebd99=function(_0x435230){while(--_0x435230){_0x2561ef['push'](_0x2561ef['shift']());}};_0x2ebd99(++_0x37fed4);}(_0x94ff,0x181));var _0xf94f=function(_0x3f81d,_0x42b9bf){_0x3f81d=_0x3f81d-0x0;var _0x4f5fe6=_0x94ff[_0x3f81d];return _0x4f5fe6;};'use strict';var _=require(_0xf94f('0x0'));var util=require(_0xf94f('0x1'));var logger=require(_0xf94f('0x2'))(_0xf94f('0x3'));var moment=require(_0xf94f('0x4'));var BPromise=require(_0xf94f('0x5'));var rp=require(_0xf94f('0x6'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0xf94f('0x7'));var rimraf=require(_0xf94f('0x8'));var config=require(_0xf94f('0x9'));var attributes=require(_0xf94f('0xa'));module[_0xf94f('0xb')]=function(_0x1f3100,_0x50ab42){return _0x1f3100[_0xf94f('0xc')](_0xf94f('0xd'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xf94f('0xe'),'fields':['messageId']},{'name':_0xf94f('0xf'),'fields':[_0xf94f('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x328935,_0x2de5f7,_0x25ad35){var _0x53c0ea=_0x1f3100[_0xf94f('0x11')];var _0x662eb5=_0x328935[_0xf94f('0x12')]({'plain':!![]});if(_0x662eb5[_0xf94f('0x13')][_0xf94f('0x14')]()==='in'||_0x662eb5['direction']['toLowerCase']()===_0xf94f('0x15')&&!_0x662eb5[_0xf94f('0x16')]&&!_[_0xf94f('0x17')](_0x662eb5[_0xf94f('0x18')])){_0x53c0ea[_0xf94f('0x19')][_0xf94f('0x1a')]({'where':{'id':_0x662eb5[_0xf94f('0x1b')]}})['then'](function(_0x9bbba6){if(_0x9bbba6){_0x9bbba6[_0xf94f('0x1c')]({'lastMsgAt':_0x662eb5[_0xf94f('0x1d')],'lastMsgDirection':_0x662eb5[_0xf94f('0x13')]['toLowerCase']()});}})[_0xf94f('0x1e')](function(_0x310f35){console[_0xf94f('0x1f')](_0x310f35);});}if(_0x662eb5['direction']===_0xf94f('0x15')&&!_0x662eb5['secret']){var _0x2eb0fc;_0x53c0ea[_0xf94f('0x20')][_0xf94f('0x21')]({'where':{'id':_0x662eb5[_0xf94f('0x22')]},'raw':!![]})[_0xf94f('0x23')](function(_0x2a4430){_0x2eb0fc=_0x2a4430;if(_0x2eb0fc&&_0x2eb0fc['type']){switch(_0x2eb0fc['type']){case'twilio':var _0x47825a=require(_0xf94f('0x24'));if(_0x2eb0fc[_0xf94f('0x25')]&&_0x2eb0fc[_0xf94f('0x26')]&&_0x2eb0fc[_0xf94f('0x27')]){var _0x280291=new _0x47825a(_0x2eb0fc['accountSid'],_0x2eb0fc[_0xf94f('0x26')]);_0x280291['messages'][_0xf94f('0x28')]({'body':_0x662eb5[_0xf94f('0x10')],'to':_0xf94f('0x29')+_0x662eb5[_0xf94f('0x27')],'from':'whatsapp:'+_0x2eb0fc[_0xf94f('0x27')],'statusCallback':_0x2eb0fc[_0xf94f('0x2a')]+_0xf94f('0x2b')+_0x662eb5['id']+'/status?token='+_0x2eb0fc['token']})[_0xf94f('0x23')](function(_0x3c94ec){if(_0x3c94ec[_0xf94f('0x2c')]){return _0x328935[_0xf94f('0x1c')]({'messageId':_0x3c94ec[_0xf94f('0x2c')]});}})[_0xf94f('0x1e')](function(_0x3321c8){logger[_0xf94f('0x1f')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xf94f('0x2d'),'twilio',util[_0xf94f('0x2e')](_0x3321c8,{'showHidden':![],'depth':null}));});}else{logger[_0xf94f('0x1f')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf94f('0x24'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xf94f('0x2f'):var _0xa41539=_0x2eb0fc[_0xf94f('0x25')];var _0x180458=_0x2eb0fc[_0xf94f('0x26')];var _0x36a2d0=_0x2eb0fc['baseUrl']+_0xf94f('0x30')+_0xa41539+_0xf94f('0x31');var _0x54ed14={'to':[_0x662eb5[_0xf94f('0x27')]],'message':{'type':_0xf94f('0x32'),'text':_0x662eb5['body']}};var _0xc3e66a={'method':_0xf94f('0x33'),'uri':_0x36a2d0,'headers':{'Authorization':'Bearer\x20'+_0x180458,'Content-Type':_0xf94f('0x34')},'body':_0x54ed14,'json':!![]};rp(_0xc3e66a)[_0xf94f('0x23')](function(_0x14e267){if(_0x14e267['statuses'][0x0][_0xf94f('0x35')]){return _0x328935[_0xf94f('0x1c')]({'messageId':_0x14e267[_0xf94f('0x36')][0x0]['message_id']});}})[_0xf94f('0x1e')](function(_0x587ef8){logger[_0xf94f('0x37')](_0xf94f('0x38'),_0x587ef8);});break;}}})[_0xf94f('0x39')](function(){_0x25ad35();});}else{_0x25ad35();}}},'charset':_0xf94f('0x3a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 80b45ec..eba790e 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 _0xdc2d=['./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','then','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost'];(function(_0x415004,_0x22909f){var _0x3f829f=function(_0x21e590){while(--_0x21e590){_0x415004['push'](_0x415004['shift']());}};_0x3f829f(++_0x22909f);}(_0xdc2d,0x167));var _0xddc2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdc2d[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xddc2('0x0'));var util=require('util');var moment=require(_0xddc2('0x1'));var BPromise=require(_0xddc2('0x2'));var rs=require(_0xddc2('0x3'));var fs=require('fs');var Redis=require(_0xddc2('0x4'));var db=require(_0xddc2('0x5'))['db'];var utils=require(_0xddc2('0x6'));var logger=require(_0xddc2('0x7'))(_0xddc2('0x8'));var config=require(_0xddc2('0x9'));var jayson=require(_0xddc2('0xa'));var client=jayson['client'][_0xddc2('0xb')]({'port':0x232a});config['redis']=_[_0xddc2('0xc')](config[_0xddc2('0xd')],{'host':_0xddc2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xddc2('0xf'))[_0xddc2('0x10')](socket);function respondWithRpcPromise(_0x8e0195,_0x56fabf,_0x12ef9d){return new BPromise(function(_0x1ee4a7,_0x82d97f){return client[_0xddc2('0x11')](_0x8e0195,_0x12ef9d)['then'](function(_0x59abfe){logger[_0xddc2('0x12')](_0xddc2('0x13'),_0x56fabf,_0xddc2('0x14'));logger[_0xddc2('0x15')](_0xddc2('0x16'),_0x56fabf,_0xddc2('0x14'),JSON['stringify'](_0x59abfe));if(_0x59abfe[_0xddc2('0x17')]){if(_0x59abfe[_0xddc2('0x17')][_0xddc2('0x18')]===0x1f4){logger[_0xddc2('0x17')](_0xddc2('0x13'),_0x56fabf,_0x59abfe[_0xddc2('0x17')][_0xddc2('0x19')]);return _0x82d97f(_0x59abfe[_0xddc2('0x17')][_0xddc2('0x19')]);}logger['error'](_0xddc2('0x13'),_0x56fabf,_0x59abfe[_0xddc2('0x17')][_0xddc2('0x19')]);return _0x1ee4a7(_0x59abfe['error']['message']);}else{logger[_0xddc2('0x12')](_0xddc2('0x13'),_0x56fabf,_0xddc2('0x14'));_0x1ee4a7(_0x59abfe['result'][_0xddc2('0x19')]);}})['catch'](function(_0x3faeb7){logger[_0xddc2('0x17')](_0xddc2('0x13'),_0x56fabf,_0x3faeb7);_0x82d97f(_0x3faeb7);});});}exports[_0xddc2('0x1a')]=function(_0x175e0f){var _0x23d765=this;return new Promise(function(_0xc734a8,_0x568ff1){return db[_0xddc2('0x1b')][_0xddc2('0x1c')](_0x175e0f[_0xddc2('0x1d')],{'raw':_0x175e0f[_0xddc2('0x1e')]?_0x175e0f['options'][_0xddc2('0x1f')]===undefined?!![]:![]:!![]})[_0xddc2('0x20')](function(_0x2677a4){logger[_0xddc2('0x12')](_0xddc2('0x1a'),_0x175e0f);logger[_0xddc2('0x15')](_0xddc2('0x1a'),_0x175e0f,JSON[_0xddc2('0x21')](_0x2677a4));_0xc734a8(_0x2677a4);})['catch'](function(_0x4148c2){logger[_0xddc2('0x17')](_0xddc2('0x1a'),_0x4148c2[_0xddc2('0x19')],_0x175e0f);_0x568ff1(_0x23d765[_0xddc2('0x17')](0x1f4,_0x4148c2[_0xddc2('0x19')]));});});}; \ No newline at end of file +var _0x686d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','create','body','options','raw','CreateWhatsappMessage','lodash','util','moment'];(function(_0xea693f,_0x4075be){var _0x1955af=function(_0x124263){while(--_0x124263){_0xea693f['push'](_0xea693f['shift']());}};_0x1955af(++_0x4075be);}(_0x686d,0x141));var _0xd686=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0x686d[_0x5c2a2b];return _0x19921f;};'use strict';var _=require(_0xd686('0x0'));var util=require(_0xd686('0x1'));var moment=require(_0xd686('0x2'));var BPromise=require('bluebird');var rs=require(_0xd686('0x3'));var fs=require('fs');var Redis=require(_0xd686('0x4'));var db=require(_0xd686('0x5'))['db'];var utils=require(_0xd686('0x6'));var logger=require(_0xd686('0x7'))(_0xd686('0x8'));var config=require(_0xd686('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd686('0xa')][_0xd686('0xb')]({'port':0x232a});config[_0xd686('0xc')]=_[_0xd686('0xd')](config['redis'],{'host':_0xd686('0xe'),'port':0x18eb});var socket=require(_0xd686('0xf'))(new Redis(config[_0xd686('0xc')]));require(_0xd686('0x10'))[_0xd686('0x11')](socket);function respondWithRpcPromise(_0x4915ff,_0x5cf991,_0x16c6ef){return new BPromise(function(_0x91046a,_0x167149){return client[_0xd686('0x12')](_0x4915ff,_0x16c6ef)[_0xd686('0x13')](function(_0x2a45ab){logger[_0xd686('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x5cf991,_0xd686('0x15'));logger[_0xd686('0x16')](_0xd686('0x17'),_0x5cf991,_0xd686('0x15'),JSON[_0xd686('0x18')](_0x2a45ab));if(_0x2a45ab[_0xd686('0x19')]){if(_0x2a45ab['error'][_0xd686('0x1a')]===0x1f4){logger['error'](_0xd686('0x1b'),_0x5cf991,_0x2a45ab[_0xd686('0x19')]['message']);return _0x167149(_0x2a45ab[_0xd686('0x19')][_0xd686('0x1c')]);}logger[_0xd686('0x19')](_0xd686('0x1b'),_0x5cf991,_0x2a45ab[_0xd686('0x19')][_0xd686('0x1c')]);return _0x91046a(_0x2a45ab[_0xd686('0x19')][_0xd686('0x1c')]);}else{logger['info'](_0xd686('0x1b'),_0x5cf991,_0xd686('0x15'));_0x91046a(_0x2a45ab[_0xd686('0x1d')][_0xd686('0x1c')]);}})[_0xd686('0x1e')](function(_0x1d30ab){logger[_0xd686('0x19')](_0xd686('0x1b'),_0x5cf991,_0x1d30ab);_0x167149(_0x1d30ab);});});}exports['CreateWhatsappMessage']=function(_0x596899){var _0x43f6cc=this;return new Promise(function(_0x1f5f92,_0x3e8f49){return db['WhatsappMessage'][_0xd686('0x1f')](_0x596899[_0xd686('0x20')],{'raw':_0x596899['options']?_0x596899[_0xd686('0x21')][_0xd686('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x492bdf){logger[_0xd686('0x14')]('CreateWhatsappMessage',_0x596899);logger['debug'](_0xd686('0x23'),_0x596899,JSON['stringify'](_0x492bdf));_0x1f5f92(_0x492bdf);})['catch'](function(_0x5a5270){logger[_0xd686('0x19')](_0xd686('0x23'),_0x5a5270['message'],_0x596899);_0x3e8f49(_0x43f6cc[_0xd686('0x19')](0x1f4,_0x5a5270[_0xd686('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index ac99cec..d394386 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 _0xecdd=['save','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xecdd,0x6f));var _0xdecd=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xecdd[_0x3ab9ee];return _0x82ee88;};'use strict';var WhatsappMessageEvents=require(_0xdecd('0x0'));var events=[_0xdecd('0x1'),'remove','update'];function createListener(_0x48383d,_0x13777b){return function(_0x14a5e3){_0x13777b[_0xdecd('0x2')](_0x48383d,_0x14a5e3);};}function removeListener(_0x2a82d0,_0x81e4ff){return function(){WhatsappMessageEvents[_0xdecd('0x3')](_0x2a82d0,_0x81e4ff);};}exports[_0xdecd('0x4')]=function(_0x41aac4){for(var _0x84156c=0x0,_0x39ed22=events[_0xdecd('0x5')];_0x84156c<_0x39ed22;_0x84156c++){var _0x590b5c=events[_0x84156c];var _0x50a5f2=createListener(_0xdecd('0x6')+_0x590b5c,_0x41aac4);WhatsappMessageEvents['on'](_0x590b5c,_0x50a5f2);}}; \ No newline at end of file +var _0xc606=['update','removeListener','register','length','whatsappMessage:'];(function(_0xee3051,_0xbe4f18){var _0x139e81=function(_0xac81c3){while(--_0xac81c3){_0xee3051['push'](_0xee3051['shift']());}};_0x139e81(++_0xbe4f18);}(_0xc606,0x1a4));var _0x6c60=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0xc606[_0xf16b1];return _0x26f94d;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save','remove',_0x6c60('0x0')];function createListener(_0x5b8fe3,_0x5a83d9){return function(_0x21f65e){_0x5a83d9['emit'](_0x5b8fe3,_0x21f65e);};}function removeListener(_0x54d39c,_0x13868c){return function(){WhatsappMessageEvents[_0x6c60('0x1')](_0x54d39c,_0x13868c);};}exports[_0x6c60('0x2')]=function(_0x581131){for(var _0x35c023=0x0,_0x1db213=events[_0x6c60('0x3')];_0x35c023<_0x1db213;_0x35c023++){var _0x2430db=events[_0x35c023];var _0x3cb4c7=createListener(_0x6c60('0x4')+_0x2430db,_0x581131);WhatsappMessageEvents['on'](_0x2430db,_0x3cb4c7);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index da3bf2f..e96ba35 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 _0x8fcd=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getTeams','getAgents','create','post','/:id/teams','addTeams','put','update','delete','destroy','removeTeams','/:id/users','exports','util'];(function(_0x34dd0e,_0x1f965b){var _0x7ac476=function(_0x5dd593){while(--_0x5dd593){_0x34dd0e['push'](_0x34dd0e['shift']());}};_0x7ac476(++_0x1f965b);}(_0x8fcd,0x137));var _0xd8fc=function(_0x25d395,_0x33b581){_0x25d395=_0x25d395-0x0;var _0x23d48a=_0x8fcd[_0x25d395];return _0x23d48a;};'use strict';var multer=require('multer');var util=require(_0xd8fc('0x0'));var path=require('path');var timeout=require(_0xd8fc('0x1'));var express=require(_0xd8fc('0x2'));var router=express['Router']();var fs_extra=require(_0xd8fc('0x3'));var auth=require(_0xd8fc('0x4'));var interaction=require(_0xd8fc('0x5'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0xd8fc('0x6')]('/',auth[_0xd8fc('0x7')](),controller[_0xd8fc('0x8')]);router[_0xd8fc('0x6')](_0xd8fc('0x9'),auth[_0xd8fc('0x7')](),controller[_0xd8fc('0xa')]);router[_0xd8fc('0x6')](_0xd8fc('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd8fc('0x6')](_0xd8fc('0xc'),auth[_0xd8fc('0x7')](),controller['getMembers']);router['get']('/:id/teams',auth[_0xd8fc('0x7')](),controller[_0xd8fc('0xd')]);router[_0xd8fc('0x6')]('/:id/users',auth[_0xd8fc('0x7')](),controller[_0xd8fc('0xe')]);router['post']('/',auth[_0xd8fc('0x7')](),controller[_0xd8fc('0xf')]);router[_0xd8fc('0x10')](_0xd8fc('0x11'),auth[_0xd8fc('0x7')](),controller[_0xd8fc('0x12')]);router[_0xd8fc('0x10')]('/:id/users',auth[_0xd8fc('0x7')](),controller['addAgents']);router[_0xd8fc('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd8fc('0x14')]);router[_0xd8fc('0x15')](_0xd8fc('0xb'),auth['isAuthenticated'](),controller[_0xd8fc('0x16')]);router['delete']('/:id/teams',auth[_0xd8fc('0x7')](),controller[_0xd8fc('0x17')]);router[_0xd8fc('0x15')](_0xd8fc('0x18'),auth[_0xd8fc('0x7')](),controller['removeAgents']);module[_0xd8fc('0x19')]=router; \ No newline at end of file +var _0xfb11=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','update','destroy','delete','removeTeams','removeAgents','exports','util','path','connect-timeout'];(function(_0x21e21c,_0x4c77f3){var _0xd905cd=function(_0xbf7e4f){while(--_0xbf7e4f){_0x21e21c['push'](_0x21e21c['shift']());}};_0xd905cd(++_0x4c77f3);}(_0xfb11,0x159));var _0x1fb1=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xfb11[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require('multer');var util=require(_0x1fb1('0x0'));var path=require(_0x1fb1('0x1'));var timeout=require(_0x1fb1('0x2'));var express=require(_0x1fb1('0x3'));var router=express[_0x1fb1('0x4')]();var fs_extra=require(_0x1fb1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1fb1('0x6'));var config=require(_0x1fb1('0x7'));var controller=require(_0x1fb1('0x8'));router[_0x1fb1('0x9')]('/',auth[_0x1fb1('0xa')](),controller['index']);router[_0x1fb1('0x9')]('/describe',auth[_0x1fb1('0xa')](),controller[_0x1fb1('0xb')]);router[_0x1fb1('0x9')](_0x1fb1('0xc'),auth[_0x1fb1('0xa')](),controller[_0x1fb1('0xd')]);router['get'](_0x1fb1('0xe'),auth[_0x1fb1('0xa')](),controller[_0x1fb1('0xf')]);router[_0x1fb1('0x9')](_0x1fb1('0x10'),auth[_0x1fb1('0xa')](),controller[_0x1fb1('0x11')]);router[_0x1fb1('0x9')](_0x1fb1('0x12'),auth[_0x1fb1('0xa')](),controller[_0x1fb1('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1fb1('0x14')]);router[_0x1fb1('0x15')](_0x1fb1('0x10'),auth[_0x1fb1('0xa')](),controller[_0x1fb1('0x16')]);router['post'](_0x1fb1('0x12'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x1fb1('0xc'),auth[_0x1fb1('0xa')](),controller[_0x1fb1('0x17')]);router['delete'](_0x1fb1('0xc'),auth[_0x1fb1('0xa')](),controller[_0x1fb1('0x18')]);router[_0x1fb1('0x19')](_0x1fb1('0x10'),auth[_0x1fb1('0xa')](),controller[_0x1fb1('0x1a')]);router[_0x1fb1('0x19')](_0x1fb1('0x12'),auth[_0x1fb1('0xa')](),controller[_0x1fb1('0x1b')]);module[_0x1fb1('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index d10c15c..0d1e01d 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 _0x2504=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x452ddc,_0x2aee82){var _0x982d84=function(_0xdc672f){while(--_0xdc672f){_0x452ddc['push'](_0x452ddc['shift']());}};_0x982d84(++_0x2aee82);}(_0x2504,0xee));var _0x4250=function(_0x3a6c9f,_0x486666){_0x3a6c9f=_0x3a6c9f-0x0;var _0x43aaa7=_0x2504[_0x3a6c9f];return _0x43aaa7;};'use strict';var Sequelize=require(_0x4250('0x0'));module[_0x4250('0x1')]={'name':{'type':Sequelize[_0x4250('0x2')],'unique':_0x4250('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4250('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4250('0x5')](_0x4250('0x6'),_0x4250('0x7'),_0x4250('0x8'))},'description':{'type':Sequelize[_0x4250('0x2')]}}; \ No newline at end of file +var _0x9e0d=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x3054f8,_0x1e6528){var _0x45d366=function(_0x433b77){while(--_0x433b77){_0x3054f8['push'](_0x3054f8['shift']());}};_0x45d366(++_0x1e6528);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x48ef81,_0x1e2858){_0x48ef81=_0x48ef81-0x0;var _0xcd5a12=_0x9e0d[_0x48ef81];return _0xcd5a12;};'use strict';var Sequelize=require(_0xd9e0('0x0'));module[_0xd9e0('0x1')]={'name':{'type':Sequelize[_0xd9e0('0x2')],'unique':_0xd9e0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd9e0('0x4')](_0xd9e0('0x5'),_0xd9e0('0x6'),_0xd9e0('0x7'))},'description':{'type':Sequelize[_0xd9e0('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 0b3f3a0..a15a618 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 _0xcb80=['include','WhatsappQueue','rows','catch','show','find','create','body','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','UserWhatsappQueue','WhatsappQueueId','filter','findAll','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','count','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','omit','isArray','getAgents','findOne','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','json','offset','undefined','limit','status','Content-Range','apply','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','end','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xcb80,0x1db));var _0x0cb8=function(_0x221d6d,_0x60a157){_0x221d6d=_0x221d6d-0x0;var _0x160e5a=_0xcb80[_0x221d6d];return _0x160e5a;};'use strict';var emlformat=require(_0x0cb8('0x0'));var rimraf=require(_0x0cb8('0x1'));var zipdir=require(_0x0cb8('0x2'));var jsonpatch=require(_0x0cb8('0x3'));var rp=require(_0x0cb8('0x4'));var moment=require(_0x0cb8('0x5'));var BPromise=require(_0x0cb8('0x6'));var Mustache=require(_0x0cb8('0x7'));var util=require(_0x0cb8('0x8'));var path=require(_0x0cb8('0x9'));var sox=require(_0x0cb8('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cb8('0xb'));var _=require(_0x0cb8('0xc'));var squel=require(_0x0cb8('0xd'));var crypto=require(_0x0cb8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0cb8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0cb8('0x10'));var Papa=require(_0x0cb8('0x11'));var Redis=require(_0x0cb8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0cb8('0x13'));var as=require(_0x0cb8('0x14'));var hardwareService=require(_0x0cb8('0x15'));var logger=require(_0x0cb8('0x16'))(_0x0cb8('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0cb8('0x18'));var db=require('../../mysqldb')['db'];config[_0x0cb8('0x19')]=_['defaults'](config[_0x0cb8('0x19')],{'host':_0x0cb8('0x1a'),'port':0x18eb});var socket=require(_0x0cb8('0x1b'))(new Redis(config[_0x0cb8('0x19')]));require(_0x0cb8('0x1c'))[_0x0cb8('0x1d')](socket);function respondWithStatusCode(_0x364d9a,_0x32efe9){_0x32efe9=_0x32efe9||0xcc;return function(_0x360621){if(_0x360621){return _0x364d9a[_0x0cb8('0x1e')](_0x32efe9);}return _0x364d9a['status'](_0x32efe9)['end']();};}function respondWithResult(_0x571885,_0x4eb66b){_0x4eb66b=_0x4eb66b||0xc8;return function(_0xaa442c){if(_0xaa442c){return _0x571885['status'](_0x4eb66b)[_0x0cb8('0x1f')](_0xaa442c);}};}function respondWithFilteredResult(_0x3309cd,_0x377dd8){return function(_0x5f2bbf){if(_0x5f2bbf){var _0x1c7b0b=typeof _0x377dd8[_0x0cb8('0x20')]===_0x0cb8('0x21')&&typeof _0x377dd8[_0x0cb8('0x22')]==='undefined';var _0x3b4326=_0x5f2bbf['count'];var _0x388b32=_0x1c7b0b?0x0:_0x377dd8['offset'];var _0x2b44dd=_0x1c7b0b?_0x5f2bbf['count']:_0x377dd8[_0x0cb8('0x20')]+_0x377dd8[_0x0cb8('0x22')];var _0x170c24;if(_0x2b44dd>=_0x3b4326){_0x2b44dd=_0x3b4326;_0x170c24=0xc8;}else{_0x170c24=0xce;}_0x3309cd[_0x0cb8('0x23')](_0x170c24);return _0x3309cd['set'](_0x0cb8('0x24'),_0x388b32+'-'+_0x2b44dd+'/'+_0x3b4326)[_0x0cb8('0x1f')](_0x5f2bbf);}return null;};}function patchUpdates(_0x121fd6){return function(_0x534f08){try{jsonpatch[_0x0cb8('0x25')](_0x534f08,_0x121fd6,!![]);}catch(_0x4a98e0){return BPromise['reject'](_0x4a98e0);}return _0x534f08[_0x0cb8('0x26')]();};}function saveUpdates(_0x744f61,_0x23f3cb){return function(_0x4984fa){if(_0x4984fa){return _0x4984fa[_0x0cb8('0x27')](_0x744f61)[_0x0cb8('0x28')](function(_0x385707){return _0x385707;});}return null;};}function removeEntity(_0x2f6cd8,_0x45bacc){return function(_0x28079f){if(_0x28079f){return _0x28079f[_0x0cb8('0x29')]()[_0x0cb8('0x28')](function(){var _0x29e6ae=_0x28079f[_0x0cb8('0x2a')]({'plain':!![]});var _0x57d86b=_0x0cb8('0x2b');return db[_0x0cb8('0x2c')]['destroy']({'where':{'type':_0x57d86b,'resourceId':_0x29e6ae['id']}})['then'](function(){return _0x28079f;});})['then'](function(){_0x2f6cd8[_0x0cb8('0x23')](0xcc)[_0x0cb8('0x2d')]();});}};}function handleEntityNotFound(_0x6d7c93,_0x21d9a7){return function(_0x3da241){if(!_0x3da241){_0x6d7c93[_0x0cb8('0x1e')](0x194);}return _0x3da241;};}function handleError(_0x2d24ad,_0x301246){_0x301246=_0x301246||0x1f4;return function(_0x51dd4a){logger['error'](_0x51dd4a['stack']);if(_0x51dd4a[_0x0cb8('0x2e')]){delete _0x51dd4a[_0x0cb8('0x2e')];}_0x2d24ad[_0x0cb8('0x23')](_0x301246)['send'](_0x51dd4a);};}exports[_0x0cb8('0x2f')]=function(_0x231ebc,_0x336142){var _0x345c7b={},_0x391c41={},_0xb0beb7={'count':0x0,'rows':[]};var _0x16c74d=_[_0x0cb8('0x30')](db['WhatsappQueue'][_0x0cb8('0x31')],function(_0x1872a3){return{'name':_0x1872a3[_0x0cb8('0x32')],'type':_0x1872a3[_0x0cb8('0x33')][_0x0cb8('0x34')]};});_0x391c41[_0x0cb8('0x35')]=_[_0x0cb8('0x30')](_0x16c74d,_0x0cb8('0x2e'));_0x391c41['query']=_[_0x0cb8('0x36')](_0x231ebc[_0x0cb8('0x37')]);_0x391c41[_0x0cb8('0x38')]=_[_0x0cb8('0x39')](_0x391c41[_0x0cb8('0x35')],_0x391c41['query']);_0x345c7b[_0x0cb8('0x3a')]=_[_0x0cb8('0x39')](_0x391c41['model'],qs[_0x0cb8('0x3b')](_0x231ebc['query'][_0x0cb8('0x3b')]));_0x345c7b[_0x0cb8('0x3a')]=_0x345c7b[_0x0cb8('0x3a')][_0x0cb8('0x3c')]?_0x345c7b[_0x0cb8('0x3a')]:_0x391c41['model'];if(!_0x231ebc['query'][_0x0cb8('0x3d')](_0x0cb8('0x3e'))){_0x345c7b[_0x0cb8('0x22')]=qs[_0x0cb8('0x22')](_0x231ebc[_0x0cb8('0x37')][_0x0cb8('0x22')]);_0x345c7b['offset']=qs[_0x0cb8('0x20')](_0x231ebc[_0x0cb8('0x37')]['offset']);}_0x345c7b['order']=qs[_0x0cb8('0x3f')](_0x231ebc['query']['sort']);_0x345c7b[_0x0cb8('0x40')]=qs[_0x0cb8('0x38')](_[_0x0cb8('0x41')](_0x231ebc[_0x0cb8('0x37')],_0x391c41[_0x0cb8('0x38')]),_0x16c74d);if(_0x231ebc[_0x0cb8('0x37')]['filter']){_0x345c7b[_0x0cb8('0x40')]=_[_0x0cb8('0x42')](_0x345c7b[_0x0cb8('0x40')],{'$or':_[_0x0cb8('0x30')](_0x16c74d,function(_0x5a37b2){if(_0x5a37b2[_0x0cb8('0x33')]!==_0x0cb8('0x43')){var _0x57d975={};_0x57d975[_0x5a37b2[_0x0cb8('0x2e')]]={'$like':'%'+_0x231ebc[_0x0cb8('0x37')]['filter']+'%'};return _0x57d975;}})});}_0x345c7b=_[_0x0cb8('0x42')]({},_0x345c7b,_0x231ebc[_0x0cb8('0x44')]);var _0x25a7a1={'where':_0x345c7b[_0x0cb8('0x40')]};return db['WhatsappQueue']['count'](_0x25a7a1)[_0x0cb8('0x28')](function(_0x3abb32){_0xb0beb7['count']=_0x3abb32;if(_0x231ebc['query']['includeAll']){_0x345c7b[_0x0cb8('0x45')]=[{'all':!![]}];}return db[_0x0cb8('0x46')]['findAll'](_0x345c7b);})[_0x0cb8('0x28')](function(_0x59a90c){_0xb0beb7[_0x0cb8('0x47')]=_0x59a90c;return _0xb0beb7;})[_0x0cb8('0x28')](respondWithFilteredResult(_0x336142,_0x345c7b))[_0x0cb8('0x48')](handleError(_0x336142,null));};exports[_0x0cb8('0x49')]=function(_0x58d0ec,_0x10df28){var _0x11385f={'raw':!![],'where':{'id':_0x58d0ec['params']['id']}},_0x512a21={};_0x512a21[_0x0cb8('0x35')]=_[_0x0cb8('0x36')](db[_0x0cb8('0x46')][_0x0cb8('0x31')]);_0x512a21['query']=_[_0x0cb8('0x36')](_0x58d0ec[_0x0cb8('0x37')]);_0x512a21['filters']=_[_0x0cb8('0x39')](_0x512a21['model'],_0x512a21[_0x0cb8('0x37')]);_0x11385f[_0x0cb8('0x3a')]=_[_0x0cb8('0x39')](_0x512a21['model'],qs[_0x0cb8('0x3b')](_0x58d0ec[_0x0cb8('0x37')][_0x0cb8('0x3b')]));_0x11385f[_0x0cb8('0x3a')]=_0x11385f[_0x0cb8('0x3a')][_0x0cb8('0x3c')]?_0x11385f[_0x0cb8('0x3a')]:_0x512a21[_0x0cb8('0x35')];if(_0x58d0ec[_0x0cb8('0x37')]['includeAll']){_0x11385f[_0x0cb8('0x45')]=[{'all':!![]}];}_0x11385f=_[_0x0cb8('0x42')]({},_0x11385f,_0x58d0ec[_0x0cb8('0x44')]);return db[_0x0cb8('0x46')][_0x0cb8('0x4a')](_0x11385f)[_0x0cb8('0x28')](handleEntityNotFound(_0x10df28,null))[_0x0cb8('0x28')](respondWithResult(_0x10df28,null))[_0x0cb8('0x48')](handleError(_0x10df28,null));};exports[_0x0cb8('0x4b')]=function(_0x4347cc,_0x3be1cb){return db[_0x0cb8('0x46')]['create'](_0x4347cc[_0x0cb8('0x4c')],{})[_0x0cb8('0x28')](function(_0x5d3313){var _0xd0a7d2=_0x4347cc['user'][_0x0cb8('0x2a')]({'plain':!![]});if(!_0xd0a7d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd0a7d2[_0x0cb8('0x4d')]===_0x0cb8('0x4e')){var _0x41c497=_0x5d3313[_0x0cb8('0x2a')]({'plain':!![]});var _0x3520a2=_0x0cb8('0x2b');return db[_0x0cb8('0x4f')][_0x0cb8('0x4a')]({'where':{'name':_0x3520a2,'userProfileId':_0xd0a7d2['userProfileId']},'raw':!![]})[_0x0cb8('0x28')](function(_0x1e496b){if(_0x1e496b&&_0x1e496b[_0x0cb8('0x50')]===0x0){return db['UserProfileResource'][_0x0cb8('0x4b')]({'name':_0x41c497[_0x0cb8('0x2e')],'resourceId':_0x41c497['id'],'type':_0x1e496b[_0x0cb8('0x2e')],'sectionId':_0x1e496b['id']},{})[_0x0cb8('0x28')](function(){return _0x5d3313;});}else{return _0x5d3313;}})[_0x0cb8('0x48')](function(_0x180088){logger[_0x0cb8('0x51')](_0x0cb8('0x52'),_0x180088);throw _0x180088;});}return _0x5d3313;})[_0x0cb8('0x28')](respondWithResult(_0x3be1cb,0xc9))[_0x0cb8('0x48')](handleError(_0x3be1cb,null));};exports['update']=function(_0x40d912,_0x33b806){if(_0x40d912[_0x0cb8('0x4c')]['id']){delete _0x40d912['body']['id'];}return db[_0x0cb8('0x46')][_0x0cb8('0x4a')]({'where':{'id':_0x40d912['params']['id']}})[_0x0cb8('0x28')](handleEntityNotFound(_0x33b806,null))['then'](saveUpdates(_0x40d912[_0x0cb8('0x4c')],null))[_0x0cb8('0x28')](respondWithResult(_0x33b806,null))[_0x0cb8('0x48')](handleError(_0x33b806,null));};exports[_0x0cb8('0x29')]=function(_0x32e1b0,_0x1a4435){return db['WhatsappQueue'][_0x0cb8('0x4a')]({'where':{'id':_0x32e1b0[_0x0cb8('0x53')]['id']}})[_0x0cb8('0x28')](handleEntityNotFound(_0x1a4435,null))[_0x0cb8('0x28')](removeEntity(_0x1a4435,null))[_0x0cb8('0x48')](handleError(_0x1a4435,null));};exports['describe']=function(_0xb2fb90,_0x5b9bda){return db['WhatsappQueue']['describe']()[_0x0cb8('0x28')](respondWithResult(_0x5b9bda,null))[_0x0cb8('0x48')](handleError(_0x5b9bda,null));};exports[_0x0cb8('0x54')]=function(_0x4792a7,_0x43471d,_0x4e5f94){var _0x361815={'raw':!![],'where':{}},_0x5d6508={},_0xdc72e2;return db['WhatsappQueue']['findOne']({'where':{'id':_0x4792a7[_0x0cb8('0x53')]['id']}})[_0x0cb8('0x28')](handleEntityNotFound(_0x43471d,null))[_0x0cb8('0x28')](function(_0x102531){if(_0x102531){_0xdc72e2=_0x102531['get']({'plain':!![]});_0x5d6508[_0x0cb8('0x35')]=_[_0x0cb8('0x36')](db[_0x0cb8('0x55')][_0x0cb8('0x31')]);_0x5d6508['query']=_['keys'](_0x4792a7[_0x0cb8('0x37')]);_0x5d6508[_0x0cb8('0x38')]=_[_0x0cb8('0x39')](_0x5d6508[_0x0cb8('0x35')],_0x5d6508['query']);_0x361815[_0x0cb8('0x3a')]=_[_0x0cb8('0x39')](_0x5d6508[_0x0cb8('0x35')],qs['fields'](_0x4792a7[_0x0cb8('0x37')]['fields']));_0x361815[_0x0cb8('0x3a')]=_0x361815[_0x0cb8('0x3a')][_0x0cb8('0x3c')]?_0x361815[_0x0cb8('0x3a')]:_0x5d6508[_0x0cb8('0x35')];if(!_0x4792a7[_0x0cb8('0x37')]['hasOwnProperty'](_0x0cb8('0x3e'))){_0x361815[_0x0cb8('0x22')]=qs[_0x0cb8('0x22')](_0x4792a7[_0x0cb8('0x37')][_0x0cb8('0x22')]);_0x361815[_0x0cb8('0x20')]=qs[_0x0cb8('0x20')](_0x4792a7[_0x0cb8('0x37')][_0x0cb8('0x20')]);}_0x361815['order']=qs['sort'](_0x4792a7[_0x0cb8('0x37')]['sort']);_0x361815[_0x0cb8('0x40')]=qs[_0x0cb8('0x38')](_['pick'](_0x4792a7['query'],_0x5d6508[_0x0cb8('0x38')]));_0x361815[_0x0cb8('0x40')][_0x0cb8('0x56')]=_0x102531['id'];if(_0x4792a7[_0x0cb8('0x37')][_0x0cb8('0x57')]){_0x361815[_0x0cb8('0x40')]=_[_0x0cb8('0x42')](_0x361815['where'],{'$or':_[_0x0cb8('0x30')](_0x361815[_0x0cb8('0x3a')],function(_0x1923f9){var _0x3816b5={};_0x3816b5[_0x1923f9]={'$like':'%'+_0x4792a7[_0x0cb8('0x37')][_0x0cb8('0x57')]+'%'};return _0x3816b5;})});}_0x361815=_[_0x0cb8('0x42')]({},_0x361815,_0x4792a7[_0x0cb8('0x44')]);return db[_0x0cb8('0x55')][_0x0cb8('0x58')](_0x361815);}})[_0x0cb8('0x28')](function(_0x2e9255){if(_0x2e9255){return db[_0x0cb8('0x59')][_0x0cb8('0x5a')]({'where':{'id':_['map'](_0x2e9255,_0x0cb8('0x5b')),'role':_0x0cb8('0x5c')},'attributes':['id',_0x0cb8('0x2e'),_0x0cb8('0x5d'),_0x0cb8('0x5e'),_0x0cb8('0x5f')]});}})[_0x0cb8('0x28')](function(_0x41d982){if(_0x41d982){return{'count':_0x41d982[_0x0cb8('0x60')],'rows':_['map'](_0x41d982[_0x0cb8('0x47')],function(_0x251da2){return{'membername':_0x251da2[_0x0cb8('0x2e')],'UserId':_0x251da2['id'],'queue_name':_0xdc72e2['name'],'WhatsappQueueId':_0xdc72e2['id'],'interface':util['format']('%s/%s','SIP',_0x251da2[_0x0cb8('0x2e')]),'penalty':0x0,'paused':_0x251da2['whatsappPause'],'createdAt':_0x251da2['createdAt'],'updatedAt':_0x251da2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0cb8('0x28')](respondWithFilteredResult(_0x43471d,_0x361815))[_0x0cb8('0x48')](handleError(_0x43471d,null));};exports[_0x0cb8('0x61')]=function(_0x254c5c,_0x5d849f,_0x126a0a){var _0x38b1ab={};var _0xb40a24={};var _0x542cc4;var _0x27d175;return db['WhatsappQueue']['findOne']({'where':{'id':_0x254c5c[_0x0cb8('0x53')]['id']}})[_0x0cb8('0x28')](handleEntityNotFound(_0x5d849f,null))['then'](function(_0xd218b5){if(_0xd218b5){_0x542cc4=_0xd218b5;_0xb40a24[_0x0cb8('0x35')]=_['keys'](db['Team'][_0x0cb8('0x31')]);_0xb40a24[_0x0cb8('0x37')]=_[_0x0cb8('0x36')](_0x254c5c[_0x0cb8('0x37')]);_0xb40a24['filters']=_['intersection'](_0xb40a24[_0x0cb8('0x35')],_0xb40a24['query']);_0x38b1ab[_0x0cb8('0x3a')]=_['intersection'](_0xb40a24['model'],qs[_0x0cb8('0x3b')](_0x254c5c['query']['fields']));_0x38b1ab[_0x0cb8('0x3a')]=_0x38b1ab[_0x0cb8('0x3a')][_0x0cb8('0x3c')]?_0x38b1ab['attributes']:_0xb40a24[_0x0cb8('0x35')];_0x38b1ab['order']=qs[_0x0cb8('0x3f')](_0x254c5c[_0x0cb8('0x37')]['sort']);_0x38b1ab[_0x0cb8('0x40')]=qs[_0x0cb8('0x38')](_['pick'](_0x254c5c[_0x0cb8('0x37')],_0xb40a24['filters']));if(_0x254c5c[_0x0cb8('0x37')][_0x0cb8('0x57')]){_0x38b1ab['where']=_[_0x0cb8('0x42')](_0x38b1ab[_0x0cb8('0x40')],{'$or':_[_0x0cb8('0x30')](_0x38b1ab[_0x0cb8('0x3a')],function(_0x4c5427){var _0x24b165={};_0x24b165[_0x4c5427]={'$like':'%'+_0x254c5c[_0x0cb8('0x37')][_0x0cb8('0x57')]+'%'};return _0x24b165;})});}_0x38b1ab=_[_0x0cb8('0x42')]({},_0x38b1ab,_0x254c5c[_0x0cb8('0x44')]);return _0x542cc4[_0x0cb8('0x61')](_0x38b1ab);}})[_0x0cb8('0x28')](function(_0x142d65){if(_0x142d65){_0x27d175=_0x142d65[_0x0cb8('0x3c')];if(!_0x254c5c[_0x0cb8('0x37')]['hasOwnProperty'](_0x0cb8('0x3e'))){_0x38b1ab['limit']=qs['limit'](_0x254c5c[_0x0cb8('0x37')][_0x0cb8('0x22')]);_0x38b1ab[_0x0cb8('0x20')]=qs[_0x0cb8('0x20')](_0x254c5c['query'][_0x0cb8('0x20')]);}return _0x542cc4[_0x0cb8('0x61')](_0x38b1ab);}})[_0x0cb8('0x28')](function(_0x575f62){if(_0x575f62){return _0x575f62?{'count':_0x27d175,'rows':_0x575f62}:null;}})[_0x0cb8('0x28')](respondWithResult(_0x5d849f,null))[_0x0cb8('0x48')](handleError(_0x5d849f,null));};exports[_0x0cb8('0x62')]=function(_0x21260a,_0x50df58,_0x1cbd59){var _0x55549d=_0x21260a['body'][_0x0cb8('0x63')];return db[_0x0cb8('0x64')]['findAll']({'where':{'id':_0x55549d},'attributes':['id'],'include':[{'model':db[_0x0cb8('0x59')],'as':_0x0cb8('0x65'),'attributes':['id',_0x0cb8('0x2e'),_0x0cb8('0x66'),_0x0cb8('0x67'),_0x0cb8('0x68')],'raw':!![]}]})[_0x0cb8('0x28')](function(_0x515a58){if(_0x515a58){var _0x1457bf=_[_0x0cb8('0x69')](_0x515a58,function(_0x2b90eb){var _0x5d80ab=_0x2b90eb[_0x0cb8('0x2a')]({'plain':!![]});return _0x5d80ab[_0x0cb8('0x65')];});return db[_0x0cb8('0x46')][_0x0cb8('0x4a')]({'where':{'id':_0x21260a[_0x0cb8('0x53')]['id']}})[_0x0cb8('0x28')](function(_0x125951){return db[_0x0cb8('0x6a')][_0x0cb8('0x6b')](function(_0x38f48e){return _0x125951[_0x0cb8('0x62')](_0x55549d,{'transaction':_0x38f48e})['then'](function(){return BPromise[_0x0cb8('0x6c')](_0x1457bf,function(_0x4a396d){return db[_0x0cb8('0x55')][_0x0cb8('0x6d')]({'where':{'UserId':_0x4a396d['id'],'WhatsappQueueId':_0x21260a['params']['id']},'transaction':_0x38f48e});});})[_0x0cb8('0x28')](function(){_0x1457bf[_0x0cb8('0x6e')](function(_0x2ce6b1){socket[_0x0cb8('0x6f')](_0x0cb8('0x70'),{'UserId':_0x2ce6b1['id'],'WhatsappQueueId':_0x125951['id']});});});});});}})[_0x0cb8('0x28')](respondWithStatusCode(_0x50df58,null))[_0x0cb8('0x48')](handleError(_0x50df58,null));};exports[_0x0cb8('0x71')]=function(_0x23e657,_0x193bf0,_0x55f5c3){return db[_0x0cb8('0x64')][_0x0cb8('0x58')]({'where':{'id':_0x23e657[_0x0cb8('0x37')][_0x0cb8('0x63')]},'attributes':['id'],'include':[{'model':db[_0x0cb8('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x193bf0,null))[_0x0cb8('0x28')](function(_0x2f3c1d){var _0x5b21d8=_[_0x0cb8('0x30')](_0x2f3c1d,'id');var _0x4f88ba=[];var _0x219776=[];var _0x4ec11d=squel['select']();_0x4ec11d[_0x0cb8('0x72')]('tq.TeamId')['from'](_0x0cb8('0x73'),'tq')[_0x0cb8('0x74')](_0x0cb8('0x75'),'ut',_0x0cb8('0x76'))[_0x0cb8('0x40')]('WhatsappQueueId\x20=\x20?',_0x23e657[_0x0cb8('0x53')]['id']);for(var _0xad8f30=0x0;_0xad8f30<_0x2f3c1d[_0x0cb8('0x3c')];_0xad8f30+=0x1){let _0x372689=_0x2f3c1d[_0xad8f30];for(var _0x4b3870=0x0;_0x4b3870<_0x372689[_0x0cb8('0x65')][_0x0cb8('0x3c')];_0x4b3870+=0x1){let _0x21a3b2=_0x372689[_0x0cb8('0x65')][_0x4b3870];var _0x18e8cd=_0x4ec11d[_0x0cb8('0x77')]();_0x18e8cd['where']('ut.UserId\x20=\x20?',_0x21a3b2['id']);_0x219776[_0x0cb8('0x78')](db[_0x0cb8('0x6a')][_0x0cb8('0x37')](_0x18e8cd['toString'](),{'type':db[_0x0cb8('0x6a')][_0x0cb8('0x79')]['SELECT']})[_0x0cb8('0x28')](function(_0x4e709c){if(_0x4e709c[_0x0cb8('0x3c')]===0x1){return _0x21a3b2['id'];}else{var _0x25e349=_[_0x0cb8('0x7a')](_[_0x0cb8('0x30')](_0x4e709c,_0x0cb8('0x7b')),function(_0x5d3b45){return _[_0x0cb8('0x7c')](_0x5b21d8,_0x5d3b45);});if(_0x25e349){return _0x21a3b2['id'];}}}));}}return BPromise[_0x0cb8('0x7d')](_0x219776)[_0x0cb8('0x28')](function(_0xe95392){_0x4f88ba=_(_0x4f88ba)[_0x0cb8('0x7e')](_0xe95392)['compact']()[_0x0cb8('0x7f')]();return db[_0x0cb8('0x46')][_0x0cb8('0x4a')]({'where':{'id':_0x23e657[_0x0cb8('0x53')]['id']}})[_0x0cb8('0x28')](function(_0xe780cb){return db[_0x0cb8('0x6a')][_0x0cb8('0x6b')](function(_0x429b40){return _0xe780cb[_0x0cb8('0x71')](_0x23e657[_0x0cb8('0x37')][_0x0cb8('0x63')],{'transaction':_0x429b40})[_0x0cb8('0x28')](function(){if(!_[_0x0cb8('0x80')](_0x4f88ba)){return _0xe780cb[_0x0cb8('0x81')](_0x4f88ba,{'transaction':_0x429b40});}})['then'](function(){_0x4f88ba['forEach'](function(_0x2a2e23){socket[_0x0cb8('0x6f')](_0x0cb8('0x82'),{'UserId':_0x2a2e23,'WhatsappQueueId':_0xe780cb['id']});});});});});});})[_0x0cb8('0x28')](respondWithStatusCode(_0x193bf0,null))[_0x0cb8('0x48')](handleError(_0x193bf0,null));};exports['addAgents']=function(_0x1a21b5,_0x102317,_0xc3363e){return db['WhatsappQueue'][_0x0cb8('0x4a')]({'where':{'id':_0x1a21b5[_0x0cb8('0x53')]['id']}})[_0x0cb8('0x28')](handleEntityNotFound(_0x102317,null))['then'](function(_0x488d09){if(_0x488d09){return _0x488d09['addAgents'](_0x1a21b5['body'][_0x0cb8('0x63')],_[_0x0cb8('0x83')](_0x1a21b5['body'],[_0x0cb8('0x63'),'id'])||{})['spread'](function(_0x55e033){for(var _0x77551d=0x0;_0x77551d<_0x1a21b5[_0x0cb8('0x4c')][_0x0cb8('0x63')][_0x0cb8('0x3c')];_0x77551d+=0x1){socket[_0x0cb8('0x6f')](_0x0cb8('0x70'),{'UserId':Number(_0x1a21b5[_0x0cb8('0x4c')]['ids'][_0x77551d]),'WhatsappQueueId':Number(_0x1a21b5[_0x0cb8('0x53')]['id'])});}return _0x55e033;});}})[_0x0cb8('0x28')](respondWithResult(_0x102317,null))[_0x0cb8('0x48')](handleError(_0x102317,null));};exports[_0x0cb8('0x81')]=function(_0x11e204,_0x20a9b5,_0xba13a){return db[_0x0cb8('0x46')]['find']({'where':{'id':_0x11e204['params']['id']}})[_0x0cb8('0x28')](handleEntityNotFound(_0x20a9b5,null))[_0x0cb8('0x28')](function(_0x622677){if(_0x622677){return _0x622677[_0x0cb8('0x81')](_0x11e204[_0x0cb8('0x37')]['ids'])[_0x0cb8('0x28')](function(){if(_[_0x0cb8('0x84')](_0x11e204[_0x0cb8('0x37')][_0x0cb8('0x63')])){for(var _0x1954ed=0x0;_0x1954ed<_0x11e204[_0x0cb8('0x37')][_0x0cb8('0x63')][_0x0cb8('0x3c')];_0x1954ed+=0x1){socket[_0x0cb8('0x6f')](_0x0cb8('0x82'),{'UserId':Number(_0x11e204[_0x0cb8('0x37')][_0x0cb8('0x63')][_0x1954ed]),'WhatsappQueueId':Number(_0x11e204[_0x0cb8('0x53')]['id'])});}}else{socket['emit'](_0x0cb8('0x82'),{'UserId':Number(_0x11e204['query']['ids']),'WhatsappQueueId':Number(_0x11e204[_0x0cb8('0x53')]['id'])});}});}})[_0x0cb8('0x28')](respondWithStatusCode(_0x20a9b5,null))['catch'](handleError(_0x20a9b5,null));};exports[_0x0cb8('0x85')]=function(_0xbe02d4,_0x22cc72,_0xbceee0){var _0x18ab07={};var _0x46ffa9={};var _0x56beff;var _0x57e79d;return db['WhatsappQueue'][_0x0cb8('0x86')]({'where':{'id':_0xbe02d4[_0x0cb8('0x53')]['id']}})[_0x0cb8('0x28')](handleEntityNotFound(_0x22cc72,null))[_0x0cb8('0x28')](function(_0x312317){if(_0x312317){_0x56beff=_0x312317;_0x46ffa9[_0x0cb8('0x35')]=_['keys'](db[_0x0cb8('0x59')]['rawAttributes']);_0x46ffa9[_0x0cb8('0x37')]=_[_0x0cb8('0x36')](_0xbe02d4[_0x0cb8('0x37')]);_0x46ffa9[_0x0cb8('0x38')]=_[_0x0cb8('0x39')](_0x46ffa9['model'],_0x46ffa9[_0x0cb8('0x37')]);_0x18ab07[_0x0cb8('0x3a')]=_['intersection'](_0x46ffa9[_0x0cb8('0x35')],qs[_0x0cb8('0x3b')](_0xbe02d4[_0x0cb8('0x37')][_0x0cb8('0x3b')]));_0x18ab07[_0x0cb8('0x3a')]=_0x18ab07['attributes']['length']?_0x18ab07['attributes']:_0x46ffa9[_0x0cb8('0x35')];_0x18ab07[_0x0cb8('0x87')]=qs[_0x0cb8('0x3f')](_0xbe02d4[_0x0cb8('0x37')]['sort']);_0x18ab07[_0x0cb8('0x40')]=qs[_0x0cb8('0x38')](_[_0x0cb8('0x41')](_0xbe02d4['query'],_0x46ffa9[_0x0cb8('0x38')]));if(_0xbe02d4[_0x0cb8('0x37')][_0x0cb8('0x57')]){_0x18ab07[_0x0cb8('0x40')]=_[_0x0cb8('0x42')](_0x18ab07['where'],{'$or':_[_0x0cb8('0x30')](_0x18ab07[_0x0cb8('0x3a')],function(_0x120047){var _0xbe1146={};_0xbe1146[_0x120047]={'$like':'%'+_0xbe02d4[_0x0cb8('0x37')][_0x0cb8('0x57')]+'%'};return _0xbe1146;})});}_0x18ab07=_[_0x0cb8('0x42')]({},_0x18ab07,_0xbe02d4[_0x0cb8('0x44')]);return _0x56beff[_0x0cb8('0x85')](_0x18ab07);}})[_0x0cb8('0x28')](function(_0x246238){if(_0x246238){_0x57e79d=_0x246238[_0x0cb8('0x3c')];if(!_0xbe02d4[_0x0cb8('0x37')][_0x0cb8('0x3d')](_0x0cb8('0x3e'))){_0x18ab07[_0x0cb8('0x22')]=qs[_0x0cb8('0x22')](_0xbe02d4[_0x0cb8('0x37')][_0x0cb8('0x22')]);_0x18ab07['offset']=qs[_0x0cb8('0x20')](_0xbe02d4[_0x0cb8('0x37')]['offset']);}return _0x56beff['getAgents'](_0x18ab07);}})[_0x0cb8('0x28')](function(_0x42f172){if(_0x42f172){return _0x42f172?{'count':_0x57e79d,'rows':_0x42f172}:null;}})[_0x0cb8('0x28')](respondWithResult(_0x22cc72,null))[_0x0cb8('0x48')](handleError(_0x22cc72,null));}; \ No newline at end of file +var _0x67d9=['count','set','reject','save','then','destroy','get','end','error','stack','index','rawAttributes','fieldName','type','key','map','name','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','WhatsappQueue','includeAll','include','findAll','rows','show','params','intersection','find','create','body','role','user','WhatsappQueues','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','catch','getMembers','findOne','UserWhatsappQueue','pick','WhatsappQueueId','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','SIP','whatsappPause','getTeams','Team','ids','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','sendStatus','status','offset','limit','undefined'];(function(_0x4101d6,_0x4906a2){var _0x48c5d6=function(_0x7936d2){while(--_0x7936d2){_0x4101d6['push'](_0x4101d6['shift']());}};_0x48c5d6(++_0x4906a2);}(_0x67d9,0xec));var _0x967d=function(_0x86dcf7,_0x2bea31){_0x86dcf7=_0x86dcf7-0x0;var _0x53635f=_0x67d9[_0x86dcf7];return _0x53635f;};'use strict';var emlformat=require(_0x967d('0x0'));var rimraf=require(_0x967d('0x1'));var zipdir=require(_0x967d('0x2'));var jsonpatch=require(_0x967d('0x3'));var rp=require('request-promise');var moment=require(_0x967d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x967d('0x5'));var util=require(_0x967d('0x6'));var path=require(_0x967d('0x7'));var sox=require(_0x967d('0x8'));var csv=require(_0x967d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x967d('0xa'));var _=require(_0x967d('0xb'));var squel=require(_0x967d('0xc'));var crypto=require(_0x967d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x967d('0xe'));var toCsv=require(_0x967d('0x9'));var querystring=require(_0x967d('0xf'));var Papa=require(_0x967d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x967d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x967d('0x12'));var logger=require('../../config/logger')(_0x967d('0x13'));var utils=require(_0x967d('0x14'));var config=require(_0x967d('0x15'));var licenseUtil=require(_0x967d('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x967d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x967d('0x18'))(new Redis(config[_0x967d('0x17')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x589ef0,_0x59190a){_0x59190a=_0x59190a||0xcc;return function(_0x504a82){if(_0x504a82){return _0x589ef0[_0x967d('0x19')](_0x59190a);}return _0x589ef0[_0x967d('0x1a')](_0x59190a)['end']();};}function respondWithResult(_0x30cd2,_0x2cad36){_0x2cad36=_0x2cad36||0xc8;return function(_0x53c546){if(_0x53c546){return _0x30cd2['status'](_0x2cad36)['json'](_0x53c546);}};}function respondWithFilteredResult(_0x349a96,_0x16f8a8){return function(_0x2c522e){if(_0x2c522e){var _0x4662f3=typeof _0x16f8a8[_0x967d('0x1b')]==='undefined'&&typeof _0x16f8a8[_0x967d('0x1c')]===_0x967d('0x1d');var _0x579a29=_0x2c522e['count'];var _0x1d4466=_0x4662f3?0x0:_0x16f8a8['offset'];var _0x3fdda4=_0x4662f3?_0x2c522e[_0x967d('0x1e')]:_0x16f8a8[_0x967d('0x1b')]+_0x16f8a8['limit'];var _0x121916;if(_0x3fdda4>=_0x579a29){_0x3fdda4=_0x579a29;_0x121916=0xc8;}else{_0x121916=0xce;}_0x349a96[_0x967d('0x1a')](_0x121916);return _0x349a96[_0x967d('0x1f')]('Content-Range',_0x1d4466+'-'+_0x3fdda4+'/'+_0x579a29)['json'](_0x2c522e);}return null;};}function patchUpdates(_0x14e485){return function(_0x34e901){try{jsonpatch['apply'](_0x34e901,_0x14e485,!![]);}catch(_0x3974bc){return BPromise[_0x967d('0x20')](_0x3974bc);}return _0x34e901[_0x967d('0x21')]();};}function saveUpdates(_0x248e3e,_0x1671b0){return function(_0xfcf254){if(_0xfcf254){return _0xfcf254['update'](_0x248e3e)[_0x967d('0x22')](function(_0x542e8a){return _0x542e8a;});}return null;};}function removeEntity(_0x552c0d,_0x399fb2){return function(_0x4a2b91){if(_0x4a2b91){return _0x4a2b91[_0x967d('0x23')]()[_0x967d('0x22')](function(){var _0x50dc76=_0x4a2b91[_0x967d('0x24')]({'plain':!![]});var _0x552799='WhatsappQueues';return db['UserProfileResource'][_0x967d('0x23')]({'where':{'type':_0x552799,'resourceId':_0x50dc76['id']}})[_0x967d('0x22')](function(){return _0x4a2b91;});})['then'](function(){_0x552c0d[_0x967d('0x1a')](0xcc)[_0x967d('0x25')]();});}};}function handleEntityNotFound(_0x246b67,_0x534357){return function(_0x522bff){if(!_0x522bff){_0x246b67[_0x967d('0x19')](0x194);}return _0x522bff;};}function handleError(_0x12a757,_0x1b8d83){_0x1b8d83=_0x1b8d83||0x1f4;return function(_0x13b04d){logger[_0x967d('0x26')](_0x13b04d[_0x967d('0x27')]);if(_0x13b04d['name']){delete _0x13b04d['name'];}_0x12a757[_0x967d('0x1a')](_0x1b8d83)['send'](_0x13b04d);};}exports[_0x967d('0x28')]=function(_0x2bff5c,_0x10bc8a){var _0x1dfcba={},_0x427125={},_0x1ee98f={'count':0x0,'rows':[]};var _0x4b443f=_['map'](db['WhatsappQueue'][_0x967d('0x29')],function(_0x127740){return{'name':_0x127740[_0x967d('0x2a')],'type':_0x127740[_0x967d('0x2b')][_0x967d('0x2c')]};});_0x427125['model']=_[_0x967d('0x2d')](_0x4b443f,_0x967d('0x2e'));_0x427125[_0x967d('0x2f')]=_[_0x967d('0x30')](_0x2bff5c[_0x967d('0x2f')]);_0x427125[_0x967d('0x31')]=_['intersection'](_0x427125[_0x967d('0x32')],_0x427125[_0x967d('0x2f')]);_0x1dfcba['attributes']=_['intersection'](_0x427125[_0x967d('0x32')],qs[_0x967d('0x33')](_0x2bff5c[_0x967d('0x2f')][_0x967d('0x33')]));_0x1dfcba[_0x967d('0x34')]=_0x1dfcba[_0x967d('0x34')][_0x967d('0x35')]?_0x1dfcba['attributes']:_0x427125[_0x967d('0x32')];if(!_0x2bff5c['query'][_0x967d('0x36')](_0x967d('0x37'))){_0x1dfcba[_0x967d('0x1c')]=qs[_0x967d('0x1c')](_0x2bff5c[_0x967d('0x2f')][_0x967d('0x1c')]);_0x1dfcba[_0x967d('0x1b')]=qs[_0x967d('0x1b')](_0x2bff5c['query'][_0x967d('0x1b')]);}_0x1dfcba[_0x967d('0x38')]=qs[_0x967d('0x39')](_0x2bff5c[_0x967d('0x2f')][_0x967d('0x39')]);_0x1dfcba[_0x967d('0x3a')]=qs[_0x967d('0x31')](_['pick'](_0x2bff5c[_0x967d('0x2f')],_0x427125[_0x967d('0x31')]),_0x4b443f);if(_0x2bff5c[_0x967d('0x2f')][_0x967d('0x3b')]){_0x1dfcba[_0x967d('0x3a')]=_['merge'](_0x1dfcba[_0x967d('0x3a')],{'$or':_[_0x967d('0x2d')](_0x4b443f,function(_0x412b35){if(_0x412b35[_0x967d('0x2b')]!=='VIRTUAL'){var _0x5b5460={};_0x5b5460[_0x412b35['name']]={'$like':'%'+_0x2bff5c[_0x967d('0x2f')][_0x967d('0x3b')]+'%'};return _0x5b5460;}})});}_0x1dfcba=_[_0x967d('0x3c')]({},_0x1dfcba,_0x2bff5c[_0x967d('0x3d')]);var _0x4ee974={'where':_0x1dfcba[_0x967d('0x3a')]};return db[_0x967d('0x3e')][_0x967d('0x1e')](_0x4ee974)['then'](function(_0xe9783a){_0x1ee98f['count']=_0xe9783a;if(_0x2bff5c['query'][_0x967d('0x3f')]){_0x1dfcba[_0x967d('0x40')]=[{'all':!![]}];}return db[_0x967d('0x3e')][_0x967d('0x41')](_0x1dfcba);})[_0x967d('0x22')](function(_0x562d20){_0x1ee98f[_0x967d('0x42')]=_0x562d20;return _0x1ee98f;})[_0x967d('0x22')](respondWithFilteredResult(_0x10bc8a,_0x1dfcba))['catch'](handleError(_0x10bc8a,null));};exports[_0x967d('0x43')]=function(_0x1f2154,_0x444913){var _0x45894e={'raw':!![],'where':{'id':_0x1f2154[_0x967d('0x44')]['id']}},_0x83c5f8={};_0x83c5f8[_0x967d('0x32')]=_[_0x967d('0x30')](db['WhatsappQueue'][_0x967d('0x29')]);_0x83c5f8[_0x967d('0x2f')]=_['keys'](_0x1f2154[_0x967d('0x2f')]);_0x83c5f8[_0x967d('0x31')]=_[_0x967d('0x45')](_0x83c5f8['model'],_0x83c5f8[_0x967d('0x2f')]);_0x45894e[_0x967d('0x34')]=_['intersection'](_0x83c5f8[_0x967d('0x32')],qs['fields'](_0x1f2154[_0x967d('0x2f')][_0x967d('0x33')]));_0x45894e[_0x967d('0x34')]=_0x45894e['attributes'][_0x967d('0x35')]?_0x45894e['attributes']:_0x83c5f8['model'];if(_0x1f2154['query'][_0x967d('0x3f')]){_0x45894e[_0x967d('0x40')]=[{'all':!![]}];}_0x45894e=_[_0x967d('0x3c')]({},_0x45894e,_0x1f2154[_0x967d('0x3d')]);return db[_0x967d('0x3e')][_0x967d('0x46')](_0x45894e)[_0x967d('0x22')](handleEntityNotFound(_0x444913,null))['then'](respondWithResult(_0x444913,null))['catch'](handleError(_0x444913,null));};exports[_0x967d('0x47')]=function(_0x134ba7,_0x26fdf4){return db[_0x967d('0x3e')][_0x967d('0x47')](_0x134ba7[_0x967d('0x48')],{})['then'](function(_0x690477){var _0x21b13=_0x134ba7['user']['get']({'plain':!![]});if(!_0x21b13)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21b13[_0x967d('0x49')]===_0x967d('0x4a')){var _0x3d853b=_0x690477['get']({'plain':!![]});var _0x3c8f9f=_0x967d('0x4b');return db['UserProfileSection'][_0x967d('0x46')]({'where':{'name':_0x3c8f9f,'userProfileId':_0x21b13['userProfileId']},'raw':!![]})[_0x967d('0x22')](function(_0x129068){if(_0x129068&&_0x129068['autoAssociation']===0x0){return db[_0x967d('0x4c')]['create']({'name':_0x3d853b[_0x967d('0x2e')],'resourceId':_0x3d853b['id'],'type':_0x129068[_0x967d('0x2e')],'sectionId':_0x129068['id']},{})['then'](function(){return _0x690477;});}else{return _0x690477;}})['catch'](function(_0x2529bd){logger[_0x967d('0x26')](_0x967d('0x4d'),_0x2529bd);throw _0x2529bd;});}return _0x690477;})[_0x967d('0x22')](respondWithResult(_0x26fdf4,0xc9))['catch'](handleError(_0x26fdf4,null));};exports[_0x967d('0x4e')]=function(_0x48fece,_0x50f285){if(_0x48fece[_0x967d('0x48')]['id']){delete _0x48fece['body']['id'];}return db[_0x967d('0x3e')][_0x967d('0x46')]({'where':{'id':_0x48fece['params']['id']}})[_0x967d('0x22')](handleEntityNotFound(_0x50f285,null))[_0x967d('0x22')](saveUpdates(_0x48fece['body'],null))[_0x967d('0x22')](respondWithResult(_0x50f285,null))[_0x967d('0x4f')](handleError(_0x50f285,null));};exports[_0x967d('0x23')]=function(_0x1c84ea,_0x5d447e){return db[_0x967d('0x3e')]['find']({'where':{'id':_0x1c84ea[_0x967d('0x44')]['id']}})[_0x967d('0x22')](handleEntityNotFound(_0x5d447e,null))[_0x967d('0x22')](removeEntity(_0x5d447e,null))[_0x967d('0x4f')](handleError(_0x5d447e,null));};exports['describe']=function(_0x4956e1,_0x31ed02){return db[_0x967d('0x3e')]['describe']()[_0x967d('0x22')](respondWithResult(_0x31ed02,null))[_0x967d('0x4f')](handleError(_0x31ed02,null));};exports[_0x967d('0x50')]=function(_0x492df0,_0xbd47ee,_0xd5c4db){var _0x393285={'raw':!![],'where':{}},_0x2c634d={},_0x1a8805;return db[_0x967d('0x3e')][_0x967d('0x51')]({'where':{'id':_0x492df0[_0x967d('0x44')]['id']}})[_0x967d('0x22')](handleEntityNotFound(_0xbd47ee,null))[_0x967d('0x22')](function(_0x36b4e2){if(_0x36b4e2){_0x1a8805=_0x36b4e2[_0x967d('0x24')]({'plain':!![]});_0x2c634d[_0x967d('0x32')]=_[_0x967d('0x30')](db[_0x967d('0x52')]['rawAttributes']);_0x2c634d[_0x967d('0x2f')]=_['keys'](_0x492df0[_0x967d('0x2f')]);_0x2c634d['filters']=_[_0x967d('0x45')](_0x2c634d[_0x967d('0x32')],_0x2c634d[_0x967d('0x2f')]);_0x393285[_0x967d('0x34')]=_[_0x967d('0x45')](_0x2c634d['model'],qs[_0x967d('0x33')](_0x492df0['query']['fields']));_0x393285[_0x967d('0x34')]=_0x393285[_0x967d('0x34')][_0x967d('0x35')]?_0x393285[_0x967d('0x34')]:_0x2c634d[_0x967d('0x32')];if(!_0x492df0[_0x967d('0x2f')][_0x967d('0x36')](_0x967d('0x37'))){_0x393285['limit']=qs[_0x967d('0x1c')](_0x492df0[_0x967d('0x2f')][_0x967d('0x1c')]);_0x393285[_0x967d('0x1b')]=qs[_0x967d('0x1b')](_0x492df0[_0x967d('0x2f')][_0x967d('0x1b')]);}_0x393285[_0x967d('0x38')]=qs[_0x967d('0x39')](_0x492df0[_0x967d('0x2f')][_0x967d('0x39')]);_0x393285[_0x967d('0x3a')]=qs['filters'](_[_0x967d('0x53')](_0x492df0[_0x967d('0x2f')],_0x2c634d[_0x967d('0x31')]));_0x393285['where'][_0x967d('0x54')]=_0x36b4e2['id'];if(_0x492df0[_0x967d('0x2f')][_0x967d('0x3b')]){_0x393285[_0x967d('0x3a')]=_[_0x967d('0x3c')](_0x393285[_0x967d('0x3a')],{'$or':_['map'](_0x393285[_0x967d('0x34')],function(_0x4af19d){var _0x415c7e={};_0x415c7e[_0x4af19d]={'$like':'%'+_0x492df0['query'][_0x967d('0x3b')]+'%'};return _0x415c7e;})});}_0x393285=_['merge']({},_0x393285,_0x492df0[_0x967d('0x3d')]);return db['UserWhatsappQueue'][_0x967d('0x41')](_0x393285);}})['then'](function(_0x4271a5){if(_0x4271a5){return db[_0x967d('0x55')][_0x967d('0x56')]({'where':{'id':_[_0x967d('0x2d')](_0x4271a5,'UserId'),'role':_0x967d('0x57')},'attributes':['id',_0x967d('0x2e'),'whatsappPause',_0x967d('0x58'),_0x967d('0x59')]});}})[_0x967d('0x22')](function(_0x210513){if(_0x210513){return{'count':_0x210513['count'],'rows':_[_0x967d('0x2d')](_0x210513[_0x967d('0x42')],function(_0x34baeb){return{'membername':_0x34baeb[_0x967d('0x2e')],'UserId':_0x34baeb['id'],'queue_name':_0x1a8805[_0x967d('0x2e')],'WhatsappQueueId':_0x1a8805['id'],'interface':util[_0x967d('0x5a')](_0x967d('0x5b'),_0x967d('0x5c'),_0x34baeb['name']),'penalty':0x0,'paused':_0x34baeb[_0x967d('0x5d')],'createdAt':_0x34baeb[_0x967d('0x59')],'updatedAt':_0x34baeb[_0x967d('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x967d('0x22')](respondWithFilteredResult(_0xbd47ee,_0x393285))[_0x967d('0x4f')](handleError(_0xbd47ee,null));};exports[_0x967d('0x5e')]=function(_0x2350b8,_0x11f8db,_0x5da5f2){var _0x205af8={};var _0x20ac9f={};var _0x205a62;var _0x43c150;return db[_0x967d('0x3e')]['findOne']({'where':{'id':_0x2350b8[_0x967d('0x44')]['id']}})['then'](handleEntityNotFound(_0x11f8db,null))[_0x967d('0x22')](function(_0x40e08f){if(_0x40e08f){_0x205a62=_0x40e08f;_0x20ac9f[_0x967d('0x32')]=_[_0x967d('0x30')](db[_0x967d('0x5f')]['rawAttributes']);_0x20ac9f[_0x967d('0x2f')]=_[_0x967d('0x30')](_0x2350b8[_0x967d('0x2f')]);_0x20ac9f[_0x967d('0x31')]=_['intersection'](_0x20ac9f[_0x967d('0x32')],_0x20ac9f['query']);_0x205af8[_0x967d('0x34')]=_[_0x967d('0x45')](_0x20ac9f[_0x967d('0x32')],qs[_0x967d('0x33')](_0x2350b8[_0x967d('0x2f')][_0x967d('0x33')]));_0x205af8[_0x967d('0x34')]=_0x205af8[_0x967d('0x34')][_0x967d('0x35')]?_0x205af8[_0x967d('0x34')]:_0x20ac9f[_0x967d('0x32')];_0x205af8[_0x967d('0x38')]=qs[_0x967d('0x39')](_0x2350b8[_0x967d('0x2f')][_0x967d('0x39')]);_0x205af8[_0x967d('0x3a')]=qs[_0x967d('0x31')](_['pick'](_0x2350b8[_0x967d('0x2f')],_0x20ac9f[_0x967d('0x31')]));if(_0x2350b8['query'][_0x967d('0x3b')]){_0x205af8['where']=_[_0x967d('0x3c')](_0x205af8['where'],{'$or':_[_0x967d('0x2d')](_0x205af8[_0x967d('0x34')],function(_0x5118d4){var _0x439514={};_0x439514[_0x5118d4]={'$like':'%'+_0x2350b8[_0x967d('0x2f')][_0x967d('0x3b')]+'%'};return _0x439514;})});}_0x205af8=_[_0x967d('0x3c')]({},_0x205af8,_0x2350b8[_0x967d('0x3d')]);return _0x205a62['getTeams'](_0x205af8);}})[_0x967d('0x22')](function(_0x52c1c8){if(_0x52c1c8){_0x43c150=_0x52c1c8[_0x967d('0x35')];if(!_0x2350b8[_0x967d('0x2f')][_0x967d('0x36')](_0x967d('0x37'))){_0x205af8[_0x967d('0x1c')]=qs[_0x967d('0x1c')](_0x2350b8[_0x967d('0x2f')][_0x967d('0x1c')]);_0x205af8[_0x967d('0x1b')]=qs[_0x967d('0x1b')](_0x2350b8[_0x967d('0x2f')][_0x967d('0x1b')]);}return _0x205a62[_0x967d('0x5e')](_0x205af8);}})[_0x967d('0x22')](function(_0x1a9ae0){if(_0x1a9ae0){return _0x1a9ae0?{'count':_0x43c150,'rows':_0x1a9ae0}:null;}})[_0x967d('0x22')](respondWithResult(_0x11f8db,null))[_0x967d('0x4f')](handleError(_0x11f8db,null));};exports['addTeams']=function(_0x1b9ddf,_0x547820,_0x48174f){var _0x5b0d6e=_0x1b9ddf['body'][_0x967d('0x60')];return db[_0x967d('0x5f')][_0x967d('0x41')]({'where':{'id':_0x5b0d6e},'attributes':['id'],'include':[{'model':db['User'],'as':_0x967d('0x61'),'attributes':['id',_0x967d('0x2e'),'online',_0x967d('0x62'),_0x967d('0x63')],'raw':!![]}]})[_0x967d('0x22')](function(_0x557c00){if(_0x557c00){var _0x4d90b1=_[_0x967d('0x64')](_0x557c00,function(_0x12e04a){var _0x383f79=_0x12e04a[_0x967d('0x24')]({'plain':!![]});return _0x383f79[_0x967d('0x61')];});return db[_0x967d('0x3e')]['find']({'where':{'id':_0x1b9ddf['params']['id']}})['then'](function(_0x39a0c8){return db[_0x967d('0x65')]['transaction'](function(_0x2a3992){return _0x39a0c8['addTeams'](_0x5b0d6e,{'transaction':_0x2a3992})['then'](function(){return BPromise[_0x967d('0x66')](_0x4d90b1,function(_0x1926ec){return db[_0x967d('0x52')][_0x967d('0x67')]({'where':{'UserId':_0x1926ec['id'],'WhatsappQueueId':_0x1b9ddf[_0x967d('0x44')]['id']},'transaction':_0x2a3992});});})['then'](function(){_0x4d90b1['forEach'](function(_0x228bb1){socket[_0x967d('0x68')](_0x967d('0x69'),{'UserId':_0x228bb1['id'],'WhatsappQueueId':_0x39a0c8['id']});});});});});}})[_0x967d('0x22')](respondWithStatusCode(_0x547820,null))[_0x967d('0x4f')](handleError(_0x547820,null));};exports[_0x967d('0x6a')]=function(_0xb6303a,_0x23c564,_0x1447c6){return db[_0x967d('0x5f')][_0x967d('0x41')]({'where':{'id':_0xb6303a[_0x967d('0x2f')][_0x967d('0x60')]},'attributes':['id'],'include':[{'model':db[_0x967d('0x55')],'as':_0x967d('0x61'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x23c564,null))[_0x967d('0x22')](function(_0x37b78d){var _0x553468=_['map'](_0x37b78d,'id');var _0x438948=[];var _0x5a0def=[];var _0x40229e=squel[_0x967d('0x6b')]();_0x40229e[_0x967d('0x6c')](_0x967d('0x6d'))[_0x967d('0x6e')](_0x967d('0x6f'),'tq')['join']('user_has_teams','ut',_0x967d('0x70'))['where']('WhatsappQueueId\x20=\x20?',_0xb6303a[_0x967d('0x44')]['id']);for(var _0x117964=0x0;_0x117964<_0x37b78d[_0x967d('0x35')];_0x117964+=0x1){let _0x20852c=_0x37b78d[_0x117964];for(var _0xfa61be=0x0;_0xfa61be<_0x20852c['Agents'][_0x967d('0x35')];_0xfa61be+=0x1){let _0x314afa=_0x20852c[_0x967d('0x61')][_0xfa61be];var _0x3e7f0e=_0x40229e['clone']();_0x3e7f0e[_0x967d('0x3a')](_0x967d('0x71'),_0x314afa['id']);_0x5a0def[_0x967d('0x72')](db[_0x967d('0x65')][_0x967d('0x2f')](_0x3e7f0e[_0x967d('0x73')](),{'type':db[_0x967d('0x65')][_0x967d('0x74')][_0x967d('0x75')]})[_0x967d('0x22')](function(_0x1a1d7e){if(_0x1a1d7e[_0x967d('0x35')]===0x1){return _0x314afa['id'];}else{var _0x3a2672=_[_0x967d('0x76')](_[_0x967d('0x2d')](_0x1a1d7e,_0x967d('0x77')),function(_0x186e7c){return _[_0x967d('0x78')](_0x553468,_0x186e7c);});if(_0x3a2672){return _0x314afa['id'];}}}));}}return BPromise[_0x967d('0x79')](_0x5a0def)[_0x967d('0x22')](function(_0x253b0f){_0x438948=_(_0x438948)[_0x967d('0x7a')](_0x253b0f)[_0x967d('0x7b')]()[_0x967d('0x7c')]();return db['WhatsappQueue'][_0x967d('0x46')]({'where':{'id':_0xb6303a[_0x967d('0x44')]['id']}})['then'](function(_0x3d2a29){return db[_0x967d('0x65')]['transaction'](function(_0x2ac459){return _0x3d2a29[_0x967d('0x6a')](_0xb6303a[_0x967d('0x2f')][_0x967d('0x60')],{'transaction':_0x2ac459})['then'](function(){if(!_[_0x967d('0x7d')](_0x438948)){return _0x3d2a29[_0x967d('0x7e')](_0x438948,{'transaction':_0x2ac459});}})[_0x967d('0x22')](function(){_0x438948[_0x967d('0x7f')](function(_0x5ef571){socket[_0x967d('0x68')](_0x967d('0x80'),{'UserId':_0x5ef571,'WhatsappQueueId':_0x3d2a29['id']});});});});});});})[_0x967d('0x22')](respondWithStatusCode(_0x23c564,null))[_0x967d('0x4f')](handleError(_0x23c564,null));};exports['addAgents']=function(_0x413e84,_0x4ae744,_0x4ad1d3){return db[_0x967d('0x3e')]['find']({'where':{'id':_0x413e84['params']['id']}})['then'](handleEntityNotFound(_0x4ae744,null))[_0x967d('0x22')](function(_0x206a31){if(_0x206a31){return _0x206a31[_0x967d('0x81')](_0x413e84[_0x967d('0x48')][_0x967d('0x60')],_[_0x967d('0x82')](_0x413e84['body'],[_0x967d('0x60'),'id'])||{})['spread'](function(_0x34b3d9){for(var _0x363c9e=0x0;_0x363c9e<_0x413e84[_0x967d('0x48')][_0x967d('0x60')][_0x967d('0x35')];_0x363c9e+=0x1){socket[_0x967d('0x68')](_0x967d('0x69'),{'UserId':Number(_0x413e84[_0x967d('0x48')][_0x967d('0x60')][_0x363c9e]),'WhatsappQueueId':Number(_0x413e84[_0x967d('0x44')]['id'])});}return _0x34b3d9;});}})[_0x967d('0x22')](respondWithResult(_0x4ae744,null))[_0x967d('0x4f')](handleError(_0x4ae744,null));};exports[_0x967d('0x7e')]=function(_0xa9b15d,_0x1a5427,_0x1b715e){return db[_0x967d('0x3e')][_0x967d('0x46')]({'where':{'id':_0xa9b15d[_0x967d('0x44')]['id']}})['then'](handleEntityNotFound(_0x1a5427,null))[_0x967d('0x22')](function(_0x2f11dd){if(_0x2f11dd){return _0x2f11dd['removeAgents'](_0xa9b15d[_0x967d('0x2f')][_0x967d('0x60')])[_0x967d('0x22')](function(){if(_[_0x967d('0x83')](_0xa9b15d['query']['ids'])){for(var _0x3d8527=0x0;_0x3d8527<_0xa9b15d['query'][_0x967d('0x60')]['length'];_0x3d8527+=0x1){socket[_0x967d('0x68')]('userWhatsappQueue:remove',{'UserId':Number(_0xa9b15d['query'][_0x967d('0x60')][_0x3d8527]),'WhatsappQueueId':Number(_0xa9b15d[_0x967d('0x44')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0xa9b15d[_0x967d('0x2f')][_0x967d('0x60')]),'WhatsappQueueId':Number(_0xa9b15d[_0x967d('0x44')]['id'])});}});}})[_0x967d('0x22')](respondWithStatusCode(_0x1a5427,null))[_0x967d('0x4f')](handleError(_0x1a5427,null));};exports[_0x967d('0x84')]=function(_0x1f6f71,_0x263b24,_0x193f85){var _0x3806e0={};var _0x198323={};var _0xc0b0af;var _0xd9a6a2;return db[_0x967d('0x3e')][_0x967d('0x51')]({'where':{'id':_0x1f6f71['params']['id']}})['then'](handleEntityNotFound(_0x263b24,null))['then'](function(_0xda1372){if(_0xda1372){_0xc0b0af=_0xda1372;_0x198323[_0x967d('0x32')]=_[_0x967d('0x30')](db['User'][_0x967d('0x29')]);_0x198323[_0x967d('0x2f')]=_[_0x967d('0x30')](_0x1f6f71[_0x967d('0x2f')]);_0x198323[_0x967d('0x31')]=_[_0x967d('0x45')](_0x198323[_0x967d('0x32')],_0x198323[_0x967d('0x2f')]);_0x3806e0['attributes']=_[_0x967d('0x45')](_0x198323['model'],qs[_0x967d('0x33')](_0x1f6f71[_0x967d('0x2f')]['fields']));_0x3806e0[_0x967d('0x34')]=_0x3806e0['attributes']['length']?_0x3806e0[_0x967d('0x34')]:_0x198323[_0x967d('0x32')];_0x3806e0['order']=qs[_0x967d('0x39')](_0x1f6f71[_0x967d('0x2f')][_0x967d('0x39')]);_0x3806e0[_0x967d('0x3a')]=qs[_0x967d('0x31')](_[_0x967d('0x53')](_0x1f6f71[_0x967d('0x2f')],_0x198323[_0x967d('0x31')]));if(_0x1f6f71[_0x967d('0x2f')]['filter']){_0x3806e0[_0x967d('0x3a')]=_[_0x967d('0x3c')](_0x3806e0[_0x967d('0x3a')],{'$or':_[_0x967d('0x2d')](_0x3806e0['attributes'],function(_0x1bd310){var _0x1135b3={};_0x1135b3[_0x1bd310]={'$like':'%'+_0x1f6f71[_0x967d('0x2f')][_0x967d('0x3b')]+'%'};return _0x1135b3;})});}_0x3806e0=_['merge']({},_0x3806e0,_0x1f6f71['options']);return _0xc0b0af['getAgents'](_0x3806e0);}})['then'](function(_0x19f3d7){if(_0x19f3d7){_0xd9a6a2=_0x19f3d7[_0x967d('0x35')];if(!_0x1f6f71[_0x967d('0x2f')][_0x967d('0x36')]('nolimit')){_0x3806e0['limit']=qs['limit'](_0x1f6f71[_0x967d('0x2f')][_0x967d('0x1c')]);_0x3806e0['offset']=qs['offset'](_0x1f6f71[_0x967d('0x2f')]['offset']);}return _0xc0b0af['getAgents'](_0x3806e0);}})[_0x967d('0x22')](function(_0x138111){if(_0x138111){return _0x138111?{'count':_0xd9a6a2,'rows':_0x138111}:null;}})[_0x967d('0x22')](respondWithResult(_0x263b24,null))['catch'](handleError(_0x263b24,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 54f19c4..c489c8f 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 _0x61b4=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x2a9fbf,_0x1cdd71){var _0x21035f=function(_0x52772b){while(--_0x52772b){_0x2a9fbf['push'](_0x2a9fbf['shift']());}};_0x21035f(++_0x1cdd71);}(_0x61b4,0x68));var _0x461b=function(_0x141749,_0x477b04){_0x141749=_0x141749-0x0;var _0x3e6932=_0x61b4[_0x141749];return _0x3e6932;};'use strict';var EventEmitter=require(_0x461b('0x0'));var WhatsappQueue=require(_0x461b('0x1'))['db'][_0x461b('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x461b('0x3')](0x0);var events={'afterCreate':_0x461b('0x4'),'afterUpdate':_0x461b('0x5'),'afterDestroy':_0x461b('0x6')};function emitEvent(_0x42bb5d){return function(_0x5db51b,_0x3a5951,_0x19bf78){WhatsappQueueEvents[_0x461b('0x7')](_0x42bb5d+':'+_0x5db51b['id'],_0x5db51b);WhatsappQueueEvents[_0x461b('0x7')](_0x42bb5d,_0x5db51b);_0x19bf78(null);};}for(var e in events){if(events[_0x461b('0x8')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xca19=['emit','hasOwnProperty','hook','exports','../../mysqldb','save','remove'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xca19,0x90));var _0x9ca1=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xca19[_0x9cd4c3];return _0x4c9025;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x9ca1('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9ca1('0x1'),'afterUpdate':'update','afterDestroy':_0x9ca1('0x2')};function emitEvent(_0x52f335){return function(_0x2c1f26,_0x21db77,_0x30c623){WhatsappQueueEvents[_0x9ca1('0x3')](_0x52f335+':'+_0x2c1f26['id'],_0x2c1f26);WhatsappQueueEvents[_0x9ca1('0x3')](_0x52f335,_0x2c1f26);_0x30c623(null);};}for(var e in events){if(events[_0x9ca1('0x4')](e)){var event=events[e];WhatsappQueue[_0x9ca1('0x5')](e,emitEvent(event));}}module[_0x9ca1('0x6')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index d1e05b3..4d542ac 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 _0x2b40=['define','WhatsappQueue','whatsapp_queues','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x2b40,0x1d1));var _0x02b4=function(_0x3e1747,_0x27784e){_0x3e1747=_0x3e1747-0x0;var _0x536910=_0x2b40[_0x3e1747];return _0x536910;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x02b4('0x0'));var moment=require(_0x02b4('0x1'));var BPromise=require(_0x02b4('0x2'));var rp=require(_0x02b4('0x3'));var fs=require('fs');var path=require(_0x02b4('0x4'));var rimraf=require(_0x02b4('0x5'));var config=require(_0x02b4('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0x02b4('0x7')]=function(_0x2d2b4c,_0x24c547){return _0x2d2b4c[_0x02b4('0x8')](_0x02b4('0x9'),attributes,{'tableName':_0x02b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d1d=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','whatsapp_queues','api'];(function(_0x16660b,_0x294df8){var _0x43061a=function(_0x20b35d){while(--_0x20b35d){_0x16660b['push'](_0x16660b['shift']());}};_0x43061a(++_0x294df8);}(_0x9d1d,0x13a));var _0xd9d1=function(_0x2746e7,_0x1c1570){_0x2746e7=_0x2746e7-0x0;var _0x25479c=_0x9d1d[_0x2746e7];return _0x25479c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd9d1('0x0'));var moment=require(_0xd9d1('0x1'));var BPromise=require(_0xd9d1('0x2'));var rp=require(_0xd9d1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd9d1('0x4'));var config=require(_0xd9d1('0x5'));var attributes=require('./whatsappQueue.attributes');module[_0xd9d1('0x6')]=function(_0x1dbb24,_0x39bbe2){return _0x1dbb24[_0xd9d1('0x7')]('WhatsappQueue',attributes,{'tableName':_0xd9d1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 80339ee..105d0ef 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 _0xc813=['where','ShowWhatsappQueue','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetWhatsappQueue','findAll','options','limit','include','map','model','attributes','then','WhatsappQueue','find'];(function(_0x57e174,_0x5e8ed5){var _0x59097b=function(_0x511291){while(--_0x511291){_0x57e174['push'](_0x57e174['shift']());}};_0x59097b(++_0x5e8ed5);}(_0xc813,0x1e2));var _0x3c81=function(_0x5abc1e,_0x8715e7){_0x5abc1e=_0x5abc1e-0x0;var _0x3423d1=_0xc813[_0x5abc1e];return _0x3423d1;};'use strict';var _=require(_0x3c81('0x0'));var util=require(_0x3c81('0x1'));var moment=require('moment');var BPromise=require(_0x3c81('0x2'));var rs=require(_0x3c81('0x3'));var fs=require('fs');var Redis=require(_0x3c81('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c81('0x5'));var logger=require('../../config/logger')(_0x3c81('0x6'));var config=require(_0x3c81('0x7'));var jayson=require(_0x3c81('0x8'));var client=jayson[_0x3c81('0x9')][_0x3c81('0xa')]({'port':0x232a});config[_0x3c81('0xb')]=_[_0x3c81('0xc')](config[_0x3c81('0xb')],{'host':_0x3c81('0xd'),'port':0x18eb});var socket=require(_0x3c81('0xe'))(new Redis(config[_0x3c81('0xb')]));require(_0x3c81('0xf'))[_0x3c81('0x10')](socket);function respondWithRpcPromise(_0x5b216d,_0x12ce0c,_0x5c298d){return new BPromise(function(_0x4726e4,_0x3b0074){return client[_0x3c81('0x11')](_0x5b216d,_0x5c298d)['then'](function(_0x304852){logger[_0x3c81('0x12')](_0x3c81('0x13'),_0x12ce0c,_0x3c81('0x14'));logger[_0x3c81('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x12ce0c,_0x3c81('0x14'),JSON[_0x3c81('0x16')](_0x304852));if(_0x304852[_0x3c81('0x17')]){if(_0x304852[_0x3c81('0x17')]['code']===0x1f4){logger[_0x3c81('0x17')](_0x3c81('0x13'),_0x12ce0c,_0x304852[_0x3c81('0x17')][_0x3c81('0x18')]);return _0x3b0074(_0x304852[_0x3c81('0x17')][_0x3c81('0x18')]);}logger[_0x3c81('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x12ce0c,_0x304852['error'][_0x3c81('0x18')]);return _0x4726e4(_0x304852['error'][_0x3c81('0x18')]);}else{logger[_0x3c81('0x12')](_0x3c81('0x13'),_0x12ce0c,_0x3c81('0x14'));_0x4726e4(_0x304852[_0x3c81('0x19')][_0x3c81('0x18')]);}})[_0x3c81('0x1a')](function(_0x4afd3a){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x12ce0c,_0x4afd3a);_0x3b0074(_0x4afd3a);});});}exports[_0x3c81('0x1b')]=function(_0x2dbe3b){var _0x3316e8=this;return new Promise(function(_0x141e34,_0x54fcee){return db['WhatsappQueue'][_0x3c81('0x1c')]({'raw':_0x2dbe3b[_0x3c81('0x1d')]?_0x2dbe3b[_0x3c81('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2dbe3b[_0x3c81('0x1d')]?_0x2dbe3b[_0x3c81('0x1d')]['where']||null:null,'attributes':_0x2dbe3b[_0x3c81('0x1d')]?_0x2dbe3b[_0x3c81('0x1d')]['attributes']||null:null,'limit':_0x2dbe3b[_0x3c81('0x1d')]?_0x2dbe3b[_0x3c81('0x1d')][_0x3c81('0x1e')]||null:null,'include':_0x2dbe3b[_0x3c81('0x1d')]?_0x2dbe3b[_0x3c81('0x1d')][_0x3c81('0x1f')]?_[_0x3c81('0x20')](_0x2dbe3b[_0x3c81('0x1d')][_0x3c81('0x1f')],function(_0x2d0000){return{'model':db[_0x2d0000[_0x3c81('0x21')]],'as':_0x2d0000['as'],'attributes':_0x2d0000[_0x3c81('0x22')],'include':_0x2d0000['include']?_[_0x3c81('0x20')](_0x2d0000['include'],function(_0x3adf3c){return{'model':db[_0x3adf3c[_0x3c81('0x21')]],'as':_0x3adf3c['as'],'attributes':_0x3adf3c[_0x3c81('0x22')],'include':_0x3adf3c[_0x3c81('0x1f')]?_[_0x3c81('0x20')](_0x3adf3c[_0x3c81('0x1f')],function(_0x5b97c8){return{'model':db[_0x5b97c8[_0x3c81('0x21')]],'as':_0x5b97c8['as'],'attributes':_0x5b97c8['attributes']};}):[]};}):[]};}):[]:[]})[_0x3c81('0x23')](function(_0x3cf863){logger['info'](_0x3c81('0x1b'),_0x2dbe3b);logger[_0x3c81('0x15')](_0x3c81('0x1b'),_0x2dbe3b,JSON[_0x3c81('0x16')](_0x3cf863));_0x141e34(_0x3cf863);})[_0x3c81('0x1a')](function(_0x26da65){logger['error'](_0x3c81('0x1b'),_0x26da65[_0x3c81('0x18')],_0x2dbe3b);_0x54fcee(_0x3316e8[_0x3c81('0x17')](0x1f4,_0x26da65[_0x3c81('0x18')]));});});};exports['ShowWhatsappQueue']=function(_0x219c5e){var _0x425898=this;return new Promise(function(_0x15ac93,_0x4d0372){return db[_0x3c81('0x24')][_0x3c81('0x25')]({'raw':_0x219c5e[_0x3c81('0x1d')]?_0x219c5e[_0x3c81('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x219c5e[_0x3c81('0x1d')]?_0x219c5e[_0x3c81('0x1d')][_0x3c81('0x26')]||null:null,'attributes':_0x219c5e[_0x3c81('0x1d')]?_0x219c5e[_0x3c81('0x1d')]['attributes']||null:null,'include':_0x219c5e[_0x3c81('0x1d')]?_0x219c5e[_0x3c81('0x1d')][_0x3c81('0x1f')]?_[_0x3c81('0x20')](_0x219c5e[_0x3c81('0x1d')][_0x3c81('0x1f')],function(_0x2b25b7){return{'model':db[_0x2b25b7[_0x3c81('0x21')]],'as':_0x2b25b7['as'],'attributes':_0x2b25b7[_0x3c81('0x22')],'include':_0x2b25b7[_0x3c81('0x1f')]?_[_0x3c81('0x20')](_0x2b25b7[_0x3c81('0x1f')],function(_0x435bc0){return{'model':db[_0x435bc0[_0x3c81('0x21')]],'as':_0x435bc0['as'],'attributes':_0x435bc0[_0x3c81('0x22')],'include':_0x435bc0[_0x3c81('0x1f')]?_[_0x3c81('0x20')](_0x435bc0[_0x3c81('0x1f')],function(_0x31df7b){return{'model':db[_0x31df7b[_0x3c81('0x21')]],'as':_0x31df7b['as'],'attributes':_0x31df7b['attributes']};}):[]};}):[]};}):[]:[]})[_0x3c81('0x23')](function(_0x28651c){logger[_0x3c81('0x12')]('ShowWhatsappQueue',_0x219c5e);logger[_0x3c81('0x15')]('ShowWhatsappQueue',_0x219c5e,JSON[_0x3c81('0x16')](_0x28651c));_0x15ac93(_0x28651c);})[_0x3c81('0x1a')](function(_0x4c5fad){logger['error'](_0x3c81('0x27'),_0x4c5fad['message'],_0x219c5e);_0x4d0372(_0x425898['error'](0x1f4,_0x4c5fad[_0x3c81('0x18')]));});});}; \ No newline at end of file +var _0xad15=['find','raw','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','WhatsappQueue','findAll','options','where','attributes','limit','include','map','model','GetWhatsappQueue','debug','ShowWhatsappQueue'];(function(_0x2c72c6,_0xd6b4ce){var _0xdbae41=function(_0x33d015){while(--_0x33d015){_0x2c72c6['push'](_0x2c72c6['shift']());}};_0xdbae41(++_0xd6b4ce);}(_0xad15,0x12a));var _0x5ad1=function(_0x221a70,_0x364013){_0x221a70=_0x221a70-0x0;var _0x1070b4=_0xad15[_0x221a70];return _0x1070b4;};'use strict';var _=require(_0x5ad1('0x0'));var util=require(_0x5ad1('0x1'));var moment=require(_0x5ad1('0x2'));var BPromise=require(_0x5ad1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ad1('0x4'))['db'];var utils=require(_0x5ad1('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5ad1('0x6'));var client=jayson['client'][_0x5ad1('0x7')]({'port':0x232a});config[_0x5ad1('0x8')]=_[_0x5ad1('0x9')](config[_0x5ad1('0x8')],{'host':_0x5ad1('0xa'),'port':0x18eb});var socket=require(_0x5ad1('0xb'))(new Redis(config[_0x5ad1('0x8')]));require(_0x5ad1('0xc'))['register'](socket);function respondWithRpcPromise(_0x11b391,_0x441b64,_0x1902af){return new BPromise(function(_0x47b0c5,_0x242f33){return client[_0x5ad1('0xd')](_0x11b391,_0x1902af)[_0x5ad1('0xe')](function(_0x515cf7){logger[_0x5ad1('0xf')](_0x5ad1('0x10'),_0x441b64,_0x5ad1('0x11'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x441b64,_0x5ad1('0x11'),JSON[_0x5ad1('0x12')](_0x515cf7));if(_0x515cf7[_0x5ad1('0x13')]){if(_0x515cf7[_0x5ad1('0x13')][_0x5ad1('0x14')]===0x1f4){logger['error'](_0x5ad1('0x10'),_0x441b64,_0x515cf7[_0x5ad1('0x13')][_0x5ad1('0x15')]);return _0x242f33(_0x515cf7[_0x5ad1('0x13')]['message']);}logger[_0x5ad1('0x13')](_0x5ad1('0x10'),_0x441b64,_0x515cf7['error']['message']);return _0x47b0c5(_0x515cf7[_0x5ad1('0x13')][_0x5ad1('0x15')]);}else{logger['info'](_0x5ad1('0x10'),_0x441b64,_0x5ad1('0x11'));_0x47b0c5(_0x515cf7['result']['message']);}})[_0x5ad1('0x16')](function(_0x290d1f){logger['error'](_0x5ad1('0x10'),_0x441b64,_0x290d1f);_0x242f33(_0x290d1f);});});}exports['GetWhatsappQueue']=function(_0x23e226){var _0x265da5=this;return new Promise(function(_0x1efc42,_0x3dd0e0){return db[_0x5ad1('0x17')][_0x5ad1('0x18')]({'raw':_0x23e226['options']?_0x23e226[_0x5ad1('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x23e226['options']?_0x23e226[_0x5ad1('0x19')][_0x5ad1('0x1a')]||null:null,'attributes':_0x23e226['options']?_0x23e226[_0x5ad1('0x19')][_0x5ad1('0x1b')]||null:null,'limit':_0x23e226[_0x5ad1('0x19')]?_0x23e226['options'][_0x5ad1('0x1c')]||null:null,'include':_0x23e226['options']?_0x23e226['options'][_0x5ad1('0x1d')]?_[_0x5ad1('0x1e')](_0x23e226[_0x5ad1('0x19')][_0x5ad1('0x1d')],function(_0x439f55){return{'model':db[_0x439f55['model']],'as':_0x439f55['as'],'attributes':_0x439f55['attributes'],'include':_0x439f55[_0x5ad1('0x1d')]?_[_0x5ad1('0x1e')](_0x439f55[_0x5ad1('0x1d')],function(_0x26a5a6){return{'model':db[_0x26a5a6[_0x5ad1('0x1f')]],'as':_0x26a5a6['as'],'attributes':_0x26a5a6[_0x5ad1('0x1b')],'include':_0x26a5a6['include']?_['map'](_0x26a5a6[_0x5ad1('0x1d')],function(_0x449435){return{'model':db[_0x449435[_0x5ad1('0x1f')]],'as':_0x449435['as'],'attributes':_0x449435['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ad1('0xe')](function(_0x206403){logger[_0x5ad1('0xf')](_0x5ad1('0x20'),_0x23e226);logger[_0x5ad1('0x21')](_0x5ad1('0x20'),_0x23e226,JSON[_0x5ad1('0x12')](_0x206403));_0x1efc42(_0x206403);})['catch'](function(_0x1ad856){logger[_0x5ad1('0x13')](_0x5ad1('0x20'),_0x1ad856['message'],_0x23e226);_0x3dd0e0(_0x265da5['error'](0x1f4,_0x1ad856[_0x5ad1('0x15')]));});});};exports[_0x5ad1('0x22')]=function(_0x156b97){var _0x15992c=this;return new Promise(function(_0x599d88,_0x547971){return db[_0x5ad1('0x17')][_0x5ad1('0x23')]({'raw':_0x156b97[_0x5ad1('0x19')]?_0x156b97[_0x5ad1('0x19')][_0x5ad1('0x24')]===undefined?!![]:![]:!![],'where':_0x156b97['options']?_0x156b97[_0x5ad1('0x19')][_0x5ad1('0x1a')]||null:null,'attributes':_0x156b97[_0x5ad1('0x19')]?_0x156b97[_0x5ad1('0x19')][_0x5ad1('0x1b')]||null:null,'include':_0x156b97[_0x5ad1('0x19')]?_0x156b97[_0x5ad1('0x19')][_0x5ad1('0x1d')]?_[_0x5ad1('0x1e')](_0x156b97[_0x5ad1('0x19')][_0x5ad1('0x1d')],function(_0x5d6c2d){return{'model':db[_0x5d6c2d[_0x5ad1('0x1f')]],'as':_0x5d6c2d['as'],'attributes':_0x5d6c2d[_0x5ad1('0x1b')],'include':_0x5d6c2d['include']?_[_0x5ad1('0x1e')](_0x5d6c2d[_0x5ad1('0x1d')],function(_0x5dc3cb){return{'model':db[_0x5dc3cb[_0x5ad1('0x1f')]],'as':_0x5dc3cb['as'],'attributes':_0x5dc3cb[_0x5ad1('0x1b')],'include':_0x5dc3cb[_0x5ad1('0x1d')]?_[_0x5ad1('0x1e')](_0x5dc3cb[_0x5ad1('0x1d')],function(_0x3dd07f){return{'model':db[_0x3dd07f[_0x5ad1('0x1f')]],'as':_0x3dd07f['as'],'attributes':_0x3dd07f['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ad1('0xe')](function(_0x209db5){logger[_0x5ad1('0xf')](_0x5ad1('0x22'),_0x156b97);logger['debug'](_0x5ad1('0x22'),_0x156b97,JSON[_0x5ad1('0x12')](_0x209db5));_0x599d88(_0x209db5);})[_0x5ad1('0x16')](function(_0x2e90ce){logger['error'](_0x5ad1('0x22'),_0x2e90ce[_0x5ad1('0x15')],_0x156b97);_0x547971(_0x15992c[_0x5ad1('0x13')](0x1f4,_0x2e90ce[_0x5ad1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 4aa096b..53873c7 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 _0xaaa6=['register','whatsappQueue:','save','remove','update','removeListener'];(function(_0xd54a8c,_0x411dce){var _0x75efa5=function(_0x640142){while(--_0x640142){_0xd54a8c['push'](_0xd54a8c['shift']());}};_0x75efa5(++_0x411dce);}(_0xaaa6,0x8c));var _0x6aaa=function(_0x1d927a,_0x153c1a){_0x1d927a=_0x1d927a-0x0;var _0x3f533c=_0xaaa6[_0x1d927a];return _0x3f533c;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x6aaa('0x0'),_0x6aaa('0x1'),_0x6aaa('0x2')];function createListener(_0x2e8302,_0x231951){return function(_0x1328a2){_0x231951['emit'](_0x2e8302,_0x1328a2);};}function removeListener(_0x2a7023,_0x42b9e8){return function(){WhatsappQueueEvents[_0x6aaa('0x3')](_0x2a7023,_0x42b9e8);};}exports[_0x6aaa('0x4')]=function(_0x5070da){for(var _0x1b103f=0x0,_0x20f5e7=events['length'];_0x1b103f<_0x20f5e7;_0x1b103f++){var _0x422203=events[_0x1b103f];var _0x22d3b8=createListener(_0x6aaa('0x5')+_0x422203,_0x5070da);WhatsappQueueEvents['on'](_0x422203,_0x22d3b8);}}; \ No newline at end of file +var _0x655d=['length','save','update','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x655d,0x81));var _0xd655=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x655d[_0x1cc8fe];return _0x230054;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xd655('0x0'),'remove',_0xd655('0x1')];function createListener(_0x4e83ad,_0x364700){return function(_0x534707){_0x364700['emit'](_0x4e83ad,_0x534707);};}function removeListener(_0x4c9d12,_0x3c07ad){return function(){WhatsappQueueEvents['removeListener'](_0x4c9d12,_0x3c07ad);};}exports[_0xd655('0x2')]=function(_0x28cf40){for(var _0x130ec0=0x0,_0x55ed8a=events[_0xd655('0x3')];_0x130ec0<_0x55ed8a;_0x130ec0++){var _0x50384f=events[_0x130ec0];var _0x3c5b67=createListener('whatsappQueue:'+_0x50384f,_0x28cf40);WhatsappQueueEvents['on'](_0x50384f,_0x3c5b67);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index cce72b1..ea6adae 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 _0xedf8=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','index','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x32ecda,_0x1dc368){var _0x56b376=function(_0x594dfe){while(--_0x594dfe){_0x32ecda['push'](_0x32ecda['shift']());}};_0x56b376(++_0x1dc368);}(_0xedf8,0x1eb));var _0x8edf=function(_0x333925,_0x349d94){_0x333925=_0x333925-0x0;var _0x28d191=_0xedf8[_0x333925];return _0x28d191;};'use strict';var multer=require('multer');var util=require(_0x8edf('0x0'));var path=require(_0x8edf('0x1'));var timeout=require(_0x8edf('0x2'));var express=require('express');var router=express[_0x8edf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8edf('0x4'));var interaction=require(_0x8edf('0x5'));var config=require(_0x8edf('0x6'));var controller=require(_0x8edf('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8edf('0x8')]);router[_0x8edf('0x9')]('/describe',auth[_0x8edf('0xa')](),controller['describe']);router[_0x8edf('0x9')](_0x8edf('0xb'),auth['isAuthenticated'](),controller[_0x8edf('0xc')]);router[_0x8edf('0xd')]('/',auth['isAuthenticated'](),controller[_0x8edf('0xe')]);router[_0x8edf('0xf')](_0x8edf('0xb'),auth[_0x8edf('0xa')](),controller[_0x8edf('0x10')]);router['delete'](_0x8edf('0xb'),auth[_0x8edf('0xa')](),controller[_0x8edf('0x11')]);module[_0x8edf('0x12')]=router; \ No newline at end of file +var _0x9d5c=['/:id','show','post','create','put','update','delete','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','/describe','describe','get'];(function(_0x757ee6,_0x2e2d15){var _0x174fd9=function(_0x2f0fc0){while(--_0x2f0fc0){_0x757ee6['push'](_0x757ee6['shift']());}};_0x174fd9(++_0x2e2d15);}(_0x9d5c,0xb3));var _0xc9d5=function(_0x1c8a30,_0x48cb84){_0x1c8a30=_0x1c8a30-0x0;var _0x3a6fa8=_0x9d5c[_0x1c8a30];return _0x3a6fa8;};'use strict';var multer=require(_0xc9d5('0x0'));var util=require(_0xc9d5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc9d5('0x2')]();var fs_extra=require(_0xc9d5('0x3'));var auth=require(_0xc9d5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc9d5('0x5'));var controller=require(_0xc9d5('0x6'));router['get']('/',auth[_0xc9d5('0x7')](),controller['index']);router['get'](_0xc9d5('0x8'),auth[_0xc9d5('0x7')](),controller[_0xc9d5('0x9')]);router[_0xc9d5('0xa')](_0xc9d5('0xb'),auth[_0xc9d5('0x7')](),controller[_0xc9d5('0xc')]);router[_0xc9d5('0xd')]('/',auth[_0xc9d5('0x7')](),controller[_0xc9d5('0xe')]);router[_0xc9d5('0xf')]('/:id',auth[_0xc9d5('0x7')](),controller[_0xc9d5('0x10')]);router[_0xc9d5('0x11')](_0xc9d5('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xc9d5('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 0a6bc3a..03fabeb 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(_0x1be2b9,_0x1ef861){var _0xa85d9c=function(_0x43d83f){while(--_0x43d83f){_0x1be2b9['push'](_0x1be2b9['shift']());}};_0xa85d9c(++_0x1ef861);}(_0x7a54,0x106));var _0x47a5=function(_0x354124,_0x1e0658){_0x354124=_0x354124-0x0;var _0x5089d3=_0x7a54[_0x354124];return _0x5089d3;};'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(_0x48a62e,_0x4f4c21){var _0x558f65=function(_0x27f233){while(--_0x27f233){_0x48a62e['push'](_0x48a62e['shift']());}};_0x558f65(++_0x4f4c21);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 9c2143c..ede23b9 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 _0xe1e3=['path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','offset','limit','count','status','set','Content-Range','apply','reject','destroy','then','end','name','index','map','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','WhatsappQueueReport','includeAll','include','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','bluebird','util'];(function(_0x161ac3,_0x142e49){var _0x3bb837=function(_0x269c7c){while(--_0x269c7c){_0x161ac3['push'](_0x161ac3['shift']());}};_0x3bb837(++_0x142e49);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x28e2b9,_0x2ddba3){_0x28e2b9=_0x28e2b9-0x0;var _0x260a56=_0xe1e3[_0x28e2b9];return _0x260a56;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e47b9,_0x536129){_0x536129=_0x536129||0xcc;return function(_0x5c09a2){if(_0x5c09a2){return _0x4e47b9[_0x3e1e('0x14')](_0x536129);}return _0x4e47b9['status'](_0x536129)['end']();};}function respondWithResult(_0x3a9375,_0x8bd4cd){_0x8bd4cd=_0x8bd4cd||0xc8;return function(_0x78ee54){if(_0x78ee54){return _0x3a9375['status'](_0x8bd4cd)['json'](_0x78ee54);}};}function respondWithFilteredResult(_0x4131a1,_0x1b62e6){return function(_0x4dca60){if(_0x4dca60){var _0x26cb35=typeof _0x1b62e6[_0x3e1e('0x15')]==='undefined'&&typeof _0x1b62e6[_0x3e1e('0x16')]==='undefined';var _0x23228c=_0x4dca60[_0x3e1e('0x17')];var _0x1d786c=_0x26cb35?0x0:_0x1b62e6[_0x3e1e('0x15')];var _0x791ed8=_0x26cb35?_0x4dca60[_0x3e1e('0x17')]:_0x1b62e6['offset']+_0x1b62e6['limit'];var _0x4a9497;if(_0x791ed8>=_0x23228c){_0x791ed8=_0x23228c;_0x4a9497=0xc8;}else{_0x4a9497=0xce;}_0x4131a1[_0x3e1e('0x18')](_0x4a9497);return _0x4131a1[_0x3e1e('0x19')](_0x3e1e('0x1a'),_0x1d786c+'-'+_0x791ed8+'/'+_0x23228c)['json'](_0x4dca60);}return null;};}function patchUpdates(_0x1c5acd){return function(_0x530815){try{jsonpatch[_0x3e1e('0x1b')](_0x530815,_0x1c5acd,!![]);}catch(_0x33ec1d){return BPromise[_0x3e1e('0x1c')](_0x33ec1d);}return _0x530815['save']();};}function saveUpdates(_0x53e051,_0x96396){return function(_0xefa098){if(_0xefa098){return _0xefa098['update'](_0x53e051)['then'](function(_0x13d7ac){return _0x13d7ac;});}return null;};}function removeEntity(_0x1b5097,_0x488f9f){return function(_0x60e6bc){if(_0x60e6bc){return _0x60e6bc[_0x3e1e('0x1d')]()[_0x3e1e('0x1e')](function(){_0x1b5097[_0x3e1e('0x18')](0xcc)[_0x3e1e('0x1f')]();});}};}function handleEntityNotFound(_0x159212,_0x43d583){return function(_0x21c898){if(!_0x21c898){_0x159212['sendStatus'](0x194);}return _0x21c898;};}function handleError(_0x5d908e,_0x44e419){_0x44e419=_0x44e419||0x1f4;return function(_0x541ef1){logger['error'](_0x541ef1['stack']);if(_0x541ef1['name']){delete _0x541ef1[_0x3e1e('0x20')];}_0x5d908e[_0x3e1e('0x18')](_0x44e419)['send'](_0x541ef1);};}exports[_0x3e1e('0x21')]=function(_0x5ac814,_0xdfcd93){var _0x176bb4={},_0x53a6ff={},_0x43e029={'count':0x0,'rows':[]};var _0x210a84=_[_0x3e1e('0x22')](db['WhatsappQueueReport'][_0x3e1e('0x23')],function(_0x4ec149){return{'name':_0x4ec149['fieldName'],'type':_0x4ec149['type'][_0x3e1e('0x24')]};});_0x53a6ff['model']=_['map'](_0x210a84,_0x3e1e('0x20'));_0x53a6ff[_0x3e1e('0x25')]=_[_0x3e1e('0x26')](_0x5ac814[_0x3e1e('0x25')]);_0x53a6ff[_0x3e1e('0x27')]=_['intersection'](_0x53a6ff['model'],_0x53a6ff['query']);_0x176bb4['attributes']=_[_0x3e1e('0x28')](_0x53a6ff[_0x3e1e('0x29')],qs[_0x3e1e('0x2a')](_0x5ac814[_0x3e1e('0x25')][_0x3e1e('0x2a')]));_0x176bb4[_0x3e1e('0x2b')]=_0x176bb4[_0x3e1e('0x2b')][_0x3e1e('0x2c')]?_0x176bb4['attributes']:_0x53a6ff[_0x3e1e('0x29')];if(!_0x5ac814[_0x3e1e('0x25')]['hasOwnProperty'](_0x3e1e('0x2d'))){_0x176bb4[_0x3e1e('0x16')]=qs[_0x3e1e('0x16')](_0x5ac814[_0x3e1e('0x25')]['limit']);_0x176bb4['offset']=qs[_0x3e1e('0x15')](_0x5ac814[_0x3e1e('0x25')]['offset']);}_0x176bb4[_0x3e1e('0x2e')]=qs[_0x3e1e('0x2f')](_0x5ac814['query'][_0x3e1e('0x2f')]);_0x176bb4[_0x3e1e('0x30')]=qs[_0x3e1e('0x27')](_[_0x3e1e('0x31')](_0x5ac814[_0x3e1e('0x25')],_0x53a6ff['filters']),_0x210a84);if(_0x5ac814[_0x3e1e('0x25')][_0x3e1e('0x32')]){_0x176bb4[_0x3e1e('0x30')]=_[_0x3e1e('0x33')](_0x176bb4['where'],{'$or':_[_0x3e1e('0x22')](_0x210a84,function(_0xf973c9){if(_0xf973c9[_0x3e1e('0x34')]!==_0x3e1e('0x35')){var _0x2cc5c7={};_0x2cc5c7[_0xf973c9[_0x3e1e('0x20')]]={'$like':'%'+_0x5ac814[_0x3e1e('0x25')]['filter']+'%'};return _0x2cc5c7;}})});}_0x176bb4=_[_0x3e1e('0x33')]({},_0x176bb4,_0x5ac814['options']);var _0x53bdf5={'where':_0x176bb4[_0x3e1e('0x30')]};return db[_0x3e1e('0x36')][_0x3e1e('0x17')](_0x53bdf5)['then'](function(_0x3dbd2a){_0x43e029[_0x3e1e('0x17')]=_0x3dbd2a;if(_0x5ac814['query'][_0x3e1e('0x37')]){_0x176bb4[_0x3e1e('0x38')]=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x176bb4);})[_0x3e1e('0x1e')](function(_0x49e4cb){_0x43e029['rows']=_0x49e4cb;return _0x43e029;})[_0x3e1e('0x1e')](respondWithFilteredResult(_0xdfcd93,_0x176bb4))[_0x3e1e('0x39')](handleError(_0xdfcd93,null));};exports[_0x3e1e('0x3a')]=function(_0x202748,_0x377a06){var _0x55ea1d={'raw':!![],'where':{'id':_0x202748[_0x3e1e('0x3b')]['id']}},_0x5b32ad={};_0x5b32ad[_0x3e1e('0x29')]=_[_0x3e1e('0x26')](db['WhatsappQueueReport'][_0x3e1e('0x23')]);_0x5b32ad[_0x3e1e('0x25')]=_[_0x3e1e('0x26')](_0x202748['query']);_0x5b32ad[_0x3e1e('0x27')]=_['intersection'](_0x5b32ad['model'],_0x5b32ad[_0x3e1e('0x25')]);_0x55ea1d[_0x3e1e('0x2b')]=_[_0x3e1e('0x28')](_0x5b32ad[_0x3e1e('0x29')],qs['fields'](_0x202748['query']['fields']));_0x55ea1d['attributes']=_0x55ea1d[_0x3e1e('0x2b')][_0x3e1e('0x2c')]?_0x55ea1d['attributes']:_0x5b32ad['model'];if(_0x202748[_0x3e1e('0x25')][_0x3e1e('0x37')]){_0x55ea1d[_0x3e1e('0x38')]=[{'all':!![]}];}_0x55ea1d=_['merge']({},_0x55ea1d,_0x202748[_0x3e1e('0x3c')]);return db['WhatsappQueueReport'][_0x3e1e('0x3d')](_0x55ea1d)[_0x3e1e('0x1e')](handleEntityNotFound(_0x377a06,null))[_0x3e1e('0x1e')](respondWithResult(_0x377a06,null))[_0x3e1e('0x39')](handleError(_0x377a06,null));};exports[_0x3e1e('0x3e')]=function(_0x3de309,_0x53d32b){return db[_0x3e1e('0x36')][_0x3e1e('0x3e')](_0x3de309['body'],{})[_0x3e1e('0x1e')](respondWithResult(_0x53d32b,0xc9))[_0x3e1e('0x39')](handleError(_0x53d32b,null));};exports['update']=function(_0x1cc820,_0x347b3f){if(_0x1cc820[_0x3e1e('0x3f')]['id']){delete _0x1cc820[_0x3e1e('0x3f')]['id'];}return db['WhatsappQueueReport'][_0x3e1e('0x3d')]({'where':{'id':_0x1cc820[_0x3e1e('0x3b')]['id']}})[_0x3e1e('0x1e')](handleEntityNotFound(_0x347b3f,null))[_0x3e1e('0x1e')](saveUpdates(_0x1cc820['body'],null))[_0x3e1e('0x1e')](respondWithResult(_0x347b3f,null))[_0x3e1e('0x39')](handleError(_0x347b3f,null));};exports[_0x3e1e('0x1d')]=function(_0x25ddf7,_0xe2516c){return db[_0x3e1e('0x36')][_0x3e1e('0x3d')]({'where':{'id':_0x25ddf7[_0x3e1e('0x3b')]['id']}})['then'](handleEntityNotFound(_0xe2516c,null))[_0x3e1e('0x1e')](removeEntity(_0xe2516c,null))['catch'](handleError(_0xe2516c,null));};exports['describe']=function(_0x4c8583,_0x1c4269){return db[_0x3e1e('0x36')]['describe']()[_0x3e1e('0x1e')](respondWithResult(_0x1c4269,null))['catch'](handleError(_0x1c4269,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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x14a0,0x8e));var _0x014a=function(_0x3b79c5,_0x3cd860){_0x3b79c5=_0x3b79c5-0x0;var _0x16581e=_0x14a0[_0x3b79c5];return _0x16581e;};'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 b3fc4ea..0cf8e62 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 _0xd5fb=['util','../../config/logger','api','moment','../../config/environment','./whatsappQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x28c0cb,_0x4b54f3){var _0x9d54f7=function(_0x293e00){while(--_0x293e00){_0x28c0cb['push'](_0x28c0cb['shift']());}};_0x9d54f7(++_0x4b54f3);}(_0xd5fb,0xa9));var _0xbd5f=function(_0x379c3e,_0x5c9d34){_0x379c3e=_0x379c3e-0x0;var _0x20fa30=_0xd5fb[_0x379c3e];return _0x20fa30;};'use strict';var _=require(_0xbd5f('0x0'));var util=require(_0xbd5f('0x1'));var logger=require(_0xbd5f('0x2'))(_0xbd5f('0x3'));var moment=require(_0xbd5f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbd5f('0x5'));var attributes=require(_0xbd5f('0x6'));module[_0xbd5f('0x7')]=function(_0x3c02b9,_0xe0c02){return _0x3c02b9[_0xbd5f('0x8')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xbd5f('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5e59=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0x5e59,0x6e));var _0x95e5=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0x5e59[_0x45313f];return _0x402910;};'use strict';var _=require(_0x95e5('0x0'));var util=require(_0x95e5('0x1'));var logger=require(_0x95e5('0x2'))(_0x95e5('0x3'));var moment=require('moment');var BPromise=require(_0x95e5('0x4'));var rp=require(_0x95e5('0x5'));var fs=require('fs');var path=require(_0x95e5('0x6'));var rimraf=require(_0x95e5('0x7'));var config=require(_0x95e5('0x8'));var attributes=require(_0x95e5('0x9'));module[_0x95e5('0xa')]=function(_0x23f268,_0x1d2eca){return _0x23f268['define'](_0x95e5('0xb'),attributes,{'tableName':_0x95e5('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x95e5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 866b298..f259f1a 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 _0x15df=['message','info','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x48429a,_0x2ea0db){var _0x5f76df=function(_0xe73051){while(--_0xe73051){_0x48429a['push'](_0x48429a['shift']());}};_0x5f76df(++_0x2ea0db);}(_0x15df,0xa1));var _0xf15d=function(_0x320ddb,_0x41c163){_0x320ddb=_0x320ddb-0x0;var _0xc48c17=_0x15df[_0x320ddb];return _0xc48c17;};'use strict';var _=require(_0xf15d('0x0'));var util=require(_0xf15d('0x1'));var moment=require(_0xf15d('0x2'));var BPromise=require(_0xf15d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf15d('0x4'));var db=require(_0xf15d('0x5'))['db'];var utils=require(_0xf15d('0x6'));var logger=require('../../config/logger')(_0xf15d('0x7'));var config=require(_0xf15d('0x8'));var jayson=require(_0xf15d('0x9'));var client=jayson[_0xf15d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50bbab,_0x23051d,_0x38050d){return new BPromise(function(_0x1d4cb5,_0x1834b2){return client[_0xf15d('0xb')](_0x50bbab,_0x38050d)['then'](function(_0x5a856c){logger['info'](_0xf15d('0xc'),_0x23051d,_0xf15d('0xd'));logger[_0xf15d('0xe')](_0xf15d('0xf'),_0x23051d,_0xf15d('0xd'),JSON[_0xf15d('0x10')](_0x5a856c));if(_0x5a856c[_0xf15d('0x11')]){if(_0x5a856c[_0xf15d('0x11')][_0xf15d('0x12')]===0x1f4){logger[_0xf15d('0x11')](_0xf15d('0xc'),_0x23051d,_0x5a856c[_0xf15d('0x11')][_0xf15d('0x13')]);return _0x1834b2(_0x5a856c['error'][_0xf15d('0x13')]);}logger[_0xf15d('0x11')](_0xf15d('0xc'),_0x23051d,_0x5a856c[_0xf15d('0x11')][_0xf15d('0x13')]);return _0x1d4cb5(_0x5a856c[_0xf15d('0x11')][_0xf15d('0x13')]);}else{logger[_0xf15d('0x14')](_0xf15d('0xc'),_0x23051d,_0xf15d('0xd'));_0x1d4cb5(_0x5a856c['result'][_0xf15d('0x13')]);}})[_0xf15d('0x15')](function(_0x3aea7c){logger[_0xf15d('0x11')](_0xf15d('0xc'),_0x23051d,_0x3aea7c);_0x1834b2(_0x3aea7c);});});}exports[_0xf15d('0x16')]=function(_0x34b684){var _0x32d429=this;return new Promise(function(_0x21d3cb,_0x254a6f){return db[_0xf15d('0x17')][_0xf15d('0x18')](_0x34b684[_0xf15d('0x19')],{'raw':_0x34b684[_0xf15d('0x1a')]?_0x34b684[_0xf15d('0x1a')][_0xf15d('0x1b')]===undefined?!![]:![]:!![]})[_0xf15d('0x1c')](function(_0x1ad3d2){logger['info'](_0xf15d('0x16'),_0x34b684);logger[_0xf15d('0xe')](_0xf15d('0x16'),_0x34b684,JSON[_0xf15d('0x10')](_0x1ad3d2));_0x21d3cb(_0x1ad3d2);})['catch'](function(_0x382230){logger['error'](_0xf15d('0x16'),_0x382230[_0xf15d('0x13')],_0x34b684);_0x254a6f(_0x32d429[_0xf15d('0x11')](0x1f4,_0x382230[_0xf15d('0x13')]));});});};exports[_0xf15d('0x1d')]=function(_0x12c2eb){var _0x52660d=this;return new Promise(function(_0x3c91ff,_0xe5e895){return db['WhatsappQueueReport']['update'](_0x12c2eb['body'],{'raw':_0x12c2eb[_0xf15d('0x1a')]?_0x12c2eb['options'][_0xf15d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12c2eb[_0xf15d('0x1a')]?_0x12c2eb[_0xf15d('0x1a')]['where']||null:null,'attributes':_0x12c2eb[_0xf15d('0x1a')]?_0x12c2eb[_0xf15d('0x1a')]['attributes']||null:null,'limit':_0x12c2eb['options']?_0x12c2eb[_0xf15d('0x1a')]['limit']||null:null})[_0xf15d('0x1c')](function(_0xcce131){logger['info'](_0xf15d('0x1d'),_0x12c2eb);logger[_0xf15d('0xe')](_0xf15d('0x1d'),_0x12c2eb,JSON[_0xf15d('0x10')](_0xcce131));_0x3c91ff(_0xcce131);})[_0xf15d('0x15')](function(_0x24e71f){logger[_0xf15d('0x11')]('UpdateWhatsappQueueReport',_0x24e71f[_0xf15d('0x13')],_0x12c2eb);_0xe5e895(_0x52660d['error'](0x1f4,_0x24e71f[_0xf15d('0x13')]));});});}; \ No newline at end of file +var _0x5905=['result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x59aecc,_0x255014){var _0x46b112=function(_0x285bc3){while(--_0x285bc3){_0x59aecc['push'](_0x59aecc['shift']());}};_0x46b112(++_0x255014);}(_0x5905,0x134));var _0x5590=function(_0x11036f,_0x112547){_0x11036f=_0x11036f-0x0;var _0x55a346=_0x5905[_0x11036f];return _0x55a346;};'use strict';var _=require(_0x5590('0x0'));var util=require(_0x5590('0x1'));var moment=require(_0x5590('0x2'));var BPromise=require('bluebird');var rs=require(_0x5590('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5590('0x4'))['db'];var utils=require(_0x5590('0x5'));var logger=require(_0x5590('0x6'))(_0x5590('0x7'));var config=require(_0x5590('0x8'));var jayson=require(_0x5590('0x9'));var client=jayson['client'][_0x5590('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dc3d1,_0x2878ba,_0x412b8b){return new BPromise(function(_0x1bfebe,_0x1d4279){return client[_0x5590('0xb')](_0x4dc3d1,_0x412b8b)[_0x5590('0xc')](function(_0x2509df){logger[_0x5590('0xd')](_0x5590('0xe'),_0x2878ba,_0x5590('0xf'));logger[_0x5590('0x10')](_0x5590('0x11'),_0x2878ba,_0x5590('0xf'),JSON[_0x5590('0x12')](_0x2509df));if(_0x2509df['error']){if(_0x2509df[_0x5590('0x13')][_0x5590('0x14')]===0x1f4){logger[_0x5590('0x13')](_0x5590('0xe'),_0x2878ba,_0x2509df[_0x5590('0x13')][_0x5590('0x15')]);return _0x1d4279(_0x2509df[_0x5590('0x13')][_0x5590('0x15')]);}logger[_0x5590('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2878ba,_0x2509df[_0x5590('0x13')]['message']);return _0x1bfebe(_0x2509df['error'][_0x5590('0x15')]);}else{logger[_0x5590('0xd')](_0x5590('0xe'),_0x2878ba,_0x5590('0xf'));_0x1bfebe(_0x2509df[_0x5590('0x16')][_0x5590('0x15')]);}})[_0x5590('0x17')](function(_0x264c86){logger[_0x5590('0x13')](_0x5590('0xe'),_0x2878ba,_0x264c86);_0x1d4279(_0x264c86);});});}exports[_0x5590('0x18')]=function(_0x39f494){var _0x33ac0c=this;return new Promise(function(_0xf450bd,_0x51a9c4){return db[_0x5590('0x19')][_0x5590('0x1a')](_0x39f494[_0x5590('0x1b')],{'raw':_0x39f494['options']?_0x39f494[_0x5590('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x5590('0xc')](function(_0x274018){logger['info']('CreateWhatsappQueueReport',_0x39f494);logger[_0x5590('0x10')](_0x5590('0x18'),_0x39f494,JSON['stringify'](_0x274018));_0xf450bd(_0x274018);})[_0x5590('0x17')](function(_0x341fdd){logger[_0x5590('0x13')](_0x5590('0x18'),_0x341fdd['message'],_0x39f494);_0x51a9c4(_0x33ac0c[_0x5590('0x13')](0x1f4,_0x341fdd[_0x5590('0x15')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x14f259){var _0x4f01b4=this;return new Promise(function(_0x1de3b9,_0x59d82e){return db['WhatsappQueueReport']['update'](_0x14f259[_0x5590('0x1b')],{'raw':_0x14f259[_0x5590('0x1c')]?_0x14f259[_0x5590('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14f259['options']?_0x14f259['options'][_0x5590('0x1d')]||null:null,'attributes':_0x14f259[_0x5590('0x1c')]?_0x14f259[_0x5590('0x1c')][_0x5590('0x1e')]||null:null,'limit':_0x14f259[_0x5590('0x1c')]?_0x14f259[_0x5590('0x1c')][_0x5590('0x1f')]||null:null})['then'](function(_0x4fbe88){logger[_0x5590('0xd')]('UpdateWhatsappQueueReport',_0x14f259);logger[_0x5590('0x10')](_0x5590('0x20'),_0x14f259,JSON['stringify'](_0x4fbe88));_0x1de3b9(_0x4fbe88);})[_0x5590('0x17')](function(_0x24ae26){logger['error'](_0x5590('0x20'),_0x24ae26[_0x5590('0x15')],_0x14f259);_0x59d82e(_0x4f01b4[_0x5590('0x13')](0x1f4,_0x24ae26[_0x5590('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index df8e0ab..91ab112 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 _0xc421=['../../config/environment','./whatsappTransferReport.controller','get','index','describe','isAuthenticated','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2515f8,_0x38e831){var _0xccb0d6=function(_0x1c5dbc){while(--_0x1c5dbc){_0x2515f8['push'](_0x2515f8['shift']());}};_0xccb0d6(++_0x38e831);}(_0xc421,0x148));var _0x1c42=function(_0x51bfad,_0x375e57){_0x51bfad=_0x51bfad-0x0;var _0x375bb5=_0xc421[_0x51bfad];return _0x375bb5;};'use strict';var multer=require('multer');var util=require(_0x1c42('0x0'));var path=require(_0x1c42('0x1'));var timeout=require(_0x1c42('0x2'));var express=require(_0x1c42('0x3'));var router=express[_0x1c42('0x4')]();var fs_extra=require(_0x1c42('0x5'));var auth=require(_0x1c42('0x6'));var interaction=require(_0x1c42('0x7'));var config=require(_0x1c42('0x8'));var controller=require(_0x1c42('0x9'));router[_0x1c42('0xa')]('/',auth['isAuthenticated'](),controller[_0x1c42('0xb')]);router[_0x1c42('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x1c42('0xc')]);router[_0x1c42('0xa')]('/:id',auth[_0x1c42('0xd')](),controller[_0x1c42('0xe')]);router['post']('/',auth[_0x1c42('0xd')](),controller[_0x1c42('0xf')]);router[_0x1c42('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1c42('0x11')]);router[_0x1c42('0x12')]('/:id',auth[_0x1c42('0xd')](),controller[_0x1c42('0x13')]);module[_0x1c42('0x14')]=router; \ No newline at end of file +var _0xd1d4=['create','put','/:id','update','delete','destroy','exports','multer','util','express','Router','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x1bfc33,_0x48c342){var _0x2422b6=function(_0x3c676e){while(--_0x3c676e){_0x1bfc33['push'](_0x1bfc33['shift']());}};_0x2422b6(++_0x48c342);}(_0xd1d4,0x79));var _0x4d1d=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xd1d4[_0x1ccdf7];return _0x52a0ae;};'use strict';var multer=require(_0x4d1d('0x0'));var util=require(_0x4d1d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4d1d('0x2'));var router=express[_0x4d1d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4d1d('0x4'));router[_0x4d1d('0x5')]('/',auth[_0x4d1d('0x6')](),controller[_0x4d1d('0x7')]);router[_0x4d1d('0x5')](_0x4d1d('0x8'),auth[_0x4d1d('0x6')](),controller[_0x4d1d('0x9')]);router['get']('/:id',auth[_0x4d1d('0x6')](),controller[_0x4d1d('0xa')]);router[_0x4d1d('0xb')]('/',auth['isAuthenticated'](),controller[_0x4d1d('0xc')]);router[_0x4d1d('0xd')](_0x4d1d('0xe'),auth[_0x4d1d('0x6')](),controller[_0x4d1d('0xf')]);router[_0x4d1d('0x10')](_0x4d1d('0xe'),auth['isAuthenticated'](),controller[_0x4d1d('0x11')]);module[_0x4d1d('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index c259106..e727bd0 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 _0xae24=['STRING','ENUM','account','agent','queue','DATE'];(function(_0x26253d,_0x5dfc80){var _0x318a82=function(_0x22ae6a){while(--_0x22ae6a){_0x26253d['push'](_0x26253d['shift']());}};_0x318a82(++_0x5dfc80);}(_0xae24,0x180));var _0x4ae2=function(_0x20c023,_0x2a80c0){_0x20c023=_0x20c023-0x0;var _0x5a2251=_0xae24[_0x20c023];return _0x5a2251;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4ae2('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x4ae2('0x1')](_0x4ae2('0x2'),_0x4ae2('0x3'),_0x4ae2('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4ae2('0x5')]}}; \ No newline at end of file +var _0x585e=['sequelize','exports','STRING','ENUM','account','DATE'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x585e,0x1c2));var _0xe585=function(_0x1db4b4,_0x44a2aa){_0x1db4b4=_0x1db4b4-0x0;var _0x39fc6f=_0x585e[_0x1db4b4];return _0x39fc6f;};'use strict';var Sequelize=require(_0xe585('0x0'));module[_0xe585('0x1')]={'uniqueid':{'type':Sequelize[_0xe585('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe585('0x3')](_0xe585('0x4'),'agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xe585('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index ae78050..7812b3c 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 _0x80c4=['merge','type','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','WhatsappTransferReport','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x33a432,_0x1acced){var _0x45bd47=function(_0x215360){while(--_0x215360){_0x33a432['push'](_0x33a432['shift']());}};_0x45bd47(++_0x1acced);}(_0x80c4,0xa3));var _0x480c=function(_0x1ceb48,_0x2b2ad5){_0x1ceb48=_0x1ceb48-0x0;var _0x13686c=_0x80c4[_0x1ceb48];return _0x13686c;};'use strict';var emlformat=require(_0x480c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x480c('0x1'));var jsonpatch=require(_0x480c('0x2'));var rp=require(_0x480c('0x3'));var moment=require(_0x480c('0x4'));var BPromise=require(_0x480c('0x5'));var Mustache=require(_0x480c('0x6'));var util=require('util');var path=require(_0x480c('0x7'));var sox=require(_0x480c('0x8'));var csv=require(_0x480c('0x9'));var ejs=require(_0x480c('0xa'));var fs=require('fs');var fs_extra=require(_0x480c('0xb'));var _=require(_0x480c('0xc'));var squel=require(_0x480c('0xd'));var crypto=require(_0x480c('0xe'));var jsforce=require(_0x480c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x480c('0x9'));var querystring=require(_0x480c('0x10'));var Papa=require(_0x480c('0x11'));var Redis=require(_0x480c('0x12'));var authService=require(_0x480c('0x13'));var qs=require(_0x480c('0x14'));var as=require(_0x480c('0x15'));var hardwareService=require(_0x480c('0x16'));var logger=require(_0x480c('0x17'))(_0x480c('0x18'));var utils=require(_0x480c('0x19'));var config=require(_0x480c('0x1a'));var licenseUtil=require(_0x480c('0x1b'));var db=require(_0x480c('0x1c'))['db'];function respondWithStatusCode(_0x428d08,_0x3f5438){_0x3f5438=_0x3f5438||0xcc;return function(_0x376da3){if(_0x376da3){return _0x428d08[_0x480c('0x1d')](_0x3f5438);}return _0x428d08['status'](_0x3f5438)[_0x480c('0x1e')]();};}function respondWithResult(_0x29613b,_0x5efdbb){_0x5efdbb=_0x5efdbb||0xc8;return function(_0x3b48b6){if(_0x3b48b6){return _0x29613b[_0x480c('0x1f')](_0x5efdbb)[_0x480c('0x20')](_0x3b48b6);}};}function respondWithFilteredResult(_0x513f2d,_0x5ea02c){return function(_0x445635){if(_0x445635){var _0x164428=typeof _0x5ea02c[_0x480c('0x21')]===_0x480c('0x22')&&typeof _0x5ea02c[_0x480c('0x23')]==='undefined';var _0x5b5ea3=_0x445635['count'];var _0xfc8a9f=_0x164428?0x0:_0x5ea02c[_0x480c('0x21')];var _0x54750c=_0x164428?_0x445635[_0x480c('0x24')]:_0x5ea02c['offset']+_0x5ea02c[_0x480c('0x23')];var _0x1507d1;if(_0x54750c>=_0x5b5ea3){_0x54750c=_0x5b5ea3;_0x1507d1=0xc8;}else{_0x1507d1=0xce;}_0x513f2d[_0x480c('0x1f')](_0x1507d1);return _0x513f2d['set'](_0x480c('0x25'),_0xfc8a9f+'-'+_0x54750c+'/'+_0x5b5ea3)[_0x480c('0x20')](_0x445635);}return null;};}function patchUpdates(_0x9e5a12){return function(_0x5840be){try{jsonpatch[_0x480c('0x26')](_0x5840be,_0x9e5a12,!![]);}catch(_0x50bb63){return BPromise[_0x480c('0x27')](_0x50bb63);}return _0x5840be[_0x480c('0x28')]();};}function saveUpdates(_0x5b5a51,_0x3b5bca){return function(_0x3cca31){if(_0x3cca31){return _0x3cca31[_0x480c('0x29')](_0x5b5a51)[_0x480c('0x2a')](function(_0x5dbf8f){return _0x5dbf8f;});}return null;};}function removeEntity(_0x1bc75c,_0x241901){return function(_0x5288f5){if(_0x5288f5){return _0x5288f5[_0x480c('0x2b')]()[_0x480c('0x2a')](function(){_0x1bc75c[_0x480c('0x1f')](0xcc)[_0x480c('0x1e')]();});}};}function handleEntityNotFound(_0x12445d,_0x7f067f){return function(_0x4008ff){if(!_0x4008ff){_0x12445d[_0x480c('0x1d')](0x194);}return _0x4008ff;};}function handleError(_0x72e37b,_0x40def3){_0x40def3=_0x40def3||0x1f4;return function(_0x1363ef){logger['error'](_0x1363ef['stack']);if(_0x1363ef[_0x480c('0x2c')]){delete _0x1363ef['name'];}_0x72e37b['status'](_0x40def3)['send'](_0x1363ef);};}exports['index']=function(_0x4451fe,_0x6019aa){var _0x337816={},_0x377e5c={},_0x592c2b={'count':0x0,'rows':[]};var _0x4a54b2=_['map'](db[_0x480c('0x2d')][_0x480c('0x2e')],function(_0x5c56e5){return{'name':_0x5c56e5[_0x480c('0x2f')],'type':_0x5c56e5['type']['key']};});_0x377e5c[_0x480c('0x30')]=_[_0x480c('0x31')](_0x4a54b2,_0x480c('0x2c'));_0x377e5c[_0x480c('0x32')]=_[_0x480c('0x33')](_0x4451fe[_0x480c('0x32')]);_0x377e5c[_0x480c('0x34')]=_[_0x480c('0x35')](_0x377e5c['model'],_0x377e5c['query']);_0x337816[_0x480c('0x36')]=_[_0x480c('0x35')](_0x377e5c['model'],qs[_0x480c('0x37')](_0x4451fe[_0x480c('0x32')][_0x480c('0x37')]));_0x337816[_0x480c('0x36')]=_0x337816[_0x480c('0x36')][_0x480c('0x38')]?_0x337816[_0x480c('0x36')]:_0x377e5c[_0x480c('0x30')];if(!_0x4451fe[_0x480c('0x32')][_0x480c('0x39')](_0x480c('0x3a'))){_0x337816[_0x480c('0x23')]=qs[_0x480c('0x23')](_0x4451fe[_0x480c('0x32')][_0x480c('0x23')]);_0x337816['offset']=qs[_0x480c('0x21')](_0x4451fe[_0x480c('0x32')][_0x480c('0x21')]);}_0x337816[_0x480c('0x3b')]=qs['sort'](_0x4451fe[_0x480c('0x32')][_0x480c('0x3c')]);_0x337816['where']=qs[_0x480c('0x34')](_['pick'](_0x4451fe[_0x480c('0x32')],_0x377e5c[_0x480c('0x34')]),_0x4a54b2);if(_0x4451fe[_0x480c('0x32')]['filter']){_0x337816[_0x480c('0x3d')]=_[_0x480c('0x3e')](_0x337816[_0x480c('0x3d')],{'$or':_[_0x480c('0x31')](_0x4a54b2,function(_0x588669){if(_0x588669[_0x480c('0x3f')]!==_0x480c('0x40')){var _0x21877b={};_0x21877b[_0x588669[_0x480c('0x2c')]]={'$like':'%'+_0x4451fe[_0x480c('0x32')]['filter']+'%'};return _0x21877b;}})});}_0x337816=_['merge']({},_0x337816,_0x4451fe[_0x480c('0x41')]);var _0x2b5003={'where':_0x337816[_0x480c('0x3d')]};return db[_0x480c('0x2d')]['count'](_0x2b5003)[_0x480c('0x2a')](function(_0x30d983){_0x592c2b[_0x480c('0x24')]=_0x30d983;if(_0x4451fe[_0x480c('0x32')][_0x480c('0x42')]){_0x337816[_0x480c('0x43')]=[{'all':!![]}];}return db[_0x480c('0x2d')]['findAll'](_0x337816);})[_0x480c('0x2a')](function(_0x4ca83c){_0x592c2b[_0x480c('0x44')]=_0x4ca83c;return _0x592c2b;})[_0x480c('0x2a')](respondWithFilteredResult(_0x6019aa,_0x337816))['catch'](handleError(_0x6019aa,null));};exports[_0x480c('0x45')]=function(_0x2aad21,_0x4bee28){var _0xa5e32d={'raw':!![],'where':{'id':_0x2aad21[_0x480c('0x46')]['id']}},_0x4d62fb={};_0x4d62fb[_0x480c('0x30')]=_[_0x480c('0x33')](db['WhatsappTransferReport'][_0x480c('0x2e')]);_0x4d62fb[_0x480c('0x32')]=_[_0x480c('0x33')](_0x2aad21[_0x480c('0x32')]);_0x4d62fb[_0x480c('0x34')]=_[_0x480c('0x35')](_0x4d62fb[_0x480c('0x30')],_0x4d62fb[_0x480c('0x32')]);_0xa5e32d[_0x480c('0x36')]=_[_0x480c('0x35')](_0x4d62fb[_0x480c('0x30')],qs['fields'](_0x2aad21[_0x480c('0x32')]['fields']));_0xa5e32d[_0x480c('0x36')]=_0xa5e32d['attributes'][_0x480c('0x38')]?_0xa5e32d[_0x480c('0x36')]:_0x4d62fb[_0x480c('0x30')];if(_0x2aad21[_0x480c('0x32')][_0x480c('0x42')]){_0xa5e32d['include']=[{'all':!![]}];}_0xa5e32d=_[_0x480c('0x3e')]({},_0xa5e32d,_0x2aad21['options']);return db[_0x480c('0x2d')][_0x480c('0x47')](_0xa5e32d)['then'](handleEntityNotFound(_0x4bee28,null))['then'](respondWithResult(_0x4bee28,null))[_0x480c('0x48')](handleError(_0x4bee28,null));};exports['create']=function(_0x2649e0,_0x2c1ca6){return db[_0x480c('0x2d')]['create'](_0x2649e0['body'],{})['then'](respondWithResult(_0x2c1ca6,0xc9))[_0x480c('0x48')](handleError(_0x2c1ca6,null));};exports['update']=function(_0x3d7b08,_0x1ec5a2){if(_0x3d7b08[_0x480c('0x49')]['id']){delete _0x3d7b08[_0x480c('0x49')]['id'];}return db['WhatsappTransferReport'][_0x480c('0x47')]({'where':{'id':_0x3d7b08[_0x480c('0x46')]['id']}})[_0x480c('0x2a')](handleEntityNotFound(_0x1ec5a2,null))[_0x480c('0x2a')](saveUpdates(_0x3d7b08[_0x480c('0x49')],null))[_0x480c('0x2a')](respondWithResult(_0x1ec5a2,null))[_0x480c('0x48')](handleError(_0x1ec5a2,null));};exports[_0x480c('0x2b')]=function(_0x5d5668,_0x41c2d3){return db[_0x480c('0x2d')]['find']({'where':{'id':_0x5d5668['params']['id']}})[_0x480c('0x2a')](handleEntityNotFound(_0x41c2d3,null))['then'](removeEntity(_0x41c2d3,null))['catch'](handleError(_0x41c2d3,null));};exports['describe']=function(_0x5cca6e,_0x2b97ff){return db['WhatsappTransferReport'][_0x480c('0x4a')]()[_0x480c('0x2a')](respondWithResult(_0x2b97ff,null))[_0x480c('0x48')](handleError(_0x2b97ff,null));}; \ No newline at end of file +var _0xf612=['order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','undefined','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x3c43d6,_0x316bb5){var _0x4570ae=function(_0x55774c){while(--_0x55774c){_0x3c43d6['push'](_0x3c43d6['shift']());}};_0x4570ae(++_0x316bb5);}(_0xf612,0x14b));var _0x2f61=function(_0x456a18,_0x3fef5f){_0x456a18=_0x456a18-0x0;var _0x4dfb0d=_0xf612[_0x456a18];return _0x4dfb0d;};'use strict';var emlformat=require(_0x2f61('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f61('0x1'));var jsonpatch=require(_0x2f61('0x2'));var rp=require(_0x2f61('0x3'));var moment=require(_0x2f61('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2f61('0x5'));var util=require(_0x2f61('0x6'));var path=require(_0x2f61('0x7'));var sox=require(_0x2f61('0x8'));var csv=require(_0x2f61('0x9'));var ejs=require(_0x2f61('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f61('0xb'));var squel=require(_0x2f61('0xc'));var crypto=require(_0x2f61('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2f61('0xe'));var toCsv=require(_0x2f61('0x9'));var querystring=require(_0x2f61('0xf'));var Papa=require(_0x2f61('0x10'));var Redis=require(_0x2f61('0x11'));var authService=require(_0x2f61('0x12'));var qs=require(_0x2f61('0x13'));var as=require(_0x2f61('0x14'));var hardwareService=require(_0x2f61('0x15'));var logger=require('../../config/logger')(_0x2f61('0x16'));var utils=require(_0x2f61('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2f61('0x18'));var db=require(_0x2f61('0x19'))['db'];function respondWithStatusCode(_0x3e25a9,_0x39f9a2){_0x39f9a2=_0x39f9a2||0xcc;return function(_0x283adc){if(_0x283adc){return _0x3e25a9['sendStatus'](_0x39f9a2);}return _0x3e25a9['status'](_0x39f9a2)[_0x2f61('0x1a')]();};}function respondWithResult(_0x50b4bc,_0x540198){_0x540198=_0x540198||0xc8;return function(_0x3d33b5){if(_0x3d33b5){return _0x50b4bc['status'](_0x540198)[_0x2f61('0x1b')](_0x3d33b5);}};}function respondWithFilteredResult(_0x36244a,_0x4d9848){return function(_0x3f3e4f){if(_0x3f3e4f){var _0x1a8cfa=typeof _0x4d9848[_0x2f61('0x1c')]===_0x2f61('0x1d')&&typeof _0x4d9848['limit']==='undefined';var _0x369492=_0x3f3e4f['count'];var _0x14330f=_0x1a8cfa?0x0:_0x4d9848[_0x2f61('0x1c')];var _0x1ecd14=_0x1a8cfa?_0x3f3e4f['count']:_0x4d9848[_0x2f61('0x1c')]+_0x4d9848['limit'];var _0x2685be;if(_0x1ecd14>=_0x369492){_0x1ecd14=_0x369492;_0x2685be=0xc8;}else{_0x2685be=0xce;}_0x36244a[_0x2f61('0x1e')](_0x2685be);return _0x36244a[_0x2f61('0x1f')](_0x2f61('0x20'),_0x14330f+'-'+_0x1ecd14+'/'+_0x369492)[_0x2f61('0x1b')](_0x3f3e4f);}return null;};}function patchUpdates(_0xa3620a){return function(_0x1859e6){try{jsonpatch[_0x2f61('0x21')](_0x1859e6,_0xa3620a,!![]);}catch(_0x543d9d){return BPromise[_0x2f61('0x22')](_0x543d9d);}return _0x1859e6[_0x2f61('0x23')]();};}function saveUpdates(_0x437b27,_0x31b801){return function(_0x12f57e){if(_0x12f57e){return _0x12f57e[_0x2f61('0x24')](_0x437b27)[_0x2f61('0x25')](function(_0x5ab9dd){return _0x5ab9dd;});}return null;};}function removeEntity(_0x1735c9,_0x1b606d){return function(_0x2bade7){if(_0x2bade7){return _0x2bade7[_0x2f61('0x26')]()[_0x2f61('0x25')](function(){_0x1735c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22933d,_0x4739e9){return function(_0x44eb40){if(!_0x44eb40){_0x22933d['sendStatus'](0x194);}return _0x44eb40;};}function handleError(_0x28336b,_0xc13fd){_0xc13fd=_0xc13fd||0x1f4;return function(_0x47f35b){logger[_0x2f61('0x27')](_0x47f35b[_0x2f61('0x28')]);if(_0x47f35b['name']){delete _0x47f35b[_0x2f61('0x29')];}_0x28336b[_0x2f61('0x1e')](_0xc13fd)[_0x2f61('0x2a')](_0x47f35b);};}exports[_0x2f61('0x2b')]=function(_0xd7e14a,_0x480f93){var _0x3ead9e={},_0x14a6fc={},_0x3767a7={'count':0x0,'rows':[]};var _0x2ef56c=_[_0x2f61('0x2c')](db[_0x2f61('0x2d')][_0x2f61('0x2e')],function(_0x58e23b){return{'name':_0x58e23b['fieldName'],'type':_0x58e23b[_0x2f61('0x2f')]['key']};});_0x14a6fc[_0x2f61('0x30')]=_[_0x2f61('0x2c')](_0x2ef56c,_0x2f61('0x29'));_0x14a6fc['query']=_[_0x2f61('0x31')](_0xd7e14a['query']);_0x14a6fc[_0x2f61('0x32')]=_['intersection'](_0x14a6fc[_0x2f61('0x30')],_0x14a6fc[_0x2f61('0x33')]);_0x3ead9e[_0x2f61('0x34')]=_[_0x2f61('0x35')](_0x14a6fc[_0x2f61('0x30')],qs[_0x2f61('0x36')](_0xd7e14a[_0x2f61('0x33')]['fields']));_0x3ead9e[_0x2f61('0x34')]=_0x3ead9e[_0x2f61('0x34')][_0x2f61('0x37')]?_0x3ead9e[_0x2f61('0x34')]:_0x14a6fc[_0x2f61('0x30')];if(!_0xd7e14a[_0x2f61('0x33')][_0x2f61('0x38')](_0x2f61('0x39'))){_0x3ead9e[_0x2f61('0x3a')]=qs[_0x2f61('0x3a')](_0xd7e14a[_0x2f61('0x33')][_0x2f61('0x3a')]);_0x3ead9e[_0x2f61('0x1c')]=qs[_0x2f61('0x1c')](_0xd7e14a['query'][_0x2f61('0x1c')]);}_0x3ead9e[_0x2f61('0x3b')]=qs['sort'](_0xd7e14a[_0x2f61('0x33')][_0x2f61('0x3c')]);_0x3ead9e[_0x2f61('0x3d')]=qs[_0x2f61('0x32')](_[_0x2f61('0x3e')](_0xd7e14a[_0x2f61('0x33')],_0x14a6fc[_0x2f61('0x32')]),_0x2ef56c);if(_0xd7e14a[_0x2f61('0x33')][_0x2f61('0x3f')]){_0x3ead9e['where']=_[_0x2f61('0x40')](_0x3ead9e['where'],{'$or':_['map'](_0x2ef56c,function(_0x1c3394){if(_0x1c3394[_0x2f61('0x2f')]!==_0x2f61('0x41')){var _0x3763a1={};_0x3763a1[_0x1c3394[_0x2f61('0x29')]]={'$like':'%'+_0xd7e14a[_0x2f61('0x33')][_0x2f61('0x3f')]+'%'};return _0x3763a1;}})});}_0x3ead9e=_[_0x2f61('0x40')]({},_0x3ead9e,_0xd7e14a[_0x2f61('0x42')]);var _0x13cd17={'where':_0x3ead9e[_0x2f61('0x3d')]};return db[_0x2f61('0x2d')][_0x2f61('0x43')](_0x13cd17)[_0x2f61('0x25')](function(_0x212814){_0x3767a7[_0x2f61('0x43')]=_0x212814;if(_0xd7e14a[_0x2f61('0x33')][_0x2f61('0x44')]){_0x3ead9e[_0x2f61('0x45')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x2f61('0x46')](_0x3ead9e);})['then'](function(_0x909efe){_0x3767a7[_0x2f61('0x47')]=_0x909efe;return _0x3767a7;})[_0x2f61('0x25')](respondWithFilteredResult(_0x480f93,_0x3ead9e))[_0x2f61('0x48')](handleError(_0x480f93,null));};exports['show']=function(_0x3a4415,_0x514ab2){var _0x3c9aa7={'raw':!![],'where':{'id':_0x3a4415[_0x2f61('0x49')]['id']}},_0x27bc94={};_0x27bc94[_0x2f61('0x30')]=_[_0x2f61('0x31')](db[_0x2f61('0x2d')][_0x2f61('0x2e')]);_0x27bc94[_0x2f61('0x33')]=_['keys'](_0x3a4415['query']);_0x27bc94[_0x2f61('0x32')]=_[_0x2f61('0x35')](_0x27bc94[_0x2f61('0x30')],_0x27bc94[_0x2f61('0x33')]);_0x3c9aa7['attributes']=_[_0x2f61('0x35')](_0x27bc94[_0x2f61('0x30')],qs[_0x2f61('0x36')](_0x3a4415[_0x2f61('0x33')][_0x2f61('0x36')]));_0x3c9aa7[_0x2f61('0x34')]=_0x3c9aa7[_0x2f61('0x34')][_0x2f61('0x37')]?_0x3c9aa7[_0x2f61('0x34')]:_0x27bc94['model'];if(_0x3a4415['query']['includeAll']){_0x3c9aa7['include']=[{'all':!![]}];}_0x3c9aa7=_[_0x2f61('0x40')]({},_0x3c9aa7,_0x3a4415['options']);return db[_0x2f61('0x2d')]['find'](_0x3c9aa7)['then'](handleEntityNotFound(_0x514ab2,null))[_0x2f61('0x25')](respondWithResult(_0x514ab2,null))[_0x2f61('0x48')](handleError(_0x514ab2,null));};exports[_0x2f61('0x4a')]=function(_0x388126,_0x21acb9){return db[_0x2f61('0x2d')][_0x2f61('0x4a')](_0x388126[_0x2f61('0x4b')],{})[_0x2f61('0x25')](respondWithResult(_0x21acb9,0xc9))[_0x2f61('0x48')](handleError(_0x21acb9,null));};exports[_0x2f61('0x24')]=function(_0x4e21ee,_0x134ad9){if(_0x4e21ee[_0x2f61('0x4b')]['id']){delete _0x4e21ee[_0x2f61('0x4b')]['id'];}return db[_0x2f61('0x2d')]['find']({'where':{'id':_0x4e21ee['params']['id']}})[_0x2f61('0x25')](handleEntityNotFound(_0x134ad9,null))[_0x2f61('0x25')](saveUpdates(_0x4e21ee[_0x2f61('0x4b')],null))[_0x2f61('0x25')](respondWithResult(_0x134ad9,null))[_0x2f61('0x48')](handleError(_0x134ad9,null));};exports['destroy']=function(_0x392756,_0x2ec07e){return db[_0x2f61('0x2d')][_0x2f61('0x4c')]({'where':{'id':_0x392756['params']['id']}})[_0x2f61('0x25')](handleEntityNotFound(_0x2ec07e,null))[_0x2f61('0x25')](removeEntity(_0x2ec07e,null))[_0x2f61('0x48')](handleError(_0x2ec07e,null));};exports[_0x2f61('0x4d')]=function(_0x23fcb6,_0x460dcb){return db[_0x2f61('0x2d')][_0x2f61('0x4d')]()[_0x2f61('0x25')](respondWithResult(_0x460dcb,null))[_0x2f61('0x48')](handleError(_0x460dcb,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 07099ae..d5790f1 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 _0xb4cf=['moment','bluebird','path','../../config/environment','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x4f2108,_0x2f2e58){var _0x4f3111=function(_0x609868){while(--_0x609868){_0x4f2108['push'](_0x4f2108['shift']());}};_0x4f3111(++_0x2f2e58);}(_0xb4cf,0x194));var _0xfb4c=function(_0x1a1caa,_0x39295f){_0x1a1caa=_0x1a1caa-0x0;var _0x322687=_0xb4cf[_0x1a1caa];return _0x322687;};'use strict';var _=require(_0xfb4c('0x0'));var util=require(_0xfb4c('0x1'));var logger=require(_0xfb4c('0x2'))('api');var moment=require(_0xfb4c('0x3'));var BPromise=require(_0xfb4c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb4c('0x5'));var rimraf=require('rimraf');var config=require(_0xfb4c('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0xfb4c('0x7')]=function(_0x5b7ef8,_0x9b57b1){return _0x5b7ef8['define'](_0xfb4c('0x8'),attributes,{'tableName':_0xfb4c('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xfb4c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x971b=['report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport'];(function(_0x3b737e,_0x10f07e){var _0x336d50=function(_0x2a72ac){while(--_0x2a72ac){_0x3b737e['push'](_0x3b737e['shift']());}};_0x336d50(++_0x10f07e);}(_0x971b,0x1ec));var _0xb971=function(_0x5875ad,_0x3597b8){_0x5875ad=_0x5875ad-0x0;var _0x32a922=_0x971b[_0x5875ad];return _0x32a922;};'use strict';var _=require(_0xb971('0x0'));var util=require(_0xb971('0x1'));var logger=require(_0xb971('0x2'))('api');var moment=require(_0xb971('0x3'));var BPromise=require(_0xb971('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb971('0x5'));var rimraf=require(_0xb971('0x6'));var config=require(_0xb971('0x7'));var attributes=require(_0xb971('0x8'));module[_0xb971('0x9')]=function(_0x5ac2c7,_0x49b933){return _0x5ac2c7[_0xb971('0xa')](_0xb971('0xb'),attributes,{'tableName':_0xb971('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb971('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index e377258..c0e3b5b 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 _0xd129=['jayson/promise','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0xd129,0x134));var _0x9d12=function(_0xa19577,_0x29b5da){_0xa19577=_0xa19577-0x0;var _0x3a8ed9=_0xd129[_0xa19577];return _0x3a8ed9;};'use strict';var _=require(_0x9d12('0x0'));var util=require('util');var moment=require(_0x9d12('0x1'));var BPromise=require(_0x9d12('0x2'));var rs=require(_0x9d12('0x3'));var fs=require('fs');var Redis=require(_0x9d12('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d12('0x5'));var logger=require(_0x9d12('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9d12('0x7'));var client=jayson[_0x9d12('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5825b8,_0x5db191,_0x3312ca){return new BPromise(function(_0x278997,_0x49c740){return client[_0x9d12('0x9')](_0x5825b8,_0x3312ca)[_0x9d12('0xa')](function(_0x2c3c29){logger[_0x9d12('0xb')](_0x9d12('0xc'),_0x5db191,_0x9d12('0xd'));logger[_0x9d12('0xe')](_0x9d12('0xf'),_0x5db191,'request\x20sent',JSON[_0x9d12('0x10')](_0x2c3c29));if(_0x2c3c29['error']){if(_0x2c3c29[_0x9d12('0x11')][_0x9d12('0x12')]===0x1f4){logger['error'](_0x9d12('0xc'),_0x5db191,_0x2c3c29[_0x9d12('0x11')][_0x9d12('0x13')]);return _0x49c740(_0x2c3c29[_0x9d12('0x11')][_0x9d12('0x13')]);}logger[_0x9d12('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5db191,_0x2c3c29['error'][_0x9d12('0x13')]);return _0x278997(_0x2c3c29[_0x9d12('0x11')]['message']);}else{logger[_0x9d12('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5db191,_0x9d12('0xd'));_0x278997(_0x2c3c29['result']['message']);}})[_0x9d12('0x14')](function(_0x123bdb){logger[_0x9d12('0x11')](_0x9d12('0xc'),_0x5db191,_0x123bdb);_0x49c740(_0x123bdb);});});} \ No newline at end of file +var _0x7021=['info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x278bb6,_0x11b4f7){var _0x434995=function(_0x28971f){while(--_0x28971f){_0x278bb6['push'](_0x278bb6['shift']());}};_0x434995(++_0x11b4f7);}(_0x7021,0x97));var _0x1702=function(_0x292423,_0x1759b7){_0x292423=_0x292423-0x0;var _0x2801cb=_0x7021[_0x292423];return _0x2801cb;};'use strict';var _=require('lodash');var util=require(_0x1702('0x0'));var moment=require(_0x1702('0x1'));var BPromise=require(_0x1702('0x2'));var rs=require(_0x1702('0x3'));var fs=require('fs');var Redis=require(_0x1702('0x4'));var db=require(_0x1702('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1702('0x6'));var config=require(_0x1702('0x7'));var jayson=require(_0x1702('0x8'));var client=jayson['client'][_0x1702('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x396ffa,_0x143b26,_0x50761e){return new BPromise(function(_0x57c21d,_0x26d5a4){return client[_0x1702('0xa')](_0x396ffa,_0x50761e)['then'](function(_0x25d9b7){logger[_0x1702('0xb')](_0x1702('0xc'),_0x143b26,_0x1702('0xd'));logger[_0x1702('0xe')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x143b26,_0x1702('0xd'),JSON['stringify'](_0x25d9b7));if(_0x25d9b7[_0x1702('0xf')]){if(_0x25d9b7[_0x1702('0xf')]['code']===0x1f4){logger[_0x1702('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x143b26,_0x25d9b7['error'][_0x1702('0x10')]);return _0x26d5a4(_0x25d9b7[_0x1702('0xf')][_0x1702('0x10')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x143b26,_0x25d9b7[_0x1702('0xf')][_0x1702('0x10')]);return _0x57c21d(_0x25d9b7[_0x1702('0xf')][_0x1702('0x10')]);}else{logger[_0x1702('0xb')](_0x1702('0xc'),_0x143b26,_0x1702('0xd'));_0x57c21d(_0x25d9b7['result'][_0x1702('0x10')]);}})[_0x1702('0x11')](function(_0x383733){logger[_0x1702('0xf')](_0x1702('0xc'),_0x143b26,_0x383733);_0x26d5a4(_0x383733);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index c4c0e62..56e4abe 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9e8=['then','seedDB','default','listen','info','start','filter','exitCode','number','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','join','Offline\x20apps:','status','online','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sequelize','sync'];(function(_0x5ca3b8,_0xefe3d2){var _0x2c145c=function(_0xf8050b){while(--_0xf8050b){_0x5ca3b8['push'](_0x5ca3b8['shift']());}};_0x2c145c(++_0xefe3d2);}(_0xe9e8,0x179));var _0x8e9e=function(_0x4749f6,_0x4bb59f){_0x4749f6=_0x4749f6-0x0;var _0x2605d4=_0xe9e8[_0x4749f6];return _0x2605d4;};'use strict';var _=require(_0x8e9e('0x0'));var db=require(_0x8e9e('0x1'))['db'];var seedDb=require(_0x8e9e('0x2'));var checkLicense=require(_0x8e9e('0x3'));var rpc=require(_0x8e9e('0x4'));var config=require(_0x8e9e('0x5'));var logger=require(_0x8e9e('0x6'))('app');var pm2=require(_0x8e9e('0x7'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x8e9e('0x8'));var chat=require(_0x8e9e('0x9'));var whatsapp=require(_0x8e9e('0xa'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x8e9e('0xb')][_0x8e9e('0xc')]()[_0x8e9e('0xd')](function(){if(config[_0x8e9e('0xe')]){return seedDb[_0x8e9e('0xf')]();}})[_0x8e9e('0xd')](function(){return checkLicense['default']();})['then'](function(){return rpc[_0x8e9e('0x10')]();})[_0x8e9e('0xd')](function(_0x2488a3){logger[_0x8e9e('0x11')](_0x2488a3);return chat[_0x8e9e('0x12')]();})[_0x8e9e('0xd')](function(){return whatsapp[_0x8e9e('0x12')]();})[_0x8e9e('0xd')](function(){return schedule[_0x8e9e('0x12')]();})[_0x8e9e('0xd')](function(){return transcribe[_0x8e9e('0x12')]();})[_0x8e9e('0xd')](function(){return provider[_0x8e9e('0x12')]();})[_0x8e9e('0xd')](function(_0x555cb7){logger[_0x8e9e('0x11')](_0x555cb7);return pm2[_0x8e9e('0x12')](pm2Config);})[_0x8e9e('0xd')](function(_0x265d3a){var _0x5397cf=_0x265d3a[_0x8e9e('0x13')](function(_0x4bba06){return typeof _0x4bba06[_0x8e9e('0x14')]===_0x8e9e('0x15')&&_0x4bba06[_0x8e9e('0x14')]>=0x0;});if(_0x5397cf['length']>0x0){throw new Error(_0x5397cf['length']+_0x8e9e('0x16')+_[_0x8e9e('0x17')](_0x5397cf,function(_0x5b62ca){return'\x22'+_0x5b62ca[_0x8e9e('0x18')][_0x8e9e('0x19')]+'\x22';}));}logger[_0x8e9e('0x11')](_0x8e9e('0x1a'),_['map'](_[_0x8e9e('0x13')](_0x265d3a,{'status':'online'}),_0x8e9e('0x19'))[_0x8e9e('0x1b')]());logger[_0x8e9e('0x11')](_0x8e9e('0x1c'),_['map'](_['filter'](_0x265d3a,function(_0x4e0daa){return _0x4e0daa[_0x8e9e('0x1d')]!==_0x8e9e('0x1e');}),_0x8e9e('0x19'))[_0x8e9e('0x1b')]()||_0x8e9e('0x1f'));console[_0x8e9e('0x20')](_0x8e9e('0x21'));})[_0x8e9e('0x22')](function(_0x2664a0){console[_0x8e9e('0x20')](_0x8e9e('0x23'),_0x2664a0);logger[_0x8e9e('0x24')](_0x8e9e('0x25'),_0x2664a0);process[_0x8e9e('0x26')](0x1);});}main(); \ No newline at end of file +var _0xe06f=['./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','online','Offline\x20apps:','status','join','None','App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/license','./config/environment'];(function(_0x63e423,_0x59a7f4){var _0x312c74=function(_0x8fdbb5){while(--_0x8fdbb5){_0x63e423['push'](_0x63e423['shift']());}};_0x312c74(++_0x59a7f4);}(_0xe06f,0x65));var _0xfe06=function(_0x1e4473,_0x3c12d9){_0x1e4473=_0x1e4473-0x0;var _0x1a4b7d=_0xe06f[_0x1e4473];return _0x1a4b7d;};'use strict';var _=require(_0xfe06('0x0'));var db=require(_0xfe06('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xfe06('0x2'));var rpc=require('./rpc');var config=require(_0xfe06('0x3'));var logger=require(_0xfe06('0x4'))(_0xfe06('0x5'));var pm2=require(_0xfe06('0x6'));var pm2Config=require(_0xfe06('0x7'));var schedule=require(_0xfe06('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');var provider=require(_0xfe06('0x9'));function main(){return db[_0xfe06('0xa')][_0xfe06('0xb')]()[_0xfe06('0xc')](function(){if(config[_0xfe06('0xd')]){return seedDb[_0xfe06('0xe')]();}})['then'](function(){return checkLicense[_0xfe06('0xe')]();})[_0xfe06('0xc')](function(){return rpc[_0xfe06('0xf')]();})[_0xfe06('0xc')](function(_0x4efaa2){logger[_0xfe06('0x10')](_0x4efaa2);return chat[_0xfe06('0x11')]();})[_0xfe06('0xc')](function(){return whatsapp[_0xfe06('0x11')]();})[_0xfe06('0xc')](function(){return schedule[_0xfe06('0x11')]();})[_0xfe06('0xc')](function(){return transcribe[_0xfe06('0x11')]();})['then'](function(){return provider[_0xfe06('0x11')]();})[_0xfe06('0xc')](function(_0x3ffe50){logger[_0xfe06('0x10')](_0x3ffe50);return pm2['start'](pm2Config);})['then'](function(_0x3e44dd){var _0x5290be=_0x3e44dd[_0xfe06('0x12')](function(_0x3a41ab){return typeof _0x3a41ab[_0xfe06('0x13')]==='number'&&_0x3a41ab[_0xfe06('0x13')]>=0x0;});if(_0x5290be[_0xfe06('0x14')]>0x0){throw new Error(_0x5290be[_0xfe06('0x14')]+_0xfe06('0x15')+_[_0xfe06('0x16')](_0x5290be,function(_0x48dd0d){return'\x22'+_0x48dd0d[_0xfe06('0x17')]['name']+'\x22';}));}logger[_0xfe06('0x10')](_0xfe06('0x18'),_[_0xfe06('0x16')](_[_0xfe06('0x12')](_0x3e44dd,{'status':_0xfe06('0x19')}),'name')['join']());logger['info'](_0xfe06('0x1a'),_[_0xfe06('0x16')](_[_0xfe06('0x12')](_0x3e44dd,function(_0x4775b5){return _0x4775b5[_0xfe06('0x1b')]!=='online';}),'name')[_0xfe06('0x1c')]()||_0xfe06('0x1d'));console['log'](_0xfe06('0x1e'));})[_0xfe06('0x1f')](function(_0x1ac501){console[_0xfe06('0x20')](_0xfe06('0x21'),_0x1ac501);logger['error'](_0xfe06('0x22'),_0x1ac501);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 4a7b1a7..c0df487 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 _0xfea1=['split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','encryptString','promisify','sign','secret','payload','options','randomBytes','toString','hex','floor','HS512','../../mysqldb','../encryptor','jsonwebtoken','express-jwt','composable-middleware','bluebird','util','moment','secrets','session','fullname','name','internal','email','md5secret','voicePause','mailPause','smsPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isAuthenticated','use','user','ChatInteraction','findOne','params','disposition','then','closed','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub','Setting','allowedLoginAttempts','blockDuration','disabled','Invalid\x20API\x20access\x20key','blockedAt','User\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfea1,0x186));var _0x1fea=function(_0x2f06e0,_0x2e1c2a){_0x2f06e0=_0x2f06e0-0x0;var _0xf2711b=_0xfea1[_0x2f06e0];return _0xf2711b;};'use strict';var db=require(_0x1fea('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x1fea('0x1'));var _=require('lodash');var jwt=require(_0x1fea('0x2'));var expressJwt=require(_0x1fea('0x3'));var compose=require(_0x1fea('0x4'));var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require(_0x1fea('0x5'));var util=require(_0x1fea('0x6'));var moment=require(_0x1fea('0x7'));var validateJwt=expressJwt({'secret':config[_0x1fea('0x8')][_0x1fea('0x9')]});var userAttributes=['id','role',_0x1fea('0xa'),_0x1fea('0xb'),_0x1fea('0xc'),_0x1fea('0xd'),'userpic','permissions',_0x1fea('0xe'),_0x1fea('0xf'),'chatPause',_0x1fea('0x10'),'faxPause',_0x1fea('0x11'),'openchannelPause',_0x1fea('0x12'),'showWebBar',_0x1fea('0x13'),_0x1fea('0x14'),_0x1fea('0x15'),'allowmessenger',_0x1fea('0x16'),'alias',_0x1fea('0x17'),_0x1fea('0x18'),_0x1fea('0x19'),'phoneBarEnableRecording',_0x1fea('0x1a'),_0x1fea('0x1b'),_0x1fea('0x1c'),_0x1fea('0x1d'),_0x1fea('0x1e'),_0x1fea('0x1f'),_0x1fea('0x20'),_0x1fea('0x21'),'userProfileId','privacyEnabled',_0x1fea('0x22'),_0x1fea('0x23'),_0x1fea('0x24'),_0x1fea('0x25'),_0x1fea('0x26'),_0x1fea('0x27'),_0x1fea('0x28')];exports['isChatInteractionAuthorized']=function(){return this[_0x1fea('0x29')](!![])[_0x1fea('0x2a')](function(_0x5e1440,_0x23c107,_0x54c9dc){if(_0x5e1440[_0x1fea('0x2b')]){_0x54c9dc();}else{return db[_0x1fea('0x2c')][_0x1fea('0x2d')]({'where':{'id':_0x5e1440[_0x1fea('0x2e')]['id']},'attributes':['id','closed',_0x1fea('0x2f')],'raw':!![]})[_0x1fea('0x30')](function(_0x2e15dc){if(_0x2e15dc&&_0x2e15dc[_0x1fea('0x31')]){return _0x23c107[_0x1fea('0x32')](_0x2e15dc['disposition']===_0x1fea('0x33')?0x195:0x193)[_0x1fea('0x34')]({'message':_0x2e15dc[_0x1fea('0x2f')]===_0x1fea('0x33')?_0x1fea('0x35'):_0x1fea('0x36')});}else{_0x54c9dc();}})[_0x1fea('0x37')](function(_0x49ba7a){_0x54c9dc(_0x49ba7a);});}});};exports[_0x1fea('0x29')]=function isAuthenticated(_0x57ef0c){return compose()[_0x1fea('0x2a')](function(_0x3186db,_0x177174,_0xa35ba){var _0x2cb168;if(_0x3186db[_0x1fea('0x38')][_0x1fea('0x39')]){if(_[_0x1fea('0x3a')](_0x3186db['headers'][_0x1fea('0x39')],_0x1fea('0x3b'))){var _0x4e0b37=basicAuth(_0x3186db);db[_0x1fea('0x3c')]['find']({'where':{'name':_0x4e0b37[_0x1fea('0xb')]}})['then'](function(_0x1457b5){if(!_0x1457b5||!_0x1457b5[_0x1fea('0x3d')](_0x4e0b37[_0x1fea('0x3e')])){return _0x177174['status'](0x191)[_0x1fea('0x34')]({'message':_0x1fea('0x3f')});}_0x3186db[_0x1fea('0x2b')]={'id':_0x1457b5['id']};_0xa35ba();})[_0x1fea('0x37')](function(_0x5a89d3){_0xa35ba(_0x5a89d3);});}else if(_[_0x1fea('0x3a')](_0x3186db[_0x1fea('0x38')][_0x1fea('0x39')],_0x1fea('0x40'))){validateJwt(_0x3186db,_0x177174,_0xa35ba);}else{if(_0x57ef0c){_0xa35ba();}else{return _0x177174['status'](0x193)[_0x1fea('0x34')]({'message':_0x1fea('0x41')});}}}else if(_0x3186db[_0x1fea('0x42')][_0x1fea('0x43')]){try{var _0x4e5169={'audience':hardwareConf[_0x1fea('0x44')](),'issuer':hardwareConf[_0x1fea('0x44')]()};verifyJwt(_0x3186db[_0x1fea('0x42')]['apikey'],_0x4e5169)[_0x1fea('0x30')](function(_0x1b134a){return db[_0x1fea('0x3c')][_0x1fea('0x45')]({'where':{'id':_0x1b134a[_0x1fea('0x46')]}})[_0x1fea('0x30')](function(_0x33caed){_0x2cb168=_0x33caed;return db[_0x1fea('0x47')][_0x1fea('0x2d')]({'where':{'id':0x1},'attributes':[_0x1fea('0x48'),_0x1fea('0x49')],'raw':!![]});})['then'](function(_0x2261ad){if(!_0x2cb168||!_['isEqual'](_0x2cb168['apiKeyNonce'],_0x1b134a['nonce'])){return _0x177174[_0x1fea('0x32')](0x191)[_0x1fea('0x34')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x2cb168[_0x1fea('0x4a')]){return _0x177174[_0x1fea('0x32')](0x191)[_0x1fea('0x34')]({'message':_0x1fea('0x4b')});}if(_0x2cb168['blocked']){if(_0x2261ad[_0x1fea('0x49')]>0x0){if(moment(_0x2cb168[_0x1fea('0x4c')])['add'](_0x2261ad[_0x1fea('0x49')],'minutes')>moment()){return _0x177174[_0x1fea('0x32')](0x191)[_0x1fea('0x34')]({'message':_0x1fea('0x4b')});}}else{return _0x177174[_0x1fea('0x32')](0x191)[_0x1fea('0x34')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x3186db[_0x1fea('0x2b')]={'id':_0x2cb168['id']};_0xa35ba();});})[_0x1fea('0x37')](function(){return _0x177174[_0x1fea('0x32')](0x191)[_0x1fea('0x34')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x25f5cf){_0xa35ba(_0x25f5cf);}}else if(_0x57ef0c){_0xa35ba();}else{return _0x177174[_0x1fea('0x32')](0x193)[_0x1fea('0x34')]({'message':_0x1fea('0x41')});}})['use'](function(_0x4bb9a2,_0x204f4f,_0x196485){if(_0x4bb9a2[_0x1fea('0x2b')]){db[_0x1fea('0x3c')][_0x1fea('0x45')]({'where':{'id':_0x4bb9a2[_0x1fea('0x2b')]['id']},'attributes':userAttributes})[_0x1fea('0x30')](function(_0x3b27df){if(!_0x3b27df){return _0x204f4f[_0x1fea('0x32')](0x194)[_0x1fea('0x34')]({'message':_0x1fea('0x4d')});}_0x4bb9a2[_0x1fea('0x2b')]=_0x3b27df;_0x196485();})[_0x1fea('0x37')](function(_0x30e32f){_0x196485(_0x30e32f);});}else if(_0x57ef0c){_0x196485();}else{return _0x204f4f[_0x1fea('0x32')](0x194)[_0x1fea('0x34')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x1fea('0x4e')]=function canUpdate(){return compose()[_0x1fea('0x2a')](function(_0x2836fe,_0x309c06,_0x1fe477){return licenseUtil['getLicense']()[_0x1fea('0x30')](function(_0x546d41){if(_0x546d41['update']){_0x1fe477();}else{return _0x309c06['status'](0x193)['json']({'message':_0x1fea('0x4f')});}})[_0x1fea('0x37')](function(_0x349e22){_0x1fe477(_0x349e22);});});};exports[_0x1fea('0x50')]=function isWebrtcLicence(){return compose()[_0x1fea('0x2a')](function(_0x506776,_0x5a2de6,_0x826dd3){return licenseUtil[_0x1fea('0x51')]()['then'](function(_0x5c1b74){if(_0x5c1b74[_0x1fea('0x52')]){_0x826dd3();}else{return _0x5a2de6[_0x1fea('0x32')](0x193)['json']({'message':_0x1fea('0x4f')});}})[_0x1fea('0x37')](function(_0xde1721){_0x826dd3(_0xde1721);});});};exports[_0x1fea('0x53')]=function(_0x4d9189,_0x86f8a8,_0x361dbc){_0x4d9189[_0x1fea('0x53')]=!![];return _0x361dbc();};exports[_0x1fea('0x54')]=function signToken(_0x2a3b88){return signJwt(_0x2a3b88);};exports[_0x1fea('0x55')]=function(_0x5a00d5,_0x412244){if(!_0x5a00d5[_0x1fea('0x2b')]){return _0x412244['status'](0x194)['json']({'message':_0x1fea('0x56')});}var _0x3c2429={'payload':{'id':_0x5a00d5[_0x1fea('0x2b')]['id'],'role':_0x5a00d5[_0x1fea('0x2b')][_0x1fea('0x57')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3c2429)[_0x1fea('0x30')](function(_0x58f22b){_0x412244[_0x1fea('0x58')](_0x1fea('0x59'),_0x58f22b);_0x412244[_0x1fea('0x5a')](_0x1fea('0x5b'));})['catch'](function(_0x2a634d){return _0x412244[_0x1fea('0x32')](0x1f4)[_0x1fea('0x5c')](_0x2a634d);});};exports[_0x1fea('0x5d')]=function(_0x19b0ec){if(_[_0x1fea('0x5e')](_0x19b0ec[_0x1fea('0x5f')])||_[_0x1fea('0x5e')](_0x19b0ec['apiKeyIat'])){return null;}else{return createJwt(_0x19b0ec);}};exports[_0x1fea('0x60')]=function(_0xedb136){_0xedb136['apiKeyNonce']=generateNonce();_0xedb136[_0x1fea('0x61')]=generateIssuedAt();return createJwt(_0xedb136);};exports[_0x1fea('0x62')]=function(_0x3fbe57,_0x36a19a){var _0x270ee1=_0x3fbe57['query'][_0x1fea('0x43')];if(_0x270ee1){var _0x10937b={'nonce':_0x36a19a['apiKeyNonce'],'iat':_0x36a19a['apiKeyIat'],'audience':hardwareConf[_0x1fea('0x44')](),'issuer':hardwareConf[_0x1fea('0x44')]()};return verifyJwt(_0x270ee1,_0x10937b)[_0x1fea('0x30')](function(){return generateApiKey(_0x36a19a);});}else{throw{'message':_0x1fea('0x63')};}};exports[_0x1fea('0x64')]=function(_0x547c55){var _0x5d3eeb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5d3eeb[_0x1fea('0x65')](_0x547c55))throw new db[(_0x1fea('0x66'))][(_0x1fea('0x67'))](_0x1fea('0x68'));return;};exports['validatePasswordHistory']=function(_0xfa013,_0x374cf5,_0x2dbe03){var _0x11277a=encryptor[_0x1fea('0x69')](_0x374cf5)[_0x1fea('0x6a')](',');for(var _0x164a7d=0x0;_0x164a7d<_0x2dbe03;_0x164a7d++){if(!_0x11277a[_0x164a7d])break;if(_0xfa013[_0x1fea('0x6b')]()===_0x11277a[_0x164a7d][_0x1fea('0x6b')]()){var _0x18e41f=util[_0x1fea('0x6c')](_0x1fea('0x6d'),_0x2dbe03);if(_0x2dbe03===0x1){_0x18e41f=_0x1fea('0x6e');}throw new db[(_0x1fea('0x66'))][(_0x1fea('0x67'))](_0x18e41f);}}return;};exports[_0x1fea('0x6f')]=function(_0x29ba93,_0x3a7d83){var _0x1bde98=_0x3a7d83?encryptor[_0x1fea('0x69')](_0x3a7d83)[_0x1fea('0x6a')](','):[];if(_0x1bde98[_0x1fea('0x70')]===0x5){_0x1bde98['splice'](-0x1,0x1);}_0x1bde98['unshift'](_0x29ba93);return encryptor[_0x1fea('0x71')](_0x1bde98['join'](','));};function signJwt(_0x97c939){var _0x42a3fb=BPromise[_0x1fea('0x72')](jwt[_0x1fea('0x73')],{'context':jwt});var _0xf54898=_0x97c939[_0x1fea('0x74')]||config[_0x1fea('0x8')][_0x1fea('0x9')];return new BPromise(function(_0xb82760,_0x2c403b){_0x42a3fb(_0x97c939[_0x1fea('0x75')],_0xf54898,_0x97c939[_0x1fea('0x76')])[_0x1fea('0x30')](function(_0x32dc66){_0xb82760(_0x32dc66);})['catch'](function(_0x611050){_0x2c403b(_0x611050);});});}function verifyJwt(_0x216fab,_0xdb80ee,_0x49924f){var _0x28fa22=BPromise[_0x1fea('0x72')](jwt['verify'],{'context':jwt});var _0x362f71=_0x49924f||config[_0x1fea('0x8')]['session'];return new BPromise(function(_0x150e49,_0x496b24){_0x28fa22(_0x216fab,_0x362f71,_0xdb80ee)[_0x1fea('0x30')](function(_0x3519b8){_0x150e49(_0x3519b8);})[_0x1fea('0x37')](function(_0x495450){_0x496b24(_0x495450);});});}function generateNonce(){return crypto[_0x1fea('0x77')](0x10)[_0x1fea('0x78')](_0x1fea('0x79'));}function generateIssuedAt(){return Math[_0x1fea('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x27eb8d){var _0x45ce16={'payload':{'iat':_0x27eb8d[_0x1fea('0x61')],'nonce':_0x27eb8d[_0x1fea('0x5f')]},'options':{'algorithm':_0x1fea('0x7b'),'subject':_0x27eb8d['id'][_0x1fea('0x78')](),'issuer':hardwareConf[_0x1fea('0x44')](),'audience':hardwareConf[_0x1fea('0x44')]()}};return signJwt(_0x45ce16)['then'](function(_0x310a64){return{'iat':_0x27eb8d[_0x1fea('0x61')],'nonce':_0x27eb8d[_0x1fea('0x5f')],'token':_0x310a64};});} \ No newline at end of file +var _0x7d06=['composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','privacyEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','then','unmanaged','disposition','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','find','authenticate','status','json','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','User','sub','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','minutes','User\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','join','sign','secret','promisify','randomBytes','toString','hex','now','HS512','../../config/environment','../../config/license/hardware','jsonwebtoken','express-jwt'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7d06,0x1e8));var _0x67d0=function(_0x5359f0,_0x4a9382){_0x5359f0=_0x5359f0-0x0;var _0x37ab6e=_0x7d06[_0x5359f0];return _0x37ab6e;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x67d0('0x0'));var hardwareConf=require(_0x67d0('0x1'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require('lodash');var jwt=require(_0x67d0('0x2'));var expressJwt=require(_0x67d0('0x3'));var compose=require(_0x67d0('0x4'));var basicAuth=require(_0x67d0('0x5'));var crypto=require(_0x67d0('0x6'));var BPromise=require(_0x67d0('0x7'));var util=require(_0x67d0('0x8'));var moment=require(_0x67d0('0x9'));var validateJwt=expressJwt({'secret':config[_0x67d0('0xa')][_0x67d0('0xb')]});var userAttributes=['id',_0x67d0('0xc'),'fullname',_0x67d0('0xd'),_0x67d0('0xe'),_0x67d0('0xf'),_0x67d0('0x10'),_0x67d0('0x11'),_0x67d0('0x12'),_0x67d0('0x13'),_0x67d0('0x14'),_0x67d0('0x15'),'faxPause',_0x67d0('0x16'),'openchannelPause',_0x67d0('0x17'),_0x67d0('0x18'),_0x67d0('0x19'),_0x67d0('0x1a'),_0x67d0('0x1b'),_0x67d0('0x1c'),'passwordResetAt',_0x67d0('0x1d'),'phoneBarAutoAnswer',_0x67d0('0x1e'),_0x67d0('0x1f'),_0x67d0('0x20'),_0x67d0('0x21'),_0x67d0('0x22'),_0x67d0('0x23'),_0x67d0('0x24'),'phoneBarRemoteControl',_0x67d0('0x25'),'hotdesk',_0x67d0('0x26'),'userProfileId',_0x67d0('0x27'),'settingsEnabled',_0x67d0('0x28'),_0x67d0('0x29'),'downloadOmnichannelInteractions',_0x67d0('0x2a'),'ignorePauseForPreviewCalls',_0x67d0('0x2b')];exports[_0x67d0('0x2c')]=function(){return this[_0x67d0('0x2d')](!![])[_0x67d0('0x2e')](function(_0x2e467f,_0x38b13d,_0x5924a8){if(_0x2e467f[_0x67d0('0x2f')]){_0x5924a8();}else{return db[_0x67d0('0x30')][_0x67d0('0x31')]({'where':{'id':_0x2e467f[_0x67d0('0x32')]['id']},'attributes':['id',_0x67d0('0x33'),'disposition'],'raw':!![]})[_0x67d0('0x34')](function(_0x5169e1){if(_0x5169e1&&_0x5169e1[_0x67d0('0x33')]){return _0x38b13d['status'](_0x5169e1['disposition']===_0x67d0('0x35')?0x195:0x193)['json']({'message':_0x5169e1[_0x67d0('0x36')]===_0x67d0('0x35')?_0x67d0('0x37'):_0x67d0('0x38')});}else{_0x5924a8();}})[_0x67d0('0x39')](function(_0x17472f){_0x5924a8(_0x17472f);});}});};exports[_0x67d0('0x2d')]=function isAuthenticated(_0x1ee51b){return compose()['use'](function(_0x248b86,_0x40578b,_0x54a622){var _0x286fc9;if(_0x248b86[_0x67d0('0x3a')][_0x67d0('0x3b')]){if(_[_0x67d0('0x3c')](_0x248b86[_0x67d0('0x3a')]['authorization'],_0x67d0('0x3d'))){var _0x167c60=basicAuth(_0x248b86);db['User'][_0x67d0('0x3e')]({'where':{'name':_0x167c60[_0x67d0('0xd')]}})[_0x67d0('0x34')](function(_0x2294d1){if(!_0x2294d1||!_0x2294d1[_0x67d0('0x3f')](_0x167c60['pass'])){return _0x40578b[_0x67d0('0x40')](0x191)[_0x67d0('0x41')]({'message':'Wrong\x20credentials.'});}_0x248b86[_0x67d0('0x2f')]={'id':_0x2294d1['id']};_0x54a622();})[_0x67d0('0x39')](function(_0x76dd19){_0x54a622(_0x76dd19);});}else if(_['startsWith'](_0x248b86['headers'][_0x67d0('0x3b')],_0x67d0('0x42'))){validateJwt(_0x248b86,_0x40578b,_0x54a622);}else{if(_0x1ee51b){_0x54a622();}else{return _0x40578b[_0x67d0('0x40')](0x193)['json']({'message':_0x67d0('0x43')});}}}else if(_0x248b86['query'][_0x67d0('0x44')]){try{var _0x365665={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x67d0('0x45')]()};verifyJwt(_0x248b86[_0x67d0('0x46')]['apikey'],_0x365665)['then'](function(_0x5baaf4){return db[_0x67d0('0x47')][_0x67d0('0x3e')]({'where':{'id':_0x5baaf4[_0x67d0('0x48')]}})['then'](function(_0x5c9b8d){_0x286fc9=_0x5c9b8d;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x67d0('0x49'),_0x67d0('0x4a')],'raw':!![]});})[_0x67d0('0x34')](function(_0x218bfe){if(!_0x286fc9||!_['isEqual'](_0x286fc9[_0x67d0('0x4b')],_0x5baaf4[_0x67d0('0x4c')])){return _0x40578b[_0x67d0('0x40')](0x191)[_0x67d0('0x41')]({'message':_0x67d0('0x4d')});}if(_0x286fc9[_0x67d0('0x4e')]){return _0x40578b[_0x67d0('0x40')](0x191)['json']({'message':_0x67d0('0x4f')});}if(_0x286fc9[_0x67d0('0x50')]){if(_0x218bfe['blockDuration']>0x0){if(moment(_0x286fc9['blockedAt'])['add'](_0x218bfe[_0x67d0('0x4a')],_0x67d0('0x51'))>moment()){return _0x40578b[_0x67d0('0x40')](0x191)[_0x67d0('0x41')]({'message':_0x67d0('0x4f')});}}else{return _0x40578b[_0x67d0('0x40')](0x191)[_0x67d0('0x41')]({'message':_0x67d0('0x4f')});}}_0x248b86[_0x67d0('0x2f')]={'id':_0x286fc9['id']};_0x54a622();});})[_0x67d0('0x39')](function(){return _0x40578b[_0x67d0('0x40')](0x191)[_0x67d0('0x41')]({'message':_0x67d0('0x4f')});});}catch(_0x52c4cd){_0x54a622(_0x52c4cd);}}else if(_0x1ee51b){_0x54a622();}else{return _0x40578b[_0x67d0('0x40')](0x193)[_0x67d0('0x41')]({'message':_0x67d0('0x43')});}})[_0x67d0('0x2e')](function(_0x4c8dcd,_0x564ae0,_0x54c323){if(_0x4c8dcd[_0x67d0('0x2f')]){db[_0x67d0('0x47')]['find']({'where':{'id':_0x4c8dcd['user']['id']},'attributes':userAttributes})[_0x67d0('0x34')](function(_0x24c7c8){if(!_0x24c7c8){return _0x564ae0[_0x67d0('0x40')](0x194)[_0x67d0('0x41')]({'message':_0x67d0('0x52')});}_0x4c8dcd[_0x67d0('0x2f')]=_0x24c7c8;_0x54c323();})[_0x67d0('0x39')](function(_0x37d145){_0x54c323(_0x37d145);});}else if(_0x1ee51b){_0x54c323();}else{return _0x564ae0[_0x67d0('0x40')](0x194)[_0x67d0('0x41')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x67d0('0x53')]=function canUpdate(){return compose()['use'](function(_0x55e117,_0x941b05,_0x1284b2){return licenseUtil[_0x67d0('0x54')]()[_0x67d0('0x34')](function(_0x2953c0){if(_0x2953c0['update']){_0x1284b2();}else{return _0x941b05[_0x67d0('0x40')](0x193)[_0x67d0('0x41')]({'message':_0x67d0('0x55')});}})[_0x67d0('0x39')](function(_0x542227){_0x1284b2(_0x542227);});});};exports[_0x67d0('0x56')]=function isWebrtcLicence(){return compose()[_0x67d0('0x2e')](function(_0x1c1fc0,_0x2162e5,_0xecf20c){return licenseUtil[_0x67d0('0x54')]()[_0x67d0('0x34')](function(_0x10e1ba){if(_0x10e1ba[_0x67d0('0x57')]){_0xecf20c();}else{return _0x2162e5[_0x67d0('0x40')](0x193)['json']({'message':_0x67d0('0x55')});}})[_0x67d0('0x39')](function(_0x5d2dfc){_0xecf20c(_0x5d2dfc);});});};exports[_0x67d0('0x58')]=function(_0x21765b,_0x2134ac,_0x1cec89){_0x21765b[_0x67d0('0x58')]=!![];return _0x1cec89();};exports[_0x67d0('0x59')]=function signToken(_0x4ccea8){return signJwt(_0x4ccea8);};exports[_0x67d0('0x5a')]=function(_0x5055ce,_0x245bb6){if(!_0x5055ce[_0x67d0('0x2f')]){return _0x245bb6[_0x67d0('0x40')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x55fb9a={'payload':{'id':_0x5055ce[_0x67d0('0x2f')]['id'],'role':_0x5055ce[_0x67d0('0x2f')][_0x67d0('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x55fb9a)[_0x67d0('0x34')](function(_0x22214e){_0x245bb6[_0x67d0('0x5b')](_0x67d0('0x5c'),_0x22214e);_0x245bb6[_0x67d0('0x5d')](_0x67d0('0x5e'));})['catch'](function(_0x4fc02a){return _0x245bb6[_0x67d0('0x40')](0x1f4)['send'](_0x4fc02a);});};exports[_0x67d0('0x5f')]=function(_0x14226d){if(_[_0x67d0('0x60')](_0x14226d[_0x67d0('0x4b')])||_['isNil'](_0x14226d[_0x67d0('0x61')])){return null;}else{return createJwt(_0x14226d);}};exports[_0x67d0('0x62')]=function(_0x4de137){_0x4de137[_0x67d0('0x4b')]=generateNonce();_0x4de137[_0x67d0('0x61')]=generateIssuedAt();return createJwt(_0x4de137);};exports[_0x67d0('0x63')]=function(_0x1ec19b,_0x343147){var _0x53a23e=_0x1ec19b[_0x67d0('0x46')][_0x67d0('0x44')];if(_0x53a23e){var _0x5b7844={'nonce':_0x343147[_0x67d0('0x4b')],'iat':_0x343147[_0x67d0('0x61')],'audience':hardwareConf[_0x67d0('0x45')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x53a23e,_0x5b7844)[_0x67d0('0x34')](function(){return generateApiKey(_0x343147);});}else{throw{'message':_0x67d0('0x64')};}};exports['validatePasswordPattern']=function(_0x239173){var _0x1abd08=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1abd08[_0x67d0('0x65')](_0x239173))throw new db[(_0x67d0('0x66'))][(_0x67d0('0x67'))](_0x67d0('0x68'));return;};exports[_0x67d0('0x69')]=function(_0x3108e9,_0x150769,_0x1b79e1){var _0x5b4d00=encryptor[_0x67d0('0x6a')](_0x150769)['split'](',');for(var _0x508188=0x0;_0x508188<_0x1b79e1;_0x508188++){if(!_0x5b4d00[_0x508188])break;if(_0x3108e9[_0x67d0('0x6b')]()===_0x5b4d00[_0x508188][_0x67d0('0x6b')]()){var _0x3d07b9=util['format'](_0x67d0('0x6c'),_0x1b79e1);if(_0x1b79e1===0x1){_0x3d07b9=_0x67d0('0x6d');}throw new db[(_0x67d0('0x66'))]['ValidationError'](_0x3d07b9);}}return;};exports['updatePasswordsHistory']=function(_0x5461c8,_0xa69acc){var _0x4902e9=_0xa69acc?encryptor[_0x67d0('0x6a')](_0xa69acc)['split'](','):[];if(_0x4902e9[_0x67d0('0x6e')]===0x5){_0x4902e9[_0x67d0('0x6f')](-0x1,0x1);}_0x4902e9[_0x67d0('0x70')](_0x5461c8);return encryptor[_0x67d0('0x71')](_0x4902e9[_0x67d0('0x72')](','));};function signJwt(_0x3032f0){var _0x4283bc=BPromise['promisify'](jwt[_0x67d0('0x73')],{'context':jwt});var _0x306de5=_0x3032f0[_0x67d0('0x74')]||config['secrets'][_0x67d0('0xb')];return new BPromise(function(_0x1c2004,_0x3b7849){_0x4283bc(_0x3032f0['payload'],_0x306de5,_0x3032f0['options'])[_0x67d0('0x34')](function(_0xd53657){_0x1c2004(_0xd53657);})[_0x67d0('0x39')](function(_0x446a0f){_0x3b7849(_0x446a0f);});});}function verifyJwt(_0x5cc862,_0x53bffd,_0x3623be){var _0x1681c4=BPromise[_0x67d0('0x75')](jwt['verify'],{'context':jwt});var _0x16c444=_0x3623be||config[_0x67d0('0xa')][_0x67d0('0xb')];return new BPromise(function(_0x59cd28,_0x57cbac){_0x1681c4(_0x5cc862,_0x16c444,_0x53bffd)[_0x67d0('0x34')](function(_0x3638e2){_0x59cd28(_0x3638e2);})['catch'](function(_0x52aa47){_0x57cbac(_0x52aa47);});});}function generateNonce(){return crypto[_0x67d0('0x76')](0x10)[_0x67d0('0x77')](_0x67d0('0x78'));}function generateIssuedAt(){return Math['floor'](Date[_0x67d0('0x79')]()/0x3e8)[_0x67d0('0x77')]();}function createJwt(_0xc60ad2){var _0x22a8a3={'payload':{'iat':_0xc60ad2[_0x67d0('0x61')],'nonce':_0xc60ad2[_0x67d0('0x4b')]},'options':{'algorithm':_0x67d0('0x7a'),'subject':_0xc60ad2['id'][_0x67d0('0x77')](),'issuer':hardwareConf[_0x67d0('0x45')](),'audience':hardwareConf[_0x67d0('0x45')]()}};return signJwt(_0x22a8a3)[_0x67d0('0x34')](function(_0x5eb205){return{'iat':_0xc60ad2[_0x67d0('0x61')],'nonce':_0xc60ad2['apiKeyNonce'],'token':_0x5eb205};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 73e29da..c053298 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 _0x0039=['secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','encryptString','secret','utf8','decryptString','bluebird','lodash','../../config/environment','../../config/logger','app'];(function(_0x42ace9,_0x4526ec){var _0x406432=function(_0x170137){while(--_0x170137){_0x42ace9['push'](_0x42ace9['shift']());}};_0x406432(++_0x4526ec);}(_0x0039,0x19f));var _0x9003=function(_0x482ac6,_0x182c1d){_0x482ac6=_0x482ac6-0x0;var _0x15b85f=_0x0039[_0x482ac6];return _0x15b85f;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x9003('0x0'));var _=require(_0x9003('0x1'));var config=require(_0x9003('0x2'));var logger=require(_0x9003('0x3'))(_0x9003('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x9003('0x5')][_0x9003('0x6')],'algorithm':_0x9003('0x7')};const fileOptions={'algorithm':_0x9003('0x8')};if(config[_0x9003('0x9')]&&config[_0x9003('0x9')][_0x9003('0xa')]){var isSupported=isAlgorithmSupported(config[_0x9003('0x9')][_0x9003('0xa')]);if(isSupported){fileOptions['algorithm']=config[_0x9003('0x9')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x9003('0xb')](',\x20');logger[_0x9003('0xc')](config['encrypt'][_0x9003('0xa')],_0x9003('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x453370){return AES_SUPPORTED_RX[_0x9003('0xe')](_0x453370);}function getSupportedCiphers(){return crypto[_0x9003('0xf')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x37d218){return getSupportedCiphers()[_0x9003('0x10')](_0x37d218)>-0x1;}function combineOptions(_0x1cab5b){var _0x94bb13={};for(var _0x47a699 in fileOptions){if(fileOptions[_0x9003('0x11')](_0x47a699)){_0x94bb13[_0x47a699]=fileOptions[_0x47a699];}}if(_0x1cab5b){for(var _0x1875a3 in _0x1cab5b){if(_0x1cab5b[_0x9003('0x11')](_0x1875a3)){_0x94bb13[_0x1875a3]=_0x1cab5b[_0x1875a3];}}}return _0x94bb13;}exports['encryptFile']=function(_0x4801c8,_0x4c0755,_0x262621,_0x2c5ea8){return new BPromise(function(_0x520953,_0x45faf2){_0x2c5ea8=combineOptions(_0x2c5ea8);var _0x1814da=new Buffer(_0x262621);var _0x31c058=fs[_0x9003('0x12')](_0x4801c8);var _0x59c6bb=fs[_0x9003('0x13')](_0x4c0755);var _0x42210c=crypto[_0x9003('0x14')](_0x2c5ea8[_0x9003('0xa')],_0x1814da);_0x31c058['on'](_0x9003('0x15'),function(_0x51a693){var _0x3f71f7=new Buffer(_0x42210c[_0x9003('0x16')](_0x51a693),_0x9003('0x17'));_0x59c6bb[_0x9003('0x18')](_0x3f71f7);});_0x31c058['on'](_0x9003('0x19'),function(){try{var _0x4a28d3=new Buffer(_0x42210c[_0x9003('0x1a')](_0x9003('0x17')),_0x9003('0x17'));_0x59c6bb[_0x9003('0x18')](_0x4a28d3);_0x59c6bb['end']();_0x59c6bb['on'](_0x9003('0x1b'),function(){return _0x520953(_0x4c0755);});}catch(_0x11e4c3){fs[_0x9003('0x1c')](_0x4c0755);return _0x45faf2(_0x11e4c3);}});});};exports[_0x9003('0x1d')]=function(_0x4520e6,_0x33e573,_0x16f421,_0x28b8a9){return new BPromise(function(_0x43bd04,_0x13dbbd){_0x28b8a9=combineOptions(_0x28b8a9);var _0x211d10=new Buffer(_0x16f421);var _0x1571a4=fs[_0x9003('0x12')](_0x4520e6);var _0x27cbc8=fs[_0x9003('0x13')](_0x33e573);var _0x2342a3=crypto[_0x9003('0x1e')](_0x28b8a9[_0x9003('0xa')],_0x211d10);_0x1571a4['on'](_0x9003('0x15'),function(_0xc07f4a){var _0x50bd5f=new Buffer(_0x2342a3['update'](_0xc07f4a),_0x9003('0x17'));_0x27cbc8['write'](_0x50bd5f);});_0x1571a4['on'](_0x9003('0x19'),function(){try{var _0x594ad4=new Buffer(_0x2342a3['final'](_0x9003('0x17')),_0x9003('0x17'));_0x27cbc8[_0x9003('0x18')](_0x594ad4);_0x27cbc8[_0x9003('0x19')]();_0x27cbc8['on'](_0x9003('0x1b'),function(){return _0x43bd04(_0x33e573);});}catch(_0x4d88a5){fs[_0x9003('0x1c')](_0x33e573);return _0x13dbbd(_0x4d88a5);}});});};exports[_0x9003('0x1f')]=function(_0x342cbd,_0x4ea90e,_0x42fd54){var _0x47b9d7=_0x42fd54||stringOptions['algorithm'];var _0x202892=_0x4ea90e||stringOptions[_0x9003('0x20')];var _0xc75173=crypto['createCipher'](_0x47b9d7,_0x202892);var _0xf4ce9a=_0xc75173[_0x9003('0x16')](_0x342cbd,_0x9003('0x21'),'base64');_0xf4ce9a+=_0xc75173[_0x9003('0x1a')]('base64');return _0xf4ce9a;};exports[_0x9003('0x22')]=function(_0x484432,_0x224b61,_0x3a8fda){var _0x49d074=_0x3a8fda||stringOptions[_0x9003('0xa')];var _0x48440a=_0x224b61||stringOptions[_0x9003('0x20')];var _0x3118dc=crypto[_0x9003('0x1e')](_0x49d074,_0x48440a);var _0x5ee7b9=_0x3118dc[_0x9003('0x16')](_0x484432,'base64',_0x9003('0x21'));_0x5ee7b9+=_0x3118dc[_0x9003('0x1a')]('utf8');return _0x5ee7b9;}; \ No newline at end of file +var _0x1edb=['../../config/logger','secrets','session','aes192','encrypt','algorithm','join','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','binary','end','final','write','close','unlink','createDecipher','update','encryptString','createCipher','utf8','base64','decryptString','secret','crypto','bluebird','../../config/environment'];(function(_0xbd6f77,_0x5e1895){var _0x3f8712=function(_0x2adcd2){while(--_0x2adcd2){_0xbd6f77['push'](_0xbd6f77['shift']());}};_0x3f8712(++_0x5e1895);}(_0x1edb,0x1dd));var _0xb1ed=function(_0x3db7e9,_0x4af7cd){_0x3db7e9=_0x3db7e9-0x0;var _0x3480de=_0x1edb[_0x3db7e9];return _0x3480de;};'use strict';var crypto=require(_0xb1ed('0x0'));var fs=require('fs');var BPromise=require(_0xb1ed('0x1'));var _=require('lodash');var config=require(_0xb1ed('0x2'));var logger=require(_0xb1ed('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xb1ed('0x4')][_0xb1ed('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xb1ed('0x6')};if(config['encrypt']&&config[_0xb1ed('0x7')][_0xb1ed('0x8')]){var isSupported=isAlgorithmSupported(config[_0xb1ed('0x7')]['algorithm']);if(isSupported){fileOptions[_0xb1ed('0x8')]=config['encrypt'][_0xb1ed('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xb1ed('0x9')](',\x20');logger['error'](config['encrypt']['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x2c5c77){return AES_SUPPORTED_RX[_0xb1ed('0xa')](_0x2c5c77);}function getSupportedCiphers(){return crypto[_0xb1ed('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x57af06){return getSupportedCiphers()[_0xb1ed('0xc')](_0x57af06)>-0x1;}function combineOptions(_0x5135d3){var _0x544554={};for(var _0x1d383c in fileOptions){if(fileOptions[_0xb1ed('0xd')](_0x1d383c)){_0x544554[_0x1d383c]=fileOptions[_0x1d383c];}}if(_0x5135d3){for(var _0x15404f in _0x5135d3){if(_0x5135d3['hasOwnProperty'](_0x15404f)){_0x544554[_0x15404f]=_0x5135d3[_0x15404f];}}}return _0x544554;}exports[_0xb1ed('0xe')]=function(_0xbd323e,_0x186e28,_0x130c93,_0x134853){return new BPromise(function(_0x282e4b,_0x21c8a5){_0x134853=combineOptions(_0x134853);var _0x3a2211=new Buffer(_0x130c93);var _0x4a2377=fs[_0xb1ed('0xf')](_0xbd323e);var _0x184377=fs[_0xb1ed('0x10')](_0x186e28);var _0x55c03b=crypto['createCipher'](_0x134853[_0xb1ed('0x8')],_0x3a2211);_0x4a2377['on'](_0xb1ed('0x11'),function(_0x3e193d){var _0x167df6=new Buffer(_0x55c03b['update'](_0x3e193d),_0xb1ed('0x12'));_0x184377['write'](_0x167df6);});_0x4a2377['on'](_0xb1ed('0x13'),function(){try{var _0x2ca490=new Buffer(_0x55c03b[_0xb1ed('0x14')](_0xb1ed('0x12')),_0xb1ed('0x12'));_0x184377[_0xb1ed('0x15')](_0x2ca490);_0x184377['end']();_0x184377['on'](_0xb1ed('0x16'),function(){return _0x282e4b(_0x186e28);});}catch(_0x4bd790){fs[_0xb1ed('0x17')](_0x186e28);return _0x21c8a5(_0x4bd790);}});});};exports['decryptFile']=function(_0x46ba70,_0x58716c,_0xfcaa65,_0x39b909){return new BPromise(function(_0xa1d134,_0x4cc104){_0x39b909=combineOptions(_0x39b909);var _0x1c3485=new Buffer(_0xfcaa65);var _0x5a0efd=fs[_0xb1ed('0xf')](_0x46ba70);var _0x4e5c44=fs[_0xb1ed('0x10')](_0x58716c);var _0x5128e9=crypto[_0xb1ed('0x18')](_0x39b909[_0xb1ed('0x8')],_0x1c3485);_0x5a0efd['on'](_0xb1ed('0x11'),function(_0x16f2ca){var _0x4f00fe=new Buffer(_0x5128e9[_0xb1ed('0x19')](_0x16f2ca),_0xb1ed('0x12'));_0x4e5c44[_0xb1ed('0x15')](_0x4f00fe);});_0x5a0efd['on']('end',function(){try{var _0x16bfe5=new Buffer(_0x5128e9[_0xb1ed('0x14')](_0xb1ed('0x12')),_0xb1ed('0x12'));_0x4e5c44[_0xb1ed('0x15')](_0x16bfe5);_0x4e5c44[_0xb1ed('0x13')]();_0x4e5c44['on'](_0xb1ed('0x16'),function(){return _0xa1d134(_0x58716c);});}catch(_0x102061){fs[_0xb1ed('0x17')](_0x58716c);return _0x4cc104(_0x102061);}});});};exports[_0xb1ed('0x1a')]=function(_0x35068a,_0x517a89,_0x5f5693){var _0xe9adb7=_0x5f5693||stringOptions['algorithm'];var _0x9b368c=_0x517a89||stringOptions['secret'];var _0x16b626=crypto[_0xb1ed('0x1b')](_0xe9adb7,_0x9b368c);var _0x3539c9=_0x16b626[_0xb1ed('0x19')](_0x35068a,_0xb1ed('0x1c'),_0xb1ed('0x1d'));_0x3539c9+=_0x16b626['final']('base64');return _0x3539c9;};exports[_0xb1ed('0x1e')]=function(_0x400c5b,_0x4a5928,_0x348b62){var _0x535cd4=_0x348b62||stringOptions[_0xb1ed('0x8')];var _0x40b7a3=_0x4a5928||stringOptions[_0xb1ed('0x1f')];var _0x110605=crypto[_0xb1ed('0x18')](_0x535cd4,_0x40b7a3);var _0x2e87f1=_0x110605[_0xb1ed('0x19')](_0x400c5b,_0xb1ed('0x1d'),_0xb1ed('0x1c'));_0x2e87f1+=_0x110605[_0xb1ed('0x14')]('utf8');return _0x2e87f1;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 83bf32c..ff8ccac 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 _0x4103=['Setting','find','split','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','.csv','existsSync','each','join','%s%d.%s','csv','%s.%s','zip','zip\x20finished','Completed','catch','inspect','Failed','finally','util','path','to-csv','bluebird','zip-dir','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV'];(function(_0x384eb2,_0x1a9317){var _0x1a2036=function(_0xbbf628){while(--_0xbbf628){_0x384eb2['push'](_0x384eb2['shift']());}};_0x1a2036(++_0x1a9317);}(_0x4103,0x7c));var _0x3410=function(_0x504069,_0x4da72e){_0x504069=_0x504069-0x0;var _0x1b54e2=_0x4103[_0x504069];return _0x1b54e2;};'use strict';var util=require(_0x3410('0x0'));var path=require(_0x3410('0x1'));var _=require('lodash');var csv=require(_0x3410('0x2'));var fs=require('fs');var BPromise=require(_0x3410('0x3'));var zipdir=require(_0x3410('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x3410('0x5')];var logger=require('../../config/logger')(_0x3410('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x3410('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x526253,_0x56961d){var _0x21f97f={'status':_0x526253};var _0x2f651f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x56961d){_0x21f97f[_0x3410('0x8')]=_0x56961d;}return db[_0x3410('0x9')]['update'](_0x21f97f,_0x2f651f);}function main(){var _0x241fd7=0x1388;var _0x4c1891;logger[_0x3410('0xa')](util[_0x3410('0xb')](_0x3410('0xc'),EXTRACTED_REPORT_ID,_0x3410('0xd')));return db[_0x3410('0xe')][_0x3410('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3410('0x10'),_0x3410('0x11')]})['then'](function(_0x293412){if(_0x293412){_0x4c1891=_0x293412;_0x241fd7=_0x4c1891[_0x3410('0x11')]||0x1388;}})['then'](function(){return dbH[_0x3410('0x12')][_0x3410('0x13')](util[_0x3410('0xb')](_0x3410('0x14'),QUERY),{'type':dbH['sequelize'][_0x3410('0x15')][_0x3410('0x16')]});})[_0x3410('0x17')](function(_0x42996c){if(!_0x42996c[0x0]['num']){return analyticExtractedReport(_0x3410('0x18'));}var _0x151acb=[];var _0xa0d002=0x0;if(_0x4c1891[_0x3410('0x10')]){if(_0x42996c&&_0x42996c[_0x3410('0x19')]){var _0x1c2ed8=_[_0x3410('0x1a')](_0x42996c[0x0][_0x3410('0x1b')]/_0x241fd7);var _0xeb70da=Number[_0x3410('0x1c')](_0x42996c[0x0]['num']/_0x241fd7)?_0x42996c[0x0][_0x3410('0x1b')]%_0x241fd7:0x0;_0x1c2ed8[_0x3410('0x1d')](function(_0x243718){if(_0x243718>0x0){_0xa0d002+=_0x241fd7;}_0x151acb[_0x3410('0x1e')](dbH[_0x3410('0x12')][_0x3410('0x13')](util[_0x3410('0xb')](_0x3410('0x1f'),QUERY,_0x241fd7,_0xa0d002),{'type':dbH[_0x3410('0x12')][_0x3410('0x15')]['SELECT']}));});if(_0xeb70da>0x0){_0xa0d002+=_0x241fd7;_0x151acb[_0x3410('0x1e')](dbH['sequelize'][_0x3410('0x13')](util['format'](_0x3410('0x1f'),QUERY,_0xeb70da,_0xa0d002),{'type':dbH['sequelize'][_0x3410('0x15')][_0x3410('0x16')]}));}}}else{_0x151acb['push'](dbH[_0x3410('0x12')][_0x3410('0x13')](QUERY,{'type':dbH['sequelize'][_0x3410('0x15')][_0x3410('0x16')]}));}var _0x35f833=path['dirname'](PATH);var _0x3b9cce=path['basename'](PATH,_0x3410('0x20'));var _0x21bbf7=_0x4c1891[_0x3410('0x10')]&&_0x151acb[_0x3410('0x19')]>0x1;var _0x2e3ccc=[];if(!fs[_0x3410('0x21')](path['join'](_0x35f833,_0x3b9cce))&&_0x21bbf7){fs['mkdirSync'](path['join'](_0x35f833,_0x3b9cce));}return BPromise[_0x3410('0x22')](_0x151acb,function(_0x26d76c){_0x2e3ccc[_0x3410('0x1e')](_0x26d76c);})['then'](function(){for(var _0x40f72a=0x0;_0x40f72a<_0x2e3ccc[_0x3410('0x19')];_0x40f72a+=0x1){var _0x4f682f;var _0x455726=_0x2e3ccc[_0x40f72a];if(_0x21bbf7){_0x4f682f=path[_0x3410('0x23')](_0x35f833,_0x3b9cce,util[_0x3410('0xb')](_0x3410('0x24'),_0x3b9cce,_0x40f72a,_0x3410('0x25')));}else{_0x4f682f=path['join'](_0x35f833,util['format'](_0x3410('0x26'),_0x3b9cce,_0x3410('0x25')));}fs['writeFileSync'](_0x4f682f,csv(_0x455726));}})[_0x3410('0x17')](function(){if(_0x21bbf7){return new Promise(function(_0xb90a25){zipdir(path[_0x3410('0x23')](_0x35f833,_0x3b9cce),{'saveTo':path[_0x3410('0x23')](_0x35f833,util[_0x3410('0xb')](_0x3410('0x26'),_0x3b9cce,_0x3410('0x27')))},function(_0xf738fe,_0x479723){rimraf(path[_0x3410('0x23')](_0x35f833,_0x3b9cce),function(){});_0xb90a25(_0x3410('0x28'));});});}})[_0x3410('0x17')](function(){logger['info'](util[_0x3410('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x3410('0xd')));return analyticExtractedReport(_0x3410('0x29'),_0x21bbf7?util['format']('%s.%s',_0x3b9cce,_0x21bbf7?'zip':_0x3410('0x25')):null);});})[_0x3410('0x2a')](function(_0x324548){logger[_0x3410('0xa')](util[_0x3410('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3410('0xd')),util[_0x3410('0x2b')](_0x324548,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3410('0x2c'));})[_0x3410('0x2d')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xa9a4=['num','Empty','split','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','%s.%s','inspect','Failed','finally','util','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Setting','find','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT'];(function(_0x296187,_0x66707b){var _0x4565d2=function(_0xb3f7cb){while(--_0xb3f7cb){_0x296187['push'](_0x296187['shift']());}};_0x4565d2(++_0x66707b);}(_0xa9a4,0x1d3));var _0x4a9a=function(_0x3da7b7,_0x3db506){_0x3da7b7=_0x3da7b7-0x0;var _0x36fa46=_0xa9a4[_0x3da7b7];return _0x36fa46;};'use strict';var util=require(_0x4a9a('0x0'));var path=require('path');var _=require(_0x4a9a('0x1'));var csv=require(_0x4a9a('0x2'));var fs=require('fs');var BPromise=require(_0x4a9a('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x4a9a('0x4'));var db=require(_0x4a9a('0x5'))['db'];var dbH=require(_0x4a9a('0x5'))[_0x4a9a('0x6')];var logger=require(_0x4a9a('0x7'))(_0x4a9a('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x4a9a('0x9')][0x3];var PATH=process[_0x4a9a('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x37ff77,_0x2f2c58){var _0x9eac7d={'status':_0x37ff77};var _0xdc5b6e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2f2c58){_0x9eac7d[_0x4a9a('0xa')]=_0x2f2c58;}return db[_0x4a9a('0xb')][_0x4a9a('0xc')](_0x9eac7d,_0xdc5b6e);}function main(){var _0x2183e7=0x1388;var _0x58366c;logger[_0x4a9a('0xd')](util[_0x4a9a('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x4a9a('0xf')][_0x4a9a('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x4a9a('0x11')]})[_0x4a9a('0x12')](function(_0x59bb82){if(_0x59bb82){_0x58366c=_0x59bb82;_0x2183e7=_0x58366c[_0x4a9a('0x11')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x4a9a('0x13')](util[_0x4a9a('0xe')](_0x4a9a('0x14'),QUERY),{'type':dbH[_0x4a9a('0x15')]['QueryTypes'][_0x4a9a('0x16')]});})['then'](function(_0x407827){if(!_0x407827[0x0][_0x4a9a('0x17')]){return analyticExtractedReport(_0x4a9a('0x18'));}var _0x22a69b=[];var _0x22387d=0x0;if(_0x58366c[_0x4a9a('0x19')]){if(_0x407827&&_0x407827[_0x4a9a('0x1a')]){var _0x1a647d=_[_0x4a9a('0x1b')](_0x407827[0x0][_0x4a9a('0x17')]/_0x2183e7);var _0x3e70e7=Number[_0x4a9a('0x1c')](_0x407827[0x0][_0x4a9a('0x17')]/_0x2183e7)?_0x407827[0x0][_0x4a9a('0x17')]%_0x2183e7:0x0;_0x1a647d['forEach'](function(_0x457dd0){if(_0x457dd0>0x0){_0x22387d+=_0x2183e7;}_0x22a69b[_0x4a9a('0x1d')](dbH[_0x4a9a('0x15')][_0x4a9a('0x13')](util['format'](_0x4a9a('0x1e'),QUERY,_0x2183e7,_0x22387d),{'type':dbH[_0x4a9a('0x15')][_0x4a9a('0x1f')][_0x4a9a('0x16')]}));});if(_0x3e70e7>0x0){_0x22387d+=_0x2183e7;_0x22a69b[_0x4a9a('0x1d')](dbH[_0x4a9a('0x15')][_0x4a9a('0x13')](util[_0x4a9a('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3e70e7,_0x22387d),{'type':dbH['sequelize'][_0x4a9a('0x1f')]['SELECT']}));}}}else{_0x22a69b['push'](dbH[_0x4a9a('0x15')][_0x4a9a('0x13')](QUERY,{'type':dbH[_0x4a9a('0x15')][_0x4a9a('0x1f')][_0x4a9a('0x16')]}));}var _0x582135=path[_0x4a9a('0x20')](PATH);var _0x2082e8=path['basename'](PATH,_0x4a9a('0x21'));var _0x26d9e1=_0x58366c['split']&&_0x22a69b[_0x4a9a('0x1a')]>0x1;var _0x199447=[];if(!fs[_0x4a9a('0x22')](path[_0x4a9a('0x23')](_0x582135,_0x2082e8))&&_0x26d9e1){fs[_0x4a9a('0x24')](path['join'](_0x582135,_0x2082e8));}return BPromise[_0x4a9a('0x25')](_0x22a69b,function(_0x31ba83){_0x199447[_0x4a9a('0x1d')](_0x31ba83);})[_0x4a9a('0x12')](function(){for(var _0x7a08b7=0x0;_0x7a08b7<_0x199447[_0x4a9a('0x1a')];_0x7a08b7+=0x1){var _0x12486b;var _0x1aeb1d=_0x199447[_0x7a08b7];if(_0x26d9e1){_0x12486b=path[_0x4a9a('0x23')](_0x582135,_0x2082e8,util[_0x4a9a('0xe')](_0x4a9a('0x26'),_0x2082e8,_0x7a08b7,_0x4a9a('0x27')));}else{_0x12486b=path[_0x4a9a('0x23')](_0x582135,util[_0x4a9a('0xe')]('%s.%s',_0x2082e8,_0x4a9a('0x27')));}fs[_0x4a9a('0x28')](_0x12486b,csv(_0x1aeb1d));}})[_0x4a9a('0x12')](function(){if(_0x26d9e1){return new Promise(function(_0x1a1c51){zipdir(path[_0x4a9a('0x23')](_0x582135,_0x2082e8),{'saveTo':path['join'](_0x582135,util[_0x4a9a('0xe')]('%s.%s',_0x2082e8,_0x4a9a('0x29')))},function(_0x2aed25,_0x52a397){rimraf(path['join'](_0x582135,_0x2082e8),function(){});_0x1a1c51('zip\x20finished');});});}})['then'](function(){logger[_0x4a9a('0xd')](util[_0x4a9a('0xe')](_0x4a9a('0x2a'),EXTRACTED_REPORT_ID,_0x4a9a('0x2b')));return analyticExtractedReport(_0x4a9a('0x2c'),_0x26d9e1?util['format'](_0x4a9a('0x2d'),_0x2082e8,_0x26d9e1?_0x4a9a('0x29'):_0x4a9a('0x27')):null);});})['catch'](function(_0x293dd3){logger['info'](util[_0x4a9a('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0x4a9a('0x2e')](_0x293dd3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4a9a('0x2f'));})[_0x4a9a('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 266165d..09030ed 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 _0xab63=['channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','tableHeader','map','pick','value','length','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','margin','landscape','toString','footer','Arial','right','num','Empty','Setting','find','split','then','splitSizePdf','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','.pdf','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xab63,0x1d6));var _0x3ab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab63[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ab6('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x3ab6('0x1'));var moment=require(_0x3ab6('0x2'));var htmlToPdfmake=require(_0x3ab6('0x3'));var PdfPrinter=require(_0x3ab6('0x4'));var zipdir=require(_0x3ab6('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0x3ab6('0x6'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x3ab6('0x7'));var db=require(_0x3ab6('0x8'))['db'];var dbH=require('../../mysqldb')[_0x3ab6('0x9')];var logger=require('../../config/logger')(_0x3ab6('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x3ab6('0xb')][0x2]);var QUERY=process[_0x3ab6('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x3ab6('0xb')][0x5];var FORMAT=_0x3ab6('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xc4adf7,_0x3ae04d){var _0x4a51d2={'status':_0xc4adf7};var _0x18b6ca={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3ae04d){_0x4a51d2['savename']=_0x3ae04d;}return db[_0x3ab6('0xd')][_0x3ab6('0xe')](_0x4a51d2,_0x18b6ca);}function getHeaders(_0x5eae13){return _['map'](_0x5eae13,function(_0x3b45f4){return{'text':_0x3b45f4,'style':_0x3ab6('0xf')};});}function getRows(_0x56f27b,_0x170fc2){return _[_0x3ab6('0x10')](_0x170fc2,function(_0x425d27){return _(_0x425d27)[_0x3ab6('0x11')](_0x56f27b)[_0x3ab6('0x10')](function(_0x3d7225){return _0x3d7225?_['toString'](_0x3d7225):'';})[_0x3ab6('0x12')]();});}function createTable(_0x5d4518,_0x15271e){var _0x263026={'widths':_['fill'](Array(_0x5d4518[_0x3ab6('0x13')]),0x91),'heights':function(_0x1293ca){return _0x1293ca===0x0?_0x3ab6('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4f20ea=getHeaders(_0x5d4518);_0x263026[_0x3ab6('0x15')][_0x3ab6('0x16')](_0x4f20ea);var _0x2b533d=getRows(_0x5d4518,_0x15271e);_0x263026[_0x3ab6('0x15')]=_0x263026[_0x3ab6('0x15')][_0x3ab6('0x17')](_0x2b533d);return _0x263026;}function createTables(_0x24cbb){var _0x5b547a=[];var _0x3c0c1f=_[_0x3ab6('0x18')](Object[_0x3ab6('0x19')](_0x24cbb[0x0]),0x5);_0x3c0c1f[_0x3ab6('0x1a')](function(_0x2f6bed){_0x5b547a['push'](createTable(_0x2f6bed,_0x24cbb));});return _0x5b547a;}function getPDFDocDefinition(_0x5729ea){var _0x3a4c3a=util[_0x3ab6('0x1b')](_0x3ab6('0x1c'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x3ab6('0x1d')])[_0x3ab6('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x3ab6('0x1e')])[_0x3ab6('0x1b')](FORMAT));var _0x1d48e0=[];for(var _0x53c97e=0x0;_0x53c97e<_0x5729ea['length'];_0x53c97e++){var _0x2db73b=[];if(_0x53c97e===0x0){_0x2db73b[_0x3ab6('0x16')]({'text':_0x3a4c3a,'style':_0x3ab6('0x1f')});}var _0x4e3ca1={'table':_0x5729ea[_0x53c97e]};if(_0x53c97e>0x0){_0x4e3ca1[_0x3ab6('0x20')]=_0x3ab6('0x21');_0x4e3ca1[_0x3ab6('0x22')]=[0x0,0x46,0x0,0x0];}_0x2db73b[_0x3ab6('0x16')](_0x4e3ca1);_0x1d48e0[_0x3ab6('0x16')](_0x2db73b);}return{'pageSize':'A4','pageOrientation':_0x3ab6('0x23'),'content':_0x1d48e0,'footer':function(_0x9c12ed,_0x58d797){return{'text':_0x9c12ed[_0x3ab6('0x24')]()+'\x20/\x20'+_0x58d797,'style':_0x3ab6('0x25')};},'defaultStyle':{'font':_0x3ab6('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x3ab6('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x274cf8){var _0x3a8a45=0x1388;var _0x4b7791;if(!_0x274cf8[0x0][_0x3ab6('0x28')]){return analyticExtractedReport(_0x3ab6('0x29'));}return db[_0x3ab6('0x2a')][_0x3ab6('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3ab6('0x2c'),'splitSizePdf']})[_0x3ab6('0x2d')](function(_0x381319){if(_0x381319){_0x4b7791=_0x381319;_0x3a8a45=_0x4b7791[_0x3ab6('0x2e')]||0x3e8;}})[_0x3ab6('0x2d')](function(){var _0x50862c=[];var _0x30ac68=0x0;if(_0x4b7791[_0x3ab6('0x2c')]){if(_0x274cf8&&_0x274cf8[_0x3ab6('0x13')]){var _0x22f6a7=_[_0x3ab6('0x2f')](_0x274cf8[0x0]['num']/_0x3a8a45);var _0x35c2b2=Number[_0x3ab6('0x30')](_0x274cf8[0x0]['num']/_0x3a8a45)?_0x274cf8[0x0][_0x3ab6('0x28')]%_0x3a8a45:0x0;_0x22f6a7['forEach'](function(_0x18acfb){if(_0x18acfb>0x0){_0x30ac68+=_0x3a8a45;}_0x50862c[_0x3ab6('0x16')](dbH[_0x3ab6('0x31')][_0x3ab6('0x32')](util[_0x3ab6('0x1b')](_0x3ab6('0x33'),QUERY,_0x3a8a45,_0x30ac68),{'type':dbH[_0x3ab6('0x31')]['QueryTypes'][_0x3ab6('0x34')]}));});if(_0x35c2b2>0x0){_0x30ac68+=_0x3a8a45;_0x50862c['push'](dbH['sequelize'][_0x3ab6('0x32')](util[_0x3ab6('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x35c2b2,_0x30ac68),{'type':dbH[_0x3ab6('0x31')][_0x3ab6('0x35')][_0x3ab6('0x34')]}));}}}else{_0x50862c[_0x3ab6('0x16')](dbH[_0x3ab6('0x31')]['query'](QUERY,{'type':dbH[_0x3ab6('0x31')][_0x3ab6('0x35')][_0x3ab6('0x34')]}));}var _0x4a1654=path[_0x3ab6('0x36')](PATH);var _0x40d8d9=path[_0x3ab6('0x37')](PATH,_0x3ab6('0x38'));var _0x419f86=_0x4b7791[_0x3ab6('0x2c')]&&_0x50862c[_0x3ab6('0x13')]>0x1;var _0x149020=[];if(!fs['existsSync'](path['join'](_0x4a1654,_0x40d8d9))&&_0x419f86){fs[_0x3ab6('0x39')](path[_0x3ab6('0x3a')](_0x4a1654,_0x40d8d9));}return BPromise[_0x3ab6('0x3b')](_0x50862c,function(_0x43f12c){_0x149020[_0x3ab6('0x16')](_0x43f12c);})[_0x3ab6('0x2d')](function(){var _0x142912=[];for(var _0x552c98=0x0;_0x552c98<_0x149020[_0x3ab6('0x13')];_0x552c98+=0x1){var _0x5d9a37=_0x149020[_0x552c98];var _0x37250c=createTables(_[_0x3ab6('0x3c')](_0x5d9a37));var _0x3d26e6;var _0x424ff2=getPDFDocDefinition(_0x37250c);var _0x3a4459=getPDFPrinter();var _0x4d8cb1=_0x3a4459[_0x3ab6('0x3d')](_0x424ff2);if(_0x419f86){_0x3d26e6=path[_0x3ab6('0x3a')](_0x4a1654,_0x40d8d9,util[_0x3ab6('0x1b')](_0x3ab6('0x3e'),_0x40d8d9,_0x552c98,_0x3ab6('0x3f')));}else{_0x3d26e6=path[_0x3ab6('0x3a')](_0x4a1654,util[_0x3ab6('0x1b')](_0x3ab6('0x40'),_0x40d8d9,_0x3ab6('0x3f')));}_0x142912[_0x3ab6('0x16')](writePDFDocument(_0x4d8cb1,_0x3d26e6));}return Promise[_0x3ab6('0x41')](_0x142912);})[_0x3ab6('0x2d')](function(){if(_0x419f86){return new Promise(function(_0x774536){zipdir(path[_0x3ab6('0x3a')](_0x4a1654,_0x40d8d9),{'saveTo':path[_0x3ab6('0x3a')](_0x4a1654,util[_0x3ab6('0x1b')](_0x3ab6('0x40'),_0x40d8d9,_0x3ab6('0x42')))},function(){rimraf(path[_0x3ab6('0x3a')](_0x4a1654,_0x40d8d9),function(){});_0x774536(_0x3ab6('0x43'));});});}})['then'](function(){if(!_0x419f86)return;rimraf(path[_0x3ab6('0x3a')](_0x4a1654,_0x40d8d9),function(){});})[_0x3ab6('0x2d')](function(){logger[_0x3ab6('0x44')](util[_0x3ab6('0x1b')](_0x3ab6('0x45'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x3ab6('0x46'),_0x419f86?util['format']('%s.%s',_0x40d8d9,_0x419f86?_0x3ab6('0x42'):_0x3ab6('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3ab6('0x44')](util[_0x3ab6('0x1b')](_0x3ab6('0x47'),EXTRACTED_REPORT_ID,_0x3ab6('0x48')));return db[_0x3ab6('0xd')][_0x3ab6('0x49')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x52a4c4){EXTRACTED_REPORT=_0x52a4c4;return dbH['sequelize']['query'](util[_0x3ab6('0x1b')](_0x3ab6('0x4a'),QUERY),{'type':dbH[_0x3ab6('0x31')][_0x3ab6('0x35')]['SELECT']});})[_0x3ab6('0x2d')](extractReport)[_0x3ab6('0x4b')](function(_0x52c945){logger[_0x3ab6('0x44')](util[_0x3ab6('0x1b')](_0x3ab6('0x4c'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x52c945,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3ab6('0x4d'));})['finally'](function(){process[_0x3ab6('0x4e')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x55b78d=new PdfPrinter({'Arial':{'normal':__dirname+_0x3ab6('0x4f'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x3ab6('0x50'),'bolditalics':__dirname+_0x3ab6('0x51')}});return _0x55b78d;}function getPDFDocDefinitionFromHTML(_0x1ab218,_0x50dad5){var _0x3bd0e8=util[_0x3ab6('0x1b')]('%s\x20#%d',_0x50dad5[_0x3ab6('0x52')],_0x50dad5['interactionId']);var _0x2e8881=moment()[_0x3ab6('0x1b')](_0x3ab6('0x53'))[_0x3ab6('0x24')]();var _0x57ef5c=htmlToPdfmake(_0x1ab218,{'window':window,'tableAutoSize':!![]});return{'content':[_0x57ef5c],'defaultStyle':{'font':_0x3ab6('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x3ab6('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3ab6('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x3ab6('0x54')}},'header':function(){return[{'text':_0x3ab6('0x55'),'style':'header'}];},'footer':function(_0x2f18a1,_0x42393c){return[{'text':util[_0x3ab6('0x1b')](_0x3ab6('0x56'),_0x3bd0e8,_0x2f18a1,_0x42393c,_0x2e8881),'style':_0x3ab6('0x25')}];}};}function writePDFDocument(_0x5575d4,_0x2f4445){return new Promise(function(_0x4fbb4d,_0x3737c9){var _0x28aa8d=_0x5575d4[_0x3ab6('0x57')](fs[_0x3ab6('0x58')](_0x2f4445));_0x28aa8d['on']('finish',function(){_0x4fbb4d(_0x3ab6('0x59'));});_0x28aa8d['on'](_0x3ab6('0x5a'),function(_0x42187f){_0x3737c9(_0x42187f);});_0x5575d4[_0x3ab6('0x5b')]();});}exports['createPdfFromHTML']=function(_0xb1a7fb,_0x46fa8d){var _0x2e36b8=getPDFPrinter();var _0x1124d9=getPDFDocDefinitionFromHTML(_0xb1a7fb,_0x46fa8d);var _0x1bbdaf=_0x2e36b8[_0x3ab6('0x3d')](_0x1124d9);return writePDFDocument(_0x1bbdaf,_0x46fa8d[_0x3ab6('0x1')])[_0x3ab6('0x4b')](function(_0x409286){throw _0x409286;});}; \ No newline at end of file +var _0x8199=['all','zip','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','path','lodash','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','pick','toString','value','fill','auto','body','concat','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','length','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','sequelize','QueryTypes','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s.%s','pdf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8199,0xd6));var _0x9819=function(_0x22bd91,_0x56a648){_0x22bd91=_0x22bd91-0x0;var _0x488b43=_0x8199[_0x22bd91];return _0x488b43;};'use strict';var _=require(_0x9819('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0x9819('0x1'));var htmlToPdfmake=require(_0x9819('0x2'));var PdfPrinter=require(_0x9819('0x3'));var zipdir=require(_0x9819('0x4'));var rimraf=require(_0x9819('0x5'));var JSDOM=require(_0x9819('0x6'))[_0x9819('0x7')];var window=new JSDOM('')[_0x9819('0x8')];var BPromise=require(_0x9819('0x9'));var db=require(_0x9819('0xa'))['db'];var dbH=require('../../mysqldb')[_0x9819('0xb')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x9819('0xc')][0x2]);var QUERY=process[_0x9819('0xc')][0x3];var PATH=process[_0x9819('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x9819('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x45121f,_0x2eb1da){var _0x578831={'status':_0x45121f};var _0x1b5015={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2eb1da){_0x578831[_0x9819('0xe')]=_0x2eb1da;}return db['AnalyticExtractedReport'][_0x9819('0xf')](_0x578831,_0x1b5015);}function getHeaders(_0x317a2c){return _[_0x9819('0x10')](_0x317a2c,function(_0x1b3e59){return{'text':_0x1b3e59,'style':'tableHeader'};});}function getRows(_0x2e9374,_0x341e5a){return _[_0x9819('0x10')](_0x341e5a,function(_0x4c41d1){return _(_0x4c41d1)[_0x9819('0x11')](_0x2e9374)[_0x9819('0x10')](function(_0x579775){return _0x579775?_[_0x9819('0x12')](_0x579775):'';})[_0x9819('0x13')]();});}function createTable(_0x5d7e21,_0x497279){var _0x53069d={'widths':_[_0x9819('0x14')](Array(_0x5d7e21['length']),0x91),'heights':function(_0x363924){return _0x363924===0x0?_0x9819('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x402038=getHeaders(_0x5d7e21);_0x53069d['body']['push'](_0x402038);var _0x492f1e=getRows(_0x5d7e21,_0x497279);_0x53069d[_0x9819('0x16')]=_0x53069d['body'][_0x9819('0x17')](_0x492f1e);return _0x53069d;}function createTables(_0x26b06c){var _0x3a05d7=[];var _0x1ac231=_['chunk'](Object['keys'](_0x26b06c[0x0]),0x5);_0x1ac231[_0x9819('0x18')](function(_0xbda788){_0x3a05d7[_0x9819('0x19')](createTable(_0xbda788,_0x26b06c));});return _0x3a05d7;}function getPDFDocDefinition(_0x487236){var _0x3315ce=util[_0x9819('0x1a')](_0x9819('0x1b'),NAME,EXTRACTED_REPORT[_0x9819('0x1c')],moment(EXTRACTED_REPORT['startDate'])[_0x9819('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x9819('0x1d')])['format'](FORMAT));var _0x4c305c=[];for(var _0x9bd9d8=0x0;_0x9bd9d8<_0x487236[_0x9819('0x1e')];_0x9bd9d8++){var _0x5d13d6=[];if(_0x9bd9d8===0x0){_0x5d13d6[_0x9819('0x19')]({'text':_0x3315ce,'style':'header'});}var _0x174c73={'table':_0x487236[_0x9bd9d8]};if(_0x9bd9d8>0x0){_0x174c73[_0x9819('0x1f')]=_0x9819('0x20');_0x174c73[_0x9819('0x21')]=[0x0,0x46,0x0,0x0];}_0x5d13d6[_0x9819('0x19')](_0x174c73);_0x4c305c[_0x9819('0x19')](_0x5d13d6);}return{'pageSize':'A4','pageOrientation':_0x9819('0x22'),'content':_0x4c305c,'footer':function(_0x66b6b1,_0x5486b7){return{'text':_0x66b6b1[_0x9819('0x12')]()+_0x9819('0x23')+_0x5486b7,'style':_0x9819('0x24')};},'defaultStyle':{'font':_0x9819('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9819('0x26')},'footer':{'alignment':_0x9819('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x399cfe){var _0x4d6ee1=0x1388;var _0x35d7a7;if(!_0x399cfe[0x0][_0x9819('0x28')]){return analyticExtractedReport(_0x9819('0x29'));}return db[_0x9819('0x2a')][_0x9819('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9819('0x2c'),_0x9819('0x2d')]})[_0x9819('0x2e')](function(_0x3cf420){if(_0x3cf420){_0x35d7a7=_0x3cf420;_0x4d6ee1=_0x35d7a7[_0x9819('0x2d')]||0x3e8;}})[_0x9819('0x2e')](function(){var _0x34f4ad=[];var _0x257e37=0x0;if(_0x35d7a7['split']){if(_0x399cfe&&_0x399cfe[_0x9819('0x1e')]){var _0x7f3f46=_[_0x9819('0x2f')](_0x399cfe[0x0]['num']/_0x4d6ee1);var _0x41a759=Number[_0x9819('0x30')](_0x399cfe[0x0][_0x9819('0x28')]/_0x4d6ee1)?_0x399cfe[0x0]['num']%_0x4d6ee1:0x0;_0x7f3f46[_0x9819('0x18')](function(_0x226b81){if(_0x226b81>0x0){_0x257e37+=_0x4d6ee1;}_0x34f4ad[_0x9819('0x19')](dbH['sequelize'][_0x9819('0x31')](util[_0x9819('0x1a')](_0x9819('0x32'),QUERY,_0x4d6ee1,_0x257e37),{'type':dbH['sequelize']['QueryTypes'][_0x9819('0x33')]}));});if(_0x41a759>0x0){_0x257e37+=_0x4d6ee1;_0x34f4ad[_0x9819('0x19')](dbH[_0x9819('0x34')][_0x9819('0x31')](util[_0x9819('0x1a')](_0x9819('0x32'),QUERY,_0x41a759,_0x257e37),{'type':dbH['sequelize'][_0x9819('0x35')][_0x9819('0x33')]}));}}}else{_0x34f4ad[_0x9819('0x19')](dbH[_0x9819('0x34')]['query'](QUERY,{'type':dbH[_0x9819('0x34')][_0x9819('0x35')]['SELECT']}));}var _0x43acf5=path[_0x9819('0x36')](PATH);var _0x42b398=path[_0x9819('0x37')](PATH,_0x9819('0x38'));var _0x278f79=_0x35d7a7['split']&&_0x34f4ad[_0x9819('0x1e')]>0x1;var _0x43b454=[];if(!fs[_0x9819('0x39')](path[_0x9819('0x3a')](_0x43acf5,_0x42b398))&&_0x278f79){fs[_0x9819('0x3b')](path[_0x9819('0x3a')](_0x43acf5,_0x42b398));}return BPromise[_0x9819('0x3c')](_0x34f4ad,function(_0x2d33b7){_0x43b454[_0x9819('0x19')](_0x2d33b7);})[_0x9819('0x2e')](function(){var _0x447d1c=[];for(var _0x4c2cdc=0x0;_0x4c2cdc<_0x43b454[_0x9819('0x1e')];_0x4c2cdc+=0x1){var _0x956892=_0x43b454[_0x4c2cdc];var _0x289411=createTables(_[_0x9819('0x3d')](_0x956892));var _0x3eb341;var _0x580aaf=getPDFDocDefinition(_0x289411);var _0x114003=getPDFPrinter();var _0x28483c=_0x114003[_0x9819('0x3e')](_0x580aaf);if(_0x278f79){_0x3eb341=path[_0x9819('0x3a')](_0x43acf5,_0x42b398,util[_0x9819('0x1a')]('%s%d.%s',_0x42b398,_0x4c2cdc,'pdf'));}else{_0x3eb341=path[_0x9819('0x3a')](_0x43acf5,util[_0x9819('0x1a')](_0x9819('0x3f'),_0x42b398,_0x9819('0x40')));}_0x447d1c[_0x9819('0x19')](writePDFDocument(_0x28483c,_0x3eb341));}return Promise[_0x9819('0x41')](_0x447d1c);})['then'](function(){if(_0x278f79){return new Promise(function(_0x560fd8){zipdir(path[_0x9819('0x3a')](_0x43acf5,_0x42b398),{'saveTo':path['join'](_0x43acf5,util[_0x9819('0x1a')](_0x9819('0x3f'),_0x42b398,_0x9819('0x42')))},function(){rimraf(path[_0x9819('0x3a')](_0x43acf5,_0x42b398),function(){});_0x560fd8('zip\x20finished');});});}})[_0x9819('0x2e')](function(){if(!_0x278f79)return;rimraf(path[_0x9819('0x3a')](_0x43acf5,_0x42b398),function(){});})[_0x9819('0x2e')](function(){logger[_0x9819('0x43')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x9819('0x44')));return analyticExtractedReport(_0x9819('0x45'),_0x278f79?util[_0x9819('0x1a')](_0x9819('0x3f'),_0x42b398,_0x278f79?'zip':_0x9819('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x9819('0x43')](util[_0x9819('0x1a')](_0x9819('0x46'),EXTRACTED_REPORT_ID,_0x9819('0x44')));return db[_0x9819('0x47')][_0x9819('0x48')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9819('0x2e')](function(_0x216154){EXTRACTED_REPORT=_0x216154;return dbH[_0x9819('0x34')][_0x9819('0x31')](util[_0x9819('0x1a')](_0x9819('0x49'),QUERY),{'type':dbH[_0x9819('0x34')][_0x9819('0x35')][_0x9819('0x33')]});})['then'](extractReport)[_0x9819('0x4a')](function(_0x493c1d){logger[_0x9819('0x43')](util[_0x9819('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util[_0x9819('0x4b')](_0x493c1d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9819('0x4c'));})[_0x9819('0x4d')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x30fc63=new PdfPrinter({'Arial':{'normal':__dirname+_0x9819('0x4e'),'bold':__dirname+_0x9819('0x4f'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x9819('0x50')}});return _0x30fc63;}function getPDFDocDefinitionFromHTML(_0x25c048,_0x3ae139){var _0x4ef9f3=util[_0x9819('0x1a')](_0x9819('0x51'),_0x3ae139[_0x9819('0x52')],_0x3ae139['interactionId']);var _0x429427=moment()[_0x9819('0x1a')](_0x9819('0x53'))[_0x9819('0x12')]();var _0x3ba488=htmlToPdfmake(_0x25c048,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3ba488],'defaultStyle':{'font':_0x9819('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x9819('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9819('0x54')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x9819('0x55')}];},'footer':function(_0x204094,_0x41af75){return[{'text':util[_0x9819('0x1a')](_0x9819('0x56'),_0x4ef9f3,_0x204094,_0x41af75,_0x429427),'style':_0x9819('0x24')}];}};}function writePDFDocument(_0xe54ea4,_0xef83ea){return new Promise(function(_0x48b3a7,_0xa7a80e){var _0x4742c1=_0xe54ea4[_0x9819('0x57')](fs[_0x9819('0x58')](_0xef83ea));_0x4742c1['on'](_0x9819('0x59'),function(){_0x48b3a7(_0x9819('0x59'));});_0x4742c1['on'](_0x9819('0x5a'),function(_0x46a0a9){_0xa7a80e(_0x46a0a9);});_0xe54ea4[_0x9819('0x5b')]();});}exports['createPdfFromHTML']=function(_0x1505d7,_0x203c36){var _0x133d78=getPDFPrinter();var _0x17fc29=getPDFDocDefinitionFromHTML(_0x1505d7,_0x203c36);var _0x4b6590=_0x133d78['createPdfKitDocument'](_0x17fc29);return writePDFDocument(_0x4b6590,_0x203c36[_0x9819('0x5c')])[_0x9819('0x4a')](function(_0x15dab1){throw _0x15dab1;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 3131cb8..3a987a6 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 _0xcc1b=['rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','XLSX','find','split','splitSizeXlsx','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','lodash','json2xls','zip-dir'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xcc1b,0x100));var _0xbcc1=function(_0x11470d,_0x51c1b1){_0x11470d=_0x11470d-0x0;var _0x5c1184=_0xcc1b[_0x11470d];return _0x5c1184;};'use strict';var util=require(_0xbcc1('0x0'));var path=require('path');var _=require(_0xbcc1('0x1'));var fs=require('fs');var json2xls=require(_0xbcc1('0x2'));var BPromise=require('bluebird');var zipdir=require(_0xbcc1('0x3'));var rimraf=require(_0xbcc1('0x4'));var db=require(_0xbcc1('0x5'))['db'];var dbH=require(_0xbcc1('0x5'))[_0xbcc1('0x6')];var logger=require(_0xbcc1('0x7'))(_0xbcc1('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xbcc1('0x9')][0x2]);var QUERY=process[_0xbcc1('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x39bea1,_0x5ae0e1){var _0x2581d3={'status':_0x39bea1};var _0x50a057={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5ae0e1){_0x2581d3[_0xbcc1('0xa')]=_0x5ae0e1;}return db[_0xbcc1('0xb')][_0xbcc1('0xc')](_0x2581d3,_0x50a057);}function main(){var _0x5246a6=0x1388;var _0x140097;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbcc1('0xd')));return db['Setting'][_0xbcc1('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbcc1('0xf'),_0xbcc1('0x10')]})[_0xbcc1('0x11')](function(_0x44d7b4){if(_0x44d7b4){_0x140097=_0x44d7b4;_0x5246a6=_0x140097['splitSizeXlsx']||0x1388;}})[_0xbcc1('0x11')](function(){return dbH['sequelize'][_0xbcc1('0x12')](util[_0xbcc1('0x13')](_0xbcc1('0x14'),QUERY),{'type':dbH[_0xbcc1('0x15')][_0xbcc1('0x16')][_0xbcc1('0x17')]});})[_0xbcc1('0x11')](function(_0x4be22d){if(!_0x4be22d[0x0][_0xbcc1('0x18')]){return analyticExtractedReport(_0xbcc1('0x19'));}var _0x124c8f=[];var _0x163181=0x0;if(_0x140097[_0xbcc1('0xf')]){if(_0x4be22d&&_0x4be22d[_0xbcc1('0x1a')]){var _0x391f46=_['range'](_0x4be22d[0x0][_0xbcc1('0x18')]/_0x5246a6);var _0x523530=Number[_0xbcc1('0x1b')](_0x4be22d[0x0][_0xbcc1('0x18')]/_0x5246a6)?_0x4be22d[0x0][_0xbcc1('0x18')]%_0x5246a6:0x0;_0x391f46[_0xbcc1('0x1c')](function(_0x3ff99f){if(_0x3ff99f>0x0){_0x163181+=_0x5246a6;}_0x124c8f[_0xbcc1('0x1d')](dbH[_0xbcc1('0x15')][_0xbcc1('0x12')](util[_0xbcc1('0x13')](_0xbcc1('0x1e'),QUERY,_0x5246a6,_0x163181),{'type':dbH[_0xbcc1('0x15')][_0xbcc1('0x16')][_0xbcc1('0x17')]}));});if(_0x523530>0x0){_0x163181+=_0x5246a6;_0x124c8f[_0xbcc1('0x1d')](dbH['sequelize']['query'](util[_0xbcc1('0x13')](_0xbcc1('0x1e'),QUERY,_0x523530,_0x163181),{'type':dbH[_0xbcc1('0x15')][_0xbcc1('0x16')][_0xbcc1('0x17')]}));}}}else{_0x124c8f[_0xbcc1('0x1d')](dbH['sequelize'][_0xbcc1('0x12')](QUERY,{'type':dbH[_0xbcc1('0x15')][_0xbcc1('0x16')][_0xbcc1('0x17')]}));}var _0x3c5cea=path[_0xbcc1('0x1f')](PATH);var _0x3522fb=path[_0xbcc1('0x20')](PATH,_0xbcc1('0x21'));var _0x1a1ff6=_0x140097[_0xbcc1('0xf')]&&_0x124c8f[_0xbcc1('0x1a')]>0x1;var _0x577ff8=[];if(!fs[_0xbcc1('0x22')](path['join'](_0x3c5cea,_0x3522fb))&&_0x1a1ff6){fs[_0xbcc1('0x23')](path[_0xbcc1('0x24')](_0x3c5cea,_0x3522fb));}return BPromise[_0xbcc1('0x25')](_0x124c8f,function(_0x37e673){_0x577ff8[_0xbcc1('0x1d')](_0x37e673);})[_0xbcc1('0x11')](function(){for(var _0x1bca3f=0x0;_0x1bca3f<_0x577ff8['length'];_0x1bca3f+=0x1){var _0x5d8c0e;var _0x2b3f06=_0x577ff8[_0x1bca3f];if(_0x1a1ff6){_0x5d8c0e=path[_0xbcc1('0x24')](_0x3c5cea,_0x3522fb,util[_0xbcc1('0x13')](_0xbcc1('0x26'),_0x3522fb,_0x1bca3f,_0xbcc1('0x27')));}else{_0x5d8c0e=path[_0xbcc1('0x24')](_0x3c5cea,util[_0xbcc1('0x13')](_0xbcc1('0x28'),_0x3522fb,_0xbcc1('0x27')));}fs[_0xbcc1('0x29')](_0x5d8c0e,json2xls(_0x2b3f06),_0xbcc1('0x2a'));}})[_0xbcc1('0x11')](function(){if(_0x1a1ff6){return new Promise(function(_0x2f417f){zipdir(path[_0xbcc1('0x24')](_0x3c5cea,_0x3522fb),{'saveTo':path['join'](_0x3c5cea,util[_0xbcc1('0x13')](_0xbcc1('0x28'),_0x3522fb,_0xbcc1('0x2b')))},function(_0x15312b,_0x59289b){rimraf(path[_0xbcc1('0x24')](_0x3c5cea,_0x3522fb),function(){});_0x2f417f(_0xbcc1('0x2c'));});});}})[_0xbcc1('0x11')](function(){logger[_0xbcc1('0x2d')](util[_0xbcc1('0x13')](_0xbcc1('0x2e'),EXTRACTED_REPORT_ID,_0xbcc1('0xd')));return analyticExtractedReport(_0xbcc1('0x2f'),_0x1a1ff6?util[_0xbcc1('0x13')](_0xbcc1('0x28'),_0x3522fb,_0x1a1ff6?'zip':_0xbcc1('0x27')):null);});})['catch'](function(_0x546bcf){logger[_0xbcc1('0x2d')](util['format'](_0xbcc1('0x30'),EXTRACTED_REPORT_ID,_0xbcc1('0xd')),util['inspect'](_0x546bcf,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbcc1('0x31'));})[_0xbcc1('0x32')](function(){process[_0xbcc1('0x33')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x6054=['mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','join','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','inspect','Failed','exit','util','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','XLSX','Setting','split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','length'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x6054,0x127));var _0x4605=function(_0xb3eb73,_0x49d849){_0xb3eb73=_0xb3eb73-0x0;var _0xca1a5a=_0x6054[_0xb3eb73];return _0xca1a5a;};'use strict';var util=require(_0x4605('0x0'));var path=require('path');var _=require(_0x4605('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x4605('0x2'));var zipdir=require(_0x4605('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x4605('0x4'))[_0x4605('0x5')];var logger=require(_0x4605('0x6'))(_0x4605('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x4605('0x8')][0x3];var PATH=process[_0x4605('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2288d3,_0x2c8cc2){var _0x2358ca={'status':_0x2288d3};var _0x5bd43a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c8cc2){_0x2358ca[_0x4605('0x9')]=_0x2c8cc2;}return db[_0x4605('0xa')][_0x4605('0xb')](_0x2358ca,_0x5bd43a);}function main(){var _0x5b9737=0x1388;var _0x351874;logger[_0x4605('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x4605('0xd')));return db[_0x4605('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4605('0xf'),_0x4605('0x10')]})[_0x4605('0x11')](function(_0x415fa3){if(_0x415fa3){_0x351874=_0x415fa3;_0x5b9737=_0x351874[_0x4605('0x10')]||0x1388;}})[_0x4605('0x11')](function(){return dbH[_0x4605('0x12')][_0x4605('0x13')](util[_0x4605('0x14')](_0x4605('0x15'),QUERY),{'type':dbH[_0x4605('0x12')][_0x4605('0x16')][_0x4605('0x17')]});})[_0x4605('0x11')](function(_0xbd4dbc){if(!_0xbd4dbc[0x0][_0x4605('0x18')]){return analyticExtractedReport(_0x4605('0x19'));}var _0x60d885=[];var _0x4b4dd2=0x0;if(_0x351874[_0x4605('0xf')]){if(_0xbd4dbc&&_0xbd4dbc['length']){var _0x388299=_[_0x4605('0x1a')](_0xbd4dbc[0x0][_0x4605('0x18')]/_0x5b9737);var _0x4e3319=Number[_0x4605('0x1b')](_0xbd4dbc[0x0][_0x4605('0x18')]/_0x5b9737)?_0xbd4dbc[0x0][_0x4605('0x18')]%_0x5b9737:0x0;_0x388299['forEach'](function(_0x5ad72e){if(_0x5ad72e>0x0){_0x4b4dd2+=_0x5b9737;}_0x60d885[_0x4605('0x1c')](dbH[_0x4605('0x12')]['query'](util['format'](_0x4605('0x1d'),QUERY,_0x5b9737,_0x4b4dd2),{'type':dbH['sequelize'][_0x4605('0x16')][_0x4605('0x17')]}));});if(_0x4e3319>0x0){_0x4b4dd2+=_0x5b9737;_0x60d885[_0x4605('0x1c')](dbH[_0x4605('0x12')][_0x4605('0x13')](util[_0x4605('0x14')](_0x4605('0x1d'),QUERY,_0x4e3319,_0x4b4dd2),{'type':dbH[_0x4605('0x12')][_0x4605('0x16')][_0x4605('0x17')]}));}}}else{_0x60d885['push'](dbH[_0x4605('0x12')]['query'](QUERY,{'type':dbH[_0x4605('0x12')][_0x4605('0x16')][_0x4605('0x17')]}));}var _0x236015=path[_0x4605('0x1e')](PATH);var _0x4ff2c0=path[_0x4605('0x1f')](PATH,_0x4605('0x20'));var _0x3ad318=_0x351874['split']&&_0x60d885[_0x4605('0x21')]>0x1;var _0x83a71f=[];if(!fs['existsSync'](path['join'](_0x236015,_0x4ff2c0))&&_0x3ad318){fs[_0x4605('0x22')](path['join'](_0x236015,_0x4ff2c0));}return BPromise[_0x4605('0x23')](_0x60d885,function(_0x108ccb){_0x83a71f[_0x4605('0x1c')](_0x108ccb);})[_0x4605('0x11')](function(){for(var _0x2b7814=0x0;_0x2b7814<_0x83a71f[_0x4605('0x21')];_0x2b7814+=0x1){var _0x4250f0;var _0x488418=_0x83a71f[_0x2b7814];if(_0x3ad318){_0x4250f0=path['join'](_0x236015,_0x4ff2c0,util['format'](_0x4605('0x24'),_0x4ff2c0,_0x2b7814,_0x4605('0x25')));}else{_0x4250f0=path['join'](_0x236015,util[_0x4605('0x14')](_0x4605('0x26'),_0x4ff2c0,'xlsx'));}fs[_0x4605('0x27')](_0x4250f0,json2xls(_0x488418),'binary');}})[_0x4605('0x11')](function(){if(_0x3ad318){return new Promise(function(_0x3f5890){zipdir(path[_0x4605('0x28')](_0x236015,_0x4ff2c0),{'saveTo':path[_0x4605('0x28')](_0x236015,util[_0x4605('0x14')](_0x4605('0x26'),_0x4ff2c0,'zip'))},function(_0x6ba056,_0x18e11f){rimraf(path[_0x4605('0x28')](_0x236015,_0x4ff2c0),function(){});_0x3f5890(_0x4605('0x29'));});});}})[_0x4605('0x11')](function(){logger[_0x4605('0xc')](util[_0x4605('0x14')](_0x4605('0x2a'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x4605('0x2b'),_0x3ad318?util[_0x4605('0x14')](_0x4605('0x26'),_0x4ff2c0,_0x3ad318?'zip':_0x4605('0x25')):null);});})['catch'](function(_0x2907f4){logger[_0x4605('0xc')](util[_0x4605('0x14')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x4605('0xd')),util[_0x4605('0x2c')](_0x2907f4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4605('0x2d'));})['finally'](function(){process[_0x4605('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index b1dd804..6d4b8a6 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 _0xac75=['hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','ExecIf','$[${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','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','destroy','then','bulkCreate','sortBy','catch','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','priority','extensions','extension','find','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','inbound','outbound','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid='];(function(_0x4cfbf4,_0x90c6c9){var _0x23d5b1=function(_0x501883){while(--_0x501883){_0x4cfbf4['push'](_0x4cfbf4['shift']());}};_0x23d5b1(++_0x90c6c9);}(_0xac75,0xf2));var _0x5ac7=function(_0x4dd5c8,_0x53cb32){_0x4dd5c8=_0x4dd5c8-0x0;var _0x35d2c4=_0xac75[_0x4dd5c8];return _0x35d2c4;};'use strict';var _=require(_0x5ac7('0x0'));var util=require(_0x5ac7('0x1'));function rewrite(_0x570257,_0x2115c2){var _0xc239af=this;return _0x570257[_0x5ac7('0x2')][_0x5ac7('0x3')][_0x5ac7('0x4')]({'raw':!![]})['then'](function(_0x597d16){_0xc239af[_0x5ac7('0x5')]=_0x597d16;return _0x570257[_0x5ac7('0x2')][_0x5ac7('0x6')][_0x5ac7('0x4')]({'where':{'IntervalId':_0x2115c2[_0x5ac7('0x7')]},'raw':!![]});})['then'](function(_0x535726){return _0x570257[_0x5ac7('0x2')][_0x5ac7('0x6')][_0x5ac7('0x4')]({'where':{'exten':{'$in':_[_0x5ac7('0x8')](_[_0x5ac7('0x9')](_0x535726,_0x5ac7('0xa')))}},'order':[{'raw':_0x5ac7('0xb')}],'raw':!![]});})['then'](function(_0x24f2a0){var _0x372ced=_[_0x5ac7('0xc')](_0x24f2a0,{'priority':'1'});var _0x16b77a=_[_0x5ac7('0xc')](_0x24f2a0,{'isApp':0x1});var _0x53aa9a=_[_0x5ac7('0xd')](_0x16b77a,'exten');var _0x47b985=[_0x5ac7('0xe'),'playback'];var _0x2ff172=[];var _0x518e3a=[];for(var _0x449944 in _0x53aa9a){if(_0x53aa9a['hasOwnProperty'](_0x449944)){_0xc239af[_0x5ac7('0xf')]=0x2;_0xc239af[_0x5ac7('0x10')]=[];_0xc239af[_0x5ac7('0x11')]=_[_0x5ac7('0x12')](_0x372ced,{'exten':_0x53aa9a[_0x449944][0x0][_0x5ac7('0xa')]});_0xc239af[_0x5ac7('0x10')][_0x5ac7('0x13')]({'type':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')],'app':_0x5ac7('0x15'),'appdata':util['format'](_0x5ac7('0x16'),_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')]),'context':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x17')],'exten':_0x53aa9a[_0x449944][0x0][_0x5ac7('0xa')],'priority':_0xc239af[_0x5ac7('0xf')]++,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')]});if(_0x53aa9a[_0x449944][0x0]['type']===_0x5ac7('0x19')){_0xc239af[_0x5ac7('0x10')][_0x5ac7('0x13')]({'type':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')],'app':_0x5ac7('0x15'),'appdata':'CDR(routeid)='+_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')],'context':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x17')],'exten':_0x53aa9a[_0x449944][0x0][_0x5ac7('0xa')],'priority':_0xc239af[_0x5ac7('0xf')]++,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0]['VoiceExtensionId']});}else if(_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')]===_0x5ac7('0x1a')){if(_0xc239af[_0x5ac7('0x11')]){_0xc239af[_0x5ac7('0x10')][_0x5ac7('0x13')]({'type':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')],'app':_0x5ac7('0x15'),'appdata':_0x5ac7('0x1b')+(_0xc239af[_0x5ac7('0x11')][_0x5ac7('0x1c')]?_0x5ac7('0x1d')+_0xc239af[_0x5ac7('0x11')]['cutdigits']+'}':'${EXTEN}'),'context':_0x53aa9a[_0x449944][0x0]['context'],'exten':_0x53aa9a[_0x449944][0x0][_0x5ac7('0xa')],'priority':_0xc239af[_0x5ac7('0xf')]++,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')]});}_0xc239af[_0x5ac7('0x10')][_0x5ac7('0x13')]({'type':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')],'app':_0x5ac7('0x15'),'appdata':_0x5ac7('0x1e')+_0x53aa9a[_0x449944][0x0]['VoiceExtensionId'],'context':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x17')],'exten':_0x53aa9a[_0x449944][0x0][_0x5ac7('0xa')],'priority':_0xc239af['priority']++,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0]['VoiceExtensionId']});var _0x25c064=_0xc239af['priority']++;_0xc239af['extensions']['push']({'type':_0x53aa9a[_0x449944][0x0]['type'],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x25c064+0x2)+_0x5ac7('0x1f')+(_0x25c064+0x1)+')','context':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x17')],'exten':_0x53aa9a[_0x449944][0x0]['exten'],'priority':_0x25c064,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')]});if(_0xc239af['extension']){_0xc239af[_0x5ac7('0x10')][_0x5ac7('0x13')]({'type':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')],'app':'Set','appdata':_0xc239af[_0x5ac7('0x11')][_0x5ac7('0x1c')]?_0x5ac7('0x20')+_0xc239af['extension'][_0x5ac7('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x17')],'exten':_0x53aa9a[_0x449944][0x0]['exten'],'priority':_0xc239af[_0x5ac7('0xf')]++,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0]['VoiceExtensionId']});}_0xc239af[_0x5ac7('0x10')][_0x5ac7('0x13')]({'type':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')],'app':_0x5ac7('0x15'),'appdata':_0x5ac7('0x21')+_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')],'context':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x17')],'exten':_0x53aa9a[_0x449944][0x0]['exten'],'priority':_0xc239af[_0x5ac7('0xf')]++,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')]});if(_0xc239af['extension']&&_0xc239af[_0x5ac7('0x11')][_0x5ac7('0x22')](_0x5ac7('0x23'))&&_0xc239af['extension']['recordingFormat']!=='none'){_0xc239af['extensions'][_0x5ac7('0x13')]({'type':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')],'app':'Set','appdata':_0x5ac7('0x24'),'context':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x17')],'exten':_0x53aa9a[_0x449944][0x0]['exten'],'priority':_0xc239af[_0x5ac7('0xf')]++,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')]});_0xc239af[_0x5ac7('0x10')][_0x5ac7('0x13')]({'type':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')],'app':_0x5ac7('0x15'),'appdata':_0x5ac7('0x25')+_0xc239af[_0x5ac7('0x11')]['recordingFormat']||_0x5ac7('0x26'),'context':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x17')],'exten':_0x53aa9a[_0x449944][0x0][_0x5ac7('0xa')],'priority':_0xc239af[_0x5ac7('0xf')]++,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')]});}}_0xc239af[_0x5ac7('0x10')][_0x5ac7('0x13')]({'type':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')],'app':_0x5ac7('0x15'),'appdata':_0x5ac7('0x27'),'context':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x17')],'exten':_0x53aa9a[_0x449944][0x0]['exten'],'priority':_0xc239af[_0x5ac7('0xf')]++,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')]});_0xc239af[_0x5ac7('0x10')][_0x5ac7('0x13')]({'type':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')],'app':_0x5ac7('0x15'),'appdata':_0x5ac7('0x28'),'context':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x17')],'exten':_0x53aa9a[_0x449944][0x0][_0x5ac7('0xa')],'priority':_0xc239af[_0x5ac7('0xf')]++,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')]});_0xc239af[_0x5ac7('0x10')]['push']({'type':_0x53aa9a[_0x449944][0x0]['type'],'app':_0x5ac7('0x15'),'appdata':_0x5ac7('0x29'),'context':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x17')],'exten':_0x53aa9a[_0x449944][0x0][_0x5ac7('0xa')],'priority':_0xc239af['priority']++,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')]});for(var _0x2d7cad=0x0,_0x3a767e=0x0;_0x2d7cad<_0x53aa9a[_0x449944][_0x5ac7('0x2a')];_0x2d7cad+=0x1,_0x3a767e=0x0){var _0x24b39a=_0x53aa9a[_0x449944][_0x2d7cad];if(_0x24b39a[_0x5ac7('0x14')]){_0x24b39a[_0x5ac7('0x14')]=_0x24b39a[_0x5ac7('0x14')]['toLowerCase']();}var _0x1ee10b=[];var _0x17b852=[];delete _0x24b39a['id'];delete _0x24b39a[_0x5ac7('0x2b')];delete _0x24b39a[_0x5ac7('0x2c')];var _0x393291=_0x24b39a[_0x5ac7('0x2d')]!==_0x5ac7('0x2e')?[_0x24b39a[_0x5ac7('0x2d')]]:_0x24b39a[_0x5ac7('0x7')]?_[_0x5ac7('0x9')](_[_0x5ac7('0xc')](_0xc239af['intervals'],{'IntervalId':_0x24b39a['IntervalId']}),_0x5ac7('0x2d')):[];if(_0x24b39a['hasOwnProperty'](_0x5ac7('0x2f'))){if(_0x24b39a[_0x5ac7('0x2f')]&&_0x24b39a[_0x5ac7('0x2f')]!=='--'){_0x1ee10b[_0x5ac7('0x13')]({'type':_0x24b39a[_0x5ac7('0x14')],'app':'Set','appdata':_0x5ac7('0x30')+_0x24b39a[_0x5ac7('0x2f')],'context':_0x24b39a[_0x5ac7('0x17')],'exten':_0x24b39a['exten'],'priority':_0x393291[_0x5ac7('0x2a')]+_0xc239af[_0x5ac7('0xf')]+_0x3a767e++,'VoiceExtensionId':_0x24b39a[_0x5ac7('0x18')]});}}if(_0x24b39a['type']===_0x5ac7('0x1a')&&_0x24b39a['hasOwnProperty'](_0x5ac7('0x31'))){if(_0x24b39a['callerID']){_0x1ee10b[_0x5ac7('0x13')]({'type':_0x24b39a[_0x5ac7('0x14')],'app':_0x5ac7('0x32'),'appdata':_0x5ac7('0x33')+_0x24b39a[_0x5ac7('0x31')]+')','context':_0x24b39a[_0x5ac7('0x17')],'exten':_0x24b39a[_0x5ac7('0xa')],'priority':_0x393291[_0x5ac7('0x2a')]+_0xc239af['priority']+_0x3a767e++,'VoiceExtensionId':_0x24b39a[_0x5ac7('0x18')]});}else{_0x1ee10b[_0x5ac7('0x13')]({'type':_0x24b39a[_0x5ac7('0x14')],'app':_0x5ac7('0x32'),'appdata':_0x5ac7('0x34'),'context':_0x24b39a[_0x5ac7('0x17')],'exten':_0x24b39a[_0x5ac7('0xa')],'priority':_0x393291[_0x5ac7('0x2a')]+_0xc239af[_0x5ac7('0xf')]+_0x3a767e++,'VoiceExtensionId':_0x24b39a[_0x5ac7('0x18')]});}}if(_0x24b39a[_0x5ac7('0x22')]('answer')){if(_0x47b985[_0x5ac7('0x35')](_0x24b39a[_0x5ac7('0x36')]['toLowerCase']())>=0x0&&_0x24b39a[_0x5ac7('0x37')]!=='custom'){if(_0x24b39a[_0x5ac7('0x38')]){_0x1ee10b['push']({'type':_0x24b39a['type'],'app':'ExecIf','appdata':_0x5ac7('0x39'),'context':_0x24b39a[_0x5ac7('0x17')],'exten':_0x24b39a[_0x5ac7('0xa')],'priority':_0x393291[_0x5ac7('0x2a')]+_0xc239af[_0x5ac7('0xf')]+_0x3a767e++,'VoiceExtensionId':_0x24b39a['VoiceExtensionId']});_0x1ee10b['push']({'type':_0x24b39a[_0x5ac7('0x14')],'app':_0x5ac7('0x15'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x24b39a[_0x5ac7('0x17')],'exten':_0x24b39a[_0x5ac7('0xa')],'priority':_0x393291[_0x5ac7('0x2a')]+_0xc239af[_0x5ac7('0xf')]+_0x3a767e++,'VoiceExtensionId':_0x24b39a[_0x5ac7('0x18')]});}else{_0x1ee10b[_0x5ac7('0x13')]({'type':_0x24b39a[_0x5ac7('0x14')],'app':_0x5ac7('0x32'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x24b39a[_0x5ac7('0x17')],'exten':_0x24b39a['exten'],'priority':_0x393291['length']+_0xc239af[_0x5ac7('0xf')]+_0x3a767e++,'VoiceExtensionId':_0x24b39a[_0x5ac7('0x18')]});_0x1ee10b[_0x5ac7('0x13')]({'type':_0x24b39a['type'],'app':_0x5ac7('0x15'),'appdata':_0x5ac7('0x3a'),'context':_0x24b39a[_0x5ac7('0x17')],'exten':_0x24b39a[_0x5ac7('0xa')],'priority':_0x393291[_0x5ac7('0x2a')]+_0xc239af[_0x5ac7('0xf')]+_0x3a767e++,'VoiceExtensionId':_0x24b39a[_0x5ac7('0x18')]});}}}for(var _0x82748=0x0;_0x82748<_0x393291[_0x5ac7('0x2a')];_0x82748+=0x1){var _0x28414c=_0xc239af['priority']+_0x393291[_0x5ac7('0x2a')];var _0x2b86c3=_0x82748===_0x393291['length']-0x1?_0xc239af[_0x5ac7('0xf')]+_0x1ee10b[_0x5ac7('0x2a')]+_0x17b852[_0x5ac7('0x2a')]+0x2:_0xc239af[_0x5ac7('0xf')]+_0x82748+0x1;_0x1ee10b[_0x5ac7('0x3b')](_0x82748,0x0,{'type':_0x24b39a[_0x5ac7('0x14')],'app':'GotoIfTime','appdata':_0x393291[_0x82748]+'?'+_0x24b39a[_0x5ac7('0x17')]+_0x5ac7('0x3c')+_0x28414c+':'+_0x24b39a[_0x5ac7('0x17')]+_0x5ac7('0x3c')+_0x2b86c3,'exten':_0x24b39a[_0x5ac7('0xa')],'context':_0x24b39a[_0x5ac7('0x17')],'priority':_0xc239af[_0x5ac7('0xf')]+_0x82748,'VoiceExtensionId':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')]});}_0x24b39a[_0x5ac7('0xf')]=_0x1ee10b['length']?_['last'](_0x1ee10b)[_0x5ac7('0xf')]+0x1:_0xc239af['priority'];_0xc239af[_0x5ac7('0xf')]=(_0x17b852['length']?_[_0x5ac7('0x3d')](_0x17b852)[_0x5ac7('0xf')]:_0x24b39a[_0x5ac7('0xf')])+0x1;_0xc239af['extensions']=_[_0x5ac7('0x3e')](_0xc239af[_0x5ac7('0x10')],_0x1ee10b,[_0x24b39a],_0x17b852);}_0xc239af[_0x5ac7('0x10')][_0x5ac7('0x13')]({'type':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x14')],'app':_0x5ac7('0x3f'),'exten':_0x53aa9a[_0x449944][0x0]['exten'],'context':_0x53aa9a[_0x449944][0x0][_0x5ac7('0x17')],'priority':_0xc239af[_0x5ac7('0xf')],'VoiceExtensionId':_0x53aa9a[_0x449944][0x0]['VoiceExtensionId']});_0x2ff172[_0x5ac7('0x13')](_0x53aa9a[_0x449944][0x0][_0x5ac7('0x18')]);_0x518e3a=_[_0x5ac7('0x3e')](_0x518e3a,_0xc239af[_0x5ac7('0x10')]);}}return _0x570257['transaction'](function(_0x51b41e){return _0x570257[_0x5ac7('0x2')][_0x5ac7('0x6')][_0x5ac7('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x2ff172}},'transaction':_0x51b41e})[_0x5ac7('0x41')](function(_0x1027d4){return _0x570257['models']['VoiceExtension'][_0x5ac7('0x42')](_[_0x5ac7('0x43')](_0x518e3a,_0x5ac7('0xf')),{'transaction':_0x51b41e});});});})[_0x5ac7('0x44')](function(_0x275b9d){console['error'](_0x275b9d);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x3a09=['XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','transaction','destroy','error','rewrite','lodash','util','models','Interval','findAll','intervals','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','then','filter','queue','priority','extension','push','type','format','context','inbound','extensions','Set','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','toLowerCase','interval','*,*,*,*','tag','callerID','ExecIf','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','custom'];(function(_0x1ba0e4,_0x159ac7){var _0x324fdc=function(_0x560596){while(--_0x560596){_0x1ba0e4['push'](_0x1ba0e4['shift']());}};_0x324fdc(++_0x159ac7);}(_0x3a09,0x107));var _0x93a0=function(_0x396f68,_0x4bed1a){_0x396f68=_0x396f68-0x0;var _0x406a7d=_0x3a09[_0x396f68];return _0x406a7d;};'use strict';var _=require(_0x93a0('0x0'));var util=require(_0x93a0('0x1'));function rewrite(_0x59e20a,_0x33a4bd){var _0x4294cb=this;return _0x59e20a[_0x93a0('0x2')][_0x93a0('0x3')][_0x93a0('0x4')]({'raw':!![]})['then'](function(_0x1bd8be){_0x4294cb[_0x93a0('0x5')]=_0x1bd8be;return _0x59e20a[_0x93a0('0x2')]['VoiceExtension'][_0x93a0('0x4')]({'where':{'IntervalId':_0x33a4bd[_0x93a0('0x6')]},'raw':!![]});})['then'](function(_0x59a603){return _0x59e20a['models'][_0x93a0('0x7')][_0x93a0('0x4')]({'where':{'exten':{'$in':_[_0x93a0('0x8')](_[_0x93a0('0x9')](_0x59a603,_0x93a0('0xa')))}},'order':[{'raw':_0x93a0('0xb')}],'raw':!![]});})[_0x93a0('0xc')](function(_0x57ecb4){var _0x1d9885=_['filter'](_0x57ecb4,{'priority':'1'});var _0x5240b3=_[_0x93a0('0xd')](_0x57ecb4,{'isApp':0x1});var _0x1bdcef=_['groupBy'](_0x5240b3,_0x93a0('0xa'));var _0x442720=[_0x93a0('0xe'),'playback'];var _0x57cebd=[];var _0x4a1eae=[];for(var _0x191075 in _0x1bdcef){if(_0x1bdcef['hasOwnProperty'](_0x191075)){_0x4294cb[_0x93a0('0xf')]=0x2;_0x4294cb['extensions']=[];_0x4294cb[_0x93a0('0x10')]=_['find'](_0x1d9885,{'exten':_0x1bdcef[_0x191075][0x0]['exten']});_0x4294cb['extensions'][_0x93a0('0x11')]({'type':_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')],'app':'Set','appdata':util[_0x93a0('0x13')]('CDR(type)=%s',_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')]),'context':_0x1bdcef[_0x191075][0x0][_0x93a0('0x14')],'exten':_0x1bdcef[_0x191075][0x0][_0x93a0('0xa')],'priority':_0x4294cb[_0x93a0('0xf')]++,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0]['VoiceExtensionId']});if(_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')]===_0x93a0('0x15')){_0x4294cb[_0x93a0('0x16')][_0x93a0('0x11')]({'type':_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')],'app':_0x93a0('0x17'),'appdata':_0x93a0('0x18')+_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')],'context':_0x1bdcef[_0x191075][0x0]['context'],'exten':_0x1bdcef[_0x191075][0x0]['exten'],'priority':_0x4294cb[_0x93a0('0xf')]++,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0]['VoiceExtensionId']});}else if(_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')]===_0x93a0('0x1a')){if(_0x4294cb[_0x93a0('0x10')]){_0x4294cb['extensions'][_0x93a0('0x11')]({'type':_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')],'app':_0x93a0('0x17'),'appdata':_0x93a0('0x1b')+(_0x4294cb[_0x93a0('0x10')][_0x93a0('0x1c')]?'${EXTEN:'+_0x4294cb['extension']['cutdigits']+'}':_0x93a0('0x1d')),'context':_0x1bdcef[_0x191075][0x0][_0x93a0('0x14')],'exten':_0x1bdcef[_0x191075][0x0]['exten'],'priority':_0x4294cb[_0x93a0('0xf')]++,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0]['VoiceExtensionId']});}_0x4294cb[_0x93a0('0x16')][_0x93a0('0x11')]({'type':_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')],'app':_0x93a0('0x17'),'appdata':'CDR(routeid)='+_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')],'context':_0x1bdcef[_0x191075][0x0][_0x93a0('0x14')],'exten':_0x1bdcef[_0x191075][0x0][_0x93a0('0xa')],'priority':_0x4294cb[_0x93a0('0xf')]++,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')]});var _0x57c24e=_0x4294cb[_0x93a0('0xf')]++;_0x4294cb['extensions'][_0x93a0('0x11')]({'type':_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')],'app':'ExecIf','appdata':_0x93a0('0x1e')+(_0x57c24e+0x2)+_0x93a0('0x1f')+(_0x57c24e+0x1)+')','context':_0x1bdcef[_0x191075][0x0]['context'],'exten':_0x1bdcef[_0x191075][0x0]['exten'],'priority':_0x57c24e,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')]});if(_0x4294cb[_0x93a0('0x10')]){_0x4294cb['extensions']['push']({'type':_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')],'app':_0x93a0('0x17'),'appdata':_0x4294cb['extension']['cutdigits']?_0x93a0('0x20')+_0x4294cb['extension']['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x1bdcef[_0x191075][0x0][_0x93a0('0x14')],'exten':_0x1bdcef[_0x191075][0x0][_0x93a0('0xa')],'priority':_0x4294cb[_0x93a0('0xf')]++,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')]});}_0x4294cb[_0x93a0('0x16')][_0x93a0('0x11')]({'type':_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')],'app':_0x93a0('0x17'),'appdata':_0x93a0('0x21')+_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')],'context':_0x1bdcef[_0x191075][0x0][_0x93a0('0x14')],'exten':_0x1bdcef[_0x191075][0x0]['exten'],'priority':_0x4294cb[_0x93a0('0xf')]++,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')]});if(_0x4294cb[_0x93a0('0x10')]&&_0x4294cb[_0x93a0('0x10')][_0x93a0('0x22')](_0x93a0('0x23'))&&_0x4294cb[_0x93a0('0x10')][_0x93a0('0x23')]!=='none'){_0x4294cb[_0x93a0('0x16')][_0x93a0('0x11')]({'type':_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')],'app':_0x93a0('0x17'),'appdata':_0x93a0('0x24'),'context':_0x1bdcef[_0x191075][0x0][_0x93a0('0x14')],'exten':_0x1bdcef[_0x191075][0x0][_0x93a0('0xa')],'priority':_0x4294cb[_0x93a0('0xf')]++,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')]});_0x4294cb[_0x93a0('0x16')][_0x93a0('0x11')]({'type':_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')],'app':_0x93a0('0x17'),'appdata':_0x93a0('0x25')+_0x4294cb[_0x93a0('0x10')][_0x93a0('0x23')]||_0x93a0('0x26'),'context':_0x1bdcef[_0x191075][0x0][_0x93a0('0x14')],'exten':_0x1bdcef[_0x191075][0x0][_0x93a0('0xa')],'priority':_0x4294cb[_0x93a0('0xf')]++,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')]});}}_0x4294cb['extensions'][_0x93a0('0x11')]({'type':_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')],'app':'Set','appdata':_0x93a0('0x27'),'context':_0x1bdcef[_0x191075][0x0][_0x93a0('0x14')],'exten':_0x1bdcef[_0x191075][0x0]['exten'],'priority':_0x4294cb[_0x93a0('0xf')]++,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')]});_0x4294cb[_0x93a0('0x16')][_0x93a0('0x11')]({'type':_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')],'app':_0x93a0('0x17'),'appdata':_0x93a0('0x28'),'context':_0x1bdcef[_0x191075][0x0][_0x93a0('0x14')],'exten':_0x1bdcef[_0x191075][0x0][_0x93a0('0xa')],'priority':_0x4294cb['priority']++,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')]});_0x4294cb[_0x93a0('0x16')][_0x93a0('0x11')]({'type':_0x1bdcef[_0x191075][0x0][_0x93a0('0x12')],'app':_0x93a0('0x17'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1bdcef[_0x191075][0x0]['context'],'exten':_0x1bdcef[_0x191075][0x0][_0x93a0('0xa')],'priority':_0x4294cb['priority']++,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')]});for(var _0x1954b8=0x0,_0x17f09f=0x0;_0x1954b8<_0x1bdcef[_0x191075]['length'];_0x1954b8+=0x1,_0x17f09f=0x0){var _0x59c00a=_0x1bdcef[_0x191075][_0x1954b8];if(_0x59c00a[_0x93a0('0x12')]){_0x59c00a[_0x93a0('0x12')]=_0x59c00a[_0x93a0('0x12')][_0x93a0('0x29')]();}var _0x301a06=[];var _0x5c6190=[];delete _0x59c00a['id'];delete _0x59c00a['createdAt'];delete _0x59c00a['updatedAt'];var _0x3675a4=_0x59c00a[_0x93a0('0x2a')]!==_0x93a0('0x2b')?[_0x59c00a[_0x93a0('0x2a')]]:_0x59c00a[_0x93a0('0x6')]?_['map'](_[_0x93a0('0xd')](_0x4294cb[_0x93a0('0x5')],{'IntervalId':_0x59c00a[_0x93a0('0x6')]}),_0x93a0('0x2a')):[];if(_0x59c00a[_0x93a0('0x22')](_0x93a0('0x2c'))){if(_0x59c00a['tag']&&_0x59c00a['tag']!=='--'){_0x301a06[_0x93a0('0x11')]({'type':_0x59c00a[_0x93a0('0x12')],'app':_0x93a0('0x17'),'appdata':'CDR(tag)='+_0x59c00a['tag'],'context':_0x59c00a[_0x93a0('0x14')],'exten':_0x59c00a['exten'],'priority':_0x3675a4['length']+_0x4294cb[_0x93a0('0xf')]+_0x17f09f++,'VoiceExtensionId':_0x59c00a['VoiceExtensionId']});}}if(_0x59c00a['type']==='outbound'&&_0x59c00a['hasOwnProperty'](_0x93a0('0x2d'))){if(_0x59c00a['callerID']){_0x301a06[_0x93a0('0x11')]({'type':_0x59c00a[_0x93a0('0x12')],'app':_0x93a0('0x2e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x59c00a['callerID']+')','context':_0x59c00a[_0x93a0('0x14')],'exten':_0x59c00a[_0x93a0('0xa')],'priority':_0x3675a4[_0x93a0('0x2f')]+_0x4294cb[_0x93a0('0xf')]+_0x17f09f++,'VoiceExtensionId':_0x59c00a[_0x93a0('0x19')]});}else{_0x301a06[_0x93a0('0x11')]({'type':_0x59c00a[_0x93a0('0x12')],'app':'ExecIf','appdata':_0x93a0('0x30'),'context':_0x59c00a[_0x93a0('0x14')],'exten':_0x59c00a[_0x93a0('0xa')],'priority':_0x3675a4[_0x93a0('0x2f')]+_0x4294cb[_0x93a0('0xf')]+_0x17f09f++,'VoiceExtensionId':_0x59c00a['VoiceExtensionId']});}}if(_0x59c00a[_0x93a0('0x22')](_0x93a0('0x31'))){if(_0x442720[_0x93a0('0x32')](_0x59c00a['app'][_0x93a0('0x29')]())>=0x0&&_0x59c00a['appType']!==_0x93a0('0x33')){if(_0x59c00a['answer']){_0x301a06['push']({'type':_0x59c00a[_0x93a0('0x12')],'app':_0x93a0('0x2e'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x59c00a['context'],'exten':_0x59c00a[_0x93a0('0xa')],'priority':_0x3675a4[_0x93a0('0x2f')]+_0x4294cb[_0x93a0('0xf')]+_0x17f09f++,'VoiceExtensionId':_0x59c00a[_0x93a0('0x19')]});_0x301a06[_0x93a0('0x11')]({'type':_0x59c00a[_0x93a0('0x12')],'app':_0x93a0('0x17'),'appdata':_0x93a0('0x34'),'context':_0x59c00a[_0x93a0('0x14')],'exten':_0x59c00a['exten'],'priority':_0x3675a4[_0x93a0('0x2f')]+_0x4294cb[_0x93a0('0xf')]+_0x17f09f++,'VoiceExtensionId':_0x59c00a[_0x93a0('0x19')]});}else{_0x301a06[_0x93a0('0x11')]({'type':_0x59c00a['type'],'app':_0x93a0('0x2e'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x59c00a[_0x93a0('0x14')],'exten':_0x59c00a['exten'],'priority':_0x3675a4[_0x93a0('0x2f')]+_0x4294cb['priority']+_0x17f09f++,'VoiceExtensionId':_0x59c00a[_0x93a0('0x19')]});_0x301a06['push']({'type':_0x59c00a[_0x93a0('0x12')],'app':_0x93a0('0x17'),'appdata':_0x93a0('0x35'),'context':_0x59c00a[_0x93a0('0x14')],'exten':_0x59c00a[_0x93a0('0xa')],'priority':_0x3675a4[_0x93a0('0x2f')]+_0x4294cb[_0x93a0('0xf')]+_0x17f09f++,'VoiceExtensionId':_0x59c00a[_0x93a0('0x19')]});}}}for(var _0x449631=0x0;_0x449631<_0x3675a4[_0x93a0('0x2f')];_0x449631+=0x1){var _0x2e84cc=_0x4294cb[_0x93a0('0xf')]+_0x3675a4[_0x93a0('0x2f')];var _0x148302=_0x449631===_0x3675a4[_0x93a0('0x2f')]-0x1?_0x4294cb[_0x93a0('0xf')]+_0x301a06['length']+_0x5c6190[_0x93a0('0x2f')]+0x2:_0x4294cb['priority']+_0x449631+0x1;_0x301a06[_0x93a0('0x36')](_0x449631,0x0,{'type':_0x59c00a[_0x93a0('0x12')],'app':_0x93a0('0x37'),'appdata':_0x3675a4[_0x449631]+'?'+_0x59c00a[_0x93a0('0x14')]+_0x93a0('0x38')+_0x2e84cc+':'+_0x59c00a[_0x93a0('0x14')]+_0x93a0('0x38')+_0x148302,'exten':_0x59c00a['exten'],'context':_0x59c00a[_0x93a0('0x14')],'priority':_0x4294cb[_0x93a0('0xf')]+_0x449631,'VoiceExtensionId':_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')]});}_0x59c00a['priority']=_0x301a06['length']?_[_0x93a0('0x39')](_0x301a06)[_0x93a0('0xf')]+0x1:_0x4294cb[_0x93a0('0xf')];_0x4294cb['priority']=(_0x5c6190[_0x93a0('0x2f')]?_[_0x93a0('0x39')](_0x5c6190)[_0x93a0('0xf')]:_0x59c00a[_0x93a0('0xf')])+0x1;_0x4294cb[_0x93a0('0x16')]=_['concat'](_0x4294cb[_0x93a0('0x16')],_0x301a06,[_0x59c00a],_0x5c6190);}_0x4294cb[_0x93a0('0x16')][_0x93a0('0x11')]({'type':_0x1bdcef[_0x191075][0x0]['type'],'app':_0x93a0('0x3a'),'exten':_0x1bdcef[_0x191075][0x0][_0x93a0('0xa')],'context':_0x1bdcef[_0x191075][0x0][_0x93a0('0x14')],'priority':_0x4294cb['priority'],'VoiceExtensionId':_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')]});_0x57cebd[_0x93a0('0x11')](_0x1bdcef[_0x191075][0x0][_0x93a0('0x19')]);_0x4a1eae=_['concat'](_0x4a1eae,_0x4294cb[_0x93a0('0x16')]);}}return _0x59e20a[_0x93a0('0x3b')](function(_0x1761f1){return _0x59e20a[_0x93a0('0x2')][_0x93a0('0x7')][_0x93a0('0x3c')]({'where':{'VoiceExtensionId':{'$in':_0x57cebd}},'transaction':_0x1761f1})[_0x93a0('0xc')](function(_0x2e5029){return _0x59e20a[_0x93a0('0x2')][_0x93a0('0x7')]['bulkCreate'](_['sortBy'](_0x4a1eae,_0x93a0('0xf')),{'transaction':_0x1761f1});});});})['catch'](function(_0x4cd214){console[_0x93a0('0x3d')](_0x4cd214);});}exports[_0x93a0('0x3e')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index f9ac056..f32ff4d 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 _0x180e=['createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/logger','api','redis','socket.io-emitter','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','into','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','insert','ListId\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','cm_contacts','cm_hopper_black','findAll','dialCheckDuplicateType','CmList','Lists','get','sequelize','VoiceQueueId','onlyIfOpen','query','all','VoiceQueue','CampaignId','Campaign','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!'];(function(_0x3207a4,_0x1b9024){var _0x5c8dff=function(_0x4611b9){while(--_0x4611b9){_0x3207a4['push'](_0x3207a4['shift']());}};_0x5c8dff(++_0x1b9024);}(_0x180e,0x6e));var _0xe180=function(_0x56c4b8,_0x17f78d){_0x56c4b8=_0x56c4b8-0x0;var _0x222836=_0x180e[_0x56c4b8];return _0x222836;};'use strict';var BPromise=require(_0xe180('0x0'));var util=require(_0xe180('0x1'));var _=require(_0xe180('0x2'));var fs=require('fs');var squel=require(_0xe180('0x3'));var Papa=require(_0xe180('0x4'));var Redis=require('ioredis');var db=require(_0xe180('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0xe180('0x6'))(_0xe180('0x7'));config[_0xe180('0x8')]=_['defaults'](config[_0xe180('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xe180('0x9'))(new Redis(config[_0xe180('0x8')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xe180('0xa')][0x2]||process[_0xe180('0xa')][0x2]==='undefined'||process['argv'][0x2]===_0xe180('0xb')){throw new Error(_0xe180('0xc'));}var FILEPATH=process[_0xe180('0xa')][0x2];if(!process[_0xe180('0xa')][0x3]||process['argv'][0x3]===_0xe180('0xd')||process[_0xe180('0xa')][0x3]===_0xe180('0xb')||!process[_0xe180('0xa')][0x4]||process[_0xe180('0xa')][0x4]===_0xe180('0xd')||process[_0xe180('0xa')][0x4]===_0xe180('0xb')){throw new Error(_0xe180('0xe'));}var FIELDS=_[_0xe180('0xf')](process['argv'][0x3][_0xe180('0x10')](','),process[_0xe180('0xa')][0x4][_0xe180('0x10')](','));if(!process[_0xe180('0xa')][0x5]||process[_0xe180('0xa')][0x5]===_0xe180('0xd')||process[_0xe180('0xa')][0x5]===_0xe180('0xb')){throw new Error(_0xe180('0x11'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xe180('0xa')][0x6]&&process[_0xe180('0xa')][0x6]!=='undefined'&&process[_0xe180('0xa')][0x6]!==_0xe180('0xb')?process[_0xe180('0xa')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0xe180('0xa')][0x7]!==_0xe180('0xb')?process[_0xe180('0xa')][0x7]:null;if(!process[_0xe180('0xa')][0x8]||process[_0xe180('0xa')][0x8]==='undefined'||process[_0xe180('0xa')][0x8]===_0xe180('0xb')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xe180('0xa')][0x8];}catch(_0x36ce31){logger['error'](_0x36ce31);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(_0x1219a2,_0x443b06,_0x4c407d,_0x17cb6e){var _0x3247d6={'message':_0x443b06};_0x3247d6[_0x1219a2]=!![];if(_0x4c407d){_0x3247d6['contact']=_0x4c407d;}if(_0x17cb6e){_0x3247d6['index']=_0x17cb6e;}return _0x3247d6;}function isEmail(_0x3e040c){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3e040c);}function checkRow(_0x5b3d13,_0x449010,_0x384425){return new BPromise(function(_0x564320,_0x142de8){if(_['isNil'](_0x5b3d13)){return _0x142de8(handleCheckRowError(_0xe180('0x12'),_0xe180('0x13'),null,_0x384425));}if(_0x5b3d13['errors']&&_0x5b3d13[_0xe180('0x14')][_0xe180('0x15')]){var _0x42d6ea=_['map'](_0x5b3d13[_0xe180('0x14')],_0xe180('0x16'))[_0xe180('0x17')](';');return _0x142de8(handleCheckRowError('error',_0x42d6ea,null,_0x384425));}var _0x47a77b={};for(var _0x3cb4dd in FIELDS){if(FIELDS[_0xe180('0x18')](_0x3cb4dd)&&FIELDS[_0x3cb4dd]){_0x47a77b[_0x3cb4dd]=_0x5b3d13[_0xe180('0x19')][0x0][FIELDS[_0x3cb4dd]]||_0x5b3d13[_0xe180('0x19')][0x0]['\ufeff'+FIELDS[_0x3cb4dd]];}}if(!_0x47a77b[_0xe180('0x1a')]){return _0x142de8(handleCheckRowError(_0xe180('0x12'),_0xe180('0x1b'),null,_0x384425));}if(!_0x47a77b['phone']){return _0x142de8(handleCheckRowError(_0xe180('0x12'),_0xe180('0x1c'),null,_0x384425));}if(_0x47a77b[_0xe180('0x1d')]){var _0x5d85ba=moment(_0x47a77b[_0xe180('0x1d')],_0xe180('0x1e'));if(!_0x5d85ba[_0xe180('0x1f')]()){return _0x142de8(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x384425));}}if(_0x47a77b[_0xe180('0x20')]){if(!isEmail(_0x47a77b['email'])){return _0x142de8(handleCheckRowError(_0xe180('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x384425));}}_0x47a77b[_0xe180('0x21')]=LISTID;_0x47a77b['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x449010){var _0x3478d8={};for(var _0x517113=0x0,_0x3d73ee=DUPLICATES[_0xe180('0x15')];_0x517113<_0x3d73ee;_0x517113+=0x1){_0x3478d8[DUPLICATES[_0x517113]]=_0x47a77b[DUPLICATES[_0x517113]];}var _0x364a13=_[_0xe180('0x22')](_0x449010,_0x3478d8);if(_0x364a13){return _0x142de8(handleCheckRowError(_0xe180('0x23'),_0xe180('0x24'),_0x364a13,_0x384425));}}return db[_0xe180('0x25')][_0xe180('0x26')](_0x47a77b,{'raw':!![],'hooks':![],'fields':_[_0xe180('0x27')](_0x47a77b)})[_0xe180('0x28')](function(_0x3ee1ba){if(DUPLICATES&&DUPLICATES['length']&&_0x449010){_0x449010[_0xe180('0x29')](_[_0xe180('0x2a')](_0x47a77b,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3ee1ba['id'];return _0x564320();})[_0xe180('0x2b')](function(_0x1a0d57){return _0x142de8(handleCheckRowError(_0xe180('0x12'),_0xe180('0x2c')+(_0x1a0d57[_0xe180('0x16')]||JSON[_0xe180('0x2d')](_0x1a0d57)),null,_0x384425));});});}function checkHopper(){function _0x2b4d0a(){return function(_0x3c271a){logger[_0xe180('0x12')]('cmContact',_0xe180('0x2e'),util[_0xe180('0x2f')](_0x3c271a,{'showHidden':![],'depth':null}));};}var _0x5e2525=function(_0x2b2c3b,_0x2b1e36){var _0xbc3f9c=squel['insert']()[_0xe180('0x30')]('cm_hopper')[_0xe180('0x31')]([_0xe180('0x32'),_0xe180('0x33'),_0xe180('0x34'),_0xe180('0x21'),_0x2b1e36,_0xe180('0x35'),_0xe180('0x36')],squel[_0xe180('0x37')]()[_0xe180('0x38')](_0xe180('0x32'),'phone')[_0xe180('0x38')](_0xe180('0x39'),_0xe180('0x33'))[_0xe180('0x38')]('id',_0xe180('0x34'))[_0xe180('0x38')](LISTID[_0xe180('0x3a')](),_0xe180('0x21'))[_0xe180('0x38')](_0x2b2c3b['id'][_0xe180('0x3a')](),_0x2b1e36)[_0xe180('0x38')](_0xe180('0x39'),'createdAt')['field'](_0xe180('0x39'),_0xe180('0x36'))[_0xe180('0x3b')]('cm_contacts')[_0xe180('0x3c')](_0xe180('0x3d'))[_0xe180('0x3c')]('ListId\x20=\x20?',LISTID[_0xe180('0x3a')]())[_0xe180('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0xe180('0x3c')](_0xe180('0x3e'),squel[_0xe180('0x37')]()[_0xe180('0x38')]('phone')[_0xe180('0x3b')](_0xe180('0x3f'))[_0xe180('0x3c')](_0x2b1e36+_0xe180('0x40'),_0x2b2c3b['id'][_0xe180('0x3a')]())))[_0xe180('0x3a')]();return _0xbc3f9c;};var _0x1ff739=function(_0x2564fa,_0x4567ce){var _0x1936b8=squel[_0xe180('0x41')]()[_0xe180('0x30')]('cm_hopper')['fromQuery']([_0xe180('0x32'),_0xe180('0x33'),_0xe180('0x34'),_0xe180('0x21'),_0x4567ce,_0xe180('0x35'),_0xe180('0x36')],squel[_0xe180('0x37')]()[_0xe180('0x38')](_0xe180('0x32'),_0xe180('0x32'))[_0xe180('0x38')](_0xe180('0x39'),_0xe180('0x33'))['field']('id',_0xe180('0x34'))[_0xe180('0x38')](LISTID[_0xe180('0x3a')](),_0xe180('0x21'))['field'](_0x2564fa['id'][_0xe180('0x3a')](),_0x4567ce)['field'](_0xe180('0x39'),'createdAt')[_0xe180('0x38')]('NOW()','updatedAt')['from']('cm_contacts')[_0xe180('0x3c')](_0xe180('0x3d'))[_0xe180('0x3c')](_0xe180('0x42'),LISTID[_0xe180('0x3a')]())[_0xe180('0x3c')](_0xe180('0x43'),squel[_0xe180('0x44')](hopperContacts))[_0xe180('0x3c')](_0xe180('0x45'))[_0xe180('0x3c')](_0xe180('0x3e'),squel['select']()[_0xe180('0x38')]('calleridnum')[_0xe180('0x3b')]('cm_hopper_final')[_0xe180('0x3c')](_0x4567ce+_0xe180('0x40'),_0x2564fa['id'][_0xe180('0x3a')]()))[_0xe180('0x3c')](_0xe180('0x3e'),squel['select']()[_0xe180('0x38')](_0xe180('0x32'))[_0xe180('0x3b')](_0xe180('0x3f'))[_0xe180('0x3c')](_0x4567ce+'\x20=\x20?',_0x2564fa['id']['toString']())))['toString']();return _0x1936b8;};function _0x2b5fd7(_0x238ded,_0x393e7a){var _0x179b1a=squel[_0xe180('0x41')]()[_0xe180('0x30')](_0xe180('0x3f'))['fromQuery']([_0xe180('0x32'),_0xe180('0x33'),_0xe180('0x34'),'ListId',_0x393e7a,_0xe180('0x35'),_0xe180('0x36')],squel[_0xe180('0x37')]()[_0xe180('0x38')](_0xe180('0x32'),_0xe180('0x32'))[_0xe180('0x38')]('NOW()',_0xe180('0x33'))['field']('id',_0xe180('0x34'))[_0xe180('0x38')](LISTID[_0xe180('0x3a')](),_0xe180('0x21'))['field'](_0x238ded['id'][_0xe180('0x3a')](),_0x393e7a)[_0xe180('0x38')](_0xe180('0x39'),'createdAt')[_0xe180('0x38')](_0xe180('0x39'),_0xe180('0x36'))[_0xe180('0x3b')](_0xe180('0x46'))[_0xe180('0x3c')](_0xe180('0x3d'))[_0xe180('0x3c')](_0xe180('0x42'),LISTID[_0xe180('0x3a')]())['where'](_0xe180('0x43'),squel[_0xe180('0x44')](hopperContacts))[_0xe180('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0xe180('0x3a')]();return _0x179b1a;}function _0x4d6e07(_0x3c9628,_0x420aa1){var _0x1c4180=squel[_0xe180('0x41')]()[_0xe180('0x30')](_0xe180('0x47'))[_0xe180('0x31')]([_0xe180('0x32'),_0xe180('0x34'),_0xe180('0x21'),_0x420aa1,_0xe180('0x35'),'updatedAt'],squel[_0xe180('0x37')]()[_0xe180('0x38')](_0xe180('0x32'),_0xe180('0x32'))[_0xe180('0x38')]('id','ContactId')[_0xe180('0x38')](LISTID[_0xe180('0x3a')](),_0xe180('0x21'))[_0xe180('0x38')](_0x3c9628['id'][_0xe180('0x3a')](),_0x420aa1)[_0xe180('0x38')](_0xe180('0x39'),_0xe180('0x35'))[_0xe180('0x38')](_0xe180('0x39'),_0xe180('0x36'))[_0xe180('0x3b')](_0xe180('0x46'))['where'](_0xe180('0x3d'))[_0xe180('0x3c')]('ListId\x20=\x20?',LISTID[_0xe180('0x3a')]())['where'](_0xe180('0x43'),squel[_0xe180('0x44')](hopperContacts))[_0xe180('0x3c')](_0xe180('0x45')))['toString']();return _0x1c4180;}return db['VoiceQueue'][_0xe180('0x48')]({'where':{'type':'outbound'},'attributes':['id',_0xe180('0x49')],'include':[{'model':db[_0xe180('0x4a')],'as':_0xe180('0x4b'),'where':{'id':LISTID}}]})[_0xe180('0x28')](function(_0x52f90a){var _0x26afb3=[];if(_0x52f90a){var _0x5d3032;for(var _0x489f8e=0x0,_0x4eb6d9;_0x489f8e<_0x52f90a[_0xe180('0x15')];_0x489f8e+=0x1){_0x4eb6d9=_0x52f90a[_0x489f8e][_0xe180('0x4c')]({'plain':!![]});switch(_0x4eb6d9[_0xe180('0x49')]){case'always':_0x26afb3[_0xe180('0x29')](db[_0xe180('0x4d')]['query'](_0x1ff739(_0x4eb6d9,_0xe180('0x4e')))[_0xe180('0x28')](function(){})['catch'](_0x2b4d0a()));break;case _0xe180('0x4f'):_0x26afb3[_0xe180('0x29')](db['sequelize']['query'](_0x5e2525(_0x4eb6d9,_0xe180('0x4e')))[_0xe180('0x28')](function(){})[_0xe180('0x2b')](_0x2b4d0a()));break;default:_0x26afb3[_0xe180('0x29')](db[_0xe180('0x4d')][_0xe180('0x50')](_0x2b5fd7(_0x4eb6d9,_0xe180('0x4e')))[_0xe180('0x28')](function(){})[_0xe180('0x2b')](_0x2b4d0a()));}}}return _0x26afb3;})[_0xe180('0x51')]()[_0xe180('0x28')](function(){return db[_0xe180('0x52')][_0xe180('0x48')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xe180('0x4a')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x4f48b6){var _0x284a51=[];if(_0x4f48b6){var _0x435acb;for(var _0x1adb4a=0x0,_0x569668;_0x1adb4a<_0x4f48b6[_0xe180('0x15')];_0x1adb4a+=0x1){_0x569668=_0x4f48b6[_0x1adb4a][_0xe180('0x4c')]({'plain':!![]});_0x284a51[_0xe180('0x29')](db[_0xe180('0x4d')][_0xe180('0x50')](_0x4d6e07(_0x569668,_0xe180('0x4e')))[_0xe180('0x28')](function(){})['catch'](_0x2b4d0a()));}}return _0x284a51;})[_0xe180('0x51')]();})['then'](function(){return db['Campaign'][_0xe180('0x48')]({'attributes':['id',_0xe180('0x49')],'include':[{'model':db['CmList'],'as':_0xe180('0x4b'),'where':{'id':LISTID}}]})[_0xe180('0x28')](function(_0x16c3e9){var _0x7627e=[];if(_0x16c3e9){for(var _0x26f851=0x0,_0x3bb3ea;_0x26f851<_0x16c3e9[_0xe180('0x15')];_0x26f851+=0x1){_0x3bb3ea=_0x16c3e9[_0x26f851][_0xe180('0x4c')]({'plain':!![]});switch(_0x3bb3ea[_0xe180('0x49')]){case'always':_0x7627e[_0xe180('0x29')](db[_0xe180('0x4d')][_0xe180('0x50')](_0x1ff739(_0x3bb3ea,_0xe180('0x53')))[_0xe180('0x28')](function(){})['catch'](_0x2b4d0a()));break;case _0xe180('0x4f'):_0x7627e[_0xe180('0x29')](db[_0xe180('0x4d')][_0xe180('0x50')](_0x5e2525(_0x3bb3ea,'CampaignId'))[_0xe180('0x28')](function(){})[_0xe180('0x2b')](_0x2b4d0a()));break;default:_0x7627e[_0xe180('0x29')](db[_0xe180('0x4d')][_0xe180('0x50')](_0x2b5fd7(_0x3bb3ea,'CampaignId'))['then'](function(){})[_0xe180('0x2b')](_0x2b4d0a()));}}}return _0x7627e;})[_0xe180('0x51')]();})['then'](function(){return db[_0xe180('0x54')][_0xe180('0x48')]({'attributes':['id'],'include':[{'model':db[_0xe180('0x4a')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xe180('0x28')](function(_0x62532e){var _0x19a4cd=[];if(_0x62532e){for(var _0xa0f4d5=0x0,_0x55fb0e;_0xa0f4d5<_0x62532e[_0xe180('0x15')];_0xa0f4d5+=0x1){_0x55fb0e=_0x62532e[_0xa0f4d5]['get']({'plain':!![]});_0x19a4cd[_0xe180('0x29')](db[_0xe180('0x4d')]['query'](_0x4d6e07(_0x55fb0e,_0xe180('0x53')))['then'](function(){})['catch'](_0x2b4d0a()));}}return _0x19a4cd;})['all']();})[_0xe180('0x2b')](function(_0x2995b0){logger[_0xe180('0x12')](_0xe180('0x55'),'generalCheckHopper',_0x2995b0[_0xe180('0x16')]);});}var processPromises=function(_0x3ff519){return BPromise[_0xe180('0x51')](promises)[_0xe180('0x28')](function(_0x524823){})['catch'](function(_0x4dc4c6){logger[_0xe180('0x12')](_0xe180('0x56'),JSON[_0xe180('0x2d')](_0x4dc4c6));})[_0xe180('0x57')](function(){socket[_0xe180('0x58')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3ff519){return _0x3ff519[_0xe180('0x59')]();}});};var endCsv=function(){return BPromise[_0xe180('0x5a')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xe180('0x58')](_0xe180('0x5b')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xe180('0x5c')](FILEPATH);}catch(_0x936a24){logger['error'](_0xe180('0x5d'),JSON['stringify'](_0x936a24));}finally{process[_0xe180('0x5e')](0x0);}});};process['on'](_0xe180('0x5f'),function(){logger[_0xe180('0x60')](_0xe180('0x61'));endCsv();});function main(){return BPromise[_0xe180('0x5a')]()[_0xe180('0x28')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe180('0x10')](',');return db[_0xe180('0x25')][_0xe180('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x119c5a){var _0x10116d=fs[_0xe180('0x62')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xe180('0x63')](_0x10116d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x30c07e,_0x5a5ce4){total+=0x1;var _0x42acbf=total;promises[_0xe180('0x29')](checkRow(_0x30c07e,_0x119c5a,_0x42acbf)[_0xe180('0x28')](function(){success+=0x1;})['catch'](function(_0x156c8c){if(_0x156c8c[_0xe180('0x12')]){errors+=0x1;delete _0x156c8c['error'];}else if(_0x156c8c[_0xe180('0x23')]){duplicates+=0x1;delete _0x156c8c[_0xe180('0x23')];}rows[_0xe180('0x29')](_0x156c8c);}));if(total%0xc8===0x0){_0x5a5ce4[_0xe180('0x64')]();return processPromises(_0x5a5ce4);}},'complete':function(){return processPromises()[_0xe180('0x28')](function(){logger['info'](_0xe180('0x65'));endCsv();});},'error':function(_0x474242,_0x4e0ad1){logger['info'](_0xe180('0x66'),JSON[_0xe180('0x2d')](_0x474242));endCsv();}});})[_0xe180('0x2b')](function(_0x4a3766){logger[_0xe180('0x12')](_0xe180('0x67'),JSON['stringify'](_0x4a3766));});}main(); \ No newline at end of file +var _0x4f10=['phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','Duplicate\x20Contact','CmContact','then','push','pick','catch','stringify','checkHopper','inspect','into','cm_hopper','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','fromQuery','id\x20IN\x20?','str','calleridnum','insert','findAll','outbound','dialCheckDuplicateType','CmList','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','VoiceQueue','Campaign','Lists','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!'];(function(_0x35900f,_0x2b57b2){var _0xe1aaf3=function(_0x2d653a){while(--_0x2d653a){_0x35900f['push'](_0x35900f['shift']());}};_0xe1aaf3(++_0x2b57b2);}(_0x4f10,0x1f3));var _0x04f1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4f10[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x04f1('0x0'));var util=require(_0x04f1('0x1'));var _=require(_0x04f1('0x2'));var fs=require('fs');var squel=require(_0x04f1('0x3'));var Papa=require(_0x04f1('0x4'));var Redis=require(_0x04f1('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x04f1('0x6'));var logger=require(_0x04f1('0x7'))(_0x04f1('0x8'));config[_0x04f1('0x9')]=_['defaults'](config['redis'],{'host':_0x04f1('0xa'),'port':0x18eb});var socket=require(_0x04f1('0xb'))(new Redis(config['redis']));require(_0x04f1('0xc'))[_0x04f1('0xd')](socket);try{if(!process['argv'][0x2]||process[_0x04f1('0xe')][0x2]===_0x04f1('0xf')||process[_0x04f1('0xe')][0x2]===_0x04f1('0x10')){throw new Error(_0x04f1('0x11'));}var FILEPATH=process['argv'][0x2];if(!process[_0x04f1('0xe')][0x3]||process[_0x04f1('0xe')][0x3]===_0x04f1('0xf')||process['argv'][0x3]===_0x04f1('0x10')||!process[_0x04f1('0xe')][0x4]||process[_0x04f1('0xe')][0x4]==='undefined'||process['argv'][0x4]===_0x04f1('0x10')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x04f1('0x12')](process[_0x04f1('0xe')][0x3][_0x04f1('0x13')](','),process[_0x04f1('0xe')][0x4][_0x04f1('0x13')](','));if(!process[_0x04f1('0xe')][0x5]||process[_0x04f1('0xe')][0x5]==='undefined'||process[_0x04f1('0xe')][0x5]===_0x04f1('0x10')){throw new Error(_0x04f1('0x14'));}var LISTID=process[_0x04f1('0xe')][0x5];var COMPANYID=process[_0x04f1('0xe')][0x6]&&process['argv'][0x6]!==_0x04f1('0xf')&&process[_0x04f1('0xe')][0x6]!==_0x04f1('0x10')?process['argv'][0x6]:null;var DUPLICATES=process[_0x04f1('0xe')][0x7]&&process[_0x04f1('0xe')][0x7]!==_0x04f1('0xf')&&process[_0x04f1('0xe')][0x7]!=='null'?process[_0x04f1('0xe')][0x7]:null;if(!process[_0x04f1('0xe')][0x8]||process[_0x04f1('0xe')][0x8]===_0x04f1('0xf')||process[_0x04f1('0xe')][0x8]===_0x04f1('0x10')){throw new Error(_0x04f1('0x15'));}var SOCKET_TIMESTAMP=process[_0x04f1('0xe')][0x8];}catch(_0x1fc075){logger[_0x04f1('0x16')](_0x1fc075);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(_0xf8a870,_0x8f62eb,_0xebf539,_0x224e20){var _0x2085bb={'message':_0x8f62eb};_0x2085bb[_0xf8a870]=!![];if(_0xebf539){_0x2085bb[_0x04f1('0x17')]=_0xebf539;}if(_0x224e20){_0x2085bb[_0x04f1('0x18')]=_0x224e20;}return _0x2085bb;}function isEmail(_0x819c5f){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x819c5f);}function checkRow(_0x5c7886,_0x2f2bcc,_0x1502a5){return new BPromise(function(_0x2412d6,_0x5bafdf){if(_[_0x04f1('0x19')](_0x5c7886)){return _0x5bafdf(handleCheckRowError(_0x04f1('0x16'),_0x04f1('0x1a'),null,_0x1502a5));}if(_0x5c7886[_0x04f1('0x1b')]&&_0x5c7886['errors'][_0x04f1('0x1c')]){var _0x5e2a9a=_[_0x04f1('0x1d')](_0x5c7886[_0x04f1('0x1b')],_0x04f1('0x1e'))[_0x04f1('0x1f')](';');return _0x5bafdf(handleCheckRowError(_0x04f1('0x16'),_0x5e2a9a,null,_0x1502a5));}var _0x3160a3={};for(var _0x4be1f0 in FIELDS){if(FIELDS[_0x04f1('0x20')](_0x4be1f0)&&FIELDS[_0x4be1f0]){_0x3160a3[_0x4be1f0]=_0x5c7886[_0x04f1('0x21')][0x0][FIELDS[_0x4be1f0]]||_0x5c7886[_0x04f1('0x21')][0x0]['\ufeff'+FIELDS[_0x4be1f0]];}}if(!_0x3160a3[_0x04f1('0x22')]){return _0x5bafdf(handleCheckRowError(_0x04f1('0x16'),_0x04f1('0x23'),null,_0x1502a5));}if(!_0x3160a3[_0x04f1('0x24')]){return _0x5bafdf(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x1502a5));}if(_0x3160a3[_0x04f1('0x25')]){var _0xa7c2d3=moment(_0x3160a3[_0x04f1('0x25')],_0x04f1('0x26'));if(!_0xa7c2d3[_0x04f1('0x27')]()){return _0x5bafdf(handleCheckRowError(_0x04f1('0x16'),_0x04f1('0x28'),null,_0x1502a5));}}if(_0x3160a3['email']){if(!isEmail(_0x3160a3[_0x04f1('0x29')])){return _0x5bafdf(handleCheckRowError('error',_0x04f1('0x2a'),null,_0x1502a5));}}_0x3160a3[_0x04f1('0x2b')]=LISTID;_0x3160a3[_0x04f1('0x2c')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2f2bcc){var _0xe60ad4={};for(var _0x1f0934=0x0,_0x2c5ec0=DUPLICATES['length'];_0x1f0934<_0x2c5ec0;_0x1f0934+=0x1){_0xe60ad4[DUPLICATES[_0x1f0934]]=_0x3160a3[DUPLICATES[_0x1f0934]];}var _0x499d5d=_['find'](_0x2f2bcc,_0xe60ad4);if(_0x499d5d){return _0x5bafdf(handleCheckRowError(_0x04f1('0x2d'),_0x04f1('0x2e'),_0x499d5d,_0x1502a5));}}return db[_0x04f1('0x2f')]['create'](_0x3160a3,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3160a3)})[_0x04f1('0x30')](function(_0x1daff3){if(DUPLICATES&&DUPLICATES[_0x04f1('0x1c')]&&_0x2f2bcc){_0x2f2bcc[_0x04f1('0x31')](_[_0x04f1('0x32')](_0x3160a3,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1daff3['id'];return _0x2412d6();})[_0x04f1('0x33')](function(_0x27f75c){return _0x5bafdf(handleCheckRowError(_0x04f1('0x16'),'Error\x20while\x20creating\x20contact:\x20'+(_0x27f75c['message']||JSON[_0x04f1('0x34')](_0x27f75c)),null,_0x1502a5));});});}function checkHopper(){function _0x34f84d(){return function(_0x4a3231){logger[_0x04f1('0x16')]('cmContact',_0x04f1('0x35'),util[_0x04f1('0x36')](_0x4a3231,{'showHidden':![],'depth':null}));};}var _0xb65b9e=function(_0x2bb394,_0x88bdf0){var _0xaaa321=squel['insert']()[_0x04f1('0x37')](_0x04f1('0x38'))['fromQuery'](['phone',_0x04f1('0x39'),_0x04f1('0x3a'),_0x04f1('0x2b'),_0x88bdf0,_0x04f1('0x3b'),_0x04f1('0x3c')],squel[_0x04f1('0x3d')]()[_0x04f1('0x3e')](_0x04f1('0x24'),_0x04f1('0x24'))[_0x04f1('0x3e')](_0x04f1('0x3f'),_0x04f1('0x39'))[_0x04f1('0x3e')]('id',_0x04f1('0x3a'))[_0x04f1('0x3e')](LISTID[_0x04f1('0x40')](),_0x04f1('0x2b'))[_0x04f1('0x3e')](_0x2bb394['id'][_0x04f1('0x40')](),_0x88bdf0)[_0x04f1('0x3e')](_0x04f1('0x3f'),_0x04f1('0x3b'))[_0x04f1('0x3e')](_0x04f1('0x3f'),_0x04f1('0x3c'))['from'](_0x04f1('0x41'))['where'](_0x04f1('0x42'))[_0x04f1('0x43')](_0x04f1('0x44'),LISTID[_0x04f1('0x40')]())['where'](_0x04f1('0x45'))[_0x04f1('0x43')](_0x04f1('0x46'),squel[_0x04f1('0x3d')]()[_0x04f1('0x3e')](_0x04f1('0x24'))[_0x04f1('0x47')](_0x04f1('0x38'))[_0x04f1('0x43')](_0x88bdf0+_0x04f1('0x48'),_0x2bb394['id'][_0x04f1('0x40')]())))[_0x04f1('0x40')]();return _0xaaa321;};var _0x233abb=function(_0x6f7cc3,_0x1c0408){var _0x4099ff=squel['insert']()['into'](_0x04f1('0x38'))[_0x04f1('0x49')]([_0x04f1('0x24'),'scheduledAt',_0x04f1('0x3a'),_0x04f1('0x2b'),_0x1c0408,_0x04f1('0x3b'),'updatedAt'],squel['select']()[_0x04f1('0x3e')](_0x04f1('0x24'),_0x04f1('0x24'))['field'](_0x04f1('0x3f'),_0x04f1('0x39'))[_0x04f1('0x3e')]('id','ContactId')[_0x04f1('0x3e')](LISTID[_0x04f1('0x40')](),_0x04f1('0x2b'))[_0x04f1('0x3e')](_0x6f7cc3['id'][_0x04f1('0x40')](),_0x1c0408)[_0x04f1('0x3e')](_0x04f1('0x3f'),_0x04f1('0x3b'))[_0x04f1('0x3e')]('NOW()','updatedAt')['from'](_0x04f1('0x41'))[_0x04f1('0x43')](_0x04f1('0x42'))[_0x04f1('0x43')]('ListId\x20=\x20?',LISTID[_0x04f1('0x40')]())['where'](_0x04f1('0x4a'),squel[_0x04f1('0x4b')](hopperContacts))[_0x04f1('0x43')](_0x04f1('0x45'))[_0x04f1('0x43')](_0x04f1('0x46'),squel['select']()['field'](_0x04f1('0x4c'))['from']('cm_hopper_final')[_0x04f1('0x43')](_0x1c0408+_0x04f1('0x48'),_0x6f7cc3['id']['toString']()))[_0x04f1('0x43')](_0x04f1('0x46'),squel[_0x04f1('0x3d')]()[_0x04f1('0x3e')](_0x04f1('0x24'))[_0x04f1('0x47')]('cm_hopper')[_0x04f1('0x43')](_0x1c0408+_0x04f1('0x48'),_0x6f7cc3['id'][_0x04f1('0x40')]())))[_0x04f1('0x40')]();return _0x4099ff;};function _0xd4bdb2(_0x5e4907,_0x418c62){var _0x60916f=squel[_0x04f1('0x4d')]()[_0x04f1('0x37')](_0x04f1('0x38'))[_0x04f1('0x49')]([_0x04f1('0x24'),_0x04f1('0x39'),_0x04f1('0x3a'),_0x04f1('0x2b'),_0x418c62,'createdAt',_0x04f1('0x3c')],squel['select']()['field'](_0x04f1('0x24'),_0x04f1('0x24'))[_0x04f1('0x3e')](_0x04f1('0x3f'),_0x04f1('0x39'))[_0x04f1('0x3e')]('id',_0x04f1('0x3a'))[_0x04f1('0x3e')](LISTID['toString'](),'ListId')['field'](_0x5e4907['id'][_0x04f1('0x40')](),_0x418c62)[_0x04f1('0x3e')]('NOW()','createdAt')[_0x04f1('0x3e')](_0x04f1('0x3f'),_0x04f1('0x3c'))[_0x04f1('0x47')](_0x04f1('0x41'))['where'](_0x04f1('0x42'))[_0x04f1('0x43')](_0x04f1('0x44'),LISTID[_0x04f1('0x40')]())[_0x04f1('0x43')](_0x04f1('0x4a'),squel[_0x04f1('0x4b')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x04f1('0x40')]();return _0x60916f;}function _0x37adb7(_0x528487,_0x3e3727){var _0x224621=squel[_0x04f1('0x4d')]()['into']('cm_hopper_black')['fromQuery']([_0x04f1('0x24'),_0x04f1('0x3a'),'ListId',_0x3e3727,_0x04f1('0x3b'),_0x04f1('0x3c')],squel['select']()[_0x04f1('0x3e')]('phone',_0x04f1('0x24'))[_0x04f1('0x3e')]('id','ContactId')['field'](LISTID['toString'](),_0x04f1('0x2b'))['field'](_0x528487['id'][_0x04f1('0x40')](),_0x3e3727)[_0x04f1('0x3e')](_0x04f1('0x3f'),_0x04f1('0x3b'))[_0x04f1('0x3e')](_0x04f1('0x3f'),_0x04f1('0x3c'))[_0x04f1('0x47')]('cm_contacts')[_0x04f1('0x43')](_0x04f1('0x42'))['where'](_0x04f1('0x44'),LISTID[_0x04f1('0x40')]())['where'](_0x04f1('0x4a'),squel[_0x04f1('0x4b')](hopperContacts))[_0x04f1('0x43')](_0x04f1('0x45')))[_0x04f1('0x40')]();return _0x224621;}return db['VoiceQueue'][_0x04f1('0x4e')]({'where':{'type':_0x04f1('0x4f')},'attributes':['id',_0x04f1('0x50')],'include':[{'model':db[_0x04f1('0x51')],'as':'Lists','where':{'id':LISTID}}]})[_0x04f1('0x30')](function(_0x37c704){var _0x1221fa=[];if(_0x37c704){var _0x57e397;for(var _0x327542=0x0,_0xfcbffc;_0x327542<_0x37c704[_0x04f1('0x1c')];_0x327542+=0x1){_0xfcbffc=_0x37c704[_0x327542][_0x04f1('0x52')]({'plain':!![]});switch(_0xfcbffc[_0x04f1('0x50')]){case _0x04f1('0x53'):_0x1221fa['push'](db['sequelize'][_0x04f1('0x54')](_0x233abb(_0xfcbffc,_0x04f1('0x55')))[_0x04f1('0x30')](function(){})[_0x04f1('0x33')](_0x34f84d()));break;case _0x04f1('0x56'):_0x1221fa[_0x04f1('0x31')](db[_0x04f1('0x57')]['query'](_0xb65b9e(_0xfcbffc,_0x04f1('0x55')))[_0x04f1('0x30')](function(){})[_0x04f1('0x33')](_0x34f84d()));break;default:_0x1221fa[_0x04f1('0x31')](db[_0x04f1('0x57')]['query'](_0xd4bdb2(_0xfcbffc,'VoiceQueueId'))[_0x04f1('0x30')](function(){})[_0x04f1('0x33')](_0x34f84d()));}}}return _0x1221fa;})[_0x04f1('0x58')]()[_0x04f1('0x30')](function(){return db[_0x04f1('0x59')][_0x04f1('0x4e')]({'where':{'type':_0x04f1('0x4f')},'attributes':['id'],'include':[{'model':db[_0x04f1('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x04f1('0x30')](function(_0x5ae42e){var _0x146648=[];if(_0x5ae42e){var _0x54546a;for(var _0xaa19ab=0x0,_0x4c46e5;_0xaa19ab<_0x5ae42e[_0x04f1('0x1c')];_0xaa19ab+=0x1){_0x4c46e5=_0x5ae42e[_0xaa19ab][_0x04f1('0x52')]({'plain':!![]});_0x146648[_0x04f1('0x31')](db['sequelize']['query'](_0x37adb7(_0x4c46e5,_0x04f1('0x55')))[_0x04f1('0x30')](function(){})[_0x04f1('0x33')](_0x34f84d()));}}return _0x146648;})[_0x04f1('0x58')]();})['then'](function(){return db[_0x04f1('0x5a')][_0x04f1('0x4e')]({'attributes':['id',_0x04f1('0x50')],'include':[{'model':db[_0x04f1('0x51')],'as':_0x04f1('0x5b'),'where':{'id':LISTID}}]})[_0x04f1('0x30')](function(_0x154269){var _0x1b6d62=[];if(_0x154269){for(var _0x301160=0x0,_0x9dc04b;_0x301160<_0x154269[_0x04f1('0x1c')];_0x301160+=0x1){_0x9dc04b=_0x154269[_0x301160][_0x04f1('0x52')]({'plain':!![]});switch(_0x9dc04b[_0x04f1('0x50')]){case _0x04f1('0x53'):_0x1b6d62[_0x04f1('0x31')](db[_0x04f1('0x57')]['query'](_0x233abb(_0x9dc04b,_0x04f1('0x5c')))[_0x04f1('0x30')](function(){})[_0x04f1('0x33')](_0x34f84d()));break;case'onlyIfOpen':_0x1b6d62['push'](db[_0x04f1('0x57')][_0x04f1('0x54')](_0xb65b9e(_0x9dc04b,'CampaignId'))[_0x04f1('0x30')](function(){})['catch'](_0x34f84d()));break;default:_0x1b6d62[_0x04f1('0x31')](db[_0x04f1('0x57')][_0x04f1('0x54')](_0xd4bdb2(_0x9dc04b,'CampaignId'))[_0x04f1('0x30')](function(){})[_0x04f1('0x33')](_0x34f84d()));}}}return _0x1b6d62;})[_0x04f1('0x58')]();})[_0x04f1('0x30')](function(){return db[_0x04f1('0x5a')][_0x04f1('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x04f1('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x309108){var _0x462d90=[];if(_0x309108){for(var _0x6120a8=0x0,_0x21f9c1;_0x6120a8<_0x309108[_0x04f1('0x1c')];_0x6120a8+=0x1){_0x21f9c1=_0x309108[_0x6120a8][_0x04f1('0x52')]({'plain':!![]});_0x462d90['push'](db['sequelize']['query'](_0x37adb7(_0x21f9c1,_0x04f1('0x5c')))[_0x04f1('0x30')](function(){})[_0x04f1('0x33')](_0x34f84d()));}}return _0x462d90;})[_0x04f1('0x58')]();})[_0x04f1('0x33')](function(_0x1fcab2){logger[_0x04f1('0x16')](_0x04f1('0x5d'),'generalCheckHopper',_0x1fcab2[_0x04f1('0x1e')]);});}var processPromises=function(_0x36da84){return BPromise[_0x04f1('0x58')](promises)[_0x04f1('0x30')](function(_0x487ea8){})[_0x04f1('0x33')](function(_0x52c891){logger[_0x04f1('0x16')](_0x04f1('0x5e'),JSON[_0x04f1('0x34')](_0x52c891));})[_0x04f1('0x5f')](function(){socket[_0x04f1('0x60')](_0x04f1('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x36da84){return _0x36da84[_0x04f1('0x62')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x04f1('0x30')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x04f1('0x60')](_0x04f1('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x04f1('0x63')](FILEPATH);}catch(_0x4ab11f){logger[_0x04f1('0x16')](_0x04f1('0x64'),JSON['stringify'](_0x4ab11f));}finally{process[_0x04f1('0x65')](0x0);}});};process['on'](_0x04f1('0x66'),function(){logger[_0x04f1('0x67')](_0x04f1('0x68'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x04f1('0x13')](',');return db[_0x04f1('0x2f')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x04f1('0x30')](function(_0x1a362e){var _0x27898d=fs[_0x04f1('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x27898d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2ebc82,_0x566cec){total+=0x1;var _0x4ab035=total;promises[_0x04f1('0x31')](checkRow(_0x2ebc82,_0x1a362e,_0x4ab035)[_0x04f1('0x30')](function(){success+=0x1;})[_0x04f1('0x33')](function(_0x452239){if(_0x452239[_0x04f1('0x16')]){errors+=0x1;delete _0x452239[_0x04f1('0x16')];}else if(_0x452239[_0x04f1('0x2d')]){duplicates+=0x1;delete _0x452239[_0x04f1('0x2d')];}rows[_0x04f1('0x31')](_0x452239);}));if(total%0xc8===0x0){_0x566cec['pause']();return processPromises(_0x566cec);}},'complete':function(){return processPromises()['then'](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x146097,_0x2c8747){logger['info']('CSV\x20parse\x20error',JSON[_0x04f1('0x34')](_0x146097));endCsv();}});})[_0x04f1('0x33')](function(_0x5a2cdb){logger[_0x04f1('0x16')](_0x04f1('0x6a'),JSON[_0x04f1('0x34')](_0x5a2cdb));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index fdf3ca5..f9ff560 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 _0x5ebb=['No\x20agent\x20available','SIGINT','lodash','bluebird','squel','ioredis','../../../mysqldb','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','from','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','phone','updatedAt','priority','UserId','select','join','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_hopper_black','ListId','createdAt','fields','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','scheduledat','ContactId','recallme','field','ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','info','Received\x20SIGINT','message','exit','errors','push','code','catch','error','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','sequelize','query','spread','then','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','length','all','timezones','dialTimezone','isNil','set','offset','main','stringify','start','binding','socket_timestamp','root','server/files/tmp','.csv','includes','header',',utcOffset','parse','createReadStream','data','rows','hasOwnProperty','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','\x20not\x20specified','SystemRow','appendFileSync','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','each','finish','affectedRows','emit','contact:import:','unlink','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','map'];(function(_0x29bdeb,_0x29cbc8){var _0x5311d5=function(_0x586683){while(--_0x586683){_0x29bdeb['push'](_0x29bdeb['shift']());}};_0x5311d5(++_0x29cbc8);}(_0x5ebb,0x9a));var _0xb5eb=function(_0x1c4866,_0x255b66){_0x1c4866=_0x1c4866-0x0;var _0x4239e6=_0x5ebb[_0x1c4866];return _0x4239e6;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xb5eb('0x0'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0xb5eb('0x1'));var moment=require('moment');var squel=require(_0xb5eb('0x2'));var Redis=require(_0xb5eb('0x3'));var db=require(_0xb5eb('0x4'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0xb5eb('0x5'))('import');config[_0xb5eb('0x6')]=_[_0xb5eb('0x7')](config[_0xb5eb('0x6')],{'host':_0xb5eb('0x8'),'port':0x18eb});var socket=require(_0xb5eb('0x9'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xb5eb('0xa')](_0xb5eb('0xb'));function isEmail(_0x377bce){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x377bce);}function selectNotIn(_0x4a5141,_0x4c7982,_0x2672fc,_0x861ebd,_0x434edd){return squel['select']()['field']('phone')[_0xb5eb('0xc')](_0x861ebd)['join'](_0x4c7982,null,_0x4c7982+_0xb5eb('0xd')+_0x861ebd+'.'+_0x2672fc)['where'](_0x861ebd+'.'+_0x2672fc+_0xb5eb('0xe')+_0x4a5141+'.'+_0x2672fc)[_0xb5eb('0xf')](_0x4c7982+_0xb5eb('0x10')+_0x434edd['join']()+')');}function insertCmHopper(_0x36ed79,_0x4984e5,_0x5640fc,_0x1018db,_0x48e9d4){var _0x89dabe=[_0xb5eb('0x11'),_0xb5eb('0x12'),'cm_contacts.id',_0xb5eb('0x13'),_0x4984e5+'.'+_0x1018db,_0xb5eb('0x14'),_0xb5eb('0x15'),_0xb5eb('0x16'),'cm_contacts.UserId','\x22'+_0x48e9d4+'\x22'];return squel[_0xb5eb('0x17')]()[_0xb5eb('0x18')](_0xb5eb('0x19'))[_0xb5eb('0x1a')]([_0xb5eb('0x1b'),'scheduledat','ContactId','ListId',_0x1018db,'createdAt',_0xb5eb('0x1c'),_0xb5eb('0x1d'),_0xb5eb('0x1e'),'recallme'],squel[_0xb5eb('0x1f')]()['fields'](_0x89dabe)['from'](_0x4984e5)[_0xb5eb('0x20')](_0xb5eb('0x21'),null,'cm_contacts.ListId\x20=\x20'+_0x4984e5+_0xb5eb('0x22'))['join'](_0x5640fc,null,_0x5640fc+_0xb5eb('0xd')+_0x4984e5+'.'+_0x1018db)[_0xb5eb('0xf')](_0x4984e5+_0xb5eb('0x23'),_0x36ed79)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xb5eb('0xf')](_0xb5eb('0x24'),selectNotIn(_0x4984e5,_0x5640fc,_0x1018db,_0xb5eb('0x19'),[_0xb5eb('0x25'),_0xb5eb('0x26')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4984e5,_0x5640fc,_0x1018db,'cm_hopper',[_0xb5eb('0x25')])))[_0xb5eb('0x27')]();}function insertCmHopperBlack(_0x43d563,_0x2b5b93,_0x2e5a9b,_0x30b169){var _0x373f1a=[_0xb5eb('0x11'),_0xb5eb('0x28'),'cm_contacts.ListId',_0x2b5b93+'.'+_0x30b169,_0xb5eb('0x14'),_0xb5eb('0x15')];return squel[_0xb5eb('0x17')]()[_0xb5eb('0x18')](_0xb5eb('0x29'))[_0xb5eb('0x1a')]([_0xb5eb('0x1b'),'ContactId',_0xb5eb('0x2a'),_0x30b169,_0xb5eb('0x2b'),_0xb5eb('0x1c')],squel[_0xb5eb('0x1f')]()[_0xb5eb('0x2c')](_0x373f1a)[_0xb5eb('0xc')](_0x2b5b93)['join']('cm_contacts',null,_0xb5eb('0x2d')+_0x2b5b93+_0xb5eb('0x22'))['join'](_0x2e5a9b,null,_0x2e5a9b+_0xb5eb('0xd')+_0x2b5b93+'.'+_0x30b169)[_0xb5eb('0xf')](_0x2b5b93+'.CmListId\x20=\x20?',_0x43d563)[_0xb5eb('0xf')](_0xb5eb('0x2e'),NOW)[_0xb5eb('0xf')](_0xb5eb('0x24'),squel[_0xb5eb('0x1f')]()['field'](_0xb5eb('0x1b'))[_0xb5eb('0xc')](_0xb5eb('0x29'))[_0xb5eb('0xf')]('ListId\x20=\x20?',_0x43d563)['where'](_0x30b169+'\x20=\x20?',_0x2b5b93+'.'+_0x30b169)))[_0xb5eb('0x27')]();}function insertTzCmHopper(_0x451cfe,_0x19d6b2,_0x30ea27,_0x3ee252,_0x55568e,_0x205fdb){var _0x2c5571=[_0xb5eb('0x11'),_0xb5eb('0x2f')+_0x205fdb+'.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id',_0xb5eb('0x13'),_0x19d6b2+'.'+_0x3ee252,'cm_contacts.createdAt',_0xb5eb('0x15'),_0xb5eb('0x16'),'cm_contacts.UserId','\x22'+_0x55568e+'\x22'];var _0x2d0883=squel[_0xb5eb('0x17')]()['into'](_0xb5eb('0x19'))[_0xb5eb('0x1a')]([_0xb5eb('0x1b'),_0xb5eb('0x30'),_0xb5eb('0x31'),_0xb5eb('0x2a'),_0x3ee252,_0xb5eb('0x2b'),'updatedAt',_0xb5eb('0x1d'),_0xb5eb('0x1e'),_0xb5eb('0x32')],squel[_0xb5eb('0x1f')]()[_0xb5eb('0x2c')](_0x2c5571)[_0xb5eb('0xc')](_0x19d6b2)['join']('cm_contacts',null,_0xb5eb('0x2d')+_0x19d6b2+_0xb5eb('0x22'))[_0xb5eb('0x20')](_0x30ea27,null,_0x30ea27+_0xb5eb('0xd')+_0x19d6b2+'.'+_0x3ee252)[_0xb5eb('0x20')](_0x205fdb,null,_0x205fdb+'.id\x20=\x20'+_0x19d6b2+'.'+_0x3ee252)['where'](_0x19d6b2+_0xb5eb('0x23'),_0x451cfe)[_0xb5eb('0xf')](_0xb5eb('0x2e'),NOW)[_0xb5eb('0xf')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x19d6b2,_0x30ea27,_0x3ee252,'cm_hopper',[_0xb5eb('0x25'),_0xb5eb('0x26')]))['where'](_0xb5eb('0x24'),selectNotIn(_0x19d6b2,_0x30ea27,_0x3ee252,_0xb5eb('0x19'),[_0xb5eb('0x25')])))['toString']();return _0x2d0883;}function insertTzCmHopperBlack(_0xcf61bc,_0x527fa7,_0x5296b6,_0x2652da){var _0x464ebc=[_0xb5eb('0x11'),_0xb5eb('0x28'),_0xb5eb('0x13'),_0x527fa7+'.'+_0x2652da,'cm_contacts.createdAt',_0xb5eb('0x15')];return squel[_0xb5eb('0x17')]()['into'](_0xb5eb('0x29'))[_0xb5eb('0x1a')]([_0xb5eb('0x1b'),_0xb5eb('0x31'),_0xb5eb('0x2a'),_0x2652da,_0xb5eb('0x2b'),'updatedAt'],squel[_0xb5eb('0x1f')]()[_0xb5eb('0x2c')](_0x464ebc)[_0xb5eb('0xc')](_0x527fa7)[_0xb5eb('0x20')]('cm_contacts',null,_0xb5eb('0x2d')+_0x527fa7+_0xb5eb('0x22'))['join'](_0x5296b6,null,_0x5296b6+'.id\x20=\x20'+_0x527fa7+'.'+_0x2652da)[_0xb5eb('0xf')](_0x527fa7+_0xb5eb('0x23'),_0xcf61bc)['where'](_0xb5eb('0x2e'),NOW)['where'](_0xb5eb('0x24'),squel[_0xb5eb('0x1f')]()[_0xb5eb('0x33')](_0xb5eb('0x1b'))['from']('cm_hopper_black')[_0xb5eb('0xf')](_0xb5eb('0x34'),_0xcf61bc)[_0xb5eb('0xf')](_0x2652da+'\x20=\x20?',_0x527fa7+'.'+_0x2652da)))[_0xb5eb('0x27')]();}function insertCmContact(_0x1f9154,_0x35fe2e,_0x338669,_0x50af40){var _0x1d2dd8=_['concat'](_[_0xb5eb('0x35')](_0x50af40),[_0xb5eb('0x2a'),_0xb5eb('0x36'),'createdAt','updatedAt']);return squel[_0xb5eb('0x17')]()['into'](_0xb5eb('0x21'))[_0xb5eb('0x1a')](_0x1d2dd8,squel['select']()['fields'](_0x1d2dd8)[_0xb5eb('0xc')](_0x35fe2e)['where']('('+_0x338669[_0xb5eb('0x20')](',')+_0xb5eb('0x37'),squel[_0xb5eb('0x1f')]()[_0xb5eb('0x2c')](_0x338669)['from']('cm_contacts')[_0xb5eb('0xf')](_0xb5eb('0x34'),_0x1f9154)[_0xb5eb('0xf')](_0xb5eb('0x38')))[_0xb5eb('0xf')](_0xb5eb('0x39'),squel[_0xb5eb('0x1f')]()[_0xb5eb('0x33')](_0xb5eb('0x3a'),'min_id')['from'](_0x35fe2e)['group'](_0x338669[_0xb5eb('0x20')](','))))[_0xb5eb('0x27')]();}function handleStop(){logger[_0xb5eb('0x3b')](_0xb5eb('0x3c'));stopped=!![];}function handleUncaughtException(_0x276d14){logger['error'](_0x276d14[_0xb5eb('0x3d')]);process[_0xb5eb('0x3e')](0x1);}function handleError(_0xf95275,_0x168efb){stats[_0xb5eb('0x3f')][_0xb5eb('0x40')]({'name':_0x168efb[_0xb5eb('0x41')],'message':_0x168efb[_0xb5eb('0x3d')],'row':_0xf95275});}function handleQuery(_0x398e00){logger[_0xb5eb('0x3b')](_0x398e00);return db['sequelize']['query'](_0x398e00)['spread'](function(_0x455bce){results['push'](_0x455bce);})[_0xb5eb('0x42')](function(_0x5e2352){logger[_0xb5eb('0x43')](_0x5e2352[_0xb5eb('0x3d')]);});}function updateTzCampaigns(_0x3e50bb){return new Promise(function(_0x2899c4,_0x5323e4){var _0xae3dda=squel[_0xb5eb('0x1f')]()[_0xb5eb('0x2c')]([_0xb5eb('0x44'),'campaigns.dialTimezone'])[_0xb5eb('0xc')](_0xb5eb('0x45'))[_0xb5eb('0x20')](_0xb5eb('0x46'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0xb5eb('0xf')](_0xb5eb('0x47')+_0x3e50bb);db[_0xb5eb('0x48')][_0xb5eb('0x49')](_0xae3dda[_0xb5eb('0x27')]())[_0xb5eb('0x4a')](function(_0x4c6659){var _0x2d0f6a=[];for(var _0x5c6f1c=0x0;_0x5c6f1c<_0x4c6659['length'];_0x5c6f1c++){_0x2d0f6a['push'](getTimezoneData(_0x4c6659[_0x5c6f1c],tmp_campaigns));}BPromise['all'](_0x2d0f6a)[_0xb5eb('0x4b')](function(){_0x2899c4({'val':0x1});});})[_0xb5eb('0x42')](function(_0x55aab8){logger[_0xb5eb('0x43')](_0x55aab8['message']);_0x2899c4({'val':0x0});});});}function updateTzVoiceQueues(_0x170d10){return new Promise(function(_0x1f105d,_0x423767){var _0x2da39c=squel['select']()[_0xb5eb('0x2c')]([_0xb5eb('0x4c'),_0xb5eb('0x4d')])[_0xb5eb('0xc')](_0xb5eb('0x4e'))[_0xb5eb('0x20')]('voice_queues_has_cm_lists',null,_0xb5eb('0x4f'))[_0xb5eb('0xf')](_0xb5eb('0x50')+_0x170d10);db[_0xb5eb('0x48')][_0xb5eb('0x49')](_0x2da39c[_0xb5eb('0x27')]())[_0xb5eb('0x4a')](function(_0x548426){var _0x13621a=[];for(var _0x53c93f=0x0;_0x53c93f<_0x548426[_0xb5eb('0x51')];_0x53c93f++){_0x13621a[_0xb5eb('0x40')](getTimezoneData(_0x548426[_0x53c93f],tmp_voice_queues));}BPromise[_0xb5eb('0x52')](_0x13621a)[_0xb5eb('0x4b')](function(){_0x1f105d({'val':0x1});});})[_0xb5eb('0x42')](function(_0x10f5a9){logger[_0xb5eb('0x43')](_0x10f5a9['message']);_0x1f105d({'val':0x0});});});}function getTimezoneData(_0x554d5a,_0x235fe5){return new Promise(function(_0x5cf900,_0xe4be43){var _0x1ab329=shared[_0xb5eb('0x53')];var _0x179357=_0x1ab329[_0x554d5a[_0xb5eb('0x54')]];if(_[_0xb5eb('0x55')](_0x179357)){_0x5cf900({'ret':0x1});}else{var _0x2ed4d5=_0x179357['utcOffset'];var _0x3f8764=squel['insert']()['into'](_0x235fe5)[_0xb5eb('0x56')]('id',_0x554d5a['id'])['set'](_0xb5eb('0x57'),_0x2ed4d5)[_0xb5eb('0x56')](_0xb5eb('0x54'),_0x554d5a[_0xb5eb('0x54')])['toString']();return db['sequelize']['query'](_0x3f8764)[_0xb5eb('0x4a')](function(_0x5c811e){_0x5cf900({'ret':0x1});})[_0xb5eb('0x42')](function(_0x281162){logger['error'](_0x281162[_0xb5eb('0x3d')]);_0xe4be43({'ret':0x1});});}});}function handleTZQuery(_0x53b9fa){logger[_0xb5eb('0x3b')](_0x53b9fa);return db[_0xb5eb('0x48')]['query'](_0x53b9fa)[_0xb5eb('0x4a')](function(_0x50a694){})[_0xb5eb('0x42')](function(_0x1e6cf7){logger[_0xb5eb('0x43')](_0x1e6cf7[_0xb5eb('0x3d')]);});}function main(_0x13503f,_0x1b9284,_0x4d24d3,_0x58b380){logger[_0xb5eb('0x3b')](_0xb5eb('0x58'),_0x13503f,JSON[_0xb5eb('0x59')](_0x1b9284));process['send'](_0xb5eb('0x5a'));var _0x33fe68=_0x1b9284[_0xb5eb('0x5b')];var _0x35bf5c=_0x1b9284[_0xb5eb('0x5c')];var _0x202e39=path['join'](config[_0xb5eb('0x5d')],_0xb5eb('0x5e'),_0x35bf5c+_0xb5eb('0x5f'));hasTZ=_[_0xb5eb('0x35')](_0x33fe68)[_0xb5eb('0x60')](_0xb5eb('0x54'));var _0x64bed4=_[_0xb5eb('0x35')](_0x33fe68)[_0xb5eb('0x20')]();logger['info'](_0xb5eb('0x61'),_0x64bed4);if(hasTZ)_0x64bed4+=_0xb5eb('0x62');fs['writeFileSync'](_0x202e39,_0x64bed4+'\x0a');Papa[_0xb5eb('0x63')](fs[_0xb5eb('0x64')](_0x13503f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x50d288,_0x261451){try{for(var _0x28af7b=0x0,_0x5df8cc=[];_0x28af7b<_0x50d288[_0xb5eb('0x65')][_0xb5eb('0x51')];_0x28af7b++){stats[_0xb5eb('0x66')]+=0x1;if(_0x50d288[_0xb5eb('0x3f')][_0x28af7b]){handleError(_0x50d288[_0xb5eb('0x65')][_0x28af7b],_0x50d288['errors'][_0x28af7b]);}else{var _0x154559=[];for(var _0x295ab7 in _0x33fe68){if(_0x33fe68[_0xb5eb('0x67')](_0x295ab7)){if(_0x50d288['data'][_0x28af7b][_0x33fe68[_0x295ab7]]){var _0x3f9dc4=_['trim'](_0x50d288['data'][_0x28af7b][_0x33fe68[_0x295ab7]][_0xb5eb('0x68')](/"/g,'\x27'));switch(_0x295ab7){case _0xb5eb('0x30'):var _0x827020=moment(_0x3f9dc4,_0xb5eb('0xb'),!![]);if(_0x827020[_0xb5eb('0x69')]()){_0x5df8cc[_0xb5eb('0x40')]('\x22'+_0x3f9dc4+'\x22');}else{_0x154559['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xb5eb('0x1d'):var _0x25816b=parseInt(_0x3f9dc4);_0x3f9dc4=_[_0xb5eb('0x6a')](_0x25816b)||_0x25816b<0x0||_0x25816b>0x4?_0x58b380?0x3:0x2:_0x25816b;_0x5df8cc[_0xb5eb('0x40')]('\x22'+_0x3f9dc4+'\x22');break;case _0xb5eb('0x1e'):var _0x29751e=parseInt(_0x3f9dc4);if(_[_0xb5eb('0x6b')](_0x29751e)&&_['includes'](_0x4d24d3,_0x29751e)){_0x5df8cc[_0xb5eb('0x40')]('\x22'+_0x29751e+'\x22');}else{_0x154559['push'](_0xb5eb('0x6c'));}break;case _0xb5eb('0x6d'):if(isEmail(_0x3f9dc4)){_0x5df8cc['push']('\x22'+_0x3f9dc4+'\x22');}else{_0x154559[_0xb5eb('0x40')](_0xb5eb('0x6e'));}break;case _0xb5eb('0x6f'):var _0x1fe077=moment(_0x3f9dc4,_0xb5eb('0x70'),!![]);if(_0x1fe077['isValid']()){_0x5df8cc[_0xb5eb('0x40')]('\x22'+_0x3f9dc4+'\x22');}else{_0x154559[_0xb5eb('0x40')](_0xb5eb('0x71'));}break;case _0xb5eb('0x54'):var _0x26a475=shared['timezones'];var _0x565a92=_0x26a475[_0x3f9dc4];if(!_[_0xb5eb('0x55')](_0x565a92)){var _0x474c04=_0x565a92[_0xb5eb('0x72')];_0x5df8cc[_0xb5eb('0x40')]('\x22'+_0x3f9dc4+'\x22');_0x5df8cc[_0xb5eb('0x40')]('\x22'+_0x474c04+'\x22');}break;default:_0x5df8cc[_0xb5eb('0x40')]('\x22'+_0x3f9dc4+'\x22');}}else{switch(_0x295ab7){case _0xb5eb('0x73'):case'phone':_0x154559[_0xb5eb('0x40')](_0x295ab7+_0xb5eb('0x74'));break;default:_0x5df8cc[_0xb5eb('0x40')]('\x22\x22');}}}}if(_0x154559['length']){handleError(_0x50d288[_0xb5eb('0x65')][_0x28af7b],{'code':_0xb5eb('0x75'),'message':_0x154559[_0xb5eb('0x20')]()});}else{fs[_0xb5eb('0x76')](_0x202e39,_0x5df8cc['join']()+'\x0a');}_0x5df8cc=[];}if(!(stats[_0xb5eb('0x66')]%0xc8)){socket['emit']('contact:import:'+_0x35bf5c,stats);stats['errors']=[];}}if(stopped){logger[_0xb5eb('0x3b')](_0xb5eb('0x77'));_0x261451[_0xb5eb('0x78')]();}}catch(_0x4f176d){handleError(_0x50d288[_0xb5eb('0x65')][_0x28af7b],{'code':_0xb5eb('0x79'),'message':_0x4f176d[_0xb5eb('0x3d')]});logger[_0xb5eb('0x43')](_0xb5eb('0x7a'),_0x4f176d['message']);}},'complete':function(){try{var _0x46bdf5=[];var _0xb2e5b0=[];var _0x233abc='cm_contacts';if(_0x1b9284[_0xb5eb('0x7b')]&&_0x1b9284[_0xb5eb('0x7b')][_0xb5eb('0x51')]){_0x233abc=_0xb5eb('0x7c')+_0x35bf5c;_0x46bdf5['push'](_0xb5eb('0x7d')+_0x233abc+_0xb5eb('0x7e'));}tmp_campaigns=_0xb5eb('0x7f')+_0x35bf5c;tmp_voice_queues='voice_queues_'+_0x35bf5c;_0xb2e5b0[_0xb5eb('0x40')](_0xb5eb('0x7d')+tmp_campaigns+_0xb5eb('0x80'));_0xb2e5b0[_0xb5eb('0x40')](_0xb5eb('0x7d')+tmp_voice_queues+_0xb5eb('0x80'));BPromise['each'](_0xb2e5b0,handleTZQuery)[_0xb5eb('0x4b')](function(_0x11bda2){updateTzCampaigns(_0x1b9284[_0xb5eb('0x2a')])[_0xb5eb('0x4b')](function(_0x13c1e7){updateTzVoiceQueues(_0x1b9284[_0xb5eb('0x2a')])[_0xb5eb('0x4b')](function(_0x3a176c){var _0x5a284a=util['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',_0x202e39,_0x233abc,_0x64bed4,_0x1b9284[_0xb5eb('0x2a')],_0x1b9284[_0xb5eb('0x36')]||null,NOW,NOW);if(_[_0xb5eb('0x55')](_0x33fe68[_0xb5eb('0x30')])){_0x5a284a+=_0xb5eb('0x81');}_0x46bdf5[_0xb5eb('0x40')](_0x5a284a);if(_0x1b9284[_0xb5eb('0x7b')]&&_0x1b9284[_0xb5eb('0x7b')][_0xb5eb('0x51')]){_0x46bdf5[_0xb5eb('0x40')](insertCmContact(_0x1b9284[_0xb5eb('0x2a')],_0x233abc,_0x1b9284['duplicates'],_0x33fe68));_0x46bdf5[_0xb5eb('0x40')](_0xb5eb('0x82')+_0x233abc+';');}if(hasTZ){_0x46bdf5[_0xb5eb('0x40')](insertTzCmHopper(_0x1b9284[_0xb5eb('0x2a')],_0xb5eb('0x83'),_0xb5eb('0x4e'),'VoiceQueueId',_0x58b380,tmp_voice_queues));_0x46bdf5[_0xb5eb('0x40')](insertTzCmHopperBlack(_0x1b9284['ListId'],'voice_queues_has_cm_blacklists',_0xb5eb('0x4e'),_0xb5eb('0x84')));_0x46bdf5['push'](insertTzCmHopper(_0x1b9284['ListId'],'campaigns_has_cm_lists','campaigns',_0xb5eb('0x85'),_0x58b380,tmp_campaigns));_0x46bdf5['push'](insertTzCmHopperBlack(_0x1b9284[_0xb5eb('0x2a')],_0xb5eb('0x86'),_0xb5eb('0x45'),_0xb5eb('0x85')));}else{_0x46bdf5[_0xb5eb('0x40')](insertCmHopper(_0x1b9284[_0xb5eb('0x2a')],_0xb5eb('0x83'),_0xb5eb('0x4e'),'VoiceQueueId',_0x58b380));_0x46bdf5[_0xb5eb('0x40')](insertCmHopperBlack(_0x1b9284[_0xb5eb('0x2a')],_0xb5eb('0x87'),_0xb5eb('0x4e'),'VoiceQueueId'));_0x46bdf5['push'](insertCmHopper(_0x1b9284[_0xb5eb('0x2a')],'campaigns_has_cm_lists',_0xb5eb('0x45'),_0xb5eb('0x85'),_0x58b380));_0x46bdf5[_0xb5eb('0x40')](insertCmHopperBlack(_0x1b9284[_0xb5eb('0x2a')],_0xb5eb('0x86'),_0xb5eb('0x45'),'CampaignId'));}_0x46bdf5[_0xb5eb('0x40')](_0xb5eb('0x82')+tmp_campaigns+';');_0x46bdf5[_0xb5eb('0x40')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0xb5eb('0x88')](_0x46bdf5,handleQuery)['then'](function(_0x10ec36){stats[_0xb5eb('0x89')]=!![];stats[_0xb5eb('0x8a')]=_0x1b9284[_0xb5eb('0x7b')]&&_0x1b9284[_0xb5eb('0x7b')][_0xb5eb('0x51')]?results[0x2]['affectedRows']:results[0x0][_0xb5eb('0x8a')];socket[_0xb5eb('0x8b')](_0xb5eb('0x8c')+_0x35bf5c,stats);fs[_0xb5eb('0x8d')](_0x13503f);fs[_0xb5eb('0x8d')](_0x202e39);process[_0xb5eb('0x3e')](0x0);})[_0xb5eb('0x42')](function(_0x3284c4){logger['error'](_0x3284c4[_0xb5eb('0x3d')]);process[_0xb5eb('0x3e')](0x1);});});});});}catch(_0x3321c7){logger['error']('complete',_0x3321c7[_0xb5eb('0x3d')]);process[_0xb5eb('0x3e')](0x1);}},'error':function(_0x404855,_0x265173,_0x57e74c,_0x575795){throw new Error(_0x575795);}});}function validate(){if(process['argv']&&process[_0xb5eb('0x8e')][_0xb5eb('0x51')]<0x4){throw new Error(_0xb5eb('0x8f'));}var _0xac0bef=path[_0xb5eb('0x20')](config[_0xb5eb('0x5d')],_0xb5eb('0x5e'),process[_0xb5eb('0x8e')][0x2]);if(!fs[_0xb5eb('0x90')](_0xac0bef)){throw new Error(_0xb5eb('0x91'));}var _0x17fc75={};try{_0x17fc75=JSON['parse'](process[_0xb5eb('0x8e')][0x3]);if(!_0x17fc75[_0xb5eb('0x5b')]){throw new Error(_0xb5eb('0x92'));}if(!_0x17fc75[_0xb5eb('0x5b')][_0xb5eb('0x1b')]){throw new Error(_0xb5eb('0x93'));}if(!_0x17fc75[_0xb5eb('0x5b')][_0xb5eb('0x73')]){throw new Error(_0xb5eb('0x94'));}var _0x355ee6=0x0;if(_0x17fc75[_0xb5eb('0x5b')][_0xb5eb('0x1e')]){_0x355ee6=0x1;}if(!_0x17fc75['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x14790c){throw new Error('body\x20id\x20mandatory');}var _0x29a7e4=[];try{_0x29a7e4=_[_0xb5eb('0x95')](JSON['parse'](process[_0xb5eb('0x8e')][0x4]),'id');}catch(_0x52707c){logger[_0xb5eb('0x3b')](_0xb5eb('0x96'));}main(_0xac0bef,_0x17fc75,_0x29a7e4,_0x355ee6);}validate();process['on'](_0xb5eb('0x97'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x54aa=['.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_hopper_black','fromQuery','ContactId','select','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','recallme','concat','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','exit','errors','push','code','sequelize','query','spread','catch','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','then','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','all','dialTimezone','isNil','utcOffset','set','offset','stringify','send','start','binding','root','server/files/tmp','.csv','includes',',utcOffset','writeFileSync','createReadStream','data','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','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','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x54aa,0x199));var _0xa54a=function(_0x3d4498,_0x3b6416){_0x3d4498=_0x3d4498-0x0;var _0x529459=_0x54aa[_0x3d4498];return _0x529459;};'use strict';var fs=require('fs');var path=require(_0xa54a('0x0'));var _=require(_0xa54a('0x1'));var Papa=require('papaparse');var util=require(_0xa54a('0x2'));var BPromise=require(_0xa54a('0x3'));var moment=require(_0xa54a('0x4'));var squel=require(_0xa54a('0x5'));var Redis=require(_0xa54a('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0xa54a('0x7'));var shared=require(_0xa54a('0x8'));var logger=require('../../../config/logger')(_0xa54a('0x9'));config[_0xa54a('0xa')]=_[_0xa54a('0xb')](config[_0xa54a('0xa')],{'host':_0xa54a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa54a('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xa54a('0xd'));function isEmail(_0x207edf){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x207edf);}function selectNotIn(_0x110ea5,_0x2d8325,_0x10fe85,_0x597110,_0xa1fc24){return squel['select']()[_0xa54a('0xe')](_0xa54a('0xf'))[_0xa54a('0x10')](_0x597110)[_0xa54a('0x11')](_0x2d8325,null,_0x2d8325+_0xa54a('0x12')+_0x597110+'.'+_0x10fe85)[_0xa54a('0x13')](_0x597110+'.'+_0x10fe85+_0xa54a('0x14')+_0x110ea5+'.'+_0x10fe85)['where'](_0x2d8325+'.dialCheckDuplicateType\x20IN\x20('+_0xa1fc24[_0xa54a('0x11')]()+')');}function insertCmHopper(_0x35c5cf,_0x133170,_0xd8a712,_0x462ef4,_0x113b9b){var _0xab8e3b=['cm_contacts.phone',_0xa54a('0x15'),_0xa54a('0x16'),_0xa54a('0x17'),_0x133170+'.'+_0x462ef4,_0xa54a('0x18'),_0xa54a('0x19'),_0xa54a('0x1a'),_0xa54a('0x1b'),'\x22'+_0x113b9b+'\x22'];return squel[_0xa54a('0x1c')]()[_0xa54a('0x1d')](_0xa54a('0x1e'))['fromQuery']([_0xa54a('0xf'),_0xa54a('0x1f'),'ContactId',_0xa54a('0x20'),_0x462ef4,_0xa54a('0x21'),_0xa54a('0x22'),_0xa54a('0x23'),_0xa54a('0x24'),'recallme'],squel['select']()[_0xa54a('0x25')](_0xab8e3b)[_0xa54a('0x10')](_0x133170)[_0xa54a('0x11')](_0xa54a('0x26'),null,_0xa54a('0x27')+_0x133170+_0xa54a('0x28'))['join'](_0xd8a712,null,_0xd8a712+_0xa54a('0x12')+_0x133170+'.'+_0x462ef4)[_0xa54a('0x13')](_0x133170+_0xa54a('0x29'),_0x35c5cf)[_0xa54a('0x13')](_0xa54a('0x2a'),NOW)['where'](_0xa54a('0x2b'),selectNotIn(_0x133170,_0xd8a712,_0x462ef4,_0xa54a('0x1e'),[_0xa54a('0x2c'),_0xa54a('0x2d')]))[_0xa54a('0x13')](_0xa54a('0x2b'),selectNotIn(_0x133170,_0xd8a712,_0x462ef4,_0xa54a('0x1e'),[_0xa54a('0x2c')])))[_0xa54a('0x2e')]();}function insertCmHopperBlack(_0x20b305,_0x2f48db,_0x15314d,_0xff7357){var _0x106af2=[_0xa54a('0x2f'),'cm_contacts.id',_0xa54a('0x17'),_0x2f48db+'.'+_0xff7357,_0xa54a('0x18'),'cm_contacts.updatedAt'];return squel[_0xa54a('0x1c')]()[_0xa54a('0x1d')](_0xa54a('0x30'))[_0xa54a('0x31')](['phone',_0xa54a('0x32'),_0xa54a('0x20'),_0xff7357,_0xa54a('0x21'),_0xa54a('0x22')],squel[_0xa54a('0x33')]()[_0xa54a('0x25')](_0x106af2)[_0xa54a('0x10')](_0x2f48db)[_0xa54a('0x11')](_0xa54a('0x26'),null,_0xa54a('0x27')+_0x2f48db+'.CmListId')[_0xa54a('0x11')](_0x15314d,null,_0x15314d+_0xa54a('0x12')+_0x2f48db+'.'+_0xff7357)[_0xa54a('0x13')](_0x2f48db+'.CmListId\x20=\x20?',_0x20b305)[_0xa54a('0x13')](_0xa54a('0x2a'),NOW)[_0xa54a('0x13')](_0xa54a('0x2b'),squel[_0xa54a('0x33')]()[_0xa54a('0xe')]('phone')[_0xa54a('0x10')](_0xa54a('0x30'))[_0xa54a('0x13')](_0xa54a('0x34'),_0x20b305)[_0xa54a('0x13')](_0xff7357+_0xa54a('0x35'),_0x2f48db+'.'+_0xff7357)))['toString']();}function insertTzCmHopper(_0x832ec3,_0x4a6a24,_0x442a20,_0x17c453,_0x4391c4,_0x6340bf){var _0x25650e=[_0xa54a('0x2f'),_0xa54a('0x36')+_0x6340bf+_0xa54a('0x37'),_0xa54a('0x16'),_0xa54a('0x17'),_0x4a6a24+'.'+_0x17c453,'cm_contacts.createdAt',_0xa54a('0x19'),_0xa54a('0x1a'),_0xa54a('0x1b'),'\x22'+_0x4391c4+'\x22'];var _0xcb84d7=squel[_0xa54a('0x1c')]()[_0xa54a('0x1d')](_0xa54a('0x1e'))[_0xa54a('0x31')]([_0xa54a('0xf'),_0xa54a('0x1f'),_0xa54a('0x32'),_0xa54a('0x20'),_0x17c453,_0xa54a('0x21'),_0xa54a('0x22'),_0xa54a('0x23'),_0xa54a('0x24'),_0xa54a('0x38')],squel[_0xa54a('0x33')]()[_0xa54a('0x25')](_0x25650e)[_0xa54a('0x10')](_0x4a6a24)[_0xa54a('0x11')](_0xa54a('0x26'),null,_0xa54a('0x27')+_0x4a6a24+'.CmListId')[_0xa54a('0x11')](_0x442a20,null,_0x442a20+'.id\x20=\x20'+_0x4a6a24+'.'+_0x17c453)['join'](_0x6340bf,null,_0x6340bf+_0xa54a('0x12')+_0x4a6a24+'.'+_0x17c453)['where'](_0x4a6a24+_0xa54a('0x29'),_0x832ec3)[_0xa54a('0x13')](_0xa54a('0x2a'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4a6a24,_0x442a20,_0x17c453,_0xa54a('0x1e'),[_0xa54a('0x2c'),_0xa54a('0x2d')]))[_0xa54a('0x13')](_0xa54a('0x2b'),selectNotIn(_0x4a6a24,_0x442a20,_0x17c453,_0xa54a('0x1e'),['\x22always\x22'])))[_0xa54a('0x2e')]();return _0xcb84d7;}function insertTzCmHopperBlack(_0x33d746,_0x5d5246,_0x564e91,_0x234e41){var _0x559a31=[_0xa54a('0x2f'),_0xa54a('0x16'),_0xa54a('0x17'),_0x5d5246+'.'+_0x234e41,_0xa54a('0x18'),_0xa54a('0x19')];return squel[_0xa54a('0x1c')]()['into'](_0xa54a('0x30'))[_0xa54a('0x31')]([_0xa54a('0xf'),_0xa54a('0x32'),_0xa54a('0x20'),_0x234e41,_0xa54a('0x21'),_0xa54a('0x22')],squel['select']()[_0xa54a('0x25')](_0x559a31)[_0xa54a('0x10')](_0x5d5246)[_0xa54a('0x11')](_0xa54a('0x26'),null,_0xa54a('0x27')+_0x5d5246+'.CmListId')[_0xa54a('0x11')](_0x564e91,null,_0x564e91+_0xa54a('0x12')+_0x5d5246+'.'+_0x234e41)[_0xa54a('0x13')](_0x5d5246+'.CmListId\x20=\x20?',_0x33d746)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xa54a('0x13')](_0xa54a('0x2b'),squel[_0xa54a('0x33')]()[_0xa54a('0xe')](_0xa54a('0xf'))[_0xa54a('0x10')](_0xa54a('0x30'))['where']('ListId\x20=\x20?',_0x33d746)['where'](_0x234e41+_0xa54a('0x35'),_0x5d5246+'.'+_0x234e41)))[_0xa54a('0x2e')]();}function insertCmContact(_0x589d1d,_0x1a14a1,_0x2f2b50,_0x4ec833){var _0x251751=_[_0xa54a('0x39')](_['keys'](_0x4ec833),[_0xa54a('0x20'),_0xa54a('0x3a'),_0xa54a('0x21'),_0xa54a('0x22')]);return squel[_0xa54a('0x1c')]()['into'](_0xa54a('0x26'))[_0xa54a('0x31')](_0x251751,squel[_0xa54a('0x33')]()[_0xa54a('0x25')](_0x251751)[_0xa54a('0x10')](_0x1a14a1)[_0xa54a('0x13')]('('+_0x2f2b50[_0xa54a('0x11')](',')+_0xa54a('0x3b'),squel[_0xa54a('0x33')]()['fields'](_0x2f2b50)[_0xa54a('0x10')](_0xa54a('0x26'))[_0xa54a('0x13')]('ListId\x20=\x20?',_0x589d1d)[_0xa54a('0x13')](_0xa54a('0x3c')))[_0xa54a('0x13')](_0xa54a('0x3d'),squel[_0xa54a('0x33')]()['field'](_0xa54a('0x3e'),_0xa54a('0x3f'))['from'](_0x1a14a1)[_0xa54a('0x40')](_0x2f2b50[_0xa54a('0x11')](','))))[_0xa54a('0x2e')]();}function handleStop(){logger[_0xa54a('0x41')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x299a27){logger[_0xa54a('0x42')](_0x299a27[_0xa54a('0x43')]);process[_0xa54a('0x44')](0x1);}function handleError(_0x190a6f,_0x14e3d6){stats[_0xa54a('0x45')][_0xa54a('0x46')]({'name':_0x14e3d6[_0xa54a('0x47')],'message':_0x14e3d6[_0xa54a('0x43')],'row':_0x190a6f});}function handleQuery(_0x14288d){logger[_0xa54a('0x41')](_0x14288d);return db[_0xa54a('0x48')][_0xa54a('0x49')](_0x14288d)[_0xa54a('0x4a')](function(_0xaaf869){results[_0xa54a('0x46')](_0xaaf869);})[_0xa54a('0x4b')](function(_0x1c4c3e){logger['error'](_0x1c4c3e[_0xa54a('0x43')]);});}function updateTzCampaigns(_0x31d335){return new Promise(function(_0x30b1d0,_0x429904){var _0x5754ac=squel['select']()[_0xa54a('0x25')](['campaigns.id',_0xa54a('0x4c')])['from'](_0xa54a('0x4d'))[_0xa54a('0x11')]('campaigns_has_cm_lists',null,_0xa54a('0x4e'))[_0xa54a('0x13')](_0xa54a('0x4f')+_0x31d335);db['sequelize']['query'](_0x5754ac[_0xa54a('0x2e')]())[_0xa54a('0x4a')](function(_0x112318){var _0x4086b4=[];for(var _0x3d6b58=0x0;_0x3d6b58<_0x112318[_0xa54a('0x50')];_0x3d6b58++){_0x4086b4[_0xa54a('0x46')](getTimezoneData(_0x112318[_0x3d6b58],tmp_campaigns));}BPromise['all'](_0x4086b4)[_0xa54a('0x51')](function(){_0x30b1d0({'val':0x1});});})[_0xa54a('0x4b')](function(_0x33c623){logger[_0xa54a('0x42')](_0x33c623['message']);_0x30b1d0({'val':0x0});});});}function updateTzVoiceQueues(_0x48065c){return new Promise(function(_0xb36577,_0x1519b1){var _0x5cbba4=squel['select']()[_0xa54a('0x25')]([_0xa54a('0x52'),_0xa54a('0x53')])[_0xa54a('0x10')]('voice_queues')['join'](_0xa54a('0x54'),null,_0xa54a('0x55'))[_0xa54a('0x13')](_0xa54a('0x56')+_0x48065c);db[_0xa54a('0x48')][_0xa54a('0x49')](_0x5cbba4[_0xa54a('0x2e')]())[_0xa54a('0x4a')](function(_0x1fe8d5){var _0xffb279=[];for(var _0x5bdd87=0x0;_0x5bdd87<_0x1fe8d5['length'];_0x5bdd87++){_0xffb279[_0xa54a('0x46')](getTimezoneData(_0x1fe8d5[_0x5bdd87],tmp_voice_queues));}BPromise[_0xa54a('0x57')](_0xffb279)[_0xa54a('0x51')](function(){_0xb36577({'val':0x1});});})[_0xa54a('0x4b')](function(_0x2c9324){logger[_0xa54a('0x42')](_0x2c9324[_0xa54a('0x43')]);_0xb36577({'val':0x0});});});}function getTimezoneData(_0x149b34,_0x4061a4){return new Promise(function(_0x4f6dfe,_0x4c381c){var _0x30cf2b=shared['timezones'];var _0x20b4a5=_0x30cf2b[_0x149b34[_0xa54a('0x58')]];if(_[_0xa54a('0x59')](_0x20b4a5)){_0x4f6dfe({'ret':0x1});}else{var _0x4f5753=_0x20b4a5[_0xa54a('0x5a')];var _0x502bb2=squel[_0xa54a('0x1c')]()[_0xa54a('0x1d')](_0x4061a4)[_0xa54a('0x5b')]('id',_0x149b34['id'])['set'](_0xa54a('0x5c'),_0x4f5753)[_0xa54a('0x5b')](_0xa54a('0x58'),_0x149b34[_0xa54a('0x58')])[_0xa54a('0x2e')]();return db[_0xa54a('0x48')][_0xa54a('0x49')](_0x502bb2)[_0xa54a('0x4a')](function(_0x2e94c4){_0x4f6dfe({'ret':0x1});})[_0xa54a('0x4b')](function(_0x34b760){logger[_0xa54a('0x42')](_0x34b760[_0xa54a('0x43')]);_0x4c381c({'ret':0x1});});}});}function handleTZQuery(_0x18d531){logger[_0xa54a('0x41')](_0x18d531);return db['sequelize'][_0xa54a('0x49')](_0x18d531)[_0xa54a('0x4a')](function(_0x791e7b){})[_0xa54a('0x4b')](function(_0x5ebb2d){logger[_0xa54a('0x42')](_0x5ebb2d[_0xa54a('0x43')]);});}function main(_0x4d6999,_0x4c5ab8,_0x45d6ed,_0x46490a){logger['info']('main',_0x4d6999,JSON[_0xa54a('0x5d')](_0x4c5ab8));process[_0xa54a('0x5e')](_0xa54a('0x5f'));var _0x59b38c=_0x4c5ab8[_0xa54a('0x60')];var _0x36aa9c=_0x4c5ab8['socket_timestamp'];var _0x568a47=path[_0xa54a('0x11')](config[_0xa54a('0x61')],_0xa54a('0x62'),_0x36aa9c+_0xa54a('0x63'));hasTZ=_['keys'](_0x59b38c)[_0xa54a('0x64')](_0xa54a('0x58'));var _0x4f6b5f=_['keys'](_0x59b38c)[_0xa54a('0x11')]();logger[_0xa54a('0x41')]('header',_0x4f6b5f);if(hasTZ)_0x4f6b5f+=_0xa54a('0x65');fs[_0xa54a('0x66')](_0x568a47,_0x4f6b5f+'\x0a');Papa['parse'](fs[_0xa54a('0x67')](_0x4d6999),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1f948b,_0x37cd68){try{for(var _0x322cef=0x0,_0x56b767=[];_0x322cef<_0x1f948b[_0xa54a('0x68')][_0xa54a('0x50')];_0x322cef++){stats['rows']+=0x1;if(_0x1f948b[_0xa54a('0x45')][_0x322cef]){handleError(_0x1f948b[_0xa54a('0x68')][_0x322cef],_0x1f948b[_0xa54a('0x45')][_0x322cef]);}else{var _0x897d8d=[];for(var _0x104df7 in _0x59b38c){if(_0x59b38c[_0xa54a('0x69')](_0x104df7)){if(_0x1f948b[_0xa54a('0x68')][_0x322cef][_0x59b38c[_0x104df7]]){var _0x184d0c=_[_0xa54a('0x6a')](_0x1f948b[_0xa54a('0x68')][_0x322cef][_0x59b38c[_0x104df7]]['replace'](/"/g,'\x27'));switch(_0x104df7){case'scheduledat':var _0x18a047=moment(_0x184d0c,_0xa54a('0xd'),!![]);if(_0x18a047[_0xa54a('0x6b')]()){_0x56b767[_0xa54a('0x46')]('\x22'+_0x184d0c+'\x22');}else{_0x897d8d[_0xa54a('0x46')](_0xa54a('0x6c'));}break;case _0xa54a('0x23'):var _0x336ef5=parseInt(_0x184d0c);_0x184d0c=_[_0xa54a('0x6d')](_0x336ef5)||_0x336ef5<0x0||_0x336ef5>0x4?_0x46490a?0x3:0x2:_0x336ef5;_0x56b767[_0xa54a('0x46')]('\x22'+_0x184d0c+'\x22');break;case _0xa54a('0x24'):var _0x550a70=parseInt(_0x184d0c);if(_['isNumber'](_0x550a70)&&_[_0xa54a('0x64')](_0x45d6ed,_0x550a70)){_0x56b767[_0xa54a('0x46')]('\x22'+_0x550a70+'\x22');}else{_0x897d8d[_0xa54a('0x46')](_0xa54a('0x6e'));}break;case _0xa54a('0x6f'):if(isEmail(_0x184d0c)){_0x56b767[_0xa54a('0x46')]('\x22'+_0x184d0c+'\x22');}else{_0x897d8d[_0xa54a('0x46')](_0xa54a('0x70'));}break;case'dateOfBirth':var _0x23c696=moment(_0x184d0c,_0xa54a('0x71'),!![]);if(_0x23c696[_0xa54a('0x6b')]()){_0x56b767[_0xa54a('0x46')]('\x22'+_0x184d0c+'\x22');}else{_0x897d8d[_0xa54a('0x46')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xa54a('0x58'):var _0x5010ee=shared['timezones'];var _0x58506d=_0x5010ee[_0x184d0c];if(!_[_0xa54a('0x59')](_0x58506d)){var _0x38eec1=_0x58506d[_0xa54a('0x5a')];_0x56b767['push']('\x22'+_0x184d0c+'\x22');_0x56b767[_0xa54a('0x46')]('\x22'+_0x38eec1+'\x22');}break;default:_0x56b767[_0xa54a('0x46')]('\x22'+_0x184d0c+'\x22');}}else{switch(_0x104df7){case'firstName':case _0xa54a('0xf'):_0x897d8d[_0xa54a('0x46')](_0x104df7+'\x20not\x20specified');break;default:_0x56b767[_0xa54a('0x46')]('\x22\x22');}}}}if(_0x897d8d[_0xa54a('0x50')]){handleError(_0x1f948b['data'][_0x322cef],{'code':_0xa54a('0x72'),'message':_0x897d8d[_0xa54a('0x11')]()});}else{fs[_0xa54a('0x73')](_0x568a47,_0x56b767[_0xa54a('0x11')]()+'\x0a');}_0x56b767=[];}if(!(stats['rows']%0xc8)){socket[_0xa54a('0x74')](_0xa54a('0x75')+_0x36aa9c,stats);stats[_0xa54a('0x45')]=[];}}if(stopped){logger['info'](_0xa54a('0x76'));_0x37cd68[_0xa54a('0x77')]();}}catch(_0x57e8f0){handleError(_0x1f948b[_0xa54a('0x68')][_0x322cef],{'code':'SystemError','message':_0x57e8f0[_0xa54a('0x43')]});logger['error']('step',_0x57e8f0[_0xa54a('0x43')]);}},'complete':function(){try{var _0x88eed5=[];var _0x1c1c43=[];var _0x4d7672=_0xa54a('0x26');if(_0x4c5ab8['duplicates']&&_0x4c5ab8[_0xa54a('0x78')][_0xa54a('0x50')]){_0x4d7672=_0xa54a('0x79')+_0x36aa9c;_0x88eed5[_0xa54a('0x46')]('CREATE\x20TABLE\x20'+_0x4d7672+_0xa54a('0x7a'));}tmp_campaigns='campaigns_'+_0x36aa9c;tmp_voice_queues='voice_queues_'+_0x36aa9c;_0x1c1c43[_0xa54a('0x46')](_0xa54a('0x7b')+tmp_campaigns+_0xa54a('0x7c'));_0x1c1c43[_0xa54a('0x46')](_0xa54a('0x7b')+tmp_voice_queues+_0xa54a('0x7c'));BPromise[_0xa54a('0x7d')](_0x1c1c43,handleTZQuery)[_0xa54a('0x51')](function(_0x3abb9b){updateTzCampaigns(_0x4c5ab8[_0xa54a('0x20')])[_0xa54a('0x51')](function(_0xd90081){updateTzVoiceQueues(_0x4c5ab8['ListId'])['then'](function(_0x5c4c53){var _0x3740b8=util['format'](_0xa54a('0x7e'),_0x568a47,_0x4d7672,_0x4f6b5f,_0x4c5ab8[_0xa54a('0x20')],_0x4c5ab8['CompanyId']||null,NOW,NOW);if(_[_0xa54a('0x59')](_0x59b38c[_0xa54a('0x1f')])){_0x3740b8+=',\x20scheduledAt\x20=\x20NOW()';}_0x88eed5['push'](_0x3740b8);if(_0x4c5ab8[_0xa54a('0x78')]&&_0x4c5ab8[_0xa54a('0x78')][_0xa54a('0x50')]){_0x88eed5['push'](insertCmContact(_0x4c5ab8[_0xa54a('0x20')],_0x4d7672,_0x4c5ab8['duplicates'],_0x59b38c));_0x88eed5['push']('DROP\x20TABLE\x20'+_0x4d7672+';');}if(hasTZ){_0x88eed5[_0xa54a('0x46')](insertTzCmHopper(_0x4c5ab8[_0xa54a('0x20')],_0xa54a('0x54'),_0xa54a('0x7f'),_0xa54a('0x80'),_0x46490a,tmp_voice_queues));_0x88eed5[_0xa54a('0x46')](insertTzCmHopperBlack(_0x4c5ab8[_0xa54a('0x20')],_0xa54a('0x81'),_0xa54a('0x7f'),_0xa54a('0x80')));_0x88eed5[_0xa54a('0x46')](insertTzCmHopper(_0x4c5ab8['ListId'],_0xa54a('0x82'),_0xa54a('0x4d'),_0xa54a('0x83'),_0x46490a,tmp_campaigns));_0x88eed5[_0xa54a('0x46')](insertTzCmHopperBlack(_0x4c5ab8[_0xa54a('0x20')],_0xa54a('0x84'),_0xa54a('0x4d'),_0xa54a('0x83')));}else{_0x88eed5[_0xa54a('0x46')](insertCmHopper(_0x4c5ab8[_0xa54a('0x20')],_0xa54a('0x54'),_0xa54a('0x7f'),_0xa54a('0x80'),_0x46490a));_0x88eed5[_0xa54a('0x46')](insertCmHopperBlack(_0x4c5ab8[_0xa54a('0x20')],_0xa54a('0x81'),_0xa54a('0x7f'),'VoiceQueueId'));_0x88eed5[_0xa54a('0x46')](insertCmHopper(_0x4c5ab8[_0xa54a('0x20')],_0xa54a('0x82'),_0xa54a('0x4d'),_0xa54a('0x83'),_0x46490a));_0x88eed5[_0xa54a('0x46')](insertCmHopperBlack(_0x4c5ab8[_0xa54a('0x20')],_0xa54a('0x84'),_0xa54a('0x4d'),_0xa54a('0x83')));}_0x88eed5['push'](_0xa54a('0x85')+tmp_campaigns+';');_0x88eed5[_0xa54a('0x46')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0xa54a('0x7d')](_0x88eed5,handleQuery)[_0xa54a('0x51')](function(_0x3c25ce){stats['finish']=!![];stats[_0xa54a('0x86')]=_0x4c5ab8[_0xa54a('0x78')]&&_0x4c5ab8[_0xa54a('0x78')]['length']?results[0x2][_0xa54a('0x86')]:results[0x0]['affectedRows'];socket['emit'](_0xa54a('0x75')+_0x36aa9c,stats);fs[_0xa54a('0x87')](_0x4d6999);fs['unlink'](_0x568a47);process[_0xa54a('0x44')](0x0);})['catch'](function(_0x5f2c89){logger['error'](_0x5f2c89[_0xa54a('0x43')]);process[_0xa54a('0x44')](0x1);});});});});}catch(_0x22ec27){logger[_0xa54a('0x42')](_0xa54a('0x88'),_0x22ec27[_0xa54a('0x43')]);process[_0xa54a('0x44')](0x1);}},'error':function(_0x433f5e,_0xc46ad8,_0xc19db0,_0x5033f8){throw new Error(_0x5033f8);}});}function validate(){if(process[_0xa54a('0x89')]&&process[_0xa54a('0x89')][_0xa54a('0x50')]<0x4){throw new Error(_0xa54a('0x8a'));}var _0x36bacf=path[_0xa54a('0x11')](config[_0xa54a('0x61')],_0xa54a('0x62'),process[_0xa54a('0x89')][0x2]);if(!fs[_0xa54a('0x8b')](_0x36bacf)){throw new Error(_0xa54a('0x8c'));}var _0x860aed={};try{_0x860aed=JSON['parse'](process[_0xa54a('0x89')][0x3]);if(!_0x860aed[_0xa54a('0x60')]){throw new Error(_0xa54a('0x8d'));}if(!_0x860aed[_0xa54a('0x60')][_0xa54a('0xf')]){throw new Error(_0xa54a('0x8e'));}if(!_0x860aed[_0xa54a('0x60')][_0xa54a('0x8f')]){throw new Error('firstName\x20is\x20mandatory');}var _0x394080=0x0;if(_0x860aed['binding'][_0xa54a('0x24')]){_0x394080=0x1;}if(!_0x860aed[_0xa54a('0x20')]){throw new Error(_0xa54a('0x90'));}}catch(_0x2cf368){throw new Error(_0xa54a('0x91'));}var _0xf58a38=[];try{_0xf58a38=_[_0xa54a('0x92')](JSON[_0xa54a('0x93')](process[_0xa54a('0x89')][0x4]),'id');}catch(_0x2829a1){logger[_0xa54a('0x41')](_0xa54a('0x94'));}main(_0x36bacf,_0x860aed,_0xf58a38,_0x394080);}validate();process['on']('SIGINT',handleStop);process['on'](_0xa54a('0x95'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index afff142..66795e5 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 _0x4d28=['Outbound\x20Call','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','Hold\x20Time','talktime','membername','answertime','Complete\x20Time','endtime','Duration','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound'];(function(_0x1ac8d8,_0x1fb4f5){var _0x4a3a82=function(_0xfb4eea){while(--_0xfb4eea){_0x1ac8d8['push'](_0x1ac8d8['shift']());}};_0x4a3a82(++_0x1fb4f5);}(_0x4d28,0x100));var _0x84d2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4d28[_0xfae23b];return _0x200640;};'use strict';exports['getSubjects']=function(_0x162fd0,_0xf19798){var _0x4d0a5c=[{'type':_0x84d2('0x0'),'content':_0x84d2('0x1'),'variableName':null}];switch(_0x162fd0[_0x84d2('0x2')]()){case _0x84d2('0x3'):switch(_0xf19798[_0x84d2('0x2')]()){case _0x84d2('0x4'):_0x4d0a5c[_0x84d2('0x5')]({'type':_0x84d2('0x6'),'content':'','variableName':_0x84d2('0x7')});_0x4d0a5c[_0x84d2('0x5')]({'type':'variable','content':'','variableName':_0x84d2('0x8')});break;case _0x84d2('0x9'):_0x4d0a5c[_0x84d2('0x5')]({'type':_0x84d2('0x0'),'content':_0x84d2('0xa'),'variableName':null});_0x4d0a5c[_0x84d2('0x5')]({'type':_0x84d2('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x4d0a5c;};exports['getDescriptions']=function(_0x5080b6,_0x79c801){var _0x47dab5=[];switch(_0x5080b6[_0x84d2('0x2')]()){case'voice':switch(_0x79c801[_0x84d2('0x2')]()){case'inbound':_0x47dab5=[{'type':_0x84d2('0x0'),'content':_0x84d2('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x84d2('0xc'),'content':'','key':'Caller\x20Number','keyType':_0x84d2('0x6'),'variableName':'calleridnum'},{'type':_0x84d2('0xc'),'content':'','key':_0x84d2('0xd'),'keyType':_0x84d2('0x6'),'variableName':_0x84d2('0xe')},{'type':'keyValue','content':'','key':_0x84d2('0xf'),'keyType':_0x84d2('0x6'),'variableName':_0x84d2('0x10')},{'type':'keyValue','content':'','key':_0x84d2('0x11'),'keyType':_0x84d2('0x6'),'variableName':_0x84d2('0x7')},{'type':_0x84d2('0xc'),'content':'','key':_0x84d2('0x12'),'keyType':_0x84d2('0x6'),'variableName':_0x84d2('0x13')},{'type':_0x84d2('0xc'),'content':'','key':_0x84d2('0x14'),'keyType':_0x84d2('0x6'),'variableName':_0x84d2('0x15')},{'type':_0x84d2('0x0'),'content':_0x84d2('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x84d2('0x17'),'keyType':_0x84d2('0x6'),'variableName':_0x84d2('0x18')},{'type':_0x84d2('0xc'),'content':'','key':_0x84d2('0x19'),'keyType':_0x84d2('0x6'),'variableName':_0x84d2('0x1a')},{'type':_0x84d2('0x0'),'content':_0x84d2('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':_0x84d2('0xc'),'content':'','key':_0x84d2('0x1c'),'keyType':_0x84d2('0x6'),'variableName':'agentcalledAt'},{'type':_0x84d2('0xc'),'content':'','key':'Agent\x20Connect','keyType':_0x84d2('0x6'),'variableName':_0x84d2('0x1d')},{'type':_0x84d2('0xc'),'content':'','key':_0x84d2('0x1e'),'keyType':_0x84d2('0x6'),'variableName':'agentcompleteAt'},{'type':_0x84d2('0xc'),'content':'','key':_0x84d2('0x1f'),'keyType':'variable','variableName':'holdtime'},{'type':_0x84d2('0xc'),'content':'','key':'Talk\x20Time','keyType':_0x84d2('0x6'),'variableName':_0x84d2('0x20')}];break;case _0x84d2('0x9'):_0x47dab5=[{'type':_0x84d2('0x0'),'content':_0x84d2('0xb'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0x84d2('0x6'),'keyContent':'','variableName':_0x84d2('0x1a')},{'type':_0x84d2('0xc'),'content':'','key':'Member\x20Name','keyType':_0x84d2('0x6'),'keyContent':'','variableName':_0x84d2('0x21')},{'type':'keyValue','content':'','key':'UniqueId','keyType':'variable','keyContent':'','variableName':_0x84d2('0x13')},{'type':_0x84d2('0xc'),'content':'','key':'Date','keyType':_0x84d2('0x6'),'keyContent':'','variableName':'starttime'},{'type':_0x84d2('0x0'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x84d2('0xc'),'content':'','key':'Answer\x20Time','keyType':_0x84d2('0x6'),'keyContent':'','variableName':_0x84d2('0x22')},{'type':_0x84d2('0xc'),'content':'','key':_0x84d2('0x23'),'keyType':_0x84d2('0x6'),'keyContent':'','variableName':_0x84d2('0x24')},{'type':_0x84d2('0xc'),'content':'','key':_0x84d2('0x25'),'keyType':_0x84d2('0x6'),'keyContent':'','variableName':'duration'},{'type':_0x84d2('0xc'),'content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x47dab5;}; \ No newline at end of file +var _0x8af7=['billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','calleridnum','calleridname','Call\x20To','destexten','keyValue','Queue','UniqueId','***\x20Agent\x20Info\x20***','***\x20Time\x20Info\x20***','agentcalledAt','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration'];(function(_0x625bb,_0x3e6265){var _0x483d68=function(_0x5eddda){while(--_0x5eddda){_0x625bb['push'](_0x625bb['shift']());}};_0x483d68(++_0x3e6265);}(_0x8af7,0x120));var _0x78af=function(_0xaf8d3e,_0x2c2619){_0xaf8d3e=_0xaf8d3e-0x0;var _0x5438fc=_0x8af7[_0xaf8d3e];return _0x5438fc;};'use strict';exports['getSubjects']=function(_0x457f5f,_0x3dff11){var _0x3a9387=[{'type':_0x78af('0x0'),'content':_0x78af('0x1'),'variableName':null}];switch(_0x457f5f[_0x78af('0x2')]()){case _0x78af('0x3'):switch(_0x3dff11['toLowerCase']()){case'inbound':_0x3a9387[_0x78af('0x4')]({'type':_0x78af('0x5'),'content':'','variableName':_0x78af('0x6')});_0x3a9387[_0x78af('0x4')]({'type':_0x78af('0x5'),'content':'','variableName':'calleridnum'});break;case _0x78af('0x7'):_0x3a9387[_0x78af('0x4')]({'type':_0x78af('0x0'),'content':_0x78af('0x8'),'variableName':null});_0x3a9387[_0x78af('0x4')]({'type':_0x78af('0x5'),'content':'','variableName':_0x78af('0x9')});break;}}return _0x3a9387;};exports[_0x78af('0xa')]=function(_0x339039,_0x45e555){var _0x5a94ae=[];switch(_0x339039[_0x78af('0x2')]()){case _0x78af('0x3'):switch(_0x45e555['toLowerCase']()){case _0x78af('0xb'):_0x5a94ae=[{'type':_0x78af('0x0'),'content':_0x78af('0xc'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':_0x78af('0x5'),'variableName':_0x78af('0xd')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x78af('0x5'),'variableName':_0x78af('0xe')},{'type':'keyValue','content':'','key':_0x78af('0xf'),'keyType':'variable','variableName':_0x78af('0x10')},{'type':_0x78af('0x11'),'content':'','key':_0x78af('0x12'),'keyType':_0x78af('0x5'),'variableName':_0x78af('0x6')},{'type':_0x78af('0x11'),'content':'','key':_0x78af('0x13'),'keyType':_0x78af('0x5'),'variableName':'uniqueid'},{'type':_0x78af('0x11'),'content':'','key':'Date','keyType':_0x78af('0x5'),'variableName':'agentcalledAt'},{'type':_0x78af('0x0'),'content':_0x78af('0x14'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0x78af('0x5'),'variableName':'destcalleridname'},{'type':_0x78af('0x11'),'content':'','key':'Agent\x20Number','keyType':_0x78af('0x5'),'variableName':_0x78af('0x9')},{'type':_0x78af('0x0'),'content':_0x78af('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0x78af('0x11'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0x78af('0x16')},{'type':'keyValue','content':'','key':_0x78af('0x17'),'keyType':'variable','variableName':'agentconnectAt'},{'type':_0x78af('0x11'),'content':'','key':_0x78af('0x18'),'keyType':'variable','variableName':_0x78af('0x19')},{'type':_0x78af('0x11'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0x78af('0x1a')},{'type':_0x78af('0x11'),'content':'','key':_0x78af('0x1b'),'keyType':'variable','variableName':_0x78af('0x1c')}];break;case'outbound':_0x5a94ae=[{'type':_0x78af('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':_0x78af('0x1d'),'keyType':'variable','keyContent':'','variableName':_0x78af('0x9')},{'type':_0x78af('0x11'),'content':'','key':_0x78af('0x1e'),'keyType':_0x78af('0x5'),'keyContent':'','variableName':_0x78af('0x1f')},{'type':_0x78af('0x11'),'content':'','key':_0x78af('0x13'),'keyType':'variable','keyContent':'','variableName':'uniqueid'},{'type':_0x78af('0x11'),'content':'','key':_0x78af('0x20'),'keyType':'variable','keyContent':'','variableName':_0x78af('0x21')},{'type':_0x78af('0x0'),'content':_0x78af('0x15')},{'type':_0x78af('0x11'),'content':'','key':_0x78af('0x22'),'keyType':_0x78af('0x5'),'keyContent':'','variableName':_0x78af('0x23')},{'type':_0x78af('0x11'),'content':'','key':_0x78af('0x24'),'keyType':_0x78af('0x5'),'keyContent':'','variableName':_0x78af('0x25')},{'type':_0x78af('0x11'),'content':'','key':_0x78af('0x26'),'keyType':_0x78af('0x5'),'keyContent':'','variableName':_0x78af('0x27')},{'type':_0x78af('0x11'),'content':'','key':'Billable\x20Time','keyType':_0x78af('0x5'),'keyContent':'','variableName':_0x78af('0x28')}];break;}}return _0x5a94ae;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index ee5b5e6..02b05d3 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 _0xeffb=['findOne','then','update','error','user','body','omit','html','phone','fax','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction'];(function(_0x5677b1,_0x4cfe89){var _0x3324e5=function(_0x39fe8e){while(--_0x39fe8e){_0x5677b1['push'](_0x5677b1['shift']());}};_0x3324e5(++_0x4cfe89);}(_0xeffb,0xac));var _0xbeff=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xeffb[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require('lodash');var db=require(_0xbeff('0x0'))['db'];var loggers={'openchannel':require(_0xbeff('0x1'))(_0xbeff('0x2')),'mail':require(_0xbeff('0x1'))(_0xbeff('0x3')),'fax':require(_0xbeff('0x1'))('fax-interactions'),'sms':require(_0xbeff('0x1'))(_0xbeff('0x4')),'chat':require(_0xbeff('0x1'))(_0xbeff('0x5')),'whatsapp':require(_0xbeff('0x1'))('whatsapp-interactions')};function getInteractionId(_0x4eae26,_0x28c8c5,_0x1ab44f){if(_0x4eae26&&_0x4eae26[_[_0xbeff('0x6')](_0x1ab44f)+'InteractionId']){return _0x4eae26[_[_0xbeff('0x6')](_0x1ab44f)+_0xbeff('0x7')];}else if(_0x4eae26&&_0x4eae26['id']){return _0x4eae26['id'];}else if(_0x28c8c5&&_0x28c8c5['id']){return _0x28c8c5['id'];}else{return _0xbeff('0x8');}}function log(_0x17c754,_0x185bfa,_0x35694c,_0x5ec65d,_0x29931b,_0x346d9a){loggers[_0x29931b[_0xbeff('0x9')]()][_0x17c754](_0xbeff('0xa'),_0x346d9a[_0xbeff('0xb')](),_0x185bfa?_0x185bfa['id']:null,_0x185bfa?_0x185bfa[_0xbeff('0xc')]:null,_0x185bfa?_0x185bfa[_0xbeff('0xd')]:null,getInteractionId(_0x35694c,_0x5ec65d,_0x29931b),_0x35694c?JSON[_0xbeff('0xe')](_0x35694c):_0xbeff('0xf'));}function updateUser(_0x567f4e,_0x21aee5,_0x5059e4,_0x2fe594,_0x56b9f2){db[_[_0xbeff('0x6')](_0x2fe594)+_0xbeff('0x10')][_0xbeff('0x11')]({'where':{'id':getInteractionId(_0x21aee5,_0x5059e4,_0x2fe594)}})[_0xbeff('0x12')](function(_0x4d351a){if(_0x4d351a){return _0x4d351a[_0xbeff('0x13')]({'UserId':_0x567f4e?_0x567f4e['id']:null});}})[_0xbeff('0x12')](function(_0x4109d0){if(_0x4109d0){log('info',_0x567f4e,_0x21aee5,_0x5059e4,_0x2fe594,_0x56b9f2);}})['catch'](function(){log(_0xbeff('0x14'),_0x567f4e,_0x21aee5,_0x5059e4,_0x2fe594,_0x56b9f2);});}exports['tracked']=function(_0x17287c,_0x11750e){return function(_0x5c19a0,_0x5b5695,_0x243a7a){var _0x375bc9=_0x5c19a0[_0xbeff('0x15')];var _0x21f1a0={};var _0x4239d2=_0x5c19a0['query'];if(_0x21f1a0){_0x21f1a0=_['clone'](_0x5c19a0[_0xbeff('0x16')]);_0x21f1a0=_[_0xbeff('0x17')](_0x21f1a0,[_0xbeff('0x16'),_0xbeff('0x18'),_0xbeff('0x19'),_0xbeff('0x1a'),'mobile']);}updateUser(_0x375bc9,_0x21f1a0,_0x4239d2,_0x17287c,_0x11750e);_0x243a7a(null);};}; \ No newline at end of file +var _0xa8cc=['mobile','openchannel-interactions','../../config/logger','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','InteractionId','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','Interaction','findOne','then','update','catch','error','tracked','user','query','clone','body','omit','fax'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0xa8cc,0x11f));var _0xca8c=function(_0x45e045,_0x265985){_0x45e045=_0x45e045-0x0;var _0x34a2f9=_0xa8cc[_0x45e045];return _0x34a2f9;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0xca8c('0x0')),'mail':require(_0xca8c('0x1'))(_0xca8c('0x2')),'fax':require(_0xca8c('0x1'))('fax-interactions'),'sms':require(_0xca8c('0x1'))(_0xca8c('0x3')),'chat':require('../../config/logger')(_0xca8c('0x4')),'whatsapp':require(_0xca8c('0x1'))(_0xca8c('0x5'))};function getInteractionId(_0x205683,_0x438394,_0x220913){if(_0x205683&&_0x205683[_['upperFirst'](_0x220913)+_0xca8c('0x6')]){return _0x205683[_[_0xca8c('0x7')](_0x220913)+'InteractionId'];}else if(_0x205683&&_0x205683['id']){return _0x205683['id'];}else if(_0x438394&&_0x438394['id']){return _0x438394['id'];}else{return _0xca8c('0x8');}}function log(_0x3d0bc0,_0x5d62e2,_0x5e3cf0,_0x4281ca,_0x5c055a,_0x53d8e8){loggers[_0x5c055a[_0xca8c('0x9')]()][_0x3d0bc0](_0xca8c('0xa'),_0x53d8e8[_0xca8c('0xb')](),_0x5d62e2?_0x5d62e2['id']:null,_0x5d62e2?_0x5d62e2['name']:null,_0x5d62e2?_0x5d62e2['role']:null,getInteractionId(_0x5e3cf0,_0x4281ca,_0x5c055a),_0x5e3cf0?JSON['stringify'](_0x5e3cf0):'null');}function updateUser(_0x15924a,_0x67cfff,_0x55c266,_0x8ba120,_0x3f15c1){db[_[_0xca8c('0x7')](_0x8ba120)+_0xca8c('0xc')][_0xca8c('0xd')]({'where':{'id':getInteractionId(_0x67cfff,_0x55c266,_0x8ba120)}})[_0xca8c('0xe')](function(_0x3790e0){if(_0x3790e0){return _0x3790e0[_0xca8c('0xf')]({'UserId':_0x15924a?_0x15924a['id']:null});}})[_0xca8c('0xe')](function(_0x1d6638){if(_0x1d6638){log('info',_0x15924a,_0x67cfff,_0x55c266,_0x8ba120,_0x3f15c1);}})[_0xca8c('0x10')](function(){log(_0xca8c('0x11'),_0x15924a,_0x67cfff,_0x55c266,_0x8ba120,_0x3f15c1);});}exports[_0xca8c('0x12')]=function(_0xd7aade,_0x493379){return function(_0x988623,_0x358895,_0x5aade7){var _0x255fe8=_0x988623[_0xca8c('0x13')];var _0x4818fa={};var _0x5d481a=_0x988623[_0xca8c('0x14')];if(_0x4818fa){_0x4818fa=_[_0xca8c('0x15')](_0x988623[_0xca8c('0x16')]);_0x4818fa=_[_0xca8c('0x17')](_0x4818fa,['body','html','phone',_0xca8c('0x18'),_0xca8c('0x19')]);}updateUser(_0x255fe8,_0x4818fa,_0x5d481a,_0xd7aade,_0x493379);_0x5aade7(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index e10713d..a3e8981 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 _0x40d2=['catch','users','admin','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','parse','use','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x24b852,_0x2bad67){var _0x180ad2=function(_0x454562){while(--_0x454562){_0x24b852['push'](_0x24b852['shift']());}};_0x180ad2(++_0x2bad67);}(_0x40d2,0xf3));var _0x240d=function(_0x9b2d5b,_0x4d57c8){_0x9b2d5b=_0x9b2d5b-0x0;var _0x27f388=_0x40d2[_0x9b2d5b];return _0x27f388;};'use strict';var crypto=require('crypto');var util=require(_0x240d('0x0'));var compose=require(_0x240d('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x240d('0x2'));function getValueFromLicense(_0x57b08d,_0x684d80){if(_0x57b08d&&_0x684d80){if(_0x684d80[_0x240d('0x3')]&&_0x684d80[_0x240d('0x4')]){var _0x5e9a3c=_0x684d80[_0x240d('0x3')];var _0x33555a=_0x684d80[_0x240d('0x4')];var _0x1be755=_0x5e9a3c[_0x240d('0x5')]('-')[0x4];var _0x2b549b=_0x5e9a3c[_0x240d('0x5')]('-')[0x0];var _0x21e057=crypto[_0x240d('0x6')](_0x240d('0x7'),util[_0x240d('0x8')](_0x240d('0x9'),_0x1be755,_0x5e9a3c,_0x2b549b));var _0x2af0db=_0x21e057['update'](_0x33555a,_0x240d('0xa'),_0x240d('0xb'));_0x2af0db+=_0x21e057[_0x240d('0xc')](_0x240d('0xb'));var _0x368efa=JSON[_0x240d('0xd')](_0x2af0db);return _0x368efa['hasOwnProperty'](_0x57b08d)?_0x368efa[_0x57b08d]:null;}}return null;}function isLimit(_0x4d76df,_0x51e914,_0x25cd2b,_0x53e184){var _0x1c1ad4=_0x51e914;return compose()[_0x240d('0xe')](function(_0x4da585,_0x207403,_0x513760){return db[_0x240d('0xf')][_0x240d('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x240d('0x11')](function(_0xf1f56c){var _0x478180=getValueFromLicense(_0x4d76df,_0xf1f56c);return _0x478180?_0x478180:_0x1c1ad4;})[_0x240d('0x11')](function(_0x3c3bd6){_0x1c1ad4=_0x3c3bd6;return _0x25cd2b[_0x240d('0x12')](_0x53e184);})['then'](function(_0x12f38c){if(_0x12f38c>=_0x1c1ad4){return _0x207403[_0x240d('0x13')](0x193)['json']({'message':util[_0x240d('0x8')](_0x240d('0x14'),_0x4d76df)});}_0x513760();})[_0x240d('0x15')](function(_0x2c21d6){_0x513760(_0x2c21d6);});});}function isUserLimit(){return isLimit(_0x240d('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0x240d('0x17')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x2d14=['composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','update','base64','utf8','parse','hasOwnProperty','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x2d14,0x10c));var _0x42d1=function(_0x4021d2,_0x5e3865){_0x4021d2=_0x4021d2-0x0;var _0x106e2a=_0x2d14[_0x4021d2];return _0x106e2a;};'use strict';var crypto=require(_0x42d1('0x0'));var util=require(_0x42d1('0x1'));var compose=require(_0x42d1('0x2'));var db=require(_0x42d1('0x3'))['db'];var config=require(_0x42d1('0x4'));function getValueFromLicense(_0x1c96a3,_0x286e73){if(_0x1c96a3&&_0x286e73){if(_0x286e73[_0x42d1('0x5')]&&_0x286e73[_0x42d1('0x6')]){var _0x496f35=_0x286e73[_0x42d1('0x5')];var _0xaa6266=_0x286e73[_0x42d1('0x6')];var _0x27ebc3=_0x496f35[_0x42d1('0x7')]('-')[0x4];var _0x1c24f5=_0x496f35[_0x42d1('0x7')]('-')[0x0];var _0xf222b0=crypto[_0x42d1('0x8')](_0x42d1('0x9'),util[_0x42d1('0xa')]('%s:%s:%s',_0x27ebc3,_0x496f35,_0x1c24f5));var _0x48b032=_0xf222b0[_0x42d1('0xb')](_0xaa6266,_0x42d1('0xc'),_0x42d1('0xd'));_0x48b032+=_0xf222b0['final'](_0x42d1('0xd'));var _0x32a07f=JSON[_0x42d1('0xe')](_0x48b032);return _0x32a07f[_0x42d1('0xf')](_0x1c96a3)?_0x32a07f[_0x1c96a3]:null;}}return null;}function isLimit(_0x11095f,_0x44687e,_0x417207,_0x811643){var _0x3437dd=_0x44687e;return compose()['use'](function(_0x526af8,_0x5218ae,_0x1ce855){return db['License'][_0x42d1('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x260544){var _0xcbbef6=getValueFromLicense(_0x11095f,_0x260544);return _0xcbbef6?_0xcbbef6:_0x3437dd;})[_0x42d1('0x11')](function(_0x3e7cf){_0x3437dd=_0x3e7cf;return _0x417207['count'](_0x811643);})['then'](function(_0x34c1c3){if(_0x34c1c3>=_0x3437dd){return _0x5218ae[_0x42d1('0x12')](0x193)[_0x42d1('0x13')]({'message':util[_0x42d1('0xa')](_0x42d1('0x14'),_0x11095f)});}_0x1ce855();})[_0x42d1('0x15')](function(_0x9df328){_0x1ce855(_0x9df328);});});}function isUserLimit(){return isLimit(_0x42d1('0x16'),0x1,db[_0x42d1('0x17')],{'where':{'$or':[{'role':_0x42d1('0x18')},{'role':_0x42d1('0x19')}]}});}exports[_0x42d1('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 1171b33..20ea0e5 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 _0xb01b=['shift','match','filter','indexOf','map','conditions','push','DATE','operator','$eq','$between','value','includes','$gt','add','days','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','\x20OR\x20','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','pop','utcOffset','format','hours','lodash','moment','parseSearch','startsWith','[$or]','and','[$and]','replace','split','length','forEach'];(function(_0xea6018,_0x4cf082){var _0x57b54d=function(_0x49099a){while(--_0x49099a){_0xea6018['push'](_0xea6018['shift']());}};_0x57b54d(++_0x4cf082);}(_0xb01b,0x65));var _0xbb01=function(_0x4e14fd,_0x38f205){_0x4e14fd=_0x4e14fd-0x0;var _0x2c9f27=_0xb01b[_0x4e14fd];return _0x2c9f27;};'use strict';var _=require(_0xbb01('0x0'));var moment=require(_0xbb01('0x1'));exports[_0xbb01('0x2')]=function(_0x1956a3){var _0x189d8d={'conditions':[]};_0x189d8d['sqlOperator']=_[_0xbb01('0x3')](_0x1956a3,_0xbb01('0x4'))?'or':_0xbb01('0x5');var _0x4d2cd8=_0x1956a3['replace'](_0xbb01('0x6'),'')[_0xbb01('0x7')](_0xbb01('0x4'),'')[_0xbb01('0x8')]('||');for(var _0x219f9e=0x0;_0x219f9e<_0x4d2cd8[_0xbb01('0x9')];_0x219f9e++){var _0x81f449=_0x4d2cd8[_0x219f9e][_0xbb01('0x8')](':=');var _0x126297=_0x81f449[0x0];var _0x3ad5c6=_0x81f449['slice'](0x1);_0x3ad5c6[_0xbb01('0xa')](function(_0x36901e){var _0x2f17bf=_0x36901e['split']('[')[_0xbb01('0xb')]();var _0x554f74=_0x36901e[_0xbb01('0xc')](/\[(.*?)\]/g);_0x554f74[_0xbb01('0xa')](function(_0x21ae6d){var _0x2eaef4=_0x21ae6d[_0xbb01('0x8')]('[')[_0xbb01('0xd')](function(_0x52b843){return _0x52b843[_0xbb01('0xe')](']')>-0x1;})[_0xbb01('0xf')](function(_0x32f953){return _0x32f953[_0xbb01('0x8')](']')[0x0];})[0x0];_0x189d8d[_0xbb01('0x10')][_0xbb01('0x11')]({'field':_0x126297,'operator':_0x2f17bf,'value':_0x2eaef4});});});}return _0x189d8d;};exports['buildExpression']=function(_0xee120e,_0x255e52,_0x3ae6f9){var _0x547190={};if(_0x255e52===_0xbb01('0x12')){if(_0x3ae6f9[_0xbb01('0x13')]===_0xbb01('0x14')){_0x3ae6f9[_0xbb01('0x13')]=_0xbb01('0x15');_0x3ae6f9[_0xbb01('0x16')]+=','+_0x3ae6f9[_0xbb01('0x16')];}else if(_[_0xbb01('0x17')]([_0xbb01('0x18'),'$lte'],_0x3ae6f9[_0xbb01('0x13')])){_0x3ae6f9['value']=moment(_0x3ae6f9[_0xbb01('0x16')])[_0xbb01('0x19')](0x1,_0xbb01('0x1a'))['format'](_0xbb01('0x1b'));}}if(_0x3ae6f9[_0xbb01('0x1c')]){_0x255e52=_0x3ae6f9[_0xbb01('0x1c')];_0x547190[_0xbb01('0x1d')]=_0xbb01('0x1e')+_0xee120e+'.'+_0x3ae6f9[_0xbb01('0x1f')]+_0xbb01('0x20')+_0x3ae6f9[_0xbb01('0x1c')]+')\x20'+parseOperator(_0x3ae6f9[_0xbb01('0x13')]);}else{_0x547190[_0xbb01('0x1d')]=_0xee120e+'.'+_0x3ae6f9[_0xbb01('0x1f')]+'\x20'+parseOperator(_0x3ae6f9['operator']);}if(_['includes'](['$ne','$notIn'],_0x3ae6f9['operator']))_0x547190[_0xbb01('0x1d')]='('+_0x547190['text']+_0xbb01('0x21')+_0xee120e+'.'+_0x3ae6f9[_0xbb01('0x1f')]+'\x20IS\x20NULL)';_0x547190[_0xbb01('0x16')]=parseValue(_0x255e52,_0x3ae6f9[_0xbb01('0x13')],_0x3ae6f9[_0xbb01('0x16')]);return _0x547190;};function parseOperator(_0x48df04){var _0x22850e;switch(_0x48df04){case'$in':_0x22850e=_0xbb01('0x22');break;case _0xbb01('0x23'):_0x22850e=_0xbb01('0x24');break;case _0xbb01('0x14'):_0x22850e=_0xbb01('0x25');break;case _0xbb01('0x26'):_0x22850e=_0xbb01('0x27');break;case'$substring':case'$startsWith':case _0xbb01('0x28'):_0x22850e=_0xbb01('0x29');break;case _0xbb01('0x2a'):_0x22850e=_0xbb01('0x2b');break;case _0xbb01('0x18'):_0x22850e=_0xbb01('0x2c');break;case _0xbb01('0x2d'):_0x22850e=_0xbb01('0x2e');break;case _0xbb01('0x2f'):_0x22850e=_0xbb01('0x30');break;case _0xbb01('0x15'):_0x22850e=_0xbb01('0x31');break;}return _0x22850e;}function parseValue(_0x16d2fe,_0x3981c2,_0x4020e1){var _0xc87294={'start':undefined,'end':undefined};switch(_0x3981c2){case'$in':case'$notIn':_0xc87294[_0xbb01('0x32')]=_0x4020e1[_0xbb01('0x8')](',');break;case'$substring':_0xc87294[_0xbb01('0x32')]='%'+_0x4020e1+'%';break;case _0xbb01('0x33'):_0xc87294[_0xbb01('0x32')]=_0x4020e1+'%';break;case _0xbb01('0x28'):_0xc87294[_0xbb01('0x32')]='%'+_0x4020e1;break;case _0xbb01('0x15'):var _0x375139=_0x4020e1['split'](',');var _0x4020e1=_0x375139['shift']();var _0x1da937=_0x375139[_0xbb01('0x34')]();if(_0x16d2fe===_0xbb01('0x12')){_0x4020e1=moment(_0x4020e1)[_0xbb01('0x35')](0x0,!![])[_0xbb01('0x36')]();_0x1da937=moment(_0x1da937)[_0xbb01('0x35')](0x0,!![])[_0xbb01('0x19')](0x17,_0xbb01('0x37'))[_0xbb01('0x19')](0x3b,'minutes')[_0xbb01('0x19')](0x3b,'seconds')['format']();}_0xc87294={'start':_0x4020e1,'end':_0x1da937};break;default:_0xc87294[_0xbb01('0x32')]=_0x4020e1;break;}return _0xc87294;} \ No newline at end of file +var _0x2e64=['$endsWith','$lt','<\x20?','$gt','>\x20?','$gte','>=\x20?','start','shift','pop','hours','seconds','lodash','moment','sqlOperator','startsWith','[$or]','and','[$and]','replace','split','length','forEach','match','indexOf','map','conditions','push','buildExpression','DATE','$eq','$between','value','includes','operator','add','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x2e64,0xdc));var _0x42e6=function(_0x3072b6,_0x1cfc2d){_0x3072b6=_0x3072b6-0x0;var _0xae29fc=_0x2e64[_0x3072b6];return _0xae29fc;};'use strict';var _=require(_0x42e6('0x0'));var moment=require(_0x42e6('0x1'));exports['parseSearch']=function(_0x134559){var _0x558360={'conditions':[]};_0x558360[_0x42e6('0x2')]=_[_0x42e6('0x3')](_0x134559,_0x42e6('0x4'))?'or':_0x42e6('0x5');var _0x877c66=_0x134559['replace'](_0x42e6('0x6'),'')[_0x42e6('0x7')]('[$or]','')[_0x42e6('0x8')]('||');for(var _0x31dbd8=0x0;_0x31dbd8<_0x877c66[_0x42e6('0x9')];_0x31dbd8++){var _0x1a4d71=_0x877c66[_0x31dbd8]['split'](':=');var _0x580344=_0x1a4d71[0x0];var _0x11aac8=_0x1a4d71['slice'](0x1);_0x11aac8[_0x42e6('0xa')](function(_0x425162){var _0x1d8d4c=_0x425162[_0x42e6('0x8')]('[')['shift']();var _0x3ad37c=_0x425162[_0x42e6('0xb')](/\[(.*?)\]/g);_0x3ad37c[_0x42e6('0xa')](function(_0x454366){var _0x16c978=_0x454366[_0x42e6('0x8')]('[')['filter'](function(_0x4eaa18){return _0x4eaa18[_0x42e6('0xc')](']')>-0x1;})[_0x42e6('0xd')](function(_0x341352){return _0x341352[_0x42e6('0x8')](']')[0x0];})[0x0];_0x558360[_0x42e6('0xe')][_0x42e6('0xf')]({'field':_0x580344,'operator':_0x1d8d4c,'value':_0x16c978});});});}return _0x558360;};exports[_0x42e6('0x10')]=function(_0x55e31c,_0x11acb5,_0x57c2cd){var _0x5246f2={};if(_0x11acb5===_0x42e6('0x11')){if(_0x57c2cd['operator']===_0x42e6('0x12')){_0x57c2cd['operator']=_0x42e6('0x13');_0x57c2cd[_0x42e6('0x14')]+=','+_0x57c2cd[_0x42e6('0x14')];}else if(_[_0x42e6('0x15')](['$gt','$lte'],_0x57c2cd[_0x42e6('0x16')])){_0x57c2cd[_0x42e6('0x14')]=moment(_0x57c2cd[_0x42e6('0x14')])[_0x42e6('0x17')](0x1,'days')[_0x42e6('0x18')](_0x42e6('0x19'));}}if(_0x57c2cd[_0x42e6('0x1a')]){_0x11acb5=_0x57c2cd[_0x42e6('0x1a')];_0x5246f2[_0x42e6('0x1b')]=_0x42e6('0x1c')+_0x55e31c+'.'+_0x57c2cd[_0x42e6('0x1d')]+'\x20AS\x20'+_0x57c2cd[_0x42e6('0x1a')]+')\x20'+parseOperator(_0x57c2cd[_0x42e6('0x16')]);}else{_0x5246f2[_0x42e6('0x1b')]=_0x55e31c+'.'+_0x57c2cd[_0x42e6('0x1d')]+'\x20'+parseOperator(_0x57c2cd['operator']);}if(_[_0x42e6('0x15')](['$ne','$notIn'],_0x57c2cd['operator']))_0x5246f2['text']='('+_0x5246f2[_0x42e6('0x1b')]+_0x42e6('0x1e')+_0x55e31c+'.'+_0x57c2cd[_0x42e6('0x1d')]+_0x42e6('0x1f');_0x5246f2[_0x42e6('0x14')]=parseValue(_0x11acb5,_0x57c2cd[_0x42e6('0x16')],_0x57c2cd[_0x42e6('0x14')]);return _0x5246f2;};function parseOperator(_0x288388){var _0x301230;switch(_0x288388){case _0x42e6('0x20'):_0x301230=_0x42e6('0x21');break;case _0x42e6('0x22'):_0x301230=_0x42e6('0x23');break;case _0x42e6('0x12'):_0x301230=_0x42e6('0x24');break;case'$ne':_0x301230=_0x42e6('0x25');break;case _0x42e6('0x26'):case _0x42e6('0x27'):case _0x42e6('0x28'):_0x301230='LIKE\x20?';break;case _0x42e6('0x29'):_0x301230=_0x42e6('0x2a');break;case _0x42e6('0x2b'):_0x301230=_0x42e6('0x2c');break;case'$lte':_0x301230='<=\x20?';break;case _0x42e6('0x2d'):_0x301230=_0x42e6('0x2e');break;case _0x42e6('0x13'):_0x301230='BETWEEN\x20?\x20AND\x20?';break;}return _0x301230;}function parseValue(_0x281f5f,_0x5eeefa,_0x108e47){var _0x512d69={'start':undefined,'end':undefined};switch(_0x5eeefa){case'$in':case _0x42e6('0x22'):_0x512d69[_0x42e6('0x2f')]=_0x108e47[_0x42e6('0x8')](',');break;case _0x42e6('0x26'):_0x512d69[_0x42e6('0x2f')]='%'+_0x108e47+'%';break;case'$startsWith':_0x512d69[_0x42e6('0x2f')]=_0x108e47+'%';break;case _0x42e6('0x28'):_0x512d69[_0x42e6('0x2f')]='%'+_0x108e47;break;case _0x42e6('0x13'):var _0x231b89=_0x108e47[_0x42e6('0x8')](',');var _0x108e47=_0x231b89[_0x42e6('0x30')]();var _0xa1b070=_0x231b89[_0x42e6('0x31')]();if(_0x281f5f===_0x42e6('0x11')){_0x108e47=moment(_0x108e47)['utcOffset'](0x0,!![])['format']();_0xa1b070=moment(_0xa1b070)['utcOffset'](0x0,!![])[_0x42e6('0x17')](0x17,_0x42e6('0x32'))[_0x42e6('0x17')](0x3b,'minutes')[_0x42e6('0x17')](0x3b,_0x42e6('0x33'))[_0x42e6('0x18')]();}_0x512d69={'start':_0x108e47,'end':_0xa1b070};break;default:_0x512d69['start']=_0x108e47;break;}return _0x512d69;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 70a4f03..37f6374 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 _0xf69d=['sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','$gte','format','YYYY-MM-DD','$lte','subtract','name','uniqueid','isArray','offset','sort','map','priority','cast','col','DESC','omit','length','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','model','attributes','intersection','nolimit','limit','where','pick','filter','object','columns','value','type','lower','lodash'];(function(_0x5e2b34,_0x58385c){var _0x4859f9=function(_0x177263){while(--_0x177263){_0x5e2b34['push'](_0x5e2b34['shift']());}};_0x4859f9(++_0x58385c);}(_0xf69d,0xd3));var _0xdf69=function(_0x1b3471,_0x3b7d6b){_0x1b3471=_0x1b3471-0x0;var _0x274f65=_0xf69d[_0x1b3471];return _0x274f65;};'use strict';var _=require(_0xdf69('0x0'));var sequelize=require(_0xdf69('0x1'));var moment=require(_0xdf69('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xe063fc){var _0xf89475=['ne'];try{var _0x4e4bdd=JSON[_0xdf69('0x3')](_0xe063fc);var _0x342114=Object[_0xdf69('0x4')](_0x4e4bdd)[0x0];return _0xf89475[_0xdf69('0x5')](_0x342114);}catch(_0x177ff7){return![];}}function getOperatorValue(_0x18ce2b){var _0x2d456f=JSON[_0xdf69('0x3')](_0x18ce2b);var _0x1d2501=Object[_0xdf69('0x4')](_0x2d456f)[0x0];var _0x18a08e=_0x2d456f[_0x1d2501];return{['$'+_0x1d2501]:_0x18a08e};}exports[_0xdf69('0x6')]=function(_0x38909e){var _0x466c26=null;if(_0x38909e){_0x466c26=_0x38909e[_0xdf69('0x7')](',');}return _0x466c26;};exports[_0xdf69('0x8')]=function(_0x1e0e8d,_0x4fcc93){var _0x305726={};if(!_[_0xdf69('0x9')](_0x1e0e8d)){_[_0xdf69('0xa')](_0x1e0e8d,function(_0x21d8e0,_0x43ce3d){try{if(_0x4fcc93){var _0x1b86d4=_['find'](_0x4fcc93,{'name':_0x43ce3d})||{};if(hasSequelizeOperator(_0x21d8e0)){_0x305726[_0x43ce3d]=getOperatorValue(_0x21d8e0);}else if(_0x1b86d4['type']==='DATE'&&_['isPlainObject'](_0x21d8e0)){var _0x3dcda8=JSON[_0xdf69('0x3')](_0x21d8e0);var _0x3b557c={'$gte':moment(moment(_0x3dcda8[_0xdf69('0xb')])[_0xdf69('0xc')](_0xdf69('0xd')))['utc']()[_0xdf69('0xc')](),'$lte':moment(moment(_0x3dcda8[_0xdf69('0xe')])[_0xdf69('0xc')](_0xdf69('0xd')))['utc']()[_0xdf69('0xf')](0x1,'s')['format']()};_0x305726[_0x43ce3d]=_0x3b557c;}else if(_0x1b86d4[_0xdf69('0x10')]===_0xdf69('0x11')){_0x305726[_0x43ce3d]=_0x21d8e0;}else{_0x305726[_0x43ce3d]=_['isArray'](_0x21d8e0)?_0x21d8e0:JSON[_0xdf69('0x3')](_0x21d8e0);}}else{_0x305726[_0x43ce3d]=_[_0xdf69('0x12')](_0x21d8e0)?_0x21d8e0:JSON[_0xdf69('0x3')](_0x21d8e0);}}catch(_0x85d1d){_0x305726[_0x43ce3d]=_0x21d8e0['split'](',');}});}return _0x305726;};exports['limit']=function(_0x352400){_0x352400=parseInt(_0x352400,0xa);if(!_0x352400||_0x352400<0x0){_0x352400=LIMIT_VALUE;}return _0x352400;};exports[_0xdf69('0x13')]=function(_0x54df73){_0x54df73=parseInt(_0x54df73,0xa);if(!_0x54df73||_0x54df73<0x0){_0x54df73=0x0;}return _0x54df73;};exports[_0xdf69('0x14')]=function(_0x259e90){var _0x68fa80,_0x526cbc=null;if(_0x259e90){_0x68fa80=_0x259e90[_0xdf69('0x7')](',');_0x526cbc=_[_0xdf69('0x15')](_0x68fa80,function(_0x4d09d5){if(_0x4d09d5['indexOf']('-')===0x0){return[_0x4d09d5===_0xdf69('0x16')?sequelize[_0xdf69('0x17')](sequelize[_0xdf69('0x18')]('priority'),'unsigned'):_0x4d09d5['substr'](0x1),_0xdf69('0x19')];}else{return[_0x4d09d5==='priority'?sequelize[_0xdf69('0x17')](sequelize[_0xdf69('0x18')](_0xdf69('0x16')),'unsigned'):_0x4d09d5,'ASC'];}});}return _0x526cbc;};exports[_0xdf69('0x1a')]=function(_0x1437f6,_0x6da296){if(_[_0xdf69('0x9')](_0x1437f6)){return _0x1437f6;}if(_['isArray'](_0x1437f6)){for(var _0x3b727c=0x0;_0x3b727c<_0x1437f6[_0xdf69('0x1b')];_0x3b727c+=0x1){_0x1437f6[_0x3b727c]=this[_0xdf69('0x1a')](_0x1437f6[_0x3b727c],_0x6da296);}return _0x1437f6;}if(!_['isObject'](_0x1437f6)){return _0x1437f6;}if(_[_0xdf69('0x1c')](_0x6da296)){_0x6da296=[_0x6da296];}if(!_['isArray'](_0x6da296)){return _0x1437f6;}for(var _0x5dcabd=0x0;_0x5dcabd<_0x6da296['length'];_0x5dcabd+=0x1){_['unset'](_0x1437f6,_0x6da296[_0x5dcabd]);}for(var _0x146b6a in _0x1437f6){if(_0x1437f6[_0xdf69('0x1d')](_0x146b6a)){_0x1437f6[_0x146b6a]=this['omit'](_0x1437f6[_0x146b6a],_0x6da296);}}return _0x1437f6;};exports[_0xdf69('0x1e')]=function(_0xd81d0a){return _0xd81d0a[_0xdf69('0x1f')](RegExp(_0xdf69('0x20')))?!![]:![];};exports[_0xdf69('0x21')]=function(_0x1b57b3){return _0x1b57b3[_0xdf69('0x1f')](/^\S+@\S+$/)?!![]:![];};exports[_0xdf69('0x22')]=function(_0x1f67fe){var _0x3b97df=[];_0x1f67fe[_0xdf69('0x7')](/[ ,]+/)[_0xdf69('0x23')](function(_0x38f848){_0x38f848=_0x38f848[_0xdf69('0x24')](/([^:]")"+/g,'$1');_0x38f848='+'+_0x38f848+'*';var _0x1b145b=/[ `!@#$%^&*()_\-?~]/;if(_0x38f848[_0xdf69('0x1f')](_0x1b145b))_0x38f848='\x22'+_0x38f848+'\x22';_0x3b97df[_0xdf69('0x25')](_0x38f848);});return _0x3b97df['join']('\x20');};exports[_0xdf69('0x26')]=function(_0x2aab76,_0x20fd6e,_0x321040){var _0x1a23d1={},_0x51ee4c={};if(_0x20fd6e[_0xdf69('0x27')]['$id']){_0x20fd6e[_0xdf69('0x27')]['id']=_0x20fd6e[_0xdf69('0x27')]['$id'];delete _0x20fd6e[_0xdf69('0x27')]['$id'];}_0x1a23d1[_0xdf69('0x28')]=_[_0xdf69('0x15')](_0x2aab76,_0xdf69('0x10'));_0x1a23d1[_0xdf69('0x27')]=_[_0xdf69('0x4')](_0x20fd6e['query']);_0x1a23d1[_0xdf69('0x8')]=_['intersection'](_0x1a23d1[_0xdf69('0x28')],_0x1a23d1[_0xdf69('0x27')]);_0x51ee4c[_0xdf69('0x29')]=_[_0xdf69('0x2a')](_0x1a23d1['model'],this[_0xdf69('0x6')](_0x20fd6e['query'][_0xdf69('0x6')]));_0x51ee4c['attributes']=_0x51ee4c[_0xdf69('0x29')]['length']?_0x51ee4c[_0xdf69('0x29')]:_0x1a23d1[_0xdf69('0x28')];if(!_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x1d')](_0xdf69('0x2b'))){_0x51ee4c['limit']=this[_0xdf69('0x2c')](_0x20fd6e[_0xdf69('0x27')]['limit']);_0x51ee4c['offset']=this['offset'](_0x20fd6e['query'][_0xdf69('0x13')]);}_0x51ee4c['order']=this[_0xdf69('0x14')](_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x14')]);_0x51ee4c[_0xdf69('0x2d')]=this['filters'](_[_0xdf69('0x2e')](_0x20fd6e[_0xdf69('0x27')],_0x1a23d1[_0xdf69('0x8')]),_0x2aab76);if(_0x20fd6e['query'][_0xdf69('0x2f')]){var _0xdd919d=_0x2aab76;var _0x34ab67=_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x2f')];if(typeof _0x34ab67===_0xdf69('0x30')){_0xdd919d=_[_0xdf69('0x2f')](_0x2aab76,function(_0x4fd313){return _['includes'](_0x34ab67[_0xdf69('0x31')],_0x4fd313[_0xdf69('0x10')]);});_0x34ab67=_0x34ab67[_0xdf69('0x32')];}_0x51ee4c[_0xdf69('0x2d')]=_['merge'](_0x51ee4c['where'],{'$or':_['map'](_0xdd919d,function(_0x5454e1){if(_0x5454e1[_0xdf69('0x33')]!=='VIRTUAL'){if(_0x321040){return sequelize[_0xdf69('0x2d')](sequelize['fn']('lower',sequelize[_0xdf69('0x18')](_0x5454e1[_0xdf69('0x10')])),{'$like':sequelize['fn'](_0xdf69('0x34'),'%'+_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x2f')]+'%')});}else{var _0x2a7c7d={};_0x2a7c7d[_0x5454e1[_0xdf69('0x10')]]={'$like':'%'+_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x2f')]+'%'};return _0x2a7c7d;}}})});}_0x51ee4c=_['merge']({},_0x51ee4c,_0x20fd6e['options']);return _0x51ee4c;}; \ No newline at end of file +var _0x885a=['^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','query','$id','name','intersection','model','attributes','hasOwnProperty','order','where','pick','filter','object','columns','merge','VIRTUAL','lower','options','sequelize','moment','parse','keys','includes','fields','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','uniqueid','isArray','split','limit','offset','sort','map','priority','cast','col','unsigned','DESC','omit','isObject','isString','length','unset','match'];(function(_0x49bae7,_0x1c99bb){var _0x178f0c=function(_0x50783b){while(--_0x50783b){_0x49bae7['push'](_0x49bae7['shift']());}};_0x178f0c(++_0x1c99bb);}(_0x885a,0x180));var _0xa885=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x885a[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var sequelize=require(_0xa885('0x0'));var moment=require(_0xa885('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x35456c){var _0x2e4bc8=['ne'];try{var _0x573a2b=JSON[_0xa885('0x2')](_0x35456c);var _0x1c41b5=Object[_0xa885('0x3')](_0x573a2b)[0x0];return _0x2e4bc8[_0xa885('0x4')](_0x1c41b5);}catch(_0x108285){return![];}}function getOperatorValue(_0x33f18b){var _0x5dfd7e=JSON[_0xa885('0x2')](_0x33f18b);var _0x1200c7=Object[_0xa885('0x3')](_0x5dfd7e)[0x0];var _0x546175=_0x5dfd7e[_0x1200c7];return{['$'+_0x1200c7]:_0x546175};}exports[_0xa885('0x5')]=function(_0x2b7916){var _0x38df93=null;if(_0x2b7916){_0x38df93=_0x2b7916['split'](',');}return _0x38df93;};exports[_0xa885('0x6')]=function(_0x299f57,_0x42ab89){var _0x745710={};if(!_[_0xa885('0x7')](_0x299f57)){_[_0xa885('0x8')](_0x299f57,function(_0xcf5f96,_0x571c0d){try{if(_0x42ab89){var _0x8a82f5=_[_0xa885('0x9')](_0x42ab89,{'name':_0x571c0d})||{};if(hasSequelizeOperator(_0xcf5f96)){_0x745710[_0x571c0d]=getOperatorValue(_0xcf5f96);}else if(_0x8a82f5[_0xa885('0xa')]===_0xa885('0xb')&&_[_0xa885('0xc')](_0xcf5f96)){var _0x3e9c7a=JSON[_0xa885('0x2')](_0xcf5f96);var _0x574eb8={'$gte':moment(moment(_0x3e9c7a[_0xa885('0xd')])[_0xa885('0xe')](_0xa885('0xf')))[_0xa885('0x10')]()[_0xa885('0xe')](),'$lte':moment(moment(_0x3e9c7a['$lte'])[_0xa885('0xe')](_0xa885('0xf')))['utc']()[_0xa885('0x11')](0x1,'s')[_0xa885('0xe')]()};_0x745710[_0x571c0d]=_0x574eb8;}else if(_0x8a82f5['name']===_0xa885('0x12')){_0x745710[_0x571c0d]=_0xcf5f96;}else{_0x745710[_0x571c0d]=_[_0xa885('0x13')](_0xcf5f96)?_0xcf5f96:JSON['parse'](_0xcf5f96);}}else{_0x745710[_0x571c0d]=_[_0xa885('0x13')](_0xcf5f96)?_0xcf5f96:JSON['parse'](_0xcf5f96);}}catch(_0x2e9290){_0x745710[_0x571c0d]=_0xcf5f96[_0xa885('0x14')](',');}});}return _0x745710;};exports[_0xa885('0x15')]=function(_0x4e4d51){_0x4e4d51=parseInt(_0x4e4d51,0xa);if(!_0x4e4d51||_0x4e4d51<0x0){_0x4e4d51=LIMIT_VALUE;}return _0x4e4d51;};exports[_0xa885('0x16')]=function(_0x56a614){_0x56a614=parseInt(_0x56a614,0xa);if(!_0x56a614||_0x56a614<0x0){_0x56a614=0x0;}return _0x56a614;};exports[_0xa885('0x17')]=function(_0x1d5d0b){var _0x113043,_0x523916=null;if(_0x1d5d0b){_0x113043=_0x1d5d0b[_0xa885('0x14')](',');_0x523916=_[_0xa885('0x18')](_0x113043,function(_0x1530b6){if(_0x1530b6['indexOf']('-')===0x0){return[_0x1530b6===_0xa885('0x19')?sequelize[_0xa885('0x1a')](sequelize[_0xa885('0x1b')]('priority'),_0xa885('0x1c')):_0x1530b6['substr'](0x1),_0xa885('0x1d')];}else{return[_0x1530b6===_0xa885('0x19')?sequelize['cast'](sequelize[_0xa885('0x1b')](_0xa885('0x19')),_0xa885('0x1c')):_0x1530b6,'ASC'];}});}return _0x523916;};exports[_0xa885('0x1e')]=function(_0x14aed1,_0x558098){if(_[_0xa885('0x7')](_0x14aed1)){return _0x14aed1;}if(_['isArray'](_0x14aed1)){for(var _0x15ff4d=0x0;_0x15ff4d<_0x14aed1['length'];_0x15ff4d+=0x1){_0x14aed1[_0x15ff4d]=this[_0xa885('0x1e')](_0x14aed1[_0x15ff4d],_0x558098);}return _0x14aed1;}if(!_[_0xa885('0x1f')](_0x14aed1)){return _0x14aed1;}if(_[_0xa885('0x20')](_0x558098)){_0x558098=[_0x558098];}if(!_[_0xa885('0x13')](_0x558098)){return _0x14aed1;}for(var _0x1e0177=0x0;_0x1e0177<_0x558098[_0xa885('0x21')];_0x1e0177+=0x1){_[_0xa885('0x22')](_0x14aed1,_0x558098[_0x1e0177]);}for(var _0x3f219d in _0x14aed1){if(_0x14aed1['hasOwnProperty'](_0x3f219d)){_0x14aed1[_0x3f219d]=this['omit'](_0x14aed1[_0x3f219d],_0x558098);}}return _0x14aed1;};exports['isNumeric']=function(_0x4fc438){return _0x4fc438[_0xa885('0x23')](RegExp(_0xa885('0x24')))?!![]:![];};exports[_0xa885('0x25')]=function(_0x17c0eb){return _0x17c0eb[_0xa885('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0xa885('0x26')]=function(_0x5ac39f){var _0x40d982=[];_0x5ac39f['split'](/[ ,]+/)[_0xa885('0x27')](function(_0x4a1e54){_0x4a1e54=_0x4a1e54[_0xa885('0x28')](/([^:]")"+/g,'$1');_0x4a1e54='+'+_0x4a1e54+'*';var _0x528a71=/[ `!@#$%^&*()_\-?~]/;if(_0x4a1e54[_0xa885('0x23')](_0x528a71))_0x4a1e54='\x22'+_0x4a1e54+'\x22';_0x40d982[_0xa885('0x29')](_0x4a1e54);});return _0x40d982[_0xa885('0x2a')]('\x20');};exports['getOptions']=function(_0x15f3a,_0x23dea1,_0x5ed672){var _0x30814a={},_0x54dbd8={};if(_0x23dea1[_0xa885('0x2b')][_0xa885('0x2c')]){_0x23dea1[_0xa885('0x2b')]['id']=_0x23dea1['query'][_0xa885('0x2c')];delete _0x23dea1[_0xa885('0x2b')][_0xa885('0x2c')];}_0x30814a['model']=_[_0xa885('0x18')](_0x15f3a,_0xa885('0x2d'));_0x30814a[_0xa885('0x2b')]=_[_0xa885('0x3')](_0x23dea1[_0xa885('0x2b')]);_0x30814a[_0xa885('0x6')]=_[_0xa885('0x2e')](_0x30814a[_0xa885('0x2f')],_0x30814a['query']);_0x54dbd8['attributes']=_[_0xa885('0x2e')](_0x30814a[_0xa885('0x2f')],this[_0xa885('0x5')](_0x23dea1[_0xa885('0x2b')][_0xa885('0x5')]));_0x54dbd8[_0xa885('0x30')]=_0x54dbd8[_0xa885('0x30')][_0xa885('0x21')]?_0x54dbd8[_0xa885('0x30')]:_0x30814a['model'];if(!_0x23dea1['query'][_0xa885('0x31')]('nolimit')){_0x54dbd8['limit']=this[_0xa885('0x15')](_0x23dea1['query'][_0xa885('0x15')]);_0x54dbd8[_0xa885('0x16')]=this[_0xa885('0x16')](_0x23dea1[_0xa885('0x2b')][_0xa885('0x16')]);}_0x54dbd8[_0xa885('0x32')]=this[_0xa885('0x17')](_0x23dea1[_0xa885('0x2b')][_0xa885('0x17')]);_0x54dbd8[_0xa885('0x33')]=this['filters'](_[_0xa885('0x34')](_0x23dea1[_0xa885('0x2b')],_0x30814a[_0xa885('0x6')]),_0x15f3a);if(_0x23dea1[_0xa885('0x2b')][_0xa885('0x35')]){var _0x5e327f=_0x15f3a;var _0x57d912=_0x23dea1[_0xa885('0x2b')][_0xa885('0x35')];if(typeof _0x57d912===_0xa885('0x36')){_0x5e327f=_[_0xa885('0x35')](_0x15f3a,function(_0x1cfe71){return _['includes'](_0x57d912[_0xa885('0x37')],_0x1cfe71[_0xa885('0x2d')]);});_0x57d912=_0x57d912['value'];}_0x54dbd8['where']=_[_0xa885('0x38')](_0x54dbd8[_0xa885('0x33')],{'$or':_['map'](_0x5e327f,function(_0x561bf0){if(_0x561bf0[_0xa885('0xa')]!==_0xa885('0x39')){if(_0x5ed672){return sequelize[_0xa885('0x33')](sequelize['fn'](_0xa885('0x3a'),sequelize[_0xa885('0x1b')](_0x561bf0[_0xa885('0x2d')])),{'$like':sequelize['fn'](_0xa885('0x3a'),'%'+_0x23dea1[_0xa885('0x2b')][_0xa885('0x35')]+'%')});}else{var _0x3dcf63={};_0x3dcf63[_0x561bf0[_0xa885('0x2d')]]={'$like':'%'+_0x23dea1['query'][_0xa885('0x35')]+'%'};return _0x3dcf63;}}})});}_0x54dbd8=_[_0xa885('0x38')]({},_0x54dbd8,_0x23dea1[_0xa885('0x3b')]);return _0x54dbd8;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 9ce2529..e5afe7f 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x4571ae,_0x5309bf){var _0x52b48b=function(_0x20695c){while(--_0x20695c){_0x4571ae['push'](_0x4571ae['shift']());}};_0x52b48b(++_0x5309bf);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x2627e3,_0x5bb123){var _0x55621b=function(_0x230e5a){while(--_0x230e5a){_0x2627e3['push'](_0x2627e3['shift']());}};_0x55621b(++_0x5bb123);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 9de1fa1..144917b 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 _0x9f38=['model','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','utf8','replace','macAddress','ipAddress','substring','crypto','bimedia-machine-uuid','networkInterfaces','orderBy','keys','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','127.0.0.1','map'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x9f38,0x100));var _0x89f3=function(_0x368575,_0x65d11b){_0x368575=_0x368575-0x0;var _0x2b1860=_0x9f38[_0x368575];return _0x2b1860;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x89f3('0x0'));var machine=require(_0x89f3('0x1'));var exec=require('child_process')['execSync'];var config=require('../environment');function getInterfaces(){var _0x26abc8=[];var _0x45d9ec=os[_0x89f3('0x2')]();var _0x373fa8=_[_0x89f3('0x3')](_[_0x89f3('0x4')](_0x45d9ec));for(var _0x42efec=0x0;_0x42efec<_0x373fa8['length'];_0x42efec++){var _0x215522=_0x45d9ec[_0x373fa8[_0x42efec]]['filter'](function(_0x1c5784){return _0x1c5784[_0x89f3('0x5')]===_0x89f3('0x6')&&_0x1c5784[_0x89f3('0x7')]===![];});_0x26abc8=_0x26abc8[_0x89f3('0x8')](_0x215522);}return _0x26abc8;}function getFirstInterface(){var _0x5cb9a6=_[_0x89f3('0x9')](getInterfaces());return{'macAddress':_0x5cb9a6&&_0x5cb9a6[_0x89f3('0xa')]?_0x5cb9a6[_0x89f3('0xa')]:_0x89f3('0xb'),'ipAddress':_0x5cb9a6&&_0x5cb9a6['address']?_0x5cb9a6['address']:_0x89f3('0xc')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x39af10=_[_0x89f3('0x3')](os['cpus']()[_0x89f3('0xd')](function(_0x59ad69){return _0x59ad69[_0x89f3('0xe')];}))['join'](':');return crypto[_0x89f3('0xf')](_0x89f3('0x10'))[_0x89f3('0x11')](_0x39af10)[_0x89f3('0x12')](_0x89f3('0x13'));}exports[_0x89f3('0x14')]=function(){var _0x3408ee=os[_0x89f3('0x15')]();var _0x341f2a=/[0-9a-f-]{36}/;if(config[_0x89f3('0x16')]&&_0x341f2a[_0x89f3('0x17')](config[_0x89f3('0x16')])){return config[_0x89f3('0x16')];}else if(_0x3408ee===_0x89f3('0x18')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x89f3('0x19')})[_0x89f3('0x1a')]('\x0d\x0a','');}else{var _0x18603c=getFirstInterface();var _0x55cad0=getCPUhash();var _0x238e78=_0x55cad0+'|'+os['hostname']()+'|'+_0x18603c[_0x89f3('0x1b')]+'|'+_0x18603c[_0x89f3('0x1c')];var _0x1289b5=crypto[_0x89f3('0xf')](_0x89f3('0x10'))['update'](_0x238e78)[_0x89f3('0x12')](_0x89f3('0x13'));return _0x1289b5['substring'](0x0,0x8)+'-'+_0x1289b5[_0x89f3('0x1d')](0x8,0xc)+'-'+_0x1289b5[_0x89f3('0x1d')](0xc,0x10)+'-'+_0x1289b5[_0x89f3('0x1d')](0x10,0x14)+'-'+_0x1289b5[_0x89f3('0x1d')](0x14);}}; \ No newline at end of file +var _0x7227=['filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','map','model','join','createHash','update','digest','hex','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','md5','substring','lodash','crypto','bimedia-machine-uuid','execSync','../environment','networkInterfaces','orderBy','keys','length'];(function(_0x3c9faf,_0x498703){var _0x53cecc=function(_0x85e967){while(--_0x85e967){_0x3c9faf['push'](_0x3c9faf['shift']());}};_0x53cecc(++_0x498703);}(_0x7227,0x129));var _0x7722=function(_0x26a4ea,_0xa72fb8){_0x26a4ea=_0x26a4ea-0x0;var _0x1b669e=_0x7227[_0x26a4ea];return _0x1b669e;};'use strict';var _=require(_0x7722('0x0'));var os=require('os');var crypto=require(_0x7722('0x1'));var machine=require(_0x7722('0x2'));var exec=require('child_process')[_0x7722('0x3')];var config=require(_0x7722('0x4'));function getInterfaces(){var _0x2e5166=[];var _0x2914a8=os[_0x7722('0x5')]();var _0x283479=_[_0x7722('0x6')](_[_0x7722('0x7')](_0x2914a8));for(var _0x335cf2=0x0;_0x335cf2<_0x283479[_0x7722('0x8')];_0x335cf2++){var _0x31c49e=_0x2914a8[_0x283479[_0x335cf2]][_0x7722('0x9')](function(_0x227caf){return _0x227caf[_0x7722('0xa')]===_0x7722('0xb')&&_0x227caf[_0x7722('0xc')]===![];});_0x2e5166=_0x2e5166[_0x7722('0xd')](_0x31c49e);}return _0x2e5166;}function getFirstInterface(){var _0x49ed92=_[_0x7722('0xe')](getInterfaces());return{'macAddress':_0x49ed92&&_0x49ed92[_0x7722('0xf')]?_0x49ed92[_0x7722('0xf')]:_0x7722('0x10'),'ipAddress':_0x49ed92&&_0x49ed92[_0x7722('0x11')]?_0x49ed92[_0x7722('0x11')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x48e2a4=_['orderBy'](os['cpus']()[_0x7722('0x12')](function(_0x48b3f8){return _0x48b3f8[_0x7722('0x13')];}))[_0x7722('0x14')](':');return crypto[_0x7722('0x15')]('md5')[_0x7722('0x16')](_0x48e2a4)[_0x7722('0x17')](_0x7722('0x18'));}exports[_0x7722('0x19')]=function(){var _0x11cc9f=os['platform']();var _0x113857=/[0-9a-f-]{36}/;if(config[_0x7722('0x1a')]&&_0x113857[_0x7722('0x1b')](config[_0x7722('0x1a')])){return config[_0x7722('0x1a')];}else if(_0x11cc9f===_0x7722('0x1c')){return exec(_0x7722('0x1d'),{'encoding':_0x7722('0x1e')})[_0x7722('0x1f')]('\x0d\x0a','');}else{var _0x5d4cad=getFirstInterface();var _0x4d163d=getCPUhash();var _0x1a924d=_0x4d163d+'|'+os['hostname']()+'|'+_0x5d4cad['macAddress']+'|'+_0x5d4cad['ipAddress'];var _0x41776e=crypto[_0x7722('0x15')](_0x7722('0x20'))['update'](_0x1a924d)[_0x7722('0x17')](_0x7722('0x18'));return _0x41776e[_0x7722('0x21')](0x0,0x8)+'-'+_0x41776e[_0x7722('0x21')](0x8,0xc)+'-'+_0x41776e['substring'](0xc,0x10)+'-'+_0x41776e['substring'](0x10,0x14)+'-'+_0x41776e['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index a1d2524..17069f7 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 _0xdd85=['THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','days','DEMO\x20START\x20AT\x20%s','catch','error','getUuid','License','findOrCreate','spread','util','moment','version','../../mysqldb','./hardware','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','get','data1','active','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info'];(function(_0x215971,_0x37ea84){var _0x1031a4=function(_0x4bcdc4){while(--_0x4bcdc4){_0x215971['push'](_0x215971['shift']());}};_0x1031a4(++_0x37ea84);}(_0xdd85,0x1b5));var _0x5dd8=function(_0x76c010,_0x445a88){_0x76c010=_0x76c010-0x0;var _0x288bc6=_0xdd85[_0x76c010];return _0x288bc6;};'use strict';var util=require(_0x5dd8('0x0'));var moment=require(_0x5dd8('0x1'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0x5dd8('0x2'));var db=require(_0x5dd8('0x3'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x5dd8('0x4'));var logger=require('../logger')(_0x5dd8('0x5'));var HOST=_0x5dd8('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3bfb2c){return new BPromise(function(_0x331105,_0x425669){var _0x4941f6=util['format'](_0x5dd8('0x7'),HOST,_0x3bfb2c,module[_0x5dd8('0x8')][_0x5dd8('0x2')]);if(oldToken){_0x4941f6=util[_0x5dd8('0x9')](_0x5dd8('0xa'),HOST,_0x3bfb2c,module[_0x5dd8('0x8')]['version'],oldToken);}var _0x22c9c8={'uri':_0x4941f6,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x22c9c8)[_0x5dd8('0xb')](function(_0x1fc2f4){_0x331105(_0x1fc2f4);})['catch'](function(_0x41500c){_0x425669(_0x41500c);});});}function manageLicense(_0xa47f04,_0xd59dc7){var _0x1134fd=_0xd59dc7[_0x5dd8('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x1134fd[_0x5dd8('0xd')]!==_0xa47f04&&!_0x1134fd['data2']){oldToken=_0x1134fd[_0x5dd8('0xd')];}httpRequest(_0xa47f04)[_0x5dd8('0xb')](function(_0x1d77fd){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1d77fd[_0x5dd8('0xe')]){isOldTokenSent=![];if(!_0x1134fd[_0x5dd8('0x5')]&&_0x1134fd[_0x5dd8('0x5')]!=_0x1d77fd[_0x5dd8('0x5')]||_0x1134fd[_0x5dd8('0x5')]&&_0x1134fd[_0x5dd8('0xf')]){logger['info'](_0x5dd8('0x10'));}if(_0x1134fd[_0x5dd8('0x5')]&&!_0x1134fd[_0x5dd8('0xf')]&&_0x1134fd[_0x5dd8('0x5')]!=_0x1d77fd['license']){logger[_0x5dd8('0x11')](_0x5dd8('0x12'));}if(_0x1134fd[_0x5dd8('0x5')]&&!_0x1134fd[_0x5dd8('0xf')]&&_0x1134fd[_0x5dd8('0x5')]==_0x1d77fd[_0x5dd8('0x5')]){return _0xd59dc7;}return _0xd59dc7[_0x5dd8('0x13')]({'data1':_0xa47f04,'data2':null,'license':_0x1d77fd[_0x5dd8('0x5')]});}else{if(_0x1d77fd['license']||_0x1134fd[_0x5dd8('0x5')]){if(!_0x1134fd[_0x5dd8('0xf')]){if(_0x1134fd[_0x5dd8('0xd')]==_0xa47f04){GRAY_PERIOD_REASON=_0x5dd8('0x14');logger[_0x5dd8('0x11')](_0x5dd8('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x5dd8('0x11')](_0x5dd8('0x16'),_0x1134fd[_0x5dd8('0xd')],_0xa47f04);}logger[_0x5dd8('0x11')](_0x5dd8('0x17'),GRAY_PERIOD_REASON[_0x5dd8('0x18')](),moment()[_0x5dd8('0x9')](_0x5dd8('0x19')));return _0xd59dc7['update']({'data2':encryptor[_0x5dd8('0x1a')](moment()['format'](_0x5dd8('0x19')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x1134fd[_0x5dd8('0xf')]),_0x5dd8('0x1b'))>DAYS){logger['info'](_0x5dd8('0x1c'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0xd59dc7[_0x5dd8('0x13')]({'data1':_0xa47f04,'data2':null,'license':null});}}}else{if(_0x1134fd[_0x5dd8('0xd')]!=_0xa47f04){logger[_0x5dd8('0x11')](_0x5dd8('0x16'),_0x1134fd['data1'],_0xa47f04);return _0xd59dc7[_0x5dd8('0x13')]({'data1':_0xa47f04,'data2':null,'license':null});}}}return _0xd59dc7;})['then'](function(_0x231cd3){_0xd59dc7=_0x231cd3;})[_0x5dd8('0x1d')](function(_0xbca670){logger[_0x5dd8('0x1e')](_0xbca670['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x5dd8('0x1f')](),_0xd59dc7);},TIME);});}function defaultLicense(){var _0x4606da=hardware['getUuid']();if(_0x4606da){return db[_0x5dd8('0x20')][_0x5dd8('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x4606da}})[_0x5dd8('0x22')](function(_0x2203a9,_0x329b43){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x4606da);manageLicense(_0x4606da,_0x2203a9);})['catch'](function(_0x5a4752){logger[_0x5dd8('0x1e')](_0x5a4752['message']);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x7f9b=['pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','finally','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','request-promise','bluebird'];(function(_0x4b7c65,_0x48df1d){var _0x16a07f=function(_0x120abf){while(--_0x120abf){_0x4b7c65['push'](_0x4b7c65['shift']());}};_0x16a07f(++_0x48df1d);}(_0x7f9b,0x100));var _0xb7f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7f9b[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xb7f9('0x0'));var moment=require('moment');var rp=require(_0xb7f9('0x1'));var BPromise=require(_0xb7f9('0x2'));var pkginfo=require(_0xb7f9('0x3'))(module,_0xb7f9('0x4'));var db=require(_0xb7f9('0x5'))['db'];var encryptor=require(_0xb7f9('0x6'));var hardware=require(_0xb7f9('0x7'));var logger=require(_0xb7f9('0x8'))(_0xb7f9('0x9'));var HOST=_0xb7f9('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2b7829){return new BPromise(function(_0x23db02,_0x452f14){var _0x1c901d=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x2b7829,module[_0xb7f9('0xb')][_0xb7f9('0x4')]);if(oldToken){_0x1c901d=util[_0xb7f9('0xc')](_0xb7f9('0xd'),HOST,_0x2b7829,module[_0xb7f9('0xb')]['version'],oldToken);}var _0x45710d={'uri':_0x1c901d,'method':_0xb7f9('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x45710d)[_0xb7f9('0xf')](function(_0x43d13c){_0x23db02(_0x43d13c);})[_0xb7f9('0x10')](function(_0x41b011){_0x452f14(_0x41b011);});});}function manageLicense(_0x2d6bca,_0x10f33c){var _0x59285d=_0x10f33c[_0xb7f9('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x59285d[_0xb7f9('0x12')]!==_0x2d6bca&&!_0x59285d[_0xb7f9('0x13')]){oldToken=_0x59285d[_0xb7f9('0x12')];}httpRequest(_0x2d6bca)[_0xb7f9('0xf')](function(_0x383cfe){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x383cfe[_0xb7f9('0x14')]){isOldTokenSent=![];if(!_0x59285d['license']&&_0x59285d[_0xb7f9('0x9')]!=_0x383cfe[_0xb7f9('0x9')]||_0x59285d['license']&&_0x59285d['data2']){logger[_0xb7f9('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x59285d[_0xb7f9('0x9')]&&!_0x59285d[_0xb7f9('0x13')]&&_0x59285d[_0xb7f9('0x9')]!=_0x383cfe['license']){logger[_0xb7f9('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x59285d[_0xb7f9('0x9')]&&!_0x59285d[_0xb7f9('0x13')]&&_0x59285d[_0xb7f9('0x9')]==_0x383cfe['license']){return _0x10f33c;}return _0x10f33c[_0xb7f9('0x16')]({'data1':_0x2d6bca,'data2':null,'license':_0x383cfe[_0xb7f9('0x9')]});}else{if(_0x383cfe[_0xb7f9('0x9')]||_0x59285d['license']){if(!_0x59285d[_0xb7f9('0x13')]){if(_0x59285d[_0xb7f9('0x12')]==_0x2d6bca){GRAY_PERIOD_REASON='Disabled';logger['info'](_0xb7f9('0x17'));}else{GRAY_PERIOD_REASON=_0xb7f9('0x18');logger[_0xb7f9('0x15')](_0xb7f9('0x19'),_0x59285d[_0xb7f9('0x12')],_0x2d6bca);}logger[_0xb7f9('0x15')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xb7f9('0x1a')](),moment()[_0xb7f9('0xc')](_0xb7f9('0x1b')));return _0x10f33c[_0xb7f9('0x16')]({'data2':encryptor[_0xb7f9('0x1c')](moment()[_0xb7f9('0xc')](_0xb7f9('0x1b')))});}else{if(moment()[_0xb7f9('0x1d')](encryptor['decryptString'](_0x59285d['data2']),_0xb7f9('0x1e'))>DAYS){logger[_0xb7f9('0x15')]('DEMO\x20START\x20AT\x20%s',moment()[_0xb7f9('0xc')](_0xb7f9('0x1b')));isOldTokenSent=![];return _0x10f33c[_0xb7f9('0x16')]({'data1':_0x2d6bca,'data2':null,'license':null});}}}else{if(_0x59285d[_0xb7f9('0x12')]!=_0x2d6bca){logger[_0xb7f9('0x15')](_0xb7f9('0x19'),_0x59285d['data1'],_0x2d6bca);return _0x10f33c['update']({'data1':_0x2d6bca,'data2':null,'license':null});}}}return _0x10f33c;})[_0xb7f9('0xf')](function(_0x89d41d){_0x10f33c=_0x89d41d;})[_0xb7f9('0x10')](function(_0x390604){logger['error'](_0x390604['message']);})[_0xb7f9('0x1f')](function(){setTimeout(function(){manageLicense(hardware[_0xb7f9('0x20')](),_0x10f33c);},TIME);});}function defaultLicense(){var _0x286c72=hardware[_0xb7f9('0x20')]();if(_0x286c72){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x286c72}})[_0xb7f9('0x21')](function(_0xc93ace,_0x24ab86){logger[_0xb7f9('0x15')](_0xb7f9('0x22'),_0x286c72);manageLicense(_0x286c72,_0xc93ace);})[_0xb7f9('0x10')](function(_0x4e5340){logger[_0xb7f9('0x23')](_0x4e5340['message']);});}}exports[_0xb7f9('0x24')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index e640d8c..f6fba3a 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 _0x29a5=['license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','parse','demo','uuid','machineUuid','decryptString','gray','deadline','add','days','changed','disabled','message','User','findAll','sequelize','COUNT','role','count','admin','user','users','telephones','forEach','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','bluebird','../../mysqldb','Demo\x20license','getUuid','Breaking\x20license','defaults','then','catch','data1'];(function(_0x4041cd,_0x3b12fe){var _0x59486c=function(_0x48b3d8){while(--_0x48b3d8){_0x4041cd['push'](_0x4041cd['shift']());}};_0x59486c(++_0x3b12fe);}(_0x29a5,0x10e));var _0x529a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x29a5[_0x4d613c];return _0x301fe3;};'use strict';var util=require(_0x529a('0x0'));var _=require(_0x529a('0x1'));var moment=require(_0x529a('0x2'));var BPromise=require(_0x529a('0x3'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0x529a('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x529a('0x5'),'machineUuid':hardware[_0x529a('0x6')](),'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':_0x529a('0x7'),'machineUuid':hardware[_0x529a('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x507e4a){return new BPromise(function(_0x10c153,_0x32adf9){return db['License']['find'](_[_0x529a('0x8')](_0x507e4a,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x502ef3){return checkLicense(_0x502ef3,null);})[_0x529a('0x9')](function(_0x373d78){_0x10c153(_0x373d78);return;})[_0x529a('0xa')](function(_0x2d8985){_0x32adf9(_0x2d8985);});});}function checkLicense(_0x4e8894,_0x22be76){if(!_0x4e8894){demoLicense['uuid']=_0x4e8894[_0x529a('0xb')];return demoLicense;}try{var _0x481d83=_0x22be76||_0x4e8894[_0x529a('0xc')];if(_[_0x529a('0xd')](_0x481d83)){throw new Error(_0x529a('0xe'));}var _0x38025f=_0x4e8894['data1'];var _0x453a5a=_0x4e8894[_0x529a('0xf')];var _0x1de1c6=_0x38025f[_0x529a('0x10')]('-')[0x4];var _0x425c23=_0x38025f['split']('-')[0x0];var _0x585806=encryptor['decryptString'](_0x481d83,util[_0x529a('0x11')](_0x529a('0x12'),_0x1de1c6,_0x38025f,_0x425c23));var _0x132acb=JSON[_0x529a('0x13')](_0x585806);_0x132acb[_0x529a('0x14')]=![];_0x132acb[_0x529a('0x15')]=_0x38025f;_0x132acb[_0x529a('0x16')]=hardware[_0x529a('0x6')]();if(_0x453a5a){var _0x3124cc=encryptor[_0x529a('0x17')](_0x453a5a);_0x132acb[_0x529a('0x18')]=_0x3124cc;_0x132acb[_0x529a('0x19')]=moment(_0x3124cc)[_0x529a('0x1a')](0x7,_0x529a('0x1b'))[_0x529a('0x11')]();_0x132acb['grayReason']=_0x132acb['uuid']!=_0x132acb[_0x529a('0x16')]?_0x529a('0x1c'):_0x529a('0x1d');}return _0x132acb;}catch(_0x59c1f0){breakingLicense[_0x529a('0x15')]=_0x4e8894[_0x529a('0xb')];breakingLicense['message']=_0x59c1f0[_0x529a('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3a78a0,_0x557d20){getLicense()[_0x529a('0x9')](function(_0x2a0727){return db[_0x529a('0x1f')][_0x529a('0x20')]({'attributes':['role',[db[_0x529a('0x21')]['fn'](_0x529a('0x22'),db['sequelize']['col'](_0x529a('0x23'))),_0x529a('0x24')]],'group':_0x529a('0x23'),'where':{'role':{'$or':[_0x529a('0x25'),_0x529a('0x26'),'telephone']}},'raw':!![]})[_0x529a('0x9')](function(_0x335d68){var _0x3b38bd={'user':_0x2a0727[_0x529a('0x27')]||0x0,'telephone':_0x2a0727[_0x529a('0x28')]||0x0};_0x335d68[_0x529a('0x29')](function(_0x3469b3){var _0x2eb171=_0x3469b3[_0x529a('0x23')]===_0x529a('0x25')?_0x529a('0x26'):_0x3469b3[_0x529a('0x23')];_0x3b38bd[_0x2eb171]-=_0x3469b3['count'];if(_0x3b38bd[_0x2eb171]<0x0)_0x3b38bd[_0x2eb171]=0x0;});_0x3a78a0(_0x3b38bd);return;});})[_0x529a('0xa')](function(_0x34c5f8){_0x557d20(_0x34c5f8);});});}function checkUserLimits(_0x47ff54){return new BPromise(function(_0x3e1650,_0xb32049){getLimits()['then'](function(_0x5c82b3){var _0x29419d=_[_0x529a('0x2a')](_[_0x529a('0x2b')](_0x47ff54,_0x529a('0x23')),['admin',_0x529a('0x26'),'telephone']);var _0x366172=(_0x29419d[_0x529a('0x25')]||0x0)+(_0x29419d[_0x529a('0x26')]||0x0);var _0x53816d=_0x29419d[_0x529a('0x2c')]||0x0;if(_0x366172>_0x5c82b3[_0x529a('0x26')])return _0xb32049(_0x529a('0x2d'));if(_0x53816d>_0x5c82b3[_0x529a('0x2c')])return _0xb32049(_0x529a('0x2e'));return _0x3e1650();})[_0x529a('0xa')](function(_0x3c4827){_0xb32049(_0x3c4827);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x5aa3=['data1','license','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','deadline','add','days','changed','disabled','message','User','findAll','role','COUNT','sequelize','col','count','admin','users','telephones','forEach','user','catch','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','find','defaults','then'];(function(_0x5738f2,_0x4e756b){var _0x22e1cf=function(_0x584011){while(--_0x584011){_0x5738f2['push'](_0x5738f2['shift']());}};_0x22e1cf(++_0x4e756b);}(_0x5aa3,0x174));var _0x35aa=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x5aa3[_0x8a969d];return _0x1d8dc7;};'use strict';var util=require(_0x35aa('0x0'));var _=require('lodash');var moment=require(_0x35aa('0x1'));var BPromise=require(_0x35aa('0x2'));var hardware=require(_0x35aa('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x35aa('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x35aa('0x5'),'machineUuid':hardware[_0x35aa('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x35aa('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x35aa('0x8'),'machineUuid':hardware[_0x35aa('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2f8ce5){return new BPromise(function(_0x495b5c,_0x50ac2e){return db['License'][_0x35aa('0x9')](_[_0x35aa('0xa')](_0x2f8ce5,{'raw':!![],'where':{'id':0x1}}))[_0x35aa('0xb')](function(_0x1de31c){return checkLicense(_0x1de31c,null);})[_0x35aa('0xb')](function(_0x29cc69){_0x495b5c(_0x29cc69);return;})['catch'](function(_0x5961b3){_0x50ac2e(_0x5961b3);});});}function checkLicense(_0x1301ad,_0x3ecc58){if(!_0x1301ad){demoLicense['uuid']=_0x1301ad[_0x35aa('0xc')];return demoLicense;}try{var _0x3d32ef=_0x3ecc58||_0x1301ad[_0x35aa('0xd')];if(_['isEmpty'](_0x3d32ef)){throw new Error(_0x35aa('0xe'));}var _0x3f6a87=_0x1301ad['data1'];var _0x27c799=_0x1301ad['data2'];var _0x582228=_0x3f6a87[_0x35aa('0xf')]('-')[0x4];var _0x42f28f=_0x3f6a87[_0x35aa('0xf')]('-')[0x0];var _0x21cf8e=encryptor[_0x35aa('0x10')](_0x3d32ef,util[_0x35aa('0x11')](_0x35aa('0x12'),_0x582228,_0x3f6a87,_0x42f28f));var _0x646cc1=JSON[_0x35aa('0x13')](_0x21cf8e);_0x646cc1[_0x35aa('0x14')]=![];_0x646cc1[_0x35aa('0x15')]=_0x3f6a87;_0x646cc1[_0x35aa('0x16')]=hardware[_0x35aa('0x6')]();if(_0x27c799){var _0x11e79c=encryptor[_0x35aa('0x10')](_0x27c799);_0x646cc1['gray']=_0x11e79c;_0x646cc1[_0x35aa('0x17')]=moment(_0x11e79c)[_0x35aa('0x18')](0x7,_0x35aa('0x19'))['format']();_0x646cc1['grayReason']=_0x646cc1[_0x35aa('0x15')]!=_0x646cc1[_0x35aa('0x16')]?_0x35aa('0x1a'):_0x35aa('0x1b');}return _0x646cc1;}catch(_0x420f8e){breakingLicense['uuid']=_0x1301ad['data1'];breakingLicense[_0x35aa('0x1c')]=_0x420f8e[_0x35aa('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1b2135,_0x114ce5){getLicense()[_0x35aa('0xb')](function(_0x404bcb){return db[_0x35aa('0x1d')][_0x35aa('0x1e')]({'attributes':[_0x35aa('0x1f'),[db['sequelize']['fn'](_0x35aa('0x20'),db[_0x35aa('0x21')][_0x35aa('0x22')](_0x35aa('0x1f'))),_0x35aa('0x23')]],'group':_0x35aa('0x1f'),'where':{'role':{'$or':[_0x35aa('0x24'),'user','telephone']}},'raw':!![]})[_0x35aa('0xb')](function(_0x205c73){var _0x17f6ae={'user':_0x404bcb[_0x35aa('0x25')]||0x0,'telephone':_0x404bcb[_0x35aa('0x26')]||0x0};_0x205c73[_0x35aa('0x27')](function(_0x30da42){var _0x437c63=_0x30da42['role']===_0x35aa('0x24')?_0x35aa('0x28'):_0x30da42[_0x35aa('0x1f')];_0x17f6ae[_0x437c63]-=_0x30da42['count'];if(_0x17f6ae[_0x437c63]<0x0)_0x17f6ae[_0x437c63]=0x0;});_0x1b2135(_0x17f6ae);return;});})[_0x35aa('0x29')](function(_0x145574){_0x114ce5(_0x145574);});});}function checkUserLimits(_0x1ace7e){return new BPromise(function(_0x408d5b,_0x4e4589){getLimits()['then'](function(_0x47402f){var _0x539989=_[_0x35aa('0x2a')](_[_0x35aa('0x2b')](_0x1ace7e,_0x35aa('0x1f')),[_0x35aa('0x24'),_0x35aa('0x28'),_0x35aa('0x2c')]);var _0x2f367e=(_0x539989['admin']||0x0)+(_0x539989[_0x35aa('0x28')]||0x0);var _0x3fde17=_0x539989['telephone']||0x0;if(_0x2f367e>_0x47402f[_0x35aa('0x28')])return _0x4e4589(_0x35aa('0x2d'));if(_0x3fde17>_0x47402f[_0x35aa('0x2c')])return _0x4e4589(_0x35aa('0x2e'));return _0x408d5b();})[_0x35aa('0x29')](function(_0x12c6e9){_0x4e4589(_0x12c6e9);});});}module[_0x35aa('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 1b4cf0c..7e0d26b 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 _0x8f59=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x8f59,0x11d));var _0x98f5=function(_0xac0de1,_0x12d3d9){_0xac0de1=_0xac0de1-0x0;var _0x1c1995=_0x8f59[_0xac0de1];return _0x1c1995;};'use strict';module[_0x98f5('0x0')]={'DOMAIN':_0x98f5('0x1'),'SESSION_SECRET':_0x98f5('0x2'),'GOOGLE_ID':_0x98f5('0x3'),'GOOGLE_SECRET':_0x98f5('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xd914=['http://localhost:9000','app-id','secret','exports'];(function(_0x53d7a8,_0x42bd72){var _0x4caee1=function(_0x11fda6){while(--_0x11fda6){_0x53d7a8['push'](_0x53d7a8['shift']());}};_0x4caee1(++_0x42bd72);}(_0xd914,0x17f));var _0x4d91=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0xd914[_0x18a436];return _0x5c2cf8;};'use strict';module[_0x4d91('0x0')]={'DOMAIN':_0x4d91('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4d91('0x2'),'GOOGLE_SECRET':_0x4d91('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index cdb3653..fca35e4 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8561=['../utils/loggers','fileLogger'];(function(_0x4b4cf2,_0x25c278){var _0xdaebd8=function(_0x4e82c9){while(--_0x4e82c9){_0x4b4cf2['push'](_0x4b4cf2['shift']());}};_0xdaebd8(++_0x25c278);}(_0x8561,0xba));var _0x1856=function(_0x2f8b0f,_0x532d7c){_0x2f8b0f=_0x2f8b0f-0x0;var _0x34273d=_0x8561[_0x2f8b0f];return _0x34273d;};'use strict';var fileLogger=require(_0x1856('0x0'))[_0x1856('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0x1fe4=['exports','fileLogger'];(function(_0x4e3577,_0x405200){var _0x550df9=function(_0x26fae4){while(--_0x26fae4){_0x4e3577['push'](_0x4e3577['shift']());}};_0x550df9(++_0x405200);}(_0x1fe4,0x135));var _0x41fe=function(_0x837dad,_0x1d9098){_0x837dad=_0x837dad-0x0;var _0x1d62d3=_0x1fe4[_0x837dad];return _0x1d62d3;};'use strict';var fileLogger=require('../utils/loggers')[_0x41fe('0x0')];module[_0x41fe('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index d87c4ed..2bfba4a 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 _0xadcf=['../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','path','express','join','ami','agi','../../services/agi/index.js'];(function(_0x45ed3c,_0x5eb4c1){var _0x8b5434=function(_0x1afacd){while(--_0x1afacd){_0x45ed3c['push'](_0x45ed3c['shift']());}};_0x8b5434(++_0x5eb4c1);}(_0xadcf,0x162));var _0xfadc=function(_0x10fc1d,_0x1966e4){_0x10fc1d=_0x10fc1d-0x0;var _0x19cc91=_0xadcf[_0x10fc1d];return _0x19cc91;};'use strict';var path=require(_0xfadc('0x0'));var os=require('os');var config={'apps':[{'name':_0xfadc('0x1'),'script':path[_0xfadc('0x2')](__dirname,'../../services/express/index.js')},{'name':_0xfadc('0x3'),'script':path[_0xfadc('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0xfadc('0x4'),'script':path['join'](__dirname,_0xfadc('0x5'))},{'name':'email','script':path[_0xfadc('0x2')](__dirname,_0xfadc('0x6'))},{'name':_0xfadc('0x7'),'script':path['join'](__dirname,_0xfadc('0x8'))},{'name':'xdr','script':path[_0xfadc('0x2')](__dirname,_0xfadc('0x9'))}]};module['exports']=config; \ No newline at end of file +var _0xa333=['path','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','join','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa333,0x195));var _0x3a33=function(_0x3032cd,_0x4cf98a){_0x3032cd=_0x3032cd-0x0;var _0x36e8da=_0xa333[_0x3032cd];return _0x36e8da;};'use strict';var path=require(_0x3a33('0x0'));var os=require('os');var config={'apps':[{'name':_0x3a33('0x1'),'script':path['join'](__dirname,_0x3a33('0x2'))},{'name':_0x3a33('0x3'),'script':path['join'](__dirname,_0x3a33('0x4'))},{'name':_0x3a33('0x5'),'script':path['join'](__dirname,_0x3a33('0x6'))},{'name':_0x3a33('0x7'),'script':path[_0x3a33('0x8')](__dirname,_0x3a33('0x9'))},{'name':_0x3a33('0xa'),'script':path[_0x3a33('0x8')](__dirname,_0x3a33('0xb'))},{'name':_0x3a33('0xc'),'script':path[_0x3a33('0x8')](__dirname,_0x3a33('0xd'))}]};module[_0x3a33('0xe')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index e25f3fd..770eac7 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 _0x3660=['describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3660,0x8b));var _0x0366=function(_0x44499c,_0x2ba66a){_0x44499c=_0x44499c-0x0;var _0x33cce5=_0x3660[_0x44499c];return _0x33cce5;};'use strict';var pm2=require(_0x0366('0x0'));var BPromise=require(_0x0366('0x1'));var config=require(_0x0366('0x2'));function connect(){return new BPromise(function(_0x515d6c,_0x4d766f){return pm2[_0x0366('0x3')](function(_0x2f73ce){if(_0x2f73ce){return _0x4d766f(_0x2f73ce);}return _0x515d6c(_0x0366('0x4'));});});};exports[_0x0366('0x5')]=function(_0x24e87d){return connect()[_0x0366('0x6')](function(){return new BPromise(function(_0x316cb2,_0x3e2d46){return pm2[_0x0366('0x5')](_0x24e87d,function(_0x674a78,_0x106099){if(_0x674a78){return _0x3e2d46(_0x674a78);}pm2[_0x0366('0x7')]();return _0x316cb2(_0x106099);});});});};exports[_0x0366('0x8')]=function(_0x32df01){return connect()['then'](function(){return new BPromise(function(_0x119ff3,_0x33c3bb){return pm2['stop'](_0x32df01,function(_0xb521c7,_0x1939e2){if(_0xb521c7){return _0x33c3bb(_0xb521c7);}pm2[_0x0366('0x7')]();return _0x119ff3(_0x1939e2);});});});};exports['restart']=function(_0x25f297){return connect()[_0x0366('0x6')](function(){return new BPromise(function(_0xe1bb05,_0x1d9e6e){return pm2[_0x0366('0x9')](_0x25f297,function(_0x1a150e,_0x419fb8){if(_0x1a150e){return _0x1d9e6e(_0x1a150e);}pm2[_0x0366('0x7')]();return _0xe1bb05(_0x419fb8);});});});};exports['list']=function(){return connect()[_0x0366('0x6')](function(){return new BPromise(function(_0x207a60,_0x312548){return pm2[_0x0366('0xa')](function(_0xc6be44,_0x4cfdda){if(_0xc6be44){return _0x312548(_0xc6be44);}pm2[_0x0366('0x7')]();return _0x207a60(_0x4cfdda);});});});};exports[_0x0366('0xb')]=function(_0x47f746){return connect()[_0x0366('0x6')](function(){return new BPromise(function(_0x8749ea,_0x53f740){return pm2[_0x0366('0xb')](_0x47f746,function(_0x50c140,_0x5b4efb){if(_0x50c140){return _0x53f740(_0x50c140);}pm2[_0x0366('0x7')]();return _0x8749ea(_0x5b4efb);});});});};exports[_0x0366('0xc')]=function(_0x1a3572){return connect()[_0x0366('0x6')](function(){return new BPromise(function(_0x4f78e7,_0x13780c){return pm2[_0x0366('0xc')](_0x1a3572,function(_0x47fcb2,_0x3ba09d){if(_0x47fcb2){return _0x13780c(_0x47fcb2);}pm2[_0x0366('0x7')]();return _0x4f78e7(_0x3ba09d);});});});};exports[_0x0366('0xd')]=function(){return connect()['then'](function(){return new BPromise(function(_0xad028d,_0x169dcc){return pm2['dump'](function(_0xa1597c){if(_0xa1597c){return _0x169dcc(_0xa1597c);}return _0xad028d(_0x0366('0xe'));});});});}; \ No newline at end of file +var _0xd3e5=['describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','disconnect','stop','restart','then','list'];(function(_0x3aeb33,_0x15e14d){var _0x33879e=function(_0x2a2452){while(--_0x2a2452){_0x3aeb33['push'](_0x3aeb33['shift']());}};_0x33879e(++_0x15e14d);}(_0xd3e5,0xe5));var _0x5d3e=function(_0x29a68b,_0x43a441){_0x29a68b=_0x29a68b-0x0;var _0x2f6dd6=_0xd3e5[_0x29a68b];return _0x2f6dd6;};'use strict';var pm2=require(_0x5d3e('0x0'));var BPromise=require(_0x5d3e('0x1'));var config=require(_0x5d3e('0x2'));function connect(){return new BPromise(function(_0x81e56f,_0x521276){return pm2[_0x5d3e('0x3')](function(_0xac08cc){if(_0xac08cc){return _0x521276(_0xac08cc);}return _0x81e56f(_0x5d3e('0x4'));});});};exports[_0x5d3e('0x5')]=function(_0x5f37fb){return connect()['then'](function(){return new BPromise(function(_0x36cc4d,_0x5b644c){return pm2[_0x5d3e('0x5')](_0x5f37fb,function(_0x6eada7,_0x3a76c2){if(_0x6eada7){return _0x5b644c(_0x6eada7);}pm2[_0x5d3e('0x6')]();return _0x36cc4d(_0x3a76c2);});});});};exports[_0x5d3e('0x7')]=function(_0x17aa0e){return connect()['then'](function(){return new BPromise(function(_0x166d11,_0x3497e1){return pm2[_0x5d3e('0x7')](_0x17aa0e,function(_0x3fd347,_0x11c1bd){if(_0x3fd347){return _0x3497e1(_0x3fd347);}pm2[_0x5d3e('0x6')]();return _0x166d11(_0x11c1bd);});});});};exports[_0x5d3e('0x8')]=function(_0xdd3b33){return connect()[_0x5d3e('0x9')](function(){return new BPromise(function(_0x437f45,_0x391a1b){return pm2['restart'](_0xdd3b33,function(_0x35071b,_0x463285){if(_0x35071b){return _0x391a1b(_0x35071b);}pm2['disconnect']();return _0x437f45(_0x463285);});});});};exports[_0x5d3e('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x3595e2,_0x356f56){return pm2['list'](function(_0x35750b,_0x445d27){if(_0x35750b){return _0x356f56(_0x35750b);}pm2[_0x5d3e('0x6')]();return _0x3595e2(_0x445d27);});});});};exports[_0x5d3e('0xb')]=function(_0x417973){return connect()[_0x5d3e('0x9')](function(){return new BPromise(function(_0xb8b0b5,_0x378245){return pm2[_0x5d3e('0xb')](_0x417973,function(_0x77042d,_0x528311){if(_0x77042d){return _0x378245(_0x77042d);}pm2[_0x5d3e('0x6')]();return _0xb8b0b5(_0x528311);});});});};exports[_0x5d3e('0xc')]=function(_0x228623){return connect()['then'](function(){return new BPromise(function(_0x105a63,_0x2cd06c){return pm2[_0x5d3e('0xc')](_0x228623,function(_0x135ec9,_0x134958){if(_0x135ec9){return _0x2cd06c(_0x135ec9);}pm2[_0x5d3e('0x6')]();return _0x105a63(_0x134958);});});});};exports[_0x5d3e('0xd')]=function(){return connect()[_0x5d3e('0x9')](function(){return new BPromise(function(_0x296ebe,_0x18ba75){return pm2[_0x5d3e('0xd')](function(_0x129651){if(_0x129651){return _0x18ba75(_0x129651);}return _0x296ebe(_0x5d3e('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index f761ecd..4a0dc56 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 _0x7bbf=['error','[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','socket.io-emitter','Setting','chatTimeout','ChatInteraction','findAll','lastMsgAt','minutes','then','length','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch'];(function(_0x2b9b81,_0x5d028b){var _0xd2bfee=function(_0x1ba090){while(--_0x1ba090){_0x2b9b81['push'](_0x2b9b81['shift']());}};_0xd2bfee(++_0x5d028b);}(_0x7bbf,0x108));var _0xf7bb=function(_0x1ea2eb,_0x2f4e86){_0x1ea2eb=_0x1ea2eb-0x0;var _0x44290d=_0x7bbf[_0x1ea2eb];return _0x44290d;};'use strict';var _=require('lodash');var moment=require(_0xf7bb('0x0'));var Redis=require(_0xf7bb('0x1'));var util=require('util');var config=require(_0xf7bb('0x2'));var db=require(_0xf7bb('0x3'))['db'];var logger=require(_0xf7bb('0x4'))(_0xf7bb('0x5'));config[_0xf7bb('0x6')]=_['defaults'](config[_0xf7bb('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xf7bb('0x7'))(new Redis(config[_0xf7bb('0x6')]));function closeInteractions(){var _0x387505=0x0;var _0x2fe899=[];return db[_0xf7bb('0x8')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x48abf2){_0x387505=_0x48abf2[_0xf7bb('0x9')];if(_0x387505){return db[_0xf7bb('0xa')][_0xf7bb('0xb')]({'raw':!![],'attributes':['id',_0xf7bb('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x48abf2['chatTimeout'],_0xf7bb('0xd'))}}});}else{return[];}})[_0xf7bb('0xe')](function(_0x46df14){if(_0x46df14&&_0x46df14[_0xf7bb('0xf')]){_0x2fe899=_['map'](_0x46df14||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x2fe899[_0xf7bb('0x10')]());return db[_0xf7bb('0xa')]['update']({'closeReason':_0xf7bb('0x11'),'disposition':_0xf7bb('0x12'),'closed':!![],'closedAt':moment()[_0xf7bb('0x13')](_0xf7bb('0x14'))},{'where':{'id':_0x2fe899}});}})[_0xf7bb('0xe')](function(){if(_0x2fe899&&_0x2fe899[_0xf7bb('0xf')]){logger[_0xf7bb('0x15')](_0xf7bb('0x16'),_0x2fe899['join']());for(var _0x5b2861=0x0;_0x5b2861<_0x2fe899['length'];_0x5b2861++){io[_0xf7bb('0x17')](_0xf7bb('0x18'),{'id':_0x2fe899[_0x5b2861],'closed':!![]});}}})[_0xf7bb('0x19')](function(_0x3a669c){logger[_0xf7bb('0x1a')](_0xf7bb('0x1b'),_0x3a669c?util[_0xf7bb('0x1c')](_0x3a669c,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4600=['then','chatTimeout','ChatInteraction','subtract','length','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','Setting','find'];(function(_0x16251d,_0x141db5){var _0x2d87b8=function(_0x462160){while(--_0x462160){_0x16251d['push'](_0x16251d['shift']());}};_0x2d87b8(++_0x141db5);}(_0x4600,0x1e1));var _0x0460=function(_0x190a46,_0xe5b0e){_0x190a46=_0x190a46-0x0;var _0xba5779=_0x4600[_0x190a46];return _0xba5779;};'use strict';var _=require('lodash');var moment=require(_0x0460('0x0'));var Redis=require(_0x0460('0x1'));var util=require(_0x0460('0x2'));var config=require(_0x0460('0x3'));var db=require(_0x0460('0x4'))['db'];var logger=require(_0x0460('0x5'))('schedule');config[_0x0460('0x6')]=_[_0x0460('0x7')](config[_0x0460('0x6')],{'host':_0x0460('0x8'),'port':0x18eb});var io=require(_0x0460('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x143a25=0x0;var _0x3307cf=[];return db[_0x0460('0xa')][_0x0460('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x0460('0xc')](function(_0x3eb03e){_0x143a25=_0x3eb03e[_0x0460('0xd')];if(_0x143a25){return db[_0x0460('0xe')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0460('0xf')](_0x3eb03e['chatTimeout'],'minutes')}}});}else{return[];}})[_0x0460('0xc')](function(_0x365589){if(_0x365589&&_0x365589[_0x0460('0x10')]){_0x3307cf=_['map'](_0x365589||[],'id');logger['info'](_0x0460('0x11'),_0x3307cf[_0x0460('0x12')]());return db[_0x0460('0xe')][_0x0460('0x13')]({'closeReason':_0x0460('0x14'),'disposition':_0x0460('0x15'),'closed':!![],'closedAt':moment()[_0x0460('0x16')](_0x0460('0x17'))},{'where':{'id':_0x3307cf}});}})[_0x0460('0xc')](function(){if(_0x3307cf&&_0x3307cf['length']){logger[_0x0460('0x18')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x3307cf[_0x0460('0x12')]());for(var _0x2e5e33=0x0;_0x2e5e33<_0x3307cf[_0x0460('0x10')];_0x2e5e33++){io['emit'](_0x0460('0x19'),{'id':_0x3307cf[_0x2e5e33],'closed':!![]});}}})['catch'](function(_0x32cb3b){logger[_0x0460('0x1a')](_0x0460('0x1b'),_0x32cb3b?util[_0x0460('0x1c')](_0x32cb3b,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index b1ea951..84b9b80 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7818=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x102789,_0x24217f){var _0x4aeb4f=function(_0x48bbcb){while(--_0x48bbcb){_0x102789['push'](_0x102789['shift']());}};_0x4aeb4f(++_0x24217f);}(_0x7818,0x9f));var _0x8781=function(_0xd79b7a,_0x2a74b9){_0xd79b7a=_0xd79b7a-0x0;var _0x4d999d=_0x7818[_0xd79b7a];return _0x4d999d;};'use strict';function start(){var _0x54df7f=require(_0x8781('0x0'));return _0x54df7f[_0x8781('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x9853=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0xfeeeb6,_0x142522){var _0x1d8f2d=function(_0x2ac160){while(--_0x2ac160){_0xfeeeb6['push'](_0xfeeeb6['shift']());}};_0x1d8f2d(++_0x142522);}(_0x9853,0xbe));var _0x3985=function(_0x38e870,_0x3d2e6a){_0x38e870=_0x38e870-0x0;var _0x2dabbe=_0x9853[_0x38e870];return _0x2dabbe;};'use strict';function start(){var _0x58afb4=require(_0x3985('0x0'));return _0x58afb4['startAllRefreshIntervals']();}module[_0x3985('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 2340e7e..1363524 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 _0x2d7b=['isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','map','toString','keyBy','difference','length','exists','stop','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','active','endAt','start','add\x20cron','deleteJob','stop\x20cron','startAt','update\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','Smtp','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','name','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','savename','%s.%s','basename','extname','existsSync','status','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','Sent','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','email\x20sent','catch','error','data'];(function(_0xfce44d,_0x4843d9){var _0x435896=function(_0x2af04a){while(--_0x2af04a){_0xfce44d['push'](_0xfce44d['shift']());}};_0x435896(++_0x4843d9);}(_0x2d7b,0x11e));var _0xb2d7=function(_0x38390d,_0x484541){_0x38390d=_0x38390d-0x0;var _0x12e8f5=_0x2d7b[_0x38390d];return _0x12e8f5;};'use strict';var fs=require('fs');var util=require(_0xb2d7('0x0'));var path=require(_0xb2d7('0x1'));var _=require(_0xb2d7('0x2'));var moment=require(_0xb2d7('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xb2d7('0x4'));var BPromise=require(_0xb2d7('0x5'));var logger=require('../logger')('schedule');var db=require(_0xb2d7('0x6'))['db'];var analyticCustomReportController=require(_0xb2d7('0x7'));var analyticDefaultReportController=require(_0xb2d7('0x8'));var client=jayson[_0xb2d7('0x9')][_0xb2d7('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x241c30,_0x1c4c87){return function(){logger[_0xb2d7('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x241c30[_0xb2d7('0xc')]);var _0x26075b=!![];var _0x204062={'tls':{'rejectUnauthorized':![]}};if(_0x241c30[_0xb2d7('0xd')][_0xb2d7('0xe')][_0xb2d7('0xf')]){_0x204062[_0xb2d7('0xf')]=_0x241c30[_0xb2d7('0xd')][_0xb2d7('0xe')][_0xb2d7('0xf')];}else{_0x204062[_0xb2d7('0x10')]=_0x241c30[_0xb2d7('0xd')][_0xb2d7('0xe')][_0xb2d7('0x10')];_0x204062[_0xb2d7('0x11')]=_0x241c30[_0xb2d7('0xd')][_0xb2d7('0xe')]['port'];_0x204062[_0xb2d7('0x12')]=_0x241c30[_0xb2d7('0xd')][_0xb2d7('0xe')]['secure'];}if(_0x241c30[_0xb2d7('0xd')][_0xb2d7('0xe')]['authentication']){_0x204062[_0xb2d7('0x13')]={'user':_0x241c30[_0xb2d7('0xd')][_0xb2d7('0xe')]['user'],'pass':_0x241c30[_0xb2d7('0xd')][_0xb2d7('0xe')][_0xb2d7('0x14')]};}var _0x5da874={'account':_0x204062,'message':{'from':util['format'](_0xb2d7('0x15'),_0x241c30[_0xb2d7('0xd')][_0xb2d7('0x16')],_0x241c30[_0xb2d7('0xd')]['email']||_0x241c30[_0xb2d7('0xd')]['Smtp'][_0xb2d7('0x17')]),'to':_0x241c30[_0xb2d7('0xc')],'cc':_0x241c30['cc'],'bcc':_0x241c30[_0xb2d7('0x18')],'subject':util[_0xb2d7('0x19')](_0xb2d7('0x1a'),_0x1c4c87['name'],_0x241c30[_0xb2d7('0x1b')],_0x241c30['subtractUnit'])}};var _0x38d2ca=path[_0xb2d7('0x1c')](__dirname,'../../files/reports');var _0x3276c0=_0x1c4c87[_0xb2d7('0x1d')];var _0x10929c=util['format'](_0xb2d7('0x1e'),path[_0xb2d7('0x1f')](_0x1c4c87[_0xb2d7('0x1d')],path[_0xb2d7('0x20')](_0x1c4c87['savename'])),'zip');var _0x7d2afb=path[_0xb2d7('0x1c')](_0x38d2ca,_0x3276c0);var _0x107256=path[_0xb2d7('0x1c')](_0x38d2ca,_0x10929c);if(fs[_0xb2d7('0x21')](_0x7d2afb)){_0x1c4c87[_0xb2d7('0x22')]='Sent';_0x5da874['message']['attachments']=[{'filename':_0x3276c0,'path':_0x7d2afb}];_0x5da874[_0xb2d7('0x23')][_0xb2d7('0x24')]=util[_0xb2d7('0x19')](_0xb2d7('0x25'),JSON[_0xb2d7('0x26')](_0x1c4c87,null,0x2));}else if(fs[_0xb2d7('0x21')](_0x107256)){_0x1c4c87[_0xb2d7('0x22')]=_0xb2d7('0x27');_0x5da874[_0xb2d7('0x23')][_0xb2d7('0x28')]=[{'filename':_0x10929c,'path':_0x107256}];}else{_0x5da874['message'][_0xb2d7('0x24')]=_0xb2d7('0x29');if(!_0x241c30[_0xb2d7('0x2a')]){_0x26075b=![];logger[_0xb2d7('0xb')](_0xb2d7('0x2b'));}}if(_0x26075b){return client['request'](_0xb2d7('0x2c'),_0x5da874)[_0xb2d7('0x2d')](function(_0x4b6536){if(_0x4b6536['error']){return logger['error']('error\x20mail',JSON['stringify'](_0x4b6536));}return logger[_0xb2d7('0xb')](_0xb2d7('0x2e'));})[_0xb2d7('0x2f')](function(_0x3eb19b){return logger[_0xb2d7('0x30')]('error\x20mail',JSON[_0xb2d7('0x26')](_0x3eb19b));});}};}function handleError(){return function(_0xf32317){return logger[_0xb2d7('0x30')](JSON['stringify'](_0xf32317));};}function handleResult(_0x5a3f4a){return function(_0x1a3192){logger['info'](_0xb2d7('0x31'),JSON[_0xb2d7('0x26')](_0x1a3192));if(_0x5a3f4a[_0xb2d7('0xd')]&&_0x5a3f4a[_0xb2d7('0xd')][_0xb2d7('0xe')]&&!_[_0xb2d7('0x32')](_0x5a3f4a[_0xb2d7('0xc')])){setTimeout(handleSendEmail(_0x5a3f4a,_0x1a3192),0x3c*0x3e8);}};}function handleJob(_0x6256b5){return function(){try{if(_['isNil'](_0x6256b5['subtractNumber'])){return logger[_0xb2d7('0xb')](_0xb2d7('0x33'));}if(_['isNil'](_0x6256b5[_0xb2d7('0x34')])){return logger['info'](_0xb2d7('0x35'));}var _0x142481={'startDate':moment()['subtract'](_0x6256b5[_0xb2d7('0x1b')],_0x6256b5['subtractUnit'])[_0xb2d7('0x19')](_0xb2d7('0x36')),'endDate':moment()[_0xb2d7('0x19')](_0xb2d7('0x36')),'type':'scheduled','output':_0x6256b5['output'],'name':_0x6256b5[_0xb2d7('0x16')]};if(!_[_0xb2d7('0x32')](_0x6256b5[_0xb2d7('0x37')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x6256b5[_0xb2d7('0x37')]);return analyticDefaultReportController[_0xb2d7('0x38')]({'id':_0x6256b5[_0xb2d7('0x37')]},_0x142481)[_0xb2d7('0x2d')](handleResult(_0x6256b5))[_0xb2d7('0x2f')](handleError());}if(!_[_0xb2d7('0x32')](_0x6256b5[_0xb2d7('0x39')])){logger[_0xb2d7('0xb')](_0xb2d7('0x3a'),_0x6256b5['CustomReportId']);return analyticCustomReportController[_0xb2d7('0x38')]({'id':_0x6256b5['CustomReportId']},_0x142481)['then'](handleResult(_0x6256b5))[_0xb2d7('0x2f')](handleError());}}catch(_0x248ce0){logger[_0xb2d7('0x30')](JSON[_0xb2d7('0x26')](_0x248ce0));}return logger[_0xb2d7('0xb')](_0xb2d7('0x3b'));};}function getJobs(_0x257c90){var _0x4a867f={};if(_0x257c90){_0x4a867f['id']=_0x257c90;}return db[_0xb2d7('0x3c')]['findAll']({'where':_0x4a867f,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0xb2d7('0xc')],'include':[{'model':db[_0xb2d7('0x3d')],'as':_0xb2d7('0xe')}]}]})[_0xb2d7('0x2d')](function(_0x178cba){var _0x125e24=_['keys'](manager['jobs']);var _0x4cb321=_[_0xb2d7('0x3e')](_0x178cba,function(_0x250f74){return _0x250f74['id'][_0xb2d7('0x3f')]();});var _0x417081=_[_0xb2d7('0x40')](_0x178cba,function(_0x426832){return _0x426832['id'][_0xb2d7('0x3f')]();});var _0x44eb45=_0x257c90?_0x4cb321:_['difference'](_0x4cb321,_0x125e24);var _0x2ea68c=_['intersection'](_0x4cb321,_0x125e24);var _0x12e9c8=_[_0xb2d7('0x41')](_0x125e24,_0x4cb321);var _0x1bc2f2;var _0x56e18c;for(_0x1bc2f2=0x0;_0x1bc2f2<_0x12e9c8[_0xb2d7('0x42')]&&!_0x257c90;_0x1bc2f2+=0x1){_0x56e18c=_0x12e9c8[_0x1bc2f2][_0xb2d7('0x3f')]();if(manager[_0xb2d7('0x43')](_0x56e18c)){manager[_0xb2d7('0x44')](_0x56e18c);manager['deleteJob'](_0x56e18c);logger[_0xb2d7('0xb')](_0xb2d7('0x45'),_0x56e18c);}}logger['info'](_0xb2d7('0x46'),JSON[_0xb2d7('0x26')](_0x44eb45));for(_0x1bc2f2=0x0;_0x1bc2f2<_0x44eb45[_0xb2d7('0x42')];_0x1bc2f2+=0x1){_0x56e18c=_0x44eb45[_0x1bc2f2][_0xb2d7('0x3f')]();logger['info']('index',_0x56e18c);if(_0x257c90){logger[_0xb2d7('0xb')](_0xb2d7('0x47'),_0x257c90);logger['info'](JSON['stringify'](_0x417081[_0x56e18c]));BPromise[_0xb2d7('0x48')]()[_0xb2d7('0x2d')](handleJob(_0x417081[_0x56e18c]));logger[_0xb2d7('0xb')](_0xb2d7('0x49'),_0x417081[_0x56e18c][_0xb2d7('0x16')],_0x417081[_0x56e18c][_0xb2d7('0x4a')]);}else if(_0x417081[_0x56e18c][_0xb2d7('0x4a')]&&_0x417081[_0x56e18c][_0xb2d7('0x4b')]&&moment()['isBetween'](_0x417081[_0x56e18c]['startAt'],_0x417081[_0x56e18c][_0xb2d7('0x4c')])){manager['add'](_0x56e18c,_0x417081[_0x56e18c][_0xb2d7('0x4a')],handleJob(_0x417081[_0x56e18c]));manager[_0xb2d7('0x4d')](_0x56e18c);logger[_0xb2d7('0xb')](_0xb2d7('0x4e'),_0x417081[_0x56e18c][_0xb2d7('0x16')],_0x417081[_0x56e18c][_0xb2d7('0x4a')]);}else if(manager[_0xb2d7('0x43')](_0x56e18c)){manager['stop'](_0x56e18c);manager[_0xb2d7('0x4f')](_0x56e18c);logger['info'](_0xb2d7('0x50'),_0x417081[_0x56e18c]['name'],_0x417081[_0x56e18c][_0xb2d7('0x4a')]);}}for(_0x1bc2f2=0x0,_0x56e18c;_0x1bc2f2<_0x2ea68c['length']&&!_0x257c90;_0x1bc2f2+=0x1){_0x56e18c=_0x2ea68c[_0x1bc2f2]['toString']();if(manager[_0xb2d7('0x43')](_0x56e18c)){if(_0x417081[_0x56e18c][_0xb2d7('0x4a')]&&_0x417081[_0x56e18c][_0xb2d7('0x4b')]&&moment()['isBetween'](_0x417081[_0x56e18c][_0xb2d7('0x51')],_0x417081[_0x56e18c]['endAt'])){manager['update'](_0x56e18c,_0x417081[_0x56e18c][_0xb2d7('0x4a')],handleJob(_0x417081[_0x56e18c]));logger[_0xb2d7('0xb')](_0xb2d7('0x52'),_0x417081[_0x56e18c]['name'],_0x417081[_0x56e18c][_0xb2d7('0x4a')]);}else{manager[_0xb2d7('0x44')](_0x56e18c);manager['deleteJob'](_0x56e18c);logger[_0xb2d7('0xb')](_0xb2d7('0x50'),_0x417081[_0x56e18c][_0xb2d7('0x16')],_0x417081[_0x56e18c]['cron']);}}}})[_0xb2d7('0x2f')](function(_0x19c829){logger[_0xb2d7('0x30')](JSON['stringify'](_0x19c829));});}exports[_0xb2d7('0x53')]=function(_0xba2684){return getJobs(_0xba2684);};exports[_0xb2d7('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x2160=['jayson/promise','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','MailAccount','service','Smtp','host','port','secure','authentication','auth','user','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','savename','format','%s.%s','basename','extname','zip','existsSync','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','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','error\x20mail','email\x20sent','catch','data','email','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','runReport','no\x20report\x20id','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','index','run\x20job','cron','active','isBetween','startAt','add','start','exists','run','util','path','moment','cron-job-manager'];(function(_0x1e66f3,_0x32e260){var _0x115fc4=function(_0x31459e){while(--_0x31459e){_0x1e66f3['push'](_0x1e66f3['shift']());}};_0x115fc4(++_0x32e260);}(_0x2160,0xf8));var _0x0216=function(_0x57a0b7,_0x1068af){_0x57a0b7=_0x57a0b7-0x0;var _0x4fb4c6=_0x2160[_0x57a0b7];return _0x4fb4c6;};'use strict';var fs=require('fs');var util=require(_0x0216('0x0'));var path=require(_0x0216('0x1'));var _=require('lodash');var moment=require(_0x0216('0x2'));var CronJobManager=require(_0x0216('0x3'));var jayson=require(_0x0216('0x4'));var BPromise=require('bluebird');var logger=require('../logger')(_0x0216('0x5'));var db=require(_0x0216('0x6'))['db'];var analyticCustomReportController=require(_0x0216('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x0216('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5efa12,_0x55a26c){return function(){logger[_0x0216('0x9')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x5efa12['email']);var _0x5dcf94=!![];var _0xd4729c={'tls':{'rejectUnauthorized':![]}};if(_0x5efa12[_0x0216('0xa')]['Smtp'][_0x0216('0xb')]){_0xd4729c[_0x0216('0xb')]=_0x5efa12['MailAccount'][_0x0216('0xc')][_0x0216('0xb')];}else{_0xd4729c[_0x0216('0xd')]=_0x5efa12[_0x0216('0xa')][_0x0216('0xc')][_0x0216('0xd')];_0xd4729c[_0x0216('0xe')]=_0x5efa12[_0x0216('0xa')][_0x0216('0xc')]['port'];_0xd4729c[_0x0216('0xf')]=_0x5efa12['MailAccount'][_0x0216('0xc')][_0x0216('0xf')];}if(_0x5efa12[_0x0216('0xa')][_0x0216('0xc')][_0x0216('0x10')]){_0xd4729c[_0x0216('0x11')]={'user':_0x5efa12[_0x0216('0xa')][_0x0216('0xc')][_0x0216('0x12')],'pass':_0x5efa12[_0x0216('0xa')]['Smtp']['pass']};}var _0x17309f={'account':_0xd4729c,'message':{'from':util['format'](_0x0216('0x13'),_0x5efa12[_0x0216('0xa')][_0x0216('0x14')],_0x5efa12['MailAccount']['email']||_0x5efa12[_0x0216('0xa')]['Smtp'][_0x0216('0x12')]),'to':_0x5efa12['email'],'cc':_0x5efa12['cc'],'bcc':_0x5efa12[_0x0216('0x15')],'subject':util['format'](_0x0216('0x16'),_0x55a26c['name'],_0x5efa12['subtractNumber'],_0x5efa12[_0x0216('0x17')])}};var _0xb4a2f8=path[_0x0216('0x18')](__dirname,'../../files/reports');var _0x5e80cf=_0x55a26c[_0x0216('0x19')];var _0x3f23ca=util[_0x0216('0x1a')](_0x0216('0x1b'),path[_0x0216('0x1c')](_0x55a26c[_0x0216('0x19')],path[_0x0216('0x1d')](_0x55a26c[_0x0216('0x19')])),_0x0216('0x1e'));var _0xea125=path[_0x0216('0x18')](_0xb4a2f8,_0x5e80cf);var _0x2697fc=path['join'](_0xb4a2f8,_0x3f23ca);if(fs[_0x0216('0x1f')](_0xea125)){_0x55a26c['status']=_0x0216('0x20');_0x17309f[_0x0216('0x21')][_0x0216('0x22')]=[{'filename':_0x5e80cf,'path':_0xea125}];_0x17309f['message']['text']=util['format'](_0x0216('0x23'),JSON[_0x0216('0x24')](_0x55a26c,null,0x2));}else if(fs['existsSync'](_0x2697fc)){_0x55a26c['status']=_0x0216('0x20');_0x17309f[_0x0216('0x21')]['attachments']=[{'filename':_0x3f23ca,'path':_0x2697fc}];}else{_0x17309f[_0x0216('0x21')][_0x0216('0x25')]=_0x0216('0x26');if(!_0x5efa12[_0x0216('0x27')]){_0x5dcf94=![];logger[_0x0216('0x9')](_0x0216('0x28'));}}if(_0x5dcf94){return client[_0x0216('0x29')](_0x0216('0x2a'),_0x17309f)[_0x0216('0x2b')](function(_0x282dd4){if(_0x282dd4['error']){return logger[_0x0216('0x2c')](_0x0216('0x2d'),JSON[_0x0216('0x24')](_0x282dd4));}return logger[_0x0216('0x9')](_0x0216('0x2e'));})[_0x0216('0x2f')](function(_0x1f576b){return logger[_0x0216('0x2c')](_0x0216('0x2d'),JSON['stringify'](_0x1f576b));});}};}function handleError(){return function(_0x296933){return logger['error'](JSON['stringify'](_0x296933));};}function handleResult(_0x1bd7e7){return function(_0x4ff06a){logger['info'](_0x0216('0x30'),JSON['stringify'](_0x4ff06a));if(_0x1bd7e7[_0x0216('0xa')]&&_0x1bd7e7['MailAccount'][_0x0216('0xc')]&&!_['isNil'](_0x1bd7e7[_0x0216('0x31')])){setTimeout(handleSendEmail(_0x1bd7e7,_0x4ff06a),0x3c*0x3e8);}};}function handleJob(_0xbc0431){return function(){try{if(_[_0x0216('0x32')](_0xbc0431[_0x0216('0x33')])){return logger[_0x0216('0x9')](_0x0216('0x34'));}if(_[_0x0216('0x32')](_0xbc0431[_0x0216('0x17')])){return logger[_0x0216('0x9')]('subtractUnit\x20null\x20or\x20undefined');}var _0x34cda9={'startDate':moment()[_0x0216('0x35')](_0xbc0431[_0x0216('0x33')],_0xbc0431['subtractUnit'])[_0x0216('0x1a')](_0x0216('0x36')),'endDate':moment()[_0x0216('0x1a')](_0x0216('0x36')),'type':_0x0216('0x37'),'output':_0xbc0431['output'],'name':_0xbc0431[_0x0216('0x14')]};if(!_[_0x0216('0x32')](_0xbc0431[_0x0216('0x38')])){logger[_0x0216('0x9')](_0x0216('0x39'),_0xbc0431['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0xbc0431[_0x0216('0x38')]},_0x34cda9)['then'](handleResult(_0xbc0431))['catch'](handleError());}if(!_[_0x0216('0x32')](_0xbc0431[_0x0216('0x3a')])){logger[_0x0216('0x9')]('exec\x20custom\x20report\x20id:%s',_0xbc0431[_0x0216('0x3a')]);return analyticCustomReportController[_0x0216('0x3b')]({'id':_0xbc0431['CustomReportId']},_0x34cda9)[_0x0216('0x2b')](handleResult(_0xbc0431))[_0x0216('0x2f')](handleError());}}catch(_0x5360ab){logger['error'](JSON[_0x0216('0x24')](_0x5360ab));}return logger[_0x0216('0x9')](_0x0216('0x3c'));};}function getJobs(_0x35b9cd){var _0x16e988={};if(_0x35b9cd){_0x16e988['id']=_0x35b9cd;}return db['Schedule'][_0x0216('0x3d')]({'where':_0x16e988,'include':[{'model':db[_0x0216('0xa')],'attributes':['id',_0x0216('0x14'),_0x0216('0x31')],'include':[{'model':db[_0x0216('0x3e')],'as':_0x0216('0xc')}]}]})['then'](function(_0x1981c4){var _0x3509da=_[_0x0216('0x3f')](manager[_0x0216('0x40')]);var _0x49e9a9=_[_0x0216('0x41')](_0x1981c4,function(_0x3bed3d){return _0x3bed3d['id'][_0x0216('0x42')]();});var _0x256010=_[_0x0216('0x43')](_0x1981c4,function(_0x2f4465){return _0x2f4465['id']['toString']();});var _0x1e6c7a=_0x35b9cd?_0x49e9a9:_[_0x0216('0x44')](_0x49e9a9,_0x3509da);var _0x7b9c59=_[_0x0216('0x45')](_0x49e9a9,_0x3509da);var _0x13943d=_[_0x0216('0x44')](_0x3509da,_0x49e9a9);var _0x56ee25;var _0xaa67d2;for(_0x56ee25=0x0;_0x56ee25<_0x13943d[_0x0216('0x46')]&&!_0x35b9cd;_0x56ee25+=0x1){_0xaa67d2=_0x13943d[_0x56ee25]['toString']();if(manager['exists'](_0xaa67d2)){manager[_0x0216('0x47')](_0xaa67d2);manager[_0x0216('0x48')](_0xaa67d2);logger[_0x0216('0x9')](_0x0216('0x49'),_0xaa67d2);}}logger['info']('toRun',JSON[_0x0216('0x24')](_0x1e6c7a));for(_0x56ee25=0x0;_0x56ee25<_0x1e6c7a[_0x0216('0x46')];_0x56ee25+=0x1){_0xaa67d2=_0x1e6c7a[_0x56ee25][_0x0216('0x42')]();logger[_0x0216('0x9')](_0x0216('0x4a'),_0xaa67d2);if(_0x35b9cd){logger['info']('my\x20id',_0x35b9cd);logger['info'](JSON[_0x0216('0x24')](_0x256010[_0xaa67d2]));BPromise['resolve']()['then'](handleJob(_0x256010[_0xaa67d2]));logger[_0x0216('0x9')](_0x0216('0x4b'),_0x256010[_0xaa67d2][_0x0216('0x14')],_0x256010[_0xaa67d2][_0x0216('0x4c')]);}else if(_0x256010[_0xaa67d2]['cron']&&_0x256010[_0xaa67d2][_0x0216('0x4d')]&&moment()[_0x0216('0x4e')](_0x256010[_0xaa67d2][_0x0216('0x4f')],_0x256010[_0xaa67d2]['endAt'])){manager[_0x0216('0x50')](_0xaa67d2,_0x256010[_0xaa67d2][_0x0216('0x4c')],handleJob(_0x256010[_0xaa67d2]));manager[_0x0216('0x51')](_0xaa67d2);logger[_0x0216('0x9')]('add\x20cron',_0x256010[_0xaa67d2][_0x0216('0x14')],_0x256010[_0xaa67d2][_0x0216('0x4c')]);}else if(manager[_0x0216('0x52')](_0xaa67d2)){manager[_0x0216('0x47')](_0xaa67d2);manager['deleteJob'](_0xaa67d2);logger[_0x0216('0x9')]('stop\x20cron',_0x256010[_0xaa67d2][_0x0216('0x14')],_0x256010[_0xaa67d2][_0x0216('0x4c')]);}}for(_0x56ee25=0x0,_0xaa67d2;_0x56ee25<_0x7b9c59['length']&&!_0x35b9cd;_0x56ee25+=0x1){_0xaa67d2=_0x7b9c59[_0x56ee25]['toString']();if(manager['exists'](_0xaa67d2)){if(_0x256010[_0xaa67d2][_0x0216('0x4c')]&&_0x256010[_0xaa67d2]['active']&&moment()['isBetween'](_0x256010[_0xaa67d2][_0x0216('0x4f')],_0x256010[_0xaa67d2]['endAt'])){manager['update'](_0xaa67d2,_0x256010[_0xaa67d2]['cron'],handleJob(_0x256010[_0xaa67d2]));logger[_0x0216('0x9')]('update\x20cron',_0x256010[_0xaa67d2]['name'],_0x256010[_0xaa67d2]['cron']);}else{manager[_0x0216('0x47')](_0xaa67d2);manager['deleteJob'](_0xaa67d2);logger[_0x0216('0x9')]('stop\x20cron',_0x256010[_0xaa67d2][_0x0216('0x14')],_0x256010[_0xaa67d2][_0x0216('0x4c')]);}}}})[_0x0216('0x2f')](function(_0x3cf054){logger[_0x0216('0x2c')](JSON[_0x0216('0x24')](_0x3cf054));});}exports[_0x0216('0x53')]=function(_0x1df4dd){return getJobs(_0x1df4dd);};exports[_0x0216('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 33f0be2..1a1afc3 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 _0x980c=['findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Sentiment','Positive','catch','name','SequelizeValidationError','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','push','all','error','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','transcripts','results','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','sentiment','sentimentAccountId','ValidationError'];(function(_0x5d903f,_0x4a6a53){var _0x42f61c=function(_0x51aeb6){while(--_0x51aeb6){_0x5d903f['push'](_0x5d903f['shift']());}};_0x42f61c(++_0x4a6a53);}(_0x980c,0x100));var _0xc980=function(_0x508d2a,_0x58ee0a){_0x508d2a=_0x508d2a-0x0;var _0x335301=_0x980c[_0x508d2a];return _0x335301;};var _=require(_0xc980('0x0'));var AWS=require(_0xc980('0x1'));var rp=require(_0xc980('0x2'));var util=require(_0xc980('0x3'));var BPromise=require(_0xc980('0x4'));var db=require(_0xc980('0x5'))['db'];var logger=require(_0xc980('0x6'))(_0xc980('0x7'));function getTranscriptionJob(_0x31af83,_0x3dd395,_0x2af8db,_0x5793bf){return new Promise(function(_0x472ece,_0x311a54){var _0x36d2dd=new AWS[(_0xc980('0x8'))]({'accessKeyId':_0x3dd395,'secretAccessKey':_0x31af83,'region':_0x2af8db});_0x36d2dd[_0xc980('0x9')]({'TranscriptionJobName':_0x5793bf},function(_0x4523c0,_0x355bfa){if(_0x4523c0){return _0x311a54(_0x4523c0);}else{return _0x472ece(_0x355bfa);}});});}function sentiment(_0x5a6141,_0x5aeea3,_0x5b99c8,_0x7c55a2,_0x49b5fb){return new Promise(function(_0x121671,_0x199251){var _0x1099ef=new AWS['Comprehend']({'accessKeyId':_0x5aeea3,'secretAccessKey':_0x5a6141,'region':_0x5b99c8});_0x1099ef[_0xc980('0xa')]({'Text':_0x7c55a2,'LanguageCode':_0x49b5fb[_0xc980('0xb')](0x0,0x2)},function(_0x45abbc,_0x5d770e){if(_0x45abbc){return _0x199251(_0x45abbc);}else{return _0x121671(_0x5d770e);}});});}function checkTranscribeJob(_0x1c4eed,_0x42ef16,_0x3101fa){var _0x20b510;return new BPromise(function(_0x1423a7,_0x1872a9){logger[_0xc980('0xc')](util[_0xc980('0xd')](_0xc980('0xe'),_0x1c4eed['id'],_0x1c4eed[_0xc980('0xf')]));return getTranscriptionJob(_0x3101fa[_0xc980('0x10')],_0x3101fa[_0xc980('0x11')],_0x42ef16[_0xc980('0x12')],_0x1c4eed['transcribeName'])['then'](function(_0xd12d7e){logger['info'](util['format'](_0xc980('0x13'),_0x1c4eed['id'],_0x1c4eed[_0xc980('0xf')],_0xd12d7e[_0xc980('0x14')][_0xc980('0x15')]));if(!_0x1c4eed[_0xc980('0x16')]){switch(_0xd12d7e[_0xc980('0x14')]['TranscriptionJobStatus']){case _0xc980('0x17'):var _0x4342e3={'transcribeStatus':_0xd12d7e[_0xc980('0x14')]['TranscriptionJobStatus'],'fileUri':_0xd12d7e[_0xc980('0x14')][_0xc980('0x18')][_0xc980('0x19')]};logger[_0xc980('0xc')](util[_0xc980('0xd')](_0xc980('0x1a'),_0x1c4eed['id']));return rp({'uri':_0xd12d7e['TranscriptionJob'][_0xc980('0x18')][_0xc980('0x19')],'json':!![]})[_0xc980('0x1b')](function(_0x138d77){logger[_0xc980('0xc')](util[_0xc980('0xd')](_0xc980('0x1c'),_0x1c4eed['id']));if(_0x138d77&&_0x138d77['results']&&_0x138d77['results'][_0xc980('0x1d')]&&_0x138d77[_0xc980('0x1e')][_0xc980('0x1d')][_0xc980('0x1f')]){_0x4342e3[_0xc980('0x16')]='';for(var _0x32845e=0x0;_0x32845e<_0x138d77['results'][_0xc980('0x1d')][_0xc980('0x1f')];_0x32845e++){_0x4342e3[_0xc980('0x16')]+=_0x138d77[_0xc980('0x1e')][_0xc980('0x1d')][_0x32845e][_0xc980('0x20')]+'';}}return _0x1c4eed[_0xc980('0x21')](_0x4342e3);})[_0xc980('0x1b')](function(){logger[_0xc980('0xc')](util[_0xc980('0xd')](_0xc980('0x22'),_0x1c4eed['id']));if(!_0x1c4eed[_0xc980('0x23')]){throw new db[(_0xc980('0x24'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x42ef16[_0xc980('0x25')]||!_0x42ef16[_0xc980('0x26')]||!_0x42ef16['sentimentRegion']||!_0x42ef16['language']||!_0x42ef16['bucket']){throw new db[(_0xc980('0x24'))][(_0xc980('0x27'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4342e3[_0xc980('0x16')]){throw new Error('Transcript\x20not\x20available');}if(_0x42ef16[_0xc980('0x26')]===_0x3101fa['id']){return _0x3101fa;}else{return db['CloudProvider'][_0xc980('0x28')]({'where':{'id':_settings[_0xc980('0x26')]}});}})[_0xc980('0x1b')](function(_0x3ffb1b){if(!_0x3ffb1b){throw new db[(_0xc980('0x24'))][(_0xc980('0x27'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3ffb1b['data1']||!_0x3ffb1b[_0xc980('0x11')]){throw new db[(_0xc980('0x24'))][(_0xc980('0x27'))](_0xc980('0x29'));}_0x20b510=_0x3ffb1b;logger[_0xc980('0xc')](util[_0xc980('0xd')](_0xc980('0x2a'),_0x1c4eed['id']));return sentiment(_0x20b510[_0xc980('0x10')],_0x20b510['data2'],_0x42ef16[_0xc980('0x2b')],_0x4342e3['fileText'],_0x42ef16['language']);})[_0xc980('0x1b')](function(_0x12d720){logger[_0xc980('0xc')](util[_0xc980('0xd')](_0xc980('0x2c'),_0x1c4eed['id']));return _0x1c4eed[_0xc980('0x21')]({'sentiment':_0x12d720['Sentiment'],'sPositive':_0x12d720[_0xc980('0x2d')]['Positive'],'sNegative':_0x12d720[_0xc980('0x2d')][_0xc980('0x2e')],'sMixed':_0x12d720[_0xc980('0x2d')][_0xc980('0x2f')],'sNeutral':_0x12d720['SentimentScore'][_0xc980('0x30')]});})[_0xc980('0x1b')](function(){logger[_0xc980('0xc')](util[_0xc980('0xd')](_0xc980('0x22'),_0x1c4eed['id']));_0x1423a7();});case _0xc980('0x31'):return _0x1c4eed[_0xc980('0x21')]({'transcribeStatus':_0xc980('0x31'),'failureReason':_0xd12d7e[_0xc980('0x14')][_0xc980('0x32')]})[_0xc980('0x1b')](function(){logger[_0xc980('0xc')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1c4eed['id']));_0x1423a7();});default:logger['info'](util['format'](_0xc980('0x33'),_0x1c4eed['id']));break;}}else{return BPromise[_0xc980('0x34')]()[_0xc980('0x1b')](function(){if(!_0x1c4eed[_0xc980('0x23')]){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x42ef16[_0xc980('0x25')]||!_0x42ef16[_0xc980('0x26')]||!_0x42ef16[_0xc980('0x2b')]||!_0x42ef16[_0xc980('0x35')]||!_0x42ef16['bucket']){throw new db[(_0xc980('0x24'))][(_0xc980('0x27'))](_0xc980('0x36'));}if(!_0x1c4eed[_0xc980('0x16')]){throw new Error(_0xc980('0x37'));}if(_0x42ef16[_0xc980('0x26')]===_0x3101fa['id']){return _0x3101fa;}else{return db[_0xc980('0x38')][_0xc980('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xc980('0x1b')](function(_0x39a498){if(!_0x39a498){throw new db[(_0xc980('0x24'))][(_0xc980('0x27'))](_0xc980('0x39'));}if(!_0x39a498[_0xc980('0x10')]||!_0x39a498[_0xc980('0x11')]){throw new db[(_0xc980('0x24'))][(_0xc980('0x27'))](_0xc980('0x29'));}_0x20b510=_0x39a498;logger['info'](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1c4eed['id']));return sentiment(_0x20b510[_0xc980('0x10')],_0x20b510['data2'],_0x42ef16[_0xc980('0x2b')],_0x1c4eed[_0xc980('0x16')],_0x42ef16[_0xc980('0x35')]);})[_0xc980('0x1b')](function(_0x339574){logger[_0xc980('0xc')](util['format'](_0xc980('0x2c'),_0x1c4eed['id']));return _0x1c4eed[_0xc980('0x21')]({'sentiment':_0x339574[_0xc980('0x3a')],'sPositive':_0x339574[_0xc980('0x2d')][_0xc980('0x3b')],'sNegative':_0x339574[_0xc980('0x2d')][_0xc980('0x2e')],'sMixed':_0x339574[_0xc980('0x2d')][_0xc980('0x2f')],'sNeutral':_0x339574[_0xc980('0x2d')][_0xc980('0x30')],'transcribeStatus':_0xc980('0x17')});})[_0xc980('0x1b')](function(){logger[_0xc980('0xc')](util[_0xc980('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1c4eed['id']));_0x1423a7();});}})[_0xc980('0x3c')](function(_0x8ba84a){if(_0x8ba84a){if(!_0x8ba84a[_0xc980('0x3d')]||_0x8ba84a['name']!==_0xc980('0x3e')){logger['error'](util[_0xc980('0xd')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x1c4eed['id']),util[_0xc980('0x3f')](_0x8ba84a,{'showHidden':![],'depth':null}));}}_0x1423a7();});});}function checkTranscribe(){var _0xc1253e;var _0x8af161;var _0x549cc4;return db['VoiceRecording'][_0xc980('0x40')]({'where':{'transcribeStatus':_0xc980('0x41')}})[_0xc980('0x1b')](function(_0xf8c03f){if(!_0xf8c03f||!_0xf8c03f[_0xc980('0x1f')]){throw new db[(_0xc980('0x24'))][(_0xc980('0x27'))](_0xc980('0x42'));}_0xc1253e=_0xf8c03f;return db[_0xc980('0x43')][_0xc980('0x28')]({'where':{'id':0x1}});})[_0xc980('0x1b')](function(_0x25e7eb){if(!_0x25e7eb){throw new db[(_0xc980('0x24'))][(_0xc980('0x27'))]('Settings\x20not\x20available');}_0x8af161=_0x25e7eb;if(!_0x8af161['transcribe']||!_0x8af161[_0xc980('0x44')]||!_0x8af161[_0xc980('0x12')]||!_0x8af161['language']||!_0x8af161['bucket']){throw new db[(_0xc980('0x24'))][(_0xc980('0x27'))](_0xc980('0x45'));}return db[_0xc980('0x38')][_0xc980('0x28')]({'where':{'id':_0x8af161[_0xc980('0x44')]}});})[_0xc980('0x1b')](function(_0x3b53a3){if(!_0x3b53a3){throw new db[(_0xc980('0x24'))][(_0xc980('0x27'))](_0xc980('0x39'));}if(!_0x3b53a3['data1']||!_0x3b53a3['data2']){throw new db[(_0xc980('0x24'))][(_0xc980('0x27'))]('Cloud\x20Provider\x20not\x20configured');}_0x549cc4=_0x3b53a3;var _0x2ab0b0=[];_0xc1253e['forEach'](function(_0x4850ae){_0x2ab0b0[_0xc980('0x46')](checkTranscribeJob(_0x4850ae,_0x8af161,_0x549cc4));});return BPromise[_0xc980('0x47')](_0x2ab0b0);})[_0xc980('0x3c')](function(_0x2ab8d8){if(_0x2ab8d8){if(!_0x2ab8d8[_0xc980('0x3d')]||_0x2ab8d8[_0xc980('0x3d')]!==_0xc980('0x3e')){logger[_0xc980('0x48')](util[_0xc980('0x3f')](_0x2ab8d8,{'showHidden':![],'depth':null}));}}});}exports[_0xc980('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x9780=['SentimentScore','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Transcribe\x20not\x20configured','forEach','push','all','catch','error','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','Sentiment'];(function(_0x2c893f,_0xa53d83){var _0xb71e92=function(_0x5d180e){while(--_0x5d180e){_0x2c893f['push'](_0x2c893f['shift']());}};_0xb71e92(++_0xa53d83);}(_0x9780,0x1d4));var _0x0978=function(_0x14e27a,_0x3b4136){_0x14e27a=_0x14e27a-0x0;var _0x288688=_0x9780[_0x14e27a];return _0x288688;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0x0978('0x0'));var util=require(_0x0978('0x1'));var BPromise=require(_0x0978('0x2'));var db=require(_0x0978('0x3'))['db'];var logger=require(_0x0978('0x4'))(_0x0978('0x5'));function getTranscriptionJob(_0x173398,_0x1e1969,_0x7acd8f,_0x35b86e){return new Promise(function(_0x21b165,_0x5bb746){var _0x422038=new AWS[(_0x0978('0x6'))]({'accessKeyId':_0x1e1969,'secretAccessKey':_0x173398,'region':_0x7acd8f});_0x422038[_0x0978('0x7')]({'TranscriptionJobName':_0x35b86e},function(_0xefd03b,_0x34fe92){if(_0xefd03b){return _0x5bb746(_0xefd03b);}else{return _0x21b165(_0x34fe92);}});});}function sentiment(_0x1883a7,_0x2aa5ff,_0x34081e,_0x3a0754,_0x16b60f){return new Promise(function(_0x235bb1,_0x55e975){var _0x1a94fd=new AWS['Comprehend']({'accessKeyId':_0x2aa5ff,'secretAccessKey':_0x1883a7,'region':_0x34081e});_0x1a94fd[_0x0978('0x8')]({'Text':_0x3a0754,'LanguageCode':_0x16b60f[_0x0978('0x9')](0x0,0x2)},function(_0x2579db,_0x21105f){if(_0x2579db){return _0x55e975(_0x2579db);}else{return _0x235bb1(_0x21105f);}});});}function checkTranscribeJob(_0x50e2d2,_0x3db101,_0x4cb5f5){var _0x3cc5e6;return new BPromise(function(_0x3ec1a8,_0x12dba5){logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0xc'),_0x50e2d2['id'],_0x50e2d2[_0x0978('0xd')]));return getTranscriptionJob(_0x4cb5f5[_0x0978('0xe')],_0x4cb5f5['data2'],_0x3db101[_0x0978('0xf')],_0x50e2d2[_0x0978('0xd')])[_0x0978('0x10')](function(_0x20e9ab){logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0x11'),_0x50e2d2['id'],_0x50e2d2[_0x0978('0xd')],_0x20e9ab[_0x0978('0x12')]['TranscriptionJobStatus']));if(!_0x50e2d2[_0x0978('0x13')]){switch(_0x20e9ab[_0x0978('0x12')][_0x0978('0x14')]){case _0x0978('0x15'):var _0x3d7e83={'transcribeStatus':_0x20e9ab[_0x0978('0x12')][_0x0978('0x14')],'fileUri':_0x20e9ab[_0x0978('0x12')][_0x0978('0x16')]['TranscriptFileUri']};logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0x17'),_0x50e2d2['id']));return rp({'uri':_0x20e9ab['TranscriptionJob'][_0x0978('0x16')][_0x0978('0x18')],'json':!![]})[_0x0978('0x10')](function(_0x5b6558){logger[_0x0978('0xa')](util['format'](_0x0978('0x19'),_0x50e2d2['id']));if(_0x5b6558&&_0x5b6558['results']&&_0x5b6558[_0x0978('0x1a')]['transcripts']&&_0x5b6558[_0x0978('0x1a')]['transcripts'][_0x0978('0x1b')]){_0x3d7e83['fileText']='';for(var _0x584da0=0x0;_0x584da0<_0x5b6558[_0x0978('0x1a')][_0x0978('0x1c')][_0x0978('0x1b')];_0x584da0++){_0x3d7e83[_0x0978('0x13')]+=_0x5b6558[_0x0978('0x1a')][_0x0978('0x1c')][_0x584da0][_0x0978('0x1d')]+'';}}return _0x50e2d2[_0x0978('0x1e')](_0x3d7e83);})[_0x0978('0x10')](function(){logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0x1f'),_0x50e2d2['id']));if(!_0x50e2d2[_0x0978('0x20')]){throw new db[(_0x0978('0x21'))][(_0x0978('0x22'))](_0x0978('0x23'));}if(!_0x3db101[_0x0978('0x24')]||!_0x3db101[_0x0978('0x25')]||!_0x3db101[_0x0978('0x26')]||!_0x3db101['language']||!_0x3db101[_0x0978('0x27')]){throw new db['Sequelize'][(_0x0978('0x22'))](_0x0978('0x28'));}if(!_0x3d7e83[_0x0978('0x13')]){throw new Error(_0x0978('0x29'));}if(_0x3db101[_0x0978('0x25')]===_0x4cb5f5['id']){return _0x4cb5f5;}else{return db[_0x0978('0x2a')][_0x0978('0x2b')]({'where':{'id':_settings[_0x0978('0x25')]}});}})[_0x0978('0x10')](function(_0x188fd7){if(!_0x188fd7){throw new db[(_0x0978('0x21'))][(_0x0978('0x22'))](_0x0978('0x2c'));}if(!_0x188fd7[_0x0978('0xe')]||!_0x188fd7[_0x0978('0x2d')]){throw new db[(_0x0978('0x21'))][(_0x0978('0x22'))](_0x0978('0x2e'));}_0x3cc5e6=_0x188fd7;logger['info'](util[_0x0978('0xb')](_0x0978('0x2f'),_0x50e2d2['id']));return sentiment(_0x3cc5e6[_0x0978('0xe')],_0x3cc5e6[_0x0978('0x2d')],_0x3db101[_0x0978('0x26')],_0x3d7e83['fileText'],_0x3db101[_0x0978('0x30')]);})[_0x0978('0x10')](function(_0x41d44d){logger[_0x0978('0xa')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x50e2d2['id']));return _0x50e2d2[_0x0978('0x1e')]({'sentiment':_0x41d44d[_0x0978('0x31')],'sPositive':_0x41d44d[_0x0978('0x32')]['Positive'],'sNegative':_0x41d44d[_0x0978('0x32')][_0x0978('0x33')],'sMixed':_0x41d44d[_0x0978('0x32')][_0x0978('0x34')],'sNeutral':_0x41d44d['SentimentScore'][_0x0978('0x35')]});})['then'](function(){logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0x1f'),_0x50e2d2['id']));_0x3ec1a8();});case _0x0978('0x36'):return _0x50e2d2[_0x0978('0x1e')]({'transcribeStatus':_0x0978('0x36'),'failureReason':_0x20e9ab[_0x0978('0x12')]['FailureReason']})[_0x0978('0x10')](function(){logger[_0x0978('0xa')](util[_0x0978('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x50e2d2['id']));_0x3ec1a8();});default:logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0x37'),_0x50e2d2['id']));break;}}else{return BPromise[_0x0978('0x38')]()['then'](function(){if(!_0x50e2d2['tempSentiment']){throw new db[(_0x0978('0x21'))]['ValidationError'](_0x0978('0x23'));}if(!_0x3db101[_0x0978('0x24')]||!_0x3db101[_0x0978('0x25')]||!_0x3db101[_0x0978('0x26')]||!_0x3db101[_0x0978('0x30')]||!_0x3db101[_0x0978('0x27')]){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x50e2d2[_0x0978('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x3db101[_0x0978('0x25')]===_0x4cb5f5['id']){return _0x4cb5f5;}else{return db['CloudProvider'][_0x0978('0x2b')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x0978('0x10')](function(_0x534d07){if(!_0x534d07){throw new db[(_0x0978('0x21'))][(_0x0978('0x22'))](_0x0978('0x2c'));}if(!_0x534d07['data1']||!_0x534d07['data2']){throw new db['Sequelize'][(_0x0978('0x22'))](_0x0978('0x2e'));}_0x3cc5e6=_0x534d07;logger[_0x0978('0xa')](util['format'](_0x0978('0x2f'),_0x50e2d2['id']));return sentiment(_0x3cc5e6[_0x0978('0xe')],_0x3cc5e6[_0x0978('0x2d')],_0x3db101[_0x0978('0x26')],_0x50e2d2[_0x0978('0x13')],_0x3db101[_0x0978('0x30')]);})['then'](function(_0x334034){logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0x39'),_0x50e2d2['id']));return _0x50e2d2[_0x0978('0x1e')]({'sentiment':_0x334034['Sentiment'],'sPositive':_0x334034[_0x0978('0x32')][_0x0978('0x3a')],'sNegative':_0x334034['SentimentScore'][_0x0978('0x33')],'sMixed':_0x334034[_0x0978('0x32')][_0x0978('0x34')],'sNeutral':_0x334034[_0x0978('0x32')]['Neutral'],'transcribeStatus':_0x0978('0x15')});})[_0x0978('0x10')](function(){logger[_0x0978('0xa')](util['format'](_0x0978('0x1f'),_0x50e2d2['id']));_0x3ec1a8();});}})['catch'](function(_0x2ad97b){if(_0x2ad97b){if(!_0x2ad97b[_0x0978('0x3b')]||_0x2ad97b[_0x0978('0x3b')]!==_0x0978('0x3c')){logger['error'](util['format'](_0x0978('0x3d'),_0x50e2d2['id']),util[_0x0978('0x3e')](_0x2ad97b,{'showHidden':![],'depth':null}));}}_0x3ec1a8();});});}function checkTranscribe(){var _0x466cb6;var _0x8922c6;var _0xaac741;return db[_0x0978('0x3f')][_0x0978('0x40')]({'where':{'transcribeStatus':_0x0978('0x41')}})[_0x0978('0x10')](function(_0x15b5a3){if(!_0x15b5a3||!_0x15b5a3[_0x0978('0x1b')]){throw new db['Sequelize'][(_0x0978('0x22'))](_0x0978('0x42'));}_0x466cb6=_0x15b5a3;return db[_0x0978('0x43')]['findOne']({'where':{'id':0x1}});})[_0x0978('0x10')](function(_0x3c9605){if(!_0x3c9605){throw new db['Sequelize']['ValidationError']('Settings\x20not\x20available');}_0x8922c6=_0x3c9605;if(!_0x8922c6[_0x0978('0x5')]||!_0x8922c6['transcribeAccountId']||!_0x8922c6[_0x0978('0xf')]||!_0x8922c6[_0x0978('0x30')]||!_0x8922c6[_0x0978('0x27')]){throw new db[(_0x0978('0x21'))][(_0x0978('0x22'))](_0x0978('0x44'));}return db['CloudProvider'][_0x0978('0x2b')]({'where':{'id':_0x8922c6['transcribeAccountId']}});})[_0x0978('0x10')](function(_0x38574d){if(!_0x38574d){throw new db['Sequelize'][(_0x0978('0x22'))](_0x0978('0x2c'));}if(!_0x38574d['data1']||!_0x38574d[_0x0978('0x2d')]){throw new db['Sequelize'][(_0x0978('0x22'))](_0x0978('0x2e'));}_0xaac741=_0x38574d;var _0x20f0c2=[];_0x466cb6[_0x0978('0x45')](function(_0x5cb364){_0x20f0c2[_0x0978('0x46')](checkTranscribeJob(_0x5cb364,_0x8922c6,_0xaac741));});return BPromise[_0x0978('0x47')](_0x20f0c2);})[_0x0978('0x48')](function(_0x27bdb5){if(_0x27bdb5){if(!_0x27bdb5[_0x0978('0x3b')]||_0x27bdb5['name']!==_0x0978('0x3c')){logger[_0x0978('0x49')](util[_0x0978('0x3e')](_0x27bdb5,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 513b37d..c43b980 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 _0xecfa=['defaults','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','schedule','redis'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xecfa,0x1c9));var _0xaecf=function(_0x3d15bc,_0x572d1d){_0x3d15bc=_0x3d15bc-0x0;var _0x125646=_0xecfa[_0x3d15bc];return _0x125646;};'use strict';var _=require(_0xaecf('0x0'));var moment=require('moment');var Redis=require(_0xaecf('0x1'));var util=require(_0xaecf('0x2'));var config=require(_0xaecf('0x3'));var db=require(_0xaecf('0x4'))['db'];var logger=require('../logger')(_0xaecf('0x5'));config[_0xaecf('0x6')]=_[_0xaecf('0x7')](config[_0xaecf('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xaecf('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x3414bc=[];return db[_0xaecf('0x9')]['findAll']({'raw':!![],'attributes':['id',_0xaecf('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xaecf('0xb')](0x18,_0xaecf('0xc'))}}})[_0xaecf('0xd')](function(_0x38d2ce){if(_0x38d2ce&&_0x38d2ce[_0xaecf('0xe')]){_0x3414bc=_[_0xaecf('0xf')](_0x38d2ce||[],'id');logger[_0xaecf('0x10')](_0xaecf('0x11'),_0x3414bc[_0xaecf('0x12')]());return db[_0xaecf('0x9')][_0xaecf('0x13')]({'closeReason':'system','disposition':_0xaecf('0x14'),'closed':!![],'closedAt':moment()[_0xaecf('0x15')](_0xaecf('0x16'))},{'where':{'id':_0x3414bc}});}})[_0xaecf('0xd')](function(){if(_0x3414bc&&_0x3414bc[_0xaecf('0xe')]){logger[_0xaecf('0x10')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x3414bc['join']());for(var _0x364434=0x0;_0x364434<_0x3414bc[_0xaecf('0xe')];_0x364434++){io[_0xaecf('0x17')](_0xaecf('0x18'),{'id':_0x3414bc[_0x364434],'closed':!![]});}}})[_0xaecf('0x19')](function(_0x56111e){logger['error'](_0xaecf('0x1a'),_0x56111e?util[_0xaecf('0x1b')](_0x56111e,{'showHidden':![],'depth':null}):'');});}exports[_0xaecf('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x7aa3=['info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','hours'];(function(_0x2e8693,_0x1de368){var _0x216e14=function(_0x31cb1f){while(--_0x31cb1f){_0x2e8693['push'](_0x2e8693['shift']());}};_0x216e14(++_0x1de368);}(_0x7aa3,0x1a5));var _0x37aa=function(_0x22d510,_0x180123){_0x22d510=_0x22d510-0x0;var _0x13f34d=_0x7aa3[_0x22d510];return _0x13f34d;};'use strict';var _=require(_0x37aa('0x0'));var moment=require(_0x37aa('0x1'));var Redis=require('ioredis');var util=require(_0x37aa('0x2'));var config=require(_0x37aa('0x3'));var db=require(_0x37aa('0x4'))['db'];var logger=require(_0x37aa('0x5'))(_0x37aa('0x6'));config[_0x37aa('0x7')]=_[_0x37aa('0x8')](config['redis'],{'host':_0x37aa('0x9'),'port':0x18eb});var io=require(_0x37aa('0xa'))(new Redis(config[_0x37aa('0x7')]));function closeInteractions(){var _0x1e9f39=[];return db[_0x37aa('0xb')]['findAll']({'raw':!![],'attributes':['id',_0x37aa('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x37aa('0xd'))}}})['then'](function(_0x35c81e){if(_0x35c81e&&_0x35c81e['length']){_0x1e9f39=_['map'](_0x35c81e||[],'id');logger[_0x37aa('0xe')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x1e9f39[_0x37aa('0xf')]());return db['WhatsappInteraction'][_0x37aa('0x10')]({'closeReason':_0x37aa('0x11'),'disposition':_0x37aa('0x12'),'closed':!![],'closedAt':moment()[_0x37aa('0x13')](_0x37aa('0x14'))},{'where':{'id':_0x1e9f39}});}})[_0x37aa('0x15')](function(){if(_0x1e9f39&&_0x1e9f39[_0x37aa('0x16')]){logger[_0x37aa('0xe')](_0x37aa('0x17'),_0x1e9f39['join']());for(var _0x222df4=0x0;_0x222df4<_0x1e9f39['length'];_0x222df4++){io[_0x37aa('0x18')](_0x37aa('0x19'),{'id':_0x1e9f39[_0x222df4],'closed':!![]});}}})['catch'](function(_0x563a2c){logger['error'](_0x37aa('0x1a'),_0x563a2c?util[_0x37aa('0x1b')](_0x563a2c,{'showHidden':![],'depth':null}):'');});}exports[_0x37aa('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 58148a8..3dee2de 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e2e=['catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','CmContact','contacts2','hopper2'];(function(_0x56bce4,_0x176888){var _0x4eca32=function(_0x54cae9){while(--_0x54cae9){_0x56bce4['push'](_0x56bce4['shift']());}};_0x4eca32(++_0x176888);}(_0x4e2e,0x1a5));var _0xe4e2=function(_0xa0073c,_0x39fac0){_0xa0073c=_0xa0073c-0x0;var _0x246d6d=_0x4e2e[_0xa0073c];return _0x246d6d;};'use strict';var util=require(_0xe4e2('0x0'));var db=require(_0xe4e2('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xe4e2('0x2')]({'id':i,'firstName':_0xe4e2('0x3')+i,'lastName':_0xe4e2('0x4')+i,'phone':0xf879fb460+i,'email':_0xe4e2('0x5')+i+_0xe4e2('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe4e2('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xe4e2('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe4e2('0x7')](),'updatedAt':Date[_0xe4e2('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xe4e2('0x5')+i+_0xe4e2('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe4e2('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xe4e2('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe4e2('0x7')](),'updatedAt':Date[_0xe4e2('0x7')]()});}db['CmContact'][_0xe4e2('0x8')]({'where':{}})[_0xe4e2('0x9')](function(){return db['CmContact'][_0xe4e2('0xa')](contacts);})[_0xe4e2('0x9')](function(){console[_0xe4e2('0xb')](_0xe4e2('0xc'),_0xe4e2('0xd'));return db[_0xe4e2('0xe')][_0xe4e2('0x8')]({'where':{}});})[_0xe4e2('0x9')](function(){return db[_0xe4e2('0xe')][_0xe4e2('0xa')](hopper);})[_0xe4e2('0x9')](function(){console[_0xe4e2('0xb')](_0xe4e2('0xc'),_0xe4e2('0xf'));return db[_0xe4e2('0x10')][_0xe4e2('0xa')](contacts2);})[_0xe4e2('0x9')](function(){console[_0xe4e2('0xb')]('finished\x20populating',_0xe4e2('0x11'));return db['CmHopper'][_0xe4e2('0xa')](hopper2);})[_0xe4e2('0x9')](function(){console['log']('finished\x20populating',_0xe4e2('0x12'));})[_0xe4e2('0x13')](function(_0x2f3ef1){console[_0xe4e2('0xb')](_0x2f3ef1);}); \ No newline at end of file +var _0xb806=['log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','destroy','then','CmContact','bulkCreate'];(function(_0x3a2bc6,_0xb3d543){var _0x2781d8=function(_0x4321af){while(--_0x4321af){_0x3a2bc6['push'](_0x3a2bc6['shift']());}};_0x2781d8(++_0xb3d543);}(_0xb806,0x112));var _0x6b80=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xb806[_0x2261ce];return _0x524640;};'use strict';var util=require(_0x6b80('0x0'));var db=require(_0x6b80('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6b80('0x2')]({'id':i,'firstName':_0x6b80('0x3')+i,'lastName':_0x6b80('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6b80('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x6b80('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6b80('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6b80('0x2')]({'id':i,'firstName':_0x6b80('0x3')+i,'lastName':_0x6b80('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6b80('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6b80('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x6b80('0x6')]()});}db['CmContact'][_0x6b80('0x7')]({'where':{}})[_0x6b80('0x8')](function(){return db[_0x6b80('0x9')][_0x6b80('0xa')](contacts);})[_0x6b80('0x8')](function(){console[_0x6b80('0xb')](_0x6b80('0xc'),_0x6b80('0xd'));return db[_0x6b80('0xe')][_0x6b80('0x7')]({'where':{}});})[_0x6b80('0x8')](function(){return db[_0x6b80('0xe')][_0x6b80('0xa')](hopper);})[_0x6b80('0x8')](function(){console[_0x6b80('0xb')](_0x6b80('0xc'),_0x6b80('0xf'));return db[_0x6b80('0x9')][_0x6b80('0xa')](contacts2);})['then'](function(){console[_0x6b80('0xb')](_0x6b80('0xc'),_0x6b80('0x10'));return db[_0x6b80('0xe')][_0x6b80('0xa')](hopper2);})['then'](function(){console[_0x6b80('0xb')](_0x6b80('0xc'),_0x6b80('0x11'));})[_0x6b80('0x12')](function(_0x5f02ec){console[_0x6b80('0xb')](_0x5f02ec);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 6cbeb61..4b6f4a8 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4250=['format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','util','../mysqldb','push'];(function(_0x2ba3ee,_0x16a9fa){var _0x55ca1e=function(_0x47c590){while(--_0x47c590){_0x2ba3ee['push'](_0x2ba3ee['shift']());}};_0x55ca1e(++_0x16a9fa);}(_0x4250,0x90));var _0x0425=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x4250[_0xa1e3e3];return _0xc980e9;};'use strict';var util=require(_0x0425('0x0'));var db=require(_0x0425('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x0425('0x2')]({'name':util[_0x0425('0x3')](_0x0425('0x4'),_0x0425('0x5'),i),'fullname':util['format'](_0x0425('0x4'),_0x0425('0x5'),i),'email':util[_0x0425('0x3')](_0x0425('0x6'),'agent',i),'role':_0x0425('0x5'),'password':_0x0425('0x7'),'internal':0xfa0+i,'type':_0x0425('0x8'),'transport':[_0x0425('0x9'),'ws',_0x0425('0xa')],'disallow':[_0x0425('0xb')],'allow':[_0x0425('0xc')],'defaultuser':util[_0x0425('0x3')](_0x0425('0x4'),_0x0425('0x5'),i),'encryption':_0x0425('0xd'),'avpf':_0x0425('0xd'),'force_avp':'yes','icesupport':_0x0425('0xd'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x0425('0xe'),'dtlsprivatekey':_0x0425('0xf'),'dtlssetup':'actpass','callerid':util[_0x0425('0x3')](_0x0425('0x10'),util[_0x0425('0x3')](_0x0425('0x4'),_0x0425('0x5'),i),0xfa0+i)});}db[_0x0425('0x11')][_0x0425('0x12')](users)['then'](function(){console[_0x0425('0x13')](_0x0425('0x14'));})['catch'](function(_0x40024c){console[_0x0425('0x13')](_0x40024c);}); \ No newline at end of file +var _0x36d0=['format','friend','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','add\x20user','catch','util','../mysqldb','push','%s%s','agent'];(function(_0x49fd15,_0x59cee2){var _0x59aed8=function(_0xb40733){while(--_0xb40733){_0x49fd15['push'](_0x49fd15['shift']());}};_0x59aed8(++_0x59cee2);}(_0x36d0,0x94));var _0x036d=function(_0xaadd7d,_0x137c9e){_0xaadd7d=_0xaadd7d-0x0;var _0x483b11=_0x36d0[_0xaadd7d];return _0x483b11;};'use strict';var util=require(_0x036d('0x0'));var db=require(_0x036d('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x036d('0x2')]({'name':util['format'](_0x036d('0x3'),_0x036d('0x4'),i),'fullname':util['format'](_0x036d('0x3'),_0x036d('0x4'),i),'email':util[_0x036d('0x5')]('%s%s@xcally.com',_0x036d('0x4'),i),'role':_0x036d('0x4'),'password':'password','internal':0xfa0+i,'type':_0x036d('0x6'),'transport':['udp','ws','wss'],'disallow':['all'],'allow':[_0x036d('0x7')],'defaultuser':util[_0x036d('0x5')](_0x036d('0x3'),_0x036d('0x4'),i),'encryption':_0x036d('0x8'),'avpf':'yes','force_avp':_0x036d('0x8'),'icesupport':_0x036d('0x8'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x036d('0x9'),'dtlsprivatekey':_0x036d('0xa'),'dtlssetup':_0x036d('0xb'),'callerid':util[_0x036d('0x5')](_0x036d('0xc'),util[_0x036d('0x5')](_0x036d('0x3'),_0x036d('0x4'),i),0xfa0+i)});}db[_0x036d('0xd')]['bulkCreate'](users)[_0x036d('0xe')](function(){console['log'](_0x036d('0xf'));})[_0x036d('0x10')](function(_0xac0c87){console['log'](_0xac0c87);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index dcac77a..272f565 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd69e=['ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','VoiceQueues','OpenchannelQueues','OpenchannelQueue','Trunk','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','voice','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','leave','emit','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','name','agent','ivr','findOne','then','autoAssociation','ChatQueues','FaxQueues','MailQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','map','resourceId','User','where','role','telephone','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','userProfileId'];(function(_0x519a0b,_0x123197){var _0x5b72b7=function(_0x1305c7){while(--_0x1305c7){_0x519a0b['push'](_0x519a0b['shift']());}};_0x5b72b7(++_0x123197);}(_0xd69e,0xa0));var _0xed69=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xd69e[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xed69('0x0'));var util=require(_0xed69('0x1'));var BPromise=require(_0xed69('0x2'));var db=require('../mysqldb')['db'];var config=require(_0xed69('0x3'));var queryQueues={'attributes':['id',_0xed69('0x4')],'include':[{'as':'Agents','model':db['User'],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0xed69('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xed69('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xed69('0x4')],'where':{'role':_0xed69('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xed69('0x4'),'type'],'where':{'type':_0xed69('0x6')}};function getAssociatedResources(_0x54ca2a,_0x31dbb0,_0x42c0b0){return db['UserProfileSection'][_0xed69('0x7')]({'where':{'name':_0x54ca2a,'userProfileId':_0x31dbb0},'raw':!![]})[_0xed69('0x8')](function(_0x4ebc85){if(_0x4ebc85){if(_0x4ebc85[_0xed69('0x9')]){switch(_0x54ca2a){case'VoiceQueues':case _0xed69('0xa'):case _0xed69('0xb'):case'SmsQueues':case _0xed69('0xc'):case'OpenchannelQueues':case _0xed69('0xd'):return db[_0x42c0b0][_0xed69('0xe')](queryQueues);case _0xed69('0xf'):return db[_0x42c0b0]['findAll'](queryTelephones);case'Trunks':return db[_0x42c0b0][_0xed69('0xe')](queryTrunks);case _0xed69('0x10'):return db[_0x42c0b0][_0xed69('0xe')](queryCampaigns);}}else{return db[_0xed69('0x11')][_0xed69('0xe')]({'attributes':['resourceId'],'where':{'sectionId':_0x4ebc85['id']},'raw':!![]})[_0xed69('0x8')](function(_0x1e318a){if(_0x1e318a){var _0x19af14={'where':{'id':_[_0xed69('0x12')](_0x1e318a,_0xed69('0x13'))},'raw':!![]};switch(_0x42c0b0){case _0xed69('0x14'):_0x19af14[_0xed69('0x15')][_0xed69('0x16')]=_0xed69('0x17');break;case _0xed69('0x18'):_0x19af14['where']['type']='ivr';break;}return db[_0x42c0b0][_0xed69('0xe')](_0x19af14);}else{return[];}});}}else{return[];}})[_0xed69('0x8')](function(_0x387cec){return _0x387cec;});}function joinOrLeaveQueues(_0x576a71,_0x237759,_0x11c1fc,_0x589f07){_0x576a71[_0x237759](util[_0xed69('0x19')](_0xed69('0x1a'),_0x11c1fc,_0x589f07[_0xed69('0x4')]));if(_0x589f07[_0xed69('0x1b')]){for(var _0x4ef2fe=0x0;_0x4ef2fe<_0x589f07[_0xed69('0x1b')][_0xed69('0x1c')];_0x4ef2fe+=0x1){_0x576a71[_0x237759](util['format'](_0xed69('0x1d'),_0x589f07[_0xed69('0x1b')][_0x4ef2fe][_0xed69('0x4')]));}}}function joinOrLeave(_0x176fd1,_0xa3486a,_0x169398){var _0x513337;if(_0x176fd1[_0xed69('0x1e')][_0xed69('0x1f')]['id']){db[_0xed69('0x14')][_0xed69('0x20')]({'attributes':['id',_0xed69('0x4'),_0xed69('0x16'),_0xed69('0x21')],'where':{'id':_0x176fd1[_0xed69('0x1e')][_0xed69('0x1f')]['id']},'include':[{'model':db[_0xed69('0x22')],'as':_0xed69('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xed69('0x24')],'as':_0xed69('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xed69('0x26')],'as':_0xed69('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xed69('0x28')],'as':_0xed69('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xed69('0x2a')],'as':_0xed69('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xed69('0x8')](function(_0x1b24d7){if(_0x1b24d7){_0x513337=_0x1b24d7;_0x176fd1[_0xa3486a](util['format']('user:%s',_0x1b24d7[_0xed69('0x4')]));var _0x54474b=[];switch(_0x1b24d7[_0xed69('0x16')]){case _0xed69('0x2c'):_0x176fd1[_0xa3486a](_0xed69('0x2d'));_0x176fd1[_0xa3486a](_0xed69('0x2e'));if(queryQueues[_0xed69('0x2f')](_0xed69('0x30'))){delete queryQueues[_0xed69('0x30')];}_0x54474b['push'](db[_0xed69('0x31')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x33')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x34')]['findAll'](queryQueues));_0x54474b['push'](db[_0xed69('0x35')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x36')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db['OpenchannelQueue'][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x37')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x14')]['findAll'](queryTelephones));_0x54474b['push'](db['Trunk'][_0xed69('0xe')](queryTrunks));_0x54474b[_0xed69('0x32')](db[_0xed69('0x18')][_0xed69('0xe')](queryCampaigns));_0x54474b['push'](db[_0xed69('0x14')][_0xed69('0xe')](queryAgents));break;case'user':_0x176fd1[_0xa3486a](_0xed69('0x2d'));_0x176fd1[_0xa3486a](_0xed69('0x2e'));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0x38'),_0x1b24d7['userProfileId'],_0xed69('0x31')));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0xa'),_0x1b24d7[_0xed69('0x21')],_0xed69('0x33')));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0xb'),_0x1b24d7[_0xed69('0x21')],'FaxQueue'));_0x54474b[_0xed69('0x32')](getAssociatedResources('SmsQueues',_0x1b24d7[_0xed69('0x21')],_0xed69('0x35')));_0x54474b[_0xed69('0x32')](getAssociatedResources('MailQueues',_0x1b24d7[_0xed69('0x21')],'MailQueue'));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0x39'),_0x1b24d7[_0xed69('0x21')],_0xed69('0x3a')));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0xd'),_0x1b24d7[_0xed69('0x21')],'WhatsappQueue'));_0x54474b['push'](getAssociatedResources(_0xed69('0xf'),_0x1b24d7[_0xed69('0x21')],_0xed69('0x14')));_0x54474b[_0xed69('0x32')](getAssociatedResources('Trunks',_0x1b24d7[_0xed69('0x21')],_0xed69('0x3b')));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0x10'),_0x1b24d7[_0xed69('0x21')],_0xed69('0x18')));_0x54474b[_0xed69('0x32')](db[_0xed69('0x14')]['findAll'](queryAgents));break;case'agent':_0x176fd1[_0xa3486a](_0xed69('0x2d'));_0x176fd1[_0xa3486a](_0xed69('0x2e'));_0x54474b[_0xed69('0x32')](_0x1b24d7['getVoiceQueues']({'attributes':['id',_0xed69('0x4')]}));_0x54474b[_0xed69('0x32')](_0x1b24d7[_0xed69('0x3c')]({'attributes':['id',_0xed69('0x4')]}));_0x54474b[_0xed69('0x32')](_0x1b24d7[_0xed69('0x3d')]({'attributes':['id',_0xed69('0x4')]}));_0x54474b[_0xed69('0x32')](_0x1b24d7['getSmsQueues']({'attributes':['id',_0xed69('0x4')]}));_0x54474b['push'](_0x1b24d7[_0xed69('0x3e')]({'attributes':['id','name']}));_0x54474b[_0xed69('0x32')](_0x1b24d7[_0xed69('0x3f')]({'attributes':['id',_0xed69('0x4')]}));_0x54474b[_0xed69('0x32')](_0x1b24d7['getWhatsappQueues']({'attributes':['id',_0xed69('0x4')]}));break;}return BPromise['all'](_0x54474b);}})[_0xed69('0x8')](function(_0x22b575){if(_0x22b575&&_0x22b575[_0xed69('0x1c')]){for(var _0x187cef=0x0;_0x187cef<_0x22b575[_0xed69('0x1c')];_0x187cef+=0x1){for(var _0x2227d1=0x0;_0x2227d1<_0x22b575[_0x187cef][_0xed69('0x1c')];_0x2227d1+=0x1){switch(_0x187cef){case 0x0:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x40'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x1:joinOrLeaveQueues(_0x176fd1,_0xa3486a,'chat',_0x22b575[_0x187cef][_0x2227d1]);break;case 0x2:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x41'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x3:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x42'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x4:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x43'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x5:joinOrLeaveQueues(_0x176fd1,_0xa3486a,'openchannel',_0x22b575[_0x187cef][_0x2227d1]);break;case 0x6:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x44'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x7:if(_0x513337['role']!==_0xed69('0x5'))_0x176fd1[_0xa3486a](util[_0xed69('0x19')](_0xed69('0x45'),_0x22b575[_0x187cef][_0x2227d1][_0xed69('0x4')]));break;case 0x8:if(_0x513337[_0xed69('0x16')]!=='agent')_0x176fd1[_0xa3486a](util[_0xed69('0x19')](_0xed69('0x46'),_0x22b575[_0x187cef][_0x2227d1]['name']));break;case 0x9:if(_0x513337[_0xed69('0x16')]!==_0xed69('0x5'))_0x176fd1[_0xa3486a](util[_0xed69('0x19')]('campaign:%s:%s',_0x22b575[_0x187cef][_0x2227d1]['type'],_0x22b575[_0x187cef][_0x2227d1]['name']));break;case 0xa:_0x176fd1[_0xa3486a](util['format'](_0xed69('0x1d'),_0x22b575[_0x187cef][_0x2227d1][_0xed69('0x4')]));break;}}}}})[_0xed69('0x8')](function(){if(_0xa3486a===_0xed69('0x47')){var _0x4afc79=_[_0xed69('0x12')](_0x513337['ChatInteractions'],'id');return _0x513337['removeChatInteractions'](_0x4afc79)[_0xed69('0x8')](function(){for(var _0x1e2c03=0x0;_0x1e2c03<_0x4afc79[_0xed69('0x1c')];_0x1e2c03+=0x1){_0x169398[_0xed69('0x48')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x4afc79[_0x1e2c03]),'UserId':Number(_0x513337['id'])});}});}})['then'](function(){if(_0xa3486a===_0xed69('0x47')){var _0x4ed824=_[_0xed69('0x12')](_0x513337[_0xed69('0x49')],'id');return _0x513337[_0xed69('0x4a')](_0x4ed824)['then'](function(){for(var _0x1644b9=0x0;_0x1644b9<_0x4ed824[_0xed69('0x1c')];_0x1644b9+=0x1){_0x169398['emit'](_0xed69('0x4b'),{'MailInteractionId':Number(_0x4ed824[_0x1644b9]),'UserId':Number(_0x513337['id'])});}});}})[_0xed69('0x8')](function(){if(_0xa3486a===_0xed69('0x47')){var _0x44cd99=_['map'](_0x513337[_0xed69('0x25')],'id');return _0x513337['removeFaxInteractions'](_0x44cd99)['then'](function(){for(var _0xa6647b=0x0;_0xa6647b<_0x44cd99[_0xed69('0x1c')];_0xa6647b+=0x1){_0x169398[_0xed69('0x48')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x44cd99[_0xa6647b]),'UserId':Number(_0x513337['id'])});}});}})['then'](function(){if(_0xa3486a===_0xed69('0x47')){var _0x3093a3=_['map'](_0x513337['SmsInteractions'],'id');return _0x513337[_0xed69('0x4c')](_0x3093a3)[_0xed69('0x8')](function(){for(var _0x179566=0x0;_0x179566<_0x3093a3[_0xed69('0x1c')];_0x179566+=0x1){_0x169398[_0xed69('0x48')](_0xed69('0x4d'),{'SmsInteractionId':Number(_0x3093a3[_0x179566]),'UserId':Number(_0x513337['id'])});}});}})[_0xed69('0x8')](function(){if(_0xa3486a===_0xed69('0x47')){var _0x5bf1c6=_['map'](_0x513337[_0xed69('0x29')],'id');return _0x513337[_0xed69('0x4e')](_0x5bf1c6)[_0xed69('0x8')](function(){for(var _0x285867=0x0;_0x285867<_0x5bf1c6['length'];_0x285867+=0x1){_0x169398[_0xed69('0x48')](_0xed69('0x4f'),{'OpenchannelInteractionId':Number(_0x5bf1c6[_0x285867]),'UserId':Number(_0x513337['id'])});}});}})[_0xed69('0x8')](function(){if(_0xa3486a===_0xed69('0x47')){var _0x11dfa4=_[_0xed69('0x12')](_0x513337['WhatsappInteractions'],'id');return _0x513337[_0xed69('0x50')](_0x11dfa4)[_0xed69('0x8')](function(){for(var _0x4d229f=0x0;_0x4d229f<_0x11dfa4[_0xed69('0x1c')];_0x4d229f+=0x1){_0x169398[_0xed69('0x48')](_0xed69('0x51'),{'WhatsappInteractionId':Number(_0x11dfa4[_0x4d229f]),'UserId':Number(_0x513337['id'])});}});}})[_0xed69('0x52')](function(_0x2bffca){_0x176fd1[_0xed69('0x53')](_0x2bffca);});}}function onDisconnect(_0x2aae2b,_0x182471){joinOrLeave(_0x2aae2b,_0xed69('0x47'),_0x182471);}function onConnect(_0x2c3138){joinOrLeave(_0x2c3138,_0xed69('0x54'));}exports[_0xed69('0x55')]=function(_0x1d16ab){_0x1d16ab['on'](_0xed69('0x56'),function(_0xcb2bc3){_0xcb2bc3[_0xed69('0x57')](0x0);_0xcb2bc3[_0xed69('0x58')]=_0xcb2bc3[_0xed69('0x59')]['connection']['remoteAddress']+':'+_0xcb2bc3[_0xed69('0x59')][_0xed69('0x56')][_0xed69('0x5a')];_0xcb2bc3[_0xed69('0x5b')]=new Date();_0xcb2bc3['log']=function(_0x498229){console[_0xed69('0x53')](_0xed69('0x5c')+_0xcb2bc3[_0xed69('0x5d')][_0xed69('0x4')]+'['+_0xcb2bc3[_0xed69('0x58')]+']',_0x498229);};_0xcb2bc3['on'](_0xed69('0x5e'),function(){onDisconnect(_0xcb2bc3,_0x1d16ab);_0xcb2bc3['log'](_0xed69('0x5f'));});onConnect(_0xcb2bc3);_0xcb2bc3[_0xed69('0x53')](_0xed69('0x60'));});}; \ No newline at end of file +var _0xda20=['findOne','then','autoAssociation','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','map','where','role','Campaign','format','%s:queue:%s','length','user:%s','Agents','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','VoiceQueues','userProfileId','VoiceQueue','ChatQueues','SmsQueue','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','chat','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','name','User','agent','type','ivr'];(function(_0x2e581d,_0x28e422){var _0x787f3b=function(_0x55450f){while(--_0x55450f){_0x2e581d['push'](_0x2e581d['shift']());}};_0x787f3b(++_0x28e422);}(_0xda20,0x1d9));var _0x0da2=function(_0x4adbc9,_0x262962){_0x4adbc9=_0x4adbc9-0x0;var _0x36c384=_0xda20[_0x4adbc9];return _0x36c384;};'use strict';var _=require(_0x0da2('0x0'));var util=require('util');var BPromise=require(_0x0da2('0x1'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x0da2('0x2')],'include':[{'as':'Agents','model':db[_0x0da2('0x3')],'attributes':['id',_0x0da2('0x2'),'role'],'raw':!![],'where':{'role':_0x0da2('0x4')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x0da2('0x2')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x0da2('0x2')]};var queryAgents={'raw':!![],'attributes':['id',_0x0da2('0x2')],'where':{'role':_0x0da2('0x4')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x0da2('0x2'),_0x0da2('0x5')],'where':{'type':_0x0da2('0x6')}};function getAssociatedResources(_0x3e76ad,_0x131fa8,_0x248bce){return db['UserProfileSection'][_0x0da2('0x7')]({'where':{'name':_0x3e76ad,'userProfileId':_0x131fa8},'raw':!![]})[_0x0da2('0x8')](function(_0x18ff2b){if(_0x18ff2b){if(_0x18ff2b[_0x0da2('0x9')]){switch(_0x3e76ad){case'VoiceQueues':case'ChatQueues':case _0x0da2('0xa'):case _0x0da2('0xb'):case _0x0da2('0xc'):case _0x0da2('0xd'):case _0x0da2('0xe'):return db[_0x248bce][_0x0da2('0xf')](queryQueues);case _0x0da2('0x10'):return db[_0x248bce]['findAll'](queryTelephones);case _0x0da2('0x11'):return db[_0x248bce]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x248bce]['findAll'](queryCampaigns);}}else{return db[_0x0da2('0x12')]['findAll']({'attributes':[_0x0da2('0x13')],'where':{'sectionId':_0x18ff2b['id']},'raw':!![]})[_0x0da2('0x8')](function(_0x5d0f4e){if(_0x5d0f4e){var _0xa0613c={'where':{'id':_[_0x0da2('0x14')](_0x5d0f4e,'resourceId')},'raw':!![]};switch(_0x248bce){case _0x0da2('0x3'):_0xa0613c[_0x0da2('0x15')][_0x0da2('0x16')]='telephone';break;case _0x0da2('0x17'):_0xa0613c[_0x0da2('0x15')]['type']='ivr';break;}return db[_0x248bce][_0x0da2('0xf')](_0xa0613c);}else{return[];}});}}else{return[];}})['then'](function(_0x16e7ab){return _0x16e7ab;});}function joinOrLeaveQueues(_0x569834,_0x522b89,_0x495311,_0x5cf40a){_0x569834[_0x522b89](util[_0x0da2('0x18')](_0x0da2('0x19'),_0x495311,_0x5cf40a[_0x0da2('0x2')]));if(_0x5cf40a['Agents']){for(var _0x5304af=0x0;_0x5304af<_0x5cf40a['Agents'][_0x0da2('0x1a')];_0x5304af+=0x1){_0x569834[_0x522b89](util[_0x0da2('0x18')](_0x0da2('0x1b'),_0x5cf40a[_0x0da2('0x1c')][_0x5304af][_0x0da2('0x2')]));}}}function joinOrLeave(_0x51786b,_0x7a3708,_0x113c40){var _0x1c3ab0;if(_0x51786b[_0x0da2('0x1d')][_0x0da2('0x1e')]['id']){db[_0x0da2('0x3')][_0x0da2('0x1f')]({'attributes':['id',_0x0da2('0x2'),_0x0da2('0x16'),'userProfileId'],'where':{'id':_0x51786b[_0x0da2('0x1d')]['query']['id']},'include':[{'model':db[_0x0da2('0x20')],'as':_0x0da2('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x0da2('0x22')],'as':_0x0da2('0x23'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x0da2('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x0da2('0x25')],'as':_0x0da2('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x0da2('0x27')],'as':_0x0da2('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x0da2('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x525dc){if(_0x525dc){_0x1c3ab0=_0x525dc;_0x51786b[_0x7a3708](util[_0x0da2('0x18')](_0x0da2('0x1b'),_0x525dc[_0x0da2('0x2')]));var _0x1d17ad=[];switch(_0x525dc[_0x0da2('0x16')]){case _0x0da2('0x2a'):_0x51786b[_0x7a3708](_0x0da2('0x2b'));_0x51786b[_0x7a3708](_0x0da2('0x2c'));if(queryQueues[_0x0da2('0x2d')](_0x0da2('0x2e'))){delete queryQueues['include'];}_0x1d17ad['push'](db['VoiceQueue'][_0x0da2('0xf')](queryQueues));_0x1d17ad[_0x0da2('0x2f')](db['ChatQueue']['findAll'](queryQueues));_0x1d17ad[_0x0da2('0x2f')](db[_0x0da2('0x30')][_0x0da2('0xf')](queryQueues));_0x1d17ad[_0x0da2('0x2f')](db['SmsQueue'][_0x0da2('0xf')](queryQueues));_0x1d17ad['push'](db[_0x0da2('0x31')][_0x0da2('0xf')](queryQueues));_0x1d17ad[_0x0da2('0x2f')](db[_0x0da2('0x32')][_0x0da2('0xf')](queryQueues));_0x1d17ad[_0x0da2('0x2f')](db[_0x0da2('0x33')]['findAll'](queryQueues));_0x1d17ad[_0x0da2('0x2f')](db[_0x0da2('0x3')][_0x0da2('0xf')](queryTelephones));_0x1d17ad[_0x0da2('0x2f')](db[_0x0da2('0x34')][_0x0da2('0xf')](queryTrunks));_0x1d17ad['push'](db[_0x0da2('0x17')][_0x0da2('0xf')](queryCampaigns));_0x1d17ad[_0x0da2('0x2f')](db[_0x0da2('0x3')]['findAll'](queryAgents));break;case'user':_0x51786b[_0x7a3708](_0x0da2('0x2b'));_0x51786b[_0x7a3708](_0x0da2('0x2c'));_0x1d17ad[_0x0da2('0x2f')](getAssociatedResources(_0x0da2('0x35'),_0x525dc[_0x0da2('0x36')],_0x0da2('0x37')));_0x1d17ad[_0x0da2('0x2f')](getAssociatedResources(_0x0da2('0x38'),_0x525dc[_0x0da2('0x36')],'ChatQueue'));_0x1d17ad[_0x0da2('0x2f')](getAssociatedResources(_0x0da2('0xa'),_0x525dc[_0x0da2('0x36')],_0x0da2('0x30')));_0x1d17ad[_0x0da2('0x2f')](getAssociatedResources(_0x0da2('0xb'),_0x525dc[_0x0da2('0x36')],_0x0da2('0x39')));_0x1d17ad['push'](getAssociatedResources(_0x0da2('0xc'),_0x525dc['userProfileId'],'MailQueue'));_0x1d17ad[_0x0da2('0x2f')](getAssociatedResources('OpenchannelQueues',_0x525dc[_0x0da2('0x36')],_0x0da2('0x32')));_0x1d17ad[_0x0da2('0x2f')](getAssociatedResources(_0x0da2('0xe'),_0x525dc['userProfileId'],_0x0da2('0x33')));_0x1d17ad[_0x0da2('0x2f')](getAssociatedResources(_0x0da2('0x10'),_0x525dc[_0x0da2('0x36')],_0x0da2('0x3')));_0x1d17ad[_0x0da2('0x2f')](getAssociatedResources(_0x0da2('0x11'),_0x525dc[_0x0da2('0x36')],'Trunk'));_0x1d17ad['push'](getAssociatedResources(_0x0da2('0x3a'),_0x525dc['userProfileId'],_0x0da2('0x17')));_0x1d17ad['push'](db[_0x0da2('0x3')]['findAll'](queryAgents));break;case'agent':_0x51786b[_0x7a3708]('voice:inbound');_0x51786b[_0x7a3708](_0x0da2('0x2c'));_0x1d17ad[_0x0da2('0x2f')](_0x525dc[_0x0da2('0x3b')]({'attributes':['id',_0x0da2('0x2')]}));_0x1d17ad['push'](_0x525dc[_0x0da2('0x3c')]({'attributes':['id','name']}));_0x1d17ad[_0x0da2('0x2f')](_0x525dc[_0x0da2('0x3d')]({'attributes':['id','name']}));_0x1d17ad[_0x0da2('0x2f')](_0x525dc[_0x0da2('0x3e')]({'attributes':['id',_0x0da2('0x2')]}));_0x1d17ad[_0x0da2('0x2f')](_0x525dc['getMailQueues']({'attributes':['id',_0x0da2('0x2')]}));_0x1d17ad[_0x0da2('0x2f')](_0x525dc['getOpenchannelQueues']({'attributes':['id',_0x0da2('0x2')]}));_0x1d17ad[_0x0da2('0x2f')](_0x525dc[_0x0da2('0x3f')]({'attributes':['id',_0x0da2('0x2')]}));break;}return BPromise['all'](_0x1d17ad);}})[_0x0da2('0x8')](function(_0x5265f2){if(_0x5265f2&&_0x5265f2[_0x0da2('0x1a')]){for(var _0x971567=0x0;_0x971567<_0x5265f2[_0x0da2('0x1a')];_0x971567+=0x1){for(var _0x19fc01=0x0;_0x19fc01<_0x5265f2[_0x971567][_0x0da2('0x1a')];_0x19fc01+=0x1){switch(_0x971567){case 0x0:joinOrLeaveQueues(_0x51786b,_0x7a3708,'voice',_0x5265f2[_0x971567][_0x19fc01]);break;case 0x1:joinOrLeaveQueues(_0x51786b,_0x7a3708,_0x0da2('0x40'),_0x5265f2[_0x971567][_0x19fc01]);break;case 0x2:joinOrLeaveQueues(_0x51786b,_0x7a3708,_0x0da2('0x41'),_0x5265f2[_0x971567][_0x19fc01]);break;case 0x3:joinOrLeaveQueues(_0x51786b,_0x7a3708,_0x0da2('0x42'),_0x5265f2[_0x971567][_0x19fc01]);break;case 0x4:joinOrLeaveQueues(_0x51786b,_0x7a3708,_0x0da2('0x43'),_0x5265f2[_0x971567][_0x19fc01]);break;case 0x5:joinOrLeaveQueues(_0x51786b,_0x7a3708,'openchannel',_0x5265f2[_0x971567][_0x19fc01]);break;case 0x6:joinOrLeaveQueues(_0x51786b,_0x7a3708,_0x0da2('0x44'),_0x5265f2[_0x971567][_0x19fc01]);break;case 0x7:if(_0x1c3ab0[_0x0da2('0x16')]!==_0x0da2('0x4'))_0x51786b[_0x7a3708](util[_0x0da2('0x18')](_0x0da2('0x45'),_0x5265f2[_0x971567][_0x19fc01]['name']));break;case 0x8:if(_0x1c3ab0[_0x0da2('0x16')]!==_0x0da2('0x4'))_0x51786b[_0x7a3708](util[_0x0da2('0x18')](_0x0da2('0x46'),_0x5265f2[_0x971567][_0x19fc01][_0x0da2('0x2')]));break;case 0x9:if(_0x1c3ab0[_0x0da2('0x16')]!==_0x0da2('0x4'))_0x51786b[_0x7a3708](util['format'](_0x0da2('0x47'),_0x5265f2[_0x971567][_0x19fc01]['type'],_0x5265f2[_0x971567][_0x19fc01]['name']));break;case 0xa:_0x51786b[_0x7a3708](util['format'](_0x0da2('0x1b'),_0x5265f2[_0x971567][_0x19fc01][_0x0da2('0x2')]));break;}}}}})[_0x0da2('0x8')](function(){if(_0x7a3708===_0x0da2('0x48')){var _0x5537e4=_[_0x0da2('0x14')](_0x1c3ab0['ChatInteractions'],'id');return _0x1c3ab0['removeChatInteractions'](_0x5537e4)['then'](function(){for(var _0x34ddb1=0x0;_0x34ddb1<_0x5537e4[_0x0da2('0x1a')];_0x34ddb1+=0x1){_0x113c40[_0x0da2('0x49')](_0x0da2('0x4a'),{'ChatInteractionId':Number(_0x5537e4[_0x34ddb1]),'UserId':Number(_0x1c3ab0['id'])});}});}})['then'](function(){if(_0x7a3708===_0x0da2('0x48')){var _0x42dcd9=_[_0x0da2('0x14')](_0x1c3ab0[_0x0da2('0x23')],'id');return _0x1c3ab0[_0x0da2('0x4b')](_0x42dcd9)[_0x0da2('0x8')](function(){for(var _0x44e99a=0x0;_0x44e99a<_0x42dcd9['length'];_0x44e99a+=0x1){_0x113c40[_0x0da2('0x49')](_0x0da2('0x4c'),{'MailInteractionId':Number(_0x42dcd9[_0x44e99a]),'UserId':Number(_0x1c3ab0['id'])});}});}})[_0x0da2('0x8')](function(){if(_0x7a3708===_0x0da2('0x48')){var _0x11ad94=_['map'](_0x1c3ab0['FaxInteractions'],'id');return _0x1c3ab0[_0x0da2('0x4d')](_0x11ad94)[_0x0da2('0x8')](function(){for(var _0x53b355=0x0;_0x53b355<_0x11ad94['length'];_0x53b355+=0x1){_0x113c40[_0x0da2('0x49')](_0x0da2('0x4e'),{'FaxInteractionId':Number(_0x11ad94[_0x53b355]),'UserId':Number(_0x1c3ab0['id'])});}});}})[_0x0da2('0x8')](function(){if(_0x7a3708===_0x0da2('0x48')){var _0x8c48d6=_[_0x0da2('0x14')](_0x1c3ab0[_0x0da2('0x26')],'id');return _0x1c3ab0[_0x0da2('0x4f')](_0x8c48d6)[_0x0da2('0x8')](function(){for(var _0x2e0236=0x0;_0x2e0236<_0x8c48d6[_0x0da2('0x1a')];_0x2e0236+=0x1){_0x113c40[_0x0da2('0x49')](_0x0da2('0x50'),{'SmsInteractionId':Number(_0x8c48d6[_0x2e0236]),'UserId':Number(_0x1c3ab0['id'])});}});}})[_0x0da2('0x8')](function(){if(_0x7a3708==='leave'){var _0x10cda4=_['map'](_0x1c3ab0['OpenchannelInteractions'],'id');return _0x1c3ab0[_0x0da2('0x51')](_0x10cda4)[_0x0da2('0x8')](function(){for(var _0x33e12e=0x0;_0x33e12e<_0x10cda4[_0x0da2('0x1a')];_0x33e12e+=0x1){_0x113c40[_0x0da2('0x49')](_0x0da2('0x52'),{'OpenchannelInteractionId':Number(_0x10cda4[_0x33e12e]),'UserId':Number(_0x1c3ab0['id'])});}});}})[_0x0da2('0x8')](function(){if(_0x7a3708==='leave'){var _0x50abf1=_[_0x0da2('0x14')](_0x1c3ab0['WhatsappInteractions'],'id');return _0x1c3ab0['removeWhatsappInteractions'](_0x50abf1)[_0x0da2('0x8')](function(){for(var _0x3527cd=0x0;_0x3527cd<_0x50abf1[_0x0da2('0x1a')];_0x3527cd+=0x1){_0x113c40[_0x0da2('0x49')](_0x0da2('0x53'),{'WhatsappInteractionId':Number(_0x50abf1[_0x3527cd]),'UserId':Number(_0x1c3ab0['id'])});}});}})[_0x0da2('0x54')](function(_0x571728){_0x51786b[_0x0da2('0x55')](_0x571728);});}}function onDisconnect(_0xd2d895,_0x1cfc42){joinOrLeave(_0xd2d895,_0x0da2('0x48'),_0x1cfc42);}function onConnect(_0x4d2cf9){joinOrLeave(_0x4d2cf9,_0x0da2('0x56'));}exports[_0x0da2('0x57')]=function(_0x49ef1d){_0x49ef1d['on'](_0x0da2('0x58'),function(_0x5984ab){_0x5984ab[_0x0da2('0x59')](0x0);_0x5984ab[_0x0da2('0x5a')]=_0x5984ab[_0x0da2('0x5b')][_0x0da2('0x58')][_0x0da2('0x5c')]+':'+_0x5984ab[_0x0da2('0x5b')]['connection']['remotePort'];_0x5984ab['connectedAt']=new Date();_0x5984ab[_0x0da2('0x55')]=function(_0x3313b2){console[_0x0da2('0x55')]('SocketIO\x20'+_0x5984ab['nsp'][_0x0da2('0x2')]+'['+_0x5984ab['address']+']',_0x3313b2);};_0x5984ab['on'](_0x0da2('0x5d'),function(){onDisconnect(_0x5984ab,_0x49ef1d);_0x5984ab[_0x0da2('0x55')](_0x0da2('0x5e'));});onConnect(_0x5984ab);_0x5984ab[_0x0da2('0x55')](_0x0da2('0x5f'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index a7ba474..afa2844 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 _0xf96d=['../../mysqldb','../logger','triggers','http','Chat','ChatInteraction','afterCreate','afterUpdate','closedinteraction','SmsInteraction','newmessage','Whatsapp','WhatsappInteraction','newinteraction','Fax','FaxInteraction','FaxMessage','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','then','Trigger,\x20%s','EventManager','error','get','channel','motionChannel','event','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','SELECT','contact','UserId','interface','SIP/%s','name','agent','outgoingmessage','catch','offlineMessage','opened','format','AfterCreate','closed','substatus','QueryTypes','AfterUpdate','User','fullname','email','internal','default','length','hasOwnProperty','model','hook','callback','toLowerCase','util'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xf96d,0x191));var _0xdf96=function(_0x1a0040,_0x4eee31){_0x1a0040=_0x1a0040-0x0;var _0x5d68da=_0xf96d[_0x1a0040];return _0x5d68da;};'use strict';var util=require(_0xdf96('0x0'));var db=require(_0xdf96('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0xdf96('0x2'))(_0xdf96('0x3'));var client=jayson['client'][_0xdf96('0x4')]({'port':0x232a});var triggers=[{'channel':_0xdf96('0x5'),'model':_0xdf96('0x6'),'event':_0xdf96('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xdf96('0x5'),'model':'ChatInteraction','event':_0xdf96('0x8'),'condition':_0xdf96('0x9'),'callback':afterUpdate},{'channel':_0xdf96('0x5'),'model':'ChatMessage','event':_0xdf96('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Chat','model':'ChatOfflineMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0xdf96('0xa'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':_0xdf96('0xa'),'event':_0xdf96('0x8'),'condition':_0xdf96('0x9'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':'afterCreate','condition':_0xdf96('0xb'),'callback':afterCreateMessage},{'channel':_0xdf96('0xc'),'model':_0xdf96('0xd'),'event':_0xdf96('0x7'),'condition':_0xdf96('0xe'),'callback':afterCreate},{'channel':_0xdf96('0xc'),'model':'WhatsappInteraction','event':_0xdf96('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdf96('0xc'),'model':'WhatsappMessage','event':_0xdf96('0x7'),'condition':_0xdf96('0xb'),'callback':afterCreateMessage},{'channel':_0xdf96('0xf'),'model':'FaxInteraction','event':_0xdf96('0x7'),'condition':_0xdf96('0xe'),'callback':afterCreate},{'channel':_0xdf96('0xf'),'model':_0xdf96('0x10'),'event':_0xdf96('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdf96('0xf'),'model':_0xdf96('0x11'),'event':_0xdf96('0x7'),'condition':_0xdf96('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':_0xdf96('0x12'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Mail','model':_0xdf96('0x12'),'event':_0xdf96('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':_0xdf96('0x13'),'event':_0xdf96('0x7'),'condition':_0xdf96('0xb'),'callback':afterCreateMessage},{'channel':_0xdf96('0x14'),'model':'OpenchannelInteraction','event':_0xdf96('0x7'),'condition':_0xdf96('0xe'),'callback':afterCreate},{'channel':'Openchannel','model':_0xdf96('0x15'),'event':_0xdf96('0x8'),'condition':_0xdf96('0x9'),'callback':afterUpdate},{'channel':_0xdf96('0x14'),'model':_0xdf96('0x16'),'event':_0xdf96('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x5c8eef){return client[_0xdf96('0x17')]('EventManager',_0x5c8eef)[_0xdf96('0x18')](function(_0x244daa){logger['info'](_0xdf96('0x19'),_0xdf96('0x1a'),_0x244daa);if(_0x244daa['error']){if(_0x244daa[_0xdf96('0x1b')]['code']===0x1f4){logger[_0xdf96('0x1b')](_0xdf96('0x19'),_0xdf96('0x1a'),_0x244daa[_0xdf96('0x1b')]);}}})['catch'](function(_0x20f980){logger['error']('Trigger,\x20%s','EventManager',_0x20f980);});}function afterCreateMessage(_0x1d90ce){return function(_0x502d11){_0x502d11=_0x502d11[_0xdf96('0x1c')]({'plain':!![]});_0x502d11[_0xdf96('0x1d')]=_0x1d90ce;_0x502d11[_0xdf96('0x1e')]=_0x1d90ce;_0x502d11[_0xdf96('0x1f')]=_0x502d11['direction'];Promise[_0xdf96('0x20')]()['then'](function(){if(typeof _0x502d11[_0xdf96('0x21')]===_0xdf96('0x22'))return null;var _0x274cde=_0xdf96('0x23')+_0x502d11['ContactId'];return db[_0xdf96('0x24')][_0xdf96('0x25')](_0x274cde,{'type':db[_0xdf96('0x26')]['QueryTypes'][_0xdf96('0x27')],'raw':!![]});})[_0xdf96('0x18')](function(_0x34add0){if(_0x34add0){_0x502d11[_0xdf96('0x28')]=_0x34add0[0x0];}if(typeof _0x502d11[_0xdf96('0x29')]===_0xdf96('0x22'))return;return getAgent(_0x502d11[_0xdf96('0x29')]);})['then'](function(_0x52ea3b){if(_0x52ea3b){_0x502d11[_0xdf96('0x2a')]=util['format'](_0xdf96('0x2b'),_0x52ea3b[_0xdf96('0x2c')]);_0x502d11[_0xdf96('0x2d')]=_0x52ea3b;_0x502d11[_0xdf96('0x1d')]=_0x1d90ce;return request({'event':'incomingmessage','message':_0x502d11});}else{return request({'event':_0xdf96('0x2e'),'message':_0x502d11});}})[_0xdf96('0x2f')](function(_0x57f661){logger[_0xdf96('0x1b')](_0xdf96('0x19'),'AfterCreateMessage',_0x57f661);});};}function afterCreateOfflineMessage(_0x4726f5){return function(_0x515b78){_0x515b78=_0x515b78['get']({'plain':!![]});_0x515b78[_0xdf96('0x1d')]=_0x4726f5;_0x515b78['motionChannel']=_0x4726f5;_0x515b78[_0xdf96('0x1f')]=_0xdf96('0x30');return request({'event':_0x515b78[_0xdf96('0x1f')],'message':_0x515b78});};}function afterCreate(_0x231bf4,_0x1a79d8){return function(_0x488cc6){_0x488cc6=_0x488cc6['get']({'plain':!![]});_0x488cc6[_0xdf96('0x1d')]=_0x231bf4;_0x488cc6[_0xdf96('0x1e')]=_0x231bf4;_0x488cc6['event']=_0xdf96('0x31');Promise[_0xdf96('0x20')]()[_0xdf96('0x18')](function(){var _0x365650=_0xdf96('0x23')+_0x488cc6['ContactId'];return db[_0xdf96('0x24')][_0xdf96('0x25')](_0x365650,{'type':db[_0xdf96('0x26')]['QueryTypes']['SELECT'],'raw':!![]});})['then'](function(_0xe3ad5){if(_0xe3ad5){_0x488cc6[_0xdf96('0x28')]=_0xe3ad5[0x0];}if(typeof _0x488cc6[_0xdf96('0x29')]===_0xdf96('0x22'))return;return getAgent(_0x488cc6[_0xdf96('0x29')]);})[_0xdf96('0x18')](function(_0x3d2a03){if(_0x3d2a03){_0x488cc6[_0xdf96('0x2a')]=util[_0xdf96('0x32')](_0xdf96('0x2b'),_0x3d2a03[_0xdf96('0x2c')]);_0x488cc6[_0xdf96('0x2d')]=_0x3d2a03;}return request({'event':_0x1a79d8,'message':_0x488cc6});})[_0xdf96('0x2f')](function(_0xa245a4){logger[_0xdf96('0x1b')](_0xdf96('0x19'),_0xdf96('0x33'),_0xa245a4);});};}function afterUpdate(_0x443802){return function(_0x26a990){var _0x1f33b1=_0x26a990['changed'](_0xdf96('0x34'))&&_0x26a990['closed'];var _0x48550b=_0x26a990['changed']('substatus');if(_0x1f33b1||_0x48550b){var _0x203c5b=_0x1f33b1?_0xdf96('0x9'):_0xdf96('0x35');var _0xacd309=_0x26a990[_0xdf96('0x1c')]({'plain':!![]});_0xacd309[_0xdf96('0x1d')]=_0x443802;_0xacd309[_0xdf96('0x1e')]=_0x443802;_0xacd309[_0xdf96('0x1f')]=_0x1f33b1?_0xdf96('0x34'):_0xdf96('0x35');var _0x24364d=_0xdf96('0x23')+_0xacd309[_0xdf96('0x21')];return db['sequelize'][_0xdf96('0x25')](_0x24364d,{'type':db[_0xdf96('0x26')][_0xdf96('0x36')][_0xdf96('0x27')],'raw':!![]})[_0xdf96('0x18')](function(_0x4ff02d){if(_0x4ff02d){_0xacd309[_0xdf96('0x28')]=_0x4ff02d[0x0];}if(typeof _0xacd309['UserId']==='undefined')return;return getAgent(_0xacd309[_0xdf96('0x29')]);})[_0xdf96('0x18')](function(_0x5afb62){if(_0x5afb62){_0xacd309['interface']=util[_0xdf96('0x32')](_0xdf96('0x2b'),_0x5afb62[_0xdf96('0x2c')]);_0xacd309['agent']=_0x5afb62;}return request({'event':_0x203c5b,'message':_0xacd309});})[_0xdf96('0x2f')](function(_0x16d077){logger[_0xdf96('0x1b')](_0xdf96('0x19'),_0xdf96('0x37'),_0x16d077);});}};}function getAgent(_0x5e7b34){return db[_0xdf96('0x38')]['find']({'where':{'id':_0x5e7b34},'attributes':['id',_0xdf96('0x2c'),_0xdf96('0x39'),_0xdf96('0x3a'),_0xdf96('0x3b')],'raw':!![]})[_0xdf96('0x18')](function(_0x1077ef){return _0x1077ef;});}exports[_0xdf96('0x3c')]=function(){for(var _0x44410f=0x0;_0x44410f=_0x3afa39['agents']){throw Error(_0x52bc('0x13'));}_0x123a2c(_0x394c28);})[_0x52bc('0x14')](function(_0x50d077){_0x4d6960(_0x50d077);});});}; \ No newline at end of file +var _0xb882=['then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','bluebird','../mysqldb','./license/util','voice','mail','chat','sms','whatsapp','openchannel','getChannels','toLowerCase','includes','clearBlockUser','updateAttributes','role','agent','User'];(function(_0xefc05d,_0x705c1a){var _0x2323b9=function(_0x41d0f6){while(--_0x41d0f6){_0xefc05d['push'](_0xefc05d['shift']());}};_0x2323b9(++_0x705c1a);}(_0xb882,0x1a8));var _0x2b88=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xb882[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var BPromise=require(_0x2b88('0x0'));var db=require(_0x2b88('0x1'))['db'];var util=require(_0x2b88('0x2'));var channels=[_0x2b88('0x3'),_0x2b88('0x4'),_0x2b88('0x5'),'fax',_0x2b88('0x6'),_0x2b88('0x7'),_0x2b88('0x8')];exports[_0x2b88('0x9')]=function(){return channels;};exports['isValidChannel']=function(_0x410990){_0x410990=_0x410990[_0x2b88('0xa')]();return _[_0x2b88('0xb')](channels,_0x410990);};exports[_0x2b88('0xc')]=function(_0x2c0f2d,_0x1c7136,_0x35ac76,_0x2ed04f){var _0x270791={'loginAttempts':_0x1c7136,'blocked':_0x35ac76};if(!_['isUndefined'](_0x2ed04f)){_0x270791['blockedAt']=_0x2ed04f;}return _0x2c0f2d[_0x2b88('0xd')](_0x270791);};exports['getLicense']=function(_0x9a4e34){return new BPromise(function(_0x4217b6,_0x27adfa){var _0x4b911c=0x0;if(_0x9a4e34[_0x2b88('0xe')]!==_0x2b88('0xf')){_0x4217b6(_0x9a4e34);}db[_0x2b88('0x10')]['count']({'where':{'role':_0x2b88('0xf'),'online':!![],'id':{'$ne':_0x9a4e34['id']}}})[_0x2b88('0x11')](function(_0x548367){_0x4b911c=_0x548367;return util[_0x2b88('0x12')]();})[_0x2b88('0x11')](function(_0x3cca1a){if(_0x3cca1a&&_0x3cca1a[_0x2b88('0x13')]&&_0x4b911c>=_0x3cca1a[_0x2b88('0x13')]){throw Error(_0x2b88('0x14'));}_0x4217b6(_0x9a4e34);})['catch'](function(_0x2c8372){_0x27adfa(_0x2c8372);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index f383a4c..e72b056 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd087=['json','exports','404','status'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0xd087,0x1bd));var _0x7d08=function(_0x4d0b5b,_0xf881c4){_0x4d0b5b=_0x4d0b5b-0x0;var _0x521856=_0xd087[_0x4d0b5b];return _0x521856;};'use strict';module[_0x7d08('0x0')][0x194]=function pageNotFound(_0xf242a9,_0x3b95fd){var _0x45a3e8=_0x7d08('0x1');var _0x5e2f78=0x194;var _0x50648d={'status':_0x5e2f78};_0x3b95fd[_0x7d08('0x2')](_0x50648d[_0x7d08('0x2')]);_0x3b95fd['render'](_0x45a3e8,{},function(_0x4bc45c,_0x3b7809){if(_0x4bc45c){return _0x3b95fd[_0x7d08('0x2')](_0x50648d[_0x7d08('0x2')])[_0x7d08('0x3')](_0x50648d);}_0x3b95fd['send'](_0x3b7809);});}; \ No newline at end of file +var _0x0e0f=['send','exports','404','status','render','json'];(function(_0x2b4581,_0xf44ae3){var _0x3b9902=function(_0x52e45b){while(--_0x52e45b){_0x2b4581['push'](_0x2b4581['shift']());}};_0x3b9902(++_0xf44ae3);}(_0x0e0f,0xe5));var _0xf0e0=function(_0x5d6ec1,_0x6f2b18){_0x5d6ec1=_0x5d6ec1-0x0;var _0x2b4ed4=_0x0e0f[_0x5d6ec1];return _0x2b4ed4;};'use strict';module[_0xf0e0('0x0')][0x194]=function pageNotFound(_0x505c1e,_0x4a9e1d){var _0x1c8403=_0xf0e0('0x1');var _0x21d817=0x194;var _0x22cc9f={'status':_0x21d817};_0x4a9e1d[_0xf0e0('0x2')](_0x22cc9f['status']);_0x4a9e1d[_0xf0e0('0x3')](_0x1c8403,{},function(_0x2218c8,_0x4a6540){if(_0x2218c8){return _0x4a9e1d[_0xf0e0('0x2')](_0x22cc9f[_0xf0e0('0x2')])[_0xf0e0('0x4')](_0x22cc9f);}_0x4a9e1d[_0xf0e0('0x5')](_0x4a6540);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 9348f06..804cd18 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36fa=['Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','SquareOdbc','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','cascade','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','Team','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','SmsQueue','OpenchannelQueue','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','UserWhatsappQueue','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','user_has_mail_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','CmList','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','VoiceQueueReport','uniqueid','AgentReports','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Disposition','Dispositions','MailApplication','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','Contact','ChatWebsiteId','Answers','Exntensions','TagId','FaxInteractionId','FaxAccountId','fax_interaction_has_tags','Interaction','team_has_fax_queues','SmsAccountId','Interactions','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ProactiveActions','OpenchannelQueueReport','ChatApplication','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','ChatProactiveAction','CompanyId','ChatInteractions','cm_contact_has_tags','Agent','OwnerId','CampaignId','All','Any','AutomationAnyId','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','CustomReportId','Sound','moh_has_sounds','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','Fields','DefaultReportId','Configurations','Subjects','SubjectId','FieldId','AccountId','Subject','Description','DescriptionId','VariableId','SugarcrmAccount','SugarcrmField','Descriptions','Field','DeskAccount','DeskField','int_desk_configuration_has_tags','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowAccount','Dynamics365Configuration','FromId','ToId','SessionId','ProjectId','TrunkBackup','SquareProject','SquareProjectId','campaigns_has_cm_lists','BlackLists','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','CustomFields','Resources','sectionId','WhatsappAccountId','WhatsappApplication','user_has_whatsapp_accounts','WhatsappInteractionId','whatsapp_interaction_has_tags','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','sequelize','lodash','defaultsDeep','motion2','xC@LL1234','127.0.0.1','utf8','utf8_general_ci','sequelizeHistory','mysql','utf8mb4','name','database','username','password','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../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','../api/openchannelQueueReport/openchannelQueueReport.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model'];(function(_0x5acfde,_0x3596d4){var _0x123d61=function(_0x1bcea9){while(--_0x1bcea9){_0x5acfde['push'](_0x5acfde['shift']());}};_0x123d61(++_0x3596d4);}(_0x36fa,0x16c));var _0xa36f=function(_0xa06aa2,_0xa03c95){_0xa06aa2=_0xa06aa2-0x0;var _0x34b48d=_0x36fa[_0xa06aa2];return _0x34b48d;};'use strict';var config=require(_0xa36f('0x0'));var Sequelize=require(_0xa36f('0x1'));var _=require(_0xa36f('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config['sequelize']=_[_0xa36f('0x3')](config[_0xa36f('0x1')],{'database':_0xa36f('0x4'),'username':'xcall','password':_0xa36f('0x5'),'options':{'host':_0xa36f('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xa36f('0x7'),'collate':_0xa36f('0x8')}}});config[_0xa36f('0x9')]=_['defaultsDeep'](config[_0xa36f('0x9')],{'database':_0xa36f('0x4'),'username':'xcall','password':'xC@LL1234','options':{'host':_0xa36f('0x6'),'port':0xcea,'dialect':_0xa36f('0xa'),'dialectOptions':{'charset':_0xa36f('0xb')},'logging':![],'timezone':timezone[_0xa36f('0xc')](),'define':{'charset':_0xa36f('0x7'),'collate':_0xa36f('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xa36f('0xd')],config[_0xa36f('0x1')][_0xa36f('0xe')],config[_0xa36f('0x1')][_0xa36f('0xf')],config[_0xa36f('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa36f('0x9')][_0xa36f('0xd')],config[_0xa36f('0x9')][_0xa36f('0xe')],config['sequelizeHistory'][_0xa36f('0xf')],config[_0xa36f('0x9')]['options'])};db[_0xa36f('0x10')]=db['sequelize'][_0xa36f('0x11')]('../api/user/user.model');db[_0xa36f('0x12')]=db['sequelize']['import'](_0xa36f('0x13'));db[_0xa36f('0x14')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x15'));db[_0xa36f('0x16')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x17'));db[_0xa36f('0x18')]=db[_0xa36f('0x1')]['import'](_0xa36f('0x19'));db[_0xa36f('0x1a')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x1b'));db[_0xa36f('0x1c')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x1d'));db[_0xa36f('0x1e')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x1f'));db[_0xa36f('0x20')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x21'));db[_0xa36f('0x22')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x23'));db['VoiceCallReport']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x24'));db[_0xa36f('0x25')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x26'));db[_0xa36f('0x27')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x28'));db['VoiceQueueReport']=db[_0xa36f('0x1')]['import'](_0xa36f('0x29'));db['MemberReport']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x2a'));db[_0xa36f('0x2b')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x2c'));db[_0xa36f('0x2d')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x2e'));db[_0xa36f('0x2f')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x30'));db[_0xa36f('0x31')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x32'));db[_0xa36f('0x33')]=db[_0xa36f('0x1')][_0xa36f('0x11')]('../api/userChatQueue/userChatQueue.model');db[_0xa36f('0x34')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x35'));db[_0xa36f('0x36')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x37'));db[_0xa36f('0x38')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x39'));db['UserOpenchannelQueue']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x3a'));db['UserWhatsappQueue']=db['sequelize']['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xa36f('0x3b')]=db['sequelize']['import']('../api/mailServerIn/mailServerIn.model');db[_0xa36f('0x3c')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x3d'));db['MailAccount']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x3e'));db[_0xa36f('0x3f')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x40'));db['MailSubstatus']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x41'));db[_0xa36f('0x42')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x43'));db[_0xa36f('0x44')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x45'));db['MailApplication']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x46'));db[_0xa36f('0x47')]=db[_0xa36f('0x1')]['import'](_0xa36f('0x48'));db[_0xa36f('0x49')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x4a'));db[_0xa36f('0x4b')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x4c'));db[_0xa36f('0x4d')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x4e'));db[_0xa36f('0x4f')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x50'));db[_0xa36f('0x51')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x52'));db[_0xa36f('0x53')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x54'));db[_0xa36f('0x55')]=db[_0xa36f('0x1')][_0xa36f('0x11')]('../api/faxQueue/faxQueue.model');db[_0xa36f('0x56')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x57'));db[_0xa36f('0x58')]=db[_0xa36f('0x1')]['import']('../api/smsAccount/smsAccount.model');db[_0xa36f('0x59')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x5a'));db[_0xa36f('0x5b')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x5c'));db[_0xa36f('0x5d')]=db[_0xa36f('0x1')]['import'](_0xa36f('0x5e'));db['SmsQueue']=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x5f'));db[_0xa36f('0x60')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x61'));db[_0xa36f('0x62')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x63'));db['OpenchannelInteraction']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x64'));db[_0xa36f('0x65')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x66'));db['OpenchannelQueue']=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x67'));db[_0xa36f('0x68')]=db[_0xa36f('0x1')]['import'](_0xa36f('0x69'));db['OpenchannelQueueReport']=db[_0xa36f('0x1')]['import'](_0xa36f('0x6a'));db['ChatApplication']=db[_0xa36f('0x1')]['import']('../api/chatApplication/chatApplication.model');db[_0xa36f('0x6b')]=db['sequelize'][_0xa36f('0x11')]('../api/chatInteraction/chatInteraction.model');db[_0xa36f('0x6c')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x6d'));db[_0xa36f('0x6e')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x6f'));db[_0xa36f('0x70')]=db[_0xa36f('0x1')]['import'](_0xa36f('0x71'));db[_0xa36f('0x72')]=db[_0xa36f('0x1')]['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db['sequelize']['import'](_0xa36f('0x73'));db[_0xa36f('0x74')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x75'));db[_0xa36f('0x76')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x77'));db[_0xa36f('0x78')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x79'));db[_0xa36f('0x7a')]=db['sequelize'][_0xa36f('0x11')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xa36f('0x7b')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x7c'));db[_0xa36f('0x7d')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x7e'));db[_0xa36f('0x7f')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x80'));db[_0xa36f('0x81')]=db[_0xa36f('0x1')][_0xa36f('0x11')]('../api/cmCustomField/cmCustomField.model');db[_0xa36f('0x82')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x83'));db[_0xa36f('0x84')]=db['sequelize'][_0xa36f('0x11')]('../api/automation/automation.model');db[_0xa36f('0x85')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x86'));db['Disposition']=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x87'));db[_0xa36f('0x88')]=db[_0xa36f('0x1')]['import'](_0xa36f('0x89'));db[_0xa36f('0x8a')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x8b'));db[_0xa36f('0x8c')]=db[_0xa36f('0x1')][_0xa36f('0x11')]('../api/pause/pause.model');db[_0xa36f('0x8d')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x8e'));db[_0xa36f('0x8f')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x90'));db[_0xa36f('0x91')]=db[_0xa36f('0x1')]['import'](_0xa36f('0x92'));db['Sound']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x93'));db[_0xa36f('0x94')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x95'));db[_0xa36f('0x96')]=db[_0xa36f('0x1')]['import'](_0xa36f('0x97'));db[_0xa36f('0x98')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x99'));db[_0xa36f('0x9a')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x9b'));db[_0xa36f('0x9c')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x9d'));db['IntegrationReport']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x9e'));db[_0xa36f('0x9f')]=db[_0xa36f('0x1')]['import'](_0xa36f('0xa0'));db[_0xa36f('0xa1')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xa2'));db[_0xa36f('0xa3')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xa4'));db[_0xa36f('0xa5')]=db[_0xa36f('0x1')]['import'](_0xa36f('0xa6'));db[_0xa36f('0xa7')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xa8'));db[_0xa36f('0xa9')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xaa'));db[_0xa36f('0xab')]=db['sequelize'][_0xa36f('0x11')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xa36f('0xac')]=db['sequelize']['import'](_0xa36f('0xad'));db[_0xa36f('0xae')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xaf'));db['SugarcrmAccount']=db[_0xa36f('0x1')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xa36f('0xb0')]=db[_0xa36f('0x1')]['import'](_0xa36f('0xb1'));db['SugarcrmField']=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xb2'));db['DeskAccount']=db['sequelize']['import']('../api/intDeskAccount/intDeskAccount.model');db[_0xa36f('0xb3')]=db[_0xa36f('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0xa36f('0x1')]['import']('../api/intDeskField/intDeskField.model');db[_0xa36f('0xb4')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xb5'));db[_0xa36f('0xb6')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xb7'));db[_0xa36f('0xb8')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xb9'));db[_0xa36f('0xba')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xbb'));db['ZendeskConfiguration']=db[_0xa36f('0x1')]['import'](_0xa36f('0xbc'));db['ZendeskField']=db[_0xa36f('0x1')][_0xa36f('0x11')]('../api/intZendeskField/intZendeskField.model');db[_0xa36f('0xbd')]=db[_0xa36f('0x1')]['import'](_0xa36f('0xbe'));db[_0xa36f('0xbf')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xc0'));db['FreshdeskField']=db[_0xa36f('0x1')]['import'](_0xa36f('0xc1'));db['VtigerAccount']=db[_0xa36f('0x1')][_0xa36f('0x11')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xa36f('0xc2')]=db['sequelize'][_0xa36f('0x11')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xc3'));db['ServicenowAccount']=db['sequelize'][_0xa36f('0x11')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xa36f('0xc4')]=db[_0xa36f('0x1')][_0xa36f('0x11')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xa36f('0xc5')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xc6'));db[_0xa36f('0xc7')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xc8'));db['Dynamics365Configuration']=db[_0xa36f('0x1')][_0xa36f('0x11')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xa36f('0xc9')]=db[_0xa36f('0x1')]['import'](_0xa36f('0xca'));db[_0xa36f('0xcb')]=db[_0xa36f('0x1')]['import'](_0xa36f('0xcc'));db[_0xa36f('0xcd')]=db['sequelize'][_0xa36f('0x11')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xa36f('0xce')]=db['sequelize']['import']('../api/intFreshsalesField/intFreshsalesField.model');db[_0xa36f('0x9c')]=db[_0xa36f('0x1')]['import'](_0xa36f('0x9d'));db[_0xa36f('0xcf')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xd0'));db[_0xa36f('0xd1')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xd2'));db[_0xa36f('0xd3')]=db[_0xa36f('0x1')]['import'](_0xa36f('0xd4'));db[_0xa36f('0xd5')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xd6'));db[_0xa36f('0xd7')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xd8'));db[_0xa36f('0xd9')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xda'));db[_0xa36f('0xdb')]=db[_0xa36f('0x1')]['import']('../api/smsQueueReport/smsQueueReport.model');db[_0xa36f('0xdc')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xdd'));db['SquareDetailsReport']=db[_0xa36f('0x1')][_0xa36f('0x11')]('../api/squareReportDetail/squareReportDetail.model');db[_0xa36f('0xde')]=db['sequelize']['import'](_0xa36f('0xdf'));db['Setting']=db[_0xa36f('0x1')]['import']('../api/setting/setting.model');db[_0xa36f('0xe0')]=db[_0xa36f('0x1')]['import']('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xe1'));db[_0xa36f('0xe2')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xe3'));db[_0xa36f('0xe4')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xe5'));db['Team']=db[_0xa36f('0x1')][_0xa36f('0x11')]('../api/team/team.model');db['License']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xe6'));db[_0xa36f('0xe7')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xe8'));db[_0xa36f('0xe9')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xea'));db['Attachment']=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xeb'));db[_0xa36f('0xec')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xed'));db[_0xa36f('0xee')]=db['sequelize'][_0xa36f('0x11')]('../api/mailTransferReport/mailTransferReport.model');db[_0xa36f('0xef')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xf0'));db[_0xa36f('0xf1')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xf2'));db[_0xa36f('0xf3')]=db['sequelize'][_0xa36f('0x11')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xa36f('0xf4')]=db[_0xa36f('0x1')]['import'](_0xa36f('0xf5'));db['CmList']=db[_0xa36f('0x1')][_0xa36f('0x11')]('../api/cmList/cmList.model');db[_0xa36f('0xf6')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0xf7'));db[_0xa36f('0xf8')]=db[_0xa36f('0x1')]['import'](_0xa36f('0xf9'));db[_0xa36f('0xfa')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xfb'));db[_0xa36f('0xfc')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0xfd'));db['UserNotification']=db[_0xa36f('0x1')]['import'](_0xa36f('0xfe'));db[_0xa36f('0xff')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x100'));db['WhatsappApplication']=db['sequelize'][_0xa36f('0x11')]('../api/whatsappApplication/whatsappApplication.model');db[_0xa36f('0x101')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x102'));db[_0xa36f('0x103')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x104'));db[_0xa36f('0x105')]=db['sequelize'][_0xa36f('0x11')](_0xa36f('0x106'));db[_0xa36f('0x107')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x108'));db[_0xa36f('0x109')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x10a'));db[_0xa36f('0x10b')]=db[_0xa36f('0x1')]['import']('../api/cloudProvider/cloudProvider.model');db[_0xa36f('0x10c')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x10d'));db[_0xa36f('0x10e')]=db[_0xa36f('0x1')]['import'](_0xa36f('0x10f'));db[_0xa36f('0x110')]=db[_0xa36f('0x1')][_0xa36f('0x11')](_0xa36f('0x111'));db[_0xa36f('0x112')]=db['sequelize'][_0xa36f('0x11')]('../api/user-setting/user-setting.model');db[_0xa36f('0x10')][_0xa36f('0x113')](db[_0xa36f('0x20')],{'as':_0xa36f('0x20'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x115')});db['User'][_0xa36f('0x113')](db['UserSetting'],{'as':_0xa36f('0x116'),'onDelete':'cascade','foreignKey':'UserId'});db[_0xa36f('0x10')][_0xa36f('0x117')](db[_0xa36f('0x1c')],{'as':_0xa36f('0x118'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x10')][_0xa36f('0x117')](db[_0xa36f('0x2f')],{'as':_0xa36f('0x119'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x10')][_0xa36f('0x117')](db[_0xa36f('0x16')],{'as':_0xa36f('0x11a'),'onDelete':_0xa36f('0x114'),'hooks':!![]});db['User'][_0xa36f('0x117')](db[_0xa36f('0x7b')],{'as':_0xa36f('0x11b'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0xa36f('0x7d')],{'as':_0xa36f('0x11c'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x10')][_0xa36f('0x117')](db[_0xa36f('0x7f')],{'as':_0xa36f('0x7f'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x10')][_0xa36f('0x117')](db[_0xa36f('0x11d')],{'as':_0xa36f('0x11e'),'foreignKey':'UserId'});db[_0xa36f('0x10')][_0xa36f('0x117')](db[_0xa36f('0x6b')],{'as':'ChatInteractions','foreignKey':_0xa36f('0x115')});db[_0xa36f('0x10')][_0xa36f('0x117')](db[_0xa36f('0x5b')],{'as':_0xa36f('0x11f'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x10')][_0xa36f('0x117')](db[_0xa36f('0x51')],{'as':_0xa36f('0x120'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x10')][_0xa36f('0x117')](db[_0xa36f('0x42')],{'as':'MailInteractions','foreignKey':_0xa36f('0x115')});db[_0xa36f('0x10')][_0xa36f('0x117')](db[_0xa36f('0x101')],{'as':_0xa36f('0x121'),'foreignKey':'UserId'});db[_0xa36f('0x10')][_0xa36f('0x117')](db['UserNotification'],{'as':_0xa36f('0x122'),'foreignKey':_0xa36f('0x123')});db[_0xa36f('0x10')][_0xa36f('0x124')](db[_0xa36f('0xf8')],{'as':_0xa36f('0xf8'),'foreignKey':_0xa36f('0x125')});db[_0xa36f('0x10')][_0xa36f('0x126')](db[_0xa36f('0x72')],{'as':_0xa36f('0x127'),'through':_0xa36f('0x128')});db[_0xa36f('0x10')][_0xa36f('0x126')](db[_0xa36f('0x76')],{'as':_0xa36f('0x129'),'through':'cm_user_has_contacts'});db[_0xa36f('0x10')][_0xa36f('0x126')](db['CmList'],{'as':_0xa36f('0x12a'),'through':'cm_user_has_lists'});db['User'][_0xa36f('0x126')](db[_0xa36f('0x12b')],{'through':_0xa36f('0x12c')});db[_0xa36f('0x10')][_0xa36f('0x126')](db[_0xa36f('0x42')],{'as':_0xa36f('0x12d'),'through':_0xa36f('0x12e')});db[_0xa36f('0x10')][_0xa36f('0x126')](db[_0xa36f('0x6b')],{'as':'ChatInteractions','through':_0xa36f('0x12f')});db[_0xa36f('0x10')][_0xa36f('0x126')](db[_0xa36f('0x51')],{'as':'FaxInteractions','through':_0xa36f('0x130')});db['User'][_0xa36f('0x126')](db[_0xa36f('0x5b')],{'as':_0xa36f('0x11f'),'through':_0xa36f('0x131')});db['User'][_0xa36f('0x126')](db[_0xa36f('0x11d')],{'as':'OpenchannelInteractions','through':_0xa36f('0x132')});db[_0xa36f('0x10')][_0xa36f('0x126')](db['WhatsappInteraction'],{'as':_0xa36f('0x121'),'through':_0xa36f('0x133')});db[_0xa36f('0x10')][_0xa36f('0x126')](db[_0xa36f('0x1a')],{'as':_0xa36f('0x134'),'through':'UserVoiceQueue','required':![]});db[_0xa36f('0x10')]['belongsToMany'](db[_0xa36f('0xf6')],{'as':_0xa36f('0x135'),'through':'UserVoicePrefix','required':![]});db[_0xa36f('0x10')][_0xa36f('0x126')](db[_0xa36f('0x3f')],{'as':_0xa36f('0x136'),'through':'UserMailQueue','required':![]});db['User'][_0xa36f('0x126')](db['ChatQueue'],{'as':_0xa36f('0x137'),'through':_0xa36f('0x33'),'required':![],'hooks':!![]});db[_0xa36f('0x10')][_0xa36f('0x126')](db['FaxQueue'],{'as':'FaxQueues','through':_0xa36f('0x36'),'required':![]});db[_0xa36f('0x10')]['belongsToMany'](db[_0xa36f('0x138')],{'as':'SmsQueues','through':_0xa36f('0x38'),'required':![]});db[_0xa36f('0x10')][_0xa36f('0x126')](db[_0xa36f('0x139')],{'as':_0xa36f('0x13a'),'through':_0xa36f('0x13b'),'required':![]});db[_0xa36f('0x10')]['belongsToMany'](db['WhatsappQueue'],{'as':_0xa36f('0x13c'),'through':_0xa36f('0x13d'),'required':![]});db[_0xa36f('0x10')][_0xa36f('0x126')](db['CmList'],{'through':_0xa36f('0x13e')});db[_0xa36f('0x10')][_0xa36f('0x126')](db[_0xa36f('0x68')],{'as':_0xa36f('0x13f'),'through':_0xa36f('0x140')});db['User']['belongsToMany'](db[_0xa36f('0x4d')],{'as':_0xa36f('0x141'),'through':_0xa36f('0x142')});db['User'][_0xa36f('0x126')](db[_0xa36f('0x143')],{'as':'MailAccounts','through':_0xa36f('0x144')});db['User'][_0xa36f('0x126')](db[_0xa36f('0x60')],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0xa36f('0x10')][_0xa36f('0x126')](db[_0xa36f('0x58')],{'as':_0xa36f('0x145'),'through':_0xa36f('0x146')});db[_0xa36f('0x10')][_0xa36f('0x126')](db[_0xa36f('0xff')],{'as':_0xa36f('0x147'),'through':'user_has_whatsapp_accounts'});db['User'][_0xa36f('0x126')](db['SquareProject'],{'as':_0xa36f('0x148'),'through':_0xa36f('0x149')});db['VoiceChanSpy']['hasMany'](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x14a')});db['VoiceContext']['hasMany'](db[_0xa36f('0x16')],{'onDelete':_0xa36f('0x114')});db[_0xa36f('0x16')]['hasMany'](db[_0xa36f('0x16')],{'as':_0xa36f('0x14b'),'onDelete':_0xa36f('0x114')});db['VoiceMusicOnHold'][_0xa36f('0x126')](db['Sound'],{'as':_0xa36f('0x14c'),'through':'moh_has_sounds'});db[_0xa36f('0x1a')][_0xa36f('0x117')](db[_0xa36f('0x2f')],{'as':_0xa36f('0x14d'),'foreignKey':_0xa36f('0x14e')});db['VoiceQueue'][_0xa36f('0x117')](db[_0xa36f('0x78')],{'as':_0xa36f('0x14f'),'foreignKey':_0xa36f('0x14e')});db[_0xa36f('0x1a')][_0xa36f('0x117')](db['CmHopperFinal'],{'as':_0xa36f('0x11b'),'foreignKey':_0xa36f('0x14e')});db[_0xa36f('0x1a')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xa36f('0x14e')});db['VoiceQueue'][_0xa36f('0x117')](db['ReportAgentPreview'],{'as':_0xa36f('0x7f'),'foreignKey':_0xa36f('0x14e')});db[_0xa36f('0x1a')][_0xa36f('0x117')](db[_0xa36f('0x7a')],{'as':_0xa36f('0x150'),'foreignKey':_0xa36f('0x14e')});db[_0xa36f('0x1a')]['hasMany'](db[_0xa36f('0xd9')],{'as':_0xa36f('0x151'),'foreignKey':_0xa36f('0x14e')});db[_0xa36f('0x1a')][_0xa36f('0x124')](db[_0xa36f('0x2b')],{'as':_0xa36f('0x2b'),'foreignKey':_0xa36f('0x152')});db['VoiceQueue'][_0xa36f('0x124')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0xa36f('0x153')});db['VoiceQueue'][_0xa36f('0x124')](db['Interval'],{'as':_0xa36f('0x8a'),'foreignKey':_0xa36f('0x154')});db[_0xa36f('0x1a')][_0xa36f('0x124')](db['Pause'],{'as':_0xa36f('0x155'),'foreignKey':_0xa36f('0x156')});db['VoiceQueue'][_0xa36f('0x126')](db[_0xa36f('0x157')],{'as':_0xa36f('0x12a'),'through':_0xa36f('0x158')});db['VoiceQueue'][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':_0xa36f('0x159'),'through':_0xa36f('0x31')});db['VoiceQueue'][_0xa36f('0x126')](db[_0xa36f('0x12b')],{'as':_0xa36f('0x15a'),'through':_0xa36f('0x10c')});db[_0xa36f('0x1a')][_0xa36f('0x126')](db[_0xa36f('0x157')],{'as':'BlackLists','through':_0xa36f('0x15b')});db[_0xa36f('0x1c')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'as':_0xa36f('0x10'),'foreignKey':'UserId'});db['ScreenRecording'][_0xa36f('0x124')](db[_0xa36f('0x10')],{'as':_0xa36f('0x10'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x20')]['hasMany'](db[_0xa36f('0x22')],{'as':_0xa36f('0x15c'),'onDelete':_0xa36f('0x114'),'foreignKey':'mailboxuser','sourceKey':_0xa36f('0x15d')});db[_0xa36f('0x22')][_0xa36f('0x124')](db[_0xa36f('0x20')],{'foreignKey':_0xa36f('0x15e'),'targetKey':_0xa36f('0x15d')});db[_0xa36f('0x15f')][_0xa36f('0x117')](db[_0xa36f('0x160')],{'as':'QueueCalls','foreignKey':_0xa36f('0x161'),'constraints':![]});db[_0xa36f('0x15f')]['hasMany'](db[_0xa36f('0x27')],{'as':_0xa36f('0x162'),'foreignKey':_0xa36f('0x161'),'constraints':![]});db[_0xa36f('0x15f')][_0xa36f('0x124')](db['User'],{'as':_0xa36f('0x10'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x15f')][_0xa36f('0x124')](db['CmContact'],{'as':'Contact','foreignKey':_0xa36f('0x163')});db[_0xa36f('0x3b')][_0xa36f('0x124')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xa36f('0x164')});db[_0xa36f('0x3b')][_0xa36f('0x124')](db['CloudProvider'],{'as':_0xa36f('0x10b'),'foreignKey':_0xa36f('0x165'),'onDelete':_0xa36f('0x166')});db[_0xa36f('0x3c')][_0xa36f('0x124')](db[_0xa36f('0x143')],{'as':_0xa36f('0x143'),'foreignKey':_0xa36f('0x164')});db['MailServerOut'][_0xa36f('0x124')](db[_0xa36f('0x10b')],{'as':_0xa36f('0x10b'),'foreignKey':_0xa36f('0x165'),'onDelete':_0xa36f('0x166')});db[_0xa36f('0x143')][_0xa36f('0x113')](db['MailServerIn'],{'as':_0xa36f('0x167'),'onDelete':_0xa36f('0x114')});db[_0xa36f('0x143')][_0xa36f('0x113')](db[_0xa36f('0x3c')],{'as':_0xa36f('0x168'),'onDelete':_0xa36f('0x114')});db['MailAccount'][_0xa36f('0x117')](db[_0xa36f('0x169')],{'as':_0xa36f('0x16a'),'foreignKey':_0xa36f('0x164'),'onDelete':'cascade'});db[_0xa36f('0x143')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':'MailAccountId'});db['MailAccount'][_0xa36f('0x117')](db[_0xa36f('0x44')],{'as':_0xa36f('0x15c'),'foreignKey':_0xa36f('0x164')});db[_0xa36f('0x143')][_0xa36f('0x117')](db['MailInteraction'],{'as':'Interactions'});db[_0xa36f('0x143')][_0xa36f('0x117')](db[_0xa36f('0x16b')],{'as':_0xa36f('0x14b')});db[_0xa36f('0x143')][_0xa36f('0x124')](db[_0xa36f('0x157')],{'as':_0xa36f('0x16c'),'foreignKey':_0xa36f('0x16d')});db['MailAccount']['belongsTo'](db[_0xa36f('0x96')],{'as':_0xa36f('0x96'),'foreignKey':_0xa36f('0x16e')});db[_0xa36f('0x143')]['belongsTo'](db[_0xa36f('0x8c')],{'as':_0xa36f('0x155'),'foreignKey':_0xa36f('0x156')});db[_0xa36f('0x143')][_0xa36f('0x126')](db['User'],{'as':_0xa36f('0x159'),'through':_0xa36f('0x144')});db[_0xa36f('0x3f')][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':_0xa36f('0x159'),'through':'UserMailQueue'});db['MailQueue'][_0xa36f('0x126')](db[_0xa36f('0x12b')],{'through':_0xa36f('0x16f'),'as':_0xa36f('0x15a')});db[_0xa36f('0x42')][_0xa36f('0x117')](db[_0xa36f('0x44')],{'as':_0xa36f('0x15c'),'onDelete':'cascade','foreignKey':_0xa36f('0x170')});db[_0xa36f('0x42')][_0xa36f('0x124')](db[_0xa36f('0x143')],{'as':_0xa36f('0x171'),'foreignKey':'MailAccountId'});db['MailInteraction'][_0xa36f('0x124')](db['CmContact'],{'as':'Contact','foreignKey':_0xa36f('0x163')});db[_0xa36f('0x42')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'as':_0xa36f('0x172'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x42')][_0xa36f('0x126')](db[_0xa36f('0x94')],{'through':_0xa36f('0x173'),'as':_0xa36f('0x174')});db[_0xa36f('0x42')][_0xa36f('0x126')](db[_0xa36f('0x94')],{'through':_0xa36f('0x173'),'as':_0xa36f('0x175')});db['MailInteraction'][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':_0xa36f('0x176'),'through':'user_has_mail_interactions','foreignKey':_0xa36f('0x170')});db[_0xa36f('0x44')][_0xa36f('0x117')](db[_0xa36f('0x177')],{'as':_0xa36f('0x178'),'onDelete':_0xa36f('0x114')});db[_0xa36f('0x44')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'as':_0xa36f('0x10')});db[_0xa36f('0x44')]['belongsTo'](db[_0xa36f('0x76')],{'onDelete':_0xa36f('0x114'),'as':_0xa36f('0x179')});db[_0xa36f('0x44')][_0xa36f('0x124')](db['MailInteraction'],{'as':'Interaction','foreignKey':_0xa36f('0x170')});db[_0xa36f('0x44')][_0xa36f('0x124')](db[_0xa36f('0x143')],{'as':_0xa36f('0x171'),'foreignKey':_0xa36f('0x164')});db[_0xa36f('0x44')][_0xa36f('0x124')](db[_0xa36f('0x68')],{'as':'ChatWebsite','foreignKey':_0xa36f('0x17a')});db['MailMessage'][_0xa36f('0x124')](db[_0xa36f('0x6e')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0xa36f('0x124')](db[_0xa36f('0x10')],{'onDelete':_0xa36f('0x166')});db['MailApplication'][_0xa36f('0x124')](db[_0xa36f('0x3f')],{'onDelete':_0xa36f('0x166')});db['MailApplication']['belongsTo'](db[_0xa36f('0x143')],{'onDelete':_0xa36f('0x166')});db[_0xa36f('0x16b')]['belongsTo'](db[_0xa36f('0x8a')],{'onDelete':_0xa36f('0x166'),'foreignKey':'IntervalId'});db['MailApplication']['belongsTo'](db[_0xa36f('0x94')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport'][_0xa36f('0x124')](db[_0xa36f('0x143')],{});db[_0xa36f('0x47')][_0xa36f('0x124')](db['CmList'],{'as':_0xa36f('0x16c'),'foreignKey':_0xa36f('0x16d')});db['MailQueueReport'][_0xa36f('0x124')](db[_0xa36f('0x76')],{'as':_0xa36f('0x179'),'foreignKey':'ContactId'});db[_0xa36f('0x47')][_0xa36f('0x124')](db[_0xa36f('0x42')],{});db[_0xa36f('0x47')][_0xa36f('0x124')](db[_0xa36f('0x44')],{});db[_0xa36f('0x47')][_0xa36f('0x124')](db[_0xa36f('0x10')],{});db[_0xa36f('0x47')]['belongsTo'](db[_0xa36f('0x3f')],{});db['Dashboard'][_0xa36f('0x117')](db['DashboardItem'],{'as':'Items','onDelete':_0xa36f('0x114')});db[_0xa36f('0x4d')][_0xa36f('0x117')](db[_0xa36f('0x169')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':'cascade'});db['FaxAccount'][_0xa36f('0x117')](db[_0xa36f('0x85')],{'as':_0xa36f('0x17b'),'foreignKey':'FaxAccountId'});db['FaxAccount']['hasMany'](db[_0xa36f('0x51')],{'as':'Interactions'});db[_0xa36f('0x4d')][_0xa36f('0x117')](db[_0xa36f('0x4f')],{'as':'Applications'});db[_0xa36f('0x4d')][_0xa36f('0x117')](db[_0xa36f('0x16')],{'as':_0xa36f('0x17c'),'onDelete':_0xa36f('0x114')});db[_0xa36f('0x4d')][_0xa36f('0x117')](db['FaxMessage'],{'as':'Messages'});db['FaxAccount'][_0xa36f('0x124')](db[_0xa36f('0x2b')],{'as':'Trunk'});db[_0xa36f('0x4d')][_0xa36f('0x124')](db['CmList'],{'as':_0xa36f('0x16c'),'foreignKey':_0xa36f('0x16d')});db[_0xa36f('0x4d')][_0xa36f('0x124')](db[_0xa36f('0x8c')],{'as':_0xa36f('0x155'),'foreignKey':_0xa36f('0x156')});db['FaxAccount']['belongsToMany'](db['User'],{'as':_0xa36f('0x159'),'through':'user_has_fax_accounts'});db[_0xa36f('0x4f')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'onDelete':'restrict'});db[_0xa36f('0x4f')][_0xa36f('0x124')](db[_0xa36f('0x55')],{'onDelete':_0xa36f('0x166')});db[_0xa36f('0x4f')][_0xa36f('0x124')](db[_0xa36f('0x4d')],{'onDelete':_0xa36f('0x166')});db[_0xa36f('0x4f')][_0xa36f('0x124')](db[_0xa36f('0x94')],{'onDelete':_0xa36f('0x166'),'foreignKey':_0xa36f('0x17d')});db['FaxInteraction'][_0xa36f('0x117')](db['FaxMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xa36f('0x17e')});db[_0xa36f('0x51')][_0xa36f('0x124')](db[_0xa36f('0x4d')],{'as':'Account','foreignKey':_0xa36f('0x17f')});db[_0xa36f('0x51')]['belongsTo'](db[_0xa36f('0x76')],{'as':'Contact','foreignKey':_0xa36f('0x163')});db[_0xa36f('0x51')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'as':_0xa36f('0x172'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x51')][_0xa36f('0x126')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0xa36f('0x174')});db[_0xa36f('0x51')]['belongsToMany'](db['Tag'],{'through':_0xa36f('0x180'),'as':_0xa36f('0x175')});db['FaxInteraction']['belongsToMany'](db[_0xa36f('0x10')],{'as':_0xa36f('0x176'),'through':_0xa36f('0x130'),'foreignKey':_0xa36f('0x17e')});db['FaxMessage'][_0xa36f('0x124')](db['User'],{'onDelete':'cascade','as':'User'});db[_0xa36f('0x53')][_0xa36f('0x124')](db[_0xa36f('0x51')],{'as':_0xa36f('0x181'),'foreignKey':_0xa36f('0x17e')});db[_0xa36f('0x53')][_0xa36f('0x124')](db[_0xa36f('0x76')],{'onDelete':_0xa36f('0x114'),'as':_0xa36f('0x179')});db['FaxMessage']['belongsTo'](db[_0xa36f('0x177')],{'as':_0xa36f('0x177'),'foreignKey':'AttachmentId'});db[_0xa36f('0x53')]['belongsTo'](db[_0xa36f('0x4d')],{'as':_0xa36f('0x171'),'foreignKey':_0xa36f('0x17f')});db[_0xa36f('0x55')][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':'Agents','through':_0xa36f('0x36')});db[_0xa36f('0x55')][_0xa36f('0x126')](db[_0xa36f('0x12b')],{'through':_0xa36f('0x182'),'as':_0xa36f('0x15a')});db[_0xa36f('0x56')][_0xa36f('0x124')](db['FaxAccount'],{});db[_0xa36f('0x56')][_0xa36f('0x124')](db[_0xa36f('0x157')],{'as':'List','foreignKey':_0xa36f('0x16d')});db[_0xa36f('0x56')][_0xa36f('0x124')](db[_0xa36f('0x76')],{'as':_0xa36f('0x179'),'foreignKey':_0xa36f('0x163')});db[_0xa36f('0x56')][_0xa36f('0x124')](db[_0xa36f('0x51')],{});db[_0xa36f('0x56')][_0xa36f('0x124')](db['FaxMessage'],{});db[_0xa36f('0x56')][_0xa36f('0x124')](db[_0xa36f('0x10')],{});db[_0xa36f('0x56')][_0xa36f('0x124')](db[_0xa36f('0x55')],{});db['SmsAccount'][_0xa36f('0x117')](db[_0xa36f('0x169')],{'as':'Dispositions','foreignKey':_0xa36f('0x183'),'onDelete':_0xa36f('0x114')});db[_0xa36f('0x58')][_0xa36f('0x117')](db[_0xa36f('0x85')],{'as':_0xa36f('0x17b'),'foreignKey':_0xa36f('0x183')});db['SmsAccount'][_0xa36f('0x117')](db['SmsMessage'],{'as':'Messages','foreignKey':_0xa36f('0x183')});db[_0xa36f('0x58')][_0xa36f('0x117')](db[_0xa36f('0x5b')],{'as':_0xa36f('0x184')});db[_0xa36f('0x58')][_0xa36f('0x117')](db[_0xa36f('0x59')],{'as':_0xa36f('0x14b')});db[_0xa36f('0x58')]['belongsTo'](db[_0xa36f('0x157')],{'as':_0xa36f('0x16c'),'foreignKey':_0xa36f('0x16d')});db[_0xa36f('0x58')][_0xa36f('0x124')](db[_0xa36f('0x8c')],{'as':_0xa36f('0x155'),'foreignKey':_0xa36f('0x156')});db[_0xa36f('0x58')]['belongsToMany'](db[_0xa36f('0x10')],{'as':_0xa36f('0x159'),'through':_0xa36f('0x146')});db[_0xa36f('0x59')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'onDelete':_0xa36f('0x166')});db[_0xa36f('0x59')][_0xa36f('0x124')](db[_0xa36f('0x138')],{'onDelete':_0xa36f('0x166')});db[_0xa36f('0x59')]['belongsTo'](db[_0xa36f('0x58')],{'onDelete':_0xa36f('0x166')});db[_0xa36f('0x59')][_0xa36f('0x124')](db[_0xa36f('0x8a')],{'onDelete':_0xa36f('0x166'),'foreignKey':'IntervalId'});db['SmsApplication'][_0xa36f('0x124')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xa36f('0x17d')});db[_0xa36f('0x5b')][_0xa36f('0x117')](db[_0xa36f('0x5d')],{'as':_0xa36f('0x15c'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x185')});db['SmsInteraction'][_0xa36f('0x124')](db['SmsAccount'],{'as':_0xa36f('0x171'),'foreignKey':_0xa36f('0x183')});db[_0xa36f('0x5b')]['belongsTo'](db['CmContact'],{'as':_0xa36f('0x179'),'foreignKey':_0xa36f('0x163')});db['SmsInteraction'][_0xa36f('0x124')](db[_0xa36f('0x10')],{'as':_0xa36f('0x172'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x5b')][_0xa36f('0x126')](db[_0xa36f('0x94')],{'through':_0xa36f('0x186'),'as':_0xa36f('0x174')});db[_0xa36f('0x5b')][_0xa36f('0x126')](db[_0xa36f('0x94')],{'through':_0xa36f('0x186'),'as':'ThroughTags'});db['SmsInteraction'][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0xa36f('0x5d')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'as':'User'});db[_0xa36f('0x5d')]['belongsTo'](db[_0xa36f('0x76')],{'onDelete':'cascade','as':'Contact'});db[_0xa36f('0x5d')][_0xa36f('0x124')](db[_0xa36f('0x5b')],{'onDelete':_0xa36f('0x114'),'as':_0xa36f('0x181'),'foreignKey':_0xa36f('0x185')});db[_0xa36f('0x5d')]['belongsTo'](db[_0xa36f('0x58')],{'as':'Account','foreignKey':_0xa36f('0x183')});db[_0xa36f('0x138')][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':_0xa36f('0x159'),'through':_0xa36f('0x38'),'foreignKey':_0xa36f('0x187')});db[_0xa36f('0x138')][_0xa36f('0x126')](db[_0xa36f('0x12b')],{'through':_0xa36f('0x188'),'as':_0xa36f('0x15a')});db[_0xa36f('0x60')][_0xa36f('0x117')](db['Disposition'],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0xa36f('0x60')][_0xa36f('0x117')](db[_0xa36f('0x85')],{'as':'Answers','foreignKey':_0xa36f('0x189')});db[_0xa36f('0x60')][_0xa36f('0x117')](db[_0xa36f('0x11d')],{'as':_0xa36f('0x184'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xa36f('0x117')](db['OpenchannelMessage'],{'as':_0xa36f('0x15c'),'foreignKey':_0xa36f('0x189')});db[_0xa36f('0x60')][_0xa36f('0x117')](db[_0xa36f('0x62')],{'as':_0xa36f('0x14b'),'foreignKey':'OpenchannelAccountId'});db[_0xa36f('0x60')][_0xa36f('0x124')](db[_0xa36f('0x157')],{'as':_0xa36f('0x16c'),'foreignKey':_0xa36f('0x16d')});db[_0xa36f('0x60')][_0xa36f('0x124')](db[_0xa36f('0x8c')],{'as':_0xa36f('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount'][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':_0xa36f('0x159'),'through':_0xa36f('0x18a')});db['OpenchannelApplication']['belongsTo'](db[_0xa36f('0x10')],{'onDelete':_0xa36f('0x166')});db[_0xa36f('0x62')][_0xa36f('0x124')](db[_0xa36f('0x139')],{'onDelete':_0xa36f('0x166'),'foreignKey':_0xa36f('0x18b')});db['OpenchannelApplication']['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0xa36f('0x166'),'foreignKey':'OpenchannelAccountId'});db[_0xa36f('0x62')]['belongsTo'](db[_0xa36f('0x8a')],{'onDelete':_0xa36f('0x166'),'foreignKey':'IntervalId'});db[_0xa36f('0x62')][_0xa36f('0x124')](db[_0xa36f('0x94')],{'onDelete':_0xa36f('0x166'),'foreignKey':'TagId'});db[_0xa36f('0x11d')][_0xa36f('0x117')](db[_0xa36f('0x65')],{'as':_0xa36f('0x15c'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x18c')});db['OpenchannelInteraction'][_0xa36f('0x124')](db['OpenchannelAccount'],{'as':_0xa36f('0x171'),'foreignKey':_0xa36f('0x189')});db[_0xa36f('0x11d')][_0xa36f('0x124')](db['CmContact'],{'as':_0xa36f('0x179'),'foreignKey':_0xa36f('0x163')});db[_0xa36f('0x11d')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'as':_0xa36f('0x172'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x11d')][_0xa36f('0x126')](db[_0xa36f('0x94')],{'through':_0xa36f('0x18d'),'as':_0xa36f('0x174')});db[_0xa36f('0x11d')][_0xa36f('0x126')](db[_0xa36f('0x94')],{'through':_0xa36f('0x18d'),'as':_0xa36f('0x175')});db[_0xa36f('0x11d')][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':_0xa36f('0x176'),'through':_0xa36f('0x132'),'foreignKey':_0xa36f('0x18c')});db['OpenchannelMessage'][_0xa36f('0x124')](db['User'],{'onDelete':'cascade','as':_0xa36f('0x10')});db[_0xa36f('0x65')][_0xa36f('0x124')](db[_0xa36f('0x76')],{'onDelete':'cascade','as':_0xa36f('0x179')});db['OpenchannelMessage']['belongsTo'](db[_0xa36f('0x11d')],{'onDelete':_0xa36f('0x114'),'as':_0xa36f('0x181'),'foreignKey':'OpenchannelInteractionId'});db[_0xa36f('0x65')][_0xa36f('0x124')](db[_0xa36f('0x177')],{'as':'Attachment','foreignKey':_0xa36f('0x18e')});db['OpenchannelMessage'][_0xa36f('0x124')](db[_0xa36f('0x60')],{'as':_0xa36f('0x171'),'foreignKey':_0xa36f('0x189')});db[_0xa36f('0x139')][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':_0xa36f('0x159'),'through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db[_0xa36f('0x139')][_0xa36f('0x126')](db[_0xa36f('0x12b')],{'through':_0xa36f('0x18f'),'as':_0xa36f('0x15a')});db[_0xa36f('0x68')][_0xa36f('0x117')](db['Disposition'],{'as':_0xa36f('0x16a'),'foreignKey':'ChatWebsiteId','onDelete':_0xa36f('0x114')});db[_0xa36f('0x68')]['hasMany'](db[_0xa36f('0x85')],{'as':_0xa36f('0x17b'),'foreignKey':_0xa36f('0x17a')});db[_0xa36f('0x68')][_0xa36f('0x117')](db['ChatProactiveAction'],{'as':_0xa36f('0x190')});db[_0xa36f('0x68')][_0xa36f('0x117')](db['ChatInteraction'],{'as':_0xa36f('0x184')});db['ChatWebsite'][_0xa36f('0x117')](db['ChatApplication'],{'as':_0xa36f('0x14b')});db['ChatWebsite'][_0xa36f('0x117')](db['ChatMessage'],{'as':_0xa36f('0x15c')});db[_0xa36f('0x68')][_0xa36f('0x124')](db[_0xa36f('0x157')],{'as':_0xa36f('0x16c'),'foreignKey':_0xa36f('0x16d')});db[_0xa36f('0x68')][_0xa36f('0x124')](db[_0xa36f('0x8a')],{'as':_0xa36f('0x8a'),'foreignKey':'IntervalId'});db[_0xa36f('0x68')][_0xa36f('0x124')](db[_0xa36f('0x143')],{'as':_0xa36f('0x143'),'foreignKey':_0xa36f('0x164')});db['ChatWebsite']['belongsTo'](db[_0xa36f('0x8c')],{'as':_0xa36f('0x155'),'foreignKey':_0xa36f('0x156')});db['ChatWebsite'][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':_0xa36f('0x159'),'through':_0xa36f('0x140')});db[_0xa36f('0x191')][_0xa36f('0x124')](db[_0xa36f('0x60')],{});db[_0xa36f('0x191')][_0xa36f('0x124')](db[_0xa36f('0x157')],{'as':_0xa36f('0x16c'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0xa36f('0x124')](db[_0xa36f('0x76')],{'as':_0xa36f('0x179'),'foreignKey':_0xa36f('0x163')});db[_0xa36f('0x191')][_0xa36f('0x124')](db[_0xa36f('0x11d')],{});db[_0xa36f('0x191')][_0xa36f('0x124')](db['OpenchannelMessage'],{});db[_0xa36f('0x191')][_0xa36f('0x124')](db[_0xa36f('0x10')],{});db[_0xa36f('0x191')][_0xa36f('0x124')](db[_0xa36f('0x139')],{});db[_0xa36f('0x192')]['belongsTo'](db[_0xa36f('0x10')],{'as':'Agent','foreignKey':_0xa36f('0x115'),'onDelete':'restrict'});db['ChatApplication'][_0xa36f('0x124')](db[_0xa36f('0x70')],{'as':_0xa36f('0x193'),'foreignKey':_0xa36f('0x194'),'onDelete':_0xa36f('0x166')});db[_0xa36f('0x192')]['belongsTo'](db[_0xa36f('0x68')],{'as':_0xa36f('0x195'),'foreignKey':_0xa36f('0x17a'),'onDelete':_0xa36f('0x166')});db['ChatApplication'][_0xa36f('0x124')](db['Tag'],{'onDelete':_0xa36f('0x166'),'foreignKey':'TagId'});db['ChatInteraction'][_0xa36f('0x117')](db[_0xa36f('0x6c')],{'as':_0xa36f('0x15c'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x196')});db[_0xa36f('0x6b')]['belongsTo'](db['ChatWebsite'],{'as':_0xa36f('0x171'),'foreignKey':'ChatWebsiteId'});db[_0xa36f('0x6b')][_0xa36f('0x124')](db[_0xa36f('0x76')],{'as':'Contact','foreignKey':_0xa36f('0x163')});db['ChatInteraction'][_0xa36f('0x124')](db[_0xa36f('0x10')],{'as':_0xa36f('0x172'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x6b')][_0xa36f('0x126')](db[_0xa36f('0x94')],{'through':_0xa36f('0x197'),'as':_0xa36f('0x174')});db['ChatInteraction'][_0xa36f('0x126')](db['Tag'],{'through':_0xa36f('0x197'),'as':_0xa36f('0x175')});db[_0xa36f('0x6b')][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':_0xa36f('0x176'),'through':'user_has_chat_interactions','foreignKey':_0xa36f('0x196')});db[_0xa36f('0x6c')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'onDelete':'cascade','as':_0xa36f('0x10')});db['ChatMessage'][_0xa36f('0x124')](db[_0xa36f('0x76')],{'onDelete':_0xa36f('0x114'),'as':_0xa36f('0x179'),'foreignKey':_0xa36f('0x163')});db[_0xa36f('0x6c')][_0xa36f('0x124')](db[_0xa36f('0x6b')],{'onDelete':_0xa36f('0x114'),'as':_0xa36f('0x181'),'foreignKey':_0xa36f('0x196')});db[_0xa36f('0x6c')]['belongsTo'](db[_0xa36f('0x177')],{'as':_0xa36f('0x177'),'foreignKey':_0xa36f('0x18e')});db['ChatMessage']['belongsTo'](db[_0xa36f('0x68')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xa36f('0x6e')][_0xa36f('0x117')](db['Attachment'],{'as':_0xa36f('0x178'),'foreignKey':_0xa36f('0x198'),'onDelete':'cascade','hooks':!![]});db[_0xa36f('0x6e')][_0xa36f('0x124')](db[_0xa36f('0x76')],{'onDelete':_0xa36f('0x114'),'as':_0xa36f('0x179'),'foreignKey':_0xa36f('0x163')});db[_0xa36f('0x6e')][_0xa36f('0x124')](db['ChatWebsite'],{'as':_0xa36f('0x171'),'foreignKey':'ChatWebsiteId'});db[_0xa36f('0x70')][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':_0xa36f('0x159'),'through':_0xa36f('0x33'),'hooks':!![]});db[_0xa36f('0x70')][_0xa36f('0x126')](db['Team'],{'through':_0xa36f('0x199'),'as':_0xa36f('0x15a')});db[_0xa36f('0x72')][_0xa36f('0x117')](db['ChatInternalMessage'],{'as':_0xa36f('0x15c'),'foreignKey':_0xa36f('0x19a'),'onDelete':'cascade'});db[_0xa36f('0x72')][_0xa36f('0x126')](db['User'],{'as':_0xa36f('0x14d'),'through':_0xa36f('0x128')});db[_0xa36f('0x19b')]['belongsTo'](db[_0xa36f('0x68')],{'as':_0xa36f('0x195'),'foreignKey':_0xa36f('0x17a')});db[_0xa36f('0x74')][_0xa36f('0x117')](db[_0xa36f('0x76')],{'as':_0xa36f('0x129'),'foreignKey':_0xa36f('0x19c')});db['CmContact'][_0xa36f('0x117')](db[_0xa36f('0x78')],{'as':_0xa36f('0x14f'),'foreignKey':'ContactId'});db[_0xa36f('0x76')][_0xa36f('0x117')](db[_0xa36f('0x7b')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xa36f('0x76')][_0xa36f('0x117')](db[_0xa36f('0x7d')],{'as':'HopperHistories','foreignKey':_0xa36f('0x163')});db[_0xa36f('0x76')][_0xa36f('0x117')](db[_0xa36f('0x7f')],{'as':_0xa36f('0x7f'),'foreignKey':_0xa36f('0x163')});db['CmContact'][_0xa36f('0x117')](db[_0xa36f('0xd9')],{'as':_0xa36f('0x151'),'foreignKey':_0xa36f('0x163')});db[_0xa36f('0x76')][_0xa36f('0x117')](db[_0xa36f('0x11d')],{'as':'OpenchannelInteractions','foreignKey':_0xa36f('0x163'),'onDelete':'restrict'});db[_0xa36f('0x76')][_0xa36f('0x117')](db['ChatInteraction'],{'as':_0xa36f('0x19d'),'foreignKey':_0xa36f('0x163'),'onDelete':'restrict'});db[_0xa36f('0x76')][_0xa36f('0x117')](db[_0xa36f('0x5b')],{'as':_0xa36f('0x11f'),'foreignKey':_0xa36f('0x163'),'onDelete':_0xa36f('0x166')});db[_0xa36f('0x76')][_0xa36f('0x117')](db[_0xa36f('0x51')],{'as':_0xa36f('0x120'),'foreignKey':_0xa36f('0x163'),'onDelete':_0xa36f('0x166')});db[_0xa36f('0x76')]['hasMany'](db[_0xa36f('0x42')],{'as':_0xa36f('0x12d'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xa36f('0x76')][_0xa36f('0x124')](db[_0xa36f('0x74')],{'as':'Company','foreignKey':_0xa36f('0x19c')});db[_0xa36f('0x76')][_0xa36f('0x124')](db[_0xa36f('0x157')],{'as':'List','foreignKey':_0xa36f('0x16d'),'onDelete':_0xa36f('0x114')});db['CmContact'][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':_0xa36f('0x176'),'through':'cm_user_has_contacts'});db['CmContact']['belongsToMany'](db[_0xa36f('0x94')],{'as':_0xa36f('0x174'),'through':_0xa36f('0x19e')});db[_0xa36f('0x76')]['belongsToMany'](db[_0xa36f('0x94')],{'through':'cm_contact_has_tags','as':_0xa36f('0x175')});db[_0xa36f('0x78')]['belongsTo'](db[_0xa36f('0x76')],{'as':_0xa36f('0x179'),'foreignKey':_0xa36f('0x163'),'onDelete':_0xa36f('0x114')});db[_0xa36f('0x78')][_0xa36f('0x124')](db[_0xa36f('0x157')],{'as':_0xa36f('0x16c'),'foreignKey':_0xa36f('0x16d'),'onDelete':_0xa36f('0x114')});db['CmHopper'][_0xa36f('0x124')](db['User'],{'as':_0xa36f('0x19f'),'foreignKey':_0xa36f('0x115')});db[_0xa36f('0x78')][_0xa36f('0x124')](db['VoiceQueue'],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0xa36f('0x114')});db[_0xa36f('0x78')][_0xa36f('0x124')](db[_0xa36f('0xe7')],{'as':_0xa36f('0xe7'),'foreignKey':'CampaignId','onDelete':_0xa36f('0x114')});db[_0xa36f('0x78')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xa36f('0x1a0')});db[_0xa36f('0x7a')][_0xa36f('0x124')](db[_0xa36f('0x76')],{'as':_0xa36f('0x179'),'foreignKey':'ContactId','onDelete':_0xa36f('0x114')});db[_0xa36f('0x7a')][_0xa36f('0x124')](db[_0xa36f('0x157')],{'as':_0xa36f('0x16c'),'foreignKey':_0xa36f('0x16d'),'onDelete':_0xa36f('0x114')});db['CmHopperBlack'][_0xa36f('0x124')](db[_0xa36f('0x1a')],{'as':_0xa36f('0x193'),'foreignKey':_0xa36f('0x14e'),'onDelete':'cascade'});db['CmHopperBlack'][_0xa36f('0x124')](db[_0xa36f('0xe7')],{'as':_0xa36f('0xe7'),'foreignKey':_0xa36f('0x1a1'),'onDelete':_0xa36f('0x114')});db['Automation'][_0xa36f('0x117')](db[_0xa36f('0x88')],{'as':{'plural':_0xa36f('0x1a2'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0xa36f('0x84')][_0xa36f('0x117')](db['Condition'],{'as':{'plural':_0xa36f('0x1a3'),'singular':'OneAny'},'foreignKey':_0xa36f('0x1a4'),'onDelete':_0xa36f('0x114'),'hooks':!![]});db[_0xa36f('0x84')][_0xa36f('0x117')](db[_0xa36f('0x82')],{'as':'Actions','foreignKey':_0xa36f('0x1a5'),'onDelete':_0xa36f('0x114'),'hooks':!![]});db['Disposition']['hasMany'](db['Disposition'],{'as':_0xa36f('0x16a'),'foreignKey':_0xa36f('0x1a6'),'onDelete':'cascade'});db[_0xa36f('0x8a')][_0xa36f('0x117')](db[_0xa36f('0x8a')],{'as':_0xa36f('0x1a7'),'foreignKey':_0xa36f('0x154'),'onDelete':'cascade','hooks':!![],'required':![]});db['Interval'][_0xa36f('0x117')](db[_0xa36f('0x16')],{'as':'Extensions','foreignKey':_0xa36f('0x154'),'onDelete':_0xa36f('0x166')});db[_0xa36f('0x8a')][_0xa36f('0x117')](db[_0xa36f('0x16b')],{'as':_0xa36f('0x1a8'),'foreignKey':'IntervalId'});db[_0xa36f('0x8a')][_0xa36f('0x117')](db[_0xa36f('0x192')],{'as':_0xa36f('0x1a9'),'foreignKey':_0xa36f('0x154')});db[_0xa36f('0x8a')]['hasMany'](db[_0xa36f('0x4f')],{'as':'FaxApplications','foreignKey':'IntervalId'});db[_0xa36f('0x8a')]['hasMany'](db[_0xa36f('0x59')],{'as':_0xa36f('0x1aa'),'foreignKey':'IntervalId'});db[_0xa36f('0x91')][_0xa36f('0x124')](db[_0xa36f('0x143')],{});db[_0xa36f('0x91')][_0xa36f('0x124')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xa36f('0x124')](db[_0xa36f('0x9f')],{'foreignKey':_0xa36f('0x1ab')});db[_0xa36f('0x1ac')]['belongsToMany'](db[_0xa36f('0x18')],{'as':'Mohs','through':_0xa36f('0x1ad'),'onDelete':_0xa36f('0x166')});db[_0xa36f('0x94')][_0xa36f('0x126')](db[_0xa36f('0x76')],{'through':_0xa36f('0x19e')});db[_0xa36f('0x94')][_0xa36f('0x126')](db[_0xa36f('0x6b')],{'through':_0xa36f('0x197')});db[_0xa36f('0x94')][_0xa36f('0x126')](db[_0xa36f('0x42')],{'through':_0xa36f('0x173')});db[_0xa36f('0x94')][_0xa36f('0x126')](db[_0xa36f('0x5b')],{'through':_0xa36f('0x186')});db[_0xa36f('0x94')][_0xa36f('0x126')](db[_0xa36f('0x51')],{'through':_0xa36f('0x180')});db[_0xa36f('0x94')][_0xa36f('0x126')](db[_0xa36f('0x11d')],{'through':_0xa36f('0x18d')});db['Tag'][_0xa36f('0x126')](db[_0xa36f('0x101')],{'through':'whatsapp_interaction_has_tags'});db[_0xa36f('0x98')][_0xa36f('0x117')](db[_0xa36f('0x88')],{'as':{'plural':_0xa36f('0x1ae'),'singular':_0xa36f('0x1af')},'foreignKey':_0xa36f('0x1b0'),'onDelete':_0xa36f('0x114'),'hooks':!![]});db[_0xa36f('0x98')][_0xa36f('0x117')](db[_0xa36f('0x88')],{'as':{'plural':_0xa36f('0x1b1'),'singular':'AnyCondition'},'foreignKey':_0xa36f('0x1b2'),'onDelete':_0xa36f('0x114'),'hooks':!![]});db['Trigger'][_0xa36f('0x117')](db[_0xa36f('0x82')],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xa36f('0x114'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1ab'),'hooks':!![]});db[_0xa36f('0xa1')][_0xa36f('0x117')](db['AnalyticFieldReport'],{'as':_0xa36f('0x1b3'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1b4')});db[_0xa36f('0xa5')][_0xa36f('0x117')](db['AnalyticFieldReport'],{'as':_0xa36f('0x1b3'),'onDelete':_0xa36f('0x114'),'foreignKey':'MetricId'});db['AnalyticFieldReport']['belongsTo'](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0xa36f('0xab')]['hasMany'](db['SalesforceConfiguration'],{'as':_0xa36f('0x1b5'),'onDelete':_0xa36f('0x114'),'foreignKey':'AccountId'});db[_0xa36f('0xac')][_0xa36f('0x117')](db[_0xa36f('0xae')],{'as':_0xa36f('0x1b6'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0xac')][_0xa36f('0x117')](db[_0xa36f('0xae')],{'as':'Descriptions','onDelete':_0xa36f('0x114'),'foreignKey':'DescriptionId'});db[_0xa36f('0xac')]['hasMany'](db[_0xa36f('0xae')],{'as':_0xa36f('0x1b3'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0xac')]['belongsTo'](db[_0xa36f('0xab')],{'as':_0xa36f('0x171'),'foreignKey':_0xa36f('0x1b9')});db[_0xa36f('0xae')][_0xa36f('0x117')](db[_0xa36f('0xae')],{'as':_0xa36f('0x1ba'),'foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0xae')][_0xa36f('0x117')](db[_0xa36f('0xae')],{'as':_0xa36f('0x1bb'),'foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0xae')]['hasMany'](db[_0xa36f('0xae')],{'as':'Field','foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0xae')][_0xa36f('0x124')](db[_0xa36f('0x9a')],{'as':_0xa36f('0x9a'),'foreignKey':_0xa36f('0x1bd')});db[_0xa36f('0x1be')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0xa36f('0x1b5'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1b9')});db[_0xa36f('0xb0')][_0xa36f('0x117')](db[_0xa36f('0x1bf')],{'as':'Subjects','onDelete':_0xa36f('0x114'),'foreignKey':'SubjectId'});db[_0xa36f('0xb0')][_0xa36f('0x117')](db[_0xa36f('0x1bf')],{'as':_0xa36f('0x1c0'),'onDelete':_0xa36f('0x114'),'foreignKey':'DescriptionId'});db[_0xa36f('0xb0')]['hasMany'](db['SugarcrmField'],{'as':_0xa36f('0x1b3'),'onDelete':'cascade','foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0xb0')][_0xa36f('0x124')](db[_0xa36f('0x1be')],{'as':'Account','foreignKey':_0xa36f('0x1b9')});db[_0xa36f('0x1bf')][_0xa36f('0x117')](db[_0xa36f('0x1bf')],{'as':_0xa36f('0x1ba'),'foreignKey':'SubjectId'});db[_0xa36f('0x1bf')][_0xa36f('0x117')](db['SugarcrmField'],{'as':_0xa36f('0x1bb'),'foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0x1bf')][_0xa36f('0x117')](db[_0xa36f('0x1bf')],{'as':_0xa36f('0x1c1'),'foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0x1bf')][_0xa36f('0x124')](db[_0xa36f('0x9a')],{'as':_0xa36f('0x9a'),'foreignKey':_0xa36f('0x1bd')});db[_0xa36f('0x1c2')]['hasMany'](db['DeskConfiguration'],{'as':_0xa36f('0x1b5'),'onDelete':'cascade','foreignKey':_0xa36f('0x1b9')});db[_0xa36f('0xb3')][_0xa36f('0x117')](db[_0xa36f('0x1c3')],{'as':_0xa36f('0x1b6'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1b7')});db['DeskConfiguration']['hasMany'](db[_0xa36f('0x1c3')],{'as':_0xa36f('0x1c0'),'onDelete':'cascade','foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0xb3')][_0xa36f('0x117')](db[_0xa36f('0x1c3')],{'as':_0xa36f('0x1b3'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1b8')});db['DeskConfiguration'][_0xa36f('0x124')](db[_0xa36f('0x1c2')],{'as':_0xa36f('0x171'),'foreignKey':'AccountId'});db[_0xa36f('0xb3')][_0xa36f('0x126')](db[_0xa36f('0x94')],{'through':_0xa36f('0x1c4')});db[_0xa36f('0x1c3')]['hasMany'](db[_0xa36f('0x1c3')],{'as':_0xa36f('0x1ba'),'foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0x1c3')][_0xa36f('0x117')](db['DeskField'],{'as':'Description','foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0x1c3')][_0xa36f('0x117')](db[_0xa36f('0x1c3')],{'as':_0xa36f('0x1c1'),'foreignKey':'FieldId'});db[_0xa36f('0x1c3')][_0xa36f('0x124')](db[_0xa36f('0x9a')],{'as':'Variable','foreignKey':_0xa36f('0x1bd')});db[_0xa36f('0xb4')]['hasMany'](db['ZohoConfiguration'],{'as':_0xa36f('0x1b5'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1b9')});db[_0xa36f('0xb6')][_0xa36f('0x117')](db[_0xa36f('0xb8')],{'as':_0xa36f('0x1b6'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0xb6')][_0xa36f('0x117')](db['ZohoField'],{'as':_0xa36f('0x1c0'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0xb6')]['hasMany'](db[_0xa36f('0xb8')],{'as':_0xa36f('0x1b3'),'onDelete':_0xa36f('0x114'),'foreignKey':'FieldId'});db[_0xa36f('0xb6')]['belongsTo'](db[_0xa36f('0xb4')],{'as':'Account','foreignKey':_0xa36f('0x1b9')});db['ZohoField']['hasMany'](db[_0xa36f('0xb8')],{'as':_0xa36f('0x1ba'),'foreignKey':'SubjectId'});db[_0xa36f('0xb8')][_0xa36f('0x117')](db[_0xa36f('0xb8')],{'as':_0xa36f('0x1bb'),'foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0xb8')][_0xa36f('0x117')](db[_0xa36f('0xb8')],{'as':_0xa36f('0x1c1'),'foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0xb8')][_0xa36f('0x124')](db[_0xa36f('0x9a')],{'as':_0xa36f('0x9a'),'foreignKey':_0xa36f('0x1bd')});db[_0xa36f('0xba')][_0xa36f('0x117')](db[_0xa36f('0x1c5')],{'as':_0xa36f('0x1b5'),'onDelete':'cascade','foreignKey':_0xa36f('0x1b9')});db[_0xa36f('0x1c5')]['hasMany'](db[_0xa36f('0x1c6')],{'as':'Subjects','foreignKey':_0xa36f('0x1b7')});db['ZendeskConfiguration']['hasMany'](db[_0xa36f('0x1c6')],{'as':_0xa36f('0x1c0'),'foreignKey':_0xa36f('0x1bc')});db['ZendeskConfiguration'][_0xa36f('0x117')](db[_0xa36f('0x1c6')],{'as':_0xa36f('0x1b3'),'foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0x1c5')][_0xa36f('0x124')](db[_0xa36f('0xba')],{'as':'Account','foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xa36f('0x126')](db[_0xa36f('0x94')],{'through':_0xa36f('0x1c7')});db['ZendeskField'][_0xa36f('0x117')](db[_0xa36f('0x1c6')],{'as':_0xa36f('0x1ba'),'foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0x1c6')][_0xa36f('0x117')](db[_0xa36f('0x1c6')],{'as':_0xa36f('0x1bb'),'foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0x1c6')][_0xa36f('0x117')](db[_0xa36f('0x1c6')],{'as':_0xa36f('0x1c1'),'foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0x1c6')][_0xa36f('0x124')](db['Variable'],{'as':_0xa36f('0x9a'),'foreignKey':'VariableId'});db[_0xa36f('0xbd')]['hasMany'](db[_0xa36f('0xbf')],{'as':_0xa36f('0x1b5'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1b9')});db[_0xa36f('0xbf')][_0xa36f('0x117')](db[_0xa36f('0x1c8')],{'as':_0xa36f('0x1b6'),'onDelete':'cascade','foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0xbf')][_0xa36f('0x117')](db[_0xa36f('0x1c8')],{'as':_0xa36f('0x1c0'),'onDelete':_0xa36f('0x114'),'foreignKey':'DescriptionId'});db[_0xa36f('0xbf')][_0xa36f('0x117')](db['FreshdeskField'],{'as':_0xa36f('0x1b3'),'onDelete':_0xa36f('0x114'),'foreignKey':'FieldId'});db[_0xa36f('0xbf')][_0xa36f('0x124')](db[_0xa36f('0xbd')],{'as':_0xa36f('0x171'),'foreignKey':'AccountId'});db['FreshdeskConfiguration']['belongsToMany'](db[_0xa36f('0x94')],{'through':_0xa36f('0x1c9')});db[_0xa36f('0x1c8')]['hasMany'](db['FreshdeskField'],{'as':_0xa36f('0x1ba'),'foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0x1c8')][_0xa36f('0x117')](db[_0xa36f('0x1c8')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xa36f('0x1c8')][_0xa36f('0x117')](db['FreshdeskField'],{'as':_0xa36f('0x1c1'),'foreignKey':_0xa36f('0x1b8')});db['FreshdeskField'][_0xa36f('0x124')](db['Variable'],{'as':_0xa36f('0x9a'),'foreignKey':_0xa36f('0x1bd')});db[_0xa36f('0x1ca')][_0xa36f('0x117')](db['VtigerConfiguration'],{'as':_0xa36f('0x1b5'),'onDelete':_0xa36f('0x114'),'foreignKey':'AccountId'});db['VtigerConfiguration']['hasMany'](db['VtigerField'],{'as':_0xa36f('0x1b6'),'foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0xc2')]['hasMany'](db['VtigerField'],{'as':'Descriptions','foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0xc2')]['hasMany'](db[_0xa36f('0x1cb')],{'as':_0xa36f('0x1b3'),'foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0xc2')]['belongsTo'](db[_0xa36f('0x1ca')],{'as':_0xa36f('0x171'),'foreignKey':_0xa36f('0x1b9')});db[_0xa36f('0x1cb')][_0xa36f('0x117')](db[_0xa36f('0x1cb')],{'as':'Subject','foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0x1cb')]['hasMany'](db[_0xa36f('0x1cb')],{'as':_0xa36f('0x1bb'),'foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0x1cb')][_0xa36f('0x117')](db[_0xa36f('0x1cb')],{'as':'Field','foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0x1cb')][_0xa36f('0x124')](db[_0xa36f('0x9a')],{'as':_0xa36f('0x9a'),'foreignKey':_0xa36f('0x1bd')});db[_0xa36f('0x1cc')][_0xa36f('0x117')](db[_0xa36f('0xc4')],{'as':'Configurations','onDelete':_0xa36f('0x114'),'foreignKey':'AccountId'});db[_0xa36f('0xc4')][_0xa36f('0x117')](db['ServicenowField'],{'as':_0xa36f('0x1b6'),'foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0xc4')]['hasMany'](db[_0xa36f('0xc5')],{'as':'Descriptions','foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0xc4')][_0xa36f('0x117')](db['ServicenowField'],{'as':_0xa36f('0x1b3'),'foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0xc4')]['belongsTo'](db[_0xa36f('0x1cc')],{'as':_0xa36f('0x171'),'foreignKey':'AccountId'});db['ServicenowField'][_0xa36f('0x117')](db[_0xa36f('0xc5')],{'as':_0xa36f('0x1ba'),'foreignKey':_0xa36f('0x1b7')});db['ServicenowField']['hasMany'](db[_0xa36f('0xc5')],{'as':_0xa36f('0x1bb'),'foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0xc5')][_0xa36f('0x117')](db[_0xa36f('0xc5')],{'as':'Field','foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0xc5')][_0xa36f('0x124')](db[_0xa36f('0x9a')],{'as':_0xa36f('0x9a'),'foreignKey':_0xa36f('0x1bd')});db[_0xa36f('0xc7')][_0xa36f('0x117')](db['Dynamics365Configuration'],{'as':_0xa36f('0x1b5'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1b9')});db[_0xa36f('0xc7')][_0xa36f('0x124')](db[_0xa36f('0x10b')],{'as':_0xa36f('0x10b'),'foreignKey':_0xa36f('0x165')});db['Dynamics365Configuration'][_0xa36f('0x117')](db[_0xa36f('0xc9')],{'as':_0xa36f('0x1b6'),'onDelete':_0xa36f('0x114'),'foreignKey':'SubjectId'});db[_0xa36f('0x1cd')][_0xa36f('0x117')](db[_0xa36f('0xc9')],{'as':_0xa36f('0x1c0'),'onDelete':'cascade','foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0x1cd')][_0xa36f('0x117')](db[_0xa36f('0xc9')],{'as':_0xa36f('0x1b3'),'onDelete':_0xa36f('0x114'),'foreignKey':'FieldId'});db[_0xa36f('0x1cd')][_0xa36f('0x124')](db['Dynamics365Account'],{'as':_0xa36f('0x171'),'foreignKey':_0xa36f('0x1b9')});db['Dynamics365Field'][_0xa36f('0x117')](db[_0xa36f('0xc9')],{'as':_0xa36f('0x1ba'),'foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0xc9')][_0xa36f('0x117')](db[_0xa36f('0xc9')],{'as':_0xa36f('0x1bb'),'foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0xc9')][_0xa36f('0x117')](db[_0xa36f('0xc9')],{'as':_0xa36f('0x1c1'),'foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0xc9')][_0xa36f('0x124')](db[_0xa36f('0x9a')],{'as':_0xa36f('0x9a'),'foreignKey':_0xa36f('0x1bd')});db[_0xa36f('0xcb')][_0xa36f('0x117')](db[_0xa36f('0xcd')],{'as':'Configurations','onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1b9')});db['FreshsalesConfiguration']['hasMany'](db[_0xa36f('0xce')],{'as':_0xa36f('0x1b6'),'foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0xcd')][_0xa36f('0x117')](db[_0xa36f('0xce')],{'as':_0xa36f('0x1c0'),'foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0xcd')][_0xa36f('0x117')](db[_0xa36f('0xce')],{'as':_0xa36f('0x1b3'),'foreignKey':_0xa36f('0x1b8')});db[_0xa36f('0xcd')][_0xa36f('0x124')](db['FreshsalesAccount'],{'as':_0xa36f('0x171'),'foreignKey':_0xa36f('0x1b9')});db[_0xa36f('0xce')][_0xa36f('0x117')](db[_0xa36f('0xce')],{'as':'Subject','foreignKey':_0xa36f('0x1b7')});db[_0xa36f('0xce')][_0xa36f('0x117')](db['FreshsalesField'],{'as':_0xa36f('0x1bb'),'foreignKey':_0xa36f('0x1bc')});db[_0xa36f('0xce')][_0xa36f('0x117')](db[_0xa36f('0xce')],{'as':_0xa36f('0x1c1'),'foreignKey':_0xa36f('0x1b8')});db['FreshsalesField']['belongsTo'](db[_0xa36f('0x9a')],{'as':_0xa36f('0x9a'),'foreignKey':_0xa36f('0x1bd')});db[_0xa36f('0xd1')][_0xa36f('0x124')](db[_0xa36f('0x68')],{});db[_0xa36f('0xd1')][_0xa36f('0x124')](db[_0xa36f('0x157')],{'as':_0xa36f('0x16c'),'foreignKey':_0xa36f('0x16d')});db[_0xa36f('0xd1')][_0xa36f('0x124')](db[_0xa36f('0x76')],{'as':'Contact','foreignKey':_0xa36f('0x163')});db[_0xa36f('0xd1')]['belongsTo'](db[_0xa36f('0x6b')],{});db[_0xa36f('0xd1')][_0xa36f('0x124')](db[_0xa36f('0x6c')],{});db[_0xa36f('0xd1')]['belongsTo'](db[_0xa36f('0x10')],{});db[_0xa36f('0xd1')][_0xa36f('0x124')](db[_0xa36f('0x70')],{});db['ChatInternalMessage'][_0xa36f('0x124')](db['User'],{'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1ce')});db[_0xa36f('0xd3')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1cf')});db[_0xa36f('0xd9')][_0xa36f('0x117')](db[_0xa36f('0xd7')],{'foreignKey':'SessionId','onDelete':_0xa36f('0x114')});db[_0xa36f('0xd9')]['hasMany'](db[_0xa36f('0xd5')],{'foreignKey':_0xa36f('0x1d0'),'onDelete':_0xa36f('0x114')});db[_0xa36f('0xdb')][_0xa36f('0x124')](db[_0xa36f('0x58')],{});db[_0xa36f('0xdb')]['belongsTo'](db[_0xa36f('0x157')],{'as':_0xa36f('0x16c'),'foreignKey':'ListId'});db[_0xa36f('0xdb')][_0xa36f('0x124')](db['CmContact'],{'as':_0xa36f('0x179'),'foreignKey':'ContactId'});db[_0xa36f('0xdb')][_0xa36f('0x124')](db[_0xa36f('0x5b')],{});db[_0xa36f('0xdb')][_0xa36f('0x124')](db[_0xa36f('0x5d')],{});db[_0xa36f('0xdb')][_0xa36f('0x124')](db[_0xa36f('0x10')],{});db['SmsQueueReport']['belongsTo'](db[_0xa36f('0x138')],{});db[_0xa36f('0xde')]['hasMany'](db[_0xa36f('0xd9')],{'foreignKey':_0xa36f('0x1d1')});db['JscriptyProject'][_0xa36f('0x117')](db[_0xa36f('0xd7')],{'foreignKey':_0xa36f('0x1d1')});db[_0xa36f('0xde')][_0xa36f('0x117')](db[_0xa36f('0xd5')],{'foreignKey':_0xa36f('0x1d1')});db['SquareProject'][_0xa36f('0x126')](db['User'],{'as':_0xa36f('0x176'),'through':_0xa36f('0x149')});db['Team'][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':'Agents','through':_0xa36f('0x12c')});db[_0xa36f('0x12b')][_0xa36f('0x126')](db['VoiceQueue'],{'through':_0xa36f('0x10c'),'as':_0xa36f('0x134')});db[_0xa36f('0x12b')][_0xa36f('0x126')](db[_0xa36f('0x3f')],{'through':_0xa36f('0x16f'),'as':_0xa36f('0x136')});db[_0xa36f('0x12b')]['belongsToMany'](db[_0xa36f('0x70')],{'through':_0xa36f('0x199'),'as':_0xa36f('0x137')});db['Team'][_0xa36f('0x126')](db[_0xa36f('0x55')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0xa36f('0x12b')][_0xa36f('0x126')](db[_0xa36f('0x138')],{'through':_0xa36f('0x188'),'as':'SmsQueues'});db[_0xa36f('0x12b')][_0xa36f('0x126')](db['OpenchannelQueue'],{'through':_0xa36f('0x18f'),'as':'OpenchannelQueues'});db[_0xa36f('0x12b')][_0xa36f('0x126')](db['WhatsappQueue'],{'through':'team_has_whatsapp_queues','as':_0xa36f('0x13c')});db[_0xa36f('0x12b')][_0xa36f('0x126')](db[_0xa36f('0xf6')],{'through':'TeamVoicePrefix','as':_0xa36f('0x135')});db[_0xa36f('0xe7')][_0xa36f('0x117')](db[_0xa36f('0x78')],{'as':_0xa36f('0x14f'),'foreignKey':_0xa36f('0x1a1')});db[_0xa36f('0xe7')]['hasMany'](db[_0xa36f('0x7b')],{'as':_0xa36f('0x11b'),'foreignKey':_0xa36f('0x1a1')});db[_0xa36f('0xe7')][_0xa36f('0x117')](db[_0xa36f('0x7d')],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0xa36f('0xe7')][_0xa36f('0x117')](db[_0xa36f('0x7a')],{'as':'HopperBlacks','foreignKey':_0xa36f('0x1a1')});db[_0xa36f('0xe7')][_0xa36f('0x124')](db['Trunk'],{'as':_0xa36f('0x2b'),'foreignKey':_0xa36f('0x152')});db[_0xa36f('0xe7')]['belongsTo'](db['Trunk'],{'as':_0xa36f('0x1d2'),'foreignKey':_0xa36f('0x153')});db[_0xa36f('0xe7')][_0xa36f('0x124')](db['Interval'],{'as':_0xa36f('0x8a'),'foreignKey':_0xa36f('0x154')});db['Campaign']['belongsTo'](db['SquareProject'],{'as':_0xa36f('0x1d3'),'foreignKey':_0xa36f('0x1d4')});db[_0xa36f('0xe7')][_0xa36f('0x126')](db[_0xa36f('0x157')],{'as':_0xa36f('0x12a'),'through':_0xa36f('0x1d5')});db[_0xa36f('0xe7')][_0xa36f('0x126')](db[_0xa36f('0x157')],{'as':_0xa36f('0x1d6'),'through':'campaigns_has_cm_blacklists'});db['Attachment'][_0xa36f('0x124')](db[_0xa36f('0x6e')],{'as':_0xa36f('0x6e'),'foreignKey':_0xa36f('0x198')});db[_0xa36f('0xee')]['belongsTo'](db[_0xa36f('0x44')],{});db[_0xa36f('0xee')][_0xa36f('0x124')](db['MailInteraction'],{});db[_0xa36f('0xee')][_0xa36f('0x124')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0xa36f('0x1d7')});db[_0xa36f('0xee')]['belongsTo'](db[_0xa36f('0x10')],{'foreignKey':_0xa36f('0x1d8'),'as':_0xa36f('0x1d9')});db[_0xa36f('0xee')][_0xa36f('0x124')](db['User'],{'foreignKey':_0xa36f('0x1da'),'as':_0xa36f('0x1db')});db[_0xa36f('0xee')]['belongsTo'](db[_0xa36f('0x3f')],{'foreignKey':_0xa36f('0x1dc'),'as':_0xa36f('0x1dd')});db[_0xa36f('0xee')][_0xa36f('0x124')](db['MailAccount'],{'foreignKey':_0xa36f('0x1de'),'as':_0xa36f('0x1df')});db['ChatTransferReport'][_0xa36f('0x124')](db[_0xa36f('0x6c')],{});db[_0xa36f('0xef')]['belongsTo'](db['ChatInteraction'],{});db['ChatTransferReport'][_0xa36f('0x124')](db[_0xa36f('0x68')],{'foreignKey':_0xa36f('0x1e0'),'as':_0xa36f('0x1d7')});db['ChatTransferReport'][_0xa36f('0x124')](db['User'],{'foreignKey':_0xa36f('0x1d8'),'as':_0xa36f('0x1d9')});db['ChatTransferReport']['belongsTo'](db[_0xa36f('0x10')],{'foreignKey':_0xa36f('0x1da'),'as':_0xa36f('0x1db')});db[_0xa36f('0xef')][_0xa36f('0x124')](db['ChatQueue'],{'foreignKey':_0xa36f('0x1e1'),'as':'ToQueue'});db[_0xa36f('0xef')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0xa36f('0x1e2'),'as':_0xa36f('0x1df')});db[_0xa36f('0xf1')][_0xa36f('0x124')](db[_0xa36f('0x53')],{});db[_0xa36f('0xf1')][_0xa36f('0x124')](db[_0xa36f('0x51')],{});db[_0xa36f('0xf1')][_0xa36f('0x124')](db[_0xa36f('0x4d')],{'foreignKey':_0xa36f('0x1e3'),'as':_0xa36f('0x1d7')});db[_0xa36f('0xf1')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'foreignKey':'FromUserId','as':_0xa36f('0x1d9')});db['FaxTransferReport'][_0xa36f('0x124')](db[_0xa36f('0x10')],{'foreignKey':_0xa36f('0x1da'),'as':_0xa36f('0x1db')});db[_0xa36f('0xf1')][_0xa36f('0x124')](db[_0xa36f('0x55')],{'foreignKey':_0xa36f('0x1e4'),'as':_0xa36f('0x1dd')});db['FaxTransferReport'][_0xa36f('0x124')](db['FaxAccount'],{'foreignKey':_0xa36f('0x1e5'),'as':'ToAccount'});db[_0xa36f('0xf3')]['belongsTo'](db[_0xa36f('0x65')],{});db[_0xa36f('0xf3')]['belongsTo'](db[_0xa36f('0x11d')],{});db[_0xa36f('0xf3')][_0xa36f('0x124')](db['OpenchannelAccount'],{'foreignKey':_0xa36f('0x1e6'),'as':'FromAccount'});db[_0xa36f('0xf3')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'foreignKey':_0xa36f('0x1d8'),'as':_0xa36f('0x1d9')});db[_0xa36f('0xf3')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'foreignKey':'ToUserId','as':_0xa36f('0x1db')});db[_0xa36f('0xf3')][_0xa36f('0x124')](db['OpenchannelQueue'],{'foreignKey':_0xa36f('0x1e7'),'as':_0xa36f('0x1dd')});db[_0xa36f('0xf3')][_0xa36f('0x124')](db[_0xa36f('0x60')],{'foreignKey':_0xa36f('0x1e8'),'as':'ToAccount'});db[_0xa36f('0xf4')][_0xa36f('0x124')](db[_0xa36f('0x5d')],{});db[_0xa36f('0xf4')][_0xa36f('0x124')](db[_0xa36f('0x5b')],{});db['SmsTransferReport'][_0xa36f('0x124')](db[_0xa36f('0x58')],{'foreignKey':_0xa36f('0x1e9'),'as':_0xa36f('0x1d7')});db['SmsTransferReport'][_0xa36f('0x124')](db[_0xa36f('0x10')],{'foreignKey':_0xa36f('0x1d8'),'as':_0xa36f('0x1d9')});db[_0xa36f('0xf4')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'foreignKey':_0xa36f('0x1da'),'as':'ToAgent'});db[_0xa36f('0xf4')][_0xa36f('0x124')](db[_0xa36f('0x138')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0xa36f('0xf4')]['belongsTo'](db[_0xa36f('0x58')],{'foreignKey':'ToSmsAccountId','as':_0xa36f('0x1df')});db[_0xa36f('0x157')]['hasMany'](db[_0xa36f('0x169')],{'as':'Dispositions','foreignKey':_0xa36f('0x16d'),'onDelete':_0xa36f('0x114')});db[_0xa36f('0x157')]['hasMany'](db[_0xa36f('0x81')],{'as':_0xa36f('0x1ea'),'foreignKey':_0xa36f('0x16d')});db[_0xa36f('0x157')]['hasMany'](db[_0xa36f('0x76')],{'as':_0xa36f('0x129'),'onDelete':'cascade','foreignKey':_0xa36f('0x16d')});db[_0xa36f('0x157')]['hasMany'](db['CmHopperFinal'],{'as':_0xa36f('0x11b'),'foreignKey':_0xa36f('0x16d')});db[_0xa36f('0x157')]['hasMany'](db[_0xa36f('0x7d')],{'as':_0xa36f('0x11c'),'foreignKey':_0xa36f('0x16d')});db[_0xa36f('0x157')][_0xa36f('0x117')](db[_0xa36f('0x7f')],{'as':_0xa36f('0x7f'),'foreignKey':_0xa36f('0x16d')});db['CmList'][_0xa36f('0x126')](db['VoiceQueue'],{'as':'Queues','through':_0xa36f('0x158')});db[_0xa36f('0x157')][_0xa36f('0x126')](db['User'],{'as':_0xa36f('0x159'),'through':_0xa36f('0x13e')});db[_0xa36f('0xf6')][_0xa36f('0x117')](db[_0xa36f('0x16')],{'as':_0xa36f('0x11a'),'onDelete':'cascade'});db[_0xa36f('0xf6')]['belongsToMany'](db[_0xa36f('0x10')],{'as':_0xa36f('0x159'),'through':'UserVoicePrefix'});db[_0xa36f('0xf6')][_0xa36f('0x126')](db['Team'],{'through':_0xa36f('0x10e'),'as':'Teams'});db[_0xa36f('0xf8')][_0xa36f('0x117')](db['User'],{'as':_0xa36f('0x176'),'foreignKey':_0xa36f('0x125')});db[_0xa36f('0xf8')]['hasMany'](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0xa36f('0x125'),'onDelete':_0xa36f('0x114')});db[_0xa36f('0xfa')]['hasMany'](db[_0xa36f('0xfc')],{'as':_0xa36f('0x1eb'),'foreignKey':_0xa36f('0x1ec'),'onDelete':_0xa36f('0x114')});db[_0xa36f('0xff')]['hasMany'](db[_0xa36f('0x169')],{'as':_0xa36f('0x16a'),'foreignKey':_0xa36f('0x1ed'),'onDelete':_0xa36f('0x114')});db[_0xa36f('0xff')][_0xa36f('0x117')](db[_0xa36f('0x85')],{'as':'Answers','foreignKey':_0xa36f('0x1ed')});db['WhatsappAccount'][_0xa36f('0x117')](db[_0xa36f('0x103')],{'as':_0xa36f('0x15c'),'foreignKey':_0xa36f('0x1ed')});db[_0xa36f('0xff')]['hasMany'](db[_0xa36f('0x101')],{'as':_0xa36f('0x184')});db[_0xa36f('0xff')][_0xa36f('0x117')](db[_0xa36f('0x1ee')],{'as':_0xa36f('0x14b')});db[_0xa36f('0xff')]['belongsTo'](db[_0xa36f('0x157')],{'as':_0xa36f('0x16c'),'foreignKey':_0xa36f('0x16d')});db[_0xa36f('0xff')]['belongsTo'](db[_0xa36f('0x8c')],{'as':_0xa36f('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa36f('0xff')]['belongsToMany'](db[_0xa36f('0x10')],{'as':_0xa36f('0x159'),'through':_0xa36f('0x1ef')});db[_0xa36f('0x1ee')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'onDelete':_0xa36f('0x166')});db[_0xa36f('0x1ee')][_0xa36f('0x124')](db[_0xa36f('0x109')],{'onDelete':_0xa36f('0x166')});db[_0xa36f('0x1ee')][_0xa36f('0x124')](db['WhatsappAccount'],{'onDelete':_0xa36f('0x166')});db[_0xa36f('0x1ee')][_0xa36f('0x124')](db[_0xa36f('0x8a')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xa36f('0x1ee')]['belongsTo'](db['Tag'],{'onDelete':_0xa36f('0x166'),'foreignKey':_0xa36f('0x17d')});db[_0xa36f('0x101')][_0xa36f('0x117')](db[_0xa36f('0x103')],{'as':_0xa36f('0x15c'),'onDelete':_0xa36f('0x114'),'foreignKey':_0xa36f('0x1f0')});db[_0xa36f('0x101')][_0xa36f('0x124')](db[_0xa36f('0xff')],{'as':_0xa36f('0x171'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction']['belongsTo'](db[_0xa36f('0x76')],{'as':_0xa36f('0x179'),'foreignKey':_0xa36f('0x163')});db[_0xa36f('0x101')]['belongsTo'](db[_0xa36f('0x10')],{'as':_0xa36f('0x172'),'foreignKey':'UserId'});db[_0xa36f('0x101')][_0xa36f('0x126')](db[_0xa36f('0x94')],{'through':_0xa36f('0x1f1'),'as':'Tags'});db[_0xa36f('0x101')][_0xa36f('0x126')](db[_0xa36f('0x94')],{'through':_0xa36f('0x1f1'),'as':_0xa36f('0x175')});db[_0xa36f('0x101')][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':_0xa36f('0x176'),'through':_0xa36f('0x133'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0xa36f('0x124')](db['User'],{'as':_0xa36f('0x10')});db[_0xa36f('0x103')][_0xa36f('0x124')](db[_0xa36f('0x76')],{'onDelete':_0xa36f('0x114'),'as':'Contact'});db['WhatsappMessage']['belongsTo'](db['WhatsappInteraction'],{'onDelete':_0xa36f('0x114'),'as':_0xa36f('0x181'),'foreignKey':_0xa36f('0x1f0')});db[_0xa36f('0x103')][_0xa36f('0x124')](db['WhatsappAccount'],{'as':_0xa36f('0x171'),'foreignKey':'WhatsappAccountId'});db[_0xa36f('0x105')][_0xa36f('0x124')](db[_0xa36f('0xff')],{});db['WhatsappQueueReport'][_0xa36f('0x124')](db['CmList'],{'as':_0xa36f('0x16c'),'foreignKey':_0xa36f('0x16d')});db[_0xa36f('0x105')]['belongsTo'](db[_0xa36f('0x76')],{'as':_0xa36f('0x179'),'foreignKey':_0xa36f('0x163')});db[_0xa36f('0x105')]['belongsTo'](db['WhatsappInteraction'],{});db[_0xa36f('0x105')][_0xa36f('0x124')](db['WhatsappQueue'],{});db[_0xa36f('0x105')][_0xa36f('0x124')](db['WhatsappMessage'],{});db[_0xa36f('0x105')][_0xa36f('0x124')](db[_0xa36f('0x10')],{});db['WhatsappTransferReport'][_0xa36f('0x124')](db[_0xa36f('0x103')],{});db[_0xa36f('0x107')]['belongsTo'](db[_0xa36f('0x101')],{});db[_0xa36f('0x107')][_0xa36f('0x124')](db[_0xa36f('0xff')],{'foreignKey':'FromWhatsappAccountId','as':_0xa36f('0x1d7')});db[_0xa36f('0x107')][_0xa36f('0x124')](db[_0xa36f('0xff')],{'foreignKey':'ToWhatsappAccountId','as':_0xa36f('0x1df')});db[_0xa36f('0x107')]['belongsTo'](db[_0xa36f('0x109')],{'foreignKey':_0xa36f('0x1f2'),'as':_0xa36f('0x1dd')});db[_0xa36f('0x107')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'foreignKey':_0xa36f('0x1d8'),'as':_0xa36f('0x1d9')});db[_0xa36f('0x107')]['belongsTo'](db['User'],{'foreignKey':_0xa36f('0x1da'),'as':'ToAgent'});db[_0xa36f('0x109')][_0xa36f('0x126')](db[_0xa36f('0x10')],{'as':'Agents','through':_0xa36f('0x13d'),'foreignKey':_0xa36f('0x1f3')});db[_0xa36f('0x109')][_0xa36f('0x126')](db['Team'],{'through':_0xa36f('0x1f4'),'as':_0xa36f('0x15a')});db[_0xa36f('0x112')][_0xa36f('0x124')](db[_0xa36f('0x10')],{'as':'user','foreignKey':_0xa36f('0x115'),'onDelete':_0xa36f('0x114'),'hooks':!![]});db[_0xa36f('0x10b')][_0xa36f('0x113')](db[_0xa36f('0xc7')],{'as':'Dynamics365Account','onDelete':_0xa36f('0x166')});db[_0xa36f('0x10b')]['hasOne'](db[_0xa36f('0x3b')],{'as':_0xa36f('0x167'),'onDelete':_0xa36f('0x166')});db[_0xa36f('0x10b')][_0xa36f('0x113')](db[_0xa36f('0x3c')],{'as':_0xa36f('0x168'),'onDelete':_0xa36f('0x166')});module[_0xa36f('0x1f5')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x367a=['OpenchannelQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','OpenchannelAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','Applications','VoiceMusicOnHold','Sounds','VoiceQueueId','HopperHistories','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','QueueCalls','AgentReports','uniqueid','Contact','ContactId','CloudProviderId','restrict','MailAccountId','Imap','Smtp','Dispositions','Answers','MailMessage','Interactions','MailApplication','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','TagId','List','FaxAccountId','Exntensions','ListId','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','Owner','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelQueueReport','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','Attachments','team_has_chat_queues','ChatGroupId','Members','CompanyId','Hoppers','Company','cm_contact_has_tags','Agent','Campaign','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','AutomationAnyId','AutomationId','ParentId','MailApplications','FaxApplications','SmsApplications','Schedule','CustomReportId','whatsapp_interaction_has_tags','Trigger','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','AnalyticFieldReport','DefaultReportId','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Field','VariableId','SugarcrmAccount','Subject','int_desk_configuration_has_tags','Description','ZohoConfiguration','ZohoField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Account','SessionId','ProjectId','FaxQueues','team_has_whatsapp_queues','WhatsappQueues','VoicePrefixes','HopperBlacks','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','FromAgent','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxAccountId','ToAccount','FromOpenchannelAccountId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','utf8_general_ci','sequelizeHistory','name','utf8','username','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','ZendeskField','../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','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','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','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','MailInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','CmContact','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','FaxInteractions','user_has_fax_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueues','UserFaxQueue','SmsQueues','OpenchannelQueue'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0x367a,0xb5));var _0xa367=function(_0x3a7de4,_0x3a4444){_0x3a7de4=_0x3a7de4-0x0;var _0x490878=_0x367a[_0x3a7de4];return _0x490878;};'use strict';var config=require(_0xa367('0x0'));var Sequelize=require(_0xa367('0x1'));var _=require(_0xa367('0x2'));var jstz=require(_0xa367('0x3'));var timezone=jstz[_0xa367('0x4')]();config['sequelize']=_[_0xa367('0x5')](config[_0xa367('0x1')],{'database':_0xa367('0x6'),'username':_0xa367('0x7'),'password':_0xa367('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xa367('0x9'),'dialectOptions':{'charset':_0xa367('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xa367('0xb')}}});config[_0xa367('0xc')]=_[_0xa367('0x5')](config[_0xa367('0xc')],{'database':_0xa367('0x6'),'username':_0xa367('0x7'),'password':_0xa367('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xa367('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xa367('0xd')](),'define':{'charset':_0xa367('0xe'),'collate':_0xa367('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa367('0x1')]['database'],config[_0xa367('0x1')][_0xa367('0xf')],config[_0xa367('0x1')][_0xa367('0x10')],config[_0xa367('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa367('0xc')]['database'],config[_0xa367('0xc')]['username'],config['sequelizeHistory'][_0xa367('0x10')],config[_0xa367('0xc')]['options'])};db[_0xa367('0x11')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x13'));db[_0xa367('0x14')]=db[_0xa367('0x1')]['import'](_0xa367('0x15'));db[_0xa367('0x16')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x17'));db[_0xa367('0x18')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x19'));db['VoiceMusicOnHold']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x1a'));db[_0xa367('0x1b')]=db['sequelize'][_0xa367('0x12')](_0xa367('0x1c'));db[_0xa367('0x1d')]=db[_0xa367('0x1')]['import'](_0xa367('0x1e'));db[_0xa367('0x1f')]=db['sequelize']['import'](_0xa367('0x20'));db[_0xa367('0x21')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0xa367('0x1')][_0xa367('0x12')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xa367('0x22')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x23'));db[_0xa367('0x24')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/voiceDialReport/voiceDialReport.model');db[_0xa367('0x25')]=db['sequelize'][_0xa367('0x12')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xa367('0x26')]=db['sequelize'][_0xa367('0x12')](_0xa367('0x27'));db[_0xa367('0x28')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x29'));db[_0xa367('0x2a')]=db['sequelize'][_0xa367('0x12')](_0xa367('0x2b'));db['VoiceTransferReport']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x2c'));db['UserVoiceQueueRt']=db[_0xa367('0x1')]['import'](_0xa367('0x2d'));db['UserVoiceQueue']=db['sequelize'][_0xa367('0x12')](_0xa367('0x2e'));db[_0xa367('0x2f')]=db['sequelize']['import'](_0xa367('0x30'));db[_0xa367('0x31')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x32'));db['UserFaxQueue']=db['sequelize'][_0xa367('0x12')]('../api/userFaxQueue/userFaxQueue.model');db[_0xa367('0x33')]=db['sequelize']['import'](_0xa367('0x34'));db[_0xa367('0x35')]=db[_0xa367('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xa367('0x36')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x37'));db[_0xa367('0x38')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x39'));db[_0xa367('0x3a')]=db['sequelize'][_0xa367('0x12')](_0xa367('0x3b'));db[_0xa367('0x3c')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/mailAccount/mailAccount.model');db[_0xa367('0x3d')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x3e'));db[_0xa367('0x3f')]=db[_0xa367('0x1')]['import'](_0xa367('0x40'));db['MailMessage']=db['sequelize'][_0xa367('0x12')](_0xa367('0x41'));db['MailApplication']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x42'));db[_0xa367('0x43')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x44'));db[_0xa367('0x45')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x46'));db[_0xa367('0x47')]=db[_0xa367('0x1')]['import'](_0xa367('0x48'));db[_0xa367('0x49')]=db['sequelize']['import']('../api/faxAccount/faxAccount.model');db[_0xa367('0x4a')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x4b'));db[_0xa367('0x4c')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x4d'));db[_0xa367('0x4e')]=db['sequelize'][_0xa367('0x12')](_0xa367('0x4f'));db[_0xa367('0x50')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x51'));db[_0xa367('0x52')]=db[_0xa367('0x1')]['import'](_0xa367('0x53'));db[_0xa367('0x54')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x55'));db['SmsApplication']=db['sequelize'][_0xa367('0x12')](_0xa367('0x56'));db[_0xa367('0x57')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x58'));db[_0xa367('0x59')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/smsMessage/smsMessage.model');db[_0xa367('0x5a')]=db['sequelize'][_0xa367('0x12')]('../api/smsQueue/smsQueue.model');db[_0xa367('0x5b')]=db['sequelize']['import']('../api/openchannelAccount/openchannelAccount.model');db[_0xa367('0x5c')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x5d'));db[_0xa367('0x5e')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x5f'));db[_0xa367('0x60')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x61'));db['OpenchannelQueue']=db['sequelize'][_0xa367('0x12')](_0xa367('0x62'));db[_0xa367('0x63')]=db[_0xa367('0x1')]['import']('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x64'));db[_0xa367('0x65')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x66'));db[_0xa367('0x67')]=db[_0xa367('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0xa367('0x68')]=db[_0xa367('0x1')]['import'](_0xa367('0x69'));db['ChatOfflineMessage']=db[_0xa367('0x1')]['import'](_0xa367('0x6a'));db[_0xa367('0x6b')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x6c'));db['ChatGroup']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x6d'));db[_0xa367('0x6e')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x6f'));db[_0xa367('0x70')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x71'));db['CmContact']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x72'));db[_0xa367('0x73')]=db['sequelize'][_0xa367('0x12')]('../api/cmHopper/cmHopper.model');db[_0xa367('0x74')]=db['sequelize'][_0xa367('0x12')](_0xa367('0x75'));db['CmHopperFinal']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x76'));db[_0xa367('0x77')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x78'));db[_0xa367('0x79')]=db[_0xa367('0x1')]['import'](_0xa367('0x7a'));db[_0xa367('0x7b')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0xa367('0x7c')]=db['sequelize']['import'](_0xa367('0x7d'));db[_0xa367('0x7e')]=db['sequelize'][_0xa367('0x12')]('../api/automation/automation.model');db[_0xa367('0x7f')]=db[_0xa367('0x1')]['import'](_0xa367('0x80'));db[_0xa367('0x81')]=db[_0xa367('0x1')]['import'](_0xa367('0x82'));db['Condition']=db['sequelize'][_0xa367('0x12')](_0xa367('0x83'));db[_0xa367('0x84')]=db['sequelize'][_0xa367('0x12')](_0xa367('0x85'));db['Pause']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x86'));db[_0xa367('0x87')]=db[_0xa367('0x1')]['import'](_0xa367('0x88'));db['VoiceQueuesLog']=db[_0xa367('0x1')][_0xa367('0x12')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0xa367('0x1')]['import']('../api/schedule/schedule.model');db[_0xa367('0x89')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x8a'));db['Tag']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x8b'));db[_0xa367('0x8c')]=db[_0xa367('0x1')]['import'](_0xa367('0x8d'));db['Trigger']=db['sequelize']['import'](_0xa367('0x8e'));db[_0xa367('0x8f')]=db['sequelize'][_0xa367('0x12')](_0xa367('0x90'));db[_0xa367('0x91')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x92'));db[_0xa367('0x93')]=db['sequelize'][_0xa367('0x12')](_0xa367('0x94'));db[_0xa367('0x95')]=db[_0xa367('0x1')]['import'](_0xa367('0x96'));db[_0xa367('0x97')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xa367('0x98')]=db['sequelize'][_0xa367('0x12')](_0xa367('0x99'));db[_0xa367('0x9a')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x9b'));db['AnalyticFieldReport']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x9c'));db[_0xa367('0x9d')]=db['sequelize'][_0xa367('0x12')](_0xa367('0x9e'));db[_0xa367('0x9f')]=db[_0xa367('0x1')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xa367('0xa0')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xa1'));db[_0xa367('0xa2')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xa3'));db['SugarcrmAccount']=db[_0xa367('0x1')][_0xa367('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xa367('0xa4')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xa5'));db[_0xa367('0xa6')]=db[_0xa367('0x1')]['import'](_0xa367('0xa7'));db[_0xa367('0xa8')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xa9'));db[_0xa367('0xaa')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xab'));db[_0xa367('0xac')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xad'));db[_0xa367('0xae')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0xa367('0x1')][_0xa367('0x12')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xaf'));db[_0xa367('0xb0')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xa367('0xb1')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xa367('0xb2')]=db['sequelize'][_0xa367('0x12')](_0xa367('0xb3'));db[_0xa367('0xb4')]=db['sequelize']['import'](_0xa367('0xb5'));db[_0xa367('0xb6')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xb7'));db[_0xa367('0xb8')]=db[_0xa367('0x1')]['import'](_0xa367('0xb9'));db[_0xa367('0xba')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xbb'));db[_0xa367('0xbc')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xbd'));db[_0xa367('0xbe')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0xa367('0xbf')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xa367('0xc0')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xc1'));db[_0xa367('0xc2')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xc3'));db['Dynamics365Account']=db['sequelize']['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0xa367('0xc4')]=db['sequelize'][_0xa367('0x12')](_0xa367('0xc5'));db[_0xa367('0xc6')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xa367('0xc7')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xc8'));db[_0xa367('0xc9')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xca'));db[_0xa367('0xcb')]=db['sequelize'][_0xa367('0x12')](_0xa367('0xcc'));db[_0xa367('0x91')]=db['sequelize'][_0xa367('0x12')](_0xa367('0x92'));db['Network']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xcd'));db[_0xa367('0xce')]=db[_0xa367('0x1')]['import'](_0xa367('0xcf'));db[_0xa367('0xd0')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xd1'));db[_0xa367('0xd2')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xd3'));db[_0xa367('0xd4')]=db[_0xa367('0x1')]['import'](_0xa367('0xd5'));db['JscriptySessionReport']=db['sequelize'][_0xa367('0x12')](_0xa367('0xd6'));db[_0xa367('0xd7')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xd8'));db[_0xa367('0xd9')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xda'));db[_0xa367('0xdb')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xdc'));db[_0xa367('0xdd')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xde'));db[_0xa367('0xdf')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xe0'));db['SquareOdbc']=db[_0xa367('0x1')][_0xa367('0x12')]('../api/squareOdbc/squareOdbc.model');db[_0xa367('0xe1')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xe2'));db[_0xa367('0xe3')]=db['sequelize'][_0xa367('0x12')](_0xa367('0xe4'));db[_0xa367('0xe5')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xe6'));db[_0xa367('0xe7')]=db['sequelize']['import'](_0xa367('0xe8'));db[_0xa367('0xe9')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xea'));db['Campaign']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xeb'));db[_0xa367('0xec')]=db[_0xa367('0x1')]['import'](_0xa367('0xed'));db[_0xa367('0xee')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xef'));db[_0xa367('0xf0')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/plugin/plugin.model');db[_0xa367('0xf1')]=db[_0xa367('0x1')]['import']('../api/mailTransferReport/mailTransferReport.model');db[_0xa367('0xf2')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xf3'));db[_0xa367('0xf4')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xf5'));db[_0xa367('0xf6')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xf7'));db['SmsTransferReport']=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xf8'));db[_0xa367('0xf9')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0xfa'));db[_0xa367('0xfb')]=db['sequelize'][_0xa367('0x12')](_0xa367('0xfc'));db[_0xa367('0xfd')]=db['sequelize'][_0xa367('0x12')](_0xa367('0xfe'));db[_0xa367('0xff')]=db[_0xa367('0x1')]['import'](_0xa367('0x100'));db[_0xa367('0x101')]=db[_0xa367('0x1')]['import']('../api/userProfileResource/userProfileResource.model');db[_0xa367('0x102')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x103'));db[_0xa367('0x104')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x105'));db[_0xa367('0x106')]=db['sequelize'][_0xa367('0x12')]('../api/whatsappApplication/whatsappApplication.model');db[_0xa367('0x107')]=db[_0xa367('0x1')]['import'](_0xa367('0x108'));db[_0xa367('0x109')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x10a'));db[_0xa367('0x10b')]=db['sequelize']['import'](_0xa367('0x10c'));db[_0xa367('0x10d')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x10e'));db[_0xa367('0x10f')]=db[_0xa367('0x1')][_0xa367('0x12')]('../api/whatsappQueue/whatsappQueue.model');db[_0xa367('0x110')]=db[_0xa367('0x1')]['import'](_0xa367('0x111'));db[_0xa367('0x112')]=db['sequelize']['import'](_0xa367('0x113'));db[_0xa367('0x114')]=db[_0xa367('0x1')]['import'](_0xa367('0x115'));db[_0xa367('0x116')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x117'));db[_0xa367('0x118')]=db[_0xa367('0x1')][_0xa367('0x12')](_0xa367('0x119'));db['User'][_0xa367('0x11a')](db['VoiceMail'],{'as':_0xa367('0x21'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x11c')});db['User'][_0xa367('0x11a')](db['UserSetting'],{'as':_0xa367('0x11d'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x11c')});db['User'][_0xa367('0x11e')](db[_0xa367('0x1d')],{'as':'Recordings','foreignKey':_0xa367('0x11c')});db[_0xa367('0x11')][_0xa367('0x11e')](db[_0xa367('0x11f')],{'as':_0xa367('0x120'),'foreignKey':_0xa367('0x11c')});db[_0xa367('0x11')]['hasMany'](db[_0xa367('0x18')],{'as':_0xa367('0x121'),'onDelete':_0xa367('0x11b'),'hooks':!![]});db[_0xa367('0x11')][_0xa367('0x11e')](db[_0xa367('0x122')],{'as':_0xa367('0x123'),'foreignKey':_0xa367('0x11c')});db['User'][_0xa367('0x11e')](db['CmHopperHistory'],{'as':_0xa367('0x124'),'foreignKey':_0xa367('0x11c')});db['User'][_0xa367('0x11e')](db[_0xa367('0x79')],{'as':_0xa367('0x79'),'foreignKey':_0xa367('0x11c')});db[_0xa367('0x11')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xa367('0x125'),'foreignKey':_0xa367('0x11c')});db['User'][_0xa367('0x11e')](db[_0xa367('0x67')],{'as':'ChatInteractions','foreignKey':_0xa367('0x11c')});db['User'][_0xa367('0x11e')](db['SmsInteraction'],{'as':_0xa367('0x126'),'foreignKey':_0xa367('0x11c')});db[_0xa367('0x11')][_0xa367('0x11e')](db[_0xa367('0x4c')],{'as':'FaxInteractions','foreignKey':_0xa367('0x11c')});db[_0xa367('0x11')][_0xa367('0x11e')](db[_0xa367('0x3f')],{'as':_0xa367('0x127'),'foreignKey':'UserId'});db['User'][_0xa367('0x11e')](db[_0xa367('0x107')],{'as':'WhatsappInteractions','foreignKey':'UserId'});db['User']['hasMany'](db[_0xa367('0x102')],{'as':_0xa367('0x128'),'foreignKey':_0xa367('0x129')});db[_0xa367('0x11')][_0xa367('0x12a')](db[_0xa367('0xfd')],{'as':_0xa367('0xfd'),'foreignKey':_0xa367('0x12b')});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0x12d')],{'as':_0xa367('0x12e'),'through':_0xa367('0x12f')});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0x130')],{'as':'Contacts','through':_0xa367('0x131')});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0xf9')],{'as':_0xa367('0x132'),'through':_0xa367('0x133')});db['User'][_0xa367('0x12c')](db['Team'],{'through':_0xa367('0x134')});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0x3f')],{'as':_0xa367('0x127'),'through':_0xa367('0x135')});db['User']['belongsToMany'](db[_0xa367('0x67')],{'as':_0xa367('0x136'),'through':'user_has_chat_interactions'});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0x4c')],{'as':_0xa367('0x137'),'through':_0xa367('0x138')});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0x57')],{'as':_0xa367('0x126'),'through':'user_has_sms_interactions'});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0x5e')],{'as':_0xa367('0x125'),'through':'user_has_openchannel_interactions'});db[_0xa367('0x11')]['belongsToMany'](db[_0xa367('0x107')],{'as':_0xa367('0x139'),'through':_0xa367('0x13a')});db[_0xa367('0x11')]['belongsToMany'](db['VoiceQueue'],{'as':_0xa367('0x13b'),'through':'UserVoiceQueue','required':![]});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0xfb')],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db[_0xa367('0x11')]['belongsToMany'](db[_0xa367('0x3d')],{'as':_0xa367('0x13c'),'through':_0xa367('0x31'),'required':![]});db[_0xa367('0x11')]['belongsToMany'](db['ChatQueue'],{'as':_0xa367('0x13d'),'through':_0xa367('0x2f'),'required':![],'hooks':!![]});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0x50')],{'as':'FaxQueues','through':_0xa367('0x13e'),'required':![]});db[_0xa367('0x11')]['belongsToMany'](db['SmsQueue'],{'as':_0xa367('0x13f'),'through':_0xa367('0x33'),'required':![]});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0x140')],{'as':_0xa367('0x141'),'through':_0xa367('0x35'),'required':![]});db['User'][_0xa367('0x12c')](db[_0xa367('0x10f')],{'as':'WhatsappQueues','through':_0xa367('0x36'),'required':![]});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0xf9')],{'through':_0xa367('0x133')});db[_0xa367('0x11')]['belongsToMany'](db[_0xa367('0x63')],{'as':_0xa367('0x142'),'through':_0xa367('0x143')});db['User'][_0xa367('0x12c')](db['FaxAccount'],{'as':_0xa367('0x144'),'through':_0xa367('0x145')});db[_0xa367('0x11')][_0xa367('0x12c')](db['MailAccount'],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0x5b')],{'as':_0xa367('0x146'),'through':'user_has_openchannel_accounts'});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0x54')],{'as':'SmsAccounts','through':_0xa367('0x147')});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0x104')],{'as':_0xa367('0x148'),'through':_0xa367('0x149')});db[_0xa367('0x11')][_0xa367('0x12c')](db[_0xa367('0xe1')],{'as':_0xa367('0x14a'),'through':_0xa367('0x14b')});db[_0xa367('0x14')][_0xa367('0x11e')](db[_0xa367('0x18')],{'as':_0xa367('0x14c'),'onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0xa367('0x16')][_0xa367('0x11e')](db[_0xa367('0x18')],{'onDelete':'cascade'});db[_0xa367('0x18')][_0xa367('0x11e')](db[_0xa367('0x18')],{'as':_0xa367('0x14d'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x14e')][_0xa367('0x12c')](db['Sound'],{'as':_0xa367('0x14f'),'through':'moh_has_sounds'});db['VoiceQueue'][_0xa367('0x11e')](db[_0xa367('0x11f')],{'as':'Members','foreignKey':_0xa367('0x150')});db[_0xa367('0x1b')][_0xa367('0x11e')](db[_0xa367('0x73')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0xa367('0x1b')][_0xa367('0x11e')](db[_0xa367('0x122')],{'as':_0xa367('0x123'),'foreignKey':_0xa367('0x150')});db['VoiceQueue'][_0xa367('0x11e')](db['CmHopperHistory'],{'as':_0xa367('0x151'),'foreignKey':_0xa367('0x150')});db['VoiceQueue']['hasMany'](db[_0xa367('0x79')],{'as':_0xa367('0x79'),'foreignKey':_0xa367('0x150')});db['VoiceQueue'][_0xa367('0x11e')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0xa367('0x150')});db[_0xa367('0x1b')]['hasMany'](db[_0xa367('0x152')],{'as':_0xa367('0x153'),'foreignKey':_0xa367('0x150')});db[_0xa367('0x1b')][_0xa367('0x12a')](db[_0xa367('0x2a')],{'as':'Trunk','foreignKey':_0xa367('0x154')});db[_0xa367('0x1b')][_0xa367('0x12a')](db[_0xa367('0x2a')],{'as':_0xa367('0x155'),'foreignKey':_0xa367('0x156')});db[_0xa367('0x1b')][_0xa367('0x12a')](db[_0xa367('0x84')],{'as':'Interval','foreignKey':_0xa367('0x157')});db[_0xa367('0x1b')][_0xa367('0x12a')](db[_0xa367('0x158')],{'as':_0xa367('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa367('0x1b')][_0xa367('0x12c')](db[_0xa367('0xf9')],{'as':'Lists','through':_0xa367('0x15a')});db['VoiceQueue'][_0xa367('0x12c')](db[_0xa367('0x11')],{'as':_0xa367('0x15b'),'through':'UserVoiceQueue'});db[_0xa367('0x1b')][_0xa367('0x12c')](db[_0xa367('0xe7')],{'as':_0xa367('0x15c'),'through':'TeamVoiceQueue'});db[_0xa367('0x1b')][_0xa367('0x12c')](db['CmList'],{'as':_0xa367('0x15d'),'through':_0xa367('0x15e')});db[_0xa367('0x1d')][_0xa367('0x12a')](db[_0xa367('0x11')],{'as':'User','foreignKey':_0xa367('0x11c')});db[_0xa367('0x1f')][_0xa367('0x12a')](db['User'],{'as':_0xa367('0x11'),'foreignKey':_0xa367('0x11c')});db[_0xa367('0x21')]['hasMany'](db[_0xa367('0x15f')],{'as':_0xa367('0x160'),'onDelete':_0xa367('0x11b'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0xa367('0x15f')]['belongsTo'](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0xa367('0x22')][_0xa367('0x11e')](db[_0xa367('0x26')],{'as':_0xa367('0x161'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0xa367('0x11e')](db['VoiceAgentReport'],{'as':_0xa367('0x162'),'foreignKey':_0xa367('0x163'),'constraints':![]});db['VoiceCallReport'][_0xa367('0x12a')](db[_0xa367('0x11')],{'as':'User','foreignKey':'UserId'});db[_0xa367('0x22')][_0xa367('0x12a')](db[_0xa367('0x130')],{'as':_0xa367('0x164'),'foreignKey':_0xa367('0x165')});db[_0xa367('0x38')]['belongsTo'](db[_0xa367('0x3c')],{'as':_0xa367('0x3c'),'foreignKey':'MailAccountId'});db[_0xa367('0x38')][_0xa367('0x12a')](db[_0xa367('0x110')],{'as':_0xa367('0x110'),'foreignKey':_0xa367('0x166'),'onDelete':_0xa367('0x167')});db[_0xa367('0x3a')][_0xa367('0x12a')](db[_0xa367('0x3c')],{'as':_0xa367('0x3c'),'foreignKey':_0xa367('0x168')});db[_0xa367('0x3a')]['belongsTo'](db[_0xa367('0x110')],{'as':_0xa367('0x110'),'foreignKey':_0xa367('0x166'),'onDelete':_0xa367('0x167')});db[_0xa367('0x3c')][_0xa367('0x11a')](db['MailServerIn'],{'as':_0xa367('0x169'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x3c')][_0xa367('0x11a')](db[_0xa367('0x3a')],{'as':_0xa367('0x16a'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x3c')][_0xa367('0x11e')](db['Disposition'],{'as':_0xa367('0x16b'),'foreignKey':'MailAccountId','onDelete':'cascade'});db['MailAccount'][_0xa367('0x11e')](db['CannedAnswer'],{'as':_0xa367('0x16c'),'foreignKey':_0xa367('0x168')});db[_0xa367('0x3c')][_0xa367('0x11e')](db[_0xa367('0x16d')],{'as':_0xa367('0x160'),'foreignKey':_0xa367('0x168')});db['MailAccount'][_0xa367('0x11e')](db[_0xa367('0x3f')],{'as':_0xa367('0x16e')});db[_0xa367('0x3c')][_0xa367('0x11e')](db[_0xa367('0x16f')],{'as':_0xa367('0x14d')});db['MailAccount']['belongsTo'](db[_0xa367('0xf9')],{'as':'List','foreignKey':'ListId'});db[_0xa367('0x3c')]['belongsTo'](db[_0xa367('0x8c')],{'as':_0xa367('0x8c'),'foreignKey':'TemplateId'});db['MailAccount'][_0xa367('0x12a')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa367('0x170')});db[_0xa367('0x3c')][_0xa367('0x12c')](db[_0xa367('0x11')],{'as':_0xa367('0x15b'),'through':_0xa367('0x171')});db[_0xa367('0x3d')][_0xa367('0x12c')](db['User'],{'as':_0xa367('0x15b'),'through':_0xa367('0x31')});db['MailQueue'][_0xa367('0x12c')](db[_0xa367('0xe7')],{'through':_0xa367('0x172'),'as':_0xa367('0x15c')});db['MailInteraction'][_0xa367('0x11e')](db[_0xa367('0x16d')],{'as':_0xa367('0x160'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x173')});db[_0xa367('0x3f')][_0xa367('0x12a')](db[_0xa367('0x3c')],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x168')});db[_0xa367('0x3f')][_0xa367('0x12a')](db[_0xa367('0x130')],{'as':_0xa367('0x164'),'foreignKey':_0xa367('0x165')});db[_0xa367('0x3f')][_0xa367('0x12a')](db[_0xa367('0x11')],{'as':'Owner','foreignKey':_0xa367('0x11c')});db[_0xa367('0x3f')][_0xa367('0x12c')](db[_0xa367('0x175')],{'through':_0xa367('0x176'),'as':_0xa367('0x177')});db[_0xa367('0x3f')][_0xa367('0x12c')](db[_0xa367('0x175')],{'through':_0xa367('0x176'),'as':_0xa367('0x178')});db['MailInteraction']['belongsToMany'](db[_0xa367('0x11')],{'as':_0xa367('0x179'),'through':_0xa367('0x135'),'foreignKey':_0xa367('0x173')});db[_0xa367('0x16d')][_0xa367('0x11e')](db['Attachment'],{'as':'Attachments','onDelete':_0xa367('0x11b')});db[_0xa367('0x16d')][_0xa367('0x12a')](db[_0xa367('0x11')],{'as':'User'});db[_0xa367('0x16d')][_0xa367('0x12a')](db[_0xa367('0x130')],{'onDelete':'cascade','as':_0xa367('0x164')});db[_0xa367('0x16d')][_0xa367('0x12a')](db['MailInteraction'],{'as':_0xa367('0x17a'),'foreignKey':_0xa367('0x173')});db[_0xa367('0x16d')][_0xa367('0x12a')](db['MailAccount'],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x168')});db[_0xa367('0x16d')][_0xa367('0x12a')](db[_0xa367('0x63')],{'as':'ChatWebsite','foreignKey':_0xa367('0x17b')});db[_0xa367('0x16d')]['belongsTo'](db[_0xa367('0x17c')],{'as':_0xa367('0x17c'),'foreignKey':_0xa367('0x17d')});db['MailApplication'][_0xa367('0x12a')](db[_0xa367('0x11')],{'onDelete':_0xa367('0x167')});db[_0xa367('0x16f')][_0xa367('0x12a')](db[_0xa367('0x3d')],{'onDelete':_0xa367('0x167')});db['MailApplication'][_0xa367('0x12a')](db[_0xa367('0x3c')],{'onDelete':'restrict'});db['MailApplication'][_0xa367('0x12a')](db['Interval'],{'onDelete':_0xa367('0x167'),'foreignKey':_0xa367('0x157')});db[_0xa367('0x16f')][_0xa367('0x12a')](db[_0xa367('0x175')],{'onDelete':_0xa367('0x167'),'foreignKey':_0xa367('0x17e')});db['MailQueueReport'][_0xa367('0x12a')](db['MailAccount'],{});db[_0xa367('0x43')]['belongsTo'](db[_0xa367('0xf9')],{'as':_0xa367('0x17f'),'foreignKey':'ListId'});db[_0xa367('0x43')][_0xa367('0x12a')](db[_0xa367('0x130')],{'as':_0xa367('0x164'),'foreignKey':_0xa367('0x165')});db[_0xa367('0x43')][_0xa367('0x12a')](db['MailInteraction'],{});db[_0xa367('0x43')]['belongsTo'](db[_0xa367('0x16d')],{});db['MailQueueReport'][_0xa367('0x12a')](db[_0xa367('0x11')],{});db['MailQueueReport'][_0xa367('0x12a')](db[_0xa367('0x3d')],{});db[_0xa367('0x45')][_0xa367('0x11e')](db['DashboardItem'],{'as':'Items','onDelete':'cascade'});db[_0xa367('0x49')][_0xa367('0x11e')](db[_0xa367('0x81')],{'as':'Dispositions','foreignKey':_0xa367('0x180'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x49')]['hasMany'](db[_0xa367('0x7f')],{'as':_0xa367('0x16c'),'foreignKey':_0xa367('0x180')});db[_0xa367('0x49')][_0xa367('0x11e')](db[_0xa367('0x4c')],{'as':_0xa367('0x16e')});db[_0xa367('0x49')][_0xa367('0x11e')](db[_0xa367('0x4a')],{'as':_0xa367('0x14d')});db['FaxAccount'][_0xa367('0x11e')](db[_0xa367('0x18')],{'as':_0xa367('0x181'),'onDelete':'cascade'});db['FaxAccount']['hasMany'](db['FaxMessage'],{'as':_0xa367('0x160')});db['FaxAccount']['belongsTo'](db[_0xa367('0x2a')],{'as':_0xa367('0x2a')});db['FaxAccount'][_0xa367('0x12a')](db[_0xa367('0xf9')],{'as':_0xa367('0x17f'),'foreignKey':_0xa367('0x182')});db[_0xa367('0x49')]['belongsTo'](db['Pause'],{'as':_0xa367('0x159'),'foreignKey':_0xa367('0x170')});db['FaxAccount'][_0xa367('0x12c')](db[_0xa367('0x11')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0xa367('0x4a')][_0xa367('0x12a')](db[_0xa367('0x11')],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0xa367('0x50')],{'onDelete':_0xa367('0x167')});db['FaxApplication']['belongsTo'](db[_0xa367('0x49')],{'onDelete':_0xa367('0x167')});db['FaxApplication']['belongsTo'](db['Tag'],{'onDelete':_0xa367('0x167'),'foreignKey':_0xa367('0x17e')});db['FaxInteraction'][_0xa367('0x11e')](db[_0xa367('0x4e')],{'as':_0xa367('0x160'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x183')});db[_0xa367('0x4c')][_0xa367('0x12a')](db[_0xa367('0x49')],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x180')});db[_0xa367('0x4c')]['belongsTo'](db['CmContact'],{'as':_0xa367('0x164'),'foreignKey':_0xa367('0x165')});db[_0xa367('0x4c')][_0xa367('0x12a')](db[_0xa367('0x11')],{'as':'Owner','foreignKey':_0xa367('0x11c')});db['FaxInteraction'][_0xa367('0x12c')](db[_0xa367('0x175')],{'through':_0xa367('0x184'),'as':_0xa367('0x177')});db[_0xa367('0x4c')][_0xa367('0x12c')](db[_0xa367('0x175')],{'through':_0xa367('0x184'),'as':_0xa367('0x178')});db[_0xa367('0x4c')][_0xa367('0x12c')](db[_0xa367('0x11')],{'as':_0xa367('0x179'),'through':_0xa367('0x138'),'foreignKey':_0xa367('0x183')});db[_0xa367('0x4e')][_0xa367('0x12a')](db[_0xa367('0x11')],{'onDelete':_0xa367('0x11b'),'as':_0xa367('0x11')});db[_0xa367('0x4e')]['belongsTo'](db[_0xa367('0x4c')],{'as':_0xa367('0x17a'),'foreignKey':_0xa367('0x183')});db[_0xa367('0x4e')][_0xa367('0x12a')](db[_0xa367('0x130')],{'onDelete':_0xa367('0x11b'),'as':_0xa367('0x164')});db[_0xa367('0x4e')][_0xa367('0x12a')](db[_0xa367('0xee')],{'as':_0xa367('0xee'),'foreignKey':_0xa367('0x185')});db[_0xa367('0x4e')][_0xa367('0x12a')](db['FaxAccount'],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x180')});db[_0xa367('0x50')][_0xa367('0x12c')](db[_0xa367('0x11')],{'as':_0xa367('0x15b'),'through':_0xa367('0x13e')});db[_0xa367('0x50')][_0xa367('0x12c')](db['Team'],{'through':_0xa367('0x186'),'as':_0xa367('0x15c')});db[_0xa367('0x52')]['belongsTo'](db[_0xa367('0x49')],{});db['FaxQueueReport'][_0xa367('0x12a')](db[_0xa367('0xf9')],{'as':_0xa367('0x17f'),'foreignKey':'ListId'});db['FaxQueueReport'][_0xa367('0x12a')](db['CmContact'],{'as':_0xa367('0x164'),'foreignKey':_0xa367('0x165')});db[_0xa367('0x52')][_0xa367('0x12a')](db[_0xa367('0x4c')],{});db['FaxQueueReport']['belongsTo'](db[_0xa367('0x4e')],{});db[_0xa367('0x52')][_0xa367('0x12a')](db[_0xa367('0x11')],{});db[_0xa367('0x52')]['belongsTo'](db[_0xa367('0x50')],{});db['SmsAccount'][_0xa367('0x11e')](db[_0xa367('0x81')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':'cascade'});db[_0xa367('0x54')][_0xa367('0x11e')](db[_0xa367('0x7f')],{'as':_0xa367('0x16c'),'foreignKey':_0xa367('0x187')});db[_0xa367('0x54')][_0xa367('0x11e')](db[_0xa367('0x59')],{'as':_0xa367('0x160'),'foreignKey':'SmsAccountId'});db[_0xa367('0x54')][_0xa367('0x11e')](db[_0xa367('0x57')],{'as':_0xa367('0x16e')});db['SmsAccount'][_0xa367('0x11e')](db['SmsApplication'],{'as':'Applications'});db[_0xa367('0x54')][_0xa367('0x12a')](db[_0xa367('0xf9')],{'as':_0xa367('0x17f'),'foreignKey':'ListId'});db[_0xa367('0x54')][_0xa367('0x12a')](db[_0xa367('0x158')],{'as':'mandatoryDispositionPause','foreignKey':_0xa367('0x170')});db['SmsAccount']['belongsToMany'](db[_0xa367('0x11')],{'as':_0xa367('0x15b'),'through':_0xa367('0x147')});db[_0xa367('0x188')]['belongsTo'](db[_0xa367('0x11')],{'onDelete':_0xa367('0x167')});db[_0xa367('0x188')][_0xa367('0x12a')](db['SmsQueue'],{'onDelete':_0xa367('0x167')});db[_0xa367('0x188')][_0xa367('0x12a')](db['SmsAccount'],{'onDelete':_0xa367('0x167')});db[_0xa367('0x188')][_0xa367('0x12a')](db['Interval'],{'onDelete':_0xa367('0x167'),'foreignKey':_0xa367('0x157')});db[_0xa367('0x188')]['belongsTo'](db[_0xa367('0x175')],{'onDelete':_0xa367('0x167'),'foreignKey':_0xa367('0x17e')});db[_0xa367('0x57')][_0xa367('0x11e')](db[_0xa367('0x59')],{'as':'Messages','onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x189')});db['SmsInteraction'][_0xa367('0x12a')](db[_0xa367('0x54')],{'as':_0xa367('0x174'),'foreignKey':'SmsAccountId'});db['SmsInteraction'][_0xa367('0x12a')](db['CmContact'],{'as':'Contact','foreignKey':_0xa367('0x165')});db[_0xa367('0x57')][_0xa367('0x12a')](db[_0xa367('0x11')],{'as':'Owner','foreignKey':_0xa367('0x11c')});db[_0xa367('0x57')][_0xa367('0x12c')](db[_0xa367('0x175')],{'through':_0xa367('0x18a'),'as':_0xa367('0x177')});db['SmsInteraction'][_0xa367('0x12c')](db[_0xa367('0x175')],{'through':_0xa367('0x18a'),'as':'ThroughTags'});db[_0xa367('0x57')][_0xa367('0x12c')](db[_0xa367('0x11')],{'as':_0xa367('0x179'),'through':_0xa367('0x18b'),'foreignKey':_0xa367('0x189')});db[_0xa367('0x59')]['belongsTo'](db['User'],{'as':_0xa367('0x11')});db[_0xa367('0x59')][_0xa367('0x12a')](db[_0xa367('0x130')],{'onDelete':'cascade','as':_0xa367('0x164')});db[_0xa367('0x59')][_0xa367('0x12a')](db[_0xa367('0x57')],{'onDelete':_0xa367('0x11b'),'as':_0xa367('0x17a'),'foreignKey':'SmsInteractionId'});db[_0xa367('0x59')]['belongsTo'](db[_0xa367('0x54')],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x187')});db[_0xa367('0x5a')][_0xa367('0x12c')](db['User'],{'as':_0xa367('0x15b'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0xa367('0x5a')][_0xa367('0x12c')](db[_0xa367('0xe7')],{'through':_0xa367('0x18c'),'as':_0xa367('0x15c')});db['OpenchannelAccount'][_0xa367('0x11e')](db['Disposition'],{'as':_0xa367('0x16b'),'foreignKey':_0xa367('0x18d'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x5b')][_0xa367('0x11e')](db[_0xa367('0x7f')],{'as':'Answers','foreignKey':_0xa367('0x18d')});db[_0xa367('0x5b')][_0xa367('0x11e')](db[_0xa367('0x5e')],{'as':'Interactions','foreignKey':_0xa367('0x18d')});db[_0xa367('0x5b')][_0xa367('0x11e')](db['OpenchannelMessage'],{'as':_0xa367('0x160'),'foreignKey':_0xa367('0x18d')});db['OpenchannelAccount'][_0xa367('0x11e')](db[_0xa367('0x5c')],{'as':_0xa367('0x14d'),'foreignKey':_0xa367('0x18d')});db[_0xa367('0x5b')][_0xa367('0x12a')](db[_0xa367('0xf9')],{'as':_0xa367('0x17f'),'foreignKey':_0xa367('0x182')});db['OpenchannelAccount'][_0xa367('0x12a')](db[_0xa367('0x158')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount'][_0xa367('0x12c')](db[_0xa367('0x11')],{'as':_0xa367('0x15b'),'through':_0xa367('0x18e')});db[_0xa367('0x5c')][_0xa367('0x12a')](db[_0xa367('0x11')],{'onDelete':_0xa367('0x167')});db[_0xa367('0x5c')][_0xa367('0x12a')](db[_0xa367('0x140')],{'onDelete':'restrict','foreignKey':_0xa367('0x18f')});db['OpenchannelApplication'][_0xa367('0x12a')](db[_0xa367('0x5b')],{'onDelete':_0xa367('0x167'),'foreignKey':_0xa367('0x18d')});db[_0xa367('0x5c')][_0xa367('0x12a')](db['Interval'],{'onDelete':_0xa367('0x167'),'foreignKey':'IntervalId'});db[_0xa367('0x5c')][_0xa367('0x12a')](db[_0xa367('0x175')],{'onDelete':_0xa367('0x167'),'foreignKey':'TagId'});db[_0xa367('0x5e')][_0xa367('0x11e')](db[_0xa367('0x60')],{'as':_0xa367('0x160'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x190')});db[_0xa367('0x5e')][_0xa367('0x12a')](db['OpenchannelAccount'],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x18d')});db[_0xa367('0x5e')][_0xa367('0x12a')](db[_0xa367('0x130')],{'as':_0xa367('0x164'),'foreignKey':'ContactId'});db['OpenchannelInteraction'][_0xa367('0x12a')](db[_0xa367('0x11')],{'as':_0xa367('0x191'),'foreignKey':_0xa367('0x11c')});db['OpenchannelInteraction'][_0xa367('0x12c')](db[_0xa367('0x175')],{'through':'openchannel_interaction_has_tags','as':_0xa367('0x177')});db[_0xa367('0x5e')][_0xa367('0x12c')](db['Tag'],{'through':_0xa367('0x192'),'as':'ThroughTags'});db[_0xa367('0x5e')]['belongsToMany'](db[_0xa367('0x11')],{'as':_0xa367('0x179'),'through':_0xa367('0x193'),'foreignKey':_0xa367('0x190')});db[_0xa367('0x60')][_0xa367('0x12a')](db[_0xa367('0x11')],{'onDelete':_0xa367('0x11b'),'as':'User'});db[_0xa367('0x60')][_0xa367('0x12a')](db[_0xa367('0x130')],{'onDelete':_0xa367('0x11b'),'as':'Contact'});db[_0xa367('0x60')][_0xa367('0x12a')](db[_0xa367('0x5e')],{'onDelete':_0xa367('0x11b'),'as':_0xa367('0x17a'),'foreignKey':'OpenchannelInteractionId'});db[_0xa367('0x60')]['belongsTo'](db[_0xa367('0xee')],{'as':_0xa367('0xee'),'foreignKey':_0xa367('0x185')});db[_0xa367('0x60')][_0xa367('0x12a')](db[_0xa367('0x5b')],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x18d')});db[_0xa367('0x140')][_0xa367('0x12c')](db[_0xa367('0x11')],{'as':_0xa367('0x15b'),'through':_0xa367('0x35'),'foreignKey':_0xa367('0x18f')});db[_0xa367('0x140')][_0xa367('0x12c')](db[_0xa367('0xe7')],{'through':'team_has_openchannel_queues','as':_0xa367('0x15c')});db[_0xa367('0x63')][_0xa367('0x11e')](db['Disposition'],{'as':_0xa367('0x16b'),'foreignKey':'ChatWebsiteId','onDelete':_0xa367('0x11b')});db[_0xa367('0x63')][_0xa367('0x11e')](db['CannedAnswer'],{'as':_0xa367('0x16c'),'foreignKey':_0xa367('0x17b')});db[_0xa367('0x63')][_0xa367('0x11e')](db[_0xa367('0x6e')],{'as':'ProactiveActions'});db[_0xa367('0x63')][_0xa367('0x11e')](db[_0xa367('0x67')],{'as':_0xa367('0x16e')});db[_0xa367('0x63')][_0xa367('0x11e')](db[_0xa367('0x65')],{'as':_0xa367('0x14d')});db[_0xa367('0x63')][_0xa367('0x11e')](db['ChatMessage'],{'as':'Messages'});db['ChatWebsite'][_0xa367('0x12a')](db[_0xa367('0xf9')],{'as':_0xa367('0x17f'),'foreignKey':_0xa367('0x182')});db['ChatWebsite'][_0xa367('0x12a')](db[_0xa367('0x84')],{'as':_0xa367('0x84'),'foreignKey':_0xa367('0x157')});db['ChatWebsite'][_0xa367('0x12a')](db['MailAccount'],{'as':_0xa367('0x3c'),'foreignKey':_0xa367('0x168')});db[_0xa367('0x63')][_0xa367('0x12a')](db[_0xa367('0x158')],{'as':_0xa367('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0xa367('0x12c')](db[_0xa367('0x11')],{'as':_0xa367('0x15b'),'through':_0xa367('0x143')});db['OpenchannelQueueReport'][_0xa367('0x12a')](db[_0xa367('0x5b')],{});db[_0xa367('0x194')][_0xa367('0x12a')](db['CmList'],{'as':_0xa367('0x17f'),'foreignKey':_0xa367('0x182')});db[_0xa367('0x194')][_0xa367('0x12a')](db['CmContact'],{'as':_0xa367('0x164'),'foreignKey':'ContactId'});db[_0xa367('0x194')][_0xa367('0x12a')](db['OpenchannelInteraction'],{});db[_0xa367('0x194')]['belongsTo'](db[_0xa367('0x60')],{});db[_0xa367('0x194')][_0xa367('0x12a')](db[_0xa367('0x11')],{});db[_0xa367('0x194')][_0xa367('0x12a')](db[_0xa367('0x140')],{});db['ChatApplication'][_0xa367('0x12a')](db[_0xa367('0x11')],{'as':'Agent','foreignKey':'UserId','onDelete':_0xa367('0x167')});db[_0xa367('0x65')][_0xa367('0x12a')](db[_0xa367('0x6b')],{'as':_0xa367('0x195'),'foreignKey':_0xa367('0x196'),'onDelete':_0xa367('0x167')});db[_0xa367('0x65')][_0xa367('0x12a')](db[_0xa367('0x63')],{'as':_0xa367('0x197'),'foreignKey':_0xa367('0x17b'),'onDelete':_0xa367('0x167')});db[_0xa367('0x65')]['belongsTo'](db[_0xa367('0x175')],{'onDelete':_0xa367('0x167'),'foreignKey':_0xa367('0x17e')});db['ChatInteraction'][_0xa367('0x11e')](db[_0xa367('0x68')],{'as':_0xa367('0x160'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x198')});db[_0xa367('0x67')][_0xa367('0x12a')](db[_0xa367('0x63')],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x17b')});db[_0xa367('0x67')]['belongsTo'](db[_0xa367('0x130')],{'as':_0xa367('0x164'),'foreignKey':_0xa367('0x165')});db[_0xa367('0x67')][_0xa367('0x12a')](db[_0xa367('0x11')],{'as':'Owner','foreignKey':_0xa367('0x11c')});db[_0xa367('0x67')][_0xa367('0x12c')](db[_0xa367('0x175')],{'through':_0xa367('0x199'),'as':'Tags'});db[_0xa367('0x67')]['belongsToMany'](db[_0xa367('0x175')],{'through':_0xa367('0x199'),'as':_0xa367('0x178')});db['ChatInteraction']['belongsToMany'](db[_0xa367('0x11')],{'as':_0xa367('0x179'),'through':_0xa367('0x19a'),'foreignKey':'ChatInteractionId'});db[_0xa367('0x68')]['belongsTo'](db[_0xa367('0x11')],{'onDelete':_0xa367('0x11b'),'as':_0xa367('0x11')});db[_0xa367('0x68')][_0xa367('0x12a')](db['CmContact'],{'onDelete':'cascade','as':_0xa367('0x164'),'foreignKey':_0xa367('0x165')});db[_0xa367('0x68')][_0xa367('0x12a')](db[_0xa367('0x67')],{'onDelete':_0xa367('0x11b'),'as':_0xa367('0x17a'),'foreignKey':_0xa367('0x198')});db[_0xa367('0x68')][_0xa367('0x12a')](db[_0xa367('0xee')],{'as':_0xa367('0xee'),'foreignKey':_0xa367('0x185')});db[_0xa367('0x68')]['belongsTo'](db['ChatWebsite'],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x17b')});db['ChatOfflineMessage'][_0xa367('0x11e')](db[_0xa367('0xee')],{'as':_0xa367('0x19b'),'foreignKey':_0xa367('0x17d'),'onDelete':'cascade','hooks':!![]});db[_0xa367('0x17c')]['belongsTo'](db[_0xa367('0x130')],{'onDelete':_0xa367('0x11b'),'as':_0xa367('0x164'),'foreignKey':_0xa367('0x165')});db[_0xa367('0x17c')][_0xa367('0x12a')](db[_0xa367('0x63')],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x17b')});db['ChatQueue'][_0xa367('0x12c')](db['User'],{'as':_0xa367('0x15b'),'through':_0xa367('0x2f'),'hooks':!![]});db[_0xa367('0x6b')][_0xa367('0x12c')](db[_0xa367('0xe7')],{'through':_0xa367('0x19c'),'as':_0xa367('0x15c')});db[_0xa367('0x12d')][_0xa367('0x11e')](db['ChatInternalMessage'],{'as':_0xa367('0x160'),'foreignKey':_0xa367('0x19d'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x12d')][_0xa367('0x12c')](db['User'],{'as':_0xa367('0x19e'),'through':_0xa367('0x12f')});db['ChatProactiveAction'][_0xa367('0x12a')](db[_0xa367('0x63')],{'as':'Website','foreignKey':_0xa367('0x17b')});db[_0xa367('0x70')][_0xa367('0x11e')](db[_0xa367('0x130')],{'as':'Contacts','foreignKey':_0xa367('0x19f')});db[_0xa367('0x130')][_0xa367('0x11e')](db[_0xa367('0x73')],{'as':_0xa367('0x1a0'),'foreignKey':_0xa367('0x165')});db[_0xa367('0x130')][_0xa367('0x11e')](db[_0xa367('0x122')],{'as':'HopperFinals','foreignKey':_0xa367('0x165')});db['CmContact']['hasMany'](db[_0xa367('0x77')],{'as':_0xa367('0x151'),'foreignKey':_0xa367('0x165')});db[_0xa367('0x130')]['hasMany'](db[_0xa367('0x79')],{'as':_0xa367('0x79'),'foreignKey':_0xa367('0x165')});db[_0xa367('0x130')][_0xa367('0x11e')](db['JscriptySessionReport'],{'as':_0xa367('0x153'),'foreignKey':_0xa367('0x165')});db['CmContact'][_0xa367('0x11e')](db[_0xa367('0x5e')],{'as':_0xa367('0x125'),'foreignKey':_0xa367('0x165'),'onDelete':_0xa367('0x167')});db['CmContact'][_0xa367('0x11e')](db[_0xa367('0x67')],{'as':_0xa367('0x136'),'foreignKey':_0xa367('0x165'),'onDelete':_0xa367('0x167')});db[_0xa367('0x130')]['hasMany'](db[_0xa367('0x57')],{'as':_0xa367('0x126'),'foreignKey':_0xa367('0x165'),'onDelete':_0xa367('0x167')});db[_0xa367('0x130')]['hasMany'](db['FaxInteraction'],{'as':_0xa367('0x137'),'foreignKey':'ContactId','onDelete':_0xa367('0x167')});db[_0xa367('0x130')][_0xa367('0x11e')](db[_0xa367('0x3f')],{'as':_0xa367('0x127'),'foreignKey':_0xa367('0x165'),'onDelete':'restrict'});db['CmContact'][_0xa367('0x12a')](db['CmCompany'],{'as':_0xa367('0x1a1'),'foreignKey':_0xa367('0x19f')});db[_0xa367('0x130')][_0xa367('0x12a')](db[_0xa367('0xf9')],{'as':_0xa367('0x17f'),'foreignKey':_0xa367('0x182'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x130')][_0xa367('0x12c')](db[_0xa367('0x11')],{'as':_0xa367('0x179'),'through':'cm_user_has_contacts'});db['CmContact']['belongsToMany'](db[_0xa367('0x175')],{'as':'Tags','through':_0xa367('0x1a2')});db[_0xa367('0x130')][_0xa367('0x12c')](db[_0xa367('0x175')],{'through':_0xa367('0x1a2'),'as':'ThroughTags'});db['CmHopper'][_0xa367('0x12a')](db[_0xa367('0x130')],{'as':_0xa367('0x164'),'foreignKey':'ContactId','onDelete':_0xa367('0x11b')});db[_0xa367('0x73')][_0xa367('0x12a')](db['CmList'],{'as':'List','foreignKey':_0xa367('0x182'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x73')]['belongsTo'](db[_0xa367('0x11')],{'as':_0xa367('0x1a3'),'foreignKey':'UserId'});db[_0xa367('0x73')][_0xa367('0x12a')](db['VoiceQueue'],{'as':_0xa367('0x195'),'foreignKey':_0xa367('0x150'),'onDelete':'cascade'});db['CmHopper'][_0xa367('0x12a')](db['Campaign'],{'as':_0xa367('0x1a4'),'foreignKey':_0xa367('0x1a5'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x73')][_0xa367('0x12a')](db[_0xa367('0x11')],{'as':_0xa367('0x191'),'foreignKey':_0xa367('0x1a6')});db['CmHopperBlack']['belongsTo'](db[_0xa367('0x130')],{'as':_0xa367('0x164'),'foreignKey':_0xa367('0x165'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x74')][_0xa367('0x12a')](db[_0xa367('0xf9')],{'as':_0xa367('0x17f'),'foreignKey':_0xa367('0x182'),'onDelete':'cascade'});db[_0xa367('0x74')]['belongsTo'](db[_0xa367('0x1b')],{'as':_0xa367('0x195'),'foreignKey':_0xa367('0x150'),'onDelete':_0xa367('0x11b')});db['CmHopperBlack'][_0xa367('0x12a')](db[_0xa367('0x1a4')],{'as':'Campaign','foreignKey':_0xa367('0x1a5'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x7e')][_0xa367('0x11e')](db[_0xa367('0x1a7')],{'as':{'plural':_0xa367('0x1a8'),'singular':_0xa367('0x1a9')},'foreignKey':_0xa367('0x1aa'),'onDelete':_0xa367('0x11b'),'hooks':!![]});db[_0xa367('0x7e')][_0xa367('0x11e')](db['Condition'],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0xa367('0x1ab'),'onDelete':_0xa367('0x11b'),'hooks':!![]});db[_0xa367('0x7e')]['hasMany'](db[_0xa367('0x7c')],{'as':'Actions','foreignKey':_0xa367('0x1ac'),'onDelete':'cascade','hooks':!![]});db[_0xa367('0x81')]['hasMany'](db[_0xa367('0x81')],{'as':_0xa367('0x16b'),'foreignKey':_0xa367('0x1ad'),'onDelete':'cascade'});db['Interval'][_0xa367('0x11e')](db[_0xa367('0x84')],{'as':'Intervals','foreignKey':_0xa367('0x157'),'onDelete':_0xa367('0x11b'),'hooks':!![],'required':![]});db['Interval'][_0xa367('0x11e')](db[_0xa367('0x18')],{'as':_0xa367('0x121'),'foreignKey':'IntervalId','onDelete':_0xa367('0x167')});db[_0xa367('0x84')][_0xa367('0x11e')](db[_0xa367('0x16f')],{'as':_0xa367('0x1ae'),'foreignKey':'IntervalId'});db[_0xa367('0x84')][_0xa367('0x11e')](db[_0xa367('0x65')],{'as':'ChatApplications','foreignKey':_0xa367('0x157')});db[_0xa367('0x84')][_0xa367('0x11e')](db[_0xa367('0x4a')],{'as':_0xa367('0x1af'),'foreignKey':'IntervalId'});db[_0xa367('0x84')][_0xa367('0x11e')](db[_0xa367('0x188')],{'as':_0xa367('0x1b0'),'foreignKey':'IntervalId'});db[_0xa367('0x1b1')][_0xa367('0x12a')](db[_0xa367('0x3c')],{});db[_0xa367('0x1b1')]['belongsTo'](db[_0xa367('0x97')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xa367('0x12a')](db[_0xa367('0x95')],{'foreignKey':_0xa367('0x1b2')});db[_0xa367('0x89')][_0xa367('0x12c')](db[_0xa367('0x14e')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xa367('0x167')});db[_0xa367('0x175')][_0xa367('0x12c')](db[_0xa367('0x130')],{'through':_0xa367('0x1a2')});db[_0xa367('0x175')]['belongsToMany'](db[_0xa367('0x67')],{'through':'chat_interaction_has_tags'});db['Tag'][_0xa367('0x12c')](db['MailInteraction'],{'through':_0xa367('0x176')});db[_0xa367('0x175')][_0xa367('0x12c')](db[_0xa367('0x57')],{'through':_0xa367('0x18a')});db[_0xa367('0x175')][_0xa367('0x12c')](db[_0xa367('0x4c')],{'through':_0xa367('0x184')});db[_0xa367('0x175')][_0xa367('0x12c')](db[_0xa367('0x5e')],{'through':_0xa367('0x192')});db[_0xa367('0x175')][_0xa367('0x12c')](db[_0xa367('0x107')],{'through':_0xa367('0x1b3')});db[_0xa367('0x1b4')][_0xa367('0x11e')](db['Condition'],{'as':{'plural':_0xa367('0x1b5'),'singular':'AllCondition'},'foreignKey':_0xa367('0x1b6'),'onDelete':'cascade','hooks':!![]});db[_0xa367('0x1b4')]['hasMany'](db[_0xa367('0x1a7')],{'as':{'plural':_0xa367('0x1b7'),'singular':_0xa367('0x1b8')},'foreignKey':_0xa367('0x1b9'),'onDelete':_0xa367('0x11b'),'hooks':!![]});db[_0xa367('0x1b4')][_0xa367('0x11e')](db[_0xa367('0x7c')],{'as':_0xa367('0x1ba'),'foreignKey':_0xa367('0x1bb'),'onDelete':_0xa367('0x11b'),'hooks':!![]});db[_0xa367('0x95')][_0xa367('0x11e')](db['AnalyticFieldReport'],{'as':_0xa367('0x1bc'),'onDelete':_0xa367('0x11b'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xa367('0x97')][_0xa367('0x11e')](db[_0xa367('0x1bd')],{'as':_0xa367('0x1bc'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1be')});db[_0xa367('0x9a')][_0xa367('0x11e')](db['AnalyticFieldReport'],{'as':_0xa367('0x1bc'),'onDelete':'cascade','foreignKey':_0xa367('0x1bf')});db['AnalyticFieldReport'][_0xa367('0x12a')](db[_0xa367('0x9a')],{'foreignKey':_0xa367('0x1bf')});db[_0xa367('0x9f')][_0xa367('0x11e')](db[_0xa367('0xa0')],{'as':_0xa367('0x1c0'),'onDelete':'cascade','foreignKey':_0xa367('0x1c1')});db[_0xa367('0xa0')]['hasMany'](db['SalesforceField'],{'as':_0xa367('0x1c2'),'onDelete':'cascade','foreignKey':_0xa367('0x1c3')});db['SalesforceConfiguration']['hasMany'](db[_0xa367('0xa2')],{'as':_0xa367('0x1c4'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c5')});db[_0xa367('0xa0')][_0xa367('0x11e')](db[_0xa367('0xa2')],{'as':'Fields','onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c6')});db['SalesforceConfiguration'][_0xa367('0x12a')](db[_0xa367('0x9f')],{'as':_0xa367('0x174'),'foreignKey':'AccountId'});db[_0xa367('0xa2')][_0xa367('0x11e')](db[_0xa367('0xa2')],{'as':'Subject','foreignKey':_0xa367('0x1c3')});db['SalesforceField'][_0xa367('0x11e')](db[_0xa367('0xa2')],{'as':'Description','foreignKey':_0xa367('0x1c5')});db[_0xa367('0xa2')]['hasMany'](db['SalesforceField'],{'as':_0xa367('0x1c7'),'foreignKey':'FieldId'});db[_0xa367('0xa2')][_0xa367('0x12a')](db[_0xa367('0x8f')],{'as':_0xa367('0x8f'),'foreignKey':_0xa367('0x1c8')});db[_0xa367('0x1c9')]['hasMany'](db[_0xa367('0xa4')],{'as':_0xa367('0x1c0'),'onDelete':_0xa367('0x11b'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0xa367('0x11e')](db[_0xa367('0xa6')],{'as':'Subjects','onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c3')});db['SugarcrmConfiguration'][_0xa367('0x11e')](db[_0xa367('0xa6')],{'as':_0xa367('0x1c4'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c5')});db[_0xa367('0xa4')][_0xa367('0x11e')](db[_0xa367('0xa6')],{'as':_0xa367('0x1bc'),'onDelete':_0xa367('0x11b'),'foreignKey':'FieldId'});db[_0xa367('0xa4')][_0xa367('0x12a')](db[_0xa367('0x1c9')],{'as':'Account','foreignKey':'AccountId'});db[_0xa367('0xa6')]['hasMany'](db['SugarcrmField'],{'as':_0xa367('0x1ca'),'foreignKey':_0xa367('0x1c3')});db[_0xa367('0xa6')][_0xa367('0x11e')](db['SugarcrmField'],{'as':'Description','foreignKey':_0xa367('0x1c5')});db[_0xa367('0xa6')]['hasMany'](db[_0xa367('0xa6')],{'as':'Field','foreignKey':'FieldId'});db[_0xa367('0xa6')][_0xa367('0x12a')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0xa367('0xa8')]['hasMany'](db[_0xa367('0xaa')],{'as':_0xa367('0x1c0'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c1')});db[_0xa367('0xaa')][_0xa367('0x11e')](db[_0xa367('0xac')],{'as':_0xa367('0x1c2'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c3')});db[_0xa367('0xaa')][_0xa367('0x11e')](db[_0xa367('0xac')],{'as':'Descriptions','onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c5')});db[_0xa367('0xaa')]['hasMany'](db[_0xa367('0xac')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xa367('0x1c6')});db[_0xa367('0xaa')]['belongsTo'](db[_0xa367('0xa8')],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x1c1')});db[_0xa367('0xaa')][_0xa367('0x12c')](db['Tag'],{'through':_0xa367('0x1cb')});db[_0xa367('0xac')][_0xa367('0x11e')](db[_0xa367('0xac')],{'as':_0xa367('0x1ca'),'foreignKey':'SubjectId'});db[_0xa367('0xac')]['hasMany'](db[_0xa367('0xac')],{'as':_0xa367('0x1cc'),'foreignKey':'DescriptionId'});db[_0xa367('0xac')][_0xa367('0x11e')](db[_0xa367('0xac')],{'as':_0xa367('0x1c7'),'foreignKey':_0xa367('0x1c6')});db['DeskField']['belongsTo'](db[_0xa367('0x8f')],{'as':_0xa367('0x8f'),'foreignKey':_0xa367('0x1c8')});db[_0xa367('0xae')][_0xa367('0x11e')](db[_0xa367('0x1cd')],{'as':_0xa367('0x1c0'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c1')});db[_0xa367('0x1cd')][_0xa367('0x11e')](db[_0xa367('0x1ce')],{'as':_0xa367('0x1c2'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c3')});db[_0xa367('0x1cd')][_0xa367('0x11e')](db['ZohoField'],{'as':_0xa367('0x1c4'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c5')});db['ZohoConfiguration'][_0xa367('0x11e')](db[_0xa367('0x1ce')],{'as':'Fields','onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c6')});db['ZohoConfiguration'][_0xa367('0x12a')](db[_0xa367('0xae')],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x1c1')});db[_0xa367('0x1ce')][_0xa367('0x11e')](db[_0xa367('0x1ce')],{'as':'Subject','foreignKey':_0xa367('0x1c3')});db[_0xa367('0x1ce')]['hasMany'](db[_0xa367('0x1ce')],{'as':_0xa367('0x1cc'),'foreignKey':_0xa367('0x1c5')});db[_0xa367('0x1ce')][_0xa367('0x11e')](db[_0xa367('0x1ce')],{'as':_0xa367('0x1c7'),'foreignKey':_0xa367('0x1c6')});db[_0xa367('0x1ce')][_0xa367('0x12a')](db['Variable'],{'as':_0xa367('0x8f'),'foreignKey':_0xa367('0x1c8')});db[_0xa367('0xb0')][_0xa367('0x11e')](db[_0xa367('0xb1')],{'as':_0xa367('0x1c0'),'onDelete':_0xa367('0x11b'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xa367('0x11e')](db[_0xa367('0xb2')],{'as':_0xa367('0x1c2'),'foreignKey':_0xa367('0x1c3')});db[_0xa367('0xb1')][_0xa367('0x11e')](db['ZendeskField'],{'as':_0xa367('0x1c4'),'foreignKey':'DescriptionId'});db[_0xa367('0xb1')][_0xa367('0x11e')](db[_0xa367('0xb2')],{'as':'Fields','foreignKey':_0xa367('0x1c6')});db[_0xa367('0xb1')][_0xa367('0x12a')](db[_0xa367('0xb0')],{'as':'Account','foreignKey':_0xa367('0x1c1')});db[_0xa367('0xb1')][_0xa367('0x12c')](db[_0xa367('0x175')],{'through':_0xa367('0x1cf')});db[_0xa367('0xb2')][_0xa367('0x11e')](db[_0xa367('0xb2')],{'as':_0xa367('0x1ca'),'foreignKey':_0xa367('0x1c3')});db[_0xa367('0xb2')][_0xa367('0x11e')](db[_0xa367('0xb2')],{'as':'Description','foreignKey':_0xa367('0x1c5')});db['ZendeskField'][_0xa367('0x11e')](db[_0xa367('0xb2')],{'as':_0xa367('0x1c7'),'foreignKey':'FieldId'});db[_0xa367('0xb2')][_0xa367('0x12a')](db[_0xa367('0x8f')],{'as':'Variable','foreignKey':_0xa367('0x1c8')});db['FreshdeskAccount'][_0xa367('0x11e')](db[_0xa367('0xb6')],{'as':_0xa367('0x1c0'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xa367('0xb6')][_0xa367('0x11e')](db[_0xa367('0xb8')],{'as':_0xa367('0x1c2'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c3')});db[_0xa367('0xb6')][_0xa367('0x11e')](db['FreshdeskField'],{'as':_0xa367('0x1c4'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c5')});db['FreshdeskConfiguration'][_0xa367('0x11e')](db['FreshdeskField'],{'as':_0xa367('0x1bc'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c6')});db[_0xa367('0xb6')][_0xa367('0x12a')](db[_0xa367('0xb4')],{'as':'Account','foreignKey':_0xa367('0x1c1')});db[_0xa367('0xb6')][_0xa367('0x12c')](db[_0xa367('0x175')],{'through':_0xa367('0x1d0')});db[_0xa367('0xb8')][_0xa367('0x11e')](db[_0xa367('0xb8')],{'as':_0xa367('0x1ca'),'foreignKey':'SubjectId'});db[_0xa367('0xb8')][_0xa367('0x11e')](db[_0xa367('0xb8')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xa367('0xb8')][_0xa367('0x11e')](db[_0xa367('0xb8')],{'as':_0xa367('0x1c7'),'foreignKey':_0xa367('0x1c6')});db['FreshdeskField'][_0xa367('0x12a')](db[_0xa367('0x8f')],{'as':'Variable','foreignKey':_0xa367('0x1c8')});db['VtigerAccount']['hasMany'](db['VtigerConfiguration'],{'as':_0xa367('0x1c0'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c1')});db[_0xa367('0xbc')][_0xa367('0x11e')](db[_0xa367('0xbe')],{'as':_0xa367('0x1c2'),'foreignKey':'SubjectId'});db['VtigerConfiguration'][_0xa367('0x11e')](db['VtigerField'],{'as':_0xa367('0x1c4'),'foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0xa367('0x11e')](db['VtigerField'],{'as':_0xa367('0x1bc'),'foreignKey':_0xa367('0x1c6')});db[_0xa367('0xbc')][_0xa367('0x12a')](db[_0xa367('0xba')],{'as':_0xa367('0x174'),'foreignKey':'AccountId'});db[_0xa367('0xbe')][_0xa367('0x11e')](db[_0xa367('0xbe')],{'as':_0xa367('0x1ca'),'foreignKey':_0xa367('0x1c3')});db[_0xa367('0xbe')]['hasMany'](db[_0xa367('0xbe')],{'as':_0xa367('0x1cc'),'foreignKey':_0xa367('0x1c5')});db[_0xa367('0xbe')][_0xa367('0x11e')](db[_0xa367('0xbe')],{'as':'Field','foreignKey':_0xa367('0x1c6')});db[_0xa367('0xbe')][_0xa367('0x12a')](db['Variable'],{'as':_0xa367('0x8f'),'foreignKey':'VariableId'});db[_0xa367('0xbf')]['hasMany'](db[_0xa367('0xc0')],{'as':_0xa367('0x1c0'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1c1')});db[_0xa367('0xc0')][_0xa367('0x11e')](db[_0xa367('0xc2')],{'as':_0xa367('0x1c2'),'foreignKey':_0xa367('0x1c3')});db['ServicenowConfiguration'][_0xa367('0x11e')](db[_0xa367('0xc2')],{'as':_0xa367('0x1c4'),'foreignKey':_0xa367('0x1c5')});db['ServicenowConfiguration']['hasMany'](db[_0xa367('0xc2')],{'as':_0xa367('0x1bc'),'foreignKey':'FieldId'});db['ServicenowConfiguration'][_0xa367('0x12a')](db[_0xa367('0xbf')],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x1c1')});db[_0xa367('0xc2')][_0xa367('0x11e')](db['ServicenowField'],{'as':_0xa367('0x1ca'),'foreignKey':_0xa367('0x1c3')});db['ServicenowField'][_0xa367('0x11e')](db[_0xa367('0xc2')],{'as':_0xa367('0x1cc'),'foreignKey':_0xa367('0x1c5')});db[_0xa367('0xc2')]['hasMany'](db[_0xa367('0xc2')],{'as':'Field','foreignKey':_0xa367('0x1c6')});db['ServicenowField'][_0xa367('0x12a')](db[_0xa367('0x8f')],{'as':_0xa367('0x8f'),'foreignKey':_0xa367('0x1c8')});db['Dynamics365Account']['hasMany'](db[_0xa367('0xc4')],{'as':_0xa367('0x1c0'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xa367('0x1d1')][_0xa367('0x12a')](db[_0xa367('0x110')],{'as':_0xa367('0x110'),'foreignKey':_0xa367('0x166')});db[_0xa367('0xc4')][_0xa367('0x11e')](db[_0xa367('0xc6')],{'as':_0xa367('0x1c2'),'onDelete':'cascade','foreignKey':_0xa367('0x1c3')});db['Dynamics365Configuration'][_0xa367('0x11e')](db[_0xa367('0xc6')],{'as':'Descriptions','onDelete':_0xa367('0x11b'),'foreignKey':'DescriptionId'});db[_0xa367('0xc4')][_0xa367('0x11e')](db[_0xa367('0xc6')],{'as':_0xa367('0x1bc'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xa367('0xc4')][_0xa367('0x12a')](db[_0xa367('0x1d1')],{'as':'Account','foreignKey':_0xa367('0x1c1')});db[_0xa367('0xc6')]['hasMany'](db[_0xa367('0xc6')],{'as':_0xa367('0x1ca'),'foreignKey':_0xa367('0x1c3')});db['Dynamics365Field'][_0xa367('0x11e')](db[_0xa367('0xc6')],{'as':_0xa367('0x1cc'),'foreignKey':_0xa367('0x1c5')});db['Dynamics365Field'][_0xa367('0x11e')](db[_0xa367('0xc6')],{'as':'Field','foreignKey':_0xa367('0x1c6')});db['Dynamics365Field'][_0xa367('0x12a')](db[_0xa367('0x8f')],{'as':'Variable','foreignKey':_0xa367('0x1c8')});db[_0xa367('0xc7')][_0xa367('0x11e')](db[_0xa367('0xc9')],{'as':_0xa367('0x1c0'),'onDelete':_0xa367('0x11b'),'foreignKey':'AccountId'});db[_0xa367('0xc9')][_0xa367('0x11e')](db[_0xa367('0xcb')],{'as':_0xa367('0x1c2'),'foreignKey':_0xa367('0x1c3')});db[_0xa367('0xc9')]['hasMany'](db[_0xa367('0xcb')],{'as':_0xa367('0x1c4'),'foreignKey':_0xa367('0x1c5')});db[_0xa367('0xc9')]['hasMany'](db[_0xa367('0xcb')],{'as':_0xa367('0x1bc'),'foreignKey':_0xa367('0x1c6')});db[_0xa367('0xc9')]['belongsTo'](db[_0xa367('0xc7')],{'as':_0xa367('0x174'),'foreignKey':_0xa367('0x1c1')});db[_0xa367('0xcb')][_0xa367('0x11e')](db[_0xa367('0xcb')],{'as':_0xa367('0x1ca'),'foreignKey':_0xa367('0x1c3')});db['FreshsalesField'][_0xa367('0x11e')](db[_0xa367('0xcb')],{'as':_0xa367('0x1cc'),'foreignKey':_0xa367('0x1c5')});db[_0xa367('0xcb')]['hasMany'](db[_0xa367('0xcb')],{'as':_0xa367('0x1c7'),'foreignKey':_0xa367('0x1c6')});db[_0xa367('0xcb')][_0xa367('0x12a')](db[_0xa367('0x8f')],{'as':_0xa367('0x8f'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0xa367('0x12a')](db['ChatWebsite'],{});db[_0xa367('0xce')]['belongsTo'](db[_0xa367('0xf9')],{'as':'List','foreignKey':_0xa367('0x182')});db[_0xa367('0xce')][_0xa367('0x12a')](db[_0xa367('0x130')],{'as':_0xa367('0x164'),'foreignKey':_0xa367('0x165')});db[_0xa367('0xce')][_0xa367('0x12a')](db[_0xa367('0x67')],{});db[_0xa367('0xce')][_0xa367('0x12a')](db['ChatMessage'],{});db['ChatQueueReport'][_0xa367('0x12a')](db[_0xa367('0x11')],{});db[_0xa367('0xce')]['belongsTo'](db['ChatQueue'],{});db['ChatInternalMessage']['belongsTo'](db[_0xa367('0x11')],{'onDelete':_0xa367('0x11b'),'foreignKey':'FromId'});db[_0xa367('0xd0')][_0xa367('0x12a')](db['User'],{'onDelete':_0xa367('0x11b'),'foreignKey':'ToId'});db[_0xa367('0x152')][_0xa367('0x11e')](db[_0xa367('0xd4')],{'foreignKey':_0xa367('0x1d2'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x152')][_0xa367('0x11e')](db['JscriptyAnswerReport'],{'foreignKey':_0xa367('0x1d2'),'onDelete':_0xa367('0x11b')});db[_0xa367('0xd7')][_0xa367('0x12a')](db[_0xa367('0x54')],{});db[_0xa367('0xd7')][_0xa367('0x12a')](db['CmList'],{'as':_0xa367('0x17f'),'foreignKey':_0xa367('0x182')});db[_0xa367('0xd7')][_0xa367('0x12a')](db[_0xa367('0x130')],{'as':_0xa367('0x164'),'foreignKey':_0xa367('0x165')});db[_0xa367('0xd7')][_0xa367('0x12a')](db[_0xa367('0x57')],{});db[_0xa367('0xd7')][_0xa367('0x12a')](db[_0xa367('0x59')],{});db[_0xa367('0xd7')][_0xa367('0x12a')](db[_0xa367('0x11')],{});db[_0xa367('0xd7')][_0xa367('0x12a')](db['SmsQueue'],{});db[_0xa367('0xdd')][_0xa367('0x11e')](db['JscriptySessionReport'],{'foreignKey':_0xa367('0x1d3')});db[_0xa367('0xdd')][_0xa367('0x11e')](db[_0xa367('0xd4')],{'foreignKey':'ProjectId'});db[_0xa367('0xdd')]['hasMany'](db[_0xa367('0xd2')],{'foreignKey':_0xa367('0x1d3')});db[_0xa367('0xe1')]['belongsToMany'](db[_0xa367('0x11')],{'as':_0xa367('0x179'),'through':_0xa367('0x14b')});db[_0xa367('0xe7')]['belongsToMany'](db[_0xa367('0x11')],{'as':'Agents','through':_0xa367('0x134')});db[_0xa367('0xe7')][_0xa367('0x12c')](db[_0xa367('0x1b')],{'through':_0xa367('0x112'),'as':_0xa367('0x13b')});db[_0xa367('0xe7')][_0xa367('0x12c')](db[_0xa367('0x3d')],{'through':_0xa367('0x172'),'as':_0xa367('0x13c')});db[_0xa367('0xe7')][_0xa367('0x12c')](db[_0xa367('0x6b')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0xa367('0xe7')][_0xa367('0x12c')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0xa367('0x1d4')});db['Team'][_0xa367('0x12c')](db[_0xa367('0x5a')],{'through':_0xa367('0x18c'),'as':_0xa367('0x13f')});db[_0xa367('0xe7')][_0xa367('0x12c')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0xa367('0xe7')][_0xa367('0x12c')](db[_0xa367('0x10f')],{'through':_0xa367('0x1d5'),'as':_0xa367('0x1d6')});db[_0xa367('0xe7')]['belongsToMany'](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0xa367('0x1d7')});db[_0xa367('0x1a4')]['hasMany'](db[_0xa367('0x73')],{'as':_0xa367('0x1a0'),'foreignKey':'CampaignId'});db[_0xa367('0x1a4')][_0xa367('0x11e')](db[_0xa367('0x122')],{'as':_0xa367('0x123'),'foreignKey':'CampaignId'});db['Campaign'][_0xa367('0x11e')](db[_0xa367('0x77')],{'as':_0xa367('0x151'),'foreignKey':_0xa367('0x1a5')});db['Campaign'][_0xa367('0x11e')](db[_0xa367('0x74')],{'as':_0xa367('0x1d8'),'foreignKey':_0xa367('0x1a5')});db[_0xa367('0x1a4')][_0xa367('0x12a')](db[_0xa367('0x2a')],{'as':_0xa367('0x2a'),'foreignKey':'TrunkId'});db[_0xa367('0x1a4')][_0xa367('0x12a')](db[_0xa367('0x2a')],{'as':_0xa367('0x155'),'foreignKey':_0xa367('0x156')});db[_0xa367('0x1a4')][_0xa367('0x12a')](db[_0xa367('0x84')],{'as':'Interval','foreignKey':_0xa367('0x157')});db[_0xa367('0x1a4')][_0xa367('0x12a')](db['SquareProject'],{'as':_0xa367('0xe1'),'foreignKey':'SquareProjectId'});db[_0xa367('0x1a4')][_0xa367('0x12c')](db[_0xa367('0xf9')],{'as':_0xa367('0x132'),'through':_0xa367('0x1d9')});db[_0xa367('0x1a4')][_0xa367('0x12c')](db[_0xa367('0xf9')],{'as':_0xa367('0x15d'),'through':_0xa367('0x1da')});db[_0xa367('0xee')][_0xa367('0x12a')](db[_0xa367('0x17c')],{'as':'ChatOfflineMessage','foreignKey':_0xa367('0x17d')});db[_0xa367('0xf1')][_0xa367('0x12a')](db[_0xa367('0x16d')],{});db[_0xa367('0xf1')][_0xa367('0x12a')](db[_0xa367('0x3f')],{});db[_0xa367('0xf1')]['belongsTo'](db[_0xa367('0x3c')],{'foreignKey':'FromMailAccountId','as':_0xa367('0x1db')});db[_0xa367('0xf1')]['belongsTo'](db[_0xa367('0x11')],{'foreignKey':_0xa367('0x1dc'),'as':'FromAgent'});db[_0xa367('0xf1')][_0xa367('0x12a')](db[_0xa367('0x11')],{'foreignKey':_0xa367('0x1dd'),'as':_0xa367('0x1de')});db[_0xa367('0xf1')][_0xa367('0x12a')](db[_0xa367('0x3d')],{'foreignKey':_0xa367('0x1df'),'as':'ToQueue'});db[_0xa367('0xf1')]['belongsTo'](db[_0xa367('0x3c')],{'foreignKey':_0xa367('0x1e0'),'as':'ToAccount'});db[_0xa367('0xf2')]['belongsTo'](db[_0xa367('0x68')],{});db[_0xa367('0xf2')]['belongsTo'](db[_0xa367('0x67')],{});db['ChatTransferReport'][_0xa367('0x12a')](db[_0xa367('0x63')],{'foreignKey':'FromChatWebsiteId','as':_0xa367('0x1db')});db[_0xa367('0xf2')][_0xa367('0x12a')](db[_0xa367('0x11')],{'foreignKey':_0xa367('0x1dc'),'as':_0xa367('0x1e1')});db[_0xa367('0xf2')][_0xa367('0x12a')](db[_0xa367('0x11')],{'foreignKey':_0xa367('0x1dd'),'as':_0xa367('0x1de')});db[_0xa367('0xf2')][_0xa367('0x12a')](db[_0xa367('0x6b')],{'foreignKey':_0xa367('0x1e2'),'as':_0xa367('0x1e3')});db[_0xa367('0xf2')][_0xa367('0x12a')](db[_0xa367('0x63')],{'foreignKey':_0xa367('0x1e4'),'as':'ToAccount'});db[_0xa367('0xf4')]['belongsTo'](db[_0xa367('0x4e')],{});db[_0xa367('0xf4')][_0xa367('0x12a')](db[_0xa367('0x4c')],{});db['FaxTransferReport']['belongsTo'](db[_0xa367('0x49')],{'foreignKey':_0xa367('0x1e5'),'as':'FromAccount'});db['FaxTransferReport'][_0xa367('0x12a')](db[_0xa367('0x11')],{'foreignKey':_0xa367('0x1dc'),'as':'FromAgent'});db['FaxTransferReport'][_0xa367('0x12a')](db['User'],{'foreignKey':_0xa367('0x1dd'),'as':_0xa367('0x1de')});db[_0xa367('0xf4')][_0xa367('0x12a')](db[_0xa367('0x50')],{'foreignKey':'ToFaxQueueId','as':_0xa367('0x1e3')});db[_0xa367('0xf4')][_0xa367('0x12a')](db[_0xa367('0x49')],{'foreignKey':_0xa367('0x1e6'),'as':_0xa367('0x1e7')});db[_0xa367('0xf6')][_0xa367('0x12a')](db[_0xa367('0x60')],{});db[_0xa367('0xf6')][_0xa367('0x12a')](db[_0xa367('0x5e')],{});db[_0xa367('0xf6')]['belongsTo'](db[_0xa367('0x5b')],{'foreignKey':_0xa367('0x1e8'),'as':_0xa367('0x1db')});db['OpenchannelTransferReport'][_0xa367('0x12a')](db['User'],{'foreignKey':_0xa367('0x1dc'),'as':_0xa367('0x1e1')});db['OpenchannelTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xa367('0x1dd'),'as':_0xa367('0x1de')});db[_0xa367('0xf6')]['belongsTo'](db[_0xa367('0x140')],{'foreignKey':'ToOpenchannelQueueId','as':_0xa367('0x1e3')});db[_0xa367('0xf6')][_0xa367('0x12a')](db[_0xa367('0x5b')],{'foreignKey':_0xa367('0x1e9'),'as':_0xa367('0x1e7')});db[_0xa367('0x1ea')][_0xa367('0x12a')](db[_0xa367('0x59')],{});db[_0xa367('0x1ea')][_0xa367('0x12a')](db[_0xa367('0x57')],{});db[_0xa367('0x1ea')][_0xa367('0x12a')](db[_0xa367('0x54')],{'foreignKey':_0xa367('0x1eb'),'as':_0xa367('0x1db')});db[_0xa367('0x1ea')][_0xa367('0x12a')](db[_0xa367('0x11')],{'foreignKey':_0xa367('0x1dc'),'as':'FromAgent'});db[_0xa367('0x1ea')][_0xa367('0x12a')](db['User'],{'foreignKey':'ToUserId','as':_0xa367('0x1de')});db[_0xa367('0x1ea')]['belongsTo'](db[_0xa367('0x5a')],{'foreignKey':_0xa367('0x1ec'),'as':_0xa367('0x1e3')});db[_0xa367('0x1ea')][_0xa367('0x12a')](db[_0xa367('0x54')],{'foreignKey':_0xa367('0x1ed'),'as':_0xa367('0x1e7')});db['CmList'][_0xa367('0x11e')](db[_0xa367('0x81')],{'as':_0xa367('0x16b'),'foreignKey':_0xa367('0x182'),'onDelete':_0xa367('0x11b')});db['CmList'][_0xa367('0x11e')](db[_0xa367('0x7b')],{'as':'CustomFields','foreignKey':'ListId'});db[_0xa367('0xf9')][_0xa367('0x11e')](db[_0xa367('0x130')],{'as':'Contacts','onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x182')});db[_0xa367('0xf9')][_0xa367('0x11e')](db[_0xa367('0x122')],{'as':_0xa367('0x123'),'foreignKey':_0xa367('0x182')});db[_0xa367('0xf9')][_0xa367('0x11e')](db[_0xa367('0x77')],{'as':_0xa367('0x124'),'foreignKey':_0xa367('0x182')});db[_0xa367('0xf9')][_0xa367('0x11e')](db[_0xa367('0x79')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0xa367('0xf9')][_0xa367('0x12c')](db[_0xa367('0x1b')],{'as':_0xa367('0x1ee'),'through':'voice_queues_has_cm_lists'});db[_0xa367('0xf9')][_0xa367('0x12c')](db[_0xa367('0x11')],{'as':_0xa367('0x15b'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0xa367('0x11e')](db['VoiceExtension'],{'as':_0xa367('0x121'),'onDelete':_0xa367('0x11b')});db[_0xa367('0xfb')]['belongsToMany'](db[_0xa367('0x11')],{'as':'Agents','through':_0xa367('0x116')});db['VoicePrefix'][_0xa367('0x12c')](db[_0xa367('0xe7')],{'through':_0xa367('0x114'),'as':_0xa367('0x15c')});db[_0xa367('0xfd')][_0xa367('0x11e')](db[_0xa367('0x11')],{'as':_0xa367('0x179'),'foreignKey':_0xa367('0x12b')});db['UserProfile']['hasMany'](db[_0xa367('0xff')],{'as':_0xa367('0x1ef'),'foreignKey':_0xa367('0x12b'),'onDelete':_0xa367('0x11b')});db[_0xa367('0xff')][_0xa367('0x11e')](db['UserProfileResource'],{'as':_0xa367('0x1f0'),'foreignKey':_0xa367('0x1f1'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x104')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0xa367('0x1f2'),'onDelete':_0xa367('0x11b')});db[_0xa367('0x104')][_0xa367('0x11e')](db[_0xa367('0x7f')],{'as':_0xa367('0x16c'),'foreignKey':_0xa367('0x1f2')});db[_0xa367('0x104')][_0xa367('0x11e')](db[_0xa367('0x109')],{'as':_0xa367('0x160'),'foreignKey':_0xa367('0x1f2')});db[_0xa367('0x104')][_0xa367('0x11e')](db[_0xa367('0x107')],{'as':_0xa367('0x16e')});db[_0xa367('0x104')][_0xa367('0x11e')](db['WhatsappApplication'],{'as':'Applications'});db[_0xa367('0x104')][_0xa367('0x12a')](db[_0xa367('0xf9')],{'as':'List','foreignKey':_0xa367('0x182')});db[_0xa367('0x104')][_0xa367('0x12a')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa367('0x170')});db[_0xa367('0x104')][_0xa367('0x12c')](db['User'],{'as':_0xa367('0x15b'),'through':'user_has_whatsapp_accounts'});db[_0xa367('0x106')]['belongsTo'](db[_0xa367('0x11')],{'onDelete':_0xa367('0x167')});db[_0xa367('0x106')][_0xa367('0x12a')](db[_0xa367('0x10f')],{'onDelete':_0xa367('0x167')});db[_0xa367('0x106')][_0xa367('0x12a')](db[_0xa367('0x104')],{'onDelete':_0xa367('0x167')});db[_0xa367('0x106')][_0xa367('0x12a')](db[_0xa367('0x84')],{'onDelete':_0xa367('0x167'),'foreignKey':_0xa367('0x157')});db['WhatsappApplication'][_0xa367('0x12a')](db['Tag'],{'onDelete':_0xa367('0x167'),'foreignKey':_0xa367('0x17e')});db[_0xa367('0x107')][_0xa367('0x11e')](db['WhatsappMessage'],{'as':_0xa367('0x160'),'onDelete':_0xa367('0x11b'),'foreignKey':_0xa367('0x1f3')});db[_0xa367('0x107')][_0xa367('0x12a')](db[_0xa367('0x104')],{'as':'Account','foreignKey':_0xa367('0x1f2')});db['WhatsappInteraction'][_0xa367('0x12a')](db['CmContact'],{'as':_0xa367('0x164'),'foreignKey':_0xa367('0x165')});db['WhatsappInteraction'][_0xa367('0x12a')](db[_0xa367('0x11')],{'as':_0xa367('0x191'),'foreignKey':_0xa367('0x11c')});db[_0xa367('0x107')]['belongsToMany'](db[_0xa367('0x175')],{'through':_0xa367('0x1b3'),'as':_0xa367('0x177')});db['WhatsappInteraction'][_0xa367('0x12c')](db[_0xa367('0x175')],{'through':'whatsapp_interaction_has_tags','as':_0xa367('0x178')});db[_0xa367('0x107')]['belongsToMany'](db[_0xa367('0x11')],{'as':'Users','through':_0xa367('0x13a'),'foreignKey':_0xa367('0x1f3')});db[_0xa367('0x109')][_0xa367('0x12a')](db['User'],{'as':'User'});db[_0xa367('0x109')][_0xa367('0x12a')](db[_0xa367('0x130')],{'onDelete':_0xa367('0x11b'),'as':_0xa367('0x164')});db[_0xa367('0x109')][_0xa367('0x12a')](db[_0xa367('0x107')],{'onDelete':_0xa367('0x11b'),'as':_0xa367('0x17a'),'foreignKey':_0xa367('0x1f3')});db[_0xa367('0x109')][_0xa367('0x12a')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport']['belongsTo'](db[_0xa367('0x104')],{});db[_0xa367('0x10b')][_0xa367('0x12a')](db[_0xa367('0xf9')],{'as':_0xa367('0x17f'),'foreignKey':_0xa367('0x182')});db[_0xa367('0x10b')][_0xa367('0x12a')](db['CmContact'],{'as':_0xa367('0x164'),'foreignKey':'ContactId'});db['WhatsappQueueReport'][_0xa367('0x12a')](db[_0xa367('0x107')],{});db['WhatsappQueueReport'][_0xa367('0x12a')](db[_0xa367('0x10f')],{});db['WhatsappQueueReport'][_0xa367('0x12a')](db[_0xa367('0x109')],{});db[_0xa367('0x10b')][_0xa367('0x12a')](db[_0xa367('0x11')],{});db[_0xa367('0x10d')][_0xa367('0x12a')](db[_0xa367('0x109')],{});db[_0xa367('0x10d')][_0xa367('0x12a')](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0xa367('0x12a')](db[_0xa367('0x104')],{'foreignKey':'FromWhatsappAccountId','as':_0xa367('0x1db')});db[_0xa367('0x10d')][_0xa367('0x12a')](db[_0xa367('0x104')],{'foreignKey':_0xa367('0x1f4'),'as':_0xa367('0x1e7')});db[_0xa367('0x10d')]['belongsTo'](db[_0xa367('0x10f')],{'foreignKey':'ToQueueId','as':_0xa367('0x1e3')});db[_0xa367('0x10d')][_0xa367('0x12a')](db['User'],{'foreignKey':_0xa367('0x1dc'),'as':_0xa367('0x1e1')});db['WhatsappTransferReport'][_0xa367('0x12a')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['WhatsappQueue'][_0xa367('0x12c')](db[_0xa367('0x11')],{'as':_0xa367('0x15b'),'through':_0xa367('0x36'),'foreignKey':'WhatsappQueueId'});db[_0xa367('0x10f')][_0xa367('0x12c')](db[_0xa367('0xe7')],{'through':_0xa367('0x1d5'),'as':'Teams'});db['UserSetting'][_0xa367('0x12a')](db['User'],{'as':'user','foreignKey':_0xa367('0x11c'),'onDelete':'cascade','hooks':!![]});db['CloudProvider'][_0xa367('0x11a')](db['Dynamics365Account'],{'as':_0xa367('0x1d1'),'onDelete':'restrict'});db[_0xa367('0x110')][_0xa367('0x11a')](db[_0xa367('0x38')],{'as':_0xa367('0x169'),'onDelete':_0xa367('0x167')});db['CloudProvider'][_0xa367('0x11a')](db[_0xa367('0x3a')],{'as':_0xa367('0x16a'),'onDelete':'restrict'});module[_0xa367('0x1f5')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 4dc3e81..afcc451 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c4e=['/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','static','join','/apidoc','root','/demo','snippet','3.0.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','appPath','path','./errors','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/dashboard','/api/dashboards/items','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/sms/accounts','./api/smsAccount','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/action','/api/automations','./api/automation','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','./api/license'];(function(_0x56c016,_0x22c1e6){var _0x19db47=function(_0x16387d){while(--_0x16387d){_0x56c016['push'](_0x56c016['shift']());}};_0x19db47(++_0x22c1e6);}(_0x4c4e,0x152));var _0xe4c4=function(_0x53260a,_0x31db25){_0x53260a=_0x53260a-0x0;var _0x5dbeb0=_0x4c4e[_0x53260a];return _0x5dbeb0;};'use strict';var path=require(_0xe4c4('0x0'));var express=require('express');var errors=require(_0xe4c4('0x1'));var config=require(_0xe4c4('0x2'));var setupLoggers=require(_0xe4c4('0x3'))['setupLoggers'];var clientSideLogs=require(_0xe4c4('0x4'));exports[_0xe4c4('0x5')]=function(_0x1a4483){return setupLoggers(_0x1a4483)['then'](function(){_0x1a4483[_0xe4c4('0x6')]('/api/users',require(_0xe4c4('0x7')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x8'),require(_0xe4c4('0x9')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xa'),require(_0xe4c4('0xb')));_0x1a4483[_0xe4c4('0x6')]('/api/voice/extensions',require('./api/voiceExtension'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xc'),require(_0xe4c4('0xd')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xe'),require(_0xe4c4('0xf')));_0x1a4483['use'](_0xe4c4('0x10'),require(_0xe4c4('0x11')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x12'),require('./api/screenRecording'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x13'),require('./api/voiceMail'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x14'),require('./api/voiceMailMessage'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x15'),require('./api/voiceCallReport'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x16'),require(_0xe4c4('0x17')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x18'),require(_0xe4c4('0x19')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x1a'),require(_0xe4c4('0x1b')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x1c'),require(_0xe4c4('0x1d')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x1e'),require(_0xe4c4('0x1f')));_0x1a4483['use'](_0xe4c4('0x20'),require(_0xe4c4('0x21')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x22'),require('./api/mailServerOut'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x23'),require(_0xe4c4('0x24')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x25'),require(_0xe4c4('0x26')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x27'),require(_0xe4c4('0x28')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x29'),require(_0xe4c4('0x2a')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x2b'),require(_0xe4c4('0x2c')));_0x1a4483['use']('/api/mail/applications',require(_0xe4c4('0x2d')));_0x1a4483['use'](_0xe4c4('0x2e'),require('./api/mailQueueReport'));_0x1a4483[_0xe4c4('0x6')]('/api/dashboards',require(_0xe4c4('0x2f')));_0x1a4483['use'](_0xe4c4('0x30'),require('./api/dashboardItem'));_0x1a4483['use']('/api/fax/accounts',require('./api/faxAccount'));_0x1a4483[_0xe4c4('0x6')]('/api/fax/applications',require('./api/faxApplication'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x31'),require('./api/faxInteraction'));_0x1a4483['use'](_0xe4c4('0x32'),require(_0xe4c4('0x33')));_0x1a4483['use'](_0xe4c4('0x34'),require(_0xe4c4('0x35')));_0x1a4483[_0xe4c4('0x6')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x36'),require(_0xe4c4('0x37')));_0x1a4483[_0xe4c4('0x6')]('/api/sms/applications',require('./api/smsApplication'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x38'),require('./api/smsInteraction'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x39'),require(_0xe4c4('0x3a')));_0x1a4483['use'](_0xe4c4('0x3b'),require('./api/smsQueue'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x3c'),require(_0xe4c4('0x3d')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x3e'),require(_0xe4c4('0x3f')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x40'),require(_0xe4c4('0x41')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x42'),require(_0xe4c4('0x43')));_0x1a4483['use'](_0xe4c4('0x44'),require(_0xe4c4('0x45')));_0x1a4483[_0xe4c4('0x6')]('/api/chat/websites',require(_0xe4c4('0x46')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x47'),require('./api/openchannelQueueReport'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x48'),require(_0xe4c4('0x49')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x4a'),require(_0xe4c4('0x4b')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x4c'),require(_0xe4c4('0x4d')));_0x1a4483[_0xe4c4('0x6')]('/api/chat/offline_messages',require(_0xe4c4('0x4e')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x4f'),require(_0xe4c4('0x50')));_0x1a4483['use'](_0xe4c4('0x51'),require(_0xe4c4('0x52')));_0x1a4483['use'](_0xe4c4('0x53'),require(_0xe4c4('0x54')));_0x1a4483['use'](_0xe4c4('0x55'),require(_0xe4c4('0x56')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x57'),require(_0xe4c4('0x58')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x59'),require(_0xe4c4('0x5a')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x5b'),require(_0xe4c4('0x5c')));_0x1a4483[_0xe4c4('0x6')]('/api/cm/hopper_final',require(_0xe4c4('0x5d')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x5e'),require(_0xe4c4('0x5f')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x60'),require('./api/cmCustomField'));_0x1a4483[_0xe4c4('0x6')]('/api/actions',require(_0xe4c4('0x61')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x62'),require(_0xe4c4('0x63')));_0x1a4483[_0xe4c4('0x6')]('/api/canned_answers',require('./api/cannedAnswer'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x64'),require(_0xe4c4('0x65')));_0x1a4483['use'](_0xe4c4('0x66'),require(_0xe4c4('0x67')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x68'),require('./api/interval'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x69'),require(_0xe4c4('0x6a')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x6b'),require(_0xe4c4('0x6c')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x6d'),require(_0xe4c4('0x6e')));_0x1a4483['use'](_0xe4c4('0x6f'),require('./api/schedule'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x70'),require(_0xe4c4('0x71')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x72'),require(_0xe4c4('0x73')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x74'),require(_0xe4c4('0x75')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x76'),require(_0xe4c4('0x77')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x78'),require('./api/variable'));_0x1a4483['use'](_0xe4c4('0x79'),require(_0xe4c4('0x7a')));_0x1a4483['use'](_0xe4c4('0x7b'),require(_0xe4c4('0x7c')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x7d'),require(_0xe4c4('0x7e')));_0x1a4483['use'](_0xe4c4('0x7f'),require(_0xe4c4('0x80')));_0x1a4483['use'](_0xe4c4('0x81'),require(_0xe4c4('0x82')));_0x1a4483['use'](_0xe4c4('0x83'),require('./api/analyticMetric'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x84'),require(_0xe4c4('0x85')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x86'),require('./api/analyticTreeReport'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x87'),require(_0xe4c4('0x88')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x89'),require(_0xe4c4('0x8a')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x8b'),require(_0xe4c4('0x8c')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x8d'),require(_0xe4c4('0x8e')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x8f'),require(_0xe4c4('0x90')));_0x1a4483[_0xe4c4('0x6')]('/api/integrations/sugarcrm/fields',require(_0xe4c4('0x91')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x92'),require('./api/intDeskAccount'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x93'),require(_0xe4c4('0x94')));_0x1a4483['use'](_0xe4c4('0x95'),require('./api/intDeskField'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x96'),require(_0xe4c4('0x97')));_0x1a4483['use']('/api/integrations/zoho/configurations',require(_0xe4c4('0x98')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x99'),require('./api/intZohoField'));_0x1a4483[_0xe4c4('0x6')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x1a4483['use']('/api/integrations/zendesk/configurations',require(_0xe4c4('0x9a')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x9b'),require(_0xe4c4('0x9c')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x9d'),require('./api/intFreshdeskAccount'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x9e'),require(_0xe4c4('0x9f')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xa0'),require(_0xe4c4('0xa1')));_0x1a4483['use']('/api/integrations/vtiger/accounts',require(_0xe4c4('0xa2')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xa3'),require(_0xe4c4('0xa4')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xa5'),require(_0xe4c4('0xa6')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xa7'),require('./api/intServicenowAccount'));_0x1a4483['use'](_0xe4c4('0xa8'),require('./api/intServicenowConfiguration'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xa9'),require(_0xe4c4('0xaa')));_0x1a4483['use'](_0xe4c4('0xab'),require('./api/intDynamics365Account'));_0x1a4483[_0xe4c4('0x6')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xac'),require(_0xe4c4('0xad')));_0x1a4483['use']('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xae'),require('./api/intFreshsalesConfiguration'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xaf'),require(_0xe4c4('0xb0')));_0x1a4483['use']('/api/networks',require(_0xe4c4('0xb1')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xb2'),require(_0xe4c4('0xb3')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xb4'),require('./api/chatInternalMessage'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xb5'),require(_0xe4c4('0xb6')));_0x1a4483['use'](_0xe4c4('0xb7'),require(_0xe4c4('0xb8')));_0x1a4483[_0xe4c4('0x6')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x1a4483[_0xe4c4('0x6')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xb9'),require(_0xe4c4('0xba')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xbb'),require(_0xe4c4('0xbc')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xbd'),require('./api/jscriptyProject'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xbe'),require('./api/setting'));_0x1a4483['use'](_0xe4c4('0xbf'),require(_0xe4c4('0xc0')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xc1'),require('./api/squareProject'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xc2'),require(_0xe4c4('0xc3')));_0x1a4483['use']('/api/square/messages',require(_0xe4c4('0xc4')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xc5'),require(_0xe4c4('0xc6')));_0x1a4483['use']('/api/license',require(_0xe4c4('0xc7')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xc8'),require(_0xe4c4('0xc9')));_0x1a4483[_0xe4c4('0x6')]('/api/migrations',require(_0xe4c4('0xca')));_0x1a4483['use'](_0xe4c4('0xcb'),require(_0xe4c4('0xcc')));_0x1a4483['use']('/api/plugins',require(_0xe4c4('0xcd')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xce'),require(_0xe4c4('0xcf')));_0x1a4483[_0xe4c4('0x6')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x1a4483['use'](_0xe4c4('0xd0'),require(_0xe4c4('0xd1')));_0x1a4483['use'](_0xe4c4('0xd2'),require(_0xe4c4('0xd3')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xd4'),require('./api/smsTransferReport'));_0x1a4483['use'](_0xe4c4('0xd5'),require(_0xe4c4('0xd6')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xd7'),require(_0xe4c4('0xd8')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xd9'),require('./api/userProfile'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xda'),require(_0xe4c4('0xdb')));_0x1a4483[_0xe4c4('0x6')]('/api/userProfile/resources',require(_0xe4c4('0xdc')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xdd'),require(_0xe4c4('0xde')));_0x1a4483['use'](_0xe4c4('0xdf'),require(_0xe4c4('0xe0')));_0x1a4483['use']('/api/whatsapp/applications',require(_0xe4c4('0xe1')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xe2'),require(_0xe4c4('0xe3')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xe4'),require(_0xe4c4('0xe5')));_0x1a4483[_0xe4c4('0x6')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xe6'),require(_0xe4c4('0xe7')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xe8'),require('./api/whatsappQueue'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xe9'),require(_0xe4c4('0xea')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xeb'),require(_0xe4c4('0xec')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xed'),require(_0xe4c4('0xee')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xef'),require(_0xe4c4('0xf0')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xf1'),require(_0xe4c4('0xf2')));_0x1a4483[_0xe4c4('0x6')]('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x1a4483[_0xe4c4('0x6')]('/api/jira',require(_0xe4c4('0xf3')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xf4'),require(_0xe4c4('0xf5')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xf6'),require(_0xe4c4('0xf7')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xf8'),require(_0xe4c4('0xf9')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xfa'),require(_0xe4c4('0xfb')));_0x1a4483['use'](_0xe4c4('0xfc'),require(_0xe4c4('0xfd')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xfe'),clientSideLogs);_0x1a4483[_0xe4c4('0x6')]('/apidoc',express[_0xe4c4('0xff')](path[_0xe4c4('0x100')](config['root'],_0xe4c4('0x101'))));_0x1a4483[_0xe4c4('0x6')]('/www',express['static'](path['join'](config[_0xe4c4('0x102')],'/www')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x103'),express[_0xe4c4('0xff')](path['join'](config[_0xe4c4('0x102')],_0xe4c4('0x103'))));_0x1a4483[_0xe4c4('0x6')]('/snippet',express['static'](path['join'](config[_0xe4c4('0x102')],_0xe4c4('0x104'),_0xe4c4('0x105'))));_0x1a4483['use'](_0xe4c4('0x106'),express[_0xe4c4('0xff')](path[_0xe4c4('0x100')](config[_0xe4c4('0x102')],_0xe4c4('0x107'))));_0x1a4483['route'](_0xe4c4('0x108'))[_0xe4c4('0x109')](errors[0x194]);_0x1a4483[_0xe4c4('0x10a')]('/*')['get'](function(_0x157c61,_0x21d8ca){_0x21d8ca[_0xe4c4('0x10b')](path['resolve'](_0x1a4483[_0xe4c4('0x109')](_0xe4c4('0x10c'))+'/index.html'));});return _0x1a4483;});}; \ No newline at end of file +var _0x7dfd=['./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','./api/campaign','/api/migrations','./api/migration','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./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/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions'];(function(_0x468a77,_0x1382be){var _0x2d1c33=function(_0x2f2e83){while(--_0x2f2e83){_0x468a77['push'](_0x468a77['shift']());}};_0x2d1c33(++_0x1382be);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xd7df('0x0'));var express=require(_0xd7df('0x1'));var errors=require(_0xd7df('0x2'));var config=require(_0xd7df('0x3'));var setupLoggers=require(_0xd7df('0x4'))[_0xd7df('0x5')];var clientSideLogs=require(_0xd7df('0x6'));exports[_0xd7df('0x7')]=function(_0x3ef231){return setupLoggers(_0x3ef231)[_0xd7df('0x8')](function(){_0x3ef231[_0xd7df('0x9')](_0xd7df('0xa'),require(_0xd7df('0xb')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xc'),require(_0xd7df('0xd')));_0x3ef231[_0xd7df('0x9')]('/api/voice/contexts',require(_0xd7df('0xe')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xf'),require(_0xd7df('0x10')));_0x3ef231['use'](_0xd7df('0x11'),require('./api/voiceMusicOnHold'));_0x3ef231[_0xd7df('0x9')]('/api/voice/queues',require(_0xd7df('0x12')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x13'),require(_0xd7df('0x14')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x15'),require(_0xd7df('0x16')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x17'),require(_0xd7df('0x18')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x19'),require(_0xd7df('0x1a')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x1b'),require(_0xd7df('0x1c')));_0x3ef231[_0xd7df('0x9')]('/api/voice/dials/reports',require(_0xd7df('0x1d')));_0x3ef231[_0xd7df('0x9')]('/api/voice/agents/reports',require(_0xd7df('0x1e')));_0x3ef231[_0xd7df('0x9')]('/api/voice/queues/reports',require(_0xd7df('0x1f')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x20'),require('./api/memberReport'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x21'),require(_0xd7df('0x22')));_0x3ef231['use'](_0xd7df('0x23'),require(_0xd7df('0x24')));_0x3ef231[_0xd7df('0x9')]('/api/mail/out_servers',require(_0xd7df('0x25')));_0x3ef231['use'](_0xd7df('0x26'),require('./api/mailAccount'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x27'),require(_0xd7df('0x28')));_0x3ef231['use'](_0xd7df('0x29'),require('./api/mailSubstatus'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x2a'),require(_0xd7df('0x2b')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x2c'),require(_0xd7df('0x2d')));_0x3ef231[_0xd7df('0x9')]('/api/mail/applications',require('./api/mailApplication'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x2e'),require(_0xd7df('0x2f')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x30'),require(_0xd7df('0x31')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x32'),require(_0xd7df('0x33')));_0x3ef231['use'](_0xd7df('0x34'),require(_0xd7df('0x35')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x36'),require(_0xd7df('0x37')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x38'),require(_0xd7df('0x39')));_0x3ef231['use']('/api/fax/messages',require('./api/faxMessage'));_0x3ef231['use']('/api/fax/queues',require(_0xd7df('0x3a')));_0x3ef231['use'](_0xd7df('0x3b'),require(_0xd7df('0x3c')));_0x3ef231['use'](_0xd7df('0x3d'),require(_0xd7df('0x3e')));_0x3ef231['use'](_0xd7df('0x3f'),require(_0xd7df('0x40')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x41'),require(_0xd7df('0x42')));_0x3ef231[_0xd7df('0x9')]('/api/sms/messages',require(_0xd7df('0x43')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x44'),require(_0xd7df('0x45')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x46'),require(_0xd7df('0x47')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x48'),require(_0xd7df('0x49')));_0x3ef231[_0xd7df('0x9')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x3ef231[_0xd7df('0x9')]('/api/openchannel/messages',require(_0xd7df('0x4a')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x4b'),require(_0xd7df('0x4c')));_0x3ef231['use']('/api/chat/websites',require('./api/chatWebsite'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x4d'),require('./api/openchannelQueueReport'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x4e'),require(_0xd7df('0x4f')));_0x3ef231[_0xd7df('0x9')]('/api/chat/interactions',require(_0xd7df('0x50')));_0x3ef231[_0xd7df('0x9')]('/api/chat/messages',require(_0xd7df('0x51')));_0x3ef231['use'](_0xd7df('0x52'),require(_0xd7df('0x53')));_0x3ef231[_0xd7df('0x9')]('/api/chat/queues',require(_0xd7df('0x54')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x55'),require(_0xd7df('0x56')));_0x3ef231['use'](_0xd7df('0x57'),require(_0xd7df('0x58')));_0x3ef231[_0xd7df('0x9')]('/api/cm/companies',require(_0xd7df('0x59')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x5a'),require('./api/cmContact'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x5b'),require('./api/cmHopper'));_0x3ef231['use'](_0xd7df('0x5c'),require(_0xd7df('0x5d')));_0x3ef231[_0xd7df('0x9')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x3ef231[_0xd7df('0x9')]('/api/cm/hopper_history',require(_0xd7df('0x5e')));_0x3ef231['use']('/api/cm/custom_fields',require(_0xd7df('0x5f')));_0x3ef231['use'](_0xd7df('0x60'),require(_0xd7df('0x61')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x62'),require(_0xd7df('0x63')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x64'),require(_0xd7df('0x65')));_0x3ef231[_0xd7df('0x9')]('/api/dispositions',require(_0xd7df('0x66')));_0x3ef231['use'](_0xd7df('0x67'),require(_0xd7df('0x68')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x69'),require(_0xd7df('0x6a')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x6b'),require(_0xd7df('0x6c')));_0x3ef231[_0xd7df('0x9')]('/api/cdr',require(_0xd7df('0x6d')));_0x3ef231[_0xd7df('0x9')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x6e'),require(_0xd7df('0x6f')));_0x3ef231['use']('/api/sounds',require(_0xd7df('0x70')));_0x3ef231['use'](_0xd7df('0x71'),require(_0xd7df('0x72')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x73'),require(_0xd7df('0x74')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x75'),require(_0xd7df('0x76')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x77'),require(_0xd7df('0x78')));_0x3ef231[_0xd7df('0x9')]('/api/integrations',require(_0xd7df('0x79')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x7a'),require(_0xd7df('0x7b')));_0x3ef231[_0xd7df('0x9')]('/api/analytics/custom_reports',require(_0xd7df('0x7c')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x7d'),require('./api/analyticDefaultReport'));_0x3ef231[_0xd7df('0x9')]('/api/analytics/extracted_reports',require(_0xd7df('0x7e')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x7f'),require(_0xd7df('0x80')));_0x3ef231[_0xd7df('0x9')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x3ef231['use'](_0xd7df('0x81'),require('./api/analyticTreeReport'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x82'),require(_0xd7df('0x83')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x84'),require(_0xd7df('0x85')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x86'),require(_0xd7df('0x87')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x88'),require(_0xd7df('0x89')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x8a'),require(_0xd7df('0x8b')));_0x3ef231[_0xd7df('0x9')]('/api/integrations/sugarcrm/fields',require(_0xd7df('0x8c')));_0x3ef231[_0xd7df('0x9')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x3ef231[_0xd7df('0x9')]('/api/integrations/desk/configurations',require(_0xd7df('0x8d')));_0x3ef231['use'](_0xd7df('0x8e'),require(_0xd7df('0x8f')));_0x3ef231[_0xd7df('0x9')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x3ef231['use'](_0xd7df('0x90'),require(_0xd7df('0x91')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x92'),require(_0xd7df('0x93')));_0x3ef231[_0xd7df('0x9')]('/api/integrations/zendesk/accounts',require(_0xd7df('0x94')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x95'),require(_0xd7df('0x96')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x97'),require(_0xd7df('0x98')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x99'),require(_0xd7df('0x9a')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x9b'),require(_0xd7df('0x9c')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x9d'),require(_0xd7df('0x9e')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x9f'),require(_0xd7df('0xa0')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xa1'),require(_0xd7df('0xa2')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xa3'),require(_0xd7df('0xa4')));_0x3ef231[_0xd7df('0x9')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xa5'),require(_0xd7df('0xa6')));_0x3ef231['use'](_0xd7df('0xa7'),require(_0xd7df('0xa8')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xa9'),require('./api/intDynamics365Account'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xaa'),require(_0xd7df('0xab')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xac'),require(_0xd7df('0xad')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xae'),require('./api/intFreshsalesAccount'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xaf'),require('./api/intFreshsalesConfiguration'));_0x3ef231['use']('/api/integrations/freshsales/fields',require(_0xd7df('0xb0')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xb1'),require(_0xd7df('0xb2')));_0x3ef231['use'](_0xd7df('0xb3'),require(_0xd7df('0xb4')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xb5'),require(_0xd7df('0xb6')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xb7'),require('./api/jscriptyAnswerReport'));_0x3ef231['use'](_0xd7df('0xb8'),require('./api/jscriptyQuestionReport'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xb9'),require(_0xd7df('0xba')));_0x3ef231['use']('/api/sms/reports/queue',require(_0xd7df('0xbb')));_0x3ef231[_0xd7df('0x9')]('/api/square/reports',require(_0xd7df('0xbc')));_0x3ef231[_0xd7df('0x9')]('/api/square/details/reports',require(_0xd7df('0xbd')));_0x3ef231[_0xd7df('0x9')]('/api/jscripty/projects',require(_0xd7df('0xbe')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xbf'),require(_0xd7df('0xc0')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xc1'),require(_0xd7df('0xc2')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xc3'),require('./api/squareProject'));_0x3ef231['use'](_0xd7df('0xc4'),require(_0xd7df('0xc5')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xc6'),require(_0xd7df('0xc7')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xc8'),require(_0xd7df('0xc9')));_0x3ef231[_0xd7df('0x9')]('/api/license',require(_0xd7df('0xca')));_0x3ef231[_0xd7df('0x9')]('/api/campaigns',require(_0xd7df('0xcb')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xcc'),require(_0xd7df('0xcd')));_0x3ef231['use']('/api/attachments',require('./api/attachment'));_0x3ef231[_0xd7df('0x9')]('/api/plugins',require(_0xd7df('0xce')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xcf'),require(_0xd7df('0xd0')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xd1'),require('./api/chatTransferReport'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xd2'),require(_0xd7df('0xd3')));_0x3ef231['use'](_0xd7df('0xd4'),require(_0xd7df('0xd5')));_0x3ef231['use'](_0xd7df('0xd6'),require(_0xd7df('0xd7')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xd8'),require(_0xd7df('0xd9')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xda'),require('./api/voicePrefix'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xdb'),require(_0xd7df('0xdc')));_0x3ef231[_0xd7df('0x9')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xdd'),require(_0xd7df('0xde')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xdf'),require('./api/userNotification'));_0x3ef231[_0xd7df('0x9')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xe0'),require(_0xd7df('0xe1')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xe2'),require(_0xd7df('0xe3')));_0x3ef231['use']('/api/whatsapp/messages',require(_0xd7df('0xe4')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xe5'),require(_0xd7df('0xe6')));_0x3ef231['use'](_0xd7df('0xe7'),require('./api/whatsappTransferReport'));_0x3ef231[_0xd7df('0x9')]('/api/whatsapp/queues',require(_0xd7df('0xe8')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xe9'),require(_0xd7df('0xea')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xeb'),require('./api/realtime'));_0x3ef231[_0xd7df('0x9')]('/api/user-settings',require(_0xd7df('0xec')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xed'),require(_0xd7df('0xee')));_0x3ef231['use'](_0xd7df('0xef'),require(_0xd7df('0xf0')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xf1'),require(_0xd7df('0xf2')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xf3'),require(_0xd7df('0xf4')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xf5'),require(_0xd7df('0xf6')));_0x3ef231[_0xd7df('0x9')]('/api/version',require(_0xd7df('0xf7')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xf8'),require('./api/system'));_0x3ef231['use'](_0xd7df('0xf9'),require(_0xd7df('0xfa')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xfb'),require(_0xd7df('0xfc')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xfd'),clientSideLogs);_0x3ef231[_0xd7df('0x9')](_0xd7df('0xfe'),express[_0xd7df('0xff')](path['join'](config[_0xd7df('0x100')],_0xd7df('0xfe'))));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x101'),express[_0xd7df('0xff')](path[_0xd7df('0x102')](config['root'],'/www')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x103'),express[_0xd7df('0xff')](path[_0xd7df('0x102')](config[_0xd7df('0x100')],'/demo')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x104'),express[_0xd7df('0xff')](path[_0xd7df('0x102')](config[_0xd7df('0x100')],_0xd7df('0x105'),_0xd7df('0x106'))));_0x3ef231['use'](_0xd7df('0x107'),express['static'](path['join'](config[_0xd7df('0x100')],_0xd7df('0x108'))));_0x3ef231[_0xd7df('0x109')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xd7df('0x10a')](errors[0x194]);_0x3ef231['route']('/*')['get'](function(_0x327f5a,_0x3d439d){_0x3d439d[_0xd7df('0x10b')](path[_0xd7df('0x10c')](_0x3ef231[_0xd7df('0x10a')]('appPath')+'/index.html'));});return _0x3ef231;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 9395797..b223cc5 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f25=['../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/faxAccount/faxAccount.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','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/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/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x9f25,0x1b3));var _0x59f2=function(_0x17caca,_0x2bc731){_0x17caca=_0x17caca-0x0;var _0x1d9b18=_0x9f25[_0x17caca];return _0x1d9b18;};'use strict';var jayson=require(_0x59f2('0x0'));var _=require('lodash');var config=require(_0x59f2('0x1'));exports[_0x59f2('0x2')]=function(){return new Promise(function(_0x104709,_0x2ef99){var _0x465141={};_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x4')));_0x465141=_['merge'](_0x465141,require('../api/voiceExtension/voiceExtension.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x5')));_0x465141=_[_0x59f2('0x3')](_0x465141,require('../api/voiceRecording/voiceRecording.rpc'));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x6')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x7')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x8')));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x9')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0xa')));_0x465141=_['merge'](_0x465141,require(_0x59f2('0xb')));_0x465141=_[_0x59f2('0x3')](_0x465141,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0xc')));_0x465141=_['merge'](_0x465141,require(_0x59f2('0xd')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0xe')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0xf')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x10')));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x11')));_0x465141=_['merge'](_0x465141,require('../api/mailApplication/mailApplication.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x12')));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x13')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x14')));_0x465141=_[_0x59f2('0x3')](_0x465141,require('../api/faxMessage/faxMessage.rpc'));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x15')));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x16')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x17')));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x18')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x19')));_0x465141=_[_0x59f2('0x3')](_0x465141,require('../api/smsQueue/smsQueue.rpc'));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x1a')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x1b')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x1c')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x1d')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x1e')));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x1f')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x20')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x21')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x22')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x23')));_0x465141=_['merge'](_0x465141,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x24')));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x25')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x26')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x27')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x28')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x29')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x2a')));_0x465141=_['merge'](_0x465141,require('../api/trigger/trigger.rpc'));_0x465141=_['merge'](_0x465141,require('../api/variable/variable.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x2b')));_0x465141=_[_0x59f2('0x3')](_0x465141,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x2c')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x2d')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x2e')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x2f')));_0x465141=_[_0x59f2('0x3')](_0x465141,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x30')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x31')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x32')));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x33')));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x34')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x35')));_0x465141=_['merge'](_0x465141,require('../api/squareOdbc/squareOdbc.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x36')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x37')));_0x465141=_['merge'](_0x465141,require('../api/squareMessage/squareMessage.rpc'));_0x465141=_['merge'](_0x465141,require(_0x59f2('0x38')));_0x465141=_[_0x59f2('0x3')](_0x465141,require('../api/attachment/attachment.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require('../api/plugin/plugin.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x39')));_0x465141=_['merge'](_0x465141,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x3a')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x3b')));_0x465141=_[_0x59f2('0x3')](_0x465141,require(_0x59f2('0x3c')));var _0x5e7b93=jayson[_0x59f2('0x3d')](_0x465141)[_0x59f2('0x3e')]();var _0x22cf66=config[_0x59f2('0x3f')][_0x59f2('0x40')]||config['port']+0x1;var _0x392d69=config['rpc']['ip']||_0x59f2('0x41');_0x5e7b93['on']('error',function(_0x351822){return _0x2ef99(_0x351822);});_0x5e7b93[_0x59f2('0x2')](_0x22cf66,_0x392d69,function(){console[_0x59f2('0x42')](_0x59f2('0x43'),_0x392d69,_0x22cf66);require(_0x59f2('0x44'))['default']();return _0x104709('RPC\x20listening\x20on\x20'+_0x392d69+':'+_0x22cf66);});});}; \ No newline at end of file +var _0xc83d=['error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.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/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','http','rpc','port','localhost'];(function(_0x384f12,_0x3eae2e){var _0x3bc6b4=function(_0x53759b){while(--_0x53759b){_0x384f12['push'](_0x384f12['shift']());}};_0x3bc6b4(++_0x3eae2e);}(_0xc83d,0x1a8));var _0xdc83=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc83d[_0x59ee6f];return _0x4c0979;};'use strict';var jayson=require(_0xdc83('0x0'));var _=require(_0xdc83('0x1'));var config=require(_0xdc83('0x2'));exports['listen']=function(){return new Promise(function(_0x16085b,_0x67bc1b){var _0x3848de={};_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x4')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x5')));_0x3848de=_['merge'](_0x3848de,require(_0xdc83('0x6')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x7')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x8')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x9')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0xa')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0xb')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0xc')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0xd')));_0x3848de=_['merge'](_0x3848de,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require('../api/mailServerIn/mailServerIn.rpc'));_0x3848de=_['merge'](_0x3848de,require(_0xdc83('0xe')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0xf')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require('../api/mailInteraction/mailInteraction.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x10')));_0x3848de=_['merge'](_0x3848de,require(_0xdc83('0x11')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x12')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x13')));_0x3848de=_['merge'](_0x3848de,require('../api/faxApplication/faxApplication.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x14')));_0x3848de=_['merge'](_0x3848de,require(_0xdc83('0x15')));_0x3848de=_['merge'](_0x3848de,require(_0xdc83('0x16')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x17')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x18')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x19')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x1a')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x1b')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x1c')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x1d')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x3848de=_['merge'](_0x3848de,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x1e')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x1f')));_0x3848de=_['merge'](_0x3848de,require(_0xdc83('0x20')));_0x3848de=_['merge'](_0x3848de,require('../api/cmContact/cmContact.rpc'));_0x3848de=_['merge'](_0x3848de,require(_0xdc83('0x21')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x22')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x23')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x24')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x25')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x26')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x27')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x28')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require('../api/template/template.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x29')));_0x3848de=_['merge'](_0x3848de,require('../api/variable/variable.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x2a')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x2b')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x2c')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x2d')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x2e')));_0x3848de=_['merge'](_0x3848de,require(_0xdc83('0x2f')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x30')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x31')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x32')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x33')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x34')));_0x3848de=_['merge'](_0x3848de,require(_0xdc83('0x35')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x36')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x37')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x38')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x39')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require('../api/squareMessage/squareMessage.rpc'));_0x3848de=_['merge'](_0x3848de,require('../api/campaign/campaign.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require('../api/attachment/attachment.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x3a')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x3b')));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x3848de=_[_0xdc83('0x3')](_0x3848de,require(_0xdc83('0x3c')));_0x3848de=_['merge'](_0x3848de,require(_0xdc83('0x3d')));_0x3848de=_['merge'](_0x3848de,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x552584=jayson['server'](_0x3848de)[_0xdc83('0x3e')]();var _0x46e809=config[_0xdc83('0x3f')][_0xdc83('0x40')]||config[_0xdc83('0x40')]+0x1;var _0x5ea587=config[_0xdc83('0x3f')]['ip']||_0xdc83('0x41');_0x552584['on'](_0xdc83('0x42'),function(_0x189fd0){return _0x67bc1b(_0x189fd0);});_0x552584['listen'](_0x46e809,_0x5ea587,function(){console['log'](_0xdc83('0x43'),_0x5ea587,_0x46e809);require(_0xdc83('0x44'))[_0xdc83('0x45')]();return _0x16085b('RPC\x20listening\x20on\x20'+_0x5ea587+':'+_0x46e809);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 0ea7fb7..eb7189e 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 _0xd7a3=['continueAt','extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','emit','ready','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','replace','result=','indexOf','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','write','prototype','sendRequest','command','answer','ANSWER','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s'];(function(_0x563294,_0x441ce5){var _0xce1224=function(_0x4fa5f1){while(--_0x4fa5f1){_0x563294['push'](_0x563294['shift']());}};_0xce1224(++_0x441ce5);}(_0xd7a3,0xf4));var _0x3d7a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xd7a3[_0x422905];return _0x33dc6c;};'use strict';var util=require(_0x3d7a('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0x3d7a('0x1')];var AGIReply=require(_0x3d7a('0x2'));var AGIError=require(_0x3d7a('0x3'));function AGIChannel(_0x220727){var _0x625de0=this,_0x5ed7ba=new AGIReply(),_0x387b7d=![],_0x29395f={};EventEmitter['call'](_0x625de0);_0x220727[_0x3d7a('0x4')](_0x3d7a('0x5'));_0x220727[_0x3d7a('0x6')](0x8*0x3c*0x3c*0x3e8);_0x5ed7ba[_0x3d7a('0x4')](_0x3d7a('0x5'));_0x5ed7ba['on']('headers',function(_0x40626e){for(var _0x3fcfb8 in _0x40626e){_0x625de0[_0x3fcfb8]=_0x40626e[_0x3fcfb8];}_0x625de0[_0x3d7a('0x7')](_0x3d7a('0x8'));});_0x5ed7ba['on']('line',function(_0x57dfab){if(_0x57dfab[_0x3d7a('0x9')]()=='hangup'){_0x625de0['emit'](_0x3d7a('0xa'));return;}if(_0x57dfab[_0x3d7a('0xb')](0x0,0xb)==_0x3d7a('0xc')){_0x387b7d=!![];}if(_0x387b7d){_0x29395f['rx']+=_0x57dfab+'\x0a';if(_0x57dfab['search'](_0x3d7a('0xd'))!=-0x1){_0x387b7d=![];}}else{_0x29395f['rx']=_0x57dfab;}if(_0x387b7d){return;}if(typeof _0x29395f['cb']==_0x3d7a('0xe')){var _0x2e5749=_0x29395f['rx'][_0x3d7a('0xb')](0x0,0x3),_0xe95946=null,_0x44fab3=null;_0x2e5749=parseInt(_0x2e5749);if(isNaN(_0x2e5749)){_0x29395f['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2e5749!=0xc8){_0x29395f['cb'](null,{'code':_0x2e5749,'result':-0x1,'extra':'KO'});return;}_0xe95946=_0x29395f['rx']['substring'](0x4)[_0x3d7a('0xf')](_0x3d7a('0x10'),'');if(_0xe95946[_0x3d7a('0x11')]('\x20')!=-0x1){_0xe95946=_0xe95946['substr'](0x0,_0xe95946[_0x3d7a('0x11')]('\x20'));}if(_[_0x3d7a('0x12')](_0xe95946,'-1')){_0xe95946=parseInt(_0xe95946);}_0x44fab3=_0x29395f['rx'][_0x3d7a('0x13')]('\x20');if(_0x44fab3[_0x3d7a('0x14')]==0x3){_0x44fab3=_0x44fab3[0x2][_0x3d7a('0xb')](0x1,_0x44fab3[0x2]['length']-0x1);}else if(_0x44fab3['length']>0x3){var _0x4034fc=/\((.+)\)/;var _0x53f733=_0x29395f['rx'][_0x3d7a('0x15')](_0x4034fc);if(_0x53f733){_0x44fab3=_0x53f733[0x1];}else{_0x44fab3=null;}}else{_0x44fab3=null;}_0x29395f['cb'](null,{'code':_0x2e5749,'result':_0xe95946,'extra':_0x44fab3});}});_0x220727['on'](_0x3d7a('0x16'),function(_0x472c59){_0x625de0[_0x3d7a('0x7')](_0x3d7a('0x16'),new AGIError('E_AGI_SOCKET_ERROR',_0x472c59[_0x3d7a('0x17')]));});_0x220727['on'](_0x3d7a('0x18'),function(){_0x625de0['emit']('close',new AGIError(_0x3d7a('0x19')));});_0x220727['on'](_0x3d7a('0x1a'),function(){_0x625de0[_0x3d7a('0x7')](_0x3d7a('0x1a'),new AGIError(_0x3d7a('0x1b')));_0x220727[_0x3d7a('0x1c')]();});_0x220727['pipe'](_0x5ed7ba);this['command']=function(_0x2ea939,_0x38c4bf){var _0x2ea939=_0x2ea939||'',_0x38c4bf=typeof _0x38c4bf==_0x3d7a('0xe')?_0x38c4bf:new Function();_0x29395f={'tx':_0x2ea939,'rx':'','cb':_0x38c4bf};_0x220727[_0x3d7a('0x1d')](_0x2ea939+'\x0a');},this['close']=function(){_0x220727[_0x3d7a('0x1c')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x1f')]=function(_0x3ab0dd){return this[_0x3d7a('0x20')]['sync'](this,_0x3ab0dd);};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x21')]=function(){return this[_0x3d7a('0x1f')](_0x3d7a('0x22'));};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x23')]=function(_0x5653f6,_0x4adafc,_0x3c1d4a){_0x5653f6=_0x5653f6===undefined?'beep':_0x5653f6;_0x4adafc=_0x4adafc===undefined?'5':_0x4adafc;_0x3c1d4a=_0x3c1d4a===undefined?'1':_0x3c1d4a;return this['sendRequest'](util['format'](_0x3d7a('0x24'),_0x5653f6,_0x4adafc*0x3e8,_0x3c1d4a));};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x25')]=function(_0x38bd9d){_0x38bd9d=_0x38bd9d||'NO\x20MESSAGE';return this['sendRequest'](util[_0x3d7a('0x26')](_0x3d7a('0x27'),_0x38bd9d));};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x28')]=function(_0x211df8,_0x2854e2){if(_[_0x3d7a('0x29')](_0x2854e2)){return this['sendRequest'](util[_0x3d7a('0x26')](_0x3d7a('0x2a'),_0x211df8,_0x2854e2[_0x3d7a('0x2b')](',')));}return this[_0x3d7a('0x1f')](util[_0x3d7a('0x26')](_0x3d7a('0x2a'),_0x211df8,_0x2854e2));};AGIChannel['prototype'][_0x3d7a('0x2c')]=function(_0x1e422a){return this[_0x3d7a('0x1f')](util[_0x3d7a('0x26')](_0x3d7a('0x2d'),_0x1e422a));};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x2e')]=function(_0x5152b2){return this[_0x3d7a('0x1f')](util[_0x3d7a('0x26')](_0x3d7a('0x2f'),_0x5152b2));};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x30')]=function(_0x1b4a76){return this[_0x3d7a('0x1f')](util[_0x3d7a('0x26')](_0x3d7a('0x31'),_0x1b4a76));};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0xa')]=function(){return this[_0x3d7a('0x1f')]('HANGUP');};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x32')]=function(_0x45f1bb,_0xe412a5){var _0x3dc595=_[_0x3d7a('0x33')](_0xe412a5)||_[_0x3d7a('0x34')](_0xe412a5)?_0xe412a5[_0x3d7a('0x35')]():_0xe412a5;return this[_0x3d7a('0x1f')](util[_0x3d7a('0x26')](_0x3d7a('0x36'),_0x45f1bb,_0x3dc595?_0x3dc595[_0x3d7a('0x35')]()[_0x3d7a('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x37')]=function(_0x28a7e7,_0x375a86){return this[_0x3d7a('0x1f')](util['format'](_0x3d7a('0x38'),_0x28a7e7,_0x375a86));};AGIChannel['prototype'][_0x3d7a('0x39')]=function(_0x1385b4,_0x46127f){return this[_0x3d7a('0x1f')](util[_0x3d7a('0x26')]('SAY\x20DIGITS\x20%s\x20%s',_0x1385b4,_0x46127f));};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x3a')]=function(_0x255baa,_0x26e1f6){return this[_0x3d7a('0x1f')](util[_0x3d7a('0x26')](_0x3d7a('0x3b'),_0x255baa,_0x26e1f6));};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x3c')]=function(_0x4b03f6,_0x4b086b,_0x4819ef){_0x4b086b=_0x4b086b||this[_0x3d7a('0x3d')];_0x4819ef=_0x4819ef||0x1;this[_0x3d7a('0x2c')](_0x4b03f6);this[_0x3d7a('0x2e')](_0x4b086b);this[_0x3d7a('0x30')](_0x4819ef);return this[_0x3d7a('0x25')](util[_0x3d7a('0x26')]('GOTO\x20%s\x20%s\x20%s',_0x4b03f6,_0x4b086b,_0x4819ef));};AGIChannel['prototype'][_0x3d7a('0x3e')]=function(_0x20a601){return this['sendRequest'](util['format'](_0x3d7a('0x3f'),_0x20a601));};AGIChannel['prototype'][_0x3d7a('0x40')]=function(_0x3f5e22,_0x2f16fe,_0x58fcab,_0x2a6cd8,_0x4614e0,_0x5250ec){_0x2f16fe=_0x2f16fe||'wav';_0x58fcab=_0x58fcab||'';_0x2a6cd8=_0x2a6cd8===undefined?-0x1:_0x2a6cd8==='-1'?-0x1:_0x2a6cd8*0x3e8;_0x4614e0=_0x4614e0===undefined?'':'s='+_0x4614e0;_0x5250ec=_0x5250ec?_0x3d7a('0x41'):'';return this[_0x3d7a('0x1f')](util[_0x3d7a('0x26')](_0x3d7a('0x42'),_0x3f5e22,_0x2f16fe,_0x58fcab,_0x2a6cd8,_0x5250ec,_0x4614e0));};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x43')]=function(_0x4f341b,_0x39fb6c){_0x39fb6c=_0x39fb6c||'';return this[_0x3d7a('0x1f')](util[_0x3d7a('0x26')](_0x3d7a('0x44'),_0x4f341b,_0x39fb6c));};AGIChannel['prototype'][_0x3d7a('0x45')]=function(_0x4410c0){return this[_0x3d7a('0x28')](_0x3d7a('0x46'),_0x4410c0);};AGIChannel[_0x3d7a('0x1e')][_0x3d7a('0x47')]=function(_0x1db35e){return this[_0x3d7a('0x28')](_0x3d7a('0x48'),_0x1db35e);};AGIChannel[_0x3d7a('0x1e')]['error']=function(_0x95b829,_0xdf9dae){this[_0x3d7a('0x25')](util[_0x3d7a('0x26')](_0x3d7a('0x49'),_0x95b829['id'],_0x95b829[_0x3d7a('0x4a')],_0xdf9dae));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3d7a('0x4b')]=AGIChannel; \ No newline at end of file +var _0x444a=['startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','sendRequest','sync','prototype','answer','ANSWER','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20DIGITS\x20%s\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','520-Invalid','520\x20End\x20of\x20proper','function','substring','replace','result=','indexOf'];(function(_0x1dc7c2,_0x1dc820){var _0x239a75=function(_0x162b0a){while(--_0x162b0a){_0x1dc7c2['push'](_0x1dc7c2['shift']());}};_0x239a75(++_0x1dc820);}(_0x444a,0x1a1));var _0xa444=function(_0x3d5df9,_0x5b3623){_0x3d5df9=_0x3d5df9-0x0;var _0x50ba39=_0x444a[_0x3d5df9];return _0x50ba39;};'use strict';var util=require(_0xa444('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0xa444('0x1')];var AGIReply=require(_0xa444('0x2'));var AGIError=require(_0xa444('0x3'));function AGIChannel(_0x9c036d){var _0xb0f5ee=this,_0x4f3da7=new AGIReply(),_0x22fa86=![],_0x2e73d1={};EventEmitter[_0xa444('0x4')](_0xb0f5ee);_0x9c036d[_0xa444('0x5')](_0xa444('0x6'));_0x9c036d[_0xa444('0x7')](0x8*0x3c*0x3c*0x3e8);_0x4f3da7[_0xa444('0x5')]('utf8');_0x4f3da7['on'](_0xa444('0x8'),function(_0x4ef8f5){for(var _0x1e03d1 in _0x4ef8f5){_0xb0f5ee[_0x1e03d1]=_0x4ef8f5[_0x1e03d1];}_0xb0f5ee[_0xa444('0x9')](_0xa444('0xa'));});_0x4f3da7['on'](_0xa444('0xb'),function(_0x4acc9f){if(_0x4acc9f[_0xa444('0xc')]()==_0xa444('0xd')){_0xb0f5ee[_0xa444('0x9')](_0xa444('0xd'));return;}if(_0x4acc9f['substring'](0x0,0xb)==_0xa444('0xe')){_0x22fa86=!![];}if(_0x22fa86){_0x2e73d1['rx']+=_0x4acc9f+'\x0a';if(_0x4acc9f['search'](_0xa444('0xf'))!=-0x1){_0x22fa86=![];}}else{_0x2e73d1['rx']=_0x4acc9f;}if(_0x22fa86){return;}if(typeof _0x2e73d1['cb']==_0xa444('0x10')){var _0x4ad863=_0x2e73d1['rx'][_0xa444('0x11')](0x0,0x3),_0x5ab12e=null,_0x54494e=null;_0x4ad863=parseInt(_0x4ad863);if(isNaN(_0x4ad863)){_0x2e73d1['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x4ad863!=0xc8){_0x2e73d1['cb'](null,{'code':_0x4ad863,'result':-0x1,'extra':'KO'});return;}_0x5ab12e=_0x2e73d1['rx'][_0xa444('0x11')](0x4)[_0xa444('0x12')](_0xa444('0x13'),'');if(_0x5ab12e[_0xa444('0x14')]('\x20')!=-0x1){_0x5ab12e=_0x5ab12e['substr'](0x0,_0x5ab12e['indexOf']('\x20'));}if(_[_0xa444('0x15')](_0x5ab12e,'-1')){_0x5ab12e=parseInt(_0x5ab12e);}_0x54494e=_0x2e73d1['rx'][_0xa444('0x16')]('\x20');if(_0x54494e[_0xa444('0x17')]==0x3){_0x54494e=_0x54494e[0x2][_0xa444('0x11')](0x1,_0x54494e[0x2][_0xa444('0x17')]-0x1);}else if(_0x54494e['length']>0x3){var _0x1036c5=/\((.+)\)/;var _0x149b32=_0x2e73d1['rx'][_0xa444('0x18')](_0x1036c5);if(_0x149b32){_0x54494e=_0x149b32[0x1];}else{_0x54494e=null;}}else{_0x54494e=null;}_0x2e73d1['cb'](null,{'code':_0x4ad863,'result':_0x5ab12e,'extra':_0x54494e});}});_0x9c036d['on'](_0xa444('0x19'),function(_0x54e9f1){_0xb0f5ee[_0xa444('0x9')](_0xa444('0x19'),new AGIError(_0xa444('0x1a'),_0x54e9f1[_0xa444('0x1b')]));});_0x9c036d['on'](_0xa444('0x1c'),function(){_0xb0f5ee[_0xa444('0x9')](_0xa444('0x1c'),new AGIError(_0xa444('0x1d')));});_0x9c036d['on'](_0xa444('0x1e'),function(){_0xb0f5ee[_0xa444('0x9')]('timeout',new AGIError(_0xa444('0x1f')));_0x9c036d[_0xa444('0x20')]();});_0x9c036d[_0xa444('0x21')](_0x4f3da7);this['command']=function(_0x41ad29,_0x476ae1){var _0x41ad29=_0x41ad29||'',_0x476ae1=typeof _0x476ae1==_0xa444('0x10')?_0x476ae1:new Function();_0x2e73d1={'tx':_0x41ad29,'rx':'','cb':_0x476ae1};_0x9c036d['write'](_0x41ad29+'\x0a');},this[_0xa444('0x1c')]=function(){_0x9c036d[_0xa444('0x20')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xa444('0x22')]=function(_0x534822){return this['command'][_0xa444('0x23')](this,_0x534822);};AGIChannel[_0xa444('0x24')][_0xa444('0x25')]=function(){return this[_0xa444('0x22')](_0xa444('0x26'));};AGIChannel[_0xa444('0x24')]['getData']=function(_0x2ac298,_0x9827f1,_0x573eec){_0x2ac298=_0x2ac298===undefined?_0xa444('0x27'):_0x2ac298;_0x9827f1=_0x9827f1===undefined?'5':_0x9827f1;_0x573eec=_0x573eec===undefined?'1':_0x573eec;return this[_0xa444('0x22')](util['format'](_0xa444('0x28'),_0x2ac298,_0x9827f1*0x3e8,_0x573eec));};AGIChannel['prototype'][_0xa444('0x29')]=function(_0x1f505c){_0x1f505c=_0x1f505c||_0xa444('0x2a');return this['sendRequest'](util[_0xa444('0x2b')](_0xa444('0x2c'),_0x1f505c));};AGIChannel[_0xa444('0x24')][_0xa444('0x2d')]=function(_0x33a34e,_0x45bb84){if(_['isArray'](_0x45bb84)){return this['sendRequest'](util[_0xa444('0x2b')](_0xa444('0x2e'),_0x33a34e,_0x45bb84[_0xa444('0x2f')](',')));}return this[_0xa444('0x22')](util['format'](_0xa444('0x2e'),_0x33a34e,_0x45bb84));};AGIChannel[_0xa444('0x24')][_0xa444('0x30')]=function(_0x46baa6){return this[_0xa444('0x22')](util['format'](_0xa444('0x31'),_0x46baa6));};AGIChannel[_0xa444('0x24')][_0xa444('0x32')]=function(_0x5c673b){return this[_0xa444('0x22')](util['format'](_0xa444('0x33'),_0x5c673b));};AGIChannel['prototype'][_0xa444('0x34')]=function(_0x5cf89b){return this['sendRequest'](util[_0xa444('0x2b')](_0xa444('0x35'),_0x5cf89b));};AGIChannel[_0xa444('0x24')][_0xa444('0xd')]=function(){return this['sendRequest'](_0xa444('0x36'));};AGIChannel[_0xa444('0x24')][_0xa444('0x37')]=function(_0x541ed4,_0x3365eb){var _0xd7761d=_['isBoolean'](_0x3365eb)||_['isNumber'](_0x3365eb)?_0x3365eb[_0xa444('0x38')]():_0x3365eb;return this[_0xa444('0x22')](util[_0xa444('0x2b')](_0xa444('0x39'),_0x541ed4,_0xd7761d?_0xd7761d[_0xa444('0x38')]()[_0xa444('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xa444('0x24')]['sayNumber']=function(_0x1be848,_0x1e0afd){return this[_0xa444('0x22')](util[_0xa444('0x2b')]('SAY\x20NUMBER\x20%s\x20%s',_0x1be848,_0x1e0afd));};AGIChannel[_0xa444('0x24')]['sayDigits']=function(_0x50b2c4,_0x5d414a){return this[_0xa444('0x22')](util[_0xa444('0x2b')](_0xa444('0x3a'),_0x50b2c4,_0x5d414a));};AGIChannel[_0xa444('0x24')]['sayPhonetic']=function(_0x5aa36e,_0x2d06f5){return this[_0xa444('0x22')](util[_0xa444('0x2b')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x5aa36e,_0x2d06f5));};AGIChannel[_0xa444('0x24')][_0xa444('0x3b')]=function(_0x512583,_0x1a9e2f,_0x4ec668){_0x1a9e2f=_0x1a9e2f||this['extension'];_0x4ec668=_0x4ec668||0x1;this['setContext'](_0x512583);this[_0xa444('0x32')](_0x1a9e2f);this[_0xa444('0x34')](_0x4ec668);return this[_0xa444('0x29')](util[_0xa444('0x2b')](_0xa444('0x3c'),_0x512583,_0x1a9e2f,_0x4ec668));};AGIChannel[_0xa444('0x24')][_0xa444('0x3d')]=function(_0x5a0489){return this['sendRequest'](util[_0xa444('0x2b')](_0xa444('0x3e'),_0x5a0489));};AGIChannel[_0xa444('0x24')][_0xa444('0x3f')]=function(_0x181944,_0x7652aa,_0x2f4554,_0x42272a,_0x7aab0,_0x1f97e5){_0x7652aa=_0x7652aa||_0xa444('0x40');_0x2f4554=_0x2f4554||'';_0x42272a=_0x42272a===undefined?-0x1:_0x42272a==='-1'?-0x1:_0x42272a*0x3e8;_0x7aab0=_0x7aab0===undefined?'':'s='+_0x7aab0;_0x1f97e5=_0x1f97e5?'BEEP':'';return this[_0xa444('0x22')](util['format'](_0xa444('0x41'),_0x181944,_0x7652aa,_0x2f4554,_0x42272a,_0x1f97e5,_0x7aab0));};AGIChannel[_0xa444('0x24')][_0xa444('0x42')]=function(_0x109a2b,_0x4f4ace){_0x4f4ace=_0x4f4ace||'';return this[_0xa444('0x22')](util[_0xa444('0x2b')](_0xa444('0x43'),_0x109a2b,_0x4f4ace));};AGIChannel[_0xa444('0x24')][_0xa444('0x44')]=function(_0x46e41a){return this[_0xa444('0x2d')]('AGI',_0x46e41a);};AGIChannel[_0xa444('0x24')][_0xa444('0x45')]=function(_0x4e054e){return this[_0xa444('0x2d')](_0xa444('0x46'),_0x4e054e);};AGIChannel[_0xa444('0x24')]['error']=function(_0x1557ff,_0x3e351d){this['noop'](util[_0xa444('0x2b')](_0xa444('0x47'),_0x1557ff['id'],_0x1557ff[_0xa444('0x48')],_0x3e351d));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index c896bcd..cc3670b 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 _0x3d16=['E_AGI_UNDEFINED','push','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x497fa0,_0x91c3b2){var _0x28f9e0=function(_0x5742b5){while(--_0x5742b5){_0x497fa0['push'](_0x497fa0['shift']());}};_0x28f9e0(++_0x91c3b2);}(_0x3d16,0x18b));var _0x63d1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d16[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x63d1('0x0'));var error={'E_AGI_UNDEFINED':_0x63d1('0x1'),'E_AGI_ARGUMENT_PORT':_0x63d1('0x2'),'E_AGI_SERVER_ERROR':_0x63d1('0x3'),'E_AGI_SERVER_CLOSE':_0x63d1('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x63d1('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x63d1('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x63d1('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x63d1('0x8'),'E_AGI_IVR_ENTRY':_0x63d1('0x9')};function AGIError(_0x449ec9){var _0x449ec9=_0x449ec9||null,_0x2fe5f3=_0x2fe5f3||[],_0x210434=0x1,_0x45f709='';if(!error[_0x449ec9]){_0x449ec9=_0x63d1('0xa');}_0x2fe5f3[_0x63d1('0xb')](error[_0x449ec9]);while(arguments[_0x210434]){_0x2fe5f3[_0x63d1('0xb')](arguments[_0x210434]);_0x210434++;}_0x45f709=util['format']['apply'](util,_0x2fe5f3);this[_0x63d1('0xc')]=_0x45f709;this[_0x63d1('0xd')]=_0x449ec9;}module[_0x63d1('0xe')]=AGIError; \ No newline at end of file +var _0x6ef0=['util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','apply','name','exports'];(function(_0x49d23d,_0x2bc740){var _0x587541=function(_0x132d91){while(--_0x132d91){_0x49d23d['push'](_0x49d23d['shift']());}};_0x587541(++_0x2bc740);}(_0x6ef0,0x1c0));var _0x06ef=function(_0x174e10,_0x32f58c){_0x174e10=_0x174e10-0x0;var _0x4184c5=_0x6ef0[_0x174e10];return _0x4184c5;};'use strict';var util=require(_0x06ef('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x06ef('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x06ef('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x06ef('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x06ef('0x4'),'E_AGI_SOCKET_ERROR':_0x06ef('0x5'),'E_AGI_SOCKET_CLOSE':_0x06ef('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x06ef('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x06ef('0x8'),'E_AGI_IVR_ENTRY':_0x06ef('0x9')};function AGIError(_0x495186){var _0x495186=_0x495186||null,_0x5522d7=_0x5522d7||[],_0x37520f=0x1,_0x1e2703='';if(!error[_0x495186]){_0x495186='E_AGI_UNDEFINED';}_0x5522d7['push'](error[_0x495186]);while(arguments[_0x37520f]){_0x5522d7[_0x06ef('0xa')](arguments[_0x37520f]);_0x37520f++;}_0x1e2703=util['format'][_0x06ef('0xb')](util,_0x5522d7);this['message']=_0x1e2703;this[_0x06ef('0xc')]=_0x495186;}module[_0x06ef('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 0b05865..a8fd81a 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 _0xf2fe=['info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','length','condition','agicommand','vswitch','default','target','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','exports','lodash','agi','menu','getsecretdigits','vertices','edges','prototype','addVertex','addEdge','numberOfEdges','size','getVertex','traverseBFS'];(function(_0x1483a3,_0x43f2e1){var _0x487178=function(_0x46dba1){while(--_0x46dba1){_0x1483a3['push'](_0x1483a3['shift']());}};_0x487178(++_0x43f2e1);}(_0xf2fe,0xcb));var _0xef2f=function(_0x3b44b0,_0x4458f3){_0x3b44b0=_0x3b44b0-0x0;var _0x39b561=_0xf2fe[_0x3b44b0];return _0x39b561;};'use strict';var _=require(_0xef2f('0x0'));var logger=require('../../../config/logger')(_0xef2f('0x1'));var verticesWithRetry=[_0xef2f('0x2'),'getdigits',_0xef2f('0x3')];var Graph=function(){this[_0xef2f('0x4')]={};this[_0xef2f('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0xef2f('0x6')][_0xef2f('0x7')]=function(_0x3fcec8){this[_0xef2f('0x4')][_0x3fcec8['id']]=_0x3fcec8;this[_0xef2f('0x5')][_0x3fcec8['id']]=[];};Graph['prototype'][_0xef2f('0x8')]=function(_0x46d064,_0x2581af,_0x478f2c){this[_0xef2f('0x5')][_0x46d064]['push']({'target':_0x2581af,'condition':_0x478f2c});this[_0xef2f('0x9')]+=0x1;};Graph['prototype'][_0xef2f('0xa')]=function(){return _[_0xef2f('0xa')](this['vertices']);};Graph[_0xef2f('0x6')]['relations']=function(){return this[_0xef2f('0x9')];};Graph[_0xef2f('0x6')][_0xef2f('0xb')]=function(_0x4fc1ec){return this[_0xef2f('0x4')][_0x4fc1ec];};Graph[_0xef2f('0x6')][_0xef2f('0xc')]=function(_0x3792ec,_0x202e6c){if(!this[_0xef2f('0x4')][_0x3792ec]){return logger[_0xef2f('0xd')](_0xef2f('0xe'));}var _0x3b32a9=_0x202e6c(this[_0xef2f('0x4')][_0x3792ec]);if(!_0x3b32a9){return logger[_0xef2f('0xd')](_0xef2f('0xf'));}if(this[_0xef2f('0x5')][_0x3792ec]['length']===0x0){return logger[_0xef2f('0xd')](_0xef2f('0x10'));}for(var _0x19dfe5=0x0,_0x504121=[],_0x4a054b=![];_0x19dfe5\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','root','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','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','continueAt','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./rpc','./mailRpc','./graph','agi','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','message','format','name','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','info','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','getSquareProject'];(function(_0x5c31eb,_0x44043d){var _0x5b4773=function(_0x46c393){while(--_0x46c393){_0x5c31eb['push'](_0x5c31eb['shift']());}};_0x5b4773(++_0x44043d);}(_0xbfa6,0x199));var _0x6bfa=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0xbfa6[_0x54defc];return _0x1955d3;};'use strict';var parser=require(_0x6bfa('0x0'));var _=require(_0x6bfa('0x1'));var syncho=require(_0x6bfa('0x2'));var util=require(_0x6bfa('0x3'));var moment=require(_0x6bfa('0x4'));var config=require(_0x6bfa('0x5'));var logger=require(_0x6bfa('0x6'))('agi');var utilLicense=require(_0x6bfa('0x7'));var rpc=require(_0x6bfa('0x8'));var mailRpc=require(_0x6bfa('0x9'));var Graph=require(_0x6bfa('0xa'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x6bfa('0xb')]=_['defaults'](config[_0x6bfa('0xb')],{'ip':_0x6bfa('0xc'),'port':0x11dd});function connectionHandler(_0x183be2){process[_0x6bfa('0xd')](function(){syncho(function(){try{setChannelVariables(_0x183be2);agiHandler(_0x183be2);}catch(_0x21c671){logger[_0x6bfa('0xe')](_0x21c671[_0x6bfa('0xf')]);}});});}function listeningHandler(){console['log'](_0x6bfa('0x10'),config['agi'][_0x6bfa('0x11')]);logger['info'](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0x6bfa('0xb')][_0x6bfa('0x11')]));}function errorHandler(_0x3a4836){if(_0x3a4836&&_0x3a4836['name']&&_0x3a4836[_0x6bfa('0x12')]){logger[_0x6bfa('0xe')](util[_0x6bfa('0x13')]('[%s]\x20%s',_0x3a4836[_0x6bfa('0x14')],_0x3a4836[_0x6bfa('0x12')]));}else{logger['error'](util['format'](_0x6bfa('0x15'),_0x3a4836['stack']));}}function closeHandler(){logger['info'](util[_0x6bfa('0x13')](_0x6bfa('0x16'),this[_0x6bfa('0x17')],this[_0x6bfa('0x18')],this['callerid'],this[_0x6bfa('0x19')],this[_0x6bfa('0x1a')]));try{createSquareReport(this);}catch(_0x2b87d1){logger[_0x6bfa('0xe')](_0x2b87d1[_0x6bfa('0xf')]);}}function timeoutHandler(){logger[_0x6bfa('0x1b')](util[_0x6bfa('0x13')](_0x6bfa('0x1c'),this['arg_1'],this[_0x6bfa('0x18')],this[_0x6bfa('0x1d')],this['dnid'],this[_0x6bfa('0x1a')]));}function hangupHandler(){logger['info'](util[_0x6bfa('0x13')](_0x6bfa('0x1e'),this[_0x6bfa('0x17')],this['calleridname'],this[_0x6bfa('0x1d')],this['dnid'],this[_0x6bfa('0x1a')]));this[_0x6bfa('0x1f')]=!![];}function getRoot(_0x4de3f2){return parser[_0x6bfa('0x20')](_0x4de3f2,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x2f8d34,_0x58599e,_0x420865){_0x58599e[_0x6bfa('0x21')]=_0x420865;if(_0x58599e[_0x6bfa('0x22')](_0x6bfa('0x23'))){_0x58599e[_0x6bfa('0x24')]=parseInt(_0x58599e[_0x6bfa('0x23')],0xa);}_0x2f8d34[_0x6bfa('0x25')](_['omit'](_0x58599e,_0x6bfa('0x26')));}function initGraph(_0x5a62bf,_0x59f8fb){var _0x563392=new Graph();for(var _0x1d6074 in _0x5a62bf){if(_0x5a62bf[_0x6bfa('0x22')](_0x1d6074)){if(_[_0x6bfa('0x27')](_0x5a62bf[_0x1d6074])){for(var _0x124a58=0x0;_0x124a58<_0x5a62bf[_0x1d6074][_0x6bfa('0x28')];_0x124a58+=0x1){addVertex(_0x563392,_0x5a62bf[_0x1d6074][_0x124a58],_0x1d6074);}}else{addVertex(_0x563392,_0x5a62bf[_0x1d6074],_0x1d6074);}}}for(var _0x2ec9e5=0x0;_0x2ec9e5<_0x59f8fb[_0x6bfa('0x28')];_0x2ec9e5+=0x1){if(_0x59f8fb[_0x2ec9e5][_0x6bfa('0x29')]&&_0x59f8fb[_0x2ec9e5][_0x6bfa('0x2a')]){_0x563392[_0x6bfa('0x2b')](_0x59f8fb[_0x2ec9e5][_0x6bfa('0x29')],_0x59f8fb[_0x2ec9e5][_0x6bfa('0x2a')],_0x59f8fb[_0x2ec9e5][_0x6bfa('0x2c')]);}}return _0x563392;}function getSquareProject(_0x1db013,_0x238919){rpc[_0x6bfa('0x2d')](_0x1db013)[_0x6bfa('0x2e')](function(_0x4455b9){_0x238919(null,_0x4455b9);})[_0x6bfa('0x2f')](function(_0x68f723){_0x238919(null,_0x68f723);});}function createSquareReport(_0x32f5fb,_0x16b67e){rpc['createSquareReport'](_0x32f5fb)[_0x6bfa('0x2e')](function(_0x310778){if(_0x16b67e){_0x16b67e(null,_0x310778);}})['catch'](function(_0x232b66){if(_0x16b67e){_0x16b67e(null,_0x232b66);}});}function setChannelVariables(_0x3d17e2){for(var _0x325110 in _0x3d17e2){if(_0x3d17e2[_0x6bfa('0x22')](_0x325110)){if(_0x325110[_0x6bfa('0x30')](_0x6bfa('0x31'))===0x0){_0x3d17e2[_0x325110[_0x6bfa('0x32')](0x4)]=_0x3d17e2[_0x325110];delete _0x3d17e2[_0x325110];}}}}function getLogFromObject(_0x47f19d){return util[_0x6bfa('0x33')](_0x47f19d,{'showHidden':![],'depth':null});}function agiHandler(_0x260c86){var _0x3d0a30,_0x4d263c,_0x27a021,_0x2c071f,_0xfd9f57;logger[_0x6bfa('0x34')](_0x6bfa('0x35'),JSON[_0x6bfa('0x36')](_0x260c86,null,0x2));logger[_0x6bfa('0x1b')](util[_0x6bfa('0x13')](_0x6bfa('0x37'),_0x260c86[_0x6bfa('0x17')],_0x260c86['calleridname'],_0x260c86['callerid'],_0x260c86['dnid'],_0x260c86[_0x6bfa('0x1a')]));_0x260c86['on'](_0x6bfa('0xe'),errorHandler);_0x260c86['on'](_0x6bfa('0x38'),closeHandler);_0x260c86['on'](_0x6bfa('0x39'),timeoutHandler);_0x260c86[_0x6bfa('0x1f')]=![];_0x260c86['on'](_0x6bfa('0x3a'),hangupHandler);var _0x55ca4e=getSquareProject[_0x6bfa('0x3b')](null,_0x260c86[_0x6bfa('0x17')]);if(_0x55ca4e){if(_0x55ca4e[_0x6bfa('0x3c')]){_0x3d0a30=getRoot(_0x55ca4e[_0x6bfa('0x3c')]);if(_0x3d0a30&&_0x3d0a30[_0x6bfa('0x3d')]){logger[_0x6bfa('0x34')](_0x6bfa('0x3e'),JSON['stringify'](_0x3d0a30,null,0x2));_0x260c86['joinAt']=moment()[_0x6bfa('0x13')](_0x6bfa('0x3f'));_0x4d263c=initGraph(_[_0x6bfa('0x40')](_0x3d0a30,_0x6bfa('0x26')),_0x3d0a30[_0x6bfa('0x26')]);_0x27a021=new Vertices(_0x260c86,rpc,mailRpc);logger[_0x6bfa('0x1b')](util[_0x6bfa('0x13')](_0x6bfa('0x41'),_0x260c86[_0x6bfa('0x17')],_0x260c86['calleridname'],_0x260c86[_0x6bfa('0x1d')],_0x260c86[_0x6bfa('0x19')],_0x260c86[_0x6bfa('0x1a')]));_0x4d263c[_0x6bfa('0x42')](_0x3d0a30[_0x6bfa('0x3d')]['id'],function(_0x26fbcc){try{_0x26fbcc=_0x27a021[_0x6bfa('0x43')](_0x26fbcc);logger[_0x6bfa('0x34')](_0x6bfa('0x44'),JSON[_0x6bfa('0x36')](_0x26fbcc,null,0x2));if(_0x26fbcc[_0x6bfa('0x21')]==='gotoc'){logger['info'](_0x6bfa('0x45'));_0x260c86['context']=_0x26fbcc[_0x6bfa('0x46')]||_0x260c86[_0x6bfa('0x46')];_0x260c86[_0x6bfa('0x47')]=_0x26fbcc['extension'];_0x260c86[_0x6bfa('0x48')]=_0x26fbcc[_0x6bfa('0x48')]?_0x26fbcc[_0x6bfa('0x48')]-0x1:0x1;return null;}else if(_0x26fbcc&&_0x27a021[_0x26fbcc[_0x6bfa('0x21')]]){_0xfd9f57=_0x27a021[_0x26fbcc[_0x6bfa('0x21')]](_0x26fbcc);logger['info']('response',JSON[_0x6bfa('0x36')](_0xfd9f57,null,0x2));if(_0xfd9f57&&_0xfd9f57[_0x6bfa('0x49')]===AGI_CODE_SUCCESS&&_0xfd9f57[_0x6bfa('0x4a')]!==AGI_RESULT_ERROR&&!_0x260c86[_0x6bfa('0x1f')]){logger[_0x6bfa('0x34')](_0x6bfa('0x4b'),getLogFromObject(_0xfd9f57));return _['isUndefined'](_0xfd9f57['result'])?null:_0xfd9f57[_0x6bfa('0x4a')][_0x6bfa('0x4c')]();}else{logger[_0x6bfa('0xe')]('response',getLogFromObject(_0xfd9f57));return null;}}else{logger[_0x6bfa('0xe')](_0x6bfa('0x4d'));return null;}}catch(_0x12402d){logger[_0x6bfa('0xe')](_0x12402d[_0x6bfa('0xf')]);return null;}});if(_0x3d0a30[_0x6bfa('0x4e')]){logger[_0x6bfa('0x1b')](util[_0x6bfa('0x13')](_0x6bfa('0x4f'),_0x260c86[_0x6bfa('0x17')],_0x260c86[_0x6bfa('0x18')],_0x260c86[_0x6bfa('0x1d')],_0x260c86[_0x6bfa('0x19')],_0x260c86['uniqueid']));_0x4d263c['traverseBFS'](_0x3d0a30[_0x6bfa('0x4e')]['id'],function(_0x7fcd87){try{_0x7fcd87=_0x27a021[_0x6bfa('0x43')](_0x7fcd87);logger[_0x6bfa('0x34')]('vertex',JSON[_0x6bfa('0x36')](_0x7fcd87,null,0x2));if(_0x7fcd87&&_0x27a021[_0x7fcd87[_0x6bfa('0x21')]]){_0xfd9f57=_0x27a021[_0x7fcd87['agicommand']](_0x7fcd87);if(_0xfd9f57){logger[_0x6bfa('0x34')]('response',getLogFromObject(_0xfd9f57));return _['isUndefined'](_0xfd9f57[_0x6bfa('0x4a')])?null:_0xfd9f57[_0x6bfa('0x4a')][_0x6bfa('0x4c')]();}else{logger[_0x6bfa('0xe')]('response',getLogFromObject(_0xfd9f57));return null;}}else{logger[_0x6bfa('0xe')](_0x6bfa('0x4d'));return null;}}catch(_0x2fbea9){logger[_0x6bfa('0xe')](_0x2fbea9[_0x6bfa('0xf')]);return null;}});}logger[_0x6bfa('0x1b')](util['format'](_0x6bfa('0x50'),_0x260c86['arg_1'],_0x260c86[_0x6bfa('0x18')],_0x260c86[_0x6bfa('0x1d')],_0x260c86[_0x6bfa('0x19')],_0x260c86[_0x6bfa('0x1a')]));logger[_0x6bfa('0x1b')](util[_0x6bfa('0x13')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x260c86[_0x6bfa('0x46')],_0x260c86[_0x6bfa('0x47')],parseInt(_0x260c86['priority'],0xa)+0x1));_0x260c86['continueAt'](_0x260c86[_0x6bfa('0x46')],_0x260c86[_0x6bfa('0x47')],parseInt(_0x260c86[_0x6bfa('0x48')],0xa)+0x1);_0x260c86['close']();}}else{logger[_0x6bfa('0xe')](util[_0x6bfa('0x13')]('Project\x20%s\x20not\x20published',_0x260c86[_0x6bfa('0x17')]));_0x260c86[_0x6bfa('0x51')](_0x260c86[_0x6bfa('0x46')],_0x260c86[_0x6bfa('0x47')],parseInt(_0x260c86['priority'],0xa)+0x1);_0x260c86[_0x6bfa('0x38')]();}}else{logger['error'](util['format']('Project\x20%s\x20not\x20found',_0x260c86[_0x6bfa('0x17')]));_0x260c86[_0x6bfa('0x51')](_0x260c86[_0x6bfa('0x46')],_0x260c86[_0x6bfa('0x47')],parseInt(_0x260c86[_0x6bfa('0x48')],0xa)+0x1);_0x260c86['close']();}}function main(){var _0x3efd00;return utilLicense[_0x6bfa('0x52')]()[_0x6bfa('0x2e')](function(_0x4fbad6){if(_0x4fbad6){if(_0x4fbad6[_0x6bfa('0x53')]){if(_0x4fbad6[_0x6bfa('0x54')]&&_0x4fbad6['callysquare']>0x0){logger[_0x6bfa('0x1b')](util[_0x6bfa('0x13')](_0x6bfa('0x55'),_0x4fbad6[_0x6bfa('0x54')]));_0x3efd00=_0x4fbad6[_0x6bfa('0x54')];}else{logger[_0x6bfa('0x1b')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0x6bfa('0x56'));_0x3efd00=-0x1;}}})['catch'](function(_0x49789d){logger[_0x6bfa('0xe')](_0x6bfa('0x57'),_0x49789d[_0x6bfa('0xf')]);})['finally'](function(){var _0x4fc93f=require(_0x6bfa('0x58'))(config[_0x6bfa('0xb')][_0x6bfa('0x11')],config[_0x6bfa('0xb')]['ip'],_0x3efd00);_0x4fc93f['on']('error',errorHandler);_0x4fc93f['on'](_0x6bfa('0x59'),listeningHandler);_0x4fc93f['on'](_0x6bfa('0x5a'),connectionHandler);_0x4fc93f['on'](_0x6bfa('0x38'),closeHandler);});}main(); \ No newline at end of file +var _0x1b4e=['omit','isArray','source','target','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','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','extension','close','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','port','listening','connection','xml2json','lodash','syncho','util','moment','agi','../../config/license/util','./rpc','./mailRpc','./graph','defaults','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','format','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','evtHangup','toJson','root','agicommand','hasOwnProperty','retry','addVertex'];(function(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0x1b4e,0x1a1));var _0xe1b4=function(_0x46d957,_0x294ce8){_0x46d957=_0x46d957-0x0;var _0x598548=_0x1b4e[_0x46d957];return _0x598548;};'use strict';var parser=require(_0xe1b4('0x0'));var _=require(_0xe1b4('0x1'));var syncho=require(_0xe1b4('0x2'));var util=require(_0xe1b4('0x3'));var moment=require(_0xe1b4('0x4'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xe1b4('0x5'));var utilLicense=require(_0xe1b4('0x6'));var rpc=require(_0xe1b4('0x7'));var mailRpc=require(_0xe1b4('0x8'));var Graph=require(_0xe1b4('0x9'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xe1b4('0xa')](config['agi'],{'ip':_0xe1b4('0xb'),'port':0x11dd});function connectionHandler(_0x2f5759){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x2f5759);agiHandler(_0x2f5759);}catch(_0x1cb726){logger[_0xe1b4('0xc')](_0x1cb726[_0xe1b4('0xd')]);}});});}function listeningHandler(){console[_0xe1b4('0xe')](_0xe1b4('0xf'),config[_0xe1b4('0x5')]['port']);logger[_0xe1b4('0x10')](util['format'](_0xe1b4('0x11'),config[_0xe1b4('0x5')]['ip'],config[_0xe1b4('0x5')]['port']));}function errorHandler(_0x1139a8){if(_0x1139a8&&_0x1139a8[_0xe1b4('0x12')]&&_0x1139a8[_0xe1b4('0x13')]){logger[_0xe1b4('0xc')](util['format'](_0xe1b4('0x14'),_0x1139a8[_0xe1b4('0x12')],_0x1139a8[_0xe1b4('0x13')]));}else{logger[_0xe1b4('0xc')](util[_0xe1b4('0x15')](_0xe1b4('0x16'),_0x1139a8[_0xe1b4('0xd')]));}}function closeHandler(){logger[_0xe1b4('0x10')](util[_0xe1b4('0x15')](_0xe1b4('0x17'),this['arg_1'],this[_0xe1b4('0x18')],this['callerid'],this[_0xe1b4('0x19')],this[_0xe1b4('0x1a')]));try{createSquareReport(this);}catch(_0x5f494b){logger[_0xe1b4('0xc')](_0x5f494b['stack']);}}function timeoutHandler(){logger['info'](util[_0xe1b4('0x15')](_0xe1b4('0x1b'),this['arg_1'],this[_0xe1b4('0x18')],this[_0xe1b4('0x1c')],this[_0xe1b4('0x19')],this[_0xe1b4('0x1a')]));}function hangupHandler(){logger[_0xe1b4('0x10')](util[_0xe1b4('0x15')](_0xe1b4('0x1d'),this[_0xe1b4('0x1e')],this[_0xe1b4('0x18')],this['callerid'],this[_0xe1b4('0x19')],this[_0xe1b4('0x1a')]));this[_0xe1b4('0x1f')]=!![];}function getRoot(_0x220bc8){return parser[_0xe1b4('0x20')](_0x220bc8,{'object':!![]})['mxGraphModel'][_0xe1b4('0x21')];}function addVertex(_0x11bc4e,_0x361d02,_0x539538){_0x361d02[_0xe1b4('0x22')]=_0x539538;if(_0x361d02[_0xe1b4('0x23')]('retry')){_0x361d02['maxRetry']=parseInt(_0x361d02[_0xe1b4('0x24')],0xa);}_0x11bc4e[_0xe1b4('0x25')](_[_0xe1b4('0x26')](_0x361d02,'mxCell'));}function initGraph(_0x43ed29,_0x2b1aa6){var _0x4440f0=new Graph();for(var _0x57e67a in _0x43ed29){if(_0x43ed29['hasOwnProperty'](_0x57e67a)){if(_[_0xe1b4('0x27')](_0x43ed29[_0x57e67a])){for(var _0x3aaa3c=0x0;_0x3aaa3c<_0x43ed29[_0x57e67a]['length'];_0x3aaa3c+=0x1){addVertex(_0x4440f0,_0x43ed29[_0x57e67a][_0x3aaa3c],_0x57e67a);}}else{addVertex(_0x4440f0,_0x43ed29[_0x57e67a],_0x57e67a);}}}for(var _0x374b96=0x0;_0x374b96<_0x2b1aa6['length'];_0x374b96+=0x1){if(_0x2b1aa6[_0x374b96][_0xe1b4('0x28')]&&_0x2b1aa6[_0x374b96][_0xe1b4('0x29')]){_0x4440f0['addEdge'](_0x2b1aa6[_0x374b96][_0xe1b4('0x28')],_0x2b1aa6[_0x374b96][_0xe1b4('0x29')],_0x2b1aa6[_0x374b96]['value']);}}return _0x4440f0;}function getSquareProject(_0x22cc47,_0x53cb4f){rpc[_0xe1b4('0x2a')](_0x22cc47)[_0xe1b4('0x2b')](function(_0x1cc5ce){_0x53cb4f(null,_0x1cc5ce);})[_0xe1b4('0x2c')](function(_0x1f13ac){_0x53cb4f(null,_0x1f13ac);});}function createSquareReport(_0x2504f2,_0x4558b5){rpc[_0xe1b4('0x2d')](_0x2504f2)[_0xe1b4('0x2b')](function(_0x542c9a){if(_0x4558b5){_0x4558b5(null,_0x542c9a);}})['catch'](function(_0x97556a){if(_0x4558b5){_0x4558b5(null,_0x97556a);}});}function setChannelVariables(_0x194ffb){for(var _0x5bcfbe in _0x194ffb){if(_0x194ffb[_0xe1b4('0x23')](_0x5bcfbe)){if(_0x5bcfbe[_0xe1b4('0x2e')](_0xe1b4('0x2f'))===0x0){_0x194ffb[_0x5bcfbe[_0xe1b4('0x30')](0x4)]=_0x194ffb[_0x5bcfbe];delete _0x194ffb[_0x5bcfbe];}}}}function getLogFromObject(_0xb343e7){return util[_0xe1b4('0x31')](_0xb343e7,{'showHidden':![],'depth':null});}function agiHandler(_0x33b969){var _0x3e6f46,_0x45e20e,_0x1587f4,_0x528e35,_0xeeeef8;logger[_0xe1b4('0x32')](_0xe1b4('0x33'),JSON[_0xe1b4('0x34')](_0x33b969,null,0x2));logger[_0xe1b4('0x10')](util[_0xe1b4('0x15')](_0xe1b4('0x35'),_0x33b969[_0xe1b4('0x1e')],_0x33b969[_0xe1b4('0x18')],_0x33b969['callerid'],_0x33b969[_0xe1b4('0x19')],_0x33b969[_0xe1b4('0x1a')]));_0x33b969['on'](_0xe1b4('0xc'),errorHandler);_0x33b969['on']('close',closeHandler);_0x33b969['on'](_0xe1b4('0x36'),timeoutHandler);_0x33b969[_0xe1b4('0x1f')]=![];_0x33b969['on'](_0xe1b4('0x37'),hangupHandler);var _0x130137=getSquareProject[_0xe1b4('0x38')](null,_0x33b969[_0xe1b4('0x1e')]);if(_0x130137){if(_0x130137[_0xe1b4('0x39')]){_0x3e6f46=getRoot(_0x130137[_0xe1b4('0x39')]);if(_0x3e6f46&&_0x3e6f46[_0xe1b4('0x3a')]){logger['debug'](_0xe1b4('0x21'),JSON[_0xe1b4('0x34')](_0x3e6f46,null,0x2));_0x33b969[_0xe1b4('0x3b')]=moment()['format'](_0xe1b4('0x3c'));_0x45e20e=initGraph(_[_0xe1b4('0x26')](_0x3e6f46,_0xe1b4('0x3d')),_0x3e6f46[_0xe1b4('0x3d')]);_0x1587f4=new Vertices(_0x33b969,rpc,mailRpc);logger['info'](util[_0xe1b4('0x15')](_0xe1b4('0x3e'),_0x33b969['arg_1'],_0x33b969[_0xe1b4('0x18')],_0x33b969[_0xe1b4('0x1c')],_0x33b969['dnid'],_0x33b969[_0xe1b4('0x1a')]));_0x45e20e[_0xe1b4('0x3f')](_0x3e6f46['start']['id'],function(_0xbe3bd4){try{_0xbe3bd4=_0x1587f4[_0xe1b4('0x40')](_0xbe3bd4);logger['debug'](_0xe1b4('0x41'),JSON['stringify'](_0xbe3bd4,null,0x2));if(_0xbe3bd4['agicommand']===_0xe1b4('0x42')){logger[_0xe1b4('0x10')](_0xe1b4('0x43'));_0x33b969['context']=_0xbe3bd4[_0xe1b4('0x44')]||_0x33b969[_0xe1b4('0x44')];_0x33b969['extension']=_0xbe3bd4['extension'];_0x33b969[_0xe1b4('0x45')]=_0xbe3bd4['priority']?_0xbe3bd4[_0xe1b4('0x45')]-0x1:0x1;return null;}else if(_0xbe3bd4&&_0x1587f4[_0xbe3bd4['agicommand']]){_0xeeeef8=_0x1587f4[_0xbe3bd4[_0xe1b4('0x22')]](_0xbe3bd4);logger['info'](_0xe1b4('0x46'),JSON[_0xe1b4('0x34')](_0xeeeef8,null,0x2));if(_0xeeeef8&&_0xeeeef8['code']===AGI_CODE_SUCCESS&&_0xeeeef8[_0xe1b4('0x47')]!==AGI_RESULT_ERROR&&!_0x33b969[_0xe1b4('0x1f')]){logger[_0xe1b4('0x32')](_0xe1b4('0x46'),getLogFromObject(_0xeeeef8));return _[_0xe1b4('0x48')](_0xeeeef8[_0xe1b4('0x47')])?null:_0xeeeef8[_0xe1b4('0x47')][_0xe1b4('0x49')]();}else{logger[_0xe1b4('0xc')](_0xe1b4('0x46'),getLogFromObject(_0xeeeef8));return null;}}else{logger[_0xe1b4('0xc')](_0xe1b4('0x4a'));return null;}}catch(_0x58608a){logger['error'](_0x58608a[_0xe1b4('0xd')]);return null;}});if(_0x3e6f46[_0xe1b4('0x4b')]){logger[_0xe1b4('0x10')](util[_0xe1b4('0x15')](_0xe1b4('0x4c'),_0x33b969['arg_1'],_0x33b969[_0xe1b4('0x18')],_0x33b969[_0xe1b4('0x1c')],_0x33b969[_0xe1b4('0x19')],_0x33b969[_0xe1b4('0x1a')]));_0x45e20e[_0xe1b4('0x3f')](_0x3e6f46[_0xe1b4('0x4b')]['id'],function(_0x3fd354){try{_0x3fd354=_0x1587f4[_0xe1b4('0x40')](_0x3fd354);logger['debug'](_0xe1b4('0x41'),JSON[_0xe1b4('0x34')](_0x3fd354,null,0x2));if(_0x3fd354&&_0x1587f4[_0x3fd354[_0xe1b4('0x22')]]){_0xeeeef8=_0x1587f4[_0x3fd354[_0xe1b4('0x22')]](_0x3fd354);if(_0xeeeef8){logger[_0xe1b4('0x32')]('response',getLogFromObject(_0xeeeef8));return _[_0xe1b4('0x48')](_0xeeeef8[_0xe1b4('0x47')])?null:_0xeeeef8[_0xe1b4('0x47')][_0xe1b4('0x49')]();}else{logger[_0xe1b4('0xc')]('response',getLogFromObject(_0xeeeef8));return null;}}else{logger[_0xe1b4('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x24a37c){logger[_0xe1b4('0xc')](_0x24a37c['stack']);return null;}});}logger[_0xe1b4('0x10')](util[_0xe1b4('0x15')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x33b969[_0xe1b4('0x1e')],_0x33b969['calleridname'],_0x33b969['callerid'],_0x33b969['dnid'],_0x33b969[_0xe1b4('0x1a')]));logger['info'](util[_0xe1b4('0x15')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x33b969[_0xe1b4('0x44')],_0x33b969[_0xe1b4('0x4d')],parseInt(_0x33b969[_0xe1b4('0x45')],0xa)+0x1));_0x33b969['continueAt'](_0x33b969[_0xe1b4('0x44')],_0x33b969['extension'],parseInt(_0x33b969[_0xe1b4('0x45')],0xa)+0x1);_0x33b969[_0xe1b4('0x4e')]();}}else{logger[_0xe1b4('0xc')](util[_0xe1b4('0x15')](_0xe1b4('0x4f'),_0x33b969[_0xe1b4('0x1e')]));_0x33b969[_0xe1b4('0x50')](_0x33b969['context'],_0x33b969[_0xe1b4('0x4d')],parseInt(_0x33b969['priority'],0xa)+0x1);_0x33b969['close']();}}else{logger[_0xe1b4('0xc')](util[_0xe1b4('0x15')](_0xe1b4('0x51'),_0x33b969[_0xe1b4('0x1e')]));_0x33b969[_0xe1b4('0x50')](_0x33b969['context'],_0x33b969['extension'],parseInt(_0x33b969[_0xe1b4('0x45')],0xa)+0x1);_0x33b969['close']();}}function main(){var _0x55bca2;return utilLicense[_0xe1b4('0x52')]()[_0xe1b4('0x2b')](function(_0x194e66){if(_0x194e66){if(_0x194e66['voice']){if(_0x194e66['callysquare']&&_0x194e66[_0xe1b4('0x53')]>0x0){logger[_0xe1b4('0x10')](util['format'](_0xe1b4('0x54'),_0x194e66['callysquare']));_0x55bca2=_0x194e66[_0xe1b4('0x53')];}else{logger[_0xe1b4('0x10')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xe1b4('0x10')](_0xe1b4('0x55'));_0x55bca2=-0x1;}}})[_0xe1b4('0x2c')](function(_0x36c375){logger[_0xe1b4('0xc')](_0xe1b4('0x56'),_0x36c375[_0xe1b4('0xd')]);})[_0xe1b4('0x4b')](function(){var _0x286ae8=require(_0xe1b4('0x57'))(config['agi'][_0xe1b4('0x58')],config['agi']['ip'],_0x55bca2);_0x286ae8['on'](_0xe1b4('0xc'),errorHandler);_0x286ae8['on'](_0xe1b4('0x59'),listeningHandler);_0x286ae8['on'](_0xe1b4('0x5a'),connectionHandler);_0x286ae8['on'](_0xe1b4('0x4e'),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 4733573..1f4312c 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 _0x2f5b=['SendMail','bluebird','jayson/promise','client','request','then','error','catch','sendMailMessage'];(function(_0x40536f,_0x4a414a){var _0xddb2d1=function(_0x479a44){while(--_0x479a44){_0x40536f['push'](_0x40536f['shift']());}};_0xddb2d1(++_0x4a414a);}(_0x2f5b,0x1a8));var _0xb2f5=function(_0x45d7c5,_0x1b145b){_0x45d7c5=_0x45d7c5-0x0;var _0x183633=_0x2f5b[_0x45d7c5];return _0x183633;};'use strict';var BPromise=require(_0xb2f5('0x0'));var jayson=require(_0xb2f5('0x1'));var client=jayson[_0xb2f5('0x2')]['http']({'port':0x232b});function request(_0x72847b,_0x2ca90d){return new BPromise(function(_0x1a0d35,_0x4ec160){return client[_0xb2f5('0x3')](_0x72847b,_0x2ca90d)[_0xb2f5('0x4')](function(_0x2427b0){if(_0x2427b0['error']){return _0x4ec160(_0x2427b0[_0xb2f5('0x5')]['message']);}else{return _0x1a0d35(_0x2427b0['result']);}})[_0xb2f5('0x6')](function(_0x3cfa7f){return _0x4ec160(_0x3cfa7f);});});}exports[_0xb2f5('0x7')]=function(_0x27ec14,_0xe6ea43){return request(_0xb2f5('0x8'),{'account':_0x27ec14,'message':_0xe6ea43});}; \ No newline at end of file +var _0x2b66=['jayson/promise','http','request','then','error','result','sendMailMessage','SendMail','bluebird'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x2b66,0xe9));var _0x62b6=function(_0x10db5e,_0x63485a){_0x10db5e=_0x10db5e-0x0;var _0x54a2d6=_0x2b66[_0x10db5e];return _0x54a2d6;};'use strict';var BPromise=require(_0x62b6('0x0'));var jayson=require(_0x62b6('0x1'));var client=jayson['client'][_0x62b6('0x2')]({'port':0x232b});function request(_0x4b09ee,_0x112295){return new BPromise(function(_0x28e5e7,_0x39e7b1){return client[_0x62b6('0x3')](_0x4b09ee,_0x112295)[_0x62b6('0x4')](function(_0x3d2119){if(_0x3d2119[_0x62b6('0x5')]){return _0x39e7b1(_0x3d2119['error']['message']);}else{return _0x28e5e7(_0x3d2119[_0x62b6('0x6')]);}})['catch'](function(_0x6ad6a8){return _0x39e7b1(_0x6ad6a8);});});}exports[_0x62b6('0x7')]=function(_0x33b732,_0x4e87a5){return request(_0x62b6('0x8'),{'account':_0x33b732,'message':_0x4e87a5});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index da0f39c..c7a9176 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 _0xd802=['substring','split','slice','trim','length','emit','line','exports','stream','Transform','call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf'];(function(_0x17055a,_0x5aa499){var _0xea5e0a=function(_0x1cf027){while(--_0x1cf027){_0x17055a['push'](_0x17055a['shift']());}};_0xea5e0a(++_0x5aa499);}(_0xd802,0x7a));var _0x2d80=function(_0x1249f4,_0x27226c){_0x1249f4=_0x1249f4-0x0;var _0x47c8a9=_0xd802[_0x1249f4];return _0x47c8a9;};'use strict';var util=require('util');var Transform=require(_0x2d80('0x0'))[_0x2d80('0x1')];function AGIReply(_0x48309d){Transform[_0x2d80('0x2')](this,_0x48309d);this['_localBuffer']='';this[_0x2d80('0x3')]=![];}util[_0x2d80('0x4')](AGIReply,Transform);AGIReply[_0x2d80('0x5')][_0x2d80('0x6')]=function(_0x590cb3,_0x49cded,_0xf81f6f){var _0x22c27c='\x0a',_0xe79ee2=['\x0a\x0a',_0x2d80('0x7')],_0x5374c1=-0x1,_0x1b66c3=-0x1,_0xc9b900='',_0x5ec831=0x0,_0x4d6e6a='',_0x502800='';this[_0x2d80('0x8')]+=_0x590cb3[_0x2d80('0x9')]();_0x4d6e6a=this[_0x2d80('0x8')];if(!this[_0x2d80('0x3')]){_0x5ec831=0x0;while(_0xe79ee2[_0x5ec831]){while((_0x1b66c3=_0x4d6e6a[_0x2d80('0xa')](_0xe79ee2[_0x5ec831]))!=-0x1){_0xc9b900=_0xe79ee2[_0x5ec831];_0x502800=_0x4d6e6a[_0x2d80('0xb')](0x0,_0x1b66c3);_0x4d6e6a=_0x4d6e6a[_0x2d80('0xb')](_0x1b66c3+_0xc9b900['length']);var _0x3b469a=_0x502800[_0x2d80('0xc')](_0x22c27c),_0x598f17=0x0,_0x2e645c={},_0x54c2f3='',_0x61411e='',_0x78d051=-0x1;while(_0x3b469a[_0x598f17]){_0x78d051=_0x3b469a[_0x598f17][_0x2d80('0xa')](':');if(_0x78d051!=-0x1){_0x54c2f3=_0x3b469a[_0x598f17][_0x2d80('0xd')](0x0,_0x78d051)['trim']();_0x61411e=_0x3b469a[_0x598f17]['slice'](_0x78d051+0x1)[_0x2d80('0xe')]();if(_0x54c2f3[_0x2d80('0xf')]>0x0){_0x2e645c[_0x54c2f3]=_0x61411e;}}else{}_0x598f17++;}this[_0x2d80('0x10')]('headers',_0x2e645c);this[_0x2d80('0x3')]=!![];}_0x5ec831++;}this['_localBuffer']=_0x4d6e6a;}else{while((_0x5374c1=_0x4d6e6a[_0x2d80('0xa')](_0x22c27c))!=-0x1){_0x502800=_0x4d6e6a[_0x2d80('0xb')](0x0,_0x5374c1);this[_0x2d80('0x10')](_0x2d80('0x11'),_0x502800);_0x4d6e6a=_0x4d6e6a[_0x2d80('0xb')](_0x5374c1+_0x22c27c[_0x2d80('0xf')]);}this[_0x2d80('0x8')]=_0x4d6e6a;}_0xf81f6f();};module[_0x2d80('0x12')]=AGIReply; \ No newline at end of file +var _0xb826=['indexOf','substring','length','slice','trim','emit','headers','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString'];(function(_0x452097,_0x3ce395){var _0x2dacad=function(_0x5394ba){while(--_0x5394ba){_0x452097['push'](_0x452097['shift']());}};_0x2dacad(++_0x3ce395);}(_0xb826,0x1b8));var _0x6b82=function(_0xd75cb4,_0x3e21ef){_0xd75cb4=_0xd75cb4-0x0;var _0x453680=_0xb826[_0xd75cb4];return _0x453680;};'use strict';var util=require(_0x6b82('0x0'));var Transform=require(_0x6b82('0x1'))[_0x6b82('0x2')];function AGIReply(_0x24076f){Transform[_0x6b82('0x3')](this,_0x24076f);this[_0x6b82('0x4')]='';this[_0x6b82('0x5')]=![];}util[_0x6b82('0x6')](AGIReply,Transform);AGIReply[_0x6b82('0x7')]['_transform']=function(_0x4ae677,_0x19f2dc,_0x55921b){var _0x2edc5d='\x0a',_0x3155ee=['\x0a\x0a',_0x6b82('0x8')],_0x37b02d=-0x1,_0x591779=-0x1,_0x167d0f='',_0x14e7db=0x0,_0x28a8fe='',_0x48feb3='';this[_0x6b82('0x4')]+=_0x4ae677[_0x6b82('0x9')]();_0x28a8fe=this[_0x6b82('0x4')];if(!this[_0x6b82('0x5')]){_0x14e7db=0x0;while(_0x3155ee[_0x14e7db]){while((_0x591779=_0x28a8fe[_0x6b82('0xa')](_0x3155ee[_0x14e7db]))!=-0x1){_0x167d0f=_0x3155ee[_0x14e7db];_0x48feb3=_0x28a8fe[_0x6b82('0xb')](0x0,_0x591779);_0x28a8fe=_0x28a8fe[_0x6b82('0xb')](_0x591779+_0x167d0f[_0x6b82('0xc')]);var _0x38f89d=_0x48feb3['split'](_0x2edc5d),_0x147362=0x0,_0x266fc2={},_0x44ea6d='',_0xb20bcd='',_0xfb9a12=-0x1;while(_0x38f89d[_0x147362]){_0xfb9a12=_0x38f89d[_0x147362][_0x6b82('0xa')](':');if(_0xfb9a12!=-0x1){_0x44ea6d=_0x38f89d[_0x147362][_0x6b82('0xd')](0x0,_0xfb9a12)[_0x6b82('0xe')]();_0xb20bcd=_0x38f89d[_0x147362]['slice'](_0xfb9a12+0x1)[_0x6b82('0xe')]();if(_0x44ea6d[_0x6b82('0xc')]>0x0){_0x266fc2[_0x44ea6d]=_0xb20bcd;}}else{}_0x147362++;}this[_0x6b82('0xf')](_0x6b82('0x10'),_0x266fc2);this[_0x6b82('0x5')]=!![];}_0x14e7db++;}this[_0x6b82('0x4')]=_0x28a8fe;}else{while((_0x37b02d=_0x28a8fe[_0x6b82('0xa')](_0x2edc5d))!=-0x1){_0x48feb3=_0x28a8fe[_0x6b82('0xb')](0x0,_0x37b02d);this[_0x6b82('0xf')]('line',_0x48feb3);_0x28a8fe=_0x28a8fe['substring'](_0x37b02d+_0x2edc5d[_0x6b82('0xc')]);}this['_localBuffer']=_0x28a8fe;}_0x55921b();};module[_0x6b82('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 4540bfa..72e3fe1 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 _0xe914=['createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','agentLogin','LoginUser','agentPause','agentUnpause','LogoutUser','bluebird','moment','util','jayson/promise','client','http','request','error','message','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount'];(function(_0x4fbfeb,_0x47363e){var _0x2507ad=function(_0x158321){while(--_0x158321){_0x4fbfeb['push'](_0x4fbfeb['shift']());}};_0x2507ad(++_0x47363e);}(_0xe914,0x7f));var _0x4e91=function(_0x3ac215,_0x7ca8ae){_0x3ac215=_0x3ac215-0x0;var _0x423237=_0xe914[_0x3ac215];return _0x423237;};'use strict';var BPromise=require(_0x4e91('0x0'));var moment=require(_0x4e91('0x1'));var _=require('lodash');var util=require(_0x4e91('0x2'));var jayson=require(_0x4e91('0x3'));var client=jayson[_0x4e91('0x4')][_0x4e91('0x5')]({'port':0x2329});function request(_0x297dc0,_0x59e102){return new BPromise(function(_0x4f4e88,_0x209bfa){return client[_0x4e91('0x6')](_0x297dc0,_0x59e102)['then'](function(_0x29c27c){if(_0x29c27c[_0x4e91('0x7')]){return _0x209bfa(_0x29c27c[_0x4e91('0x7')][_0x4e91('0x8')]);}else{return _0x4f4e88(_0x29c27c['result']);}})['catch'](function(_0x1dcea3){return _0x209bfa(_0x1dcea3);});});}exports['getSquareProject']=function(_0x523dec){return request(_0x4e91('0x9'),{'options':{'raw':![],'where':{'name':_0x523dec},'attributes':[_0x4e91('0xa')]}});};exports[_0x4e91('0xb')]=function(_0x2762e9){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x2762e9},'include':[{'model':_0x4e91('0xc'),'as':_0x4e91('0xd')}],'attributes':['id',_0x4e91('0xe'),'email']}});};exports[_0x4e91('0xf')]=function(_0x21e6b8){return request(_0x4e91('0x9'),{'options':{'where':{'id':_0x21e6b8},'attributes':[_0x4e91('0xe')]}});};exports[_0x4e91('0x10')]=function(_0x30810e){return request(_0x4e91('0x11'),{'options':{'where':{'id':_0x30810e},'attributes':[_0x4e91('0xe')]}});};exports[_0x4e91('0x12')]=function(_0x5cf980){return request(_0x4e91('0x13'),{'options':{'where':{'id':_0x5cf980},'attributes':[_0x4e91('0xe')]}});};exports[_0x4e91('0x14')]=function(_0x5408ae){return request(_0x4e91('0x15'),{'options':{'where':{'id':_0x5408ae},'attributes':[_0x4e91('0x16')]}});};exports[_0x4e91('0x17')]=function(_0x443e3f){return request(_0x4e91('0x18'),{'options':{'where':{'id':_0x443e3f},'attributes':[_0x4e91('0xe')]}});};exports[_0x4e91('0x19')]=function(_0x17b9dc){return request('GetContactByPhone',{'options':{'where':{'phone':_0x17b9dc[_0x4e91('0x1a')]},'attributes':['id']}});};exports[_0x4e91('0x1b')]=function(_0x7bdc49){return request('ShowTrunk',{'options':{'where':{'id':_0x7bdc49},'attributes':[_0x4e91('0xe')]}});};exports[_0x4e91('0x1c')]=function(_0x4a332b){return request(_0x4e91('0x1d'),{'options':{'where':{'id':_0x4a332b},'attributes':[_0x4e91('0x1e')]}});};exports['getIntervalById']=function(_0x19498b){return request(_0x4e91('0x1f'),{'options':{'raw':![],'where':{'id':_0x19498b},'include':[{'model':_0x4e91('0x20'),'as':'Intervals'}]}});};exports[_0x4e91('0x21')]=function(_0x516499){return request(_0x4e91('0x22'),{'options':{'where':{'id':_0x516499},'attributes':['id',_0x4e91('0xe')]}});};exports[_0x4e91('0x23')]=function(_0x540490){return request('CreateSmsMessage',{'body':_0x540490});};exports[_0x4e91('0x24')]=function(_0x5eb85d){return request(_0x4e91('0x25'),{'body':_0x5eb85d});};exports['createSquareReport']=function(_0x2550d8){return request('CreateSquareReport',{'body':_[_0x4e91('0x26')](_0x2550d8,{'project_name':_0x2550d8[_0x4e91('0x27')],'prev_project_name':_0x2550d8[_0x4e91('0x28')]||'','is_subproject':_0x2550d8['arg_2']?!![]:![],'leaveAt':moment()[_0x4e91('0x29')](_0x4e91('0x2a'))})});};exports['createSquareRecording']=function(_0xdfa12d){return request(_0x4e91('0x2b'),{'body':_0xdfa12d});};exports[_0x4e91('0x2c')]=function(_0xba7e8f){return request(_0x4e91('0x2d'),{'body':_0xba7e8f});};exports[_0x4e91('0x2e')]=function(_0xee9a14){return request(_0x4e91('0x2f'),{'options':{'raw':![],'where':{'phone':_0xee9a14['phone'],'ListId':_0xee9a14['ListId']}}})['then'](function(_0x263dbe){if(_0x263dbe){return _0x263dbe;}return request(_0x4e91('0x30'),{'body':_0xee9a14});});};exports['getPauseById']=function(_0x35beb1){return request('ShowPause',{'options':{'where':{'id':_0x35beb1},'attributes':['name']}});};exports[_0x4e91('0x31')]=function(_0x146090,_0x14dfa6){return request(_0x4e91('0x32'),{'body':{'interface':_0x14dfa6},'options':{'where':_0x146090}});};exports[_0x4e91('0x33')]=function(_0x3e1755,_0x4f09f2,_0x587fbb){return request('PauseUser',{'body':{'type':_0x4f09f2,'uniqueid':_0x587fbb},'options':{'where':_0x3e1755}});};exports[_0x4e91('0x34')]=function(_0x125b72){return request('UnpauseUser',{'body':{},'options':{'where':_0x125b72}});};exports['agentLogout']=function(_0x4f65db){return request(_0x4e91('0x35'),{'body':{},'options':{'where':_0x4f65db}});}; \ No newline at end of file +var _0xe93b=['ShowSquareOdbc','dsn','ShowUser','getContactByPhone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','lodash','util','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','ShowVoiceQueue','ShowVariable','getSquareOdbcById'];(function(_0x3ff79c,_0x508384){var _0x5056c0=function(_0x19b094){while(--_0x19b094){_0x3ff79c['push'](_0x3ff79c['shift']());}};_0x5056c0(++_0x508384);}(_0xe93b,0x1c2));var _0xbe93=function(_0x1d310a,_0x3f7dea){_0x1d310a=_0x1d310a-0x0;var _0x3d215c=_0xe93b[_0x1d310a];return _0x3d215c;};'use strict';var BPromise=require('bluebird');var moment=require(_0xbe93('0x0'));var _=require(_0xbe93('0x1'));var util=require(_0xbe93('0x2'));var jayson=require('jayson/promise');var client=jayson[_0xbe93('0x3')][_0xbe93('0x4')]({'port':0x2329});function request(_0x39a786,_0xf6395){return new BPromise(function(_0xc103ec,_0x3cf411){return client[_0xbe93('0x5')](_0x39a786,_0xf6395)[_0xbe93('0x6')](function(_0x5ad742){if(_0x5ad742[_0xbe93('0x7')]){return _0x3cf411(_0x5ad742[_0xbe93('0x7')][_0xbe93('0x8')]);}else{return _0xc103ec(_0x5ad742[_0xbe93('0x9')]);}})[_0xbe93('0xa')](function(_0xfba559){return _0x3cf411(_0xfba559);});});}exports[_0xbe93('0xb')]=function(_0x3ed10a){return request(_0xbe93('0xc'),{'options':{'raw':![],'where':{'name':_0x3ed10a},'attributes':['production']}});};exports[_0xbe93('0xd')]=function(_0x125609){return request(_0xbe93('0xe'),{'options':{'raw':![],'where':{'id':_0x125609},'include':[{'model':_0xbe93('0xf'),'as':_0xbe93('0x10')}],'attributes':['id',_0xbe93('0x11'),'email']}});};exports[_0xbe93('0x12')]=function(_0x412f8a){return request(_0xbe93('0xc'),{'options':{'where':{'id':_0x412f8a},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0xf87f23){return request(_0xbe93('0x13'),{'options':{'where':{'id':_0xf87f23},'attributes':[_0xbe93('0x11')]}});};exports['getVariableById']=function(_0x527a2f){return request(_0xbe93('0x14'),{'options':{'where':{'id':_0x527a2f},'attributes':[_0xbe93('0x11')]}});};exports[_0xbe93('0x15')]=function(_0x3c8f76){return request(_0xbe93('0x16'),{'options':{'where':{'id':_0x3c8f76},'attributes':[_0xbe93('0x17')]}});};exports['getUserById']=function(_0x3435e5){return request(_0xbe93('0x18'),{'options':{'where':{'id':_0x3435e5},'attributes':['name']}});};exports[_0xbe93('0x19')]=function(_0x4506fc){return request('GetContactByPhone',{'options':{'where':{'phone':_0x4506fc['phone']},'attributes':['id']}});};exports[_0xbe93('0x1a')]=function(_0x37312e){return request('ShowTrunk',{'options':{'where':{'id':_0x37312e},'attributes':[_0xbe93('0x11')]}});};exports[_0xbe93('0x1b')]=function(_0x10b457){return request(_0xbe93('0x1c'),{'options':{'where':{'id':_0x10b457},'attributes':[_0xbe93('0x1d')]}});};exports[_0xbe93('0x1e')]=function(_0x3baca6){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x3baca6},'include':[{'model':_0xbe93('0x1f'),'as':_0xbe93('0x20')}]}});};exports[_0xbe93('0x21')]=function(_0xd8ba78){return request(_0xbe93('0x22'),{'options':{'where':{'id':_0xd8ba78},'attributes':['id','name']}});};exports[_0xbe93('0x23')]=function(_0x1321b8){return request(_0xbe93('0x24'),{'body':_0x1321b8});};exports[_0xbe93('0x25')]=function(_0x118e87){return request('CreateSquareDetailsReport',{'body':_0x118e87});};exports['createSquareReport']=function(_0x14629a){return request(_0xbe93('0x26'),{'body':_[_0xbe93('0x27')](_0x14629a,{'project_name':_0x14629a[_0xbe93('0x28')],'prev_project_name':_0x14629a['arg_2']||'','is_subproject':_0x14629a[_0xbe93('0x29')]?!![]:![],'leaveAt':moment()[_0xbe93('0x2a')](_0xbe93('0x2b'))})});};exports[_0xbe93('0x2c')]=function(_0x24e8ac){return request(_0xbe93('0x2d'),{'body':_0x24e8ac});};exports[_0xbe93('0x2e')]=function(_0x2d1de2){return request(_0xbe93('0x2f'),{'body':_0x2d1de2});};exports[_0xbe93('0x30')]=function(_0xdcf0c4){return request(_0xbe93('0x31'),{'options':{'raw':![],'where':{'phone':_0xdcf0c4['phone'],'ListId':_0xdcf0c4[_0xbe93('0x32')]}}})[_0xbe93('0x6')](function(_0x3eeeb5){if(_0x3eeeb5){return _0x3eeeb5;}return request(_0xbe93('0x33'),{'body':_0xdcf0c4});});};exports['getPauseById']=function(_0x3fd740){return request('ShowPause',{'options':{'where':{'id':_0x3fd740},'attributes':['name']}});};exports[_0xbe93('0x34')]=function(_0x2ccc40,_0x24f605){return request(_0xbe93('0x35'),{'body':{'interface':_0x24f605},'options':{'where':_0x2ccc40}});};exports['agentPause']=function(_0x50da57,_0x4113cd,_0x353bfe){return request(_0xbe93('0x36'),{'body':{'type':_0x4113cd,'uniqueid':_0x353bfe},'options':{'where':_0x50da57}});};exports[_0xbe93('0x37')]=function(_0x3c5790){return request(_0xbe93('0x38'),{'body':{},'options':{'where':_0x3c5790}});};exports[_0xbe93('0x39')]=function(_0x2d8611){return request(_0xbe93('0x3a'),{'body':{},'options':{'where':_0x2d8611}});}; \ 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 fed3f0e..aba61cf 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 _0x647c=['exports','./polly'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x647c,0x1d3));var _0xc647=function(_0x30fae7,_0x562858){_0x30fae7=_0x30fae7-0x0;var _0x1dbd52=_0x647c[_0x30fae7];return _0x1dbd52;};var polly=require(_0xc647('0x0'));var lex=require('./lex');module[_0xc647('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xf360=['./lex','exports','./polly'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf360,0x9e));var _0x0f36=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf360[_0x20a584];return _0x4b41a8;};var polly=require(_0x0f36('0x0'));var lex=require(_0x0f36('0x1'));module[_0x0f36('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 1273693..bc6d59b 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x3d5d4e,_0x33a55d,_0x5527b3,_0x175deb,_0xd002ca,_0x200b2a){return lex(_0x3d5d4e,_0x33a55d,_0x5527b3,_0x175deb,_0xd002ca,_0x200b2a);}; \ No newline at end of file +var _0xb43b=['./lib/api','exports'];(function(_0x4697fa,_0x21c841){var _0x390950=function(_0x3deb8a){while(--_0x3deb8a){_0x4697fa['push'](_0x4697fa['shift']());}};_0x390950(++_0x21c841);}(_0xb43b,0x1b2));var _0xbb43=function(_0xc9c605,_0x515a65){_0xc9c605=_0xc9c605-0x0;var _0x43394c=_0xb43b[_0xc9c605];return _0x43394c;};'use strict';var lex=require(_0xbb43('0x0'));module[_0xbb43('0x1')]=function(_0x5c45dd,_0x1bdcfc,_0x1995f8,_0x22bc86,_0x4cf605,_0x131e9e){return lex(_0x5c45dd,_0x1bdcfc,_0x1995f8,_0x22bc86,_0x4cf605,_0x131e9e);}; \ 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 6c03db0..52fbac1 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(_0x593d7b,_0x129e81){var _0xaa2568=function(_0x1b8561){while(--_0x1b8561){_0x593d7b['push'](_0x593d7b['shift']());}};_0xaa2568(++_0x129e81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x9b9193,_0x35a06b){var _0x5b9dae=function(_0x5d2ab3){while(--_0x5d2ab3){_0x9b9193['push'](_0x9b9193['shift']());}};_0x5b9dae(++_0x35a06b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 26bcacd..4dae327 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. * // * * // ************************************************************************* -'use strict';var polly=require('./lib/api');module['exports']=function(_0x3d5e77,_0x1145e8,_0x740bfd,_0x2e2495,_0xd19feb,_0x24dba2,_0x4c5b2c){return polly(_0x3d5e77,_0x1145e8,_0x740bfd,_0x2e2495,_0xd19feb,_0x24dba2,_0x4c5b2c);}; \ No newline at end of file +var _0xed9e=['exports','./lib/api'];(function(_0x12c668,_0x5b3f48){var _0x4efa7c=function(_0x4c6669){while(--_0x4c6669){_0x12c668['push'](_0x12c668['shift']());}};_0x4efa7c(++_0x5b3f48);}(_0xed9e,0x6d));var _0xeed9=function(_0x1509c6,_0x47611e){_0x1509c6=_0x1509c6-0x0;var _0x57ae28=_0xed9e[_0x1509c6];return _0x57ae28;};'use strict';var polly=require(_0xeed9('0x0'));module[_0xeed9('0x1')]=function(_0x70a612,_0x5e93fa,_0x327e92,_0x57a143,_0x36b8db,_0x5340c9,_0x5aa69a){return polly(_0x70a612,_0x5e93fa,_0x327e92,_0x57a143,_0x36b8db,_0x5340c9,_0x5aa69a);}; \ 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 30f1daf..63d68b4 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 _0x8f78=['mp3','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x1be579,_0x3d6341){var _0x3afb8f=function(_0x14c208){while(--_0x14c208){_0x1be579['push'](_0x1be579['shift']());}};_0x3afb8f(++_0x3d6341);}(_0x8f78,0x1af));var _0x88f7=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x8f78[_0x1ac595];return _0x455fff;};'use strict';var fs=require('fs');var path=require(_0x88f7('0x0'));var BPromise=require('bluebird');var rs=require(_0x88f7('0x1'));var AWS=require(_0x88f7('0x2'));function pollyResult(_0x224b49,_0x4d626a,_0x5df25a){return new BPromise(function(_0x34252d,_0x5c0b50){_0x224b49[_0x88f7('0x3')](_0x4d626a,function(_0x534de9,_0x251be1){if(_0x534de9){_0x5c0b50(_0x534de9);}else if(_0x251be1){if(_0x251be1[_0x88f7('0x4')]instanceof Buffer){fs['writeFile'](_0x5df25a,_0x251be1[_0x88f7('0x4')],function(_0x43d21d){if(_0x43d21d){_0x5c0b50(_0x43d21d);}else{_0x34252d();}});}else{_0x5c0b50(new Error(_0x88f7('0x5')));}}else{_0x5c0b50(new Error(_0x88f7('0x6')));}});});}module[_0x88f7('0x7')]=function(_0x5f8721,_0x30cfb5,_0x5a6d1c,_0x48f326,_0x7fff56,_0x1bcd1b,_0x162ba0){var _0x5e20db=new AWS[(_0x88f7('0x8'))]({'accessKeyId':_0x5f8721,'secretAccessKey':_0x30cfb5,'region':_0x5a6d1c});var _0x72f7ff={'Text':_0x7fff56,'TextType':_0x1bcd1b||'text','OutputFormat':_0x88f7('0x9'),'VoiceId':_0x48f326};return pollyResult(_0x5e20db,_0x72f7ff,_0x162ba0);}; \ No newline at end of file +var _0xa6a6=['mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x136d09,_0x36ca45){var _0x2605a1=function(_0x2ead56){while(--_0x2ead56){_0x136d09['push'](_0x136d09['shift']());}};_0x2605a1(++_0x36ca45);}(_0xa6a6,0x181));var _0x6a6a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa6a6[_0x2dafbe];return _0x58a45a;};'use strict';var fs=require('fs');var path=require(_0x6a6a('0x0'));var BPromise=require(_0x6a6a('0x1'));var rs=require(_0x6a6a('0x2'));var AWS=require(_0x6a6a('0x3'));function pollyResult(_0x115729,_0x1bac72,_0x5cd866){return new BPromise(function(_0x3d0c87,_0x53f630){_0x115729[_0x6a6a('0x4')](_0x1bac72,function(_0x99fff8,_0x3d900a){if(_0x99fff8){_0x53f630(_0x99fff8);}else if(_0x3d900a){if(_0x3d900a[_0x6a6a('0x5')]instanceof Buffer){fs[_0x6a6a('0x6')](_0x5cd866,_0x3d900a['AudioStream'],function(_0xe3351e){if(_0xe3351e){_0x53f630(_0xe3351e);}else{_0x3d0c87();}});}else{_0x53f630(new Error(_0x6a6a('0x7')));}}else{_0x53f630(new Error(_0x6a6a('0x8')));}});});}module[_0x6a6a('0x9')]=function(_0x24b208,_0x50423f,_0x584854,_0x48064f,_0x14b3f3,_0x471b12,_0x38532f){var _0x3b6493=new AWS[(_0x6a6a('0xa'))]({'accessKeyId':_0x24b208,'secretAccessKey':_0x50423f,'region':_0x584854});var _0x280d66={'Text':_0x14b3f3,'TextType':_0x471b12||'text','OutputFormat':_0x6a6a('0xb'),'VoiceId':_0x48064f};return pollyResult(_0x3b6493,_0x280d66,_0x38532f);}; \ 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 ca1cb8a..a78842a 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 _0x50c9=['exports','./lib/api'];(function(_0x1c72ac,_0x380a0e){var _0x274e46=function(_0x1bbadf){while(--_0x1bbadf){_0x1c72ac['push'](_0x1c72ac['shift']());}};_0x274e46(++_0x380a0e);}(_0x50c9,0x1c7));var _0x950c=function(_0xd02e22,_0x579fae){_0xd02e22=_0xd02e22-0x0;var _0x51cc1e=_0x50c9[_0xd02e22];return _0x51cc1e;};'use strict';var asr=require(_0x950c('0x0'));module[_0x950c('0x1')]=function(_0xbfa19a,_0x52f381,_0x46c907,_0x2e1dbe){return asr(_0xbfa19a,_0x52f381,_0x46c907);}; \ No newline at end of file +var _0x6878=['exports','./lib/api'];(function(_0x2ed502,_0x3b7fab){var _0x191886=function(_0x446add){while(--_0x446add){_0x2ed502['push'](_0x2ed502['shift']());}};_0x191886(++_0x3b7fab);}(_0x6878,0x1b5));var _0x8687=function(_0x27a8ec,_0x102c7b){_0x27a8ec=_0x27a8ec-0x0;var _0x12aab1=_0x6878[_0x27a8ec];return _0x12aab1;};'use strict';var asr=require(_0x8687('0x0'));module[_0x8687('0x1')]=function(_0x5f2261,_0x431073,_0x32f5a3,_0x137413){return asr(_0x5f2261,_0x431073,_0x32f5a3);}; \ 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 8061308..d7f5b7d 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 _0x0fc2=['readFileSync','base64','POST','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x0fc2,0x6e));var _0x20fc=function(_0x377f21,_0x23cd63){_0x377f21=_0x377f21-0x0;var _0x547252=_0x0fc2[_0x377f21];return _0x547252;};'use strict';var url=require(_0x20fc('0x0'));var BPromise=require(_0x20fc('0x1'));var fs=require('fs');var host=_0x20fc('0x2');module[_0x20fc('0x3')]=function(_0x51d2ab,_0x46b3ae,_0xba56f5){return new BPromise(function(_0x4765f2,_0x2b95b8){var _0x14a9af;if(typeof _0x51d2ab!==_0x20fc('0x4')||_0x51d2ab[_0x20fc('0x5')]===0x0){return _0x2b95b8(_0x20fc('0x6'));}if(typeof _0x46b3ae!==_0x20fc('0x4')||_0x46b3ae[_0x20fc('0x5')]===0x0){return _0x2b95b8(_0x20fc('0x7'));}if(typeof _0xba56f5!==_0x20fc('0x8')&&(typeof _0xba56f5!==_0x20fc('0x4')||_0xba56f5[_0x20fc('0x5')]===0x0)){return _0x2b95b8(_0x20fc('0x9'));}try{_0x14a9af=fs[_0x20fc('0xa')](_0x51d2ab)['toString'](_0x20fc('0xb'));}catch(_0x3f25d1){return _0x2b95b8(_0x3f25d1);}return _0x4765f2({'method':_0x20fc('0xc'),'uri':host+'/v1/speech:recognize?key='+_0x46b3ae,'body':{'config':{'encoding':_0x20fc('0xd'),'sampleRateHertz':_0x20fc('0xe'),'languageCode':_0xba56f5},'audio':{'content':_0x14a9af}},'json':!![]});});}; \ No newline at end of file +var _0x6931=['url','bluebird','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000'];(function(_0xcf82b2,_0x49ab9a){var _0x4275e9=function(_0x5b768f){while(--_0x5b768f){_0xcf82b2['push'](_0xcf82b2['shift']());}};_0x4275e9(++_0x49ab9a);}(_0x6931,0xa5));var _0x1693=function(_0x3402b8,_0x4f5412){_0x3402b8=_0x3402b8-0x0;var _0x155ace=_0x6931[_0x3402b8];return _0x155ace;};'use strict';var url=require(_0x1693('0x0'));var BPromise=require(_0x1693('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x7828b9,_0x190052,_0x37c53b){return new BPromise(function(_0x528500,_0x1c8ac6){var _0x3ea966;if(typeof _0x7828b9!==_0x1693('0x2')||_0x7828b9['length']===0x0){return _0x1c8ac6(_0x1693('0x3'));}if(typeof _0x190052!=='string'||_0x190052[_0x1693('0x4')]===0x0){return _0x1c8ac6(_0x1693('0x5'));}if(typeof _0x37c53b!==_0x1693('0x6')&&(typeof _0x37c53b!==_0x1693('0x2')||_0x37c53b[_0x1693('0x4')]===0x0)){return _0x1c8ac6(_0x1693('0x7'));}try{_0x3ea966=fs[_0x1693('0x8')](_0x7828b9)[_0x1693('0x9')](_0x1693('0xa'));}catch(_0x1b48f7){return _0x1c8ac6(_0x1b48f7);}return _0x528500({'method':_0x1693('0xb'),'uri':host+_0x1693('0xc')+_0x190052,'body':{'config':{'encoding':_0x1693('0xd'),'sampleRateHertz':_0x1693('0xe'),'languageCode':_0x37c53b},'audio':{'content':_0x3ea966}},'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 22de9de..01a9d9d 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 _0xddae=['./asr'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xddae,0xe3));var _0xedda=function(_0x345753,_0x324dd8){_0x345753=_0x345753-0x0;var _0x4e53bc=_0xddae[_0x345753];return _0x4e53bc;};var asr=require(_0xedda('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x4c7f=['./asr','exports'];(function(_0x2c6b86,_0x18f856){var _0x1f8dfe=function(_0x5b3ded){while(--_0x5b3ded){_0x2c6b86['push'](_0x2c6b86['shift']());}};_0x1f8dfe(++_0x18f856);}(_0x4c7f,0x1e6));var _0xf4c7=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x4c7f[_0x31ced5];return _0x10d9e5;};var asr=require(_0xf4c7('0x0'));module[_0xf4c7('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 08cb58e..41e6ae1 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 _0xbfe4=['replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','fields','diagnosticInfo','end_conversation','boolValue','intent','isFallback','queryText','responseId','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','transcript','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','path','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','close','unlink','error','download\x20error','pipe','https:','data','end','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','POST','audioContent','writeFile','.wav','chmodSync','info','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','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr','results','map','alternatives','join','confidence','googleASR\x20transcription','catch','name','message','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','googleDialogflowV2'];(function(_0x484374,_0x2a1bfd){var _0x4e53d5=function(_0x427b21){while(--_0x427b21){_0x484374['push'](_0x484374['shift']());}};_0x4e53d5(++_0x2a1bfd);}(_0xbfe4,0x12c));var _0x4bfe=function(_0x4d3f23,_0x43e464){_0x4d3f23=_0x4d3f23-0x0;var _0x2dd310=_0xbfe4[_0x4d3f23];return _0x2dd310;};'use strict';var apiai=require(_0x4bfe('0x0'));var BPromise=require(_0x4bfe('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x4bfe('0x2'));var https=require(_0x4bfe('0x3'));var md5=require('md5');var path=require(_0x4bfe('0x4'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0x4bfe('0x5'));var sox=require(_0x4bfe('0x6'));var tts=require(_0x4bfe('0x7'));var urlParse=require(_0x4bfe('0x8'))[_0x4bfe('0x9')];var util=require(_0x4bfe('0xa'));var aws=require(_0x4bfe('0xb'));var google=require(_0x4bfe('0xc'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0x4bfe('0xd'))(_0x4bfe('0xe'));var ISPEECH_API=_0x4bfe('0xf');function downloadFile(_0x130da7,_0xd39cc4){return new BPromise(function(_0x92effc,_0x1ce33a){var _0x58d48b=urlParse(_0x130da7);var _0x28f77c=_0x58d48b[_0x4bfe('0x10')]==='https:'?https:http;var _0x6db40c={'host':_0x58d48b[_0x4bfe('0x11')],'path':_0x58d48b[_0x4bfe('0x4')],'headers':{'user-agent':_0x4bfe('0x12')}};_0x28f77c[_0x4bfe('0x13')](_0x6db40c,function(_0x12ef08){if(_0x12ef08[_0x4bfe('0x14')]!==0xc8){logger['error']('request\x20to\x20'+_0x130da7+_0x4bfe('0x15')+_0x12ef08[_0x4bfe('0x14')]+'\x20('+_0x12ef08[_0x4bfe('0x16')]+')');_0x1ce33a(new Error(_0x4bfe('0x17')+_0x130da7+_0x4bfe('0x15')+_0x12ef08[_0x4bfe('0x14')]+'\x20('+_0x12ef08[_0x4bfe('0x16')]+')'));return;}var _0x2c2898=fs[_0x4bfe('0x18')](_0xd39cc4);_0x2c2898['on'](_0x4bfe('0x19'),function(){logger['info'](_0x4bfe('0x1a'));_0x2c2898[_0x4bfe('0x1b')](_0x92effc);});_0x2c2898['on']('error',function(_0x583114){fs[_0x4bfe('0x1c')](_0xd39cc4);logger[_0x4bfe('0x1d')](_0x4bfe('0x1e'),_0x583114);_0x1ce33a(_0x583114);});_0x12ef08[_0x4bfe('0x1f')](_0x2c2898);})['on'](_0x4bfe('0x1d'),function(_0x55ea52){logger[_0x4bfe('0x1d')](_0x55ea52);_0x1ce33a(_0x55ea52);})['end']();});}function uploadFile(_0x2f9bd5){return new BPromise(function(_0x40c970,_0x652c2b){var _0x183164=urlParse(_0x2f9bd5);var _0x39d58a=_0x183164[_0x4bfe('0x10')]===_0x4bfe('0x20')?https:http;var _0x4c472b={'host':_0x183164[_0x4bfe('0x11')],'path':_0x183164[_0x4bfe('0x4')],'headers':{'user-agent':_0x4bfe('0x12')}};_0x39d58a[_0x4bfe('0x13')](_0x4c472b,function(_0x4aaf00){if(_0x4aaf00[_0x4bfe('0x14')]!==0xc8){_0x652c2b(new Error('request\x20to\x20'+_0x2f9bd5+'\x20failed,\x20status\x20code\x20=\x20'+_0x4aaf00[_0x4bfe('0x14')]+'\x20('+_0x4aaf00[_0x4bfe('0x16')]+')'));return;}var _0x9b7d25='';_0x4aaf00['on'](_0x4bfe('0x21'),function(_0x55e7fd){_0x9b7d25+=_0x55e7fd;});_0x4aaf00['on'](_0x4bfe('0x22'),function(){_0x40c970(_0x9b7d25);});})['on'](_0x4bfe('0x1d'),function(_0x1a814c){_0x652c2b(_0x1a814c);})[_0x4bfe('0x22')]();});}function convertFile(_0x15187a,_0x379709){return new BPromise(function(_0x30a629,_0x475791){var _0x17ff96=sox['transcode'](_0x15187a,_0x379709,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x17ff96['on'](_0x4bfe('0x1d'),function(_0x1f2b25){logger['error']('error\x20convert',_0x1f2b25);_0x475791(_0x1f2b25);});_0x17ff96['on'](_0x4bfe('0x22'),function(){logger['info'](_0x4bfe('0x23'));_0x30a629();});_0x17ff96[_0x4bfe('0x24')]();});}function base64Decode(_0x33234e,_0x5e179e){var _0x268c45=path[_0x4bfe('0x25')](__dirname,_0x4bfe('0x26'),rs[_0x4bfe('0x27')](0x4)+'.wav');fs[_0x4bfe('0x28')](_0x268c45,_0x33234e,_0x4bfe('0x29'));return convertFile(_0x268c45,_0x5e179e)[_0x4bfe('0x2a')](function(){try{fs[_0x4bfe('0x1c')](_0x268c45);fs['chmodSync'](_0x5e179e,_0x4bfe('0x2b'));}catch(_0x317e18){logger['error'](_0x317e18);}return _0x5e179e[_0x4bfe('0x2c')]('.')[0x0];});}function base64Encode(_0xe642db){var _0x41f274=fs[_0x4bfe('0x2d')](_0xe642db);return new Buffer(_0x41f274)[_0x4bfe('0x2e')](_0x4bfe('0x29'));}exports[_0x4bfe('0x2f')]=function(_0x29e9f3,_0x41a037,_0x21f82b,_0x5e0c82,_0xc8ebca,_0x4b7e86){var _0x42592a,_0x1086be;var _0x4a6baa=_0x4bfe('0x30');var _0x5af19d=_0x4bfe('0x31')+_0x29e9f3;var _0x13d15f={};if(_0x41a037===_0x4bfe('0x32')){_0x13d15f[_0x4bfe('0x33')]={'ssml':_0x21f82b};}else{_0x13d15f[_0x4bfe('0x33')]={'text':_0x21f82b};};_0x13d15f[_0x4bfe('0x34')]={'languageCode':_0x5e0c82,'ssmlGender':_0xc8ebca};_0x13d15f[_0x4bfe('0x35')]={'audioEncoding':_0x4bfe('0x36'),'sampleRateHertz':0x1f40};var _0x572b18={'url':_0x4a6baa+'text:synthesize'+_0x5af19d,'method':_0x4bfe('0x37'),'json':!![],'body':_0x13d15f};return rp(_0x572b18)[_0x4bfe('0x2a')](function(_0x14e5fb){return new BPromise(function(_0x176d15,_0xdfe6b6){_0x42592a=path[_0x4bfe('0x25')](__dirname,'tmp',rs[_0x4bfe('0x27')](0x4)+'.mp3');var _0x484617=Buffer['from'](_0x14e5fb[_0x4bfe('0x38')],_0x4bfe('0x29'));return fs[_0x4bfe('0x39')](_0x42592a,_0x484617,function(_0x4737bf){_0xdfe6b6(_0x4737bf);},function(_0x4bdc37){fs['chmodSync'](_0x42592a,_0x4bfe('0x2b'));_0x176d15(_0x4bdc37);});});})[_0x4bfe('0x2a')](function(_0x5b59ed){_0x1086be=path[_0x4bfe('0x25')](__dirname,'tmp',rs[_0x4bfe('0x27')](0x4)+_0x4bfe('0x3a'));return convertFile(_0x42592a,_0x1086be);})[_0x4bfe('0x2a')](function(){try{fs[_0x4bfe('0x1c')](_0x42592a);fs[_0x4bfe('0x3b')](_0x1086be,_0x4bfe('0x2b'));}catch(_0x180ba1){logger[_0x4bfe('0x1d')](_0x180ba1);}logger[_0x4bfe('0x3c')](_0x4bfe('0x3d'),_0x1086be['split']('.')[0x0]);return _0x1086be['split']('.')[0x0];});};exports[_0x4bfe('0x3e')]=function(_0x4cdfc8,_0x395bb5){var _0x2c1228=_0x4bfe('0x3f');var _0x193728,_0x5e57d4;var _0x5a2059;var _0x13f8e6={'encoding':_0x4bfe('0x40'),'method':'POST','timeout':0x2710,'url':_0x2c1228,'headers':{'Content-Type':_0x4bfe('0x41')},'body':'f.req='+encodeURIComponent(JSON[_0x4bfe('0x42')]([[[_0x4bfe('0x43'),JSON[_0x4bfe('0x42')]([_0x4cdfc8,_0x395bb5||'en',![],_0x4bfe('0x44')]),null,'generic']]]))};return rp(_0x13f8e6)[_0x4bfe('0x2a')](function(_0x3d55fd){try{_0x5a2059=eval(_0x3d55fd[_0x4bfe('0x45')](0x5))[0x0][0x2];}catch(_0x44e368){throw new Error(_0x4bfe('0x46')+_0x3d55fd[_0x4bfe('0x21')]);}if(!_0x5a2059){if(_0x4cdfc8[_0x4bfe('0x47')]>0xc8){throw new Error(_0x4bfe('0x48'));}else{throw new Error('lang\x20\x22'+_0x395bb5+_0x4bfe('0x49'));}}try{_0x5a2059=eval(_0x5a2059)[0x0];}catch(_0x3535c9){throw new Error(_0x4bfe('0x46')+res[_0x4bfe('0x21')]);}const _0x435813=_0x5a2059;_0x193728=path[_0x4bfe('0x25')](__dirname,_0x4bfe('0x26'),rs[_0x4bfe('0x27')](0x4)+_0x4bfe('0x4a'));fs['writeFileSync'](_0x193728,_0x5a2059,{'encoding':_0x4bfe('0x29')});_0x5e57d4=path['resolve'](__dirname,_0x4bfe('0x26'),rs[_0x4bfe('0x27')](0x4)+_0x4bfe('0x3a'));return convertFile(_0x193728,_0x5e57d4);})[_0x4bfe('0x2a')](function(){try{fs['unlink'](_0x193728);fs[_0x4bfe('0x3b')](_0x5e57d4,_0x4bfe('0x2b'));}catch(_0x2e932c){logger[_0x4bfe('0x1d')](_0x2e932c);}logger['info'](_0x4bfe('0x4b'),_0x5e57d4['split']('.')[0x0]);return _0x5e57d4[_0x4bfe('0x2c')]('.')[0x0];});};exports[_0x4bfe('0x4c')]=function(_0x1deb91,_0x4e47d7,_0xf54307){return google[_0x4bfe('0x4d')](_0x1deb91,_0x4e47d7,_0xf54307)[_0x4bfe('0x2a')](function(_0x3d782c){logger[_0x4bfe('0x3c')](_0x3d782c['uri']);return rp(_0x3d782c);})[_0x4bfe('0x2a')](function(_0x4c9fab){var _0x806c9d='';var _0x3ea267=0x0;try{fs[_0x4bfe('0x1c')](_0x1deb91);}catch(_0x1dbf7d){logger[_0x4bfe('0x1d')](_0x1dbf7d);}if(_0x4c9fab&&_0x4c9fab[_0x4bfe('0x4e')]){_0x806c9d=_0x4c9fab[_0x4bfe('0x4e')][_0x4bfe('0x4f')](function(_0x457220){return _0x457220&&_0x457220[_0x4bfe('0x50')][0x0]&&_0x457220[_0x4bfe('0x50')][0x0]['transcript']?_0x457220[_0x4bfe('0x50')][0x0]['transcript']:'';})[_0x4bfe('0x51')]('\x0a');_0x3ea267=_0x4c9fab[_0x4bfe('0x4e')][_0x4bfe('0x4f')](function(_0x21cb8d){return _0x21cb8d&&_0x21cb8d[_0x4bfe('0x50')][0x0]&&_0x21cb8d['alternatives'][0x0][_0x4bfe('0x52')]?_0x21cb8d[_0x4bfe('0x50')][0x0][_0x4bfe('0x52')]:0x0;})[_0x4bfe('0x51')]('\x0a');}logger['info'](_0x4bfe('0x53'),_0x806c9d);logger[_0x4bfe('0x3c')]('googleASR\x20confidence',_0x3ea267);return{'transcript':_0x806c9d,'confidence':_0x3ea267};})[_0x4bfe('0x54')](function(_0x1365ae){logger[_0x4bfe('0x1d')]('[%s]\x20%s:%s',_0x1365ae[_0x4bfe('0x14')],_0x1365ae[_0x4bfe('0x55')],_0x1365ae[_0x4bfe('0x56')]);});};exports['googleDialogflow']=function(_0x3b81fe,_0x57983d,_0x245ba2,_0x132064){var _0x7d2da7=apiai(_0x57983d,{'language':_0x132064||'en'});return _0x7d2da7[_0x4bfe('0x57')](_0x245ba2,{'sessionId':md5(_0x3b81fe)})[_0x4bfe('0x2a')](function(_0x5123f3){logger[_0x4bfe('0x3c')](JSON[_0x4bfe('0x42')](_0x5123f3));return{'source':_0x5123f3['result'][_0x4bfe('0x58')],'resolvedQuery':_0x5123f3[_0x4bfe('0x59')][_0x4bfe('0x5a')],'action':_0x5123f3[_0x4bfe('0x59')][_0x4bfe('0x5b')],'actionIncomplete':_0x5123f3['result'][_0x4bfe('0x5c')],'speech':_0x5123f3[_0x4bfe('0x59')][_0x4bfe('0x5d')]['speech'],'score':_0x5123f3[_0x4bfe('0x59')][_0x4bfe('0x5e')],'statusCode':_0x5123f3[_0x4bfe('0x5f')][_0x4bfe('0x60')],'endConversation':_0x5123f3['result'][_0x4bfe('0x61')]['endConversation']||![],'isFallbackIntent':_0x5123f3[_0x4bfe('0x59')][_0x4bfe('0x61')]['isFallbackIntent']};});};exports[_0x4bfe('0x62')]=function(_0x2a3e63,_0x329ba2,_0x50e914,_0x40ef98,_0x129834,_0x2838f2){var _0x53eeda=_0x40ef98[_0x4bfe('0x63')](/\\n/g,'\x0a');var _0x2e75f6={'credentials':{'private_key':_0x53eeda,'client_email':_0x50e914}};var _0x4aeef0=new dialogflow[(_0x4bfe('0x64'))](_0x2e75f6);var _0x2141f3=_0x4aeef0['sessionPath'](_0x329ba2,md5(_0x2a3e63));var _0x1d120d={'session':_0x2141f3,'queryInput':{'text':{'text':_0x129834,'languageCode':_0x2838f2}}};return _0x4aeef0[_0x4bfe('0x65')](_0x1d120d)[_0x4bfe('0x2a')](function(_0x342c77){if(_0x342c77&&_0x342c77[_0x4bfe('0x47')]){logger[_0x4bfe('0x3c')](_0x4bfe('0x66'),JSON[_0x4bfe('0x42')](_0x342c77));var _0x50f3ca=_0x342c77[0x0];if(_0x50f3ca){var _0x355c59={'action':_0x50f3ca['queryResult'][_0x4bfe('0x5b')],'allRequiredParamsPresent':_0x50f3ca[_0x4bfe('0x67')][_0x4bfe('0x68')],'endConversation':_0x50f3ca[_0x4bfe('0x67')]['diagnosticInfo']&&_0x50f3ca[_0x4bfe('0x67')]['diagnosticInfo'][_0x4bfe('0x69')]?_0x50f3ca[_0x4bfe('0x67')][_0x4bfe('0x6a')][_0x4bfe('0x69')][_0x4bfe('0x6b')][_0x4bfe('0x6c')]:![],'fulfillmentText':_0x50f3ca['queryResult']['fulfillmentText'],'intentName':_0x50f3ca[_0x4bfe('0x67')]['intent'][_0x4bfe('0x55')],'intentDisplayName':_0x50f3ca[_0x4bfe('0x67')][_0x4bfe('0x6d')]['displayName'],'isFallbackIntent':_0x50f3ca[_0x4bfe('0x67')][_0x4bfe('0x6d')][_0x4bfe('0x6e')],'languageCode':_0x50f3ca[_0x4bfe('0x67')]['languageCode'],'queryText':_0x50f3ca[_0x4bfe('0x67')][_0x4bfe('0x6f')],'responseId':_0x50f3ca[_0x4bfe('0x70')],'score':_0x50f3ca[_0x4bfe('0x67')]['intentDetectionConfidence'],'speech':_0x50f3ca['queryResult'][_0x4bfe('0x71')],'providerResponse':JSON[_0x4bfe('0x42')](_0x342c77)};return _0x355c59;}}});};exports[_0x4bfe('0x72')]=function(_0x550843,_0x1cb804,_0x3a63c4,_0x196621){return tilde[_0x4bfe('0x4d')](_0x550843,_0x1cb804,_0x3a63c4,_0x196621)['then'](function(_0x268887){try{fs[_0x4bfe('0x1c')](_0x550843);}catch(_0x4b393d){logger[_0x4bfe('0x1d')](_0x4b393d);}logger['info'](_0x4bfe('0x73'),_0x268887[_0x4bfe('0x74')]);logger[_0x4bfe('0x3c')]('Tilde\x20ASR\x20confidence',_0x268887[_0x4bfe('0x52')]);return _0x268887;});};exports['awsPolly']=function(_0x5e76df,_0x2b3bb5,_0x1ca05e,_0x305c8b,_0x3a1485,_0x331a41){var _0x5d883a=path['resolve'](__dirname,_0x4bfe('0x26'),rs[_0x4bfe('0x27')](0x4)+_0x4bfe('0x4a'));var _0x340f7c;return aws['polly'](_0x5e76df,_0x2b3bb5,_0x1ca05e,_0x305c8b,_0x3a1485,_0x331a41,_0x5d883a)['then'](function(){_0x340f7c=path['resolve'](__dirname,_0x4bfe('0x26'),rs['generate'](0x4)+_0x4bfe('0x3a'));return convertFile(_0x5d883a,_0x340f7c);})[_0x4bfe('0x2a')](function(){try{fs[_0x4bfe('0x1c')](_0x5d883a);fs[_0x4bfe('0x3b')](_0x340f7c,_0x4bfe('0x2b'));}catch(_0x5c5369){logger[_0x4bfe('0x1d')](_0x5c5369);}return _0x340f7c[_0x4bfe('0x2c')]('.')[0x0];});};exports[_0x4bfe('0x75')]=function(_0x3c7f42,_0x298032,_0x3edff6,_0x42bb04,_0x219ffd,_0x1c6c4d){return aws[_0x4bfe('0x76')](_0x3c7f42,_0x298032,_0x3edff6,_0x42bb04,_0x219ffd,_0x1c6c4d)['then'](function(_0x3b9280){logger['info'](JSON[_0x4bfe('0x42')](_0x3b9280));return _0x3b9280;});};exports[_0x4bfe('0x77')]=function(_0x3dcbed,_0x2e5bf7,_0x5ecde9,_0x597de8){var _0x44d5a5=util[_0x4bfe('0x78')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x3dcbed,encodeURIComponent(_0x2e5bf7),_0x5ecde9,_0x597de8);var _0x27bade=path[_0x4bfe('0x25')](__dirname,_0x4bfe('0x26'),rs[_0x4bfe('0x27')](0x4)+_0x4bfe('0x4a'));var _0x462309;return downloadFile(_0x44d5a5,_0x27bade)['then'](function(){_0x462309=path[_0x4bfe('0x25')](__dirname,'tmp',rs[_0x4bfe('0x27')](0x4)+_0x4bfe('0x3a'));return convertFile(_0x27bade,_0x462309);})[_0x4bfe('0x2a')](function(){try{fs[_0x4bfe('0x1c')](_0x27bade);fs[_0x4bfe('0x3b')](_0x462309,_0x4bfe('0x2b'));}catch(_0x20b907){logger[_0x4bfe('0x1d')](_0x20b907);}return _0x462309[_0x4bfe('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0xea140a,_0x24455,_0x8a6e71,_0x4dad19){var _0x5af5e2=util[_0x4bfe('0x78')](_0x4bfe('0x79'),ISPEECH_API,_0x24455,_0x8a6e71,base64Encode(_0xea140a),_0x4dad19?util[_0x4bfe('0x78')](_0x4bfe('0x7a'),encodeURIComponent(_0x4dad19)):_0x4bfe('0x7b'));return uploadFile(_0x5af5e2)[_0x4bfe('0x2a')](function(_0x1fcf96){return querystring[_0x4bfe('0x9')](_0x1fcf96);});};exports[_0x4bfe('0x7c')]=function(_0x15d31f,_0x19c669){return sestek['nda'](_0x15d31f,_0x19c669)['then'](function(_0x4356ec){logger['info'](JSON['stringify'](_0x4356ec));var _0x5109a7={'speech':_0x4356ec[_0x4bfe('0x7d')],'action':_0x4356ec[_0x4bfe('0x7e')]?_0x4356ec[_0x4bfe('0x7e')][_0x4bfe('0x7f')]:undefined,'actiondata':_0x4356ec['channelData']?_0x4356ec[_0x4bfe('0x7e')][_0x4bfe('0x80')]:undefined};if(_0x4356ec[_0x4bfe('0x7e')]&&_0x4356ec['channelData'][_0x4bfe('0x81')]){return base64Decode(_0x4356ec[_0x4bfe('0x7e')]['AudioFromTts'][_0x4bfe('0x82')],path[_0x4bfe('0x25')](__dirname,_0x4bfe('0x26'),rs['generate'](0x4)+_0x4bfe('0x3a')))[_0x4bfe('0x2a')](function(_0xd141db){_0x5109a7[_0x4bfe('0x83')]=_0xd141db;return _0x5109a7;});}return _0x5109a7;});};exports[_0x4bfe('0x84')]=function(){return __dirname;}; \ No newline at end of file +var _0x6417=['confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','source','resolvedQuery','result','action','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','sox','url','parse','util','./aws','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','protocol','host','data','transcode','wav','error\x20convert','end','resolve','tmp','.wav','writeFileSync','base64','then','unlink','chmodSync','readFileSync','toString','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','777','googleCloudTTS\x20path','split','googleTTS','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','asr','results','alternatives','transcript','join','map'];(function(_0x459b74,_0x5773bd){var _0x46cb16=function(_0x97867f){while(--_0x97867f){_0x459b74['push'](_0x459b74['shift']());}};_0x46cb16(++_0x5773bd);}(_0x6417,0x1de));var _0x7641=function(_0x2c0a00,_0x3548e4){_0x2c0a00=_0x2c0a00-0x0;var _0x119901=_0x6417[_0x2c0a00];return _0x119901;};'use strict';var apiai=require(_0x7641('0x0'));var BPromise=require(_0x7641('0x1'));var dialogflow=require(_0x7641('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x7641('0x3'));var md5=require(_0x7641('0x4'));var path=require(_0x7641('0x5'));var querystring=require('querystring');var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0x7641('0x6'));var tts=require('google-tts-api');var urlParse=require(_0x7641('0x7'))[_0x7641('0x8')];var util=require(_0x7641('0x9'));var aws=require(_0x7641('0xa'));var google=require(_0x7641('0xb'));var sestek=require('./sestek');var tilde=require(_0x7641('0xc'));var logger=require(_0x7641('0xd'))(_0x7641('0xe'));var ISPEECH_API=_0x7641('0xf');function downloadFile(_0xce6b15,_0x2a23a2){return new BPromise(function(_0x33914c,_0x5b622e){var _0x4ef839=urlParse(_0xce6b15);var _0x49168e=_0x4ef839['protocol']===_0x7641('0x10')?https:http;var _0x46e0ce={'host':_0x4ef839['host'],'path':_0x4ef839[_0x7641('0x5')],'headers':{'user-agent':_0x7641('0x11')}};_0x49168e[_0x7641('0x12')](_0x46e0ce,function(_0x27f3e0){if(_0x27f3e0[_0x7641('0x13')]!==0xc8){logger[_0x7641('0x14')](_0x7641('0x15')+_0xce6b15+_0x7641('0x16')+_0x27f3e0[_0x7641('0x13')]+'\x20('+_0x27f3e0[_0x7641('0x17')]+')');_0x5b622e(new Error('request\x20to\x20'+_0xce6b15+_0x7641('0x16')+_0x27f3e0[_0x7641('0x13')]+'\x20('+_0x27f3e0[_0x7641('0x17')]+')'));return;}var _0x3ea80f=fs[_0x7641('0x18')](_0x2a23a2);_0x3ea80f['on'](_0x7641('0x19'),function(){logger[_0x7641('0x1a')](_0x7641('0x1b'));_0x3ea80f[_0x7641('0x1c')](_0x33914c);});_0x3ea80f['on']('error',function(_0x18f216){fs['unlink'](_0x2a23a2);logger[_0x7641('0x14')](_0x7641('0x1d'),_0x18f216);_0x5b622e(_0x18f216);});_0x27f3e0[_0x7641('0x1e')](_0x3ea80f);})['on'](_0x7641('0x14'),function(_0x8e7d17){logger[_0x7641('0x14')](_0x8e7d17);_0x5b622e(_0x8e7d17);})['end']();});}function uploadFile(_0x388932){return new BPromise(function(_0x50e2f9,_0x593ceb){var _0x2193ce=urlParse(_0x388932);var _0x5b2a0d=_0x2193ce[_0x7641('0x1f')]===_0x7641('0x10')?https:http;var _0x4026ff={'host':_0x2193ce[_0x7641('0x20')],'path':_0x2193ce[_0x7641('0x5')],'headers':{'user-agent':_0x7641('0x11')}};_0x5b2a0d[_0x7641('0x12')](_0x4026ff,function(_0x4699ad){if(_0x4699ad[_0x7641('0x13')]!==0xc8){_0x593ceb(new Error(_0x7641('0x15')+_0x388932+'\x20failed,\x20status\x20code\x20=\x20'+_0x4699ad[_0x7641('0x13')]+'\x20('+_0x4699ad[_0x7641('0x17')]+')'));return;}var _0x99842d='';_0x4699ad['on'](_0x7641('0x21'),function(_0x224fc2){_0x99842d+=_0x224fc2;});_0x4699ad['on']('end',function(){_0x50e2f9(_0x99842d);});})['on'](_0x7641('0x14'),function(_0x2f92ea){_0x593ceb(_0x2f92ea);})['end']();});}function convertFile(_0x55131b,_0x4648b7){return new BPromise(function(_0x470566,_0x4d5bfd){var _0x293021=sox[_0x7641('0x22')](_0x55131b,_0x4648b7,{'sampleRate':0x1f40,'format':_0x7641('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x293021['on'](_0x7641('0x14'),function(_0x568097){logger[_0x7641('0x14')](_0x7641('0x24'),_0x568097);_0x4d5bfd(_0x568097);});_0x293021['on'](_0x7641('0x25'),function(){logger[_0x7641('0x1a')]('finish\x20to\x20convert');_0x470566();});_0x293021['start']();});}function base64Decode(_0x2db27e,_0x17c27b){var _0x48951c=path[_0x7641('0x26')](__dirname,_0x7641('0x27'),rs['generate'](0x4)+_0x7641('0x28'));fs[_0x7641('0x29')](_0x48951c,_0x2db27e,_0x7641('0x2a'));return convertFile(_0x48951c,_0x17c27b)[_0x7641('0x2b')](function(){try{fs[_0x7641('0x2c')](_0x48951c);fs[_0x7641('0x2d')](_0x17c27b,'777');}catch(_0x49534d){logger['error'](_0x49534d);}return _0x17c27b['split']('.')[0x0];});}function base64Encode(_0x1187b4){var _0x3deef2=fs[_0x7641('0x2e')](_0x1187b4);return new Buffer(_0x3deef2)[_0x7641('0x2f')]('base64');}exports['googleCloudTTS']=function(_0x525601,_0x48116e,_0x569105,_0x4a66c8,_0x71b97f,_0x279914){var _0x37429b,_0x2ba337;var _0x5aa89c=_0x7641('0x30');var _0x296ed4='?key='+_0x525601;var _0x538630={};if(_0x48116e===_0x7641('0x31')){_0x538630[_0x7641('0x32')]={'ssml':_0x569105};}else{_0x538630[_0x7641('0x32')]={'text':_0x569105};};_0x538630[_0x7641('0x33')]={'languageCode':_0x4a66c8,'ssmlGender':_0x71b97f};_0x538630[_0x7641('0x34')]={'audioEncoding':_0x7641('0x35'),'sampleRateHertz':0x1f40};var _0x288c16={'url':_0x5aa89c+_0x7641('0x36')+_0x296ed4,'method':_0x7641('0x37'),'json':!![],'body':_0x538630};return rp(_0x288c16)[_0x7641('0x2b')](function(_0x36f278){return new BPromise(function(_0x48bcc7,_0x4d9510){_0x37429b=path[_0x7641('0x26')](__dirname,_0x7641('0x27'),rs[_0x7641('0x38')](0x4)+_0x7641('0x39'));var _0x7ddc20=Buffer[_0x7641('0x3a')](_0x36f278[_0x7641('0x3b')],_0x7641('0x2a'));return fs['writeFile'](_0x37429b,_0x7ddc20,function(_0x197a15){_0x4d9510(_0x197a15);},function(_0xfffede){fs[_0x7641('0x2d')](_0x37429b,_0x7641('0x3c'));_0x48bcc7(_0xfffede);});});})['then'](function(_0x2e2390){_0x2ba337=path[_0x7641('0x26')](__dirname,_0x7641('0x27'),rs['generate'](0x4)+'.wav');return convertFile(_0x37429b,_0x2ba337);})[_0x7641('0x2b')](function(){try{fs[_0x7641('0x2c')](_0x37429b);fs[_0x7641('0x2d')](_0x2ba337,_0x7641('0x3c'));}catch(_0x5e192f){logger[_0x7641('0x14')](_0x5e192f);}logger[_0x7641('0x1a')](_0x7641('0x3d'),_0x2ba337[_0x7641('0x3e')]('.')[0x0]);return _0x2ba337[_0x7641('0x3e')]('.')[0x0];});};exports[_0x7641('0x3f')]=function(_0x375cea,_0x3641db){var _0x1af118='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x1cdfc8,_0x3fbd5b;var _0x440773;var _0x8092eb={'encoding':'utf8','method':_0x7641('0x37'),'timeout':0x2710,'url':_0x1af118,'headers':{'Content-Type':_0x7641('0x40')},'body':_0x7641('0x41')+encodeURIComponent(JSON[_0x7641('0x42')]([[[_0x7641('0x43'),JSON['stringify']([_0x375cea,_0x3641db||'en',![],'null']),null,'generic']]]))};return rp(_0x8092eb)['then'](function(_0x481b88){try{_0x440773=eval(_0x481b88[_0x7641('0x44')](0x5))[0x0][0x2];}catch(_0x337c9b){throw new Error('parse\x20response\x20failed:\x0a'+_0x481b88['data']);}if(!_0x440773){if(_0x375cea[_0x7641('0x45')]>0xc8){throw new Error(_0x7641('0x46'));}else{throw new Error(_0x7641('0x47')+_0x3641db+_0x7641('0x48'));}}try{_0x440773=eval(_0x440773)[0x0];}catch(_0x29dac6){throw new Error(_0x7641('0x49')+res[_0x7641('0x21')]);}const _0x17dfc1=_0x440773;_0x1cdfc8=path['resolve'](__dirname,_0x7641('0x27'),rs[_0x7641('0x38')](0x4)+'.mp3');fs[_0x7641('0x29')](_0x1cdfc8,_0x440773,{'encoding':_0x7641('0x2a')});_0x3fbd5b=path[_0x7641('0x26')](__dirname,_0x7641('0x27'),rs[_0x7641('0x38')](0x4)+'.wav');return convertFile(_0x1cdfc8,_0x3fbd5b);})[_0x7641('0x2b')](function(){try{fs['unlink'](_0x1cdfc8);fs['chmodSync'](_0x3fbd5b,'777');}catch(_0x3da252){logger[_0x7641('0x14')](_0x3da252);}logger['info'](_0x7641('0x4a'),_0x3fbd5b['split']('.')[0x0]);return _0x3fbd5b['split']('.')[0x0];});};exports[_0x7641('0x4b')]=function(_0x21c838,_0x1ece7c,_0x49f5b6){return google[_0x7641('0x4c')](_0x21c838,_0x1ece7c,_0x49f5b6)[_0x7641('0x2b')](function(_0x1abf01){logger[_0x7641('0x1a')](_0x1abf01['uri']);return rp(_0x1abf01);})[_0x7641('0x2b')](function(_0x2681f7){var _0x38ae9d='';var _0x487dce=0x0;try{fs[_0x7641('0x2c')](_0x21c838);}catch(_0x5e4b74){logger[_0x7641('0x14')](_0x5e4b74);}if(_0x2681f7&&_0x2681f7['results']){_0x38ae9d=_0x2681f7[_0x7641('0x4d')]['map'](function(_0x5c47cb){return _0x5c47cb&&_0x5c47cb[_0x7641('0x4e')][0x0]&&_0x5c47cb['alternatives'][0x0][_0x7641('0x4f')]?_0x5c47cb[_0x7641('0x4e')][0x0][_0x7641('0x4f')]:'';})[_0x7641('0x50')]('\x0a');_0x487dce=_0x2681f7[_0x7641('0x4d')][_0x7641('0x51')](function(_0x719c78){return _0x719c78&&_0x719c78[_0x7641('0x4e')][0x0]&&_0x719c78[_0x7641('0x4e')][0x0][_0x7641('0x52')]?_0x719c78[_0x7641('0x4e')][0x0][_0x7641('0x52')]:0x0;})[_0x7641('0x50')]('\x0a');}logger[_0x7641('0x1a')](_0x7641('0x53'),_0x38ae9d);logger[_0x7641('0x1a')](_0x7641('0x54'),_0x487dce);return{'transcript':_0x38ae9d,'confidence':_0x487dce};})[_0x7641('0x55')](function(_0x40944c){logger[_0x7641('0x14')](_0x7641('0x56'),_0x40944c[_0x7641('0x13')],_0x40944c['name'],_0x40944c[_0x7641('0x57')]);});};exports[_0x7641('0x58')]=function(_0x382de0,_0x3f6ebe,_0x313a72,_0xc56157){var _0x3182f2=apiai(_0x3f6ebe,{'language':_0xc56157||'en'});return _0x3182f2['textRequest'](_0x313a72,{'sessionId':md5(_0x382de0)})['then'](function(_0xa0d205){logger[_0x7641('0x1a')](JSON[_0x7641('0x42')](_0xa0d205));return{'source':_0xa0d205['result'][_0x7641('0x59')],'resolvedQuery':_0xa0d205['result'][_0x7641('0x5a')],'action':_0xa0d205[_0x7641('0x5b')][_0x7641('0x5c')],'actionIncomplete':_0xa0d205[_0x7641('0x5b')]['actionIncomplete'],'speech':_0xa0d205[_0x7641('0x5b')][_0x7641('0x5d')][_0x7641('0x5e')],'score':_0xa0d205[_0x7641('0x5b')][_0x7641('0x5f')],'statusCode':_0xa0d205[_0x7641('0x60')]['code'],'endConversation':_0xa0d205[_0x7641('0x5b')][_0x7641('0x61')][_0x7641('0x62')]||![],'isFallbackIntent':_0xa0d205[_0x7641('0x5b')]['metadata'][_0x7641('0x63')]};});};exports['googleDialogflowV2']=function(_0x50ce8d,_0x5bd5cd,_0xeabacc,_0x482926,_0x3709ce,_0x4db9e6){var _0xfceefb=_0x482926[_0x7641('0x64')](/\\n/g,'\x0a');var _0x1e4d95={'credentials':{'private_key':_0xfceefb,'client_email':_0xeabacc}};var _0x523d6c=new dialogflow[(_0x7641('0x65'))](_0x1e4d95);var _0x83ac0c=_0x523d6c[_0x7641('0x66')](_0x5bd5cd,md5(_0x50ce8d));var _0x49886a={'session':_0x83ac0c,'queryInput':{'text':{'text':_0x3709ce,'languageCode':_0x4db9e6}}};return _0x523d6c[_0x7641('0x67')](_0x49886a)['then'](function(_0x51af3e){if(_0x51af3e&&_0x51af3e[_0x7641('0x45')]){logger[_0x7641('0x1a')](_0x7641('0x68'),JSON[_0x7641('0x42')](_0x51af3e));var _0x3c52e7=_0x51af3e[0x0];if(_0x3c52e7){var _0x2a1e54={'action':_0x3c52e7[_0x7641('0x69')][_0x7641('0x5c')],'allRequiredParamsPresent':_0x3c52e7[_0x7641('0x69')][_0x7641('0x6a')],'endConversation':_0x3c52e7[_0x7641('0x69')][_0x7641('0x6b')]&&_0x3c52e7['queryResult'][_0x7641('0x6b')][_0x7641('0x6c')]?_0x3c52e7['queryResult'][_0x7641('0x6b')][_0x7641('0x6c')][_0x7641('0x6d')][_0x7641('0x6e')]:![],'fulfillmentText':_0x3c52e7[_0x7641('0x69')][_0x7641('0x6f')],'intentName':_0x3c52e7['queryResult'][_0x7641('0x70')][_0x7641('0x71')],'intentDisplayName':_0x3c52e7['queryResult'][_0x7641('0x70')][_0x7641('0x72')],'isFallbackIntent':_0x3c52e7['queryResult'][_0x7641('0x70')][_0x7641('0x73')],'languageCode':_0x3c52e7[_0x7641('0x69')][_0x7641('0x74')],'queryText':_0x3c52e7[_0x7641('0x69')][_0x7641('0x75')],'responseId':_0x3c52e7[_0x7641('0x76')],'score':_0x3c52e7[_0x7641('0x69')][_0x7641('0x77')],'speech':_0x3c52e7[_0x7641('0x69')][_0x7641('0x6f')],'providerResponse':JSON[_0x7641('0x42')](_0x51af3e)};return _0x2a1e54;}}});};exports[_0x7641('0x78')]=function(_0x3936ed,_0x43f061,_0x1874f9,_0x409464){return tilde['asr'](_0x3936ed,_0x43f061,_0x1874f9,_0x409464)[_0x7641('0x2b')](function(_0x40f9fb){try{fs[_0x7641('0x2c')](_0x3936ed);}catch(_0x4cb883){logger[_0x7641('0x14')](_0x4cb883);}logger[_0x7641('0x1a')](_0x7641('0x79'),_0x40f9fb[_0x7641('0x4f')]);logger[_0x7641('0x1a')](_0x7641('0x7a'),_0x40f9fb[_0x7641('0x52')]);return _0x40f9fb;});};exports[_0x7641('0x7b')]=function(_0x3e5c5b,_0x3d0dc8,_0x35eb8e,_0xbb277f,_0x34425c,_0x3e5979){var _0x138a22=path[_0x7641('0x26')](__dirname,'tmp',rs[_0x7641('0x38')](0x4)+'.mp3');var _0x1527f8;return aws[_0x7641('0x7c')](_0x3e5c5b,_0x3d0dc8,_0x35eb8e,_0xbb277f,_0x34425c,_0x3e5979,_0x138a22)[_0x7641('0x2b')](function(){_0x1527f8=path['resolve'](__dirname,_0x7641('0x27'),rs[_0x7641('0x38')](0x4)+_0x7641('0x28'));return convertFile(_0x138a22,_0x1527f8);})[_0x7641('0x2b')](function(){try{fs['unlink'](_0x138a22);fs[_0x7641('0x2d')](_0x1527f8,_0x7641('0x3c'));}catch(_0x372f69){logger[_0x7641('0x14')](_0x372f69);}return _0x1527f8[_0x7641('0x3e')]('.')[0x0];});};exports[_0x7641('0x7d')]=function(_0x5c2c06,_0x289b13,_0x44244f,_0x7e551b,_0x9beffe,_0x2178d8){return aws[_0x7641('0x7e')](_0x5c2c06,_0x289b13,_0x44244f,_0x7e551b,_0x9beffe,_0x2178d8)['then'](function(_0x50efce){logger['info'](JSON[_0x7641('0x42')](_0x50efce));return _0x50efce;});};exports[_0x7641('0x7f')]=function(_0x3afcf9,_0xa75756,_0x416f4d,_0x4715d0){var _0x1c6251=util[_0x7641('0x80')](_0x7641('0x81'),ISPEECH_API,_0x3afcf9,encodeURIComponent(_0xa75756),_0x416f4d,_0x4715d0);var _0x43b161=path[_0x7641('0x26')](__dirname,_0x7641('0x27'),rs[_0x7641('0x38')](0x4)+_0x7641('0x39'));var _0x4d654b;return downloadFile(_0x1c6251,_0x43b161)[_0x7641('0x2b')](function(){_0x4d654b=path[_0x7641('0x26')](__dirname,_0x7641('0x27'),rs[_0x7641('0x38')](0x4)+_0x7641('0x28'));return convertFile(_0x43b161,_0x4d654b);})[_0x7641('0x2b')](function(){try{fs[_0x7641('0x2c')](_0x43b161);fs['chmodSync'](_0x4d654b,'777');}catch(_0x1e2ba9){logger[_0x7641('0x14')](_0x1e2ba9);}return _0x4d654b[_0x7641('0x3e')]('.')[0x0];});};exports[_0x7641('0x82')]=function(_0x2029b0,_0x44c88d,_0x28bb2b,_0x10823f){var _0x3c0c92=util['format'](_0x7641('0x83'),ISPEECH_API,_0x44c88d,_0x28bb2b,base64Encode(_0x2029b0),_0x10823f?util[_0x7641('0x80')](_0x7641('0x84'),encodeURIComponent(_0x10823f)):'freeform=3');return uploadFile(_0x3c0c92)['then'](function(_0x394353){return querystring[_0x7641('0x8')](_0x394353);});};exports['sestekNDA']=function(_0x448d7,_0xc91d7e){return sestek['nda'](_0x448d7,_0xc91d7e)[_0x7641('0x2b')](function(_0x46a2f3){logger[_0x7641('0x1a')](JSON[_0x7641('0x42')](_0x46a2f3));var _0x4715dd={'speech':_0x46a2f3[_0x7641('0x85')],'action':_0x46a2f3[_0x7641('0x86')]?_0x46a2f3[_0x7641('0x86')][_0x7641('0x87')]:undefined,'actiondata':_0x46a2f3[_0x7641('0x86')]?_0x46a2f3[_0x7641('0x86')]['CustomActionData']:undefined};if(_0x46a2f3[_0x7641('0x86')]&&_0x46a2f3['channelData'][_0x7641('0x88')]){return base64Decode(_0x46a2f3[_0x7641('0x86')][_0x7641('0x88')][_0x7641('0x89')],path[_0x7641('0x26')](__dirname,_0x7641('0x27'),rs[_0x7641('0x38')](0x4)+_0x7641('0x28')))[_0x7641('0x2b')](function(_0x1f247e){_0x4715dd[_0x7641('0x8a')]=_0x1f247e;return _0x4715dd;});}return _0x4715dd;});};exports[_0x7641('0x8b')]=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 fe94ddc..3c85419 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 _0xd5b3=['exports','./nda'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xd5b3,0x14f));var _0x3d5b=function(_0x4378fb,_0xd27d09){_0x4378fb=_0x4378fb-0x0;var _0x43716f=_0xd5b3[_0x4378fb];return _0x43716f;};var nda=require(_0x3d5b('0x0'));module[_0x3d5b('0x1')]={'nda':nda}; \ No newline at end of file +var _0xb7a6=['./nda'];(function(_0x1f96f3,_0x4f6e6a){var _0x3b6949=function(_0x2c781b){while(--_0x2c781b){_0x1f96f3['push'](_0x1f96f3['shift']());}};_0x3b6949(++_0x4f6e6a);}(_0xb7a6,0x15b));var _0x6b7a=function(_0x2ecffc,_0x102fa7){_0x2ecffc=_0x2ecffc-0x0;var _0x342e83=_0xb7a6[_0x2ecffc];return _0x342e83;};var nda=require(_0x6b7a('0x0'));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 13f6278..78dc29d 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 _0xbb53=['username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','calleridname','dnid','text','access_token','channelData','ProjectName','project','body','audio/wav','custom_action','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','password'];(function(_0x254c9e,_0xab8a1b){var _0x2d4cb6=function(_0x15b027){while(--_0x15b027){_0x254c9e['push'](_0x254c9e['shift']());}};_0x2d4cb6(++_0xab8a1b);}(_0xbb53,0x121));var _0x3bb5=function(_0x1eb19e,_0x2d19e6){_0x1eb19e=_0x1eb19e-0x0;var _0x4fec0d=_0xbb53[_0x1eb19e];return _0x4fec0d;};'use strict';var rp=require(_0x3bb5('0x0'));var url=require(_0x3bb5('0x1'));var logger=require(_0x3bb5('0x2'))(_0x3bb5('0x3'));module[_0x3bb5('0x4')]=function(_0x226d39,_0x414da7){var _0x3918b9={'method':_0x3bb5('0x5'),'uri':url[_0x3bb5('0x6')](_0x414da7['ndauth_url'],'/token'),'form':{'grant_type':_0x3bb5('0x7'),'username':_0x414da7[_0x3bb5('0x8')],'password':_0x414da7[_0x3bb5('0x7')]},'json':!![]};return rp(_0x3918b9)[_0x3bb5('0x9')](function(_0x22f92f){var _0x480f9c={'method':'POST','uri':url['resolve'](_0x414da7[_0x3bb5('0xa')],_0x3bb5('0xb')),'body':{'type':_0x414da7[_0x3bb5('0xc')]||'message','channelId':_0x3bb5('0xd'),'conversation':{'id':_0x226d39['uniqueid']},'from':{'id':_0x226d39['callerid'],'name':_0x226d39[_0x3bb5('0xe')]},'recipient':{'id':_0x226d39[_0x3bb5('0xf')],'name':_0x226d39['extension']},'text':_0x414da7[_0x3bb5('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x22f92f[_0x3bb5('0x11')]},'json':!![]};if(_0x414da7['project']){_0x480f9c['body'][_0x3bb5('0x12')][_0x3bb5('0x13')]=_0x414da7[_0x3bb5('0x14')];}if(_0x414da7['ndagenerate_audio']=='1'){_0x480f9c[_0x3bb5('0x15')][_0x3bb5('0x12')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x3bb5('0x16')};}if(_0x414da7[_0x3bb5('0x17')]){_0x480f9c['body']['channelData']['CustomAction']=_0x414da7[_0x3bb5('0x17')];if(_0x414da7[_0x3bb5('0x18')]){_0x480f9c['body'][_0x3bb5('0x12')][_0x3bb5('0x19')]=_0x414da7[_0x3bb5('0x18')];}}logger[_0x3bb5('0x1a')](JSON['stringify'](_0x480f9c));return rp(_0x480f9c);});}; \ No newline at end of file +var _0xa68c=['dnid','extension','text','Bearer\x20','access_token','project','channelData','ProjectName','body','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','/token','username','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid'];(function(_0x2e9f43,_0x38285e){var _0x391c48=function(_0x3ca098){while(--_0x3ca098){_0x2e9f43['push'](_0x2e9f43['shift']());}};_0x391c48(++_0x38285e);}(_0xa68c,0x187));var _0xca68=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa68c[_0x1facfa];return _0x9ec701;};'use strict';var rp=require(_0xca68('0x0'));var url=require(_0xca68('0x1'));var logger=require(_0xca68('0x2'))(_0xca68('0x3'));module[_0xca68('0x4')]=function(_0x3e77d6,_0xa0169b){var _0xb97706={'method':_0xca68('0x5'),'uri':url['resolve'](_0xa0169b['ndauth_url'],_0xca68('0x6')),'form':{'grant_type':'password','username':_0xa0169b[_0xca68('0x7')],'password':_0xa0169b[_0xca68('0x8')]},'json':!![]};return rp(_0xb97706)[_0xca68('0x9')](function(_0x2e13c0){var _0x3a6783={'method':_0xca68('0x5'),'uri':url[_0xca68('0xa')](_0xa0169b[_0xca68('0xb')],_0xca68('0xc')),'body':{'type':_0xa0169b[_0xca68('0xd')]||_0xca68('0xe'),'channelId':_0xca68('0xf'),'conversation':{'id':_0x3e77d6[_0xca68('0x10')]},'from':{'id':_0x3e77d6['callerid'],'name':_0x3e77d6['calleridname']},'recipient':{'id':_0x3e77d6[_0xca68('0x11')],'name':_0x3e77d6[_0xca68('0x12')]},'text':_0xa0169b[_0xca68('0x13')],'channelData':{}},'headers':{'Authorization':_0xca68('0x14')+_0x2e13c0[_0xca68('0x15')]},'json':!![]};if(_0xa0169b[_0xca68('0x16')]){_0x3a6783['body'][_0xca68('0x17')][_0xca68('0x18')]=_0xa0169b[_0xca68('0x16')];}if(_0xa0169b['ndagenerate_audio']=='1'){_0x3a6783[_0xca68('0x19')]['channelData'][_0xca68('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xca68('0x1b')};}if(_0xa0169b['custom_action']){_0x3a6783['body'][_0xca68('0x17')][_0xca68('0x1c')]=_0xa0169b[_0xca68('0x1d')];if(_0xa0169b[_0xca68('0x1e')]){_0x3a6783[_0xca68('0x19')][_0xca68('0x17')][_0xca68('0x1f')]=_0xa0169b[_0xca68('0x1e')];}}logger[_0xca68('0x20')](JSON[_0xca68('0x21')](_0x3a6783));return rp(_0x3a6783);});}; \ 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 bd1c2bd..a7c1484 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 _0xdf6c=['exports'];(function(_0x53e3de,_0x13da7b){var _0x7b905b=function(_0x29b56a){while(--_0x29b56a){_0x53e3de['push'](_0x53e3de['shift']());}};_0x7b905b(++_0x13da7b);}(_0xdf6c,0x147));var _0xcdf6=function(_0x10331f,_0x30d92f){_0x10331f=_0x10331f-0x0;var _0x279ac9=_0xdf6c[_0x10331f];return _0x279ac9;};'use strict';var asr=require('./lib/api');module[_0xcdf6('0x0')]=function(_0x59652f,_0x4d2fd,_0x4053d1,_0x3e27e6){return asr(_0x59652f,_0x4d2fd,_0x4053d1,_0x3e27e6);}; \ No newline at end of file +var _0xf501=['exports','./lib/api'];(function(_0x4df638,_0x5415be){var _0x2711fe=function(_0x2e14cb){while(--_0x2e14cb){_0x4df638['push'](_0x4df638['shift']());}};_0x2711fe(++_0x5415be);}(_0xf501,0x191));var _0x1f50=function(_0x91d942,_0x29df78){_0x91d942=_0x91d942-0x0;var _0x374ef4=_0xf501[_0x91d942];return _0x374ef4;};'use strict';var asr=require(_0x1f50('0x0'));module[_0x1f50('0x1')]=function(_0x4394ac,_0x1c388b,_0xe90863,_0x587939){return asr(_0x4394ac,_0x1c388b,_0xe90863,_0x587939);}; \ 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 e3e78ad..c57b23f 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 _0x971c=['Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','moment','crypto','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','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.'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0x971c,0x1d8));var _0xc971=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x971c[_0x2bf141];return _0x48277b;};'use strict';var BPromise=require(_0xc971('0x0'));var _=require(_0xc971('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc971('0x2'));var crypto=require(_0xc971('0x3'));var logger=require('../../../../../../config/logger')('agi');module[_0xc971('0x4')]=function(_0x287754,_0x3f26da,_0x2af7b7,_0x400dd2){return new BPromise(function(_0x130251,_0x5b0111){logger[_0xc971('0x5')]('Tilde\x20URI',_0x400dd2||_0xc971('0x6'));var _0x400f8c=new WebSocket(_0x400dd2||_0xc971('0x6'),{'perMessageDeflate':![]});var _0x2726bb='';var _0x5d66c6='0';var _0x2d628f='1';var _0x150bd9=_0xc971('0x7');function _0x1da4bc(_0x3f6b59){var _0x4edd8a=crypto['createHash'](_0xc971('0x8'));_0x4edd8a[_0xc971('0x9')](_0x3f6b59);return _0x4edd8a[_0xc971('0xa')](_0xc971('0xb'));}function _0x8974bf(){try{logger[_0xc971('0x5')](_0xc971('0xc'));var _0x5bae47=moment()[_0xc971('0xd')]();var _0xdff26c=_0x1da4bc(_0x5bae47+_0x3f26da+_0x2af7b7);_0x400f8c[_0xc971('0xe')](JSON['stringify']({'appID':_0x3f26da,'timestamp':_0x5bae47,'appKey':_0xdff26c}));var _0x5c1dac=fs[_0xc971('0xf')](_0x287754);_0x5c1dac['on']('data',function(_0x42781f){_0x400f8c[_0xc971('0xe')](_0x42781f);});_0x5c1dac['on'](_0xc971('0x10'),function(){_0x400f8c[_0xc971('0xe')](_0xc971('0x11'));});}catch(_0x74a00){logger[_0xc971('0x12')](_0xc971('0x13'),JSON[_0xc971('0x14')](_0x74a00));_0x400f8c[_0xc971('0x15')]();}}function _0x569d34(_0x19f4a9){try{if(_0x19f4a9){var _0x2b820b=JSON[_0xc971('0x16')](_0x19f4a9);switch(_0x2b820b[_0xc971('0x17')]){case 0x0:if(_0x2b820b[_0xc971('0x18')]){if(_0x2b820b[_0xc971('0x18')][_0xc971('0x19')]){logger['info'](_0xc971('0x1a'),JSON[_0xc971('0x14')](_0x2b820b[_0xc971('0x18')]['hypotheses']));_0x2726bb=_0x2b820b[_0xc971('0x18')][_0xc971('0x1b')][0x0][_0xc971('0x1c')];_0x5d66c6=_0x2b820b[_0xc971('0x18')][_0xc971('0x1b')][0x0][_0xc971('0x1d')];_0x2d628f='0';_0x150bd9=_0xc971('0x1e');_0x400f8c[_0xc971('0x15')]();}}break;case 0x1:logger['info'](_0xc971('0x7'));_0x2d628f='1';_0x150bd9='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xc971('0x5')](_0xc971('0x1f'));_0x2d628f='2';_0x150bd9=_0xc971('0x1f');break;case 0x9:logger[_0xc971('0x5')](_0xc971('0x20'));_0x2d628f='9';_0x150bd9=_0xc971('0x20');break;case 0xa:logger['info'](_0xc971('0x21'));_0x2d628f='10';_0x150bd9=_0xc971('0x21');break;case 0xb:logger['info'](_0xc971('0x22'));_0x2d628f='11';_0x150bd9=_0xc971('0x22');}}}catch(_0x4ae09a){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xc971('0x14')](_0x4ae09a));_0x400f8c['terminate']();}}function _0x1edee1(){logger[_0xc971('0x5')](_0xc971('0x23'));_0x130251({'transcript':_0x2726bb,'confidence':_0x5d66c6,'status':_0x2d628f,'status_message':_0x150bd9});}function _0x4bba07(_0x4c1833){logger[_0xc971('0x12')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xc971('0x24')](_0x4c1833)){logger['error'](_[_0xc971('0x25')](_0x4c1833)?JSON['stringify'](_0x4c1833):_0x4c1833);}}_0x400f8c['on'](_0xc971('0x26'),_0x8974bf);_0x400f8c['on']('message',_0x569d34);_0x400f8c['on']('close',_0x1edee1);_0x400f8c['on']('error',_0x4bba07);});}; \ No newline at end of file +var _0xf338=['moment','../../../../../../config/logger','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','createReadStream','data','send','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','info','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','close','bluebird','lodash'];(function(_0x55c965,_0x566c86){var _0x49f655=function(_0x48bd0d){while(--_0x48bd0d){_0x55c965['push'](_0x55c965['shift']());}};_0x49f655(++_0x566c86);}(_0xf338,0x170));var _0x8f33=function(_0x4766f2,_0x38b8a1){_0x4766f2=_0x4766f2-0x0;var _0xe746c2=_0xf338[_0x4766f2];return _0xe746c2;};'use strict';var BPromise=require(_0x8f33('0x0'));var _=require(_0x8f33('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x8f33('0x2'));var crypto=require('crypto');var logger=require(_0x8f33('0x3'))('agi');module['exports']=function(_0x4a6e13,_0x3b2786,_0x4db981,_0x348473){return new BPromise(function(_0x3668b8,_0x2cd030){logger['info']('Tilde\x20URI',_0x348473||_0x8f33('0x4'));var _0x400800=new WebSocket(_0x348473||_0x8f33('0x4'),{'perMessageDeflate':![]});var _0x50a41d='';var _0x4052e5='0';var _0x5913c3='1';var _0xdd5105=_0x8f33('0x5');function _0xb55468(_0x2d152f){var _0x1114c4=crypto[_0x8f33('0x6')](_0x8f33('0x7'));_0x1114c4[_0x8f33('0x8')](_0x2d152f);return _0x1114c4['digest'](_0x8f33('0x9'));}function _0x5c3105(){try{logger['info'](_0x8f33('0xa'));var _0x15cb36=moment()['unix']();var _0x78fa97=_0xb55468(_0x15cb36+_0x3b2786+_0x4db981);_0x400800['send'](JSON['stringify']({'appID':_0x3b2786,'timestamp':_0x15cb36,'appKey':_0x78fa97}));var _0x1c2113=fs[_0x8f33('0xb')](_0x4a6e13);_0x1c2113['on'](_0x8f33('0xc'),function(_0x4aa34f){_0x400800[_0x8f33('0xd')](_0x4aa34f);});_0x1c2113['on']('close',function(){_0x400800[_0x8f33('0xd')]('EOS');});}catch(_0x33e25c){logger[_0x8f33('0xe')](_0x8f33('0xf'),JSON[_0x8f33('0x10')](_0x33e25c));_0x400800[_0x8f33('0x11')]();}}function _0x3dae08(_0x55a522){try{if(_0x55a522){var _0x17deed=JSON[_0x8f33('0x12')](_0x55a522);switch(_0x17deed[_0x8f33('0x13')]){case 0x0:if(_0x17deed[_0x8f33('0x14')]){if(_0x17deed['result']['final']){logger['info'](_0x8f33('0x15'),JSON[_0x8f33('0x10')](_0x17deed[_0x8f33('0x14')]['hypotheses']));_0x50a41d=_0x17deed[_0x8f33('0x14')][_0x8f33('0x16')][0x0][_0x8f33('0x17')];_0x4052e5=_0x17deed[_0x8f33('0x14')][_0x8f33('0x16')][0x0][_0x8f33('0x18')];_0x5913c3='0';_0xdd5105=_0x8f33('0x19');_0x400800[_0x8f33('0x11')]();}}break;case 0x1:logger[_0x8f33('0x1a')](_0x8f33('0x5'));_0x5913c3='1';_0xdd5105=_0x8f33('0x5');break;case 0x2:logger[_0x8f33('0x1a')](_0x8f33('0x1b'));_0x5913c3='2';_0xdd5105='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0x8f33('0x1c'));_0x5913c3='9';_0xdd5105=_0x8f33('0x1c');break;case 0xa:logger[_0x8f33('0x1a')](_0x8f33('0x1d'));_0x5913c3='10';_0xdd5105='Authentication\x20failed.';break;case 0xb:logger[_0x8f33('0x1a')](_0x8f33('0x1e'));_0x5913c3='11';_0xdd5105=_0x8f33('0x1e');}}}catch(_0x2c45b6){logger[_0x8f33('0xe')](_0x8f33('0x1f'),JSON[_0x8f33('0x10')](_0x2c45b6));_0x400800[_0x8f33('0x11')]();}}function _0x12c32b(){logger[_0x8f33('0x1a')]('Close\x20Tilde\x20ASR\x20socket');_0x3668b8({'transcript':_0x50a41d,'confidence':_0x4052e5,'status':_0x5913c3,'status_message':_0xdd5105});}function _0x37539d(_0x5a9a6b){logger['error'](_0x8f33('0x20'));if(!_[_0x8f33('0x21')](_0x5a9a6b)){logger['error'](_[_0x8f33('0x22')](_0x5a9a6b)?JSON[_0x8f33('0x10')](_0x5a9a6b):_0x5a9a6b);}}_0x400800['on']('open',_0x5c3105);_0x400800['on'](_0x8f33('0x23'),_0x3dae08);_0x400800['on'](_0x8f33('0x24'),_0x12c32b);_0x400800['on']('error',_0x37539d);});}; \ 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 26ab96c..86aa1d3 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 _0x5cac=['exports','./asr'];(function(_0x1827c9,_0x50d05d){var _0x4ae765=function(_0x5b1698){while(--_0x5b1698){_0x1827c9['push'](_0x1827c9['shift']());}};_0x4ae765(++_0x50d05d);}(_0x5cac,0x11b));var _0xc5ca=function(_0x217eac,_0x437cbe){_0x217eac=_0x217eac-0x0;var _0x21c78d=_0x5cac[_0x217eac];return _0x21c78d;};var asr=require(_0xc5ca('0x0'));module[_0xc5ca('0x1')]={'asr':asr}; \ No newline at end of file +var _0x12f8=['exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x12f8,0x1b4));var _0x812f=function(_0x253a62,_0x1e5c19){_0x253a62=_0x253a62-0x0;var _0x12fa6b=_0x12f8[_0x253a62];return _0x12fa6b;};var asr=require('./asr');module[_0x812f('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 7aaaea7..5c4198e 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 _0xc590=['listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','net','events','EventEmitter','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen'];(function(_0x4c705e,_0x5df3a4){var _0x5b989c=function(_0x4ff86b){while(--_0x4ff86b){_0x4c705e['push'](_0x4c705e['shift']());}};_0x5b989c(++_0x5df3a4);}(_0xc590,0x165));var _0x0c59=function(_0x4687c6,_0x4286fd){_0x4687c6=_0x4687c6-0x0;var _0x37f4ed=_0xc590[_0x4687c6];return _0x37f4ed;};'use strict';var util=require('util');var net=require(_0x0c59('0x0'));var EventEmitter=require(_0x0c59('0x1'))[_0x0c59('0x2')];var AGIError=require(_0x0c59('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x15d522,_0x4ab13b,_0x5b7fb0){var _0x4621ce=this,_0x15d522=_0x15d522||0x11dd,_0x4ab13b=_0x4ab13b||_0x0c59('0x4'),_0xc995fd=null,_0x5731b6=0x0;EventEmitter[_0x0c59('0x5')](_0x4621ce);function _0x22f4f8(){if(!_0x15d522){_0x4621ce[_0x0c59('0x6')](_0x0c59('0x7'),new AGIError(_0x0c59('0x8')));return![];}_0xc995fd=net[_0x0c59('0x9')]();_0xc995fd[_0x0c59('0xa')](_0x15d522,_0x4ab13b);_0xc995fd['on'](_0x0c59('0xb'),function(){_0x4621ce[_0x0c59('0x6')](_0x0c59('0xb'));});_0xc995fd['on'](_0x0c59('0xc'),function(_0x35f149){_0xc995fd[_0x0c59('0xd')](function(_0x1b5032,_0x4763fc){if(_0x1b5032){_0x4621ce[_0x0c59('0x6')](_0x0c59('0x7'),new AGIError(_0x0c59('0xe'),_0x1b5032));}else if(_0x5b7fb0&&_0x5b7fb0<0x0){_0x4621ce[_0x0c59('0x6')](_0x0c59('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x35f149[_0x0c59('0xf')]();}else if(_0x5b7fb0&&_0x5b7fb0>0x0&&_0x5b7fb0<_0x4763fc){_0x5731b6+=0x1;_0x4621ce[_0x0c59('0x6')](_0x0c59('0x7'),new AGIError(_0x0c59('0x10'),_0x5731b6));_0x35f149[_0x0c59('0xf')]();}else{var _0x4b00c1=new AGIChannel(_0x35f149);_0x4b00c1['on']('ready',function(){_0x4621ce[_0x0c59('0x6')](_0x0c59('0xc'),_0x4b00c1);});}});});_0xc995fd['on']('error',function(_0x12b027){_0x4621ce[_0x0c59('0x6')](_0x0c59('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x12b027[_0x0c59('0x11')]));});_0xc995fd['on']('close',function(){_0x4621ce[_0x0c59('0x6')](_0x0c59('0x12'),new AGIError(_0x0c59('0x13')));});}process[_0x0c59('0x14')](function(){_0x22f4f8();});};util[_0x0c59('0x15')](AGIServer,EventEmitter);module[_0x0c59('0x16')]=function(_0x1762eb,_0x52808c,_0x152f7e){return new AGIServer(_0x1762eb,_0x52808c,_0x152f7e);}; \ No newline at end of file +var _0x6206=['127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','nextTick','inherits','exports','net','events','./error','./channel'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6206,0x122));var _0x6620=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x6206[_0x1b6c6d];return _0x290d9d;};'use strict';var util=require('util');var net=require(_0x6620('0x0'));var EventEmitter=require(_0x6620('0x1'))['EventEmitter'];var AGIError=require(_0x6620('0x2'));var AGIChannel=require(_0x6620('0x3'));var AGIServer=function(_0x3525e3,_0x435abd,_0xc333c2){var _0x5f260=this,_0x3525e3=_0x3525e3||0x11dd,_0x435abd=_0x435abd||_0x6620('0x4'),_0x11e8d9=null,_0x1b3987=0x0;EventEmitter[_0x6620('0x5')](_0x5f260);function _0x330f5e(){if(!_0x3525e3){_0x5f260['emit'](_0x6620('0x6'),new AGIError(_0x6620('0x7')));return![];}_0x11e8d9=net['createServer']();_0x11e8d9['listen'](_0x3525e3,_0x435abd);_0x11e8d9['on'](_0x6620('0x8'),function(){_0x5f260[_0x6620('0x9')]('listening');});_0x11e8d9['on'](_0x6620('0xa'),function(_0x1a5d36){_0x11e8d9[_0x6620('0xb')](function(_0x4d22bf,_0x1419b8){if(_0x4d22bf){_0x5f260[_0x6620('0x9')](_0x6620('0x6'),new AGIError(_0x6620('0xc'),_0x4d22bf));}else if(_0xc333c2&&_0xc333c2<0x0){_0x5f260[_0x6620('0x9')](_0x6620('0x6'),new AGIError(_0x6620('0xd')));_0x1a5d36[_0x6620('0xe')]();}else if(_0xc333c2&&_0xc333c2>0x0&&_0xc333c2<_0x1419b8){_0x1b3987+=0x1;_0x5f260[_0x6620('0x9')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x1b3987));_0x1a5d36['destroy']();}else{var _0x828a43=new AGIChannel(_0x1a5d36);_0x828a43['on'](_0x6620('0xf'),function(){_0x5f260[_0x6620('0x9')](_0x6620('0xa'),_0x828a43);});}});});_0x11e8d9['on'](_0x6620('0x6'),function(_0x16a3c9){_0x5f260[_0x6620('0x9')](_0x6620('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x16a3c9[_0x6620('0x10')]));});_0x11e8d9['on']('close',function(){_0x5f260[_0x6620('0x9')](_0x6620('0x11'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6620('0x12')](function(){_0x330f5e();});};util[_0x6620('0x13')](AGIServer,EventEmitter);module[_0x6620('0x14')]=function(_0x19083e,_0x136023,_0x2f4bbd){return new AGIServer(_0x19083e,_0x136023,_0x2f4bbd);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 89a780f..47c3760 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 _0xe132=['uri','render','stringify','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_polly_region','Amy','aws_text_type','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','noop','exec','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','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','delay','list_id','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','getSquareOdbc','replace','query:\x20%s','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','mindigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','awsLex','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','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','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','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','.wav','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','success','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','PLAYBACK','queue','queue_id','no\x20queue\x20selected','getVoiceQueue','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','service','host','port','secure','auth','pass','template_id','sendMail\x20message','account_id','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','getSmsAccount','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','uniqueid','createCmContact','isEmpty','isNil','random','lastName','phone','scheduledAt','callback','toString','callback_priority','has','dialTimezone','CALLERID(dialTimezone)','timezones','scheduledat','add','minutes','insertContact','utcOffset','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','agentLogin','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','computedVariables','sync'];(function(_0x4b498a,_0x3bcbb5){var _0x41f89c=function(_0x237ceb){while(--_0x237ceb){_0x4b498a['push'](_0x4b498a['shift']());}};_0x41f89c(++_0x3bcbb5);}(_0xe132,0x162));var _0x2e13=function(_0x1f0b72,_0x368551){_0x1f0b72=_0x1f0b72-0x0;var _0x181231=_0xe132[_0x1f0b72];return _0x181231;};'use strict';var fs=require('fs');var path=require(_0x2e13('0x0'));var util=require('util');var _=require(_0x2e13('0x1'));var sh=require(_0x2e13('0x2'));var odbc=require(_0x2e13('0x3'))();var rs=require(_0x2e13('0x4'));var moment=require(_0x2e13('0x5'));var Mustache=require('mustache');var rp=require(_0x2e13('0x6'));var logger=require(_0x2e13('0x7'))('agi');var config=require('../../config/environment');var shared=require(_0x2e13('0x8'));var scripts=require(_0x2e13('0x9'));var FILES_PATH=_0x2e13('0xa');var recursiveMapAttributes=[_0x2e13('0xb'),_0x2e13('0xc')];var verticesWithRetry=[_0x2e13('0xd'),_0x2e13('0xe'),_0x2e13('0xf')];var AGIVertices=function(_0xd031e9,_0x240bc3,_0x5122a2){this[_0x2e13('0x10')]=_0xd031e9;this[_0x2e13('0x11')]=_0x240bc3;this[_0x2e13('0x12')]=_0x5122a2;};AGIVertices[_0x2e13('0x13')][_0x2e13('0x14')]=function(_0x1a871d,_0x302718){this['rpc'][_0x2e13('0x15')](_0x1a871d)[_0x2e13('0x16')](function(_0x320303){_0x302718(null,_0x320303?_0x320303[_0x2e13('0x17')]:![]);})[_0x2e13('0x18')](function(_0x40882c){_0x302718(_0x40882c);});};AGIVertices[_0x2e13('0x13')]['getVoiceQueue']=function(_0xb70eb8,_0xea6c20){this[_0x2e13('0x11')]['getVoiceQueueById'](_0xb70eb8)[_0x2e13('0x16')](function(_0x2a58e5){_0xea6c20(null,_0x2a58e5?_0x2a58e5[_0x2e13('0x17')]:![]);})['catch'](function(_0xd25628){_0xea6c20(_0xd25628);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x19')]=function(_0x4a466b,_0x4fceab){this[_0x2e13('0x11')][_0x2e13('0x1a')](_0x4a466b)[_0x2e13('0x16')](function(_0x3cdefc){_0x4fceab(null,_0x3cdefc?_0x3cdefc[_0x2e13('0x17')]:![]);})[_0x2e13('0x18')](function(_0x2496ee){_0x4fceab(_0x2496ee);});};AGIVertices[_0x2e13('0x13')]['getSquareOdbc']=function(_0x26bac1,_0x9c37a9){this[_0x2e13('0x11')][_0x2e13('0x1b')](_0x26bac1)['then'](function(_0x5d6938){_0x9c37a9(null,_0x5d6938?_0x5d6938[_0x2e13('0x1c')]:![]);})[_0x2e13('0x18')](function(_0x59c180){_0x9c37a9(_0x59c180);});};AGIVertices['prototype']['getUser']=function(_0x30f744,_0x2b55a7){this[_0x2e13('0x11')][_0x2e13('0x1d')](_0x30f744)[_0x2e13('0x16')](function(_0x2416b3){_0x2b55a7(null,_0x2416b3?_0x2416b3['name']:![]);})[_0x2e13('0x18')](function(_0xa30c6e){_0x2b55a7(_0xa30c6e);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x1e')]=function(_0x20417c,_0x3e5c24){this['rpc'][_0x2e13('0x1f')](_0x20417c)[_0x2e13('0x16')](function(_0x57aab0){_0x3e5c24(null,_0x57aab0?_0x57aab0['name']:![]);})[_0x2e13('0x18')](function(_0x468102){_0x3e5c24(_0x468102);});};AGIVertices[_0x2e13('0x13')]['getSound']=function(_0x227ef8,_0x4504d3){var _0x3838a0=this;this[_0x2e13('0x11')][_0x2e13('0x20')](_0x227ef8)[_0x2e13('0x16')](function(_0x103867){_0x4504d3(null,_0x103867?_0x3838a0[_0x2e13('0x21')](_0x103867[_0x2e13('0x22')]):![]);})[_0x2e13('0x18')](function(_0x1c5ba4){_0x4504d3(_0x1c5ba4);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x23')]=function(_0x28e2bf,_0x32da06){this['rpc'][_0x2e13('0x24')](_0x28e2bf)[_0x2e13('0x16')](function(_0x27d982){_0x32da06(null,_0x27d982?_0x27d982:![]);})['catch'](function(_0x5a7d9c){_0x32da06(_0x5a7d9c);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x25')]=function(_0x1466f2,_0xc7fbc3,_0x5fefbc){this[_0x2e13('0x12')]['sendMailMessage'](_0x1466f2,_0xc7fbc3)['then'](function(){_0x5fefbc(null);})[_0x2e13('0x18')](function(_0xdd763f){_0x5fefbc(_0xdd763f);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x26')]=function(_0x2573f8,_0x2cc523){this[_0x2e13('0x11')][_0x2e13('0x27')](_0x2573f8)['then'](function(_0x471a78){if(_0x471a78){if(_0x471a78[_0x2e13('0x28')]){_0x2cc523(null,[_0x471a78[_0x2e13('0x29')]]);}else{_0x2cc523(null,_[_0x2e13('0x2a')](_0x471a78[_0x2e13('0x2b')],'interval'));}}else{_0x2cc523(null,![]);}})[_0x2e13('0x18')](function(_0x245959){_0x2cc523(_0x245959);});};AGIVertices['prototype'][_0x2e13('0x21')]=function(_0x321339){return util[_0x2e13('0x2c')]('%s/sounds/converted/%s',FILES_PATH,_0x321339);};AGIVertices[_0x2e13('0x13')][_0x2e13('0x2d')]=function(_0x4bfb50,_0x376833,_0x147a04){odbc['open'](_0x4bfb50,function(_0x2d0f31){if(_0x2d0f31){logger['error'](_0x2e13('0x2e'),_0x2d0f31);_0x147a04(_0x2d0f31);}else{logger[_0x2e13('0x2f')]('ODBC\x20connection\x20successfully');odbc[_0x2e13('0x30')](_0x376833,function(_0xe7fd08,_0x3839b9){if(_0xe7fd08){logger[_0x2e13('0x2f')](_0x2e13('0x31'),_0x376833);_0x147a04(_0xe7fd08);}else{logger[_0x2e13('0x2f')](_0x2e13('0x32'),_0x376833);odbc[_0x2e13('0x33')](function(_0x446369){if(_0x446369){logger[_0x2e13('0x34')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x446369);}_0x147a04(null,_0x3839b9);});}});}});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x35')]=function(_0x22d36c,_0x309349){this[_0x2e13('0x11')]['getSmsAccountById'](_0x22d36c)[_0x2e13('0x16')](function(_0x54a398){_0x309349(null,_0x54a398?_0x54a398:![]);})[_0x2e13('0x18')](function(_0x7c6536){_0x309349(_0x7c6536);});};AGIVertices['prototype'][_0x2e13('0x36')]=function(_0x54feeb,_0x73f6a2){this[_0x2e13('0x11')][_0x2e13('0x36')](_0x54feeb)[_0x2e13('0x16')](function(_0x1548da){_0x73f6a2(null,_0x1548da);})['catch'](function(_0x425c97){_0x73f6a2(_0x425c97);});};AGIVertices['prototype'][_0x2e13('0x37')]=function(_0x16aec7,_0x2f2661,_0x296be9){this[_0x2e13('0x11')][_0x2e13('0x37')]({'uniqueid':this['channel']['uniqueid'],'node':_0x16aec7[_0x2e13('0x38')],'application':_0x16aec7[_0x2e13('0x39')],'data':_0x2f2661||null,'project_name':this['channel'][_0x2e13('0x3a')],'callerid':this[_0x2e13('0x10')][_0x2e13('0x3b')]})['then'](function(_0x5c6a9a){if(_0x296be9){_0x296be9(null,_0x5c6a9a);}})[_0x2e13('0x18')](function(_0x59ae24){if(_0x296be9){_0x296be9(_0x59ae24);}});};AGIVertices['prototype'][_0x2e13('0x3c')]=function(_0xdcd7a4,_0x20d952,_0x5f5dce,_0x20b444){this[_0x2e13('0x11')][_0x2e13('0x3c')]({'uniqueid':this[_0x2e13('0x10')]['uniqueid'],'callerid':this[_0x2e13('0x10')]['callerid'],'calleridname':this[_0x2e13('0x10')][_0x2e13('0x3d')],'context':this[_0x2e13('0x10')][_0x2e13('0x3e')],'extension':this[_0x2e13('0x10')][_0x2e13('0x3f')],'priority':this[_0x2e13('0x10')][_0x2e13('0x40')],'accountcode':this[_0x2e13('0x10')][_0x2e13('0x41')],'dnid':this['channel'][_0x2e13('0x42')],'projectName':this[_0x2e13('0x10')][_0x2e13('0x3a')],'saveName':_0x20d952,'filename':_0xdcd7a4[_0x2e13('0x43')]||_0x20d952,'savePath':_0x5f5dce})[_0x2e13('0x16')](function(_0xcc5495){_0x20b444(null,_0xcc5495);})[_0x2e13('0x18')](function(_0x3580a7){_0x20b444(_0x3580a7);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x44')]=function(_0x304fdf,_0x2e6234,_0x532689,_0x369d60,_0x114edd){this[_0x2e13('0x11')][_0x2e13('0x44')]({'uniqueid':this[_0x2e13('0x10')][_0x2e13('0x45')],'body':_0x304fdf,'direction':_0x2e6234,'providerName':_0x532689,'providerResponse':_0x369d60})['then'](function(_0x15e9aa){if(_0x114edd){_0x114edd(null,_0x15e9aa);}})[_0x2e13('0x18')](function(_0xb63ed4){if(_0x114edd){_0x114edd(_0xb63ed4);}});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x46')]=function(_0x13b4f4,_0x225602){var _0x5aefda=this;var _0x1630de=0x0;var _0x3a1a9c={'firstName':_[_0x2e13('0x47')](_0x13b4f4['name'])||_[_0x2e13('0x48')](_0x13b4f4[_0x2e13('0x17')])?'callback_'+Math[_0x2e13('0x49')]():_0x13b4f4['name'],'lastName':_['isEmpty'](_0x13b4f4[_0x2e13('0x4a')])||_[_0x2e13('0x48')](_0x13b4f4[_0x2e13('0x4a')])?null:_0x13b4f4[_0x2e13('0x4a')],'phone':_0x13b4f4[_0x2e13('0x4b')],'ListId':_0x13b4f4['list_id'],'scheduledat':_0x13b4f4[_0x2e13('0x4c')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x2e13('0x4d'),'description':'Callback\x20scheduled\x20at\x20'+_0x13b4f4[_0x2e13('0x4c')][_0x2e13('0x4e')](),'priority':_0x13b4f4[_0x2e13('0x4f')]};if(_[_0x2e13('0x50')](_0x13b4f4,_0x2e13('0x51'))){if(!_[_0x2e13('0x48')](_0x13b4f4[_0x2e13('0x51')])){var _0x15aeb4=_0x13b4f4['dialTimezone'];if(_0x13b4f4[_0x2e13('0x51')]==_0x2e13('0x52')){this['rpc']['getContactByPhone']({'phone':_0x13b4f4[_0x2e13('0x4b')]})[_0x2e13('0x16')](function(_0xc80c60){if(!_['isNil'](_0xc80c60)){var _0x1883d7=_0xc80c60['dialTimezone'];if(!_[_0x2e13('0x48')](_0x1883d7)){var _0x796224=shared[_0x2e13('0x53')][_0x1883d7];if(!_['isNil'](_0x796224)){var _0x130e62=-0x1*_0x796224['utcOffset'];_0x3a1a9c[_0x2e13('0x54')]=moment(_0x13b4f4[_0x2e13('0x54')])[_0x2e13('0x55')](_0x130e62,_0x2e13('0x56'));_0x5aefda[_0x2e13('0x57')](_0x3a1a9c,_0x13b4f4,_0x225602);}else{_0x5aefda[_0x2e13('0x57')](_0x3a1a9c,_0x13b4f4,_0x225602);}}else{_0x5aefda['insertContact'](_0x3a1a9c,_0x13b4f4,_0x225602);}}else{_0x5aefda[_0x2e13('0x57')](_0x3a1a9c,_0x13b4f4,_0x225602);}});}else{var _0x1630de=shared['timezones'][_0x15aeb4];if(!_['isNil'](_0x1630de)){var _0x446643=-0x1*_0x1630de[_0x2e13('0x58')];_0x3a1a9c['scheduledat']=moment(_0x13b4f4['scheduledat'])[_0x2e13('0x55')](_0x446643,'minutes');_0x5aefda[_0x2e13('0x57')](_0x3a1a9c,_0x13b4f4,_0x225602);}else{_0x5aefda[_0x2e13('0x57')](_0x3a1a9c,_0x13b4f4,_0x225602);}}}else{_0x5aefda[_0x2e13('0x57')](_0x3a1a9c,_0x13b4f4,_0x225602);}}else{_0x5aefda['insertContact'](_0x3a1a9c,_0x13b4f4,_0x225602);}};AGIVertices['prototype'][_0x2e13('0x59')]=function(_0xb280a6,_0x473703){this['rpc'][_0x2e13('0x5a')](_0xb280a6)['then'](function(_0x2e646){_0x473703(null,_0x2e646?_0x2e646['name']:![]);})['catch'](function(_0x489f94){_0x473703(_0x489f94);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x5b')]=function(_0x354f3e,_0x1a1cc0,_0xfe3c18){var _0x1e2596={'role':_0x2e13('0x5c')};_0x1e2596[_0x354f3e]=this[_0x2e13('0x10')]['callerid'];this[_0x2e13('0x11')][_0x2e13('0x5b')](_0x1e2596,_0x1a1cc0,this[_0x2e13('0x10')][_0x2e13('0x45')])[_0x2e13('0x16')](function(_0x5262de){_0xfe3c18(null,_[_0x2e13('0x48')](_0x5262de)?![]:!![]);})[_0x2e13('0x18')](function(_0x5a6dd1){logger[_0x2e13('0x34')](_0x5a6dd1);_0xfe3c18(null,![]);});};AGIVertices['prototype'][_0x2e13('0x5d')]=function(_0x2c73d9,_0x61d47f){var _0x33e0b5={'role':_0x2e13('0x5c')};_0x33e0b5[_0x2c73d9]=this[_0x2e13('0x10')]['callerid'];this[_0x2e13('0x11')][_0x2e13('0x5d')](_0x33e0b5)[_0x2e13('0x16')](function(_0x58be88){_0x61d47f(null,_[_0x2e13('0x48')](_0x58be88)?![]:!![]);})[_0x2e13('0x18')](function(_0x37a879){logger[_0x2e13('0x34')](_0x37a879);_0x61d47f(null,![]);});};AGIVertices['prototype'][_0x2e13('0x5e')]=function(_0x188a67,_0x2f754c){var _0x4240d6={'role':'agent'};_0x4240d6[_0x188a67]=this[_0x2e13('0x10')][_0x2e13('0x3b')];this[_0x2e13('0x11')]['agentLogout'](_0x4240d6)[_0x2e13('0x16')](function(_0x3fe20f){_0x2f754c(null,_[_0x2e13('0x48')](_0x3fe20f)?![]:!![]);})[_0x2e13('0x18')](function(_0x15f4c4){logger['error'](_0x15f4c4);_0x2f754c(null,![]);});};AGIVertices[_0x2e13('0x13')]['agentLogin']=function(_0x571381,_0x390790){var _0x18d056={'role':_0x2e13('0x5c')};_0x18d056[_0x571381]=this[_0x2e13('0x10')][_0x2e13('0x3b')];var _0x4cddb1=_0x571381!=_0x2e13('0x5f')?util[_0x2e13('0x2c')](_0x2e13('0x60'),'LOCAL',this[_0x2e13('0x10')][_0x2e13('0x3b')]):undefined;this[_0x2e13('0x11')][_0x2e13('0x61')](_0x18d056,_0x4cddb1)['then'](function(_0x36de08){_0x390790(null,_['isNil'](_0x36de08)?![]:!![]);})['catch'](function(_0x22f345){logger[_0x2e13('0x34')](_0x22f345);_0x390790(null,![]);});};AGIVertices[_0x2e13('0x13')]['shellCommand']=function(_0x101e3b,_0x967071){sh['exec'](_[_0x2e13('0x62')](_0x101e3b),function(_0x332672,_0x39aa46){var _0x2f0389=_0x39aa46['replace'](/(\r\n|\n|\r)/gm,'');_0x967071(null,_0x2f0389);});};AGIVertices[_0x2e13('0x13')]['googleCloudTTS']=function(_0x126d7e,_0x94d5af){scripts[_0x2e13('0x63')](_0x126d7e[_0x2e13('0x64')],_0x126d7e[_0x2e13('0x65')]||'text',_0x126d7e[_0x2e13('0x66')],_0x126d7e[_0x2e13('0x67')]||_0x2e13('0x68'),_0x126d7e['ssmlGender']||_0x2e13('0x69'),_0x126d7e['audioEncoding']||_0x2e13('0x6a'))['then'](function(_0x4b7c80){_0x94d5af(null,_0x4b7c80);})[_0x2e13('0x18')](function(_0xbed8fb){_0x94d5af(_0xbed8fb);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x6b')]=function(_0x1b4979,_0x2b3fa6){scripts[_0x2e13('0x6b')](_0x1b4979['text'],_0x1b4979[_0x2e13('0x6c')]||'en',0x1)[_0x2e13('0x16')](function(_0x4c9abe){_0x2b3fa6(null,_0x4c9abe);})[_0x2e13('0x18')](function(_0x221932){_0x2b3fa6(_0x221932);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x6d')]=function(_0x1d3b1d,_0x288012){var _0x178b90={'uri':_0x1d3b1d[_0x2e13('0x6e')],'method':_0x1d3b1d[_0x2e13('0x6f')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1d3b1d[_0x2e13('0x70')])===_0x2e13('0x71')&&parseInt(_0x1d3b1d['timeout'])>=0x1?parseInt(_0x1d3b1d['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x2e13('0x72')]([_0x2e13('0x73'),_0x2e13('0x74')],_0x178b90[_0x2e13('0x6f')][_0x2e13('0x75')]())){try{_0x178b90[_0x2e13('0x76')]=_0x1d3b1d[_0x2e13('0xc')]?JSON['parse'](_0x1d3b1d[_0x2e13('0xc')]):{};}catch(_0x887b8d){logger['error'](_0x2e13('0x77'),_0x887b8d);}}try{_0x178b90[_0x2e13('0x78')]=_0x1d3b1d[_0x2e13('0xb')]?JSON[_0x2e13('0x79')](_0x1d3b1d[_0x2e13('0xb')]):{};}catch(_0x197ac2){logger[_0x2e13('0x34')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x197ac2);}if(_0x1d3b1d[_0x2e13('0x7a')]){try{var _0x4ed78f=require(_0x1d3b1d[_0x2e13('0x7a')])[_0x2e13('0x7b')](this,_0x178b90);_0x178b90[_0x2e13('0x7c')]=Mustache[_0x2e13('0x7d')](_0x1d3b1d['url'],_0x4ed78f,{},['$$','$$']);if(_0x178b90[_0x2e13('0x78')]){_0x178b90['headers']=JSON['parse'](Mustache[_0x2e13('0x7d')](JSON[_0x2e13('0x7e')](_0x178b90['headers']),_0x4ed78f,{},['$$','$$']));}if(_0x178b90[_0x2e13('0x76')]){_0x178b90['body']=JSON[_0x2e13('0x79')](Mustache['render'](JSON['stringify'](_0x178b90[_0x2e13('0x76')]),_0x4ed78f,{},['$$','$$']));}}catch(_0x413008){logger[_0x2e13('0x34')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x413008);}}rp(_0x178b90)[_0x2e13('0x16')](function(_0x25d013){var _0x135050={'statusCode':_0x25d013['statusCode']||0xc8,'statusMessage':_0x25d013[_0x2e13('0x7f')]||'OK','headers':_0x25d013['headers']||{},'body':_0x25d013[_0x2e13('0x76')]||{}};_0x288012(null,_0x135050);})[_0x2e13('0x18')](function(_0x2db29f){var _0x25fc1c={'statusCode':_0x2db29f[_0x2e13('0x80')]||0x1f4,'statusMessage':_0x2db29f[_0x2e13('0x81')]||_0x2e13('0x82'),'headers':_0x2db29f[_0x2e13('0x83')][_0x2e13('0x78')]||{},'body':_0x2db29f['options'][_0x2e13('0x76')]||{}};_0x288012(null,_0x25fc1c);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x84')]=function(_0x3ebe01,_0x262602){scripts[_0x2e13('0x84')](this['channel']['uniqueid'],_0x3ebe01[_0x2e13('0x85')],_0x3ebe01[_0x2e13('0x66')],_0x3ebe01[_0x2e13('0x86')]||'en')[_0x2e13('0x16')](function(_0x1cf74c){_0x262602(null,_0x1cf74c);})[_0x2e13('0x18')](function(_0x4ae072){_0x262602(_0x4ae072);});};AGIVertices['prototype'][_0x2e13('0x87')]=function(_0x18e77c,_0x104e74){scripts[_0x2e13('0x87')](this[_0x2e13('0x10')][_0x2e13('0x45')],_0x18e77c[_0x2e13('0x88')],_0x18e77c[_0x2e13('0x89')],_0x18e77c['private_key'],_0x18e77c[_0x2e13('0x66')],_0x18e77c[_0x2e13('0x8a')]||'en')[_0x2e13('0x16')](function(_0x38ba23){_0x104e74(null,_0x38ba23);})['catch'](function(_0x576104){_0x104e74(_0x576104);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x8b')]=function(_0x4486bd,_0x9845b0){scripts[_0x2e13('0x8b')](this[_0x2e13('0x10')],_0x4486bd)[_0x2e13('0x16')](function(_0x4bb9c7){_0x9845b0(null,_0x4bb9c7);})[_0x2e13('0x18')](function(_0x350ec7){_0x9845b0(_0x350ec7);});};AGIVertices['prototype'][_0x2e13('0x8c')]=function(_0x238b0b,_0x42a72a){scripts[_0x2e13('0x8c')](_0x238b0b['key'],_0x238b0b[_0x2e13('0x66')],_0x238b0b[_0x2e13('0x8d')]||'en-US',_0x238b0b[_0x2e13('0x8e')])[_0x2e13('0x16')](function(_0x525ff0){_0x42a72a(null,_0x525ff0);})[_0x2e13('0x18')](function(_0x2d208d){_0x42a72a(_0x2d208d);});};AGIVertices['prototype'][_0x2e13('0x8f')]=function(_0x4e967a,_0x44180c,_0x4a3b3b){scripts['ispeechASR'](_0x44180c,_0x4e967a[_0x2e13('0x85')],_0x4e967a[_0x2e13('0x90')]||_0x2e13('0x68'),this['isConfigured'](_0x4e967a[_0x2e13('0x91')])?_0x4e967a['model']:undefined)[_0x2e13('0x16')](function(_0x15445d){_0x4a3b3b(null,_0x15445d);})[_0x2e13('0x18')](function(_0x4bd63c){_0x4a3b3b(_0x4bd63c);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x92')]=function(_0x4f5113,_0x2e20e6){scripts[_0x2e13('0x92')](_0x4f5113[_0x2e13('0x93')],_0x4f5113['aws_secret_access_key'],_0x4f5113[_0x2e13('0x94')],_0x4f5113['aws_polly_voice']||_0x2e13('0x95'),_0x4f5113[_0x2e13('0x66')],_0x4f5113[_0x2e13('0x96')]||_0x2e13('0x66'))['then'](function(_0x5e4974){_0x2e20e6(null,_0x5e4974);})[_0x2e13('0x18')](function(_0x4cf8a3){_0x2e20e6(_0x4cf8a3);});};AGIVertices[_0x2e13('0x13')]['awsLex']=function(_0x486f9b,_0x2620a7){scripts['awsLex'](this['channel'][_0x2e13('0x45')],_0x486f9b[_0x2e13('0x93')],_0x486f9b['aws_secret_access_key'],_0x486f9b[_0x2e13('0x97')],_0x486f9b[_0x2e13('0x66')],_0x486f9b[_0x2e13('0x98')])[_0x2e13('0x16')](function(_0x4d726c){_0x2620a7(null,_0x4d726c);})[_0x2e13('0x18')](function(_0x2ba0cc){_0x2620a7(_0x2ba0cc);});};AGIVertices['prototype'][_0x2e13('0x99')]=function(_0x39aac1,_0x109611,_0x2a9f44){scripts[_0x2e13('0x99')](_0x109611,_0x39aac1['key'],_0x39aac1[_0x2e13('0x9a')]||_0x2e13('0x68'))[_0x2e13('0x16')](function(_0x4dc513){_0x2a9f44(null,_0x4dc513);})['catch'](function(_0x5757c7){_0x2a9f44(_0x5757c7);});};AGIVertices['prototype'][_0x2e13('0x9b')]=function(_0x2229a9,_0x1b6729,_0x14eb6d){scripts[_0x2e13('0x9b')](_0x1b6729,_0x2229a9[_0x2e13('0x9c')],_0x2229a9[_0x2e13('0x9d')],_0x2229a9[_0x2e13('0x7c')])[_0x2e13('0x16')](function(_0x15f9b8){_0x14eb6d(null,_0x15f9b8);})[_0x2e13('0x18')](function(_0x17d650){_0x14eb6d(_0x17d650);});};AGIVertices[_0x2e13('0x13')][_0x2e13('0x9e')]=function(_0x19ac8a){var _0x249b2e=_[_0x2e13('0x72')](verticesWithRetry,_0x19ac8a[_0x2e13('0x39')])?_0x19ac8a:_[_0x2e13('0x9f')](_0x19ac8a);for(var _0x5c7a05 in _0x249b2e){if(_0x249b2e[_0x2e13('0xa0')](_0x5c7a05)){if(_0x249b2e[_0x5c7a05]&&_[_0x2e13('0xa1')](_0x249b2e[_0x5c7a05])){if(_[_0x2e13('0x72')](recursiveMapAttributes,_0x5c7a05)){_0x249b2e[_0x5c7a05]=this['replaceObjectAllVariables'](_0x249b2e[_0x5c7a05]);}else{_0x249b2e[_0x5c7a05]=this[_0x2e13('0xa2')](_0x249b2e[_0x5c7a05]);}}}}return _0x249b2e;};AGIVertices[_0x2e13('0x13')][_0x2e13('0xa3')]=function(_0x88e901){for(var _0x222a8e in _0x88e901){if(_0x88e901[_0x2e13('0xa0')](_0x222a8e)){if(_['isPlainObject'](_0x88e901[_0x222a8e])){this[_0x2e13('0xa3')](_0x88e901[_0x222a8e]);}else if(_[_0x2e13('0xa4')](_0x88e901[_0x222a8e])){for(var _0x4d2d14=0x0;_0x4d2d14<_0x88e901[_0x222a8e][_0x2e13('0xa5')];_0x4d2d14++){this[_0x2e13('0xa3')](_0x88e901[_0x222a8e][_0x4d2d14]);}}else if(_[_0x2e13('0xa1')](_0x88e901[_0x222a8e])){_0x88e901[_0x222a8e]=this[_0x2e13('0xa2')](_0x88e901[_0x222a8e]);}}}};AGIVertices[_0x2e13('0x13')][_0x2e13('0xa6')]=function(_0x17a5a0,_0x13725e){for(var _0xcfc9e2 in _0x17a5a0){if(_0x17a5a0[_0x2e13('0xa0')](_0xcfc9e2)){if(_[_0x2e13('0xa7')](_0x17a5a0[_0xcfc9e2])){if(!_[_0x2e13('0x47')](_0x17a5a0[_0xcfc9e2])){this[_0x2e13('0xa6')](_0x17a5a0[_0xcfc9e2],util[_0x2e13('0x2c')]('%s.%s',_0x13725e,_0xcfc9e2));}}else if(_['isArray'](_0x17a5a0[_0xcfc9e2])){for(var _0x4b654c=0x0;_0x4b654c<_0x17a5a0[_0xcfc9e2]['length'];_0x4b654c++){this[_0x2e13('0xa6')](_0x17a5a0[_0xcfc9e2][_0x4b654c],util[_0x2e13('0x2c')](_0x2e13('0xa8'),_0x13725e,_0xcfc9e2+'['+_0x4b654c+']'));}}else{if(!_[_0x2e13('0x48')](_0x17a5a0[_0xcfc9e2])){this['channel']['setVariable'](util['format'](_0x2e13('0xa8'),_0x13725e,_0xcfc9e2),_0x17a5a0[_0xcfc9e2]);}}}}};AGIVertices[_0x2e13('0x13')]['replaceObjectAllVariables']=function(_0x29814b){try{var _0x45c52f=JSON['parse'](_0x29814b);this[_0x2e13('0xa3')](_0x45c52f);return JSON[_0x2e13('0x7e')](_0x45c52f);}catch(_0x80dda8){return this['replaceAllVariables'](_0x29814b);}};AGIVertices['prototype'][_0x2e13('0xa2')]=function(_0x5bdae4){var _0x7c4f3b=_0x5bdae4[_0x2e13('0xa9')]('{');for(var _0x5893ff=0x1;_0x5893ff<_0x7c4f3b[_0x2e13('0xa5')];_0x5893ff+=0x1){var _0x2b186c=_0x7c4f3b[_0x5893ff][_0x2e13('0xa9')]('}');if(_0x2b186c[_0x2e13('0xa5')]>0x1){_0x5bdae4=_0x5bdae4[_0x2e13('0xaa')]('{'+_0x2b186c[0x0]+'}',this[_0x2e13('0x10')][_0x2e13('0x14')](_0x2b186c[0x0])[_0x2e13('0xab')]||_0x2b186c[0x0]);}}if(_0x7c4f3b[_0x2e13('0xa5')]===0x1){return _0x5bdae4[_0x2e13('0x4e')]();}return this[_0x2e13('0xa2')](_0x5bdae4);};AGIVertices[_0x2e13('0x13')][_0x2e13('0xac')]=function(_0x5895ee,_0x269065){var _0x1d7011=this[_0x2e13('0x10')][_0x2e13('0x14')](_0x5895ee);if(_0x1d7011[_0x2e13('0xad')]===-0x1){return _0x1d7011;}logger[_0x2e13('0x2f')](util['format'](_0x2e13('0xae'),_0x269065,_0x1d7011['extra']));return this[_0x2e13('0x10')][_0x2e13('0xaf')](_0x269065,_0x1d7011[_0x2e13('0xab')]);};AGIVertices[_0x2e13('0x13')]['isConfigured']=function(_0x635786){return _0x635786&&_0x635786!=='0'&&_0x635786!=='-1'&&_0x635786!=='';};AGIVertices['prototype']['maxRetry']=function(_0x385066){this[_0x2e13('0x37')][_0x2e13('0x7b')](this,_0x385066,'-');_0x385066[_0x2e13('0xb0')]=_0x385066[_0x2e13('0xb1')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x2e13('0x13')][_0x2e13('0xb2')]=function(_0x5d8332){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0xb3'),_0x5d8332[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x5d8332[_0x2e13('0x66')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')]('no\x20text\x20configured');}var _0x453ded='\x22'+_0x5d8332['text']+'\x22';if(this[_0x2e13('0xb4')](_0x5d8332['options'])){_0x453ded+=','+_0x5d8332['options'];}var _0x314233=this[_0x2e13('0x10')][_0x2e13('0xb6')]('MRCPSynth',_0x453ded);if(_0x314233[_0x2e13('0xad')]===-0x1){return _0x314233;}return this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0xb7'),_0x453ded));};AGIVertices[_0x2e13('0x13')][_0x2e13('0xb8')]=function(_0x127ae9){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0xb9'),_0x127ae9[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x127ae9[_0x2e13('0xba')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0xbb'));}var _0x295e5c=_0x127ae9[_0x2e13('0xba')];if(this[_0x2e13('0xb4')](_0x127ae9[_0x2e13('0x83')])){_0x295e5c+=','+_0x127ae9[_0x2e13('0x83')];}var _0x1e54b8=this['channel']['exec'](_0x2e13('0xbc'),_0x295e5c);if(_0x1e54b8[_0x2e13('0xad')]===-0x1){return _0x1e54b8;}var _0x5dbbed=this[_0x2e13('0xac')](_0x2e13('0xbd'),_0x2e13('0xbe'));if(_0x5dbbed[_0x2e13('0xad')]===-0x1){return _0x5dbbed;}var _0x1c8100=this[_0x2e13('0xac')](_0x2e13('0xbf'),_0x2e13('0xc0'));if(_0x1c8100['result']===-0x1){return _0x1c8100;}var _0x463e3f=this['getAndSetVariable'](_0x2e13('0xc1'),_0x2e13('0xc2'));if(_0x463e3f[_0x2e13('0xad')]===-0x1){return _0x463e3f;}return this[_0x2e13('0x10')]['noop'](util[_0x2e13('0x2c')](_0x2e13('0xc3'),_0x295e5c));};AGIVertices[_0x2e13('0x13')][_0x2e13('0xc4')]=function(_0x58c81c){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0xc5'),_0x58c81c[_0x2e13('0x38')]));return this['channel'][_0x2e13('0xc4')]([_0x58c81c[_0x2e13('0xc6')],_0x58c81c['args']]);};AGIVertices[_0x2e13('0x13')]['answer']=function(_0x35e782){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0xc7'),_0x35e782[_0x2e13('0x38')]));if(this[_0x2e13('0xb4')](_0x35e782[_0x2e13('0x70')])){logger[_0x2e13('0x2f')](util['format'](_0x2e13('0xc8'),_0x35e782['timeout']));var _0x1839a5=this[_0x2e13('0x10')][_0x2e13('0xc9')](_0x35e782[_0x2e13('0x70')]);if(_0x1839a5[_0x2e13('0xad')]===-0x1){return _0x1839a5;}}return this[_0x2e13('0x10')]['answer']();};AGIVertices[_0x2e13('0x13')][_0x2e13('0x4d')]=function(_0x3aa338){logger[_0x2e13('0x2f')](util['format'](_0x2e13('0xca'),_0x3aa338[_0x2e13('0x38')]));if(!this['isConfigured'](_0x3aa338['list_id'])){return this[_0x2e13('0x10')]['error'](_0x3aa338,'no\x20list\x20selected');}_0x3aa338[_0x2e13('0x4c')]=moment();if(this[_0x2e13('0xb4')](_0x3aa338[_0x2e13('0xcb')])){_0x3aa338['scheduledAt']=moment()[_0x2e13('0x55')](_0x3aa338[_0x2e13('0xcb')],'minutes');}if(!this[_0x2e13('0xb4')](_0x3aa338[_0x2e13('0x4f')])){_0x3aa338['callback_priority']=0x2;}this[_0x2e13('0x46')][_0x2e13('0x7b')](this,_0x3aa338);return this['channel']['noop'](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3aa338[_0x2e13('0x4b')],_0x3aa338[_0x2e13('0xcc')],_0x3aa338[_0x2e13('0x4c')]));};AGIVertices[_0x2e13('0x13')][_0x2e13('0xcd')]=function(_0x3ef336){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0xce'),_0x3ef336['label']));var _0x392373=this[_0x2e13('0x10')][_0x2e13('0xb6')](_0x3ef336['application'],_0x3ef336['options']);if(_0x392373[_0x2e13('0xad')]===-0x1){return _0x392373;}return this[_0x2e13('0x10')]['noop'](util['format'](_0x2e13('0xcf'),_0x3ef336[_0x2e13('0xd0')],_0x3ef336[_0x2e13('0x83')]));};AGIVertices[_0x2e13('0x13')]['lumenvoxtts']=function(_0x4f97b6){logger['info'](util[_0x2e13('0x2c')](_0x2e13('0xd1'),_0x4f97b6[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x4f97b6[_0x2e13('0x66')])){return this[_0x2e13('0x10')]['noop'](_0x2e13('0xd2'));}var _0x2d005c='\x22'+_0x4f97b6[_0x2e13('0x66')]+'\x22';if(this[_0x2e13('0xb4')](_0x4f97b6[_0x2e13('0x83')])){_0x2d005c+=','+_0x4f97b6[_0x2e13('0x83')];}var _0x545a27=this[_0x2e13('0x10')]['exec']('MRCPSynth',_0x2d005c);if(_0x545a27['result']===-0x1){return _0x545a27;}return this['channel']['noop'](util[_0x2e13('0x2c')](_0x2e13('0xb7'),_0x2d005c));};AGIVertices[_0x2e13('0x13')][_0x2e13('0xd3')]=function(_0x57b2f6){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0xd4'),_0x57b2f6[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x57b2f6[_0x2e13('0x66')])){return this['channel'][_0x2e13('0xb5')]('no\x20text\x20configured');}var _0x143070='\x22'+_0x57b2f6[_0x2e13('0x66')]+'\x22';if(this[_0x2e13('0xb4')](_0x57b2f6['options'])){_0x143070+=','+_0x57b2f6[_0x2e13('0x83')];}var _0x5d779a=this[_0x2e13('0x10')][_0x2e13('0xb6')](_0x2e13('0xd5'),_0x143070);if(_0x5d779a[_0x2e13('0xad')]===-0x1){return _0x5d779a;}return this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x143070));};AGIVertices['prototype'][_0x2e13('0xd6')]=function(_0x2078e9){logger[_0x2e13('0x2f')](util['format'](_0x2e13('0xd7'),_0x2078e9[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x2078e9[_0x2e13('0xba')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0xbb'));}var _0x11ea0e=_0x2078e9[_0x2e13('0xba')];if(this[_0x2e13('0xb4')](_0x2078e9[_0x2e13('0x83')])){_0x11ea0e+=','+_0x2078e9[_0x2e13('0x83')];}var _0xbb472a=this['channel'][_0x2e13('0xb6')]('MRCPRecog',_0x11ea0e);if(_0xbb472a[_0x2e13('0xad')]===-0x1){return _0xbb472a;}var _0x2c0535=this[_0x2e13('0xac')](_0x2e13('0xbd'),_0x2e13('0xd8'));if(_0x2c0535[_0x2e13('0xad')]===-0x1){return _0x2c0535;}var _0x3b0ad0=this[_0x2e13('0xac')](_0x2e13('0xbf'),_0x2e13('0xd9'));if(_0x3b0ad0[_0x2e13('0xad')]===-0x1){return _0x3b0ad0;}var _0x2602bf=this[_0x2e13('0xac')]('RECOG_INSTANCE()',_0x2e13('0xda'));if(_0x2602bf[_0x2e13('0xad')]===-0x1){return _0x2602bf;}return this['channel'][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0xc3'),_0x11ea0e));};AGIVertices[_0x2e13('0x13')][_0x2e13('0xdb')]=function(_0x4a567){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0xdc'),_0x4a567[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x4a567['grammar'])){return this[_0x2e13('0x10')]['noop'](_0x2e13('0xbb'));}var _0x4a4c2f=_0x4a567['grammar'];if(this[_0x2e13('0xb4')](_0x4a567['options'])){_0x4a4c2f+=','+_0x4a567[_0x2e13('0x83')];}var _0xaf9e72=this[_0x2e13('0x10')]['exec'](_0x2e13('0xbc'),_0x4a4c2f);if(_0xaf9e72[_0x2e13('0xad')]===-0x1){return _0xaf9e72;}var _0x4c581c=this[_0x2e13('0xac')](_0x2e13('0xbd'),'SESTEK_ASR_CONFIDENCE');if(_0x4c581c[_0x2e13('0xad')]===-0x1){return _0x4c581c;}var _0x16d09d=this[_0x2e13('0xac')]('RECOG_INPUT()',_0x2e13('0xdd'));if(_0x16d09d[_0x2e13('0xad')]===-0x1){return _0x16d09d;}var _0x405d4c=this[_0x2e13('0xac')]('RECOG_INSTANCE()',_0x2e13('0xde'));if(_0x405d4c[_0x2e13('0xad')]===-0x1){return _0x405d4c;}return this[_0x2e13('0x10')]['noop'](util[_0x2e13('0x2c')](_0x2e13('0xc3'),_0x4a4c2f));};AGIVertices[_0x2e13('0x13')][_0x2e13('0xdf')]=function(_0x180ab1){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0xe0'),_0x180ab1['label']));if(!this[_0x2e13('0xb4')](_0x180ab1[_0x2e13('0xe1')])){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x180ab1,'no\x20database\x20selected');}var _0x4b3e56=this[_0x2e13('0xe2')]['sync'](this,_0x180ab1[_0x2e13('0xe1')]);if(!_0x4b3e56){return this['channel'][_0x2e13('0x34')](_0x180ab1,'no\x20odbc\x20database\x20found');}if(!this[_0x2e13('0xb4')](_0x180ab1[_0x2e13('0x30')])){return this['channel'][_0x2e13('0x34')](_0x180ab1,'no\x20query\x20configured');}var _0x46b93d=_0x180ab1['query'][_0x2e13('0xe3')](/(\r\n|\n|\r)/gm,'\x20');this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0xe4'),_0x46b93d));var _0x56cdd9=this[_0x2e13('0x2d')][_0x2e13('0x7b')](this,_0x4b3e56,_0x46b93d);this[_0x2e13('0x37')][_0x2e13('0x7b')](this,_0x180ab1,_0x46b93d);if(!this['isConfigured'](_0x180ab1['variable_id'])){return this[_0x2e13('0x10')][_0x2e13('0xb5')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4802b9=this['getVariable'][_0x2e13('0x7b')](this,_0x180ab1[_0x2e13('0xe5')]);if(!_0x4802b9){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x180ab1,'no\x20variable\x20found');}var _0x3ea043=this;_0x56cdd9[_0x2e13('0xe6')](function(_0x4e1189,_0x49c32e){Object[_0x2e13('0xe7')](_0x4e1189)[_0x2e13('0xe6')](function(_0x2f6430){_0x3ea043[_0x2e13('0x10')][_0x2e13('0xaf')](util['format'](_0x2e13('0xe8'),_0x4802b9,_0x49c32e,_0x2f6430),_0x4e1189[_0x2f6430]);});});this['channel'][_0x2e13('0xaf')](util[_0x2e13('0x2c')](_0x2e13('0xe9'),_0x4802b9),_0x56cdd9[_0x2e13('0xa5')]);return this[_0x2e13('0x10')]['noop'](util[_0x2e13('0x2c')]('variable\x20%s\x20set',_0x4802b9));};AGIVertices[_0x2e13('0x13')][_0x2e13('0xea')]=function(_0x53d9e3){logger[_0x2e13('0xeb')](util['format'](_0x2e13('0xec'),_0x53d9e3['label']));if(!this[_0x2e13('0xb4')](_0x53d9e3[_0x2e13('0xed')])){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x53d9e3,_0x2e13('0xee'));}var _0x56b0cb=this[_0x2e13('0xef')]['sync'](this,_0x53d9e3[_0x2e13('0xed')]);if(!_0x56b0cb){return this['channel'][_0x2e13('0x34')](_0x53d9e3,'no\x20user\x20found');}var _0x182c09=this[_0x2e13('0x10')]['exec'](_0x2e13('0xf0'),[util['format'](_0x2e13('0xf1'),_0x56b0cb),_0x53d9e3[_0x2e13('0x70')],_0x53d9e3[_0x2e13('0xf2')],_0x53d9e3[_0x2e13('0x6e')]]);if(_0x182c09['result']===-0x1){return _0x182c09;}return this[_0x2e13('0x10')]['noop'](util['format'](_0x2e13('0xf3'),_0x2e13('0xf0')));};AGIVertices[_0x2e13('0x13')][_0x2e13('0xf4')]=function(_0x5c39c6){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0xf5'),_0x5c39c6[_0x2e13('0x38')]));if(!this['isConfigured'](_0x5c39c6[_0x2e13('0x85')])){return this[_0x2e13('0x10')]['noop'](_0x2e13('0xf6'));}if(!this[_0x2e13('0xb4')](_0x5c39c6[_0x2e13('0x66')])){return this['channel'][_0x2e13('0xb5')](_0x2e13('0xd2'));}this[_0x2e13('0x10')][_0x2e13('0xf7')]=!![];this[_0x2e13('0x37')](_0x5c39c6);this[_0x2e13('0x44')](_0x5c39c6[_0x2e13('0x66')],'in','','');this[_0x2e13('0x10')][_0x2e13('0xb5')](util['format']('Trying\x20Dialogflow:\x20%s',_0x5c39c6[_0x2e13('0x66')]));var _0x4e42e4=this[_0x2e13('0x84')]['sync'](this,_0x5c39c6);if(_0x4e42e4){for(var _0x58a66e in _0x4e42e4){if(_0x4e42e4[_0x2e13('0xa0')](_0x58a66e)){this[_0x2e13('0x10')][_0x2e13('0xaf')](util[_0x2e13('0x2c')](_0x2e13('0xf8'),_0x58a66e['toUpperCase']()),_0x4e42e4[_0x58a66e]);}}this[_0x2e13('0x44')](_0x4e42e4[_0x2e13('0xf9')],_0x2e13('0xfa'),_0x2e13('0xf4'),'');return this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0xfb'),_0x4e42e4['speech']));}return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x5c39c6,_0x2e13('0xfc'));};AGIVertices[_0x2e13('0x13')]['dialogflowV2']=function(_0x32232a){logger[_0x2e13('0x2f')](util['format'](_0x2e13('0xfd'),_0x32232a[_0x2e13('0x38')]));if(!this['isConfigured'](_0x32232a[_0x2e13('0x88')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0xfe'));}if(!this[_0x2e13('0xb4')](_0x32232a[_0x2e13('0x89')])){return this['channel']['noop']('no\x20client_email\x20configured');}if(!this[_0x2e13('0xb4')](_0x32232a['private_key'])){return this['channel'][_0x2e13('0xb5')](_0x2e13('0xff'));}if(!this[_0x2e13('0xb4')](_0x32232a[_0x2e13('0x8a')])){return this['channel'][_0x2e13('0xb5')]('no\x20anguage\x20configured');}if(!this[_0x2e13('0xb4')](_0x32232a[_0x2e13('0x66')])){return this[_0x2e13('0x10')]['noop'](_0x2e13('0xd2'));}this[_0x2e13('0x10')][_0x2e13('0xf7')]=!![];this['createSquareDetailsReport'](_0x32232a);this[_0x2e13('0x44')](_0x32232a[_0x2e13('0x66')],'in','','');this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x100'),_0x32232a[_0x2e13('0x66')]));var _0x5adb23=this[_0x2e13('0x87')]['sync'](this,_0x32232a);if(_0x5adb23){for(var _0x29a566 in _0x5adb23){if(_0x5adb23[_0x2e13('0xa0')](_0x29a566)){if(_0x29a566!=='providerResponse'){this[_0x2e13('0x10')][_0x2e13('0xaf')](util[_0x2e13('0x2c')](_0x2e13('0xf8'),_0x29a566['toUpperCase']()),_0x5adb23[_0x29a566]);}}}this[_0x2e13('0x44')](_0x5adb23[_0x2e13('0xf9')],'out','dialogflowV2',_0x5adb23[_0x2e13('0x101')]);return this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x102'),_0x5adb23[_0x2e13('0xf9')]));}return this[_0x2e13('0x10')]['error'](_0x32232a,_0x2e13('0x103'));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x104')]=function(_0x5cb22a){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5cb22a['label']));if(!this['isConfigured'](_0x5cb22a['ndauth_url'])){return this[_0x2e13('0x10')][_0x2e13('0xb5')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x2e13('0xb4')](_0x5cb22a[_0x2e13('0x105')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0x106'));}if(!this[_0x2e13('0xb4')](_0x5cb22a[_0x2e13('0x107')])){return this['channel'][_0x2e13('0xb5')](_0x2e13('0x108'));}if(!this[_0x2e13('0xb4')](_0x5cb22a[_0x2e13('0x109')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')]('no\x20text\x20configured');}this[_0x2e13('0x10')][_0x2e13('0xf7')]=!![];this['createSquareDetailsReport'](_0x5cb22a);this[_0x2e13('0x44')](_0x5cb22a[_0x2e13('0x66')],'in','','');this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')]('Trying\x20SestekNDA:\x20%s',_0x5cb22a['text']));var _0x2f6330=this[_0x2e13('0x8b')]['sync'](this,_0x5cb22a);if(_0x2f6330){for(var _0x809645 in _0x2f6330){if(_0x2f6330['hasOwnProperty'](_0x809645)){this[_0x2e13('0x10')][_0x2e13('0xaf')](util[_0x2e13('0x2c')](_0x2e13('0x10a'),_0x809645[_0x2e13('0x75')]()),_0x2f6330[_0x809645]);}}this[_0x2e13('0x44')](_0x2f6330[_0x2e13('0xf9')],_0x2e13('0xfa'),_0x2e13('0x104'),'');if(_0x2f6330[_0x2e13('0x10b')]){this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x10c'),_0x2f6330[_0x2e13('0x10b')]));var _0x371a95=this[_0x2e13('0x10')][_0x2e13('0x10d')](_0x2f6330[_0x2e13('0x10b')]);try{fs[_0x2e13('0x10e')](_0x2f6330[_0x2e13('0x10b')]+'.wav');}catch(_0x3f0d5b){logger[_0x2e13('0x34')](_0x3f0d5b);}return _0x371a95;}else{return this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x10f'),_0x2f6330[_0x2e13('0xf9')]));}}return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x5cb22a,_0x2e13('0x110'));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x111')]=function(_0x2791fc){logger['info'](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x2791fc[_0x2e13('0x38')]));return this['channel']['noop']('end');};AGIVertices[_0x2e13('0x13')][_0x2e13('0x112')]=function(_0x53171c){logger['info'](util[_0x2e13('0x2c')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x53171c[_0x2e13('0x38')]));var _0x54548e='';if(_0x53171c[_0x2e13('0x113')]){if(!this['isConfigured'](_0x53171c[_0x2e13('0x113')])){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x53171c,_0x2e13('0x114'));}else{var _0x43b87c=parseInt(_0x53171c['trunk_id'],0xa);if(isNaN(_0x43b87c)){_0x54548e=_0x53171c[_0x2e13('0x113')];}else{_0x54548e=this[_0x2e13('0x1e')][_0x2e13('0x7b')](this,_0x53171c[_0x2e13('0x113')]);if(!_0x54548e){return this['channel']['error'](_0x53171c,_0x2e13('0x115'));}}}}else if(_0x53171c[_0x2e13('0x116')]){_0x54548e=_0x53171c[_0x2e13('0x116')];}else{return this['channel']['error'](_0x53171c,_0x2e13('0x114'));}var _0x72a86d=this[_0x2e13('0x10')][_0x2e13('0xb6')](_0x2e13('0xf0'),[util[_0x2e13('0x2c')](_0x2e13('0x117'),_0x54548e,_0x53171c[_0x2e13('0x4b')]),_0x53171c['timeout'],_0x53171c[_0x2e13('0xf2')],_0x53171c[_0x2e13('0x6e')]]);if(_0x72a86d[_0x2e13('0xad')]===-0x1){return _0x72a86d;}return this[_0x2e13('0x10')]['noop'](util[_0x2e13('0x2c')](_0x2e13('0xf3'),_0x2e13('0xf0')));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x118')]=function(_0x334f30){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x119'),_0x334f30[_0x2e13('0x38')]));return this[_0x2e13('0x10')][_0x2e13('0xb5')]('finally');};AGIVertices[_0x2e13('0x13')][_0x2e13('0xe')]=function(_0x81faa9){logger['info'](util[_0x2e13('0x2c')](_0x2e13('0x11a'),_0x81faa9[_0x2e13('0x38')]));if(_0x81faa9[_0x2e13('0xb0')]===0x0){return this[_0x2e13('0xb1')](_0x81faa9);}_0x81faa9[_0x2e13('0xb0')]-=0x1;if(!this[_0x2e13('0xb4')](_0x81faa9['file_id'])){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x81faa9,_0x2e13('0x11b'));}var _0x20774c=this['getSound'][_0x2e13('0x7b')](this,_0x81faa9[_0x2e13('0x11c')]);if(!_0x20774c){return this['channel']['error'](_0x81faa9,'no\x20file\x20audio\x20found');}if(!this[_0x2e13('0xb4')](_0x81faa9['variable_id'])){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x2e13('0x11d'));}var _0x41a380=this['channel'][_0x2e13('0x11e')](_0x20774c,_0x81faa9[_0x2e13('0x11f')],_0x81faa9['maxdigit']);var _0x59afe5=_0x41a380['result']?_0x41a380[_0x2e13('0xad')][_0x2e13('0x4e')]():'';logger[_0x2e13('0x2f')]('test',JSON[_0x2e13('0x7e')](_0x41a380));if(_0x41a380[_0x2e13('0xad')]===-0x1){this[_0x2e13('0x37')][_0x2e13('0x7b')](this,_0x81faa9,_0x59afe5);return _0x41a380;}else if(_0x41a380[_0x2e13('0xab')]==='timeout'){_0x41a380[_0x2e13('0xad')]=_0x59afe5[_0x2e13('0xa5')]>=parseInt(_0x81faa9[_0x2e13('0x120')])?'x':'i';}else{_0x41a380[_0x2e13('0xad')]=_0x59afe5[_0x2e13('0xa5')]>=parseInt(_0x81faa9[_0x2e13('0x120')])&&_0x59afe5[_0x2e13('0xa5')]<=parseInt(_0x81faa9['maxdigit'])?'x':'i';}var _0x15991c=this[_0x2e13('0x14')][_0x2e13('0x7b')](this,_0x81faa9['variable_id']);if(!_0x15991c){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x81faa9,_0x2e13('0x121'));}this[_0x2e13('0x10')][_0x2e13('0xaf')](_0x15991c,_0x59afe5);if(this['isConfigured'](_0x81faa9[_0x2e13('0x122')])){var _0x24aebc=parseInt(_0x81faa9[_0x2e13('0x122')],0xa);var _0x14c1f3=rs['generate']({'charset':'*','length':_0x24aebc});var _0x35207d=_0x59afe5[_0x2e13('0xa5')];if(_0x35207d>0x0){if(_0x35207d>_0x24aebc){this[_0x2e13('0x37')][_0x2e13('0x7b')](this,_0x81faa9,_0x81faa9[_0x2e13('0x123')]==='first'?_0x14c1f3+_0x59afe5[_0x2e13('0x124')](_0x24aebc):_0x59afe5[_0x2e13('0x124')](0x0,_0x35207d-_0x24aebc)+_0x14c1f3);}else{this['createSquareDetailsReport']['sync'](this,_0x81faa9,rs[_0x2e13('0x125')]({'charset':'*','length':_0x35207d}));}}else{this[_0x2e13('0x37')]['sync'](this,_0x81faa9,'');}}else{this['createSquareDetailsReport'][_0x2e13('0x7b')](this,_0x81faa9,_0x59afe5);}return _0x41a380;};AGIVertices[_0x2e13('0x13')][_0x2e13('0xf')]=function(_0xfdd93d){logger[_0x2e13('0x2f')](util['format'](_0x2e13('0x126'),_0xfdd93d[_0x2e13('0x38')]));return this[_0x2e13('0xe')](_0xfdd93d);};AGIVertices[_0x2e13('0x13')][_0x2e13('0x127')]=function(_0x31f3d8){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x128'),_0x31f3d8[_0x2e13('0x38')]));this[_0x2e13('0x37')][_0x2e13('0x7b')](this,_0x31f3d8,_0x31f3d8[_0x2e13('0x129')]);return this[_0x2e13('0x10')]['noop'](util[_0x2e13('0x2c')](_0x2e13('0x12a'),_0x31f3d8[_0x2e13('0x129')]));};AGIVertices[_0x2e13('0x13')]['awspolly']=function(_0x3b7d1d){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x12b'),_0x3b7d1d[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x3b7d1d[_0x2e13('0x93')])||!this[_0x2e13('0xb4')](_0x3b7d1d[_0x2e13('0x12c')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0x12d'));}if(!this[_0x2e13('0xb4')](_0x3b7d1d['text'])){return this['channel'][_0x2e13('0xb5')](_0x2e13('0xd2'));}this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x12e'),_0x3b7d1d[_0x2e13('0x66')]));var _0x4889a1=this['awsPolly'][_0x2e13('0x7b')](this,_0x3b7d1d);if(_0x4889a1){this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x12f'),_0x4889a1));var _0x2650fd=this['channel'][_0x2e13('0x10d')](_0x4889a1);try{fs[_0x2e13('0x10e')](_0x4889a1+'.wav');}catch(_0x3a3fab){logger[_0x2e13('0x34')](_0x3a3fab);}return _0x2650fd;}return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x3b7d1d,_0x2e13('0x130'));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x131')]=function(_0x6d5ca8){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x6d5ca8[_0x2e13('0x38')]));if(!this['isConfigured'](_0x6d5ca8['aws_access_key_id'])||!this['isConfigured'](_0x6d5ca8['aws_secret_access_key'])){return this[_0x2e13('0x10')][_0x2e13('0xb5')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x2e13('0xb4')](_0x6d5ca8[_0x2e13('0x98')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0x132'));}if(!this['isConfigured'](_0x6d5ca8['text'])){return this['channel'][_0x2e13('0xb5')](_0x2e13('0xd2'));}this[_0x2e13('0x10')][_0x2e13('0xf7')]=!![];this[_0x2e13('0x37')](_0x6d5ca8);this[_0x2e13('0x44')](_0x6d5ca8[_0x2e13('0x66')],'in','','');this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x133'),_0x6d5ca8[_0x2e13('0x66')]));var _0x2d6b8d=this[_0x2e13('0x134')]['sync'](this,_0x6d5ca8);if(_0x2d6b8d){for(var _0x2bd1c1 in _0x2d6b8d){if(_0x2d6b8d['hasOwnProperty'](_0x2bd1c1)&&_[_0x2e13('0xa1')](_0x2d6b8d[_0x2bd1c1])){this[_0x2e13('0x10')]['setVariable'](util[_0x2e13('0x2c')](_0x2e13('0x135'),_0x2bd1c1[_0x2e13('0x75')]()),_0x2d6b8d[_0x2bd1c1]);}}if(_[_0x2e13('0x48')](_0x2d6b8d[_0x2e13('0x81')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0x136'));}else{this[_0x2e13('0x44')](_0x2d6b8d[_0x2e13('0x81')],_0x2e13('0xfa'),_0x2e13('0x137'),'');return this[_0x2e13('0x10')][_0x2e13('0xb5')](util['format'](_0x2e13('0x138'),_0x2d6b8d[_0x2e13('0x81')]));}}return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x6d5ca8,_0x2e13('0x139'));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x13a')]=function(_0x1fc159){logger['info'](util[_0x2e13('0x2c')](_0x2e13('0x13b'),_0x1fc159[_0x2e13('0x38')],_0x1fc159[_0x2e13('0x70')]));if(!this[_0x2e13('0xb4')](_0x1fc159[_0x2e13('0x85')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')]('no\x20key\x20configured');}var _0x3f4e26=_0x2e13('0x13c');var _0x32232e=util[_0x2e13('0x2c')](_0x2e13('0x13d'),FILES_PATH,rs[_0x2e13('0x125')](0x4));var _0x4c5a3a=util[_0x2e13('0x2c')](_0x2e13('0xa8'),_0x32232e,_0x3f4e26);var _0x4f8adb=!![];if(_0x1fc159[_0x2e13('0x13e')]===_0x2e13('0x13f')){_0x4f8adb=![];}var _0x2784bf=this[_0x2e13('0x10')]['recordFile'](_0x32232e,_0x3f4e26,_0x1fc159[_0x2e13('0x140')],_0x1fc159[_0x2e13('0x70')],undefined,_0x4f8adb);if(_0x2784bf[_0x2e13('0xad')]!==-0x1){this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x141'),_0x4c5a3a));var _0x2a54c8=this[_0x2e13('0x99')][_0x2e13('0x7b')](this,_0x1fc159,_0x4c5a3a);if(_0x2a54c8){for(var _0x35ce0e in _0x2a54c8){if(_0x2a54c8['hasOwnProperty'](_0x35ce0e)){this['channel'][_0x2e13('0xaf')](util[_0x2e13('0x2c')](_0x2e13('0x142'),_0x35ce0e['toUpperCase']()),_0x2a54c8[_0x35ce0e]);}}return this['channel'][_0x2e13('0xb5')](util['format'](_0x2e13('0x143'),JSON[_0x2e13('0x7e')](_0x2a54c8)));}}return _0x2784bf;};AGIVertices[_0x2e13('0x13')][_0x2e13('0x144')]=function(_0x552075){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x552075['label']));if(!this[_0x2e13('0xb4')](_0x552075[_0x2e13('0x9c')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0x145'));}if(!this[_0x2e13('0xb4')](_0x552075[_0x2e13('0x9d')])){return this[_0x2e13('0x10')]['noop'](_0x2e13('0x146'));}var _0x89a6ac=_0x2e13('0x13c');var _0x5f2780=util[_0x2e13('0x2c')]('%s/recordings/%s',FILES_PATH,rs[_0x2e13('0x125')](0x4));var _0x4a9970=util[_0x2e13('0x2c')](_0x2e13('0xa8'),_0x5f2780,_0x89a6ac);var _0x34ee0c=!![];if(_0x552075[_0x2e13('0x13e')]==='NOBEEP'){_0x34ee0c=![];}var _0x37a75d=this[_0x2e13('0x10')][_0x2e13('0x147')](_0x5f2780,_0x89a6ac,_0x552075[_0x2e13('0x140')],_0x552075[_0x2e13('0x70')],undefined,_0x34ee0c);if(_0x37a75d[_0x2e13('0xad')]!==-0x1){this['channel'][_0x2e13('0xb5')](util[_0x2e13('0x2c')]('tilde\x20%s\x20file\x20created',_0x4a9970));var _0x35abef=this[_0x2e13('0x9b')]['sync'](this,_0x552075,_0x4a9970);if(_0x35abef){for(var _0x5b5c0b in _0x35abef){if(_0x35abef[_0x2e13('0xa0')](_0x5b5c0b)){this[_0x2e13('0x10')][_0x2e13('0xaf')](util[_0x2e13('0x2c')](_0x2e13('0x148'),_0x5b5c0b['toUpperCase']()),_0x35abef[_0x5b5c0b]);}}return this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x149'),JSON[_0x2e13('0x7e')](_0x35abef)));}}return _0x37a75d;};AGIVertices[_0x2e13('0x13')][_0x2e13('0x14a')]=function(_0x2a7e19){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x14b'),_0x2a7e19[_0x2e13('0x38')]));return this['channel'][_0x2e13('0x14c')](_0x2a7e19[_0x2e13('0x3e')],_0x2a7e19['extension'],_0x2a7e19[_0x2e13('0x40')]);};AGIVertices[_0x2e13('0x13')][_0x2e13('0x14d')]=function(_0x1442a8){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x14e'),_0x1442a8[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x1442a8[_0x2e13('0x14f')])){return this['channel'][_0x2e13('0x34')](_0x1442a8,_0x2e13('0x150'));}try{var _0x2aa1ab=eval(_0x1442a8[_0x2e13('0x14f')])?'true':_0x2e13('0x151');this[_0x2e13('0x10')][_0x2e13('0xb5')](util['format'](_0x2e13('0x152'),_0x1442a8[_0x2e13('0x14f')],_0x2aa1ab));return{'code':0xc8,'result':_0x2aa1ab};}catch(_0x2710e3){return{'code':0xc8,'result':_0x2e13('0x151')};}};AGIVertices[_0x2e13('0x13')][_0x2e13('0x153')]=function(_0xff70e7){logger[_0x2e13('0x2f')](util['format'](_0x2e13('0x154'),_0xff70e7[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0xff70e7[_0x2e13('0x155')])){return this['channel'][_0x2e13('0x34')](_0xff70e7,_0x2e13('0x156'));}var _0x232d38=this['getIntervals'][_0x2e13('0x7b')](this,_0xff70e7[_0x2e13('0x155')]);if(!_0x232d38){return this[_0x2e13('0x10')]['error'](_0xff70e7,_0x2e13('0x157'));}for(var _0x297a66=0x0;_0x297a66<_0x232d38[_0x2e13('0xa5')];_0x297a66+=0x1){var _0x4397c0=this['channel']['getVariable'](util['format'](_0x2e13('0x158'),_0x232d38[_0x297a66]));if(_0x4397c0['result']===-0x1){return _0x4397c0;}logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')]('IFTIME\x20%s\x20%s',_0x232d38[_0x297a66],_0x4397c0[_0x2e13('0xab')]));if(_0x4397c0[_0x2e13('0xab')]==='true'){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x159'),_0x232d38[_0x297a66],_0x2e13('0x15a')));this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x159'),_0x232d38[_0x297a66],_0x2e13('0x15a')));return{'code':0xc8,'result':'true'};}else{logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x159'),_0x232d38[_0x297a66],_0x2e13('0x151')));this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x159'),_0x232d38[_0x297a66],_0x2e13('0x151')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype']['hangup']=function(_0x3d91ce){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x15b'),_0x3d91ce[_0x2e13('0x38')]));return this[_0x2e13('0x10')][_0x2e13('0x15c')]();};AGIVertices[_0x2e13('0x13')][_0x2e13('0x15d')]=function(_0x300889){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x15e'),_0x300889[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x300889[_0x2e13('0x85')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0xf6'));}var _0x461cd0=_0x2e13('0x13c');var _0xb6ccb5=util[_0x2e13('0x2c')](_0x2e13('0x13d'),FILES_PATH,rs[_0x2e13('0x125')](0x4));var _0x3d91b4=util[_0x2e13('0x2c')]('%s.%s',_0xb6ccb5,_0x461cd0);var _0x3aefed=!![];if(_0x300889[_0x2e13('0x13e')]===_0x2e13('0x13f')){_0x3aefed=![];}var _0x26a7f8=this[_0x2e13('0x10')][_0x2e13('0x147')](_0xb6ccb5,_0x461cd0,_0x300889['intKey'],_0x300889[_0x2e13('0x70')],undefined,_0x3aefed);if(_0x26a7f8[_0x2e13('0xad')]!==-0x1){this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x15f'),_0x3d91b4));var _0x43e9cf=this[_0x2e13('0x8f')][_0x2e13('0x7b')](this,_0x300889,_0x3d91b4);if(_0x43e9cf){for(var _0x59062b in _0x43e9cf){if(_0x43e9cf[_0x2e13('0xa0')](_0x59062b)){this[_0x2e13('0x10')][_0x2e13('0xaf')](util[_0x2e13('0x2c')](_0x2e13('0x160'),_0x59062b[_0x2e13('0x75')]()),_0x43e9cf[_0x59062b]);}}return this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x161'),JSON[_0x2e13('0x7e')](_0x43e9cf)));}}return _0x26a7f8;};AGIVertices['prototype'][_0x2e13('0x162')]=function(_0x1710e4){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x163'),_0x1710e4[_0x2e13('0x38')]));if(!this['isConfigured'](_0x1710e4[_0x2e13('0x85')])){return this['channel'][_0x2e13('0xb5')](_0x2e13('0xf6'));}if(!this['isConfigured'](_0x1710e4[_0x2e13('0x66')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0xd2'));}this[_0x2e13('0x10')][_0x2e13('0xb5')](util['format'](_0x2e13('0x164'),_0x1710e4[_0x2e13('0x66')]));var _0x278a91=this[_0x2e13('0x8c')]['sync'](this,_0x1710e4);if(_0x278a91){this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x15f'),_0x278a91));var _0x50918a=this[_0x2e13('0x10')][_0x2e13('0x10d')](_0x278a91,_0x1710e4[_0x2e13('0x140')]);try{fs['unlink'](_0x278a91+_0x2e13('0x165'));}catch(_0x3aa0a4){logger['error'](_0x3aa0a4);}return _0x50918a;}return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x1710e4,_0x2e13('0x166'));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x167')]=function(_0x5ab36d){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x5ab36d['label']));if(!this['isConfigured'](_0x5ab36d[_0x2e13('0x168')])){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x5ab36d,_0x2e13('0x169'));}logger['info'](util[_0x2e13('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x2e13('0x10')][_0x2e13('0x3b')],_0x5ab36d[_0x2e13('0x168')]));var _0x50235a=this['agentLogin']['sync'](this,_0x5ab36d[_0x2e13('0x168')]);if(_0x50235a){logger['info'](util[_0x2e13('0x2c')](_0x2e13('0x16a'),this[_0x2e13('0x10')][_0x2e13('0x3b')],_0x5ab36d[_0x2e13('0x168')]));this['channel'][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x16a'),this['channel'][_0x2e13('0x3b')],_0x5ab36d[_0x2e13('0x168')]));return{'code':0xc8,'result':'success'};}else{logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x16b'),this[_0x2e13('0x10')][_0x2e13('0x3b')],_0x5ab36d[_0x2e13('0x168')]));this[_0x2e13('0x10')][_0x2e13('0xb5')](util['format'](_0x2e13('0x16b'),this['channel']['callerid'],_0x5ab36d[_0x2e13('0x168')]));return{'code':0xc8,'result':_0x2e13('0x16c')};}};AGIVertices[_0x2e13('0x13')][_0x2e13('0x16d')]=function(_0x3b6448){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x16e'),_0x3b6448['label']));if(!this[_0x2e13('0xb4')](_0x3b6448[_0x2e13('0x168')])){return this['channel'][_0x2e13('0x34')](_0x3b6448,_0x2e13('0x169'));}logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x16f'),this['channel'][_0x2e13('0x3b')],_0x3b6448[_0x2e13('0x168')]));var _0x4192fe=this[_0x2e13('0x5e')]['sync'](this,_0x3b6448[_0x2e13('0x168')]);if(_0x4192fe){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x16a'),this[_0x2e13('0x10')]['callerid'],_0x3b6448[_0x2e13('0x168')]));this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x16a'),this['channel'][_0x2e13('0x3b')],_0x3b6448[_0x2e13('0x168')]));return{'code':0xc8,'result':_0x2e13('0x170')};}else{logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x16b'),this[_0x2e13('0x10')][_0x2e13('0x3b')],_0x3b6448['findBy']));this['channel']['noop'](util['format'](_0x2e13('0x16b'),this[_0x2e13('0x10')]['callerid'],_0x3b6448[_0x2e13('0x168')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x2e13('0x13')][_0x2e13('0x171')]=function(_0x3092dc){logger[_0x2e13('0x2f')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3092dc['label']));if(!this['isConfigured'](_0x3092dc[_0x2e13('0x172')])){return this['channel']['error'](_0x3092dc,_0x2e13('0x173'));}this[_0x2e13('0x10')]['noop'](util[_0x2e13('0x2c')](_0x2e13('0x174'),_0x3092dc['operation']));var _0x293b7a=eval(_0x3092dc[_0x2e13('0x172')]);if(!this[_0x2e13('0xb4')](_0x3092dc[_0x2e13('0xe5')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0x11d'));}var _0xf21e24=this['getVariable'][_0x2e13('0x7b')](this,_0x3092dc[_0x2e13('0xe5')]);if(!_0xf21e24){return this[_0x2e13('0x10')]['error'](_0x3092dc,_0x2e13('0x121'));}if(_[_0x2e13('0xa4')](_0x293b7a)){var _0x4ded5a=this;_0x293b7a[_0x2e13('0xe6')](function(_0xf938ae,_0x371b3e){_0x4ded5a[_0x2e13('0x10')][_0x2e13('0xaf')](util[_0x2e13('0x2c')](_0x2e13('0x175'),_0xf21e24,_0x371b3e),_0xf938ae);});return this[_0x2e13('0x10')]['noop'](util['format'](_0x2e13('0x176'),_0xf21e24));}else{return this[_0x2e13('0x10')][_0x2e13('0xaf')](_0xf21e24,_0x293b7a);}};AGIVertices['prototype'][_0x2e13('0xd')]=function(_0x443c2d){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x177'),_0x443c2d[_0x2e13('0x38')]));if(_0x443c2d[_0x2e13('0xb0')]===0x0){return this[_0x2e13('0xb1')](_0x443c2d);}_0x443c2d[_0x2e13('0xb0')]-=0x1;if(!this[_0x2e13('0xb4')](_0x443c2d[_0x2e13('0x11c')])){return this[_0x2e13('0x10')]['error'](_0x443c2d,_0x2e13('0x11b'));}var _0x20b7ea=this[_0x2e13('0x178')][_0x2e13('0x7b')](this,_0x443c2d[_0x2e13('0x11c')]);if(!_0x20b7ea){return this['channel'][_0x2e13('0x34')](_0x443c2d,_0x2e13('0x179'));}var _0x25b80c=this['channel']['getData'](_0x20b7ea,_0x443c2d[_0x2e13('0x11f')],_0x443c2d[_0x2e13('0x17a')]);var _0x44b88d=_0x25b80c[_0x2e13('0xad')];if(_0x25b80c[_0x2e13('0xad')]===-0x1){this['createSquareDetailsReport'][_0x2e13('0x7b')](this,_0x443c2d,'-1');return _0x25b80c;}else if(_0x25b80c[_0x2e13('0xab')]===_0x2e13('0x70')){_0x25b80c[_0x2e13('0xad')]=_0x25b80c[_0x2e13('0xad')][_0x2e13('0xa5')]>0x0?_0x25b80c['result']:'t';}else if(_[_0x2e13('0x47')](_0x25b80c[_0x2e13('0xad')])){_0x25b80c[_0x2e13('0xad')]='#';_0x44b88d='#';}if(!this[_0x2e13('0xb4')](_0x443c2d[_0x2e13('0xe5')])){this[_0x2e13('0x10')]['noop'](_0x2e13('0x11d'));}else{var _0x13adff=this[_0x2e13('0x14')][_0x2e13('0x7b')](this,_0x443c2d[_0x2e13('0xe5')]);if(!_0x13adff){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x443c2d,_0x2e13('0x121'));}this['channel'][_0x2e13('0xaf')](_0x13adff,_0x44b88d);}this[_0x2e13('0x37')][_0x2e13('0x7b')](this,_0x443c2d,_0x44b88d);return _0x25b80c;};AGIVertices[_0x2e13('0x13')][_0x2e13('0xb5')]=function(_0x52d146){logger[_0x2e13('0x2f')](util['format'](_0x2e13('0x17b'),_0x52d146[_0x2e13('0x38')]));return this[_0x2e13('0x10')]['noop'](_0x52d146[_0x2e13('0x17c')]||_0x52d146[_0x2e13('0x38')]);};AGIVertices[_0x2e13('0x13')][_0x2e13('0x17d')]=function(_0x4dfe44){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x4dfe44['label']));if(!this[_0x2e13('0xb4')](_0x4dfe44[_0x2e13('0x168')])){return this['channel'][_0x2e13('0x34')](_0x4dfe44,'no\x20find\x20by\x20configured');}logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x2e13('0x3b')],_0x4dfe44[_0x2e13('0x168')]));var _0x521906=this[_0x2e13('0x59')]['sync'](this,_0x4dfe44[_0x2e13('0x17e')]);var _0x3fb596=this[_0x2e13('0x5b')]['sync'](this,_0x4dfe44[_0x2e13('0x168')],_0x521906);if(_0x3fb596){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x16a'),this['channel']['callerid'],_0x4dfe44[_0x2e13('0x168')]));this[_0x2e13('0x10')][_0x2e13('0xb5')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x2e13('0x10')]['callerid'],_0x4dfe44[_0x2e13('0x168')]));return{'code':0xc8,'result':_0x2e13('0x170')};}else{logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x16b'),this['channel'][_0x2e13('0x3b')],_0x4dfe44[_0x2e13('0x168')]));this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x16a'),this[_0x2e13('0x10')][_0x2e13('0x3b')],_0x4dfe44[_0x2e13('0x168')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x2e13('0x13')][_0x2e13('0x17f')]=function(_0x160ae7){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x160ae7['label']));if(!this[_0x2e13('0xb4')](_0x160ae7[_0x2e13('0x11c')])){return this[_0x2e13('0x10')]['error'](_0x160ae7,_0x2e13('0x11b'));}var _0x25f1b4=this[_0x2e13('0x178')][_0x2e13('0x7b')](this,_0x160ae7[_0x2e13('0x11c')]);if(!_0x25f1b4){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x160ae7,_0x2e13('0x179'));}var _0x38b695=this[_0x2e13('0x10')][_0x2e13('0xb6')](_0x2e13('0x180'),[_0x25f1b4,_0x160ae7[_0x2e13('0xf2')]]);if(_0x38b695[_0x2e13('0xad')]===-0x1){return _0x38b695;}return this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0xcf'),_0x2e13('0x180'),_0x25f1b4));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x181')]=function(_0x4fc884){logger[_0x2e13('0x2f')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4fc884['label']));if(!this[_0x2e13('0xb4')](_0x4fc884[_0x2e13('0x182')])){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x4fc884,_0x2e13('0x183'));}var _0x3fd65a='';var _0x23f598=parseInt(_0x4fc884[_0x2e13('0x182')],0xa);if(isNaN(_0x23f598)){_0x3fd65a=_0x4fc884['queue_id'];}else{_0x3fd65a=this[_0x2e13('0x184')][_0x2e13('0x7b')](this,_0x4fc884[_0x2e13('0x182')]);if(!_0x3fd65a){return this[_0x2e13('0x10')]['error'](_0x4fc884,'no\x20queue\x20found');}}var _0x44a756='';if(this[_0x2e13('0xb4')](_0x4fc884['file_id'])){var _0x2e304f=this[_0x2e13('0x178')][_0x2e13('0x7b')](this,_0x4fc884[_0x2e13('0x11c')]);if(_0x2e304f){_0x44a756=_0x2e304f;}}this[_0x2e13('0x37')][_0x2e13('0x7b')](this,_0x4fc884,_0x3fd65a);if(_0x4fc884[_0x2e13('0xf2')][_0x2e13('0x185')]('x')<0x0){_0x4fc884[_0x2e13('0xf2')]+='x';}if(_0x4fc884[_0x2e13('0xf2')][_0x2e13('0x185')]('X')<0x0){_0x4fc884[_0x2e13('0xf2')]+='X';}this[_0x2e13('0x10')]['setVariable'](_0x2e13('0x186'),_0x3fd65a?_0x3fd65a[_0x2e13('0x187')]():'');var _0x322b27=this['channel']['exec'](_0x2e13('0x188'),[_0x3fd65a,_0x4fc884[_0x2e13('0xf2')],_0x4fc884[_0x2e13('0x6e')],_0x44a756,_0x4fc884[_0x2e13('0x70')],_0x4fc884[_0x2e13('0xc4')],_0x4fc884[_0x2e13('0x189')],_0x4fc884[_0x2e13('0x18a')],'',_0x4fc884['position']]);if(_0x322b27['result']===-0x1){return _0x322b27;}return this['channel'][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0xcf'),_0x2e13('0x188'),_0x3fd65a));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x18b')]=function(_0x5ceeb3){logger['info'](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x5ceeb3[_0x2e13('0x38')]));var _0x305898=_0x5ceeb3[_0x2e13('0x18c')]||_0x2e13('0x13c');var _0x423e49=util[_0x2e13('0x2c')](_0x2e13('0x18d'),this[_0x2e13('0x10')][_0x2e13('0x45')],rs[_0x2e13('0x125')](0x5));var _0x248534=util[_0x2e13('0x2c')](_0x2e13('0x18e'),FILES_PATH,_0x423e49,_0x305898);var _0xfb38ee=util[_0x2e13('0x2c')](_0x2e13('0x13d'),FILES_PATH,_0x423e49);this[_0x2e13('0x3c')][_0x2e13('0x7b')](this,_0x5ceeb3,_0x423e49,_0x248534);this[_0x2e13('0x10')][_0x2e13('0xaf')](_0x2e13('0x18f'),_0x423e49);logger['info'](_0x2e13('0x190'),_0xfb38ee,_0x305898,_0x5ceeb3[_0x2e13('0x191')],_0x5ceeb3[_0x2e13('0x70')]);return this[_0x2e13('0x10')][_0x2e13('0x147')](_0xfb38ee,_0x305898,_0x5ceeb3[_0x2e13('0x191')],_0x5ceeb3[_0x2e13('0x70')],undefined,!![]);};AGIVertices[_0x2e13('0x13')]['restapi']=function(_0x4ed8ce){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x192'),_0x4ed8ce[_0x2e13('0x38')]));if(!this['isConfigured'](_0x4ed8ce['url'])){return this['channel']['noop'](_0x2e13('0x193'));}var _0x4ee266=this[_0x2e13('0x6d')][_0x2e13('0x7b')](this,_0x4ed8ce);logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x194'),util[_0x2e13('0x195')](_0x4ee266,{'showHidden':![],'depth':null})));if(!this[_0x2e13('0xb4')](_0x4ed8ce[_0x2e13('0xe5')])){return this['channel']['noop'](_0x2e13('0x196'));}var _0x5213cd=this[_0x2e13('0x14')][_0x2e13('0x7b')](this,_0x4ed8ce[_0x2e13('0xe5')]);if(!_0x5213cd){return this['channel'][_0x2e13('0x34')](_0x4ed8ce,_0x2e13('0x121'));}this[_0x2e13('0x10')][_0x2e13('0xaf')](util[_0x2e13('0x2c')]('%s_STATUS_CODE',_0x5213cd),_0x4ee266[_0x2e13('0x80')]?_0x4ee266[_0x2e13('0x80')]:_0x2e13('0x197'));this['channel']['setVariable'](util[_0x2e13('0x2c')](_0x2e13('0x198'),_0x5213cd),_0x4ee266['statusMessage']?_0x4ee266[_0x2e13('0x7f')]:'OK');if(_0x4ee266['body']){try{this[_0x2e13('0xa6')](_0x4ee266[_0x2e13('0x76')],_0x5213cd);}catch(_0xe47250){logger[_0x2e13('0x34')](util['format'](_0x2e13('0x199'),_0x5213cd));}}return this['channel'][_0x2e13('0xb5')](util['format']('variable\x20%s\x20set',_0x5213cd));};AGIVertices['prototype'][_0x2e13('0x19a')]=function(_0x876413){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x876413[_0x2e13('0x38')]));return this['channel'][_0x2e13('0x19b')](_0x876413[_0x2e13('0x19c')][_0x2e13('0xe3')](/\s+/g,''),_0x876413[_0x2e13('0x191')]);};AGIVertices[_0x2e13('0x13')][_0x2e13('0x19d')]=function(_0x22ccd1){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x19e'),_0x22ccd1[_0x2e13('0x38')]));return this[_0x2e13('0x10')][_0x2e13('0x19f')](_0x22ccd1[_0x2e13('0x71')][_0x2e13('0xe3')](/\s+/g,''),_0x22ccd1[_0x2e13('0x191')]);};AGIVertices[_0x2e13('0x13')][_0x2e13('0x1a0')]=function(_0x6d3e80){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x6d3e80[_0x2e13('0x38')]));return this[_0x2e13('0x10')][_0x2e13('0x1a1')](_0x6d3e80['text'],_0x6d3e80[_0x2e13('0x191')]);};AGIVertices[_0x2e13('0x13')][_0x2e13('0x1a2')]=function(_0x21f10c){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x1a3'),_0x21f10c['label']));if(!this[_0x2e13('0xb4')](_0x21f10c['account_id'])){return this['channel'][_0x2e13('0xb5')](_0x2e13('0x1a4'));}var _0x68fd03=this['getMailAccount']['sync'](this,_0x21f10c['account_id']);if(!_0x68fd03||!_0x68fd03[_0x2e13('0x1a5')]){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x21f10c,'no\x20mail\x20account\x20found');}var _0x5780be={'from':util[_0x2e13('0x2c')](_0x2e13('0x1a6'),_0x68fd03[_0x2e13('0x17')],_0x68fd03[_0x2e13('0x1a7')]||_0x68fd03['Smtp'][_0x2e13('0x1a8')]),'to':_0x21f10c['to']||'','cc':_0x21f10c['cc']||'','bcc':_0x21f10c['bcc']||'','subject':_0x21f10c['subject'],'html':_0x21f10c[_0x2e13('0x66')],'text':_0x21f10c[_0x2e13('0x66')]};var _0x2e8e30={'tls':{'rejectUnauthorized':![]}};if(_0x68fd03['Smtp'][_0x2e13('0x1a9')]){_0x2e8e30[_0x2e13('0x1a9')]=_0x68fd03[_0x2e13('0x1a5')][_0x2e13('0x1a9')];}else{_0x2e8e30[_0x2e13('0x1aa')]=_0x68fd03[_0x2e13('0x1a5')][_0x2e13('0x1aa')];_0x2e8e30[_0x2e13('0x1ab')]=_0x68fd03[_0x2e13('0x1a5')][_0x2e13('0x1ab')];_0x2e8e30['secure']=_0x68fd03[_0x2e13('0x1a5')][_0x2e13('0x1ac')];}if(_0x68fd03[_0x2e13('0x1a5')]['authentication']){_0x2e8e30[_0x2e13('0x1ad')]={'user':_0x68fd03[_0x2e13('0x1a5')][_0x2e13('0x1a8')],'pass':_0x68fd03[_0x2e13('0x1a5')][_0x2e13('0x1ae')]};}if(this[_0x2e13('0xb4')](_0x21f10c[_0x2e13('0x1af')])){}logger[_0x2e13('0xeb')](_0x2e13('0x1b0'),JSON[_0x2e13('0x7e')](_0x5780be));this[_0x2e13('0x37')]['sync'](this,_0x21f10c,_0x21f10c[_0x2e13('0x1b1')]);this['channel'][_0x2e13('0xb5')](util[_0x2e13('0x2c')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x68fd03[_0x2e13('0x17')]));this[_0x2e13('0x25')][_0x2e13('0x7b')](this,_0x2e8e30,_0x5780be);return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0x1b2'));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x1b3')]=function(_0x2cc208){logger[_0x2e13('0x2f')](util['format'](_0x2e13('0x1b4'),_0x2cc208[_0x2e13('0x38')]));return this[_0x2e13('0x10')][_0x2e13('0xb5')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x2e13('0x13')][_0x2e13('0x1b5')]=function(_0x5c72ed){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x1b6'),_0x5c72ed[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x5c72ed[_0x2e13('0x1b7')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0x1b8'));}var _0x4e437a=this[_0x2e13('0x35')][_0x2e13('0x7b')](this,_0x5c72ed[_0x2e13('0x1b7')]);if(!_0x4e437a){return this['channel'][_0x2e13('0x34')](_0x5c72ed,_0x2e13('0x1b9'));}var _0x344c56={'body':_0x5c72ed[_0x2e13('0x1ba')],'phone':_0x5c72ed['to']||'','SmsAccountId':_0x4e437a['id']};logger['debug'](_0x2e13('0x1bb'),JSON[_0x2e13('0x7e')](_0x344c56));this['createSquareDetailsReport'][_0x2e13('0x7b')](this,_0x5c72ed,_0x5c72ed[_0x2e13('0x1b7')]);this['channel'][_0x2e13('0xb5')](util['format'](_0x2e13('0x1bc'),_0x4e437a['name']));this[_0x2e13('0x36')]['sync'](this,_0x344c56);return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0x1bd'));};AGIVertices[_0x2e13('0x13')]['set']=function(_0x134047){logger[_0x2e13('0x2f')](util['format'](_0x2e13('0x1be'),_0x134047[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x134047[_0x2e13('0xe5')])){return this[_0x2e13('0x10')]['error'](_0x134047,'no\x20variable\x20selected');}var _0x22e0c4=this[_0x2e13('0x14')][_0x2e13('0x7b')](this,_0x134047[_0x2e13('0xe5')]);if(!_0x22e0c4){return this[_0x2e13('0x10')]['error'](_0x134047,_0x2e13('0x121'));}return this[_0x2e13('0x10')]['setVariable'](_0x22e0c4,_0x134047['variable_value']);};AGIVertices[_0x2e13('0x13')][_0x2e13('0x1bf')]=function(_0x32517f){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x1c0'),_0x32517f['label']));this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0x1c1'));if(_0x32517f[_0x2e13('0x1c2')]==='yes'){this['channel'][_0x2e13('0xb5')]('Answer');return this['channel'][_0x2e13('0x1c2')]();}return this['channel']['noop'](_0x2e13('0x1c3'));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x1c4')]=function(_0x3795d2){logger[_0x2e13('0x2f')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x3795d2[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x3795d2[_0x2e13('0x1c5')])){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x3795d2,_0x2e13('0x1c6'));}var _0x1368c2=this['getSquareProject']['sync'](this,_0x3795d2[_0x2e13('0x1c5')]);if(!this[_0x2e13('0xb4')](_0x1368c2)){return this['channel'][_0x2e13('0x34')](_0x3795d2,util['format'](_0x2e13('0x1c7'),_0x3795d2[_0x2e13('0x1c5')]));}if(_0x1368c2===this[_0x2e13('0x10')][_0x2e13('0x3a')]){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x3795d2,_0x2e13('0x1c8'));}this[_0x2e13('0x37')]['sync'](this,_0x3795d2,_0x1368c2);var _0x371fcf=this[_0x2e13('0x10')][_0x2e13('0xb6')](_0x2e13('0x1c9'),util[_0x2e13('0x2c')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x2e13('0xc4')][_0x2e13('0x1aa')]||'127.0.0.1',_0x1368c2,this[_0x2e13('0x10')][_0x2e13('0x3a')]));if(_0x371fcf[_0x2e13('0xad')]===-0x1){return _0x371fcf;}return this[_0x2e13('0x10')][_0x2e13('0xb5')](util['format']('Executed\x20command\x20%s\x20%s',_0x2e13('0x1c9'),_0x1368c2));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x1ca')]=function(_0x42df86){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x1cb'),_0x42df86[_0x2e13('0x38')]));var _0x1a1498=this[_0x2e13('0x1cc')][_0x2e13('0x7b')](this,_0x42df86[_0x2e13('0xc6')]);this[_0x2e13('0x37')]['sync'](this,_0x42df86,_0x42df86['command']);if(this[_0x2e13('0xb4')](_0x42df86[_0x2e13('0xe5')])){var _0x433d84=this[_0x2e13('0x14')][_0x2e13('0x7b')](this,_0x42df86['variable_id']);if(_0x433d84){this[_0x2e13('0x10')][_0x2e13('0xaf')](_0x433d84,_0x1a1498);return this['channel'][_0x2e13('0xb5')](util[_0x2e13('0x2c')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x42df86[_0x2e13('0xc6')],_0x433d84));}}return this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x1cd'),_0x42df86[_0x2e13('0xc6')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0x4118f2){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x1ce'),_0x4118f2[_0x2e13('0x38')]));_0x4118f2['text']=_0x4118f2[_0x2e13('0x66')][_0x2e13('0xe3')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x2e13('0xb4')](_0x4118f2[_0x2e13('0x64')])){return this['channel'][_0x2e13('0xb5')](_0x2e13('0x1cf'));}if(!this['isConfigured'](_0x4118f2[_0x2e13('0x66')])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0xd2'));}this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x1d0'),_0x4118f2[_0x2e13('0x66')]));var _0x2aa4fe=this[_0x2e13('0x63')][_0x2e13('0x7b')](this,_0x4118f2);if(_0x2aa4fe){this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')](_0x2e13('0x1d1'),_0x2aa4fe));var _0x2db056=this[_0x2e13('0x10')][_0x2e13('0x10d')](_0x2aa4fe);try{fs[_0x2e13('0x10e')](_0x2aa4fe+_0x2e13('0x165'));}catch(_0x85f3b3){logger['error'](_0x85f3b3);}return _0x2db056;}return this['channel'][_0x2e13('0x34')](_0x4118f2,_0x2e13('0x1d2'));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x1d3')]=function(_0x4fa8f9){logger['info'](util['format'](_0x2e13('0x1d4'),_0x4fa8f9['label']));_0x4fa8f9[_0x2e13('0x66')]=_0x4fa8f9[_0x2e13('0x66')][_0x2e13('0xe3')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x2e13('0xb4')](_0x4fa8f9['text'])){return this[_0x2e13('0x10')][_0x2e13('0xb5')](_0x2e13('0xd2'));}this[_0x2e13('0x10')]['noop'](util[_0x2e13('0x2c')](_0x2e13('0x1d5'),_0x4fa8f9[_0x2e13('0x66')]));var _0x50e195=this['googleTTS'][_0x2e13('0x7b')](this,_0x4fa8f9);if(_0x50e195){this[_0x2e13('0x10')][_0x2e13('0xb5')](util[_0x2e13('0x2c')]('Google\x20TTS\x20%s\x20file\x20created',_0x50e195));var _0x3419cd=this[_0x2e13('0x10')][_0x2e13('0x10d')](_0x50e195);try{fs[_0x2e13('0x10e')](_0x50e195+_0x2e13('0x165'));}catch(_0x184824){logger[_0x2e13('0x34')](_0x184824);}return _0x3419cd;}return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x4fa8f9,_0x2e13('0x1d6'));};AGIVertices['prototype']['unpause']=function(_0x562f8d){logger[_0x2e13('0x2f')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x562f8d[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x562f8d[_0x2e13('0x168')])){return this['channel'][_0x2e13('0x34')](_0x562f8d,_0x2e13('0x169'));}logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')](_0x2e13('0x16f'),this[_0x2e13('0x10')][_0x2e13('0x3b')],_0x562f8d[_0x2e13('0x168')]));var _0x26fa1b=this[_0x2e13('0x5d')]['sync'](this,_0x562f8d[_0x2e13('0x168')]);if(_0x26fa1b){logger[_0x2e13('0x2f')](util[_0x2e13('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2e13('0x10')][_0x2e13('0x3b')],_0x562f8d[_0x2e13('0x168')]));this[_0x2e13('0x10')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x2e13('0x3b')],_0x562f8d[_0x2e13('0x168')]));return{'code':0xc8,'result':_0x2e13('0x170')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x2e13('0x10')][_0x2e13('0x3b')],_0x562f8d[_0x2e13('0x168')]));this[_0x2e13('0x10')][_0x2e13('0xb5')](util['format'](_0x2e13('0x16b'),this[_0x2e13('0x10')]['callerid'],_0x562f8d['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x2e13('0x13')][_0x2e13('0x1d7')]=function(_0x418f86){logger['info'](util[_0x2e13('0x2c')](_0x2e13('0x1d8'),_0x418f86[_0x2e13('0x38')]));var _0x58d22a=this['channel'][_0x2e13('0xb6')](_0x2e13('0x1d9'),[_0x418f86[_0x2e13('0x1da')],_0x418f86['options']]);if(_0x58d22a[_0x2e13('0xad')]===-0x1){return _0x58d22a;}return this[_0x2e13('0x10')]['noop'](util[_0x2e13('0x2c')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x418f86['mailbox']));};AGIVertices[_0x2e13('0x13')][_0x2e13('0x1db')]=function(_0x2edbca){logger['info'](util[_0x2e13('0x2c')](_0x2e13('0x1dc'),_0x2edbca[_0x2e13('0x38')]));if(!this[_0x2e13('0xb4')](_0x2edbca[_0x2e13('0xe5')])){return this[_0x2e13('0x10')][_0x2e13('0x34')](_0x2edbca,'no\x20variable\x20selected');}var _0x1771bc=this[_0x2e13('0x14')][_0x2e13('0x7b')](this,_0x2edbca[_0x2e13('0xe5')]);if(!_0x1771bc){return this[_0x2e13('0x10')]['error'](_0x2edbca,_0x2e13('0x121'));}var _0x55c288=this[_0x2e13('0x10')]['getVariable'](_0x1771bc);return{'code':0xc8,'result':_0x55c288[_0x2e13('0xab')]?_0x55c288[_0x2e13('0xab')]:'-'};};String[_0x2e13('0x13')]['replaceAll']=function(_0x351caf,_0x4f102e){return this['split'](_0x351caf)[_0x2e13('0x1dd')](_0x4f102e);};module['exports']=AGIVertices; \ No newline at end of file +var _0xb7a8=['no\x20project_id\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','Executed\x20command\x20%s','finally','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','toString','test','mindigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','wav','%s/recordings/%s','generate','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','beep','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','recordFile','restapi','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','\x22%s\x22\x20<%s>','email','Smtp','subject','service','host','port','secure','authentication','auth','user','pass','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','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','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','util','lodash','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','then','name','catch','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getTrunk','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','getSoundPath','format','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','file','createCmContact','callback_','random','isEmpty','lastName','isNil','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','has','dialTimezone','getContactByPhone','timezones','utcOffset','scheduledat','add','minutes','insertContact','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','toUpperCase','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','dialogflow_language','googleDialogflowV2','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','key','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','agicommand','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','split','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','extra','maxRetry','createSquareDetailsReport','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','createSquareMessage','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block'];(function(_0x4e6e53,_0x57dd51){var _0x128755=function(_0x5034bd){while(--_0x5034bd){_0x4e6e53['push'](_0x4e6e53['shift']());}};_0x128755(++_0x57dd51);}(_0xb7a8,0xec));var _0x8b7a=function(_0x9999c1,_0x5ad5de){_0x9999c1=_0x9999c1-0x0;var _0x2f4ec1=_0xb7a8[_0x9999c1];return _0x2f4ec1;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x8b7a('0x0'));var _=require(_0x8b7a('0x1'));var sh=require('shelljs');var odbc=require(_0x8b7a('0x2'))();var rs=require(_0x8b7a('0x3'));var moment=require(_0x8b7a('0x4'));var Mustache=require('mustache');var rp=require(_0x8b7a('0x5'));var logger=require(_0x8b7a('0x6'))(_0x8b7a('0x7'));var config=require(_0x8b7a('0x8'));var shared=require(_0x8b7a('0x9'));var scripts=require(_0x8b7a('0xa'));var FILES_PATH=_0x8b7a('0xb');var recursiveMapAttributes=[_0x8b7a('0xc'),_0x8b7a('0xd')];var verticesWithRetry=[_0x8b7a('0xe'),_0x8b7a('0xf'),_0x8b7a('0x10')];var AGIVertices=function(_0x517818,_0x138031,_0x55f130){this[_0x8b7a('0x11')]=_0x517818;this[_0x8b7a('0x12')]=_0x138031;this['mailRpc']=_0x55f130;};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x14')]=function(_0x41b541,_0x5ccf33){this[_0x8b7a('0x12')]['getVariableById'](_0x41b541)[_0x8b7a('0x15')](function(_0xec9743){_0x5ccf33(null,_0xec9743?_0xec9743[_0x8b7a('0x16')]:![]);})[_0x8b7a('0x17')](function(_0x58a968){_0x5ccf33(_0x58a968);});};AGIVertices[_0x8b7a('0x13')]['getVoiceQueue']=function(_0x39c91f,_0x1ca7fd){this[_0x8b7a('0x12')]['getVoiceQueueById'](_0x39c91f)['then'](function(_0x570134){_0x1ca7fd(null,_0x570134?_0x570134[_0x8b7a('0x16')]:![]);})['catch'](function(_0xf8214a){_0x1ca7fd(_0xf8214a);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x18')]=function(_0x21a0be,_0x326fd6){this['rpc'][_0x8b7a('0x19')](_0x21a0be)[_0x8b7a('0x15')](function(_0x64ee0f){_0x326fd6(null,_0x64ee0f?_0x64ee0f['name']:![]);})[_0x8b7a('0x17')](function(_0x400f0e){_0x326fd6(_0x400f0e);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x54e05b,_0x163466){this[_0x8b7a('0x12')][_0x8b7a('0x1a')](_0x54e05b)[_0x8b7a('0x15')](function(_0x14f4bb){_0x163466(null,_0x14f4bb?_0x14f4bb[_0x8b7a('0x1b')]:![]);})[_0x8b7a('0x17')](function(_0x479ecd){_0x163466(_0x479ecd);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x1c')]=function(_0x97dbe0,_0x31780){this[_0x8b7a('0x12')]['getUserById'](_0x97dbe0)[_0x8b7a('0x15')](function(_0x3b154d){_0x31780(null,_0x3b154d?_0x3b154d[_0x8b7a('0x16')]:![]);})[_0x8b7a('0x17')](function(_0x114a09){_0x31780(_0x114a09);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x1d')]=function(_0x7d295e,_0x56ac1b){this[_0x8b7a('0x12')]['getTrunkById'](_0x7d295e)[_0x8b7a('0x15')](function(_0x21d759){_0x56ac1b(null,_0x21d759?_0x21d759['name']:![]);})[_0x8b7a('0x17')](function(_0x111a2e){_0x56ac1b(_0x111a2e);});};AGIVertices['prototype']['getSound']=function(_0x42710c,_0xfb45bd){var _0x246ce3=this;this[_0x8b7a('0x12')][_0x8b7a('0x1e')](_0x42710c)[_0x8b7a('0x15')](function(_0x2bdd4d){_0xfb45bd(null,_0x2bdd4d?_0x246ce3['getSoundPath'](_0x2bdd4d[_0x8b7a('0x1f')]):![]);})[_0x8b7a('0x17')](function(_0x1706eb){_0xfb45bd(_0x1706eb);});};AGIVertices['prototype'][_0x8b7a('0x20')]=function(_0x3509c3,_0x42c98e){this['rpc'][_0x8b7a('0x21')](_0x3509c3)[_0x8b7a('0x15')](function(_0x5ea0e){_0x42c98e(null,_0x5ea0e?_0x5ea0e:![]);})['catch'](function(_0x17788c){_0x42c98e(_0x17788c);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x22')]=function(_0x2890f7,_0x554bcb,_0x332253){this[_0x8b7a('0x23')]['sendMailMessage'](_0x2890f7,_0x554bcb)[_0x8b7a('0x15')](function(){_0x332253(null);})[_0x8b7a('0x17')](function(_0xe89038){_0x332253(_0xe89038);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x24')]=function(_0x79d063,_0x3c1089){this[_0x8b7a('0x12')][_0x8b7a('0x25')](_0x79d063)[_0x8b7a('0x15')](function(_0x562882){if(_0x562882){if(_0x562882[_0x8b7a('0x26')]){_0x3c1089(null,[_0x562882['interval']]);}else{_0x3c1089(null,_[_0x8b7a('0x27')](_0x562882[_0x8b7a('0x28')],_0x8b7a('0x29')));}}else{_0x3c1089(null,![]);}})['catch'](function(_0x21047a){_0x3c1089(_0x21047a);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x2a')]=function(_0x48dcb9){return util[_0x8b7a('0x2b')]('%s/sounds/converted/%s',FILES_PATH,_0x48dcb9);};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x2c')]=function(_0x58c28b,_0x2c22a4,_0x37e62e){odbc['open'](_0x58c28b,function(_0x45c5b4){if(_0x45c5b4){logger[_0x8b7a('0x2d')](_0x8b7a('0x2e'),_0x45c5b4);_0x37e62e(_0x45c5b4);}else{logger['info'](_0x8b7a('0x2f'));odbc['query'](_0x2c22a4,function(_0x1d0d3a,_0x228b12){if(_0x1d0d3a){logger[_0x8b7a('0x30')](_0x8b7a('0x31'),_0x2c22a4);_0x37e62e(_0x1d0d3a);}else{logger[_0x8b7a('0x30')](_0x8b7a('0x32'),_0x2c22a4);odbc[_0x8b7a('0x33')](function(_0x4bc521){if(_0x4bc521){logger[_0x8b7a('0x2d')](_0x8b7a('0x34'),_0x4bc521);}_0x37e62e(null,_0x228b12);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x55bac7,_0x2f6fa1){this['rpc'][_0x8b7a('0x35')](_0x55bac7)[_0x8b7a('0x15')](function(_0x424c3c){_0x2f6fa1(null,_0x424c3c?_0x424c3c:![]);})[_0x8b7a('0x17')](function(_0x556bc6){_0x2f6fa1(_0x556bc6);});};AGIVertices[_0x8b7a('0x13')]['createSmsMessage']=function(_0x272dd1,_0x211023){this['rpc']['createSmsMessage'](_0x272dd1)[_0x8b7a('0x15')](function(_0x3ed487){_0x211023(null,_0x3ed487);})[_0x8b7a('0x17')](function(_0x396d13){_0x211023(_0x396d13);});};AGIVertices[_0x8b7a('0x13')]['createSquareDetailsReport']=function(_0x4b5d7c,_0x3e1752,_0x1ee59e){this[_0x8b7a('0x12')]['createSquareDetailsReport']({'uniqueid':this[_0x8b7a('0x11')][_0x8b7a('0x36')],'node':_0x4b5d7c[_0x8b7a('0x37')],'application':_0x4b5d7c['agicommand'],'data':_0x3e1752||null,'project_name':this['channel'][_0x8b7a('0x38')],'callerid':this[_0x8b7a('0x11')][_0x8b7a('0x39')]})['then'](function(_0x37954f){if(_0x1ee59e){_0x1ee59e(null,_0x37954f);}})['catch'](function(_0x1186fb){if(_0x1ee59e){_0x1ee59e(_0x1186fb);}});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x3a')]=function(_0x3c6ed8,_0x2e0f8a,_0x104be4,_0x540b03){this[_0x8b7a('0x12')][_0x8b7a('0x3a')]({'uniqueid':this['channel'][_0x8b7a('0x36')],'callerid':this['channel'][_0x8b7a('0x39')],'calleridname':this[_0x8b7a('0x11')][_0x8b7a('0x3b')],'context':this['channel'][_0x8b7a('0x3c')],'extension':this[_0x8b7a('0x11')][_0x8b7a('0x3d')],'priority':this[_0x8b7a('0x11')][_0x8b7a('0x3e')],'accountcode':this[_0x8b7a('0x11')]['accountcode'],'dnid':this[_0x8b7a('0x11')]['dnid'],'projectName':this[_0x8b7a('0x11')][_0x8b7a('0x38')],'saveName':_0x2e0f8a,'filename':_0x3c6ed8[_0x8b7a('0x3f')]||_0x2e0f8a,'savePath':_0x104be4})[_0x8b7a('0x15')](function(_0x4607d1){_0x540b03(null,_0x4607d1);})[_0x8b7a('0x17')](function(_0x4184a0){_0x540b03(_0x4184a0);});};AGIVertices[_0x8b7a('0x13')]['createSquareMessage']=function(_0x12144a,_0x503b4f,_0x6b2118,_0x3070d3,_0x453bd5){this['rpc']['createSquareMessage']({'uniqueid':this[_0x8b7a('0x11')][_0x8b7a('0x36')],'body':_0x12144a,'direction':_0x503b4f,'providerName':_0x6b2118,'providerResponse':_0x3070d3})[_0x8b7a('0x15')](function(_0xcc01f5){if(_0x453bd5){_0x453bd5(null,_0xcc01f5);}})[_0x8b7a('0x17')](function(_0x51332f){if(_0x453bd5){_0x453bd5(_0x51332f);}});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x40')]=function(_0x26b6d1,_0x472fc3){var _0x2853f3=this;var _0x15b4ee=0x0;var _0x5d8624={'firstName':_['isEmpty'](_0x26b6d1[_0x8b7a('0x16')])||_['isNil'](_0x26b6d1[_0x8b7a('0x16')])?_0x8b7a('0x41')+Math[_0x8b7a('0x42')]():_0x26b6d1[_0x8b7a('0x16')],'lastName':_[_0x8b7a('0x43')](_0x26b6d1[_0x8b7a('0x44')])||_[_0x8b7a('0x45')](_0x26b6d1[_0x8b7a('0x44')])?null:_0x26b6d1[_0x8b7a('0x44')],'phone':_0x26b6d1['phone'],'ListId':_0x26b6d1[_0x8b7a('0x46')],'scheduledat':_0x26b6d1[_0x8b7a('0x47')],'callbackUniqueid':this[_0x8b7a('0x11')]['uniqueid'],'tags':_0x8b7a('0x48'),'description':_0x8b7a('0x49')+_0x26b6d1[_0x8b7a('0x47')]['toString'](),'priority':_0x26b6d1[_0x8b7a('0x4a')]};if(_[_0x8b7a('0x4b')](_0x26b6d1,_0x8b7a('0x4c'))){if(!_[_0x8b7a('0x45')](_0x26b6d1[_0x8b7a('0x4c')])){var _0x249fd9=_0x26b6d1[_0x8b7a('0x4c')];if(_0x26b6d1[_0x8b7a('0x4c')]=='CALLERID(dialTimezone)'){this['rpc'][_0x8b7a('0x4d')]({'phone':_0x26b6d1['phone']})[_0x8b7a('0x15')](function(_0x194c33){if(!_['isNil'](_0x194c33)){var _0x35659f=_0x194c33[_0x8b7a('0x4c')];if(!_[_0x8b7a('0x45')](_0x35659f)){var _0x1b6163=shared[_0x8b7a('0x4e')][_0x35659f];if(!_[_0x8b7a('0x45')](_0x1b6163)){var _0x37974d=-0x1*_0x1b6163[_0x8b7a('0x4f')];_0x5d8624['scheduledat']=moment(_0x26b6d1[_0x8b7a('0x50')])[_0x8b7a('0x51')](_0x37974d,_0x8b7a('0x52'));_0x2853f3['insertContact'](_0x5d8624,_0x26b6d1,_0x472fc3);}else{_0x2853f3[_0x8b7a('0x53')](_0x5d8624,_0x26b6d1,_0x472fc3);}}else{_0x2853f3[_0x8b7a('0x53')](_0x5d8624,_0x26b6d1,_0x472fc3);}}else{_0x2853f3[_0x8b7a('0x53')](_0x5d8624,_0x26b6d1,_0x472fc3);}});}else{var _0x15b4ee=shared[_0x8b7a('0x4e')][_0x249fd9];if(!_[_0x8b7a('0x45')](_0x15b4ee)){var _0x57d9e1=-0x1*_0x15b4ee[_0x8b7a('0x4f')];_0x5d8624[_0x8b7a('0x50')]=moment(_0x26b6d1[_0x8b7a('0x50')])[_0x8b7a('0x51')](_0x57d9e1,_0x8b7a('0x52'));_0x2853f3[_0x8b7a('0x53')](_0x5d8624,_0x26b6d1,_0x472fc3);}else{_0x2853f3[_0x8b7a('0x53')](_0x5d8624,_0x26b6d1,_0x472fc3);}}}else{_0x2853f3[_0x8b7a('0x53')](_0x5d8624,_0x26b6d1,_0x472fc3);}}else{_0x2853f3[_0x8b7a('0x53')](_0x5d8624,_0x26b6d1,_0x472fc3);}};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x54')]=function(_0x1baaa6,_0x24f2ec){this['rpc'][_0x8b7a('0x55')](_0x1baaa6)['then'](function(_0x5444b3){_0x24f2ec(null,_0x5444b3?_0x5444b3[_0x8b7a('0x16')]:![]);})[_0x8b7a('0x17')](function(_0x327482){_0x24f2ec(_0x327482);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x56')]=function(_0x4383a8,_0x4bcdf2,_0x418107){var _0x1fcbd7={'role':'agent'};_0x1fcbd7[_0x4383a8]=this['channel'][_0x8b7a('0x39')];this['rpc'][_0x8b7a('0x56')](_0x1fcbd7,_0x4bcdf2,this[_0x8b7a('0x11')][_0x8b7a('0x36')])['then'](function(_0x4909e8){_0x418107(null,_['isNil'](_0x4909e8)?![]:!![]);})[_0x8b7a('0x17')](function(_0x2a6e90){logger['error'](_0x2a6e90);_0x418107(null,![]);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x57')]=function(_0xf7a9b,_0x425ab6){var _0xf6e9bd={'role':_0x8b7a('0x58')};_0xf6e9bd[_0xf7a9b]=this[_0x8b7a('0x11')][_0x8b7a('0x39')];this['rpc'][_0x8b7a('0x57')](_0xf6e9bd)['then'](function(_0x34e0b6){_0x425ab6(null,_['isNil'](_0x34e0b6)?![]:!![]);})['catch'](function(_0x27df8a){logger[_0x8b7a('0x2d')](_0x27df8a);_0x425ab6(null,![]);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x59')]=function(_0x2bae97,_0x41ea88){var _0x5b491a={'role':'agent'};_0x5b491a[_0x2bae97]=this['channel'][_0x8b7a('0x39')];this[_0x8b7a('0x12')][_0x8b7a('0x59')](_0x5b491a)[_0x8b7a('0x15')](function(_0x1c4f8b){_0x41ea88(null,_[_0x8b7a('0x45')](_0x1c4f8b)?![]:!![]);})[_0x8b7a('0x17')](function(_0x184b9f){logger[_0x8b7a('0x2d')](_0x184b9f);_0x41ea88(null,![]);});};AGIVertices['prototype'][_0x8b7a('0x5a')]=function(_0x4ee0d5,_0x576aad){var _0x45947f={'role':_0x8b7a('0x58')};_0x45947f[_0x4ee0d5]=this[_0x8b7a('0x11')][_0x8b7a('0x39')];var _0x403494=_0x4ee0d5!=_0x8b7a('0x5b')?util[_0x8b7a('0x2b')](_0x8b7a('0x5c'),_0x8b7a('0x5d'),this[_0x8b7a('0x11')][_0x8b7a('0x39')]):undefined;this['rpc'][_0x8b7a('0x5a')](_0x45947f,_0x403494)[_0x8b7a('0x15')](function(_0x3d130e){_0x576aad(null,_['isNil'](_0x3d130e)?![]:!![]);})[_0x8b7a('0x17')](function(_0x55c7a6){logger[_0x8b7a('0x2d')](_0x55c7a6);_0x576aad(null,![]);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x5e')]=function(_0x3375ed,_0x4971a4){sh[_0x8b7a('0x5f')](_[_0x8b7a('0x60')](_0x3375ed),function(_0x52f473,_0xe8bc0){var _0x12bcd5=_0xe8bc0['replace'](/(\r\n|\n|\r)/gm,'');_0x4971a4(null,_0x12bcd5);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x61')]=function(_0x30b195,_0x524f3b){scripts[_0x8b7a('0x61')](_0x30b195['apiKey'],_0x30b195['google_cloud_tts_text_type']||'text',_0x30b195[_0x8b7a('0x62')],_0x30b195['languageCode']||_0x8b7a('0x63'),_0x30b195[_0x8b7a('0x64')]||_0x8b7a('0x65'),_0x30b195[_0x8b7a('0x66')]||_0x8b7a('0x67'))[_0x8b7a('0x15')](function(_0xf1deb){_0x524f3b(null,_0xf1deb);})['catch'](function(_0x417a0a){_0x524f3b(_0x417a0a);});};AGIVertices['prototype'][_0x8b7a('0x68')]=function(_0x1e735e,_0x27d2c0){scripts[_0x8b7a('0x68')](_0x1e735e[_0x8b7a('0x62')],_0x1e735e[_0x8b7a('0x69')]||'en',0x1)[_0x8b7a('0x15')](function(_0x437c6f){_0x27d2c0(null,_0x437c6f);})[_0x8b7a('0x17')](function(_0x506c68){_0x27d2c0(_0x506c68);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x6a')]=function(_0x54bd06,_0x197ab8){var _0x47a363={'uri':_0x54bd06[_0x8b7a('0x6b')],'method':_0x54bd06[_0x8b7a('0x6c')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x54bd06[_0x8b7a('0x6d')])==='number'&&parseInt(_0x54bd06[_0x8b7a('0x6d')])>=0x1?parseInt(_0x54bd06[_0x8b7a('0x6d')])*0x3e8:0x5*0x3e8};if(_[_0x8b7a('0x6e')]([_0x8b7a('0x6f'),_0x8b7a('0x70')],_0x47a363[_0x8b7a('0x6c')][_0x8b7a('0x71')]())){try{_0x47a363[_0x8b7a('0x72')]=_0x54bd06[_0x8b7a('0xd')]?JSON[_0x8b7a('0x73')](_0x54bd06[_0x8b7a('0xd')]):{};}catch(_0x4b4c7f){logger[_0x8b7a('0x2d')](_0x8b7a('0x74'),_0x4b4c7f);}}try{_0x47a363[_0x8b7a('0x75')]=_0x54bd06[_0x8b7a('0xc')]?JSON[_0x8b7a('0x73')](_0x54bd06[_0x8b7a('0xc')]):{};}catch(_0x28af6f){logger[_0x8b7a('0x2d')](_0x8b7a('0x76'),_0x28af6f);}if(_0x54bd06['computedVariables']){try{var _0x4cd7aa=require(_0x54bd06[_0x8b7a('0x77')])[_0x8b7a('0x78')](this,_0x47a363);_0x47a363[_0x8b7a('0x79')]=Mustache[_0x8b7a('0x7a')](_0x54bd06['url'],_0x4cd7aa,{},['$$','$$']);if(_0x47a363[_0x8b7a('0x75')]){_0x47a363[_0x8b7a('0x75')]=JSON[_0x8b7a('0x73')](Mustache[_0x8b7a('0x7a')](JSON[_0x8b7a('0x7b')](_0x47a363[_0x8b7a('0x75')]),_0x4cd7aa,{},['$$','$$']));}if(_0x47a363[_0x8b7a('0x72')]){_0x47a363[_0x8b7a('0x72')]=JSON[_0x8b7a('0x73')](Mustache[_0x8b7a('0x7a')](JSON['stringify'](_0x47a363[_0x8b7a('0x72')]),_0x4cd7aa,{},['$$','$$']));}}catch(_0x5d93c5){logger[_0x8b7a('0x2d')](_0x8b7a('0x7c'),_0x5d93c5);}}rp(_0x47a363)[_0x8b7a('0x15')](function(_0x43b41a){var _0x28afb4={'statusCode':_0x43b41a[_0x8b7a('0x7d')]||0xc8,'statusMessage':_0x43b41a[_0x8b7a('0x7e')]||'OK','headers':_0x43b41a[_0x8b7a('0x75')]||{},'body':_0x43b41a[_0x8b7a('0x72')]||{}};_0x197ab8(null,_0x28afb4);})[_0x8b7a('0x17')](function(_0x1d74ec){var _0x5b5206={'statusCode':_0x1d74ec[_0x8b7a('0x7d')]||0x1f4,'statusMessage':_0x1d74ec[_0x8b7a('0x7f')]||_0x8b7a('0x80'),'headers':_0x1d74ec[_0x8b7a('0x81')][_0x8b7a('0x75')]||{},'body':_0x1d74ec[_0x8b7a('0x81')][_0x8b7a('0x72')]||{}};_0x197ab8(null,_0x5b5206);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x82')]=function(_0x59030d,_0x2020dc){scripts[_0x8b7a('0x82')](this['channel']['uniqueid'],_0x59030d['key'],_0x59030d['text'],_0x59030d[_0x8b7a('0x83')]||'en')[_0x8b7a('0x15')](function(_0x1f9ac2){_0x2020dc(null,_0x1f9ac2);})[_0x8b7a('0x17')](function(_0x40c07b){_0x2020dc(_0x40c07b);});};AGIVertices['prototype'][_0x8b7a('0x84')]=function(_0x4ccca9,_0x47b1d4){scripts[_0x8b7a('0x84')](this[_0x8b7a('0x11')]['uniqueid'],_0x4ccca9['dialogflowV2_project_id'],_0x4ccca9[_0x8b7a('0x85')],_0x4ccca9[_0x8b7a('0x86')],_0x4ccca9['text'],_0x4ccca9['dialogflowV2_language']||'en')[_0x8b7a('0x15')](function(_0x1ce0ae){_0x47b1d4(null,_0x1ce0ae);})['catch'](function(_0x2224c8){_0x47b1d4(_0x2224c8);});};AGIVertices[_0x8b7a('0x13')]['sestekNDA']=function(_0x3d8cca,_0x4e2cea){scripts[_0x8b7a('0x87')](this[_0x8b7a('0x11')],_0x3d8cca)[_0x8b7a('0x15')](function(_0x10307c){_0x4e2cea(null,_0x10307c);})['catch'](function(_0x5bcb60){_0x4e2cea(_0x5bcb60);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x88')]=function(_0x37d391,_0x158090){scripts['ispeechTTS'](_0x37d391['key'],_0x37d391['text'],_0x37d391[_0x8b7a('0x89')]||_0x8b7a('0x63'),_0x37d391[_0x8b7a('0x8a')])['then'](function(_0x2d8888){_0x158090(null,_0x2d8888);})[_0x8b7a('0x17')](function(_0x54c26b){_0x158090(_0x54c26b);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x8b')]=function(_0x1a337a,_0x25c2ce,_0x116b10){scripts[_0x8b7a('0x8b')](_0x25c2ce,_0x1a337a[_0x8b7a('0x8c')],_0x1a337a[_0x8b7a('0x8d')]||_0x8b7a('0x63'),this[_0x8b7a('0x8e')](_0x1a337a[_0x8b7a('0x8f')])?_0x1a337a['model']:undefined)[_0x8b7a('0x15')](function(_0x205396){_0x116b10(null,_0x205396);})[_0x8b7a('0x17')](function(_0x4d12a0){_0x116b10(_0x4d12a0);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x90')]=function(_0x11518e,_0x281702){scripts[_0x8b7a('0x90')](_0x11518e[_0x8b7a('0x91')],_0x11518e['aws_secret_access_key'],_0x11518e[_0x8b7a('0x92')],_0x11518e[_0x8b7a('0x93')]||'Amy',_0x11518e[_0x8b7a('0x62')],_0x11518e[_0x8b7a('0x94')]||'text')[_0x8b7a('0x15')](function(_0x29483f){_0x281702(null,_0x29483f);})[_0x8b7a('0x17')](function(_0x5473cd){_0x281702(_0x5473cd);});};AGIVertices[_0x8b7a('0x13')]['awsLex']=function(_0x4e22ac,_0x331738){scripts[_0x8b7a('0x95')](this['channel'][_0x8b7a('0x36')],_0x4e22ac['aws_access_key_id'],_0x4e22ac['aws_secret_access_key'],_0x4e22ac[_0x8b7a('0x96')],_0x4e22ac['text'],_0x4e22ac[_0x8b7a('0x97')])[_0x8b7a('0x15')](function(_0x4f1648){_0x331738(null,_0x4f1648);})['catch'](function(_0x2baab6){_0x331738(_0x2baab6);});};AGIVertices['prototype'][_0x8b7a('0x98')]=function(_0x453b63,_0x44b176,_0x258061){scripts[_0x8b7a('0x98')](_0x44b176,_0x453b63[_0x8b7a('0x8c')],_0x453b63[_0x8b7a('0x99')]||_0x8b7a('0x63'))[_0x8b7a('0x15')](function(_0x40946c){_0x258061(null,_0x40946c);})[_0x8b7a('0x17')](function(_0x55935d){_0x258061(_0x55935d);});};AGIVertices['prototype'][_0x8b7a('0x9a')]=function(_0x572773,_0x3678d8,_0x2ba38a){scripts[_0x8b7a('0x9a')](_0x3678d8,_0x572773[_0x8b7a('0x9b')],_0x572773[_0x8b7a('0x9c')],_0x572773['uri'])[_0x8b7a('0x15')](function(_0x1f0090){_0x2ba38a(null,_0x1f0090);})['catch'](function(_0x236298){_0x2ba38a(_0x236298);});};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x9d')]=function(_0x2a0473){var _0x3b6cc7=_[_0x8b7a('0x6e')](verticesWithRetry,_0x2a0473[_0x8b7a('0x9e')])?_0x2a0473:_['clone'](_0x2a0473);for(var _0x26fe0e in _0x3b6cc7){if(_0x3b6cc7[_0x8b7a('0x9f')](_0x26fe0e)){if(_0x3b6cc7[_0x26fe0e]&&_[_0x8b7a('0xa0')](_0x3b6cc7[_0x26fe0e])){if(_['includes'](recursiveMapAttributes,_0x26fe0e)){_0x3b6cc7[_0x26fe0e]=this['replaceObjectAllVariables'](_0x3b6cc7[_0x26fe0e]);}else{_0x3b6cc7[_0x26fe0e]=this[_0x8b7a('0xa1')](_0x3b6cc7[_0x26fe0e]);}}}}return _0x3b6cc7;};AGIVertices['prototype'][_0x8b7a('0xa2')]=function(_0x56e602){for(var _0x45eba5 in _0x56e602){if(_0x56e602[_0x8b7a('0x9f')](_0x45eba5)){if(_[_0x8b7a('0xa3')](_0x56e602[_0x45eba5])){this[_0x8b7a('0xa2')](_0x56e602[_0x45eba5]);}else if(_[_0x8b7a('0xa4')](_0x56e602[_0x45eba5])){for(var _0x331fdc=0x0;_0x331fdc<_0x56e602[_0x45eba5][_0x8b7a('0xa5')];_0x331fdc++){this[_0x8b7a('0xa2')](_0x56e602[_0x45eba5][_0x331fdc]);}}else if(_[_0x8b7a('0xa0')](_0x56e602[_0x45eba5])){_0x56e602[_0x45eba5]=this['replaceAllVariables'](_0x56e602[_0x45eba5]);}}}};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0xa6')]=function(_0x84110,_0x46edc2){for(var _0x26f2b9 in _0x84110){if(_0x84110[_0x8b7a('0x9f')](_0x26f2b9)){if(_[_0x8b7a('0xa3')](_0x84110[_0x26f2b9])){if(!_[_0x8b7a('0x43')](_0x84110[_0x26f2b9])){this[_0x8b7a('0xa6')](_0x84110[_0x26f2b9],util[_0x8b7a('0x2b')](_0x8b7a('0xa7'),_0x46edc2,_0x26f2b9));}}else if(_[_0x8b7a('0xa4')](_0x84110[_0x26f2b9])){for(var _0x3d2425=0x0;_0x3d2425<_0x84110[_0x26f2b9][_0x8b7a('0xa5')];_0x3d2425++){this[_0x8b7a('0xa6')](_0x84110[_0x26f2b9][_0x3d2425],util[_0x8b7a('0x2b')]('%s.%s',_0x46edc2,_0x26f2b9+'['+_0x3d2425+']'));}}else{if(!_[_0x8b7a('0x45')](_0x84110[_0x26f2b9])){this['channel']['setVariable'](util['format'](_0x8b7a('0xa7'),_0x46edc2,_0x26f2b9),_0x84110[_0x26f2b9]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x26f918){try{var _0x23dbd9=JSON[_0x8b7a('0x73')](_0x26f918);this[_0x8b7a('0xa2')](_0x23dbd9);return JSON['stringify'](_0x23dbd9);}catch(_0x27a0bd){return this['replaceAllVariables'](_0x26f918);}};AGIVertices[_0x8b7a('0x13')]['replaceAllVariables']=function(_0x3d9ab8){var _0x4a3c78=_0x3d9ab8['split']('{');for(var _0x2bafb9=0x1;_0x2bafb9<_0x4a3c78[_0x8b7a('0xa5')];_0x2bafb9+=0x1){var _0x50cae7=_0x4a3c78[_0x2bafb9][_0x8b7a('0xa8')]('}');if(_0x50cae7['length']>0x1){_0x3d9ab8=_0x3d9ab8['replaceAll']('{'+_0x50cae7[0x0]+'}',this[_0x8b7a('0x11')][_0x8b7a('0x14')](_0x50cae7[0x0])['extra']||_0x50cae7[0x0]);}}if(_0x4a3c78['length']===0x1){return _0x3d9ab8['toString']();}return this['replaceAllVariables'](_0x3d9ab8);};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0xa9')]=function(_0x3c6782,_0x34e538){var _0x24e5fd=this[_0x8b7a('0x11')][_0x8b7a('0x14')](_0x3c6782);if(_0x24e5fd[_0x8b7a('0xaa')]===-0x1){return _0x24e5fd;}logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0xab'),_0x34e538,_0x24e5fd['extra']));return this[_0x8b7a('0x11')][_0x8b7a('0xac')](_0x34e538,_0x24e5fd[_0x8b7a('0xad')]);};AGIVertices['prototype'][_0x8b7a('0x8e')]=function(_0x25194c){return _0x25194c&&_0x25194c!=='0'&&_0x25194c!=='-1'&&_0x25194c!=='';};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0xae')]=function(_0x4c1169){this[_0x8b7a('0xaf')][_0x8b7a('0x78')](this,_0x4c1169,'-');_0x4c1169[_0x8b7a('0xb0')]=_0x4c1169[_0x8b7a('0xae')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x249339){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0xb1'),_0x249339['label']));if(!this[_0x8b7a('0x8e')](_0x249339['text'])){return this['channel'][_0x8b7a('0xb2')](_0x8b7a('0xb3'));}var _0x5a91e5='\x22'+_0x249339['text']+'\x22';if(this['isConfigured'](_0x249339['options'])){_0x5a91e5+=','+_0x249339[_0x8b7a('0x81')];}var _0xcb2c1e=this['channel']['exec']('MRCPSynth',_0x5a91e5);if(_0xcb2c1e[_0x8b7a('0xaa')]===-0x1){return _0xcb2c1e;}return this[_0x8b7a('0x11')]['noop'](util['format'](_0x8b7a('0xb4'),_0x5a91e5));};AGIVertices[_0x8b7a('0x13')]['mrcprecog']=function(_0x11c9b3){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0xb5'),_0x11c9b3[_0x8b7a('0x37')]));if(!this[_0x8b7a('0x8e')](_0x11c9b3[_0x8b7a('0xb6')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0xb7'));}var _0x14df08=_0x11c9b3[_0x8b7a('0xb6')];if(this[_0x8b7a('0x8e')](_0x11c9b3[_0x8b7a('0x81')])){_0x14df08+=','+_0x11c9b3['options'];}var _0x1add69=this[_0x8b7a('0x11')][_0x8b7a('0x5f')](_0x8b7a('0xb8'),_0x14df08);if(_0x1add69['result']===-0x1){return _0x1add69;}var _0x409d68=this[_0x8b7a('0xa9')](_0x8b7a('0xb9'),_0x8b7a('0xba'));if(_0x409d68[_0x8b7a('0xaa')]===-0x1){return _0x409d68;}var _0x3c5398=this[_0x8b7a('0xa9')](_0x8b7a('0xbb'),_0x8b7a('0xbc'));if(_0x3c5398[_0x8b7a('0xaa')]===-0x1){return _0x3c5398;}var _0x1fd1b8=this[_0x8b7a('0xa9')](_0x8b7a('0xbd'),_0x8b7a('0xbe'));if(_0x1fd1b8['result']===-0x1){return _0x1fd1b8;}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0xbf'),_0x14df08));};AGIVertices[_0x8b7a('0x13')]['agi']=function(_0x2a0d24){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0xc0'),_0x2a0d24[_0x8b7a('0x37')]));return this[_0x8b7a('0x11')]['agi']([_0x2a0d24[_0x8b7a('0xc1')],_0x2a0d24['args']]);};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0xc2')]=function(_0x261cba){logger[_0x8b7a('0x30')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x261cba[_0x8b7a('0x37')]));if(this[_0x8b7a('0x8e')](_0x261cba[_0x8b7a('0x6d')])){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0xc3'),_0x261cba[_0x8b7a('0x6d')]));var _0xfcb066=this[_0x8b7a('0x11')][_0x8b7a('0xc4')](_0x261cba[_0x8b7a('0x6d')]);if(_0xfcb066['result']===-0x1){return _0xfcb066;}}return this[_0x8b7a('0x11')]['answer']();};AGIVertices['prototype'][_0x8b7a('0x48')]=function(_0x4b5bec){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0xc5'),_0x4b5bec['label']));if(!this[_0x8b7a('0x8e')](_0x4b5bec[_0x8b7a('0x46')])){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x4b5bec,_0x8b7a('0xc6'));}_0x4b5bec[_0x8b7a('0x47')]=moment();if(this[_0x8b7a('0x8e')](_0x4b5bec[_0x8b7a('0xc7')])){_0x4b5bec['scheduledAt']=moment()[_0x8b7a('0x51')](_0x4b5bec[_0x8b7a('0xc7')],_0x8b7a('0x52'));}if(!this[_0x8b7a('0x8e')](_0x4b5bec[_0x8b7a('0x4a')])){_0x4b5bec[_0x8b7a('0x4a')]=0x2;}this[_0x8b7a('0x40')][_0x8b7a('0x78')](this,_0x4b5bec);return this['channel']['noop'](util[_0x8b7a('0x2b')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x4b5bec['phone'],_0x4b5bec[_0x8b7a('0x46')],_0x4b5bec[_0x8b7a('0x47')]));};AGIVertices['prototype'][_0x8b7a('0xc8')]=function(_0x518fcb){logger[_0x8b7a('0x30')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x518fcb[_0x8b7a('0x37')]));var _0x3d3698=this[_0x8b7a('0x11')][_0x8b7a('0x5f')](_0x518fcb['application'],_0x518fcb[_0x8b7a('0x81')]);if(_0x3d3698[_0x8b7a('0xaa')]===-0x1){return _0x3d3698;}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0xc9'),_0x518fcb[_0x8b7a('0xca')],_0x518fcb[_0x8b7a('0x81')]));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0xcb')]=function(_0x320119){logger['info'](util[_0x8b7a('0x2b')](_0x8b7a('0xcc'),_0x320119[_0x8b7a('0x37')]));if(!this[_0x8b7a('0x8e')](_0x320119[_0x8b7a('0x62')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0xb3'));}var _0x40ed0a='\x22'+_0x320119[_0x8b7a('0x62')]+'\x22';if(this['isConfigured'](_0x320119['options'])){_0x40ed0a+=','+_0x320119[_0x8b7a('0x81')];}var _0x27503c=this[_0x8b7a('0x11')]['exec'](_0x8b7a('0xcd'),_0x40ed0a);if(_0x27503c['result']===-0x1){return _0x27503c;}return this[_0x8b7a('0x11')]['noop'](util[_0x8b7a('0x2b')](_0x8b7a('0xb4'),_0x40ed0a));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0xce')]=function(_0xe6ae1b){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0xcf'),_0xe6ae1b['label']));if(!this[_0x8b7a('0x8e')](_0xe6ae1b[_0x8b7a('0x62')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0xb3'));}var _0xa2f194='\x22'+_0xe6ae1b[_0x8b7a('0x62')]+'\x22';if(this[_0x8b7a('0x8e')](_0xe6ae1b[_0x8b7a('0x81')])){_0xa2f194+=','+_0xe6ae1b[_0x8b7a('0x81')];}var _0x2af212=this[_0x8b7a('0x11')][_0x8b7a('0x5f')]('MRCPSynth',_0xa2f194);if(_0x2af212['result']===-0x1){return _0x2af212;}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util['format'](_0x8b7a('0xb4'),_0xa2f194));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0xd0')]=function(_0x3526cd){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x3526cd[_0x8b7a('0x37')]));if(!this['isConfigured'](_0x3526cd['grammar'])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0xb7'));}var _0x498652=_0x3526cd[_0x8b7a('0xb6')];if(this['isConfigured'](_0x3526cd['options'])){_0x498652+=','+_0x3526cd[_0x8b7a('0x81')];}var _0x4c8771=this[_0x8b7a('0x11')][_0x8b7a('0x5f')](_0x8b7a('0xb8'),_0x498652);if(_0x4c8771[_0x8b7a('0xaa')]===-0x1){return _0x4c8771;}var _0x415b06=this['getAndSetVariable'](_0x8b7a('0xb9'),'LUMENVOX_ASR_CONFIDENCE');if(_0x415b06[_0x8b7a('0xaa')]===-0x1){return _0x415b06;}var _0x2eafcb=this['getAndSetVariable'](_0x8b7a('0xbb'),_0x8b7a('0xd1'));if(_0x2eafcb[_0x8b7a('0xaa')]===-0x1){return _0x2eafcb;}var _0x563965=this[_0x8b7a('0xa9')]('RECOG_INSTANCE()',_0x8b7a('0xd2'));if(_0x563965['result']===-0x1){return _0x563965;}return this['channel'][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0xbf'),_0x498652));};AGIVertices['prototype'][_0x8b7a('0xd3')]=function(_0x4e8497){logger['info'](util[_0x8b7a('0x2b')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x4e8497['label']));if(!this[_0x8b7a('0x8e')](_0x4e8497[_0x8b7a('0xb6')])){return this['channel'][_0x8b7a('0xb2')](_0x8b7a('0xb7'));}var _0x5c43ff=_0x4e8497[_0x8b7a('0xb6')];if(this['isConfigured'](_0x4e8497[_0x8b7a('0x81')])){_0x5c43ff+=','+_0x4e8497[_0x8b7a('0x81')];}var _0x21c385=this['channel'][_0x8b7a('0x5f')](_0x8b7a('0xb8'),_0x5c43ff);if(_0x21c385[_0x8b7a('0xaa')]===-0x1){return _0x21c385;}var _0x3fad97=this[_0x8b7a('0xa9')](_0x8b7a('0xb9'),_0x8b7a('0xd4'));if(_0x3fad97[_0x8b7a('0xaa')]===-0x1){return _0x3fad97;}var _0x34b15b=this['getAndSetVariable'](_0x8b7a('0xbb'),'SESTEK_ASR_TRANSCRIPT');if(_0x34b15b[_0x8b7a('0xaa')]===-0x1){return _0x34b15b;}var _0x28ed83=this[_0x8b7a('0xa9')](_0x8b7a('0xbd'),_0x8b7a('0xd5'));if(_0x28ed83['result']===-0x1){return _0x28ed83;}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0xbf'),_0x5c43ff));};AGIVertices['prototype']['database']=function(_0x4b340e){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0xd6'),_0x4b340e[_0x8b7a('0x37')]));if(!this[_0x8b7a('0x8e')](_0x4b340e[_0x8b7a('0xd7')])){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x4b340e,_0x8b7a('0xd8'));}var _0x512997=this['getSquareOdbc'][_0x8b7a('0x78')](this,_0x4b340e[_0x8b7a('0xd7')]);if(!_0x512997){return this['channel'][_0x8b7a('0x2d')](_0x4b340e,_0x8b7a('0xd9'));}if(!this[_0x8b7a('0x8e')](_0x4b340e[_0x8b7a('0xda')])){return this['channel'][_0x8b7a('0x2d')](_0x4b340e,_0x8b7a('0xdb'));}var _0x638f35=_0x4b340e[_0x8b7a('0xda')][_0x8b7a('0xdc')](/(\r\n|\n|\r)/gm,'\x20');this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0xdd'),_0x638f35));var _0x330ac5=this[_0x8b7a('0x2c')]['sync'](this,_0x512997,_0x638f35);this[_0x8b7a('0xaf')]['sync'](this,_0x4b340e,_0x638f35);if(!this['isConfigured'](_0x4b340e[_0x8b7a('0xde')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0xdf'));}var _0x4a68b4=this[_0x8b7a('0x14')][_0x8b7a('0x78')](this,_0x4b340e[_0x8b7a('0xde')]);if(!_0x4a68b4){return this['channel'][_0x8b7a('0x2d')](_0x4b340e,'no\x20variable\x20found');}var _0x13f97a=this;_0x330ac5[_0x8b7a('0xe0')](function(_0x2a9c24,_0x827f18){Object[_0x8b7a('0xe1')](_0x2a9c24)[_0x8b7a('0xe0')](function(_0x418f5d){_0x13f97a['channel'][_0x8b7a('0xac')](util[_0x8b7a('0x2b')](_0x8b7a('0xe2'),_0x4a68b4,_0x827f18,_0x418f5d),_0x2a9c24[_0x418f5d]);});});this[_0x8b7a('0x11')][_0x8b7a('0xac')](util[_0x8b7a('0x2b')](_0x8b7a('0xe3'),_0x4a68b4),_0x330ac5[_0x8b7a('0xa5')]);return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0xe4'),_0x4a68b4));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0xe5')]=function(_0x44b16d){logger['debug'](util[_0x8b7a('0x2b')](_0x8b7a('0xe6'),_0x44b16d['label']));if(!this[_0x8b7a('0x8e')](_0x44b16d['sip_id'])){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x44b16d,_0x8b7a('0xe7'));}var _0x965c1a=this[_0x8b7a('0x1c')][_0x8b7a('0x78')](this,_0x44b16d['sip_id']);if(!_0x965c1a){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x44b16d,_0x8b7a('0xe8'));}var _0x85ea16=this['channel'][_0x8b7a('0x5f')](_0x8b7a('0xe9'),[util[_0x8b7a('0x2b')](_0x8b7a('0xea'),_0x965c1a),_0x44b16d[_0x8b7a('0x6d')],_0x44b16d['opts'],_0x44b16d[_0x8b7a('0x6b')]]);if(_0x85ea16['result']===-0x1){return _0x85ea16;}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices['prototype'][_0x8b7a('0xeb')]=function(_0x34fe81){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0xec'),_0x34fe81['label']));if(!this['isConfigured'](_0x34fe81[_0x8b7a('0x8c')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0xed'));}if(!this[_0x8b7a('0x8e')](_0x34fe81[_0x8b7a('0x62')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0xb3'));}this[_0x8b7a('0x11')]['bot']=!![];this[_0x8b7a('0xaf')](_0x34fe81);this['createSquareMessage'](_0x34fe81[_0x8b7a('0x62')],'in','','');this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0xee'),_0x34fe81[_0x8b7a('0x62')]));var _0x4f1dd9=this['googleDialogflow'][_0x8b7a('0x78')](this,_0x34fe81);if(_0x4f1dd9){for(var _0x5760f4 in _0x4f1dd9){if(_0x4f1dd9[_0x8b7a('0x9f')](_0x5760f4)){this[_0x8b7a('0x11')][_0x8b7a('0xac')](util[_0x8b7a('0x2b')](_0x8b7a('0xef'),_0x5760f4[_0x8b7a('0x71')]()),_0x4f1dd9[_0x5760f4]);}}this[_0x8b7a('0xf0')](_0x4f1dd9['speech'],'out',_0x8b7a('0xeb'),'');return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')]('Dialogflow\x20Result\x20%s',_0x4f1dd9[_0x8b7a('0xf1')]));}return this[_0x8b7a('0x11')]['error'](_0x34fe81,_0x8b7a('0xf2'));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0xf3')]=function(_0x5ef5df){logger['info'](util['format'](_0x8b7a('0xf4'),_0x5ef5df[_0x8b7a('0x37')]));if(!this['isConfigured'](_0x5ef5df['dialogflowV2_project_id'])){return this['channel'][_0x8b7a('0xb2')](_0x8b7a('0xf5'));}if(!this['isConfigured'](_0x5ef5df[_0x8b7a('0x85')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x5ef5df[_0x8b7a('0x86')])){return this['channel'][_0x8b7a('0xb2')](_0x8b7a('0xf6'));}if(!this[_0x8b7a('0x8e')](_0x5ef5df[_0x8b7a('0xf7')])){return this[_0x8b7a('0x11')]['noop'](_0x8b7a('0xf8'));}if(!this[_0x8b7a('0x8e')](_0x5ef5df[_0x8b7a('0x62')])){return this['channel'][_0x8b7a('0xb2')](_0x8b7a('0xb3'));}this['channel'][_0x8b7a('0xf9')]=!![];this['createSquareDetailsReport'](_0x5ef5df);this[_0x8b7a('0xf0')](_0x5ef5df['text'],'in','','');this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0xfa'),_0x5ef5df[_0x8b7a('0x62')]));var _0x758ce1=this[_0x8b7a('0x84')][_0x8b7a('0x78')](this,_0x5ef5df);if(_0x758ce1){for(var _0x1f4197 in _0x758ce1){if(_0x758ce1['hasOwnProperty'](_0x1f4197)){if(_0x1f4197!==_0x8b7a('0xfb')){this[_0x8b7a('0x11')]['setVariable'](util['format'](_0x8b7a('0xef'),_0x1f4197[_0x8b7a('0x71')]()),_0x758ce1[_0x1f4197]);}}}this[_0x8b7a('0xf0')](_0x758ce1[_0x8b7a('0xf1')],_0x8b7a('0xfc'),_0x8b7a('0xf3'),_0x758ce1['providerResponse']);return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0xfd'),_0x758ce1[_0x8b7a('0xf1')]));}return this[_0x8b7a('0x11')]['error'](_0x5ef5df,_0x8b7a('0xfe'));};AGIVertices[_0x8b7a('0x13')]['sesteknda']=function(_0x4a7e26){logger['info'](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x4a7e26[_0x8b7a('0x37')]));if(!this['isConfigured'](_0x4a7e26[_0x8b7a('0xff')])){return this['channel'][_0x8b7a('0xb2')](_0x8b7a('0x100'));}if(!this[_0x8b7a('0x8e')](_0x4a7e26[_0x8b7a('0x101')])){return this['channel']['noop'](_0x8b7a('0x102'));}if(!this[_0x8b7a('0x8e')](_0x4a7e26[_0x8b7a('0x103')])){return this['channel'][_0x8b7a('0xb2')](_0x8b7a('0x104'));}if(!this[_0x8b7a('0x8e')](_0x4a7e26[_0x8b7a('0x105')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')]('no\x20text\x20configured');}this[_0x8b7a('0x11')][_0x8b7a('0xf9')]=!![];this[_0x8b7a('0xaf')](_0x4a7e26);this[_0x8b7a('0xf0')](_0x4a7e26['text'],'in','','');this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x106'),_0x4a7e26[_0x8b7a('0x62')]));var _0x17c947=this[_0x8b7a('0x87')]['sync'](this,_0x4a7e26);if(_0x17c947){for(var _0x396b30 in _0x17c947){if(_0x17c947['hasOwnProperty'](_0x396b30)){this[_0x8b7a('0x11')][_0x8b7a('0xac')](util[_0x8b7a('0x2b')](_0x8b7a('0x107'),_0x396b30[_0x8b7a('0x71')]()),_0x17c947[_0x396b30]);}}this[_0x8b7a('0xf0')](_0x17c947[_0x8b7a('0xf1')],_0x8b7a('0xfc'),_0x8b7a('0x108'),'');if(_0x17c947[_0x8b7a('0x109')]){this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x10a'),_0x17c947['audiofile']));var _0x31d0ca=this[_0x8b7a('0x11')][_0x8b7a('0x10b')](_0x17c947[_0x8b7a('0x109')]);try{fs['unlink'](_0x17c947[_0x8b7a('0x109')]+_0x8b7a('0x10c'));}catch(_0x5a0cf2){logger[_0x8b7a('0x2d')](_0x5a0cf2);}return _0x31d0ca;}else{return this['channel'][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x10d'),_0x17c947[_0x8b7a('0xf1')]));}}return this[_0x8b7a('0x11')]['error'](_0x4a7e26,_0x8b7a('0x10e'));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x10f')]=function(_0x4156a9){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x110'),_0x4156a9[_0x8b7a('0x37')]));return this[_0x8b7a('0x11')][_0x8b7a('0xb2')]('end');};AGIVertices['prototype']['ext_dial']=function(_0x2c52e5){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x111'),_0x2c52e5[_0x8b7a('0x37')]));var _0xb217c4='';if(_0x2c52e5[_0x8b7a('0x112')]){if(!this[_0x8b7a('0x8e')](_0x2c52e5[_0x8b7a('0x112')])){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x2c52e5,'no\x20trunk\x20selected');}else{var _0x335d1d=parseInt(_0x2c52e5[_0x8b7a('0x112')],0xa);if(isNaN(_0x335d1d)){_0xb217c4=_0x2c52e5[_0x8b7a('0x112')];}else{_0xb217c4=this['getTrunk'][_0x8b7a('0x78')](this,_0x2c52e5[_0x8b7a('0x112')]);if(!_0xb217c4){return this['channel'][_0x8b7a('0x2d')](_0x2c52e5,_0x8b7a('0x113'));}}}}else if(_0x2c52e5[_0x8b7a('0x114')]){_0xb217c4=_0x2c52e5['trunk_name'];}else{return this['channel'][_0x8b7a('0x2d')](_0x2c52e5,_0x8b7a('0x115'));}var _0x5f5675=this[_0x8b7a('0x11')][_0x8b7a('0x5f')]('DIAL',[util[_0x8b7a('0x2b')](_0x8b7a('0x116'),_0xb217c4,_0x2c52e5['phone']),_0x2c52e5[_0x8b7a('0x6d')],_0x2c52e5[_0x8b7a('0x117')],_0x2c52e5[_0x8b7a('0x6b')]]);if(_0x5f5675['result']===-0x1){return _0x5f5675;}return this['channel'][_0x8b7a('0xb2')](util['format'](_0x8b7a('0x118'),'DIAL'));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x119')]=function(_0x16e732){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x16e732[_0x8b7a('0x37')]));return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0x119'));};AGIVertices[_0x8b7a('0x13')]['getdigits']=function(_0x1ec433){logger['info'](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x1ec433[_0x8b7a('0x37')]));if(_0x1ec433[_0x8b7a('0xb0')]===0x0){return this['maxRetry'](_0x1ec433);}_0x1ec433[_0x8b7a('0xb0')]-=0x1;if(!this['isConfigured'](_0x1ec433[_0x8b7a('0x11a')])){return this['channel'][_0x8b7a('0x2d')](_0x1ec433,_0x8b7a('0x11b'));}var _0x3dd7ae=this['getSound'][_0x8b7a('0x78')](this,_0x1ec433[_0x8b7a('0x11a')]);if(!_0x3dd7ae){return this[_0x8b7a('0x11')]['error'](_0x1ec433,_0x8b7a('0x11c'));}if(!this[_0x8b7a('0x8e')](_0x1ec433[_0x8b7a('0xde')])){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x8b7a('0xdf'));}var _0x2fb667=this[_0x8b7a('0x11')][_0x8b7a('0x11d')](_0x3dd7ae,_0x1ec433[_0x8b7a('0x11e')],_0x1ec433[_0x8b7a('0x11f')]);var _0x47f36d=_0x2fb667[_0x8b7a('0xaa')]?_0x2fb667[_0x8b7a('0xaa')][_0x8b7a('0x120')]():'';logger[_0x8b7a('0x30')](_0x8b7a('0x121'),JSON[_0x8b7a('0x7b')](_0x2fb667));if(_0x2fb667[_0x8b7a('0xaa')]===-0x1){this[_0x8b7a('0xaf')]['sync'](this,_0x1ec433,_0x47f36d);return _0x2fb667;}else if(_0x2fb667[_0x8b7a('0xad')]===_0x8b7a('0x6d')){_0x2fb667['result']=_0x47f36d['length']>=parseInt(_0x1ec433[_0x8b7a('0x122')])?'x':'i';}else{_0x2fb667[_0x8b7a('0xaa')]=_0x47f36d[_0x8b7a('0xa5')]>=parseInt(_0x1ec433[_0x8b7a('0x122')])&&_0x47f36d['length']<=parseInt(_0x1ec433[_0x8b7a('0x11f')])?'x':'i';}var _0x4fd469=this[_0x8b7a('0x14')]['sync'](this,_0x1ec433['variable_id']);if(!_0x4fd469){return this[_0x8b7a('0x11')]['error'](_0x1ec433,_0x8b7a('0x123'));}this[_0x8b7a('0x11')][_0x8b7a('0xac')](_0x4fd469,_0x47f36d);if(this['isConfigured'](_0x1ec433['hiddendigitsnum'])){var _0x20be2b=parseInt(_0x1ec433[_0x8b7a('0x124')],0xa);var _0x35fd61=rs['generate']({'charset':'*','length':_0x20be2b});var _0x12fc65=_0x47f36d[_0x8b7a('0xa5')];if(_0x12fc65>0x0){if(_0x12fc65>_0x20be2b){this[_0x8b7a('0xaf')][_0x8b7a('0x78')](this,_0x1ec433,_0x1ec433[_0x8b7a('0x125')]===_0x8b7a('0x126')?_0x35fd61+_0x47f36d['substr'](_0x20be2b):_0x47f36d[_0x8b7a('0x127')](0x0,_0x12fc65-_0x20be2b)+_0x35fd61);}else{this[_0x8b7a('0xaf')]['sync'](this,_0x1ec433,rs['generate']({'charset':'*','length':_0x12fc65}));}}else{this[_0x8b7a('0xaf')][_0x8b7a('0x78')](this,_0x1ec433,'');}}else{this[_0x8b7a('0xaf')][_0x8b7a('0x78')](this,_0x1ec433,_0x47f36d);}return _0x2fb667;};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x10')]=function(_0x433cbc){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x128'),_0x433cbc[_0x8b7a('0x37')]));return this[_0x8b7a('0xf')](_0x433cbc);};AGIVertices['prototype'][_0x8b7a('0x129')]=function(_0x4a08fb){logger[_0x8b7a('0x30')](util['format'](_0x8b7a('0x12a'),_0x4a08fb['label']));this[_0x8b7a('0xaf')][_0x8b7a('0x78')](this,_0x4a08fb,_0x4a08fb['goalname']);return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')]('GOAL\x20%s',_0x4a08fb[_0x8b7a('0x12b')]));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x12c')]=function(_0x5e014e){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x12d'),_0x5e014e[_0x8b7a('0x37')]));if(!this[_0x8b7a('0x8e')](_0x5e014e[_0x8b7a('0x91')])||!this[_0x8b7a('0x8e')](_0x5e014e[_0x8b7a('0x12e')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x8b7a('0x8e')](_0x5e014e['text'])){return this[_0x8b7a('0x11')]['noop']('no\x20text\x20configured');}this[_0x8b7a('0x11')]['noop'](util[_0x8b7a('0x2b')](_0x8b7a('0x12f'),_0x5e014e[_0x8b7a('0x62')]));var _0x27f707=this['awsPolly'][_0x8b7a('0x78')](this,_0x5e014e);if(_0x27f707){this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x130'),_0x27f707));var _0x284710=this[_0x8b7a('0x11')]['streamFile'](_0x27f707);try{fs[_0x8b7a('0x131')](_0x27f707+_0x8b7a('0x10c'));}catch(_0x2793ba){logger[_0x8b7a('0x2d')](_0x2793ba);}return _0x284710;}return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x5e014e,_0x8b7a('0x132'));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x133')]=function(_0x1e4786){logger['info'](util[_0x8b7a('0x2b')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x1e4786['label']));if(!this['isConfigured'](_0x1e4786[_0x8b7a('0x91')])||!this[_0x8b7a('0x8e')](_0x1e4786[_0x8b7a('0x12e')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0x134'));}if(!this[_0x8b7a('0x8e')](_0x1e4786[_0x8b7a('0x97')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0x135'));}if(!this[_0x8b7a('0x8e')](_0x1e4786['text'])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0xb3'));}this[_0x8b7a('0x11')][_0x8b7a('0xf9')]=!![];this[_0x8b7a('0xaf')](_0x1e4786);this['createSquareMessage'](_0x1e4786[_0x8b7a('0x62')],'in','','');this['channel']['noop'](util[_0x8b7a('0x2b')](_0x8b7a('0x136'),_0x1e4786['text']));var _0x1d2470=this['awsLex']['sync'](this,_0x1e4786);if(_0x1d2470){for(var _0x1084ad in _0x1d2470){if(_0x1d2470[_0x8b7a('0x9f')](_0x1084ad)&&_['isString'](_0x1d2470[_0x1084ad])){this[_0x8b7a('0x11')][_0x8b7a('0xac')](util[_0x8b7a('0x2b')](_0x8b7a('0x137'),_0x1084ad[_0x8b7a('0x71')]()),_0x1d2470[_0x1084ad]);}}if(_[_0x8b7a('0x45')](_0x1d2470[_0x8b7a('0x7f')])){return this['channel']['noop'](_0x8b7a('0x138'));}else{this[_0x8b7a('0xf0')](_0x1d2470['message'],_0x8b7a('0xfc'),_0x8b7a('0x139'),'');return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x13a'),_0x1d2470[_0x8b7a('0x7f')]));}}return this['channel']['error'](_0x1e4786,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x8b7a('0x13b')]=function(_0x3cbb62){logger['info'](util[_0x8b7a('0x2b')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x3cbb62[_0x8b7a('0x37')],_0x3cbb62[_0x8b7a('0x6d')]));if(!this[_0x8b7a('0x8e')](_0x3cbb62[_0x8b7a('0x8c')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0xed'));}var _0x45e521=_0x8b7a('0x13c');var _0x112c89=util['format'](_0x8b7a('0x13d'),FILES_PATH,rs[_0x8b7a('0x13e')](0x4));var _0x59f04e=util[_0x8b7a('0x2b')](_0x8b7a('0xa7'),_0x112c89,_0x45e521);var _0x1a3c3f=!![];if(_0x3cbb62['beep']===_0x8b7a('0x13f')){_0x1a3c3f=![];}var _0x5e3b15=this['channel']['recordFile'](_0x112c89,_0x45e521,_0x3cbb62[_0x8b7a('0x140')],_0x3cbb62[_0x8b7a('0x6d')],undefined,_0x1a3c3f);if(_0x5e3b15[_0x8b7a('0xaa')]!==-0x1){this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x141'),_0x59f04e));var _0x16d26c=this['googleASR'][_0x8b7a('0x78')](this,_0x3cbb62,_0x59f04e);if(_0x16d26c){for(var _0x318585 in _0x16d26c){if(_0x16d26c[_0x8b7a('0x9f')](_0x318585)){this[_0x8b7a('0x11')][_0x8b7a('0xac')](util[_0x8b7a('0x2b')](_0x8b7a('0x142'),_0x318585[_0x8b7a('0x71')]()),_0x16d26c[_0x318585]);}}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x16d26c)));}}return _0x5e3b15;};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x143')]=function(_0x11168d){logger['info'](util[_0x8b7a('0x2b')](_0x8b7a('0x144'),_0x11168d[_0x8b7a('0x37')]));if(!this[_0x8b7a('0x8e')](_0x11168d[_0x8b7a('0x9b')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0x145'));}if(!this[_0x8b7a('0x8e')](_0x11168d['appsecret'])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0x146'));}var _0xcb08cd=_0x8b7a('0x13c');var _0x48f2b0=util[_0x8b7a('0x2b')](_0x8b7a('0x13d'),FILES_PATH,rs['generate'](0x4));var _0x2f1b2e=util[_0x8b7a('0x2b')]('%s.%s',_0x48f2b0,_0xcb08cd);var _0x56b42=!![];if(_0x11168d['beep']===_0x8b7a('0x13f')){_0x56b42=![];}var _0x243e38=this[_0x8b7a('0x11')]['recordFile'](_0x48f2b0,_0xcb08cd,_0x11168d[_0x8b7a('0x140')],_0x11168d[_0x8b7a('0x6d')],undefined,_0x56b42);if(_0x243e38[_0x8b7a('0xaa')]!==-0x1){this[_0x8b7a('0x11')]['noop'](util[_0x8b7a('0x2b')](_0x8b7a('0x147'),_0x2f1b2e));var _0x164230=this[_0x8b7a('0x9a')]['sync'](this,_0x11168d,_0x2f1b2e);if(_0x164230){for(var _0x3f930c in _0x164230){if(_0x164230[_0x8b7a('0x9f')](_0x3f930c)){this[_0x8b7a('0x11')][_0x8b7a('0xac')](util[_0x8b7a('0x2b')](_0x8b7a('0x148'),_0x3f930c[_0x8b7a('0x71')]()),_0x164230[_0x3f930c]);}}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util['format']('TildeASR\x20Result\x20%s',JSON['stringify'](_0x164230)));}}return _0x243e38;};AGIVertices[_0x8b7a('0x13')]['gotoc']=function(_0x35961a){logger['info'](util[_0x8b7a('0x2b')](_0x8b7a('0x149'),_0x35961a['label']));return this['channel'][_0x8b7a('0x14a')](_0x35961a[_0x8b7a('0x3c')],_0x35961a[_0x8b7a('0x3d')],_0x35961a[_0x8b7a('0x3e')]);};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x14b')]=function(_0x26e8a2){logger['info'](util[_0x8b7a('0x2b')](_0x8b7a('0x14c'),_0x26e8a2['label']));if(!this[_0x8b7a('0x8e')](_0x26e8a2['condition'])){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x26e8a2,_0x8b7a('0x14d'));}try{var _0x409be8=eval(_0x26e8a2[_0x8b7a('0x14e')])?_0x8b7a('0x14f'):_0x8b7a('0x150');this['channel'][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x151'),_0x26e8a2[_0x8b7a('0x14e')],_0x409be8));return{'code':0xc8,'result':_0x409be8};}catch(_0x121eda){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype'][_0x8b7a('0x152')]=function(_0x153e55){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x153e55[_0x8b7a('0x37')]));if(!this['isConfigured'](_0x153e55[_0x8b7a('0x153')])){return this['channel']['error'](_0x153e55,'no\x20interval\x20configured');}var _0x33bdb2=this[_0x8b7a('0x24')][_0x8b7a('0x78')](this,_0x153e55[_0x8b7a('0x153')]);if(!_0x33bdb2){return this['channel'][_0x8b7a('0x2d')](_0x153e55,'no\x20intervals\x20found');}for(var _0xbbabd0=0x0;_0xbbabd0<_0x33bdb2['length'];_0xbbabd0+=0x1){var _0xf672f1=this[_0x8b7a('0x11')]['getVariable'](util['format']('IFTIME(%s?true:false)',_0x33bdb2[_0xbbabd0]));if(_0xf672f1[_0x8b7a('0xaa')]===-0x1){return _0xf672f1;}logger['info'](util[_0x8b7a('0x2b')]('IFTIME\x20%s\x20%s',_0x33bdb2[_0xbbabd0],_0xf672f1[_0x8b7a('0xad')]));if(_0xf672f1[_0x8b7a('0xad')]===_0x8b7a('0x14f')){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x154'),_0x33bdb2[_0xbbabd0],_0x8b7a('0x14f')));this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x154'),_0x33bdb2[_0xbbabd0],_0x8b7a('0x14f')));return{'code':0xc8,'result':'true'};}else{logger['info'](util['format'](_0x8b7a('0x154'),_0x33bdb2[_0xbbabd0],'false'));this['channel'][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x154'),_0x33bdb2[_0xbbabd0],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype']['hangup']=function(_0x29aafb){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x155'),_0x29aafb[_0x8b7a('0x37')]));return this[_0x8b7a('0x11')][_0x8b7a('0x156')]();};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x157')]=function(_0x1069bb){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x158'),_0x1069bb['label']));if(!this['isConfigured'](_0x1069bb[_0x8b7a('0x8c')])){return this[_0x8b7a('0x11')]['noop'](_0x8b7a('0xed'));}var _0x2e5fa8=_0x8b7a('0x13c');var _0x49acfa=util[_0x8b7a('0x2b')](_0x8b7a('0x13d'),FILES_PATH,rs['generate'](0x4));var _0x133f26=util[_0x8b7a('0x2b')](_0x8b7a('0xa7'),_0x49acfa,_0x2e5fa8);var _0x387152=!![];if(_0x1069bb[_0x8b7a('0x159')]==='NOBEEP'){_0x387152=![];}var _0x39d6c7=this[_0x8b7a('0x11')]['recordFile'](_0x49acfa,_0x2e5fa8,_0x1069bb['intKey'],_0x1069bb[_0x8b7a('0x6d')],undefined,_0x387152);if(_0x39d6c7[_0x8b7a('0xaa')]!==-0x1){this[_0x8b7a('0x11')]['noop'](util[_0x8b7a('0x2b')](_0x8b7a('0x15a'),_0x133f26));var _0x18050b=this[_0x8b7a('0x8b')][_0x8b7a('0x78')](this,_0x1069bb,_0x133f26);if(_0x18050b){for(var _0x359a0e in _0x18050b){if(_0x18050b[_0x8b7a('0x9f')](_0x359a0e)){this['channel'][_0x8b7a('0xac')](util[_0x8b7a('0x2b')](_0x8b7a('0x15b'),_0x359a0e['toUpperCase']()),_0x18050b[_0x359a0e]);}}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x15c'),JSON[_0x8b7a('0x7b')](_0x18050b)));}}return _0x39d6c7;};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x15d')]=function(_0x4c82d1){logger['info'](util[_0x8b7a('0x2b')](_0x8b7a('0x15e'),_0x4c82d1['label']));if(!this[_0x8b7a('0x8e')](_0x4c82d1[_0x8b7a('0x8c')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')]('no\x20key\x20configured');}if(!this[_0x8b7a('0x8e')](_0x4c82d1[_0x8b7a('0x62')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')]('no\x20text\x20configured');}this['channel'][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')]('Trying\x20ispeech\x20TTS\x20%s',_0x4c82d1[_0x8b7a('0x62')]));var _0x2c62ce=this[_0x8b7a('0x88')]['sync'](this,_0x4c82d1);if(_0x2c62ce){this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x15a'),_0x2c62ce));var _0xb24d83=this[_0x8b7a('0x11')][_0x8b7a('0x10b')](_0x2c62ce,_0x4c82d1['intKey']);try{fs[_0x8b7a('0x131')](_0x2c62ce+_0x8b7a('0x10c'));}catch(_0x25c2f6){logger[_0x8b7a('0x2d')](_0x25c2f6);}return _0xb24d83;}return this['channel'][_0x8b7a('0x2d')](_0x4c82d1,_0x8b7a('0x15f'));};AGIVertices['prototype'][_0x8b7a('0x160')]=function(_0x576488){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x161'),_0x576488[_0x8b7a('0x37')]));if(!this[_0x8b7a('0x8e')](_0x576488['findBy'])){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x576488,'no\x20find\x20by\x20configured');}logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8b7a('0x11')][_0x8b7a('0x39')],_0x576488['findBy']));var _0x149735=this[_0x8b7a('0x5a')]['sync'](this,_0x576488[_0x8b7a('0x162')]);if(_0x149735){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x8b7a('0x39')],_0x576488[_0x8b7a('0x162')]));this[_0x8b7a('0x11')]['noop'](util['format'](_0x8b7a('0x163'),this[_0x8b7a('0x11')][_0x8b7a('0x39')],_0x576488[_0x8b7a('0x162')]));return{'code':0xc8,'result':_0x8b7a('0x164')};}else{logger['info'](util[_0x8b7a('0x2b')](_0x8b7a('0x165'),this[_0x8b7a('0x11')]['callerid'],_0x576488[_0x8b7a('0x162')]));this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util['format'](_0x8b7a('0x165'),this['channel'][_0x8b7a('0x39')],_0x576488['findBy']));return{'code':0xc8,'result':_0x8b7a('0x166')};}};AGIVertices[_0x8b7a('0x13')]['logout']=function(_0x2a7f86){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2a7f86[_0x8b7a('0x37')]));if(!this[_0x8b7a('0x8e')](_0x2a7f86[_0x8b7a('0x162')])){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x2a7f86,_0x8b7a('0x167'));}logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8b7a('0x11')][_0x8b7a('0x39')],_0x2a7f86[_0x8b7a('0x162')]));var _0x3c1f3f=this['agentLogout']['sync'](this,_0x2a7f86[_0x8b7a('0x162')]);if(_0x3c1f3f){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x163'),this[_0x8b7a('0x11')][_0x8b7a('0x39')],_0x2a7f86[_0x8b7a('0x162')]));this['channel'][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x163'),this['channel'][_0x8b7a('0x39')],_0x2a7f86[_0x8b7a('0x162')]));return{'code':0xc8,'result':_0x8b7a('0x164')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8b7a('0x11')][_0x8b7a('0x39')],_0x2a7f86[_0x8b7a('0x162')]));this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x165'),this[_0x8b7a('0x11')]['callerid'],_0x2a7f86['findBy']));return{'code':0xc8,'result':_0x8b7a('0x166')};}};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x168')]=function(_0x5628d9){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x169'),_0x5628d9['label']));if(!this[_0x8b7a('0x8e')](_0x5628d9['operation'])){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x5628d9,'no\x20operation\x20configured');}this[_0x8b7a('0x11')]['noop'](util[_0x8b7a('0x2b')](_0x8b7a('0x16a'),_0x5628d9['operation']));var _0x578308=eval(_0x5628d9[_0x8b7a('0x16b')]);if(!this['isConfigured'](_0x5628d9[_0x8b7a('0xde')])){return this['channel'][_0x8b7a('0xb2')](_0x8b7a('0xdf'));}var _0x25367d=this[_0x8b7a('0x14')][_0x8b7a('0x78')](this,_0x5628d9[_0x8b7a('0xde')]);if(!_0x25367d){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x5628d9,'no\x20variable\x20found');}if(_[_0x8b7a('0xa4')](_0x578308)){var _0x35e6ca=this;_0x578308[_0x8b7a('0xe0')](function(_0x228eb6,_0x3ddb6d){_0x35e6ca[_0x8b7a('0x11')][_0x8b7a('0xac')](util[_0x8b7a('0x2b')](_0x8b7a('0x16c'),_0x25367d,_0x3ddb6d),_0x228eb6);});return this[_0x8b7a('0x11')]['noop'](util[_0x8b7a('0x2b')]('variable\x20%s[key]\x20set',_0x25367d));}else{return this[_0x8b7a('0x11')][_0x8b7a('0xac')](_0x25367d,_0x578308);}};AGIVertices['prototype'][_0x8b7a('0xe')]=function(_0x5ce680){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x16d'),_0x5ce680[_0x8b7a('0x37')]));if(_0x5ce680[_0x8b7a('0xb0')]===0x0){return this[_0x8b7a('0xae')](_0x5ce680);}_0x5ce680[_0x8b7a('0xb0')]-=0x1;if(!this[_0x8b7a('0x8e')](_0x5ce680['file_id'])){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x5ce680,_0x8b7a('0x11b'));}var _0x5a7d89=this[_0x8b7a('0x16e')][_0x8b7a('0x78')](this,_0x5ce680[_0x8b7a('0x11a')]);if(!_0x5a7d89){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x5ce680,_0x8b7a('0x11c'));}var _0xc5fc3e=this[_0x8b7a('0x11')]['getData'](_0x5a7d89,_0x5ce680[_0x8b7a('0x11e')],_0x5ce680['digit']);var _0x26537e=_0xc5fc3e['result'];if(_0xc5fc3e[_0x8b7a('0xaa')]===-0x1){this[_0x8b7a('0xaf')][_0x8b7a('0x78')](this,_0x5ce680,'-1');return _0xc5fc3e;}else if(_0xc5fc3e[_0x8b7a('0xad')]===_0x8b7a('0x6d')){_0xc5fc3e['result']=_0xc5fc3e[_0x8b7a('0xaa')]['length']>0x0?_0xc5fc3e[_0x8b7a('0xaa')]:'t';}else if(_[_0x8b7a('0x43')](_0xc5fc3e[_0x8b7a('0xaa')])){_0xc5fc3e[_0x8b7a('0xaa')]='#';_0x26537e='#';}if(!this['isConfigured'](_0x5ce680['variable_id'])){this['channel'][_0x8b7a('0xb2')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x14c76d=this[_0x8b7a('0x14')][_0x8b7a('0x78')](this,_0x5ce680[_0x8b7a('0xde')]);if(!_0x14c76d){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x5ce680,_0x8b7a('0x123'));}this['channel'][_0x8b7a('0xac')](_0x14c76d,_0x26537e);}this['createSquareDetailsReport'][_0x8b7a('0x78')](this,_0x5ce680,_0x26537e);return _0xc5fc3e;};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0xb2')]=function(_0x5d0816){logger['info'](util[_0x8b7a('0x2b')](_0x8b7a('0x16f'),_0x5d0816[_0x8b7a('0x37')]));return this[_0x8b7a('0x11')]['noop'](_0x5d0816[_0x8b7a('0x170')]||_0x5d0816[_0x8b7a('0x37')]);};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x171')]=function(_0x4affca){logger[_0x8b7a('0x30')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x4affca['label']));if(!this[_0x8b7a('0x8e')](_0x4affca[_0x8b7a('0x162')])){return this[_0x8b7a('0x11')]['error'](_0x4affca,_0x8b7a('0x167'));}logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x172'),this[_0x8b7a('0x11')]['callerid'],_0x4affca[_0x8b7a('0x162')]));var _0x18df1c=this[_0x8b7a('0x54')]['sync'](this,_0x4affca[_0x8b7a('0x173')]);var _0x3c350b=this['agentPause'][_0x8b7a('0x78')](this,_0x4affca[_0x8b7a('0x162')],_0x18df1c);if(_0x3c350b){logger['info'](util[_0x8b7a('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8b7a('0x11')][_0x8b7a('0x39')],_0x4affca['findBy']));this['channel'][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x163'),this[_0x8b7a('0x11')]['callerid'],_0x4affca[_0x8b7a('0x162')]));return{'code':0xc8,'result':_0x8b7a('0x164')};}else{logger[_0x8b7a('0x30')](util['format'](_0x8b7a('0x165'),this[_0x8b7a('0x11')]['callerid'],_0x4affca[_0x8b7a('0x162')]));this['channel'][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x163'),this['channel'][_0x8b7a('0x39')],_0x4affca[_0x8b7a('0x162')]));return{'code':0xc8,'result':_0x8b7a('0x166')};}};AGIVertices['prototype'][_0x8b7a('0x174')]=function(_0xe9c89b){logger[_0x8b7a('0x30')](util['format'](_0x8b7a('0x175'),_0xe9c89b[_0x8b7a('0x37')]));if(!this[_0x8b7a('0x8e')](_0xe9c89b[_0x8b7a('0x11a')])){return this[_0x8b7a('0x11')]['error'](_0xe9c89b,_0x8b7a('0x11b'));}var _0x1320a3=this['getSound'][_0x8b7a('0x78')](this,_0xe9c89b[_0x8b7a('0x11a')]);if(!_0x1320a3){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0xe9c89b,'no\x20file\x20audio\x20found');}var _0x5e891a=this[_0x8b7a('0x11')][_0x8b7a('0x5f')](_0x8b7a('0x176'),[_0x1320a3,_0xe9c89b[_0x8b7a('0x117')]]);if(_0x5e891a[_0x8b7a('0xaa')]===-0x1){return _0x5e891a;}return this['channel']['noop'](util[_0x8b7a('0x2b')]('Executed\x20command\x20%s\x20%s',_0x8b7a('0x176'),_0x1320a3));};AGIVertices[_0x8b7a('0x13')]['queue']=function(_0x554cba){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x177'),_0x554cba['label']));if(!this[_0x8b7a('0x8e')](_0x554cba[_0x8b7a('0x178')])){return this[_0x8b7a('0x11')]['error'](_0x554cba,_0x8b7a('0x179'));}var _0x22d661='';var _0x432ad4=parseInt(_0x554cba['queue_id'],0xa);if(isNaN(_0x432ad4)){_0x22d661=_0x554cba[_0x8b7a('0x178')];}else{_0x22d661=this[_0x8b7a('0x17a')]['sync'](this,_0x554cba[_0x8b7a('0x178')]);if(!_0x22d661){return this['channel'][_0x8b7a('0x2d')](_0x554cba,_0x8b7a('0x17b'));}}var _0x40450e='';if(this[_0x8b7a('0x8e')](_0x554cba[_0x8b7a('0x11a')])){var _0xf6427d=this[_0x8b7a('0x16e')][_0x8b7a('0x78')](this,_0x554cba[_0x8b7a('0x11a')]);if(_0xf6427d){_0x40450e=_0xf6427d;}}this['createSquareDetailsReport'][_0x8b7a('0x78')](this,_0x554cba,_0x22d661);if(_0x554cba[_0x8b7a('0x117')][_0x8b7a('0x17c')]('x')<0x0){_0x554cba[_0x8b7a('0x117')]+='x';}if(_0x554cba[_0x8b7a('0x117')][_0x8b7a('0x17c')]('X')<0x0){_0x554cba[_0x8b7a('0x117')]+='X';}this['channel'][_0x8b7a('0xac')]('XMCS-QUEUE',_0x22d661?_0x22d661[_0x8b7a('0x17d')]():'');var _0x50ba26=this[_0x8b7a('0x11')][_0x8b7a('0x5f')](_0x8b7a('0x17e'),[_0x22d661,_0x554cba[_0x8b7a('0x117')],_0x554cba[_0x8b7a('0x6b')],_0x40450e,_0x554cba[_0x8b7a('0x6d')],_0x554cba['agi'],_0x554cba[_0x8b7a('0x17f')],_0x554cba[_0x8b7a('0x180')],'',_0x554cba[_0x8b7a('0x181')]]);if(_0x50ba26[_0x8b7a('0xaa')]===-0x1){return _0x50ba26;}return this[_0x8b7a('0x11')]['noop'](util['format'](_0x8b7a('0xc9'),'QUEUE',_0x22d661));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x182')]=function(_0xe2336f){logger[_0x8b7a('0x30')](util['format'](_0x8b7a('0x183'),_0xe2336f['label']));var _0x161d53=_0xe2336f[_0x8b7a('0x184')]||_0x8b7a('0x13c');var _0x5432b2=util[_0x8b7a('0x2b')](_0x8b7a('0x185'),this[_0x8b7a('0x11')][_0x8b7a('0x36')],rs['generate'](0x5));var _0x13dbc8=util[_0x8b7a('0x2b')]('%s/recordings/%s.%s',FILES_PATH,_0x5432b2,_0x161d53);var _0xd82dac=util[_0x8b7a('0x2b')](_0x8b7a('0x13d'),FILES_PATH,_0x5432b2);this[_0x8b7a('0x3a')][_0x8b7a('0x78')](this,_0xe2336f,_0x5432b2,_0x13dbc8);this['channel'][_0x8b7a('0xac')](_0x8b7a('0x186'),_0x5432b2);logger['info'](_0x8b7a('0x187'),_0xd82dac,_0x161d53,_0xe2336f[_0x8b7a('0x188')],_0xe2336f[_0x8b7a('0x6d')]);return this[_0x8b7a('0x11')][_0x8b7a('0x189')](_0xd82dac,_0x161d53,_0xe2336f[_0x8b7a('0x188')],_0xe2336f[_0x8b7a('0x6d')],undefined,!![]);};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x18a')]=function(_0x1b3446){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x1b3446[_0x8b7a('0x37')]));if(!this[_0x8b7a('0x8e')](_0x1b3446[_0x8b7a('0x6b')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0x18b'));}var _0x191795=this[_0x8b7a('0x6a')][_0x8b7a('0x78')](this,_0x1b3446);logger['info'](util['format'](_0x8b7a('0x18c'),util[_0x8b7a('0x18d')](_0x191795,{'showHidden':![],'depth':null})));if(!this[_0x8b7a('0x8e')](_0x1b3446[_0x8b7a('0xde')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0x18e'));}var _0x564b20=this['getVariable'][_0x8b7a('0x78')](this,_0x1b3446[_0x8b7a('0xde')]);if(!_0x564b20){return this[_0x8b7a('0x11')]['error'](_0x1b3446,'no\x20variable\x20found');}this['channel'][_0x8b7a('0xac')](util['format'](_0x8b7a('0x18f'),_0x564b20),_0x191795[_0x8b7a('0x7d')]?_0x191795['statusCode']:'200');this[_0x8b7a('0x11')][_0x8b7a('0xac')](util[_0x8b7a('0x2b')](_0x8b7a('0x190'),_0x564b20),_0x191795[_0x8b7a('0x7e')]?_0x191795[_0x8b7a('0x7e')]:'OK');if(_0x191795[_0x8b7a('0x72')]){try{this[_0x8b7a('0xa6')](_0x191795['body'],_0x564b20);}catch(_0x47fe5f){logger[_0x8b7a('0x2d')](util[_0x8b7a('0x2b')](_0x8b7a('0x191'),_0x564b20));}}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0xe4'),_0x564b20));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x192')]=function(_0x206fd9){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x193'),_0x206fd9['label']));return this[_0x8b7a('0x11')][_0x8b7a('0x194')](_0x206fd9[_0x8b7a('0x195')][_0x8b7a('0xdc')](/\s+/g,''),_0x206fd9['escape_digits']);};AGIVertices['prototype'][_0x8b7a('0x196')]=function(_0x1004fe){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x197'),_0x1004fe['label']));return this[_0x8b7a('0x11')][_0x8b7a('0x198')](_0x1004fe[_0x8b7a('0x199')]['replace'](/\s+/g,''),_0x1004fe[_0x8b7a('0x188')]);};AGIVertices[_0x8b7a('0x13')]['sayphonetic']=function(_0x53be4a){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x19a'),_0x53be4a[_0x8b7a('0x37')]));return this['channel'][_0x8b7a('0x19b')](_0x53be4a[_0x8b7a('0x62')],_0x53be4a[_0x8b7a('0x188')]);};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x19c')]=function(_0x47dd79){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x19d'),_0x47dd79[_0x8b7a('0x37')]));if(!this[_0x8b7a('0x8e')](_0x47dd79[_0x8b7a('0x19e')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')]('no\x20mail\x20account\x20configured');}var _0x43f674=this[_0x8b7a('0x20')][_0x8b7a('0x78')](this,_0x47dd79[_0x8b7a('0x19e')]);if(!_0x43f674||!_0x43f674['Smtp']){return this[_0x8b7a('0x11')]['error'](_0x47dd79,'no\x20mail\x20account\x20found');}var _0x3e0249={'from':util[_0x8b7a('0x2b')](_0x8b7a('0x19f'),_0x43f674[_0x8b7a('0x16')],_0x43f674[_0x8b7a('0x1a0')]||_0x43f674[_0x8b7a('0x1a1')]['user']),'to':_0x47dd79['to']||'','cc':_0x47dd79['cc']||'','bcc':_0x47dd79['bcc']||'','subject':_0x47dd79[_0x8b7a('0x1a2')],'html':_0x47dd79[_0x8b7a('0x62')],'text':_0x47dd79['text']};var _0x1006c9={'tls':{'rejectUnauthorized':![]}};if(_0x43f674['Smtp'][_0x8b7a('0x1a3')]){_0x1006c9['service']=_0x43f674['Smtp'][_0x8b7a('0x1a3')];}else{_0x1006c9[_0x8b7a('0x1a4')]=_0x43f674['Smtp'][_0x8b7a('0x1a4')];_0x1006c9[_0x8b7a('0x1a5')]=_0x43f674[_0x8b7a('0x1a1')][_0x8b7a('0x1a5')];_0x1006c9[_0x8b7a('0x1a6')]=_0x43f674[_0x8b7a('0x1a1')][_0x8b7a('0x1a6')];}if(_0x43f674[_0x8b7a('0x1a1')][_0x8b7a('0x1a7')]){_0x1006c9[_0x8b7a('0x1a8')]={'user':_0x43f674[_0x8b7a('0x1a1')][_0x8b7a('0x1a9')],'pass':_0x43f674[_0x8b7a('0x1a1')][_0x8b7a('0x1aa')]};}if(this['isConfigured'](_0x47dd79[_0x8b7a('0x1ab')])){}logger[_0x8b7a('0x1ac')](_0x8b7a('0x1ad'),JSON[_0x8b7a('0x7b')](_0x3e0249));this['createSquareDetailsReport'][_0x8b7a('0x78')](this,_0x47dd79,_0x47dd79[_0x8b7a('0x19e')]);this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x1ae'),_0x43f674[_0x8b7a('0x16')]));this['sendMailMessage'][_0x8b7a('0x78')](this,_0x1006c9,_0x3e0249);return this['channel'][_0x8b7a('0xb2')](_0x8b7a('0x1af'));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x1b0')]=function(_0xdedf7d){logger[_0x8b7a('0x30')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0xdedf7d['label']));return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0x1b1'));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x1b2')]=function(_0x388f63){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x1b3'),_0x388f63['label']));if(!this[_0x8b7a('0x8e')](_0x388f63[_0x8b7a('0x1b4')])){return this['channel'][_0x8b7a('0xb2')](_0x8b7a('0x1b5'));}var _0x54584f=this[_0x8b7a('0x1b6')]['sync'](this,_0x388f63[_0x8b7a('0x1b4')]);if(!_0x54584f){return this['channel'][_0x8b7a('0x2d')](_0x388f63,_0x8b7a('0x1b7'));}var _0x2ad79f={'body':_0x388f63[_0x8b7a('0x1b8')],'phone':_0x388f63['to']||'','SmsAccountId':_0x54584f['id']};logger[_0x8b7a('0x1ac')](_0x8b7a('0x1b9'),JSON[_0x8b7a('0x7b')](_0x2ad79f));this[_0x8b7a('0xaf')][_0x8b7a('0x78')](this,_0x388f63,_0x388f63['sms_account_id']);this['channel'][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x54584f[_0x8b7a('0x16')]));this['createSmsMessage'][_0x8b7a('0x78')](this,_0x2ad79f);return this[_0x8b7a('0x11')]['noop'](_0x8b7a('0x1ba'));};AGIVertices[_0x8b7a('0x13')]['set']=function(_0x5efd8a){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x5efd8a['label']));if(!this[_0x8b7a('0x8e')](_0x5efd8a['variable_id'])){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x5efd8a,_0x8b7a('0x1bb'));}var _0x20ee81=this[_0x8b7a('0x14')][_0x8b7a('0x78')](this,_0x5efd8a[_0x8b7a('0xde')]);if(!_0x20ee81){return this['channel'][_0x8b7a('0x2d')](_0x5efd8a,_0x8b7a('0x123'));}return this[_0x8b7a('0x11')][_0x8b7a('0xac')](_0x20ee81,_0x5efd8a[_0x8b7a('0x1bc')]);};AGIVertices[_0x8b7a('0x13')]['start']=function(_0x4e40b2){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x1bd'),_0x4e40b2[_0x8b7a('0x37')]));this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0x1be'));if(_0x4e40b2['answer']===_0x8b7a('0x1bf')){this[_0x8b7a('0x11')]['noop'](_0x8b7a('0x1c0'));return this[_0x8b7a('0x11')][_0x8b7a('0xc2')]();}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')]('Skipped\x20Answer');};AGIVertices[_0x8b7a('0x13')]['subproject']=function(_0x2dc84a){logger['info'](util[_0x8b7a('0x2b')](_0x8b7a('0x1c1'),_0x2dc84a[_0x8b7a('0x37')]));if(!this[_0x8b7a('0x8e')](_0x2dc84a[_0x8b7a('0x1c2')])){return this['channel'][_0x8b7a('0x2d')](_0x2dc84a,_0x8b7a('0x1c3'));}var _0xbc4cb5=this['getSquareProject']['sync'](this,_0x2dc84a[_0x8b7a('0x1c2')]);if(!this[_0x8b7a('0x8e')](_0xbc4cb5)){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x2dc84a,util[_0x8b7a('0x2b')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2dc84a['project_id']));}if(_0xbc4cb5===this[_0x8b7a('0x11')][_0x8b7a('0x38')]){return this['channel']['error'](_0x2dc84a,_0x8b7a('0x1c4'));}this[_0x8b7a('0xaf')][_0x8b7a('0x78')](this,_0x2dc84a,_0xbc4cb5);var _0x3660f1=this[_0x8b7a('0x11')][_0x8b7a('0x5f')](_0x8b7a('0x1c5'),util['format'](_0x8b7a('0x1c6'),config[_0x8b7a('0x7')]['host']||_0x8b7a('0x1c7'),_0xbc4cb5,this[_0x8b7a('0x11')][_0x8b7a('0x38')]));if(_0x3660f1[_0x8b7a('0xaa')]===-0x1){return _0x3660f1;}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')]('Executed\x20command\x20%s\x20%s','AGI',_0xbc4cb5));};AGIVertices['prototype'][_0x8b7a('0x1c8')]=function(_0x247b73){logger[_0x8b7a('0x30')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x247b73[_0x8b7a('0x37')]));var _0x1366cc=this['shellCommand'][_0x8b7a('0x78')](this,_0x247b73['command']);this[_0x8b7a('0xaf')][_0x8b7a('0x78')](this,_0x247b73,_0x247b73[_0x8b7a('0xc1')]);if(this[_0x8b7a('0x8e')](_0x247b73[_0x8b7a('0xde')])){var _0x14eb6a=this[_0x8b7a('0x14')][_0x8b7a('0x78')](this,_0x247b73[_0x8b7a('0xde')]);if(_0x14eb6a){this[_0x8b7a('0x11')][_0x8b7a('0xac')](_0x14eb6a,_0x1366cc);return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x1c9'),_0x247b73[_0x8b7a('0xc1')],_0x14eb6a));}}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util['format'](_0x8b7a('0x1ca'),_0x247b73['command']));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x1cb')]=function(_0x3e4436){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x1cc'),_0x3e4436[_0x8b7a('0x37')]));_0x3e4436['text']=_0x3e4436[_0x8b7a('0x62')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8b7a('0x8e')](_0x3e4436[_0x8b7a('0x1cd')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0x1ce'));}if(!this['isConfigured'](_0x3e4436[_0x8b7a('0x62')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0xb3'));}this['channel']['noop'](util['format'](_0x8b7a('0x1cf'),_0x3e4436[_0x8b7a('0x62')]));var _0x110a4b=this[_0x8b7a('0x61')][_0x8b7a('0x78')](this,_0x3e4436);if(_0x110a4b){this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x1d0'),_0x110a4b));var _0xbcac71=this[_0x8b7a('0x11')]['streamFile'](_0x110a4b);try{fs[_0x8b7a('0x131')](_0x110a4b+_0x8b7a('0x10c'));}catch(_0x3fa184){logger[_0x8b7a('0x2d')](_0x3fa184);}return _0xbcac71;}return this['channel'][_0x8b7a('0x2d')](_0x3e4436,_0x8b7a('0x1d1'));};AGIVertices['prototype'][_0x8b7a('0x1d2')]=function(_0x52b4d1){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x1d3'),_0x52b4d1[_0x8b7a('0x37')]));_0x52b4d1[_0x8b7a('0x62')]=_0x52b4d1['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8b7a('0x8e')](_0x52b4d1[_0x8b7a('0x62')])){return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](_0x8b7a('0xb3'));}this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')]('Trying\x20Google\x20TTS\x20%s',_0x52b4d1[_0x8b7a('0x62')]));var _0xd6950e=this[_0x8b7a('0x68')]['sync'](this,_0x52b4d1);if(_0xd6950e){this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x1d4'),_0xd6950e));var _0x3f7c52=this[_0x8b7a('0x11')][_0x8b7a('0x10b')](_0xd6950e);try{fs['unlink'](_0xd6950e+_0x8b7a('0x10c'));}catch(_0x4d7bb3){logger['error'](_0x4d7bb3);}return _0x3f7c52;}return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x52b4d1,_0x8b7a('0x1d5'));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x1d6')]=function(_0x2e43ed){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x1d7'),_0x2e43ed[_0x8b7a('0x37')]));if(!this['isConfigured'](_0x2e43ed[_0x8b7a('0x162')])){return this[_0x8b7a('0x11')]['error'](_0x2e43ed,_0x8b7a('0x167'));}logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x8b7a('0x39')],_0x2e43ed[_0x8b7a('0x162')]));var _0x46f746=this[_0x8b7a('0x57')][_0x8b7a('0x78')](this,_0x2e43ed[_0x8b7a('0x162')]);if(_0x46f746){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8b7a('0x11')][_0x8b7a('0x39')],_0x2e43ed[_0x8b7a('0x162')]));this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')](_0x8b7a('0x163'),this[_0x8b7a('0x11')][_0x8b7a('0x39')],_0x2e43ed['findBy']));return{'code':0xc8,'result':_0x8b7a('0x164')};}else{logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x165'),this[_0x8b7a('0x11')][_0x8b7a('0x39')],_0x2e43ed['findBy']));this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x2e43ed[_0x8b7a('0x162')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x1d8')]=function(_0x11ae26){logger[_0x8b7a('0x30')](util['format'](_0x8b7a('0x1d9'),_0x11ae26[_0x8b7a('0x37')]));var _0x139766=this['channel'][_0x8b7a('0x5f')](_0x8b7a('0x1da'),[_0x11ae26[_0x8b7a('0x1db')],_0x11ae26[_0x8b7a('0x81')]]);if(_0x139766[_0x8b7a('0xaa')]===-0x1){return _0x139766;}return this[_0x8b7a('0x11')][_0x8b7a('0xb2')](util[_0x8b7a('0x2b')]('Executed\x20command\x20%s\x20%s',_0x8b7a('0x1da'),_0x11ae26[_0x8b7a('0x1db')]));};AGIVertices[_0x8b7a('0x13')][_0x8b7a('0x1dc')]=function(_0x18dcad){logger[_0x8b7a('0x30')](util[_0x8b7a('0x2b')](_0x8b7a('0x1dd'),_0x18dcad['label']));if(!this[_0x8b7a('0x8e')](_0x18dcad[_0x8b7a('0xde')])){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x18dcad,'no\x20variable\x20selected');}var _0x54fd0b=this[_0x8b7a('0x14')][_0x8b7a('0x78')](this,_0x18dcad['variable_id']);if(!_0x54fd0b){return this[_0x8b7a('0x11')][_0x8b7a('0x2d')](_0x18dcad,_0x8b7a('0x123'));}var _0x4cb3b5=this[_0x8b7a('0x11')][_0x8b7a('0x14')](_0x54fd0b);return{'code':0xc8,'result':_0x4cb3b5[_0x8b7a('0xad')]?_0x4cb3b5[_0x8b7a('0xad')]:'-'};};String[_0x8b7a('0x13')][_0x8b7a('0x1de')]=function(_0x25655e,_0x4d5181){return this[_0x8b7a('0xa8')](_0x25655e)[_0x8b7a('0x1df')](_0x4d5181);};module[_0x8b7a('0x1e0')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index bdce5f7..1fc52a3 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 _0x948e=['mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','syncHangupRequest','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition'];(function(_0x449030,_0x57ef95){var _0x5c6de2=function(_0x32241b){while(--_0x32241b){_0x449030['push'](_0x449030['shift']());}};_0x5c6de2(++_0x57ef95);}(_0x948e,0xf3));var _0xe948=function(_0x23d3fb,_0x13ea0a){_0x23d3fb=_0x23d3fb-0x0;var _0x309dc9=_0x948e[_0x23d3fb];return _0x309dc9;};'use strict';var util=require('util');var _=require(_0xe948('0x0'));var moment=require(_0xe948('0x1'));var ami=require(_0xe948('0x2'));var logger=require('../../../config/logger')(_0xe948('0x3'));var RpcUser=require(_0xe948('0x4'));var RpcVoiceAgentReport=require(_0xe948('0x5'));function Acw(_0x52d2a3){this[_0xe948('0x6')]=_0x52d2a3[_0xe948('0x6')];this['agents']=_0x52d2a3[_0xe948('0x7')];this[_0xe948('0x8')]=_0x52d2a3['timers'];this[_0xe948('0x9')]={};ami['on'](_0xe948('0xa'),this[_0xe948('0xb')][_0xe948('0xc')](this));ami['on'](_0xe948('0xd'),this['syncHangupRequest'][_0xe948('0xc')](this));ami['on'](_0xe948('0xe'),this['syncHangup'][_0xe948('0xc')](this));ami['on'](_0xe948('0xf'),this['syncAgentRingNoAnswer'][_0xe948('0xc')](this));ami['on'](_0xe948('0x10'),this[_0xe948('0x11')][_0xe948('0xc')](this));ami['on'](_0xe948('0x12'),this[_0xe948('0x13')][_0xe948('0xc')](this));ami['on'](_0xe948('0x14'),this[_0xe948('0x15')][_0xe948('0xc')](this));}function getDiff(_0x552e08){var _0x22847c=moment()['milliseconds'](0x0);var _0x36f877=moment(_0x552e08)[_0xe948('0x16')](0x0);return _0x22847c['diff'](_0x36f877,_0xe948('0x17'));}Acw[_0xe948('0x18')][_0xe948('0x19')]=function(_0x1c5137){try{var _0x1c9acf=this;var _0x32f759=this['channels'][_0x1c5137][_0xe948('0x1a')];var _0x2d18bd=this[_0xe948('0x9')][_0x1c5137][_0xe948('0x1b')];var _0x492c40=this[_0xe948('0x6')][_0x2d18bd];var _0x33a5ad=![];var _0x216e19=_0xe948('0x1c');if(_0x492c40[_0xe948('0x1d')]){if(_0x492c40[_0xe948('0x1e')][_0xe948('0x1f')]){_0x33a5ad=!![];_0x216e19=_0x492c40[_0xe948('0x1e')]['name'];}}ami['Action']({'action':_0xe948('0x20'),'interface':_0x32f759,'paused':!![],'reason':_0x216e19})[_0xe948('0x21')](function(_0x5364d8){if(_0x1c9acf[_0xe948('0x7')][_0x32f759]){return RpcUser[_0xe948('0x22')](_0x1c9acf[_0xe948('0x7')][_0x32f759]['id'])['then'](function(_0x59d508){if(_0x59d508&&!_0x59d508[_0xe948('0x23')]){logger[_0xe948('0x24')](_0xe948('0x25'),_0x1c5137,_0x32f759,_0x2d18bd);var _0x5b6257=_0x1c9acf[_0xe948('0x9')][_0x1c5137][_0xe948('0x26')]&&_0x1c9acf['channels'][_0x1c5137][_0xe948('0x27')]?_0x1c9acf[_0xe948('0x9')][_0x1c5137][_0xe948('0x27')]:_0x1c5137;return RpcUser[_0xe948('0x28')](_0x1c9acf[_0xe948('0x7')][_0x32f759],_0x216e19,_0x5b6257)[_0xe948('0x21')](function(_0x2def54){if(!_0x33a5ad){_0x1c9acf[_0xe948('0x8')][_0x32f759]={};logger['info'](_0xe948('0x29'),_0x1c5137,_0x1c9acf[_0xe948('0x6')][_0x2d18bd]['acwTimeout'],_0x32f759,_0x2d18bd);_0x1c9acf['timers'][_0x32f759][_0xe948('0x2a')]=setTimeout(_0x1c9acf['stopAcw'][_0xe948('0xc')](_0x1c9acf,_0x32f759),_0x1c9acf[_0xe948('0x6')][_0x2d18bd][_0xe948('0x2b')]*0x3e8);_0x1c9acf[_0xe948('0x8')][_0x32f759][_0xe948('0x2c')]=moment()[_0xe948('0x2d')](_0xe948('0x2e'));_0x1c9acf[_0xe948('0x8')][_0x32f759]['uniqueid']=_0x1c5137;_0x1c9acf[_0xe948('0x8')][_0x32f759]['queue']=_0x2d18bd;_0x1c9acf['timers'][_0x32f759][_0xe948('0x2f')]=function(){var _0x5dd899=getDiff(_0x1c9acf[_0xe948('0x8')][_0x32f759][_0xe948('0x2c')]);clearTimeout(_0x1c9acf['timers'][_0x32f759]['timer']);_0x1c9acf[_0xe948('0x8')][_0x32f759][_0xe948('0x2a')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x5dd899},_0x1c9acf[_0xe948('0x8')][_0x32f759][_0xe948('0x30')],_0x32f759)[_0xe948('0x21')](function(_0x2acbcd){logger[_0xe948('0x24')](_0xe948('0x31'),_0x1c5137,_0x5dd899,_0x2acbcd);})[_0xe948('0x32')](function(_0x43615a){logger['error'](_0xe948('0x33'),_0x1c5137,_0x43615a);});delete _0x1c9acf[_0xe948('0x8')][_0x32f759];};}});}else{logger[_0xe948('0x24')](_0xe948('0x34'),_0x1c5137,_0x32f759,_0x2d18bd);}});}})[_0xe948('0x32')](function(_0x1f9787){logger[_0xe948('0x35')](_0xe948('0x29'),_0x1c5137,_0x1c9acf['voiceQueues'][_0x2d18bd][_0xe948('0x2b')],_0x32f759,_0x2d18bd);})[_0xe948('0x36')](function(){delete _0x1c9acf[_0xe948('0x9')][_0x1c5137];});}catch(_0xb55857){logger['error'](_0xe948('0x37'),_0xb55857[_0xe948('0x38')]);}};Acw[_0xe948('0x18')]['stopAcw']=function(_0x585431){try{var _0x394b27=this;if(_0x394b27[_0xe948('0x8')][_0x585431]){_0x394b27[_0xe948('0x8')][_0x585431]['timer']=![];var _0x37c09e=_0x394b27[_0xe948('0x8')][_0x585431][_0xe948('0x30')];var _0x2347ea=_0x394b27['timers'][_0x585431][_0xe948('0x1b')];var _0x261fca=_0x394b27[_0xe948('0x6')][_0x2347ea][_0xe948('0x2b')];logger[_0xe948('0x24')]('[%s][TIMER][STOP][AGENT:%s]',_0x37c09e,_0x585431);RpcUser[_0xe948('0x39')](this['agents'][_0x585431]);RpcVoiceAgentReport['update']({'acwtime':_0x261fca,'agentacw':!![]},_0x37c09e,_0x585431)[_0xe948('0x21')](function(_0x99e53b){logger[_0xe948('0x24')](_0xe948('0x31'),_0x37c09e,_0x261fca,_0x99e53b);})[_0xe948('0x32')](function(_0x426bac){logger[_0xe948('0x35')](_0xe948('0x33'),_0x37c09e,_0x426bac);});}else{logger['error'](_0xe948('0x3a'),_0x585431);if(_0x394b27[_0xe948('0x8')]){logger[_0xe948('0x24')](_0xe948('0x3b'),JSON['stringify'](_0x394b27[_0xe948('0x8')]));}}}catch(_0x462ea0){logger[_0xe948('0x35')](_0xe948('0x3c'),_0x462ea0[_0xe948('0x38')]);}};Acw[_0xe948('0x18')]['syncAgentConnect']=function(_0x44f52f){try{if(this[_0xe948('0x6')][_0x44f52f['queue']]&&(this[_0xe948('0x6')][_0x44f52f['queue']][_0xe948('0x3')]||this[_0xe948('0x6')][_0x44f52f[_0xe948('0x1b')]][_0xe948('0x1d')])){if(this[_0xe948('0x7')][_0x44f52f['interface']]){this['channels'][_0x44f52f[_0xe948('0x30')]]={'queue':_0x44f52f[_0xe948('0x1b')],'interface':_0x44f52f[_0xe948('0x1a')],'destlinkedid':_0x44f52f[_0xe948('0x27')]};}}}catch(_0x123dec){logger[_0xe948('0x35')](_0xe948('0x3d'),_0x123dec[_0xe948('0x38')]);}};Acw[_0xe948('0x18')][_0xe948('0x15')]=function(_0x31b50b){try{if(this[_0xe948('0x6')][_0x31b50b[_0xe948('0x1b')]]&&(this[_0xe948('0x6')][_0x31b50b[_0xe948('0x1b')]][_0xe948('0x3')]||this[_0xe948('0x6')][_0x31b50b['queue']]['mandatoryDisposition'])){if(this[_0xe948('0x7')][_0x31b50b[_0xe948('0x1a')]]){this[_0xe948('0x9')][_0x31b50b['uniqueid']]={'queue':_0x31b50b[_0xe948('0x1b')],'interface':_0x31b50b[_0xe948('0x1a')]};}}}catch(_0xeb016f){logger[_0xe948('0x35')]('[ACW][syncAgentConnectPreview]\x20%s',_0xeb016f[_0xe948('0x38')]);}};Acw[_0xe948('0x18')][_0xe948('0x3e')]=function(_0x29bfd3){try{if(this[_0xe948('0x9')][_0x29bfd3['uniqueid']]&&_['isUndefined'](this[_0xe948('0x9')][_0x29bfd3[_0xe948('0x30')]][_0xe948('0x26')])){logger[_0xe948('0x24')](_0xe948('0x3f'),_0x29bfd3[_0xe948('0x30')]);this['startAcw'](_0x29bfd3[_0xe948('0x30')]);}else if(this[_0xe948('0x9')][_0x29bfd3[_0xe948('0x40')]]&&_[_0xe948('0x41')](this[_0xe948('0x9')][_0x29bfd3['linkedid']][_0xe948('0x26')])){logger[_0xe948('0x24')](_0xe948('0x42'),_0x29bfd3[_0xe948('0x40')]);this[_0xe948('0x19')](_0x29bfd3['linkedid']);}}catch(_0x1086ed){logger[_0xe948('0x35')](_0xe948('0x43'),_0x1086ed[_0xe948('0x38')]);}};Acw[_0xe948('0x18')][_0xe948('0x44')]=function(_0x5a67b9){try{if(this[_0xe948('0x9')][_0x5a67b9[_0xe948('0x30')]]&&this[_0xe948('0x9')][_0x5a67b9[_0xe948('0x30')]][_0xe948('0x26')]){logger['info'](_0xe948('0x45'),_0x5a67b9[_0xe948('0x30')]);this[_0xe948('0x19')](_0x5a67b9[_0xe948('0x30')]);}else if(this[_0xe948('0x9')][_0x5a67b9[_0xe948('0x40')]]&&this[_0xe948('0x9')][_0x5a67b9[_0xe948('0x40')]][_0xe948('0x26')]){logger[_0xe948('0x24')](_0xe948('0x46'),_0x5a67b9[_0xe948('0x40')]);this['startAcw'](_0x5a67b9[_0xe948('0x40')]);}}catch(_0xf60b4c){logger[_0xe948('0x35')](_0xe948('0x47'),_0xf60b4c[_0xe948('0x38')]);}};Acw['prototype'][_0xe948('0x11')]=function(_0x446b4e){try{if(!_[_0xe948('0x48')](this[_0xe948('0x9')][_0x446b4e[_0xe948('0x49')]])){this['startAcw'](_0x446b4e[_0xe948('0x49')]);if(this[_0xe948('0x9')][_0x446b4e[_0xe948('0x4a')]]){this['channels'][_0x446b4e['secondtransfereruniqueid']][_0xe948('0x26')]=!![];this[_0xe948('0x9')][_0x446b4e[_0xe948('0x4b')]]=this[_0xe948('0x9')][_0x446b4e[_0xe948('0x4a')]];delete this[_0xe948('0x9')][_0x446b4e['secondtransfereruniqueid']];}}else if(!_[_0xe948('0x48')](this[_0xe948('0x9')][_0x446b4e[_0xe948('0x4b')]])){this[_0xe948('0x19')](_0x446b4e[_0xe948('0x4b')]);if(this[_0xe948('0x9')][_0x446b4e['origtransfereruniqueid']]){this[_0xe948('0x9')][_0x446b4e[_0xe948('0x4c')]][_0xe948('0x26')]=!![];this[_0xe948('0x9')][_0x446b4e['transfereeuniqueid']]=this['channels'][_0x446b4e[_0xe948('0x4c')]];delete this['channels'][_0x446b4e[_0xe948('0x4c')]];}}}catch(_0x217a39){logger[_0xe948('0x35')](_0xe948('0x4d'),_0x217a39[_0xe948('0x38')]);}};Acw[_0xe948('0x18')][_0xe948('0x13')]=function(_0x24da0b){try{if(this[_0xe948('0x9')][_0x24da0b['transfereruniqueid']]){logger[_0xe948('0x24')](_0xe948('0x4e'),JSON[_0xe948('0x4f')](_0x24da0b[_0xe948('0x50')]));this[_0xe948('0x19')](_0x24da0b[_0xe948('0x50')]);}else if(this[_0xe948('0x9')][_0x24da0b[_0xe948('0x51')]]){logger['info'](_0xe948('0x52'),JSON[_0xe948('0x4f')](_0x24da0b[_0xe948('0x51')]));this[_0xe948('0x19')](_0x24da0b['transfererlinkedid']);}}catch(_0x59cee9){logger[_0xe948('0x35')](_0xe948('0x53'),_0x59cee9[_0xe948('0x38')]);}};Acw[_0xe948('0x18')][_0xe948('0x54')]=function(_0x5cd995){try{if(this[_0xe948('0x6')][_0x5cd995[_0xe948('0x1b')]]&&this[_0xe948('0x6')][_0x5cd995[_0xe948('0x1b')]][_0xe948('0x55')]===_0xe948('0x56')){if(this['agents'][_0x5cd995[_0xe948('0x1a')]]){logger[_0xe948('0x24')](_0xe948('0x57'),_0x5cd995[_0xe948('0x30')],_0x5cd995[_0xe948('0x1a')],_0x5cd995[_0xe948('0x1b')]);return RpcUser['savePause'](this[_0xe948('0x7')][_0x5cd995[_0xe948('0x1a')]],_0xe948('0x58'),_0x5cd995[_0xe948('0x30')]);}}}catch(_0x28b24f){logger[_0xe948('0x35')](_0xe948('0x59'),_0x28b24f[_0xe948('0x38')]);}};module[_0xe948('0x5a')]=Acw; \ No newline at end of file +var _0x264c=['[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','channels','interface','ACW','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition'];(function(_0x22c174,_0x535e3b){var _0x1cd3f6=function(_0x5da7a0){while(--_0x5da7a0){_0x22c174['push'](_0x22c174['shift']());}};_0x1cd3f6(++_0x535e3b);}(_0x264c,0x181));var _0xc264=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0x264c[_0x48ec91];return _0x22766c;};'use strict';var util=require(_0xc264('0x0'));var _=require(_0xc264('0x1'));var moment=require(_0xc264('0x2'));var ami=require('../ami');var logger=require(_0xc264('0x3'))(_0xc264('0x4'));var RpcUser=require(_0xc264('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x134e25){this[_0xc264('0x6')]=_0x134e25['voiceQueues'];this[_0xc264('0x7')]=_0x134e25[_0xc264('0x7')];this[_0xc264('0x8')]=_0x134e25[_0xc264('0x8')];this['channels']={};ami['on'](_0xc264('0x9'),this[_0xc264('0xa')][_0xc264('0xb')](this));ami['on'](_0xc264('0xc'),this[_0xc264('0xd')][_0xc264('0xb')](this));ami['on'](_0xc264('0xe'),this[_0xc264('0xf')]['bind'](this));ami['on'](_0xc264('0x10'),this[_0xc264('0x11')][_0xc264('0xb')](this));ami['on'](_0xc264('0x12'),this[_0xc264('0x13')][_0xc264('0xb')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xc264('0xb')](this));ami['on'](_0xc264('0x14'),this[_0xc264('0x15')][_0xc264('0xb')](this));}function getDiff(_0x522a57){var _0x424296=moment()['milliseconds'](0x0);var _0x40c42f=moment(_0x522a57)[_0xc264('0x16')](0x0);return _0x424296[_0xc264('0x17')](_0x40c42f,_0xc264('0x18'));}Acw[_0xc264('0x19')]['startAcw']=function(_0x53aab8){try{var _0x3723e4=this;var _0x74a0ed=this[_0xc264('0x1a')][_0x53aab8][_0xc264('0x1b')];var _0x521d85=this['channels'][_0x53aab8]['queue'];var _0x1ebf5a=this[_0xc264('0x6')][_0x521d85];var _0x210d8e=![];var _0x24bfd8=_0xc264('0x1c');if(_0x1ebf5a['mandatoryDisposition']){if(_0x1ebf5a[_0xc264('0x1d')][_0xc264('0x1e')]){_0x210d8e=!![];_0x24bfd8=_0x1ebf5a[_0xc264('0x1d')]['name'];}}ami['Action']({'action':_0xc264('0x1f'),'interface':_0x74a0ed,'paused':!![],'reason':_0x24bfd8})[_0xc264('0x20')](function(_0x397141){if(_0x3723e4[_0xc264('0x7')][_0x74a0ed]){return RpcUser[_0xc264('0x21')](_0x3723e4[_0xc264('0x7')][_0x74a0ed]['id'])[_0xc264('0x20')](function(_0x5d44f0){if(_0x5d44f0&&!_0x5d44f0[_0xc264('0x22')]){logger[_0xc264('0x23')](_0xc264('0x24'),_0x53aab8,_0x74a0ed,_0x521d85);var _0x2596e7=_0x3723e4[_0xc264('0x1a')][_0x53aab8][_0xc264('0x25')]&&_0x3723e4[_0xc264('0x1a')][_0x53aab8][_0xc264('0x26')]?_0x3723e4[_0xc264('0x1a')][_0x53aab8][_0xc264('0x26')]:_0x53aab8;return RpcUser[_0xc264('0x27')](_0x3723e4['agents'][_0x74a0ed],_0x24bfd8,_0x2596e7)[_0xc264('0x20')](function(_0x486edf){if(!_0x210d8e){_0x3723e4[_0xc264('0x8')][_0x74a0ed]={};logger[_0xc264('0x23')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x53aab8,_0x3723e4[_0xc264('0x6')][_0x521d85][_0xc264('0x28')],_0x74a0ed,_0x521d85);_0x3723e4[_0xc264('0x8')][_0x74a0ed][_0xc264('0x29')]=setTimeout(_0x3723e4[_0xc264('0x2a')][_0xc264('0xb')](_0x3723e4,_0x74a0ed),_0x3723e4[_0xc264('0x6')][_0x521d85]['acwTimeout']*0x3e8);_0x3723e4[_0xc264('0x8')][_0x74a0ed][_0xc264('0x2b')]=moment()[_0xc264('0x2c')](_0xc264('0x2d'));_0x3723e4['timers'][_0x74a0ed][_0xc264('0x2e')]=_0x53aab8;_0x3723e4['timers'][_0x74a0ed][_0xc264('0x2f')]=_0x521d85;_0x3723e4[_0xc264('0x8')][_0x74a0ed][_0xc264('0x30')]=function(){var _0x14a642=getDiff(_0x3723e4[_0xc264('0x8')][_0x74a0ed][_0xc264('0x2b')]);clearTimeout(_0x3723e4[_0xc264('0x8')][_0x74a0ed]['timer']);_0x3723e4[_0xc264('0x8')][_0x74a0ed]['timer']=![];RpcVoiceAgentReport[_0xc264('0x31')]({'acwtime':_0x14a642},_0x3723e4['timers'][_0x74a0ed][_0xc264('0x2e')],_0x74a0ed)[_0xc264('0x20')](function(_0x24f13c){logger[_0xc264('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x53aab8,_0x14a642,_0x24f13c);})[_0xc264('0x32')](function(_0x22deed){logger[_0xc264('0x33')](_0xc264('0x34'),_0x53aab8,_0x22deed);});delete _0x3723e4[_0xc264('0x8')][_0x74a0ed];};}});}else{logger[_0xc264('0x23')](_0xc264('0x35'),_0x53aab8,_0x74a0ed,_0x521d85);}});}})[_0xc264('0x32')](function(_0x12415a){logger[_0xc264('0x33')](_0xc264('0x36'),_0x53aab8,_0x3723e4[_0xc264('0x6')][_0x521d85][_0xc264('0x28')],_0x74a0ed,_0x521d85);})[_0xc264('0x37')](function(){delete _0x3723e4[_0xc264('0x1a')][_0x53aab8];});}catch(_0x21918f){logger['error'](_0xc264('0x38'),_0x21918f[_0xc264('0x39')]);}};Acw['prototype']['stopAcw']=function(_0x16ad8f){try{var _0x591246=this;if(_0x591246['timers'][_0x16ad8f]){_0x591246[_0xc264('0x8')][_0x16ad8f]['timer']=![];var _0x2b81a3=_0x591246[_0xc264('0x8')][_0x16ad8f]['uniqueid'];var _0x47da9c=_0x591246['timers'][_0x16ad8f][_0xc264('0x2f')];var _0x3489ea=_0x591246[_0xc264('0x6')][_0x47da9c][_0xc264('0x28')];logger[_0xc264('0x23')](_0xc264('0x3a'),_0x2b81a3,_0x16ad8f);RpcUser['saveUnpause'](this[_0xc264('0x7')][_0x16ad8f]);RpcVoiceAgentReport[_0xc264('0x31')]({'acwtime':_0x3489ea,'agentacw':!![]},_0x2b81a3,_0x16ad8f)[_0xc264('0x20')](function(_0x583fa6){logger[_0xc264('0x23')](_0xc264('0x3b'),_0x2b81a3,_0x3489ea,_0x583fa6);})['catch'](function(_0x4c7a3b){logger[_0xc264('0x33')](_0xc264('0x34'),_0x2b81a3,_0x4c7a3b);});}else{logger[_0xc264('0x33')](_0xc264('0x3c'),_0x16ad8f);if(_0x591246[_0xc264('0x8')]){logger[_0xc264('0x23')](_0xc264('0x3d'),JSON[_0xc264('0x3e')](_0x591246[_0xc264('0x8')]));}}}catch(_0x523bad){logger['error'](_0xc264('0x3f'),_0x523bad['message']);}};Acw['prototype']['syncAgentConnect']=function(_0x54b6b3){try{if(this[_0xc264('0x6')][_0x54b6b3[_0xc264('0x2f')]]&&(this['voiceQueues'][_0x54b6b3[_0xc264('0x2f')]][_0xc264('0x4')]||this[_0xc264('0x6')][_0x54b6b3[_0xc264('0x2f')]][_0xc264('0x40')])){if(this[_0xc264('0x7')][_0x54b6b3['interface']]){this[_0xc264('0x1a')][_0x54b6b3[_0xc264('0x2e')]]={'queue':_0x54b6b3[_0xc264('0x2f')],'interface':_0x54b6b3['interface'],'destlinkedid':_0x54b6b3[_0xc264('0x26')]};}}}catch(_0x4741b9){logger[_0xc264('0x33')](_0xc264('0x41'),_0x4741b9[_0xc264('0x39')]);}};Acw[_0xc264('0x19')][_0xc264('0x15')]=function(_0x5b6e05){try{if(this['voiceQueues'][_0x5b6e05[_0xc264('0x2f')]]&&(this[_0xc264('0x6')][_0x5b6e05[_0xc264('0x2f')]][_0xc264('0x4')]||this[_0xc264('0x6')][_0x5b6e05['queue']]['mandatoryDisposition'])){if(this[_0xc264('0x7')][_0x5b6e05[_0xc264('0x1b')]]){this[_0xc264('0x1a')][_0x5b6e05[_0xc264('0x2e')]]={'queue':_0x5b6e05[_0xc264('0x2f')],'interface':_0x5b6e05['interface']};}}}catch(_0x34e460){logger[_0xc264('0x33')](_0xc264('0x42'),_0x34e460[_0xc264('0x39')]);}};Acw[_0xc264('0x19')][_0xc264('0xd')]=function(_0x23160d){try{if(this['channels'][_0x23160d[_0xc264('0x2e')]]&&_[_0xc264('0x43')](this[_0xc264('0x1a')][_0x23160d[_0xc264('0x2e')]][_0xc264('0x25')])){logger[_0xc264('0x23')](_0xc264('0x44'),_0x23160d[_0xc264('0x2e')]);this[_0xc264('0x45')](_0x23160d[_0xc264('0x2e')]);}else if(this[_0xc264('0x1a')][_0x23160d[_0xc264('0x46')]]&&_[_0xc264('0x43')](this[_0xc264('0x1a')][_0x23160d['linkedid']][_0xc264('0x25')])){logger[_0xc264('0x23')]('[%s][HANGUP:LINKEDID]',_0x23160d['linkedid']);this['startAcw'](_0x23160d[_0xc264('0x46')]);}}catch(_0x13e7cd){logger[_0xc264('0x33')]('[ACW][syncHangupRequest]\x20%s',_0x13e7cd[_0xc264('0x39')]);}};Acw[_0xc264('0x19')][_0xc264('0xf')]=function(_0x18c11a){try{if(this[_0xc264('0x1a')][_0x18c11a[_0xc264('0x2e')]]&&this[_0xc264('0x1a')][_0x18c11a['uniqueid']]['attended']){logger[_0xc264('0x23')](_0xc264('0x47'),_0x18c11a['uniqueid']);this[_0xc264('0x45')](_0x18c11a[_0xc264('0x2e')]);}else if(this['channels'][_0x18c11a[_0xc264('0x46')]]&&this['channels'][_0x18c11a[_0xc264('0x46')]][_0xc264('0x25')]){logger[_0xc264('0x23')](_0xc264('0x48'),_0x18c11a[_0xc264('0x46')]);this[_0xc264('0x45')](_0x18c11a[_0xc264('0x46')]);}}catch(_0x30e5f7){logger[_0xc264('0x33')](_0xc264('0x49'),_0x30e5f7[_0xc264('0x39')]);}};Acw[_0xc264('0x19')][_0xc264('0x13')]=function(_0x3859a4){try{if(!_[_0xc264('0x4a')](this[_0xc264('0x1a')][_0x3859a4['transfereeuniqueid']])){this['startAcw'](_0x3859a4[_0xc264('0x4b')]);if(this['channels'][_0x3859a4[_0xc264('0x4c')]]){this[_0xc264('0x1a')][_0x3859a4[_0xc264('0x4c')]]['attended']=!![];this[_0xc264('0x1a')][_0x3859a4[_0xc264('0x4d')]]=this[_0xc264('0x1a')][_0x3859a4[_0xc264('0x4c')]];delete this['channels'][_0x3859a4[_0xc264('0x4c')]];}}else if(!_[_0xc264('0x4a')](this[_0xc264('0x1a')][_0x3859a4['transfertargetuniqueid']])){this[_0xc264('0x45')](_0x3859a4[_0xc264('0x4d')]);if(this['channels'][_0x3859a4[_0xc264('0x4e')]]){this[_0xc264('0x1a')][_0x3859a4[_0xc264('0x4e')]]['attended']=!![];this[_0xc264('0x1a')][_0x3859a4['transfereeuniqueid']]=this[_0xc264('0x1a')][_0x3859a4[_0xc264('0x4e')]];delete this['channels'][_0x3859a4[_0xc264('0x4e')]];}}}catch(_0x271273){logger[_0xc264('0x33')](_0xc264('0x4f'),_0x271273['message']);}};Acw[_0xc264('0x19')][_0xc264('0x50')]=function(_0x1f3d04){try{if(this[_0xc264('0x1a')][_0x1f3d04[_0xc264('0x51')]]){logger[_0xc264('0x23')](_0xc264('0x52'),JSON[_0xc264('0x3e')](_0x1f3d04['transfereruniqueid']));this['startAcw'](_0x1f3d04['transfereruniqueid']);}else if(this[_0xc264('0x1a')][_0x1f3d04[_0xc264('0x53')]]){logger['info'](_0xc264('0x54'),JSON[_0xc264('0x3e')](_0x1f3d04[_0xc264('0x53')]));this[_0xc264('0x45')](_0x1f3d04[_0xc264('0x53')]);}}catch(_0x34efc6){logger[_0xc264('0x33')]('[ACW][syncBlindTransfer]\x20%s',_0x34efc6[_0xc264('0x39')]);}};Acw[_0xc264('0x19')][_0xc264('0x11')]=function(_0x35d9a8){try{if(this[_0xc264('0x6')][_0x35d9a8[_0xc264('0x2f')]]&&this[_0xc264('0x6')][_0x35d9a8[_0xc264('0x2f')]]['autopause']===_0xc264('0x55')){if(this['agents'][_0x35d9a8[_0xc264('0x1b')]]){logger[_0xc264('0x23')](_0xc264('0x56'),_0x35d9a8[_0xc264('0x2e')],_0x35d9a8[_0xc264('0x1b')],_0x35d9a8[_0xc264('0x2f')]);return RpcUser[_0xc264('0x27')](this[_0xc264('0x7')][_0x35d9a8['interface']],_0xc264('0x57'),_0x35d9a8[_0xc264('0x2e')]);}}}catch(_0x5d4136){logger['error'](_0xc264('0x58'),_0x5d4136[_0xc264('0x39')]);}};module[_0xc264('0x59')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 057cf0c..b0a0238 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 _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x1891b0,_0x2a226d){var _0x3bfc99=function(_0x49c20c){while(--_0x49c20c){_0x1891b0['push'](_0x1891b0['shift']());}};_0x3bfc99(++_0x2a226d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb7e7[_0x1a36a5];return _0x746243;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file +var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x12d2f3,_0x4c5e20){var _0x7f9ee4=function(_0x24d478){while(--_0x24d478){_0x12d2f3['push'](_0x12d2f3['shift']());}};_0x7f9ee4(++_0x4c5e20);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index a8bcce8..63f03e5 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x112aa9,_0x51a391){var _0xebc169=function(_0x52ce81){while(--_0x52ce81){_0x112aa9['push'](_0x112aa9['shift']());}};_0xebc169(++_0x51a391);}(_0xb43b,0x1b2));var _0xbb43=function(_0x59a2f0,_0x42d754){_0x59a2f0=_0x59a2f0-0x0;var _0x2c9a21=_0xb43b[_0x59a2f0];return _0x2c9a21;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x336953,_0x1e4fb4){var _0x5476a6=function(_0x5cffe4){while(--_0x5cffe4){_0x336953['push'](_0x336953['shift']());}};_0x5476a6(++_0x1e4fb4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 46d8695..a6419d5 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 _0xb66d=['voiceQueue','uniqueid','name','phone','firstName','Contact','lastName','number','queue','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','util','lodash','moment','string','isNil'];(function(_0x4343ab,_0x5cd581){var _0x4ffb26=function(_0x3196f8){while(--_0x3196f8){_0x4343ab['push'](_0x4343ab['shift']());}};_0x4ffb26(++_0x5cd581);}(_0xb66d,0x1bd));var _0xdb66=function(_0x3e2f39,_0x52276d){_0x3e2f39=_0x3e2f39-0x0;var _0x1f915c=_0xb66d[_0x3e2f39];return _0x1f915c;};'use strict';var util=require(_0xdb66('0x0'));var _=require(_0xdb66('0x1'));var moment=require(_0xdb66('0x2'));function checkNameSurname(_0xf12d29,_0x49e1d1,_0x5a7be6){var _0x25cb7b='';if(!_['isNil'](_0x49e1d1)&&_0xdb66('0x3')===typeof _0x49e1d1){_0x25cb7b+=_0x49e1d1;}if(!_[_0xdb66('0x4')](_0x5a7be6)&&_0xdb66('0x3')===typeof _0x5a7be6){_0x25cb7b+='\x20'+_0x5a7be6;}if(_0x25cb7b!==''){return _0x25cb7b;}return _0xf12d29;}function Action(_0x4898d9,_0x1d7ca4,_0x244bec){this[_0xdb66('0x5')]=_0x4898d9;this[_0xdb66('0x6')]=_0x244bec||undefined;this[_0xdb66('0x7')]=checkNameSurname(_0x1d7ca4['Contact'][_0xdb66('0x8')],_0x1d7ca4['Contact'][_0xdb66('0x9')],_0x1d7ca4[_0xdb66('0xa')][_0xdb66('0xb')]);this[_0xdb66('0xc')]=_0x1d7ca4[_0xdb66('0xa')][_0xdb66('0x8')];this[_0xdb66('0xd')]=_0x4898d9[_0xdb66('0x7')];this[_0xdb66('0xe')]=_0x1d7ca4[_0xdb66('0xe')]||![];this[_0xdb66('0xf')]=_0x4898d9['type'];this['dialQueueTimeout']=_0x4898d9['dialQueueTimeout']||0x3;this[_0xdb66('0x10')]=_0x1d7ca4[_0xdb66('0x10')];this[_0xdb66('0x11')]=_0x1d7ca4['countbusyretry'];this[_0xdb66('0x12')]=_0x1d7ca4['countcongestionretry'];this[_0xdb66('0x13')]=_0x1d7ca4[_0xdb66('0x13')];this[_0xdb66('0x14')]=_0x1d7ca4['countnosuchnumberretry'];this[_0xdb66('0x15')]=_0x1d7ca4[_0xdb66('0x15')];this[_0xdb66('0x16')]=_0x1d7ca4['countabandonedretry'];this[_0xdb66('0x17')]=_0x1d7ca4[_0xdb66('0x17')];this[_0xdb66('0x18')]=_0x1d7ca4[_0xdb66('0x18')];this[_0xdb66('0x19')]=_0x1d7ca4[_0xdb66('0x19')];this[_0xdb66('0x1a')]=_0x1d7ca4[_0xdb66('0x1a')];this[_0xdb66('0x1b')]=_0x1d7ca4['UserId'];this['VoiceQueueId']=_0x1d7ca4[_0xdb66('0x1c')];this[_0xdb66('0x1d')]=_0x1d7ca4[_0xdb66('0x1d')];this[_0xdb66('0x1e')]=_0x1d7ca4['id'];this[_0xdb66('0x1f')]=_0x1d7ca4[_0xdb66('0xa')]['firstName']||'';this[_0xdb66('0x20')]=moment()[_0xdb66('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xdb66('0x22')]=_0x1d7ca4[_0xdb66('0x22')];this[_0xdb66('0x23')]=_0x1d7ca4[_0xdb66('0x23')];this[_0xdb66('0x24')]=_0x1d7ca4['callbackat'];this['recallme']=_0x1d7ca4['recallme'];this[_0xdb66('0x25')]='';this[_0xdb66('0x26')]='';}Action[_0xdb66('0x27')][_0xdb66('0x28')]=function(){return util[_0xdb66('0x21')](_0xdb66('0x29'),this[_0xdb66('0x7')],this[_0xdb66('0x5')][_0xdb66('0x2a')]>0x0?this['number'][_0xdb66('0x2b')](this[_0xdb66('0x5')][_0xdb66('0x2a')]):this['number']);};Action['prototype'][_0xdb66('0x2c')]=function(){return this[_0xdb66('0xd')];};module['exports']=Action; \ No newline at end of file +var _0x000f=['exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName','number','queue','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring'];(function(_0x52bcb3,_0x2736dd){var _0x106b67=function(_0x11717a){while(--_0x11717a){_0x52bcb3['push'](_0x52bcb3['shift']());}};_0x106b67(++_0x2736dd);}(_0x000f,0xad));var _0xf000=function(_0x272b31,_0x436bdc){_0x272b31=_0x272b31-0x0;var _0x2cb016=_0x000f[_0x272b31];return _0x2cb016;};'use strict';var util=require(_0xf000('0x0'));var _=require(_0xf000('0x1'));var moment=require(_0xf000('0x2'));function checkNameSurname(_0x3e866b,_0x3ab8dc,_0x1bded6){var _0x49aa42='';if(!_[_0xf000('0x3')](_0x3ab8dc)&&_0xf000('0x4')===typeof _0x3ab8dc){_0x49aa42+=_0x3ab8dc;}if(!_[_0xf000('0x3')](_0x1bded6)&&_0xf000('0x4')===typeof _0x1bded6){_0x49aa42+='\x20'+_0x1bded6;}if(_0x49aa42!==''){return _0x49aa42;}return _0x3e866b;}function Action(_0x3c0b6b,_0x43a0a5,_0x5a0e39){this[_0xf000('0x5')]=_0x3c0b6b;this[_0xf000('0x6')]=_0x5a0e39||undefined;this[_0xf000('0x7')]=checkNameSurname(_0x43a0a5[_0xf000('0x8')][_0xf000('0x9')],_0x43a0a5[_0xf000('0x8')]['firstName'],_0x43a0a5[_0xf000('0x8')][_0xf000('0xa')]);this[_0xf000('0xb')]=_0x43a0a5[_0xf000('0x8')][_0xf000('0x9')];this[_0xf000('0xc')]=_0x3c0b6b[_0xf000('0x7')];this['active']=_0x43a0a5['active']||![];this['type']=_0x3c0b6b['type'];this['dialQueueTimeout']=_0x3c0b6b[_0xf000('0xd')]||0x3;this[_0xf000('0xe')]=_0x43a0a5[_0xf000('0xe')];this[_0xf000('0xf')]=_0x43a0a5['countbusyretry'];this[_0xf000('0x10')]=_0x43a0a5[_0xf000('0x10')];this[_0xf000('0x11')]=_0x43a0a5[_0xf000('0x11')];this['countnosuchnumberretry']=_0x43a0a5['countnosuchnumberretry'];this[_0xf000('0x12')]=_0x43a0a5[_0xf000('0x12')];this[_0xf000('0x13')]=_0x43a0a5['countabandonedretry'];this[_0xf000('0x14')]=_0x43a0a5['countmachineretry'];this[_0xf000('0x15')]=_0x43a0a5[_0xf000('0x15')];this['ContactId']=_0x43a0a5['ContactId'];this['ListId']=_0x43a0a5[_0xf000('0x16')];this['UserId']=_0x43a0a5[_0xf000('0x17')];this[_0xf000('0x18')]=_0x43a0a5['VoiceQueueId'];this[_0xf000('0x19')]=_0x43a0a5['CampaignId'];this[_0xf000('0x1a')]=_0x43a0a5['id'];this[_0xf000('0x1b')]=_0x43a0a5['Contact'][_0xf000('0x1c')]||'';this['starttime']=moment()[_0xf000('0x1d')](_0xf000('0x1e'));this[_0xf000('0x1f')]=_0x43a0a5[_0xf000('0x1f')];this['callbackuniqueid']=_0x43a0a5[_0xf000('0x20')];this[_0xf000('0x21')]=_0x43a0a5[_0xf000('0x21')];this[_0xf000('0x22')]=_0x43a0a5['recallme'];this[_0xf000('0x23')]='';this[_0xf000('0x24')]='';}Action[_0xf000('0x25')][_0xf000('0x26')]=function(){return util[_0xf000('0x1d')](_0xf000('0x27'),this[_0xf000('0x7')],this[_0xf000('0x5')][_0xf000('0x28')]>0x0?this[_0xf000('0xb')][_0xf000('0x29')](this[_0xf000('0x5')][_0xf000('0x28')]):this[_0xf000('0xb')]);};Action[_0xf000('0x25')]['getQueue']=function(){return this['queue'];};module[_0xf000('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index fb7ec7e..4a1cb2a 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 _0xf963=['countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x22583f,_0x53427a){var _0x2c2a8c=function(_0x48676c){while(--_0x48676c){_0x22583f['push'](_0x22583f['shift']());}};_0x2c2a8c(++_0x53427a);}(_0xf963,0x13a));var _0x3f96=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf963[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0x3f96('0x0'));var _=require(_0x3f96('0x1'));var moment=require('moment');function getSeconds(_0x3cc217,_0x1fa2cd){var _0x4e6f3b=moment(_0x3cc217)[_0x3f96('0x2')](0x0);var _0x598dac=moment(_0x1fa2cd)[_0x3f96('0x2')](0x0);return _0x4e6f3b['diff'](_0x598dac,_0x3f96('0x3'));}function AgentComplete(_0x27188e,_0x276ef4){this[_0x3f96('0x4')]=0x4;this[_0x3f96('0x5')]=_0x3f96('0x6');this[_0x3f96('0x7')]=_0x27188e['scheduledat'];this[_0x3f96('0x8')]=_0x27188e['type'];this[_0x3f96('0x9')]=_0x27188e[_0x3f96('0x8')]===_0x3f96('0xa')?_0x3f96('0xb'):_0x27188e[_0x3f96('0x8')];this[_0x3f96('0xc')]=_0x27188e[_0x3f96('0xc')];this[_0x3f96('0xd')]=_0x27188e[_0x3f96('0xd')];this[_0x3f96('0xe')]=_0x27188e[_0x3f96('0xe')];this[_0x3f96('0xf')]=_0x27188e[_0x3f96('0xc')]+_0x27188e[_0x3f96('0xd')]+_0x27188e[_0x3f96('0xe')]+_0x27188e[_0x3f96('0x10')]+_0x27188e[_0x3f96('0x11')]+_0x27188e['countabandonedretry']+_0x27188e[_0x3f96('0x12')]+_0x27188e[_0x3f96('0x13')];this['countnosuchnumberretry']=_0x27188e[_0x3f96('0x10')];this[_0x3f96('0x11')]=_0x27188e['countdropretry'];this[_0x3f96('0x14')]=_0x27188e[_0x3f96('0x14')];this['countmachineretry']=_0x27188e[_0x3f96('0x12')];this[_0x3f96('0x13')]=_0x27188e[_0x3f96('0x13')];this['uniqueid']=_0x276ef4[_0x3f96('0x15')];this[_0x3f96('0x16')]=_0x27188e[_0x3f96('0x17')];this[_0x3f96('0x18')]=_0x27188e[_0x3f96('0x19')];this[_0x3f96('0x1a')]=_0x27188e['starttime'];this[_0x3f96('0x1b')]=_0x27188e['responsetime'];this[_0x3f96('0x1c')]=_0x27188e[_0x3f96('0x1c')];this[_0x3f96('0x1d')]=moment()[_0x3f96('0x1e')](_0x3f96('0x1f'));this[_0x3f96('0x20')]=getSeconds(_0x27188e[_0x3f96('0x1b')],_0x27188e[_0x3f96('0x1a')]);this['holdtime']=getSeconds(_0x27188e[_0x3f96('0x1c')],_0x27188e[_0x3f96('0x1b')]);this[_0x3f96('0x21')]=getSeconds(this[_0x3f96('0x1d')],_0x27188e[_0x3f96('0x1c')]);this[_0x3f96('0xb')]=_0x276ef4[_0x3f96('0xb')];this[_0x3f96('0x22')]=_0x276ef4['membername'];this[_0x3f96('0x23')]=_0x276ef4[_0x3f96('0x23')];this[_0x3f96('0x24')]=_0x27188e[_0x3f96('0x24')];this[_0x3f96('0x25')]=_0x27188e[_0x3f96('0x25')];this[_0x3f96('0x26')]=_0x27188e[_0x3f96('0x26')];this[_0x3f96('0x27')]=_0x27188e[_0x3f96('0x27')];this[_0x3f96('0x28')]=_0x27188e['ContactId'];this['ListId']=_0x27188e[_0x3f96('0x29')];this[_0x3f96('0x2a')]=_0x27188e[_0x3f96('0x2a')];this[_0x3f96('0x2b')]=_0x27188e[_0x3f96('0x2b')];this['CampaignId']=_0x27188e[_0x3f96('0x2c')];this[_0x3f96('0x2d')]=_0x27188e[_0x3f96('0x2d')]||'';this['originatecalleridname']=_0x27188e[_0x3f96('0x2e')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xdf89=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','outbound'];(function(_0x423549,_0x242e63){var _0xdcb104=function(_0x6bff59){while(--_0x6bff59){_0x423549['push'](_0x423549['shift']());}};_0xdcb104(++_0x242e63);}(_0xdf89,0x11c));var _0x9df8=function(_0x40d007,_0x1cad24){_0x40d007=_0x40d007-0x0;var _0x110fcf=_0xdf89[_0x40d007];return _0x110fcf;};'use strict';var util=require('util');var _=require(_0x9df8('0x0'));var moment=require(_0x9df8('0x1'));function getSeconds(_0x2171fa,_0x37c5c9){var _0x13fbf5=moment(_0x2171fa)[_0x9df8('0x2')](0x0);var _0x17debd=moment(_0x37c5c9)[_0x9df8('0x2')](0x0);return _0x13fbf5[_0x9df8('0x3')](_0x17debd,_0x9df8('0x4'));}function AgentComplete(_0x463ea4,_0x27ad08){this['state']=0x4;this[_0x9df8('0x5')]=_0x9df8('0x6');this[_0x9df8('0x7')]=_0x463ea4[_0x9df8('0x7')];this['type']=_0x463ea4[_0x9df8('0x8')];this['campaigntype']=_0x463ea4[_0x9df8('0x8')]===_0x9df8('0x9')?'queue':_0x463ea4[_0x9df8('0x8')];this[_0x9df8('0xa')]=_0x463ea4[_0x9df8('0xa')];this[_0x9df8('0xb')]=_0x463ea4[_0x9df8('0xb')];this[_0x9df8('0xc')]=_0x463ea4['countnoanswerretry'];this[_0x9df8('0xd')]=_0x463ea4[_0x9df8('0xa')]+_0x463ea4[_0x9df8('0xb')]+_0x463ea4[_0x9df8('0xc')]+_0x463ea4['countnosuchnumberretry']+_0x463ea4[_0x9df8('0xe')]+_0x463ea4['countabandonedretry']+_0x463ea4[_0x9df8('0xf')]+_0x463ea4[_0x9df8('0x10')];this[_0x9df8('0x11')]=_0x463ea4[_0x9df8('0x11')];this[_0x9df8('0xe')]=_0x463ea4[_0x9df8('0xe')];this[_0x9df8('0x12')]=_0x463ea4[_0x9df8('0x12')];this[_0x9df8('0xf')]=_0x463ea4[_0x9df8('0xf')];this[_0x9df8('0x10')]=_0x463ea4[_0x9df8('0x10')];this['uniqueid']=_0x27ad08[_0x9df8('0x13')];this['calleridname']=_0x463ea4['name'];this[_0x9df8('0x14')]=_0x463ea4[_0x9df8('0x15')];this[_0x9df8('0x16')]=_0x463ea4['starttime'];this[_0x9df8('0x17')]=_0x463ea4[_0x9df8('0x17')];this[_0x9df8('0x18')]=_0x463ea4['answertime'];this[_0x9df8('0x19')]=moment()[_0x9df8('0x1a')](_0x9df8('0x1b'));this[_0x9df8('0x1c')]=getSeconds(_0x463ea4['responsetime'],_0x463ea4['starttime']);this['holdtime']=getSeconds(_0x463ea4['answertime'],_0x463ea4[_0x9df8('0x17')]);this['talktime']=getSeconds(this[_0x9df8('0x19')],_0x463ea4[_0x9df8('0x18')]);this[_0x9df8('0x1d')]=_0x27ad08[_0x9df8('0x1d')];this[_0x9df8('0x1e')]=_0x27ad08[_0x9df8('0x1e')];this[_0x9df8('0x1f')]=_0x27ad08[_0x9df8('0x1f')];this[_0x9df8('0x20')]=_0x463ea4[_0x9df8('0x20')];this[_0x9df8('0x21')]=_0x463ea4[_0x9df8('0x21')];this[_0x9df8('0x22')]=_0x463ea4['callbackat'];this['recallme']=_0x463ea4[_0x9df8('0x23')];this[_0x9df8('0x24')]=_0x463ea4[_0x9df8('0x24')];this['ListId']=_0x463ea4['ListId'];this[_0x9df8('0x25')]=_0x463ea4[_0x9df8('0x25')];this['VoiceQueueId']=_0x463ea4[_0x9df8('0x26')];this[_0x9df8('0x27')]=_0x463ea4['CampaignId'];this[_0x9df8('0x28')]=_0x463ea4[_0x9df8('0x28')]||'';this[_0x9df8('0x29')]=_0x463ea4[_0x9df8('0x29')]||'';}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 1fbbf98..2eaa2fc 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 _0xf006=['countabandonedretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry'];(function(_0x4ea7fb,_0x4d1115){var _0x21c599=function(_0x571be3){while(--_0x571be3){_0x4ea7fb['push'](_0x4ea7fb['shift']());}};_0x21c599(++_0x4d1115);}(_0xf006,0x146));var _0x6f00=function(_0xc7ca77,_0x177d6c){_0xc7ca77=_0xc7ca77-0x0;var _0x421077=_0xf006[_0xc7ca77];return _0x421077;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x6f00('0x0'));function getSeconds(_0x281499,_0x5914f3){var _0xbab575=moment(_0x281499)['milliseconds'](0x0);var _0x1c7a9e=moment(_0x5914f3)['milliseconds'](0x0);return _0xbab575['diff'](_0x1c7a9e,_0x6f00('0x1'));}function Final(_0x402677){this[_0x6f00('0x2')]=_0x402677['uniqueid'];this[_0x6f00('0x3')]=_0x402677['scheduledat'];this[_0x6f00('0x4')]=_0x402677[_0x6f00('0x4')];this[_0x6f00('0x5')]=_0x402677[_0x6f00('0x4')]===_0x6f00('0x6')?_0x6f00('0x7'):_0x402677[_0x6f00('0x4')];this[_0x6f00('0x8')]=_0x402677[_0x6f00('0x8')];this[_0x6f00('0x9')]=_0x402677[_0x6f00('0x9')];this[_0x6f00('0xa')]=_0x402677[_0x6f00('0xa')];this['countglobal']=_0x402677[_0x6f00('0x8')]+_0x402677[_0x6f00('0x9')]+_0x402677[_0x6f00('0xa')]+_0x402677[_0x6f00('0xb')]+_0x402677[_0x6f00('0xc')]+_0x402677['countabandonedretry']+_0x402677[_0x6f00('0xd')]+_0x402677['countagentrejectretry'];this[_0x6f00('0xb')]=_0x402677['countnosuchnumberretry'];this[_0x6f00('0xc')]=_0x402677[_0x6f00('0xc')];this[_0x6f00('0xe')]=_0x402677[_0x6f00('0xe')];this[_0x6f00('0xd')]=_0x402677[_0x6f00('0xd')];this[_0x6f00('0xf')]=_0x402677[_0x6f00('0xf')];this[_0x6f00('0x7')]=_0x402677['queue'];this[_0x6f00('0x10')]=_0x402677['calleridname'];this['calleridnum']=_0x402677[_0x6f00('0x11')];this[_0x6f00('0x12')]=_0x402677[_0x6f00('0x12')];this[_0x6f00('0x13')]=_0x402677[_0x6f00('0x13')];this[_0x6f00('0x14')]=_0x402677[_0x6f00('0x13')];this[_0x6f00('0x15')]=_0x402677[_0x6f00('0x15')]||0x0;this[_0x6f00('0x16')]=_0x402677[_0x6f00('0x16')]||0x0;this[_0x6f00('0x17')]=_0x402677['talktime']||0x0;this['callback']=_0x402677['callback'];this[_0x6f00('0x18')]=_0x402677[_0x6f00('0x18')];this[_0x6f00('0x19')]=_0x402677['callbackat'];this[_0x6f00('0x1a')]=_0x402677[_0x6f00('0x1a')];this[_0x6f00('0x1b')]=_0x402677[_0x6f00('0x1b')];this[_0x6f00('0x1c')]=_0x402677[_0x6f00('0x1c')];this[_0x6f00('0x1d')]=_0x402677[_0x6f00('0x1d')];this['VoiceQueueId']=_0x402677[_0x6f00('0x1e')];this[_0x6f00('0x1f')]=_0x402677[_0x6f00('0x1f')];this['originatecalleridnum']=_0x402677[_0x6f00('0x20')]||'';this['originatecalleridname']=_0x402677[_0x6f00('0x21')]||'';}module['exports']=Final; \ No newline at end of file +var _0x202c=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','ContactId','ListId'];(function(_0x93049b,_0x1dd373){var _0x3f28b8=function(_0x1e5f14){while(--_0x1e5f14){_0x93049b['push'](_0x93049b['shift']());}};_0x3f28b8(++_0x1dd373);}(_0x202c,0x178));var _0xc202=function(_0x236ff0,_0x197c81){_0x236ff0=_0x236ff0-0x0;var _0x40d005=_0x202c[_0x236ff0];return _0x40d005;};'use strict';var util=require(_0xc202('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x1cf3fd,_0x1ab6a1){var _0x27b3b2=moment(_0x1cf3fd)['milliseconds'](0x0);var _0x215161=moment(_0x1ab6a1)[_0xc202('0x1')](0x0);return _0x27b3b2[_0xc202('0x2')](_0x215161,_0xc202('0x3'));}function Final(_0x4b4368){this[_0xc202('0x4')]=_0x4b4368[_0xc202('0x4')];this['scheduledat']=_0x4b4368[_0xc202('0x5')];this['type']=_0x4b4368[_0xc202('0x6')];this[_0xc202('0x7')]=_0x4b4368[_0xc202('0x6')]===_0xc202('0x8')?_0xc202('0x9'):_0x4b4368[_0xc202('0x6')];this[_0xc202('0xa')]=_0x4b4368[_0xc202('0xa')];this[_0xc202('0xb')]=_0x4b4368[_0xc202('0xb')];this[_0xc202('0xc')]=_0x4b4368[_0xc202('0xc')];this[_0xc202('0xd')]=_0x4b4368['countbusyretry']+_0x4b4368[_0xc202('0xb')]+_0x4b4368[_0xc202('0xc')]+_0x4b4368[_0xc202('0xe')]+_0x4b4368[_0xc202('0xf')]+_0x4b4368[_0xc202('0x10')]+_0x4b4368[_0xc202('0x11')]+_0x4b4368[_0xc202('0x12')];this['countnosuchnumberretry']=_0x4b4368[_0xc202('0xe')];this[_0xc202('0xf')]=_0x4b4368['countdropretry'];this['countabandonedretry']=_0x4b4368['countabandonedretry'];this[_0xc202('0x11')]=_0x4b4368['countmachineretry'];this[_0xc202('0x12')]=_0x4b4368['countagentrejectretry'];this[_0xc202('0x9')]=_0x4b4368[_0xc202('0x9')];this[_0xc202('0x13')]=_0x4b4368[_0xc202('0x13')];this[_0xc202('0x14')]=_0x4b4368[_0xc202('0x14')];this[_0xc202('0x15')]=_0x4b4368['starttime'];this[_0xc202('0x16')]=_0x4b4368[_0xc202('0x16')];this[_0xc202('0x17')]=_0x4b4368['responsetime'];this['ringtime']=_0x4b4368[_0xc202('0x18')]||0x0;this[_0xc202('0x19')]=_0x4b4368[_0xc202('0x19')]||0x0;this[_0xc202('0x1a')]=_0x4b4368[_0xc202('0x1a')]||0x0;this['callback']=_0x4b4368['callback'];this[_0xc202('0x1b')]=_0x4b4368['callbackuniqueid'];this[_0xc202('0x1c')]=_0x4b4368[_0xc202('0x1c')];this['recallme']=_0x4b4368['recallme'];this[_0xc202('0x1d')]=_0x4b4368['ContactId'];this[_0xc202('0x1e')]=_0x4b4368[_0xc202('0x1e')];this[_0xc202('0x1f')]=_0x4b4368[_0xc202('0x1f')];this[_0xc202('0x20')]=_0x4b4368['VoiceQueueId'];this['CampaignId']=_0x4b4368[_0xc202('0x21')];this[_0xc202('0x22')]=_0x4b4368[_0xc202('0x22')]||'';this['originatecalleridname']=_0x4b4368[_0xc202('0x23')]||'';}module[_0xc202('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 7d2a68f..f4ca002 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 _0x9b10=['countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b10,0x76));var _0x09b1=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x9b10[_0x42245d];return _0x4b211a;};'use strict';var util=require(_0x09b1('0x0'));var _=require(_0x09b1('0x1'));var moment=require(_0x09b1('0x2'));function getSeconds(_0x1817f1,_0x2c41ae){var _0x11bb2b=moment(_0x1817f1)[_0x09b1('0x3')](0x0);var _0x5c5f57=moment(_0x2c41ae)['milliseconds'](0x0);return _0x11bb2b[_0x09b1('0x4')](_0x5c5f57,_0x09b1('0x5'));}function Hangup(_0x594550,_0x2a5084){this['state']=0x4;this[_0x09b1('0x6')]='Answer';this[_0x09b1('0x7')]=_0x594550[_0x09b1('0x7')];this['type']=_0x594550[_0x09b1('0x8')];this[_0x09b1('0x9')]=_0x594550['type']===_0x09b1('0xa')?'queue':_0x594550['type'];this[_0x09b1('0xb')]=_0x594550['countbusyretry'];this[_0x09b1('0xc')]=_0x594550[_0x09b1('0xc')];this['countnoanswerretry']=_0x594550[_0x09b1('0xd')];this[_0x09b1('0xe')]=_0x594550['countbusyretry']+_0x594550[_0x09b1('0xc')]+_0x594550[_0x09b1('0xd')]+_0x594550[_0x09b1('0xf')]+_0x594550[_0x09b1('0x10')]+_0x594550['countabandonedretry']+_0x594550['countmachineretry']+_0x594550[_0x09b1('0x11')];this[_0x09b1('0xf')]=_0x594550[_0x09b1('0xf')];this[_0x09b1('0x10')]=_0x594550[_0x09b1('0x10')];this[_0x09b1('0x12')]=_0x594550[_0x09b1('0x12')];this[_0x09b1('0x13')]=_0x594550['countmachineretry'];this[_0x09b1('0x11')]=_0x594550[_0x09b1('0x11')];this[_0x09b1('0x14')]=_0x2a5084[_0x09b1('0x14')];this['calleridname']=_0x594550[_0x09b1('0x15')];this[_0x09b1('0x16')]=_0x594550[_0x09b1('0x17')];this[_0x09b1('0x18')]=_0x594550[_0x09b1('0x18')];this['responsetime']=_0x594550[_0x09b1('0x19')];this[_0x09b1('0x1a')]=moment()[_0x09b1('0x1b')](_0x09b1('0x1c'));this['ringtime']=getSeconds(_0x594550['responsetime'],_0x594550[_0x09b1('0x18')]);this[_0x09b1('0x1d')]=0x0;this[_0x09b1('0x1e')]=getSeconds(this[_0x09b1('0x1a')],_0x594550['responsetime']);this[_0x09b1('0x1f')]=_0x594550['queue'];this[_0x09b1('0x20')]=_0x09b1('0x21');this[_0x09b1('0x22')]=_0x2a5084[_0x09b1('0x23')];this[_0x09b1('0x24')]=_0x594550[_0x09b1('0x24')];this[_0x09b1('0x25')]=_0x594550[_0x09b1('0x25')];this[_0x09b1('0x26')]=_0x594550[_0x09b1('0x26')];this[_0x09b1('0x27')]=_0x594550[_0x09b1('0x27')];this[_0x09b1('0x28')]=_0x594550['ContactId'];this[_0x09b1('0x29')]=_0x594550['ListId'];this['UserId']=_0x594550['UserId'];this[_0x09b1('0x2a')]=_0x594550[_0x09b1('0x2a')];this[_0x09b1('0x2b')]=_0x594550[_0x09b1('0x2b')];}module['exports']=Hangup; \ No newline at end of file +var _0xbbe0=['seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff'];(function(_0x5ae6b7,_0x14960d){var _0x26d37f=function(_0x1be115){while(--_0x1be115){_0x5ae6b7['push'](_0x5ae6b7['shift']());}};_0x26d37f(++_0x14960d);}(_0xbbe0,0x137));var _0x0bbe=function(_0x3ca977,_0x58219a){_0x3ca977=_0x3ca977-0x0;var _0x2e67cd=_0xbbe0[_0x3ca977];return _0x2e67cd;};'use strict';var util=require('util');var _=require(_0x0bbe('0x0'));var moment=require(_0x0bbe('0x1'));function getSeconds(_0x16c999,_0x58439f){var _0x345a84=moment(_0x16c999)[_0x0bbe('0x2')](0x0);var _0x38d4d5=moment(_0x58439f)[_0x0bbe('0x2')](0x0);return _0x345a84[_0x0bbe('0x3')](_0x38d4d5,_0x0bbe('0x4'));}function Hangup(_0x5acc72,_0x12f458){this[_0x0bbe('0x5')]=0x4;this['statedesc']=_0x0bbe('0x6');this[_0x0bbe('0x7')]=_0x5acc72[_0x0bbe('0x7')];this[_0x0bbe('0x8')]=_0x5acc72[_0x0bbe('0x8')];this[_0x0bbe('0x9')]=_0x5acc72['type']===_0x0bbe('0xa')?_0x0bbe('0xb'):_0x5acc72[_0x0bbe('0x8')];this['countbusyretry']=_0x5acc72[_0x0bbe('0xc')];this[_0x0bbe('0xd')]=_0x5acc72[_0x0bbe('0xd')];this[_0x0bbe('0xe')]=_0x5acc72[_0x0bbe('0xe')];this['countglobal']=_0x5acc72[_0x0bbe('0xc')]+_0x5acc72['countcongestionretry']+_0x5acc72[_0x0bbe('0xe')]+_0x5acc72[_0x0bbe('0xf')]+_0x5acc72[_0x0bbe('0x10')]+_0x5acc72[_0x0bbe('0x11')]+_0x5acc72[_0x0bbe('0x12')]+_0x5acc72[_0x0bbe('0x13')];this['countnosuchnumberretry']=_0x5acc72[_0x0bbe('0xf')];this[_0x0bbe('0x10')]=_0x5acc72[_0x0bbe('0x10')];this[_0x0bbe('0x11')]=_0x5acc72[_0x0bbe('0x11')];this['countmachineretry']=_0x5acc72['countmachineretry'];this[_0x0bbe('0x13')]=_0x5acc72[_0x0bbe('0x13')];this[_0x0bbe('0x14')]=_0x12f458[_0x0bbe('0x14')];this['calleridname']=_0x5acc72[_0x0bbe('0x15')];this[_0x0bbe('0x16')]=_0x5acc72[_0x0bbe('0x17')];this[_0x0bbe('0x18')]=_0x5acc72[_0x0bbe('0x18')];this[_0x0bbe('0x19')]=_0x5acc72[_0x0bbe('0x19')];this[_0x0bbe('0x1a')]=moment()['format'](_0x0bbe('0x1b'));this[_0x0bbe('0x1c')]=getSeconds(_0x5acc72[_0x0bbe('0x19')],_0x5acc72[_0x0bbe('0x18')]);this[_0x0bbe('0x1d')]=0x0;this[_0x0bbe('0x1e')]=getSeconds(this[_0x0bbe('0x1a')],_0x5acc72['responsetime']);this[_0x0bbe('0xb')]=_0x5acc72[_0x0bbe('0xb')];this[_0x0bbe('0x1f')]=_0x0bbe('0x20');this[_0x0bbe('0x21')]=_0x12f458[_0x0bbe('0x22')];this[_0x0bbe('0x23')]=_0x5acc72[_0x0bbe('0x23')];this[_0x0bbe('0x24')]=_0x5acc72[_0x0bbe('0x24')];this[_0x0bbe('0x25')]=_0x5acc72[_0x0bbe('0x25')];this[_0x0bbe('0x26')]=_0x5acc72[_0x0bbe('0x26')];this[_0x0bbe('0x27')]=_0x5acc72[_0x0bbe('0x27')];this['ListId']=_0x5acc72[_0x0bbe('0x28')];this[_0x0bbe('0x29')]=_0x5acc72[_0x0bbe('0x29')];this[_0x0bbe('0x2a')]=_0x5acc72['VoiceQueueId'];this[_0x0bbe('0x2b')]=_0x5acc72['CampaignId'];}module[_0x0bbe('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 6215195..b3a7760 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 _0x41da=['originatecalleridname','exports','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x34c553,_0x3e7dfc){var _0x1357d2=function(_0x3b509f){while(--_0x3b509f){_0x34c553['push'](_0x34c553['shift']());}};_0x1357d2(++_0x3e7dfc);}(_0x41da,0x71));var _0xa41d=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0x41da[_0x3b2244];return _0x2dcc14;};'use strict';var util=require('util');var _=require(_0xa41d('0x0'));var moment=require(_0xa41d('0x1'));function getSeconds(_0x41dc79,_0x280a7d){var _0x266181=moment(_0x41dc79)[_0xa41d('0x2')](0x0);var _0x342731=moment(_0x280a7d)[_0xa41d('0x2')](0x0);return _0x266181['diff'](_0x342731,_0xa41d('0x3'));}function History(_0x53c080){this[_0xa41d('0x4')]=_0x53c080[_0xa41d('0x4')];this[_0xa41d('0x5')]=_0x53c080[_0xa41d('0x5')]||undefined;this[_0xa41d('0x6')]=_0x53c080[_0xa41d('0x6')];this[_0xa41d('0x7')]=_0x53c080[_0xa41d('0x6')]==='outbound'?_0xa41d('0x8'):_0x53c080[_0xa41d('0x6')];this['countbusyretry']=_0x53c080['countbusyretry'];this[_0xa41d('0x9')]=_0x53c080['countcongestionretry'];this['countnoanswerretry']=_0x53c080[_0xa41d('0xa')];this[_0xa41d('0xb')]=_0x53c080[_0xa41d('0xc')]+_0x53c080[_0xa41d('0x9')]+_0x53c080[_0xa41d('0xa')]+_0x53c080[_0xa41d('0xd')]+_0x53c080[_0xa41d('0xe')]+_0x53c080['countabandonedretry']+_0x53c080[_0xa41d('0xf')]+_0x53c080[_0xa41d('0x10')];this[_0xa41d('0xd')]=_0x53c080['countnosuchnumberretry'];this[_0xa41d('0xe')]=_0x53c080['countdropretry'];this['countabandonedretry']=_0x53c080[_0xa41d('0x11')];this[_0xa41d('0xf')]=_0x53c080[_0xa41d('0xf')];this[_0xa41d('0x10')]=_0x53c080[_0xa41d('0x10')];this[_0xa41d('0x8')]=_0x53c080[_0xa41d('0x8')];this['calleridname']=_0x53c080['name'];this[_0xa41d('0x12')]=_0x53c080[_0xa41d('0x13')];this[_0xa41d('0x14')]=_0x53c080[_0xa41d('0x14')];this['responsetime']=_0x53c080[_0xa41d('0x15')];this[_0xa41d('0x16')]=_0x53c080[_0xa41d('0x15')];this[_0xa41d('0x17')]=getSeconds(_0x53c080['responsetime'],_0x53c080[_0xa41d('0x14')]);this[_0xa41d('0x18')]=0x0;this['talktime']=0x0;this[_0xa41d('0x19')]=_0x53c080[_0xa41d('0x19')];this[_0xa41d('0x1a')]=_0x53c080[_0xa41d('0x1a')];this['callbackat']=_0x53c080[_0xa41d('0x1b')];this[_0xa41d('0x1c')]=_0x53c080[_0xa41d('0x1c')];this[_0xa41d('0x1d')]=_0x53c080[_0xa41d('0x1d')];this['ListId']=_0x53c080[_0xa41d('0x1e')];this[_0xa41d('0x1f')]=_0x53c080[_0xa41d('0x1f')];this[_0xa41d('0x20')]=_0x53c080[_0xa41d('0x20')];this[_0xa41d('0x21')]=_0x53c080[_0xa41d('0x21')];this[_0xa41d('0x22')]=_0x53c080[_0xa41d('0x22')]||'';this['originatecalleridname']=_0x53c080[_0xa41d('0x23')]||'';}module[_0xa41d('0x24')]=History; \ No newline at end of file +var _0x5b0d=['callback','callbackuniqueid','callbackat','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','holdtime'];(function(_0x5f27a1,_0x122e60){var _0x43c440=function(_0x4db850){while(--_0x4db850){_0x5f27a1['push'](_0x5f27a1['shift']());}};_0x43c440(++_0x122e60);}(_0x5b0d,0x172));var _0xd5b0=function(_0x2c502a,_0x9dd2b6){_0x2c502a=_0x2c502a-0x0;var _0x5f510c=_0x5b0d[_0x2c502a];return _0x5f510c;};'use strict';var util=require(_0xd5b0('0x0'));var _=require(_0xd5b0('0x1'));var moment=require(_0xd5b0('0x2'));function getSeconds(_0xe6de6b,_0x1a35f4){var _0x205e64=moment(_0xe6de6b)[_0xd5b0('0x3')](0x0);var _0x5bf85f=moment(_0x1a35f4)[_0xd5b0('0x3')](0x0);return _0x205e64[_0xd5b0('0x4')](_0x5bf85f,'seconds');}function History(_0x33577f){this[_0xd5b0('0x5')]=_0x33577f[_0xd5b0('0x5')];this[_0xd5b0('0x6')]=_0x33577f[_0xd5b0('0x6')]||undefined;this[_0xd5b0('0x7')]=_0x33577f[_0xd5b0('0x7')];this[_0xd5b0('0x8')]=_0x33577f['type']===_0xd5b0('0x9')?_0xd5b0('0xa'):_0x33577f[_0xd5b0('0x7')];this[_0xd5b0('0xb')]=_0x33577f[_0xd5b0('0xb')];this[_0xd5b0('0xc')]=_0x33577f['countcongestionretry'];this[_0xd5b0('0xd')]=_0x33577f[_0xd5b0('0xd')];this['countglobal']=_0x33577f['countbusyretry']+_0x33577f['countcongestionretry']+_0x33577f[_0xd5b0('0xd')]+_0x33577f[_0xd5b0('0xe')]+_0x33577f[_0xd5b0('0xf')]+_0x33577f[_0xd5b0('0x10')]+_0x33577f['countmachineretry']+_0x33577f['countagentrejectretry'];this[_0xd5b0('0xe')]=_0x33577f['countnosuchnumberretry'];this['countdropretry']=_0x33577f['countdropretry'];this['countabandonedretry']=_0x33577f[_0xd5b0('0x10')];this[_0xd5b0('0x11')]=_0x33577f[_0xd5b0('0x11')];this[_0xd5b0('0x12')]=_0x33577f[_0xd5b0('0x12')];this[_0xd5b0('0xa')]=_0x33577f['queue'];this[_0xd5b0('0x13')]=_0x33577f[_0xd5b0('0x14')];this[_0xd5b0('0x15')]=_0x33577f[_0xd5b0('0x16')];this[_0xd5b0('0x17')]=_0x33577f[_0xd5b0('0x17')];this[_0xd5b0('0x18')]=_0x33577f[_0xd5b0('0x18')];this['endtime']=_0x33577f[_0xd5b0('0x18')];this['ringtime']=getSeconds(_0x33577f[_0xd5b0('0x18')],_0x33577f['starttime']);this[_0xd5b0('0x19')]=0x0;this['talktime']=0x0;this[_0xd5b0('0x1a')]=_0x33577f[_0xd5b0('0x1a')];this['callbackuniqueid']=_0x33577f[_0xd5b0('0x1b')];this[_0xd5b0('0x1c')]=_0x33577f[_0xd5b0('0x1c')];this['recallme']=_0x33577f['recallme'];this[_0xd5b0('0x1d')]=_0x33577f['ContactId'];this['ListId']=_0x33577f[_0xd5b0('0x1e')];this['UserId']=_0x33577f['UserId'];this[_0xd5b0('0x1f')]=_0x33577f['VoiceQueueId'];this[_0xd5b0('0x20')]=_0x33577f[_0xd5b0('0x20')];this[_0xd5b0('0x21')]=_0x33577f[_0xd5b0('0x21')]||'';this[_0xd5b0('0x22')]=_0x33577f[_0xd5b0('0x22')]||'';}module[_0xd5b0('0x23')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index e17d9ef..661db87 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 _0xbede=['[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','dialMachineMaxRetry','dialMachineRetryFrequency','minutes','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','droptime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','queueBooked','idHopper','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','queueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','rrmemory','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','length','push','Action','command','indexOf','true','iftime\x20%s,%s','all','some','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','checkIfTimeIntervals','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','filter','online','log','map','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','\x5cw{0,','pow','replace','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','response','callProgressDetecting','[callProgressDetecting]\x20','countbusyretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','object','[callProgressDetecting]','entity\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','[CatchErlangB]','outboundQueuePauses','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','dialOrderByScheduledAt','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\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','p\x20=\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','util','lodash','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','enqueue','tail','finally','sequence','preview','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBookedRR','agentconnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncOriginateResponse','agentcomplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','message','AGENTS_NOT_LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','name','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','outbound','strategy','answered','loggedIn','sumBillable','sumDuration','talking','total','type','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','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','predictiveIntervalTotalCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','erlangAbandonmentRate','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','isEmpty','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','available','IS_DISACTIVED','sendMessageOneNotActive','state','statedesc','starttime','prototype','clearZombieChannels','[uniqueid]','[actions]','status','No\x20such\x20channel','updateOriginated','voiceQueues','queue','[Dialer][checkChannel]','countReScheduled','resolve','catch','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','isSuccess','Success','format','reachable','SIP/%s','uniqueid','isNil','variable','exten','xcally-motion-dialer','dialAMDActive','HANGUP','membername','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','AMD','countmachineretry','countglobal','custom:amd'];(function(_0xa040ad,_0x5f4d98){var _0x1708a1=function(_0xef0707){while(--_0xef0707){_0xa040ad['push'](_0xa040ad['shift']());}};_0x1708a1(++_0x5f4d98);}(_0xbede,0x12e));var _0xebed=function(_0x44431e,_0x549190){_0x44431e=_0x44431e-0x0;var _0x1ce4df=_0xbede[_0x44431e];return _0x1ce4df;};'use strict';var util=require(_0xebed('0x0'));var _=require(_0xebed('0x1'));var BPromise=require('bluebird');var uuid=require(_0xebed('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0xebed('0x3'));var Redis=require(_0xebed('0x4'));var ut=require(_0xebed('0x5'));var config=require(_0xebed('0x6'));var logger=require(_0xebed('0x7'))(_0xebed('0x8'));var loggerBooked=require(_0xebed('0x7'))(_0xebed('0x9'));var loggerPredictive=require(_0xebed('0x7'))(_0xebed('0xa'));var loggerPredictiveCalls=require(_0xebed('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xebed('0x7'))(_0xebed('0xb'));var ami=require(_0xebed('0xc'));config[_0xebed('0xd')]=_[_0xebed('0xe')](config[_0xebed('0xd')],{'host':_0xebed('0xf'),'port':0x18eb});var io=require(_0xebed('0x10'))(new Redis(config[_0xebed('0xd')]));var cmHopper=require(_0xebed('0x11'));var cmHopperHistory=require(_0xebed('0x12'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xebed('0x13'));var RpcSetting=require('../rpc/setting');var Action=require(_0xebed('0x14'));var History=require(_0xebed('0x15'));var Final=require(_0xebed('0x16'));var AgentComplete=require(_0xebed('0x17'));var QueueCallerAbandon=require(_0xebed('0x18'));var Hangup=require('./hangup');var ipAgi=process[_0xebed('0x19')][_0xebed('0x1a')]||_0xebed('0x1b');var strategy={'rrmemory':'rrmemory','roundrobin':_0xebed('0x1c')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xebed('0x1d')]=function(_0x4fbb07){this[_0xebed('0x1e')]=this['tail']?this['tail'][_0xebed('0x1f')](_0x4fbb07):_0x4fbb07();};function Dialer(_0x44398,_0x1ddc9f){this[_0xebed('0x20')]=new Sequence();this[_0xebed('0x21')]=_0x1ddc9f;this['voiceQueues']=_0x44398['voiceQueues'];this[_0xebed('0x22')]=_0x44398[_0xebed('0x22')];this[_0xebed('0x23')]=_0x44398[_0xebed('0x23')];this[_0xebed('0x24')]=_0x44398[_0xebed('0x24')];this['maxNumberOriginate']=config[_0xebed('0x25')]||0x2;this[_0xebed('0x26')]={};this[_0xebed('0x27')]={};this[_0xebed('0x28')]={};this[_0xebed('0x29')]={};this[_0xebed('0x2a')]={};this[_0xebed('0x2b')]={};this[_0xebed('0x2c')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0xebed('0x2d')]={};ami['on'](_0xebed('0x2e'),this['syncAgentConnect']['bind'](this));ami['on'](_0xebed('0x2f'),this[_0xebed('0x30')][_0xebed('0x31')](this));ami['on']('originateresponse',this[_0xebed('0x32')][_0xebed('0x31')](this));ami['on'](_0xebed('0x33'),this['syncAgentComplete'][_0xebed('0x31')](this));ami['on'](_0xebed('0x34'),this['syncQueueSummary'][_0xebed('0x31')](this));ami['on'](_0xebed('0x35'),this[_0xebed('0x36')][_0xebed('0x31')](this));ami['on']('hangup',this[_0xebed('0x37')][_0xebed('0x31')](this));ami['on'](_0xebed('0x38'),this[_0xebed('0x39')][_0xebed('0x31')](this));ami['on'](_0xebed('0x3a'),this[_0xebed('0x3b')][_0xebed('0x31')](this));ami['on'](_0xebed('0x3c'),this[_0xebed('0x3d')][_0xebed('0x31')](this));ami['on']('queuestatuscomplete',this[_0xebed('0x3e')][_0xebed('0x31')](this));this[_0xebed('0x3f')]();this[_0xebed('0x40')]();RpcSetting[_0xebed('0x41')]()[_0xebed('0x42')](function(_0x4cb867){previewRecallmeReminderInterval=_0x4cb867['previewRecallmeReminderInterval'];});}function isNotNull(_0xa65ab9){return _0xa65ab9!==null&&!_[_0xebed('0x43')](_0xa65ab9);}function checkIsLoggedIn(_0x3f436d,_0x3f3fa0){return function(){if(_0x3f3fa0<=0x0){_0x3f436d[_0xebed('0x44')]=_0xebed('0x45');throw _0x3f436d['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x38d77d){return _0x38d77d;}function checkIsActive(_0x4cb421,_0x10ef46){return function(){if(!isActive(_0x10ef46)){_0x4cb421[_0xebed('0x44')]=_0xebed('0x46');throw _0x4cb421['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x582e34){return function(){if(!isNotNull(_0x582e34[_0xebed('0x47')])){_0x582e34[_0xebed('0x44')]=_0xebed('0x48');throw _0x582e34[_0xebed('0x49')]+_0xebed('0x4a');}if(!isNotNull(_0x582e34[_0xebed('0x47')][_0xebed('0x4b')])){_0x582e34[_0xebed('0x44')]=_0xebed('0x48');throw _0x582e34['name']+_0xebed('0x4a');}if(!isNotNull(_['isEmpty'](_0x582e34['Interval'][_0xebed('0x4b')]))){_0x582e34[_0xebed('0x44')]='INTERVAL_IS_NULL';throw _0x582e34[_0xebed('0x49')]+_0xebed('0x4a');}};}function msgResponse(_0xd0adef,_0x5e8bd1,_0x5ce3dd){return{'action':_0xd0adef,'response':_0x5e8bd1,'message':_0x5ce3dd,'stack':_0x5ce3dd};}function myreject(_0x510a53){return function(_0x3902af){return _0x510a53(msgResponse(_0xebed('0x4c'),_0xebed('0x4d'),JSON[_0xebed('0x4e')](_0x3902af)));};}function getSeconds(_0x4d833f,_0x1c03e7){var _0x3741aa=moment(_0x4d833f)[_0xebed('0x4f')](0x0);var _0x40beb2=moment(_0x1c03e7)[_0xebed('0x4f')](0x0);return _0x3741aa['diff'](_0x40beb2,_0xebed('0x50'));}function emit(_0x50c227,_0x5d2a54,_0x2c247e){io['to'](_0x50c227)[_0xebed('0x51')](_0x5d2a54,_0x2c247e);}function emitVoiceQueueSummary(_0x1ab749){if(_0x1ab749['type']===_0xebed('0x52')){var _0x1b81a7={'id':_0x1ab749['id'],'name':_0x1ab749['name'],'strategy':_0x1ab749[_0xebed('0x53')],'answered':_0x1ab749[_0xebed('0x54')],'available':_0x1ab749['available'],'loggedIn':_0x1ab749[_0xebed('0x55')],'pTalking':_0x1ab749['pTalking'],'sumBillable':_0x1ab749[_0xebed('0x56')],'sumDuration':_0x1ab749[_0xebed('0x57')],'sumHoldTime':_0x1ab749['sumHoldTime']||0x0,'talking':_0x1ab749[_0xebed('0x58')],'total':_0x1ab749[_0xebed('0x59')],'type':_0x1ab749[_0xebed('0x5a')],'unmanaged':_0x1ab749[_0xebed('0x5b')],'abandoned':_0x1ab749['abandoned'],'waiting':_0x1ab749['waiting'],'loggedInDb':_0x1ab749[_0xebed('0x5c')],'dialActive':_0x1ab749[_0xebed('0x5d')],'dialMethod':_0x1ab749[_0xebed('0x5e')],'dialOriginateCallerIdName':_0x1ab749[_0xebed('0x5f')],'dialOriginateCallerIdNumber':_0x1ab749[_0xebed('0x60')],'dialOriginateTimeout':_0x1ab749[_0xebed('0x61')],'dialPrefix':_0x1ab749['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1ab749[_0xebed('0x62')],'outboundAnswerCallsDay':_0x1ab749[_0xebed('0x63')],'outboundBlacklistCallsDay':_0x1ab749[_0xebed('0x64')],'outboundBusyCallsDay':_0x1ab749[_0xebed('0x65')],'outboundCongestionCallsDay':_0x1ab749[_0xebed('0x66')],'outboundDropCallsDayACS':_0x1ab749[_0xebed('0x67')],'outboundDropCallsDayCallersExit':_0x1ab749[_0xebed('0x68')],'outboundDropCallsDayTimeout':_0x1ab749[_0xebed('0x69')],'outboundNoAnswerCallsDay':_0x1ab749['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1ab749[_0xebed('0x6a')],'outboundOriginateFailureCallsDay':_0x1ab749['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1ab749[_0xebed('0x6b')],'outboundRejectCallsDay':_0x1ab749[_0xebed('0x6c')],'outboundUnknownCallsDay':_0x1ab749['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x1ab749[_0xebed('0x6d')],'predictiveIntervalAvgHoldtime':_0x1ab749[_0xebed('0x6e')],'predictiveIntervalAvgTalktime':_0x1ab749[_0xebed('0x6f')],'predictiveIntervalDroppedCallsCallersExit':_0x1ab749[_0xebed('0x70')],'predictiveIntervalDroppedCallsTimeout':_0x1ab749[_0xebed('0x71')],'predictiveIntervalErlangCalls':_0x1ab749[_0xebed('0x72')],'predictiveIntervalErlangCallsDroppedCalls':_0x1ab749['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1ab749[_0xebed('0x73')],'predictiveIntervalMultiplicativeFactor':_0x1ab749['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1ab749[_0xebed('0x74')],'predictiveIntervalAvailable':_0x1ab749[_0xebed('0x75')],'predictiveIntervalTotalCalls':_0x1ab749['predictiveIntervalTotalCalls'],'message':_0x1ab749[_0xebed('0x44')],'originated':_0x1ab749[_0xebed('0x76')],'erlangCalls':_0x1ab749[_0xebed('0x77')],'erlangCallToSecond':_0x1ab749[_0xebed('0x78')],'erlangAbandonmentRate':_0x1ab749['erlangAbandonmentRate'],'erlangBusyFactor':_0x1ab749[_0xebed('0x79')],'startPredictive':_0x1ab749[_0xebed('0x2b')],'startProgressive':_0x1ab749[_0xebed('0x2c')]};if(_0x1ab749[_0xebed('0x7a')]){_0x1b81a7['Trunk']={'id':_0x1ab749[_0xebed('0x7a')]['id'],'name':_0x1ab749[_0xebed('0x7a')]['name'],'active':_0x1ab749['Trunk'][_0xebed('0x7b')],'callerid':_0x1ab749[_0xebed('0x7a')][_0xebed('0x7c')]};}if(_0x1ab749[_0xebed('0x47')]){_0x1b81a7[_0xebed('0x47')]={'id':_0x1ab749[_0xebed('0x47')]['id'],'name':_0x1ab749[_0xebed('0x47')]['name']};}var _0x3ce09e=md5(JSON[_0xebed('0x4e')](_0x1b81a7));if(_0x1ab749[_0xebed('0x3')]!==_0x3ce09e){_0x1ab749[_0xebed('0x3')]=_0x3ce09e;emit(util['format'](_0xebed('0x7d'),_0x1b81a7[_0xebed('0x49')]),_0xebed('0x7e'),_0x1b81a7);}}}function emitCampaignSummary(_0x189ef6){if(_0x189ef6['type']==='ivr'){emit(util['format'](_0xebed('0x7f'),_0x189ef6[_0xebed('0x49')]),_0xebed('0x80'),_0x189ef6);}}function checkGetDataPredictive(_0x565370){if(isNotNull(_0x565370)&&!_['isEmpty'](_0x565370)){loggerPredictive[_0xebed('0x81')](_0xebed('0x82'));loggerPredictive[_0xebed('0x81')](_0xebed('0x83'),_0x565370[_0xebed('0x84')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x565370[_0xebed('0x6d')]);loggerPredictive[_0xebed('0x81')](_0xebed('0x85'),_0x565370['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xebed('0x81')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x565370['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xebed('0x81')](_0xebed('0x86'),_0x565370[_0xebed('0x6e')]);loggerPredictive[_0xebed('0x81')](_0xebed('0x87'),_0x565370[_0xebed('0x6f')]);loggerPredictive[_0xebed('0x81')](_0xebed('0x88'));if(_0x565370[_0xebed('0x84')]>0x0){if(!_[_0xebed('0x43')](_0x565370[_0xebed('0x6f')])&&_0x565370[_0xebed('0x6f')]>0x0){return!![];}loggerPredictive[_0xebed('0x81')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x565370[_0xebed('0x6e')])&&_0x565370[_0xebed('0x6e')]>0x0){return!![];}loggerPredictive['info'](_0xebed('0x89'));}else{loggerPredictive[_0xebed('0x81')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xebed('0x81')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x3974e5){return function(_0x4c472c){loggerPredictive[_0xebed('0x81')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xebed('0x81')](_0xebed('0x8a'),_0x4c472c['erlangCalls']);loggerPredictive['info'](_0xebed('0x8b'),_0x4c472c['erlangCallToSecond']);loggerPredictive[_0xebed('0x81')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4c472c[_0xebed('0x8c')]);loggerPredictive[_0xebed('0x81')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4c472c[_0xebed('0x79')]);loggerPredictive[_0xebed('0x81')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4c472c['erlangAbandonmentRate']);loggerPredictive[_0xebed('0x81')](_0xebed('0x88'));_[_0xebed('0x8d')](_0x3974e5,_0x4c472c);};}function getDiff(_0x204f4a){var _0xc93c21=moment()[_0xebed('0x4f')](0x0);var _0x1414ff=moment(_0x204f4a)['milliseconds'](0x0);return _0xc93c21[_0xebed('0x8e')](_0x1414ff,_0xebed('0x50'));}function ifInterval(_0x30018a,_0xfbcf89){if(_['isUndefined'](_0xfbcf89)){return![];}return getDiff(_0xfbcf89)<_0x30018a*0x3c;}function freeVariablesPredictive(_0x37b800){if(isNotNull(_0x37b800)){if(!_[_0xebed('0x43')](_0x37b800[_0xebed('0x2c')])){_0x37b800[_0xebed('0x2c')]=undefined;loggerPredictive['info'](_0x37b800[_0xebed('0x49')],_0xebed('0x8f'));}if(!_['isUndefined'](_0x37b800[_0xebed('0x2b')])){_0x37b800[_0xebed('0x2b')]=undefined;loggerPredictive['info'](_0x37b800[_0xebed('0x49')],_0xebed('0x90'));}if(!_[_0xebed('0x43')](_0x37b800[_0xebed('0x91')])){clearInterval(_0x37b800[_0xebed('0x91')]);_0x37b800[_0xebed('0x91')]=undefined;loggerPredictive[_0xebed('0x81')](_0x37b800['name'],_0xebed('0x92'));}}}function erlangb(_0xd45eac,_0x3c58fa){if(_0x3c58fa===0x0){return 0x0;}var _0x1413eb=0x1;for(var _0x2b1d9f=0x1;_0x2b1d9f<=_0x3c58fa;_0x2b1d9f+=0x1){_0x1413eb=0x1+_0x1413eb*_0x2b1d9f/_0xd45eac;}return 0x1/_0x1413eb;}function isVoiceQueueOutbound(_0x4da1ab){return _0x4da1ab===_0xebed('0x52');}function isNotPreview(_0xb54e74){return _0xb54e74!==_0xebed('0x21');}function isCampaignIvr(_0x27f74c){return _0x27f74c===_0xebed('0x93');}function getCallerId(_0x4dab3f,_0x5b1f84,_0xb9e86e){if(!_['isUndefined'](_0xb9e86e)&&typeof _0xb9e86e==='string'&&!_[_0xebed('0x94')](_0xb9e86e)){if(!_[_0xebed('0x43')](_0x5b1f84)&&typeof _0x5b1f84===_0xebed('0x95')&&!_['isEmpty'](_0x5b1f84)){return util['format'](_0xebed('0x96'),_0x5b1f84,_0xb9e86e);}return util['format'](_0xebed('0x96'),_0xb9e86e,_0xb9e86e);}if(!_[_0xebed('0x43')](_0x4dab3f)&&typeof _0x4dab3f==='string'&&!_['isEmpty'](_0x4dab3f)){return _0x4dab3f;}return _0xebed('0x97');}function loggerCatchQueueSummary(_0x194637,_0x2d1de4){return function(_0x459ab8){freeVariablesPredictive(_0x2d1de4);emitVoiceQueueSummary(_0x2d1de4);emitCampaignSummary(_0x2d1de4);loggerSyncQueueSummary[_0xebed('0x98')](_0x194637,util[_0xebed('0x99')](_0x459ab8,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2d483e,_0xb08a){return function(_0x5b9dc5){loggerPredictive[_0xebed('0x98')](_0xb08a[_0xebed('0x49')],_0x2d483e);loggerPredictive['error'](_0x5b9dc5[_0xebed('0x9a')]);freeVariablesPredictive(_0xb08a);};}function loggerCatch(_0x2e7c3a){return function(_0x1fcd1){logger[_0xebed('0x98')](_0x2e7c3a,util[_0xebed('0x99')](_0x1fcd1,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x20d57f){return _0x20d57f&&!_[_0xebed('0x43')](_0x20d57f)&&_0x20d57f['length']>0x0;}function decremetOriginate(_0x4c43c9){if(!_['isUndefined'](_0x4c43c9)&&_0x4c43c9!==null){if(typeof _0x4c43c9['originated']!==_0xebed('0x9b')){if(_0x4c43c9[_0xebed('0x76')]>0x0){_0x4c43c9[_0xebed('0x76')]-=0x1;}else{logger['error'](_0xebed('0x9c'));}}}else{logger[_0xebed('0x98')](_0xebed('0x9d'));}}function checkContactLowerLimitOriginate(_0x3294b0,_0x2abc2b,_0x483c35){if(_0x2abc2b>_0x483c35){for(var _0x3f678e=0x0;_0x3f678e<_0x2abc2b-_0x483c35;_0x3f678e+=0x1){decremetOriginate(_0x3294b0);}}}function loggerGetContactDialer(_0x382fb5,_0xcb036,_0x20bfd0){return function(_0x4f1776){checkContactLowerLimitOriginate(_0xcb036,_0x20bfd0,0x0);logger[_0xebed('0x98')](_0x382fb5,util[_0xebed('0x99')](_0x4f1776,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x11e8a5){return function(_0x4476ca){if(isNotNull(_0x4476ca)&&isNotNull(_0x4476ca[0x0])){if(_0x4476ca[0x0][_0xebed('0x9e')]>0x0){_0x11e8a5[_0xebed('0x44')]=_0xebed('0x9f');logger[_0xebed('0x81')](_0xebed('0xa0')+_0x11e8a5[_0xebed('0x49')],_0x4476ca[0x0][_0xebed('0x9e')],_0xebed('0xa1'));}else{_0x11e8a5[_0xebed('0x44')]=_0xebed('0xa2');logger[_0xebed('0x81')](_0xebed('0xa3')+_0x11e8a5[_0xebed('0x49')]);}}};}function notSendMessagesQueue(_0x2a0f8e){if(_0x2a0f8e['sendMessageOneNotActive']){freeVariablesPredictive(_0x2a0f8e);if(_0x2a0f8e[_0xebed('0x76')]===0x0&&_0x2a0f8e[_0xebed('0x58')]===0x0&&_0x2a0f8e['waiting']===0x0&&(_0x2a0f8e['pTalking']||0x0)===0x0){_0x2a0f8e['sendMessageOneNotActive']=![];_0x2a0f8e[_0xebed('0xa4')]=0x0;_0x2a0f8e[_0xebed('0x44')]=_0xebed('0x46');}else{_0x2a0f8e[_0xebed('0x44')]=_0xebed('0xa5');}emitVoiceQueueSummary(_0x2a0f8e);}}function notSendMessagesCampaign(_0x50e310){if(_0x50e310[_0xebed('0xa6')]){if(_0x50e310[_0xebed('0x76')]===0x0){_0x50e310['sendMessageOneNotActive']=![];_0x50e310[_0xebed('0x44')]=_0xebed('0x46');}else{_0x50e310[_0xebed('0x44')]=_0xebed('0xa5');}emitCampaignSummary(_0x50e310);}}function createObjHistory(_0x3b9849,_0x3bafaf,_0x3b7340,_0x31c767,_0x2fd088){_0x3b9849[_0xebed('0x44')]=_0x3b7340;var _0x322e8=new Action(_0x3b9849,_0x3bafaf);var _0x2a04d9=new History(_0x322e8);_0x2a04d9[_0xebed('0xa7')]=_0x31c767;_0x2a04d9[_0xebed('0xa8')]=_0x2fd088;_0x2a04d9['endtime']=_0x322e8[_0xebed('0xa9')];return _0x2a04d9;}Dialer[_0xebed('0xaa')][_0xebed('0x40')]=function(){var _0x1a9a6f=this;setInterval(function(){_0x1a9a6f[_0xebed('0xab')](_0x1a9a6f['uniqueId'],_0xebed('0xac'));_0x1a9a6f[_0xebed('0xab')](_0x1a9a6f['actions'],_0xebed('0xad'));},0x32c8);};Dialer[_0xebed('0xaa')]['clearZombieChannels']=function(_0x22acf1,_0xed666e){var _0xf74dc5=this;for(var _0x32ca38 in _0x22acf1){if(typeof _0x22acf1[_0x32ca38]!==_0xebed('0x9b')){this[_0xebed('0x20')][_0xebed('0x1d')](function(){if(!_['isNil'](_0x22acf1[_0x32ca38])){return ami['Action']({'action':_0xebed('0xae'),'channel':_0x22acf1[_0x32ca38]['channel']})['catch'](function(_0x2ef449){if(_0x2ef449[_0xebed('0x44')]===_0xebed('0xaf')){setTimeout(function(){if(_0x22acf1[_0x32ca38]&&_0x22acf1[_0x32ca38][_0xebed('0x5a')]!==_0xebed('0x93')){_0xf74dc5[_0xebed('0xb0')](_0xf74dc5[_0xebed('0xb1')][_0x22acf1[_0x32ca38][_0xebed('0xb2')]]);logger[_0xebed('0x98')](_0xebed('0xb3'),_0xed666e,_0x32ca38,_0x22acf1[_0x32ca38][_0xebed('0xb2')]);delete _0x22acf1[_0x32ca38];}if(_0x22acf1[_0x32ca38]&&_0x22acf1[_0x32ca38]['type']===_0xebed('0x93')){_0xf74dc5[_0xebed('0xb0')](_0xf74dc5[_0xebed('0x22')][_0x22acf1[_0x32ca38]['queue']]);logger[_0xebed('0x98')]('[Dialer][checkChannel][ivr]',_0xed666e,_0x32ca38,_0x22acf1[_0x32ca38][_0xebed('0xb2')]);delete _0x22acf1[_0x32ca38];}},0x2328);}});}});}}};Dialer[_0xebed('0xaa')][_0xebed('0xb4')]=function(_0x39e1fc){return BPromise[_0xebed('0xb5')]()[_0xebed('0x42')](cmHopper[_0xebed('0xb4')](_0x39e1fc))[_0xebed('0xb6')](loggerCatch(_0xebed('0xb7')));};Dialer[_0xebed('0xaa')][_0xebed('0xb8')]=function(_0x54dbfc){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackList'](_0x54dbfc))[_0xebed('0xb6')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xebed('0xaa')]['checkIsBlackListIvr']=function(_0x8d9c4c){return BPromise[_0xebed('0xb5')]()[_0xebed('0x42')](cmHopperBlack[_0xebed('0xb9')](_0x8d9c4c))[_0xebed('0xb6')](loggerCatch(_0xebed('0xba')));};Dialer[_0xebed('0xaa')][_0xebed('0xbb')]=function(_0x1560b6){return BPromise['resolve']()[_0xebed('0x42')](cmHopperHistory[_0xebed('0xbc')](_0x1560b6))[_0xebed('0xb6')](loggerCatch(_0xebed('0xbd')));};Dialer[_0xebed('0xaa')][_0xebed('0xbe')]=function(_0x57884a){return BPromise['resolve']()[_0xebed('0x42')](cmHopper[_0xebed('0xbe')](_0x57884a))[_0xebed('0xb6')](loggerCatch(_0xebed('0xbf')));};Dialer[_0xebed('0xaa')][_0xebed('0xc0')]=function(_0x2bd8bd,_0x2e84a4,_0x2f809f){return BPromise[_0xebed('0xb5')]()['then'](cmHopper[_0xebed('0xc0')](_0x2bd8bd,_0x2e84a4,_0x2f809f))[_0xebed('0xb6')](loggerCatch(_0xebed('0xc1')));};Dialer['prototype'][_0xebed('0xc2')]=function(_0x24ecd0,_0x9e1330,_0x12b528,_0x382c20,_0x181b59){return BPromise[_0xebed('0xb5')]()[_0xebed('0x42')](cmHopper['getContactDialer'](_0x24ecd0,_0x9e1330,_0x12b528,_0x382c20))[_0xebed('0xb6')](function(_0x4db167){_0x181b59[_0xebed('0xc3')]-=_0x12b528;_0x181b59[_0xebed('0xc3')]=_0x181b59['temp']>0x0?_0x181b59[_0xebed('0xc3')]:0x0;loggerCatch(_0xebed('0xc4'))(_0x4db167);});};Dialer[_0xebed('0xaa')][_0xebed('0xc5')]=function(_0x1cc20d,_0x3d022d,_0x4eb6fa,_0x25aed5){return BPromise['resolve']()[_0xebed('0x42')](cmHopper[_0xebed('0xc5')](_0x1cc20d,_0x3d022d,_0x4eb6fa))[_0xebed('0xb6')](function(_0x527c93){_0x25aed5[_0xebed('0xc3')]-=_0x3d022d;_0x25aed5['temp']=_0x25aed5['temp']>0x0?_0x25aed5[_0xebed('0xc3')]:0x0;loggerCatch(_0xebed('0xc6'))(_0x527c93);});};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x2dfa58){return BPromise[_0xebed('0xb5')]()['then'](voiceQueueRt[_0xebed('0xc7')](_0x2dfa58))[_0xebed('0xb6')](loggerCatch(_0xebed('0xc8')));};Dialer[_0xebed('0xaa')]['moveContactManagedDialer']=function(_0x4a618c){return BPromise[_0xebed('0xb5')]()[_0xebed('0x42')](cmHopper[_0xebed('0xc9')](_0x4a618c))[_0xebed('0xb6')](loggerCatch(_0xebed('0xca')));};Dialer[_0xebed('0xaa')][_0xebed('0xcb')]=function(_0x87a38d){return BPromise[_0xebed('0xb5')]()[_0xebed('0x42')](cmHopperHistory[_0xebed('0xcb')](_0x87a38d))[_0xebed('0xb6')](loggerCatch(_0xebed('0xcc')));};Dialer[_0xebed('0xaa')][_0xebed('0xb0')]=function(_0x47ea0b){if(!_['isUndefined'](_0x47ea0b)&&_0x47ea0b!==null){if(typeof _0x47ea0b[_0xebed('0x76')]!=='undefined'){if(_0x47ea0b[_0xebed('0x76')]>0x0){_0x47ea0b[_0xebed('0x76')]-=0x1;}else{logger['error'](_0xebed('0xcd'));}}}else{logger[_0xebed('0x98')](_0xebed('0xce'));}};Dialer[_0xebed('0xaa')][_0xebed('0xcf')]=function(_0xdda52,_0x1a9927){var _0x309456=this;return function(_0x55cd84){_0x309456['updateOriginated'](_0x1a9927);logger[_0xebed('0x98')](_0xdda52,util[_0xebed('0x99')](_0x55cd84,{'showHidden':![],'depth':null}));};};Dialer[_0xebed('0xaa')][_0xebed('0xd0')]=function(_0x6ced62,_0x240ebf,_0x1c3c16){var _0x729d51={'state':0x19,'statedesc':_0xebed('0xd1')};this[_0xebed('0xb0')](_0x240ebf);this[_0xebed('0xd2')](_[_0xebed('0x8d')](_0x729d51,_[_0xebed('0xd3')](_0x1c3c16,[_0xebed('0xd4'),_0xebed('0xd5'),_0xebed('0xd6'),_0xebed('0xd7'),'CampaignId'])),_0xebed('0xd8'),'[emptyContact]');logger[_0xebed('0x98')](_0x6ced62);};Dialer[_0xebed('0xaa')][_0xebed('0xd9')]=function(_0x4d6538){return _0x4d6538===_0xebed('0xda');};Dialer['prototype']['isTrunkReachable']=function(_0x3bb59e){return!_[_0xebed('0x43')](_0x3bb59e)&&_0x3bb59e&&!_['isUndefined'](_0x3bb59e[_0xebed('0x49')])&&!_[_0xebed('0x43')](_0x3bb59e[_0xebed('0x7b')])&&_0x3bb59e['active']&&(this[_0xebed('0x24')][util[_0xebed('0xdb')]('SIP/%s',_0x3bb59e[_0xebed('0x49')])][_0xebed('0xae')]===_0xebed('0xdc')||this[_0xebed('0x24')][util[_0xebed('0xdb')](_0xebed('0xdd'),_0x3bb59e[_0xebed('0x49')])][_0xebed('0xae')]==='unmonitored');};Dialer[_0xebed('0xaa')][_0xebed('0xd2')]=function(_0x4c7415,_0xaf1d13,_0x320225){this[_0xebed('0xcb')](_0x4c7415)[_0xebed('0xb6')](loggerCatch(_0xaf1d13));this['moveContactManagedDialer'](_0x4c7415)[_0xebed('0xb6')](loggerCatch(_0x320225));};Dialer[_0xebed('0xaa')]['syncVarSet']=function(_0x23eb1e){var _0x279f10=this[_0xebed('0x29')][_0x23eb1e[_0xebed('0xde')]];var _0x43c120;if(!_[_0xebed('0xdf')](_0x23eb1e)&&!_[_0xebed('0xdf')](_0x23eb1e[_0xebed('0xe0')])&&!_[_0xebed('0xdf')](_0x23eb1e[_0xebed('0xe0')]['amdstatus'])&&_0x23eb1e[_0xebed('0xe1')]===_0xebed('0xe2')&&_0x279f10){if(_0x279f10[_0xebed('0x5a')]!==_0xebed('0x93')&&this[_0xebed('0xb1')][_0x279f10[_0xebed('0xb2')]][_0xebed('0xe3')]&&_0x23eb1e['value']===_0xebed('0xe4')){delete this['uniqueId'][_0x23eb1e['uniqueid']];this[_0xebed('0xb0')](this['voiceQueues'][_0x279f10['queue']]);this[_0xebed('0xb1')][_0x279f10[_0xebed('0xb2')]]['outboundAnswerCallsDay']+=0x1;this[_0xebed('0xb1')][_0x279f10[_0xebed('0xb2')]][_0xebed('0x62')]+=0x1;_0x43c120=new Hangup(_0x279f10,_0x23eb1e);_0x43c120[_0xebed('0xa7')]=0x12;_0x43c120['statedesc']='HangupInAMD';_0x43c120[_0xebed('0xe5')]='AMD';ami[_0xebed('0x51')]('custom:amd',ut[_0xebed('0xe6')](_0x43c120,_0xebed('0xe7')));this[_0xebed('0xd2')](_0x43c120,_0xebed('0xe8'),_0xebed('0xe9'));}if(_0x279f10[_0xebed('0x5a')]!==_0xebed('0x93')&&this[_0xebed('0xb1')][_0x279f10[_0xebed('0xb2')]][_0xebed('0xe3')]&&_0x23eb1e[_0xebed('0xea')]==='MACHINE'){var _0x1fd47a=this;return new BPromise(function(_0x406bba,_0x49d0d1){delete _0x1fd47a[_0xebed('0x29')][_0x23eb1e['uniqueid']];_0x1fd47a[_0xebed('0xb0')](_0x1fd47a[_0xebed('0xb1')][_0x279f10[_0xebed('0xb2')]]);_0x1fd47a['voiceQueues'][_0x279f10['queue']][_0xebed('0x63')]+=0x1;_0x1fd47a['voiceQueues'][_0x279f10['queue']][_0xebed('0x62')]+=0x1;var _0x1fcd18=_0x1fd47a[_0xebed('0xb1')][_0x279f10[_0xebed('0xb2')]];var _0x3f1a61=new Hangup(_0x279f10,_0x23eb1e);_0x3f1a61[_0xebed('0xa7')]=0x13;_0x3f1a61[_0xebed('0xa8')]='Machine';_0x3f1a61['membername']=_0xebed('0xeb');_0x3f1a61[_0xebed('0xec')]+=0x1;_0x3f1a61[_0xebed('0xed')]+=0x1;_0x3f1a61[_0xebed('0xe7')]=!![];ami[_0xebed('0x51')](_0xebed('0xee'),ut['buildObj'](_0x3f1a61,_0xebed('0xe7')));_0x1fd47a[_0xebed('0xcb')](_0x3f1a61)[_0xebed('0xb6')](loggerCatch(_0xebed('0xef')));if(_0x3f1a61['countbusyretry']+_0x3f1a61[_0xebed('0xf0')]+_0x3f1a61[_0xebed('0xf1')]+_0x3f1a61[_0xebed('0xf2')]+_0x3f1a61[_0xebed('0xf3')]+_0x3f1a61[_0xebed('0xf4')]+_0x3f1a61[_0xebed('0xec')]+_0x3f1a61[_0xebed('0xf5')]>=_0x1fcd18[_0xebed('0xf6')]){_0x1fd47a[_0xebed('0xf7')](_0x3f1a61,_0x406bba,_0x49d0d1,_0xebed('0xf8'));}else{if(_0x3f1a61['countmachineretry']>=_0x1fcd18['dialMachineMaxRetry']){_0x1fd47a[_0xebed('0xf9')](_0x3f1a61,_0x406bba,_0x49d0d1,_0xebed('0xfa'));}else{_0x1fd47a[_0xebed('0xbe')]({'active':![],'countmachineretry':_0x3f1a61['countmachineretry'],'scheduledat':moment()[_0xebed('0xfb')](_0x1fcd18['dialMachineRetryFrequency'],'minutes')[_0xebed('0xdb')](_0xebed('0xfc')),'ContactId':_0x3f1a61[_0xebed('0xd4')],'ListId':_0x3f1a61['ListId'],'VoiceQueueId':_0x3f1a61[_0xebed('0xd7')]||undefined,'CampaignId':_0x3f1a61[_0xebed('0xfd')]||undefined})[_0xebed('0xb6')](loggerCatch(_0xebed('0xfe')));_0x406bba({'reschedule':0x1});}}});}if(_0x279f10[_0xebed('0x5a')]===_0xebed('0x93')&&this[_0xebed('0x22')][_0x279f10[_0xebed('0xb2')]][_0xebed('0xe3')]&&_0x23eb1e[_0xebed('0xea')]==='HANGUP'){delete this[_0xebed('0x29')][_0x23eb1e[_0xebed('0xde')]];this[_0xebed('0xb0')](this[_0xebed('0x22')][_0x279f10[_0xebed('0xb2')]]);_0x43c120=new Hangup(_0x279f10,_0x23eb1e);_0x43c120[_0xebed('0xa7')]=0x12;_0x43c120[_0xebed('0xa8')]='HangupInAMD';_0x43c120['membername']='AMD';ami['emit']('custom:amd',ut[_0xebed('0xe6')](_0x43c120,_0xebed('0xe7')));this[_0xebed('0xd2')](_0x43c120,_0xebed('0xff'),_0xebed('0x100'));}if(_0x279f10[_0xebed('0x5a')]===_0xebed('0x93')&&this[_0xebed('0x22')][_0x279f10[_0xebed('0xb2')]][_0xebed('0xe3')]&&_0x23eb1e[_0xebed('0xea')]===_0xebed('0x101')){var _0x1fd47a=this;return new BPromise(function(_0x1d6a67,_0x325691){delete _0x1fd47a['uniqueId'][_0x23eb1e[_0xebed('0xde')]];_0x1fd47a[_0xebed('0xb0')](_0x1fd47a['campaigns'][_0x279f10['queue']]);_0x1fd47a[_0xebed('0x22')][_0x279f10[_0xebed('0xb2')]][_0xebed('0x63')]+=0x1;_0x1fd47a[_0xebed('0x22')][_0x279f10[_0xebed('0xb2')]][_0xebed('0x62')]+=0x1;var _0x19cf32=_0x1fd47a[_0xebed('0x22')][_0x279f10[_0xebed('0xb2')]];var _0x4431b6=new Hangup(_0x279f10,_0x23eb1e);_0x4431b6['state']=0x13;_0x4431b6[_0xebed('0xa8')]='Machine';_0x4431b6[_0xebed('0xe5')]=_0xebed('0xeb');_0x4431b6['countmachineretry']+=0x1;_0x4431b6[_0xebed('0xed')]+=0x1;_0x4431b6[_0xebed('0xe7')]=!![];ami[_0xebed('0x51')](_0xebed('0xee'),ut[_0xebed('0xe6')](_0x4431b6,_0xebed('0xe7')));_0x1fd47a['createHistory'](_0x4431b6)[_0xebed('0xb6')](loggerCatch(_0xebed('0xef')));if(_0x4431b6['countbusyretry']+_0x4431b6[_0xebed('0xf0')]+_0x4431b6[_0xebed('0xf1')]+_0x4431b6[_0xebed('0xf2')]+_0x4431b6[_0xebed('0xf3')]+_0x4431b6[_0xebed('0xf4')]+_0x4431b6['countmachineretry']+_0x4431b6[_0xebed('0xf5')]>=_0x19cf32[_0xebed('0xf6')]){_0x1fd47a[_0xebed('0xf7')](_0x4431b6,_0x1d6a67,_0x325691,_0xebed('0xf8'));}else{if(_0x4431b6[_0xebed('0xec')]>=_0x19cf32[_0xebed('0x102')]){_0x1fd47a[_0xebed('0xf9')](_0x4431b6,_0x1d6a67,_0x325691,'reason\x2019\x20machine....');}else{_0x1fd47a['rescheduleContact']({'active':![],'countmachineretry':_0x4431b6[_0xebed('0xec')],'scheduledat':moment()['add'](_0x19cf32[_0xebed('0x103')],_0xebed('0x104'))[_0xebed('0xdb')](_0xebed('0xfc')),'ContactId':_0x4431b6[_0xebed('0xd4')],'ListId':_0x4431b6[_0xebed('0xd5')],'VoiceQueueId':_0x4431b6['VoiceQueueId']||undefined,'CampaignId':_0x4431b6[_0xebed('0xfd')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x1d6a67({'reschedule':0x1});}}});}}};Dialer[_0xebed('0xaa')][_0xebed('0x37')]=function(_0x3ee86b){var _0x5c9d59=this[_0xebed('0x29')][_0x3ee86b['uniqueid']];var _0x25dff4=this;var _0x43e9f3;if(_0x5c9d59&&_0x5c9d59[_0xebed('0x5a')]===_0xebed('0x93')){delete this[_0xebed('0x29')][_0x3ee86b[_0xebed('0xde')]];this[_0xebed('0xb0')](this['campaigns'][_0x5c9d59['queue']]);this['campaigns'][_0x5c9d59[_0xebed('0xb2')]][_0xebed('0x105')]+=0x1;_0x43e9f3=new Hangup(_0x5c9d59,_0x3ee86b);this[_0xebed('0xcb')](_0x43e9f3)[_0xebed('0xb6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xebed('0xc9')](_0x43e9f3)[_0xebed('0xb6')](loggerCatch(_0xebed('0x106')));}if(_0x5c9d59&&_0x5c9d59[_0xebed('0x5a')]!==_0xebed('0x93')&&isNotNull(this[_0xebed('0xb1')][_0x5c9d59[_0xebed('0xb2')]][_0xebed('0x107')])){delete this[_0xebed('0x29')][_0x3ee86b[_0xebed('0xde')]];this[_0xebed('0xb0')](this['voiceQueues'][_0x5c9d59[_0xebed('0xb2')]]);this[_0xebed('0xb1')][_0x5c9d59[_0xebed('0xb2')]][_0xebed('0x63')]+=0x1;this['voiceQueues'][_0x5c9d59['queue']][_0xebed('0x62')]+=0x1;_0x43e9f3=new Hangup(_0x5c9d59,_0x3ee86b);_0x43e9f3[_0xebed('0xa7')]=0x10;_0x43e9f3[_0xebed('0xa8')]=_0xebed('0x108');_0x43e9f3[_0xebed('0xe5')]=_0xebed('0x109');this[_0xebed('0xcb')](_0x43e9f3)['catch'](loggerCatch(_0xebed('0x10a')));this[_0xebed('0xc9')](_0x43e9f3)[_0xebed('0xb6')](loggerCatch(_0xebed('0x106')));}if(_0x5c9d59&&_0x5c9d59[_0xebed('0x5a')]!=='ivr'&&!isNotNull(this[_0xebed('0xb1')][_0x5c9d59[_0xebed('0xb2')]]['dialQueueProject'])){delete this[_0xebed('0x29')][_0x3ee86b[_0xebed('0xde')]];this['updateOriginated'](this[_0xebed('0xb1')][_0x5c9d59[_0xebed('0xb2')]]);this['voiceQueues'][_0x5c9d59[_0xebed('0xb2')]][_0xebed('0x10b')]+=0x1;_0x43e9f3=new Hangup(_0x5c9d59,_0x3ee86b);_0x43e9f3[_0xebed('0xa7')]=0xc;_0x43e9f3[_0xebed('0xa8')]=_0x3ee86b[_0xebed('0x10c')];_0x43e9f3[_0xebed('0xe5')]=_0xebed('0x10d');this['createHistory'](_0x43e9f3)['catch'](loggerCatch(_0xebed('0x10a')));this[_0xebed('0xc9')](_0x43e9f3)[_0xebed('0xb6')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0xebed('0x10e')]=function(_0x3a57f1){var _0x2bf98a=this['uniqueId'][_0x3a57f1[_0xebed('0xde')]];var _0x2e029e=this;if(this[_0xebed('0xb1')][_0x3a57f1[_0xebed('0xb2')]]){if(_0x2bf98a&&_0x2bf98a[_0xebed('0x5a')]!==_0xebed('0x93')){delete this[_0xebed('0x29')][_0x3a57f1[_0xebed('0xde')]];this['voiceQueues'][_0x3a57f1[_0xebed('0xb2')]][_0xebed('0x63')]+=0x1;var _0x4fc01f=new AgentComplete(_0x2bf98a,_0x3a57f1);if(_0x3a57f1[_0xebed('0x10f')]===_0xebed('0x110')){_0x4fc01f[_0xebed('0x111')]=this[_0xebed('0xb1')][_0x3a57f1[_0xebed('0xb2')]][_0xebed('0x112')]&&this['voiceQueues'][_0x3a57f1[_0xebed('0xb2')]][_0xebed('0x113')]?moment()[_0xebed('0xdb')](_0xebed('0xfc')):undefined;}this[_0xebed('0xcb')](_0x4fc01f)['catch'](loggerCatch(_0xebed('0x114')));this['moveContactManagedDialer'](_0x4fc01f)[_0xebed('0xb6')](loggerCatch(_0xebed('0x115')));}}};Dialer[_0xebed('0xaa')][_0xebed('0x116')]=function(_0x26a483){if(this[_0xebed('0xb1')][_0x26a483[_0xebed('0xb2')]]){if(this[_0xebed('0x29')][_0x26a483[_0xebed('0xde')]]&&this[_0xebed('0x29')][_0x26a483[_0xebed('0xde')]]['type']!=='ivr'){this['updateOriginated'](this[_0xebed('0xb1')][_0x26a483[_0xebed('0xb2')]]);this[_0xebed('0x29')][_0x26a483[_0xebed('0xde')]][_0xebed('0x117')]=moment()[_0xebed('0xdb')](_0xebed('0xfc'));}}};Dialer[_0xebed('0xaa')][_0xebed('0x118')]=function(_0x5ad10c){this[_0xebed('0xcb')](_0x5ad10c)['catch'](loggerCatch(_0xebed('0x114')));this[_0xebed('0xc9')](_0x5ad10c)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xebed('0xaa')][_0xebed('0x30')]=function(_0x50c540){var _0x2f8a6e=this[_0xebed('0x29')][_0x50c540[_0xebed('0xde')]];var _0x3d6809=this;if(this[_0xebed('0xb1')][_0x50c540['queue']]){if(_0x2f8a6e&&_0x2f8a6e['type']!==_0xebed('0x93')){delete this[_0xebed('0x29')][_0x50c540[_0xebed('0xde')]];this[_0xebed('0xb0')](this[_0xebed('0xb1')][_0x50c540[_0xebed('0xb2')]]);_0x2f8a6e['droptime']=moment()[_0xebed('0xdb')](_0xebed('0xfc'));var _0x470ba0=new QueueCallerAbandon(_0x2f8a6e,_0x50c540);if(getSeconds(_0x2f8a6e[_0xebed('0x119')],_0x2f8a6e['responsetime'])>=_0x2f8a6e[_0xebed('0x11a')]){this[_0xebed('0xb1')][_0x50c540['queue']][_0xebed('0x71')]+=0x1;this[_0xebed('0xb1')][_0x50c540['queue']][_0xebed('0x69')]+=0x1;this['voiceQueues'][_0x50c540[_0xebed('0xb2')]][_0xebed('0x11b')]+=0x1;_0x470ba0[_0xebed('0xa7')]=0xa;_0x470ba0[_0xebed('0xa8')]='Drop';_0x470ba0[_0xebed('0x11c')]=_0xebed('0x11d');_0x470ba0[_0xebed('0x111')]=this['voiceQueues'][_0x50c540[_0xebed('0xb2')]][_0xebed('0x112')]?moment()['format'](_0xebed('0xfc')):undefined;_0x470ba0['countdropretry']+=0x1;_0x470ba0[_0xebed('0xed')]+=0x1;if(_0x470ba0['countdropretry']>=this[_0xebed('0xb1')][_0x50c540['queue']][_0xebed('0x11e')]){this[_0xebed('0x118')](_0x470ba0);}else{this[_0xebed('0xbe')]({'active':![],'countdropretry':_0x470ba0[_0xebed('0xf3')],'scheduledat':moment()[_0xebed('0xfb')](this['voiceQueues'][_0x50c540[_0xebed('0xb2')]][_0xebed('0x11f')],'minutes')[_0xebed('0xdb')](_0xebed('0xfc')),'ContactId':_0x2f8a6e['ContactId'],'ListId':_0x2f8a6e[_0xebed('0xd5')],'VoiceQueueId':_0x2f8a6e[_0xebed('0xd7')]||undefined,'CampaignId':_0x2f8a6e[_0xebed('0xfd')]||undefined})[_0xebed('0xb6')](loggerCatch(_0xebed('0x120')));var _0x15fa37=new History(_0x470ba0);_0x15fa37[_0xebed('0xa7')]=0xa;_0x15fa37[_0xebed('0xa8')]='Drop';_0x15fa37[_0xebed('0xa9')]=moment()[_0xebed('0xdb')](_0xebed('0xfc'));_0x15fa37[_0xebed('0x121')]=_0x15fa37['starttime'];_0x15fa37[_0xebed('0x122')]=_0x470ba0[_0xebed('0x122')];_0x15fa37[_0xebed('0x123')]=_0x470ba0[_0xebed('0x123')];this[_0xebed('0xcb')](_0x15fa37)[_0xebed('0xb6')](loggerCatch(_0xebed('0x124')));}}else{this['voiceQueues'][_0x50c540[_0xebed('0xb2')]][_0xebed('0x70')]+=0x1;this[_0xebed('0xb1')][_0x50c540[_0xebed('0xb2')]][_0xebed('0x68')]+=0x1;_0x470ba0['state']=0xb;_0x470ba0[_0xebed('0xa8')]='Abandoned';_0x470ba0['dropreason']=_0xebed('0x125');_0x470ba0[_0xebed('0xf4')]+=0x1;_0x470ba0['countglobal']+=0x1;if(_0x470ba0['countabandonedretry']>=this[_0xebed('0xb1')][_0x50c540['queue']][_0xebed('0x126')]){this[_0xebed('0x118')](_0x470ba0);}else{this[_0xebed('0xbe')]({'active':![],'countabandonedretry':_0x470ba0['countabandonedretry'],'scheduledat':moment()[_0xebed('0xfb')](this[_0xebed('0xb1')][_0x50c540[_0xebed('0xb2')]]['dialAbandonedRetryFrequency'],_0xebed('0x104'))['format'](_0xebed('0xfc')),'ContactId':_0x2f8a6e[_0xebed('0xd4')],'ListId':_0x2f8a6e[_0xebed('0xd5')],'VoiceQueueId':_0x2f8a6e['VoiceQueueId']||undefined,'CampaignId':_0x2f8a6e[_0xebed('0xfd')]||undefined})['catch'](loggerCatch(_0xebed('0x127')));var _0x15fa37=new History(_0x470ba0);_0x15fa37[_0xebed('0xa7')]=0xb;_0x15fa37[_0xebed('0xa8')]=_0xebed('0x128');_0x15fa37[_0xebed('0xa9')]=moment()['format'](_0xebed('0xfc'));_0x15fa37[_0xebed('0x121')]=_0x15fa37['starttime'];_0x15fa37[_0xebed('0x122')]=_0x470ba0[_0xebed('0x122')];_0x15fa37[_0xebed('0x123')]=_0x470ba0[_0xebed('0x123')];this[_0xebed('0xcb')](_0x15fa37)['catch'](loggerCatch(_0xebed('0x129')));}}}}};Dialer[_0xebed('0xaa')]['syncNewExten']=function(_0x50e2a4){if(this[_0xebed('0x27')][_0x50e2a4['uniqueid']]){this[_0xebed('0x27')][_0x50e2a4['uniqueid']][_0xebed('0x12a')]=_0x50e2a4[_0xebed('0x12a')];}if(this[_0xebed('0x29')][_0x50e2a4[_0xebed('0xde')]]){this[_0xebed('0x29')][_0x50e2a4[_0xebed('0xde')]][_0xebed('0x12a')]=_0x50e2a4[_0xebed('0x12a')];}};Dialer[_0xebed('0xaa')][_0xebed('0x3d')]=function(_0x2a050c){if(strategy[this[_0xebed('0xb1')][this[_0xebed('0x27')][_0x2a050c[_0xebed('0x12b')]]['queue']][_0xebed('0x53')]]==='roundrobin'){if(this[_0xebed('0x27')][_0x2a050c[_0xebed('0x12b')]]&&_[_0xebed('0xdf')](this[_0xebed('0x27')][_0x2a050c['actionid']][_0xebed('0x12c')])&&_0x2a050c[_0xebed('0xae')]==='1'&&_0x2a050c[_0xebed('0x12d')]==='0'){if(this[_0xebed('0x23')][_0x2a050c['stateinterface']]){if(!this['agents'][_0x2a050c['stateinterface']][_0xebed('0x12c')]){this[_0xebed('0x23')][_0x2a050c[_0xebed('0x12e')]]['locked']=!![];this[_0xebed('0x27')][_0x2a050c[_0xebed('0x12b')]][_0xebed('0x12c')]=!![];this[_0xebed('0x27')][_0x2a050c[_0xebed('0x12b')]][_0xebed('0x12e')]=_0x2a050c[_0xebed('0x12e')];}}}}else if((strategy[this[_0xebed('0xb1')][this[_0xebed('0x27')][_0x2a050c[_0xebed('0x12b')]][_0xebed('0xb2')]]['strategy']]||'rrmemory')==='rrmemory'){if(this[_0xebed('0x27')][_0x2a050c['actionid']]){if(this[_0xebed('0x23')][_0x2a050c[_0xebed('0x12e')]]){this[_0xebed('0x27')][_0x2a050c[_0xebed('0x12b')]][_0xebed('0x12e')]=_0x2a050c[_0xebed('0x12e')];if(_[_0xebed('0xdf')](this[_0xebed('0x12f')][this['actions'][_0x2a050c[_0xebed('0x12b')]][_0xebed('0xb2')]])){this[_0xebed('0x12f')][this['actions'][_0x2a050c[_0xebed('0x12b')]][_0xebed('0xb2')]]=[];}this[_0xebed('0x12f')][this[_0xebed('0x27')][_0x2a050c['actionid']][_0xebed('0xb2')]]['push'](_[_0xebed('0x8d')](_[_0xebed('0xd3')](this[_0xebed('0x27')][_0x2a050c['actionid']],[_0xebed('0x130'),'stateinterface']),{'status':_0x2a050c[_0xebed('0xae')],'paused':_0x2a050c[_0xebed('0x12d')]}));}}}};function unlockQueueStatus(_0x4a5750,_0x377f76){setTimeout(function(){if(_[_0xebed('0x43')](_0x4a5750['queueStatusComplete'])){loggerBooked['error'](_0xebed('0x131'),_0x377f76);}_0x4a5750['queueStatusComplete']=!![];loggerBooked['info'](_0xebed('0x132'),_0x377f76,JSON[_0xebed('0x4e')](_[_0xebed('0xd3')](_0x4a5750,[_0xebed('0x49'),_0xebed('0x133')])));},0x1f3);}Dialer[_0xebed('0xaa')]['syncQueueStatusComplete']=function(_0x57a198){var _0xb8feaa=this;var _0x26d108=_0xb8feaa['voiceQueues'][_0xb8feaa[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]][_0xebed('0xb2')]];if(strategy[this[_0xebed('0xb1')][this[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]][_0xebed('0xb2')]]['strategy']]===_0xebed('0x1c')){if(this[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]]&&this[_0xebed('0x27')][_0x57a198['actionid']][_0xebed('0x12e')]){this[_0xebed('0x21')][_0xebed('0x134')](this['actions'][_0x57a198[_0xebed('0x12b')]][_0xebed('0x130')],this['actions'][_0x57a198[_0xebed('0x12b')]][_0xebed('0x12e')])['catch'](function(_0x5dba2c){logger['error'](_0xebed('0x135'),util['inspect'](_0x5dba2c,{'showHidden':![],'depth':null}));})['finally'](function(){_0xb8feaa[_0xebed('0xb0')](_0xb8feaa[_0xebed('0xb1')][_0xb8feaa[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]][_0xebed('0xb2')]]);_0xb8feaa[_0xebed('0x23')][_0xb8feaa[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]]['stateinterface']][_0xebed('0x12c')]=![];delete _0xb8feaa[_0xebed('0x27')][_0x57a198['actionid']];unlockQueueStatus(_0x26d108);});}else{this[_0xebed('0xb0')](this[_0xebed('0xb1')][this[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]][_0xebed('0xb2')]]);this[_0xebed('0xbe')]({'active':![],'ContactId':this[_0xebed('0x27')][_0x57a198['actionid']][_0xebed('0xd4')],'ListId':this[_0xebed('0x27')][_0x57a198['actionid']]['ListId'],'VoiceQueueId':this[_0xebed('0x27')][_0x57a198['actionid']][_0xebed('0xd7')]||undefined,'CampaignId':this[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]][_0xebed('0xfd')]||undefined})['catch'](loggerCatch(_0xebed('0x136')));delete this['actions'][_0x57a198[_0xebed('0x12b')]];unlockQueueStatus(_0x26d108);}}else if((strategy[this['voiceQueues'][this[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]][_0xebed('0xb2')]][_0xebed('0x53')]]||'rrmemory')===_0xebed('0x137')){var _0x2c197c;if(this['actions'][_0x57a198[_0xebed('0x12b')]]&&!_['isEmpty'](this[_0xebed('0x12f')][this[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]]['queue']])){if(this[_0xebed('0x2d')][_0xb8feaa[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]]['queue']]){this[_0xebed('0x2d')][_0xb8feaa[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]][_0xebed('0xb2')]]=this[_0xebed('0x2d')][this[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]][_0xebed('0xb2')]]?this[_0xebed('0x2d')][this[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]][_0xebed('0xb2')]]:this[_0xebed('0x12f')][this[_0xebed('0x27')][_0x57a198[_0xebed('0x12b')]][_0xebed('0xb2')]]?this[_0xebed('0x12f')][this[_0xebed('0x27')][_0x57a198['actionid']][_0xebed('0xb2')]][_0xebed('0x138')]||0x0:0x0;}this[_0xebed('0x12f')][this['actions'][_0x57a198[_0xebed('0x12b')]]['queue']][_0xebed('0x138')]=this['queueBookedRR'][this['actions'][_0x57a198[_0xebed('0x12b')]]['queue']];for(var _0x5113b8=0x0;_0x5113b8=0x0;})[_0xebed('0xb6')](myreject(_0x198b27)));}}else{_0xc27d37['push'](ami[_0xebed('0x150')]({'action':'command','command':util['format'](_0xebed('0x154'),_0x4d897c,!_['isUndefined'](config[_0xebed('0x14b')][_0xf29a29])?_0xf29a29:'')})[_0xebed('0x42')](function(_0x17d61c){return _0x17d61c['content']['indexOf']('true')>=0x0;})[_0xebed('0xb6')](myreject(_0x198b27)));}BPromise[_0xebed('0x155')](_0xc27d37)['then'](function(_0x5940e4){var _0xb21d28=_[_0xebed('0x156')](_0x5940e4);if(_0xb21d28){return _0x421ae1(_0xb21d28);}else{_0x2c48b5[_0xebed('0x44')]=_0x1b523a?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x198b27(msgResponse('[ifTime][promiseAll]',_0xebed('0x148'),_0xebed('0x157')+_0x1b523a+'\x20'+_0x440d42+_0xebed('0x158')+util[_0xebed('0x99')](_0x4d897c,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0xf29a29));}})[_0xebed('0xb6')](function(_0x294b6f){return _0x198b27(msgResponse(_0xebed('0x147'),_0xebed('0x148'),JSON['stringify'](_0x294b6f)));});});};Dialer[_0xebed('0xaa')][_0xebed('0x159')]=function(_0x2b0da1){var _0x4a0337=this;return function(){switch(_0x2b0da1[_0xebed('0x5e')]){case _0xebed('0x15a'):freeVariablesPredictive(_0x2b0da1);_0x4a0337[_0xebed('0x15b')](_0x2b0da1,0x1);break;case _0xebed('0x15c'):freeVariablesPredictive(_0x2b0da1);_0x4a0337[_0xebed('0x15b')](_0x2b0da1,_0x2b0da1[_0xebed('0x15d')]);break;case _0xebed('0xa'):_0x4a0337[_0xebed('0xa')](_0x2b0da1);break;case _0xebed('0x9'):freeVariablesPredictive(_0x2b0da1);_0x4a0337[_0xebed('0x15b')](_0x2b0da1,0x1);break;default:freeVariablesPredictive(_0x2b0da1);logger[_0xebed('0x98')](_0xebed('0x15e'),_0x2b0da1[_0xebed('0x49')],_0xebed('0x15f'));}};};Dialer[_0xebed('0xaa')][_0xebed('0x160')]=function(_0x3da3c5){var _0x4da89e=this;return function(){_0x4da89e[_0xebed('0x161')](_0x3da3c5);};};Dialer[_0xebed('0xaa')][_0xebed('0xb')]=function(_0x40995d){var _0x4e9ea5=this;if(isNotPreview(_0x40995d['dialMethod'])){if(isVoiceQueueOutbound(_0x40995d[_0xebed('0x5a')])&&isActive(_0x40995d[_0xebed('0x5d')])){_0x40995d[_0xebed('0xa6')]=!![];BPromise[_0xebed('0xb5')]()[_0xebed('0x42')](checkIsLoggedIn(_0x40995d,_0x40995d['loggedIn']))[_0xebed('0x42')](checkIsActive(_0x40995d,_0x40995d[_0xebed('0x5d')]))[_0xebed('0x42')](checkInterval(_0x40995d))['then'](_0x4e9ea5[_0xebed('0x142')](_0x40995d))['then'](_0x4e9ea5[_0xebed('0x146')](_0x40995d[_0xebed('0x162')],_0x40995d['dialTimezone'],_0x40995d[_0xebed('0x49')],_0x40995d))['then'](_0x4e9ea5[_0xebed('0x163')](_0x40995d[_0xebed('0x47')],_0x40995d[_0xebed('0x164')],_0x40995d[_0xebed('0x49')],_0x40995d))[_0xebed('0x42')](_0x4e9ea5['checkDialMethod'](_0x40995d))['catch'](loggerCatchQueueSummary(_0xebed('0x165'),_0x40995d));}else{notSendMessagesQueue(_0x40995d);}}else{freeVariablesPredictive(_0x40995d);}};Dialer[_0xebed('0xaa')][_0xebed('0x36')]=_['throttle'](function(){var _0x2a6a2c=_['filter'](this[_0xebed('0xb1')],function(_0x1ae69e){return _0x1ae69e[_0xebed('0x166')];});var _0x521944=_[_0xebed('0x167')](this[_0xebed('0x23')],function(_0x52cb54){return _0x52cb54[_0xebed('0x168')]&&_0x52cb54['status']==='reachable';});console[_0xebed('0x169')](_0xebed('0x36'),_[_0xebed('0x16a')](_0x2a6a2c,'id'),previewRecallmeReminderInterval,_[_0xebed('0x16a')](_0x521944,'id'));if(_0x2a6a2c[_0xebed('0x14e')]>0x0&&_0x521944['length']>0x0){return BPromise[_0xebed('0xb5')]()[_0xebed('0x42')](cmHopper[_0xebed('0x16b')](_[_0xebed('0x16a')](_0x2a6a2c,'id'),previewRecallmeReminderInterval,_[_0xebed('0x16a')](_0x521944,'id')))['then'](function(_0x1de697){console[_0xebed('0x169')]('checkPreviewRecallReminder\x20res',_0x1de697);for(var _0x34b6b0=0x0;_0x34b6b0<_0x1de697['length'];_0x34b6b0++){var _0x37882c=_0x1de697[_0x34b6b0][_0xebed('0x16c')][_0xebed('0x49')];if(_0x37882c)io['to'](util[_0xebed('0xdb')](_0xebed('0x16d'),_0x37882c))[_0xebed('0x51')](_0xebed('0x16e'),{'hopper':_0x1de697[_0x34b6b0]});}})[_0xebed('0xb6')](function(_0x35a4f6){logger[_0xebed('0x98')](_0xebed('0x16f'),_0x35a4f6);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xebed('0xaa')][_0xebed('0x141')]=function(){var _0x2fc940=this;var _0x2e22dc;for(var _0x257e9c in this[_0xebed('0x22')]){if(typeof this[_0xebed('0x22')][_0x257e9c]!==_0xebed('0x9b')){_0x2e22dc=this[_0xebed('0x22')][_0x257e9c];if(isCampaignIvr(_0x2e22dc[_0xebed('0x5a')])&&isActive(_0x2e22dc[_0xebed('0x7b')])){_0x2e22dc[_0xebed('0xa6')]=!![];BPromise[_0xebed('0xb5')]()[_0xebed('0x42')](checkIsActive(_0x2e22dc,_0x2e22dc[_0xebed('0x7b')]))[_0xebed('0x42')](checkInterval(_0x2e22dc))['then'](_0x2fc940[_0xebed('0x142')](_0x2e22dc))[_0xebed('0x42')](_0x2fc940[_0xebed('0x146')](_0x2e22dc[_0xebed('0x162')],_0x2e22dc['dialTimezone'],_0x2e22dc[_0xebed('0x49')],_0x2e22dc))[_0xebed('0x42')](_0x2fc940[_0xebed('0x163')](_0x2e22dc[_0xebed('0x47')],_0x2e22dc['dialTimezone'],_0x2e22dc[_0xebed('0x49')],_0x2e22dc))[_0xebed('0x42')](_0x2fc940[_0xebed('0x160')](_0x2e22dc))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x2e22dc));}else{notSendMessagesCampaign(_0x2e22dc);}}}};function getCallerIdRandom(_0x282ce6,_0x3e0557){var _0x54af42;var _0x479f7a;var _0x5b5cf1;if(_0x3e0557<=0x0){_0x3e0557=0x1;}_0x54af42=new RegExp(_0xebed('0x170')+_0x3e0557+'}$');_0x479f7a=Math[_0xebed('0x171')](0xa,_0x3e0557-0x1);_0x5b5cf1=Math['pow'](0xa,_0x3e0557)-0x1;return util[_0xebed('0xdb')]('%s',_[_0xebed('0x172')](_0x282ce6,_0x54af42,_['random'](_0x479f7a,_0x5b5cf1)));}function extractCalleridName(_0x123421){var _0x59f928=_0x123421[_0xebed('0x173')](/"(.*?)"/);return _0x59f928?_0x59f928[0x1]:_0x123421;}function extractCalleridNumber(_0x59a41b){var _0x39d64c=_0x59a41b[_0xebed('0x173')](/<(.*?)>/);return _0x39d64c?_0x39d64c[0x1]:_0x59a41b;}Dialer['prototype'][_0xebed('0x174')]=function(_0x45189f,_0x1699f1){var _0x3ddf1c=this;var _0x9f56aa=uuid['v4']();this[_0xebed('0x27')][_0x9f56aa]=new Action(_0x45189f,_0x1699f1,_0x9f56aa);return new BPromise(function(_0x1a90da,_0x681d46){if(_[_0xebed('0x43')](_0x45189f)&&typeof _0x45189f!=='object'){return _0x681d46(msgResponse(_0xebed('0x175'),_0xebed('0x148'),_0xebed('0x176')));}if(_[_0xebed('0x43')](_0x1699f1[_0xebed('0x177')][_0xebed('0x178')])||_0x1699f1[_0xebed('0x177')][_0xebed('0x178')]===null){return _0x681d46(msgResponse(_0xebed('0x175'),'Failure',_0xebed('0x179')));}var _0x1793dd={'XMD-CALLERID':_0x3ddf1c[_0xebed('0x27')][_0x9f56aa][_0xebed('0x17a')](),'XMD-AGI':_0x45189f[_0xebed('0x107')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x45189f['dialQueueProject']):_0xebed('0x17b'),'XMD-AGIAFTER':_0x45189f['dialQueueProject2']?util[_0xebed('0xdb')]('\x22agi://%s/square,%s\x22',ipAgi,_0x45189f[_0xebed('0x112')]):'NONE','XMD-QUEUE':_0x45189f['type']===_0xebed('0x52')?util[_0xebed('0xdb')](_0xebed('0x17c'),_0x45189f[_0xebed('0x49')],_0x45189f[_0xebed('0x17d')]||'',_0x45189f['dialAgiAfterHangupAgent']?'c':'',_0x45189f['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x1699f1['ContactId'],'XMD-CDRTYPE':_0xebed('0x8'),'CALLERID(all)':_0x3ddf1c[_0xebed('0x27')][_0x9f56aa][_0xebed('0x17a')](),'XMD-AMD':_0x45189f[_0xebed('0xe3')]?_0xebed('0x17e'):_0xebed('0x17b'),'XMD-DESTINATION':_0xebed('0xe2')};if(_0x45189f[_0xebed('0xe3')]){_0x1793dd[_0xebed('0x17f')]=_0x45189f['dialAMDInitialSilence']||0x9c4;_0x1793dd[_0xebed('0x180')]=_0x45189f[_0xebed('0x181')]||0x5dc;_0x1793dd[_0xebed('0x182')]=_0x45189f[_0xebed('0x183')]||0x320;_0x1793dd[_0xebed('0x184')]=_0x45189f['dialAMDTotalAnalysisTime']||0x1388;_0x1793dd['XMD-AMDMINWORDLENGTH']=_0x45189f[_0xebed('0x185')]||0x64;_0x1793dd[_0xebed('0x186')]=_0x45189f[_0xebed('0x187')]||0x32;_0x1793dd[_0xebed('0x188')]=_0x45189f[_0xebed('0x189')]||0x3;_0x1793dd['XMD-AMDSILENCETHRESHOLD']=_0x45189f[_0xebed('0x18a')]||0x100;_0x1793dd[_0xebed('0x18b')]=_0x45189f[_0xebed('0x18c')]||0x1388;}if(_0x45189f[_0xebed('0x5a')]==='outbound'){_0x1793dd[_0xebed('0x18d')]=_0x1699f1[_0xebed('0xd7')];}else{_0x1793dd[_0xebed('0x18e')]=_0x1699f1[_0xebed('0xfd')];}for(var _0x1772af in _0x1699f1['Contact']){if(typeof _0x1699f1[_0xebed('0x177')][_0x1772af]!==_0xebed('0x9b')){if(isNotNull(_0x1699f1[_0xebed('0x177')][_0x1772af])&&_0x1772af!=='id'&&_0x1772af!=='tags'&&_0x1772af!==_0xebed('0x18f')&&_0x1772af!==_0xebed('0x190')){_0x1793dd[util[_0xebed('0xdb')](_0xebed('0x191'),_0xebed('0x192'),_['toUpper'](_0x1772af))]=_0x1699f1[_0xebed('0x177')][_0x1772af];}}}var _0x1d6edf=_0x3ddf1c[_0xebed('0x143')](_0x45189f[_0xebed('0x7a')])?getCallerId(_0x45189f[_0xebed('0x7a')]['callerid'],_0x45189f[_0xebed('0x5f')],_0x45189f[_0xebed('0x193')]>0x0?getCallerIdRandom(_0x45189f[_0xebed('0x60')],_0x45189f[_0xebed('0x193')]):_0x45189f[_0xebed('0x60')]):getCallerId(_[_0xebed('0xdf')](_0x45189f[_0xebed('0x144')])?_0x45189f[_0xebed('0x7a')][_0xebed('0x7c')]:_0x45189f['TrunkBackup']['callerid'],_0x45189f['dialOriginateCallerIdName'],_0x45189f[_0xebed('0x193')]>0x0?getCallerIdRandom(_0x45189f[_0xebed('0x60')],_0x45189f[_0xebed('0x193')]):_0x45189f[_0xebed('0x60')]);if(_0x1d6edf){_0x1793dd[_0xebed('0x194')]=_0x3ddf1c[_0xebed('0x27')][_0x9f56aa][_0xebed('0x195')]=extractCalleridName(_0x1d6edf);_0x1793dd['XMD-ORIGINATECALLERIDNUM']=_0x3ddf1c['actions'][_0x9f56aa][_0xebed('0x196')]=extractCalleridNumber(_0x1d6edf);}return ami['Action']({'actionid':_0x9f56aa,'action':_0xebed('0x175'),'channel':_0x3ddf1c[_0xebed('0x143')](_0x45189f[_0xebed('0x7a')])?util[_0xebed('0xdb')](_0xebed('0x197'),_0x45189f[_0xebed('0x7a')][_0xebed('0x49')],isNotNull(_0x45189f[_0xebed('0x198')])?_0x45189f[_0xebed('0x198')]['trim']()||'':'',_0x45189f[_0xebed('0x199')]>0x0?_0x1699f1[_0xebed('0x177')][_0xebed('0x178')][_0xebed('0x19a')](_0x45189f[_0xebed('0x199')]):_0x1699f1[_0xebed('0x177')][_0xebed('0x178')]):util[_0xebed('0xdb')](_0xebed('0x197'),_[_0xebed('0xdf')](_0x45189f['TrunkBackup'])?_0x45189f[_0xebed('0x7a')][_0xebed('0x49')]:_0x45189f[_0xebed('0x144')][_0xebed('0x49')],isNotNull(_0x45189f[_0xebed('0x198')])?_0x45189f[_0xebed('0x198')]['trim']()||'':'',_0x45189f[_0xebed('0x199')]>0x0?_0x1699f1[_0xebed('0x177')][_0xebed('0x178')][_0xebed('0x19a')](_0x45189f['dialCutDigit']):_0x1699f1[_0xebed('0x177')][_0xebed('0x178')]),'callerid':_0x1d6edf,'Exten':_0xebed('0xe2'),'Context':_0xebed('0x19b'),'Priority':'1','variable':_0x1793dd,'timeout':(_0x45189f[_0xebed('0x61')]||0x1e)*0x3e8,'async':!![],'channelid':_0x9f56aa})[_0xebed('0x42')](function(_0x40ca02){return _0x1a90da(_0x40ca02);})['catch'](function(_0x3ac0cd){_0x45189f[_0xebed('0x19c')]+=0x1;var _0x437396=new History(_0x3ddf1c[_0xebed('0x27')][_0x9f56aa]);logger['error'](util[_0xebed('0xdb')](_0xebed('0x19d'),JSON[_0xebed('0x4e')](_0x3ac0cd)));_0x437396[_0xebed('0xa7')]=0xe;_0x437396[_0xebed('0xa8')]='OriginateError';_0x437396[_0xebed('0xa9')]=moment()[_0xebed('0xdb')]('YYYY-MM-DD\x20HH:mm:ss');_0x437396['endtime']=_0x437396[_0xebed('0xa9')];_0x3ddf1c['createHistory'](_0x437396)[_0xebed('0xb6')](loggerCatch('[originate][error]'));_0x3ddf1c[_0xebed('0xc9')](_0x437396)[_0xebed('0xb6')](loggerCatch(_0xebed('0x19e')))[_0xebed('0x1f')](function(){delete _0x3ddf1c[_0xebed('0x27')][_0x9f56aa];return _0x681d46(msgResponse(_0xebed('0x175'),'Error',_0xebed('0x19f')));});});});};Dialer[_0xebed('0xaa')][_0xebed('0x32')]=function(_0x11b997){var _0xf729c1=this[_0xebed('0x27')][_0x11b997['actionid']];if(_0xf729c1){delete this[_0xebed('0x27')][_0x11b997[_0xebed('0x12b')]];_0xf729c1['responsetime']=moment()[_0xebed('0xdb')](_0xebed('0xfc'));var _0x3ebc51=_0xf729c1[_0xebed('0x5a')]===_0xebed('0x93')?this[_0xebed('0x22')][_0xf729c1[_0xebed('0xb2')]]:this['voiceQueues'][_0xf729c1['getQueue']()];if(!this[_0xebed('0xd9')](_0x11b997[_0xebed('0x1a0')])){this['updateOriginated'](_0x3ebc51);return this[_0xebed('0x1a1')](_0xf729c1,_0x3ebc51,_0x11b997)[_0xebed('0xb6')](loggerCatch(_0xebed('0x1a2')));}this[_0xebed('0x29')][_0x11b997['uniqueid']]=_0xf729c1;}};Dialer[_0xebed('0xaa')]['checkRetriveMax']=function(_0x15627f,_0x21fa42,_0x4f7e00){var _0x84a86d=new History(_0x21fa42);if(_0x84a86d[_0xebed('0x1a3')]+_0x84a86d[_0xebed('0xf0')]+_0x84a86d[_0xebed('0xf1')]+_0x84a86d[_0xebed('0xf2')]+_0x84a86d[_0xebed('0xf3')]+_0x84a86d[_0xebed('0xf4')]+_0x84a86d[_0xebed('0xec')]+_0x84a86d['countagentrejectretry']>=_0x4f7e00['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x15627f){case 0x3:if(_0x84a86d[_0xebed('0xf1')]>=_0x4f7e00[_0xebed('0x1a4')]-0x1){return!![];}this[_0xebed('0xbe')]({'active':![],'countnoanswerretry':_0x84a86d[_0xebed('0xf1')]+=0x1,'scheduledat':moment()[_0xebed('0xfb')](_0x4f7e00['dialNoAnswerRetryFrequency'],_0xebed('0x104'))[_0xebed('0xdb')](_0xebed('0xfc')),'ContactId':_0x84a86d[_0xebed('0xd4')],'ListId':_0x84a86d[_0xebed('0xd5')],'VoiceQueueId':_0x84a86d[_0xebed('0xd7')]||undefined,'CampaignId':_0x84a86d['CampaignId']||undefined})[_0xebed('0xb6')](loggerCatch(_0xebed('0x1a5')));break;case 0x5:if(_0x84a86d[_0xebed('0x1a3')]>=_0x4f7e00[_0xebed('0x1a6')]-0x1){return!![];}this[_0xebed('0xbe')]({'active':![],'countbusyretry':_0x84a86d['countbusyretry']+=0x1,'scheduledat':moment()[_0xebed('0xfb')](_0x4f7e00['dialBusyRetryFrequency'],_0xebed('0x104'))[_0xebed('0xdb')](_0xebed('0xfc')),'ContactId':_0x84a86d[_0xebed('0xd4')],'ListId':_0x84a86d[_0xebed('0xd5')],'VoiceQueueId':_0x84a86d[_0xebed('0xd7')]||undefined,'CampaignId':_0x84a86d[_0xebed('0xfd')]||undefined})[_0xebed('0xb6')](loggerCatch(_0xebed('0x1a7')));break;case 0x8:if(_0x84a86d[_0xebed('0xf0')]>=_0x4f7e00[_0xebed('0x1a8')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x84a86d['countcongestionretry']+=0x1,'scheduledat':moment()[_0xebed('0xfb')](_0x4f7e00[_0xebed('0x1a9')],_0xebed('0x104'))['format'](_0xebed('0xfc')),'ContactId':_0x84a86d[_0xebed('0xd4')],'ListId':_0x84a86d[_0xebed('0xd5')],'VoiceQueueId':_0x84a86d[_0xebed('0xd7')]||undefined,'CampaignId':_0x84a86d['CampaignId']||undefined})[_0xebed('0xb6')](loggerCatch(_0xebed('0x1aa')));break;case 0x0:if(_0x84a86d['countnosuchnumberretry']>=_0x4f7e00['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xebed('0xbe')]({'active':![],'countnosuchnumberretry':_0x84a86d[_0xebed('0xf2')]+=0x1,'scheduledat':moment()[_0xebed('0xfb')](_0x4f7e00[_0xebed('0x1ab')],'minutes')[_0xebed('0xdb')](_0xebed('0xfc')),'ContactId':_0x84a86d[_0xebed('0xd4')],'ListId':_0x84a86d[_0xebed('0xd5')],'VoiceQueueId':_0x84a86d[_0xebed('0xd7')]||undefined,'CampaignId':_0x84a86d['CampaignId']||undefined})['catch'](loggerCatch(_0xebed('0x1ac')));}break;case 0xa:if(_0x84a86d[_0xebed('0xf3')]>=_0x4f7e00['dialDropMaxRetry']-0x1){return!![];}this[_0xebed('0xbe')]({'active':![],'countdropretry':_0x84a86d['countdropretry']+=0x1,'scheduledat':moment()[_0xebed('0xfb')](_0x4f7e00['dialDropRetryFrequency'],'minutes')['format'](_0xebed('0xfc')),'ContactId':_0x84a86d[_0xebed('0xd4')],'ListId':_0x84a86d[_0xebed('0xd5')],'VoiceQueueId':_0x84a86d[_0xebed('0xd7')]||undefined,'CampaignId':_0x84a86d['CampaignId']||undefined})[_0xebed('0xb6')](loggerCatch(_0xebed('0x120')));break;case 0xb:if(_0x84a86d[_0xebed('0xf4')]>=_0x4f7e00['dialAbandonedMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x84a86d[_0xebed('0xf4')]+=0x1,'scheduledat':moment()[_0xebed('0xfb')](_0x4f7e00[_0xebed('0x1ad')],'minutes')[_0xebed('0xdb')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x84a86d[_0xebed('0xd4')],'ListId':_0x84a86d[_0xebed('0xd5')],'VoiceQueueId':_0x84a86d[_0xebed('0xd7')]||undefined,'CampaignId':_0x84a86d[_0xebed('0xfd')]||undefined})['catch'](loggerCatch(_0xebed('0x127')));break;case 0x13:if(_0x84a86d[_0xebed('0xec')]>=_0x4f7e00[_0xebed('0x102')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x84a86d[_0xebed('0xec')]+=0x1,'scheduledat':moment()['add'](_0x4f7e00[_0xebed('0x103')],_0xebed('0x104'))[_0xebed('0xdb')](_0xebed('0xfc')),'ContactId':_0x84a86d[_0xebed('0xd4')],'ListId':_0x84a86d[_0xebed('0xd5')],'VoiceQueueId':_0x84a86d['VoiceQueueId']||undefined,'CampaignId':_0x84a86d[_0xebed('0xfd')]||undefined})[_0xebed('0xb6')](loggerCatch(_0xebed('0xfe')));break;case 0x14:if(_0x84a86d[_0xebed('0xf5')]>=_0x4f7e00[_0xebed('0x1ae')]-0x1){return!![];}this[_0xebed('0xbe')]({'active':![],'countagentrejectretry':_0x84a86d[_0xebed('0xf5')]+=0x1,'scheduledat':moment()['add'](_0x4f7e00[_0xebed('0x1af')],'minutes')['format'](_0xebed('0xfc')),'ContactId':_0x84a86d[_0xebed('0xd4')],'ListId':_0x84a86d['ListId'],'VoiceQueueId':_0x84a86d['VoiceQueueId']||undefined,'CampaignId':_0x84a86d['CampaignId']||undefined})[_0xebed('0xb6')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xebed('0xaa')][_0xebed('0x1a1')]=function(_0x254e8d,_0x34feae,_0x3a7e39){var _0x974dbd=this;var _0xe2f1f6=new History(_0x254e8d);return new BPromise(function(_0x42a5ec,_0x2addfa){if(_[_0xebed('0x43')](_0x34feae)&&typeof _0x34feae!==_0xebed('0x1b0')){return _0x2addfa(msgResponse(_0xebed('0x1b1'),_0xebed('0x148'),_0xebed('0x1b2')));}if(_['isUndefined'](_0x3a7e39)&&typeof _0x3a7e39!==_0xebed('0x1b0')){return _0x2addfa(msgResponse(_0xebed('0x1b1'),_0xebed('0x148'),'evt\x20is\x20undefine'));}switch(_0x3a7e39[_0xebed('0x10f')]){case'0':_0x34feae[_0xebed('0x6a')]+=0x1;_0xe2f1f6[_0xebed('0xa7')]=0x0;_0xe2f1f6[_0xebed('0xa8')]='NoSuchNumber';_0xe2f1f6[_0xebed('0xf2')]+=0x1;_0xe2f1f6[_0xebed('0xed')]+=0x1;ami[_0xebed('0x51')](_0xebed('0x1b3'),ut[_0xebed('0xe6')](_0x254e8d,_0xebed('0x1b4')));_0x974dbd[_0xebed('0xcb')](_0xe2f1f6)[_0xebed('0xb6')](loggerCatch(_0xebed('0xef')));if(_0x974dbd[_0xebed('0x1b5')](0x0,_0x254e8d,_0x34feae)){if(_0xe2f1f6[_0xebed('0xf2')]>=_0x34feae[_0xebed('0x1b6')]){_0x974dbd[_0xebed('0xf9')](_0xe2f1f6,_0x42a5ec,_0x2addfa,'reason\x200\x20no\x20such\x20number....');}else{_0x974dbd[_0xebed('0xf7')](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0xebed('0x1b7'));}}break;case'3':_0x34feae['outboundNoAnswerCallsDay']+=0x1;_0xe2f1f6['state']=0x3;_0xe2f1f6[_0xebed('0xa8')]=_0xebed('0x1b8');_0xe2f1f6[_0xebed('0xf1')]+=0x1;_0xe2f1f6[_0xebed('0xed')]+=0x1;ami['emit'](_0xebed('0x1b9'),ut['buildObj'](_0x254e8d,_0xebed('0x1ba')));_0x974dbd['createHistory'](_0xe2f1f6)['catch'](loggerCatch(_0xebed('0x1bb')));if(_0x974dbd[_0xebed('0x1b5')](0x3,_0x254e8d,_0x34feae)){if(_0xe2f1f6[_0xebed('0xf1')]>=_0x34feae[_0xebed('0x1a4')]){_0x974dbd['createStateFinal'](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0xebed('0x1bc'));}else{_0x974dbd[_0xebed('0xf7')](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0xebed('0x1bc'));}}break;case'5':_0x34feae[_0xebed('0x65')]+=0x1;_0xe2f1f6[_0xebed('0xa7')]=0x5;_0xe2f1f6[_0xebed('0xa8')]='Busy';_0xe2f1f6[_0xebed('0x1a3')]+=0x1;_0xe2f1f6[_0xebed('0xed')]+=0x1;ami['emit'](_0xebed('0x1bd'),ut[_0xebed('0xe6')](_0x254e8d,_0xebed('0x1be')));_0x974dbd['createHistory'](_0xe2f1f6)['catch'](loggerCatch(_0xebed('0x1bf')));if(_0x974dbd[_0xebed('0x1b5')](0x5,_0x254e8d,_0x34feae)){if(_0xe2f1f6[_0xebed('0x1a3')]>=_0x34feae['dialBusyMaxRetry']){_0x974dbd[_0xebed('0xf9')](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0xebed('0x1c0'));}else{_0x974dbd[_0xebed('0xf7')](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0xebed('0x1c0'));}}break;case'8':_0x34feae['outboundCongestionCallsDay']+=0x1;_0xe2f1f6['state']=0x8;_0xe2f1f6[_0xebed('0xa8')]=_0xebed('0x1c1');_0xe2f1f6[_0xebed('0xf0')]+=0x1;_0xe2f1f6[_0xebed('0xed')]+=0x1;ami[_0xebed('0x51')]('custom:agentcongestion',ut[_0xebed('0xe6')](_0x254e8d,'congestion'));_0x974dbd[_0xebed('0xcb')](_0xe2f1f6)[_0xebed('0xb6')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x974dbd['checkRetriveMax'](0x8,_0x254e8d,_0x34feae)){if(_0xe2f1f6[_0xebed('0xf0')]>=_0x34feae['dialCongestionMaxRetry']){_0x974dbd[_0xebed('0xf9')](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0xebed('0x1c2'));}else{_0x974dbd[_0xebed('0xf7')](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0xebed('0x1c2'));}}break;case'11':_0x34feae['outboundAbandonedCallsDay']+=0x1;_0xe2f1f6['state']=0xb;_0xe2f1f6[_0xebed('0xa8')]=_0xebed('0x128');_0xe2f1f6[_0xebed('0xf4')]+=0x1;_0xe2f1f6[_0xebed('0xed')]+=0x1;_0x974dbd['createHistory'](_0xe2f1f6)[_0xebed('0xb6')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x974dbd[_0xebed('0x1b5')](0xb,_0x254e8d,_0x34feae)){if(_0xe2f1f6[_0xebed('0xf4')]>=_0x34feae[_0xebed('0x126')]){_0x974dbd['createStateFinal'](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0xebed('0x1c3'));}else{_0x974dbd[_0xebed('0xf7')](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0xebed('0x1c3'));}}break;case'20':_0x34feae[_0xebed('0x6c')]+=0x1;_0xe2f1f6['state']=0x14;_0xe2f1f6['statedesc']='AgentReject';_0xe2f1f6[_0xebed('0xf5')]+=0x1;_0xe2f1f6[_0xebed('0xed')]+=0x1;ami[_0xebed('0x51')](_0xebed('0x1c4'),ut[_0xebed('0xe6')](_0x254e8d,'agentreject'));_0x974dbd['createHistory'](_0xe2f1f6)[_0xebed('0xb6')](loggerCatch(_0xebed('0x1c5')));if(_0x974dbd['checkRetriveMax'](0x14,_0x254e8d,_0x34feae)){if(_0xe2f1f6[_0xebed('0xf5')]>=_0x34feae[_0xebed('0x1ae')]){_0x974dbd[_0xebed('0xf9')](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0xebed('0x1c6'));}else{_0x974dbd[_0xebed('0xf7')](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0xebed('0x1c6'));}}break;default:_0x34feae[_0xebed('0x10b')]+=0x1;_0xe2f1f6[_0xebed('0xa7')]=0xc;_0xe2f1f6['statedesc']=_0x3a7e39[_0xebed('0x10f')];_0x974dbd[_0xebed('0xcb')](_0xe2f1f6)[_0xebed('0xb6')](loggerCatch(_0xebed('0x1c7')));if(_0x974dbd['checkRetriveMax'](_0x3a7e39['reason'],_0x254e8d,_0x34feae)){if(_0xe2f1f6[_0xebed('0x1a3')]+_0xe2f1f6['countcongestionretry']+_0xe2f1f6[_0xebed('0xf1')]+_0xe2f1f6[_0xebed('0xf2')]+_0xe2f1f6[_0xebed('0xf3')]+_0xe2f1f6['countabandonedretry']+_0xe2f1f6[_0xebed('0xec')]+_0xe2f1f6[_0xebed('0xf5')]>=_0x34feae[_0xebed('0xf6')]){_0x974dbd[_0xebed('0xf7')](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0x3a7e39[_0xebed('0x10f')]);}else{_0x974dbd[_0xebed('0xf9')](_0xe2f1f6,_0x42a5ec,_0x2addfa,_0x3a7e39[_0xebed('0x10f')]);}}}});};Dialer[_0xebed('0xaa')][_0xebed('0xf7')]=function(_0x19b2aa,_0x37061c,_0x1fec97,_0x2c70d6){var _0x4bcb90=new Final(_0x19b2aa);_0x4bcb90[_0xebed('0xa7')]=0xf;_0x4bcb90[_0xebed('0xa8')]=_0xebed('0x1c8');this[_0xebed('0xf9')](_0x4bcb90,_0x37061c,_0x1fec97,_0x2c70d6);};Dialer[_0xebed('0xaa')][_0xebed('0xf9')]=function(_0x422790,_0x2dcd02,_0x2b499c,_0x33115b){this[_0xebed('0xc9')](_0x422790)['then'](function(){return _0x2dcd02(msgResponse(_0xebed('0x1b1'),_0xebed('0xda'),_0x33115b));})[_0xebed('0xb6')](function(){return _0x2b499c(msgResponse('[moveContactManagedDialer][0]',_0xebed('0x148'),_0xebed('0x1c9')));});};Dialer[_0xebed('0xaa')]['predictive']=function(_0x58a554){var _0x13279e=_0x58a554[_0xebed('0x1ca')]/0x64;var _0x408904=_0x58a554['outboundDropCallsDayTimeout']/(_0x58a554[_0xebed('0x69')]+_0x58a554[_0xebed('0x63')]);var _0x1d740f=Math[_0xebed('0x1cb')](_0x58a554[_0xebed('0x75')]*(_0x58a554[_0xebed('0x1cc')]/0x64));var _0xfd33b7=Math[_0xebed('0x1cb')](_0x58a554[_0xebed('0x75')]*(_0x58a554['predictiveIntervalMinThreshold']/0x64));var _0x3733b8=_0x58a554[_0xebed('0xa4')]+_0x58a554[_0xebed('0x58')];var _0x1ec513=Math[_0xebed('0x1cd')](_0x58a554[_0xebed('0x77')]*_0x58a554[_0xebed('0x8c')]*_0x58a554[_0xebed('0x73')]*_0x58a554['predictiveIntervalMultiplicativeFactor']);if(_[_0xebed('0x43')](_0x58a554[_0xebed('0x2c')])){if(!_['isUndefined'](_0x58a554[_0xebed('0x2b')])){_0x58a554[_0xebed('0x2b')]=undefined;loggerPredictive['error'](_0xebed('0x1ce'),_0xebed('0x1cf'));}if(!_[_0xebed('0x43')](_0x58a554[_0xebed('0x91')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xebed('0x1d0'));clearInterval(_0x58a554[_0xebed('0x91')]);_0x58a554[_0xebed('0x91')]=undefined;}_0x58a554['startProgressive']=moment()[_0xebed('0xdb')](_0xebed('0xfc'));loggerPredictive[_0xebed('0x81')](_0x58a554[_0xebed('0x49')],_0xebed('0x1d1'),_0x58a554[_0xebed('0x2c')]);this[_0xebed('0x15b')](_0x58a554,0x1);}else if(ifInterval(_0x58a554[_0xebed('0x1d2')],_0x58a554[_0xebed('0x2c')])){this[_0xebed('0x15b')](_0x58a554,0x1);loggerPredictiveCalls[_0xebed('0x81')](_0xebed('0x1d3'),_0x58a554[_0xebed('0x2c')],_0x58a554[_0xebed('0x49')]);_0x58a554[_0xebed('0x77')]=0x0;_0x58a554[_0xebed('0x11b')]=0x0;}else if(_0x13279e<_0x408904&&_0x58a554[_0xebed('0x1d4')]==='dropRate'){freeVariablesPredictive(_0x58a554);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xebed('0x1d5'),_0x408904,_0xebed('0x2c'),_0x58a554[_0xebed('0x49')]);}else if(_0x1ec513<_0x58a554[_0xebed('0x11b')]&&_0x58a554[_0xebed('0x1d4')]===_0xebed('0x1d6')){freeVariablesPredictive(_0x58a554);loggerPredictive[_0xebed('0x81')](_0xebed('0x1d7'),'Max\x20Drop\x20',_0x1ec513,_0xebed('0x1d8'),_0x58a554[_0xebed('0x11b')],_0xebed('0x2c'),_0x58a554[_0xebed('0x49')]);}else if(!ifInterval(_0x58a554[_0xebed('0x1d2')],_0x58a554[_0xebed('0x2c')])&&_[_0xebed('0x43')](_0x58a554[_0xebed('0x2b')])&&!_[_0xebed('0x43')](_0x58a554[_0xebed('0x2c')])){_0x58a554['startPredictive']=moment()[_0xebed('0xdb')](_0xebed('0xfc'));loggerPredictive[_0xebed('0x81')](_0x58a554[_0xebed('0x49')],_0xebed('0x1d9'),_0x58a554[_0xebed('0x2b')]);this['averageHandleTime'](_0x58a554[_0xebed('0x1d2')])[_0xebed('0x42')](this[_0xebed('0x1da')](_0x58a554))[_0xebed('0x42')](mergeDataErlangB(_0x58a554))[_0xebed('0x42')](this[_0xebed('0x1db')](_0x58a554))[_0xebed('0xb6')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x58a554));}else if(!ifInterval(_0x58a554['dialPredictiveInterval'],_0x58a554[_0xebed('0x2b')])){_0x58a554[_0xebed('0x11b')]=0x0;_0x58a554[_0xebed('0x2b')]=moment()[_0xebed('0xdb')](_0xebed('0xfc'));loggerPredictive[_0xebed('0x81')](_0x58a554[_0xebed('0x49')],_0xebed('0x1dc'),_0x58a554['startPredictive']);clearInterval(_0x58a554['handlePredictive']);_0x58a554[_0xebed('0x91')]=undefined;this['averageHandleTime'](_0x58a554[_0xebed('0x1d2')])[_0xebed('0x42')](this['getDataPredictive'](_0x58a554))[_0xebed('0x42')](mergeDataErlangB(_0x58a554))[_0xebed('0x42')](this['startMethodPredictive'](_0x58a554))[_0xebed('0xb6')](loggerCatchPredictive(_0xebed('0x1dd'),_0x58a554));}else if(_0x58a554[_0xebed('0x75')]&&_0x3733b8<_0x58a554[_0xebed('0x75')]-_0xfd33b7){freeVariablesPredictive(_0x58a554);loggerPredictive[_0xebed('0x81')](_0x58a554['name'],_0xebed('0x1de'),_0x3733b8,')\x20are\x20less\x20than\x20threshold\x20(',_0x58a554[_0xebed('0x75')],'-',_0xfd33b7,'=',_0x58a554['predictiveIntervalAvailable']-_0xfd33b7,')');}else if(_0x58a554['predictiveIntervalAvailable']&&_0x3733b8>_0x58a554[_0xebed('0x75')]+_0x1d740f){freeVariablesPredictive(_0x58a554);loggerPredictive[_0xebed('0x81')](_0x58a554[_0xebed('0x49')],_0xebed('0x1de'),_0x3733b8,_0xebed('0x1df'),_0x58a554[_0xebed('0x75')],'+',_0x1d740f,'=',_0x58a554[_0xebed('0x75')]+_0x1d740f,')');}};Dialer[_0xebed('0xaa')][_0xebed('0x1da')]=function(_0x32c587){var _0x311c56=this;return function(_0x533d6c){return new BPromise(function(_0x48105c,_0x110179){_[_0xebed('0x8d')](_0x32c587,_0x533d6c[0x0]);if(checkGetDataPredictive(_0x533d6c[0x0])){var _0x5ac5fe=_0x32c587['predictiveIntervalAvailable']=_0x32c587[_0xebed('0x58')]+_0x32c587[_0xebed('0xa4')];var _0x28c705=_0x32c587['dialPredictiveInterval']*0x3c;var _0x30e0fc=_0x533d6c[0x0][_0xebed('0x6f')]+_0x533d6c[0x0]['predictiveIntervalAvgHoldtime'];var _0x32d032=(_0x533d6c[0x0]['predictiveIntervalAnsweredCalls']+_0x533d6c[0x0][_0xebed('0x71')]+_0x533d6c[0x0][_0xebed('0x70')])/_0x533d6c[0x0][_0xebed('0x84')];_0x32c587[_0xebed('0x73')]=_0x32d032>0x0?_0x32d032:0x1;switch(_0x32c587[_0xebed('0x1d4')]){case _0xebed('0x1d6'):var _0x5f199e=_0x32c587[_0xebed('0x1ca')]/0x64;return _0x311c56[_0xebed('0x1e0')](_0x5ac5fe,_0x28c705,_0x30e0fc,_0x32d032,_0x5f199e)[_0xebed('0x42')](function(_0x4b2d11){return _0x48105c(_0x4b2d11);});case _0xebed('0x1e1'):var _0x246787=_0x32c587[_0xebed('0x1ca')]/0x64;return _0x311c56[_0xebed('0x1e2')](_0x5ac5fe,_0x28c705,_0x30e0fc,_0x32d032,_0x246787)[_0xebed('0x42')](function(_0x5b53d1){return _0x48105c(_0x5b53d1);});default:return _0x110179(msgResponse(_0xebed('0x1e3'),_0xebed('0x148'),_0xebed('0x1e4')));}}else{return _0x110179(msgResponse(_0xebed('0x1e3'),'Failure',_0xebed('0x1e5')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x3e7741){var _0x3ef9b3=this;return function(_0x2a7810){return new BPromise(function(_0x1bc9ec,_0x3ff158){_[_0xebed('0x8d')](_0x3e7741,_0x2a7810[0x0]);if(checkGetDataPredictive(_0x2a7810[0x0])){loggerPredictive['info'](JSON[_0xebed('0x4e')](_0x2a7810[0x0]));if(_0x3e7741[_0xebed('0x1d4')]===_0xebed('0x1d6')){return _0x3ef9b3[_0xebed('0xc7')](_0x3e7741['id'])[_0xebed('0x42')](function(_0x3069e6){var _0x357abd=_0x3e7741[_0xebed('0x55')]-_0x3069e6[0x0]['outboundQueuePauses'];var _0x35b6a8=_0x3e7741[_0xebed('0x1d2')]*0x3c;var _0x265185=_0x2a7810[0x0]['predictiveIntervalAvgTalktime']+_0x2a7810[0x0][_0xebed('0x6e')];var _0x1b02d6=(_0x2a7810[0x0][_0xebed('0x6d')]+_0x2a7810[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2a7810[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2a7810[0x0][_0xebed('0x84')];var _0x3ed424=_0x3e7741['dialPredictiveOptimizationPercentage']/0x64;_0x3e7741[_0xebed('0x74')]=_0x3069e6[0x0]['outboundQueuePauses']||0x0;_0x3e7741[_0xebed('0x73')]=_0x1b02d6>0x0?_0x1b02d6:0x1;return _0x3ef9b3['abandonmentRate'](_0x357abd,_0x35b6a8,_0x265185,_0x1b02d6,_0x3ed424);})[_0xebed('0x42')](function(_0x3c09f1){return _0x1bc9ec(_0x3c09f1);})[_0xebed('0xb6')](function(_0x1c3874){return _0x3ff158(msgResponse(_0xebed('0x1e6'),'Failure',JSON['stringify'](_0x1c3874)));});}if(_0x3e7741[_0xebed('0x1d4')]===_0xebed('0x1e1')){return _0x3ef9b3['getVoiceQueueRtPauses'](_0x3e7741['id'])[_0xebed('0x42')](function(_0xc5934c){var _0x33b733=_0x3e7741[_0xebed('0x55')]-_0xc5934c[0x0][_0xebed('0x1e7')];var _0x513583=_0x3e7741[_0xebed('0x1d2')]*0x3c;var _0x556ea9=_0x2a7810[0x0]['predictiveIntervalAvgTalktime']+_0x2a7810[0x0][_0xebed('0x6e')];var _0x56530d=(_0x2a7810[0x0]['predictiveIntervalAnsweredCalls']+_0x2a7810[0x0][_0xebed('0x71')]+_0x2a7810[0x0][_0xebed('0x70')])/_0x2a7810[0x0][_0xebed('0x84')];var _0x236c09=_0x3e7741[_0xebed('0x1ca')]/0x64;_0x3e7741[_0xebed('0x74')]=_0xc5934c[0x0]['outboundQueuePauses']||0x0;_0x3e7741['predictiveIntervalHitRate']=_0x56530d>0x0?_0x56530d:0x1;return _0x3ef9b3[_0xebed('0x1e2')](_0x33b733,_0x513583,_0x556ea9,_0x56530d,_0x236c09);})[_0xebed('0x42')](function(_0x271fd1){return _0x1bc9ec(_0x271fd1);})['catch'](function(_0x27914b){return _0x3ff158(msgResponse(_0xebed('0x1e6'),'Failure',JSON[_0xebed('0x4e')](_0x27914b)));});}}else{return _0x3ff158(msgResponse('[getDataPredictive]',_0xebed('0x148'),_0xebed('0x1e5')));}});};};Dialer[_0xebed('0xaa')][_0xebed('0x1db')]=function(_0x2cfa8e){var _0x45a729=this;return function(){var _0x5694b2=0x0;var _0x4e765b=Math[_0xebed('0x1cd')](_0x2cfa8e['erlangCallToSecond']*0x3e8);if(_0x4e765b>0x0){_0x4e765b=_0x4e765b<0x64?0x64:_0x4e765b;loggerPredictive[_0xebed('0x81')](_0x2cfa8e[_0xebed('0x49')],_0xebed('0x1e8'),_0x4e765b,_0xebed('0x4f'));_0x2cfa8e[_0xebed('0x91')]=setInterval(function(){_0x45a729[_0xebed('0x91')](_0x2cfa8e);loggerPredictiveCalls['info']('[handlePredictive]',_0x5694b2+=0x1);},_0x4e765b);}else{loggerPredictive[_0xebed('0x81')](_0x2cfa8e['name'],_0xebed('0x1e9'));}};};Dialer[_0xebed('0xaa')][_0xebed('0x1ea')]=function(_0x5deda6,_0x2fe2c2){var _0x5158bc=this;return function(_0x16f00e){if(_[_0xebed('0x94')](_0x16f00e)){if(_[_0xebed('0xdf')](_0x2fe2c2[_0xebed('0xd6')])||!_0x2fe2c2[_0xebed('0x1eb')]){if(_0x5deda6[_0xebed('0x5e')]==='booked'){_0x5deda6[_0xebed('0x133')]=_[_0xebed('0x43')](_0x5deda6[_0xebed('0x133')])?!![]:_0x5deda6['queueStatusComplete'];var _0xa876d3=uuid['v4']();_0x5158bc['actions'][_0xa876d3]=new Action(_0x5deda6,_0x2fe2c2,_0xa876d3);loggerBooked['info']('[booked][checkContactBlack]',_0xa876d3,_0xebed('0x1ec'),JSON[_0xebed('0x4e')](_0x5deda6['queueStatusComplete']),_0xebed('0x1ed'),_0x5deda6['name']);if(_0x5deda6[_0xebed('0x133')]){_0x5deda6['queueStatusComplete']=![];_0x5158bc['queueBooked'][_0x5158bc[_0xebed('0x27')][_0xa876d3]['queue']]=[];ami[_0xebed('0x150')]({'actionid':_0xa876d3,'action':_0xebed('0x1ee'),'queue':_0x5deda6[_0xebed('0x49')]})[_0xebed('0xb6')](function(){_0x5158bc[_0xebed('0xb0')](_0x5deda6);_0x5158bc[_0xebed('0xbe')]({'active':![],'ContactId':_0x5158bc[_0xebed('0x27')][_0xa876d3]['ContactId'],'ListId':_0x5158bc['actions'][_0xa876d3][_0xebed('0xd5')],'VoiceQueueId':_0x5158bc[_0xebed('0x27')][_0xa876d3]['VoiceQueueId']||undefined,'CampaignId':_0x5158bc[_0xebed('0x27')][_0xa876d3][_0xebed('0xfd')]||undefined})['catch'](loggerCatch(_0xebed('0x1ef')));delete _0x5158bc['actions'][_0xa876d3];});}else{loggerBooked[_0xebed('0x81')](_0xebed('0x1f0'),JSON['stringify'](_0x5deda6[_0xebed('0x133')]),_0xebed('0x1ed'),_0x5deda6['name']);_0x5158bc[_0xebed('0xb0')](_0x5deda6);_0x5158bc[_0xebed('0xbe')]({'active':![],'ContactId':_0x5158bc['actions'][_0xa876d3][_0xebed('0xd4')],'ListId':_0x5158bc[_0xebed('0x27')][_0xa876d3][_0xebed('0xd5')],'VoiceQueueId':_0x5158bc[_0xebed('0x27')][_0xa876d3][_0xebed('0xd7')]||undefined,'CampaignId':_0x5158bc[_0xebed('0x27')][_0xa876d3]['CampaignId']||undefined})[_0xebed('0xb6')](loggerCatch(_0xebed('0x1ef')));delete _0x5158bc[_0xebed('0x27')][_0xa876d3];}}else{return _0x5158bc['actionOriginate'](_0x5deda6,_0x2fe2c2);}}else{if(getDiff(_0x2fe2c2[_0xebed('0x1f1')])<_0x5deda6[_0xebed('0x1f2')]*0x3c){if(_0x2fe2c2[_0xebed('0x16c')]&&!_0x2fe2c2['Agent'][_0xebed('0x1f3')]){_0x5158bc['preview']['run'](_0x2fe2c2['id'])[_0xebed('0x1f')](function(){_0x5158bc[_0xebed('0xb0')](_0x5deda6);});}else{_0x5158bc['unlockContact']({'active':![]},_0x2fe2c2['id'],0x1)['finally'](function(){_0x5158bc[_0xebed('0xb0')](_0x5deda6);});}}else{_0x5deda6[_0xebed('0x6b')]+=0x1;_0x5158bc[_0xebed('0xb0')](_0x5deda6);if(_0x5deda6[_0xebed('0x1f4')]){_0x5158bc['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2fe2c2[_0xebed('0xd4')],'ListId':_0x2fe2c2[_0xebed('0xd5')],'VoiceQueueId':_0x2fe2c2[_0xebed('0xd7')]||undefined,'CampaignId':_0x2fe2c2['CampaignId']||undefined})[_0xebed('0xb6')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x5158bc[_0xebed('0xcb')](createObjHistory(_0x5deda6,_0x2fe2c2,_0xebed('0x1f5'),0x17,_0xebed('0x1f6')))[_0xebed('0xb6')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x5158bc[_0xebed('0xd2')](createObjHistory(_0x5deda6,_0x2fe2c2,_0xebed('0x1f7'),0x16,'RecallFailedTimeout'),_0xebed('0x1f8'),_0xebed('0x1f9'));}}}}else{_0x5deda6[_0xebed('0x64')]+=0x1;_0x5158bc[_0xebed('0xd2')](createObjHistory(_0x5deda6,_0x2fe2c2,_0xebed('0x1fa'),0xd,_0xebed('0x1fb')),_0xebed('0x1fc'),_0xebed('0x1fd'));throw _0xebed('0x1fe');}};};Dialer['prototype'][_0xebed('0x161')]=function(_0x14acc2){var _0x4a00f9=this;var _0x131de9=_0x14acc2['limitCalls']-_0x14acc2[_0xebed('0x76')]-_0x14acc2[_0xebed('0xc3')];emitCampaignSummary(_0x14acc2);if(_0x131de9>0x0){if(_0x131de9>this[_0xebed('0x25')]){_0x131de9=this['maxNumberOriginate'];}_0x14acc2[_0xebed('0xc3')]+=_0x131de9;this[_0xebed('0xc5')](_0x14acc2['id'],_0x131de9,_0x14acc2['dialOrderByScheduledAt'],_0x14acc2)[_0xebed('0x42')](function(_0x563f38){_0x14acc2[_0xebed('0xc3')]-=_0x131de9;_0x14acc2[_0xebed('0xc3')]=_0x14acc2['temp']>0x0?_0x14acc2[_0xebed('0xc3')]:0x0;if(!checkContactEmpty(_0x563f38)){_0x14acc2[_0xebed('0x44')]=_0xebed('0xa2');logger[_0xebed('0x81')](_0xebed('0x1ff')+_0x14acc2[_0xebed('0x49')]);}else{_0x14acc2[_0xebed('0x76')]+=_0x563f38['length'];_0x14acc2[_0xebed('0x44')]=_0xebed('0x200');for(var _0x316225=0x0;_0x316225<_0x563f38[_0xebed('0x14e')];_0x316225+=0x1){_0x14acc2[_0xebed('0x201')]+=0x1;if(_[_0xebed('0xdf')](_0x563f38[_0x316225])||_['isNil'](_0x563f38[_0x316225][_0xebed('0x177')])||_[_0xebed('0xdf')](_0x563f38[_0x316225]['Contact'][_0xebed('0x178')])){_0x4a00f9[_0xebed('0xd0')](_0xebed('0x202'),_0x14acc2,_0x563f38[_0x316225]);}else{_0x4a00f9['checkIsBlackListIvr'](_[_0xebed('0xd3')](_0x563f38[_0x316225],[_0xebed('0xfd'),_0xebed('0x203')]))[_0xebed('0x42')](_0x4a00f9[_0xebed('0x1ea')](_0x14acc2,_0x563f38[_0x316225]))[_0xebed('0xb6')](_0x4a00f9['loggerHandler'](_0xebed('0x204'),_0x14acc2));}}}})['catch'](loggerGetContactDialer(_0xebed('0x205'),_0x14acc2,_0x131de9));}};Dialer[_0xebed('0xaa')][_0xebed('0x15b')]=function(_0x2b3e09,_0x4c8c18){var _0x326c94=this;var _0x255706=[];var _0x5d304d=_0x4c8c18>=0x1?_0x4c8c18:0x1;if(_0x2b3e09[_0xebed('0x5e')]===_0xebed('0x9')){_0x5d304d=0x1;}var _0x498f6e=Math[_0xebed('0x1cd')](_0x2b3e09['available']*_0x5d304d)-_0x2b3e09['originated']-_0x2b3e09[_0xebed('0xc3')];emitVoiceQueueSummary(_0x2b3e09);if(_0x2b3e09[_0xebed('0x206')]>0x0){var _0x47ae1f=_0x2b3e09[_0xebed('0x206')]-_0x2b3e09[_0xebed('0x76')]-_0x2b3e09[_0xebed('0x58')]-_0x2b3e09[_0xebed('0xc3')]-_0x2b3e09[_0xebed('0x207')];if(_0x498f6e>_0x47ae1f){_0x498f6e=_0x47ae1f;}}if(_0x498f6e>0x0){if(_0x2b3e09[_0xebed('0x5e')]==='booked'){_0x498f6e=0x1;}if(_0x498f6e>this[_0xebed('0x25')]){_0x498f6e=this[_0xebed('0x25')];}_0x2b3e09[_0xebed('0xc3')]+=_0x498f6e;for(var _0x2dcfe4 in this[_0xebed('0x23')]){if(typeof this[_0xebed('0x23')][_0x2dcfe4]!==_0xebed('0x9b')){if(this[_0xebed('0x23')][_0x2dcfe4]['state']===_0xebed('0x208')&&this[_0xebed('0x23')][_0x2dcfe4][_0xebed('0xae')]===_0xebed('0xdc')){_0x255706['push'](this[_0xebed('0x23')][_0x2dcfe4]['id']);}}}this[_0xebed('0xc2')](_0x2b3e09['id'],_0x255706,_0x498f6e,_0x2b3e09[_0xebed('0x209')],_0x2b3e09)[_0xebed('0x42')](function(_0x214b79){_0x2b3e09[_0xebed('0xc3')]-=_0x498f6e;_0x2b3e09[_0xebed('0xc3')]=_0x2b3e09[_0xebed('0xc3')]>0x0?_0x2b3e09[_0xebed('0xc3')]:0x0;if(!checkContactEmpty(_0x214b79)){_0x326c94[_0xebed('0xb4')](_0x2b3e09)[_0xebed('0x42')](sendMessageReschedule(_0x2b3e09))[_0xebed('0xb6')](loggerCatch(_0xebed('0xb7')));}else{_0x2b3e09[_0xebed('0x76')]+=_0x214b79['length'];_0x2b3e09[_0xebed('0x44')]=_0x2b3e09[_0xebed('0x5e')]===_0xebed('0x9')?_0xebed('0x17e'):_0xebed('0x200');for(var _0x77c026=0x0;_0x77c026<_0x214b79[_0xebed('0x14e')];_0x77c026+=0x1){if(_[_0xebed('0xdf')](_0x214b79[_0x77c026])||_['isNil'](_0x214b79[_0x77c026][_0xebed('0x177')])||_[_0xebed('0xdf')](_0x214b79[_0x77c026]['Contact'][_0xebed('0x178')])){_0x326c94[_0xebed('0xd0')](_0xebed('0x202'),_0x2b3e09,_0x214b79[_0x77c026]);}else{_0x326c94[_0xebed('0xb8')](_[_0xebed('0xd3')](_0x214b79[_0x77c026],[_0xebed('0xd7'),_0xebed('0x203')]))[_0xebed('0x42')](_0x326c94[_0xebed('0x1ea')](_0x2b3e09,_0x214b79[_0x77c026]))[_0xebed('0xb6')](_0x326c94[_0xebed('0xcf')]('[actionOriginate]\x20',_0x2b3e09));}}}})['catch'](loggerGetContactDialer(_0xebed('0x20a'),_0x2b3e09,_0x498f6e));}};Dialer[_0xebed('0xaa')][_0xebed('0x91')]=function(_0x34caeb){if(_0x34caeb['dialLimitQueue']>0x0){var _0x5a1493=_0x34caeb[_0xebed('0x206')]-_0x34caeb['originated']-_0x34caeb[_0xebed('0x58')];if(_0x5a1493>0x0){this['tryOriginatePredictive'](_0x34caeb);}else{loggerPredictiveCalls[_0xebed('0x81')](_0xebed('0x20b'));}}else{this[_0xebed('0x20c')](_0x34caeb);}};Dialer[_0xebed('0xaa')]['tryOriginatePredictive']=function(_0x4af0b6){var _0x13a022=this;var _0x491595=[];_0x4af0b6[_0xebed('0x76')]+=0x1;for(var _0xc1c682 in this[_0xebed('0x23')]){if(typeof this[_0xebed('0x23')][_0xc1c682]!=='undefined'){if(this[_0xebed('0x23')][_0xc1c682]['state']==='not_inuse'&&this[_0xebed('0x23')][_0xc1c682][_0xebed('0xae')]==='reachable'){_0x491595['push'](this[_0xebed('0x23')][_0xc1c682]['id']);}}}this[_0xebed('0xc2')](_0x4af0b6['id'],_0x491595,0x1,_0x4af0b6['dialOrderByScheduledAt'],_0x4af0b6)[_0xebed('0x42')](function(_0x982be6){if(!checkContactEmpty(_0x982be6)){checkContactLowerLimitOriginate(_0x4af0b6,0x1,0x0);_0x13a022[_0xebed('0xb4')](_0x4af0b6)[_0xebed('0x42')](sendMessageReschedule(_0x4af0b6))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x4af0b6[_0xebed('0x44')]=_0xebed('0x200');if(_['isNil'](_0x982be6[0x0])||_[_0xebed('0xdf')](_0x982be6[0x0][_0xebed('0x177')])||_[_0xebed('0xdf')](_0x982be6[0x0][_0xebed('0x177')]['phone'])){_0x13a022['emptyContact'](_0xebed('0x202'),_0x4af0b6,_0x982be6[0x0]);}else{_0x13a022[_0xebed('0xb8')](_[_0xebed('0xd3')](_0x982be6[0x0],[_0xebed('0xd7'),_0xebed('0x203')]))['then'](_0x13a022[_0xebed('0x1ea')](_0x4af0b6,_0x982be6[0x0]))[_0xebed('0xb6')](_0x13a022['loggerHandler'](_0xebed('0x20d'),_0x4af0b6));}}})['catch'](loggerGetContactDialer(_0xebed('0x20e'),_0x4af0b6,0x1));emitVoiceQueueSummary(_0x4af0b6);};Dialer[_0xebed('0xaa')][_0xebed('0x1e0')]=function(_0xe0fbf3,_0x4d293b,_0x2c4b15,_0x23a395,_0x5a58a0,_0x357ac2){loggerPredictive[_0xebed('0x81')](_0xebed('0x20f'));loggerPredictive[_0xebed('0x81')](_0xebed('0x210'),_0xe0fbf3);loggerPredictive[_0xebed('0x81')](_0xebed('0x211'),_0x4d293b);loggerPredictive['info'](_0xebed('0x212'),_0x2c4b15);loggerPredictive[_0xebed('0x81')](_0xebed('0x213'),_0x23a395);loggerPredictive[_0xebed('0x81')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a58a0);loggerPredictive[_0xebed('0x81')](_0xebed('0x88'));return new BPromise(function(_0x239051,_0x5a8f6d){if(_0xe0fbf3<=0x0||isNaN(_0xe0fbf3)){return _0x5a8f6d(msgResponse(_0xebed('0x214'),'Error',_0xebed('0x215')+_0xe0fbf3));}if(_0x2c4b15<=0x0||isNaN(_0x2c4b15)){return _0x5a8f6d(msgResponse(_0xebed('0x214'),_0xebed('0x4d'),_0xebed('0x216')+_0x2c4b15));}if(_0x23a395<=0x0||isNaN(_0x23a395)){return _0x5a8f6d(msgResponse('[abandonmentRate]',_0xebed('0x4d'),'p\x20=\x20'+_0x23a395));}if(_0x4d293b<=0x0||isNaN(_0x4d293b)){return _0x5a8f6d(msgResponse('[abandonmentRate]',_0xebed('0x4d'),'interval\x20=\x20'+_0x4d293b));}if(_0x5a58a0<=0x0||isNaN(_0x5a58a0)){return _0x5a8f6d(msgResponse(_0xebed('0x214'),_0xebed('0x4d'),'Amax\x20=\x20'+_0x5a58a0));}_0x357ac2=_0x357ac2||0x0;var _0x5bb754=0x1/_0x2c4b15;var _0x3d8e72=0x0;var _0x44efce=0x0;var _0x317c9a=0x0;var _0x588227=0x0;for(var _0x2ec2a6=0x0;_0x317c9a<_0x5a58a0;_0x2ec2a6+=0x1){_0x44efce=_0x2ec2a6/_0x4d293b;_0x3d8e72=(_0x23a395*_0x44efce+_0x357ac2)/_0x5bb754;_0x317c9a=erlangb(_0x3d8e72,_0xe0fbf3);_0x588227=_0x3d8e72/_0xe0fbf3*(0x1-erlangb(_0x3d8e72,_0xe0fbf3));}return _0x239051({'erlangCalls':_0x2ec2a6,'erlangCallToSecond':_0x4d293b/_0x2ec2a6,'erlangAbandonmentRate':_0x317c9a,'erlangBusyFactor':_0x588227});});};Dialer[_0xebed('0xaa')][_0xebed('0x1e2')]=function(_0x26e52f,_0x116188,_0x3a12b6,_0x16f907,_0x4b5dc8,_0x4d48a3){loggerPredictive[_0xebed('0x81')](_0xebed('0x217'));loggerPredictive[_0xebed('0x81')]('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',_0x26e52f);loggerPredictive[_0xebed('0x81')](_0xebed('0x211'),_0x116188);loggerPredictive[_0xebed('0x81')](_0xebed('0x212'),_0x3a12b6);loggerPredictive['info'](_0xebed('0x213'),_0x16f907);loggerPredictive[_0xebed('0x81')](_0xebed('0x218'),_0x4b5dc8);loggerPredictive[_0xebed('0x81')](_0xebed('0x88'));return new BPromise(function(_0x114182,_0x4ad575){if(_0x26e52f<=0x0||isNaN(_0x26e52f)){return _0x4ad575(msgResponse('[busyFactor]',_0xebed('0x4d'),_0xebed('0x215')+_0x26e52f));}if(_0x3a12b6<=0x0||isNaN(_0x3a12b6)){return _0x4ad575(msgResponse('[busyFactor]',_0xebed('0x4d'),_0xebed('0x216')+_0x3a12b6));}if(_0x16f907<=0x0||isNaN(_0x16f907)){return _0x4ad575(msgResponse('[busyFactor]','Error',_0xebed('0x219')+_0x16f907));}if(_0x116188<=0x0||isNaN(_0x116188)){return _0x4ad575(msgResponse(_0xebed('0x21a'),_0xebed('0x4d'),_0xebed('0x21b')+_0x116188));}if(_0x4b5dc8<=0x0||isNaN(_0x4b5dc8)){return _0x4ad575(msgResponse(_0xebed('0x21a'),_0xebed('0x4d'),_0xebed('0x21c')+_0x4b5dc8));}_0x4d48a3=_0x4d48a3||0x0;var _0x3c7700=0x1/_0x3a12b6;var _0x173e4f=0x0;var _0x524f0a=0x0;var _0x41e573=0x0;var _0x13e825=0x0;for(var _0x42cd94=0x0;_0x13e825<_0x4b5dc8;_0x42cd94+=0x1){_0x524f0a=_0x42cd94/_0x116188;_0x173e4f=(_0x16f907*_0x524f0a+_0x4d48a3)/_0x3c7700;_0x41e573=erlangb(_0x173e4f,_0x26e52f);_0x13e825=_0x173e4f/_0x26e52f*(0x1-erlangb(_0x173e4f,_0x26e52f));}return _0x114182({'erlangCalls':_0x42cd94,'erlangCallToSecond':_0x116188/_0x42cd94,'erlangAbandonmentRate':_0x41e573,'erlangBusyFactor':_0x13e825});});};module['exports']=Dialer; \ No newline at end of file +var _0xa966=['dialMachineMaxRetry','reason\x2019\x20machine....','rescheduleContact','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','VoiceQueueId','CampaignId','HangupInAMD','[syncHangupInAMDIvr]','countbusyretry','stateGlobal','add','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','actionid','strategy','locked','paused','stateinterface','merge','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','true','content','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','method\x20not\x20recognized','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncQueueSummaryComplete','filter','dialPreviewRecallmeReminder','online','map','handlePreviewRecallNotifications','log','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','match','object','voiceQueue\x20is\x20undefine','phone','Contact','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','substring','trim','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','createStateFinal','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','reason','[syncAgentComplete][createHistory][?]','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','dialPredictiveOptimizationPercentage','[getDataPredictive]','check\x20failure','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','busyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','push','[countReScheduled]\x20','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\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]','Umin\x20=\x20','util','bluebird','uuid','moment','md5','ioredis','../preview/util/util','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','localhost','socket.io-emitter','redis','../rpc/cmHopperHistory','./action','./agentComplete','./queueCallerAbandon','./hangup','env','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','outbound','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','startPredictive','Trunk','callerid','format','voice_queue:save','ivr','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\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\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','isUndefined','Avg\x20Talk\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','erlangCalls','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','---------------------------','startProgressive','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','error','inspect','length','undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','NOT_ACTIVE','IS_DISACTIVED','state','statedesc','endtime','[uniqueid]','clearZombieChannels','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','ContactId','[emptyContact][createHistory]','[emptyContact]','isTrunkReachable','active','SIP/%s','unmonitored','moveContactManagedDialer','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','membername','AMD','custom:amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','countglobal','amd','buildObj','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xa966,0x13b));var _0x6a96=function(_0x2f5102,_0x30e8e0){_0x2f5102=_0x2f5102-0x0;var _0x19cf7a=_0xa966[_0x2f5102];return _0x19cf7a;};'use strict';var util=require(_0x6a96('0x0'));var _=require('lodash');var BPromise=require(_0x6a96('0x1'));var uuid=require(_0x6a96('0x2'));var moment=require(_0x6a96('0x3'));var rr=require('rr');var md5=require(_0x6a96('0x4'));var Redis=require(_0x6a96('0x5'));var ut=require(_0x6a96('0x6'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0x6a96('0x7'));var loggerBooked=require(_0x6a96('0x8'))(_0x6a96('0x9'));var loggerPredictive=require('../../../config/logger')(_0x6a96('0xa'));var loggerPredictiveCalls=require('../../../config/logger')(_0x6a96('0xb'));var loggerSyncQueueSummary=require(_0x6a96('0x8'))(_0x6a96('0xc'));var ami=require(_0x6a96('0xd'));config['redis']=_[_0x6a96('0xe')](config['redis'],{'host':_0x6a96('0xf'),'port':0x18eb});var io=require(_0x6a96('0x10'))(new Redis(config[_0x6a96('0x11')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x6a96('0x12'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Action=require(_0x6a96('0x13'));var History=require('./history');var Final=require('./final');var AgentComplete=require(_0x6a96('0x14'));var QueueCallerAbandon=require(_0x6a96('0x15'));var Hangup=require(_0x6a96('0x16'));var ipAgi=process[_0x6a96('0x17')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0x6a96('0x18'),'roundrobin':_0x6a96('0x19')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x6a96('0x1a')]['enqueue']=function(_0x3b5d2c){this[_0x6a96('0x1b')]=this[_0x6a96('0x1b')]?this[_0x6a96('0x1b')][_0x6a96('0x1c')](_0x3b5d2c):_0x3b5d2c();};function Dialer(_0x74c85b,_0x225643){this[_0x6a96('0x1d')]=new Sequence();this[_0x6a96('0x1e')]=_0x225643;this[_0x6a96('0x1f')]=_0x74c85b[_0x6a96('0x1f')];this[_0x6a96('0x20')]=_0x74c85b['campaigns'];this[_0x6a96('0x21')]=_0x74c85b[_0x6a96('0x21')];this[_0x6a96('0x22')]=_0x74c85b[_0x6a96('0x22')];this['maxNumberOriginate']=config[_0x6a96('0x23')]||0x2;this['channels']={};this[_0x6a96('0x24')]={};this[_0x6a96('0x25')]={};this[_0x6a96('0x26')]={};this[_0x6a96('0x27')]={};this['startPredictive']={};this['startProgressive']={};this[_0x6a96('0x28')]={};this[_0x6a96('0x29')]={};this[_0x6a96('0x2a')]={};ami['on'](_0x6a96('0x2b'),this[_0x6a96('0x2c')][_0x6a96('0x2d')](this));ami['on'](_0x6a96('0x2e'),this[_0x6a96('0x2f')][_0x6a96('0x2d')](this));ami['on'](_0x6a96('0x30'),this['syncOriginateResponse'][_0x6a96('0x2d')](this));ami['on'](_0x6a96('0x31'),this[_0x6a96('0x32')][_0x6a96('0x2d')](this));ami['on']('custom:queuesummary',this[_0x6a96('0xc')]['bind'](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete'][_0x6a96('0x2d')](this));ami['on'](_0x6a96('0x33'),this[_0x6a96('0x34')]['bind'](this));ami['on'](_0x6a96('0x35'),this[_0x6a96('0x36')]['bind'](this));ami['on'](_0x6a96('0x37'),this[_0x6a96('0x38')][_0x6a96('0x2d')](this));ami['on'](_0x6a96('0x39'),this[_0x6a96('0x3a')][_0x6a96('0x2d')](this));ami['on'](_0x6a96('0x3b'),this[_0x6a96('0x3c')][_0x6a96('0x2d')](this));this[_0x6a96('0x3d')]();this[_0x6a96('0x3e')]();RpcSetting[_0x6a96('0x3f')]()['then'](function(_0x1c765b){previewRecallmeReminderInterval=_0x1c765b[_0x6a96('0x40')];});}function isNotNull(_0x2d55bd){return _0x2d55bd!==null&&!_['isUndefined'](_0x2d55bd);}function checkIsLoggedIn(_0x443697,_0x279639){return function(){if(_0x279639<=0x0){_0x443697[_0x6a96('0x41')]=_0x6a96('0x42');throw _0x443697[_0x6a96('0x43')]+_0x6a96('0x44');}};}function isActive(_0x5e5f95){return _0x5e5f95;}function checkIsActive(_0xc83084,_0x19a20b){return function(){if(!isActive(_0x19a20b)){_0xc83084[_0x6a96('0x41')]='NOT_ACTIVE';throw _0xc83084[_0x6a96('0x43')]+'\x20NOT\x20Active';}};}function checkInterval(_0x451402){return function(){if(!isNotNull(_0x451402[_0x6a96('0x45')])){_0x451402['message']=_0x6a96('0x46');throw _0x451402[_0x6a96('0x43')]+_0x6a96('0x47');}if(!isNotNull(_0x451402[_0x6a96('0x45')]['Intervals'])){_0x451402[_0x6a96('0x41')]=_0x6a96('0x46');throw _0x451402[_0x6a96('0x43')]+_0x6a96('0x47');}if(!isNotNull(_[_0x6a96('0x48')](_0x451402[_0x6a96('0x45')]['Intervals']))){_0x451402[_0x6a96('0x41')]='INTERVAL_IS_NULL';throw _0x451402['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x5331b8,_0x7b2052,_0x4457db){return{'action':_0x5331b8,'response':_0x7b2052,'message':_0x4457db,'stack':_0x4457db};}function myreject(_0x53fe7a){return function(_0x5a62ef){return _0x53fe7a(msgResponse(_0x6a96('0x49'),_0x6a96('0x4a'),JSON[_0x6a96('0x4b')](_0x5a62ef)));};}function getSeconds(_0x1af77d,_0x358471){var _0x1c64f9=moment(_0x1af77d)[_0x6a96('0x4c')](0x0);var _0x447e7a=moment(_0x358471)[_0x6a96('0x4c')](0x0);return _0x1c64f9[_0x6a96('0x4d')](_0x447e7a,_0x6a96('0x4e'));}function emit(_0x46b59a,_0xc444d1,_0x5e6f87){io['to'](_0x46b59a)[_0x6a96('0x4f')](_0xc444d1,_0x5e6f87);}function emitVoiceQueueSummary(_0x5c8eae){if(_0x5c8eae['type']===_0x6a96('0x50')){var _0x3221f9={'id':_0x5c8eae['id'],'name':_0x5c8eae[_0x6a96('0x43')],'strategy':_0x5c8eae['strategy'],'answered':_0x5c8eae[_0x6a96('0x51')],'available':_0x5c8eae[_0x6a96('0x52')],'loggedIn':_0x5c8eae[_0x6a96('0x53')],'pTalking':_0x5c8eae[_0x6a96('0x54')],'sumBillable':_0x5c8eae['sumBillable'],'sumDuration':_0x5c8eae[_0x6a96('0x55')],'sumHoldTime':_0x5c8eae[_0x6a96('0x56')]||0x0,'talking':_0x5c8eae[_0x6a96('0x57')],'total':_0x5c8eae[_0x6a96('0x58')],'type':_0x5c8eae[_0x6a96('0x59')],'unmanaged':_0x5c8eae[_0x6a96('0x5a')],'abandoned':_0x5c8eae['abandoned'],'waiting':_0x5c8eae[_0x6a96('0x5b')],'loggedInDb':_0x5c8eae[_0x6a96('0x5c')],'dialActive':_0x5c8eae[_0x6a96('0x5d')],'dialMethod':_0x5c8eae['dialMethod'],'dialOriginateCallerIdName':_0x5c8eae['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5c8eae[_0x6a96('0x5e')],'dialOriginateTimeout':_0x5c8eae['dialOriginateTimeout'],'dialPrefix':_0x5c8eae[_0x6a96('0x5f')],'outboundAnswerAgiCallsDay':_0x5c8eae[_0x6a96('0x60')],'outboundAnswerCallsDay':_0x5c8eae['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x5c8eae[_0x6a96('0x61')],'outboundBusyCallsDay':_0x5c8eae['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x5c8eae['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x5c8eae[_0x6a96('0x62')],'outboundDropCallsDayCallersExit':_0x5c8eae['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5c8eae[_0x6a96('0x63')],'outboundNoAnswerCallsDay':_0x5c8eae[_0x6a96('0x64')],'outboundNoSuchCallsDay':_0x5c8eae[_0x6a96('0x65')],'outboundOriginateFailureCallsDay':_0x5c8eae['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5c8eae[_0x6a96('0x66')],'outboundRejectCallsDay':_0x5c8eae[_0x6a96('0x67')],'outboundUnknownCallsDay':_0x5c8eae[_0x6a96('0x68')],'predictiveIntervalAnsweredCalls':_0x5c8eae['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x5c8eae[_0x6a96('0x69')],'predictiveIntervalAvgTalktime':_0x5c8eae['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x5c8eae[_0x6a96('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x5c8eae['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x5c8eae[_0x6a96('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x5c8eae[_0x6a96('0x6c')],'predictiveIntervalHitRate':_0x5c8eae['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x5c8eae[_0x6a96('0x6d')],'predictiveIntervalPauses':_0x5c8eae['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x5c8eae[_0x6a96('0x6e')],'predictiveIntervalTotalCalls':_0x5c8eae[_0x6a96('0x6f')],'message':_0x5c8eae[_0x6a96('0x41')],'originated':_0x5c8eae[_0x6a96('0x70')],'erlangCalls':_0x5c8eae['erlangCalls'],'erlangCallToSecond':_0x5c8eae[_0x6a96('0x71')],'erlangAbandonmentRate':_0x5c8eae['erlangAbandonmentRate'],'erlangBusyFactor':_0x5c8eae['erlangBusyFactor'],'startPredictive':_0x5c8eae[_0x6a96('0x72')],'startProgressive':_0x5c8eae['startProgressive']};if(_0x5c8eae[_0x6a96('0x73')]){_0x3221f9['Trunk']={'id':_0x5c8eae['Trunk']['id'],'name':_0x5c8eae['Trunk'][_0x6a96('0x43')],'active':_0x5c8eae[_0x6a96('0x73')]['active'],'callerid':_0x5c8eae[_0x6a96('0x73')][_0x6a96('0x74')]};}if(_0x5c8eae[_0x6a96('0x45')]){_0x3221f9[_0x6a96('0x45')]={'id':_0x5c8eae[_0x6a96('0x45')]['id'],'name':_0x5c8eae[_0x6a96('0x45')][_0x6a96('0x43')]};}var _0x5d4f72=md5(JSON['stringify'](_0x3221f9));if(_0x5c8eae[_0x6a96('0x4')]!==_0x5d4f72){_0x5c8eae['md5']=_0x5d4f72;emit(util[_0x6a96('0x75')]('voice:queue:%s',_0x3221f9[_0x6a96('0x43')]),_0x6a96('0x76'),_0x3221f9);}}}function emitCampaignSummary(_0x23bb75){if(_0x23bb75[_0x6a96('0x59')]===_0x6a96('0x77')){emit(util[_0x6a96('0x75')]('campaign:ivr:%s',_0x23bb75[_0x6a96('0x43')]),_0x6a96('0x78'),_0x23bb75);}}function checkGetDataPredictive(_0x508dba){if(isNotNull(_0x508dba)&&!_[_0x6a96('0x48')](_0x508dba)){loggerPredictive[_0x6a96('0x79')](_0x6a96('0x7a'));loggerPredictive['info'](_0x6a96('0x7b'),_0x508dba[_0x6a96('0x6f')]);loggerPredictive[_0x6a96('0x79')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x508dba[_0x6a96('0x7c')]);loggerPredictive['info'](_0x6a96('0x7d'),_0x508dba['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x7e'),_0x508dba[_0x6a96('0x6a')]);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x7f'),_0x508dba['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x80'),_0x508dba[_0x6a96('0x81')]);loggerPredictive[_0x6a96('0x79')]('---------------------------');if(_0x508dba['predictiveIntervalTotalCalls']>0x0){if(!_[_0x6a96('0x82')](_0x508dba[_0x6a96('0x81')])&&_0x508dba[_0x6a96('0x81')]>0x0){return!![];}loggerPredictive[_0x6a96('0x79')](_0x6a96('0x83'));if(!_['isUndefined'](_0x508dba[_0x6a96('0x69')])&&_0x508dba[_0x6a96('0x69')]>0x0){return!![];}loggerPredictive[_0x6a96('0x79')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x6a96('0x79')](_0x6a96('0x84'));}}else{loggerPredictive['info'](_0x6a96('0x85'));}return![];}function mergeDataErlangB(_0x376e86){return function(_0x5c807d){loggerPredictive['info'](_0x6a96('0x86'));loggerPredictive[_0x6a96('0x79')](_0x6a96('0x87'),_0x5c807d[_0x6a96('0x88')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c807d[_0x6a96('0x71')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c807d['erlangAbandonmentRate']);loggerPredictive['info'](_0x6a96('0x89'),_0x5c807d[_0x6a96('0x8a')]);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x8b'),_0x5c807d[_0x6a96('0x8c')]);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x8d'));_['merge'](_0x376e86,_0x5c807d);};}function getDiff(_0x3c642b){var _0x2b8699=moment()[_0x6a96('0x4c')](0x0);var _0x3e20c8=moment(_0x3c642b)['milliseconds'](0x0);return _0x2b8699[_0x6a96('0x4d')](_0x3e20c8,_0x6a96('0x4e'));}function ifInterval(_0x2f4473,_0x5df0d5){if(_[_0x6a96('0x82')](_0x5df0d5)){return![];}return getDiff(_0x5df0d5)<_0x2f4473*0x3c;}function freeVariablesPredictive(_0x2d0f43){if(isNotNull(_0x2d0f43)){if(!_[_0x6a96('0x82')](_0x2d0f43['startProgressive'])){_0x2d0f43[_0x6a96('0x8e')]=undefined;loggerPredictive[_0x6a96('0x79')](_0x2d0f43['name'],_0x6a96('0x8f'));}if(!_[_0x6a96('0x82')](_0x2d0f43['startPredictive'])){_0x2d0f43[_0x6a96('0x72')]=undefined;loggerPredictive[_0x6a96('0x79')](_0x2d0f43['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x6a96('0x82')](_0x2d0f43[_0x6a96('0x90')])){clearInterval(_0x2d0f43[_0x6a96('0x90')]);_0x2d0f43[_0x6a96('0x90')]=undefined;loggerPredictive['info'](_0x2d0f43[_0x6a96('0x43')],_0x6a96('0x91'));}}}function erlangb(_0x975ab6,_0x90d408){if(_0x90d408===0x0){return 0x0;}var _0x31d0a4=0x1;for(var _0xc8a9ea=0x1;_0xc8a9ea<=_0x90d408;_0xc8a9ea+=0x1){_0x31d0a4=0x1+_0x31d0a4*_0xc8a9ea/_0x975ab6;}return 0x1/_0x31d0a4;}function isVoiceQueueOutbound(_0x1f83ec){return _0x1f83ec===_0x6a96('0x50');}function isNotPreview(_0x38ee77){return _0x38ee77!==_0x6a96('0x1e');}function isCampaignIvr(_0x4da03d){return _0x4da03d===_0x6a96('0x77');}function getCallerId(_0x3379ad,_0x54ccf1,_0x4b376b){if(!_['isUndefined'](_0x4b376b)&&typeof _0x4b376b===_0x6a96('0x92')&&!_[_0x6a96('0x48')](_0x4b376b)){if(!_[_0x6a96('0x82')](_0x54ccf1)&&typeof _0x54ccf1===_0x6a96('0x92')&&!_[_0x6a96('0x48')](_0x54ccf1)){return util[_0x6a96('0x75')]('\x22%s\x22\x20<%s>',_0x54ccf1,_0x4b376b);}return util[_0x6a96('0x75')](_0x6a96('0x93'),_0x4b376b,_0x4b376b);}if(!_['isUndefined'](_0x3379ad)&&typeof _0x3379ad===_0x6a96('0x92')&&!_['isEmpty'](_0x3379ad)){return _0x3379ad;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x58e23c,_0x158eda){return function(_0x51ab57){freeVariablesPredictive(_0x158eda);emitVoiceQueueSummary(_0x158eda);emitCampaignSummary(_0x158eda);loggerSyncQueueSummary[_0x6a96('0x94')](_0x58e23c,util['inspect'](_0x51ab57,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2946e8,_0x4f9d69){return function(_0x212195){loggerPredictive['error'](_0x4f9d69['name'],_0x2946e8);loggerPredictive['error'](_0x212195['stack']);freeVariablesPredictive(_0x4f9d69);};}function loggerCatch(_0x2580f8){return function(_0x4f3ff9){logger[_0x6a96('0x94')](_0x2580f8,util[_0x6a96('0x95')](_0x4f3ff9,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1bfa23){return _0x1bfa23&&!_[_0x6a96('0x82')](_0x1bfa23)&&_0x1bfa23[_0x6a96('0x96')]>0x0;}function decremetOriginate(_0x29fee3){if(!_[_0x6a96('0x82')](_0x29fee3)&&_0x29fee3!==null){if(typeof _0x29fee3[_0x6a96('0x70')]!==_0x6a96('0x97')){if(_0x29fee3[_0x6a96('0x70')]>0x0){_0x29fee3[_0x6a96('0x70')]-=0x1;}else{logger[_0x6a96('0x94')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x295bb8,_0x6fd054,_0x5acf9f){if(_0x6fd054>_0x5acf9f){for(var _0x1b8fa2=0x0;_0x1b8fa2<_0x6fd054-_0x5acf9f;_0x1b8fa2+=0x1){decremetOriginate(_0x295bb8);}}}function loggerGetContactDialer(_0x5f48b0,_0x3fd875,_0x421314){return function(_0x29a6d7){checkContactLowerLimitOriginate(_0x3fd875,_0x421314,0x0);logger['error'](_0x5f48b0,util['inspect'](_0x29a6d7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1441a7){return function(_0xebaf6a){if(isNotNull(_0xebaf6a)&&isNotNull(_0xebaf6a[0x0])){if(_0xebaf6a[0x0][_0x6a96('0x98')]>0x0){_0x1441a7[_0x6a96('0x41')]=_0x6a96('0x99');logger[_0x6a96('0x79')](_0x6a96('0x9a')+_0x1441a7[_0x6a96('0x43')],_0xebaf6a[0x0][_0x6a96('0x98')],_0x6a96('0x9b'));}else{_0x1441a7[_0x6a96('0x41')]=_0x6a96('0x9c');logger[_0x6a96('0x79')]('[getContactDialer2][Empty]'+_0x1441a7[_0x6a96('0x43')]);}}};}function notSendMessagesQueue(_0x4e7963){if(_0x4e7963[_0x6a96('0x9d')]){freeVariablesPredictive(_0x4e7963);if(_0x4e7963[_0x6a96('0x70')]===0x0&&_0x4e7963['talking']===0x0&&_0x4e7963[_0x6a96('0x5b')]===0x0&&(_0x4e7963[_0x6a96('0x54')]||0x0)===0x0){_0x4e7963['sendMessageOneNotActive']=![];_0x4e7963['available']=0x0;_0x4e7963[_0x6a96('0x41')]=_0x6a96('0x9e');}else{_0x4e7963[_0x6a96('0x41')]=_0x6a96('0x9f');}emitVoiceQueueSummary(_0x4e7963);}}function notSendMessagesCampaign(_0x35ada0){if(_0x35ada0['sendMessageOneNotActive']){if(_0x35ada0[_0x6a96('0x70')]===0x0){_0x35ada0[_0x6a96('0x9d')]=![];_0x35ada0[_0x6a96('0x41')]=_0x6a96('0x9e');}else{_0x35ada0[_0x6a96('0x41')]=_0x6a96('0x9f');}emitCampaignSummary(_0x35ada0);}}function createObjHistory(_0x40d1b1,_0x5c74b8,_0x3abef6,_0x5ce997,_0x5748a1){_0x40d1b1[_0x6a96('0x41')]=_0x3abef6;var _0x491383=new Action(_0x40d1b1,_0x5c74b8);var _0x4a959f=new History(_0x491383);_0x4a959f[_0x6a96('0xa0')]=_0x5ce997;_0x4a959f[_0x6a96('0xa1')]=_0x5748a1;_0x4a959f[_0x6a96('0xa2')]=_0x491383['starttime'];return _0x4a959f;}Dialer[_0x6a96('0x1a')][_0x6a96('0x3e')]=function(){var _0x3a023f=this;setInterval(function(){_0x3a023f['clearZombieChannels'](_0x3a023f['uniqueId'],_0x6a96('0xa3'));_0x3a023f[_0x6a96('0xa4')](_0x3a023f[_0x6a96('0x24')],_0x6a96('0xa5'));},0x32c8);};Dialer[_0x6a96('0x1a')][_0x6a96('0xa4')]=function(_0x3fe20f,_0x30b8c7){var _0x3283fc=this;for(var _0xce2fed in _0x3fe20f){if(typeof _0x3fe20f[_0xce2fed]!==_0x6a96('0x97')){this[_0x6a96('0x1d')]['enqueue'](function(){if(!_[_0x6a96('0xa6')](_0x3fe20f[_0xce2fed])){return ami[_0x6a96('0xa7')]({'action':_0x6a96('0xa8'),'channel':_0x3fe20f[_0xce2fed][_0x6a96('0xa9')]})[_0x6a96('0xaa')](function(_0x353725){if(_0x353725['message']===_0x6a96('0xab')){setTimeout(function(){if(_0x3fe20f[_0xce2fed]&&_0x3fe20f[_0xce2fed][_0x6a96('0x59')]!=='ivr'){_0x3283fc[_0x6a96('0xac')](_0x3283fc[_0x6a96('0x1f')][_0x3fe20f[_0xce2fed][_0x6a96('0xad')]]);logger[_0x6a96('0x94')](_0x6a96('0xae'),_0x30b8c7,_0xce2fed,_0x3fe20f[_0xce2fed]['queue']);delete _0x3fe20f[_0xce2fed];}if(_0x3fe20f[_0xce2fed]&&_0x3fe20f[_0xce2fed][_0x6a96('0x59')]==='ivr'){_0x3283fc['updateOriginated'](_0x3283fc[_0x6a96('0x20')][_0x3fe20f[_0xce2fed][_0x6a96('0xad')]]);logger[_0x6a96('0x94')](_0x6a96('0xaf'),_0x30b8c7,_0xce2fed,_0x3fe20f[_0xce2fed][_0x6a96('0xad')]);delete _0x3fe20f[_0xce2fed];}},0x2328);}});}});}}};Dialer['prototype'][_0x6a96('0xb0')]=function(_0x8e6d9f){return BPromise[_0x6a96('0xb1')]()[_0x6a96('0xb2')](cmHopper[_0x6a96('0xb0')](_0x8e6d9f))[_0x6a96('0xaa')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x6a96('0x1a')][_0x6a96('0xb3')]=function(_0x47ee49){return BPromise[_0x6a96('0xb1')]()[_0x6a96('0xb2')](cmHopperBlack['checkIsBlackList'](_0x47ee49))[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xb4')));};Dialer[_0x6a96('0x1a')][_0x6a96('0xb5')]=function(_0x5ba1a8){return BPromise[_0x6a96('0xb1')]()[_0x6a96('0xb2')](cmHopperBlack['checkIsBlackListIvr'](_0x5ba1a8))[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xb6')));};Dialer[_0x6a96('0x1a')][_0x6a96('0xb7')]=function(_0x53b8d2){return BPromise[_0x6a96('0xb1')]()[_0x6a96('0xb2')](cmHopperHistory[_0x6a96('0xb8')](_0x53b8d2))[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xb9')));};Dialer[_0x6a96('0x1a')]['rescheduleContact']=function(_0x14e264){return BPromise[_0x6a96('0xb1')]()[_0x6a96('0xb2')](cmHopper['rescheduleContact'](_0x14e264))[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xba')));};Dialer[_0x6a96('0x1a')][_0x6a96('0xbb')]=function(_0x1c5d52,_0xb26f28,_0x2e154e){return BPromise[_0x6a96('0xb1')]()[_0x6a96('0xb2')](cmHopper[_0x6a96('0xbb')](_0x1c5d52,_0xb26f28,_0x2e154e))[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xbc')));};Dialer[_0x6a96('0x1a')][_0x6a96('0xbd')]=function(_0x509fe8,_0x2d9d50,_0x2f3bc6,_0x2835e9,_0x26fc8d){return BPromise[_0x6a96('0xb1')]()[_0x6a96('0xb2')](cmHopper[_0x6a96('0xbd')](_0x509fe8,_0x2d9d50,_0x2f3bc6,_0x2835e9))[_0x6a96('0xaa')](function(_0x404800){_0x26fc8d[_0x6a96('0xbe')]-=_0x2f3bc6;_0x26fc8d[_0x6a96('0xbe')]=_0x26fc8d[_0x6a96('0xbe')]>0x0?_0x26fc8d[_0x6a96('0xbe')]:0x0;loggerCatch(_0x6a96('0xbf'))(_0x404800);});};Dialer['prototype'][_0x6a96('0xc0')]=function(_0x23fb07,_0x19f716,_0x5f0181,_0x2903d9){return BPromise[_0x6a96('0xb1')]()['then'](cmHopper[_0x6a96('0xc0')](_0x23fb07,_0x19f716,_0x5f0181))[_0x6a96('0xaa')](function(_0x5a7f21){_0x2903d9[_0x6a96('0xbe')]-=_0x19f716;_0x2903d9[_0x6a96('0xbe')]=_0x2903d9[_0x6a96('0xbe')]>0x0?_0x2903d9[_0x6a96('0xbe')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x5a7f21);});};Dialer[_0x6a96('0x1a')]['getVoiceQueueRtPauses']=function(_0x11d7a2){return BPromise['resolve']()[_0x6a96('0xb2')](voiceQueueRt[_0x6a96('0xc1')](_0x11d7a2))[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xc2')));};Dialer[_0x6a96('0x1a')]['moveContactManagedDialer']=function(_0x3d7719){return BPromise[_0x6a96('0xb1')]()[_0x6a96('0xb2')](cmHopper['moveContactManagedDialer'](_0x3d7719))[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xc3')));};Dialer[_0x6a96('0x1a')][_0x6a96('0xc4')]=function(_0xd060e4){return BPromise[_0x6a96('0xb1')]()[_0x6a96('0xb2')](cmHopperHistory[_0x6a96('0xc4')](_0xd060e4))[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xc5')));};Dialer[_0x6a96('0x1a')][_0x6a96('0xac')]=function(_0x5c5a96){if(!_[_0x6a96('0x82')](_0x5c5a96)&&_0x5c5a96!==null){if(typeof _0x5c5a96[_0x6a96('0x70')]!=='undefined'){if(_0x5c5a96[_0x6a96('0x70')]>0x0){_0x5c5a96[_0x6a96('0x70')]-=0x1;}else{logger[_0x6a96('0x94')](_0x6a96('0xc6'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x6a96('0xc7')]=function(_0x11a922,_0x513c72){var _0x4b86a1=this;return function(_0x46e633){_0x4b86a1[_0x6a96('0xac')](_0x513c72);logger[_0x6a96('0x94')](_0x11a922,util[_0x6a96('0x95')](_0x46e633,{'showHidden':![],'depth':null}));};};Dialer[_0x6a96('0x1a')][_0x6a96('0xc8')]=function(_0x2e4842,_0x58886c,_0x196294){var _0x311f78={'state':0x19,'statedesc':_0x6a96('0xc9')};this[_0x6a96('0xac')](_0x58886c);this[_0x6a96('0xca')](_['merge'](_0x311f78,_['pick'](_0x196294,[_0x6a96('0xcb'),'ListId','UserId','VoiceQueueId','CampaignId'])),_0x6a96('0xcc'),_0x6a96('0xcd'));logger[_0x6a96('0x94')](_0x2e4842);};Dialer[_0x6a96('0x1a')]['isSuccess']=function(_0x287db9){return _0x287db9==='Success';};Dialer[_0x6a96('0x1a')][_0x6a96('0xce')]=function(_0x3a031f){return!_[_0x6a96('0x82')](_0x3a031f)&&_0x3a031f&&!_[_0x6a96('0x82')](_0x3a031f[_0x6a96('0x43')])&&!_[_0x6a96('0x82')](_0x3a031f[_0x6a96('0xcf')])&&_0x3a031f[_0x6a96('0xcf')]&&(this[_0x6a96('0x22')][util[_0x6a96('0x75')](_0x6a96('0xd0'),_0x3a031f[_0x6a96('0x43')])][_0x6a96('0xa8')]==='reachable'||this[_0x6a96('0x22')][util[_0x6a96('0x75')](_0x6a96('0xd0'),_0x3a031f[_0x6a96('0x43')])][_0x6a96('0xa8')]===_0x6a96('0xd1'));};Dialer[_0x6a96('0x1a')][_0x6a96('0xca')]=function(_0x44d3cc,_0x240e6f,_0x441e99){this[_0x6a96('0xc4')](_0x44d3cc)['catch'](loggerCatch(_0x240e6f));this[_0x6a96('0xd2')](_0x44d3cc)[_0x6a96('0xaa')](loggerCatch(_0x441e99));};Dialer[_0x6a96('0x1a')][_0x6a96('0x38')]=function(_0x1764c6){var _0x3a2bdb=this[_0x6a96('0x26')][_0x1764c6[_0x6a96('0xd3')]];var _0x4f6421;if(!_[_0x6a96('0xa6')](_0x1764c6)&&!_[_0x6a96('0xa6')](_0x1764c6[_0x6a96('0xd4')])&&!_[_0x6a96('0xa6')](_0x1764c6[_0x6a96('0xd4')]['amdstatus'])&&_0x1764c6[_0x6a96('0xd5')]===_0x6a96('0xd6')&&_0x3a2bdb){if(_0x3a2bdb[_0x6a96('0x59')]!==_0x6a96('0x77')&&this[_0x6a96('0x1f')][_0x3a2bdb[_0x6a96('0xad')]][_0x6a96('0xd7')]&&_0x1764c6[_0x6a96('0xd8')]===_0x6a96('0xd9')){delete this['uniqueId'][_0x1764c6[_0x6a96('0xd3')]];this['updateOriginated'](this[_0x6a96('0x1f')][_0x3a2bdb[_0x6a96('0xad')]]);this[_0x6a96('0x1f')][_0x3a2bdb[_0x6a96('0xad')]][_0x6a96('0xda')]+=0x1;this[_0x6a96('0x1f')][_0x3a2bdb['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x4f6421=new Hangup(_0x3a2bdb,_0x1764c6);_0x4f6421[_0x6a96('0xa0')]=0x12;_0x4f6421['statedesc']='HangupInAMD';_0x4f6421[_0x6a96('0xdb')]=_0x6a96('0xdc');ami[_0x6a96('0x4f')](_0x6a96('0xdd'),ut['buildObj'](_0x4f6421,'amd'));this['saveInDb'](_0x4f6421,_0x6a96('0xde'),_0x6a96('0xdf'));}if(_0x3a2bdb[_0x6a96('0x59')]!==_0x6a96('0x77')&&this['voiceQueues'][_0x3a2bdb[_0x6a96('0xad')]][_0x6a96('0xd7')]&&_0x1764c6['value']==='MACHINE'){var _0x354c63=this;return new BPromise(function(_0x3da76a,_0x7b5b3d){delete _0x354c63['uniqueId'][_0x1764c6[_0x6a96('0xd3')]];_0x354c63[_0x6a96('0xac')](_0x354c63['voiceQueues'][_0x3a2bdb['queue']]);_0x354c63[_0x6a96('0x1f')][_0x3a2bdb[_0x6a96('0xad')]][_0x6a96('0xda')]+=0x1;_0x354c63[_0x6a96('0x1f')][_0x3a2bdb[_0x6a96('0xad')]][_0x6a96('0x60')]+=0x1;var _0x4b75f9=_0x354c63[_0x6a96('0x1f')][_0x3a2bdb[_0x6a96('0xad')]];var _0x35cd43=new Hangup(_0x3a2bdb,_0x1764c6);_0x35cd43[_0x6a96('0xa0')]=0x13;_0x35cd43['statedesc']=_0x6a96('0xe0');_0x35cd43['membername']=_0x6a96('0xdc');_0x35cd43[_0x6a96('0xe1')]+=0x1;_0x35cd43[_0x6a96('0xe2')]+=0x1;_0x35cd43[_0x6a96('0xe3')]=!![];ami[_0x6a96('0x4f')](_0x6a96('0xdd'),ut[_0x6a96('0xe4')](_0x35cd43,_0x6a96('0xe3')));_0x354c63[_0x6a96('0xc4')](_0x35cd43)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xe5')));if(_0x35cd43['countbusyretry']+_0x35cd43[_0x6a96('0xe6')]+_0x35cd43[_0x6a96('0xe7')]+_0x35cd43[_0x6a96('0xe8')]+_0x35cd43[_0x6a96('0xe9')]+_0x35cd43[_0x6a96('0xea')]+_0x35cd43[_0x6a96('0xe1')]+_0x35cd43[_0x6a96('0xeb')]>=_0x4b75f9[_0x6a96('0xec')]){_0x354c63['stateGlobal'](_0x35cd43,_0x3da76a,_0x7b5b3d,_0x6a96('0xed'));}else{if(_0x35cd43['countmachineretry']>=_0x4b75f9[_0x6a96('0xee')]){_0x354c63['createStateFinal'](_0x35cd43,_0x3da76a,_0x7b5b3d,_0x6a96('0xef'));}else{_0x354c63[_0x6a96('0xf0')]({'active':![],'countmachineretry':_0x35cd43[_0x6a96('0xe1')],'scheduledat':moment()['add'](_0x4b75f9[_0x6a96('0xf1')],_0x6a96('0xf2'))[_0x6a96('0x75')](_0x6a96('0xf3')),'ContactId':_0x35cd43[_0x6a96('0xcb')],'ListId':_0x35cd43[_0x6a96('0xf4')],'VoiceQueueId':_0x35cd43[_0x6a96('0xf5')]||undefined,'CampaignId':_0x35cd43[_0x6a96('0xf6')]||undefined})[_0x6a96('0xaa')](loggerCatch('[rescheduleContact][Machine]'));_0x3da76a({'reschedule':0x1});}}});}if(_0x3a2bdb[_0x6a96('0x59')]===_0x6a96('0x77')&&this[_0x6a96('0x20')][_0x3a2bdb[_0x6a96('0xad')]][_0x6a96('0xd7')]&&_0x1764c6[_0x6a96('0xd8')]==='HANGUP'){delete this[_0x6a96('0x26')][_0x1764c6[_0x6a96('0xd3')]];this[_0x6a96('0xac')](this[_0x6a96('0x20')][_0x3a2bdb['queue']]);_0x4f6421=new Hangup(_0x3a2bdb,_0x1764c6);_0x4f6421[_0x6a96('0xa0')]=0x12;_0x4f6421[_0x6a96('0xa1')]=_0x6a96('0xf7');_0x4f6421[_0x6a96('0xdb')]=_0x6a96('0xdc');ami[_0x6a96('0x4f')](_0x6a96('0xdd'),ut[_0x6a96('0xe4')](_0x4f6421,_0x6a96('0xe3')));this[_0x6a96('0xca')](_0x4f6421,'[syncHangupInAMDIvr][createHistory]',_0x6a96('0xf8'));}if(_0x3a2bdb[_0x6a96('0x59')]==='ivr'&&this['campaigns'][_0x3a2bdb[_0x6a96('0xad')]][_0x6a96('0xd7')]&&_0x1764c6[_0x6a96('0xd8')]==='MACHINE'){var _0x354c63=this;return new BPromise(function(_0x51111f,_0x119310){delete _0x354c63['uniqueId'][_0x1764c6[_0x6a96('0xd3')]];_0x354c63[_0x6a96('0xac')](_0x354c63[_0x6a96('0x20')][_0x3a2bdb['queue']]);_0x354c63[_0x6a96('0x20')][_0x3a2bdb[_0x6a96('0xad')]]['outboundAnswerCallsDay']+=0x1;_0x354c63[_0x6a96('0x20')][_0x3a2bdb['queue']][_0x6a96('0x60')]+=0x1;var _0x50a218=_0x354c63[_0x6a96('0x20')][_0x3a2bdb[_0x6a96('0xad')]];var _0x367989=new Hangup(_0x3a2bdb,_0x1764c6);_0x367989[_0x6a96('0xa0')]=0x13;_0x367989[_0x6a96('0xa1')]=_0x6a96('0xe0');_0x367989[_0x6a96('0xdb')]=_0x6a96('0xdc');_0x367989[_0x6a96('0xe1')]+=0x1;_0x367989[_0x6a96('0xe2')]+=0x1;_0x367989[_0x6a96('0xe3')]=!![];ami[_0x6a96('0x4f')](_0x6a96('0xdd'),ut['buildObj'](_0x367989,_0x6a96('0xe3')));_0x354c63[_0x6a96('0xc4')](_0x367989)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xe5')));if(_0x367989[_0x6a96('0xf9')]+_0x367989[_0x6a96('0xe6')]+_0x367989[_0x6a96('0xe7')]+_0x367989[_0x6a96('0xe8')]+_0x367989['countdropretry']+_0x367989[_0x6a96('0xea')]+_0x367989[_0x6a96('0xe1')]+_0x367989['countagentrejectretry']>=_0x50a218[_0x6a96('0xec')]){_0x354c63[_0x6a96('0xfa')](_0x367989,_0x51111f,_0x119310,'reason19\x20machine....');}else{if(_0x367989[_0x6a96('0xe1')]>=_0x50a218[_0x6a96('0xee')]){_0x354c63['createStateFinal'](_0x367989,_0x51111f,_0x119310,'reason\x2019\x20machine....');}else{_0x354c63[_0x6a96('0xf0')]({'active':![],'countmachineretry':_0x367989[_0x6a96('0xe1')],'scheduledat':moment()[_0x6a96('0xfb')](_0x50a218[_0x6a96('0xf1')],_0x6a96('0xf2'))['format'](_0x6a96('0xf3')),'ContactId':_0x367989[_0x6a96('0xcb')],'ListId':_0x367989[_0x6a96('0xf4')],'VoiceQueueId':_0x367989[_0x6a96('0xf5')]||undefined,'CampaignId':_0x367989[_0x6a96('0xf6')]||undefined})['catch'](loggerCatch(_0x6a96('0xfc')));_0x51111f({'reschedule':0x1});}}});}}};Dialer[_0x6a96('0x1a')][_0x6a96('0x34')]=function(_0x1f763b){var _0x5f4f34=this[_0x6a96('0x26')][_0x1f763b['uniqueid']];var _0x42ed5c=this;var _0x53de86;if(_0x5f4f34&&_0x5f4f34[_0x6a96('0x59')]===_0x6a96('0x77')){delete this[_0x6a96('0x26')][_0x1f763b[_0x6a96('0xd3')]];this[_0x6a96('0xac')](this['campaigns'][_0x5f4f34['queue']]);this[_0x6a96('0x20')][_0x5f4f34[_0x6a96('0xad')]][_0x6a96('0xfd')]+=0x1;_0x53de86=new Hangup(_0x5f4f34,_0x1f763b);this['createHistory'](_0x53de86)['catch'](loggerCatch(_0x6a96('0xfe')));this['moveContactManagedDialer'](_0x53de86)['catch'](loggerCatch(_0x6a96('0xff')));}if(_0x5f4f34&&_0x5f4f34[_0x6a96('0x59')]!==_0x6a96('0x77')&&isNotNull(this[_0x6a96('0x1f')][_0x5f4f34[_0x6a96('0xad')]][_0x6a96('0x100')])){delete this[_0x6a96('0x26')][_0x1f763b['uniqueid']];this[_0x6a96('0xac')](this[_0x6a96('0x1f')][_0x5f4f34['queue']]);this[_0x6a96('0x1f')][_0x5f4f34[_0x6a96('0xad')]][_0x6a96('0xda')]+=0x1;this[_0x6a96('0x1f')][_0x5f4f34[_0x6a96('0xad')]][_0x6a96('0x60')]+=0x1;_0x53de86=new Hangup(_0x5f4f34,_0x1f763b);_0x53de86[_0x6a96('0xa0')]=0x10;_0x53de86[_0x6a96('0xa1')]=_0x6a96('0x101');_0x53de86[_0x6a96('0xdb')]=_0x6a96('0x102');this['createHistory'](_0x53de86)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xfe')));this[_0x6a96('0xd2')](_0x53de86)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xff')));}if(_0x5f4f34&&_0x5f4f34[_0x6a96('0x59')]!==_0x6a96('0x77')&&!isNotNull(this[_0x6a96('0x1f')][_0x5f4f34['queue']][_0x6a96('0x100')])){delete this[_0x6a96('0x26')][_0x1f763b['uniqueid']];this[_0x6a96('0xac')](this[_0x6a96('0x1f')][_0x5f4f34[_0x6a96('0xad')]]);this['voiceQueues'][_0x5f4f34['queue']][_0x6a96('0x68')]+=0x1;_0x53de86=new Hangup(_0x5f4f34,_0x1f763b);_0x53de86['state']=0xc;_0x53de86['statedesc']=_0x1f763b[_0x6a96('0x103')];_0x53de86[_0x6a96('0xdb')]=_0x6a96('0x104');this['createHistory'](_0x53de86)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xfe')));this['moveContactManagedDialer'](_0x53de86)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0xff')));}};Dialer['prototype'][_0x6a96('0x32')]=function(_0x5dc897){var _0x4e6ef4=this['uniqueId'][_0x5dc897['uniqueid']];var _0x2e8ef6=this;if(this[_0x6a96('0x1f')][_0x5dc897[_0x6a96('0xad')]]){if(_0x4e6ef4&&_0x4e6ef4[_0x6a96('0x59')]!==_0x6a96('0x77')){delete this[_0x6a96('0x26')][_0x5dc897[_0x6a96('0xd3')]];this[_0x6a96('0x1f')][_0x5dc897[_0x6a96('0xad')]]['outboundAnswerCallsDay']+=0x1;var _0x554114=new AgentComplete(_0x4e6ef4,_0x5dc897);if(_0x5dc897['reason']===_0x6a96('0x105')){_0x554114[_0x6a96('0x106')]=this[_0x6a96('0x1f')][_0x5dc897['queue']][_0x6a96('0x107')]&&this[_0x6a96('0x1f')][_0x5dc897[_0x6a96('0xad')]][_0x6a96('0x108')]?moment()['format'](_0x6a96('0xf3')):undefined;}this['createHistory'](_0x554114)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x109')));this[_0x6a96('0xd2')](_0x554114)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x10a')));}}};Dialer['prototype'][_0x6a96('0x2c')]=function(_0x3620d8){if(this[_0x6a96('0x1f')][_0x3620d8['queue']]){if(this[_0x6a96('0x26')][_0x3620d8['uniqueid']]&&this[_0x6a96('0x26')][_0x3620d8[_0x6a96('0xd3')]][_0x6a96('0x59')]!==_0x6a96('0x77')){this[_0x6a96('0xac')](this[_0x6a96('0x1f')][_0x3620d8[_0x6a96('0xad')]]);this[_0x6a96('0x26')][_0x3620d8['uniqueid']][_0x6a96('0x10b')]=moment()[_0x6a96('0x75')](_0x6a96('0xf3'));}}};Dialer['prototype'][_0x6a96('0x10c')]=function(_0x375b52){this['createHistory'](_0x375b52)[_0x6a96('0xaa')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x6a96('0xd2')](_0x375b52)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x10d')));};Dialer[_0x6a96('0x1a')][_0x6a96('0x2f')]=function(_0xf604ce){var _0x278c7a=this[_0x6a96('0x26')][_0xf604ce[_0x6a96('0xd3')]];var _0x3c9e00=this;if(this['voiceQueues'][_0xf604ce['queue']]){if(_0x278c7a&&_0x278c7a[_0x6a96('0x59')]!==_0x6a96('0x77')){delete this[_0x6a96('0x26')][_0xf604ce['uniqueid']];this[_0x6a96('0xac')](this[_0x6a96('0x1f')][_0xf604ce[_0x6a96('0xad')]]);_0x278c7a[_0x6a96('0x10e')]=moment()[_0x6a96('0x75')](_0x6a96('0xf3'));var _0x622c9e=new QueueCallerAbandon(_0x278c7a,_0xf604ce);if(getSeconds(_0x278c7a[_0x6a96('0x10e')],_0x278c7a[_0x6a96('0x10f')])>=_0x278c7a[_0x6a96('0x110')]){this[_0x6a96('0x1f')][_0xf604ce[_0x6a96('0xad')]][_0x6a96('0x111')]+=0x1;this[_0x6a96('0x1f')][_0xf604ce['queue']][_0x6a96('0x63')]+=0x1;this[_0x6a96('0x1f')][_0xf604ce[_0x6a96('0xad')]][_0x6a96('0x6c')]+=0x1;_0x622c9e[_0x6a96('0xa0')]=0xa;_0x622c9e[_0x6a96('0xa1')]=_0x6a96('0x112');_0x622c9e[_0x6a96('0x113')]=_0x6a96('0x114');_0x622c9e['agiafterat']=this['voiceQueues'][_0xf604ce['queue']][_0x6a96('0x107')]?moment()[_0x6a96('0x75')](_0x6a96('0xf3')):undefined;_0x622c9e[_0x6a96('0xe9')]+=0x1;_0x622c9e[_0x6a96('0xe2')]+=0x1;if(_0x622c9e[_0x6a96('0xe9')]>=this[_0x6a96('0x1f')][_0xf604ce[_0x6a96('0xad')]][_0x6a96('0x115')]){this[_0x6a96('0x10c')](_0x622c9e);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x622c9e[_0x6a96('0xe9')],'scheduledat':moment()[_0x6a96('0xfb')](this[_0x6a96('0x1f')][_0xf604ce[_0x6a96('0xad')]][_0x6a96('0x116')],_0x6a96('0xf2'))[_0x6a96('0x75')](_0x6a96('0xf3')),'ContactId':_0x278c7a[_0x6a96('0xcb')],'ListId':_0x278c7a[_0x6a96('0xf4')],'VoiceQueueId':_0x278c7a[_0x6a96('0xf5')]||undefined,'CampaignId':_0x278c7a['CampaignId']||undefined})[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x117')));var _0x116cc1=new History(_0x622c9e);_0x116cc1['state']=0xa;_0x116cc1[_0x6a96('0xa1')]=_0x6a96('0x112');_0x116cc1[_0x6a96('0x118')]=moment()[_0x6a96('0x75')](_0x6a96('0xf3'));_0x116cc1[_0x6a96('0xa2')]=_0x116cc1[_0x6a96('0x118')];_0x116cc1['calleridname']=_0x622c9e[_0x6a96('0x119')];_0x116cc1[_0x6a96('0x11a')]=_0x622c9e[_0x6a96('0x11a')];this[_0x6a96('0xc4')](_0x116cc1)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x6a96('0x1f')][_0xf604ce[_0x6a96('0xad')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0xf604ce[_0x6a96('0xad')]]['outboundDropCallsDayCallersExit']+=0x1;_0x622c9e[_0x6a96('0xa0')]=0xb;_0x622c9e[_0x6a96('0xa1')]=_0x6a96('0x11b');_0x622c9e[_0x6a96('0x113')]=_0x6a96('0x11c');_0x622c9e[_0x6a96('0xea')]+=0x1;_0x622c9e[_0x6a96('0xe2')]+=0x1;if(_0x622c9e[_0x6a96('0xea')]>=this[_0x6a96('0x1f')][_0xf604ce[_0x6a96('0xad')]][_0x6a96('0x11d')]){this[_0x6a96('0x10c')](_0x622c9e);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x622c9e[_0x6a96('0xea')],'scheduledat':moment()['add'](this[_0x6a96('0x1f')][_0xf604ce[_0x6a96('0xad')]][_0x6a96('0x11e')],'minutes')[_0x6a96('0x75')](_0x6a96('0xf3')),'ContactId':_0x278c7a[_0x6a96('0xcb')],'ListId':_0x278c7a['ListId'],'VoiceQueueId':_0x278c7a[_0x6a96('0xf5')]||undefined,'CampaignId':_0x278c7a[_0x6a96('0xf6')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x116cc1=new History(_0x622c9e);_0x116cc1[_0x6a96('0xa0')]=0xb;_0x116cc1[_0x6a96('0xa1')]=_0x6a96('0x11b');_0x116cc1[_0x6a96('0x118')]=moment()['format'](_0x6a96('0xf3'));_0x116cc1['endtime']=_0x116cc1['starttime'];_0x116cc1[_0x6a96('0x119')]=_0x622c9e[_0x6a96('0x119')];_0x116cc1[_0x6a96('0x11a')]=_0x622c9e[_0x6a96('0x11a')];this[_0x6a96('0xc4')](_0x116cc1)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x6a96('0x1a')][_0x6a96('0x36')]=function(_0x590835){if(this[_0x6a96('0x24')][_0x590835[_0x6a96('0xd3')]]){this[_0x6a96('0x24')][_0x590835[_0x6a96('0xd3')]]['channel']=_0x590835[_0x6a96('0xa9')];}if(this['uniqueId'][_0x590835[_0x6a96('0xd3')]]){this[_0x6a96('0x26')][_0x590835['uniqueid']][_0x6a96('0xa9')]=_0x590835['channel'];}};Dialer[_0x6a96('0x1a')]['syncQueueMember']=function(_0xfa3fdc){if(strategy[this[_0x6a96('0x1f')][this['actions'][_0xfa3fdc[_0x6a96('0x11f')]][_0x6a96('0xad')]][_0x6a96('0x120')]]===_0x6a96('0x19')){if(this[_0x6a96('0x24')][_0xfa3fdc[_0x6a96('0x11f')]]&&_[_0x6a96('0xa6')](this[_0x6a96('0x24')][_0xfa3fdc[_0x6a96('0x11f')]][_0x6a96('0x121')])&&_0xfa3fdc[_0x6a96('0xa8')]==='1'&&_0xfa3fdc[_0x6a96('0x122')]==='0'){if(this[_0x6a96('0x21')][_0xfa3fdc['stateinterface']]){if(!this[_0x6a96('0x21')][_0xfa3fdc[_0x6a96('0x123')]][_0x6a96('0x121')]){this[_0x6a96('0x21')][_0xfa3fdc[_0x6a96('0x123')]][_0x6a96('0x121')]=!![];this['actions'][_0xfa3fdc['actionid']]['locked']=!![];this[_0x6a96('0x24')][_0xfa3fdc[_0x6a96('0x11f')]][_0x6a96('0x123')]=_0xfa3fdc[_0x6a96('0x123')];}}}}else if((strategy[this[_0x6a96('0x1f')][this[_0x6a96('0x24')][_0xfa3fdc[_0x6a96('0x11f')]][_0x6a96('0xad')]][_0x6a96('0x120')]]||_0x6a96('0x18'))===_0x6a96('0x18')){if(this['actions'][_0xfa3fdc[_0x6a96('0x11f')]]){if(this[_0x6a96('0x21')][_0xfa3fdc[_0x6a96('0x123')]]){this['actions'][_0xfa3fdc['actionid']][_0x6a96('0x123')]=_0xfa3fdc[_0x6a96('0x123')];if(_[_0x6a96('0xa6')](this['queueBooked'][this[_0x6a96('0x24')][_0xfa3fdc[_0x6a96('0x11f')]][_0x6a96('0xad')]])){this[_0x6a96('0x29')][this[_0x6a96('0x24')][_0xfa3fdc['actionid']][_0x6a96('0xad')]]=[];}this[_0x6a96('0x29')][this[_0x6a96('0x24')][_0xfa3fdc[_0x6a96('0x11f')]][_0x6a96('0xad')]]['push'](_[_0x6a96('0x124')](_['pick'](this[_0x6a96('0x24')][_0xfa3fdc[_0x6a96('0x11f')]],[_0x6a96('0x125'),'stateinterface']),{'status':_0xfa3fdc[_0x6a96('0xa8')],'paused':_0xfa3fdc[_0x6a96('0x122')]}));}}}};function unlockQueueStatus(_0xb480a3,_0xfcb35){setTimeout(function(){if(_['isUndefined'](_0xb480a3[_0x6a96('0x126')])){loggerBooked[_0x6a96('0x94')](_0x6a96('0x127'),_0xfcb35);}_0xb480a3[_0x6a96('0x126')]=!![];loggerBooked[_0x6a96('0x79')](_0x6a96('0x128'),_0xfcb35,JSON[_0x6a96('0x4b')](_[_0x6a96('0x129')](_0xb480a3,[_0x6a96('0x43'),_0x6a96('0x126')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x11b5a1){var _0x333447=this;var _0x1a76a9=_0x333447['voiceQueues'][_0x333447[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xad')]];if(strategy[this[_0x6a96('0x1f')][this['actions'][_0x11b5a1['actionid']][_0x6a96('0xad')]]['strategy']]==='roundrobin'){if(this['actions'][_0x11b5a1['actionid']]&&this[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]]['stateinterface']){this['preview'][_0x6a96('0x12a')](this[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0x125')],this[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0x123')])[_0x6a96('0xaa')](function(_0x3fd20f){logger[_0x6a96('0x94')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x6a96('0x95')](_0x3fd20f,{'showHidden':![],'depth':null}));})[_0x6a96('0x1c')](function(){_0x333447[_0x6a96('0xac')](_0x333447[_0x6a96('0x1f')][_0x333447[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xad')]]);_0x333447['agents'][_0x333447[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0x123')]]['locked']=![];delete _0x333447['actions'][_0x11b5a1[_0x6a96('0x11f')]];unlockQueueStatus(_0x1a76a9);});}else{this[_0x6a96('0xac')](this[_0x6a96('0x1f')][this['actions'][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xad')]]);this[_0x6a96('0xf0')]({'active':![],'ContactId':this[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xcb')],'ListId':this[_0x6a96('0x24')][_0x11b5a1['actionid']][_0x6a96('0xf4')],'VoiceQueueId':this[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xf5')]||undefined,'CampaignId':this[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]]['CampaignId']||undefined})[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x12b')));delete this[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]];unlockQueueStatus(_0x1a76a9);}}else if((strategy[this['voiceQueues'][this[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xad')]][_0x6a96('0x120')]]||_0x6a96('0x18'))===_0x6a96('0x18')){var _0x2774f3;if(this['actions'][_0x11b5a1[_0x6a96('0x11f')]]&&!_[_0x6a96('0x48')](this[_0x6a96('0x29')][this['actions'][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xad')]])){if(this[_0x6a96('0x2a')][_0x333447[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xad')]]){this['queueBookedRR'][_0x333447[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xad')]]=this[_0x6a96('0x2a')][this['actions'][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xad')]]?this['queueBookedRR'][this['actions'][_0x11b5a1['actionid']][_0x6a96('0xad')]]:this[_0x6a96('0x29')][this[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xad')]]?this[_0x6a96('0x29')][this[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]]['queue']][_0x6a96('0x12c')]||0x0:0x0;}this[_0x6a96('0x29')][this[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xad')]][_0x6a96('0x12c')]=this[_0x6a96('0x2a')][this[_0x6a96('0x24')][_0x11b5a1[_0x6a96('0x11f')]][_0x6a96('0xad')]];for(var _0x249ea1=0x0;_0x249ea1=0x0;})[_0x6a96('0xaa')](myreject(_0x1d0eaf)));}}else{_0x30b21f['push'](ami[_0x6a96('0xa7')]({'action':_0x6a96('0x148'),'command':util[_0x6a96('0x75')](_0x6a96('0x149'),_0x569f01,!_['isUndefined'](config[_0x6a96('0x144')][_0x4d2bee])?_0x4d2bee:'')})[_0x6a96('0xb2')](function(_0x5d32dc){return _0x5d32dc[_0x6a96('0x14b')]['indexOf'](_0x6a96('0x14a'))>=0x0;})[_0x6a96('0xaa')](myreject(_0x1d0eaf)));}BPromise[_0x6a96('0x14c')](_0x30b21f)[_0x6a96('0xb2')](function(_0x451917){var _0x39517f=_['some'](_0x451917);if(_0x39517f){return _0x32df4e(_0x39517f);}else{_0x41f77a[_0x6a96('0x41')]=_0x7a491a?_0x6a96('0x14d'):_0x6a96('0x14e');return _0x1d0eaf(msgResponse(_0x6a96('0x14f'),'Failure','Global:\x20'+_0x7a491a+'\x20'+_0x5302c3+_0x6a96('0x150')+util[_0x6a96('0x95')](_0x569f01,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4d2bee));}})[_0x6a96('0xaa')](function(_0x23ffa1){return _0x1d0eaf(msgResponse('ifTime',_0x6a96('0x142'),JSON[_0x6a96('0x4b')](_0x23ffa1)));});});};Dialer[_0x6a96('0x1a')][_0x6a96('0x151')]=function(_0x524cc0){var _0x3a68ac=this;return function(){switch(_0x524cc0[_0x6a96('0x152')]){case _0x6a96('0x153'):freeVariablesPredictive(_0x524cc0);_0x3a68ac[_0x6a96('0x154')](_0x524cc0,0x1);break;case'power':freeVariablesPredictive(_0x524cc0);_0x3a68ac[_0x6a96('0x154')](_0x524cc0,_0x524cc0[_0x6a96('0x155')]);break;case _0x6a96('0xa'):_0x3a68ac['predictive'](_0x524cc0);break;case _0x6a96('0x9'):freeVariablesPredictive(_0x524cc0);_0x3a68ac['handlePower'](_0x524cc0,0x1);break;default:freeVariablesPredictive(_0x524cc0);logger['error']('Queue',_0x524cc0[_0x6a96('0x43')],_0x6a96('0x156'));}};};Dialer['prototype']['launchHandleIvr']=function(_0x3177e3){var _0x2cfc32=this;return function(){_0x2cfc32[_0x6a96('0x157')](_0x3177e3);};};Dialer[_0x6a96('0x1a')][_0x6a96('0xc')]=function(_0x55f102){var _0x387034=this;if(isNotPreview(_0x55f102[_0x6a96('0x152')])){if(isVoiceQueueOutbound(_0x55f102['type'])&&isActive(_0x55f102[_0x6a96('0x5d')])){_0x55f102[_0x6a96('0x9d')]=!![];BPromise[_0x6a96('0xb1')]()[_0x6a96('0xb2')](checkIsLoggedIn(_0x55f102,_0x55f102[_0x6a96('0x53')]))[_0x6a96('0xb2')](checkIsActive(_0x55f102,_0x55f102[_0x6a96('0x5d')]))[_0x6a96('0xb2')](checkInterval(_0x55f102))[_0x6a96('0xb2')](_0x387034['checkIsTrunkReachable'](_0x55f102))[_0x6a96('0xb2')](_0x387034[_0x6a96('0x13e')](_0x55f102[_0x6a96('0x158')],_0x55f102[_0x6a96('0x159')],_0x55f102['name'],_0x55f102))[_0x6a96('0xb2')](_0x387034['checkIfTimeIntervals'](_0x55f102['Interval'],_0x55f102['dialTimezone'],_0x55f102[_0x6a96('0x43')],_0x55f102))['then'](_0x387034[_0x6a96('0x151')](_0x55f102))[_0x6a96('0xaa')](loggerCatchQueueSummary(_0x6a96('0x15a'),_0x55f102));}else{notSendMessagesQueue(_0x55f102);}}else{freeVariablesPredictive(_0x55f102);}};Dialer[_0x6a96('0x1a')][_0x6a96('0x15b')]=_['throttle'](function(){var _0x2c0ff4=_[_0x6a96('0x15c')](this[_0x6a96('0x1f')],function(_0x1bafce){return _0x1bafce[_0x6a96('0x15d')];});var _0x4d3700=_['filter'](this[_0x6a96('0x21')],function(_0x4569b0){return _0x4569b0[_0x6a96('0x15e')]&&_0x4569b0[_0x6a96('0xa8')]==='reachable';});console['log']('syncQueueSummaryComplete',_[_0x6a96('0x15f')](_0x2c0ff4,'id'),previewRecallmeReminderInterval,_[_0x6a96('0x15f')](_0x4d3700,'id'));if(_0x2c0ff4['length']>0x0&&_0x4d3700['length']>0x0){return BPromise[_0x6a96('0xb1')]()['then'](cmHopper[_0x6a96('0x160')](_[_0x6a96('0x15f')](_0x2c0ff4,'id'),previewRecallmeReminderInterval,_[_0x6a96('0x15f')](_0x4d3700,'id')))[_0x6a96('0xb2')](function(_0x34b7b6){console[_0x6a96('0x161')]('checkPreviewRecallReminder\x20res',_0x34b7b6);for(var _0x2fcccd=0x0;_0x2fcccd<_0x34b7b6['length'];_0x2fcccd++){var _0x396c06=_0x34b7b6[_0x2fcccd]['Agent'][_0x6a96('0x43')];if(_0x396c06)io['to'](util[_0x6a96('0x75')](_0x6a96('0x162'),_0x396c06))[_0x6a96('0x4f')](_0x6a96('0x163'),{'hopper':_0x34b7b6[_0x2fcccd]});}})[_0x6a96('0xaa')](function(_0x2e9c2f){logger['error'](_0x6a96('0x164'),_0x2e9c2f);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x6a96('0x139')]=function(){var _0x4da46f=this;var _0x3dfb46;for(var _0x5c2ab8 in this[_0x6a96('0x20')]){if(typeof this[_0x6a96('0x20')][_0x5c2ab8]!==_0x6a96('0x97')){_0x3dfb46=this['campaigns'][_0x5c2ab8];if(isCampaignIvr(_0x3dfb46[_0x6a96('0x59')])&&isActive(_0x3dfb46['active'])){_0x3dfb46[_0x6a96('0x9d')]=!![];BPromise[_0x6a96('0xb1')]()['then'](checkIsActive(_0x3dfb46,_0x3dfb46[_0x6a96('0xcf')]))['then'](checkInterval(_0x3dfb46))[_0x6a96('0xb2')](_0x4da46f[_0x6a96('0x13a')](_0x3dfb46))[_0x6a96('0xb2')](_0x4da46f['checkIfTime'](_0x3dfb46[_0x6a96('0x158')],_0x3dfb46[_0x6a96('0x159')],_0x3dfb46[_0x6a96('0x43')],_0x3dfb46))[_0x6a96('0xb2')](_0x4da46f[_0x6a96('0x140')](_0x3dfb46[_0x6a96('0x45')],_0x3dfb46[_0x6a96('0x159')],_0x3dfb46['name'],_0x3dfb46))[_0x6a96('0xb2')](_0x4da46f[_0x6a96('0x165')](_0x3dfb46))[_0x6a96('0xaa')](loggerCatchQueueSummary(_0x6a96('0x166'),_0x3dfb46));}else{notSendMessagesCampaign(_0x3dfb46);}}}};function getCallerIdRandom(_0x307c30,_0x4ea497){var _0x21a956;var _0x335855;var _0x280525;if(_0x4ea497<=0x0){_0x4ea497=0x1;}_0x21a956=new RegExp(_0x6a96('0x167')+_0x4ea497+'}$');_0x335855=Math[_0x6a96('0x168')](0xa,_0x4ea497-0x1);_0x280525=Math[_0x6a96('0x168')](0xa,_0x4ea497)-0x1;return util[_0x6a96('0x75')]('%s',_[_0x6a96('0x169')](_0x307c30,_0x21a956,_['random'](_0x335855,_0x280525)));}function extractCalleridName(_0x5ac821){var _0x1b91b8=_0x5ac821[_0x6a96('0x16a')](/"(.*?)"/);return _0x1b91b8?_0x1b91b8[0x1]:_0x5ac821;}function extractCalleridNumber(_0x8c61c1){var _0x2f77f5=_0x8c61c1[_0x6a96('0x16a')](/<(.*?)>/);return _0x2f77f5?_0x2f77f5[0x1]:_0x8c61c1;}Dialer[_0x6a96('0x1a')]['actionOriginate']=function(_0xdeb969,_0x777e58){var _0x522073=this;var _0x26287f=uuid['v4']();this['actions'][_0x26287f]=new Action(_0xdeb969,_0x777e58,_0x26287f);return new BPromise(function(_0x41de9d,_0x15fd7e){if(_['isUndefined'](_0xdeb969)&&typeof _0xdeb969!==_0x6a96('0x16b')){return _0x15fd7e(msgResponse('originate',_0x6a96('0x142'),_0x6a96('0x16c')));}if(_[_0x6a96('0x82')](_0x777e58['Contact'][_0x6a96('0x16d')])||_0x777e58[_0x6a96('0x16e')][_0x6a96('0x16d')]===null){return _0x15fd7e(msgResponse(_0x6a96('0x16f'),_0x6a96('0x142'),_0x6a96('0x170')));}var _0x4d4207={'XMD-CALLERID':_0x522073[_0x6a96('0x24')][_0x26287f][_0x6a96('0x171')](),'XMD-AGI':_0xdeb969[_0x6a96('0x100')]?util[_0x6a96('0x75')](_0x6a96('0x172'),ipAgi,_0xdeb969[_0x6a96('0x100')]):'NONE','XMD-AGIAFTER':_0xdeb969[_0x6a96('0x107')]?util[_0x6a96('0x75')]('\x22agi://%s/square,%s\x22',ipAgi,_0xdeb969['dialQueueProject2']):_0x6a96('0x173'),'XMD-QUEUE':_0xdeb969[_0x6a96('0x59')]===_0x6a96('0x50')?util[_0x6a96('0x75')]('\x22%s,%s%s,,,%s\x22',_0xdeb969[_0x6a96('0x43')],_0xdeb969['dialQueueOptions']||'',_0xdeb969[_0x6a96('0x108')]?'c':'',_0xdeb969['dialQueueTimeout']||0x3):_0x6a96('0x173'),'XMD-CONTACTID':_0x777e58[_0x6a96('0xcb')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x522073[_0x6a96('0x24')][_0x26287f]['getCaller'](),'XMD-AMD':_0xdeb969[_0x6a96('0xd7')]?_0x6a96('0x174'):_0x6a96('0x173'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0xdeb969[_0x6a96('0xd7')]){_0x4d4207[_0x6a96('0x175')]=_0xdeb969[_0x6a96('0x176')]||0x9c4;_0x4d4207[_0x6a96('0x177')]=_0xdeb969[_0x6a96('0x178')]||0x5dc;_0x4d4207['XMD-AMDAFTERGREETINGSILENCE']=_0xdeb969[_0x6a96('0x179')]||0x320;_0x4d4207[_0x6a96('0x17a')]=_0xdeb969['dialAMDTotalAnalysisTime']||0x1388;_0x4d4207[_0x6a96('0x17b')]=_0xdeb969[_0x6a96('0x17c')]||0x64;_0x4d4207['XMD-AMDBETWEENWORDSSILENCE']=_0xdeb969[_0x6a96('0x17d')]||0x32;_0x4d4207[_0x6a96('0x17e')]=_0xdeb969[_0x6a96('0x17f')]||0x3;_0x4d4207['XMD-AMDSILENCETHRESHOLD']=_0xdeb969[_0x6a96('0x180')]||0x100;_0x4d4207['XMD-AMDMAXIMUMWORDLENGTH']=_0xdeb969[_0x6a96('0x181')]||0x1388;}if(_0xdeb969['type']==='outbound'){_0x4d4207['XMD-VOICEQUEUEID']=_0x777e58[_0x6a96('0xf5')];}else{_0x4d4207[_0x6a96('0x182')]=_0x777e58[_0x6a96('0xf6')];}for(var _0x2d4030 in _0x777e58[_0x6a96('0x16e')]){if(typeof _0x777e58[_0x6a96('0x16e')][_0x2d4030]!=='undefined'){if(isNotNull(_0x777e58[_0x6a96('0x16e')][_0x2d4030])&&_0x2d4030!=='id'&&_0x2d4030!==_0x6a96('0x183')&&_0x2d4030!==_0x6a96('0x184')&&_0x2d4030!==_0x6a96('0x185')){_0x4d4207[util[_0x6a96('0x75')](_0x6a96('0x186'),_0x6a96('0x187'),_[_0x6a96('0x188')](_0x2d4030))]=_0x777e58[_0x6a96('0x16e')][_0x2d4030];}}}var _0x3720c5=_0x522073['isTrunkReachable'](_0xdeb969[_0x6a96('0x73')])?getCallerId(_0xdeb969[_0x6a96('0x73')][_0x6a96('0x74')],_0xdeb969[_0x6a96('0x189')],_0xdeb969['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0xdeb969['dialOriginateCallerIdNumber'],_0xdeb969[_0x6a96('0x18a')]):_0xdeb969[_0x6a96('0x5e')]):getCallerId(_['isNil'](_0xdeb969[_0x6a96('0x13b')])?_0xdeb969['Trunk'][_0x6a96('0x74')]:_0xdeb969[_0x6a96('0x13b')][_0x6a96('0x74')],_0xdeb969[_0x6a96('0x189')],_0xdeb969[_0x6a96('0x18a')]>0x0?getCallerIdRandom(_0xdeb969[_0x6a96('0x5e')],_0xdeb969['dialRandomLastDigitCallerIdNumber']):_0xdeb969[_0x6a96('0x5e')]);if(_0x3720c5){_0x4d4207[_0x6a96('0x18b')]=_0x522073['actions'][_0x26287f][_0x6a96('0x18c')]=extractCalleridName(_0x3720c5);_0x4d4207[_0x6a96('0x18d')]=_0x522073[_0x6a96('0x24')][_0x26287f][_0x6a96('0x18e')]=extractCalleridNumber(_0x3720c5);}return ami[_0x6a96('0xa7')]({'actionid':_0x26287f,'action':_0x6a96('0x16f'),'channel':_0x522073[_0x6a96('0xce')](_0xdeb969['Trunk'])?util[_0x6a96('0x75')](_0x6a96('0x18f'),_0xdeb969['Trunk'][_0x6a96('0x43')],isNotNull(_0xdeb969[_0x6a96('0x5f')])?_0xdeb969[_0x6a96('0x5f')]['trim']()||'':'',_0xdeb969[_0x6a96('0x190')]>0x0?_0x777e58['Contact'][_0x6a96('0x16d')][_0x6a96('0x191')](_0xdeb969[_0x6a96('0x190')]):_0x777e58[_0x6a96('0x16e')][_0x6a96('0x16d')]):util[_0x6a96('0x75')](_0x6a96('0x18f'),_[_0x6a96('0xa6')](_0xdeb969[_0x6a96('0x13b')])?_0xdeb969[_0x6a96('0x73')][_0x6a96('0x43')]:_0xdeb969[_0x6a96('0x13b')]['name'],isNotNull(_0xdeb969[_0x6a96('0x5f')])?_0xdeb969[_0x6a96('0x5f')][_0x6a96('0x192')]()||'':'',_0xdeb969[_0x6a96('0x190')]>0x0?_0x777e58[_0x6a96('0x16e')][_0x6a96('0x16d')][_0x6a96('0x191')](_0xdeb969[_0x6a96('0x190')]):_0x777e58[_0x6a96('0x16e')][_0x6a96('0x16d')]),'callerid':_0x3720c5,'Exten':'xcally-motion-dialer','Context':_0x6a96('0x193'),'Priority':'1','variable':_0x4d4207,'timeout':(_0xdeb969[_0x6a96('0x194')]||0x1e)*0x3e8,'async':!![],'channelid':_0x26287f})[_0x6a96('0xb2')](function(_0x3e01b6){return _0x41de9d(_0x3e01b6);})['catch'](function(_0x3ff972){_0xdeb969[_0x6a96('0x195')]+=0x1;var _0x5098b4=new History(_0x522073[_0x6a96('0x24')][_0x26287f]);logger[_0x6a96('0x94')](util['format'](_0x6a96('0x196'),JSON['stringify'](_0x3ff972)));_0x5098b4[_0x6a96('0xa0')]=0xe;_0x5098b4['statedesc']=_0x6a96('0x197');_0x5098b4['starttime']=moment()[_0x6a96('0x75')](_0x6a96('0xf3'));_0x5098b4[_0x6a96('0xa2')]=_0x5098b4[_0x6a96('0x118')];_0x522073[_0x6a96('0xc4')](_0x5098b4)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x198')));_0x522073[_0x6a96('0xd2')](_0x5098b4)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x198')))[_0x6a96('0x1c')](function(){delete _0x522073[_0x6a96('0x24')][_0x26287f];return _0x15fd7e(msgResponse('originate',_0x6a96('0x4a'),_0x6a96('0x199')));});});});};Dialer[_0x6a96('0x1a')][_0x6a96('0x19a')]=function(_0x25166d){var _0x1b3ae3=this[_0x6a96('0x24')][_0x25166d[_0x6a96('0x11f')]];if(_0x1b3ae3){delete this[_0x6a96('0x24')][_0x25166d[_0x6a96('0x11f')]];_0x1b3ae3[_0x6a96('0x10f')]=moment()['format'](_0x6a96('0xf3'));var _0x19e608=_0x1b3ae3[_0x6a96('0x59')]==='ivr'?this[_0x6a96('0x20')][_0x1b3ae3[_0x6a96('0xad')]]:this[_0x6a96('0x1f')][_0x1b3ae3[_0x6a96('0x19b')]()];if(!this[_0x6a96('0x19c')](_0x25166d[_0x6a96('0x19d')])){this[_0x6a96('0xac')](_0x19e608);return this[_0x6a96('0x19e')](_0x1b3ae3,_0x19e608,_0x25166d)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x19f')));}this[_0x6a96('0x26')][_0x25166d['uniqueid']]=_0x1b3ae3;}};Dialer[_0x6a96('0x1a')][_0x6a96('0x1a0')]=function(_0x73f3c2,_0x4106a4,_0x25842a){var _0x1dcc12=new History(_0x4106a4);if(_0x1dcc12[_0x6a96('0xf9')]+_0x1dcc12[_0x6a96('0xe6')]+_0x1dcc12['countnoanswerretry']+_0x1dcc12[_0x6a96('0xe8')]+_0x1dcc12[_0x6a96('0xe9')]+_0x1dcc12[_0x6a96('0xea')]+_0x1dcc12[_0x6a96('0xe1')]+_0x1dcc12[_0x6a96('0xeb')]>=_0x25842a['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x73f3c2){case 0x3:if(_0x1dcc12['countnoanswerretry']>=_0x25842a['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x1dcc12[_0x6a96('0xe7')]+=0x1,'scheduledat':moment()[_0x6a96('0xfb')](_0x25842a[_0x6a96('0x1a1')],_0x6a96('0xf2'))[_0x6a96('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1dcc12[_0x6a96('0xcb')],'ListId':_0x1dcc12['ListId'],'VoiceQueueId':_0x1dcc12['VoiceQueueId']||undefined,'CampaignId':_0x1dcc12[_0x6a96('0xf6')]||undefined})[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x1a2')));break;case 0x5:if(_0x1dcc12[_0x6a96('0xf9')]>=_0x25842a['dialBusyMaxRetry']-0x1){return!![];}this[_0x6a96('0xf0')]({'active':![],'countbusyretry':_0x1dcc12['countbusyretry']+=0x1,'scheduledat':moment()[_0x6a96('0xfb')](_0x25842a[_0x6a96('0x1a3')],_0x6a96('0xf2'))[_0x6a96('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1dcc12[_0x6a96('0xcb')],'ListId':_0x1dcc12['ListId'],'VoiceQueueId':_0x1dcc12['VoiceQueueId']||undefined,'CampaignId':_0x1dcc12[_0x6a96('0xf6')]||undefined})[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x1a4')));break;case 0x8:if(_0x1dcc12[_0x6a96('0xe6')]>=_0x25842a[_0x6a96('0x1a5')]-0x1){return!![];}this[_0x6a96('0xf0')]({'active':![],'countcongestionretry':_0x1dcc12[_0x6a96('0xe6')]+=0x1,'scheduledat':moment()[_0x6a96('0xfb')](_0x25842a['dialCongestionRetryFrequency'],_0x6a96('0xf2'))[_0x6a96('0x75')](_0x6a96('0xf3')),'ContactId':_0x1dcc12[_0x6a96('0xcb')],'ListId':_0x1dcc12[_0x6a96('0xf4')],'VoiceQueueId':_0x1dcc12['VoiceQueueId']||undefined,'CampaignId':_0x1dcc12[_0x6a96('0xf6')]||undefined})[_0x6a96('0xaa')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x1dcc12['countnosuchnumberretry']>=_0x25842a[_0x6a96('0x1a6')]-0x1){return!![];}else{this[_0x6a96('0xf0')]({'active':![],'countnosuchnumberretry':_0x1dcc12[_0x6a96('0xe8')]+=0x1,'scheduledat':moment()[_0x6a96('0xfb')](_0x25842a['dialNoSuchNumberRetryFrequency'],_0x6a96('0xf2'))[_0x6a96('0x75')](_0x6a96('0xf3')),'ContactId':_0x1dcc12[_0x6a96('0xcb')],'ListId':_0x1dcc12[_0x6a96('0xf4')],'VoiceQueueId':_0x1dcc12[_0x6a96('0xf5')]||undefined,'CampaignId':_0x1dcc12[_0x6a96('0xf6')]||undefined})[_0x6a96('0xaa')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x1dcc12[_0x6a96('0xe9')]>=_0x25842a[_0x6a96('0x115')]-0x1){return!![];}this[_0x6a96('0xf0')]({'active':![],'countdropretry':_0x1dcc12['countdropretry']+=0x1,'scheduledat':moment()[_0x6a96('0xfb')](_0x25842a['dialDropRetryFrequency'],_0x6a96('0xf2'))[_0x6a96('0x75')](_0x6a96('0xf3')),'ContactId':_0x1dcc12[_0x6a96('0xcb')],'ListId':_0x1dcc12['ListId'],'VoiceQueueId':_0x1dcc12[_0x6a96('0xf5')]||undefined,'CampaignId':_0x1dcc12[_0x6a96('0xf6')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x1dcc12[_0x6a96('0xea')]>=_0x25842a[_0x6a96('0x11d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x1dcc12[_0x6a96('0xea')]+=0x1,'scheduledat':moment()[_0x6a96('0xfb')](_0x25842a[_0x6a96('0x11e')],_0x6a96('0xf2'))[_0x6a96('0x75')](_0x6a96('0xf3')),'ContactId':_0x1dcc12[_0x6a96('0xcb')],'ListId':_0x1dcc12[_0x6a96('0xf4')],'VoiceQueueId':_0x1dcc12[_0x6a96('0xf5')]||undefined,'CampaignId':_0x1dcc12[_0x6a96('0xf6')]||undefined})['catch'](loggerCatch(_0x6a96('0x1a7')));break;case 0x13:if(_0x1dcc12['countmachineretry']>=_0x25842a['dialMachineMaxRetry']-0x1){return!![];}this[_0x6a96('0xf0')]({'active':![],'countmachineretry':_0x1dcc12['countmachineretry']+=0x1,'scheduledat':moment()[_0x6a96('0xfb')](_0x25842a[_0x6a96('0xf1')],'minutes')[_0x6a96('0x75')](_0x6a96('0xf3')),'ContactId':_0x1dcc12[_0x6a96('0xcb')],'ListId':_0x1dcc12[_0x6a96('0xf4')],'VoiceQueueId':_0x1dcc12['VoiceQueueId']||undefined,'CampaignId':_0x1dcc12[_0x6a96('0xf6')]||undefined})['catch'](loggerCatch(_0x6a96('0xfc')));break;case 0x14:if(_0x1dcc12[_0x6a96('0xeb')]>=_0x25842a[_0x6a96('0x1a8')]-0x1){return!![];}this[_0x6a96('0xf0')]({'active':![],'countagentrejectretry':_0x1dcc12[_0x6a96('0xeb')]+=0x1,'scheduledat':moment()[_0x6a96('0xfb')](_0x25842a[_0x6a96('0x1a9')],_0x6a96('0xf2'))[_0x6a96('0x75')](_0x6a96('0xf3')),'ContactId':_0x1dcc12[_0x6a96('0xcb')],'ListId':_0x1dcc12[_0x6a96('0xf4')],'VoiceQueueId':_0x1dcc12[_0x6a96('0xf5')]||undefined,'CampaignId':_0x1dcc12[_0x6a96('0xf6')]||undefined})[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x1aa')));break;default:return!![];}};Dialer['prototype'][_0x6a96('0x19e')]=function(_0x267ff2,_0x36701c,_0x2c84c8){var _0x1ac8cc=this;var _0x58f5f2=new History(_0x267ff2);return new BPromise(function(_0x4b0766,_0x53826b){if(_['isUndefined'](_0x36701c)&&typeof _0x36701c!==_0x6a96('0x16b')){return _0x53826b(msgResponse(_0x6a96('0x1ab'),_0x6a96('0x142'),_0x6a96('0x1ac')));}if(_['isUndefined'](_0x2c84c8)&&typeof _0x2c84c8!==_0x6a96('0x16b')){return _0x53826b(msgResponse(_0x6a96('0x1ab'),'Failure',_0x6a96('0x1ad')));}switch(_0x2c84c8['reason']){case'0':_0x36701c[_0x6a96('0x65')]+=0x1;_0x58f5f2['state']=0x0;_0x58f5f2[_0x6a96('0xa1')]=_0x6a96('0x1ae');_0x58f5f2[_0x6a96('0xe8')]+=0x1;_0x58f5f2['countglobal']+=0x1;ami['emit'](_0x6a96('0x1af'),ut[_0x6a96('0xe4')](_0x267ff2,_0x6a96('0x1b0')));_0x1ac8cc[_0x6a96('0xc4')](_0x58f5f2)['catch'](loggerCatch(_0x6a96('0xe5')));if(_0x1ac8cc['checkRetriveMax'](0x0,_0x267ff2,_0x36701c)){if(_0x58f5f2[_0x6a96('0xe8')]>=_0x36701c[_0x6a96('0x1a6')]){_0x1ac8cc['createStateFinal'](_0x58f5f2,_0x4b0766,_0x53826b,'reason\x200\x20no\x20such\x20number....');}else{_0x1ac8cc[_0x6a96('0xfa')](_0x58f5f2,_0x4b0766,_0x53826b,_0x6a96('0x1b1'));}}break;case'3':_0x36701c[_0x6a96('0x64')]+=0x1;_0x58f5f2[_0x6a96('0xa0')]=0x3;_0x58f5f2[_0x6a96('0xa1')]=_0x6a96('0x1b2');_0x58f5f2[_0x6a96('0xe7')]+=0x1;_0x58f5f2[_0x6a96('0xe2')]+=0x1;ami[_0x6a96('0x4f')](_0x6a96('0x1b3'),ut[_0x6a96('0xe4')](_0x267ff2,'noanswer'));_0x1ac8cc[_0x6a96('0xc4')](_0x58f5f2)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x1b4')));if(_0x1ac8cc[_0x6a96('0x1a0')](0x3,_0x267ff2,_0x36701c)){if(_0x58f5f2['countnoanswerretry']>=_0x36701c[_0x6a96('0x1b5')]){_0x1ac8cc[_0x6a96('0x1b6')](_0x58f5f2,_0x4b0766,_0x53826b,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1ac8cc['stateGlobal'](_0x58f5f2,_0x4b0766,_0x53826b,_0x6a96('0x1b7'));}}break;case'5':_0x36701c['outboundBusyCallsDay']+=0x1;_0x58f5f2[_0x6a96('0xa0')]=0x5;_0x58f5f2[_0x6a96('0xa1')]=_0x6a96('0x1b8');_0x58f5f2['countbusyretry']+=0x1;_0x58f5f2[_0x6a96('0xe2')]+=0x1;ami[_0x6a96('0x4f')](_0x6a96('0x1b9'),ut[_0x6a96('0xe4')](_0x267ff2,_0x6a96('0x1ba')));_0x1ac8cc[_0x6a96('0xc4')](_0x58f5f2)['catch'](loggerCatch(_0x6a96('0x1bb')));if(_0x1ac8cc[_0x6a96('0x1a0')](0x5,_0x267ff2,_0x36701c)){if(_0x58f5f2['countbusyretry']>=_0x36701c[_0x6a96('0x1bc')]){_0x1ac8cc[_0x6a96('0x1b6')](_0x58f5f2,_0x4b0766,_0x53826b,_0x6a96('0x1bd'));}else{_0x1ac8cc['stateGlobal'](_0x58f5f2,_0x4b0766,_0x53826b,_0x6a96('0x1bd'));}}break;case'8':_0x36701c[_0x6a96('0x1be')]+=0x1;_0x58f5f2['state']=0x8;_0x58f5f2[_0x6a96('0xa1')]=_0x6a96('0x1bf');_0x58f5f2[_0x6a96('0xe6')]+=0x1;_0x58f5f2['countglobal']+=0x1;ami['emit'](_0x6a96('0x1c0'),ut['buildObj'](_0x267ff2,_0x6a96('0x1c1')));_0x1ac8cc[_0x6a96('0xc4')](_0x58f5f2)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x1c2')));if(_0x1ac8cc['checkRetriveMax'](0x8,_0x267ff2,_0x36701c)){if(_0x58f5f2[_0x6a96('0xe6')]>=_0x36701c['dialCongestionMaxRetry']){_0x1ac8cc[_0x6a96('0x1b6')](_0x58f5f2,_0x4b0766,_0x53826b,_0x6a96('0x1c3'));}else{_0x1ac8cc[_0x6a96('0xfa')](_0x58f5f2,_0x4b0766,_0x53826b,_0x6a96('0x1c3'));}}break;case'11':_0x36701c[_0x6a96('0x1c4')]+=0x1;_0x58f5f2[_0x6a96('0xa0')]=0xb;_0x58f5f2[_0x6a96('0xa1')]=_0x6a96('0x11b');_0x58f5f2[_0x6a96('0xea')]+=0x1;_0x58f5f2[_0x6a96('0xe2')]+=0x1;_0x1ac8cc['createHistory'](_0x58f5f2)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x1c5')));if(_0x1ac8cc['checkRetriveMax'](0xb,_0x267ff2,_0x36701c)){if(_0x58f5f2['countabandonedretry']>=_0x36701c['dialAbandonedMaxRetry']){_0x1ac8cc['createStateFinal'](_0x58f5f2,_0x4b0766,_0x53826b,_0x6a96('0x1c6'));}else{_0x1ac8cc[_0x6a96('0xfa')](_0x58f5f2,_0x4b0766,_0x53826b,_0x6a96('0x1c6'));}}break;case'20':_0x36701c['outboundRejectCallsDay']+=0x1;_0x58f5f2[_0x6a96('0xa0')]=0x14;_0x58f5f2[_0x6a96('0xa1')]=_0x6a96('0x1c7');_0x58f5f2[_0x6a96('0xeb')]+=0x1;_0x58f5f2['countglobal']+=0x1;ami[_0x6a96('0x4f')](_0x6a96('0x1c8'),ut['buildObj'](_0x267ff2,_0x6a96('0x1c9')));_0x1ac8cc[_0x6a96('0xc4')](_0x58f5f2)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x1ca')));if(_0x1ac8cc[_0x6a96('0x1a0')](0x14,_0x267ff2,_0x36701c)){if(_0x58f5f2[_0x6a96('0xeb')]>=_0x36701c['dialAgentRejectMaxRetry']){_0x1ac8cc['createStateFinal'](_0x58f5f2,_0x4b0766,_0x53826b,'reason\x2020\x20agentreject');}else{_0x1ac8cc[_0x6a96('0xfa')](_0x58f5f2,_0x4b0766,_0x53826b,_0x6a96('0x1cb'));}}break;default:_0x36701c['outboundUnknownCallsDay']+=0x1;_0x58f5f2['state']=0xc;_0x58f5f2[_0x6a96('0xa1')]=_0x2c84c8[_0x6a96('0x1cc')];_0x1ac8cc[_0x6a96('0xc4')](_0x58f5f2)[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x1cd')));if(_0x1ac8cc[_0x6a96('0x1a0')](_0x2c84c8[_0x6a96('0x1cc')],_0x267ff2,_0x36701c)){if(_0x58f5f2['countbusyretry']+_0x58f5f2['countcongestionretry']+_0x58f5f2[_0x6a96('0xe7')]+_0x58f5f2[_0x6a96('0xe8')]+_0x58f5f2[_0x6a96('0xe9')]+_0x58f5f2[_0x6a96('0xea')]+_0x58f5f2[_0x6a96('0xe1')]+_0x58f5f2[_0x6a96('0xeb')]>=_0x36701c[_0x6a96('0xec')]){_0x1ac8cc[_0x6a96('0xfa')](_0x58f5f2,_0x4b0766,_0x53826b,_0x2c84c8[_0x6a96('0x1cc')]);}else{_0x1ac8cc[_0x6a96('0x1b6')](_0x58f5f2,_0x4b0766,_0x53826b,_0x2c84c8[_0x6a96('0x1cc')]);}}}});};Dialer[_0x6a96('0x1a')][_0x6a96('0xfa')]=function(_0x555d4f,_0x3e1508,_0x314705,_0x21290d){var _0x1a8e66=new Final(_0x555d4f);_0x1a8e66['state']=0xf;_0x1a8e66['statedesc']='Global';this['createStateFinal'](_0x1a8e66,_0x3e1508,_0x314705,_0x21290d);};Dialer[_0x6a96('0x1a')][_0x6a96('0x1b6')]=function(_0x3f551d,_0x4f171c,_0x5f51f4,_0x3d8db6){this[_0x6a96('0xd2')](_0x3f551d)[_0x6a96('0xb2')](function(){return _0x4f171c(msgResponse('[callProgressDetecting]',_0x6a96('0x1ce'),_0x3d8db6));})[_0x6a96('0xaa')](function(){return _0x5f51f4(msgResponse(_0x6a96('0x1cf'),_0x6a96('0x142'),_0x6a96('0x1d0')));});};Dialer['prototype'][_0x6a96('0xa')]=function(_0x4a1d93){var _0x420e60=_0x4a1d93['dialPredictiveOptimizationPercentage']/0x64;var _0x5b1a1b=_0x4a1d93[_0x6a96('0x63')]/(_0x4a1d93[_0x6a96('0x63')]+_0x4a1d93[_0x6a96('0xda')]);var _0x45ac9a=Math[_0x6a96('0x1d1')](_0x4a1d93[_0x6a96('0x6e')]*(_0x4a1d93[_0x6a96('0x1d2')]/0x64));var _0x3c8dbd=Math[_0x6a96('0x1d1')](_0x4a1d93[_0x6a96('0x6e')]*(_0x4a1d93['predictiveIntervalMinThreshold']/0x64));var _0x434c54=_0x4a1d93[_0x6a96('0x52')]+_0x4a1d93[_0x6a96('0x57')];var _0x25b283=Math[_0x6a96('0x1d3')](_0x4a1d93[_0x6a96('0x88')]*_0x4a1d93[_0x6a96('0x8c')]*_0x4a1d93[_0x6a96('0x1d4')]*_0x4a1d93[_0x6a96('0x6d')]);if(_[_0x6a96('0x82')](_0x4a1d93[_0x6a96('0x8e')])){if(!_[_0x6a96('0x82')](_0x4a1d93[_0x6a96('0x72')])){_0x4a1d93[_0x6a96('0x72')]=undefined;loggerPredictive[_0x6a96('0x94')](_0x6a96('0x1d5'),_0x6a96('0x1d6'));}if(!_[_0x6a96('0x82')](_0x4a1d93[_0x6a96('0x90')])){loggerPredictive['error'](_0x6a96('0x1d5'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4a1d93['handlePredictive']);_0x4a1d93['handlePredictive']=undefined;}_0x4a1d93[_0x6a96('0x8e')]=moment()['format'](_0x6a96('0xf3'));loggerPredictive[_0x6a96('0x79')](_0x4a1d93[_0x6a96('0x43')],'collection\x20data\x20in\x20progressive\x20at',_0x4a1d93[_0x6a96('0x8e')]);this[_0x6a96('0x154')](_0x4a1d93,0x1);}else if(ifInterval(_0x4a1d93[_0x6a96('0x1d7')],_0x4a1d93['startProgressive'])){this[_0x6a96('0x154')](_0x4a1d93,0x1);loggerPredictiveCalls[_0x6a96('0x79')](_0x6a96('0x1d8'),_0x4a1d93[_0x6a96('0x8e')],_0x4a1d93['name']);_0x4a1d93['erlangCalls']=0x0;_0x4a1d93[_0x6a96('0x6c')]=0x0;}else if(_0x420e60<_0x5b1a1b&&_0x4a1d93[_0x6a96('0x1d9')]===_0x6a96('0x1da')){freeVariablesPredictive(_0x4a1d93);loggerPredictive[_0x6a96('0x79')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x6a96('0x1db'),_0x5b1a1b,_0x6a96('0x8e'),_0x4a1d93[_0x6a96('0x43')]);}else if(_0x25b283<_0x4a1d93[_0x6a96('0x6c')]&&_0x4a1d93[_0x6a96('0x1d9')]===_0x6a96('0x1da')){freeVariablesPredictive(_0x4a1d93);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x1dc'),_0x6a96('0x1dd'),_0x25b283,_0x6a96('0x1de'),_0x4a1d93[_0x6a96('0x6c')],_0x6a96('0x8e'),_0x4a1d93[_0x6a96('0x43')]);}else if(!ifInterval(_0x4a1d93[_0x6a96('0x1d7')],_0x4a1d93['startProgressive'])&&_['isUndefined'](_0x4a1d93[_0x6a96('0x72')])&&!_['isUndefined'](_0x4a1d93[_0x6a96('0x8e')])){_0x4a1d93[_0x6a96('0x72')]=moment()[_0x6a96('0x75')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x6a96('0x79')](_0x4a1d93['name'],_0x6a96('0x1df'),_0x4a1d93[_0x6a96('0x72')]);this[_0x6a96('0xb7')](_0x4a1d93[_0x6a96('0x1d7')])['then'](this[_0x6a96('0x1e0')](_0x4a1d93))['then'](mergeDataErlangB(_0x4a1d93))[_0x6a96('0xb2')](this[_0x6a96('0x1e1')](_0x4a1d93))[_0x6a96('0xaa')](loggerCatchPredictive(_0x6a96('0x1e2'),_0x4a1d93));}else if(!ifInterval(_0x4a1d93[_0x6a96('0x1d7')],_0x4a1d93[_0x6a96('0x72')])){_0x4a1d93[_0x6a96('0x6c')]=0x0;_0x4a1d93[_0x6a96('0x72')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x4a1d93[_0x6a96('0x43')],'recalculate\x20predictive\x20at',_0x4a1d93['startPredictive']);clearInterval(_0x4a1d93[_0x6a96('0x90')]);_0x4a1d93[_0x6a96('0x90')]=undefined;this[_0x6a96('0xb7')](_0x4a1d93[_0x6a96('0x1d7')])[_0x6a96('0xb2')](this[_0x6a96('0x1e0')](_0x4a1d93))[_0x6a96('0xb2')](mergeDataErlangB(_0x4a1d93))['then'](this['startMethodPredictive'](_0x4a1d93))[_0x6a96('0xaa')](loggerCatchPredictive(_0x6a96('0x1e3'),_0x4a1d93));}else if(_0x4a1d93['predictiveIntervalAvailable']&&_0x434c54<_0x4a1d93[_0x6a96('0x6e')]-_0x3c8dbd){freeVariablesPredictive(_0x4a1d93);loggerPredictive[_0x6a96('0x79')](_0x4a1d93[_0x6a96('0x43')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x434c54,')\x20are\x20less\x20than\x20threshold\x20(',_0x4a1d93[_0x6a96('0x6e')],'-',_0x3c8dbd,'=',_0x4a1d93[_0x6a96('0x6e')]-_0x3c8dbd,')');}else if(_0x4a1d93[_0x6a96('0x6e')]&&_0x434c54>_0x4a1d93[_0x6a96('0x6e')]+_0x45ac9a){freeVariablesPredictive(_0x4a1d93);loggerPredictive[_0x6a96('0x79')](_0x4a1d93[_0x6a96('0x43')],_0x6a96('0x1e4'),_0x434c54,_0x6a96('0x1e5'),_0x4a1d93['predictiveIntervalAvailable'],'+',_0x45ac9a,'=',_0x4a1d93[_0x6a96('0x6e')]+_0x45ac9a,')');}};Dialer[_0x6a96('0x1a')][_0x6a96('0x1e0')]=function(_0x43013b){var _0x1a4746=this;return function(_0x57dd9d){return new BPromise(function(_0x1b9cf0,_0x56fd45){_[_0x6a96('0x124')](_0x43013b,_0x57dd9d[0x0]);if(checkGetDataPredictive(_0x57dd9d[0x0])){var _0xf6a321=_0x43013b[_0x6a96('0x6e')]=_0x43013b[_0x6a96('0x57')]+_0x43013b[_0x6a96('0x52')];var _0x534a1c=_0x43013b['dialPredictiveInterval']*0x3c;var _0x286776=_0x57dd9d[0x0][_0x6a96('0x81')]+_0x57dd9d[0x0][_0x6a96('0x69')];var _0x25e99a=(_0x57dd9d[0x0]['predictiveIntervalAnsweredCalls']+_0x57dd9d[0x0][_0x6a96('0x111')]+_0x57dd9d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x57dd9d[0x0]['predictiveIntervalTotalCalls'];_0x43013b[_0x6a96('0x1d4')]=_0x25e99a>0x0?_0x25e99a:0x1;switch(_0x43013b['dialPredictiveOptimization']){case _0x6a96('0x1da'):var _0x12f9a6=_0x43013b['dialPredictiveOptimizationPercentage']/0x64;return _0x1a4746[_0x6a96('0x1e6')](_0xf6a321,_0x534a1c,_0x286776,_0x25e99a,_0x12f9a6)[_0x6a96('0xb2')](function(_0x3794db){return _0x1b9cf0(_0x3794db);});case'agentBusyFactor':var _0x3f47c6=_0x43013b[_0x6a96('0x1e7')]/0x64;return _0x1a4746['busyFactor'](_0xf6a321,_0x534a1c,_0x286776,_0x25e99a,_0x3f47c6)['then'](function(_0x182cde){return _0x1b9cf0(_0x182cde);});default:return _0x56fd45(msgResponse(_0x6a96('0x1e8'),_0x6a96('0x142'),'Unknown\x20Predictive'));}}else{return _0x56fd45(msgResponse(_0x6a96('0x1e8'),_0x6a96('0x142'),_0x6a96('0x1e9')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x30f09e){var _0x386b5f=this;return function(_0x46e29b){return new BPromise(function(_0x4722ce,_0x472f70){_[_0x6a96('0x124')](_0x30f09e,_0x46e29b[0x0]);if(checkGetDataPredictive(_0x46e29b[0x0])){loggerPredictive[_0x6a96('0x79')](JSON['stringify'](_0x46e29b[0x0]));if(_0x30f09e[_0x6a96('0x1d9')]===_0x6a96('0x1da')){return _0x386b5f[_0x6a96('0xc1')](_0x30f09e['id'])[_0x6a96('0xb2')](function(_0x3c73bd){var _0x531ddd=_0x30f09e[_0x6a96('0x53')]-_0x3c73bd[0x0][_0x6a96('0x1ea')];var _0x4b8093=_0x30f09e[_0x6a96('0x1d7')]*0x3c;var _0x2d5453=_0x46e29b[0x0][_0x6a96('0x81')]+_0x46e29b[0x0][_0x6a96('0x69')];var _0x43fc25=(_0x46e29b[0x0][_0x6a96('0x7c')]+_0x46e29b[0x0][_0x6a96('0x111')]+_0x46e29b[0x0][_0x6a96('0x6a')])/_0x46e29b[0x0][_0x6a96('0x6f')];var _0x170ed8=_0x30f09e[_0x6a96('0x1e7')]/0x64;_0x30f09e[_0x6a96('0x1eb')]=_0x3c73bd[0x0]['outboundQueuePauses']||0x0;_0x30f09e[_0x6a96('0x1d4')]=_0x43fc25>0x0?_0x43fc25:0x1;return _0x386b5f[_0x6a96('0x1e6')](_0x531ddd,_0x4b8093,_0x2d5453,_0x43fc25,_0x170ed8);})['then'](function(_0x2ead39){return _0x4722ce(_0x2ead39);})[_0x6a96('0xaa')](function(_0x5478f0){return _0x472f70(msgResponse(_0x6a96('0x1ec'),_0x6a96('0x142'),JSON[_0x6a96('0x4b')](_0x5478f0)));});}if(_0x30f09e[_0x6a96('0x1d9')]===_0x6a96('0x1ed')){return _0x386b5f[_0x6a96('0xc1')](_0x30f09e['id'])[_0x6a96('0xb2')](function(_0xa3830b){var _0x514859=_0x30f09e[_0x6a96('0x53')]-_0xa3830b[0x0][_0x6a96('0x1ea')];var _0xe68b1d=_0x30f09e[_0x6a96('0x1d7')]*0x3c;var _0x3bbea5=_0x46e29b[0x0][_0x6a96('0x81')]+_0x46e29b[0x0][_0x6a96('0x69')];var _0xc15e60=(_0x46e29b[0x0]['predictiveIntervalAnsweredCalls']+_0x46e29b[0x0][_0x6a96('0x111')]+_0x46e29b[0x0][_0x6a96('0x6a')])/_0x46e29b[0x0][_0x6a96('0x6f')];var _0x7b065a=_0x30f09e['dialPredictiveOptimizationPercentage']/0x64;_0x30f09e[_0x6a96('0x1eb')]=_0xa3830b[0x0]['outboundQueuePauses']||0x0;_0x30f09e['predictiveIntervalHitRate']=_0xc15e60>0x0?_0xc15e60:0x1;return _0x386b5f[_0x6a96('0x1ee')](_0x514859,_0xe68b1d,_0x3bbea5,_0xc15e60,_0x7b065a);})['then'](function(_0x247bf3){return _0x4722ce(_0x247bf3);})['catch'](function(_0x9ee353){return _0x472f70(msgResponse(_0x6a96('0x1ec'),'Failure',JSON['stringify'](_0x9ee353)));});}}else{return _0x472f70(msgResponse(_0x6a96('0x1e8'),_0x6a96('0x142'),_0x6a96('0x1e9')));}});};};Dialer[_0x6a96('0x1a')][_0x6a96('0x1e1')]=function(_0x48bd68){var _0x447359=this;return function(){var _0xac21e6=0x0;var _0x35e0ff=Math[_0x6a96('0x1d3')](_0x48bd68[_0x6a96('0x71')]*0x3e8);if(_0x35e0ff>0x0){_0x35e0ff=_0x35e0ff<0x64?0x64:_0x35e0ff;loggerPredictive[_0x6a96('0x79')](_0x48bd68[_0x6a96('0x43')],_0x6a96('0x1ef'),_0x35e0ff,_0x6a96('0x4c'));_0x48bd68[_0x6a96('0x90')]=setInterval(function(){_0x447359[_0x6a96('0x90')](_0x48bd68);loggerPredictiveCalls[_0x6a96('0x79')](_0x6a96('0x1f0'),_0xac21e6+=0x1);},_0x35e0ff);}else{loggerPredictive[_0x6a96('0x79')](_0x48bd68[_0x6a96('0x43')],_0x6a96('0x1f1'));}};};Dialer[_0x6a96('0x1a')][_0x6a96('0x1f2')]=function(_0x2ac0c5,_0x385c59){var _0x4646d9=this;return function(_0x50562f){if(_[_0x6a96('0x48')](_0x50562f)){if(_[_0x6a96('0xa6')](_0x385c59[_0x6a96('0x1f3')])||!_0x385c59[_0x6a96('0x1f4')]){if(_0x2ac0c5[_0x6a96('0x152')]===_0x6a96('0x9')){_0x2ac0c5[_0x6a96('0x126')]=_[_0x6a96('0x82')](_0x2ac0c5[_0x6a96('0x126')])?!![]:_0x2ac0c5['queueStatusComplete'];var _0x1da1a1=uuid['v4']();_0x4646d9[_0x6a96('0x24')][_0x1da1a1]=new Action(_0x2ac0c5,_0x385c59,_0x1da1a1);loggerBooked['info'](_0x6a96('0x1f5'),_0x1da1a1,'queueStatusComplete:\x20',JSON['stringify'](_0x2ac0c5['queueStatusComplete']),_0x6a96('0x1f6'),_0x2ac0c5['name']);if(_0x2ac0c5[_0x6a96('0x126')]){_0x2ac0c5[_0x6a96('0x126')]=![];_0x4646d9[_0x6a96('0x29')][_0x4646d9[_0x6a96('0x24')][_0x1da1a1][_0x6a96('0xad')]]=[];ami['Action']({'actionid':_0x1da1a1,'action':_0x6a96('0x1f7'),'queue':_0x2ac0c5[_0x6a96('0x43')]})[_0x6a96('0xaa')](function(){_0x4646d9['updateOriginated'](_0x2ac0c5);_0x4646d9[_0x6a96('0xf0')]({'active':![],'ContactId':_0x4646d9['actions'][_0x1da1a1][_0x6a96('0xcb')],'ListId':_0x4646d9[_0x6a96('0x24')][_0x1da1a1][_0x6a96('0xf4')],'VoiceQueueId':_0x4646d9['actions'][_0x1da1a1][_0x6a96('0xf5')]||undefined,'CampaignId':_0x4646d9[_0x6a96('0x24')][_0x1da1a1][_0x6a96('0xf6')]||undefined})[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x1f8')));delete _0x4646d9[_0x6a96('0x24')][_0x1da1a1];});}else{loggerBooked[_0x6a96('0x79')]('[booked][checkContactBlack][else]',JSON[_0x6a96('0x4b')](_0x2ac0c5[_0x6a96('0x126')]),'Queue:\x20',_0x2ac0c5[_0x6a96('0x43')]);_0x4646d9['updateOriginated'](_0x2ac0c5);_0x4646d9[_0x6a96('0xf0')]({'active':![],'ContactId':_0x4646d9[_0x6a96('0x24')][_0x1da1a1][_0x6a96('0xcb')],'ListId':_0x4646d9[_0x6a96('0x24')][_0x1da1a1][_0x6a96('0xf4')],'VoiceQueueId':_0x4646d9[_0x6a96('0x24')][_0x1da1a1]['VoiceQueueId']||undefined,'CampaignId':_0x4646d9[_0x6a96('0x24')][_0x1da1a1][_0x6a96('0xf6')]||undefined})[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x1f8')));delete _0x4646d9[_0x6a96('0x24')][_0x1da1a1];}}else{return _0x4646d9[_0x6a96('0x1f9')](_0x2ac0c5,_0x385c59);}}else{if(getDiff(_0x385c59[_0x6a96('0x1fa')])<_0x2ac0c5[_0x6a96('0x1fb')]*0x3c){if(_0x385c59[_0x6a96('0x1fc')]&&!_0x385c59['Agent'][_0x6a96('0x1fd')]){_0x4646d9['preview'][_0x6a96('0x12a')](_0x385c59['id'])[_0x6a96('0x1c')](function(){_0x4646d9[_0x6a96('0xac')](_0x2ac0c5);});}else{_0x4646d9[_0x6a96('0xbb')]({'active':![]},_0x385c59['id'],0x1)[_0x6a96('0x1c')](function(){_0x4646d9[_0x6a96('0xac')](_0x2ac0c5);});}}else{_0x2ac0c5[_0x6a96('0x66')]+=0x1;_0x4646d9[_0x6a96('0xac')](_0x2ac0c5);if(_0x2ac0c5[_0x6a96('0x1fe')]){_0x4646d9[_0x6a96('0xf0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x385c59[_0x6a96('0xcb')],'ListId':_0x385c59['ListId'],'VoiceQueueId':_0x385c59[_0x6a96('0xf5')]||undefined,'CampaignId':_0x385c59[_0x6a96('0xf6')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x4646d9['createHistory'](createObjHistory(_0x2ac0c5,_0x385c59,_0x6a96('0x1ff'),0x17,_0x6a96('0x200')))['catch'](loggerCatch(_0x6a96('0x201')));}else{_0x4646d9[_0x6a96('0xca')](createObjHistory(_0x2ac0c5,_0x385c59,_0x6a96('0x202'),0x16,'RecallFailedTimeout'),_0x6a96('0x203'),_0x6a96('0x204'));}}}}else{_0x2ac0c5[_0x6a96('0x61')]+=0x1;_0x4646d9[_0x6a96('0xca')](createObjHistory(_0x2ac0c5,_0x385c59,'BLACKLIST',0xd,_0x6a96('0x205')),_0x6a96('0x206'),'[Originate][MoveBlacklist]');throw _0x6a96('0x207');}};};Dialer[_0x6a96('0x1a')]['handleIvr']=function(_0xb7f4db){var _0x4fd454=this;var _0x4440ca=_0xb7f4db[_0x6a96('0x208')]-_0xb7f4db['originated']-_0xb7f4db[_0x6a96('0xbe')];emitCampaignSummary(_0xb7f4db);if(_0x4440ca>0x0){if(_0x4440ca>this[_0x6a96('0x23')]){_0x4440ca=this['maxNumberOriginate'];}_0xb7f4db[_0x6a96('0xbe')]+=_0x4440ca;this[_0x6a96('0xc0')](_0xb7f4db['id'],_0x4440ca,_0xb7f4db[_0x6a96('0x209')],_0xb7f4db)[_0x6a96('0xb2')](function(_0x52904d){_0xb7f4db[_0x6a96('0xbe')]-=_0x4440ca;_0xb7f4db[_0x6a96('0xbe')]=_0xb7f4db[_0x6a96('0xbe')]>0x0?_0xb7f4db['temp']:0x0;if(!checkContactEmpty(_0x52904d)){_0xb7f4db['message']=_0x6a96('0x9c');logger[_0x6a96('0x79')](_0x6a96('0x20a')+_0xb7f4db[_0x6a96('0x43')]);}else{_0xb7f4db[_0x6a96('0x70')]+=_0x52904d['length'];_0xb7f4db[_0x6a96('0x41')]=_0x6a96('0x20b');for(var _0x2ceec4=0x0;_0x2ceec4<_0x52904d[_0x6a96('0x96')];_0x2ceec4+=0x1){_0xb7f4db[_0x6a96('0x20c')]+=0x1;if(_['isNil'](_0x52904d[_0x2ceec4])||_['isNil'](_0x52904d[_0x2ceec4][_0x6a96('0x16e')])||_[_0x6a96('0xa6')](_0x52904d[_0x2ceec4][_0x6a96('0x16e')][_0x6a96('0x16d')])){_0x4fd454[_0x6a96('0xc8')](_0x6a96('0x20d'),_0xb7f4db,_0x52904d[_0x2ceec4]);}else{_0x4fd454['checkIsBlackListIvr'](_['pick'](_0x52904d[_0x2ceec4],['CampaignId',_0x6a96('0x20e')]))[_0x6a96('0xb2')](_0x4fd454['checkContactBlack'](_0xb7f4db,_0x52904d[_0x2ceec4]))[_0x6a96('0xaa')](_0x4fd454[_0x6a96('0xc7')]('[actionOriginateIvr]\x20',_0xb7f4db));}}}})[_0x6a96('0xaa')](loggerGetContactDialer(_0x6a96('0x20f'),_0xb7f4db,_0x4440ca));}};Dialer[_0x6a96('0x1a')][_0x6a96('0x154')]=function(_0x447c1d,_0x3b1181){var _0x3cd5d8=this;var _0x1ab5a=[];var _0x95d5d0=_0x3b1181>=0x1?_0x3b1181:0x1;if(_0x447c1d[_0x6a96('0x152')]===_0x6a96('0x9')){_0x95d5d0=0x1;}var _0x3929bb=Math['floor'](_0x447c1d[_0x6a96('0x52')]*_0x95d5d0)-_0x447c1d['originated']-_0x447c1d[_0x6a96('0xbe')];emitVoiceQueueSummary(_0x447c1d);if(_0x447c1d[_0x6a96('0x210')]>0x0){var _0x3d424a=_0x447c1d['dialLimitQueue']-_0x447c1d['originated']-_0x447c1d[_0x6a96('0x57')]-_0x447c1d[_0x6a96('0xbe')]-_0x447c1d['pTalking'];if(_0x3929bb>_0x3d424a){_0x3929bb=_0x3d424a;}}if(_0x3929bb>0x0){if(_0x447c1d['dialMethod']==='booked'){_0x3929bb=0x1;}if(_0x3929bb>this[_0x6a96('0x23')]){_0x3929bb=this[_0x6a96('0x23')];}_0x447c1d[_0x6a96('0xbe')]+=_0x3929bb;for(var _0x140280 in this[_0x6a96('0x21')]){if(typeof this[_0x6a96('0x21')][_0x140280]!=='undefined'){if(this[_0x6a96('0x21')][_0x140280][_0x6a96('0xa0')]===_0x6a96('0x211')&&this[_0x6a96('0x21')][_0x140280][_0x6a96('0xa8')]==='reachable'){_0x1ab5a[_0x6a96('0x212')](this[_0x6a96('0x21')][_0x140280]['id']);}}}this[_0x6a96('0xbd')](_0x447c1d['id'],_0x1ab5a,_0x3929bb,_0x447c1d[_0x6a96('0x209')],_0x447c1d)[_0x6a96('0xb2')](function(_0x491415){_0x447c1d['temp']-=_0x3929bb;_0x447c1d[_0x6a96('0xbe')]=_0x447c1d[_0x6a96('0xbe')]>0x0?_0x447c1d[_0x6a96('0xbe')]:0x0;if(!checkContactEmpty(_0x491415)){_0x3cd5d8[_0x6a96('0xb0')](_0x447c1d)[_0x6a96('0xb2')](sendMessageReschedule(_0x447c1d))['catch'](loggerCatch(_0x6a96('0x213')));}else{_0x447c1d['originated']+=_0x491415['length'];_0x447c1d['message']=_0x447c1d[_0x6a96('0x152')]===_0x6a96('0x9')?'ACTIVE':'RUNNING';for(var _0x556f04=0x0;_0x556f04<_0x491415['length'];_0x556f04+=0x1){if(_[_0x6a96('0xa6')](_0x491415[_0x556f04])||_[_0x6a96('0xa6')](_0x491415[_0x556f04][_0x6a96('0x16e')])||_['isNil'](_0x491415[_0x556f04][_0x6a96('0x16e')][_0x6a96('0x16d')])){_0x3cd5d8[_0x6a96('0xc8')](_0x6a96('0x20d'),_0x447c1d,_0x491415[_0x556f04]);}else{_0x3cd5d8[_0x6a96('0xb3')](_[_0x6a96('0x129')](_0x491415[_0x556f04],[_0x6a96('0xf5'),_0x6a96('0x20e')]))[_0x6a96('0xb2')](_0x3cd5d8[_0x6a96('0x1f2')](_0x447c1d,_0x491415[_0x556f04]))[_0x6a96('0xaa')](_0x3cd5d8['loggerHandler'](_0x6a96('0x20d'),_0x447c1d));}}}})[_0x6a96('0xaa')](loggerGetContactDialer(_0x6a96('0x214'),_0x447c1d,_0x3929bb));}};Dialer[_0x6a96('0x1a')][_0x6a96('0x90')]=function(_0x2523a4){if(_0x2523a4['dialLimitQueue']>0x0){var _0x121448=_0x2523a4['dialLimitQueue']-_0x2523a4['originated']-_0x2523a4[_0x6a96('0x57')];if(_0x121448>0x0){this['tryOriginatePredictive'](_0x2523a4);}else{loggerPredictiveCalls[_0x6a96('0x79')](_0x6a96('0x215'));}}else{this[_0x6a96('0x216')](_0x2523a4);}};Dialer[_0x6a96('0x1a')][_0x6a96('0x216')]=function(_0x43e336){var _0x32adfb=this;var _0x2300d5=[];_0x43e336['originated']+=0x1;for(var _0x39f8c6 in this[_0x6a96('0x21')]){if(typeof this['agents'][_0x39f8c6]!=='undefined'){if(this['agents'][_0x39f8c6][_0x6a96('0xa0')]===_0x6a96('0x211')&&this[_0x6a96('0x21')][_0x39f8c6]['status']==='reachable'){_0x2300d5[_0x6a96('0x212')](this[_0x6a96('0x21')][_0x39f8c6]['id']);}}}this[_0x6a96('0xbd')](_0x43e336['id'],_0x2300d5,0x1,_0x43e336[_0x6a96('0x209')],_0x43e336)['then'](function(_0x526f2d){if(!checkContactEmpty(_0x526f2d)){checkContactLowerLimitOriginate(_0x43e336,0x1,0x0);_0x32adfb['countReScheduled'](_0x43e336)[_0x6a96('0xb2')](sendMessageReschedule(_0x43e336))[_0x6a96('0xaa')](loggerCatch(_0x6a96('0x213')));}else{_0x43e336[_0x6a96('0x41')]=_0x6a96('0x20b');if(_['isNil'](_0x526f2d[0x0])||_[_0x6a96('0xa6')](_0x526f2d[0x0]['Contact'])||_['isNil'](_0x526f2d[0x0]['Contact'][_0x6a96('0x16d')])){_0x32adfb[_0x6a96('0xc8')](_0x6a96('0x20d'),_0x43e336,_0x526f2d[0x0]);}else{_0x32adfb['checkIsBlackList'](_[_0x6a96('0x129')](_0x526f2d[0x0],['VoiceQueueId',_0x6a96('0x20e')]))[_0x6a96('0xb2')](_0x32adfb[_0x6a96('0x1f2')](_0x43e336,_0x526f2d[0x0]))['catch'](_0x32adfb[_0x6a96('0xc7')](_0x6a96('0x217'),_0x43e336));}}})[_0x6a96('0xaa')](loggerGetContactDialer(_0x6a96('0x218'),_0x43e336,0x1));emitVoiceQueueSummary(_0x43e336);};Dialer[_0x6a96('0x1a')]['abandonmentRate']=function(_0xe90930,_0x46b974,_0x4e0cc7,_0x896b69,_0x5dd1aa,_0x5e6340){loggerPredictive[_0x6a96('0x79')](_0x6a96('0x219'));loggerPredictive[_0x6a96('0x79')](_0x6a96('0x21a'),_0xe90930);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x21b'),_0x46b974);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x21c'),_0x4e0cc7);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x21d'),_0x896b69);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x21e'),_0x5dd1aa);loggerPredictive[_0x6a96('0x79')]('---------------------------');return new BPromise(function(_0x5ce4ef,_0x25c254){if(_0xe90930<=0x0||isNaN(_0xe90930)){return _0x25c254(msgResponse(_0x6a96('0x21f'),_0x6a96('0x4a'),_0x6a96('0x220')+_0xe90930));}if(_0x4e0cc7<=0x0||isNaN(_0x4e0cc7)){return _0x25c254(msgResponse(_0x6a96('0x21f'),_0x6a96('0x4a'),_0x6a96('0x221')+_0x4e0cc7));}if(_0x896b69<=0x0||isNaN(_0x896b69)){return _0x25c254(msgResponse(_0x6a96('0x21f'),'Error',_0x6a96('0x222')+_0x896b69));}if(_0x46b974<=0x0||isNaN(_0x46b974)){return _0x25c254(msgResponse(_0x6a96('0x21f'),_0x6a96('0x4a'),_0x6a96('0x223')+_0x46b974));}if(_0x5dd1aa<=0x0||isNaN(_0x5dd1aa)){return _0x25c254(msgResponse(_0x6a96('0x21f'),_0x6a96('0x4a'),_0x6a96('0x224')+_0x5dd1aa));}_0x5e6340=_0x5e6340||0x0;var _0x4fbb83=0x1/_0x4e0cc7;var _0x2adca5=0x0;var _0x3604dd=0x0;var _0x1dd1db=0x0;var _0xf87088=0x0;for(var _0x30e6f4=0x0;_0x1dd1db<_0x5dd1aa;_0x30e6f4+=0x1){_0x3604dd=_0x30e6f4/_0x46b974;_0x2adca5=(_0x896b69*_0x3604dd+_0x5e6340)/_0x4fbb83;_0x1dd1db=erlangb(_0x2adca5,_0xe90930);_0xf87088=_0x2adca5/_0xe90930*(0x1-erlangb(_0x2adca5,_0xe90930));}return _0x5ce4ef({'erlangCalls':_0x30e6f4,'erlangCallToSecond':_0x46b974/_0x30e6f4,'erlangAbandonmentRate':_0x1dd1db,'erlangBusyFactor':_0xf87088});});};Dialer[_0x6a96('0x1a')][_0x6a96('0x1ee')]=function(_0x54a528,_0x3266ed,_0x3b29e3,_0x1976a4,_0x3e2f1e,_0x1659ee){loggerPredictive[_0x6a96('0x79')](_0x6a96('0x225'));loggerPredictive[_0x6a96('0x79')](_0x6a96('0x21a'),_0x54a528);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x21b'),_0x3266ed);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x21c'),_0x3b29e3);loggerPredictive[_0x6a96('0x79')](_0x6a96('0x21d'),_0x1976a4);loggerPredictive['info'](_0x6a96('0x226'),_0x3e2f1e);loggerPredictive['info'](_0x6a96('0x8d'));return new BPromise(function(_0x574698,_0x3e623b){if(_0x54a528<=0x0||isNaN(_0x54a528)){return _0x3e623b(msgResponse(_0x6a96('0x227'),'Error',_0x6a96('0x220')+_0x54a528));}if(_0x3b29e3<=0x0||isNaN(_0x3b29e3)){return _0x3e623b(msgResponse(_0x6a96('0x227'),_0x6a96('0x4a'),'Ts\x20=\x20'+_0x3b29e3));}if(_0x1976a4<=0x0||isNaN(_0x1976a4)){return _0x3e623b(msgResponse(_0x6a96('0x227'),_0x6a96('0x4a'),'p\x20=\x20'+_0x1976a4));}if(_0x3266ed<=0x0||isNaN(_0x3266ed)){return _0x3e623b(msgResponse(_0x6a96('0x227'),_0x6a96('0x4a'),'interval\x20=\x20'+_0x3266ed));}if(_0x3e2f1e<=0x0||isNaN(_0x3e2f1e)){return _0x3e623b(msgResponse(_0x6a96('0x227'),_0x6a96('0x4a'),_0x6a96('0x228')+_0x3e2f1e));}_0x1659ee=_0x1659ee||0x0;var _0x4986d3=0x1/_0x3b29e3;var _0x1d31d9=0x0;var _0x4bd0ac=0x0;var _0x17b405=0x0;var _0x21abbb=0x0;for(var _0x3d3bfd=0x0;_0x21abbb<_0x3e2f1e;_0x3d3bfd+=0x1){_0x4bd0ac=_0x3d3bfd/_0x3266ed;_0x1d31d9=(_0x1976a4*_0x4bd0ac+_0x1659ee)/_0x4986d3;_0x17b405=erlangb(_0x1d31d9,_0x54a528);_0x21abbb=_0x1d31d9/_0x54a528*(0x1-erlangb(_0x1d31d9,_0x54a528));}return _0x574698({'erlangCalls':_0x3d3bfd,'erlangCallToSecond':_0x3266ed/_0x3d3bfd,'erlangAbandonmentRate':_0x17b405,'erlangBusyFactor':_0x21abbb});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 4a57c5e..0b06d0b 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 _0x6837=['campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','scheduledat','type'];(function(_0x41021b,_0x2b9954){var _0x2810a2=function(_0x30aa9c){while(--_0x30aa9c){_0x41021b['push'](_0x41021b['shift']());}};_0x2810a2(++_0x2b9954);}(_0x6837,0x149));var _0x7683=function(_0x2d211b,_0x5f3d2e){_0x2d211b=_0x2d211b-0x0;var _0x456fab=_0x6837[_0x2d211b];return _0x456fab;};'use strict';var util=require(_0x7683('0x0'));var _=require('lodash');var moment=require(_0x7683('0x1'));function getSeconds(_0x124582,_0x477ee2){var _0xd28bd5=moment(_0x124582)[_0x7683('0x2')](0x0);var _0x3c188c=moment(_0x477ee2)[_0x7683('0x2')](0x0);return _0xd28bd5[_0x7683('0x3')](_0x3c188c,_0x7683('0x4'));}function QueueCallerAbandon(_0x1d97e0,_0x1904fb){this[_0x7683('0x5')]=_0x1d97e0[_0x7683('0x5')];this[_0x7683('0x6')]=_0x1d97e0[_0x7683('0x6')];this[_0x7683('0x7')]=_0x1d97e0['type']==='outbound'?_0x7683('0x8'):_0x1d97e0['type'];this[_0x7683('0x9')]=_0x1d97e0[_0x7683('0x9')];this[_0x7683('0xa')]=_0x1d97e0[_0x7683('0xa')];this[_0x7683('0xb')]=_0x1d97e0['countnoanswerretry'];this['countglobal']=_0x1d97e0[_0x7683('0x9')]+_0x1d97e0['countcongestionretry']+_0x1d97e0[_0x7683('0xb')]+_0x1d97e0[_0x7683('0xc')]+_0x1d97e0['countdropretry']+_0x1d97e0['countabandonedretry']+_0x1d97e0[_0x7683('0xd')]+_0x1d97e0[_0x7683('0xe')];this[_0x7683('0xc')]=_0x1d97e0['countnosuchnumberretry'];this[_0x7683('0xf')]=_0x1d97e0['countdropretry'];this['countabandonedretry']=_0x1d97e0[_0x7683('0x10')];this[_0x7683('0xd')]=_0x1d97e0[_0x7683('0xd')];this[_0x7683('0xe')]=_0x1d97e0[_0x7683('0xe')];this[_0x7683('0x11')]=_0x1904fb['uniqueid'];this['calleridname']=_0x1d97e0[_0x7683('0x12')];this[_0x7683('0x13')]=_0x1d97e0[_0x7683('0x14')];this[_0x7683('0x15')]=_0x1d97e0['starttime'];this[_0x7683('0x16')]=_0x1d97e0['responsetime'];this[_0x7683('0x17')]=_0x1d97e0[_0x7683('0x17')];this[_0x7683('0x18')]=this['droptime'];this[_0x7683('0x19')]=getSeconds(_0x1d97e0[_0x7683('0x16')],_0x1d97e0['starttime']);this[_0x7683('0x1a')]=getSeconds(this[_0x7683('0x17')],_0x1d97e0['responsetime']);this[_0x7683('0x1b')]=0x0;this[_0x7683('0x8')]=_0x1904fb['queue'];this[_0x7683('0x1c')]=_0x1904fb[_0x7683('0x1d')];this[_0x7683('0x1e')]=_0x1904fb[_0x7683('0x1e')];this[_0x7683('0x1f')]=_0x1d97e0['callback'];this[_0x7683('0x20')]=_0x1d97e0[_0x7683('0x20')];this['callbackat']=_0x1d97e0[_0x7683('0x21')];this[_0x7683('0x22')]=_0x1d97e0[_0x7683('0x22')];this['ContactId']=_0x1d97e0[_0x7683('0x23')];this[_0x7683('0x24')]=_0x1d97e0['ListId'];this[_0x7683('0x25')]=_0x1d97e0[_0x7683('0x25')];this[_0x7683('0x26')]=_0x1d97e0[_0x7683('0x26')];this[_0x7683('0x27')]=_0x1d97e0[_0x7683('0x27')];this['originatecalleridnum']=_0x1d97e0['originatecalleridnum']||'';this[_0x7683('0x28')]=_0x1d97e0[_0x7683('0x28')]||'';}module[_0x7683('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x165f=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime','talktime','membername','connectedlinename','reason'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x165f,0x12a));var _0xf165=function(_0x32393c,_0x2f4ec5){_0x32393c=_0x32393c-0x0;var _0x392ba1=_0x165f[_0x32393c];return _0x392ba1;};'use strict';var util=require(_0xf165('0x0'));var _=require(_0xf165('0x1'));var moment=require(_0xf165('0x2'));function getSeconds(_0x17fe6d,_0x30d872){var _0x4fe746=moment(_0x17fe6d)['milliseconds'](0x0);var _0x1ebf12=moment(_0x30d872)[_0xf165('0x3')](0x0);return _0x4fe746[_0xf165('0x4')](_0x1ebf12,_0xf165('0x5'));}function QueueCallerAbandon(_0x508b92,_0x49c7d5){this[_0xf165('0x6')]=_0x508b92[_0xf165('0x6')];this['type']=_0x508b92['type'];this['campaigntype']=_0x508b92[_0xf165('0x7')]==='outbound'?_0xf165('0x8'):_0x508b92[_0xf165('0x7')];this[_0xf165('0x9')]=_0x508b92[_0xf165('0x9')];this[_0xf165('0xa')]=_0x508b92[_0xf165('0xa')];this[_0xf165('0xb')]=_0x508b92['countnoanswerretry'];this[_0xf165('0xc')]=_0x508b92[_0xf165('0x9')]+_0x508b92['countcongestionretry']+_0x508b92['countnoanswerretry']+_0x508b92[_0xf165('0xd')]+_0x508b92[_0xf165('0xe')]+_0x508b92['countabandonedretry']+_0x508b92['countmachineretry']+_0x508b92['countagentrejectretry'];this[_0xf165('0xd')]=_0x508b92[_0xf165('0xd')];this[_0xf165('0xe')]=_0x508b92[_0xf165('0xe')];this[_0xf165('0xf')]=_0x508b92[_0xf165('0xf')];this[_0xf165('0x10')]=_0x508b92[_0xf165('0x10')];this[_0xf165('0x11')]=_0x508b92['countagentrejectretry'];this['uniqueid']=_0x49c7d5['uniqueid'];this[_0xf165('0x12')]=_0x508b92['name'];this[_0xf165('0x13')]=_0x508b92[_0xf165('0x14')];this[_0xf165('0x15')]=_0x508b92[_0xf165('0x15')];this[_0xf165('0x16')]=_0x508b92['responsetime'];this[_0xf165('0x17')]=_0x508b92['droptime'];this[_0xf165('0x18')]=this[_0xf165('0x17')];this['ringtime']=getSeconds(_0x508b92[_0xf165('0x16')],_0x508b92[_0xf165('0x15')]);this[_0xf165('0x19')]=getSeconds(this['droptime'],_0x508b92[_0xf165('0x16')]);this[_0xf165('0x1a')]=0x0;this[_0xf165('0x8')]=_0x49c7d5[_0xf165('0x8')];this[_0xf165('0x1b')]=_0x49c7d5[_0xf165('0x1c')];this[_0xf165('0x1d')]=_0x49c7d5[_0xf165('0x1d')];this[_0xf165('0x1e')]=_0x508b92['callback'];this[_0xf165('0x1f')]=_0x508b92[_0xf165('0x1f')];this['callbackat']=_0x508b92[_0xf165('0x20')];this[_0xf165('0x21')]=_0x508b92['recallme'];this['ContactId']=_0x508b92[_0xf165('0x22')];this[_0xf165('0x23')]=_0x508b92[_0xf165('0x23')];this['UserId']=_0x508b92[_0xf165('0x24')];this['VoiceQueueId']=_0x508b92['VoiceQueueId'];this[_0xf165('0x25')]=_0x508b92[_0xf165('0x25')];this['originatecalleridnum']=_0x508b92[_0xf165('0x26')]||'';this[_0xf165('0x27')]=_0x508b92[_0xf165('0x27')]||'';}module[_0xf165('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index d329f6d..3e59759 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(_0x267d23,_0x1185b2){var _0x210095=function(_0x3a1e33){while(--_0x3a1e33){_0x267d23['push'](_0x267d23['shift']());}};_0x210095(++_0x1185b2);}(_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 +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x2c450b,_0x91a5f1){var _0x21c486=function(_0x40e8f2){while(--_0x40e8f2){_0x2c450b['push'](_0x2c450b['shift']());}};_0x21c486(++_0x91a5f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 545104e..8446d41 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 _0x5555=['./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','trunks','newchannel','syncNewchannel','bind','syncVarSet','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','faxAccounts','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','channelstate','channelstatedesc','value','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','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','path','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','isTrunkReachable','isNil','active','format','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','lodash','uuid','moment'];(function(_0x8fca23,_0x53d194){var _0x2f0ec4=function(_0xe17eb7){while(--_0xe17eb7){_0x8fca23['push'](_0x8fca23['shift']());}};_0x2f0ec4(++_0x53d194);}(_0x5555,0x6f));var _0x5555=function(_0x1677f0,_0x43d752){_0x1677f0=_0x1677f0-0x0;var _0x2e6aee=_0x5555[_0x1677f0];return _0x2e6aee;};'use strict';var util=require('util');var _=require(_0x5555('0x0'));var BPromise=require('bluebird');var uuid=require(_0x5555('0x1'));var moment=require(_0x5555('0x2'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require(_0x5555('0x3'));var logger=require(_0x5555('0x4'))(_0x5555('0x5'));var ami=require(_0x5555('0x6'));var rpcDb=require(_0x5555('0x7'));var Channel=require('./channel');var ut=require(_0x5555('0x8'));var Action=require(_0x5555('0x9'));var faxAccount=require(_0x5555('0xa'));var attachment=require(_0x5555('0xb'));var faxMessage=require(_0x5555('0xc'));function Fax(_0x38d300){this[_0x5555('0xd')]={};this['faxAccounts']=_0x38d300['faxAccounts'];this[_0x5555('0xe')]=_0x38d300[_0x5555('0xe')];this['actions']={};ami['on'](_0x5555('0xf'),this[_0x5555('0x10')][_0x5555('0x11')](this));ami['on']('varset',this[_0x5555('0x12')][_0x5555('0x11')](this));ami['on'](_0x5555('0x13'),this['syncNewState'][_0x5555('0x11')](this));ami['on'](_0x5555('0x14'),this[_0x5555('0x15')][_0x5555('0x11')](this));ami['on'](_0x5555('0x16'),this[_0x5555('0x17')][_0x5555('0x11')](this));ami['on'](_0x5555('0x18'),this[_0x5555('0x19')]['bind'](this));ami['on']('hangup',this[_0x5555('0x1a')][_0x5555('0x11')](this));ami['on'](_0x5555('0x1b'),this[_0x5555('0x1c')][_0x5555('0x11')](this));}Fax[_0x5555('0x1d')][_0x5555('0x10')]=function(_0x59105c){if(_0x59105c[_0x5555('0x1e')]===_0x5555('0x1f')){for(var _0x4153f8 in this[_0x5555('0x20')]){if(this[_0x5555('0x20')][_0x5555('0x21')](_0x4153f8)){if(_0x59105c[_0x5555('0x22')]===this[_0x5555('0x20')][_0x4153f8]['localstationid']){this[_0x5555('0xd')][_0x59105c[_0x5555('0x23')]]={};this[_0x5555('0xd')][_0x59105c[_0x5555('0x23')]][_0x5555('0x24')]=_0x59105c[_0x5555('0x24')];this[_0x5555('0xd')][_0x59105c[_0x5555('0x23')]]['id']=this[_0x5555('0x20')][_0x4153f8]['id'];this[_0x5555('0xd')][_0x59105c[_0x5555('0x23')]][_0x5555('0x25')]=this[_0x5555('0x20')][_0x4153f8][_0x5555('0x25')];logger[_0x5555('0x26')](_0x59105c[_0x5555('0x23')],_0x5555('0x27'));}}}}if(this[_0x5555('0x28')][_0x59105c[_0x5555('0x23')]]){this[_0x5555('0xd')][_0x59105c['uniqueid']]={};this['channels'][_0x59105c[_0x5555('0x23')]]['channel']=_0x59105c['channel'];logger[_0x5555('0x26')](_0x59105c[_0x5555('0x23')],'\x20syncNewchannel\x20');}};Fax[_0x5555('0x1d')][_0x5555('0x12')]=function(_0x4e8fc1){if(this[_0x5555('0xd')][_0x4e8fc1[_0x5555('0x23')]]){for(var _0xdcc1a9 in _0x4e8fc1[_0x5555('0x29')]){if(_0x4e8fc1[_0x5555('0x29')][_0x5555('0x21')](_0xdcc1a9)){this['channels'][_0x4e8fc1[_0x5555('0x23')]][_0xdcc1a9]=_0x4e8fc1['value'];}}}};Fax[_0x5555('0x1d')]['syncNewState']=function(_0x358459){if(this[_0x5555('0xd')][_0x358459[_0x5555('0x23')]]){this[_0x5555('0xd')][_0x358459[_0x5555('0x23')]][_0x5555('0x2a')]=_0x358459[_0x5555('0x2a')];this[_0x5555('0xd')][_0x358459[_0x5555('0x23')]][_0x5555('0x2b')]=_0x358459[_0x5555('0x2b')];}};Fax[_0x5555('0x1d')][_0x5555('0x15')]=function(_0x14b66f){if(this[_0x5555('0xd')][_0x14b66f[_0x5555('0x23')]]){for(var _0x66785b in _0x14b66f['variable']){if(_0x14b66f[_0x5555('0x29')][_0x5555('0x21')](_0x66785b)){this[_0x5555('0xd')][_0x14b66f['uniqueid']][_0x66785b]=_0x14b66f[_0x5555('0x2c')];}}}};Fax[_0x5555('0x1d')]['syncFaxStatus']=function(_0x406f5c){if(this['channels'][_0x406f5c[_0x5555('0x23')]]){this[_0x5555('0xd')][_0x406f5c[_0x5555('0x23')]]['operation']=_0x406f5c[_0x5555('0x2d')];this[_0x5555('0xd')][_0x406f5c['uniqueid']][_0x5555('0x2e')]=_0x406f5c['status'];this[_0x5555('0xd')][_0x406f5c[_0x5555('0x23')]][_0x5555('0x2f')]=_0x406f5c[_0x5555('0x2f')];this[_0x5555('0xd')][_0x406f5c['uniqueid']][_0x5555('0x30')]=_0x406f5c['filename'];logger[_0x5555('0x26')](_0x406f5c[_0x5555('0x23')],_0x5555('0x31'));}};Fax[_0x5555('0x1d')]['syncReceiveFax']=function(_0x52ab37){var _0x1a08c0=this;if(this[_0x5555('0xd')][_0x52ab37['uniqueid']]){var _0x3d4721=this[_0x5555('0xd')][_0x52ab37[_0x5555('0x23')]]['id'];this['channels'][_0x52ab37[_0x5555('0x23')]][_0x5555('0x32')]=_0x52ab37[_0x5555('0x32')];this[_0x5555('0xd')][_0x52ab37[_0x5555('0x23')]][_0x5555('0x33')]=_0x52ab37[_0x5555('0x33')];this[_0x5555('0xd')][_0x52ab37['uniqueid']][_0x5555('0x2f')]=_0x52ab37[_0x5555('0x2f')];this[_0x5555('0xd')][_0x52ab37[_0x5555('0x23')]][_0x5555('0x34')]=_0x52ab37[_0x5555('0x34')];this[_0x5555('0xd')][_0x52ab37[_0x5555('0x23')]][_0x5555('0x35')]=_0x52ab37['transferrate'];this['channels'][_0x52ab37[_0x5555('0x23')]][_0x5555('0x30')]=_0x52ab37[_0x5555('0x30')];this[_0x5555('0xd')][_0x52ab37[_0x5555('0x23')]]['calleridnum']=_0x52ab37['calleridnum'];if(this[_0x5555('0xd')][_0x52ab37[_0x5555('0x23')]][_0x5555('0x33')]>0x0){tiff2pdf(_0x52ab37[_0x5555('0x30')],_0x5555('0x36'),function(_0x429306){logger[_0x5555('0x26')](_0x52ab37[_0x5555('0x23')],_0x5555('0x37'),_0x429306[_0x5555('0x38')]);attachment['create']({'name':path[_0x5555('0x39')](_0x52ab37[_0x5555('0x30')])[_0x5555('0x25')],'basename':path[_0x5555('0x39')](_0x52ab37[_0x5555('0x30')])[_0x5555('0x25')]+_0x5555('0x3a'),'type':_0x5555('0x3b')})['then'](function(_0x55fb0e){faxAccount[_0x5555('0x3c')](_0x3d4721,{'from':_0x52ab37['calleridnum'],'mapKey':'fax','body':path[_0x5555('0x39')](_0x52ab37[_0x5555('0x30')])[_0x5555('0x25')]+_0x5555('0x3a'),'AttachmentId':_0x55fb0e['id']})['catch'](function(_0x41232a){logger[_0x5555('0x3d')](_0x52ab37[_0x5555('0x23')],_0x5555('0x3e'),JSON[_0x5555('0x3f')](_0x41232a));});})[_0x5555('0x40')](function(_0xecb2b5){logger[_0x5555('0x3d')](_0x52ab37[_0x5555('0x23')],_0x5555('0x41'),JSON['stringify'](_0xecb2b5));});});}logger[_0x5555('0x26')](_0x52ab37[_0x5555('0x23')],_0x5555('0x41'));}};Fax[_0x5555('0x1d')][_0x5555('0x1c')]=function(_0x5720d1){if(this[_0x5555('0x28')][_0x5720d1[_0x5555('0x23')]]){_[_0x5555('0x42')](this[_0x5555('0xd')][_0x5720d1[_0x5555('0x23')]],_[_0x5555('0x43')](_0x5720d1,[_0x5555('0x44'),'reason']));}};function updateStatus(_0x47944b){if(_0x47944b['AttachmentId']){faxMessage['update'](_0x47944b[_0x5555('0x45')],{'failMessage':_0x5555('0x46')})[_0x5555('0x47')](function(_0x2e132d){ut['logger'](_0x5555('0x48'),_0x2e132d);})[_0x5555('0x40')](function(_0x4300fc){ut[_0x5555('0x49')](_0x5555('0x4a'),_0x4300fc);});}else{ut[_0x5555('0x49')](_0x5555('0x4b'));}}Fax[_0x5555('0x1d')][_0x5555('0x4c')]=function(_0x2204d0,_0x338676,_0x189805){var _0x4886eb=this;var _0x3abe89={};if(_0x338676){_0x3abe89={'read':_0x338676};}else{_0x3abe89={'failMessage':_0x189805};}if(this[_0x5555('0x28')][_0x2204d0]['AttachmentId']){faxMessage['update'](this[_0x5555('0x28')][_0x2204d0][_0x5555('0x45')],_0x3abe89)[_0x5555('0x47')](function(_0xab701e){ut[_0x5555('0x49')]('[Fax][Message][Updated]',_0xab701e);})[_0x5555('0x40')](function(_0x5ac893){ut[_0x5555('0x49')](_0x5555('0x4d'),_0x5ac893);})[_0x5555('0x4e')](function(){delete _0x4886eb['channels'][_0x2204d0];delete _0x4886eb[_0x5555('0x28')][_0x2204d0];});}else{ut[_0x5555('0x49')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x2204d0];delete this['actions'][_0x2204d0];}};Fax[_0x5555('0x1d')][_0x5555('0x1a')]=function(_0x37033b){var _0x5349ab=this;if(this[_0x5555('0xd')][_0x37033b[_0x5555('0x23')]]){if(this['actions'][_0x37033b[_0x5555('0x23')]]){this[_0x5555('0xd')][_0x37033b[_0x5555('0x23')]]['id']=this[_0x5555('0x28')][_0x37033b['uniqueid']]['id'];this[_0x5555('0xd')][_0x37033b[_0x5555('0x23')]][_0x5555('0x25')]=this[_0x5555('0x28')][_0x37033b[_0x5555('0x23')]][_0x5555('0x25')];}logger[_0x5555('0x26')](_0x37033b['uniqueid'],this['actions'][_0x37033b[_0x5555('0x23')]]?_0x5555('0x4f'):'\x20hangup\x20faxRiceive\x20',JSON[_0x5555('0x3f')](this[_0x5555('0xd')][_0x37033b['uniqueid']]));if(this['actions'][_0x37033b[_0x5555('0x23')]]){if(this[_0x5555('0xd')][_0x37033b['uniqueid']][_0x5555('0x50')]>0x0&&this['channels'][_0x37033b[_0x5555('0x23')]]['faxstatus']==='SUCCESS'){this[_0x5555('0x4c')](_0x37033b[_0x5555('0x23')],!![]);}else{this['updateStatus'](_0x37033b['uniqueid'],![],this['channels'][_0x37033b[_0x5555('0x23')]][_0x5555('0x51')]?_0x5555('0x52')+this[_0x5555('0xd')][_0x37033b[_0x5555('0x23')]]['faxstatusstring']:_0x5555('0x53'));}}}};Fax[_0x5555('0x1d')][_0x5555('0x54')]=function(_0x32e22a){var _0x54ff81=this;return new BPromise(function(_0xc817b2,_0x111401){_0x54ff81[_0x5555('0x55')](_0x32e22a,_0x54ff81[_0x5555('0x20')][_0x32e22a[_0x5555('0x56')]])['then'](function(_0x28f37c){ut[_0x5555('0x49')](_0x5555('0x57'),_0x28f37c);_0xc817b2(ut[_0x5555('0x38')]('Fax\x20received'));})[_0x5555('0x40')](function(_0x27705c){ut[_0x5555('0x49')]('[Fax][execOriginate][failure]',_0x27705c);updateStatus(_0x32e22a);_0x111401(ut[_0x5555('0x38')](_0x5555('0x58')));});});};Fax['prototype'][_0x5555('0x59')]=function(_0x17cf48){var _0xec8300=this;return new BPromise(function(_0x3aac62,_0x118705){var _0x23b6fa=_0xec8300[_0x5555('0x5a')](_0xec8300['faxAccounts'][_0x17cf48['FaxAccountId']][_0x5555('0x5b')],_0x17cf48);if(_0x23b6fa[_0x5555('0x5c')]){_0x3aac62(ut[_0x5555('0x38')](_0x5555('0x5d')));}else{_0x118705(ut[_0x5555('0x38')](_0x23b6fa['message']));}});};function originate(_0x296dd5,_0x51b2b5,_0x550c5a){return new BPromise(function(_0x54e22c,_0x3bb16c){if(_0x550c5a){var _0xb0cb92=util['format'](_0x5555('0x5e'),path[_0x5555('0x39')](_0x296dd5[_0x5555('0x5f')])[_0x5555('0x25')],_0x296dd5[_0x5555('0x5f')]);gs['execute'](_0xb0cb92)['then'](function(){_0x296dd5[_0x5555('0x5f')]=util['format'](_0x5555('0x60'),path['parse'](_0x296dd5[_0x5555('0x5f')])['dir'],path[_0x5555('0x39')](_0x296dd5[_0x5555('0x5f')])[_0x5555('0x25')]);_0x51b2b5[_0x5555('0x61')]=_0x296dd5[_0x5555('0x5f')];ut[_0x5555('0x49')](_0x5555('0x62'),'');ami['Action'](ut[_0x5555('0x63')](_0x296dd5,_0x51b2b5))[_0x5555('0x47')](function(_0x5e9597){_0x54e22c(_0x5e9597);})[_0x5555('0x40')](function(_0x5aeb15){_0x3bb16c(_0x5aeb15);});})[_0x5555('0x40')](function(_0x49d745){_0x3bb16c(_0x49d745);});}else{ami[_0x5555('0x64')](ut[_0x5555('0x63')](_0x296dd5,_0x51b2b5))[_0x5555('0x47')](function(_0x42805d){_0x54e22c(_0x42805d);})[_0x5555('0x40')](function(_0x5c99a1){_0x3bb16c(_0x5c99a1);});}});}Fax[_0x5555('0x1d')][_0x5555('0x55')]=function(_0x3b0e31,_0x150f7c){var _0x282739=this;return new BPromise(function(_0x24877c,_0x3ee39e){var _0x18bb05=uuid['v4']();var _0x2c44dd=ut[_0x5555('0x65')](_0x3b0e31,_0x150f7c);_0x282739['actions'][_0x18bb05]=new Action(_0x18bb05,_0x150f7c,_0x3b0e31);var _0x381e92=_0x282739['actions'][_0x18bb05];if(path[_0x5555('0x39')](_0x3b0e31[_0x5555('0x5f')])['ext']==='.pdf'){originate(_0x381e92,_0x2c44dd,!![])['then'](function(_0x3f8f8c){_0x24877c(_0x3f8f8c);})['catch'](function(_0x4c0a9b){_0x3ee39e(_0x4c0a9b);});}else{originate(_0x381e92,_0x2c44dd,![])[_0x5555('0x47')](function(_0x1663b1){_0x24877c(_0x1663b1);})['catch'](function(_0xbeb90a){_0x3ee39e(_0xbeb90a);});}});};Fax['prototype'][_0x5555('0x66')]=function(_0x1bcd2d){return!_[_0x5555('0x67')](_0x1bcd2d)&&!_['isNil'](_0x1bcd2d[_0x5555('0x25')])&&!_[_0x5555('0x67')](_0x1bcd2d[_0x5555('0x68')])&&_0x1bcd2d['active']&&!_[_0x5555('0x67')](this[_0x5555('0xe')][util[_0x5555('0x69')](_0x5555('0x6a'),_0x1bcd2d[_0x5555('0x25')])])&&!_[_0x5555('0x67')](this[_0x5555('0xe')][util[_0x5555('0x69')](_0x5555('0x6a'),_0x1bcd2d[_0x5555('0x25')])][_0x5555('0x2e')])&&(this[_0x5555('0xe')][util[_0x5555('0x69')](_0x5555('0x6a'),_0x1bcd2d['name'])][_0x5555('0x2e')]===_0x5555('0x6b')||this[_0x5555('0xe')][util['format'](_0x5555('0x6a'),_0x1bcd2d[_0x5555('0x25')])]['status']===_0x5555('0x6c'));};Fax['prototype'][_0x5555('0x5a')]=function(_0x3049cd,_0x114aff){if(!this[_0x5555('0x66')](_0x3049cd)){ut[_0x5555('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x5555('0x67')](_0x3049cd)?'':_0x3049cd[_0x5555('0x25')]+_0x5555('0x6d'));return{'isValid':![],'message':_0x5555('0x6e')};}if(_[_0x5555('0x67')](_0x114aff['fax'])){ut[_0x5555('0x49')](_0x5555('0x6f'),JSON[_0x5555('0x3f')](_0x114aff));return{'isValid':![],'message':_0x5555('0x70')};}if(_[_0x5555('0x67')](_0x114aff[_0x5555('0x5f')])){ut[_0x5555('0x49')](_0x5555('0x71'),JSON['stringify'](_0x114aff));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file +var _0x5aa6=['[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','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','path','execute','format','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','.pdf','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','fax','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','moment','./util/gs','../../../config/logger','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','bind','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','channel','channels','uniqueid','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus'];(function(_0x3844ab,_0x461e40){var _0x2a3276=function(_0x1d1176){while(--_0x1d1176){_0x3844ab['push'](_0x3844ab['shift']());}};_0x2a3276(++_0x461e40);}(_0x5aa6,0x19a));var _0x65aa=function(_0xdac4f9,_0x5e6c6b){_0xdac4f9=_0xdac4f9-0x0;var _0x3161bf=_0x5aa6[_0xdac4f9];return _0x3161bf;};'use strict';var util=require('util');var _=require(_0x65aa('0x0'));var BPromise=require(_0x65aa('0x1'));var uuid=require(_0x65aa('0x2'));var moment=require(_0x65aa('0x3'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require(_0x65aa('0x4'));var logger=require(_0x65aa('0x5'))('fax');var ami=require(_0x65aa('0x6'));var rpcDb=require(_0x65aa('0x7'));var Channel=require('./channel');var ut=require(_0x65aa('0x8'));var Action=require(_0x65aa('0x9'));var faxAccount=require(_0x65aa('0xa'));var attachment=require(_0x65aa('0xb'));var faxMessage=require(_0x65aa('0xc'));function Fax(_0x512e0a){this['channels']={};this[_0x65aa('0xd')]=_0x512e0a[_0x65aa('0xd')];this[_0x65aa('0xe')]=_0x512e0a[_0x65aa('0xe')];this[_0x65aa('0xf')]={};ami['on'](_0x65aa('0x10'),this[_0x65aa('0x11')]['bind'](this));ami['on'](_0x65aa('0x12'),this[_0x65aa('0x13')]['bind'](this));ami['on'](_0x65aa('0x14'),this[_0x65aa('0x15')]['bind'](this));ami['on'](_0x65aa('0x16'),this[_0x65aa('0x17')][_0x65aa('0x18')](this));ami['on']('faxstatus',this[_0x65aa('0x19')]['bind'](this));ami['on']('receivefax',this[_0x65aa('0x1a')][_0x65aa('0x18')](this));ami['on'](_0x65aa('0x1b'),this[_0x65aa('0x1c')][_0x65aa('0x18')](this));ami['on'](_0x65aa('0x1d'),this[_0x65aa('0x1e')]['bind'](this));}Fax[_0x65aa('0x1f')][_0x65aa('0x11')]=function(_0x3fe743){if(_0x3fe743[_0x65aa('0x20')]===_0x65aa('0x21')){for(var _0x45e16e in this[_0x65aa('0xd')]){if(this[_0x65aa('0xd')][_0x65aa('0x22')](_0x45e16e)){if(_0x3fe743['exten']===this[_0x65aa('0xd')][_0x45e16e][_0x65aa('0x23')]){this['channels'][_0x3fe743['uniqueid']]={};this['channels'][_0x3fe743['uniqueid']][_0x65aa('0x24')]=_0x3fe743[_0x65aa('0x24')];this[_0x65aa('0x25')][_0x3fe743[_0x65aa('0x26')]]['id']=this[_0x65aa('0xd')][_0x45e16e]['id'];this[_0x65aa('0x25')][_0x3fe743[_0x65aa('0x26')]][_0x65aa('0x27')]=this['faxAccounts'][_0x45e16e]['name'];logger[_0x65aa('0x28')](_0x3fe743[_0x65aa('0x26')],'\x20syncNewchannel\x20');}}}}if(this[_0x65aa('0xf')][_0x3fe743['uniqueid']]){this[_0x65aa('0x25')][_0x3fe743[_0x65aa('0x26')]]={};this[_0x65aa('0x25')][_0x3fe743[_0x65aa('0x26')]][_0x65aa('0x24')]=_0x3fe743['channel'];logger['info'](_0x3fe743[_0x65aa('0x26')],_0x65aa('0x29'));}};Fax['prototype'][_0x65aa('0x13')]=function(_0x51dfff){if(this[_0x65aa('0x25')][_0x51dfff[_0x65aa('0x26')]]){for(var _0x2c695d in _0x51dfff[_0x65aa('0x2a')]){if(_0x51dfff['variable'][_0x65aa('0x22')](_0x2c695d)){this[_0x65aa('0x25')][_0x51dfff[_0x65aa('0x26')]][_0x2c695d]=_0x51dfff[_0x65aa('0x2b')];}}}};Fax[_0x65aa('0x1f')][_0x65aa('0x15')]=function(_0x1b7dac){if(this[_0x65aa('0x25')][_0x1b7dac[_0x65aa('0x26')]]){this[_0x65aa('0x25')][_0x1b7dac['uniqueid']][_0x65aa('0x2c')]=_0x1b7dac['channelstate'];this[_0x65aa('0x25')][_0x1b7dac[_0x65aa('0x26')]][_0x65aa('0x2d')]=_0x1b7dac[_0x65aa('0x2d')];}};Fax[_0x65aa('0x1f')][_0x65aa('0x17')]=function(_0x50fbb5){if(this[_0x65aa('0x25')][_0x50fbb5['uniqueid']]){for(var _0xa83009 in _0x50fbb5[_0x65aa('0x2a')]){if(_0x50fbb5[_0x65aa('0x2a')][_0x65aa('0x22')](_0xa83009)){this['channels'][_0x50fbb5[_0x65aa('0x26')]][_0xa83009]=_0x50fbb5[_0x65aa('0x2b')];}}}};Fax[_0x65aa('0x1f')][_0x65aa('0x19')]=function(_0x4a8a57){if(this[_0x65aa('0x25')][_0x4a8a57[_0x65aa('0x26')]]){this['channels'][_0x4a8a57['uniqueid']][_0x65aa('0x2e')]=_0x4a8a57['operation'];this[_0x65aa('0x25')][_0x4a8a57[_0x65aa('0x26')]][_0x65aa('0x2f')]=_0x4a8a57['status'];this[_0x65aa('0x25')][_0x4a8a57[_0x65aa('0x26')]][_0x65aa('0x23')]=_0x4a8a57[_0x65aa('0x23')];this[_0x65aa('0x25')][_0x4a8a57[_0x65aa('0x26')]][_0x65aa('0x30')]=_0x4a8a57['filename'];logger[_0x65aa('0x28')](_0x4a8a57['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x65aa('0x1f')]['syncReceiveFax']=function(_0x4d3493){var _0x1dc298=this;if(this[_0x65aa('0x25')][_0x4d3493[_0x65aa('0x26')]]){var _0x13d9e6=this[_0x65aa('0x25')][_0x4d3493[_0x65aa('0x26')]]['id'];this[_0x65aa('0x25')][_0x4d3493[_0x65aa('0x26')]]['remotestationid']=_0x4d3493[_0x65aa('0x31')];this['channels'][_0x4d3493['uniqueid']][_0x65aa('0x32')]=_0x4d3493[_0x65aa('0x32')];this[_0x65aa('0x25')][_0x4d3493['uniqueid']][_0x65aa('0x23')]=_0x4d3493['localstationid'];this[_0x65aa('0x25')][_0x4d3493[_0x65aa('0x26')]][_0x65aa('0x33')]=_0x4d3493[_0x65aa('0x33')];this[_0x65aa('0x25')][_0x4d3493[_0x65aa('0x26')]][_0x65aa('0x34')]=_0x4d3493['transferrate'];this[_0x65aa('0x25')][_0x4d3493['uniqueid']]['filename']=_0x4d3493[_0x65aa('0x30')];this[_0x65aa('0x25')][_0x4d3493[_0x65aa('0x26')]][_0x65aa('0x35')]=_0x4d3493[_0x65aa('0x35')];if(this['channels'][_0x4d3493[_0x65aa('0x26')]]['pagestransferred']>0x0){tiff2pdf(_0x4d3493[_0x65aa('0x30')],_0x65aa('0x36'),function(_0x23f2ad){logger[_0x65aa('0x28')](_0x4d3493[_0x65aa('0x26')],_0x65aa('0x37'),_0x23f2ad[_0x65aa('0x38')]);attachment[_0x65aa('0x39')]({'name':path[_0x65aa('0x3a')](_0x4d3493['filename'])['name'],'basename':path[_0x65aa('0x3a')](_0x4d3493[_0x65aa('0x30')])['name']+'.pdf','type':'application/pdf'})['then'](function(_0x2062b4){faxAccount[_0x65aa('0x3b')](_0x13d9e6,{'from':_0x4d3493[_0x65aa('0x35')],'mapKey':'fax','body':path[_0x65aa('0x3a')](_0x4d3493[_0x65aa('0x30')])['name']+'.pdf','AttachmentId':_0x2062b4['id']})[_0x65aa('0x3c')](function(_0x5bf75b){logger[_0x65aa('0x3d')](_0x4d3493[_0x65aa('0x26')],_0x65aa('0x3e'),JSON[_0x65aa('0x3f')](_0x5bf75b));});})[_0x65aa('0x3c')](function(_0x3afd91){logger[_0x65aa('0x3d')](_0x4d3493[_0x65aa('0x26')],_0x65aa('0x40'),JSON['stringify'](_0x3afd91));});});}logger[_0x65aa('0x28')](_0x4d3493[_0x65aa('0x26')],_0x65aa('0x40'));}};Fax['prototype'][_0x65aa('0x1e')]=function(_0x398b44){if(this[_0x65aa('0xf')][_0x398b44['uniqueid']]){_[_0x65aa('0x41')](this['channels'][_0x398b44[_0x65aa('0x26')]],_[_0x65aa('0x42')](_0x398b44,[_0x65aa('0x43'),_0x65aa('0x44')]));}};function updateStatus(_0x3ce228){if(_0x3ce228[_0x65aa('0x45')]){faxMessage[_0x65aa('0x46')](_0x3ce228[_0x65aa('0x45')],{'failMessage':_0x65aa('0x47')})[_0x65aa('0x48')](function(_0x3cb99e){ut['logger'](_0x65aa('0x49'),_0x3cb99e);})['catch'](function(_0x2c452f){ut[_0x65aa('0x4a')](_0x65aa('0x4b'),_0x2c452f);});}else{ut[_0x65aa('0x4a')](_0x65aa('0x4c'));}}Fax['prototype'][_0x65aa('0x4d')]=function(_0x53f7c1,_0x437324,_0xfdeb89){var _0x3c672f=this;var _0x1a7d07={};if(_0x437324){_0x1a7d07={'read':_0x437324};}else{_0x1a7d07={'failMessage':_0xfdeb89};}if(this[_0x65aa('0xf')][_0x53f7c1][_0x65aa('0x45')]){faxMessage['update'](this[_0x65aa('0xf')][_0x53f7c1][_0x65aa('0x45')],_0x1a7d07)[_0x65aa('0x48')](function(_0xfc1764){ut[_0x65aa('0x4a')](_0x65aa('0x4e'),_0xfc1764);})[_0x65aa('0x3c')](function(_0x199a07){ut[_0x65aa('0x4a')](_0x65aa('0x4f'),_0x199a07);})[_0x65aa('0x50')](function(){delete _0x3c672f[_0x65aa('0x25')][_0x53f7c1];delete _0x3c672f['actions'][_0x53f7c1];});}else{ut[_0x65aa('0x4a')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x53f7c1];delete this[_0x65aa('0xf')][_0x53f7c1];}};Fax[_0x65aa('0x1f')]['syncHangup']=function(_0x301e13){var _0x390c84=this;if(this['channels'][_0x301e13[_0x65aa('0x26')]]){if(this[_0x65aa('0xf')][_0x301e13[_0x65aa('0x26')]]){this[_0x65aa('0x25')][_0x301e13[_0x65aa('0x26')]]['id']=this[_0x65aa('0xf')][_0x301e13[_0x65aa('0x26')]]['id'];this[_0x65aa('0x25')][_0x301e13[_0x65aa('0x26')]]['name']=this[_0x65aa('0xf')][_0x301e13[_0x65aa('0x26')]][_0x65aa('0x27')];}logger[_0x65aa('0x28')](_0x301e13[_0x65aa('0x26')],this[_0x65aa('0xf')][_0x301e13[_0x65aa('0x26')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0x65aa('0x25')][_0x301e13[_0x65aa('0x26')]]));if(this[_0x65aa('0xf')][_0x301e13[_0x65aa('0x26')]]){if(this[_0x65aa('0x25')][_0x301e13[_0x65aa('0x26')]][_0x65aa('0x51')]>0x0&&this[_0x65aa('0x25')][_0x301e13['uniqueid']]['faxstatus']===_0x65aa('0x52')){this[_0x65aa('0x4d')](_0x301e13['uniqueid'],!![]);}else{this[_0x65aa('0x4d')](_0x301e13['uniqueid'],![],this[_0x65aa('0x25')][_0x301e13[_0x65aa('0x26')]][_0x65aa('0x53')]?_0x65aa('0x54')+this[_0x65aa('0x25')][_0x301e13[_0x65aa('0x26')]]['faxstatusstring']:_0x65aa('0x55'));}}}};Fax[_0x65aa('0x1f')][_0x65aa('0x56')]=function(_0xd7eed8){var _0x4f0b09=this;return new BPromise(function(_0x5b2837,_0x5cd9f3){_0x4f0b09[_0x65aa('0x57')](_0xd7eed8,_0x4f0b09[_0x65aa('0xd')][_0xd7eed8[_0x65aa('0x58')]])[_0x65aa('0x48')](function(_0x1c9587){ut[_0x65aa('0x4a')]('[Fax][execOriginate][success]',_0x1c9587);_0x5b2837(ut['message']('Fax\x20received'));})[_0x65aa('0x3c')](function(_0x3b7c57){ut['logger'](_0x65aa('0x59'),_0x3b7c57);updateStatus(_0xd7eed8);_0x5cd9f3(ut['message'](_0x65aa('0x5a')));});});};Fax[_0x65aa('0x1f')][_0x65aa('0x5b')]=function(_0x530f63){var _0x3e202e=this;return new BPromise(function(_0x4f173c,_0x1311f5){var _0x19d286=_0x3e202e[_0x65aa('0x5c')](_0x3e202e[_0x65aa('0xd')][_0x530f63[_0x65aa('0x58')]][_0x65aa('0x5d')],_0x530f63);if(_0x19d286[_0x65aa('0x5e')]){_0x4f173c(ut[_0x65aa('0x38')](_0x65aa('0x5f')));}else{_0x1311f5(ut[_0x65aa('0x38')](_0x19d286[_0x65aa('0x38')]));}});};function originate(_0x2bc02d,_0x46c98e,_0x230ae4){return new BPromise(function(_0x7d4ece,_0x1ab239){if(_0x230ae4){var _0x304ae4=util['format'](_0x65aa('0x60'),path[_0x65aa('0x3a')](_0x2bc02d[_0x65aa('0x61')])['name'],_0x2bc02d[_0x65aa('0x61')]);gs[_0x65aa('0x62')](_0x304ae4)[_0x65aa('0x48')](function(){_0x2bc02d[_0x65aa('0x61')]=util[_0x65aa('0x63')]('%s/%s.tif',path[_0x65aa('0x3a')](_0x2bc02d[_0x65aa('0x61')])['dir'],path[_0x65aa('0x3a')](_0x2bc02d['path'])['name']);_0x46c98e[_0x65aa('0x64')]=_0x2bc02d[_0x65aa('0x61')];ut[_0x65aa('0x4a')](_0x65aa('0x65'),'');ami[_0x65aa('0x66')](ut[_0x65aa('0x67')](_0x2bc02d,_0x46c98e))[_0x65aa('0x48')](function(_0x4d3dd7){_0x7d4ece(_0x4d3dd7);})[_0x65aa('0x3c')](function(_0x496ee3){_0x1ab239(_0x496ee3);});})['catch'](function(_0x411ccf){_0x1ab239(_0x411ccf);});}else{ami[_0x65aa('0x66')](ut['variablesAction'](_0x2bc02d,_0x46c98e))[_0x65aa('0x48')](function(_0x401118){_0x7d4ece(_0x401118);})[_0x65aa('0x3c')](function(_0x54fa00){_0x1ab239(_0x54fa00);});}});}Fax[_0x65aa('0x1f')][_0x65aa('0x57')]=function(_0x586d81,_0x57d8ad){var _0x494628=this;return new BPromise(function(_0x4fd0ba,_0x36141f){var _0xb86ddc=uuid['v4']();var _0x3c6664=ut['addVariables'](_0x586d81,_0x57d8ad);_0x494628['actions'][_0xb86ddc]=new Action(_0xb86ddc,_0x57d8ad,_0x586d81);var _0x1828e1=_0x494628[_0x65aa('0xf')][_0xb86ddc];if(path[_0x65aa('0x3a')](_0x586d81['path'])[_0x65aa('0x68')]===_0x65aa('0x69')){originate(_0x1828e1,_0x3c6664,!![])[_0x65aa('0x48')](function(_0x87a822){_0x4fd0ba(_0x87a822);})[_0x65aa('0x3c')](function(_0x55f794){_0x36141f(_0x55f794);});}else{originate(_0x1828e1,_0x3c6664,![])[_0x65aa('0x48')](function(_0x14d786){_0x4fd0ba(_0x14d786);})['catch'](function(_0x33d9b8){_0x36141f(_0x33d9b8);});}});};Fax[_0x65aa('0x1f')][_0x65aa('0x6a')]=function(_0x589176){return!_[_0x65aa('0x6b')](_0x589176)&&!_[_0x65aa('0x6b')](_0x589176[_0x65aa('0x27')])&&!_['isNil'](_0x589176[_0x65aa('0x6c')])&&_0x589176[_0x65aa('0x6c')]&&!_[_0x65aa('0x6b')](this[_0x65aa('0xe')][util[_0x65aa('0x63')]('SIP/%s',_0x589176[_0x65aa('0x27')])])&&!_[_0x65aa('0x6b')](this[_0x65aa('0xe')][util[_0x65aa('0x63')](_0x65aa('0x6d'),_0x589176[_0x65aa('0x27')])]['status'])&&(this[_0x65aa('0xe')][util[_0x65aa('0x63')](_0x65aa('0x6d'),_0x589176[_0x65aa('0x27')])][_0x65aa('0x2f')]===_0x65aa('0x6e')||this['trunks'][util[_0x65aa('0x63')](_0x65aa('0x6d'),_0x589176[_0x65aa('0x27')])][_0x65aa('0x2f')]===_0x65aa('0x6f'));};Fax[_0x65aa('0x1f')][_0x65aa('0x5c')]=function(_0x311733,_0x11e515){if(!this[_0x65aa('0x6a')](_0x311733)){ut[_0x65aa('0x4a')](_0x65aa('0x70'),_['isNil'](_0x311733)?'':_0x311733[_0x65aa('0x27')]+_0x65aa('0x71'));return{'isValid':![],'message':_0x65aa('0x72')};}if(_[_0x65aa('0x6b')](_0x11e515[_0x65aa('0x73')])){ut[_0x65aa('0x4a')](_0x65aa('0x74'),JSON[_0x65aa('0x3f')](_0x11e515));return{'isValid':![],'message':_0x65aa('0x75')};}if(_[_0x65aa('0x6b')](_0x11e515[_0x65aa('0x61')])){ut[_0x65aa('0x4a')](_0x65aa('0x76'),JSON[_0x65aa('0x3f')](_0x11e515));return{'isValid':![],'message':_0x65aa('0x77')};}return{'isValid':!![],'message':_0x65aa('0x78')};};module[_0x65aa('0x79')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 82de1e2..0462bcc 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 _0x25d4=['then','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','notify','resolve'];(function(_0x915f8c,_0x32d97c){var _0x49976e=function(_0x3db43d){while(--_0x3db43d){_0x915f8c['push'](_0x915f8c['shift']());}};_0x49976e(++_0x32d97c);}(_0x25d4,0x70));var _0x425d=function(_0x56530b,_0x43e9d5){_0x56530b=_0x56530b-0x0;var _0x1980f0=_0x25d4[_0x56530b];return _0x1980f0;};'use strict';var util=require(_0x425d('0x0'));var BPromise=require(_0x425d('0x1'));var logger=require(_0x425d('0x2'))(_0x425d('0x3'));var _=require(_0x425d('0x4'));var faxAccount=require(_0x425d('0x5'));function loggerCatch(_0x2b283a){return function(_0xb524a5){logger['error'](_0x2b283a,util['inspect'](_0xb524a5,{'showHidden':![],'depth':null}));};}exports[_0x425d('0x6')]=function(_0x1d4c2d,_0x3c58a2){return BPromise[_0x425d('0x7')]()[_0x425d('0x8')](faxAccount['notify'](_0x1d4c2d,_0x3c58a2))['catch'](loggerCatch(_0x425d('0x9')));}; \ No newline at end of file +var _0xe1d3=['../rpc/faxAccount','notify','resolve','then','catch','util','bluebird','../../../config/logger','preview'];(function(_0x526b71,_0x5afef0){var _0x27a94e=function(_0x383294){while(--_0x383294){_0x526b71['push'](_0x526b71['shift']());}};_0x27a94e(++_0x5afef0);}(_0xe1d3,0x9e));var _0x3e1d=function(_0x43cf41,_0x1d6a6d){_0x43cf41=_0x43cf41-0x0;var _0x3a93f8=_0xe1d3[_0x43cf41];return _0x3a93f8;};'use strict';var util=require(_0x3e1d('0x0'));var BPromise=require(_0x3e1d('0x1'));var logger=require(_0x3e1d('0x2'))(_0x3e1d('0x3'));var _=require('lodash');var faxAccount=require(_0x3e1d('0x4'));function loggerCatch(_0x41068d){return function(_0xcc4d4e){logger['error'](_0x41068d,util['inspect'](_0xcc4d4e,{'showHidden':![],'depth':null}));};}exports[_0x3e1d('0x5')]=function(_0x5406de,_0x4a81b8){return BPromise[_0x3e1d('0x6')]()[_0x3e1d('0x7')](faxAccount[_0x3e1d('0x5')](_0x5406de,_0x4a81b8))[_0x3e1d('0x8')](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 bb179bb..bcf6f2c 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 _0x47ee=['../../../../config/logger','fax','bluebird','child_process','exec','Exec\x20gs','\x20Error\x20:','util'];(function(_0x3e3dc5,_0x590afc){var _0x59f604=function(_0x55c58a){while(--_0x55c58a){_0x3e3dc5['push'](_0x3e3dc5['shift']());}};_0x59f604(++_0x590afc);}(_0x47ee,0x1b7));var _0xe47e=function(_0x53754c,_0xf98c20){_0x53754c=_0x53754c-0x0;var _0x378915=_0x47ee[_0x53754c];return _0x378915;};'use strict';var util=require(_0xe47e('0x0'));var logger=require(_0xe47e('0x1'))(_0xe47e('0x2'));var BPromise=require(_0xe47e('0x3'));var exec=require(_0xe47e('0x4'))[_0xe47e('0x5')];exports['execute']=function(_0x4c2c9c){return new BPromise(function(_0x1c1e43,_0x294b98){exec(_0x4c2c9c,function(_0x333b1c,_0x585e3c,_0x2b870e){logger['info'](_0xe47e('0x6'),_0x585e3c);if(_0x333b1c){logger['info']('Exec\x20gs',_0xe47e('0x7'),util['inspect'](_0x333b1c,{'showHidden':![],'depth':null}),_0x585e3c,_0x2b870e);_0x294b98(_0x333b1c);}_0x1c1e43(_0x585e3c);});});}; \ No newline at end of file +var _0x0f31=['exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x583490,_0x365b39){var _0x22a814=function(_0x5a9cc1){while(--_0x5a9cc1){_0x583490['push'](_0x583490['shift']());}};_0x22a814(++_0x365b39);}(_0x0f31,0xb6));var _0x10f3=function(_0x26ae3e,_0xa7b43f){_0x26ae3e=_0x26ae3e-0x0;var _0x3788a2=_0x0f31[_0x26ae3e];return _0x3788a2;};'use strict';var util=require(_0x10f3('0x0'));var logger=require(_0x10f3('0x1'))(_0x10f3('0x2'));var BPromise=require(_0x10f3('0x3'));var exec=require(_0x10f3('0x4'))[_0x10f3('0x5')];exports[_0x10f3('0x6')]=function(_0x4990b3){return new BPromise(function(_0x4344a8,_0x53a6de){exec(_0x4990b3,function(_0x45c369,_0x399eaf,_0x416e3d){logger[_0x10f3('0x7')](_0x10f3('0x8'),_0x399eaf);if(_0x45c369){logger['info'](_0x10f3('0x8'),_0x10f3('0x9'),util[_0x10f3('0xa')](_0x45c369,{'showHidden':![],'depth':null}),_0x399eaf,_0x416e3d);_0x53a6de(_0x45c369);}_0x4344a8(_0x399eaf);});});}; \ 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 b9f686c..78dfb66 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 _0xd66f=['\x22%s\x22\x20<%s>','util','lodash','fax','message','logger','info','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd66f,0x139));var _0xfd66=function(_0x1481ad,_0x2d3888){_0x1481ad=_0x1481ad-0x0;var _0x5ef3cb=_0xd66f[_0x1481ad];return _0x5ef3cb;};'use strict';var util=require(_0xfd66('0x0'));var _=require(_0xfd66('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0xfd66('0x2'));exports[_0xfd66('0x3')]=function(_0x5a7de1){return{'message':_0x5a7de1};};exports[_0xfd66('0x4')]=function(_0x29c4f5,_0x42e03c){logger[_0xfd66('0x5')](_0x29c4f5,util['inspect'](_0x42e03c,{'showHidden':![],'depth':null}));};exports[_0xfd66('0x6')]=function(_0x34df68,_0x308d05){var _0x25cd80={'XMF-ECM':_0x308d05[_0xfd66('0x7')],'XMF-HEADERINFO':_0x308d05[_0xfd66('0x8')],'XMF-MINRATE':_0x308d05[_0xfd66('0x9')],'XMF-MAXRATE':_0x308d05[_0xfd66('0xa')],'XMF-MODEM':util[_0xfd66('0xb')](_0xfd66('0xc'),_0x308d05[_0xfd66('0xd')]),'XMF-GATEWAY':_0x308d05[_0xfd66('0xe')],'XMF-FAXDETECT':_0x308d05['faxdetect'],'XMF-T38TIMEOUT':_0x308d05[_0xfd66('0xf')],'XMF-LOCALSTATIONID':_0x308d05[_0xfd66('0x10')],'XMF-PATH':_0x34df68[_0xfd66('0x11')]};return _0x25cd80;};exports[_0xfd66('0x12')]=function(_0xf47204,_0x2f728f){return{'actionid':_0xf47204[_0xfd66('0x13')],'action':_0xfd66('0x14'),'channel':_0xf47204[_0xfd66('0x15')],'Exten':'xcally-motion-fax','Context':_0xfd66('0x16'),'Priority':'1','callerid':util[_0xfd66('0xb')](_0xfd66('0x17'),_0xf47204['headerinfo']?_0xf47204[_0xfd66('0x8')]:'',_0xf47204[_0xfd66('0x10')]),'variable':_0x2f728f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xf47204[_0xfd66('0x13')]};}; \ No newline at end of file +var _0xe778=['ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','message','info','inspect','addVariables'];(function(_0x2a8879,_0x4afe54){var _0x30c04c=function(_0x20fc2d){while(--_0x20fc2d){_0x2a8879['push'](_0x2a8879['shift']());}};_0x30c04c(++_0x4afe54);}(_0xe778,0x149));var _0x8e77=function(_0x270448,_0x21d49b){_0x270448=_0x270448-0x0;var _0x1de6ca=_0xe778[_0x270448];return _0x1de6ca;};'use strict';var util=require(_0x8e77('0x0'));var _=require(_0x8e77('0x1'));var moment=require(_0x8e77('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0x8e77('0x3')]=function(_0x57d482){return{'message':_0x57d482};};exports['logger']=function(_0x468ec6,_0x5c7a5b){logger[_0x8e77('0x4')](_0x468ec6,util[_0x8e77('0x5')](_0x5c7a5b,{'showHidden':![],'depth':null}));};exports[_0x8e77('0x6')]=function(_0x40b0a3,_0x411e01){var _0x3bca6e={'XMF-ECM':_0x411e01[_0x8e77('0x7')],'XMF-HEADERINFO':_0x411e01[_0x8e77('0x8')],'XMF-MINRATE':_0x411e01[_0x8e77('0x9')],'XMF-MAXRATE':_0x411e01[_0x8e77('0xa')],'XMF-MODEM':util[_0x8e77('0xb')](_0x8e77('0xc'),_0x411e01[_0x8e77('0xd')]),'XMF-GATEWAY':_0x411e01[_0x8e77('0xe')],'XMF-FAXDETECT':_0x411e01[_0x8e77('0xf')],'XMF-T38TIMEOUT':_0x411e01['t38timeout'],'XMF-LOCALSTATIONID':_0x411e01[_0x8e77('0x10')],'XMF-PATH':_0x40b0a3[_0x8e77('0x11')]};return _0x3bca6e;};exports[_0x8e77('0x12')]=function(_0xfb6c8f,_0x573041){return{'actionid':_0xfb6c8f[_0x8e77('0x13')],'action':_0x8e77('0x14'),'channel':_0xfb6c8f[_0x8e77('0x15')],'Exten':'xcally-motion-fax','Context':_0x8e77('0x16'),'Priority':'1','callerid':util[_0x8e77('0xb')](_0x8e77('0x17'),_0xfb6c8f[_0x8e77('0x8')]?_0xfb6c8f[_0x8e77('0x8')]:'',_0xfb6c8f[_0x8e77('0x10')]),'variable':_0x573041,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xfb6c8f[_0x8e77('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index fbb5692..2d0d7d9 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 _0xdea6=['sync','bluebird','util','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','then','initAgents','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','listen'];(function(_0x56f223,_0x1e6f08){var _0x1cedbb=function(_0x9d31b){while(--_0x9d31b){_0x56f223['push'](_0x56f223['shift']());}};_0x1cedbb(++_0x1e6f08);}(_0xdea6,0x83));var _0x6dea=function(_0x256a0a,_0x1cb1b4){_0x256a0a=_0x256a0a-0x0;var _0xfb938=_0xdea6[_0x256a0a];return _0xfb938;};'use strict';var BPromise=require(_0x6dea('0x0'));var util=require(_0x6dea('0x1'));var moment=require('moment');var server=require(_0x6dea('0x2'));var Realtime=require(_0x6dea('0x3'));var Report=require(_0x6dea('0x4'));var Acw=require(_0x6dea('0x5'));var Trigger=require(_0x6dea('0x6'));var Dialer=require('./dialer');var Preview=require(_0x6dea('0x7'));var Fax=require(_0x6dea('0x8'));var user=require(_0x6dea('0x9'));var voiceQueue=require(_0x6dea('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x6dea('0xb'));var trigger=require('./rpc/trigger');var template=require(_0x6dea('0xc'));var cmHopperHistory=require(_0x6dea('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x6dea('0xe'));var faxAccount=require(_0x6dea('0xf'));var zendesk=require(_0x6dea('0x10'));var salesforce=require(_0x6dea('0x11'));var sugarcrm=require(_0x6dea('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x6dea('0x13'));var zoho=require(_0x6dea('0x14'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x6dea('0x15'));var dynamics365=require(_0x6dea('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('../../config/logger')(_0x6dea('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6dea('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6dea('0x18')](_0x6dea('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x6dea('0x1a')](user['getAgents']())[_0x6dea('0x1a')](realtime[_0x6dea('0x1b')]())[_0x6dea('0x1a')](user['getTelephones']())[_0x6dea('0x1a')](realtime['initTelephones']())[_0x6dea('0x1a')](trunk[_0x6dea('0x1c')]())[_0x6dea('0x1a')](realtime[_0x6dea('0x1d')]())['then'](voiceQueue['getVoiceQueues']())[_0x6dea('0x1a')](realtime[_0x6dea('0x1e')]())[_0x6dea('0x1a')](trigger[_0x6dea('0x1f')]())['then'](realtime[_0x6dea('0x20')]())['then'](template['getTemplates']())[_0x6dea('0x1a')](realtime['initTemplates']())[_0x6dea('0x1a')](zendesk[_0x6dea('0x21')]())['then'](realtime[_0x6dea('0x22')]())['then'](salesforce[_0x6dea('0x23')]())['then'](realtime['initSalesforceAccounts']())[_0x6dea('0x1a')](sugarcrm[_0x6dea('0x24')]())['then'](realtime[_0x6dea('0x25')]())[_0x6dea('0x1a')](freshdesk[_0x6dea('0x26')]())[_0x6dea('0x1a')](realtime[_0x6dea('0x27')]())[_0x6dea('0x1a')](desk[_0x6dea('0x28')]())['then'](realtime[_0x6dea('0x29')]())[_0x6dea('0x1a')](zoho[_0x6dea('0x2a')]())[_0x6dea('0x1a')](realtime[_0x6dea('0x2b')]())['then'](vtiger[_0x6dea('0x2c')]())[_0x6dea('0x1a')](realtime['initVtigerAccounts']())[_0x6dea('0x1a')](freshsales['getFreshsalesAccounts']())['then'](realtime['initFreshsalesAccounts']())[_0x6dea('0x1a')](servicenow[_0x6dea('0x2d')]())[_0x6dea('0x1a')](realtime[_0x6dea('0x2e')]())[_0x6dea('0x1a')](dynamics365[_0x6dea('0x2f')]())['then'](realtime['initDynamics365Accounts']())[_0x6dea('0x1a')](campaign[_0x6dea('0x30')]())[_0x6dea('0x1a')](realtime['initCampaigns']())['then'](voiceExtension[_0x6dea('0x31')]())['then'](realtime[_0x6dea('0x32')]())[_0x6dea('0x1a')](faxAccount[_0x6dea('0x33')]())[_0x6dea('0x1a')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x6dea('0x34')]()[_0x6dea('0x1a')](voiceQueueReport[_0x6dea('0x35')]())[_0x6dea('0x1a')](realtime[_0x6dea('0x36')]())[_0x6dea('0x1a')](cmHopperHistory[_0x6dea('0x37')]())[_0x6dea('0x1a')](realtime[_0x6dea('0x38')]())[_0x6dea('0x1a')](cmHopperHistory[_0x6dea('0x39')]())[_0x6dea('0x1a')](realtime[_0x6dea('0x3a')]())[_0x6dea('0x1a')](voiceCallReport[_0x6dea('0x3b')]())[_0x6dea('0x1a')](realtime[_0x6dea('0x3c')]())[_0x6dea('0x3d')](function(_0x11739a){logger[_0x6dea('0x3e')]('[index.js][initParams]',util['inspect'](_0x11739a,{'showHidden':![],'depth':null}));});}function main(){return server[_0x6dea('0x3f')](realtime,preview,fax)[_0x6dea('0x1a')](function(_0x9a487d){return initRealtime();})[_0x6dea('0x1a')](function(){return initParams();})[_0x6dea('0x1a')](function(){report[_0x6dea('0x40')]();setInterval(initRealtime,0x1388);})[_0x6dea('0x3d')](function(_0xce5e22){logger[_0x6dea('0x3e')]('[index.js][main]',util['inspect'](_0xce5e22,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xdfdf=['./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','get','resolve','then','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','util','./server','./acw','./trigger','./dialer','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount'];(function(_0x4e3397,_0x20951a){var _0x4398c6=function(_0x187045){while(--_0x187045){_0x4e3397['push'](_0x4e3397['shift']());}};_0x4398c6(++_0x20951a);}(_0xdfdf,0xbc));var _0xfdfd=function(_0x54fc37,_0x1e2974){_0x54fc37=_0x54fc37-0x0;var _0x4abfda=_0xdfdf[_0x54fc37];return _0x4abfda;};'use strict';var BPromise=require(_0xfdfd('0x0'));var util=require(_0xfdfd('0x1'));var moment=require('moment');var server=require(_0xfdfd('0x2'));var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0xfdfd('0x3'));var Trigger=require(_0xfdfd('0x4'));var Dialer=require(_0xfdfd('0x5'));var Preview=require('./preview');var Fax=require(_0xfdfd('0x6'));var user=require('./rpc/user');var voiceQueue=require(_0xfdfd('0x7'));var voiceQueueReport=require(_0xfdfd('0x8'));var voiceCallReport=require(_0xfdfd('0x9'));var trunk=require(_0xfdfd('0xa'));var trigger=require(_0xfdfd('0xb'));var template=require(_0xfdfd('0xc'));var cmHopperHistory=require(_0xfdfd('0xd'));var campaign=require(_0xfdfd('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xfdfd('0xf'));var zendesk=require(_0xfdfd('0x10'));var salesforce=require(_0xfdfd('0x11'));var sugarcrm=require(_0xfdfd('0x12'));var freshdesk=require(_0xfdfd('0x13'));var desk=require(_0xfdfd('0x14'));var zoho=require(_0xfdfd('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xfdfd('0x16'));var servicenow=require(_0xfdfd('0x17'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xfdfd('0x18'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xfdfd('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xfdfd('0x19')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xfdfd('0x1a')]()[_0xfdfd('0x1b')](user['getAgents']())[_0xfdfd('0x1b')](realtime['initAgents']())[_0xfdfd('0x1b')](user[_0xfdfd('0x1c')]())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x1d')]())['then'](trunk[_0xfdfd('0x1e')]())[_0xfdfd('0x1b')](realtime['initTrunks']())[_0xfdfd('0x1b')](voiceQueue[_0xfdfd('0x1f')]())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x20')]())['then'](trigger['getTriggers']())[_0xfdfd('0x1b')](realtime['initTriggers']())['then'](template['getTemplates']())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x21')]())[_0xfdfd('0x1b')](zendesk[_0xfdfd('0x22')]())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x23')]())[_0xfdfd('0x1b')](salesforce['getSalesforceAccounts']())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x24')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x25')]())['then'](freshdesk[_0xfdfd('0x26')]())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x27')]())[_0xfdfd('0x1b')](desk[_0xfdfd('0x28')]())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x29')]())[_0xfdfd('0x1b')](zoho[_0xfdfd('0x2a')]())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x2b')]())[_0xfdfd('0x1b')](vtiger['getVtigerAccounts']())['then'](realtime[_0xfdfd('0x2c')]())[_0xfdfd('0x1b')](freshsales[_0xfdfd('0x2d')]())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x2e')]())[_0xfdfd('0x1b')](servicenow[_0xfdfd('0x2f')]())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x30')]())[_0xfdfd('0x1b')](dynamics365[_0xfdfd('0x31')]())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x32')]())[_0xfdfd('0x1b')](campaign[_0xfdfd('0x33')]())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x34')]())[_0xfdfd('0x1b')](voiceExtension['getVoiceExtensions']())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x35')]())[_0xfdfd('0x1b')](faxAccount[_0xfdfd('0x36')]())[_0xfdfd('0x1b')](realtime['initFaxAccounts']())[_0xfdfd('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0xfdfd('0x1a')]()[_0xfdfd('0x1b')](voiceQueueReport[_0xfdfd('0x37')]())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x38')]())[_0xfdfd('0x1b')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0xfdfd('0x39')]())['then'](cmHopperHistory[_0xfdfd('0x3a')]())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x3b')]())['then'](voiceCallReport['getVoiceCallReports']())[_0xfdfd('0x1b')](realtime[_0xfdfd('0x3c')]())[_0xfdfd('0x3d')](function(_0x1138bc){logger[_0xfdfd('0x3e')](_0xfdfd('0x3f'),util[_0xfdfd('0x40')](_0x1138bc,{'showHidden':![],'depth':null}));});}function main(){return server[_0xfdfd('0x41')](realtime,preview,fax)[_0xfdfd('0x1b')](function(_0x29603b){return initRealtime();})[_0xfdfd('0x1b')](function(){return initParams();})['then'](function(){report[_0xfdfd('0x42')]();setInterval(initRealtime,0x1388);})[_0xfdfd('0x3d')](function(_0x5ad191){logger['error'](_0xfdfd('0x43'),util[_0xfdfd('0x40')](_0x5ad191,{'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 1e8579b..70545ba 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 _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x1e0275,_0xa03a44){var _0x2f7e29=function(_0x3b7430){while(--_0x3b7430){_0x1e0275['push'](_0x1e0275['shift']());}};_0x2f7e29(++_0xa03a44);}(_0x70e0,0x17b));var _0x070e=function(_0x5ea540,_0x41b543){_0x5ea540=_0x5ea540-0x0;var _0x49a8e0=_0x70e0[_0x5ea540];return _0x49a8e0;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x561ff6,_0x2beeb1){var _0x18826c=function(_0x5c0293){while(--_0x5c0293){_0x561ff6['push'](_0x561ff6['shift']());}};_0x18826c(++_0x2beeb1);}(_0x70e0,0x17b));var _0x070e=function(_0x2e3eb0,_0x18c166){_0x2e3eb0=_0x2e3eb0-0x0;var _0x13cc74=_0x70e0[_0x2e3eb0];return _0x13cc74;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index e65e675..b3966c6 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 _0x8222=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8222,0x1b9));var _0x2822=function(_0x4f3942,_0x5113b6){_0x4f3942=_0x4f3942-0x0;var _0x1c2af5=_0x8222[_0x4f3942];return _0x1c2af5;};'use strict';function Campaign(_0x181da7){this['id']=_0x181da7['id']||0x0;this['name']=_0x181da7[_0x2822('0x0')]||'';this[_0x2822('0x1')]=_0x181da7[_0x2822('0x1')]||_0x2822('0x2');this['originated']=0x0;this['temp']=0x0;this[_0x2822('0x3')]=0x0;this[_0x2822('0x4')]=0x0;this[_0x2822('0x5')]='';this[_0x2822('0x6')]=!![];this[_0x2822('0x7')]=_0x181da7[_0x2822('0x7')];this[_0x2822('0x8')]=_0x181da7[_0x2822('0x8')];this[_0x2822('0x9')]=_0x181da7['dialTimezone']||null;this[_0x2822('0xa')]=_0x181da7['dialGlobalInterval']?_0x181da7[_0x2822('0xa')]:null;this[_0x2822('0xb')]=_0x181da7[_0x2822('0xb')];this[_0x2822('0xc')]=_0x181da7[_0x2822('0xc')];this[_0x2822('0xd')]=_0x181da7[_0x2822('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x181da7[_0x2822('0xe')];this[_0x2822('0xf')]=_0x181da7[_0x2822('0xf')];this[_0x2822('0x10')]=_0x181da7[_0x2822('0x10')];this[_0x2822('0x11')]=_0x181da7[_0x2822('0x11')];this[_0x2822('0x12')]=_0x181da7['dialNoAnswerMaxRetry'];this[_0x2822('0x13')]=_0x181da7[_0x2822('0x13')];this[_0x2822('0x14')]=_0x181da7[_0x2822('0x14')];this[_0x2822('0x15')]=_0x181da7[_0x2822('0x15')]||0x3;this[_0x2822('0x16')]=_0x181da7[_0x2822('0x16')]||0x96;this[_0x2822('0x17')]=_0x181da7[_0x2822('0x17')]||0x3;this[_0x2822('0x18')]=_0x181da7[_0x2822('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x181da7['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x181da7[_0x2822('0x19')]||0x96;this['dialMachineMaxRetry']=_0x181da7['dialMachineMaxRetry']||0x3;this[_0x2822('0x1a')]=_0x181da7['dialMachineRetryFrequency']||0x96;this[_0x2822('0x1b')]=_0x181da7[_0x2822('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x181da7[_0x2822('0x1c')]||0x96;this[_0x2822('0x1d')]=_0x181da7['dialOrderByScheduledAt']||_0x2822('0x1e');this[_0x2822('0x1f')]=_0x181da7['dialPrefix']||undefined;this[_0x2822('0x20')]=_0x181da7[_0x2822('0x20')]||undefined;this[_0x2822('0x21')]=_0x181da7[_0x2822('0x21')]||undefined;this[_0x2822('0x22')]=_0x181da7['TrunkBackup']?_0x181da7[_0x2822('0x22')]:undefined;this['Trunk']=_0x181da7[_0x2822('0x23')]?_0x181da7[_0x2822('0x23')]:undefined;this[_0x2822('0x24')]=_0x181da7[_0x2822('0x24')]?_0x181da7[_0x2822('0x24')]:undefined;this[_0x2822('0x25')]=_0x181da7[_0x2822('0x25')]?_0x181da7['SquareProject']:undefined;this['dialQueueProject']=_0x181da7[_0x2822('0x25')]?_0x181da7[_0x2822('0x25')]['name']:undefined;this[_0x2822('0x26')]=_0x181da7[_0x2822('0x26')]||![];this[_0x2822('0x27')]=_0x181da7['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x181da7[_0x2822('0x28')];this[_0x2822('0x29')]=_0x181da7[_0x2822('0x29')];this['dialAMDTotalAnalysisTime']=_0x181da7['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x181da7[_0x2822('0x2a')];this[_0x2822('0x2b')]=_0x181da7[_0x2822('0x2b')];this[_0x2822('0x2c')]=_0x181da7[_0x2822('0x2c')];this[_0x2822('0x2d')]=_0x181da7[_0x2822('0x2d')];this[_0x2822('0x2e')]=_0x181da7[_0x2822('0x2e')];}module['exports']=Campaign; \ No newline at end of file +var _0x07f1=['dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','active','limitCalls','dialTimezone'];(function(_0x36cb6f,_0x14c0c0){var _0xa0b59b=function(_0xd09039){while(--_0xd09039){_0x36cb6f['push'](_0x36cb6f['shift']());}};_0xa0b59b(++_0x14c0c0);}(_0x07f1,0x11f));var _0x107f=function(_0x3a1ff1,_0x2ddc90){_0x3a1ff1=_0x3a1ff1-0x0;var _0x3a1957=_0x07f1[_0x3a1ff1];return _0x3a1957;};'use strict';function Campaign(_0x329d3b){this['id']=_0x329d3b['id']||0x0;this[_0x107f('0x0')]=_0x329d3b[_0x107f('0x0')]||'';this[_0x107f('0x1')]=_0x329d3b['type']||'campaign';this[_0x107f('0x2')]=0x0;this[_0x107f('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x329d3b[_0x107f('0x4')];this[_0x107f('0x5')]=_0x329d3b[_0x107f('0x5')];this[_0x107f('0x6')]=_0x329d3b[_0x107f('0x6')]||null;this['dialGlobalInterval']=_0x329d3b[_0x107f('0x7')]?_0x329d3b[_0x107f('0x7')]:null;this[_0x107f('0x8')]=_0x329d3b[_0x107f('0x8')];this[_0x107f('0x9')]=_0x329d3b[_0x107f('0x9')];this[_0x107f('0xa')]=_0x329d3b[_0x107f('0xa')]||0x1e;this[_0x107f('0xb')]=_0x329d3b[_0x107f('0xb')];this[_0x107f('0xc')]=_0x329d3b[_0x107f('0xc')];this[_0x107f('0xd')]=_0x329d3b[_0x107f('0xd')];this[_0x107f('0xe')]=_0x329d3b[_0x107f('0xe')];this['dialNoAnswerMaxRetry']=_0x329d3b[_0x107f('0xf')];this[_0x107f('0x10')]=_0x329d3b[_0x107f('0x10')];this[_0x107f('0x11')]=_0x329d3b[_0x107f('0x11')];this[_0x107f('0x12')]=_0x329d3b[_0x107f('0x12')]||0x3;this[_0x107f('0x13')]=_0x329d3b[_0x107f('0x13')]||0x96;this[_0x107f('0x14')]=_0x329d3b[_0x107f('0x14')]||0x3;this[_0x107f('0x15')]=_0x329d3b[_0x107f('0x15')]||0x96;this[_0x107f('0x16')]=_0x329d3b[_0x107f('0x16')]||0x3;this[_0x107f('0x17')]=_0x329d3b[_0x107f('0x17')]||0x96;this[_0x107f('0x18')]=_0x329d3b[_0x107f('0x18')]||0x3;this[_0x107f('0x19')]=_0x329d3b[_0x107f('0x19')]||0x96;this[_0x107f('0x1a')]=_0x329d3b[_0x107f('0x1a')]||0x3;this[_0x107f('0x1b')]=_0x329d3b[_0x107f('0x1b')]||0x96;this[_0x107f('0x1c')]=_0x329d3b[_0x107f('0x1c')]||_0x107f('0x1d');this[_0x107f('0x1e')]=_0x329d3b[_0x107f('0x1e')]||undefined;this[_0x107f('0x1f')]=_0x329d3b['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x107f('0x20')]=_0x329d3b['dialCutDigit']||undefined;this[_0x107f('0x21')]=_0x329d3b[_0x107f('0x21')]?_0x329d3b[_0x107f('0x21')]:undefined;this[_0x107f('0x22')]=_0x329d3b['Trunk']?_0x329d3b[_0x107f('0x22')]:undefined;this['Interval']=_0x329d3b[_0x107f('0x23')]?_0x329d3b[_0x107f('0x23')]:undefined;this[_0x107f('0x24')]=_0x329d3b[_0x107f('0x24')]?_0x329d3b['SquareProject']:undefined;this[_0x107f('0x25')]=_0x329d3b[_0x107f('0x24')]?_0x329d3b[_0x107f('0x24')][_0x107f('0x0')]:undefined;this[_0x107f('0x26')]=_0x329d3b[_0x107f('0x26')]||![];this['dialAMDInitialSilence']=_0x329d3b[_0x107f('0x27')];this[_0x107f('0x28')]=_0x329d3b[_0x107f('0x28')];this['dialAMDAfterGreetingSilence']=_0x329d3b[_0x107f('0x29')];this[_0x107f('0x2a')]=_0x329d3b[_0x107f('0x2a')];this[_0x107f('0x2b')]=_0x329d3b[_0x107f('0x2b')];this[_0x107f('0x2c')]=_0x329d3b[_0x107f('0x2c')];this[_0x107f('0x2d')]=_0x329d3b[_0x107f('0x2d')];this[_0x107f('0x2e')]=_0x329d3b[_0x107f('0x2e')];this['dialAMDMaximumWordLength']=_0x329d3b[_0x107f('0x2f')];}module[_0x107f('0x30')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index ea43f7b..936c034 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 _0xdd6e=['calleridnum','connectedlinenum','connectedlinename','accountcode','context','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','duration','type','tag','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel'];(function(_0x5608bc,_0x4d7322){var _0x2de34f=function(_0x3be907){while(--_0x3be907){_0x5608bc['push'](_0x5608bc['shift']());}};_0x2de34f(++_0x4d7322);}(_0xdd6e,0xa5));var _0xedd6=function(_0x1488f3,_0xe8a2de){_0x1488f3=_0x1488f3-0x0;var _0x30819c=_0xdd6e[_0x1488f3];return _0x30819c;};'use strict';function Channel(){this[_0xedd6('0x0')]=null;this[_0xedd6('0x1')]='';this[_0xedd6('0x2')]='';this[_0xedd6('0x3')]=0x0;this['calleridname']='';this[_0xedd6('0x4')]=undefined;this[_0xedd6('0x5')]=undefined;this[_0xedd6('0x6')]=0x0;this[_0xedd6('0x7')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0xedd6('0x8')]=![];this[_0xedd6('0x9')]=null;this['endtime']=null;this[_0xedd6('0xa')]=![];this[_0xedd6('0xb')]=![];this[_0xedd6('0xc')]='';this[_0xedd6('0xd')]='';this[_0xedd6('0xe')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0xedd6('0xf')]=null;this[_0xedd6('0x10')]=null;this['disposition']=null;this[_0xedd6('0x11')]=![];this[_0xedd6('0x12')]=null;this[_0xedd6('0x13')]=null;this[_0xedd6('0x14')]=[];this['transfercalleridnum']=undefined;this[_0xedd6('0x15')]=undefined;this['transferType']=undefined;this[_0xedd6('0x16')]=0x0;}module[_0xedd6('0x17')]=Channel; \ No newline at end of file +var _0xfa25=['mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','exten','answered','unmanaged','lastapplication','lastdata','duration','holdtime','type','tag','monitor','monitors','transfercalleridnum','transferType'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa25,0xd1));var _0x5fa2=function(_0x4b98f5,_0x58984e){_0x4b98f5=_0x4b98f5-0x0;var _0x2b09f4=_0xfa25[_0x4b98f5];return _0x2b09f4;};'use strict';function Channel(){this['starttime']=null;this[_0x5fa2('0x0')]='';this[_0x5fa2('0x1')]='';this[_0x5fa2('0x2')]=0x0;this[_0x5fa2('0x3')]='';this[_0x5fa2('0x4')]=undefined;this[_0x5fa2('0x5')]=undefined;this[_0x5fa2('0x6')]=0x0;this[_0x5fa2('0x7')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x5fa2('0x8')]=0x0;this[_0x5fa2('0x9')]=![];this['answertime']=null;this['endtime']=null;this[_0x5fa2('0xa')]=![];this['abandoned']=![];this[_0x5fa2('0xb')]='';this[_0x5fa2('0xc')]='';this[_0x5fa2('0xd')]=0x0;this['billableseconds']=0x0;this[_0x5fa2('0xe')]=0x0;this[_0x5fa2('0xf')]=null;this[_0x5fa2('0x10')]=null;this['disposition']=null;this[_0x5fa2('0x11')]=![];this['monitorFilename']=null;this['queue']=null;this[_0x5fa2('0x12')]=[];this[_0x5fa2('0x13')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x5fa2('0x14')]=undefined;this[_0x5fa2('0x15')]=0x0;}module[_0x5fa2('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 3d895c7..db2961c 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 _0xbff2=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x19c137,_0x59a19f){var _0x3c2af0=function(_0x42a6f8){while(--_0x42a6f8){_0x19c137['push'](_0x19c137['shift']());}};_0x3c2af0(++_0x59a19f);}(_0xbff2,0x158));var _0x2bff=function(_0x421bab,_0x4538b5){_0x421bab=_0x421bab-0x0;var _0x273ad8=_0xbff2[_0x421bab];return _0x273ad8;};'use strict';function DeskAccount(_0x2752fe){this['id']=_0x2752fe['id']||0x0;this[_0x2bff('0x0')]=_0x2752fe[_0x2bff('0x0')]||'';this[_0x2bff('0x1')]=_0x2752fe[_0x2bff('0x1')]||'';this[_0x2bff('0x2')]=_0x2752fe[_0x2bff('0x2')]||'';this['authType']=_0x2752fe[_0x2bff('0x3')]||'';this['password']=_0x2752fe[_0x2bff('0x4')]||'';this['consumerKey']=_0x2752fe[_0x2bff('0x5')]||'';this[_0x2bff('0x6')]=_0x2752fe['consumerSecret']||'';this[_0x2bff('0x7')]=_0x2752fe['token']||'';this[_0x2bff('0x8')]=_0x2752fe[_0x2bff('0x8')]||'';this[_0x2bff('0x9')]=_0x2752fe[_0x2bff('0x9')]||'';this['serverUrl']=_0x2752fe[_0x2bff('0xa')]||'';this[_0x2bff('0xb')]=_0x2752fe[_0x2bff('0xb')]||{};}module[_0x2bff('0xc')]=DeskAccount; \ No newline at end of file +var _0xcbe8=['Configurations','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','serverUrl'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcbe8,0x173));var _0x8cbe=function(_0x4d2b0b,_0x487116){_0x4d2b0b=_0x4d2b0b-0x0;var _0x4d4dce=_0xcbe8[_0x4d2b0b];return _0x4d4dce;};'use strict';function DeskAccount(_0x6f2cb8){this['id']=_0x6f2cb8['id']||0x0;this['name']=_0x6f2cb8['name']||'';this[_0x8cbe('0x0')]=_0x6f2cb8[_0x8cbe('0x0')]||'';this[_0x8cbe('0x1')]=_0x6f2cb8[_0x8cbe('0x1')]||'';this[_0x8cbe('0x2')]=_0x6f2cb8[_0x8cbe('0x2')]||'';this[_0x8cbe('0x3')]=_0x6f2cb8['password']||'';this[_0x8cbe('0x4')]=_0x6f2cb8[_0x8cbe('0x4')]||'';this[_0x8cbe('0x5')]=_0x6f2cb8[_0x8cbe('0x5')]||'';this[_0x8cbe('0x6')]=_0x6f2cb8[_0x8cbe('0x6')]||'';this[_0x8cbe('0x7')]=_0x6f2cb8['tokenSecret']||'';this['type']=_0x6f2cb8['type']||'';this[_0x8cbe('0x8')]=_0x6f2cb8[_0x8cbe('0x8')]||'';this[_0x8cbe('0x9')]=_0x6f2cb8['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 1e68b12..13b7b30 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 _0xb625=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','CloudProvider','exports','name'];(function(_0x898be8,_0x3bedaa){var _0xd5b23f=function(_0x2332d4){while(--_0x2332d4){_0x898be8['push'](_0x898be8['shift']());}};_0xd5b23f(++_0x3bedaa);}(_0xb625,0x1e3));var _0x5b62=function(_0x4de003,_0x1677e9){_0x4de003=_0x4de003-0x0;var _0x2875b9=_0xb625[_0x4de003];return _0x2875b9;};'use strict';function Dynamics365Account(_0x2eeab4){this['id']=_0x2eeab4['id']||0x0;this[_0x5b62('0x0')]=_0x2eeab4[_0x5b62('0x0')]||'';this[_0x5b62('0x1')]=_0x2eeab4['username']||'';this[_0x5b62('0x2')]=_0x2eeab4[_0x5b62('0x2')]||'';this[_0x5b62('0x3')]=_0x2eeab4['remoteUri']||'';this[_0x5b62('0x4')]=_0x2eeab4[_0x5b62('0x4')]||'';this[_0x5b62('0x5')]=_0x2eeab4[_0x5b62('0x5')]||'';this[_0x5b62('0x6')]=_0x2eeab4['clientSecret']||{};this[_0x5b62('0x7')]=_0x2eeab4[_0x5b62('0x7')]||'';this['modernAuthentication']=_0x2eeab4['modernAuthentication']||![];this['Configurations']=_0x2eeab4[_0x5b62('0x8')]||{};this[_0x5b62('0x9')]=_0x2eeab4[_0x5b62('0x9')]||{};}module[_0x5b62('0xa')]=Dynamics365Account; \ No newline at end of file +var _0xd542=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x47d42a,_0x582563){var _0x39eaac=function(_0x563dff){while(--_0x563dff){_0x47d42a['push'](_0x47d42a['shift']());}};_0x39eaac(++_0x582563);}(_0xd542,0xf0));var _0x2d54=function(_0x2e8ea0,_0x1a21ef){_0x2e8ea0=_0x2e8ea0-0x0;var _0x76618e=_0xd542[_0x2e8ea0];return _0x76618e;};'use strict';function Dynamics365Account(_0x566629){this['id']=_0x566629['id']||0x0;this[_0x2d54('0x0')]=_0x566629[_0x2d54('0x0')]||'';this[_0x2d54('0x1')]=_0x566629['username']||'';this[_0x2d54('0x2')]=_0x566629[_0x2d54('0x2')]||'';this[_0x2d54('0x3')]=_0x566629[_0x2d54('0x3')]||'';this[_0x2d54('0x4')]=_0x566629['tenantId']||'';this[_0x2d54('0x5')]=_0x566629[_0x2d54('0x5')]||'';this[_0x2d54('0x6')]=_0x566629[_0x2d54('0x6')]||{};this[_0x2d54('0x7')]=_0x566629[_0x2d54('0x7')]||'';this[_0x2d54('0x8')]=_0x566629['modernAuthentication']||![];this[_0x2d54('0x9')]=_0x566629['Configurations']||{};this[_0x2d54('0xa')]=_0x566629['CloudProvider']||{};}module[_0x2d54('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index f925d1e..2d988b1 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 _0x72a1=['minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','description','ecm','headerinfo','localstationid'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x72a1,0x172));var _0x172a=function(_0x559d2b,_0x1e0cca){_0x559d2b=_0x559d2b-0x0;var _0x38bcc0=_0x72a1[_0x559d2b];return _0x38bcc0;};'use strict';function FaxAccount(_0x52d0bd){this['id']=_0x52d0bd['id']||0x0;this['name']=_0x52d0bd['name']||'';this[_0x172a('0x0')]=_0x52d0bd['description'];this['ecm']=_0x52d0bd[_0x172a('0x1')];this[_0x172a('0x2')]=_0x52d0bd[_0x172a('0x2')];this[_0x172a('0x3')]=_0x52d0bd[_0x172a('0x3')];this[_0x172a('0x4')]=_0x52d0bd[_0x172a('0x4')]||0x960;this[_0x172a('0x5')]=_0x52d0bd[_0x172a('0x5')]||0x3840;this[_0x172a('0x6')]=_0x52d0bd[_0x172a('0x6')]||_0x172a('0x7');this[_0x172a('0x8')]=_0x52d0bd[_0x172a('0x8')]||'no';this[_0x172a('0x9')]=_0x52d0bd['faxdetect']||'no';this[_0x172a('0xa')]=_0x52d0bd[_0x172a('0xa')]||0x1388;this[_0x172a('0xb')]=_0x52d0bd[_0x172a('0xb')]||_0x172a('0xc');this[_0x172a('0xd')]=_0x52d0bd[_0x172a('0xd')]?_0x52d0bd[_0x172a('0xd')]:undefined;this[_0x172a('0xe')]=_0x52d0bd[_0x172a('0xe')];this['key']=_0x52d0bd[_0x172a('0xf')];}module[_0x172a('0x10')]=FaxAccount; \ No newline at end of file +var _0xa0a3=['t38timeout','tech','Trunk','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect'];(function(_0xe64bb4,_0x166b49){var _0xbd35f3=function(_0x121558){while(--_0x121558){_0xe64bb4['push'](_0xe64bb4['shift']());}};_0xbd35f3(++_0x166b49);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x337305,_0x38cf8a){_0x337305=_0x337305-0x0;var _0x33eac4=_0xa0a3[_0x337305];return _0x33eac4;};'use strict';function FaxAccount(_0x5e6a97){this['id']=_0x5e6a97['id']||0x0;this[_0x3a0a('0x0')]=_0x5e6a97[_0x3a0a('0x0')]||'';this['description']=_0x5e6a97[_0x3a0a('0x1')];this[_0x3a0a('0x2')]=_0x5e6a97[_0x3a0a('0x2')];this[_0x3a0a('0x3')]=_0x5e6a97[_0x3a0a('0x3')];this[_0x3a0a('0x4')]=_0x5e6a97[_0x3a0a('0x4')];this[_0x3a0a('0x5')]=_0x5e6a97[_0x3a0a('0x5')]||0x960;this[_0x3a0a('0x6')]=_0x5e6a97[_0x3a0a('0x6')]||0x3840;this[_0x3a0a('0x7')]=_0x5e6a97[_0x3a0a('0x7')]||'v17,v27,v29';this['gateway']=_0x5e6a97[_0x3a0a('0x8')]||'no';this[_0x3a0a('0x9')]=_0x5e6a97[_0x3a0a('0x9')]||'no';this[_0x3a0a('0xa')]=_0x5e6a97[_0x3a0a('0xa')]||0x1388;this[_0x3a0a('0xb')]=_0x5e6a97[_0x3a0a('0xb')]||'SIP';this['Trunk']=_0x5e6a97[_0x3a0a('0xc')]?_0x5e6a97[_0x3a0a('0xc')]:undefined;this['ListId']=_0x5e6a97['ListId'];this[_0x3a0a('0xd')]=_0x5e6a97[_0x3a0a('0xd')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 5a4923b..8e06c03 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 _0x1c70=['Configurations','name','username','remoteUri','serverUrl'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x1c70,0x132));var _0x01c7=function(_0x332998,_0x2d99c7){_0x332998=_0x332998-0x0;var _0x460be7=_0x1c70[_0x332998];return _0x460be7;};'use strict';function FreshdeskAccount(_0x598bb0){this['id']=_0x598bb0['id']||0x0;this[_0x01c7('0x0')]=_0x598bb0[_0x01c7('0x0')]||'';this[_0x01c7('0x1')]=_0x598bb0['username']||'';this['apiKey']=_0x598bb0['token']||'';this[_0x01c7('0x2')]=_0x598bb0[_0x01c7('0x2')]||'';this[_0x01c7('0x3')]=_0x598bb0['serverUrl']||'';this[_0x01c7('0x4')]=_0x598bb0['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x29d3=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x29d3,0x87));var _0x329d=function(_0x22651f,_0x35cc9d){_0x22651f=_0x22651f-0x0;var _0x253ac9=_0x29d3[_0x22651f];return _0x253ac9;};'use strict';function FreshdeskAccount(_0x1d5ddf){this['id']=_0x1d5ddf['id']||0x0;this[_0x329d('0x0')]=_0x1d5ddf['name']||'';this[_0x329d('0x1')]=_0x1d5ddf['username']||'';this[_0x329d('0x2')]=_0x1d5ddf[_0x329d('0x3')]||'';this[_0x329d('0x4')]=_0x1d5ddf[_0x329d('0x4')]||'';this[_0x329d('0x5')]=_0x1d5ddf[_0x329d('0x5')]||'';this[_0x329d('0x6')]=_0x1d5ddf[_0x329d('0x6')]||{};}module[_0x329d('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index c9e8eb5..7d0693f 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 _0x4aa3=['exports','name','username','token','remoteUri','serverUrl','Configurations'];(function(_0x54cf8c,_0xb68c75){var _0x3ce01c=function(_0x54487d){while(--_0x54487d){_0x54cf8c['push'](_0x54cf8c['shift']());}};_0x3ce01c(++_0xb68c75);}(_0x4aa3,0x174));var _0x34aa=function(_0x1a817a,_0x3e2cde){_0x1a817a=_0x1a817a-0x0;var _0x5348ed=_0x4aa3[_0x1a817a];return _0x5348ed;};'use strict';function FreshsalesAccount(_0x45ec6e){this['id']=_0x45ec6e['id']||0x0;this[_0x34aa('0x0')]=_0x45ec6e['name']||'';this[_0x34aa('0x1')]=_0x45ec6e[_0x34aa('0x1')]||'';this['apiKey']=_0x45ec6e[_0x34aa('0x2')]||'';this[_0x34aa('0x3')]=_0x45ec6e['remoteUri']||'';this[_0x34aa('0x4')]=_0x45ec6e[_0x34aa('0x4')]||'';this[_0x34aa('0x5')]=_0x45ec6e['Configurations']||{};}module[_0x34aa('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x4cc7=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4cc7,0x1b6));var _0x74cc=function(_0x370be6,_0x17c8c8){_0x370be6=_0x370be6-0x0;var _0xb512b2=_0x4cc7[_0x370be6];return _0xb512b2;};'use strict';function FreshsalesAccount(_0x13d27d){this['id']=_0x13d27d['id']||0x0;this[_0x74cc('0x0')]=_0x13d27d[_0x74cc('0x0')]||'';this[_0x74cc('0x1')]=_0x13d27d[_0x74cc('0x1')]||'';this[_0x74cc('0x2')]=_0x13d27d[_0x74cc('0x3')]||'';this[_0x74cc('0x4')]=_0x13d27d['remoteUri']||'';this[_0x74cc('0x5')]=_0x13d27d[_0x74cc('0x5')]||'';this[_0x74cc('0x6')]=_0x13d27d[_0x74cc('0x6')]||{};}module[_0x74cc('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 6fcb3f1..df6aff4 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 _0x5439=['queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinename','context','priority','holdtime','lastAssignedTo','motionChannel','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete'];(function(_0x29b840,_0x3b70d3){var _0x359db1=function(_0x4b1630){while(--_0x4b1630){_0x29b840['push'](_0x29b840['shift']());}};_0x359db1(++_0x3b70d3);}(_0x5439,0x182));var _0x9543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5439[_0x14add3];return _0x4a174f;};'use strict';function QueueReport(){this[_0x9543('0x0')]=_0x9543('0x1');this[_0x9543('0x2')]='';this[_0x9543('0x3')]='';this[_0x9543('0x4')]='';this['queue']='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0x9543('0x5')]=0x1;this[_0x9543('0x6')]=0x1;this[_0x9543('0x7')]=![];this[_0x9543('0x8')]=null;this[_0x9543('0x9')]=![];this[_0x9543('0xa')]=null;this['queuecallerexit']=![];this[_0x9543('0xb')]=null;this[_0x9543('0xc')]=0x1;this[_0x9543('0xd')]='';this['connectedlinenum']='';this[_0x9543('0xe')]='';this['accountcode']='';this[_0x9543('0xf')]='';this['exten']='';this[_0x9543('0x10')]='';this[_0x9543('0x11')]=0x0;this['assigned']=![];this[_0x9543('0x12')]='';this[_0x9543('0x13')]='voice';this['mohtime']=0x0;this[_0x9543('0x14')]={};}module[_0x9543('0x15')]=QueueReport; \ No newline at end of file +var _0x19bf=['originalposition','channel','connectedlinenum','accountcode','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','mohtime','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt'];(function(_0xf95365,_0x9e5f23){var _0x5cee8a=function(_0x29433c){while(--_0x29433c){_0xf95365['push'](_0xf95365['shift']());}};_0x5cee8a(++_0x9e5f23);}(_0x19bf,0xa2));var _0xf19b=function(_0xd1b150,_0x114fd0){_0xd1b150=_0xd1b150-0x0;var _0x4c73bb=_0x19bf[_0xd1b150];return _0x4c73bb;};'use strict';function QueueReport(){this[_0xf19b('0x0')]='inbound';this[_0xf19b('0x1')]='';this[_0xf19b('0x2')]='';this[_0xf19b('0x3')]='';this[_0xf19b('0x4')]='';this[_0xf19b('0x5')]=null;this[_0xf19b('0x6')]=null;this[_0xf19b('0x7')]=0x1;this[_0xf19b('0x8')]=0x1;this[_0xf19b('0x9')]=![];this[_0xf19b('0xa')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0xf19b('0xb')]=![];this[_0xf19b('0xc')]=null;this[_0xf19b('0xd')]=0x1;this[_0xf19b('0xe')]='';this[_0xf19b('0xf')]='';this['connectedlinename']='';this[_0xf19b('0x10')]='';this[_0xf19b('0x11')]='';this[_0xf19b('0x12')]='';this['priority']='';this[_0xf19b('0x13')]=0x0;this[_0xf19b('0x14')]=![];this[_0xf19b('0x15')]='';this[_0xf19b('0x16')]='voice';this[_0xf19b('0x17')]=0x0;this['variables']={};}module[_0xf19b('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index c484d23..2dccb87 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 _0x5217=['name','username','remoteUri','password','clientId','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x4705ac,_0x4bdc74){var _0x1f9af6=function(_0x51dafa){while(--_0x51dafa){_0x4705ac['push'](_0x4705ac['shift']());}};_0x1f9af6(++_0x4bdc74);}(_0x5217,0xbb));var _0x7521=function(_0x4468cc,_0x32aa14){_0x4468cc=_0x4468cc-0x0;var _0x17e046=_0x5217[_0x4468cc];return _0x17e046;};'use strict';function SalesforceAccount(_0x1d50fa){this['id']=_0x1d50fa['id']||0x0;this['name']=_0x1d50fa[_0x7521('0x0')]||'';this['username']=_0x1d50fa[_0x7521('0x1')]||'';this[_0x7521('0x2')]=_0x1d50fa[_0x7521('0x2')]||'';this[_0x7521('0x3')]=_0x1d50fa['password']||'';this[_0x7521('0x4')]=_0x1d50fa['clientId']||'';this['clientSecret']=_0x1d50fa['clientSecret']||'';this[_0x7521('0x5')]=_0x1d50fa[_0x7521('0x5')]||'';this['type']=_0x1d50fa[_0x7521('0x6')]||_0x7521('0x7');this['serverUrl']=_0x1d50fa[_0x7521('0x8')]||'';this[_0x7521('0x9')]=_0x1d50fa[_0x7521('0x9')]||{};}module[_0x7521('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xf19d=['Configurations','exports','name','username','password','clientId','clientSecret','securityToken','type','serverUrl'];(function(_0x2b61a8,_0x54b839){var _0x1e6931=function(_0x107ea8){while(--_0x107ea8){_0x2b61a8['push'](_0x2b61a8['shift']());}};_0x1e6931(++_0x54b839);}(_0xf19d,0x110));var _0xdf19=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xf19d[_0x279d37];return _0x530173;};'use strict';function SalesforceAccount(_0x124b9e){this['id']=_0x124b9e['id']||0x0;this['name']=_0x124b9e[_0xdf19('0x0')]||'';this['username']=_0x124b9e[_0xdf19('0x1')]||'';this['remoteUri']=_0x124b9e['remoteUri']||'';this['password']=_0x124b9e[_0xdf19('0x2')]||'';this[_0xdf19('0x3')]=_0x124b9e[_0xdf19('0x3')]||'';this[_0xdf19('0x4')]=_0x124b9e[_0xdf19('0x4')]||'';this[_0xdf19('0x5')]=_0x124b9e[_0xdf19('0x5')]||'';this[_0xdf19('0x6')]=_0x124b9e[_0xdf19('0x6')]||'integrationTab';this[_0xdf19('0x7')]=_0x124b9e[_0xdf19('0x7')]||'';this[_0xdf19('0x8')]=_0x124b9e[_0xdf19('0x8')]||{};}module[_0xdf19('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 323bc8f..ccf8c94 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 _0x6ae5=['serverUrl','Configurations','exports','name','username','password'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0x6ae5,0xe7));var _0x56ae=function(_0x3edbf0,_0x29a740){_0x3edbf0=_0x3edbf0-0x0;var _0x2e2c1b=_0x6ae5[_0x3edbf0];return _0x2e2c1b;};'use strict';function ServicenowAccount(_0x1c5769){this['id']=_0x1c5769['id']||0x0;this[_0x56ae('0x0')]=_0x1c5769[_0x56ae('0x0')]||'';this[_0x56ae('0x1')]=_0x1c5769['username']||'';this[_0x56ae('0x2')]=_0x1c5769[_0x56ae('0x2')]||'';this['remoteUri']=_0x1c5769['remoteUri']||'';this[_0x56ae('0x3')]=_0x1c5769[_0x56ae('0x3')]||'';this[_0x56ae('0x4')]=_0x1c5769['Configurations']||{};}module[_0x56ae('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x6ebe=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x24875c,_0x592ab9){var _0x3c0a8f=function(_0x2bfedb){while(--_0x2bfedb){_0x24875c['push'](_0x24875c['shift']());}};_0x3c0a8f(++_0x592ab9);}(_0x6ebe,0x79));var _0xe6eb=function(_0x83c6f5,_0x3b1182){_0x83c6f5=_0x83c6f5-0x0;var _0x37b68c=_0x6ebe[_0x83c6f5];return _0x37b68c;};'use strict';function ServicenowAccount(_0x45fb5f){this['id']=_0x45fb5f['id']||0x0;this[_0xe6eb('0x0')]=_0x45fb5f['name']||'';this[_0xe6eb('0x1')]=_0x45fb5f[_0xe6eb('0x1')]||'';this[_0xe6eb('0x2')]=_0x45fb5f['password']||'';this['remoteUri']=_0x45fb5f[_0xe6eb('0x3')]||'';this[_0xe6eb('0x4')]=_0x45fb5f['serverUrl']||'';this[_0xe6eb('0x5')]=_0x45fb5f[_0xe6eb('0x5')]||{};}module[_0xe6eb('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index f7a4047..1f43abb 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 _0xdd55=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0xcc4dda,_0x149272){var _0x22aec3=function(_0x32c947){while(--_0x32c947){_0xcc4dda['push'](_0xcc4dda['shift']());}};_0x22aec3(++_0x149272);}(_0xdd55,0x95));var _0x5dd5=function(_0x3bd208,_0x3a59c2){_0x3bd208=_0x3bd208-0x0;var _0x97a34f=_0xdd55[_0x3bd208];return _0x97a34f;};'use strict';function SugarcrmAccount(_0x2d813c){this['id']=_0x2d813c['id']||0x0;this[_0x5dd5('0x0')]=_0x2d813c['name']||'';this[_0x5dd5('0x1')]=_0x2d813c[_0x5dd5('0x1')]||'';this[_0x5dd5('0x2')]=_0x2d813c[_0x5dd5('0x2')]||'';this['remoteUri']=_0x2d813c[_0x5dd5('0x3')]||'';this['serverUrl']=_0x2d813c[_0x5dd5('0x4')]||'';this[_0x5dd5('0x5')]=_0x2d813c[_0x5dd5('0x5')]||{};}module[_0x5dd5('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x8075=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x5e1d4d,_0x385ac5){var _0x254f78=function(_0x26c41f){while(--_0x26c41f){_0x5e1d4d['push'](_0x5e1d4d['shift']());}};_0x254f78(++_0x385ac5);}(_0x8075,0xab));var _0x5807=function(_0x475d1f,_0x9b15a6){_0x475d1f=_0x475d1f-0x0;var _0x3eead7=_0x8075[_0x475d1f];return _0x3eead7;};'use strict';function SugarcrmAccount(_0x9f034d){this['id']=_0x9f034d['id']||0x0;this[_0x5807('0x0')]=_0x9f034d['name']||'';this[_0x5807('0x1')]=_0x9f034d['username']||'';this[_0x5807('0x2')]=_0x9f034d[_0x5807('0x2')]||'';this['remoteUri']=_0x9f034d[_0x5807('0x3')]||'';this[_0x5807('0x4')]=_0x9f034d['serverUrl']||'';this['Configurations']=_0x9f034d[_0x5807('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 6ff0784..34c2013 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 _0xac80=['state','unknown','status','address','exports','name','accountcode'];(function(_0x48c886,_0x4a6723){var _0x51d1f7=function(_0x4e92e1){while(--_0x4e92e1){_0x48c886['push'](_0x48c886['shift']());}};_0x51d1f7(++_0x4a6723);}(_0xac80,0x163));var _0x0ac8=function(_0x28308e,_0x12f06b){_0x28308e=_0x28308e-0x0;var _0xf6ca26=_0xac80[_0x28308e];return _0xf6ca26;};'use strict';function Telephone(_0x2b801c){this['id']=_0x2b801c['id']||0x0;this[_0x0ac8('0x0')]=_0x2b801c[_0x0ac8('0x0')]||'';this[_0x0ac8('0x1')]=_0x2b801c[_0x0ac8('0x1')]||'';this[_0x0ac8('0x2')]=_0x0ac8('0x3');this['stateTime']=0x0;this[_0x0ac8('0x4')]=_0x0ac8('0x3');this[_0x0ac8('0x5')]='';}module[_0x0ac8('0x6')]=Telephone; \ No newline at end of file +var _0xc87b=['stateTime','address','exports','name','accountcode','state','unknown'];(function(_0x1447a2,_0x388757){var _0x3de31f=function(_0x186541){while(--_0x186541){_0x1447a2['push'](_0x1447a2['shift']());}};_0x3de31f(++_0x388757);}(_0xc87b,0xb2));var _0xbc87=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xc87b[_0x5608a3];return _0x1ed50a;};'use strict';function Telephone(_0x50ab04){this['id']=_0x50ab04['id']||0x0;this[_0xbc87('0x0')]=_0x50ab04[_0xbc87('0x0')]||'';this[_0xbc87('0x1')]=_0x50ab04['accountcode']||'';this[_0xbc87('0x2')]=_0xbc87('0x3');this[_0xbc87('0x4')]=0x0;this['status']=_0xbc87('0x3');this[_0xbc87('0x5')]='';}module[_0xbc87('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 00ee0e0..015a7c7 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x16a997,_0x4657b5){var _0x1da90f=function(_0xe0e457){while(--_0xe0e457){_0x16a997['push'](_0x16a997['shift']());}};_0x1da90f(++_0x4657b5);}(_0xb10b,0x12a));var _0xbb10=function(_0x58a975,_0x4f7451){_0x58a975=_0x58a975-0x0;var _0x47f055=_0xb10b[_0x58a975];return _0x47f055;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x4150ee,_0x2f1ca9){var _0x51e9ab=function(_0x4aac32){while(--_0x4aac32){_0x4150ee['push'](_0x4150ee['shift']());}};_0x51e9ab(++_0x2f1ca9);}(_0xb10b,0x12a));var _0xbb10=function(_0x3a23c1,_0x495d49){_0x3a23c1=_0x3a23c1-0x0;var _0x286863=_0xb10b[_0x3a23c1];return _0x286863;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index e431898..e38a571 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 _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x22cd31,_0x1e38d1){var _0x28f6da=function(_0x4b0644){while(--_0x4b0644){_0x22cd31['push'](_0x22cd31['shift']());}};_0x28f6da(++_0x1e38d1);}(_0x4fc2,0x111));var _0x24fc=function(_0x3366c5,_0x597f9a){_0x3366c5=_0x3366c5-0x0;var _0x18500d=_0x4fc2[_0x3366c5];return _0x18500d;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x5f2f=['AnyConditions','Actions','exports','name','channel','voice','status'];(function(_0x127796,_0xd2a09b){var _0x2113eb=function(_0x34f9ef){while(--_0x34f9ef){_0x127796['push'](_0x127796['shift']());}};_0x2113eb(++_0xd2a09b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2da4db,_0xc408e9){_0x2da4db=_0x2da4db-0x0;var _0x38863d=_0x5f2f[_0x2da4db];return _0x38863d;};'use strict';function Trigger(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||_0xf5f2('0x2');this[_0xf5f2('0x3')]=_0x7c86d8[_0xf5f2('0x3')]||![];this['AllConditions']=_0x7c86d8['AllConditions']||[];this[_0xf5f2('0x4')]=_0x7c86d8[_0xf5f2('0x4')]||[];this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||[];}module[_0xf5f2('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 7dd9103..fb87f6e 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 _0x4856=['registrationtime','address','defaultuser','exports','active','name','state','unknown','status','registry','indexOf','host','port','domainport'];(function(_0x74d12d,_0x1970a1){var _0x325250=function(_0x126e57){while(--_0x126e57){_0x74d12d['push'](_0x74d12d['shift']());}};_0x325250(++_0x1970a1);}(_0x4856,0xc8));var _0x6485=function(_0x38300c,_0x4618b9){_0x38300c=_0x38300c-0x0;var _0x591bf6=_0x4856[_0x38300c];return _0x591bf6;};'use strict';function Trunk(_0x178480){this['id']=_0x178480['id']||0x0;this[_0x6485('0x0')]=_0x178480[_0x6485('0x0')]||![];this[_0x6485('0x1')]=_0x178480[_0x6485('0x1')]||'';this[_0x6485('0x2')]=_0x6485('0x3');this['stateTime']=0x0;this[_0x6485('0x4')]=_0x6485('0x3');this[_0x6485('0x5')]=_0x178480['registry']&&_0x178480[_0x6485('0x5')][_0x6485('0x6')](':')?_0x178480[_0x6485('0x5')]['split'](':')[0x0]:'';this[_0x6485('0x7')]='';this[_0x6485('0x8')]='';this['domain']='';this[_0x6485('0x9')]='';this['refresh']='';this['stateRegistry']=_0x6485('0x3');this[_0x6485('0xa')]='';this[_0x6485('0xb')]='';this[_0x6485('0xc')]=_0x178480[_0x6485('0xc')]||'';}module[_0x6485('0xd')]=Trunk; \ No newline at end of file +var _0xd289=['registry','indexOf','split','host','port','domainport','unknown','registrationtime','address','defaultuser','exports','active','name','state','status'];(function(_0x33609c,_0x4c350a){var _0x246404=function(_0x5e5b41){while(--_0x5e5b41){_0x33609c['push'](_0x33609c['shift']());}};_0x246404(++_0x4c350a);}(_0xd289,0xb0));var _0x9d28=function(_0x36072d,_0x24f414){_0x36072d=_0x36072d-0x0;var _0x32a52c=_0xd289[_0x36072d];return _0x32a52c;};'use strict';function Trunk(_0x29f85b){this['id']=_0x29f85b['id']||0x0;this[_0x9d28('0x0')]=_0x29f85b[_0x9d28('0x0')]||![];this[_0x9d28('0x1')]=_0x29f85b[_0x9d28('0x1')]||'';this[_0x9d28('0x2')]='unknown';this['stateTime']=0x0;this[_0x9d28('0x3')]='unknown';this[_0x9d28('0x4')]=_0x29f85b[_0x9d28('0x4')]&&_0x29f85b[_0x9d28('0x4')][_0x9d28('0x5')](':')?_0x29f85b[_0x9d28('0x4')][_0x9d28('0x6')](':')[0x0]:'';this[_0x9d28('0x7')]='';this[_0x9d28('0x8')]='';this['domain']='';this[_0x9d28('0x9')]='';this['refresh']='';this['stateRegistry']=_0x9d28('0xa');this[_0x9d28('0xb')]='';this[_0x9d28('0xc')]='';this[_0x9d28('0xd')]=_0x29f85b['defaultuser']||'';}module[_0x9d28('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index ef6a782..7737ba9 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 _0xe31b=['recordingFormat','none','exports','exten'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xe31b,0x15b));var _0xbe31=function(_0x2f7be9,_0x173b28){_0x2f7be9=_0x2f7be9-0x0;var _0x22b2ad=_0xe31b[_0x2f7be9];return _0x22b2ad;};'use strict';function voiceExtension(_0x1c88ed){this['id']=_0x1c88ed['id']||0x0;this[_0xbe31('0x0')]=_0x1c88ed['exten']||'';this['recordingFormat']=_0x1c88ed[_0xbe31('0x1')]||_0xbe31('0x2');this['mandatoryDisposition']=_0x1c88ed['mandatoryDisposition']||![];}module[_0xbe31('0x3')]=voiceExtension; \ No newline at end of file +var _0xf4f6=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf4f6,0xfe));var _0x6f4f=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xf4f6[_0x68c979];return _0x4f0001;};'use strict';function voiceExtension(_0x35bf3d){this['id']=_0x35bf3d['id']||0x0;this['exten']=_0x35bf3d[_0x6f4f('0x0')]||'';this[_0x6f4f('0x1')]=_0x35bf3d['recordingFormat']||_0x6f4f('0x2');this[_0x6f4f('0x3')]=_0x35bf3d['mandatoryDisposition']||![];}module[_0x6f4f('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 259c00e..49712fb 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 _0x0615=['dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','name','monitor_format','type','waiting','total','answered','sumHoldTime','sumBillable','unmanaged','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient'];(function(_0x399bd4,_0x3c84ab){var _0x12d41b=function(_0x2341dc){while(--_0x2341dc){_0x399bd4['push'](_0x399bd4['shift']());}};_0x12d41b(++_0x3c84ab);}(_0x0615,0x7c));var _0x5061=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0615[_0x502c7d];return _0x30b7ed;};'use strict';var statusDesc=[_0x5061('0x0'),_0x5061('0x1'),_0x5061('0x2'),_0x5061('0x3'),'invalid',_0x5061('0x4'),_0x5061('0x5'),_0x5061('0x6'),_0x5061('0x7')];var monitorFormat={'wav':_0x5061('0x8'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x42915c){this['id']=_0x42915c['id']||0x0;this['name']=_0x42915c[_0x5061('0x9')]||'';this['monitor_format']=_0x42915c[_0x5061('0xa')]||'';this['type']=_0x42915c[_0x5061('0xb')]||'inbound';this[_0x5061('0xc')]=0x0;this['talking']=0x0;this[_0x5061('0xd')]=0x0;this[_0x5061('0xe')]=0x0;this['sumDuration']=0x0;this[_0x5061('0xf')]=0x0;this[_0x5061('0x10')]=0x0;this[_0x5061('0x11')]=0x0;this['abandoned']=0x0;this[_0x5061('0x12')]=0x0;this['available']=0x0;this[_0x5061('0x13')]=_0x42915c[_0x5061('0x13')]||![];this['acwTimeout']=_0x42915c[_0x5061('0x14')]||0xa;this[_0x5061('0x15')]=_0x42915c['autopause']||'no';this[_0x5061('0x16')]=!![];this[_0x5061('0x17')]='';this[_0x5061('0x18')]=0x0;this[_0x5061('0x19')]=0x0;this[_0x5061('0x1a')]=_0x42915c[_0x5061('0x1a')]||null;this['dialGlobalInterval']=_0x42915c[_0x5061('0x1b')]?_0x42915c['dialGlobalInterval']:null;this[_0x5061('0x1c')]=_0x42915c['dialActive'];this[_0x5061('0x1d')]=_0x42915c[_0x5061('0x1d')]||'progressive';this[_0x5061('0x1e')]=_0x42915c[_0x5061('0x1e')]||0x0;this[_0x5061('0x1f')]=_0x42915c[_0x5061('0x1f')]||0x0;this[_0x5061('0x20')]=_0x42915c[_0x5061('0x20')]||0x1;this[_0x5061('0x21')]=_0x42915c[_0x5061('0x21')]||_0x5061('0x22');this[_0x5061('0x23')]=_0x42915c[_0x5061('0x23')]||0.03;this['dialPredictiveInterval']=_0x42915c[_0x5061('0x24')]||0x258;this[_0x5061('0x25')]=_0x42915c[_0x5061('0x25')]||'anonymous';this[_0x5061('0x26')]=_0x42915c[_0x5061('0x26')]||_0x5061('0x27');this[_0x5061('0x28')]=_0x42915c[_0x5061('0x28')]||0x1e;this['dialQueueOptions']=_0x42915c[_0x5061('0x29')]||_0x5061('0x2a');this[_0x5061('0x2b')]=_0x42915c['dialQueueTimeout']||0x3;this[_0x5061('0x2c')]=_0x42915c[_0x5061('0x2c')]||undefined;this[_0x5061('0x2d')]=_0x42915c['dialCongestionMaxRetry']||0x3;this[_0x5061('0x2e')]=_0x42915c[_0x5061('0x2e')]||0x96;this[_0x5061('0x2f')]=_0x42915c['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x42915c[_0x5061('0x30')]||0x96;this['dialNoAnswerMaxRetry']=_0x42915c[_0x5061('0x31')]||0x3;this[_0x5061('0x32')]=_0x42915c[_0x5061('0x32')]||0x96;this[_0x5061('0x33')]=_0x42915c[_0x5061('0x33')]||0x3;this[_0x5061('0x34')]=_0x42915c[_0x5061('0x34')]||0x96;this[_0x5061('0x35')]=_0x42915c[_0x5061('0x35')]||0x3;this[_0x5061('0x36')]=_0x42915c[_0x5061('0x36')]||0x96;this[_0x5061('0x37')]=_0x42915c['dialAbandonedMaxRetry']||0x3;this[_0x5061('0x38')]=_0x42915c[_0x5061('0x38')]||0x96;this[_0x5061('0x39')]=_0x42915c[_0x5061('0x39')]||0x3;this[_0x5061('0x3a')]=_0x42915c[_0x5061('0x3a')]||0x96;this[_0x5061('0x3b')]=_0x42915c['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x42915c[_0x5061('0x3c')]||0x96;this[_0x5061('0x3d')]=_0x42915c['dialGlobalMaxRetry']||0x4;this[_0x5061('0x3e')]=_0x42915c[_0x5061('0x3e')]?_0x42915c[_0x5061('0x3e')]:undefined;this[_0x5061('0x3f')]=_0x42915c[_0x5061('0x3f')]?_0x42915c[_0x5061('0x3f')]:undefined;this[_0x5061('0x40')]=_0x42915c[_0x5061('0x40')]||undefined;this[_0x5061('0x41')]=_0x42915c[_0x5061('0x41')]?_0x42915c[_0x5061('0x41')]:undefined;this[_0x5061('0x42')]=_0x42915c[_0x5061('0x42')]||_0x5061('0x43');this[_0x5061('0x44')]=_0x42915c[_0x5061('0x44')]||undefined;this[_0x5061('0x45')]=_0x42915c[_0x5061('0x45')]||undefined;this[_0x5061('0x46')]=strategy[_0x42915c[_0x5061('0x46')]]||_0x5061('0x47');this['queueStatusComplete']=!![];this[_0x5061('0x48')]=_0x42915c[_0x5061('0x48')]||![];this[_0x5061('0x49')]=_0x42915c[_0x5061('0x49')];this[_0x5061('0x4a')]=_0x42915c['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x42915c[_0x5061('0x4b')];this[_0x5061('0x4c')]=_0x42915c['dialAMDTotalAnalysisTime'];this[_0x5061('0x4d')]=_0x42915c[_0x5061('0x4d')];this[_0x5061('0x4e')]=_0x42915c['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x42915c[_0x5061('0x4f')];this['dialAMDSilenceThreshold']=_0x42915c[_0x5061('0x50')];this[_0x5061('0x51')]=_0x42915c[_0x5061('0x51')];this['outboundRejectCallsDay']=0x0;this[_0x5061('0x52')]=0x0;this[_0x5061('0x53')]=_0x42915c['timeout'];this[_0x5061('0x54')]=0x0;this[_0x5061('0x55')]=0x0;this[_0x5061('0x56')]=0x0;this[_0x5061('0x57')]=0x0;this[_0x5061('0x58')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x5061('0x59')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x5061('0x5a')]=0x0;this[_0x5061('0x5b')]=0x0;this[_0x5061('0x5c')]=0x0;this[_0x5061('0x5d')]=0x0;this['outboundReCallsDay']=0x0;this[_0x5061('0x5e')]=0x0;this['startProgressive']=undefined;this[_0x5061('0x5f')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x5061('0x60')]=0x0;this[_0x5061('0x61')]=0x0;this[_0x5061('0x62')]=0x0;this[_0x5061('0x63')]=0x0;this[_0x5061('0x64')]=0x0;this[_0x5061('0x65')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x5061('0x66')]=0x0;this[_0x5061('0x67')]=_0x42915c[_0x5061('0x68')]||0x14;this['predictiveIntervalMinThreshold']=_0x42915c[_0x5061('0x68')]||0xa;this[_0x5061('0x69')]=0x0;this[_0x5061('0x6a')]=0x0;this[_0x5061('0x6b')]=0x1;this['erlangCalls']=0x0;this[_0x5061('0x6c')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x5061('0x6d')]=0x0;this[_0x5061('0x6e')]=_0x42915c['dialRecallMeTimeout']||0x1e;this[_0x5061('0x6f')]=_0x42915c[_0x5061('0x6f')]||![];this[_0x5061('0x70')]=!!_0x42915c[_0x5061('0x70')]||![];this[_0x5061('0x71')]=!!_0x42915c['dialPreviewRecallmeReminder']||![];this[_0x5061('0x72')]=_0x42915c[_0x5061('0x72')]||undefined;this['dialAgiAfterHangupClient']=_0x42915c[_0x5061('0x73')]||![];this['dialAgiAfterHangupAgent']=_0x42915c[_0x5061('0x74')]||![];this[_0x5061('0xa')]=monitorFormat[_0x42915c[_0x5061('0xa')]]?monitorFormat[_0x42915c[_0x5061('0xa')]]:undefined;this[_0x5061('0x75')]=_0x42915c[_0x5061('0x75')]||![];this['mandatoryDispositionPause']=_0x42915c[_0x5061('0x76')]?_0x42915c[_0x5061('0x76')]:undefined;}module[_0x5061('0x77')]=VoiceQueue; \ No newline at end of file +var _0x103b=['inbound','waiting','talking','total','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','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','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type'];(function(_0x4a1bce,_0x2cd5c0){var _0x443f2e=function(_0x6188dd){while(--_0x6188dd){_0x4a1bce['push'](_0x4a1bce['shift']());}};_0x443f2e(++_0x2cd5c0);}(_0x103b,0x15e));var _0xb103=function(_0x3d10ca,_0x769b54){_0x3d10ca=_0x3d10ca-0x0;var _0x2e0400=_0x103b[_0x3d10ca];return _0x2e0400;};'use strict';var statusDesc=[_0xb103('0x0'),_0xb103('0x1'),_0xb103('0x2'),_0xb103('0x3'),'invalid',_0xb103('0x4'),_0xb103('0x5'),_0xb103('0x6'),_0xb103('0x7')];var monitorFormat={'wav':_0xb103('0x8'),'wav49':_0xb103('0x9'),'gsm':_0xb103('0xa')};var strategy={'rrmemory':_0xb103('0xb'),'roundrobin':_0xb103('0xc')};function VoiceQueue(_0x263cda){this['id']=_0x263cda['id']||0x0;this['name']=_0x263cda[_0xb103('0xd')]||'';this[_0xb103('0xe')]=_0x263cda['monitor_format']||'';this['type']=_0x263cda[_0xb103('0xf')]||_0xb103('0x10');this[_0xb103('0x11')]=0x0;this[_0xb103('0x12')]=0x0;this[_0xb103('0x13')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0xb103('0x14')]=0x0;this['unmanaged']=0x0;this[_0xb103('0x15')]=0x0;this[_0xb103('0x16')]=0x0;this[_0xb103('0x17')]=0x0;this[_0xb103('0x18')]=_0x263cda['acw']||![];this[_0xb103('0x19')]=_0x263cda['acwTimeout']||0xa;this[_0xb103('0x1a')]=_0x263cda['autopause']||'no';this[_0xb103('0x1b')]=!![];this[_0xb103('0x1c')]='';this[_0xb103('0x1d')]=0x0;this[_0xb103('0x1e')]=0x0;this['dialTimezone']=_0x263cda[_0xb103('0x1f')]||null;this[_0xb103('0x20')]=_0x263cda[_0xb103('0x20')]?_0x263cda[_0xb103('0x20')]:null;this[_0xb103('0x21')]=_0x263cda[_0xb103('0x21')];this[_0xb103('0x22')]=_0x263cda[_0xb103('0x22')]||_0xb103('0x23');this[_0xb103('0x24')]=_0x263cda[_0xb103('0x24')]||0x0;this[_0xb103('0x25')]=_0x263cda['dialLimitQueue']||0x0;this[_0xb103('0x26')]=_0x263cda[_0xb103('0x26')]||0x1;this[_0xb103('0x27')]=_0x263cda['dialPredictiveOptimization']||_0xb103('0x28');this['dialPredictiveOptimizationPercentage']=_0x263cda[_0xb103('0x29')]||0.03;this[_0xb103('0x2a')]=_0x263cda[_0xb103('0x2a')]||0x258;this['dialOriginateCallerIdName']=_0x263cda[_0xb103('0x2b')]||_0xb103('0x2c');this[_0xb103('0x2d')]=_0x263cda[_0xb103('0x2d')]||'anonymous';this[_0xb103('0x2e')]=_0x263cda[_0xb103('0x2e')]||0x1e;this[_0xb103('0x2f')]=_0x263cda[_0xb103('0x2f')]||_0xb103('0x30');this['dialQueueTimeout']=_0x263cda['dialQueueTimeout']||0x3;this[_0xb103('0x31')]=_0x263cda[_0xb103('0x31')]||undefined;this[_0xb103('0x32')]=_0x263cda[_0xb103('0x32')]||0x3;this[_0xb103('0x33')]=_0x263cda[_0xb103('0x33')]||0x96;this[_0xb103('0x34')]=_0x263cda[_0xb103('0x34')]||0x3;this[_0xb103('0x35')]=_0x263cda[_0xb103('0x35')]||0x96;this[_0xb103('0x36')]=_0x263cda['dialNoAnswerMaxRetry']||0x3;this[_0xb103('0x37')]=_0x263cda[_0xb103('0x37')]||0x96;this[_0xb103('0x38')]=_0x263cda[_0xb103('0x38')]||0x3;this[_0xb103('0x39')]=_0x263cda[_0xb103('0x39')]||0x96;this[_0xb103('0x3a')]=_0x263cda[_0xb103('0x3a')]||0x3;this['dialDropRetryFrequency']=_0x263cda[_0xb103('0x3b')]||0x96;this['dialAbandonedMaxRetry']=_0x263cda[_0xb103('0x3c')]||0x3;this[_0xb103('0x3d')]=_0x263cda[_0xb103('0x3d')]||0x96;this[_0xb103('0x3e')]=_0x263cda['dialMachineMaxRetry']||0x3;this[_0xb103('0x3f')]=_0x263cda[_0xb103('0x3f')]||0x96;this[_0xb103('0x40')]=_0x263cda['dialAgentRejectMaxRetry']||0x3;this[_0xb103('0x41')]=_0x263cda[_0xb103('0x41')]||0x96;this[_0xb103('0x42')]=_0x263cda['dialGlobalMaxRetry']||0x4;this[_0xb103('0x43')]=_0x263cda[_0xb103('0x43')]?_0x263cda[_0xb103('0x43')]:undefined;this[_0xb103('0x44')]=_0x263cda['TrunkBackup']?_0x263cda[_0xb103('0x44')]:undefined;this[_0xb103('0x45')]=_0x263cda[_0xb103('0x45')]||undefined;this[_0xb103('0x46')]=_0x263cda[_0xb103('0x46')]?_0x263cda[_0xb103('0x46')]:undefined;this[_0xb103('0x47')]=_0x263cda[_0xb103('0x47')]||_0xb103('0x48');this[_0xb103('0x49')]=_0x263cda[_0xb103('0x49')]||undefined;this[_0xb103('0x4a')]=_0x263cda[_0xb103('0x4a')]||undefined;this[_0xb103('0x4b')]=strategy[_0x263cda[_0xb103('0x4b')]]||_0xb103('0xb');this['queueStatusComplete']=!![];this[_0xb103('0x4c')]=_0x263cda[_0xb103('0x4c')]||![];this['dialAMDInitialSilence']=_0x263cda[_0xb103('0x4d')];this[_0xb103('0x4e')]=_0x263cda[_0xb103('0x4e')];this[_0xb103('0x4f')]=_0x263cda[_0xb103('0x4f')];this[_0xb103('0x50')]=_0x263cda['dialAMDTotalAnalysisTime'];this[_0xb103('0x51')]=_0x263cda['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x263cda['dialAMDBetweenWordsSilence'];this[_0xb103('0x52')]=_0x263cda[_0xb103('0x52')];this['dialAMDSilenceThreshold']=_0x263cda[_0xb103('0x53')];this['dialAMDMaximumWordLength']=_0x263cda[_0xb103('0x54')];this[_0xb103('0x55')]=0x0;this['pTalking']=0x0;this[_0xb103('0x56')]=_0x263cda[_0xb103('0x56')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xb103('0x57')]=0x0;this[_0xb103('0x58')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xb103('0x59')]=0x0;this[_0xb103('0x5a')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xb103('0x5b')]=0x0;this[_0xb103('0x5c')]=0x0;this[_0xb103('0x5d')]=0x0;this[_0xb103('0x5e')]=0x0;this[_0xb103('0x5f')]=0x0;this[_0xb103('0x60')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0xb103('0x61')]=undefined;this[_0xb103('0x62')]=1.05;this[_0xb103('0x63')]=0x0;this[_0xb103('0x64')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xb103('0x65')]=0x0;this[_0xb103('0x66')]=0x0;this[_0xb103('0x67')]=0x0;this[_0xb103('0x68')]=0x0;this['predictiveIntervalMaxThreshold']=_0x263cda[_0xb103('0x69')]||0x14;this[_0xb103('0x6a')]=_0x263cda[_0xb103('0x69')]||0xa;this[_0xb103('0x6b')]=0x0;this[_0xb103('0x6c')]=0x0;this[_0xb103('0x6d')]=0x1;this['erlangCalls']=0x0;this[_0xb103('0x6e')]=0x0;this[_0xb103('0x6f')]=0x0;this[_0xb103('0x70')]=0x0;this['dialRecallMeTimeout']=_0x263cda['dialRecallMeTimeout']||0x1e;this[_0xb103('0x71')]=_0x263cda[_0xb103('0x71')]||![];this[_0xb103('0x72')]=!!_0x263cda[_0xb103('0x72')]||![];this[_0xb103('0x73')]=!!_0x263cda[_0xb103('0x73')]||![];this[_0xb103('0x74')]=_0x263cda[_0xb103('0x74')]||undefined;this[_0xb103('0x75')]=_0x263cda['dialAgiAfterHangupClient']||![];this[_0xb103('0x76')]=_0x263cda[_0xb103('0x76')]||![];this[_0xb103('0xe')]=monitorFormat[_0x263cda[_0xb103('0xe')]]?monitorFormat[_0x263cda[_0xb103('0xe')]]:undefined;this[_0xb103('0x77')]=_0x263cda[_0xb103('0x77')]||![];this['mandatoryDispositionPause']=_0x263cda[_0xb103('0x78')]?_0x263cda[_0xb103('0x78')]:undefined;}module[_0xb103('0x79')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 4d676ae..d907072 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 _0x7847=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x4e7c1c,_0x56eafd){var _0x47adb2=function(_0x346135){while(--_0x346135){_0x4e7c1c['push'](_0x4e7c1c['shift']());}};_0x47adb2(++_0x56eafd);}(_0x7847,0xca));var _0x7784=function(_0xdbde1c,_0x3dfd55){_0xdbde1c=_0xdbde1c-0x0;var _0x527029=_0x7847[_0xdbde1c];return _0x527029;};'use strict';function VtigerAccount(_0x1670ba){this['id']=_0x1670ba['id']||0x0;this[_0x7784('0x0')]=_0x1670ba['name']||'';this[_0x7784('0x1')]=_0x1670ba['username']||'';this['accessKey']=_0x1670ba[_0x7784('0x2')]||'';this[_0x7784('0x3')]=_0x1670ba['remoteUri']||'';this[_0x7784('0x4')]=_0x1670ba[_0x7784('0x4')]||'';this[_0x7784('0x5')]=_0x1670ba[_0x7784('0x5')]||{};}module[_0x7784('0x6')]=VtigerAccount; \ No newline at end of file +var _0xf037=['name','username','accessKey','remoteUri','Configurations','exports'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xf037,0x19e));var _0x7f03=function(_0x1af0e5,_0x152990){_0x1af0e5=_0x1af0e5-0x0;var _0x3c444a=_0xf037[_0x1af0e5];return _0x3c444a;};'use strict';function VtigerAccount(_0x4fb7cf){this['id']=_0x4fb7cf['id']||0x0;this[_0x7f03('0x0')]=_0x4fb7cf['name']||'';this[_0x7f03('0x1')]=_0x4fb7cf[_0x7f03('0x1')]||'';this[_0x7f03('0x2')]=_0x4fb7cf['accessKey']||'';this[_0x7f03('0x3')]=_0x4fb7cf[_0x7f03('0x3')]||'';this['serverUrl']=_0x4fb7cf['serverUrl']||'';this[_0x7f03('0x4')]=_0x4fb7cf['Configurations']||{};}module[_0x7f03('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 879d63f..d2252e1 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 _0x2300=['remoteUri','authType','type','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2300,0x10a));var _0x0230=function(_0x36a422,_0xf32c){_0x36a422=_0x36a422-0x0;var _0x557512=_0x2300[_0x36a422];return _0x557512;};'use strict';function ZendeskAccount(_0x9eeb90){this['id']=_0x9eeb90['id']||0x0;this[_0x0230('0x0')]=_0x9eeb90[_0x0230('0x0')]||'';this[_0x0230('0x1')]=_0x9eeb90[_0x0230('0x1')]||'';this[_0x0230('0x2')]=_0x9eeb90[_0x0230('0x2')]||'';this[_0x0230('0x3')]=_0x9eeb90[_0x0230('0x3')]||'';this[_0x0230('0x4')]=_0x9eeb90['remoteUri']||'';this[_0x0230('0x5')]=_0x9eeb90[_0x0230('0x5')]||'';this[_0x0230('0x6')]=_0x9eeb90[_0x0230('0x6')]||'integrationTab';this['serverUrl']=_0x9eeb90[_0x0230('0x7')]||'';this[_0x0230('0x8')]=_0x9eeb90[_0x0230('0x8')]||{};}module[_0x0230('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xc5cb=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xc5cb,0x108));var _0xbc5c=function(_0x8b94a8,_0x27e5b6){_0x8b94a8=_0x8b94a8-0x0;var _0x45b2c3=_0xc5cb[_0x8b94a8];return _0x45b2c3;};'use strict';function ZendeskAccount(_0x486be6){this['id']=_0x486be6['id']||0x0;this[_0xbc5c('0x0')]=_0x486be6[_0xbc5c('0x0')]||'';this[_0xbc5c('0x1')]=_0x486be6[_0xbc5c('0x1')]||'';this[_0xbc5c('0x2')]=_0x486be6[_0xbc5c('0x2')]||'';this[_0xbc5c('0x3')]=_0x486be6[_0xbc5c('0x3')]||'';this[_0xbc5c('0x4')]=_0x486be6[_0xbc5c('0x4')]||'';this[_0xbc5c('0x5')]=_0x486be6[_0xbc5c('0x5')]||'';this['type']=_0x486be6[_0xbc5c('0x6')]||_0xbc5c('0x7');this['serverUrl']=_0x486be6[_0xbc5c('0x8')]||'';this['Configurations']=_0x486be6[_0xbc5c('0x9')]||{};}module[_0xbc5c('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index b9c11f8..b473fee 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 _0x1163=['Configurations','name','description','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x43b4c9,_0x150055){var _0x478339=function(_0x7805ec){while(--_0x7805ec){_0x43b4c9['push'](_0x43b4c9['shift']());}};_0x478339(++_0x150055);}(_0x1163,0x10f));var _0x3116=function(_0x9077a4,_0x41748c){_0x9077a4=_0x9077a4-0x0;var _0x204bdc=_0x1163[_0x9077a4];return _0x204bdc;};'use strict';function ZohoAccount(_0x293c73){this['id']=_0x293c73['id']||0x0;this['name']=_0x293c73[_0x3116('0x0')]||'';this[_0x3116('0x1')]=_0x293c73[_0x3116('0x1')]||'';this['host']=_0x293c73['host']||'';this[_0x3116('0x2')]=_0x293c73[_0x3116('0x2')]||'';this[_0x3116('0x3')]=_0x293c73[_0x3116('0x3')]||'';this[_0x3116('0x4')]=_0x293c73[_0x3116('0x4')]||'';this['serverUrl']=_0x293c73[_0x3116('0x5')]||'';this['code']=_0x293c73[_0x3116('0x6')]||'';this[_0x3116('0x7')]=_0x293c73[_0x3116('0x7')]||'';this[_0x3116('0x8')]=_0x293c73[_0x3116('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x63b9=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x4e4f71,_0x431933){var _0x556fd8=function(_0x29665b){while(--_0x29665b){_0x4e4f71['push'](_0x4e4f71['shift']());}};_0x556fd8(++_0x431933);}(_0x63b9,0xc4));var _0x963b=function(_0x1c2710,_0x1d0ec5){_0x1c2710=_0x1c2710-0x0;var _0x1a3cd4=_0x63b9[_0x1c2710];return _0x1a3cd4;};'use strict';function ZohoAccount(_0x1ac16c){this['id']=_0x1ac16c['id']||0x0;this[_0x963b('0x0')]=_0x1ac16c['name']||'';this[_0x963b('0x1')]=_0x1ac16c[_0x963b('0x1')]||'';this['host']=_0x1ac16c[_0x963b('0x2')]||'';this[_0x963b('0x3')]=_0x1ac16c['zone']||'';this[_0x963b('0x4')]=_0x1ac16c[_0x963b('0x4')]||'';this[_0x963b('0x5')]=_0x1ac16c[_0x963b('0x5')]||'';this[_0x963b('0x6')]=_0x1ac16c[_0x963b('0x6')]||'';this[_0x963b('0x7')]=_0x1ac16c['code']||'';this[_0x963b('0x8')]=_0x1ac16c['refreshToken']||'';this['Configurations']=_0x1ac16c[_0x963b('0x9')]||{};}module[_0x963b('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 756552d..90f2608 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 _0x3950=['originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','Agent','channelAgent','membername','format','SIP/%s','calleridname','Contact','phone','lastName','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum'];(function(_0x4341b3,_0x33890a){var _0x155121=function(_0x3f5ce5){while(--_0x3f5ce5){_0x4341b3['push'](_0x4341b3['shift']());}};_0x155121(++_0x33890a);}(_0x3950,0xb1));var _0x0395=function(_0x41358a,_0x322144){_0x41358a=_0x41358a-0x0;var _0x8c40ce=_0x3950[_0x41358a];return _0x8c40ce;};'use strict';var util=require(_0x0395('0x0'));var _=require(_0x0395('0x1'));var moment=require(_0x0395('0x2'));function checkNameSurname(_0x465a8d,_0x4ea1e5,_0x66949b){var _0x15894e='';if(!_[_0x0395('0x3')](_0x4ea1e5)&&_0x0395('0x4')===typeof _0x4ea1e5){_0x15894e+=_0x4ea1e5;}if(!_[_0x0395('0x3')](_0x66949b)&&_0x0395('0x4')===typeof _0x66949b){_0x15894e+='\x20'+_0x66949b;}if(_0x15894e!==''){return _0x15894e;}return _0x465a8d;}function Action(_0x292320,_0x3a9e91,_0x135d35,_0x178c77,_0x2eeec7){this[_0x0395('0x5')]=_0x135d35||undefined;this[_0x0395('0x6')]=_0x292320['id'];this[_0x0395('0x7')]=_0x3a9e91[_0x0395('0x8')];this['type']=_0x3a9e91[_0x0395('0x9')];this['campaigntype']=_0x0395('0x7');this['dialAnswer']=![];this['membername']=_[_0x0395('0x3')](_0x292320[_0x0395('0xa')])?undefined:_0x292320[_0x0395('0xa')]['name'];this[_0x0395('0xb')]=this[_0x0395('0xc')]?util[_0x0395('0xd')](_0x0395('0xe'),this[_0x0395('0xc')]):_0x178c77||undefined;this[_0x0395('0xf')]=checkNameSurname(_0x292320[_0x0395('0x10')][_0x0395('0x11')],_0x292320[_0x0395('0x10')]['firstName'],_0x292320['Contact'][_0x0395('0x12')]);this['active']=_0x292320['active']||![];this['calleridnum']=_0x292320['Contact'][_0x0395('0x11')];this['scheduledat']=_0x292320[_0x0395('0x13')];this[_0x0395('0x14')]=_0x292320['countbusyretry']||0x0;this[_0x0395('0x15')]=_0x292320['countcongestionretry']||0x0;this[_0x0395('0x16')]=_0x292320[_0x0395('0x16')]||0x0;this[_0x0395('0x17')]=(_0x292320['countbusyretry']||0x0)+(_0x292320[_0x0395('0x15')]||0x0)+(_0x292320[_0x0395('0x16')]||0x0)+(_0x292320['countnosuchnumberretry']||0x0)+(_0x292320[_0x0395('0x18')]||0x0)+(_0x292320[_0x0395('0x19')]||0x0)+(_0x292320['countmachineretry']||0x0)+(_0x292320['countagentrejectretry']||0x0);this[_0x0395('0x1a')]=_0x292320[_0x0395('0x1a')]||0x0;this['countdropretry']=_0x292320[_0x0395('0x18')]||0x0;this['countabandonedretry']=_0x292320['countabandonedretry']||0x0;this[_0x0395('0x1b')]=_0x292320[_0x0395('0x1b')]||0x0;this[_0x0395('0x1c')]=_0x292320[_0x0395('0x1c')]||0x0;this[_0x0395('0x1d')]=_0x292320[_0x0395('0x1d')];this[_0x0395('0x1e')]=_0x292320['callbackuniqueid'];this['callbackat']=_0x292320[_0x0395('0x1f')];this[_0x0395('0x20')]=_0x292320[_0x0395('0x20')];this[_0x0395('0x21')]=_0x292320[_0x0395('0x21')];this[_0x0395('0x22')]=_0x292320['ListId'];this['UserId']=_[_0x0395('0x3')](_0x292320['Agent'])?_0x292320[_0x0395('0x23')]:_0x292320['Agent']['id'];this[_0x0395('0x24')]=_0x292320[_0x0395('0x24')];this[_0x0395('0x25')]='';this[_0x0395('0x26')]='';}Action['prototype'][_0x0395('0x27')]=function(){return util[_0x0395('0xd')](_0x0395('0x28'),this[_0x0395('0xf')],this[_0x0395('0x29')]);};module[_0x0395('0x2a')]=Action; \ No newline at end of file +var _0xda4f=['lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','Contact','phone','firstName'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xda4f,0x1e7));var _0xfda4=function(_0x2e8f5d,_0x2e38bc){_0x2e8f5d=_0x2e8f5d-0x0;var _0x4b1752=_0xda4f[_0x2e8f5d];return _0x4b1752;};'use strict';var util=require(_0xfda4('0x0'));var _=require(_0xfda4('0x1'));var moment=require(_0xfda4('0x2'));function checkNameSurname(_0x8570c4,_0x11ceda,_0x32f0ee){var _0x29664b='';if(!_[_0xfda4('0x3')](_0x11ceda)&&_0xfda4('0x4')===typeof _0x11ceda){_0x29664b+=_0x11ceda;}if(!_[_0xfda4('0x3')](_0x32f0ee)&&'string'===typeof _0x32f0ee){_0x29664b+='\x20'+_0x32f0ee;}if(_0x29664b!==''){return _0x29664b;}return _0x8570c4;}function Action(_0x2ca792,_0x1ed2af,_0x9e4f6b,_0x2a2f5d,_0x44fc11){this[_0xfda4('0x5')]=_0x9e4f6b||undefined;this[_0xfda4('0x6')]=_0x2ca792['id'];this[_0xfda4('0x7')]=_0x1ed2af[_0xfda4('0x8')];this[_0xfda4('0x9')]=_0x1ed2af[_0xfda4('0x9')];this['campaigntype']=_0xfda4('0x7');this[_0xfda4('0xa')]=![];this['membername']=_['isNil'](_0x2ca792['Agent'])?undefined:_0x2ca792[_0xfda4('0xb')][_0xfda4('0x8')];this[_0xfda4('0xc')]=this[_0xfda4('0xd')]?util[_0xfda4('0xe')](_0xfda4('0xf'),this['membername']):_0x2a2f5d||undefined;this['calleridname']=checkNameSurname(_0x2ca792[_0xfda4('0x10')][_0xfda4('0x11')],_0x2ca792[_0xfda4('0x10')][_0xfda4('0x12')],_0x2ca792['Contact'][_0xfda4('0x13')]);this[_0xfda4('0x14')]=_0x2ca792['active']||![];this[_0xfda4('0x15')]=_0x2ca792[_0xfda4('0x10')][_0xfda4('0x11')];this[_0xfda4('0x16')]=_0x2ca792[_0xfda4('0x16')];this[_0xfda4('0x17')]=_0x2ca792[_0xfda4('0x17')]||0x0;this['countcongestionretry']=_0x2ca792[_0xfda4('0x18')]||0x0;this[_0xfda4('0x19')]=_0x2ca792[_0xfda4('0x19')]||0x0;this[_0xfda4('0x1a')]=(_0x2ca792['countbusyretry']||0x0)+(_0x2ca792[_0xfda4('0x18')]||0x0)+(_0x2ca792[_0xfda4('0x19')]||0x0)+(_0x2ca792['countnosuchnumberretry']||0x0)+(_0x2ca792[_0xfda4('0x1b')]||0x0)+(_0x2ca792[_0xfda4('0x1c')]||0x0)+(_0x2ca792['countmachineretry']||0x0)+(_0x2ca792[_0xfda4('0x1d')]||0x0);this['countnosuchnumberretry']=_0x2ca792['countnosuchnumberretry']||0x0;this['countdropretry']=_0x2ca792[_0xfda4('0x1b')]||0x0;this[_0xfda4('0x1c')]=_0x2ca792['countabandonedretry']||0x0;this[_0xfda4('0x1e')]=_0x2ca792['countmachineretry']||0x0;this['countagentrejectretry']=_0x2ca792[_0xfda4('0x1d')]||0x0;this['callback']=_0x2ca792['callback'];this[_0xfda4('0x1f')]=_0x2ca792['callbackuniqueid'];this[_0xfda4('0x20')]=_0x2ca792['callbackat'];this[_0xfda4('0x21')]=_0x2ca792[_0xfda4('0x21')];this['ContactId']=_0x2ca792[_0xfda4('0x22')];this[_0xfda4('0x23')]=_0x2ca792[_0xfda4('0x23')];this[_0xfda4('0x24')]=_[_0xfda4('0x3')](_0x2ca792[_0xfda4('0xb')])?_0x2ca792['UserId']:_0x2ca792[_0xfda4('0xb')]['id'];this[_0xfda4('0x25')]=_0x2ca792[_0xfda4('0x25')];this[_0xfda4('0x26')]='';this[_0xfda4('0x27')]='';}Action[_0xfda4('0x28')][_0xfda4('0x29')]=function(){return util[_0xfda4('0xe')](_0xfda4('0x2a'),this[_0xfda4('0x2b')],this[_0xfda4('0x2c')]);};module[_0xfda4('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 8741bdf..dd9ed3b 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 _0xa9e0=['available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','Interval','stringify','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','sequence','isNil','[clearZombieChannels][talking]','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','status','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannel','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','format','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','catch','loggedIn','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','NOANSWER','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Queue','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','substring','trim','dialCutDigit','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','callerid','originatecalleridname','originatecalleridnum','extractCalleridNumber','toLowerVariables','starttime','YYYY-MM-DD\x20HH:mm:ss','variablesAction','OriginateError','channel','actionid','logLookAgent','clone','isFailure','response','disableContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','transfer','[syncHangup][talking][transfer]','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','variable','keys','value','error','[syncVarSet][Preview]','transfertargetlinkedid','exports','util','lodash','bluebird','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','name','strategy','answered'];(function(_0x3e39c9,_0x152f27){var _0xe511d3=function(_0x25063a){while(--_0x25063a){_0x3e39c9['push'](_0x3e39c9['shift']());}};_0xe511d3(++_0x152f27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x0a9e('0x3'));var Redis=require('ioredis');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x7'));var ami=require('../ami');var rpcDb=require(_0x0a9e('0x8'));var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));config['redis']=_['defaults'](config[_0x0a9e('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xb')]));var Sequence=function(){};Sequence[_0x0a9e('0xc')][_0x0a9e('0xd')]=function(_0x3ab53f){this[_0x0a9e('0xe')]=this[_0x0a9e('0xe')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0xf')]=_0x527cdd[_0x0a9e('0x10')];this[_0x0a9e('0x11')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]={};this[_0x0a9e('0x13')]=_0x527cdd['agents'];this[_0x0a9e('0x14')]=0x0;ami['on'](_0x0a9e('0x15'),this[_0x0a9e('0x16')][_0x0a9e('0x17')](this));ami['on'](_0x0a9e('0x18'),this[_0x0a9e('0x19')]['bind'](this));ami['on'](_0x0a9e('0x1a'),this['syncHangupRequest'][_0x0a9e('0x17')](this));ami['on']('dialend',this[_0x0a9e('0x1b')][_0x0a9e('0x17')](this));ami['on']('newexten',this[_0x0a9e('0x1c')]['bind'](this));ami['on'](_0x0a9e('0x1d'),this[_0x0a9e('0x1e')][_0x0a9e('0x17')](this));ami['on'](_0x0a9e('0x1f'),this[_0x0a9e('0x20')][_0x0a9e('0x17')](this));ami['on'](_0x0a9e('0x21'),this[_0x0a9e('0x22')][_0x0a9e('0x17')](this));this[_0x0a9e('0x23')](this[_0x0a9e('0xf')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x24')](_0x4bb1e3,_0x2c3407);}function emitCampaignPreview(_0x53682f){if(_0x53682f[_0x0a9e('0x25')]==='outbound'){var _0x588269={'id':_0x53682f['id'],'name':_0x53682f[_0x0a9e('0x26')],'strategy':_0x53682f[_0x0a9e('0x27')],'answered':_0x53682f[_0x0a9e('0x28')],'available':_0x53682f[_0x0a9e('0x29')],'loggedIn':_0x53682f['loggedIn'],'pTalking':_0x53682f[_0x0a9e('0x2a')],'sumBillable':_0x53682f[_0x0a9e('0x2b')],'sumDuration':_0x53682f[_0x0a9e('0x2c')],'sumHoldTime':_0x53682f[_0x0a9e('0x2d')]||0x0,'talking':_0x53682f[_0x0a9e('0x2e')],'total':_0x53682f[_0x0a9e('0x2f')],'type':_0x53682f[_0x0a9e('0x25')],'unmanaged':_0x53682f['unmanaged'],'abandoned':_0x53682f['abandoned'],'waiting':_0x53682f[_0x0a9e('0x30')],'loggedInDb':_0x53682f[_0x0a9e('0x31')],'dialActive':_0x53682f[_0x0a9e('0x32')],'dialMethod':_0x53682f[_0x0a9e('0x33')],'dialOriginateCallerIdName':_0x53682f['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x53682f[_0x0a9e('0x34')],'dialOriginateTimeout':_0x53682f['dialOriginateTimeout'],'dialPrefix':_0x53682f[_0x0a9e('0x35')],'outboundAnswerAgiCallsDay':_0x53682f['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x53682f[_0x0a9e('0x36')],'outboundBlacklistCallsDay':_0x53682f[_0x0a9e('0x37')],'outboundBusyCallsDay':_0x53682f[_0x0a9e('0x38')],'outboundCongestionCallsDay':_0x53682f[_0x0a9e('0x39')],'outboundDropCallsDayACS':_0x53682f[_0x0a9e('0x3a')],'outboundDropCallsDayCallersExit':_0x53682f[_0x0a9e('0x3b')],'outboundDropCallsDayTimeout':_0x53682f[_0x0a9e('0x3c')],'outboundNoAnswerCallsDay':_0x53682f[_0x0a9e('0x3d')],'outboundNoSuchCallsDay':_0x53682f['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x53682f[_0x0a9e('0x3e')],'outboundReCallsDay':_0x53682f[_0x0a9e('0x3f')],'outboundRejectCallsDay':_0x53682f[_0x0a9e('0x40')],'outboundUnknownCallsDay':_0x53682f[_0x0a9e('0x41')],'outboundAbandonedCallsDay':_0x53682f['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x53682f[_0x0a9e('0x42')],'predictiveIntervalAvgHoldtime':_0x53682f[_0x0a9e('0x43')],'predictiveIntervalAvgTalktime':_0x53682f[_0x0a9e('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x53682f[_0x0a9e('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x53682f[_0x0a9e('0x46')],'predictiveIntervalErlangCalls':_0x53682f[_0x0a9e('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x53682f[_0x0a9e('0x48')],'predictiveIntervalHitRate':_0x53682f[_0x0a9e('0x49')],'predictiveIntervalMultiplicativeFactor':_0x53682f[_0x0a9e('0x4a')],'predictiveIntervalPauses':_0x53682f['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x53682f[_0x0a9e('0x4b')],'predictiveIntervalTotalCalls':_0x53682f['predictiveIntervalTotalCalls'],'message':_0x53682f[_0x0a9e('0x4c')],'originated':_0x53682f[_0x0a9e('0x4d')],'erlangCalls':_0x53682f[_0x0a9e('0x4e')],'erlangCallToSecond':_0x53682f[_0x0a9e('0x4f')],'erlangAbandonmentRate':_0x53682f[_0x0a9e('0x50')],'erlangBusyFactor':_0x53682f['erlangBusyFactor'],'startPredictive':_0x53682f[_0x0a9e('0x51')],'startProgressive':_0x53682f[_0x0a9e('0x52')]};if(_0x53682f[_0x0a9e('0x53')]){_0x588269[_0x0a9e('0x53')]={'id':_0x53682f[_0x0a9e('0x53')]['id'],'name':_0x53682f[_0x0a9e('0x53')][_0x0a9e('0x26')],'active':_0x53682f[_0x0a9e('0x53')]['active'],'callerid':_0x53682f[_0x0a9e('0x53')]['callerid']};}if(_0x53682f[_0x0a9e('0x54')]){_0x588269[_0x0a9e('0x54')]={'id':_0x53682f[_0x0a9e('0x54')]['id'],'name':_0x53682f[_0x0a9e('0x54')]['name']};}var _0x191e91=md5(JSON[_0x0a9e('0x55')](_0x588269));if(_0x53682f[_0x0a9e('0x3')]!==_0x191e91){_0x53682f[_0x0a9e('0x3')]=_0x191e91;emit(util['format']('voice:queue:%s',_0x588269[_0x0a9e('0x26')]),'voice_queue:save',_0x588269);}}}function emitVoiceQueueChannelRemove(_0x24936a){logger[_0x0a9e('0x56')](_0x0a9e('0x57'),JSON[_0x0a9e('0x55')](_0x24936a));emit(util['format'](_0x0a9e('0x58'),_0x24936a[_0x0a9e('0x26')]),_0x0a9e('0x59'),_0x24936a);io['emit'](_0x0a9e('0x5a'),_0x24936a);}function notSendMessagesQueue(_0x1a180b){if(_0x1a180b[_0x0a9e('0x5b')]){if(_0x1a180b['originated']===0x0&&_0x1a180b['pTalking']===0x0){_0x1a180b[_0x0a9e('0x5b')]=![];_0x1a180b[_0x0a9e('0x29')]=0x0;_0x1a180b['paused']=0x0;_0x1a180b[_0x0a9e('0x4c')]=_0x0a9e('0x5c');ut[_0x0a9e('0x5d')](_0x0a9e('0x5e'),_0x1a180b['name']+'\x20is\x20not\x20active');}else{_0x1a180b[_0x0a9e('0x4c')]=_0x0a9e('0x5f');ut['logger'](_0x0a9e('0x5e'),_0x1a180b[_0x0a9e('0x26')]+_0x0a9e('0x60'));}emitCampaignPreview(_0x1a180b);}}Preview['prototype'][_0x0a9e('0x23')]=function(){var _0x2cfea9=this;setInterval(function(){_0x2cfea9[_0x0a9e('0x61')]();},0x7cf);};Preview[_0x0a9e('0xc')][_0x0a9e('0x61')]=function(){var _0xeaa5e5=this[_0x0a9e('0xf')];this[_0x0a9e('0x14')]+=0x1;for(var _0x23b089 in _0xeaa5e5){if(_0xeaa5e5[_0x0a9e('0x62')](_0x23b089)&&(_0xeaa5e5[_0x23b089][_0x0a9e('0x33')]===_0x0a9e('0x6')||_0xeaa5e5[_0x23b089][_0x0a9e('0x33')]===_0x0a9e('0x63'))&&_0xeaa5e5[_0x23b089][_0x0a9e('0x25')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x0a9e('0x14')]=0x0;this[_0x0a9e('0x64')]();}}if(_0xeaa5e5[_0x0a9e('0x62')](_0x23b089)&&_0xeaa5e5[_0x23b089][_0x0a9e('0x33')]===_0x0a9e('0x6')&&_0xeaa5e5[_0x23b089][_0x0a9e('0x25')]===_0x0a9e('0x65')){if(_0xeaa5e5[_0x23b089][_0x0a9e('0x32')]){this[_0x0a9e('0x66')](_0xeaa5e5[_0x23b089]);if(_0xeaa5e5[_0x23b089][_0x0a9e('0x67')])this[_0x0a9e('0x68')](_0xeaa5e5[_0x23b089]);}else{notSendMessagesQueue(_0xeaa5e5[_0x23b089]);}}}};Preview[_0x0a9e('0xc')]['clearZombieChannel']=function(_0x117c99){var _0x138b8b=this;this[_0x0a9e('0x69')][_0x0a9e('0xd')](function(){if(!_[_0x0a9e('0x6a')](_0x138b8b[_0x0a9e('0x12')][_0x117c99])){loggerAction[_0x0a9e('0x56')](_0x0a9e('0x6b'),_0x117c99,'Queue',_0x138b8b[_0x0a9e('0x12')][_0x117c99]['queue'],_0x0a9e('0x6c'),JSON[_0x0a9e('0x55')](_0x138b8b[_0x0a9e('0xf')][_0x138b8b['actions'][_0x117c99][_0x0a9e('0x6d')]][_0x0a9e('0x4d')]),_0x0a9e('0x6e'),JSON[_0x0a9e('0x55')](_0x138b8b[_0x0a9e('0xf')][_0x138b8b[_0x0a9e('0x12')][_0x117c99][_0x0a9e('0x6d')]]['pTalking']),JSON[_0x0a9e('0x55')](_0x138b8b[_0x0a9e('0x12')][_0x117c99][_0x0a9e('0x6f')]),JSON[_0x0a9e('0x55')](_[_0x0a9e('0x70')](_0x138b8b[_0x0a9e('0x12')][_0x117c99],[_0x0a9e('0x71'),_0x0a9e('0x72'),_0x0a9e('0x73'),'ListId'])));return ami[_0x0a9e('0x74')]({'action':_0x0a9e('0x75'),'channel':_0x138b8b['actions'][_0x117c99]['channel']})['catch'](function(_0x1adfee){if(_0x1adfee[_0x0a9e('0x4c')]===_0x0a9e('0x76')){setTimeout(function(){if(_0x138b8b[_0x0a9e('0x12')][_0x117c99]){ut[_0x0a9e('0x77')](_0x138b8b[_0x0a9e('0xf')][_0x138b8b[_0x0a9e('0x12')][_0x117c99][_0x0a9e('0x6d')]],'[clearZombieChannel]');if(_0x138b8b['actions'][_0x117c99]['dialAnswer']===!![]){ut[_0x0a9e('0x78')](_0x138b8b[_0x0a9e('0xf')][_0x138b8b[_0x0a9e('0x12')][_0x117c99]['queue']],_0x0a9e('0x79'));ut[_0x0a9e('0x7a')]('[Dialer][checkChannel][pTalking][Preview]'+_0x117c99,_0x138b8b['actions'][_0x117c99][_0x0a9e('0x6d')]);}ut['loggerError'](_0x0a9e('0x7b')+_0x117c99,_0x138b8b['actions'][_0x117c99][_0x0a9e('0x6d')]);delete _0x138b8b[_0x0a9e('0x12')][_0x117c99];}},0x2328);}});}});};Preview[_0x0a9e('0xc')]['clearZombieChannels']=function(){var _0x2f82da=this;loggerAction[_0x0a9e('0x56')]('[action]',_['size'](this[_0x0a9e('0x12')]));for(var _0x3aedd0 in this['actions']){if(_0x2f82da[_0x0a9e('0x12')]['hasOwnProperty'](_0x3aedd0)){_0x2f82da[_0x0a9e('0x7c')](_0x3aedd0);}}};Preview['prototype'][_0x0a9e('0x68')]=function(_0x4a6deb){var _0x5da27d=this;rpcDb['getContactRecallMe'](_0x4a6deb['id'],ut[_0x0a9e('0x7d')](this['agents']))[_0x0a9e('0x7e')](function(_0x65432){if(!_[_0x0a9e('0x6a')](_0x65432)){for(var _0x19b4df=0x0;_0x19b4df<_0x65432[_0x0a9e('0x7f')];_0x19b4df+=0x1){if(ut[_0x0a9e('0x80')](_0x65432[_0x19b4df][_0x0a9e('0x81')])<_0x4a6deb[_0x0a9e('0x82')]*0x3c){if(_0x65432[_0x19b4df]['Agent']&&!_0x65432[_0x19b4df][_0x0a9e('0x83')][_0x0a9e('0x84')]){_0x5da27d[_0x0a9e('0x85')](_0x65432[_0x19b4df]['id'])[_0x0a9e('0x7e')](ut[_0x0a9e('0x86')](_0x0a9e('0x87')))['catch'](ut[_0x0a9e('0x86')](_0x0a9e('0x87')));}else{rpcDb['disableContact'](_0x65432[_0x19b4df]['id']);}}else{var _0x3649cc=new Action(_0x65432[_0x19b4df],_0x4a6deb);_0x3649cc['starttime']=moment()[_0x0a9e('0x88')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a6deb['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x3649cc,0x17,_0x0a9e('0x89'));if(_0x4a6deb['dialRecallInQueue']){rpcDb[_0x0a9e('0x8a')](ut[_0x0a9e('0x8b')](_0x65432[_0x19b4df]));rpcDb[_0x0a9e('0x8c')](_0x3649cc,_0x0a9e('0x8d'));}else{ut[_0x0a9e('0x8e')](_0x3649cc,0x16,_0x0a9e('0x8f'));rpcDb['createCustomerHistory'](_0x3649cc,_0x0a9e('0x90'));rpcDb['createCustomerFinal'](_0x3649cc,_0x0a9e('0x90'));}}}}})[_0x0a9e('0x91')](ut[_0x0a9e('0x86')]('[getContactRecallMe]'));};Preview[_0x0a9e('0xc')][_0x0a9e('0x66')]=function(_0x119677){_0x119677[_0x0a9e('0x5b')]=!![];if(ut['IsNotLoggedIn'](_0x119677[_0x0a9e('0x92')])){_0x119677[_0x0a9e('0x4c')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x0a9e('0x93')](_0x119677[_0x0a9e('0x32')])){_0x119677[_0x0a9e('0x4c')]=_0x0a9e('0x5c');}else if(!this[_0x0a9e('0x94')](_0x119677['Trunk'])){if(!this[_0x0a9e('0x94')](_0x119677[_0x0a9e('0x95')])){_0x119677[_0x0a9e('0x4c')]='TRUNK_IS_NOT_REACHABLE';}else{_0x119677[_0x0a9e('0x4c')]='ACTIVE';}}else{_0x119677['message']=_0x0a9e('0x96');}emitCampaignPreview(_0x119677);};Preview[_0x0a9e('0xc')][_0x0a9e('0x97')]=function(_0x19c995,_0x186f39,_0xc8c264){var _0x387489=this;var _0x54a37d=this[_0x0a9e('0x12')][_0x186f39];var _0x1cc4f3=this[_0x0a9e('0xf')][_0x54a37d[_0x0a9e('0x6d')]];var _0x2bbb86;if(_0x1cc4f3){switch(_0xc8c264){case'1':_0x1cc4f3[_0x0a9e('0x98')]+=0x1;_0x54a37d[_0x0a9e('0x99')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut[_0x0a9e('0x9b')](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x0,'NoSuchNumber');ami[_0x0a9e('0x24')](_0x0a9e('0x9c'),ut[_0x0a9e('0x9d')](_0x54a37d,'nosuchnumber'));rpcDb[_0x0a9e('0x8c')](_0x54a37d,_0x0a9e('0x9e'));if(ut['totalGlobal'](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut[_0x0a9e('0xa0')](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xa2')](_0x2bbb86,_0x0a9e('0xa3'));}else{if(_0x54a37d['countnosuchnumberretry']>=_0x1cc4f3['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x54a37d,_0x0a9e('0xa3'));}else{rpcDb[_0x0a9e('0xa4')](ut[_0x0a9e('0xa5')](_0x54a37d,_0x0a9e('0x99'),_0x1cc4f3[_0x0a9e('0xa6')]),_0x54a37d[_0x0a9e('0xa7')],_0x54a37d[_0x0a9e('0xa8')]);}}delete this[_0x0a9e('0x12')][_0x19c995['linkedid']];break;case _0x0a9e('0xa9'):var _0xcbc8b2=moment()[_0x0a9e('0x88')]('YYYY-MM-DD\x20HH:mm:ss');_0x54a37d[_0x0a9e('0xaa')]=_0xcbc8b2;_0x54a37d['answertime']=_0xcbc8b2;_0x54a37d[_0x0a9e('0x6f')]=!![];_0x1cc4f3[_0x0a9e('0x2a')]+=0x1;logger['info'](_0x0a9e('0xab'),_0x54a37d[_0x0a9e('0xac')],_0x0a9e('0xad'),_0x1cc4f3[_0x0a9e('0x26')],'pTalking:\x20',_0x1cc4f3[_0x0a9e('0x2a')]);ami[_0x0a9e('0x24')](_0x0a9e('0xae'),ut[_0x0a9e('0x9d')](_0x54a37d,'connect',this[_0x0a9e('0xf')][_0x54a37d[_0x0a9e('0x6d')]]));if(_0x1cc4f3[_0x0a9e('0xaf')]){ami[_0x0a9e('0x24')]('custom:agentConnectPreview',ut[_0x0a9e('0xb0')](_0x54a37d));}break;case'16':ami[_0x0a9e('0x24')](_0x0a9e('0xb1'),ut[_0x0a9e('0x9d')](_0x54a37d,_0x0a9e('0xb2'),this[_0x0a9e('0xf')][_0x54a37d[_0x0a9e('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0x0a9e('0x9d')](_0x54a37d,_0x0a9e('0xb2')));_0x1cc4f3[_0x0a9e('0x36')]+=0x1;_0x1cc4f3[_0x0a9e('0x2f')]+=0x1;_0x1cc4f3[_0x0a9e('0x28')]+=0x1;ut[_0x0a9e('0x78')](_0x1cc4f3,_0x0a9e('0xb3'));_0x54a37d['countglobal']=ut[_0x0a9e('0x9b')](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x4,_0x0a9e('0xb4'));rpcDb['createCustomerHistory'](_0x54a37d,_0x0a9e('0xb5'));rpcDb[_0x0a9e('0xa2')](_0x54a37d,_0x0a9e('0xb6'));rpcDb[_0x0a9e('0xb7')](_0x54a37d);_0x1cc4f3['sumDuration']+=_0x54a37d['talktime'];_0x1cc4f3[_0x0a9e('0x2b')]+=_0x54a37d[_0x0a9e('0xb8')];logger['info'](_0x0a9e('0xb9'),_0x54a37d['uniqueid'],_0x0a9e('0xad'),_0x1cc4f3[_0x0a9e('0x26')],'pTalking:\x20',_0x1cc4f3[_0x0a9e('0x2a')]);delete this[_0x0a9e('0x12')][_0x19c995[_0x0a9e('0xba')]];break;case _0x0a9e('0xbb'):_0x1cc4f3[_0x0a9e('0x38')]+=0x1;_0x54a37d[_0x0a9e('0xbc')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut['totalGlobal'](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x5,_0x0a9e('0xbd'));ami[_0x0a9e('0x24')](_0x0a9e('0xbe'),ut['buildObj'](_0x54a37d,_0x0a9e('0xbf')));rpcDb[_0x0a9e('0x8c')](_0x54a37d,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x0a9e('0x9b')](_0x54a37d)>=_0x1cc4f3['dialGlobalMaxRetry']){_0x2bbb86=ut[_0x0a9e('0xa0')](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xa2')](_0x2bbb86,_0x0a9e('0xc0'));}else{if(_0x54a37d['countbusyretry']>=_0x1cc4f3['dialBusyMaxRetry']){rpcDb[_0x0a9e('0xa2')](_0x54a37d,_0x0a9e('0xc1'));}else{rpcDb[_0x0a9e('0xa4')](ut['scheduledAt'](_0x54a37d,_0x0a9e('0xbc'),_0x1cc4f3[_0x0a9e('0xc2')]),_0x54a37d['unlockAgent'],_0x54a37d['activeContact']);}}break;case _0x0a9e('0xc3'):_0x1cc4f3['outboundNoAnswerCallsDay']+=0x1;_0x54a37d['countnoanswerretry']+=0x1;_0x54a37d['countglobal']=ut[_0x0a9e('0x9b')](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x3,_0x0a9e('0xc4'));ami[_0x0a9e('0x24')](_0x0a9e('0xc5'),ut[_0x0a9e('0x9d')](_0x54a37d,'noanswer'));rpcDb[_0x0a9e('0x8c')](_0x54a37d,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x0a9e('0x9b')](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut[_0x0a9e('0xa0')](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb['createCustomerFinal'](_0x2bbb86,_0x0a9e('0xc6'));}else{if(_0x54a37d[_0x0a9e('0xc7')]>=_0x1cc4f3[_0x0a9e('0xc8')]){rpcDb['createCustomerFinal'](_0x54a37d,_0x0a9e('0xc9'));}else{rpcDb[_0x0a9e('0xa4')](ut[_0x0a9e('0xa5')](_0x54a37d,_0x0a9e('0xc7'),_0x1cc4f3[_0x0a9e('0xca')]),_0x54a37d[_0x0a9e('0xa7')],_0x54a37d[_0x0a9e('0xa8')]);}}break;case _0x0a9e('0xcb'):_0x1cc4f3['outboundCongestionCallsDay']+=0x1;_0x54a37d[_0x0a9e('0xcc')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut['totalGlobal'](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x8,_0x0a9e('0xcd'));ami[_0x0a9e('0x24')]('custom:agentcongestion',ut[_0x0a9e('0x9d')](_0x54a37d,'congestion'));rpcDb[_0x0a9e('0x8c')](_0x54a37d,_0x0a9e('0xce'));if(ut[_0x0a9e('0x9b')](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut[_0x0a9e('0xa0')](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xa2')](_0x2bbb86,_0x0a9e('0xcf'));}else{if(_0x54a37d['countcongestionretry']>=_0x1cc4f3[_0x0a9e('0xd0')]){rpcDb[_0x0a9e('0xa2')](_0x54a37d,_0x0a9e('0xce'));}else{rpcDb[_0x0a9e('0xa4')](ut[_0x0a9e('0xa5')](_0x54a37d,_0x0a9e('0xcc'),_0x1cc4f3[_0x0a9e('0xc2')]),_0x54a37d[_0x0a9e('0xa7')],_0x54a37d[_0x0a9e('0xa8')]);}}break;case _0x0a9e('0xd1'):_0x1cc4f3[_0x0a9e('0x40')]+=0x1;_0x54a37d[_0x0a9e('0xd2')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut['totalGlobal'](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x14,_0x0a9e('0xd3'));ami[_0x0a9e('0x24')](_0x0a9e('0xd4'),ut[_0x0a9e('0x9d')](_0x54a37d,'agentreject'));rpcDb[_0x0a9e('0x8c')](_0x54a37d,_0x0a9e('0xd5'));if(ut['totalGlobal'](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut['cloneAction'](_0x54a37d,0x14,_0x0a9e('0xd3'));rpcDb[_0x0a9e('0xa2')](_0x2bbb86,_0x0a9e('0xd6'));}else{if(_0x54a37d[_0x0a9e('0xd2')]>=_0x1cc4f3['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0xa2')](_0x54a37d,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0xa4')](ut[_0x0a9e('0xa5')](_0x54a37d,'countagentrejectretry',_0x1cc4f3[_0x0a9e('0xd7')]),_0x54a37d[_0x0a9e('0xa7')],_0x54a37d[_0x0a9e('0xa8')]);}}break;case'ABANDONED':_0x1cc4f3['outboundAbandonedCallsDay']+=0x1;_0x54a37d[_0x0a9e('0xd8')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut[_0x0a9e('0x9b')](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0xb,_0x0a9e('0xd9'));rpcDb[_0x0a9e('0x8c')](_0x54a37d,_0x0a9e('0xda'));if(ut[_0x0a9e('0x9b')](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut['cloneAction'](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb['createCustomerFinal'](_0x2bbb86,_0x0a9e('0xda'));}else{if(_0x54a37d[_0x0a9e('0xdb')]>=_0x1cc4f3[_0x0a9e('0xdc')]){rpcDb[_0x0a9e('0xa2')](_0x54a37d,_0x0a9e('0xda'));}else{rpcDb['rescheduleContact'](ut[_0x0a9e('0xa5')](_0x54a37d,_0x0a9e('0xd8'),_0x1cc4f3[_0x0a9e('0xdd')]),_0x54a37d[_0x0a9e('0xa7')],_0x54a37d[_0x0a9e('0xa8')]);}}break;case'18':_0x1cc4f3['outboundUnknownCallsDay']+=0x1;_0x54a37d['countmachineretry']+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut['totalGlobal'](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x12,_0x19c995[_0x0a9e('0xde')]||_0x19c995[_0x0a9e('0xdf')]);ami[_0x0a9e('0x24')](_0x0a9e('0xe0'),ut[_0x0a9e('0x9d')](_0x54a37d,'amd'));rpcDb['createCustomerHistory'](_0x54a37d,_0x0a9e('0xe1'));if(ut['totalGlobal'](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut['cloneAction'](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb['createCustomerFinal'](_0x2bbb86,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x0a9e('0xa2')](_0x54a37d,_0x0a9e('0xe1'));}delete this['actions'][_0x19c995[_0x0a9e('0xba')]];break;case'19':_0x1cc4f3[_0x0a9e('0x41')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut[_0x0a9e('0x9b')](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x13,_0x19c995['cause-txt']||_0x19c995['dialstatus']);ami[_0x0a9e('0x24')](_0x0a9e('0xe0'),ut[_0x0a9e('0x9d')](_0x54a37d,_0x0a9e('0xe2')));rpcDb[_0x0a9e('0x8c')](_0x54a37d,'[callProgressDetectingCustomer][machine]');if(ut[_0x0a9e('0x9b')](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut['cloneAction'](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xa2')](_0x2bbb86,_0x0a9e('0xe3'));}else{rpcDb[_0x0a9e('0xa2')](_0x54a37d,_0x0a9e('0xe3'));}delete this[_0x0a9e('0x12')][_0x19c995[_0x0a9e('0xba')]];break;default:if(_0x54a37d[_0x0a9e('0x6f')]){ut[_0x0a9e('0x78')](_0x1cc4f3,_0x0a9e('0xe4'));ut['loggerError'](_0x0a9e('0xe5')+_0x1cc4f3[_0x0a9e('0x26')],_0x19c995);}_0x1cc4f3[_0x0a9e('0x41')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut[_0x0a9e('0x9b')](_0x54a37d);ut['logCustomer'](_0x54a37d,0xc,_0x19c995['cause-txt']||_0x19c995[_0x0a9e('0xdf')]);rpcDb[_0x0a9e('0x8c')](_0x54a37d,_0x0a9e('0xe6'));if(ut[_0x0a9e('0x9b')](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut['cloneAction'](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xa2')](_0x2bbb86,_0x0a9e('0xe7'));}else{rpcDb['createCustomerFinal'](_0x54a37d,_0x0a9e('0xe7'));}delete this['actions'][_0x19c995[_0x0a9e('0xba')]];}if(!(_0x54a37d['dialAnswer']&&_0xc8c264==='16')){ut[_0x0a9e('0x77')](_0x1cc4f3,_0x0a9e('0xe8'));logger[_0x0a9e('0x56')]('[originated][decrement][callProgressDetectingCustomer]',_0x54a37d[_0x0a9e('0xac')],'\x20Queue',_0x1cc4f3[_0x0a9e('0x26')],_0x0a9e('0x6c'),_0x1cc4f3[_0x0a9e('0x4d')]);}if(_0xc8c264!==_0x0a9e('0xa9')){delete this[_0x0a9e('0x12')][_0x19c995[_0x0a9e('0xba')]];delete this[_0x0a9e('0x12')][_0x19c995[_0x0a9e('0xe9')]];}}};Preview[_0x0a9e('0xc')][_0x0a9e('0xea')]=function(_0x4262d0,_0xc876d4,_0x2415fe){if(_[_0x0a9e('0xeb')](_0xc876d4)&&_0x0a9e('0xec')!==typeof _0xc876d4){return;}if(_[_0x0a9e('0xeb')](_0x2415fe)&&'object'!==typeof _0x2415fe){return;}switch(_0x2415fe['reason']){case'0':ut[_0x0a9e('0xed')](_0x4262d0,0x0,'NoSuchNumber');rpcDb[_0x0a9e('0xee')](_0x4262d0,_0x0a9e('0xef'));break;case'3':ut['logAgent'](_0x4262d0,0x3,_0x0a9e('0xc4'));rpcDb[_0x0a9e('0xee')](_0x4262d0,_0x0a9e('0xf0'));break;case'5':ut[_0x0a9e('0xed')](_0x4262d0,0x5,'Busy');rpcDb[_0x0a9e('0xee')](_0x4262d0,_0x0a9e('0xf1'));break;case'8':ut[_0x0a9e('0xed')](_0x4262d0,0x8,_0x0a9e('0xcd'));rpcDb['createAgentHistory'](_0x4262d0,_0x0a9e('0xf2'));break;case'22':ut[_0x0a9e('0xed')](_0x4262d0,0x16,_0x0a9e('0xf3'));rpcDb['createAgentHistory'](_0x4262d0,_0x0a9e('0xf4'));break;default:ut[_0x0a9e('0xed')](_0x4262d0,0xc,_0x2415fe[_0x0a9e('0xf5')]);rpcDb['createAgentHistory'](_0x4262d0,_0x0a9e('0xf2'));}ut[_0x0a9e('0x77')](_0xc876d4,_0x0a9e('0xf6'));logger[_0x0a9e('0x56')](_0x0a9e('0xf7'),_0x4262d0['uniqueid'],_0x0a9e('0xad'),_0xc876d4[_0x0a9e('0x26')],'originated:\x20',_0xc876d4[_0x0a9e('0x4d')]);delete this[_0x0a9e('0x12')][_0x4262d0[_0x0a9e('0xac')]];};Preview['prototype']['checkInBlack']=function(_0x523d08,_0x1015aa,_0x4a70ce,_0x55f91a,_0x183244){var _0x1f78b4=this;return new BPromise(function(_0x2a8d55,_0x54ce11){if(_[_0x0a9e('0x6a')](_0x1015aa)||_[_0x0a9e('0x6a')](_0x1015aa[_0x0a9e('0xf8')])||_[_0x0a9e('0x6a')](_0x1015aa[_0x0a9e('0xf8')][_0x0a9e('0xf9')])||_[_0x0a9e('0x6a')](_0x1015aa[_0x0a9e('0x73')])){_0x54ce11(ut[_0x0a9e('0x4c')]('Contact\x20is\x20undefined',_0x55f91a,_0x183244));return;}var _0x43c397=uuid['v4']();var _0x5526a7=_0x1f78b4[_0x0a9e('0xf')][_0x1015aa[_0x0a9e('0xfa')][_0x0a9e('0x26')]];var _0x3cf222=_0x4a70ce?_0x1f78b4[_0x0a9e('0x13')][_0x4a70ce]['id']:undefined;_0x1f78b4[_0x0a9e('0x12')][_0x43c397]=new Action(_0x1015aa,_0x5526a7,_0x43c397,_0x4a70ce,_0x3cf222);var _0x53d9fc=_0x1f78b4[_0x0a9e('0x12')][_0x43c397];_0x53d9fc[_0x0a9e('0xa7')]=_0x55f91a;_0x53d9fc[_0x0a9e('0xa8')]=_0x183244;_0x53d9fc[_0x0a9e('0xfb')]=_0x4a70ce;if(_['isEmpty'](_0x523d08)){_0x1f78b4[_0x0a9e('0xfc')](_0x53d9fc,_0x5526a7,_0x1015aa,_0x4a70ce)[_0x0a9e('0x7e')](function(_0x43beea){logger[_0x0a9e('0x56')](_0x0a9e('0xfd'),_0x0a9e('0xfe')+_0x53d9fc[_0x0a9e('0x6d')]+_0x0a9e('0xff')+_0x53d9fc[_0x0a9e('0x100')],JSON[_0x0a9e('0x55')](_0x43beea));ami['emit'](_0x0a9e('0x101'),ut[_0x0a9e('0x9d')](_0x53d9fc,_0x0a9e('0x102'),_0x1f78b4[_0x0a9e('0xf')][_0x53d9fc[_0x0a9e('0x6d')]]));_0x2a8d55(ut[_0x0a9e('0x4c')](_0x0a9e('0x103')));})[_0x0a9e('0x91')](function(_0x566b90){ut[_0x0a9e('0x5d')](_0x0a9e('0x104'),_0x566b90);_0x54ce11(ut[_0x0a9e('0x4c')]('Call\x20failed',_0x55f91a,_0x183244));});}else{_0x5526a7[_0x0a9e('0x37')]+=0x1;ut[_0x0a9e('0x105')](_0x53d9fc);rpcDb[_0x0a9e('0x106')](_0x53d9fc,_0x0a9e('0x107'));delete _0x1f78b4[_0x0a9e('0x12')][_0x43c397];_0x54ce11(ut[_0x0a9e('0x4c')](_0x0a9e('0x108'),_0x55f91a,_0x183244));}});};Preview[_0x0a9e('0xc')][_0x0a9e('0x94')]=function(_0x451010){return!_['isNil'](_0x451010)&&!_[_0x0a9e('0x6a')](_0x451010[_0x0a9e('0x26')])&&!_[_0x0a9e('0x6a')](_0x451010[_0x0a9e('0x109')])&&_0x451010[_0x0a9e('0x109')]&&!_[_0x0a9e('0x6a')](this['trunks'][util[_0x0a9e('0x88')]('SIP/%s',_0x451010['name'])])&&!_['isNil'](this[_0x0a9e('0x11')][util[_0x0a9e('0x88')](_0x0a9e('0x10a'),_0x451010[_0x0a9e('0x26')])]['status'])&&(this[_0x0a9e('0x11')][util[_0x0a9e('0x88')](_0x0a9e('0x10a'),_0x451010[_0x0a9e('0x26')])][_0x0a9e('0x75')]==='reachable'||this['trunks'][util[_0x0a9e('0x88')](_0x0a9e('0x10a'),_0x451010[_0x0a9e('0x26')])]['status']===_0x0a9e('0x10b'));};Preview[_0x0a9e('0xc')][_0x0a9e('0x85')]=function(_0x4cee8c,_0x8ad1c0){var _0x2bf85d=this;return new BPromise(function(_0x15ba6b,_0x4eda8f){_0x2bf85d[_0x0a9e('0x10c')](_0x4cee8c,_0x8ad1c0)[_0x0a9e('0x7e')](function(_0x3b7213){_0x15ba6b(_['pick'](_0x3b7213,['message']));})['catch'](function(_0x3b04fd){if(_0x3b04fd[_0x0a9e('0x10d')]){rpcDb[_0x0a9e('0x10e')](_0x4cee8c);}if(_0x3b04fd[_0x0a9e('0x109')]){rpcDb['disableContact'](_0x4cee8c);}_0x4eda8f(_[_0x0a9e('0x70')](_0x3b04fd,['message']));});});};Preview[_0x0a9e('0xc')][_0x0a9e('0x10c')]=function(_0x242f23,_0x57f673){var _0x33b4b3=this;return new BPromise(function(_0x33a26c,_0xb8a476){var _0x580dd6,_0x40eb5d;rpcDb['getContactPreview'](_0x242f23)[_0x0a9e('0x7e')](function(_0x5c57e1){if(!_[_0x0a9e('0x6a')](_0x5c57e1[0x0])){_0x40eb5d=_0x5c57e1[0x0]['recallme']?![]:!![];_0x580dd6=_0x5c57e1[0x0][_0x0a9e('0x10f')]?!![]:![];_0x580dd6=_0x57f673?!![]:_0x580dd6;}var _0x37215d=_0x33b4b3[_0x0a9e('0x110')](_0x5c57e1);if(_0x37215d[_0x0a9e('0x111')]){rpcDb[_0x0a9e('0x112')](_[_0x0a9e('0x70')](_0x5c57e1[0x0],[_0x0a9e('0x73'),'Contact.phone']))[_0x0a9e('0x7e')](function(_0x1c9ea2){_0x33b4b3['checkInBlack'](_0x1c9ea2,_0x5c57e1[0x0],_0x57f673,_0x40eb5d,_0x580dd6)[_0x0a9e('0x7e')](function(_0x3753ca){_0x33a26c(_0x3753ca);})['catch'](function(_0x39070b){_0xb8a476(_0x39070b);});})[_0x0a9e('0x91')](function(_0x16b578){ut['logger'](_0x0a9e('0x113'),_0x16b578);_0xb8a476(ut[_0x0a9e('0x4c')](_0x0a9e('0x114'),_0x40eb5d,_0x580dd6));});}else{_0xb8a476(ut[_0x0a9e('0x4c')](_0x37215d[_0x0a9e('0x4c')],_0x40eb5d,_0x580dd6));}})[_0x0a9e('0x91')](function(_0x3ba897){ut[_0x0a9e('0x5d')](_0x0a9e('0x115'),_0x3ba897);_0xb8a476(ut[_0x0a9e('0x4c')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x0a9e('0xc')]['validateContact']=function(_0x3c9854){if(_[_0x0a9e('0x6a')](_0x3c9854)||_[_0x0a9e('0x116')](_0x3c9854)||!_[_0x0a9e('0x6a')](_0x3c9854[0x0][_0x0a9e('0x83')])&&_[_0x0a9e('0x6a')](_0x3c9854[0x0]['Agent'][_0x0a9e('0x26')])){ut[_0x0a9e('0x5d')](_0x0a9e('0x117'),_0x3c9854);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x11e4e3=this[_0x0a9e('0xf')][_0x3c9854[0x0][_0x0a9e('0xfa')][_0x0a9e('0x26')]];_0x11e4e3[_0x0a9e('0x4c')]=_0x0a9e('0x96');if(_[_0x0a9e('0x6a')](_0x11e4e3)){ut['logger'](_0x0a9e('0x118'),_0x11e4e3);return{'isValid':![],'message':_0x0a9e('0x119')};}if(!this[_0x0a9e('0x94')](_0x11e4e3[_0x0a9e('0x53')])){ut[_0x0a9e('0x5d')](_0x0a9e('0x11a'),_0x0a9e('0x11b')+_0x11e4e3['name']+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x0a9e('0x94')](_0x11e4e3[_0x0a9e('0x95')])){ut[_0x0a9e('0x5d')](_0x0a9e('0x11a'),_0x11e4e3[_0x0a9e('0x26')]+_0x0a9e('0x11c'));return{'isValid':![],'message':_0x0a9e('0x11d')};}}if(!ut['isActive'](_0x11e4e3[_0x0a9e('0x32')])){ut[_0x0a9e('0x5d')](_0x0a9e('0x11e'),_0x11e4e3[_0x0a9e('0x26')]+_0x0a9e('0x11f'));return{'isValid':![],'message':_0x0a9e('0x11b')+_0x11e4e3[_0x0a9e('0x26')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x0a9e('0x120')};};Preview[_0x0a9e('0xc')][_0x0a9e('0xfc')]=function(_0x5885c3,_0x2b8ad4,_0x387817,_0x2030cf){var _0x292f02=this;return new BPromise(function(_0x5c8dc4,_0x38892b){var _0xcbbea0=_0x5885c3[_0x0a9e('0xac')];var _0x93d953=_0x292f02[_0x0a9e('0x94')](_0x2b8ad4[_0x0a9e('0x53')])?util[_0x0a9e('0x88')](_0x0a9e('0x121'),_0x2b8ad4['Trunk'][_0x0a9e('0x26')],_[_0x0a9e('0x6a')](_0x2b8ad4[_0x0a9e('0x35')])?'':_0x2b8ad4[_0x0a9e('0x35')]['trim']()||'',_0x2b8ad4['dialCutDigit']>0x0?_0x387817[_0x0a9e('0xf8')][_0x0a9e('0xf9')][_0x0a9e('0x122')](_0x2b8ad4['dialCutDigit']):_0x387817[_0x0a9e('0xf8')][_0x0a9e('0xf9')]):util['format'](_0x0a9e('0x121'),_['isNil'](_0x2b8ad4[_0x0a9e('0x95')])?_0x2b8ad4['Trunk']['name']:_0x2b8ad4['TrunkBackup'][_0x0a9e('0x26')],_[_0x0a9e('0x6a')](_0x2b8ad4[_0x0a9e('0x35')])?'':_0x2b8ad4[_0x0a9e('0x35')][_0x0a9e('0x123')]()||'',_0x2b8ad4[_0x0a9e('0x124')]>0x0?_0x387817['Contact'][_0x0a9e('0xf9')][_0x0a9e('0x122')](_0x2b8ad4[_0x0a9e('0x124')]):_0x387817[_0x0a9e('0xf8')][_0x0a9e('0xf9')]);var _0x18dccf=_0x292f02[_0x0a9e('0x94')](_0x2b8ad4['Trunk'])?ut['getCallerId'](_0x2b8ad4[_0x0a9e('0x53')]['callerid'],_0x2b8ad4[_0x0a9e('0x125')],_0x2b8ad4[_0x0a9e('0x126')]>0x0?ut[_0x0a9e('0x127')](_0x2b8ad4[_0x0a9e('0x34')],_0x2b8ad4[_0x0a9e('0x126')]):_0x2b8ad4[_0x0a9e('0x34')]):ut['getCallerId'](_[_0x0a9e('0x6a')](_0x2b8ad4['TrunkBackup'])?_0x2b8ad4['Trunk'][_0x0a9e('0x128')]:_0x2b8ad4['TrunkBackup'][_0x0a9e('0x128')],_0x2b8ad4['dialOriginateCallerIdName'],_0x2b8ad4['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0a9e('0x127')](_0x2b8ad4['dialOriginateCallerIdNumber'],_0x2b8ad4[_0x0a9e('0x126')]):_0x2b8ad4[_0x0a9e('0x34')]);if(_0x18dccf){_0x5885c3[_0x0a9e('0x129')]=ut['extractCalleridName'](_0x18dccf);_0x5885c3[_0x0a9e('0x12a')]=ut[_0x0a9e('0x12b')](_0x18dccf);}var _0x3ea310=ut['addVariables'](_0x2b8ad4,_0x387817,_0x93d953,_0x18dccf,_0xcbbea0,_0x5885c3);_['merge'](_0x5885c3,ut[_0x0a9e('0x12c')](_0x3ea310));_0x5885c3[_0x0a9e('0x12d')]=moment()[_0x0a9e('0x88')](_0x0a9e('0x12e'));ami[_0x0a9e('0x74')](ut[_0x0a9e('0x12f')](_0x5885c3,_0x2b8ad4,_0x3ea310,_0x5885c3[_0x0a9e('0xa8')],_0x2030cf))[_0x0a9e('0x7e')](function(_0x937b2a){_0x2b8ad4[_0x0a9e('0x4d')]+=0x1;logger['info']('[originated][increment]',_0xcbbea0,'\x20Queue',_0x2b8ad4[_0x0a9e('0x26')],_0x0a9e('0x6c'),_0x2b8ad4[_0x0a9e('0x4d')]);_0x5c8dc4(_0x937b2a);})[_0x0a9e('0x91')](function(_0xb0e231){ut[_0x0a9e('0xed')](_0x5885c3,0xe,_0x0a9e('0x130'));rpcDb[_0x0a9e('0xee')](_0x5885c3,'[originateFailure][logOriginateFailure]');_0x38892b(_0xb0e231);});});};Preview['prototype'][_0x0a9e('0x1c')]=function(_0x98a973){if(this['actions'][_0x98a973[_0x0a9e('0xba')]]){this[_0x0a9e('0x12')][_0x98a973[_0x0a9e('0xba')]][_0x0a9e('0x131')]=_0x98a973[_0x0a9e('0x131')];}};Preview[_0x0a9e('0xc')][_0x0a9e('0x16')]=function(_0x262281){var _0x59f8f7=this;var _0x400800=this[_0x0a9e('0x12')][_0x262281[_0x0a9e('0x132')]];if(_0x400800){if(_0x400800['lookAgent']&&this[_0x0a9e('0x13')][_0x400800[_0x0a9e('0xfb')]]){ut[_0x0a9e('0x133')](_0x400800,this[_0x0a9e('0x13')][_0x400800[_0x0a9e('0xfb')]][_0x0a9e('0x26')],this[_0x0a9e('0x13')][_0x400800[_0x0a9e('0xfb')]]['id']);}var _0x3a9c0f=_[_0x0a9e('0x134')](_0x400800);_0x3a9c0f[_0x0a9e('0xaa')]=moment()[_0x0a9e('0x88')]('YYYY-MM-DD\x20HH:mm:ss');var _0x572a72=_0x59f8f7[_0x0a9e('0xf')][_0x400800[_0x0a9e('0x6d')]];if(ut[_0x0a9e('0x135')](_0x262281[_0x0a9e('0x136')])){if(_0x400800[_0x0a9e('0xa7')]){rpcDb[_0x0a9e('0x10e')](_0x400800[_0x0a9e('0x100')]);}if(_0x400800['activeContact']){rpcDb[_0x0a9e('0x137')](_0x400800['idContact']);}ami[_0x0a9e('0x24')](_0x0a9e('0x138'),ut[_0x0a9e('0x9d')](_0x400800,_0x0a9e('0x139'),this[_0x0a9e('0xf')][_0x400800[_0x0a9e('0x6d')]]));this[_0x0a9e('0xea')](_0x3a9c0f,_0x572a72,_0x262281);}else{_0x400800[_0x0a9e('0x12d')]=moment()[_0x0a9e('0x88')](_0x0a9e('0x12e'));ut[_0x0a9e('0xed')](_0x3a9c0f,0x4,_0x0a9e('0xb4'));rpcDb[_0x0a9e('0xee')](_0x3a9c0f,_0x0a9e('0x13a'));}}};Preview[_0x0a9e('0xc')][_0x0a9e('0x19')]=function(_0x5b78a8){var _0x54cf62=this;var _0x9dc1de=this[_0x0a9e('0x12')][_0x5b78a8['linkedid']];var _0x5500de;if(_0x9dc1de){_0x5500de=this[_0x0a9e('0xf')][_0x9dc1de[_0x0a9e('0x6d')]];logger[_0x0a9e('0x56')]('[syncHangup][talking]',_0x5b78a8[_0x0a9e('0xba')],'\x20Queue',_0x5500de[_0x0a9e('0x26')],'pTalking:\x20',_0x5500de[_0x0a9e('0x2a')]);}if(this['actions'][_0x5b78a8[_0x0a9e('0xba')]]&&_0x5b78a8[_0x0a9e('0xba')]!==_0x5b78a8[_0x0a9e('0xac')]){if(_0x5b78a8['cause']==='16'&&this[_0x0a9e('0x12')][_0x5b78a8['linkedid']]['dialAnswer']){this[_0x0a9e('0x97')](_0x5b78a8,_0x5b78a8[_0x0a9e('0xba')],_0x5b78a8[_0x0a9e('0x13b')]);}else if(this[_0x0a9e('0x12')][_0x5b78a8[_0x0a9e('0xba')]][_0x0a9e('0x6f')]){logger[_0x0a9e('0x56')](_0x0a9e('0x13c'),_0x5b78a8[_0x0a9e('0xba')],_0x5b78a8[_0x0a9e('0x13b')],_0x0a9e('0xad'),_0x5500de[_0x0a9e('0x26')],_0x0a9e('0x6e'),_0x5500de[_0x0a9e('0x2a')]);this[_0x0a9e('0x97')](_0x5b78a8,_0x5b78a8[_0x0a9e('0xba')],_0x5b78a8[_0x0a9e('0x13b')]);}}else if(_0x9dc1de&&_[_0x0a9e('0x6a')](_0x9dc1de[_0x0a9e('0x13d')])&&_0x5500de['dialQueueProject']&&_0x5b78a8[_0x0a9e('0xba')]===_0x5b78a8[_0x0a9e('0xac')]&&_[_0x0a9e('0x6a')](_0x5b78a8[_0x0a9e('0xf5')])&&_0x5b78a8['cause']==='16'&&_0x5b78a8['channelstate']==='6'&&_['isUndefined'](_0x9dc1de[_0x0a9e('0x13e')])){if(_0x9dc1de['unlockAgent']){rpcDb[_0x0a9e('0x10e')](_0x9dc1de[_0x0a9e('0x100')]);}if(_0x9dc1de[_0x0a9e('0xa8')]){rpcDb[_0x0a9e('0x137')](_0x9dc1de[_0x0a9e('0x100')]);}_0x5b78a8[_0x0a9e('0xf5')]='22';this[_0x0a9e('0xea')](_0x9dc1de,_0x5500de,_0x5b78a8);}else if(_0x9dc1de&&_0x9dc1de[_0x0a9e('0x13e')]){if(_0x5b78a8[_0x0a9e('0x13b')]==='16'&&this[_0x0a9e('0x12')][_0x5b78a8['linkedid']][_0x0a9e('0x6f')]){logger['info'](_0x0a9e('0x13f'),_0x5b78a8['linkedid'],_0x5b78a8[_0x0a9e('0x13b')],_0x0a9e('0xad'),_0x5500de[_0x0a9e('0x26')],'pTalking:\x20',_0x5500de[_0x0a9e('0x2a')]);this[_0x0a9e('0x97')](_0x5b78a8,_0x5b78a8['linkedid'],_0x5b78a8['cause']);}else if(this[_0x0a9e('0x12')][_0x5b78a8[_0x0a9e('0xba')]][_0x0a9e('0x6f')]){logger['info']('[syncHangup][talking][cause]',_0x5b78a8['linkedid'],_0x5b78a8[_0x0a9e('0x13b')],_0x0a9e('0xad'),_0x5500de[_0x0a9e('0x26')],_0x0a9e('0x6e'),_0x5500de[_0x0a9e('0x2a')]);this[_0x0a9e('0x97')](_0x5b78a8,_0x5b78a8[_0x0a9e('0xba')],_0x5b78a8[_0x0a9e('0x13b')]);}}};Preview[_0x0a9e('0xc')][_0x0a9e('0x1b')]=function(_0xc9669d){if(this[_0x0a9e('0x12')][_0xc9669d[_0x0a9e('0xe9')]]&&_0xc9669d[_0x0a9e('0xe9')]!==_0xc9669d[_0x0a9e('0x140')]){this[_0x0a9e('0x97')](_0xc9669d,_0xc9669d[_0x0a9e('0xe9')],_0xc9669d[_0x0a9e('0xdf')]);}};Preview['prototype'][_0x0a9e('0x141')]=function(_0x25ba4e){if(this[_0x0a9e('0x12')][_0x25ba4e[_0x0a9e('0xba')]]&&_0x25ba4e[_0x0a9e('0xba')]!==_0x25ba4e[_0x0a9e('0xac')]&&!this['actions'][_0x25ba4e[_0x0a9e('0xba')]][_0x0a9e('0x6f')]){if(_0x25ba4e[_0x0a9e('0x13b')]==='1'){this[_0x0a9e('0x97')](_0x25ba4e,_0x25ba4e[_0x0a9e('0xba')],_0x25ba4e[_0x0a9e('0x13b')]);}}};Preview[_0x0a9e('0xc')][_0x0a9e('0x142')]=function(_0x4175a6,_0x541af6,_0x5d27c1){if(this[_0x0a9e('0x12')][_0x4175a6]){if(_[_0x0a9e('0x6a')](this['actions'][_0x4175a6][_0x0a9e('0x143')])){this[_0x0a9e('0x12')][_0x4175a6]['variables']={};}this[_0x0a9e('0x12')][_0x4175a6]['variables'][_0x541af6]=_0x5d27c1;}};Preview[_0x0a9e('0xc')][_0x0a9e('0x1e')]=function(_0x58c53c){try{if(!_[_0x0a9e('0x6a')](_0x58c53c)){if(ut[_0x0a9e('0x144')](_['keys'](_0x58c53c[_0x0a9e('0x145')])[0x0])){this[_0x0a9e('0x142')](_0x58c53c['uniqueid'],_[_0x0a9e('0x146')](_0x58c53c[_0x0a9e('0x145')])[0x0],_0x58c53c[_0x0a9e('0x147')]);}}}catch(_0x24361){logger[_0x0a9e('0x148')](_0x0a9e('0x149'),util['inspect'](_0x24361,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xc')][_0x0a9e('0x20')]=function(_0x51e697){if(_0x51e697){if(this[_0x0a9e('0x12')][_0x51e697[_0x0a9e('0x14a')]]){this[_0x0a9e('0x12')][_0x51e697[_0x0a9e('0x14a')]][_0x0a9e('0x13e')]=!![];}}};Preview[_0x0a9e('0xc')][_0x0a9e('0x22')]=function(_0x53fd38){if(_0x53fd38){if(this['actions'][_0x53fd38['transfererlinkedid']]){this['actions'][_0x53fd38['transfererlinkedid']][_0x0a9e('0x13e')]=!![];}}};module[_0x0a9e('0x14b')]=Preview; \ No newline at end of file +var _0xa9e0=['available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','Interval','stringify','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','sequence','isNil','[clearZombieChannels][talking]','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','status','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannel','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','format','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','catch','loggedIn','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','NOANSWER','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Queue','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','substring','trim','dialCutDigit','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','callerid','originatecalleridname','originatecalleridnum','extractCalleridNumber','toLowerVariables','starttime','YYYY-MM-DD\x20HH:mm:ss','variablesAction','OriginateError','channel','actionid','logLookAgent','clone','isFailure','response','disableContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','transfer','[syncHangup][talking][transfer]','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','variable','keys','value','error','[syncVarSet][Preview]','transfertargetlinkedid','exports','util','lodash','bluebird','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','name','strategy','answered'];(function(_0x3f003e,_0xdbd34){var _0xa860fa=function(_0x2de637){while(--_0x2de637){_0x3f003e['push'](_0x3f003e['shift']());}};_0xa860fa(++_0xdbd34);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x0a9e('0x3'));var Redis=require('ioredis');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x7'));var ami=require('../ami');var rpcDb=require(_0x0a9e('0x8'));var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));config['redis']=_['defaults'](config[_0x0a9e('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xb')]));var Sequence=function(){};Sequence[_0x0a9e('0xc')][_0x0a9e('0xd')]=function(_0x3ab53f){this[_0x0a9e('0xe')]=this[_0x0a9e('0xe')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0xf')]=_0x527cdd[_0x0a9e('0x10')];this[_0x0a9e('0x11')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]={};this[_0x0a9e('0x13')]=_0x527cdd['agents'];this[_0x0a9e('0x14')]=0x0;ami['on'](_0x0a9e('0x15'),this[_0x0a9e('0x16')][_0x0a9e('0x17')](this));ami['on'](_0x0a9e('0x18'),this[_0x0a9e('0x19')]['bind'](this));ami['on'](_0x0a9e('0x1a'),this['syncHangupRequest'][_0x0a9e('0x17')](this));ami['on']('dialend',this[_0x0a9e('0x1b')][_0x0a9e('0x17')](this));ami['on']('newexten',this[_0x0a9e('0x1c')]['bind'](this));ami['on'](_0x0a9e('0x1d'),this[_0x0a9e('0x1e')][_0x0a9e('0x17')](this));ami['on'](_0x0a9e('0x1f'),this[_0x0a9e('0x20')][_0x0a9e('0x17')](this));ami['on'](_0x0a9e('0x21'),this[_0x0a9e('0x22')][_0x0a9e('0x17')](this));this[_0x0a9e('0x23')](this[_0x0a9e('0xf')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x24')](_0x4bb1e3,_0x2c3407);}function emitCampaignPreview(_0x53682f){if(_0x53682f[_0x0a9e('0x25')]==='outbound'){var _0x588269={'id':_0x53682f['id'],'name':_0x53682f[_0x0a9e('0x26')],'strategy':_0x53682f[_0x0a9e('0x27')],'answered':_0x53682f[_0x0a9e('0x28')],'available':_0x53682f[_0x0a9e('0x29')],'loggedIn':_0x53682f['loggedIn'],'pTalking':_0x53682f[_0x0a9e('0x2a')],'sumBillable':_0x53682f[_0x0a9e('0x2b')],'sumDuration':_0x53682f[_0x0a9e('0x2c')],'sumHoldTime':_0x53682f[_0x0a9e('0x2d')]||0x0,'talking':_0x53682f[_0x0a9e('0x2e')],'total':_0x53682f[_0x0a9e('0x2f')],'type':_0x53682f[_0x0a9e('0x25')],'unmanaged':_0x53682f['unmanaged'],'abandoned':_0x53682f['abandoned'],'waiting':_0x53682f[_0x0a9e('0x30')],'loggedInDb':_0x53682f[_0x0a9e('0x31')],'dialActive':_0x53682f[_0x0a9e('0x32')],'dialMethod':_0x53682f[_0x0a9e('0x33')],'dialOriginateCallerIdName':_0x53682f['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x53682f[_0x0a9e('0x34')],'dialOriginateTimeout':_0x53682f['dialOriginateTimeout'],'dialPrefix':_0x53682f[_0x0a9e('0x35')],'outboundAnswerAgiCallsDay':_0x53682f['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x53682f[_0x0a9e('0x36')],'outboundBlacklistCallsDay':_0x53682f[_0x0a9e('0x37')],'outboundBusyCallsDay':_0x53682f[_0x0a9e('0x38')],'outboundCongestionCallsDay':_0x53682f[_0x0a9e('0x39')],'outboundDropCallsDayACS':_0x53682f[_0x0a9e('0x3a')],'outboundDropCallsDayCallersExit':_0x53682f[_0x0a9e('0x3b')],'outboundDropCallsDayTimeout':_0x53682f[_0x0a9e('0x3c')],'outboundNoAnswerCallsDay':_0x53682f[_0x0a9e('0x3d')],'outboundNoSuchCallsDay':_0x53682f['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x53682f[_0x0a9e('0x3e')],'outboundReCallsDay':_0x53682f[_0x0a9e('0x3f')],'outboundRejectCallsDay':_0x53682f[_0x0a9e('0x40')],'outboundUnknownCallsDay':_0x53682f[_0x0a9e('0x41')],'outboundAbandonedCallsDay':_0x53682f['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x53682f[_0x0a9e('0x42')],'predictiveIntervalAvgHoldtime':_0x53682f[_0x0a9e('0x43')],'predictiveIntervalAvgTalktime':_0x53682f[_0x0a9e('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x53682f[_0x0a9e('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x53682f[_0x0a9e('0x46')],'predictiveIntervalErlangCalls':_0x53682f[_0x0a9e('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x53682f[_0x0a9e('0x48')],'predictiveIntervalHitRate':_0x53682f[_0x0a9e('0x49')],'predictiveIntervalMultiplicativeFactor':_0x53682f[_0x0a9e('0x4a')],'predictiveIntervalPauses':_0x53682f['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x53682f[_0x0a9e('0x4b')],'predictiveIntervalTotalCalls':_0x53682f['predictiveIntervalTotalCalls'],'message':_0x53682f[_0x0a9e('0x4c')],'originated':_0x53682f[_0x0a9e('0x4d')],'erlangCalls':_0x53682f[_0x0a9e('0x4e')],'erlangCallToSecond':_0x53682f[_0x0a9e('0x4f')],'erlangAbandonmentRate':_0x53682f[_0x0a9e('0x50')],'erlangBusyFactor':_0x53682f['erlangBusyFactor'],'startPredictive':_0x53682f[_0x0a9e('0x51')],'startProgressive':_0x53682f[_0x0a9e('0x52')]};if(_0x53682f[_0x0a9e('0x53')]){_0x588269[_0x0a9e('0x53')]={'id':_0x53682f[_0x0a9e('0x53')]['id'],'name':_0x53682f[_0x0a9e('0x53')][_0x0a9e('0x26')],'active':_0x53682f[_0x0a9e('0x53')]['active'],'callerid':_0x53682f[_0x0a9e('0x53')]['callerid']};}if(_0x53682f[_0x0a9e('0x54')]){_0x588269[_0x0a9e('0x54')]={'id':_0x53682f[_0x0a9e('0x54')]['id'],'name':_0x53682f[_0x0a9e('0x54')]['name']};}var _0x191e91=md5(JSON[_0x0a9e('0x55')](_0x588269));if(_0x53682f[_0x0a9e('0x3')]!==_0x191e91){_0x53682f[_0x0a9e('0x3')]=_0x191e91;emit(util['format']('voice:queue:%s',_0x588269[_0x0a9e('0x26')]),'voice_queue:save',_0x588269);}}}function emitVoiceQueueChannelRemove(_0x24936a){logger[_0x0a9e('0x56')](_0x0a9e('0x57'),JSON[_0x0a9e('0x55')](_0x24936a));emit(util['format'](_0x0a9e('0x58'),_0x24936a[_0x0a9e('0x26')]),_0x0a9e('0x59'),_0x24936a);io['emit'](_0x0a9e('0x5a'),_0x24936a);}function notSendMessagesQueue(_0x1a180b){if(_0x1a180b[_0x0a9e('0x5b')]){if(_0x1a180b['originated']===0x0&&_0x1a180b['pTalking']===0x0){_0x1a180b[_0x0a9e('0x5b')]=![];_0x1a180b[_0x0a9e('0x29')]=0x0;_0x1a180b['paused']=0x0;_0x1a180b[_0x0a9e('0x4c')]=_0x0a9e('0x5c');ut[_0x0a9e('0x5d')](_0x0a9e('0x5e'),_0x1a180b['name']+'\x20is\x20not\x20active');}else{_0x1a180b[_0x0a9e('0x4c')]=_0x0a9e('0x5f');ut['logger'](_0x0a9e('0x5e'),_0x1a180b[_0x0a9e('0x26')]+_0x0a9e('0x60'));}emitCampaignPreview(_0x1a180b);}}Preview['prototype'][_0x0a9e('0x23')]=function(){var _0x2cfea9=this;setInterval(function(){_0x2cfea9[_0x0a9e('0x61')]();},0x7cf);};Preview[_0x0a9e('0xc')][_0x0a9e('0x61')]=function(){var _0xeaa5e5=this[_0x0a9e('0xf')];this[_0x0a9e('0x14')]+=0x1;for(var _0x23b089 in _0xeaa5e5){if(_0xeaa5e5[_0x0a9e('0x62')](_0x23b089)&&(_0xeaa5e5[_0x23b089][_0x0a9e('0x33')]===_0x0a9e('0x6')||_0xeaa5e5[_0x23b089][_0x0a9e('0x33')]===_0x0a9e('0x63'))&&_0xeaa5e5[_0x23b089][_0x0a9e('0x25')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x0a9e('0x14')]=0x0;this[_0x0a9e('0x64')]();}}if(_0xeaa5e5[_0x0a9e('0x62')](_0x23b089)&&_0xeaa5e5[_0x23b089][_0x0a9e('0x33')]===_0x0a9e('0x6')&&_0xeaa5e5[_0x23b089][_0x0a9e('0x25')]===_0x0a9e('0x65')){if(_0xeaa5e5[_0x23b089][_0x0a9e('0x32')]){this[_0x0a9e('0x66')](_0xeaa5e5[_0x23b089]);if(_0xeaa5e5[_0x23b089][_0x0a9e('0x67')])this[_0x0a9e('0x68')](_0xeaa5e5[_0x23b089]);}else{notSendMessagesQueue(_0xeaa5e5[_0x23b089]);}}}};Preview[_0x0a9e('0xc')]['clearZombieChannel']=function(_0x117c99){var _0x138b8b=this;this[_0x0a9e('0x69')][_0x0a9e('0xd')](function(){if(!_[_0x0a9e('0x6a')](_0x138b8b[_0x0a9e('0x12')][_0x117c99])){loggerAction[_0x0a9e('0x56')](_0x0a9e('0x6b'),_0x117c99,'Queue',_0x138b8b[_0x0a9e('0x12')][_0x117c99]['queue'],_0x0a9e('0x6c'),JSON[_0x0a9e('0x55')](_0x138b8b[_0x0a9e('0xf')][_0x138b8b['actions'][_0x117c99][_0x0a9e('0x6d')]][_0x0a9e('0x4d')]),_0x0a9e('0x6e'),JSON[_0x0a9e('0x55')](_0x138b8b[_0x0a9e('0xf')][_0x138b8b[_0x0a9e('0x12')][_0x117c99][_0x0a9e('0x6d')]]['pTalking']),JSON[_0x0a9e('0x55')](_0x138b8b[_0x0a9e('0x12')][_0x117c99][_0x0a9e('0x6f')]),JSON[_0x0a9e('0x55')](_[_0x0a9e('0x70')](_0x138b8b[_0x0a9e('0x12')][_0x117c99],[_0x0a9e('0x71'),_0x0a9e('0x72'),_0x0a9e('0x73'),'ListId'])));return ami[_0x0a9e('0x74')]({'action':_0x0a9e('0x75'),'channel':_0x138b8b['actions'][_0x117c99]['channel']})['catch'](function(_0x1adfee){if(_0x1adfee[_0x0a9e('0x4c')]===_0x0a9e('0x76')){setTimeout(function(){if(_0x138b8b[_0x0a9e('0x12')][_0x117c99]){ut[_0x0a9e('0x77')](_0x138b8b[_0x0a9e('0xf')][_0x138b8b[_0x0a9e('0x12')][_0x117c99][_0x0a9e('0x6d')]],'[clearZombieChannel]');if(_0x138b8b['actions'][_0x117c99]['dialAnswer']===!![]){ut[_0x0a9e('0x78')](_0x138b8b[_0x0a9e('0xf')][_0x138b8b[_0x0a9e('0x12')][_0x117c99]['queue']],_0x0a9e('0x79'));ut[_0x0a9e('0x7a')]('[Dialer][checkChannel][pTalking][Preview]'+_0x117c99,_0x138b8b['actions'][_0x117c99][_0x0a9e('0x6d')]);}ut['loggerError'](_0x0a9e('0x7b')+_0x117c99,_0x138b8b['actions'][_0x117c99][_0x0a9e('0x6d')]);delete _0x138b8b[_0x0a9e('0x12')][_0x117c99];}},0x2328);}});}});};Preview[_0x0a9e('0xc')]['clearZombieChannels']=function(){var _0x2f82da=this;loggerAction[_0x0a9e('0x56')]('[action]',_['size'](this[_0x0a9e('0x12')]));for(var _0x3aedd0 in this['actions']){if(_0x2f82da[_0x0a9e('0x12')]['hasOwnProperty'](_0x3aedd0)){_0x2f82da[_0x0a9e('0x7c')](_0x3aedd0);}}};Preview['prototype'][_0x0a9e('0x68')]=function(_0x4a6deb){var _0x5da27d=this;rpcDb['getContactRecallMe'](_0x4a6deb['id'],ut[_0x0a9e('0x7d')](this['agents']))[_0x0a9e('0x7e')](function(_0x65432){if(!_[_0x0a9e('0x6a')](_0x65432)){for(var _0x19b4df=0x0;_0x19b4df<_0x65432[_0x0a9e('0x7f')];_0x19b4df+=0x1){if(ut[_0x0a9e('0x80')](_0x65432[_0x19b4df][_0x0a9e('0x81')])<_0x4a6deb[_0x0a9e('0x82')]*0x3c){if(_0x65432[_0x19b4df]['Agent']&&!_0x65432[_0x19b4df][_0x0a9e('0x83')][_0x0a9e('0x84')]){_0x5da27d[_0x0a9e('0x85')](_0x65432[_0x19b4df]['id'])[_0x0a9e('0x7e')](ut[_0x0a9e('0x86')](_0x0a9e('0x87')))['catch'](ut[_0x0a9e('0x86')](_0x0a9e('0x87')));}else{rpcDb['disableContact'](_0x65432[_0x19b4df]['id']);}}else{var _0x3649cc=new Action(_0x65432[_0x19b4df],_0x4a6deb);_0x3649cc['starttime']=moment()[_0x0a9e('0x88')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a6deb['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x3649cc,0x17,_0x0a9e('0x89'));if(_0x4a6deb['dialRecallInQueue']){rpcDb[_0x0a9e('0x8a')](ut[_0x0a9e('0x8b')](_0x65432[_0x19b4df]));rpcDb[_0x0a9e('0x8c')](_0x3649cc,_0x0a9e('0x8d'));}else{ut[_0x0a9e('0x8e')](_0x3649cc,0x16,_0x0a9e('0x8f'));rpcDb['createCustomerHistory'](_0x3649cc,_0x0a9e('0x90'));rpcDb['createCustomerFinal'](_0x3649cc,_0x0a9e('0x90'));}}}}})[_0x0a9e('0x91')](ut[_0x0a9e('0x86')]('[getContactRecallMe]'));};Preview[_0x0a9e('0xc')][_0x0a9e('0x66')]=function(_0x119677){_0x119677[_0x0a9e('0x5b')]=!![];if(ut['IsNotLoggedIn'](_0x119677[_0x0a9e('0x92')])){_0x119677[_0x0a9e('0x4c')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x0a9e('0x93')](_0x119677[_0x0a9e('0x32')])){_0x119677[_0x0a9e('0x4c')]=_0x0a9e('0x5c');}else if(!this[_0x0a9e('0x94')](_0x119677['Trunk'])){if(!this[_0x0a9e('0x94')](_0x119677[_0x0a9e('0x95')])){_0x119677[_0x0a9e('0x4c')]='TRUNK_IS_NOT_REACHABLE';}else{_0x119677[_0x0a9e('0x4c')]='ACTIVE';}}else{_0x119677['message']=_0x0a9e('0x96');}emitCampaignPreview(_0x119677);};Preview[_0x0a9e('0xc')][_0x0a9e('0x97')]=function(_0x19c995,_0x186f39,_0xc8c264){var _0x387489=this;var _0x54a37d=this[_0x0a9e('0x12')][_0x186f39];var _0x1cc4f3=this[_0x0a9e('0xf')][_0x54a37d[_0x0a9e('0x6d')]];var _0x2bbb86;if(_0x1cc4f3){switch(_0xc8c264){case'1':_0x1cc4f3[_0x0a9e('0x98')]+=0x1;_0x54a37d[_0x0a9e('0x99')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut[_0x0a9e('0x9b')](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x0,'NoSuchNumber');ami[_0x0a9e('0x24')](_0x0a9e('0x9c'),ut[_0x0a9e('0x9d')](_0x54a37d,'nosuchnumber'));rpcDb[_0x0a9e('0x8c')](_0x54a37d,_0x0a9e('0x9e'));if(ut['totalGlobal'](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut[_0x0a9e('0xa0')](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xa2')](_0x2bbb86,_0x0a9e('0xa3'));}else{if(_0x54a37d['countnosuchnumberretry']>=_0x1cc4f3['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x54a37d,_0x0a9e('0xa3'));}else{rpcDb[_0x0a9e('0xa4')](ut[_0x0a9e('0xa5')](_0x54a37d,_0x0a9e('0x99'),_0x1cc4f3[_0x0a9e('0xa6')]),_0x54a37d[_0x0a9e('0xa7')],_0x54a37d[_0x0a9e('0xa8')]);}}delete this[_0x0a9e('0x12')][_0x19c995['linkedid']];break;case _0x0a9e('0xa9'):var _0xcbc8b2=moment()[_0x0a9e('0x88')]('YYYY-MM-DD\x20HH:mm:ss');_0x54a37d[_0x0a9e('0xaa')]=_0xcbc8b2;_0x54a37d['answertime']=_0xcbc8b2;_0x54a37d[_0x0a9e('0x6f')]=!![];_0x1cc4f3[_0x0a9e('0x2a')]+=0x1;logger['info'](_0x0a9e('0xab'),_0x54a37d[_0x0a9e('0xac')],_0x0a9e('0xad'),_0x1cc4f3[_0x0a9e('0x26')],'pTalking:\x20',_0x1cc4f3[_0x0a9e('0x2a')]);ami[_0x0a9e('0x24')](_0x0a9e('0xae'),ut[_0x0a9e('0x9d')](_0x54a37d,'connect',this[_0x0a9e('0xf')][_0x54a37d[_0x0a9e('0x6d')]]));if(_0x1cc4f3[_0x0a9e('0xaf')]){ami[_0x0a9e('0x24')]('custom:agentConnectPreview',ut[_0x0a9e('0xb0')](_0x54a37d));}break;case'16':ami[_0x0a9e('0x24')](_0x0a9e('0xb1'),ut[_0x0a9e('0x9d')](_0x54a37d,_0x0a9e('0xb2'),this[_0x0a9e('0xf')][_0x54a37d[_0x0a9e('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0x0a9e('0x9d')](_0x54a37d,_0x0a9e('0xb2')));_0x1cc4f3[_0x0a9e('0x36')]+=0x1;_0x1cc4f3[_0x0a9e('0x2f')]+=0x1;_0x1cc4f3[_0x0a9e('0x28')]+=0x1;ut[_0x0a9e('0x78')](_0x1cc4f3,_0x0a9e('0xb3'));_0x54a37d['countglobal']=ut[_0x0a9e('0x9b')](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x4,_0x0a9e('0xb4'));rpcDb['createCustomerHistory'](_0x54a37d,_0x0a9e('0xb5'));rpcDb[_0x0a9e('0xa2')](_0x54a37d,_0x0a9e('0xb6'));rpcDb[_0x0a9e('0xb7')](_0x54a37d);_0x1cc4f3['sumDuration']+=_0x54a37d['talktime'];_0x1cc4f3[_0x0a9e('0x2b')]+=_0x54a37d[_0x0a9e('0xb8')];logger['info'](_0x0a9e('0xb9'),_0x54a37d['uniqueid'],_0x0a9e('0xad'),_0x1cc4f3[_0x0a9e('0x26')],'pTalking:\x20',_0x1cc4f3[_0x0a9e('0x2a')]);delete this[_0x0a9e('0x12')][_0x19c995[_0x0a9e('0xba')]];break;case _0x0a9e('0xbb'):_0x1cc4f3[_0x0a9e('0x38')]+=0x1;_0x54a37d[_0x0a9e('0xbc')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut['totalGlobal'](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x5,_0x0a9e('0xbd'));ami[_0x0a9e('0x24')](_0x0a9e('0xbe'),ut['buildObj'](_0x54a37d,_0x0a9e('0xbf')));rpcDb[_0x0a9e('0x8c')](_0x54a37d,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x0a9e('0x9b')](_0x54a37d)>=_0x1cc4f3['dialGlobalMaxRetry']){_0x2bbb86=ut[_0x0a9e('0xa0')](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xa2')](_0x2bbb86,_0x0a9e('0xc0'));}else{if(_0x54a37d['countbusyretry']>=_0x1cc4f3['dialBusyMaxRetry']){rpcDb[_0x0a9e('0xa2')](_0x54a37d,_0x0a9e('0xc1'));}else{rpcDb[_0x0a9e('0xa4')](ut['scheduledAt'](_0x54a37d,_0x0a9e('0xbc'),_0x1cc4f3[_0x0a9e('0xc2')]),_0x54a37d['unlockAgent'],_0x54a37d['activeContact']);}}break;case _0x0a9e('0xc3'):_0x1cc4f3['outboundNoAnswerCallsDay']+=0x1;_0x54a37d['countnoanswerretry']+=0x1;_0x54a37d['countglobal']=ut[_0x0a9e('0x9b')](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x3,_0x0a9e('0xc4'));ami[_0x0a9e('0x24')](_0x0a9e('0xc5'),ut[_0x0a9e('0x9d')](_0x54a37d,'noanswer'));rpcDb[_0x0a9e('0x8c')](_0x54a37d,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x0a9e('0x9b')](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut[_0x0a9e('0xa0')](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb['createCustomerFinal'](_0x2bbb86,_0x0a9e('0xc6'));}else{if(_0x54a37d[_0x0a9e('0xc7')]>=_0x1cc4f3[_0x0a9e('0xc8')]){rpcDb['createCustomerFinal'](_0x54a37d,_0x0a9e('0xc9'));}else{rpcDb[_0x0a9e('0xa4')](ut[_0x0a9e('0xa5')](_0x54a37d,_0x0a9e('0xc7'),_0x1cc4f3[_0x0a9e('0xca')]),_0x54a37d[_0x0a9e('0xa7')],_0x54a37d[_0x0a9e('0xa8')]);}}break;case _0x0a9e('0xcb'):_0x1cc4f3['outboundCongestionCallsDay']+=0x1;_0x54a37d[_0x0a9e('0xcc')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut['totalGlobal'](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x8,_0x0a9e('0xcd'));ami[_0x0a9e('0x24')]('custom:agentcongestion',ut[_0x0a9e('0x9d')](_0x54a37d,'congestion'));rpcDb[_0x0a9e('0x8c')](_0x54a37d,_0x0a9e('0xce'));if(ut[_0x0a9e('0x9b')](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut[_0x0a9e('0xa0')](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xa2')](_0x2bbb86,_0x0a9e('0xcf'));}else{if(_0x54a37d['countcongestionretry']>=_0x1cc4f3[_0x0a9e('0xd0')]){rpcDb[_0x0a9e('0xa2')](_0x54a37d,_0x0a9e('0xce'));}else{rpcDb[_0x0a9e('0xa4')](ut[_0x0a9e('0xa5')](_0x54a37d,_0x0a9e('0xcc'),_0x1cc4f3[_0x0a9e('0xc2')]),_0x54a37d[_0x0a9e('0xa7')],_0x54a37d[_0x0a9e('0xa8')]);}}break;case _0x0a9e('0xd1'):_0x1cc4f3[_0x0a9e('0x40')]+=0x1;_0x54a37d[_0x0a9e('0xd2')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut['totalGlobal'](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x14,_0x0a9e('0xd3'));ami[_0x0a9e('0x24')](_0x0a9e('0xd4'),ut[_0x0a9e('0x9d')](_0x54a37d,'agentreject'));rpcDb[_0x0a9e('0x8c')](_0x54a37d,_0x0a9e('0xd5'));if(ut['totalGlobal'](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut['cloneAction'](_0x54a37d,0x14,_0x0a9e('0xd3'));rpcDb[_0x0a9e('0xa2')](_0x2bbb86,_0x0a9e('0xd6'));}else{if(_0x54a37d[_0x0a9e('0xd2')]>=_0x1cc4f3['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0xa2')](_0x54a37d,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0xa4')](ut[_0x0a9e('0xa5')](_0x54a37d,'countagentrejectretry',_0x1cc4f3[_0x0a9e('0xd7')]),_0x54a37d[_0x0a9e('0xa7')],_0x54a37d[_0x0a9e('0xa8')]);}}break;case'ABANDONED':_0x1cc4f3['outboundAbandonedCallsDay']+=0x1;_0x54a37d[_0x0a9e('0xd8')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut[_0x0a9e('0x9b')](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0xb,_0x0a9e('0xd9'));rpcDb[_0x0a9e('0x8c')](_0x54a37d,_0x0a9e('0xda'));if(ut[_0x0a9e('0x9b')](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut['cloneAction'](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb['createCustomerFinal'](_0x2bbb86,_0x0a9e('0xda'));}else{if(_0x54a37d[_0x0a9e('0xdb')]>=_0x1cc4f3[_0x0a9e('0xdc')]){rpcDb[_0x0a9e('0xa2')](_0x54a37d,_0x0a9e('0xda'));}else{rpcDb['rescheduleContact'](ut[_0x0a9e('0xa5')](_0x54a37d,_0x0a9e('0xd8'),_0x1cc4f3[_0x0a9e('0xdd')]),_0x54a37d[_0x0a9e('0xa7')],_0x54a37d[_0x0a9e('0xa8')]);}}break;case'18':_0x1cc4f3['outboundUnknownCallsDay']+=0x1;_0x54a37d['countmachineretry']+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut['totalGlobal'](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x12,_0x19c995[_0x0a9e('0xde')]||_0x19c995[_0x0a9e('0xdf')]);ami[_0x0a9e('0x24')](_0x0a9e('0xe0'),ut[_0x0a9e('0x9d')](_0x54a37d,'amd'));rpcDb['createCustomerHistory'](_0x54a37d,_0x0a9e('0xe1'));if(ut['totalGlobal'](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut['cloneAction'](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb['createCustomerFinal'](_0x2bbb86,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x0a9e('0xa2')](_0x54a37d,_0x0a9e('0xe1'));}delete this['actions'][_0x19c995[_0x0a9e('0xba')]];break;case'19':_0x1cc4f3[_0x0a9e('0x41')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut[_0x0a9e('0x9b')](_0x54a37d);ut[_0x0a9e('0x8e')](_0x54a37d,0x13,_0x19c995['cause-txt']||_0x19c995['dialstatus']);ami[_0x0a9e('0x24')](_0x0a9e('0xe0'),ut[_0x0a9e('0x9d')](_0x54a37d,_0x0a9e('0xe2')));rpcDb[_0x0a9e('0x8c')](_0x54a37d,'[callProgressDetectingCustomer][machine]');if(ut[_0x0a9e('0x9b')](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut['cloneAction'](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xa2')](_0x2bbb86,_0x0a9e('0xe3'));}else{rpcDb[_0x0a9e('0xa2')](_0x54a37d,_0x0a9e('0xe3'));}delete this[_0x0a9e('0x12')][_0x19c995[_0x0a9e('0xba')]];break;default:if(_0x54a37d[_0x0a9e('0x6f')]){ut[_0x0a9e('0x78')](_0x1cc4f3,_0x0a9e('0xe4'));ut['loggerError'](_0x0a9e('0xe5')+_0x1cc4f3[_0x0a9e('0x26')],_0x19c995);}_0x1cc4f3[_0x0a9e('0x41')]+=0x1;_0x54a37d[_0x0a9e('0x9a')]=ut[_0x0a9e('0x9b')](_0x54a37d);ut['logCustomer'](_0x54a37d,0xc,_0x19c995['cause-txt']||_0x19c995[_0x0a9e('0xdf')]);rpcDb[_0x0a9e('0x8c')](_0x54a37d,_0x0a9e('0xe6'));if(ut[_0x0a9e('0x9b')](_0x54a37d)>=_0x1cc4f3[_0x0a9e('0x9f')]){_0x2bbb86=ut['cloneAction'](_0x54a37d,0xf,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xa2')](_0x2bbb86,_0x0a9e('0xe7'));}else{rpcDb['createCustomerFinal'](_0x54a37d,_0x0a9e('0xe7'));}delete this['actions'][_0x19c995[_0x0a9e('0xba')]];}if(!(_0x54a37d['dialAnswer']&&_0xc8c264==='16')){ut[_0x0a9e('0x77')](_0x1cc4f3,_0x0a9e('0xe8'));logger[_0x0a9e('0x56')]('[originated][decrement][callProgressDetectingCustomer]',_0x54a37d[_0x0a9e('0xac')],'\x20Queue',_0x1cc4f3[_0x0a9e('0x26')],_0x0a9e('0x6c'),_0x1cc4f3[_0x0a9e('0x4d')]);}if(_0xc8c264!==_0x0a9e('0xa9')){delete this[_0x0a9e('0x12')][_0x19c995[_0x0a9e('0xba')]];delete this[_0x0a9e('0x12')][_0x19c995[_0x0a9e('0xe9')]];}}};Preview[_0x0a9e('0xc')][_0x0a9e('0xea')]=function(_0x4262d0,_0xc876d4,_0x2415fe){if(_[_0x0a9e('0xeb')](_0xc876d4)&&_0x0a9e('0xec')!==typeof _0xc876d4){return;}if(_[_0x0a9e('0xeb')](_0x2415fe)&&'object'!==typeof _0x2415fe){return;}switch(_0x2415fe['reason']){case'0':ut[_0x0a9e('0xed')](_0x4262d0,0x0,'NoSuchNumber');rpcDb[_0x0a9e('0xee')](_0x4262d0,_0x0a9e('0xef'));break;case'3':ut['logAgent'](_0x4262d0,0x3,_0x0a9e('0xc4'));rpcDb[_0x0a9e('0xee')](_0x4262d0,_0x0a9e('0xf0'));break;case'5':ut[_0x0a9e('0xed')](_0x4262d0,0x5,'Busy');rpcDb[_0x0a9e('0xee')](_0x4262d0,_0x0a9e('0xf1'));break;case'8':ut[_0x0a9e('0xed')](_0x4262d0,0x8,_0x0a9e('0xcd'));rpcDb['createAgentHistory'](_0x4262d0,_0x0a9e('0xf2'));break;case'22':ut[_0x0a9e('0xed')](_0x4262d0,0x16,_0x0a9e('0xf3'));rpcDb['createAgentHistory'](_0x4262d0,_0x0a9e('0xf4'));break;default:ut[_0x0a9e('0xed')](_0x4262d0,0xc,_0x2415fe[_0x0a9e('0xf5')]);rpcDb['createAgentHistory'](_0x4262d0,_0x0a9e('0xf2'));}ut[_0x0a9e('0x77')](_0xc876d4,_0x0a9e('0xf6'));logger[_0x0a9e('0x56')](_0x0a9e('0xf7'),_0x4262d0['uniqueid'],_0x0a9e('0xad'),_0xc876d4[_0x0a9e('0x26')],'originated:\x20',_0xc876d4[_0x0a9e('0x4d')]);delete this[_0x0a9e('0x12')][_0x4262d0[_0x0a9e('0xac')]];};Preview['prototype']['checkInBlack']=function(_0x523d08,_0x1015aa,_0x4a70ce,_0x55f91a,_0x183244){var _0x1f78b4=this;return new BPromise(function(_0x2a8d55,_0x54ce11){if(_[_0x0a9e('0x6a')](_0x1015aa)||_[_0x0a9e('0x6a')](_0x1015aa[_0x0a9e('0xf8')])||_[_0x0a9e('0x6a')](_0x1015aa[_0x0a9e('0xf8')][_0x0a9e('0xf9')])||_[_0x0a9e('0x6a')](_0x1015aa[_0x0a9e('0x73')])){_0x54ce11(ut[_0x0a9e('0x4c')]('Contact\x20is\x20undefined',_0x55f91a,_0x183244));return;}var _0x43c397=uuid['v4']();var _0x5526a7=_0x1f78b4[_0x0a9e('0xf')][_0x1015aa[_0x0a9e('0xfa')][_0x0a9e('0x26')]];var _0x3cf222=_0x4a70ce?_0x1f78b4[_0x0a9e('0x13')][_0x4a70ce]['id']:undefined;_0x1f78b4[_0x0a9e('0x12')][_0x43c397]=new Action(_0x1015aa,_0x5526a7,_0x43c397,_0x4a70ce,_0x3cf222);var _0x53d9fc=_0x1f78b4[_0x0a9e('0x12')][_0x43c397];_0x53d9fc[_0x0a9e('0xa7')]=_0x55f91a;_0x53d9fc[_0x0a9e('0xa8')]=_0x183244;_0x53d9fc[_0x0a9e('0xfb')]=_0x4a70ce;if(_['isEmpty'](_0x523d08)){_0x1f78b4[_0x0a9e('0xfc')](_0x53d9fc,_0x5526a7,_0x1015aa,_0x4a70ce)[_0x0a9e('0x7e')](function(_0x43beea){logger[_0x0a9e('0x56')](_0x0a9e('0xfd'),_0x0a9e('0xfe')+_0x53d9fc[_0x0a9e('0x6d')]+_0x0a9e('0xff')+_0x53d9fc[_0x0a9e('0x100')],JSON[_0x0a9e('0x55')](_0x43beea));ami['emit'](_0x0a9e('0x101'),ut[_0x0a9e('0x9d')](_0x53d9fc,_0x0a9e('0x102'),_0x1f78b4[_0x0a9e('0xf')][_0x53d9fc[_0x0a9e('0x6d')]]));_0x2a8d55(ut[_0x0a9e('0x4c')](_0x0a9e('0x103')));})[_0x0a9e('0x91')](function(_0x566b90){ut[_0x0a9e('0x5d')](_0x0a9e('0x104'),_0x566b90);_0x54ce11(ut[_0x0a9e('0x4c')]('Call\x20failed',_0x55f91a,_0x183244));});}else{_0x5526a7[_0x0a9e('0x37')]+=0x1;ut[_0x0a9e('0x105')](_0x53d9fc);rpcDb[_0x0a9e('0x106')](_0x53d9fc,_0x0a9e('0x107'));delete _0x1f78b4[_0x0a9e('0x12')][_0x43c397];_0x54ce11(ut[_0x0a9e('0x4c')](_0x0a9e('0x108'),_0x55f91a,_0x183244));}});};Preview[_0x0a9e('0xc')][_0x0a9e('0x94')]=function(_0x451010){return!_['isNil'](_0x451010)&&!_[_0x0a9e('0x6a')](_0x451010[_0x0a9e('0x26')])&&!_[_0x0a9e('0x6a')](_0x451010[_0x0a9e('0x109')])&&_0x451010[_0x0a9e('0x109')]&&!_[_0x0a9e('0x6a')](this['trunks'][util[_0x0a9e('0x88')]('SIP/%s',_0x451010['name'])])&&!_['isNil'](this[_0x0a9e('0x11')][util[_0x0a9e('0x88')](_0x0a9e('0x10a'),_0x451010[_0x0a9e('0x26')])]['status'])&&(this[_0x0a9e('0x11')][util[_0x0a9e('0x88')](_0x0a9e('0x10a'),_0x451010[_0x0a9e('0x26')])][_0x0a9e('0x75')]==='reachable'||this['trunks'][util[_0x0a9e('0x88')](_0x0a9e('0x10a'),_0x451010[_0x0a9e('0x26')])]['status']===_0x0a9e('0x10b'));};Preview[_0x0a9e('0xc')][_0x0a9e('0x85')]=function(_0x4cee8c,_0x8ad1c0){var _0x2bf85d=this;return new BPromise(function(_0x15ba6b,_0x4eda8f){_0x2bf85d[_0x0a9e('0x10c')](_0x4cee8c,_0x8ad1c0)[_0x0a9e('0x7e')](function(_0x3b7213){_0x15ba6b(_['pick'](_0x3b7213,['message']));})['catch'](function(_0x3b04fd){if(_0x3b04fd[_0x0a9e('0x10d')]){rpcDb[_0x0a9e('0x10e')](_0x4cee8c);}if(_0x3b04fd[_0x0a9e('0x109')]){rpcDb['disableContact'](_0x4cee8c);}_0x4eda8f(_[_0x0a9e('0x70')](_0x3b04fd,['message']));});});};Preview[_0x0a9e('0xc')][_0x0a9e('0x10c')]=function(_0x242f23,_0x57f673){var _0x33b4b3=this;return new BPromise(function(_0x33a26c,_0xb8a476){var _0x580dd6,_0x40eb5d;rpcDb['getContactPreview'](_0x242f23)[_0x0a9e('0x7e')](function(_0x5c57e1){if(!_[_0x0a9e('0x6a')](_0x5c57e1[0x0])){_0x40eb5d=_0x5c57e1[0x0]['recallme']?![]:!![];_0x580dd6=_0x5c57e1[0x0][_0x0a9e('0x10f')]?!![]:![];_0x580dd6=_0x57f673?!![]:_0x580dd6;}var _0x37215d=_0x33b4b3[_0x0a9e('0x110')](_0x5c57e1);if(_0x37215d[_0x0a9e('0x111')]){rpcDb[_0x0a9e('0x112')](_[_0x0a9e('0x70')](_0x5c57e1[0x0],[_0x0a9e('0x73'),'Contact.phone']))[_0x0a9e('0x7e')](function(_0x1c9ea2){_0x33b4b3['checkInBlack'](_0x1c9ea2,_0x5c57e1[0x0],_0x57f673,_0x40eb5d,_0x580dd6)[_0x0a9e('0x7e')](function(_0x3753ca){_0x33a26c(_0x3753ca);})['catch'](function(_0x39070b){_0xb8a476(_0x39070b);});})[_0x0a9e('0x91')](function(_0x16b578){ut['logger'](_0x0a9e('0x113'),_0x16b578);_0xb8a476(ut[_0x0a9e('0x4c')](_0x0a9e('0x114'),_0x40eb5d,_0x580dd6));});}else{_0xb8a476(ut[_0x0a9e('0x4c')](_0x37215d[_0x0a9e('0x4c')],_0x40eb5d,_0x580dd6));}})[_0x0a9e('0x91')](function(_0x3ba897){ut[_0x0a9e('0x5d')](_0x0a9e('0x115'),_0x3ba897);_0xb8a476(ut[_0x0a9e('0x4c')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x0a9e('0xc')]['validateContact']=function(_0x3c9854){if(_[_0x0a9e('0x6a')](_0x3c9854)||_[_0x0a9e('0x116')](_0x3c9854)||!_[_0x0a9e('0x6a')](_0x3c9854[0x0][_0x0a9e('0x83')])&&_[_0x0a9e('0x6a')](_0x3c9854[0x0]['Agent'][_0x0a9e('0x26')])){ut[_0x0a9e('0x5d')](_0x0a9e('0x117'),_0x3c9854);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x11e4e3=this[_0x0a9e('0xf')][_0x3c9854[0x0][_0x0a9e('0xfa')][_0x0a9e('0x26')]];_0x11e4e3[_0x0a9e('0x4c')]=_0x0a9e('0x96');if(_[_0x0a9e('0x6a')](_0x11e4e3)){ut['logger'](_0x0a9e('0x118'),_0x11e4e3);return{'isValid':![],'message':_0x0a9e('0x119')};}if(!this[_0x0a9e('0x94')](_0x11e4e3[_0x0a9e('0x53')])){ut[_0x0a9e('0x5d')](_0x0a9e('0x11a'),_0x0a9e('0x11b')+_0x11e4e3['name']+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x0a9e('0x94')](_0x11e4e3[_0x0a9e('0x95')])){ut[_0x0a9e('0x5d')](_0x0a9e('0x11a'),_0x11e4e3[_0x0a9e('0x26')]+_0x0a9e('0x11c'));return{'isValid':![],'message':_0x0a9e('0x11d')};}}if(!ut['isActive'](_0x11e4e3[_0x0a9e('0x32')])){ut[_0x0a9e('0x5d')](_0x0a9e('0x11e'),_0x11e4e3[_0x0a9e('0x26')]+_0x0a9e('0x11f'));return{'isValid':![],'message':_0x0a9e('0x11b')+_0x11e4e3[_0x0a9e('0x26')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x0a9e('0x120')};};Preview[_0x0a9e('0xc')][_0x0a9e('0xfc')]=function(_0x5885c3,_0x2b8ad4,_0x387817,_0x2030cf){var _0x292f02=this;return new BPromise(function(_0x5c8dc4,_0x38892b){var _0xcbbea0=_0x5885c3[_0x0a9e('0xac')];var _0x93d953=_0x292f02[_0x0a9e('0x94')](_0x2b8ad4[_0x0a9e('0x53')])?util[_0x0a9e('0x88')](_0x0a9e('0x121'),_0x2b8ad4['Trunk'][_0x0a9e('0x26')],_[_0x0a9e('0x6a')](_0x2b8ad4[_0x0a9e('0x35')])?'':_0x2b8ad4[_0x0a9e('0x35')]['trim']()||'',_0x2b8ad4['dialCutDigit']>0x0?_0x387817[_0x0a9e('0xf8')][_0x0a9e('0xf9')][_0x0a9e('0x122')](_0x2b8ad4['dialCutDigit']):_0x387817[_0x0a9e('0xf8')][_0x0a9e('0xf9')]):util['format'](_0x0a9e('0x121'),_['isNil'](_0x2b8ad4[_0x0a9e('0x95')])?_0x2b8ad4['Trunk']['name']:_0x2b8ad4['TrunkBackup'][_0x0a9e('0x26')],_[_0x0a9e('0x6a')](_0x2b8ad4[_0x0a9e('0x35')])?'':_0x2b8ad4[_0x0a9e('0x35')][_0x0a9e('0x123')]()||'',_0x2b8ad4[_0x0a9e('0x124')]>0x0?_0x387817['Contact'][_0x0a9e('0xf9')][_0x0a9e('0x122')](_0x2b8ad4[_0x0a9e('0x124')]):_0x387817[_0x0a9e('0xf8')][_0x0a9e('0xf9')]);var _0x18dccf=_0x292f02[_0x0a9e('0x94')](_0x2b8ad4['Trunk'])?ut['getCallerId'](_0x2b8ad4[_0x0a9e('0x53')]['callerid'],_0x2b8ad4[_0x0a9e('0x125')],_0x2b8ad4[_0x0a9e('0x126')]>0x0?ut[_0x0a9e('0x127')](_0x2b8ad4[_0x0a9e('0x34')],_0x2b8ad4[_0x0a9e('0x126')]):_0x2b8ad4[_0x0a9e('0x34')]):ut['getCallerId'](_[_0x0a9e('0x6a')](_0x2b8ad4['TrunkBackup'])?_0x2b8ad4['Trunk'][_0x0a9e('0x128')]:_0x2b8ad4['TrunkBackup'][_0x0a9e('0x128')],_0x2b8ad4['dialOriginateCallerIdName'],_0x2b8ad4['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0a9e('0x127')](_0x2b8ad4['dialOriginateCallerIdNumber'],_0x2b8ad4[_0x0a9e('0x126')]):_0x2b8ad4[_0x0a9e('0x34')]);if(_0x18dccf){_0x5885c3[_0x0a9e('0x129')]=ut['extractCalleridName'](_0x18dccf);_0x5885c3[_0x0a9e('0x12a')]=ut[_0x0a9e('0x12b')](_0x18dccf);}var _0x3ea310=ut['addVariables'](_0x2b8ad4,_0x387817,_0x93d953,_0x18dccf,_0xcbbea0,_0x5885c3);_['merge'](_0x5885c3,ut[_0x0a9e('0x12c')](_0x3ea310));_0x5885c3[_0x0a9e('0x12d')]=moment()[_0x0a9e('0x88')](_0x0a9e('0x12e'));ami[_0x0a9e('0x74')](ut[_0x0a9e('0x12f')](_0x5885c3,_0x2b8ad4,_0x3ea310,_0x5885c3[_0x0a9e('0xa8')],_0x2030cf))[_0x0a9e('0x7e')](function(_0x937b2a){_0x2b8ad4[_0x0a9e('0x4d')]+=0x1;logger['info']('[originated][increment]',_0xcbbea0,'\x20Queue',_0x2b8ad4[_0x0a9e('0x26')],_0x0a9e('0x6c'),_0x2b8ad4[_0x0a9e('0x4d')]);_0x5c8dc4(_0x937b2a);})[_0x0a9e('0x91')](function(_0xb0e231){ut[_0x0a9e('0xed')](_0x5885c3,0xe,_0x0a9e('0x130'));rpcDb[_0x0a9e('0xee')](_0x5885c3,'[originateFailure][logOriginateFailure]');_0x38892b(_0xb0e231);});});};Preview['prototype'][_0x0a9e('0x1c')]=function(_0x98a973){if(this['actions'][_0x98a973[_0x0a9e('0xba')]]){this[_0x0a9e('0x12')][_0x98a973[_0x0a9e('0xba')]][_0x0a9e('0x131')]=_0x98a973[_0x0a9e('0x131')];}};Preview[_0x0a9e('0xc')][_0x0a9e('0x16')]=function(_0x262281){var _0x59f8f7=this;var _0x400800=this[_0x0a9e('0x12')][_0x262281[_0x0a9e('0x132')]];if(_0x400800){if(_0x400800['lookAgent']&&this[_0x0a9e('0x13')][_0x400800[_0x0a9e('0xfb')]]){ut[_0x0a9e('0x133')](_0x400800,this[_0x0a9e('0x13')][_0x400800[_0x0a9e('0xfb')]][_0x0a9e('0x26')],this[_0x0a9e('0x13')][_0x400800[_0x0a9e('0xfb')]]['id']);}var _0x3a9c0f=_[_0x0a9e('0x134')](_0x400800);_0x3a9c0f[_0x0a9e('0xaa')]=moment()[_0x0a9e('0x88')]('YYYY-MM-DD\x20HH:mm:ss');var _0x572a72=_0x59f8f7[_0x0a9e('0xf')][_0x400800[_0x0a9e('0x6d')]];if(ut[_0x0a9e('0x135')](_0x262281[_0x0a9e('0x136')])){if(_0x400800[_0x0a9e('0xa7')]){rpcDb[_0x0a9e('0x10e')](_0x400800[_0x0a9e('0x100')]);}if(_0x400800['activeContact']){rpcDb[_0x0a9e('0x137')](_0x400800['idContact']);}ami[_0x0a9e('0x24')](_0x0a9e('0x138'),ut[_0x0a9e('0x9d')](_0x400800,_0x0a9e('0x139'),this[_0x0a9e('0xf')][_0x400800[_0x0a9e('0x6d')]]));this[_0x0a9e('0xea')](_0x3a9c0f,_0x572a72,_0x262281);}else{_0x400800[_0x0a9e('0x12d')]=moment()[_0x0a9e('0x88')](_0x0a9e('0x12e'));ut[_0x0a9e('0xed')](_0x3a9c0f,0x4,_0x0a9e('0xb4'));rpcDb[_0x0a9e('0xee')](_0x3a9c0f,_0x0a9e('0x13a'));}}};Preview[_0x0a9e('0xc')][_0x0a9e('0x19')]=function(_0x5b78a8){var _0x54cf62=this;var _0x9dc1de=this[_0x0a9e('0x12')][_0x5b78a8['linkedid']];var _0x5500de;if(_0x9dc1de){_0x5500de=this[_0x0a9e('0xf')][_0x9dc1de[_0x0a9e('0x6d')]];logger[_0x0a9e('0x56')]('[syncHangup][talking]',_0x5b78a8[_0x0a9e('0xba')],'\x20Queue',_0x5500de[_0x0a9e('0x26')],'pTalking:\x20',_0x5500de[_0x0a9e('0x2a')]);}if(this['actions'][_0x5b78a8[_0x0a9e('0xba')]]&&_0x5b78a8[_0x0a9e('0xba')]!==_0x5b78a8[_0x0a9e('0xac')]){if(_0x5b78a8['cause']==='16'&&this[_0x0a9e('0x12')][_0x5b78a8['linkedid']]['dialAnswer']){this[_0x0a9e('0x97')](_0x5b78a8,_0x5b78a8[_0x0a9e('0xba')],_0x5b78a8[_0x0a9e('0x13b')]);}else if(this[_0x0a9e('0x12')][_0x5b78a8[_0x0a9e('0xba')]][_0x0a9e('0x6f')]){logger[_0x0a9e('0x56')](_0x0a9e('0x13c'),_0x5b78a8[_0x0a9e('0xba')],_0x5b78a8[_0x0a9e('0x13b')],_0x0a9e('0xad'),_0x5500de[_0x0a9e('0x26')],_0x0a9e('0x6e'),_0x5500de[_0x0a9e('0x2a')]);this[_0x0a9e('0x97')](_0x5b78a8,_0x5b78a8[_0x0a9e('0xba')],_0x5b78a8[_0x0a9e('0x13b')]);}}else if(_0x9dc1de&&_[_0x0a9e('0x6a')](_0x9dc1de[_0x0a9e('0x13d')])&&_0x5500de['dialQueueProject']&&_0x5b78a8[_0x0a9e('0xba')]===_0x5b78a8[_0x0a9e('0xac')]&&_[_0x0a9e('0x6a')](_0x5b78a8[_0x0a9e('0xf5')])&&_0x5b78a8['cause']==='16'&&_0x5b78a8['channelstate']==='6'&&_['isUndefined'](_0x9dc1de[_0x0a9e('0x13e')])){if(_0x9dc1de['unlockAgent']){rpcDb[_0x0a9e('0x10e')](_0x9dc1de[_0x0a9e('0x100')]);}if(_0x9dc1de[_0x0a9e('0xa8')]){rpcDb[_0x0a9e('0x137')](_0x9dc1de[_0x0a9e('0x100')]);}_0x5b78a8[_0x0a9e('0xf5')]='22';this[_0x0a9e('0xea')](_0x9dc1de,_0x5500de,_0x5b78a8);}else if(_0x9dc1de&&_0x9dc1de[_0x0a9e('0x13e')]){if(_0x5b78a8[_0x0a9e('0x13b')]==='16'&&this[_0x0a9e('0x12')][_0x5b78a8['linkedid']][_0x0a9e('0x6f')]){logger['info'](_0x0a9e('0x13f'),_0x5b78a8['linkedid'],_0x5b78a8[_0x0a9e('0x13b')],_0x0a9e('0xad'),_0x5500de[_0x0a9e('0x26')],'pTalking:\x20',_0x5500de[_0x0a9e('0x2a')]);this[_0x0a9e('0x97')](_0x5b78a8,_0x5b78a8['linkedid'],_0x5b78a8['cause']);}else if(this[_0x0a9e('0x12')][_0x5b78a8[_0x0a9e('0xba')]][_0x0a9e('0x6f')]){logger['info']('[syncHangup][talking][cause]',_0x5b78a8['linkedid'],_0x5b78a8[_0x0a9e('0x13b')],_0x0a9e('0xad'),_0x5500de[_0x0a9e('0x26')],_0x0a9e('0x6e'),_0x5500de[_0x0a9e('0x2a')]);this[_0x0a9e('0x97')](_0x5b78a8,_0x5b78a8[_0x0a9e('0xba')],_0x5b78a8[_0x0a9e('0x13b')]);}}};Preview[_0x0a9e('0xc')][_0x0a9e('0x1b')]=function(_0xc9669d){if(this[_0x0a9e('0x12')][_0xc9669d[_0x0a9e('0xe9')]]&&_0xc9669d[_0x0a9e('0xe9')]!==_0xc9669d[_0x0a9e('0x140')]){this[_0x0a9e('0x97')](_0xc9669d,_0xc9669d[_0x0a9e('0xe9')],_0xc9669d[_0x0a9e('0xdf')]);}};Preview['prototype'][_0x0a9e('0x141')]=function(_0x25ba4e){if(this[_0x0a9e('0x12')][_0x25ba4e[_0x0a9e('0xba')]]&&_0x25ba4e[_0x0a9e('0xba')]!==_0x25ba4e[_0x0a9e('0xac')]&&!this['actions'][_0x25ba4e[_0x0a9e('0xba')]][_0x0a9e('0x6f')]){if(_0x25ba4e[_0x0a9e('0x13b')]==='1'){this[_0x0a9e('0x97')](_0x25ba4e,_0x25ba4e[_0x0a9e('0xba')],_0x25ba4e[_0x0a9e('0x13b')]);}}};Preview[_0x0a9e('0xc')][_0x0a9e('0x142')]=function(_0x4175a6,_0x541af6,_0x5d27c1){if(this[_0x0a9e('0x12')][_0x4175a6]){if(_[_0x0a9e('0x6a')](this['actions'][_0x4175a6][_0x0a9e('0x143')])){this[_0x0a9e('0x12')][_0x4175a6]['variables']={};}this[_0x0a9e('0x12')][_0x4175a6]['variables'][_0x541af6]=_0x5d27c1;}};Preview[_0x0a9e('0xc')][_0x0a9e('0x1e')]=function(_0x58c53c){try{if(!_[_0x0a9e('0x6a')](_0x58c53c)){if(ut[_0x0a9e('0x144')](_['keys'](_0x58c53c[_0x0a9e('0x145')])[0x0])){this[_0x0a9e('0x142')](_0x58c53c['uniqueid'],_[_0x0a9e('0x146')](_0x58c53c[_0x0a9e('0x145')])[0x0],_0x58c53c[_0x0a9e('0x147')]);}}}catch(_0x24361){logger[_0x0a9e('0x148')](_0x0a9e('0x149'),util['inspect'](_0x24361,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xc')][_0x0a9e('0x20')]=function(_0x51e697){if(_0x51e697){if(this[_0x0a9e('0x12')][_0x51e697[_0x0a9e('0x14a')]]){this[_0x0a9e('0x12')][_0x51e697[_0x0a9e('0x14a')]][_0x0a9e('0x13e')]=!![];}}};Preview[_0x0a9e('0xc')][_0x0a9e('0x22')]=function(_0x53fd38){if(_0x53fd38){if(this['actions'][_0x53fd38['transfererlinkedid']]){this['actions'][_0x53fd38['transfererlinkedid']][_0x0a9e('0x13e')]=!![];}}};module[_0x0a9e('0x14b')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index cc817bb..9d0916f 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 _0x7817=['catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory'];(function(_0x506557,_0x37764e){var _0x496322=function(_0x4ff159){while(--_0x4ff159){_0x506557['push'](_0x506557['shift']());}};_0x496322(++_0x37764e);}(_0x7817,0x64));var _0x7781=function(_0x50b54b,_0xba911d){_0x50b54b=_0x50b54b-0x0;var _0x1859c1=_0x7817[_0x50b54b];return _0x1859c1;};'use strict';var util=require(_0x7781('0x0'));var BPromise=require(_0x7781('0x1'));var logger=require(_0x7781('0x2'))('preview');var _=require(_0x7781('0x3'));var cmHopper=require(_0x7781('0x4'));var cmHopperFinal=require(_0x7781('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x7781('0x6'));var voiceQueueRt=require(_0x7781('0x7'));var agentReportPreview=require(_0x7781('0x8'));var voiceQueueReport=require(_0x7781('0x9'));function loggerCatch(_0x8d136e){return function(_0x934463){logger[_0x7781('0xa')](_0x8d136e,util['inspect'](_0x934463,{'showHidden':![],'depth':null}));};}function create(_0x235ea3){return BPromise[_0x7781('0xb')]()[_0x7781('0xc')](cmHopperHistory[_0x7781('0xd')](_0x235ea3))[_0x7781('0xe')](loggerCatch(_0x7781('0xf')));}function createAgent(_0x18ea4b){return BPromise[_0x7781('0xb')]()['then'](agentReportPreview[_0x7781('0xd')](_0x18ea4b))[_0x7781('0xe')](loggerCatch(_0x7781('0xf')));}function moveContact(_0x59899f){return BPromise[_0x7781('0xb')]()[_0x7781('0xc')](cmHopper[_0x7781('0x10')](_0x59899f,!![]))[_0x7781('0xe')](loggerCatch(_0x7781('0x11')));}exports[_0x7781('0x12')]=function(_0xb07c0b){return BPromise[_0x7781('0xb')]()[_0x7781('0xc')](cmHopperBlack[_0x7781('0x12')](_0xb07c0b))[_0x7781('0xe')](loggerCatch(_0x7781('0x13')));};exports[_0x7781('0x14')]=function(_0x1d3ce7){return BPromise[_0x7781('0xb')]()[_0x7781('0xc')](cmHopper[_0x7781('0x14')](_0x1d3ce7))[_0x7781('0xe')](loggerCatch(_0x7781('0x15')));};exports[_0x7781('0xd')]=function(_0x20af94,_0x183c7a){create(_0x20af94)[_0x7781('0xe')](loggerCatch(_0x183c7a));moveContact(_0x20af94)[_0x7781('0xe')](loggerCatch(_0x183c7a));};exports[_0x7781('0x16')]=function(_0xd01ef3,_0x1b4be1){createAgent(_0xd01ef3)[_0x7781('0xe')](loggerCatch(_0x1b4be1));};exports[_0x7781('0x17')]=function(_0x2a7190,_0xacd5d3){create(_0x2a7190)[_0x7781('0xe')](loggerCatch(_0xacd5d3));};exports[_0x7781('0x18')]=function(_0x3ef500,_0x33e0ca){moveContact(_0x3ef500)[_0x7781('0xe')](loggerCatch(_0x33e0ca));};exports[_0x7781('0x19')]=function(_0x53d4ae,_0x360247,_0x26bd82){if(_0x360247){_0x53d4ae[_0x7781('0x1a')]=null;}if(_0x26bd82){_0x53d4ae[_0x7781('0x1b')]=![];}return BPromise[_0x7781('0xb')]()[_0x7781('0xc')](cmHopper[_0x7781('0x19')](_0x53d4ae))[_0x7781('0xe')](loggerCatch(_0x7781('0x1c')));};exports[_0x7781('0x1d')]=function(_0x489554){return BPromise[_0x7781('0xb')]()[_0x7781('0xc')](cmHopper[_0x7781('0x1d')](_0x489554))[_0x7781('0xe')](loggerCatch(_0x7781('0x1e')));};exports[_0x7781('0x1f')]=function(_0xb58e11){return BPromise[_0x7781('0xb')]()[_0x7781('0xc')](cmHopper[_0x7781('0x1f')]({'UserId':null},_0xb58e11,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0x7781('0x20')]=function(_0x3863b8){return BPromise[_0x7781('0xb')]()['then'](cmHopper[_0x7781('0x1f')]({'active':![]},_0x3863b8,0x1))['catch'](loggerCatch(_0x7781('0x21')));};exports[_0x7781('0x22')]=function(_0x2f49a7){var _0x402bac={};_0x402bac['type']=_0x2f49a7[_0x7781('0x23')];_0x402bac[_0x7781('0x24')]=_0x2f49a7[_0x7781('0x24')];_0x402bac[_0x7781('0x25')]=_0x2f49a7[_0x7781('0x25')];_0x402bac[_0x7781('0x26')]=_0x2f49a7[_0x7781('0x26')];_0x402bac['queue']=_0x2f49a7[_0x7781('0x27')];_0x402bac[_0x7781('0x28')]=_0x2f49a7['answertime'];_0x402bac['queuecallerleaveAt']=_0x2f49a7['answertime'];_0x402bac['queuecallercomplete']=0x1;_0x402bac['queuecallercompleteAt']=_0x2f49a7[_0x7781('0x29')];_0x402bac[_0x7781('0x2a')]=_0x2f49a7[_0x7781('0x2b')];_0x402bac[_0x7781('0x2c')]=_0x7781('0x2d');_0x402bac['exten']=_0x7781('0x2e');_0x402bac[_0x7781('0x2f')]=0x0;_0x402bac[_0x7781('0x30')]=0x1;_0x402bac[_0x7781('0x31')]=_0x2f49a7[_0x7781('0x2b')];_0x402bac[_0x7781('0x32')]='COMPLETED';return BPromise[_0x7781('0xb')]()['then'](voiceQueueReport[_0x7781('0x33')](_0x402bac))[_0x7781('0xe')](loggerCatch(_0x7781('0x34')));};exports['getContactRecallMe']=function(_0x229431,_0x4c4a87){return BPromise[_0x7781('0xb')]()[_0x7781('0xc')](cmHopper[_0x7781('0x35')](_0x229431,_0x4c4a87))['catch'](loggerCatch(_0x7781('0x36')));};exports[_0x7781('0x37')]=function(_0xbe908){return BPromise['resolve']()[_0x7781('0xc')](cmHopper[_0x7781('0x19')](_0xbe908,!![],!![]))[_0x7781('0xe')](loggerCatch(_0x7781('0x38')));}; \ No newline at end of file +var _0x96e8=['[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContact','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview'];(function(_0x2eb0ba,_0x174584){var _0x109c0d=function(_0x4cfb24){while(--_0x4cfb24){_0x2eb0ba['push'](_0x2eb0ba['shift']());}};_0x109c0d(++_0x174584);}(_0x96e8,0xce));var _0x896e=function(_0x3a7d70,_0x34121e){_0x3a7d70=_0x3a7d70-0x0;var _0x13ec32=_0x96e8[_0x3a7d70];return _0x13ec32;};'use strict';var util=require(_0x896e('0x0'));var BPromise=require(_0x896e('0x1'));var logger=require(_0x896e('0x2'))(_0x896e('0x3'));var _=require(_0x896e('0x4'));var cmHopper=require(_0x896e('0x5'));var cmHopperFinal=require(_0x896e('0x6'));var cmHopperHistory=require(_0x896e('0x7'));var cmHopperBlack=require(_0x896e('0x8'));var voiceQueueRt=require(_0x896e('0x9'));var agentReportPreview=require(_0x896e('0xa'));var voiceQueueReport=require(_0x896e('0xb'));function loggerCatch(_0x361d37){return function(_0x1622e2){logger['error'](_0x361d37,util['inspect'](_0x1622e2,{'showHidden':![],'depth':null}));};}function create(_0x2db9a1){return BPromise[_0x896e('0xc')]()[_0x896e('0xd')](cmHopperHistory[_0x896e('0xe')](_0x2db9a1))[_0x896e('0xf')](loggerCatch(_0x896e('0x10')));}function createAgent(_0x54f7e3){return BPromise[_0x896e('0xc')]()[_0x896e('0xd')](agentReportPreview[_0x896e('0xe')](_0x54f7e3))[_0x896e('0xf')](loggerCatch(_0x896e('0x10')));}function moveContact(_0x303753){return BPromise[_0x896e('0xc')]()[_0x896e('0xd')](cmHopper[_0x896e('0x11')](_0x303753,!![]))[_0x896e('0xf')](loggerCatch(_0x896e('0x12')));}exports['checkIsBlackList']=function(_0x36bb8a){return BPromise[_0x896e('0xc')]()[_0x896e('0xd')](cmHopperBlack[_0x896e('0x13')](_0x36bb8a))[_0x896e('0xf')](loggerCatch(_0x896e('0x14')));};exports[_0x896e('0x15')]=function(_0x574946){return BPromise[_0x896e('0xc')]()[_0x896e('0xd')](cmHopper[_0x896e('0x15')](_0x574946))[_0x896e('0xf')](loggerCatch(_0x896e('0x16')));};exports[_0x896e('0xe')]=function(_0x4c6760,_0x235205){create(_0x4c6760)[_0x896e('0xf')](loggerCatch(_0x235205));moveContact(_0x4c6760)[_0x896e('0xf')](loggerCatch(_0x235205));};exports['createAgentHistory']=function(_0x24d133,_0x48078b){createAgent(_0x24d133)['catch'](loggerCatch(_0x48078b));};exports[_0x896e('0x17')]=function(_0x56e146,_0xf73c37){create(_0x56e146)[_0x896e('0xf')](loggerCatch(_0xf73c37));};exports[_0x896e('0x18')]=function(_0x177a6d,_0x49d74e){moveContact(_0x177a6d)[_0x896e('0xf')](loggerCatch(_0x49d74e));};exports['rescheduleContact']=function(_0x41a1dc,_0x46f144,_0x48682f){if(_0x46f144){_0x41a1dc[_0x896e('0x19')]=null;}if(_0x48682f){_0x41a1dc[_0x896e('0x1a')]=![];}return BPromise[_0x896e('0xc')]()[_0x896e('0xd')](cmHopper['rescheduleContact'](_0x41a1dc))[_0x896e('0xf')](loggerCatch(_0x896e('0x1b')));};exports[_0x896e('0x1c')]=function(_0x7ae5bb){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0x7ae5bb))[_0x896e('0xf')](loggerCatch(_0x896e('0x1d')));};exports['unlockContact']=function(_0xe337f5){return BPromise['resolve']()[_0x896e('0xd')](cmHopper[_0x896e('0x1e')]({'UserId':null},_0xe337f5,0x1))[_0x896e('0xf')](loggerCatch('[unlockContact]\x20'));};exports[_0x896e('0x1f')]=function(_0x39f6e2){return BPromise[_0x896e('0xc')]()[_0x896e('0xd')](cmHopper[_0x896e('0x1e')]({'active':![]},_0x39f6e2,0x1))['catch'](loggerCatch(_0x896e('0x20')));};exports[_0x896e('0x21')]=function(_0x304249){var _0x1f3a16={};_0x1f3a16[_0x896e('0x22')]=_0x304249[_0x896e('0x22')];_0x1f3a16[_0x896e('0x23')]=_0x304249['uniqueid'];_0x1f3a16[_0x896e('0x24')]=_0x304249['calleridnum'];_0x1f3a16['calleridname']=_0x304249[_0x896e('0x25')];_0x1f3a16[_0x896e('0x26')]=_0x304249[_0x896e('0x26')];_0x1f3a16[_0x896e('0x27')]=_0x304249[_0x896e('0x28')];_0x1f3a16['queuecallerleaveAt']=_0x304249[_0x896e('0x28')];_0x1f3a16[_0x896e('0x29')]=0x1;_0x1f3a16[_0x896e('0x2a')]=_0x304249['endtime'];_0x1f3a16['connectedlinename']=_0x304249['membername'];_0x1f3a16['context']=_0x896e('0x2b');_0x1f3a16[_0x896e('0x2c')]=_0x896e('0x2d');_0x1f3a16[_0x896e('0x2e')]=0x0;_0x1f3a16['assigned']=0x1;_0x1f3a16[_0x896e('0x2f')]=_0x304249[_0x896e('0x30')];_0x1f3a16[_0x896e('0x31')]=_0x896e('0x32');return BPromise[_0x896e('0xc')]()[_0x896e('0xd')](voiceQueueReport[_0x896e('0x33')](_0x1f3a16))['catch'](loggerCatch(_0x896e('0x34')));};exports[_0x896e('0x35')]=function(_0x31c05e,_0x2bd8b0){return BPromise[_0x896e('0xc')]()['then'](cmHopper[_0x896e('0x35')](_0x31c05e,_0x2bd8b0))[_0x896e('0xf')](loggerCatch(_0x896e('0x36')));};exports['rescheduleContactInQueue']=function(_0x3c36ac){return BPromise[_0x896e('0xc')]()[_0x896e('0xd')](cmHopper[_0x896e('0x37')](_0x3c36ac,!![],!![]))['catch'](loggerCatch(_0x896e('0x38')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 7adaf84..3ef398e 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 _0xc288=['127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','Queue','calleridnum','ContactId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','tags','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','endtime','logAgent','responsetime','ringtime','starttime','membername','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','calleridname','BOOKED','originate','channelAgent','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','add','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','name','interface','voice','mandatoryDisposition','buildAcw','queue','uniqueid','agentReadyId','not_inuse','reachable','push','getDiff','ListId','CampaignId','filterKey','type','dialAnswer','countglobal','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','preview','env'];(function(_0x4f527b,_0x2829b1){var _0x2a3c4b=function(_0x3e738f){while(--_0x3e738f){_0x4f527b['push'](_0x4f527b['shift']());}};_0x2a3c4b(++_0x2829b1);}(_0xc288,0x115));var _0x8c28=function(_0xae99e2,_0x3c08e3){_0xae99e2=_0xae99e2-0x0;var _0x5cd708=_0xc288[_0xae99e2];return _0x5cd708;};'use strict';var util=require(_0x8c28('0x0'));var _=require(_0x8c28('0x1'));var moment=require(_0x8c28('0x2'));var logger=require('../../../../config/logger')(_0x8c28('0x3'));var ipAgi=process[_0x8c28('0x4')]['XCALLY_IP_AGI']||_0x8c28('0x5');function getSeconds(_0x4fce70,_0x36d1bd){var _0x3966cd=moment(_0x4fce70)['milliseconds'](0x0);var _0x13bf58=moment(_0x36d1bd)[_0x8c28('0x6')](0x0);return _0x3966cd[_0x8c28('0x7')](_0x13bf58,_0x8c28('0x8'));}exports['loggerCatch']=function(_0x2caeed){return function(_0x3e0bd7){logger[_0x8c28('0x9')](_0x2caeed,util[_0x8c28('0xa')](_0x3e0bd7,{'showHidden':![],'depth':null}));};};exports[_0x8c28('0xb')]=function(_0x4e9425,_0x26114b){logger[_0x8c28('0xc')](_0x4e9425,util[_0x8c28('0xa')](_0x26114b,{'showHidden':![],'depth':null}));};exports[_0x8c28('0xd')]=function(_0x5341f2,_0x330fa7){logger['error'](_0x5341f2,util[_0x8c28('0xa')](_0x330fa7,{'showHidden':![],'depth':null}));};exports[_0x8c28('0xe')]=function(_0x56190d){return function(_0xdb53ed){logger[_0x8c28('0xc')](_0x56190d,util[_0x8c28('0xa')](_0xdb53ed,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x484e3a,_0x26f29e,_0x2b56a1){return{'message':_0x484e3a,'unlock':_0x26f29e,'active':_0x2b56a1};};exports[_0x8c28('0xf')]=function(_0x2c768d,_0xcfdfa3,_0x38716f){if(!_[_0x8c28('0x10')](_0x38716f)&&_0x8c28('0x11')===typeof _0x38716f&&!_[_0x8c28('0x12')](_0x38716f)){if(!_[_0x8c28('0x10')](_0xcfdfa3)&&'string'===typeof _0xcfdfa3&&!_[_0x8c28('0x12')](_0xcfdfa3)){return util[_0x8c28('0x13')](_0x8c28('0x14'),_0xcfdfa3,_0x38716f);}return util[_0x8c28('0x13')](_0x8c28('0x14'),_0x38716f,_0x38716f);}if(!_['isUndefined'](_0x2c768d)&&_0x8c28('0x11')===typeof _0x2c768d&&!_[_0x8c28('0x12')](_0x2c768d)){return _0x2c768d;}return'\x22\x22\x20<>';};exports[_0x8c28('0x15')]=function(_0x2d9bbf){if(_[_0x8c28('0x16')](_0x2d9bbf)){return![];}return _0x2d9bbf;};exports['addVariables']=function(_0x363c19,_0x4d180d,_0x3a4504,_0x31a43f,_0x9f33f,_0xcfb85b){var _0x1984e3={'XMD-QUEUE':_0x4d180d[_0x8c28('0x17')]?_0x4d180d[_0x8c28('0x17')]['name']:'','XMD-CALLERID':_0x31a43f,'XMD-CALLERID-PREVIEW':_0xcfb85b?util[_0x8c28('0x13')](_0x8c28('0x14'),_0xcfb85b['calleridname'],_0xcfb85b[_0x8c28('0x18')]):_0x31a43f,'XMD-DIALID':_0x9f33f,'XMD-CONTACTID':_0x4d180d[_0x8c28('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x31a43f,'XMD-VOICEQUEUEID':_0x4d180d['VoiceQueueId'],'XMD-DIALCHANNEL':_0x3a4504,'XMD-DIALTIMEOUT':_0x363c19[_0x8c28('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x8c28('0x13')](_0x8c28('0x1b'),_0x363c19[_0x8c28('0x1c')]?'g':'',_[_0x8c28('0x12')](_0x363c19['monitor_format'])?'':_0x8c28('0x1d')),'XMD-DIALURL':_0x363c19[_0x8c28('0x1e')]||'','XMD-AGI':_0x363c19[_0x8c28('0x1f')]?util['format'](_0x8c28('0x20'),ipAgi,_0x363c19[_0x8c28('0x1f')]):_0x8c28('0x21'),'XMD-AGIAFTER':_0x363c19[_0x8c28('0x1c')]?util['format'](_0x8c28('0x20'),ipAgi,_0x363c19[_0x8c28('0x1c')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0xcfb85b?_0xcfb85b[_0x8c28('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0xcfb85b?_0xcfb85b[_0x8c28('0x23')]:'','XMD-DESTINATION':_0x8c28('0x24'),'SIPADDHEADER':_0x8c28('0x25')};if(!_[_0x8c28('0x12')](_0x363c19[_0x8c28('0x26')])){_0x1984e3[util[_0x8c28('0x13')]('%s',_0x8c28('0x27'))]=_0x363c19[_0x8c28('0x26')];_0x1984e3[util[_0x8c28('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x9f33f;}if(_0x4d180d&&_0x4d180d[_0x8c28('0x28')]){for(var _0x4297ab in _0x4d180d['Contact']){if(_0x4d180d[_0x8c28('0x28')]['hasOwnProperty'](_0x4297ab)){if(!_[_0x8c28('0x16')](_0x4d180d[_0x8c28('0x28')][_0x4297ab])&&_0x4297ab!=='id'&&_0x4297ab!==_0x8c28('0x29')&&_0x4297ab!==_0x8c28('0x2a')&&_0x4297ab!==_0x8c28('0x2b')){_0x1984e3[util[_0x8c28('0x13')]('%s%s',_0x8c28('0x2c'),_[_0x8c28('0x2d')](_0x4297ab))]=_0x4d180d['Contact'][_0x4297ab];}}}}return _0x1984e3;};exports[_0x8c28('0x2e')]=function(_0x5f2d62){var _0xedc11={};for(var _0x1f2539 in _0x5f2d62){if(_0x5f2d62[_0x8c28('0x2f')](_0x1f2539)){_0xedc11[util[_0x8c28('0x13')]('%s',_['toLower'](_0x1f2539))]=_0x5f2d62[_0x1f2539];}}return{'variables':_0xedc11};};exports[_0x8c28('0x30')]=function(_0x438b11,_0x1141fc){if(!_['isNil'](_0x438b11)){if(_0x438b11[_0x8c28('0x2f')](_0x8c28('0x31'))){if(_0x438b11[_0x8c28('0x31')]>0x0){_0x438b11[_0x8c28('0x31')]-=0x1;}else{logger[_0x8c28('0x9')](_0x8c28('0x32'),_0x1141fc);}}}else{logger[_0x8c28('0x9')](_0x8c28('0x33'),_0x1141fc);}};exports[_0x8c28('0x34')]=function(_0xb9bba){var _0x337d37=moment()['format'](_0x8c28('0x35'));_0xb9bba[_0x8c28('0x36')]=0xd;_0xb9bba[_0x8c28('0x37')]='Blacklist';_0xb9bba['starttime']=_0x337d37;_0xb9bba['responsetime']=_0x337d37;_0xb9bba[_0x8c28('0x38')]=_0x337d37;};exports[_0x8c28('0x39')]=function(_0x3ff2cc,_0x72861d,_0x2b24a9){var _0x327c9d=moment()[_0x8c28('0x13')](_0x8c28('0x35'));_0x3ff2cc[_0x8c28('0x36')]=_0x72861d;_0x3ff2cc['statedesc']=_0x2b24a9;_0x3ff2cc[_0x8c28('0x3a')]=_0x327c9d;_0x3ff2cc[_0x8c28('0x3b')]=getSeconds(_0x3ff2cc[_0x8c28('0x3a')],_0x3ff2cc[_0x8c28('0x3c')]);};exports['logLookAgent']=function(_0xc960d9,_0x2d23f9,_0xfc810c){_0xc960d9[_0x8c28('0x3d')]=_0x2d23f9;_0xc960d9['UserId']=_0xfc810c;};exports[_0x8c28('0x3e')]=function(_0x166f0b,_0x2a7088,_0x159a3e){var _0x29eee7=moment()['format'](_0x8c28('0x35'));_0x166f0b[_0x8c28('0x36')]=_0x2a7088;_0x166f0b[_0x8c28('0x37')]=_0x159a3e;_0x166f0b[_0x8c28('0x3a')]=_0x166f0b[_0x8c28('0x3a')]?_0x166f0b[_0x8c28('0x3a')]:_0x29eee7;_0x166f0b[_0x8c28('0x38')]=_0x166f0b[_0x8c28('0x38')]?_0x166f0b['endtime']:_0x29eee7;_0x166f0b[_0x8c28('0x3b')]=getSeconds(_0x166f0b[_0x8c28('0x3a')]||0x0,_0x166f0b[_0x8c28('0x3c')]||0x0);_0x166f0b[_0x8c28('0x3f')]=_0x166f0b[_0x8c28('0x40')]?getSeconds(_0x166f0b['endtime'],_0x166f0b[_0x8c28('0x40')]):0x0;};exports[_0x8c28('0x41')]=function(_0x37056a){return _0x37056a===_0x8c28('0x42');};exports[_0x8c28('0x43')]=function(_0x3b242a,_0x5867a5,_0x5c8a6b,_0x4834a8,_0x489f6e){var _0x24bca9=_0x4834a8?'RECALL':_0x3b242a[_0x8c28('0x44')];_0x24bca9=_0x489f6e?_0x8c28('0x45'):_0x24bca9;return{'actionid':_0x3b242a['uniqueid'],'action':_0x8c28('0x46'),'channel':_0x3b242a[_0x8c28('0x47')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x24bca9,_0x3b242a['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x8c28('0x48'),'Priority':'1','variable':_0x5c8a6b,'timeout':(_0x5867a5[_0x8c28('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3b242a['uniqueid']};};exports['totalGlobal']=function(_0x7d6d83){return _0x7d6d83[_0x8c28('0x4a')]+_0x7d6d83[_0x8c28('0x4b')]+_0x7d6d83[_0x8c28('0x4c')]+_0x7d6d83[_0x8c28('0x4d')]+_0x7d6d83[_0x8c28('0x4e')];};exports['cloneAction']=function(_0x4c30b7){var _0x59a8b2=_[_0x8c28('0x4f')](_0x4c30b7);_0x59a8b2[_0x8c28('0x36')]=0xf;_0x59a8b2[_0x8c28('0x37')]=_0x8c28('0x50');return _0x59a8b2;};exports[_0x8c28('0x51')]=function(_0x41af3e,_0x365ea4,_0x5e37da){var _0x236bc1={};_0x236bc1[_0x365ea4]=_0x41af3e[_0x365ea4];_0x236bc1[_0x8c28('0x52')]=![];_0x236bc1[_0x8c28('0x53')]=moment()[_0x8c28('0x54')](_0x5e37da,'minutes')[_0x8c28('0x13')](_0x8c28('0x35'));_0x236bc1[_0x8c28('0x19')]=_0x41af3e[_0x8c28('0x19')];_0x236bc1['ListId']=_0x41af3e['ListId'];_0x236bc1['VoiceQueueId']=_0x41af3e[_0x8c28('0x55')]||undefined;return _0x236bc1;};exports[_0x8c28('0x56')]=function(_0x56765a,_0x4e3977){if(!_[_0x8c28('0x16')](_0x56765a)){if(_0x56765a['pTalking']>0x0){_0x56765a[_0x8c28('0x57')]-=0x1;}else{logger['error'](_0x4e3977,_0x8c28('0x58'));}}else{logger[_0x8c28('0x9')](_0x4e3977,_0x8c28('0x59'));}};exports[_0x8c28('0x5a')]=function(_0x5f25b9){if(_0x5f25b9<=0x0){return!![];}return![];};exports[_0x8c28('0x5b')]=function(_0x4b580c,_0x5eee98,_0x4bc21a){_0x4b580c['lastevent']=_0x5eee98;_0x4b580c[_0x8c28('0x5c')]=_0x4b580c['queue'];_0x4b580c[_0x8c28('0x5d')]=_0x4b580c[_0x8c28('0x47')];_0x4b580c['motionChannel']=_0x8c28('0x5e');if(_0x4bc21a){_0x4b580c[_0x8c28('0x5f')]=_0x4bc21a[_0x8c28('0x5f')];}return _0x4b580c;};exports[_0x8c28('0x60')]=function(_0x34bfc7){var _0x46d4cf={};_0x46d4cf[_0x8c28('0x61')]=_0x34bfc7[_0x8c28('0x61')];_0x46d4cf[_0x8c28('0x5d')]=_0x34bfc7['channelAgent'];_0x46d4cf[_0x8c28('0x62')]=_0x34bfc7[_0x8c28('0x62')];return _0x46d4cf;};exports[_0x8c28('0x63')]=function(_0x15d509){var _0x5e12fb=[];for(var _0x21da70 in _0x15d509){if(_0x15d509['hasOwnProperty'](_0x21da70)){if(!_[_0x8c28('0x16')](_0x15d509[_0x21da70])&&_0x15d509[_0x21da70][_0x8c28('0x36')]===_0x8c28('0x64')&&_0x15d509[_0x21da70]['status']===_0x8c28('0x65')){_0x5e12fb[_0x8c28('0x66')](_0x15d509[_0x21da70]['id']);}}}return _0x5e12fb;};exports[_0x8c28('0x67')]=function(_0x8c304f){var _0x11b062=moment()['milliseconds'](0x0);var _0x55701e=moment(_0x8c304f)[_0x8c28('0x6')](0x0);return _0x11b062[_0x8c28('0x7')](_0x55701e,_0x8c28('0x8'));};exports['createBody']=function(_0x41ca5d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x41ca5d['ContactId'],'ListId':_0x41ca5d[_0x8c28('0x68')],'VoiceQueueId':_0x41ca5d[_0x8c28('0x55')]||undefined,'CampaignId':_0x41ca5d[_0x8c28('0x69')]||undefined};};exports[_0x8c28('0x6a')]=function(_0x207793){if(_0x207793===_0x8c28('0x62')||_0x207793==='idContact'||_0x207793===_0x8c28('0x61')||_0x207793===_0x8c28('0x6b')||_0x207793==='campaigntype'||_0x207793===_0x8c28('0x6c')||_0x207793===_0x8c28('0x3d')||_0x207793==='channelAgent'||_0x207793===_0x8c28('0x44')||_0x207793===_0x8c28('0x52')||_0x207793==='calleridnum'||_0x207793===_0x8c28('0x53')||_0x207793===_0x8c28('0x4a')||_0x207793===_0x8c28('0x4b')||_0x207793==='countnoanswerretry'||_0x207793===_0x8c28('0x6d')||_0x207793==='callback'||_0x207793==='callbackuniqueid'||_0x207793==='callbackat'||_0x207793===_0x8c28('0x6e')||_0x207793==='ContactId'||_0x207793===_0x8c28('0x68')||_0x207793==='UserId'||_0x207793===_0x8c28('0x55')||_0x207793===_0x8c28('0x6f')||_0x207793===_0x8c28('0x70')||_0x207793===_0x8c28('0x71')||_0x207793===_0x8c28('0x72')||_0x207793===_0x8c28('0x73')||_0x207793===_0x8c28('0x74')||_0x207793===_0x8c28('0x75')||_0x207793==='xmd-dialoptions'||_0x207793===_0x8c28('0x76')||_0x207793===_0x8c28('0x77')||_0x207793===_0x8c28('0x78')||_0x207793===_0x8c28('0x79')||_0x207793===_0x8c28('0x7a')||_0x207793===_0x8c28('0x7b')||_0x207793===_0x8c28('0x7c')||_0x207793==='rtpaudioqos'||_0x207793===_0x8c28('0x7d')||_0x207793===_0x8c28('0x7e')||_0x207793==='rtpaudioqosjitterbridged'||_0x207793===_0x8c28('0x7f')||_0x207793===_0x8c28('0x80')||_0x207793===_0x8c28('0x81')||_0x207793===_0x8c28('0x82')||_0x207793===_0x8c28('0x83')||_0x207793===_0x8c28('0x7d')||_0x207793==='rtpaudioqosjitter'||_0x207793===_0x8c28('0x84')||_0x207793===_0x8c28('0x7f')||_0x207793===_0x8c28('0x80')||_0x207793===_0x8c28('0x81')||_0x207793===_0x8c28('0x82')||_0x207793===_0x8c28('0x85')||_0x207793===_0x8c28('0x86')||_0x207793===_0x8c28('0x36')||_0x207793===_0x8c28('0x37')){return![];}return!![];};exports[_0x8c28('0x87')]=function(_0x2281d5,_0x3da342){var _0x11d605,_0x354d3f,_0x2ed44f;if(_0x3da342<=0x0){_0x3da342=0x1;}_0x11d605=new RegExp('\x5cw{0,'+_0x3da342+'}$');_0x354d3f=Math[_0x8c28('0x88')](0xa,_0x3da342-0x1);_0x2ed44f=Math['pow'](0xa,_0x3da342)-0x1;return util['format']('%s',_[_0x8c28('0x89')](_0x2281d5,_0x11d605,_[_0x8c28('0x8a')](_0x354d3f,_0x2ed44f)));};exports['extractCalleridName']=function(_0x483aaf){var _0x12ece5=_0x483aaf[_0x8c28('0x8b')](/"(.*?)"/);return _0x12ece5?_0x12ece5[0x1]:_0x483aaf;};exports[_0x8c28('0x8c')]=function(_0x310512){var _0x4f18d5=_0x310512[_0x8c28('0x8b')](/<(.*?)>/);return _0x4f18d5?_0x4f18d5[0x1]:_0x310512;}; \ No newline at end of file +var _0x0caf=['bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','util','moment','../../../../config/logger','milliseconds','diff','error','inspect','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','ringtime','membername','UserId','logCustomer','answertime','isFailure','Failure','variablesAction','RECALL','originate','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','channelAgent','voice','mandatoryDisposition','buildAcw','interface','status','reachable','push','getDiff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','rtpaudioqoslossbridged'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0caf,0x92));var _0xf0ca=function(_0x1011d8,_0x24b6b0){_0x1011d8=_0x1011d8-0x0;var _0x281797=_0x0caf[_0x1011d8];return _0x281797;};'use strict';var util=require(_0xf0ca('0x0'));var _=require('lodash');var moment=require(_0xf0ca('0x1'));var logger=require(_0xf0ca('0x2'))('preview');var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x508bfe,_0x519238){var _0x1b736c=moment(_0x508bfe)['milliseconds'](0x0);var _0x5d3666=moment(_0x519238)[_0xf0ca('0x3')](0x0);return _0x1b736c[_0xf0ca('0x4')](_0x5d3666,'seconds');}exports['loggerCatch']=function(_0x754efb){return function(_0x17af1b){logger[_0xf0ca('0x5')](_0x754efb,util[_0xf0ca('0x6')](_0x17af1b,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x53fe91,_0x296bb5){logger['info'](_0x53fe91,util[_0xf0ca('0x6')](_0x296bb5,{'showHidden':![],'depth':null}));};exports[_0xf0ca('0x7')]=function(_0x11f74a,_0x47846c){logger['error'](_0x11f74a,util[_0xf0ca('0x6')](_0x47846c,{'showHidden':![],'depth':null}));};exports[_0xf0ca('0x8')]=function(_0x23cb6c){return function(_0xfc8d6e){logger['info'](_0x23cb6c,util[_0xf0ca('0x6')](_0xfc8d6e,{'showHidden':![],'depth':null}));};};exports[_0xf0ca('0x9')]=function(_0x3edb0c,_0x7f0c9c,_0x3cdd0f){return{'message':_0x3edb0c,'unlock':_0x7f0c9c,'active':_0x3cdd0f};};exports[_0xf0ca('0xa')]=function(_0x2a6cda,_0x566bf0,_0x3e9c2e){if(!_['isUndefined'](_0x3e9c2e)&&_0xf0ca('0xb')===typeof _0x3e9c2e&&!_[_0xf0ca('0xc')](_0x3e9c2e)){if(!_[_0xf0ca('0xd')](_0x566bf0)&&_0xf0ca('0xb')===typeof _0x566bf0&&!_['isEmpty'](_0x566bf0)){return util[_0xf0ca('0xe')]('\x22%s\x22\x20<%s>',_0x566bf0,_0x3e9c2e);}return util[_0xf0ca('0xe')](_0xf0ca('0xf'),_0x3e9c2e,_0x3e9c2e);}if(!_[_0xf0ca('0xd')](_0x2a6cda)&&_0xf0ca('0xb')===typeof _0x2a6cda&&!_[_0xf0ca('0xc')](_0x2a6cda)){return _0x2a6cda;}return _0xf0ca('0x10');};exports['isActive']=function(_0x293838){if(_[_0xf0ca('0x11')](_0x293838)){return![];}return _0x293838;};exports[_0xf0ca('0x12')]=function(_0x43c0dc,_0x11cbdf,_0x2caa29,_0x599871,_0x3f6adc,_0x1858dd){var _0x5c0bb3={'XMD-QUEUE':_0x11cbdf[_0xf0ca('0x13')]?_0x11cbdf[_0xf0ca('0x13')]['name']:'','XMD-CALLERID':_0x599871,'XMD-CALLERID-PREVIEW':_0x1858dd?util[_0xf0ca('0xe')]('\x22%s\x22\x20<%s>',_0x1858dd['calleridname'],_0x1858dd[_0xf0ca('0x14')]):_0x599871,'XMD-DIALID':_0x3f6adc,'XMD-CONTACTID':_0x11cbdf[_0xf0ca('0x15')],'XMD-CDRTYPE':_0xf0ca('0x16'),'CALLERID(all)':_0x599871,'XMD-VOICEQUEUEID':_0x11cbdf[_0xf0ca('0x17')],'XMD-DIALCHANNEL':_0x2caa29,'XMD-DIALTIMEOUT':_0x43c0dc[_0xf0ca('0x18')]||0x1e,'XMD-DIALOPTIONS':util[_0xf0ca('0xe')](_0xf0ca('0x19'),_0x43c0dc[_0xf0ca('0x1a')]?'g':'',_[_0xf0ca('0xc')](_0x43c0dc[_0xf0ca('0x1b')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x43c0dc[_0xf0ca('0x1c')]||'','XMD-AGI':_0x43c0dc[_0xf0ca('0x1d')]?util[_0xf0ca('0xe')]('\x22agi://%s/square,%s\x22',ipAgi,_0x43c0dc[_0xf0ca('0x1d')]):'NONE','XMD-AGIAFTER':_0x43c0dc[_0xf0ca('0x1a')]?util[_0xf0ca('0xe')](_0xf0ca('0x1e'),ipAgi,_0x43c0dc[_0xf0ca('0x1a')]):_0xf0ca('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x1858dd?_0x1858dd[_0xf0ca('0x20')]:'','XMD-ORIGINATECALLERIDNAME':_0x1858dd?_0x1858dd['originatecalleridname']:'','XMD-DESTINATION':_0xf0ca('0x21'),'SIPADDHEADER':_0xf0ca('0x22')};if(!_[_0xf0ca('0xc')](_0x43c0dc[_0xf0ca('0x1b')])){_0x5c0bb3[util[_0xf0ca('0xe')]('%s',_0xf0ca('0x23'))]=_0x43c0dc[_0xf0ca('0x1b')];_0x5c0bb3[util[_0xf0ca('0xe')]('%s',_0xf0ca('0x24'))]=_0x3f6adc;}if(_0x11cbdf&&_0x11cbdf[_0xf0ca('0x25')]){for(var _0x5b0d62 in _0x11cbdf[_0xf0ca('0x25')]){if(_0x11cbdf[_0xf0ca('0x25')][_0xf0ca('0x26')](_0x5b0d62)){if(!_[_0xf0ca('0x11')](_0x11cbdf[_0xf0ca('0x25')][_0x5b0d62])&&_0x5b0d62!=='id'&&_0x5b0d62!==_0xf0ca('0x27')&&_0x5b0d62!=='createdAt'&&_0x5b0d62!==_0xf0ca('0x28')){_0x5c0bb3[util[_0xf0ca('0xe')](_0xf0ca('0x29'),_0xf0ca('0x2a'),_['toUpper'](_0x5b0d62))]=_0x11cbdf[_0xf0ca('0x25')][_0x5b0d62];}}}}return _0x5c0bb3;};exports[_0xf0ca('0x2b')]=function(_0x19480d){var _0x3ecfd6={};for(var _0x7e073a in _0x19480d){if(_0x19480d[_0xf0ca('0x26')](_0x7e073a)){_0x3ecfd6[util[_0xf0ca('0xe')]('%s',_[_0xf0ca('0x2c')](_0x7e073a))]=_0x19480d[_0x7e073a];}}return{'variables':_0x3ecfd6};};exports[_0xf0ca('0x2d')]=function(_0x36ea82,_0xc5ba20){if(!_['isNil'](_0x36ea82)){if(_0x36ea82[_0xf0ca('0x26')](_0xf0ca('0x2e'))){if(_0x36ea82[_0xf0ca('0x2e')]>0x0){_0x36ea82[_0xf0ca('0x2e')]-=0x1;}else{logger[_0xf0ca('0x5')](_0xf0ca('0x2f'),_0xc5ba20);}}}else{logger[_0xf0ca('0x5')](_0xf0ca('0x30'),_0xc5ba20);}};exports['logBlacklist']=function(_0x54bd82){var _0x6376f7=moment()[_0xf0ca('0xe')](_0xf0ca('0x31'));_0x54bd82[_0xf0ca('0x32')]=0xd;_0x54bd82[_0xf0ca('0x33')]='Blacklist';_0x54bd82[_0xf0ca('0x34')]=_0x6376f7;_0x54bd82[_0xf0ca('0x35')]=_0x6376f7;_0x54bd82[_0xf0ca('0x36')]=_0x6376f7;};exports[_0xf0ca('0x37')]=function(_0x568dd7,_0x223b07,_0x9ea297){var _0xffa037=moment()[_0xf0ca('0xe')](_0xf0ca('0x31'));_0x568dd7[_0xf0ca('0x32')]=_0x223b07;_0x568dd7[_0xf0ca('0x33')]=_0x9ea297;_0x568dd7[_0xf0ca('0x35')]=_0xffa037;_0x568dd7[_0xf0ca('0x38')]=getSeconds(_0x568dd7['responsetime'],_0x568dd7[_0xf0ca('0x34')]);};exports['logLookAgent']=function(_0x78bae0,_0x4d268e,_0xa6d2ae){_0x78bae0[_0xf0ca('0x39')]=_0x4d268e;_0x78bae0[_0xf0ca('0x3a')]=_0xa6d2ae;};exports[_0xf0ca('0x3b')]=function(_0x8e22,_0x51af1d,_0x3e7959){var _0x389229=moment()[_0xf0ca('0xe')](_0xf0ca('0x31'));_0x8e22[_0xf0ca('0x32')]=_0x51af1d;_0x8e22[_0xf0ca('0x33')]=_0x3e7959;_0x8e22['responsetime']=_0x8e22[_0xf0ca('0x35')]?_0x8e22[_0xf0ca('0x35')]:_0x389229;_0x8e22[_0xf0ca('0x36')]=_0x8e22[_0xf0ca('0x36')]?_0x8e22[_0xf0ca('0x36')]:_0x389229;_0x8e22[_0xf0ca('0x38')]=getSeconds(_0x8e22['responsetime']||0x0,_0x8e22['starttime']||0x0);_0x8e22['talktime']=_0x8e22['answertime']?getSeconds(_0x8e22[_0xf0ca('0x36')],_0x8e22[_0xf0ca('0x3c')]):0x0;};exports[_0xf0ca('0x3d')]=function(_0x37bc9f){return _0x37bc9f===_0xf0ca('0x3e');};exports[_0xf0ca('0x3f')]=function(_0x3cb71a,_0x566a66,_0x5ba08a,_0x302b27,_0x4061eb){var _0x1ef87e=_0x302b27?_0xf0ca('0x40'):_0x3cb71a['calleridname'];_0x1ef87e=_0x4061eb?'BOOKED':_0x1ef87e;return{'actionid':_0x3cb71a['uniqueid'],'action':_0xf0ca('0x41'),'channel':_0x3cb71a['channelAgent'],'callerid':util[_0xf0ca('0xe')](_0xf0ca('0xf'),_0x1ef87e,_0x3cb71a['calleridnum']),'Exten':_0xf0ca('0x21'),'Context':_0xf0ca('0x42'),'Priority':'1','variable':_0x5ba08a,'timeout':(_0x566a66[_0xf0ca('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3cb71a[_0xf0ca('0x44')]};};exports[_0xf0ca('0x45')]=function(_0xbfa0c7){return _0xbfa0c7[_0xf0ca('0x46')]+_0xbfa0c7[_0xf0ca('0x47')]+_0xbfa0c7[_0xf0ca('0x48')]+_0xbfa0c7[_0xf0ca('0x49')]+_0xbfa0c7[_0xf0ca('0x4a')];};exports['cloneAction']=function(_0x578ada){var _0x50c2a6=_['clone'](_0x578ada);_0x50c2a6[_0xf0ca('0x32')]=0xf;_0x50c2a6[_0xf0ca('0x33')]='Global';return _0x50c2a6;};exports[_0xf0ca('0x4b')]=function(_0x36ac0c,_0x1933ea,_0x2c42a8){var _0x1daa7f={};_0x1daa7f[_0x1933ea]=_0x36ac0c[_0x1933ea];_0x1daa7f[_0xf0ca('0x4c')]=![];_0x1daa7f[_0xf0ca('0x4d')]=moment()[_0xf0ca('0x4e')](_0x2c42a8,_0xf0ca('0x4f'))[_0xf0ca('0xe')](_0xf0ca('0x31'));_0x1daa7f[_0xf0ca('0x15')]=_0x36ac0c[_0xf0ca('0x15')];_0x1daa7f['ListId']=_0x36ac0c[_0xf0ca('0x50')];_0x1daa7f[_0xf0ca('0x17')]=_0x36ac0c['VoiceQueueId']||undefined;return _0x1daa7f;};exports[_0xf0ca('0x51')]=function(_0x3ef1a8,_0x4d5178){if(!_[_0xf0ca('0x11')](_0x3ef1a8)){if(_0x3ef1a8[_0xf0ca('0x52')]>0x0){_0x3ef1a8[_0xf0ca('0x52')]-=0x1;}else{logger['error'](_0x4d5178,_0xf0ca('0x53'));}}else{logger[_0xf0ca('0x5')](_0x4d5178,_0xf0ca('0x54'));}};exports[_0xf0ca('0x55')]=function(_0x422a49){if(_0x422a49<=0x0){return!![];}return![];};exports[_0xf0ca('0x56')]=function(_0x5268b3,_0x4922fb,_0xbeeb99){_0x5268b3[_0xf0ca('0x57')]=_0x4922fb;_0x5268b3[_0xf0ca('0x58')]=_0x5268b3[_0xf0ca('0x59')];_0x5268b3['interface']=_0x5268b3[_0xf0ca('0x5a')];_0x5268b3['motionChannel']=_0xf0ca('0x5b');if(_0xbeeb99){_0x5268b3['mandatoryDisposition']=_0xbeeb99[_0xf0ca('0x5c')];}return _0x5268b3;};exports[_0xf0ca('0x5d')]=function(_0x2169a8){var _0x198a81={};_0x198a81[_0xf0ca('0x59')]=_0x2169a8[_0xf0ca('0x59')];_0x198a81[_0xf0ca('0x5e')]=_0x2169a8[_0xf0ca('0x5a')];_0x198a81[_0xf0ca('0x44')]=_0x2169a8[_0xf0ca('0x44')];return _0x198a81;};exports['agentReadyId']=function(_0x28701e){var _0x73c3a1=[];for(var _0x375890 in _0x28701e){if(_0x28701e[_0xf0ca('0x26')](_0x375890)){if(!_['isNil'](_0x28701e[_0x375890])&&_0x28701e[_0x375890][_0xf0ca('0x32')]==='not_inuse'&&_0x28701e[_0x375890][_0xf0ca('0x5f')]===_0xf0ca('0x60')){_0x73c3a1[_0xf0ca('0x61')](_0x28701e[_0x375890]['id']);}}}return _0x73c3a1;};exports[_0xf0ca('0x62')]=function(_0x2d9382){var _0x2aebfb=moment()[_0xf0ca('0x3')](0x0);var _0x4c5837=moment(_0x2d9382)[_0xf0ca('0x3')](0x0);return _0x2aebfb[_0xf0ca('0x4')](_0x4c5837,_0xf0ca('0x63'));};exports[_0xf0ca('0x64')]=function(_0x282a3d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x282a3d['ContactId'],'ListId':_0x282a3d['ListId'],'VoiceQueueId':_0x282a3d['VoiceQueueId']||undefined,'CampaignId':_0x282a3d[_0xf0ca('0x65')]||undefined};};exports[_0xf0ca('0x66')]=function(_0x17d365){if(_0x17d365==='uniqueid'||_0x17d365===_0xf0ca('0x67')||_0x17d365===_0xf0ca('0x59')||_0x17d365===_0xf0ca('0x68')||_0x17d365===_0xf0ca('0x69')||_0x17d365===_0xf0ca('0x6a')||_0x17d365===_0xf0ca('0x39')||_0x17d365===_0xf0ca('0x5a')||_0x17d365==='calleridname'||_0x17d365===_0xf0ca('0x4c')||_0x17d365===_0xf0ca('0x14')||_0x17d365===_0xf0ca('0x4d')||_0x17d365===_0xf0ca('0x46')||_0x17d365===_0xf0ca('0x47')||_0x17d365==='countnoanswerretry'||_0x17d365===_0xf0ca('0x6b')||_0x17d365==='callback'||_0x17d365===_0xf0ca('0x6c')||_0x17d365==='callbackat'||_0x17d365===_0xf0ca('0x6d')||_0x17d365==='ContactId'||_0x17d365===_0xf0ca('0x50')||_0x17d365==='UserId'||_0x17d365==='VoiceQueueId'||_0x17d365===_0xf0ca('0x6e')||_0x17d365===_0xf0ca('0x6f')||_0x17d365===_0xf0ca('0x70')||_0x17d365===_0xf0ca('0x71')||_0x17d365===_0xf0ca('0x72')||_0x17d365===_0xf0ca('0x73')||_0x17d365===_0xf0ca('0x74')||_0x17d365===_0xf0ca('0x75')||_0x17d365===_0xf0ca('0x76')||_0x17d365==='xmd-dialchannel'||_0x17d365===_0xf0ca('0x77')||_0x17d365===_0xf0ca('0x78')||_0x17d365===_0xf0ca('0x79')||_0x17d365==='xmd-agiafter'||_0x17d365===_0xf0ca('0x7a')||_0x17d365==='rtpaudioqos'||_0x17d365===_0xf0ca('0x7b')||_0x17d365===_0xf0ca('0x7c')||_0x17d365===_0xf0ca('0x7d')||_0x17d365==='rtpaudioqosloss'||_0x17d365==='rtpaudioqoslossbridged'||_0x17d365===_0xf0ca('0x7e')||_0x17d365===_0xf0ca('0x7f')||_0x17d365==='rtpaudioqos'||_0x17d365==='rtpaudioqosbridged'||_0x17d365===_0xf0ca('0x7c')||_0x17d365===_0xf0ca('0x7d')||_0x17d365===_0xf0ca('0x80')||_0x17d365===_0xf0ca('0x81')||_0x17d365===_0xf0ca('0x7e')||_0x17d365===_0xf0ca('0x7f')||_0x17d365===_0xf0ca('0x82')||_0x17d365==='bridgepvtcallid'||_0x17d365===_0xf0ca('0x32')||_0x17d365===_0xf0ca('0x33')){return![];}return!![];};exports[_0xf0ca('0x83')]=function(_0x5bbcb6,_0x3ae463){var _0x43108c,_0x4b959b,_0x24d5bd;if(_0x3ae463<=0x0){_0x3ae463=0x1;}_0x43108c=new RegExp(_0xf0ca('0x84')+_0x3ae463+'}$');_0x4b959b=Math['pow'](0xa,_0x3ae463-0x1);_0x24d5bd=Math[_0xf0ca('0x85')](0xa,_0x3ae463)-0x1;return util[_0xf0ca('0xe')]('%s',_[_0xf0ca('0x86')](_0x5bbcb6,_0x43108c,_[_0xf0ca('0x87')](_0x4b959b,_0x24d5bd)));};exports[_0xf0ca('0x88')]=function(_0x10ec90){var _0x3b5c24=_0x10ec90[_0xf0ca('0x89')](/"(.*?)"/);return _0x3b5c24?_0x3b5c24[0x1]:_0x10ec90;};exports['extractCalleridNumber']=function(_0x439273){var _0x5e9c1d=_0x439273['match'](/<(.*?)>/);return _0x5e9c1d?_0x5e9c1d[0x1]:_0x439273;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index fd31510..b4650de 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 _0x3156=['voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','queueremove','boolean','reload'];(function(_0x26b3ea,_0x14bef1){var _0x48afd2=function(_0x38ec43){while(--_0x38ec43){_0x26b3ea['push'](_0x26b3ea['shift']());}};_0x48afd2(++_0x14bef1);}(_0x3156,0x13c));var _0x6315=function(_0x2872c6,_0x4afc40){_0x2872c6=_0x2872c6-0x0;var _0x5c4375=_0x3156[_0x2872c6];return _0x5c4375;};'use strict';exports['queueadd']={'queue':{'type':_0x6315('0x0'),'required':!![]},'interface':{'type':_0x6315('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x6315('0x1')]={'queue':{'type':_0x6315('0x0'),'required':!![]},'interface':{'type':_0x6315('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x6315('0x0'),'required':!![]},'paused':{'type':_0x6315('0x2')},'reason':{'type':_0x6315('0x0'),'required':![]}};exports[_0x6315('0x3')]={'module':{'type':_0x6315('0x0'),'required':![]}};exports[_0x6315('0x4')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x6315('0x5')]={'uniqueid':{'type':_0x6315('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0x6315('0x0')}};exports[_0x6315('0x6')]={'uniqueid':{'type':_0x6315('0x0'),'required':!![]}};exports[_0x6315('0x7')]={'uniqueid':{'type':_0x6315('0x0'),'required':!![]},'exten':{'type':_0x6315('0x0'),'required':!![]},'context':{'type':_0x6315('0x0')}}; \ No newline at end of file +var _0xa7c2=['voicechannel','voicequeuechannelhangup','queueadd','string','number','queueremove','reload'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0xa7c2,0xf0));var _0x2a7c=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xa7c2[_0x2be8c2];return _0x97f531;};'use strict';exports[_0x2a7c('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x2a7c('0x1'),'required':!![]},'membername':{'type':_0x2a7c('0x1'),'required':!![]},'penalty':{'type':_0x2a7c('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x2a7c('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x2a7c('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x2a7c('0x1'),'required':![]}};exports[_0x2a7c('0x4')]={'module':{'type':_0x2a7c('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x2a7c('0x1'),'required':!![]}};exports[_0x2a7c('0x5')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x2a7c('0x1')},'format':{'type':_0x2a7c('0x1')},'mixmonitorid':{'type':_0x2a7c('0x1')}};exports[_0x2a7c('0x6')]={'uniqueid':{'type':_0x2a7c('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x2a7c('0x1'),'required':!![]},'exten':{'type':_0x2a7c('0x1'),'required':!![]},'context':{'type':_0x2a7c('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index d13931c..ff7a9bc 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 _0xbec8=['SIP/%s','name','hasOwnProperty','format','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','isNil','isUndefined','initVoiceQueues','voiceQueues','triggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','deskAccounts','initServicenowAccounts','servicenowAccounts','merge','initVoiceQueueReports','uniqueid','queue','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','outbound','ANSWERED','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xbec8,0x187));var _0x8bec=function(_0x1eced4,_0xc5070f){_0x1eced4=_0x1eced4-0x0;var _0x1a91e5=_0xbec8[_0x1eced4];return _0x1a91e5;};'use strict';var BPromise=require(_0x8bec('0x0'));var util=require(_0x8bec('0x1'));var _=require(_0x8bec('0x2'));var moment=require(_0x8bec('0x3'));var Agent=require(_0x8bec('0x4'));var Telephone=require(_0x8bec('0x5'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x8bec('0x6'));var Trigger=require(_0x8bec('0x7'));var Template=require(_0x8bec('0x8'));var Campaign=require(_0x8bec('0x9'));var VoiceExtension=require(_0x8bec('0xa'));var ZendeskAccount=require(_0x8bec('0xb'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x8bec('0xc'));var SugarcrmAccount=require(_0x8bec('0xd'));var ZohoAccount=require(_0x8bec('0xe'));var DeskAccount=require(_0x8bec('0xf'));var VtigerAccount=require(_0x8bec('0x10'));var ServicenowAccount=require(_0x8bec('0x11'));var Dynamics365Account=require(_0x8bec('0x12'));var FreshsalesAccount=require(_0x8bec('0x13'));var FaxAccount=require(_0x8bec('0x14'));var Realtime=function(){this['agents']={};this[_0x8bec('0x15')]={};this[_0x8bec('0x16')]={};this['voiceQueues']={};this['triggers']={};this['campaigns']={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8bec('0x17')]={};this[_0x8bec('0x18')]={};this[_0x8bec('0x19')]={};this[_0x8bec('0x1a')]={};this[_0x8bec('0x1b')]={};this[_0x8bec('0x1c')]={};this[_0x8bec('0x1d')]={};this[_0x8bec('0x1e')]={};this[_0x8bec('0x1f')]={};this[_0x8bec('0x20')]={};this['zohoAccounts']={};this['deskAccounts']={};this[_0x8bec('0x21')]={};this['servicenowAccounts']={};this[_0x8bec('0x22')]={};this[_0x8bec('0x23')]={};this['faxAccounts']={};};function freeIsNotKey(_0x370f88,_0xe88187,_0x371114){var _0x3a702e=_[_0x8bec('0x24')](_0x370f88,function(_0x38de1d,_0x519e6b){return _0x38de1d[_0x371114];});for(var _0xada008 in _0xe88187){if(_0xe88187['hasOwnProperty'](_0xada008)){if(!_0x3a702e[_0xada008]){delete _0xe88187[_0xada008];}}}}function freeIsNotKeySip(_0x7eec4d,_0x481b89){var _0x77bf63=_[_0x8bec('0x24')](_0x7eec4d,function(_0x1f7de9,_0x206a74){return util['format'](_0x8bec('0x25'),_0x1f7de9[_0x8bec('0x26')]);});for(var _0x21ba51 in _0x481b89){if(_0x481b89[_0x8bec('0x27')](_0x21ba51)){if(!_0x77bf63[_0x21ba51]){delete _0x481b89[_0x21ba51];}}}}function freeIsNotKeyAgent(_0x2b5a57,_0x4a2861){var _0x512cea=_[_0x8bec('0x24')](_0x2b5a57,function(_0x81c136,_0x3a364c){var _0xacffe2=_['isNil'](_0x81c136['interface'])?util[_0x8bec('0x28')]('SIP/%s',_0x81c136[_0x8bec('0x26')]):_0x81c136[_0x8bec('0x29')];return _0xacffe2;});for(var _0xde216 in _0x4a2861){if(_0x4a2861[_0x8bec('0x27')](_0xde216)){if(!_0x512cea[_0xde216]){delete _0x4a2861[_0xde216];}}}}function clearVoiceCallReports(_0x59088c){_0x59088c[_0x8bec('0x2a')]=0x0;_0x59088c[_0x8bec('0x2b')]=0x0;_0x59088c[_0x8bec('0x2c')]=0x0;_0x59088c[_0x8bec('0x2d')]=0x0;_0x59088c[_0x8bec('0x2e')]=0x0;}function clearCampaigns(_0x252c5f){if(!_[_0x8bec('0x2f')](_0x252c5f)){for(var _0x280fe6 in _0x252c5f){if(_0x252c5f[_0x8bec('0x27')](_0x280fe6)){_0x252c5f[_0x280fe6]['ivrTotalCallsDays']=0x0;_0x252c5f[_0x280fe6]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x1acd6e){if(!_[_0x8bec('0x2f')](_0x1acd6e)){for(var _0x5bc6d3 in _0x1acd6e){if(_0x1acd6e[_0x8bec('0x27')](_0x5bc6d3)){_0x1acd6e[_0x5bc6d3][_0x8bec('0x2a')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x2b')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x30')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x31')]=0x0;_0x1acd6e[_0x5bc6d3]['sumHoldTime']=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x2d')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x2e')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x32')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x33')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x34')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x35')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x36')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x37')]=0x0;_0x1acd6e[_0x5bc6d3]['outboundDropCallsDayTimeout']=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x38')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x39')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x3a')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x3b')]=0x0;_0x1acd6e[_0x5bc6d3]['outboundReCallsDay']=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x32')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x3c')]=0x0;_0x1acd6e[_0x5bc6d3][_0x8bec('0x3d')]=!![];}}}}Realtime[_0x8bec('0x3e')][_0x8bec('0x3f')]=function(_0x80d95a,_0x7971fc){for(var _0x5367d6 in _0x7971fc){if(_0x80d95a[_0x8bec('0x27')](_0x5367d6)){_0x80d95a[_0x5367d6]=_0x7971fc[_0x5367d6];}}};Realtime['prototype'][_0x8bec('0x40')]=function(){var _0x9490f6=this;return function(_0x1aa02c){if(_0x1aa02c){freeIsNotKeyAgent(_0x1aa02c,_0x9490f6[_0x8bec('0x41')]);for(var _0x2b2171=0x0,_0xe38dd2={},_0x5acd79={};_0x2b2171<_0x1aa02c[_0x8bec('0x42')];_0x2b2171+=0x1){_0xe38dd2=_0x1aa02c[_0x2b2171];var _0x456659=_[_0x8bec('0x43')](_0xe38dd2['interface'])?util[_0x8bec('0x28')](_0x8bec('0x25'),_0xe38dd2[_0x8bec('0x26')]):_0xe38dd2[_0x8bec('0x29')];if(_[_0x8bec('0x44')](_0x9490f6['agents'][_0x456659])){_0x9490f6[_0x8bec('0x41')][_0x456659]=new Agent(_0xe38dd2);}else{_0x9490f6[_0x8bec('0x3f')](_0x9490f6[_0x8bec('0x41')][_0x456659],_0xe38dd2);}}}return _0x9490f6[_0x8bec('0x41')];};};Realtime['prototype']['initTelephones']=function(){var _0xa634f7=this;return function(_0x449542){if(_0x449542){freeIsNotKeySip(_0x449542,_0xa634f7['telephones']);for(var _0x3f47be=0x0,_0x38d32b={},_0x12a158={};_0x3f47be<_0x449542['length'];_0x3f47be+=0x1){_0x38d32b=_0x449542[_0x3f47be];if(_[_0x8bec('0x44')](_0xa634f7['telephones'][util[_0x8bec('0x28')](_0x8bec('0x25'),_0x38d32b[_0x8bec('0x26')])])){_0xa634f7[_0x8bec('0x15')][util['format']('SIP/%s',_0x38d32b[_0x8bec('0x26')])]=new Telephone(_0x38d32b);}else{_0xa634f7[_0x8bec('0x3f')](_0xa634f7[_0x8bec('0x15')][util['format']('SIP/%s',_0x38d32b[_0x8bec('0x26')])],_0x38d32b);}}}return _0xa634f7[_0x8bec('0x15')];};};Realtime[_0x8bec('0x3e')]['initTrunks']=function(){var _0x315076=this;return function(_0x1bdbf7){if(_0x1bdbf7){freeIsNotKeySip(_0x1bdbf7,_0x315076[_0x8bec('0x16')]);for(var _0x9e419b=0x0,_0x200c5c={},_0x16b58c={};_0x9e419b<_0x1bdbf7[_0x8bec('0x42')];_0x9e419b+=0x1){_0x200c5c=_0x1bdbf7[_0x9e419b];if(_['isUndefined'](_0x315076['trunks'][util[_0x8bec('0x28')](_0x8bec('0x25'),_0x200c5c[_0x8bec('0x26')])])){_0x315076[_0x8bec('0x16')][util['format'](_0x8bec('0x25'),_0x200c5c[_0x8bec('0x26')])]=new Trunk(_0x200c5c);}else{_0x315076['mergeFromDatabase'](_0x315076[_0x8bec('0x16')][util['format']('SIP/%s',_0x200c5c['name'])],_0x200c5c);}}}return _0x315076[_0x8bec('0x16')];};};Realtime[_0x8bec('0x3e')][_0x8bec('0x45')]=function(){var _0x3add4a=this;return function(_0x3d3a32){if(_0x3d3a32){freeIsNotKey(_0x3d3a32,_0x3add4a['voiceQueues'],_0x8bec('0x26'));for(var _0x3a0f85=0x0,_0x23bda8={},_0xc233c={};_0x3a0f85<_0x3d3a32[_0x8bec('0x42')];_0x3a0f85+=0x1){_0x23bda8=_0x3d3a32[_0x3a0f85];if(_[_0x8bec('0x44')](_0x3add4a[_0x8bec('0x46')][_0x23bda8[_0x8bec('0x26')]])){_0x3add4a[_0x8bec('0x46')][_0x23bda8['name']]=new VoiceQueue(_0x23bda8);}else{_0x3add4a[_0x8bec('0x3f')](_0x3add4a[_0x8bec('0x46')][_0x23bda8[_0x8bec('0x26')]],_0x23bda8);}}}return _0x3add4a['voiceQueues'];};};Realtime['prototype']['initTriggers']=function(){var _0x483d97=this;return function(_0x4cfdcd){if(_0x4cfdcd){freeIsNotKey(_0x4cfdcd,_0x483d97[_0x8bec('0x47')],'id');for(var _0x311545=0x0,_0x58a55d={},_0x36743f={};_0x311545<_0x4cfdcd['length'];_0x311545+=0x1){_0x58a55d=_0x4cfdcd[_0x311545];if(_[_0x8bec('0x44')](_0x483d97['triggers'][_0x58a55d['id']])){_0x483d97[_0x8bec('0x47')][_0x58a55d['id']]=new Trigger(_0x58a55d);}else{_0x483d97['mergeFromDatabase'](_0x483d97['triggers'][_0x58a55d['id']],_0x58a55d);}}}return _0x483d97[_0x8bec('0x47')];};};Realtime[_0x8bec('0x3e')][_0x8bec('0x48')]=function(){var _0x1b87da=this;return function(_0x24e2db){if(_0x24e2db){freeIsNotKey(_0x24e2db,_0x1b87da[_0x8bec('0x49')],'id');for(var _0x47e828=0x0,_0x2676c0={},_0x45990c={};_0x47e828<_0x24e2db[_0x8bec('0x42')];_0x47e828+=0x1){_0x2676c0=_0x24e2db[_0x47e828];if(_[_0x8bec('0x44')](_0x1b87da[_0x8bec('0x49')][_0x2676c0['id']])){_0x1b87da[_0x8bec('0x49')][_0x2676c0['id']]=new Template(_0x2676c0);}else{_0x1b87da[_0x8bec('0x3f')](_0x1b87da[_0x8bec('0x49')][_0x2676c0['id']],_0x2676c0);}}}return _0x1b87da[_0x8bec('0x49')];};};Realtime[_0x8bec('0x3e')][_0x8bec('0x4a')]=function(){var _0x21c224=this;return function(_0x3763e8){if(_0x3763e8){freeIsNotKey(_0x3763e8,_0x21c224[_0x8bec('0x1d')],'id');for(var _0x4d51f4=0x0,_0x55ea21={},_0x331250={};_0x4d51f4<_0x3763e8[_0x8bec('0x42')];_0x4d51f4+=0x1){_0x55ea21=_0x3763e8[_0x4d51f4];if(_[_0x8bec('0x44')](_0x21c224[_0x8bec('0x1d')][_0x55ea21['id']])){_0x21c224[_0x8bec('0x1d')][_0x55ea21['id']]=new ZendeskAccount(_0x55ea21);}else{_0x21c224[_0x8bec('0x3f')](_0x21c224[_0x8bec('0x1d')][_0x55ea21['id']],_0x55ea21);}}}return _0x21c224[_0x8bec('0x1d')];};};Realtime[_0x8bec('0x3e')][_0x8bec('0x4b')]=function(){var _0x36037d=this;return function(_0x5f017e){if(_0x5f017e){freeIsNotKey(_0x5f017e,_0x36037d[_0x8bec('0x1e')],'id');for(var _0x6fa6fd=0x0,_0x42f187={},_0x5d6e5b={};_0x6fa6fd<_0x5f017e[_0x8bec('0x42')];_0x6fa6fd+=0x1){_0x42f187=_0x5f017e[_0x6fa6fd];if(_[_0x8bec('0x44')](_0x36037d['salesforceAccounts'][_0x42f187['id']])){_0x36037d[_0x8bec('0x1e')][_0x42f187['id']]=new SalesforceAccount(_0x42f187);}else{_0x36037d[_0x8bec('0x3f')](_0x36037d[_0x8bec('0x1e')][_0x42f187['id']],_0x42f187);}}}return _0x36037d[_0x8bec('0x1e')];};};Realtime[_0x8bec('0x3e')]['initFreshdeskAccounts']=function(){var _0x3a10a8=this;return function(_0x596e53){if(_0x596e53){freeIsNotKey(_0x596e53,_0x3a10a8[_0x8bec('0x20')],'id');for(var _0x4ad34f=0x0,_0x20e826={},_0x439caa={};_0x4ad34f<_0x596e53[_0x8bec('0x42')];_0x4ad34f+=0x1){_0x20e826=_0x596e53[_0x4ad34f];if(_[_0x8bec('0x44')](_0x3a10a8[_0x8bec('0x20')][_0x20e826['id']])){_0x3a10a8[_0x8bec('0x20')][_0x20e826['id']]=new FreshdeskAccount(_0x20e826);}else{_0x3a10a8[_0x8bec('0x3f')](_0x3a10a8[_0x8bec('0x20')][_0x20e826['id']],_0x20e826);}}}return _0x3a10a8[_0x8bec('0x20')];};};Realtime[_0x8bec('0x3e')][_0x8bec('0x4c')]=function(){var _0x14d208=this;return function(_0x2c32af){if(_0x2c32af){freeIsNotKey(_0x2c32af,_0x14d208[_0x8bec('0x4d')],'id');for(var _0x178b41=0x0,_0x270705={},_0x8fcdea={};_0x178b41<_0x2c32af[_0x8bec('0x42')];_0x178b41+=0x1){_0x270705=_0x2c32af[_0x178b41];if(_[_0x8bec('0x44')](_0x14d208[_0x8bec('0x4d')][_0x270705['id']])){_0x14d208[_0x8bec('0x4d')][_0x270705['id']]=new ZohoAccount(_0x270705);}else{_0x14d208[_0x8bec('0x3f')](_0x14d208[_0x8bec('0x4d')][_0x270705['id']],_0x270705);}}}return _0x14d208[_0x8bec('0x4d')];};};Realtime[_0x8bec('0x3e')][_0x8bec('0x4e')]=function(){var _0x4fe4c8=this;return function(_0x34d11c){if(_0x34d11c){freeIsNotKey(_0x34d11c,_0x4fe4c8[_0x8bec('0x4f')],'id');for(var _0x544ca0=0x0,_0x3e8cd1={},_0x3164a6={};_0x544ca0<_0x34d11c[_0x8bec('0x42')];_0x544ca0+=0x1){_0x3e8cd1=_0x34d11c[_0x544ca0];if(_[_0x8bec('0x44')](_0x4fe4c8['deskAccounts'][_0x3e8cd1['id']])){_0x4fe4c8['deskAccounts'][_0x3e8cd1['id']]=new DeskAccount(_0x3e8cd1);}else{_0x4fe4c8['mergeFromDatabase'](_0x4fe4c8['deskAccounts'][_0x3e8cd1['id']],_0x3e8cd1);}}}return _0x4fe4c8[_0x8bec('0x4f')];};};Realtime[_0x8bec('0x3e')]['initSugarcrmAccounts']=function(){var _0x220f2b=this;return function(_0x36f955){if(_0x36f955){freeIsNotKey(_0x36f955,_0x220f2b['sugarcrmAccounts'],'id');for(var _0x3aab8e=0x0,_0x24ae63={},_0x435bc7={};_0x3aab8e<_0x36f955[_0x8bec('0x42')];_0x3aab8e+=0x1){_0x24ae63=_0x36f955[_0x3aab8e];if(_['isUndefined'](_0x220f2b[_0x8bec('0x1f')][_0x24ae63['id']])){_0x220f2b['sugarcrmAccounts'][_0x24ae63['id']]=new SugarcrmAccount(_0x24ae63);}else{_0x220f2b[_0x8bec('0x3f')](_0x220f2b[_0x8bec('0x1f')][_0x24ae63['id']],_0x24ae63);}}}return _0x220f2b['sugarcrmAccounts'];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x5a12f1=this;return function(_0x3ea8ac){if(_0x3ea8ac){freeIsNotKey(_0x3ea8ac,_0x5a12f1[_0x8bec('0x21')],'id');for(var _0x3fc2dd=0x0,_0x59c7a8={},_0x1eff8d={};_0x3fc2dd<_0x3ea8ac[_0x8bec('0x42')];_0x3fc2dd+=0x1){_0x59c7a8=_0x3ea8ac[_0x3fc2dd];if(_[_0x8bec('0x44')](_0x5a12f1[_0x8bec('0x21')][_0x59c7a8['id']])){_0x5a12f1[_0x8bec('0x21')][_0x59c7a8['id']]=new VtigerAccount(_0x59c7a8);}else{_0x5a12f1[_0x8bec('0x3f')](_0x5a12f1[_0x8bec('0x21')][_0x59c7a8['id']],_0x59c7a8);}}}return _0x5a12f1['vtigerAccounts'];};};Realtime[_0x8bec('0x3e')][_0x8bec('0x50')]=function(){var _0x34dd46=this;return function(_0x1eb68d){if(_0x1eb68d){freeIsNotKey(_0x1eb68d,_0x34dd46[_0x8bec('0x51')],'id');for(var _0x2693cd=0x0,_0x5e8044={},_0x4bc406={};_0x2693cd<_0x1eb68d[_0x8bec('0x42')];_0x2693cd+=0x1){_0x5e8044=_0x1eb68d[_0x2693cd];if(_[_0x8bec('0x44')](_0x34dd46[_0x8bec('0x51')][_0x5e8044['id']])){_0x34dd46[_0x8bec('0x51')][_0x5e8044['id']]=new ServicenowAccount(_0x5e8044);}else{_0x34dd46['mergeFromDatabase'](_0x34dd46['servicenowAccounts'][_0x5e8044['id']],_0x5e8044);}}}return _0x34dd46[_0x8bec('0x51')];};};Realtime[_0x8bec('0x3e')]['initDynamics365Accounts']=function(){var _0x48f8b2=this;return function(_0xbf4f97){if(_0xbf4f97){freeIsNotKey(_0xbf4f97,_0x48f8b2[_0x8bec('0x22')],'id');for(var _0x218248=0x0,_0x4f06b6={},_0x4cead9={};_0x218248<_0xbf4f97[_0x8bec('0x42')];_0x218248+=0x1){_0x4f06b6=_0xbf4f97[_0x218248];if(_[_0x8bec('0x44')](_0x48f8b2[_0x8bec('0x22')][_0x4f06b6['id']])){_0x48f8b2['dynamics365Accounts'][_0x4f06b6['id']]=new Dynamics365Account(_0x4f06b6);}else{_0x48f8b2[_0x8bec('0x3f')](_0x48f8b2[_0x8bec('0x22')][_0x4f06b6['id']],_0x4f06b6);}}}return _0x48f8b2[_0x8bec('0x22')];};};Realtime[_0x8bec('0x3e')]['initFreshsalesAccounts']=function(){var _0x10625a=this;return function(_0x1b17c2){if(_0x1b17c2){freeIsNotKey(_0x1b17c2,_0x10625a['freshsalesAccounts'],'id');for(var _0x555142=0x0,_0x4f18cc={},_0xa32b99={};_0x555142<_0x1b17c2[_0x8bec('0x42')];_0x555142+=0x1){_0x4f18cc=_0x1b17c2[_0x555142];if(_['isUndefined'](_0x10625a[_0x8bec('0x23')][_0x4f18cc['id']])){_0x10625a['freshsalesAccounts'][_0x4f18cc['id']]=new FreshsalesAccount(_0x4f18cc);}else{_0x10625a[_0x8bec('0x3f')](_0x10625a['freshsalesAccounts'][_0x4f18cc['id']],_0x4f18cc);}}}return _0x10625a[_0x8bec('0x23')];};};Realtime[_0x8bec('0x3e')]['initVoiceQueueHopperHistory']=function(){var _0x498b65=this;return function(_0x5528e2){for(var _0x25c36d=0x0;_0x25c36d<_0x5528e2[_0x8bec('0x42')];_0x25c36d+=0x1){_[_0x8bec('0x52')](_0x498b65[_0x8bec('0x46')][_0x5528e2[_0x25c36d][_0x8bec('0x26')]],_0x5528e2[_0x25c36d]);}return _0x498b65['voiceQueues'];};};Realtime[_0x8bec('0x3e')][_0x8bec('0x53')]=function(){var _0x2087d0=this;return function(_0x14a2e0){clearVoiceQueues(_0x2087d0[_0x8bec('0x46')]);if(_0x14a2e0){_0x14a2e0=_['groupBy'](_0x14a2e0,_0x8bec('0x54'));for(var _0x498a22 in _0x14a2e0){if(_0x14a2e0['hasOwnProperty'](_0x498a22)){var _0x349f57={};for(var _0x256536=0x0;_0x256536<_0x14a2e0[_0x498a22][_0x8bec('0x42')];_0x256536+=0x1){var _0x230337=_0x14a2e0[_0x498a22][_0x256536][_0x8bec('0x55')];if(_0x2087d0[_0x8bec('0x46')][_0x230337]){if(_0x14a2e0[_0x498a22][_0x256536]['queuecallerexit']){_0x2087d0[_0x8bec('0x46')][_0x230337][_0x8bec('0x30')]+=0x1;}if(_0x14a2e0[_0x498a22][_0x256536][_0x8bec('0x56')]){_0x2087d0[_0x8bec('0x46')][_0x230337][_0x8bec('0x31')]+=0x1;}_0x2087d0[_0x8bec('0x46')][_0x230337]['sumHoldTime']+=moment(_0x14a2e0[_0x498a22][_0x256536][_0x8bec('0x57')])[_0x8bec('0x58')](moment(_0x14a2e0[_0x498a22][_0x256536][_0x8bec('0x59')]),_0x8bec('0x5a'))||0x0;if(_0x256536===_0x14a2e0[_0x498a22]['length']-0x1){_0x2087d0[_0x8bec('0x46')][_0x230337][_0x8bec('0x2d')]+=moment(_0x14a2e0[_0x498a22][_0x256536]['queuecallercompleteAt']||_0x14a2e0[_0x498a22][_0x256536]['queuecallerabandonAt']||_0x14a2e0[_0x498a22][_0x256536][_0x8bec('0x5b')])[_0x8bec('0x58')](moment(_0x14a2e0[_0x498a22][_0x256536][_0x8bec('0x59')]),_0x8bec('0x5a'))||0x0;_0x2087d0[_0x8bec('0x46')][_0x230337][_0x8bec('0x2a')]+=0x1;if(_0x14a2e0[_0x498a22][_0x256536][_0x8bec('0x5c')]){_0x2087d0[_0x8bec('0x46')][_0x230337][_0x8bec('0x2b')]+=0x1;_0x2087d0['voiceQueues'][_0x230337][_0x8bec('0x2e')]+=moment(_0x14a2e0[_0x498a22][_0x256536][_0x8bec('0x5d')])[_0x8bec('0x58')](moment(_0x14a2e0[_0x498a22][_0x256536][_0x8bec('0x57')]),'seconds')||0x0;}}else{_0x2087d0['voiceQueues'][_0x230337][_0x8bec('0x2d')]+=_0x2087d0['voiceQueues'][_0x230337][_0x8bec('0x2c')]||0x0;}}}}}}return _0x2087d0['voiceQueues'];};};Realtime['prototype'][_0x8bec('0x5e')]=function(){var _0xdfc05b=this;return function(_0xdcc4bc){clearVoiceCallReports(_0xdfc05b[_0x8bec('0x5f')]);if(_0xdcc4bc){for(var _0x1a0e06=0x0;_0x1a0e06<_0xdcc4bc['length'];_0x1a0e06+=0x1){_0xdfc05b[_0x8bec('0x5f')][_0x8bec('0x2a')]+=0x1;_0xdfc05b[_0x8bec('0x5f')]['sumDuration']+=_0xdcc4bc[_0x1a0e06]['duration'];if(_0xdcc4bc[_0x1a0e06]['disposition']===_0x8bec('0x60')){_0xdfc05b[_0x8bec('0x5f')][_0x8bec('0x2b')]+=0x1;_0xdfc05b['outbound'][_0x8bec('0x2c')]+=_0xdcc4bc[_0x1a0e06][_0x8bec('0x61')]-_0xdcc4bc[_0x1a0e06][_0x8bec('0x62')]||0x0;_0xdfc05b['outbound'][_0x8bec('0x2e')]+=_0xdcc4bc[_0x1a0e06][_0x8bec('0x62')];}}}return _0xdfc05b[_0x8bec('0x5f')];};};Realtime['prototype'][_0x8bec('0x63')]=function(){var _0x5168fe=this;return function(_0x2fd279){if(_0x2fd279){freeIsNotKey(_0x2fd279,_0x5168fe[_0x8bec('0x64')],_0x8bec('0x26'));for(var _0x5e8110=0x0,_0x16a9ac={};_0x5e8110<_0x2fd279['length'];_0x5e8110+=0x1){_0x16a9ac=_0x2fd279[_0x5e8110];if(_[_0x8bec('0x44')](_0x5168fe['campaigns'][_0x16a9ac[_0x8bec('0x26')]])){_0x5168fe[_0x8bec('0x64')][_0x16a9ac['name']]=new Campaign(_0x16a9ac);}else{_0x5168fe['mergeFromDatabase'](_0x5168fe[_0x8bec('0x64')][_0x16a9ac[_0x8bec('0x26')]],_0x16a9ac);_0x5168fe[_0x8bec('0x64')][_0x16a9ac[_0x8bec('0x26')]][_0x8bec('0x65')]=_0x16a9ac[_0x8bec('0x66')]?_0x16a9ac['SquareProject'][_0x8bec('0x26')]:undefined;}}}return _0x5168fe[_0x8bec('0x64')];};};Realtime[_0x8bec('0x3e')][_0x8bec('0x67')]=function(){var _0x4e70d7=this;return function(_0x1c2513){if(_0x1c2513){freeIsNotKey(_0x1c2513,_0x4e70d7[_0x8bec('0x17')],'id');for(var _0xdd9e94=0x0,_0x1addb4={};_0xdd9e94<_0x1c2513[_0x8bec('0x42')];_0xdd9e94+=0x1){_0x1addb4=_0x1c2513[_0xdd9e94];if(_[_0x8bec('0x44')](_0x4e70d7[_0x8bec('0x17')][_0x1addb4['id']])){_0x4e70d7[_0x8bec('0x17')][_0x1addb4['id']]=new VoiceExtension(_0x1addb4);}else{_0x4e70d7['mergeFromDatabase'](_0x4e70d7[_0x8bec('0x17')][_0x1addb4['id']],_0x1addb4);}}}return _0x4e70d7[_0x8bec('0x17')];};};Realtime[_0x8bec('0x3e')][_0x8bec('0x68')]=function(){var _0x2b9504=this;return function(_0x18178e){clearCampaigns(_0x2b9504[_0x8bec('0x64')]);for(var _0x5ade2f=0x0;_0x5ade2f<_0x18178e['length'];_0x5ade2f+=0x1){_[_0x8bec('0x52')](_0x2b9504[_0x8bec('0x64')][_0x18178e[_0x5ade2f]['name']],_0x18178e[_0x5ade2f]);}return _0x2b9504[_0x8bec('0x64')];};};Realtime['prototype'][_0x8bec('0x69')]=function(){var _0x3ab316=this;return function(_0x24a51c){if(_0x24a51c){freeIsNotKey(_0x24a51c,_0x3ab316[_0x8bec('0x6a')],'id');for(var _0x571479=0x0,_0x1a85b2={},_0x47560f={};_0x571479<_0x24a51c[_0x8bec('0x42')];_0x571479+=0x1){_0x1a85b2=_0x24a51c[_0x571479];if(_[_0x8bec('0x44')](_0x3ab316[_0x8bec('0x6a')][_0x1a85b2['id']])){_0x3ab316[_0x8bec('0x6a')][_0x1a85b2['id']]=new FaxAccount(_0x1a85b2);}else{_0x3ab316[_0x8bec('0x3f')](_0x3ab316[_0x8bec('0x6a')][_0x1a85b2['id']],_0x1a85b2);}}}return _0x3ab316[_0x8bec('0x6a')];};};module['exports']=Realtime; \ No newline at end of file +var _0xab90=['salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','interface','name','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','isNil','initTrunks','isUndefined','initVoiceQueues','initTemplates','templates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','exports','util','lodash','moment','../model/agent','../model/telephone','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','queueChannels','timers','settings','zendeskAccounts'];(function(_0x3e5bc8,_0x457d89){var _0xfd84bc=function(_0x1a766c){while(--_0x1a766c){_0x3e5bc8['push'](_0x3e5bc8['shift']());}};_0xfd84bc(++_0x457d89);}(_0xab90,0x130));var _0x0ab9=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xab90[_0x199572];return _0x13cfa3;};'use strict';var BPromise=require('bluebird');var util=require(_0x0ab9('0x0'));var _=require(_0x0ab9('0x1'));var moment=require(_0x0ab9('0x2'));var Agent=require(_0x0ab9('0x3'));var Telephone=require(_0x0ab9('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x0ab9('0x5'));var Template=require(_0x0ab9('0x6'));var Campaign=require(_0x0ab9('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x0ab9('0x8'));var SalesforceAccount=require(_0x0ab9('0x9'));var FreshdeskAccount=require(_0x0ab9('0xa'));var SugarcrmAccount=require(_0x0ab9('0xb'));var ZohoAccount=require(_0x0ab9('0xc'));var DeskAccount=require(_0x0ab9('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x0ab9('0xe'));var FreshsalesAccount=require(_0x0ab9('0xf'));var FaxAccount=require(_0x0ab9('0x10'));var Realtime=function(){this['agents']={};this[_0x0ab9('0x11')]={};this[_0x0ab9('0x12')]={};this[_0x0ab9('0x13')]={};this[_0x0ab9('0x14')]={};this[_0x0ab9('0x15')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this[_0x0ab9('0x16')]={};this['outboundChannels']={};this[_0x0ab9('0x17')]={};this[_0x0ab9('0x18')]={};this[_0x0ab9('0x19')]={};this[_0x0ab9('0x1a')]={};this['sugarcrmAccounts']={};this[_0x0ab9('0x1b')]={};this[_0x0ab9('0x1c')]={};this[_0x0ab9('0x1d')]={};this[_0x0ab9('0x1e')]={};this['servicenowAccounts']={};this[_0x0ab9('0x1f')]={};this[_0x0ab9('0x20')]={};this[_0x0ab9('0x21')]={};};function freeIsNotKey(_0x3c80e7,_0x4f77b3,_0x3091f4){var _0x2da6f8=_[_0x0ab9('0x22')](_0x3c80e7,function(_0x250dab,_0x353bf7){return _0x250dab[_0x3091f4];});for(var _0x54843b in _0x4f77b3){if(_0x4f77b3[_0x0ab9('0x23')](_0x54843b)){if(!_0x2da6f8[_0x54843b]){delete _0x4f77b3[_0x54843b];}}}}function freeIsNotKeySip(_0x3a763f,_0x1fd22a){var _0x27d916=_['mapKeys'](_0x3a763f,function(_0xcf2c36,_0x4a4cfd){return util[_0x0ab9('0x24')](_0x0ab9('0x25'),_0xcf2c36['name']);});for(var _0x5ed3d0 in _0x1fd22a){if(_0x1fd22a[_0x0ab9('0x23')](_0x5ed3d0)){if(!_0x27d916[_0x5ed3d0]){delete _0x1fd22a[_0x5ed3d0];}}}}function freeIsNotKeyAgent(_0x5af962,_0x5907e0){var _0xb87d80=_[_0x0ab9('0x22')](_0x5af962,function(_0x5828f0,_0x996830){var _0x12e7f1=_['isNil'](_0x5828f0[_0x0ab9('0x26')])?util[_0x0ab9('0x24')]('SIP/%s',_0x5828f0[_0x0ab9('0x27')]):_0x5828f0[_0x0ab9('0x26')];return _0x12e7f1;});for(var _0x32925f in _0x5907e0){if(_0x5907e0['hasOwnProperty'](_0x32925f)){if(!_0xb87d80[_0x32925f]){delete _0x5907e0[_0x32925f];}}}}function clearVoiceCallReports(_0x22bd7b){_0x22bd7b[_0x0ab9('0x28')]=0x0;_0x22bd7b[_0x0ab9('0x29')]=0x0;_0x22bd7b[_0x0ab9('0x2a')]=0x0;_0x22bd7b[_0x0ab9('0x2b')]=0x0;_0x22bd7b['sumBillable']=0x0;}function clearCampaigns(_0x4ecc44){if(!_[_0x0ab9('0x2c')](_0x4ecc44)){for(var _0x35fbac in _0x4ecc44){if(_0x4ecc44[_0x0ab9('0x23')](_0x35fbac)){_0x4ecc44[_0x35fbac][_0x0ab9('0x2d')]=0x0;_0x4ecc44[_0x35fbac]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x40eb0d){if(!_['isEmpty'](_0x40eb0d)){for(var _0xb27b0b in _0x40eb0d){if(_0x40eb0d[_0x0ab9('0x23')](_0xb27b0b)){_0x40eb0d[_0xb27b0b]['total']=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x29')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x2e')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x2f')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x2a')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x2b')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x30')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x31')]=0x0;_0x40eb0d[_0xb27b0b]['outboundNoAnswerCallsDay']=0x0;_0x40eb0d[_0xb27b0b]['outboundBusyCallsDay']=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x32')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x33')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x34')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x35')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x36')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x37')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x38')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x39')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x3a')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x31')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x3b')]=0x0;_0x40eb0d[_0xb27b0b][_0x0ab9('0x3c')]=!![];}}}}Realtime[_0x0ab9('0x3d')][_0x0ab9('0x3e')]=function(_0x59f2e0,_0x28bbfe){for(var _0x42aa17 in _0x28bbfe){if(_0x59f2e0[_0x0ab9('0x23')](_0x42aa17)){_0x59f2e0[_0x42aa17]=_0x28bbfe[_0x42aa17];}}};Realtime['prototype'][_0x0ab9('0x3f')]=function(){var _0x32dccf=this;return function(_0x1e6a9f){if(_0x1e6a9f){freeIsNotKeyAgent(_0x1e6a9f,_0x32dccf[_0x0ab9('0x40')]);for(var _0x21cba8=0x0,_0x14ae72={},_0x695322={};_0x21cba8<_0x1e6a9f[_0x0ab9('0x41')];_0x21cba8+=0x1){_0x14ae72=_0x1e6a9f[_0x21cba8];var _0x49275c=_[_0x0ab9('0x42')](_0x14ae72[_0x0ab9('0x26')])?util[_0x0ab9('0x24')](_0x0ab9('0x25'),_0x14ae72['name']):_0x14ae72['interface'];if(_['isUndefined'](_0x32dccf['agents'][_0x49275c])){_0x32dccf[_0x0ab9('0x40')][_0x49275c]=new Agent(_0x14ae72);}else{_0x32dccf[_0x0ab9('0x3e')](_0x32dccf[_0x0ab9('0x40')][_0x49275c],_0x14ae72);}}}return _0x32dccf[_0x0ab9('0x40')];};};Realtime[_0x0ab9('0x3d')]['initTelephones']=function(){var _0x45c154=this;return function(_0x3bd723){if(_0x3bd723){freeIsNotKeySip(_0x3bd723,_0x45c154[_0x0ab9('0x11')]);for(var _0x42b935=0x0,_0x4b9640={},_0x5ad539={};_0x42b935<_0x3bd723[_0x0ab9('0x41')];_0x42b935+=0x1){_0x4b9640=_0x3bd723[_0x42b935];if(_['isUndefined'](_0x45c154[_0x0ab9('0x11')][util[_0x0ab9('0x24')](_0x0ab9('0x25'),_0x4b9640[_0x0ab9('0x27')])])){_0x45c154[_0x0ab9('0x11')][util['format'](_0x0ab9('0x25'),_0x4b9640[_0x0ab9('0x27')])]=new Telephone(_0x4b9640);}else{_0x45c154[_0x0ab9('0x3e')](_0x45c154[_0x0ab9('0x11')][util['format']('SIP/%s',_0x4b9640['name'])],_0x4b9640);}}}return _0x45c154[_0x0ab9('0x11')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x43')]=function(){var _0xca3601=this;return function(_0x4ec36f){if(_0x4ec36f){freeIsNotKeySip(_0x4ec36f,_0xca3601[_0x0ab9('0x12')]);for(var _0x3f37f2=0x0,_0x479b62={},_0x4ffa9f={};_0x3f37f2<_0x4ec36f['length'];_0x3f37f2+=0x1){_0x479b62=_0x4ec36f[_0x3f37f2];if(_[_0x0ab9('0x44')](_0xca3601[_0x0ab9('0x12')][util['format'](_0x0ab9('0x25'),_0x479b62[_0x0ab9('0x27')])])){_0xca3601[_0x0ab9('0x12')][util[_0x0ab9('0x24')](_0x0ab9('0x25'),_0x479b62['name'])]=new Trunk(_0x479b62);}else{_0xca3601['mergeFromDatabase'](_0xca3601[_0x0ab9('0x12')][util['format'](_0x0ab9('0x25'),_0x479b62[_0x0ab9('0x27')])],_0x479b62);}}}return _0xca3601[_0x0ab9('0x12')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x45')]=function(){var _0xe42525=this;return function(_0x1b9f58){if(_0x1b9f58){freeIsNotKey(_0x1b9f58,_0xe42525[_0x0ab9('0x13')],_0x0ab9('0x27'));for(var _0x557d45=0x0,_0x57f2ed={},_0x1b442c={};_0x557d45<_0x1b9f58['length'];_0x557d45+=0x1){_0x57f2ed=_0x1b9f58[_0x557d45];if(_[_0x0ab9('0x44')](_0xe42525[_0x0ab9('0x13')][_0x57f2ed[_0x0ab9('0x27')]])){_0xe42525['voiceQueues'][_0x57f2ed[_0x0ab9('0x27')]]=new VoiceQueue(_0x57f2ed);}else{_0xe42525['mergeFromDatabase'](_0xe42525[_0x0ab9('0x13')][_0x57f2ed[_0x0ab9('0x27')]],_0x57f2ed);}}}return _0xe42525[_0x0ab9('0x13')];};};Realtime['prototype']['initTriggers']=function(){var _0x2fde1e=this;return function(_0x501b51){if(_0x501b51){freeIsNotKey(_0x501b51,_0x2fde1e['triggers'],'id');for(var _0x34fce2=0x0,_0x354b0a={},_0x12180f={};_0x34fce2<_0x501b51['length'];_0x34fce2+=0x1){_0x354b0a=_0x501b51[_0x34fce2];if(_[_0x0ab9('0x44')](_0x2fde1e['triggers'][_0x354b0a['id']])){_0x2fde1e[_0x0ab9('0x14')][_0x354b0a['id']]=new Trigger(_0x354b0a);}else{_0x2fde1e['mergeFromDatabase'](_0x2fde1e[_0x0ab9('0x14')][_0x354b0a['id']],_0x354b0a);}}}return _0x2fde1e[_0x0ab9('0x14')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x46')]=function(){var _0x3e20fd=this;return function(_0x3390c8){if(_0x3390c8){freeIsNotKey(_0x3390c8,_0x3e20fd[_0x0ab9('0x47')],'id');for(var _0xbf5a77=0x0,_0x2226ad={},_0x1ec03b={};_0xbf5a77<_0x3390c8[_0x0ab9('0x41')];_0xbf5a77+=0x1){_0x2226ad=_0x3390c8[_0xbf5a77];if(_[_0x0ab9('0x44')](_0x3e20fd[_0x0ab9('0x47')][_0x2226ad['id']])){_0x3e20fd[_0x0ab9('0x47')][_0x2226ad['id']]=new Template(_0x2226ad);}else{_0x3e20fd[_0x0ab9('0x3e')](_0x3e20fd[_0x0ab9('0x47')][_0x2226ad['id']],_0x2226ad);}}}return _0x3e20fd[_0x0ab9('0x47')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x48')]=function(){var _0x35e622=this;return function(_0x179e47){if(_0x179e47){freeIsNotKey(_0x179e47,_0x35e622['zendeskAccounts'],'id');for(var _0x4ec54d=0x0,_0x2bba61={},_0x52dc22={};_0x4ec54d<_0x179e47[_0x0ab9('0x41')];_0x4ec54d+=0x1){_0x2bba61=_0x179e47[_0x4ec54d];if(_[_0x0ab9('0x44')](_0x35e622[_0x0ab9('0x19')][_0x2bba61['id']])){_0x35e622[_0x0ab9('0x19')][_0x2bba61['id']]=new ZendeskAccount(_0x2bba61);}else{_0x35e622[_0x0ab9('0x3e')](_0x35e622['zendeskAccounts'][_0x2bba61['id']],_0x2bba61);}}}return _0x35e622['zendeskAccounts'];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x3c44fb=this;return function(_0x4c510d){if(_0x4c510d){freeIsNotKey(_0x4c510d,_0x3c44fb[_0x0ab9('0x1a')],'id');for(var _0x446f7c=0x0,_0x102d71={},_0xc57098={};_0x446f7c<_0x4c510d['length'];_0x446f7c+=0x1){_0x102d71=_0x4c510d[_0x446f7c];if(_[_0x0ab9('0x44')](_0x3c44fb['salesforceAccounts'][_0x102d71['id']])){_0x3c44fb['salesforceAccounts'][_0x102d71['id']]=new SalesforceAccount(_0x102d71);}else{_0x3c44fb[_0x0ab9('0x3e')](_0x3c44fb['salesforceAccounts'][_0x102d71['id']],_0x102d71);}}}return _0x3c44fb[_0x0ab9('0x1a')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x49')]=function(){var _0x29b23a=this;return function(_0xab74a){if(_0xab74a){freeIsNotKey(_0xab74a,_0x29b23a['freshdeskAccounts'],'id');for(var _0x41e323=0x0,_0x1d94a6={},_0x95262e={};_0x41e323<_0xab74a[_0x0ab9('0x41')];_0x41e323+=0x1){_0x1d94a6=_0xab74a[_0x41e323];if(_[_0x0ab9('0x44')](_0x29b23a[_0x0ab9('0x1b')][_0x1d94a6['id']])){_0x29b23a[_0x0ab9('0x1b')][_0x1d94a6['id']]=new FreshdeskAccount(_0x1d94a6);}else{_0x29b23a[_0x0ab9('0x3e')](_0x29b23a[_0x0ab9('0x1b')][_0x1d94a6['id']],_0x1d94a6);}}}return _0x29b23a['freshdeskAccounts'];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x4a')]=function(){var _0x362739=this;return function(_0x49c6f1){if(_0x49c6f1){freeIsNotKey(_0x49c6f1,_0x362739[_0x0ab9('0x1c')],'id');for(var _0x146f99=0x0,_0x114b7d={},_0x13742f={};_0x146f99<_0x49c6f1[_0x0ab9('0x41')];_0x146f99+=0x1){_0x114b7d=_0x49c6f1[_0x146f99];if(_[_0x0ab9('0x44')](_0x362739[_0x0ab9('0x1c')][_0x114b7d['id']])){_0x362739[_0x0ab9('0x1c')][_0x114b7d['id']]=new ZohoAccount(_0x114b7d);}else{_0x362739['mergeFromDatabase'](_0x362739[_0x0ab9('0x1c')][_0x114b7d['id']],_0x114b7d);}}}return _0x362739[_0x0ab9('0x1c')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x4b')]=function(){var _0x2233ad=this;return function(_0xe29d89){if(_0xe29d89){freeIsNotKey(_0xe29d89,_0x2233ad['deskAccounts'],'id');for(var _0x30a76e=0x0,_0x200d46={},_0x2dfc79={};_0x30a76e<_0xe29d89['length'];_0x30a76e+=0x1){_0x200d46=_0xe29d89[_0x30a76e];if(_[_0x0ab9('0x44')](_0x2233ad[_0x0ab9('0x1d')][_0x200d46['id']])){_0x2233ad['deskAccounts'][_0x200d46['id']]=new DeskAccount(_0x200d46);}else{_0x2233ad[_0x0ab9('0x3e')](_0x2233ad[_0x0ab9('0x1d')][_0x200d46['id']],_0x200d46);}}}return _0x2233ad[_0x0ab9('0x1d')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x4c')]=function(){var _0x44c1b1=this;return function(_0x20e03e){if(_0x20e03e){freeIsNotKey(_0x20e03e,_0x44c1b1[_0x0ab9('0x4d')],'id');for(var _0x32927b=0x0,_0x590bd3={},_0x1cb75a={};_0x32927b<_0x20e03e[_0x0ab9('0x41')];_0x32927b+=0x1){_0x590bd3=_0x20e03e[_0x32927b];if(_[_0x0ab9('0x44')](_0x44c1b1[_0x0ab9('0x4d')][_0x590bd3['id']])){_0x44c1b1[_0x0ab9('0x4d')][_0x590bd3['id']]=new SugarcrmAccount(_0x590bd3);}else{_0x44c1b1[_0x0ab9('0x3e')](_0x44c1b1[_0x0ab9('0x4d')][_0x590bd3['id']],_0x590bd3);}}}return _0x44c1b1['sugarcrmAccounts'];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x4e')]=function(){var _0x5b38b6=this;return function(_0x57dd9e){if(_0x57dd9e){freeIsNotKey(_0x57dd9e,_0x5b38b6[_0x0ab9('0x1e')],'id');for(var _0x103a45=0x0,_0x334801={},_0x4fdd67={};_0x103a45<_0x57dd9e[_0x0ab9('0x41')];_0x103a45+=0x1){_0x334801=_0x57dd9e[_0x103a45];if(_[_0x0ab9('0x44')](_0x5b38b6[_0x0ab9('0x1e')][_0x334801['id']])){_0x5b38b6['vtigerAccounts'][_0x334801['id']]=new VtigerAccount(_0x334801);}else{_0x5b38b6[_0x0ab9('0x3e')](_0x5b38b6[_0x0ab9('0x1e')][_0x334801['id']],_0x334801);}}}return _0x5b38b6[_0x0ab9('0x1e')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x4f')]=function(){var _0x493803=this;return function(_0x1fb816){if(_0x1fb816){freeIsNotKey(_0x1fb816,_0x493803[_0x0ab9('0x50')],'id');for(var _0x3255f6=0x0,_0x3261f4={},_0x3d8f5f={};_0x3255f6<_0x1fb816[_0x0ab9('0x41')];_0x3255f6+=0x1){_0x3261f4=_0x1fb816[_0x3255f6];if(_[_0x0ab9('0x44')](_0x493803['servicenowAccounts'][_0x3261f4['id']])){_0x493803[_0x0ab9('0x50')][_0x3261f4['id']]=new ServicenowAccount(_0x3261f4);}else{_0x493803[_0x0ab9('0x3e')](_0x493803[_0x0ab9('0x50')][_0x3261f4['id']],_0x3261f4);}}}return _0x493803[_0x0ab9('0x50')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x51')]=function(){var _0x1954ac=this;return function(_0x4387d7){if(_0x4387d7){freeIsNotKey(_0x4387d7,_0x1954ac[_0x0ab9('0x1f')],'id');for(var _0x59948e=0x0,_0x279f29={},_0x36a926={};_0x59948e<_0x4387d7[_0x0ab9('0x41')];_0x59948e+=0x1){_0x279f29=_0x4387d7[_0x59948e];if(_['isUndefined'](_0x1954ac[_0x0ab9('0x1f')][_0x279f29['id']])){_0x1954ac[_0x0ab9('0x1f')][_0x279f29['id']]=new Dynamics365Account(_0x279f29);}else{_0x1954ac['mergeFromDatabase'](_0x1954ac[_0x0ab9('0x1f')][_0x279f29['id']],_0x279f29);}}}return _0x1954ac[_0x0ab9('0x1f')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x52')]=function(){var _0x246ca7=this;return function(_0x3b6356){if(_0x3b6356){freeIsNotKey(_0x3b6356,_0x246ca7['freshsalesAccounts'],'id');for(var _0x52575e=0x0,_0x4b3053={},_0xb4fcd0={};_0x52575e<_0x3b6356[_0x0ab9('0x41')];_0x52575e+=0x1){_0x4b3053=_0x3b6356[_0x52575e];if(_[_0x0ab9('0x44')](_0x246ca7[_0x0ab9('0x20')][_0x4b3053['id']])){_0x246ca7['freshsalesAccounts'][_0x4b3053['id']]=new FreshsalesAccount(_0x4b3053);}else{_0x246ca7[_0x0ab9('0x3e')](_0x246ca7[_0x0ab9('0x20')][_0x4b3053['id']],_0x4b3053);}}}return _0x246ca7[_0x0ab9('0x20')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x53')]=function(){var _0xf494a7=this;return function(_0x533fda){for(var _0x3edf6e=0x0;_0x3edf6e<_0x533fda[_0x0ab9('0x41')];_0x3edf6e+=0x1){_[_0x0ab9('0x54')](_0xf494a7[_0x0ab9('0x13')][_0x533fda[_0x3edf6e][_0x0ab9('0x27')]],_0x533fda[_0x3edf6e]);}return _0xf494a7[_0x0ab9('0x13')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x55')]=function(){var _0xe0ce7b=this;return function(_0x4b09bb){clearVoiceQueues(_0xe0ce7b[_0x0ab9('0x13')]);if(_0x4b09bb){_0x4b09bb=_['groupBy'](_0x4b09bb,_0x0ab9('0x56'));for(var _0x5c5076 in _0x4b09bb){if(_0x4b09bb[_0x0ab9('0x23')](_0x5c5076)){var _0x53f11d={};for(var _0x148378=0x0;_0x148378<_0x4b09bb[_0x5c5076][_0x0ab9('0x41')];_0x148378+=0x1){var _0x4d3c8c=_0x4b09bb[_0x5c5076][_0x148378][_0x0ab9('0x57')];if(_0xe0ce7b[_0x0ab9('0x13')][_0x4d3c8c]){if(_0x4b09bb[_0x5c5076][_0x148378][_0x0ab9('0x58')]){_0xe0ce7b[_0x0ab9('0x13')][_0x4d3c8c][_0x0ab9('0x2e')]+=0x1;}if(_0x4b09bb[_0x5c5076][_0x148378]['queuecallerabandon']){_0xe0ce7b[_0x0ab9('0x13')][_0x4d3c8c][_0x0ab9('0x2f')]+=0x1;}_0xe0ce7b['voiceQueues'][_0x4d3c8c][_0x0ab9('0x2a')]+=moment(_0x4b09bb[_0x5c5076][_0x148378][_0x0ab9('0x59')])['diff'](moment(_0x4b09bb[_0x5c5076][_0x148378][_0x0ab9('0x5a')]),_0x0ab9('0x5b'))||0x0;if(_0x148378===_0x4b09bb[_0x5c5076][_0x0ab9('0x41')]-0x1){_0xe0ce7b[_0x0ab9('0x13')][_0x4d3c8c]['sumDuration']+=moment(_0x4b09bb[_0x5c5076][_0x148378][_0x0ab9('0x5c')]||_0x4b09bb[_0x5c5076][_0x148378][_0x0ab9('0x5d')]||_0x4b09bb[_0x5c5076][_0x148378][_0x0ab9('0x5e')])[_0x0ab9('0x5f')](moment(_0x4b09bb[_0x5c5076][_0x148378][_0x0ab9('0x5a')]),'seconds')||0x0;_0xe0ce7b[_0x0ab9('0x13')][_0x4d3c8c][_0x0ab9('0x28')]+=0x1;if(_0x4b09bb[_0x5c5076][_0x148378][_0x0ab9('0x60')]){_0xe0ce7b[_0x0ab9('0x13')][_0x4d3c8c][_0x0ab9('0x29')]+=0x1;_0xe0ce7b[_0x0ab9('0x13')][_0x4d3c8c][_0x0ab9('0x30')]+=moment(_0x4b09bb[_0x5c5076][_0x148378]['queuecallercompleteAt'])[_0x0ab9('0x5f')](moment(_0x4b09bb[_0x5c5076][_0x148378][_0x0ab9('0x59')]),_0x0ab9('0x5b'))||0x0;}}else{_0xe0ce7b[_0x0ab9('0x13')][_0x4d3c8c][_0x0ab9('0x2b')]+=_0xe0ce7b[_0x0ab9('0x13')][_0x4d3c8c]['sumHoldTime']||0x0;}}}}}}return _0xe0ce7b['voiceQueues'];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x61')]=function(){var _0x1feb4d=this;return function(_0x33229e){clearVoiceCallReports(_0x1feb4d[_0x0ab9('0x62')]);if(_0x33229e){for(var _0x28769c=0x0;_0x28769c<_0x33229e['length'];_0x28769c+=0x1){_0x1feb4d[_0x0ab9('0x62')][_0x0ab9('0x28')]+=0x1;_0x1feb4d[_0x0ab9('0x62')][_0x0ab9('0x2b')]+=_0x33229e[_0x28769c][_0x0ab9('0x63')];if(_0x33229e[_0x28769c][_0x0ab9('0x64')]===_0x0ab9('0x65')){_0x1feb4d[_0x0ab9('0x62')][_0x0ab9('0x29')]+=0x1;_0x1feb4d[_0x0ab9('0x62')][_0x0ab9('0x2a')]+=_0x33229e[_0x28769c][_0x0ab9('0x63')]-_0x33229e[_0x28769c][_0x0ab9('0x66')]||0x0;_0x1feb4d[_0x0ab9('0x62')][_0x0ab9('0x30')]+=_0x33229e[_0x28769c]['billableseconds'];}}}return _0x1feb4d[_0x0ab9('0x62')];};};Realtime[_0x0ab9('0x3d')][_0x0ab9('0x67')]=function(){var _0x5d1412=this;return function(_0x2c2d90){if(_0x2c2d90){freeIsNotKey(_0x2c2d90,_0x5d1412[_0x0ab9('0x15')],_0x0ab9('0x27'));for(var _0x37049f=0x0,_0x568132={};_0x37049f<_0x2c2d90['length'];_0x37049f+=0x1){_0x568132=_0x2c2d90[_0x37049f];if(_[_0x0ab9('0x44')](_0x5d1412[_0x0ab9('0x15')][_0x568132[_0x0ab9('0x27')]])){_0x5d1412[_0x0ab9('0x15')][_0x568132[_0x0ab9('0x27')]]=new Campaign(_0x568132);}else{_0x5d1412[_0x0ab9('0x3e')](_0x5d1412['campaigns'][_0x568132[_0x0ab9('0x27')]],_0x568132);_0x5d1412[_0x0ab9('0x15')][_0x568132[_0x0ab9('0x27')]][_0x0ab9('0x68')]=_0x568132[_0x0ab9('0x69')]?_0x568132[_0x0ab9('0x69')]['name']:undefined;}}}return _0x5d1412[_0x0ab9('0x15')];};};Realtime['prototype'][_0x0ab9('0x6a')]=function(){var _0x12260e=this;return function(_0x2d30ee){if(_0x2d30ee){freeIsNotKey(_0x2d30ee,_0x12260e[_0x0ab9('0x6b')],'id');for(var _0x2385e8=0x0,_0x33ec6c={};_0x2385e8<_0x2d30ee['length'];_0x2385e8+=0x1){_0x33ec6c=_0x2d30ee[_0x2385e8];if(_[_0x0ab9('0x44')](_0x12260e[_0x0ab9('0x6b')][_0x33ec6c['id']])){_0x12260e['voiceExtensions'][_0x33ec6c['id']]=new VoiceExtension(_0x33ec6c);}else{_0x12260e[_0x0ab9('0x3e')](_0x12260e[_0x0ab9('0x6b')][_0x33ec6c['id']],_0x33ec6c);}}}return _0x12260e[_0x0ab9('0x6b')];};};Realtime['prototype'][_0x0ab9('0x6c')]=function(){var _0x360b02=this;return function(_0x3ab708){clearCampaigns(_0x360b02[_0x0ab9('0x15')]);for(var _0x251003=0x0;_0x251003<_0x3ab708[_0x0ab9('0x41')];_0x251003+=0x1){_[_0x0ab9('0x54')](_0x360b02[_0x0ab9('0x15')][_0x3ab708[_0x251003]['name']],_0x3ab708[_0x251003]);}return _0x360b02[_0x0ab9('0x15')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x483e10=this;return function(_0x2186e7){if(_0x2186e7){freeIsNotKey(_0x2186e7,_0x483e10['faxAccounts'],'id');for(var _0x3a4bcb=0x0,_0x3f9272={},_0x429b92={};_0x3a4bcb<_0x2186e7[_0x0ab9('0x41')];_0x3a4bcb+=0x1){_0x3f9272=_0x2186e7[_0x3a4bcb];if(_[_0x0ab9('0x44')](_0x483e10[_0x0ab9('0x21')][_0x3f9272['id']])){_0x483e10[_0x0ab9('0x21')][_0x3f9272['id']]=new FaxAccount(_0x3f9272);}else{_0x483e10[_0x0ab9('0x3e')](_0x483e10[_0x0ab9('0x21')][_0x3f9272['id']],_0x3f9272);}}}return _0x483e10['faxAccounts'];};};module[_0x0ab9('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 1ab24dd..2b2f0a3 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 _0x6e3a=['../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','interface','format','SIP/%s','connectedlinenum','assigned','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','getAgentByInternal','length','keys','getCallType','channel','split','calleridnum','internal','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','UserId','membername','create','monitor','monitors','filename','createdAt','connectedlinename','originatecalleridnum','xcally-motion-dialer','forEach','startsWith','indexOf','mobile','substring','lastIndexOf','transfererlinkedid','lodash','moment','../../../config/environment','../rpc/voiceAgentReport'];(function(_0x11df20,_0x55960b){var _0x25693c=function(_0x5dde77){while(--_0x5dde77){_0x11df20['push'](_0x11df20['shift']());}};_0x25693c(++_0x55960b);}(_0x6e3a,0x1c8));var _0xa6e3=function(_0x3714a0,_0x3775e4){_0x3714a0=_0x3714a0-0x0;var _0x430d52=_0x6e3a[_0x3714a0];return _0x430d52;};'use strict';var _=require(_0xa6e3('0x0'));var moment=require(_0xa6e3('0x1'));var util=require('util');var config=require(_0xa6e3('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xa6e3('0x3'));var RpcVoiceCallReport=require(_0xa6e3('0x4'));var RpcVoiceDialReport=require(_0xa6e3('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xa6e3('0x6'));var RpcVoiceRecording=require(_0xa6e3('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xa6e3('0x8'));var VoiceCallReport=require(_0xa6e3('0x9'));var VoiceAgentReport=require(_0xa6e3('0xa'));var VoiceDialReport=require(_0xa6e3('0xb'));var UserReport=require(_0xa6e3('0xc'));function Report(_0x4ad93d){this[_0xa6e3('0xd')]=_0x4ad93d;this[_0xa6e3('0xe')]=_0x4ad93d[_0xa6e3('0xe')];this[_0xa6e3('0xf')]=_0x4ad93d[_0xa6e3('0xf')];}Report[_0xa6e3('0x10')][_0xa6e3('0x11')]=function(_0x2affb4){var _0xcfee17=new VoiceQueueReport(this[_0xa6e3('0xd')]);var _0x505920=new VoiceAgentReport(this[_0xa6e3('0xd')]);var _0x4ebe4a=new VoiceDialReport(this['realtime']);var _0x6dc128=new VoiceCallReport(this[_0xa6e3('0xd')]);var _0x16f0ee=new UserReport(this[_0xa6e3('0xd')]);if(config[_0xa6e3('0x12')]&&config[_0xa6e3('0x12')][_0xa6e3('0x13')]){ami['on'](_0xa6e3('0x14'),this[_0xa6e3('0x15')][_0xa6e3('0x16')](this));ami['on'](_0xa6e3('0x17'),this[_0xa6e3('0x18')][_0xa6e3('0x16')](this));ami['on'](_0xa6e3('0x19'),this['voiceAgentReport'][_0xa6e3('0x16')](this));ami['on'](_0xa6e3('0x1a'),this[_0xa6e3('0x1b')][_0xa6e3('0x16')](this));ami['on'](_0xa6e3('0x1c'),this[_0xa6e3('0x1d')][_0xa6e3('0x16')](this));ami['on'](_0xa6e3('0x1e'),this[_0xa6e3('0x1f')][_0xa6e3('0x16')](this));}};Report[_0xa6e3('0x10')][_0xa6e3('0x20')]=function(_0x58f6b6){var _0x3faa8d;_0x3faa8d=_['find'](this['agents'],function(_0x29a630){return _0x29a630[_0xa6e3('0x21')]==_0x58f6b6||_0x29a630[_0xa6e3('0x22')]==_0x58f6b6;});if(_[_0xa6e3('0x23')](_0x3faa8d)){var _0x5321cf=_['find'](this[_0xa6e3('0xf')],function(_0x1ff2a5){return _0x1ff2a5[_0xa6e3('0x21')]==_0x58f6b6||_0x1ff2a5[_0xa6e3('0x22')]==_0x58f6b6;});if(_0x5321cf){_0x3faa8d=_[_0xa6e3('0x24')](this[_0xa6e3('0xe')],function(_0x2cf56f){return _0x2cf56f[_0xa6e3('0x25')]==util[_0xa6e3('0x26')](_0xa6e3('0x27'),_0x5321cf['name']);});}}return _0x3faa8d;};Report[_0xa6e3('0x10')][_0xa6e3('0x15')]=function(_0x359b70){for(var _0x1db1f5=0x0;_0x1db1f5<_0x359b70['length'];_0x1db1f5+=0x1){var _0x5cc27c=this[_0xa6e3('0x20')](_0x359b70[_0x1db1f5][_0xa6e3('0x28')]);if(_0x5cc27c){_0x359b70[_0x1db1f5][_0xa6e3('0x21')]=_0x5cc27c[_0xa6e3('0x21')];_0x359b70[_0x1db1f5][_0xa6e3('0x29')]=!![];_0x359b70[_0x1db1f5]['lastAssignedTo']=_0x5cc27c[_0xa6e3('0x22')];_0x359b70[_0x1db1f5]['interface']=_[_0xa6e3('0x23')](_0x5cc27c[_0xa6e3('0x25')])?util['format'](_0xa6e3('0x27'),_0x5cc27c[_0xa6e3('0x22')]):_0x5cc27c[_0xa6e3('0x25')];if(_0x359b70[_0x1db1f5][_0xa6e3('0x2a')]){_0x359b70[_0x1db1f5]['queuecallercompleteAt']=moment()[_0xa6e3('0x26')](_0xa6e3('0x2b'));}if(_0x359b70[_0x1db1f5][_0xa6e3('0x2c')]){_0x359b70[_0x1db1f5][_0xa6e3('0x2d')]=moment()[_0xa6e3('0x26')](_0xa6e3('0x2b'));}RpcMemberReport[_0xa6e3('0x15')](_0x359b70[_0x1db1f5]);}RpcVoiceQueueReport['create'](_0x359b70[_0x1db1f5]);}};function extractCalleridNumber(_0x38059b){var _0x22864d=_0x38059b[_0xa6e3('0x2e')](/<(.*?)>/);return _0x22864d?_0x22864d[0x1]:_0x38059b;}Report[_0xa6e3('0x10')][_0xa6e3('0x2f')]=function(_0x5b0748){for(var _0x281f02=0x0;_0x281f02/);return _0x3839e1?_0x3839e1[0x1]:_0x496f5d;}Report['prototype'][_0x1b50('0x2b')]=function(_0x4fae3f){for(var _0x358691=0x0;_0x358691',_0x26b221[_0x1b50('0x43')],_0x26b221[_0x1b50('0x2f')]);}if(RpcVoiceTransferReport[_0x1b50('0x44')][_0x26b221['linkedid']]){var _0x4bc398=RpcVoiceTransferReport[_0x1b50('0x44')][_0x26b221[_0x1b50('0x45')]];_0x4bc398['transfereelinkedid']=_0x26b221[_0x1b50('0x46')];RpcVoiceTransferReport[_0x1b50('0x1a')](_0x4bc398);delete RpcVoiceTransferReport[_0x1b50('0x44')][_0x26b221[_0x1b50('0x45')]];}if(_['isNil'](_0x26b221[_0x1b50('0x35')])){_0x26b221['type']=this[_0x1b50('0x2d')](_0x26b221);}if(_[_0x1b50('0x20')](_0x26b221['UserId'])){var _0x21be72=_0x26b221[_0x1b50('0x3f')]['split']('-')[0x0];var _0x2a0106=this[_0x1b50('0xc')][_0x21be72];if(!_0x2a0106)_0x2a0106=this['getAgentByInternal'](_0x26b221[_0x1b50('0x1e')]);if(_0x2a0106){_0x26b221[_0x1b50('0x47')]=_0x2a0106['id'];_0x26b221[_0x1b50('0x48')]=_0x2a0106[_0x1b50('0x1f')];}}RpcVoiceCallReport[_0x1b50('0x2a')](_0x26b221);if(_0x26b221[_0x1b50('0x49')]){for(var _0x2c4593=0x0;_0x2c4593<_0x26b221[_0x1b50('0x4a')][_0x1b50('0x24')];_0x2c4593+=0x1){_0x26b221[_0x1b50('0x4b')]=_0x26b221[_0x1b50('0x4a')][_0x2c4593][_0x1b50('0x4c')];_0x26b221[_0x1b50('0x4d')]=_0x26b221['monitors'][_0x2c4593][_0x1b50('0x4d')];if(_0x26b221[_0x1b50('0x34')]=='xcally-motion-preview'){_0x26b221['calleridnum']=_0x26b221[_0x1b50('0x25')];_0x26b221[_0x1b50('0x43')]=_0x26b221[_0x1b50('0x4e')];_0x26b221['connectedlinenum']=_0x26b221[_0x1b50('0x1e')];_0x26b221[_0x1b50('0x4e')]=_0x26b221[_0x1b50('0x48')];_0x26b221[_0x1b50('0x34')]=_0x26b221['originatecalleridnum'];}else if(_0x26b221[_0x1b50('0x34')]==_0x1b50('0x4f')){_0x26b221['calleridnum']=_0x26b221[_0x1b50('0x33')];_0x26b221[_0x1b50('0x34')]=_0x26b221['originatecalleridnum'];}RpcVoiceRecording[_0x1b50('0x2a')](_0x26b221);}}};Report[_0x1b50('0xe')]['voiceAgentReport']=function(_0x33d607){if(_[_0x1b50('0x50')](_0x33d607)){_0x33d607[_0x1b50('0x51')](function(_0x58cda5){RpcVoiceAgentReport[_0x1b50('0x2a')](_0x58cda5);});}else{RpcVoiceAgentReport['create'](_0x33d607);}};Report[_0x1b50('0xe')][_0x1b50('0x18')]=function(_0x2bb09b){RpcVoiceDialReport[_0x1b50('0x2a')](_0x2bb09b);var _0x3edc87;var _0x265d18;var _0x2f6b8f=_0x2bb09b['channel'];if(_[_0x1b50('0x52')](_0x2f6b8f,_0x1b50('0x53'))){_0x265d18=_0x2f6b8f[_0x1b50('0x54')](_0x2f6b8f[_0x1b50('0x55')]('/')+0x1,_0x2f6b8f[_0x1b50('0x55')]('@'));_0x3edc87=_['find'](this[_0x1b50('0xc')],function(_0x34309f){return _0x34309f['mobile']==_0x265d18||_0x34309f[_0x1b50('0x56')]==_0x265d18||_0x34309f[_0x1b50('0x1e')]==_0x265d18;});}else{_0x265d18=_0x2f6b8f[_0x1b50('0x54')](_0x2f6b8f['indexOf']('/')+0x1,_0x2f6b8f[_0x1b50('0x57')]('-'));_0x3edc87=this['findAgent'](_0x265d18);}if(_0x3edc87){_0x2bb09b[_0x1b50('0x21')]=_[_0x1b50('0x20')](_0x3edc87['interface'])?util[_0x1b50('0x22')](_0x1b50('0x23'),_0x3edc87[_0x1b50('0x1f')]):_0x3edc87['interface'];_0x2bb09b[_0x1b50('0x48')]=_0x3edc87[_0x1b50('0x1f')];_0x2bb09b['accountcode']=_0x3edc87[_0x1b50('0x1e')];RpcMemberReport[_0x1b50('0x18')](_0x2bb09b);}};Report[_0x1b50('0xe')][_0x1b50('0x1a')]=function(_0x16ef5f){RpcVoiceTransferReport['transfers'][_0x16ef5f[_0x1b50('0x58')]]=_0x16ef5f;};Report[_0x1b50('0xe')][_0x1b50('0x1b')]=function(_0x90bf42){RpcVoiceTransferReport[_0x1b50('0x1b')](_0x90bf42);};module[_0x1b50('0x59')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 168cbf6..7317208 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd70a=['device','[userReport][devicestatechange]','local','toLowerCase','stateTime','updateStatusRealtime','telephone:%s','telephone:save','debug','Local','indexOf','mobile','phone','accountcode','toNumber','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','status','trunk:%s','lodash','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','registry','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s'];(function(_0x40dd0e,_0xec146b){var _0x2d1280=function(_0xd02e0c){while(--_0xd02e0c){_0x40dd0e['push'](_0x40dd0e['shift']());}};_0x2d1280(++_0xec146b);}(_0xd70a,0x1ce));var _0xad70=function(_0x1c0f41,_0x26d95d){_0x1c0f41=_0x1c0f41-0x0;var _0x369a9f=_0xd70a[_0x1c0f41];return _0x369a9f;};'use strict';var _=require(_0xad70('0x0'));var moment=require('moment');var util=require(_0xad70('0x1'));var Redis=require(_0xad70('0x2'));var BPromise=require(_0xad70('0x3'));var config=require(_0xad70('0x4'));var logger=require(_0xad70('0x5'))(_0xad70('0x6'));var ami=require(_0xad70('0x7'));config[_0xad70('0x8')]=_[_0xad70('0x9')](config[_0xad70('0x8')],{'host':_0xad70('0xa'),'port':0x18eb});var io=require(_0xad70('0xb'))(new Redis(config[_0xad70('0x8')]));function UserReport(_0x1462da){this['trunks']=_0x1462da[_0xad70('0xc')];this[_0xad70('0xd')]=_0x1462da[_0xad70('0xd')];this[_0xad70('0xe')]=_0x1462da[_0xad70('0xe')];ami['on']('registryentry',this[_0xad70('0xf')][_0xad70('0x10')](this));ami['on'](_0xad70('0x11'),this[_0xad70('0xf')][_0xad70('0x10')](this));ami['on']('devicestatechange',this[_0xad70('0x12')][_0xad70('0x10')](this));ami['on']('peerstatus',this[_0xad70('0x13')][_0xad70('0x10')](this));return this[_0xad70('0x14')]();}function showSipRegistrations(){Promise[_0xad70('0x15')]()[_0xad70('0x16')](ami[_0xad70('0x17')]())[_0xad70('0x18')](function(_0x5513af){logger[_0xad70('0x19')](_0xad70('0x1a'),util[_0xad70('0x1b')](_0x5513af,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xad70('0x15')]()[_0xad70('0x16')](ami[_0xad70('0x1c')]())[_0xad70('0x18')](function(_0x2694eb){logger[_0xad70('0x19')]('[userReport][devicestatelist]',util[_0xad70('0x1b')](_0x2694eb,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xad70('0x15')]()['then'](ami['actionSipPeerStatus']())[_0xad70('0x18')](function(_0x53396d){logger['error']('[userReport][sippeerstatus]',util[_0xad70('0x1b')](_0x53396d,{'showHidden':![],'depth':null}));});}UserReport[_0xad70('0x1d')][_0xad70('0x14')]=function(){setInterval(function(){BPromise[_0xad70('0x15')]()[_0xad70('0x16')](showSipRegistrations())[_0xad70('0x16')](listDeviceStates())[_0xad70('0x16')](showPeersStatus());},0x32c8);};UserReport[_0xad70('0x1d')][_0xad70('0x1e')]=function(_0x5f0e98){return _0x5f0e98!==null&&!_[_0xad70('0x1f')](_0x5f0e98);};UserReport[_0xad70('0x1d')][_0xad70('0x20')]=function(_0x275bb2,_0x2dc173,_0xc39fc0){io['to'](_0x275bb2)[_0xad70('0x20')](_0x2dc173,_0xc39fc0);};UserReport[_0xad70('0x1d')]['syncRegistry']=function(_0x524023){try{if(this['isNotNull'](_0x524023)){logger[_0xad70('0x21')](_0xad70('0x22'),_0x524023[_0xad70('0x23')],_0x524023[_0xad70('0x24')]);logger['debug'](_0xad70('0x25'),util[_0xad70('0x1b')](_0x524023,{'showHidden':![],'depth':null}));var _0x167608=_[_0xad70('0x26')](this[_0xad70('0xc')],{'defaultuser':_0x524023[_0xad70('0x23')]});if(_0x167608){_0x524023[_0xad70('0x27')]=_0x524023[_0xad70('0x24')];_[_0xad70('0x28')](_0x167608,_[_0xad70('0x29')](_0x524023,[_0xad70('0x2a'),_0xad70('0x2b'),_0xad70('0x23'),'state']));logger['debug'](_0xad70('0x2c'),util[_0xad70('0x1b')](_0x167608,{'showHidden':![],'depth':null}));this[_0xad70('0x20')](util[_0xad70('0x2d')]('trunk:%s',_0x167608[_0xad70('0x2e')]),_0xad70('0x2f'),_0x167608);}}}catch(_0x4cc6cb){logger['error'](_0xad70('0x25'),util[_0xad70('0x1b')](_0x4cc6cb,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xad70('0x12')]=function(_0x5708fe){try{if(this[_0xad70('0x1e')](_0x5708fe)){logger[_0xad70('0x21')](_0xad70('0x30'),_0x5708fe[_0xad70('0x31')],_0x5708fe[_0xad70('0x24')]);logger['debug'](_0xad70('0x32'),util[_0xad70('0x1b')](_0x5708fe,{'showHidden':![],'depth':null}));if(this[_0xad70('0xd')][_0x5708fe[_0xad70('0x31')]]){if(!this['agents'][_0x5708fe[_0xad70('0x31')]][_0xad70('0x33')]||_0x5708fe['state'][_0xad70('0x34')]()=='inuse'){this['agents'][_0x5708fe[_0xad70('0x31')]][_0xad70('0x33')]=![];if(this['agents'][_0x5708fe[_0xad70('0x31')]][_0xad70('0x24')]!==_0x5708fe[_0xad70('0x24')][_0xad70('0x34')]()){this[_0xad70('0xd')][_0x5708fe['device']][_0xad70('0x35')]=_['toNumber'](moment()[_0xad70('0x2d')]('x'));}this[_0xad70('0xd')][_0x5708fe[_0xad70('0x31')]][_0xad70('0x24')]=_0x5708fe[_0xad70('0x24')][_0xad70('0x34')]();this['agents'][_0x5708fe['device']][_0xad70('0x36')](_0x5708fe);}}else if(this[_0xad70('0xe')][_0x5708fe[_0xad70('0x31')]]){if(this['telephones'][_0x5708fe[_0xad70('0x31')]][_0xad70('0x24')]!==_0x5708fe[_0xad70('0x24')]['toLowerCase']()){this['telephones'][_0x5708fe[_0xad70('0x31')]][_0xad70('0x35')]=_['toNumber'](moment()['format']('x'));}this[_0xad70('0xe')][_0x5708fe[_0xad70('0x31')]]['state']=_0x5708fe[_0xad70('0x24')][_0xad70('0x34')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xad70('0x1b')](this[_0xad70('0xe')][_0x5708fe[_0xad70('0x31')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xad70('0x2d')](_0xad70('0x37'),this[_0xad70('0xe')][_0x5708fe[_0xad70('0x31')]][_0xad70('0x2e')]),_0xad70('0x38'),this[_0xad70('0xe')][_0x5708fe[_0xad70('0x31')]]);}else if(this[_0xad70('0xc')][_0x5708fe[_0xad70('0x31')]]){if(this['trunks'][_0x5708fe[_0xad70('0x31')]][_0xad70('0x24')]!==_0x5708fe['state'][_0xad70('0x34')]()){this[_0xad70('0xc')][_0x5708fe['device']]['stateTime']=_['toNumber'](moment()[_0xad70('0x2d')]('x'));}this[_0xad70('0xc')][_0x5708fe[_0xad70('0x31')]]['state']=_0x5708fe[_0xad70('0x24')][_0xad70('0x34')]();logger[_0xad70('0x39')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0xad70('0x1b')](this[_0xad70('0xc')][_0x5708fe['device']],{'showHidden':![],'depth':null}));this[_0xad70('0x20')](util['format']('trunk:%s',this['trunks'][_0x5708fe['device']]['name']),_0xad70('0x2f'),this[_0xad70('0xc')][_0x5708fe[_0xad70('0x31')]]);}else if(_['startsWith'](_0x5708fe[_0xad70('0x31')],_0xad70('0x3a'))){var _0x3a67a3=_0x5708fe['device'];var _0x4317c7=_0x3a67a3['substring'](_0x3a67a3[_0xad70('0x3b')]('/')+0x1,_0x3a67a3['indexOf']('@'));var _0x22d0cd=_[_0xad70('0x26')](this['agents'],function(_0x1ad732){return _0x1ad732[_0xad70('0x3c')]==_0x4317c7||_0x1ad732[_0xad70('0x3d')]==_0x4317c7||_0x1ad732[_0xad70('0x3e')]==_0x4317c7;});if(_0x22d0cd){if(_0x22d0cd[_0xad70('0x24')]!==_0x5708fe[_0xad70('0x24')]['toLowerCase']()){_0x22d0cd['stateTime']=_[_0xad70('0x3f')](moment()[_0xad70('0x2d')]('x'));}_0x22d0cd['state']=_0x5708fe['state']['toLowerCase']();_0x22d0cd[_0xad70('0x33')]=!![];_0x22d0cd[_0xad70('0x36')](_0x5708fe);}}}}catch(_0x2c7f06){logger[_0xad70('0x19')](_0xad70('0x32'),util[_0xad70('0x1b')](_0x2c7f06,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xad70('0x13')]=function(_0x40b14f){try{if(this[_0xad70('0x1e')](_0x40b14f)&&this['isNotNull'](_0x40b14f[_0xad70('0x40')])){logger['info'](_0xad70('0x41'),_0x40b14f[_0xad70('0x42')],_0x40b14f['address'],_0x40b14f[_0xad70('0x40')]);logger[_0xad70('0x39')](_0xad70('0x43'),util[_0xad70('0x1b')](_0x40b14f,{'showHidden':![],'depth':null}));if(this['agents'][_0x40b14f[_0xad70('0x42')]]){if(!this[_0xad70('0xd')][_0x40b14f['peer']]['local']||_0x40b14f[_0xad70('0x40')][_0xad70('0x34')]()==_0xad70('0x44')){this['agents'][_0x40b14f[_0xad70('0x42')]][_0xad70('0x33')]=![];this['agents'][_0x40b14f[_0xad70('0x42')]]['status']=_0x40b14f[_0xad70('0x40')]['toLowerCase']();this[_0xad70('0xd')][_0x40b14f[_0xad70('0x42')]][_0xad70('0x45')]=_0x40b14f[_0xad70('0x45')];this[_0xad70('0xd')][_0x40b14f['peer']][_0xad70('0x36')](_0x40b14f);}}else if(this[_0xad70('0xe')][_0x40b14f[_0xad70('0x42')]]){this['telephones'][_0x40b14f['peer']]['status']=_0x40b14f[_0xad70('0x40')]['toLowerCase']();this['telephones'][_0x40b14f[_0xad70('0x42')]]['address']=_0x40b14f['address'];logger[_0xad70('0x39')](_0xad70('0x46'),util['inspect'](this[_0xad70('0xe')][_0x40b14f['peer']],{'showHidden':![],'depth':null}));this[_0xad70('0x20')](util[_0xad70('0x2d')](_0xad70('0x37'),this['telephones'][_0x40b14f[_0xad70('0x42')]][_0xad70('0x2e')]),_0xad70('0x38'),this['telephones'][_0x40b14f[_0xad70('0x42')]]);}else if(this[_0xad70('0xc')][_0x40b14f[_0xad70('0x42')]]){this[_0xad70('0xc')][_0x40b14f[_0xad70('0x42')]][_0xad70('0x47')]=_0x40b14f[_0xad70('0x40')][_0xad70('0x34')]();this[_0xad70('0xc')][_0x40b14f['peer']]['address']=_0x40b14f[_0xad70('0x45')];logger[_0xad70('0x39')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0xad70('0x1b')](this[_0xad70('0xc')][_0x40b14f[_0xad70('0x42')]],{'showHidden':![],'depth':null}));this[_0xad70('0x20')](util[_0xad70('0x2d')](_0xad70('0x48'),this['trunks'][_0x40b14f['peer']][_0xad70('0x2e')]),_0xad70('0x2f'),this[_0xad70('0xc')][_0x40b14f[_0xad70('0x42')]]);}}}catch(_0x457cb5){logger[_0xad70('0x19')]('[userReport][peerstatus]',util[_0xad70('0x1b')](_0x457cb5,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0xd1c5=['name','telephone:save','trunk:save','Local','substring','indexOf','phone','accountcode','updateStatusRealtime','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','bind','syncRegistry','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect','error','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','then','isNotNull','isUndefined','emit','info','username','state','debug','find','stateRegistry','merge','omit','event','actionid','trunk:%s','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','format','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s'];(function(_0x23eaa4,_0x580b96){var _0x2f5492=function(_0x123027){while(--_0x123027){_0x23eaa4['push'](_0x23eaa4['shift']());}};_0x2f5492(++_0x580b96);}(_0xd1c5,0xf2));var _0x5d1c=function(_0x841032,_0x226b29){_0x841032=_0x841032-0x0;var _0x39496a=_0xd1c5[_0x841032];return _0x39496a;};'use strict';var _=require(_0x5d1c('0x0'));var moment=require(_0x5d1c('0x1'));var util=require(_0x5d1c('0x2'));var Redis=require(_0x5d1c('0x3'));var BPromise=require(_0x5d1c('0x4'));var config=require('../../../config/environment');var logger=require(_0x5d1c('0x5'))(_0x5d1c('0x6'));var ami=require(_0x5d1c('0x7'));config['redis']=_[_0x5d1c('0x8')](config[_0x5d1c('0x9')],{'host':_0x5d1c('0xa'),'port':0x18eb});var io=require(_0x5d1c('0xb'))(new Redis(config[_0x5d1c('0x9')]));function UserReport(_0x12848a){this[_0x5d1c('0xc')]=_0x12848a['trunks'];this[_0x5d1c('0xd')]=_0x12848a[_0x5d1c('0xd')];this[_0x5d1c('0xe')]=_0x12848a[_0x5d1c('0xe')];ami['on']('registryentry',this['syncRegistry'][_0x5d1c('0xf')](this));ami['on']('registry',this[_0x5d1c('0x10')][_0x5d1c('0xf')](this));ami['on'](_0x5d1c('0x11'),this[_0x5d1c('0x12')]['bind'](this));ami['on'](_0x5d1c('0x13'),this['syncPeerStatus'][_0x5d1c('0xf')](this));return this[_0x5d1c('0x14')]();}function showSipRegistrations(){Promise[_0x5d1c('0x15')]()['then'](ami[_0x5d1c('0x16')]())[_0x5d1c('0x17')](function(_0x2ec0eb){logger['error'](_0x5d1c('0x18'),util[_0x5d1c('0x19')](_0x2ec0eb,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x5d1c('0x15')]()['then'](ami['actionDeviceStateList']())[_0x5d1c('0x17')](function(_0x40a0c0){logger[_0x5d1c('0x1a')](_0x5d1c('0x1b'),util[_0x5d1c('0x19')](_0x40a0c0,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()['then'](ami[_0x5d1c('0x1c')]())['catch'](function(_0x241cc4){logger['error'](_0x5d1c('0x1d'),util[_0x5d1c('0x19')](_0x241cc4,{'showHidden':![],'depth':null}));});}UserReport[_0x5d1c('0x1e')][_0x5d1c('0x14')]=function(){setInterval(function(){BPromise[_0x5d1c('0x15')]()[_0x5d1c('0x1f')](showSipRegistrations())[_0x5d1c('0x1f')](listDeviceStates())[_0x5d1c('0x1f')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x5d1c('0x20')]=function(_0xbe07a7){return _0xbe07a7!==null&&!_[_0x5d1c('0x21')](_0xbe07a7);};UserReport['prototype'][_0x5d1c('0x22')]=function(_0xafc043,_0x196975,_0xe383e2){io['to'](_0xafc043)[_0x5d1c('0x22')](_0x196975,_0xe383e2);};UserReport[_0x5d1c('0x1e')][_0x5d1c('0x10')]=function(_0x349c61){try{if(this['isNotNull'](_0x349c61)){logger[_0x5d1c('0x23')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x349c61[_0x5d1c('0x24')],_0x349c61[_0x5d1c('0x25')]);logger[_0x5d1c('0x26')]('[userReport][registry]',util['inspect'](_0x349c61,{'showHidden':![],'depth':null}));var _0x206411=_[_0x5d1c('0x27')](this[_0x5d1c('0xc')],{'defaultuser':_0x349c61[_0x5d1c('0x24')]});if(_0x206411){_0x349c61[_0x5d1c('0x28')]=_0x349c61[_0x5d1c('0x25')];_[_0x5d1c('0x29')](_0x206411,_[_0x5d1c('0x2a')](_0x349c61,[_0x5d1c('0x2b'),_0x5d1c('0x2c'),'username',_0x5d1c('0x25')]));logger[_0x5d1c('0x26')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x5d1c('0x19')](_0x206411,{'showHidden':![],'depth':null}));this[_0x5d1c('0x22')](util['format'](_0x5d1c('0x2d'),_0x206411['name']),'trunk:save',_0x206411);}}}catch(_0x5c2e98){logger[_0x5d1c('0x1a')](_0x5d1c('0x2e'),util[_0x5d1c('0x19')](_0x5c2e98,{'showHidden':![],'depth':null}));}};UserReport[_0x5d1c('0x1e')][_0x5d1c('0x12')]=function(_0x4da118){try{if(this[_0x5d1c('0x20')](_0x4da118)){logger['info'](_0x5d1c('0x2f'),_0x4da118[_0x5d1c('0x30')],_0x4da118[_0x5d1c('0x25')]);logger[_0x5d1c('0x26')](_0x5d1c('0x31'),util[_0x5d1c('0x19')](_0x4da118,{'showHidden':![],'depth':null}));if(this['agents'][_0x4da118[_0x5d1c('0x30')]]){if(!this[_0x5d1c('0xd')][_0x4da118[_0x5d1c('0x30')]][_0x5d1c('0x32')]||_0x4da118[_0x5d1c('0x25')][_0x5d1c('0x33')]()==_0x5d1c('0x34')){this[_0x5d1c('0xd')][_0x4da118[_0x5d1c('0x30')]]['local']=![];if(this[_0x5d1c('0xd')][_0x4da118[_0x5d1c('0x30')]][_0x5d1c('0x25')]!==_0x4da118[_0x5d1c('0x25')][_0x5d1c('0x33')]()){this[_0x5d1c('0xd')][_0x4da118['device']][_0x5d1c('0x35')]=_[_0x5d1c('0x36')](moment()[_0x5d1c('0x37')]('x'));}this[_0x5d1c('0xd')][_0x4da118[_0x5d1c('0x30')]]['state']=_0x4da118[_0x5d1c('0x25')]['toLowerCase']();this[_0x5d1c('0xd')][_0x4da118[_0x5d1c('0x30')]]['updateStatusRealtime'](_0x4da118);}}else if(this[_0x5d1c('0xe')][_0x4da118[_0x5d1c('0x30')]]){if(this[_0x5d1c('0xe')][_0x4da118[_0x5d1c('0x30')]][_0x5d1c('0x25')]!==_0x4da118[_0x5d1c('0x25')][_0x5d1c('0x33')]()){this[_0x5d1c('0xe')][_0x4da118[_0x5d1c('0x30')]][_0x5d1c('0x35')]=_['toNumber'](moment()[_0x5d1c('0x37')]('x'));}this[_0x5d1c('0xe')][_0x4da118[_0x5d1c('0x30')]][_0x5d1c('0x25')]=_0x4da118[_0x5d1c('0x25')][_0x5d1c('0x33')]();logger[_0x5d1c('0x26')](_0x5d1c('0x38'),util['inspect'](this[_0x5d1c('0xe')][_0x4da118[_0x5d1c('0x30')]],{'showHidden':![],'depth':null}));this[_0x5d1c('0x22')](util['format'](_0x5d1c('0x39'),this[_0x5d1c('0xe')][_0x4da118['device']][_0x5d1c('0x3a')]),_0x5d1c('0x3b'),this[_0x5d1c('0xe')][_0x4da118['device']]);}else if(this[_0x5d1c('0xc')][_0x4da118[_0x5d1c('0x30')]]){if(this[_0x5d1c('0xc')][_0x4da118[_0x5d1c('0x30')]][_0x5d1c('0x25')]!==_0x4da118[_0x5d1c('0x25')][_0x5d1c('0x33')]()){this[_0x5d1c('0xc')][_0x4da118[_0x5d1c('0x30')]][_0x5d1c('0x35')]=_[_0x5d1c('0x36')](moment()[_0x5d1c('0x37')]('x'));}this[_0x5d1c('0xc')][_0x4da118[_0x5d1c('0x30')]][_0x5d1c('0x25')]=_0x4da118[_0x5d1c('0x25')][_0x5d1c('0x33')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x5d1c('0x19')](this['trunks'][_0x4da118['device']],{'showHidden':![],'depth':null}));this[_0x5d1c('0x22')](util[_0x5d1c('0x37')]('trunk:%s',this[_0x5d1c('0xc')][_0x4da118[_0x5d1c('0x30')]]['name']),_0x5d1c('0x3c'),this[_0x5d1c('0xc')][_0x4da118[_0x5d1c('0x30')]]);}else if(_['startsWith'](_0x4da118[_0x5d1c('0x30')],_0x5d1c('0x3d'))){var _0x1afffd=_0x4da118[_0x5d1c('0x30')];var _0x1cf16a=_0x1afffd[_0x5d1c('0x3e')](_0x1afffd[_0x5d1c('0x3f')]('/')+0x1,_0x1afffd[_0x5d1c('0x3f')]('@'));var _0x11a2fb=_[_0x5d1c('0x27')](this[_0x5d1c('0xd')],function(_0x368124){return _0x368124['mobile']==_0x1cf16a||_0x368124[_0x5d1c('0x40')]==_0x1cf16a||_0x368124[_0x5d1c('0x41')]==_0x1cf16a;});if(_0x11a2fb){if(_0x11a2fb[_0x5d1c('0x25')]!==_0x4da118[_0x5d1c('0x25')][_0x5d1c('0x33')]()){_0x11a2fb[_0x5d1c('0x35')]=_[_0x5d1c('0x36')](moment()[_0x5d1c('0x37')]('x'));}_0x11a2fb[_0x5d1c('0x25')]=_0x4da118[_0x5d1c('0x25')]['toLowerCase']();_0x11a2fb['local']=!![];_0x11a2fb[_0x5d1c('0x42')](_0x4da118);}}}}catch(_0x14aa50){logger[_0x5d1c('0x1a')]('[userReport][devicestatechange]',util['inspect'](_0x14aa50,{'showHidden':![],'depth':null}));}};UserReport[_0x5d1c('0x1e')][_0x5d1c('0x43')]=function(_0x4d06c4){try{if(this[_0x5d1c('0x20')](_0x4d06c4)&&this[_0x5d1c('0x20')](_0x4d06c4['peerstatus'])){logger[_0x5d1c('0x23')](_0x5d1c('0x44'),_0x4d06c4[_0x5d1c('0x45')],_0x4d06c4[_0x5d1c('0x46')],_0x4d06c4[_0x5d1c('0x13')]);logger['debug']('[userReport][peerstatus]',util['inspect'](_0x4d06c4,{'showHidden':![],'depth':null}));if(this['agents'][_0x4d06c4['peer']]){if(!this['agents'][_0x4d06c4['peer']]['local']||_0x4d06c4[_0x5d1c('0x13')][_0x5d1c('0x33')]()==_0x5d1c('0x47')){this[_0x5d1c('0xd')][_0x4d06c4['peer']][_0x5d1c('0x32')]=![];this[_0x5d1c('0xd')][_0x4d06c4[_0x5d1c('0x45')]]['status']=_0x4d06c4[_0x5d1c('0x13')]['toLowerCase']();this[_0x5d1c('0xd')][_0x4d06c4[_0x5d1c('0x45')]][_0x5d1c('0x46')]=_0x4d06c4['address'];this[_0x5d1c('0xd')][_0x4d06c4[_0x5d1c('0x45')]][_0x5d1c('0x42')](_0x4d06c4);}}else if(this[_0x5d1c('0xe')][_0x4d06c4[_0x5d1c('0x45')]]){this[_0x5d1c('0xe')][_0x4d06c4[_0x5d1c('0x45')]][_0x5d1c('0x48')]=_0x4d06c4[_0x5d1c('0x13')][_0x5d1c('0x33')]();this['telephones'][_0x4d06c4[_0x5d1c('0x45')]][_0x5d1c('0x46')]=_0x4d06c4['address'];logger[_0x5d1c('0x26')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x5d1c('0x19')](this[_0x5d1c('0xe')][_0x4d06c4[_0x5d1c('0x45')]],{'showHidden':![],'depth':null}));this[_0x5d1c('0x22')](util[_0x5d1c('0x37')](_0x5d1c('0x39'),this[_0x5d1c('0xe')][_0x4d06c4['peer']][_0x5d1c('0x3a')]),_0x5d1c('0x3b'),this[_0x5d1c('0xe')][_0x4d06c4[_0x5d1c('0x45')]]);}else if(this[_0x5d1c('0xc')][_0x4d06c4[_0x5d1c('0x45')]]){this[_0x5d1c('0xc')][_0x4d06c4[_0x5d1c('0x45')]][_0x5d1c('0x48')]=_0x4d06c4[_0x5d1c('0x13')][_0x5d1c('0x33')]();this['trunks'][_0x4d06c4[_0x5d1c('0x45')]][_0x5d1c('0x46')]=_0x4d06c4['address'];logger[_0x5d1c('0x26')](_0x5d1c('0x49'),util['inspect'](this[_0x5d1c('0xc')][_0x4d06c4['peer']],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x5d1c('0x2d'),this['trunks'][_0x4d06c4[_0x5d1c('0x45')]][_0x5d1c('0x3a')]),'trunk:save',this[_0x5d1c('0xc')][_0x4d06c4[_0x5d1c('0x45')]]);}}}catch(_0x143671){logger[_0x5d1c('0x1a')]('[userReport][peerstatus]',util['inspect'](_0x143671,{'showHidden':![],'depth':null}));}};module[_0x5d1c('0x4a')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index a6b48af..2eb367c 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x5ab22f,_0x1f7621){var _0x4b1e42=function(_0x2046d7){while(--_0x2046d7){_0x5ab22f['push'](_0x5ab22f['shift']());}};_0x4b1e42(++_0x1f7621);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x403a04,_0x462b1f){var _0x4a3849=function(_0x59f79e){while(--_0x59f79e){_0x403a04['push'](_0x403a04['shift']());}};_0x4a3849(++_0x462b1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 8b92d10..ce096fb 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffcc=['context','from-sip','channel','exten','destconnectedlinenum','connectedlinenum','format','user:%s','split','user:agentconnect','accountcode','error','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','pick','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','applicationdata','appdata','startsWith','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','includes','lastapplication','lastdata','cdr(','match','type','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','channelstate','answered','answertime','holdtime','diff','calleridnum','connectedlinename','UserId','membername','name','seconds','destinationchannel','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','user:agentcomplete','transferType','resolve','then','undefined','isEmpty','Action','StopMixMonitor','catch','webbar:stopmonitors','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','transfererchannel','transfereruniqueid','BLIND','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','lodash','moment','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','playback','voicemail','NO\x20ANSWER','BUSY','FAILED','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','newstate','varset','syncVarSet','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','prototype','isNotNull','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','[%s][voiceCallReport][newcallerid]\x20event:','inspect','linkedid','isUndefined','merge','keys'];(function(_0x209028,_0x39aac9){var _0x4e0847=function(_0x275dc0){while(--_0x275dc0){_0x209028['push'](_0x209028['shift']());}};_0x4e0847(++_0x39aac9);}(_0xffcc,0x90));var _0xcffc=function(_0x4102d8,_0x3a8c78){_0x4102d8=_0x4102d8-0x0;var _0x1d465a=_0xffcc[_0x4102d8];return _0x1d465a;};'use strict';var _=require(_0xcffc('0x0'));var moment=require(_0xcffc('0x1'));var util=require(_0xcffc('0x2'));var path=require(_0xcffc('0x3'));var Redis=require('ioredis');var config=require(_0xcffc('0x4'));var logger=require(_0xcffc('0x5'))(_0xcffc('0x6'));var ami=require(_0xcffc('0x7'));var Channel=require(_0xcffc('0x8'));var RpcSetting=require(_0xcffc('0x9'));var applications=[_0xcffc('0xa'),_0xcffc('0xb'),_0xcffc('0xc'),'dial',_0xcffc('0xd'),_0xcffc('0xe')];var dispositions=['NO\x20ANSWER','FAILED','FAILED',_0xcffc('0xf'),_0xcffc('0xf'),_0xcffc('0xf'),'ANSWERED',_0xcffc('0x10'),_0xcffc('0x11'),_0xcffc('0x11'),'FAILED'];config[_0xcffc('0x12')]=_[_0xcffc('0x13')](config[_0xcffc('0x12')],{'host':'localhost','port':0x18eb});var io=require(_0xcffc('0x14'))(new Redis(config[_0xcffc('0x12')]));function VoiceCallReport(_0x125456){this[_0xcffc('0x15')]=_0x125456[_0xcffc('0x15')];this['agents']=_0x125456[_0xcffc('0x16')];this[_0xcffc('0x17')]={};ami['on'](_0xcffc('0x18'),this[_0xcffc('0x19')][_0xcffc('0x1a')](this));ami['on']('newexten',this['syncNewExten'][_0xcffc('0x1a')](this));ami['on'](_0xcffc('0x1b'),this[_0xcffc('0x1c')]['bind'](this));ami['on'](_0xcffc('0x1d'),this['syncNewState'][_0xcffc('0x1a')](this));ami['on'](_0xcffc('0x1e'),this[_0xcffc('0x1f')][_0xcffc('0x1a')](this));ami['on']('hangup',this['syncHangup'][_0xcffc('0x1a')](this));ami['on'](_0xcffc('0x20'),this[_0xcffc('0x21')][_0xcffc('0x1a')](this));ami['on']('attendedtransfer',this[_0xcffc('0x22')][_0xcffc('0x1a')](this));ami['on'](_0xcffc('0x23'),this[_0xcffc('0x24')][_0xcffc('0x1a')](this));ami['on'](_0xcffc('0x25'),this[_0xcffc('0x26')][_0xcffc('0x1a')](this));ami['on'](_0xcffc('0x27'),this[_0xcffc('0x28')][_0xcffc('0x1a')](this));try{logger[_0xcffc('0x29')](_0xcffc('0x2a'));ami[_0xcffc('0x2b')]();}catch(_0x34e665){logger['error'](_0xcffc('0x2c'),util['inspect'](_0x34e665,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xcffc('0x2d')][_0xcffc('0x2e')]=function(_0x1a0710){return _0x1a0710!==null&&!_['isUndefined'](_0x1a0710);};VoiceCallReport[_0xcffc('0x2d')][_0xcffc('0x2f')]=function(_0x51007a,_0xcb7a9d,_0x5a7b80){io['to'](_0x51007a)[_0xcffc('0x2f')](_0xcb7a9d,_0x5a7b80);};VoiceCallReport['prototype'][_0xcffc('0x21')]=function(_0x297550){try{if(this[_0xcffc('0x2e')](_0x297550)){logger['info'](_0xcffc('0x30'),_0x297550[_0xcffc('0x31')],_0x297550[_0xcffc('0x32')],_0x297550['calleridnum']);logger['debug'](_0xcffc('0x33'),_0x297550[_0xcffc('0x31')],util[_0xcffc('0x34')](_0x297550,{'showHidden':![],'depth':null}));if(_0x297550['uniqueid']===_0x297550[_0xcffc('0x35')]){if(!_[_0xcffc('0x36')](this['channels'][_0x297550[_0xcffc('0x31')]])){_[_0xcffc('0x37')](this['channels'][_0x297550['uniqueid']],_['pick'](_0x297550,_[_0xcffc('0x38')](this[_0xcffc('0x15')][_0x297550[_0xcffc('0x31')]])));}}if(_0x297550[_0xcffc('0x39')]===_0xcffc('0x3a')){if(this[_0xcffc('0x16')][_0x297550[_0xcffc('0x3b')]['split']('-')[0x0]]){if(_0x297550[_0xcffc('0x3c')]=='xcally-motion-preview'){this[_0xcffc('0x16')][_0x297550['channel']['split']('-')[0x0]][_0xcffc('0x3d')]=_0x297550[_0xcffc('0x3e')];this[_0xcffc('0x2f')](util[_0xcffc('0x3f')](_0xcffc('0x40'),this[_0xcffc('0x16')][_0x297550[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]]['name']),_0xcffc('0x42'),{'destaccountcode':this['agents'][_0x297550[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]][_0xcffc('0x43')],'destconnectedlinenum':_0x297550[_0xcffc('0x3e')]});}}}}}catch(_0x1906c0){logger[_0xcffc('0x44')](_0xcffc('0x45'),_0x297550['uniqueid'],util[_0xcffc('0x34')](_0x1906c0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcffc('0x2d')][_0xcffc('0x1c')]=function(_0x2d26e4){try{if(this[_0xcffc('0x2e')](_0x2d26e4)){logger[_0xcffc('0x46')](_0xcffc('0x47'),_0x2d26e4[_0xcffc('0x31')],util[_0xcffc('0x34')](_0x2d26e4,{'showHidden':![],'depth':null}));if(this[_0xcffc('0x15')][_0x2d26e4[_0xcffc('0x31')]])return;if(_0x2d26e4['channel']==='OutgoingSpoolFailed')return;if(_0x2d26e4[_0xcffc('0x31')]!==_0x2d26e4[_0xcffc('0x35')]&&!this['blindTransfers'][_0x2d26e4['linkedid']])return;logger[_0xcffc('0x29')](_0xcffc('0x48'),_0x2d26e4['uniqueid'],_0x2d26e4['context'],_0x2d26e4[_0xcffc('0x3c')]);this['channels'][_0x2d26e4['uniqueid']]=new Channel();this[_0xcffc('0x15')][_0x2d26e4[_0xcffc('0x31')]]['starttime']=moment()['format'](_0xcffc('0x49'));this[_0xcffc('0x15')][_0x2d26e4[_0xcffc('0x31')]][_0xcffc('0x4a')]=dispositions[_[_0xcffc('0x4b')](_0x2d26e4['channelstate'])];_[_0xcffc('0x37')](this[_0xcffc('0x15')][_0x2d26e4[_0xcffc('0x31')]],_[_0xcffc('0x4c')](_0x2d26e4,_[_0xcffc('0x38')](this['channels'][_0x2d26e4['uniqueid']])));if(_0x2d26e4['context']===_0xcffc('0x3a')){if(this[_0xcffc('0x16')][_0x2d26e4[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]]){if(_[_0xcffc('0x36')](this[_0xcffc('0x16')][_0x2d26e4['channel'][_0xcffc('0x41')]('-')[0x0]][_0xcffc('0x3d')])){this[_0xcffc('0x16')][_0x2d26e4[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]]['destconnectedlinenum']=_0x2d26e4[_0xcffc('0x3c')];logger['debug'](_0xcffc('0x4d'),_0x2d26e4['uniqueid'],util[_0xcffc('0x34')]({'id':this[_0xcffc('0x16')][_0x2d26e4[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0xcffc('0x16')][_0x2d26e4['channel']['split']('-')[0x0]][_0xcffc('0x43')],'destconnectedlinenum':_0x2d26e4['exten']},{'showHidden':![],'depth':null}));this[_0xcffc('0x2f')](util[_0xcffc('0x3f')](_0xcffc('0x40'),this['agents'][_0x2d26e4[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]]['name']),_0xcffc('0x42'),{'id':this[_0xcffc('0x16')][_0x2d26e4[_0xcffc('0x3b')]['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x2d26e4[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x2d26e4[_0xcffc('0x3c')]});}}}}}catch(_0x1fa94b){logger[_0xcffc('0x44')](_0xcffc('0x4e'),_0x2d26e4[_0xcffc('0x31')],util['inspect'](_0x1fa94b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcffc('0x2d')][_0xcffc('0x19')]=function(_0x4c89eb){try{if(this[_0xcffc('0x2e')](_0x4c89eb)){logger[_0xcffc('0x46')](_0xcffc('0x4f'),_0x4c89eb[_0xcffc('0x31')],util[_0xcffc('0x34')](_0x4c89eb,{'showHidden':![],'depth':null}));if(_0x4c89eb[_0xcffc('0x3b')]===_0xcffc('0x50')||_0x4c89eb[_0xcffc('0x3c')]==='h')return;if(_0x4c89eb[_0xcffc('0x31')]===_0x4c89eb[_0xcffc('0x35')]||this[_0xcffc('0x17')][_0x4c89eb[_0xcffc('0x35')]]){_0x4c89eb[_0xcffc('0x51')]=_0x4c89eb['application']['toLowerCase']();_0x4c89eb[_0xcffc('0x52')]=_0x4c89eb[_0xcffc('0x53')]&&_0x4c89eb[_0xcffc('0x53')][_0xcffc('0x54')]('CDR(routeAlias)')?_0x4c89eb[_0xcffc('0x53')]:(_0x4c89eb[_0xcffc('0x53')]||_0x4c89eb[_0xcffc('0x52')])[_0xcffc('0x55')]();logger[_0xcffc('0x29')](_0xcffc('0x56'),_0x4c89eb['uniqueid'],_0x4c89eb['application'],_0x4c89eb[_0xcffc('0x52')]);if(_[_0xcffc('0x36')](this[_0xcffc('0x15')][_0x4c89eb['uniqueid']])){this[_0xcffc('0x15')][_0x4c89eb['uniqueid']]=new Channel();this[_0xcffc('0x15')][_0x4c89eb[_0xcffc('0x31')]][_0xcffc('0x57')]=_0x4c89eb[_0xcffc('0x58')]?moment()[_0xcffc('0x59')](moment[_0xcffc('0x58')](_0x4c89eb[_0xcffc('0x58')])['seconds'](),'seconds')[_0xcffc('0x3f')](_0xcffc('0x49')):moment()[_0xcffc('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xcffc('0x15')][_0x4c89eb[_0xcffc('0x31')]]['disposition']='NO\x20ANSWER';}_[_0xcffc('0x37')](this[_0xcffc('0x15')][_0x4c89eb[_0xcffc('0x31')]],_[_0xcffc('0x4c')](_0x4c89eb,_[_0xcffc('0x38')](this[_0xcffc('0x15')][_0x4c89eb[_0xcffc('0x31')]])));if(_[_0xcffc('0x5a')](applications,_0x4c89eb['application'])){this['channels'][_0x4c89eb[_0xcffc('0x31')]][_0xcffc('0x5b')]=_0x4c89eb['application'];this['channels'][_0x4c89eb[_0xcffc('0x31')]][_0xcffc('0x5c')]=_0x4c89eb['applicationdata'];if(_0x4c89eb[_0xcffc('0x51')]===_0xcffc('0xa')&&_[_0xcffc('0x54')](_0x4c89eb['applicationdata'][_0xcffc('0x55')](),_0xcffc('0x5d'))){var _0x3aa47b=_0x4c89eb[_0xcffc('0x52')]['split']('=');var _0x7c33bb=_0x3aa47b[0x0][_0xcffc('0x55')]()[_0xcffc('0x5e')](/cdr\((.*)\)/);if(_0x7c33bb){if(_0x7c33bb[0x1]===_0xcffc('0x5f')&&!_['isNil'](this[_0xcffc('0x15')][_0x4c89eb['uniqueid']][_0x7c33bb[0x1]]))return;this[_0xcffc('0x15')][_0x4c89eb[_0xcffc('0x31')]][_0x7c33bb[0x1]]=_0x3aa47b[0x1];}}else if(_0x4c89eb[_0xcffc('0x51')]===_0xcffc('0xb')){this['channels'][_0x4c89eb['uniqueid']][_0xcffc('0xb')]=_0x4c89eb[_0xcffc('0x52')][_0xcffc('0x41')](',')[0x0];}}}}}catch(_0x1fe694){logger[_0xcffc('0x44')](_0xcffc('0x60'),_0x4c89eb[_0xcffc('0x31')],util['inspect'](_0x1fe694,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcffc('0x2d')]['syncNewState']=function(_0x17872a){try{if(this[_0xcffc('0x2e')](_0x17872a)){logger[_0xcffc('0x29')](_0xcffc('0x61'),_0x17872a['uniqueid'],_0x17872a[_0xcffc('0x35')],_0x17872a[_0xcffc('0x32')],_0x17872a['calleridnum']);logger[_0xcffc('0x46')]('[%s][voiceCallReport][newstate]\x20event:',_0x17872a[_0xcffc('0x31')],util['inspect'](_0x17872a,{'showHidden':![],'depth':null}));if(_0x17872a[_0xcffc('0x62')]!=='6')return;if(_0x17872a[_0xcffc('0x31')]!==_0x17872a['linkedid']){var _0x2256f5=moment();if(this[_0xcffc('0x15')][_0x17872a['linkedid']]){if(!this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x35')]][_0xcffc('0x63')]){this['channels'][_0x17872a[_0xcffc('0x35')]]['answered']=!![];this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x35')]][_0xcffc('0x64')]=_0x2256f5[_0xcffc('0x3f')](_0xcffc('0x49'));if(this['channels'][_0x17872a[_0xcffc('0x35')]][_0xcffc('0x57')]){this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x35')]][_0xcffc('0x65')]=_0x2256f5[_0xcffc('0x66')](this['channels'][_0x17872a[_0xcffc('0x35')]][_0xcffc('0x57')],'seconds');}}this[_0xcffc('0x15')][_0x17872a['linkedid']][_0xcffc('0x35')]=_0x17872a[_0xcffc('0x31')];if(_0x17872a[_0xcffc('0x67')]!=='xcally-motion-preview'){this[_0xcffc('0x15')][_0x17872a['linkedid']][_0xcffc('0x3e')]=_0x17872a['calleridnum'];}this['channels'][_0x17872a[_0xcffc('0x35')]][_0xcffc('0x68')]=_0x17872a['calleridname'];this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x35')]]['destinationchannel']=_0x17872a['channel'];this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x35')]][_0xcffc('0x4a')]=dispositions[_['toNumber'](_0x17872a[_0xcffc('0x62')])];if(this['agents'][_0x17872a[_0xcffc('0x3b')]['split']('-')[0x0]]){this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x35')]][_0xcffc('0x69')]=this[_0xcffc('0x16')][_0x17872a['channel'][_0xcffc('0x41')]('-')[0x0]]['id'];this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x35')]][_0xcffc('0x6a')]=this['agents'][_0x17872a[_0xcffc('0x3b')]['split']('-')[0x0]][_0xcffc('0x6b')];}}if(this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x31')]]){if(!this[_0xcffc('0x15')][_0x17872a['uniqueid']]['answered']){this['channels'][_0x17872a['uniqueid']]['answered']=!![];this['channels'][_0x17872a['uniqueid']][_0xcffc('0x64')]=_0x2256f5[_0xcffc('0x3f')](_0xcffc('0x49'));if(this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x31')]][_0xcffc('0x57')]){this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x31')]]['holdtime']=_0x2256f5[_0xcffc('0x66')](this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x31')]][_0xcffc('0x57')],_0xcffc('0x6c'));}}if(_0x17872a[_0xcffc('0x67')]!=='xcally-motion-preview'){this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x31')]]['connectedlinenum']=_0x17872a['calleridnum'];}this['channels'][_0x17872a[_0xcffc('0x31')]][_0xcffc('0x68')]=_0x17872a[_0xcffc('0x32')];this['channels'][_0x17872a['uniqueid']][_0xcffc('0x6d')]=_0x17872a[_0xcffc('0x3b')];this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x31')]][_0xcffc('0x4a')]=dispositions[_[_0xcffc('0x4b')](_0x17872a['channelstate'])];}}else{if(this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x31')]]){if(this[_0xcffc('0x16')][_0x17872a[_0xcffc('0x3b')]['split']('-')[0x0]]){this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x31')]]['UserId']=this['agents'][_0x17872a[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]]['id'];this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x31')]]['membername']=this[_0xcffc('0x16')][_0x17872a[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]][_0xcffc('0x6b')];}}}if(_0x17872a['context']===_0xcffc('0x3a')){if(this[_0xcffc('0x16')][_0x17872a['channel'][_0xcffc('0x41')]('-')[0x0]]){this[_0xcffc('0x16')][_0x17872a[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]][_0xcffc('0x3d')]=_0x17872a[_0xcffc('0x3c')];var _0x520de3,_0x1245e5;if(this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x31')]]){_0x520de3=this['channels'][_0x17872a[_0xcffc('0x31')]]['routealias'];_0x1245e5=this['channels'][_0x17872a[_0xcffc('0x31')]]['queue'];}else if(this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x35')]]){_0x520de3=this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x35')]][_0xcffc('0x6e')];_0x1245e5=this[_0xcffc('0x15')][_0x17872a[_0xcffc('0x35')]]['queue'];}logger[_0xcffc('0x46')](_0xcffc('0x6f'),_0x17872a['uniqueid'],util['inspect']({'id':this[_0xcffc('0x16')][_0x17872a[_0xcffc('0x3b')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xcffc('0x16')][_0x17872a['channel'][_0xcffc('0x41')]('-')[0x0]][_0xcffc('0x43')],'destconnectedlinenum':_0x17872a[_0xcffc('0x3c')],'routealias':_0x520de3,'queue':_0x1245e5||undefined},{'showHidden':![],'depth':null}));this[_0xcffc('0x2f')](util[_0xcffc('0x3f')](_0xcffc('0x40'),this[_0xcffc('0x16')][_0x17872a[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]][_0xcffc('0x6b')]),'user:agentconnect',{'id':this['agents'][_0x17872a[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xcffc('0x16')][_0x17872a[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]][_0xcffc('0x43')],'destconnectedlinenum':_0x17872a[_0xcffc('0x3c')],'routealias':_0x520de3,'queue':_0x1245e5||undefined});}}}}catch(_0x1aecb8){logger[_0xcffc('0x44')](_0xcffc('0x70'),_0x17872a['uniqueid'],util['inspect'](_0x1aecb8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcffc('0x2d')][_0xcffc('0x71')]=function(_0x5c1365,_0x510b7f){try{if(this[_0xcffc('0x15')][_0x5c1365]){logger[_0xcffc('0x29')](_0xcffc('0x72'),_0x5c1365,_0x510b7f);this[_0xcffc('0x15')][_0x5c1365][_0xcffc('0x73')]=!![];if(_[_0xcffc('0x74')](_0x510b7f,_0xcffc('0x75'))){_0x510b7f=_0x510b7f[_0xcffc('0x76')](_0xcffc('0x75'),_0xcffc('0x77'));}this[_0xcffc('0x15')][_0x5c1365][_0xcffc('0x78')]=_0x510b7f;var _0x5ba8eb=_['find'](this[_0xcffc('0x15')][_0x5c1365][_0xcffc('0x79')],{'filename':_0x510b7f});if(_[_0xcffc('0x7a')](_0x5ba8eb)){this['channels'][_0x5c1365][_0xcffc('0x79')][_0xcffc('0x7b')]({'filename':_0x510b7f,'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xcffc('0x7c')});}}}catch(_0x3433b3){logger[_0xcffc('0x44')](_0xcffc('0x7d'),_0x5c1365,util['inspect'](_0x3433b3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcffc('0x2d')]['syncVarSet']=function(_0x4ae142){try{if(this[_0xcffc('0x2e')](_0x4ae142)){logger['debug'](_0xcffc('0x7e'),_0x4ae142['uniqueid'],util[_0xcffc('0x34')](_0x4ae142,{'showHidden':![],'depth':null}));if(this[_0xcffc('0x15')][_0x4ae142['uniqueid']]&&_0x4ae142[_0xcffc('0x3b')]!=_0xcffc('0x50')){if(this[_0xcffc('0x2e')](_0x4ae142[_0xcffc('0x7f')])){if(this[_0xcffc('0x2e')](_0x4ae142['variable'][_0xcffc('0x80')])){logger[_0xcffc('0x29')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x4ae142[_0xcffc('0x31')],_0x4ae142['value']);this[_0xcffc('0x71')](_0x4ae142[_0xcffc('0x31')],_0x4ae142[_0xcffc('0x81')]);}else if(this[_0xcffc('0x2e')](_0x4ae142['variable']['xmd-phone'])){logger[_0xcffc('0x29')](_0xcffc('0x82'),_0x4ae142[_0xcffc('0x31')],_0x4ae142[_0xcffc('0x81')]);this[_0xcffc('0x15')][_0x4ae142[_0xcffc('0x31')]][_0xcffc('0x67')]=_0x4ae142[_0xcffc('0x81')];}else if(this[_0xcffc('0x2e')](_0x4ae142[_0xcffc('0x7f')][_0xcffc('0x83')])){logger['info'](_0xcffc('0x84'),_0x4ae142[_0xcffc('0x31')],_0x4ae142['value']);this['channels'][_0x4ae142[_0xcffc('0x31')]][_0xcffc('0x85')]=_0x4ae142[_0xcffc('0x81')];}else if(this[_0xcffc('0x2e')](_0x4ae142['variable'][_0xcffc('0x86')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x4ae142[_0xcffc('0x31')],_0x4ae142[_0xcffc('0x81')]);this[_0xcffc('0x15')][_0x4ae142[_0xcffc('0x31')]][_0xcffc('0x5f')]=_0x4ae142[_0xcffc('0x81')];}else if(this['isNotNull'](_0x4ae142['variable']['xmd-queue'])){logger[_0xcffc('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x4ae142[_0xcffc('0x31')],_0x4ae142[_0xcffc('0x81')][_0xcffc('0x41')](',')[0x0]);this[_0xcffc('0x15')][_0x4ae142[_0xcffc('0x31')]][_0xcffc('0xb')]=_0x4ae142[_0xcffc('0x81')][_0xcffc('0x41')](',')[0x0];}else if(this[_0xcffc('0x2e')](_0x4ae142[_0xcffc('0x7f')][_0xcffc('0x87')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x4ae142[_0xcffc('0x31')],_0x4ae142['value']);this['channels'][_0x4ae142['uniqueid']][_0xcffc('0x88')]=_0x4ae142[_0xcffc('0x81')];}else if(this[_0xcffc('0x2e')](_0x4ae142[_0xcffc('0x7f')][_0xcffc('0x89')])){logger[_0xcffc('0x29')](_0xcffc('0x8a'),_0x4ae142[_0xcffc('0x31')],_0x4ae142[_0xcffc('0x81')]);this[_0xcffc('0x15')][_0x4ae142[_0xcffc('0x31')]][_0xcffc('0x8b')]=_0x4ae142[_0xcffc('0x81')];}else if(this['isNotNull'](_0x4ae142[_0xcffc('0x7f')][_0xcffc('0x8c')])){logger[_0xcffc('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x4ae142[_0xcffc('0x31')],_0x4ae142['value']);this[_0xcffc('0x15')][_0x4ae142['uniqueid']][_0xcffc('0x8d')]=_0x4ae142['value'];}else if(this[_0xcffc('0x2e')](_0x4ae142['variable']['xmcs-queue'])){logger[_0xcffc('0x29')](_0xcffc('0x8e'),_0x4ae142[_0xcffc('0x31')],_0x4ae142[_0xcffc('0x81')]);this[_0xcffc('0x15')][_0x4ae142[_0xcffc('0x31')]][_0xcffc('0xb')]=_0x4ae142[_0xcffc('0x81')];}else if(this['isNotNull'](_0x4ae142['variable'][_0xcffc('0x8f')])){logger[_0xcffc('0x29')](_0xcffc('0x90'),_0x4ae142[_0xcffc('0x31')],_0x4ae142[_0xcffc('0x81')]);this[_0xcffc('0x15')][_0x4ae142[_0xcffc('0x31')]][_0xcffc('0x91')]=_0x4ae142['value'];}}}else if(this[_0xcffc('0x2e')](_0x4ae142[_0xcffc('0x7f')]['mixmonitor_filename'])){if(_0x4ae142[_0xcffc('0x81')]){var _0x16d83a=path['parse'](_0x4ae142['value'])['name'];logger[_0xcffc('0x29')](_0xcffc('0x92'),_0x16d83a,_0x4ae142[_0xcffc('0x81')]);this['syncMixMonitorFilename'](_0x16d83a,_0x4ae142['value']);}}else if(this['channels'][_0x4ae142['linkedid']]){if(this[_0xcffc('0x2e')](_0x4ae142[_0xcffc('0x7f')])){if(this[_0xcffc('0x2e')](_0x4ae142['variable'][_0xcffc('0x8f')])){logger[_0xcffc('0x29')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x4ae142[_0xcffc('0x35')],_0x4ae142[_0xcffc('0x81')]);this[_0xcffc('0x15')][_0x4ae142[_0xcffc('0x35')]][_0xcffc('0x93')]=_0x4ae142[_0xcffc('0x81')];}}}}}catch(_0x3a89a5){logger[_0xcffc('0x44')](_0xcffc('0x94'),_0x4ae142[_0xcffc('0x31')],util[_0xcffc('0x34')](_0x3a89a5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcffc('0x2d')][_0xcffc('0x95')]=function(_0x3a527f){try{if(this[_0xcffc('0x2e')](_0x3a527f)){logger[_0xcffc('0x46')](_0xcffc('0x96'),_0x3a527f[_0xcffc('0x31')],util[_0xcffc('0x34')](_0x3a527f,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x3a527f['linkedid']]){if(this[_0xcffc('0x15')][this[_0xcffc('0x17')][_0x3a527f[_0xcffc('0x35')]]['linkedid']]){this['channels'][this[_0xcffc('0x17')][_0x3a527f[_0xcffc('0x35')]]['linkedid']]['uniqueid']=_0x3a527f[_0xcffc('0x31')];this[_0xcffc('0x15')][this['blindTransfers'][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x35')]][_0xcffc('0x63')]=this[_0xcffc('0x15')][_0x3a527f[_0xcffc('0x31')]][_0xcffc('0x63')];this['channels'][this[_0xcffc('0x17')][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x35')]]['answertime']=this['channels'][_0x3a527f[_0xcffc('0x31')]][_0xcffc('0x64')];this[_0xcffc('0x15')][this['blindTransfers'][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x35')]][_0xcffc('0x6d')]=this[_0xcffc('0x15')][this[_0xcffc('0x17')][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x35')]][_0xcffc('0x3b')];this[_0xcffc('0x15')][this['blindTransfers'][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x35')]][_0xcffc('0x4a')]=this['channels'][_0x3a527f[_0xcffc('0x31')]][_0xcffc('0x4a')];this['channels'][_0x3a527f[_0xcffc('0x31')]]=this[_0xcffc('0x15')][this['blindTransfers'][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x35')]];delete this[_0xcffc('0x15')][this[_0xcffc('0x17')][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x35')]];}else if(this[_0xcffc('0x15')][this['blindTransfers'][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x31')]]){this[_0xcffc('0x15')][this[_0xcffc('0x17')][_0x3a527f[_0xcffc('0x35')]]['uniqueid']][_0xcffc('0x31')]=[this[_0xcffc('0x15')][this[_0xcffc('0x17')][_0x3a527f['linkedid']][_0xcffc('0x31')]][_0xcffc('0x35')],this[_0xcffc('0x15')][this[_0xcffc('0x17')][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x31')]][_0xcffc('0x35')]=this['channels'][this['blindTransfers'][_0x3a527f[_0xcffc('0x35')]]['uniqueid']][_0xcffc('0x31')]][0x0];this[_0xcffc('0x15')][this[_0xcffc('0x17')][_0x3a527f[_0xcffc('0x35')]]['uniqueid']]['answered']=this[_0xcffc('0x15')][_0x3a527f[_0xcffc('0x31')]][_0xcffc('0x63')];this[_0xcffc('0x15')][this[_0xcffc('0x17')][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x31')]]['answertime']=this[_0xcffc('0x15')][_0x3a527f[_0xcffc('0x31')]][_0xcffc('0x64')];this[_0xcffc('0x15')][this['blindTransfers'][_0x3a527f['linkedid']][_0xcffc('0x31')]][_0xcffc('0x6d')]=this[_0xcffc('0x15')][this[_0xcffc('0x17')][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x31')]]['channel'];this[_0xcffc('0x15')][this['blindTransfers'][_0x3a527f['linkedid']][_0xcffc('0x31')]][_0xcffc('0x4a')]=this['channels'][_0x3a527f[_0xcffc('0x31')]]['disposition'];this['channels'][_0x3a527f[_0xcffc('0x31')]]=this[_0xcffc('0x15')][this['blindTransfers'][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x31')]];delete this[_0xcffc('0x15')][this[_0xcffc('0x17')][_0x3a527f[_0xcffc('0x35')]][_0xcffc('0x31')]];}}if(this[_0xcffc('0x15')][_0x3a527f[_0xcffc('0x31')]]){logger[_0xcffc('0x29')](_0xcffc('0x97'),_0x3a527f['uniqueid'],_0x3a527f[_0xcffc('0x98')]);var _0x24de16=moment();this[_0xcffc('0x15')][_0x3a527f[_0xcffc('0x31')]][_0xcffc('0x99')]=_0x24de16[_0xcffc('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3a527f[_0xcffc('0x31')]][_0xcffc('0x58')]=_0x24de16['diff'](this['channels'][_0x3a527f['uniqueid']][_0xcffc('0x57')],_0xcffc('0x6c'));if(this['channels'][_0x3a527f[_0xcffc('0x31')]]['answered']){this[_0xcffc('0x15')][_0x3a527f['uniqueid']][_0xcffc('0x9a')]=_0x24de16['diff'](this[_0xcffc('0x15')][_0x3a527f['uniqueid']][_0xcffc('0x64')],_0xcffc('0x6c'));this[_0xcffc('0x15')][_0x3a527f[_0xcffc('0x31')]][_0xcffc('0x65')]=this['channels'][_0x3a527f[_0xcffc('0x31')]]['duration']-this[_0xcffc('0x15')][_0x3a527f[_0xcffc('0x31')]]['billableseconds'];}if(_0x3a527f[_0xcffc('0x39')]==='from-sip'){if(this['agents'][_0x3a527f[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]]){this['agents'][_0x3a527f[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]]=_[_0xcffc('0x9b')](this[_0xcffc('0x16')][_0x3a527f['channel'][_0xcffc('0x41')]('-')[0x0]],[_0xcffc('0x3d')]);logger[_0xcffc('0x46')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x3a527f['uniqueid'],util[_0xcffc('0x34')]({'id':this[_0xcffc('0x16')][_0x3a527f[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x3a527f[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]][_0xcffc('0x43')]},{'showHidden':![],'depth':null}));this[_0xcffc('0x2f')](util[_0xcffc('0x3f')]('user:%s',this[_0xcffc('0x16')][_0x3a527f[_0xcffc('0x3b')]['split']('-')[0x0]]['name']),'user:agentcomplete',{'id':this[_0xcffc('0x16')][_0x3a527f[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0xcffc('0x16')][_0x3a527f[_0xcffc('0x3b')][_0xcffc('0x41')]('-')[0x0]][_0xcffc('0x43')]});for(var _0x59ee37=0x0;_0x59ee370x0?_0x5ed5b1:0x0;this[_0x8203('0x12')][_0x298945['queue']]['talking']=this[_0x8203('0x12')][_0x298945[_0x8203('0x61')]][_0x8203('0x34')]>_['toNumber'](_0x298945[_0x8203('0x69')])?_[_0x8203('0x68')](_0x298945[_0x8203('0x69')]):this[_0x8203('0x12')][_0x298945[_0x8203('0x61')]][_0x8203('0x34')];this['emitVoiceQueueSummary'](this[_0x8203('0x12')][_0x298945[_0x8203('0x61')]],_0x8203('0x16'));}logger[_0x8203('0x46')](_0x8203('0x6a'),util[_0x8203('0x40')](this[_0x8203('0x12')][_0x298945[_0x8203('0x61')]],{'showHidden':![],'depth':null}));ami[_0x8203('0x44')](_0x8203('0x6b'),this[_0x8203('0x12')][_0x298945[_0x8203('0x61')]]);}}}catch(_0x5c99f7){logger[_0x8203('0x3d')](_0x8203('0x5f'),util[_0x8203('0x40')](_0x5c99f7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8203('0xa')][_0x8203('0x19')]=function(_0x31f463){logger[_0x8203('0x46')](_0x8203('0x6c'),util[_0x8203('0x40')](_0x31f463,{'showHidden':![],'depth':null}));ami['emit'](_0x8203('0x6d'),{});this[_0x8203('0x13')]=!![];};VoiceQueueReport[_0x8203('0xa')][_0x8203('0x1b')]=function(_0x10180f){try{if(this[_0x8203('0x60')](_0x10180f)){logger[_0x8203('0x46')](_0x8203('0x6e'),_0x10180f['uniqueid'],util['inspect'](_0x10180f,{'showHidden':![],'depth':null}));if(_[_0x8203('0x5d')](this[_0x8203('0xe')][_0x10180f[_0x8203('0x6f')]]))this[_0x8203('0xe')][_0x10180f[_0x8203('0x6f')]]=[];if(_['isUndefined'](this['channels'][_0x10180f[_0x8203('0x6f')]]))this[_0x8203('0x10')][_0x10180f['uniqueid']]={};var _0x3caf9b=new QueueReport();_0x3caf9b['name']=_0x10180f[_0x8203('0x61')];_0x3caf9b[_0x8203('0x55')]=this[_0x8203('0x12')][_0x3caf9b[_0x8203('0x49')]]&&this['voiceQueues'][_0x3caf9b[_0x8203('0x49')]][_0x8203('0x55')]?this['voiceQueues'][_0x3caf9b[_0x8203('0x49')]][_0x8203('0x55')]||'inbound':_0x8203('0x4e');_0x3caf9b[_0x8203('0x61')]=_0x10180f[_0x8203('0x61')];_0x3caf9b[_0x8203('0x70')]=moment()[_0x8203('0x4d')](_0x8203('0x71'));_0x3caf9b['position']=_0x10180f[_0x8203('0x72')];_0x3caf9b['count']=_0x10180f[_0x8203('0x73')];_0x3caf9b[_0x8203('0x6f')]=_0x10180f[_0x8203('0x6f')];_0x3caf9b[_0x8203('0x74')]=this[_0x8203('0x10')][_0x10180f[_0x8203('0x6f')]][_0x8203('0x74')];logger[_0x8203('0x63')](_0x8203('0x75'),_0x3caf9b[_0x8203('0x49')],_0x3caf9b['type']);_[_0x8203('0x76')](_0x3caf9b,_[_0x8203('0x77')](_0x10180f,_[_0x8203('0x78')](_0x3caf9b)));this[_0x8203('0xe')][_0x10180f[_0x8203('0x6f')]][_0x8203('0x79')](_0x3caf9b);this[_0x8203('0x10')][_0x10180f[_0x8203('0x6f')]]=_0x3caf9b;this['emitVoiceQueueChannelSave'](_0x3caf9b,'queuecallerjoin');}}catch(_0x405df4){logger[_0x8203('0x3d')](_0x8203('0x6e'),_0x10180f['uniqueid'],util['inspect'](_0x405df4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8203('0xa')][_0x8203('0x7a')]=function(_0x2ab829){try{if(this[_0x8203('0x60')](_0x2ab829)){logger['debug'](_0x8203('0x7b'),_0x2ab829[_0x8203('0x6f')],util[_0x8203('0x40')](_0x2ab829,{'showHidden':![],'depth':null}));if(this[_0x8203('0xe')][_0x2ab829[_0x8203('0x6f')]]){var _0x4d0036=_['last'](this[_0x8203('0xe')][_0x2ab829[_0x8203('0x6f')]]);_0x4d0036[_0x8203('0x7c')]=![];_0x4d0036[_0x8203('0x7d')]=null;_0x4d0036[_0x8203('0x7e')]=_0x2ab829[_0x8203('0x7e')];_0x4d0036[_0x8203('0x7f')]=_0x2ab829[_0x8203('0x7f')];_0x4d0036[_0x8203('0x1c')]=!![];_0x4d0036[_0x8203('0x80')]=moment()[_0x8203('0x4d')](_0x8203('0x71'));_0x4d0036[_0x8203('0x81')]=_0x8203('0x82');_0x4d0036[_0x8203('0x83')]=null;logger[_0x8203('0x63')](_0x8203('0x84'),_0x4d0036[_0x8203('0x49')],_0x4d0036[_0x8203('0x55')]);this[_0x8203('0x10')][_0x2ab829['uniqueid']]=_0x4d0036;this[_0x8203('0x43')](_0x4d0036,_0x8203('0x1c'));}}}catch(_0x6c24e4){logger['error'](_0x8203('0x7b'),_0x2ab829[_0x8203('0x6f')],util[_0x8203('0x40')](_0x6c24e4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8203('0xa')][_0x8203('0x1e')]=function(_0x3a7c5d){try{if(this[_0x8203('0x60')](_0x3a7c5d)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x3a7c5d[_0x8203('0x6f')],util[_0x8203('0x40')](_0x3a7c5d,{'showHidden':![],'depth':null}));if(this[_0x8203('0xe')][_0x3a7c5d[_0x8203('0x6f')]]){var _0x23bd55=_[_0x8203('0x85')](this[_0x8203('0xe')][_0x3a7c5d[_0x8203('0x6f')]]);_0x23bd55[_0x8203('0x86')]=moment()[_0x8203('0x4d')](_0x8203('0x71'));_0x23bd55[_0x8203('0x87')]=_0x3a7c5d[_0x8203('0x87')];_0x23bd55['connectedlinename']=_0x3a7c5d[_0x8203('0x88')];logger['info'](_0x8203('0x89'),_0x23bd55[_0x8203('0x49')],_0x23bd55[_0x8203('0x55')],_0x3a7c5d[_0x8203('0x87')],_0x3a7c5d['connectedlinename']);this[_0x8203('0x10')][_0x3a7c5d[_0x8203('0x6f')]]=_0x23bd55;this[_0x8203('0x45')](_0x23bd55,_0x8203('0x1d'));}}}catch(_0x52bfc0){logger[_0x8203('0x3d')](_0x8203('0x8a'),_0x3a7c5d[_0x8203('0x6f')],util[_0x8203('0x40')](_0x52bfc0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8203('0xa')][_0x8203('0x22')]=function(_0x3e23c0){try{if(this['isNotNull'](_0x3e23c0)){logger['debug'](_0x8203('0x8b'),_0x3e23c0[_0x8203('0x6f')],util[_0x8203('0x40')](_0x3e23c0,{'showHidden':![],'depth':null}));if(this[_0x8203('0xe')][_0x3e23c0['uniqueid']]){var _0xd75fc8=_['last'](this[_0x8203('0xe')][_0x3e23c0[_0x8203('0x6f')]]);_0xd75fc8['queuecallercomplete']=!![];_0xd75fc8[_0x8203('0x81')]=_0x8203('0x8c');logger[_0x8203('0x63')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0xd75fc8['name'],_0xd75fc8['type']);}}}catch(_0x2a813e){logger['error'](_0x8203('0x8b'),_0x3e23c0[_0x8203('0x6f')],util[_0x8203('0x40')](_0x2a813e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8203('0xa')][_0x8203('0x20')]=function(_0x2dbb4d){try{if(this[_0x8203('0x60')](_0x2dbb4d)){logger[_0x8203('0x46')](_0x8203('0x8d'),_0x2dbb4d['uniqueid'],util[_0x8203('0x40')](_0x2dbb4d,{'showHidden':![],'depth':null}));if(this[_0x8203('0xe')][_0x2dbb4d[_0x8203('0x6f')]]){var _0x175656=_[_0x8203('0x85')](this['queueReports'][_0x2dbb4d[_0x8203('0x6f')]]);_0x175656[_0x8203('0x1c')]=![];_0x175656[_0x8203('0x80')]=null;_0x175656[_0x8203('0x8e')]=!![];_0x175656[_0x8203('0x83')]=_0x2dbb4d[_0x8203('0x8f')];_0x175656[_0x8203('0x7e')]=_0x2dbb4d[_0x8203('0x7e')];_0x175656[_0x8203('0x7c')]=!![];_0x175656[_0x8203('0x90')]=![];_0x175656[_0x8203('0x91')]=null;if(!_0x175656['transfer']){if(_0x2dbb4d[_0x8203('0x92')]=='transfer'){_0x175656[_0x8203('0x81')]=_0x8203('0x93');logger[_0x8203('0x63')](_0x8203('0x94'),_0x175656[_0x8203('0x49')],_0x175656[_0x8203('0x55')]);}else{if(_[_0x8203('0x95')](_0x2dbb4d[_0x8203('0x96')][_0x8203('0x97')](),'local/')){if(this['queueReports'][_0x2dbb4d[_0x8203('0x98')]]){var _0x2fc909=_[_0x8203('0x85')](this['queueReports'][_0x2dbb4d[_0x8203('0x98')]]);_0x2fc909[_0x8203('0x7c')]=![];_0x2fc909[_0x8203('0x90')]=!![];_0x2fc909[_0x8203('0x91')]=moment(_0x175656[_0x8203('0x70')])[_0x8203('0x99')](_0x2dbb4d['holdtime'],_0x8203('0x9a'))[_0x8203('0x4d')](_0x8203('0x71'));_0x2fc909[_0x8203('0x81')]=_0x8203('0x9b');_0x2fc909[_0x8203('0x9c')]=!![];_0x2fc909[_0x8203('0x9d')]=_0x8203('0x9e');_0x2fc909[_0x8203('0x9f')]=_0x2dbb4d[_0x8203('0xa0')];_0x2fc909[_0x8203('0xa1')]=_0x2dbb4d[_0x8203('0x6f')];logger[_0x8203('0x63')](_0x8203('0xa2'),_0x2fc909[_0x8203('0x49')],_0x2fc909[_0x8203('0x55')]);var _0x782a3d=this['queueReports'][_0x2dbb4d['linkedid']];this[_0x8203('0xe')][_0x2dbb4d[_0x8203('0x98')]]=this[_0x8203('0xe')][_0x2dbb4d[_0x8203('0x6f')]];this['queueReports'][_0x2dbb4d[_0x8203('0x6f')]]=_0x782a3d;}}else{_0x175656[_0x8203('0x81')]=_0x8203('0xa3')+_0x2dbb4d['reason']['toUpperCase']();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x175656['name'],_0x175656[_0x8203('0x55')],_0x175656['queuecallerexitreason']);}}}this['channels'][_0x2dbb4d['uniqueid']]=_0x175656;this[_0x8203('0x43')](_0x175656,_0x8203('0x1f'));}}}catch(_0x13b611){logger[_0x8203('0x3d')](_0x8203('0x8d'),_0x2dbb4d['uniqueid'],util[_0x8203('0x40')](_0x13b611,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x2e1045){try{if(this[_0x8203('0x60')](_0x2e1045)){logger[_0x8203('0x46')](_0x8203('0xa4'),_0x2e1045[_0x8203('0x6f')],util[_0x8203('0x40')](_0x2e1045,{'showHidden':![],'depth':null}));this['addVariable'](_0x2e1045[_0x8203('0x6f')],_['keys'](_0x2e1045[_0x8203('0xa5')])[0x0],_0x2e1045[_0x8203('0xa6')]);if(this[_0x8203('0xe')][_0x2e1045[_0x8203('0x6f')]]){var _0x270db1=_[_0x8203('0x85')](this[_0x8203('0xe')][_0x2e1045['uniqueid']]);if(_0x270db1){if(this['isNotNull'](_0x2e1045[_0x8203('0xa5')])&&this[_0x8203('0x60')](_0x2e1045[_0x8203('0xa5')]['queuestatus'])){switch(_0x2e1045[_0x8203('0xa6')]){case'CONTINUE':_0x270db1['queuecallerexit']=![];_0x270db1['queuecallerexitAt']=null;break;case'TIMEOUT':_0x270db1[_0x8203('0xa7')]='timeout';_0x270db1[_0x8203('0x90')]=!![];_0x270db1[_0x8203('0x91')]=moment()[_0x8203('0x4d')](_0x8203('0x71'));_0x270db1[_0x8203('0x86')]=moment()[_0x8203('0x4d')](_0x8203('0x71'));logger['debug'](_0x8203('0xa8'),_0x2e1045[_0x8203('0x6f')],util[_0x8203('0x40')](_0x270db1,{'showHidden':![],'depth':null}));ami[_0x8203('0x44')]('custom:timeout',_0x270db1);break;default:_0x270db1[_0x8203('0x90')]=!![];_0x270db1['queuecallerexitAt']=moment()[_0x8203('0x4d')](_0x8203('0x71'));_0x270db1[_0x8203('0x86')]=moment()['format'](_0x8203('0x71'));}_0x270db1[_0x8203('0x1c')]=![];_0x270db1['queuecallerabandonAt']=null;_0x270db1[_0x8203('0x81')]=_0x2e1045[_0x8203('0xa6')];this[_0x8203('0x10')][_0x2e1045[_0x8203('0x6f')]]=_0x270db1;this[_0x8203('0x43')](_0x270db1,_0x8203('0x23'));}else if(this['isNotNull'](_0x2e1045[_0x8203('0xa5')])&&this[_0x8203('0x60')](_0x2e1045[_0x8203('0xa5')][_0x8203('0xa9')])){if(!_0x270db1[_0x8203('0x1c')]){_0x270db1['queuecallerexit']=!![];_0x270db1['queuecallerexitAt']=moment()[_0x8203('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x270db1[_0x8203('0x81')]='EXITWITHKEY';_0x270db1[_0x8203('0x86')]=moment()[_0x8203('0x4d')](_0x8203('0x71'));this[_0x8203('0x10')][_0x2e1045[_0x8203('0x6f')]]=_0x270db1;}}logger['info'](_0x8203('0xaa'),_0x2e1045[_0x8203('0x6f')],_0x270db1[_0x8203('0x49')],_0x270db1['type'],_['keys'](_0x2e1045[_0x8203('0xa5')])[0x0],_0x2e1045[_0x8203('0xa6')]);_0x270db1[_0x8203('0x15')]=this[_0x8203('0x15')][_0x2e1045['uniqueid']];}}}}catch(_0x426322){logger[_0x8203('0x3d')](_0x8203('0xa4'),_0x2e1045[_0x8203('0x6f')],util[_0x8203('0x40')](_0x426322,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8203('0xab')]=function(_0x5239c9,_0x3ae6c2,_0x175c23){var _0x39fdfd=[_0x8203('0xac'),_0x8203('0xad'),_0x8203('0xae'),_0x8203('0xaf'),_0x8203('0xb0'),_0x8203('0xb1'),_0x8203('0xb2'),_0x8203('0xb3'),'sipcallid',_0x8203('0xb4'),_0x8203('0xb5'),'bridgepvtcallid','membercalls',_0x8203('0xb6'),_0x8203('0xb7'),_0x8203('0xb8'),_0x8203('0x8f'),_0x8203('0xb9'),'memberrealtime'];if(!_[_0x8203('0x38')](_0x3ae6c2)&&!_['includes'](_0x39fdfd,_0x3ae6c2)){if(_[_0x8203('0x5d')](this[_0x8203('0x15')][_0x5239c9])){this[_0x8203('0x15')][_0x5239c9]={};}this[_0x8203('0x15')][_0x5239c9][_0x3ae6c2]=_0x175c23;}};VoiceQueueReport['prototype']['syncHangup']=function(_0x58af07){try{if(this[_0x8203('0x60')](_0x58af07)){logger[_0x8203('0x46')](_0x8203('0xba'),_0x58af07[_0x8203('0x6f')],util[_0x8203('0x40')](_0x58af07,{'showHidden':![],'depth':null}));if(this[_0x8203('0xe')][_0x58af07['uniqueid']]){for(var _0x5d5ff4=0x0,_0xa8d93f={};_0x5d5ff40x0?_0x259b4c:0x0;this['voiceQueues'][_0x54e138[_0x8e36('0x67')]][_0x8e36('0x2e')]=this[_0x8e36('0x11')][_0x54e138[_0x8e36('0x67')]][_0x8e36('0x2e')]>_[_0x8e36('0x6c')](_0x54e138['loggedin'])?_[_0x8e36('0x6c')](_0x54e138[_0x8e36('0x6d')]):this['voiceQueues'][_0x54e138['queue']][_0x8e36('0x2e')];this[_0x8e36('0x6e')](this['voiceQueues'][_0x54e138[_0x8e36('0x67')]],_0x8e36('0x15'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x8e36('0x3f')](this[_0x8e36('0x11')][_0x54e138[_0x8e36('0x67')]],{'showHidden':![],'depth':null}));ami[_0x8e36('0x44')]('custom:queuesummary',this[_0x8e36('0x11')][_0x54e138[_0x8e36('0x67')]]);}}}catch(_0x18811a){logger[_0x8e36('0x3d')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x18811a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8e36('0xc')]['syncQueueSummaryComplete']=function(_0x5ea1e4){logger['debug'](_0x8e36('0x6f'),util['inspect'](_0x5ea1e4,{'showHidden':![],'depth':null}));ami[_0x8e36('0x44')](_0x8e36('0x70'),{});this[_0x8e36('0x12')]=!![];};VoiceQueueReport[_0x8e36('0xc')][_0x8e36('0x1a')]=function(_0x51cd6b){try{if(this['isNotNull'](_0x51cd6b)){logger[_0x8e36('0x46')](_0x8e36('0x71'),_0x51cd6b['uniqueid'],util[_0x8e36('0x3f')](_0x51cd6b,{'showHidden':![],'depth':null}));if(_[_0x8e36('0x62')](this[_0x8e36('0xf')][_0x51cd6b[_0x8e36('0x48')]]))this['queueReports'][_0x51cd6b[_0x8e36('0x48')]]=[];if(_[_0x8e36('0x62')](this[_0x8e36('0x32')][_0x51cd6b[_0x8e36('0x48')]]))this[_0x8e36('0x32')][_0x51cd6b['uniqueid']]={};var _0x51731a=new QueueReport();_0x51731a['name']=_0x51cd6b['queue'];_0x51731a[_0x8e36('0x52')]=this[_0x8e36('0x11')][_0x51731a[_0x8e36('0x4a')]]&&this['voiceQueues'][_0x51731a[_0x8e36('0x4a')]][_0x8e36('0x52')]?this['voiceQueues'][_0x51731a['name']][_0x8e36('0x52')]||'inbound':_0x8e36('0x53');_0x51731a[_0x8e36('0x67')]=_0x51cd6b[_0x8e36('0x67')];_0x51731a[_0x8e36('0x72')]=moment()[_0x8e36('0x60')](_0x8e36('0x73'));_0x51731a[_0x8e36('0x74')]=_0x51cd6b['position'];_0x51731a[_0x8e36('0x75')]=_0x51cd6b['count'];_0x51731a[_0x8e36('0x48')]=_0x51cd6b[_0x8e36('0x48')];_0x51731a[_0x8e36('0x76')]=this[_0x8e36('0x32')][_0x51cd6b[_0x8e36('0x48')]][_0x8e36('0x76')];logger[_0x8e36('0x68')](_0x8e36('0x77'),_0x51731a[_0x8e36('0x4a')],_0x51731a[_0x8e36('0x52')]);_[_0x8e36('0x78')](_0x51731a,_['pick'](_0x51cd6b,_[_0x8e36('0x79')](_0x51731a)));this[_0x8e36('0xf')][_0x51cd6b[_0x8e36('0x48')]][_0x8e36('0x7a')](_0x51731a);this[_0x8e36('0x32')][_0x51cd6b[_0x8e36('0x48')]]=_0x51731a;this[_0x8e36('0x45')](_0x51731a,'queuecallerjoin');}}catch(_0x48b590){logger['error'](_0x8e36('0x71'),_0x51cd6b[_0x8e36('0x48')],util[_0x8e36('0x3f')](_0x48b590,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8e36('0xc')][_0x8e36('0x7b')]=function(_0x2e8cd9){try{if(this[_0x8e36('0x61')](_0x2e8cd9)){logger[_0x8e36('0x46')](_0x8e36('0x7c'),_0x2e8cd9['uniqueid'],util[_0x8e36('0x3f')](_0x2e8cd9,{'showHidden':![],'depth':null}));if(this[_0x8e36('0xf')][_0x2e8cd9[_0x8e36('0x48')]]){var _0x27cc9d=_['last'](this[_0x8e36('0xf')][_0x2e8cd9[_0x8e36('0x48')]]);_0x27cc9d[_0x8e36('0x7d')]=![];_0x27cc9d[_0x8e36('0x7e')]=null;_0x27cc9d['holdtime']=_0x2e8cd9[_0x8e36('0x7f')];_0x27cc9d['originalposition']=_0x2e8cd9[_0x8e36('0x80')];_0x27cc9d[_0x8e36('0x1b')]=!![];_0x27cc9d['queuecallerabandonAt']=moment()['format'](_0x8e36('0x73'));_0x27cc9d['queuecallerexitreason']=_0x8e36('0x81');_0x27cc9d['lastAssignedTo']=null;logger[_0x8e36('0x68')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x27cc9d[_0x8e36('0x4a')],_0x27cc9d['type']);this[_0x8e36('0x32')][_0x2e8cd9[_0x8e36('0x48')]]=_0x27cc9d;this[_0x8e36('0x43')](_0x27cc9d,_0x8e36('0x1b'));}}}catch(_0x2797fd){logger[_0x8e36('0x3d')](_0x8e36('0x7c'),_0x2e8cd9[_0x8e36('0x48')],util['inspect'](_0x2797fd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8e36('0xc')][_0x8e36('0x82')]=function(_0x467223){try{if(this['isNotNull'](_0x467223)){logger[_0x8e36('0x46')](_0x8e36('0x83'),_0x467223[_0x8e36('0x48')],util[_0x8e36('0x3f')](_0x467223,{'showHidden':![],'depth':null}));if(this[_0x8e36('0xf')][_0x467223[_0x8e36('0x48')]]){var _0x586465=_[_0x8e36('0x84')](this[_0x8e36('0xf')][_0x467223[_0x8e36('0x48')]]);_0x586465[_0x8e36('0x85')]=moment()[_0x8e36('0x60')](_0x8e36('0x73'));_0x586465[_0x8e36('0x86')]=_0x467223[_0x8e36('0x86')];_0x586465['connectedlinename']=_0x467223[_0x8e36('0x87')];logger[_0x8e36('0x68')](_0x8e36('0x88'),_0x586465['name'],_0x586465[_0x8e36('0x52')],_0x467223['connectedlinenum'],_0x467223['connectedlinename']);this[_0x8e36('0x32')][_0x467223[_0x8e36('0x48')]]=_0x586465;this[_0x8e36('0x45')](_0x586465,_0x8e36('0x1c'));}}}catch(_0x58d170){logger[_0x8e36('0x3d')](_0x8e36('0x83'),_0x467223[_0x8e36('0x48')],util[_0x8e36('0x3f')](_0x58d170,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8e36('0xc')][_0x8e36('0x20')]=function(_0x4daedc){try{if(this[_0x8e36('0x61')](_0x4daedc)){logger['debug'](_0x8e36('0x89'),_0x4daedc[_0x8e36('0x48')],util[_0x8e36('0x3f')](_0x4daedc,{'showHidden':![],'depth':null}));if(this[_0x8e36('0xf')][_0x4daedc[_0x8e36('0x48')]]){var _0x4b6785=_[_0x8e36('0x84')](this[_0x8e36('0xf')][_0x4daedc[_0x8e36('0x48')]]);_0x4b6785[_0x8e36('0x7d')]=!![];_0x4b6785[_0x8e36('0x4e')]=_0x8e36('0x8a');logger[_0x8e36('0x68')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4b6785[_0x8e36('0x4a')],_0x4b6785[_0x8e36('0x52')]);}}}catch(_0x3203fb){logger[_0x8e36('0x3d')](_0x8e36('0x89'),_0x4daedc[_0x8e36('0x48')],util[_0x8e36('0x3f')](_0x3203fb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8e36('0x1e')]=function(_0x2cf55d){try{if(this[_0x8e36('0x61')](_0x2cf55d)){logger[_0x8e36('0x46')](_0x8e36('0x8b'),_0x2cf55d[_0x8e36('0x48')],util[_0x8e36('0x3f')](_0x2cf55d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2cf55d[_0x8e36('0x48')]]){var _0x568968=_[_0x8e36('0x84')](this[_0x8e36('0xf')][_0x2cf55d[_0x8e36('0x48')]]);_0x568968[_0x8e36('0x1b')]=![];_0x568968[_0x8e36('0x8c')]=null;_0x568968[_0x8e36('0x8d')]=!![];_0x568968[_0x8e36('0x8e')]=_0x2cf55d[_0x8e36('0x8f')];_0x568968[_0x8e36('0x7f')]=_0x2cf55d[_0x8e36('0x7f')];_0x568968[_0x8e36('0x7d')]=!![];_0x568968[_0x8e36('0x90')]=![];_0x568968['queuecallerexitAt']=null;if(!_0x568968[_0x8e36('0x91')]){if(_0x2cf55d[_0x8e36('0x92')]=='transfer'){_0x568968[_0x8e36('0x4e')]=_0x8e36('0x93');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x568968[_0x8e36('0x4a')],_0x568968[_0x8e36('0x52')]);}else{if(_[_0x8e36('0x94')](_0x2cf55d['channel']['toLowerCase'](),_0x8e36('0x95'))){if(this['queueReports'][_0x2cf55d['linkedid']]){var _0x5b03b3=_[_0x8e36('0x84')](this['queueReports'][_0x2cf55d[_0x8e36('0x96')]]);_0x5b03b3[_0x8e36('0x7d')]=![];_0x5b03b3['queuecallerexit']=!![];_0x5b03b3[_0x8e36('0x97')]=moment(_0x568968[_0x8e36('0x72')])[_0x8e36('0x98')](_0x2cf55d[_0x8e36('0x7f')],'seconds')['format'](_0x8e36('0x73'));_0x5b03b3['queuecallerexitreason']=_0x8e36('0x99');_0x5b03b3['transfer']=!![];_0x5b03b3[_0x8e36('0x9a')]=_0x8e36('0x9b');_0x5b03b3[_0x8e36('0x9c')]=_0x2cf55d[_0x8e36('0x9d')];_0x5b03b3[_0x8e36('0x9e')]=_0x2cf55d[_0x8e36('0x48')];logger[_0x8e36('0x68')](_0x8e36('0x9f'),_0x5b03b3[_0x8e36('0x4a')],_0x5b03b3[_0x8e36('0x52')]);var _0x5b3d6e=this[_0x8e36('0xf')][_0x2cf55d[_0x8e36('0x96')]];this['queueReports'][_0x2cf55d[_0x8e36('0x96')]]=this['queueReports'][_0x2cf55d['uniqueid']];this[_0x8e36('0xf')][_0x2cf55d[_0x8e36('0x48')]]=_0x5b3d6e;}}else{_0x568968[_0x8e36('0x4e')]=_0x8e36('0xa0')+_0x2cf55d['reason']['toUpperCase']();logger[_0x8e36('0x68')](_0x8e36('0xa1'),_0x568968[_0x8e36('0x4a')],_0x568968['type'],_0x568968[_0x8e36('0x4e')]);}}}this[_0x8e36('0x32')][_0x2cf55d['uniqueid']]=_0x568968;this[_0x8e36('0x43')](_0x568968,_0x8e36('0x1d'));}}}catch(_0xea5868){logger[_0x8e36('0x3d')](_0x8e36('0x8b'),_0x2cf55d[_0x8e36('0x48')],util['inspect'](_0xea5868,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8e36('0xc')]['syncVarSet']=function(_0x37644f){try{if(this[_0x8e36('0x61')](_0x37644f)){logger[_0x8e36('0x46')]('[%s][voiceQueueReport][varset]',_0x37644f[_0x8e36('0x48')],util[_0x8e36('0x3f')](_0x37644f,{'showHidden':![],'depth':null}));this[_0x8e36('0xa2')](_0x37644f[_0x8e36('0x48')],_[_0x8e36('0x79')](_0x37644f['variable'])[0x0],_0x37644f[_0x8e36('0xa3')]);if(this[_0x8e36('0xf')][_0x37644f['uniqueid']]){var _0xf403ba=_[_0x8e36('0x84')](this[_0x8e36('0xf')][_0x37644f[_0x8e36('0x48')]]);if(_0xf403ba){if(this[_0x8e36('0x61')](_0x37644f['variable'])&&this[_0x8e36('0x61')](_0x37644f[_0x8e36('0xa4')][_0x8e36('0xa5')])){switch(_0x37644f['value']){case'CONTINUE':_0xf403ba['queuecallerexit']=![];_0xf403ba['queuecallerexitAt']=null;break;case _0x8e36('0xa6'):_0xf403ba[_0x8e36('0xa7')]=_0x8e36('0xa8');_0xf403ba[_0x8e36('0x90')]=!![];_0xf403ba['queuecallerexitAt']=moment()[_0x8e36('0x60')](_0x8e36('0x73'));_0xf403ba[_0x8e36('0x85')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x8e36('0x46')](_0x8e36('0xa9'),_0x37644f[_0x8e36('0x48')],util[_0x8e36('0x3f')](_0xf403ba,{'showHidden':![],'depth':null}));ami[_0x8e36('0x44')](_0x8e36('0xaa'),_0xf403ba);break;default:_0xf403ba['queuecallerexit']=!![];_0xf403ba[_0x8e36('0x97')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xf403ba[_0x8e36('0x85')]=moment()['format'](_0x8e36('0x73'));}_0xf403ba['queuecallerabandon']=![];_0xf403ba[_0x8e36('0x8c')]=null;_0xf403ba[_0x8e36('0x4e')]=_0x37644f[_0x8e36('0xa3')];this['channels'][_0x37644f[_0x8e36('0x48')]]=_0xf403ba;this['emitVoiceQueueChannelRemove'](_0xf403ba,_0x8e36('0xab'));}else if(this['isNotNull'](_0x37644f[_0x8e36('0xa4')])&&this[_0x8e36('0x61')](_0x37644f[_0x8e36('0xa4')][_0x8e36('0xac')])){if(!_0xf403ba[_0x8e36('0x1b')]){_0xf403ba[_0x8e36('0x90')]=!![];_0xf403ba[_0x8e36('0x97')]=moment()['format'](_0x8e36('0x73'));_0xf403ba[_0x8e36('0x4e')]=_0x8e36('0xad');_0xf403ba['queuecallerleaveAt']=moment()[_0x8e36('0x60')](_0x8e36('0x73'));this['channels'][_0x37644f[_0x8e36('0x48')]]=_0xf403ba;}}logger[_0x8e36('0x68')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x37644f[_0x8e36('0x48')],_0xf403ba[_0x8e36('0x4a')],_0xf403ba['type'],_[_0x8e36('0x79')](_0x37644f[_0x8e36('0xa4')])[0x0],_0x37644f['value']);_0xf403ba[_0x8e36('0x14')]=this[_0x8e36('0x14')][_0x37644f[_0x8e36('0x48')]];}}}}catch(_0x4df2f1){logger[_0x8e36('0x3d')](_0x8e36('0xae'),_0x37644f[_0x8e36('0x48')],util[_0x8e36('0x3f')](_0x4df2f1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8e36('0xc')][_0x8e36('0xa2')]=function(_0x52f4b8,_0x3c2ad2,_0x3d069d){var _0x376619=[_0x8e36('0xaf'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x8e36('0xb0'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x8e36('0xb1'),_0x8e36('0xb2'),_0x8e36('0xb3'),'sipuri',_0x8e36('0xb4'),_0x8e36('0xb5'),_0x8e36('0xb6'),_0x8e36('0xb7'),_0x8e36('0xb8'),_0x8e36('0xb9'),_0x8e36('0x8f'),_0x8e36('0xba'),_0x8e36('0xbb')];if(!_[_0x8e36('0x36')](_0x3c2ad2)&&!_['includes'](_0x376619,_0x3c2ad2)){if(_[_0x8e36('0x62')](this[_0x8e36('0x14')][_0x52f4b8])){this[_0x8e36('0x14')][_0x52f4b8]={};}this[_0x8e36('0x14')][_0x52f4b8][_0x3c2ad2]=_0x3d069d;}};VoiceQueueReport['prototype'][_0x8e36('0x22')]=function(_0x31ac6c){try{if(this[_0x8e36('0x61')](_0x31ac6c)){logger[_0x8e36('0x46')](_0x8e36('0xbc'),_0x31ac6c['uniqueid'],util['inspect'](_0x31ac6c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x31ac6c[_0x8e36('0x48')]]){for(var _0x1d275a=0x0,_0x5ae617={};_0x1d275a=0x0?moment(_0x168a87[_0x3269('0x16')])[_0x3269('0xd')](_0x168a87['starttime'],_0x3269('0x17')):null,'data1':_0x3269('0x18'),'data2':_0x168a87[_0x3269('0x10')],'data3':_0x168a87[_0x3269('0xe')],'data4':_0x168a87[_0x3269('0x19')]||null,'role':'agent','internal':_0x168a87['accountcode']?_[_0x3269('0x11')](_0x168a87['accountcode']):undefined,'uniqueid':_0x168a87[_0x3269('0x12')]},'log':_0x3269('0x6')});}; \ No newline at end of file +var _0xf2d6=['voice','isNil','format','SIP/%s','interface','TALKING','diff','seconds','inbound','exten','queue','agent','toNumber','uniqueid','voiceDialReport','membername','starttime','endtime','outbound','accountcode','dialstring','moment','lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport'];(function(_0xf5d4a6,_0x5ac12a){var _0x16e333=function(_0x5e4203){while(--_0x5e4203){_0xf5d4a6['push'](_0xf5d4a6['shift']());}};_0x16e333(++_0x5ac12a);}(_0xf2d6,0xfd));var _0x6f2d=function(_0x5a57cb,_0x1a720a){_0x5a57cb=_0x5a57cb-0x0;var _0xf204fa=_0xf2d6[_0x5a57cb];return _0xf204fa;};'use strict';var moment=require(_0x6f2d('0x0'));var _=require(_0x6f2d('0x1'));var util=require('util');var client=require(_0x6f2d('0x2'));exports[_0x6f2d('0x3')]=function(_0x95c60c){var _0x4e5470=_0x95c60c[_0x6f2d('0x4')]||_0x95c60c[_0x6f2d('0x5')];return client[_0x6f2d('0x6')](_0x6f2d('0x7'),{'body':{'channel':_0x6f2d('0x8'),'membername':_0x95c60c['lastAssignedTo'],'interface':_[_0x6f2d('0x9')](_0x95c60c['interface'])?util[_0x6f2d('0xa')](_0x6f2d('0xb'),_0x95c60c['lastAssignedTo']):_0x95c60c[_0x6f2d('0xc')],'type':_0x6f2d('0xd'),'enterAt':_0x95c60c['queuecallerleaveAt'],'exitAt':_0x4e5470,'duration':moment(_0x4e5470)[_0x6f2d('0xe')](_0x95c60c['queuecallerleaveAt'],_0x6f2d('0xf')),'data1':_0x6f2d('0x10'),'data2':_0x95c60c['calleridnum'],'data3':_0x95c60c[_0x6f2d('0x11')],'data4':null,'data5':_0x95c60c[_0x6f2d('0x12')],'role':_0x6f2d('0x13'),'internal':_0x95c60c['accountcode']?_[_0x6f2d('0x14')](_0x95c60c['accountcode']):undefined,'uniqueid':_0x95c60c[_0x6f2d('0x15')]},'log':_0x6f2d('0x7')});};exports[_0x6f2d('0x16')]=function(_0x26982b){return client[_0x6f2d('0x6')](_0x6f2d('0x7'),{'body':{'channel':_0x6f2d('0x8'),'membername':_0x26982b[_0x6f2d('0x17')],'interface':_0x26982b['interface'],'type':_0x6f2d('0xd'),'enterAt':_0x26982b[_0x6f2d('0x18')],'exitAt':_0x26982b['endtime'],'duration':moment(_0x26982b[_0x6f2d('0x19')])[_0x6f2d('0xe')](_0x26982b[_0x6f2d('0x18')],_0x6f2d('0xf'))>=0x0?moment(_0x26982b[_0x6f2d('0x19')])[_0x6f2d('0xe')](_0x26982b[_0x6f2d('0x18')],_0x6f2d('0xf')):null,'data1':_0x6f2d('0x1a'),'data2':_0x26982b[_0x6f2d('0x1b')],'data3':_0x26982b[_0x6f2d('0x11')],'data4':_0x26982b[_0x6f2d('0x1c')]||null,'role':_0x6f2d('0x13'),'internal':_0x26982b[_0x6f2d('0x1b')]?_[_0x6f2d('0x14')](_0x26982b[_0x6f2d('0x1b')]):undefined,'uniqueid':_0x26982b[_0x6f2d('0x15')]},'log':_0x6f2d('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index ac577be..6c46351 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 _0x4b20=['Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings'];(function(_0x306ce9,_0x5308c6){var _0x3f653d=function(_0x45352e){while(--_0x45352e){_0x306ce9['push'](_0x306ce9['shift']());}};_0x3f653d(++_0x5308c6);}(_0x4b20,0x116));var _0x04b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b20[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x04b2('0x0'));exports[_0x04b2('0x1')]=function(){return client[_0x04b2('0x2')](_0x04b2('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x04b2('0x4'),_0x04b2('0x5')]},'log':_0x04b2('0x6')});}; \ No newline at end of file +var _0xb676=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','../client','Request'];(function(_0x4d2c8b,_0xc753cd){var _0x4dbdb0=function(_0x1290a5){while(--_0x1290a5){_0x4d2c8b['push'](_0x4d2c8b['shift']());}};_0x4dbdb0(++_0xc753cd);}(_0xb676,0xbc));var _0x6b67=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0xb676[_0x2ca9d4];return _0x258956;};'use strict';var client=require(_0x6b67('0x0'));exports['getSettings']=function(){return client[_0x6b67('0x1')](_0x6b67('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6b67('0x3'),_0x6b67('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 2701967..3751a48 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 _0x7c63=['GetTemplate','name','html','../client','getTemplates'];(function(_0x31757a,_0x2e8602){var _0x47de6d=function(_0x515a57){while(--_0x515a57){_0x31757a['push'](_0x31757a['shift']());}};_0x47de6d(++_0x2e8602);}(_0x7c63,0xf3));var _0x37c6=function(_0x2a468b,_0x56add9){_0x2a468b=_0x2a468b-0x0;var _0xd02803=_0x7c63[_0x2a468b];return _0xd02803;};'use strict';var client=require(_0x37c6('0x0'));exports[_0x37c6('0x1')]=function(_0x3307a9){return function(_0x20a725){return client['Request'](_0x37c6('0x2'),{'options':{'raw':!![],'attributes':['id',_0x37c6('0x3'),_0x37c6('0x4')]},'log':_0x37c6('0x2')});};}; \ No newline at end of file +var _0x75af=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x246115,_0x398123){var _0x385878=function(_0x534a9c){while(--_0x534a9c){_0x246115['push'](_0x246115['shift']());}};_0x385878(++_0x398123);}(_0x75af,0x17d));var _0xf75a=function(_0x5856e4,_0x4785b7){_0x5856e4=_0x5856e4-0x0;var _0x51ef7c=_0x75af[_0x5856e4];return _0x51ef7c;};'use strict';var client=require(_0xf75a('0x0'));exports[_0xf75a('0x1')]=function(_0x435961){return function(_0x424df8){return client[_0xf75a('0x2')](_0xf75a('0x3'),{'options':{'raw':!![],'attributes':['id',_0xf75a('0x4'),_0xf75a('0x5')]},'log':_0xf75a('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 848c841..38bebb7 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 _0x28cd=['data2','data4','data5','data6','data7','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','action','data1'];(function(_0x53a393,_0x2e3db){var _0x3a8248=function(_0x499279){while(--_0x499279){_0x53a393['push'](_0x53a393['shift']());}};_0x3a8248(++_0x2e3db);}(_0x28cd,0x135));var _0xd28c=function(_0x2a8ff8,_0x474830){_0x2a8ff8=_0x2a8ff8-0x0;var _0x1702f1=_0x28cd[_0x2a8ff8];return _0x1702f1;};'use strict';var client=require('../client');exports[_0xd28c('0x0')]=function(_0x3b027b){return function(_0x3b0e8d){return client[_0xd28c('0x1')](_0xd28c('0x2'),{'options':{'raw':![],'attributes':['id',_0xd28c('0x3'),_0xd28c('0x4'),_0xd28c('0x5')],'include':[{'model':_0xd28c('0x6'),'as':_0xd28c('0x7'),'attributes':['id',_0xd28c('0x8'),_0xd28c('0x9'),_0xd28c('0xa')]},{'model':'Condition','as':_0xd28c('0xb'),'attributes':['id',_0xd28c('0x8'),_0xd28c('0x9'),_0xd28c('0xa')]},{'model':'Action','as':'Actions','attributes':['id',_0xd28c('0xc'),_0xd28c('0xd'),_0xd28c('0xe'),'data3',_0xd28c('0xf'),_0xd28c('0x10'),_0xd28c('0x11'),_0xd28c('0x12')]}]},'log':_0xd28c('0x2')});};}; \ No newline at end of file +var _0xaaa2=['action','data1','data3','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','operator','value','AnyConditions','field','Action','Actions'];(function(_0x5da794,_0xf1cf6){var _0x2517ad=function(_0xd052e3){while(--_0xd052e3){_0x5da794['push'](_0x5da794['shift']());}};_0x2517ad(++_0xf1cf6);}(_0xaaa2,0x195));var _0x2aaa=function(_0x44c96b,_0x5e1812){_0x44c96b=_0x44c96b-0x0;var _0x47c673=_0xaaa2[_0x44c96b];return _0x47c673;};'use strict';var client=require(_0x2aaa('0x0'));exports[_0x2aaa('0x1')]=function(_0x1fa848){return function(_0xc236b8){return client[_0x2aaa('0x2')](_0x2aaa('0x3'),{'options':{'raw':![],'attributes':['id',_0x2aaa('0x4'),_0x2aaa('0x5'),_0x2aaa('0x6')],'include':[{'model':_0x2aaa('0x7'),'as':_0x2aaa('0x8'),'attributes':['id','field',_0x2aaa('0x9'),_0x2aaa('0xa')]},{'model':_0x2aaa('0x7'),'as':_0x2aaa('0xb'),'attributes':['id',_0x2aaa('0xc'),_0x2aaa('0x9'),'value']},{'model':_0x2aaa('0xd'),'as':_0x2aaa('0xe'),'attributes':['id',_0x2aaa('0xf'),_0x2aaa('0x10'),'data2',_0x2aaa('0x11'),'data4',_0x2aaa('0x12'),_0x2aaa('0x13'),_0x2aaa('0x14')]}]},'log':_0x2aaa('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 5e2613a..bdb225e 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 _0xa04d=['getTrunks','Request','GetTrunk','name','registry'];(function(_0x4578af,_0x57fbe5){var _0x3e4872=function(_0x3e5e46){while(--_0x3e5e46){_0x4578af['push'](_0x4578af['shift']());}};_0x3e4872(++_0x57fbe5);}(_0xa04d,0x118));var _0xda04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa04d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xda04('0x0')]=function(_0x33cc53){return function(_0x5db738){return client[_0xda04('0x1')](_0xda04('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xda04('0x3'),_0xda04('0x4'),'defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xd3ee=['registry','GetTrunk','../client','getTrunks','Request','name'];(function(_0x52d7f2,_0x396a9e){var _0x4250cf=function(_0xc68f89){while(--_0xc68f89){_0x52d7f2['push'](_0x52d7f2['shift']());}};_0x4250cf(++_0x396a9e);}(_0xd3ee,0x1b2));var _0xed3e=function(_0x41b133,_0x114320){_0x41b133=_0x41b133-0x0;var _0x844201=_0xd3ee[_0x41b133];return _0x844201;};'use strict';var client=require(_0xed3e('0x0'));exports[_0xed3e('0x1')]=function(_0x51c2e0){return function(_0x1f4434){return client[_0xed3e('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xed3e('0x3'),_0xed3e('0x4'),'defaultuser']},'log':_0xed3e('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 10b46b3..f12c2d1 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 _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x31c378,_0x354ea2){var _0x383517=function(_0xab73cd){while(--_0xab73cd){_0x31c378['push'](_0x31c378['shift']());}};_0x383517(++_0x354ea2);}(_0xedd9,0xfc));var _0x9edd=function(_0xab0515,_0x4b8ab2){_0xab0515=_0xab0515-0x0;var _0x443d59=_0xedd9[_0xab0515];return _0x443d59;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 4d217ed..03b8ec7 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 _0x61ce=['../client','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0x47f719,_0x2e559d){var _0x407f4e=function(_0x2be03a){while(--_0x2be03a){_0x47f719['push'](_0x47f719['shift']());}};_0x407f4e(++_0x2e559d);}(_0x61ce,0x127));var _0xe61c=function(_0x433531,_0x40179d){_0x433531=_0x433531-0x0;var _0x392d08=_0x61ce[_0x433531];return _0x392d08;};'use strict';var client=require(_0xe61c('0x0'));exports['create']=function(_0x24ab3a){return client['Request'](_0xe61c('0x1'),{'body':_0x24ab3a,'log':'CreateVoiceAgentReport'});};exports[_0xe61c('0x2')]=function(_0x22b589,_0x29011e,_0x31eff0){return client[_0xe61c('0x3')](_0xe61c('0x4'),{'body':_0x22b589,'options':{'where':{'uniqueid':_0x29011e,'interface':_0x31eff0,'agentcomplete':!![]}},'log':_0xe61c('0x4')});}; \ No newline at end of file +var _0xba03=['CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','Request'];(function(_0x56c32f,_0x3304ec){var _0x20338e=function(_0x343925){while(--_0x343925){_0x56c32f['push'](_0x56c32f['shift']());}};_0x20338e(++_0x3304ec);}(_0xba03,0x1d6));var _0x3ba0=function(_0x5a307c,_0x42446d){_0x5a307c=_0x5a307c-0x0;var _0x5e6dba=_0xba03[_0x5a307c];return _0x5e6dba;};'use strict';var client=require(_0x3ba0('0x0'));exports['create']=function(_0x557751){return client[_0x3ba0('0x1')](_0x3ba0('0x2'),{'body':_0x557751,'log':_0x3ba0('0x2')});};exports['update']=function(_0x204c77,_0x1306f9,_0x2e138c){return client[_0x3ba0('0x1')](_0x3ba0('0x3'),{'body':_0x204c77,'options':{'where':{'uniqueid':_0x1306f9,'interface':_0x2e138c,'agentcomplete':!![]}},'log':_0x3ba0('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 9f14b6b..9d374b5 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 _0x4755=['YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','GetVoiceCallReport','startOf','format'];(function(_0x59eca4,_0xec28a5){var _0x30d5fe=function(_0x3fa4bb){while(--_0x3fa4bb){_0x59eca4['push'](_0x59eca4['shift']());}};_0x30d5fe(++_0xec28a5);}(_0x4755,0x191));var _0x5475=function(_0x23c3f4,_0x24f0b3){_0x23c3f4=_0x23c3f4-0x0;var _0x82f0f1=_0x4755[_0x23c3f4];return _0x82f0f1;};'use strict';var moment=require('moment');var util=require(_0x5475('0x0'));var _=require(_0x5475('0x1'));var client=require(_0x5475('0x2'));exports[_0x5475('0x3')]=function(_0x4e7747){return client[_0x5475('0x4')](_0x5475('0x5'),{'body':_[_0x5475('0x6')](_0x4e7747,{'source':_0x4e7747[_0x5475('0x7')],'destinationcontext':_0x4e7747['context'],'callerid':_0x4e7747[_0x5475('0x8')],'amaflags':_0x5475('0x9')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0x5475('0x4')](_0x5475('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x5475('0xb')]('day')[_0x5475('0xc')](_0x5475('0xd')),moment()[_0x5475('0xe')]('day')[_0x5475('0xc')](_0x5475('0xd'))]}},'attributes':[_0x5475('0xf'),'disposition',_0x5475('0x10'),'billableseconds']},'log':_0x5475('0x11')});};}; \ No newline at end of file +var _0xb52a=['format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','billableseconds','GetVoiceCallReports','lodash','create','CreateVoiceCallReport','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf','day'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb52a,0x85));var _0xab52=function(_0x10df1e,_0xf56f85){_0x10df1e=_0x10df1e-0x0;var _0x3e24fb=_0xb52a[_0x10df1e];return _0x3e24fb;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0xab52('0x0'));var client=require('../client');exports[_0xab52('0x1')]=function(_0x261b21){return client['Request'](_0xab52('0x2'),{'body':_['merge'](_0x261b21,{'source':_0x261b21['calleridnum'],'destinationcontext':_0x261b21['context'],'callerid':_0x261b21[_0xab52('0x3')],'amaflags':_0xab52('0x4')}),'log':_0xab52('0x2')});};exports[_0xab52('0x5')]=function(){return function(){return client[_0xab52('0x6')](_0xab52('0x7'),{'options':{'where':{'type':[_0xab52('0x8')],'createdAt':{'$between':[moment()[_0xab52('0x9')](_0xab52('0xa'))[_0xab52('0xb')](_0xab52('0xc')),moment()[_0xab52('0xd')](_0xab52('0xa'))[_0xab52('0xb')](_0xab52('0xc'))]}},'attributes':[_0xab52('0xe'),_0xab52('0xf'),'duration',_0xab52('0x10')]},'log':_0xab52('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 3f1c689..317be3c 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 _0x016c=['CreateVoiceDialReport','../client','create'];(function(_0x5755b2,_0xafac09){var _0x1bcadf=function(_0x6d1c24){while(--_0x6d1c24){_0x5755b2['push'](_0x5755b2['shift']());}};_0x1bcadf(++_0xafac09);}(_0x016c,0x19c));var _0xc016=function(_0x521eaf,_0x57eba7){_0x521eaf=_0x521eaf-0x0;var _0x5db465=_0x016c[_0x521eaf];return _0x5db465;};'use strict';var client=require(_0xc016('0x0'));exports[_0xc016('0x1')]=function(_0x48cc23){return client['Request'](_0xc016('0x2'),{'body':_0x48cc23,'log':_0xc016('0x2')});}; \ No newline at end of file +'use strict';var client=require('../client');exports['create']=function(_0x14b164){return client['Request']('CreateVoiceDialReport',{'body':_0x14b164,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index eafe2b0..81545b1 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 _0x7117=['GetVoiceExtension','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x176f4f,_0x35bfed){var _0x6185d2=function(_0x4c276c){while(--_0x4c276c){_0x176f4f['push'](_0x176f4f['shift']());}};_0x6185d2(++_0x35bfed);}(_0x7117,0x1ec));var _0x7711=function(_0x134f3b,_0x22f283){_0x134f3b=_0x134f3b-0x0;var _0x3917c9=_0x7117[_0x134f3b];return _0x3917c9;};'use strict';var client=require(_0x7711('0x0'));exports[_0x7711('0x1')]=function(){return function(){return client[_0x7711('0x2')](_0x7711('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x7711('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x7711('0x1')});};}; \ No newline at end of file +var _0x39c4=['getVoiceExtensions','exten','recordingFormat'];(function(_0x410608,_0x221982){var _0x387125=function(_0x50a540){while(--_0x50a540){_0x410608['push'](_0x410608['shift']());}};_0x387125(++_0x221982);}(_0x39c4,0x174));var _0x439c=function(_0x1b1adf,_0x62e634){_0x1b1adf=_0x1b1adf-0x0;var _0x21c223=_0x39c4[_0x1b1adf];return _0x21c223;};'use strict';var client=require('../client');exports[_0x439c('0x0')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x439c('0x1'),_0x439c('0x2')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 8885b49..835892d 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 _0x97f4=['dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97f4,0x166));var _0x497f=function(_0x248bd7,_0x1178aa){_0x248bd7=_0x248bd7-0x0;var _0x5d356c=_0x97f4[_0x248bd7];return _0x5d356c;};'use strict';var client=require(_0x497f('0x0'));exports[_0x497f('0x1')]=function(){return function(){return client[_0x497f('0x2')](_0x497f('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x497f('0x4'),_0x497f('0x5'),_0x497f('0x6'),_0x497f('0x7'),_0x497f('0x8'),'dialActive','dialMethod',_0x497f('0x9'),_0x497f('0xa'),_0x497f('0xb'),_0x497f('0xc'),_0x497f('0xd'),_0x497f('0xe'),_0x497f('0xf'),'dialOriginateCallerIdNumber',_0x497f('0x10'),_0x497f('0x11'),'dialQueueTimeout','dialQueueProject',_0x497f('0x12'),_0x497f('0x13'),_0x497f('0x14'),_0x497f('0x15'),_0x497f('0x16'),_0x497f('0x17'),_0x497f('0x18'),_0x497f('0x19'),_0x497f('0x1a'),_0x497f('0x1b'),_0x497f('0x1c'),_0x497f('0x1d'),'dialAMDInitialSilence',_0x497f('0x1e'),_0x497f('0x1f'),_0x497f('0x20'),_0x497f('0x21'),'dialAMDBetweenWordsSilence',_0x497f('0x22'),_0x497f('0x23'),_0x497f('0x24'),_0x497f('0x25'),'dialRecallMeTimeout',_0x497f('0x26'),_0x497f('0x27'),_0x497f('0x28'),_0x497f('0x29'),'dialQueueProject2',_0x497f('0x7'),'strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x497f('0x2a'),_0x497f('0x2b'),_0x497f('0x2c'),'dialDropRetryFrequency',_0x497f('0x2d'),_0x497f('0x2e'),_0x497f('0x2f'),_0x497f('0x30'),_0x497f('0x31'),_0x497f('0x32'),'mandatoryDisposition',_0x497f('0x33'),'dialPredictiveIntervalMinThreshold',_0x497f('0x34'),_0x497f('0x35')],'include':[{'model':'Trunk','as':_0x497f('0x36'),'attributes':['id',_0x497f('0x37'),_0x497f('0x38'),_0x497f('0x39')]},{'model':'Pause','as':_0x497f('0x3a'),'attributes':['id',_0x497f('0x37')]},{'model':_0x497f('0x36'),'as':_0x497f('0x3b'),'attributes':['id',_0x497f('0x37'),_0x497f('0x38'),_0x497f('0x39')]},{'model':'Interval','as':_0x497f('0x3c'),'attributes':['id',_0x497f('0x37')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x497f('0x37'),_0x497f('0x3d')]}]}]},'log':_0x497f('0x1')});};}; \ No newline at end of file +var _0x773b=['dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','dialCutDigit','dialNoSuchNumberMaxRetry'];(function(_0x22185b,_0x1f1beb){var _0x27c904=function(_0x25685b){while(--_0x25685b){_0x22185b['push'](_0x22185b['shift']());}};_0x27c904(++_0x1f1beb);}(_0x773b,0x17a));var _0xb773=function(_0x532ecd,_0x1df646){_0x532ecd=_0x532ecd-0x0;var _0xdb8b04=_0x773b[_0x532ecd];return _0xdb8b04;};'use strict';var client=require(_0xb773('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xb773('0x1')](_0xb773('0x2'),{'options':{'raw':![],'attributes':['id',_0xb773('0x3'),_0xb773('0x4'),_0xb773('0x5'),_0xb773('0x6'),_0xb773('0x7'),_0xb773('0x8'),'dialActive',_0xb773('0x9'),'dialLimitChannel',_0xb773('0xa'),'dialPowerLevel',_0xb773('0xb'),_0xb773('0xc'),_0xb773('0xd'),_0xb773('0xe'),_0xb773('0xf'),'dialOriginateTimeout',_0xb773('0x10'),'dialQueueTimeout',_0xb773('0x11'),_0xb773('0x12'),_0xb773('0x13'),_0xb773('0x14'),_0xb773('0x15'),_0xb773('0x16'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0xb773('0x17'),_0xb773('0x18'),'dialPrefix',_0xb773('0x19'),_0xb773('0x1a'),_0xb773('0x1b'),_0xb773('0x1c'),'dialAMDAfterGreetingSilence',_0xb773('0x1d'),_0xb773('0x1e'),'dialAMDBetweenWordsSilence',_0xb773('0x1f'),_0xb773('0x20'),_0xb773('0x21'),_0xb773('0x22'),_0xb773('0x23'),_0xb773('0x24'),_0xb773('0x25'),_0xb773('0x26'),'dialAgiAfterHangupClient',_0xb773('0x27'),_0xb773('0x7'),'strategy','dialRandomLastDigitCallerIdNumber',_0xb773('0x28'),_0xb773('0x29'),_0xb773('0x2a'),'dialDropMaxRetry',_0xb773('0x2b'),_0xb773('0x2c'),_0xb773('0x2d'),_0xb773('0x2e'),_0xb773('0x2f'),_0xb773('0x30'),'dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0xb773('0x31'),_0xb773('0x32'),_0xb773('0x33')],'include':[{'model':_0xb773('0x34'),'as':_0xb773('0x34'),'attributes':['id',_0xb773('0x3'),'callerid','active']},{'model':_0xb773('0x35'),'as':_0xb773('0x36'),'attributes':['id',_0xb773('0x3')]},{'model':_0xb773('0x34'),'as':_0xb773('0x37'),'attributes':['id',_0xb773('0x3'),_0xb773('0x38'),'active']},{'model':'Interval','as':_0xb773('0x39'),'attributes':['id',_0xb773('0x3')],'include':[{'model':_0xb773('0x39'),'as':_0xb773('0x3a'),'attributes':['id',_0xb773('0x3'),'interval']}]}]},'log':_0xb773('0x3b')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index ea97ae4..7f7f197 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(_0x1fe6b1,_0x10d0eb){var _0x1048c0=function(_0x3fe72e){while(--_0x3fe72e){_0x1fe6b1['push'](_0x1fe6b1['shift']());}};_0x1048c0(++_0x10d0eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x2606d6,_0x1b0849){var _0x1ffa92=function(_0x174324){while(--_0x174324){_0x2606d6['push'](_0x2606d6['shift']());}};_0x1ffa92(++_0x1b0849);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 6f927f1..213c00b 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 _0xdf4b=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x236a00,_0x8844fc){var _0x18d816=function(_0x3b0928){while(--_0x3b0928){_0x236a00['push'](_0x236a00['shift']());}};_0x18d816(++_0x8844fc);}(_0xdf4b,0x1df));var _0xbdf4=function(_0x4be5f4,_0x2fc7c4){_0x4be5f4=_0x4be5f4-0x0;var _0x464b83=_0xdf4b[_0x4be5f4];return _0x464b83;};'use strict';var client=require(_0xbdf4('0x0'));exports[_0xbdf4('0x1')]=function(_0x51dee4){return function(){return client[_0xbdf4('0x2')](_0xbdf4('0x3'),{'options':{'where':{'VoiceQueueId':_0x51dee4,'paused':!![]},'raw':!![]},'log':_0xbdf4('0x1')});};}; \ No newline at end of file +var _0xdd63=['GetVoiceQueueRtPauses','../client','Request'];(function(_0x184ae4,_0x511d97){var _0x5bb118=function(_0x2af1c3){while(--_0x2af1c3){_0x184ae4['push'](_0x184ae4['shift']());}};_0x5bb118(++_0x511d97);}(_0xdd63,0x14e));var _0x3dd6=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xdd63[_0x311c35];return _0x5cc50c;};'use strict';var client=require(_0x3dd6('0x0'));exports['getVoiceQueueRtPauses']=function(_0x1523c4){return function(){return client[_0x3dd6('0x1')](_0x3dd6('0x2'),{'options':{'where':{'VoiceQueueId':_0x1523c4,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index e44e431..ebf2ad1 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(_0x5a886f,_0x410341){var _0x22defd=function(_0x45bff6){while(--_0x45bff6){_0x5a886f['push'](_0x5a886f['shift']());}};_0x22defd(++_0x410341);}(_0x7a54,0x106));var _0x47a5=function(_0x1b4968,_0x13c141){_0x1b4968=_0x1b4968-0x0;var _0x338246=_0x7a54[_0x1b4968];return _0x338246;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x16277e,_0x216917){var _0x3f2f9b=function(_0x4a9846){while(--_0x4a9846){_0x16277e['push'](_0x16277e['shift']());}};_0x3f2f9b(++_0x216917);}(_0x7a54,0x106));var _0x47a5=function(_0x47fb8f,_0x21c89f){_0x47fb8f=_0x47fb8f-0x0;var _0x540898=_0x7a54[_0x47fb8f];return _0x540898;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 84637ac..da4cb8c 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 _0x2683=['secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname'];(function(_0x166bad,_0x46be9b){var _0xdf317d=function(_0x8e47f2){while(--_0x8e47f2){_0x166bad['push'](_0x166bad['shift']());}};_0xdf317d(++_0x46be9b);}(_0x2683,0x12c));var _0x3268=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x2683[_0x5f309e];return _0x487b5e;};'use strict';var client=require('../client');exports['transfers']={};exports['blindTransfer']=function(_0x50fe23){return client['Request'](_0x3268('0x0'),{'body':{'result':_0x50fe23[_0x3268('0x1')],'transfererchannel':_0x50fe23[_0x3268('0x2')],'transferercalleridnum':_0x50fe23[_0x3268('0x3')],'transferercalleridname':_0x50fe23[_0x3268('0x4')],'transfererconnectedlinenum':_0x50fe23['transfererconnectedlinenum'],'transfererconnectedlinename':_0x50fe23[_0x3268('0x5')],'transfereraccountcode':_0x50fe23[_0x3268('0x6')],'transferercontext':_0x50fe23['transferercontext'],'transfererexten':_0x50fe23[_0x3268('0x7')],'transfererlinkedid':_0x50fe23[_0x3268('0x8')],'transfereechannel':_0x50fe23[_0x3268('0x9')],'transfereecalleridnum':_0x50fe23[_0x3268('0xa')],'transfereecalleridname':_0x50fe23[_0x3268('0xb')],'transfereeconnectedlinenum':_0x50fe23[_0x3268('0xc')],'transfereeconnectedlinename':_0x50fe23[_0x3268('0xd')],'transfereeaccountcode':_0x50fe23[_0x3268('0xe')],'transfereecontext':_0x50fe23[_0x3268('0xf')],'transfereeexten':_0x50fe23[_0x3268('0x10')],'transfereelinkedid':_0x50fe23['transfereelinkedid'],'isexternal':_0x50fe23[_0x3268('0x11')],'context':_0x50fe23[_0x3268('0x12')],'extension':_0x50fe23[_0x3268('0x13')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0x3268('0x14')]=function(_0x505ae6){return client['Request'](_0x3268('0x0'),{'body':{'result':_0x505ae6[_0x3268('0x1')],'transfererchannel':_0x505ae6[_0x3268('0x15')],'transferercalleridnum':_0x505ae6[_0x3268('0x16')],'transferercalleridname':_0x505ae6[_0x3268('0x17')],'transfererconnectedlinenum':_0x505ae6[_0x3268('0x18')],'transfererconnectedlinename':_0x505ae6['secondtransfererconnectedlinename'],'transfereraccountcode':_0x505ae6[_0x3268('0x19')],'transferercontext':_0x505ae6[_0x3268('0x1a')],'transfererexten':_0x505ae6[_0x3268('0x1b')],'transfererlinkedid':_0x505ae6[_0x3268('0x1c')],'transfereechannel':_0x505ae6['transfertargetchannel'],'transfereecalleridnum':_0x505ae6[_0x3268('0x1d')],'transfereecalleridname':_0x505ae6['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x505ae6[_0x3268('0x1e')],'transfereeconnectedlinename':_0x505ae6['transfertargetconnectedlinename'],'transfereeaccountcode':_0x505ae6['transfertargetaccountcode'],'transfereecontext':_0x505ae6['transfertargetcontext'],'transfereeexten':_0x505ae6[_0x3268('0x1f')],'transfereelinkedid':_0x505ae6[_0x3268('0x20')],'isexternal':_0x505ae6['isexternal'],'context':_0x505ae6[_0x3268('0x21')],'extension':_0x505ae6[_0x3268('0x22')],'type':_0x3268('0x23')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xca4b=['transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereelinkedid','context','extension','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x44c2ba,_0x5e1ef0){var _0x798b84=function(_0x113258){while(--_0x113258){_0x44c2ba['push'](_0x44c2ba['shift']());}};_0x798b84(++_0x5e1ef0);}(_0xca4b,0x11d));var _0xbca4=function(_0x1c242e,_0x388ae5){_0x1c242e=_0x1c242e-0x0;var _0x1c07d4=_0xca4b[_0x1c242e];return _0x1c07d4;};'use strict';var client=require(_0xbca4('0x0'));exports[_0xbca4('0x1')]={};exports[_0xbca4('0x2')]=function(_0x21344d){return client[_0xbca4('0x3')](_0xbca4('0x4'),{'body':{'result':_0x21344d[_0xbca4('0x5')],'transfererchannel':_0x21344d[_0xbca4('0x6')],'transferercalleridnum':_0x21344d[_0xbca4('0x7')],'transferercalleridname':_0x21344d['transferercalleridname'],'transfererconnectedlinenum':_0x21344d[_0xbca4('0x8')],'transfererconnectedlinename':_0x21344d['transfererconnectedlinename'],'transfereraccountcode':_0x21344d[_0xbca4('0x9')],'transferercontext':_0x21344d[_0xbca4('0xa')],'transfererexten':_0x21344d[_0xbca4('0xb')],'transfererlinkedid':_0x21344d[_0xbca4('0xc')],'transfereechannel':_0x21344d[_0xbca4('0xd')],'transfereecalleridnum':_0x21344d[_0xbca4('0xe')],'transfereecalleridname':_0x21344d[_0xbca4('0xf')],'transfereeconnectedlinenum':_0x21344d['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x21344d[_0xbca4('0x10')],'transfereeaccountcode':_0x21344d[_0xbca4('0x11')],'transfereecontext':_0x21344d['transfereecontext'],'transfereeexten':_0x21344d['transfereeexten'],'transfereelinkedid':_0x21344d[_0xbca4('0x12')],'isexternal':_0x21344d['isexternal'],'context':_0x21344d[_0xbca4('0x13')],'extension':_0x21344d[_0xbca4('0x14')],'type':'blind'},'log':_0xbca4('0x4')});};exports['attendedTransfer']=function(_0x414b5c){return client['Request'](_0xbca4('0x4'),{'body':{'result':_0x414b5c[_0xbca4('0x5')],'transfererchannel':_0x414b5c['origtransfererchannel'],'transferercalleridnum':_0x414b5c[_0xbca4('0x15')],'transferercalleridname':_0x414b5c[_0xbca4('0x16')],'transfererconnectedlinenum':_0x414b5c[_0xbca4('0x17')],'transfererconnectedlinename':_0x414b5c[_0xbca4('0x18')],'transfereraccountcode':_0x414b5c[_0xbca4('0x19')],'transferercontext':_0x414b5c[_0xbca4('0x1a')],'transfererexten':_0x414b5c['secondtransfererexten'],'transfererlinkedid':_0x414b5c[_0xbca4('0x1b')],'transfereechannel':_0x414b5c['transfertargetchannel'],'transfereecalleridnum':_0x414b5c[_0xbca4('0x1c')],'transfereecalleridname':_0x414b5c[_0xbca4('0x1d')],'transfereeconnectedlinenum':_0x414b5c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x414b5c['transfertargetconnectedlinename'],'transfereeaccountcode':_0x414b5c['transfertargetaccountcode'],'transfereecontext':_0x414b5c['transfertargetcontext'],'transfereeexten':_0x414b5c[_0xbca4('0x1e')],'transfereelinkedid':_0x414b5c[_0xbca4('0x1f')],'isexternal':_0x414b5c[_0xbca4('0x20')],'context':_0x414b5c[_0xbca4('0x21')],'extension':_0x414b5c['origtransfererexten'],'type':_0xbca4('0x22')},'log':_0xbca4('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 31c6eb3..df6af6b 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 _0x2a07=['username','ami\x20disconnected','join','pick','module','action','Reload','Action','then','message','catch','isConnected','command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','find','omit','undefined','values','channels','error','voicechannel','length','map','uniqueid','channel','filename','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','mixmonitorid','status','toLowerCase','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','telephones','campaigns','event','Event\x20name\x20mandatory','emit','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','asterisk'];(function(_0x5b4e92,_0xf5074){var _0xb3bf0=function(_0x3a3ee1){while(--_0x3a3ee1){_0x5b4e92['push'](_0x5b4e92['shift']());}};_0xb3bf0(++_0xf5074);}(_0x2a07,0x74));var _0x72a0=function(_0xbc6566,_0x32d463){_0xbc6566=_0xbc6566-0x0;var _0x4ed128=_0x2a07[_0xbc6566];return _0x4ed128;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var jayson=require(_0x72a0('0x2'));var schema=require(_0x72a0('0x3'));var BPromise=require(_0x72a0('0x4'));var moment=require('moment');var config=require(_0x72a0('0x5'));var properties=require(_0x72a0('0x6'));var ami=require(_0x72a0('0x7'));exports[_0x72a0('0x8')]=function(_0x431f65,_0xce74c,_0x3ccf6d){return new BPromise(function(_0x20dab9,_0x193e3b){var _0x287b06={'QueuePause':function(_0x21c819){return new Promise(function(_0x2c04eb,_0x22270e){var _0x1d32e9=util[_0x72a0('0x9')](_0x72a0('0xa'),'SIP',_0x21c819[_0x72a0('0xb')]);if(_0x431f65[_0x72a0('0xc')]&&_0x431f65['timers'][_0x1d32e9]&&_0x431f65[_0x72a0('0xc')][_0x1d32e9][_0x72a0('0xd')]){_0x431f65[_0x72a0('0xc')][_0x1d32e9][_0x72a0('0xe')]();}if(_0x431f65[_0x72a0('0xf')][_0x1d32e9]){_0x431f65['agents'][_0x1d32e9][_0x72a0('0x10')]({'statePause':_0x21c819[_0x72a0('0x11')]?!![]:![]});}_0x2c04eb({'code':0xc8,'message':_0x72a0('0x12')});});},'Reload':function(_0xf91a82){var _0x149f0d=this;return new Promise(function(_0x324cbd,_0xe73b5e){if(ami['isConnected']()==![]){return _0xe73b5e(_0x149f0d['error'](0x1f4,[config[_0x72a0('0x13')]['ip'],config[_0x72a0('0x13')][_0x72a0('0x14')],_0x72a0('0x15')][_0x72a0('0x16')]('\x20')));}_0xf91a82=_[_0x72a0('0x17')](_0xf91a82,_['keys'](properties[_0x72a0('0x18')]));_0xf91a82[_0x72a0('0x19')]=_0x72a0('0x1a');return ami[_0x72a0('0x1b')](_0xf91a82)[_0x72a0('0x1c')](function(_0x54495e){_0x324cbd({'code':0xc8,'message':_0x54495e[_0x72a0('0x1d')]});})[_0x72a0('0x1e')](function(_0x131b73){_0xe73b5e(_0x149f0d['error'](0x1f5,_0x131b73[_0x72a0('0x1d')]));});});},'Command':function(_0x46e9e3){var _0x30899b=this;return new Promise(function(_0x41614d,_0x5437df){if(ami[_0x72a0('0x1f')]()==![]){return _0x5437df(_0x30899b['error'](0x1f4,[config[_0x72a0('0x13')]['ip'],config[_0x72a0('0x13')][_0x72a0('0x14')],'ami\x20disconnected'][_0x72a0('0x16')]('\x20')));}_0x46e9e3=_[_0x72a0('0x17')](_0x46e9e3,_0x72a0('0x20'));_0x46e9e3[_0x72a0('0x19')]='Command';return ami[_0x72a0('0x1b')](_0x46e9e3)[_0x72a0('0x1c')](function(_0x1ddd54){_0x41614d({'code':0xc8,'message':_0x1ddd54[_0x72a0('0x21')]});})[_0x72a0('0x1e')](function(_0x174b1b){_0x5437df(_0x30899b['error'](0x1f5,_0x174b1b['message']));});});},'VoiceQueues':function(_0x468d66){return new Promise(function(_0x2d8b68,_0x123df4){var _0x1504ed=[];for(var _0xf5cb49 in _0x431f65[_0x72a0('0x22')]){if(_0x431f65[_0x72a0('0x22')][_0x72a0('0x23')](_0xf5cb49)){var _0xee99e2=_0x431f65[_0x72a0('0x22')][_0xf5cb49];var _0x4f9718={'id':_0xee99e2['id'],'name':_0xee99e2[_0x72a0('0xb')],'strategy':_0xee99e2[_0x72a0('0x24')],'answered':_0xee99e2[_0x72a0('0x25')],'available':_0xee99e2[_0x72a0('0x26')],'loggedIn':_0xee99e2[_0x72a0('0x27')],'pTalking':_0xee99e2[_0x72a0('0x28')],'sumBillable':_0xee99e2[_0x72a0('0x29')],'sumDuration':_0xee99e2[_0x72a0('0x2a')],'sumHoldTime':_0xee99e2[_0x72a0('0x2b')]||0x0,'talking':_0xee99e2[_0x72a0('0x2c')],'total':_0xee99e2['total'],'type':_0xee99e2[_0x72a0('0x2d')],'unmanaged':_0xee99e2[_0x72a0('0x2e')],'abandoned':_0xee99e2[_0x72a0('0x2f')],'waiting':_0xee99e2[_0x72a0('0x30')],'loggedInDb':_0xee99e2[_0x72a0('0x31')]};if(_0xee99e2[_0x72a0('0x2d')]===_0x72a0('0x32')){_0x4f9718['dialActive']=_0xee99e2[_0x72a0('0x33')];_0x4f9718[_0x72a0('0x34')]=_0xee99e2[_0x72a0('0x34')];_0x4f9718[_0x72a0('0x35')]=_0xee99e2[_0x72a0('0x35')];_0x4f9718[_0x72a0('0x36')]=_0xee99e2[_0x72a0('0x36')];_0x4f9718[_0x72a0('0x37')]=_0xee99e2['dialOriginateTimeout'];_0x4f9718[_0x72a0('0x38')]=_0xee99e2[_0x72a0('0x38')];_0x4f9718[_0x72a0('0x39')]=_0xee99e2['temp'];_0x4f9718[_0x72a0('0x3a')]=_0xee99e2['outboundAnswerAgiCallsDay'];_0x4f9718[_0x72a0('0x3b')]=_0xee99e2[_0x72a0('0x3b')];_0x4f9718[_0x72a0('0x3c')]=_0xee99e2[_0x72a0('0x3c')];_0x4f9718[_0x72a0('0x3d')]=_0xee99e2[_0x72a0('0x3d')];_0x4f9718[_0x72a0('0x3e')]=_0xee99e2[_0x72a0('0x3e')];_0x4f9718[_0x72a0('0x3f')]=_0xee99e2[_0x72a0('0x3f')];_0x4f9718[_0x72a0('0x40')]=_0xee99e2[_0x72a0('0x40')];_0x4f9718['outboundDropCallsDayTimeout']=_0xee99e2[_0x72a0('0x41')];_0x4f9718['outboundNoAnswerCallsDay']=_0xee99e2[_0x72a0('0x42')];_0x4f9718[_0x72a0('0x43')]=_0xee99e2[_0x72a0('0x43')];_0x4f9718[_0x72a0('0x44')]=_0xee99e2[_0x72a0('0x44')];_0x4f9718[_0x72a0('0x45')]=_0xee99e2[_0x72a0('0x45')];_0x4f9718[_0x72a0('0x46')]=_0xee99e2[_0x72a0('0x46')];_0x4f9718['outboundUnknownCallsDay']=_0xee99e2['outboundUnknownCallsDay'];_0x4f9718[_0x72a0('0x47')]=_0xee99e2[_0x72a0('0x47')];_0x4f9718[_0x72a0('0x48')]=_0xee99e2[_0x72a0('0x48')];_0x4f9718[_0x72a0('0x49')]=_0xee99e2['predictiveIntervalAvgTalktime'];_0x4f9718[_0x72a0('0x4a')]=_0xee99e2[_0x72a0('0x4a')];_0x4f9718['predictiveIntervalDroppedCallsTimeout']=_0xee99e2[_0x72a0('0x4b')];_0x4f9718['predictiveIntervalErlangCalls']=_0xee99e2['predictiveIntervalErlangCalls'];_0x4f9718['predictiveIntervalErlangCallsDroppedCalls']=_0xee99e2[_0x72a0('0x4c')];_0x4f9718['predictiveIntervalHitRate']=_0xee99e2[_0x72a0('0x4d')];_0x4f9718[_0x72a0('0x4e')]=_0xee99e2[_0x72a0('0x4e')];_0x4f9718[_0x72a0('0x4f')]=_0xee99e2['predictiveIntervalPauses'];_0x4f9718['predictiveIntervalAvailable']=_0xee99e2['predictiveIntervalAvailable'];_0x4f9718['predictiveIntervalTotalCalls']=_0xee99e2[_0x72a0('0x50')];_0x4f9718[_0x72a0('0x1d')]=_0xee99e2['message'];_0x4f9718[_0x72a0('0x51')]=_0xee99e2[_0x72a0('0x51')];_0x4f9718['erlangCalls']=_0xee99e2[_0x72a0('0x52')];_0x4f9718[_0x72a0('0x53')]=_0xee99e2[_0x72a0('0x53')];_0x4f9718[_0x72a0('0x54')]=_0xee99e2[_0x72a0('0x54')];_0x4f9718[_0x72a0('0x55')]=_0xee99e2['erlangBusyFactor'];_0x4f9718[_0x72a0('0x56')]=_0xee99e2['startPredictive'];_0x4f9718[_0x72a0('0x57')]=_0xee99e2['startProgressive'];}if(_0xee99e2[_0x72a0('0x58')]){_0x4f9718[_0x72a0('0x58')]={'id':_0xee99e2['Trunk']['id'],'name':_0xee99e2[_0x72a0('0x58')]['name'],'active':_0xee99e2[_0x72a0('0x58')][_0x72a0('0x59')],'callerid':_0xee99e2[_0x72a0('0x58')]['callerid']};}if(_0xee99e2[_0x72a0('0x5a')]){_0x4f9718[_0x72a0('0x5a')]={'id':_0xee99e2[_0x72a0('0x5a')]['id'],'name':_0xee99e2['Interval']['name']};}_0x1504ed[_0x72a0('0x5b')](_0x4f9718);}}_0x2d8b68({'count':_0x1504ed['length'],'rows':_0x1504ed});});},'UpdateVoiceQueue':function(_0x28e1a0){return new Promise(function(_0x1436f7,_0x1d2e44){var _0x2b4d36=_[_0x72a0('0x5c')](_0x431f65[_0x72a0('0x22')],{'id':parseInt(_0x28e1a0['id'])});var _0x451558=_[_0x72a0('0x5d')](_0x28e1a0,['id']);if(_0x2b4d36){for(var _0x2efa92 in _0x451558){if(typeof _0x451558[_0x2efa92]!=='undefined'&&typeof _0x2b4d36[_0x2efa92]!==_0x72a0('0x5e')){_0x2b4d36[_0x2efa92]=_0x451558[_0x2efa92];}}_0x1436f7(_0x2b4d36);}else{_0x1d2e44();}});},'VoiceChannels':function(_0x2c2f03){return new Promise(function(_0x134150,_0x476e7a){var _0x3a669d=_[_0x72a0('0x5f')](_0x431f65[_0x72a0('0x60')]);_0x134150({'count':_0x3a669d['length'],'rows':_0x3a669d});});},'VoiceChannelMixMonitor':function(_0x4f9091){var _0x409095=this;return new Promise(function(_0x2161a3,_0xe38fb3){if(ami[_0x72a0('0x1f')]()==![]){return _0xe38fb3(_0x409095[_0x72a0('0x61')](0x1f4,[config[_0x72a0('0x13')]['ip'],config[_0x72a0('0x13')][_0x72a0('0x14')],_0x72a0('0x15')][_0x72a0('0x16')]('\x20')));}var _0x499721=schema(properties[_0x72a0('0x62')])[_0x72a0('0x3')](_0x4f9091);if(_0x499721[_0x72a0('0x63')]>0x0){return _0xe38fb3(_0x409095[_0x72a0('0x61')](0x1f4,_[_0x72a0('0x64')](_0x499721,'message')[_0x72a0('0x16')](',\x20')));}var _0x595243=_['find'](_0x431f65[_0x72a0('0x60')],{'uniqueid':_0x4f9091[_0x72a0('0x65')]});if(_0x595243&&_0x595243[_0x72a0('0x66')]){var _0x35ed6f=util[_0x72a0('0x9')]('%s.%s',_0x4f9091[_0x72a0('0x67')]||_0x4f9091[_0x72a0('0x65')],_0x4f9091['format']||'wav');return ami[_0x72a0('0x1b')]({'action':_0x72a0('0x68'),'channel':_0x595243[_0x72a0('0x66')],'file':_0x35ed6f,'options':_0x72a0('0x69')})[_0x72a0('0x1c')](function(_0x3813ca){var _0x37a6d6=_[_0x72a0('0x5c')](_0x595243['monitors'],{'filename':_0x72a0('0x6a')+_0x35ed6f['toLowerCase']()});if(_['isNil'](_0x37a6d6)){_0x595243['monitors'][_0x72a0('0x5b')]({'filename':_0x72a0('0x6a')+_0x35ed6f['toLowerCase'](),'createdAt':moment()[_0x72a0('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x3813ca[_0x72a0('0x6b')],'status':'rec'});}else{_0x37a6d6['mixmonitorid']=_0x3813ca[_0x72a0('0x6b')];_0x37a6d6[_0x72a0('0x6c')]='rec';}_0x2161a3({'code':0xc8,'message':[_0x4f9091[_0x72a0('0x65')],'MixMonitor\x20Success',_0x3813ca[_0x72a0('0x6b')]]['join']('\x20'),'mixmonitorid':_0x3813ca['mixmonitorid']});})[_0x72a0('0x1e')](function(_0x2dbbb4){_0xe38fb3(_0x409095[_0x72a0('0x61')](0x1f5,[_0x4f9091['uniqueid'],_0x2dbbb4['message'][_0x72a0('0x6d')]()]['join']('\x20')));});}else{return _0xe38fb3(_0x409095[_0x72a0('0x61')](0x1f5,_0x72a0('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x1cea02){var _0x4b03ab=this;return new Promise(function(_0x11a750,_0x2628dd){if(ami[_0x72a0('0x1f')]()==![]){return _0x2628dd(_0x4b03ab[_0x72a0('0x61')](0x1f4,[config[_0x72a0('0x13')]['ip'],config[_0x72a0('0x13')][_0x72a0('0x14')],_0x72a0('0x15')]['join']('\x20')));}var _0x39c3a2=schema(properties['voicechannel'])['validate'](_0x1cea02);if(_0x39c3a2['length']>0x0){return _0x2628dd(_0x4b03ab['error'](0x1f4,_[_0x72a0('0x64')](_0x39c3a2,_0x72a0('0x1d'))[_0x72a0('0x16')](',\x20')));}var _0x4a2f94=_[_0x72a0('0x5c')](_0x431f65['channels'],{'uniqueid':_0x1cea02[_0x72a0('0x65')]});if(_0x4a2f94){return BPromise[_0x72a0('0x6f')]()['then'](function(){if(_0x4a2f94[_0x72a0('0x66')]){return ami[_0x72a0('0x1b')]({'action':_0x72a0('0x70'),'channel':_0x4a2f94[_0x72a0('0x66')],'mixmonitorid':_0x1cea02['mixmonitorid']})[_0x72a0('0x1e')](function(_0x4d9b42){});}})[_0x72a0('0x1c')](function(){if(_0x4a2f94[_0x72a0('0x71')]){return ami[_0x72a0('0x1b')]({'action':'StopMixMonitor','channel':_0x4a2f94[_0x72a0('0x71')],'mixmonitorid':_0x1cea02[_0x72a0('0x6b')]})[_0x72a0('0x1e')](function(_0x154c9d){});}})[_0x72a0('0x1c')](function(_0x599e4c){var _0x5707e9=_[_0x72a0('0x5c')](_0x4a2f94['monitors'],{'mixmonitorid':_0x1cea02[_0x72a0('0x6b')]});if(_0x5707e9){_0x5707e9['status']=_0x72a0('0x72');}})[_0x72a0('0x1c')](function(){var _0x5ef439=util[_0x72a0('0x9')](_0x72a0('0x73'),_0x1cea02[_0x72a0('0x67')]||_0x1cea02['uniqueid'],_0x1cea02[_0x72a0('0x9')]||'wav');var _0x2ea1bb=_[_0x72a0('0x5c')](_0x4a2f94['monitors'],{'filename':_0x72a0('0x6a')+_0x5ef439['toLowerCase']()});if(_0x2ea1bb){_0x2ea1bb['status']='stop';}})[_0x72a0('0x1c')](function(){_0x11a750({'code':0xc8,'message':[_0x1cea02['uniqueid'],_0x72a0('0x74')]['join']('\x20')});})[_0x72a0('0x1e')](function(_0x32262){_0x2628dd(_0x4b03ab[_0x72a0('0x61')](0x1f5,[_0x1cea02['uniqueid'],_0x32262[_0x72a0('0x1d')][_0x72a0('0x6d')]()][_0x72a0('0x16')]('\x20')));});}else{return _0x2628dd(_0x4b03ab[_0x72a0('0x61')](0x1f5,_0x72a0('0x6e')));}});},'VoiceQueuesChannels':function(_0x58ef97){return new Promise(function(_0x54e925,_0x2d431d){var _0x19c116=_[_0x72a0('0x5f')](_0x431f65['queueChannels']);_0x54e925({'count':_0x19c116[_0x72a0('0x63')],'rows':_0x19c116});});},'VoiceQueuesChannel':function(_0x647e75){var _0x4ebce5=this;return new Promise(function(_0xd041ec,_0x48345f){var _0xd8b0e1=schema(properties[_0x72a0('0x75')])[_0x72a0('0x3')](_0x647e75);if(_0xd8b0e1[_0x72a0('0x63')]>0x0){return _0x48345f(_0x4ebce5[_0x72a0('0x61')](0x1f4,_[_0x72a0('0x64')](_0xd8b0e1,_0x72a0('0x1d'))['join'](',\x20')));}var _0x5b0dfd=_['find'](_0x431f65[_0x72a0('0x76')],{'uniqueid':_0x647e75[_0x72a0('0x65')]});if(_0x5b0dfd){_0xd041ec(_0x5b0dfd);}else{return _0x48345f(_0x4ebce5[_0x72a0('0x61')](0x1f5,_0x72a0('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x235814){var _0x867b95=this;return new Promise(function(_0x5ab97b,_0x2dd438){if(ami[_0x72a0('0x1f')]()==![]){return _0x2dd438(_0x867b95[_0x72a0('0x61')](0x1f4,[config[_0x72a0('0x13')]['ip'],config[_0x72a0('0x13')][_0x72a0('0x14')],_0x72a0('0x15')]['join']('\x20')));}var _0x1e36b0=schema(properties[_0x72a0('0x77')])[_0x72a0('0x3')](_0x235814);if(_0x1e36b0[_0x72a0('0x63')]>0x0){return _0x2dd438(_0x867b95[_0x72a0('0x61')](0x1f4,_[_0x72a0('0x64')](_0x1e36b0,'message')[_0x72a0('0x16')](',\x20')));}var _0x47e13c=_[_0x72a0('0x5c')](_0x431f65[_0x72a0('0x76')],{'uniqueid':_0x235814[_0x72a0('0x65')]});if(_0x47e13c&&_0x47e13c[_0x72a0('0x66')]){return ami[_0x72a0('0x1b')]({'action':'Hangup','channel':_0x47e13c[_0x72a0('0x66')]})[_0x72a0('0x1c')](function(_0x4e52e4){_0x5ab97b({'code':0xc8,'message':[_0x235814[_0x72a0('0x65')],_0x4e52e4[_0x72a0('0x1d')][_0x72a0('0x6d')]()][_0x72a0('0x16')]('\x20')});})['catch'](function(_0x3b4d55){_0x2dd438(_0x867b95[_0x72a0('0x61')](0x1f5,[_0x235814[_0x72a0('0x65')],_0x3b4d55[_0x72a0('0x1d')][_0x72a0('0x6d')]()][_0x72a0('0x16')]('\x20')));});}else{return _0x2dd438(_0x867b95[_0x72a0('0x61')](0x1f5,_0x72a0('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0xd771f1){var _0x3d02e6=this;return new Promise(function(_0x2fd7e2,_0x109e9e){if(ami['isConnected']()==![]){return _0x109e9e(_0x3d02e6[_0x72a0('0x61')](0x1f4,[config[_0x72a0('0x13')]['ip'],config[_0x72a0('0x13')][_0x72a0('0x14')],_0x72a0('0x15')][_0x72a0('0x16')]('\x20')));}var _0x20281b=schema(properties[_0x72a0('0x78')])['validate'](_0xd771f1);if(_0x20281b[_0x72a0('0x63')]>0x0){return _0x109e9e(_0x3d02e6['error'](0x1f4,_['map'](_0x20281b,_0x72a0('0x1d'))['join'](',\x20')));}var _0x5b9fed=_[_0x72a0('0x5c')](_0x431f65['queueChannels'],{'uniqueid':_0xd771f1[_0x72a0('0x65')]});if(_0x5b9fed&&_0x5b9fed[_0x72a0('0x66')]){return ami[_0x72a0('0x1b')]({'action':'Redirect','channel':_0x5b9fed[_0x72a0('0x66')],'exten':_0xd771f1[_0x72a0('0x79')],'context':_0xd771f1[_0x72a0('0x7a')]||_0x5b9fed[_0x72a0('0x7a')],'priority':0x1})[_0x72a0('0x1c')](function(_0x5cbae1){_0x2fd7e2({'code':0xc8,'message':[_0xd771f1[_0x72a0('0x65')],_0x5cbae1[_0x72a0('0x1d')][_0x72a0('0x6d')]()]['join']('\x20')});})[_0x72a0('0x1e')](function(_0x2e3eb0){_0x109e9e(_0x3d02e6[_0x72a0('0x61')](0x1f5,[_0xd771f1['uniqueid'],_0x2e3eb0[_0x72a0('0x1d')][_0x72a0('0x6d')]()][_0x72a0('0x16')]('\x20')));});}else{return _0x109e9e(_0x3d02e6[_0x72a0('0x61')](0x1f5,_0x72a0('0x6e')));}});},'Agents':function(_0xb7849d){return new Promise(function(_0xff26b1,_0x1b5e55){var _0x30e020=_['values'](_0x431f65[_0x72a0('0xf')]);_0xff26b1({'count':_0x30e020[_0x72a0('0x63')],'rows':_0x30e020});});},'Telephones':function(_0x14657c){return new Promise(function(_0x2458b8,_0x173cc4){var _0x5b72b7=_[_0x72a0('0x5f')](_0x431f65[_0x72a0('0x7b')]);_0x2458b8({'count':_0x5b72b7[_0x72a0('0x63')],'rows':_0x5b72b7});});},'Trunks':function(_0x4124e7){return new Promise(function(_0x5a995e,_0x36d8b9){var _0x41f20f=_[_0x72a0('0x5f')](_0x431f65['trunks']);_0x5a995e({'count':_0x41f20f['length'],'rows':_0x41f20f});});},'OutboundChannels':function(_0x3e23e4){return new Promise(function(_0x76b0bf,_0x17776e){var _0x301479=_[_0x72a0('0x5f')](_0x431f65['outboundChannels']);_0x76b0bf({'count':_0x301479['length'],'rows':_0x301479});});},'Outbound':function(_0x5c4170){return new Promise(function(_0x410f6b,_0x5c1412){_0x410f6b(_0x431f65[_0x72a0('0x32')]);});},'Campaigns':function(_0x4ebb71){return new Promise(function(_0x54724b,_0x58101a){var _0x5035df=_[_0x72a0('0x5f')](_0x431f65[_0x72a0('0x7c')]);_0x54724b({'count':_0x5035df[_0x72a0('0x63')],'rows':_0x5035df});});},'VoiceQueuesPreview':function(_0xde2abe){var _0x5bad18=this;return new Promise(function(_0x10db32,_0x67a029){_0xce74c['run'](_0xde2abe['id'])[_0x72a0('0x1c')](function(_0x5c30f9){_0x10db32({'code':0xc8,'message':_0x5c30f9['message']});})[_0x72a0('0x1e')](function(_0x401d3c){_0x67a029(_0x5bad18[_0x72a0('0x61')](0x1f4,_0x401d3c[_0x72a0('0x1d')]));});});},'EventManager':function(_0x5e1638){var _0x5075ed=this;return new Promise(function(_0x575c69,_0x455818){if(!_0x5e1638[_0x72a0('0x7d')]){return _0x455818(_0x5075ed[_0x72a0('0x61')](0x1f4,_0x72a0('0x7e')));}ami[_0x72a0('0x7f')]('custom:'+_0x5e1638['event'],_0x5e1638[_0x72a0('0x1d')]);_0x575c69({'code':0xc8,'message':_0x5e1638});});},'FaxAccounts':function(_0x3ab4ec){return new Promise(function(_0x57550f,_0x40f2e2){var _0x3a8fee=_[_0x72a0('0x5f')](_0x431f65[_0x72a0('0x80')]);_0x57550f({'count':_0x3a8fee[_0x72a0('0x63')],'rows':_0x3a8fee});});},'SendFax':function(_0x167a80){var _0x7533ea=this;return new Promise(function(_0x56bdf5,_0x42e186){_0x3ccf6d[_0x72a0('0x81')](_0x167a80)[_0x72a0('0x1c')](function(_0x5a0aa3){_0x56bdf5({'code':0xc8,'message':_0x5a0aa3[_0x72a0('0x1d')]});})[_0x72a0('0x1e')](function(_0x346e03){_0x42e186(_0x7533ea[_0x72a0('0x61')](0x1f4,_0x346e03[_0x72a0('0x1d')]));});});},'CheckAfterSend':function(_0x49374f){var _0xc16765=this;return new Promise(function(_0x15d979,_0x1f6d7d){_0x3ccf6d[_0x72a0('0x82')](_0x49374f)[_0x72a0('0x1c')](function(_0x262e3a){_0x15d979({'code':0xc8,'message':_0x262e3a['message']});})[_0x72a0('0x1e')](function(_0x216f40){_0x1f6d7d(_0xc16765[_0x72a0('0x61')](0x1f4,_0x216f40[_0x72a0('0x1d')]));});});}};var _0xa48ecb=jayson[_0x72a0('0x83')](_0x287b06)[_0x72a0('0x84')]();_0xa48ecb['on'](_0x72a0('0x61'),function(_0x2c99f9){return _0x193e3b(_0x2c99f9);});_0xa48ecb['listen'](0x232a,_0x72a0('0x85'),function(){console['log'](_0x72a0('0x86'),0x232a);return _0x20dab9(_0x72a0('0x87')+0x232a);});});}; \ No newline at end of file +var _0x9fd4=['sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','channel','filename','uniqueid','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','destinationchannel','StopMixMonitor','stop','%s.%s','wav','status','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelredirect','exten','context','trunks','outboundChannels','run','custom:','event','faxAccounts','send','server','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','format','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','answered','loggedIn','pTalking'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x9fd4,0x16c));var _0x49fd=function(_0x343308,_0x500535){_0x343308=_0x343308-0x0;var _0x1504f1=_0x9fd4[_0x343308];return _0x1504f1;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var jayson=require(_0x49fd('0x2'));var schema=require(_0x49fd('0x3'));var BPromise=require(_0x49fd('0x4'));var moment=require(_0x49fd('0x5'));var config=require(_0x49fd('0x6'));var properties=require(_0x49fd('0x7'));var ami=require(_0x49fd('0x8'));exports['listen']=function(_0x481f6a,_0x3b4b46,_0x42fdc7){return new BPromise(function(_0x1bc16e,_0x9353cd){var _0x48b999={'QueuePause':function(_0x14bb94){return new Promise(function(_0x461ac1,_0x36f605){var _0x3bf3fd=util[_0x49fd('0x9')]('%s/%s',_0x49fd('0xa'),_0x14bb94[_0x49fd('0xb')]);if(_0x481f6a[_0x49fd('0xc')]&&_0x481f6a[_0x49fd('0xc')][_0x3bf3fd]&&_0x481f6a[_0x49fd('0xc')][_0x3bf3fd][_0x49fd('0xd')]){_0x481f6a[_0x49fd('0xc')][_0x3bf3fd]['updateAcw']();}if(_0x481f6a[_0x49fd('0xe')][_0x3bf3fd]){_0x481f6a[_0x49fd('0xe')][_0x3bf3fd][_0x49fd('0xf')]({'statePause':_0x14bb94[_0x49fd('0x10')]?!![]:![]});}_0x461ac1({'code':0xc8,'message':_0x49fd('0x11')});});},'Reload':function(_0x206bd8){var _0x26f2c1=this;return new Promise(function(_0x3fa518,_0x1d900b){if(ami[_0x49fd('0x12')]()==![]){return _0x1d900b(_0x26f2c1[_0x49fd('0x13')](0x1f4,[config[_0x49fd('0x14')]['ip'],config[_0x49fd('0x14')][_0x49fd('0x15')],_0x49fd('0x16')][_0x49fd('0x17')]('\x20')));}_0x206bd8=_[_0x49fd('0x18')](_0x206bd8,_[_0x49fd('0x19')](properties[_0x49fd('0x1a')]));_0x206bd8[_0x49fd('0x1b')]=_0x49fd('0x1c');return ami[_0x49fd('0x1d')](_0x206bd8)[_0x49fd('0x1e')](function(_0x475eee){_0x3fa518({'code':0xc8,'message':_0x475eee[_0x49fd('0x1f')]});})[_0x49fd('0x20')](function(_0x598793){_0x1d900b(_0x26f2c1[_0x49fd('0x13')](0x1f5,_0x598793[_0x49fd('0x1f')]));});});},'Command':function(_0x59a407){var _0x5c323a=this;return new Promise(function(_0x449c9a,_0x53cbd1){if(ami[_0x49fd('0x12')]()==![]){return _0x53cbd1(_0x5c323a[_0x49fd('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x49fd('0x14')][_0x49fd('0x15')],'ami\x20disconnected'][_0x49fd('0x17')]('\x20')));}_0x59a407=_[_0x49fd('0x18')](_0x59a407,_0x49fd('0x21'));_0x59a407[_0x49fd('0x1b')]=_0x49fd('0x22');return ami[_0x49fd('0x1d')](_0x59a407)['then'](function(_0x46019d){_0x449c9a({'code':0xc8,'message':_0x46019d[_0x49fd('0x23')]});})[_0x49fd('0x20')](function(_0x4bf811){_0x53cbd1(_0x5c323a[_0x49fd('0x13')](0x1f5,_0x4bf811[_0x49fd('0x1f')]));});});},'VoiceQueues':function(_0x146d55){return new Promise(function(_0x4bff4c,_0x597161){var _0x497469=[];for(var _0x13c5a8 in _0x481f6a[_0x49fd('0x24')]){if(_0x481f6a[_0x49fd('0x24')][_0x49fd('0x25')](_0x13c5a8)){var _0x9587b9=_0x481f6a[_0x49fd('0x24')][_0x13c5a8];var _0x20873e={'id':_0x9587b9['id'],'name':_0x9587b9[_0x49fd('0xb')],'strategy':_0x9587b9['strategy'],'answered':_0x9587b9[_0x49fd('0x26')],'available':_0x9587b9['available'],'loggedIn':_0x9587b9[_0x49fd('0x27')],'pTalking':_0x9587b9[_0x49fd('0x28')],'sumBillable':_0x9587b9['sumBillable'],'sumDuration':_0x9587b9[_0x49fd('0x29')],'sumHoldTime':_0x9587b9[_0x49fd('0x2a')]||0x0,'talking':_0x9587b9[_0x49fd('0x2b')],'total':_0x9587b9[_0x49fd('0x2c')],'type':_0x9587b9[_0x49fd('0x2d')],'unmanaged':_0x9587b9[_0x49fd('0x2e')],'abandoned':_0x9587b9[_0x49fd('0x2f')],'waiting':_0x9587b9[_0x49fd('0x30')],'loggedInDb':_0x9587b9['loggedInDb']};if(_0x9587b9[_0x49fd('0x2d')]==='outbound'){_0x20873e[_0x49fd('0x31')]=_0x9587b9['dialActive'];_0x20873e[_0x49fd('0x32')]=_0x9587b9[_0x49fd('0x32')];_0x20873e[_0x49fd('0x33')]=_0x9587b9['dialOriginateCallerIdName'];_0x20873e['dialOriginateCallerIdNumber']=_0x9587b9['dialOriginateCallerIdNumber'];_0x20873e[_0x49fd('0x34')]=_0x9587b9[_0x49fd('0x34')];_0x20873e['dialPrefix']=_0x9587b9[_0x49fd('0x35')];_0x20873e['temp']=_0x9587b9['temp'];_0x20873e[_0x49fd('0x36')]=_0x9587b9[_0x49fd('0x36')];_0x20873e[_0x49fd('0x37')]=_0x9587b9[_0x49fd('0x37')];_0x20873e[_0x49fd('0x38')]=_0x9587b9['outboundBlacklistCallsDay'];_0x20873e['outboundBusyCallsDay']=_0x9587b9[_0x49fd('0x39')];_0x20873e[_0x49fd('0x3a')]=_0x9587b9[_0x49fd('0x3a')];_0x20873e[_0x49fd('0x3b')]=_0x9587b9['outboundDropCallsDayACS'];_0x20873e[_0x49fd('0x3c')]=_0x9587b9[_0x49fd('0x3c')];_0x20873e[_0x49fd('0x3d')]=_0x9587b9[_0x49fd('0x3d')];_0x20873e[_0x49fd('0x3e')]=_0x9587b9[_0x49fd('0x3e')];_0x20873e[_0x49fd('0x3f')]=_0x9587b9[_0x49fd('0x3f')];_0x20873e[_0x49fd('0x40')]=_0x9587b9[_0x49fd('0x40')];_0x20873e[_0x49fd('0x41')]=_0x9587b9['outboundReCallsDay'];_0x20873e[_0x49fd('0x42')]=_0x9587b9[_0x49fd('0x42')];_0x20873e[_0x49fd('0x43')]=_0x9587b9[_0x49fd('0x43')];_0x20873e[_0x49fd('0x44')]=_0x9587b9[_0x49fd('0x44')];_0x20873e[_0x49fd('0x45')]=_0x9587b9[_0x49fd('0x45')];_0x20873e[_0x49fd('0x46')]=_0x9587b9['predictiveIntervalAvgTalktime'];_0x20873e[_0x49fd('0x47')]=_0x9587b9['predictiveIntervalDroppedCallsCallersExit'];_0x20873e[_0x49fd('0x48')]=_0x9587b9[_0x49fd('0x48')];_0x20873e['predictiveIntervalErlangCalls']=_0x9587b9[_0x49fd('0x49')];_0x20873e[_0x49fd('0x4a')]=_0x9587b9['predictiveIntervalErlangCallsDroppedCalls'];_0x20873e[_0x49fd('0x4b')]=_0x9587b9['predictiveIntervalHitRate'];_0x20873e['predictiveIntervalMultiplicativeFactor']=_0x9587b9['predictiveIntervalMultiplicativeFactor'];_0x20873e[_0x49fd('0x4c')]=_0x9587b9[_0x49fd('0x4c')];_0x20873e[_0x49fd('0x4d')]=_0x9587b9[_0x49fd('0x4d')];_0x20873e['predictiveIntervalTotalCalls']=_0x9587b9[_0x49fd('0x4e')];_0x20873e[_0x49fd('0x1f')]=_0x9587b9[_0x49fd('0x1f')];_0x20873e[_0x49fd('0x4f')]=_0x9587b9[_0x49fd('0x4f')];_0x20873e[_0x49fd('0x50')]=_0x9587b9[_0x49fd('0x50')];_0x20873e[_0x49fd('0x51')]=_0x9587b9['erlangCallToSecond'];_0x20873e[_0x49fd('0x52')]=_0x9587b9[_0x49fd('0x52')];_0x20873e['erlangBusyFactor']=_0x9587b9[_0x49fd('0x53')];_0x20873e[_0x49fd('0x54')]=_0x9587b9['startPredictive'];_0x20873e[_0x49fd('0x55')]=_0x9587b9['startProgressive'];}if(_0x9587b9[_0x49fd('0x56')]){_0x20873e[_0x49fd('0x56')]={'id':_0x9587b9[_0x49fd('0x56')]['id'],'name':_0x9587b9[_0x49fd('0x56')]['name'],'active':_0x9587b9['Trunk'][_0x49fd('0x57')],'callerid':_0x9587b9['Trunk'][_0x49fd('0x58')]};}if(_0x9587b9[_0x49fd('0x59')]){_0x20873e[_0x49fd('0x59')]={'id':_0x9587b9[_0x49fd('0x59')]['id'],'name':_0x9587b9['Interval'][_0x49fd('0xb')]};}_0x497469[_0x49fd('0x5a')](_0x20873e);}}_0x4bff4c({'count':_0x497469[_0x49fd('0x5b')],'rows':_0x497469});});},'UpdateVoiceQueue':function(_0x8d4b0b){return new Promise(function(_0x24705e,_0x30937f){var _0x231c08=_[_0x49fd('0x5c')](_0x481f6a[_0x49fd('0x24')],{'id':parseInt(_0x8d4b0b['id'])});var _0xa4a3b7=_[_0x49fd('0x5d')](_0x8d4b0b,['id']);if(_0x231c08){for(var _0x312344 in _0xa4a3b7){if(typeof _0xa4a3b7[_0x312344]!==_0x49fd('0x5e')&&typeof _0x231c08[_0x312344]!==_0x49fd('0x5e')){_0x231c08[_0x312344]=_0xa4a3b7[_0x312344];}}_0x24705e(_0x231c08);}else{_0x30937f();}});},'VoiceChannels':function(_0x58c7eb){return new Promise(function(_0x4fc625,_0x6960ad){var _0xa3518f=_[_0x49fd('0x5f')](_0x481f6a[_0x49fd('0x60')]);_0x4fc625({'count':_0xa3518f['length'],'rows':_0xa3518f});});},'VoiceChannelMixMonitor':function(_0x23e5f2){var _0x3ae66a=this;return new Promise(function(_0x4b28fa,_0x341728){if(ami[_0x49fd('0x12')]()==![]){return _0x341728(_0x3ae66a[_0x49fd('0x13')](0x1f4,[config[_0x49fd('0x14')]['ip'],config[_0x49fd('0x14')][_0x49fd('0x15')],_0x49fd('0x16')][_0x49fd('0x17')]('\x20')));}var _0x215b76=schema(properties[_0x49fd('0x61')])[_0x49fd('0x3')](_0x23e5f2);if(_0x215b76['length']>0x0){return _0x341728(_0x3ae66a[_0x49fd('0x13')](0x1f4,_[_0x49fd('0x62')](_0x215b76,_0x49fd('0x1f'))[_0x49fd('0x17')](',\x20')));}var _0x23457c=_[_0x49fd('0x5c')](_0x481f6a['channels'],{'uniqueid':_0x23e5f2['uniqueid']});if(_0x23457c&&_0x23457c[_0x49fd('0x63')]){var _0x765bca=util[_0x49fd('0x9')]('%s.%s',_0x23e5f2[_0x49fd('0x64')]||_0x23e5f2[_0x49fd('0x65')],_0x23e5f2['format']||'wav');return ami['Action']({'action':_0x49fd('0x66'),'channel':_0x23457c['channel'],'file':_0x765bca,'options':'ai(mixmonitorid)'})['then'](function(_0x37860b){var _0x46d467=_[_0x49fd('0x5c')](_0x23457c[_0x49fd('0x67')],{'filename':_0x49fd('0x68')+_0x765bca[_0x49fd('0x69')]()});if(_[_0x49fd('0x6a')](_0x46d467)){_0x23457c[_0x49fd('0x67')][_0x49fd('0x5a')]({'filename':_0x49fd('0x68')+_0x765bca['toLowerCase'](),'createdAt':moment()[_0x49fd('0x9')](_0x49fd('0x6b')),'mixmonitorid':_0x37860b[_0x49fd('0x6c')],'status':_0x49fd('0x6d')});}else{_0x46d467[_0x49fd('0x6c')]=_0x37860b[_0x49fd('0x6c')];_0x46d467['status']=_0x49fd('0x6d');}_0x4b28fa({'code':0xc8,'message':[_0x23e5f2[_0x49fd('0x65')],'MixMonitor\x20Success',_0x37860b['mixmonitorid']][_0x49fd('0x17')]('\x20'),'mixmonitorid':_0x37860b['mixmonitorid']});})[_0x49fd('0x20')](function(_0x575bc5){_0x341728(_0x3ae66a[_0x49fd('0x13')](0x1f5,[_0x23e5f2['uniqueid'],_0x575bc5[_0x49fd('0x1f')][_0x49fd('0x69')]()]['join']('\x20')));});}else{return _0x341728(_0x3ae66a[_0x49fd('0x13')](0x1f5,_0x49fd('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x275a68){var _0x40f3bc=this;return new Promise(function(_0x1b7992,_0x41da82){if(ami[_0x49fd('0x12')]()==![]){return _0x41da82(_0x40f3bc[_0x49fd('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x49fd('0x14')][_0x49fd('0x15')],_0x49fd('0x16')]['join']('\x20')));}var _0x34613d=schema(properties[_0x49fd('0x61')])[_0x49fd('0x3')](_0x275a68);if(_0x34613d[_0x49fd('0x5b')]>0x0){return _0x41da82(_0x40f3bc[_0x49fd('0x13')](0x1f4,_[_0x49fd('0x62')](_0x34613d,_0x49fd('0x1f'))[_0x49fd('0x17')](',\x20')));}var _0x61d98c=_['find'](_0x481f6a[_0x49fd('0x60')],{'uniqueid':_0x275a68[_0x49fd('0x65')]});if(_0x61d98c){return BPromise['resolve']()[_0x49fd('0x1e')](function(){if(_0x61d98c[_0x49fd('0x63')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x61d98c['channel'],'mixmonitorid':_0x275a68[_0x49fd('0x6c')]})[_0x49fd('0x20')](function(_0x410bbe){});}})[_0x49fd('0x1e')](function(){if(_0x61d98c[_0x49fd('0x6f')]){return ami['Action']({'action':_0x49fd('0x70'),'channel':_0x61d98c['destinationchannel'],'mixmonitorid':_0x275a68[_0x49fd('0x6c')]})['catch'](function(_0x1e5279){});}})[_0x49fd('0x1e')](function(_0x234e2a){var _0x1cd930=_['find'](_0x61d98c[_0x49fd('0x67')],{'mixmonitorid':_0x275a68[_0x49fd('0x6c')]});if(_0x1cd930){_0x1cd930['status']=_0x49fd('0x71');}})[_0x49fd('0x1e')](function(){var _0xc3cddd=util['format'](_0x49fd('0x72'),_0x275a68[_0x49fd('0x64')]||_0x275a68[_0x49fd('0x65')],_0x275a68[_0x49fd('0x9')]||_0x49fd('0x73'));var _0x330c6d=_['find'](_0x61d98c['monitors'],{'filename':_0x49fd('0x68')+_0xc3cddd[_0x49fd('0x69')]()});if(_0x330c6d){_0x330c6d[_0x49fd('0x74')]=_0x49fd('0x71');}})[_0x49fd('0x1e')](function(){_0x1b7992({'code':0xc8,'message':[_0x275a68[_0x49fd('0x65')],_0x49fd('0x75')][_0x49fd('0x17')]('\x20')});})[_0x49fd('0x20')](function(_0x3cb9e9){_0x41da82(_0x40f3bc[_0x49fd('0x13')](0x1f5,[_0x275a68[_0x49fd('0x65')],_0x3cb9e9[_0x49fd('0x1f')]['toLowerCase']()][_0x49fd('0x17')]('\x20')));});}else{return _0x41da82(_0x40f3bc[_0x49fd('0x13')](0x1f5,_0x49fd('0x6e')));}});},'VoiceQueuesChannels':function(_0x561e58){return new Promise(function(_0x545603,_0x3a9985){var _0x1be81d=_[_0x49fd('0x5f')](_0x481f6a['queueChannels']);_0x545603({'count':_0x1be81d[_0x49fd('0x5b')],'rows':_0x1be81d});});},'VoiceQueuesChannel':function(_0x161767){var _0x162b84=this;return new Promise(function(_0x3ce72c,_0x1a3555){var _0x24ad9f=schema(properties[_0x49fd('0x76')])['validate'](_0x161767);if(_0x24ad9f['length']>0x0){return _0x1a3555(_0x162b84[_0x49fd('0x13')](0x1f4,_['map'](_0x24ad9f,_0x49fd('0x1f'))['join'](',\x20')));}var _0x593346=_['find'](_0x481f6a[_0x49fd('0x77')],{'uniqueid':_0x161767[_0x49fd('0x65')]});if(_0x593346){_0x3ce72c(_0x593346);}else{return _0x1a3555(_0x162b84['error'](0x1f5,_0x49fd('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x3bca7b){var _0x4c3a12=this;return new Promise(function(_0x67f0f5,_0x2ba14a){if(ami['isConnected']()==![]){return _0x2ba14a(_0x4c3a12[_0x49fd('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x49fd('0x14')][_0x49fd('0x15')],'ami\x20disconnected'][_0x49fd('0x17')]('\x20')));}var _0x27132c=schema(properties['voicequeuechannelhangup'])[_0x49fd('0x3')](_0x3bca7b);if(_0x27132c[_0x49fd('0x5b')]>0x0){return _0x2ba14a(_0x4c3a12[_0x49fd('0x13')](0x1f4,_[_0x49fd('0x62')](_0x27132c,_0x49fd('0x1f'))[_0x49fd('0x17')](',\x20')));}var _0x1ffd5f=_[_0x49fd('0x5c')](_0x481f6a['queueChannels'],{'uniqueid':_0x3bca7b['uniqueid']});if(_0x1ffd5f&&_0x1ffd5f[_0x49fd('0x63')]){return ami[_0x49fd('0x1d')]({'action':'Hangup','channel':_0x1ffd5f[_0x49fd('0x63')]})[_0x49fd('0x1e')](function(_0x5a2794){_0x67f0f5({'code':0xc8,'message':[_0x3bca7b[_0x49fd('0x65')],_0x5a2794[_0x49fd('0x1f')][_0x49fd('0x69')]()][_0x49fd('0x17')]('\x20')});})['catch'](function(_0x33c908){_0x2ba14a(_0x4c3a12[_0x49fd('0x13')](0x1f5,[_0x3bca7b[_0x49fd('0x65')],_0x33c908[_0x49fd('0x1f')][_0x49fd('0x69')]()][_0x49fd('0x17')]('\x20')));});}else{return _0x2ba14a(_0x4c3a12[_0x49fd('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x1d04d5){var _0x31dec5=this;return new Promise(function(_0x3c86dc,_0x373ce0){if(ami[_0x49fd('0x12')]()==![]){return _0x373ce0(_0x31dec5[_0x49fd('0x13')](0x1f4,[config[_0x49fd('0x14')]['ip'],config[_0x49fd('0x14')][_0x49fd('0x15')],_0x49fd('0x16')][_0x49fd('0x17')]('\x20')));}var _0x40c089=schema(properties[_0x49fd('0x78')])[_0x49fd('0x3')](_0x1d04d5);if(_0x40c089[_0x49fd('0x5b')]>0x0){return _0x373ce0(_0x31dec5[_0x49fd('0x13')](0x1f4,_[_0x49fd('0x62')](_0x40c089,_0x49fd('0x1f'))[_0x49fd('0x17')](',\x20')));}var _0x1ba291=_['find'](_0x481f6a[_0x49fd('0x77')],{'uniqueid':_0x1d04d5['uniqueid']});if(_0x1ba291&&_0x1ba291[_0x49fd('0x63')]){return ami[_0x49fd('0x1d')]({'action':'Redirect','channel':_0x1ba291['channel'],'exten':_0x1d04d5[_0x49fd('0x79')],'context':_0x1d04d5[_0x49fd('0x7a')]||_0x1ba291[_0x49fd('0x7a')],'priority':0x1})['then'](function(_0x1c0136){_0x3c86dc({'code':0xc8,'message':[_0x1d04d5['uniqueid'],_0x1c0136[_0x49fd('0x1f')][_0x49fd('0x69')]()]['join']('\x20')});})['catch'](function(_0x51afb5){_0x373ce0(_0x31dec5[_0x49fd('0x13')](0x1f5,[_0x1d04d5['uniqueid'],_0x51afb5[_0x49fd('0x1f')][_0x49fd('0x69')]()][_0x49fd('0x17')]('\x20')));});}else{return _0x373ce0(_0x31dec5['error'](0x1f5,_0x49fd('0x6e')));}});},'Agents':function(_0x5b49e8){return new Promise(function(_0xceaa75,_0x24315e){var _0x58d948=_[_0x49fd('0x5f')](_0x481f6a[_0x49fd('0xe')]);_0xceaa75({'count':_0x58d948[_0x49fd('0x5b')],'rows':_0x58d948});});},'Telephones':function(_0x5e73a7){return new Promise(function(_0x1f3678,_0x3b91d0){var _0x3f063e=_[_0x49fd('0x5f')](_0x481f6a['telephones']);_0x1f3678({'count':_0x3f063e[_0x49fd('0x5b')],'rows':_0x3f063e});});},'Trunks':function(_0x268029){return new Promise(function(_0x9fbe94,_0x232f6f){var _0x5ec8ac=_['values'](_0x481f6a[_0x49fd('0x7b')]);_0x9fbe94({'count':_0x5ec8ac['length'],'rows':_0x5ec8ac});});},'OutboundChannels':function(_0x365d33){return new Promise(function(_0x3b2ac0,_0x377d62){var _0x25457f=_['values'](_0x481f6a[_0x49fd('0x7c')]);_0x3b2ac0({'count':_0x25457f[_0x49fd('0x5b')],'rows':_0x25457f});});},'Outbound':function(_0x574e8a){return new Promise(function(_0x557189,_0x20f97d){_0x557189(_0x481f6a['outbound']);});},'Campaigns':function(_0x2b506c){return new Promise(function(_0x30c38c,_0x2a4af6){var _0x4dc0bd=_[_0x49fd('0x5f')](_0x481f6a['campaigns']);_0x30c38c({'count':_0x4dc0bd[_0x49fd('0x5b')],'rows':_0x4dc0bd});});},'VoiceQueuesPreview':function(_0x5d638d){var _0x156f8e=this;return new Promise(function(_0x5f02fa,_0x5c28d7){_0x3b4b46[_0x49fd('0x7d')](_0x5d638d['id'])['then'](function(_0x36f200){_0x5f02fa({'code':0xc8,'message':_0x36f200[_0x49fd('0x1f')]});})[_0x49fd('0x20')](function(_0x5e1943){_0x5c28d7(_0x156f8e[_0x49fd('0x13')](0x1f4,_0x5e1943['message']));});});},'EventManager':function(_0x1deda5){var _0x59a9e8=this;return new Promise(function(_0x25bb21,_0x4b53d0){if(!_0x1deda5['event']){return _0x4b53d0(_0x59a9e8['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x49fd('0x7e')+_0x1deda5[_0x49fd('0x7f')],_0x1deda5[_0x49fd('0x1f')]);_0x25bb21({'code':0xc8,'message':_0x1deda5});});},'FaxAccounts':function(_0x5a6c59){return new Promise(function(_0x78a4de,_0x40d20e){var _0x20326b=_['values'](_0x481f6a[_0x49fd('0x80')]);_0x78a4de({'count':_0x20326b['length'],'rows':_0x20326b});});},'SendFax':function(_0x574fdc){var _0x485396=this;return new Promise(function(_0xd23a0a,_0x148a2b){_0x42fdc7[_0x49fd('0x81')](_0x574fdc)[_0x49fd('0x1e')](function(_0x232bab){_0xd23a0a({'code':0xc8,'message':_0x232bab[_0x49fd('0x1f')]});})[_0x49fd('0x20')](function(_0x265b81){_0x148a2b(_0x485396['error'](0x1f4,_0x265b81[_0x49fd('0x1f')]));});});},'CheckAfterSend':function(_0x11b242){var _0x4997e6=this;return new Promise(function(_0x30c14a,_0x47bba4){_0x42fdc7['checkAfterSend'](_0x11b242)[_0x49fd('0x1e')](function(_0x206543){_0x30c14a({'code':0xc8,'message':_0x206543['message']});})[_0x49fd('0x20')](function(_0xe9596f){_0x47bba4(_0x4997e6[_0x49fd('0x13')](0x1f4,_0xe9596f[_0x49fd('0x1f')]));});});}};var _0x45153b=jayson[_0x49fd('0x82')](_0x48b999)['http']();_0x45153b['on']('error',function(_0x549914){return _0x9353cd(_0x549914);});_0x45153b[_0x49fd('0x83')](0x232a,'127.0.0.1',function(){console[_0x49fd('0x84')](_0x49fd('0x85'),0x232a);return _0x1bc16e(_0x49fd('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 2cb8509..f8afdb7 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 _0xbd50=['lastName','mobile','fax','createdAt','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName'];(function(_0xbb6185,_0x98d595){var _0x435d96=function(_0x8e0918){while(--_0x8e0918){_0xbb6185['push'](_0xbb6185['shift']());}};_0x435d96(++_0x98d595);}(_0xbd50,0x196));var _0x0bd5=function(_0x112734,_0x2e0d98){_0x112734=_0x112734-0x0;var _0x4a82ef=_0xbd50[_0x112734];return _0x4a82ef;};'use strict';var _=require(_0x0bd5('0x0'));var BPromise=require(_0x0bd5('0x1'));var Redis=require(_0x0bd5('0x2'));var util=require('util');var config=require(_0x0bd5('0x3'));var logger=require(_0x0bd5('0x4'))(_0x0bd5('0x5'));var cmContactRpc=require(_0x0bd5('0x6'));config[_0x0bd5('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0bd5('0x8'))(new Redis(config[_0x0bd5('0x7')]));function emit(_0xcc6cfa,_0x2c0db1,_0x1b99f3,_0x5ebe64,_0x47e78d){logger[_0x0bd5('0x9')](_0x0bd5('0xa'),_0xcc6cfa,_0x2c0db1['id'],_0x1b99f3,_0x5ebe64,JSON[_0x0bd5('0xb')](_0x47e78d));io['to'](_0x1b99f3)['emit'](_0x5ebe64,_0x47e78d);}exports[_0x0bd5('0xc')]=function(_0x2fa7d1,_0x519bc6,_0x210f45,_0x7db86e){var _0x4d7d17,_0x1ce7dd;var _0x130723={};var _0x1aa818=Number(_0x210f45['data1']);var _0x2f7a0c=_0x210f45[_0x0bd5('0xd')]?Boolean(Number(_0x210f45[_0x0bd5('0xd')])):![];var _0xc5b4cd;var _0xfa1eed=![];if(!_[_0x0bd5('0xe')](_0x210f45[_0x0bd5('0xf')])){if(_0x210f45[_0x0bd5('0xf')]=='1')_0xfa1eed=!![];}if(!_0xfa1eed){if(_0x7db86e['xmd-contactid']){_0x130723['id']=_0x7db86e[_0x0bd5('0x10')];}}if(!_0x130723['id']){_0x130723[_0x0bd5('0x11')]=_0x1aa818;_0xc5b4cd=_0x210f45['data3']&&_0x210f45[_0x0bd5('0x12')]!=='0'?_0x210f45[_0x0bd5('0x12')][_0x0bd5('0x13')](','):[_0x0bd5('0x14')];_0x130723['$or']=_[_0x0bd5('0x15')](_0xc5b4cd,function(_0x2e4f36){var _0xa890be={};_0xa890be[_0x2e4f36]=_0x7db86e[_0x0bd5('0x16')]?_0x7db86e[_0x0bd5('0x17')]:_0x7db86e[_0x0bd5('0x18')];return _0xa890be;});}var _0xc58e12=['id',_0x0bd5('0x19'),_0x0bd5('0x1a'),_0x0bd5('0x14'),_0x0bd5('0x1b'),_0x0bd5('0x1c'),_0x0bd5('0x11'),_0x0bd5('0x1d'),'scheduledAt','updatedAt'];var _0x596b6a=_['union'](_0xc58e12,_0xc5b4cd);BPromise['resolve']()[_0x0bd5('0x1e')](cmContactRpc[_0x0bd5('0x1f')]({'attributes':_0x596b6a,'where':_0x130723}))[_0x0bd5('0x1e')](function(_0x4a6910){_0x1ce7dd=_0x4a6910;if(!_[_0x0bd5('0x20')](_0x1ce7dd)){if(_0x1ce7dd['length']===0x1){_0x4d7d17=_0x1ce7dd[0x0];logger[_0x0bd5('0x9')](_0x0bd5('0x21'),_0x7db86e[_0x0bd5('0x22')],_0x519bc6['id'],_0x4d7d17['id']);}else{logger['info'](_0x0bd5('0x23'),_0x7db86e['uniqueid'],_0x519bc6['id'],_['map'](_0x1ce7dd,'id')[_0x0bd5('0x24')](','));}return;}else{logger[_0x0bd5('0x9')](_0x0bd5('0x25'),_0x7db86e['uniqueid'],_0x519bc6['id']);var _0x42428c={'ListId':_0x1aa818};var _0x5eab3e=_0x210f45[_0x0bd5('0x26')]&&_0x210f45[_0x0bd5('0x26')]!=='0'?_0x210f45[_0x0bd5('0x26')]:_0x0bd5('0x14');if(_0x2f7a0c){logger[_0x0bd5('0x9')](_0x0bd5('0x27'),_0x7db86e[_0x0bd5('0x22')],_0x519bc6['id']);_0x42428c[_0x5eab3e]=_[_0x0bd5('0xe')](_0x7db86e[_0x0bd5('0x16')])?_0x7db86e[_0x0bd5('0x18')]:_0x7db86e[_0x0bd5('0x17')];if(_[_0x0bd5('0xe')](_0x7db86e[_0x0bd5('0x16')])){_0x42428c[_0x0bd5('0x19')]=_0x7db86e['calleridname']&&_0x7db86e[_0x0bd5('0x28')]!==_0x0bd5('0x29')?_0x7db86e['calleridname']:_0x0bd5('0x2a');}else{_0x42428c[_0x0bd5('0x19')]=_0x7db86e['destcalleridname']&&_0x7db86e[_0x0bd5('0x2b')]!==_0x0bd5('0x29')?_0x7db86e[_0x0bd5('0x2b')]:_0x0bd5('0x2a');}return BPromise['resolve']()[_0x0bd5('0x1e')](cmContactRpc[_0x0bd5('0x2c')](_0x42428c))[_0x0bd5('0x1e')](function(_0x24ef4a){_0x4d7d17=_0x24ef4a;_0x1ce7dd[_0x0bd5('0x2d')](_0x24ef4a);if(_0x4d7d17){logger[_0x0bd5('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x7db86e[_0x0bd5('0x22')],_0x519bc6['id'],_0x4d7d17['id']);}return;});}else{logger['info'](_0x0bd5('0x2e'),_0x7db86e[_0x0bd5('0x22')],_0x519bc6['id']);_0x42428c[_0x5eab3e]=_[_0x0bd5('0xe')](_0x7db86e[_0x0bd5('0x16')])?_0x7db86e[_0x0bd5('0x18')]:_0x7db86e[_0x0bd5('0x17')];if(_[_0x0bd5('0xe')](_0x7db86e[_0x0bd5('0x16')])){_0x42428c[_0x0bd5('0x19')]=_0x7db86e[_0x0bd5('0x28')]&&_0x7db86e[_0x0bd5('0x28')]!==_0x0bd5('0x29')?_0x7db86e[_0x0bd5('0x28')]:'Unknown';}else{_0x42428c[_0x0bd5('0x19')]=_0x7db86e[_0x0bd5('0x2b')]&&_0x7db86e['destcalleridname']!==''?_0x7db86e[_0x0bd5('0x2b')]:_0x0bd5('0x2a');}_0x4d7d17=_0x42428c;_0x1ce7dd[_0x0bd5('0x2d')](_0x42428c);return;}}})[_0x0bd5('0x1e')](function(){if(_0x2fa7d1){emit(_0x7db86e[_0x0bd5('0x22')],_0x519bc6,util[_0x0bd5('0x2f')](_0x0bd5('0x30'),_0x2fa7d1[_0x0bd5('0x31')]),util[_0x0bd5('0x2f')](_0x0bd5('0x32'),_0x210f45[_0x0bd5('0x33')][_0x0bd5('0x34')]()),{'evt':_[_0x0bd5('0x35')](_0x7db86e,{'autoCreate':_0x2f7a0c}),'contact':_0x4d7d17===undefined?{}:_0x4d7d17,'contacts':_0x1ce7dd['length']===0x0?undefined:_0x1ce7dd});}});}; \ No newline at end of file +var _0x8d0e=['destcalleridnum','calleridname','','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','Unknown','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','info','[CM][%s][%s]','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','split','$or','map','calleridnum','firstName','lastName','phone','fax','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId'];(function(_0x24d587,_0x54f833){var _0x205c54=function(_0x4b83c1){while(--_0x4b83c1){_0x24d587['push'](_0x24d587['shift']());}};_0x205c54(++_0x54f833);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2a97db,_0x4d5ba1){_0x2a97db=_0x2a97db-0x0;var _0x3ef37d=_0x8d0e[_0x2a97db];return _0x3ef37d;};'use strict';var _=require(_0xe8d0('0x0'));var BPromise=require(_0xe8d0('0x1'));var Redis=require(_0xe8d0('0x2'));var util=require(_0xe8d0('0x3'));var config=require(_0xe8d0('0x4'));var logger=require(_0xe8d0('0x5'))(_0xe8d0('0x6'));var cmContactRpc=require(_0xe8d0('0x7'));config[_0xe8d0('0x8')]=_['defaults'](config[_0xe8d0('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe8d0('0x8')]));function emit(_0x92483d,_0x469d37,_0xcc03d0,_0x2b6dce,_0x13aa63){logger[_0xe8d0('0x9')](_0xe8d0('0xa'),_0x92483d,_0x469d37['id'],_0xcc03d0,_0x2b6dce,JSON['stringify'](_0x13aa63));io['to'](_0xcc03d0)[_0xe8d0('0xb')](_0x2b6dce,_0x13aa63);}exports[_0xe8d0('0xc')]=function(_0x463159,_0x599bc3,_0x580aab,_0x42e0c2){var _0x25e6b8,_0x3da047;var _0x10b345={};var _0x314657=Number(_0x580aab[_0xe8d0('0xd')]);var _0x5934b2=_0x580aab[_0xe8d0('0xe')]?Boolean(Number(_0x580aab[_0xe8d0('0xe')])):![];var _0x533b42;var _0x2b640d=![];if(!_['isNil'](_0x580aab['data5'])){if(_0x580aab[_0xe8d0('0xf')]=='1')_0x2b640d=!![];}if(!_0x2b640d){if(_0x42e0c2[_0xe8d0('0x10')]){_0x10b345['id']=_0x42e0c2[_0xe8d0('0x10')];}}if(!_0x10b345['id']){_0x10b345[_0xe8d0('0x11')]=_0x314657;_0x533b42=_0x580aab[_0xe8d0('0x12')]&&_0x580aab[_0xe8d0('0x12')]!=='0'?_0x580aab['data3'][_0xe8d0('0x13')](','):['phone'];_0x10b345[_0xe8d0('0x14')]=_[_0xe8d0('0x15')](_0x533b42,function(_0xfe8a4){var _0x4d1db4={};_0x4d1db4[_0xfe8a4]=_0x42e0c2['routeId']?_0x42e0c2['destcalleridnum']:_0x42e0c2[_0xe8d0('0x16')];return _0x4d1db4;});}var _0x384854=['id',_0xe8d0('0x17'),_0xe8d0('0x18'),_0xe8d0('0x19'),'mobile',_0xe8d0('0x1a'),_0xe8d0('0x11'),'createdAt','scheduledAt','updatedAt'];var _0x384a60=_[_0xe8d0('0x1b')](_0x384854,_0x533b42);BPromise[_0xe8d0('0x1c')]()[_0xe8d0('0x1d')](cmContactRpc[_0xe8d0('0x1e')]({'attributes':_0x384a60,'where':_0x10b345}))[_0xe8d0('0x1d')](function(_0x1bd25c){_0x3da047=_0x1bd25c;if(!_[_0xe8d0('0x1f')](_0x3da047)){if(_0x3da047[_0xe8d0('0x20')]===0x1){_0x25e6b8=_0x3da047[0x0];logger['info'](_0xe8d0('0x21'),_0x42e0c2[_0xe8d0('0x22')],_0x599bc3['id'],_0x25e6b8['id']);}else{logger['info'](_0xe8d0('0x23'),_0x42e0c2[_0xe8d0('0x22')],_0x599bc3['id'],_[_0xe8d0('0x15')](_0x3da047,'id')[_0xe8d0('0x24')](','));}return;}else{logger[_0xe8d0('0x9')](_0xe8d0('0x25'),_0x42e0c2[_0xe8d0('0x22')],_0x599bc3['id']);var _0x32f0c1={'ListId':_0x314657};var _0xfa3527=_0x580aab[_0xe8d0('0x26')]&&_0x580aab[_0xe8d0('0x26')]!=='0'?_0x580aab['data4']:_0xe8d0('0x19');if(_0x5934b2){logger[_0xe8d0('0x9')](_0xe8d0('0x27'),_0x42e0c2['uniqueid'],_0x599bc3['id']);_0x32f0c1[_0xfa3527]=_[_0xe8d0('0x28')](_0x42e0c2[_0xe8d0('0x29')])?_0x42e0c2['calleridnum']:_0x42e0c2[_0xe8d0('0x2a')];if(_[_0xe8d0('0x28')](_0x42e0c2[_0xe8d0('0x29')])){_0x32f0c1[_0xe8d0('0x17')]=_0x42e0c2[_0xe8d0('0x2b')]&&_0x42e0c2['calleridname']!==_0xe8d0('0x2c')?_0x42e0c2['calleridname']:'Unknown';}else{_0x32f0c1['firstName']=_0x42e0c2[_0xe8d0('0x2d')]&&_0x42e0c2[_0xe8d0('0x2d')]!==_0xe8d0('0x2c')?_0x42e0c2['destcalleridname']:'Unknown';}return BPromise[_0xe8d0('0x1c')]()['then'](cmContactRpc[_0xe8d0('0x2e')](_0x32f0c1))[_0xe8d0('0x1d')](function(_0x327004){_0x25e6b8=_0x327004;_0x3da047[_0xe8d0('0x2f')](_0x327004);if(_0x25e6b8){logger[_0xe8d0('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x42e0c2[_0xe8d0('0x22')],_0x599bc3['id'],_0x25e6b8['id']);}return;});}else{logger[_0xe8d0('0x9')](_0xe8d0('0x30'),_0x42e0c2[_0xe8d0('0x22')],_0x599bc3['id']);_0x32f0c1[_0xfa3527]=_['isNil'](_0x42e0c2[_0xe8d0('0x29')])?_0x42e0c2[_0xe8d0('0x16')]:_0x42e0c2['destcalleridnum'];if(_[_0xe8d0('0x28')](_0x42e0c2['routeId'])){_0x32f0c1[_0xe8d0('0x17')]=_0x42e0c2['calleridname']&&_0x42e0c2[_0xe8d0('0x2b')]!==''?_0x42e0c2[_0xe8d0('0x2b')]:_0xe8d0('0x31');}else{_0x32f0c1[_0xe8d0('0x17')]=_0x42e0c2[_0xe8d0('0x2d')]&&_0x42e0c2['destcalleridname']!==_0xe8d0('0x2c')?_0x42e0c2[_0xe8d0('0x2d')]:_0xe8d0('0x31');}_0x25e6b8=_0x32f0c1;_0x3da047['push'](_0x32f0c1);return;}}})[_0xe8d0('0x1d')](function(){if(_0x463159){emit(_0x42e0c2[_0xe8d0('0x22')],_0x599bc3,util[_0xe8d0('0x32')](_0xe8d0('0x33'),_0x463159[_0xe8d0('0x34')]),util['format'](_0xe8d0('0x35'),_0x580aab[_0xe8d0('0x36')][_0xe8d0('0x37')]()),{'evt':_[_0xe8d0('0x38')](_0x42e0c2,{'autoCreate':_0x5934b2}),'contact':_0x25e6b8===undefined?{}:_0x25e6b8,'contacts':_0x3da047[_0xe8d0('0x20')]===0x0?undefined:_0x3da047});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index a45f011..51ef607 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 _0xcb1a=['location','uriLocation','800','windowHeight','data6','600','winArguments','format','user:%s','trigger:%s:%s','jscripty','name','trigger:%s','exec','integration','urlforward','script','buildUri','parse','query','search','replace','AllConditions','length','every','channel','AnyConditions','some','checkConditions','field','account','ChatWebsiteId','upperFirst','operator','value','AccountId','interaction','message','event','queue','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','./integration','./script','../../../config/environment','trigger','../ami','redis','defaults','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','deskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','motionChannel','undefined','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','isNil','data3','data4'];(function(_0x4e5123,_0x47ee95){var _0x297c28=function(_0x3fcfcf){while(--_0x3fcfcf){_0x4e5123['push'](_0x4e5123['shift']());}};_0x297c28(++_0x47ee95);}(_0xcb1a,0xb6));var _0xacb1=function(_0x3a9fa2,_0x5c8cd4){_0x3a9fa2=_0x3a9fa2-0x0;var _0x5dd2e9=_0xcb1a[_0x3a9fa2];return _0x5dd2e9;};'use strict';var util=require(_0xacb1('0x0'));var _=require(_0xacb1('0x1'));var url=require(_0xacb1('0x2'));var Mustache=require(_0xacb1('0x3'));var Redis=require('ioredis');var urlforward=require('./urlforward');var integration=require(_0xacb1('0x4'));var cmContact=require('./cmContact');var script=require(_0xacb1('0x5'));var config=require(_0xacb1('0x6'));var logger=require('../../../config/logger')(_0xacb1('0x7'));var ami=require(_0xacb1('0x8'));config[_0xacb1('0x9')]=_[_0xacb1('0xa')](config[_0xacb1('0x9')],{'host':_0xacb1('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xacb1('0x9')]));var operators={'equals':function(_0x6dc009,_0xbe8947){return _0x6dc009==_0xbe8947;},'not_equals':function(_0x1492f3,_0x257d6a){return _0x1492f3!=_0x257d6a;}};var barAndWebActions=[_0xacb1('0xc'),_0xacb1('0x2'),_0xacb1('0xd')];function Trigger(_0x1d97a2){this[_0xacb1('0xe')]=_0x1d97a2[_0xacb1('0xe')];this['agents']=_0x1d97a2[_0xacb1('0xf')];this[_0xacb1('0x10')]=_0x1d97a2['voiceQueues'];this['templates']=_0x1d97a2[_0xacb1('0x11')];this[_0xacb1('0x12')]=_0x1d97a2[_0xacb1('0x12')];this[_0xacb1('0x13')]=_0x1d97a2[_0xacb1('0x13')];this[_0xacb1('0x14')]=_0x1d97a2['freshdeskAccounts'];this[_0xacb1('0x15')]=_0x1d97a2['salesforceAccounts'];this[_0xacb1('0x16')]=_0x1d97a2[_0xacb1('0x16')];this[_0xacb1('0x17')]=_0x1d97a2[_0xacb1('0x17')];this['deskAccounts']=_0x1d97a2['deskAccounts'];this[_0xacb1('0x18')]=_0x1d97a2[_0xacb1('0x18')];this[_0xacb1('0x19')]=_0x1d97a2[_0xacb1('0x19')];this[_0xacb1('0x1a')]=_0x1d97a2[_0xacb1('0x1a')];this[_0xacb1('0x1b')]=_0x1d97a2[_0xacb1('0x1b')];this[_0xacb1('0x1c')]={'zendesk':this[_0xacb1('0x13')],'salesforce':this[_0xacb1('0x15')],'freshdesk':this[_0xacb1('0x14')],'sugarcrm':this[_0xacb1('0x16')],'zoho':this[_0xacb1('0x17')],'desk':this[_0xacb1('0x1d')],'vtiger':this[_0xacb1('0x18')],'dynamics365':this[_0xacb1('0x1a')],'freshsales':this[_0xacb1('0x1b')],'servicenow':this[_0xacb1('0x19')]};ami['on'](_0xacb1('0x1e'),this[_0xacb1('0x1f')][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x21'),this[_0xacb1('0x1f')][_0xacb1('0x20')](this));ami['on']('custom:agentringnoanswer',this[_0xacb1('0x1f')][_0xacb1('0x20')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x22'),this['syncCustomEvent'][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x23'),this[_0xacb1('0x1f')][_0xacb1('0x20')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x24'),this['syncCustomEvent'][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x25'),this[_0xacb1('0x1f')][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x26'),this['syncCustomEvent'][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x27'),this['syncCustomEvent'][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x28'),this[_0xacb1('0x1f')]['bind'](this));ami['on'](_0xacb1('0x29'),this[_0xacb1('0x2a')]['bind'](this));ami['on'](_0xacb1('0x2b'),this[_0xacb1('0x2a')][_0xacb1('0x20')](this));ami['on']('custom:dialend',this['syncAgentDial'][_0xacb1('0x20')](this));ami['on']('custom:newinteraction',this[_0xacb1('0x1f')][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x2c'),this[_0xacb1('0x1f')][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x2d'),this[_0xacb1('0x1f')][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x2e'),this[_0xacb1('0x1f')][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x2f'),this[_0xacb1('0x1f')][_0xacb1('0x20')](this));ami['on'](_0xacb1('0x30'),this[_0xacb1('0x1f')]['bind'](this));ami['on'](_0xacb1('0x31'),this[_0xacb1('0x1f')]['bind'](this));ami['on'](_0xacb1('0x32'),this[_0xacb1('0x1f')]['bind'](this));}Trigger[_0xacb1('0x33')][_0xacb1('0x34')]=function(_0x2777a6,_0x569636,_0x12f335){logger[_0xacb1('0x35')](_0x2777a6,_0x569636,JSON[_0xacb1('0x36')](_0x12f335));io['to'](_0x2777a6)[_0xacb1('0x34')](_0x569636,_0x12f335);};Trigger[_0xacb1('0x33')][_0xacb1('0x1f')]=function(_0xb833be){var _0x215355=_['clone'](_0xb833be);if(typeof _0x215355[_0xacb1('0x37')]===_0xacb1('0x38')){_0x215355[_0xacb1('0x37')]='voice';}this[_0xacb1('0x39')](_0x215355);};Trigger[_0xacb1('0x33')]['syncAgentDial']=function(_0x1bfed1){if(this[_0xacb1('0xf')][_0x1bfed1[_0xacb1('0x3a')]]){this[_0xacb1('0x1f')](_0x1bfed1);}};Trigger['prototype'][_0xacb1('0x39')]=function(_0x188caa){var _0x3f6136;for(var _0x46feea in this['triggers']){if(this[_0xacb1('0xe')][_0xacb1('0x3b')](_0x46feea)){if(this[_0xacb1('0xe')][_0x46feea][_0xacb1('0x3c')]){_0x3f6136=this[_0xacb1('0x3d')](this[_0xacb1('0xe')][_0x46feea],_0x188caa);if(_0x3f6136){_[_0xacb1('0x3e')](_0x188caa,_0x188caa[_0xacb1('0x3f')]);for(var _0x4d8d13=0x0,_0x1f79a6,_0x319090,_0x3a76c5;_0x4d8d130x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x4d9d48,_0x3a2cdf){var _0x566cd1=function(_0x248260){while(--_0x248260){_0x4d9d48['push'](_0x4d9d48['shift']());}};_0x566cd1(++_0x3a2cdf);}(_0x55ca,0x126));var _0xa55c=function(_0x310448,_0x59f6bd){_0x310448=_0x310448-0x0;var _0xc0124b=_0x55ca[_0x310448];return _0xc0124b;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ 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 ba5ddd1..dd561b4 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 _0xb506=['then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','validateEmail','userEmail','email','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','systemuserid','message','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','enduserId',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','customField','idField','indexOf','content','incident','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','username','password','clientSecret','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!'];(function(_0x47dcb3,_0x264f61){var _0xe01dd0=function(_0x297c76){while(--_0x297c76){_0x47dcb3['push'](_0x47dcb3['shift']());}};_0xe01dd0(++_0x264f61);}(_0xb506,0x18d));var _0x6b50=function(_0x4a4411,_0x2a644e){_0x4a4411=_0x4a4411-0x0;var _0x520572=_0xb506[_0x4a4411];return _0x520572;};'use strict';var _=require(_0x6b50('0x0'));var rp=require(_0x6b50('0x1'));var util=require(_0x6b50('0x2'));var intUtil=require(_0x6b50('0x3'));var md5=require(_0x6b50('0x4'));var Redis=require(_0x6b50('0x5'));var logger=require(_0x6b50('0x6'))(_0x6b50('0x7'));var config=require(_0x6b50('0x8'));config[_0x6b50('0x9')]=_['defaults'](config[_0x6b50('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x6b50('0xa'))(new Redis(config['redis']));function getAuthToken(_0x2ac5b7,_0x53568c,_0x2944e4){if(_0x2ac5b7[_0x6b50('0xb')]){_0x2ac5b7[_0x6b50('0xc')]=_0x2ac5b7[_0x6b50('0xd')][_0x6b50('0xe')];_0x2ac5b7[_0x6b50('0xf')]=_0x2ac5b7['CloudProvider'][_0x6b50('0x10')];return Promise[_0x6b50('0x11')](_0x2ac5b7[_0x6b50('0xd')][_0x6b50('0x12')]);}var _0x57f72b={'method':_0x6b50('0x13'),'uri':_0x53568c,'form':{'client_id':_0x2ac5b7['clientId'],'resource':_0x2ac5b7['remoteUri'],'username':_0x2ac5b7[_0x6b50('0x14')],'password':_0x2ac5b7[_0x6b50('0x15')],'grant_type':_0x6b50('0x15'),'client_secret':_0x2ac5b7[_0x6b50('0x16')]},'json':!![]};return rp(_0x57f72b)['then'](function(_0x3d6f29){return _0x3d6f29[_0x6b50('0x17')];})[_0x6b50('0x18')](function(_0x393e44){logger['error']('['+[_0x2944e4[_0x6b50('0x19')]()]+_0x6b50('0x1a'));return _0x393e44['message'];});}function getUser(_0x24d103,_0x3f6c9f,_0x3ca928,_0x113450,_0x29db86,_0x1da826){return new Promise(function(_0x244d85,_0x4a83e9){return getAuthToken(_0x3f6c9f,_0x113450,_0x1da826)[_0x6b50('0x1b')](function(_0x57b129){var _0x24e4b8={'method':'GET','uri':_0x29db86+_0x6b50('0x1c'),'headers':{'Authorization':_0x6b50('0x1d')+_0x57b129,'OData-Version':_0x6b50('0x1e')},'json':!![]};return rp(_0x24e4b8);})[_0x6b50('0x1b')](function(_0x100a2f){var _0x298608=_0x100a2f['value'];var _0x5ba174=![];var _0x165e23=null;if(!_['isNil'](_0x3ca928)){if(intUtil[_0x6b50('0x1f')](_0x3ca928['email'])){_0x24d103[_0x6b50('0x20')]=_0x3ca928[_0x6b50('0x21')];for(_0x165e23=0x0;_0x165e23<_0x298608['length'];_0x165e23++){if(_0x298608[_0x165e23][_0x6b50('0x22')]===_0x3ca928[_0x6b50('0x21')]&&!_0x298608[_0x165e23][_0x6b50('0x23')]){_0x5ba174=!![];logger[_0x6b50('0x24')]('['+[_0x1da826[_0x6b50('0x19')]()]+_0x6b50('0x25')+_0x298608[_0x165e23]['systemuserid']+'!');_0x24d103[_0x6b50('0x26')]=_0x298608[_0x165e23]['systemuserid'];}}}}if(!_0x5ba174){logger['info']('['+[_0x1da826[_0x6b50('0x19')]()]+_0x6b50('0x27'));_0x24d103[_0x6b50('0x20')]=_0x3f6c9f['username'];for(_0x165e23=0x0;_0x165e23<_0x298608[_0x6b50('0x28')];_0x165e23++){if(_0x298608[_0x165e23]['internalemailaddress']===_0x3f6c9f[_0x6b50('0x14')]){_0x24d103['userId']=_0x298608[_0x165e23][_0x6b50('0x29')];}}}_0x244d85(_0x24d103);})['catch'](function(_0x15db89){_0x4a83e9(_0x15db89[_0x6b50('0x2a')]);});});}function createEndUser(_0xba90a0,_0x4d15d6,_0x13e184,_0xce81ce,_0x4bafc6,_0x4671ce){return new Promise(function(_0x96c5a3,_0x1f2295){return getAuthToken(_0x4d15d6,_0x13e184,_0x4671ce)['then'](function(_0x365b4a){var _0x34f2dd=_0x4671ce[_0x6b50('0x2b')]()===_0x6b50('0x2c')?_0x4bafc6[_0x6b50('0x2d')]:_0x4bafc6[_0x6b50('0x2e')];var _0x925fee={'method':_0x6b50('0x13'),'uri':_0xce81ce+_0x6b50('0x2f'),'body':{'telephone1':_0x34f2dd,'fullname':_0x34f2dd,'firstname':_0x34f2dd,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6b50('0x30')+_0xba90a0['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x365b4a,'OData-Version':_0x6b50('0x1e')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x925fee);})[_0x6b50('0x1b')](function(_0x818806){var _0x165671=_0x818806[_0x6b50('0x31')][_0x6b50('0x32')];var _0x1439d5=_0x165671[_0x6b50('0x33')](_0x165671[_0x6b50('0x34')]('(')+0x1,_0x165671['lastIndexOf'](')'));_0xba90a0['enduserId']=_0x1439d5;_0x96c5a3(_0xba90a0);})['catch'](function(_0x7b50ba){_0x1f2295(_0x7b50ba[_0x6b50('0x2a')]);});});}function getEndUser(_0x4cca3d,_0x453882,_0x2739b5,_0xfedac6,_0x3fb2be,_0x3dd0ec,_0x9008a4){var _0x312e40=_0x3dd0ec[_0x6b50('0x2b')]()==='outbound'?_0x3fb2be[_0x6b50('0x2d')]:_0x3fb2be['calleridnum'];return getAuthToken(_0x453882,_0x2739b5,_0x3dd0ec)[_0x6b50('0x1b')](function(_0x429362){var _0x3779ec={'method':_0x6b50('0x35'),'uri':_0xfedac6+_0x6b50('0x36')+_0x312e40[_0x6b50('0x37')]('+',_0x6b50('0x38'))+'\x27','headers':{'Authorization':_0x6b50('0x1d')+_0x429362,'If-None-Match':null,'OData-Version':_0x6b50('0x1e')},'json':!![]};return rp(_0x3779ec);})[_0x6b50('0x1b')](function(_0x42ce51){var _0x2e925a=![];if(!_0x42ce51)return _0x2e925a;var _0x5a9561=_0x42ce51['value'];for(var _0x2079fd=0x0;_0x2079fd<_0x5a9561[_0x6b50('0x28')];_0x2079fd++){if(_0x5a9561[_0x2079fd][_0x6b50('0x39')]===_0x312e40){_0x2e925a=!![];_0x4cca3d[_0x6b50('0x3a')]=_0x5a9561[_0x2079fd]['contactid'];}}return _0x2e925a;})[_0x6b50('0x1b')](function(_0x548295){if(_0x548295)return _0x4cca3d;if(_0x9008a4==='nothing'){logger[_0x6b50('0x24')]('['+[_0x3dd0ec[_0x6b50('0x19')]()]+_0x6b50('0x3b'));return _0x4cca3d;}return createEndUser(_0x4cca3d,_0x453882,_0x2739b5,_0xfedac6,_0x3fb2be,_0x3dd0ec)[_0x6b50('0x1b')](function(_0x27e0f8){logger[_0x6b50('0x24')]('['+[_0x3dd0ec[_0x6b50('0x19')]()]+_0x6b50('0x3c'),_0x27e0f8[_0x6b50('0x3a')]);return _0x27e0f8;});});}function getCustomFields(_0x5f14da,_0x4d1785,_0x32092f){var _0x1cce6d={};if(_0x5f14da[_0x6b50('0x28')]>0x0){_[_0x6b50('0x3d')](_0x5f14da,function(_0x383a8b){if(_[_0x6b50('0x3e')]([_0x6b50('0x3f'),_0x6b50('0x40')],_0x383a8b[_0x6b50('0x41')])&&_0x383a8b['nameField']&&!_0x383a8b[_0x6b50('0x42')]){var _0x29fc0f=_0x383a8b[_0x6b50('0x43')]['toLowerCase']();var _0x38ff99=_0x29fc0f['substring'](0x0,_0x29fc0f[_0x6b50('0x44')]('_'));var _0x36af22=_0x29fc0f['substring'](_0x29fc0f[_0x6b50('0x44')]('_')+0x1);if(_0x38ff99===_0x32092f){_0x1cce6d[_0x36af22]=_0x383a8b[_0x6b50('0x45')];}}});}return _0x1cce6d;}function getTicket(_0x1e62fe,_0x8a0841,_0x197eff,_0x21b251,_0x2d8268,_0xea33d7,_0x2a58fe){return new Promise(function(_0xd234ad,_0x3ad5e6){var _0x46c5ee;return getAuthToken(_0x8a0841,_0x197eff,_0x2a58fe)[_0x6b50('0x1b')](function(_0x578268){if(_0xea33d7['ticketType']===_0x6b50('0x46')){_0x46c5ee={'method':_0x6b50('0x13'),'uri':_0x21b251+'incidents','body':Object[_0x6b50('0x47')]({},{'title':intUtil[_0x6b50('0x48')](_0xea33d7[_0x6b50('0x49')],_0x2d8268,'\x20'),'description':intUtil['getString'](_0xea33d7[_0x6b50('0x4a')],_0x2d8268,'\x0a'),'customerid_contact@odata.bind':_0x1e62fe[_0x6b50('0x3a')]?_0x6b50('0x4b')+_0x1e62fe[_0x6b50('0x3a')]+')':undefined,'ownerid@odata.bind':_0x6b50('0x30')+_0x1e62fe[_0x6b50('0x26')]+')','caseorigincode':'1'},getCustomFields(_0xea33d7[_0x6b50('0x4c')],_0x2d8268,_0xea33d7[_0x6b50('0x4d')])),'headers':{'Authorization':_0x6b50('0x1d')+_0x578268,'OData-Version':_0x6b50('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xea33d7[_0x6b50('0x4d')]==='phonecall'){var _0x5dcb59=_0x1e62fe['enduserId']?[{'partyid_systemuser@odata.bind':_0x6b50('0x30')+_0x1e62fe[_0x6b50('0x26')]+')','participationtypemask':_0x1e62fe[_0x6b50('0x4e')]===_0x6b50('0x4f')?0x2:0x1},{'partyid_contact@odata.bind':_0x6b50('0x4b')+_0x1e62fe[_0x6b50('0x3a')]+')','participationtypemask':_0x1e62fe[_0x6b50('0x4e')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x6b50('0x30')+_0x1e62fe[_0x6b50('0x26')]+')','participationtypemask':_0x1e62fe[_0x6b50('0x4e')]===_0x6b50('0x4f')?0x2:0x1}];_0x46c5ee={'method':_0x6b50('0x13'),'uri':_0x21b251+'phonecalls','body':Object[_0x6b50('0x47')]({},{'subject':intUtil[_0x6b50('0x48')](_0xea33d7['Subjects'],_0x2d8268,'\x20'),'phonenumber':String(_0x2d8268[_0x6b50('0x2e')]),'description':intUtil['getString'](_0xea33d7['Descriptions'],_0x2d8268,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1e62fe[_0x6b50('0x3a')]?'/contacts('+_0x1e62fe[_0x6b50('0x3a')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x1e62fe[_0x6b50('0x26')]+')','directioncode':_0x1e62fe[_0x6b50('0x4e')]===_0x6b50('0x4f')?![]:!![],'phonecall_activity_parties':_0x5dcb59},getCustomFields(_0xea33d7[_0x6b50('0x4c')],_0x2d8268,_0xea33d7[_0x6b50('0x4d')])),'headers':{'Authorization':'Bearer\x20'+_0x578268,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x46c5ee);})[_0x6b50('0x1b')](function(_0x5d157c){var _0x1f5a01=_0x5d157c[_0x6b50('0x31')][_0x6b50('0x32')];var _0x5814ff=_0x1f5a01[_0x6b50('0x33')](_0x1f5a01[_0x6b50('0x34')]('(')+0x1,_0x1f5a01[_0x6b50('0x34')](')'));_0x1e62fe[_0x6b50('0x50')]=_0x5814ff;_0xd234ad(_0x1e62fe);})[_0x6b50('0x18')](function(_0x5d9d64){_0x3ad5e6(_0x5d9d64[_0x6b50('0x2a')]);});});}function emit(_0xb41d81,_0x330acf,_0x21c686,_0x1ef1e5){var _0x1cd49f={'uri':util[_0x6b50('0x51')](_0x6b50('0x52'),_0xb41d81,_0x21c686,_0x1ef1e5)};io['to'](util[_0x6b50('0x51')](_0x6b50('0x53'),_0x330acf))['emit'](_0x6b50('0x54'),_0x1cd49f);}exports['cs']=function(_0x163fdb,_0xdae2ba,_0x599d23,_0x55a2a7,_0x47e94e,_0x19431e,_0x1e9db8,_0x658ec1){var _0x2837a3={};_0x19431e[_0x6b50('0xc')]=_0x19431e[_0x6b50('0xb')]?intUtil['stripTrailingSlash'](_0x19431e[_0x6b50('0xd')][_0x6b50('0xe')]):intUtil[_0x6b50('0x55')](_0x19431e[_0x6b50('0xc')]);_0x19431e[_0x6b50('0x56')]=intUtil[_0x6b50('0x55')](_0x19431e[_0x6b50('0x56')]);_0x2837a3[_0x6b50('0x4e')]=_0x658ec1===_0x6b50('0x4f')||_0x658ec1===_0x6b50('0x57')?_0x6b50('0x4f'):_0x6b50('0x2c');var _0x5a5e59=_0x19431e[_0x6b50('0xb')]?util[_0x6b50('0x51')]('%s/api/data/v9.0/',_0x19431e[_0x6b50('0xd')][_0x6b50('0xe')]):util[_0x6b50('0x51')]('%s/api/data/v9.0/',_0x19431e[_0x6b50('0xc')]);var _0xd2bb14=util['format'](_0x6b50('0x58'),_0x19431e['tenantId']);var _0x5dac20=util['format'](_0x6b50('0x59'),_0x19431e[_0x6b50('0x56')],_0xdae2ba['uniqueid'],md5(_0xdae2ba['uniqueid']));if(_0x47e94e&&_0x47e94e[_0x6b50('0x5a')]){logger[_0x6b50('0x24')]('[QUEUE]',_0x6b50('0x5b'));_0xdae2ba[_0x6b50('0x5c')]=_0x5dac20;}else if(_0x1e9db8&&_0x1e9db8[_0x6b50('0x5d')]&&_0x1e9db8[_0x6b50('0x5d')]!==_0x6b50('0x5e')){logger[_0x6b50('0x24')](_0x6b50('0x5f'),'Recording\x20is\x20enabled!');_0xdae2ba[_0x6b50('0x5c')]=_0x5dac20;}else{_0xdae2ba[_0x6b50('0x5c')]='';}return getUser(_0x2837a3,_0x19431e,_0x55a2a7,_0xd2bb14,_0x5a5e59,_0x658ec1)[_0x6b50('0x1b')](function(_0x57a345){logger[_0x6b50('0x24')]('['+_0x658ec1[_0x6b50('0x19')]()+_0x6b50('0x60'),_0x57a345[_0x6b50('0x26')]);logger['info']('['+_0x658ec1[_0x6b50('0x19')]()+_0x6b50('0x61'),_0x57a345['userEmail']);return getEndUser(_0x57a345,_0x19431e,_0xd2bb14,_0x5a5e59,_0xdae2ba,_0x658ec1,_0x599d23['moduleCreate']);})[_0x6b50('0x1b')](function(_0x429e98){logger['info']('['+_0x658ec1[_0x6b50('0x19')]()+_0x6b50('0x62'),_0x429e98['enduserId']);logger[_0x6b50('0x24')]('['+_0x658ec1[_0x6b50('0x19')]()+_0x6b50('0x63'),_0xdae2ba[_0x6b50('0x2e')]);return getTicket(_0x429e98,_0x19431e,_0xd2bb14,_0x5a5e59,_0xdae2ba,_0x599d23,_0x658ec1);})['then'](function(_0x47afcb){logger[_0x6b50('0x24')](util[_0x6b50('0x51')]('['+_0x658ec1[_0x6b50('0x19')]()+_0x6b50('0x64'),_0x599d23[_0x6b50('0x4d')],_0x47afcb['ticketId']));logger['info'](util[_0x6b50('0x51')]('['+_0x658ec1[_0x6b50('0x19')]()+_0x6b50('0x65'),_0x658ec1));if(_0x658ec1!==_0x6b50('0x57')){logger[_0x6b50('0x24')]('['+_0x658ec1[_0x6b50('0x19')]()+']',_0x6b50('0x66'));emit(_0x19431e[_0x6b50('0xc')],_0x55a2a7[_0x6b50('0x67')],_0x599d23[_0x6b50('0x4d')],_0x47afcb['ticketId']);}})[_0x6b50('0x18')](function(_0x107e6d){logger[_0x6b50('0x68')]('['+_0x658ec1[_0x6b50('0x19')]()+_0x6b50('0x69'),_0x107e6d[_0x6b50('0x2a')]);});}; \ No newline at end of file +var _0x1d0d=['%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','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\x20%s\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','ioredis','dynamics365','../../../../config/environment','redis','modernAuthentication','remoteUri','CloudProvider','data7','data2','resolve','data5','username','password','then','access_token','catch',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','string','picklist','nameField','idField','indexOf','content','POST','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','assign','getString','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0x1d0d,0x73));var _0xd1d0=function(_0x196044,_0x4fd287){_0x196044=_0x196044-0x0;var _0xa07a9=_0x1d0d[_0x196044];return _0xa07a9;};'use strict';var _=require('lodash');var rp=require(_0xd1d0('0x0'));var util=require(_0xd1d0('0x1'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0xd1d0('0x2'));var logger=require('../../../../config/logger')(_0xd1d0('0x3'));var config=require(_0xd1d0('0x4'));config[_0xd1d0('0x5')]=_['defaults'](config[_0xd1d0('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd1d0('0x5')]));function getAuthToken(_0x335dc5,_0x378440,_0x2acfb7){if(_0x335dc5[_0xd1d0('0x6')]){_0x335dc5[_0xd1d0('0x7')]=_0x335dc5[_0xd1d0('0x8')][_0xd1d0('0x9')];_0x335dc5['tenantId']=_0x335dc5[_0xd1d0('0x8')][_0xd1d0('0xa')];return Promise[_0xd1d0('0xb')](_0x335dc5[_0xd1d0('0x8')][_0xd1d0('0xc')]);}var _0x39daea={'method':'POST','uri':_0x378440,'form':{'client_id':_0x335dc5['clientId'],'resource':_0x335dc5[_0xd1d0('0x7')],'username':_0x335dc5[_0xd1d0('0xd')],'password':_0x335dc5[_0xd1d0('0xe')],'grant_type':_0xd1d0('0xe'),'client_secret':_0x335dc5['clientSecret']},'json':!![]};return rp(_0x39daea)[_0xd1d0('0xf')](function(_0x405e8f){return _0x405e8f[_0xd1d0('0x10')];})[_0xd1d0('0x11')](function(_0x21a392){logger['error']('['+[_0x2acfb7['toUpperCase']()]+_0xd1d0('0x12'));return _0x21a392[_0xd1d0('0x13')];});}function getUser(_0x517eff,_0x1cbeef,_0x392884,_0x27996f,_0x22df6c,_0x4694f0){return new Promise(function(_0x12ec53,_0x3b7c7b){return getAuthToken(_0x1cbeef,_0x27996f,_0x4694f0)['then'](function(_0x198cb8){var _0x13167e={'method':_0xd1d0('0x14'),'uri':_0x22df6c+_0xd1d0('0x15'),'headers':{'Authorization':_0xd1d0('0x16')+_0x198cb8,'OData-Version':_0xd1d0('0x17')},'json':!![]};return rp(_0x13167e);})[_0xd1d0('0xf')](function(_0x330d9b){var _0x4dbf30=_0x330d9b[_0xd1d0('0x18')];var _0x58f9df=![];var _0x477e83=null;if(!_['isNil'](_0x392884)){if(intUtil[_0xd1d0('0x19')](_0x392884[_0xd1d0('0x1a')])){_0x517eff[_0xd1d0('0x1b')]=_0x392884[_0xd1d0('0x1a')];for(_0x477e83=0x0;_0x477e83<_0x4dbf30[_0xd1d0('0x1c')];_0x477e83++){if(_0x4dbf30[_0x477e83][_0xd1d0('0x1d')]===_0x392884[_0xd1d0('0x1a')]&&!_0x4dbf30[_0x477e83][_0xd1d0('0x1e')]){_0x58f9df=!![];logger[_0xd1d0('0x1f')]('['+[_0x4694f0[_0xd1d0('0x20')]()]+_0xd1d0('0x21')+_0x4dbf30[_0x477e83][_0xd1d0('0x22')]+'!');_0x517eff[_0xd1d0('0x23')]=_0x4dbf30[_0x477e83]['systemuserid'];}}}}if(!_0x58f9df){logger[_0xd1d0('0x1f')]('['+[_0x4694f0[_0xd1d0('0x20')]()]+_0xd1d0('0x24'));_0x517eff[_0xd1d0('0x1b')]=_0x1cbeef[_0xd1d0('0xd')];for(_0x477e83=0x0;_0x477e83<_0x4dbf30[_0xd1d0('0x1c')];_0x477e83++){if(_0x4dbf30[_0x477e83][_0xd1d0('0x1d')]===_0x1cbeef[_0xd1d0('0xd')]){_0x517eff[_0xd1d0('0x23')]=_0x4dbf30[_0x477e83][_0xd1d0('0x22')];}}}_0x12ec53(_0x517eff);})['catch'](function(_0x2dad45){_0x3b7c7b(_0x2dad45[_0xd1d0('0x13')]);});});}function createEndUser(_0x2ee1ef,_0x25290f,_0x2af9d5,_0x4dfe56,_0x17d316,_0x3d9294){return new Promise(function(_0x59f61b,_0x4b3706){return getAuthToken(_0x25290f,_0x2af9d5,_0x3d9294)[_0xd1d0('0xf')](function(_0x4f9fd4){var _0x143663=_0x3d9294[_0xd1d0('0x25')]()===_0xd1d0('0x26')?_0x17d316[_0xd1d0('0x27')]:_0x17d316[_0xd1d0('0x28')];var _0x15b3de={'method':'POST','uri':_0x4dfe56+_0xd1d0('0x29'),'body':{'telephone1':_0x143663,'fullname':_0x143663,'firstname':_0x143663,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xd1d0('0x2a')+_0x2ee1ef[_0xd1d0('0x23')]+')'},'headers':{'Authorization':_0xd1d0('0x16')+_0x4f9fd4,'OData-Version':_0xd1d0('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x15b3de);})[_0xd1d0('0xf')](function(_0x2a78b2){var _0xdbed52=_0x2a78b2[_0xd1d0('0x2b')][_0xd1d0('0x2c')];var _0x3a464d=_0xdbed52[_0xd1d0('0x2d')](_0xdbed52['lastIndexOf']('(')+0x1,_0xdbed52[_0xd1d0('0x2e')](')'));_0x2ee1ef[_0xd1d0('0x2f')]=_0x3a464d;_0x59f61b(_0x2ee1ef);})[_0xd1d0('0x11')](function(_0x108139){_0x4b3706(_0x108139[_0xd1d0('0x13')]);});});}function getEndUser(_0x790310,_0x1e6ce5,_0x28cdfb,_0x53cca2,_0x157f6b,_0x3c15c6,_0x3fcfe2){var _0x332e86=_0x3c15c6[_0xd1d0('0x25')]()===_0xd1d0('0x26')?_0x157f6b[_0xd1d0('0x27')]:_0x157f6b['calleridnum'];return getAuthToken(_0x1e6ce5,_0x28cdfb,_0x3c15c6)[_0xd1d0('0xf')](function(_0x3049aa){var _0x5c16d1={'method':_0xd1d0('0x14'),'uri':_0x53cca2+_0xd1d0('0x30')+_0x332e86[_0xd1d0('0x31')]('+',_0xd1d0('0x32'))+'\x27','headers':{'Authorization':_0xd1d0('0x16')+_0x3049aa,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5c16d1);})[_0xd1d0('0xf')](function(_0x1cc562){var _0x3430af=![];if(!_0x1cc562)return _0x3430af;var _0x3a96d6=_0x1cc562['value'];for(var _0x154f7a=0x0;_0x154f7a<_0x3a96d6[_0xd1d0('0x1c')];_0x154f7a++){if(_0x3a96d6[_0x154f7a][_0xd1d0('0x33')]===_0x332e86){_0x3430af=!![];_0x790310[_0xd1d0('0x2f')]=_0x3a96d6[_0x154f7a]['contactid'];}}return _0x3430af;})['then'](function(_0x5b89a9){if(_0x5b89a9)return _0x790310;if(_0x3fcfe2===_0xd1d0('0x34')){logger['info']('['+[_0x3c15c6[_0xd1d0('0x20')]()]+_0xd1d0('0x35'));return _0x790310;}return createEndUser(_0x790310,_0x1e6ce5,_0x28cdfb,_0x53cca2,_0x157f6b,_0x3c15c6)[_0xd1d0('0xf')](function(_0x32d056){logger[_0xd1d0('0x1f')]('['+[_0x3c15c6[_0xd1d0('0x20')]()]+']\x20Enduser\x20created!',_0x32d056['enduserId']);return _0x32d056;});});}function getCustomFields(_0x259cc6,_0x401d9e,_0x1db69f){var _0x15c318={};if(_0x259cc6[_0xd1d0('0x1c')]>0x0){_[_0xd1d0('0x36')](_0x259cc6,function(_0x5cce3c){if(_['includes']([_0xd1d0('0x37'),_0xd1d0('0x38')],_0x5cce3c['type'])&&_0x5cce3c[_0xd1d0('0x39')]&&!_0x5cce3c['customField']){var _0x401224=_0x5cce3c[_0xd1d0('0x3a')][_0xd1d0('0x25')]();var _0x5d19b4=_0x401224[_0xd1d0('0x2d')](0x0,_0x401224[_0xd1d0('0x3b')]('_'));var _0x481c58=_0x401224['substring'](_0x401224[_0xd1d0('0x3b')]('_')+0x1);if(_0x5d19b4===_0x1db69f){_0x15c318[_0x481c58]=_0x5cce3c[_0xd1d0('0x3c')];}}});}return _0x15c318;}function getTicket(_0x5b634a,_0x5703f6,_0x5e8dbb,_0x368ab2,_0x2eee32,_0x72cbed,_0x336209){return new Promise(function(_0x37c789,_0x32c3c1){var _0x4e3b5f;return getAuthToken(_0x5703f6,_0x5e8dbb,_0x336209)[_0xd1d0('0xf')](function(_0x4ab03c){if(_0x72cbed['ticketType']==='incident'){_0x4e3b5f={'method':_0xd1d0('0x3d'),'uri':_0x368ab2+'incidents','body':Object['assign']({},{'title':intUtil['getString'](_0x72cbed[_0xd1d0('0x3e')],_0x2eee32,'\x20'),'description':intUtil['getString'](_0x72cbed[_0xd1d0('0x3f')],_0x2eee32,'\x0a'),'customerid_contact@odata.bind':_0x5b634a[_0xd1d0('0x2f')]?_0xd1d0('0x40')+_0x5b634a[_0xd1d0('0x2f')]+')':undefined,'ownerid@odata.bind':_0xd1d0('0x2a')+_0x5b634a['userId']+')','caseorigincode':'1'},getCustomFields(_0x72cbed[_0xd1d0('0x41')],_0x2eee32,_0x72cbed[_0xd1d0('0x42')])),'headers':{'Authorization':'Bearer\x20'+_0x4ab03c,'OData-Version':_0xd1d0('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x72cbed[_0xd1d0('0x42')]===_0xd1d0('0x43')){var _0x499578=_0x5b634a[_0xd1d0('0x2f')]?[{'partyid_systemuser@odata.bind':_0xd1d0('0x2a')+_0x5b634a['userId']+')','participationtypemask':_0x5b634a['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xd1d0('0x40')+_0x5b634a['enduserId']+')','participationtypemask':_0x5b634a[_0xd1d0('0x44')]===_0xd1d0('0x45')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xd1d0('0x2a')+_0x5b634a[_0xd1d0('0x23')]+')','participationtypemask':_0x5b634a[_0xd1d0('0x44')]===_0xd1d0('0x45')?0x2:0x1}];_0x4e3b5f={'method':_0xd1d0('0x3d'),'uri':_0x368ab2+_0xd1d0('0x46'),'body':Object[_0xd1d0('0x47')]({},{'subject':intUtil[_0xd1d0('0x48')](_0x72cbed[_0xd1d0('0x3e')],_0x2eee32,'\x20'),'phonenumber':String(_0x2eee32[_0xd1d0('0x28')]),'description':intUtil[_0xd1d0('0x48')](_0x72cbed[_0xd1d0('0x3f')],_0x2eee32,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5b634a[_0xd1d0('0x2f')]?_0xd1d0('0x40')+_0x5b634a[_0xd1d0('0x2f')]+')':undefined,'ownerid@odata.bind':_0xd1d0('0x2a')+_0x5b634a[_0xd1d0('0x23')]+')','directioncode':_0x5b634a[_0xd1d0('0x44')]===_0xd1d0('0x45')?![]:!![],'phonecall_activity_parties':_0x499578},getCustomFields(_0x72cbed[_0xd1d0('0x41')],_0x2eee32,_0x72cbed['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x4ab03c,'OData-Version':_0xd1d0('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4e3b5f);})[_0xd1d0('0xf')](function(_0x5c11e3){var _0x4be294=_0x5c11e3[_0xd1d0('0x2b')][_0xd1d0('0x2c')];var _0x77846b=_0x4be294[_0xd1d0('0x2d')](_0x4be294[_0xd1d0('0x2e')]('(')+0x1,_0x4be294[_0xd1d0('0x2e')](')'));_0x5b634a[_0xd1d0('0x49')]=_0x77846b;_0x37c789(_0x5b634a);})['catch'](function(_0x9abfdc){_0x32c3c1(_0x9abfdc[_0xd1d0('0x13')]);});});}function emit(_0x274f13,_0x3ceea1,_0x50b2bf,_0x556cd0){var _0x1ef6f4={'uri':util[_0xd1d0('0x4a')](_0xd1d0('0x4b'),_0x274f13,_0x50b2bf,_0x556cd0)};io['to'](util[_0xd1d0('0x4a')]('user:%s',_0x3ceea1))[_0xd1d0('0x4c')](_0xd1d0('0x4d'),_0x1ef6f4);}exports['cs']=function(_0x261eac,_0x4ffb74,_0x2712d0,_0x3fc746,_0x2d3a61,_0x252c27,_0x4659d1,_0x3c5550){var _0x5363bf={};_0x252c27['remoteUri']=_0x252c27[_0xd1d0('0x6')]?intUtil['stripTrailingSlash'](_0x252c27[_0xd1d0('0x8')][_0xd1d0('0x9')]):intUtil[_0xd1d0('0x4e')](_0x252c27[_0xd1d0('0x7')]);_0x252c27[_0xd1d0('0x4f')]=intUtil[_0xd1d0('0x4e')](_0x252c27[_0xd1d0('0x4f')]);_0x5363bf['callDirection']=_0x3c5550===_0xd1d0('0x45')||_0x3c5550===_0xd1d0('0x50')?_0xd1d0('0x45'):_0xd1d0('0x26');var _0x4c32d7=_0x252c27['modernAuthentication']?util['format'](_0xd1d0('0x51'),_0x252c27[_0xd1d0('0x8')][_0xd1d0('0x9')]):util[_0xd1d0('0x4a')](_0xd1d0('0x51'),_0x252c27[_0xd1d0('0x7')]);var _0x5464b4=util['format'](_0xd1d0('0x52'),_0x252c27[_0xd1d0('0x53')]);var _0x460283=util[_0xd1d0('0x4a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x252c27[_0xd1d0('0x4f')],_0x4ffb74[_0xd1d0('0x54')],md5(_0x4ffb74[_0xd1d0('0x54')]));if(_0x2d3a61&&_0x2d3a61[_0xd1d0('0x55')]){logger['info'](_0xd1d0('0x56'),_0xd1d0('0x57'));_0x4ffb74[_0xd1d0('0x58')]=_0x460283;}else if(_0x4659d1&&_0x4659d1[_0xd1d0('0x59')]&&_0x4659d1[_0xd1d0('0x59')]!==_0xd1d0('0x5a')){logger[_0xd1d0('0x1f')](_0xd1d0('0x5b'),_0xd1d0('0x57'));_0x4ffb74[_0xd1d0('0x58')]=_0x460283;}else{_0x4ffb74[_0xd1d0('0x58')]='';}return getUser(_0x5363bf,_0x252c27,_0x3fc746,_0x5464b4,_0x4c32d7,_0x3c5550)['then'](function(_0x53e18d){logger[_0xd1d0('0x1f')]('['+_0x3c5550[_0xd1d0('0x20')]()+_0xd1d0('0x5c'),_0x53e18d[_0xd1d0('0x23')]);logger[_0xd1d0('0x1f')]('['+_0x3c5550[_0xd1d0('0x20')]()+_0xd1d0('0x5d'),_0x53e18d[_0xd1d0('0x1b')]);return getEndUser(_0x53e18d,_0x252c27,_0x5464b4,_0x4c32d7,_0x4ffb74,_0x3c5550,_0x2712d0[_0xd1d0('0x5e')]);})['then'](function(_0x1fcabc){logger[_0xd1d0('0x1f')]('['+_0x3c5550[_0xd1d0('0x20')]()+_0xd1d0('0x5f'),_0x1fcabc[_0xd1d0('0x2f')]);logger[_0xd1d0('0x1f')]('['+_0x3c5550['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x4ffb74[_0xd1d0('0x28')]);return getTicket(_0x1fcabc,_0x252c27,_0x5464b4,_0x4c32d7,_0x4ffb74,_0x2712d0,_0x3c5550);})['then'](function(_0x14f03c){logger[_0xd1d0('0x1f')](util[_0xd1d0('0x4a')]('['+_0x3c5550['toUpperCase']()+_0xd1d0('0x60'),_0x2712d0['ticketType'],_0x14f03c[_0xd1d0('0x49')]));logger[_0xd1d0('0x1f')](util[_0xd1d0('0x4a')]('['+_0x3c5550[_0xd1d0('0x20')]()+']\x20Call\x20direction:\x20%s',_0x3c5550));if(_0x3c5550!=='unmanaged'){logger[_0xd1d0('0x1f')]('['+_0x3c5550[_0xd1d0('0x20')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x252c27[_0xd1d0('0x7')],_0x3fc746['name'],_0x2712d0[_0xd1d0('0x42')],_0x14f03c['ticketId']);}})[_0xd1d0('0x11')](function(_0x3bd235){logger['error']('['+_0x3c5550[_0xd1d0('0x20')]()+_0xd1d0('0x61'),_0x3bd235[_0xd1d0('0x13')]);});}; \ 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 d561cbf..2666e5d 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 _0x2655=['destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','base64','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','toLowerCase','content','toString','includes','idField','customField','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:'];(function(_0x365c7e,_0x539dee){var _0x269765=function(_0x3f74f1){while(--_0x3f74f1){_0x365c7e['push'](_0x365c7e['shift']());}};_0x269765(++_0x539dee);}(_0x2655,0x1dd));var _0x5265=function(_0x516c57,_0x545ca9){_0x516c57=_0x516c57-0x0;var _0x434380=_0x2655[_0x516c57];return _0x434380;};'use strict';var _=require(_0x5265('0x0'));var rp=require(_0x5265('0x1'));var md5=require('md5');var util=require(_0x5265('0x2'));var Redis=require('ioredis');var intUtil=require(_0x5265('0x3'));var config=require(_0x5265('0x4'));var logger=require(_0x5265('0x5'))(_0x5265('0x6'));config[_0x5265('0x7')]=_[_0x5265('0x8')](config[_0x5265('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5265('0x9'))(new Redis(config[_0x5265('0x7')]));var headers={'Content-Type':_0x5265('0xa'),'Accept':_0x5265('0xa')};function emit(_0x42a680,_0x3d9370,_0x57cda8){io['to'](_0x42a680)['emit'](_0x3d9370,_0x57cda8);}function getTicket(_0x3f4b53,_0x7221e0,_0x110e98,_0x5d065c,_0x23cb3b){logger[_0x5265('0xb')](_0x5265('0xc'));var _0x35c9df=_[_0x5265('0xd')]({'responder_id':_0x7221e0['id'],'requester_id':_0x110e98['id'],'name':util[_0x5265('0xe')]('Caller\x20-\x20%s',_0x23cb3b[_0x5265('0xf')]),'phone':_0x23cb3b[_0x5265('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x5265('0x11')](_0x5d065c[_0x5265('0x12')],_0x23cb3b,'\x20'),'description':intUtil[_0x5265('0x11')](_0x5d065c[_0x5265('0x13')],_0x23cb3b,_0x5265('0x14')),'tags':getTags(_0x5d065c[_0x5265('0x15')],_0x5265('0x16'))},getCustomFields(_0x5d065c[_0x5265('0x17')],_0x23cb3b));_0x35c9df[_0x5265('0x18')]=_[_0x5265('0x19')](_[_0x5265('0x1a')](_0x35c9df[_0x5265('0x18')],'id'),_0x5265('0x1b'));return request({'uri':util[_0x5265('0xe')]('%s/api/v2/tickets',_0x3f4b53[_0x5265('0x1c')]),'method':_0x5265('0x1d'),'body':_0x35c9df})['then'](function(_0x57665b){logger[_0x5265('0xb')](_0x5265('0x1e'));return _0x57665b;});}function getUser(_0x30cdd3,_0x374c80){if(intUtil[_0x5265('0x1f')](_0x374c80)){return request({'uri':util[_0x5265('0xe')](_0x5265('0x20'),_0x30cdd3[_0x5265('0x1c')]),'qs':{'email':_0x374c80}})[_0x5265('0x21')](function(_0x2f4fbe){if(_0x2f4fbe[_0x5265('0x22')]){logger['info'](_0x5265('0x23'));return _[_0x5265('0x24')](_0x2f4fbe,function(_0x84d7d){return _0x84d7d[_0x5265('0x25')][_0x5265('0x26')]===_0x374c80;});}else{logger[_0x5265('0xb')](_0x5265('0x27'));return request({'uri':util['format'](_0x5265('0x28'),_0x30cdd3[_0x5265('0x1c')])})['then'](function(_0xb3d2c4){logger[_0x5265('0xb')]('Admin\x20account\x20selected.');return _0xb3d2c4;});}});}else{logger[_0x5265('0xb')](_0x5265('0x29'));return request({'uri':util[_0x5265('0xe')](_0x5265('0x28'),_0x30cdd3['remoteUri'])})[_0x5265('0x21')](function(_0x2d3ac8){logger[_0x5265('0xb')](_0x5265('0x2a'));return _0x2d3ac8;});}}function getEndUser(_0xef3783,_0x47667e,_0x14dfcc){logger[_0x5265('0xb')]('Searching\x20enduser\x20with\x20phone',_0x14dfcc);return request({'uri':util[_0x5265('0xe')]('%s/api/v2/contacts',_0xef3783[_0x5265('0x1c')]),'qs':{'phone':_0x14dfcc}})['then'](function(_0x4706ce){if(_0x4706ce[_0x5265('0x22')]){logger[_0x5265('0xb')]('Enduser\x20found!');return _[_0x5265('0x24')](_0x4706ce,{'phone':_0x14dfcc});}else{logger[_0x5265('0xb')](_0x5265('0x2b'));return request({'uri':util[_0x5265('0xe')](_0x5265('0x2c'),_0xef3783[_0x5265('0x1c')]),'method':_0x5265('0x1d'),'body':{'name':_0x47667e,'phone':_0x14dfcc}})['then'](function(_0xf4bbb7){logger[_0x5265('0xb')](_0x5265('0x2d'));return _0xf4bbb7;});}});}function getAuth(_0x10a188){return util[_0x5265('0xe')](_0x5265('0x2e'),new Buffer(_0x10a188[_0x5265('0x2f')]+':X')['toString'](_0x5265('0x30')));}function request(_0x548368){logger['debug'](_0x5265('0x31'),JSON[_0x5265('0x32')](_0x548368));return rp(_[_0x5265('0x8')](_0x548368,{'method':_0x5265('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x6a3440,_0xfac1ac){var _0x104a7a=[];if(_0x6a3440&&_0x6a3440[_0x5265('0x22')]>0x0){_0x104a7a=_[_0x5265('0x34')](_0x6a3440,_0xfac1ac);}return _0x104a7a;}function getCustomFields(_0x4f7cec,_0x2b16a7){var _0x440ce1=[];var _0x35c6e9={'custom_fields':[]};if(_0x4f7cec[_0x5265('0x22')]>0x0){_[_0x5265('0x35')](_0x4f7cec,function(_0x34f159){if(_['includes']([_0x5265('0x36'),_0x5265('0x37')],_0x34f159[_0x5265('0x38')])&&_0x34f159[_0x5265('0x39')]&&!_0x34f159['customField']){_0x35c6e9[_0x34f159[_0x5265('0x39')][_0x5265('0x3a')]()]=_0x34f159[_0x5265('0x3b')][_0x5265('0x3c')]();}else if(_[_0x5265('0x3d')](['string','picklist'],_0x34f159['type'])&&_0x34f159[_0x5265('0x3e')]&&_0x34f159[_0x5265('0x3f')]){_0x35c6e9[_0x5265('0x18')][_0x5265('0x40')]({'id':_0x34f159[_0x5265('0x3e')],'value':_0x34f159['content'][_0x5265('0x3c')]()});}else if(_0x34f159[_0x5265('0x38')]===_0x5265('0x41')&&_0x34f159[_0x5265('0x42')]&&_0x34f159[_0x5265('0x3e')]&&_0x34f159[_0x5265('0x3f')]){_0x2b16a7[_0x34f159['variableName']]&&_0x35c6e9[_0x5265('0x18')][_0x5265('0x40')]({'id':_0x34f159['idField'],'value':_0x2b16a7[_0x34f159[_0x5265('0x42')]]['toString']()});}else if(_0x34f159[_0x5265('0x38')]===_0x5265('0x43')&&_0x34f159[_0x5265('0x44')]&&_0x34f159[_0x5265('0x44')]['name']&&_0x34f159['idField']&&_0x34f159[_0x5265('0x3f')]){_0x2b16a7[_0x34f159['Variable']['name'][_0x5265('0x3a')]()]&&_0x35c6e9[_0x5265('0x18')][_0x5265('0x40')]({'id':_0x34f159[_0x5265('0x3e')],'value':_0x2b16a7[_0x34f159[_0x5265('0x44')]['name'][_0x5265('0x3a')]()][_0x5265('0x3c')]()});}});}return _0x35c6e9;}exports['queue']=function(_0x52d368,_0x33de0a,_0xe1fb3c,_0x30f66b,_0x5b5fec,_0x51c69b){var _0xe4287f,_0x407b97;_0x51c69b[_0x5265('0x1c')]=intUtil[_0x5265('0x45')](_0x51c69b[_0x5265('0x1c')]);_0x51c69b[_0x5265('0x46')]=intUtil[_0x5265('0x45')](_0x51c69b[_0x5265('0x46')]);if(_0x5b5fec&&_0x5b5fec[_0x5265('0x47')]){logger[_0x5265('0xb')](_0x5265('0x48'),'Recording\x20is\x20enabled!');_0x33de0a[_0x5265('0x49')]=util[_0x5265('0xe')](_0x5265('0x4a'),_0x51c69b[_0x5265('0x46')],_0x33de0a[_0x5265('0x4b')],md5(_0x33de0a[_0x5265('0x4b')]));}else{_0x33de0a[_0x5265('0x49')]='';}headers[_0x5265('0x4c')]=getAuth(_0x51c69b);return getUser(_0x51c69b,_0x30f66b['email'])[_0x5265('0x21')](function(_0x38f022){_0xe4287f=_0x38f022;logger[_0x5265('0xb')]('The\x20User\x20ID\x20is:',_0xe4287f['id']);return getEndUser(_0x51c69b,_0x33de0a[_0x5265('0xf')],_0x33de0a[_0x5265('0x10')]);})[_0x5265('0x21')](function(_0x184d76){_0x407b97=_0x184d76;logger[_0x5265('0xb')](_0x5265('0x4d'),_0x407b97['id']);return getTicket(_0x51c69b,_0xe4287f,_0x407b97,_0xe1fb3c,_0x33de0a);})[_0x5265('0x21')](function(_0xa7e981){if(_0xa7e981&&_0xa7e981['id']){logger[_0x5265('0xb')]('Ticket\x20created!');logger[_0x5265('0xb')]('The\x20Ticket\x20ID\x20is:',_0xa7e981['id']);logger[_0x5265('0xb')]('[QUEUE]',_0x5265('0x4e'));emit(util['format'](_0x5265('0x4f'),_0x30f66b[_0x5265('0x16')]),_0x5265('0x50'),{'uri':util[_0x5265('0xe')](_0x5265('0x51'),_0x51c69b['remoteUri'],_0xa7e981['id'])});}})[_0x5265('0x52')](function(_0x2b5f9d){logger['error'](_0x5265('0x48'),JSON[_0x5265('0x32')](_0x2b5f9d));});};exports['outbound']=function(_0x1e84b0,_0x36b551,_0x2c8e13,_0x49c016,_0x3ead82,_0x274e4e,_0x4e905f){var _0x393d5c,_0x49fffc;_0x274e4e[_0x5265('0x1c')]=intUtil['stripTrailingSlash'](_0x274e4e[_0x5265('0x1c')]);_0x274e4e[_0x5265('0x46')]=intUtil[_0x5265('0x45')](_0x274e4e['serverUrl']);if(_0x4e905f&&_0x4e905f[_0x5265('0x53')]&&_0x4e905f[_0x5265('0x53')]!=='none'){logger[_0x5265('0xb')](_0x5265('0x54'),_0x5265('0x55'));_0x36b551[_0x5265('0x49')]=util[_0x5265('0xe')](_0x5265('0x4a'),_0x274e4e[_0x5265('0x46')],_0x36b551[_0x5265('0x4b')],md5(_0x36b551[_0x5265('0x4b')]));}headers['Authorization']=getAuth(_0x274e4e);return getUser(_0x274e4e,_0x49c016['email'])['then'](function(_0xef301e){_0x393d5c=_0xef301e;logger[_0x5265('0xb')](_0x5265('0x56'),_0x393d5c['id']);return getEndUser(_0x274e4e,_0x36b551[_0x5265('0x57')],_0x36b551[_0x5265('0x58')]);})['then'](function(_0x52f878){_0x49fffc=_0x52f878;logger['info']('The\x20Enduser\x20ID\x20is:',_0x49fffc['id']);return getTicket(_0x274e4e,_0x393d5c,_0x49fffc,_0x2c8e13,_0x36b551);})['then'](function(_0x2fee4b){if(_0x2fee4b&&_0x2fee4b['id']){logger[_0x5265('0xb')]('Ticket\x20created!');logger[_0x5265('0xb')](_0x5265('0x59'),_0x2fee4b['id']);logger[_0x5265('0xb')](_0x5265('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x5265('0x4f'),_0x49c016[_0x5265('0x16')]),'trigger:browser:url',{'uri':util[_0x5265('0xe')](_0x5265('0x51'),_0x274e4e[_0x5265('0x1c')],_0x2fee4b['id'])});}})['catch'](function(_0x22d62d){logger[_0x5265('0x5a')]('[OUTBOUND]',JSON[_0x5265('0x32')](_0x22d62d));});};exports[_0x5265('0x5b')]=function(_0x2729df,_0x25a322,_0x16756b,_0x17d964,_0x5777a1,_0x1687eb){var _0x7a71fb,_0x8e6c15;_0x1687eb[_0x5265('0x1c')]=intUtil[_0x5265('0x45')](_0x1687eb[_0x5265('0x1c')]);_0x1687eb[_0x5265('0x46')]=intUtil['stripTrailingSlash'](_0x1687eb[_0x5265('0x46')]);if(_0x5777a1&&_0x5777a1['monitor_format']){logger[_0x5265('0xb')]('['+_0x25a322[_0x5265('0x5c')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x25a322[_0x5265('0x49')]=util[_0x5265('0xe')](_0x5265('0x4a'),_0x1687eb[_0x5265('0x46')],_0x25a322[_0x5265('0x4b')],md5(_0x25a322['uniqueid']));}else{_0x25a322['recordingURL']='';}headers[_0x5265('0x4c')]=getAuth(_0x1687eb);return getUser(_0x1687eb,'')[_0x5265('0x21')](function(_0x54417b){_0x7a71fb=_0x54417b;logger['info']('The\x20User\x20ID\x20is:',_0x7a71fb['id']);return getEndUser(_0x1687eb,_0x25a322[_0x5265('0xf')],_0x25a322['calleridnum']);})['then'](function(_0x1ceb0c){_0x8e6c15=_0x1ceb0c;logger[_0x5265('0xb')]('The\x20Enduser\x20ID\x20is:',_0x8e6c15['id']);return getTicket(_0x1687eb,_0x7a71fb,_0x8e6c15,_0x16756b,_0x25a322);})[_0x5265('0x21')](function(_0x1b016c){if(_0x1b016c){logger[_0x5265('0xb')](_0x5265('0x1e'));logger[_0x5265('0xb')](_0x5265('0x59'),_0x1b016c['id']);}})[_0x5265('0x52')](function(_0x14131a){logger[_0x5265('0x5a')]('['+_0x25a322['lastevent'][_0x5265('0x5d')]()+']',JSON['stringify'](_0x14131a));});}; \ No newline at end of file +var _0x6fcc=['Fields','custom_fields','mapValues','keyBy','value','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Basic\x20%s','apiKey','base64','debug','stringify','GET','map','forEach','includes','picklist','type','nameField','customField','content','push','idField','variableName','toString','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/helpdesk/tickets/%d','lastevent','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','name'];(function(_0x11447a,_0x360188){var _0x10ee27=function(_0x2dedd9){while(--_0x2dedd9){_0x11447a['push'](_0x11447a['shift']());}};_0x10ee27(++_0x360188);}(_0x6fcc,0x149));var _0xc6fc=function(_0xda9b6,_0x54ea66){_0xda9b6=_0xda9b6-0x0;var _0x14f93c=_0x6fcc[_0xda9b6];return _0x14f93c;};'use strict';var _=require(_0xc6fc('0x0'));var rp=require('request-promise');var md5=require(_0xc6fc('0x1'));var util=require(_0xc6fc('0x2'));var Redis=require(_0xc6fc('0x3'));var intUtil=require(_0xc6fc('0x4'));var config=require(_0xc6fc('0x5'));var logger=require(_0xc6fc('0x6'))('freshdesk');config[_0xc6fc('0x7')]=_['defaults'](config[_0xc6fc('0x7')],{'host':_0xc6fc('0x8'),'port':0x18eb});var io=require(_0xc6fc('0x9'))(new Redis(config[_0xc6fc('0x7')]));var headers={'Content-Type':_0xc6fc('0xa'),'Accept':_0xc6fc('0xa')};function emit(_0x1acc7e,_0x4e9d96,_0x235aee){io['to'](_0x1acc7e)[_0xc6fc('0xb')](_0x4e9d96,_0x235aee);}function getTicket(_0x3df4ed,_0x5bf81f,_0x4ce23a,_0x3a5621,_0x50450d){logger[_0xc6fc('0xc')](_0xc6fc('0xd'));var _0xae9b7a=_[_0xc6fc('0xe')]({'responder_id':_0x5bf81f['id'],'requester_id':_0x4ce23a['id'],'name':util[_0xc6fc('0xf')](_0xc6fc('0x10'),_0x50450d[_0xc6fc('0x11')]),'phone':_0x50450d['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xc6fc('0x12')](_0x3a5621[_0xc6fc('0x13')],_0x50450d,'\x20'),'description':intUtil['getString'](_0x3a5621[_0xc6fc('0x14')],_0x50450d,_0xc6fc('0x15')),'tags':getTags(_0x3a5621['Tags'],_0xc6fc('0x16'))},getCustomFields(_0x3a5621[_0xc6fc('0x17')],_0x50450d));_0xae9b7a[_0xc6fc('0x18')]=_[_0xc6fc('0x19')](_[_0xc6fc('0x1a')](_0xae9b7a[_0xc6fc('0x18')],'id'),_0xc6fc('0x1b'));return request({'uri':util['format']('%s/api/v2/tickets',_0x3df4ed['remoteUri']),'method':_0xc6fc('0x1c'),'body':_0xae9b7a})['then'](function(_0x61ffcd){logger[_0xc6fc('0xc')](_0xc6fc('0x1d'));return _0x61ffcd;});}function getUser(_0x1f6eed,_0x4a7813){if(intUtil[_0xc6fc('0x1e')](_0x4a7813)){return request({'uri':util[_0xc6fc('0xf')](_0xc6fc('0x1f'),_0x1f6eed['remoteUri']),'qs':{'email':_0x4a7813}})[_0xc6fc('0x20')](function(_0x5dedee){if(_0x5dedee[_0xc6fc('0x21')]){logger['info'](_0xc6fc('0x22'));return _[_0xc6fc('0x23')](_0x5dedee,function(_0x1998ad){return _0x1998ad['contact'][_0xc6fc('0x24')]===_0x4a7813;});}else{logger[_0xc6fc('0xc')](_0xc6fc('0x25'));return request({'uri':util[_0xc6fc('0xf')]('%s/api/v2/agents/me',_0x1f6eed[_0xc6fc('0x26')])})[_0xc6fc('0x20')](function(_0x255b83){logger['info']('Admin\x20account\x20selected.');return _0x255b83;});}});}else{logger[_0xc6fc('0xc')](_0xc6fc('0x27'));return request({'uri':util[_0xc6fc('0xf')](_0xc6fc('0x28'),_0x1f6eed['remoteUri'])})[_0xc6fc('0x20')](function(_0x3eeb16){logger['info'](_0xc6fc('0x29'));return _0x3eeb16;});}}function getEndUser(_0x130639,_0x36c10e,_0x1756da){logger[_0xc6fc('0xc')]('Searching\x20enduser\x20with\x20phone',_0x1756da);return request({'uri':util['format']('%s/api/v2/contacts',_0x130639[_0xc6fc('0x26')]),'qs':{'phone':_0x1756da}})[_0xc6fc('0x20')](function(_0x8a71bc){if(_0x8a71bc[_0xc6fc('0x21')]){logger[_0xc6fc('0xc')](_0xc6fc('0x2a'));return _[_0xc6fc('0x23')](_0x8a71bc,{'phone':_0x1756da});}else{logger[_0xc6fc('0xc')](_0xc6fc('0x2b'));return request({'uri':util['format'](_0xc6fc('0x2c'),_0x130639[_0xc6fc('0x26')]),'method':_0xc6fc('0x1c'),'body':{'name':_0x36c10e,'phone':_0x1756da}})['then'](function(_0x5e1ece){logger['info']('Enduser\x20created.');return _0x5e1ece;});}});}function getAuth(_0x5c8bbd){return util[_0xc6fc('0xf')](_0xc6fc('0x2d'),new Buffer(_0x5c8bbd[_0xc6fc('0x2e')]+':X')['toString'](_0xc6fc('0x2f')));}function request(_0x3f608b){logger[_0xc6fc('0x30')]('[HTTP]',JSON[_0xc6fc('0x31')](_0x3f608b));return rp(_['defaults'](_0x3f608b,{'method':_0xc6fc('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x2fe8c9,_0x23de2c){var _0x108c7b=[];if(_0x2fe8c9&&_0x2fe8c9[_0xc6fc('0x21')]>0x0){_0x108c7b=_[_0xc6fc('0x33')](_0x2fe8c9,_0x23de2c);}return _0x108c7b;}function getCustomFields(_0x44cf45,_0x1cb819){var _0x15c035=[];var _0x41dea8={'custom_fields':[]};if(_0x44cf45[_0xc6fc('0x21')]>0x0){_[_0xc6fc('0x34')](_0x44cf45,function(_0xa629de){if(_[_0xc6fc('0x35')](['string',_0xc6fc('0x36')],_0xa629de[_0xc6fc('0x37')])&&_0xa629de[_0xc6fc('0x38')]&&!_0xa629de[_0xc6fc('0x39')]){_0x41dea8[_0xa629de[_0xc6fc('0x38')]['toLowerCase']()]=_0xa629de[_0xc6fc('0x3a')]['toString']();}else if(_['includes'](['string',_0xc6fc('0x36')],_0xa629de[_0xc6fc('0x37')])&&_0xa629de['idField']&&_0xa629de['customField']){_0x41dea8[_0xc6fc('0x18')][_0xc6fc('0x3b')]({'id':_0xa629de[_0xc6fc('0x3c')],'value':_0xa629de[_0xc6fc('0x3a')]['toString']()});}else if(_0xa629de['type']==='variable'&&_0xa629de[_0xc6fc('0x3d')]&&_0xa629de['idField']&&_0xa629de[_0xc6fc('0x39')]){_0x1cb819[_0xa629de[_0xc6fc('0x3d')]]&&_0x41dea8[_0xc6fc('0x18')][_0xc6fc('0x3b')]({'id':_0xa629de['idField'],'value':_0x1cb819[_0xa629de[_0xc6fc('0x3d')]][_0xc6fc('0x3e')]()});}else if(_0xa629de[_0xc6fc('0x37')]===_0xc6fc('0x3f')&&_0xa629de[_0xc6fc('0x40')]&&_0xa629de[_0xc6fc('0x40')][_0xc6fc('0x16')]&&_0xa629de[_0xc6fc('0x3c')]&&_0xa629de[_0xc6fc('0x39')]){_0x1cb819[_0xa629de['Variable'][_0xc6fc('0x16')]['toLowerCase']()]&&_0x41dea8[_0xc6fc('0x18')][_0xc6fc('0x3b')]({'id':_0xa629de[_0xc6fc('0x3c')],'value':_0x1cb819[_0xa629de[_0xc6fc('0x40')][_0xc6fc('0x16')]['toLowerCase']()][_0xc6fc('0x3e')]()});}});}return _0x41dea8;}exports['queue']=function(_0x39a7fc,_0x3b2e8b,_0x4e1d59,_0x553caa,_0x4a8034,_0x52ffc0){var _0x53b142,_0x2cacf8;_0x52ffc0[_0xc6fc('0x26')]=intUtil[_0xc6fc('0x41')](_0x52ffc0[_0xc6fc('0x26')]);_0x52ffc0[_0xc6fc('0x42')]=intUtil[_0xc6fc('0x41')](_0x52ffc0[_0xc6fc('0x42')]);if(_0x4a8034&&_0x4a8034[_0xc6fc('0x43')]){logger[_0xc6fc('0xc')](_0xc6fc('0x44'),'Recording\x20is\x20enabled!');_0x3b2e8b[_0xc6fc('0x45')]=util[_0xc6fc('0xf')](_0xc6fc('0x46'),_0x52ffc0[_0xc6fc('0x42')],_0x3b2e8b[_0xc6fc('0x47')],md5(_0x3b2e8b[_0xc6fc('0x47')]));}else{_0x3b2e8b[_0xc6fc('0x45')]='';}headers[_0xc6fc('0x48')]=getAuth(_0x52ffc0);return getUser(_0x52ffc0,_0x553caa[_0xc6fc('0x24')])[_0xc6fc('0x20')](function(_0x401bdb){_0x53b142=_0x401bdb;logger['info'](_0xc6fc('0x49'),_0x53b142['id']);return getEndUser(_0x52ffc0,_0x3b2e8b['calleridname'],_0x3b2e8b['calleridnum']);})[_0xc6fc('0x20')](function(_0x2d4388){_0x2cacf8=_0x2d4388;logger[_0xc6fc('0xc')](_0xc6fc('0x4a'),_0x2cacf8['id']);return getTicket(_0x52ffc0,_0x53b142,_0x2cacf8,_0x4e1d59,_0x3b2e8b);})[_0xc6fc('0x20')](function(_0x43bdb0){if(_0x43bdb0&&_0x43bdb0['id']){logger['info'](_0xc6fc('0x1d'));logger[_0xc6fc('0xc')]('The\x20Ticket\x20ID\x20is:',_0x43bdb0['id']);logger['info'](_0xc6fc('0x44'),_0xc6fc('0x4b'));emit(util[_0xc6fc('0xf')](_0xc6fc('0x4c'),_0x553caa[_0xc6fc('0x16')]),'trigger:browser:url',{'uri':util['format']('%s/helpdesk/tickets/%d',_0x52ffc0[_0xc6fc('0x26')],_0x43bdb0['id'])});}})[_0xc6fc('0x4d')](function(_0x5649e7){logger[_0xc6fc('0x4e')](_0xc6fc('0x44'),JSON[_0xc6fc('0x31')](_0x5649e7));});};exports[_0xc6fc('0x4f')]=function(_0x21be50,_0x4cb2d8,_0x462a89,_0x8457a6,_0x3ef0bb,_0x35a4d3,_0x1be718){var _0x5cf22b,_0x446ba4;_0x35a4d3[_0xc6fc('0x26')]=intUtil['stripTrailingSlash'](_0x35a4d3['remoteUri']);_0x35a4d3[_0xc6fc('0x42')]=intUtil[_0xc6fc('0x41')](_0x35a4d3[_0xc6fc('0x42')]);if(_0x1be718&&_0x1be718['recordingFormat']&&_0x1be718[_0xc6fc('0x50')]!==_0xc6fc('0x51')){logger[_0xc6fc('0xc')]('[OUTBOUND]',_0xc6fc('0x52'));_0x4cb2d8['recordingURL']=util[_0xc6fc('0xf')](_0xc6fc('0x46'),_0x35a4d3[_0xc6fc('0x42')],_0x4cb2d8[_0xc6fc('0x47')],md5(_0x4cb2d8['uniqueid']));}headers[_0xc6fc('0x48')]=getAuth(_0x35a4d3);return getUser(_0x35a4d3,_0x8457a6[_0xc6fc('0x24')])[_0xc6fc('0x20')](function(_0x5c53f9){_0x5cf22b=_0x5c53f9;logger['info'](_0xc6fc('0x49'),_0x5cf22b['id']);return getEndUser(_0x35a4d3,_0x4cb2d8['destcalleridname'],_0x4cb2d8[_0xc6fc('0x53')]);})[_0xc6fc('0x20')](function(_0x5e37ce){_0x446ba4=_0x5e37ce;logger[_0xc6fc('0xc')](_0xc6fc('0x4a'),_0x446ba4['id']);return getTicket(_0x35a4d3,_0x5cf22b,_0x446ba4,_0x462a89,_0x4cb2d8);})[_0xc6fc('0x20')](function(_0x35f24a){if(_0x35f24a&&_0x35f24a['id']){logger[_0xc6fc('0xc')](_0xc6fc('0x1d'));logger[_0xc6fc('0xc')](_0xc6fc('0x54'),_0x35f24a['id']);logger[_0xc6fc('0xc')]('[OUTBOUND]',_0xc6fc('0x4b'));emit(util[_0xc6fc('0xf')](_0xc6fc('0x4c'),_0x8457a6[_0xc6fc('0x16')]),'trigger:browser:url',{'uri':util[_0xc6fc('0xf')](_0xc6fc('0x55'),_0x35a4d3[_0xc6fc('0x26')],_0x35f24a['id'])});}})['catch'](function(_0x296c76){logger[_0xc6fc('0x4e')]('[OUTBOUND]',JSON[_0xc6fc('0x31')](_0x296c76));});};exports['unmanaged']=function(_0x598387,_0x191590,_0x539dd6,_0x413bc2,_0x50a2e5,_0x27ca63){var _0x11c2bf,_0x26e857;_0x27ca63[_0xc6fc('0x26')]=intUtil[_0xc6fc('0x41')](_0x27ca63['remoteUri']);_0x27ca63[_0xc6fc('0x42')]=intUtil['stripTrailingSlash'](_0x27ca63[_0xc6fc('0x42')]);if(_0x50a2e5&&_0x50a2e5[_0xc6fc('0x43')]){logger['info']('['+_0x191590[_0xc6fc('0x56')][_0xc6fc('0x57')]()+']',_0xc6fc('0x52'));_0x191590[_0xc6fc('0x45')]=util[_0xc6fc('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x27ca63[_0xc6fc('0x42')],_0x191590[_0xc6fc('0x47')],md5(_0x191590[_0xc6fc('0x47')]));}else{_0x191590[_0xc6fc('0x45')]='';}headers['Authorization']=getAuth(_0x27ca63);return getUser(_0x27ca63,'')[_0xc6fc('0x20')](function(_0xb8e296){_0x11c2bf=_0xb8e296;logger['info'](_0xc6fc('0x49'),_0x11c2bf['id']);return getEndUser(_0x27ca63,_0x191590['calleridname'],_0x191590['calleridnum']);})[_0xc6fc('0x20')](function(_0x2e02f4){_0x26e857=_0x2e02f4;logger[_0xc6fc('0xc')](_0xc6fc('0x4a'),_0x26e857['id']);return getTicket(_0x27ca63,_0x11c2bf,_0x26e857,_0x539dd6,_0x191590);})[_0xc6fc('0x20')](function(_0xe35e55){if(_0xe35e55){logger[_0xc6fc('0xc')](_0xc6fc('0x1d'));logger[_0xc6fc('0xc')](_0xc6fc('0x54'),_0xe35e55['id']);}})[_0xc6fc('0x4d')](function(_0x4b7191){logger[_0xc6fc('0x4e')]('['+_0x191590[_0xc6fc('0x56')][_0xc6fc('0x57')]()+']',JSON[_0xc6fc('0x31')](_0x4b7191));});}; \ 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 3e8b686..fb12f0f 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 _0x932f=['destcalleridnum','calleridnum','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','email','adminEmail','info','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','error','message','Getting\x20user\x20list','then','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','catch','/api/lookup?q=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','format','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','toUpperCase','Creating\x20new\x20task','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','username','toLowerCase'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x932f,0x1ba));var _0xf932=function(_0xec1270,_0x34f055){_0xec1270=_0xec1270-0x0;var _0x2116fe=_0x932f[_0xec1270];return _0x2116fe;};'use strict';var _=require(_0xf932('0x0'));var rp=require(_0xf932('0x1'));var md5=require(_0xf932('0x2'));var util=require(_0xf932('0x3'));var moment=require(_0xf932('0x4'));var Promise=require('bluebird');var Redis=require(_0xf932('0x5'));var intUtil=require(_0xf932('0x6'));var config=require(_0xf932('0x7'));var logger=require(_0xf932('0x8'))('freshsales');config[_0xf932('0x9')]=_[_0xf932('0xa')](config[_0xf932('0x9')],{'host':_0xf932('0xb'),'port':0x18eb});var io=require(_0xf932('0xc'))(new Redis(config[_0xf932('0x9')]));function getAdminId(_0x958b75,_0x259b47,_0x59acef,_0x72626c){return new Promise(function(_0x36ca6e,_0x14e1c9){var _0x766f97=![];var _0x39cb79={'method':_0xf932('0xd'),'uri':_0x72626c+_0xf932('0xe'),'json':!![]};_0x39cb79[_0xf932('0xf')]=_0x59acef;logger['info'](_0xf932('0x10'));return rp(_0x39cb79)['then'](function(_0xb7d705){if(_0xb7d705){var _0x3e2dc7=_0xb7d705['users'];var _0x343952=null;for(_0x343952=0x0;_0x343952<_0x3e2dc7['length'];_0x343952++){if(_0x3e2dc7[_0x343952][_0xf932('0x11')]===_0x958b75[_0xf932('0x12')]){_0x958b75['adminId']=_0x3e2dc7[_0x343952]['id'];_0x766f97=!![];}}if(_0x766f97){logger[_0xf932('0x13')](_0xf932('0x14'),_0x958b75[_0xf932('0x15')]);_0x36ca6e(_0x958b75);}else{_0x14e1c9({'statusCode':0x194,'message':_0xf932('0x16')});}}else{_0x14e1c9({'statusCode':0x194,'message':_0xf932('0x16')});}})['catch'](function(_0x5519e5){logger[_0xf932('0x17')]('['+[_0x259b47['toUpperCase']()]+']',_0x5519e5[_0xf932('0x18')]);_0x14e1c9(_0x5519e5);});});}function getUser(_0xc7d61b,_0x19d07f,_0x159f10){return function(_0x47a011){return new Promise(function(_0x2a6071,_0x502165){var _0x2342fb={'method':_0xf932('0xd'),'uri':_0x159f10+_0xf932('0xe'),'json':!![]};_0x2342fb[_0xf932('0xf')]=_0x19d07f;logger[_0xf932('0x13')](_0xf932('0x19'));return rp(_0x2342fb)[_0xf932('0x1a')](function(_0x106461){if(_0x106461){var _0x1f9d1a=_0x106461['users'];var _0x180a2b=![];var _0x5840da=null;if(_0x47a011[_0xf932('0x1b')]!==null){logger[_0xf932('0x13')]('Getting\x20user\x20with\x20email',_0x47a011['agentEmail']);_0x47a011[_0xf932('0x1c')]=_0x47a011[_0xf932('0x1b')];for(_0x5840da=0x0;_0x5840da<_0x1f9d1a['length'];_0x5840da++){if(_0x1f9d1a[_0x5840da][_0xf932('0x11')]===_0x47a011[_0xf932('0x1b')]){_0x180a2b=!![];_0x47a011[_0xf932('0x1d')]=_0x1f9d1a[_0x5840da]['id'];logger[_0xf932('0x13')](_0xf932('0x1e'),_0x47a011[_0xf932('0x1d')]);}}}if(!_0x180a2b){logger['info'](_0xf932('0x1f'));_0x47a011['userEmail']=_0x47a011[_0xf932('0x12')];_0x47a011[_0xf932('0x1d')]=_0x47a011['adminId'];_0x180a2b=!![];}if(_0x180a2b){_0x2a6071(_0x47a011);}else{_0x502165({'statusCode':0x194,'message':_0xf932('0x16')});}}else{_0x502165({'statusCode':0x194,'message':_0xf932('0x16')});}})[_0xf932('0x20')](function(_0x531b2d){logger['error']('['+[_0xc7d61b['toUpperCase']()]+']',_0x531b2d['message']);_0x502165(_0x531b2d);});});};}function searchContact(_0x5bab08,_0x58e92f,_0x2c6889,_0x226ca2){return new Promise(function(_0x70f3c2,_0x507ee5){var _0x1d9b97={'method':_0xf932('0xd'),'headers':_0x58e92f,'uri':_0x5bab08+_0xf932('0x21')+_0x226ca2+'&f='+_0x2c6889+_0xf932('0x22'),'json':!![]};rp(_0x1d9b97)[_0xf932('0x1a')](function(_0x108a6c){var _0x1fc352=_[_0xf932('0x23')](_0x108a6c[_0xf932('0x24')][_0xf932('0x24')],[_0x2c6889,_0x226ca2]);_0x70f3c2(_0x1fc352);})[_0xf932('0x20')](function(_0x388b89){_0x507ee5(_0x388b89);});});}function getEndUser(_0x3c373d,_0x3a9354,_0x180e5e){return function(_0x117cf0){return new Promise(function(_0xaad714,_0x5ec063){logger[_0xf932('0x13')](util['format'](_0xf932('0x25'),_0x117cf0[_0xf932('0x26')]));searchContact(_0x180e5e,_0x3a9354,'mobile_number',_0x117cf0[_0xf932('0x26')])[_0xf932('0x1a')](function(_0x39dabf){if(_0x39dabf){_0x117cf0[_0xf932('0x27')]=_0x39dabf['id'];logger[_0xf932('0x13')](_0xf932('0x28'),_0x117cf0['endUserId']);return _0xaad714(_0x117cf0);}searchContact(_0x180e5e,_0x3a9354,_0xf932('0x29'),_0x117cf0[_0xf932('0x26')])[_0xf932('0x1a')](function(_0x487e6f){if(_0x487e6f){_0x117cf0['endUserId']=_0x487e6f['id'];logger[_0xf932('0x13')]('Contact\x20found\x20work_number:',_0x117cf0[_0xf932('0x27')]);return _0xaad714(_0x117cf0);}createEndUser(_0x117cf0,_0x3c373d,_0x3a9354,_0x180e5e)[_0xf932('0x1a')](function(_0x425c77){logger[_0xf932('0x13')](_0xf932('0x2a'),_0x425c77[_0xf932('0x27')]);return _0xaad714(_0x425c77);});});})[_0xf932('0x20')](function(_0x538e3c){_0x5ec063(_0x538e3c);});});};}function createEndUser(_0x4fc164,_0x520957,_0x453978,_0x4546c5){return new Promise(function(_0x509eb7,_0x74d8fc){var _0x16bdae=moment();var _0xd42b5={'method':_0xf932('0x2b'),'uri':_0x4546c5+_0xf932('0x2c'),'body':{'contact':{'last_name':_0x4fc164[_0xf932('0x26')],'work_number':_0x4fc164[_0xf932('0x26')],'mobile_number':_0x4fc164[_0xf932('0x26')],'owner_id':_0x4fc164[_0xf932('0x1d')],'created_at':_0x16bdae[_0xf932('0x2d')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0xd42b5[_0xf932('0xf')]=_0x453978;logger[_0xf932('0x13')](_0xf932('0x2e'));return rp(_0xd42b5)[_0xf932('0x1a')](function(_0x3654a6){_0x4fc164[_0xf932('0x27')]=_0x3654a6[_0xf932('0x2f')]['id'];_0x509eb7(_0x4fc164);})[_0xf932('0x20')](function(_0xb4ec36){logger[_0xf932('0x17')]('['+[_0x520957[_0xf932('0x30')]()]+']',_0xb4ec36[_0xf932('0x18')]);_0x74d8fc(_0xb4ec36[_0xf932('0x18')]);});});}function getTicket(_0x34049c,_0x5ebb6a,_0x39ee28,_0x4021a7,_0x4b71ef){return function(_0x2e9470){logger[_0xf932('0x13')](_0xf932('0x31'));return new Promise(function(_0x220c93,_0x2b6691){var _0x554a6b=moment();var _0x6a04af={'method':_0xf932('0x2b'),'uri':_0x39ee28+'/api/tasks','body':{'title':intUtil[_0xf932('0x32')](_0x4021a7[_0xf932('0x33')],_0x4b71ef,'\x20'),'description':intUtil['getString'](_0x4021a7[_0xf932('0x34')],_0x4b71ef,'\x0a'),'owner_id':_0x2e9470[_0xf932('0x1d')],'creater_id':_0x2e9470[_0xf932('0x15')],'targetable_id':_0x2e9470[_0xf932('0x27')],'targetable_type':_0xf932('0x35'),'created_at':_0x554a6b['format'](_0xf932('0x36')),'due_date':_0x554a6b['add'](0x1e,'m')[_0xf932('0x2d')](_0xf932('0x36'))},'json':!![]};_0x6a04af['headers']=_0x5ebb6a;return rp(_0x6a04af)[_0xf932('0x1a')](function(_0x314099){_0x2e9470[_0xf932('0x37')]=_0x314099[_0xf932('0x38')]['id'];logger[_0xf932('0x13')](_0xf932('0x39'),_0x2e9470[_0xf932('0x37')]);_0x220c93(_0x2e9470);})[_0xf932('0x20')](function(_0x15fa49){logger[_0xf932('0x17')]('['+[_0x34049c[_0xf932('0x30')]()]+']',_0x15fa49[_0xf932('0x18')]);_0x2b6691(_0x15fa49['message']);});});};}function emit(_0xa062c7,_0x12aa76,_0x2c0e7b){var _0x12d9b6={'uri':_0xa062c7+_0xf932('0x3a')+_0x2c0e7b};io['to'](util[_0xf932('0x2d')](_0xf932('0x3b'),_0x12aa76))[_0xf932('0x3c')](_0xf932('0x3d'),_0x12d9b6);}exports['cs']=function(_0x3415f1,_0x37c353,_0x3673da,_0x162c7f,_0x308ea0,_0x432899,_0x33c7c6,_0x69ce29){var _0xa8457c={};var _0x30467a={'Authorization':_0xf932('0x3e')+_0x432899[_0xf932('0x3f')]};_0x432899['remoteUri']=intUtil[_0xf932('0x40')](_0x432899[_0xf932('0x41')]);_0x432899['serverUrl']=intUtil[_0xf932('0x40')](_0x432899['serverUrl']);var _0x442941=_0x432899['remoteUri'];_0xa8457c['adminEmail']=_0x432899[_0xf932('0x42')];_0xa8457c[_0xf932('0x26')]=_0x69ce29[_0xf932('0x43')]()==='outbound'?_0x37c353[_0xf932('0x44')]:_0x37c353[_0xf932('0x45')];_0xa8457c['callDirection']=_0x69ce29===_0xf932('0x46')||_0x69ce29===_0xf932('0x47')?_0xf932('0x46'):_0xf932('0x48');if(_0x162c7f){_0xa8457c[_0xf932('0x1b')]=_0x162c7f[_0xf932('0x11')];}var _0x5be585=util[_0xf932('0x2d')](_0xf932('0x49'),_0x432899[_0xf932('0x4a')],_0x37c353['uniqueid'],md5(_0x37c353['uniqueid']));if(_0x308ea0&&_0x308ea0[_0xf932('0x4b')]){logger[_0xf932('0x13')](_0xf932('0x4c'),_0xf932('0x4d'));_0x37c353[_0xf932('0x4e')]=_0x5be585;}else if(_0x33c7c6&&_0x33c7c6[_0xf932('0x4f')]&&_0x33c7c6[_0xf932('0x4f')]!==_0xf932('0x50')){logger[_0xf932('0x13')]('[OUTBOUND]',_0xf932('0x4d'));_0x37c353[_0xf932('0x4e')]=_0x5be585;}else{_0x37c353[_0xf932('0x4e')]='';}return getAdminId(_0xa8457c,_0x69ce29,_0x30467a,_0x442941)['then'](getUser(_0x69ce29,_0x30467a,_0x442941))[_0xf932('0x1a')](getEndUser(_0x69ce29,_0x30467a,_0x442941))[_0xf932('0x1a')](getTicket(_0x69ce29,_0x30467a,_0x442941,_0x3673da,_0x37c353))[_0xf932('0x1a')](function(_0x1bc3de){logger['info'](util['format'](_0xf932('0x51'),_0x1bc3de[_0xf932('0x37')]));if(_0x69ce29!==_0xf932('0x47')){logger['info']('['+[_0x69ce29[_0xf932('0x30')]()]+']',_0xf932('0x52'));emit(_0x442941,_0x162c7f['name'],_0x1bc3de['endUserId']);}})[_0xf932('0x20')](function(_0x5dd45e){logger[_0xf932('0x17')]('['+[_0x69ce29[_0xf932('0x30')]()]+_0xf932('0x53'),util[_0xf932('0x54')](_0x5dd45e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x56db=['defaults','localhost','socket.io-emitter','GET','info','Getting\x20admin\x20information','then','users','length','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','adminEmail','catch','&entities=contact','contacts','format','mobile_number','contactNumber','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','headers','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis'];(function(_0x19cbac,_0x4a7597){var _0x180da3=function(_0x219c1a){while(--_0x219c1a){_0x19cbac['push'](_0x19cbac['shift']());}};_0x180da3(++_0x4a7597);}(_0x56db,0x14e));var _0xb56d=function(_0x4a0066,_0x16fb7e){_0x4a0066=_0x4a0066-0x0;var _0x611761=_0x56db[_0x4a0066];return _0x611761;};'use strict';var _=require(_0xb56d('0x0'));var rp=require(_0xb56d('0x1'));var md5=require('md5');var util=require(_0xb56d('0x2'));var moment=require(_0xb56d('0x3'));var Promise=require(_0xb56d('0x4'));var Redis=require(_0xb56d('0x5'));var intUtil=require(_0xb56d('0x6'));var config=require('../../../../config/environment');var logger=require(_0xb56d('0x7'))(_0xb56d('0x8'));config[_0xb56d('0x9')]=_[_0xb56d('0xa')](config['redis'],{'host':_0xb56d('0xb'),'port':0x18eb});var io=require(_0xb56d('0xc'))(new Redis(config[_0xb56d('0x9')]));function getAdminId(_0x4ebe89,_0x3cf95f,_0x274448,_0x4b5e95){return new Promise(function(_0x514661,_0x30bae1){var _0x55797b=![];var _0xaacb37={'method':_0xb56d('0xd'),'uri':_0x4b5e95+'/api/selector/owners','json':!![]};_0xaacb37['headers']=_0x274448;logger[_0xb56d('0xe')](_0xb56d('0xf'));return rp(_0xaacb37)[_0xb56d('0x10')](function(_0x43028f){if(_0x43028f){var _0x35a1d8=_0x43028f[_0xb56d('0x11')];var _0xff5816=null;for(_0xff5816=0x0;_0xff5816<_0x35a1d8[_0xb56d('0x12')];_0xff5816++){if(_0x35a1d8[_0xff5816]['email']===_0x4ebe89['adminEmail']){_0x4ebe89[_0xb56d('0x13')]=_0x35a1d8[_0xff5816]['id'];_0x55797b=!![];}}if(_0x55797b){logger['info'](_0xb56d('0x14'),_0x4ebe89[_0xb56d('0x13')]);_0x514661(_0x4ebe89);}else{_0x30bae1({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x30bae1({'statusCode':0x194,'message':_0xb56d('0x15')});}})['catch'](function(_0x14b7f0){logger[_0xb56d('0x16')]('['+[_0x3cf95f[_0xb56d('0x17')]()]+']',_0x14b7f0[_0xb56d('0x18')]);_0x30bae1(_0x14b7f0);});});}function getUser(_0x46c46a,_0x2058f7,_0xe42cff){return function(_0x308f43){return new Promise(function(_0xadc792,_0x3baf3e){var _0x111129={'method':_0xb56d('0xd'),'uri':_0xe42cff+_0xb56d('0x19'),'json':!![]};_0x111129['headers']=_0x2058f7;logger[_0xb56d('0xe')](_0xb56d('0x1a'));return rp(_0x111129)[_0xb56d('0x10')](function(_0x2c17fb){if(_0x2c17fb){var _0x2bb738=_0x2c17fb[_0xb56d('0x11')];var _0x4a7a06=![];var _0x398fd4=null;if(_0x308f43[_0xb56d('0x1b')]!==null){logger['info'](_0xb56d('0x1c'),_0x308f43['agentEmail']);_0x308f43[_0xb56d('0x1d')]=_0x308f43[_0xb56d('0x1b')];for(_0x398fd4=0x0;_0x398fd4<_0x2bb738['length'];_0x398fd4++){if(_0x2bb738[_0x398fd4]['email']===_0x308f43[_0xb56d('0x1b')]){_0x4a7a06=!![];_0x308f43['userId']=_0x2bb738[_0x398fd4]['id'];logger[_0xb56d('0xe')](_0xb56d('0x1e'),_0x308f43[_0xb56d('0x1f')]);}}}if(!_0x4a7a06){logger[_0xb56d('0xe')]('Admin\x20selected');_0x308f43[_0xb56d('0x1d')]=_0x308f43[_0xb56d('0x20')];_0x308f43[_0xb56d('0x1f')]=_0x308f43[_0xb56d('0x13')];_0x4a7a06=!![];}if(_0x4a7a06){_0xadc792(_0x308f43);}else{_0x3baf3e({'statusCode':0x194,'message':_0xb56d('0x15')});}}else{_0x3baf3e({'statusCode':0x194,'message':_0xb56d('0x15')});}})[_0xb56d('0x21')](function(_0x301014){logger[_0xb56d('0x16')]('['+[_0x46c46a[_0xb56d('0x17')]()]+']',_0x301014[_0xb56d('0x18')]);_0x3baf3e(_0x301014);});});};}function searchContact(_0x4732c5,_0x3a459e,_0xea47e8,_0x56a432){return new Promise(function(_0x23dcff,_0x2b50c6){var _0xcb91f={'method':_0xb56d('0xd'),'headers':_0x3a459e,'uri':_0x4732c5+'/api/lookup?q='+_0x56a432+'&f='+_0xea47e8+_0xb56d('0x22'),'json':!![]};rp(_0xcb91f)['then'](function(_0x531d81){var _0x5a97fc=_['find'](_0x531d81[_0xb56d('0x23')]['contacts'],[_0xea47e8,_0x56a432]);_0x23dcff(_0x5a97fc);})[_0xb56d('0x21')](function(_0x1339a0){_0x2b50c6(_0x1339a0);});});}function getEndUser(_0x21e87e,_0x256b8b,_0x29246f){return function(_0x2412ac){return new Promise(function(_0x151c8f,_0x4e92b9){logger['info'](util[_0xb56d('0x24')]('Searching\x20contact\x20with\x20phone\x20%s',_0x2412ac['contactNumber']));searchContact(_0x29246f,_0x256b8b,_0xb56d('0x25'),_0x2412ac[_0xb56d('0x26')])[_0xb56d('0x10')](function(_0x130499){if(_0x130499){_0x2412ac['endUserId']=_0x130499['id'];logger[_0xb56d('0xe')](_0xb56d('0x27'),_0x2412ac[_0xb56d('0x28')]);return _0x151c8f(_0x2412ac);}searchContact(_0x29246f,_0x256b8b,_0xb56d('0x29'),_0x2412ac[_0xb56d('0x26')])['then'](function(_0x5a19ff){if(_0x5a19ff){_0x2412ac['endUserId']=_0x5a19ff['id'];logger[_0xb56d('0xe')](_0xb56d('0x2a'),_0x2412ac[_0xb56d('0x28')]);return _0x151c8f(_0x2412ac);}createEndUser(_0x2412ac,_0x21e87e,_0x256b8b,_0x29246f)[_0xb56d('0x10')](function(_0xa2b368){logger['info'](_0xb56d('0x2b'),_0xa2b368[_0xb56d('0x28')]);return _0x151c8f(_0xa2b368);});});})[_0xb56d('0x21')](function(_0x2dd1b3){_0x4e92b9(_0x2dd1b3);});});};}function createEndUser(_0x187363,_0x228305,_0x5313c8,_0x4099dc){return new Promise(function(_0x5c5e1d,_0x42b010){var _0x64182e=moment();var _0x1f1248={'method':_0xb56d('0x2c'),'uri':_0x4099dc+_0xb56d('0x2d'),'body':{'contact':{'last_name':_0x187363['contactNumber'],'work_number':_0x187363[_0xb56d('0x26')],'mobile_number':_0x187363[_0xb56d('0x26')],'owner_id':_0x187363[_0xb56d('0x1f')],'created_at':_0x64182e[_0xb56d('0x24')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x1f1248['headers']=_0x5313c8;logger['info'](_0xb56d('0x2e'));return rp(_0x1f1248)[_0xb56d('0x10')](function(_0x159cbf){_0x187363[_0xb56d('0x28')]=_0x159cbf[_0xb56d('0x2f')]['id'];_0x5c5e1d(_0x187363);})['catch'](function(_0x31ea7d){logger[_0xb56d('0x16')]('['+[_0x228305[_0xb56d('0x17')]()]+']',_0x31ea7d[_0xb56d('0x18')]);_0x42b010(_0x31ea7d[_0xb56d('0x18')]);});});}function getTicket(_0x1dfe29,_0x478783,_0x165c23,_0x386e41,_0x5426b2){return function(_0x1181d6){logger[_0xb56d('0xe')](_0xb56d('0x30'));return new Promise(function(_0x571f66,_0x26062){var _0x33cf1b=moment();var _0x15ad4f={'method':'POST','uri':_0x165c23+_0xb56d('0x31'),'body':{'title':intUtil[_0xb56d('0x32')](_0x386e41[_0xb56d('0x33')],_0x5426b2,'\x20'),'description':intUtil[_0xb56d('0x32')](_0x386e41[_0xb56d('0x34')],_0x5426b2,'\x0a'),'owner_id':_0x1181d6['userId'],'creater_id':_0x1181d6[_0xb56d('0x13')],'targetable_id':_0x1181d6[_0xb56d('0x28')],'targetable_type':_0xb56d('0x35'),'created_at':_0x33cf1b[_0xb56d('0x24')](_0xb56d('0x36')),'due_date':_0x33cf1b[_0xb56d('0x37')](0x1e,'m')[_0xb56d('0x24')](_0xb56d('0x36'))},'json':!![]};_0x15ad4f[_0xb56d('0x38')]=_0x478783;return rp(_0x15ad4f)[_0xb56d('0x10')](function(_0x2ae8e8){_0x1181d6[_0xb56d('0x39')]=_0x2ae8e8[_0xb56d('0x3a')]['id'];logger['info'](_0xb56d('0x3b'),_0x1181d6[_0xb56d('0x39')]);_0x571f66(_0x1181d6);})[_0xb56d('0x21')](function(_0x1a3780){logger['error']('['+[_0x1dfe29[_0xb56d('0x17')]()]+']',_0x1a3780[_0xb56d('0x18')]);_0x26062(_0x1a3780[_0xb56d('0x18')]);});});};}function emit(_0x11c4dd,_0x2e0338,_0x44f690){var _0x20a5d5={'uri':_0x11c4dd+_0xb56d('0x3c')+_0x44f690};io['to'](util['format'](_0xb56d('0x3d'),_0x2e0338))['emit'](_0xb56d('0x3e'),_0x20a5d5);}exports['cs']=function(_0x10622d,_0x37512f,_0x1840ae,_0x2a490d,_0x785cb1,_0x159530,_0x31e776,_0x578077){var _0x59322e={};var _0x342794={'Authorization':_0xb56d('0x3f')+_0x159530[_0xb56d('0x40')]};_0x159530[_0xb56d('0x41')]=intUtil[_0xb56d('0x42')](_0x159530['remoteUri']);_0x159530[_0xb56d('0x43')]=intUtil[_0xb56d('0x42')](_0x159530[_0xb56d('0x43')]);var _0x447684=_0x159530[_0xb56d('0x41')];_0x59322e['adminEmail']=_0x159530[_0xb56d('0x44')];_0x59322e[_0xb56d('0x26')]=_0x578077[_0xb56d('0x45')]()===_0xb56d('0x46')?_0x37512f[_0xb56d('0x47')]:_0x37512f[_0xb56d('0x48')];_0x59322e[_0xb56d('0x49')]=_0x578077===_0xb56d('0x4a')||_0x578077===_0xb56d('0x4b')?_0xb56d('0x4a'):_0xb56d('0x46');if(_0x2a490d){_0x59322e[_0xb56d('0x1b')]=_0x2a490d[_0xb56d('0x4c')];}var _0x3fb52a=util[_0xb56d('0x24')](_0xb56d('0x4d'),_0x159530[_0xb56d('0x43')],_0x37512f[_0xb56d('0x4e')],md5(_0x37512f[_0xb56d('0x4e')]));if(_0x785cb1&&_0x785cb1['monitor_format']){logger['info']('[QUEUE]',_0xb56d('0x4f'));_0x37512f[_0xb56d('0x50')]=_0x3fb52a;}else if(_0x31e776&&_0x31e776[_0xb56d('0x51')]&&_0x31e776['recordingFormat']!==_0xb56d('0x52')){logger[_0xb56d('0xe')]('[OUTBOUND]',_0xb56d('0x4f'));_0x37512f[_0xb56d('0x50')]=_0x3fb52a;}else{_0x37512f[_0xb56d('0x50')]='';}return getAdminId(_0x59322e,_0x578077,_0x342794,_0x447684)[_0xb56d('0x10')](getUser(_0x578077,_0x342794,_0x447684))[_0xb56d('0x10')](getEndUser(_0x578077,_0x342794,_0x447684))[_0xb56d('0x10')](getTicket(_0x578077,_0x342794,_0x447684,_0x1840ae,_0x37512f))['then'](function(_0x4be63c){logger[_0xb56d('0xe')](util[_0xb56d('0x24')](_0xb56d('0x53'),_0x4be63c[_0xb56d('0x39')]));if(_0x578077!==_0xb56d('0x4b')){logger[_0xb56d('0xe')]('['+[_0x578077['toUpperCase']()]+']',_0xb56d('0x54'));emit(_0x447684,_0x2a490d['name'],_0x4be63c[_0xb56d('0x28')]);}})['catch'](function(_0x4715d1){logger['error']('['+[_0x578077[_0xb56d('0x17')]()]+_0xb56d('0x55'),util['inspect'](_0x4715d1,{'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 31deb0e..00cffe8 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 _0xe000=['./dynamics365','./freshsales','sugarcrm','desk','vtiger','freshsales','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','log','EVENT\x20UNKNOWN','unmanaged','zendesk','salesforce','freshdesk','servicenow','unknown\x20integration','../../../../config/logger','%s\x20configuration\x20#%s\x20not\x20found','error','format','%s\x20account\x20#%s\x20not\x20found','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger'];(function(_0x1e9442,_0x5b7508){var _0x4d1f6d=function(_0x377a6e){while(--_0x377a6e){_0x1e9442['push'](_0x1e9442['shift']());}};_0x4d1f6d(++_0x5b7508);}(_0xe000,0x7e));var _0x0e00=function(_0x1ddaa0,_0x1e589c){_0x1ddaa0=_0x1ddaa0-0x0;var _0x4c17cb=_0xe000[_0x1ddaa0];return _0x4c17cb;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0x0e00('0x0'));var salesforce=require(_0x0e00('0x1'));var sugarcrm=require(_0x0e00('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0x0e00('0x3'));var desk=require(_0x0e00('0x4'));var vtiger=require(_0x0e00('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x0e00('0x6'));var freshsales=require(_0x0e00('0x7'));var integrations=['zendesk','salesforce',_0x0e00('0x8'),'freshdesk','zoho',_0x0e00('0x9'),_0x0e00('0xa'),'dynamics365',_0x0e00('0xb'),'servicenow'];exports['exec']=function(_0x1d39af,_0x4ce1c1,_0x2debd3,_0x3d713e,_0x36638f,_0x3e4904){if(_0x2debd3){if(_[_0x0e00('0xc')](integrations,_0x1d39af[_0x0e00('0xd')][_0x0e00('0xe')]())){try{var _0x1c729f=null;var _0x30a665='';var _0x4a9686=_0x2debd3[_0x1d39af['data1'][_0x0e00('0xe')]()];if(_0x4a9686){var _0x4fc56f=_0x4a9686[_0x1d39af[_0x0e00('0xf')]];if(_0x4fc56f){var _0x57e55d=_[_0x0e00('0x10')](_0x4fc56f[_0x0e00('0x11')],{'id':parseInt(_0x1d39af[_0x0e00('0x12')],0xa)});if(_0x57e55d){if(_0x3d713e){if(_0x36638f&&_0x4ce1c1['queue']){_0x30a665=_0x0e00('0x13');}else if(_0x4ce1c1['routeId']){_0x30a665='outbound';}else{console[_0x0e00('0x14')](_0x0e00('0x15'),_0x4ce1c1);}}else{_0x30a665=_0x0e00('0x16');}switch(_0x1d39af[_0x0e00('0xd')][_0x0e00('0xe')]()){case _0x0e00('0x17'):zendesk[_0x30a665](_0x1d39af,_0x4ce1c1,_0x57e55d,_0x3d713e,_0x36638f,_0x4fc56f,_0x3e4904);break;case _0x0e00('0x18'):salesforce[_0x30a665](_0x1d39af,_0x4ce1c1,_0x57e55d,_0x3d713e,_0x36638f,_0x4fc56f,_0x3e4904);break;case'sugarcrm':sugarcrm[_0x30a665](_0x1d39af,_0x4ce1c1,_0x57e55d,_0x3d713e,_0x36638f,_0x4fc56f,_0x3e4904);break;case _0x0e00('0x19'):freshdesk[_0x30a665](_0x1d39af,_0x4ce1c1,_0x57e55d,_0x3d713e,_0x36638f,_0x4fc56f,_0x3e4904);break;case'zoho':zoho[_0x30a665](_0x1d39af,_0x4ce1c1,_0x57e55d,_0x3d713e,_0x36638f,_0x4fc56f,_0x3e4904);break;case _0x0e00('0x9'):desk[_0x30a665](_0x1d39af,_0x4ce1c1,_0x57e55d,_0x3d713e,_0x36638f,_0x4fc56f,_0x3e4904);break;case _0x0e00('0xa'):vtiger[_0x30a665](_0x1d39af,_0x4ce1c1,_0x57e55d,_0x3d713e,_0x36638f,_0x4fc56f,_0x3e4904);break;case'freshsales':freshsales['cs'](_0x1d39af,_0x4ce1c1,_0x57e55d,_0x3d713e,_0x36638f,_0x4fc56f,_0x3e4904,_0x30a665);break;case _0x0e00('0x1a'):servicenow['cs'](_0x1d39af,_0x4ce1c1,_0x57e55d,_0x3d713e,_0x36638f,_0x4fc56f,_0x3e4904,_0x30a665);break;case'dynamics365':dynamics365['cs'](_0x1d39af,_0x4ce1c1,_0x57e55d,_0x3d713e,_0x36638f,_0x4fc56f,_0x3e4904,_0x30a665);break;default:console[_0x0e00('0x14')](_0x0e00('0x1b'));}}else{_0x1c729f=require(_0x0e00('0x1c'))(_0x1d39af[_0x0e00('0xd')][_0x0e00('0xe')]());_0x1c729f['error']('[EXEC]',util['format'](_0x0e00('0x1d'),_0x1d39af[_0x0e00('0xd')][_0x0e00('0xe')](),_0x1d39af[_0x0e00('0x12')]));}}else{_0x1c729f=require('../../../../config/logger')(_0x1d39af[_0x0e00('0xd')][_0x0e00('0xe')]());_0x1c729f[_0x0e00('0x1e')]('[EXEC]',util[_0x0e00('0x1f')](_0x0e00('0x20'),_0x1d39af['data1'][_0x0e00('0xe')](),_0x1d39af['data2']));}}else{}}catch(_0x3013bc){console[_0x0e00('0x1e')](_0x3013bc);}}}}; \ No newline at end of file +var _0xc7a3=['./dynamics365','zendesk','salesforce','sugarcrm','zoho','vtiger','freshsales','servicenow','exec','includes','toLowerCase','data1','find','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','desk','dynamics365','unknown\x20integration','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./freshdesk','./zoho','./servicenow'];(function(_0xbe0bad,_0x242e22){var _0x2a18cc=function(_0x17f8ff){while(--_0x17f8ff){_0xbe0bad['push'](_0xbe0bad['shift']());}};_0x2a18cc(++_0x242e22);}(_0xc7a3,0x9f));var _0x3c7a=function(_0x56d8b4,_0x37e5bd){_0x56d8b4=_0x56d8b4-0x0;var _0x1b2e82=_0xc7a3[_0x56d8b4];return _0x1b2e82;};'use strict';var _=require(_0x3c7a('0x0'));var util=require(_0x3c7a('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x3c7a('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x3c7a('0x3'));var zoho=require(_0x3c7a('0x4'));var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0x3c7a('0x5'));var dynamics365=require(_0x3c7a('0x6'));var freshsales=require('./freshsales');var integrations=[_0x3c7a('0x7'),_0x3c7a('0x8'),_0x3c7a('0x9'),'freshdesk',_0x3c7a('0xa'),'desk',_0x3c7a('0xb'),'dynamics365',_0x3c7a('0xc'),_0x3c7a('0xd')];exports[_0x3c7a('0xe')]=function(_0x2c5207,_0x116fb0,_0x2472be,_0x55f8c6,_0x22a5bf,_0x4b99d0){if(_0x2472be){if(_[_0x3c7a('0xf')](integrations,_0x2c5207['data1'][_0x3c7a('0x10')]())){try{var _0x29bfc2=null;var _0x247edc='';var _0x4fa34f=_0x2472be[_0x2c5207[_0x3c7a('0x11')]['toLowerCase']()];if(_0x4fa34f){var _0x5d03c8=_0x4fa34f[_0x2c5207['data2']];if(_0x5d03c8){var _0x13ec76=_[_0x3c7a('0x12')](_0x5d03c8['Configurations'],{'id':parseInt(_0x2c5207[_0x3c7a('0x13')],0xa)});if(_0x13ec76){if(_0x55f8c6){if(_0x22a5bf&&_0x116fb0[_0x3c7a('0x14')]){_0x247edc='queue';}else if(_0x116fb0[_0x3c7a('0x15')]){_0x247edc='outbound';}else{console[_0x3c7a('0x16')](_0x3c7a('0x17'),_0x116fb0);}}else{_0x247edc=_0x3c7a('0x18');}switch(_0x2c5207[_0x3c7a('0x11')][_0x3c7a('0x10')]()){case _0x3c7a('0x7'):zendesk[_0x247edc](_0x2c5207,_0x116fb0,_0x13ec76,_0x55f8c6,_0x22a5bf,_0x5d03c8,_0x4b99d0);break;case'salesforce':salesforce[_0x247edc](_0x2c5207,_0x116fb0,_0x13ec76,_0x55f8c6,_0x22a5bf,_0x5d03c8,_0x4b99d0);break;case'sugarcrm':sugarcrm[_0x247edc](_0x2c5207,_0x116fb0,_0x13ec76,_0x55f8c6,_0x22a5bf,_0x5d03c8,_0x4b99d0);break;case'freshdesk':freshdesk[_0x247edc](_0x2c5207,_0x116fb0,_0x13ec76,_0x55f8c6,_0x22a5bf,_0x5d03c8,_0x4b99d0);break;case _0x3c7a('0xa'):zoho[_0x247edc](_0x2c5207,_0x116fb0,_0x13ec76,_0x55f8c6,_0x22a5bf,_0x5d03c8,_0x4b99d0);break;case _0x3c7a('0x19'):desk[_0x247edc](_0x2c5207,_0x116fb0,_0x13ec76,_0x55f8c6,_0x22a5bf,_0x5d03c8,_0x4b99d0);break;case _0x3c7a('0xb'):vtiger[_0x247edc](_0x2c5207,_0x116fb0,_0x13ec76,_0x55f8c6,_0x22a5bf,_0x5d03c8,_0x4b99d0);break;case _0x3c7a('0xc'):freshsales['cs'](_0x2c5207,_0x116fb0,_0x13ec76,_0x55f8c6,_0x22a5bf,_0x5d03c8,_0x4b99d0,_0x247edc);break;case _0x3c7a('0xd'):servicenow['cs'](_0x2c5207,_0x116fb0,_0x13ec76,_0x55f8c6,_0x22a5bf,_0x5d03c8,_0x4b99d0,_0x247edc);break;case _0x3c7a('0x1a'):dynamics365['cs'](_0x2c5207,_0x116fb0,_0x13ec76,_0x55f8c6,_0x22a5bf,_0x5d03c8,_0x4b99d0,_0x247edc);break;default:console[_0x3c7a('0x16')](_0x3c7a('0x1b'));}}else{_0x29bfc2=require('../../../../config/logger')(_0x2c5207[_0x3c7a('0x11')]['toLowerCase']());_0x29bfc2[_0x3c7a('0x1c')]('[EXEC]',util[_0x3c7a('0x1d')](_0x3c7a('0x1e'),_0x2c5207['data1'][_0x3c7a('0x10')](),_0x2c5207['data3']));}}else{_0x29bfc2=require('../../../../config/logger')(_0x2c5207[_0x3c7a('0x11')][_0x3c7a('0x10')]());_0x29bfc2[_0x3c7a('0x1c')](_0x3c7a('0x1f'),util['format'](_0x3c7a('0x20'),_0x2c5207[_0x3c7a('0x11')][_0x3c7a('0x10')](),_0x2c5207['data2']));}}else{}}catch(_0x559918){console['error'](_0x559918);}}}}; \ 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 54021ab..71f4532 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 _0x4d39=['attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','Name','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','catch','error','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridnum',']\x20Ticket\x20%s\x20created.','request-promise','moment','md5','jsforce','util','ioredis','./util','../../../../config/environment','redis','localhost','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','contact','WhoId','endUserType','WhatId','Case','ContactId','account','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','find','length','Email','info','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','then','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','additionalSearchContact','merge','$or','Contact','execute','cloneDeep','additionalSearchLead','sobject','Lead','additionalSearchAccount','Account','first'];(function(_0x38616d,_0x22fbe5){var _0x505626=function(_0x5b3a5a){while(--_0x5b3a5a){_0x38616d['push'](_0x38616d['shift']());}};_0x505626(++_0x22fbe5);}(_0x4d39,0x13c));var _0x94d3=function(_0x1bff3b,_0x3a9503){_0x1bff3b=_0x1bff3b-0x0;var _0x5b1dd0=_0x4d39[_0x1bff3b];return _0x5b1dd0;};'use strict';var _=require('lodash');var rp=require(_0x94d3('0x0'));var moment=require(_0x94d3('0x1'));var BPromise=require('bluebird');var md5=require(_0x94d3('0x2'));var jsforce=require(_0x94d3('0x3'));var util=require(_0x94d3('0x4'));var Redis=require(_0x94d3('0x5'));var intUtil=require(_0x94d3('0x6'));var config=require(_0x94d3('0x7'));var logger=require('../../../../config/logger')('salesforce');config[_0x94d3('0x8')]=_['defaults'](config[_0x94d3('0x8')],{'host':_0x94d3('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x94d3('0x8')]));function emit(_0x462815,_0x477cd7,_0x11699d){io['to'](_0x462815)[_0x94d3('0xa')](_0x477cd7,_0x11699d);}function getTicket(_0x129195,_0x29d4a8,_0x54f1ec,_0x58254d,_0x4130c5,_0x46f032,_0x2151c9,_0x48f679){var _0x1b6ce6=Object[_0x94d3('0xb')]({},{'OwnerId':_0x29d4a8['id'],'Subject':intUtil[_0x94d3('0xc')](_0x58254d[_0x94d3('0xd')],_0x4130c5,'\x20'),'Description':intUtil[_0x94d3('0xc')](_0x58254d[_0x94d3('0xe')],_0x4130c5,'\x0a')},getCustomFields(_0x46f032,_0x4130c5));if(_0x54f1ec){if(_0x58254d[_0x94d3('0xf')]===_0x94d3('0x10')){_0x1b6ce6[_0x94d3('0x11')]=moment[_0x94d3('0x12')]();_0x1b6ce6[_0x94d3('0x13')]=![];_0x1b6ce6['IsRecurrence']=![];if(_0x54f1ec['endUserType']===_0x94d3('0x14')||_0x54f1ec['endUserType']==='lead'){_0x1b6ce6[_0x94d3('0x15')]=_0x54f1ec['id'];}else if(_0x54f1ec[_0x94d3('0x16')]==='account'){_0x1b6ce6[_0x94d3('0x17')]=_0x54f1ec['id'];}}else if(_0x58254d[_0x94d3('0xf')]===_0x94d3('0x18')){if(_0x54f1ec[_0x94d3('0x16')]===_0x94d3('0x14')){_0x1b6ce6[_0x94d3('0x19')]=_0x54f1ec['id'];}else if(_0x54f1ec[_0x94d3('0x16')]===_0x94d3('0x1a')){_0x1b6ce6[_0x94d3('0x1b')]=_0x54f1ec['id'];}else if(_0x54f1ec['endUserType']===_0x94d3('0x1c')&&_0x58254d[_0x94d3('0x1d')]){_0x1b6ce6[_0x58254d[_0x94d3('0x1d')]]=_0x54f1ec['id'];}else{logger['info'](_0x94d3('0x1e'));}}}return _0x2151c9['sobject'](_0x58254d[_0x94d3('0xf')])[_0x94d3('0x1f')](_0x1b6ce6);}function getUser(_0x29cd4f,_0x29f315,_0x4d5053){if(!_[_0x94d3('0x20')](_0x29f315)&&intUtil['validateEmail'](_0x29f315)){var _0x5653fa={'Email':_0x29f315};var _0x4c34e0={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4d5053['sobject']('User')[_0x94d3('0x21')](_0x5653fa,_0x4c34e0)['execute']()['then'](function(_0x30615b){if(_0x30615b[_0x94d3('0x22')]){var _0x568f8e=_[_0x94d3('0x21')](_0x30615b,function(_0x546ecc){return _0x546ecc[_0x94d3('0x23')]===_0x29f315;});if(_0x568f8e){logger[_0x94d3('0x24')]('Agent\x20%s\x20found.',_0x29f315);return BPromise[_0x94d3('0x25')]({'id':_0x568f8e['Id'],'name':_0x568f8e['Name']});}}else{logger[_0x94d3('0x24')](_0x94d3('0x26'),_0x29f315);return _0x4d5053['identity']()['then'](function(_0x59ee5f){return BPromise[_0x94d3('0x25')]({'id':_0x59ee5f[_0x94d3('0x27')],'name':_0x59ee5f[_0x94d3('0x28')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x29f315);return _0x4d5053[_0x94d3('0x29')]()[_0x94d3('0x2a')](function(_0x5b1be8){return BPromise[_0x94d3('0x25')]({'id':_0x5b1be8['user_id'],'name':_0x5b1be8[_0x94d3('0x28')]});});}}function getEndUser(_0x1fffec,_0x2bf869,_0x16137e,_0x19f095,_0x3ec896){var _0x7bead8={'$or':{'Phone':_0x19f095}};var _0x416a53={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x94d3('0x2a')](function(){logger[_0x94d3('0x24')](_0x94d3('0x2b'),_0x19f095,_0x2bf869['moduleSearch']);switch(_0x2bf869['moduleSearch']){case'contact_lead':var _0x41e603=_['cloneDeep'](_0x7bead8);if(_0x2bf869[_0x94d3('0x2c')]){var _0xa48e85={};_0xa48e85[_0x2bf869[_0x94d3('0x2c')]]=_0x19f095;_[_0x94d3('0x2d')](_0x41e603[_0x94d3('0x2e')],_0xa48e85);}return _0x3ec896['sobject'](_0x94d3('0x2f'))['find'](_0x41e603,_0x416a53)[_0x94d3('0x30')]()[_0x94d3('0x2a')](function(_0x3078cb){if(_0x3078cb&&_0x3078cb['length']){return _0x3078cb;}else{var _0xd4acda=_[_0x94d3('0x31')](_0x7bead8);if(_0x2bf869['additionalSearchLead']){var _0x68d5ed={};_0x68d5ed[_0x2bf869[_0x94d3('0x32')]]=_0x19f095;_[_0x94d3('0x2d')](_0xd4acda[_0x94d3('0x2e')],_0x68d5ed);}return _0x3ec896[_0x94d3('0x33')](_0x94d3('0x34'))[_0x94d3('0x21')](_0xd4acda,_0x416a53);}});case'account_contact_lead':var _0xe5b749=_['cloneDeep'](_0x7bead8);if(_0x2bf869[_0x94d3('0x35')]){var _0xa48e85={};_0xa48e85[_0x2bf869[_0x94d3('0x35')]]=_0x19f095;_[_0x94d3('0x2d')](_0xe5b749[_0x94d3('0x2e')],_0xa48e85);}return _0x3ec896[_0x94d3('0x33')]('Account')[_0x94d3('0x21')](_0xe5b749,_0x416a53)[_0x94d3('0x30')]()['then'](function(_0x1eb7ec){if(_0x1eb7ec&&_0x1eb7ec['length']){return _0x1eb7ec;}else{var _0x2cde17=_[_0x94d3('0x31')](_0x7bead8);if(_0x2bf869['additionalSearchContact']){var _0x591467={};_0x591467[_0x2bf869[_0x94d3('0x2c')]]=_0x19f095;_['merge'](_0x2cde17['$or'],_0x591467);}return _0x3ec896['sobject']('Contact')[_0x94d3('0x21')](_0x2cde17,_0x416a53)[_0x94d3('0x2a')](function(_0x29dca4){if(_0x29dca4&&_0x29dca4[_0x94d3('0x22')]){return _0x29dca4;}else{var _0x344931=_[_0x94d3('0x31')](_0x7bead8);if(_0x2bf869[_0x94d3('0x32')]){var _0x3402ef={};_0x3402ef[_0x2bf869[_0x94d3('0x32')]]=_0x19f095;_[_0x94d3('0x2d')](_0x344931[_0x94d3('0x2e')],_0x3402ef);}return _0x3ec896[_0x94d3('0x33')](_0x94d3('0x34'))[_0x94d3('0x21')](_0x344931,_0x416a53);}});}});case'contact':var _0x41e603=_['cloneDeep'](_0x7bead8);if(_0x2bf869[_0x94d3('0x2c')]){var _0xa48e85={};_0xa48e85[_0x2bf869[_0x94d3('0x2c')]]=_0x19f095;_[_0x94d3('0x2d')](_0x41e603[_0x94d3('0x2e')],_0xa48e85);}return _0x3ec896[_0x94d3('0x33')](_0x94d3('0x2f'))['find'](_0x41e603,_0x416a53)['execute']();case _0x94d3('0x1c'):var _0x53e3bb=_[_0x94d3('0x31')](_0x7bead8);if(_0x2bf869[_0x94d3('0x32')]){var _0xa48e85={};_0xa48e85[_0x2bf869[_0x94d3('0x32')]]=_0x19f095;_[_0x94d3('0x2d')](_0x53e3bb[_0x94d3('0x2e')],_0xa48e85);}return _0x3ec896['sobject'](_0x94d3('0x34'))['find'](_0x53e3bb,_0x416a53);case _0x94d3('0x1a'):var _0xe5b749=_[_0x94d3('0x31')](_0x7bead8);if(_0x2bf869['additionalSearchAccount']){var _0xa48e85={};_0xa48e85[_0x2bf869[_0x94d3('0x35')]]=_0x19f095;_['merge'](_0xe5b749['$or'],_0xa48e85);}return _0x3ec896[_0x94d3('0x33')](_0x94d3('0x36'))[_0x94d3('0x21')](_0xe5b749,_0x416a53);default:return null;}})['then'](function(_0x1c9441){if(_0x1c9441&&_0x1c9441['length']){var _0x176488=_[_0x94d3('0x37')](_0x1c9441);if(_0x176488){return BPromise[_0x94d3('0x25')]({'id':_0x176488['Id'],'name':_0x176488['Name'],'phone':_0x176488['Phone'],'endUserType':_0x176488[_0x94d3('0x38')]['type'][_0x94d3('0x39')]()});}}})[_0x94d3('0x2a')](function(_0x374fe6){if(_0x374fe6){logger[_0x94d3('0x24')](_0x94d3('0x3a'),_0x374fe6[_0x94d3('0x16')],_0x19f095);return BPromise[_0x94d3('0x25')](_0x374fe6);}else{logger['info'](_0x94d3('0x3b'),_0x19f095);var _0x5e3aeb={'Phone':_0x19f095};if(_0x2bf869[_0x94d3('0x3c')]){if(_0x2bf869[_0x94d3('0x3c')]===_0x94d3('0x14')){logger[_0x94d3('0x24')](_0x94d3('0x3d'),_0x19f095,_0x2bf869['moduleCreate']);_0x5e3aeb[_0x94d3('0x3e')]=_0x16137e!==_0x94d3('0x3f')?_0x16137e:util[_0x94d3('0x40')](_0x94d3('0x41'),_0x19f095);}else if(_0x2bf869['moduleCreate']==='lead'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x19f095,_0x2bf869[_0x94d3('0x3c')]);_0x5e3aeb[_0x94d3('0x3e')]=_0x16137e!==''?_0x16137e:util[_0x94d3('0x40')](_0x94d3('0x41'),_0x19f095);_0x5e3aeb[_0x94d3('0x42')]=_0x94d3('0x43');}else if(_0x2bf869[_0x94d3('0x3c')]===_0x94d3('0x1a')){logger['info'](_0x94d3('0x3d'),_0x19f095,_0x2bf869[_0x94d3('0x3c')]);_0x5e3aeb[_0x94d3('0x44')]=_0x16137e!==_0x94d3('0x3f')?_0x16137e:util[_0x94d3('0x40')]('Caller\x20-\x20%s',_0x19f095);}else{return null;}}return _0x3ec896[_0x94d3('0x33')](_['upperFirst'](_0x2bf869['moduleCreate']))['create'](_0x5e3aeb)[_0x94d3('0x2a')](function(_0x8bada2){return BPromise[_0x94d3('0x25')]({'id':_0x8bada2['id'],'endUserType':_0x2bf869['moduleCreate']});});}});}function getCustomFields(_0x9eb5be,_0x1d2b81){var _0xd45c09={};if(_0x9eb5be[_0x94d3('0x22')]>0x0){_[_0x94d3('0x45')](_0x9eb5be,function(_0x435d03){if(_[_0x94d3('0x46')]([_0x94d3('0x47'),'picklist'],_0x435d03[_0x94d3('0x48')])&&_0x435d03[_0x94d3('0x49')]){_0xd45c09[_0x435d03[_0x94d3('0x49')]]=_0x435d03[_0x94d3('0x4a')][_0x94d3('0x4b')]();}else if(_0x435d03[_0x94d3('0x48')]===_0x94d3('0x4c')&&_0x435d03[_0x94d3('0x4d')]&&_0x435d03[_0x94d3('0x49')]){_0x1d2b81[_0x435d03['variableName']]&&(_0xd45c09[_0x435d03[_0x94d3('0x49')]]=_0x1d2b81[_0x435d03[_0x94d3('0x4d')]][_0x94d3('0x4b')]());}else if(_0x435d03[_0x94d3('0x48')]===_0x94d3('0x4e')&&_0x435d03['Variable']&&_0x435d03[_0x94d3('0x4f')][_0x94d3('0x50')]&&_0x435d03[_0x94d3('0x49')]){_0x1d2b81[_0x435d03['Variable'][_0x94d3('0x50')][_0x94d3('0x39')]()]&&(_0xd45c09[_0x435d03['idField']]=_0x1d2b81[_0x435d03[_0x94d3('0x4f')]['name']['toLowerCase']()][_0x94d3('0x4b')]());}});}return _0xd45c09;}function getConnection(_0x5992ba){var _0x379cea=_0x5992ba['password'][_0x94d3('0x51')](_0x5992ba[_0x94d3('0x52')]);var _0x44347f=new jsforce[(_0x94d3('0x53'))]({'oauth2':{'loginUrl':_0x5992ba[_0x94d3('0x54')]||_0x94d3('0x55'),'clientId':_0x5992ba[_0x94d3('0x56')],'clientSecret':_0x5992ba[_0x94d3('0x57')]}});return _0x44347f[_0x94d3('0x58')](_0x5992ba['username'],_0x379cea)[_0x94d3('0x2a')](function(){logger[_0x94d3('0x24')](_0x94d3('0x59'));return _0x44347f;});}exports[_0x94d3('0x5a')]=function(_0xbc3920,_0x29ffcc,_0x2f2ceb,_0xe0373d,_0x5b968a,_0x28ed4f){var _0x20f7fe,_0x40ec18,_0x53d13f,_0x59fe32;_0x28ed4f[_0x94d3('0x5b')]=intUtil[_0x94d3('0x5c')](_0x28ed4f['serverUrl']);_0x28ed4f[_0x94d3('0x54')]=intUtil[_0x94d3('0x5c')](_0x28ed4f[_0x94d3('0x54')]);if(_0x5b968a&&_0x5b968a[_0x94d3('0x5d')]){logger[_0x94d3('0x24')](_0x94d3('0x5e'),'Recording\x20is\x20enabled!');_0x29ffcc[_0x94d3('0x5f')]=util[_0x94d3('0x40')](_0x94d3('0x60'),_0x28ed4f['serverUrl'],_0x29ffcc[_0x94d3('0x61')],md5(_0x29ffcc[_0x94d3('0x61')]));}else{_0x29ffcc[_0x94d3('0x5f')]='';}return getConnection(_0x28ed4f)[_0x94d3('0x2a')](function(_0x492fc4){_0x59fe32=_0x492fc4;return getUser(_0x28ed4f,_0xe0373d[_0x94d3('0x62')],_0x59fe32);})[_0x94d3('0x2a')](function(_0x4524eb){_0x20f7fe=_0x4524eb;return getEndUser(_0x28ed4f,_0x2f2ceb,_0x29ffcc['calleridname'],_0x29ffcc['calleridnum'],_0x59fe32);})[_0x94d3('0x2a')](function(_0x5d322b){_0x40ec18=_0x5d322b;return getTicket(_0x28ed4f,_0x20f7fe,_0x40ec18,_0x2f2ceb,_0x29ffcc,_0x2f2ceb[_0x94d3('0x63')],_0x59fe32,_0x94d3('0x5a'));})[_0x94d3('0x2a')](function(_0x260f69){_0x53d13f=_0x260f69;logger[_0x94d3('0x24')](_0x94d3('0x64'),_0x53d13f['id']);logger[_0x94d3('0x24')](_0x94d3('0x65'),_0x53d13f['id'],_0xe0373d[_0x94d3('0x50')],_0x28ed4f['type']);switch(_0x28ed4f[_0x94d3('0x48')]){case _0x94d3('0x66'):emit(util['format'](_0x94d3('0x67'),_0xe0373d['name']),'trigger:salesforce:display',{'recordId':_0x53d13f['id']});break;case'newTab':emit(util[_0x94d3('0x40')](_0x94d3('0x67'),_0xe0373d[_0x94d3('0x50')]),_0x94d3('0x68'),{'uri':util['format'](_0x94d3('0x69'),_0x59fe32[_0x94d3('0x6a')],_0x53d13f['id'])});break;default:logger['error'](_0x94d3('0x6b'));}})['catch'](function(_0x20971e){logger['error'](_0x94d3('0x5e'),_0x20971e);});};exports[_0x94d3('0x6c')]=function(_0xc05114,_0x18d6cc,_0x2a0a67,_0x2ff31e,_0x136fd0,_0x421d56,_0x201737){var _0x37337b,_0x1bdb7b,_0x464e56,_0x4e9ba2;_0x421d56[_0x94d3('0x5b')]=intUtil[_0x94d3('0x5c')](_0x421d56[_0x94d3('0x5b')]);_0x421d56['remoteUri']=intUtil[_0x94d3('0x5c')](_0x421d56[_0x94d3('0x54')]);if(_0x201737&&_0x201737[_0x94d3('0x6d')]&&_0x201737[_0x94d3('0x6d')]!=='none'){logger['info'](_0x94d3('0x6e'),'Recording\x20is\x20enabled!');_0x18d6cc['recordingURL']=util[_0x94d3('0x40')](_0x94d3('0x60'),_0x421d56[_0x94d3('0x5b')],_0x18d6cc[_0x94d3('0x61')],md5(_0x18d6cc[_0x94d3('0x61')]));}return getConnection(_0x421d56)['then'](function(_0x531490){_0x4e9ba2=_0x531490;return getUser(_0x421d56,_0x2ff31e['email'],_0x4e9ba2);})[_0x94d3('0x2a')](function(_0x1c890c){_0x37337b=_0x1c890c;return getEndUser(_0x421d56,_0x2a0a67,_0x18d6cc[_0x94d3('0x6f')],_0x18d6cc['destcalleridnum'],_0x4e9ba2);})[_0x94d3('0x2a')](function(_0x36d7db){_0x1bdb7b=_0x36d7db;return getTicket(_0x421d56,_0x37337b,_0x1bdb7b,_0x2a0a67,_0x18d6cc,_0x2a0a67[_0x94d3('0x63')],_0x4e9ba2,_0x94d3('0x6c'));})['then'](function(_0x3696bf){_0x464e56=_0x3696bf;logger[_0x94d3('0x24')](_0x94d3('0x70'),_0x464e56['id']);logger['info'](_0x94d3('0x71'),_0x464e56['id'],_0x2ff31e[_0x94d3('0x50')],_0x421d56['type']);switch(_0x421d56[_0x94d3('0x48')]){case _0x94d3('0x66'):emit(util[_0x94d3('0x40')]('user:%s',_0x2ff31e['name']),'trigger:salesforce:display',{'recordId':_0x464e56['id']});break;case _0x94d3('0x72'):emit(util[_0x94d3('0x40')](_0x94d3('0x67'),_0x2ff31e[_0x94d3('0x50')]),'trigger:browser:url',{'uri':util[_0x94d3('0x40')](_0x94d3('0x69'),_0x4e9ba2[_0x94d3('0x6a')],_0x464e56['id'])});break;default:logger['error'](_0x94d3('0x6e'),_0x94d3('0x73'));}})[_0x94d3('0x74')](function(_0x399fde){logger[_0x94d3('0x75')](_0x94d3('0x6e'),_0x399fde);});};exports[_0x94d3('0x76')]=function(_0x4eb0e9,_0x4fa0d4,_0xc55f66,_0x11c600,_0x161840,_0x2cf52f){var _0x3d69e0,_0x422b0c,_0x35f89f,_0xbfd621;_0x2cf52f[_0x94d3('0x5b')]=intUtil[_0x94d3('0x5c')](_0x2cf52f[_0x94d3('0x5b')]);_0x2cf52f[_0x94d3('0x54')]=intUtil['stripTrailingSlash'](_0x2cf52f[_0x94d3('0x54')]);if(_0x161840&&_0x161840['monitor_format']){logger[_0x94d3('0x24')]('['+_0x4fa0d4[_0x94d3('0x77')][_0x94d3('0x78')]()+']',_0x94d3('0x79'));_0x4fa0d4[_0x94d3('0x5f')]=util[_0x94d3('0x40')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2cf52f[_0x94d3('0x5b')],_0x4fa0d4[_0x94d3('0x61')],md5(_0x4fa0d4[_0x94d3('0x61')]));}else{_0x4fa0d4['recordingURL']='';}return getConnection(_0x2cf52f)['then'](function(_0x46d043){_0xbfd621=_0x46d043;if(!_[_0x94d3('0x20')](_0x11c600)){return getUser(_0x2cf52f,_0x11c600[_0x94d3('0x50')],_0xbfd621);}else{return getUser(_0x2cf52f,null,_0xbfd621);}})[_0x94d3('0x2a')](function(_0x480e39){_0x3d69e0=_0x480e39;return getEndUser(_0x2cf52f,_0xc55f66,_0x4fa0d4['calleridname'],_0x4fa0d4[_0x94d3('0x7a')],_0xbfd621);})[_0x94d3('0x2a')](function(_0x32d9af){_0x422b0c=_0x32d9af;return getTicket(_0x2cf52f,_0x3d69e0,_0x422b0c,_0xc55f66,_0x4fa0d4,_0xc55f66[_0x94d3('0x63')],_0xbfd621);})['then'](function(_0x1d5d35){_0x35f89f=_0x1d5d35;logger[_0x94d3('0x24')]('['+_0x4fa0d4[_0x94d3('0x77')]['toUpperCase']()+_0x94d3('0x7b'),_0x35f89f['id']);logger[_0x94d3('0x24')]('['+_0x4fa0d4[_0x94d3('0x77')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x2cf52f[_0x94d3('0x48')]);})[_0x94d3('0x74')](function(_0x3db340){logger[_0x94d3('0x75')]('['+_0x4fa0d4[_0x94d3('0x77')][_0x94d3('0x78')]()+']',_0x3db340);});}; \ No newline at end of file +var _0x9083=['Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','Company','No\x20Company','Name','forEach','includes','string','idField','content','variable','variableName','toString','customVariable','Variable','name','password','concat','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','monitor_format','lastevent','toUpperCase','recordingURL','isNil','calleridnum','lodash','bluebird','md5','jsforce','./util','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','ticketType','Task','utc','IsRecurrence','contact','endUserType','lead','WhoId','WhatId','Case','ContactId','account','leadId','info','create','validateEmail','sobject','find','execute','then','length','Email','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','cloneDeep','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found'];(function(_0x11c913,_0x1c6f22){var _0x5ba6eb=function(_0xb20492){while(--_0xb20492){_0x11c913['push'](_0x11c913['shift']());}};_0x5ba6eb(++_0x1c6f22);}(_0x9083,0xb4));var _0x3908=function(_0x75b9b7,_0x500211){_0x75b9b7=_0x75b9b7-0x0;var _0x5dc76e=_0x9083[_0x75b9b7];return _0x5dc76e;};'use strict';var _=require(_0x3908('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3908('0x1'));var md5=require(_0x3908('0x2'));var jsforce=require(_0x3908('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x3908('0x4'));var config=require('../../../../config/environment');var logger=require(_0x3908('0x5'))(_0x3908('0x6'));config[_0x3908('0x7')]=_['defaults'](config['redis'],{'host':_0x3908('0x8'),'port':0x18eb});var io=require(_0x3908('0x9'))(new Redis(config['redis']));function emit(_0x3a5fd9,_0x5e47e9,_0x2694d4){io['to'](_0x3a5fd9)[_0x3908('0xa')](_0x5e47e9,_0x2694d4);}function getTicket(_0x224ecc,_0x3efa41,_0x40fe16,_0x1e6e84,_0x202692,_0x5f1ba0,_0x47b1f5,_0x3472e4){var _0x5235f4=Object[_0x3908('0xb')]({},{'OwnerId':_0x3efa41['id'],'Subject':intUtil[_0x3908('0xc')](_0x1e6e84['Subjects'],_0x202692,'\x20'),'Description':intUtil[_0x3908('0xc')](_0x1e6e84['Descriptions'],_0x202692,'\x0a')},getCustomFields(_0x5f1ba0,_0x202692));if(_0x40fe16){if(_0x1e6e84[_0x3908('0xd')]===_0x3908('0xe')){_0x5235f4['ActivityDate']=moment[_0x3908('0xf')]();_0x5235f4['IsReminderSet']=![];_0x5235f4[_0x3908('0x10')]=![];if(_0x40fe16['endUserType']===_0x3908('0x11')||_0x40fe16[_0x3908('0x12')]===_0x3908('0x13')){_0x5235f4[_0x3908('0x14')]=_0x40fe16['id'];}else if(_0x40fe16[_0x3908('0x12')]==='account'){_0x5235f4[_0x3908('0x15')]=_0x40fe16['id'];}}else if(_0x1e6e84[_0x3908('0xd')]===_0x3908('0x16')){if(_0x40fe16['endUserType']==='contact'){_0x5235f4[_0x3908('0x17')]=_0x40fe16['id'];}else if(_0x40fe16[_0x3908('0x12')]===_0x3908('0x18')){_0x5235f4['AccountId']=_0x40fe16['id'];}else if(_0x40fe16[_0x3908('0x12')]===_0x3908('0x13')&&_0x1e6e84[_0x3908('0x19')]){_0x5235f4[_0x1e6e84[_0x3908('0x19')]]=_0x40fe16['id'];}else{logger[_0x3908('0x1a')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x47b1f5['sobject'](_0x1e6e84[_0x3908('0xd')])[_0x3908('0x1b')](_0x5235f4);}function getUser(_0x49eca5,_0x281098,_0x499c44){if(!_['isNil'](_0x281098)&&intUtil[_0x3908('0x1c')](_0x281098)){var _0x29d772={'Email':_0x281098};var _0x7642ac={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x499c44[_0x3908('0x1d')]('User')[_0x3908('0x1e')](_0x29d772,_0x7642ac)[_0x3908('0x1f')]()[_0x3908('0x20')](function(_0x33c15d){if(_0x33c15d[_0x3908('0x21')]){var _0x15b616=_[_0x3908('0x1e')](_0x33c15d,function(_0x4ba314){return _0x4ba314[_0x3908('0x22')]===_0x281098;});if(_0x15b616){logger['info'](_0x3908('0x23'),_0x281098);return BPromise['resolve']({'id':_0x15b616['Id'],'name':_0x15b616['Name']});}}else{logger[_0x3908('0x1a')](_0x3908('0x24'),_0x281098);return _0x499c44['identity']()[_0x3908('0x20')](function(_0x4a86cb){return BPromise[_0x3908('0x25')]({'id':_0x4a86cb[_0x3908('0x26')],'name':_0x4a86cb['display_name']});});}});}else{logger[_0x3908('0x1a')](_0x3908('0x24'),_0x281098);return _0x499c44[_0x3908('0x27')]()[_0x3908('0x20')](function(_0x3f1676){return BPromise[_0x3908('0x25')]({'id':_0x3f1676[_0x3908('0x26')],'name':_0x3f1676[_0x3908('0x28')]});});}}function getEndUser(_0xcc650e,_0x29df59,_0x517fb6,_0x1ba69d,_0xe654ef){var _0x572da1={'$or':{'Phone':_0x1ba69d}};var _0x100833={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x3908('0x20')](function(){logger[_0x3908('0x1a')](_0x3908('0x29'),_0x1ba69d,_0x29df59[_0x3908('0x2a')]);switch(_0x29df59[_0x3908('0x2a')]){case _0x3908('0x2b'):var _0x170542=_['cloneDeep'](_0x572da1);if(_0x29df59[_0x3908('0x2c')]){var _0x301c45={};_0x301c45[_0x29df59[_0x3908('0x2c')]]=_0x1ba69d;_[_0x3908('0x2d')](_0x170542[_0x3908('0x2e')],_0x301c45);}return _0xe654ef[_0x3908('0x1d')](_0x3908('0x2f'))['find'](_0x170542,_0x100833)[_0x3908('0x1f')]()[_0x3908('0x20')](function(_0x219324){if(_0x219324&&_0x219324[_0x3908('0x21')]){return _0x219324;}else{var _0x40387f=_[_0x3908('0x30')](_0x572da1);if(_0x29df59[_0x3908('0x31')]){var _0x486921={};_0x486921[_0x29df59[_0x3908('0x31')]]=_0x1ba69d;_['merge'](_0x40387f[_0x3908('0x2e')],_0x486921);}return _0xe654ef[_0x3908('0x1d')](_0x3908('0x32'))[_0x3908('0x1e')](_0x40387f,_0x100833);}});case _0x3908('0x33'):var _0xbabead=_[_0x3908('0x30')](_0x572da1);if(_0x29df59[_0x3908('0x34')]){var _0x301c45={};_0x301c45[_0x29df59[_0x3908('0x34')]]=_0x1ba69d;_[_0x3908('0x2d')](_0xbabead[_0x3908('0x2e')],_0x301c45);}return _0xe654ef['sobject']('Account')[_0x3908('0x1e')](_0xbabead,_0x100833)['execute']()[_0x3908('0x20')](function(_0x1ff49a){if(_0x1ff49a&&_0x1ff49a[_0x3908('0x21')]){return _0x1ff49a;}else{var _0x3b498d=_['cloneDeep'](_0x572da1);if(_0x29df59['additionalSearchContact']){var _0x4703bb={};_0x4703bb[_0x29df59['additionalSearchContact']]=_0x1ba69d;_['merge'](_0x3b498d[_0x3908('0x2e')],_0x4703bb);}return _0xe654ef[_0x3908('0x1d')](_0x3908('0x2f'))[_0x3908('0x1e')](_0x3b498d,_0x100833)[_0x3908('0x20')](function(_0x59e9a1){if(_0x59e9a1&&_0x59e9a1[_0x3908('0x21')]){return _0x59e9a1;}else{var _0x20c4b6=_['cloneDeep'](_0x572da1);if(_0x29df59['additionalSearchLead']){var _0x278b3a={};_0x278b3a[_0x29df59[_0x3908('0x31')]]=_0x1ba69d;_[_0x3908('0x2d')](_0x20c4b6[_0x3908('0x2e')],_0x278b3a);}return _0xe654ef[_0x3908('0x1d')](_0x3908('0x32'))['find'](_0x20c4b6,_0x100833);}});}});case _0x3908('0x11'):var _0x170542=_['cloneDeep'](_0x572da1);if(_0x29df59[_0x3908('0x2c')]){var _0x301c45={};_0x301c45[_0x29df59['additionalSearchContact']]=_0x1ba69d;_['merge'](_0x170542[_0x3908('0x2e')],_0x301c45);}return _0xe654ef[_0x3908('0x1d')](_0x3908('0x2f'))['find'](_0x170542,_0x100833)[_0x3908('0x1f')]();case _0x3908('0x13'):var _0x48e2e8=_[_0x3908('0x30')](_0x572da1);if(_0x29df59[_0x3908('0x31')]){var _0x301c45={};_0x301c45[_0x29df59[_0x3908('0x31')]]=_0x1ba69d;_[_0x3908('0x2d')](_0x48e2e8[_0x3908('0x2e')],_0x301c45);}return _0xe654ef['sobject'](_0x3908('0x32'))['find'](_0x48e2e8,_0x100833);case'account':var _0xbabead=_['cloneDeep'](_0x572da1);if(_0x29df59[_0x3908('0x34')]){var _0x301c45={};_0x301c45[_0x29df59[_0x3908('0x34')]]=_0x1ba69d;_['merge'](_0xbabead[_0x3908('0x2e')],_0x301c45);}return _0xe654ef[_0x3908('0x1d')](_0x3908('0x35'))[_0x3908('0x1e')](_0xbabead,_0x100833);default:return null;}})[_0x3908('0x20')](function(_0x79ca6b){if(_0x79ca6b&&_0x79ca6b[_0x3908('0x21')]){var _0x3efd9f=_['first'](_0x79ca6b);if(_0x3efd9f){return BPromise['resolve']({'id':_0x3efd9f['Id'],'name':_0x3efd9f['Name'],'phone':_0x3efd9f[_0x3908('0x36')],'endUserType':_0x3efd9f['attributes'][_0x3908('0x37')][_0x3908('0x38')]()});}}})['then'](function(_0x5a683b){if(_0x5a683b){logger[_0x3908('0x1a')](_0x3908('0x39'),_0x5a683b[_0x3908('0x12')],_0x1ba69d);return BPromise[_0x3908('0x25')](_0x5a683b);}else{logger['info'](_0x3908('0x3a'),_0x1ba69d);var _0xaecb43={'Phone':_0x1ba69d};if(_0x29df59[_0x3908('0x3b')]){if(_0x29df59['moduleCreate']===_0x3908('0x11')){logger[_0x3908('0x1a')](_0x3908('0x3c'),_0x1ba69d,_0x29df59[_0x3908('0x3b')]);_0xaecb43[_0x3908('0x3d')]=_0x517fb6!==_0x3908('0x3e')?_0x517fb6:util['format'](_0x3908('0x3f'),_0x1ba69d);}else if(_0x29df59[_0x3908('0x3b')]==='lead'){logger[_0x3908('0x1a')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1ba69d,_0x29df59[_0x3908('0x3b')]);_0xaecb43[_0x3908('0x3d')]=_0x517fb6!==_0x3908('0x3e')?_0x517fb6:util['format']('Caller\x20-\x20%s',_0x1ba69d);_0xaecb43[_0x3908('0x40')]=_0x3908('0x41');}else if(_0x29df59[_0x3908('0x3b')]==='account'){logger[_0x3908('0x1a')](_0x3908('0x3c'),_0x1ba69d,_0x29df59[_0x3908('0x3b')]);_0xaecb43[_0x3908('0x42')]=_0x517fb6!==''?_0x517fb6:util['format']('Caller\x20-\x20%s',_0x1ba69d);}else{return null;}}return _0xe654ef[_0x3908('0x1d')](_['upperFirst'](_0x29df59[_0x3908('0x3b')]))['create'](_0xaecb43)[_0x3908('0x20')](function(_0x211bef){return BPromise[_0x3908('0x25')]({'id':_0x211bef['id'],'endUserType':_0x29df59[_0x3908('0x3b')]});});}});}function getCustomFields(_0x346521,_0x3c1436){var _0x42c3ed={};if(_0x346521['length']>0x0){_[_0x3908('0x43')](_0x346521,function(_0x2346fe){if(_[_0x3908('0x44')]([_0x3908('0x45'),'picklist'],_0x2346fe['type'])&&_0x2346fe[_0x3908('0x46')]){_0x42c3ed[_0x2346fe['idField']]=_0x2346fe[_0x3908('0x47')]['toString']();}else if(_0x2346fe[_0x3908('0x37')]===_0x3908('0x48')&&_0x2346fe[_0x3908('0x49')]&&_0x2346fe[_0x3908('0x46')]){_0x3c1436[_0x2346fe[_0x3908('0x49')]]&&(_0x42c3ed[_0x2346fe[_0x3908('0x46')]]=_0x3c1436[_0x2346fe[_0x3908('0x49')]][_0x3908('0x4a')]());}else if(_0x2346fe[_0x3908('0x37')]===_0x3908('0x4b')&&_0x2346fe[_0x3908('0x4c')]&&_0x2346fe[_0x3908('0x4c')][_0x3908('0x4d')]&&_0x2346fe['idField']){_0x3c1436[_0x2346fe['Variable'][_0x3908('0x4d')][_0x3908('0x38')]()]&&(_0x42c3ed[_0x2346fe[_0x3908('0x46')]]=_0x3c1436[_0x2346fe[_0x3908('0x4c')][_0x3908('0x4d')][_0x3908('0x38')]()][_0x3908('0x4a')]());}});}return _0x42c3ed;}function getConnection(_0x35314a){var _0x43efb7=_0x35314a[_0x3908('0x4e')][_0x3908('0x4f')](_0x35314a['securityToken']);var _0xecff39=new jsforce['Connection']({'oauth2':{'loginUrl':_0x35314a['remoteUri']||_0x3908('0x50'),'clientId':_0x35314a[_0x3908('0x51')],'clientSecret':_0x35314a[_0x3908('0x52')]}});return _0xecff39['login'](_0x35314a[_0x3908('0x53')],_0x43efb7)[_0x3908('0x20')](function(){logger[_0x3908('0x1a')](_0x3908('0x54'));return _0xecff39;});}exports[_0x3908('0x55')]=function(_0x176f98,_0x29da15,_0xa9b035,_0x4ab083,_0x1da876,_0x430cb2){var _0x32905f,_0x3471ee,_0x24f352,_0x30d71e;_0x430cb2[_0x3908('0x56')]=intUtil[_0x3908('0x57')](_0x430cb2[_0x3908('0x56')]);_0x430cb2[_0x3908('0x58')]=intUtil[_0x3908('0x57')](_0x430cb2[_0x3908('0x58')]);if(_0x1da876&&_0x1da876['monitor_format']){logger[_0x3908('0x1a')](_0x3908('0x59'),_0x3908('0x5a'));_0x29da15['recordingURL']=util[_0x3908('0x5b')](_0x3908('0x5c'),_0x430cb2['serverUrl'],_0x29da15['uniqueid'],md5(_0x29da15[_0x3908('0x5d')]));}else{_0x29da15['recordingURL']='';}return getConnection(_0x430cb2)[_0x3908('0x20')](function(_0x1c6412){_0x30d71e=_0x1c6412;return getUser(_0x430cb2,_0x4ab083[_0x3908('0x5e')],_0x30d71e);})[_0x3908('0x20')](function(_0x38dc59){_0x32905f=_0x38dc59;return getEndUser(_0x430cb2,_0xa9b035,_0x29da15[_0x3908('0x5f')],_0x29da15['calleridnum'],_0x30d71e);})[_0x3908('0x20')](function(_0x537ff6){_0x3471ee=_0x537ff6;return getTicket(_0x430cb2,_0x32905f,_0x3471ee,_0xa9b035,_0x29da15,_0xa9b035[_0x3908('0x60')],_0x30d71e,_0x3908('0x55'));})[_0x3908('0x20')](function(_0x4b974e){_0x24f352=_0x4b974e;logger['info'](_0x3908('0x61'),_0x24f352['id']);logger[_0x3908('0x1a')](_0x3908('0x62'),_0x24f352['id'],_0x4ab083[_0x3908('0x4d')],_0x430cb2[_0x3908('0x37')]);switch(_0x430cb2['type']){case _0x3908('0x63'):emit(util['format']('user:%s',_0x4ab083[_0x3908('0x4d')]),_0x3908('0x64'),{'recordId':_0x24f352['id']});break;case _0x3908('0x65'):emit(util[_0x3908('0x5b')](_0x3908('0x66'),_0x4ab083[_0x3908('0x4d')]),'trigger:browser:url',{'uri':util['format'](_0x3908('0x67'),_0x30d71e[_0x3908('0x68')],_0x24f352['id'])});break;default:logger[_0x3908('0x69')](_0x3908('0x6a'));}})[_0x3908('0x6b')](function(_0x5cb2b6){logger[_0x3908('0x69')](_0x3908('0x59'),_0x5cb2b6);});};exports[_0x3908('0x6c')]=function(_0x3fa692,_0x4dd3dc,_0x407040,_0x267f70,_0x423432,_0x1fb132,_0x1acbe9){var _0x38bf59,_0x57736a,_0x8f94f,_0x446c20;_0x1fb132['serverUrl']=intUtil[_0x3908('0x57')](_0x1fb132['serverUrl']);_0x1fb132['remoteUri']=intUtil['stripTrailingSlash'](_0x1fb132[_0x3908('0x58')]);if(_0x1acbe9&&_0x1acbe9[_0x3908('0x6d')]&&_0x1acbe9[_0x3908('0x6d')]!=='none'){logger[_0x3908('0x1a')](_0x3908('0x6e'),_0x3908('0x5a'));_0x4dd3dc['recordingURL']=util[_0x3908('0x5b')](_0x3908('0x5c'),_0x1fb132[_0x3908('0x56')],_0x4dd3dc[_0x3908('0x5d')],md5(_0x4dd3dc['uniqueid']));}return getConnection(_0x1fb132)['then'](function(_0xe8053d){_0x446c20=_0xe8053d;return getUser(_0x1fb132,_0x267f70[_0x3908('0x5e')],_0x446c20);})[_0x3908('0x20')](function(_0x339ef4){_0x38bf59=_0x339ef4;return getEndUser(_0x1fb132,_0x407040,_0x4dd3dc[_0x3908('0x6f')],_0x4dd3dc[_0x3908('0x70')],_0x446c20);})[_0x3908('0x20')](function(_0x538b25){_0x57736a=_0x538b25;return getTicket(_0x1fb132,_0x38bf59,_0x57736a,_0x407040,_0x4dd3dc,_0x407040[_0x3908('0x60')],_0x446c20,_0x3908('0x6c'));})['then'](function(_0x53f84f){_0x8f94f=_0x53f84f;logger[_0x3908('0x1a')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x8f94f['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x8f94f['id'],_0x267f70[_0x3908('0x4d')],_0x1fb132['type']);switch(_0x1fb132[_0x3908('0x37')]){case _0x3908('0x63'):emit(util['format'](_0x3908('0x66'),_0x267f70[_0x3908('0x4d')]),_0x3908('0x64'),{'recordId':_0x8f94f['id']});break;case _0x3908('0x65'):emit(util[_0x3908('0x5b')]('user:%s',_0x267f70[_0x3908('0x4d')]),'trigger:browser:url',{'uri':util[_0x3908('0x5b')](_0x3908('0x67'),_0x446c20[_0x3908('0x68')],_0x8f94f['id'])});break;default:logger[_0x3908('0x69')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x3908('0x6b')](function(_0x277a27){logger[_0x3908('0x69')](_0x3908('0x6e'),_0x277a27);});};exports['unmanaged']=function(_0x2c4ceb,_0x47f74d,_0x3fc654,_0x24c3f9,_0x4b3c8f,_0x48cc3d){var _0x1b84e4,_0x3aef71,_0x5a0895,_0xad5610;_0x48cc3d[_0x3908('0x56')]=intUtil[_0x3908('0x57')](_0x48cc3d['serverUrl']);_0x48cc3d[_0x3908('0x58')]=intUtil[_0x3908('0x57')](_0x48cc3d[_0x3908('0x58')]);if(_0x4b3c8f&&_0x4b3c8f[_0x3908('0x71')]){logger[_0x3908('0x1a')]('['+_0x47f74d[_0x3908('0x72')][_0x3908('0x73')]()+']',_0x3908('0x5a'));_0x47f74d[_0x3908('0x74')]=util[_0x3908('0x5b')](_0x3908('0x5c'),_0x48cc3d[_0x3908('0x56')],_0x47f74d['uniqueid'],md5(_0x47f74d[_0x3908('0x5d')]));}else{_0x47f74d[_0x3908('0x74')]='';}return getConnection(_0x48cc3d)[_0x3908('0x20')](function(_0x2e6b15){_0xad5610=_0x2e6b15;if(!_[_0x3908('0x75')](_0x24c3f9)){return getUser(_0x48cc3d,_0x24c3f9['name'],_0xad5610);}else{return getUser(_0x48cc3d,null,_0xad5610);}})[_0x3908('0x20')](function(_0xac557){_0x1b84e4=_0xac557;return getEndUser(_0x48cc3d,_0x3fc654,_0x47f74d[_0x3908('0x5f')],_0x47f74d[_0x3908('0x76')],_0xad5610);})[_0x3908('0x20')](function(_0xfa37fa){_0x3aef71=_0xfa37fa;return getTicket(_0x48cc3d,_0x1b84e4,_0x3aef71,_0x3fc654,_0x47f74d,_0x3fc654[_0x3908('0x60')],_0xad5610);})['then'](function(_0x5eee0f){_0x5a0895=_0x5eee0f;logger['info']('['+_0x47f74d[_0x3908('0x72')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x5a0895['id']);logger[_0x3908('0x1a')]('['+_0x47f74d[_0x3908('0x72')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x48cc3d[_0x3908('0x37')]);})[_0x3908('0x6b')](function(_0x55a9c8){logger[_0x3908('0x69')]('['+_0x47f74d[_0x3908('0x72')][_0x3908('0x73')]()+']',_0x55a9c8);});}; \ 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 816f966..a3d2588 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 _0xe9c2=['uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','then','length','adminId','sys_id','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','result','true','userId','userEmail','adminEmail','],\x20getUser\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','customField','nameField','toLowerCase','toString','string','idField','content','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','getString','Subjects','Descriptions','Fields','ticketId',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe9c2,0x1a7));var _0x2e9c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe9c2[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x2e9c('0x0'));var Promise=require('bluebird');var rp=require(_0x2e9c('0x1'));var util=require(_0x2e9c('0x2'));var md5=require(_0x2e9c('0x3'));var Redis=require(_0x2e9c('0x4'));var intUtil=require(_0x2e9c('0x5'));var config=require(_0x2e9c('0x6'));var logger=require(_0x2e9c('0x7'))(_0x2e9c('0x8'));config[_0x2e9c('0x9')]=_[_0x2e9c('0xa')](config[_0x2e9c('0x9')],{'host':_0x2e9c('0xb'),'port':0x18eb});var io=require(_0x2e9c('0xc'))(new Redis(config[_0x2e9c('0x9')]));function getAdminUser(_0x4dab86,_0x29f23b,_0x12cf23,_0x1d81cd,_0x3cec2f,_0x2363ea){return new Promise(function(_0x3e459d,_0x3329fb){var _0x201a82={'method':_0x2e9c('0xd'),'uri':_0x1d81cd+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x3cec2f+'&'+_0x2363ea,'auth':_0x29f23b,'json':!![]};return rp(_0x201a82)[_0x2e9c('0xe')](function(_0x325ee0){if(_0x325ee0['result'][_0x2e9c('0xf')]>0x0){_0x12cf23[_0x2e9c('0x10')]=_0x325ee0['result'][0x0][_0x2e9c('0x11')];}logger[_0x2e9c('0x12')]('['+[_0x4dab86[_0x2e9c('0x13')]()]+'],\x20getAdminUser\x20crm',_0x12cf23);_0x3e459d(_0x12cf23);})[_0x2e9c('0x14')](function(_0x11c040){logger[_0x2e9c('0x15')]('['+[_0x4dab86[_0x2e9c('0x13')]()]+']',_0x11c040['message']);_0x3329fb(_0x11c040[_0x2e9c('0x16')]);});});}function getUser(_0x24f653,_0x4edddd,_0x2e4720,_0x11d000,_0x2c97e2){return function(_0x4ab22e){logger[_0x2e9c('0x12')]('['+[_0x24f653[_0x2e9c('0x13')]()]+_0x2e9c('0x17'),_0x4ab22e);return new Promise(function(_0x4313ce,_0x136248){if(intUtil[_0x2e9c('0x18')](_0x4ab22e['userEmail'])){var _0x43db02={'method':_0x2e9c('0xd'),'uri':_0x2e4720+_0x2e9c('0x19')+_0x4ab22e['userEmail']+'&'+_0x11d000+'&'+_0x2c97e2,'auth':_0x4edddd,'json':!![]};logger[_0x2e9c('0x12')]('['+[_0x24f653[_0x2e9c('0x13')]()]+_0x2e9c('0x1a'),_0x43db02);return rp(_0x43db02)[_0x2e9c('0xe')](function(_0x5cc1a5){logger[_0x2e9c('0x12')]('['+[_0x24f653[_0x2e9c('0x13')]()]+'],\x20getUser\x20entity',_0x5cc1a5);if(_0x5cc1a5['result'][_0x2e9c('0xf')]>0x0&&String(_0x5cc1a5[_0x2e9c('0x1b')][0x0]['active'])===_0x2e9c('0x1c')){_0x4ab22e[_0x2e9c('0x1d')]=_0x5cc1a5['result'][0x0][_0x2e9c('0x11')];}else{_0x4ab22e['userId']=_0x4ab22e[_0x2e9c('0x10')];_0x4ab22e[_0x2e9c('0x1e')]=_0x4ab22e[_0x2e9c('0x1f')];}logger['info']('['+[_0x24f653[_0x2e9c('0x13')]()]+_0x2e9c('0x20'),_0x4ab22e);_0x4313ce(_0x4ab22e);})[_0x2e9c('0x14')](function(_0x287a1c){logger[_0x2e9c('0x15')]('['+[_0x24f653[_0x2e9c('0x13')]()]+']',_0x287a1c[_0x2e9c('0x16')]);_0x136248(_0x287a1c['message']);});}else{logger['info']('['+[_0x24f653[_0x2e9c('0x13')]()]+']\x20using\x20admin\x20profile');_0x4ab22e[_0x2e9c('0x1d')]=_0x4ab22e[_0x2e9c('0x10')];_0x4ab22e['userEmail']=_0x4ab22e[_0x2e9c('0x1f')];_0x4313ce(_0x4ab22e);}});};}function createEndUser(_0x5aa3c5,_0x68491b,_0x55bfe7,_0x574346,_0x1e9455){logger['info']('['+[_0x5aa3c5[_0x2e9c('0x13')]()]+'],\x20createEndUser\x20input\x20crm',_0x55bfe7);return new Promise(function(_0x57a9b9,_0x368822){var _0x2b1f2b={'method':_0x2e9c('0x21'),'uri':_0x574346+_0x2e9c('0x22')+_0x1e9455,'body':{'user_name':_0x55bfe7['endUserNumber'],'roles':'user','first_name':_0x55bfe7[_0x2e9c('0x23')],'active':_0x2e9c('0x1c'),'date_format':_0x2e9c('0x24'),'phone':_0x55bfe7[_0x2e9c('0x23')]},'auth':_0x68491b,'json':!![]};return rp(_0x2b1f2b)[_0x2e9c('0xe')](function(_0x3281ec){logger[_0x2e9c('0x12')]('['+[_0x5aa3c5[_0x2e9c('0x13')]()]+_0x2e9c('0x25'),_0x3281ec['result']);_0x55bfe7['endUserId']=_0x3281ec['result'][_0x2e9c('0x11')];_0x57a9b9(_0x55bfe7);})[_0x2e9c('0x14')](function(_0x2b6098){logger[_0x2e9c('0x15')]('['+[_0x5aa3c5[_0x2e9c('0x13')]()]+']',_0x2b6098[_0x2e9c('0x16')]);_0x368822(_0x2b6098['message']);});});}function getEndUser(_0x1c351a,_0x15421f,_0x3a56c1,_0x21adc7,_0x88b47f){return function(_0x2a9f09){logger['info']('['+[_0x1c351a['toUpperCase']()]+_0x2e9c('0x26'),_0x2a9f09);return new Promise(function(_0x32136e,_0x4e93a3){var _0x59773d={'method':'GET','uri':_0x3a56c1+_0x2e9c('0x27')+_0x2a9f09[_0x2e9c('0x23')]+'&'+_0x21adc7+'&'+_0x88b47f,'auth':_0x15421f,'json':!![]};return rp(_0x59773d)[_0x2e9c('0xe')](function(_0x45b589){if(_0x45b589[_0x2e9c('0x1b')][_0x2e9c('0xf')]>0x0){_0x2a9f09[_0x2e9c('0x28')]=_0x45b589['result'][0x0][_0x2e9c('0x11')];logger[_0x2e9c('0x12')]('['+[_0x1c351a[_0x2e9c('0x13')]()]+_0x2e9c('0x29'),_0x2a9f09);_0x32136e(_0x2a9f09);}else{return createEndUser(_0x1c351a,_0x15421f,_0x2a9f09,_0x3a56c1,_0x21adc7)[_0x2e9c('0xe')](function(_0x1f7668){logger[_0x2e9c('0x12')]('['+[_0x1c351a['toUpperCase']()]+_0x2e9c('0x2a'),_0x1f7668);_0x32136e(_0x1f7668);});}})[_0x2e9c('0x14')](function(_0x5d5569){logger[_0x2e9c('0x15')]('['+[_0x1c351a[_0x2e9c('0x13')]()]+']',_0x5d5569[_0x2e9c('0x16')]);_0x4e93a3(_0x5d5569['message']);});});};}function getCustomFields(_0x1c0f98,_0x47ca2d){var _0x34a66d={};if(_0x1c0f98[_0x2e9c('0xf')]>0x0){_[_0x2e9c('0x2b')](_0x1c0f98,function(_0x7a3dcb){if(_[_0x2e9c('0x2c')](['string',_0x2e9c('0x2d')],_0x7a3dcb[_0x2e9c('0x2e')])&&_0x7a3dcb['nameField']&&!_0x7a3dcb[_0x2e9c('0x2f')]){_0x34a66d[_0x7a3dcb[_0x2e9c('0x30')][_0x2e9c('0x31')]()]=_0x7a3dcb['content'][_0x2e9c('0x32')]();}else if(_['includes']([_0x2e9c('0x33'),_0x2e9c('0x2d')],_0x7a3dcb['type'])&&_0x7a3dcb[_0x2e9c('0x34')]&&_0x7a3dcb[_0x2e9c('0x2f')]){_0x34a66d[_0x7a3dcb[_0x2e9c('0x34')]['toLowerCase']()]=_0x7a3dcb[_0x2e9c('0x35')]['toString']();}else if(_0x7a3dcb['type']==='variable'&&_0x7a3dcb['variableName']&&_0x7a3dcb[_0x2e9c('0x34')]&&_0x7a3dcb[_0x2e9c('0x2f')]){_0x34a66d[_0x7a3dcb[_0x2e9c('0x34')][_0x2e9c('0x31')]()]=_0x47ca2d[_0x7a3dcb[_0x2e9c('0x36')]][_0x2e9c('0x32')]();}else if(_0x7a3dcb[_0x2e9c('0x2e')]==='customVariable'&&_0x7a3dcb[_0x2e9c('0x37')]&&_0x7a3dcb['Variable'][_0x2e9c('0x38')]&&_0x7a3dcb[_0x2e9c('0x34')]&&_0x7a3dcb['customField']){_0x34a66d[_0x7a3dcb[_0x2e9c('0x34')][_0x2e9c('0x31')]()]=_0x47ca2d[_0x7a3dcb[_0x2e9c('0x37')][_0x2e9c('0x38')]['toLowerCase']()]['toString']();}});}return _0x34a66d;}function getTicket(_0x5937b2,_0x28c366,_0x26263f,_0x2b1deb,_0x55792b,_0x25618f){return function(_0x7f3cb7){logger[_0x2e9c('0x12')]('['+[_0x5937b2['toUpperCase']()]+_0x2e9c('0x39'),_0x7f3cb7);return new Promise(function(_0x18411f,_0x415982){var _0x3c1807=_0x5937b2[_0x2e9c('0x31')]()===_0x2e9c('0x3a')?_0x7f3cb7[_0x2e9c('0x1d')]:_0x7f3cb7['endUserId'];var _0x4ee707={'method':_0x2e9c('0x21'),'uri':_0x26263f+'incident'+'?'+_0x25618f,'body':Object['assign']({},{'active':_0x2e9c('0x1c'),'caller_id':_0x3c1807,'assigned_to':_0x7f3cb7['userId'],'short_description':intUtil[_0x2e9c('0x3b')](_0x2b1deb[_0x2e9c('0x3c')],_0x55792b,'\x20'),'description':intUtil[_0x2e9c('0x3b')](_0x2b1deb[_0x2e9c('0x3d')],_0x55792b,'\x0a')},getCustomFields(_0x2b1deb[_0x2e9c('0x3e')],_0x55792b)),'auth':_0x28c366,'json':!![]};return rp(_0x4ee707)[_0x2e9c('0xe')](function(_0x208e95){logger[_0x2e9c('0x12')]('['+[_0x5937b2['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x208e95['result']);_0x7f3cb7[_0x2e9c('0x3f')]=_0x208e95[_0x2e9c('0x1b')]['sys_id'];_0x7f3cb7['ticketNumber']=_0x208e95[_0x2e9c('0x1b')]['number'];logger[_0x2e9c('0x12')]('['+[_0x5937b2[_0x2e9c('0x13')]()]+_0x2e9c('0x40'),_0x7f3cb7);_0x18411f(_0x7f3cb7);})[_0x2e9c('0x14')](function(_0x25e67c){logger[_0x2e9c('0x15')]('['+[_0x5937b2[_0x2e9c('0x13')]()]+']',_0x25e67c['message']);_0x415982(_0x25e67c['message']);});});};}function createRemoteTag(_0x48a302,_0x211bc1,_0x22d3f9,_0x2e7222){return new Promise(function(_0x1916b1,_0x41f328){var _0x1edc6d={'method':_0x2e9c('0x21'),'uri':_0x22d3f9+_0x2e9c('0x41')+'?'+_0x2e7222,'body':{'short_description':_0x48a302,'global':!![],'active':!![],'name':_0x48a302},'auth':_0x211bc1,'json':!![]};return rp(_0x1edc6d)[_0x2e9c('0xe')](function(_0x328b40){var _0x17ea87=_0x328b40[_0x2e9c('0x1b')][_0x2e9c('0x11')];_0x1916b1(_0x17ea87);});});}function getRemoteTag(_0x38839e,_0x24598d,_0x4f6f55,_0x230926,_0x2bf4fc){return new Promise(function(_0x532802,_0x488911){var _0x35dd6e={'method':_0x2e9c('0xd'),'uri':_0x4f6f55+_0x2e9c('0x41')+_0x2e9c('0x42')+_0x38839e+'&'+_0x230926,'auth':_0x24598d,'json':!![]};return rp(_0x35dd6e)[_0x2e9c('0xe')](function(_0x54beeb){if(_0x54beeb['result'][_0x2e9c('0xf')]>0x0){var _0x45dd5b=_0x54beeb['result'][0x0][_0x2e9c('0x11')];_0x532802(_0x45dd5b);}else{return createRemoteTag(_0x38839e,_0x24598d,_0x4f6f55,_0x230926)[_0x2e9c('0xe')](function(_0x4cc3b2){_0x532802(_0x4cc3b2);});}});});}function assignTagToIncident(_0x26aa74,_0x31f8db,_0x10b931,_0x1a1f9b,_0x525ff6){return new Promise(function(_0x20b77e,_0x5e9fec){var _0x3bdef8={'method':_0x2e9c('0x21'),'uri':_0x10b931+_0x2e9c('0x43')+'?'+_0x525ff6,'body':{'label':_0x26aa74,'table':_0x2e9c('0x44'),'id_type':_0x2e9c('0x45'),'table_key':_0x1a1f9b[_0x2e9c('0x3f')],'title':_0x2e9c('0x46')+_0x1a1f9b[_0x2e9c('0x47')],'id_display':_0x1a1f9b[_0x2e9c('0x47')]},'auth':_0x31f8db,'json':!![]};return rp(_0x3bdef8)[_0x2e9c('0xe')](function(_0xbd909c){_0x20b77e();})['catch'](function(){_0x20b77e();});});}function manageTags(_0x239c2b,_0xb31499,_0x4993f6,_0x5b0a55,_0x3a3f48,_0x658737,_0x57ff60){return new Promise(function(_0x443f58,_0x1f6b67){var _0x1e6bde=[];_0xb31499['forEach'](function(_0x1bbd6b){_0x1e6bde[_0x2e9c('0x48')](getRemoteTag(_0x1bbd6b,_0x4993f6,_0x5b0a55,_0x658737,_0x57ff60));});return Promise[_0x2e9c('0x49')](_0x1e6bde)[_0x2e9c('0xe')](function(_0x21e737){if(_0x21e737['length']){logger[_0x2e9c('0x12')]('['+[_0x239c2b['toUpperCase']()]+_0x2e9c('0x4a'),_0x21e737);var _0x5f4732=[];_0x21e737[_0x2e9c('0x2b')](function(_0x12b23e){_0x5f4732[_0x2e9c('0x48')](assignTagToIncident(_0x12b23e,_0x4993f6,_0x5b0a55,_0x3a3f48,_0x658737));});return Promise['all'](_0x5f4732)[_0x2e9c('0xe')](function(){_0x443f58();})['catch'](function(){_0x443f58();});}else{_0x443f58();}});});}function getTags(_0x8ff7bd,_0x2d1527,_0x322b33,_0x325827,_0xfb31f7,_0x8768a){return function(_0x15b618){return new Promise(function(_0x44c8ad,_0x14c738){var _0x5d8e12=[];var _0x3a43d9=_0x325827[_0x2e9c('0x4b')];if(_0x3a43d9&&_0x3a43d9['length']>0x0){_0x5d8e12=_['map'](_0x3a43d9,_0x2e9c('0x38'));}if(_0x5d8e12[_0x2e9c('0xf')]>0x0){return manageTags(_0x8ff7bd,_0x5d8e12,_0x2d1527,_0x322b33,_0x15b618,_0xfb31f7,_0x8768a)['then'](function(){_0x44c8ad(_0x15b618);});}else{_0x44c8ad(_0x15b618);}});};}function emit(_0x2ee773,_0x5ab21c,_0x525ce0){var _0x479911='%26sysparm_record_target%3Dincident'+_0x2e9c('0x4c')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x2e9c('0x4d');var _0x4b5929={'uri':_0x2ee773+_0x2e9c('0x4e')+_0x525ce0+_0x479911};io['to'](util['format'](_0x2e9c('0x4f'),_0x5ab21c))[_0x2e9c('0x50')](_0x2e9c('0x51'),_0x4b5929);}exports['cs']=function(_0x3ebfb0,_0x5a00dd,_0xdae077,_0x2ba57b,_0x43c381,_0x12c345,_0x509141,_0x54cf6f){var _0x58edf3={};var _0x50b063={'user':_0x12c345[_0x2e9c('0x52')],'pass':_0x12c345[_0x2e9c('0x53')]};var _0xdb0608=_0x2e9c('0x54');var _0xa228e8='sysparm_display_value=true';_0x12c345[_0x2e9c('0x55')]=intUtil[_0x2e9c('0x56')](_0x12c345[_0x2e9c('0x55')]);_0x12c345[_0x2e9c('0x57')]=intUtil[_0x2e9c('0x56')](_0x12c345[_0x2e9c('0x57')]);var _0x1a729f=util[_0x2e9c('0x58')](_0x2e9c('0x59'),_0x12c345[_0x2e9c('0x55')]);_0x58edf3[_0x2e9c('0x1e')]=!_[_0x2e9c('0x5a')](_0x2ba57b)?_0x2ba57b[_0x2e9c('0x5b')]:null;_0x58edf3[_0x2e9c('0x1f')]=_0x12c345[_0x2e9c('0x5b')];_0x58edf3[_0x2e9c('0x23')]=_0x54cf6f['toLowerCase']()===_0x2e9c('0x3a')?_0x5a00dd[_0x2e9c('0x5c')]:_0x5a00dd[_0x2e9c('0x5d')];_0x58edf3[_0x2e9c('0x5e')]=_0x54cf6f===_0x2e9c('0x5f')||_0x54cf6f==='unmanaged'?_0x2e9c('0x5f'):_0x2e9c('0x3a');var _0xed7544=util['format'](_0x2e9c('0x60'),_0x12c345[_0x2e9c('0x57')],_0x5a00dd[_0x2e9c('0x61')],md5(_0x5a00dd[_0x2e9c('0x61')]));if(_0x43c381&&_0x43c381[_0x2e9c('0x62')]){logger[_0x2e9c('0x12')]('[QUEUE]',_0x2e9c('0x63'));_0x5a00dd[_0x2e9c('0x64')]=_0xed7544;}else if(_0x509141&&_0x509141[_0x2e9c('0x65')]&&_0x509141[_0x2e9c('0x65')]!=='none'){logger[_0x2e9c('0x12')]('[OUTBOUND]',_0x2e9c('0x63'));_0x5a00dd[_0x2e9c('0x64')]=_0xed7544;}else{_0x5a00dd['recordingURL']='';}return getAdminUser(_0x54cf6f,_0x50b063,_0x58edf3,_0x1a729f,_0xa228e8,_0xdb0608)['then'](getUser(_0x54cf6f,_0x50b063,_0x1a729f,_0xa228e8,_0xdb0608))[_0x2e9c('0xe')](getEndUser(_0x54cf6f,_0x50b063,_0x1a729f,_0xa228e8,_0xdb0608))[_0x2e9c('0xe')](getTicket(_0x54cf6f,_0x50b063,_0x1a729f,_0xdae077,_0x5a00dd,_0xa228e8))[_0x2e9c('0xe')](function(_0x17c06e){logger['info'](util[_0x2e9c('0x58')]('The\x20ticket\x20ID\x20is:\x20%s',_0x17c06e[_0x2e9c('0x3f')]));logger[_0x2e9c('0x12')](util[_0x2e9c('0x58')](_0x2e9c('0x66'),_0x54cf6f));if(_0x54cf6f!=='unmanaged'){logger[_0x2e9c('0x12')]('['+[_0x54cf6f[_0x2e9c('0x13')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x12c345[_0x2e9c('0x55')],_0x2ba57b[_0x2e9c('0x38')],_0x17c06e[_0x2e9c('0x3f')]);}})[_0x2e9c('0x14')](function(_0x4cf360){logger['error']('['+[_0x54cf6f[_0x2e9c('0x13')]()]+_0x2e9c('0x67'),util['inspect'](_0x4cf360,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x12d9=['],\x20createEndUser\x20crm','includes','picklist','nameField','customField','toLowerCase','toString','string','idField','content','type','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','true','getString','Descriptions','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','format','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','toUpperCase','error','message','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','userId','adminEmail','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','endUserId','],\x20getEndUser\x20crm'];(function(_0x116930,_0x2265ba){var _0x110111=function(_0x549948){while(--_0x549948){_0x116930['push'](_0x116930['shift']());}};_0x110111(++_0x2265ba);}(_0x12d9,0xa1));var _0x912d=function(_0x1274dd,_0x21624b){_0x1274dd=_0x1274dd-0x0;var _0xc6919=_0x12d9[_0x1274dd];return _0xc6919;};'use strict';var _=require(_0x912d('0x0'));var Promise=require(_0x912d('0x1'));var rp=require(_0x912d('0x2'));var util=require(_0x912d('0x3'));var md5=require('md5');var Redis=require(_0x912d('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x912d('0x5'))('servicenow');config[_0x912d('0x6')]=_[_0x912d('0x7')](config[_0x912d('0x6')],{'host':_0x912d('0x8'),'port':0x18eb});var io=require(_0x912d('0x9'))(new Redis(config['redis']));function getAdminUser(_0x49200c,_0x5d5909,_0x1278b5,_0x1432a8,_0x320cf5,_0xf57130){return new Promise(function(_0xac14d7,_0x17d62d){var _0x5d8ee4={'method':_0x912d('0xa'),'uri':_0x1432a8+_0x912d('0xb')+'&'+_0x320cf5+'&'+_0xf57130,'auth':_0x5d5909,'json':!![]};return rp(_0x5d8ee4)['then'](function(_0x156cfe){if(_0x156cfe[_0x912d('0xc')][_0x912d('0xd')]>0x0){_0x1278b5[_0x912d('0xe')]=_0x156cfe[_0x912d('0xc')][0x0][_0x912d('0xf')];}logger[_0x912d('0x10')]('['+[_0x49200c[_0x912d('0x11')]()]+'],\x20getAdminUser\x20crm',_0x1278b5);_0xac14d7(_0x1278b5);})['catch'](function(_0xce805e){logger[_0x912d('0x12')]('['+[_0x49200c[_0x912d('0x11')]()]+']',_0xce805e[_0x912d('0x13')]);_0x17d62d(_0xce805e[_0x912d('0x13')]);});});}function getUser(_0x4931f3,_0xfae737,_0x80c9a6,_0xfb3686,_0x41e4cf){return function(_0x5455fe){logger[_0x912d('0x10')]('['+[_0x4931f3[_0x912d('0x11')]()]+_0x912d('0x14'),_0x5455fe);return new Promise(function(_0x511d3a,_0x381410){if(intUtil['validateEmail'](_0x5455fe[_0x912d('0x15')])){var _0x9fc35a={'method':_0x912d('0xa'),'uri':_0x80c9a6+'sys_user?sysparm_query=email%3D'+_0x5455fe['userEmail']+'&'+_0xfb3686+'&'+_0x41e4cf,'auth':_0xfae737,'json':!![]};logger['info']('['+[_0x4931f3[_0x912d('0x11')]()]+_0x912d('0x16'),_0x9fc35a);return rp(_0x9fc35a)[_0x912d('0x17')](function(_0x51a59c){logger[_0x912d('0x10')]('['+[_0x4931f3[_0x912d('0x11')]()]+_0x912d('0x18'),_0x51a59c);if(_0x51a59c[_0x912d('0xc')][_0x912d('0xd')]>0x0&&String(_0x51a59c['result'][0x0][_0x912d('0x19')])==='true'){_0x5455fe[_0x912d('0x1a')]=_0x51a59c['result'][0x0][_0x912d('0xf')];}else{_0x5455fe['userId']=_0x5455fe[_0x912d('0xe')];_0x5455fe[_0x912d('0x15')]=_0x5455fe[_0x912d('0x1b')];}logger[_0x912d('0x10')]('['+[_0x4931f3[_0x912d('0x11')]()]+'],\x20getUser\x20crm',_0x5455fe);_0x511d3a(_0x5455fe);})[_0x912d('0x1c')](function(_0x1db330){logger[_0x912d('0x12')]('['+[_0x4931f3[_0x912d('0x11')]()]+']',_0x1db330[_0x912d('0x13')]);_0x381410(_0x1db330[_0x912d('0x13')]);});}else{logger[_0x912d('0x10')]('['+[_0x4931f3['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x5455fe[_0x912d('0x1a')]=_0x5455fe[_0x912d('0xe')];_0x5455fe['userEmail']=_0x5455fe[_0x912d('0x1b')];_0x511d3a(_0x5455fe);}});};}function createEndUser(_0xcf3e25,_0xdfdb30,_0x49f7bb,_0x12e892,_0x84b9b9){logger[_0x912d('0x10')]('['+[_0xcf3e25[_0x912d('0x11')]()]+_0x912d('0x1d'),_0x49f7bb);return new Promise(function(_0x37c2c7,_0x18565f){var _0x126210={'method':_0x912d('0x1e'),'uri':_0x12e892+_0x912d('0x1f')+_0x84b9b9,'body':{'user_name':_0x49f7bb['endUserNumber'],'roles':_0x912d('0x20'),'first_name':_0x49f7bb[_0x912d('0x21')],'active':'true','date_format':_0x912d('0x22'),'phone':_0x49f7bb['endUserNumber']},'auth':_0xdfdb30,'json':!![]};return rp(_0x126210)['then'](function(_0x43922d){logger[_0x912d('0x10')]('['+[_0xcf3e25[_0x912d('0x11')]()]+'],\x20EndUser\x20schema',_0x43922d['result']);_0x49f7bb['endUserId']=_0x43922d[_0x912d('0xc')]['sys_id'];_0x37c2c7(_0x49f7bb);})[_0x912d('0x1c')](function(_0x3e5f04){logger[_0x912d('0x12')]('['+[_0xcf3e25[_0x912d('0x11')]()]+']',_0x3e5f04[_0x912d('0x13')]);_0x18565f(_0x3e5f04[_0x912d('0x13')]);});});}function getEndUser(_0x2dd60c,_0x16dbd8,_0x336378,_0x5285c4,_0x40d90e){return function(_0x172c4f){logger[_0x912d('0x10')]('['+[_0x2dd60c[_0x912d('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x172c4f);return new Promise(function(_0x3b7d41,_0x1ba73a){var _0x28c836={'method':_0x912d('0xa'),'uri':_0x336378+'sys_user?sysparm_query=phone%3D'+_0x172c4f[_0x912d('0x21')]+'&'+_0x5285c4+'&'+_0x40d90e,'auth':_0x16dbd8,'json':!![]};return rp(_0x28c836)['then'](function(_0x5cda0e){if(_0x5cda0e[_0x912d('0xc')][_0x912d('0xd')]>0x0){_0x172c4f[_0x912d('0x23')]=_0x5cda0e[_0x912d('0xc')][0x0]['sys_id'];logger[_0x912d('0x10')]('['+[_0x2dd60c[_0x912d('0x11')]()]+_0x912d('0x24'),_0x172c4f);_0x3b7d41(_0x172c4f);}else{return createEndUser(_0x2dd60c,_0x16dbd8,_0x172c4f,_0x336378,_0x5285c4)[_0x912d('0x17')](function(_0x1a5fca){logger[_0x912d('0x10')]('['+[_0x2dd60c[_0x912d('0x11')]()]+_0x912d('0x25'),_0x1a5fca);_0x3b7d41(_0x1a5fca);});}})[_0x912d('0x1c')](function(_0x5998f5){logger[_0x912d('0x12')]('['+[_0x2dd60c['toUpperCase']()]+']',_0x5998f5['message']);_0x1ba73a(_0x5998f5[_0x912d('0x13')]);});});};}function getCustomFields(_0x5e3dfc,_0x3c27cf){var _0x54d3e0={};if(_0x5e3dfc[_0x912d('0xd')]>0x0){_['forEach'](_0x5e3dfc,function(_0xc94f3f){if(_[_0x912d('0x26')](['string',_0x912d('0x27')],_0xc94f3f['type'])&&_0xc94f3f[_0x912d('0x28')]&&!_0xc94f3f[_0x912d('0x29')]){_0x54d3e0[_0xc94f3f[_0x912d('0x28')][_0x912d('0x2a')]()]=_0xc94f3f['content'][_0x912d('0x2b')]();}else if(_[_0x912d('0x26')]([_0x912d('0x2c'),'picklist'],_0xc94f3f['type'])&&_0xc94f3f[_0x912d('0x2d')]&&_0xc94f3f['customField']){_0x54d3e0[_0xc94f3f[_0x912d('0x2d')][_0x912d('0x2a')]()]=_0xc94f3f[_0x912d('0x2e')][_0x912d('0x2b')]();}else if(_0xc94f3f[_0x912d('0x2f')]===_0x912d('0x30')&&_0xc94f3f[_0x912d('0x31')]&&_0xc94f3f['idField']&&_0xc94f3f[_0x912d('0x29')]){_0x54d3e0[_0xc94f3f['idField'][_0x912d('0x2a')]()]=_0x3c27cf[_0xc94f3f[_0x912d('0x31')]][_0x912d('0x2b')]();}else if(_0xc94f3f['type']===_0x912d('0x32')&&_0xc94f3f[_0x912d('0x33')]&&_0xc94f3f[_0x912d('0x33')][_0x912d('0x34')]&&_0xc94f3f[_0x912d('0x2d')]&&_0xc94f3f[_0x912d('0x29')]){_0x54d3e0[_0xc94f3f[_0x912d('0x2d')]['toLowerCase']()]=_0x3c27cf[_0xc94f3f['Variable'][_0x912d('0x34')][_0x912d('0x2a')]()][_0x912d('0x2b')]();}});}return _0x54d3e0;}function getTicket(_0x42ba5f,_0x403bbc,_0x2a7dab,_0x56a245,_0x19ac81,_0x5a1fe4){return function(_0x183c5a){logger[_0x912d('0x10')]('['+[_0x42ba5f[_0x912d('0x11')]()]+_0x912d('0x35'),_0x183c5a);return new Promise(function(_0x2be138,_0x1dbf82){var _0x4b915e=_0x42ba5f['toLowerCase']()===_0x912d('0x36')?_0x183c5a[_0x912d('0x1a')]:_0x183c5a[_0x912d('0x23')];var _0x3cb5f9={'method':_0x912d('0x1e'),'uri':_0x2a7dab+'incident'+'?'+_0x5a1fe4,'body':Object[_0x912d('0x37')]({},{'active':_0x912d('0x38'),'caller_id':_0x4b915e,'assigned_to':_0x183c5a[_0x912d('0x1a')],'short_description':intUtil[_0x912d('0x39')](_0x56a245['Subjects'],_0x19ac81,'\x20'),'description':intUtil[_0x912d('0x39')](_0x56a245[_0x912d('0x3a')],_0x19ac81,'\x0a')},getCustomFields(_0x56a245['Fields'],_0x19ac81)),'auth':_0x403bbc,'json':!![]};return rp(_0x3cb5f9)[_0x912d('0x17')](function(_0x12c0f5){logger[_0x912d('0x10')]('['+[_0x42ba5f['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x12c0f5[_0x912d('0xc')]);_0x183c5a[_0x912d('0x3b')]=_0x12c0f5['result'][_0x912d('0xf')];_0x183c5a[_0x912d('0x3c')]=_0x12c0f5[_0x912d('0xc')][_0x912d('0x3d')];logger[_0x912d('0x10')]('['+[_0x42ba5f[_0x912d('0x11')]()]+_0x912d('0x3e'),_0x183c5a);_0x2be138(_0x183c5a);})[_0x912d('0x1c')](function(_0x9f3c93){logger['error']('['+[_0x42ba5f['toUpperCase']()]+']',_0x9f3c93[_0x912d('0x13')]);_0x1dbf82(_0x9f3c93[_0x912d('0x13')]);});});};}function createRemoteTag(_0x5eaa2e,_0xee6a3d,_0x418b23,_0x10d1bb){return new Promise(function(_0xcd0c3e,_0x380b46){var _0x10cde3={'method':'POST','uri':_0x418b23+'label'+'?'+_0x10d1bb,'body':{'short_description':_0x5eaa2e,'global':!![],'active':!![],'name':_0x5eaa2e},'auth':_0xee6a3d,'json':!![]};return rp(_0x10cde3)[_0x912d('0x17')](function(_0x6fa602){var _0x94399f=_0x6fa602[_0x912d('0xc')][_0x912d('0xf')];_0xcd0c3e(_0x94399f);});});}function getRemoteTag(_0x4e096f,_0x5b840d,_0x150040,_0x5f1b6a,_0x54fd53){return new Promise(function(_0x25a381,_0x4af9e8){var _0x3e533e={'method':_0x912d('0xa'),'uri':_0x150040+_0x912d('0x3f')+_0x912d('0x40')+_0x4e096f+'&'+_0x5f1b6a,'auth':_0x5b840d,'json':!![]};return rp(_0x3e533e)[_0x912d('0x17')](function(_0x5844a3){if(_0x5844a3['result']['length']>0x0){var _0x508eb7=_0x5844a3['result'][0x0]['sys_id'];_0x25a381(_0x508eb7);}else{return createRemoteTag(_0x4e096f,_0x5b840d,_0x150040,_0x5f1b6a)[_0x912d('0x17')](function(_0x118237){_0x25a381(_0x118237);});}});});}function assignTagToIncident(_0x2460f9,_0x27a220,_0x30e55d,_0x185cfa,_0x379154){return new Promise(function(_0x39911a,_0x3c4d39){var _0x24f40b={'method':_0x912d('0x1e'),'uri':_0x30e55d+_0x912d('0x41')+'?'+_0x379154,'body':{'label':_0x2460f9,'table':_0x912d('0x42'),'id_type':_0x912d('0x43'),'table_key':_0x185cfa[_0x912d('0x3b')],'title':'Incident\x20-\x20'+_0x185cfa[_0x912d('0x3c')],'id_display':_0x185cfa['ticketNumber']},'auth':_0x27a220,'json':!![]};return rp(_0x24f40b)[_0x912d('0x17')](function(_0x9857b8){_0x39911a();})['catch'](function(){_0x39911a();});});}function manageTags(_0x80541b,_0xa3ae05,_0x5cf4bf,_0xd6d645,_0x453951,_0x2ad838,_0x20f5a5){return new Promise(function(_0x4cd3cb,_0x3f37db){var _0x54501a=[];_0xa3ae05[_0x912d('0x44')](function(_0x2fa106){_0x54501a[_0x912d('0x45')](getRemoteTag(_0x2fa106,_0x5cf4bf,_0xd6d645,_0x2ad838,_0x20f5a5));});return Promise[_0x912d('0x46')](_0x54501a)[_0x912d('0x17')](function(_0x1f5ca2){if(_0x1f5ca2['length']){logger[_0x912d('0x10')]('['+[_0x80541b[_0x912d('0x11')]()]+_0x912d('0x47'),_0x1f5ca2);var _0x54881f=[];_0x1f5ca2[_0x912d('0x44')](function(_0x1b330c){_0x54881f[_0x912d('0x45')](assignTagToIncident(_0x1b330c,_0x5cf4bf,_0xd6d645,_0x453951,_0x2ad838));});return Promise[_0x912d('0x46')](_0x54881f)[_0x912d('0x17')](function(){_0x4cd3cb();})[_0x912d('0x1c')](function(){_0x4cd3cb();});}else{_0x4cd3cb();}});});}function getTags(_0x565fbe,_0x5b4431,_0xbcba84,_0x35b528,_0x13c79d,_0x13db50){return function(_0x56016a){return new Promise(function(_0x3d97f7,_0x1db4c8){var _0x558d11=[];var _0x154df5=_0x35b528['Tags'];if(_0x154df5&&_0x154df5[_0x912d('0xd')]>0x0){_0x558d11=_['map'](_0x154df5,'name');}if(_0x558d11[_0x912d('0xd')]>0x0){return manageTags(_0x565fbe,_0x558d11,_0x5b4431,_0xbcba84,_0x56016a,_0x13c79d,_0x13db50)[_0x912d('0x17')](function(){_0x3d97f7(_0x56016a);});}else{_0x3d97f7(_0x56016a);}});};}function emit(_0x55b5c8,_0x203cfe,_0xf59740){var _0x3e3e=_0x912d('0x48')+_0x912d('0x49')+_0x912d('0x4a')+'%255EORDERBYDESCnumber';var _0x442ac8={'uri':_0x55b5c8+'/nav_to.do?uri=incident.do?sys_id%3D'+_0xf59740+_0x3e3e};io['to'](util[_0x912d('0x4b')]('user:%s',_0x203cfe))[_0x912d('0x4c')](_0x912d('0x4d'),_0x442ac8);}exports['cs']=function(_0x11ab8e,_0x20a8c3,_0xea00d1,_0x29c427,_0x3d56c9,_0x2a28e4,_0x1a633c,_0x40a108){var _0x12e0fc={};var _0xe468d6={'user':_0x2a28e4['username'],'pass':_0x2a28e4[_0x912d('0x4e')]};var _0x367984=_0x912d('0x4f');var _0x9caa9a=_0x912d('0x50');_0x2a28e4[_0x912d('0x51')]=intUtil[_0x912d('0x52')](_0x2a28e4[_0x912d('0x51')]);_0x2a28e4[_0x912d('0x53')]=intUtil[_0x912d('0x52')](_0x2a28e4['serverUrl']);var _0x26dfa3=util[_0x912d('0x4b')](_0x912d('0x54'),_0x2a28e4[_0x912d('0x51')]);_0x12e0fc[_0x912d('0x15')]=!_['isNil'](_0x29c427)?_0x29c427[_0x912d('0x55')]:null;_0x12e0fc[_0x912d('0x1b')]=_0x2a28e4[_0x912d('0x55')];_0x12e0fc[_0x912d('0x21')]=_0x40a108[_0x912d('0x2a')]()===_0x912d('0x36')?_0x20a8c3[_0x912d('0x56')]:_0x20a8c3['calleridnum'];_0x12e0fc['callDirection']=_0x40a108===_0x912d('0x57')||_0x40a108===_0x912d('0x58')?'queue':_0x912d('0x36');var _0x308e60=util[_0x912d('0x4b')](_0x912d('0x59'),_0x2a28e4['serverUrl'],_0x20a8c3[_0x912d('0x5a')],md5(_0x20a8c3[_0x912d('0x5a')]));if(_0x3d56c9&&_0x3d56c9[_0x912d('0x5b')]){logger['info']('[QUEUE]',_0x912d('0x5c'));_0x20a8c3['recordingURL']=_0x308e60;}else if(_0x1a633c&&_0x1a633c['recordingFormat']&&_0x1a633c[_0x912d('0x5d')]!=='none'){logger['info'](_0x912d('0x5e'),_0x912d('0x5c'));_0x20a8c3[_0x912d('0x5f')]=_0x308e60;}else{_0x20a8c3[_0x912d('0x5f')]='';}return getAdminUser(_0x40a108,_0xe468d6,_0x12e0fc,_0x26dfa3,_0x9caa9a,_0x367984)[_0x912d('0x17')](getUser(_0x40a108,_0xe468d6,_0x26dfa3,_0x9caa9a,_0x367984))[_0x912d('0x17')](getEndUser(_0x40a108,_0xe468d6,_0x26dfa3,_0x9caa9a,_0x367984))[_0x912d('0x17')](getTicket(_0x40a108,_0xe468d6,_0x26dfa3,_0xea00d1,_0x20a8c3,_0x9caa9a))[_0x912d('0x17')](function(_0x33cd85){logger[_0x912d('0x10')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x33cd85[_0x912d('0x3b')]));logger[_0x912d('0x10')](util[_0x912d('0x4b')]('call\x20direction:\x20%s',_0x40a108));if(_0x40a108!==_0x912d('0x58')){logger[_0x912d('0x10')]('['+[_0x40a108[_0x912d('0x11')]()]+']',_0x912d('0x60'));emit(_0x2a28e4[_0x912d('0x51')],_0x29c427['name'],_0x33cd85[_0x912d('0x3b')]);}})[_0x912d('0x1c')](function(_0x28eb30){logger[_0x912d('0x12')]('['+[_0x40a108['toUpperCase']()]+_0x912d('0x61'),util[_0x912d('0x62')](_0x28eb30,{'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 ebe3760..7c29dc2 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 _0xd907=['request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','push','JSON','Calls','format','Basic\x20%s','toString','stringify','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','map','type','nameField','customField','toLowerCase','string','idField','variableName','custom_fields','Variable','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','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...','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','contacts','user:%s','trigger:browser:url','lastevent','toUpperCase','lodash'];(function(_0x44d4e9,_0x52d710){var _0x4c9bd2=function(_0x40fc44){while(--_0x40fc44){_0x44d4e9['push'](_0x44d4e9['shift']());}};_0x4c9bd2(++_0x52d710);}(_0xd907,0x1d3));var _0x7d90=function(_0x33a6bd,_0x564362){_0x33a6bd=_0x33a6bd-0x0;var _0x339aff=_0xd907[_0x33a6bd];return _0x339aff;};'use strict';var _=require(_0x7d90('0x0'));var rp=require(_0x7d90('0x1'));var BPromise=require(_0x7d90('0x2'));var md5=require('md5');var util=require(_0x7d90('0x3'));var Redis=require(_0x7d90('0x4'));var intUtil=require(_0x7d90('0x5'));var config=require(_0x7d90('0x6'));var logger=require(_0x7d90('0x7'))(_0x7d90('0x8'));config[_0x7d90('0x9')]=_[_0x7d90('0xa')](config[_0x7d90('0x9')],{'host':_0x7d90('0xb'),'port':0x18eb});var io=require(_0x7d90('0xc'))(new Redis(config[_0x7d90('0x9')]));var def={'method':_0x7d90('0xd'),'json':!![]};function emit(_0x84f6a2,_0x27c888,_0x360333){io['to'](_0x84f6a2)[_0x7d90('0xe')](_0x27c888,_0x360333);}function getTicket(_0xd19a6f,_0x1d55b9,_0x3b9048,_0x233df3,_0x80eddc,_0x16845e,_0x37f7ac,_0x12d464){logger['info'](_0x7d90('0xf'));var _0x325810=new Date();var _0xeed34b=[{'name':_0x7d90('0x10'),'value':intUtil[_0x7d90('0x11')](_0x233df3['Subjects'],_0x80eddc,'\x20')},{'name':_0x7d90('0x12'),'value':_0x1d55b9['id']},{'name':_0x7d90('0x13'),'value':_0x1d55b9['id']},{'name':_0x7d90('0x14'),'value':intUtil[_0x7d90('0x11')](_0x233df3[_0x7d90('0x15')],_0x80eddc,'\x0a')},{'name':_0x7d90('0x16'),'value':_0x325810[_0x7d90('0x17')]()['slice'](0x0,0x13)[_0x7d90('0x18')]('T','\x20')},{'name':_0x7d90('0x19'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x7d90('0x1a'),'value':_0x3b9048['id']},{'name':_0x7d90('0x1b'),'value':_0x7d90('0x1c')},{'name':_0x7d90('0x1d'),'value':_0x3b9048['name']},{'name':_0x7d90('0x1e'),'value':_0x12d464}];if(_0x16845e[_0x7d90('0x1f')]){_[_0x7d90('0x20')](_0x16845e,function(_0x3204a6){if(_0x80eddc[_0x3204a6['variableName']]){_0xeed34b[_0x7d90('0x21')]({'name':_0x3204a6['idField'],'value':_0x80eddc[_0x3204a6['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':_0x7d90('0x22'),'response_type':_0x7d90('0x22'),'rest_data':JSON['stringify']({'session':_0x37f7ac['id'],'module_name':_0x7d90('0x23'),'name_value_list':_0xeed34b})}});}function getAuth(_0x47bdcb){return util[_0x7d90('0x24')](_0x7d90('0x25'),new Buffer(_0x47bdcb['apiKey']+':X')[_0x7d90('0x26')]('base64'));}function getServerInfo(_0x498984){return request({'form':{'method':'get_server_info','input_type':_0x7d90('0x22'),'response_type':'JSON','rest_data':JSON[_0x7d90('0x27')]({'session':_0x498984['id']})}});}function getUser(_0x4570fb,_0x361692,_0x462612){if(!_[_0x7d90('0x28')](_0x361692)){logger[_0x7d90('0x29')](_0x7d90('0x2a'),_0x361692);return request({'form':{'method':_0x7d90('0x2b'),'input_type':_0x7d90('0x22'),'response_type':_0x7d90('0x22'),'rest_data':JSON[_0x7d90('0x27')]({'session':_0x462612['id'],'module_name':_0x7d90('0x2c'),'query':util[_0x7d90('0x24')](_0x7d90('0x2d'),_0x361692),'order_by':'','offset':'0','select_fields':['id',_0x7d90('0x10'),_0x7d90('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7d90('0x2f')](function(_0x356b1a){if(_0x356b1a['entry_list'][_0x7d90('0x1f')]){var _0x2ab44e=_[_0x7d90('0x30')](_0x356b1a[_0x7d90('0x31')],function(_0x3489b9){return _0x3489b9[_0x7d90('0x32')][_0x7d90('0x2e')][_0x7d90('0x33')]===_0x361692;});if(_0x2ab44e){logger[_0x7d90('0x29')]('Agent\x20found!');return BPromise['resolve']({'id':_0x2ab44e[_0x7d90('0x32')]['id'][_0x7d90('0x33')],'name':_0x2ab44e[_0x7d90('0x32')][_0x7d90('0x10')][_0x7d90('0x33')]});}}logger[_0x7d90('0x29')](_0x7d90('0x34'));return BPromise[_0x7d90('0x35')]({'id':_0x462612[_0x7d90('0x32')][_0x7d90('0x36')]['value'],'name':_0x462612[_0x7d90('0x32')][_0x7d90('0x2e')]['value']});});}else{logger[_0x7d90('0x29')](_0x7d90('0x37'));return BPromise[_0x7d90('0x35')]({'id':_0x462612[_0x7d90('0x32')]['user_id']['value'],'name':_0x462612[_0x7d90('0x32')][_0x7d90('0x2e')][_0x7d90('0x33')]});}}function getEndUser(_0x6c1e41,_0x211ec4,_0x18cc1e,_0x1bf139){logger[_0x7d90('0x29')]('Searching\x20enduser\x20with\x20phone',_0x18cc1e);return request({'form':{'method':_0x7d90('0x2b'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x7d90('0x27')]({'session':_0x1bf139['id'],'module_name':_0x7d90('0x1c'),'query':util[_0x7d90('0x24')](_0x7d90('0x38'),_0x18cc1e),'order_by':'','offset':'0','select_fields':['id',_0x7d90('0x10'),_0x7d90('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7d90('0x2f')](function(_0x6c8b6b){if(_0x6c8b6b[_0x7d90('0x31')][_0x7d90('0x1f')]){var _0xd1ae88=_['find'](_0x6c8b6b['entry_list'],function(_0x3a2d52){return _0x3a2d52[_0x7d90('0x32')][_0x7d90('0x39')][_0x7d90('0x33')]===_0x18cc1e;});if(_0xd1ae88){logger[_0x7d90('0x29')]('Enduser\x20found!');return BPromise['resolve']({'id':_0xd1ae88[_0x7d90('0x32')]['id'][_0x7d90('0x33')],'name':_0xd1ae88[_0x7d90('0x32')]['name'][_0x7d90('0x33')],'phone':_0xd1ae88[_0x7d90('0x32')][_0x7d90('0x39')]['value']});}}else{logger['info'](_0x7d90('0x3a'));return request({'form':{'method':_0x7d90('0x3b'),'input_type':_0x7d90('0x22'),'response_type':_0x7d90('0x22'),'rest_data':JSON[_0x7d90('0x27')]({'session':_0x1bf139['id'],'module_name':_0x7d90('0x1c'),'name_value_list':[{'name':_0x7d90('0x3c'),'value':_0x211ec4!==_0x7d90('0x3d')?_0x211ec4:util['format'](_0x7d90('0x3e'),_0x18cc1e)},{'name':_0x7d90('0x39'),'value':_0x18cc1e}]})}})['then'](function(_0xcf5c56){logger[_0x7d90('0x29')](_0x7d90('0x3f'));return BPromise[_0x7d90('0x35')]({'id':_0xcf5c56['id'],'name':_0xcf5c56[_0x7d90('0x31')][_0x7d90('0x3c')][_0x7d90('0x33')],'phone':_0xcf5c56['entry_list'][_0x7d90('0x39')]['value']});});}});}function request(_0x5ab0c6){logger['debug']('[HTTP]',JSON[_0x7d90('0x27')](_0x5ab0c6));return rp(_['merge'](def,_0x5ab0c6));}function getTags(_0x3220d8,_0x3f3081){var _0x39cdd3=[];if(_0x3220d8&&_0x3220d8[_0x7d90('0x1f')]>0x0){_0x39cdd3=_[_0x7d90('0x40')](_0x3220d8,_0x3f3081);}return _0x39cdd3;}function getCustomFields(_0xad5819,_0x7ddf8d){var _0x1c1a8f=[];var _0x5be654={'custom_fields':[]};if(_0xad5819[_0x7d90('0x1f')]>0x0){_['forEach'](_0xad5819,function(_0x53872a){if(_0x53872a[_0x7d90('0x41')]==='string'&&_0x53872a[_0x7d90('0x42')]&&!_0x53872a[_0x7d90('0x43')]){_0x5be654[_0x53872a['nameField'][_0x7d90('0x44')]()]=_0x53872a['content'][_0x7d90('0x26')]();}else if(_0x53872a[_0x7d90('0x41')]===_0x7d90('0x45')&&_0x53872a['idField']&&_0x53872a[_0x7d90('0x43')]){_0x5be654['custom_fields']['push']({'id':_0x53872a[_0x7d90('0x46')],'value':_0x53872a['content'][_0x7d90('0x26')]()});}else if(_0x53872a['type']==='variable'&&_0x53872a[_0x7d90('0x47')]&&_0x53872a[_0x7d90('0x46')]&&_0x53872a['customField']){_0x7ddf8d[_0x53872a[_0x7d90('0x47')]]&&_0x5be654[_0x7d90('0x48')][_0x7d90('0x21')]({'id':_0x53872a[_0x7d90('0x46')],'value':_0x7ddf8d[_0x53872a['variableName']]['toString']()});}else if(_0x53872a[_0x7d90('0x41')]==='customVariable'&&_0x53872a[_0x7d90('0x49')]&&_0x53872a[_0x7d90('0x49')][_0x7d90('0x10')]&&_0x53872a['idField']&&_0x53872a[_0x7d90('0x43')]){_0x7ddf8d[_0x53872a['Variable'][_0x7d90('0x10')]['toLowerCase']()]&&_0x5be654[_0x7d90('0x48')][_0x7d90('0x21')]({'id':_0x53872a[_0x7d90('0x46')],'value':_0x7ddf8d[_0x53872a[_0x7d90('0x49')][_0x7d90('0x10')][_0x7d90('0x44')]()][_0x7d90('0x26')]()});}});}return _0x5be654;}function getConnection(_0xa0d913){return request({'method':_0x7d90('0xd'),'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0xa0d913['username'],'password':_0xa0d913[_0x7d90('0x4a')],'encryption':_0x7d90('0x4b')},'application':_0x7d90('0x4c')})}})[_0x7d90('0x2f')](function(_0x498563){var _0xf183=_0x498563;if(_0xf183['id']){def['sessionID']=_0xf183['id'];return BPromise[_0x7d90('0x35')](_0xf183);}else{throw new Error(util[_0x7d90('0x24')](_0x7d90('0x4d'),_0xa0d913['id']));}});}function setRelationship(_0x33902d,_0xcce2ce,_0x4321c8,_0x703cee){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0x7d90('0x22'),'rest_data':JSON[_0x7d90('0x27')]({'session':_0x33902d['id'],'module_name':_0x7d90('0x23'),'module_id':_0x4321c8['id'],'link_field_name':_0x703cee,'related_ids':[_0xcce2ce['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x7d90('0x4e')]=function(_0x251f69,_0x9931a6,_0xaab4d4,_0x5050a2,_0x5d8d3a,_0x39b42f){var _0x251f23,_0xa2cc4f,_0x530162,_0x576292;_0x39b42f[_0x7d90('0x4f')]=intUtil['stripTrailingSlash'](_0x39b42f['remoteUri']);_0x39b42f[_0x7d90('0x50')]=intUtil[_0x7d90('0x51')](_0x39b42f[_0x7d90('0x50')]);def[_0x7d90('0x52')]=util['format'](_0x7d90('0x53'),_0x39b42f[_0x7d90('0x4f')]);if(_0x5d8d3a&&_0x5d8d3a[_0x7d90('0x54')]){logger[_0x7d90('0x29')](_0x7d90('0x55'),_0x7d90('0x56'));_0x9931a6[_0x7d90('0x57')]=util[_0x7d90('0x24')](_0x7d90('0x58'),_0x39b42f[_0x7d90('0x50')],_0x9931a6[_0x7d90('0x59')],md5(_0x9931a6['uniqueid']));}else{_0x9931a6['recordingURL']='';}return getConnection(_0x39b42f)[_0x7d90('0x2f')](function(_0x13c0b3){_0x576292=_0x13c0b3;return getUser(_0x39b42f,_0x5050a2['name'],_0x576292);})[_0x7d90('0x2f')](function(_0x1868b3){_0x251f23=_0x1868b3;logger[_0x7d90('0x29')](_0x7d90('0x5a'),_0x251f23['id']);return getEndUser(_0x39b42f,_0x9931a6[_0x7d90('0x5b')],_0x9931a6[_0x7d90('0x5c')],_0x576292);})[_0x7d90('0x2f')](function(_0x734406){_0xa2cc4f=_0x734406;logger[_0x7d90('0x29')](_0x7d90('0x5d'),_0xa2cc4f['id']);return getTicket(_0x39b42f,_0x251f23,_0xa2cc4f,_0xaab4d4,_0x9931a6,_0xaab4d4[_0x7d90('0x5e')],_0x576292,_0x7d90('0x5f'));})[_0x7d90('0x2f')](function(_0x47689a){_0x530162=_0x47689a;logger['info'](_0x7d90('0x60'));logger[_0x7d90('0x29')](_0x7d90('0x61'),_0x530162['id']);return setRelationship(_0x576292,_0x251f23,_0x530162,_0x7d90('0x62'));})[_0x7d90('0x2f')](function(){return setRelationship(_0x576292,_0xa2cc4f,_0x530162,'contacts');})[_0x7d90('0x2f')](function(){return getServerInfo(_0x576292);})['then'](function(_0x3a0272){var _0x10e42e=parseInt(_0x3a0272[_0x7d90('0x63')][_0x7d90('0x64')](0x0));var _0x2726bb=util['format'](_0x7d90('0x65'),_0x39b42f['remoteUri'],_0x530162['id']);if(_0x10e42e>0x6){_0x2726bb=util[_0x7d90('0x24')](_0x7d90('0x66'),_0x39b42f[_0x7d90('0x4f')],_0x530162['id']);}logger[_0x7d90('0x29')](_0x7d90('0x55'),_0x7d90('0x67'));emit(util['format']('user:%s',_0x5050a2[_0x7d90('0x10')]),'trigger:browser:url',{'uri':_0x2726bb});})[_0x7d90('0x68')](function(_0x58ace4){logger[_0x7d90('0x69')](_0x7d90('0x55'),JSON[_0x7d90('0x27')](_0x58ace4));});};exports['outbound']=function(_0x181ed8,_0x3741c4,_0x18a5bd,_0x55aecd,_0x224ec8,_0x9dfca8,_0x108c6e){var _0x36cb12,_0x2d76ee,_0x150a01,_0x7e25d1;_0x9dfca8[_0x7d90('0x4f')]=intUtil[_0x7d90('0x51')](_0x9dfca8['remoteUri']);_0x9dfca8['serverUrl']=intUtil[_0x7d90('0x51')](_0x9dfca8[_0x7d90('0x50')]);def[_0x7d90('0x52')]=util['format'](_0x7d90('0x53'),_0x9dfca8[_0x7d90('0x4f')]);if(_0x108c6e&&_0x108c6e['recordingFormat']&&_0x108c6e[_0x7d90('0x6a')]!==_0x7d90('0x6b')){logger[_0x7d90('0x29')](_0x7d90('0x6c'),_0x7d90('0x56'));_0x3741c4[_0x7d90('0x57')]=util[_0x7d90('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x9dfca8[_0x7d90('0x50')],_0x3741c4[_0x7d90('0x59')],md5(_0x3741c4[_0x7d90('0x59')]));}return getConnection(_0x9dfca8)[_0x7d90('0x2f')](function(_0x3f3415){_0x7e25d1=_0x3f3415;return getUser(_0x9dfca8,_0x55aecd[_0x7d90('0x10')],_0x7e25d1);})[_0x7d90('0x2f')](function(_0x29430d){_0x36cb12=_0x29430d;logger[_0x7d90('0x29')](_0x7d90('0x5a'),_0x36cb12['id']);return getEndUser(_0x9dfca8,_0x3741c4[_0x7d90('0x6d')],_0x3741c4[_0x7d90('0x6e')],_0x7e25d1);})[_0x7d90('0x2f')](function(_0x37d02f){_0x2d76ee=_0x37d02f;logger[_0x7d90('0x29')]('The\x20Enduser\x20ID\x20is:',_0x2d76ee['id']);return getTicket(_0x9dfca8,_0x36cb12,_0x2d76ee,_0x18a5bd,_0x3741c4,_0x18a5bd[_0x7d90('0x5e')],_0x7e25d1,_0x7d90('0x6f'));})[_0x7d90('0x2f')](function(_0x3afbbf){_0x150a01=_0x3afbbf;logger['info']('Ticket\x20created!');logger[_0x7d90('0x29')](_0x7d90('0x61'),_0x150a01['id']);return setRelationship(_0x7e25d1,_0x36cb12,_0x150a01,_0x7d90('0x62'));})[_0x7d90('0x2f')](function(){return setRelationship(_0x7e25d1,_0x2d76ee,_0x150a01,_0x7d90('0x70'));})[_0x7d90('0x2f')](function(){return getServerInfo(_0x7e25d1);})[_0x7d90('0x2f')](function(_0x4413b3){var _0xa7d54f=parseInt(_0x4413b3['version'][_0x7d90('0x64')](0x0));var _0x1b3755=util[_0x7d90('0x24')](_0x7d90('0x65'),_0x9dfca8[_0x7d90('0x4f')],_0x150a01['id']);if(_0xa7d54f>0x6){_0x1b3755=util[_0x7d90('0x24')](_0x7d90('0x66'),_0x9dfca8[_0x7d90('0x4f')],_0x150a01['id']);}logger[_0x7d90('0x29')](_0x7d90('0x6c'),_0x7d90('0x67'));emit(util[_0x7d90('0x24')](_0x7d90('0x71'),_0x55aecd[_0x7d90('0x10')]),_0x7d90('0x72'),{'uri':_0x1b3755});})[_0x7d90('0x68')](function(_0x34b9c7){logger[_0x7d90('0x69')](_0x7d90('0x6c'),JSON[_0x7d90('0x27')](_0x34b9c7));});};exports['unmanaged']=function(_0x551db2,_0x2fb89f,_0x3f7b4c,_0x84b99,_0x58eac6,_0x233e7d){var _0x2dc87f,_0x2c2f3d,_0x1b4a71,_0x305fb4;_0x233e7d[_0x7d90('0x4f')]=intUtil[_0x7d90('0x51')](_0x233e7d[_0x7d90('0x4f')]);_0x233e7d['serverUrl']=intUtil[_0x7d90('0x51')](_0x233e7d[_0x7d90('0x50')]);def[_0x7d90('0x52')]=util[_0x7d90('0x24')](_0x7d90('0x53'),_0x233e7d[_0x7d90('0x4f')]);if(_0x58eac6&&_0x58eac6[_0x7d90('0x54')]){logger['info']('['+_0x2fb89f[_0x7d90('0x73')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x2fb89f[_0x7d90('0x57')]=util['format'](_0x7d90('0x58'),_0x233e7d[_0x7d90('0x50')],_0x2fb89f['uniqueid'],md5(_0x2fb89f[_0x7d90('0x59')]));}else{_0x2fb89f['recordingURL']='';}return getConnection(_0x233e7d)['then'](function(_0x76d748){_0x305fb4=_0x76d748;if(!_[_0x7d90('0x28')](_0x84b99)){return getUser(_0x233e7d,_0x84b99['name'],_0x305fb4);}else{return getUser(_0x233e7d,null,_0x305fb4);}})[_0x7d90('0x2f')](function(_0x765fb3){_0x2dc87f=_0x765fb3;logger['info'](_0x7d90('0x5a'),_0x2dc87f['id']);return getEndUser(_0x233e7d,_0x2fb89f['calleridname'],_0x2fb89f[_0x7d90('0x5c')],_0x305fb4);})[_0x7d90('0x2f')](function(_0x5ed160){_0x2c2f3d=_0x5ed160;logger[_0x7d90('0x29')](_0x7d90('0x5d'),_0x2c2f3d['id']);return getTicket(_0x233e7d,_0x2dc87f,_0x2c2f3d,_0x3f7b4c,_0x2fb89f,_0x3f7b4c[_0x7d90('0x5e')],_0x305fb4,_0x7d90('0x5f'));})['then'](function(_0x151223){_0x1b4a71=_0x151223;logger['info'](_0x7d90('0x60'));logger['info'](_0x7d90('0x61'),_0x1b4a71['id']);return setRelationship(_0x305fb4,_0x2dc87f,_0x1b4a71,_0x7d90('0x62'));})[_0x7d90('0x2f')](function(){return setRelationship(_0x305fb4,_0x2c2f3d,_0x1b4a71,_0x7d90('0x70'));})[_0x7d90('0x2f')](function(){return getServerInfo(_0x305fb4);})['catch'](function(_0x49699e){logger['error']('['+_0x2fb89f[_0x7d90('0x73')][_0x7d90('0x74')]()+']',JSON[_0x7d90('0x27')](_0x49699e));});}; \ No newline at end of file +var _0xf8af=['sessionID','Account\x20%d\x20is\x20not\x20valid','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','uniqueid','recordingURL','calleridnum','Fields','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','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','contacts','[OUTBOUND]','unmanaged','uri','toUpperCase','The\x20User\x20ID\x20is:','calleridname','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','assigned_user_id','created_by','getString','Descriptions','date_start','slice','replace','duration_minutes','parent_id','parent_type','parent_name','name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','format','Basic\x20%s','toString','base64','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','type','string','nameField','customField','content','variable','custom_fields','Variable','toLowerCase','login','password','PLAIN'];(function(_0x47038d,_0x15ecdb){var _0x2dc9b9=function(_0x1d6284){while(--_0x1d6284){_0x47038d['push'](_0x47038d['shift']());}};_0x2dc9b9(++_0x15ecdb);}(_0xf8af,0x121));var _0xff8a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf8af[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xff8a('0x0'));var rp=require(_0xff8a('0x1'));var BPromise=require('bluebird');var md5=require(_0xff8a('0x2'));var util=require(_0xff8a('0x3'));var Redis=require('ioredis');var intUtil=require(_0xff8a('0x4'));var config=require(_0xff8a('0x5'));var logger=require(_0xff8a('0x6'))(_0xff8a('0x7'));config[_0xff8a('0x8')]=_[_0xff8a('0x9')](config[_0xff8a('0x8')],{'host':_0xff8a('0xa'),'port':0x18eb});var io=require(_0xff8a('0xb'))(new Redis(config[_0xff8a('0x8')]));var def={'method':_0xff8a('0xc'),'json':!![]};function emit(_0x369e66,_0xc26e5c,_0x443e8d){io['to'](_0x369e66)[_0xff8a('0xd')](_0xc26e5c,_0x443e8d);}function getTicket(_0x35f5da,_0x335daa,_0xb53443,_0x5dcdac,_0x4a275f,_0x3ac44b,_0x40654c,_0x2c63b1){logger['info']('Creating\x20new\x20ticket...');var _0x365585=new Date();var _0x297325=[{'name':'name','value':intUtil['getString'](_0x5dcdac['Subjects'],_0x4a275f,'\x20')},{'name':_0xff8a('0xe'),'value':_0x335daa['id']},{'name':_0xff8a('0xf'),'value':_0x335daa['id']},{'name':'description','value':intUtil[_0xff8a('0x10')](_0x5dcdac[_0xff8a('0x11')],_0x4a275f,'\x0a')},{'name':_0xff8a('0x12'),'value':_0x365585['toISOString']()[_0xff8a('0x13')](0x0,0x13)[_0xff8a('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xff8a('0x15'),'value':'15'},{'name':_0xff8a('0x16'),'value':_0xb53443['id']},{'name':_0xff8a('0x17'),'value':'Contacts'},{'name':_0xff8a('0x18'),'value':_0xb53443[_0xff8a('0x19')]},{'name':_0xff8a('0x1a'),'value':_0x2c63b1}];if(_0x3ac44b[_0xff8a('0x1b')]){_[_0xff8a('0x1c')](_0x3ac44b,function(_0xfcac5f){if(_0x4a275f[_0xfcac5f[_0xff8a('0x1d')]]){_0x297325[_0xff8a('0x1e')]({'name':_0xfcac5f[_0xff8a('0x1f')],'value':_0x4a275f[_0xfcac5f[_0xff8a('0x1d')]]});}});}return request({'form':{'method':_0xff8a('0x20'),'input_type':_0xff8a('0x21'),'response_type':_0xff8a('0x21'),'rest_data':JSON[_0xff8a('0x22')]({'session':_0x40654c['id'],'module_name':'Calls','name_value_list':_0x297325})}});}function getAuth(_0x3c6d87){return util[_0xff8a('0x23')](_0xff8a('0x24'),new Buffer(_0x3c6d87['apiKey']+':X')[_0xff8a('0x25')](_0xff8a('0x26')));}function getServerInfo(_0x5b879c){return request({'form':{'method':_0xff8a('0x27'),'input_type':'JSON','response_type':_0xff8a('0x21'),'rest_data':JSON[_0xff8a('0x22')]({'session':_0x5b879c['id']})}});}function getUser(_0x5895fc,_0x145f69,_0x231f26){if(!_[_0xff8a('0x28')](_0x145f69)){logger[_0xff8a('0x29')](_0xff8a('0x2a'),_0x145f69);return request({'form':{'method':_0xff8a('0x2b'),'input_type':_0xff8a('0x21'),'response_type':_0xff8a('0x21'),'rest_data':JSON[_0xff8a('0x22')]({'session':_0x231f26['id'],'module_name':_0xff8a('0x2c'),'query':util[_0xff8a('0x23')](_0xff8a('0x2d'),_0x145f69),'order_by':'','offset':'0','select_fields':['id',_0xff8a('0x19'),_0xff8a('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xff8a('0x2f')](function(_0x38f6d9){if(_0x38f6d9[_0xff8a('0x30')][_0xff8a('0x1b')]){var _0x32b2f3=_[_0xff8a('0x31')](_0x38f6d9['entry_list'],function(_0x2d5925){return _0x2d5925[_0xff8a('0x32')]['user_name'][_0xff8a('0x33')]===_0x145f69;});if(_0x32b2f3){logger[_0xff8a('0x29')](_0xff8a('0x34'));return BPromise[_0xff8a('0x35')]({'id':_0x32b2f3[_0xff8a('0x32')]['id']['value'],'name':_0x32b2f3['name_value_list'][_0xff8a('0x19')]['value']});}}logger[_0xff8a('0x29')](_0xff8a('0x36'));return BPromise[_0xff8a('0x35')]({'id':_0x231f26[_0xff8a('0x32')][_0xff8a('0x37')]['value'],'name':_0x231f26['name_value_list']['user_name']['value']});});}else{logger[_0xff8a('0x29')](_0xff8a('0x38'));return BPromise['resolve']({'id':_0x231f26[_0xff8a('0x32')][_0xff8a('0x37')][_0xff8a('0x33')],'name':_0x231f26[_0xff8a('0x32')][_0xff8a('0x2e')]['value']});}}function getEndUser(_0x568748,_0x5cebf0,_0x5d58cd,_0x357d0d){logger['info'](_0xff8a('0x39'),_0x5d58cd);return request({'form':{'method':_0xff8a('0x2b'),'input_type':_0xff8a('0x21'),'response_type':_0xff8a('0x21'),'rest_data':JSON['stringify']({'session':_0x357d0d['id'],'module_name':_0xff8a('0x3a'),'query':util[_0xff8a('0x23')](_0xff8a('0x3b'),_0x5d58cd),'order_by':'','offset':'0','select_fields':['id',_0xff8a('0x19'),_0xff8a('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x49bc92){if(_0x49bc92[_0xff8a('0x30')][_0xff8a('0x1b')]){var _0x5aea0a=_[_0xff8a('0x31')](_0x49bc92[_0xff8a('0x30')],function(_0x1cce14){return _0x1cce14[_0xff8a('0x32')][_0xff8a('0x3c')][_0xff8a('0x33')]===_0x5d58cd;});if(_0x5aea0a){logger[_0xff8a('0x29')](_0xff8a('0x3d'));return BPromise[_0xff8a('0x35')]({'id':_0x5aea0a[_0xff8a('0x32')]['id'][_0xff8a('0x33')],'name':_0x5aea0a[_0xff8a('0x32')]['name'][_0xff8a('0x33')],'phone':_0x5aea0a[_0xff8a('0x32')]['phone_home'][_0xff8a('0x33')]});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xff8a('0x20'),'input_type':_0xff8a('0x21'),'response_type':_0xff8a('0x21'),'rest_data':JSON[_0xff8a('0x22')]({'session':_0x357d0d['id'],'module_name':_0xff8a('0x3a'),'name_value_list':[{'name':_0xff8a('0x3e'),'value':_0x5cebf0!==''?_0x5cebf0:util[_0xff8a('0x23')](_0xff8a('0x3f'),_0x5d58cd)},{'name':_0xff8a('0x3c'),'value':_0x5d58cd}]})}})[_0xff8a('0x2f')](function(_0x5cc545){logger['info'](_0xff8a('0x40'));return BPromise[_0xff8a('0x35')]({'id':_0x5cc545['id'],'name':_0x5cc545['entry_list'][_0xff8a('0x3e')]['value'],'phone':_0x5cc545['entry_list'][_0xff8a('0x3c')]['value']});});}});}function request(_0x1314ff){logger[_0xff8a('0x41')]('[HTTP]',JSON[_0xff8a('0x22')](_0x1314ff));return rp(_[_0xff8a('0x42')](def,_0x1314ff));}function getTags(_0x194fea,_0x42c5e5){var _0x4120fd=[];if(_0x194fea&&_0x194fea[_0xff8a('0x1b')]>0x0){_0x4120fd=_[_0xff8a('0x43')](_0x194fea,_0x42c5e5);}return _0x4120fd;}function getCustomFields(_0x4e2753,_0x19e555){var _0x4e28e4=[];var _0x5b75a1={'custom_fields':[]};if(_0x4e2753['length']>0x0){_[_0xff8a('0x1c')](_0x4e2753,function(_0x222edd){if(_0x222edd[_0xff8a('0x44')]===_0xff8a('0x45')&&_0x222edd[_0xff8a('0x46')]&&!_0x222edd[_0xff8a('0x47')]){_0x5b75a1[_0x222edd[_0xff8a('0x46')]['toLowerCase']()]=_0x222edd[_0xff8a('0x48')][_0xff8a('0x25')]();}else if(_0x222edd[_0xff8a('0x44')]===_0xff8a('0x45')&&_0x222edd['idField']&&_0x222edd[_0xff8a('0x47')]){_0x5b75a1['custom_fields'][_0xff8a('0x1e')]({'id':_0x222edd[_0xff8a('0x1f')],'value':_0x222edd[_0xff8a('0x48')][_0xff8a('0x25')]()});}else if(_0x222edd[_0xff8a('0x44')]===_0xff8a('0x49')&&_0x222edd[_0xff8a('0x1d')]&&_0x222edd[_0xff8a('0x1f')]&&_0x222edd['customField']){_0x19e555[_0x222edd[_0xff8a('0x1d')]]&&_0x5b75a1[_0xff8a('0x4a')]['push']({'id':_0x222edd['idField'],'value':_0x19e555[_0x222edd[_0xff8a('0x1d')]][_0xff8a('0x25')]()});}else if(_0x222edd[_0xff8a('0x44')]==='customVariable'&&_0x222edd[_0xff8a('0x4b')]&&_0x222edd[_0xff8a('0x4b')]['name']&&_0x222edd[_0xff8a('0x1f')]&&_0x222edd[_0xff8a('0x47')]){_0x19e555[_0x222edd[_0xff8a('0x4b')]['name'][_0xff8a('0x4c')]()]&&_0x5b75a1['custom_fields'][_0xff8a('0x1e')]({'id':_0x222edd[_0xff8a('0x1f')],'value':_0x19e555[_0x222edd['Variable'][_0xff8a('0x19')][_0xff8a('0x4c')]()][_0xff8a('0x25')]()});}});}return _0x5b75a1;}function getConnection(_0xa78dd6){return request({'method':'POST','form':{'method':_0xff8a('0x4d'),'input_type':_0xff8a('0x21'),'response_type':'JSON','rest_data':JSON[_0xff8a('0x22')]({'user_auth':{'user_name':_0xa78dd6['username'],'password':_0xa78dd6[_0xff8a('0x4e')],'encryption':_0xff8a('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xff8a('0x2f')](function(_0x2244fb){var _0x5cd4d3=_0x2244fb;if(_0x5cd4d3['id']){def[_0xff8a('0x50')]=_0x5cd4d3['id'];return BPromise['resolve'](_0x5cd4d3);}else{throw new Error(util[_0xff8a('0x23')](_0xff8a('0x51'),_0xa78dd6['id']));}});}function setRelationship(_0x4da50c,_0x22d7b9,_0x281406,_0x5c769f){return request({'form':{'method':'set_relationship','input_type':_0xff8a('0x21'),'response_type':_0xff8a('0x21'),'rest_data':JSON['stringify']({'session':_0x4da50c['id'],'module_name':_0xff8a('0x52'),'module_id':_0x281406['id'],'link_field_name':_0x5c769f,'related_ids':[_0x22d7b9['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xff8a('0x53')]=function(_0x2cdc7c,_0x25fd91,_0x1a1c4c,_0x6080f7,_0x1c93cb,_0x3a1ffc){var _0x4d7ba1,_0x1e651a,_0xc3baa1,_0x572831;_0x3a1ffc[_0xff8a('0x54')]=intUtil[_0xff8a('0x55')](_0x3a1ffc['remoteUri']);_0x3a1ffc[_0xff8a('0x56')]=intUtil['stripTrailingSlash'](_0x3a1ffc['serverUrl']);def['uri']=util[_0xff8a('0x23')](_0xff8a('0x57'),_0x3a1ffc[_0xff8a('0x54')]);if(_0x1c93cb&&_0x1c93cb[_0xff8a('0x58')]){logger[_0xff8a('0x29')]('[QUEUE]',_0xff8a('0x59'));_0x25fd91['recordingURL']=util[_0xff8a('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3a1ffc['serverUrl'],_0x25fd91[_0xff8a('0x5a')],md5(_0x25fd91[_0xff8a('0x5a')]));}else{_0x25fd91[_0xff8a('0x5b')]='';}return getConnection(_0x3a1ffc)['then'](function(_0x25ec16){_0x572831=_0x25ec16;return getUser(_0x3a1ffc,_0x6080f7[_0xff8a('0x19')],_0x572831);})[_0xff8a('0x2f')](function(_0x44f9bf){_0x4d7ba1=_0x44f9bf;logger[_0xff8a('0x29')]('The\x20User\x20ID\x20is:',_0x4d7ba1['id']);return getEndUser(_0x3a1ffc,_0x25fd91['calleridname'],_0x25fd91[_0xff8a('0x5c')],_0x572831);})[_0xff8a('0x2f')](function(_0x3d2894){_0x1e651a=_0x3d2894;logger['info']('The\x20Enduser\x20ID\x20is:',_0x1e651a['id']);return getTicket(_0x3a1ffc,_0x4d7ba1,_0x1e651a,_0x1a1c4c,_0x25fd91,_0x1a1c4c[_0xff8a('0x5d')],_0x572831,_0xff8a('0x5e'));})['then'](function(_0x566e7d){_0xc3baa1=_0x566e7d;logger['info'](_0xff8a('0x5f'));logger['info'](_0xff8a('0x60'),_0xc3baa1['id']);return setRelationship(_0x572831,_0x4d7ba1,_0xc3baa1,_0xff8a('0x61'));})[_0xff8a('0x2f')](function(){return setRelationship(_0x572831,_0x1e651a,_0xc3baa1,'contacts');})['then'](function(){return getServerInfo(_0x572831);})['then'](function(_0x2fdf90){var _0x1df524=parseInt(_0x2fdf90[_0xff8a('0x62')][_0xff8a('0x63')](0x0));var _0x35cc48=util[_0xff8a('0x23')](_0xff8a('0x64'),_0x3a1ffc[_0xff8a('0x54')],_0xc3baa1['id']);if(_0x1df524>0x6){_0x35cc48=util[_0xff8a('0x23')](_0xff8a('0x65'),_0x3a1ffc['remoteUri'],_0xc3baa1['id']);}logger[_0xff8a('0x29')](_0xff8a('0x66'),_0xff8a('0x67'));emit(util[_0xff8a('0x23')](_0xff8a('0x68'),_0x6080f7['name']),_0xff8a('0x69'),{'uri':_0x35cc48});})[_0xff8a('0x6a')](function(_0x56377f){logger[_0xff8a('0x6b')](_0xff8a('0x66'),JSON['stringify'](_0x56377f));});};exports[_0xff8a('0x6c')]=function(_0x232d22,_0x1802ba,_0x19eb92,_0xaa8d6f,_0x5eb844,_0x7df935,_0x4b0f8c){var _0x4453d2,_0x5cc0dc,_0x5e91d6,_0x2d36b1;_0x7df935[_0xff8a('0x54')]=intUtil[_0xff8a('0x55')](_0x7df935['remoteUri']);_0x7df935[_0xff8a('0x56')]=intUtil['stripTrailingSlash'](_0x7df935['serverUrl']);def['uri']=util[_0xff8a('0x23')](_0xff8a('0x57'),_0x7df935[_0xff8a('0x54')]);if(_0x4b0f8c&&_0x4b0f8c[_0xff8a('0x6d')]&&_0x4b0f8c[_0xff8a('0x6d')]!==_0xff8a('0x6e')){logger[_0xff8a('0x29')]('[OUTBOUND]',_0xff8a('0x59'));_0x1802ba[_0xff8a('0x5b')]=util[_0xff8a('0x23')](_0xff8a('0x6f'),_0x7df935[_0xff8a('0x56')],_0x1802ba['uniqueid'],md5(_0x1802ba[_0xff8a('0x5a')]));}return getConnection(_0x7df935)['then'](function(_0x211673){_0x2d36b1=_0x211673;return getUser(_0x7df935,_0xaa8d6f['name'],_0x2d36b1);})[_0xff8a('0x2f')](function(_0xb06832){_0x4453d2=_0xb06832;logger[_0xff8a('0x29')]('The\x20User\x20ID\x20is:',_0x4453d2['id']);return getEndUser(_0x7df935,_0x1802ba[_0xff8a('0x70')],_0x1802ba[_0xff8a('0x71')],_0x2d36b1);})[_0xff8a('0x2f')](function(_0x4f2a67){_0x5cc0dc=_0x4f2a67;logger[_0xff8a('0x29')](_0xff8a('0x72'),_0x5cc0dc['id']);return getTicket(_0x7df935,_0x4453d2,_0x5cc0dc,_0x19eb92,_0x1802ba,_0x19eb92[_0xff8a('0x5d')],_0x2d36b1,_0xff8a('0x73'));})['then'](function(_0x1505a4){_0x5e91d6=_0x1505a4;logger[_0xff8a('0x29')]('Ticket\x20created!');logger[_0xff8a('0x29')](_0xff8a('0x60'),_0x5e91d6['id']);return setRelationship(_0x2d36b1,_0x4453d2,_0x5e91d6,'users');})[_0xff8a('0x2f')](function(){return setRelationship(_0x2d36b1,_0x5cc0dc,_0x5e91d6,_0xff8a('0x74'));})[_0xff8a('0x2f')](function(){return getServerInfo(_0x2d36b1);})[_0xff8a('0x2f')](function(_0x41acd7){var _0xc224d0=parseInt(_0x41acd7[_0xff8a('0x62')]['charAt'](0x0));var _0x41f06b=util[_0xff8a('0x23')](_0xff8a('0x64'),_0x7df935[_0xff8a('0x54')],_0x5e91d6['id']);if(_0xc224d0>0x6){_0x41f06b=util[_0xff8a('0x23')](_0xff8a('0x65'),_0x7df935['remoteUri'],_0x5e91d6['id']);}logger[_0xff8a('0x29')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0xaa8d6f['name']),'trigger:browser:url',{'uri':_0x41f06b});})[_0xff8a('0x6a')](function(_0x67ad5c){logger[_0xff8a('0x6b')](_0xff8a('0x75'),JSON[_0xff8a('0x22')](_0x67ad5c));});};exports[_0xff8a('0x76')]=function(_0x5f0229,_0x54ebe0,_0x1807a9,_0x4557dd,_0x281a9e,_0x578080){var _0x2a63c6,_0x461f22,_0x407aa0,_0x2faebe;_0x578080[_0xff8a('0x54')]=intUtil[_0xff8a('0x55')](_0x578080['remoteUri']);_0x578080[_0xff8a('0x56')]=intUtil['stripTrailingSlash'](_0x578080[_0xff8a('0x56')]);def[_0xff8a('0x77')]=util['format'](_0xff8a('0x57'),_0x578080[_0xff8a('0x54')]);if(_0x281a9e&&_0x281a9e[_0xff8a('0x58')]){logger[_0xff8a('0x29')]('['+_0x54ebe0['lastevent'][_0xff8a('0x78')]()+']',_0xff8a('0x59'));_0x54ebe0[_0xff8a('0x5b')]=util[_0xff8a('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x578080[_0xff8a('0x56')],_0x54ebe0[_0xff8a('0x5a')],md5(_0x54ebe0['uniqueid']));}else{_0x54ebe0[_0xff8a('0x5b')]='';}return getConnection(_0x578080)[_0xff8a('0x2f')](function(_0x127fd0){_0x2faebe=_0x127fd0;if(!_[_0xff8a('0x28')](_0x4557dd)){return getUser(_0x578080,_0x4557dd[_0xff8a('0x19')],_0x2faebe);}else{return getUser(_0x578080,null,_0x2faebe);}})[_0xff8a('0x2f')](function(_0x31ddd2){_0x2a63c6=_0x31ddd2;logger[_0xff8a('0x29')](_0xff8a('0x79'),_0x2a63c6['id']);return getEndUser(_0x578080,_0x54ebe0[_0xff8a('0x7a')],_0x54ebe0[_0xff8a('0x5c')],_0x2faebe);})[_0xff8a('0x2f')](function(_0x5d17d3){_0x461f22=_0x5d17d3;logger[_0xff8a('0x29')](_0xff8a('0x72'),_0x461f22['id']);return getTicket(_0x578080,_0x2a63c6,_0x461f22,_0x1807a9,_0x54ebe0,_0x1807a9[_0xff8a('0x5d')],_0x2faebe,_0xff8a('0x5e'));})['then'](function(_0x2c8dc4){_0x407aa0=_0x2c8dc4;logger['info'](_0xff8a('0x5f'));logger[_0xff8a('0x29')](_0xff8a('0x60'),_0x407aa0['id']);return setRelationship(_0x2faebe,_0x2a63c6,_0x407aa0,_0xff8a('0x61'));})[_0xff8a('0x2f')](function(){return setRelationship(_0x2faebe,_0x461f22,_0x407aa0,'contacts');})[_0xff8a('0x2f')](function(){return getServerInfo(_0x2faebe);})[_0xff8a('0x6a')](function(_0x2beec1){logger['error']('['+_0x54ebe0['lastevent']['toUpperCase']()+']',JSON[_0xff8a('0x22')](_0x2beec1));});}; \ 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 e307f15..c3144f8 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 _0x791c=['sortBy','type','string','push','variableName','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','keyContent','%s:\x20%s','join','stripTrailingSlash','substring','lastIndexOf','isNil','test','lodash','util','getString'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x791c,0x1c5));var _0xc791=function(_0x596c43,_0x28647a){_0x596c43=_0x596c43-0x0;var _0x4e1315=_0x791c[_0x596c43];return _0x4e1315;};'use strict';var _=require(_0xc791('0x0'));var util=require(_0xc791('0x1'));exports[_0xc791('0x2')]=function(_0x3a6f7b,_0x4f9cc2,_0xc120a0){var _0x4d657b=[];if(_0x3a6f7b['length']>0x0){var _0x14a47f=_[_0xc791('0x3')](_0x3a6f7b,['id']);for(var _0x364ab1=0x0;_0x364ab1<_0x14a47f['length'];_0x364ab1++){var _0x443644=_0x14a47f[_0x364ab1];if(_0x443644[_0xc791('0x4')]===_0xc791('0x5')){_0x4d657b[_0xc791('0x6')](_0x443644['content']);}else if(_0x443644[_0xc791('0x4')]==='variable'&&_0x443644['variableName']){_0x4f9cc2[_0x443644[_0xc791('0x7')]]&&_0x4d657b[_0xc791('0x6')](_0x4f9cc2[_0x443644[_0xc791('0x7')]]['toString']());}else if(_0x443644[_0xc791('0x4')]===_0xc791('0x8')&&_0x443644[_0xc791('0x9')]&&_0x443644[_0xc791('0x9')][_0xc791('0xa')]){_0x4f9cc2[_0x443644[_0xc791('0x9')][_0xc791('0xa')][_0xc791('0xb')]()]&&_0x4d657b[_0xc791('0x6')](_0x4f9cc2[_0x443644[_0xc791('0x9')][_0xc791('0xa')][_0xc791('0xb')]()]['toString']());}else if(_0x443644['type']===_0xc791('0xc')){if(_0x443644[_0xc791('0xd')]==='string'&&_0x443644[_0xc791('0xe')]){_0x4d657b[_0xc791('0x6')](util[_0xc791('0xf')]('%s:\x20%s',_0x443644[_0xc791('0xe')],_0x443644[_0xc791('0x10')]));}else if(_0x443644[_0xc791('0xd')]==='variable'&&_0x443644[_0xc791('0x7')]&&_0x443644[_0xc791('0xe')]){_0x4f9cc2[_0x443644[_0xc791('0x7')]]&&_0x4d657b[_0xc791('0x6')](util[_0xc791('0xf')](_0xc791('0x11'),_0x443644[_0xc791('0xe')],_0x4f9cc2[_0x443644['variableName']]));}else if(_0x443644['keyType']==='customVariable'&&_0x443644[_0xc791('0x9')]&&_0x443644[_0xc791('0x9')][_0xc791('0xa')]&&_0x443644[_0xc791('0xe')]){_0x4f9cc2[_0x443644[_0xc791('0x9')][_0xc791('0xa')]['toLowerCase']()]&&_0x4d657b[_0xc791('0x6')](util['format']('%s:\x20%s',_0x443644[_0xc791('0xe')],_0x4f9cc2[_0x443644[_0xc791('0x9')]['name'][_0xc791('0xb')]()]));}}}}return _0x4d657b[_0xc791('0x12')](_0xc120a0);};exports[_0xc791('0x13')]=function(_0x222f3a){var _0xa3251e=_0x222f3a['slice'](-0x1);if(_0xa3251e==='/'){_0x222f3a=_0x222f3a[_0xc791('0x14')](0x0,_0x222f3a[_0xc791('0x15')](_0xa3251e));}return _0x222f3a;};exports['validateEmail']=function(_0x238ec2){if(!_[_0xc791('0x16')](_0x238ec2)&&_0x238ec2!==''){var _0x58f888=/^(([^<>()\[\]\\.,;:\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 _0x58f888[_0xc791('0x17')](String(_0x238ec2)[_0xc791('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x94f2=['type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','customVariable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','sortBy','length'];(function(_0xb5c716,_0x161a04){var _0x9cbd73=function(_0x27df8a){while(--_0x27df8a){_0xb5c716['push'](_0xb5c716['shift']());}};_0x9cbd73(++_0x161a04);}(_0x94f2,0x177));var _0x294f=function(_0x2ab92c,_0x59023c){_0x2ab92c=_0x2ab92c-0x0;var _0x108614=_0x94f2[_0x2ab92c];return _0x108614;};'use strict';var _=require(_0x294f('0x0'));var util=require('util');exports['getString']=function(_0x493d77,_0x44ba9b,_0x23c5aa){var _0x54f3ff=[];if(_0x493d77['length']>0x0){var _0x387c78=_[_0x294f('0x1')](_0x493d77,['id']);for(var _0x3020f8=0x0;_0x3020f8<_0x387c78[_0x294f('0x2')];_0x3020f8++){var _0x314228=_0x387c78[_0x3020f8];if(_0x314228[_0x294f('0x3')]===_0x294f('0x4')){_0x54f3ff[_0x294f('0x5')](_0x314228[_0x294f('0x6')]);}else if(_0x314228[_0x294f('0x3')]===_0x294f('0x7')&&_0x314228['variableName']){_0x44ba9b[_0x314228[_0x294f('0x8')]]&&_0x54f3ff['push'](_0x44ba9b[_0x314228[_0x294f('0x8')]][_0x294f('0x9')]());}else if(_0x314228[_0x294f('0x3')]==='customVariable'&&_0x314228[_0x294f('0xa')]&&_0x314228['Variable']['name']){_0x44ba9b[_0x314228['Variable'][_0x294f('0xb')][_0x294f('0xc')]()]&&_0x54f3ff[_0x294f('0x5')](_0x44ba9b[_0x314228[_0x294f('0xa')][_0x294f('0xb')]['toLowerCase']()][_0x294f('0x9')]());}else if(_0x314228[_0x294f('0x3')]===_0x294f('0xd')){if(_0x314228[_0x294f('0xe')]===_0x294f('0x4')&&_0x314228[_0x294f('0xf')]){_0x54f3ff[_0x294f('0x5')](util[_0x294f('0x10')]('%s:\x20%s',_0x314228[_0x294f('0xf')],_0x314228['keyContent']));}else if(_0x314228[_0x294f('0xe')]===_0x294f('0x7')&&_0x314228[_0x294f('0x8')]&&_0x314228[_0x294f('0xf')]){_0x44ba9b[_0x314228[_0x294f('0x8')]]&&_0x54f3ff['push'](util[_0x294f('0x10')](_0x294f('0x11'),_0x314228[_0x294f('0xf')],_0x44ba9b[_0x314228[_0x294f('0x8')]]));}else if(_0x314228[_0x294f('0xe')]===_0x294f('0x12')&&_0x314228['Variable']&&_0x314228[_0x294f('0xa')][_0x294f('0xb')]&&_0x314228[_0x294f('0xf')]){_0x44ba9b[_0x314228['Variable'][_0x294f('0xb')][_0x294f('0xc')]()]&&_0x54f3ff[_0x294f('0x5')](util['format'](_0x294f('0x11'),_0x314228['key'],_0x44ba9b[_0x314228[_0x294f('0xa')][_0x294f('0xb')]['toLowerCase']()]));}}}}return _0x54f3ff[_0x294f('0x13')](_0x23c5aa);};exports[_0x294f('0x14')]=function(_0x1d214d){var _0x511ab6=_0x1d214d[_0x294f('0x15')](-0x1);if(_0x511ab6==='/'){_0x1d214d=_0x1d214d[_0x294f('0x16')](0x0,_0x1d214d[_0x294f('0x17')](_0x511ab6));}return _0x1d214d;};exports[_0x294f('0x18')]=function(_0x272e85){if(!_[_0x294f('0x19')](_0x272e85)&&_0x272e85!==''){var _0x2f56b5=/^(([^<>()\[\]\\.,;:\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 _0x2f56b5[_0x294f('0x1a')](String(_0x272e85)[_0x294f('0xc')]());}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 79275e9..dee18ff 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xe706,0xa3));var _0x6e70=function(_0xd333a1,_0x1f61a0){_0xd333a1=_0xd333a1-0x0;var _0x553a60=_0xe706[_0xd333a1];return _0x553a60;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','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]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x5a6de2,_0x5c8b10){var _0x2c0525=function(_0x59d072){while(--_0x59d072){_0x5a6de2['push'](_0x5a6de2['shift']());}};_0x2c0525(++_0x5c8b10);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('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;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ 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 26ff523..30d0dad 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 _0x145d=['calleridname','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','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','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','password','token','%s/token:%s','username','Basic\x20%s','toString','base64','[HTTP]','stringify','defaults','GET','map','forEach','includes','picklist','nameField','customField','toLowerCase','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','newTab','user:%s','trigger:browser:url','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','replace','/api/v2','unmanaged','The\x20User\x20ID\x20is:'];(function(_0x385013,_0x46a70e){var _0x1a1924=function(_0x2a026f){while(--_0x2a026f){_0x385013['push'](_0x385013['shift']());}};_0x1a1924(++_0x46a70e);}(_0x145d,0x1bf));var _0xd145=function(_0x2923a0,_0x409dea){_0x2923a0=_0x2923a0-0x0;var _0x35930e=_0x145d[_0x2923a0];return _0x35930e;};'use strict';var _=require(_0xd145('0x0'));var rp=require('request-promise');var md5=require(_0xd145('0x1'));var util=require(_0xd145('0x2'));var Redis=require(_0xd145('0x3'));var intUtil=require('./util');var config=require(_0xd145('0x4'));var logger=require(_0xd145('0x5'))(_0xd145('0x6'));config[_0xd145('0x7')]=_['defaults'](config[_0xd145('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd145('0x7')]));function emit(_0x310371,_0x2a761b,_0x45f016){io['to'](_0x310371)['emit'](_0x2a761b,_0x45f016);}var headers={'Content-Type':'application/json','Accept':_0xd145('0x8')};function getTicket(_0x585b42,_0x3ac8ee,_0x270559,_0x3597c5,_0x803192){logger[_0xd145('0x9')](_0xd145('0xa'));return request({'uri':util[_0xd145('0xb')](_0xd145('0xc'),_0x585b42[_0xd145('0xd')]),'method':_0xd145('0xe'),'body':{'ticket':_[_0xd145('0xf')]({'requester_id':_0x270559['id'],'submitter_id':_0x3ac8ee?_0x3ac8ee['id']:undefined,'assignee_id':_0x3ac8ee?_0x3ac8ee['id']:undefined,'tags':getTags(_0x3597c5[_0xd145('0x10')],_0xd145('0x11')),'subject':intUtil['getString'](_0x3597c5[_0xd145('0x12')],_0x803192,'\x20'),'description':intUtil[_0xd145('0x13')](_0x3597c5[_0xd145('0x14')],_0x803192,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd145('0x13')](_0x3597c5[_0xd145('0x14')],_0x803192,'\x0a')}},getCustomFields(_0x3597c5[_0xd145('0x15')],_0x803192))}})[_0xd145('0x16')](function(_0x23b9c9){logger[_0xd145('0x9')](_0xd145('0x17'));return _0x23b9c9[_0xd145('0x18')];});}function getUser(_0x483528,_0x3c9ddf){if(intUtil[_0xd145('0x19')](_0x3c9ddf)){logger[_0xd145('0x9')]('Getting\x20agent\x20with\x20email',_0x3c9ddf);return request({'uri':util[_0xd145('0xb')](_0xd145('0x1a'),_0x483528['remoteUri']),'qs':{'query':util[_0xd145('0xb')](_0xd145('0x1b'),_0x3c9ddf)}})['then'](function(_0x546bc8){if(_0x546bc8[_0xd145('0x1c')]){logger[_0xd145('0x9')](_0xd145('0x1d'));return _[_0xd145('0x1e')](_0x546bc8['results'],{'email':_0x3c9ddf,'role':_0xd145('0x1f')});}else{logger['info'](_0xd145('0x20'));return request({'uri':util[_0xd145('0xb')](_0xd145('0x21'),_0x483528[_0xd145('0xd')])})[_0xd145('0x16')](function(_0x1513fc){logger['info'](_0xd145('0x22'));return _0x1513fc[_0xd145('0x23')];});}});}else{logger[_0xd145('0x9')](_0xd145('0x20'));return request({'uri':util[_0xd145('0xb')](_0xd145('0x21'),_0x483528[_0xd145('0xd')])})[_0xd145('0x16')](function(_0x1e6f94){logger[_0xd145('0x9')](_0xd145('0x22'));return _0x1e6f94['user'];});}}function getEndUser(_0x12e7c9,_0x4617a4,_0x48bdd5){logger[_0xd145('0x9')](_0xd145('0x24'),_0x48bdd5);return request({'uri':util[_0xd145('0xb')](_0xd145('0x1a'),_0x12e7c9[_0xd145('0xd')]),'qs':{'query':util[_0xd145('0xb')](_0xd145('0x25'),_0x48bdd5)}})['then'](function(_0x607d83){var _0x3fcec1;if(_0x607d83[_0xd145('0x26')][_0xd145('0x27')]){_0x607d83[_0xd145('0x26')]=_[_0xd145('0x28')](_0x607d83[_0xd145('0x26')],{'suspended':![],'role':'end-user'});if(_0x607d83[_0xd145('0x26')]['length']){_0x3fcec1=_['first'](_0x607d83[_0xd145('0x26')]);}}if(_0x3fcec1){logger[_0xd145('0x9')]('Enduser\x20found!');return _0x3fcec1;}else{logger[_0xd145('0x9')](_0xd145('0x29'));return request({'uri':util[_0xd145('0xb')](_0xd145('0x2a'),_0x12e7c9[_0xd145('0xd')]),'method':_0xd145('0xe'),'body':{'user':{'role':_0xd145('0x2b'),'name':util[_0xd145('0xb')](_0xd145('0x2c'),_0x4617a4||_0x48bdd5),'phone':_0x48bdd5}}})[_0xd145('0x16')](function(_0x3aee33){logger[_0xd145('0x9')](_0xd145('0x2d'));return _0x3aee33[_0xd145('0x23')];});}});}function getAuth(_0x1d0fb7){var _0x14bb0b;if(_0x1d0fb7[_0xd145('0x2e')]==='password'){_0x14bb0b=util[_0xd145('0xb')](_0xd145('0x2f'),_0x1d0fb7['username'],_0x1d0fb7[_0xd145('0x30')]);}else if(_0x1d0fb7[_0xd145('0x2e')]===_0xd145('0x31')){_0x14bb0b=util[_0xd145('0xb')](_0xd145('0x32'),_0x1d0fb7[_0xd145('0x33')],_0x1d0fb7[_0xd145('0x31')]);}return util[_0xd145('0xb')](_0xd145('0x34'),new Buffer(_0x14bb0b)[_0xd145('0x35')](_0xd145('0x36')));}function request(_0x385bec){logger['debug'](_0xd145('0x37'),JSON[_0xd145('0x38')](_0x385bec));return rp(_[_0xd145('0x39')](_0x385bec,{'method':_0xd145('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x2002b1,_0x5e7f50){var _0x2bbecc=[];if(_0x2002b1&&_0x2002b1[_0xd145('0x27')]>0x0){_0x2bbecc=_[_0xd145('0x3b')](_0x2002b1,_0x5e7f50);}return _0x2bbecc;}function getCustomFields(_0x5a4e4d,_0x184ea4){var _0x36cc73=[];var _0x59d5e4={'custom_fields':[]};if(_0x5a4e4d[_0xd145('0x27')]>0x0){_[_0xd145('0x3c')](_0x5a4e4d,function(_0x3c3b43){if(_[_0xd145('0x3d')](['string',_0xd145('0x3e')],_0x3c3b43['type'])&&_0x3c3b43[_0xd145('0x3f')]&&!_0x3c3b43[_0xd145('0x40')]){_0x59d5e4[_0x3c3b43[_0xd145('0x3f')][_0xd145('0x41')]()]=_0x3c3b43['content'][_0xd145('0x35')]();}else if(_[_0xd145('0x3d')](['string','picklist'],_0x3c3b43[_0xd145('0x42')])&&_0x3c3b43[_0xd145('0x43')]&&_0x3c3b43[_0xd145('0x40')]){_0x59d5e4[_0xd145('0x44')][_0xd145('0x45')]({'id':_0x3c3b43[_0xd145('0x43')],'value':_0x3c3b43['content'][_0xd145('0x35')]()});}else if(_0x3c3b43[_0xd145('0x42')]===_0xd145('0x46')&&_0x3c3b43['variableName']&&_0x3c3b43['idField']&&_0x3c3b43[_0xd145('0x40')]){_0x184ea4[_0x3c3b43['variableName']]&&_0x59d5e4[_0xd145('0x44')]['push']({'id':_0x3c3b43[_0xd145('0x43')],'value':_0x184ea4[_0x3c3b43[_0xd145('0x47')]][_0xd145('0x35')]()});}else if(_0x3c3b43[_0xd145('0x42')]===_0xd145('0x48')&&_0x3c3b43['Variable']&&_0x3c3b43['Variable'][_0xd145('0x11')]&&_0x3c3b43[_0xd145('0x43')]&&_0x3c3b43[_0xd145('0x40')]){_0x184ea4[_0x3c3b43[_0xd145('0x49')][_0xd145('0x11')][_0xd145('0x41')]()]&&_0x59d5e4[_0xd145('0x44')][_0xd145('0x45')]({'id':_0x3c3b43[_0xd145('0x43')],'value':_0x184ea4[_0x3c3b43[_0xd145('0x49')][_0xd145('0x11')][_0xd145('0x41')]()][_0xd145('0x35')]()});}});}return _0x59d5e4;}exports[_0xd145('0x4a')]=function(_0x199103,_0x577159,_0x9fdfe3,_0x4b9bf1,_0x4a8cbd,_0x24acc7){var _0x178b7d,_0x3839df;_0x24acc7[_0xd145('0xd')]=intUtil[_0xd145('0x4b')](_0x24acc7['remoteUri']);_0x24acc7['serverUrl']=intUtil[_0xd145('0x4b')](_0x24acc7[_0xd145('0x4c')]);if(_0x4a8cbd&&_0x4a8cbd[_0xd145('0x4d')]){logger[_0xd145('0x9')](_0xd145('0x4e'),_0xd145('0x4f'));_0x577159[_0xd145('0x50')]=util[_0xd145('0xb')](_0xd145('0x51'),_0x24acc7['serverUrl'],_0x577159['uniqueid'],md5(_0x577159['uniqueid']));}else{_0x577159['recordingURL']='';}headers[_0xd145('0x52')]=getAuth(_0x24acc7);return getUser(_0x24acc7,_0x4b9bf1[_0xd145('0x53')])[_0xd145('0x16')](function(_0x39f796){_0x178b7d=_0x39f796;logger[_0xd145('0x9')]('The\x20User\x20ID\x20is:',_0x178b7d['id']);return getEndUser(_0x24acc7,_0x577159['calleridname'],_0x577159[_0xd145('0x54')]);})[_0xd145('0x16')](function(_0x481c8c){_0x3839df=_0x481c8c;logger[_0xd145('0x9')](_0xd145('0x55'),_0x3839df['id']);return getTicket(_0x24acc7,_0x178b7d,_0x3839df,_0x9fdfe3,_0x577159);})[_0xd145('0x16')](function(_0x2ebc5b){if(_0x2ebc5b){logger['info'](_0xd145('0x56'),_0x2ebc5b['id']);switch(_0x24acc7['type']){case'integrationTab':logger[_0xd145('0x9')]('[QUEUE]',_0xd145('0x57'));return request({'uri':util[_0xd145('0xb')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x24acc7['remoteUri'],_0x178b7d['id'],_0x2ebc5b['id']),'method':_0xd145('0xe')});case _0xd145('0x58'):logger[_0xd145('0x9')](_0xd145('0x4e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd145('0xb')](_0xd145('0x59'),_0x4b9bf1[_0xd145('0x11')]),_0xd145('0x5a'),{'uri':util[_0xd145('0xb')]('%s/agent/tickets/%s',_0x24acc7['remoteUri']['replace']('/api/v2',''),_0x2ebc5b['id'])});break;default:logger[_0xd145('0x5b')](_0xd145('0x4e'),_0xd145('0x5c'));}}})[_0xd145('0x5d')](function(_0x2d3420){logger[_0xd145('0x5b')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xd145('0x5e')](_0x2d3420,{'showHidden':!![],'depth':null}));});};exports[_0xd145('0x5f')]=function(_0x1a353f,_0x1d022d,_0x5a1897,_0x1f5af5,_0x3ab1ed,_0x4818a8,_0x281b24){var _0x464fe5,_0x551813;_0x4818a8['remoteUri']=intUtil[_0xd145('0x4b')](_0x4818a8['remoteUri']);_0x4818a8[_0xd145('0x4c')]=intUtil['stripTrailingSlash'](_0x4818a8[_0xd145('0x4c')]);if(_0x281b24&&_0x281b24[_0xd145('0x60')]&&_0x281b24['recordingFormat']!==_0xd145('0x61')){logger[_0xd145('0x9')](_0xd145('0x62'),_0xd145('0x4f'));_0x1d022d[_0xd145('0x50')]=util[_0xd145('0xb')](_0xd145('0x51'),_0x4818a8['serverUrl'],_0x1d022d['uniqueid'],md5(_0x1d022d[_0xd145('0x63')]));}headers[_0xd145('0x52')]=getAuth(_0x4818a8);return getUser(_0x4818a8,_0x1f5af5[_0xd145('0x53')])['then'](function(_0x19ecfc){_0x464fe5=_0x19ecfc;logger[_0xd145('0x9')]('The\x20User\x20ID\x20is:',_0x464fe5['id']);return getEndUser(_0x4818a8,_0x1d022d[_0xd145('0x64')],_0x1d022d[_0xd145('0x65')]);})[_0xd145('0x16')](function(_0x3b2cf4){_0x551813=_0x3b2cf4;logger[_0xd145('0x9')](_0xd145('0x55'),_0x551813['id']);return getTicket(_0x4818a8,_0x464fe5,_0x551813,_0x5a1897,_0x1d022d);})['then'](function(_0x2f09f0){if(_0x2f09f0){logger[_0xd145('0x9')](_0xd145('0x56'),_0x2f09f0['id']);switch(_0x4818a8[_0xd145('0x42')]){case _0xd145('0x66'):logger['info'](_0xd145('0x62'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xd145('0xb')](_0xd145('0x67'),_0x4818a8[_0xd145('0xd')],_0x464fe5['id'],_0x2f09f0['id']),'method':'POST'});case _0xd145('0x58'):logger[_0xd145('0x9')](_0xd145('0x62'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd145('0xb')](_0xd145('0x59'),_0x1f5af5['name']),_0xd145('0x5a'),{'uri':util['format']('%s/agent/tickets/%s',_0x4818a8['remoteUri'][_0xd145('0x68')](_0xd145('0x69'),''),_0x2f09f0['id'])});break;default:logger[_0xd145('0x5b')](_0xd145('0x62'),_0xd145('0x5c'));}}})[_0xd145('0x5d')](function(_0x53c461){logger[_0xd145('0x5b')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xd145('0x5e')](_0x53c461,{'showHidden':!![],'depth':null}));});};exports[_0xd145('0x6a')]=function(_0x228df7,_0x59415a,_0x408f23,_0x4e1fc5,_0x1be3e1,_0x3c498a){var _0x48ee33,_0x595693;_0x3c498a[_0xd145('0xd')]=intUtil[_0xd145('0x4b')](_0x3c498a[_0xd145('0xd')]);_0x3c498a[_0xd145('0x4c')]=intUtil[_0xd145('0x4b')](_0x3c498a[_0xd145('0x4c')]);if(_0x1be3e1&&_0x1be3e1[_0xd145('0x4d')]){logger[_0xd145('0x9')]('['+_0x59415a['lastevent']['toUpperCase']()+']',_0xd145('0x4f'));_0x59415a['recordingURL']=util[_0xd145('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3c498a[_0xd145('0x4c')],_0x59415a[_0xd145('0x63')],md5(_0x59415a['uniqueid']));}else{_0x59415a[_0xd145('0x50')]='';}headers[_0xd145('0x52')]=getAuth(_0x3c498a);return getUser(_0x3c498a)[_0xd145('0x16')](function(_0x527ad0){_0x48ee33=_0x527ad0;logger[_0xd145('0x9')](_0xd145('0x6b'),_0x48ee33['id']);return getEndUser(_0x3c498a,_0x59415a[_0xd145('0x6c')],_0x59415a[_0xd145('0x54')]);})[_0xd145('0x16')](function(_0x1416b5){_0x595693=_0x1416b5;logger[_0xd145('0x9')](_0xd145('0x55'),_0x595693['id']);return getTicket(_0x3c498a,_0x48ee33,_0x595693,_0x408f23,_0x59415a);})[_0xd145('0x16')](function(_0x2688b6){if(_0x2688b6){logger['info'](_0xd145('0x56'),_0x2688b6['id']);}})[_0xd145('0x5d')](function(_0x147943){logger[_0xd145('0x5b')]('['+_0x59415a['lastevent'][_0xd145('0x6d')]()+']'+_0xd145('0x6e'),util[_0xd145('0x5e')](_0x147943,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6bee=['variable','variableName','customField','customVariable','Variable','name','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','integrationTab','[QUEUE]','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','/api/v2','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','Subjects','getString','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','password','%s:%s','username','authType','%s/token:%s','Basic\x20%s','toString','base64','stringify','GET','map','forEach','includes','string','picklist','nameField','toLowerCase','type','idField','custom_fields','push','content'];(function(_0x52446b,_0x4eb7f9){var _0x2dcc6f=function(_0x2061bb){while(--_0x2061bb){_0x52446b['push'](_0x52446b['shift']());}};_0x2dcc6f(++_0x4eb7f9);}(_0x6bee,0x112));var _0xe6be=function(_0x22d530,_0x1db612){_0x22d530=_0x22d530-0x0;var _0x1c0feb=_0x6bee[_0x22d530];return _0x1c0feb;};'use strict';var _=require(_0xe6be('0x0'));var rp=require('request-promise');var md5=require(_0xe6be('0x1'));var util=require(_0xe6be('0x2'));var Redis=require(_0xe6be('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xe6be('0x4'))(_0xe6be('0x5'));config[_0xe6be('0x6')]=_[_0xe6be('0x7')](config[_0xe6be('0x6')],{'host':_0xe6be('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x356166,_0x3bad4f,_0x289bcb){io['to'](_0x356166)[_0xe6be('0x9')](_0x3bad4f,_0x289bcb);}var headers={'Content-Type':_0xe6be('0xa'),'Accept':_0xe6be('0xa')};function getTicket(_0x457f0b,_0x26d432,_0x32af19,_0x4b0871,_0x122495){logger[_0xe6be('0xb')](_0xe6be('0xc'));return request({'uri':util['format'](_0xe6be('0xd'),_0x457f0b[_0xe6be('0xe')]),'method':_0xe6be('0xf'),'body':{'ticket':_[_0xe6be('0x10')]({'requester_id':_0x32af19['id'],'submitter_id':_0x26d432?_0x26d432['id']:undefined,'assignee_id':_0x26d432?_0x26d432['id']:undefined,'tags':getTags(_0x4b0871[_0xe6be('0x11')],'name'),'subject':intUtil['getString'](_0x4b0871[_0xe6be('0x12')],_0x122495,'\x20'),'description':intUtil[_0xe6be('0x13')](_0x4b0871[_0xe6be('0x14')],_0x122495,'\x0a'),'comment':{'public':![],'body':intUtil[_0xe6be('0x13')](_0x4b0871[_0xe6be('0x14')],_0x122495,'\x0a')}},getCustomFields(_0x4b0871[_0xe6be('0x15')],_0x122495))}})['then'](function(_0x280ea8){logger['info'](_0xe6be('0x16'));return _0x280ea8[_0xe6be('0x17')];});}function getUser(_0x374878,_0xb81885){if(intUtil[_0xe6be('0x18')](_0xb81885)){logger['info'](_0xe6be('0x19'),_0xb81885);return request({'uri':util[_0xe6be('0x1a')](_0xe6be('0x1b'),_0x374878[_0xe6be('0xe')]),'qs':{'query':util['format'](_0xe6be('0x1c'),_0xb81885)}})[_0xe6be('0x1d')](function(_0x115df5){if(_0x115df5[_0xe6be('0x1e')]){logger[_0xe6be('0xb')](_0xe6be('0x1f'));return _[_0xe6be('0x20')](_0x115df5[_0xe6be('0x21')],{'email':_0xb81885,'role':_0xe6be('0x22')});}else{logger[_0xe6be('0xb')](_0xe6be('0x23'));return request({'uri':util[_0xe6be('0x1a')](_0xe6be('0x24'),_0x374878[_0xe6be('0xe')])})[_0xe6be('0x1d')](function(_0x16257d){logger['info'](_0xe6be('0x25'));return _0x16257d[_0xe6be('0x26')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x374878[_0xe6be('0xe')])})['then'](function(_0xda64b0){logger[_0xe6be('0xb')](_0xe6be('0x25'));return _0xda64b0['user'];});}}function getEndUser(_0x3fe725,_0x480d8e,_0x1a2cb9){logger[_0xe6be('0xb')](_0xe6be('0x27'),_0x1a2cb9);return request({'uri':util[_0xe6be('0x1a')](_0xe6be('0x1b'),_0x3fe725[_0xe6be('0xe')]),'qs':{'query':util['format'](_0xe6be('0x28'),_0x1a2cb9)}})[_0xe6be('0x1d')](function(_0x2e15b9){var _0x790900;if(_0x2e15b9[_0xe6be('0x21')][_0xe6be('0x29')]){_0x2e15b9[_0xe6be('0x21')]=_[_0xe6be('0x2a')](_0x2e15b9[_0xe6be('0x21')],{'suspended':![],'role':'end-user'});if(_0x2e15b9[_0xe6be('0x21')][_0xe6be('0x29')]){_0x790900=_[_0xe6be('0x2b')](_0x2e15b9[_0xe6be('0x21')]);}}if(_0x790900){logger[_0xe6be('0xb')](_0xe6be('0x2c'));return _0x790900;}else{logger['info'](_0xe6be('0x2d'));return request({'uri':util[_0xe6be('0x1a')](_0xe6be('0x2e'),_0x3fe725[_0xe6be('0xe')]),'method':_0xe6be('0xf'),'body':{'user':{'role':_0xe6be('0x2f'),'name':util['format'](_0xe6be('0x30'),_0x480d8e||_0x1a2cb9),'phone':_0x1a2cb9}}})[_0xe6be('0x1d')](function(_0x11fe19){logger[_0xe6be('0xb')]('Enduser\x20created.');return _0x11fe19['user'];});}});}function getAuth(_0x40b413){var _0x2bfaf6;if(_0x40b413['authType']===_0xe6be('0x31')){_0x2bfaf6=util[_0xe6be('0x1a')](_0xe6be('0x32'),_0x40b413[_0xe6be('0x33')],_0x40b413[_0xe6be('0x31')]);}else if(_0x40b413[_0xe6be('0x34')]==='token'){_0x2bfaf6=util[_0xe6be('0x1a')](_0xe6be('0x35'),_0x40b413[_0xe6be('0x33')],_0x40b413['token']);}return util['format'](_0xe6be('0x36'),new Buffer(_0x2bfaf6)[_0xe6be('0x37')](_0xe6be('0x38')));}function request(_0x32d9b2){logger['debug']('[HTTP]',JSON[_0xe6be('0x39')](_0x32d9b2));return rp(_['defaults'](_0x32d9b2,{'method':_0xe6be('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x26325c,_0x2f6127){var _0x410f59=[];if(_0x26325c&&_0x26325c[_0xe6be('0x29')]>0x0){_0x410f59=_[_0xe6be('0x3b')](_0x26325c,_0x2f6127);}return _0x410f59;}function getCustomFields(_0x152966,_0x493b47){var _0x176652=[];var _0x3d1d04={'custom_fields':[]};if(_0x152966[_0xe6be('0x29')]>0x0){_[_0xe6be('0x3c')](_0x152966,function(_0x272ae4){if(_[_0xe6be('0x3d')]([_0xe6be('0x3e'),_0xe6be('0x3f')],_0x272ae4['type'])&&_0x272ae4['nameField']&&!_0x272ae4['customField']){_0x3d1d04[_0x272ae4[_0xe6be('0x40')][_0xe6be('0x41')]()]=_0x272ae4['content'][_0xe6be('0x37')]();}else if(_['includes']([_0xe6be('0x3e'),_0xe6be('0x3f')],_0x272ae4[_0xe6be('0x42')])&&_0x272ae4[_0xe6be('0x43')]&&_0x272ae4['customField']){_0x3d1d04[_0xe6be('0x44')][_0xe6be('0x45')]({'id':_0x272ae4[_0xe6be('0x43')],'value':_0x272ae4[_0xe6be('0x46')][_0xe6be('0x37')]()});}else if(_0x272ae4[_0xe6be('0x42')]===_0xe6be('0x47')&&_0x272ae4[_0xe6be('0x48')]&&_0x272ae4[_0xe6be('0x43')]&&_0x272ae4[_0xe6be('0x49')]){_0x493b47[_0x272ae4[_0xe6be('0x48')]]&&_0x3d1d04['custom_fields'][_0xe6be('0x45')]({'id':_0x272ae4['idField'],'value':_0x493b47[_0x272ae4[_0xe6be('0x48')]][_0xe6be('0x37')]()});}else if(_0x272ae4[_0xe6be('0x42')]===_0xe6be('0x4a')&&_0x272ae4[_0xe6be('0x4b')]&&_0x272ae4[_0xe6be('0x4b')]['name']&&_0x272ae4[_0xe6be('0x43')]&&_0x272ae4[_0xe6be('0x49')]){_0x493b47[_0x272ae4[_0xe6be('0x4b')][_0xe6be('0x4c')][_0xe6be('0x41')]()]&&_0x3d1d04[_0xe6be('0x44')]['push']({'id':_0x272ae4[_0xe6be('0x43')],'value':_0x493b47[_0x272ae4[_0xe6be('0x4b')]['name'][_0xe6be('0x41')]()][_0xe6be('0x37')]()});}});}return _0x3d1d04;}exports['queue']=function(_0xffcb3e,_0x232587,_0x4e516c,_0x4fd590,_0x4f1f04,_0x3512eb){var _0x563017,_0x139ea4;_0x3512eb[_0xe6be('0xe')]=intUtil[_0xe6be('0x4d')](_0x3512eb[_0xe6be('0xe')]);_0x3512eb[_0xe6be('0x4e')]=intUtil['stripTrailingSlash'](_0x3512eb[_0xe6be('0x4e')]);if(_0x4f1f04&&_0x4f1f04[_0xe6be('0x4f')]){logger[_0xe6be('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x232587[_0xe6be('0x50')]=util['format'](_0xe6be('0x51'),_0x3512eb[_0xe6be('0x4e')],_0x232587[_0xe6be('0x52')],md5(_0x232587[_0xe6be('0x52')]));}else{_0x232587['recordingURL']='';}headers[_0xe6be('0x53')]=getAuth(_0x3512eb);return getUser(_0x3512eb,_0x4fd590[_0xe6be('0x54')])[_0xe6be('0x1d')](function(_0x44d484){_0x563017=_0x44d484;logger[_0xe6be('0xb')](_0xe6be('0x55'),_0x563017['id']);return getEndUser(_0x3512eb,_0x232587[_0xe6be('0x56')],_0x232587['calleridnum']);})['then'](function(_0x3bb6bc){_0x139ea4=_0x3bb6bc;logger[_0xe6be('0xb')]('The\x20Enduser\x20ID\x20is:',_0x139ea4['id']);return getTicket(_0x3512eb,_0x563017,_0x139ea4,_0x4e516c,_0x232587);})['then'](function(_0x36cc20){if(_0x36cc20){logger[_0xe6be('0xb')]('The\x20Ticket\x20ID\x20is:',_0x36cc20['id']);switch(_0x3512eb['type']){case _0xe6be('0x57'):logger['info'](_0xe6be('0x58'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xe6be('0x1a')](_0xe6be('0x59'),_0x3512eb[_0xe6be('0xe')],_0x563017['id'],_0x36cc20['id']),'method':_0xe6be('0xf')});case _0xe6be('0x5a'):logger[_0xe6be('0xb')](_0xe6be('0x58'),_0xe6be('0x5b'));emit(util[_0xe6be('0x1a')]('user:%s',_0x4fd590['name']),_0xe6be('0x5c'),{'uri':util[_0xe6be('0x1a')](_0xe6be('0x5d'),_0x3512eb[_0xe6be('0xe')][_0xe6be('0x5e')]('/api/v2',''),_0x36cc20['id'])});break;default:logger[_0xe6be('0x5f')]('[QUEUE]',_0xe6be('0x60'));}}})['catch'](function(_0x16cf14){logger[_0xe6be('0x5f')](_0xe6be('0x61'),util[_0xe6be('0x62')](_0x16cf14,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x465c41,_0x18d4a6,_0x43397b,_0xebccee,_0x3dd3fb,_0x4a6f9a,_0xb83a5a){var _0x5c3ab2,_0x53585f;_0x4a6f9a[_0xe6be('0xe')]=intUtil['stripTrailingSlash'](_0x4a6f9a['remoteUri']);_0x4a6f9a[_0xe6be('0x4e')]=intUtil[_0xe6be('0x4d')](_0x4a6f9a['serverUrl']);if(_0xb83a5a&&_0xb83a5a[_0xe6be('0x63')]&&_0xb83a5a['recordingFormat']!=='none'){logger[_0xe6be('0xb')](_0xe6be('0x64'),_0xe6be('0x65'));_0x18d4a6[_0xe6be('0x50')]=util['format'](_0xe6be('0x51'),_0x4a6f9a['serverUrl'],_0x18d4a6[_0xe6be('0x52')],md5(_0x18d4a6[_0xe6be('0x52')]));}headers[_0xe6be('0x53')]=getAuth(_0x4a6f9a);return getUser(_0x4a6f9a,_0xebccee['email'])['then'](function(_0x2a2fb9){_0x5c3ab2=_0x2a2fb9;logger[_0xe6be('0xb')](_0xe6be('0x55'),_0x5c3ab2['id']);return getEndUser(_0x4a6f9a,_0x18d4a6[_0xe6be('0x66')],_0x18d4a6[_0xe6be('0x67')]);})[_0xe6be('0x1d')](function(_0x21e3d3){_0x53585f=_0x21e3d3;logger[_0xe6be('0xb')](_0xe6be('0x68'),_0x53585f['id']);return getTicket(_0x4a6f9a,_0x5c3ab2,_0x53585f,_0x43397b,_0x18d4a6);})[_0xe6be('0x1d')](function(_0x19d980){if(_0x19d980){logger[_0xe6be('0xb')](_0xe6be('0x69'),_0x19d980['id']);switch(_0x4a6f9a[_0xe6be('0x42')]){case _0xe6be('0x57'):logger[_0xe6be('0xb')](_0xe6be('0x64'),_0xe6be('0x6a'));return request({'uri':util[_0xe6be('0x1a')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4a6f9a['remoteUri'],_0x5c3ab2['id'],_0x19d980['id']),'method':_0xe6be('0xf')});case'newTab':logger[_0xe6be('0xb')](_0xe6be('0x64'),_0xe6be('0x5b'));emit(util[_0xe6be('0x1a')](_0xe6be('0x6b'),_0xebccee['name']),_0xe6be('0x5c'),{'uri':util[_0xe6be('0x1a')](_0xe6be('0x5d'),_0x4a6f9a[_0xe6be('0xe')][_0xe6be('0x5e')](_0xe6be('0x6c'),''),_0x19d980['id'])});break;default:logger[_0xe6be('0x5f')](_0xe6be('0x64'),_0xe6be('0x60'));}}})[_0xe6be('0x6d')](function(_0x4112e6){logger[_0xe6be('0x5f')](_0xe6be('0x6e'),util['inspect'](_0x4112e6,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x729bdb,_0x4f744e,_0x58fc53,_0x3f83ca,_0x1cc7f6,_0x4b4025){var _0x250ee9,_0x467209;_0x4b4025[_0xe6be('0xe')]=intUtil[_0xe6be('0x4d')](_0x4b4025[_0xe6be('0xe')]);_0x4b4025[_0xe6be('0x4e')]=intUtil['stripTrailingSlash'](_0x4b4025[_0xe6be('0x4e')]);if(_0x1cc7f6&&_0x1cc7f6[_0xe6be('0x4f')]){logger[_0xe6be('0xb')]('['+_0x4f744e[_0xe6be('0x6f')][_0xe6be('0x70')]()+']','Recording\x20is\x20enabled!');_0x4f744e[_0xe6be('0x50')]=util[_0xe6be('0x1a')](_0xe6be('0x51'),_0x4b4025[_0xe6be('0x4e')],_0x4f744e[_0xe6be('0x52')],md5(_0x4f744e['uniqueid']));}else{_0x4f744e[_0xe6be('0x50')]='';}headers[_0xe6be('0x53')]=getAuth(_0x4b4025);return getUser(_0x4b4025)[_0xe6be('0x1d')](function(_0x38b10d){_0x250ee9=_0x38b10d;logger[_0xe6be('0xb')](_0xe6be('0x55'),_0x250ee9['id']);return getEndUser(_0x4b4025,_0x4f744e[_0xe6be('0x56')],_0x4f744e[_0xe6be('0x71')]);})[_0xe6be('0x1d')](function(_0x3aa0de){_0x467209=_0x3aa0de;logger[_0xe6be('0xb')](_0xe6be('0x68'),_0x467209['id']);return getTicket(_0x4b4025,_0x250ee9,_0x467209,_0x58fc53,_0x4f744e);})['then'](function(_0x2a80d2){if(_0x2a80d2){logger['info'](_0xe6be('0x69'),_0x2a80d2['id']);}})[_0xe6be('0x6d')](function(_0x1470d9){logger['error']('['+_0x4f744e[_0xe6be('0x6f')]['toUpperCase']()+']'+_0xe6be('0x72'),util[_0xe6be('0x62')](_0x1470d9,{'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 a626b77..5d26fd7 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 _0x4dd4=['mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','connect','Answered','Abandoned','timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','code','Call\x20created!','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','/downloads?type=uniqueid&token=','destcalleridname','Outbound','unmanaged','The\x20Call\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','moment','ioredis','bluebird','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','debug','[HTTP]','length','includes','string','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','SUCCESS','details','CREATE\x20ERROR','moduleSearch','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc'];(function(_0x18d9bb,_0x46e4ab){var _0x2dd06f=function(_0x36288b){while(--_0x36288b){_0x18d9bb['push'](_0x18d9bb['shift']());}};_0x2dd06f(++_0x46e4ab);}(_0x4dd4,0xcf));var _0x44dd=function(_0x144e02,_0x2b0836){_0x144e02=_0x144e02-0x0;var _0x327229=_0x4dd4[_0x144e02];return _0x327229;};'use strict';var _=require(_0x44dd('0x0'));var rp=require(_0x44dd('0x1'));var md5=require(_0x44dd('0x2'));var util=require('util');var intUtil=require('./util');var moment=require(_0x44dd('0x3'));var Redis=require(_0x44dd('0x4'));var BPromise=require(_0x44dd('0x5'));var config=require('../../../../config/environment');var logger=require(_0x44dd('0x6'))(_0x44dd('0x7'));config['redis']=_['defaults'](config[_0x44dd('0x8')],{'host':_0x44dd('0x9'),'port':0x18eb});var io=require(_0x44dd('0xa'))(new Redis(config[_0x44dd('0x8')]));function emit(_0x5f3aa8,_0x1d1307,_0x1a811){io['to'](_0x5f3aa8)['emit'](_0x1d1307,_0x1a811);}function request(_0x4583e8){logger[_0x44dd('0xb')](_0x44dd('0xc'),JSON['stringify'](_0x4583e8));return rp(_0x4583e8);}function getCustomFields(_0x16179b,_0x3414f2){var _0x25fe0b={};if(_0x16179b[_0x44dd('0xd')]>0x0){_['forEach'](_0x16179b,function(_0x25e9ed){if(_[_0x44dd('0xe')]([_0x44dd('0xf'),_0x44dd('0x10')],_0x25e9ed['type'])&&_0x25e9ed[_0x44dd('0x11')]){_0x25fe0b[_0x25e9ed[_0x44dd('0x11')]]=_0x25e9ed[_0x44dd('0x12')][_0x44dd('0x13')]();}else if(_0x25e9ed[_0x44dd('0x14')]===_0x44dd('0x15')&&_0x25e9ed[_0x44dd('0x16')]&&_0x25e9ed[_0x44dd('0x11')]&&_0x3414f2[_0x25e9ed[_0x44dd('0x16')]]){_0x25fe0b[_0x25e9ed['idField']]=_0x3414f2[_0x25e9ed['variableName']][_0x44dd('0x13')]();}else if(_0x25e9ed[_0x44dd('0x14')]===_0x44dd('0x17')&&_0x25e9ed[_0x44dd('0x18')]&&_0x25e9ed[_0x44dd('0x18')][_0x44dd('0x19')]&&_0x25e9ed[_0x44dd('0x11')]&&_0x3414f2[_0x25e9ed[_0x44dd('0x18')][_0x44dd('0x19')][_0x44dd('0x1a')]()]){_0x25fe0b[_0x25e9ed['idField']]=_0x3414f2[_0x25e9ed[_0x44dd('0x18')]['name']['toLowerCase']()][_0x44dd('0x13')]();}});}return _0x25fe0b;}function getName(_0x50233){if(_0x50233[_0x44dd('0x1b')]('\x20')>0x0){var _0x2710ce=_0x50233[_0x44dd('0x1c')](/ (.+)/);if(_0x2710ce[0x1]){return _0x2710ce;}}return[_0x50233,_0x50233];}var accountsTokens={};function getAccessToken(_0x18370f){return new Promise(function(_0x1f376a,_0x15d2ac){if(!_['isNil'](accountsTokens[_0x18370f['id']])&&!_[_0x44dd('0x1d')](accountsTokens[_0x18370f['id']][_0x44dd('0x1e')])){if(moment()[_0x44dd('0x1f')](accountsTokens[_0x18370f['id']][_0x44dd('0x20')])){_0x1f376a(accountsTokens[_0x18370f['id']][_0x44dd('0x1e')]);}}var _0x498b7a;switch(_0x18370f[_0x44dd('0x21')]){case'US':_0x498b7a='https://accounts.zoho.com';break;case'AU':_0x498b7a=_0x44dd('0x22');break;case'EU':_0x498b7a=_0x44dd('0x23');break;case'IN':_0x498b7a=_0x44dd('0x24');break;case'CN':_0x498b7a=_0x44dd('0x25');break;default:_0x498b7a=_0x44dd('0x23');break;}var _0x44183a={'method':_0x44dd('0x26'),'uri':_0x498b7a+_0x44dd('0x27'),'qs':{'refresh_token':_0x18370f[_0x44dd('0x28')],'client_id':_0x18370f[_0x44dd('0x29')],'client_secret':_0x18370f[_0x44dd('0x2a')],'grant_type':_0x44dd('0x2b')},'json':!![]};return rp(_0x44183a)[_0x44dd('0x2c')](function(_0x406728){accountsTokens[_0x18370f['id']]={'access_token':_0x406728['access_token'],'expires_in':moment()[_0x44dd('0x2d')](_0x406728[_0x44dd('0x20')],'seconds')};_0x1f376a(_0x406728['access_token']);})[_0x44dd('0x2e')](function(_0x279676){logger[_0x44dd('0x2f')]('Failing\x20creating\x20the\x20access_token',_0x279676[_0x44dd('0x30')]);_0x15d2ac(_0x279676);});});}function getUser(_0x4a37fd,_0xd942b6,_0x2db475,_0x17dc97){logger[_0x44dd('0x31')](_0x44dd('0x32'));return request({'method':_0x44dd('0x33'),'uri':util[_0x44dd('0x34')](_0x44dd('0x35'),_0xd942b6),'qs':{'type':_0x44dd('0x36')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4a37fd},'json':!![]})[_0x44dd('0x2c')](function(_0x57d670){if(_0x57d670[_0x44dd('0x37')]){var _0x45fd7e=-0x1;if(_[_0x44dd('0x38')](_0x57d670[_0x44dd('0x37')])){if(!_['isNil'](_0x17dc97)){_0x45fd7e=_[_0x44dd('0x39')](_0x57d670[_0x44dd('0x37')],function(_0x5b99e6){return _0x5b99e6[_0x44dd('0x3a')]===_0x17dc97;});}if(_0x45fd7e>=0x0){logger[_0x44dd('0x31')](_0x44dd('0x3b'));}else{logger[_0x44dd('0x31')](_0x44dd('0x3c'));_0x45fd7e=_[_0x44dd('0x39')](_0x57d670[_0x44dd('0x37')],function(_0x576eba){return _0x576eba[_0x44dd('0x3d')][_0x44dd('0x19')]===_0x44dd('0x3e');});}return _0x57d670[_0x44dd('0x37')][_0x45fd7e];}else{if(_0x57d670['user']['profile']['name']===_0x44dd('0x3e')){logger[_0x44dd('0x31')](_0x44dd('0x3c'));user=_0x57d670[_0x44dd('0x3f')];return user;}else{logger[_0x44dd('0x2f')](_0x44dd('0x40'),JSON[_0x44dd('0x41')](_0x57d670));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x44dd('0x41')](_0x57d670));}}}else{logger[_0x44dd('0x2f')](_0x44dd('0x40'),JSON[_0x44dd('0x41')](_0x57d670));throw new Error(_0x44dd('0x42')+JSON[_0x44dd('0x41')](_0x57d670));}})['catch'](function(_0x3f06a7){console['error'](_0x3f06a7);});}function getZohoUser(_0x336f9c,_0xcb8500){return new BPromise(function(_0x87e6e2,_0x339001){request(_0x336f9c)[_0x44dd('0x2c')](function(_0x3ec6fe){var _0x25483a=null;if(_0x3ec6fe){_0x25483a=_0x3ec6fe[_0x44dd('0x43')][0x0];_0x25483a[_0x44dd('0x44')]=_0xcb8500;}_0x87e6e2(_0x25483a);})[_0x44dd('0x2e')](function(_0x40a637){_0x339001(_0x40a637);});});}function createEndUser(_0x36143a,_0x5ca814,_0x698660,_0x43b763,_0x11c1ce,_0x3c87bc){var _0x698660=getName(_0x698660);return request({'method':'POST','uri':_0x44dd('0x45')+_0x5ca814+_0x44dd('0x46')+_[_0x44dd('0x47')](_0x3c87bc[_0x44dd('0x48')])+'s','body':{'data':[{'Last_Name':_0x698660[0x1],'First_Name':_0x698660[0x0],'Phone':_0x43b763,'Owner':{'name':!_['isNil'](_0x11c1ce[_0x44dd('0x49')][_0x44dd('0x19')])?_0x11c1ce['role'][_0x44dd('0x19')]:!_[_0x44dd('0x1d')](_0x11c1ce[_0x44dd('0x4a')])?_0x11c1ce[_0x44dd('0x4a')]+'\x20'+_0x11c1ce[_0x44dd('0x4b')]:_0x11c1ce[_0x44dd('0x4b')],'id':_0x11c1ce['id']}}]},'headers':{'Authorization':_0x44dd('0x4c')+_0x36143a},'json':!![]})[_0x44dd('0x2c')](function(_0x59176a){if(_0x59176a&&_0x59176a[_0x44dd('0x43')][0x0]['code']===_0x44dd('0x4d')){var _0x2c6a1e=_0x59176a[_0x44dd('0x43')][0x0][_0x44dd('0x4e')];_0x2c6a1e[_0x44dd('0x44')]=_[_0x44dd('0x47')](_0x3c87bc['moduleCreate'])+'s';return _0x2c6a1e;}logger[_0x44dd('0x2f')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0x44dd('0x2e')](function(_0x531b94){console['log'](_0x44dd('0x4f'),_0x531b94);});}function getEndUser(_0x40b3e8,_0x1117e7,_0x3aa92c,_0x580c89,_0x53fb1e,_0x3838d8,_0x44972e){var _0x109e30={'method':_0x44dd('0x33'),'uri':'','headers':{'Authorization':_0x44dd('0x4c')+_0x40b3e8},'json':!![]};switch(_0x44972e[_0x44dd('0x50')]){case _0x44dd('0x51'):_0x109e30[_0x44dd('0x52')]=_0x44dd('0x45')+_0x1117e7+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x53fb1e+'))';return getZohoUser(_0x109e30,_0x44dd('0x53'))['then'](function(_0x50ef09){if(_0x50ef09)return _0x50ef09;_0x109e30[_0x44dd('0x52')]=_0x44dd('0x45')+_0x1117e7+_0x44dd('0x54')+_0x53fb1e+'))';return getZohoUser(_0x109e30,_0x44dd('0x55'))[_0x44dd('0x2c')](function(_0x524593){if(_0x524593)return _0x524593;if(_0x44972e['moduleCreate']!=_0x44dd('0x56')){return createEndUser(_0x40b3e8,_0x1117e7,_0x580c89,_0x53fb1e,_0x3838d8,_0x44972e);}else{return{};}});});break;case _0x44dd('0x57'):_0x109e30[_0x44dd('0x52')]='https://www.zohoapis.'+_0x1117e7+_0x44dd('0x58')+_0x53fb1e+'))';return getZohoUser(_0x109e30,_0x44dd('0x53'))['then'](function(_0x457806){if(_0x457806)return _0x457806;if(_0x44972e['moduleCreate']!='nothing'){return createEndUser(_0x40b3e8,_0x1117e7,_0x580c89,_0x53fb1e,_0x3838d8,_0x44972e);}else{return{};}});break;case'lead':_0x109e30[_0x44dd('0x52')]=_0x44dd('0x45')+_0x1117e7+_0x44dd('0x54')+_0x53fb1e+'))';return getZohoUser(_0x109e30,_0x44dd('0x55'))['then'](function(_0x51bb94){if(_0x51bb94)return _0x51bb94;if(_0x44972e['moduleCreate']!=_0x44dd('0x56')){return createEndUser(_0x40b3e8,_0x1117e7,_0x580c89,_0x53fb1e,_0x3838d8,_0x44972e);}else{return{};}});break;}}function getCall(_0x5a9412,_0x425a93,_0x932fb,_0x59a683,_0x3be260,_0x440d82,_0x2e47a4,_0x5bbe8b){logger['info'](_0x44dd('0x59'));var _0x6aebba={};_0x6aebba[_0x44dd('0x5a')]={'name':!_[_0x44dd('0x1d')](_0x59a683[_0x44dd('0x49')][_0x44dd('0x19')])&&!_[_0x44dd('0x1d')](_0x59a683[_0x44dd('0x3d')][_0x44dd('0x19')])&&_0x59a683[_0x44dd('0x3d')]['name']===_0x44dd('0x5b')?_0x59a683[_0x44dd('0x49')][_0x44dd('0x19')]:!_[_0x44dd('0x1d')](_0x59a683[_0x44dd('0x4a')])?_0x59a683[_0x44dd('0x4a')]+'\x20'+_0x59a683[_0x44dd('0x4b')]:_0x59a683[_0x44dd('0x4b')],'id':_0x59a683['id']};_0x6aebba[_0x44dd('0x5c')]=intUtil[_0x44dd('0x5d')](_0x440d82[_0x44dd('0x5e')],_0x2e47a4,'\x20');_0x6aebba[_0x44dd('0x5f')]=intUtil['getString'](_0x440d82[_0x44dd('0x60')],_0x2e47a4,'\x0a');if(_0x3be260[_0x44dd('0x44')]===_0x44dd('0x53')){_0x6aebba[_0x44dd('0x61')]={'name':!_[_0x44dd('0x1d')](_0x3be260[_0x44dd('0x62')])?_0x3be260[_0x44dd('0x62')]:!_[_0x44dd('0x1d')](_0x3be260[_0x44dd('0x63')])?_0x3be260[_0x44dd('0x63')]+'\x20'+_0x3be260[_0x44dd('0x64')]:_0x3be260[_0x44dd('0x64')],'id':_0x3be260['id']};}if(_0x3be260[_0x44dd('0x44')]==='Leads'){_0x6aebba['What_Id']={'name':!_[_0x44dd('0x1d')](_0x3be260[_0x44dd('0x62')])?_0x3be260[_0x44dd('0x62')]:!_['isNil'](_0x3be260[_0x44dd('0x63')])?_0x3be260[_0x44dd('0x63')]+'\x20'+_0x3be260['Last_Name']:_0x3be260[_0x44dd('0x64')],'id':_0x3be260['id']};_0x6aebba[_0x44dd('0x65')]=_[_0x44dd('0x47')](_0x3be260[_0x44dd('0x44')]);}if(_0x2e47a4[_0x44dd('0x66')]){_0x6aebba[_0x44dd('0x67')]=moment[_0x44dd('0x68')](parseInt(_0x2e47a4['talktime'])*0x3e8)[_0x44dd('0x34')](_0x44dd('0x69'));}else if(_0x2e47a4['answertime']&&_0x2e47a4['endtime']){_0x6aebba[_0x44dd('0x67')]=moment[_0x44dd('0x68')](moment(_0x2e47a4[_0x44dd('0x6a')],_0x44dd('0x6b'))['diff'](moment(_0x2e47a4[_0x44dd('0x6c')],_0x44dd('0x6b'))))[_0x44dd('0x34')](_0x44dd('0x69'));}switch(_0x2e47a4[_0x44dd('0x6d')]){case _0x44dd('0x6e'):_0x6aebba[_0x44dd('0x6f')]=_0x44dd('0x70');break;case'complete':case _0x44dd('0x71'):_0x6aebba[_0x44dd('0x6f')]=_0x44dd('0x72');break;case'rejected':_0x6aebba[_0x44dd('0x6f')]='Rejected';break;case'abandoned':_0x6aebba[_0x44dd('0x6f')]=_0x44dd('0x73');break;case _0x44dd('0x74'):_0x6aebba[_0x44dd('0x6f')]='Timeout';default:}_0x6aebba[_0x44dd('0x75')]=(_0x5bbe8b===_0x44dd('0x76')?moment(_0x2e47a4[_0x44dd('0x6c')])['format'](_0x44dd('0x6b')):moment(_0x2e47a4['agentcalledAt'])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x44dd('0x34')](_0x44dd('0x6b'));_0x6aebba[_0x44dd('0x77')]=_0x5bbe8b||_0x44dd('0x78');_0x6aebba=_[_0x44dd('0x79')](_0x6aebba,getCustomFields(_0x440d82[_0x44dd('0x7a')],_0x2e47a4));return request({'method':_0x44dd('0x26'),'uri':_0x44dd('0x45')+_0x425a93+_0x44dd('0x7b'),'headers':{'Authorization':_0x44dd('0x4c')+_0x5a9412},'body':{'data':[_0x6aebba]},'json':!![]})[_0x44dd('0x2c')](function(_0x11d4ca){if(_0x11d4ca&&_0x11d4ca[_0x44dd('0x43')][0x0][_0x44dd('0x7c')]===_0x44dd('0x4d')){logger['info'](_0x44dd('0x7d'));return{'id':_0x11d4ca[_0x44dd('0x43')][0x0][_0x44dd('0x4e')]['id']};}})[_0x44dd('0x2e')](function(_0x32e09a){logger[_0x44dd('0x31')](_0x44dd('0x7e'),_0x32e09a[_0x44dd('0x30')]);console['log'](_0x44dd('0x7e'),_0x32e09a);});}exports[_0x44dd('0x7f')]=function(_0x283a80,_0x2d611a,_0x5a612c,_0x55a390,_0x231b94,_0x57ab93){var _0x9c5904,_0x40abf2,_0x56034a;_0x57ab93['host']=intUtil[_0x44dd('0x80')](_0x57ab93[_0x44dd('0x81')]);_0x57ab93[_0x44dd('0x82')]=intUtil[_0x44dd('0x80')](_0x57ab93[_0x44dd('0x82')]);if(_0x231b94&&_0x231b94[_0x44dd('0x83')]){logger[_0x44dd('0x31')](_0x44dd('0x84'),_0x44dd('0x85'));_0x2d611a[_0x44dd('0x86')]=_0x57ab93[_0x44dd('0x82')]+'/api/voice/recordings/'+_0x2d611a[_0x44dd('0x87')]+'/downloads?type=uniqueid&token='+md5(_0x2d611a[_0x44dd('0x87')]);}else{_0x2d611a[_0x44dd('0x86')]='';}var _0x27a818=_0x57ab93[_0x44dd('0x81')]===_0x44dd('0x88')?'eu':_0x44dd('0x89');return getAccessToken(_0x57ab93)[_0x44dd('0x2c')](function(_0x248f96){_0x56034a=_0x248f96;return getUser(_0x56034a,_0x27a818,_0x57ab93,_0x55a390['email']);})[_0x44dd('0x2c')](function(_0x1f3147){_0x9c5904=_0x1f3147;logger[_0x44dd('0x31')](_0x44dd('0x8a'),_0x9c5904['id']);return getEndUser(_0x56034a,_0x27a818,_0x57ab93,_0x2d611a[_0x44dd('0x8b')],_0x2d611a[_0x44dd('0x8c')],_0x9c5904,_0x5a612c);})[_0x44dd('0x2c')](function(_0x36e23c){_0x40abf2=_0x36e23c;return getCall(_0x56034a,_0x27a818,_0x57ab93,_0x9c5904,_0x40abf2,_0x5a612c,_0x2d611a,_0x44dd('0x78'));})[_0x44dd('0x2c')](function(_0x498722){if(_0x498722){logger[_0x44dd('0x31')]('The\x20Call\x20ID\x20is:',_0x498722['id']);logger['info'](_0x44dd('0x84'),_0x44dd('0x8d'));emit(util['format'](_0x44dd('0x8e'),_0x55a390[_0x44dd('0x19')]),_0x44dd('0x8f'),{'uri':_0x44dd('0x90')+_0x57ab93[_0x44dd('0x81')]+_0x44dd('0x91')+_0x498722['id']});}})[_0x44dd('0x2e')](function(_0x4d0953){logger['error'](_0x44dd('0x84'),JSON[_0x44dd('0x41')](_0x4d0953));});};exports[_0x44dd('0x76')]=function(_0x371561,_0x319b7c,_0x4bc5b5,_0x7e630e,_0x55c300,_0x47e9c5,_0x2cbf7b){var _0x5b74ec,_0xc230dc,_0x42a7eb;_0x47e9c5['host']=intUtil['stripTrailingSlash'](_0x47e9c5['host']);_0x47e9c5[_0x44dd('0x82')]=intUtil[_0x44dd('0x80')](_0x47e9c5[_0x44dd('0x82')]);if(_0x2cbf7b&&_0x2cbf7b['recordingFormat']&&_0x2cbf7b[_0x44dd('0x92')]!==_0x44dd('0x93')){logger['info'](_0x44dd('0x94'),'Recording\x20is\x20enabled!');_0x319b7c[_0x44dd('0x86')]=_0x47e9c5['serverUrl']+_0x44dd('0x95')+_0x319b7c[_0x44dd('0x87')]+_0x44dd('0x96')+md5(_0x319b7c[_0x44dd('0x87')]);}var _0x5ebda7=_0x47e9c5[_0x44dd('0x81')]===_0x44dd('0x88')?'eu':'com';return getAccessToken(_0x47e9c5)[_0x44dd('0x2c')](function(_0x25a676){_0x42a7eb=_0x25a676;return getUser(_0x42a7eb,_0x5ebda7,_0x47e9c5,_0x7e630e[_0x44dd('0x3a')]);})[_0x44dd('0x2c')](function(_0x44e358){_0x5b74ec=_0x44e358;logger[_0x44dd('0x31')](_0x44dd('0x8a'),_0x5b74ec['id']);return getEndUser(_0x42a7eb,_0x5ebda7,_0x47e9c5,_0x319b7c[_0x44dd('0x97')],_0x319b7c['destcalleridnum'],_0x5b74ec,_0x4bc5b5);})[_0x44dd('0x2c')](function(_0x1676f5){_0xc230dc=_0x1676f5;return getCall(_0x42a7eb,_0x5ebda7,_0x47e9c5,_0x5b74ec,_0xc230dc,_0x4bc5b5,_0x319b7c,_0x44dd('0x98'));})[_0x44dd('0x2c')](function(_0x3aea2e){if(_0x3aea2e){logger[_0x44dd('0x31')]('The\x20Call\x20ID\x20is:',_0x3aea2e['id']);logger[_0x44dd('0x31')](_0x44dd('0x94'),_0x44dd('0x8d'));emit(util[_0x44dd('0x34')](_0x44dd('0x8e'),_0x7e630e[_0x44dd('0x19')]),'trigger:browser:url',{'uri':_0x44dd('0x90')+_0x47e9c5[_0x44dd('0x81')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3aea2e['id']});}})[_0x44dd('0x2e')](function(_0x368a81){logger[_0x44dd('0x2f')]('[OUTBOUND]',JSON[_0x44dd('0x41')](_0x368a81));});};exports[_0x44dd('0x99')]=function(_0x10918d,_0x867d2d,_0x8f073b,_0x4310a8,_0x40ca41,_0x5dee94){var _0x1bed80,_0x5a75c9,_0x50f58a;_0x5dee94['host']=intUtil[_0x44dd('0x80')](_0x5dee94[_0x44dd('0x81')]);_0x5dee94['serverUrl']=intUtil[_0x44dd('0x80')](_0x5dee94['serverUrl']);if(_0x40ca41&&_0x40ca41[_0x44dd('0x83')]){logger['info']('['+_0x867d2d['lastevent']['toUpperCase']()+']',_0x44dd('0x85'));_0x867d2d[_0x44dd('0x86')]=_0x5dee94[_0x44dd('0x82')]+_0x44dd('0x95')+_0x867d2d[_0x44dd('0x87')]+'/downloads?type=uniqueid&token='+md5(_0x867d2d[_0x44dd('0x87')]);}else{_0x867d2d[_0x44dd('0x86')]='';}var _0x470e0d=_0x5dee94[_0x44dd('0x81')]===_0x44dd('0x88')?'eu':'com';return getAccessToken(_0x5dee94)[_0x44dd('0x2c')](function(_0x10a1b1){_0x50f58a=_0x10a1b1;return getUser(_0x50f58a,_0x470e0d,_0x5dee94);})[_0x44dd('0x2c')](function(_0x173c14){_0x1bed80=_0x173c14;logger[_0x44dd('0x31')]('The\x20User\x20ID\x20is:',_0x1bed80['id']);return getEndUser(_0x50f58a,_0x470e0d,_0x5dee94,_0x867d2d['calleridname'],_0x867d2d[_0x44dd('0x8c')],_0x1bed80,_0x8f073b);})[_0x44dd('0x2c')](function(_0x1dffe9){_0x5a75c9=_0x1dffe9;return getCall(_0x50f58a,_0x470e0d,_0x5dee94,_0x1bed80,_0x5a75c9,_0x8f073b,_0x867d2d,_0x44dd('0x78'));})[_0x44dd('0x2c')](function(_0x5bd4c7){if(_0x5bd4c7){logger[_0x44dd('0x31')](_0x44dd('0x9a'),_0x5bd4c7['id']);}})[_0x44dd('0x2e')](function(_0x25d952){logger[_0x44dd('0x2f')]('['+_0x867d2d['lastevent'][_0x44dd('0x9b')]()+']',JSON['stringify'](_0x25d952));});}; \ No newline at end of file +var _0xd66e=['calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','none','[OUTBOUND]','com','destcalleridname','https://crm.','unmanaged','lastevent','zoho.eu','request-promise','md5','util','./util','bluebird','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','seconds','catch','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','data','SUCCESS','details','Error:\x20','log','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','uri','lead','Leads','administrator','Subject','Subjects','Description','getString','Descriptions','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','connect','Answered','rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','The\x20User\x20ID\x20is:','calleridname'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0xd66e,0x1ce));var _0xed66=function(_0x3cf387,_0x31ed26){_0x3cf387=_0x3cf387-0x0;var _0x24425f=_0xd66e[_0x3cf387];return _0x24425f;};'use strict';var _=require('lodash');var rp=require(_0xed66('0x0'));var md5=require(_0xed66('0x1'));var util=require(_0xed66('0x2'));var intUtil=require(_0xed66('0x3'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0xed66('0x4'));var config=require(_0xed66('0x5'));var logger=require('../../../../config/logger')('zoho');config[_0xed66('0x6')]=_[_0xed66('0x7')](config[_0xed66('0x6')],{'host':_0xed66('0x8'),'port':0x18eb});var io=require(_0xed66('0x9'))(new Redis(config[_0xed66('0x6')]));function emit(_0x8ffae4,_0x2fd34b,_0x2cc575){io['to'](_0x8ffae4)[_0xed66('0xa')](_0x2fd34b,_0x2cc575);}function request(_0x352f93){logger['debug']('[HTTP]',JSON[_0xed66('0xb')](_0x352f93));return rp(_0x352f93);}function getCustomFields(_0x129296,_0x50604f){var _0xc6cb59={};if(_0x129296[_0xed66('0xc')]>0x0){_[_0xed66('0xd')](_0x129296,function(_0x2261a5){if(_[_0xed66('0xe')]([_0xed66('0xf'),_0xed66('0x10')],_0x2261a5[_0xed66('0x11')])&&_0x2261a5[_0xed66('0x12')]){_0xc6cb59[_0x2261a5[_0xed66('0x12')]]=_0x2261a5[_0xed66('0x13')][_0xed66('0x14')]();}else if(_0x2261a5[_0xed66('0x11')]===_0xed66('0x15')&&_0x2261a5[_0xed66('0x16')]&&_0x2261a5['idField']&&_0x50604f[_0x2261a5[_0xed66('0x16')]]){_0xc6cb59[_0x2261a5[_0xed66('0x12')]]=_0x50604f[_0x2261a5[_0xed66('0x16')]][_0xed66('0x14')]();}else if(_0x2261a5['type']===_0xed66('0x17')&&_0x2261a5['Variable']&&_0x2261a5[_0xed66('0x18')]['name']&&_0x2261a5[_0xed66('0x12')]&&_0x50604f[_0x2261a5[_0xed66('0x18')][_0xed66('0x19')][_0xed66('0x1a')]()]){_0xc6cb59[_0x2261a5[_0xed66('0x12')]]=_0x50604f[_0x2261a5[_0xed66('0x18')][_0xed66('0x19')][_0xed66('0x1a')]()]['toString']();}});}return _0xc6cb59;}function getName(_0x44d96c){if(_0x44d96c[_0xed66('0x1b')]('\x20')>0x0){var _0x5c8988=_0x44d96c[_0xed66('0x1c')](/ (.+)/);if(_0x5c8988[0x1]){return _0x5c8988;}}return[_0x44d96c,_0x44d96c];}var accountsTokens={};function getAccessToken(_0x2cb624){return new Promise(function(_0x1360b2,_0x1269a0){if(!_[_0xed66('0x1d')](accountsTokens[_0x2cb624['id']])&&!_[_0xed66('0x1d')](accountsTokens[_0x2cb624['id']]['access_token'])){if(moment()[_0xed66('0x1e')](accountsTokens[_0x2cb624['id']][_0xed66('0x1f')])){_0x1360b2(accountsTokens[_0x2cb624['id']][_0xed66('0x20')]);}}var _0x75a597;switch(_0x2cb624[_0xed66('0x21')]){case'US':_0x75a597='https://accounts.zoho.com';break;case'AU':_0x75a597=_0xed66('0x22');break;case'EU':_0x75a597='https://accounts.zoho.eu';break;case'IN':_0x75a597='https://accounts.zoho.in';break;case'CN':_0x75a597=_0xed66('0x23');break;default:_0x75a597=_0xed66('0x24');break;}var _0x2076f4={'method':'POST','uri':_0x75a597+_0xed66('0x25'),'qs':{'refresh_token':_0x2cb624['refreshToken'],'client_id':_0x2cb624[_0xed66('0x26')],'client_secret':_0x2cb624[_0xed66('0x27')],'grant_type':_0xed66('0x28')},'json':!![]};return rp(_0x2076f4)[_0xed66('0x29')](function(_0x5aeae9){accountsTokens[_0x2cb624['id']]={'access_token':_0x5aeae9[_0xed66('0x20')],'expires_in':moment()[_0xed66('0x2a')](_0x5aeae9['expires_in'],_0xed66('0x2b'))};_0x1360b2(_0x5aeae9[_0xed66('0x20')]);})[_0xed66('0x2c')](function(_0x57334f){logger['error']('Failing\x20creating\x20the\x20access_token',_0x57334f[_0xed66('0x2d')]);_0x1269a0(_0x57334f);});});}function getUser(_0x5e5f27,_0x25a24e,_0x242a74,_0x5a41dd){logger[_0xed66('0x2e')]('Search\x20user');return request({'method':_0xed66('0x2f'),'uri':util[_0xed66('0x30')](_0xed66('0x31'),_0x25a24e),'qs':{'type':_0xed66('0x32')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5e5f27},'json':!![]})[_0xed66('0x29')](function(_0x4c82ce){if(_0x4c82ce[_0xed66('0x33')]){var _0x49690c=-0x1;if(_[_0xed66('0x34')](_0x4c82ce[_0xed66('0x33')])){if(!_['isNil'](_0x5a41dd)){_0x49690c=_[_0xed66('0x35')](_0x4c82ce[_0xed66('0x33')],function(_0x41b20d){return _0x41b20d[_0xed66('0x36')]===_0x5a41dd;});}if(_0x49690c>=0x0){logger[_0xed66('0x2e')](_0xed66('0x37'));}else{logger['info'](_0xed66('0x38'));_0x49690c=_[_0xed66('0x35')](_0x4c82ce['users'],function(_0x1ccb5f){return _0x1ccb5f[_0xed66('0x39')][_0xed66('0x19')]===_0xed66('0x3a');});}return _0x4c82ce[_0xed66('0x33')][_0x49690c];}else{if(_0x4c82ce['user'][_0xed66('0x39')]['name']===_0xed66('0x3a')){logger[_0xed66('0x2e')](_0xed66('0x38'));user=_0x4c82ce[_0xed66('0x3b')];return user;}else{logger[_0xed66('0x3c')](_0xed66('0x3d'),JSON[_0xed66('0xb')](_0x4c82ce));throw new Error(_0xed66('0x3e')+JSON['stringify'](_0x4c82ce));}}}else{logger[_0xed66('0x3c')](_0xed66('0x3d'),JSON[_0xed66('0xb')](_0x4c82ce));throw new Error(_0xed66('0x3e')+JSON['stringify'](_0x4c82ce));}})[_0xed66('0x2c')](function(_0x2ac87b){console[_0xed66('0x3c')](_0x2ac87b);});}function getZohoUser(_0xa4d6dc,_0x590671){return new BPromise(function(_0x4e9691,_0x32a4b9){request(_0xa4d6dc)[_0xed66('0x29')](function(_0x51fd0c){var _0x4b4e13=null;if(_0x51fd0c){_0x4b4e13=_0x51fd0c['data'][0x0];_0x4b4e13[_0xed66('0x3f')]=_0x590671;}_0x4e9691(_0x4b4e13);})[_0xed66('0x2c')](function(_0x6e56d4){_0x32a4b9(_0x6e56d4);});});}function createEndUser(_0x4c54b2,_0xd8531,_0x12abcb,_0x32588c,_0x2bd26e,_0x227b3e){var _0x12abcb=getName(_0x12abcb);return request({'method':_0xed66('0x40'),'uri':_0xed66('0x41')+_0xd8531+_0xed66('0x42')+_[_0xed66('0x43')](_0x227b3e[_0xed66('0x44')])+'s','body':{'data':[{'Last_Name':_0x12abcb[0x1],'First_Name':_0x12abcb[0x0],'Phone':_0x32588c,'Owner':{'name':!_[_0xed66('0x1d')](_0x2bd26e['role'][_0xed66('0x19')])?_0x2bd26e[_0xed66('0x45')][_0xed66('0x19')]:!_[_0xed66('0x1d')](_0x2bd26e[_0xed66('0x46')])?_0x2bd26e[_0xed66('0x46')]+'\x20'+_0x2bd26e[_0xed66('0x47')]:_0x2bd26e[_0xed66('0x47')],'id':_0x2bd26e['id']}}]},'headers':{'Authorization':_0xed66('0x48')+_0x4c54b2},'json':!![]})['then'](function(_0x524eda){if(_0x524eda&&_0x524eda[_0xed66('0x49')][0x0]['code']===_0xed66('0x4a')){var _0x125d6f=_0x524eda[_0xed66('0x49')][0x0][_0xed66('0x4b')];_0x125d6f[_0xed66('0x3f')]=_[_0xed66('0x43')](_0x227b3e[_0xed66('0x44')])+'s';return _0x125d6f;}logger[_0xed66('0x3c')](_0xed66('0x3d'),JSON[_0xed66('0xb')](data));throw new Error(_0xed66('0x4c')+JSON[_0xed66('0xb')](data));})['catch'](function(_0x9b969a){console[_0xed66('0x4d')]('CREATE\x20ERROR',_0x9b969a);});}function getEndUser(_0xfd0f7f,_0x8b2edf,_0x3ed28d,_0x449a99,_0x17bf05,_0x545eea,_0x41e016){var _0x4d813d={'method':_0xed66('0x2f'),'uri':'','headers':{'Authorization':_0xed66('0x48')+_0xfd0f7f},'json':!![]};switch(_0x41e016['moduleSearch']){case _0xed66('0x4e'):_0x4d813d['uri']=_0xed66('0x41')+_0x8b2edf+_0xed66('0x4f')+_0x17bf05+'))';return getZohoUser(_0x4d813d,_0xed66('0x50'))[_0xed66('0x29')](function(_0x573eab){if(_0x573eab)return _0x573eab;_0x4d813d['uri']=_0xed66('0x41')+_0x8b2edf+_0xed66('0x51')+_0x17bf05+'))';return getZohoUser(_0x4d813d,'Leads')[_0xed66('0x29')](function(_0x4f23a7){if(_0x4f23a7)return _0x4f23a7;if(_0x41e016['moduleCreate']!=_0xed66('0x52')){return createEndUser(_0xfd0f7f,_0x8b2edf,_0x449a99,_0x17bf05,_0x545eea,_0x41e016);}else{return{};}});});break;case _0xed66('0x53'):_0x4d813d[_0xed66('0x54')]='https://www.zohoapis.'+_0x8b2edf+_0xed66('0x4f')+_0x17bf05+'))';return getZohoUser(_0x4d813d,'Contacts')[_0xed66('0x29')](function(_0x3f4989){if(_0x3f4989)return _0x3f4989;if(_0x41e016[_0xed66('0x44')]!=_0xed66('0x52')){return createEndUser(_0xfd0f7f,_0x8b2edf,_0x449a99,_0x17bf05,_0x545eea,_0x41e016);}else{return{};}});break;case _0xed66('0x55'):_0x4d813d[_0xed66('0x54')]=_0xed66('0x41')+_0x8b2edf+_0xed66('0x51')+_0x17bf05+'))';return getZohoUser(_0x4d813d,_0xed66('0x56'))['then'](function(_0x1e465e){if(_0x1e465e)return _0x1e465e;if(_0x41e016[_0xed66('0x44')]!=_0xed66('0x52')){return createEndUser(_0xfd0f7f,_0x8b2edf,_0x449a99,_0x17bf05,_0x545eea,_0x41e016);}else{return{};}});break;}}function getCall(_0x10f220,_0x4f2da8,_0xc097f1,_0x39c94e,_0x43733c,_0x38e7c4,_0x38eeec,_0x5cbbfc){logger[_0xed66('0x2e')]('Creating\x20new\x20call...');var _0x35f543={};_0x35f543['Owner']={'name':!_[_0xed66('0x1d')](_0x39c94e[_0xed66('0x45')][_0xed66('0x19')])&&!_[_0xed66('0x1d')](_0x39c94e['profile'][_0xed66('0x19')])&&_0x39c94e[_0xed66('0x39')]['name']===_0xed66('0x57')?_0x39c94e[_0xed66('0x45')][_0xed66('0x19')]:!_[_0xed66('0x1d')](_0x39c94e['first_name'])?_0x39c94e[_0xed66('0x46')]+'\x20'+_0x39c94e['last_name']:_0x39c94e[_0xed66('0x47')],'id':_0x39c94e['id']};_0x35f543[_0xed66('0x58')]=intUtil['getString'](_0x38e7c4[_0xed66('0x59')],_0x38eeec,'\x20');_0x35f543[_0xed66('0x5a')]=intUtil[_0xed66('0x5b')](_0x38e7c4[_0xed66('0x5c')],_0x38eeec,'\x0a');if(_0x43733c[_0xed66('0x3f')]==='Contacts'){_0x35f543['Who_Id']={'name':!_[_0xed66('0x1d')](_0x43733c[_0xed66('0x5d')])?_0x43733c[_0xed66('0x5d')]:!_[_0xed66('0x1d')](_0x43733c['First_Name'])?_0x43733c[_0xed66('0x5e')]+'\x20'+_0x43733c[_0xed66('0x5f')]:_0x43733c[_0xed66('0x5f')],'id':_0x43733c['id']};}if(_0x43733c['enduserType']===_0xed66('0x56')){_0x35f543['What_Id']={'name':!_['isNil'](_0x43733c[_0xed66('0x5d')])?_0x43733c[_0xed66('0x5d')]:!_[_0xed66('0x1d')](_0x43733c[_0xed66('0x5e')])?_0x43733c[_0xed66('0x5e')]+'\x20'+_0x43733c[_0xed66('0x5f')]:_0x43733c['Last_Name'],'id':_0x43733c['id']};_0x35f543[_0xed66('0x60')]=_[_0xed66('0x43')](_0x43733c['enduserType']);}if(_0x38eeec[_0xed66('0x61')]){_0x35f543[_0xed66('0x62')]=moment['utc'](parseInt(_0x38eeec[_0xed66('0x61')])*0x3e8)['format'](_0xed66('0x63'));}else if(_0x38eeec[_0xed66('0x64')]&&_0x38eeec[_0xed66('0x65')]){_0x35f543[_0xed66('0x62')]=moment['utc'](moment(_0x38eeec[_0xed66('0x65')],_0xed66('0x66'))[_0xed66('0x67')](moment(_0x38eeec[_0xed66('0x68')],_0xed66('0x66'))))[_0xed66('0x30')]('mm:ss');}switch(_0x38eeec['lastevent']){case _0xed66('0x69'):_0x35f543[_0xed66('0x6a')]=_0xed66('0x6b');break;case'complete':case _0xed66('0x6c'):_0x35f543[_0xed66('0x6a')]=_0xed66('0x6d');break;case _0xed66('0x6e'):_0x35f543['Call_Result']='Rejected';break;case _0xed66('0x6f'):_0x35f543[_0xed66('0x6a')]='Abandoned';break;case _0xed66('0x70'):_0x35f543[_0xed66('0x6a')]=_0xed66('0x71');default:}_0x35f543[_0xed66('0x72')]=(_0x5cbbfc===_0xed66('0x73')?moment(_0x38eeec[_0xed66('0x68')])[_0xed66('0x30')](_0xed66('0x66')):moment(_0x38eeec['agentcalledAt'])[_0xed66('0x30')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xed66('0x30')]('YYYY-MM-DDTHH:mm:ss');_0x35f543[_0xed66('0x74')]=_0x5cbbfc||_0xed66('0x75');_0x35f543=_[_0xed66('0x76')](_0x35f543,getCustomFields(_0x38e7c4[_0xed66('0x77')],_0x38eeec));return request({'method':_0xed66('0x40'),'uri':_0xed66('0x41')+_0x4f2da8+_0xed66('0x78'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x10f220},'body':{'data':[_0x35f543]},'json':!![]})[_0xed66('0x29')](function(_0x2b15d1){if(_0x2b15d1&&_0x2b15d1['data'][0x0]['code']===_0xed66('0x4a')){logger[_0xed66('0x2e')]('Call\x20created!');return{'id':_0x2b15d1[_0xed66('0x49')][0x0]['details']['id']};}})[_0xed66('0x2c')](function(_0x3fee07){logger[_0xed66('0x2e')](_0xed66('0x79'),_0x3fee07[_0xed66('0x2d')]);console[_0xed66('0x4d')](_0xed66('0x79'),_0x3fee07);});}exports[_0xed66('0x7a')]=function(_0x1a3f4b,_0x1e5362,_0x20183b,_0x4716b5,_0x128f24,_0x22450d){var _0x37d27d,_0x5ab422,_0x3f9d5a;_0x22450d[_0xed66('0x7b')]=intUtil[_0xed66('0x7c')](_0x22450d[_0xed66('0x7b')]);_0x22450d['serverUrl']=intUtil['stripTrailingSlash'](_0x22450d[_0xed66('0x7d')]);if(_0x128f24&&_0x128f24[_0xed66('0x7e')]){logger['info']('[QUEUE]',_0xed66('0x7f'));_0x1e5362[_0xed66('0x80')]=_0x22450d[_0xed66('0x7d')]+_0xed66('0x81')+_0x1e5362[_0xed66('0x82')]+_0xed66('0x83')+md5(_0x1e5362[_0xed66('0x82')]);}else{_0x1e5362[_0xed66('0x80')]='';}var _0x147e89=_0x22450d[_0xed66('0x7b')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x22450d)[_0xed66('0x29')](function(_0x203dba){_0x3f9d5a=_0x203dba;return getUser(_0x3f9d5a,_0x147e89,_0x22450d,_0x4716b5[_0xed66('0x36')]);})['then'](function(_0xdb5556){_0x37d27d=_0xdb5556;logger[_0xed66('0x2e')](_0xed66('0x84'),_0x37d27d['id']);return getEndUser(_0x3f9d5a,_0x147e89,_0x22450d,_0x1e5362[_0xed66('0x85')],_0x1e5362[_0xed66('0x86')],_0x37d27d,_0x20183b);})[_0xed66('0x29')](function(_0x59089c){_0x5ab422=_0x59089c;return getCall(_0x3f9d5a,_0x147e89,_0x22450d,_0x37d27d,_0x5ab422,_0x20183b,_0x1e5362,_0xed66('0x75'));})[_0xed66('0x29')](function(_0x5c43ea){if(_0x5c43ea){logger[_0xed66('0x2e')](_0xed66('0x87'),_0x5c43ea['id']);logger[_0xed66('0x2e')](_0xed66('0x88'),_0xed66('0x89'));emit(util['format'](_0xed66('0x8a'),_0x4716b5[_0xed66('0x19')]),_0xed66('0x8b'),{'uri':'https://crm.'+_0x22450d[_0xed66('0x7b')]+_0xed66('0x8c')+_0x5c43ea['id']});}})['catch'](function(_0x2951fb){logger[_0xed66('0x3c')](_0xed66('0x88'),JSON[_0xed66('0xb')](_0x2951fb));});};exports[_0xed66('0x73')]=function(_0x124c7c,_0x939dd,_0x306845,_0x501896,_0x1d61dc,_0x1739c4,_0xb2f644){var _0x49c314,_0x1ea139,_0x30ca87;_0x1739c4[_0xed66('0x7b')]=intUtil[_0xed66('0x7c')](_0x1739c4[_0xed66('0x7b')]);_0x1739c4[_0xed66('0x7d')]=intUtil[_0xed66('0x7c')](_0x1739c4[_0xed66('0x7d')]);if(_0xb2f644&&_0xb2f644['recordingFormat']&&_0xb2f644['recordingFormat']!==_0xed66('0x8d')){logger[_0xed66('0x2e')](_0xed66('0x8e'),'Recording\x20is\x20enabled!');_0x939dd['recordingURL']=_0x1739c4['serverUrl']+'/api/voice/recordings/'+_0x939dd[_0xed66('0x82')]+_0xed66('0x83')+md5(_0x939dd['uniqueid']);}var _0xcf163=_0x1739c4[_0xed66('0x7b')]==='zoho.eu'?'eu':_0xed66('0x8f');return getAccessToken(_0x1739c4)[_0xed66('0x29')](function(_0x3d8021){_0x30ca87=_0x3d8021;return getUser(_0x30ca87,_0xcf163,_0x1739c4,_0x501896['email']);})['then'](function(_0xd07e1b){_0x49c314=_0xd07e1b;logger['info']('The\x20User\x20ID\x20is:',_0x49c314['id']);return getEndUser(_0x30ca87,_0xcf163,_0x1739c4,_0x939dd[_0xed66('0x90')],_0x939dd['destcalleridnum'],_0x49c314,_0x306845);})[_0xed66('0x29')](function(_0x2a6af4){_0x1ea139=_0x2a6af4;return getCall(_0x30ca87,_0xcf163,_0x1739c4,_0x49c314,_0x1ea139,_0x306845,_0x939dd,'Outbound');})[_0xed66('0x29')](function(_0x342521){if(_0x342521){logger[_0xed66('0x2e')]('The\x20Call\x20ID\x20is:',_0x342521['id']);logger['info'](_0xed66('0x8e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xed66('0x30')]('user:%s',_0x501896['name']),'trigger:browser:url',{'uri':_0xed66('0x91')+_0x1739c4[_0xed66('0x7b')]+_0xed66('0x8c')+_0x342521['id']});}})[_0xed66('0x2c')](function(_0x43775d){logger['error'](_0xed66('0x8e'),JSON['stringify'](_0x43775d));});};exports[_0xed66('0x92')]=function(_0x44118a,_0x480226,_0x5159dd,_0x374c10,_0x1c09ba,_0x4840bd){var _0x4156e2,_0x4ff589,_0x221e1e;_0x4840bd[_0xed66('0x7b')]=intUtil[_0xed66('0x7c')](_0x4840bd[_0xed66('0x7b')]);_0x4840bd['serverUrl']=intUtil[_0xed66('0x7c')](_0x4840bd[_0xed66('0x7d')]);if(_0x1c09ba&&_0x1c09ba['monitor_format']){logger[_0xed66('0x2e')]('['+_0x480226[_0xed66('0x93')]['toUpperCase']()+']',_0xed66('0x7f'));_0x480226['recordingURL']=_0x4840bd[_0xed66('0x7d')]+'/api/voice/recordings/'+_0x480226[_0xed66('0x82')]+_0xed66('0x83')+md5(_0x480226[_0xed66('0x82')]);}else{_0x480226[_0xed66('0x80')]='';}var _0xe24c09=_0x4840bd['host']===_0xed66('0x94')?'eu':'com';return getAccessToken(_0x4840bd)['then'](function(_0x377e5c){_0x221e1e=_0x377e5c;return getUser(_0x221e1e,_0xe24c09,_0x4840bd);})['then'](function(_0x3a5944){_0x4156e2=_0x3a5944;logger[_0xed66('0x2e')]('The\x20User\x20ID\x20is:',_0x4156e2['id']);return getEndUser(_0x221e1e,_0xe24c09,_0x4840bd,_0x480226[_0xed66('0x85')],_0x480226[_0xed66('0x86')],_0x4156e2,_0x5159dd);})[_0xed66('0x29')](function(_0x56dce9){_0x4ff589=_0x56dce9;return getCall(_0x221e1e,_0xe24c09,_0x4840bd,_0x4156e2,_0x4ff589,_0x5159dd,_0x480226,_0xed66('0x75'));})['then'](function(_0x2b2706){if(_0x2b2706){logger[_0xed66('0x2e')]('The\x20Call\x20ID\x20is:',_0x2b2706['id']);}})[_0xed66('0x2c')](function(_0x588cf4){logger[_0xed66('0x3c')]('['+_0x480226[_0xed66('0x93')]['toUpperCase']()+']',JSON['stringify'](_0x588cf4));});}; \ 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 f81e90b..51614d5 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 _0x9738=['data2','data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','exec'];(function(_0x3b821c,_0x215154){var _0x8238f0=function(_0x20e119){while(--_0x20e119){_0x3b821c['push'](_0x3b821c['shift']());}};_0x8238f0(++_0x215154);}(_0x9738,0x1a9));var _0x8973=function(_0x3d4042,_0xfedb57){_0x3d4042=_0x3d4042-0x0;var _0x510210=_0x9738[_0x3d4042];return _0x510210;};'use strict';var util=require('util');var sh=require(_0x8973('0x0'));var Mustache=require(_0x8973('0x1'));var logger=require(_0x8973('0x2'))('trigger');exports[_0x8973('0x3')]=function(_0x2c1125,_0x589ae2){var _0x14950f=_0x2c1125[_0x8973('0x4')]?_0x2c1125['data2']:'Script';var _0x29bafc=_0x2c1125[_0x8973('0x5')]?Mustache[_0x8973('0x6')](_0x2c1125['data3'],_0x589ae2):_0x589ae2;sh[_0x8973('0x3')](_0x29bafc,function(_0x10f7ee,_0x5346c3,_0x317c7e){if(_0x10f7ee!==0x0){logger['error'](util[_0x8973('0x7')](_0x8973('0x8'),_0x14950f,_0x29bafc,_0x10f7ee,_0x317c7e));}else{logger[_0x8973('0x9')](util[_0x8973('0x7')](_0x8973('0xa'),_0x14950f,_0x29bafc,_0x5346c3));}});}; \ No newline at end of file +var _0x2343=['mustache','../../../../config/logger','trigger','exec','data2','Script','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x183a5b,_0x1fe225){var _0x2e057a=function(_0x1e65d1){while(--_0x1e65d1){_0x183a5b['push'](_0x183a5b['shift']());}};_0x2e057a(++_0x1fe225);}(_0x2343,0x6e));var _0x3234=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x2343[_0xd1c39b];return _0x58f5bc;};'use strict';var util=require(_0x3234('0x0'));var sh=require(_0x3234('0x1'));var Mustache=require(_0x3234('0x2'));var logger=require(_0x3234('0x3'))(_0x3234('0x4'));exports[_0x3234('0x5')]=function(_0x1b15fa,_0x4d5780){var _0x50542e=_0x1b15fa[_0x3234('0x6')]?_0x1b15fa[_0x3234('0x6')]:_0x3234('0x7');var _0x1ca31b=_0x1b15fa[_0x3234('0x8')]?Mustache['render'](_0x1b15fa[_0x3234('0x8')],_0x4d5780):_0x4d5780;sh['exec'](_0x1ca31b,function(_0x5cae5e,_0x3ff7ee,_0x8a97eb){if(_0x5cae5e!==0x0){logger[_0x3234('0x9')](util[_0x3234('0xa')](_0x3234('0xb'),_0x50542e,_0x1ca31b,_0x5cae5e,_0x8a97eb));}else{logger[_0x3234('0xc')](util[_0x3234('0xa')](_0x3234('0xd'),_0x50542e,_0x1ca31b,_0x3ff7ee));}});}; \ 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 7e56785..9668601 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 _0x4a73=['DELETE','POST','PUT','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data5','headers','data6','parse','error','GET'];(function(_0x56de1f,_0xd5887){var _0x58487b=function(_0x137cc8){while(--_0x137cc8){_0x56de1f['push'](_0x56de1f['shift']());}};_0x58487b(++_0xd5887);}(_0x4a73,0x1a3));var _0x34a7=function(_0x1b079b,_0x4157a5){_0x1b079b=_0x1b079b-0x0;var _0x1898d7=_0x4a73[_0x1b079b];return _0x1898d7;};'use strict';var rp=require(_0x34a7('0x0'));var util=require(_0x34a7('0x1'));var _=require(_0x34a7('0x2'));var Mustache=require(_0x34a7('0x3'));var logger=require(_0x34a7('0x4'))(_0x34a7('0x5'));exports['exec']=function(_0x2a46b6,_0x238298){var _0x5661ce,_0x49b98b;var _0x3ef54b={'method':_0x2a46b6[_0x34a7('0x6')][_0x34a7('0x7')](),'uri':Mustache[_0x34a7('0x8')](_0x2a46b6['data2'],_0x238298),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2a46b6[_0x34a7('0x9')])==='number'&&parseInt(_0x2a46b6[_0x34a7('0x9')])>=0x1&&parseInt(_0x2a46b6[_0x34a7('0x9')])<=0xa?parseInt(_0x2a46b6[_0x34a7('0x9')])*0x3e8:0x5*0x3e8};try{_0x3ef54b[_0x34a7('0xa')]=_0x2a46b6[_0x34a7('0xb')]?JSON[_0x34a7('0xc')](Mustache['render'](_0x2a46b6[_0x34a7('0xb')],_0x238298)):{};}catch(_0x182dc0){logger[_0x34a7('0xd')](_0x182dc0['stack']);}switch(_0x2a46b6[_0x34a7('0x6')][_0x34a7('0x7')]()){case _0x34a7('0xe'):case _0x34a7('0xf'):_0x5661ce=null;_0x3ef54b['qs']=_0x238298;break;case _0x34a7('0x10'):case _0x34a7('0x11'):if(_0x2a46b6['data7']){try{_0x5661ce=JSON['parse'](Mustache[_0x34a7('0x8')](_0x2a46b6['data7'],_0x238298));_0x3ef54b[_0x34a7('0x12')]=_0x5661ce;}catch(_0x2a7c85){logger[_0x34a7('0xd')](_0x2a7c85['stack']);logger[_0x34a7('0xd')](_0x34a7('0x13'));}}else{_0x5661ce=_0x238298;_0x3ef54b[_0x34a7('0x12')]=_0x5661ce;}break;}logger['info'](util['format'](_0x34a7('0x14'),_0x2a46b6[_0x34a7('0x6')],_0x2a46b6['data2'],JSON[_0x34a7('0x15')](_0x3ef54b)));rp(_0x3ef54b)[_0x34a7('0x16')](function(_0x2f00d2){_0x5661ce=!_['isNil'](_0x5661ce)?',\x20request\x20body:\x20'+_0x5661ce:'';_0x49b98b=typeof _0x2f00d2[_0x34a7('0x12')]==='object'?JSON[_0x34a7('0x15')](_0x2f00d2[_0x34a7('0x12')]):_0x2f00d2['body'];logger[_0x34a7('0x17')](util[_0x34a7('0x18')](_0x34a7('0x19'),_0x2a46b6[_0x34a7('0x6')],_0x2a46b6[_0x34a7('0x1a')],_0x2f00d2[_0x34a7('0x1b')],_0x49b98b));})['catch'](function(_0x4e2cb3){logger[_0x34a7('0xd')](util[_0x34a7('0x18')](_0x34a7('0x1c'),_0x2a46b6[_0x34a7('0x6')],_0x2a46b6['data2'],_0x4e2cb3['statusCode'],_0x4e2cb3[_0x34a7('0x1d')],_0x4e2cb3[_0x34a7('0x1e')]));});}; \ No newline at end of file +var _0xf144=['number','headers','data6','parse','error','stack','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','object','statusCode','util','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5'];(function(_0x331604,_0x55d55c){var _0x4368c1=function(_0x175f61){while(--_0x175f61){_0x331604['push'](_0x331604['shift']());}};_0x4368c1(++_0x55d55c);}(_0xf144,0x87));var _0x4f14=function(_0x385713,_0xbe2a41){_0x385713=_0x385713-0x0;var _0x619260=_0xf144[_0x385713];return _0x619260;};'use strict';var rp=require('request-promise');var util=require(_0x4f14('0x0'));var _=require('lodash');var Mustache=require(_0x4f14('0x1'));var logger=require(_0x4f14('0x2'))(_0x4f14('0x3'));exports[_0x4f14('0x4')]=function(_0x2aee51,_0x73f79a){var _0x513d95,_0xa46f61;var _0x72d923={'method':_0x2aee51[_0x4f14('0x5')][_0x4f14('0x6')](),'uri':Mustache[_0x4f14('0x7')](_0x2aee51[_0x4f14('0x8')],_0x73f79a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2aee51[_0x4f14('0x9')])===_0x4f14('0xa')&&parseInt(_0x2aee51[_0x4f14('0x9')])>=0x1&&parseInt(_0x2aee51[_0x4f14('0x9')])<=0xa?parseInt(_0x2aee51[_0x4f14('0x9')])*0x3e8:0x5*0x3e8};try{_0x72d923[_0x4f14('0xb')]=_0x2aee51[_0x4f14('0xc')]?JSON[_0x4f14('0xd')](Mustache[_0x4f14('0x7')](_0x2aee51[_0x4f14('0xc')],_0x73f79a)):{};}catch(_0x455131){logger[_0x4f14('0xe')](_0x455131[_0x4f14('0xf')]);}switch(_0x2aee51['data1']['toUpperCase']()){case'GET':case _0x4f14('0x10'):_0x513d95=null;_0x72d923['qs']=_0x73f79a;break;case _0x4f14('0x11'):case _0x4f14('0x12'):if(_0x2aee51[_0x4f14('0x13')]){try{_0x513d95=JSON[_0x4f14('0xd')](Mustache[_0x4f14('0x7')](_0x2aee51[_0x4f14('0x13')],_0x73f79a));_0x72d923[_0x4f14('0x14')]=_0x513d95;}catch(_0x4a7619){logger[_0x4f14('0xe')](_0x4a7619[_0x4f14('0xf')]);logger[_0x4f14('0xe')](_0x4f14('0x15'));}}else{_0x513d95=_0x73f79a;_0x72d923[_0x4f14('0x14')]=_0x513d95;}break;}logger[_0x4f14('0x16')](util[_0x4f14('0x17')](_0x4f14('0x18'),_0x2aee51[_0x4f14('0x5')],_0x2aee51[_0x4f14('0x8')],JSON[_0x4f14('0x19')](_0x72d923)));rp(_0x72d923)[_0x4f14('0x1a')](function(_0x40ea00){_0x513d95=!_['isNil'](_0x513d95)?',\x20request\x20body:\x20'+_0x513d95:'';_0xa46f61=typeof _0x40ea00[_0x4f14('0x14')]===_0x4f14('0x1b')?JSON['stringify'](_0x40ea00[_0x4f14('0x14')]):_0x40ea00[_0x4f14('0x14')];logger[_0x4f14('0x16')](util[_0x4f14('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x2aee51[_0x4f14('0x5')],_0x2aee51[_0x4f14('0x8')],_0x40ea00['statusCode'],_0xa46f61));})['catch'](function(_0x455414){logger['error'](util[_0x4f14('0x17')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x2aee51[_0x4f14('0x5')],_0x2aee51['data2'],_0x455414[_0x4f14('0x1c')],_0x455414['name'],_0x455414['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 9dcf4dd..8ce03be 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 _0x9344=['error','message','result','catch','exports','jayson/promise','bluebird','routing','client','http','Request','request','then','debug','rpc'];(function(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0x9344,0xd7));var _0x4934=function(_0x405f28,_0x3ea99f){_0x405f28=_0x405f28-0x0;var _0x1a6075=_0x9344[_0x405f28];return _0x1a6075;};'use strict';var jayson=require(_0x4934('0x0'));var BPromise=require(_0x4934('0x1'));var logger=require('../../config/logger')(_0x4934('0x2'));var client=jayson[_0x4934('0x3')][_0x4934('0x4')]({'port':0x2329});client[_0x4934('0x5')]=function(_0x4a3e0a,_0x1ec6c5){return new BPromise(function(_0x591828,_0x25c635){return client[_0x4934('0x6')](_0x4a3e0a,_0x1ec6c5)[_0x4934('0x7')](function(_0xf09b41){logger[_0x4934('0x8')](_0x4934('0x9'),_0x4934('0x2'),_0x4a3e0a,_0x1ec6c5,_0xf09b41);if(_0xf09b41[_0x4934('0xa')]){logger[_0x4934('0xa')](_0x4934('0x9'),_0x4934('0x2'),_0x4a3e0a,_0xf09b41[_0x4934('0xa')][_0x4934('0xb')],_0x1ec6c5);return _0x25c635(_0xf09b41[_0x4934('0xa')][_0x4934('0xb')]);}else{return _0x591828(_0xf09b41[_0x4934('0xc')]);}})[_0x4934('0xd')](function(_0x27fb59){logger[_0x4934('0xa')](_0x4934('0x9'),_0x4934('0x2'),_0x4a3e0a,_0x27fb59,_0x1ec6c5);return _0x25c635(_0x27fb59);});});};module[_0x4934('0xe')]=client; \ No newline at end of file +var _0x6b66=['catch','exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','result'];(function(_0x4f54cc,_0x2ea830){var _0x491a99=function(_0x43d6ca){while(--_0x43d6ca){_0x4f54cc['push'](_0x4f54cc['shift']());}};_0x491a99(++_0x2ea830);}(_0x6b66,0x110));var _0x66b6=function(_0x3a3e67,_0x5f428d){_0x3a3e67=_0x3a3e67-0x0;var _0x3d8e72=_0x6b66[_0x3a3e67];return _0x3d8e72;};'use strict';var jayson=require(_0x66b6('0x0'));var BPromise=require('bluebird');var logger=require(_0x66b6('0x1'))(_0x66b6('0x2'));var client=jayson[_0x66b6('0x3')][_0x66b6('0x4')]({'port':0x2329});client[_0x66b6('0x5')]=function(_0x136c9b,_0x6d9180){return new BPromise(function(_0x40d422,_0x19e022){return client[_0x66b6('0x6')](_0x136c9b,_0x6d9180)[_0x66b6('0x7')](function(_0x1d5fc3){logger[_0x66b6('0x8')](_0x66b6('0x9'),'routing',_0x136c9b,_0x6d9180,_0x1d5fc3);if(_0x1d5fc3['error']){logger['error'](_0x66b6('0x9'),'routing',_0x136c9b,_0x1d5fc3[_0x66b6('0xa')][_0x66b6('0xb')],_0x6d9180);return _0x19e022(_0x1d5fc3['error'][_0x66b6('0xb')]);}else{return _0x40d422(_0x1d5fc3[_0x66b6('0xc')]);}})[_0x66b6('0xd')](function(_0x51487a){logger['error'](_0x66b6('0x9'),_0x66b6('0x2'),_0x136c9b,_0x51487a,_0x6d9180);return _0x19e022(_0x51487a);});});};module[_0x66b6('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 479d157..b4c5c6a 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 _0xdb64=['refresh','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./lib/email','./rpc/mailAccount','email','then','getMailAccounts','initMailAccounts'];(function(_0x88d3a,_0x5541d5){var _0x549872=function(_0x129617){while(--_0x129617){_0x88d3a['push'](_0x88d3a['shift']());}};_0x549872(++_0x5541d5);}(_0xdb64,0x173));var _0x4db6=function(_0x59ae80,_0x56b205){_0x59ae80=_0x59ae80-0x0;var _0x473bf9=_0xdb64[_0x59ae80];return _0x473bf9;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0x4db6('0x0'));var mailAccount=require(_0x4db6('0x1'));var setting=require('./rpc/setting');var logger=require('../../config/logger')(_0x4db6('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x4db6('0x3')](mailAccount[_0x4db6('0x4')]())[_0x4db6('0x3')](realtime[_0x4db6('0x5')]())['then'](function(){email[_0x4db6('0x6')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x4db6('0x7')](realtime,email)[_0x4db6('0x3')](function(){return initRealtime();})[_0x4db6('0x3')](function(){return setting[_0x4db6('0x8')]();})[_0x4db6('0x3')](function(_0x41b086){return setInterval(initRealtime,_0x41b086[_0x4db6('0x9')]*0x3e8);})[_0x4db6('0xa')](function(_0x28fbad){logger[_0x4db6('0xb')](_0x4db6('0xc'),_0x28fbad);});}main(); \ No newline at end of file +var _0x2238=['./lib/email','./rpc/setting','resolve','then','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime'];(function(_0x1f75d4,_0x183581){var _0x72f2ca=function(_0x5aafee){while(--_0x5aafee){_0x1f75d4['push'](_0x1f75d4['shift']());}};_0x72f2ca(++_0x183581);}(_0x2238,0x194));var _0x8223=function(_0x34c1b9,_0x4b700a){_0x34c1b9=_0x34c1b9-0x0;var _0x1f4ed5=_0x2238[_0x34c1b9];return _0x1f4ed5;};'use strict';var server=require(_0x8223('0x0'));var Realtime=require(_0x8223('0x1'));var EmailChannel=require(_0x8223('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x8223('0x3'));var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x8223('0x4')]()['then'](mailAccount['getMailAccounts']())[_0x8223('0x5')](realtime[_0x8223('0x6')]())[_0x8223('0x5')](function(){email['refresh'](realtime[_0x8223('0x7')]);return realtime;});}function main(){return server[_0x8223('0x8')](realtime,email)[_0x8223('0x5')](function(){return initRealtime();})[_0x8223('0x5')](function(){return setting[_0x8223('0x9')]();})[_0x8223('0x5')](function(_0x184161){return setInterval(initRealtime,_0x184161[_0x8223('0xa')]*0x3e8);})[_0x8223('0xb')](function(_0x51a450){logger[_0x8223('0xc')](_0x8223('0xd'),_0x51a450);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 00cceb9..aba7ee3 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 _0x6cea=['handleImapError','sendMail','send','Smtp','lastSync','verify','verified','exports','lodash','moment','ioredis','../../../config/logger','email','redis','defaults','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','active','Imap','status','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','service','custom','provider','imapAccounts','handleImapBox','handleImapEmail','bind','end','handleImapEnd','disabled','name','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s'];(function(_0x4d1daf,_0x4c8cb2){var _0x7204fd=function(_0x41c356){while(--_0x41c356){_0x4d1daf['push'](_0x4d1daf['shift']());}};_0x7204fd(++_0x4c8cb2);}(_0x6cea,0x189));var _0xa6ce=function(_0x33b442,_0x5e3326){_0x33b442=_0x33b442-0x0;var _0x4e5947=_0x6cea[_0x33b442];return _0x4e5947;};'use strict';var _=require(_0xa6ce('0x0'));var moment=require(_0xa6ce('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0xa6ce('0x2'));var config=require('../../../config/environment');var logger=require(_0xa6ce('0x3'))(_0xa6ce('0x4'));config[_0xa6ce('0x5')]=_[_0xa6ce('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa6ce('0x7'))(new Redis(config[_0xa6ce('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xa6ce('0x8'));var mailAccount=require(_0xa6ce('0x9'));var md5Accounts={};function EmailChannel(_0x5a2613){logger[_0xa6ce('0xa')](_0xa6ce('0xb'));this[_0xa6ce('0xc')]=_0x5a2613[_0xa6ce('0xc')];this['imapAccounts']={};this[_0xa6ce('0xd')]=new EmailSmtp();}EmailChannel[_0xa6ce('0xe')][_0xa6ce('0xf')]=function(_0xbd62f3){var _0x5e2bc5=this[_0xa6ce('0xc')][_0xbd62f3];var _0x2f4ecf={'id':_0x5e2bc5['id'],'name':_0x5e2bc5['name'],'key':_0x5e2bc5['key'],'active':_0x5e2bc5[_0xa6ce('0x10')],'Imap':{'status':_0x5e2bc5[_0xa6ce('0x11')][_0xa6ce('0x12')],'messageStatus':_0x5e2bc5[_0xa6ce('0x11')][_0xa6ce('0x13')],'total':_0x5e2bc5[_0xa6ce('0x11')][_0xa6ce('0x14')]}};if(_[_0xa6ce('0x15')](md5Accounts[_0xbd62f3])){md5Accounts[_0xbd62f3]={};}var _0x3b36db=md5(JSON[_0xa6ce('0x16')](_0x2f4ecf));if(md5Accounts[_0xbd62f3][_0xa6ce('0x17')]!==_0x3b36db){md5Accounts[_0xbd62f3][_0xa6ce('0x17')]=_0x3b36db;io[_0xa6ce('0xf')](_0xa6ce('0x18'),_0x2f4ecf);}};EmailChannel[_0xa6ce('0xe')][_0xa6ce('0x19')]=function(_0x14801d){for(var _0x2716b0 in _0x14801d){if(_0x14801d[_0xa6ce('0x1a')](_0x2716b0)){if(_0x14801d[_0x2716b0]['Imap']&&_0x14801d[_0x2716b0]['active']){var _0x325d90=_0x14801d[_0x2716b0]['Imap'];if(!_0x325d90[_0xa6ce('0x1b')]&&_0x14801d[_0x2716b0]['provider']!==_0xa6ce('0x1c'))_0x325d90[_0xa6ce('0x1b')]=_0x14801d[_0x2716b0][_0xa6ce('0x1d')];if(!this[_0xa6ce('0x1e')][_0xa6ce('0x1a')](_0x325d90['id'])){this[_0xa6ce('0x1e')][_0x325d90['id']]=new EmailImap(_0x325d90,_0x14801d[_0x2716b0][_0xa6ce('0x4')]);this[_0xa6ce('0x1e')][_0x325d90['id']]['on']('box',this[_0xa6ce('0x1f')]['bind'](this,_0x2716b0));this[_0xa6ce('0x1e')][_0x325d90['id']]['on'](_0xa6ce('0x4'),this[_0xa6ce('0x20')][_0xa6ce('0x21')](this,_0x2716b0));this[_0xa6ce('0x1e')][_0x325d90['id']]['on'](_0xa6ce('0x22'),this[_0xa6ce('0x23')]['bind'](this,_0x2716b0));this[_0xa6ce('0x1e')][_0x325d90['id']]['on']('error',this['handleImapError']['bind'](this,_0x2716b0));}}else{if(_[_0xa6ce('0x15')](this[_0xa6ce('0xc')][_0x2716b0][_0xa6ce('0x11')])){this[_0xa6ce('0xc')][_0x2716b0][_0xa6ce('0x11')]={};}this[_0xa6ce('0xc')][_0x2716b0][_0xa6ce('0x11')]['status']=_0xa6ce('0x24');this['mailAccounts'][_0x2716b0][_0xa6ce('0x11')][_0xa6ce('0x13')]='';this[_0xa6ce('0xf')](_0x2716b0);}}}};EmailChannel[_0xa6ce('0xe')][_0xa6ce('0x1f')]=function(_0x107b26,_0x38664f){if(this[_0xa6ce('0xc')][_0x107b26]){this[_0xa6ce('0xc')][_0x107b26]['Imap']['status']='connected';this[_0xa6ce('0xc')][_0x107b26][_0xa6ce('0x11')]['messageStatus']=_0x38664f[_0xa6ce('0x25')];if(_0x38664f['messages']){this['mailAccounts'][_0x107b26][_0xa6ce('0x11')][_0xa6ce('0x14')]=_0x38664f['messages'][_0xa6ce('0x14')];}return this[_0xa6ce('0xf')](_0x107b26);}};EmailChannel[_0xa6ce('0xe')][_0xa6ce('0x20')]=function(_0x77e055,_0x2c31f7){logger['info'](_0xa6ce('0x26'),_0x2c31f7[_0xa6ce('0x27')],_0x2c31f7['lastName'],_0x2c31f7[_0xa6ce('0x28')],_0x77e055);if(this[_0xa6ce('0xc')][_0x77e055]){return mailAccount[_0xa6ce('0x29')](_0x77e055,_0x2c31f7)[_0xa6ce('0x2a')](function(_0x1234b2){if(_0x1234b2){logger['info'](_0xa6ce('0x2b'));}})[_0xa6ce('0x2c')](function(_0x29cde){logger[_0xa6ce('0x2d')](_0xa6ce('0x2e'),JSON[_0xa6ce('0x16')](_0x29cde));});}};EmailChannel[_0xa6ce('0xe')][_0xa6ce('0x23')]=function(_0xe76c16){if(this['mailAccounts'][_0xe76c16]&&this[_0xa6ce('0xc')][_0xe76c16][_0xa6ce('0x11')]){if(this[_0xa6ce('0x1e')][this['mailAccounts'][_0xe76c16][_0xa6ce('0x11')]['id']]){delete this[_0xa6ce('0x1e')][this['mailAccounts'][_0xe76c16]['Imap']['id']];}this['mailAccounts'][_0xe76c16]['Imap']['lastSync']=moment();this[_0xa6ce('0xf')](_0xe76c16);}};EmailChannel[_0xa6ce('0xe')][_0xa6ce('0x2f')]=function(_0x3d4b7c,_0x233fd1){if(this[_0xa6ce('0xc')][_0x3d4b7c]){this['mailAccounts'][_0x3d4b7c]['Imap'][_0xa6ce('0x12')]=_0xa6ce('0x2d');this[_0xa6ce('0xc')][_0x3d4b7c]['Imap'][_0xa6ce('0x13')]=_0x233fd1;return this[_0xa6ce('0xf')](_0x3d4b7c);}};EmailChannel['prototype'][_0xa6ce('0x30')]=function(_0xf7e44c,_0x5de178){return this[_0xa6ce('0xd')][_0xa6ce('0x31')](_0xf7e44c,_0x5de178);};EmailChannel[_0xa6ce('0xe')]['verifySmtp']=function(_0x4546b1){var _0x128564=this;if(this[_0xa6ce('0xc')][_0x4546b1['id']]){if(_[_0xa6ce('0x15')](this[_0xa6ce('0xc')][_0x4546b1['id']][_0xa6ce('0x32')])){this['mailAccounts'][_0x4546b1['id']]['Smtp']={};}this['mailAccounts'][_0x4546b1['id']][_0xa6ce('0x32')][_0xa6ce('0x33')]=moment();return new BPromise(function(_0x177ab2,_0x41e1fb){return _0x128564['smtp'][_0xa6ce('0x34')](_0x4546b1)['then'](function(_0x42a7f1){_0x128564[_0xa6ce('0xc')][_0x4546b1['id']][_0xa6ce('0x32')][_0xa6ce('0x12')]=_0xa6ce('0x35');_0x128564[_0xa6ce('0xc')][_0x4546b1['id']][_0xa6ce('0x32')]['messageStatus']='';_0x128564[_0xa6ce('0xf')](_0x4546b1['id']);_0x177ab2(_0x42a7f1);})['catch'](function(_0x55041a){_0x128564[_0xa6ce('0xc')][_0x4546b1['id']]['Smtp'][_0xa6ce('0x12')]=_0xa6ce('0x2d');_0x128564[_0xa6ce('0xc')][_0x4546b1['id']]['Smtp'][_0xa6ce('0x13')]=_0x55041a;_0x128564[_0xa6ce('0xf')](_0x4546b1['id']);_0x41e1fb(_0x55041a);});});}return this[_0xa6ce('0xd')]['verify'](_0x4546b1);};module[_0xa6ce('0x36')]=EmailChannel; \ No newline at end of file +var _0x5710=['New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','notify','Mail\x20accepted\x20from\x20routing','catch','lastSync','sendMail','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','stringify','mailAccount:update','hasOwnProperty','service','provider','handleImapBox','bind','end','handleImapEnd','error','handleImapError','isNil','disabled','messages','handleImapEmail','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5710,0xb1));var _0x0571=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5710[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x0571('0x0'));var moment=require(_0x0571('0x1'));var BPromise=require(_0x0571('0x2'));var md5=require(_0x0571('0x3'));var Redis=require(_0x0571('0x4'));var config=require(_0x0571('0x5'));var logger=require(_0x0571('0x6'))(_0x0571('0x7'));config[_0x0571('0x8')]=_[_0x0571('0x9')](config[_0x0571('0x8')],{'host':_0x0571('0xa'),'port':0x18eb});var io=require(_0x0571('0xb'))(new Redis(config[_0x0571('0x8')]));var EmailImap=require(_0x0571('0xc'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x0571('0xd'));var md5Accounts={};function EmailChannel(_0x587040){logger['info'](_0x0571('0xe'));this[_0x0571('0xf')]=_0x587040[_0x0571('0xf')];this[_0x0571('0x10')]={};this[_0x0571('0x11')]=new EmailSmtp();}EmailChannel[_0x0571('0x12')][_0x0571('0x13')]=function(_0xca744d){var _0x411fdf=this[_0x0571('0xf')][_0xca744d];var _0x159a96={'id':_0x411fdf['id'],'name':_0x411fdf[_0x0571('0x14')],'key':_0x411fdf[_0x0571('0x15')],'active':_0x411fdf[_0x0571('0x16')],'Imap':{'status':_0x411fdf[_0x0571('0x17')][_0x0571('0x18')],'messageStatus':_0x411fdf['Imap'][_0x0571('0x19')],'total':_0x411fdf[_0x0571('0x17')][_0x0571('0x1a')]}};if(_['isNil'](md5Accounts[_0xca744d])){md5Accounts[_0xca744d]={};}var _0x17777a=md5(JSON[_0x0571('0x1b')](_0x159a96));if(md5Accounts[_0xca744d][_0x0571('0x3')]!==_0x17777a){md5Accounts[_0xca744d][_0x0571('0x3')]=_0x17777a;io[_0x0571('0x13')](_0x0571('0x1c'),_0x159a96);}};EmailChannel[_0x0571('0x12')]['refresh']=function(_0x449c38){for(var _0x1f6c4a in _0x449c38){if(_0x449c38[_0x0571('0x1d')](_0x1f6c4a)){if(_0x449c38[_0x1f6c4a][_0x0571('0x17')]&&_0x449c38[_0x1f6c4a]['active']){var _0x179215=_0x449c38[_0x1f6c4a]['Imap'];if(!_0x179215[_0x0571('0x1e')]&&_0x449c38[_0x1f6c4a][_0x0571('0x1f')]!=='custom')_0x179215['service']=_0x449c38[_0x1f6c4a][_0x0571('0x1f')];if(!this[_0x0571('0x10')]['hasOwnProperty'](_0x179215['id'])){this[_0x0571('0x10')][_0x179215['id']]=new EmailImap(_0x179215,_0x449c38[_0x1f6c4a]['email']);this['imapAccounts'][_0x179215['id']]['on']('box',this[_0x0571('0x20')][_0x0571('0x21')](this,_0x1f6c4a));this[_0x0571('0x10')][_0x179215['id']]['on'](_0x0571('0x7'),this['handleImapEmail'][_0x0571('0x21')](this,_0x1f6c4a));this[_0x0571('0x10')][_0x179215['id']]['on'](_0x0571('0x22'),this[_0x0571('0x23')][_0x0571('0x21')](this,_0x1f6c4a));this[_0x0571('0x10')][_0x179215['id']]['on'](_0x0571('0x24'),this[_0x0571('0x25')][_0x0571('0x21')](this,_0x1f6c4a));}}else{if(_[_0x0571('0x26')](this[_0x0571('0xf')][_0x1f6c4a][_0x0571('0x17')])){this[_0x0571('0xf')][_0x1f6c4a][_0x0571('0x17')]={};}this[_0x0571('0xf')][_0x1f6c4a][_0x0571('0x17')][_0x0571('0x18')]=_0x0571('0x27');this[_0x0571('0xf')][_0x1f6c4a][_0x0571('0x17')][_0x0571('0x19')]='';this[_0x0571('0x13')](_0x1f6c4a);}}}};EmailChannel[_0x0571('0x12')]['handleImapBox']=function(_0xaf98ac,_0x13ec5e){if(this[_0x0571('0xf')][_0xaf98ac]){this[_0x0571('0xf')][_0xaf98ac][_0x0571('0x17')]['status']='connected';this['mailAccounts'][_0xaf98ac][_0x0571('0x17')][_0x0571('0x19')]=_0x13ec5e[_0x0571('0x14')];if(_0x13ec5e[_0x0571('0x28')]){this[_0x0571('0xf')][_0xaf98ac][_0x0571('0x17')][_0x0571('0x1a')]=_0x13ec5e[_0x0571('0x28')][_0x0571('0x1a')];}return this[_0x0571('0x13')](_0xaf98ac);}};EmailChannel[_0x0571('0x12')][_0x0571('0x29')]=function(_0x178385,_0x3e491f){logger[_0x0571('0x2a')](_0x0571('0x2b'),_0x3e491f[_0x0571('0x2c')],_0x3e491f['lastName'],_0x3e491f['from'],_0x178385);if(this['mailAccounts'][_0x178385]){return mailAccount[_0x0571('0x2d')](_0x178385,_0x3e491f)['then'](function(_0x4efcc6){if(_0x4efcc6){logger[_0x0571('0x2a')](_0x0571('0x2e'));}})[_0x0571('0x2f')](function(_0x2e1849){logger[_0x0571('0x24')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x0571('0x1b')](_0x2e1849));});}};EmailChannel[_0x0571('0x12')][_0x0571('0x23')]=function(_0x2d86fb){if(this['mailAccounts'][_0x2d86fb]&&this[_0x0571('0xf')][_0x2d86fb][_0x0571('0x17')]){if(this[_0x0571('0x10')][this[_0x0571('0xf')][_0x2d86fb][_0x0571('0x17')]['id']]){delete this['imapAccounts'][this[_0x0571('0xf')][_0x2d86fb][_0x0571('0x17')]['id']];}this['mailAccounts'][_0x2d86fb][_0x0571('0x17')][_0x0571('0x30')]=moment();this[_0x0571('0x13')](_0x2d86fb);}};EmailChannel[_0x0571('0x12')][_0x0571('0x25')]=function(_0x3c6b6d,_0x335e44){if(this['mailAccounts'][_0x3c6b6d]){this[_0x0571('0xf')][_0x3c6b6d]['Imap'][_0x0571('0x18')]=_0x0571('0x24');this[_0x0571('0xf')][_0x3c6b6d]['Imap'][_0x0571('0x19')]=_0x335e44;return this['emit'](_0x3c6b6d);}};EmailChannel[_0x0571('0x12')][_0x0571('0x31')]=function(_0x1f12f6,_0x6e8ff3){return this['smtp']['send'](_0x1f12f6,_0x6e8ff3);};EmailChannel[_0x0571('0x12')][_0x0571('0x32')]=function(_0x2dde88){var _0x3a4bec=this;if(this[_0x0571('0xf')][_0x2dde88['id']]){if(_[_0x0571('0x26')](this['mailAccounts'][_0x2dde88['id']]['Smtp'])){this[_0x0571('0xf')][_0x2dde88['id']][_0x0571('0x33')]={};}this[_0x0571('0xf')][_0x2dde88['id']][_0x0571('0x33')][_0x0571('0x30')]=moment();return new BPromise(function(_0x1a7e01,_0x199122){return _0x3a4bec[_0x0571('0x11')][_0x0571('0x34')](_0x2dde88)['then'](function(_0x4784c9){_0x3a4bec['mailAccounts'][_0x2dde88['id']][_0x0571('0x33')][_0x0571('0x18')]=_0x0571('0x35');_0x3a4bec[_0x0571('0xf')][_0x2dde88['id']][_0x0571('0x33')]['messageStatus']='';_0x3a4bec[_0x0571('0x13')](_0x2dde88['id']);_0x1a7e01(_0x4784c9);})[_0x0571('0x2f')](function(_0x672237){_0x3a4bec['mailAccounts'][_0x2dde88['id']][_0x0571('0x33')][_0x0571('0x18')]='error';_0x3a4bec[_0x0571('0xf')][_0x2dde88['id']][_0x0571('0x33')][_0x0571('0x19')]=_0x672237;_0x3a4bec[_0x0571('0x13')](_0x2dde88['id']);_0x199122(_0x672237);});});}return this[_0x0571('0x11')]['verify'](_0x2dde88);};module[_0x0571('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 8354639..358c5dc 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 _0x9536=['getAccount','once','handleReady','bind','end','handleEnd','error','connect','inherits','prototype','connTimeout','authTimeout','authentication','user','password','host','port','tls','autotls','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','service','openBox','handleOpenBox','emit','box','handleError','readUnseen','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','closeBox','handleCloseBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account'];(function(_0x2605d0,_0x448262){var _0x34f175=function(_0x79a10f){while(--_0x79a10f){_0x2605d0['push'](_0x2605d0['shift']());}};_0x34f175(++_0x448262);}(_0x9536,0x179));var _0x6953=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0x9536[_0x53b53e];return _0xbb6179;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var Imap=require(_0x6953('0x2'));var simpleParser=require(_0x6953('0x3'))['simpleParser'];var Iconv=require(_0x6953('0x4'))['Iconv'];var EventEmitter=require(_0x6953('0x5'))[_0x6953('0x6')];var utils=require(_0x6953('0x7'));var logger=require(_0x6953('0x8'))(_0x6953('0x9'));function EmailImap(_0x494ac2,_0x2b273e){this[_0x6953('0xa')]=_0x6953('0xb');this[_0x6953('0xc')]=this[_0x6953('0xd')](_0x494ac2,_0x2b273e);this['imap']=new Imap(this[_0x6953('0xc')]);this[_0x6953('0x2')][_0x6953('0xe')]('ready',this[_0x6953('0xf')][_0x6953('0x10')](this));this[_0x6953('0x2')][_0x6953('0xe')](_0x6953('0x11'),this[_0x6953('0x12')][_0x6953('0x10')](this));this[_0x6953('0x2')]['on'](_0x6953('0x13'),this['handleError'][_0x6953('0x10')](this));this['imap'][_0x6953('0x14')]();}util[_0x6953('0x15')](EmailImap,EventEmitter);EmailImap[_0x6953('0x16')][_0x6953('0xd')]=function(_0x1b5221,_0x244713){var _0x175fa9={'connTimeout':_0x1b5221[_0x6953('0x17')]?_0x1b5221[_0x6953('0x17')]*0x3e8:0x2710,'authTimeout':_0x1b5221[_0x6953('0x18')]?_0x1b5221[_0x6953('0x18')]*0x3e8:0x1388};if(_['isNil'](_0x1b5221['service'])){if(_0x1b5221[_0x6953('0x19')]){_0x175fa9[_0x6953('0x1a')]=_0x1b5221[_0x6953('0x1a')];_0x175fa9[_0x6953('0x1b')]=_0x1b5221['password'];}_0x175fa9[_0x6953('0x1c')]=_0x1b5221[_0x6953('0x1c')];_0x175fa9['port']=_0x1b5221[_0x6953('0x1d')]||0x3e1;if(_0x1b5221[_0x6953('0x1e')]){_0x175fa9[_0x6953('0x1e')]=!![];}else{_0x175fa9[_0x6953('0x1e')]=![];_0x175fa9[_0x6953('0x1f')]='required';}}else{if(_0x1b5221[_0x6953('0x20')]){_0x175fa9[_0x6953('0x21')]=utils[_0x6953('0x22')](_0x1b5221[_0x6953('0x23')][_0x6953('0x24')],_0x1b5221['user']);_0x175fa9[_0x6953('0x1a')]=_0x1b5221[_0x6953('0x1a')];}else{_0x175fa9['user']=_0x1b5221[_0x6953('0x1a')];_0x175fa9[_0x6953('0x1b')]=_0x1b5221[_0x6953('0x1b')];}_0x175fa9[_0x6953('0x1c')]=utils['getHost'](_0x1b5221[_0x6953('0x25')]);_0x175fa9[_0x6953('0x1d')]=0x3e1;_0x175fa9[_0x6953('0x1e')]=!![];}_0x175fa9['email']=_0x244713||_0x1b5221['user']||'anonymous@xcally.com';return _0x175fa9;};EmailImap[_0x6953('0x16')][_0x6953('0xf')]=function(){this['imap'][_0x6953('0x26')](this['mailbox'],![],this[_0x6953('0x27')][_0x6953('0x10')](this));};EmailImap[_0x6953('0x16')][_0x6953('0x27')]=function(_0x191d80,_0x1497e3){if(_0x191d80){this['handleError'](_0x191d80,!![]);}else{this[_0x6953('0x28')](_0x6953('0x29'),_0x1497e3);this['readUnseen']();}};EmailImap[_0x6953('0x16')]['handleCloseBox']=function(_0x173b3c){if(_0x173b3c){this[_0x6953('0x2a')](_0x173b3c,!![]);}else{this[_0x6953('0x2')]['end']();}};EmailImap[_0x6953('0x16')][_0x6953('0x2b')]=function(){this[_0x6953('0x2')]['search']([_0x6953('0x2c')],this[_0x6953('0x2d')]['bind'](this));};EmailImap['prototype'][_0x6953('0x2d')]=function(_0x44389b,_0x3d9365){if(_0x44389b){this[_0x6953('0x2a')](_0x44389b,!![]);}else{if(_0x3d9365[_0x6953('0x2e')]){try{var _0x56ce8e=this[_0x6953('0x2')]['fetch'](_0x3d9365,{'bodies':'','markSeen':!![]});_0x56ce8e['on'](_0x6953('0x2f'),this[_0x6953('0x30')]['bind'](this));_0x56ce8e['once'](_0x6953('0x13'),this[_0x6953('0x31')][_0x6953('0x10')](this));_0x56ce8e['once'](_0x6953('0x11'),this['handleFetchEnd']['bind'](this));}catch(_0x5eda70){logger['error'](_0x5eda70);}}else{this[_0x6953('0x2')][_0x6953('0x32')](!![],this[_0x6953('0x33')][_0x6953('0x10')](this));}}};EmailImap[_0x6953('0x16')][_0x6953('0x30')]=function(_0x4f6e06){_0x4f6e06['on'](_0x6953('0x34'),this['handleMessageBody'][_0x6953('0x10')](this));_0x4f6e06['once'](_0x6953('0x35'),this[_0x6953('0x36')][_0x6953('0x10')](this));_0x4f6e06[_0x6953('0xe')]('end',this[_0x6953('0x37')][_0x6953('0x10')](this));};EmailImap[_0x6953('0x16')][_0x6953('0x38')]=function(_0x40b6ea){simpleParser(_0x40b6ea,{'Iconv':Iconv},this[_0x6953('0x39')][_0x6953('0x10')](this));};EmailImap[_0x6953('0x16')][_0x6953('0x36')]=function(){};EmailImap[_0x6953('0x16')][_0x6953('0x37')]=function(){};EmailImap['prototype'][_0x6953('0x39')]=function(_0x3c03ab,_0x1f6571){if(_0x3c03ab){logger['error'](_0x3c03ab);}else{var _0x47e7e7=this;utils[_0x6953('0x3a')](this['account'],_0x1f6571,function(_0x5abaf2){_0x47e7e7[_0x6953('0x28')](_0x6953('0x9'),_0x5abaf2);});}};EmailImap['prototype'][_0x6953('0x3b')]=function(){this[_0x6953('0x2')][_0x6953('0x32')](!![],this[_0x6953('0x33')][_0x6953('0x10')](this));};EmailImap[_0x6953('0x16')]['handleFetchError']=function(_0x3a72e5){this[_0x6953('0x2a')](_0x3a72e5);this[_0x6953('0x2')][_0x6953('0x32')](!![],this[_0x6953('0x33')][_0x6953('0x10')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x6953('0x28')]('end');};EmailImap['prototype'][_0x6953('0x2a')]=function(_0x2e1197,_0x2bdbb6){logger[_0x6953('0x13')](_0x6953('0x2a'),this['account']['email'],JSON[_0x6953('0x3c')](_0x2e1197));var _0x452b69='';if(_0x2e1197){if(_0x2e1197['textCode']){_0x452b69=_0x2e1197[_0x6953('0x3d')];}else{for(var _0x5d3bf4 in _0x2e1197){if(_0x2e1197[_0x6953('0x3e')](_0x5d3bf4)){_0x452b69+=_[_0x6953('0x3f')](_0x5d3bf4)+':\x20'+_0x2e1197[_0x5d3bf4]+'\x0a';}}}}if(_0x2bdbb6){this[_0x6953('0x2')][_0x6953('0x11')]();}else{this['emit'](_0x6953('0x13'),_0x452b69);this[_0x6953('0x28')]('end');}};module[_0x6953('0x40')]=EmailImap; \ No newline at end of file +var _0xc6ac=['parser','handleFetchEnd','handleEnd','stringify','textCode','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','account','getAccount','once','ready','handleReady','end','bind','error','connect','inherits','connTimeout','authTimeout','isNil','user','password','host','port','tls','autotls','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','getHost','service','anonymous@xcally.com','prototype','mailbox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','closeBox','handleFetchMessage','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser'];(function(_0x3e38dc,_0x55ec2a){var _0x5aa9b1=function(_0x3b8b5f){while(--_0x3b8b5f){_0x3e38dc['push'](_0x3e38dc['shift']());}};_0x5aa9b1(++_0x55ec2a);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x1454b5,_0x56888c){_0x1454b5=_0x1454b5-0x0;var _0x4d134f=_0xc6ac[_0x1454b5];return _0x4d134f;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var Imap=require(_0xcc6a('0x2'));var simpleParser=require(_0xcc6a('0x3'))[_0xcc6a('0x4')];var Iconv=require(_0xcc6a('0x5'))[_0xcc6a('0x6')];var EventEmitter=require(_0xcc6a('0x7'))[_0xcc6a('0x8')];var utils=require(_0xcc6a('0x9'));var logger=require(_0xcc6a('0xa'))(_0xcc6a('0xb'));function EmailImap(_0x12330e,_0x197bd7){this['mailbox']=_0xcc6a('0xc');this[_0xcc6a('0xd')]=this[_0xcc6a('0xe')](_0x12330e,_0x197bd7);this['imap']=new Imap(this[_0xcc6a('0xd')]);this[_0xcc6a('0x2')][_0xcc6a('0xf')](_0xcc6a('0x10'),this[_0xcc6a('0x11')]['bind'](this));this[_0xcc6a('0x2')][_0xcc6a('0xf')](_0xcc6a('0x12'),this['handleEnd'][_0xcc6a('0x13')](this));this[_0xcc6a('0x2')]['on'](_0xcc6a('0x14'),this['handleError']['bind'](this));this[_0xcc6a('0x2')][_0xcc6a('0x15')]();}util[_0xcc6a('0x16')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x369dc1,_0xcb9e2e){var _0x43710d={'connTimeout':_0x369dc1[_0xcc6a('0x17')]?_0x369dc1[_0xcc6a('0x17')]*0x3e8:0x2710,'authTimeout':_0x369dc1[_0xcc6a('0x18')]?_0x369dc1[_0xcc6a('0x18')]*0x3e8:0x1388};if(_[_0xcc6a('0x19')](_0x369dc1['service'])){if(_0x369dc1['authentication']){_0x43710d['user']=_0x369dc1[_0xcc6a('0x1a')];_0x43710d[_0xcc6a('0x1b')]=_0x369dc1[_0xcc6a('0x1b')];}_0x43710d[_0xcc6a('0x1c')]=_0x369dc1[_0xcc6a('0x1c')];_0x43710d[_0xcc6a('0x1d')]=_0x369dc1[_0xcc6a('0x1d')]||0x3e1;if(_0x369dc1[_0xcc6a('0x1e')]){_0x43710d[_0xcc6a('0x1e')]=!![];}else{_0x43710d[_0xcc6a('0x1e')]=![];_0x43710d[_0xcc6a('0x1f')]='required';}}else{if(_0x369dc1[_0xcc6a('0x20')]){_0x43710d[_0xcc6a('0x21')]=utils[_0xcc6a('0x22')](_0x369dc1[_0xcc6a('0x23')][_0xcc6a('0x24')],_0x369dc1[_0xcc6a('0x1a')]);_0x43710d[_0xcc6a('0x1a')]=_0x369dc1[_0xcc6a('0x1a')];}else{_0x43710d[_0xcc6a('0x1a')]=_0x369dc1[_0xcc6a('0x1a')];_0x43710d[_0xcc6a('0x1b')]=_0x369dc1[_0xcc6a('0x1b')];}_0x43710d['host']=utils[_0xcc6a('0x25')](_0x369dc1[_0xcc6a('0x26')]);_0x43710d[_0xcc6a('0x1d')]=0x3e1;_0x43710d['tls']=!![];}_0x43710d[_0xcc6a('0xb')]=_0xcb9e2e||_0x369dc1[_0xcc6a('0x1a')]||_0xcc6a('0x27');return _0x43710d;};EmailImap[_0xcc6a('0x28')][_0xcc6a('0x11')]=function(){this[_0xcc6a('0x2')]['openBox'](this[_0xcc6a('0x29')],![],this[_0xcc6a('0x2a')][_0xcc6a('0x13')](this));};EmailImap['prototype'][_0xcc6a('0x2a')]=function(_0x3dad72,_0x4da301){if(_0x3dad72){this[_0xcc6a('0x2b')](_0x3dad72,!![]);}else{this[_0xcc6a('0x2c')](_0xcc6a('0x2d'),_0x4da301);this[_0xcc6a('0x2e')]();}};EmailImap['prototype'][_0xcc6a('0x2f')]=function(_0x3cf14c){if(_0x3cf14c){this[_0xcc6a('0x2b')](_0x3cf14c,!![]);}else{this['imap'][_0xcc6a('0x12')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0xcc6a('0x2')][_0xcc6a('0x30')]([_0xcc6a('0x31')],this[_0xcc6a('0x32')][_0xcc6a('0x13')](this));};EmailImap[_0xcc6a('0x28')]['handleReadUnseen']=function(_0x7b2b54,_0x28e3c3){if(_0x7b2b54){this[_0xcc6a('0x2b')](_0x7b2b54,!![]);}else{if(_0x28e3c3[_0xcc6a('0x33')]){try{var _0x211a8c=this[_0xcc6a('0x2')][_0xcc6a('0x34')](_0x28e3c3,{'bodies':'','markSeen':!![]});_0x211a8c['on'](_0xcc6a('0x35'),this['handleFetchMessage'][_0xcc6a('0x13')](this));_0x211a8c[_0xcc6a('0xf')](_0xcc6a('0x14'),this[_0xcc6a('0x36')][_0xcc6a('0x13')](this));_0x211a8c[_0xcc6a('0xf')](_0xcc6a('0x12'),this['handleFetchEnd'][_0xcc6a('0x13')](this));}catch(_0x5a41b4){logger['error'](_0x5a41b4);}}else{this['imap'][_0xcc6a('0x37')](!![],this[_0xcc6a('0x2f')][_0xcc6a('0x13')](this));}}};EmailImap[_0xcc6a('0x28')][_0xcc6a('0x38')]=function(_0x5856af){_0x5856af['on']('body',this[_0xcc6a('0x39')][_0xcc6a('0x13')](this));_0x5856af[_0xcc6a('0xf')]('attributes',this[_0xcc6a('0x3a')][_0xcc6a('0x13')](this));_0x5856af[_0xcc6a('0xf')](_0xcc6a('0x12'),this[_0xcc6a('0x3b')][_0xcc6a('0x13')](this));};EmailImap[_0xcc6a('0x28')][_0xcc6a('0x39')]=function(_0x2a1cd2){simpleParser(_0x2a1cd2,{'Iconv':Iconv},this[_0xcc6a('0x3c')][_0xcc6a('0x13')](this));};EmailImap[_0xcc6a('0x28')][_0xcc6a('0x3a')]=function(){};EmailImap[_0xcc6a('0x28')][_0xcc6a('0x3b')]=function(){};EmailImap[_0xcc6a('0x28')][_0xcc6a('0x3c')]=function(_0x386cbc,_0x57dafe){if(_0x386cbc){logger['error'](_0x386cbc);}else{var _0x1d3e45=this;utils[_0xcc6a('0x3d')](this[_0xcc6a('0xd')],_0x57dafe,function(_0x1fd8e1){_0x1d3e45[_0xcc6a('0x2c')](_0xcc6a('0xb'),_0x1fd8e1);});}};EmailImap[_0xcc6a('0x28')][_0xcc6a('0x3e')]=function(){this['imap']['closeBox'](!![],this[_0xcc6a('0x2f')]['bind'](this));};EmailImap['prototype']['handleFetchError']=function(_0x674e04){this[_0xcc6a('0x2b')](_0x674e04);this[_0xcc6a('0x2')][_0xcc6a('0x37')](!![],this[_0xcc6a('0x2f')]['bind'](this));};EmailImap[_0xcc6a('0x28')][_0xcc6a('0x3f')]=function(){this[_0xcc6a('0x2c')](_0xcc6a('0x12'));};EmailImap[_0xcc6a('0x28')][_0xcc6a('0x2b')]=function(_0x54f862,_0x4447cc){logger[_0xcc6a('0x14')](_0xcc6a('0x2b'),this[_0xcc6a('0xd')]['email'],JSON[_0xcc6a('0x40')](_0x54f862));var _0x4a9cea='';if(_0x54f862){if(_0x54f862[_0xcc6a('0x41')]){_0x4a9cea=_0x54f862[_0xcc6a('0x41')];}else{for(var _0x3ab8f5 in _0x54f862){if(_0x54f862['hasOwnProperty'](_0x3ab8f5)){_0x4a9cea+=_[_0xcc6a('0x42')](_0x3ab8f5)+':\x20'+_0x54f862[_0x3ab8f5]+'\x0a';}}}}if(_0x4447cc){this[_0xcc6a('0x2')][_0xcc6a('0x12')]();}else{this['emit']('error',_0x4a9cea);this[_0xcc6a('0x2c')](_0xcc6a('0x12'));}};module[_0xcc6a('0x43')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index d9754a1..820cddc 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 _0xeb5f=['toString','verify','exports','nodemailer-plugin-inline-base64','prototype','createTransport','compile','sendMail'];(function(_0x1a8c3e,_0x4a9ac7){var _0x2bbf9d=function(_0x5ac1c3){while(--_0x5ac1c3){_0x1a8c3e['push'](_0x1a8c3e['shift']());}};_0x2bbf9d(++_0x4a9ac7);}(_0xeb5f,0x103));var _0xfeb5=function(_0x4271ae,_0x2917a2){_0x4271ae=_0x4271ae-0x0;var _0x5ee3e8=_0xeb5f[_0x4271ae];return _0x5ee3e8;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xfeb5('0x0'));function EmailSmtp(){}EmailSmtp[_0xfeb5('0x1')]['send']=function(_0x14bedd,_0x2ce445){return new Promise(function(_0x3c64a4,_0x40f66d){var _0x3948f1=nodemailer[_0xfeb5('0x2')](_0x14bedd);_0x3948f1['use'](_0xfeb5('0x3'),inlineBase64());_0x3948f1[_0xfeb5('0x4')](_0x2ce445,function(_0x26847e,_0x61ee44){if(_0x26847e){_0x40f66d(_0x26847e[_0xfeb5('0x5')]());}else{_0x3c64a4(_0x61ee44);}});});};EmailSmtp['prototype'][_0xfeb5('0x6')]=function(_0x29c0fe){return new Promise(function(_0x2fa9db,_0x1a2c93){var _0x9cf56=nodemailer['createTransport'](_0x29c0fe);_0x9cf56[_0xfeb5('0x6')](function(_0x1780bd,_0x3ab1df){if(_0x1780bd){_0x1a2c93(_0x1780bd[_0xfeb5('0x5')]());}else{if(_0x3ab1df){_0x2fa9db(_0x3ab1df);}else{_0x1a2c93('Not\x20verifired');}}});});};module[_0xfeb5('0x7')]=EmailSmtp; \ No newline at end of file +var _0x8c45=['verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','use','sendMail','toString'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8c45,0xc1));var _0x58c4=function(_0x21444c,_0x12e8ad){_0x21444c=_0x21444c-0x0;var _0x5bbc48=_0x8c45[_0x21444c];return _0x5bbc48;};'use strict';var nodemailer=require(_0x58c4('0x0'));var inlineBase64=require(_0x58c4('0x1'));function EmailSmtp(){}EmailSmtp[_0x58c4('0x2')]['send']=function(_0x55036b,_0x28ae82){return new Promise(function(_0x4b4e36,_0x189e06){var _0x297da4=nodemailer[_0x58c4('0x3')](_0x55036b);_0x297da4[_0x58c4('0x4')]('compile',inlineBase64());_0x297da4[_0x58c4('0x5')](_0x28ae82,function(_0x287f62,_0x379915){if(_0x287f62){_0x189e06(_0x287f62[_0x58c4('0x6')]());}else{_0x4b4e36(_0x379915);}});});};EmailSmtp['prototype']['verify']=function(_0x12cb2e){return new Promise(function(_0x3324ef,_0x97833e){var _0x3ba7a3=nodemailer[_0x58c4('0x3')](_0x12cb2e);_0x3ba7a3[_0x58c4('0x7')](function(_0x13f4b1,_0x102942){if(_0x13f4b1){_0x97833e(_0x13f4b1[_0x58c4('0x6')]());}else{if(_0x102942){_0x3324ef(_0x102942);}else{_0x97833e(_0x58c4('0x8'));}}});});};module[_0x58c4('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 03c6c5a..e2495b3 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 _0xdd47=['messageId','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','application/ms-tnef','info','first','Attachments','Title','getHost','imap.gmail.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','moment','randomstring','path','email','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','indexOf','split','length','slice','Anonymous','html','replace','includes','attachments','push','filename','_SRC','_IMG','\x20[Attachment:\x20','body','0x1?_0x24b24b[_0x7dd4('0xf')](0x0,-0x1)['join']('\x20'):_0x404170[_0x7dd4('0xa')];}return _0x7dd4('0x10');}function getLastName(_0x4eb096){var _0x458b4e=_[_0x7dd4('0x5')](_0x4eb096[_0x7dd4('0x6')]);if(_0x458b4e&&_0x458b4e[_0x7dd4('0xa')]){var _0x4c4ca4=_0x458b4e['name'][_0x7dd4('0xd')](/\s+/);return _0x4c4ca4[_0x7dd4('0xe')]>0x1?_0x4c4ca4['pop']():'';}return'';}function getMails(_0x2bef98,_0x2074f6){var _0x2d0e84='';for(var _0x2d2c7c=0x0;_0x2d2c7c<_0x2074f6[_0x7dd4('0x6')][_0x7dd4('0xe')];_0x2d2c7c+=0x1){if(_0x2074f6[_0x7dd4('0x6')][_0x2d2c7c][_0x7dd4('0x7')]!==_0x2bef98){if(!_['isEmpty'](_0x2d0e84)){_0x2d0e84+=',';}_0x2d0e84+=_0x2074f6[_0x7dd4('0x6')][_0x2d2c7c][_0x7dd4('0xa')]||_0x2074f6['value'][_0x2d2c7c][_0x7dd4('0x7')]||'';_0x2d0e84+='\x20<';_0x2d0e84+=_0x2074f6['value'][_0x2d2c7c]['address']?_0x2074f6[_0x7dd4('0x6')][_0x2d2c7c][_0x7dd4('0x7')]:'anonymous'+random[_0x7dd4('0x8')](0x6)+_0x7dd4('0x9');_0x2d0e84+='>';}}return _0x2d0e84;}function parseEmail(_0x4b0e41,_0x9a0ebf,_0x105c24){if(_0x9a0ebf[_0x7dd4('0x11')]){var _0x5624a5=/)<[^<]*)*<\/script>/gi;while(_0x5624a5['test'](_0x9a0ebf[_0x7dd4('0x11')])){_0x9a0ebf['html']=_0x9a0ebf['html'][_0x7dd4('0x12')](_0x5624a5,'');}if(_0x9a0ebf[_0x7dd4('0x11')][_0x7dd4('0x13')]('{_0x3105ab[_0x7dd4('0x15')](_0xe6dd86[_0x7dd4('0x16')]);});var _0x1fae1d=/]+>/g;var _0x54468d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xff1696=_0x9a0ebf[_0x7dd4('0x11')][_0x7dd4('0x12')](_0x54468d,_0x7dd4('0x17'));var _0x2e6fd7=_0xff1696[_0x7dd4('0x12')](_0x1fae1d,_0x7dd4('0x18'));for(let _0x42ced6=0x0;_0x42ced6<_0x3105ab[_0x7dd4('0xe')];_0x42ced6++){var _0x35940a=_0x2e6fd7[_0x7dd4('0x12')](_0x7dd4('0x18'),_0x7dd4('0x19')+_0x3105ab[_0x42ced6]+'\x20]');_0x2e6fd7=_0x35940a;}_0x9a0ebf['html']=_0x2e6fd7;}_0x105c24[_0x7dd4('0x1a')]=_0x9a0ebf['html'];}else{_0x105c24[_0x7dd4('0x1a')]=_0x9a0ebf['textAsHtml'];}if(_0x105c24[_0x7dd4('0x1a')]){_0x105c24[_0x7dd4('0x1a')]=_0x105c24[_0x7dd4('0x1a')][_0x7dd4('0x12')](/0x0){var _0x424b11=['Auto-Submitted:\x20auto-replied',_0x7dd4('0x2d'),_0x7dd4('0x2e')];for(var _0x211ff0=0x0;_0x211ff0<_0x9a0ebf[_0x7dd4('0x2c')][_0x7dd4('0xe')];_0x211ff0++){var _0x496daf=_[_0x7dd4('0xc')](_0x424b11,_0x9a0ebf['headerLines'][_0x211ff0][_0x7dd4('0x2f')]);if(_0x496daf>=0x0){_0x105c24[_0x7dd4('0x30')]=!![];}}}return _0x105c24;}exports[_0x7dd4('0x31')]=function(_0x139281,_0x1a2477,_0x44180d){var _0x289308={'from':getAddress(_0x1a2477[_0x7dd4('0x32')]),'firstName':getFirstName(_0x1a2477[_0x7dd4('0x32')]),'lastName':getLastName(_0x1a2477[_0x7dd4('0x32')]),'mapKey':'email','message':{'from':getMails(_0x139281[_0x7dd4('0x3')],_0x1a2477[_0x7dd4('0x32')]),'to':_0x139281[_0x7dd4('0x3')],'cc':'','subject':_0x1a2477[_0x7dd4('0x33')]||'','messageId':_0x1a2477[_0x7dd4('0x34')],'inReplyTo':_0x1a2477['inReplyTo'],'sentAt':moment(_0x1a2477['date'])[_0x7dd4('0x23')](_0x7dd4('0x35')),'attach':![],'attachments':[]}};if(!_0x1a2477[_0x7dd4('0x11')]&&!_0x1a2477[_0x7dd4('0x36')]){var _0x5a44d7=_[_0x7dd4('0x37')](_0x1a2477['attachments'],{'contentType':_0x7dd4('0x38')});if(_0x5a44d7[_0x7dd4('0xe')]){logger[_0x7dd4('0x39')](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x1a2477[_0x7dd4('0x34')]));tnef['parseBuffer'](_[_0x7dd4('0x3a')](_0x5a44d7)[_0x7dd4('0x2a')],function(_0x4e8979,_0x2e8770){if(_0x2e8770){_0x1a2477[_0x7dd4('0x11')]=_0x2e8770['BodyHTML']||'

Empty\x20message

';if(_0x2e8770['Attachments']){for(var _0x4807aa=0x0;_0x4807aa<_0x2e8770[_0x7dd4('0x3b')][_0x7dd4('0xe')];_0x4807aa++){var _0x4923db=_0x2e8770[_0x7dd4('0x3b')][_0x4807aa];_0x289308[_0x7dd4('0x1c')][_0x7dd4('0x14')][_0x7dd4('0x15')]({'filename':_0x4923db[_0x7dd4('0x3c')],'content':Buffer['from'](_0x4923db['Data'])});}}}_0x44180d(parseEmail(_0x139281,_0x1a2477,_0x289308));});}else{_0x1a2477[_0x7dd4('0x11')]='

Empty\x20message

';_0x44180d(parseEmail(_0x139281,_0x1a2477,_0x289308));}}else{_0x44180d(parseEmail(_0x139281,_0x1a2477,_0x289308));}};exports[_0x7dd4('0x3d')]=function(_0x5485db){switch(_0x5485db){case'gmail':return _0x7dd4('0x3e');case'yahoo':return'imap.mail.yahoo.com';case _0x7dd4('0x3f'):return _0x7dd4('0x40');case _0x7dd4('0x41'):return'outlook.office365.com';}return _0x7dd4('0x42');};exports[_0x7dd4('0x43')]=function(_0x5a270c,_0x2a37aa){var _0x19c73d=[_0x7dd4('0x44')+(_0x2a37aa||''),_0x7dd4('0x45')+_0x5a270c,'',''];return Buffer[_0x7dd4('0x32')](_0x19c73d['join'](''),_0x7dd4('0x46'))[_0x7dd4('0x47')]('base64');}; \ No newline at end of file +var _0x7f6d=['isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','127.0.0.1','generateXOAuth2Token','auth=Bearer\x20','toString','base64','lodash','moment','randomstring','path','node-tnef','../../../config/logger','head','value','address','anonymous','name','split','length','slice','join','pop','generate','test','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','isEmpty','email','originTo','originCc','bcc','attach','type','attachment','attachment-','format','%s-%s','now','server/files/attachments/','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line'];(function(_0x5ccb84,_0xb44bb1){var _0x4c21ce=function(_0x185d69){while(--_0x185d69){_0x5ccb84['push'](_0x5ccb84['shift']());}};_0x4c21ce(++_0xb44bb1);}(_0x7f6d,0xb5));var _0xd7f6=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x7f6d[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xd7f6('0x0'));var moment=require(_0xd7f6('0x1'));var random=require(_0xd7f6('0x2'));var fs=require('fs');var path=require(_0xd7f6('0x3'));var util=require('util');var tnef=require(_0xd7f6('0x4'));var logger=require(_0xd7f6('0x5'))('email');var config=require('../../../config/environment');function getAddress(_0x11d246){var _0x5aa590=_[_0xd7f6('0x6')](_0x11d246[_0xd7f6('0x7')]);return _0x5aa590&&_0x5aa590[_0xd7f6('0x8')]?_0x5aa590['address']:_0xd7f6('0x9')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x38de14){var _0x6fbd20=_[_0xd7f6('0x6')](_0x38de14[_0xd7f6('0x7')]);if(_0x6fbd20&&_0x6fbd20[_0xd7f6('0xa')]){if(_0x6fbd20['name']==_0x6fbd20[_0xd7f6('0x8')]){return _0x6fbd20[_0xd7f6('0xa')]['substring'](0x0,_0x6fbd20[_0xd7f6('0xa')]['indexOf']('@'));}var _0x173ae5=_0x6fbd20['name'][_0xd7f6('0xb')](/\s+/);return _0x173ae5[_0xd7f6('0xc')]>0x1?_0x173ae5[_0xd7f6('0xd')](0x0,-0x1)[_0xd7f6('0xe')]('\x20'):_0x6fbd20[_0xd7f6('0xa')];}return'Anonymous';}function getLastName(_0x41cdcc){var _0x125016=_['head'](_0x41cdcc[_0xd7f6('0x7')]);if(_0x125016&&_0x125016[_0xd7f6('0xa')]){var _0x4f8dae=_0x125016[_0xd7f6('0xa')][_0xd7f6('0xb')](/\s+/);return _0x4f8dae['length']>0x1?_0x4f8dae[_0xd7f6('0xf')]():'';}return'';}function getMails(_0x3cdbe0,_0x3504e0){var _0x352b9f='';for(var _0x505f55=0x0;_0x505f55<_0x3504e0[_0xd7f6('0x7')]['length'];_0x505f55+=0x1){if(_0x3504e0['value'][_0x505f55]['address']!==_0x3cdbe0){if(!_['isEmpty'](_0x352b9f)){_0x352b9f+=',';}_0x352b9f+=_0x3504e0[_0xd7f6('0x7')][_0x505f55][_0xd7f6('0xa')]||_0x3504e0['value'][_0x505f55]['address']||'';_0x352b9f+='\x20<';_0x352b9f+=_0x3504e0[_0xd7f6('0x7')][_0x505f55][_0xd7f6('0x8')]?_0x3504e0[_0xd7f6('0x7')][_0x505f55][_0xd7f6('0x8')]:_0xd7f6('0x9')+random[_0xd7f6('0x10')](0x6)+'@xcally.com';_0x352b9f+='>';}}return _0x352b9f;}function parseEmail(_0x4a7b6d,_0x2ddc69,_0x1eaae9){if(_0x2ddc69['html']){var _0x45f01f=/)<[^<]*)*<\/script>/gi;while(_0x45f01f[_0xd7f6('0x11')](_0x2ddc69['html'])){_0x2ddc69[_0xd7f6('0x12')]=_0x2ddc69[_0xd7f6('0x12')][_0xd7f6('0x13')](_0x45f01f,'');}if(_0x2ddc69[_0xd7f6('0x12')][_0xd7f6('0x14')](_0xd7f6('0x15'))){var _0x41dc6d=[];_0x2ddc69[_0xd7f6('0x16')]['forEach'](_0x4bb927=>{_0x41dc6d[_0xd7f6('0x17')](_0x4bb927[_0xd7f6('0x18')]);});var _0x5d4bc9=/]+>/g;var _0x1524ef=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x34f74d=_0x2ddc69['html'][_0xd7f6('0x13')](_0x1524ef,'_SRC');var _0x428267=_0x34f74d['replace'](_0x5d4bc9,'_IMG');for(let _0x32f87c=0x0;_0x32f87c<_0x41dc6d[_0xd7f6('0xc')];_0x32f87c++){var _0x1e2027=_0x428267['replace'](_0xd7f6('0x19'),_0xd7f6('0x1a')+_0x41dc6d[_0x32f87c]+_0xd7f6('0x1b'));_0x428267=_0x1e2027;}_0x2ddc69['html']=_0x428267;}_0x1eaae9[_0xd7f6('0x1c')]=_0x2ddc69[_0xd7f6('0x12')];}else{_0x1eaae9['body']=_0x2ddc69[_0xd7f6('0x1d')];}if(_0x1eaae9[_0xd7f6('0x1c')]){_0x1eaae9[_0xd7f6('0x1c')]=_0x1eaae9[_0xd7f6('0x1c')][_0xd7f6('0x13')](/0x0){var _0x2452f5=[_0xd7f6('0x2e'),_0xd7f6('0x2f'),_0xd7f6('0x30')];for(var _0x4ccedc=0x0;_0x4ccedc<_0x2ddc69['headerLines'][_0xd7f6('0xc')];_0x4ccedc++){var _0x5407b2=_['indexOf'](_0x2452f5,_0x2ddc69['headerLines'][_0x4ccedc][_0xd7f6('0x31')]);if(_0x5407b2>=0x0){_0x1eaae9[_0xd7f6('0x32')]=!![];}}}return _0x1eaae9;}exports[_0xd7f6('0x33')]=function(_0x28d7d8,_0x5a62eb,_0x404f4d){var _0x5f4b3a={'from':getAddress(_0x5a62eb['from']),'firstName':getFirstName(_0x5a62eb[_0xd7f6('0x34')]),'lastName':getLastName(_0x5a62eb['from']),'mapKey':'email','message':{'from':getMails(_0x28d7d8['email'],_0x5a62eb['from']),'to':_0x28d7d8[_0xd7f6('0x20')],'cc':'','subject':_0x5a62eb[_0xd7f6('0x35')]||'','messageId':_0x5a62eb[_0xd7f6('0x36')],'inReplyTo':_0x5a62eb[_0xd7f6('0x37')],'sentAt':moment(_0x5a62eb[_0xd7f6('0x38')])[_0xd7f6('0x28')](_0xd7f6('0x39')),'attach':![],'attachments':[]}};if(!_0x5a62eb[_0xd7f6('0x12')]&&!_0x5a62eb[_0xd7f6('0x1d')]){var _0xcc6b66=_[_0xd7f6('0x3a')](_0x5a62eb[_0xd7f6('0x16')],{'contentType':_0xd7f6('0x3b')});if(_0xcc6b66[_0xd7f6('0xc')]){logger[_0xd7f6('0x3c')](util[_0xd7f6('0x28')](_0xd7f6('0x3d'),_0x5a62eb[_0xd7f6('0x36')]));tnef[_0xd7f6('0x3e')](_[_0xd7f6('0x3f')](_0xcc6b66)['content'],function(_0x25863c,_0x4aedb7){if(_0x4aedb7){_0x5a62eb[_0xd7f6('0x12')]=_0x4aedb7[_0xd7f6('0x40')]||_0xd7f6('0x41');if(_0x4aedb7[_0xd7f6('0x42')]){for(var _0x7a5a76=0x0;_0x7a5a76<_0x4aedb7[_0xd7f6('0x42')][_0xd7f6('0xc')];_0x7a5a76++){var _0x42a262=_0x4aedb7[_0xd7f6('0x42')][_0x7a5a76];_0x5f4b3a[_0xd7f6('0x1e')][_0xd7f6('0x16')][_0xd7f6('0x17')]({'filename':_0x42a262[_0xd7f6('0x43')],'content':Buffer[_0xd7f6('0x34')](_0x42a262['Data'])});}}}_0x404f4d(parseEmail(_0x28d7d8,_0x5a62eb,_0x5f4b3a));});}else{_0x5a62eb[_0xd7f6('0x12')]=_0xd7f6('0x41');_0x404f4d(parseEmail(_0x28d7d8,_0x5a62eb,_0x5f4b3a));}}else{_0x404f4d(parseEmail(_0x28d7d8,_0x5a62eb,_0x5f4b3a));}};exports[_0xd7f6('0x44')]=function(_0x4f2a5d){switch(_0x4f2a5d){case _0xd7f6('0x45'):return _0xd7f6('0x46');case'yahoo':return _0xd7f6('0x47');case'hotmail':return'imap-mail.outlook.com';case'outlook365':return'outlook.office365.com';}return _0xd7f6('0x48');};exports[_0xd7f6('0x49')]=function(_0x61980,_0x3e561d){var _0xca70d8=['user='+(_0x3e561d||''),_0xd7f6('0x4a')+_0x61980,'',''];return Buffer['from'](_0xca70d8[_0xd7f6('0xe')](''),'utf-8')[_0xd7f6('0x4b')](_0xd7f6('0x4c'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 04ead18..1eff9ee 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 _0x8783=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x4e5a48,_0x17e904){var _0x31baef=function(_0x24cff6){while(--_0x24cff6){_0x4e5a48['push'](_0x4e5a48['shift']());}};_0x31baef(++_0x17e904);}(_0x8783,0x92));var _0x3878=function(_0x4119ef,_0x26c3fe){_0x4119ef=_0x4119ef-0x0;var _0x456a79=_0x8783[_0x4119ef];return _0x456a79;};'use strict';var _=require(_0x3878('0x0'));function MailAccount(_0x48bb91){this['id']=_0x48bb91['id']||0x0;this[_0x3878('0x1')]=_0x48bb91[_0x3878('0x1')]||_0x3878('0x2');this[_0x3878('0x3')]=_0x48bb91['key']||_0x3878('0x4');this[_0x3878('0x5')]=_0x48bb91['active']||![];this[_0x3878('0x6')]=_0x48bb91[_0x3878('0x6')]||[];this[_0x3878('0x7')]=_0x48bb91['Smtp']||[];}module[_0x3878('0x8')]=MailAccount; \ No newline at end of file +var _0xf32b=['Smtp','lodash','name','Service','key','SERV','active','Imap'];(function(_0x4ccad7,_0x2daf62){var _0x3a1bc0=function(_0x179659){while(--_0x179659){_0x4ccad7['push'](_0x4ccad7['shift']());}};_0x3a1bc0(++_0x2daf62);}(_0xf32b,0xa1));var _0xbf32=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xf32b[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xbf32('0x0'));function MailAccount(_0x1d4800){this['id']=_0x1d4800['id']||0x0;this[_0xbf32('0x1')]=_0x1d4800[_0xbf32('0x1')]||_0xbf32('0x2');this[_0xbf32('0x3')]=_0x1d4800[_0xbf32('0x3')]||_0xbf32('0x4');this[_0xbf32('0x5')]=_0x1d4800[_0xbf32('0x5')]||![];this[_0xbf32('0x6')]=_0x1d4800[_0xbf32('0x6')]||[];this['Smtp']=_0x1d4800[_0xbf32('0x7')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index d73a9d9..c13d317 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 _0xae35=['merge','exports','lodash','mailAccounts','mapKeys','mergeFromDatabase','hasOwnProperty','prototype','initMailAccounts','length'];(function(_0x4da8ee,_0x318f64){var _0x27ec7a=function(_0x3b6c05){while(--_0x3b6c05){_0x4da8ee['push'](_0x4da8ee['shift']());}};_0x27ec7a(++_0x318f64);}(_0xae35,0x1d8));var _0x5ae3=function(_0x1203de,_0x87b16e){_0x1203de=_0x1203de-0x0;var _0x1fbb2c=_0xae35[_0x1203de];return _0x1fbb2c;};'use strict';var _=require(_0x5ae3('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x5ae3('0x1')]={};};function freeIsNotKey(_0x5a78ec,_0x2e4ff6,_0x4c7902){var _0xea1f86=_[_0x5ae3('0x2')](_0x5a78ec,function(_0x3a3afe,_0xf8b4ce){return _0x3a3afe[_0x4c7902];});for(var _0x1553f1 in _0x2e4ff6){if(_0x2e4ff6['hasOwnProperty'](_0x1553f1)){if(!_0xea1f86[_0x1553f1]){delete _0x2e4ff6[_0x1553f1];}}}}Realtime['prototype'][_0x5ae3('0x3')]=function(_0x368333,_0x2373a8){for(var _0xab404b in _0x2373a8){if(_0x368333[_0x5ae3('0x4')](_0xab404b)){_0x368333[_0xab404b]=_0x2373a8[_0xab404b];}}};Realtime[_0x5ae3('0x5')][_0x5ae3('0x6')]=function(){var _0x29fa06=this;return function(_0x26f3b6){if(_0x26f3b6){freeIsNotKey(_0x26f3b6,_0x29fa06[_0x5ae3('0x1')],'id');for(var _0x14c589=0x0,_0x1de452={},_0x341286={};_0x14c589<_0x26f3b6[_0x5ae3('0x7')];_0x14c589+=0x1){_0x1de452=_0x26f3b6[_0x14c589];if(_['isUndefined'](_0x29fa06[_0x5ae3('0x1')][_0x1de452['id']])){_0x29fa06[_0x5ae3('0x1')][_0x1de452['id']]=new MailAccount(_0x1de452);}else{_[_0x5ae3('0x8')](_0x29fa06[_0x5ae3('0x1')][_0x1de452['id']],_0x1de452);}}}return _0x29fa06[_0x5ae3('0x1')];};};module[_0x5ae3('0x9')]=Realtime; \ No newline at end of file +var _0x7d12=['initMailAccounts','mailAccounts','length','isUndefined','merge','exports','../model/mailAccount','mapKeys','prototype','mergeFromDatabase'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7d12,0x150));var _0x27d1=function(_0x414131,_0x336933){_0x414131=_0x414131-0x0;var _0x4c873f=_0x7d12[_0x414131];return _0x4c873f;};'use strict';var _=require('lodash');var MailAccount=require(_0x27d1('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x36912c,_0x3d342e,_0x2a9d22){var _0x123b15=_[_0x27d1('0x1')](_0x36912c,function(_0x284c75,_0x559939){return _0x284c75[_0x2a9d22];});for(var _0x3f276c in _0x3d342e){if(_0x3d342e['hasOwnProperty'](_0x3f276c)){if(!_0x123b15[_0x3f276c]){delete _0x3d342e[_0x3f276c];}}}}Realtime[_0x27d1('0x2')][_0x27d1('0x3')]=function(_0x15bd02,_0x5b2102){for(var _0x129139 in _0x5b2102){if(_0x15bd02['hasOwnProperty'](_0x129139)){_0x15bd02[_0x129139]=_0x5b2102[_0x129139];}}};Realtime[_0x27d1('0x2')][_0x27d1('0x4')]=function(){var _0x614b10=this;return function(_0x23bb06){if(_0x23bb06){freeIsNotKey(_0x23bb06,_0x614b10[_0x27d1('0x5')],'id');for(var _0x48bf35=0x0,_0x42d562={},_0x402523={};_0x48bf35<_0x23bb06[_0x27d1('0x6')];_0x48bf35+=0x1){_0x42d562=_0x23bb06[_0x48bf35];if(_[_0x27d1('0x7')](_0x614b10[_0x27d1('0x5')][_0x42d562['id']])){_0x614b10[_0x27d1('0x5')][_0x42d562['id']]=new MailAccount(_0x42d562);}else{_[_0x27d1('0x8')](_0x614b10[_0x27d1('0x5')][_0x42d562['id']],_0x42d562);}}}return _0x614b10[_0x27d1('0x5')];};};module[_0x27d1('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 272ec5c..0ff8918 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 _0x8c97=['data5','MailServerOut','type','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider','service','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','name'];(function(_0x37c36d,_0x183dc7){var _0x44bc17=function(_0xf5901b){while(--_0xf5901b){_0x37c36d['push'](_0x37c36d['shift']());}};_0x44bc17(++_0x183dc7);}(_0x8c97,0x194));var _0x78c9=function(_0x332e61,_0x169a93){_0x332e61=_0x332e61-0x0;var _0x385dfd=_0x8c97[_0x332e61];return _0x385dfd;};'use strict';var client=require(_0x78c9('0x0'));exports[_0x78c9('0x1')]=function(){return function(){return client[_0x78c9('0x2')](_0x78c9('0x3'),{'options':{'attributes':['id','name',_0x78c9('0x4'),_0x78c9('0x5'),'email',_0x78c9('0x6'),_0x78c9('0x7'),_0x78c9('0x8'),_0x78c9('0x9')],'raw':![],'include':[{'model':_0x78c9('0xa'),'as':_0x78c9('0xb'),'include':[{'model':_0x78c9('0xc'),'attributes':['id',_0x78c9('0xd'),_0x78c9('0x5'),'type',_0x78c9('0xe')],'as':_0x78c9('0xc')}]},{'model':_0x78c9('0xf'),'as':'Smtp','include':[{'model':_0x78c9('0xc'),'attributes':['id',_0x78c9('0xd'),_0x78c9('0x5'),_0x78c9('0x10'),_0x78c9('0xe')],'as':_0x78c9('0xc')}]}]},'log':_0x78c9('0x11')});};};exports['notify']=function(_0x37c348,_0x106d3e){return client[_0x78c9('0x2')]('NotifyMailAccount',{'account':{'id':_0x37c348},'body':_0x106d3e,'log':_0x78c9('0x12')});}; \ No newline at end of file +var _0xb7ac=['Request','GetMailAccount','name','service','active','key','TemplateId','MailServerIn','Imap','type','CloudProvider','MailServerOut','Smtp','data5','getMailAccount','NotifyMailAccount','../client','getMailAccounts'];(function(_0x3a83c8,_0x489ffd){var _0x5c89db=function(_0x35a94a){while(--_0x35a94a){_0x3a83c8['push'](_0x3a83c8['shift']());}};_0x5c89db(++_0x489ffd);}(_0xb7ac,0x18a));var _0xcb7a=function(_0x14172a,_0x48c8ff){_0x14172a=_0x14172a-0x0;var _0x58446b=_0xb7ac[_0x14172a];return _0x58446b;};'use strict';var client=require(_0xcb7a('0x0'));exports[_0xcb7a('0x1')]=function(){return function(){return client[_0xcb7a('0x2')](_0xcb7a('0x3'),{'options':{'attributes':['id',_0xcb7a('0x4'),'provider',_0xcb7a('0x5'),'email',_0xcb7a('0x6'),_0xcb7a('0x7'),'ListId',_0xcb7a('0x8')],'raw':![],'include':[{'model':_0xcb7a('0x9'),'as':_0xcb7a('0xa'),'include':[{'model':'CloudProvider','attributes':['id','name',_0xcb7a('0x5'),_0xcb7a('0xb'),'data5'],'as':_0xcb7a('0xc')}]},{'model':_0xcb7a('0xd'),'as':_0xcb7a('0xe'),'include':[{'model':_0xcb7a('0xc'),'attributes':['id',_0xcb7a('0x4'),_0xcb7a('0x5'),'type',_0xcb7a('0xf')],'as':_0xcb7a('0xc')}]}]},'log':_0xcb7a('0x10')});};};exports['notify']=function(_0x51409d,_0x41939f){return client['Request'](_0xcb7a('0x11'),{'account':{'id':_0x51409d},'body':_0x41939f,'log':_0xcb7a('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index e1523c7..bab9362 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 _0x056e=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0x056e,0x155));var _0xe056=function(_0x350aeb,_0x3d265a){_0x350aeb=_0x350aeb-0x0;var _0x3c5273=_0x056e[_0x350aeb];return _0x3c5273;};'use strict';var client=require(_0xe056('0x0'));exports[_0xe056('0x1')]=function(){return client[_0xe056('0x2')](_0xe056('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xe056('0x4')});}; \ No newline at end of file +var _0x86b4=['getSettings','Request','ShowSetting','../client'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x86b4,0x17f));var _0x486b=function(_0xe1cbb8,_0x390451){_0xe1cbb8=_0xe1cbb8-0x0;var _0x2058a7=_0x86b4[_0xe1cbb8];return _0x2058a7;};'use strict';var client=require(_0x486b('0x0'));exports[_0x486b('0x1')]=function(){return client[_0x486b('0x2')](_0x486b('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 51261e0..9d2422e 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 ba2a94a..e83418c 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 _0x06f7=['../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','socket.io','redis','localhost','adapter','socket.io-redis','default','../../config/socketio','../../config/express'];(function(_0x40b66c,_0x578758){var _0x2fd22b=function(_0x3b721b){while(--_0x3b721b){_0x40b66c['push'](_0x40b66c['shift']());}};_0x2fd22b(++_0x578758);}(_0x06f7,0x1a9));var _0x706f=function(_0x51ac09,_0x383098){_0x51ac09=_0x51ac09-0x0;var _0x3f827d=_0x06f7[_0x51ac09];return _0x3f827d;};'use strict';var _=require('lodash');var http=require('http');var express=require(_0x706f('0x0'));var sticky=require(_0x706f('0x1'));var Redis=require(_0x706f('0x2'));var config=require(_0x706f('0x3'));var app=express();var server=http[_0x706f('0x4')](app);server[_0x706f('0x5')]=0xdbba0;if(sticky[_0x706f('0x6')](server,config['port'])){var socketio=require(_0x706f('0x7'))(server,{'transports':['websocket','polling']});config[_0x706f('0x8')]=_['defaults'](config['redis'],{'host':_0x706f('0x9'),'port':0x18eb});socketio[_0x706f('0xa')](require(_0x706f('0xb'))({'pubClient':new Redis(config[_0x706f('0x8')]),'subClient':new Redis(config[_0x706f('0x8')])}));require('../../config/triggers')[_0x706f('0xc')]();require(_0x706f('0xd'))[_0x706f('0xc')](socketio);require(_0x706f('0xe'))[_0x706f('0xc')](app);require(_0x706f('0xf'))['default'](app);}else{server['once'](_0x706f('0x10'),function(){console[_0x706f('0x11')](_0x706f('0x12'),config['port']);});}exports=module[_0x706f('0x13')]=app; \ No newline at end of file +var _0xece2=['socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','once','listening','port','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','socket.io','websocket','polling','defaults','redis','adapter'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xece2,0xc0));var _0x2ece=function(_0x30f08a,_0x2e112e){_0x30f08a=_0x30f08a-0x0;var _0x1416c5=_0xece2[_0x30f08a];return _0x1416c5;};'use strict';var _=require(_0x2ece('0x0'));var http=require(_0x2ece('0x1'));var express=require(_0x2ece('0x2'));var sticky=require(_0x2ece('0x3'));var Redis=require(_0x2ece('0x4'));var config=require(_0x2ece('0x5'));var app=express();var server=http[_0x2ece('0x6')](app);server[_0x2ece('0x7')]=0xdbba0;if(sticky[_0x2ece('0x8')](server,config['port'])){var socketio=require(_0x2ece('0x9'))(server,{'transports':[_0x2ece('0xa'),_0x2ece('0xb')]});config['redis']=_[_0x2ece('0xc')](config[_0x2ece('0xd')],{'host':'localhost','port':0x18eb});socketio[_0x2ece('0xe')](require(_0x2ece('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x2ece('0xd')])}));require(_0x2ece('0x10'))[_0x2ece('0x11')]();require(_0x2ece('0x12'))[_0x2ece('0x11')](socketio);require('../../config/express')[_0x2ece('0x11')](app);require(_0x2ece('0x13'))['default'](app);}else{server[_0x2ece('0x14')](_0x2ece('0x15'),function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x2ece('0x16')]);});}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 b9e568d..ed0ab67 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 _0xbaa6=['debug','rpc','routing','error','message','result','catch','jayson/promise','bluebird','../../config/logger','http','Request','then'];(function(_0x1249e6,_0x269ca6){var _0x423334=function(_0x2ccf7d){while(--_0x2ccf7d){_0x1249e6['push'](_0x1249e6['shift']());}};_0x423334(++_0x269ca6);}(_0xbaa6,0x6f));var _0x6baa=function(_0x3550e8,_0x424fea){_0x3550e8=_0x3550e8-0x0;var _0x18eb61=_0xbaa6[_0x3550e8];return _0x18eb61;};'use strict';var jayson=require(_0x6baa('0x0'));var BPromise=require(_0x6baa('0x1'));var logger=require(_0x6baa('0x2'))('routing');var client=jayson['client'][_0x6baa('0x3')]({'port':0x2329});client[_0x6baa('0x4')]=function(_0x15f466,_0x215e37){return new BPromise(function(_0x170f27,_0x5ace54){return client['request'](_0x15f466,_0x215e37)[_0x6baa('0x5')](function(_0x42cc7d){logger[_0x6baa('0x6')](_0x6baa('0x7'),_0x6baa('0x8'),_0x15f466,_0x215e37,_0x42cc7d);if(_0x42cc7d[_0x6baa('0x9')]){logger[_0x6baa('0x9')](_0x6baa('0x7'),_0x6baa('0x8'),_0x15f466,_0x42cc7d['error'][_0x6baa('0xa')],_0x215e37);return _0x5ace54(_0x42cc7d[_0x6baa('0x9')][_0x6baa('0xa')]);}else{return _0x170f27(_0x42cc7d[_0x6baa('0xb')]);}})[_0x6baa('0xc')](function(_0x134508){logger['error'](_0x6baa('0x7'),'routing',_0x15f466,_0x134508,_0x215e37);return _0x5ace54(_0x134508);});});};module['exports']=client; \ No newline at end of file +var _0x9ab4=['catch','exports','bluebird','routing','client','request','then','debug','rpc','error','message','result'];(function(_0x57ede0,_0x2c5e8c){var _0x60056=function(_0x588cd2){while(--_0x588cd2){_0x57ede0['push'](_0x57ede0['shift']());}};_0x60056(++_0x2c5e8c);}(_0x9ab4,0xce));var _0x49ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ab4[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x49ab('0x0'));var logger=require('../../config/logger')(_0x49ab('0x1'));var client=jayson[_0x49ab('0x2')]['http']({'port':0x2329});client['Request']=function(_0x286ce1,_0x106b55){return new BPromise(function(_0x206741,_0x4a4366){return client[_0x49ab('0x3')](_0x286ce1,_0x106b55)[_0x49ab('0x4')](function(_0x3f7c1d){logger[_0x49ab('0x5')](_0x49ab('0x6'),_0x49ab('0x1'),_0x286ce1,_0x106b55,_0x3f7c1d);if(_0x3f7c1d[_0x49ab('0x7')]){logger['error']('rpc',_0x49ab('0x1'),_0x286ce1,_0x3f7c1d[_0x49ab('0x7')]['message'],_0x106b55);return _0x4a4366(_0x3f7c1d[_0x49ab('0x7')][_0x49ab('0x8')]);}else{return _0x206741(_0x3f7c1d[_0x49ab('0x9')]);}})[_0x49ab('0xa')](function(_0x2275dc){logger[_0x49ab('0x7')](_0x49ab('0x6'),_0x49ab('0x1'),_0x286ce1,_0x2275dc,_0x106b55);return _0x4a4366(_0x2275dc);});});};module[_0x49ab('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 28d1d08..e492ab2 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 _0xd383=['./rpc/faxQueue','then','getIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue'];(function(_0x40f4c5,_0x20c453){var _0x2a5533=function(_0x1de6f1){while(--_0x1de6f1){_0x40f4c5['push'](_0x40f4c5['shift']());}};_0x2a5533(++_0x20c453);}(_0xd383,0x74));var _0x3d38=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xd383[_0x1573ea];return _0x51c0e2;};'use strict';var BPromise=require(_0x3d38('0x0'));var server=require(_0x3d38('0x1'));var Realtime=require(_0x3d38('0x2'));var user=require(_0x3d38('0x3'));var interval=require(_0x3d38('0x4'));var openchannelQueue=require(_0x3d38('0x5'));var chatQueue=require(_0x3d38('0x6'));var smsQueue=require(_0x3d38('0x7'));var mailQueue=require(_0x3d38('0x8'));var faxQueue=require(_0x3d38('0x9'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x3d38('0xa')](user['getAgents']())[_0x3d38('0xa')](realtime['initAgents']())[_0x3d38('0xa')](interval[_0x3d38('0xb')]())[_0x3d38('0xa')](realtime['initIntervals']())[_0x3d38('0xa')](openchannelQueue[_0x3d38('0xc')]())[_0x3d38('0xa')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x3d38('0xd')]())[_0x3d38('0xa')](realtime[_0x3d38('0xe')]())['then'](smsQueue[_0x3d38('0xf')]())[_0x3d38('0xa')](realtime[_0x3d38('0x10')]())[_0x3d38('0xa')](mailQueue[_0x3d38('0x11')]())[_0x3d38('0xa')](realtime[_0x3d38('0x12')]())[_0x3d38('0xa')](faxQueue[_0x3d38('0x13')]())['then'](realtime[_0x3d38('0x14')]())[_0x3d38('0xa')](whatsappQueue[_0x3d38('0x15')]())[_0x3d38('0xa')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0x3d38('0x16')](realtime)[_0x3d38('0xa')](function(_0xe6808a){return initRealtime();})['then'](function(_0xb4935a){return setInterval(initRealtime,0x1388);})[_0x3d38('0x17')](function(_0x403483){console[_0x3d38('0x18')](_0x403483);});}main(); \ No newline at end of file +var _0x314e=['initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues'];(function(_0xa38403,_0x222f8d){var _0x15321d=function(_0x13dce9){while(--_0x13dce9){_0xa38403['push'](_0xa38403['shift']());}};_0x15321d(++_0x222f8d);}(_0x314e,0x7f));var _0xe314=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x314e[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require('bluebird');var server=require(_0xe314('0x0'));var Realtime=require(_0xe314('0x1'));var user=require(_0xe314('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xe314('0x3'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xe314('0x4'));var mailQueue=require(_0xe314('0x5'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xe314('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xe314('0x7')](user[_0xe314('0x8')]())[_0xe314('0x7')](realtime[_0xe314('0x9')]())['then'](interval[_0xe314('0xa')]())[_0xe314('0x7')](realtime[_0xe314('0xb')]())[_0xe314('0x7')](openchannelQueue[_0xe314('0xc')]())['then'](realtime['initOpenchannelQueues']())['then'](chatQueue['getChatQueues']())[_0xe314('0x7')](realtime[_0xe314('0xd')]())[_0xe314('0x7')](smsQueue[_0xe314('0xe')]())[_0xe314('0x7')](realtime[_0xe314('0xf')]())[_0xe314('0x7')](mailQueue[_0xe314('0x10')]())['then'](realtime[_0xe314('0x11')]())[_0xe314('0x7')](faxQueue[_0xe314('0x12')]())[_0xe314('0x7')](realtime[_0xe314('0x13')]())['then'](whatsappQueue[_0xe314('0x14')]())[_0xe314('0x7')](realtime['initWhatsappQueues']())[_0xe314('0x7')](function(){return realtime;});}function main(){return server[_0xe314('0x15')](realtime)[_0xe314('0x7')](function(_0x2a5bc3){return initRealtime();})[_0xe314('0x7')](function(_0xa3df7d){return setInterval(initRealtime,0x1388);})[_0xe314('0x16')](function(_0x320628){console[_0xe314('0x17')](_0x320628);});}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 efc2fc3..beb6dd6 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 _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x11a583,_0x3a650d){var _0x5c0d03=function(_0x24dcdb){while(--_0x24dcdb){_0x11a583['push'](_0x11a583['shift']());}};_0x5c0d03(++_0x3a650d);}(_0x7a54,0x106));var _0x47a5=function(_0xe9aa6f,_0x10a1f1){_0xe9aa6f=_0xe9aa6f-0x0;var _0x984ad2=_0x7a54[_0xe9aa6f];return _0x984ad2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x238bb6,_0x3b770e){var _0xfcdba8=function(_0x4308b1){while(--_0x4308b1){_0x238bb6['push'](_0x238bb6['shift']());}};_0xfcdba8(++_0x3b770e);}(_0x2ef3,0xba));var _0x32ef=function(_0x3d027d,_0x18baa3){_0x3d027d=_0x3d027d-0x0;var _0x475bc7=_0x2ef3[_0x3d027d];return _0x475bc7;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 5232a64..0f9863f 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 _0x8a12=['bluebird','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x405b0d,_0x330b70){var _0x2c41d0=function(_0x24d889){while(--_0x24d889){_0x405b0d['push'](_0x405b0d['shift']());}};_0x2c41d0(++_0x330b70);}(_0x8a12,0xcf));var _0x28a1=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8a12[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0x28a1('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x28a1('0x1')]({'port':0x232b});function request(_0x2b019f,_0x4f817c){return new BPromise(function(_0x2a0db7,_0x358db3){return client[_0x28a1('0x2')](_0x2b019f,_0x4f817c)[_0x28a1('0x3')](function(_0x33259a){if(_0x33259a[_0x28a1('0x4')]){return _0x358db3(_0x33259a[_0x28a1('0x4')]['message']);}else{return _0x2a0db7(_0x33259a[_0x28a1('0x5')]);}})[_0x28a1('0x6')](function(_0x4c4b7d){return _0x358db3(_0x4c4b7d);});});}exports[_0x28a1('0x7')]=function(_0x500adc,_0x7ad529){return request(_0x28a1('0x8'),{'account':_0x500adc,'message':_0x7ad529});}; \ No newline at end of file +var _0xc2b0=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','then','error'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xc2b0,0x1a8));var _0x0c2b=function(_0x37dc1d,_0xbf91ef){_0x37dc1d=_0x37dc1d-0x0;var _0x4ac931=_0xc2b0[_0x37dc1d];return _0x4ac931;};'use strict';var BPromise=require(_0x0c2b('0x0'));var jayson=require(_0x0c2b('0x1'));var client=jayson[_0x0c2b('0x2')][_0x0c2b('0x3')]({'port':0x232b});function request(_0x199bad,_0x5b9cb7){return new BPromise(function(_0x405145,_0x563701){return client['request'](_0x199bad,_0x5b9cb7)[_0x0c2b('0x4')](function(_0x5d7ad1){if(_0x5d7ad1[_0x0c2b('0x5')]){return _0x563701(_0x5d7ad1['error']['message']);}else{return _0x405145(_0x5d7ad1[_0x0c2b('0x6')]);}})[_0x0c2b('0x7')](function(_0x4612f0){return _0x563701(_0x4612f0);});});}exports[_0x0c2b('0x8')]=function(_0x15dc61,_0x8f099d){return request(_0x0c2b('0x9'),{'account':_0x15dc61,'message':_0x8f099d});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 2466f45..bf774eb 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 _0x566f=['faxStatus','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','openchannel','fax','sms','whatsapp','Status','StatusTime','toNumber','format','mailStatus','mailCurrentCapacity','faxCurrentCapacity','smsStatusTime','whatsappStatus','openchannelStatusTime','busy','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','chatCurrentCapacity','mailStatusTime','mailCapacity'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x566f,0x124));var _0xf566=function(_0x4346ab,_0x33a311){_0x4346ab=_0x4346ab-0x0;var _0x472234=_0x566f[_0x4346ab];return _0x472234;};'use strict';var _=require(_0xf566('0x0'));var moment=require(_0xf566('0x1'));var md5=require(_0xf566('0x2'));var Redis=require(_0xf566('0x3'));var config=require(_0xf566('0x4'));config[_0xf566('0x5')]=_[_0xf566('0x6')](config[_0xf566('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf566('0x7'))(new Redis(config[_0xf566('0x5')]));function Agent(_0x1a6dbc){this['id']=_0x1a6dbc['id']||0x0;this[_0xf566('0x8')]=_0x1a6dbc['name']||'';this[_0xf566('0x9')]=_0x1a6dbc[_0xf566('0x9')]||!![];this[_0xf566('0xa')]=_0x1a6dbc[_0xf566('0xa')]||![];this['chatPause']=_0x1a6dbc[_0xf566('0xb')]||![];this['mailPause']=_0x1a6dbc[_0xf566('0xc')]||![];this[_0xf566('0xd')]=_0x1a6dbc[_0xf566('0xd')]||![];this[_0xf566('0xe')]=_0x1a6dbc['smsPause']||![];this[_0xf566('0xf')]=_0x1a6dbc[_0xf566('0xf')]||![];this[_0xf566('0x10')]=_0xf566('0x11');this[_0xf566('0x12')]=0x0;this[_0xf566('0x13')]=_0x1a6dbc[_0xf566('0x13')]||0x0;this[_0xf566('0x14')]=0x0;this['mailStatus']=_0xf566('0x11');this[_0xf566('0x15')]=0x0;this[_0xf566('0x16')]=_0x1a6dbc[_0xf566('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xf566('0x17')]='unknown';this['faxStatusTime']=0x0;this[_0xf566('0x18')]=_0x1a6dbc[_0xf566('0x18')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xf566('0x19')]=_0xf566('0x11');this['smsStatusTime']=0x0;this[_0xf566('0x1a')]=_0x1a6dbc['smsCapacity']||0x0;this[_0xf566('0x1b')]=0x0;this['whatsappStatus']=_0xf566('0x11');this[_0xf566('0x1c')]=0x0;this['whatsappCapacity']=_0x1a6dbc[_0xf566('0x1d')]||0x0;this[_0xf566('0x1e')]=0x0;this[_0xf566('0x1f')]=_0xf566('0x11');this['openchannelStatusTime']=0x0;this[_0xf566('0x20')]=_0x1a6dbc[_0xf566('0x20')]||0x0;this[_0xf566('0x21')]=0x0;this['busy']=![];this[_0xf566('0x22')]=undefined;this[_0xf566('0x2')]='';this[_0xf566('0x23')]();}Agent[_0xf566('0x24')][_0xf566('0x25')]=function(_0xd52b66){if(this[_0xd52b66+_0xf566('0x26')]>0x0){if(this[_0xd52b66+_0xf566('0x27')]>0x0&&this[_0xd52b66+_0xf566('0x26')]>=this[_0xd52b66+_0xf566('0x27')]){return _0xf566('0x28');}else{return'working';}}else{return _0xf566('0x29');}};Agent[_0xf566('0x24')]['updateRealtime']=function(){var _0x11a476=[_0xf566('0x2a'),_0xf566('0x2b'),_0xf566('0x2c'),_0xf566('0x2d'),_0xf566('0x2e'),_0xf566('0x2f')];for(var _0x575113=0x0;_0x575113<_0x11a476['length'];_0x575113+=0x1){var _0xde2d8c=this[_0xf566('0x25')](_0x11a476[_0x575113]);if(this[_0x11a476[_0x575113]+_0xf566('0x30')]!==_0xde2d8c){this[_0x11a476[_0x575113]+_0xf566('0x31')]=_[_0xf566('0x32')](moment()[_0xf566('0x33')]('x'));}this[_0x11a476[_0x575113]+'Status']=_0xde2d8c;}var _0x2c933c={'id':this['id'],'name':this[_0xf566('0x8')],'online':this[_0xf566('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0xf566('0xb')],'mailPause':this[_0xf566('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0xf566('0xd')],'openchannelPause':this[_0xf566('0xf')],'chatStatus':this[_0xf566('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xf566('0x13')],'chatCurrentCapacity':this[_0xf566('0x14')],'mailStatus':this[_0xf566('0x34')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xf566('0x16')],'mailCurrentCapacity':this[_0xf566('0x35')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xf566('0x18')],'faxCurrentCapacity':this[_0xf566('0x36')],'smsStatus':this[_0xf566('0x19')],'smsStatusTime':this[_0xf566('0x37')],'smsCapacity':this[_0xf566('0x1a')],'smsCurrentCapacity':this[_0xf566('0x1b')],'whatsappStatus':this[_0xf566('0x38')],'whatsappStatusTime':this[_0xf566('0x1c')],'whatsappCapacity':this[_0xf566('0x1d')],'whatsappCurrentCapacity':this[_0xf566('0x1e')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xf566('0x39')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xf566('0x21')],'busy':this[_0xf566('0x3a')],'busyQueue':this[_0xf566('0x22')]};var _0x113a02=md5(JSON[_0xf566('0x3b')](_0x2c933c));if(this[_0xf566('0x2')]!==_0x113a02){this[_0xf566('0x2')]=_0x113a02;io[_0xf566('0x3c')](_0xf566('0x3d'),_0x2c933c);}};module[_0xf566('0x3e')]=Agent; \ No newline at end of file +var _0x856e=['chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','getChannelStatus','Capacity','maxcapacity','working','idle','openchannel','fax','whatsapp','length','Status','StatusTime','format','smsStatus','stringify','emit','user:save','exports','lodash','moment','ioredis','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause'];(function(_0x5443ca,_0x5ad082){var _0x505ade=function(_0x24b1b7){while(--_0x24b1b7){_0x5443ca['push'](_0x5443ca['shift']());}};_0x505ade(++_0x5ad082);}(_0x856e,0xa0));var _0xe856=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0x856e[_0x5ef161];return _0x1c6e9e;};'use strict';var _=require(_0xe856('0x0'));var moment=require(_0xe856('0x1'));var md5=require('md5');var Redis=require(_0xe856('0x2'));var config=require(_0xe856('0x3'));config['redis']=_['defaults'](config[_0xe856('0x4')],{'host':_0xe856('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe856('0x4')]));function Agent(_0x1caadf){this['id']=_0x1caadf['id']||0x0;this['name']=_0x1caadf[_0xe856('0x6')]||'';this[_0xe856('0x7')]=_0x1caadf['online']||!![];this[_0xe856('0x8')]=_0x1caadf[_0xe856('0x8')]||![];this['chatPause']=_0x1caadf[_0xe856('0x9')]||![];this[_0xe856('0xa')]=_0x1caadf[_0xe856('0xa')]||![];this['faxPause']=_0x1caadf[_0xe856('0xb')]||![];this[_0xe856('0xc')]=_0x1caadf[_0xe856('0xc')]||![];this['openchannelPause']=_0x1caadf[_0xe856('0xd')]||![];this[_0xe856('0xe')]=_0xe856('0xf');this[_0xe856('0x10')]=0x0;this['chatCapacity']=_0x1caadf[_0xe856('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xe856('0x12')]=_0xe856('0xf');this[_0xe856('0x13')]=0x0;this[_0xe856('0x14')]=_0x1caadf['mailCapacity']||0x0;this[_0xe856('0x15')]=0x0;this[_0xe856('0x16')]='unknown';this[_0xe856('0x17')]=0x0;this[_0xe856('0x18')]=_0x1caadf['faxCapacity']||0x0;this[_0xe856('0x19')]=0x0;this['smsStatus']='unknown';this[_0xe856('0x1a')]=0x0;this[_0xe856('0x1b')]=_0x1caadf['smsCapacity']||0x0;this[_0xe856('0x1c')]=0x0;this[_0xe856('0x1d')]='unknown';this[_0xe856('0x1e')]=0x0;this[_0xe856('0x1f')]=_0x1caadf[_0xe856('0x1f')]||0x0;this[_0xe856('0x20')]=0x0;this[_0xe856('0x21')]='unknown';this[_0xe856('0x22')]=0x0;this[_0xe856('0x23')]=_0x1caadf[_0xe856('0x23')]||0x0;this[_0xe856('0x24')]=0x0;this[_0xe856('0x25')]=![];this[_0xe856('0x26')]=undefined;this[_0xe856('0x27')]='';this[_0xe856('0x28')]();}Agent['prototype'][_0xe856('0x29')]=function(_0x41ab3a){if(this[_0x41ab3a+'CurrentCapacity']>0x0){if(this[_0x41ab3a+_0xe856('0x2a')]>0x0&&this[_0x41ab3a+'CurrentCapacity']>=this[_0x41ab3a+_0xe856('0x2a')]){return _0xe856('0x2b');}else{return _0xe856('0x2c');}}else{return _0xe856('0x2d');}};Agent['prototype'][_0xe856('0x28')]=function(){var _0x463156=['mail','chat',_0xe856('0x2e'),_0xe856('0x2f'),'sms',_0xe856('0x30')];for(var _0x28561c=0x0;_0x28561c<_0x463156[_0xe856('0x31')];_0x28561c+=0x1){var _0x26b052=this[_0xe856('0x29')](_0x463156[_0x28561c]);if(this[_0x463156[_0x28561c]+_0xe856('0x32')]!==_0x26b052){this[_0x463156[_0x28561c]+_0xe856('0x33')]=_['toNumber'](moment()[_0xe856('0x34')]('x'));}this[_0x463156[_0x28561c]+_0xe856('0x32')]=_0x26b052;}var _0x2ba305={'id':this['id'],'name':this[_0xe856('0x6')],'online':this[_0xe856('0x7')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0xe856('0xa')],'smsPause':this[_0xe856('0xc')],'faxPause':this[_0xe856('0xb')],'openchannelPause':this[_0xe856('0xd')],'chatStatus':this[_0xe856('0xe')],'chatStatusTime':this[_0xe856('0x10')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xe856('0x12')],'mailStatusTime':this[_0xe856('0x13')],'mailCapacity':this[_0xe856('0x14')],'mailCurrentCapacity':this[_0xe856('0x15')],'faxStatus':this[_0xe856('0x16')],'faxStatusTime':this[_0xe856('0x17')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xe856('0x35')],'smsStatusTime':this[_0xe856('0x1a')],'smsCapacity':this[_0xe856('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xe856('0x1e')],'whatsappCapacity':this[_0xe856('0x1f')],'whatsappCurrentCapacity':this[_0xe856('0x20')],'openchannelStatus':this[_0xe856('0x21')],'openchannelStatusTime':this[_0xe856('0x22')],'openchannelCapacity':this[_0xe856('0x23')],'openchannelCurrentCapacity':this[_0xe856('0x24')],'busy':this[_0xe856('0x25')],'busyQueue':this[_0xe856('0x26')]};var _0x2b9403=md5(JSON[_0xe856('0x36')](_0x2ba305));if(this[_0xe856('0x27')]!==_0x2b9403){this['md5']=_0x2b9403;io[_0xe856('0x37')](_0xe856('0x38'),_0x2ba305);}};module[_0xe856('0x39')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 4cf8e42..768f7b1 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 _0xaeb4=['format','chat:queue:%s','emit','chat_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','paused','length','online','chatPause','available','stringify','md5'];(function(_0x16de68,_0x33d7ff){var _0x1c277e=function(_0x1d8549){while(--_0x1d8549){_0x16de68['push'](_0x16de68['shift']());}};_0x1c277e(++_0x33d7ff);}(_0xaeb4,0xbe));var _0x4aeb=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0xaeb4[_0x173452];return _0xee3fd0;};'use strict';var _=require(_0x4aeb('0x0'));var md5=require('md5');var util=require(_0x4aeb('0x1'));var Redis=require(_0x4aeb('0x2'));var config=require(_0x4aeb('0x3'));config[_0x4aeb('0x4')]=_[_0x4aeb('0x5')](config[_0x4aeb('0x4')],{'host':_0x4aeb('0x6'),'port':0x18eb});var io=require(_0x4aeb('0x7'))(new Redis(config['redis']));function ChatQueue(_0x273935){this['id']=_0x273935['id']||0x0;this['name']=_0x273935[_0x4aeb('0x8')]||'';this[_0x4aeb('0x9')]=_0x273935[_0x4aeb('0x9')]||0xa;this['strategy']=_0x273935['strategy']||_0x4aeb('0xa');this[_0x4aeb('0xb')]=_0x273935[_0x4aeb('0xb')];this[_0x4aeb('0xc')]={};this[_0x4aeb('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x4aeb('0xe')]();}ChatQueue[_0x4aeb('0xf')][_0x4aeb('0x10')]=function(){var _0x17e5b7=this['mapAgentsId']['_rr'];this[_0x4aeb('0xc')]=_[_0x4aeb('0x11')](this[_0x4aeb('0xb')],'id');this['mapAgentsId'][_0x4aeb('0x12')]=_0x17e5b7;};ChatQueue[_0x4aeb('0xf')]['updateRealtime']=function(){this[_0x4aeb('0x13')]=0x0;this[_0x4aeb('0x14')]=0x0;for(var _0x5be722=0x0;_0x5be722=0x0?this['available']:0x0;var _0x46dfc2={'id':this['id'],'available':this['available'],'loggedIn':this[_0x4aeb('0x13')],'name':this[_0x4aeb('0x8')],'paused':this['paused'],'waiting':this[_0x4aeb('0xd')]};var _0x284d56=md5(JSON[_0x4aeb('0x19')](_0x46dfc2));if(this[_0x4aeb('0x1a')]!==_0x284d56){this['md5']=_0x284d56;io['to'](util[_0x4aeb('0x1b')](_0x4aeb('0x1c'),_0x46dfc2[_0x4aeb('0x8')]))[_0x4aeb('0x1d')](_0x4aeb('0x1e'),_0x46dfc2);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xe8f7=['socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','length','paused','available','chat:queue:%s','exports','lodash','md5','util','ioredis','redis','defaults','localhost'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe8f7,0xa8));var _0x7e8f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe8f7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7e8f('0x0'));var md5=require(_0x7e8f('0x1'));var util=require(_0x7e8f('0x2'));var Redis=require(_0x7e8f('0x3'));var config=require('../../../config/environment');config[_0x7e8f('0x4')]=_[_0x7e8f('0x5')](config['redis'],{'host':_0x7e8f('0x6'),'port':0x18eb});var io=require(_0x7e8f('0x7'))(new Redis(config[_0x7e8f('0x4')]));function ChatQueue(_0x53e491){this['id']=_0x53e491['id']||0x0;this[_0x7e8f('0x8')]=_0x53e491['name']||'';this[_0x7e8f('0x9')]=_0x53e491['timeout']||0xa;this[_0x7e8f('0xa')]=_0x53e491[_0x7e8f('0xa')]||'beepall';this[_0x7e8f('0xb')]=_0x53e491['Agents'];this['mapAgentsId']={};this[_0x7e8f('0xc')]=0x0;this['md5']='';this[_0x7e8f('0xd')]();this[_0x7e8f('0xe')]();}ChatQueue['prototype'][_0x7e8f('0xd')]=function(){var _0x5062fd=this[_0x7e8f('0xf')][_0x7e8f('0x10')];this[_0x7e8f('0xf')]=_[_0x7e8f('0x11')](this[_0x7e8f('0xb')],'id');this['mapAgentsId'][_0x7e8f('0x10')]=_0x5062fd;};ChatQueue[_0x7e8f('0x12')]['updateRealtime']=function(){this[_0x7e8f('0x13')]=0x0;this['paused']=0x0;for(var _0x29faec=0x0;_0x29faec=0x0?this[_0x7e8f('0x16')]:0x0;var _0x10eb83={'id':this['id'],'available':this[_0x7e8f('0x16')],'loggedIn':this[_0x7e8f('0x13')],'name':this[_0x7e8f('0x8')],'paused':this[_0x7e8f('0x15')],'waiting':this[_0x7e8f('0xc')]};var _0x490665=md5(JSON['stringify'](_0x10eb83));if(this[_0x7e8f('0x1')]!==_0x490665){this[_0x7e8f('0x1')]=_0x490665;io['to'](util['format'](_0x7e8f('0x17'),_0x10eb83['name']))['emit']('chat_queue:save',_0x10eb83);}};module[_0x7e8f('0x18')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 044fb2a..8d0ea3e 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 _0xac5e=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac5e,0xdd));var _0xeac5=function(_0x5a66fc,_0x2af05b){_0x5a66fc=_0x5a66fc-0x0;var _0x86592d=_0xac5e[_0x5a66fc];return _0x86592d;};'use strict';var _=require(_0xeac5('0x0'));var md5=require(_0xeac5('0x1'));var util=require(_0xeac5('0x2'));var Redis=require(_0xeac5('0x3'));var config=require('../../../config/environment');config[_0xeac5('0x4')]=_[_0xeac5('0x5')](config[_0xeac5('0x4')],{'host':_0xeac5('0x6'),'port':0x18eb});var io=require(_0xeac5('0x7'))(new Redis(config[_0xeac5('0x4')]));function FaxQueue(_0x3b3c47){this['id']=_0x3b3c47['id']||0x0;this[_0xeac5('0x8')]=_0x3b3c47[_0xeac5('0x8')]||'';this['timeout']=_0x3b3c47[_0xeac5('0x9')]||0xa;this[_0xeac5('0xa')]=_0x3b3c47[_0xeac5('0xa')]||'beepall';this[_0xeac5('0xb')]=_0x3b3c47[_0xeac5('0xb')];this[_0xeac5('0xc')]={};this[_0xeac5('0xd')]=0x0;this[_0xeac5('0x1')]='';this[_0xeac5('0xe')]();this[_0xeac5('0xf')]();}FaxQueue['prototype'][_0xeac5('0xe')]=function(){var _0x4f48e0=this[_0xeac5('0xc')]['_rr'];this[_0xeac5('0xc')]=_['map'](this[_0xeac5('0xb')],'id');this['mapAgentsId'][_0xeac5('0x10')]=_0x4f48e0;};FaxQueue[_0xeac5('0x11')][_0xeac5('0xf')]=function(){this[_0xeac5('0x12')]=0x0;this[_0xeac5('0x13')]=0x0;for(var _0x1b69ea=0x0;_0x1b69ea=0x0?this[_0xeac5('0x17')]:0x0;var _0x2846e3={'id':this['id'],'available':this[_0xeac5('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xeac5('0x8')],'paused':this[_0xeac5('0x13')],'waiting':this[_0xeac5('0xd')]};var _0x33ad0e=md5(JSON[_0xeac5('0x18')](_0x2846e3));if(this[_0xeac5('0x1')]!==_0x33ad0e){this['md5']=_0x33ad0e;io['to'](util[_0xeac5('0x19')](_0xeac5('0x1a'),_0x2846e3[_0xeac5('0x8')]))['emit'](_0xeac5('0x1b'),_0x2846e3);}};module[_0xeac5('0x1c')]=FaxQueue; \ No newline at end of file +var _0x2577=['length','online','loggedIn','available','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','redis','defaults','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused'];(function(_0x25fb84,_0x21d888){var _0x1578bf=function(_0x59cb45){while(--_0x59cb45){_0x25fb84['push'](_0x25fb84['shift']());}};_0x1578bf(++_0x21d888);}(_0x2577,0x1ca));var _0x7257=function(_0x1afb2a,_0x1b9ca6){_0x1afb2a=_0x1afb2a-0x0;var _0x4c6998=_0x2577[_0x1afb2a];return _0x4c6998;};'use strict';var _=require(_0x7257('0x0'));var md5=require(_0x7257('0x1'));var util=require(_0x7257('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x7257('0x3')]=_[_0x7257('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x105637){this['id']=_0x105637['id']||0x0;this[_0x7257('0x5')]=_0x105637[_0x7257('0x5')]||'';this['timeout']=_0x105637['timeout']||0xa;this[_0x7257('0x6')]=_0x105637[_0x7257('0x6')]||_0x7257('0x7');this[_0x7257('0x8')]=_0x105637[_0x7257('0x8')];this[_0x7257('0x9')]={};this[_0x7257('0xa')]=0x0;this[_0x7257('0x1')]='';this[_0x7257('0xb')]();this[_0x7257('0xc')]();}FaxQueue[_0x7257('0xd')][_0x7257('0xb')]=function(){var _0x1fddcf=this['mapAgentsId'][_0x7257('0xe')];this[_0x7257('0x9')]=_[_0x7257('0xf')](this['Agents'],'id');this[_0x7257('0x9')][_0x7257('0xe')]=_0x1fddcf;};FaxQueue[_0x7257('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x7257('0x10')]=0x0;for(var _0x3716b0=0x0;_0x3716b0=0x0?this[_0x7257('0x14')]:0x0;var _0x5c8260={'id':this['id'],'available':this[_0x7257('0x14')],'loggedIn':this[_0x7257('0x13')],'name':this['name'],'paused':this[_0x7257('0x10')],'waiting':this[_0x7257('0xa')]};var _0xa7d546=md5(JSON['stringify'](_0x5c8260));if(this[_0x7257('0x1')]!==_0xa7d546){this[_0x7257('0x1')]=_0xa7d546;io['to'](util[_0x7257('0x15')](_0x7257('0x16'),_0x5c8260[_0x7257('0x5')]))['emit'](_0x7257('0x17'),_0x5c8260);}};module[_0x7257('0x18')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 0554cdc..cf3d3ef 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 _0xe301=['name','Intervals','exports'];(function(_0x2484a7,_0x4e4d9f){var _0x4c0f22=function(_0x3a4f79){while(--_0x3a4f79){_0x2484a7['push'](_0x2484a7['shift']());}};_0x4c0f22(++_0x4e4d9f);}(_0xe301,0x144));var _0x1e30=function(_0x1b6ef4,_0x1b88af){_0x1b6ef4=_0x1b6ef4-0x0;var _0x4113a9=_0xe301[_0x1b6ef4];return _0x4113a9;};'use strict';function Interval(_0x29f602){this['id']=_0x29f602['id']||0x0;this[_0x1e30('0x0')]=_0x29f602[_0x1e30('0x0')]||'';this[_0x1e30('0x1')]=_0x29f602[_0x1e30('0x1')]||{};}module[_0x1e30('0x2')]=Interval; \ No newline at end of file +var _0x6eff=['name','Intervals','exports'];(function(_0x104398,_0x379b26){var _0x5c8e3b=function(_0x1e6dd3){while(--_0x1e6dd3){_0x104398['push'](_0x104398['shift']());}};_0x5c8e3b(++_0x379b26);}(_0x6eff,0xde));var _0xf6ef=function(_0xe27035,_0x1f4876){_0xe27035=_0xe27035-0x0;var _0x3745bc=_0x6eff[_0xe27035];return _0x3745bc;};'use strict';function Interval(_0x1b0aaf){this['id']=_0x1b0aaf['id']||0x0;this[_0xf6ef('0x0')]=_0x1b0aaf[_0xf6ef('0x0')]||'';this[_0xf6ef('0x1')]=_0x1b0aaf[_0xf6ef('0x1')]||{};}module[_0xf6ef('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 127884e..2dadf55 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 _0x1b16=['length','mailPause','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','updateRealtime','loggedIn'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x1b16,0x1ae));var _0x61b1=function(_0x4f27e7,_0x26b439){_0x4f27e7=_0x4f27e7-0x0;var _0x271079=_0x1b16[_0x4f27e7];return _0x271079;};'use strict';var _=require(_0x61b1('0x0'));var md5=require('md5');var util=require(_0x61b1('0x1'));var Redis=require(_0x61b1('0x2'));var config=require(_0x61b1('0x3'));config[_0x61b1('0x4')]=_['defaults'](config['redis'],{'host':_0x61b1('0x5'),'port':0x18eb});var io=require(_0x61b1('0x6'))(new Redis(config[_0x61b1('0x4')]));function MailQueue(_0x3bde7c){this['id']=_0x3bde7c['id']||0x0;this[_0x61b1('0x7')]=_0x3bde7c[_0x61b1('0x7')]||'';this[_0x61b1('0x8')]=_0x3bde7c['timeout']||0xa;this[_0x61b1('0x9')]=_0x3bde7c[_0x61b1('0x9')]||_0x61b1('0xa');this[_0x61b1('0xb')]=_0x3bde7c[_0x61b1('0xb')];this[_0x61b1('0xc')]={};this[_0x61b1('0xd')]=0x0;this[_0x61b1('0xe')]='';this[_0x61b1('0xf')]();this['updateRealtime']();}MailQueue[_0x61b1('0x10')][_0x61b1('0xf')]=function(){var _0xd3c71f=this[_0x61b1('0xc')][_0x61b1('0x11')];this[_0x61b1('0xc')]=_['map'](this[_0x61b1('0xb')],'id');this[_0x61b1('0xc')][_0x61b1('0x11')]=_0xd3c71f;};MailQueue[_0x61b1('0x10')][_0x61b1('0x12')]=function(){this[_0x61b1('0x13')]=0x0;this['paused']=0x0;for(var _0x27ba8d=0x0;_0x27ba8d=0x0?this['available']:0x0;var _0x7c7a9b={'id':this['id'],'available':this[_0x61b1('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x61b1('0x7')],'paused':this[_0x61b1('0x16')],'waiting':this[_0x61b1('0xd')]};var _0x65be87=md5(JSON[_0x61b1('0x18')](_0x7c7a9b));if(this[_0x61b1('0xe')]!==_0x65be87){this[_0x61b1('0xe')]=_0x65be87;io['to'](util[_0x61b1('0x19')](_0x61b1('0x1a'),_0x7c7a9b[_0x61b1('0x7')]))[_0x61b1('0x1b')](_0x61b1('0x1c'),_0x7c7a9b);}};module[_0x61b1('0x1d')]=MailQueue; \ No newline at end of file +var _0x8b70=['lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','prototype','loggedIn','paused','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8b70,0x134));var _0x08b7=function(_0x1e3c2f,_0x53b8d1){_0x1e3c2f=_0x1e3c2f-0x0;var _0x40ac24=_0x8b70[_0x1e3c2f];return _0x40ac24;};'use strict';var _=require(_0x08b7('0x0'));var md5=require(_0x08b7('0x1'));var util=require(_0x08b7('0x2'));var Redis=require(_0x08b7('0x3'));var config=require(_0x08b7('0x4'));config['redis']=_[_0x08b7('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x08b7('0x6')]));function MailQueue(_0x346230){this['id']=_0x346230['id']||0x0;this[_0x08b7('0x7')]=_0x346230[_0x08b7('0x7')]||'';this[_0x08b7('0x8')]=_0x346230['timeout']||0xa;this[_0x08b7('0x9')]=_0x346230[_0x08b7('0x9')]||'beepall';this['Agents']=_0x346230[_0x08b7('0xa')];this['mapAgentsId']={};this[_0x08b7('0xb')]=0x0;this[_0x08b7('0x1')]='';this[_0x08b7('0xc')]();this[_0x08b7('0xd')]();}MailQueue['prototype'][_0x08b7('0xc')]=function(){var _0x655d66=this[_0x08b7('0xe')][_0x08b7('0xf')];this[_0x08b7('0xe')]=_['map'](this[_0x08b7('0xa')],'id');this['mapAgentsId'][_0x08b7('0xf')]=_0x655d66;};MailQueue[_0x08b7('0x10')][_0x08b7('0xd')]=function(){this[_0x08b7('0x11')]=0x0;this[_0x08b7('0x12')]=0x0;for(var _0x4a5930=0x0;_0x4a5930=0x0?this['available']:0x0;var _0x10ffb0={'id':this['id'],'available':this['available'],'loggedIn':this[_0x08b7('0x11')],'name':this['name'],'paused':this[_0x08b7('0x12')],'waiting':this['waiting']};var _0x541fb2=md5(JSON[_0x08b7('0x16')](_0x10ffb0));if(this[_0x08b7('0x1')]!==_0x541fb2){this[_0x08b7('0x1')]=_0x541fb2;io['to'](util[_0x08b7('0x17')](_0x08b7('0x18'),_0x10ffb0[_0x08b7('0x7')]))[_0x08b7('0x19')](_0x08b7('0x1a'),_0x10ffb0);}};module[_0x08b7('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index b2abc09..2d7fa3e 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(_0x4f4753,_0x52d8cb){var _0x522356=function(_0x3c9b6e){while(--_0x3c9b6e){_0x4f4753['push'](_0x4f4753['shift']());}};_0x522356(++_0x52d8cb);}(_0x814b,0x1a2));var _0xb814=function(_0x21c69c,_0x1b7535){_0x21c69c=_0x21c69c-0x0;var _0x2acd03=_0x814b[_0x21c69c];return _0x2acd03;};'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 _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(_0xbe3cc6,_0x24e74d){var _0x10af53=function(_0x50588b){while(--_0x50588b){_0xbe3cc6['push'](_0xbe3cc6['shift']());}};_0x10af53(++_0x24e74d);}(_0x814b,0x1a2));var _0xb814=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x814b[_0x81dcac];return _0xc7803b;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 5b41d85..ddadc6c 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 _0xad36=['localhost','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','smsPause','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults'];(function(_0x564512,_0x542a96){var _0x265c98=function(_0x9d9f5e){while(--_0x9d9f5e){_0x564512['push'](_0x564512['shift']());}};_0x265c98(++_0x542a96);}(_0xad36,0x11c));var _0x6ad3=function(_0xaaba15,_0x2106a2){_0xaaba15=_0xaaba15-0x0;var _0x23ddbb=_0xad36[_0xaaba15];return _0x23ddbb;};'use strict';var _=require('lodash');var md5=require(_0x6ad3('0x0'));var util=require(_0x6ad3('0x1'));var Redis=require(_0x6ad3('0x2'));var config=require(_0x6ad3('0x3'));config[_0x6ad3('0x4')]=_[_0x6ad3('0x5')](config[_0x6ad3('0x4')],{'host':_0x6ad3('0x6'),'port':0x18eb});var io=require(_0x6ad3('0x7'))(new Redis(config['redis']));function SmsQueue(_0x2053e8){this['id']=_0x2053e8['id']||0x0;this[_0x6ad3('0x8')]=_0x2053e8[_0x6ad3('0x8')]||'';this[_0x6ad3('0x9')]=_0x2053e8['timeout']||0xa;this['strategy']=_0x2053e8['strategy']||'beepall';this[_0x6ad3('0xa')]=_0x2053e8[_0x6ad3('0xa')];this[_0x6ad3('0xb')]={};this[_0x6ad3('0xc')]=0x0;this[_0x6ad3('0x0')]='';this[_0x6ad3('0xd')]();this[_0x6ad3('0xe')]();}SmsQueue[_0x6ad3('0xf')][_0x6ad3('0xd')]=function(){var _0x4a47d0=this[_0x6ad3('0xb')][_0x6ad3('0x10')];this[_0x6ad3('0xb')]=_[_0x6ad3('0x11')](this[_0x6ad3('0xa')],'id');this[_0x6ad3('0xb')][_0x6ad3('0x10')]=_0x4a47d0;};SmsQueue[_0x6ad3('0xf')]['updateRealtime']=function(){this[_0x6ad3('0x12')]=0x0;this['paused']=0x0;for(var _0x14418f=0x0;_0x14418f=0x0?this['available']:0x0;var _0x358243={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6ad3('0x12')],'name':this[_0x6ad3('0x8')],'paused':this[_0x6ad3('0x16')],'waiting':this[_0x6ad3('0xc')]};var _0x5b20b1=md5(JSON['stringify'](_0x358243));if(this[_0x6ad3('0x0')]!==_0x5b20b1){this[_0x6ad3('0x0')]=_0x5b20b1;io['to'](util[_0x6ad3('0x18')](_0x6ad3('0x19'),_0x358243[_0x6ad3('0x8')]))[_0x6ad3('0x1a')](_0x6ad3('0x1b'),_0x358243);}};module[_0x6ad3('0x1c')]=SmsQueue; \ No newline at end of file +var _0x72b1=['format','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','md5'];(function(_0x17e782,_0x1ad38e){var _0x5bc51b=function(_0x2d1477){while(--_0x2d1477){_0x17e782['push'](_0x17e782['shift']());}};_0x5bc51b(++_0x1ad38e);}(_0x72b1,0x16e));var _0x172b=function(_0x58e2fc,_0x57ba9f){_0x58e2fc=_0x58e2fc-0x0;var _0x1e628a=_0x72b1[_0x58e2fc];return _0x1e628a;};'use strict';var _=require(_0x172b('0x0'));var md5=require('md5');var util=require(_0x172b('0x1'));var Redis=require(_0x172b('0x2'));var config=require(_0x172b('0x3'));config[_0x172b('0x4')]=_[_0x172b('0x5')](config[_0x172b('0x4')],{'host':_0x172b('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x172b('0x4')]));function SmsQueue(_0x40c72e){this['id']=_0x40c72e['id']||0x0;this[_0x172b('0x7')]=_0x40c72e[_0x172b('0x7')]||'';this['timeout']=_0x40c72e[_0x172b('0x8')]||0xa;this['strategy']=_0x40c72e[_0x172b('0x9')]||'beepall';this[_0x172b('0xa')]=_0x40c72e[_0x172b('0xa')];this[_0x172b('0xb')]={};this[_0x172b('0xc')]=0x0;this['md5']='';this[_0x172b('0xd')]();this[_0x172b('0xe')]();}SmsQueue[_0x172b('0xf')][_0x172b('0xd')]=function(){var _0xa4ada9=this[_0x172b('0xb')][_0x172b('0x10')];this['mapAgentsId']=_[_0x172b('0x11')](this[_0x172b('0xa')],'id');this[_0x172b('0xb')]['_rr']=_0xa4ada9;};SmsQueue[_0x172b('0xf')]['updateRealtime']=function(){this[_0x172b('0x12')]=0x0;this[_0x172b('0x13')]=0x0;for(var _0x5239b9=0x0;_0x5239b9=0x0?this[_0x172b('0x17')]:0x0;var _0x18c22a={'id':this['id'],'available':this[_0x172b('0x17')],'loggedIn':this[_0x172b('0x12')],'name':this['name'],'paused':this[_0x172b('0x13')],'waiting':this[_0x172b('0xc')]};var _0x2bedae=md5(JSON[_0x172b('0x18')](_0x18c22a));if(this[_0x172b('0x19')]!==_0x2bedae){this[_0x172b('0x19')]=_0x2bedae;io['to'](util[_0x172b('0x1a')]('sms:queue:%s',_0x18c22a['name']))['emit']('sms_queue:save',_0x18c22a);}};module[_0x172b('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 229f481..4a99a27 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 _0x12fd=['exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRealtime','updateRouting','_rr','map','prototype','loggedIn','length','online','paused','available','waiting','whatsapp:queue:%s','whatsapp_queue:save'];(function(_0x15b182,_0xb73a6e){var _0x400ac7=function(_0x3457f0){while(--_0x3457f0){_0x15b182['push'](_0x15b182['shift']());}};_0x400ac7(++_0xb73a6e);}(_0x12fd,0xe1));var _0xd12f=function(_0x559b48,_0x3f4813){_0x559b48=_0x559b48-0x0;var _0x411385=_0x12fd[_0x559b48];return _0x411385;};'use strict';var _=require(_0xd12f('0x0'));var md5=require(_0xd12f('0x1'));var util=require(_0xd12f('0x2'));var Redis=require(_0xd12f('0x3'));var config=require(_0xd12f('0x4'));config[_0xd12f('0x5')]=_[_0xd12f('0x6')](config[_0xd12f('0x5')],{'host':_0xd12f('0x7'),'port':0x18eb});var io=require(_0xd12f('0x8'))(new Redis(config['redis']));function WhatsappQueue(_0x1ac0f0){this['id']=_0x1ac0f0['id']||0x0;this['name']=_0x1ac0f0[_0xd12f('0x9')]||'';this[_0xd12f('0xa')]=_0x1ac0f0[_0xd12f('0xa')]||0xa;this[_0xd12f('0xb')]=_0x1ac0f0[_0xd12f('0xb')]||'beepall';this['Agents']=_0x1ac0f0[_0xd12f('0xc')];this[_0xd12f('0xd')]={};this['waiting']=0x0;this[_0xd12f('0x1')]='';this['updateRouting']();this[_0xd12f('0xe')]();}WhatsappQueue['prototype'][_0xd12f('0xf')]=function(){var _0x1cca39=this['mapAgentsId'][_0xd12f('0x10')];this[_0xd12f('0xd')]=_[_0xd12f('0x11')](this['Agents'],'id');this[_0xd12f('0xd')][_0xd12f('0x10')]=_0x1cca39;};WhatsappQueue[_0xd12f('0x12')]['updateRealtime']=function(){this[_0xd12f('0x13')]=0x0;this['paused']=0x0;for(var _0x2bc5fc=0x0;_0x2bc5fc=0x0?this['available']:0x0;var _0x3a155a={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xd12f('0x9')],'paused':this[_0xd12f('0x16')],'waiting':this[_0xd12f('0x18')]};var _0x42b4e8=md5(JSON['stringify'](_0x3a155a));if(this[_0xd12f('0x1')]!==_0x42b4e8){this[_0xd12f('0x1')]=_0x42b4e8;io['to'](util['format'](_0xd12f('0x19'),_0x3a155a[_0xd12f('0x9')]))['emit'](_0xd12f('0x1a'),_0x3a155a);}};module[_0xd12f('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x11d9=['loggedIn','length','online','whatsappPause','available','paused','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr'];(function(_0x12701a,_0x5d4d80){var _0x2c50ac=function(_0x1ad585){while(--_0x1ad585){_0x12701a['push'](_0x12701a['shift']());}};_0x2c50ac(++_0x5d4d80);}(_0x11d9,0x16b));var _0x911d=function(_0x292ce1,_0x3dc1d3){_0x292ce1=_0x292ce1-0x0;var _0x376ebf=_0x11d9[_0x292ce1];return _0x376ebf;};'use strict';var _=require(_0x911d('0x0'));var md5=require(_0x911d('0x1'));var util=require(_0x911d('0x2'));var Redis=require(_0x911d('0x3'));var config=require(_0x911d('0x4'));config[_0x911d('0x5')]=_[_0x911d('0x6')](config['redis'],{'host':_0x911d('0x7'),'port':0x18eb});var io=require(_0x911d('0x8'))(new Redis(config[_0x911d('0x5')]));function WhatsappQueue(_0x1315b4){this['id']=_0x1315b4['id']||0x0;this['name']=_0x1315b4[_0x911d('0x9')]||'';this[_0x911d('0xa')]=_0x1315b4['timeout']||0xa;this[_0x911d('0xb')]=_0x1315b4['strategy']||_0x911d('0xc');this[_0x911d('0xd')]=_0x1315b4['Agents'];this[_0x911d('0xe')]={};this[_0x911d('0xf')]=0x0;this['md5']='';this[_0x911d('0x10')]();this[_0x911d('0x11')]();}WhatsappQueue[_0x911d('0x12')][_0x911d('0x10')]=function(){var _0xab850e=this['mapAgentsId']['_rr'];this[_0x911d('0xe')]=_[_0x911d('0x13')](this[_0x911d('0xd')],'id');this[_0x911d('0xe')][_0x911d('0x14')]=_0xab850e;};WhatsappQueue[_0x911d('0x12')]['updateRealtime']=function(){this[_0x911d('0x15')]=0x0;this['paused']=0x0;for(var _0x208be5=0x0;_0x208be5=0x0?this['available']:0x0;var _0x4a1adf={'id':this['id'],'available':this[_0x911d('0x19')],'loggedIn':this[_0x911d('0x15')],'name':this[_0x911d('0x9')],'paused':this[_0x911d('0x1a')],'waiting':this['waiting']};var _0x2769dc=md5(JSON[_0x911d('0x1b')](_0x4a1adf));if(this[_0x911d('0x1')]!==_0x2769dc){this['md5']=_0x2769dc;io['to'](util[_0x911d('0x1c')](_0x911d('0x1d'),_0x4a1adf[_0x911d('0x9')]))['emit'](_0x911d('0x1e'),_0x4a1adf);}};module[_0x911d('0x1f')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index f262ece..8b98a8d 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 aaf178f..f220807 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 _0xa21e=['addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client','UpdateChatInteraction'];(function(_0x4785fa,_0x5763b4){var _0x5cd6a2=function(_0x46f467){while(--_0x46f467){_0x4785fa['push'](_0x4785fa['shift']());}};_0x5cd6a2(++_0x5763b4);}(_0xa21e,0x112));var _0xea21=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0xa21e[_0x5c7a85];return _0x35290f;};'use strict';var client=require(_0xea21('0x0'));exports['update']=function(_0x5e581f,_0xf6b5d1){return client['Request'](_0xea21('0x1'),{'body':_0xf6b5d1,'options':{'where':{'id':_0x5e581f}},'log':'updateChatInteraction'});};exports[_0xea21('0x2')]=function(_0x2e17bc,_0xfc1075){return client[_0xea21('0x3')](_0xea21('0x4'),{'body':_0xfc1075,'options':{'where':{'id':_0x2e17bc}},'log':_0xea21('0x5')});}; \ No newline at end of file +var _0x2ebc=['AddTagsToChatInteraction','../client','Request','updateChatInteraction','addTags'];(function(_0x422f29,_0x126579){var _0x4346e3=function(_0x3e16f4){while(--_0x3e16f4){_0x422f29['push'](_0x422f29['shift']());}};_0x4346e3(++_0x126579);}(_0x2ebc,0x74));var _0xc2eb=function(_0x1650fb,_0x2a4cf8){_0x1650fb=_0x1650fb-0x0;var _0xe9c3b5=_0x2ebc[_0x1650fb];return _0xe9c3b5;};'use strict';var client=require(_0xc2eb('0x0'));exports['update']=function(_0xdda336,_0x4b8f08){return client[_0xc2eb('0x1')]('UpdateChatInteraction',{'body':_0x4b8f08,'options':{'where':{'id':_0xdda336}},'log':_0xc2eb('0x2')});};exports[_0xc2eb('0x3')]=function(_0x3eba35,_0x31603c){return client[_0xc2eb('0x1')](_0xc2eb('0x4'),{'body':_0x31603c,'options':{'where':{'id':_0x3eba35}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index d71dd3f..c394ac5 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 _0xa23a=['create','Request','CreateChatMessage','../client'];(function(_0x8fdaf8,_0x271a01){var _0x5caa9b=function(_0x3a28d7){while(--_0x3a28d7){_0x8fdaf8['push'](_0x8fdaf8['shift']());}};_0x5caa9b(++_0x271a01);}(_0xa23a,0x11f));var _0xaa23=function(_0x26fbfd,_0x47f2c1){_0x26fbfd=_0x26fbfd-0x0;var _0x508968=_0xa23a[_0x26fbfd];return _0x508968;};'use strict';var client=require(_0xaa23('0x0'));exports[_0xaa23('0x1')]=function(_0x29fac8){return client[_0xaa23('0x2')](_0xaa23('0x3'),{'body':_0x29fac8,'log':'createChatMessage'});}; \ No newline at end of file +var _0x08a4=['../client','create','Request','CreateChatMessage'];(function(_0x268f99,_0x4e3866){var _0xdb3e22=function(_0x36ca08){while(--_0x36ca08){_0x268f99['push'](_0x268f99['shift']());}};_0xdb3e22(++_0x4e3866);}(_0x08a4,0xc8));var _0x408a=function(_0x5cb6b1,_0x4472a3){_0x5cb6b1=_0x5cb6b1-0x0;var _0x3ee63c=_0x08a4[_0x5cb6b1];return _0x3ee63c;};'use strict';var client=require(_0x408a('0x0'));exports[_0x408a('0x1')]=function(_0x2ab941){return client[_0x408a('0x2')](_0x408a('0x3'),{'body':_0x2ab941,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 4ecd1e7..2d214c5 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 _0x42b0=['Agents','name','online','chatPause','../client','getChatQueues','GetChatQueue','timeout'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x42b0,0xbc));var _0x042b=function(_0x1ad8df,_0x2e1a1f){_0x1ad8df=_0x1ad8df-0x0;var _0x42d8b2=_0x42b0[_0x1ad8df];return _0x42d8b2;};'use strict';var client=require(_0x042b('0x0'));exports[_0x042b('0x1')]=function(){return function(){return client['Request'](_0x042b('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x042b('0x3'),'strategy'],'include':[{'model':'User','as':_0x042b('0x4'),'attributes':['id',_0x042b('0x5'),_0x042b('0x6'),_0x042b('0x7')]}]},'log':_0x042b('0x1')});};}; \ No newline at end of file +var _0x04e7=['Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x04e7,0x121));var _0x704e=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0x04e7[_0xb99421];return _0x4b3ec7;};'use strict';var client=require(_0x704e('0x0'));exports[_0x704e('0x1')]=function(){return function(){return client[_0x704e('0x2')](_0x704e('0x3'),{'options':{'raw':![],'attributes':['id',_0x704e('0x4'),_0x704e('0x5'),_0x704e('0x6')],'include':[{'model':_0x704e('0x7'),'as':_0x704e('0x8'),'attributes':['id',_0x704e('0x4'),_0x704e('0x9'),_0x704e('0xa')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 710680f..d4efd86 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 _0x8d53=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x5e5d7a,_0x38bcfe){var _0x188fb2=function(_0x4b4ab9){while(--_0x4b4ab9){_0x5e5d7a['push'](_0x5e5d7a['shift']());}};_0x188fb2(++_0x38bcfe);}(_0x8d53,0x1c2));var _0x38d5=function(_0x7ee493,_0x2cc2cb){_0x7ee493=_0x7ee493-0x0;var _0x1f2c25=_0x8d53[_0x7ee493];return _0x1f2c25;};'use strict';var client=require(_0x38d5('0x0'));exports[_0x38d5('0x1')]=function(_0x5e0848){return client[_0x38d5('0x2')](_0x38d5('0x3'),{'body':_0x5e0848,'log':_0x38d5('0x3')});};exports[_0x38d5('0x4')]=function(_0x3a7660,_0x19c115){return client[_0x38d5('0x2')](_0x38d5('0x5'),{'body':_0x19c115,'options':{'where':{'uniqueid':_0x3a7660},'order':[['id','DESC']],'limit':0x1},'log':_0x38d5('0x5')});}; \ No newline at end of file +var _0xc5ba=['update','UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x41beb0,_0x2298de){var _0x77cc6f=function(_0x2f2cce){while(--_0x2f2cce){_0x41beb0['push'](_0x41beb0['shift']());}};_0x77cc6f(++_0x2298de);}(_0xc5ba,0xb9));var _0xac5b=function(_0x446f11,_0x95cf21){_0x446f11=_0x446f11-0x0;var _0x385cb5=_0xc5ba[_0x446f11];return _0x385cb5;};'use strict';var client=require(_0xac5b('0x0'));exports[_0xac5b('0x1')]=function(_0x32252a){return client[_0xac5b('0x2')](_0xac5b('0x3'),{'body':_0x32252a,'log':_0xac5b('0x3')});};exports[_0xac5b('0x4')]=function(_0x1292a5,_0x3d0dc6){return client[_0xac5b('0x2')](_0xac5b('0x5'),{'body':_0x3d0dc6,'options':{'where':{'uniqueid':_0x1292a5},'order':[['id',_0xac5b('0x6')]],'limit':0x1},'log':_0xac5b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 75be369..0af9bff 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(_0x5dd0b1,_0x3ea67c){var _0x596367=function(_0x15359f){while(--_0x15359f){_0x5dd0b1['push'](_0x5dd0b1['shift']());}};_0x596367(++_0x3ea67c);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x1196b0,_0x36c47a){var _0x111c52=function(_0x5604c7){while(--_0x5604c7){_0x1196b0['push'](_0x1196b0['shift']());}};_0x111c52(++_0x36c47a);}(_0x7a54,0x106));var _0x47a5=function(_0x4b8899,_0xada2b9){_0x4b8899=_0x4b8899-0x0;var _0x5273ee=_0x7a54[_0x4b8899];return _0x5273ee;};'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 f3def2c..5cce18c 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 _0xcb1b=['CreateFaxMessage','../client','create','Request'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xcb1b,0xf9));var _0xbcb1=function(_0x10e737,_0x2f2f14){_0x10e737=_0x10e737-0x0;var _0x5038d7=_0xcb1b[_0x10e737];return _0x5038d7;};'use strict';var client=require(_0xbcb1('0x0'));exports[_0xbcb1('0x1')]=function(_0x3b051e){return client[_0xbcb1('0x2')](_0xbcb1('0x3'),{'body':_0x3b051e,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x44c4=['CreateFaxMessage','createFaxMessage','../client','Request'];(function(_0x314420,_0x2253b4){var _0xb17007=function(_0x2507f3){while(--_0x2507f3){_0x314420['push'](_0x314420['shift']());}};_0xb17007(++_0x2253b4);}(_0x44c4,0x86));var _0x444c=function(_0x64faa5,_0x5c13b3){_0x64faa5=_0x64faa5-0x0;var _0x22edba=_0x44c4[_0x64faa5];return _0x22edba;};'use strict';var client=require(_0x444c('0x0'));exports['create']=function(_0x4e764d){return client[_0x444c('0x1')](_0x444c('0x2'),{'body':_0x4e764d,'log':_0x444c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index bfce772..0184232 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 _0xfcf8=['../client','getFaxQueues','Request','GetFaxQueue','name','strategy','User','Agents','online','faxPause'];(function(_0x24ff2a,_0x171f40){var _0xefb6ce=function(_0x36bad1){while(--_0x36bad1){_0x24ff2a['push'](_0x24ff2a['shift']());}};_0xefb6ce(++_0x171f40);}(_0xfcf8,0xc8));var _0x8fcf=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xfcf8[_0x273c39];return _0x46d6b5;};'use strict';var client=require(_0x8fcf('0x0'));exports[_0x8fcf('0x1')]=function(){return function(){return client[_0x8fcf('0x2')](_0x8fcf('0x3'),{'options':{'raw':![],'attributes':['id',_0x8fcf('0x4'),'timeout',_0x8fcf('0x5')],'include':[{'model':_0x8fcf('0x6'),'as':_0x8fcf('0x7'),'attributes':['id',_0x8fcf('0x4'),_0x8fcf('0x8'),_0x8fcf('0x9')]}]},'log':_0x8fcf('0x1')});};}; \ No newline at end of file +var _0x01a0=['strategy','../client','getFaxQueues','Request','GetFaxQueue','timeout'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x01a0,0x10f));var _0x001a=function(_0x4283ff,_0x4e62dc){_0x4283ff=_0x4283ff-0x0;var _0x462d15=_0x01a0[_0x4283ff];return _0x462d15;};'use strict';var client=require(_0x001a('0x0'));exports[_0x001a('0x1')]=function(){return function(){return client[_0x001a('0x2')](_0x001a('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x001a('0x4'),_0x001a('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id','name','online','faxPause']}]},'log':_0x001a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 7b45b66..f177f6b 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 _0x116d=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x757823,_0x4a72db){var _0x4822b9=function(_0x16f481){while(--_0x16f481){_0x757823['push'](_0x757823['shift']());}};_0x4822b9(++_0x4a72db);}(_0x116d,0x16d));var _0xd116=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x116d[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0xd116('0x0'));exports[_0xd116('0x1')]=function(_0x80b1ea){return client[_0xd116('0x2')](_0xd116('0x3'),{'body':_0x80b1ea,'log':_0xd116('0x3')});};exports[_0xd116('0x4')]=function(_0x86e793,_0x58e7b5){return client[_0xd116('0x2')](_0xd116('0x5'),{'body':_0x58e7b5,'options':{'where':{'uniqueid':_0x86e793},'order':[['id',_0xd116('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xe7d6=['UpdateFaxQueueReport','DESC','Request','CreateFaxQueueReport','update'];(function(_0x158e7b,_0x9c808f){var _0x4036fe=function(_0x353bc9){while(--_0x353bc9){_0x158e7b['push'](_0x158e7b['shift']());}};_0x4036fe(++_0x9c808f);}(_0xe7d6,0x124));var _0x6e7d=function(_0x59d471,_0x2b1e92){_0x59d471=_0x59d471-0x0;var _0x5e23b1=_0xe7d6[_0x59d471];return _0x5e23b1;};'use strict';var client=require('../client');exports['create']=function(_0x39f790){return client[_0x6e7d('0x0')](_0x6e7d('0x1'),{'body':_0x39f790,'log':'CreateFaxQueueReport'});};exports[_0x6e7d('0x2')]=function(_0x5e69f7,_0x3b7991){return client[_0x6e7d('0x0')](_0x6e7d('0x3'),{'body':_0x3b7991,'options':{'where':{'uniqueid':_0x5e69f7},'order':[['id',_0x6e7d('0x4')]],'limit':0x1},'log':_0x6e7d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 0b29767..fc62afa 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 _0x5ce1=['name','Interval','Intervals','interval','../client','getIntervals','GetInterval'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x5ce1,0x1e7));var _0x15ce=function(_0x2bc68d,_0x561c96){_0x2bc68d=_0x2bc68d-0x0;var _0x1eaca9=_0x5ce1[_0x2bc68d];return _0x1eaca9;};'use strict';var client=require(_0x15ce('0x0'));exports[_0x15ce('0x1')]=function(){return function(){return client['Request'](_0x15ce('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x15ce('0x3')],'include':[{'model':_0x15ce('0x4'),'as':_0x15ce('0x5'),'attributes':['id',_0x15ce('0x3'),_0x15ce('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x23ae=['name','Intervals','interval','../client','getIntervals','GetInterval'];(function(_0x5ea94c,_0x19937b){var _0xededd7=function(_0x27d10e){while(--_0x27d10e){_0x5ea94c['push'](_0x5ea94c['shift']());}};_0xededd7(++_0x19937b);}(_0x23ae,0x93));var _0xe23a=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0x23ae[_0x1e8b1e];return _0x4a0fde;};'use strict';var client=require(_0xe23a('0x0'));exports[_0xe23a('0x1')]=function(){return function(){return client['Request'](_0xe23a('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe23a('0x3')],'include':[{'model':'Interval','as':_0xe23a('0x4'),'attributes':['id',_0xe23a('0x3'),_0xe23a('0x5')]}]},'log':_0xe23a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index c54f1bc..09e60da 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 _0xfff0=['addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x1894e7,_0x1253e6){var _0x5e857f=function(_0x1b47c3){while(--_0x1b47c3){_0x1894e7['push'](_0x1894e7['shift']());}};_0x5e857f(++_0x1253e6);}(_0xfff0,0x139));var _0x0fff=function(_0x3702d2,_0x396ac2){_0x3702d2=_0x3702d2-0x0;var _0xb024f4=_0xfff0[_0x3702d2];return _0xb024f4;};'use strict';var client=require('../client');exports[_0x0fff('0x0')]=function(_0x2b95e0,_0x148db8){return client['Request'](_0x0fff('0x1'),{'body':_0x148db8,'options':{'where':{'id':_0x2b95e0}},'log':_0x0fff('0x2')});};exports[_0x0fff('0x3')]=function(_0x4bec60,_0x2cd3d5){return client[_0x0fff('0x4')]('AddTagsToMailInteraction',{'body':_0x2cd3d5,'options':{'where':{'id':_0x4bec60}},'log':_0x0fff('0x5')});}; \ No newline at end of file +var _0x7096=['AddTagsToMailInteraction','addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x35d59c,_0x341ef9){var _0x18cd27=function(_0x16a9c4){while(--_0x16a9c4){_0x35d59c['push'](_0x35d59c['shift']());}};_0x18cd27(++_0x341ef9);}(_0x7096,0x10c));var _0x6709=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x7096[_0x5608a3];return _0x1ed50a;};'use strict';var client=require('../client');exports[_0x6709('0x0')]=function(_0x5035b7,_0x253760){return client['Request'](_0x6709('0x1'),{'body':_0x253760,'options':{'where':{'id':_0x5035b7}},'log':_0x6709('0x2')});};exports[_0x6709('0x3')]=function(_0xccdcb5,_0x3cd087){return client[_0x6709('0x4')](_0x6709('0x5'),{'body':_0x3cd087,'options':{'where':{'id':_0xccdcb5}},'log':_0x6709('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 6c2c5c7..aee91bd 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 _0x00b0=['../client','create','Request','CreateMailMessage'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x00b0,0xec));var _0x000b=function(_0x5a96d7,_0x2a3ab9){_0x5a96d7=_0x5a96d7-0x0;var _0x1d1276=_0x00b0[_0x5a96d7];return _0x1d1276;};'use strict';var client=require(_0x000b('0x0'));exports[_0x000b('0x1')]=function(_0x58e444){return client[_0x000b('0x2')](_0x000b('0x3'),{'body':_0x58e444,'log':'createMailMessage'});}; \ No newline at end of file +var _0x9c58=['Request','createMailMessage','../client','create'];(function(_0x5c627c,_0x58de4d){var _0x5b142b=function(_0x31dff8){while(--_0x31dff8){_0x5c627c['push'](_0x5c627c['shift']());}};_0x5b142b(++_0x58de4d);}(_0x9c58,0x136));var _0x89c5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9c58[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x89c5('0x0'));exports[_0x89c5('0x1')]=function(_0x6d6fe1){return client[_0x89c5('0x2')]('CreateMailMessage',{'body':_0x6d6fe1,'log':_0x89c5('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 1668643..be2a904 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 _0xfdc1=['timeout','strategy','User','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xfdc1,0x164));var _0x1fdc=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0xfdc1[_0x372515];return _0xa3bf4e;};'use strict';var client=require(_0x1fdc('0x0'));exports[_0x1fdc('0x1')]=function(){return function(){return client[_0x1fdc('0x2')](_0x1fdc('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x1fdc('0x4'),_0x1fdc('0x5')],'include':[{'model':_0x1fdc('0x6'),'as':'Agents','attributes':['id','name','online',_0x1fdc('0x7')]}]},'log':_0x1fdc('0x1')});};}; \ No newline at end of file +var _0xae52=['online','mailPause','getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents'];(function(_0x1d5aa6,_0x1d804e){var _0x59110e=function(_0x59dfae){while(--_0x59dfae){_0x1d5aa6['push'](_0x1d5aa6['shift']());}};_0x59110e(++_0x1d804e);}(_0xae52,0x1ec));var _0x2ae5=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xae52[_0x1f9f37];return _0x21c080;};'use strict';var client=require('../client');exports[_0x2ae5('0x0')]=function(){return function(){return client[_0x2ae5('0x1')](_0x2ae5('0x2'),{'options':{'raw':![],'attributes':['id',_0x2ae5('0x3'),_0x2ae5('0x4'),_0x2ae5('0x5')],'include':[{'model':_0x2ae5('0x6'),'as':_0x2ae5('0x7'),'attributes':['id',_0x2ae5('0x3'),_0x2ae5('0x8'),_0x2ae5('0x9')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index bb6e420..d45cf55 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 _0x3dd5=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','../client','create'];(function(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0x3dd5,0x1d8));var _0x53dd=function(_0x164de5,_0x2f59c5){_0x164de5=_0x164de5-0x0;var _0x202fb4=_0x3dd5[_0x164de5];return _0x202fb4;};'use strict';var client=require(_0x53dd('0x0'));exports[_0x53dd('0x1')]=function(_0x4cab31){return client[_0x53dd('0x2')](_0x53dd('0x3'),{'body':_0x4cab31,'log':_0x53dd('0x3')});};exports[_0x53dd('0x4')]=function(_0x37d2e5,_0x515d6b){return client[_0x53dd('0x2')](_0x53dd('0x5'),{'body':_0x515d6b,'options':{'where':{'uniqueid':_0x37d2e5},'order':[['id','DESC']],'limit':0x1},'log':_0x53dd('0x5')});}; \ No newline at end of file +var _0xbed8=['Request','CreateMailQueueReport','update'];(function(_0x36176e,_0x3719b7){var _0xbe79bc=function(_0x2eea8f){while(--_0x2eea8f){_0x36176e['push'](_0x36176e['shift']());}};_0xbe79bc(++_0x3719b7);}(_0xbed8,0x1a4));var _0x8bed=function(_0x4be8ba,_0x5d10ba){_0x4be8ba=_0x4be8ba-0x0;var _0x1af822=_0xbed8[_0x4be8ba];return _0x1af822;};'use strict';var client=require('../client');exports['create']=function(_0x1287fd){return client[_0x8bed('0x0')](_0x8bed('0x1'),{'body':_0x1287fd,'log':_0x8bed('0x1')});};exports[_0x8bed('0x2')]=function(_0x3f7f01,_0x21895a){return client[_0x8bed('0x0')]('UpdateMailQueueReport',{'body':_0x21895a,'options':{'where':{'uniqueid':_0x3f7f01},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 0411825..f645ba4 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 _0xb13b=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update','Request'];(function(_0x36bff5,_0x3156cb){var _0x80ade5=function(_0x5eee65){while(--_0x5eee65){_0x36bff5['push'](_0x36bff5['shift']());}};_0x80ade5(++_0x3156cb);}(_0xb13b,0x148));var _0xbb13=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb13b[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports[_0xbb13('0x0')]=function(_0x580388,_0x2cd315){return client[_0xbb13('0x1')](_0xbb13('0x2'),{'body':_0x2cd315,'options':{'where':{'id':_0x580388}},'log':_0xbb13('0x3')});};exports['addTags']=function(_0x409968,_0x38b826){return client[_0xbb13('0x1')](_0xbb13('0x4'),{'body':_0x38b826,'options':{'where':{'id':_0x409968}},'log':_0xbb13('0x5')});}; \ No newline at end of file +var _0x422c=['../client','Request','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x422c,0xd7));var _0xc422=function(_0x1efebe,_0x1e98f1){_0x1efebe=_0x1efebe-0x0;var _0x2bbbbe=_0x422c[_0x1efebe];return _0x2bbbbe;};'use strict';var client=require(_0xc422('0x0'));exports['update']=function(_0x496038,_0x9effd4){return client[_0xc422('0x1')]('UpdateOpenchannelInteraction',{'body':_0x9effd4,'options':{'where':{'id':_0x496038}},'log':'updateOpenchannelInteraction'});};exports[_0xc422('0x2')]=function(_0x378ec8,_0x2d6c27){return client['Request'](_0xc422('0x3'),{'body':_0x2d6c27,'options':{'where':{'id':_0x378ec8}},'log':_0xc422('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index bbdb54b..295f026 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 _0x1a9f=['create','Request','createOpenchannelMessage','../client'];(function(_0x3a4e8e,_0x427ed9){var _0x21c9b8=function(_0x1eebd2){while(--_0x1eebd2){_0x3a4e8e['push'](_0x3a4e8e['shift']());}};_0x21c9b8(++_0x427ed9);}(_0x1a9f,0x1d7));var _0xf1a9=function(_0x2087db,_0x3ab649){_0x2087db=_0x2087db-0x0;var _0x4b5174=_0x1a9f[_0x2087db];return _0x4b5174;};'use strict';var client=require(_0xf1a9('0x0'));exports[_0xf1a9('0x1')]=function(_0xd66e2a){return client[_0xf1a9('0x2')]('CreateOpenchannelMessage',{'body':_0xd66e2a,'log':_0xf1a9('0x3')});}; \ No newline at end of file +var _0x6e52=['create','Request','../client'];(function(_0x5d471b,_0x2e7867){var _0x25872b=function(_0x10dee9){while(--_0x10dee9){_0x5d471b['push'](_0x5d471b['shift']());}};_0x25872b(++_0x2e7867);}(_0x6e52,0x14f));var _0x26e5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6e52[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x26e5('0x0'));exports[_0x26e5('0x1')]=function(_0x3ea112){return client[_0x26e5('0x2')]('CreateOpenchannelMessage',{'body':_0x3ea112,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 18f1957..449c13a 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 _0xc964=['GetOpenchannelQueue','timeout','User','name','online','openchannelPause','getOpenchannelQueues','../client'];(function(_0x2f3836,_0x7441f4){var _0x950eef=function(_0x138da0){while(--_0x138da0){_0x2f3836['push'](_0x2f3836['shift']());}};_0x950eef(++_0x7441f4);}(_0xc964,0x107));var _0x4c96=function(_0x3aba04,_0x319997){_0x3aba04=_0x3aba04-0x0;var _0x1ea3df=_0xc964[_0x3aba04];return _0x1ea3df;};'use strict';var client=require(_0x4c96('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x4c96('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x4c96('0x2'),'strategy'],'include':[{'model':_0x4c96('0x3'),'as':'Agents','attributes':['id',_0x4c96('0x4'),_0x4c96('0x5'),_0x4c96('0x6')]}]},'log':_0x4c96('0x7')});};}; \ No newline at end of file +var _0x62d5=['getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','strategy','User','name','openchannelPause','../client'];(function(_0x47623f,_0x148f3a){var _0x282ce8=function(_0x35bca1){while(--_0x35bca1){_0x47623f['push'](_0x47623f['shift']());}};_0x282ce8(++_0x148f3a);}(_0x62d5,0xbc));var _0x562d=function(_0x4b1475,_0x2912a3){_0x4b1475=_0x4b1475-0x0;var _0x3457d0=_0x62d5[_0x4b1475];return _0x3457d0;};'use strict';var client=require(_0x562d('0x0'));exports[_0x562d('0x1')]=function(){return function(){return client[_0x562d('0x2')](_0x562d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x562d('0x4'),_0x562d('0x5')],'include':[{'model':_0x562d('0x6'),'as':'Agents','attributes':['id',_0x562d('0x7'),'online',_0x562d('0x8')]}]},'log':_0x562d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 7057470..3ec7f83 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 _0x6779=['UpdateOpenchannelQueueReport','DESC','Request','CreateOpenchannelQueueReport','update'];(function(_0x451126,_0x59d34b){var _0x589410=function(_0x4f8b78){while(--_0x4f8b78){_0x451126['push'](_0x451126['shift']());}};_0x589410(++_0x59d34b);}(_0x6779,0x156));var _0x9677=function(_0x42b2c4,_0x3a6e4b){_0x42b2c4=_0x42b2c4-0x0;var _0x496838=_0x6779[_0x42b2c4];return _0x496838;};'use strict';var client=require('../client');exports['create']=function(_0x598ee0){return client[_0x9677('0x0')](_0x9677('0x1'),{'body':_0x598ee0,'log':_0x9677('0x1')});};exports[_0x9677('0x2')]=function(_0xb2119e,_0x453ad9){return client[_0x9677('0x0')](_0x9677('0x3'),{'body':_0x453ad9,'options':{'where':{'uniqueid':_0xb2119e},'order':[['id',_0x9677('0x4')]],'limit':0x1},'log':_0x9677('0x3')});}; \ No newline at end of file +var _0xd4df=['../client','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd4df,0x1a8));var _0xfd4d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd4df[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xfd4d('0x0'));exports['create']=function(_0x373130){return client[_0xfd4d('0x1')](_0xfd4d('0x2'),{'body':_0x373130,'log':_0xfd4d('0x2')});};exports['update']=function(_0x5763a9,_0x23c786){return client['Request'](_0xfd4d('0x3'),{'body':_0x23c786,'options':{'where':{'uniqueid':_0x5763a9},'order':[['id','DESC']],'limit':0x1},'log':_0xfd4d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index dbc72a6..9ad80c8 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 _0xac9d=['UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xac9d,0x14d));var _0xdac9=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xac9d[_0x565ed7];return _0x183ad7;};'use strict';var client=require(_0xdac9('0x0'));exports[_0xdac9('0x1')]=function(_0x30732b,_0x1e6d33){return client[_0xdac9('0x2')](_0xdac9('0x3'),{'body':_0x1e6d33,'options':{'where':{'id':_0x30732b}},'log':_0xdac9('0x4')});};exports[_0xdac9('0x5')]=function(_0x51a5d7,_0x1c17a6){return client['Request'](_0xdac9('0x6'),{'body':_0x1c17a6,'options':{'where':{'id':_0x51a5d7}},'log':_0xdac9('0x7')});}; \ No newline at end of file +var _0x861a=['UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x861a,0x194));var _0xa861=function(_0x3944cd,_0x1a3cd4){_0x3944cd=_0x3944cd-0x0;var _0x39e7a0=_0x861a[_0x3944cd];return _0x39e7a0;};'use strict';var client=require(_0xa861('0x0'));exports['update']=function(_0xc6332b,_0x5ba173){return client[_0xa861('0x1')](_0xa861('0x2'),{'body':_0x5ba173,'options':{'where':{'id':_0xc6332b}},'log':_0xa861('0x3')});};exports[_0xa861('0x4')]=function(_0x5d3ee2,_0x2ed8f){return client[_0xa861('0x1')](_0xa861('0x5'),{'body':_0x2ed8f,'options':{'where':{'id':_0x5d3ee2}},'log':_0xa861('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index ce88853..d9d4447 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 _0x8b26=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8b26,0xff));var _0x68b2=function(_0x3ecf65,_0x3bac13){_0x3ecf65=_0x3ecf65-0x0;var _0x1907df=_0x8b26[_0x3ecf65];return _0x1907df;};'use strict';var client=require(_0x68b2('0x0'));exports[_0x68b2('0x1')]=function(_0xae74a6){return client[_0x68b2('0x2')](_0x68b2('0x3'),{'body':_0xae74a6,'log':_0x68b2('0x4')});}; \ No newline at end of file +var _0x1dd8=['createSmsMessage','../client','create','CreateSmsMessage'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x1dd8,0x149));var _0x81dd=function(_0x5ba304,_0x4c97c9){_0x5ba304=_0x5ba304-0x0;var _0x1fa547=_0x1dd8[_0x5ba304];return _0x1fa547;};'use strict';var client=require(_0x81dd('0x0'));exports[_0x81dd('0x1')]=function(_0x161db3){return client['Request'](_0x81dd('0x2'),{'body':_0x161db3,'log':_0x81dd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 973d0da..bfb5d9b 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 _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x67b433,_0x4cf380){var _0x342022=function(_0x1c4c17){while(--_0x1c4c17){_0x67b433['push'](_0x67b433['shift']());}};_0x342022(++_0x4cf380);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0xcb91[_0xa28b1a];return _0x4c9b78;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 48a721f..1f77943 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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x14552c,_0x2ad6e9){var _0x4ef175=function(_0x28da5f){while(--_0x28da5f){_0x14552c['push'](_0x14552c['shift']());}};_0x4ef175(++_0x2ad6e9);}(_0x34e8,0x12c));var _0x834e=function(_0x5a4b21,_0x17a04e){_0x5a4b21=_0x5a4b21-0x0;var _0x4342b8=_0x34e8[_0x5a4b21];return _0x4342b8;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x008c,0x188));var _0xc008=function(_0x240700,_0x13e7d9){_0x240700=_0x240700-0x0;var _0x51530c=_0x008c[_0x240700];return _0x51530c;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 0ad3257..b8b696e 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(_0x601c45,_0xc5515b){var _0x37b2e8=function(_0x528536){while(--_0x528536){_0x601c45['push'](_0x601c45['shift']());}};_0x37b2e8(++_0xc5515b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x1c4901,_0x579985){var _0x4bf2e7=function(_0x41627e){while(--_0x41627e){_0x1c4901['push'](_0x1c4901['shift']());}};_0x4bf2e7(++_0x579985);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 a076912..b2dcca5 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 _0x8c8b=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','Request'];(function(_0x37e8c0,_0x3b52e3){var _0x6515c4=function(_0x4812c6){while(--_0x4812c6){_0x37e8c0['push'](_0x37e8c0['shift']());}};_0x6515c4(++_0x3b52e3);}(_0x8c8b,0x106));var _0xb8c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c8b[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xb8c8('0x0'));exports['update']=function(_0x4a0676,_0x24d772){return client[_0xb8c8('0x1')](_0xb8c8('0x2'),{'body':_0x24d772,'options':{'where':{'id':_0x4a0676}},'log':_0xb8c8('0x3')});};exports['addTags']=function(_0x4c1ecc,_0x40094e){return client[_0xb8c8('0x1')](_0xb8c8('0x4'),{'body':_0x40094e,'options':{'where':{'id':_0x4c1ecc}},'log':_0xb8c8('0x5')});}; \ No newline at end of file +var _0xfb67=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xfb67,0xdd));var _0x7fb6=function(_0x4cf486,_0x671414){_0x4cf486=_0x4cf486-0x0;var _0x5e9752=_0xfb67[_0x4cf486];return _0x5e9752;};'use strict';var client=require(_0x7fb6('0x0'));exports[_0x7fb6('0x1')]=function(_0x1c5b8d,_0x3fc29d){return client[_0x7fb6('0x2')](_0x7fb6('0x3'),{'body':_0x3fc29d,'options':{'where':{'id':_0x1c5b8d}},'log':_0x7fb6('0x4')});};exports['addTags']=function(_0x40c3ce,_0x29dadc){return client[_0x7fb6('0x2')](_0x7fb6('0x5'),{'body':_0x29dadc,'options':{'where':{'id':_0x40c3ce}},'log':_0x7fb6('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 081df09..6f67c46 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 _0x3b15=['createWhatsappMessage','create','CreateWhatsappMessage'];(function(_0x5ae57d,_0x43eaf6){var _0x3973b6=function(_0x365f9a){while(--_0x365f9a){_0x5ae57d['push'](_0x5ae57d['shift']());}};_0x3973b6(++_0x43eaf6);}(_0x3b15,0x6a));var _0x53b1=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x3b15[_0x28947d];return _0x12d2ee;};'use strict';var client=require('../client');exports[_0x53b1('0x0')]=function(_0x388f5f){return client['Request'](_0x53b1('0x1'),{'body':_0x388f5f,'log':_0x53b1('0x2')});}; \ No newline at end of file +var _0x4504=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x17da92,_0x15892d){var _0x576a32=function(_0x33def8){while(--_0x33def8){_0x17da92['push'](_0x17da92['shift']());}};_0x576a32(++_0x15892d);}(_0x4504,0x117));var _0x4450=function(_0x314779,_0x526c03){_0x314779=_0x314779-0x0;var _0x502d88=_0x4504[_0x314779];return _0x502d88;};'use strict';var client=require(_0x4450('0x0'));exports[_0x4450('0x1')]=function(_0x395960){return client[_0x4450('0x2')](_0x4450('0x3'),{'body':_0x395960,'log':_0x4450('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 8c67d27..a90c4cc 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 _0x26d7=['getWhatsappQueues','Request','name','timeout','User','Agents','online','whatsappPause','../client'];(function(_0x53528f,_0x404f7e){var _0x30f4fb=function(_0x2cdc7f){while(--_0x2cdc7f){_0x53528f['push'](_0x53528f['shift']());}};_0x30f4fb(++_0x404f7e);}(_0x26d7,0x11f));var _0x726d=function(_0x2c5d4c,_0x15a0c5){_0x2c5d4c=_0x2c5d4c-0x0;var _0x35e687=_0x26d7[_0x2c5d4c];return _0x35e687;};'use strict';var client=require(_0x726d('0x0'));exports[_0x726d('0x1')]=function(){return function(){return client[_0x726d('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x726d('0x3'),_0x726d('0x4'),'strategy'],'include':[{'model':_0x726d('0x5'),'as':_0x726d('0x6'),'attributes':['id','name',_0x726d('0x7'),_0x726d('0x8')]}]},'log':_0x726d('0x1')});};}; \ No newline at end of file +var _0x3095=['strategy','Agents','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','name','timeout'];(function(_0x2b6472,_0x24eaf9){var _0x41da28=function(_0x10cf4c){while(--_0x10cf4c){_0x2b6472['push'](_0x2b6472['shift']());}};_0x41da28(++_0x24eaf9);}(_0x3095,0x199));var _0x5309=function(_0xc4f2a6,_0x1378c0){_0xc4f2a6=_0xc4f2a6-0x0;var _0x5d6ab1=_0x3095[_0xc4f2a6];return _0x5d6ab1;};'use strict';var client=require(_0x5309('0x0'));exports[_0x5309('0x1')]=function(){return function(){return client['Request'](_0x5309('0x2'),{'options':{'raw':![],'attributes':['id',_0x5309('0x3'),_0x5309('0x4'),_0x5309('0x5')],'include':[{'model':'User','as':_0x5309('0x6'),'attributes':['id','name',_0x5309('0x7'),_0x5309('0x8')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 0cf40b2..e4bd6ce 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 _0x3d57=['UpdateWhatsappQueueReport','DESC','../client','create','CreateWhatsappQueueReport','update','Request'];(function(_0x366cc1,_0x14e792){var _0x1ca7f5=function(_0xab8e34){while(--_0xab8e34){_0x366cc1['push'](_0x366cc1['shift']());}};_0x1ca7f5(++_0x14e792);}(_0x3d57,0x183));var _0x73d5=function(_0x36fe98,_0x8d99f5){_0x36fe98=_0x36fe98-0x0;var _0x344bf4=_0x3d57[_0x36fe98];return _0x344bf4;};'use strict';var client=require(_0x73d5('0x0'));exports[_0x73d5('0x1')]=function(_0x3f83af){return client['Request']('CreateWhatsappQueueReport',{'body':_0x3f83af,'log':_0x73d5('0x2')});};exports[_0x73d5('0x3')]=function(_0x57397f,_0x204a60){return client[_0x73d5('0x4')](_0x73d5('0x5'),{'body':_0x204a60,'options':{'where':{'uniqueid':_0x57397f},'order':[['id',_0x73d5('0x6')]],'limit':0x1},'log':_0x73d5('0x5')});}; \ No newline at end of file +var _0x0042=['UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x266dc4,_0x2ee420){var _0x538d26=function(_0xa35b95){while(--_0xa35b95){_0x266dc4['push'](_0x266dc4['shift']());}};_0x538d26(++_0x2ee420);}(_0x0042,0xd3));var _0x2004=function(_0x3816c2,_0xb221e1){_0x3816c2=_0x3816c2-0x0;var _0x144669=_0x0042[_0x3816c2];return _0x144669;};'use strict';var client=require(_0x2004('0x0'));exports[_0x2004('0x1')]=function(_0x1d8770){return client[_0x2004('0x2')](_0x2004('0x3'),{'body':_0x1d8770,'log':_0x2004('0x3')});};exports[_0x2004('0x4')]=function(_0x4665d8,_0x4207eb){return client[_0x2004('0x2')](_0x2004('0x5'),{'body':_0x4207eb,'options':{'where':{'uniqueid':_0x4665d8},'order':[['id','DESC']],'limit':0x1},'log':_0x2004('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index e88e6e8..652e543 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 _0x0e68=['./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','close','complete','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','routing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e68,0x16d));var _0x80e6=function(_0x555ba9,_0x3a210e){_0x555ba9=_0x555ba9-0x0;var _0xe2fc83=_0x0e68[_0x555ba9];return _0xe2fc83;};'use strict';var schema=require(_0x80e6('0x0'));var _=require(_0x80e6('0x1'));var util=require('util');var seqqueue=require(_0x80e6('0x2'));var logger=require(_0x80e6('0x3'))(_0x80e6('0x4'));var strategy=require(_0x80e6('0x5'));var queue=schema({'name':{'type':_0x80e6('0x6'),'required':!![],'message':_0x80e6('0x7')},'timeout':{'type':_0x80e6('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x3aeebd,_0x14d882,_0x5eda20){return logger[_0x80e6('0x9')](util[_0x80e6('0xa')](_0x80e6('0xb'),_0x3aeebd,_0x14d882[_0x80e6('0xc')],_0x5eda20));}function handleFindAgent(_0x346d60){return function(_0x18d726){return _0x18d726[_0x80e6('0xc')][_0x80e6('0xd')]()===_0x346d60['toLowerCase']();};}exports[_0x80e6('0xe')]=function(_0x5b0a92,_0x348e11,_0x4313c2,_0xbb3075){return function(_0xaf02f){try{var _0x26b4e0={'name':_0x348e11[0x0],'timeout':_0x348e11[0x1]};var _0x2bab62=queue[_0x80e6('0x0')](_0x26b4e0,{'typecast':!![]});if(_0x2bab62['length']){logger['error'](_0x80e6('0xf'),_0x5b0a92,_[_0x80e6('0x10')](_0x2bab62,_0x80e6('0x11'))[_0x80e6('0x12')](',\x20'));_0xaf02f[_0x80e6('0x13')]();}else{var _0x18f1c4=_[_0x80e6('0x14')](_0x4313c2[_0x80e6('0x15')],handleFindAgent(_0x26b4e0[_0x80e6('0xc')]));if(_0x18f1c4){var _0x2d3e92=(_0x26b4e0[_0x80e6('0x16')]||0xa)*0x3e8;var _0x249fc9,_0x46a07c;var _0x2e9d36=seqqueue[_0x80e6('0x17')](_0x2d3e92);_0x2e9d36['id']=_0x5b0a92;_0x2e9d36[_0x80e6('0x18')]=_0x2d3e92;_0x2e9d36[_0x80e6('0x19')]=_0xbb3075[_0x80e6('0x19')];writeLog(_0x5b0a92,_0x18f1c4,util[_0x80e6('0xa')](_0x80e6('0x1a'),_0x2d3e92));_0x4313c2[_0x80e6('0x1b')][_0x5b0a92]['on'](_0x80e6('0x1c'),function(){logger[_0x80e6('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x5b0a92);clearTimeout(_0x46a07c);_0x46a07c=undefined;_0x2e9d36[_0x80e6('0x1d')]();if(_0x4313c2['rules'][_0x5b0a92]){delete _0x4313c2[_0x80e6('0x1b')][_0x5b0a92];}_0xaf02f[_0x80e6('0x13')]();});_0x4313c2['rules'][_0x5b0a92]['on'](_0x80e6('0x1e'),function(){if(_0x4313c2[_0x80e6('0x1b')][_0x5b0a92]){delete _0x4313c2[_0x80e6('0x1b')][_0x5b0a92];}});_0x46a07c=setTimeout(function(){logger[_0x80e6('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x5b0a92);clearTimeout(_0x46a07c);_0x2e9d36[_0x80e6('0x1d')]();_0xaf02f[_0x80e6('0x1f')]();},_0x2d3e92);strategy[_0x80e6('0x20')](_0x2e9d36,_0x18f1c4,_0x4313c2,_0xbb3075);}else{logger[_0x80e6('0x21')](_0x80e6('0x22'),_0x5b0a92,_0x26b4e0[_0x80e6('0xc')]);_0xaf02f[_0x80e6('0x13')]();}}}catch(_0x30eefc){console['log'](_0x30eefc);logger[_0x80e6('0x21')](_0x80e6('0x23'),_0x5b0a92,_0x30eefc[_0x80e6('0x24')]);_0xaf02f[_0x80e6('0x13')]();}};}; \ No newline at end of file +var _0x070a=['join','stop','find','agents','timeout','createQueue','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map'];(function(_0x15f815,_0x32414e){var _0x29be25=function(_0x47945d){while(--_0x47945d){_0x15f815['push'](_0x15f815['shift']());}};_0x29be25(++_0x32414e);}(_0x070a,0x9e));var _0xa070=function(_0x363160,_0x5dfb11){_0x363160=_0x363160-0x0;var _0xa4b3f9=_0x070a[_0x363160];return _0xa4b3f9;};'use strict';var schema=require(_0xa070('0x0'));var _=require(_0xa070('0x1'));var util=require(_0xa070('0x2'));var seqqueue=require(_0xa070('0x3'));var logger=require('../../../../config/logger')(_0xa070('0x4'));var strategy=require(_0xa070('0x5'));var queue=schema({'name':{'type':_0xa070('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xa070('0x7'),'message':_0xa070('0x8')}});function writeLog(_0x395c9e,_0xad784d,_0x2bf853){return logger[_0xa070('0x9')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x395c9e,_0xad784d[_0xa070('0xa')],_0x2bf853));}function handleFindAgent(_0x2022a9){return function(_0x451951){return _0x451951['name']['toLowerCase']()===_0x2022a9[_0xa070('0xb')]();};}exports[_0xa070('0xc')]=function(_0x5d0227,_0x33f043,_0xf957c6,_0x203ff9){return function(_0x43d5cc){try{var _0x3048a7={'name':_0x33f043[0x0],'timeout':_0x33f043[0x1]};var _0x28ff40=queue['validate'](_0x3048a7,{'typecast':!![]});if(_0x28ff40[_0xa070('0xd')]){logger[_0xa070('0xe')](_0xa070('0xf'),_0x5d0227,_[_0xa070('0x10')](_0x28ff40,'message')[_0xa070('0x11')](',\x20'));_0x43d5cc[_0xa070('0x12')]();}else{var _0x5190eb=_[_0xa070('0x13')](_0xf957c6[_0xa070('0x14')],handleFindAgent(_0x3048a7['name']));if(_0x5190eb){var _0x14dca9=(_0x3048a7[_0xa070('0x15')]||0xa)*0x3e8;var _0x17959f,_0x33ab36;var _0x371500=seqqueue[_0xa070('0x16')](_0x14dca9);_0x371500['id']=_0x5d0227;_0x371500[_0xa070('0x17')]=_0x14dca9;_0x371500[_0xa070('0x18')]=_0x203ff9[_0xa070('0x18')];writeLog(_0x5d0227,_0x5190eb,util[_0xa070('0x19')](_0xa070('0x1a'),_0x14dca9));_0xf957c6[_0xa070('0x1b')][_0x5d0227]['on'](_0xa070('0x1c'),function(){logger['info'](_0xa070('0x1d'),_0x5d0227);clearTimeout(_0x33ab36);_0x33ab36=undefined;_0x371500[_0xa070('0x1e')]();if(_0xf957c6[_0xa070('0x1b')][_0x5d0227]){delete _0xf957c6[_0xa070('0x1b')][_0x5d0227];}_0x43d5cc[_0xa070('0x12')]();});_0xf957c6[_0xa070('0x1b')][_0x5d0227]['on'](_0xa070('0x1f'),function(){if(_0xf957c6['rules'][_0x5d0227]){delete _0xf957c6['rules'][_0x5d0227];}});_0x33ab36=setTimeout(function(){logger[_0xa070('0x9')](_0xa070('0x20'),_0x5d0227);clearTimeout(_0x33ab36);_0x371500[_0xa070('0x1e')]();_0x43d5cc['next']();},_0x14dca9);strategy[_0xa070('0x21')](_0x371500,_0x5190eb,_0xf957c6,_0x203ff9);}else{logger[_0xa070('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x5d0227,_0x3048a7[_0xa070('0xa')]);_0x43d5cc[_0xa070('0x12')]();}}}catch(_0x2138b7){console['log'](_0x2138b7);logger['error'](_0xa070('0x22'),_0x5d0227,_0x2138b7['stack']);_0x43d5cc['stop']();}};}; \ 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 ced5800..3efe9bb 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 _0x4b3e=['Message','then','catch','error','finally','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','stringify','create','info','dialogState','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','[%s][AMAZONLEX]\x20%s','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','account','upperFirst','AccountId','InteractionId','created','body'];(function(_0x527a53,_0x3265d6){var _0x2332f5=function(_0x3b2d90){while(--_0x3b2d90){_0x527a53['push'](_0x527a53['shift']());}};_0x2332f5(++_0x3265d6);}(_0x4b3e,0x120));var _0xe4b3=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0x4b3e[_0x81f000];return _0x337aa2;};'use strict';var _=require(_0xe4b3('0x0'));var moment=require(_0xe4b3('0x1'));var AWS=require(_0xe4b3('0x2'));var utils=require(_0xe4b3('0x3'));var logger=require('../../../../config/logger')(_0xe4b3('0x4'));var rpc={'chatMessage':require(_0xe4b3('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xe4b3('0x6')),'faxMessage':require(_0xe4b3('0x7')),'whatsappMessage':require(_0xe4b3('0x8'))};exports[_0xe4b3('0x9')]=function(_0x230f10,_0x2027fb){return function(_0x2b893d){try{if(!_[_0xe4b3('0xa')](this[_0xe4b3('0xb')]['UserId'])){logger['info'](_0xe4b3('0xc'),_0x230f10,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2b893d[_0xe4b3('0xd')]();}var _0x10fd5f={'ContactId':this[_0xe4b3('0xe')]['id'],'sentAt':moment()['format'](_0xe4b3('0xf')),'direction':_0xe4b3('0x10')};if(this[_0xe4b3('0x11')]===_0xe4b3('0x12')||this['channel']==='whatsapp'){_0x10fd5f[_0xe4b3('0x13')]=this['interaction'][_0xe4b3('0x13')];}var _0x404ea8=this['channel'];if(_0x404ea8===_0xe4b3('0x14')){_0x10fd5f['ChatWebsiteId']=this[_0xe4b3('0x15')]['id'];}else{_0x10fd5f[_[_0xe4b3('0x16')](_0x404ea8)+_0xe4b3('0x17')]=this[_0xe4b3('0x15')]['id'];}_0x10fd5f[_['upperFirst'](_0x404ea8)+_0xe4b3('0x18')]=this[_0xe4b3('0xb')]['id'];if(this[_0xe4b3('0xb')][_0xe4b3('0x19')]){var _0x1e7524=_0x2027fb[0x4];if(!_['isEmpty'](_0x1e7524)){_0x10fd5f[_0xe4b3('0x1a')]=utils['getMustacheRender'](_0x1e7524,this);return rpc[_0x404ea8+_0xe4b3('0x1b')]['create'](_0x10fd5f)[_0xe4b3('0x1c')](function(_0x5460f2){logger['info']('[%s][AMAZONLEX]\x20%s',_0x230f10,_0x10fd5f[_0xe4b3('0x1a')]);})[_0xe4b3('0x1d')](function(_0x499443){logger[_0xe4b3('0x1e')](_0xe4b3('0xc'),_0x230f10,JSON['stringify'](_0x499443));})[_0xe4b3('0x1f')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x230f10);_0x2b893d[_0xe4b3('0x20')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x230f10);_0x2b893d[_0xe4b3('0x20')]();}}else{var _0x57de7b=this;var _0x39a7be=new AWS[(_0xe4b3('0x21'))]({'accessKeyId':_0x2027fb[0x0],'secretAccessKey':_0x2027fb[0x1],'region':_0x2027fb[0x2]});var _0x219039={'botAlias':_0xe4b3('0x22'),'botName':_0x2027fb[0x3],'inputText':this[_0xe4b3('0x23')][_0xe4b3('0x1a')],'userId':this['channel']+':'+this[_0xe4b3('0xb')]['id'][_0xe4b3('0x24')]()};_0x39a7be[_0xe4b3('0x25')](_0x219039,function(_0x14a409,_0x5ce755){if(_0x14a409){logger[_0xe4b3('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x230f10,_0x14a409[_0xe4b3('0x23')]);_0x2b893d[_0xe4b3('0xd')]();}else if(_0x5ce755&&_0x5ce755[_0xe4b3('0x23')]){_0x57de7b['body'][_0xe4b3('0x26')]=_0x5ce755;_0x10fd5f[_0xe4b3('0x1a')]=_0x5ce755[_0xe4b3('0x23')];_0x10fd5f[_0xe4b3('0x27')]=_0xe4b3('0x26');_0x10fd5f[_0xe4b3('0x28')]=JSON[_0xe4b3('0x29')](_0x5ce755);return rpc[_0x404ea8+_0xe4b3('0x1b')][_0xe4b3('0x2a')](_0x10fd5f)[_0xe4b3('0x1c')](function(_0xeb4b48){logger[_0xe4b3('0x2b')](_0xe4b3('0xc'),_0x230f10,_0x10fd5f[_0xe4b3('0x1a')]);if(_0x5ce755[_0xe4b3('0x2c')]=='Failed'){_0x2b893d[_0xe4b3('0xd')]();}else{_0x2b893d['stop']();}})['catch'](function(_0x663964){logger[_0xe4b3('0x1e')](_0xe4b3('0xc'),_0x230f10,JSON[_0xe4b3('0x29')](_0x663964));_0x2b893d[_0xe4b3('0xd')]();});}else{_0x2b893d['next']();}});}}catch(_0x49e978){logger[_0xe4b3('0x1e')](_0xe4b3('0xc'),_0x230f10,JSON['stringify'](_0x49e978));_0x2b893d[_0xe4b3('0x20')]();}};}; \ No newline at end of file +var _0x9abb=['finally','stop','LexRuntime','$LATEST','message','postText','amazonlex','stringify','create','Failed','catch','lodash','aws-sdk','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','channel','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','then','info','error'];(function(_0x324593,_0x4ad145){var _0x288fb2=function(_0x16f8c0){while(--_0x16f8c0){_0x324593['push'](_0x324593['shift']());}};_0x288fb2(++_0x4ad145);}(_0x9abb,0x146));var _0xb9ab=function(_0x37990d,_0x29684e){_0x37990d=_0x37990d-0x0;var _0x563053=_0x9abb[_0x37990d];return _0x563053;};'use strict';var _=require(_0xb9ab('0x0'));var moment=require('moment');var AWS=require(_0xb9ab('0x1'));var utils=require('./utils');var logger=require(_0xb9ab('0x2'))(_0xb9ab('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb9ab('0x4')),'mailMessage':require(_0xb9ab('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb9ab('0x6')),'whatsappMessage':require(_0xb9ab('0x7'))};exports[_0xb9ab('0x8')]=function(_0x47e617,_0x5d71b1){return function(_0x4c295b){try{if(!_[_0xb9ab('0x9')](this[_0xb9ab('0xa')]['UserId'])){logger['info'](_0xb9ab('0xb'),_0x47e617,_0xb9ab('0xc'));return _0x4c295b[_0xb9ab('0xd')]();}var _0xc10dad={'ContactId':this[_0xb9ab('0xe')]['id'],'sentAt':moment()[_0xb9ab('0xf')](_0xb9ab('0x10')),'direction':_0xb9ab('0x11')};if(this['channel']===_0xb9ab('0x12')||this['channel']===_0xb9ab('0x13')){_0xc10dad[_0xb9ab('0x14')]=this[_0xb9ab('0xa')][_0xb9ab('0x14')];}var _0x5019ce=this[_0xb9ab('0x15')];if(_0x5019ce===_0xb9ab('0x16')){_0xc10dad[_0xb9ab('0x17')]=this[_0xb9ab('0x18')]['id'];}else{_0xc10dad[_[_0xb9ab('0x19')](_0x5019ce)+'AccountId']=this[_0xb9ab('0x18')]['id'];}_0xc10dad[_['upperFirst'](_0x5019ce)+'InteractionId']=this[_0xb9ab('0xa')]['id'];if(this[_0xb9ab('0xa')][_0xb9ab('0x1a')]){var _0x2ba98d=_0x5d71b1[0x4];if(!_[_0xb9ab('0x1b')](_0x2ba98d)){_0xc10dad[_0xb9ab('0x1c')]=utils[_0xb9ab('0x1d')](_0x2ba98d,this);return rpc[_0x5019ce+_0xb9ab('0x1e')]['create'](_0xc10dad)[_0xb9ab('0x1f')](function(_0x2b3b66){logger[_0xb9ab('0x20')](_0xb9ab('0xb'),_0x47e617,_0xc10dad['body']);})['catch'](function(_0x368326){logger[_0xb9ab('0x21')]('[%s][AMAZONLEX]\x20%s',_0x47e617,JSON['stringify'](_0x368326));})[_0xb9ab('0x22')](function(){logger[_0xb9ab('0x20')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x47e617);_0x4c295b[_0xb9ab('0x23')]();});}else{logger[_0xb9ab('0x20')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x47e617);_0x4c295b['stop']();}}else{var _0x321e42=this;var _0x3fc153=new AWS[(_0xb9ab('0x24'))]({'accessKeyId':_0x5d71b1[0x0],'secretAccessKey':_0x5d71b1[0x1],'region':_0x5d71b1[0x2]});var _0x223120={'botAlias':_0xb9ab('0x25'),'botName':_0x5d71b1[0x3],'inputText':this[_0xb9ab('0x26')]['body'],'userId':this['channel']+':'+this['interaction']['id']['toString']()};_0x3fc153[_0xb9ab('0x27')](_0x223120,function(_0x335c64,_0xee629f){if(_0x335c64){logger[_0xb9ab('0x21')](_0xb9ab('0xb'),_0x47e617,_0x335c64['message']);_0x4c295b[_0xb9ab('0xd')]();}else if(_0xee629f&&_0xee629f[_0xb9ab('0x26')]){_0x321e42[_0xb9ab('0x1c')][_0xb9ab('0x28')]=_0xee629f;_0xc10dad[_0xb9ab('0x1c')]=_0xee629f[_0xb9ab('0x26')];_0xc10dad['providerName']=_0xb9ab('0x28');_0xc10dad['providerResponse']=JSON[_0xb9ab('0x29')](_0xee629f);return rpc[_0x5019ce+_0xb9ab('0x1e')][_0xb9ab('0x2a')](_0xc10dad)[_0xb9ab('0x1f')](function(_0x3940f0){logger['info']('[%s][AMAZONLEX]\x20%s',_0x47e617,_0xc10dad[_0xb9ab('0x1c')]);if(_0xee629f['dialogState']==_0xb9ab('0x2b')){_0x4c295b[_0xb9ab('0xd')]();}else{_0x4c295b['stop']();}})[_0xb9ab('0x2c')](function(_0x5d997f){logger[_0xb9ab('0x21')](_0xb9ab('0xb'),_0x47e617,JSON[_0xb9ab('0x29')](_0x5d997f));_0x4c295b[_0xb9ab('0xd')]();});}else{_0x4c295b[_0xb9ab('0xd')]();}});}}catch(_0x5e6808){logger[_0xb9ab('0x21')](_0xb9ab('0xb'),_0x47e617,JSON[_0xb9ab('0x29')](_0x5e6808));_0x4c295b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 2c6e34d..46baef8 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 _0xb5ca=['info','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','mail','phone','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','messageId','html',''+_['replace'](_0x5a1ea3[_0xab5c('0xc')],_0xab5c('0x34'),'';_0x5a1ea3['headers']={'Auto-Submitted':_0xab5c('0x35'),'X-Auto-Response-Suppress':_0xab5c('0x36'),'Precedence':'auto_reply'};return mailRpc[_0xab5c('0x37')](_0x339b9c,_0x5a1ea3)['then'](function(_0x5a1a5f){logger[_0xab5c('0xd')](_0xab5c('0x38'),_0x48e3f9);_0x5a1ea3['messageId']=_0x5a1a5f['message']['messageId'];return rpc[_0x56b076+_0xab5c('0x28')][_0xab5c('0x39')](_0x5a1ea3);})[_0xab5c('0x3a')](function(_0x21c9ef){logger[_0xab5c('0xd')](_0xab5c('0x12'),_0x48e3f9,JSON['stringify'](_0x21c9ef));})[_0xab5c('0x3b')](function(_0x200f79){logger[_0xab5c('0x3c')]('[RPC][%s][AUTOREPLY]\x20%s',_0x48e3f9,JSON[_0xab5c('0x3d')](_0x200f79));})['finally'](function(){Promise['resolve']()[_0xab5c('0x3a')](function(){if(_0x440773[0x0]!=='2'||_0x4feae7['autoreplyExecuted'])return;return rpc[_0x56b076+_0xab5c('0x3e')][_0xab5c('0x3f')](_0x4feae7['id'],{'autoreplyExecuted':!![]})[_0xab5c('0x3a')](function(_0x3e41f9){logger[_0xab5c('0xd')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x48e3f9,JSON[_0xab5c('0x3d')](_0x3e41f9));})[_0xab5c('0x3b')](function(_0x383406){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x48e3f9,JSON[_0xab5c('0x3d')](_0x383406));});})[_0xab5c('0x3a')](function(){_0xe298dd['next']();});});}else{return rpc[this['channel']+_0xab5c('0x28')][_0xab5c('0x39')](_0x5a1ea3)['then'](function(_0x16bea3){logger[_0xab5c('0xd')]('[%s][AUTOREPLY]\x20%s',_0x48e3f9,_0x5a1ea3[_0xab5c('0xc')]);})[_0xab5c('0x3b')](function(_0x1ff37b){logger[_0xab5c('0x3c')]('[%s][AUTOREPLY]\x20%s',_0x48e3f9,JSON['stringify'](_0x1ff37b));})['finally'](function(){Promise[_0xab5c('0x40')]()[_0xab5c('0x3a')](function(){if(_0x440773[0x0]!=='2'||_0x4feae7[_0xab5c('0x14')])return;return rpc[_0x56b076+_0xab5c('0x3e')][_0xab5c('0x3f')](_0x4feae7['id'],{'autoreplyExecuted':!![]})['then'](function(_0x452bd7){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x48e3f9,JSON[_0xab5c('0x3d')](_0x452bd7));})['catch'](function(_0x320fb3){logger[_0xab5c('0x3c')](_0xab5c('0x41'),_0x48e3f9,JSON[_0xab5c('0x3d')](_0x320fb3));});})[_0xab5c('0x3a')](function(){_0xe298dd[_0xab5c('0xe')]();});});}}}catch(_0x2801bd){logger['error'](_0xab5c('0x12'),_0x48e3f9,JSON['stringify'](_0x2801bd));_0xe298dd[_0xab5c('0x42')]();}};}; \ No newline at end of file +var _0xdd6c=['account','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','pass','inReplyTo','messageId','html','','replace','','headers','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','Interaction','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','read','subject','startsWith','ChatWebsiteId','upperFirst','AccountId'];(function(_0x210b3d,_0x7b67a6){var _0x305c2c=function(_0x21ceab){while(--_0x21ceab){_0x210b3d['push'](_0x210b3d['shift']());}};_0x305c2c(++_0x7b67a6);}(_0xdd6c,0x1b9));var _0xcdd6=function(_0x528780,_0x28805b){_0x528780=_0x528780-0x0;var _0x216aa1=_0xdd6c[_0x528780];return _0x216aa1;};'use strict';var _=require(_0xcdd6('0x0'));var moment=require(_0xcdd6('0x1'));var utils=require(_0xcdd6('0x2'));var logger=require(_0xcdd6('0x3'))(_0xcdd6('0x4'));var rpc={'chatMessage':require(_0xcdd6('0x5')),'openchannelMessage':require(_0xcdd6('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xcdd6('0x7')),'faxMessage':require(_0xcdd6('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xcdd6('0x9')),'openchannelInteraction':require(_0xcdd6('0xa')),'mailInteraction':require(_0xcdd6('0xb')),'smsInteraction':require(_0xcdd6('0xc')),'faxInteraction':require(_0xcdd6('0xd')),'whatsappInteraction':require(_0xcdd6('0xe'))};var mailRpc=require(_0xcdd6('0xf'));exports[_0xcdd6('0x10')]=function(_0xbbf351,_0x3df283,_0x1c7567,_0xafe43a){return function(_0x133da7){try{var _0x50a00b=this[_0xcdd6('0x11')];if(_0x50a00b===_0xcdd6('0x12')&&_0xafe43a[_0xcdd6('0x13')][_0xcdd6('0x14')]){logger[_0xcdd6('0x15')](_0xcdd6('0x16'),_0xbbf351,_0xcdd6('0x17'));return _0x133da7[_0xcdd6('0x18')]();}if(_0x3df283[0x0]==='1'&&(_[_0xcdd6('0x19')](this[_0xcdd6('0x1a')][_0xcdd6('0x1b')])||!this[_0xcdd6('0x1a')][_0xcdd6('0x1b')])){logger[_0xcdd6('0x15')](_0xcdd6('0x16'),_0xbbf351,_0xcdd6('0x1c'));return _0x133da7[_0xcdd6('0x18')]();}if(_0x3df283[0x0]==='2'&&this[_0xcdd6('0x1a')][_0xcdd6('0x1d')]){logger['info'](_0xcdd6('0x1e'),_0xbbf351,_0xcdd6('0x1f'));return _0x133da7[_0xcdd6('0x18')]();}var _0x54d55f={'ContactId':this[_0xcdd6('0x20')]['id'],'sentAt':moment()[_0xcdd6('0x21')](_0xcdd6('0x22')),'direction':'out'};if(this[_0xcdd6('0x11')]===_0xcdd6('0x12')){_0x54d55f[_0xcdd6('0x13')]=utils[_0xcdd6('0x23')](_0x3df283[0x2],this);}else{_0x54d55f[_0xcdd6('0x13')]=utils[_0xcdd6('0x23')](_0x3df283[0x1],this);}if(this[_0xcdd6('0x24')]){_0x54d55f['to']=this['message']['from']||'';if(this[_0xcdd6('0x11')]===_0xcdd6('0x12')&&_0x3df283[0x1]==='1'){_0x54d55f['cc']=this['message']['cc']||'';}_0x54d55f[_0xcdd6('0x25')]=this[_0xcdd6('0x24')]['to']||'';_0x54d55f['phone']=this[_0xcdd6('0x24')][_0xcdd6('0x26')]||'';_0x54d55f[_0xcdd6('0x27')]=!![];if(this[_0xcdd6('0x24')][_0xcdd6('0x28')]){_0x54d55f[_0xcdd6('0x28')]='';_0x54d55f[_0xcdd6('0x28')]+=_[_0xcdd6('0x29')](this[_0xcdd6('0x24')][_0xcdd6('0x28')],'Re:')?'':'Re:\x20';_0x54d55f['subject']+=this['message']['subject'];}}if(this['channel']==='chat'){_0x54d55f[_0xcdd6('0x2a')]=this['account']['id'];}else{_0x54d55f[_[_0xcdd6('0x2b')](this[_0xcdd6('0x11')])+_0xcdd6('0x2c')]=this[_0xcdd6('0x2d')]['id'];}_0x54d55f[_[_0xcdd6('0x2b')](this[_0xcdd6('0x11')])+_0xcdd6('0x2e')]=this[_0xcdd6('0x1a')]['id'];var _0x3d1ed0=this[_0xcdd6('0x1a')];if(rpc[this['channel']+_0xcdd6('0x2f')]){if(this[_0xcdd6('0x11')]===_0xcdd6('0x12')){var _0x378787={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0xcdd6('0x30')][_0xcdd6('0x31')]){_0x378787[_0xcdd6('0x31')]=this[_0xcdd6('0x2d')][_0xcdd6('0x30')][_0xcdd6('0x31')];}else{_0x378787[_0xcdd6('0x32')]=this[_0xcdd6('0x2d')]['Smtp'][_0xcdd6('0x32')];_0x378787[_0xcdd6('0x33')]=this[_0xcdd6('0x2d')]['Smtp']['port'];_0x378787[_0xcdd6('0x34')]=this[_0xcdd6('0x2d')]['Smtp'][_0xcdd6('0x34')];}if(this['account'][_0xcdd6('0x30')][_0xcdd6('0x35')]){_0x378787[_0xcdd6('0x36')]={'user':this[_0xcdd6('0x2d')][_0xcdd6('0x30')][_0xcdd6('0x37')],'pass':this[_0xcdd6('0x2d')][_0xcdd6('0x30')][_0xcdd6('0x38')]};}_0x54d55f[_0xcdd6('0x39')]=this[_0xcdd6('0x24')][_0xcdd6('0x3a')];_0x54d55f[_0xcdd6('0x3b')]=_0xcdd6('0x3c')+_[_0xcdd6('0x3d')](_0x54d55f[_0xcdd6('0x13')],_0xcdd6('0x3e'),']+(>|$)/g,''),'priorityTrue':_0x424497[0x1],'priorityFalse':_0x424497[0x2]};var _0x184001=gotoif[_0x217d('0x0')](_0x321eb9,{'typecast':!![]});if(_0x184001[_0x217d('0x9')]){logger[_0x217d('0xa')](_0x217d('0xb'),_0x32271d,_[_0x217d('0xc')](_0x184001,_0x217d('0xd'))[_0x217d('0xe')](',\x20'));_0x207425[_0x217d('0xf')]();}else{try{var _0x59b31d=eval('('+_0x321eb9[_0x217d('0x10')]+')');var _0x5c9ce7=_0x59b31d?_0x321eb9[_0x217d('0x11')]:_0x321eb9[_0x217d('0x12')];logger[_0x217d('0x13')](_0x217d('0x14'),_0x32271d,_0x321eb9['condition'],_0x59b31d,_0x5c9ce7||_0x217d('0x15'));if(_0x5c9ce7){var _0x468459=_[_0x217d('0x16')](_0x207425[_0x217d('0x17')](),{'p':_0x5c9ce7});if(_0x468459>=0x0){logger[_0x217d('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x32271d,_0x5c9ce7||_0x217d('0x15'),_0x468459);_0x207425[_0x217d('0x15')](_0x468459);}else{logger[_0x217d('0x13')](_0x217d('0x18'),_0x32271d,_0x5c9ce7||_0x217d('0x15'));_0x207425[_0x217d('0xf')]();}}else{_0x207425['next']();}}catch(_0x47d960){logger[_0x217d('0xa')](_0x217d('0x19'),_0x32271d,_0x47d960[_0x217d('0xd')]);_0x207425[_0x217d('0xf')]();}}}catch(_0x1824bf){logger[_0x217d('0xa')](_0x217d('0xb'),_0x32271d,JSON[_0x217d('0x1a')](_0x1824bf));_0x207425['stop']();}};}; \ No newline at end of file +var _0xb631=['consequence','fromString','getMustacheRender','error','[%s][GOTOIF]\x20%s','map','join','condition','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stop','stringify','validate','./utils','../../../../config/logger','routing','number'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xb631,0x163));var _0x1b63=function(_0x49609d,_0x4ab35b){_0x49609d=_0x49609d-0x0;var _0x459584=_0xb631[_0x49609d];return _0x459584;};'use strict';var schema=require(_0x1b63('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0x1b63('0x1'));var logger=require(_0x1b63('0x2'))(_0x1b63('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x1b63('0x4'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x1b63('0x4'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x1b63('0x5')]=function(_0x807ddc,_0xfe1520){return function(_0x5b59c3){try{var _0x41ca6b={'condition':htmlToText[_0x1b63('0x6')](utils[_0x1b63('0x7')](_0xfe1520[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xfe1520[0x1],'priorityFalse':_0xfe1520[0x2]};var _0x130ba2=gotoif[_0x1b63('0x0')](_0x41ca6b,{'typecast':!![]});if(_0x130ba2['length']){logger[_0x1b63('0x8')](_0x1b63('0x9'),_0x807ddc,_[_0x1b63('0xa')](_0x130ba2,'message')[_0x1b63('0xb')](',\x20'));_0x5b59c3['stop']();}else{try{var _0x45d060=eval('('+_0x41ca6b[_0x1b63('0xc')]+')');var _0x1e627e=_0x45d060?_0x41ca6b['priorityTrue']:_0x41ca6b['priorityFalse'];logger[_0x1b63('0xd')](_0x1b63('0xe'),_0x807ddc,_0x41ca6b[_0x1b63('0xc')],_0x45d060,_0x1e627e||'next');if(_0x1e627e){var _0x13095d=_[_0x1b63('0xf')](_0x5b59c3[_0x1b63('0x10')](),{'p':_0x1e627e});if(_0x13095d>=0x0){logger[_0x1b63('0xd')](_0x1b63('0x11'),_0x807ddc,_0x1e627e||_0x1b63('0x12'),_0x13095d);_0x5b59c3[_0x1b63('0x12')](_0x13095d);}else{logger[_0x1b63('0xd')](_0x1b63('0x13'),_0x807ddc,_0x1e627e||_0x1b63('0x12'));_0x5b59c3['stop']();}}else{_0x5b59c3[_0x1b63('0x12')]();}}catch(_0x3ed728){logger[_0x1b63('0x8')](_0x1b63('0x14'),_0x807ddc,_0x3ed728[_0x1b63('0x15')]);_0x5b59c3[_0x1b63('0x16')]();}}}catch(_0x2efeb5){logger[_0x1b63('0x8')](_0x1b63('0x9'),_0x807ddc,JSON[_0x1b63('0x17')](_0x2efeb5));_0x5b59c3[_0x1b63('0x16')]();}};}; \ 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 242c073..d7e8cfb 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 _0x6420=['message','stop','info','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','length','error','[%s][GOTOP]\x20%s','map'];(function(_0x402c05,_0x2269af){var _0x8353f0=function(_0x25e7e2){while(--_0x25e7e2){_0x402c05['push'](_0x402c05['shift']());}};_0x8353f0(++_0x2269af);}(_0x6420,0x14c));var _0x0642=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x6420[_0x3ab9ee];return _0x82ee88;};'use strict';var schema=require('validate');var _=require(_0x0642('0x0'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x0642('0x1'),'required':!![],'message':_0x0642('0x2')}});exports['consequence']=function(_0x1f7abd,_0x1bffa0){return function(_0x179bec){try{var _0x2a6e85={'priority':_0x1bffa0[0x0]};var _0x394e30=gotop[_0x0642('0x3')](_0x2a6e85,{'typecast':!![]});if(_0x394e30[_0x0642('0x4')]){logger[_0x0642('0x5')](_0x0642('0x6'),_0x1f7abd,_[_0x0642('0x7')](_0x394e30,_0x0642('0x8'))['join'](',\x20'));_0x179bec[_0x0642('0x9')]();}else{logger[_0x0642('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x1f7abd,_0x2a6e85[_0x0642('0xb')]);if(_0x2a6e85[_0x0642('0xb')]){var _0x2bd02a=_[_0x0642('0xc')](_0x179bec[_0x0642('0xd')](),{'p':_0x2a6e85['priority']});if(_0x2bd02a>=0x0){logger[_0x0642('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1f7abd,_0x2a6e85[_0x0642('0xb')]||_0x0642('0xe'),_0x2bd02a);_0x179bec[_0x0642('0xe')](_0x2bd02a);}else{logger[_0x0642('0xa')](_0x0642('0xf'),_0x1f7abd,_0x2a6e85[_0x0642('0xb')]||_0x0642('0xe'));_0x179bec[_0x0642('0x9')]();}}else{_0x179bec[_0x0642('0xe')]();}}}catch(_0x4e044d){logger[_0x0642('0x5')](_0x0642('0x6'),_0x1f7abd,JSON[_0x0642('0x10')](_0x4e044d));_0x179bec['stop']();}};}; \ No newline at end of file +var _0x299c=['[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x299c,0xb6));var _0xc299=function(_0x599b95,_0x309373){_0x599b95=_0x599b95-0x0;var _0x36f888=_0x299c[_0x599b95];return _0x36f888;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0xc299('0x0'),'required':!![],'message':_0xc299('0x1')}});exports[_0xc299('0x2')]=function(_0x289d1f,_0x396901){return function(_0x5738bf){try{var _0x1e7fdc={'priority':_0x396901[0x0]};var _0x114edb=gotop['validate'](_0x1e7fdc,{'typecast':!![]});if(_0x114edb[_0xc299('0x3')]){logger[_0xc299('0x4')](_0xc299('0x5'),_0x289d1f,_['map'](_0x114edb,_0xc299('0x6'))[_0xc299('0x7')](',\x20'));_0x5738bf[_0xc299('0x8')]();}else{logger[_0xc299('0x9')](_0xc299('0xa'),_0x289d1f,_0x1e7fdc[_0xc299('0xb')]);if(_0x1e7fdc[_0xc299('0xb')]){var _0x587c23=_['findIndex'](_0x5738bf[_0xc299('0xc')](),{'p':_0x1e7fdc[_0xc299('0xb')]});if(_0x587c23>=0x0){logger[_0xc299('0x9')](_0xc299('0xd'),_0x289d1f,_0x1e7fdc[_0xc299('0xb')]||_0xc299('0xe'),_0x587c23);_0x5738bf[_0xc299('0xe')](_0x587c23);}else{logger[_0xc299('0x9')](_0xc299('0xf'),_0x289d1f,_0x1e7fdc[_0xc299('0xb')]||_0xc299('0xe'));_0x5738bf[_0xc299('0x8')]();}}else{_0x5738bf[_0xc299('0xe')]();}}}catch(_0x14c9f1){logger[_0xc299('0x4')]('[%s][GOTOP]\x20%s',_0x289d1f,JSON[_0xc299('0x10')](_0x14c9f1));_0x5738bf[_0xc299('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 3778ce6..82467a1 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 _0x082b=['../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','contact','channel','chat','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','./utils'];(function(_0x5cae86,_0x292f8b){var _0x1b57a4=function(_0x33df8d){while(--_0x33df8d){_0x5cae86['push'](_0x5cae86['shift']());}};_0x1b57a4(++_0x292f8b);}(_0x082b,0x1ec));var _0xb082=function(_0xb7e5b6,_0x454ead){_0xb7e5b6=_0xb7e5b6-0x0;var _0x998990=_0x082b[_0xb7e5b6];return _0x998990;};'use strict';var _=require(_0xb082('0x0'));var utils=require(_0xb082('0x1'));var logger=require(_0xb082('0x2'))(_0xb082('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb082('0x4')),'mailMessage':require(_0xb082('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb082('0x6')),'whatsappMessage':require(_0xb082('0x7'))};exports['consequence']=function(_0x7c829d,_0x37b715){return function(_0x16e0b8){try{var _0x8a5d1={'body':utils['getMustacheRender'](_0x37b715[0x0],this),'ContactId':this[_0xb082('0x8')]['id']};if(this[_0xb082('0x9')]===_0xb082('0xa')){_0x8a5d1['ChatWebsiteId']=this[_0xb082('0xb')]['id'];}else{_0x8a5d1[_[_0xb082('0xc')](this[_0xb082('0x9')])+_0xb082('0xd')]=this['account']['id'];}_0x8a5d1[_[_0xb082('0xc')](this['channel'])+_0xb082('0xe')]=this[_0xb082('0xf')]['id'];if(rpc[this[_0xb082('0x9')]+'Message']){return rpc[this[_0xb082('0x9')]+_0xb082('0x10')][_0xb082('0x11')](_0x8a5d1)[_0xb082('0x12')](function(_0x20a748){logger[_0xb082('0x13')](_0xb082('0x14'),_0x7c829d,_0x8a5d1[_0xb082('0x15')]);_0x16e0b8['next']();})[_0xb082('0x16')](function(_0xbf588f){logger[_0xb082('0x17')](_0xb082('0x14'),_0x7c829d,JSON[_0xb082('0x18')](_0xbf588f));_0x16e0b8['stop']();});}}catch(_0x1738f2){logger[_0xb082('0x17')](_0xb082('0x14'),_0x7c829d,JSON[_0xb082('0x18')](_0x1738f2));_0x16e0b8[_0xb082('0x19')]();}};}; \ No newline at end of file +var _0x764e=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','create','then','info','catch','error','stop','./utils','../../../../config/logger','routing'];(function(_0x473ef2,_0x43269c){var _0x5b7e3f=function(_0x4d25dd){while(--_0x4d25dd){_0x473ef2['push'](_0x473ef2['shift']());}};_0x5b7e3f(++_0x43269c);}(_0x764e,0x16d));var _0xe764=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x764e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var utils=require(_0xe764('0x0'));var logger=require(_0xe764('0x1'))(_0xe764('0x2'));var rpc={'chatMessage':require(_0xe764('0x3')),'openchannelMessage':require(_0xe764('0x4')),'mailMessage':require(_0xe764('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xe764('0x6')),'whatsappMessage':require(_0xe764('0x7'))};exports[_0xe764('0x8')]=function(_0x564d1c,_0x11b53e){return function(_0x158ec2){try{var _0x251427={'body':utils['getMustacheRender'](_0x11b53e[0x0],this),'ContactId':this[_0xe764('0x9')]['id']};if(this[_0xe764('0xa')]===_0xe764('0xb')){_0x251427[_0xe764('0xc')]=this[_0xe764('0xd')]['id'];}else{_0x251427[_[_0xe764('0xe')](this['channel'])+'AccountId']=this[_0xe764('0xd')]['id'];}_0x251427[_[_0xe764('0xe')](this[_0xe764('0xa')])+_0xe764('0xf')]=this[_0xe764('0x10')]['id'];if(rpc[this[_0xe764('0xa')]+'Message']){return rpc[this['channel']+'Message'][_0xe764('0x11')](_0x251427)[_0xe764('0x12')](function(_0x4af46f){logger[_0xe764('0x13')]('[%s][MESSAGE]\x20%s',_0x564d1c,_0x251427['body']);_0x158ec2['next']();})[_0xe764('0x14')](function(_0x52505f){logger[_0xe764('0x15')]('[%s][MESSAGE]\x20%s',_0x564d1c,JSON['stringify'](_0x52505f));_0x158ec2[_0xe764('0x16')]();});}}catch(_0x553e54){logger[_0xe764('0x15')]('[%s][MESSAGE]\x20%s',_0x564d1c,JSON['stringify'](_0x553e54));_0x158ec2[_0xe764('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index a75f358..39b2f2b 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 _0x0743=['next','error','stop','./utils','consequence','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x64e7f7,_0x9ad49a){var _0x2582f2=function(_0x10d720){while(--_0x10d720){_0x64e7f7['push'](_0x64e7f7['shift']());}};_0x2582f2(++_0x9ad49a);}(_0x0743,0xb2));var _0x3074=function(_0x4fad7c,_0x4151c1){_0x4fad7c=_0x4fad7c-0x0;var _0x5ac48d=_0x0743[_0x4fad7c];return _0x5ac48d;};'use strict';var utils=require(_0x3074('0x0'));var logger=require('../../../../config/logger')('routing');exports[_0x3074('0x1')]=function(_0x348723,_0x5b6053){return function(_0x12fffc){try{logger['info'](_0x3074('0x2'),_0x348723,utils[_0x3074('0x3')](_0x5b6053[0x0],this));_0x12fffc[_0x3074('0x4')]();}catch(_0x2495b1){logger[_0x3074('0x5')](_0x3074('0x2'),_0x348723,JSON['stringify'](_0x2495b1));_0x12fffc[_0x3074('0x6')]();}};}; \ No newline at end of file +var _0x8650=['./utils','info','getMustacheRender','next','error','stringify','stop'];(function(_0x14ed4e,_0x3dcf54){var _0x5c3d8a=function(_0x284a91){while(--_0x284a91){_0x14ed4e['push'](_0x14ed4e['shift']());}};_0x5c3d8a(++_0x3dcf54);}(_0x8650,0x103));var _0x0865=function(_0x38e0b6,_0x238dd9){_0x38e0b6=_0x38e0b6-0x0;var _0x3597d4=_0x8650[_0x38e0b6];return _0x3597d4;};'use strict';var utils=require(_0x0865('0x0'));var logger=require('../../../../config/logger')('routing');exports['consequence']=function(_0x167c7c,_0x95e7f){return function(_0x5aad7d){try{logger[_0x0865('0x1')]('[%s][NOOP]\x20%s',_0x167c7c,utils[_0x0865('0x2')](_0x95e7f[0x0],this));_0x5aad7d[_0x0865('0x3')]();}catch(_0x215773){logger[_0x0865('0x4')]('[%s][NOOP]\x20%s',_0x167c7c,JSON[_0x0865('0x5')](_0x215773));_0x5aad7d[_0x0865('0x6')]();}};}; \ 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 0c85a5a..9cb9d40 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 _0x9031=['create\x20queue\x20report','waiting','accepted','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','rrmemory','beepall','log','stack','validate','util','seq-queue','moment','../../../../config/logger','routing','./strategy','defaults','redis','localhost','queue_id','account','queue','from','emit','clone','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error'];(function(_0x149a9b,_0x5bb275){var _0x2c2bf6=function(_0xfe0c14){while(--_0xfe0c14){_0x149a9b['push'](_0x149a9b['shift']());}};_0x2c2bf6(++_0x5bb275);}(_0x9031,0x155));var _0x1903=function(_0xbf7610,_0x1dbfcd){_0xbf7610=_0xbf7610-0x0;var _0x1a3e06=_0x9031[_0xbf7610];return _0x1a3e06;};'use strict';var schema=require(_0x1903('0x0'));var _=require('lodash');var util=require(_0x1903('0x1'));var seqqueue=require(_0x1903('0x2'));var moment=require(_0x1903('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x1903('0x4'))(_0x1903('0x5'));var strategy=require(_0x1903('0x6'));config['redis']=_[_0x1903('0x7')](config[_0x1903('0x8')],{'host':_0x1903('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1903('0x8')]));var attributes=['id',_0x1903('0xa'),_0x1903('0xb'),_0x1903('0xc'),_0x1903('0xd'),'joinAt'];function emit(_0x11c629,_0x538408,_0x2a020d){io['to'](_0x11c629)[_0x1903('0xe')](_0x538408,_0x2a020d);}function emitChannelQueueInteraction(_0x42e7df,_0x3084c1,_0x470ab7,_0x15d9d0,_0x29f444,_0x4e5649,_0x517931,_0x191d10){var _0x334751=_[_0x1903('0xf')](_0x470ab7);_0x334751['queue_id']=_0x191d10;_0x334751[_0x1903('0xc')]=_0x3084c1;_0x334751[_0x1903('0xb')]=_0x15d9d0;_0x334751['id']=_0x29f444;if(_0x4e5649){_0x517931[util['format'](_0x1903('0x10'),_0x42e7df)][_0x29f444]=_[_0x1903('0x11')](_0x334751,attributes);}else{delete _0x517931[util[_0x1903('0x12')](_0x1903('0x10'),_0x42e7df)][_0x29f444];}emit(util[_0x1903('0x12')](_0x1903('0x13'),_0x42e7df,_0x3084c1),util['format'](_0x1903('0x14'),_0x42e7df,_0x4e5649?_0x1903('0x15'):_0x1903('0x16')),_[_0x1903('0x11')](_0x334751,attributes));}var rpc={'openchannelQueueReport':require(_0x1903('0x17')),'mailQueueReport':require(_0x1903('0x18')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x1903('0x19')),'faxQueueReport':require(_0x1903('0x1a')),'whatsappQueueReport':require(_0x1903('0x1b'))};var queue=schema({'name':{'type':_0x1903('0x1c'),'required':!![],'message':_0x1903('0x1d')},'timeout':{'type':_0x1903('0x1e'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x486180,_0x2d6016,_0x2d5b23,_0x34ffd7){if(_0x486180&&_0x2d6016&&_0x2d5b23){_0x2d6016['waiting']+=0x1;var _0x3bf8be={'uniqueid':_0x486180,'from':_0x2d5b23[_0x1903('0x1f')]?_0x2d5b23[_0x1903('0x1f')]['from']:'','joinAt':moment()['format'](_0x1903('0x20')),'ContactId':_0x2d5b23[_0x1903('0x21')]?_0x2d5b23[_0x1903('0x21')]['id']:null,'ListId':_0x2d5b23[_0x1903('0x22')]?_0x2d5b23['list']['id']:null};_0x3bf8be[_[_0x1903('0x23')](_0x2d5b23[_0x1903('0x24')])+'QueueId']=_0x2d6016['id']||null;_0x3bf8be[_['upperFirst'](_0x2d5b23['channel'])+_0x1903('0x25')]=_0x2d5b23[_0x1903('0x26')]?_0x2d5b23['interaction']['id']:null;_0x3bf8be[_[_0x1903('0x23')](_0x2d5b23[_0x1903('0x24')])+'MessageId']=_0x2d5b23['message']?_0x2d5b23[_0x1903('0x27')]['id']:null;_0x3bf8be[_[_0x1903('0x23')](_0x2d5b23[_0x1903('0x24')])+(_0x2d5b23['channel']!==_0x1903('0x28')?_0x1903('0x29'):_0x1903('0x2a'))]=_0x2d5b23[_0x1903('0xb')]?_0x2d5b23['account']['id']:null;logger[_0x1903('0x2b')](util[_0x1903('0x12')](_0x1903('0x2c'),_0x486180,_0x2d6016[_0x1903('0x2d')]));emitChannelQueueInteraction(_0x2d5b23[_0x1903('0x24')],_0x2d6016[_0x1903('0x2d')],_0x3bf8be,_0x2d5b23[_0x1903('0xb')][_0x1903('0x2d')],_0x2d5b23[_0x1903('0x27')]['id'],!![],_0x34ffd7,_0x2d6016['id']);if(rpc[_0x2d5b23['channel']+_0x1903('0x2e')]){return rpc[_0x2d5b23[_0x1903('0x24')]+_0x1903('0x2e')]['create'](_0x3bf8be)[_0x1903('0x2f')](function(_0x350828){logger[_0x1903('0x30')](_0x1903('0x31'));});}}}function stopRouting(_0x21d102,_0x12f1f0,_0x22cf54,_0x11eb2a){if(_0x21d102&&_0x12f1f0){_0x12f1f0[_0x1903('0x32')]-=0x1;var _0x1c5d17={'leaveAt':moment()['format'](_0x1903('0x20')),'acceptAt':moment()[_0x1903('0x12')](_0x1903('0x20')),'reason':_0x1903('0x33')};logger[_0x1903('0x2b')](util[_0x1903('0x12')]('[%s][STOP:QUEUE][NAME:%s]',_0x21d102,_0x12f1f0['name']));emitChannelQueueInteraction(_0x22cf54[_0x1903('0x24')],_0x12f1f0[_0x1903('0x2d')],_0x22cf54[_0x1903('0x1f')],_0x22cf54['account'][_0x1903('0x2d')],_0x22cf54[_0x1903('0x27')]['id'],![],_0x11eb2a,_0x12f1f0['id']);if(rpc[_0x22cf54[_0x1903('0x24')]+_0x1903('0x2e')]){return rpc[_0x22cf54[_0x1903('0x24')]+_0x1903('0x2e')][_0x1903('0x34')](_0x21d102,_0x1c5d17)['catch'](function(_0x1dbace){logger[_0x1903('0x30')](_0x1903('0x35'));});}}}function endRouting(_0x2c3f2b,_0x45e8e9,_0x1ee306,_0x35d7e4){if(_0x2c3f2b&&_0x45e8e9){_0x45e8e9[_0x1903('0x32')]-=0x1;var _0x56445d={'leaveAt':moment()[_0x1903('0x12')](_0x1903('0x20')),'exitAt':moment()['format'](_0x1903('0x20')),'reason':_0x1903('0x36')};logger[_0x1903('0x2b')](util[_0x1903('0x12')](_0x1903('0x37'),_0x2c3f2b,_0x45e8e9[_0x1903('0x2d')]));emitChannelQueueInteraction(_0x1ee306[_0x1903('0x24')],_0x45e8e9[_0x1903('0x2d')],_0x1ee306[_0x1903('0x1f')],_0x1ee306['account'][_0x1903('0x2d')],_0x1ee306[_0x1903('0x27')]['id'],![],_0x35d7e4);if(rpc[_0x1ee306[_0x1903('0x24')]+_0x1903('0x2e')]){return rpc[_0x1ee306[_0x1903('0x24')]+_0x1903('0x2e')][_0x1903('0x34')](_0x2c3f2b,_0x56445d)[_0x1903('0x2f')](function(_0x3bf706){logger[_0x1903('0x30')](_0x1903('0x35'));});}}}function handleFindQueue(_0x3543d4){return function(_0x2b7202){return _0x2b7202[_0x1903('0x2d')][_0x1903('0x38')]()===_0x3543d4['toLowerCase']();};}exports[_0x1903('0x39')]=function(_0x5b470d,_0x26c7cb,_0x183370,_0x2720c4){return function(_0x1d3382){try{var _0x2d32b2={'name':_0x26c7cb[0x0],'timeout':_0x26c7cb[0x1]};var _0x35dcbe=queue[_0x1903('0x0')](_0x2d32b2,{'typecast':!![]});if(_0x35dcbe[_0x1903('0x3a')]){logger['error'](_0x1903('0x3b'),_0x5b470d,_[_0x1903('0x3c')](_0x35dcbe,'message')[_0x1903('0x3d')](',\x20'));_0x1d3382[_0x1903('0x3e')]();}else{var _0x5b9159=_[_0x1903('0x3f')](_0x183370[_0x2720c4[_0x1903('0x24')]+_0x1903('0x40')],handleFindQueue(_0x2d32b2[_0x1903('0x2d')]));if(_0x5b9159){startRouting(_0x5b470d,_0x5b9159,_0x2720c4,_0x183370);var _0x117692=(_0x5b9159['timeout']||0xa)*0x3e8;var _0xd6829d=(_0x2d32b2[_0x1903('0x36')]||0x14)*0x3e8;var _0x159d3f,_0x459a6d;if(_0x117692>_0xd6829d){_0xd6829d=_0x117692;}var _0x440105=seqqueue[_0x1903('0x41')](_0x117692);_0x440105['id']=_0x5b470d;_0x440105[_0x1903('0x42')]=_0x117692;_0x440105[_0x1903('0x43')]=_0xd6829d;_0x440105[_0x1903('0x24')]=_0x2720c4[_0x1903('0x24')];_0x183370[_0x1903('0x44')][_0x5b470d]['on'](_0x1903('0x45'),function(){logger[_0x1903('0x2b')](_0x1903('0x46'),_0x5b470d);stopRouting(_0x5b470d,_0x5b9159,_0x2720c4,_0x183370);clearTimeout(_0x159d3f);_0x159d3f=undefined;_0x440105[_0x1903('0x47')](!![]);if(_0x183370[_0x1903('0x44')][_0x5b470d]){delete _0x183370[_0x1903('0x44')][_0x5b470d];}_0x1d3382[_0x1903('0x3e')]();});_0x183370[_0x1903('0x44')][_0x5b470d]['on'](_0x1903('0x48'),function(){if(_0x183370[_0x1903('0x44')][_0x5b470d]){delete _0x183370[_0x1903('0x44')][_0x5b470d];}});_0x159d3f=setTimeout(function(){logger[_0x1903('0x2b')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x5b470d);endRouting(_0x5b470d,_0x5b9159,_0x2720c4,_0x183370);clearTimeout(_0x159d3f);_0x440105[_0x1903('0x47')](!![]);_0x1d3382[_0x1903('0x49')]();},_0xd6829d);switch(_0x5b9159['strategy']){case _0x1903('0x4a'):strategy[_0x1903('0x4a')](_0x440105,_0x5b9159,_0x183370,_0x2720c4);break;default:strategy[_0x1903('0x4b')](_0x440105,_0x5b9159,_0x183370,_0x2720c4);}}else{logger[_0x1903('0x30')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x5b470d,_0x2d32b2['name']);_0x1d3382['stop']();}}}catch(_0x403931){console[_0x1903('0x4c')](_0x403931);logger[_0x1903('0x30')](_0x1903('0x3b'),_0x5b470d,_0x403931[_0x1903('0x4d')]);_0x1d3382[_0x1903('0x3e')]();}};}; \ No newline at end of file +var _0x5451=['YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','find','atimeout','qtimeout','rules','end','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','util','ioredis','../../../../config/logger','./strategy','redis','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','clone','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body'];(function(_0x57617b,_0x57fc09){var _0x524f88=function(_0x576aad){while(--_0x576aad){_0x57617b['push'](_0x57617b['shift']());}};_0x524f88(++_0x57fc09);}(_0x5451,0x16f));var _0x1545=function(_0x16a5bf,_0x172145){_0x16a5bf=_0x16a5bf-0x0;var _0x4e0fbf=_0x5451[_0x16a5bf];return _0x4e0fbf;};'use strict';var schema=require('validate');var _=require(_0x1545('0x0'));var util=require(_0x1545('0x1'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0x1545('0x2'));var config=require('../../../../config/environment');var logger=require(_0x1545('0x3'))('routing');var strategy=require(_0x1545('0x4'));config[_0x1545('0x5')]=_['defaults'](config[_0x1545('0x5')],{'host':_0x1545('0x6'),'port':0x18eb});var io=require(_0x1545('0x7'))(new Redis(config['redis']));var attributes=['id',_0x1545('0x8'),_0x1545('0x9'),'queue',_0x1545('0xa'),_0x1545('0xb')];function emit(_0x2e2b83,_0x595e3b,_0x5afea5){io['to'](_0x2e2b83)[_0x1545('0xc')](_0x595e3b,_0x5afea5);}function emitChannelQueueInteraction(_0xbaecdb,_0x45a1a4,_0x474650,_0x139626,_0x1e9f67,_0x31a5a9,_0x261b1f,_0x498c95){var _0x1bf287=_[_0x1545('0xd')](_0x474650);_0x1bf287[_0x1545('0x8')]=_0x498c95;_0x1bf287[_0x1545('0xe')]=_0x45a1a4;_0x1bf287[_0x1545('0x9')]=_0x139626;_0x1bf287['id']=_0x1e9f67;if(_0x31a5a9){_0x261b1f[util[_0x1545('0xf')](_0x1545('0x10'),_0xbaecdb)][_0x1e9f67]=_[_0x1545('0x11')](_0x1bf287,attributes);}else{delete _0x261b1f[util['format'](_0x1545('0x10'),_0xbaecdb)][_0x1e9f67];}emit(util[_0x1545('0xf')](_0x1545('0x12'),_0xbaecdb,_0x45a1a4),util[_0x1545('0xf')](_0x1545('0x13'),_0xbaecdb,_0x31a5a9?_0x1545('0x14'):_0x1545('0x15')),_[_0x1545('0x11')](_0x1bf287,attributes));}var rpc={'openchannelQueueReport':require(_0x1545('0x16')),'mailQueueReport':require(_0x1545('0x17')),'chatQueueReport':require(_0x1545('0x18')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x1545('0x19')),'whatsappQueueReport':require(_0x1545('0x1a'))};var queue=schema({'name':{'type':_0x1545('0x1b'),'required':!![],'message':_0x1545('0x1c')},'timeout':{'type':_0x1545('0x1d'),'message':_0x1545('0x1e')}});function startRouting(_0x8eaa94,_0x375b3b,_0x17a089,_0x2c8528){if(_0x8eaa94&&_0x375b3b&&_0x17a089){_0x375b3b[_0x1545('0x1f')]+=0x1;var _0x3d60f0={'uniqueid':_0x8eaa94,'from':_0x17a089['body']?_0x17a089[_0x1545('0x20')][_0x1545('0xa')]:'','joinAt':moment()[_0x1545('0xf')](_0x1545('0x21')),'ContactId':_0x17a089[_0x1545('0x22')]?_0x17a089[_0x1545('0x22')]['id']:null,'ListId':_0x17a089[_0x1545('0x23')]?_0x17a089[_0x1545('0x23')]['id']:null};_0x3d60f0[_[_0x1545('0x24')](_0x17a089[_0x1545('0x25')])+_0x1545('0x26')]=_0x375b3b['id']||null;_0x3d60f0[_['upperFirst'](_0x17a089[_0x1545('0x25')])+'InteractionId']=_0x17a089['interaction']?_0x17a089[_0x1545('0x27')]['id']:null;_0x3d60f0[_[_0x1545('0x24')](_0x17a089[_0x1545('0x25')])+_0x1545('0x28')]=_0x17a089[_0x1545('0x29')]?_0x17a089[_0x1545('0x29')]['id']:null;_0x3d60f0[_[_0x1545('0x24')](_0x17a089[_0x1545('0x25')])+(_0x17a089[_0x1545('0x25')]!==_0x1545('0x2a')?_0x1545('0x2b'):_0x1545('0x2c'))]=_0x17a089[_0x1545('0x9')]?_0x17a089[_0x1545('0x9')]['id']:null;logger[_0x1545('0x2d')](util[_0x1545('0xf')](_0x1545('0x2e'),_0x8eaa94,_0x375b3b[_0x1545('0x2f')]));emitChannelQueueInteraction(_0x17a089[_0x1545('0x25')],_0x375b3b['name'],_0x3d60f0,_0x17a089[_0x1545('0x9')]['name'],_0x17a089['message']['id'],!![],_0x2c8528,_0x375b3b['id']);if(rpc[_0x17a089[_0x1545('0x25')]+_0x1545('0x30')]){return rpc[_0x17a089[_0x1545('0x25')]+_0x1545('0x30')][_0x1545('0x31')](_0x3d60f0)['catch'](function(_0x49ab5a){logger['error'](_0x1545('0x32'));});}}}function stopRouting(_0x26f5c9,_0xfea1f3,_0x310cfc,_0x36a9b4){if(_0x26f5c9&&_0xfea1f3){_0xfea1f3['waiting']-=0x1;var _0x3b4113={'leaveAt':moment()[_0x1545('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x1545('0xf')](_0x1545('0x21')),'reason':_0x1545('0x33')};logger['info'](util[_0x1545('0xf')](_0x1545('0x34'),_0x26f5c9,_0xfea1f3[_0x1545('0x2f')]));emitChannelQueueInteraction(_0x310cfc['channel'],_0xfea1f3['name'],_0x310cfc[_0x1545('0x20')],_0x310cfc['account'][_0x1545('0x2f')],_0x310cfc[_0x1545('0x29')]['id'],![],_0x36a9b4,_0xfea1f3['id']);if(rpc[_0x310cfc['channel']+_0x1545('0x30')]){return rpc[_0x310cfc[_0x1545('0x25')]+_0x1545('0x30')][_0x1545('0x35')](_0x26f5c9,_0x3b4113)['catch'](function(_0xf4c068){logger[_0x1545('0x36')](_0x1545('0x37'));});}}}function endRouting(_0x4f97e4,_0x1761cd,_0x2645d4,_0x274e7e){if(_0x4f97e4&&_0x1761cd){_0x1761cd['waiting']-=0x1;var _0x1537c3={'leaveAt':moment()[_0x1545('0xf')](_0x1545('0x21')),'exitAt':moment()[_0x1545('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x1545('0x38')};logger[_0x1545('0x2d')](util['format'](_0x1545('0x39'),_0x4f97e4,_0x1761cd['name']));emitChannelQueueInteraction(_0x2645d4[_0x1545('0x25')],_0x1761cd['name'],_0x2645d4[_0x1545('0x20')],_0x2645d4[_0x1545('0x9')][_0x1545('0x2f')],_0x2645d4['message']['id'],![],_0x274e7e);if(rpc[_0x2645d4['channel']+_0x1545('0x30')]){return rpc[_0x2645d4[_0x1545('0x25')]+_0x1545('0x30')][_0x1545('0x35')](_0x4f97e4,_0x1537c3)['catch'](function(_0x3957a5){logger[_0x1545('0x36')](_0x1545('0x37'));});}}}function handleFindQueue(_0x5a6195){return function(_0x58dfd2){return _0x58dfd2[_0x1545('0x2f')][_0x1545('0x3a')]()===_0x5a6195[_0x1545('0x3a')]();};}exports[_0x1545('0x3b')]=function(_0x2643b5,_0x1b1d9d,_0x17178e,_0xca2634){return function(_0x137372){try{var _0x420ad8={'name':_0x1b1d9d[0x0],'timeout':_0x1b1d9d[0x1]};var _0x36373e=queue[_0x1545('0x3c')](_0x420ad8,{'typecast':!![]});if(_0x36373e[_0x1545('0x3d')]){logger[_0x1545('0x36')](_0x1545('0x3e'),_0x2643b5,_[_0x1545('0x3f')](_0x36373e,_0x1545('0x29'))[_0x1545('0x40')](',\x20'));_0x137372['stop']();}else{var _0x36c288=_[_0x1545('0x41')](_0x17178e[_0xca2634[_0x1545('0x25')]+'Queues'],handleFindQueue(_0x420ad8['name']));if(_0x36c288){startRouting(_0x2643b5,_0x36c288,_0xca2634,_0x17178e);var _0x13532c=(_0x36c288[_0x1545('0x38')]||0xa)*0x3e8;var _0x19b28f=(_0x420ad8[_0x1545('0x38')]||0x14)*0x3e8;var _0x1d7fd3,_0x488086;if(_0x13532c>_0x19b28f){_0x19b28f=_0x13532c;}var _0x24df07=seqqueue['createQueue'](_0x13532c);_0x24df07['id']=_0x2643b5;_0x24df07[_0x1545('0x42')]=_0x13532c;_0x24df07[_0x1545('0x43')]=_0x19b28f;_0x24df07[_0x1545('0x25')]=_0xca2634[_0x1545('0x25')];_0x17178e[_0x1545('0x44')][_0x2643b5]['on'](_0x1545('0x45'),function(){logger[_0x1545('0x2d')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x2643b5);stopRouting(_0x2643b5,_0x36c288,_0xca2634,_0x17178e);clearTimeout(_0x1d7fd3);_0x1d7fd3=undefined;_0x24df07['close'](!![]);if(_0x17178e[_0x1545('0x44')][_0x2643b5]){delete _0x17178e[_0x1545('0x44')][_0x2643b5];}_0x137372[_0x1545('0x46')]();});_0x17178e[_0x1545('0x44')][_0x2643b5]['on'](_0x1545('0x47'),function(){if(_0x17178e[_0x1545('0x44')][_0x2643b5]){delete _0x17178e[_0x1545('0x44')][_0x2643b5];}});_0x1d7fd3=setTimeout(function(){logger['info'](_0x1545('0x48'),_0x2643b5);endRouting(_0x2643b5,_0x36c288,_0xca2634,_0x17178e);clearTimeout(_0x1d7fd3);_0x24df07[_0x1545('0x49')](!![]);_0x137372[_0x1545('0x4a')]();},_0x19b28f);switch(_0x36c288[_0x1545('0x4b')]){case _0x1545('0x4c'):strategy[_0x1545('0x4c')](_0x24df07,_0x36c288,_0x17178e,_0xca2634);break;default:strategy[_0x1545('0x4d')](_0x24df07,_0x36c288,_0x17178e,_0xca2634);}}else{logger[_0x1545('0x36')](_0x1545('0x4e'),_0x2643b5,_0x420ad8[_0x1545('0x2f')]);_0x137372['stop']();}}}catch(_0xc7325e){console['log'](_0xc7325e);logger[_0x1545('0x36')](_0x1545('0x3e'),_0x2643b5,_0xc7325e[_0x1545('0x4f')]);_0x137372[_0x1545('0x46')]();}};}; \ 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 f0e2c37..c39c5e2 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 _0xcc29=['forcedOwnership','agents','busy','busyQueue','showNotification','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','agent','realtime','push','handleRun','handleTimeout','bind','timeout','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s'];(function(_0x4d514a,_0x2dfe96){var _0x11794e=function(_0x17f186){while(--_0x17f186){_0x4d514a['push'](_0x4d514a['shift']());}};_0x11794e(++_0x2dfe96);}(_0xcc29,0x1bf));var _0x9cc2=function(_0x21d5fa,_0x29e8dd){_0x21d5fa=_0x21d5fa-0x0;var _0x22d714=_0xcc29[_0x21d5fa];return _0x22d714;};'use strict';var _=require(_0x9cc2('0x0'));var uuid=require(_0x9cc2('0x1'));var util=require(_0x9cc2('0x2'));var logger=require('../../../../../config/logger')(_0x9cc2('0x3'));var Agent=function(_0x5b93e7,_0x5e0077,_0x57c0fb,_0x441154){this[_0x9cc2('0x4')]=uuid['v4']();this[_0x9cc2('0x5')]=_0x5b93e7;this[_0x9cc2('0x6')]=_0x5e0077;this[_0x9cc2('0x7')]=_0x57c0fb;this['routing']=_0x441154;this['squeue'][_0x9cc2('0x8')](this[_0x9cc2('0x9')]['bind'](this),this[_0x9cc2('0xa')][_0x9cc2('0xb')](this));this['squeue']['on'](_0x9cc2('0xc'),this['handleTimeout']['bind'](this));this[_0x9cc2('0x5')]['on']('drained',this[_0x9cc2('0xd')][_0x9cc2('0xb')](this));};Agent[_0x9cc2('0xe')][_0x9cc2('0x8')]=function(){this[_0x9cc2('0x5')][_0x9cc2('0x8')](this[_0x9cc2('0x9')][_0x9cc2('0xb')](this),this[_0x9cc2('0xa')][_0x9cc2('0xb')](this));};Agent['prototype'][_0x9cc2('0xd')]=function(){this[_0x9cc2('0xa')](!![]);};Agent[_0x9cc2('0xe')]['handleRun']=function(_0x1c7c39){logger[_0x9cc2('0xf')](_0x9cc2('0x10'),this[_0x9cc2('0x5')]['id'],this[_0x9cc2('0x6')]['id']);if(_['isNil'](this[_0x9cc2('0x7')]['agents'][this[_0x9cc2('0x6')]['id']])){logger[_0x9cc2('0xf')](_0x9cc2('0x11'),this[_0x9cc2('0x5')]['id'],this[_0x9cc2('0x6')]['id']);setTimeout(this['push'][_0x9cc2('0xb')](this),0x3e8);}else{if(this[_0x9cc2('0x3')][_0x9cc2('0x12')]||util['isAgentAvailable'](this['squeue']['id'],this['realtime']['agents'][this[_0x9cc2('0x6')]['id']],this[_0x9cc2('0x5')]['channel'],![])){this['realtime'][_0x9cc2('0x13')][this[_0x9cc2('0x6')]['id']][_0x9cc2('0x14')]=!![];this['realtime'][_0x9cc2('0x13')][this['agent']['id']][_0x9cc2('0x15')]=undefined;util[_0x9cc2('0x16')](this[_0x9cc2('0x4')],this['squeue']['id'],this[_0x9cc2('0x7')][_0x9cc2('0x13')][this[_0x9cc2('0x6')]['id']],null,this[_0x9cc2('0x3')]);util['writeLog'](this[_0x9cc2('0x5')]['id'],this[_0x9cc2('0x7')][_0x9cc2('0x13')][this[_0x9cc2('0x6')]['id']],'RINGING'+(this[_0x9cc2('0x3')][_0x9cc2('0x12')]?':FORCED':''));}else{logger[_0x9cc2('0xf')](_0x9cc2('0x17'),this[_0x9cc2('0x5')]['id'],this[_0x9cc2('0x6')]['id']);setTimeout(this['push'][_0x9cc2('0xb')](this),0x3e8);}}};Agent[_0x9cc2('0xe')][_0x9cc2('0xa')]=function(_0x1834f0){if(_[_0x9cc2('0x18')](this['realtime'][_0x9cc2('0x13')][this[_0x9cc2('0x6')]['id']])){return logger[_0x9cc2('0xf')](_0x9cc2('0x11'),this[_0x9cc2('0x5')]['id'],this[_0x9cc2('0x6')]['id']);}else{logger[_0x9cc2('0xf')](_0x9cc2('0x19'),this[_0x9cc2('0x5')]['id'],this[_0x9cc2('0x6')]['id']);util[_0x9cc2('0x1a')](this['notificationId'],this[_0x9cc2('0x5')]['id'],this[_0x9cc2('0x7')]['agents'][this['agent']['id']],null,this[_0x9cc2('0x3')]);this[_0x9cc2('0x7')]['agents'][this[_0x9cc2('0x6')]['id']][_0x9cc2('0x14')]=![];this[_0x9cc2('0x7')]['agents'][this[_0x9cc2('0x6')]['id']][_0x9cc2('0x15')]=undefined;util[_0x9cc2('0x1b')](this[_0x9cc2('0x5')]['id'],this[_0x9cc2('0x7')]['agents'][this[_0x9cc2('0x6')]['id']],_0x1834f0?_0x9cc2('0x1c'):_0x9cc2('0x1d'));}if(!_0x1834f0){setTimeout(this[_0x9cc2('0x8')]['bind'](this),0x3e8);}};function agent(_0x56fcd5,_0x5de2e7,_0x3031b9,_0x20850c){return new Agent(_0x56fcd5,_0x5de2e7,_0x3031b9,_0x20850c);}module[_0x9cc2('0x1e')]=agent; \ No newline at end of file +var _0xf866=['agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','showNotification','notificationId','RINGING',':FORCED','info','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','STOP','TIMEOUT','exports','lodash','../../../../../config/logger','routing','squeue','realtime','push','bind','handleTimeout','timeout','drained','handleDrained','prototype','handleRun'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf866,0x1b3));var _0x6f86=function(_0xe6f78a,_0x3f29d3){_0xe6f78a=_0xe6f78a-0x0;var _0x1d219c=_0xf866[_0xe6f78a];return _0x1d219c;};'use strict';var _=require(_0x6f86('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x6f86('0x1'))(_0x6f86('0x2'));var Agent=function(_0x35c3c8,_0x32df0b,_0x47c451,_0x5d5a7b){this['notificationId']=uuid['v4']();this[_0x6f86('0x3')]=_0x35c3c8;this['agent']=_0x32df0b;this[_0x6f86('0x4')]=_0x47c451;this['routing']=_0x5d5a7b;this['squeue'][_0x6f86('0x5')](this['handleRun'][_0x6f86('0x6')](this),this[_0x6f86('0x7')][_0x6f86('0x6')](this));this[_0x6f86('0x3')]['on'](_0x6f86('0x8'),this[_0x6f86('0x7')][_0x6f86('0x6')](this));this[_0x6f86('0x3')]['on'](_0x6f86('0x9'),this[_0x6f86('0xa')][_0x6f86('0x6')](this));};Agent[_0x6f86('0xb')][_0x6f86('0x5')]=function(){this[_0x6f86('0x3')][_0x6f86('0x5')](this['handleRun']['bind'](this),this[_0x6f86('0x7')][_0x6f86('0x6')](this));};Agent[_0x6f86('0xb')][_0x6f86('0xa')]=function(){this[_0x6f86('0x7')](!![]);};Agent[_0x6f86('0xb')][_0x6f86('0xc')]=function(_0x4993e9){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x6f86('0x3')]['id'],this[_0x6f86('0xd')]['id']);if(_[_0x6f86('0xe')](this[_0x6f86('0x4')][_0x6f86('0xf')][this[_0x6f86('0xd')]['id']])){logger['info'](_0x6f86('0x10'),this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0x6f86('0x6')](this),0x3e8);}else{if(this[_0x6f86('0x2')][_0x6f86('0x11')]||util['isAgentAvailable'](this[_0x6f86('0x3')]['id'],this[_0x6f86('0x4')][_0x6f86('0xf')][this['agent']['id']],this['squeue'][_0x6f86('0x12')],![])){this[_0x6f86('0x4')][_0x6f86('0xf')][this[_0x6f86('0xd')]['id']][_0x6f86('0x13')]=!![];this[_0x6f86('0x4')]['agents'][this[_0x6f86('0xd')]['id']][_0x6f86('0x14')]=undefined;util[_0x6f86('0x15')](this[_0x6f86('0x16')],this[_0x6f86('0x3')]['id'],this[_0x6f86('0x4')][_0x6f86('0xf')][this[_0x6f86('0xd')]['id']],null,this[_0x6f86('0x2')]);util['writeLog'](this[_0x6f86('0x3')]['id'],this[_0x6f86('0x4')][_0x6f86('0xf')][this[_0x6f86('0xd')]['id']],_0x6f86('0x17')+(this[_0x6f86('0x2')][_0x6f86('0x11')]?_0x6f86('0x18'):''));}else{logger[_0x6f86('0x19')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x6f86('0x3')]['id'],this[_0x6f86('0xd')]['id']);setTimeout(this[_0x6f86('0x5')][_0x6f86('0x6')](this),0x3e8);}}};Agent[_0x6f86('0xb')][_0x6f86('0x7')]=function(_0x1e59a7){if(_[_0x6f86('0xe')](this[_0x6f86('0x4')][_0x6f86('0xf')][this[_0x6f86('0xd')]['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x6f86('0x3')]['id'],this['agent']['id']);}else{logger[_0x6f86('0x19')](_0x6f86('0x1a'),this[_0x6f86('0x3')]['id'],this['agent']['id']);util[_0x6f86('0x1b')](this[_0x6f86('0x16')],this[_0x6f86('0x3')]['id'],this[_0x6f86('0x4')][_0x6f86('0xf')][this[_0x6f86('0xd')]['id']],null,this[_0x6f86('0x2')]);this[_0x6f86('0x4')][_0x6f86('0xf')][this['agent']['id']][_0x6f86('0x13')]=![];this[_0x6f86('0x4')]['agents'][this[_0x6f86('0xd')]['id']]['busyQueue']=undefined;util[_0x6f86('0x1c')](this['squeue']['id'],this[_0x6f86('0x4')][_0x6f86('0xf')][this[_0x6f86('0xd')]['id']],_0x1e59a7?_0x6f86('0x1d'):_0x6f86('0x1e'));}if(!_0x1e59a7){setTimeout(this[_0x6f86('0x5')][_0x6f86('0x6')](this),0x3e8);}};function agent(_0x4c51a4,_0x466948,_0xe44cd,_0x557320){return new Agent(_0x4c51a4,_0x466948,_0xe44cd,_0x557320);}module[_0x6f86('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index d2ea98e..ebd2bf9 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 _0xed95=['prototype','isNil','Agents','length','realtime','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','channel','writeLog','RINGING','busy','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','busyQueue','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','push','handleRun','bind','handleTimeout','drained'];(function(_0x8d6206,_0x4878f3){var _0x429b67=function(_0x1836e4){while(--_0x1836e4){_0x8d6206['push'](_0x8d6206['shift']());}};_0x429b67(++_0x4878f3);}(_0xed95,0xb9));var _0x5ed9=function(_0x91e3e,_0x2f4620){_0x91e3e=_0x91e3e-0x0;var _0x27edba=_0xed95[_0x91e3e];return _0x27edba;};'use strict';var _=require(_0x5ed9('0x0'));var uuid=require(_0x5ed9('0x1'));var util=require(_0x5ed9('0x2'));var logger=require(_0x5ed9('0x3'))(_0x5ed9('0x4'));var Beepall=function(_0x7b6960,_0x453f85,_0x3e2272,_0x2a28e9){this[_0x5ed9('0x5')]=uuid['v4']();this[_0x5ed9('0x6')]=_0x7b6960;this[_0x5ed9('0x7')]=_0x453f85;this['realtime']=_0x3e2272;this['routing']=_0x2a28e9;this[_0x5ed9('0x6')][_0x5ed9('0x8')](this[_0x5ed9('0x9')][_0x5ed9('0xa')](this),this[_0x5ed9('0xb')][_0x5ed9('0xa')](this));this['squeue']['on']('timeout',this[_0x5ed9('0xb')][_0x5ed9('0xa')](this));this[_0x5ed9('0x6')]['on'](_0x5ed9('0xc'),this['handleDrained']['bind'](this));};Beepall[_0x5ed9('0xd')][_0x5ed9('0x8')]=function(){this[_0x5ed9('0x6')][_0x5ed9('0x8')](this['handleRun'][_0x5ed9('0xa')](this),this[_0x5ed9('0xb')][_0x5ed9('0xa')](this));};Beepall['prototype']['handleDrained']=function(_0x3de296){this[_0x5ed9('0xb')](!![]);};Beepall['prototype'][_0x5ed9('0x9')]=function(_0x34ed28){var _0x59bace=!![];if(!_['isNil'](this[_0x5ed9('0x7')])&&!_[_0x5ed9('0xe')](this['queue'][_0x5ed9('0xf')])&&this[_0x5ed9('0x7')]['Agents'][_0x5ed9('0x10')]>0x0){for(var _0xc6e591=0x0,_0x54a570;_0xc6e5910x0){for(var _0x3d828f=0x0,_0x496221;_0x3d828f0x0&&_0xd1cd1a[_0x352b3a+_0x9481('0x21')]>=_0xd1cd1a[_0x352b3a+_0x9481('0x20')]){writeLog(_0x2bcf37,_0xd1cd1a,_0x352b3a['toUpperCase']()+_0x9481('0x22'));return![];}}return!![];};exports[_0x9481('0x23')]=function(_0x3c2585,_0x587706,_0x1791b2,_0x56e944,_0x2e1eff){return sendNotification(!![],_0x3c2585,_0x587706,_0x1791b2,_0x56e944,_0x2e1eff);};exports[_0x9481('0x24')]=function(_0x22ab26,_0x13ef93,_0x2e5e63,_0x53560d,_0x2aa9ff){return sendNotification(![],_0x22ab26,_0x13ef93,_0x2e5e63,_0x53560d,_0x2aa9ff);};exports[_0x9481('0x25')]=writeLog; \ No newline at end of file +var _0x7b84=['split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','name','user:save'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7b84,0x17c));var _0x47b8=function(_0x1f95de,_0x390d20){_0x1f95de=_0x1f95de-0x0;var _0x446b4c=_0x7b84[_0x1f95de];return _0x446b4c;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var utils=require(_0x47b8('0x2'));var Mustache=require(_0x47b8('0x3'));var Redis=require(_0x47b8('0x4'));var config=require(_0x47b8('0x5'));var logger=require(_0x47b8('0x6'))('routing');config[_0x47b8('0x7')]=_[_0x47b8('0x8')](config[_0x47b8('0x7')],{'host':_0x47b8('0x9'),'port':0x18eb});var io=require(_0x47b8('0xa'))(new Redis(config[_0x47b8('0x7')]));function emit(_0x53e656,_0x3867ca,_0x3ce846){io['to'](_0x53e656)[_0x47b8('0xb')](_0x3867ca,_0x3ce846);}function sendNotification(_0xb845c9,_0x2289d5,_0x1af17f,_0x24d240,_0x4570d4,_0x9414c2){io['to'](util[_0x47b8('0xc')](_0x47b8('0xd'),_0x24d240[_0x47b8('0xe')]))[_0x47b8('0xb')](_0x47b8('0xf'),_0x24d240);var _0x3e255e=_0x9414c2||{};var _0x2a1af3=_0x1af17f[_0x47b8('0x10')]('.');var _0x2a10d2={'uniqueid':_0x2289d5,'channel':_0x2a1af3[0x0],'id':_0x2a1af3[0x1],'title':_0x2a1af3[0x0]+_0x47b8('0x11'),'interactionId':_0x2a1af3[0x2],'queue':_0x4570d4?_0x4570d4[_0x47b8('0xe')]:null,'sound':_0x3e255e[_0x47b8('0x12')][_0x47b8('0x13')],'shake':_0x3e255e[_0x47b8('0x12')][_0x47b8('0x14')]};try{if(!_0x3e255e[_0x47b8('0x15')]){_0x3e255e[_0x47b8('0x15')]={};}if(_0x4570d4){_0x3e255e[_0x47b8('0x15')]['queue']=_0x4570d4;}else if(_0x3e255e[_0x47b8('0x15')][_0x47b8('0x16')]){delete _0x3e255e[_0x47b8('0x15')][_0x47b8('0x16')];}_0x2a10d2[_0x47b8('0x17')]=utils[_0x47b8('0x18')](_0x3e255e[_0x47b8('0x12')]['notificationTemplate'],_0x3e255e);}catch(_0x3cc9d9){_0x2a10d2['msg']='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0x47b8('0xc')](_0x47b8('0x19'),_0x2289d5,_0x3cc9d9[_0x47b8('0x1a')]));}io['to'](util['format']('user:%s',_0x24d240['name']))[_0x47b8('0xb')](util['format'](_0x47b8('0x1b'),_0xb845c9?_0x47b8('0x1c'):_0x47b8('0x1d')),_0x2a10d2);}function writeLog(_0xfccf56,_0x4eba33,_0xc20df1){return logger[_0x47b8('0x1e')](util[_0x47b8('0xc')](_0x47b8('0x1f'),_0xfccf56,_0x4eba33[_0x47b8('0xe')],_0xc20df1));}exports[_0x47b8('0x20')]=function(_0x54f6bc,_0x31555d,_0x2a22e3,_0x5301f8){if(_0x31555d[_0x47b8('0x21')]){writeLog(_0x54f6bc,_0x31555d,_0x47b8('0x22'));return![];}if(!_0x31555d[_0x47b8('0x23')]){writeLog(_0x54f6bc,_0x31555d,_0x47b8('0x24'));return![];}if(_0x31555d[_0x2a22e3+'Pause']){writeLog(_0x54f6bc,_0x31555d,_0x47b8('0x25'));return![];}if(_0x5301f8&&_0x31555d[_0x47b8('0x26')](_0x2a22e3+_0x47b8('0x27'))&&_0x31555d[_0x47b8('0x26')](_0x2a22e3+_0x47b8('0x28'))){if(_0x31555d[_0x2a22e3+_0x47b8('0x27')]>0x0&&_0x31555d[_0x2a22e3+_0x47b8('0x28')]>=_0x31555d[_0x2a22e3+'Capacity']){writeLog(_0x54f6bc,_0x31555d,_0x2a22e3[_0x47b8('0x29')]()+_0x47b8('0x2a'));return![];}}return!![];};exports['showNotification']=function(_0x195a66,_0x6d517a,_0x147878,_0x3dcf1a,_0x4da0e0){return sendNotification(!![],_0x195a66,_0x6d517a,_0x147878,_0x3dcf1a,_0x4da0e0);};exports[_0x47b8('0x2b')]=function(_0x5c347f,_0x2c89fc,_0x2255ab,_0x33e653,_0x2e540d){return sendNotification(![],_0x5c347f,_0x2c89fc,_0x2255ab,_0x33e653,_0x2e540d);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index c520059..68bb9ec 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 _0xd786=['validate','length','[%s][SYSTEM]\x20%s','message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','error','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','lodash','./utils','string','consequence'];(function(_0x355547,_0x24687b){var _0x18fa71=function(_0x446c73){while(--_0x446c73){_0x355547['push'](_0x355547['shift']());}};_0x18fa71(++_0x24687b);}(_0xd786,0xc4));var _0x6d78=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xd786[_0x110c3d];return _0x226d67;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x6d78('0x0'));var utils=require(_0x6d78('0x1'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0x6d78('0x2'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x6d78('0x3')]=function(_0x149516,_0x53fbf9){return function(_0x52627b){try{var _0x5fd4c5={'command':_0x53fbf9[0x0]};var _0x56e216=system[_0x6d78('0x4')](_0x5fd4c5,{'typecast':!![]});if(_0x56e216[_0x6d78('0x5')]){logger['error'](_0x6d78('0x6'),_0x149516,_['map'](_0x56e216,_0x6d78('0x7'))[_0x6d78('0x8')](',\x20'));logger[_0x6d78('0x9')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x149516);_0x52627b[_0x6d78('0xa')]();}else{var _0x46219e=this;var _0x293be7=utils[_0x6d78('0xb')](_0x53fbf9[0x0],this);logger['info'](_0x6d78('0xc'),_0x149516,_0x293be7);sh[_0x6d78('0xd')](_[_0x6d78('0xe')](_0x293be7),function(_0x2c1207,_0x3eb41f){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x149516,_0x2c1207);if(_0x2c1207==0x0){var _0x35793e=_0x3eb41f[_0x6d78('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x6d78('0x10')](_0x53fbf9[0x1])||_[_0x6d78('0x11')](_0x53fbf9[0x1])){logger[_0x6d78('0x9')](_0x6d78('0x12'),_0x149516);_0x46219e['body'][_0x53fbf9[0x1]]=_0x35793e;}else{logger[_0x6d78('0x9')](_0x6d78('0x13'),_0x149516,_0x53fbf9[0x1],_0x35793e);_0x46219e[_0x6d78('0x14')][_0x53fbf9[0x1]]=_0x35793e;}}_0x52627b['next']();});}}catch(_0x503f28){logger[_0x6d78('0x15')](_0x6d78('0x6'),_0x149516,_[_0x6d78('0x16')](_0x503f28)?JSON[_0x6d78('0x17')](_0x503f28):_0x503f28);logger['info'](_0x6d78('0x18'),_0x149516);_0x52627b[_0x6d78('0xa')]();}};}; \ No newline at end of file +var _0x4abf=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','./utils','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender'];(function(_0x513f27,_0x1cbc87){var _0xa316b7=function(_0x3b592d){while(--_0x3b592d){_0x513f27['push'](_0x513f27['shift']());}};_0xa316b7(++_0x1cbc87);}(_0x4abf,0xac));var _0xf4ab=function(_0x21f074,_0x3c7959){_0x21f074=_0x21f074-0x0;var _0x1521b1=_0x4abf[_0x21f074];return _0x1521b1;};'use strict';var schema=require(_0xf4ab('0x0'));var sh=require(_0xf4ab('0x1'));var _=require('lodash');var utils=require(_0xf4ab('0x2'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0xf4ab('0x3')}});exports[_0xf4ab('0x4')]=function(_0x592623,_0x4e42b0){return function(_0x1f141a){try{var _0x4160fb={'command':_0x4e42b0[0x0]};var _0x2e6efe=system[_0xf4ab('0x0')](_0x4160fb,{'typecast':!![]});if(_0x2e6efe['length']){logger[_0xf4ab('0x5')](_0xf4ab('0x6'),_0x592623,_['map'](_0x2e6efe,_0xf4ab('0x7'))['join'](',\x20'));logger[_0xf4ab('0x8')](_0xf4ab('0x9'),_0x592623);_0x1f141a[_0xf4ab('0xa')]();}else{var _0x1dd0fa=this;var _0x3aef30=utils[_0xf4ab('0xb')](_0x4e42b0[0x0],this);logger[_0xf4ab('0x8')](_0xf4ab('0xc'),_0x592623,_0x3aef30);sh[_0xf4ab('0xd')](_[_0xf4ab('0xe')](_0x3aef30),function(_0x1df98f,_0x2d2e13){logger[_0xf4ab('0x8')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x592623,_0x1df98f);if(_0x1df98f==0x0){var _0x52ab9e=_0x2d2e13[_0xf4ab('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0xf4ab('0x10')](_0x4e42b0[0x1])||_[_0xf4ab('0x11')](_0x4e42b0[0x1])){logger[_0xf4ab('0x8')](_0xf4ab('0x12'),_0x592623);_0x1dd0fa[_0xf4ab('0x13')][_0x4e42b0[0x1]]=_0x52ab9e;}else{logger[_0xf4ab('0x8')](_0xf4ab('0x14'),_0x592623,_0x4e42b0[0x1],_0x52ab9e);_0x1dd0fa['body'][_0x4e42b0[0x1]]=_0x52ab9e;}}_0x1f141a[_0xf4ab('0xa')]();});}}catch(_0x1c5202){logger[_0xf4ab('0x5')]('[%s][SYSTEM]\x20%s',_0x592623,_[_0xf4ab('0x15')](_0x1c5202)?JSON[_0xf4ab('0x16')](_0x1c5202):_0x1c5202);logger['info'](_0xf4ab('0x9'),_0x592623);_0x1f141a[_0xf4ab('0xa')]();}};}; \ 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 d1f89e8..32b1c0d 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 _0x72a2=['[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','[%s][TAG]\x20%s','stringify','isObject','validate','lodash','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','then'];(function(_0x2bf22a,_0x2fa43e){var _0xa8859e=function(_0x470c18){while(--_0x470c18){_0x2bf22a['push'](_0x2bf22a['shift']());}};_0xa8859e(++_0x2fa43e);}(_0x72a2,0xd6));var _0x272a=function(_0x38fe9f,_0x56d24b){_0x38fe9f=_0x38fe9f-0x0;var _0x5c05b4=_0x72a2[_0x38fe9f];return _0x5c05b4;};'use strict';var schema=require(_0x272a('0x0'));var _=require(_0x272a('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x272a('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x272a('0x3')),'whatsappInteraction':require(_0x272a('0x4'))};var logger=require(_0x272a('0x5'))(_0x272a('0x6'));var tag=schema({'tag':{'type':_0x272a('0x7'),'required':!![],'message':_0x272a('0x8')}});exports[_0x272a('0x9')]=function(_0x4f275f,_0xf0f3b7,_0x152cf6,_0x1f4cfc){return function(_0x21ce48){try{var _0x313cc7={'tag':_0xf0f3b7[0x0]};var _0x2030aa=tag[_0x272a('0x0')](_0x313cc7,{'typecast':!![]});if(_0x2030aa['length']){logger[_0x272a('0xa')]('[%s][TAG]\x20%s',_0x4f275f,_[_0x272a('0xb')](_0x2030aa,_0x272a('0xc'))[_0x272a('0xd')](',\x20'));logger[_0x272a('0xe')](_0x272a('0xf'),_0x4f275f);_0x21ce48[_0x272a('0x10')]();}else{var _0x77b0a2={'ids':[_0xf0f3b7[0x0]]};if(rpc[_0x1f4cfc[_0x272a('0x11')]+'Interaction']){rpc[_0x1f4cfc['channel']+_0x272a('0x12')]['addTags'](_0x1f4cfc['interaction']['id'],_0x77b0a2)[_0x272a('0x13')](function(_0x453ce2){logger[_0x272a('0xe')](_0x272a('0x14'),_0x4f275f,_0xf0f3b7[0x1],_0x1f4cfc[_0x272a('0x11')],_0x1f4cfc[_0x272a('0x15')]['id']);})[_0x272a('0x16')](function(_0x428dff){logger[_0x272a('0xa')](_0x272a('0x17'),_0x4f275f,JSON[_0x272a('0x18')](_0x428dff));logger['info'](_0x272a('0xf'),_0x4f275f);})['finally'](function(){_0x21ce48['next']();});}}}catch(_0x352fcf){logger['error'](_0x272a('0x17'),_0x4f275f,_[_0x272a('0x19')](_0x352fcf)?JSON[_0x272a('0x18')](_0x352fcf):_0x352fcf);logger[_0x272a('0xe')](_0x272a('0xf'),_0x4f275f);_0x21ce48[_0x272a('0x10')]();}};}; \ No newline at end of file +var _0x2425=['[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','consequence','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','info'];(function(_0x4d7dc9,_0x207e3f){var _0x50b1e8=function(_0x2129dd){while(--_0x2129dd){_0x4d7dc9['push'](_0x4d7dc9['shift']());}};_0x50b1e8(++_0x207e3f);}(_0x2425,0x1c4));var _0x5242=function(_0x220ee2,_0x2ca750){_0x220ee2=_0x220ee2-0x0;var _0x2c1784=_0x2425[_0x220ee2];return _0x2c1784;};'use strict';var schema=require('validate');var _=require(_0x5242('0x0'));var rpc={'chatInteraction':require(_0x5242('0x1')),'openchannelInteraction':require(_0x5242('0x2')),'smsInteraction':require(_0x5242('0x3')),'mailInteraction':require(_0x5242('0x4')),'faxInteraction':require(_0x5242('0x5')),'whatsappInteraction':require(_0x5242('0x6'))};var logger=require(_0x5242('0x7'))(_0x5242('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x5242('0x9')]=function(_0x1a4e88,_0x45a1f4,_0x52141f,_0x369c7b){return function(_0x1a7947){try{var _0x505edb={'tag':_0x45a1f4[0x0]};var _0x1ba4f9=tag['validate'](_0x505edb,{'typecast':!![]});if(_0x1ba4f9[_0x5242('0xa')]){logger[_0x5242('0xb')](_0x5242('0xc'),_0x1a4e88,_[_0x5242('0xd')](_0x1ba4f9,_0x5242('0xe'))[_0x5242('0xf')](',\x20'));logger['info'](_0x5242('0x10'),_0x1a4e88);_0x1a7947[_0x5242('0x11')]();}else{var _0x8e4719={'ids':[_0x45a1f4[0x0]]};if(rpc[_0x369c7b[_0x5242('0x12')]+_0x5242('0x13')]){rpc[_0x369c7b[_0x5242('0x12')]+'Interaction'][_0x5242('0x14')](_0x369c7b[_0x5242('0x15')]['id'],_0x8e4719)[_0x5242('0x16')](function(_0x73f9d0){logger[_0x5242('0x17')](_0x5242('0x18'),_0x1a4e88,_0x45a1f4[0x1],_0x369c7b[_0x5242('0x12')],_0x369c7b[_0x5242('0x15')]['id']);})[_0x5242('0x19')](function(_0x5d40fe){logger[_0x5242('0xb')](_0x5242('0xc'),_0x1a4e88,JSON['stringify'](_0x5d40fe));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1a4e88);})[_0x5242('0x1a')](function(){_0x1a7947[_0x5242('0x11')]();});}}}catch(_0x2d8866){logger['error'](_0x5242('0xc'),_0x1a4e88,_[_0x5242('0x1b')](_0x2d8866)?JSON['stringify'](_0x2d8866):_0x2d8866);logger['info'](_0x5242('0x10'),_0x1a4e88);_0x1a7947[_0x5242('0x11')]();}};}; \ 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 f6e35a7..00e0859 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 _0x3b23=['request-promise','../../../../config/logger','routing','lodash','consequence','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','2.0','method','stringify','utf8','POST','application/json-rpc','then','parse','logged','channelId=','&serviceId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x3b23,0x1ed));var _0x33b2=function(_0x223fd3,_0x28fb0a){_0x223fd3=_0x223fd3-0x0;var _0x5cf76e=_0x3b23[_0x223fd3];return _0x5cf76e;};'use strict';var rp=require(_0x33b2('0x0'));var logger=require(_0x33b2('0x1'))(_0x33b2('0x2'));var _=require(_0x33b2('0x3'));var arr=[];exports[_0x33b2('0x4')]=function(_0x9aa9fe,_0x406544){return function(_0x4c63ea){var _0x9564bd=_0x406544[0xa];var _0x251a8f=_0x406544[0xb];var _0x433391=_0x406544[0xc];var _0x36bc2a=_0x406544[0xd];var _0x5606b9=_0x406544[0xe];var _0x1fe0b0=_0x406544[0xf][_0x33b2('0x5')](/\n/g,'\x20-\x20');var _0x53d770=_0x406544[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x33b2('0x6')](_0x251a8f)){arr[_0x33b2('0x7')](_0x251a8f);var _0x438068=_0x406544[0x3];var _0x42258d=_0x406544[0x4];var _0xdf53a4=_0x406544[0x1];var _0x12e82f=_0x406544[0x0];var _0x3ccd81={};_0x3ccd81[_0x33b2('0x8')]=_0x406544[0x8]+_0x33b2('0x9')+_0x433391+'|'+_0x9564bd+'|'+_0x36bc2a+'|'+_0x251a8f+'|'+_0x5606b9;_0x3ccd81[_0x33b2('0xa')]=_0x406544[0x7]+_0x33b2('0x9')+_0x433391+'|'+_0x9564bd+'|'+_0x36bc2a+'|'+_0x251a8f+'|'+_0x5606b9+'|'+_0x1fe0b0+'|'+_0x53d770;_0x3ccd81[_0x33b2('0xb')]=_0x406544[0x9];var _0x16ab3c={};_0x16ab3c['jsonrpc']=_0x33b2('0xc');_0x16ab3c[_0x33b2('0xd')]='login';var _0x19a762=[];_0x19a762[_0x33b2('0x7')](_0x406544[0x2]);_0x19a762[_0x33b2('0x7')](_0x406544[0x5]);_0x19a762[_0x33b2('0x7')](_0x406544[0x6]);_0x16ab3c['params']=_0x19a762;_0x16ab3c['id']=0x1;var _0x307929=JSON[_0x33b2('0xe')](_0x16ab3c);var _0x3f40b6={'encoding':_0x33b2('0xf'),'method':_0x33b2('0x10'),'timeout':0x2710,'url':_0x438068,'headers':{'Content-Type':_0x33b2('0x11')},'body':_0x307929};return rp(_0x3f40b6)[_0x33b2('0x12')](function(_0x22a74a){const _0x38a3c0=JSON[_0x33b2('0x13')](_0x22a74a);if(!_0x38a3c0['result'][_0x33b2('0x14')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x113217=_0x251a8f;var _0x4a6f23=_0x33b2('0x15')+_0xdf53a4+_0x33b2('0x16')+_0x12e82f+'&sessionId='+_0x113217+_0x33b2('0x17')+JSON[_0x33b2('0xe')](_0x3ccd81);var _0x1cc72d=_0x42258d+'?'+_0x4a6f23;return rp(_0x1cc72d);})[_0x33b2('0x12')](function(_0x55bcf8){logger[_0x33b2('0x18')](_0x33b2('0x19'),_0x9aa9fe,_0x55bcf8);_0x4c63ea[_0x33b2('0x1a')]();})['catch'](function(_0x1a88cb){logger['error']('[%s][TVOX]\x20%s',_0x9aa9fe,_[_0x33b2('0x1b')](_0x1a88cb)?JSON[_0x33b2('0xe')](_0x1a88cb):_0x1a88cb);_0x4c63ea[_0x33b2('0x1a')]();});}else{logger['info'](_0x33b2('0x1c'),_0x9aa9fe);_0x4c63ea['next']();}};}; \ No newline at end of file +var _0x6f77=['includes','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','2.0','method','login','push','stringify','utf8','application/json-rpc','then','parse','result','logged','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6f77,0x13d));var _0x76f7=function(_0x59197b,_0x35ec49){_0x59197b=_0x59197b-0x0;var _0x2c5edf=_0x6f77[_0x59197b];return _0x2c5edf;};'use strict';var rp=require(_0x76f7('0x0'));var logger=require(_0x76f7('0x1'))(_0x76f7('0x2'));var _=require(_0x76f7('0x3'));var arr=[];exports[_0x76f7('0x4')]=function(_0x521eb0,_0x3fbf96){return function(_0x2c4a2e){var _0x44b1db=_0x3fbf96[0xa];var _0x4d3972=_0x3fbf96[0xb];var _0x4181eb=_0x3fbf96[0xc];var _0x280552=_0x3fbf96[0xd];var _0x9f15cf=_0x3fbf96[0xe];var _0x35314d=_0x3fbf96[0xf][_0x76f7('0x5')](/\n/g,_0x76f7('0x6'));var _0x8be783=_0x3fbf96[0x10][_0x76f7('0x5')](/\n/g,'\x20');if(!arr[_0x76f7('0x7')](_0x4d3972)){arr['push'](_0x4d3972);var _0x5a23a8=_0x3fbf96[0x3];var _0x2de587=_0x3fbf96[0x4];var _0x2f22ef=_0x3fbf96[0x1];var _0x299208=_0x3fbf96[0x0];var _0x31a4e3={};_0x31a4e3[_0x76f7('0x8')]=_0x3fbf96[0x8]+'?params='+_0x4181eb+'|'+_0x44b1db+'|'+_0x280552+'|'+_0x4d3972+'|'+_0x9f15cf;_0x31a4e3[_0x76f7('0x9')]=_0x3fbf96[0x7]+_0x76f7('0xa')+_0x4181eb+'|'+_0x44b1db+'|'+_0x280552+'|'+_0x4d3972+'|'+_0x9f15cf+'|'+_0x35314d+'|'+_0x8be783;_0x31a4e3[_0x76f7('0xb')]=_0x3fbf96[0x9];var _0x4e90ad={};_0x4e90ad[_0x76f7('0xc')]=_0x76f7('0xd');_0x4e90ad[_0x76f7('0xe')]=_0x76f7('0xf');var _0x40269d=[];_0x40269d[_0x76f7('0x10')](_0x3fbf96[0x2]);_0x40269d[_0x76f7('0x10')](_0x3fbf96[0x5]);_0x40269d[_0x76f7('0x10')](_0x3fbf96[0x6]);_0x4e90ad['params']=_0x40269d;_0x4e90ad['id']=0x1;var _0x57d977=JSON[_0x76f7('0x11')](_0x4e90ad);var _0x3a5b93={'encoding':_0x76f7('0x12'),'method':'POST','timeout':0x2710,'url':_0x5a23a8,'headers':{'Content-Type':_0x76f7('0x13')},'body':_0x57d977};return rp(_0x3a5b93)[_0x76f7('0x14')](function(_0x937c99){const _0x23fd1c=JSON[_0x76f7('0x15')](_0x937c99);if(!_0x23fd1c[_0x76f7('0x16')][_0x76f7('0x17')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x430ee9=_0x4d3972;var _0x393b3a=_0x76f7('0x18')+_0x2f22ef+_0x76f7('0x19')+_0x299208+_0x76f7('0x1a')+_0x430ee9+_0x76f7('0x1b')+JSON[_0x76f7('0x11')](_0x31a4e3);var _0x55cc1f=_0x2de587+'?'+_0x393b3a;return rp(_0x55cc1f);})[_0x76f7('0x14')](function(_0x5d7fbe){logger[_0x76f7('0x1c')](_0x76f7('0x1d'),_0x521eb0,_0x5d7fbe);_0x2c4a2e[_0x76f7('0x1e')]();})[_0x76f7('0x1f')](function(_0x22a78f){logger['error'](_0x76f7('0x20'),_0x521eb0,_[_0x76f7('0x21')](_0x22a78f)?JSON[_0x76f7('0x11')](_0x22a78f):_0x22a78f);_0x2c4a2e[_0x76f7('0x1e')]();});}else{logger[_0x76f7('0x1c')](_0x76f7('0x22'),_0x521eb0);_0x2c4a2e[_0x76f7('0x23')]();}};}; \ 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 9279d47..b65ba39 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 _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x521749,_0x2c03dc){var _0x4fa9a3=function(_0x285cf){while(--_0x285cf){_0x521749['push'](_0x521749['shift']());}};_0x4fa9a3(++_0x2c03dc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file +var _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x20cc8a,_0x397b24){var _0x423432=function(_0x3f69cb){while(--_0x3f69cb){_0x20cc8a['push'](_0x20cc8a['shift']());}};_0x423432(++_0x397b24);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 115ee4e..9c4e747 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 _0xd845=['available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','uuid','./applications/utils','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','IntervalId','isNil','map','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','appdata','mail','push','slice','split','dialogflowv2','tag','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','body','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','end','QueueReport','update','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues'];(function(_0x3b988c,_0x162c2a){var _0x44cf1d=function(_0x3e8eb6){while(--_0x3e8eb6){_0x3b988c['push'](_0x3b988c['shift']());}};_0x44cf1d(++_0x162c2a);}(_0xd845,0x135));var _0x5d84=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xd845[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x5d84('0x0'));var util=require(_0x5d84('0x1'));var path=require(_0x5d84('0x2'));var fs=require('fs');var jayson=require(_0x5d84('0x3'));var BPromise=require('bluebird');var uuid=require(_0x5d84('0x4'));var utils=require(_0x5d84('0x5'));var config=require(_0x5d84('0x6'));var logger=require(_0x5d84('0x7'))('routing');var rpc={'openchannelQueueReport':require(_0x5d84('0x8')),'mailQueueReport':require(_0x5d84('0x9')),'chatQueueReport':require(_0x5d84('0xa')),'smsQueueReport':require(_0x5d84('0xb')),'faxQueueReport':require(_0x5d84('0xc')),'whatsappQueueReport':require(_0x5d84('0xd'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x135c45,_0x493231,_0x8958eb){return util[_0x5d84('0xe')]('%s.%s.%s',_0x135c45,_0x493231||0x0,_0x8958eb||0x0);}function getIntervals(_0x13dfc9,_0x2cf40d){var _0x5a377b=[];if(!_['isNil'](_0x2cf40d[_0x5d84('0xf')])&&!_[_0x5d84('0x10')](_0x13dfc9[_0x2cf40d[_0x5d84('0xf')]])&&!_[_0x5d84('0x10')](_0x13dfc9[_0x2cf40d[_0x5d84('0xf')]]['Intervals'])){_0x5a377b=_[_0x5d84('0x11')](_0x13dfc9[_0x2cf40d[_0x5d84('0xf')]][_0x5d84('0x12')],_0x5d84('0x13'));}else if(!_[_0x5d84('0x10')](_0x2cf40d[_0x5d84('0x13')])){_0x5a377b=[_0x2cf40d['interval']];}return _0x5a377b;}exports[_0x5d84('0x14')]=function(_0x56aa9c){_0x56aa9c[_0x5d84('0x15')]={};return new BPromise(function(_0x2b6ca3,_0x2d1325){var _0x47c2bb={'Start':function(_0x25e6b5){var _0x153244=this;return new Promise(function(_0x206c31,_0x3a73ed){if(_0x25e6b5){try{var _0x474937=[];var _0x4c4dc6=getId(_0x25e6b5[_0x5d84('0x16')],_0x25e6b5['message']?_0x25e6b5[_0x5d84('0x17')]['id']:0x0,_0x25e6b5['interaction']?_0x25e6b5[_0x5d84('0x18')]['id']:0x0);if(_0x25e6b5[_0x5d84('0x19')]&&_[_0x5d84('0x1a')](_0x25e6b5[_0x5d84('0x19')])&&_0x25e6b5[_0x5d84('0x19')][_0x5d84('0x1b')]){for(var _0x4a6b43=0x0;_0x4a6b43<_0x25e6b5['applications']['length'];_0x4a6b43+=0x1){var _0x4e1247=_0x25e6b5[_0x5d84('0x19')][_0x4a6b43];if(fs[_0x5d84('0x1c')](path[_0x5d84('0x1d')](__dirname,_0x5d84('0x19'),_0x4e1247[_0x5d84('0x1e')]+_0x5d84('0x1f')))){var _0xcd46ce=[];switch(_0x4e1247['app']['toLowerCase']()){case'autoreply':var _0x5a08c9=_0x4e1247[_0x5d84('0x20')]['split'](',');if(_0x25e6b5[_0x5d84('0x16')]===_0x5d84('0x21')){_0xcd46ce[_0x5d84('0x22')](_0x5a08c9[0x0]);_0xcd46ce[_0x5d84('0x22')](_0x5a08c9[0x1]);_0xcd46ce[_0x5d84('0x22')](_0x5a08c9['slice'](0x2,_0x5a08c9[_0x5d84('0x1b')])[_0x5d84('0x1d')](','));}else{_0xcd46ce['push'](_0x5a08c9[0x0]);_0xcd46ce[_0x5d84('0x22')](_0x5a08c9[_0x5d84('0x23')](0x1,_0x5a08c9['length'])[_0x5d84('0x1d')](','));}break;case'dialogflow':var _0x290cce=_0x4e1247[_0x5d84('0x20')][_0x5d84('0x24')](',');_0xcd46ce['push'](_0x290cce[0x0]);_0xcd46ce[_0x5d84('0x22')](_0x290cce[0x1]);_0xcd46ce[_0x5d84('0x22')](_0x290cce[_0x5d84('0x23')](0x2,_0x290cce[_0x5d84('0x1b')])['join'](','));break;case _0x5d84('0x25'):var _0x1a533e=_0x4e1247[_0x5d84('0x20')]['split'](',');_0xcd46ce[_0x5d84('0x22')](_0x1a533e[0x0]);_0xcd46ce['push'](_0x1a533e[0x1]);_0xcd46ce[_0x5d84('0x22')](_0x1a533e[0x2]);_0xcd46ce['push'](_0x1a533e[0x3]);_0xcd46ce[_0x5d84('0x22')](_0x1a533e[_0x5d84('0x23')](0x4,_0x1a533e[_0x5d84('0x1b')])[_0x5d84('0x1d')](','));break;case'amazonlex':var _0x805a12=_0x4e1247[_0x5d84('0x20')][_0x5d84('0x24')](',');_0xcd46ce[_0x5d84('0x22')](_0x805a12[0x0]);_0xcd46ce[_0x5d84('0x22')](_0x805a12[0x1]);_0xcd46ce[_0x5d84('0x22')](_0x805a12[0x2]);_0xcd46ce[_0x5d84('0x22')](_0x805a12[0x3]);_0xcd46ce[_0x5d84('0x22')](_0x805a12[_0x5d84('0x23')](0x4,_0x805a12[_0x5d84('0x1b')])[_0x5d84('0x1d')](','));break;case _0x5d84('0x17'):_0xcd46ce[_0x5d84('0x22')](_0x4e1247['appdata']);break;case _0x5d84('0x26'):_0xcd46ce[_0x5d84('0x22')](_0x4e1247['TagId']);_0xcd46ce[_0x5d84('0x22')](_0x4e1247['appdata']);break;case _0x5d84('0x27'):var _0x385060=utils[_0x5d84('0x28')](_0x25e6b5[_0x5d84('0x29')][_0x5d84('0x2a')],_0x25e6b5);var _0x304966=_0x4e1247[_0x5d84('0x20')][_0x5d84('0x24')](',');_0xcd46ce[_0x5d84('0x22')](_0x304966[0x0]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x1]);_0xcd46ce['push'](_0x304966[0x2]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x3]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x4]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x5]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x6]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x7]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x8]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x9]);_0xcd46ce['push'](_0x304966[0xa]);_0xcd46ce['push'](_0x25e6b5[_0x5d84('0x18')]['id']);_0xcd46ce[_0x5d84('0x22')](_0x25e6b5[_0x5d84('0x17')]['id']);_0xcd46ce[_0x5d84('0x22')](_0x4e1247[_0x5d84('0x2b')]);_0xcd46ce[_0x5d84('0x22')](_0x25e6b5[_0x5d84('0x18')]['ContactId']);_0xcd46ce['push'](_0x25e6b5[_0x5d84('0x2c')]['body']);_0xcd46ce[_0x5d84('0x22')](_0x385060);break;default:_0xcd46ce=_[_0x5d84('0x10')](_0x4e1247[_0x5d84('0x20')])?[]:_0x4e1247[_0x5d84('0x20')]['split'](',');}var _0x3e6be8={'id':util[_0x5d84('0xe')]('%s:%s:%s',_0x4c4dc6,_0x4e1247['id'],_0x4e1247[_0x5d84('0x1e')]),'condition':require(_0x5d84('0x2d'))[_0x5d84('0x2e')](_0x4c4dc6,getIntervals(_0x56aa9c[_0x5d84('0x2f')],_0x4e1247),_0x56aa9c),'consequence':require(_0x5d84('0x30')+_0x4e1247[_0x5d84('0x1e')])[_0x5d84('0x31')](_0x4c4dc6,_0xcd46ce,_0x56aa9c,_0x25e6b5),'p':_0x4e1247[_0x5d84('0x32')]||0x0};logger[_0x5d84('0x33')](_0x5d84('0x34'),_0x3e6be8['id'],_0x5d84('0x35'),getIntervals(_0x56aa9c[_0x5d84('0x2f')],_0x4e1247)[_0x5d84('0x1d')](_0x5d84('0x36')));_0x474937[_0x5d84('0x22')](_0x3e6be8);}else{logger[_0x5d84('0x37')](_0x5d84('0x38'),path[_0x5d84('0x1d')](__dirname,_0x5d84('0x19'),_0x4e1247[_0x5d84('0x1e')]+'.js'));}}_0x56aa9c['rules'][_0x4c4dc6]=new RuleEngine(_0x474937);_0x56aa9c[_0x5d84('0x15')][_0x4c4dc6]['execute'](_0x25e6b5,function(_0x5223a2){logger[_0x5d84('0x33')]('Applications\x20executed',JSON[_0x5d84('0x39')](_0x5223a2[_0x5d84('0x3a')]));if(_0x56aa9c['rules'][_0x4c4dc6]){_0x56aa9c[_0x5d84('0x15')][_0x4c4dc6][_0x5d84('0x3b')](_0x5d84('0x3c'));}});return _0x206c31({'code':0xc8,'message':_0x25e6b5});}else{logger['info'](_0x5d84('0x3d'));return _0x206c31({'code':0xc8,'message':_0x25e6b5});}}catch(_0x5aaf63){logger[_0x5d84('0x37')](_0x5aaf63[_0x5d84('0x3e')]);return _0x3a73ed(_0x153244[_0x5d84('0x37')](0x1f4,_0x5aaf63));}}return _0x3a73ed('routing\x20is\x20empty');});},'AcceptMessage':function(_0x1114ac){var _0x3f2044=this;return new Promise(function(_0x403bf4,_0x47743d){if(_0x1114ac[_0x5d84('0x3f')]&&_0x1114ac['agent']['id']){if(_0x56aa9c[_0x5d84('0x40')][_0x1114ac[_0x5d84('0x3f')]['id']]){_0x56aa9c[_0x5d84('0x40')][_0x1114ac[_0x5d84('0x3f')]['id']][_0x5d84('0x41')]=![];_0x56aa9c[_0x5d84('0x40')][_0x1114ac[_0x5d84('0x3f')]['id']]['busyQueue']=undefined;}}if(_0x1114ac[_0x5d84('0x17')]&&_0x1114ac[_0x5d84('0x17')]['id']){try{var _0x125d95=getId(_0x1114ac[_0x5d84('0x16')],_0x1114ac[_0x5d84('0x17')]?_0x1114ac['message']['id']:0x0,_0x1114ac['interaction']?_0x1114ac[_0x5d84('0x18')]['id']:0x0);if(_0x56aa9c[_0x5d84('0x15')][_0x125d95]){_0x56aa9c[_0x5d84('0x15')][_0x125d95][_0x5d84('0x3b')](_0x5d84('0x42'));if(rpc[_0x1114ac[_0x5d84('0x16')]+'QueueReport']){rpc[_0x1114ac[_0x5d84('0x16')]+_0x5d84('0x43')][_0x5d84('0x44')](_0x125d95,{'UserId':_0x1114ac[_0x5d84('0x17')]['UserId']})['catch'](function(_0x2f900c){logger[_0x5d84('0x37')](_0x5d84('0x45'));});}}return _0x403bf4({'code':0xc8,'message':_0x1114ac});}catch(_0x1df997){logger[_0x5d84('0x37')](_0x1df997[_0x5d84('0x3e')]);return _0x47743d(_0x3f2044[_0x5d84('0x37')](0x1f4,_0x1df997));}}logger[_0x5d84('0x37')](_0x5d84('0x46'));return _0x47743d(_0x3f2044[_0x5d84('0x37')](0x1f4,_0x5d84('0x46')));});},'RejectMessage':function(_0x111cd6){var _0xc528f2=this;return new Promise(function(_0x41257c,_0x3c99fc){if(_0x111cd6[_0x5d84('0x3f')]&&_0x111cd6['agent']['id']){try{if(_0x56aa9c['agents'][_0x111cd6[_0x5d84('0x3f')]['id']]){_0x56aa9c[_0x5d84('0x40')][_0x111cd6[_0x5d84('0x3f')]['id']]['busy']=![];_0x56aa9c[_0x5d84('0x40')][_0x111cd6['agent']['id']][_0x5d84('0x47')]=undefined;}return _0x41257c({'code':0xc8,'message':_0x111cd6});}catch(_0x4547d4){logger[_0x5d84('0x37')](_0x4547d4[_0x5d84('0x3e')]);return _0x3c99fc(_0xc528f2[_0x5d84('0x37')](0x1f4,_0x4547d4));}}logger['error'](_0x5d84('0x46'));return _0x3c99fc(_0xc528f2[_0x5d84('0x37')](0x1f4,_0x5d84('0x46')));});},'AbandonInteraction':function(_0x1cc197){var _0x36247e=this;return new Promise(function(_0x578ad2,_0x229af9){if(_0x1cc197[_0x5d84('0x16')]&&_0x1cc197['interaction']&&_0x1cc197['interaction']['id']){try{var _0x11bf89=getId(_0x1cc197[_0x5d84('0x16')],_0x1cc197[_0x5d84('0x17')]?_0x1cc197['message']['id']:0x0,_0x1cc197[_0x5d84('0x18')]?_0x1cc197['interaction']['id']:0x0);if(_0x56aa9c[_0x5d84('0x15')][_0x11bf89]){_0x56aa9c[_0x5d84('0x15')][_0x11bf89]['emit'](_0x5d84('0x42'));}return _0x578ad2({'code':0xc8,'message':_0x1cc197});}catch(_0x4f6314){logger[_0x5d84('0x37')](_0x4f6314['stack']);return _0x229af9(_0x36247e[_0x5d84('0x37')](0x1f4,_0x4f6314));}}logger[_0x5d84('0x37')](_0x5d84('0x46'));return _0x229af9(_0x36247e[_0x5d84('0x37')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x384f73){var _0x141322=this;return new Promise(function(_0x17817d,_0x2abc72){if(_0x56aa9c[_0x5d84('0x40')]['hasOwnProperty'](_0x384f73['id'])){for(var _0x885b11 in _0x384f73[_0x5d84('0x48')]){if(_0x384f73[_0x5d84('0x48')][_0x5d84('0x49')](_0x885b11)){if(_0x56aa9c[_0x5d84('0x40')][_0x384f73['id']][_0x5d84('0x49')](_0x885b11+_0x5d84('0x4a'))){_0x56aa9c[_0x5d84('0x40')][_0x384f73['id']][_0x885b11+_0x5d84('0x4a')]=parseInt(_0x384f73[_0x5d84('0x48')][_0x885b11],0xa);}}}_0x56aa9c['agents'][_0x384f73['id']][_0x5d84('0x4b')]();return _0x17817d({'code':0xc8,'message':_0x56aa9c[_0x5d84('0x40')][_0x384f73['id']]});}else{return _0x2abc72(_0x141322['error'](0x1f4,_0x5d84('0x4c')));}});},'Agents':function(_0x2cb0c4){return new Promise(function(_0x20d4f9,_0x3a1b40){var _0xed003d=_[_0x5d84('0x4d')](_0x56aa9c[_0x5d84('0x40')]);_0x20d4f9({'count':_0xed003d[_0x5d84('0x1b')],'rows':_0xed003d});});},'ChatQueues':function(_0x476361){return new Promise(function(_0x50d80a,_0x37851){var _0x3b4f40=[];for(var _0x10ea4b in _0x56aa9c[_0x5d84('0x4e')]){if(_0x56aa9c[_0x5d84('0x4e')]['hasOwnProperty'](_0x10ea4b)){var _0x4b945c=_0x56aa9c['chatQueues'][_0x10ea4b];var _0x1a2cd4={'id':_0x4b945c['id'],'available':_0x4b945c[_0x5d84('0x4f')],'loggedIn':_0x4b945c[_0x5d84('0x50')],'name':_0x4b945c[_0x5d84('0x51')],'paused':_0x4b945c[_0x5d84('0x52')],'waiting':_0x4b945c[_0x5d84('0x53')]};_0x3b4f40[_0x5d84('0x22')](_0x1a2cd4);}}_0x50d80a({'count':_0x3b4f40[_0x5d84('0x1b')],'rows':_0x3b4f40});});},'MailQueues':function(_0x342301){return new Promise(function(_0x2ca687,_0x24e31a){var _0x3b12d2=[];for(var _0x52a10e in _0x56aa9c[_0x5d84('0x54')]){if(_0x56aa9c['mailQueues']['hasOwnProperty'](_0x52a10e)){var _0x104575=_0x56aa9c[_0x5d84('0x54')][_0x52a10e];var _0x535c88={'id':_0x104575['id'],'available':_0x104575[_0x5d84('0x4f')],'loggedIn':_0x104575[_0x5d84('0x50')],'name':_0x104575[_0x5d84('0x51')],'paused':_0x104575['paused'],'waiting':_0x104575['waiting']};_0x3b12d2[_0x5d84('0x22')](_0x535c88);}}_0x2ca687({'count':_0x3b12d2['length'],'rows':_0x3b12d2});});},'OpenchannelQueues':function(_0x929b49){return new Promise(function(_0x231b8c,_0x5610cd){var _0x75420e=[];for(var _0x3a4a5 in _0x56aa9c['openchannelQueues']){if(_0x56aa9c[_0x5d84('0x55')][_0x5d84('0x49')](_0x3a4a5)){var _0x437c56=_0x56aa9c['openchannelQueues'][_0x3a4a5];var _0x3a4df0={'id':_0x437c56['id'],'available':_0x437c56[_0x5d84('0x4f')],'loggedIn':_0x437c56['loggedIn'],'name':_0x437c56[_0x5d84('0x51')],'paused':_0x437c56[_0x5d84('0x52')],'waiting':_0x437c56[_0x5d84('0x53')]};_0x75420e[_0x5d84('0x22')](_0x3a4df0);}}_0x231b8c({'count':_0x75420e[_0x5d84('0x1b')],'rows':_0x75420e});});},'SmsQueues':function(_0x1c2887){return new Promise(function(_0x48378c,_0x562f75){var _0x47e8ac=[];for(var _0x1a89a4 in _0x56aa9c[_0x5d84('0x56')]){if(_0x56aa9c['smsQueues'][_0x5d84('0x49')](_0x1a89a4)){var _0x5af93c=_0x56aa9c[_0x5d84('0x56')][_0x1a89a4];var _0x2fa97f={'id':_0x5af93c['id'],'available':_0x5af93c[_0x5d84('0x4f')],'loggedIn':_0x5af93c[_0x5d84('0x50')],'name':_0x5af93c['name'],'paused':_0x5af93c[_0x5d84('0x52')],'waiting':_0x5af93c[_0x5d84('0x53')]};_0x47e8ac[_0x5d84('0x22')](_0x2fa97f);}}_0x48378c({'count':_0x47e8ac[_0x5d84('0x1b')],'rows':_0x47e8ac});});},'FaxQueues':function(_0x587e11){return new Promise(function(_0x2a96c3,_0x598a10){var _0x4e4b67=[];for(var _0x334463 in _0x56aa9c[_0x5d84('0x57')]){if(_0x56aa9c[_0x5d84('0x57')][_0x5d84('0x49')](_0x334463)){var _0x320668=_0x56aa9c[_0x5d84('0x57')][_0x334463];var _0x38752f={'id':_0x320668['id'],'available':_0x320668['available'],'loggedIn':_0x320668[_0x5d84('0x50')],'name':_0x320668[_0x5d84('0x51')],'paused':_0x320668['paused'],'waiting':_0x320668[_0x5d84('0x53')]};_0x4e4b67[_0x5d84('0x22')](_0x38752f);}}_0x2a96c3({'count':_0x4e4b67['length'],'rows':_0x4e4b67});});},'WhatsappQueues':function(_0x4f21d3){return new Promise(function(_0xf6b8cf,_0x3e1b7a){var _0x1eea3b=[];for(var _0x305068 in _0x56aa9c['whatsappQueues']){if(_0x56aa9c[_0x5d84('0x58')][_0x5d84('0x49')](_0x305068)){var _0x1ec85a=_0x56aa9c[_0x5d84('0x58')][_0x305068];var _0x1f24e1={'id':_0x1ec85a['id'],'available':_0x1ec85a[_0x5d84('0x4f')],'loggedIn':_0x1ec85a[_0x5d84('0x50')],'name':_0x1ec85a[_0x5d84('0x51')],'paused':_0x1ec85a[_0x5d84('0x52')],'waiting':_0x1ec85a[_0x5d84('0x53')]};_0x1eea3b[_0x5d84('0x22')](_0x1f24e1);}}_0xf6b8cf({'count':_0x1eea3b[_0x5d84('0x1b')],'rows':_0x1eea3b});});},'ChatQueuesWaitingInteractions':function(_0xd4586b){return new Promise(function(_0x39c70b,_0x415ee0){var _0x34c034=_[_0x5d84('0x4d')](_0x56aa9c[_0x5d84('0x59')]);_0x39c70b({'count':_0x34c034['length'],'rows':_0x34c034});});},'MailQueuesWaitingInteractions':function(_0x225cb7){return new Promise(function(_0x1d41d2,_0x254231){var _0x19a59b=_[_0x5d84('0x4d')](_0x56aa9c[_0x5d84('0x5a')]);_0x1d41d2({'count':_0x19a59b[_0x5d84('0x1b')],'rows':_0x19a59b});});},'OpenchannelQueuesWaitingInteractions':function(_0x28fd0b){return new Promise(function(_0x29996e,_0x4d56a7){var _0x324739=_[_0x5d84('0x4d')](_0x56aa9c[_0x5d84('0x5b')]);_0x29996e({'count':_0x324739[_0x5d84('0x1b')],'rows':_0x324739});});},'SmsQueuesWaitingInteractions':function(_0x12a48d){return new Promise(function(_0x21e907,_0x53368f){var _0x29294f=_[_0x5d84('0x4d')](_0x56aa9c['smsQueuesWaitingInteractions']);_0x21e907({'count':_0x29294f[_0x5d84('0x1b')],'rows':_0x29294f});});},'FaxQueuesWaitingInteractions':function(_0x344aab){return new Promise(function(_0x47646c,_0x43ad34){var _0x5ecd12=_['values'](_0x56aa9c[_0x5d84('0x5c')]);_0x47646c({'count':_0x5ecd12[_0x5d84('0x1b')],'rows':_0x5ecd12});});},'WhatsappQueuesWaitingInteractions':function(_0x1a7562){return new Promise(function(_0x1a8dd4,_0x3fcd63){var _0x5b7cb4=_['values'](_0x56aa9c[_0x5d84('0x5d')]);_0x1a8dd4({'count':_0x5b7cb4[_0x5d84('0x1b')],'rows':_0x5b7cb4});});}};var _0x3cf87e=jayson['server'](_0x47c2bb)['http']();_0x3cf87e['on'](_0x5d84('0x37'),function(_0x4189ec){logger['error'](JSON[_0x5d84('0x39')](_0x4189ec));return _0x2d1325(_0x4189ec);});_0x3cf87e[_0x5d84('0x14')](0x232c,_0x5d84('0x5e'),function(){console['log'](_0x5d84('0x5f'),0x232c);return _0x2b6ca3(_0x5d84('0x60')+0x232c);});});}; \ No newline at end of file +var _0xb332=['available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','whatsappQueues','mailQueuesWaitingInteractions','values','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','jayson/promise','uuid','../../../config/environment','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','channel','interaction','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','message','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','condition','intervals','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','stringify','matchPath','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','emit','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues'];(function(_0x542a07,_0x3db5d8){var _0x4ffb68=function(_0x2854da){while(--_0x2854da){_0x542a07['push'](_0x542a07['shift']());}};_0x4ffb68(++_0x3db5d8);}(_0xb332,0xd9));var _0x2b33=function(_0x4664db,_0x1de672){_0x4664db=_0x4664db-0x0;var _0x5615b4=_0xb332[_0x4664db];return _0x5615b4;};'use strict';var _=require(_0x2b33('0x0'));var util=require('util');var path=require(_0x2b33('0x1'));var fs=require('fs');var jayson=require(_0x2b33('0x2'));var BPromise=require('bluebird');var uuid=require(_0x2b33('0x3'));var utils=require('./applications/utils');var config=require(_0x2b33('0x4'));var logger=require('../../../config/logger')(_0x2b33('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x2b33('0x6')),'chatQueueReport':require(_0x2b33('0x7')),'smsQueueReport':require(_0x2b33('0x8')),'faxQueueReport':require(_0x2b33('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x4302b7,_0x5f29ab,_0xb3aeab){return util[_0x2b33('0xa')](_0x2b33('0xb'),_0x4302b7,_0x5f29ab||0x0,_0xb3aeab||0x0);}function getIntervals(_0x14b4d1,_0x5834bb){var _0x16f18=[];if(!_[_0x2b33('0xc')](_0x5834bb[_0x2b33('0xd')])&&!_[_0x2b33('0xc')](_0x14b4d1[_0x5834bb[_0x2b33('0xd')]])&&!_[_0x2b33('0xc')](_0x14b4d1[_0x5834bb[_0x2b33('0xd')]][_0x2b33('0xe')])){_0x16f18=_[_0x2b33('0xf')](_0x14b4d1[_0x5834bb[_0x2b33('0xd')]][_0x2b33('0xe')],'interval');}else if(!_[_0x2b33('0xc')](_0x5834bb[_0x2b33('0x10')])){_0x16f18=[_0x5834bb[_0x2b33('0x10')]];}return _0x16f18;}exports['listen']=function(_0x173c75){_0x173c75['rules']={};return new BPromise(function(_0x3fcf4e,_0x17292f){var _0x233cd9={'Start':function(_0x57aea7){var _0x52693f=this;return new Promise(function(_0x1d8e75,_0x1d50d0){if(_0x57aea7){try{var _0x409428=[];var _0x2f5119=getId(_0x57aea7[_0x2b33('0x11')],_0x57aea7['message']?_0x57aea7['message']['id']:0x0,_0x57aea7['interaction']?_0x57aea7[_0x2b33('0x12')]['id']:0x0);if(_0x57aea7['applications']&&_['isArray'](_0x57aea7[_0x2b33('0x13')])&&_0x57aea7[_0x2b33('0x13')][_0x2b33('0x14')]){for(var _0x539c5f=0x0;_0x539c5f<_0x57aea7[_0x2b33('0x13')]['length'];_0x539c5f+=0x1){var _0x8079c0=_0x57aea7[_0x2b33('0x13')][_0x539c5f];if(fs[_0x2b33('0x15')](path[_0x2b33('0x16')](__dirname,_0x2b33('0x13'),_0x8079c0[_0x2b33('0x17')]+_0x2b33('0x18')))){var _0x4fb725=[];switch(_0x8079c0[_0x2b33('0x17')][_0x2b33('0x19')]()){case _0x2b33('0x1a'):var _0x196f3a=_0x8079c0[_0x2b33('0x1b')][_0x2b33('0x1c')](',');if(_0x57aea7[_0x2b33('0x11')]===_0x2b33('0x1d')){_0x4fb725['push'](_0x196f3a[0x0]);_0x4fb725[_0x2b33('0x1e')](_0x196f3a[0x1]);_0x4fb725[_0x2b33('0x1e')](_0x196f3a[_0x2b33('0x1f')](0x2,_0x196f3a[_0x2b33('0x14')])['join'](','));}else{_0x4fb725[_0x2b33('0x1e')](_0x196f3a[0x0]);_0x4fb725['push'](_0x196f3a[_0x2b33('0x1f')](0x1,_0x196f3a['length'])[_0x2b33('0x16')](','));}break;case _0x2b33('0x20'):var _0x5d8d05=_0x8079c0[_0x2b33('0x1b')]['split'](',');_0x4fb725[_0x2b33('0x1e')](_0x5d8d05[0x0]);_0x4fb725['push'](_0x5d8d05[0x1]);_0x4fb725[_0x2b33('0x1e')](_0x5d8d05[_0x2b33('0x1f')](0x2,_0x5d8d05[_0x2b33('0x14')])[_0x2b33('0x16')](','));break;case _0x2b33('0x21'):var _0x312d4d=_0x8079c0[_0x2b33('0x1b')][_0x2b33('0x1c')](',');_0x4fb725[_0x2b33('0x1e')](_0x312d4d[0x0]);_0x4fb725[_0x2b33('0x1e')](_0x312d4d[0x1]);_0x4fb725['push'](_0x312d4d[0x2]);_0x4fb725['push'](_0x312d4d[0x3]);_0x4fb725[_0x2b33('0x1e')](_0x312d4d[_0x2b33('0x1f')](0x4,_0x312d4d[_0x2b33('0x14')])[_0x2b33('0x16')](','));break;case _0x2b33('0x22'):var _0x5893bc=_0x8079c0['appdata'][_0x2b33('0x1c')](',');_0x4fb725[_0x2b33('0x1e')](_0x5893bc[0x0]);_0x4fb725[_0x2b33('0x1e')](_0x5893bc[0x1]);_0x4fb725[_0x2b33('0x1e')](_0x5893bc[0x2]);_0x4fb725[_0x2b33('0x1e')](_0x5893bc[0x3]);_0x4fb725[_0x2b33('0x1e')](_0x5893bc['slice'](0x4,_0x5893bc[_0x2b33('0x14')])['join'](','));break;case _0x2b33('0x23'):_0x4fb725[_0x2b33('0x1e')](_0x8079c0[_0x2b33('0x1b')]);break;case _0x2b33('0x24'):_0x4fb725[_0x2b33('0x1e')](_0x8079c0[_0x2b33('0x25')]);_0x4fb725[_0x2b33('0x1e')](_0x8079c0[_0x2b33('0x1b')]);break;case _0x2b33('0x26'):var _0x2b9af8=utils[_0x2b33('0x27')](_0x57aea7[_0x2b33('0x28')][_0x2b33('0x29')],_0x57aea7);var _0x19e351=_0x8079c0[_0x2b33('0x1b')][_0x2b33('0x1c')](',');_0x4fb725['push'](_0x19e351[0x0]);_0x4fb725['push'](_0x19e351[0x1]);_0x4fb725['push'](_0x19e351[0x2]);_0x4fb725[_0x2b33('0x1e')](_0x19e351[0x3]);_0x4fb725[_0x2b33('0x1e')](_0x19e351[0x4]);_0x4fb725[_0x2b33('0x1e')](_0x19e351[0x5]);_0x4fb725[_0x2b33('0x1e')](_0x19e351[0x6]);_0x4fb725[_0x2b33('0x1e')](_0x19e351[0x7]);_0x4fb725['push'](_0x19e351[0x8]);_0x4fb725['push'](_0x19e351[0x9]);_0x4fb725[_0x2b33('0x1e')](_0x19e351[0xa]);_0x4fb725['push'](_0x57aea7[_0x2b33('0x12')]['id']);_0x4fb725[_0x2b33('0x1e')](_0x57aea7[_0x2b33('0x23')]['id']);_0x4fb725[_0x2b33('0x1e')](_0x8079c0[_0x2b33('0x2a')]);_0x4fb725[_0x2b33('0x1e')](_0x57aea7[_0x2b33('0x12')][_0x2b33('0x2b')]);_0x4fb725[_0x2b33('0x1e')](_0x57aea7[_0x2b33('0x2c')]['body']);_0x4fb725[_0x2b33('0x1e')](_0x2b9af8);break;default:_0x4fb725=_[_0x2b33('0xc')](_0x8079c0[_0x2b33('0x1b')])?[]:_0x8079c0['appdata']['split'](',');}var _0x3afaa5={'id':util['format'](_0x2b33('0x2d'),_0x2f5119,_0x8079c0['id'],_0x8079c0[_0x2b33('0x17')]),'condition':require('./interval')[_0x2b33('0x2e')](_0x2f5119,getIntervals(_0x173c75[_0x2b33('0x2f')],_0x8079c0),_0x173c75),'consequence':require('./applications/'+_0x8079c0[_0x2b33('0x17')])[_0x2b33('0x30')](_0x2f5119,_0x4fb725,_0x173c75,_0x57aea7),'p':_0x8079c0['priority']||0x0};logger[_0x2b33('0x31')](_0x2b33('0x32'),_0x3afaa5['id'],_0x2b33('0x33'),getIntervals(_0x173c75['intervals'],_0x8079c0)[_0x2b33('0x16')](_0x2b33('0x34')));_0x409428[_0x2b33('0x1e')](_0x3afaa5);}else{logger[_0x2b33('0x35')](_0x2b33('0x36'),path['join'](__dirname,_0x2b33('0x13'),_0x8079c0[_0x2b33('0x17')]+_0x2b33('0x18')));}}_0x173c75['rules'][_0x2f5119]=new RuleEngine(_0x409428);_0x173c75[_0x2b33('0x37')][_0x2f5119][_0x2b33('0x38')](_0x57aea7,function(_0x3c61d6){logger[_0x2b33('0x31')]('Applications\x20executed',JSON[_0x2b33('0x39')](_0x3c61d6[_0x2b33('0x3a')]));if(_0x173c75['rules'][_0x2f5119]){_0x173c75['rules'][_0x2f5119]['emit'](_0x2b33('0x3b'));}});return _0x1d8e75({'code':0xc8,'message':_0x57aea7});}else{logger['info'](_0x2b33('0x3c'));return _0x1d8e75({'code':0xc8,'message':_0x57aea7});}}catch(_0x71214){logger[_0x2b33('0x35')](_0x71214[_0x2b33('0x3d')]);return _0x1d50d0(_0x52693f[_0x2b33('0x35')](0x1f4,_0x71214));}}return _0x1d50d0(_0x2b33('0x3e'));});},'AcceptMessage':function(_0x361b71){var _0x13bb23=this;return new Promise(function(_0x56224a,_0x34f947){if(_0x361b71[_0x2b33('0x3f')]&&_0x361b71[_0x2b33('0x3f')]['id']){if(_0x173c75[_0x2b33('0x40')][_0x361b71[_0x2b33('0x3f')]['id']]){_0x173c75[_0x2b33('0x40')][_0x361b71['agent']['id']]['busy']=![];_0x173c75['agents'][_0x361b71['agent']['id']][_0x2b33('0x41')]=undefined;}}if(_0x361b71['message']&&_0x361b71[_0x2b33('0x23')]['id']){try{var _0x50125a=getId(_0x361b71['channel'],_0x361b71[_0x2b33('0x23')]?_0x361b71[_0x2b33('0x23')]['id']:0x0,_0x361b71[_0x2b33('0x12')]?_0x361b71['interaction']['id']:0x0);if(_0x173c75[_0x2b33('0x37')][_0x50125a]){_0x173c75['rules'][_0x50125a][_0x2b33('0x42')](_0x2b33('0x43'));if(rpc[_0x361b71[_0x2b33('0x11')]+_0x2b33('0x44')]){rpc[_0x361b71[_0x2b33('0x11')]+_0x2b33('0x44')]['update'](_0x50125a,{'UserId':_0x361b71[_0x2b33('0x23')][_0x2b33('0x45')]})[_0x2b33('0x46')](function(_0x4e8c21){logger[_0x2b33('0x35')](_0x2b33('0x47'));});}}return _0x56224a({'code':0xc8,'message':_0x361b71});}catch(_0x434f0f){logger['error'](_0x434f0f[_0x2b33('0x3d')]);return _0x34f947(_0x13bb23['error'](0x1f4,_0x434f0f));}}logger['error'](_0x2b33('0x48'));return _0x34f947(_0x13bb23[_0x2b33('0x35')](0x1f4,_0x2b33('0x48')));});},'RejectMessage':function(_0xae5ffe){var _0x307370=this;return new Promise(function(_0x3022ca,_0x1982aa){if(_0xae5ffe[_0x2b33('0x3f')]&&_0xae5ffe['agent']['id']){try{if(_0x173c75[_0x2b33('0x40')][_0xae5ffe[_0x2b33('0x3f')]['id']]){_0x173c75['agents'][_0xae5ffe[_0x2b33('0x3f')]['id']][_0x2b33('0x49')]=![];_0x173c75['agents'][_0xae5ffe[_0x2b33('0x3f')]['id']][_0x2b33('0x41')]=undefined;}return _0x3022ca({'code':0xc8,'message':_0xae5ffe});}catch(_0x20f473){logger[_0x2b33('0x35')](_0x20f473['stack']);return _0x1982aa(_0x307370[_0x2b33('0x35')](0x1f4,_0x20f473));}}logger[_0x2b33('0x35')]('message\x20is\x20empty');return _0x1982aa(_0x307370[_0x2b33('0x35')](0x1f4,_0x2b33('0x48')));});},'AbandonInteraction':function(_0x1ce316){var _0x26e0ca=this;return new Promise(function(_0x3a9bbf,_0x35756e){if(_0x1ce316[_0x2b33('0x11')]&&_0x1ce316['interaction']&&_0x1ce316['interaction']['id']){try{var _0x3b0877=getId(_0x1ce316[_0x2b33('0x11')],_0x1ce316['message']?_0x1ce316[_0x2b33('0x23')]['id']:0x0,_0x1ce316[_0x2b33('0x12')]?_0x1ce316[_0x2b33('0x12')]['id']:0x0);if(_0x173c75['rules'][_0x3b0877]){_0x173c75[_0x2b33('0x37')][_0x3b0877][_0x2b33('0x42')](_0x2b33('0x43'));}return _0x3a9bbf({'code':0xc8,'message':_0x1ce316});}catch(_0x1af9a3){logger[_0x2b33('0x35')](_0x1af9a3[_0x2b33('0x3d')]);return _0x35756e(_0x26e0ca[_0x2b33('0x35')](0x1f4,_0x1af9a3));}}logger[_0x2b33('0x35')]('message\x20is\x20empty');return _0x35756e(_0x26e0ca['error'](0x1f4,_0x2b33('0x48')));});},'AgentCapacity':function(_0x138d2f){var _0x30d28f=this;return new Promise(function(_0x275210,_0x280b85){if(_0x173c75[_0x2b33('0x40')]['hasOwnProperty'](_0x138d2f['id'])){for(var _0x2a46fa in _0x138d2f[_0x2b33('0x4a')]){if(_0x138d2f[_0x2b33('0x4a')][_0x2b33('0x4b')](_0x2a46fa)){if(_0x173c75[_0x2b33('0x40')][_0x138d2f['id']][_0x2b33('0x4b')](_0x2a46fa+'CurrentCapacity')){_0x173c75[_0x2b33('0x40')][_0x138d2f['id']][_0x2a46fa+_0x2b33('0x4c')]=parseInt(_0x138d2f[_0x2b33('0x4a')][_0x2a46fa],0xa);}}}_0x173c75[_0x2b33('0x40')][_0x138d2f['id']][_0x2b33('0x4d')]();return _0x275210({'code':0xc8,'message':_0x173c75['agents'][_0x138d2f['id']]});}else{return _0x280b85(_0x30d28f[_0x2b33('0x35')](0x1f4,_0x2b33('0x4e')));}});},'Agents':function(_0x22e898){return new Promise(function(_0x2f2819,_0x49745e){var _0x34b297=_['values'](_0x173c75[_0x2b33('0x40')]);_0x2f2819({'count':_0x34b297[_0x2b33('0x14')],'rows':_0x34b297});});},'ChatQueues':function(_0x348ace){return new Promise(function(_0x24ad81,_0x2904ab){var _0x321940=[];for(var _0x23fdb7 in _0x173c75[_0x2b33('0x4f')]){if(_0x173c75['chatQueues'][_0x2b33('0x4b')](_0x23fdb7)){var _0x22d518=_0x173c75[_0x2b33('0x4f')][_0x23fdb7];var _0x43ff90={'id':_0x22d518['id'],'available':_0x22d518[_0x2b33('0x50')],'loggedIn':_0x22d518[_0x2b33('0x51')],'name':_0x22d518[_0x2b33('0x52')],'paused':_0x22d518[_0x2b33('0x53')],'waiting':_0x22d518[_0x2b33('0x54')]};_0x321940[_0x2b33('0x1e')](_0x43ff90);}}_0x24ad81({'count':_0x321940[_0x2b33('0x14')],'rows':_0x321940});});},'MailQueues':function(_0x34a555){return new Promise(function(_0x47acb1,_0x452cca){var _0x4db872=[];for(var _0x4fb281 in _0x173c75[_0x2b33('0x55')]){if(_0x173c75[_0x2b33('0x55')][_0x2b33('0x4b')](_0x4fb281)){var _0x5e4982=_0x173c75[_0x2b33('0x55')][_0x4fb281];var _0x469825={'id':_0x5e4982['id'],'available':_0x5e4982[_0x2b33('0x50')],'loggedIn':_0x5e4982[_0x2b33('0x51')],'name':_0x5e4982['name'],'paused':_0x5e4982['paused'],'waiting':_0x5e4982['waiting']};_0x4db872['push'](_0x469825);}}_0x47acb1({'count':_0x4db872['length'],'rows':_0x4db872});});},'OpenchannelQueues':function(_0x48f90e){return new Promise(function(_0x52b3ca,_0x25ca35){var _0x4338e2=[];for(var _0x653187 in _0x173c75['openchannelQueues']){if(_0x173c75[_0x2b33('0x56')][_0x2b33('0x4b')](_0x653187)){var _0x3602ba=_0x173c75[_0x2b33('0x56')][_0x653187];var _0xb18773={'id':_0x3602ba['id'],'available':_0x3602ba[_0x2b33('0x50')],'loggedIn':_0x3602ba['loggedIn'],'name':_0x3602ba['name'],'paused':_0x3602ba['paused'],'waiting':_0x3602ba['waiting']};_0x4338e2['push'](_0xb18773);}}_0x52b3ca({'count':_0x4338e2['length'],'rows':_0x4338e2});});},'SmsQueues':function(_0x35a66b){return new Promise(function(_0x456c4b,_0x5c6399){var _0x363a18=[];for(var _0xc06357 in _0x173c75[_0x2b33('0x57')]){if(_0x173c75[_0x2b33('0x57')][_0x2b33('0x4b')](_0xc06357)){var _0x3d76ed=_0x173c75[_0x2b33('0x57')][_0xc06357];var _0x4dbd8c={'id':_0x3d76ed['id'],'available':_0x3d76ed['available'],'loggedIn':_0x3d76ed[_0x2b33('0x51')],'name':_0x3d76ed[_0x2b33('0x52')],'paused':_0x3d76ed[_0x2b33('0x53')],'waiting':_0x3d76ed[_0x2b33('0x54')]};_0x363a18[_0x2b33('0x1e')](_0x4dbd8c);}}_0x456c4b({'count':_0x363a18['length'],'rows':_0x363a18});});},'FaxQueues':function(_0x50d8c5){return new Promise(function(_0x51b862,_0x30a108){var _0x18cc51=[];for(var _0x2452e4 in _0x173c75['faxQueues']){if(_0x173c75['faxQueues'][_0x2b33('0x4b')](_0x2452e4)){var _0x3e3f1f=_0x173c75['faxQueues'][_0x2452e4];var _0x29571e={'id':_0x3e3f1f['id'],'available':_0x3e3f1f[_0x2b33('0x50')],'loggedIn':_0x3e3f1f[_0x2b33('0x51')],'name':_0x3e3f1f['name'],'paused':_0x3e3f1f[_0x2b33('0x53')],'waiting':_0x3e3f1f[_0x2b33('0x54')]};_0x18cc51[_0x2b33('0x1e')](_0x29571e);}}_0x51b862({'count':_0x18cc51[_0x2b33('0x14')],'rows':_0x18cc51});});},'WhatsappQueues':function(_0x4f1cac){return new Promise(function(_0x3e0900,_0x51442d){var _0x30f2dd=[];for(var _0x328ec5 in _0x173c75[_0x2b33('0x58')]){if(_0x173c75[_0x2b33('0x58')][_0x2b33('0x4b')](_0x328ec5)){var _0x56f0e4=_0x173c75['whatsappQueues'][_0x328ec5];var _0x442788={'id':_0x56f0e4['id'],'available':_0x56f0e4['available'],'loggedIn':_0x56f0e4['loggedIn'],'name':_0x56f0e4[_0x2b33('0x52')],'paused':_0x56f0e4[_0x2b33('0x53')],'waiting':_0x56f0e4[_0x2b33('0x54')]};_0x30f2dd[_0x2b33('0x1e')](_0x442788);}}_0x3e0900({'count':_0x30f2dd[_0x2b33('0x14')],'rows':_0x30f2dd});});},'ChatQueuesWaitingInteractions':function(_0x44ca31){return new Promise(function(_0x46445c,_0x29364d){var _0x4edbf6=_['values'](_0x173c75['chatQueuesWaitingInteractions']);_0x46445c({'count':_0x4edbf6[_0x2b33('0x14')],'rows':_0x4edbf6});});},'MailQueuesWaitingInteractions':function(_0x2bc121){return new Promise(function(_0x589106,_0xf15ebc){var _0x7f70b6=_['values'](_0x173c75[_0x2b33('0x59')]);_0x589106({'count':_0x7f70b6['length'],'rows':_0x7f70b6});});},'OpenchannelQueuesWaitingInteractions':function(_0x403d06){return new Promise(function(_0x446cea,_0x48fd7e){var _0x3804fa=_[_0x2b33('0x5a')](_0x173c75['openchannelQueuesWaitingInteractions']);_0x446cea({'count':_0x3804fa[_0x2b33('0x14')],'rows':_0x3804fa});});},'SmsQueuesWaitingInteractions':function(_0x56acea){return new Promise(function(_0x34020f,_0x5bfe3f){var _0x5d9176=_['values'](_0x173c75[_0x2b33('0x5b')]);_0x34020f({'count':_0x5d9176['length'],'rows':_0x5d9176});});},'FaxQueuesWaitingInteractions':function(_0x190cc7){return new Promise(function(_0xdd6652,_0xd33435){var _0x185243=_[_0x2b33('0x5a')](_0x173c75[_0x2b33('0x5c')]);_0xdd6652({'count':_0x185243[_0x2b33('0x14')],'rows':_0x185243});});},'WhatsappQueuesWaitingInteractions':function(_0x3f8aaa){return new Promise(function(_0x209598,_0x40e87f){var _0x355250=_['values'](_0x173c75[_0x2b33('0x5d')]);_0x209598({'count':_0x355250[_0x2b33('0x14')],'rows':_0x355250});});}};var _0x496467=jayson[_0x2b33('0x5e')](_0x233cd9)['http']();_0x496467['on'](_0x2b33('0x35'),function(_0x586617){logger[_0x2b33('0x35')](JSON['stringify'](_0x586617));return _0x17292f(_0x586617);});_0x496467[_0x2b33('0x5f')](0x232c,_0x2b33('0x60'),function(){console[_0x2b33('0x61')](_0x2b33('0x62'),0x232c);return _0x3fcf4e('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 0bb1903..ce93b36 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 _0xfe6b=['some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','../../../config/logger','routing','client','http','request','then','error','message','result','catch','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s'];(function(_0x2c574e,_0x3ccb69){var _0x1b6b18=function(_0x242897){while(--_0x242897){_0x2c574e['push'](_0x2c574e['shift']());}};_0x1b6b18(++_0x3ccb69);}(_0xfe6b,0x17b));var _0xbfe6=function(_0x23c052,_0x529c10){_0x23c052=_0x23c052-0x0;var _0x4f9d57=_0xfe6b[_0x23c052];return _0x4f9d57;};'use strict';var util=require(_0xbfe6('0x0'));var BPromise=require(_0xbfe6('0x1'));var jayson=require(_0xbfe6('0x2'));var _=require('lodash');var logger=require(_0xbfe6('0x3'))(_0xbfe6('0x4'));var client=jayson[_0xbfe6('0x5')][_0xbfe6('0x6')]({'port':0x232a});function request(_0x49cac6,_0x3b6e31){return new BPromise(function(_0x18b80f,_0x34e33a){return client[_0xbfe6('0x7')](_0x49cac6,_0x3b6e31)[_0xbfe6('0x8')](function(_0x50fc03){if(_0x50fc03[_0xbfe6('0x9')]){return _0x34e33a(_0x50fc03['error'][_0xbfe6('0xa')]);}else{return _0x18b80f(_0x50fc03[_0xbfe6('0xb')]);}})[_0xbfe6('0xc')](function(_0x21c299){return _0x34e33a(_0x21c299);});});}exports[_0xbfe6('0xd')]=function(_0x2760b0,_0x43c486,_0x1e63d3){return function(_0xc9474a){if(_0x1e63d3['rules']&&!_0x1e63d3['rules'][_0x2760b0]){logger[_0xbfe6('0xe')](_0xbfe6('0xf'),_0x2760b0);return _0xc9474a[_0xbfe6('0x10')]();}var _0xf91fa=[];for(var _0x11c683=0x0;_0x11c683<_0x43c486[_0xbfe6('0x11')];_0x11c683+=0x1){_0xf91fa['push'](request(_0xbfe6('0x12'),{'command':util[_0xbfe6('0x13')](_0xbfe6('0x14'),_0x43c486[_0x11c683])})[_0xbfe6('0x8')](function(_0x41e6bd){return _0x41e6bd&&_0x41e6bd[_0xbfe6('0xa')]&&_0x41e6bd[_0xbfe6('0xa')][_0xbfe6('0x15')](_0xbfe6('0x16'))>=0x0?!![]:![];})[_0xbfe6('0xc')](function(_0x527462){logger['error'](_0xbfe6('0x17'),_0x2760b0,_0x43c486[_0x11c683]);}));}BPromise['all'](_0xf91fa)[_0xbfe6('0x8')](function(_0x1498f5){var _0xa85b9d=_[_0xbfe6('0x18')](_0x1498f5);logger[_0xbfe6('0xe')](_0xbfe6('0x19'),_0x2760b0,_0x43c486[_0xbfe6('0x1a')](_0xbfe6('0x1b')),_0xa85b9d);_0xc9474a[_0xbfe6('0x1c')](_0xa85b9d);})[_0xbfe6('0xc')](function(_0x1e633f){console[_0xbfe6('0x1d')](_0x1e633f);logger[_0xbfe6('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x2760b0,_0x43c486['join'](_0xbfe6('0x1b')),_0x1e633f[_0xbfe6('0x1e')]);_0xc9474a['stop']();});};}; \ No newline at end of file +var _0x0723=['catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format','indexOf','[%s][INTERVAL]\x20%s','some','join','\x20|\x20','log','[%s][INTERVAL]\x20%s\x20%s','stack','stop','util','bluebird','lodash','../../../config/logger','http','request','then','error','message','result'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0723,0x11f));var _0x3072=function(_0x20c567,_0x489cc8){_0x20c567=_0x20c567-0x0;var _0xdc7b7b=_0x0723[_0x20c567];return _0xdc7b7b;};'use strict';var util=require(_0x3072('0x0'));var BPromise=require(_0x3072('0x1'));var jayson=require('jayson/promise');var _=require(_0x3072('0x2'));var logger=require(_0x3072('0x3'))('routing');var client=jayson['client'][_0x3072('0x4')]({'port':0x232a});function request(_0x26d687,_0x37f3be){return new BPromise(function(_0x4ffe67,_0x44aa31){return client[_0x3072('0x5')](_0x26d687,_0x37f3be)[_0x3072('0x6')](function(_0x23d73e){if(_0x23d73e['error']){return _0x44aa31(_0x23d73e[_0x3072('0x7')][_0x3072('0x8')]);}else{return _0x4ffe67(_0x23d73e[_0x3072('0x9')]);}})[_0x3072('0xa')](function(_0x4da185){return _0x44aa31(_0x4da185);});});}exports[_0x3072('0xb')]=function(_0x54b3be,_0x14ff02,_0x5f5899){return function(_0x59b23f){if(_0x5f5899[_0x3072('0xc')]&&!_0x5f5899[_0x3072('0xc')][_0x54b3be]){logger[_0x3072('0xd')](_0x3072('0xe'),_0x54b3be);return _0x59b23f['stop']();}var _0x51a228=[];for(var _0x1fa8bf=0x0;_0x1fa8bf<_0x14ff02[_0x3072('0xf')];_0x1fa8bf+=0x1){_0x51a228['push'](request(_0x3072('0x10'),{'command':util[_0x3072('0x11')]('iftime\x20%s',_0x14ff02[_0x1fa8bf])})[_0x3072('0x6')](function(_0xb7bb23){return _0xb7bb23&&_0xb7bb23['message']&&_0xb7bb23['message'][_0x3072('0x12')]('true')>=0x0?!![]:![];})[_0x3072('0xa')](function(_0x5f443e){logger['error'](_0x3072('0x13'),_0x54b3be,_0x14ff02[_0x1fa8bf]);}));}BPromise['all'](_0x51a228)[_0x3072('0x6')](function(_0x1f9de7){var _0x219204=_[_0x3072('0x14')](_0x1f9de7);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x54b3be,_0x14ff02[_0x3072('0x15')](_0x3072('0x16')),_0x219204);_0x59b23f['when'](_0x219204);})[_0x3072('0xa')](function(_0x248473){console[_0x3072('0x17')](_0x248473);logger['error'](_0x3072('0x18'),_0x54b3be,_0x14ff02[_0x3072('0x15')](_0x3072('0x16')),_0x248473[_0x3072('0x19')]);_0x59b23f[_0x3072('0x1a')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index f144079..88b8f6d 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 _0xeffd=['secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transferuniqueid','origtransfereruniqueid','transfereeuniqueid','clone','calleridname','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','[%s][agents][agentcalled]','now','called','error','agentringnoanswer','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','push','[%s][agents][agentringnoanswer]','forIn','debug','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','extension','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid'];(function(_0x5c223a,_0x276140){var _0x127539=function(_0x3e07b3){while(--_0x3e07b3){_0x5c223a['push'](_0x5c223a['shift']());}};_0x127539(++_0x276140);}(_0xeffd,0x6b));var _0xdeff=function(_0x27056a,_0x526f6b){_0x27056a=_0x27056a-0x0;var _0x8d9f51=_0xeffd[_0x27056a];return _0x8d9f51;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var utils=require(_0xdeff('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xd8f1d6,_0x281a05){utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x4'),_0xd8f1d6[_0xdeff('0x5')],_0xd8f1d6[_0xdeff('0x6')],_0xd8f1d6[_0xdeff('0x7')],_0xd8f1d6[_0xdeff('0x8')],_0xd8f1d6[_0xdeff('0x9')],_0xd8f1d6[_0xdeff('0xa')],_0xd8f1d6[_0xdeff('0xb')],_0xd8f1d6[_0xdeff('0xc')]));if(_0xd8f1d6[_0xdeff('0x7')]){utils[_0xdeff('0xd')](_0xd8f1d6[_0xdeff('0x7')])['then'](function(_0x3ae201){if(_0x3ae201){_0xd8f1d6[_0xdeff('0xe')]=_0x3ae201[_0xdeff('0xe')];_0xd8f1d6['agentacw']=_0xd8f1d6[_0xdeff('0xf')]?_0x3ae201[_0xdeff('0x10')]:![];_0xd8f1d6[_0xdeff('0x11')]=_0xd8f1d6[_0xdeff('0x12')]?_0x3ae201[_0xdeff('0x13')]:0x0;}utils[_0xdeff('0x14')](_0xdeff('0x15'),_0xd8f1d6);});}else{utils[_0xdeff('0x14')]('CreateVoiceAgentReport',_0xd8f1d6);}if(_0x281a05){delete transfers[_0xd8f1d6[_0xdeff('0x5')]];}else{delete agents[_0xd8f1d6[_0xdeff('0x16')]];}}exports['agentcalled']=function(_0x2e614c){try{utils['debug'](util['format'](_0xdeff('0x17'),_0x2e614c[_0xdeff('0x5')]),_0x2e614c);agents[_0x2e614c[_0xdeff('0x16')]]=_0x2e614c;agents[_0x2e614c[_0xdeff('0x16')]]['agentcalledAt']=utils[_0xdeff('0x18')]();agents[_0x2e614c[_0xdeff('0x16')]][_0xdeff('0xc')]=_0xdeff('0x19');agents[_0x2e614c[_0xdeff('0x16')]][_0xdeff('0xb')]=null;agents[_0x2e614c['destuniqueid']]['connectedlinename']=null;utils[_0xdeff('0x2')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2e614c[_0xdeff('0x5')],agents[_0x2e614c[_0xdeff('0x16')]]['membername'],_0x2e614c[_0xdeff('0x16')]));}catch(_0x42e98e){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x17'),_0x2e614c[_0xdeff('0x5')]),_0x42e98e);}};exports[_0xdeff('0x1b')]=function(_0x919c93){try{if(!_['isNil'](agents[_0x919c93['destuniqueid']])){utils['debug'](util[_0xdeff('0x3')]('[%s][agents][agentringnoanswer]',_0x919c93[_0xdeff('0x5')]),_0x919c93);utils[_0xdeff('0x2')](util['format'](_0xdeff('0x1c'),_0x919c93[_0xdeff('0x5')],agents[_0x919c93['destuniqueid']]['membername'],_0x919c93[_0xdeff('0x16')]));agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0x1b')]=!![];agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0x1d')]=utils['now']();agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0xc')]=_0xdeff('0x1e');agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0x1f')]=_0xdeff('0x1e');agents[_0x919c93[_0xdeff('0x16')]]['holdtime']=_0x919c93[_0xdeff('0x20')]?parseInt(_0x919c93[_0xdeff('0x20')])/0x3e8:0x0;agents[_0x919c93['destuniqueid']]['talktime']=0x0;unanswered[_0xdeff('0x21')](_0x919c93[_0xdeff('0x16')]);}}catch(_0x16b2d0){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x22'),_0x919c93[_0xdeff('0x5')]),_0x16b2d0);}};exports['queuecallerabandon']=function(_0x331ddc){try{_[_0xdeff('0x23')](agents,function(_0x34e258,_0x5045b8){if(_0x34e258['uniqueid']==_0x331ddc[_0xdeff('0x5')]&&!_['includes'](unanswered,_0x34e258[_0xdeff('0x16')])){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][queuecallerabandon]',_0x331ddc[_0xdeff('0x5')]),_0x331ddc);utils['info'](util['format'](_0xdeff('0x25'),_0x331ddc[_0xdeff('0x5')],_0x34e258[_0xdeff('0x8')],_0x34e258[_0xdeff('0x16')]));_0x34e258['agentringnoanswer']=!![];_0x34e258[_0xdeff('0x1d')]=utils[_0xdeff('0x18')]();_0x34e258[_0xdeff('0xc')]=_0xdeff('0x26');_0x34e258[_0xdeff('0x1f')]=_0xdeff('0x26');_0x34e258[_0xdeff('0x27')]=_0x331ddc['holdtime'];_0x34e258[_0xdeff('0x28')]=0x0;writeDB(_0x34e258);}});}catch(_0x5cef77){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x29'),_0x331ddc[_0xdeff('0x5')]),_0x5cef77);}};exports[_0xdeff('0x2a')]=function(_0x965c5b){try{if(agents[_0x965c5b['destuniqueid']]){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][agentconnect]',_0x965c5b[_0xdeff('0x5')]),_0x965c5b);utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x2b'),_0x965c5b[_0xdeff('0x5')],agents[_0x965c5b[_0xdeff('0x16')]][_0xdeff('0x8')],_0x965c5b[_0xdeff('0x16')]));agents[_0x965c5b['destuniqueid']][_0xdeff('0x2c')]=utils['now']();agents[_0x965c5b[_0xdeff('0x16')]][_0xdeff('0xb')]=_0x965c5b[_0xdeff('0xb')];agents[_0x965c5b['destuniqueid']][_0xdeff('0x2d')]=_0x965c5b[_0xdeff('0x2d')];agents[_0x965c5b[_0xdeff('0x16')]][_0xdeff('0x27')]=_0x965c5b[_0xdeff('0x20')];agents[_0x965c5b['destuniqueid']][_0xdeff('0xc')]='connect';_[_0xdeff('0x23')](agents,function(_0x14f1d0,_0x518280){if(_0x14f1d0[_0xdeff('0x16')]!=_0x965c5b[_0xdeff('0x16')]&&_0x14f1d0[_0xdeff('0x5')]==_0x965c5b[_0xdeff('0x5')]){_0x14f1d0[_0xdeff('0x28')]=0x0;_0x14f1d0['holdtime']=_0x965c5b[_0xdeff('0x20')];_0x14f1d0[_0xdeff('0x1b')]=!![];_0x14f1d0[_0xdeff('0x1d')]=utils[_0xdeff('0x18')]();_0x14f1d0[_0xdeff('0xc')]='answered_elsewhere';_0x14f1d0['reason']=_0xdeff('0x2e');_0x14f1d0[_0xdeff('0x2f')]=_0x965c5b[_0xdeff('0x16')];_0x14f1d0[_0xdeff('0x30')]=_0x965c5b[_0xdeff('0x8')];writeDB(_0x14f1d0);}});}}catch(_0x289f70){utils[_0xdeff('0x1a')](util['format'](_0xdeff('0x31'),_0x965c5b[_0xdeff('0x5')]),_0x289f70);}};exports[_0xdeff('0xf')]=function(_0x54fa5b){try{if(!_[_0xdeff('0x32')](agents[_0x54fa5b[_0xdeff('0x16')]])){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][agentcomplete]',_0x54fa5b[_0xdeff('0x5')]),_0x54fa5b);utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x33'),_0x54fa5b[_0xdeff('0x5')],agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x8')],_0x54fa5b[_0xdeff('0x16')]));agents[_0x54fa5b['destuniqueid']][_0xdeff('0xf')]=!![];agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x34')]=utils[_0xdeff('0x18')]();agents[_0x54fa5b[_0xdeff('0x16')]]['talktime']=utils[_0xdeff('0x35')](agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x34')],agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x2c')]);agents[_0x54fa5b['destuniqueid']][_0xdeff('0x1f')]=_0x54fa5b['reason'];agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0xc')]=_0xdeff('0x36');writeDB(agents[_0x54fa5b[_0xdeff('0x16')]]);}}catch(_0xf58aa6){utils[_0xdeff('0x1a')](util['format']('[%s][agents][agentcomplete]',_0x54fa5b[_0xdeff('0x5')]),_0xf58aa6);}};exports[_0xdeff('0x37')]=function(_0x3dc206){try{if(!_['isNil'](agents[_0x3dc206['transfereruniqueid']])){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][blindtransfer]',_0x3dc206[_0xdeff('0x5')]),_0x3dc206);utils[_0xdeff('0x2')](util[_0xdeff('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x3dc206[_0xdeff('0x5')],agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x8')],agents[_0x3dc206['transfereruniqueid']][_0xdeff('0x5')]));agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x39')]=!![];agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x3a')]=_0xdeff('0x3b');agents[_0x3dc206[_0xdeff('0x38')]]['transferexten']=_0x3dc206[_0xdeff('0x3c')];agents[_0x3dc206[_0xdeff('0x38')]]['transferuniqueid']=agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x5')];}}catch(_0x2967b4){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x3d'),_0x3dc206[_0xdeff('0x5')]),_0x2967b4);}};exports[_0xdeff('0x3e')]=function(_0x5ca032){try{utils[_0xdeff('0x24')](util[_0xdeff('0x3')](_0xdeff('0x3f'),_0x5ca032['origtransfereruniqueid']),_0x5ca032);if(_0x5ca032['origtransfereruniqueid']==_0x5ca032[_0xdeff('0x40')]){if(!_[_0xdeff('0x32')](agents[_0x5ca032[_0xdeff('0x41')]])){utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x42'),_0x5ca032['origtransfereruniqueid'],agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x8')]));agents[_0x5ca032[_0xdeff('0x41')]]['transfer']=!![];agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x3a')]=_0xdeff('0x43');agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x44')]=_0x5ca032[_0xdeff('0x45')];agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x46')]=_0x5ca032[_0xdeff('0x47')];}if(_0x5ca032['transfereeuniqueid']&&agents[_0x5ca032[_0xdeff('0x48')]]){agents[_0x5ca032[_0xdeff('0x48')]]['agententerreason']=0x1;transfers[_0x5ca032[_0xdeff('0x48')]]=_[_0xdeff('0x49')](agents[_0x5ca032[_0xdeff('0x48')]]);transfers[_0x5ca032['transfereeuniqueid']]['calleridnum']=agents[_0x5ca032[_0xdeff('0x41')]]['calleridnum'];transfers[_0x5ca032[_0xdeff('0x48')]][_0xdeff('0x4a')]=agents[_0x5ca032[_0xdeff('0x41')]][_0xdeff('0x4a')];transfers[_0x5ca032[_0xdeff('0x48')]]['agentcalledAt']=utils['now']();transfers[_0x5ca032[_0xdeff('0x48')]][_0xdeff('0x2c')]=utils[_0xdeff('0x18')]();transfers[_0x5ca032[_0xdeff('0x48')]][_0xdeff('0x27')]=0x0;transfers[_0x5ca032[_0xdeff('0x48')]]['agententerreason']=0x2;}}else if(_0x5ca032[_0xdeff('0x41')]==_0x5ca032['secondtransfererlinkedid']){if(!_[_0xdeff('0x32')](agents[_0x5ca032[_0xdeff('0x47')]])){utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x42'),_0x5ca032[_0xdeff('0x47')],agents[_0x5ca032[_0xdeff('0x47')]][_0xdeff('0x8')]));agents[_0x5ca032[_0xdeff('0x47')]]['transfer']=!![];agents[_0x5ca032[_0xdeff('0x47')]]['transfertype']=_0xdeff('0x43');agents[_0x5ca032[_0xdeff('0x47')]]['transferexten']=_0x5ca032[_0xdeff('0x4b')];agents[_0x5ca032['origtransfereruniqueid']][_0xdeff('0x46')]=_0x5ca032['secondtransfereruniqueid'];}if(_0x5ca032['transfertargetuniqueid']&&agents[_0x5ca032[_0xdeff('0x4c')]]){agents[_0x5ca032[_0xdeff('0x4c')]]['agententerreason']=0x1;transfers[_0x5ca032[_0xdeff('0x4c')]]=_[_0xdeff('0x49')](agents[_0x5ca032[_0xdeff('0x4c')]]);transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0xa')]=agents[_0x5ca032[_0xdeff('0x47')]][_0xdeff('0xa')];transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x4a')]=agents[_0x5ca032['origtransfereruniqueid']][_0xdeff('0x4a')];transfers[_0x5ca032[_0xdeff('0x4c')]]['agentcalledAt']=utils['now']();transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x2c')]=utils['now']();transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x27')]=0x0;transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x4d')]=0x2;}}}catch(_0x194eed){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x3f'),_0x5ca032[_0xdeff('0x47')]),_0x194eed);}};exports[_0xdeff('0x4e')]=function(_0x5ab2c5){try{utils[_0xdeff('0x24')](util[_0xdeff('0x3')](_0xdeff('0x4f'),_0x5ab2c5[_0xdeff('0x5')]),_0x5ab2c5);if(agents[_0x5ab2c5[_0xdeff('0x5')]]&&agents[_0x5ab2c5['uniqueid']]['reason']==='timeout'){if(_0x5ab2c5[_0xdeff('0x50')]==='21'){agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')]=_0xdeff('0x51');agents[_0x5ab2c5['uniqueid']]['lastevent']=_0xdeff('0x51');}utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x52'),_0x5ab2c5[_0xdeff('0x5')],agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x8')],agents[_0x5ab2c5[_0xdeff('0x5')]]['reason'],agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xc')]));writeDB(agents[_0x5ab2c5[_0xdeff('0x5')]]);var _0x452fd4=unanswered[_0xdeff('0x53')](_0x5ab2c5[_0xdeff('0x5')]);if(_0x452fd4>-0x1){unanswered[_0xdeff('0x54')](_0x452fd4,0x1);}}if(transfers[_0x5ab2c5[_0xdeff('0x5')]]){transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xf')]=!![];transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x34')]=utils['now']();transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x28')]=utils[_0xdeff('0x35')](transfers[_0x5ab2c5['uniqueid']][_0xdeff('0x34')],transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x2c')]);transfers[_0x5ab2c5[_0xdeff('0x5')]]['reason']=_0xdeff('0x55');transfers[_0x5ab2c5[_0xdeff('0x5')]]['lastevent']=_0xdeff('0x36');utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x52'),_0x5ab2c5[_0xdeff('0x5')],transfers[_0x5ab2c5['uniqueid']][_0xdeff('0x8')],transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')],transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xc')]));writeDB(transfers[_0x5ab2c5['uniqueid']],!![]);}if(agents[_0x5ab2c5[_0xdeff('0x5')]]&&agents[_0x5ab2c5[_0xdeff('0x5')]]['agentconnectAt']){agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xf')]=!![];agents[_0x5ab2c5[_0xdeff('0x5')]]['agentcompleteAt']=utils[_0xdeff('0x18')]();agents[_0x5ab2c5[_0xdeff('0x5')]]['talktime']=utils[_0xdeff('0x35')](agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x34')],agents[_0x5ab2c5[_0xdeff('0x5')]]['agentconnectAt']);agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')]=agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x39')]?_0xdeff('0x39'):_0xdeff('0x55');agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xc')]=_0xdeff('0x36');utils['info'](util[_0xdeff('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ab2c5[_0xdeff('0x5')],agents[_0x5ab2c5['uniqueid']]['membername'],agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')],agents[_0x5ab2c5['uniqueid']][_0xdeff('0xc')]));writeDB(agents[_0x5ab2c5[_0xdeff('0x5')]]);}}catch(_0xd49939){utils[_0xdeff('0x1a')](util['format'](_0xdeff('0x4f'),_0x5ab2c5[_0xdeff('0x5')]),_0xd49939);}}; \ No newline at end of file +var _0xb62e=['[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfertype','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','queuecallerabandon','forIn','includes','debug','[%s][agents][queuecallerabandon]','abandoned','holdtime','agentconnect'];(function(_0x265992,_0x76b38){var _0x2694d9=function(_0xd311cf){while(--_0xd311cf){_0x265992['push'](_0x265992['shift']());}};_0x2694d9(++_0x76b38);}(_0xb62e,0x1de));var _0xeb62=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb62e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var utils=require(_0xeb62('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x386f22,_0x57a5ba){utils[_0xeb62('0x3')](util[_0xeb62('0x4')](_0xeb62('0x5'),_0x386f22[_0xeb62('0x6')],_0x386f22[_0xeb62('0x7')],_0x386f22[_0xeb62('0x8')],_0x386f22['membername'],_0x386f22[_0xeb62('0x9')],_0x386f22[_0xeb62('0xa')],_0x386f22[_0xeb62('0xb')],_0x386f22['lastevent']));if(_0x386f22[_0xeb62('0x8')]){utils[_0xeb62('0xc')](_0x386f22[_0xeb62('0x8')])[_0xeb62('0xd')](function(_0x4967c0){if(_0x4967c0){_0x386f22['type']=_0x4967c0[_0xeb62('0xe')];_0x386f22[_0xeb62('0xf')]=_0x386f22[_0xeb62('0x10')]?_0x4967c0[_0xeb62('0x11')]:![];_0x386f22[_0xeb62('0x12')]=_0x386f22[_0xeb62('0xf')]?_0x4967c0[_0xeb62('0x13')]:0x0;}utils[_0xeb62('0x14')](_0xeb62('0x15'),_0x386f22);});}else{utils[_0xeb62('0x14')]('CreateVoiceAgentReport',_0x386f22);}if(_0x57a5ba){delete transfers[_0x386f22[_0xeb62('0x6')]];}else{delete agents[_0x386f22[_0xeb62('0x16')]];}}exports[_0xeb62('0x17')]=function(_0x6822bc){try{utils['debug'](util[_0xeb62('0x4')](_0xeb62('0x18'),_0x6822bc[_0xeb62('0x6')]),_0x6822bc);agents[_0x6822bc['destuniqueid']]=_0x6822bc;agents[_0x6822bc[_0xeb62('0x16')]][_0xeb62('0x19')]=utils[_0xeb62('0x1a')]();agents[_0x6822bc['destuniqueid']][_0xeb62('0x1b')]=_0xeb62('0x1c');agents[_0x6822bc[_0xeb62('0x16')]][_0xeb62('0xb')]=null;agents[_0x6822bc[_0xeb62('0x16')]][_0xeb62('0x1d')]=null;utils[_0xeb62('0x3')](util[_0xeb62('0x4')](_0xeb62('0x1e'),_0x6822bc[_0xeb62('0x6')],agents[_0x6822bc[_0xeb62('0x16')]][_0xeb62('0x1f')],_0x6822bc[_0xeb62('0x16')]));}catch(_0x5a07bb){utils[_0xeb62('0x20')](util[_0xeb62('0x4')](_0xeb62('0x18'),_0x6822bc[_0xeb62('0x6')]),_0x5a07bb);}};exports[_0xeb62('0x21')]=function(_0x24cbf3){try{if(!_[_0xeb62('0x22')](agents[_0x24cbf3['destuniqueid']])){utils['debug'](util[_0xeb62('0x4')](_0xeb62('0x23'),_0x24cbf3[_0xeb62('0x6')]),_0x24cbf3);utils[_0xeb62('0x3')](util[_0xeb62('0x4')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x24cbf3['uniqueid'],agents[_0x24cbf3[_0xeb62('0x16')]][_0xeb62('0x1f')],_0x24cbf3[_0xeb62('0x16')]));agents[_0x24cbf3[_0xeb62('0x16')]]['agentringnoanswer']=!![];agents[_0x24cbf3['destuniqueid']][_0xeb62('0x24')]=utils['now']();agents[_0x24cbf3[_0xeb62('0x16')]]['lastevent']=_0xeb62('0x25');agents[_0x24cbf3['destuniqueid']][_0xeb62('0x26')]=_0xeb62('0x25');agents[_0x24cbf3[_0xeb62('0x16')]]['holdtime']=_0x24cbf3[_0xeb62('0x27')]?parseInt(_0x24cbf3[_0xeb62('0x27')])/0x3e8:0x0;agents[_0x24cbf3[_0xeb62('0x16')]][_0xeb62('0x28')]=0x0;unanswered[_0xeb62('0x29')](_0x24cbf3[_0xeb62('0x16')]);}}catch(_0x511202){utils[_0xeb62('0x20')](util[_0xeb62('0x4')]('[%s][agents][agentringnoanswer]',_0x24cbf3[_0xeb62('0x6')]),_0x511202);}};exports[_0xeb62('0x2a')]=function(_0x2c967c){try{_[_0xeb62('0x2b')](agents,function(_0x235448,_0x5195bf){if(_0x235448['uniqueid']==_0x2c967c[_0xeb62('0x6')]&&!_[_0xeb62('0x2c')](unanswered,_0x235448[_0xeb62('0x16')])){utils[_0xeb62('0x2d')](util[_0xeb62('0x4')](_0xeb62('0x2e'),_0x2c967c[_0xeb62('0x6')]),_0x2c967c);utils['info'](util[_0xeb62('0x4')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2c967c['uniqueid'],_0x235448[_0xeb62('0x1f')],_0x235448[_0xeb62('0x16')]));_0x235448['agentringnoanswer']=!![];_0x235448[_0xeb62('0x24')]=utils['now']();_0x235448[_0xeb62('0x1b')]=_0xeb62('0x2f');_0x235448['reason']=_0xeb62('0x2f');_0x235448[_0xeb62('0x30')]=_0x2c967c['holdtime'];_0x235448[_0xeb62('0x28')]=0x0;writeDB(_0x235448);}});}catch(_0x2a8087){utils[_0xeb62('0x20')](util[_0xeb62('0x4')]('[%s][agents][queuecallerabandon]',_0x2c967c[_0xeb62('0x6')]),_0x2a8087);}};exports[_0xeb62('0x31')]=function(_0x4cf6b0){try{if(agents[_0x4cf6b0['destuniqueid']]){utils[_0xeb62('0x2d')](util[_0xeb62('0x4')]('[%s][agents][agentconnect]',_0x4cf6b0[_0xeb62('0x6')]),_0x4cf6b0);utils[_0xeb62('0x3')](util[_0xeb62('0x4')](_0xeb62('0x32'),_0x4cf6b0[_0xeb62('0x6')],agents[_0x4cf6b0[_0xeb62('0x16')]][_0xeb62('0x1f')],_0x4cf6b0['destuniqueid']));agents[_0x4cf6b0['destuniqueid']][_0xeb62('0x33')]=utils[_0xeb62('0x1a')]();agents[_0x4cf6b0[_0xeb62('0x16')]][_0xeb62('0xb')]=_0x4cf6b0['connectedlinenum'];agents[_0x4cf6b0[_0xeb62('0x16')]]['connectedlinename']=_0x4cf6b0[_0xeb62('0x1d')];agents[_0x4cf6b0[_0xeb62('0x16')]][_0xeb62('0x30')]=_0x4cf6b0[_0xeb62('0x27')];agents[_0x4cf6b0[_0xeb62('0x16')]][_0xeb62('0x1b')]=_0xeb62('0x34');_[_0xeb62('0x2b')](agents,function(_0x5e8ef8,_0x38f91b){if(_0x5e8ef8[_0xeb62('0x16')]!=_0x4cf6b0[_0xeb62('0x16')]&&_0x5e8ef8[_0xeb62('0x6')]==_0x4cf6b0['uniqueid']){_0x5e8ef8['talktime']=0x0;_0x5e8ef8[_0xeb62('0x30')]=_0x4cf6b0[_0xeb62('0x27')];_0x5e8ef8['agentringnoanswer']=!![];_0x5e8ef8[_0xeb62('0x24')]=utils[_0xeb62('0x1a')]();_0x5e8ef8['lastevent']=_0xeb62('0x35');_0x5e8ef8['reason']=_0xeb62('0x35');_0x5e8ef8['answeredelsewheredestinationuniqueid']=_0x4cf6b0[_0xeb62('0x16')];_0x5e8ef8['answeredelsewheremembername']=_0x4cf6b0[_0xeb62('0x1f')];writeDB(_0x5e8ef8);}});}}catch(_0x609b2d){utils[_0xeb62('0x20')](util['format']('[%s][agents][agentconnect]',_0x4cf6b0[_0xeb62('0x6')]),_0x609b2d);}};exports[_0xeb62('0x10')]=function(_0xb1c958){try{if(!_[_0xeb62('0x22')](agents[_0xb1c958[_0xeb62('0x16')]])){utils['debug'](util[_0xeb62('0x4')]('[%s][agents][agentcomplete]',_0xb1c958[_0xeb62('0x6')]),_0xb1c958);utils['info'](util[_0xeb62('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xb1c958[_0xeb62('0x6')],agents[_0xb1c958['destuniqueid']][_0xeb62('0x1f')],_0xb1c958[_0xeb62('0x16')]));agents[_0xb1c958[_0xeb62('0x16')]][_0xeb62('0x10')]=!![];agents[_0xb1c958[_0xeb62('0x16')]][_0xeb62('0x36')]=utils['now']();agents[_0xb1c958[_0xeb62('0x16')]][_0xeb62('0x28')]=utils['diffTime'](agents[_0xb1c958['destuniqueid']]['agentcompleteAt'],agents[_0xb1c958['destuniqueid']][_0xeb62('0x33')]);agents[_0xb1c958[_0xeb62('0x16')]]['reason']=_0xb1c958[_0xeb62('0x26')];agents[_0xb1c958[_0xeb62('0x16')]][_0xeb62('0x1b')]=_0xeb62('0x37');writeDB(agents[_0xb1c958[_0xeb62('0x16')]]);}}catch(_0x555812){utils[_0xeb62('0x20')](util['format'](_0xeb62('0x38'),_0xb1c958[_0xeb62('0x6')]),_0x555812);}};exports[_0xeb62('0x39')]=function(_0x18c40d){try{if(!_[_0xeb62('0x22')](agents[_0x18c40d[_0xeb62('0x3a')]])){utils[_0xeb62('0x2d')](util[_0xeb62('0x4')](_0xeb62('0x3b'),_0x18c40d[_0xeb62('0x6')]),_0x18c40d);utils[_0xeb62('0x3')](util[_0xeb62('0x4')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x18c40d[_0xeb62('0x6')],agents[_0x18c40d['transfereruniqueid']]['membername'],agents[_0x18c40d[_0xeb62('0x3a')]][_0xeb62('0x6')]));agents[_0x18c40d['transfereruniqueid']][_0xeb62('0x3c')]=!![];agents[_0x18c40d[_0xeb62('0x3a')]]['transfertype']=_0xeb62('0x3d');agents[_0x18c40d[_0xeb62('0x3a')]][_0xeb62('0x3e')]=_0x18c40d[_0xeb62('0x3f')];agents[_0x18c40d[_0xeb62('0x3a')]][_0xeb62('0x40')]=agents[_0x18c40d[_0xeb62('0x3a')]][_0xeb62('0x6')];}}catch(_0x497714){utils[_0xeb62('0x20')](util['format'](_0xeb62('0x3b'),_0x18c40d[_0xeb62('0x6')]),_0x497714);}};exports[_0xeb62('0x41')]=function(_0x289af0){try{utils[_0xeb62('0x2d')](util[_0xeb62('0x4')](_0xeb62('0x42'),_0x289af0[_0xeb62('0x43')]),_0x289af0);if(_0x289af0['origtransfereruniqueid']==_0x289af0['origtransfererlinkedid']){if(!_['isNil'](agents[_0x289af0['secondtransfereruniqueid']])){utils[_0xeb62('0x3')](util['format'](_0xeb62('0x44'),_0x289af0['origtransfereruniqueid'],agents[_0x289af0[_0xeb62('0x45')]][_0xeb62('0x1f')]));agents[_0x289af0[_0xeb62('0x45')]]['transfer']=!![];agents[_0x289af0[_0xeb62('0x45')]][_0xeb62('0x46')]='ATTENDED';agents[_0x289af0[_0xeb62('0x45')]][_0xeb62('0x3e')]=_0x289af0[_0xeb62('0x47')];agents[_0x289af0[_0xeb62('0x45')]]['transferuniqueid']=_0x289af0[_0xeb62('0x43')];}if(_0x289af0[_0xeb62('0x48')]&&agents[_0x289af0['transfereeuniqueid']]){agents[_0x289af0[_0xeb62('0x48')]][_0xeb62('0x49')]=0x1;transfers[_0x289af0[_0xeb62('0x48')]]=_[_0xeb62('0x4a')](agents[_0x289af0[_0xeb62('0x48')]]);transfers[_0x289af0[_0xeb62('0x48')]][_0xeb62('0xa')]=agents[_0x289af0[_0xeb62('0x45')]][_0xeb62('0xa')];transfers[_0x289af0[_0xeb62('0x48')]][_0xeb62('0x4b')]=agents[_0x289af0[_0xeb62('0x45')]][_0xeb62('0x4b')];transfers[_0x289af0[_0xeb62('0x48')]][_0xeb62('0x19')]=utils[_0xeb62('0x1a')]();transfers[_0x289af0['transfereeuniqueid']]['agentconnectAt']=utils['now']();transfers[_0x289af0['transfereeuniqueid']][_0xeb62('0x30')]=0x0;transfers[_0x289af0['transfereeuniqueid']][_0xeb62('0x49')]=0x2;}}else if(_0x289af0[_0xeb62('0x45')]==_0x289af0[_0xeb62('0x4c')]){if(!_[_0xeb62('0x22')](agents[_0x289af0[_0xeb62('0x43')]])){utils[_0xeb62('0x3')](util[_0xeb62('0x4')](_0xeb62('0x44'),_0x289af0[_0xeb62('0x43')],agents[_0x289af0[_0xeb62('0x43')]]['membername']));agents[_0x289af0[_0xeb62('0x43')]][_0xeb62('0x3c')]=!![];agents[_0x289af0[_0xeb62('0x43')]][_0xeb62('0x46')]='ATTENDED';agents[_0x289af0[_0xeb62('0x43')]][_0xeb62('0x3e')]=_0x289af0[_0xeb62('0x4d')];agents[_0x289af0[_0xeb62('0x43')]][_0xeb62('0x40')]=_0x289af0[_0xeb62('0x45')];}if(_0x289af0[_0xeb62('0x4e')]&&agents[_0x289af0[_0xeb62('0x4e')]]){agents[_0x289af0[_0xeb62('0x4e')]][_0xeb62('0x49')]=0x1;transfers[_0x289af0[_0xeb62('0x4e')]]=_['clone'](agents[_0x289af0[_0xeb62('0x4e')]]);transfers[_0x289af0[_0xeb62('0x4e')]][_0xeb62('0xa')]=agents[_0x289af0[_0xeb62('0x43')]][_0xeb62('0xa')];transfers[_0x289af0[_0xeb62('0x4e')]][_0xeb62('0x4b')]=agents[_0x289af0[_0xeb62('0x43')]][_0xeb62('0x4b')];transfers[_0x289af0[_0xeb62('0x4e')]]['agentcalledAt']=utils[_0xeb62('0x1a')]();transfers[_0x289af0[_0xeb62('0x4e')]][_0xeb62('0x33')]=utils[_0xeb62('0x1a')]();transfers[_0x289af0['transfertargetuniqueid']][_0xeb62('0x30')]=0x0;transfers[_0x289af0[_0xeb62('0x4e')]][_0xeb62('0x49')]=0x2;}}}catch(_0xdde337){utils[_0xeb62('0x20')](util[_0xeb62('0x4')]('[%s][agents][attendedtransfer]',_0x289af0[_0xeb62('0x43')]),_0xdde337);}};exports[_0xeb62('0x4f')]=function(_0x347c55){try{utils[_0xeb62('0x2d')](util[_0xeb62('0x4')](_0xeb62('0x50'),_0x347c55[_0xeb62('0x6')]),_0x347c55);if(agents[_0x347c55[_0xeb62('0x6')]]&&agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x26')]===_0xeb62('0x25')){if(_0x347c55[_0xeb62('0x51')]==='21'){agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x26')]=_0xeb62('0x52');agents[_0x347c55[_0xeb62('0x6')]]['lastevent']=_0xeb62('0x52');}utils['info'](util[_0xeb62('0x4')](_0xeb62('0x53'),_0x347c55['uniqueid'],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1f')],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x26')],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1b')]));writeDB(agents[_0x347c55[_0xeb62('0x6')]]);var _0x449582=unanswered[_0xeb62('0x54')](_0x347c55[_0xeb62('0x6')]);if(_0x449582>-0x1){unanswered[_0xeb62('0x55')](_0x449582,0x1);}}if(transfers[_0x347c55[_0xeb62('0x6')]]){transfers[_0x347c55[_0xeb62('0x6')]]['agentcomplete']=!![];transfers[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x36')]=utils['now']();transfers[_0x347c55[_0xeb62('0x6')]]['talktime']=utils[_0xeb62('0x56')](transfers[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x36')],transfers[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x33')]);transfers[_0x347c55[_0xeb62('0x6')]]['reason']=_0xeb62('0x57');transfers[_0x347c55['uniqueid']][_0xeb62('0x1b')]=_0xeb62('0x37');utils[_0xeb62('0x3')](util[_0xeb62('0x4')](_0xeb62('0x53'),_0x347c55['uniqueid'],transfers[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1f')],transfers[_0x347c55[_0xeb62('0x6')]]['reason'],transfers[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1b')]));writeDB(transfers[_0x347c55[_0xeb62('0x6')]],!![]);}if(agents[_0x347c55[_0xeb62('0x6')]]&&agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x33')]){agents[_0x347c55['uniqueid']]['agentcomplete']=!![];agents[_0x347c55['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x28')]=utils[_0xeb62('0x56')](agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x36')],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x33')]);agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x26')]=agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x3c')]?_0xeb62('0x3c'):'agent';agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1b')]=_0xeb62('0x37');utils[_0xeb62('0x3')](util[_0xeb62('0x4')](_0xeb62('0x53'),_0x347c55[_0xeb62('0x6')],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1f')],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x26')],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1b')]));writeDB(agents[_0x347c55[_0xeb62('0x6')]]);}}catch(_0xfff29b){utils[_0xeb62('0x20')](util[_0xeb62('0x4')](_0xeb62('0x50'),_0x347c55['uniqueid']),_0xfff29b);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 7f2b6dc..d6a2e9f 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 _0x1156=['[%s][calls][musiconholdstop]','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','includes','execif','gotoif','lastapplication','lastdata','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','DOCUMENTATION','format','newstate','isNil','channelstate','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','toNumber','error','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','cause-txt','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x1156,0x93));var _0x6115=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x1156[_0x4e5552];return _0x60a338;};'use strict';var _=require(_0x6115('0x0'));var util=require(_0x6115('0x1'));var utils=require(_0x6115('0x2'));var transfers=require(_0x6115('0x3'));var dispositions=['NO\x20ANSWER',_0x6115('0x4'),_0x6115('0x4'),'NO\x20ANSWER',_0x6115('0x5'),'NO\x20ANSWER',_0x6115('0x6'),_0x6115('0x7'),_0x6115('0x4'),_0x6115('0x4'),'FAILED'];var channels={};function writeDB(_0x2925c1){var _0x3df09d;if(transfers[_0x6115('0x8')][_0x2925c1[_0x6115('0x9')]]){_0x3df09d=_0x2925c1[_0x6115('0x9')];_0x2925c1['uniqueid']=transfers[_0x6115('0x8')][_0x2925c1[_0x6115('0x9')]][_0x6115('0xa')];}utils[_0x6115('0xb')](util['format'](_0x6115('0xc'),_0x2925c1[_0x6115('0x9')],_0x2925c1[_0x6115('0xd')],_0x2925c1[_0x6115('0xe')],_0x2925c1[_0x6115('0xf')],_0x2925c1[_0x6115('0x10')],_0x2925c1[_0x6115('0x11')],_0x2925c1[_0x6115('0x12')],_0x2925c1[_0x6115('0x13')]));if(_0x2925c1[_0x6115('0x14')]){utils['getUserByInternal'](_0x2925c1[_0x6115('0x14')])[_0x6115('0x15')](function(_0x43db52){if(_0x43db52){_0x2925c1[_0x6115('0x16')]=_0x43db52['id'];}utils[_0x6115('0x17')](_0x6115('0x18'),_0x2925c1);});}else{utils[_0x6115('0x17')](_0x6115('0x18'),_0x2925c1);}if(channels[_0x2925c1[_0x6115('0x9')]]){delete channels[_0x2925c1[_0x6115('0x9')]];}else if(_0x3df09d&&channels[_0x3df09d]){if(!transfers[_0x6115('0x8')][_0x3df09d][_0x6115('0x19')])delete transfers['blinds'][_0x3df09d];delete channels[_0x3df09d];}}exports[_0x6115('0x1a')]=function(_0x268e87){try{utils[_0x6115('0x1b')](util['format']('[%s][calls][newchannel]',_0x268e87[_0x6115('0x9')]),_0x268e87);if(_0x268e87[_0x6115('0x9')]==_0x268e87['linkedid']&&_0x268e87[_0x6115('0xd')]!=_0x6115('0x1c')){utils[_0x6115('0xb')](util['format'](_0x6115('0x1d'),_0x268e87['uniqueid'],_0x268e87[_0x6115('0x1e')],_0x268e87['exten']));channels[_0x268e87[_0x6115('0x9')]]={'uniqueid':_0x268e87[_0x6115('0x9')],'accountcode':_0x268e87['accountcode'],'source':_0x268e87[_0x6115('0x11')],'destination':_0x268e87['exten'],'destinationcontext':_0x268e87[_0x6115('0x1e')],'channel':_0x268e87['channel'],'starttime':utils[_0x6115('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x6115('0x5'),'amaflags':_0x6115('0x20')};}}catch(_0x49f7a0){utils['error'](util[_0x6115('0x21')]('[%s][calls][newchannel]',_0x268e87[_0x6115('0x9')]),_0x49f7a0);}};exports[_0x6115('0x22')]=function(_0x5d243d){try{utils['debug'](util[_0x6115('0x21')]('[%s][calls][newstate]',_0x5d243d[_0x6115('0x9')]),_0x5d243d);if(!_[_0x6115('0x23')](channels[_0x5d243d['uniqueid']])&&_0x5d243d[_0x6115('0x24')]==0x6){utils[_0x6115('0xb')](util[_0x6115('0x21')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x5d243d[_0x6115('0x9')],_0x5d243d[_0x6115('0x1e')],_0x5d243d[_0x6115('0xd')]));if(_[_0x6115('0x23')](channels[_0x5d243d[_0x6115('0x9')]][_0x6115('0x25')])){channels[_0x5d243d[_0x6115('0x9')]]['systemanswertime']=utils['now']();}}else if(!_['isNil'](channels[_0x5d243d[_0x6115('0x26')]])&&_0x5d243d[_0x6115('0x24')]==0x6&&_0x5d243d['context']!=_0x6115('0x27')){utils[_0x6115('0xb')](util[_0x6115('0x21')](_0x6115('0x28'),_0x5d243d[_0x6115('0x9')],_0x5d243d[_0x6115('0x26')],_0x5d243d['context'],_0x5d243d[_0x6115('0xd')]));channels[_0x5d243d[_0x6115('0x26')]][_0x6115('0x14')]=_0x5d243d['accountcode'];channels[_0x5d243d[_0x6115('0x26')]]['destinationchannel']=_0x5d243d['channel'];if(_[_0x6115('0x23')](channels[_0x5d243d[_0x6115('0x26')]]['answertime'])){channels[_0x5d243d[_0x6115('0x26')]][_0x6115('0x29')]=utils[_0x6115('0x1f')]();}channels[_0x5d243d[_0x6115('0x26')]]['disposition']=dispositions[_[_0x6115('0x2a')](_0x5d243d['channelstate'])]||_0x6115('0x6');}}catch(_0x425bdc){utils[_0x6115('0x2b')](util[_0x6115('0x21')](_0x6115('0x2c'),_0x5d243d[_0x6115('0x9')]),_0x425bdc);}};exports[_0x6115('0x2d')]=function(_0x5e00b2){try{if(!_[_0x6115('0x23')](channels[_0x5e00b2[_0x6115('0x9')]])){utils['debug'](util[_0x6115('0x21')](_0x6115('0x2e'),_0x5e00b2[_0x6115('0x9')]),_0x5e00b2);if(_['isNil'](channels[_0x5e00b2[_0x6115('0x9')]][_0x6115('0x2f')])){channels[_0x5e00b2[_0x6115('0x9')]]['callerid']=_0x5e00b2['calleridname']+'\x20<'+_0x5e00b2[_0x6115('0x11')]+'>';}utils[_0x6115('0xb')](util[_0x6115('0x21')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x5e00b2[_0x6115('0x9')],channels[_0x5e00b2[_0x6115('0x9')]][_0x6115('0x2f')],_0x5e00b2[_0x6115('0x30')]));channels[_0x5e00b2[_0x6115('0x9')]][_0x6115('0x31')]=utils[_0x6115('0x1f')]();channels[_0x5e00b2[_0x6115('0x9')]][_0x6115('0x32')]=utils[_0x6115('0x33')](channels[_0x5e00b2[_0x6115('0x9')]][_0x6115('0x31')],channels[_0x5e00b2['uniqueid']][_0x6115('0x34')]);channels[_0x5e00b2['uniqueid']][_0x6115('0x35')]=channels[_0x5e00b2[_0x6115('0x9')]][_0x6115('0x29')]?utils['diffTime'](channels[_0x5e00b2[_0x6115('0x9')]][_0x6115('0x31')],channels[_0x5e00b2[_0x6115('0x9')]]['answertime']):0x0;writeDB(channels[_0x5e00b2[_0x6115('0x9')]]);}}catch(_0x4693d1){utils[_0x6115('0x2b')](util['format'](_0x6115('0x2e'),_0x5e00b2[_0x6115('0x9')]),_0x4693d1);}};exports['attendedtransfer']=function(_0xed0218){try{if(!_[_0x6115('0x23')](channels[_0xed0218[_0x6115('0x36')]])){utils[_0x6115('0x1b')](util[_0x6115('0x21')](_0x6115('0x37'),_0xed0218[_0x6115('0x38')]),_0xed0218);if(channels[_0xed0218['localtwolinkedid']]['channel']==_0xed0218['transfereechannel']){utils[_0x6115('0xb')](util['format'](_0x6115('0x39'),_0xed0218[_0x6115('0x38')],_0xed0218['localtwolinkedid'],_0xed0218['secondtransfererchannel']));channels[_0xed0218[_0x6115('0x36')]][_0x6115('0x3a')]=_0xed0218['secondtransfererchannel'];channels[_0xed0218[_0x6115('0x36')]][_0x6115('0x3b')]=_0x6115('0x3c');}else if(channels[_0xed0218[_0x6115('0x36')]][_0x6115('0xd')]=_0xed0218[_0x6115('0x3d')]){utils[_0x6115('0xb')](util[_0x6115('0x21')](_0x6115('0x39'),_0xed0218['origtransfereruniqueid'],_0xed0218[_0x6115('0x36')],_0xed0218[_0x6115('0x3e')]));channels[_0xed0218[_0x6115('0x36')]][_0x6115('0x3a')]=_0xed0218[_0x6115('0x3e')];channels[_0xed0218[_0x6115('0x36')]]['userfield']=_0x6115('0x3c');}}}catch(_0x53a831){utils[_0x6115('0x2b')](util[_0x6115('0x21')]('[%s][calls][attendedtransfer]',_0xed0218[_0x6115('0x38')]),_0x53a831);}};exports['musiconholdstart']=function(_0x459a56){try{if(!_[_0x6115('0x23')](channels[_0x459a56['uniqueid']])){utils['debug'](util[_0x6115('0x21')](_0x6115('0x3f'),_0x459a56[_0x6115('0x9')]),_0x459a56);channels[_0x459a56[_0x6115('0x9')]][_0x6115('0x40')]=utils[_0x6115('0x1f')]();utils[_0x6115('0xb')](util[_0x6115('0x21')](_0x6115('0x41'),_0x459a56[_0x6115('0x9')],channels[_0x459a56['uniqueid']]['musiconholdstartAt']));}}catch(_0x5079f0){utils[_0x6115('0x2b')](util[_0x6115('0x21')]('[%s][calls][musiconholdstart]',_0x459a56[_0x6115('0x9')]),_0x5079f0);}};exports['musiconholdstop']=function(_0x3ecfda){try{if(!_[_0x6115('0x23')](channels[_0x3ecfda['uniqueid']])){utils[_0x6115('0x1b')](util[_0x6115('0x21')]('[%s][calls][musiconholdstop]',_0x3ecfda[_0x6115('0x9')]),_0x3ecfda);if(!_[_0x6115('0x23')](channels[_0x3ecfda[_0x6115('0x9')]][_0x6115('0x40')])){channels[_0x3ecfda[_0x6115('0x9')]][_0x6115('0x42')]+=utils[_0x6115('0x33')](utils[_0x6115('0x1f')](),channels[_0x3ecfda['uniqueid']][_0x6115('0x40')]);utils[_0x6115('0xb')](util[_0x6115('0x21')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x3ecfda['uniqueid'],channels[_0x3ecfda[_0x6115('0x9')]][_0x6115('0x42')]));delete channels[_0x3ecfda['uniqueid']]['musiconholdstartAt'];}}}catch(_0xfee347){utils['error'](util[_0x6115('0x21')](_0x6115('0x43'),_0x3ecfda['uniqueid']),_0xfee347);}};exports[_0x6115('0x44')]=function(_0x367d3e){try{if(!_[_0x6115('0x23')](channels[_0x367d3e[_0x6115('0x9')]])){utils[_0x6115('0x1b')](util['format']('[%s][calls][varset]',_0x367d3e['uniqueid']),_0x367d3e);if(!_['isNil'](_0x367d3e[_0x6115('0x45')][_0x6115('0x46')])){utils[_0x6115('0xb')](util['format'](_0x6115('0x47'),_0x367d3e[_0x6115('0x9')],_0x367d3e[_0x6115('0x48')]));channels[_0x367d3e[_0x6115('0x9')]][_0x6115('0x49')]=_0x367d3e[_0x6115('0x48')];}if(!_[_0x6115('0x23')](_0x367d3e[_0x6115('0x45')][_0x6115('0x4a')])){utils['info'](util[_0x6115('0x21')](_0x6115('0x4b'),_0x367d3e[_0x6115('0x9')],_0x367d3e[_0x6115('0x48')]));channels[_0x367d3e['uniqueid']][_0x6115('0x4c')]=_0x367d3e[_0x6115('0x48')];channels[_0x367d3e[_0x6115('0x9')]][_0x6115('0x2f')]='\x22'+_0x367d3e[_0x6115('0x48')]+'\x22\x20<'+_0x367d3e[_0x6115('0x48')]+'>';}if(!_[_0x6115('0x23')](_0x367d3e[_0x6115('0x45')][_0x6115('0x4d')])||!_['isNil'](_0x367d3e['variable'][_0x6115('0x4e')])){utils['info'](util[_0x6115('0x21')](_0x6115('0x4f'),_0x367d3e[_0x6115('0x9')],!_[_0x6115('0x23')](_0x367d3e[_0x6115('0x45')][_0x6115('0x4d')])?_0x6115('0x4d'):_0x6115('0x4e'),_0x367d3e[_0x6115('0x48')]));channels[_0x367d3e[_0x6115('0x9')]][_0x6115('0x2f')]=_0x367d3e[_0x6115('0x48')];}if(!_[_0x6115('0x23')](_0x367d3e[_0x6115('0x45')]['xmd-queue'])||!_['isNil'](_0x367d3e['variable'][_0x6115('0x50')])){utils[_0x6115('0xb')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x367d3e['uniqueid'],!_[_0x6115('0x23')](_0x367d3e[_0x6115('0x45')][_0x6115('0x51')])?_0x6115('0x51'):_0x6115('0x50'),_0x367d3e[_0x6115('0x48')]));channels[_0x367d3e['uniqueid']]['lastapplication']=_0x6115('0x52');channels[_0x367d3e[_0x6115('0x9')]]['lastdata']=_0x367d3e[_0x6115('0x48')];channels[_0x367d3e[_0x6115('0x9')]][_0x6115('0xe')]=!![];}if(!_[_0x6115('0x23')](_0x367d3e[_0x6115('0x45')][_0x6115('0x53')])){utils[_0x6115('0xb')](util[_0x6115('0x21')](_0x6115('0x54'),_0x367d3e[_0x6115('0x9')],_0x367d3e['value']));channels[_0x367d3e['uniqueid']][_0x6115('0x55')]=_0x367d3e['value'];}if(!_['isNil'](_0x367d3e['variable'][_0x6115('0x56')])){utils[_0x6115('0xb')](util[_0x6115('0x21')](_0x6115('0x57'),_0x367d3e[_0x6115('0x9')],_0x367d3e[_0x6115('0x48')]));channels[_0x367d3e[_0x6115('0x9')]]['type']=_0x367d3e[_0x6115('0x48')];}if(!_['isNil'](_0x367d3e['variable']['outboundrouteid'])){utils[_0x6115('0xb')](util[_0x6115('0x21')](_0x6115('0x58'),_0x367d3e['uniqueid'],_0x367d3e['value']));channels[_0x367d3e[_0x6115('0x9')]]['routeid']=_0x367d3e[_0x6115('0x48')];}if(!_['isNil'](_0x367d3e['variable'][_0x6115('0x59')])){utils['info'](util[_0x6115('0x21')](_0x6115('0x5a'),_0x367d3e[_0x6115('0x9')],_0x367d3e[_0x6115('0x48')]));channels[_0x367d3e[_0x6115('0x9')]][_0x6115('0x59')]=_0x367d3e['value'];}}}catch(_0x4a759f){utils['error'](util[_0x6115('0x21')](_0x6115('0x5b'),_0x367d3e['uniqueid']),_0x4a759f);}};exports[_0x6115('0x5c')]=function(_0x4e3a9b){try{if(!_[_0x6115('0x23')](channels[_0x4e3a9b['uniqueid']])){utils['debug'](util[_0x6115('0x21')](_0x6115('0x5d'),_0x4e3a9b[_0x6115('0x9')]),_0x4e3a9b);utils[_0x6115('0xb')](util[_0x6115('0x21')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x4e3a9b['uniqueid'],_0x4e3a9b[_0x6115('0x5e')],_0x4e3a9b[_0x6115('0x5f')]));if(_0x4e3a9b[_0x6115('0x5e')][_0x6115('0x60')]()==_0x6115('0x61')&&_[_0x6115('0x62')](_0x4e3a9b[_0x6115('0x5f')][_0x6115('0x60')](),_0x6115('0x63'))){var _0x43d1f5=_0x4e3a9b[_0x6115('0x5f')][_0x6115('0x64')]('=');var _0x981d20=_0x43d1f5[0x0]['substring'](_0x43d1f5[0x0][_0x6115('0x65')]('(')+0x1,_0x43d1f5[0x0][_0x6115('0x65')](')'));var _0x2bda87=_0x43d1f5[0x1];channels[_0x4e3a9b[_0x6115('0x9')]][_0x981d20]=_0x2bda87;}if(!_[_0x6115('0x66')](['hangup','noop',_0x6115('0x67'),_0x6115('0x61'),_0x6115('0x68')],_0x4e3a9b[_0x6115('0x5e')]['toLowerCase']())){channels[_0x4e3a9b['uniqueid']][_0x6115('0x69')]=_0x4e3a9b[_0x6115('0x5e')];channels[_0x4e3a9b['uniqueid']][_0x6115('0x6a')]=_0x4e3a9b[_0x6115('0x5f')];}}}catch(_0x55ff7f){utils[_0x6115('0x2b')](util[_0x6115('0x21')](_0x6115('0x5d'),_0x4e3a9b[_0x6115('0x9')]),_0x55ff7f);}}; \ No newline at end of file +var _0xbf25=['[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','billableseconds','error','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','noop','execif','gotoif','[%s][calls][newexten]','lodash','util','./transfers.controller','NO\x20ANSWER','ANSWERED','BUSY','FAILED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','calleridnum','now','DOCUMENTATION','newstate','[%s][calls][newstate]','channelstate','context','isNil','systemanswertime'];(function(_0x352b44,_0x4a91a1){var _0x3e8baa=function(_0xed4bc3){while(--_0xed4bc3){_0x352b44['push'](_0x352b44['shift']());}};_0x3e8baa(++_0x4a91a1);}(_0xbf25,0x12d));var _0x5bf2=function(_0x1e5ab8,_0x5c2be8){_0x1e5ab8=_0x1e5ab8-0x0;var _0x22ae48=_0xbf25[_0x1e5ab8];return _0x22ae48;};'use strict';var _=require(_0x5bf2('0x0'));var util=require(_0x5bf2('0x1'));var utils=require('./utils');var transfers=require(_0x5bf2('0x2'));var dispositions=[_0x5bf2('0x3'),'FAILED','FAILED',_0x5bf2('0x3'),_0x5bf2('0x3'),_0x5bf2('0x3'),_0x5bf2('0x4'),_0x5bf2('0x5'),_0x5bf2('0x6'),_0x5bf2('0x6'),_0x5bf2('0x6')];var channels={};function writeDB(_0x1b5c36){var _0x3a74ea;if(transfers[_0x5bf2('0x7')][_0x1b5c36[_0x5bf2('0x8')]]){_0x3a74ea=_0x1b5c36['uniqueid'];_0x1b5c36['uniqueid']=transfers['blinds'][_0x1b5c36[_0x5bf2('0x8')]][_0x5bf2('0x9')];}utils[_0x5bf2('0xa')](util[_0x5bf2('0xb')](_0x5bf2('0xc'),_0x1b5c36[_0x5bf2('0x8')],_0x1b5c36[_0x5bf2('0xd')],_0x1b5c36[_0x5bf2('0xe')],_0x1b5c36[_0x5bf2('0xf')],_0x1b5c36[_0x5bf2('0x10')],_0x1b5c36['calleridnum'],_0x1b5c36[_0x5bf2('0x11')],_0x1b5c36[_0x5bf2('0x12')]));if(_0x1b5c36[_0x5bf2('0x13')]){utils[_0x5bf2('0x14')](_0x1b5c36['accountcode'])[_0x5bf2('0x15')](function(_0x387d14){if(_0x387d14){_0x1b5c36[_0x5bf2('0x16')]=_0x387d14['id'];}utils[_0x5bf2('0x17')](_0x5bf2('0x18'),_0x1b5c36);});}else{utils[_0x5bf2('0x17')](_0x5bf2('0x18'),_0x1b5c36);}if(channels[_0x1b5c36['uniqueid']]){delete channels[_0x1b5c36['uniqueid']];}else if(_0x3a74ea&&channels[_0x3a74ea]){if(!transfers[_0x5bf2('0x7')][_0x3a74ea]['recording'])delete transfers[_0x5bf2('0x7')][_0x3a74ea];delete channels[_0x3a74ea];}}exports[_0x5bf2('0x19')]=function(_0x1200b4){try{utils[_0x5bf2('0x1a')](util['format'](_0x5bf2('0x1b'),_0x1200b4[_0x5bf2('0x8')]),_0x1200b4);if(_0x1200b4[_0x5bf2('0x8')]==_0x1200b4[_0x5bf2('0x1c')]&&_0x1200b4[_0x5bf2('0xd')]!=_0x5bf2('0x1d')){utils[_0x5bf2('0xa')](util['format'](_0x5bf2('0x1e'),_0x1200b4[_0x5bf2('0x8')],_0x1200b4['context'],_0x1200b4[_0x5bf2('0x1f')]));channels[_0x1200b4[_0x5bf2('0x8')]]={'uniqueid':_0x1200b4[_0x5bf2('0x8')],'accountcode':_0x1200b4['accountcode'],'source':_0x1200b4[_0x5bf2('0x20')],'destination':_0x1200b4[_0x5bf2('0x1f')],'destinationcontext':_0x1200b4['context'],'channel':_0x1200b4[_0x5bf2('0xd')],'starttime':utils[_0x5bf2('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5bf2('0x3'),'amaflags':_0x5bf2('0x22')};}}catch(_0x326816){utils['error'](util[_0x5bf2('0xb')]('[%s][calls][newchannel]',_0x1200b4[_0x5bf2('0x8')]),_0x326816);}};exports[_0x5bf2('0x23')]=function(_0x25c6ac){try{utils[_0x5bf2('0x1a')](util[_0x5bf2('0xb')](_0x5bf2('0x24'),_0x25c6ac[_0x5bf2('0x8')]),_0x25c6ac);if(!_['isNil'](channels[_0x25c6ac['uniqueid']])&&_0x25c6ac[_0x5bf2('0x25')]==0x6){utils[_0x5bf2('0xa')](util[_0x5bf2('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x25c6ac[_0x5bf2('0x8')],_0x25c6ac[_0x5bf2('0x26')],_0x25c6ac[_0x5bf2('0xd')]));if(_[_0x5bf2('0x27')](channels[_0x25c6ac[_0x5bf2('0x8')]]['systemanswertime'])){channels[_0x25c6ac[_0x5bf2('0x8')]][_0x5bf2('0x28')]=utils[_0x5bf2('0x21')]();}}else if(!_[_0x5bf2('0x27')](channels[_0x25c6ac['linkedid']])&&_0x25c6ac[_0x5bf2('0x25')]==0x6&&_0x25c6ac[_0x5bf2('0x26')]!='transfer'){utils[_0x5bf2('0xa')](util[_0x5bf2('0xb')](_0x5bf2('0x29'),_0x25c6ac[_0x5bf2('0x8')],_0x25c6ac[_0x5bf2('0x1c')],_0x25c6ac[_0x5bf2('0x26')],_0x25c6ac['channel']));channels[_0x25c6ac['linkedid']][_0x5bf2('0x13')]=_0x25c6ac[_0x5bf2('0x13')];channels[_0x25c6ac[_0x5bf2('0x1c')]][_0x5bf2('0x2a')]=_0x25c6ac[_0x5bf2('0xd')];if(_[_0x5bf2('0x27')](channels[_0x25c6ac[_0x5bf2('0x1c')]][_0x5bf2('0x2b')])){channels[_0x25c6ac[_0x5bf2('0x1c')]]['answertime']=utils[_0x5bf2('0x21')]();}channels[_0x25c6ac[_0x5bf2('0x1c')]][_0x5bf2('0x2c')]=dispositions[_[_0x5bf2('0x2d')](_0x25c6ac[_0x5bf2('0x25')])]||_0x5bf2('0x4');}}catch(_0x1f9dc9){utils['error'](util[_0x5bf2('0xb')](_0x5bf2('0x24'),_0x25c6ac[_0x5bf2('0x8')]),_0x1f9dc9);}};exports[_0x5bf2('0x2e')]=function(_0x1c246f){try{if(!_[_0x5bf2('0x27')](channels[_0x1c246f[_0x5bf2('0x8')]])){utils[_0x5bf2('0x1a')](util[_0x5bf2('0xb')]('[%s][calls][hangup]',_0x1c246f[_0x5bf2('0x8')]),_0x1c246f);if(_['isNil'](channels[_0x1c246f[_0x5bf2('0x8')]][_0x5bf2('0x2f')])){channels[_0x1c246f[_0x5bf2('0x8')]]['callerid']=_0x1c246f['calleridname']+'\x20<'+_0x1c246f['calleridnum']+'>';}utils[_0x5bf2('0xa')](util[_0x5bf2('0xb')](_0x5bf2('0x30'),_0x1c246f[_0x5bf2('0x8')],channels[_0x1c246f[_0x5bf2('0x8')]]['callerid'],_0x1c246f[_0x5bf2('0x31')]));channels[_0x1c246f[_0x5bf2('0x8')]]['endtime']=utils[_0x5bf2('0x21')]();channels[_0x1c246f[_0x5bf2('0x8')]][_0x5bf2('0x32')]=utils[_0x5bf2('0x33')](channels[_0x1c246f[_0x5bf2('0x8')]]['endtime'],channels[_0x1c246f[_0x5bf2('0x8')]]['starttime']);channels[_0x1c246f['uniqueid']][_0x5bf2('0x34')]=channels[_0x1c246f['uniqueid']][_0x5bf2('0x2b')]?utils[_0x5bf2('0x33')](channels[_0x1c246f[_0x5bf2('0x8')]]['endtime'],channels[_0x1c246f['uniqueid']][_0x5bf2('0x2b')]):0x0;writeDB(channels[_0x1c246f[_0x5bf2('0x8')]]);}}catch(_0x4b1e4c){utils[_0x5bf2('0x35')](util[_0x5bf2('0xb')](_0x5bf2('0x36'),_0x1c246f[_0x5bf2('0x8')]),_0x4b1e4c);}};exports[_0x5bf2('0x37')]=function(_0x1a87ae){try{if(!_['isNil'](channels[_0x1a87ae[_0x5bf2('0x38')]])){utils[_0x5bf2('0x1a')](util[_0x5bf2('0xb')]('[%s][calls][attendedtransfer]',_0x1a87ae[_0x5bf2('0x39')]),_0x1a87ae);if(channels[_0x1a87ae['localtwolinkedid']]['channel']==_0x1a87ae['transfereechannel']){utils[_0x5bf2('0xa')](util[_0x5bf2('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x1a87ae['origtransfereruniqueid'],_0x1a87ae[_0x5bf2('0x38')],_0x1a87ae[_0x5bf2('0x3a')]));channels[_0x1a87ae[_0x5bf2('0x38')]]['destinationchannel']=_0x1a87ae['secondtransfererchannel'];channels[_0x1a87ae[_0x5bf2('0x38')]][_0x5bf2('0x3b')]=_0x5bf2('0x3c');}else if(channels[_0x1a87ae['localtwolinkedid']][_0x5bf2('0xd')]=_0x1a87ae[_0x5bf2('0x3d')]){utils[_0x5bf2('0xa')](util['format'](_0x5bf2('0x3e'),_0x1a87ae[_0x5bf2('0x39')],_0x1a87ae[_0x5bf2('0x38')],_0x1a87ae[_0x5bf2('0x3f')]));channels[_0x1a87ae['localtwolinkedid']][_0x5bf2('0x2a')]=_0x1a87ae[_0x5bf2('0x3f')];channels[_0x1a87ae['localtwolinkedid']]['userfield']=_0x5bf2('0x3c');}}}catch(_0xbc017){utils[_0x5bf2('0x35')](util[_0x5bf2('0xb')](_0x5bf2('0x40'),_0x1a87ae[_0x5bf2('0x39')]),_0xbc017);}};exports[_0x5bf2('0x41')]=function(_0x18a93e){try{if(!_['isNil'](channels[_0x18a93e[_0x5bf2('0x8')]])){utils[_0x5bf2('0x1a')](util['format'](_0x5bf2('0x42'),_0x18a93e[_0x5bf2('0x8')]),_0x18a93e);channels[_0x18a93e[_0x5bf2('0x8')]][_0x5bf2('0x43')]=utils['now']();utils[_0x5bf2('0xa')](util[_0x5bf2('0xb')](_0x5bf2('0x44'),_0x18a93e['uniqueid'],channels[_0x18a93e[_0x5bf2('0x8')]][_0x5bf2('0x43')]));}}catch(_0x169329){utils[_0x5bf2('0x35')](util[_0x5bf2('0xb')](_0x5bf2('0x42'),_0x18a93e[_0x5bf2('0x8')]),_0x169329);}};exports[_0x5bf2('0x45')]=function(_0x402cf8){try{if(!_[_0x5bf2('0x27')](channels[_0x402cf8[_0x5bf2('0x8')]])){utils[_0x5bf2('0x1a')](util[_0x5bf2('0xb')]('[%s][calls][musiconholdstop]',_0x402cf8[_0x5bf2('0x8')]),_0x402cf8);if(!_[_0x5bf2('0x27')](channels[_0x402cf8['uniqueid']][_0x5bf2('0x43')])){channels[_0x402cf8[_0x5bf2('0x8')]][_0x5bf2('0x46')]+=utils[_0x5bf2('0x33')](utils[_0x5bf2('0x21')](),channels[_0x402cf8['uniqueid']][_0x5bf2('0x43')]);utils[_0x5bf2('0xa')](util[_0x5bf2('0xb')](_0x5bf2('0x47'),_0x402cf8['uniqueid'],channels[_0x402cf8['uniqueid']][_0x5bf2('0x46')]));delete channels[_0x402cf8[_0x5bf2('0x8')]][_0x5bf2('0x43')];}}}catch(_0x31cfde){utils[_0x5bf2('0x35')](util[_0x5bf2('0xb')]('[%s][calls][musiconholdstop]',_0x402cf8[_0x5bf2('0x8')]),_0x31cfde);}};exports[_0x5bf2('0x48')]=function(_0x198f78){try{if(!_['isNil'](channels[_0x198f78['uniqueid']])){utils[_0x5bf2('0x1a')](util[_0x5bf2('0xb')]('[%s][calls][varset]',_0x198f78['uniqueid']),_0x198f78);if(!_[_0x5bf2('0x27')](_0x198f78[_0x5bf2('0x49')][_0x5bf2('0x4a')])){utils[_0x5bf2('0xa')](util['format'](_0x5bf2('0x4b'),_0x198f78[_0x5bf2('0x8')],_0x198f78[_0x5bf2('0x4c')]));channels[_0x198f78[_0x5bf2('0x8')]]['source']=_0x198f78['value'];}if(!_[_0x5bf2('0x27')](_0x198f78['variable'][_0x5bf2('0x4d')])){utils[_0x5bf2('0xa')](util[_0x5bf2('0xb')](_0x5bf2('0x4e'),_0x198f78[_0x5bf2('0x8')],_0x198f78[_0x5bf2('0x4c')]));channels[_0x198f78[_0x5bf2('0x8')]][_0x5bf2('0x4f')]=_0x198f78['value'];channels[_0x198f78[_0x5bf2('0x8')]]['callerid']='\x22'+_0x198f78[_0x5bf2('0x4c')]+_0x5bf2('0x50')+_0x198f78[_0x5bf2('0x4c')]+'>';}if(!_[_0x5bf2('0x27')](_0x198f78[_0x5bf2('0x49')][_0x5bf2('0x51')])||!_[_0x5bf2('0x27')](_0x198f78[_0x5bf2('0x49')][_0x5bf2('0x52')])){utils[_0x5bf2('0xa')](util[_0x5bf2('0xb')](_0x5bf2('0x53'),_0x198f78['uniqueid'],!_[_0x5bf2('0x27')](_0x198f78[_0x5bf2('0x49')][_0x5bf2('0x51')])?_0x5bf2('0x51'):_0x5bf2('0x52'),_0x198f78['value']));channels[_0x198f78[_0x5bf2('0x8')]][_0x5bf2('0x2f')]=_0x198f78[_0x5bf2('0x4c')];}if(!_[_0x5bf2('0x27')](_0x198f78[_0x5bf2('0x49')]['xmd-queue'])||!_[_0x5bf2('0x27')](_0x198f78[_0x5bf2('0x49')]['xmcs-queue'])){utils[_0x5bf2('0xa')](util[_0x5bf2('0xb')](_0x5bf2('0x53'),_0x198f78['uniqueid'],!_[_0x5bf2('0x27')](_0x198f78['variable']['xmd-queue'])?_0x5bf2('0x54'):_0x5bf2('0x55'),_0x198f78[_0x5bf2('0x4c')]));channels[_0x198f78['uniqueid']][_0x5bf2('0x56')]=_0x5bf2('0x57');channels[_0x198f78[_0x5bf2('0x8')]][_0x5bf2('0x58')]=_0x198f78[_0x5bf2('0x4c')];channels[_0x198f78[_0x5bf2('0x8')]][_0x5bf2('0xe')]=!![];}if(!_['isNil'](_0x198f78[_0x5bf2('0x49')][_0x5bf2('0x59')])){utils['info'](util[_0x5bf2('0xb')](_0x5bf2('0x5a'),_0x198f78[_0x5bf2('0x8')],_0x198f78['value']));channels[_0x198f78['uniqueid']][_0x5bf2('0x5b')]=_0x198f78[_0x5bf2('0x4c')];}if(!_[_0x5bf2('0x27')](_0x198f78[_0x5bf2('0x49')][_0x5bf2('0x5c')])){utils['info'](util['format'](_0x5bf2('0x5d'),_0x198f78[_0x5bf2('0x8')],_0x198f78['value']));channels[_0x198f78[_0x5bf2('0x8')]][_0x5bf2('0x5e')]=_0x198f78[_0x5bf2('0x4c')];}if(!_[_0x5bf2('0x27')](_0x198f78['variable'][_0x5bf2('0x5f')])){utils['info'](util[_0x5bf2('0xb')](_0x5bf2('0x60'),_0x198f78[_0x5bf2('0x8')],_0x198f78[_0x5bf2('0x4c')]));channels[_0x198f78['uniqueid']][_0x5bf2('0x61')]=_0x198f78[_0x5bf2('0x4c')];}if(!_['isNil'](_0x198f78['variable']['sipcallid'])){utils['info'](util[_0x5bf2('0xb')](_0x5bf2('0x62'),_0x198f78[_0x5bf2('0x8')],_0x198f78['value']));channels[_0x198f78[_0x5bf2('0x8')]]['sipcallid']=_0x198f78[_0x5bf2('0x4c')];}}}catch(_0x502863){utils[_0x5bf2('0x35')](util[_0x5bf2('0xb')](_0x5bf2('0x63'),_0x198f78[_0x5bf2('0x8')]),_0x502863);}};exports[_0x5bf2('0x64')]=function(_0x5e425b){try{if(!_[_0x5bf2('0x27')](channels[_0x5e425b[_0x5bf2('0x8')]])){utils['debug'](util[_0x5bf2('0xb')]('[%s][calls][newexten]',_0x5e425b[_0x5bf2('0x8')]),_0x5e425b);utils[_0x5bf2('0xa')](util[_0x5bf2('0xb')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x5e425b[_0x5bf2('0x8')],_0x5e425b[_0x5bf2('0x65')],_0x5e425b['appdata']));if(_0x5e425b[_0x5bf2('0x65')][_0x5bf2('0x66')]()==_0x5bf2('0x67')&&_[_0x5bf2('0x68')](_0x5e425b[_0x5bf2('0x69')][_0x5bf2('0x66')](),_0x5bf2('0x6a'))){var _0x37cad4=_0x5e425b[_0x5bf2('0x69')][_0x5bf2('0x6b')]('=');var _0x5e6b8a=_0x37cad4[0x0][_0x5bf2('0x6c')](_0x37cad4[0x0][_0x5bf2('0x6d')]('(')+0x1,_0x37cad4[0x0]['lastIndexOf'](')'));var _0x4c2158=_0x37cad4[0x1];channels[_0x5e425b[_0x5bf2('0x8')]][_0x5e6b8a]=_0x4c2158;}if(!_['includes']([_0x5bf2('0x2e'),_0x5bf2('0x6e'),_0x5bf2('0x6f'),'set',_0x5bf2('0x70')],_0x5e425b['application'][_0x5bf2('0x66')]())){channels[_0x5e425b[_0x5bf2('0x8')]][_0x5bf2('0x56')]=_0x5e425b[_0x5bf2('0x65')];channels[_0x5e425b['uniqueid']][_0x5bf2('0x58')]=_0x5e425b[_0x5bf2('0x69')];}}}catch(_0x3d72fe){utils[_0x5bf2('0x35')](util[_0x5bf2('0xb')](_0x5bf2('0x71'),_0x5e425b[_0x5bf2('0x8')]),_0x3d72fe);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index b4595d9..5b3a83a 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 _0x9e6e=['./utils','info','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','close'];(function(_0x139210,_0x33f6ee){var _0x3ff184=function(_0x24baf2){while(--_0x24baf2){_0x139210['push'](_0x139210['shift']());}};_0x3ff184(++_0x33f6ee);}(_0x9e6e,0x1b0));var _0xe9e6=function(_0x4368c8,_0xb4969f){_0x4368c8=_0x4368c8-0x0;var _0x1db9b0=_0x9e6e[_0x4368c8];return _0x1db9b0;};'use strict';var utils=require(_0xe9e6('0x0'));exports['connect']=function(){utils[_0xe9e6('0x1')]('[core]\x20connected');};exports[_0xe9e6('0x2')]=function(){utils[_0xe9e6('0x1')](_0xe9e6('0x3'));};exports[_0xe9e6('0x4')]=function(){utils['info']('[core]\x20fullybooted');};exports['error']=function(_0x4ed3be){utils[_0xe9e6('0x5')](_0xe9e6('0x6'),_0x4ed3be);};exports[_0xe9e6('0x7')]=function(){utils[_0xe9e6('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x149b81){}; \ No newline at end of file +var _0x6335=['managerevent','./utils','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6335,0xab));var _0x5633=function(_0x340957,_0x3daa0b){_0x340957=_0x340957-0x0;var _0x1ab577=_0x6335[_0x340957];return _0x1ab577;};'use strict';var utils=require(_0x5633('0x0'));exports['connect']=function(){utils[_0x5633('0x1')]('[core]\x20connected');};exports['shutdown']=function(){utils['info'](_0x5633('0x2'));};exports[_0x5633('0x3')]=function(){utils[_0x5633('0x1')](_0x5633('0x4'));};exports['error']=function(_0x6f3c54){utils[_0x5633('0x5')](_0x5633('0x6'),_0x6f3c54);};exports[_0x5633('0x7')]=function(){utils[_0x5633('0x1')](_0x5633('0x8'));};exports[_0x5633('0x9')]=function(_0x3ac274){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 3490154..4d17f82 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 _0xcf4b=['appdata','application','set','startsWith','toLowerCase','cdr(routeid)','split','error','[%s][dials][newexten]','varset','debug','[%s][dials][varset]','isNil','value','dialbegin','[%s][dials][dialbegin]','assign','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','endtime','starttime','holdtime','diffTime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','newexten','[%s][dials][newexten]\x20application:%s\x20appdata:%s'];(function(_0x364471,_0x302e8a){var _0x59236f=function(_0x524944){while(--_0x524944){_0x364471['push'](_0x364471['shift']());}};_0x59236f(++_0x302e8a);}(_0xcf4b,0x157));var _0xbcf4=function(_0x3acf36,_0x5c4584){_0x3acf36=_0x3acf36-0x0;var _0x5e5455=_0xcf4b[_0x3acf36];return _0x5e5455;};'use strict';var _=require(_0xbcf4('0x0'));var util=require(_0xbcf4('0x1'));var utils=require(_0xbcf4('0x2'));var dials={};function writeDB(_0x57f642){utils[_0xbcf4('0x3')](util[_0xbcf4('0x4')](_0xbcf4('0x5'),_0x57f642[_0xbcf4('0x6')],_0x57f642['channel'],_0x57f642[_0xbcf4('0x7')],_0x57f642[_0xbcf4('0x8')],_0x57f642[_0xbcf4('0x9')],_0x57f642[_0xbcf4('0xa')]));utils[_0xbcf4('0xb')]('CreateVoiceDialReport',_0x57f642);delete dials[_0x57f642[_0xbcf4('0x6')]];}exports[_0xbcf4('0xc')]=function(_0x37db69){try{utils['debug'](util[_0xbcf4('0x4')]('[%s][dials][newexten]',_0x37db69[_0xbcf4('0x6')]),_0x37db69);utils['info'](util[_0xbcf4('0x4')](_0xbcf4('0xd'),_0x37db69[_0xbcf4('0x6')],_0x37db69['application'],_0x37db69[_0xbcf4('0xe')]));if(_0x37db69[_0xbcf4('0xf')]['toLowerCase']()==_0xbcf4('0x10')&&_[_0xbcf4('0x11')](_0x37db69[_0xbcf4('0xe')][_0xbcf4('0x12')](),_0xbcf4('0x13'))){var _0x21e40a=_0x37db69[_0xbcf4('0xe')][_0xbcf4('0x14')]('=');dials[_0x37db69[_0xbcf4('0x6')]]={'routeId':_0x21e40a[0x1]};}}catch(_0x598673){utils[_0xbcf4('0x15')](util[_0xbcf4('0x4')](_0xbcf4('0x16'),_0x37db69['uniqueid']),_0x598673);}};exports[_0xbcf4('0x17')]=function(_0x5e4059){try{utils[_0xbcf4('0x18')](util[_0xbcf4('0x4')](_0xbcf4('0x19'),_0x5e4059[_0xbcf4('0x6')]),_0x5e4059);if(!_[_0xbcf4('0x1a')](_0x5e4059['variable']['outboundrouteid'])){utils['info'](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x5e4059[_0xbcf4('0x6')],_0x5e4059[_0xbcf4('0x1b')]));dials[_0x5e4059['uniqueid']]={'routeId':_0x5e4059['value']};}}catch(_0x100068){utils[_0xbcf4('0x15')](util[_0xbcf4('0x4')](_0xbcf4('0x19'),_0x5e4059['uniqueid']),_0x100068);}};exports[_0xbcf4('0x1c')]=function(_0x30294a){try{if(!_[_0xbcf4('0x1a')](dials[_0x30294a[_0xbcf4('0x6')]])){utils[_0xbcf4('0x18')](util['format'](_0xbcf4('0x1d'),_0x30294a[_0xbcf4('0x6')]),_0x30294a);dials[_0x30294a[_0xbcf4('0x6')]]=_[_0xbcf4('0x1e')](dials[_0x30294a[_0xbcf4('0x6')]],_0x30294a);dials[_0x30294a['uniqueid']]['starttime']=utils['now']();dials[_0x30294a[_0xbcf4('0x6')]][_0xbcf4('0x1f')]=_0xbcf4('0x20');utils['info'](util['format'](_0xbcf4('0x21'),_0x30294a['uniqueid'],dials[_0x30294a[_0xbcf4('0x6')]]['starttime']));}}catch(_0x2ffd4a){utils[_0xbcf4('0x15')](util['format'](_0xbcf4('0x1d'),_0x30294a['uniqueid']),_0x2ffd4a);}};exports[_0xbcf4('0x22')]=function(_0x4ed722){try{if(!_['isNil'](dials[_0x4ed722['uniqueid']])){utils[_0xbcf4('0x18')](util[_0xbcf4('0x4')](_0xbcf4('0x23'),_0x4ed722[_0xbcf4('0x6')]),_0x4ed722);dials[_0x4ed722[_0xbcf4('0x6')]][_0xbcf4('0xa')]=_0x4ed722[_0xbcf4('0xa')];if(_0x4ed722['dialstatus']==_0xbcf4('0x24')){dials[_0x4ed722[_0xbcf4('0x6')]]=_[_0xbcf4('0x1e')](dials[_0x4ed722[_0xbcf4('0x6')]],_0x4ed722);dials[_0x4ed722['uniqueid']][_0xbcf4('0x25')]=utils[_0xbcf4('0x26')]();dials[_0x4ed722['uniqueid']]['lastevent']=_0xbcf4('0x27');utils[_0xbcf4('0x3')](util[_0xbcf4('0x4')](_0xbcf4('0x28'),_0x4ed722[_0xbcf4('0x6')],_0x4ed722[_0xbcf4('0xa')],dials[_0x4ed722[_0xbcf4('0x6')]][_0xbcf4('0x25')]));}else{utils['info'](util[_0xbcf4('0x4')]('[%s][dials][dialend]\x20dialstatus:%s',_0x4ed722['uniqueid'],_0x4ed722['dialstatus']));}}}catch(_0x1c78ad){utils[_0xbcf4('0x15')](util[_0xbcf4('0x4')]('[%s][dials][dialend]',_0x4ed722[_0xbcf4('0x6')]),_0x1c78ad);}};exports['hangup']=function(_0x41744b){try{if(!_['isNil'](dials[_0x41744b[_0xbcf4('0x6')]])){utils[_0xbcf4('0x18')](util[_0xbcf4('0x4')](_0xbcf4('0x29'),_0x41744b[_0xbcf4('0x6')]),_0x41744b);utils[_0xbcf4('0x3')](util[_0xbcf4('0x4')](_0xbcf4('0x2a'),_0x41744b[_0xbcf4('0x6')],_0x41744b['calleridnum'],_0x41744b[_0xbcf4('0x2b')],_0x41744b['cause-txt']));dials[_0x41744b[_0xbcf4('0x6')]]=_[_0xbcf4('0x1e')](dials[_0x41744b[_0xbcf4('0x6')]],{'endtime':utils['now'](),'lastevent':_0xbcf4('0x2c')});dials[_0x41744b[_0xbcf4('0x6')]][_0xbcf4('0x2d')]=utils['diffTime'](dials[_0x41744b[_0xbcf4('0x6')]][_0xbcf4('0x2e')],dials[_0x41744b['uniqueid']][_0xbcf4('0x2f')]);dials[_0x41744b[_0xbcf4('0x6')]][_0xbcf4('0x30')]=utils[_0xbcf4('0x31')](dials[_0x41744b[_0xbcf4('0x6')]][_0xbcf4('0x25')]||dials[_0x41744b[_0xbcf4('0x6')]]['endtime'],dials[_0x41744b[_0xbcf4('0x6')]]['starttime']);dials[_0x41744b['uniqueid']][_0xbcf4('0x32')]=dials[_0x41744b['uniqueid']][_0xbcf4('0x25')]?utils[_0xbcf4('0x31')](dials[_0x41744b[_0xbcf4('0x6')]][_0xbcf4('0x2e')],dials[_0x41744b[_0xbcf4('0x6')]][_0xbcf4('0x25')]):0x0;writeDB(dials[_0x41744b[_0xbcf4('0x6')]]);}}catch(_0x411fb0){utils[_0xbcf4('0x15')](util[_0xbcf4('0x4')](_0xbcf4('0x29'),_0x41744b['uniqueid']),_0x411fb0);}}; \ No newline at end of file +var _0x2c92=['connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','calleridnum','cause-txt','duration','diffTime','endtime','[%s][dials][hangup]','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','dialstatus','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','split','varset','[%s][dials][varset]','isNil','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER'];(function(_0x53e3fa,_0x50c5f2){var _0xe8584a=function(_0x1771a5){while(--_0x1771a5){_0x53e3fa['push'](_0x53e3fa['shift']());}};_0xe8584a(++_0x50c5f2);}(_0x2c92,0x1a8));var _0x22c9=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x2c92[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0x22c9('0x0'));var util=require(_0x22c9('0x1'));var utils=require(_0x22c9('0x2'));var dials={};function writeDB(_0x33abda){utils[_0x22c9('0x3')](util['format'](_0x22c9('0x4'),_0x33abda[_0x22c9('0x5')],_0x33abda[_0x22c9('0x6')],_0x33abda[_0x22c9('0x7')],_0x33abda['calleridnum'],_0x33abda['connectedlinenum'],_0x33abda[_0x22c9('0x8')]));utils['request'](_0x22c9('0x9'),_0x33abda);delete dials[_0x33abda['uniqueid']];}exports[_0x22c9('0xa')]=function(_0x374f75){try{utils[_0x22c9('0xb')](util[_0x22c9('0xc')](_0x22c9('0xd'),_0x374f75[_0x22c9('0x5')]),_0x374f75);utils['info'](util[_0x22c9('0xc')](_0x22c9('0xe'),_0x374f75[_0x22c9('0x5')],_0x374f75[_0x22c9('0xf')],_0x374f75[_0x22c9('0x10')]));if(_0x374f75['application']['toLowerCase']()==_0x22c9('0x11')&&_[_0x22c9('0x12')](_0x374f75['appdata'][_0x22c9('0x13')](),'cdr(routeid)')){var _0x2a524c=_0x374f75[_0x22c9('0x10')][_0x22c9('0x14')]('=');dials[_0x374f75[_0x22c9('0x5')]]={'routeId':_0x2a524c[0x1]};}}catch(_0x2fc8da){utils['error'](util['format'](_0x22c9('0xd'),_0x374f75[_0x22c9('0x5')]),_0x2fc8da);}};exports[_0x22c9('0x15')]=function(_0x48213d){try{utils[_0x22c9('0xb')](util['format'](_0x22c9('0x16'),_0x48213d[_0x22c9('0x5')]),_0x48213d);if(!_[_0x22c9('0x17')](_0x48213d['variable']['outboundrouteid'])){utils[_0x22c9('0x3')](util[_0x22c9('0xc')](_0x22c9('0x18'),_0x48213d[_0x22c9('0x5')],_0x48213d[_0x22c9('0x19')]));dials[_0x48213d[_0x22c9('0x5')]]={'routeId':_0x48213d[_0x22c9('0x19')]};}}catch(_0x5b7c40){utils[_0x22c9('0x1a')](util[_0x22c9('0xc')](_0x22c9('0x16'),_0x48213d[_0x22c9('0x5')]),_0x5b7c40);}};exports[_0x22c9('0x1b')]=function(_0x2bd349){try{if(!_['isNil'](dials[_0x2bd349[_0x22c9('0x5')]])){utils[_0x22c9('0xb')](util['format'](_0x22c9('0x1c'),_0x2bd349['uniqueid']),_0x2bd349);dials[_0x2bd349[_0x22c9('0x5')]]=_[_0x22c9('0x1d')](dials[_0x2bd349[_0x22c9('0x5')]],_0x2bd349);dials[_0x2bd349[_0x22c9('0x5')]][_0x22c9('0x1e')]=utils[_0x22c9('0x1f')]();dials[_0x2bd349[_0x22c9('0x5')]]['lastevent']='called';utils[_0x22c9('0x3')](util[_0x22c9('0xc')](_0x22c9('0x20'),_0x2bd349['uniqueid'],dials[_0x2bd349[_0x22c9('0x5')]]['starttime']));}}catch(_0x2ac3bb){utils[_0x22c9('0x1a')](util[_0x22c9('0xc')]('[%s][dials][dialbegin]',_0x2bd349[_0x22c9('0x5')]),_0x2ac3bb);}};exports[_0x22c9('0x21')]=function(_0x1d3f18){try{if(!_['isNil'](dials[_0x1d3f18['uniqueid']])){utils[_0x22c9('0xb')](util['format'](_0x22c9('0x22'),_0x1d3f18[_0x22c9('0x5')]),_0x1d3f18);dials[_0x1d3f18[_0x22c9('0x5')]][_0x22c9('0x8')]=_0x1d3f18['dialstatus'];if(_0x1d3f18[_0x22c9('0x8')]==_0x22c9('0x23')){dials[_0x1d3f18[_0x22c9('0x5')]]=_['assign'](dials[_0x1d3f18[_0x22c9('0x5')]],_0x1d3f18);dials[_0x1d3f18[_0x22c9('0x5')]]['answertime']=utils['now']();dials[_0x1d3f18['uniqueid']]['lastevent']=_0x22c9('0x24');utils['info'](util[_0x22c9('0xc')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x1d3f18['uniqueid'],_0x1d3f18[_0x22c9('0x8')],dials[_0x1d3f18['uniqueid']][_0x22c9('0x25')]));}else{utils[_0x22c9('0x3')](util[_0x22c9('0xc')](_0x22c9('0x26'),_0x1d3f18[_0x22c9('0x5')],_0x1d3f18['dialstatus']));}}}catch(_0x1da48d){utils[_0x22c9('0x1a')](util[_0x22c9('0xc')](_0x22c9('0x22'),_0x1d3f18[_0x22c9('0x5')]),_0x1da48d);}};exports[_0x22c9('0x27')]=function(_0x4518f4){try{if(!_['isNil'](dials[_0x4518f4[_0x22c9('0x5')]])){utils['debug'](util[_0x22c9('0xc')]('[%s][dials][hangup]',_0x4518f4['uniqueid']),_0x4518f4);utils['info'](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x4518f4[_0x22c9('0x5')],_0x4518f4[_0x22c9('0x28')],_0x4518f4['calleridname'],_0x4518f4[_0x22c9('0x29')]));dials[_0x4518f4[_0x22c9('0x5')]]=_[_0x22c9('0x1d')](dials[_0x4518f4[_0x22c9('0x5')]],{'endtime':utils[_0x22c9('0x1f')](),'lastevent':'complete'});dials[_0x4518f4[_0x22c9('0x5')]][_0x22c9('0x2a')]=utils['diffTime'](dials[_0x4518f4[_0x22c9('0x5')]]['endtime'],dials[_0x4518f4[_0x22c9('0x5')]][_0x22c9('0x1e')]);dials[_0x4518f4[_0x22c9('0x5')]]['holdtime']=utils[_0x22c9('0x2b')](dials[_0x4518f4['uniqueid']][_0x22c9('0x25')]||dials[_0x4518f4[_0x22c9('0x5')]][_0x22c9('0x2c')],dials[_0x4518f4[_0x22c9('0x5')]][_0x22c9('0x1e')]);dials[_0x4518f4[_0x22c9('0x5')]]['billableseconds']=dials[_0x4518f4[_0x22c9('0x5')]][_0x22c9('0x25')]?utils[_0x22c9('0x2b')](dials[_0x4518f4[_0x22c9('0x5')]][_0x22c9('0x2c')],dials[_0x4518f4[_0x22c9('0x5')]]['answertime']):0x0;writeDB(dials[_0x4518f4[_0x22c9('0x5')]]);}}catch(_0x2a8c19){utils[_0x22c9('0x1a')](util['format'](_0x22c9('0x2d'),_0x4518f4[_0x22c9('0x5')]),_0x2a8c19);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 830179b..dd0c4e5 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 _0x26e0=['info','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','device','devicestatechange','format','[%s][index][devicestatechange]','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','debug','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','port','keepConnected','XDR\x20DISABLED'];(function(_0x5b4d9a,_0x5715e7){var _0x47b4a8=function(_0x1d2940){while(--_0x1d2940){_0x5b4d9a['push'](_0x5b4d9a['shift']());}};_0x47b4a8(++_0x5715e7);}(_0x26e0,0x15c));var _0x026e=function(_0x79ebc5,_0x2df5d1){_0x79ebc5=_0x79ebc5-0x0;var _0x3813b6=_0x26e0[_0x79ebc5];return _0x3813b6;};var AsteriskManager=require('asterisk-manager');var config=require(_0x026e('0x0'));var utils=require(_0x026e('0x1'));var util=require(_0x026e('0x2'));var isXDREnabled=config[_0x026e('0x3')]&&config['xdr'][_0x026e('0x4')]?!config[_0x026e('0x3')][_0x026e('0x4')]:!![];var isProduction=config[_0x026e('0x5')]===_0x026e('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x026e('0x3')][_0x026e('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x026e('0x8')][_0x026e('0x9')],config[_0x026e('0x8')]['ip'],config[_0x026e('0x8')]['username'],config[_0x026e('0x8')]['password'],!![]);ami[_0x026e('0xa')]();if(!isXDREnabled){utils['info'](_0x026e('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x026e('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x026e('0xd'));var calls=require(_0x026e('0xe'));var queues=require(_0x026e('0xf'));var recordings=require('./recordings.controller');var members=require(_0x026e('0x10'));var dials=require(_0x026e('0x11'));var transfers=require(_0x026e('0x12'));var core=require(_0x026e('0x13'));ami['on'](_0x026e('0x14'),core[_0x026e('0x14')]);ami['on'](_0x026e('0x15'),core[_0x026e('0x15')]);ami['on'](_0x026e('0x16'),core[_0x026e('0x16')]);ami['on']('error',core[_0x026e('0x17')]);ami['on'](_0x026e('0x18'),core[_0x026e('0x18')]);ami['on'](_0x026e('0x19'),core[_0x026e('0x19')]);ami['on']('devicestatechange',function(_0x4075d6){try{utils['debug'](util['format']('[%s][index][devicestatechange]',_0x4075d6[_0x026e('0x1a')]),_0x4075d6);members[_0x026e('0x1b')](_0x4075d6);}catch(_0x45d9b3){utils['error'](util[_0x026e('0x1c')](_0x026e('0x1d'),_0x4075d6[_0x026e('0x1a')]),_0x45d9b3);}});ami['on'](_0x026e('0x1e'),function(_0x53e87c){try{utils['debug'](util[_0x026e('0x1c')]('[%s][index][agentcalled]',_0x53e87c[_0x026e('0x1f')]),_0x53e87c);agents[_0x026e('0x1e')](_0x53e87c);}catch(_0x10d6e1){utils[_0x026e('0x17')](util[_0x026e('0x1c')](_0x026e('0x20'),_0x53e87c['uniqueid']),_0x10d6e1);}});ami['on'](_0x026e('0x21'),function(_0x1c18d4){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')]('[%s][index][agentringnoanswer]',_0x1c18d4[_0x026e('0x1f')]),_0x1c18d4);agents[_0x026e('0x21')](_0x1c18d4);}catch(_0x590082){utils['error'](util[_0x026e('0x1c')](_0x026e('0x23'),_0x1c18d4[_0x026e('0x1f')]),_0x590082);}});ami['on']('agentconnect',function(_0x1f5886){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')]('[%s][index][agentconnect]',_0x1f5886['uniqueid']),_0x1f5886);agents[_0x026e('0x24')](_0x1f5886);queues[_0x026e('0x24')](_0x1f5886);}catch(_0x5872b3){utils[_0x026e('0x17')](util[_0x026e('0x1c')](_0x026e('0x25'),_0x1f5886[_0x026e('0x1f')]),_0x5872b3);}});ami['on'](_0x026e('0x26'),function(_0x356cc3){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')](_0x026e('0x27'),_0x356cc3[_0x026e('0x1f')]),_0x356cc3);agents[_0x026e('0x26')](_0x356cc3);queues['agentcomplete'](_0x356cc3);members[_0x026e('0x26')](_0x356cc3);}catch(_0x2cb6cb){utils[_0x026e('0x17')](util[_0x026e('0x1c')](_0x026e('0x27'),_0x356cc3[_0x026e('0x1f')]),_0x2cb6cb);}});ami['on'](_0x026e('0x28'),function(_0x567f38){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')](_0x026e('0x29'),_0x567f38[_0x026e('0x1f')]),_0x567f38);agents['queuecallerabandon'](_0x567f38);queues[_0x026e('0x28')](_0x567f38);}catch(_0x5cd462){utils['error'](util[_0x026e('0x1c')](_0x026e('0x29'),_0x567f38[_0x026e('0x1f')]),_0x5cd462);}});ami['on']('queuecallerjoin',function(_0x1c17ea){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')](_0x026e('0x2a'),_0x1c17ea[_0x026e('0x1f')]),_0x1c17ea);queues[_0x026e('0x2b')](_0x1c17ea);recordings['queuecallerjoin'](_0x1c17ea);}catch(_0x258c24){utils[_0x026e('0x17')](util['format'](_0x026e('0x2a'),_0x1c17ea[_0x026e('0x1f')]),_0x258c24);}});ami['on']('queuecallerleave',function(_0x28ecc6){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')](_0x026e('0x2c'),_0x28ecc6[_0x026e('0x1f')]),_0x28ecc6);queues[_0x026e('0x2d')](_0x28ecc6);}catch(_0x2a2791){utils[_0x026e('0x17')](util[_0x026e('0x1c')](_0x026e('0x2c'),_0x28ecc6['uniqueid']),_0x2a2791);}});ami['on'](_0x026e('0x2e'),function(_0x3cfa13){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')](_0x026e('0x2f'),_0x3cfa13[_0x026e('0x1f')]),_0x3cfa13);queues[_0x026e('0x2e')](_0x3cfa13);calls[_0x026e('0x2e')](_0x3cfa13);}catch(_0x52d3fa){utils[_0x026e('0x17')](util[_0x026e('0x1c')](_0x026e('0x2f'),_0x3cfa13[_0x026e('0x1f')]),_0x52d3fa);}});ami['on'](_0x026e('0x30'),function(_0x34480a){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')](_0x026e('0x31'),_0x34480a[_0x026e('0x1f')]),_0x34480a);queues[_0x026e('0x30')](_0x34480a);calls[_0x026e('0x30')](_0x34480a);}catch(_0x20411a){utils['error'](util[_0x026e('0x1c')](_0x026e('0x31'),_0x34480a[_0x026e('0x1f')]),_0x20411a);}});ami['on'](_0x026e('0x32'),function(_0x19a682){try{utils[_0x026e('0x22')](util['format'](_0x026e('0x33'),_0x19a682[_0x026e('0x1f')]),_0x19a682);calls['newstate'](_0x19a682);recordings[_0x026e('0x32')](_0x19a682);}catch(_0x258321){utils[_0x026e('0x17')](util[_0x026e('0x1c')](_0x026e('0x33'),_0x19a682[_0x026e('0x1f')]),_0x258321);}});ami['on']('hangup',function(_0x4fffa6){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')](_0x026e('0x34'),_0x4fffa6['uniqueid']),_0x4fffa6);calls[_0x026e('0x35')](_0x4fffa6);recordings['hangup'](_0x4fffa6);dials[_0x026e('0x35')](_0x4fffa6);agents[_0x026e('0x35')](_0x4fffa6);queues[_0x026e('0x35')](_0x4fffa6);}catch(_0x25692f){utils[_0x026e('0x17')](util['format']('[%s][index][hangup]',_0x4fffa6[_0x026e('0x1f')]),_0x25692f);}});ami['on'](_0x026e('0x36'),function(_0x3f64eb){try{utils['debug'](util[_0x026e('0x1c')](_0x026e('0x37'),_0x3f64eb[_0x026e('0x1f')]),_0x3f64eb);members[_0x026e('0x36')](_0x3f64eb);}catch(_0x17f981){utils[_0x026e('0x17')](util[_0x026e('0x1c')](_0x026e('0x37'),_0x3f64eb[_0x026e('0x1f')]),_0x17f981);}});ami['on'](_0x026e('0x38'),function(_0x1d43ab){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')]('[%s][index][blindtransfer]',_0x1d43ab['uniqueid']),_0x1d43ab);queues[_0x026e('0x38')](_0x1d43ab);agents[_0x026e('0x38')](_0x1d43ab);transfers[_0x026e('0x38')](_0x1d43ab);recordings[_0x026e('0x38')](_0x1d43ab);}catch(_0x5f26d5){utils[_0x026e('0x17')](util['format'](_0x026e('0x39'),_0x1d43ab[_0x026e('0x1f')]),_0x5f26d5);}});ami['on'](_0x026e('0x3a'),function(_0x41686b){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')](_0x026e('0x3b'),_0x41686b[_0x026e('0x3c')]),_0x41686b);queues[_0x026e('0x3a')](_0x41686b);transfers[_0x026e('0x3a')](_0x41686b);agents[_0x026e('0x3a')](_0x41686b);calls['attendedtransfer'](_0x41686b);}catch(_0x3e5135){utils['error'](util[_0x026e('0x1c')](_0x026e('0x3b'),_0x41686b[_0x026e('0x3c')]),_0x3e5135);}});ami['on'](_0x026e('0x3d'),function(_0x547ec6){try{utils[_0x026e('0x22')](util['format'](_0x026e('0x3e'),_0x547ec6['uniqueid']),_0x547ec6);queues[_0x026e('0x3d')](_0x547ec6);recordings[_0x026e('0x3d')](_0x547ec6);calls['varset'](_0x547ec6);dials[_0x026e('0x3d')](_0x547ec6);}catch(_0x4f272d){utils[_0x026e('0x17')](util[_0x026e('0x1c')](_0x026e('0x3e'),_0x547ec6[_0x026e('0x1f')]),_0x4f272d);}});ami['on'](_0x026e('0x3f'),function(_0x344514){try{utils[_0x026e('0x22')](util['format'](_0x026e('0x40'),_0x344514[_0x026e('0x1f')]),_0x344514);calls[_0x026e('0x3f')](_0x344514);recordings['newexten'](_0x344514);dials[_0x026e('0x3f')](_0x344514);}catch(_0x5ec445){utils[_0x026e('0x17')](util[_0x026e('0x1c')]('[%s][index][newexten]',_0x344514[_0x026e('0x1f')]),_0x5ec445);}});ami['on'](_0x026e('0x41'),function(_0x32a263){try{utils[_0x026e('0x22')](util['format']('[%s][index][newchannel]',_0x32a263[_0x026e('0x1f')]),_0x32a263);calls[_0x026e('0x41')](_0x32a263);recordings[_0x026e('0x41')](_0x32a263);}catch(_0x2490b3){utils['error'](util['format'](_0x026e('0x42'),_0x32a263[_0x026e('0x1f')]),_0x2490b3);}});ami['on'](_0x026e('0x43'),function(_0x201af8){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')](_0x026e('0x44'),_0x201af8[_0x026e('0x1f')]),_0x201af8);dials[_0x026e('0x43')](_0x201af8);}catch(_0x5d4a92){utils[_0x026e('0x17')](util[_0x026e('0x1c')](_0x026e('0x45'),_0x201af8[_0x026e('0x1f')]),_0x5d4a92);}});ami['on'](_0x026e('0x46'),function(_0x320269){try{utils[_0x026e('0x22')](util[_0x026e('0x1c')](_0x026e('0x47'),_0x320269[_0x026e('0x1f')]),_0x320269);dials[_0x026e('0x46')](_0x320269);}catch(_0x48bbe6){utils[_0x026e('0x17')](util[_0x026e('0x1c')](_0x026e('0x47'),_0x320269['uniqueid']),_0x48bbe6);}});} \ No newline at end of file +var _0xebc8=['newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','disabled','env','production','local','port','asterisk','username','password','keepConnected','XDR\x20DISABLED','./calls.controller','./queues.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][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]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]'];(function(_0x25f8d9,_0x5e97d6){var _0x5dff7f=function(_0x4a895c){while(--_0x4a895c){_0x25f8d9['push'](_0x25f8d9['shift']());}};_0x5dff7f(++_0x5e97d6);}(_0xebc8,0x1e3));var _0x8ebc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xebc8[_0x14add3];return _0x4a174f;};var AsteriskManager=require(_0x8ebc('0x0'));var config=require(_0x8ebc('0x1'));var utils=require(_0x8ebc('0x2'));var util=require('util');var isXDREnabled=config[_0x8ebc('0x3')]&&config[_0x8ebc('0x3')][_0x8ebc('0x4')]?!config[_0x8ebc('0x3')][_0x8ebc('0x4')]:!![];var isProduction=config[_0x8ebc('0x5')]===_0x8ebc('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x8ebc('0x3')][_0x8ebc('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x8ebc('0x8')],config[_0x8ebc('0x9')]['ip'],config[_0x8ebc('0x9')][_0x8ebc('0xa')],config[_0x8ebc('0x9')][_0x8ebc('0xb')],!![]);ami[_0x8ebc('0xc')]();if(!isXDREnabled){utils['info'](_0x8ebc('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require(_0x8ebc('0xe'));var queues=require(_0x8ebc('0xf'));var recordings=require('./recordings.controller');var members=require(_0x8ebc('0x10'));var dials=require(_0x8ebc('0x11'));var transfers=require('./transfers.controller');var core=require(_0x8ebc('0x12'));ami['on']('connect',core[_0x8ebc('0x13')]);ami['on'](_0x8ebc('0x14'),core[_0x8ebc('0x14')]);ami['on'](_0x8ebc('0x15'),core['fullybooted']);ami['on'](_0x8ebc('0x16'),core[_0x8ebc('0x16')]);ami['on'](_0x8ebc('0x17'),core[_0x8ebc('0x17')]);ami['on']('managerevent',core[_0x8ebc('0x18')]);ami['on'](_0x8ebc('0x19'),function(_0x40e1eb){try{utils[_0x8ebc('0x1a')](util[_0x8ebc('0x1b')](_0x8ebc('0x1c'),_0x40e1eb[_0x8ebc('0x1d')]),_0x40e1eb);members[_0x8ebc('0x19')](_0x40e1eb);}catch(_0x43b5cf){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')](_0x8ebc('0x1c'),_0x40e1eb['device']),_0x43b5cf);}});ami['on']('agentcalled',function(_0x5d081c){try{utils[_0x8ebc('0x1a')](util['format'](_0x8ebc('0x1e'),_0x5d081c['uniqueid']),_0x5d081c);agents['agentcalled'](_0x5d081c);}catch(_0x56e85c){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')]('[%s][index][agentcalled]',_0x5d081c[_0x8ebc('0x1f')]),_0x56e85c);}});ami['on'](_0x8ebc('0x20'),function(_0x3077ac){try{utils[_0x8ebc('0x1a')](util['format'](_0x8ebc('0x21'),_0x3077ac[_0x8ebc('0x1f')]),_0x3077ac);agents[_0x8ebc('0x20')](_0x3077ac);}catch(_0x2c4a52){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')]('[%s][index][agentringnoanswer]',_0x3077ac[_0x8ebc('0x1f')]),_0x2c4a52);}});ami['on'](_0x8ebc('0x22'),function(_0x2752bd){try{utils[_0x8ebc('0x1a')](util[_0x8ebc('0x1b')](_0x8ebc('0x23'),_0x2752bd[_0x8ebc('0x1f')]),_0x2752bd);agents[_0x8ebc('0x22')](_0x2752bd);queues[_0x8ebc('0x22')](_0x2752bd);}catch(_0x45813c){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')](_0x8ebc('0x23'),_0x2752bd[_0x8ebc('0x1f')]),_0x45813c);}});ami['on'](_0x8ebc('0x24'),function(_0x7d1283){try{utils['debug'](util[_0x8ebc('0x1b')]('[%s][index][agentcomplete]',_0x7d1283[_0x8ebc('0x1f')]),_0x7d1283);agents[_0x8ebc('0x24')](_0x7d1283);queues[_0x8ebc('0x24')](_0x7d1283);members[_0x8ebc('0x24')](_0x7d1283);}catch(_0x5877aa){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')]('[%s][index][agentcomplete]',_0x7d1283[_0x8ebc('0x1f')]),_0x5877aa);}});ami['on']('queuecallerabandon',function(_0x521db4){try{utils[_0x8ebc('0x1a')](util[_0x8ebc('0x1b')](_0x8ebc('0x25'),_0x521db4['uniqueid']),_0x521db4);agents[_0x8ebc('0x26')](_0x521db4);queues[_0x8ebc('0x26')](_0x521db4);}catch(_0x209fb1){utils['error'](util[_0x8ebc('0x1b')](_0x8ebc('0x25'),_0x521db4['uniqueid']),_0x209fb1);}});ami['on'](_0x8ebc('0x27'),function(_0x18c124){try{utils['debug'](util[_0x8ebc('0x1b')]('[%s][index][queuecallerjoin]',_0x18c124[_0x8ebc('0x1f')]),_0x18c124);queues[_0x8ebc('0x27')](_0x18c124);recordings[_0x8ebc('0x27')](_0x18c124);}catch(_0x31e1fd){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')](_0x8ebc('0x28'),_0x18c124[_0x8ebc('0x1f')]),_0x31e1fd);}});ami['on'](_0x8ebc('0x29'),function(_0x1e520f){try{utils[_0x8ebc('0x1a')](util[_0x8ebc('0x1b')](_0x8ebc('0x2a'),_0x1e520f[_0x8ebc('0x1f')]),_0x1e520f);queues[_0x8ebc('0x29')](_0x1e520f);}catch(_0x143c3c){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')](_0x8ebc('0x2a'),_0x1e520f[_0x8ebc('0x1f')]),_0x143c3c);}});ami['on'](_0x8ebc('0x2b'),function(_0x3dd9a9){try{utils[_0x8ebc('0x1a')](util[_0x8ebc('0x1b')](_0x8ebc('0x2c'),_0x3dd9a9[_0x8ebc('0x1f')]),_0x3dd9a9);queues[_0x8ebc('0x2b')](_0x3dd9a9);calls[_0x8ebc('0x2b')](_0x3dd9a9);}catch(_0x557964){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')](_0x8ebc('0x2c'),_0x3dd9a9['uniqueid']),_0x557964);}});ami['on'](_0x8ebc('0x2d'),function(_0x33e6cc){try{utils['debug'](util[_0x8ebc('0x1b')](_0x8ebc('0x2e'),_0x33e6cc['uniqueid']),_0x33e6cc);queues[_0x8ebc('0x2d')](_0x33e6cc);calls[_0x8ebc('0x2d')](_0x33e6cc);}catch(_0x411940){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')](_0x8ebc('0x2e'),_0x33e6cc[_0x8ebc('0x1f')]),_0x411940);}});ami['on']('newstate',function(_0x301e32){try{utils[_0x8ebc('0x1a')](util[_0x8ebc('0x1b')](_0x8ebc('0x2f'),_0x301e32[_0x8ebc('0x1f')]),_0x301e32);calls[_0x8ebc('0x30')](_0x301e32);recordings[_0x8ebc('0x30')](_0x301e32);}catch(_0x3151ef){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')](_0x8ebc('0x2f'),_0x301e32[_0x8ebc('0x1f')]),_0x3151ef);}});ami['on'](_0x8ebc('0x31'),function(_0x2d296f){try{utils['debug'](util[_0x8ebc('0x1b')](_0x8ebc('0x32'),_0x2d296f[_0x8ebc('0x1f')]),_0x2d296f);calls['hangup'](_0x2d296f);recordings['hangup'](_0x2d296f);dials[_0x8ebc('0x31')](_0x2d296f);agents[_0x8ebc('0x31')](_0x2d296f);queues['hangup'](_0x2d296f);}catch(_0x54b566){utils[_0x8ebc('0x16')](util['format'](_0x8ebc('0x32'),_0x2d296f[_0x8ebc('0x1f')]),_0x54b566);}});ami['on'](_0x8ebc('0x33'),function(_0x1889a8){try{utils[_0x8ebc('0x1a')](util['format'](_0x8ebc('0x34'),_0x1889a8[_0x8ebc('0x1f')]),_0x1889a8);members['cdr'](_0x1889a8);}catch(_0xdc946a){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')](_0x8ebc('0x34'),_0x1889a8[_0x8ebc('0x1f')]),_0xdc946a);}});ami['on']('blindtransfer',function(_0x296826){try{utils['debug'](util[_0x8ebc('0x1b')]('[%s][index][blindtransfer]',_0x296826[_0x8ebc('0x1f')]),_0x296826);queues[_0x8ebc('0x35')](_0x296826);agents[_0x8ebc('0x35')](_0x296826);transfers['blindtransfer'](_0x296826);recordings[_0x8ebc('0x35')](_0x296826);}catch(_0xfd980f){utils[_0x8ebc('0x16')](util['format'](_0x8ebc('0x36'),_0x296826[_0x8ebc('0x1f')]),_0xfd980f);}});ami['on'](_0x8ebc('0x37'),function(_0x80f65e){try{utils[_0x8ebc('0x1a')](util['format'](_0x8ebc('0x38'),_0x80f65e[_0x8ebc('0x39')]),_0x80f65e);queues[_0x8ebc('0x37')](_0x80f65e);transfers[_0x8ebc('0x37')](_0x80f65e);agents['attendedtransfer'](_0x80f65e);calls[_0x8ebc('0x37')](_0x80f65e);}catch(_0x105ac7){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')](_0x8ebc('0x38'),_0x80f65e[_0x8ebc('0x39')]),_0x105ac7);}});ami['on'](_0x8ebc('0x3a'),function(_0x53fc9c){try{utils[_0x8ebc('0x1a')](util[_0x8ebc('0x1b')](_0x8ebc('0x3b'),_0x53fc9c[_0x8ebc('0x1f')]),_0x53fc9c);queues[_0x8ebc('0x3a')](_0x53fc9c);recordings[_0x8ebc('0x3a')](_0x53fc9c);calls['varset'](_0x53fc9c);dials[_0x8ebc('0x3a')](_0x53fc9c);}catch(_0x46ac75){utils['error'](util[_0x8ebc('0x1b')]('[%s][index][varset]',_0x53fc9c['uniqueid']),_0x46ac75);}});ami['on']('newexten',function(_0x199322){try{utils[_0x8ebc('0x1a')](util[_0x8ebc('0x1b')](_0x8ebc('0x3c'),_0x199322[_0x8ebc('0x1f')]),_0x199322);calls['newexten'](_0x199322);recordings[_0x8ebc('0x3d')](_0x199322);dials[_0x8ebc('0x3d')](_0x199322);}catch(_0x2ebeca){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')]('[%s][index][newexten]',_0x199322[_0x8ebc('0x1f')]),_0x2ebeca);}});ami['on'](_0x8ebc('0x3e'),function(_0x51beb5){try{utils[_0x8ebc('0x1a')](util['format'](_0x8ebc('0x3f'),_0x51beb5['uniqueid']),_0x51beb5);calls[_0x8ebc('0x3e')](_0x51beb5);recordings[_0x8ebc('0x3e')](_0x51beb5);}catch(_0x3ec91c){utils[_0x8ebc('0x16')](util['format'](_0x8ebc('0x3f'),_0x51beb5[_0x8ebc('0x1f')]),_0x3ec91c);}});ami['on'](_0x8ebc('0x40'),function(_0x9f7fe1){try{utils[_0x8ebc('0x1a')](util['format'](_0x8ebc('0x41'),_0x9f7fe1[_0x8ebc('0x1f')]),_0x9f7fe1);dials[_0x8ebc('0x40')](_0x9f7fe1);}catch(_0x2afea1){utils[_0x8ebc('0x16')](util[_0x8ebc('0x1b')]('[%s]dialbegin',_0x9f7fe1[_0x8ebc('0x1f')]),_0x2afea1);}});ami['on'](_0x8ebc('0x42'),function(_0x415854){try{utils[_0x8ebc('0x1a')](util['format'](_0x8ebc('0x43'),_0x415854[_0x8ebc('0x1f')]),_0x415854);dials[_0x8ebc('0x42')](_0x415854);}catch(_0x4aa95c){utils['error'](util['format'](_0x8ebc('0x43'),_0x415854[_0x8ebc('0x1f')]),_0x4aa95c);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index c0def9d..6fb868a 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 _0xba78=['split','assign','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','type','source','lodash','./utils','Local/_attended@transfer','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','data2','membername','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','catch','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','format','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','voice','TALKING','agent','NOT_INUSE','exitAt','duration','diffTime','error','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','channel'];(function(_0x417855,_0x4ab5ae){var _0x502c30=function(_0x498357){while(--_0x498357){_0x417855['push'](_0x417855['shift']());}};_0x502c30(++_0x4ab5ae);}(_0xba78,0x159));var _0x8ba7=function(_0x58acc1,_0x211dec){_0x58acc1=_0x58acc1-0x0;var _0x45459f=_0xba78[_0x58acc1];return _0x45459f;};'use strict';var _=require(_0x8ba7('0x0'));var util=require('util');var utils=require(_0x8ba7('0x1'));var members={};var exclude=[_0x8ba7('0x2'),'Queue:'];function writeDB(_0x17cd05){utils['info'](util['format'](_0x8ba7('0x3'),_0x17cd05[_0x8ba7('0x4')],_0x17cd05['interface'],_0x17cd05['channel'],_0x17cd05[_0x8ba7('0x5')],_0x17cd05[_0x8ba7('0x6')],_0x17cd05['type']));if(_0x17cd05[_0x8ba7('0x7')]){utils[_0x8ba7('0x8')](_0x17cd05[_0x8ba7('0x7')])[_0x8ba7('0x9')](function(_0x27eb9b){if(_0x27eb9b){_0x17cd05['membername']=_0x27eb9b[_0x8ba7('0xa')];_0x17cd05[_0x8ba7('0xb')]=_0x27eb9b[_0x8ba7('0xb')];utils[_0x8ba7('0xc')](_0x8ba7('0xd'),_0x17cd05);}else{utils['getUserByName'](_0x17cd05[_0x8ba7('0x7')]['split']('/')[0x1])[_0x8ba7('0x9')](function(_0x2467b5){if(_0x2467b5){_0x17cd05[_0x8ba7('0x6')]=_0x2467b5[_0x8ba7('0xa')];_0x17cd05[_0x8ba7('0xb')]=_0x2467b5[_0x8ba7('0xb')];utils[_0x8ba7('0xc')]('CreateMemberReport',_0x17cd05);}});}})[_0x8ba7('0xe')](function(_0x1f3410){utils['error'](util['format'](_0x8ba7('0xf'),_0x17cd05[_0x8ba7('0x4')]),_0x1f3410);});}delete members[_0x17cd05[_0x8ba7('0x7')]];}function startsWith(_0x5c8e9e,_0x38f4bc){return _[_0x8ba7('0x10')](_0x5c8e9e,function(_0xe4cd10){return _[_0x8ba7('0x11')](_0x38f4bc,_0xe4cd10);});}exports[_0x8ba7('0x12')]=function(_0x554991){try{utils[_0x8ba7('0x13')](util[_0x8ba7('0x14')]('[%s][members][devicestatechange]',members[_0x554991[_0x8ba7('0x15')]]?members[_0x554991[_0x8ba7('0x15')]][_0x8ba7('0x4')]:_0x554991[_0x8ba7('0x15')]),_0x554991);utils[_0x8ba7('0x16')](util[_0x8ba7('0x14')](_0x8ba7('0x17'),members[_0x554991[_0x8ba7('0x15')]]?members[_0x554991[_0x8ba7('0x15')]][_0x8ba7('0x4')]:_0x554991[_0x8ba7('0x15')],_0x554991['state'],_0x554991[_0x8ba7('0x15')]));switch(_0x554991[_0x8ba7('0x18')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x554991[_0x8ba7('0x15')])){members[_0x554991[_0x8ba7('0x15')]]={'channel':_0x8ba7('0x19'),'interface':_0x554991['device'],'type':_0x8ba7('0x1a'),'enterAt':utils['now'](),'role':_0x8ba7('0x1b')};}break;case _0x8ba7('0x1c'):if(!_['isNil'](members[_0x554991[_0x8ba7('0x15')]])){members[_0x554991[_0x8ba7('0x15')]][_0x8ba7('0x1d')]=utils['now']();members[_0x554991['device']][_0x8ba7('0x1e')]=utils[_0x8ba7('0x1f')](members[_0x554991['device']]['exitAt'],members[_0x554991[_0x8ba7('0x15')]]['enterAt']);if(members[_0x554991[_0x8ba7('0x15')]][_0x8ba7('0x4')]){writeDB(members[_0x554991[_0x8ba7('0x15')]]);}}break;default:break;}}catch(_0x3c2718){utils[_0x8ba7('0x20')](util[_0x8ba7('0x14')]('[%s][members][devicestatechange]',members[_0x554991[_0x8ba7('0x15')]]?members[_0x554991[_0x8ba7('0x15')]]['uniqueid']:_0x554991[_0x8ba7('0x15')]),_0x3c2718);}};exports['agentcomplete']=function(_0x515444){try{if(!_[_0x8ba7('0x21')](members[_0x515444['interface']])){utils['debug'](util[_0x8ba7('0x14')](_0x8ba7('0x22'),_0x515444[_0x8ba7('0x4')]),_0x515444);utils[_0x8ba7('0x16')](util[_0x8ba7('0x14')](_0x8ba7('0x23'),_0x515444[_0x8ba7('0x4')],_0x515444[_0x8ba7('0x7')],_0x515444[_0x8ba7('0x24')]));members[_0x515444[_0x8ba7('0x7')]]=_['assign'](members[_0x515444[_0x8ba7('0x7')]],{'data4':_0x515444[_0x8ba7('0x24')],'uniqueid':_0x515444['uniqueid']});}}catch(_0x2b289b){utils[_0x8ba7('0x20')](util[_0x8ba7('0x14')]('[%s][members][agentcomplete]',_0x515444['uniqueid']),_0x2b289b);}};exports[_0x8ba7('0x25')]=function(_0x240f68){try{utils[_0x8ba7('0x13')](util[_0x8ba7('0x14')]('[%s][members][cdr]',_0x240f68['uniqueid']),_0x240f68);if(_0x240f68[_0x8ba7('0x26')]){var _0x2d731e=_0x240f68[_0x8ba7('0x26')][_0x8ba7('0x27')]('-')[0x0];if(!_[_0x8ba7('0x21')](members[_0x2d731e])){members[_0x2d731e]=_[_0x8ba7('0x28')](members[_0x2d731e],{'data1':members[_0x2d731e][_0x8ba7('0x29')]||_0x240f68['type'],'data2':members[_0x2d731e][_0x8ba7('0x5')]||_0x240f68['source'],'data3':members[_0x2d731e][_0x8ba7('0x2a')]||_0x240f68[_0x8ba7('0x2b')],'uniqueid':members[_0x2d731e][_0x8ba7('0x4')]||_0x240f68[_0x8ba7('0x4')]});utils[_0x8ba7('0x16')](util[_0x8ba7('0x14')](_0x8ba7('0x2c'),_0x240f68[_0x8ba7('0x4')],members[_0x2d731e]['data1'],members[_0x2d731e][_0x8ba7('0x5')],members[_0x2d731e][_0x8ba7('0x2a')]));if(members[_0x2d731e][_0x8ba7('0x1d')]){writeDB(members[_0x2d731e]);}}}if(_0x240f68[_0x8ba7('0x2d')]){var _0x3e8159=_0x240f68[_0x8ba7('0x2d')][_0x8ba7('0x27')]('-')[0x0];if(!_[_0x8ba7('0x21')](members[_0x3e8159])){members[_0x3e8159]=_[_0x8ba7('0x28')](members[_0x3e8159],{'data1':members[_0x3e8159][_0x8ba7('0x29')]||_0x240f68[_0x8ba7('0x2e')],'data2':members[_0x3e8159][_0x8ba7('0x5')]||_0x240f68[_0x8ba7('0x2f')],'data3':members[_0x3e8159][_0x8ba7('0x2a')]||_0x240f68[_0x8ba7('0x2b')],'uniqueid':members[_0x3e8159][_0x8ba7('0x4')]||_0x240f68[_0x8ba7('0x4')]});utils['info'](util[_0x8ba7('0x14')](_0x8ba7('0x2c'),_0x240f68['uniqueid'],members[_0x3e8159][_0x8ba7('0x29')],members[_0x3e8159][_0x8ba7('0x5')],members[_0x3e8159][_0x8ba7('0x2a')]));if(members[_0x3e8159]['exitAt']){writeDB(members[_0x3e8159]);}}}}catch(_0x13fcbd){utils['error'](util[_0x8ba7('0x14')]('[%s][members][cdr]',_0x240f68[_0x8ba7('0x4')]),_0x13fcbd);}}; \ No newline at end of file +var _0x1542=['data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','split','lodash','util','./utils','Local/_attended@transfer','Queue:','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','getUserByInterface','internal','request','getUserByName','name','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','format','[%s][members][devicestatechange]','device','info','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','duration','diffTime','exitAt','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','channel','assign'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1542,0x73));var _0x2154=function(_0x147c3d,_0x47c7b2){_0x147c3d=_0x147c3d-0x0;var _0x19ee64=_0x1542[_0x147c3d];return _0x19ee64;};'use strict';var _=require(_0x2154('0x0'));var util=require(_0x2154('0x1'));var utils=require(_0x2154('0x2'));var members={};var exclude=[_0x2154('0x3'),_0x2154('0x4')];function writeDB(_0x528747){utils['info'](util['format'](_0x2154('0x5'),_0x528747[_0x2154('0x6')],_0x528747[_0x2154('0x7')],_0x528747['channel'],_0x528747[_0x2154('0x8')],_0x528747[_0x2154('0x9')],_0x528747['type']));if(_0x528747[_0x2154('0x7')]){utils[_0x2154('0xa')](_0x528747[_0x2154('0x7')])['then'](function(_0x2242f8){if(_0x2242f8){_0x528747['membername']=_0x2242f8['name'];_0x528747[_0x2154('0xb')]=_0x2242f8['internal'];utils[_0x2154('0xc')]('CreateMemberReport',_0x528747);}else{utils[_0x2154('0xd')](_0x528747['interface']['split']('/')[0x1])['then'](function(_0x5a2ba3){if(_0x5a2ba3){_0x528747[_0x2154('0x9')]=_0x5a2ba3[_0x2154('0xe')];_0x528747[_0x2154('0xb')]=_0x5a2ba3['internal'];utils[_0x2154('0xc')](_0x2154('0xf'),_0x528747);}});}})[_0x2154('0x10')](function(_0x20acd5){utils[_0x2154('0x11')](util['format'](_0x2154('0x12'),_0x528747[_0x2154('0x6')]),_0x20acd5);});}delete members[_0x528747['interface']];}function startsWith(_0x2a3df1,_0x33edb8){return _[_0x2154('0x13')](_0x2a3df1,function(_0x4a2735){return _[_0x2154('0x14')](_0x33edb8,_0x4a2735);});}exports[_0x2154('0x15')]=function(_0x5ca236){try{utils[_0x2154('0x16')](util[_0x2154('0x17')](_0x2154('0x18'),members[_0x5ca236['device']]?members[_0x5ca236['device']]['uniqueid']:_0x5ca236[_0x2154('0x19')]),_0x5ca236);utils[_0x2154('0x1a')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x5ca236[_0x2154('0x19')]]?members[_0x5ca236[_0x2154('0x19')]][_0x2154('0x6')]:_0x5ca236[_0x2154('0x19')],_0x5ca236[_0x2154('0x1b')],_0x5ca236[_0x2154('0x19')]));switch(_0x5ca236['state']){case _0x2154('0x1c'):case _0x2154('0x1d'):if(!startsWith(exclude,_0x5ca236['device'])){members[_0x5ca236['device']]={'channel':'voice','interface':_0x5ca236['device'],'type':_0x2154('0x1e'),'enterAt':utils[_0x2154('0x1f')](),'role':_0x2154('0x20')};}break;case _0x2154('0x21'):if(!_['isNil'](members[_0x5ca236[_0x2154('0x19')]])){members[_0x5ca236[_0x2154('0x19')]]['exitAt']=utils[_0x2154('0x1f')]();members[_0x5ca236[_0x2154('0x19')]][_0x2154('0x22')]=utils[_0x2154('0x23')](members[_0x5ca236[_0x2154('0x19')]][_0x2154('0x24')],members[_0x5ca236[_0x2154('0x19')]][_0x2154('0x25')]);if(members[_0x5ca236['device']][_0x2154('0x6')]){writeDB(members[_0x5ca236['device']]);}}break;default:break;}}catch(_0x56a1bf){utils[_0x2154('0x11')](util[_0x2154('0x17')]('[%s][members][devicestatechange]',members[_0x5ca236[_0x2154('0x19')]]?members[_0x5ca236[_0x2154('0x19')]]['uniqueid']:_0x5ca236['device']),_0x56a1bf);}};exports[_0x2154('0x26')]=function(_0x546006){try{if(!_[_0x2154('0x27')](members[_0x546006[_0x2154('0x7')]])){utils[_0x2154('0x16')](util[_0x2154('0x17')]('[%s][members][agentcomplete]',_0x546006['uniqueid']),_0x546006);utils['info'](util[_0x2154('0x17')](_0x2154('0x28'),_0x546006[_0x2154('0x6')],_0x546006[_0x2154('0x7')],_0x546006['queue']));members[_0x546006[_0x2154('0x7')]]=_['assign'](members[_0x546006[_0x2154('0x7')]],{'data4':_0x546006[_0x2154('0x29')],'uniqueid':_0x546006[_0x2154('0x6')]});}}catch(_0x183bba){utils['error'](util['format'](_0x2154('0x2a'),_0x546006[_0x2154('0x6')]),_0x183bba);}};exports[_0x2154('0x2b')]=function(_0x2520de){try{utils[_0x2154('0x16')](util[_0x2154('0x17')](_0x2154('0x2c'),_0x2520de['uniqueid']),_0x2520de);if(_0x2520de[_0x2154('0x2d')]){var _0x5c21fe=_0x2520de['channel']['split']('-')[0x0];if(!_[_0x2154('0x27')](members[_0x5c21fe])){members[_0x5c21fe]=_[_0x2154('0x2e')](members[_0x5c21fe],{'data1':members[_0x5c21fe][_0x2154('0x2f')]||_0x2520de[_0x2154('0x30')],'data2':members[_0x5c21fe]['data2']||_0x2520de[_0x2154('0x31')],'data3':members[_0x5c21fe][_0x2154('0x32')]||_0x2520de[_0x2154('0x33')],'uniqueid':members[_0x5c21fe]['uniqueid']||_0x2520de[_0x2154('0x6')]});utils['info'](util[_0x2154('0x17')](_0x2154('0x34'),_0x2520de[_0x2154('0x6')],members[_0x5c21fe][_0x2154('0x2f')],members[_0x5c21fe]['data2'],members[_0x5c21fe]['data3']));if(members[_0x5c21fe][_0x2154('0x24')]){writeDB(members[_0x5c21fe]);}}}if(_0x2520de['destinationchannel']){var _0x2ae32d=_0x2520de['destinationchannel'][_0x2154('0x35')]('-')[0x0];if(!_[_0x2154('0x27')](members[_0x2ae32d])){members[_0x2ae32d]=_[_0x2154('0x2e')](members[_0x2ae32d],{'data1':members[_0x2ae32d][_0x2154('0x2f')]||_0x2520de['type'],'data2':members[_0x2ae32d][_0x2154('0x8')]||_0x2520de['source'],'data3':members[_0x2ae32d][_0x2154('0x32')]||_0x2520de[_0x2154('0x33')],'uniqueid':members[_0x2ae32d][_0x2154('0x6')]||_0x2520de[_0x2154('0x6')]});utils['info'](util[_0x2154('0x17')](_0x2154('0x34'),_0x2520de[_0x2154('0x6')],members[_0x2ae32d][_0x2154('0x2f')],members[_0x2ae32d]['data2'],members[_0x2ae32d][_0x2154('0x32')]));if(members[_0x2ae32d]['exitAt']){writeDB(members[_0x2ae32d]);}}}}catch(_0xecb02b){utils[_0x2154('0x11')](util[_0x2154('0x17')](_0x2154('0x2c'),_0x2520de['uniqueid']),_0xecb02b);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index f169863..fd3d703 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 _0x8f0b=['lodash','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','error','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','extension','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s'];(function(_0x806c36,_0xf881df){var _0xbd6f14=function(_0x16fa96){while(--_0x16fa96){_0x806c36['push'](_0x806c36['shift']());}};_0xbd6f14(++_0xf881df);}(_0x8f0b,0x6e));var _0xb8f0=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x8f0b[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0xb8f0('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x1cda34){utils[_0xb8f0('0x1')](util[_0xb8f0('0x2')](_0xb8f0('0x3'),_0x1cda34[_0xb8f0('0x4')],_0x1cda34[_0xb8f0('0x5')],_0x1cda34['queue'],_0x1cda34['lastAssignedTo'],_0x1cda34[_0xb8f0('0x6')],_0x1cda34[_0xb8f0('0x7')],_0x1cda34[_0xb8f0('0x8')]));if(_0x1cda34[_0xb8f0('0x9')]){utils[_0xb8f0('0xa')](_0x1cda34[_0xb8f0('0x9')])[_0xb8f0('0xb')](function(_0x28ceba){if(_0x28ceba){_0x1cda34['type']=_0x28ceba[_0xb8f0('0xc')];}utils[_0xb8f0('0xd')](_0xb8f0('0xe'),_0x1cda34);});}else{utils[_0xb8f0('0xd')](_0xb8f0('0xe'),_0x1cda34);}if(_0x1cda34[_0xb8f0('0xf')]){delete queues[_0x1cda34[_0xb8f0('0xf')]];}else{delete queues[_0x1cda34['uniqueid']];}}exports[_0xb8f0('0x10')]=function(_0x50763f){try{utils[_0xb8f0('0x11')](util[_0xb8f0('0x2')]('[%s][queues][queuecallerjoin]',_0x50763f[_0xb8f0('0x4')]),_0x50763f);utils['info'](util['format'](_0xb8f0('0x12'),_0x50763f[_0xb8f0('0x4')],_0x50763f[_0xb8f0('0x9')],_0x50763f['position']));queues[_0x50763f[_0xb8f0('0x4')]]=_[_0xb8f0('0x13')](_0x50763f,{'originalposition':_0x50763f[_0xb8f0('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x51bd5b){utils['error'](util['format'](_0xb8f0('0x15'),_0x50763f[_0xb8f0('0x4')]),_0x51bd5b);}};exports[_0xb8f0('0x16')]=function(_0x17f9bd){try{if(!_[_0xb8f0('0x17')](queues[_0x17f9bd[_0xb8f0('0x4')]])){utils[_0xb8f0('0x11')](util['format'](_0xb8f0('0x18'),_0x17f9bd[_0xb8f0('0x4')]),_0x17f9bd);if(queues[_0x17f9bd[_0xb8f0('0x4')]]['queuecallerleaveAt']){if(!queues[_0x17f9bd[_0xb8f0('0x4')]][_0xb8f0('0x19')]&&!queues[_0x17f9bd['uniqueid']][_0xb8f0('0x1a')]){queues[_0x17f9bd[_0xb8f0('0x4')]][_0xb8f0('0x1b')]=!![];queues[_0x17f9bd[_0xb8f0('0x4')]][_0xb8f0('0x1c')]=utils[_0xb8f0('0x1d')]();queues[_0x17f9bd[_0xb8f0('0x4')]][_0xb8f0('0x8')]=_0xb8f0('0x1e');}utils['info'](util[_0xb8f0('0x2')](_0xb8f0('0x1f'),_0x17f9bd[_0xb8f0('0x4')],queues[_0x17f9bd['uniqueid']][_0xb8f0('0x20')],queues[_0x17f9bd[_0xb8f0('0x4')]][_0xb8f0('0x8')]));writeDB(queues[_0x17f9bd[_0xb8f0('0x4')]]);}else if(queues[_0x17f9bd[_0xb8f0('0x4')]][_0xb8f0('0xf')]){utils['info'](util[_0xb8f0('0x2')](_0xb8f0('0x21'),_0x17f9bd[_0xb8f0('0x4')],queues[_0x17f9bd[_0xb8f0('0x4')]][_0xb8f0('0x20')],queues[_0x17f9bd[_0xb8f0('0x4')]][_0xb8f0('0xf')]));queues[queues[_0x17f9bd[_0xb8f0('0x4')]]['transfereduniqueid']]=queues[_0x17f9bd[_0xb8f0('0x4')]];queues[queues[_0x17f9bd[_0xb8f0('0x4')]][_0xb8f0('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x17f9bd[_0xb8f0('0x4')]];}}}catch(_0x3d7847){utils[_0xb8f0('0x22')](util[_0xb8f0('0x2')](_0xb8f0('0x18'),_0x17f9bd[_0xb8f0('0x4')]),_0x3d7847);}};exports['varset']=function(_0x24e802){try{utils[_0xb8f0('0x11')](util[_0xb8f0('0x2')](_0xb8f0('0x23'),_0x24e802[_0xb8f0('0x4')]),_0x24e802);if(!_[_0xb8f0('0x17')](_0x24e802[_0xb8f0('0x24')][_0xb8f0('0x25')])&&_0x24e802[_0xb8f0('0x26')][_0xb8f0('0x27')]()!==_0xb8f0('0x28')){if(!_[_0xb8f0('0x17')](queues[_0x24e802[_0xb8f0('0x4')]])){queues[_0x24e802[_0xb8f0('0x4')]][_0xb8f0('0x19')]=![];queues[_0x24e802['uniqueid']][_0xb8f0('0x29')]=null;queues[_0x24e802[_0xb8f0('0x4')]]['queuecallerexit']=!![];queues[_0x24e802[_0xb8f0('0x4')]][_0xb8f0('0x2a')]=utils[_0xb8f0('0x1d')]();queues[_0x24e802[_0xb8f0('0x4')]][_0xb8f0('0x8')]=_0x24e802['value'][_0xb8f0('0x27')]();utils[_0xb8f0('0x1')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x24e802[_0xb8f0('0x4')],queues[_0x24e802[_0xb8f0('0x4')]][_0xb8f0('0x20')],_0x24e802['value'],queues[_0x24e802[_0xb8f0('0x4')]][_0xb8f0('0x8')]));writeDB(queues[_0x24e802['uniqueid']]);}}else if(!_[_0xb8f0('0x17')](_0x24e802[_0xb8f0('0x24')][_0xb8f0('0x2b')])){if(!_[_0xb8f0('0x17')](queues[_0x24e802[_0xb8f0('0x4')]])&&!queues[_0x24e802[_0xb8f0('0x4')]]['queuecallerabandon']){queues[_0x24e802[_0xb8f0('0x4')]][_0xb8f0('0x19')]=![];queues[_0x24e802[_0xb8f0('0x4')]][_0xb8f0('0x29')]=null;queues[_0x24e802['uniqueid']][_0xb8f0('0x1a')]=!![];queues[_0x24e802['uniqueid']][_0xb8f0('0x2a')]=utils[_0xb8f0('0x1d')]();queues[_0x24e802[_0xb8f0('0x4')]][_0xb8f0('0x8')]=_0xb8f0('0x2c');utils[_0xb8f0('0x1')](util['format'](_0xb8f0('0x2d'),_0x24e802[_0xb8f0('0x4')],queues[_0x24e802[_0xb8f0('0x4')]][_0xb8f0('0x20')],_0x24e802[_0xb8f0('0x26')],queues[_0x24e802[_0xb8f0('0x4')]][_0xb8f0('0x8')]));}}}catch(_0x23faa1){utils[_0xb8f0('0x22')](util[_0xb8f0('0x2')](_0xb8f0('0x23'),_0x24e802[_0xb8f0('0x4')]),_0x23faa1);}};exports['queuecallerabandon']=function(_0xa9d3b9){try{if(!_[_0xb8f0('0x17')](queues[_0xa9d3b9['uniqueid']])){utils[_0xb8f0('0x11')](util['format']('[%s][queues][queuecallerabandon]',_0xa9d3b9[_0xb8f0('0x4')]),_0xa9d3b9);queues[_0xa9d3b9['uniqueid']][_0xb8f0('0x1a')]=![];queues[_0xa9d3b9['uniqueid']][_0xb8f0('0x2a')]=null;queues[_0xa9d3b9[_0xb8f0('0x4')]][_0xb8f0('0x19')]=!![];queues[_0xa9d3b9['uniqueid']][_0xb8f0('0x29')]=utils['now']();queues[_0xa9d3b9[_0xb8f0('0x4')]][_0xb8f0('0x8')]=_0xb8f0('0x2e');utils[_0xb8f0('0x1')](util[_0xb8f0('0x2')](_0xb8f0('0x2f'),_0xa9d3b9[_0xb8f0('0x4')],queues[_0xa9d3b9['uniqueid']][_0xb8f0('0x20')],queues[_0xa9d3b9[_0xb8f0('0x4')]]['queuecallerexitreason']));}}catch(_0x4ef806){utils['error'](util[_0xb8f0('0x2')](_0xb8f0('0x30'),_0xa9d3b9['uniqueid']),_0x4ef806);}};exports[_0xb8f0('0x31')]=function(_0x49d39a){try{if(!_['isNil'](queues[_0x49d39a[_0xb8f0('0x4')]])){utils[_0xb8f0('0x11')](util['format'](_0xb8f0('0x32'),_0x49d39a[_0xb8f0('0x4')]),_0x49d39a);utils[_0xb8f0('0x1')](util['format'](_0xb8f0('0x33'),_0x49d39a[_0xb8f0('0x4')],queues[_0x49d39a[_0xb8f0('0x4')]][_0xb8f0('0x20')],_0x49d39a[_0xb8f0('0x34')],_0x49d39a[_0xb8f0('0x35')]));queues[_0x49d39a[_0xb8f0('0x4')]][_0xb8f0('0x31')]=!![];queues[_0x49d39a[_0xb8f0('0x4')]][_0xb8f0('0x36')]=utils[_0xb8f0('0x1d')]();queues[_0x49d39a[_0xb8f0('0x4')]]['holdtime']=utils['diffTime'](queues[_0x49d39a[_0xb8f0('0x4')]][_0xb8f0('0x36')],queues[_0x49d39a[_0xb8f0('0x4')]][_0xb8f0('0x37')]);queues[_0x49d39a[_0xb8f0('0x4')]][_0xb8f0('0x14')]=_0x49d39a[_0xb8f0('0x14')];queues[_0x49d39a[_0xb8f0('0x4')]][_0xb8f0('0x38')]=_0x49d39a[_0xb8f0('0x38')];queues[_0x49d39a[_0xb8f0('0x4')]]['connectedlinenum']=_0x49d39a['connectedlinenum'];queues[_0x49d39a[_0xb8f0('0x4')]]['connectedlinename']=_0x49d39a[_0xb8f0('0x35')];}}catch(_0x12a0dc){utils[_0xb8f0('0x22')](util['format']('[%s][queues][queuecallerleave]',_0x49d39a[_0xb8f0('0x4')]),_0x12a0dc);}};exports[_0xb8f0('0x39')]=function(_0x22492c){try{if(!_[_0xb8f0('0x17')](queues[_0x22492c[_0xb8f0('0x4')]])){utils[_0xb8f0('0x11')](util[_0xb8f0('0x2')]('[%s][queues][agentconnect]',_0x22492c['uniqueid']),_0x22492c);utils['info'](util[_0xb8f0('0x2')](_0xb8f0('0x3a'),_0x22492c[_0xb8f0('0x4')],queues[_0x22492c[_0xb8f0('0x4')]][_0xb8f0('0x20')],_0x22492c[_0xb8f0('0x3b')],_0x22492c[_0xb8f0('0x3c')]));queues[_0x22492c[_0xb8f0('0x4')]]['queuecallerabandon']=![];queues[_0x22492c['uniqueid']][_0xb8f0('0x19')]=![];queues[_0x22492c['uniqueid']][_0xb8f0('0x29')]=null;queues[_0x22492c[_0xb8f0('0x4')]][_0xb8f0('0x1a')]=![];queues[_0x22492c[_0xb8f0('0x4')]][_0xb8f0('0x8')]=null;queues[_0x22492c['uniqueid']][_0xb8f0('0x2a')]=null;queues[_0x22492c['uniqueid']][_0xb8f0('0x3d')]=!![];queues[_0x22492c[_0xb8f0('0x4')]]['accountcode']=_0x22492c[_0xb8f0('0x3c')];queues[_0x22492c['uniqueid']][_0xb8f0('0x3e')]=_0x22492c[_0xb8f0('0x3b')];}}catch(_0x5fc2c5){utils['error'](util[_0xb8f0('0x2')](_0xb8f0('0x3f'),_0x22492c[_0xb8f0('0x4')]),_0x5fc2c5);}};exports[_0xb8f0('0x40')]=function(_0x1f679a){try{if(!_[_0xb8f0('0x17')](queues[_0x1f679a['uniqueid']])){if(queues[_0x1f679a[_0xb8f0('0x4')]][_0xb8f0('0x36')]){utils[_0xb8f0('0x11')](util[_0xb8f0('0x2')](_0xb8f0('0x41'),_0x1f679a[_0xb8f0('0x4')]),_0x1f679a);queues[_0x1f679a[_0xb8f0('0x4')]]['queuecallerabandon']=![];queues[_0x1f679a[_0xb8f0('0x4')]]['queuecallerabandon']=![];queues[_0x1f679a[_0xb8f0('0x4')]][_0xb8f0('0x29')]=null;queues[_0x1f679a['uniqueid']][_0xb8f0('0x1a')]=![];queues[_0x1f679a[_0xb8f0('0x4')]]['queuecallerexitAt']=null;queues[_0x1f679a[_0xb8f0('0x4')]][_0xb8f0('0x3d')]=!![];queues[_0x1f679a[_0xb8f0('0x4')]][_0xb8f0('0x3e')]=_0x1f679a[_0xb8f0('0x3b')];queues[_0x1f679a[_0xb8f0('0x4')]][_0xb8f0('0x1b')]=!![];queues[_0x1f679a[_0xb8f0('0x4')]][_0xb8f0('0x1c')]=utils[_0xb8f0('0x1d')]();if(_0x1f679a[_0xb8f0('0x42')]==_0xb8f0('0x43')){if(!queues[_0x1f679a[_0xb8f0('0x4')]][_0xb8f0('0x43')]){queues[_0x1f679a[_0xb8f0('0x4')]][_0xb8f0('0x8')]=_0xb8f0('0x44');}}else{queues[_0x1f679a[_0xb8f0('0x4')]][_0xb8f0('0x8')]=_0xb8f0('0x45')+_0x1f679a[_0xb8f0('0x42')]['toUpperCase']();}utils[_0xb8f0('0x1')](util[_0xb8f0('0x2')](_0xb8f0('0x46'),_0x1f679a[_0xb8f0('0x4')],queues[_0x1f679a[_0xb8f0('0x4')]][_0xb8f0('0x20')],_0x1f679a[_0xb8f0('0x3b')],queues[_0x1f679a['uniqueid']][_0xb8f0('0x8')]));writeDB(queues[_0x1f679a[_0xb8f0('0x4')]]);}}}catch(_0x5c75c7){utils[_0xb8f0('0x22')](util[_0xb8f0('0x2')](_0xb8f0('0x41'),_0x1f679a[_0xb8f0('0x4')]),_0x5c75c7);}};exports[_0xb8f0('0x47')]=function(_0x5c318b){try{if(!_[_0xb8f0('0x17')](queues[_0x5c318b[_0xb8f0('0x48')]])){utils[_0xb8f0('0x11')](util['format']('[%s][queues][blindtransfer]',_0x5c318b[_0xb8f0('0x4')]),_0x5c318b);queues[_0x5c318b[_0xb8f0('0x48')]]['transfer']=!![];queues[_0x5c318b['transfereeuniqueid']][_0xb8f0('0x49')]=_0xb8f0('0x4a');queues[_0x5c318b[_0xb8f0('0x48')]][_0xb8f0('0x4b')]=_0x5c318b['extension'];queues[_0x5c318b[_0xb8f0('0x48')]][_0xb8f0('0x4c')]=_0x5c318b[_0xb8f0('0x48')];queues[_0x5c318b[_0xb8f0('0x48')]]['queuecallerexitreason']=_0xb8f0('0x4d');utils[_0xb8f0('0x1')](util[_0xb8f0('0x2')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x5c318b[_0xb8f0('0x4')],queues[_0x5c318b[_0xb8f0('0x48')]][_0xb8f0('0x20')],_0x5c318b['transfereeuniqueid'],_0x5c318b[_0xb8f0('0x4e')]));}}catch(_0x1b0a4e){utils[_0xb8f0('0x22')](util[_0xb8f0('0x2')](_0xb8f0('0x4f'),_0x5c318b[_0xb8f0('0x4')]),_0x1b0a4e);}};exports[_0xb8f0('0x50')]=function(_0x91ef3d){try{utils[_0xb8f0('0x11')](util[_0xb8f0('0x2')]('[%s][queues][attendedtransfer]',_0x91ef3d[_0xb8f0('0x51')]),_0x91ef3d);if(_0x91ef3d[_0xb8f0('0x51')]==_0x91ef3d['origtransfererlinkedid']){if(!_['isNil'](queues[_0x91ef3d['secondtransfererlinkedid']])){utils[_0xb8f0('0x1')](util[_0xb8f0('0x2')](_0xb8f0('0x52'),_0x91ef3d['origtransfereruniqueid'],queues[_0x91ef3d[_0xb8f0('0x53')]]['name'],_0x91ef3d[_0xb8f0('0x54')]));queues[_0x91ef3d[_0xb8f0('0x53')]]['transfer']=!![];queues[_0x91ef3d['secondtransfererlinkedid']][_0xb8f0('0x49')]=_0xb8f0('0x55');queues[_0x91ef3d['secondtransfererlinkedid']][_0xb8f0('0x4b')]=_0x91ef3d['origtransfererexten'];queues[_0x91ef3d[_0xb8f0('0x53')]]['transferuniqueid']=_0x91ef3d[_0xb8f0('0x51')];queues[_0x91ef3d['secondtransfererlinkedid']][_0xb8f0('0x8')]=_0xb8f0('0x56');}if(!_['isNil'](queues[_0x91ef3d['origtransfererlinkedid']])){if(_0x91ef3d[_0xb8f0('0x57')]&&queues[_0x91ef3d[_0xb8f0('0x57')]]){queues[_0x91ef3d[_0xb8f0('0x57')]][_0xb8f0('0x58')]=0x1;queues[_0x91ef3d[_0xb8f0('0x48')]]=_[_0xb8f0('0x59')](queues[_0x91ef3d[_0xb8f0('0x57')]]);queues[_0x91ef3d['transfereeuniqueid']][_0xb8f0('0xf')]=_0x91ef3d[_0xb8f0('0x5a')];queues[_0x91ef3d[_0xb8f0('0x48')]][_0xb8f0('0x58')]=0x2;queues[_0x91ef3d[_0xb8f0('0x48')]]['calleridnum']=queues[_0x91ef3d['secondtransfererlinkedid']][_0xb8f0('0x6')];queues[_0x91ef3d[_0xb8f0('0x48')]][_0xb8f0('0x5b')]=queues[_0x91ef3d[_0xb8f0('0x53')]][_0xb8f0('0x5b')];queues[_0x91ef3d[_0xb8f0('0x48')]]['queuecallerjoinAt']=utils[_0xb8f0('0x1d')]();queues[_0x91ef3d[_0xb8f0('0x48')]]['queuecallerleaveAt']=utils[_0xb8f0('0x1d')]();queues[_0x91ef3d['transfereeuniqueid']]['holdtime']=0x0;queues[_0x91ef3d[_0xb8f0('0x48')]][_0xb8f0('0x5c')]=0x0;utils[_0xb8f0('0x1')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x91ef3d['origtransfereruniqueid'],queues[_0x91ef3d['transfereeuniqueid']][_0xb8f0('0x20')],queues[_0x91ef3d[_0xb8f0('0x48')]][_0xb8f0('0x6')],queues[_0x91ef3d[_0xb8f0('0x48')]][_0xb8f0('0x5b')]));}else{utils[_0xb8f0('0x1')](util[_0xb8f0('0x2')](_0xb8f0('0x5d'),_0x91ef3d['origtransfereruniqueid'],queues[_0x91ef3d[_0xb8f0('0x5e')]][_0xb8f0('0x20')],_0x91ef3d[_0xb8f0('0x53')]));queues[_0x91ef3d['origtransfererlinkedid']][_0xb8f0('0xf')]=_0x91ef3d[_0xb8f0('0x53')];}}}else if(_0x91ef3d['secondtransfereruniqueid']==_0x91ef3d[_0xb8f0('0x53')]){if(!_[_0xb8f0('0x17')](queues[_0x91ef3d['origtransfererlinkedid']])){utils['info'](util['format'](_0xb8f0('0x5f'),_0x91ef3d['origtransfereruniqueid'],queues[_0x91ef3d[_0xb8f0('0x5e')]]['name'],_0x91ef3d['secondtransfereruniqueid'],_0x91ef3d[_0xb8f0('0x60')]));queues[_0x91ef3d['origtransfererlinkedid']][_0xb8f0('0x43')]=!![];queues[_0x91ef3d[_0xb8f0('0x5e')]][_0xb8f0('0x49')]=_0xb8f0('0x55');queues[_0x91ef3d[_0xb8f0('0x5e')]]['transferexten']=_0x91ef3d[_0xb8f0('0x60')];queues[_0x91ef3d[_0xb8f0('0x5e')]][_0xb8f0('0x4c')]=_0x91ef3d[_0xb8f0('0x61')];queues[_0x91ef3d['origtransfererlinkedid']][_0xb8f0('0x8')]=_0xb8f0('0x56');}if(!_[_0xb8f0('0x17')](queues[_0x91ef3d['secondtransfererlinkedid']])){if(_0x91ef3d[_0xb8f0('0x62')]&&queues[_0x91ef3d['transfertargetlinkedid']]){queues[_0x91ef3d['transfertargetlinkedid']][_0xb8f0('0x58')]=0x1;queues[_0x91ef3d[_0xb8f0('0x5a')]]=_['clone'](queues[_0x91ef3d[_0xb8f0('0x62')]]);queues[_0x91ef3d['transfertargetuniqueid']][_0xb8f0('0xf')]=_0x91ef3d[_0xb8f0('0x5a')];queues[_0x91ef3d['transfertargetuniqueid']][_0xb8f0('0x58')]=0x2;queues[_0x91ef3d[_0xb8f0('0x5a')]][_0xb8f0('0x6')]=queues[_0x91ef3d['origtransfererlinkedid']][_0xb8f0('0x6')];queues[_0x91ef3d[_0xb8f0('0x5a')]][_0xb8f0('0x5b')]=queues[_0x91ef3d[_0xb8f0('0x5e')]][_0xb8f0('0x5b')];queues[_0x91ef3d[_0xb8f0('0x5a')]][_0xb8f0('0x37')]=utils[_0xb8f0('0x1d')]();queues[_0x91ef3d[_0xb8f0('0x5a')]][_0xb8f0('0x36')]=utils[_0xb8f0('0x1d')]();queues[_0x91ef3d['transfertargetuniqueid']][_0xb8f0('0x63')]=0x0;queues[_0x91ef3d[_0xb8f0('0x5a')]][_0xb8f0('0x5c')]=0x0;utils[_0xb8f0('0x1')](util[_0xb8f0('0x2')](_0xb8f0('0x64'),_0x91ef3d[_0xb8f0('0x51')],queues[_0x91ef3d[_0xb8f0('0x5a')]][_0xb8f0('0x20')],queues[_0x91ef3d[_0xb8f0('0x5a')]][_0xb8f0('0xf')],queues[_0x91ef3d[_0xb8f0('0x5a')]][_0xb8f0('0x6')],queues[_0x91ef3d[_0xb8f0('0x5a')]][_0xb8f0('0x5b')]));}else{utils[_0xb8f0('0x1')](util[_0xb8f0('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x91ef3d[_0xb8f0('0x51')],queues[_0x91ef3d['secondtransfererlinkedid']][_0xb8f0('0x20')],_0x91ef3d[_0xb8f0('0x5e')]));queues[_0x91ef3d['secondtransfererlinkedid']][_0xb8f0('0xf')]=_0x91ef3d[_0xb8f0('0x5e')];}}}}catch(_0x19f9e7){utils['error'](util[_0xb8f0('0x2')](_0xb8f0('0x65'),_0x91ef3d['origtransfereruniqueid']),_0x19f9e7);}};exports[_0xb8f0('0x66')]=function(_0x9ff42b){try{if(!_[_0xb8f0('0x17')](queues[_0x9ff42b[_0xb8f0('0x4')]])){utils[_0xb8f0('0x11')](util['format'](_0xb8f0('0x67'),_0x9ff42b['uniqueid']),_0x9ff42b);queues[_0x9ff42b['uniqueid']][_0xb8f0('0x68')]=utils[_0xb8f0('0x1d')]();utils[_0xb8f0('0x1')](util[_0xb8f0('0x2')](_0xb8f0('0x69'),_0x9ff42b[_0xb8f0('0x4')],queues[_0x9ff42b[_0xb8f0('0x4')]][_0xb8f0('0x20')],queues[_0x9ff42b[_0xb8f0('0x4')]][_0xb8f0('0x68')]));}}catch(_0x18eb76){utils[_0xb8f0('0x22')](util[_0xb8f0('0x2')](_0xb8f0('0x67'),_0x9ff42b[_0xb8f0('0x4')]),_0x18eb76);}};exports[_0xb8f0('0x6a')]=function(_0x162d03){try{if(!_[_0xb8f0('0x17')](queues[_0x162d03[_0xb8f0('0x4')]])){if(!_['isNil'](queues[_0x162d03[_0xb8f0('0x4')]][_0xb8f0('0x68')])){utils[_0xb8f0('0x11')](util['format'](_0xb8f0('0x6b'),_0x162d03['uniqueid']),_0x162d03);queues[_0x162d03[_0xb8f0('0x4')]][_0xb8f0('0x5c')]+=utils[_0xb8f0('0x6c')](utils[_0xb8f0('0x1d')](),queues[_0x162d03[_0xb8f0('0x4')]][_0xb8f0('0x68')]);utils['info'](util[_0xb8f0('0x2')](_0xb8f0('0x6d'),_0x162d03['uniqueid'],queues[_0x162d03[_0xb8f0('0x4')]][_0xb8f0('0x20')],queues[_0x162d03[_0xb8f0('0x4')]][_0xb8f0('0x5c')]));delete queues[_0x162d03['uniqueid']][_0xb8f0('0x68')];}}}catch(_0x28341a){utils[_0xb8f0('0x22')](util[_0xb8f0('0x2')](_0xb8f0('0x6b'),_0x162d03['uniqueid']),_0x28341a);}}; \ No newline at end of file +var _0x223a=['clone','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','transfereduniqueid','queuecallerenterreason','[%s][queues][hangup]','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferexten','transfereelinkedid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid'];(function(_0x485983,_0x89570b){var _0x5c1ff0=function(_0x1729af){while(--_0x1729af){_0x485983['push'](_0x485983['shift']());}};_0x5c1ff0(++_0x89570b);}(_0x223a,0xe2));var _0xa223=function(_0x230dd4,_0x531e04){_0x230dd4=_0x230dd4-0x0;var _0x3c9224=_0x223a[_0x230dd4];return _0x3c9224;};'use strict';var _=require(_0xa223('0x0'));var util=require('util');var utils=require(_0xa223('0x1'));var queues={};function writeDB(_0x59d563){utils[_0xa223('0x2')](util[_0xa223('0x3')](_0xa223('0x4'),_0x59d563[_0xa223('0x5')],_0x59d563[_0xa223('0x6')],_0x59d563[_0xa223('0x7')],_0x59d563[_0xa223('0x8')],_0x59d563[_0xa223('0x9')],_0x59d563[_0xa223('0xa')],_0x59d563[_0xa223('0xb')]));if(_0x59d563[_0xa223('0x7')]){utils[_0xa223('0xc')](_0x59d563['queue'])[_0xa223('0xd')](function(_0x191f7b){if(_0x191f7b){_0x59d563[_0xa223('0xe')]=_0x191f7b[_0xa223('0xe')];}utils['request'](_0xa223('0xf'),_0x59d563);});}else{utils[_0xa223('0x10')](_0xa223('0xf'),_0x59d563);}if(_0x59d563['transfereduniqueid']){delete queues[_0x59d563['transfereduniqueid']];}else{delete queues[_0x59d563['uniqueid']];}}exports['queuecallerjoin']=function(_0x296f3f){try{utils[_0xa223('0x11')](util['format']('[%s][queues][queuecallerjoin]',_0x296f3f[_0xa223('0x5')]),_0x296f3f);utils[_0xa223('0x2')](util[_0xa223('0x3')](_0xa223('0x12'),_0x296f3f[_0xa223('0x5')],_0x296f3f[_0xa223('0x7')],_0x296f3f[_0xa223('0x13')]));queues[_0x296f3f['uniqueid']]=_[_0xa223('0x14')](_0x296f3f,{'originalposition':_0x296f3f[_0xa223('0x13')],'queuecallerjoinAt':utils[_0xa223('0x15')](),'mohtime':0x0});}catch(_0x32c9a4){utils[_0xa223('0x16')](util[_0xa223('0x3')](_0xa223('0x17'),_0x296f3f[_0xa223('0x5')]),_0x32c9a4);}};exports[_0xa223('0x18')]=function(_0x4cb099){try{if(!_[_0xa223('0x19')](queues[_0x4cb099[_0xa223('0x5')]])){utils[_0xa223('0x11')](util['format']('[%s][queues][hangup]',_0x4cb099[_0xa223('0x5')]),_0x4cb099);if(queues[_0x4cb099['uniqueid']][_0xa223('0x1a')]){if(!queues[_0x4cb099[_0xa223('0x5')]][_0xa223('0x1b')]&&!queues[_0x4cb099[_0xa223('0x5')]][_0xa223('0x1c')]){queues[_0x4cb099['uniqueid']][_0xa223('0x1d')]=!![];queues[_0x4cb099[_0xa223('0x5')]][_0xa223('0x1e')]=utils[_0xa223('0x15')]();queues[_0x4cb099[_0xa223('0x5')]][_0xa223('0xb')]=_0xa223('0x1f');}utils['info'](util[_0xa223('0x3')](_0xa223('0x20'),_0x4cb099[_0xa223('0x5')],queues[_0x4cb099[_0xa223('0x5')]][_0xa223('0x21')],queues[_0x4cb099[_0xa223('0x5')]][_0xa223('0xb')]));writeDB(queues[_0x4cb099[_0xa223('0x5')]]);}else if(queues[_0x4cb099[_0xa223('0x5')]][_0xa223('0x22')]){utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x4cb099[_0xa223('0x5')],queues[_0x4cb099['uniqueid']]['name'],queues[_0x4cb099[_0xa223('0x5')]]['transfereduniqueid']));queues[queues[_0x4cb099[_0xa223('0x5')]]['transfereduniqueid']]=queues[_0x4cb099['uniqueid']];queues[queues[_0x4cb099[_0xa223('0x5')]][_0xa223('0x22')]][_0xa223('0x23')]=0x2;delete queues[_0x4cb099[_0xa223('0x5')]];}}}catch(_0x20b286){utils[_0xa223('0x16')](util[_0xa223('0x3')](_0xa223('0x24'),_0x4cb099[_0xa223('0x5')]),_0x20b286);}};exports['varset']=function(_0x49308c){try{utils[_0xa223('0x11')](util['format']('[%s][queues][varset]',_0x49308c[_0xa223('0x5')]),_0x49308c);if(!_['isNil'](_0x49308c['variable'][_0xa223('0x25')])&&_0x49308c[_0xa223('0x26')]['toUpperCase']()!==_0xa223('0x27')){if(!_[_0xa223('0x19')](queues[_0x49308c[_0xa223('0x5')]])){queues[_0x49308c[_0xa223('0x5')]][_0xa223('0x1b')]=![];queues[_0x49308c[_0xa223('0x5')]][_0xa223('0x28')]=null;queues[_0x49308c[_0xa223('0x5')]]['queuecallerexit']=!![];queues[_0x49308c[_0xa223('0x5')]][_0xa223('0x29')]=utils[_0xa223('0x15')]();queues[_0x49308c[_0xa223('0x5')]][_0xa223('0xb')]=_0x49308c[_0xa223('0x26')][_0xa223('0x2a')]();utils[_0xa223('0x2')](util[_0xa223('0x3')](_0xa223('0x2b'),_0x49308c[_0xa223('0x5')],queues[_0x49308c[_0xa223('0x5')]]['name'],_0x49308c['value'],queues[_0x49308c[_0xa223('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x49308c[_0xa223('0x5')]]);}}else if(!_[_0xa223('0x19')](_0x49308c[_0xa223('0x2c')][_0xa223('0x2d')])){if(!_[_0xa223('0x19')](queues[_0x49308c[_0xa223('0x5')]])&&!queues[_0x49308c['uniqueid']][_0xa223('0x1b')]){queues[_0x49308c[_0xa223('0x5')]][_0xa223('0x1b')]=![];queues[_0x49308c[_0xa223('0x5')]][_0xa223('0x28')]=null;queues[_0x49308c[_0xa223('0x5')]][_0xa223('0x1c')]=!![];queues[_0x49308c[_0xa223('0x5')]][_0xa223('0x29')]=utils[_0xa223('0x15')]();queues[_0x49308c[_0xa223('0x5')]][_0xa223('0xb')]='EXITWITHKEY';utils[_0xa223('0x2')](util[_0xa223('0x3')](_0xa223('0x2e'),_0x49308c['uniqueid'],queues[_0x49308c[_0xa223('0x5')]][_0xa223('0x21')],_0x49308c[_0xa223('0x26')],queues[_0x49308c[_0xa223('0x5')]][_0xa223('0xb')]));}}}catch(_0x390c6a){utils[_0xa223('0x16')](util[_0xa223('0x3')](_0xa223('0x2f'),_0x49308c['uniqueid']),_0x390c6a);}};exports[_0xa223('0x1b')]=function(_0x439238){try{if(!_[_0xa223('0x19')](queues[_0x439238[_0xa223('0x5')]])){utils['debug'](util[_0xa223('0x3')](_0xa223('0x30'),_0x439238[_0xa223('0x5')]),_0x439238);queues[_0x439238['uniqueid']][_0xa223('0x1c')]=![];queues[_0x439238[_0xa223('0x5')]]['queuecallerexitAt']=null;queues[_0x439238[_0xa223('0x5')]]['queuecallerabandon']=!![];queues[_0x439238['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x439238[_0xa223('0x5')]][_0xa223('0xb')]='ABANDONED';utils['info'](util[_0xa223('0x3')](_0xa223('0x31'),_0x439238[_0xa223('0x5')],queues[_0x439238[_0xa223('0x5')]][_0xa223('0x21')],queues[_0x439238[_0xa223('0x5')]][_0xa223('0xb')]));}}catch(_0x2a1b12){utils[_0xa223('0x16')](util[_0xa223('0x3')](_0xa223('0x30'),_0x439238[_0xa223('0x5')]),_0x2a1b12);}};exports[_0xa223('0x32')]=function(_0x1ffc83){try{if(!_[_0xa223('0x19')](queues[_0x1ffc83[_0xa223('0x5')]])){utils[_0xa223('0x11')](util[_0xa223('0x3')](_0xa223('0x33'),_0x1ffc83[_0xa223('0x5')]),_0x1ffc83);utils['info'](util[_0xa223('0x3')](_0xa223('0x34'),_0x1ffc83[_0xa223('0x5')],queues[_0x1ffc83[_0xa223('0x5')]][_0xa223('0x21')],_0x1ffc83[_0xa223('0x35')],_0x1ffc83['connectedlinename']));queues[_0x1ffc83[_0xa223('0x5')]]['queuecallerleave']=!![];queues[_0x1ffc83[_0xa223('0x5')]][_0xa223('0x1a')]=utils[_0xa223('0x15')]();queues[_0x1ffc83['uniqueid']][_0xa223('0x36')]=utils[_0xa223('0x37')](queues[_0x1ffc83[_0xa223('0x5')]][_0xa223('0x1a')],queues[_0x1ffc83[_0xa223('0x5')]][_0xa223('0x38')]);queues[_0x1ffc83[_0xa223('0x5')]][_0xa223('0x13')]=_0x1ffc83[_0xa223('0x13')];queues[_0x1ffc83[_0xa223('0x5')]][_0xa223('0x39')]=_0x1ffc83[_0xa223('0x39')];queues[_0x1ffc83[_0xa223('0x5')]]['connectedlinenum']=_0x1ffc83[_0xa223('0x35')];queues[_0x1ffc83[_0xa223('0x5')]]['connectedlinename']=_0x1ffc83[_0xa223('0x3a')];}}catch(_0x42d851){utils[_0xa223('0x16')](util[_0xa223('0x3')](_0xa223('0x33'),_0x1ffc83['uniqueid']),_0x42d851);}};exports[_0xa223('0x3b')]=function(_0x428934){try{if(!_[_0xa223('0x19')](queues[_0x428934['uniqueid']])){utils[_0xa223('0x11')](util['format'](_0xa223('0x3c'),_0x428934[_0xa223('0x5')]),_0x428934);utils[_0xa223('0x2')](util[_0xa223('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x428934['uniqueid'],queues[_0x428934['uniqueid']][_0xa223('0x21')],_0x428934[_0xa223('0x3d')],_0x428934[_0xa223('0x3e')]));queues[_0x428934[_0xa223('0x5')]][_0xa223('0x1b')]=![];queues[_0x428934[_0xa223('0x5')]][_0xa223('0x1b')]=![];queues[_0x428934[_0xa223('0x5')]][_0xa223('0x28')]=null;queues[_0x428934[_0xa223('0x5')]][_0xa223('0x1c')]=![];queues[_0x428934['uniqueid']][_0xa223('0xb')]=null;queues[_0x428934[_0xa223('0x5')]][_0xa223('0x29')]=null;queues[_0x428934[_0xa223('0x5')]][_0xa223('0x3f')]=!![];queues[_0x428934['uniqueid']][_0xa223('0xa')]=_0x428934[_0xa223('0x3e')];queues[_0x428934['uniqueid']][_0xa223('0x8')]=_0x428934[_0xa223('0x3d')];}}catch(_0x4743e0){utils['error'](util[_0xa223('0x3')](_0xa223('0x3c'),_0x428934['uniqueid']),_0x4743e0);}};exports[_0xa223('0x40')]=function(_0x50d0ca){try{if(!_[_0xa223('0x19')](queues[_0x50d0ca[_0xa223('0x5')]])){if(queues[_0x50d0ca[_0xa223('0x5')]][_0xa223('0x1a')]){utils['debug'](util[_0xa223('0x3')]('[%s][queues][agentcomplete]',_0x50d0ca[_0xa223('0x5')]),_0x50d0ca);queues[_0x50d0ca[_0xa223('0x5')]][_0xa223('0x1b')]=![];queues[_0x50d0ca[_0xa223('0x5')]][_0xa223('0x1b')]=![];queues[_0x50d0ca[_0xa223('0x5')]][_0xa223('0x28')]=null;queues[_0x50d0ca[_0xa223('0x5')]]['queuecallerexit']=![];queues[_0x50d0ca[_0xa223('0x5')]]['queuecallerexitAt']=null;queues[_0x50d0ca[_0xa223('0x5')]][_0xa223('0x3f')]=!![];queues[_0x50d0ca['uniqueid']][_0xa223('0x8')]=_0x50d0ca[_0xa223('0x3d')];queues[_0x50d0ca[_0xa223('0x5')]]['queuecallercomplete']=!![];queues[_0x50d0ca['uniqueid']][_0xa223('0x1e')]=utils[_0xa223('0x15')]();if(_0x50d0ca[_0xa223('0x41')]==_0xa223('0x42')){if(!queues[_0x50d0ca[_0xa223('0x5')]][_0xa223('0x42')]){queues[_0x50d0ca[_0xa223('0x5')]][_0xa223('0xb')]=_0xa223('0x43');}}else{queues[_0x50d0ca[_0xa223('0x5')]]['queuecallerexitreason']=_0xa223('0x44')+_0x50d0ca['reason'][_0xa223('0x2a')]();}utils['info'](util[_0xa223('0x3')](_0xa223('0x45'),_0x50d0ca['uniqueid'],queues[_0x50d0ca[_0xa223('0x5')]][_0xa223('0x21')],_0x50d0ca[_0xa223('0x3d')],queues[_0x50d0ca[_0xa223('0x5')]][_0xa223('0xb')]));writeDB(queues[_0x50d0ca[_0xa223('0x5')]]);}}}catch(_0x2c43ac){utils[_0xa223('0x16')](util[_0xa223('0x3')]('[%s][queues][agentcomplete]',_0x50d0ca[_0xa223('0x5')]),_0x2c43ac);}};exports[_0xa223('0x46')]=function(_0x42806c){try{if(!_[_0xa223('0x19')](queues[_0x42806c[_0xa223('0x47')]])){utils[_0xa223('0x11')](util[_0xa223('0x3')]('[%s][queues][blindtransfer]',_0x42806c[_0xa223('0x5')]),_0x42806c);queues[_0x42806c[_0xa223('0x47')]]['transfer']=!![];queues[_0x42806c[_0xa223('0x47')]][_0xa223('0x48')]=_0xa223('0x49');queues[_0x42806c['transfereeuniqueid']]['transferexten']=_0x42806c[_0xa223('0x4a')];queues[_0x42806c[_0xa223('0x47')]][_0xa223('0x4b')]=_0x42806c[_0xa223('0x47')];queues[_0x42806c['transfereeuniqueid']]['queuecallerexitreason']=_0xa223('0x4c');utils['info'](util[_0xa223('0x3')](_0xa223('0x4d'),_0x42806c['uniqueid'],queues[_0x42806c[_0xa223('0x47')]][_0xa223('0x21')],_0x42806c['transfereeuniqueid'],_0x42806c['extension']));}}catch(_0x4ef140){utils[_0xa223('0x16')](util[_0xa223('0x3')](_0xa223('0x4e'),_0x42806c['uniqueid']),_0x4ef140);}};exports[_0xa223('0x4f')]=function(_0x3c80cf){try{utils['debug'](util[_0xa223('0x3')](_0xa223('0x50'),_0x3c80cf[_0xa223('0x51')]),_0x3c80cf);if(_0x3c80cf['origtransfereruniqueid']==_0x3c80cf[_0xa223('0x52')]){if(!_['isNil'](queues[_0x3c80cf[_0xa223('0x53')]])){utils[_0xa223('0x2')](util[_0xa223('0x3')](_0xa223('0x54'),_0x3c80cf[_0xa223('0x51')],queues[_0x3c80cf[_0xa223('0x53')]][_0xa223('0x21')],_0x3c80cf[_0xa223('0x55')]));queues[_0x3c80cf[_0xa223('0x53')]][_0xa223('0x42')]=!![];queues[_0x3c80cf[_0xa223('0x53')]][_0xa223('0x48')]=_0xa223('0x56');queues[_0x3c80cf[_0xa223('0x53')]][_0xa223('0x57')]=_0x3c80cf[_0xa223('0x55')];queues[_0x3c80cf[_0xa223('0x53')]][_0xa223('0x4b')]=_0x3c80cf[_0xa223('0x51')];queues[_0x3c80cf[_0xa223('0x53')]][_0xa223('0xb')]='ATTENDEDTRANSFER';}if(!_[_0xa223('0x19')](queues[_0x3c80cf[_0xa223('0x52')]])){if(_0x3c80cf[_0xa223('0x58')]&&queues[_0x3c80cf[_0xa223('0x58')]]){queues[_0x3c80cf[_0xa223('0x58')]][_0xa223('0x23')]=0x1;queues[_0x3c80cf[_0xa223('0x47')]]=_['clone'](queues[_0x3c80cf['transfereelinkedid']]);queues[_0x3c80cf['transfereeuniqueid']][_0xa223('0x22')]=_0x3c80cf['transfertargetuniqueid'];queues[_0x3c80cf[_0xa223('0x47')]][_0xa223('0x23')]=0x2;queues[_0x3c80cf[_0xa223('0x47')]][_0xa223('0x9')]=queues[_0x3c80cf[_0xa223('0x53')]]['calleridnum'];queues[_0x3c80cf[_0xa223('0x47')]]['calleridname']=queues[_0x3c80cf[_0xa223('0x53')]][_0xa223('0x59')];queues[_0x3c80cf['transfereeuniqueid']][_0xa223('0x38')]=utils[_0xa223('0x15')]();queues[_0x3c80cf[_0xa223('0x47')]][_0xa223('0x1a')]=utils[_0xa223('0x15')]();queues[_0x3c80cf[_0xa223('0x47')]]['holdtime']=0x0;queues[_0x3c80cf['transfereeuniqueid']][_0xa223('0x5a')]=0x0;utils[_0xa223('0x2')](util[_0xa223('0x3')](_0xa223('0x5b'),_0x3c80cf[_0xa223('0x51')],queues[_0x3c80cf[_0xa223('0x47')]][_0xa223('0x21')],queues[_0x3c80cf[_0xa223('0x47')]][_0xa223('0x9')],queues[_0x3c80cf['transfereeuniqueid']][_0xa223('0x59')]));}else{utils[_0xa223('0x2')](util[_0xa223('0x3')](_0xa223('0x5c'),_0x3c80cf[_0xa223('0x51')],queues[_0x3c80cf[_0xa223('0x52')]][_0xa223('0x21')],_0x3c80cf[_0xa223('0x53')]));queues[_0x3c80cf[_0xa223('0x52')]]['transfereduniqueid']=_0x3c80cf[_0xa223('0x53')];}}}else if(_0x3c80cf[_0xa223('0x5d')]==_0x3c80cf['secondtransfererlinkedid']){if(!_[_0xa223('0x19')](queues[_0x3c80cf['origtransfererlinkedid']])){utils['info'](util[_0xa223('0x3')](_0xa223('0x5e'),_0x3c80cf[_0xa223('0x51')],queues[_0x3c80cf[_0xa223('0x52')]][_0xa223('0x21')],_0x3c80cf['secondtransfereruniqueid'],_0x3c80cf[_0xa223('0x5f')]));queues[_0x3c80cf[_0xa223('0x52')]][_0xa223('0x42')]=!![];queues[_0x3c80cf['origtransfererlinkedid']][_0xa223('0x48')]='ATTENDED';queues[_0x3c80cf[_0xa223('0x52')]][_0xa223('0x57')]=_0x3c80cf[_0xa223('0x5f')];queues[_0x3c80cf[_0xa223('0x52')]]['transferuniqueid']=_0x3c80cf[_0xa223('0x5d')];queues[_0x3c80cf[_0xa223('0x52')]][_0xa223('0xb')]=_0xa223('0x60');}if(!_[_0xa223('0x19')](queues[_0x3c80cf[_0xa223('0x53')]])){if(_0x3c80cf['transfertargetlinkedid']&&queues[_0x3c80cf[_0xa223('0x61')]]){queues[_0x3c80cf['transfertargetlinkedid']][_0xa223('0x23')]=0x1;queues[_0x3c80cf['transfertargetuniqueid']]=_[_0xa223('0x62')](queues[_0x3c80cf[_0xa223('0x61')]]);queues[_0x3c80cf[_0xa223('0x63')]][_0xa223('0x22')]=_0x3c80cf['transfertargetuniqueid'];queues[_0x3c80cf[_0xa223('0x63')]][_0xa223('0x23')]=0x2;queues[_0x3c80cf[_0xa223('0x63')]][_0xa223('0x9')]=queues[_0x3c80cf[_0xa223('0x52')]][_0xa223('0x9')];queues[_0x3c80cf['transfertargetuniqueid']][_0xa223('0x59')]=queues[_0x3c80cf['origtransfererlinkedid']][_0xa223('0x59')];queues[_0x3c80cf[_0xa223('0x63')]]['queuecallerjoinAt']=utils['now']();queues[_0x3c80cf[_0xa223('0x63')]]['queuecallerleaveAt']=utils[_0xa223('0x15')]();queues[_0x3c80cf[_0xa223('0x63')]]['holdtime']=0x0;queues[_0x3c80cf[_0xa223('0x63')]][_0xa223('0x5a')]=0x0;utils[_0xa223('0x2')](util[_0xa223('0x3')](_0xa223('0x64'),_0x3c80cf[_0xa223('0x51')],queues[_0x3c80cf[_0xa223('0x63')]]['name'],queues[_0x3c80cf[_0xa223('0x63')]][_0xa223('0x22')],queues[_0x3c80cf['transfertargetuniqueid']]['calleridnum'],queues[_0x3c80cf['transfertargetuniqueid']][_0xa223('0x59')]));}else{utils['info'](util[_0xa223('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x3c80cf[_0xa223('0x51')],queues[_0x3c80cf[_0xa223('0x53')]][_0xa223('0x21')],_0x3c80cf[_0xa223('0x52')]));queues[_0x3c80cf[_0xa223('0x53')]][_0xa223('0x22')]=_0x3c80cf['origtransfererlinkedid'];}}}}catch(_0x511c04){utils['error'](util['format']('[%s][queues][attendedtransfer]',_0x3c80cf['origtransfereruniqueid']),_0x511c04);}};exports[_0xa223('0x65')]=function(_0x346354){try{if(!_[_0xa223('0x19')](queues[_0x346354[_0xa223('0x5')]])){utils[_0xa223('0x11')](util[_0xa223('0x3')](_0xa223('0x66'),_0x346354[_0xa223('0x5')]),_0x346354);queues[_0x346354[_0xa223('0x5')]][_0xa223('0x67')]=utils['now']();utils[_0xa223('0x2')](util[_0xa223('0x3')](_0xa223('0x68'),_0x346354['uniqueid'],queues[_0x346354['uniqueid']]['name'],queues[_0x346354[_0xa223('0x5')]][_0xa223('0x67')]));}}catch(_0x5cd9f7){utils[_0xa223('0x16')](util[_0xa223('0x3')](_0xa223('0x66'),_0x346354[_0xa223('0x5')]),_0x5cd9f7);}};exports[_0xa223('0x69')]=function(_0x3ce789){try{if(!_[_0xa223('0x19')](queues[_0x3ce789['uniqueid']])){if(!_[_0xa223('0x19')](queues[_0x3ce789['uniqueid']]['musiconholdstartAt'])){utils[_0xa223('0x11')](util[_0xa223('0x3')]('[%s][queues][musiconholdstop]',_0x3ce789[_0xa223('0x5')]),_0x3ce789);queues[_0x3ce789['uniqueid']][_0xa223('0x5a')]+=utils[_0xa223('0x37')](utils['now'](),queues[_0x3ce789['uniqueid']][_0xa223('0x67')]);utils[_0xa223('0x2')](util[_0xa223('0x3')](_0xa223('0x6a'),_0x3ce789[_0xa223('0x5')],queues[_0x3ce789[_0xa223('0x5')]]['name'],queues[_0x3ce789[_0xa223('0x5')]][_0xa223('0x5a')]));delete queues[_0x3ce789[_0xa223('0x5')]][_0xa223('0x67')];}}}catch(_0x32e8a5){utils[_0xa223('0x16')](util[_0xa223('0x3')](_0xa223('0x6b'),_0x3ce789[_0xa223('0x5')]),_0x32e8a5);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 5cb19d4..dfd60bb 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 _0xe566=['[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereruniqueid','recording','lodash','util','./utils','format','[%s][recordings][writeDB]','uniqueid','blinds','accountcode','getUserByInternal','then','membername','UserId','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','channel','varset','variable','mixmonitor_filename','value','endsWith','.wav49','replace','.WAV','find','monitors','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','[%s][recordings][hangup]','newexten'];(function(_0x229d7e,_0x5bc489){var _0xa78280=function(_0x59850e){while(--_0x59850e){_0x229d7e['push'](_0x229d7e['shift']());}};_0xa78280(++_0x5bc489);}(_0xe566,0xa0));var _0x6e56=function(_0x618f59,_0xe7a3a6){_0x618f59=_0x618f59-0x0;var _0x24999d=_0xe566[_0x618f59];return _0x24999d;};'use strict';var _=require(_0x6e56('0x0'));var util=require(_0x6e56('0x1'));var utils=require(_0x6e56('0x2'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x4b9f4c){var _0x4eaae5;utils['info'](util[_0x6e56('0x3')](_0x6e56('0x4'),_0x4b9f4c[_0x6e56('0x5')]));if(transfers[_0x6e56('0x6')][_0x4b9f4c[_0x6e56('0x5')]]){_0x4eaae5=_0x4b9f4c[_0x6e56('0x5')];_0x4b9f4c[_0x6e56('0x5')]=transfers[_0x6e56('0x6')][_0x4b9f4c[_0x6e56('0x5')]]['transfereeuniqueid'];}if(_0x4b9f4c[_0x6e56('0x7')]){utils[_0x6e56('0x8')](_0x4b9f4c[_0x6e56('0x7')])[_0x6e56('0x9')](function(_0x1d833d){if(_0x1d833d){_0x4b9f4c[_0x6e56('0xa')]=_0x1d833d['name'];_0x4b9f4c[_0x6e56('0xb')]=_0x1d833d['id'];}utils['request'](_0x6e56('0xc'),_0x4b9f4c);});}else{utils['request'](_0x6e56('0xc'),_0x4b9f4c);}if(_0x4eaae5)delete transfers[_0x6e56('0x6')][_0x4eaae5];}exports[_0x6e56('0xd')]=function(_0x17fc90){try{utils[_0x6e56('0xe')](util[_0x6e56('0x3')](_0x6e56('0xf'),_0x17fc90[_0x6e56('0x5')]),_0x17fc90);if(_0x17fc90['uniqueid']==_0x17fc90[_0x6e56('0x10')]){utils[_0x6e56('0x11')](util[_0x6e56('0x3')](_0x6e56('0x12'),_0x17fc90[_0x6e56('0x5')],_0x17fc90['context'],_0x17fc90[_0x6e56('0x13')]));recordings[_0x17fc90[_0x6e56('0x5')]]={'uniqueid':_0x17fc90[_0x6e56('0x5')],'accountcode':_0x17fc90[_0x6e56('0x7')],'exten':_0x17fc90[_0x6e56('0x13')],'context':_0x17fc90[_0x6e56('0x14')],'channel':_0x17fc90['channel'],'monitors':[]};}}catch(_0x2445d5){utils[_0x6e56('0x15')](util[_0x6e56('0x3')]('[%s][recordings][newchannel]',_0x17fc90[_0x6e56('0x5')]),_0x2445d5);}};exports[_0x6e56('0x16')]=function(_0x520326){try{utils[_0x6e56('0xe')](util[_0x6e56('0x3')](_0x6e56('0x17'),_0x520326[_0x6e56('0x5')]),_0x520326);if(!_[_0x6e56('0x18')](recordings[_0x520326[_0x6e56('0x5')]])&&_0x520326['channelstate']==0x6){utils[_0x6e56('0x11')](util[_0x6e56('0x3')](_0x6e56('0x19'),_0x520326[_0x6e56('0x5')],_0x520326['context'],_0x520326['channel']));}else if(!_[_0x6e56('0x18')](recordings[_0x520326[_0x6e56('0x10')]])&&_0x520326[_0x6e56('0x1a')]==0x6&&_0x520326[_0x6e56('0x14')]!=_0x6e56('0x1b')){utils[_0x6e56('0x11')](util['format'](_0x6e56('0x1c'),_0x520326[_0x6e56('0x5')],_0x520326[_0x6e56('0x10')],_0x520326[_0x6e56('0x14')],_0x520326[_0x6e56('0x1d')]));recordings[_0x520326['linkedid']][_0x6e56('0x7')]=_0x520326[_0x6e56('0x7')];}}catch(_0x1f78ef){utils['error'](util[_0x6e56('0x3')](_0x6e56('0x17'),_0x520326[_0x6e56('0x5')]),_0x1f78ef);}};exports[_0x6e56('0x1e')]=function(_0x5e0ed2){try{if(!_[_0x6e56('0x18')](_0x5e0ed2[_0x6e56('0x1f')])&&!_[_0x6e56('0x18')](_0x5e0ed2[_0x6e56('0x1f')][_0x6e56('0x20')])){utils['debug'](util[_0x6e56('0x3')]('[%s][recordings][varset]',_0x5e0ed2[_0x6e56('0x5')]),_0x5e0ed2);utils['info'](util[_0x6e56('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x5e0ed2['uniqueid'],_0x5e0ed2[_0x6e56('0x1f')],_0x5e0ed2[_0x6e56('0x21')]));if(_[_0x6e56('0x22')](_0x5e0ed2[_0x6e56('0x21')],_0x6e56('0x23'))){_0x5e0ed2['value']=_0x5e0ed2['value'][_0x6e56('0x24')](_0x6e56('0x23'),_0x6e56('0x25'));}if(recordings[_0x5e0ed2['linkedid']]){var _0x3e2bb6=_[_0x6e56('0x26')](recordings[_0x5e0ed2[_0x6e56('0x10')]]['monitors'],{'value':_0x5e0ed2[_0x6e56('0x21')]});if(_[_0x6e56('0x18')](_0x3e2bb6)){recordings[_0x5e0ed2[_0x6e56('0x10')]][_0x6e56('0x27')]['push']({'value':_0x5e0ed2[_0x6e56('0x21')]});}}}}catch(_0x3366e5){utils[_0x6e56('0x15')](util[_0x6e56('0x3')]('[%s][recordings][varset]',_0x5e0ed2[_0x6e56('0x5')]),_0x3366e5);}};exports['hangup']=function(_0x32554f){try{if(!_[_0x6e56('0x18')](recordings[_0x32554f[_0x6e56('0x5')]])){utils[_0x6e56('0xe')](util['format']('[%s][recordings][hangup]',_0x32554f[_0x6e56('0x5')]),_0x32554f);utils[_0x6e56('0x11')](util[_0x6e56('0x3')](_0x6e56('0x28'),_0x32554f[_0x6e56('0x5')],_0x32554f[_0x6e56('0x29')],_0x32554f[_0x6e56('0x2a')],_0x32554f['cause-txt']));recordings[_0x32554f[_0x6e56('0x5')]][_0x6e56('0x29')]=_0x32554f['calleridnum'];recordings[_0x32554f[_0x6e56('0x5')]][_0x6e56('0x2a')]=_0x32554f[_0x6e56('0x2a')];recordings[_0x32554f[_0x6e56('0x5')]][_0x6e56('0x2b')]=_0x32554f[_0x6e56('0x2b')];recordings[_0x32554f[_0x6e56('0x5')]]['connectedlinename']=_0x32554f[_0x6e56('0x2c')];if(recordings[_0x32554f[_0x6e56('0x5')]][_0x6e56('0x2d')]=='outbound'&&recordings[_0x32554f[_0x6e56('0x5')]][_0x6e56('0x7')]){recordings[_0x32554f[_0x6e56('0x5')]]['connectedlinenum']=recordings[_0x32554f[_0x6e56('0x5')]][_0x6e56('0x7')];recordings[_0x32554f['uniqueid']][_0x6e56('0x2c')]='';}recordings[_0x32554f[_0x6e56('0x5')]]['monitors'][_0x6e56('0x2e')](function(_0x4c12f7){var _0x5c4471=_[_0x6e56('0x2f')](recordings[_0x32554f[_0x6e56('0x5')]]);_0x5c4471['value']=_0x4c12f7['value'];writeDB(_0x5c4471);});delete recordings[_0x32554f[_0x6e56('0x5')]];}}catch(_0x35cc24){utils[_0x6e56('0x15')](util['format'](_0x6e56('0x30'),_0x32554f[_0x6e56('0x5')]),_0x35cc24);}};exports[_0x6e56('0x31')]=function(_0x459ae7){try{if(!_[_0x6e56('0x18')](recordings[_0x459ae7[_0x6e56('0x5')]])){utils[_0x6e56('0xe')](util[_0x6e56('0x3')](_0x6e56('0x32'),_0x459ae7[_0x6e56('0x5')]),_0x459ae7);utils[_0x6e56('0x11')](util['format'](_0x6e56('0x33'),_0x459ae7[_0x6e56('0x5')],_0x459ae7['application'],_0x459ae7[_0x6e56('0x34')]));if(_0x459ae7[_0x6e56('0x35')][_0x6e56('0x36')]()==_0x6e56('0x37')&&_[_0x6e56('0x38')](_0x459ae7['appdata']['toLowerCase'](),_0x6e56('0x39'))){var _0x819ecb=_0x459ae7[_0x6e56('0x34')][_0x6e56('0x3a')]('=');var _0x1e9f28=_0x819ecb[0x0][_0x6e56('0x3b')](_0x819ecb[0x0][_0x6e56('0x3c')]('(')+0x1,_0x819ecb[0x0][_0x6e56('0x3c')](')'));var _0xf387a=_0x819ecb[0x1];recordings[_0x459ae7['uniqueid']][_0x1e9f28]=_0xf387a;}}}catch(_0x2432b9){utils[_0x6e56('0x15')](util[_0x6e56('0x3')](_0x6e56('0x32'),_0x459ae7[_0x6e56('0x5')]),_0x2432b9);}};exports['queuecallerjoin']=function(_0x317a80){try{if(!_['isNil'](recordings[_0x317a80[_0x6e56('0x5')]])){utils['debug'](util[_0x6e56('0x3')](_0x6e56('0x3d'),_0x317a80[_0x6e56('0x5')]),_0x317a80);utils[_0x6e56('0x11')](util[_0x6e56('0x3')](_0x6e56('0x3e'),_0x317a80[_0x6e56('0x5')],_0x317a80['queue']));recordings[_0x317a80[_0x6e56('0x5')]][_0x6e56('0x3f')]=_0x317a80['queue'];}}catch(_0x432614){utils['error'](util['format'](_0x6e56('0x3d'),_0x317a80[_0x6e56('0x5')]),_0x432614);}};exports['blindtransfer']=function(_0x9c6a76){try{utils[_0x6e56('0xe')](util['format'](_0x6e56('0x40'),_0x9c6a76[_0x6e56('0x5')]),_0x9c6a76);utils['info'](util['format'](_0x6e56('0x41'),_0x9c6a76[_0x6e56('0x5')],_0x9c6a76[_0x6e56('0x42')],_0x9c6a76[_0x6e56('0x43')],_0x9c6a76['transfereecalleridnum'],_0x9c6a76['transfereecalleridname']));if(recordings[_0x9c6a76[_0x6e56('0x44')]]&&transfers['blinds'][_0x9c6a76['transfereruniqueid']]){transfers[_0x6e56('0x6')][_0x9c6a76[_0x6e56('0x44')]][_0x6e56('0x45')]=!![];}}catch(_0x5becf0){utils[_0x6e56('0x15')](util[_0x6e56('0x3')](_0x6e56('0x40'),_0x9c6a76[_0x6e56('0x5')]),_0x5becf0);}}; \ No newline at end of file +var _0x3381=['cdr','split','substring','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','[%s][recordings][blindtransfer]','lodash','./utils','./transfers.controller','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','info','context','exten','channel','error','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.wav49','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','forEach','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith'];(function(_0x11238d,_0x499ac8){var _0x3686b0=function(_0x1b7cbc){while(--_0x1b7cbc){_0x11238d['push'](_0x11238d['shift']());}};_0x3686b0(++_0x499ac8);}(_0x3381,0x127));var _0x1338=function(_0x3b47d4,_0x2a4fe8){_0x3b47d4=_0x3b47d4-0x0;var _0x53c059=_0x3381[_0x3b47d4];return _0x53c059;};'use strict';var _=require(_0x1338('0x0'));var util=require('util');var utils=require(_0x1338('0x1'));var transfers=require(_0x1338('0x2'));var recordings={};function writeDB(_0x523121){var _0x524276;utils['info'](util[_0x1338('0x3')](_0x1338('0x4'),_0x523121['uniqueid']));if(transfers[_0x1338('0x5')][_0x523121['uniqueid']]){_0x524276=_0x523121['uniqueid'];_0x523121[_0x1338('0x6')]=transfers['blinds'][_0x523121['uniqueid']][_0x1338('0x7')];}if(_0x523121[_0x1338('0x8')]){utils['getUserByInternal'](_0x523121[_0x1338('0x8')])[_0x1338('0x9')](function(_0x240a61){if(_0x240a61){_0x523121[_0x1338('0xa')]=_0x240a61[_0x1338('0xb')];_0x523121[_0x1338('0xc')]=_0x240a61['id'];}utils[_0x1338('0xd')](_0x1338('0xe'),_0x523121);});}else{utils['request'](_0x1338('0xe'),_0x523121);}if(_0x524276)delete transfers[_0x1338('0x5')][_0x524276];}exports[_0x1338('0xf')]=function(_0x2db2e4){try{utils[_0x1338('0x10')](util[_0x1338('0x3')]('[%s][recordings][newchannel]',_0x2db2e4[_0x1338('0x6')]),_0x2db2e4);if(_0x2db2e4[_0x1338('0x6')]==_0x2db2e4[_0x1338('0x11')]){utils[_0x1338('0x12')](util[_0x1338('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x2db2e4[_0x1338('0x6')],_0x2db2e4[_0x1338('0x13')],_0x2db2e4[_0x1338('0x14')]));recordings[_0x2db2e4[_0x1338('0x6')]]={'uniqueid':_0x2db2e4[_0x1338('0x6')],'accountcode':_0x2db2e4[_0x1338('0x8')],'exten':_0x2db2e4['exten'],'context':_0x2db2e4[_0x1338('0x13')],'channel':_0x2db2e4[_0x1338('0x15')],'monitors':[]};}}catch(_0x2fde53){utils[_0x1338('0x16')](util['format'](_0x1338('0x17'),_0x2db2e4['uniqueid']),_0x2fde53);}};exports[_0x1338('0x18')]=function(_0x156ca3){try{utils['debug'](util['format'](_0x1338('0x19'),_0x156ca3[_0x1338('0x6')]),_0x156ca3);if(!_[_0x1338('0x1a')](recordings[_0x156ca3[_0x1338('0x6')]])&&_0x156ca3[_0x1338('0x1b')]==0x6){utils['info'](util['format'](_0x1338('0x1c'),_0x156ca3[_0x1338('0x6')],_0x156ca3[_0x1338('0x13')],_0x156ca3[_0x1338('0x15')]));}else if(!_[_0x1338('0x1a')](recordings[_0x156ca3[_0x1338('0x11')]])&&_0x156ca3[_0x1338('0x1b')]==0x6&&_0x156ca3['context']!='transfer'){utils['info'](util[_0x1338('0x3')](_0x1338('0x1d'),_0x156ca3['uniqueid'],_0x156ca3['linkedid'],_0x156ca3['context'],_0x156ca3[_0x1338('0x15')]));recordings[_0x156ca3[_0x1338('0x11')]][_0x1338('0x8')]=_0x156ca3[_0x1338('0x8')];}}catch(_0x26dd7d){utils[_0x1338('0x16')](util[_0x1338('0x3')]('[%s][recordings][newstate]',_0x156ca3[_0x1338('0x6')]),_0x26dd7d);}};exports['varset']=function(_0x224eb8){try{if(!_[_0x1338('0x1a')](_0x224eb8[_0x1338('0x1e')])&&!_[_0x1338('0x1a')](_0x224eb8[_0x1338('0x1e')][_0x1338('0x1f')])){utils[_0x1338('0x10')](util[_0x1338('0x3')](_0x1338('0x20'),_0x224eb8['uniqueid']),_0x224eb8);utils[_0x1338('0x12')](util[_0x1338('0x3')](_0x1338('0x21'),_0x224eb8[_0x1338('0x6')],_0x224eb8[_0x1338('0x1e')],_0x224eb8['value']));if(_['endsWith'](_0x224eb8[_0x1338('0x22')],'.wav49')){_0x224eb8['value']=_0x224eb8[_0x1338('0x22')][_0x1338('0x23')](_0x1338('0x24'),'.WAV');}if(recordings[_0x224eb8[_0x1338('0x11')]]){var _0x3986b7=_[_0x1338('0x25')](recordings[_0x224eb8[_0x1338('0x11')]][_0x1338('0x26')],{'value':_0x224eb8[_0x1338('0x22')]});if(_[_0x1338('0x1a')](_0x3986b7)){recordings[_0x224eb8[_0x1338('0x11')]]['monitors'][_0x1338('0x27')]({'value':_0x224eb8[_0x1338('0x22')]});}}}}catch(_0x477b01){utils[_0x1338('0x16')](util[_0x1338('0x3')](_0x1338('0x20'),_0x224eb8[_0x1338('0x6')]),_0x477b01);}};exports['hangup']=function(_0x65043){try{if(!_['isNil'](recordings[_0x65043['uniqueid']])){utils[_0x1338('0x10')](util['format'](_0x1338('0x28'),_0x65043[_0x1338('0x6')]),_0x65043);utils[_0x1338('0x12')](util[_0x1338('0x3')](_0x1338('0x29'),_0x65043['uniqueid'],_0x65043[_0x1338('0x2a')],_0x65043[_0x1338('0x2b')],_0x65043[_0x1338('0x2c')]));recordings[_0x65043['uniqueid']]['calleridnum']=_0x65043[_0x1338('0x2a')];recordings[_0x65043[_0x1338('0x6')]]['calleridname']=_0x65043[_0x1338('0x2b')];recordings[_0x65043['uniqueid']][_0x1338('0x2d')]=_0x65043['connectedlinenum'];recordings[_0x65043[_0x1338('0x6')]][_0x1338('0x2e')]=_0x65043[_0x1338('0x2e')];if(recordings[_0x65043['uniqueid']]['type']=='outbound'&&recordings[_0x65043[_0x1338('0x6')]]['accountcode']){recordings[_0x65043[_0x1338('0x6')]][_0x1338('0x2d')]=recordings[_0x65043[_0x1338('0x6')]][_0x1338('0x8')];recordings[_0x65043['uniqueid']][_0x1338('0x2e')]='';}recordings[_0x65043[_0x1338('0x6')]]['monitors'][_0x1338('0x2f')](function(_0x3be954){var _0x10a7cc=_['clone'](recordings[_0x65043[_0x1338('0x6')]]);_0x10a7cc[_0x1338('0x22')]=_0x3be954[_0x1338('0x22')];writeDB(_0x10a7cc);});delete recordings[_0x65043[_0x1338('0x6')]];}}catch(_0xbe721f){utils[_0x1338('0x16')](util['format'](_0x1338('0x28'),_0x65043[_0x1338('0x6')]),_0xbe721f);}};exports[_0x1338('0x30')]=function(_0xa3bf6d){try{if(!_[_0x1338('0x1a')](recordings[_0xa3bf6d['uniqueid']])){utils[_0x1338('0x10')](util['format']('[%s][recordings][newexten]',_0xa3bf6d[_0x1338('0x6')]),_0xa3bf6d);utils['info'](util[_0x1338('0x3')](_0x1338('0x31'),_0xa3bf6d['uniqueid'],_0xa3bf6d[_0x1338('0x32')],_0xa3bf6d[_0x1338('0x33')]));if(_0xa3bf6d[_0x1338('0x32')][_0x1338('0x34')]()==_0x1338('0x35')&&_[_0x1338('0x36')](_0xa3bf6d['appdata'][_0x1338('0x34')](),_0x1338('0x37'))){var _0xa3db4d=_0xa3bf6d[_0x1338('0x33')][_0x1338('0x38')]('=');var _0x4c2a35=_0xa3db4d[0x0][_0x1338('0x39')](_0xa3db4d[0x0]['lastIndexOf']('(')+0x1,_0xa3db4d[0x0]['lastIndexOf'](')'));var _0x8e93f0=_0xa3db4d[0x1];recordings[_0xa3bf6d[_0x1338('0x6')]][_0x4c2a35]=_0x8e93f0;}}}catch(_0x868f79){utils[_0x1338('0x16')](util[_0x1338('0x3')](_0x1338('0x3a'),_0xa3bf6d[_0x1338('0x6')]),_0x868f79);}};exports[_0x1338('0x3b')]=function(_0x1288fb){try{if(!_['isNil'](recordings[_0x1288fb['uniqueid']])){utils[_0x1338('0x10')](util[_0x1338('0x3')](_0x1338('0x3c'),_0x1288fb[_0x1338('0x6')]),_0x1288fb);utils[_0x1338('0x12')](util['format'](_0x1338('0x3d'),_0x1288fb[_0x1338('0x6')],_0x1288fb['queue']));recordings[_0x1288fb[_0x1338('0x6')]][_0x1338('0x3e')]=_0x1288fb[_0x1338('0x3e')];}}catch(_0x3cbf70){utils[_0x1338('0x16')](util[_0x1338('0x3')](_0x1338('0x3c'),_0x1288fb[_0x1338('0x6')]),_0x3cbf70);}};exports[_0x1338('0x3f')]=function(_0x5ceaff){try{utils['debug'](util[_0x1338('0x3')]('[%s][recordings][blindtransfer]',_0x5ceaff[_0x1338('0x6')]),_0x5ceaff);utils[_0x1338('0x12')](util['format'](_0x1338('0x40'),_0x5ceaff[_0x1338('0x6')],_0x5ceaff[_0x1338('0x41')],_0x5ceaff[_0x1338('0x42')],_0x5ceaff[_0x1338('0x43')],_0x5ceaff['transfereecalleridname']));if(recordings[_0x5ceaff[_0x1338('0x44')]]&&transfers[_0x1338('0x5')][_0x5ceaff['transfereruniqueid']]){transfers[_0x1338('0x5')][_0x5ceaff[_0x1338('0x44')]]['recording']=!![];}}catch(_0x5b41db){utils[_0x1338('0x16')](util[_0x1338('0x3')](_0x1338('0x45'),_0x5ceaff[_0x1338('0x6')]),_0x5b41db);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 1d22300..38cdf49 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 _0x97ea=['assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','[%s][transfers][attendedtransfer]','lodash','util','./utils','format','type','origtransfereruniqueid','uniqueid','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x97ea,0xa7));var _0xa97e=function(_0x4ccd32,_0x3b11c9){_0x4ccd32=_0x4ccd32-0x0;var _0x30b693=_0x97ea[_0x4ccd32];return _0x30b693;};'use strict';var _=require(_0xa97e('0x0'));var util=require(_0xa97e('0x1'));var utils=require(_0xa97e('0x2'));function writeDB(_0x1df014){utils['info'](util[_0xa97e('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x1df014[_0xa97e('0x4')]==='attended'?_0x1df014[_0xa97e('0x5')]:_0x1df014[_0xa97e('0x6')],_0x1df014[_0xa97e('0x4')]));utils[_0xa97e('0x7')]('CreateVoiceTransferReport',_0x1df014);}exports[_0xa97e('0x8')]={};exports[_0xa97e('0x9')]=function(_0x38d2f1){try{utils[_0xa97e('0xa')](util[_0xa97e('0x3')](_0xa97e('0xb'),_0x38d2f1['uniqueid']),_0x38d2f1);utils[_0xa97e('0xc')](util[_0xa97e('0x3')](_0xa97e('0xd'),_0x38d2f1[_0xa97e('0x6')],_0x38d2f1['transferercalleridnum'],_0x38d2f1[_0xa97e('0xe')],_0x38d2f1[_0xa97e('0xf')],_0x38d2f1[_0xa97e('0x10')]));_0x38d2f1[_0xa97e('0x4')]=_0xa97e('0x11');exports[_0xa97e('0x8')][_0x38d2f1[_0xa97e('0x12')]]=_0x38d2f1;writeDB(_0x38d2f1);}catch(_0x28dbfb){utils['error'](util[_0xa97e('0x3')](_0xa97e('0xb'),_0x38d2f1[_0xa97e('0x6')]),_0x28dbfb);}};exports['attendedtransfer']=function(_0x4e4adb){try{utils[_0xa97e('0xa')](util['format']('[%s][transfers][attendedtransfer]',_0x4e4adb[_0xa97e('0x5')]),_0x4e4adb);utils[_0xa97e('0xc')](util[_0xa97e('0x3')](_0xa97e('0x13'),_0x4e4adb[_0xa97e('0x5')],_0x4e4adb[_0xa97e('0x14')],_0x4e4adb[_0xa97e('0x15')],_0x4e4adb['transfertargetcalleridnum'],_0x4e4adb[_0xa97e('0x16')]));_0x4e4adb=_[_0xa97e('0x17')](_0x4e4adb,{'transfererchannel':_0x4e4adb[_0xa97e('0x18')],'transferercalleridnum':_0x4e4adb[_0xa97e('0x14')],'transferercalleridname':_0x4e4adb[_0xa97e('0x15')],'transfererconnectedlinenum':_0x4e4adb[_0xa97e('0x19')],'transfererconnectedlinename':_0x4e4adb[_0xa97e('0x1a')],'transfereraccountcode':_0x4e4adb[_0xa97e('0x1b')],'transferercontext':_0x4e4adb['secondtransferercontext'],'transfererexten':_0x4e4adb['secondtransfererexten'],'transfererlinkedid':_0x4e4adb['origtransfererlinkedid'],'context':_0x4e4adb['origtransferercontext'],'extension':_0x4e4adb[_0xa97e('0x1c')],'type':_0xa97e('0x1d')});if(_[_0xa97e('0x1e')](_0x4e4adb[_0xa97e('0x1f')])){_0x4e4adb=_[_0xa97e('0x17')](_0x4e4adb,{'transfereechannel':_0x4e4adb[_0xa97e('0x20')],'transfereecalleridnum':_0x4e4adb['transfertargetcalleridnum'],'transfereecalleridname':_0x4e4adb[_0xa97e('0x16')],'transfereeconnectedlinenum':_0x4e4adb['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4e4adb[_0xa97e('0x21')],'transfereeaccountcode':_0x4e4adb[_0xa97e('0x22')],'transfereecontext':_0x4e4adb[_0xa97e('0x23')],'transfereeexten':_0x4e4adb[_0xa97e('0x24')],'transfereelinkedid':_0x4e4adb['transfertargetlinkedid']});}writeDB(_0x4e4adb);}catch(_0x13e644){utils['error'](util['format'](_0xa97e('0x25'),_0x4e4adb[_0xa97e('0x5')]),_0x13e644);}}; \ No newline at end of file +var _0x984e=['transferercalleridnum','transferercalleridname','blind','transfereruniqueid','error','debug','[%s][transfers][attendedtransfer]','origtransfereruniqueid','info','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','blinds','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x214d54,_0x133c72){var _0x44ca46=function(_0xe42b02){while(--_0xe42b02){_0x214d54['push'](_0x214d54['shift']());}};_0x44ca46(++_0x133c72);}(_0x984e,0x1a2));var _0xe984=function(_0x39fdd8,_0xc8a2bd){_0x39fdd8=_0x39fdd8-0x0;var _0x3f9347=_0x984e[_0x39fdd8];return _0x3f9347;};'use strict';var _=require(_0xe984('0x0'));var util=require(_0xe984('0x1'));var utils=require('./utils');function writeDB(_0x162e92){utils['info'](util[_0xe984('0x2')](_0xe984('0x3'),_0x162e92[_0xe984('0x4')]===_0xe984('0x5')?_0x162e92['origtransfereruniqueid']:_0x162e92[_0xe984('0x6')],_0x162e92[_0xe984('0x4')]));utils['request']('CreateVoiceTransferReport',_0x162e92);}exports[_0xe984('0x7')]={};exports[_0xe984('0x8')]=function(_0x4401a4){try{utils['debug'](util[_0xe984('0x2')](_0xe984('0x9'),_0x4401a4[_0xe984('0x6')]),_0x4401a4);utils['info'](util['format'](_0xe984('0xa'),_0x4401a4[_0xe984('0x6')],_0x4401a4[_0xe984('0xb')],_0x4401a4[_0xe984('0xc')],_0x4401a4['transfereecalleridnum'],_0x4401a4['transfereecalleridname']));_0x4401a4[_0xe984('0x4')]=_0xe984('0xd');exports[_0xe984('0x7')][_0x4401a4[_0xe984('0xe')]]=_0x4401a4;writeDB(_0x4401a4);}catch(_0x2b3656){utils[_0xe984('0xf')](util[_0xe984('0x2')](_0xe984('0x9'),_0x4401a4[_0xe984('0x6')]),_0x2b3656);}};exports['attendedtransfer']=function(_0x4c4dc5){try{utils[_0xe984('0x10')](util[_0xe984('0x2')](_0xe984('0x11'),_0x4c4dc5[_0xe984('0x12')]),_0x4c4dc5);utils[_0xe984('0x13')](util[_0xe984('0x2')](_0xe984('0x14'),_0x4c4dc5[_0xe984('0x12')],_0x4c4dc5[_0xe984('0x15')],_0x4c4dc5['origtransferercalleridname'],_0x4c4dc5[_0xe984('0x16')],_0x4c4dc5[_0xe984('0x17')]));_0x4c4dc5=_[_0xe984('0x18')](_0x4c4dc5,{'transfererchannel':_0x4c4dc5[_0xe984('0x19')],'transferercalleridnum':_0x4c4dc5['origtransferercalleridnum'],'transferercalleridname':_0x4c4dc5[_0xe984('0x1a')],'transfererconnectedlinenum':_0x4c4dc5[_0xe984('0x1b')],'transfererconnectedlinename':_0x4c4dc5[_0xe984('0x1c')],'transfereraccountcode':_0x4c4dc5['origtransfereraccountcode'],'transferercontext':_0x4c4dc5[_0xe984('0x1d')],'transfererexten':_0x4c4dc5[_0xe984('0x1e')],'transfererlinkedid':_0x4c4dc5[_0xe984('0x1f')],'context':_0x4c4dc5['origtransferercontext'],'extension':_0x4c4dc5[_0xe984('0x20')],'type':_0xe984('0x5')});if(_[_0xe984('0x21')](_0x4c4dc5[_0xe984('0x22')])){_0x4c4dc5=_[_0xe984('0x18')](_0x4c4dc5,{'transfereechannel':_0x4c4dc5['transfertargetchannel'],'transfereecalleridnum':_0x4c4dc5[_0xe984('0x16')],'transfereecalleridname':_0x4c4dc5[_0xe984('0x17')],'transfereeconnectedlinenum':_0x4c4dc5['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4c4dc5[_0xe984('0x23')],'transfereeaccountcode':_0x4c4dc5[_0xe984('0x24')],'transfereecontext':_0x4c4dc5[_0xe984('0x25')],'transfereeexten':_0x4c4dc5[_0xe984('0x26')],'transfereelinkedid':_0x4c4dc5['transfertargetlinkedid']});}writeDB(_0x4c4dc5);}catch(_0x2f698f){utils[_0xe984('0xf')](util[_0xe984('0x2')](_0xe984('0x11'),_0x4c4dc5[_0xe984('0x12')]),_0x2f698f);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 1dc55b0..e3284b1 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 _0xa984=['sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','GetUser','internal','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','catch','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff'];(function(_0x57cde7,_0x1497c5){var _0x2aec58=function(_0x15578f){while(--_0x15578f){_0x57cde7['push'](_0x57cde7['shift']());}};_0x2aec58(++_0x1497c5);}(_0xa984,0x15a));var _0x4a98=function(_0x5cd60f,_0x3a852e){_0x5cd60f=_0x5cd60f-0x0;var _0x51dc86=_0xa984[_0x5cd60f];return _0x51dc86;};'use strict';var BPromise=require(_0x4a98('0x0'));var jayson=require(_0x4a98('0x1'));var moment=require(_0x4a98('0x2'));var util=require(_0x4a98('0x3'));var client=jayson[_0x4a98('0x4')][_0x4a98('0x5')]({'port':0x2329});var logger=require(_0x4a98('0x6'))(_0x4a98('0x7'));exports[_0x4a98('0x8')]=function(_0x36f0f5,_0x3921a){logger[_0x4a98('0x8')](_0x36f0f5,_0x3921a?util[_0x4a98('0x9')](_0x3921a,{'showHidden':![],'depth':null}):'');};exports[_0x4a98('0xa')]=function(_0x4e24d1,_0x522f90){logger[_0x4a98('0xa')](_0x4e24d1,_0x522f90?util['inspect'](_0x522f90,{'showHidden':![],'depth':null}):'');};exports[_0x4a98('0xb')]=function(_0x59e3a5,_0x62ec0){logger['error'](_0x59e3a5,_0x62ec0?util[_0x4a98('0x9')](_0x62ec0,{'showHidden':![],'depth':null}):'');};exports[_0x4a98('0xc')]=function(_0x1242c4,_0x210345){return client[_0x4a98('0xc')](_0x1242c4,{'body':_0x210345})['then'](function(_0x2fc026){logger[_0x4a98('0xa')](_0x4a98('0xd'),_0x1242c4,_0x2fc026?util[_0x4a98('0x9')](_0x2fc026,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x8c96cd){logger[_0x4a98('0xb')](_0x4a98('0xd'),_0x1242c4,_0x8c96cd?util[_0x4a98('0x9')](_0x8c96cd,{'showHidden':![],'depth':null}):'');});};function getUser(_0x309911){return client[_0x4a98('0xc')](_0x4a98('0xe'),{'options':{'raw':!![],'attributes':['id',_0x4a98('0xf'),'name','interface'],'where':_0x309911,'limit':0x1}})[_0x4a98('0x10')](function(_0x219941){logger[_0x4a98('0xa')](_0x4a98('0x11'),JSON[_0x4a98('0x12')](_0x309911),_0x219941?util['inspect'](_0x219941,{'showHidden':![],'depth':null}):'');return _0x219941[_0x4a98('0x13')][_0x4a98('0x14')]?_0x219941['result'][0x0]:null;});}exports[_0x4a98('0x15')]=function(_0xc47316){return new BPromise(function(_0x47c1c0,_0x325b1e){if(_0xc47316){return getUser({'internal':_0xc47316})[_0x4a98('0x10')](function(_0x697a14){logger[_0x4a98('0x8')](_0x4a98('0x16'),_0xc47316,_0x697a14?_0x4a98('0x17'):_0x4a98('0x18'));return _0x47c1c0(_0x697a14);})['catch'](function(_0x447be1){logger[_0x4a98('0xb')](_0x4a98('0x19'),_0x447be1?util[_0x4a98('0x9')](_0x447be1,{'showHidden':![],'depth':null}):'');return _0x47c1c0(null);});}return _0x47c1c0(null);});};exports[_0x4a98('0x1a')]=function(_0x4b3a3a){return new BPromise(function(_0x394835,_0x287fc7){if(_0x4b3a3a){return getUser({'interface':_0x4b3a3a})[_0x4a98('0x10')](function(_0x2bee34){logger[_0x4a98('0x8')](_0x4a98('0x1b'),_0x4b3a3a,_0x2bee34?_0x4a98('0x17'):_0x4a98('0x18'));return _0x394835(_0x2bee34);})[_0x4a98('0x1c')](function(_0x4a5cf5){logger[_0x4a98('0xb')](_0x4a98('0x1d'),_0x4a5cf5?util[_0x4a98('0x9')](_0x4a5cf5,{'showHidden':![],'depth':null}):'');return _0x394835(null);});}return _0x394835(null);});};exports[_0x4a98('0x1e')]=function(_0x168316){return new BPromise(function(_0x10c2ad,_0x4e1d06){if(_0x168316){return getUser({'name':_0x168316})[_0x4a98('0x10')](function(_0x4adfe0){logger[_0x4a98('0x8')](_0x4a98('0x1f'),_0x168316,_0x4adfe0?_0x4a98('0x17'):_0x4a98('0x18'));return _0x10c2ad(_0x4adfe0);})[_0x4a98('0x1c')](function(_0x1a5c65){logger[_0x4a98('0xb')]('[utils][getUserByName]',_0x1a5c65?util[_0x4a98('0x9')](_0x1a5c65,{'showHidden':![],'depth':null}):'');return _0x10c2ad(null);});}return _0x10c2ad(null);});};exports[_0x4a98('0x20')]=function(_0x29e078){return new BPromise(function(_0x211bea,_0x2ed57f){if(_0x29e078){return client['request'](_0x4a98('0x21'),{'options':{'raw':!![],'attributes':['id',_0x4a98('0x22'),_0x4a98('0x23'),_0x4a98('0x24'),_0x4a98('0x25')],'where':{'name':_0x29e078},'limit':0x1}})[_0x4a98('0x10')](function(_0x2318cc){logger[_0x4a98('0xa')]('[utils][getVoiceQueueByName]\x20name:%s',_0x29e078,_0x2318cc?util[_0x4a98('0x9')](_0x2318cc,{'showHidden':![],'depth':null}):'');logger[_0x4a98('0x8')](_0x4a98('0x26'),_0x29e078,_0x2318cc?_0x4a98('0x17'):'notfound');return _0x211bea(_0x2318cc[_0x4a98('0x13')][_0x4a98('0x14')]?_0x2318cc[_0x4a98('0x13')][0x0]:null);})[_0x4a98('0x1c')](function(_0x48d6c3){logger['error']('[utils][getVoiceQueueByName]',_0x48d6c3?util['inspect'](_0x48d6c3,{'showHidden':![],'depth':null}):'');return _0x211bea(null);});}return _0x211bea(null);});};exports['addTime']=function(_0xfd67ba,_0x5396dd){return moment(_0xfd67ba)['add'](_0x5396dd,_0x4a98('0x27'))[_0x4a98('0x28')](_0x4a98('0x29'));};exports[_0x4a98('0x2a')]=function(_0x2d04f7,_0x482a3d){return moment(_0x2d04f7)[_0x4a98('0x2b')](_0x482a3d,_0x4a98('0x27'))['format'](_0x4a98('0x29'));};exports[_0x4a98('0x2c')]=function(_0x235121,_0x59531b){return moment(_0x235121)[_0x4a98('0x2d')](moment(_0x59531b),_0x4a98('0x27'));};exports[_0x4a98('0x2e')]=function(_0x3c5dfd,_0x4c3403){return parseInt(_0x3c5dfd,0xa)+parseInt(_0x4c3403,0xa);};exports['now']=function(){return moment()[_0x4a98('0x28')](_0x4a98('0x29'));};exports[_0x4a98('0x2f')]=function(_0x32b117,_0xca4fd1){if(_0xca4fd1){return moment(_0x32b117)[_0x4a98('0x2f')](_0xca4fd1);}return!![];};exports[_0x4a98('0x30')]=function(_0xc13306,_0x120a88){if(_0x120a88){return moment(_0xc13306)[_0x4a98('0x30')](_0x120a88);}else if(_0xc13306){return!![];}return![];}; \ No newline at end of file +var _0x779e=['http','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','interface','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','found','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','seconds','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','client'];(function(_0x34aa2f,_0xd67470){var _0x584f28=function(_0x5e1a13){while(--_0x5e1a13){_0x34aa2f['push'](_0x34aa2f['shift']());}};_0x584f28(++_0xd67470);}(_0x779e,0x137));var _0xe779=function(_0x56e0e8,_0x16ef91){_0x56e0e8=_0x56e0e8-0x0;var _0x2dab50=_0x779e[_0x56e0e8];return _0x2dab50;};'use strict';var BPromise=require(_0xe779('0x0'));var jayson=require(_0xe779('0x1'));var moment=require(_0xe779('0x2'));var util=require('util');var client=jayson[_0xe779('0x3')][_0xe779('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x234bb8,_0x3c963f){logger[_0xe779('0x5')](_0x234bb8,_0x3c963f?util[_0xe779('0x6')](_0x3c963f,{'showHidden':![],'depth':null}):'');};exports[_0xe779('0x7')]=function(_0x2684de,_0x3e784b){logger[_0xe779('0x7')](_0x2684de,_0x3e784b?util[_0xe779('0x6')](_0x3e784b,{'showHidden':![],'depth':null}):'');};exports[_0xe779('0x8')]=function(_0x205349,_0x5d6513){logger[_0xe779('0x8')](_0x205349,_0x5d6513?util[_0xe779('0x6')](_0x5d6513,{'showHidden':![],'depth':null}):'');};exports[_0xe779('0x9')]=function(_0x441ed8,_0x1b2b13){return client['request'](_0x441ed8,{'body':_0x1b2b13})[_0xe779('0xa')](function(_0x374ce5){logger[_0xe779('0x7')](_0xe779('0xb'),_0x441ed8,_0x374ce5?util[_0xe779('0x6')](_0x374ce5,{'showHidden':![],'depth':null}):'');})[_0xe779('0xc')](function(_0xe07454){logger[_0xe779('0x8')](_0xe779('0xb'),_0x441ed8,_0xe07454?util['inspect'](_0xe07454,{'showHidden':![],'depth':null}):'');});};function getUser(_0x21c45b){return client[_0xe779('0x9')](_0xe779('0xd'),{'options':{'raw':!![],'attributes':['id',_0xe779('0xe'),'name',_0xe779('0xf')],'where':_0x21c45b,'limit':0x1}})[_0xe779('0xa')](function(_0x32aa45){logger[_0xe779('0x7')]('[utils][getUser]\x20where:%s',JSON['stringify'](_0x21c45b),_0x32aa45?util[_0xe779('0x6')](_0x32aa45,{'showHidden':![],'depth':null}):'');return _0x32aa45[_0xe779('0x10')][_0xe779('0x11')]?_0x32aa45[_0xe779('0x10')][0x0]:null;});}exports[_0xe779('0x12')]=function(_0x5aca1d){return new BPromise(function(_0x93eaeb,_0x5f0803){if(_0x5aca1d){return getUser({'internal':_0x5aca1d})[_0xe779('0xa')](function(_0x218eec){logger['info'](_0xe779('0x13'),_0x5aca1d,_0x218eec?'found':_0xe779('0x14'));return _0x93eaeb(_0x218eec);})[_0xe779('0xc')](function(_0x514cab){logger['error'](_0xe779('0x15'),_0x514cab?util['inspect'](_0x514cab,{'showHidden':![],'depth':null}):'');return _0x93eaeb(null);});}return _0x93eaeb(null);});};exports[_0xe779('0x16')]=function(_0x2c0675){return new BPromise(function(_0x476927,_0x9ce3ae){if(_0x2c0675){return getUser({'interface':_0x2c0675})[_0xe779('0xa')](function(_0x2c71c0){logger[_0xe779('0x5')](_0xe779('0x17'),_0x2c0675,_0x2c71c0?'found':_0xe779('0x14'));return _0x476927(_0x2c71c0);})['catch'](function(_0x3c4d95){logger[_0xe779('0x8')]('[utils][getUserByInterface]',_0x3c4d95?util[_0xe779('0x6')](_0x3c4d95,{'showHidden':![],'depth':null}):'');return _0x476927(null);});}return _0x476927(null);});};exports[_0xe779('0x18')]=function(_0x19735f){return new BPromise(function(_0x2b988f,_0x43cc83){if(_0x19735f){return getUser({'name':_0x19735f})[_0xe779('0xa')](function(_0x4aa430){logger[_0xe779('0x5')]('[utils][getUserByName]\x20name:%s\x20%s',_0x19735f,_0x4aa430?_0xe779('0x19'):_0xe779('0x14'));return _0x2b988f(_0x4aa430);})['catch'](function(_0x16aed4){logger[_0xe779('0x8')](_0xe779('0x1a'),_0x16aed4?util['inspect'](_0x16aed4,{'showHidden':![],'depth':null}):'');return _0x2b988f(null);});}return _0x2b988f(null);});};exports[_0xe779('0x1b')]=function(_0x3b6dc4){return new BPromise(function(_0x44a91d,_0x26d93e){if(_0x3b6dc4){return client[_0xe779('0x9')](_0xe779('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xe779('0x1d'),_0xe779('0x1e'),_0xe779('0x1f'),'acwTimeout'],'where':{'name':_0x3b6dc4},'limit':0x1}})[_0xe779('0xa')](function(_0x40c42f){logger[_0xe779('0x7')](_0xe779('0x20'),_0x3b6dc4,_0x40c42f?util['inspect'](_0x40c42f,{'showHidden':![],'depth':null}):'');logger[_0xe779('0x5')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x3b6dc4,_0x40c42f?_0xe779('0x19'):'notfound');return _0x44a91d(_0x40c42f[_0xe779('0x10')][_0xe779('0x11')]?_0x40c42f[_0xe779('0x10')][0x0]:null);})[_0xe779('0xc')](function(_0x371faa){logger[_0xe779('0x8')](_0xe779('0x21'),_0x371faa?util['inspect'](_0x371faa,{'showHidden':![],'depth':null}):'');return _0x44a91d(null);});}return _0x44a91d(null);});};exports[_0xe779('0x22')]=function(_0x54031b,_0x4c68cf){return moment(_0x54031b)['add'](_0x4c68cf,'seconds')[_0xe779('0x23')](_0xe779('0x24'));};exports[_0xe779('0x25')]=function(_0xba3322,_0x2f44ca){return moment(_0xba3322)[_0xe779('0x26')](_0x2f44ca,'seconds')['format'](_0xe779('0x24'));};exports['diffTime']=function(_0x5c6dd3,_0x45abfd){return moment(_0x5c6dd3)[_0xe779('0x27')](moment(_0x45abfd),_0xe779('0x28'));};exports[_0xe779('0x29')]=function(_0x54621f,_0x3d1763){return parseInt(_0x54621f,0xa)+parseInt(_0x3d1763,0xa);};exports[_0xe779('0x2a')]=function(){return moment()[_0xe779('0x23')](_0xe779('0x24'));};exports[_0xe779('0x2b')]=function(_0x5c78ed,_0x44a67f){if(_0x44a67f){return moment(_0x5c78ed)[_0xe779('0x2b')](_0x44a67f);}return!![];};exports[_0xe779('0x2c')]=function(_0x2e94ff,_0x1e8ee1){if(_0x1e8ee1){return moment(_0x2e94ff)[_0xe779('0x2c')](_0x1e8ee1);}else if(_0x2e94ff){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index b3cac44..a35c75f 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb44=['set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','other','setupLoggers','lodash','express-winston','path','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','role','ensureDir','then','client','catch','user','no-user','data','timestamp','auth'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xdb44,0x6c));var _0x4db4=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xdb44[_0x2f1762];return _0x8ab21;};var fs=require('fs-extra');var _=require(_0x4db4('0x0'));var ewinston=require(_0x4db4('0x1'));var path=require(_0x4db4('0x2'));var util=require('util');var fileLogger=require(_0x4db4('0x3'))[_0x4db4('0x4')];var safeTemplate=require(_0x4db4('0x5'))['safeTemplate'];var maskSensitiveData=require(_0x4db4('0x6'))[_0x4db4('0x7')];function ClientSideLogger(){function _0x84a620(_0x14e6c2){var _0x52168c=path[_0x4db4('0x8')](_0x4db4('0x9'),_0x4db4('0xa'),'xcally');var _0x31d228=path[_0x4db4('0x8')]('client',_0x14e6c2[_0x4db4('0xb')]+'-'+_0x14e6c2['name']);return fs[_0x4db4('0xc')](path['join'](_0x52168c,_0x31d228))[_0x4db4('0xd')](function(){var _0x1d11cc=fileLogger(_0x4db4('0xe'),path[_0x4db4('0x8')](_0x52168c,_0x31d228));return _0x1d11cc;})[_0x4db4('0xf')](function(_0x1cbbba){throw _0x1cbbba;});}this[_0x4db4('0xa')]=function(_0x44639e,_0x4ec47b,_0x45853e,_0xe3edfb){return _0x84a620(_0x44639e['user'])[_0x4db4('0xd')](function(_0x50d228){var _0x3fd716=_0x50d228[_0x4ec47b];return _0x3fd716;})[_0x4db4('0xd')](function(_0x5ea9b0){var _0x2a9337=_0x44639e[_0x4db4('0x10')]?_0x44639e['user']['id']:_0x4db4('0x11');var _0x26be95=_0xe3edfb[_0x4db4('0x12')];var _0x520d83=_0xe3edfb[_0x4db4('0x13')];var _0x577e1a=new Date(Number(_0x520d83));return _0x5ea9b0(_0x2a9337,_0x577e1a,_0x45853e,_0x26be95);})['catch'](function(_0x429839){fileLogger('client')['error'](_0x429839);});};}function setupLoggers(_0x17ce22){return new Promise(function(_0x7ef87b){var _0x19151f=new ClientSideLogger();var _0x63c4e6=fileLogger('api');var _0x3a79de=fileLogger(_0x4db4('0x14'));_0x17ce22[_0x4db4('0x15')]('client-side-logger',_0x19151f);_0x17ce22[_0x4db4('0x16')](ewinston[_0x4db4('0x17')]({'winstonInstance':_0x63c4e6,'meta':![],'statusLevels':!![],'msg':function(_0xb8c650,_0xff6c40){var _0x2878ab=_0x4db4('0x18');if(!_[_0x4db4('0x19')](_0xb8c650[_0x4db4('0x1a')])){_0x2878ab+='\x20body=%s';var _0x150210=_0xb8c650[_0x4db4('0x1a')];maskSensitiveData(_0x150210);}return safeTemplate(util[_0x4db4('0x1b')](_0x2878ab,_0xb8c650[_0x4db4('0x1c')],_0xb8c650[_0x4db4('0x1d')][_0x4db4('0x1e')]?_0xb8c650['headers'][_0x4db4('0x1e')]:_0xb8c650[_0x4db4('0x1f')][_0x4db4('0x20')]||_0xb8c650['ip'],_0xb8c650[_0x4db4('0x21')],_0xff6c40[_0x4db4('0x22')],_0xff6c40[_0x4db4('0x23')],_0xb8c650['user']?_0xb8c650['user']['id']:null,_0xb8c650[_0x4db4('0x10')]?_0xb8c650[_0x4db4('0x10')][_0x4db4('0x24')]:null,_0xb8c650['user']?_0xb8c650['user'][_0x4db4('0xb')]:null,_0x150210?util[_0x4db4('0x25')](_0x150210,![],null):''));}}));_0x17ce22[_0x4db4('0x16')](ewinston[_0x4db4('0x17')]({'winstonInstance':_0x3a79de,'meta':![],'statusLevels':!![],'msg':function(_0x441c99,_0x25d62e){var _0x102ca9=_0x4db4('0x26');if(_0x441c99[_0x4db4('0x1a')]&&_0x441c99['body'][_0x4db4('0x27')]&&_0x441c99['body'][_0x4db4('0x28')]){_0x102ca9='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x4db4('0x1b')](_0x102ca9,_0x441c99[_0x4db4('0x1c')],_0x441c99['headers'][_0x4db4('0x1e')]?_0x441c99['headers'][_0x4db4('0x1e')]:_0x441c99[_0x4db4('0x1f')][_0x4db4('0x20')]||_0x441c99['ip'],_0x441c99[_0x4db4('0x21')],_0x25d62e[_0x4db4('0x22')],_0x25d62e[_0x4db4('0x23')],_0x441c99[_0x4db4('0x10')]?_0x441c99[_0x4db4('0x10')]['id']:null,_0x441c99[_0x4db4('0x10')]?_0x441c99[_0x4db4('0x10')][_0x4db4('0x24')]:null,_0x441c99[_0x4db4('0x10')]?_0x441c99[_0x4db4('0x10')]['role']:null,_0x441c99['body']&&_0x441c99[_0x4db4('0x1a')][_0x4db4('0x27')]?_0x441c99[_0x4db4('0x1a')][_0x4db4('0x27')]:_0x4db4('0x29'),_0x441c99[_0x4db4('0x1a')]&&_0x441c99[_0x4db4('0x1a')][_0x4db4('0x28')]?_0x441c99[_0x4db4('0x1a')][_0x4db4('0x28')]:'',_0x441c99[_0x4db4('0x1a')]&&_0x441c99['body']['agent_name']?_0x441c99[_0x4db4('0x1a')]['agent_name']:'');},'ignoreRoute':function(_0x25940e){var _0x5ce12e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5ce12e['test'](_0x25940e[_0x4db4('0x21')]);}}));return _0x7ef87b();});}exports[_0x4db4('0x2a')]=setupLoggers; \ No newline at end of file +var _0x5509=['statusCode','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','client','name','catch','user','then','no-user','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','url','responseTime','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)','remoteAddress'];(function(_0xcd575c,_0x316ed0){var _0x367873=function(_0xa98ebc){while(--_0xa98ebc){_0xcd575c['push'](_0xcd575c['shift']());}};_0x367873(++_0x316ed0);}(_0x5509,0xc5));var _0x9550=function(_0x5f0b57,_0x2ff233){_0x5f0b57=_0x5f0b57-0x0;var _0x4b4792=_0x5509[_0x5f0b57];return _0x4b4792;};var fs=require(_0x9550('0x0'));var _=require(_0x9550('0x1'));var ewinston=require(_0x9550('0x2'));var path=require(_0x9550('0x3'));var util=require(_0x9550('0x4'));var fileLogger=require(_0x9550('0x5'))[_0x9550('0x6')];var safeTemplate=require(_0x9550('0x7'))['safeTemplate'];var maskSensitiveData=require(_0x9550('0x8'))[_0x9550('0x9')];function ClientSideLogger(){function _0x401f05(_0x51df26){var _0x5e0a8e=path[_0x9550('0xa')](_0x9550('0xb'),_0x9550('0xc'),'xcally');var _0x19f84b=path[_0x9550('0xa')](_0x9550('0xd'),_0x51df26['role']+'-'+_0x51df26[_0x9550('0xe')]);return fs['ensureDir'](path[_0x9550('0xa')](_0x5e0a8e,_0x19f84b))['then'](function(){var _0x2cc13a=fileLogger(_0x9550('0xd'),path[_0x9550('0xa')](_0x5e0a8e,_0x19f84b));return _0x2cc13a;})[_0x9550('0xf')](function(_0x1cf1e9){throw _0x1cf1e9;});}this[_0x9550('0xc')]=function(_0x306cd8,_0x3fcd03,_0x43ff2c,_0x21bdba){return _0x401f05(_0x306cd8[_0x9550('0x10')])[_0x9550('0x11')](function(_0xa97689){var _0x23573f=_0xa97689[_0x3fcd03];return _0x23573f;})[_0x9550('0x11')](function(_0x4b53b9){var _0x57b157=_0x306cd8[_0x9550('0x10')]?_0x306cd8[_0x9550('0x10')]['id']:_0x9550('0x12');var _0xda26ac=_0x21bdba['data'];var _0x3c604c=_0x21bdba['timestamp'];var _0x3a067b=new Date(Number(_0x3c604c));return _0x4b53b9(_0x57b157,_0x3a067b,_0x43ff2c,_0xda26ac);})[_0x9550('0xf')](function(_0x15212b){fileLogger(_0x9550('0xd'))[_0x9550('0x13')](_0x15212b);});};}function setupLoggers(_0x360a49){return new Promise(function(_0x388562){var _0x1e4646=new ClientSideLogger();var _0x533b33=fileLogger(_0x9550('0x14'));var _0x2af129=fileLogger(_0x9550('0x15'));_0x360a49[_0x9550('0x16')](_0x9550('0x17'),_0x1e4646);_0x360a49[_0x9550('0x18')](ewinston[_0x9550('0x19')]({'winstonInstance':_0x533b33,'meta':![],'statusLevels':!![],'msg':function(_0x147c04,_0x18bc74){var _0x25c3ff=_0x9550('0x1a');if(!_['isEmpty'](_0x147c04[_0x9550('0x1b')])){_0x25c3ff+=_0x9550('0x1c');var _0x3c3d48=_0x147c04[_0x9550('0x1b')];maskSensitiveData(_0x3c3d48);}return safeTemplate(util[_0x9550('0x1d')](_0x25c3ff,_0x147c04[_0x9550('0x1e')],_0x147c04[_0x9550('0x1f')][_0x9550('0x20')]?_0x147c04[_0x9550('0x1f')][_0x9550('0x20')]:_0x147c04[_0x9550('0x21')]['remoteAddress']||_0x147c04['ip'],_0x147c04[_0x9550('0x22')],_0x18bc74['statusCode'],_0x18bc74[_0x9550('0x23')],_0x147c04[_0x9550('0x10')]?_0x147c04[_0x9550('0x10')]['id']:null,_0x147c04[_0x9550('0x10')]?_0x147c04[_0x9550('0x10')][_0x9550('0xe')]:null,_0x147c04[_0x9550('0x10')]?_0x147c04[_0x9550('0x10')][_0x9550('0x24')]:null,_0x3c3d48?util[_0x9550('0x25')](_0x3c3d48,![],null):''));}}));_0x360a49[_0x9550('0x18')](ewinston[_0x9550('0x19')]({'winstonInstance':_0x2af129,'meta':![],'statusLevels':!![],'msg':function(_0x30890e,_0x3ebc3a){var _0x22389b=_0x9550('0x26');if(_0x30890e[_0x9550('0x1b')]&&_0x30890e[_0x9550('0x1b')][_0x9550('0x27')]&&_0x30890e[_0x9550('0x1b')][_0x9550('0x28')]){_0x22389b=_0x9550('0x29');}return util[_0x9550('0x1d')](_0x22389b,_0x30890e[_0x9550('0x1e')],_0x30890e[_0x9550('0x1f')][_0x9550('0x20')]?_0x30890e[_0x9550('0x1f')][_0x9550('0x20')]:_0x30890e[_0x9550('0x21')][_0x9550('0x2a')]||_0x30890e['ip'],_0x30890e[_0x9550('0x22')],_0x3ebc3a[_0x9550('0x2b')],_0x3ebc3a[_0x9550('0x23')],_0x30890e[_0x9550('0x10')]?_0x30890e['user']['id']:null,_0x30890e[_0x9550('0x10')]?_0x30890e[_0x9550('0x10')][_0x9550('0xe')]:null,_0x30890e['user']?_0x30890e[_0x9550('0x10')][_0x9550('0x24')]:null,_0x30890e[_0x9550('0x1b')]&&_0x30890e[_0x9550('0x1b')]['device']?_0x30890e[_0x9550('0x1b')][_0x9550('0x27')]:_0x9550('0x2c'),_0x30890e[_0x9550('0x1b')]&&_0x30890e[_0x9550('0x1b')]['agent_id']?_0x30890e['body'][_0x9550('0x28')]:'',_0x30890e[_0x9550('0x1b')]&&_0x30890e[_0x9550('0x1b')][_0x9550('0x2d')]?_0x30890e[_0x9550('0x1b')]['agent_name']:'');},'ignoreRoute':function(_0x5cdf30){var _0x1dca61=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1dca61[_0x9550('0x2e')](_0x5cdf30[_0x9550('0x22')]);}}));return _0x388562();});}exports[_0x9550('0x2f')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 6d0cbd9..fde3de2 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8536=['bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','meta','keys','stringify','Logger','Console','warn','transports','File','%s-%s','error','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','redBG\x20white','red'];(function(_0x52b746,_0x43d29a){var _0x56a505=function(_0x27dc81){while(--_0x27dc81){_0x52b746['push'](_0x52b746['shift']());}};_0x56a505(++_0x43d29a);}(_0x8536,0x98));var _0x6853=function(_0x514374,_0xd49613){_0x514374=_0x514374-0x0;var _0x15f252=_0x8536[_0x514374];return _0x15f252;};'use strict';var path=require(_0x6853('0x0'));var util=require(_0x6853('0x1'));var moment=require(_0x6853('0x2'));var winston=require(_0x6853('0x3'));var config=require(_0x6853('0x4'));var debugLevel=config[_0x6853('0x5')]?config[_0x6853('0x5')]['toLowerCase']():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x6853('0x6'),'error':_0x6853('0x7'),'warn':_0x6853('0x8'),'info':_0x6853('0x9'),'print':_0x6853('0xa'),'success':_0x6853('0xb'),'http':_0x6853('0xc'),'verbose':'bold\x20magenta','debug':_0x6853('0xd'),'silly':_0x6853('0xe')};winston[_0x6853('0xf')](XC_LOG_COLORS);function getLogFileName(_0x23f6b5,_0x2c1e6,_0x41e604){var _0x161a0f=_0x23f6b5||_0x6853('0x10');return path[_0x6853('0x11')](_0x161a0f,util[_0x6853('0x12')](_0x6853('0x13'),_0x2c1e6,_0x41e604));}function formatter(_0x14cfa1,_0x55d9e2){_0x55d9e2[_0x6853('0x14')]=_0x55d9e2['message']['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0x6853('0x15'))[_0x6853('0x16')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x6853('0x12')](_0x6853('0x17'),moment()['format'](_0x6853('0x18')),_0x55d9e2[_0x6853('0x19')][_0x6853('0x1a')](),_0x14cfa1,_0x55d9e2[_0x6853('0x14')]);}function fileFormat(_0x23b86c,_0x523386){_0x523386[_0x6853('0x14')]=_0x523386[_0x6853('0x14')]['replace'](/@@{/g,_0x6853('0x1b'))['replace'](/}@@/g,_0x6853('0x15'))[_0x6853('0x16')](/@{/g,'{{')[_0x6853('0x16')](/}@/g,'}}');var _0x3ffd34=_0x523386[_0x6853('0x1c')]&&Object[_0x6853('0x1d')](_0x523386[_0x6853('0x1c')])['length']?'\x0a\x09'+JSON[_0x6853('0x1e')](_0x523386[_0x6853('0x1c')]):'';return util[_0x6853('0x12')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x6853('0x12')](_0x6853('0x18')),_0x523386[_0x6853('0x19')][_0x6853('0x1a')](),_0x23b86c,_0x523386['message'],_0x3ffd34);}function consoleLogger(){var _0x42cde3=new winston[(_0x6853('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x6853('0x20'))]({'level':_0x6853('0x21'),'json':![],'formatter':function(_0x3da643){return formatter('',_0x3da643);}})]});return _0x42cde3;}function fileLogger(_0x838462,_0x4beafc){var _0x52b858=new winston[(_0x6853('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x6853('0x22'))][(_0x6853('0x23'))]({'name':util[_0x6853('0x12')](_0x6853('0x24'),_0x838462,_0x6853('0x25')),'filename':getLogFileName(_0x4beafc,_0x838462,_0x6853('0x25')),'level':_0x6853('0x25'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1016a9){return fileFormat(_0x838462,_0x1016a9);}}),new winston[(_0x6853('0x22'))]['File']({'name':util['format'](_0x6853('0x24'),_0x838462,debugLevel),'filename':getLogFileName(_0x4beafc,_0x838462,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2a0e1a){return fileFormat(_0x838462,_0x2a0e1a);}}),new winston[(_0x6853('0x22'))][(_0x6853('0x20'))]({'level':'warn','json':![],'formatter':function(_0x81afea){return fileFormat(_0x838462,_0x81afea);}})]});return _0x52b858;}exports[_0x6853('0x26')]=consoleLogger;exports[_0x6853('0x27')]=fileLogger; \ No newline at end of file +var _0x85b5=['level','toUpperCase','meta','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','error','%s-%s','consoleLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','white','bold\x20white','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','%s-%s.log','message','replace','{{{','}}}','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x388134,_0x54666c){var _0x54f337=function(_0x2c2654){while(--_0x2c2654){_0x388134['push'](_0x388134['shift']());}};_0x54f337(++_0x54666c);}(_0x85b5,0xe4));var _0x585b=function(_0x3305a0,_0x48300e){_0x3305a0=_0x3305a0-0x0;var _0x36378d=_0x85b5[_0x3305a0];return _0x36378d;};'use strict';var path=require(_0x585b('0x0'));var util=require(_0x585b('0x1'));var moment=require(_0x585b('0x2'));var winston=require(_0x585b('0x3'));var config=require(_0x585b('0x4'));var debugLevel=config[_0x585b('0x5')]?config['debugLevel'][_0x585b('0x6')]():_0x585b('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x585b('0x8'),'error':_0x585b('0x9'),'warn':'bold\x20yellow','info':_0x585b('0xa'),'print':_0x585b('0xb'),'success':'bold\x20green','http':_0x585b('0xc'),'verbose':_0x585b('0xd'),'debug':'bold\x20blue','silly':_0x585b('0xe')};winston[_0x585b('0xf')](XC_LOG_COLORS);function getLogFileName(_0x4c644e,_0x2404e9,_0x360773){var _0x230688=_0x4c644e||_0x585b('0x10');return path['join'](_0x230688,util['format'](_0x585b('0x11'),_0x2404e9,_0x360773));}function formatter(_0x41f11b,_0x48bb1f){_0x48bb1f[_0x585b('0x12')]=_0x48bb1f[_0x585b('0x12')][_0x585b('0x13')](/@@{/g,_0x585b('0x14'))[_0x585b('0x13')](/}@@/g,_0x585b('0x15'))[_0x585b('0x13')](/@{/g,'{{')[_0x585b('0x13')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x585b('0x16')](_0x585b('0x17')),_0x48bb1f[_0x585b('0x18')][_0x585b('0x19')](),_0x41f11b,_0x48bb1f[_0x585b('0x12')]);}function fileFormat(_0x56e4aa,_0x21718f){_0x21718f[_0x585b('0x12')]=_0x21718f[_0x585b('0x12')][_0x585b('0x13')](/@@{/g,_0x585b('0x14'))[_0x585b('0x13')](/}@@/g,_0x585b('0x15'))[_0x585b('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x3327b7=_0x21718f[_0x585b('0x1a')]&&Object['keys'](_0x21718f[_0x585b('0x1a')])['length']?'\x0a\x09'+JSON['stringify'](_0x21718f[_0x585b('0x1a')]):'';return util[_0x585b('0x16')](_0x585b('0x1b'),moment()[_0x585b('0x16')](_0x585b('0x17')),_0x21718f[_0x585b('0x18')]['toUpperCase'](),_0x56e4aa,_0x21718f[_0x585b('0x12')],_0x3327b7);}function consoleLogger(){var _0x3e8c6a=new winston[(_0x585b('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x585b('0x1d'))][(_0x585b('0x1e'))]({'level':_0x585b('0x1f'),'json':![],'formatter':function(_0x571efc){return formatter('',_0x571efc);}})]});return _0x3e8c6a;}function fileLogger(_0x2d5d6e,_0x513c15){var _0x588658=new winston[(_0x585b('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x585b('0x20'))]({'name':util['format']('%s-%s',_0x2d5d6e,_0x585b('0x21')),'filename':getLogFileName(_0x513c15,_0x2d5d6e,_0x585b('0x21')),'level':_0x585b('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x39ac7c){return fileFormat(_0x2d5d6e,_0x39ac7c);}}),new winston[(_0x585b('0x1d'))][(_0x585b('0x20'))]({'name':util[_0x585b('0x16')](_0x585b('0x22'),_0x2d5d6e,debugLevel),'filename':getLogFileName(_0x513c15,_0x2d5d6e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x395140){return fileFormat(_0x2d5d6e,_0x395140);}}),new winston[(_0x585b('0x1d'))][(_0x585b('0x1e'))]({'level':_0x585b('0x1f'),'json':![],'formatter':function(_0x1ad4f6){return fileFormat(_0x2d5d6e,_0x1ad4f6);}})]});return _0x588658;}exports[_0x585b('0x23')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index f4aabd7..928b66b 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['}@@','lodash','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isArray','length','isString','replace'];(function(_0x2635b1,_0x37d0ef){var _0x233356=function(_0x420b32){while(--_0x420b32){_0x2635b1['push'](_0x2635b1['shift']());}};_0x233356(++_0x37d0ef);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0x0b0e[_0x4a93bb];return _0x208468;};var _=require(_0xe0b0('0x0'));var sensitiveFields=['username',_0xe0b0('0x1'),'newPassword',_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5'),_0xe0b0('0x6'),_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'),'code','accessKey',_0xe0b0('0xd'),_0xe0b0('0xe'),_0xe0b0('0xf'),_0xe0b0('0x10'),'accessTokenSecret',_0xe0b0('0x11'),_0xe0b0('0x12'),'consumerSecret',_0xe0b0('0x13'),_0xe0b0('0x14'),'calleridnum',_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),'privateKey',_0xe0b0('0x18'),_0xe0b0('0x19'),_0xe0b0('0x1a'),_0xe0b0('0x1b'),_0xe0b0('0x1c'),'accountSid',_0xe0b0('0x1d'),_0xe0b0('0x1e'),_0xe0b0('0x1f'),_0xe0b0('0x20'),_0xe0b0('0x21')];function maskSensitiveData(_0x55d884){const _0x41a7e2=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x55d884)){for(const _0x35cb40 in _0x55d884){if(_[_0xe0b0('0x22')](_0x55d884[_0x35cb40])){for(let _0x519ae8=0x0;_0x519ae8<_0x55d884[_0x35cb40][_0xe0b0('0x23')];_0x519ae8++){maskSensitiveData(_0x55d884[_0x35cb40][_0x519ae8]);}}else if(_['isPlainObject'](_0x55d884[_0x35cb40])){maskSensitiveData(_0x55d884[_0x35cb40]);}else if(_[_0xe0b0('0x24')](_0x55d884[_0x35cb40])){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](/{{{/g,'@@{')['replace'](/}}}/g,_0xe0b0('0x26'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x35cb40)){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](_0x41a7e2,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0x140920,_0x5464db){var _0x436ed0=function(_0x56b784){while(--_0x56b784){_0x140920['push'](_0x140920['shift']());}};_0x436ed0(++_0x5464db);}(_0x2ef3,0xba));var _0x32ef=function(_0xedeb2a,_0x34f0bd){_0xedeb2a=_0xedeb2a-0x0;var _0x50e31e=_0x2ef3[_0xedeb2a];return _0x50e31e;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 9df97ff..84f3ed7 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','\x20}\x20}','string'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x2032,0xd9));var _0x2203=function(_0x322935,_0x523814){_0x322935=_0x322935-0x0;var _0x37ee34=_0x2032[_0x322935];return _0x37ee34;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2c2259){return _0x2c2259==='{{'?_0x2203('0x0'):_0x2203('0x1');}function safeTemplate(_0x4c28da){var _0x486390=_0x4c28da;if(typeof _0x4c28da===_0x2203('0x2')){_0x486390=_0x4c28da['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x2203('0x3')](_0x4c28da)){_0x486390=_0x4c28da[_0x2203('0x4')](function(_0x44ccfd){return safeTemplate(_0x44ccfd);});}else if(_[_0x2203('0x5')](_0x4c28da)){_0x486390=Object[_0x2203('0x6')](_0x4c28da)[_0x2203('0x7')](function(_0x2e0f63,_0x2676aa){_0x2e0f63[_0x2676aa]=safeTemplate(_0x4c28da[_0x2676aa]);return _0x2e0f63;},{});}return _0x486390;}module[_0x2203('0x8')][_0x2203('0x9')]=safeTemplate; \ No newline at end of file +var _0x955f=['map','isPlainObject','keys','reduce','exports','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x35a543,_0x116ec2){var _0x580757=function(_0x18c456){while(--_0x18c456){_0x35a543['push'](_0x35a543['shift']());}};_0x580757(++_0x116ec2);}(_0x955f,0x1eb));var _0xf955=function(_0x3f7b4a,_0x114b6e){_0x3f7b4a=_0x3f7b4a-0x0;var _0x4a3fbc=_0x955f[_0x3f7b4a];return _0x4a3fbc;};var _=require(_0xf955('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x471baa){return _0x471baa==='{{'?_0xf955('0x1'):_0xf955('0x2');}function safeTemplate(_0x2834f7){var _0x585f6e=_0x2834f7;if(typeof _0x2834f7===_0xf955('0x3')){_0x585f6e=_0x2834f7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x2834f7)){_0x585f6e=_0x2834f7[_0xf955('0x4')](function(_0x5a20bc){return safeTemplate(_0x5a20bc);});}else if(_[_0xf955('0x5')](_0x2834f7)){_0x585f6e=Object[_0xf955('0x6')](_0x2834f7)[_0xf955('0x7')](function(_0x59d5b3,_0x18432f){_0x59d5b3[_0x18432f]=safeTemplate(_0x2834f7[_0x18432f]);return _0x59d5b3;},{});}return _0x585f6e;}module[_0xf955('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file -- 1.7.1